aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/extras/Mesa
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-02-02 15:02:49 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-02-02 15:02:49 +0100
commitb16b9e4656e7199c2aec74a4c8ebc7a875d3ba73 (patch)
tree4361edef0d42d5bf5ac984ef72b4fac35426eae7 /nx-X11/extras/Mesa
parent0d5a83e986f39982c0924652a3662e60b1f23162 (diff)
downloadnx-libs-b16b9e4656e7199c2aec74a4c8ebc7a875d3ba73.tar.gz
nx-libs-b16b9e4656e7199c2aec74a4c8ebc7a875d3ba73.tar.bz2
nx-libs-b16b9e4656e7199c2aec74a4c8ebc7a875d3ba73.zip
massive reduction of unneeded files
Diffstat (limited to 'nx-X11/extras/Mesa')
-rw-r--r--nx-X11/extras/Mesa/Makefile451
-rw-r--r--nx-X11/extras/Mesa/Makefile.DJ93
-rw-r--r--nx-X11/extras/Mesa/Makefile.mgw88
-rw-r--r--nx-X11/extras/Mesa/README.XF8647
-rw-r--r--nx-X11/extras/Mesa/XOrg-Xlist15
-rwxr-xr-xnx-X11/extras/Mesa/bin/installmesa69
-rwxr-xr-xnx-X11/extras/Mesa/bin/mklib698
-rw-r--r--nx-X11/extras/Mesa/configs/aix28
-rw-r--r--nx-X11/extras/Mesa/configs/aix-6428
-rw-r--r--nx-X11/extras/Mesa/configs/aix-gcc19
-rw-r--r--nx-X11/extras/Mesa/configs/aix-static23
-rw-r--r--nx-X11/extras/Mesa/configs/beos99
-rw-r--r--nx-X11/extras/Mesa/configs/darwin29
-rw-r--r--nx-X11/extras/Mesa/configs/darwin-static24
-rw-r--r--nx-X11/extras/Mesa/configs/default74
-rw-r--r--nx-X11/extras/Mesa/configs/freebsd16
-rw-r--r--nx-X11/extras/Mesa/configs/freebsd-dri45
-rw-r--r--nx-X11/extras/Mesa/configs/freebsd-dri-amd649
-rw-r--r--nx-X11/extras/Mesa/configs/freebsd-dri-x8612
-rw-r--r--nx-X11/extras/Mesa/configs/hpux1014
-rw-r--r--nx-X11/extras/Mesa/configs/hpux10-gcc16
-rw-r--r--nx-X11/extras/Mesa/configs/hpux10-static30
-rw-r--r--nx-X11/extras/Mesa/configs/hpux11-3226
-rw-r--r--nx-X11/extras/Mesa/configs/hpux11-32-static26
-rw-r--r--nx-X11/extras/Mesa/configs/hpux11-32-static-nothreads26
-rw-r--r--nx-X11/extras/Mesa/configs/hpux11-6427
-rw-r--r--nx-X11/extras/Mesa/configs/hpux11-64-static27
-rw-r--r--nx-X11/extras/Mesa/configs/hpux916
-rw-r--r--nx-X11/extras/Mesa/configs/hpux9-gcc14
-rw-r--r--nx-X11/extras/Mesa/configs/irix6-6418
-rw-r--r--nx-X11/extras/Mesa/configs/irix6-64-static25
-rw-r--r--nx-X11/extras/Mesa/configs/irix6-n3218
-rw-r--r--nx-X11/extras/Mesa/configs/irix6-n32-static25
-rw-r--r--nx-X11/extras/Mesa/configs/irix6-o3219
-rw-r--r--nx-X11/extras/Mesa/configs/irix6-o32-static25
-rw-r--r--nx-X11/extras/Mesa/configs/linux33
-rw-r--r--nx-X11/extras/Mesa/configs/linux-alpha18
-rw-r--r--nx-X11/extras/Mesa/configs/linux-alpha-static27
-rw-r--r--nx-X11/extras/Mesa/configs/linux-debug8
-rw-r--r--nx-X11/extras/Mesa/configs/linux-directfb29
-rw-r--r--nx-X11/extras/Mesa/configs/linux-dri68
-rw-r--r--nx-X11/extras/Mesa/configs/linux-dri-ppc17
-rw-r--r--nx-X11/extras/Mesa/configs/linux-dri-x8616
-rw-r--r--nx-X11/extras/Mesa/configs/linux-dri-x86-6423
-rw-r--r--nx-X11/extras/Mesa/configs/linux-fbdev10
-rw-r--r--nx-X11/extras/Mesa/configs/linux-glide20
-rw-r--r--nx-X11/extras/Mesa/configs/linux-icc21
-rw-r--r--nx-X11/extras/Mesa/configs/linux-icc-static29
-rw-r--r--nx-X11/extras/Mesa/configs/linux-indirect49
-rw-r--r--nx-X11/extras/Mesa/configs/linux-osmesa1627
-rw-r--r--nx-X11/extras/Mesa/configs/linux-osmesa16-static28
-rw-r--r--nx-X11/extras/Mesa/configs/linux-osmesa3227
-rw-r--r--nx-X11/extras/Mesa/configs/linux-ppc9
-rw-r--r--nx-X11/extras/Mesa/configs/linux-ppc-static14
-rw-r--r--nx-X11/extras/Mesa/configs/linux-profile29
-rw-r--r--nx-X11/extras/Mesa/configs/linux-solo43
-rw-r--r--nx-X11/extras/Mesa/configs/linux-solo-ia647
-rw-r--r--nx-X11/extras/Mesa/configs/linux-solo-x8612
-rw-r--r--nx-X11/extras/Mesa/configs/linux-sparc30
-rw-r--r--nx-X11/extras/Mesa/configs/linux-sparc517
-rw-r--r--nx-X11/extras/Mesa/configs/linux-static21
-rw-r--r--nx-X11/extras/Mesa/configs/linux-tcc22
-rw-r--r--nx-X11/extras/Mesa/configs/linux-ultrasparc17
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x868
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-327
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-6413
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-64-debug7
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-64-static21
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-debug9
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-glide24
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-static21
-rw-r--r--nx-X11/extras/Mesa/configs/linux-x86-xcb24
-rw-r--r--nx-X11/extras/Mesa/configs/netbsd14
-rw-r--r--nx-X11/extras/Mesa/configs/openbsd18
-rw-r--r--nx-X11/extras/Mesa/configs/osf116
-rw-r--r--nx-X11/extras/Mesa/configs/solaris-x8618
-rw-r--r--nx-X11/extras/Mesa/configs/solaris-x86-gcc24
-rw-r--r--nx-X11/extras/Mesa/configs/sunos412
-rw-r--r--nx-X11/extras/Mesa/configs/sunos4-gcc15
-rw-r--r--nx-X11/extras/Mesa/configs/sunos4-static25
-rw-r--r--nx-X11/extras/Mesa/configs/sunos518
-rw-r--r--nx-X11/extras/Mesa/configs/sunos5-gcc35
-rw-r--r--nx-X11/extras/Mesa/configs/sunos5-smp19
-rw-r--r--nx-X11/extras/Mesa/configs/ultrix-gcc21
-rw-r--r--nx-X11/extras/Mesa/descrip.mms22
-rw-r--r--nx-X11/extras/Mesa/docs/COPYING490
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_agp_offset.spec95
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_copy_sub_buffer.spec88
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_pack_invert.spec138
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_packed_depth_stencil.spec231
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_pixmap_colormap.spec90
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_program_debug.spec357
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_release_buffers.spec85
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_resize_buffers.spec82
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_set_3dfx_mode.spec85
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_sprite_point.spec191
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_swap_control.spec132
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_swap_frame_usage.spec201
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_trace.spec360
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_window_pos.spec127
-rw-r--r--nx-X11/extras/Mesa/docs/MESA_ycbcr_texture.spec204
-rw-r--r--nx-X11/extras/Mesa/docs/MiniGLX.html547
-rw-r--r--nx-X11/extras/Mesa/docs/README.3DFX830
-rw-r--r--nx-X11/extras/Mesa/docs/README.AMIWIN181
-rw-r--r--nx-X11/extras/Mesa/docs/README.BEOS137
-rw-r--r--nx-X11/extras/Mesa/docs/README.CYGWIN256
-rw-r--r--nx-X11/extras/Mesa/docs/README.D3D124
-rw-r--r--nx-X11/extras/Mesa/docs/README.DJ275
-rw-r--r--nx-X11/extras/Mesa/docs/README.GGI26
-rw-r--r--nx-X11/extras/Mesa/docs/README.LYNXOS64
-rw-r--r--nx-X11/extras/Mesa/docs/README.MINGW3290
-rw-r--r--nx-X11/extras/Mesa/docs/README.MITS102
-rw-r--r--nx-X11/extras/Mesa/docs/README.NeXT6
-rw-r--r--nx-X11/extras/Mesa/docs/README.OS296
-rw-r--r--nx-X11/extras/Mesa/docs/README.OpenStep35
-rw-r--r--nx-X11/extras/Mesa/docs/README.QUAKE208
-rw-r--r--nx-X11/extras/Mesa/docs/README.THREADS52
-rw-r--r--nx-X11/extras/Mesa/docs/README.VMS32
-rw-r--r--nx-X11/extras/Mesa/docs/README.WIN32139
-rw-r--r--nx-X11/extras/Mesa/docs/README.WINDML146
-rw-r--r--nx-X11/extras/Mesa/docs/README.X11314
-rw-r--r--nx-X11/extras/Mesa/docs/README.directfb28
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.1146
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.212
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.2.132
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.3271
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.422
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.4.122
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.4.222
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-3.5228
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-4.0163
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-4.0.122
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-4.0.250
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-4.0.352
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-4.1308
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-5.085
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-5.0.146
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-5.0.246
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-5.1279
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.087
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.0.150
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.1112
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.252
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.2.150
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.3115
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.3.149
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.3.237
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.450
-rw-r--r--nx-X11/extras/Mesa/docs/RELNOTES-6.4.147
-rw-r--r--nx-X11/extras/Mesa/docs/VERSIONS1423
-rw-r--r--nx-X11/extras/Mesa/docs/banner.html27
-rw-r--r--nx-X11/extras/Mesa/docs/bugs.html49
-rw-r--r--nx-X11/extras/Mesa/docs/conform.html695
-rw-r--r--nx-X11/extras/Mesa/docs/contents.html101
-rw-r--r--nx-X11/extras/Mesa/docs/custom.html27
-rw-r--r--nx-X11/extras/Mesa/docs/cvs_access.html106
-rw-r--r--nx-X11/extras/Mesa/docs/cvs_branches.html80
-rw-r--r--nx-X11/extras/Mesa/docs/debugging.html38
-rw-r--r--nx-X11/extras/Mesa/docs/demos.html18
-rw-r--r--nx-X11/extras/Mesa/docs/devinfo.html206
-rw-r--r--nx-X11/extras/Mesa/docs/download.html130
-rw-r--r--nx-X11/extras/Mesa/docs/enums.txt42
-rw-r--r--nx-X11/extras/Mesa/docs/envvars.html44
-rw-r--r--nx-X11/extras/Mesa/docs/extensions.html34
-rw-r--r--nx-X11/extras/Mesa/docs/faq.html394
-rw-r--r--nx-X11/extras/Mesa/docs/fbdev-dri.html315
-rw-r--r--nx-X11/extras/Mesa/docs/games.html64
-rw-r--r--nx-X11/extras/Mesa/docs/gears.pngbin1608 -> 0 bytes
-rw-r--r--nx-X11/extras/Mesa/docs/glfbdev-driver.html90
-rw-r--r--nx-X11/extras/Mesa/docs/glu.html45
-rw-r--r--nx-X11/extras/Mesa/docs/helpwanted.html74
-rw-r--r--nx-X11/extras/Mesa/docs/index.html29
-rw-r--r--nx-X11/extras/Mesa/docs/install.html309
-rw-r--r--nx-X11/extras/Mesa/docs/intro.html306
-rw-r--r--nx-X11/extras/Mesa/docs/libraries.html57
-rw-r--r--nx-X11/extras/Mesa/docs/license.html86
-rw-r--r--nx-X11/extras/Mesa/docs/lists.html55
-rw-r--r--nx-X11/extras/Mesa/docs/mangling.html28
-rw-r--r--nx-X11/extras/Mesa/docs/mesa.css33
-rw-r--r--nx-X11/extras/Mesa/docs/modelers.html70
-rw-r--r--nx-X11/extras/Mesa/docs/news.html1136
-rw-r--r--nx-X11/extras/Mesa/docs/osmesa.html77
-rw-r--r--nx-X11/extras/Mesa/docs/pbuffers.html54
-rw-r--r--nx-X11/extras/Mesa/docs/perf.html68
-rw-r--r--nx-X11/extras/Mesa/docs/precompiled.html26
-rw-r--r--nx-X11/extras/Mesa/docs/relnotes.html45
-rw-r--r--nx-X11/extras/Mesa/docs/science.html72
-rw-r--r--nx-X11/extras/Mesa/docs/sourcedocs.html26
-rw-r--r--nx-X11/extras/Mesa/docs/subset-A.html3579
-rw-r--r--nx-X11/extras/Mesa/docs/subset.html33
-rw-r--r--nx-X11/extras/Mesa/docs/systems.html56
-rw-r--r--nx-X11/extras/Mesa/docs/thanks.html134
-rw-r--r--nx-X11/extras/Mesa/docs/utilities.html26
-rw-r--r--nx-X11/extras/Mesa/docs/utility.html44
-rw-r--r--nx-X11/extras/Mesa/docs/webmaster.html24
-rw-r--r--nx-X11/extras/Mesa/include/GL/Makefile.am43
-rw-r--r--nx-X11/extras/Mesa/include/GL/amesa.h65
-rw-r--r--nx-X11/extras/Mesa/include/GL/directfbgl.h89
-rw-r--r--nx-X11/extras/Mesa/include/GL/dmesa.h160
-rw-r--r--nx-X11/extras/Mesa/include/GL/foomesa.h76
-rw-r--r--nx-X11/extras/Mesa/include/GL/fxmesa.h103
-rw-r--r--nx-X11/extras/Mesa/include/GL/ggimesa.h85
-rw-r--r--nx-X11/extras/Mesa/include/GL/gl_mangle.h1472
-rw-r--r--nx-X11/extras/Mesa/include/GL/glfbdev.h148
-rw-r--r--nx-X11/extras/Mesa/include/GL/glu.h340
-rw-r--r--nx-X11/extras/Mesa/include/GL/glu_mangle.h86
-rw-r--r--nx-X11/extras/Mesa/include/GL/glut.h748
-rw-r--r--nx-X11/extras/Mesa/include/GL/glut_h.dja340
-rw-r--r--nx-X11/extras/Mesa/include/GL/glutf90.h81
-rw-r--r--nx-X11/extras/Mesa/include/GL/glx.h551
-rw-r--r--nx-X11/extras/Mesa/include/GL/glx_mangle.h55
-rw-r--r--nx-X11/extras/Mesa/include/GL/internal/dri_interface.h477
-rw-r--r--nx-X11/extras/Mesa/include/GL/internal/sarea.h94
-rw-r--r--nx-X11/extras/Mesa/include/GL/mesa_wgl.h123
-rw-r--r--nx-X11/extras/Mesa/include/GL/mglmesa.h79
-rw-r--r--nx-X11/extras/Mesa/include/GL/miniglx.h482
-rw-r--r--nx-X11/extras/Mesa/include/GL/svgamesa.h97
-rw-r--r--nx-X11/extras/Mesa/include/GL/uglglutshapes.h45
-rw-r--r--nx-X11/extras/Mesa/include/GL/uglmesa.h155
-rw-r--r--nx-X11/extras/Mesa/include/GL/vms_x_fix.h880
-rw-r--r--nx-X11/extras/Mesa/include/GL/wmesa.h142
-rw-r--r--nx-X11/extras/Mesa/include/GL/xmesa_x.h84
-rw-r--r--nx-X11/extras/Mesa/include/GLES/egl.h274
-rw-r--r--nx-X11/extras/Mesa/include/GLES/egltypes.h45
-rw-r--r--nx-X11/extras/Mesa/mms-config.23
-rw-r--r--nx-X11/extras/Mesa/src/Makefile34
-rw-r--r--nx-X11/extras/Mesa/src/descrip.mms43
-rw-r--r--nx-X11/extras/Mesa/src/glw/GLwDrawA.c684
-rw-r--r--nx-X11/extras/Mesa/src/glw/GLwDrawA.h195
-rw-r--r--nx-X11/extras/Mesa/src/glw/GLwDrawAP.h130
-rw-r--r--nx-X11/extras/Mesa/src/glw/GLwMDrawA.c41
-rw-r--r--nx-X11/extras/Mesa/src/glw/GLwMDrawA.h41
-rw-r--r--nx-X11/extras/Mesa/src/glw/GLwMDrawAP.h41
-rw-r--r--nx-X11/extras/Mesa/src/glw/Makefile52
-rw-r--r--nx-X11/extras/Mesa/src/glw/README56
-rw-r--r--nx-X11/extras/Mesa/src/glx/Makefile12
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/Makefile86
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/NOTES115
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/dispatch.c64
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/driver.h169
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/example.miniglx.conf36
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/miniglx.c2563
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/miniglxP.h205
-rw-r--r--nx-X11/extras/Mesa/src/glx/mini/miniglx_events.c978
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/Makefile94
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/XF86dri.c617
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/clientattrib.c141
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/dri_glx.c461
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/dri_glx.h61
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/eval.c132
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glx_pbuffer.c556
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glx_query.c102
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glx_texture_compression.c347
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glxclient.h690
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glxcmds.c2969
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glxext.c1864
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glxextensions.c717
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/glxextensions.h279
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect.c8472
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect.h707
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_init.c779
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_init.h42
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_transpose_matrix.c83
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_va_private.h308
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.c1847
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.h57
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_program.c276
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/indirect_window_pos.c98
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/packrender.h249
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/packsingle.h219
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/pixel.c443
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/pixelstore.c341
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/render2.c363
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/renderpix.c215
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/single2.c833
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/singlepix.c105
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/vertarr.c203
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/xf86dri.h122
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/xf86dristr.h343
-rw-r--r--nx-X11/extras/Mesa/src/glx/x11/xfont.c377
-rw-r--r--nx-X11/extras/Mesa/src/mesa/Makefile230
-rw-r--r--nx-X11/extras/Mesa/src/mesa/Makefile.DJ168
-rw-r--r--nx-X11/extras/Mesa/src/mesa/Makefile.mgw206
-rw-r--r--nx-X11/extras/Mesa/src/mesa/array_cache/descrip.mms37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/descrip.mms26
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/common/descrip.mms37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile34
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile.template109
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/depthtmp.h253
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.c1073
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.h555
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.c98
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/extension_helper.h5887
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c.NX.original497
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c.X.original496
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h17
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmio.h62
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmx.h560
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp.h328
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp2.h609
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp_common.h81
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/stenciltmp.h182
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.c1339
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.h327
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.c695
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.h119
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.c347
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.h69
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.c1002
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.h124
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool.h94
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/Makefile96
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/de.po231
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/es.po219
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/fr.po225
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py191
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/nl.po230
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/options.h462
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/t_options.h230
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Doxyfile232
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Makefile21
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_dri.c786
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_egl.c881
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/Makefile36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.c159
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.h8
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.c354
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.h9
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_context.h306
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.c119
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.c245
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.h8
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fifo.h28
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fog.c73
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.c111
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.h18
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_linetmp.h81
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lock.h37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.c93
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.h15
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_pointtmp.h55
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_rendertmp.h646
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.c135
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.h10
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.c1223
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.h13
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.c226
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.h8
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.c53
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.h34
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.c945
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.h26
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tritmp.h239
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.c209
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.h45
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vbtmp.h151
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c427
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h8
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.c753
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.h26
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_dac.h367
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_drishare.h48
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_regs.h509
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/Makefile35
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_client.h6185
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.c226
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h403
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_dd.c128
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_inithw.c551
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.c59
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.h84
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_macros.h324
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_regs.h659
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_render.c220
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.c147
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.h30
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_span.c313
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_state.c1730
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tex.c433
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texmem.c535
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texstate.c216
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.c659
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h497
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.c362
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.h60
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_xmesa.c266
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_common.h64
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_dri.h123
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/Makefile32
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810_3d_reg.h636
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.c572
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.h252
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.c511
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.h49
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810render.c173
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.c471
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.h99
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.c201
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.h14
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.c1025
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.h15
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c564
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.h78
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texmem.c183
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texstate.c746
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.c871
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.c489
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.h60
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_common.h192
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.c975
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.h128
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_reg.h992
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/Makefile31
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h677
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.c626
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.h327
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.c415
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.h48
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.c841
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.h105
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_render.c226
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.c557
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.h113
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.c427
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.c1707
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.h68
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.c700
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.h70
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texmem.c237
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texstate.c716
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.c1056
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.h37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_common.h288
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_dri.h140
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/Makefile47
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.c122
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.h215
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_metaops.c733
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_reg.h641
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_state.c1089
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_tex.c345
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texblend.c465
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texstate.c483
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_vtbl.c456
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.c181
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.h351
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_debug.c299
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c1065
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_metaops.c516
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.c466
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.h163
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_reg.h833
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_state.c954
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_tex.c182
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c668
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c922
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c353
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.c688
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.h123
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c712
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h519
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.c607
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.h66
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_pixel.c490
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_reg.h84
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_render.c240
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c511
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.h101
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.c379
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.h41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_state.c285
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.c831
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.h42
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.c920
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.h46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_common.h169
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_dri.h69
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/Makefile33
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.c338
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.h405
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.c135
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.c912
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.h148
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.c93
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.h104
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vb.c257
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h562
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_reg.h406
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.c553
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.h78
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.c231
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.h41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.c1216
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.h47
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.c610
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.h99
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texmem.c867
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texstate.c558
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.c1921
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.h43
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.c642
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.h77
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vbtmp.h770
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/server/mach64_dri.h126
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Doxyfile234
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Makefile34
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/README26
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texcombine.c672
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texstate.c902
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c1020
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.h155
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgacontext.h372
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.c98
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.c743
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.h111
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.c664
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaregs.h1395
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgarender.c172
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.c312
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.h40
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.c1237
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.c538
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatexmem.c278
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.c912
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.h52
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.c480
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.h66
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga.h115
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_bios.h143
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c1089
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.h113
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_macros.h118
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_reg.h484
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/Makefile32
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.c364
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.h269
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.c148
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.h41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.c813
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.h144
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.c123
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.h108
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.c547
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.h84
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.c368
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.h46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.c1261
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.c617
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.h85
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texmem.c301
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texobj.h68
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texstate.c648
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.c769
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.h48
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/pci_ids.h57
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128.h465
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.c1113
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.h103
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_macros.h135
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_reg.h1394
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_version.h60
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Doxyfile232
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Makefile62
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_cmdbuf.c423
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.c694
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.h995
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c966
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h215
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.c127
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.h107
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.c15
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.h44
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos_arrays.c530
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c492
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.h40
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_reg.h1454
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c1341
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.h8
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.c737
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.h106
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.c367
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.h46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.c2383
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.h67
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state_init.c798
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.c957
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.h76
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.c583
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.h69
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.c1183
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.h47
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texmem.c526
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texstate.c1468
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.c1227
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.h123
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_c.c1002
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_sse.c234
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_x86.c440
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S495
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/Makefile83
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/pixel_shader.h103
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_context.h822
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_ioctl.h204
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_reg.h1423
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_sanity.h7
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_state.h58
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tcl.h50
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tex.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.c655
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.h118
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.c453
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.h844
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_emit.h282
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fixed_pipelines.h294
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.c1090
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.h49
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog_swz.c1343
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.c774
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.h62
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.c561
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.h49
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_program.h151
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_reg.h1387
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_render.c726
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_shader.c112
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.c2321
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.h69
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.c1051
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texmem.c514
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.c270
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.h9
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texstate.c1465
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_vertexprog.c952
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.c312
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.h249
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c372
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.h53
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.c166
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.h122
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.c879
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.h112
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.c391
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.h46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.c245
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.h45
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/vertex_shader.h91
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/Makefile42
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_compat.c302
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.c630
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.h868
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.c1283
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.h217
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lighting.c682
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.c135
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.h108
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.c12
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.h44
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c604
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h284
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_verts.c367
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.c1070
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.h8
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c656
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h103
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.c346
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.h46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.c2295
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.h74
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state_init.c572
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c983
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.h69
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c489
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.h66
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c866
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.h50
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texmem.c404
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texstate.c1171
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c1093
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.h120
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c922
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c232
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c437
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S494
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon.h202
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.c1336
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.h116
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_egl.c978
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_macros.h129
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_reg.h2142
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/Makefile36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_common.h83
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.c258
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.h444
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dd.c108
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dri.h143
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_inithw.c79
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.c62
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.h99
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_macros.h229
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_regs.h367
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_render.c203
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.c99
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_span.c334
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_state.c888
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.c554
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.h28
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texmem.c582
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texstate.c300
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.c850
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.h11
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tritmp.h958
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.c339
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_xmesa.c362
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3virgetri.h383
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/Makefile30
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_3d_reg.h699
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_bci.h612
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_init.h168
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_xmesa.c1056
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagecontext.h331
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.c119
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.h32
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.c657
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.h203
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagerender.c370
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.c343
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.h137
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.c1765
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.h41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.c2133
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.h83
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.c1297
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.h49
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/server/savage_dri.h76
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/Makefile35
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_common.h63
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_dri.h85
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.c243
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.h44
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_clear.c451
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_common2.h140
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.c523
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.h440
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.c181
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.c156
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.h45
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_fog.c190
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.c76
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.h87
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_reg.h868
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.c468
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.h62
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.c237
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.h46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.c853
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.h54
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.c185
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.h37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.c484
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.h38
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_texstate.c672
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.c1071
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.h71
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tritmp.h70
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/BUGS64
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/Makefile37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S84
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h314
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/dri_glide.h60
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c471
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h28
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c1028
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.h1007
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.c322
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.h45
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_glide.h606
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.c90
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.h144
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.c689
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.h77
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c808
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.h50
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.c492
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.h73
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.c1427
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.h49
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.c1449
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.h61
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.c1914
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.h102
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.c994
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.h84
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.c2209
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.h44
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.c1293
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.h42
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.c353
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.h69
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h266
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/Makefile26
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.c472
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.h242
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dd.c127
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dri.h28
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_lock.h11
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_state.c555
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_tris.c1125
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_vb.c434
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/Makefile32
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via.h11
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.c1252
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.h78
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_driver.h309
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_priv.h70
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_regs.h197
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_3d_reg.h1652
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.c782
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.h412
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_drmclient.h29
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.c243
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.h42
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.c970
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.h135
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_memcpy.c138
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_render.c131
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.c491
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.h95
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.c289
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.h37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.c1550
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.c970
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.h41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_texcombine.c424
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.c1190
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.h35
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/Makefile89
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.c487
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.h12
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/fbdev/glfbdev.c861
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxapi.c951
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdd.c2197
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddspan.c663
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddtex.c1849
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdrv.h771
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.c2309
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.h382
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.c269
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.h228
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.c2217
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.h850
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtexman.c874
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtris.c1834
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvb.c838
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvbtmp.h369
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/osmesa/Makefile.win39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/osmesa/descrip.mms41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.c1333
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.def13
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/descrip.mms51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/fakeglx.c2886
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.c1348
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.h223
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.c180
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.h326
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.c377
-rw-r--r--nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.h41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/.cvsignore11
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/EXT_framebuffer_object.xml188
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/Makefile70
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/descrip.mms37
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/extension_helper.py316
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/glX_XML.py531
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/glX_doc.py280
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_common.py95
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_send.py1044
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_size.py705
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_API.dtd134
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_API.xml11485
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_SPARC_asm.py135
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_XML.py813
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_apitemp.py216
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_enums.py217
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_offsets.py105
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_procs.py155
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_table.py194
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_x86-64_asm.py316
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/gl_x86_asm.py240
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/license.py47
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/mesadef.py223
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/glapi/next_available_offset.sh39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/glapi/typeexpr.py288
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/Imakefile129
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/KNOWN_BUGS21
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/Makefile.ugl364
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/Makefile.win208
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h.NX.original24
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/context.c.NX.original1818
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/context.c.X.original1750
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/descrip.mms210
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/get_gen.py1200
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/mesa.def491
-rw-r--r--nx-X11/extras/Mesa/src/mesa/main/vsnprintf.c165
-rw-r--r--nx-X11/extras/Mesa/src/mesa/math/descrip.mms45
-rw-r--r--nx-X11/extras/Mesa/src/mesa/ppc/common_ppc.c88
-rw-r--r--nx-X11/extras/Mesa/src/mesa/ppc/common_ppc_features.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/arbprogram.syn2786
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/asmopcodes.reg78
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/descrip.mms83
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/grammar/descrip.mms41
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar.syn567
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.c64
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.h20
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/BaseTypes.h133
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/Common.h288
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/ConstantUnion.h50
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/InfoSink.h135
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeGlobals.h43
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeParseContext.h44
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/PoolAlloc.h346
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/ResourceLimits.h61
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/ShHandle.h177
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/Types.h297
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Include/intermediate.h516
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp2942
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp4354
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/InfoSink.cpp107
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.cpp948
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.h58
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp243
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp2110
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/MMap.h84
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.cpp1452
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.h143
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp349
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp91
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.h35
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.cpp98
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.h35
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ShaderLang.cpp607
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.cpp235
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.h320
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.l614
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.y2009
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang_tab.h260
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/intermOut.cpp496
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/localintermediate.h91
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/parseConst.cpp344
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.c768
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.h96
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/compile.h132
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c1037
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h119
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c76
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c185
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.c191
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.h89
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/parser.h126
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h84
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c789
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h118
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h115
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c318
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h145
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c462
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h122
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/unistd.h1
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp151
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.h47
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/osinclude.h78
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/ossource.cpp140
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/osinclude.h68
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/ossource.cpp119
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLang.h212
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLangExt.h57
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/slang/descrip.mms52
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_bin.c79
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_string.py55
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_common_builtin.gc1410
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_core.gc1565
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_fragment_builtin.gc366
-rw-r--r--nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_shader.syn1508
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_version.syn118
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_vertex_builtin.gc262
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.cpp144
-rwxr-xr-xnx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sources335
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/clip.S243
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/glapi_sparc.S1884
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/norm.S609
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/sparc.c177
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/sparc.h38
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/sparc_matrix.h170
-rw-r--r--nx-X11/extras/Mesa/src/mesa/sparc/xform.S1393
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast/NOTES55
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast/descrip.mms76
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast/s_fragprog_to_c.c822
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast/s_tcc.c189
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast_setup/NOTES65
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast_setup/descrip.mms39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_vb.h38
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl/NOTES102
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl/descrip.mms74
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/NOTES.imm112
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_capi.h419
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_napi.h226
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h570
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_tapi.h75
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h159
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vb.c204
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h268
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd.c58
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp.h1254
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp2.h914
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_rendertmp.h434
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_triemit.h164
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_tritmp.h833
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_unfilled.h212
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vb.c344
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vbtmp.h675
-rw-r--r--nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vertex.h78
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86-64/Makefile29
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86-64/calling_convention.txt50
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86-64/glapi_x86-64.S31002
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.c115
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.h32
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86-64/xform4.S458
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow.c92
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow_normal.S848
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform1.S433
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform2.S473
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform3.S557
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform4.S566
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/Makefile46
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/assyntax.h1746
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/clip_args.h60
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/common_x86.c448
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.S215
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.h60
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/common_x86_features.h68
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/common_x86_macros.h107
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/gen_matypes.c251
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/glapi_x86.S1155
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/mmx.h51
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/mmx_blend.S366
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/mmx_blendtmp.h114
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/norm_args.h58
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.S689
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.h56
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.c997
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.h223
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse.c123
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse.h39
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse_normal.S257
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse_xform1.S442
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse_xform2.S461
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse_xform3.S507
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/sse_xform4.S231
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/x86.c96
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/x86.h36
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/x86_cliptest.S403
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/x86_xform2.S570
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/x86_xform3.S640
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/x86_xform4.S673
-rw-r--r--nx-X11/extras/Mesa/src/mesa/x86/xform_args.h52
-rw-r--r--nx-X11/extras/Mesa/vms/analyze_map.com148
-rw-r--r--nx-X11/extras/Mesa/vms/xlib.opt2
-rw-r--r--nx-X11/extras/Mesa/vms/xlib_share.opt7
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/gdi/gdi.dsp141
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileDebug.txt82
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileRelease.txt82
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/glu/glu.dsp985
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsDebug.txt73
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsRelease.txt73
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/mesa.dsw74
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/mesa/mesa.dsp1350
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/mesa/osmesa/osmesa.dsp125
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/progs/demos/gears.dsp114
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/progs/glut/glut.dsp333
-rw-r--r--nx-X11/extras/Mesa/windows/VC6/progs/progs.dsw41
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/mesa/gdi/gdi.vcproj181
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/mesa/glu/glu.vcproj752
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/mesa/mesa.sln41
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/mesa/mesa/mesa.vcproj1084
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/mesa/osmesa/osmesa.vcproj168
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/progs/demos/gears.vcproj154
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/progs/glut/glut.vcproj322
-rw-r--r--nx-X11/extras/Mesa/windows/VC7/progs/progs.sln27
1104 files changed, 0 insertions, 447615 deletions
diff --git a/nx-X11/extras/Mesa/Makefile b/nx-X11/extras/Mesa/Makefile
deleted file mode 100644
index ea8d6fb98..000000000
--- a/nx-X11/extras/Mesa/Makefile
+++ /dev/null
@@ -1,451 +0,0 @@
-# Top-level Mesa makefile
-
-TOP = .
-
-SUBDIRS = src progs
-
-
-default: $(TOP)/configs/current
- @for dir in $(SUBDIRS) ; do \
- (cd $$dir ; $(MAKE)) || exit 1 ; \
- done
-
-
-doxygen:
- (cd doxygen ; make) ; \
-
-clean:
- @for dir in $(SUBDIRS) ; do \
- (cd $$dir ; $(MAKE) clean) ; \
- done
-
-
-realclean:
- touch $(TOP)/configs/current
- $(MAKE) clean
- -rm -rf lib*
- -rm -f $(TOP)/configs/current
- -rm -f `find . -name \*.o`
- -rm -f `find . -name \*.a`
- -rm -f `find . -name \*.so`
- -rm -f `find . -name depend`
-
-
-
-install:
- @echo "Installing"
- $(TOP)/bin/installmesa $(DESTDIR)
-
-# DirectFBGL module installation
-linux-directfb-install:
- cd src/mesa/drivers/directfb && $(MAKE) install
-
-# If there's no current configuration file
-$(TOP)/configs/current:
- @echo
- @echo
- @echo "Please choose a configuration from the following list:"
- @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS"
- @echo
- @echo "Then type 'make <config>' (ex: 'make linux-x86')"
- @echo "(ignore the following error message)"
- @exit 1
-
-
-# Rules to set/install a specific build configuration
-aix \
-aix-64 \
-aix-gcc \
-aix-static \
-beos \
-darwin \
-darwin-static \
-freebsd \
-freebsd-dri \
-freebsd-dri-amd64 \
-freebsd-dri-x86 \
-hpux10 \
-hpux10-gcc \
-hpux10-static \
-hpux11-32 \
-hpux11-32-static \
-hpux11-32-static-nothreads \
-hpux11-64 \
-hpux11-64-static \
-hpux9 \
-hpux9-gcc \
-irix6-64 \
-irix6-64-static \
-irix6-n32 \
-irix6-n32-static \
-irix6-o32 \
-irix6-o32-static \
-linux \
-linux-alpha \
-linux-alpha-static \
-linux-debug \
-linux-directfb \
-linux-dri \
-linux-dri-x86 \
-linux-dri-x86-64 \
-linux-dri-ppc \
-linux-indirect \
-linux-fbdev \
-linux-glide \
-linux-icc \
-linux-icc-static \
-linux-osmesa16 \
-linux-osmesa16-static \
-linux-osmesa32 \
-linux-ppc \
-linux-ppc-static \
-linux-solo \
-linux-solo-x86 \
-linux-solo-ia64 \
-linux-sparc \
-linux-sparc5 \
-linux-static \
-linux-ultrasparc \
-linux-tcc \
-linux-x86 \
-linux-x86-debug \
-linux-x86-32 \
-linux-x86-64 \
-linux-x86-64-debug \
-linux-x86-64-static \
-linux-x86-xcb \
-linux-x86-glide \
-linux-x86-static \
-netbsd \
-openbsd \
-osf1 \
-solaris-x86 \
-solaris-x86-gcc \
-sunos4 \
-sunos4-gcc \
-sunos4-static \
-sunos5 \
-sunos5-gcc \
-sunos5-smp \
-ultrix-gcc:
- (cd configs && rm -f current && ln -s $@ current)
- $(MAKE) default
-
-
-# Rules for making release tarballs
-
-DIRECTORY = Mesa-6.4.1
-LIB_NAME = MesaLib-6.4.1
-DEMO_NAME = MesaDemos-6.4.1
-GLUT_NAME = MesaGLUT-6.4.1
-
-MAIN_FILES = \
- $(DIRECTORY)/Makefile* \
- $(DIRECTORY)/descrip.mms \
- $(DIRECTORY)/mms-config. \
- $(DIRECTORY)/bin/mklib \
- $(DIRECTORY)/bin/installmesa \
- $(DIRECTORY)/configs/[a-z]* \
- $(DIRECTORY)/docs/*.html \
- $(DIRECTORY)/docs/COPYING \
- $(DIRECTORY)/docs/README.* \
- $(DIRECTORY)/docs/RELNOTES* \
- $(DIRECTORY)/docs/VERSIONS \
- $(DIRECTORY)/docs/*.spec \
- $(DIRECTORY)/include/GL/internal/glcore.h \
- $(DIRECTORY)/include/GL/amesa.h \
- $(DIRECTORY)/include/GL/dmesa.h \
- $(DIRECTORY)/include/GL/directfbgl.h \
- $(DIRECTORY)/include/GL/fxmesa.h \
- $(DIRECTORY)/include/GL/ggimesa.h \
- $(DIRECTORY)/include/GL/gl.h \
- $(DIRECTORY)/include/GL/glext.h \
- $(DIRECTORY)/include/GL/gl_mangle.h \
- $(DIRECTORY)/include/GL/glu.h \
- $(DIRECTORY)/include/GL/glu_mangle.h \
- $(DIRECTORY)/include/GL/glx.h \
- $(DIRECTORY)/include/GL/glxext.h \
- $(DIRECTORY)/include/GL/glx_mangle.h \
- $(DIRECTORY)/include/GL/mesa_wgl.h \
- $(DIRECTORY)/include/GL/mglmesa.h \
- $(DIRECTORY)/include/GL/osmesa.h \
- $(DIRECTORY)/include/GL/svgamesa.h \
- $(DIRECTORY)/include/GL/ugl*.h \
- $(DIRECTORY)/include/GL/vms_x_fix.h \
- $(DIRECTORY)/include/GL/wmesa.h \
- $(DIRECTORY)/include/GL/xmesa.h \
- $(DIRECTORY)/include/GL/xmesa_x.h \
- $(DIRECTORY)/include/GL/xmesa_xf86.h \
- $(DIRECTORY)/include/GLView.h \
- $(DIRECTORY)/src/Makefile \
- $(DIRECTORY)/src/descrip.mms \
- $(DIRECTORY)/src/mesa/Makefile* \
- $(DIRECTORY)/src/mesa/sources \
- $(DIRECTORY)/src/mesa/descrip.mms \
- $(DIRECTORY)/src/mesa/depend \
- $(DIRECTORY)/src/mesa/main/*.[chS] \
- $(DIRECTORY)/src/mesa/main/descrip.mms \
- $(DIRECTORY)/src/mesa/glapi/*.[chS] \
- $(DIRECTORY)/src/mesa/glapi/descrip.mms \
- $(DIRECTORY)/src/mesa/array_cache/*.[ch] \
- $(DIRECTORY)/src/mesa/array_cache/descrip.mms \
- $(DIRECTORY)/src/mesa/math/*.[ch] \
- $(DIRECTORY)/src/mesa/math/descrip.mms \
- $(DIRECTORY)/src/mesa/shader/*.[ch] \
- $(DIRECTORY)/src/mesa/shader/descrip.mms \
- $(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \
- $(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \
- $(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
- $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
- $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
- $(DIRECTORY)/src/mesa/swrast/*.[ch] \
- $(DIRECTORY)/src/mesa/swrast/descrip.mms \
- $(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
- $(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
- $(DIRECTORY)/src/mesa/tnl/*.[chS] \
- $(DIRECTORY)/src/mesa/tnl/descrip.mms \
- $(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
- $(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
- $(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
- $(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
- $(DIRECTORY)/src/mesa/drivers/beos/Makefile \
- $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
- $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
- $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \
- $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
- $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \
- $(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \
- $(DIRECTORY)/src/mesa/drivers/ggi/default/genkgi.conf.in \
- $(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \
- $(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \
- $(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \
- $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
- $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
- $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
- $(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
- $(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
- $(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
- $(DIRECTORY)/src/mesa/ppc/*.[ch] \
- $(DIRECTORY)/src/mesa/sparc/*.[chS] \
- $(DIRECTORY)/src/mesa/x86/Makefile \
- $(DIRECTORY)/src/mesa/x86/*.[ch] \
- $(DIRECTORY)/src/mesa/x86/*.S \
- $(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
- $(DIRECTORY)/src/mesa/x86-64/*.[chS] \
- $(DIRECTORY)/src/mesa/x86-64/Makefile \
- $(DIRECTORY)/progs/Makefile \
- $(DIRECTORY)/progs/util/README \
- $(DIRECTORY)/progs/util/*.[ch] \
- $(DIRECTORY)/progs/util/sampleMakefile \
- $(DIRECTORY)/vms/analyze_map.com \
- $(DIRECTORY)/vms/xlib.opt \
- $(DIRECTORY)/vms/xlib_share.opt \
- $(DIRECTORY)/windows/VC6/mesa/gdi/gdi.dsp \
- $(DIRECTORY)/windows/VC6/mesa/glu/*.txt \
- $(DIRECTORY)/windows/VC6/mesa/glu/glu.dsp \
- $(DIRECTORY)/windows/VC6/mesa/mesa.dsw \
- $(DIRECTORY)/windows/VC6/mesa/mesa/mesa.dsp \
- $(DIRECTORY)/windows/VC6/mesa/osmesa/osmesa.dsp \
- $(DIRECTORY)/windows/VC7/mesa/gdi/gdi.vcproj \
- $(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
- $(DIRECTORY)/windows/VC7/mesa/mesa.sln \
- $(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
- $(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
-
-DRI_FILES = \
- $(DIRECTORY)/include/GL/internal/dri_interface.h \
- $(DIRECTORY)/include/GL/internal/sarea.h \
- $(DIRECTORY)/src/glx/Makefile \
- $(DIRECTORY)/src/glx/x11/Makefile \
- $(DIRECTORY)/src/glx/x11/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/dri/Makefile \
- $(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
- $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
- $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
- $(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
- $(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
- $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
- $(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
-
-SGI_GLU_FILES = \
- $(DIRECTORY)/src/glu/Makefile \
- $(DIRECTORY)/src/glu/descrip.mms \
- $(DIRECTORY)/src/glu/sgi/Makefile \
- $(DIRECTORY)/src/glu/sgi/Makefile.win \
- $(DIRECTORY)/src/glu/sgi/Makefile.DJ \
- $(DIRECTORY)/src/glu/sgi/glu.def \
- $(DIRECTORY)/src/glu/sgi/dummy.cc \
- $(DIRECTORY)/src/glu/sgi/descrip.mms \
- $(DIRECTORY)/src/glu/sgi/mesaglu.opt \
- $(DIRECTORY)/src/glu/sgi/include/gluos.h \
- $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
- $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
- $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
- $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
- $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
- $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
- $(DIRECTORY)/src/glu/sgi/libtess/README \
- $(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
- $(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
- $(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
-
-MESA_GLU_FILES = \
- $(DIRECTORY)/src/glu/mesa/README[12] \
- $(DIRECTORY)/src/glu/mesa/Makefile* \
- $(DIRECTORY)/src/glu/mesa/descrip.mms \
- $(DIRECTORY)/src/glu/mesa/mms_depend \
- $(DIRECTORY)/src/glu/mesa/*.def \
- $(DIRECTORY)/src/glu/mesa/depend \
- $(DIRECTORY)/src/glu/mesa/*.[ch]
-
-GLW_FILES = \
- $(DIRECTORY)/src/glw/*.[ch] \
- $(DIRECTORY)/src/glw/Makefile* \
- $(DIRECTORY)/src/glw/README \
- $(DIRECTORY)/src/glw/depend
-
-DEMO_FILES = \
- $(DIRECTORY)/progs/beos/*.cpp \
- $(DIRECTORY)/progs/beos/Makefile \
- $(DIRECTORY)/progs/images/*.rgb \
- $(DIRECTORY)/progs/images/*.rgba \
- $(DIRECTORY)/progs/demos/Makefile* \
- $(DIRECTORY)/progs/demos/descrip.mms \
- $(DIRECTORY)/progs/demos/*.[ch] \
- $(DIRECTORY)/progs/demos/*.cxx \
- $(DIRECTORY)/progs/demos/*.dat \
- $(DIRECTORY)/progs/demos/README \
- $(DIRECTORY)/progs/osdemos/Makefile \
- $(DIRECTORY)/progs/osdemos/*.c \
- $(DIRECTORY)/progs/xdemos/Makefile* \
- $(DIRECTORY)/progs/xdemos/descrip.mms \
- $(DIRECTORY)/progs/xdemos/*.[chf] \
- $(DIRECTORY)/progs/redbook/Makefile* \
- $(DIRECTORY)/progs/redbook/README \
- $(DIRECTORY)/progs/redbook/*.[ch] \
- $(DIRECTORY)/progs/samples/Makefile* \
- $(DIRECTORY)/progs/samples/README \
- $(DIRECTORY)/progs/samples/*.c \
- $(DIRECTORY)/progs/windml/Makefile.ugl \
- $(DIRECTORY)/progs/windml/*.c \
- $(DIRECTORY)/progs/windml/*.bmp \
- $(DIRECTORY)/progs/ggi/*.c \
- $(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
- $(DIRECTORY)/windows/VC6/progs/progs.dsw \
- $(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
- $(DIRECTORY)/windows/VC7/progs/progs.sln
-
-GLUT_FILES = \
- $(DIRECTORY)/include/GL/glut.h \
- $(DIRECTORY)/include/GL/glutf90.h \
- $(DIRECTORY)/src/glut/glx/Makefile* \
- $(DIRECTORY)/src/glut/glx/depend \
- $(DIRECTORY)/src/glut/glx/*def \
- $(DIRECTORY)/src/glut/glx/descrip.mms \
- $(DIRECTORY)/src/glut/glx/mms_depend \
- $(DIRECTORY)/src/glut/glx/*.[ch] \
- $(DIRECTORY)/src/glut/beos/*.[ch] \
- $(DIRECTORY)/src/glut/beos/*.cpp \
- $(DIRECTORY)/src/glut/beos/Makefile \
- $(DIRECTORY)/src/glut/dos/*.[ch] \
- $(DIRECTORY)/src/glut/dos/Makefile.DJ \
- $(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \
- $(DIRECTORY)/src/glut/ggi/*.[ch] \
- $(DIRECTORY)/src/glut/ggi/Makefile \
- $(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
- $(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj
-
-DEPEND_FILES = \
- $(TOP)/src/mesa/depend \
- $(TOP)/src/glw/depend \
- $(TOP)/src/glut/glx/depend \
- $(TOP)/src/glu/sgi/depend
-
-
-LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES)
-
-
-# Everything for new a Mesa release:
-tarballs: rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5
-
-
-rm_depend:
- @for dep in $(DEPEND_FILES) ; do \
- rm -f $$dep ; \
- touch $$dep ; \
- done
-
-lib_gz:
- rm -f configs/current ; \
- cd .. ; \
- tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
- gzip $(LIB_NAME).tar ; \
- mv $(LIB_NAME).tar.gz $(DIRECTORY)
-
-demo_gz:
- cd .. ; \
- tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
- gzip $(DEMO_NAME).tar ; \
- mv $(DEMO_NAME).tar.gz $(DIRECTORY)
-
-glut_gz:
- cd .. ; \
- tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
- gzip $(GLUT_NAME).tar ; \
- mv $(GLUT_NAME).tar.gz $(DIRECTORY)
-
-lib_bz2:
- rm -f configs/current ; \
- cd .. ; \
- tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
- bzip2 $(LIB_NAME).tar ; \
- mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
-
-demo_bz2:
- cd .. ; \
- tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
- bzip2 $(DEMO_NAME).tar ; \
- mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
-
-glut_bz2:
- cd .. ; \
- tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
- bzip2 $(GLUT_NAME).tar ; \
- mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
-
-lib_zip:
- rm -f configs/current ; \
- rm -f $(LIB_NAME).zip ; \
- cd .. ; \
- zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
- mv $(LIB_NAME).zip $(DIRECTORY)
-
-demo_zip:
- rm -f $(DEMO_NAME).zip ; \
- cd .. ; \
- zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \
- mv $(DEMO_NAME).zip $(DIRECTORY)
-
-glut_zip:
- rm -f $(GLUT_NAME).zip ; \
- cd .. ; \
- zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
- mv $(GLUT_NAME).zip $(DIRECTORY)
-
-md5:
- @-md5sum $(LIB_NAME).tar.gz
- @-md5sum $(LIB_NAME).tar.bz2
- @-md5sum $(LIB_NAME).zip
- @-md5sum $(DEMO_NAME).tar.gz
- @-md5sum $(DEMO_NAME).tar.bz2
- @-md5sum $(DEMO_NAME).zip
- @-md5sum $(GLUT_NAME).tar.gz
- @-md5sum $(GLUT_NAME).tar.bz2
- @-md5sum $(GLUT_NAME).zip
diff --git a/nx-X11/extras/Mesa/Makefile.DJ b/nx-X11/extras/Mesa/Makefile.DJ
deleted file mode 100644
index 78ebf43ef..000000000
--- a/nx-X11/extras/Mesa/Makefile.DJ
+++ /dev/null
@@ -1,93 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 4.0
-#
-# Copyright (C) 1999 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# DOS/DJGPP makefile v1.6 for Mesa
-#
-# Copyright (C) 2002 - Daniel Borca
-# Email : dborca@users.sourceforge.net
-# Web : http://www.geocities.com/dborca
-
-
-#
-# Available options:
-#
-# Environment variables:
-# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
-# or `mesa'.
-# default = mesa
-# GLIDE path to Glide3 SDK; used with FX.
-# default = $(TOP)/glide3
-# FX=1 build for 3dfx Glide3. Note that this disables
-# compilation of most DMesa code and requires fxMesa.
-# As a consequence, you'll need the DJGPP Glide3
-# library to build any application.
-# default = no
-# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
-# default = no
-#
-# Targets:
-# all: build everything
-# libgl: build GL
-# libglu: build GLU
-# libglut: build GLUT
-# clean: remove object files
-# realclean: remove all generated files
-#
-
-
-
-.PHONY : all libgl libglu libglut clean realclean
-
-GLU ?= mesa
-
-CFLAGS = -Wall -W -pedantic
-CFLAGS += -O2 -ffast-math
-
-export CFLAGS
-
-ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
-UNLINK = del $(subst /,\,$(1))
-else
-UNLINK = $(RM) $(1)
-endif
-
-all: libgl libglu libglut
-
-libgl: lib
- $(MAKE) -f Makefile.DJ -C src/mesa
-libglu: lib
- $(MAKE) -f Makefile.DJ -C src/glu/$(GLU)
-libglut: lib
- $(MAKE) -f Makefile.DJ -C src/glut/dos
-
-lib:
- mkdir lib
-
-clean:
- $(MAKE) -f Makefile.DJ clean -C src/mesa
- $(MAKE) -f Makefile.DJ clean -C src/glu/mesa
- $(MAKE) -f Makefile.DJ clean -C src/glu/sgi
- $(MAKE) -f Makefile.DJ clean -C src/glut/dos
-
-realclean: clean
- -$(call UNLINK,lib/*.a)
- -$(call UNLINK,lib/*.dxe)
diff --git a/nx-X11/extras/Mesa/Makefile.mgw b/nx-X11/extras/Mesa/Makefile.mgw
deleted file mode 100644
index 70c264a8d..000000000
--- a/nx-X11/extras/Mesa/Makefile.mgw
+++ /dev/null
@@ -1,88 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 4.0
-#
-# Copyright (C) 1999 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# MinGW makefile v1.2 for Mesa
-#
-# Copyright (C) 2002 - Daniel Borca
-# Email : dborca@users.sourceforge.net
-# Web : http://www.geocities.com/dborca
-
-
-#
-# Available options:
-#
-# Environment variables:
-# GLIDE path to Glide3 SDK; used with FX.
-# default = $(TOP)/glide3
-# FX=1 build for 3dfx Glide3. Note that this disables
-# compilation of most WMesa code and requires fxMesa.
-# As a consequence, you'll need the Win32 Glide3
-# library to build any application.
-# default = no
-# ICD=1 build the installable client driver interface
-# (windows opengl driver interface)
-# default = no
-# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
-# default = no
-#
-# Targets:
-# all: build everything
-# libgl: build GL
-# clean: remove object files
-# realclean: remove all generated files
-#
-
-
-
-.PHONY : all libgl clean realclean
-
-ifeq ($(ICD),1)
- # when -std=c99 mingw will not define WIN32
- CFLAGS = -Wall -W -Werror
-else
- # I love c89
- CFLAGS = -Wall -W -pedantic
-endif
-CFLAGS += -O2 -ffast-math
-
-export CFLAGS
-
-ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
-UNLINK = del $(subst /,\,$(1))
-else
-UNLINK = $(RM) $(1)
-endif
-
-all: libgl
-
-libgl: lib
- $(MAKE) -f Makefile.mgw -C src/mesa
-
-lib:
- mkdir lib
-
-clean:
- $(MAKE) -f Makefile.mgw clean -C src/mesa
-
-realclean: clean
- -$(call UNLINK,lib/*.a)
- -$(call UNLINK,lib/*.dll)
diff --git a/nx-X11/extras/Mesa/README.XF86 b/nx-X11/extras/Mesa/README.XF86
deleted file mode 100644
index 7d2c1af31..000000000
--- a/nx-X11/extras/Mesa/README.XF86
+++ /dev/null
@@ -1,47 +0,0 @@
-Importing Mesa.
-
-Mesa should be imported from a tree checked out from the Mesa CVS
-repository (:pserver:anonymous@cvs.mesa3d.sourceforge.net:/cvsroot/mesa3d).
-
-Instructions for importing a tagged Mesa release X.Y.
-
-1. Check out the release version from the Mesa CVS repository:
-
- % cvs -d :pserver:anonymous@cvs.freedesktop.org:/cvsroot/mesa \
- co -r mesa_X_Y Mesa
-
-2. Remove the CVSROOT directory:
-
- % cd Mesa
- % rm -fr CVSROOT
-
-3. Remove the CVS admin directories:
-
- % find . -name CVS -print | xargs rm -fr
-
-4. Import:
-
- % cvs import -m "Mesa version X.Y" xc/extras/Mesa MESA MESA-X_Y
-
-5. Merge:
-
- % cvs co -j MESA_PREV -j MESA-X_Y xc/extras/Mesa
-
- resolve conflicts, and commit.
-
-6. Check for new files that are GPL'd or which were in directories
- previously removed. Remove them from the main branch.
-
-
-
-
-When importing a snapshot of a Mesa (stable) branch, do everything as above,
-except check out the branch with:
-
- % cvs -d :pserver:anonymous@cvs.freedesktop.org:/cvsroot/mesa \
- co -r mesa_X_Y_branch Mesa
-
-and import with the tag MESA-X_Y-yyyymmdd indicating the date of the snapshot.
-
-
-$XFree86: xc/extras/Mesa/README.XF86,v 1.1 2000/11/30 15:46:25 dawes Exp $
diff --git a/nx-X11/extras/Mesa/XOrg-Xlist b/nx-X11/extras/Mesa/XOrg-Xlist
deleted file mode 100644
index 76661f525..000000000
--- a/nx-X11/extras/Mesa/XOrg-Xlist
+++ /dev/null
@@ -1,15 +0,0 @@
-include/GLView.h
-src/egl
-src/glu
-src/glut
-src/glw/boilerplate.c
-src/mesa/drivers/allegro
-src/mesa/drivers/beos
-src/mesa/drivers/d3d
-src/mesa/drivers/directfb
-src/mesa/drivers/dos
-src/mesa/drivers/ggi
-src/mesa/drivers/svga
-src/mesa/drivers/windows
-progs
-doxygen
diff --git a/nx-X11/extras/Mesa/bin/installmesa b/nx-X11/extras/Mesa/bin/installmesa
deleted file mode 100755
index 0bfce33c7..000000000
--- a/nx-X11/extras/Mesa/bin/installmesa
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-#
-# Simple shell script for installing Mesa's header and library files.
-# If the copy commands below don't work on a particular system (i.e. the
-# -f or -d flags), we may need to branch on `uname` to do the right thing.
-#
-
-
-TOP=.
-
-INCLUDE_DIR="/usr/local/include"
-LIB_DIR="/usr/local/lib"
-
-if [ "x$#" = "x0" ] ; then
-echo
-echo "***** Mesa installation - You may need root privileges to do this *****"
-echo
-echo "Default directory for header files is:" ${INCLUDE_DIR}
-echo "Enter new directory or press <Enter> to accept this default."
-
-read INPUT
-if [ "x${INPUT}" != "x" ] ; then
- INCLUDE_DIR=${INPUT}
-fi
-
-echo
-echo "Default directory for library files is:" ${LIB_DIR}
-echo "Enter new directory or press <Enter> to accept this default."
-
-read INPUT
-if [ "x${INPUT}" != "x" ] ; then
- LIB_DIR=${INPUT}
-fi
-
-echo
-echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL
-echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR}
-echo "Press <Enter> to continue, or <ctrl>-C to abort."
-
-read INPUT
-
-else
-INCLUDE_DIR=$1/include
-LIB_DIR=$1/lib
-fi
-
-# flags:
-# -f = force
-# -d = preserve symlinks (does not work on BSD)
-
-if [ `uname` = "FreeBSD" ] ; then
- CP_FLAGS="-f"
-else
- CP_FLAGS="-fd"
-fi
-
-
-set -v
-
-mkdir ${INCLUDE_DIR}
-mkdir ${INCLUDE_DIR}/GL
-mkdir ${INCLUDE_DIR}/GLES
-mkdir ${LIB_DIR}
-cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
-# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
-cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
-
-echo "Done."
diff --git a/nx-X11/extras/Mesa/bin/mklib b/nx-X11/extras/Mesa/bin/mklib
deleted file mode 100755
index 58c4fa705..000000000
--- a/nx-X11/extras/Mesa/bin/mklib
+++ /dev/null
@@ -1,698 +0,0 @@
-#!/bin/sh
-
-# Make a shared library.
-# This script should be useful for projects other than Mesa.
-# Improvements/fixes are welcome.
-
-
-# Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-#
-# Option defaults
-#
-LIBNAME=""
-MAJOR=1
-MINOR=0
-PATCH=""
-DEPS=""
-LINK=""
-CPLUSPLUS=0
-STATIC=0
-INSTALLDIR="."
-ARCH="auto"
-ARCHOPT=""
-NOPREFIX=0
-EXPORTS=""
-
-
-#
-# Parse arguments
-#
-while true
-do
- case $1 in
- '-h' | '--help')
- echo 'Usage: mklib [options] objects'
- echo 'Create a shared library from object files.'
- echo ' -o LIBRARY specifies the name of the resulting library, without'
- echo ' the leading "lib" or any suffix.'
- echo ' (eg: "-o GL" might result in "libGL.so" being made)'
- echo ' -major N specifies major version number (default is 1)'
- echo ' -minor N specifies minor version number (default is 0)'
- echo ' -patch N specifies patch version number (default is 0)'
- echo ' -lLIBRARY specifies a dependency on LIBRARY'
- echo ' -LDIR search in DIR for library dependencies'
- echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
- echo ' Not observed on all systems at this time.'
- echo ' -cplusplus link with C++ runtime'
- echo ' -static make a static library (default is dynamic/shared)'
- echo ' -install DIR put resulting library file(s) in DIR'
- echo ' -arch ARCH override using `uname` to determine host system'
- echo ' -archopt OPT specify an extra achitecture-specific option OPT'
- echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
- echo ' -exports FILE only export the symbols listed in FILE'
- echo ' -h, --help display this information and exit'
- exit 1
- ;;
- '-o')
- shift 1;
- LIBNAME=$1
- ;;
- '-major')
- shift 1;
- MAJOR=$1
- ;;
- '-minor')
- shift 1;
- MINOR=$1
- ;;
- '-patch')
- shift 1;
- PATCH=$1
- ;;
- '-linker')
- shift 1;
- LINK=$1
- ;;
- -l*)
- DEPS="$DEPS $1"
- ;;
- -L*)
- DEPS="$DEPS $1"
- ;;
- '-cplusplus')
- CPLUSPLUS=1
- ;;
- '-static')
- STATIC=1
- ;;
- '-install')
- shift 1;
- INSTALLDIR=$1
- ;;
- '-arch')
- shift 1;
- ARCH=$1
- ;;
- '-archopt')
- shift 1;
- ARCHOPT=$1
- ;;
- '-noprefix')
- NOPREFIX=1
- ;;
- '-exports')
- shift 1;
- EXPORTS=$1
- ;;
- -*)
- echo "mklib: Unknown option: " $1 ;
- exit 1
- ;;
- *)
- # This should be the first object file, stop parsing
- break
- esac
- shift 1
-done
-OBJECTS=$@
-
-
-if [ ${ARCH} = "auto" ] ; then
- ARCH=`uname`
-fi
-
-
-#
-# Error checking
-#
-if [ "x${LIBNAME}" = "x" ] ; then
- echo "mklib: Error: no library name specified"
- exit 1
-fi
-if [ "x${OBJECTS}" = "x" ] ; then
- echo "mklib: Error: no object files specified"
- exit 1
-fi
-
-
-#
-# Debugging info
-#
-if [ ] ; then
- echo "-----------------"
- echo ARCH is $ARCH
- echo LIBNAME is $LIBNAME
- echo MAJOR is $MAJOR
- echo MINOR is $MINOR
- echo PATCH is $PATCH
- echo DEPS are $DEPS
- echo "EXPORTS in" $EXPORTS
- echo "-----------------"
-fi
-
-
-#
-# OK, make the library now
-#
-case $ARCH in
-
- 'Linux' | 'OpenBSD')
- # we assume gcc
-
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified so set default link command now
- if [ $CPLUSPLUS = 1 ] ; then
- LINK=g++
- else
- LINK=gcc
- fi
- fi
-
- if [ $NOPREFIX = 1 ] ; then
- # No "lib" or ".so" part
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
- #OPTS="-shared -Wl,-soname,${LIBNAME}" # soname???
- OPTS="-shared"
-
- # Check if objects are 32-bit and we're running in 64-bit
- # environment. If so, pass -m32 flag to linker.
- set ${OBJECTS}
- ABI32=`file $1 | grep 32-bit`
- if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
- OPTS="-m32 ${OPTS}"
- fi
-
- rm -f ${LIBNAME}
- # make lib
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- # finish up
- FINAL_LIBS="${LIBNAME}"
- elif [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
- LINK="ar"
- OPTS="-ru"
- # make lib
- ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
- ranlib ${LIBNAME}.a
- # finish up
- FINAL_LIBS=${LIBNAME}.a
- else
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
- if [ $ARCH = 'Linux' ] ; then
- OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
- else
- OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
- fi
- if [ $EXPORTS ] ; then
- #OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
- # Make the 'exptmp' file for --version-script option
- echo "VERSION_${MAJOR}.${MINOR} {" > exptmp
- echo "global:" >> exptmp
- sed 's/$/;/' ${EXPORTS} >> exptmp
- echo "local:" >> exptmp
- echo "*;" >> exptmp
- echo "};" >> exptmp
- OPTS="${OPTS} -Xlinker --version-script=exptmp"
- # exptmp is removed below
- fi
-
- # Check if objects are 32-bit and we're running in 64-bit
- # environment. If so, pass -m32 flag to linker.
- set ${OBJECTS}
- ABI32=`file $1 | grep 32-bit`
- if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
- OPTS="-m32 ${OPTS}"
- fi
-
- if [ x${PATCH} = "x" ] ; then
- VERSION="${MAJOR}.${MINOR}"
- else
- VERSION="${MAJOR}.${MINOR}.${PATCH}"
- fi
-
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}.so.${VERSION}
-
- # rm any old libs
- rm -f ${LIBNAME}.so.${VERSION}
- rm -f ${LIBNAME}.so.${MAJOR}
- rm -f ${LIBNAME}.so
-
- # make lib
- ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS}
- # make usual symlinks
- ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR}
- ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
- # finish up
- FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
-# rm -f exptmp
- fi
- ;;
-
- 'SunOS')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making SunOS static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar -ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so"
- echo "mklib: Making SunOS shared library: " ${LIBNAME}
- # XXX OPTS for gcc should be -shared, but that doesn't work.
- # Using -G does work though.
- OPTS="-G"
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified, choose default linker now
- if [ $CPLUSPLUS = 1 ] ; then
- # determine linker and options for C++ code
- if [ `which c++` ] ; then
- # use Sun c++
- LINK="c++"
- elif [ `type g++` ] ; then
- # use g++
- LINK="g++"
- else
- echo "mklib: warning: can't find C++ comiler, trying CC."
- LINK="CC"
- fi
- else
- # use native Sun linker for C code
- LINK="ld"
- fi
- fi
- echo "mklib: linker is" ${LINK} ${OPTS}
- rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
- ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
- FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
- fi
- ;;
-
- 'FreeBSD')
- # we assume gcc
-
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified so set default link command now
- if [ $CPLUSPLUS = 1 ] ; then
- LINK=g++
- else
- LINK=gcc
- fi
- fi
-
- if [ $NOPREFIX = 1 ] ; then
- # No "lib" or ".so" part
- echo "mklib: Making FreeBSD shared library: " ${LIBNAME}
- OPTS="-shared"
- rm -f ${LIBNAME}
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS=${LIBNAME}
- elif [ $STATIC = 1 ] ; then
- STLIB="lib${LIBNAME}.a"
- echo "mklib: Making FreeBSD static library: " ${STLIB}
- rm -f ${STLIB}
- ar cq ${STLIB} ${OBJECTS}
- ranlib ${STLIB}
- FINAL_LIBS=${STLIB}
- else
- SHLIB="lib${LIBNAME}.so.${MAJOR}"
- OPTS="-shared -Wl,-soname,${SHLIB}"
- echo "mklib: Making FreeBSD shared library: " ${SHLIB}
- rm -f ${SHLIB}
- ${LINK} ${OPTS} -o ${SHLIB} ${OBJECTS} ${DEPS}
- ln -sf ${SHLIB} "lib${LIBNAME}.so"
- FINAL_LIBS="${SHLIB} lib${LIBNAME}.so"
- fi
- ;;
-
- 'NetBSD')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}_pic.a"
- echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar cq ${LIBNAME} ${OBJECTS}
- ranlib ${LIBNAME}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
- echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'IRIX' | 'IRIX64')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- rm -f ${LIBNAME}
- ar rc ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
- # XXX we should run 'file' on the first object file to determine
- # if it's o32, n32 or 64 format, as we do for Linux above.
- if [ $ARCHOPT = "64" ] ; then
- # 64-bit ABI
- OPTS="-64 -shared -all"
- echo "mklib: Making IRIX 64-bit shared library: " ${LIBNAME}
- elif [ $ARCHOPT = "o32" ] ; then
- # old 32-bit ABI
- OPTS="-32 -shared -all"
- echo "mklib: Making IRIX o32-bit shared library: " ${LIBNAME}
- else
- # new 32-bit ABI
- OPTS="-n32 -shared -all"
- echo "mklib: Making IRIX n32-bit shared library: " ${LIBNAME}
- fi
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="CC"
- else
- LINK="ld"
- fi
- ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'linux-cygwin')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making linux-cygwin library: " ${LIBNAME}
- rm -f ${LIBNAME}
- gnuwin32ar ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'HP-UX')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making HP-UX static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar -ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- RUNLIB="lib${LIBNAME}.${MAJOR}"
- DEVLIB="lib${LIBNAME}.sl"
- echo "mklib: Making HP-UX shared library: " ${RUNLIB} ${DEVLIB}
- ld -b -o ${RUNLIB} +b ${RUNLIB} ${OBJECTS} ${DEPS}
- ln -s ${RUNLIB} ${DEVLIB}
- FINAL_LIBS="${RUNLIB} ${DEVLIB}"
- fi
- ;;
-
- 'AIX' | 'AIX64')
- if [ $ARCH = "AIX64" ] ; then
- X64="-X64"
- fi
-
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making AIX static library: " ${LIBNAME}
- ar -ruv ${X64} ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- EXPFILE="lib${LIBNAME}.exp"
- OFILE=shr.o #Want to be consistent with the IBM libGL.a
- LIBNAME="lib${LIBNAME}.a" # shared objects are still stored in the .a libraries
- if [ $ARCH = "AIX64" ] ; then
- OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry -q64"
- else
- OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry"
- fi
- rm -f ${EXPFILE} ${OFILE}
- NM="/bin/nm -eC ${X64}"
- echo "#! /usr/lib/${LIBNAME}" > ${EXPFILE}
- ${NM} ${OBJECTS} | awk '{
- if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \
- && ( substr($1,1,1) != ".")) {
- if (substr ($1, 1, 7) != "__sinit" &&
- substr ($1, 1, 7) != "__sterm") {
- if (substr ($1, 1, 5) == "__tf1")
- print (substr ($1, 7))
- else if (substr ($1, 1, 5) == "__tf9")
- print (substr ($1, 15))
- else
- print $1
- }
- }
- }' | sort -u >> ${EXPFILE}
- cc ${OPTS} -o ${OFILE} ${OBJECTS} ${DEPS}
- ar ${X64} -r ${LIBNAME} ${OFILE}
- FINAL_LIBS="${LIBNAME}"
- fi
- ;;
-
- 'OpenSTEP')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making OpenSTEP static library: " ${LIBNAME}
- libtool -static -o ${LIBNAME} - ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'OSF1')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making OSF/1 static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar -ruv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- VERSION="${MAJOR}.${MINOR}"
- LIBNAME="lib${LIBNAME}.so"
- echo "mklib: Making OSF/1 shared library: " ${LIBNAME}
- if [ "x$LINK" = "x" ] ; then
- if [ $CPLUSPLUS = 1 ] ; then
- LINK=cxx
- else
- LINK=cc
- fi
- fi
- rm -f ${LIBNAME}.${VERSION}
- ${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
- ln -sf ${LIBNAME}.${VERSION} ${LIBNAME}
- FINAL_LIBS="${LIBNAME} ${LIBNAME}.${VERSION}"
- fi
- ;;
-
- 'Darwin')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making Darwin static library: " ${LIBNAME}
- LINK="ar"
- OPTS="-ruv"
- ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.dylib"
- echo "mklib: Making Darwin shared library: " ${LIBNAME}
- FLAGS="-dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0"
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="g++"
- else
- LINK="cc"
- fi
- ${LINK} ${FLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'LynxOS')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making LynxOS static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar ru ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'BeOS')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making BeOS static library: " ${LIBNAME}
- ar -cru "${LIBNAME}" ${OBJECTS}
- else
- LIBNAME="lib${LIBNAME}.so"
- echo "mklib: Making BeOS shared library: " ${LIBNAME}
- gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}"
- mimeset -f "${LIBNAME}"
- # XXX remove the Mesa3D stuff here since mklib isn't mesa-specific.
- setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!"
- fi
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'QNX')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making QNX library: " ${LIBNAME}
- wlib ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- ;;
-
- 'MorphOS')
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making MorphOS library: " ${LIBNAME}
- ppc-morphos-ar rc ${LIBNAME} ${OBJECTS}
- FINAL_LIBS="${LIBNAME}"
- ;;
-
- 'icc')
- # Intel C compiler
- # This should get merged into the Linux code, above, since this isn't
- # really a different architecture.
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
-
- if [ $STATIC = 1 ] ; then
- echo "mklib: Making Intel ICC static library: " ${LIBNAME}.a
- LINK="ar"
- OPTS="-ruv"
- # make lib
- ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
- # finish up
- FINAL_LIBS="${LIBNAME}.a"
- else
- OPTS="-shared"
- VERSION="${MAJOR}.${MINOR}.${PATCH}"
- echo "mklib: Making Intel ICC shared library: " ${LIBNAME}.so.${VERSION}
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="icc"
- else
- LINK="icc"
- fi
- # rm any old libs
- rm -f ${LIBNAME}.so.${VERSION}
- rm -f ${LIBNAME}.so.${MAJOR}
- rm -f ${LIBNAME}.so
- # make lib
- ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS}
- # make usual symlinks
- ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR}
- ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
- # finish up
- FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
- fi
- ;;
-
- 'aix-gcc')
- # AIX with gcc
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making AIX GCC static library: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar ru ${LIBNAME} ${OBJECTS}
- FINAL_LIBS=${LIBNAME}
- else
- LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
- echo "mklib: Making AIX GCC shared library: " ${LIBNAME}
- # remove old lib
- rm -f ${LIBNAME}
- # make the lib
- gcc -shared -Wl,-G ${OBJECTS} ${DEPS} -o ${LIBNAME}
- # NOTE: the application linking with this library must specify
- # the -Wl,-brtl flags to gcc
- FINAL_LIBS=${LIBNAME}
- fi
- ;;
-
- 'ultrix')
- # XXX untested
- if [ $STATIC = 0 ] ; then
- echo "mklib: Warning shared libs not supported on Ultrix"
- fi
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making static library for Ultrix: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar ru ${LIBNAME} ${OBJECTS}
- FINAL_LIBS="${LIBNAME}"
- ;;
-
- CYGWIN*)
- # GCC-based environment
- CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
- LIBNAME="lib${LIBNAME}" # prefix with "lib"
-
- if [ $STATIC = 1 ] ; then
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
- LINK="ar"
- OPTS="-ru"
- # make lib
- ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
- ranlib ${LIBNAME}.a
- # finish up
- FINAL_LIBS=${LIBNAME}.a
- else
- OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="g++"
- else
- LINK="gcc"
- fi
-
- # rm any old libs
- rm -f ${LIBNAME}-${MAJOR}.dll
- rm -f ${LIBNAME}.dll.a
- rm -f ${LIBNAME}.a
-
- # make lib
- ${LINK} ${OPTS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS}
- # make usual symlinks
- ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a
- # finish up
- FINAL_LIBS="${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a"
- # special case for installing in bin
- FINAL_BINS="${CYGNAME}-${MAJOR}.dll"
- fi
- ;;
-
- 'example')
- # If you're adding support for a new architecture, you can
- # start with this:
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making static library for example arch: " ${LIBNAME}
- rm -f ${LIBNAME}
- ar rv ${LIBNAME} ${OBJECTS}
- FINAL_LIBS="${LIBNAME}"
- else
- LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
- echo "mklib: Making shared library for example arch: " ${LIBNAME}
- ld -o ${LIBNAME} ${OBJECTS} ${DEPS}
- FINAL_LIBS="${LIBNAME}"
- fi
- ;;
-
- *)
- echo "mklib: ERROR: Don't know how to make a static/shared library for" ${ARCH}
- echo "mklib: Please add necessary commands to mklib script."
- ;;
-esac
-
-
-#
-# Put library files into installation directory if specified.
-#
-if [ ${INSTALLDIR} != "." ] ; then
- echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
- mv ${FINAL_LIBS} ${INSTALLDIR}/
-fi
diff --git a/nx-X11/extras/Mesa/configs/aix b/nx-X11/extras/Mesa/configs/aix
deleted file mode 100644
index fe8e48cd6..000000000
--- a/nx-X11/extras/Mesa/configs/aix
+++ /dev/null
@@ -1,28 +0,0 @@
-# Configuration for AIX, dynamic libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = aix
-
-# Compiler and flags
-CC = cc
-CXX = xlC
-
-CFLAGS = -O -DAIXV3
-CXXFLAGS = -O -DAIXV3
-MKLIB_OPTIONS =
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-GL_LIB_DEPS = -lX11 -lXext -lm
-GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
-GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
-GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXt -lX11
-OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
-APP_LIB_DEPS = -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC
-
diff --git a/nx-X11/extras/Mesa/configs/aix-64 b/nx-X11/extras/Mesa/configs/aix-64
deleted file mode 100644
index 0d9847529..000000000
--- a/nx-X11/extras/Mesa/configs/aix-64
+++ /dev/null
@@ -1,28 +0,0 @@
-# Configuration for AIX 64-bit, dynamic libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = aix-64
-
-# Compiler and flags
-CC = xlc
-CXX = xlC
-
-CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3
-CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3
-MKLIB_OPTIONS = -arch AIX64
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-GL_LIB_DEPS = -lX11 -lXext -lm
-GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
-GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
-GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXt -lX11
-OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
-APP_LIB_DEPS = -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC
-
diff --git a/nx-X11/extras/Mesa/configs/aix-gcc b/nx-X11/extras/Mesa/configs/aix-gcc
deleted file mode 100644
index 5f10bf25d..000000000
--- a/nx-X11/extras/Mesa/configs/aix-gcc
+++ /dev/null
@@ -1,19 +0,0 @@
-# Configuration for AIX with gcc
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = aix-gcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -O2 -DAIXV3
-CXXFLAGS = -O2 -DAIXV3
-
-MKLIB_OPTIONS = -arch aix-gcc
-GL_LIB_DEPS = -lX11 -lXext -lm
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
-APP_LIB_DEPS = -L$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi
-
diff --git a/nx-X11/extras/Mesa/configs/aix-static b/nx-X11/extras/Mesa/configs/aix-static
deleted file mode 100644
index f6f086edb..000000000
--- a/nx-X11/extras/Mesa/configs/aix-static
+++ /dev/null
@@ -1,23 +0,0 @@
-# Configuration for AIX, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = aix-static
-
-# Compiler and flags
-CC = cc
-CXX = xlC
-
-CFLAGS = -O -DAIXV3
-CXXFLAGS = -O -DAIXV3
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -lXext -lXmu -lXi -lm
-
diff --git a/nx-X11/extras/Mesa/configs/beos b/nx-X11/extras/Mesa/configs/beos
deleted file mode 100644
index 1d2eaa959..000000000
--- a/nx-X11/extras/Mesa/configs/beos
+++ /dev/null
@@ -1,99 +0,0 @@
-# Configuration for BeOS
-# Written by Philippe Houdoin
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = beos
-
-
-DEFINES = \
- -DBEOS_THREADS
-
-MACHINE=$(shell uname -m)
-ifeq ($(MACHINE), BePC)
- CPU = x86
-else
- CPU = ppc
-endif
-
-ifeq ($(CPU), x86)
- # BeOS x86 settings
-
- DEFINES += \
- -DGNU_ASSEMBLER \
- -DUSE_X86_ASM \
- -DUSE_MMX_ASM \
- -DUSE_3DNOW_ASM \
- -DUSE_SSE_ASM
-
- ASM_SOURCES = $(X86_SOURCES) $(X86_API)
-
- CC = gcc
- CXX = g++
- LD = gcc
-
- CFLAGS = \
- -Wall -Wno-multichar -Wno-ctor-dtor-privacy \
- $(DEFINES)
-
- CXXFLAGS = $(CFLAGS)
-
- LDFLAGS += -Xlinker
-
- ifdef DEBUG
- CFLAGS += -g -O0
- LDFLAGS += -g
- DEFINES += -DDEBUG
- else
- CFLAGS += -O3
- endif
-
- GLUT_CFLAGS = -fexceptions
-
-else
- # BeOS PPC settings
-
- CC = mwcc
- CXX = $(CC)
- LD = mwldppc
-
- CFLAGS = \
- -w on -requireprotos \
- $(DEFINES)
-
- CXXFLAGS = $(CFLAGS)
-
- LDFLAGS += \
- -export pragma \
- -init _init_routine_ \
- -term _term_routine_ \
- -lroot \
- /boot/develop/lib/ppc/glue-noinit.a \
- /boot/develop/lib/ppc/init_term_dyn.o \
- /boot/develop/lib/ppc/start_dyn.o
-
- ifdef DEBUG
- CFLAGS += -g -O0
- CXXFLAGS += -g -O0
- LDFLAGS += -g
- else
- CFLAGS += -O7
- CXXFLAGS += -O7
- endif
-
- GLUT_CFLAGS = -fexceptions
-endif
-
-# Directories
-SRC_DIRS = mesa glu glut/beos
-GLU_DIRS = sgi
-DRIVER_DIRS = beos
-PROGRAM_DIRS = beos samples redbook demos tests
-
-# Library/program dependencies
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB)
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS = -lgame -L$(LIB_DIR) -l$(GL_LIB)
-APP_LIB_DEPS = -lbe -L$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB)
-
diff --git a/nx-X11/extras/Mesa/configs/darwin b/nx-X11/extras/Mesa/configs/darwin
deleted file mode 100644
index 0c8a6ec47..000000000
--- a/nx-X11/extras/Mesa/configs/darwin
+++ /dev/null
@@ -1,29 +0,0 @@
-# Configuration for Darwin / MacOS X, making dynamic libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = darwin
-
-# Compiler and flags
-CC = cc
-CXX = cc
-CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-CXXFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.dylib
-GLU_LIB_NAME = libGLU.dylib
-GLUT_LIB_NAME = libglut.dylib
-GLW_LIB_NAME = libGLw.dylib
-OSMESA_LIB_NAME = libOSMesa.dylib
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL
-GLU_LIB_DEPS = -L$(LIB_DIR) -lGL
-GLUT_LIB_DEPS = -L$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
-GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
-APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-
-# omit glw lib for now:
-SRC_DIRS = mesa glu glut/glx
-
diff --git a/nx-X11/extras/Mesa/configs/darwin-static b/nx-X11/extras/Mesa/configs/darwin-static
deleted file mode 100644
index c7f9c5f06..000000000
--- a/nx-X11/extras/Mesa/configs/darwin-static
+++ /dev/null
@@ -1,24 +0,0 @@
-# Configuration for Darwin / MacOS X, making static libs
-
-include $(TOP)/configs/darwin
-
-CONFIG_NAME = darwin-static
-
-# Compiler and flags
-CFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-CXXFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-OSMESA_LIB_DEPS =
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS =
-GLW_LIB_DEPS =
-APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
diff --git a/nx-X11/extras/Mesa/configs/default b/nx-X11/extras/Mesa/configs/default
deleted file mode 100644
index e3b1bc0ec..000000000
--- a/nx-X11/extras/Mesa/configs/default
+++ /dev/null
@@ -1,74 +0,0 @@
-# Default/template configuration
-
-# This is included by other config files which may override some
-# of these variables.
-
-CONFIG_NAME = default
-
-# Version info
-MESA_MAJOR=6
-MESA_MINOR=4
-MESA_TINY=1
-
-# external projects. This should be useless now that we use libdrm.
-DRM_SOURCE_PATH=$(TOP)/../drm
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -O
-CXXFLAGS = -O
-GLU_CFLAGS =
-
-# Misc tools and flags
-MKLIB_OPTIONS =
-MKDEP = makedepend
-MKDEP_OPTIONS = -fdepend
-MAKE = make
-
-# Python and flags (generally only needed by the developers)
-PYTHON2 = python
-PYTHON_FLAGS = -t -O -O
-
-# Library names (base name)
-GL_LIB = GL
-GLU_LIB = GLU
-GLUT_LIB = glut
-GLW_LIB = GLw
-OSMESA_LIB = OSMesa
-
-
-# Library names (actual file names)
-GL_LIB_NAME = lib$(GL_LIB).so
-GLU_LIB_NAME = lib$(GLU_LIB).so
-GLUT_LIB_NAME = lib$(GLUT_LIB).so
-GLW_LIB_NAME = lib$(GLW_LIB).so
-OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
-
-
-# Optional assembly language optimization files for libGL
-ASM_SOURCES =
-
-# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
-# order to build the Motif widget too)
-GLW_SOURCES = GLwDrawA.c
-
-
-# Directories
-LIB_DIR = $(TOP)/lib
-INSTALL_PREFIX = /usr/local
-SRC_DIRS = mesa glu glut/glx glw
-GLU_DIRS = sgi
-DRIVER_DIRS = x11 osmesa
-# Which subdirs under $(TOP)/progs/ to enter:
-PROGRAM_DIRS = demos redbook samples xdemos
-
-
-# Library/program dependencies
-EXTRA_LIB_PATH ?=
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
-OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB)
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/nx-X11/extras/Mesa/configs/freebsd b/nx-X11/extras/Mesa/configs/freebsd
deleted file mode 100644
index 910352abd..000000000
--- a/nx-X11/extras/Mesa/configs/freebsd
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration for FreeBSD
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = FreeBSD
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-MAKE = gmake
-
-CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100
-CXXFLAGS = -O2 -fPIC -pedantic
-GLUT_CFLAGS = -fexceptions
-
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/freebsd-dri b/nx-X11/extras/Mesa/configs/freebsd-dri
deleted file mode 100644
index fd07dbefe..000000000
--- a/nx-X11/extras/Mesa/configs/freebsd-dri
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*-makefile-*-
-# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
-
-include $(TOP)/configs/freebsd
-
-CONFIG_NAME = freebsd-dri
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-WARN_FLAGS = -Wall
-OPT_FLAGS = -O
-
-EXPAT_INCLUDES = -I/usr/local/include
-X11_INCLUDES = -I/usr/X11R6/include
-DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
- -DGLX_DIRECT_RENDERING -DHAVE_ALIAS
-CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \
- -ffast-math $(X11_INCLUDES)
-CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
-
-ASM_SOURCES =
-
-# Library/program dependencies
-LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
-DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread $(LIBDRM_LIB)
-
-GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
-
-
-# Directories
-SRC_DIRS = glx/x11 mesa glu glut/glx glw
-DRIVER_DIRS = dri
-PROGRAM_DIRS =
-WINDOW_SYSTEM=dri
-
-DRM_SOURCE_PATH=$(TOP)/../drm
-
-# ffb and gamma are missing because they have not been converted to use the new
-# interface.
-DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
- unichrome savage sis
-
diff --git a/nx-X11/extras/Mesa/configs/freebsd-dri-amd64 b/nx-X11/extras/Mesa/configs/freebsd-dri-amd64
deleted file mode 100644
index ffddfd835..000000000
--- a/nx-X11/extras/Mesa/configs/freebsd-dri-amd64
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*-makefile-*-
-# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers
-
-include $(TOP)/configs/freebsd-dri
-
-CONFIG_NAME = freebsd-dri-x86-64
-
-ASM_FLAGS = -DUSE_X86_64_ASM
-ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
diff --git a/nx-X11/extras/Mesa/configs/freebsd-dri-x86 b/nx-X11/extras/Mesa/configs/freebsd-dri-x86
deleted file mode 100644
index 31316b1f7..000000000
--- a/nx-X11/extras/Mesa/configs/freebsd-dri-x86
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*-makefile-*-
-# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
-
-include $(TOP)/configs/freebsd-dri
-
-CONFIG_NAME = freebsd-dri-x86
-
-# Unnecessary on x86, generally.
-PIC_FLAGS =
-
-ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-ASM_SOURCES = $(X86_SOURCES)
diff --git a/nx-X11/extras/Mesa/configs/hpux10 b/nx-X11/extras/Mesa/configs/hpux10
deleted file mode 100644
index e17c8b681..000000000
--- a/nx-X11/extras/Mesa/configs/hpux10
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration for HPUX v10, shared libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux10
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +O3 +DAportable +z -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
-CXXFLAGS = +O3 +DAportable +Z -Aa -D_HPUX_SOURCE
-
-APP_LIB_DEPS = -$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/hpux10-gcc b/nx-X11/extras/Mesa/configs/hpux10-gcc
deleted file mode 100644
index 107a99a85..000000000
--- a/nx-X11/extras/Mesa/configs/hpux10-gcc
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration for HPUX v10, with gcc
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux10-gcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
-CXXFLAGS = -ansi -O3 -D_HPUX_SOURCE
-GLUT_CFLAGS = -fexceptions
-
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
-
diff --git a/nx-X11/extras/Mesa/configs/hpux10-static b/nx-X11/extras/Mesa/configs/hpux10-static
deleted file mode 100644
index 38a1313e6..000000000
--- a/nx-X11/extras/Mesa/configs/hpux10-static
+++ /dev/null
@@ -1,30 +0,0 @@
-# Configuration for HPUX v10, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux10-static
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +O3 +DAportable +z -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
-CXXFLAGS = +O3 +DAportable +Z -Aa -D_HPUX_SOURCE
-
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies (static libs don't have dependencies)
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS =
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS =
-GLW_LIB_DEPS =
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm -lstdc++
diff --git a/nx-X11/extras/Mesa/configs/hpux11-32 b/nx-X11/extras/Mesa/configs/hpux11-32
deleted file mode 100644
index 9ff407bd5..000000000
--- a/nx-X11/extras/Mesa/configs/hpux11-32
+++ /dev/null
@@ -1,26 +0,0 @@
-# Configuration for HPUX v11
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux11-32
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
-
-CXXFLAGS = +z -Aa +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
-
-MKLIB_OPTIONS =
-
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies
-APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/hpux11-32-static b/nx-X11/extras/Mesa/configs/hpux11-32-static
deleted file mode 100644
index 7507ab0b0..000000000
--- a/nx-X11/extras/Mesa/configs/hpux11-32-static
+++ /dev/null
@@ -1,26 +0,0 @@
-# Configuration for HPUX v11, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux11-32-static
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +O3 +DA2.0 -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
-
-CXXFLAGS = +O3 +DA2.0 -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
-
-MKLIB_OPTIONS = -static
-
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies
-APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/hpux11-32-static-nothreads b/nx-X11/extras/Mesa/configs/hpux11-32-static-nothreads
deleted file mode 100644
index 91b365408..000000000
--- a/nx-X11/extras/Mesa/configs/hpux11-32-static-nothreads
+++ /dev/null
@@ -1,26 +0,0 @@
-# Configuration for HPUX v11, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux11-32-static
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +O3 +DA2.0 -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
-
-CXXFLAGS = +O3 +DA2.0 -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
-
-MKLIB_OPTIONS = -static
-
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies
-APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/hpux11-64 b/nx-X11/extras/Mesa/configs/hpux11-64
deleted file mode 100644
index b0869cf81..000000000
--- a/nx-X11/extras/Mesa/configs/hpux11-64
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configuration for HPUX v11, 64-bit
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux11-64
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +z -Ae +DD64 +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
-
-CXXFLAGS = +z -Aa +DD64 +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
-
-MKLIB_OPTIONS =
-
-LIBDIR = $(TOP)/lib64
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies
-APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/hpux11-64-static b/nx-X11/extras/Mesa/configs/hpux11-64-static
deleted file mode 100644
index 451dc4208..000000000
--- a/nx-X11/extras/Mesa/configs/hpux11-64-static
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configuration for HPUX v11, 64-bit, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux11-64-static
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +O3 +DA2.0W -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
-
-CXXFLAGS = +O3 +DA2.0W -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
-
-MKLIB_OPTIONS = -static
-
-LIBDIR = $(TOP)/lib64
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies
-APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/hpux9 b/nx-X11/extras/Mesa/configs/hpux9
deleted file mode 100644
index 037381757..000000000
--- a/nx-X11/extras/Mesa/configs/hpux9
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration for HPUX v9, shared libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux9
-
-# Compiler and flags
-CC = cc
-# XXX fix this
-CXX = c++
-
-CFLAGS = +z +O3 +Olibcalls +ESlit -Aa +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM
-CXXFLAGS = +z +O3 +Olibcalls +ESlit -Aa +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5
-
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm
-
diff --git a/nx-X11/extras/Mesa/configs/hpux9-gcc b/nx-X11/extras/Mesa/configs/hpux9-gcc
deleted file mode 100644
index 47d579ea5..000000000
--- a/nx-X11/extras/Mesa/configs/hpux9-gcc
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration for HPUX v10, shared libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = hpux9-gcc
-
-# Compiler and flags
-CC = cc
-CXX = aCC
-
-CFLAGS = +O3 +DAportable +z -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
-CXXFLAGS = +O3 +DAportable +Z -Aa -D_HPUX_SOURCE
-
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/irix6-64 b/nx-X11/extras/Mesa/configs/irix6-64
deleted file mode 100644
index 6c33d33ba..000000000
--- a/nx-X11/extras/Mesa/configs/irix6-64
+++ /dev/null
@@ -1,18 +0,0 @@
-# Configuration for IRIX 6.x, make n64 DSOs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = irix6-64
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM
-CXXFLAGS = -64 -O3 -ansi -woff 1174
-MKLIB_OPTIONS = -archopt 64
-
-GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
-
-LIB_DIR = $(TOP)/lib64
-
-APP_LIB_DEPS = -L$(LIB_DIR) -64 -rpath $(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
diff --git a/nx-X11/extras/Mesa/configs/irix6-64-static b/nx-X11/extras/Mesa/configs/irix6-64-static
deleted file mode 100644
index d66af5be8..000000000
--- a/nx-X11/extras/Mesa/configs/irix6-64-static
+++ /dev/null
@@ -1,25 +0,0 @@
-# Configuration for IRIX 6.x, make n64 static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = irix6-64-static
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM
-CXXFLAGS = -64 -O3 -ansi -woff 1174
-MKLIB_OPTIONS = -archopt 64 -static
-
-GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
-
-LIB_DIR = $(TOP)/lib64
-
-APP_LIB_DEPS = -L$(LIB_DIR) -64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
diff --git a/nx-X11/extras/Mesa/configs/irix6-n32 b/nx-X11/extras/Mesa/configs/irix6-n32
deleted file mode 100644
index 4bf296401..000000000
--- a/nx-X11/extras/Mesa/configs/irix6-n32
+++ /dev/null
@@ -1,18 +0,0 @@
-# Configuration for IRIX 6.x, make n32 DSOs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = irix6-n32
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM
-CXXFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552
-MKLIB_OPTIONS = -archopt n32
-
-GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
-
-LIB_DIR = $(TOP)/lib32
-
-APP_LIB_DEPS = -L$(LIB_DIR) -n32 -rpath $(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lfpe -lm
diff --git a/nx-X11/extras/Mesa/configs/irix6-n32-static b/nx-X11/extras/Mesa/configs/irix6-n32-static
deleted file mode 100644
index b60de380c..000000000
--- a/nx-X11/extras/Mesa/configs/irix6-n32-static
+++ /dev/null
@@ -1,25 +0,0 @@
-# Configuration for IRIX 6.x, make n32 static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = irix6-n32-static
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -n32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
-CXXFLAGS = -n32 -mips2 -O2 -ansi -woff 3262,3666
-MKLIB_OPTIONS = -archopt n32 -static
-
-GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
-
-LIB_DIR = $(TOP)/lib32
-
-APP_LIB_DEPS = -L$(LIB_DIR) -n32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
diff --git a/nx-X11/extras/Mesa/configs/irix6-o32 b/nx-X11/extras/Mesa/configs/irix6-o32
deleted file mode 100644
index 56a197960..000000000
--- a/nx-X11/extras/Mesa/configs/irix6-o32
+++ /dev/null
@@ -1,19 +0,0 @@
-# Configuration for IRIX 6.x, make o32 DSOs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = irix6-o32
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
-CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
-MKLIB_OPTIONS = -archopt o32
-
-GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
-
-LIB_DIR = $(TOP)/lib32
-
-APP_LIB_DEPS = -L$(LIB_DIR) -32 -rpath $(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm
-
diff --git a/nx-X11/extras/Mesa/configs/irix6-o32-static b/nx-X11/extras/Mesa/configs/irix6-o32-static
deleted file mode 100644
index ac3d6ee17..000000000
--- a/nx-X11/extras/Mesa/configs/irix6-o32-static
+++ /dev/null
@@ -1,25 +0,0 @@
-# Configuration for IRIX 6.x, make o32 static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = irix6-o32-static
-
-# Compiler and flags
-CC = cc
-CXX = CC
-CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
-CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
-MKLIB_OPTIONS = -archopt o32 -static
-
-GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
-
-LIB_DIR = $(TOP)/lib32
-
-APP_LIB_DEPS = -L$(LIB_DIR) -32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
diff --git a/nx-X11/extras/Mesa/configs/linux b/nx-X11/extras/Mesa/configs/linux
deleted file mode 100644
index e3119ec5c..000000000
--- a/nx-X11/extras/Mesa/configs/linux
+++ /dev/null
@@ -1,33 +0,0 @@
-# Configuration for generic Linux
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-WARN_FLAGS = -Wall
-OPT_FLAGS = -O3 -g
-PIC_FLAGS = -fPIC
-
-# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32
-# to build properly on 64-bit platforms.
-
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -DPTHREADS -DUSE_XSHM
-
-X11_INCLUDES = -I/usr/X11R6/include
-
-CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
-
-CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(X11_INCLUDES)
-
-GLUT_CFLAGS = -fexceptions
-
-EXTRA_LIB_PATH = -L/usr/X11R6/lib
diff --git a/nx-X11/extras/Mesa/configs/linux-alpha b/nx-X11/extras/Mesa/configs/linux-alpha
deleted file mode 100644
index 507c80845..000000000
--- a/nx-X11/extras/Mesa/configs/linux-alpha
+++ /dev/null
@@ -1,18 +0,0 @@
-# Configuration for Linux on Alpha
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-alpha
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM
-CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE
-GLUT_CFLAGS = -fexceptions
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
-
diff --git a/nx-X11/extras/Mesa/configs/linux-alpha-static b/nx-X11/extras/Mesa/configs/linux-alpha-static
deleted file mode 100644
index 7b7ee07eb..000000000
--- a/nx-X11/extras/Mesa/configs/linux-alpha-static
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configuration for Linux on Alpha, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-alpha-static
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM
-CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE
-GLUT_CFLAGS = -fexceptions
-MKLIB_OPTIONS = -static
-
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -L/usr/X11R6/lib -lX11 -lm
diff --git a/nx-X11/extras/Mesa/configs/linux-debug b/nx-X11/extras/Mesa/configs/linux-debug
deleted file mode 100644
index ff4d1c33b..000000000
--- a/nx-X11/extras/Mesa/configs/linux-debug
+++ /dev/null
@@ -1,8 +0,0 @@
-# Configuration for debugging on Linux
-
-include $(TOP)/configs/linux
-
-CONFIG_NAME = linux-debug
-
-OPT_FLAGS = -g
-DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
diff --git a/nx-X11/extras/Mesa/configs/linux-directfb b/nx-X11/extras/Mesa/configs/linux-directfb
deleted file mode 100644
index f09c69dda..000000000
--- a/nx-X11/extras/Mesa/configs/linux-directfb
+++ /dev/null
@@ -1,29 +0,0 @@
-# Configuration for DirectFB
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-directfb
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -Wall -O3 -ffast-math -fPIC -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -D_SVID_SOURCE \
- -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DPTHREADS
-
-CXXFLAGS = -Wall -O3 -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
-
-HAVE_X86 = $(shell uname -m | grep 'i[3-6]86' >/dev/null && echo yes)
-ifeq ($(HAVE_X86), yes)
- CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
- CXXFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
- ASM_SOURCES = $(X86_SOURCES) $(X86_API)
-endif
-
-# Directories
-SRC_DIRS = mesa glu
-DRIVER_DIRS = directfb
-PROGRAM_DIRS = # disabled
-
-# Library/program dependencies
-GL_LIB_DEPS = -lm -lpthread
diff --git a/nx-X11/extras/Mesa/configs/linux-dri b/nx-X11/extras/Mesa/configs/linux-dri
deleted file mode 100644
index 293f2e789..000000000
--- a/nx-X11/extras/Mesa/configs/linux-dri
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-dri
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-MKDEP = /usr/X11R6/bin/makedepend
-#MKDEP = gcc -M
-#MKDEP_OPTIONS = -MF depend
-
-WARN_FLAGS = -Wall
-OPT_FLAGS = -O -g
-PIC_FLAGS = -fPIC
-
-# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -D_GNU_SOURCE \
- -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
- -DGLX_DIRECT_RENDERING -DHAVE_ALIAS
-
-X11_INCLUDES = -I/usr/X11R6/include
-
-CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(ASM_FLAGS) -std=c99 -ffast-math
-
-CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-
-ASM_SOURCES =
-
-# Library/program dependencies
-EXTRA_LIB_PATH=-L/usr/X11R6/lib
-
-LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
-DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
- $(LIBDRM_LIB)
-
-
-# This is now 0 by default since it seems to confuse the hell out of people
-# and generate a lot of extra noise on bugzilla. If you need to build with
-# EGL, do 'make linux-dri USING_EGL=1'
-
-USING_EGL=0
-
-# Directories
-ifeq ($(USING_EGL), 1)
-SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
-PROGRAM_DIRS = egl
-else
-SRC_DIRS = glx/x11 mesa glu glut/glx glw
-PROGRAM_DIRS =
-endif
-
-DRIVER_DIRS = dri
-WINDOW_SYSTEM=dri
-
-# gamma are missing because they have not been converted to use the new
-# interface.
-DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 r300 radeon s3v \
- savage sis tdfx trident unichrome ffb
diff --git a/nx-X11/extras/Mesa/configs/linux-dri-ppc b/nx-X11/extras/Mesa/configs/linux-dri-ppc
deleted file mode 100644
index fb8768806..000000000
--- a/nx-X11/extras/Mesa/configs/linux-dri-ppc
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/linux-dri
-
-CONFIG_NAME = linux-dri-ppc
-
-OPT_FLAGS = -Os -mcpu=603
-PIC_FLAGS = -fPIC
-
-ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM
-ASM_SOURCES = $(PPC_SOURCES)
-
-# Build only the drivers for cards that exist on PowerPC. At some point MGA
-# will be added, but not yet.
-DRI_DIRS = mach64 r128 r200 r300 radeon tdfx
-
diff --git a/nx-X11/extras/Mesa/configs/linux-dri-x86 b/nx-X11/extras/Mesa/configs/linux-dri-x86
deleted file mode 100644
index bef24e059..000000000
--- a/nx-X11/extras/Mesa/configs/linux-dri-x86
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/linux-dri
-
-CONFIG_NAME = linux-dri-x86
-
-# Unnecessary on x86, generally.
-PIC_FLAGS =
-
-# Add -m32 to CFLAGS:
-ARCH_FLAGS = -m32
-
-ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-ASM_SOURCES = $(X86_SOURCES)
-
diff --git a/nx-X11/extras/Mesa/configs/linux-dri-x86-64 b/nx-X11/extras/Mesa/configs/linux-dri-x86-64
deleted file mode 100644
index affbe2bc6..000000000
--- a/nx-X11/extras/Mesa/configs/linux-dri-x86-64
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/linux-dri
-
-CONFIG_NAME = linux-dri-x86-64
-
-ARCH_FLAGS = -m64
-
-ASM_FLAGS = -DUSE_X86_64_ASM
-ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
-
-LIB_DIR = $(TOP)/lib64
-
-# Library/program dependencies
-EXTRA_LIB_PATH=-L/usr/X11R6/lib64
-
-# ffb, gamma, and sis are missing because they have not be converted to use
-# the new interface. i810 and i830 are missing because there is no x86-64
-# system where they could *ever* be used.
-#
-DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300
-
diff --git a/nx-X11/extras/Mesa/configs/linux-fbdev b/nx-X11/extras/Mesa/configs/linux-fbdev
deleted file mode 100644
index c357485ea..000000000
--- a/nx-X11/extras/Mesa/configs/linux-fbdev
+++ /dev/null
@@ -1,10 +0,0 @@
-# Configuration for Linux fbdev interface
-
-include $(TOP)/configs/linux
-
-CONFIG_NAME = linux-fbdev
-DRIVER_DIRS = fbdev
-
-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -DUSE_GLFBDEV_DRIVER
-
-PROGRAM_DIRS = fbdev
diff --git a/nx-X11/extras/Mesa/configs/linux-glide b/nx-X11/extras/Mesa/configs/linux-glide
deleted file mode 100644
index d3e0dc32d..000000000
--- a/nx-X11/extras/Mesa/configs/linux-glide
+++ /dev/null
@@ -1,20 +0,0 @@
-# Configuration for generic Linux with 3Dfx Glide driver
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-glide
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include
-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
-GLUT_CFLAGS = -fexceptions
-
-
-# Library/program dependencies
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm
diff --git a/nx-X11/extras/Mesa/configs/linux-icc b/nx-X11/extras/Mesa/configs/linux-icc
deleted file mode 100644
index 0da3b836a..000000000
--- a/nx-X11/extras/Mesa/configs/linux-icc
+++ /dev/null
@@ -1,21 +0,0 @@
-# Configuration for Linux with Intel C compiler
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-icc
-
-# Compiler and flags
-CC = icc
-CXX = g++
-CFLAGS = -O3 -tpp6 -axK -KPIC -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
-CXXFLAGS = -O3
-GLUT_CFLAGS = -fexceptions
-MKLIB_OPTIONS = -arch icc
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
-
-
diff --git a/nx-X11/extras/Mesa/configs/linux-icc-static b/nx-X11/extras/Mesa/configs/linux-icc-static
deleted file mode 100644
index 5c65f0561..000000000
--- a/nx-X11/extras/Mesa/configs/linux-icc-static
+++ /dev/null
@@ -1,29 +0,0 @@
-# Configuration for Linux with Intel C compiler, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-icc-static
-
-# Compiler and flags
-CC = icc
-CXX = g++
-CFLAGS = -O3 -tpp6 -axK -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
-CXXFLAGS = -O3
-GLUT_CFLAGS = -fexceptions
-MKLIB_OPTIONS = -static -arch icc
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-MKLIB_OPTIONS = -arch icc
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
-
-
diff --git a/nx-X11/extras/Mesa/configs/linux-indirect b/nx-X11/extras/Mesa/configs/linux-indirect
deleted file mode 100644
index 93166e2e9..000000000
--- a/nx-X11/extras/Mesa/configs/linux-indirect
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-indirect: Builds a libGL capable of indirect
-# rendering, but *NOT* capable of direct rendering.
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-dri
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-MKDEP = /usr/X11R6/bin/makedepend
-#MKDEP = gcc -M
-#MKDEP_OPTIONS = -MF depend
-
-WARN_FLAGS = -Wall
-OPT_FLAGS = -O -g
-PIC_FLAGS = -fPIC
-
-# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -D_GNU_SOURCE \
- -DPTHREADS -DHAVE_ALIAS
-
-X11_INCLUDES = -I/usr/X11R6/include
-
-CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(ASM_FLAGS) -std=c99 -ffast-math
-
-CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-
-ASM_SOURCES =
-
-# Library/program dependencies
-EXTRA_LIB_PATH=-L/usr/X11R6/lib
-
-DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
-
-
-# Directories
-SRC_DIRS = glx/x11 glu glut/glx glw
-DRIVER_DIRS =
-PROGRAM_DIRS =
-WINDOW_SYSTEM=dri
diff --git a/nx-X11/extras/Mesa/configs/linux-osmesa16 b/nx-X11/extras/Mesa/configs/linux-osmesa16
deleted file mode 100644
index 16a3b0bba..000000000
--- a/nx-X11/extras/Mesa/configs/linux-osmesa16
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configuration for 16 bits/channel OSMesa library on Linux
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-osmesa16
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
-
-
-# Library names
-OSMESA_LIB = OSMesa16
-OSMESA_LIB_NAME = libOSMesa16.so
-
-
-# Directories
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
-
-
-# Dependencies
-OSMESA_LIB_DEPS = -lm -lpthread
-APP_LIB_DEPS = -lOSMesa16
diff --git a/nx-X11/extras/Mesa/configs/linux-osmesa16-static b/nx-X11/extras/Mesa/configs/linux-osmesa16-static
deleted file mode 100644
index 664550447..000000000
--- a/nx-X11/extras/Mesa/configs/linux-osmesa16-static
+++ /dev/null
@@ -1,28 +0,0 @@
-# Configuration for 16 bits/channel OSMesa library on Linux
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-osmesa16-static
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
-CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
-MKLIB_OPTIONS = -static
-
-
-# Library names
-OSMESA_LIB = OSMesa16
-OSMESA_LIB_NAME = libOSMesa16.a
-
-
-# Directories
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
-
-
-# Dependencies
-OSMESA_LIB_DEPS = -lm -lpthread
-APP_LIB_DEPS = -lOSMesa16
diff --git a/nx-X11/extras/Mesa/configs/linux-osmesa32 b/nx-X11/extras/Mesa/configs/linux-osmesa32
deleted file mode 100644
index 0ff0a6db9..000000000
--- a/nx-X11/extras/Mesa/configs/linux-osmesa32
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configuration for 32 bits/channel OSMesa library on Linux
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-osmesa32
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
-
-
-# Library names
-OSMESA_LIB = OSMesa32
-OSMESA_LIB_NAME = libOSMesa32.so
-
-
-# Directories
-SRC_DIRS = mesa glu
-DRIVER_DIRS = osmesa
-PROGRAM_DIRS =
-
-
-# Dependencies
-OSMESA_LIB_DEPS = -lm -lpthread
-APP_LIB_DEPS = -lOSMesa32
diff --git a/nx-X11/extras/Mesa/configs/linux-ppc b/nx-X11/extras/Mesa/configs/linux-ppc
deleted file mode 100644
index 13cfdeb42..000000000
--- a/nx-X11/extras/Mesa/configs/linux-ppc
+++ /dev/null
@@ -1,9 +0,0 @@
-# Configuration for Linux on PPC
-
-include $(TOP)/configs/linux
-
-CONFIG_NAME = linux-ppc
-
-OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops
-
-# FIXME: Use of PowerPC assembly should be enabled here. \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/configs/linux-ppc-static b/nx-X11/extras/Mesa/configs/linux-ppc-static
deleted file mode 100644
index d0e168811..000000000
--- a/nx-X11/extras/Mesa/configs/linux-ppc-static
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration for Linux on PPC, static libs
-
-include $(TOP)/configs/linux-ppc
-
-CONFIG_NAME = linux-ppc-static
-
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
diff --git a/nx-X11/extras/Mesa/configs/linux-profile b/nx-X11/extras/Mesa/configs/linux-profile
deleted file mode 100644
index b2531f562..000000000
--- a/nx-X11/extras/Mesa/configs/linux-profile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Configuration for profiling on Linux with gprof
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-profile
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -pg -O -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG
-
-CXXFLAGS = -pg -O -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
-
-GLUT_CFLAGS = -fexceptions
-
-# Need to have -L/usr/X11R6/lib in these:
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11
-
-# Need to make static libs for profiling:
-MKLIB_OPTIONS = -static
-GL_LIB_NAME = lib$(GL_LIB).a
-GLU_LIB_NAME = lib$(GLU_LIB).a
-GLUT_LIB_NAME = lib$(GLUT_LIB).a
-GLW_LIB_NAME = lib$(GLW_LIB).a
-OSMESA_LIB_NAME = lib$(OSMesa).a
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
diff --git a/nx-X11/extras/Mesa/configs/linux-solo b/nx-X11/extras/Mesa/configs/linux-solo
deleted file mode 100644
index a3deb7c20..000000000
--- a/nx-X11/extras/Mesa/configs/linux-solo
+++ /dev/null
@@ -1,43 +0,0 @@
-# Configuration for linux-solo: Linux DRI hardware drivers for fbdev
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-solo
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-WARN_FLAGS = -Wall -Wundef
-OPT_FLAGS = -O3 -g
-PIC_FLAGS = -fPIC
-
-# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -D_GNU_SOURCE \
- -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC -DIN_DRI_DRIVER
-
-CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(ASM_FLAGS) -std=c99 -ffast-math
-
-CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-
-ASM_SOURCES =
-
-# Library/program dependencies
-DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR)
-GL_LIB_DEPS = -lm -lpthread -ldl
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
-
-# Directories
-SRC_DIRS = glx/mini mesa glu glut/mini
-DRIVER_DIRS = dri
-PROGRAM_DIRS = miniglx
-
-#DRI_DIRS = ffb gamma sis savage
-DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
diff --git a/nx-X11/extras/Mesa/configs/linux-solo-ia64 b/nx-X11/extras/Mesa/configs/linux-solo-ia64
deleted file mode 100644
index b2051fac8..000000000
--- a/nx-X11/extras/Mesa/configs/linux-solo-ia64
+++ /dev/null
@@ -1,7 +0,0 @@
-# Configuration for linux-solo-ia64: Linux DRI hardware drivers for fbdev
-
-include $(TOP)/configs/linux-solo
-
-CONFIG_NAME = linux-solo-ia64
-
-DRI_DIRS = fb mach64 mga r128 r200 radeon sis tdfx unichrome
diff --git a/nx-X11/extras/Mesa/configs/linux-solo-x86 b/nx-X11/extras/Mesa/configs/linux-solo-x86
deleted file mode 100644
index b4e79ba2c..000000000
--- a/nx-X11/extras/Mesa/configs/linux-solo-x86
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*-makefile-*-
-# Configuration for linux-solo-x86: Linux hardware drivers for fbdev for x86
-
-include $(TOP)/configs/linux-solo
-
-CONFIG_NAME = linux-solo-x86
-
-# Unnecessary on x86, generally.
-PIC_FLAGS =
-
-ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-ASM_SOURCES = $(X86_SOURCES)
diff --git a/nx-X11/extras/Mesa/configs/linux-sparc b/nx-X11/extras/Mesa/configs/linux-sparc
deleted file mode 100644
index 15e0b6d4b..000000000
--- a/nx-X11/extras/Mesa/configs/linux-sparc
+++ /dev/null
@@ -1,30 +0,0 @@
-# Configuration for Linux on Sparc
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-sparc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-WARN_FLAGS = -Wall
-OPT_FLAGS = -O2
-PIC_FLAGS = -fPIC
-
-DEFINES = -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM
-
-X11_INCLUDES = -I/usr/X11R6/include
-
-CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(ASM_FLAGS) -std=c99 -ffast-math
-
-CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-GLUT_CFLAGS = -fexceptions
-
-EXTRA_LIB_PATH=-L/usr/X11R6/lib
-
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11
diff --git a/nx-X11/extras/Mesa/configs/linux-sparc5 b/nx-X11/extras/Mesa/configs/linux-sparc5
deleted file mode 100644
index aa9461af7..000000000
--- a/nx-X11/extras/Mesa/configs/linux-sparc5
+++ /dev/null
@@ -1,17 +0,0 @@
-# Configuration for Linux on Sparc5
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-sparc5
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -mcpu=ultrasparc -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
-CXXFLAGS = -mcpu=ultrasparc -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE
-GLUT_CFLAGS = -fexceptions
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-
diff --git a/nx-X11/extras/Mesa/configs/linux-static b/nx-X11/extras/Mesa/configs/linux-static
deleted file mode 100644
index 0104d3402..000000000
--- a/nx-X11/extras/Mesa/configs/linux-static
+++ /dev/null
@@ -1,21 +0,0 @@
-# Configuration for generic Linux, making static libs
-
-include $(TOP)/configs/linux
-
-CONFIG_NAME = linux-static
-
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies (static libs don't have dependencies)
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS =
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS =
-GLW_LIB_DEPS =
diff --git a/nx-X11/extras/Mesa/configs/linux-tcc b/nx-X11/extras/Mesa/configs/linux-tcc
deleted file mode 100644
index 4371fe21f..000000000
--- a/nx-X11/extras/Mesa/configs/linux-tcc
+++ /dev/null
@@ -1,22 +0,0 @@
-# Configuration for debugging on Linux
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-tcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-TCC_DIR=/home/progs/tcc-0.9.20
-
-CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR)
-
-CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
-
-GLUT_CFLAGS = -fexceptions
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L$(TCC_DIR) -ltcc -ldl
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/nx-X11/extras/Mesa/configs/linux-ultrasparc b/nx-X11/extras/Mesa/configs/linux-ultrasparc
deleted file mode 100644
index e235b56de..000000000
--- a/nx-X11/extras/Mesa/configs/linux-ultrasparc
+++ /dev/null
@@ -1,17 +0,0 @@
-# Configuration for Linux on UltraSparc
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-ultrasparc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -mv8 -O2 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
-CXXFLAGS = -mv8 -O2 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE
-GLUT_CFLAGS = -fexceptions
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR)-l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/nx-X11/extras/Mesa/configs/linux-x86 b/nx-X11/extras/Mesa/configs/linux-x86
deleted file mode 100644
index b239653e6..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86
+++ /dev/null
@@ -1,8 +0,0 @@
-# Configuration for Linux with x86 optimizations
-
-include $(TOP)/configs/linux
-
-CONFIG_NAME = linux-x86
-
-ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-32 b/nx-X11/extras/Mesa/configs/linux-x86-32
deleted file mode 100644
index f18ce7a45..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-32
+++ /dev/null
@@ -1,7 +0,0 @@
-# To build Linux x86 32-bit in an x86-64 environment
-
-include $(TOP)/configs/linux-x86
-
-CONFIG_NAME = linux-x86-32
-
-ARCH_FLAGS += -m32
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-64 b/nx-X11/extras/Mesa/configs/linux-x86-64
deleted file mode 100644
index f8ff5489f..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-64
+++ /dev/null
@@ -1,13 +0,0 @@
-# Configuration for Linux for 64-bit X86 (Opteron)
-
-include $(TOP)/configs/linux
-
-CONFIG_NAME = linux-x86-64
-
-ARCH_FLAGS = -m64
-
-ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
-ASM_FLAGS = -DUSE_X86_64_ASM
-
-LIB_DIR = $(TOP)/lib64
-EXTRA_LIB_PATH = -L/usr/X11R6/lib64
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-64-debug b/nx-X11/extras/Mesa/configs/linux-x86-64-debug
deleted file mode 100644
index bbdaec801..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-64-debug
+++ /dev/null
@@ -1,7 +0,0 @@
-# Configuration for Linux for 64-bit X86 (Opteron)
-
-include $(TOP)/configs/linux-x86-64
-
-CONFIG_NAME = linux-x86-64-debug
-
-DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-64-static b/nx-X11/extras/Mesa/configs/linux-x86-64-static
deleted file mode 100644
index 05f21d87a..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-64-static
+++ /dev/null
@@ -1,21 +0,0 @@
-# Configuration for Linux for 64-bit X86 (Opteron), static libs
-
-include $(TOP)/configs/linux-x86-64
-
-CONFIG_NAME = linux-x86-64-static
-
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies (static libs don't have dependencies)
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS =
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS =
-GLW_LIB_DEPS =
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-debug b/nx-X11/extras/Mesa/configs/linux-x86-debug
deleted file mode 100644
index dbb970300..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-debug
+++ /dev/null
@@ -1,9 +0,0 @@
-# Configuration for Linux with x86 code, but no gcc optimizations and
-# debugging enabled.
-
-include $(TOP)/configs/linux-x86
-
-CONFIG_NAME = linux-x86-debug
-
-OPT_FLAGS = -g
-DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-glide b/nx-X11/extras/Mesa/configs/linux-x86-glide
deleted file mode 100644
index b874b923f..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-glide
+++ /dev/null
@@ -1,24 +0,0 @@
-# Configuration for Linux with 3Dfx Glide driver and x86 optimizations
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-x86-glide
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include
-
-CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
-
-GLUT_CFLAGS = -fexceptions
-
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
-
-# Library/program dependencies
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-static b/nx-X11/extras/Mesa/configs/linux-x86-static
deleted file mode 100644
index d4ccfca80..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-static
+++ /dev/null
@@ -1,21 +0,0 @@
-# Configuration for Linux with x86 optimizations, static libs
-
-include $(TOP)/configs/linux-x86
-
-CONFIG_NAME = linux-x86-static
-
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies (static libs don't have dependencies)
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS =
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS =
-GLW_LIB_DEPS =
diff --git a/nx-X11/extras/Mesa/configs/linux-x86-xcb b/nx-X11/extras/Mesa/configs/linux-x86-xcb
deleted file mode 100644
index 7c5074c30..000000000
--- a/nx-X11/extras/Mesa/configs/linux-x86-xcb
+++ /dev/null
@@ -1,24 +0,0 @@
-# Configuration for Linux with x86 optimizations
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-x86-xcb
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include
-
-CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB
-
-GLUT_CFLAGS = -fexceptions
-
-
-ASM_SOURCES = $(X86_SOURCES) $(X86_API)
-
-# Library/program dependencies
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/nx-X11/extras/Mesa/configs/netbsd b/nx-X11/extras/Mesa/configs/netbsd
deleted file mode 100644
index 104daae0d..000000000
--- a/nx-X11/extras/Mesa/configs/netbsd
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration for NetBSD
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = netbsd
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100
-CXXFLAGS = -O2 -fPIC
-GLUT_CFLAGS = -fexceptions
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
-
diff --git a/nx-X11/extras/Mesa/configs/openbsd b/nx-X11/extras/Mesa/configs/openbsd
deleted file mode 100644
index f769259a3..000000000
--- a/nx-X11/extras/Mesa/configs/openbsd
+++ /dev/null
@@ -1,18 +0,0 @@
-# Configuration for OpenBSD
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = openbsd
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DUSE_XSHM -DHZ=100
-CXXFLAGS = -O2 -fPIC -I/usr/X11R6/include -DHZ=100
-
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm
-OSMESA_LIB_DEPS = -lm
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB)
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
-
diff --git a/nx-X11/extras/Mesa/configs/osf1 b/nx-X11/extras/Mesa/configs/osf1
deleted file mode 100644
index bc88c2042..000000000
--- a/nx-X11/extras/Mesa/configs/osf1
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration for OSF/1
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = osf1
-
-# Compiler and flags
-CC = cc
-CXX = cxx
-CFLAGS = -O0 -std1 -ieee_with_no_inexact -DUSE_XSHM
-CXXFLAGS = -O2 -std ansi -ieee
-
-GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm
diff --git a/nx-X11/extras/Mesa/configs/solaris-x86 b/nx-X11/extras/Mesa/configs/solaris-x86
deleted file mode 100644
index 7a04417f0..000000000
--- a/nx-X11/extras/Mesa/configs/solaris-x86
+++ /dev/null
@@ -1,18 +0,0 @@
-# Configuration for Solaris on x86
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = solaris-x86
-
-# Compiler and flags
-CC = cc
-CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM
-MKLIB_OPTIONS = -static
-
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -lglut -lGLU -lGL
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
diff --git a/nx-X11/extras/Mesa/configs/solaris-x86-gcc b/nx-X11/extras/Mesa/configs/solaris-x86-gcc
deleted file mode 100644
index 01f3d86d1..000000000
--- a/nx-X11/extras/Mesa/configs/solaris-x86-gcc
+++ /dev/null
@@ -1,24 +0,0 @@
-# Configuration for Solaris on x86 with gcc, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = solaris-x86-gcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -O3 -m486 -fPIC -I/usr/openwin/include -DUSE_XSHM
-CXXFLAGS = -O3 -m486 -fPIC
-GLUT_CFLAGS = -fexceptions
-MKLIB_OPTIONS = -static
-
-GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lX11 -lXmu -lXt -lXi -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
diff --git a/nx-X11/extras/Mesa/configs/sunos4 b/nx-X11/extras/Mesa/configs/sunos4
deleted file mode 100644
index 483b9aa73..000000000
--- a/nx-X11/extras/Mesa/configs/sunos4
+++ /dev/null
@@ -1,12 +0,0 @@
-# Configuration for SunOS 4, shared libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = sunos4
-
-# Compiler and flags
-CC = acc
-CFLAGS = -Kpic -O -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/lib/X11R5 -lX11 -lXext -lXmu -lXi -lm
-
-
diff --git a/nx-X11/extras/Mesa/configs/sunos4-gcc b/nx-X11/extras/Mesa/configs/sunos4-gcc
deleted file mode 100644
index 8fb1414fa..000000000
--- a/nx-X11/extras/Mesa/configs/sunos4-gcc
+++ /dev/null
@@ -1,15 +0,0 @@
-# Configuration for SunOS 4, with gcc, shared libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = sunos4-gcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4
-CXXFLAGS = -fPIC -O3 -I/usr/openwin/include -DSUNOS4
-GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG
-
-APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
-
diff --git a/nx-X11/extras/Mesa/configs/sunos4-static b/nx-X11/extras/Mesa/configs/sunos4-static
deleted file mode 100644
index 3e510e751..000000000
--- a/nx-X11/extras/Mesa/configs/sunos4-static
+++ /dev/null
@@ -1,25 +0,0 @@
-# Configuration for SunOS 4, static libs
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = sunos4-static
-
-# Compiler and flags
-CC = acc
-CFLAGS = -O -DUSE_XSHM -DSUNOS4
-MKLIB_OPTIONS = -static
-
-# Library names (actual file names)
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-# Library/program dependencies (static libs don't have dependencies)
-GL_LIB_DEPS =
-OSMESA_LIB_DEPS =
-GLU_LIB_DEPS =
-GLUT_LIB_DEPS =
-GLW_LIB_DEPS =
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm
diff --git a/nx-X11/extras/Mesa/configs/sunos5 b/nx-X11/extras/Mesa/configs/sunos5
deleted file mode 100644
index 9347fb842..000000000
--- a/nx-X11/extras/Mesa/configs/sunos5
+++ /dev/null
@@ -1,18 +0,0 @@
-# Configuration for SunOS 5
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = sunos5
-
-# Compiler and flags
-CC = cc
-CXX = c++
-CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM
-CXXFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include
-GLUT_CFLAGS = -DSOLARIS_2_4_BUG
-
-GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -lCrun -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/nx-X11/extras/Mesa/configs/sunos5-gcc b/nx-X11/extras/Mesa/configs/sunos5-gcc
deleted file mode 100644
index 7917c9b00..000000000
--- a/nx-X11/extras/Mesa/configs/sunos5-gcc
+++ /dev/null
@@ -1,35 +0,0 @@
-# Configuration for SunOS 5, with gcc
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = sunos5-gcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-WARN_FLAGS = -Wall
-OPT_FLAGS = -O3 -g -fomit-frame-pointer -pipe
-PIC_FLAGS = -fPIC
-
-ARCH_FLAGS ?=
-
-DEFINES = -D_REENTRANT -DUSE_XSHM
-
-ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API)
-ASM_FLAGS = -DUSE_SPARC_ASM
-
-CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- $(ASM_FLAGS) -std=c99 -ffast-math -I/usr/openwin/include
-
-CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
- -I/usr/openwin/include
-
-GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG
-
-# Library/program dependencies
-EXTRA_LIB_PATH=-L/usr/openwin/lib
-
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXi -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
-APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/nx-X11/extras/Mesa/configs/sunos5-smp b/nx-X11/extras/Mesa/configs/sunos5-smp
deleted file mode 100644
index 633bced68..000000000
--- a/nx-X11/extras/Mesa/configs/sunos5-smp
+++ /dev/null
@@ -1,19 +0,0 @@
-# Configuration for SunOS 5, SMP systems
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = sunos5-smp
-
-# Compiler and flags
-CC = cc
-CXX = c++
-CFLAGS = -KPIC -Xa -native -fast -xO5 -xlibmil -xsafe=mem -xdepend -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG
-CXXFLAGS = -KPIC -Xa -native -fast -xO5 -xlibmil -xsafe=mem -xdepend -I/usr/openwin/include -I/usr/dt/include
-GLUT_CFLAGS = -DSOLARIS_2_4_BUG
-
-GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
-GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
-GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
-GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
-APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lCrun
-
diff --git a/nx-X11/extras/Mesa/configs/ultrix-gcc b/nx-X11/extras/Mesa/configs/ultrix-gcc
deleted file mode 100644
index c65e27582..000000000
--- a/nx-X11/extras/Mesa/configs/ultrix-gcc
+++ /dev/null
@@ -1,21 +0,0 @@
-# Configuration for Ultrix, with gcc
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = ultrix-gcc
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-CFLAGS = -pedantic -O2
-CXXFLAGS = -pedantic -O2
-GLUT_CFLAGS = -fexceptions
-MKLIB_OPTIONS = -static
-
-GL_LIB_NAME = libGL.a
-GLU_LIB_NAME = libGLU.a
-GLUT_LIB_NAME = libglut.a
-GLW_LIB_NAME = libGLw.a
-OSMESA_LIB_NAME = libOSMesa.a
-
-APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXmu -lX11 -lXi -lm
diff --git a/nx-X11/extras/Mesa/descrip.mms b/nx-X11/extras/Mesa/descrip.mms
deleted file mode 100644
index 11d949889..000000000
--- a/nx-X11/extras/Mesa/descrip.mms
+++ /dev/null
@@ -1,22 +0,0 @@
-# Makefile for Mesa for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-macro :
- @ macro=""
-.ifdef NOSHARE
-.else
- @ if f$getsyi("HW_MODEL") .ge. 1024 then macro= "/MACRO=(SHARE=1)"
-.endif
- $(MMS)$(MMSQUALIFIERS)'macro' all
-
-all :
- if f$search("lib.dir") .eqs. "" then create/directory [.lib]
- set default [.src]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.progs.util]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.demos]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.xdemos]
- $(MMS)$(MMSQUALIFIERS)
- if f$search("[-]test.DIR") .nes. "" then pipe set default [-.test] ; $(MMS)$(MMSQUALIFIERS)
diff --git a/nx-X11/extras/Mesa/docs/COPYING b/nx-X11/extras/Mesa/docs/COPYING
deleted file mode 100644
index b88946cc6..000000000
--- a/nx-X11/extras/Mesa/docs/COPYING
+++ /dev/null
@@ -1,490 +0,0 @@
-
-Some parts of Mesa are copyrighted under the GNU LGPL. See the
-Mesa/docs/COPYRIGHT file for details.
-
-The following is the standard GNU copyright file.
-----------------------------------------------------------------------
-
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- c) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- d) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_agp_offset.spec b/nx-X11/extras/Mesa/docs/MESA_agp_offset.spec
deleted file mode 100644
index 8dcc72379..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_agp_offset.spec
+++ /dev/null
@@ -1,95 +0,0 @@
-Name
-
- MESA_agp_offset
-
-Name Strings
-
- GLX_MESA_agp_offset
-
-Contact
-
- Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com)
- Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com)
-
-Status
-
- Shipping (Mesa 4.0.4 and later. Only implemented in particular
- XFree86/DRI drivers.)
-
-Version
-
- 1.0
-
-Number
-
- TBD
-
-Dependencies
-
- OpenGL 1.0 or later is required
- GLX_NV_vertex_array_range is required.
- This extensions is written against the OpenGL 1.4 Specification.
-
-Overview
-
- This extensions provides a way to convert pointers in an AGP memory
- region into byte offsets into the AGP aperture.
- Note, this extension depends on GLX_NV_vertex_array_range, for which
- no real specification exists. See GL_NV_vertex_array_range for more
- information.
-
-IP Status
-
- None
-
-Issues
-
- None
-
-New Procedures and Functions
-
- unsigned int glXGetAGPOffsetMESA( const void *pointer )
-
-New Tokens
-
- None
-
-Additions to the OpenGL 1.4 Specification
-
- None
-
-Additions to Chapter 3 the GLX 1.4 Specification (Functions and Errors)
-
- Add a new section, 3.6 as follows:
-
- 3.6 AGP Memory Access
-
- On "PC" computers, AGP memory can be allocated with glXAllocateMemoryNV
- and freed with glXFreeMemoryNV. Sometimes it's useful to know where a
- block of AGP memory is located with respect to the start of the AGP
- aperature. The function
-
- GLuint glXGetAGPOffsetMESA( const GLvoid *pointer )
-
- Returns the offset of the given memory block from the start of AGP
- memory in basic machine units (i.e. bytes). If pointer is invalid
- the value ~0 will be returned.
-
-GLX Protocol
-
- None. This is a client side-only extension.
-
-Errors
-
- glXGetAGPOffsetMESA will return ~0 if the pointer does not point to
- an AGP memory region.
-
-New State
-
- None
-
-Revision History
-
- 20 September 2002 - Initial draft
- 2 October 2002 - finished GLX chapter 3 additions
- 27 July 2004 - use unsigned int instead of GLuint, void instead of GLvoid
diff --git a/nx-X11/extras/Mesa/docs/MESA_copy_sub_buffer.spec b/nx-X11/extras/Mesa/docs/MESA_copy_sub_buffer.spec
deleted file mode 100644
index 43424a5f4..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_copy_sub_buffer.spec
+++ /dev/null
@@ -1,88 +0,0 @@
-Name
-
- MESA_copy_sub_buffer
-
-Name Strings
-
- GLX_MESA_copy_sub_buffer
-
-Contact
-
- Brian Paul (brian.paul 'at' tungstengraphics.com)
-
-Status
-
- Shipping since Mesa 2.6 in February, 1998.
-
-Version
-
- Last Modified Date: 8 June 2000
-
-Number
-
- 215
-
-Dependencies
-
- OpenGL 1.0 or later is required.
- GLX 1.0 or later is required.
-
-Overview
-
- The glxCopySubBufferMESA() function copies a rectangular region
- of the back color buffer to the front color buffer. This can be
- used to quickly repaint 3D windows in response to expose events
- when the back color buffer cannot be damaged by other windows.
-
-IP Status
-
- Open-source; freely implementable.
-
-Issues
-
- None.
-
-New Procedures and Functions
-
- void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height );
-
-New Tokens
-
- None.
-
-Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
-
- Add to section 3.3.10 Double Buffering:
-
- The function
-
- void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height );
-
- may be used to copy a rectangular region of the back color buffer to
- the front color buffer. This can be used to quickly repaint 3D windows
- in response to expose events when the back color buffer cannot be
- damaged by other windows.
-
- <x> and <y> indicates the lower-left corner of the region to copy and
- <width> and <height> indicate the size in pixels. Coordinate (0,0)
- corresponds to the lower-left pixel of the window, like glReadPixels.
-
-GLX Protocol
-
- None at this time. The extension is implemented in terms of ordinary
- Xlib protocol inside of Mesa.
-
-Errors
-
- None.
-
-New State
-
- None.
-
-Revision History
-
- 8 June 2000 - initial specification
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_pack_invert.spec b/nx-X11/extras/Mesa/docs/MESA_pack_invert.spec
deleted file mode 100644
index 53d5fca71..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_pack_invert.spec
+++ /dev/null
@@ -1,138 +0,0 @@
-Name
-
- MESA_pack_invert
-
-Name Strings
-
- GL_MESA_pack_invert
-
-Contact
-
- Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com)
- Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com)
-
-Status
-
- Shipping (Mesa 4.0.4 and later)
-
-Version
-
- 1.0
-
-Number
-
- TBD
-
-Dependencies
-
- OpenGL 1.0 or later is required
- This extensions is written against the OpenGL 1.4 Specification.
-
-Overview
-
- This extension adds a new pixel storage parameter to indicate that
- images are to be packed in top-to-bottom order instead of OpenGL's
- conventional bottom-to-top order. Only pixel packing can be
- inverted (i.e. for glReadPixels, glGetTexImage, glGetConvolutionFilter,
- etc).
-
- Almost all known image file formats store images in top-to-bottom
- order. As it is, OpenGL reads images from the frame buffer in
- bottom-to-top order. Thus, images usually have to be inverted before
- writing them to a file with image I/O libraries. This extension
- allows images to be read such that inverting isn't needed.
-
-IP Status
-
- None
-
-Issues
-
- 1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc?
-
- Resolved: No, we're only concerned with pixel packing. There are other
- solutions for inverting images when using glDrawPixels (negative Y pixel
- zoom) or glTexImage (invert the vertex T coordinates). It would be easy
- enough to define a complementary extension for pixel packing in the
- future if needed.
-
-New Procedures and Functions
-
- None
-
-New Tokens
-
- Accepted by the <pname> parameter of PixelStorei and PixelStoref
- and the <pname> parameter of GetIntegerv, GetFloatv, GetDoublev
- and GetBooleanv:
-
- PACK_INVERT_MESA 0x8758
-
-Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
-
- None
-
-Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
-
- None
-
-Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
-Operations and the Frame Buffer)
-
- Add the following entry to table 4.4 (PixelStore parameters) on page 182:
-
- Parameter Name Type Initial Value Valid Range
- ---------------------------------------------------------
- PACK_INVERT_MESA boolean FALSE TRUE/FALSE
-
- In the section labeled "Placement in Client Memory" on page 184
- insert the following text into the paragraph before the sentence
- that starts with "If the format is RED, GREEN, BLUE...":
-
- "The parameter PACK_INVERT_MESA controls whether the image is packed
- in bottom-to-top order (the default) or top-to-bottom order. Equation
- 3.8 is modified as follows:
-
- ... the first element of the Nth row is indicated by
-
- p + Nk, if PACK_INVERT_MESA is false
- p + k * (H - 1) - Nk, if PACK_INVERT_MESA is true, where H is the
- image height
- "
-
-Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
-
- None
-
-Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
-State Requests)
-
- None
-
-Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
-
- None
-
-Additions to the AGL/GLX/WGL Specifications
-
- None
-
-GLX Protocol
-
- None
-
-Errors
-
- None
-
-New State
-
- Add the following entry to table 6.20 (Pixels) on page 235:
-
- Get Value Type Get Cmd Initial Value Description Sec Attribute
- --------------------------------------------------------------------------------------------------
- PACK_INVERT_MESA boolean GetBoolean FALSE Value of PACK_INVERT_MESA 4.3.2 pixel-store
-
-Revision History
-
- 21 September 2002 - Initial draft
diff --git a/nx-X11/extras/Mesa/docs/MESA_packed_depth_stencil.spec b/nx-X11/extras/Mesa/docs/MESA_packed_depth_stencil.spec
deleted file mode 100644
index f4b3e3c92..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_packed_depth_stencil.spec
+++ /dev/null
@@ -1,231 +0,0 @@
-Name
-
- MESA_packed_depth_stencil
-
-Name Strings
-
- GL_MESA_packed_depth_stencil
-
-Contact
-
- Keith Whitwell, VA Linux Systems Inc. (keithw 'at' valinux.com)
- Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
-
-Status
-
- Obsolete.
-
-Version
-
- $Id: MESA_packed_depth_stencil.spec,v 1.1.1.3 2004/08/12 23:43:24 anholt Exp $
-
-Number
-
- ???
-
-Dependencies
-
- EXT_abgr affects the definition of this extension
- SGIS_texture4D affects the definition of this extension
- EXT_cmyka affects the definition of this extension
- ARB_packed_pixels affects the definition of this extension
-
-Overview
-
- Provides a mechanism for DrawPixels and ReadPixels to efficiently
- transfer depth and stencil image data. Specifically, we defined new
- packed pixel formats and types which pack both stencil and depth
- into one value.
-
-Issues:
-
- 1. Is this the right way to distinguish between 24/8 and 8/24
- pixel formats? Should we instead provide both:
-
- GL_DEPTH_STENCIL_MESA
- GL_STENCIL_DEPTH_MESA
-
- And perhaps just use GL_UNSIGNED_INT, GL_UNSIGNED_SHORT ?
-
- 2. If not, is it correct to use _REV to indicate that stencil
- preceeds depth in the 1_15 and 8_24 formats?
-
- 3. Do we really want the GL_UNSIGNED_SHORT formats?
-
-
-New Procedures and Functions
-
- None.
-
-New Tokens
-
- Accepted by the <format> parameter of ReadPixels and DrawPixels:
-
- GL_DEPTH_STENCIL_MESA 0x8750
-
- Accepted by the <type> parameter of ReadPixels and DrawPixels:
-
- GL_UNSIGNED_INT_24_8_MESA 0x8751
- GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
- GL_UNSIGNED_SHORT_15_1_MESA 0x8753
- GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
-
-Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
-
- None
-
-Additions to Chapter 3 of the 1.1 Specification (Rasterization)
-
- One entry is added to table 3.5 (DrawPixels and ReadPixels formats).
- The new table is:
-
- Target
- Format Name Buffer Element Meaning and Order
- ----------- ------ -------------------------
- COLOR_INDEX Color Color index
- STENCIL_INDEX Stencil Stencil index
- DEPTH_COMPONENT Depth Depth component
- RED Color R component
- GREEN Color G component
- BLUE Color B component
- ALPHA Color A component
- RGB Color R, G, B components
- RGBA Color R, G, B, A components
- BGRA Color B, G, R, A components
- ABGR_EXT Color A, B, G, R components
- CMYK_EXT Color Cyan, Magenta, Yellow, Black components
- CMYKA_EXT Color Cyan, Magenta, Yellow, Black, A components
- LUMINANCE Color Luminance component
- LUMINANCE_ALPHA Color Luminance, A components
- DEPTH_STENCIL Depth, Depth component, stencil index.
- Stencil
-
- Table 3.5: DrawPixels and ReadPixels formats. The third column
- gives a description of and the number and order of elements in a
- group.
-
- Add to the description of packed pixel formats:
-
- <type> Parameter Data of Matching
- Token Name Type Elements Pixel Formats
- ---------------- ---- -------- -------------
-
- UNSIGNED_BYTE_3_3_2 ubyte 3 RGB
- UNSIGNED_BYTE_2_3_3_REV ubyte 3 RGB
- UNSIGNED_SHORT_5_6_5 ushort 3 RGB
- UNSIGNED_SHORT_5_6_5_REV ushort 3 RGB
- UNSIGNED_SHORT_4_4_4_4 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
- UNSIGNED_SHORT_4_4_4_4_REV ushort 4 RGBA,BGRA
- UNSIGNED_SHORT_5_5_5_1 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
- UNSIGNED_SHORT_1_5_5_5_REV ushort 4 RGBA,BGRA
- UNSIGNED_INT_8_8_8_8 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
- UNSIGNED_INT_8_8_8_8_REV uint 4 RGBA,BGRA
- UNSIGNED_INT_10_10_10_2 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
- UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA
- UNSIGNED_SHORT_15_1_MESA ushort 2 DEPTH_STENCIL_MESA
- UNSIGNED_SHORT_1_15_REV_MESA ushort 2 DEPTH_STENCIL_MESA
- UNSIGNED_SHORT_24_8_MESA ushort 2 DEPTH_STENCIL_MESA
- UNSIGNED_SHORT_8_24_REV_MESA ushort 2 DEPTH_STENCIL_MESA
-
- UNSIGNED_INT_8_24:
-
- 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- +-----------------------+-----------------------------------------------------------------------+
- | | |
- +-----------------------+-----------------------------------------------------------------------+
-
- first second
- element element
-
-
- UNSIGNED_INT_24_8:
-
- 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- +----------------------------------------------------------------------+------------------------+
- | | |
- +----------------------------------------------------------------------+------------------------+
-
- first second
- element element
-
- UNSIGNED_SHORT_15_1:
-
- 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- +-----------------------------------------------------------+---+
- | | |
- +-----------------------------------------------------------+---+
-
- first second
- element element
-
-
- UNSIGNED_SHORT_1_15_REV:
-
- 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- +---+-----------------------------------------------------------+
- | | |
- +---+-----------------------------------------------------------+
-
- second first
- element element
-
- The assignment of elements to fields in the packed pixel is as
- described in the table below:
-
- First Second Third Fourth
- Format Element Element Element Element
- ------ ------- ------- ------- -------
- RGB red green blue
- RGBA red green blue alpha
- BGRA blue green red alpha
- ABGR_EXT alpha blue green red
- CMYK_EXT cyan magenta yellow black
- DEPTH_STENCIL_MESA depth stencil
-
-Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
-and the Frame Buffer)
-
- The new format is added to the discussion of Obtaining Pixels from the
- Framebuffer. It should read " If the <format> is one of RED, GREEN,
- BLUE, ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, and
- the GL is in color index mode, then the color index is obtained."
-
- The new format is added to the discussion of Index Lookup. It should
- read "If <format> is one of RED, GREEN, BLUE, ALPHA, RGB, RGBA,
- ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, then the index is used to
- reference 4 tables of color components: PIXEL_MAP_I_TO_R,
- PIXEL_MAP_I_TO_G, PIXEL_MAP_I_TO_B, and PIXEL_MAP_I_TO_A."
-
-
-Additions to Chapter 5 of the 1.1 Specification (Special Functions)
-
- None
-
-Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
-
- None
-
-Additions to the GLX Specification
-
- None
-
-GLX Protocol
-
- TBD
-
-Errors
-
- None
-
-New State
-
- None
-
-Revision History
-
- Version 1.0 - 23 Sep 2000
- Keith's original version.
-
- Version 1.1 - 3 Nov 2000
- Brian's edits, assigned values to new enums.
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_pixmap_colormap.spec b/nx-X11/extras/Mesa/docs/MESA_pixmap_colormap.spec
deleted file mode 100644
index fb0b441cc..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_pixmap_colormap.spec
+++ /dev/null
@@ -1,90 +0,0 @@
-Name
-
- MESA_pixmap_colormap
-
-Name Strings
-
- GLX_MESA_pixmap_colormap
-
-Contact
-
- Brian Paul (brian.paul 'at' tungstengraphics.com)
-
-Status
-
- Shipping since Mesa 1.2.8 in May, 1996.
-
-Version
-
- Last Modified Date: 8 June 2000
-
-Number
-
- 216
-
-Dependencies
-
- OpenGL 1.0 or later is required.
- GLX 1.0 or later is required.
-
-Overview
-
- Since Mesa allows RGB rendering into drawables with PseudoColor,
- StaticColor, GrayScale and StaticGray visuals, Mesa needs a colormap
- in order to compute pixel values during rendering.
-
- The colormap associated with a window can be queried with normal
- Xlib functions but there is no colormap associated with pixmaps.
-
- The glXCreateGLXPixmapMESA function is an alternative to glXCreateGLXPixmap
- which allows specification of a colormap.
-
-IP Status
-
- Open-source; freely implementable.
-
-Issues
-
- None.
-
-New Procedures and Functions
-
- GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap, Colormap cmap );
-
-New Tokens
-
- None.
-
-Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
-
- Add to section 3.4.2 Off Screen Rendering
-
- The Mesa implementation of GLX allows RGB rendering into X windows and
- pixmaps of any visual class, not just TrueColor or DirectColor. In order
- to compute pixel values from RGB values Mesa requires a colormap.
-
- The function
-
- GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap, Colormap cmap );
-
- allows one to create a GLXPixmap with a specific colormap. The image
- rendered into the pixmap may then be copied to a window (which uses the
- same colormap and visual) with the expected results.
-
-GLX Protocol
-
- None since this is a client-side extension.
-
-Errors
-
- None.
-
-New State
-
- None.
-
-Revision History
-
- 8 June 2000 - initial specification
diff --git a/nx-X11/extras/Mesa/docs/MESA_program_debug.spec b/nx-X11/extras/Mesa/docs/MESA_program_debug.spec
deleted file mode 100644
index 89429d8f3..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_program_debug.spec
+++ /dev/null
@@ -1,357 +0,0 @@
-Name
-
- MESA_program_debug
-
-Name Strings
-
- GL_MESA_program_debug
-
-Contact
-
- Brian Paul (brian.paul 'at' tungstengraphics.com)
-
-Status
-
- XXX - Not complete yet!!!
-
-Version
-
- Last Modified Date: July 20, 2003
- Author Revision: 1.0
- $Date: 2004/08/12 23:43:24 $ $Revision: 1.1.1.3 $
-
-Number
-
- TBD
-
-Dependencies
-
- OpenGL 1.4 is required
- The extension is written against the OpenGL 1.4 specification.
- ARB_vertex_program or ARB_fragment_program or NV_vertex_program
- or NV_fragment_program is required.
-
-Overview
-
- The extension provides facilities for implementing debuggers for
- vertex and fragment programs.
-
- The concept is that vertex and fragment program debuggers will be
- implemented outside of the GL as a utility package. This extension
- only provides the minimal hooks required to implement a debugger.
-
- There are facilities to do the following:
- 1. Have the GL call a user-specified function prior to executing
- each vertex or fragment instruction.
- 2. Query the current program string's execution position.
- 3. Query the current values of intermediate program values.
-
- The main feature is the ProgramCallbackMESA function. It allows the
- user to register a callback function with the GL. The callback will
- be called prior to executing each vertex or fragment program instruction.
-
- From within the callback, the user may issue Get* commands to
- query current GL state. The GetProgramRegisterfvMESA function allows
- current program values to be queried (such as temporaries, input
- attributes, and result registers).
-
- There are flags for enabling/disabling the program callbacks.
-
- The current execution position (as an offset from the start of the
- program string) can be queried with
- GetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos) or
- GetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos).
-
-
-IP Status
-
- None
-
-Issues
-
- 1. Is this the right model for a debugger?
-
- It seems prudent to minimize the scope of this extension and leave
- it up to the developer (or developer community) to write debuggers
- that layer on top of this extension.
-
- If the debugger were fully implemented within the GL it's not
- clear how terminal and GUI-based interfaces would work, for
- example.
-
- 2. There aren't any other extensions that register callbacks with
- the GL. Isn't there another solution?
-
- If we want to be able to single-step through vertex/fragment
- programs I don't see another way to do it.
-
- 3. How do we prevent the user from doing something crazy in the
- callback function, like trying to call glBegin (leading to
- recursion)?
-
- The rule is that the callback function can only issue glGet*()
- functions and no other GL commands. It could be difficult to
- enforce this, however. Therefore, calling any non-get GL
- command from within the callback will result in undefined
- results.
-
- 4. Is this extension amenable to hardware implementation?
-
- Hopefully, but if not, the GL implementation will have to fall
- back to a software path when debugging. This may be acceptable
- for debugging.
-
- 5. What's the <data> parameter to ProgramCallbackMESA for?
-
- It's a common programming practice to associate a user-supplied
- value with callback functions.
-
- 6. Debuggers often allow one to modify intermediate program values,
- then continue. Does this extension support that?
-
- No.
-
-
-New Procedures and Functions (and datatypes)
-
- typedef void (*programcallbackMESA)(enum target, void *data)
-
- void ProgramCallbackMESA(enum target, programcallbackMESA callback,
- void *data)
-
- void GetProgramRegisterfvMESA(enum target, sizei len,
- const ubyte *registerName, float *v)
-
-New Tokens
-
- Accepted by the <cap> parameter of Enable, Disable, IsEnabled,
- GetBooleanv, GetDoublev, GetFloatv and GetIntegerv:
-
- FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
- VERTEX_PROGRAM_CALLBACK_MESA 0x8bb4
-
- Accepted by the <pname> parameter GetBooleanv, GetDoublev,
- GetFloatv and GetIntegerv:
-
- FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
- VERTEX_PROGRAM_POSITION_MESA 0x8bb4
-
- Accepted by the <pname> parameter of GetPointerv:
-
- FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
- FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
- VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
- VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
-
-Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
-
- None.
-
-Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
-
- None.
-
-Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
-Operations and the Frame Buffer)
-
- None.
-
-Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
-
- In section 5.4 "Display Lists", page 202, add the following command
- to the list of those that are not compiled into display lists:
-
- ProgramCallbackMESA.
-
-
- Add a new section 5.7 "Callback Functions"
-
- The function
-
- void ProgramCallbackMESA(enum target, programcallbackMESA callback,
- void *data)
-
- registers a user-defined callback function with the GL. <target>
- may be FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB. The enabled
- callback functions registered with these targets will be called
- prior to executing each instruction in the current fragment or
- vertex program, respectively. The callbacks are enabled and
- disabled by calling Enable or Disable with <cap>
- FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB.
-
- The callback function's signature must match the typedef
-
- typedef void (*programcallbackMESA)(enum target, void *data)
-
- When the callback function is called, <target> will either be
- FRAGMENT_PROGRAM_ARB or VERTEX_PROGRAM_ARB to indicate which
- program is currently executing and <data> will be the value
- specified when ProgramCallbackMESA was called.
-
- From within the callback function, only the following GL commands
- may be called:
-
- GetBooleanv
- GetDoublev
- GetFloatv
- GetIntegerv
- GetProgramLocalParameter
- GetProgramEnvParameter
- GetProgramRegisterfvMESA
- GetProgramivARB
- GetProgramStringARB
- GetError
-
- Calling any other command from within the callback results in
- undefined behaviour.
-
-
-Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
-State Requests)
-
- Add a new section 6.1.3 "Program Value Queries":
-
- The command
-
- void GetProgramRegisterfvMESA(enum target, sizei len,
- const ubyte *registerName,
- float *v)
-
- Is used to query the value of program variables and registers
- during program execution. GetProgramRegisterfvMESA may only be
- called from within a callback function registered with
- ProgramCallbackMESA.
-
- <registerName> and <len> specify the name a variable, input
- attribute, temporary, or result register in the program string.
- The current value of the named variable is returned as four
- values in <v>. If <name> doesn't exist in the program string,
- the error INVALID_OPERATION is generated.
-
-Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
-
- None.
-
-Additions to the AGL/GLX/WGL Specifications
-
- None.
-
-GLX Protocol
-
- XXX TBD
-
-Dependencies on NV_vertex_program and NV_fragment_program
-
- If NV_vertex_program and/or NV_fragment_program are supported,
- vertex and/or fragment programs defined by those extensions may
- be debugged as well. Register queries will use the syntax used
- by those extensions (i.e. "v[X]" to query vertex attributes,
- "o[X]" for vertex outputs, etc.)
-
-Errors
-
- INVALID_OPERATION is generated if ProgramCallbackMESA is called
- between Begin and End.
-
- INVALID_ENUM is generated by ProgramCallbackMESA if <target> is not
- a supported vertex or fragment program type.
-
- Note: INVALID_OPERAION IS NOT generated by GetProgramRegisterfvMESA,
- GetBooleanv, GetDoublev, GetFloatv, or GetIntegerv if called between
- Begin and End when a vertex or fragment program is currently executing.
-
- INVALID_ENUM is generated by ProgramCallbackMESA,
- GetProgramRegisterfvMESA if <target> is not a program target supported
- by ARB_vertex_program, ARB_fragment_program (or NV_vertex_program or
- NV_fragment_program).
-
- INVALID_VALUE is generated by GetProgramRegisterfvMESA if <registerName>
- does not name a known program register or variable.
-
- INVALID_OPERATION is generated by GetProgramRegisterfvMESA when a
- register query is attempted for a program target that's not currently
- being executed.
-
-
-New State
-
- XXX finish
-
-(table 6.N, p. ###)
- Initial
- Get Value Type Get Command Value Description Sec. Attribute
- --------- ---- ----------- ----- ----------- ---- ---------
- FRAGMENT_PROGRAM_CALLBACK_MESA B IsEnabled FALSE XXX XXX enable
- VERTEX_PROGRAM_CALLBACK_MESA B IsEnabled FALSE XXX XXX enable
- FRAGMENT_PROGRAM_POSITION_MESA Z+ GetIntegerv -1 XXX XXX -
- VERTEX_PROGRAM_POSITION_MESA Z+ GetIntegerv -1 XXX XXX -
- FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA P GetPointerv NULL XXX XXX -
- VERTEX_PROGRAM_CALLBACK_FUNC_MESA P GetPointerv NULL XXX XXX -
- FRAGMENT_PROGRAM_CALLBACK_DATA_MESA P GetPointerv NULL XXX XXX -
- VERTEX_PROGRAM_CALLBACK_DATA_MESA P GetPointerv NULL XXX XXX -
-
- XXX more?
-
-New Implementation Dependent State
-
- None.
-
-Revision History
-
- 8 July 2003
- Initial draft. (Brian Paul)
- 11 July 2003
- Second draft. (Brian Paul)
- 20 July 2003
- Third draft. Lots of fundamental changes. (Brian Paul)
- 23 July 2003
- Added chapter 5 and 6 spec language. (Brian Paul)
-
-Example Usage
-
- The following is a very simple example of how this extension may
- be used to print the values of R0, R1, R2 and R3 while executing
- vertex programs.
-
-
- /* This is called by the GL when the vertex program is executing.
- * We can only make glGet* calls from within this function!
- */
- void DebugCallback(GLenum target, GLvoid *data)
- {
- GLint pos;
- GLuint i;
-
- /* Get PC and current instruction string */
- glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_ARB, &pos);
-
- printf("Current position: %d\n", pos);
-
- printf("Current temporary registers:\n");
- for (i = 0; i < 4; i++) {
- GLfloat v[4];
- char s[10];
- sprintf(s, "R%d", i);
- glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_ARB, strlen(s), s, v);
- printf("R%d = %g, %g, %g, %g\n", i, v[0], v[1], v[2], v[3]);
- }
- }
-
-
- /*
- * elsewhere...
- */
-
- /* Register our debugger callback function */
- glProgramCallbackMESA(GL_VERTEX_PROGRAM_ARB, DebugCallback, NULL);
- glEnable(GL_VERTEX_PROGRAM_CALLBACK_MESA);
-
- /* define/bind a vertex program */
-
- glEnable(GL_VERTEX_PROGRAM);
-
- /* render something */
- glBegin(GL_POINTS);
- glVertex2f(0, 0);
- glEnd();
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_release_buffers.spec b/nx-X11/extras/Mesa/docs/MESA_release_buffers.spec
deleted file mode 100644
index 8db9350d8..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_release_buffers.spec
+++ /dev/null
@@ -1,85 +0,0 @@
-Name
-
- MESA_release_buffers
-
-Name Strings
-
- GLX_MESA_release_buffers
-
-Contact
-
- Brian Paul (brian.paul 'at' tungstengraphics.com)
-
-Status
-
- Shipping since Mesa 2.0 in October, 1996.
-
-Version
-
- Last Modified Date: 8 June 2000
-
-Number
-
- 217
-
-Dependencies
-
- OpenGL 1.0 or later is required.
- GLX 1.0 or later is required.
-
-Overview
-
- Mesa's implementation of GLX is entirely implemented on the client side.
- Therefore, Mesa cannot immediately detect when an X window or pixmap is
- destroyed in order to free any ancilliary data associated with the window
- or pixmap.
-
- The glxMesaReleaseBuffers() function can be used to explicitly indicate
- when the back color buffer, depth buffer, stencil buffer, and/or accum-
- ulation buffer associated with a drawable can be freed.
-
-IP Status
-
- Open-source; freely implementable.
-
-Issues
-
- None.
-
-New Procedures and Functions
-
- Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
-
-New Tokens
-
- None.
-
-Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
-
- The function
-
- Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
-
- causes all software ancilliary buffers (back buffer, depth, stencil,
- accum, etc) associated with the named drawable to be immediately
- deallocated. True is returned if <d> is a valid Mesa GLX drawable,
- else False is returned. After calling glXReleaseBuffersMESA, the
- drawable should no longer be used for GL rendering. Results of
- attempting to do so are undefined.
-
-
-GLX Protocol
-
- None, since this is a client-side operation.
-
-Errors
-
- None.
-
-New State
-
- None.
-
-Revision History
-
- 8 June 2000 - initial specification
diff --git a/nx-X11/extras/Mesa/docs/MESA_resize_buffers.spec b/nx-X11/extras/Mesa/docs/MESA_resize_buffers.spec
deleted file mode 100644
index 4f1fb164b..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_resize_buffers.spec
+++ /dev/null
@@ -1,82 +0,0 @@
-Name
-
- MESA_resize_buffers
-
-Name Strings
-
- GL_MESA_resize_buffers
-
-Contact
-
- Brian Paul (brian.paul 'at' tungstengraphics.com)
-
-Status
-
- Shipping (since Mesa version 2.2)
-
-Version
-
- $Id: MESA_resize_buffers.spec,v 1.1.1.3 2004/08/12 23:43:24 anholt Exp $
-
-Number
-
- 196
-
-Dependencies
-
- Mesa 2.2 or later is required.
-
-Overview
-
- Mesa is often used as a client library with no integration with
- the computer's window system (an X server, for example). And since
- Mesa does not have an event loop nor window system callbacks, it
- cannot properly respond to window system events. In particular,
- Mesa cannot automatically detect when a window has been resized.
-
- Mesa's glViewport command queries the current window size and updates
- its internal data structors accordingly. This normally works fine
- since most applications call glViewport in responce to window size
- changes.
-
- In some situations, however, the application may not call glViewport
- when a window size changes but would still like Mesa to adjust to
- the new window size. This extension exports a new function to solve
- this problem.
-
-New Procedures and Functions
-
- void glResizeBuffersMESA( void )
-
-New Tokens
-
- none
-
-Additions to the OpenGL Specification (no particular section)
-
- The glResizeBuffersMESA command may be called when the client
- determines that a window has been resized. Calling
- glResizeBuffersMESA causes Mesa to query the current window size
- and adjust its internal data structures. This may include
- reallocating depth, stencil, alpha and accumulation buffers.
-
-Additions to the AGL/GLX/WGL Specifications
-
- None
-
-Errors
-
- INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen
- Begin and End.
-
-New State
-
- None.
-
-New Implementation Dependent State
-
- None.
-
-Revision History
-
- * Revision 1.0 - Initial specification
diff --git a/nx-X11/extras/Mesa/docs/MESA_set_3dfx_mode.spec b/nx-X11/extras/Mesa/docs/MESA_set_3dfx_mode.spec
deleted file mode 100644
index 06d97ca02..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_set_3dfx_mode.spec
+++ /dev/null
@@ -1,85 +0,0 @@
-Name
-
- MESA_set_3dfx_mode
-
-Name Strings
-
- GLX_MESA_set_3dfx_mode
-
-Contact
-
- Brian Paul (brian.paul 'at' tungstengraphics.com)
-
-Status
-
- Shipping since Mesa 2.6 in February, 1998.
-
-Version
-
- Last Modified Date: 8 June 2000
-
-Number
-
- 218
-
-Dependencies
-
- OpenGL 1.0 or later is required.
- GLX 1.0 or later is required.
-
-Overview
-
- The Mesa Glide driver allows full-screen rendering or rendering into
- an X window. The glXSet3DfxModeMESA() function allows an application
- to switch between full-screen and windowed rendering.
-
-IP Status
-
- Open-source; freely implementable.
-
-Issues
-
- None.
-
-New Procedures and Functions
-
- GLboolean glXSet3DfxModeMESA( GLint mode );
-
-New Tokens
-
- GLX_3DFX_WINDOW_MODE_MESA 0x1
- GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
-
-Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
-
- The Mesa Glide device driver allows either rendering in full-screen
- mode or rendering into an X window. An application can switch between
- full-screen and window rendering with the command:
-
- GLboolean glXSet3DfxModeMESA( GLint mode );
-
- <mode> may either be GLX_3DFX_WINDOW_MODE_MESA to indicate window
- rendering or GLX_3DFX_FULLSCREEN_MODE_MESA to indicate full-screen mode.
-
- GL_TRUE is returned if <mode> is valid and the operation completed
- normally. GL_FALSE is returned if <mode> is invalid or if the Glide
- driver is not being used.
-
- Note that only one drawable and context can be created at any given
- time with the Mesa Glide driver.
-
-GLX Protocol
-
- None since this is a client-side extension.
-
-Errors
-
- None.
-
-New State
-
- None.
-
-Revision History
-
- 8 June 2000 - initial specification
diff --git a/nx-X11/extras/Mesa/docs/MESA_sprite_point.spec b/nx-X11/extras/Mesa/docs/MESA_sprite_point.spec
deleted file mode 100644
index 88df417cb..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_sprite_point.spec
+++ /dev/null
@@ -1,191 +0,0 @@
-Name
-
- MESA_sprite_point
-
-Name Strings
-
- GL_MESA_sprite_point
-
-Contact
-
- Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
-
-Status
-
- Obsolete - see GL_ARB_point_sprite.
-
-Version
-
- $Id: MESA_sprite_point.spec,v 1.1.1.3 2004/08/12 23:43:24 anholt Exp $
-
-Number
-
- ???
-
-Dependencies
-
- GL_EXT_point_parameters effects the definition of this extension
- GL_ARB_multitexture effects the definition of this extension
-
-Overview
-
- This extension modifies the way in which points are rendered,
- specifically when they're textured. When SPRITE_POINT_MESA is enabled
- a point is rendered as if it were a quadrilateral with unique texture
- coordinates at each vertex. This extension effectively turns points
- into sprites which may be rendered more easily and quickly than using
- conventional textured quadrilaterals.
-
- When using point size > 1 or attenuated points this extension is an
- effective way to render many small sprite images for particle systems
- or other effects.
-
-Issues:
-
- 1. How are the texture coordinates computed?
-
- The lower-left corner has texture coordinate (0,0,r,q).
- The lower-right, (1,0,r,q). The upper-right, (1,1,r,q).
- The upper-left, (0,1,r,q).
-
- 2. What about texgen and texture matrices?
-
- Texgen and the texture matrix have no effect on the point's s and t
- texture coordinates. The r and q coordinates may have been computed
- by texgen or the texture matrix. Note that with a 3D texture and/or
- texgen that the r coordinate could be used to select a slice in the
- 3D texture.
-
- 3. What about point smoothing?
-
- When point smoothing is enabled, a triangle fan could be rendered
- to approximate a circular point. This could be problematic to
- define and implement so POINT_SMOOTH is ignored when drawing sprite
- points.
-
- Smoothed points can be approximated by using an appropriate texture
- images, alpha testing and blending.
-
- POLYGON_SMOOTH does effect the rendering of the quadrilateral, however.
-
- 4. What about sprite rotation?
-
- There is none. Sprite points are always rendered as window-aligned
- squares. One could define rotated texture images if desired. A 3D
- texture and appropriate texture r coordinates could be used to
- effectively specify image rotation per point.
-
- 5. What about POLYGON_MODE?
-
- POLYGON_MODE does not effect the rasterization of the quadrilateral.
-
- 6. What about POLYGON_CULL?
-
- TBD. Polygon culling is normally specified and implemented in the
- transformation stage of OpenGL. However, some rasterization hardware
- implements it later during triangle setup.
-
- Polygon culling wouldn't be useful for sprite points since the
- quadrilaterals are always defined in counter-clockwise order in
- window space. For that reason, polygon culling should probably be
- ignored.
-
- 7. Should sprite points be alpha-attenuated if their size is below the
- point parameter's threshold size?
-
- 8. Should there be an advertisized maximum sprite point size?
-
- No. Since we're rendering the point as a quadrilateral there's no
- need to limit the size.
-
-
-New Procedures and Functions
-
- None.
-
-New Tokens
-
- Accepted by the <pname> parameter of Enable, Disable, IsEnabled,
- GetIntegerv, GetBooleanv, GetFloatv and GetDoublev:
-
- SPRITE_POINT_MESA 0x????
- MAX_SPRITE_POINT_SIZE_MESA 0x???? (need this?)
-
-Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
-
- None
-
-Additions to Chapter 3 of the 1.1 Specification (Rasterization)
-
- Section ???.
-
- When SPRITE_POINT_MESA is enabled points are rasterized as screen-
- aligned quadrilaterals. If the four vertices of the quadrilateral
- are labeled A, B, C, and D, starting at the lower-left corner and moving
- counter-clockwise around the quadrilateral, then the vertex and
- texture coordinates are computed as follows:
-
- vertex window coordinate texture coordinate
- A (x-r, y-r, z, w) (0, 0, r, q)
- B (x+r, y-r, z, w) (1, 0, r, q)
- C (x+r, y+r, z, w) (1, 1, r, q)
- D (x-r, y+r, z, w) (0, 1, r, q)
-
- where x, y, z, w are the point's window coordinates, r and q are the
- point's 3rd and 4th texture coordinates and r is half the point's
- size. The other vertex attributes (such as the color and fog coordinate)
- are simply duplicated from the original point vertex.
-
- Point size may either be specified with PointSize or computed
- according to the EXT_point_parameters extension.
-
- The new texture coordinates are not effected by texgen or the texture
- matrix. Note, however, that the texture r and q coordinates are passed
- unchanged and may have been computed with texgen and/or the texture
- matrix.
-
- If multiple texture units are present the same texture coordinate is
- used for all texture units.
-
- The point is then rendered as if it were a quadrilateral using the
- normal point sampling rules. POLYGON_MODE does not effect the
- rasterization of the quadrilateral but POLYGON_SMOOTH does.
-
- POINT_SMOOTH has no effect when SPRITE_POINT_MESA is enabled.
-
-Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
-and the Frame Buffer)
-
- None.
-
-Additions to Chapter 5 of the 1.1 Specification (Special Functions)
-
- None
-
-Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
-
- None
-
-Additions to the GLX Specification
-
- None
-
-GLX Protocol
-
- TBD
-
-Errors
-
- None
-
-New State
-
- Add boolean variable SPRITE_POINT_MESA to the point attribute group.
-
-Revision History
-
- Version 1.0 - 4 Dec 2000
- Original draft.
-
-
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_swap_control.spec b/nx-X11/extras/Mesa/docs/MESA_swap_control.spec
deleted file mode 100644
index ecc674649..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_swap_control.spec
+++ /dev/null
@@ -1,132 +0,0 @@
-Name
-
- MESA_swap_control
-
-Name Strings
-
- GLX_MESA_swap_control
-
-Contact
-
- Ian Romanick, IBM, idr at us.ibm.com
-
-Status
-
- Deployed in DRI drivers post-XFree86 4.3.
-
-Version
-
- Date: 5/1/2003 Revision: 1.1
-
-Number
-
- ???
-
-Dependencies
-
- None
-
- Based on GLX_SGI_swap_control version 1.9 and WGL_EXT_swap_control
- version 1.5.
-
-Overview
-
- This extension allows an application to specify a minimum periodicity
- of color buffer swaps, measured in video frame periods.
-
-Issues
-
- * Should implementations that export GLX_MESA_swap_control also export
- GL_EXT_swap_control for compatibility with WGL_EXT_swap_control?
-
- UNRESOLVED.
-
-New Procedures and Functions
-
- int glXSwapIntervalMESA(int interval)
- int glXGetSwapIntervalMESA(void)
-
-New Tokens
-
- None
-
-Additions to Chapter 2 of the 1.4 GL Specification (OpenGL Operation)
-
- None
-
-Additions to Chapter 3 of the 1.4 GL Specification (Rasterization)
-
- None
-
-Additions to Chapter 4 of the 1.4 GL Specification (Per-Fragment Operations
-and the Framebuffer)
-
- None
-
-Additions to Chapter 5 of the 1.4 GL Specification (Special Functions)
-
- None
-
-Additions to Chapter 6 of the 1.4 GL Specification (State and State Requests)
-
- None
-
-Additions to the GLX 1.3 Specification
-
- [Add the following to Section 3.3.10 of the GLX Specification (Double
- Buffering)]
-
- glXSwapIntervalMESA specifies the minimum number of video frame periods
- per buffer swap. (e.g. a value of two means that the color buffers
- will be swapped at most every other video frame.) A return value
- of zero indicates success; otherwise an error occurred. The interval
- takes effect when glXSwapBuffers is first called subsequent to the
- glXSwapIntervalMESA call.
-
- A video frame period is the time required by the monitor to display a
- full frame of video data. In the case of an interlaced monitor,
- this is typically the time required to display both the even and odd
- fields of a frame of video data.
-
- If <interval> is set to a value of 0, buffer swaps are not synchron-
- ized to a video frame. The <interval> value is silently clamped to
- the maximum implementation-dependent value supported before being
- stored.
-
- The swap interval is not part of the render context state. It cannot
- be pushed or popped. The current swap interval for the window
- associated with the current context can be obtained by calling
- glXGetSwapIntervalMESA. The default swap interval is 0.
-
- On XFree86, setting the environment variable LIBGL_THROTTLE_REFRESH sets
- the swap interval to 1.
-
-Errors
-
- glXSwapIntervalMESA returns GLX_BAD_VALUE if parameter <interval> is
- less than zero.
-
- glXSwapIntervalMESA returns GLX_BAD_CONTEXT if there is no current
- GLXContext.
-
-GLX Protocol
-
- None. This extension only extends to direct rendering contexts.
-
-New State
-
- Get Value Get Command Type Initial Value
- --------- ----------- ---- -------------
- [swap interval] GetSwapInterval Z+ 0
-
-New Implementation Dependent State
-
- None
-
-
-Revision History
-
- 1.1, 5/1/03 Added the issues section and contact information.
- Changed the default swap interval to 0.
- 1.0, 3/17/03 Initial version based on GLX_SGI_swap_control and
- WGL_EXT_swap_control.
diff --git a/nx-X11/extras/Mesa/docs/MESA_swap_frame_usage.spec b/nx-X11/extras/Mesa/docs/MESA_swap_frame_usage.spec
deleted file mode 100644
index 38cf51a20..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_swap_frame_usage.spec
+++ /dev/null
@@ -1,201 +0,0 @@
-Name
-
- MESA_swap_frame_usage
-
-Name Strings
-
- GLX_MESA_swap_frame_usage
-
-Contact
-
- Ian Romanick, IBM, idr at us.ibm.com
-
-Status
-
- Deployed in DRI drivers post-XFree86 4.3.
-
-Version
-
- Date: 5/1/2003 Revision: 1.1
-
-Number
-
- ???
-
-Dependencies
-
- GLX_SGI_swap_control affects the definition of this extension.
- GLX_MESA_swap_control affects the definition of this extension.
- GLX_OML_sync_control affects the definition of this extension.
-
- Based on WGL_I3D_swap_frame_usage version 1.3.
-
-Overview
-
- This extension allows an application to deterine what portion of the
- swap period has elapsed since the last swap operation completed. The
- "usage" value is a floating point value on the range [0,max] which is
- calculated as follows:
-
- td
- percent = ----
- tf
-
- where td is the time measured from the last completed buffer swap (or
- call to enable the statistic) to when the next buffer swap completes, tf
- is the entire time for a frame which may be multiple screen refreshes
- depending on the swap interval as set by the GLX_SGI_swap_control or
- GLX_OML_sync_control extensions.
-
- The value, percent, indicates the amount of time spent between the
- completion of the two swaps. If the value is in the range [0,1], the
- buffer swap occurred within the time period required to maintain a
- constant frame rate. If the value is in the range (1,max], a constant
- frame rate was not achieved. The value indicates the number of frames
- required to draw.
-
- This definition of "percent" differs slightly from
- WGL_I3D_swap_frame_usage. In WGL_I3D_swap_frame_usage, the measurement
- is taken from the completion of one swap to the issuance of the next.
- This representation may not be as useful as measuring between
- completions, as a significant amount of time may pass between the
- issuance of a swap and the swap actually occuring.
-
- There is also a mechanism to determine whether a frame swap was
- missed.
-
-New Procedures and Functions
-
- int glXGetFrameUsageMESA(Display *dpy,
- GLXDrawable drawable,
- float *usage)
-
- int glXBeginFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable)
-
- int glXEndFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable)
-
- int glXQueryFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable,
- int64_t *swapCount,
- int64_t *missedFrames,
- float *lastMissedUsage)
-
-New Tokens
-
- None
-
-Additions to Chapter 2 of the 1.4 GL Specification (OpenGL Operation)
-
- None
-
-Additions to Chapter 3 of the 1.4 GL Specification (Rasterization)
-
- None
-
-Additions to Chapter 4 of the 1.4 GL Specification (Per-Fragment Operations
-and the Framebuffer)
-
- None
-
-Additions to Chapter 5 of the 1.4 GL Specification (Special Functions)
-
- None
-
-Additions to Chapter 6 of the 1.4 GL Specification (State and State Requests)
-
- None
-
-Additions to the GLX 1.3 Specification
-
- The frame usage is measured as the percentage of the swap period elapsed
- between two buffer-swap operations being commited. In unextened GLX the
- swap period is the vertical refresh time. If SGI_swap_control or
- MESA_swap_control are supported, the swap period is the vertical refresh
- time multiplied by the swap interval (or one if the swap interval is set
- to zero).
-
- If OML_sync_control is supported, the swap period is the vertical
- refresh time multiplied by the divisor parameter to
- glXSwapBuffersMscOML. The frame usage in this case is less than 1.0 if
- the swap is commited before target_msc, and is greater than or equal to
- 1.0 otherwise. The actual usage value is based on the divisor and is
- never less than 0.0.
-
- int glXBeginFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable,
- float *usage)
-
- glXGetFrameUsageMESA returns a floating-point value in <usage>
- that represents the current swap usage, as defined above.
-
- Missed frame swaps can be tracked by calling the following function:
-
- int glXBeginFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable)
-
- glXBeginFrameTrackingMESA resets a "missed frame" count and
- synchronizes with the next frame vertical sync before it returns.
- If a swap is missed based in the rate control specified by the
- <interval> set by glXSwapIntervalSGI or the default swap of once
- per frame, the missed frame count is incremented.
-
- The current missed frame count and total number of swaps since
- the last call to glXBeginFrameTrackingMESA can be obtained by
- callling the following function:
-
- int glXQueryFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable,
- int64_t *swapCount,
- int64_t *missedFrames,
- float *lastMissedUsage)
-
- The location pointed to by <swapCount> will be updated with the
- number of swaps that have been commited. This value may not match the
- number of swaps that have been requested since swaps may be
- queued by the implementation. This function can be called at any
- time and does not synchronize to vertical blank.
-
- The location pointed to by <missedFrames> will contain the number
- swaps that missed the specified frame. The frame usage for the
- last missed frame is returned in the location pointed to by
- <lastMissedUsage>.
-
- Frame tracking is disabled by calling the function
-
- int glXEndFrameTrackingMESA(Display *dpy,
- GLXDrawable drawable)
-
- This function will not return until all swaps have occurred. The
- application can call glXQueryFrameTrackingMESA for a final swap and
- missed frame count.
-
- If these functions are succesful, zero is returned. If the context
- associated with dpy and drawable is not a direct context,
- GLX_BAD_CONTEXT is returned.
-
-Errors
-
- If the function succeeds, zero is returned. If the function
- fails, one of the following error codes is returned:
-
- GLX_BAD_CONTEXT The current rendering context is not a direct
- context.
-
-GLX Protocol
-
- None. This extension only extends to direct rendering contexts.
-
-New State
-
- None
-
-New Implementation Dependent State
-
- None
-
-Revision History
-
- 1.1, 5/1/03 Added contact information.
- 1.0, 3/17/03 Initial version based on WGL_I3D_swap_frame_usage.
diff --git a/nx-X11/extras/Mesa/docs/MESA_trace.spec b/nx-X11/extras/Mesa/docs/MESA_trace.spec
deleted file mode 100644
index 3db569d2b..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_trace.spec
+++ /dev/null
@@ -1,360 +0,0 @@
-Name
-
- MESA_trace
-
-Name Strings
-
- GL_MESA_trace
-
-Contact
-
- Bernd Kreimeier, Loki Entertainment, bk 'at' lokigames.com
- Brian Paul, VA Linux Systems, Inc., brianp 'at' valinux.com
-
-Status
-
- Obsolete.
-
-Version
-
- $Id: MESA_trace.spec,v 1.1.1.3 2004/08/12 23:43:24 anholt Exp $
-
-Number
-
- none yet
-
-Dependencies
-
- OpenGL 1.2 is required.
- The extension is written against the OpenGL 1.2 Specification
-
-Overview
-
- Provides the application with means to enable and disable logging
- of GL calls including parameters as readable text. The verbosity
- of the generated log can be controlled. The resulting logs are
- valid (but possibly incomplete) C code and can be compiled and
- linked for standalone test programs. The set of calls and the
- amount of static data that is logged can be controlled at runtime.
- The application can add comments and enable or disable tracing of GL
- operations at any time. The data flow from the application to GL
- and back is unaffected except for timing.
-
- Application-side implementation of these features raises namespace
- and linkage issues. In the driver dispatch table a simple
- "chain of responsibility" pattern (aka "composable piepline")
- can be added.
-
-IP Status
-
- The extension spec is in the public domain. The current implementation
- in Mesa is covered by Mesa's XFree86-style copyright by the authors above.
- This extension is partially inspired by the Quake2 QGL wrapper.
-
-Issues
-
-
- (1) Is this Extension obsolete because it can
- be implemented as a wrapper DLL?
-
- RESOLVED: No. While certain operating systems (Win32) provide linkers
- that facilitate this kind of solution, other operating systems
- (Linux) do not support hierarchical linking, so a wrapper solution
- would result in symbol collisions.
- Further, IHV's might have builtin support for tracing GL execution
- that enjoys privileged access, or that they do not wish to separate
- the tracing code from their driver code base.
-
- (2) Should the Trace API explicitely support the notion of "frames?
- This would require hooking into glXSwapBuffers calls as well.
-
- RESOLVED: No. The application can use NewTraceMESA/EndTraceMESA
- and TraceComment along with external parsing tools to split the
- trace into frames, in whatever way considered adequate.
-
- (2a) Should GLX calls be traced?
-
- PBuffers and other render-to-texture solutions demonstrate that
- context level commands beyond SwapBuffers might have to be
- traced. The GL DLL exports the entry points, so this would not
- be out of the question.
-
- (3) Should the specification mandate the actual output format?
-
- RESOLVED: No. It is sufficient to guarantee that all data and commands
- will be traced as requested by Enable/DisableTraceMESA, in the order
- encountered. Whether the resulting trace is available as a readable
- text file, binary metafile, compilable source code, much less which
- indentation and formatting has been used, is up to the implementation.
- For the same reason this specification does not enforce or prohibit
- additional information added to the trace (statistics, profiling/timing,
- warnings on possible error conditions).
-
- (4) Should the comment strings associated with names and pointer (ranges)
- be considered persistent state?
-
- RESOLVED: No. The implementation is not forced to use this information
- on subsequent occurences of name/pointer, and is free to consider it
- transient state.
-
- (5) Should comment commands be prohibited between Begin/End?
-
- RESOLVED: Yes, with the exception of TraceCommentMESA. TraceCommentMESA
- is transient, the other commands might cause storage of persistent
- data in the context. There is no need to have the ability mark names
- or pointers between Begin and End.
-
-
-New Procedures and Functions
-
- void NewTraceMESA( bitfield mask, const ubyte * traceName )
-
- void EndTraceMESA( void )
-
- void EnableTraceMESA( bitfield mask )
-
- void DisableTraceMESA( bitfield mask )
-
- void TraceAssertAttribMESA( bitfield attribMask )
-
- void TraceCommentMESA( const ubyte* comment )
-
- void TraceTextureMESA( uint name, const ubyte* comment )
-
- void TraceListMESA( uint name, const ubyte* comment )
-
- void TracePointerMESA( void* pointer, const ubyte* comment )
-
- void TracePointerRangeMESA( const void* first,
- const void* last,
- const ubyte* comment )
-
-New Tokens
-
- Accepted by the <mask> parameter of EnableTrace and DisableTrace:
-
- TRACE_ALL_BITS_MESA 0xFFFF
- TRACE_OPERATIONS_BIT_MESA 0x0001
- TRACE_PRIMITIVES_BIT_MESA 0x0002
- TRACE_ARRAYS_BIT_MESA 0x0004
- TRACE_TEXTURES_BIT_MESA 0x0008
- TRACE_PIXELS_BIT_MESA 0x0010
- TRACE_ERRORS_BIT_MESA 0x0020
-
- Accepted by the <pname> parameter of GetIntegerv, GetBooleanv,
- GetFloatv, and GetDoublev:
-
- TRACE_MASK_MESA 0x8755
-
- Accepted by the <pname> parameter to GetString:
-
- TRACE_NAME_MESA 0x8756
-
-
-Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
-
- None.
-
-Additions to Chapter 3 of the OpenGL 1.2.1 Specification (OpenGL Operation)
-
- None.
-
-Additions to Chapter 4 of the OpenGL 1.2.1 Specification (OpenGL Operation)
-
- None.
-
-Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
-
- Add a new section:
-
- 5.7 Tracing
-
- The tracing facility is used to record the execution of a GL program
- to a human-readable log. The log appears as a sequence of GL commands
- using C syntax. The primary intention of tracing is to aid in program
- debugging.
-
- A trace is started with the command
-
- void NewTraceMESA( bitfield mask, const GLubyte * traceName )
-
- <mask> may be any value accepted by PushAttrib and specifies a set of
- attribute groups. The state values included in those attribute groups
- is written to the trace as a sequence of GL commands.
-
- <traceName> specifies a name or label for the trace. It is expected
- that <traceName> will be interpreted as a filename in most implementations.
-
- A trace is ended by calling the command
-
- void EndTraceMESA( void )
-
- It is illegal to call NewTraceMESA or EndTraceMESA between Begin and End.
-
- The commands
-
- void EnableTraceMESA( bitfield mask )
- void DisableTraceMESA( bitfield mask )
-
- enable or disable tracing of different classes of GL commands.
- <mask> may be the union of any of TRACE_OPERATIONS_BIT_MESA,
- TRACE_PRIMITIVES_BIT_MESA, TRACE_ARRAYS_BIT_MESA, TRACE_TEXTURES_BIT_MESA,
- and TRACE_PIXELS_BIT_MESA. The special token TRACE_ALL_BITS_MESA
- indicates all classes of commands are to be logged.
-
- TRACE_OPERATIONS_BIT_MESA controls logging of all commands outside of
- Begin/End, including Begin/End.
-
- TRACE_PRIMITIVES_BIT_MESA controls logging of all commands inside of
- Begin/End, including Begin/End.
-
- TRACE_ARRAYS_BIT_MESA controls logging of VertexPointer, NormalPointer,
- ColorPointer, IndexPointer, TexCoordPointer and EdgeFlagPointer commands.
-
- TRACE_TEXTURES_BIT_MESA controls logging of texture data dereferenced by
- TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, and
- TexSubImage3D commands.
-
- TRACE_PIXELS_BIT_MESA controls logging of image data dereferenced by
- Bitmap and DrawPixels commands.
-
- TRACE_ERRORS_BIT_MESA controls logging of all errors. If this bit is
- set, GetError will be executed whereever applicable, and the result will
- be added to the trace as a comment. The error returns are cached and
- returned to the application on its GetError calls. If the user does not
- wish the additional GetError calls to be performed, this bit should not
- be set.
-
- The command
-
- void TraceCommentMESA( const ubyte* comment )
-
- immediately adds the <comment> string to the trace output, surrounded
- by C-style comment delimiters.
-
- The commands
-
- void TraceTextureMESA( uint name, const ubyte* comment )
- void TraceListMESA( uint name, const ubyte* comment )
-
- associates <comment> with the texture object or display list specified
- by <name>. Logged commands which reference the named texture object or
- display list will be annotated with <comment>. If IsTexture(name) or
- IsList(name) fail (respectively) the command is quietly ignored.
-
- The commands
-
- void TracePointerMESA( void* pointer, const ubyte* comment )
-
- void TracePointerRangeMESA( const void* first,
- const void* last,
- const ubyte* comment )
-
- associate <comment> with the address specified by <pointer> or with
- a range of addresses specified by <first> through <last>.
- Any logged commands which reference <pointer> or an address between
- <first> and <last> will be annotated with <comment>.
-
- The command
-
- void TraceAssertAttribMESA( bitfield attribMask )
-
- will add GL state queries and assertion statements to the log to
- confirm that the current state at the time TraceAssertAttrib is
- executed matches the current state when the trace log is executed
- in the future.
-
- <attribMask> is any value accepted by PushAttrib and specifies
- the groups of state variables which are to be asserted.
-
- The commands NewTraceMESA, EndTraceMESA, EnableTraceMESA, DisableTraceMESA,
- TraceAssertAttribMESA, TraceCommentMESA, TraceTextureMESA, TraceListMESA,
- TracePointerMESA and TracePointerRangeMESA are not compiled into display lists.
-
-
- Examples:
-
- The command NewTraceMESA(DEPTH_BUFFER_BIT, "log") will query the state
- variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE
- to get the values <test>, <func>, <mask>, and <clear> respectively.
- Statements equivalent to the following will then be logged:
-
- glEnable(GL_DEPTH_TEST); (if <test> is true)
- glDisable(GL_DEPTH_TEST); (if <test> is false)
- glDepthFunc(<func>);
- glDepthMask(<mask>);
- glClearDepth(<clear>);
-
-
- The command TraceAssertAttribMESA(DEPTH_BUFFER_BIT) will query the state
- variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE
- to get the values <test>, <func>, <mask>, and <clear> respectively.
- The resulting trace might then look will like this:
-
- {
- GLboolean b;
- GLint i;
- GLfloat f;
- b = glIsEnabled(GL_DEPTH_TEST);
- assert(b == <test>);
- glGetIntegerv(GL_DEPTH_FUNC, &i);
- assert(i == <func>);
- glGetIntegerv(GL_DEPTH_MASK, &i);
- assert(i == <mask>);
- glGetFloatv(GL_DEPTH_CLEAR_VALUE, &f);
- assert(f == <clear>);
- }
-
-
-Additions to Chapter 6 of the OpenGL 1.2.1 Specification
- (State and State Requests)
-
- Querying TRACE_MASK_MESA with GetIntegerv, GetFloatv, GetBooleanv or
- GetDoublev returns the current command class trace mask.
-
- Querying TRACE_NAME_MESA with GetString returns the current trace name.
-
-
-Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
-
- The MESA_trace extension can be used in a way that does not affect data
- flow from application to OpenGL, as well as data flow from OpenGL to
- application, except for timing, possible print I/O. TRACE_ERRORS_BIT_MESA
- will add additional GetError queries. Setting a trace mask with NewTraceMESA
- as well as use of TraceAssertAttribMESA might cause additional state queries.
- With the possible exception of performance, OpenGL rendering should not be
- affected at all by a properly chosen logging operation.
-
-Additions to the AGL/GLX/WGL Specifications
-
- None.
-
-GLX Protocol
-
- None. The logging operation is carried out client-side, by exporting
- entry points to the wrapper functions that execute the logging operation.
-
-Errors
-
- INVALID_OPERATION is generated if any trace command except TraceCommentMESA
- is called between Begin and End.
-
-New State
-
- The current trace name and current command class mask are stored
- per-context.
-
-New Implementation Dependent State
-
- None.
-
-Revision History
-
- * Revision 0.1 - Initial draft from template (bk000415)
- * Revision 0.2 - Draft (bk000906)
- * Revision 0.3 - Draft (bk000913)
- * Revision 0.4 - Reworked text, fixed typos (bp000914)
- * Revision 0.5 - Assigned final GLenum values (bp001103)
- * Revision 0.6 - TRACE_ERRORS_BIT_MESA (bk000916)
- * Revision 0.7 - Added MESA postfix (bk010126)
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_window_pos.spec b/nx-X11/extras/Mesa/docs/MESA_window_pos.spec
deleted file mode 100644
index 5ad7fa6a6..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_window_pos.spec
+++ /dev/null
@@ -1,127 +0,0 @@
-Name
-
- MESA_window_pos
-
-Name Strings
-
- GL_MESA_window_pos
-
-Contact
-
- Brian Paul, brian.paul 'at' tungstengraphics.com
-
-Status
-
- Shipping (since Mesa version 1.2.8)
-
-Version
-
- $Id: MESA_window_pos.spec,v 1.1.1.3 2004/08/12 23:43:25 anholt Exp $
-
-Number
-
- 197
-
-Dependencies
-
- OpenGL 1.0 is required.
- The extension is written against the OpenGL 1.2 Specification
-
-Overview
-
- In order to set the current raster position to a specific window
- coordinate with the RasterPos command, the modelview matrix, projection
- matrix and viewport must be set very carefully. Furthermore, if the
- desired window coordinate is outside of the window's bounds one must
- rely on a subtle side-effect of the Bitmap command in order to circumvent
- frustum clipping.
-
- This extension provides a set of functions to directly set the
- current raster position, bypassing the modelview matrix, the
- projection matrix and the viewport to window mapping. Furthermore,
- clip testing is not performed.
-
- This greatly simplifies the process of setting the current raster
- position to a specific window coordinate prior to calling DrawPixels,
- CopyPixels or Bitmap.
-
-New Procedures and Functions
-
- void WindowPos2dMESA(double x, double y)
- void WindowPos2fMESA(float x, float y)
- void WindowPos2iMESA(int x, int y)
- void WindowPos2sMESA(short x, short y)
- void WindowPos2ivMESA(const int *p)
- void WindowPos2svMESA(const short *p)
- void WindowPos2fvMESA(const float *p)
- void WindowPos2dvMESA(const double *p)
- void WindowPos3iMESA(int x, int y, int z)
- void WindowPos3sMESA(short x, short y, short z)
- void WindowPos3fMESA(float x, float y, float z)
- void WindowPos3dMESA(double x, double y, double z)
- void WindowPos3ivMESA(const int *p)
- void WindowPos3svMESA(const short *p)
- void WindowPos3fvMESA(const float *p)
- void WindowPos3dvMESA(const double *p)
- void WindowPos4iMESA(int x, int y, int z, int w)
- void WindowPos4sMESA(short x, short y, short z, short w)
- void WindowPos4fMESA(float x, float y, float z, float w)
- void WindowPos4dMESA(double x, double y, double z, double )
- void WindowPos4ivMESA(const int *p)
- void WindowPos4svMESA(const short *p)
- void WindowPos4fvMESA(const float *p)
- void WindowPos4dvMESA(const double *p)
-
-New Tokens
-
- none
-
-Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
-
- - (2.12, p. 41) Insert after third paragraph:
-
- Alternately, the current raster position may be set by one of the
- WindowPosMESA commands:
-
- void WindowPos{234}{sidf}MESA( T coords );
- void WindowPos{234}{sidf}vMESA( T coords );
-
- WindosPos4MESA takes four values indicating x, y, z, and w.
- WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only
- x, y, and z with w implicitly set to 1 (or only x and y with z
- implicititly set to 0 and w implicitly set to 1).
-
- WindowPosMESA operates like RasterPos except that the current modelview
- matrix, projection matrix and viewport parameters are ignored and the
- clip test operation always passes. The current raster position values
- are directly set to the parameters passed to WindowPosMESA. The current
- color, color index and texture coordinate update the current raster
- position's associated data.
-
-Additions to the AGL/GLX/WGL Specifications
-
- None
-
-GLX Protocol
-
- Not specified at this time. However, a protocol message very similar
- to that of RasterPos is expected.
-
-Errors
-
- INVALID_OPERATION is generated if WindowPosMESA is called betweeen
- Begin and End.
-
-New State
-
- None.
-
-New Implementation Dependent State
-
- None.
-
-Revision History
-
- * Revision 1.0 - Initial specification
- * Revision 1.1 - Minor clean-up (7 Jan 2000, Brian Paul)
-
diff --git a/nx-X11/extras/Mesa/docs/MESA_ycbcr_texture.spec b/nx-X11/extras/Mesa/docs/MESA_ycbcr_texture.spec
deleted file mode 100644
index 0fa1f7b39..000000000
--- a/nx-X11/extras/Mesa/docs/MESA_ycbcr_texture.spec
+++ /dev/null
@@ -1,204 +0,0 @@
-Name
-
- MESA_ycbcr_texture
-
-Name Strings
-
- GL_MESA_ycbcr_texture
-
-Contact
-
- Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com)
- Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com)
-
-Status
-
- Shipping (Mesa 4.0.4 and later)
-
-Version
-
- 1.0
-
-Number
-
- TBD
-
-Dependencies
-
- OpenGL 1.0 or later is required
- This extensions is written against the OpenGL 1.4 Specification.
- NV_texture_rectangle effects the definition of this extension.
-
-Overview
-
- This extension supports texture images stored in the YCbCr format.
- There is no support for converting YCbCr images to RGB or vice versa
- during pixel transfer. The texture's YCbCr colors are converted to
- RGB during texture sampling, after-which, all the usual per-fragment
- operations take place. Only 2D texture images are supported (not
- glDrawPixels, glReadPixels, etc).
-
- A YCbCr pixel (texel) is a 16-bit unsigned short with two components.
- The first component is luminance (Y). For pixels in even-numbered
- image columns, the second component is Cb. For pixels in odd-numbered
- image columns, the second component is Cr. If one were to convert the
- data to RGB one would need to examine two pixels from columns N and N+1
- (where N is even) to deduce the RGB color.
-
-IP Status
-
- None
-
-Issues
-
- None
-
-New Procedures and Functions
-
- None
-
-New Tokens
-
- Accepted by the <internalFormat> and <format> parameters of
- TexImage2D and TexSubImage2D:
-
- YCBCR_MESA 0x8757
-
- Accepted by the <type> parameter of TexImage2D and TexSubImage2D:
-
- UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */
- UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */
-
-Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
-
- None
-
-Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
-
- In section 3.6.4, Rasterization of Pixel Rectangles, on page 101,
- add the following to Table 3.8 (Packed pixel formats):
-
- type Parameter GL Data Number of Matching
- Token Name Type Components Pixel Formats
- -------------- ------- ---------- -------------
- UNSIGNED_SHORT_8_8_MESA ushort 2 YCBCR_MESA
- UNSIGNED_SHORT_8_8_REV_MESA ushort 2 YCBCR_MESA
-
-
- In section 3.6.4, Rasterization of Pixel Rectangles, on page 102,
- add the following to Table 3.10 (UNSIGNED_SHORT formats):
-
- UNSIGNED_SHORT_8_8_MESA:
-
- 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- +-------------------------------+-------------------------------+
- | 1st | 2nd |
- +-------------------------------+-------------------------------+
-
- UNSIGNED_SHORT_8_8_REV_MESA:
-
- 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- +-------------------------------+-------------------------------+
- | 2nd | 1st |
- +-------------------------------+-------------------------------+
-
-
- In section 3.6.4, Rasterization of Pixel Rectangles, on page 104,
- add the following to Table 3.12 (Packed pixel fiedl assignments):
-
- First Second Third Fourth
- Format Element Element Element Element
- ------ ------- ------- ------- -------
- YCBCR_MESA luminance chroma
-
-
- In section 3.8.1, Texture Image Specification, on page 125, add
- another item to the list of TexImage2D and TexImage3D equivalence
- exceptions:
-
- * The value of internalformat and format may be YCBCR_MESA to
- indicate that the image data is in YCbCr format. type must
- be either UNSIGNED_SHORT_8_8_MESA or UNSIGNED_SHORT_8_8_REV_MESA
- as seen in tables 3.8 and 3.10. Table 3.12 describes the mapping
- between Y and Cb/Cr to the components.
- If NV_texture_rectangle is supported target may also be
- TEXTURE_RECTANGLE_NV or PROXY_TEXTURE_RECTANGLE_NV.
- All pixel transfer operations are bypassed. The texture is stored as
- YCbCr, not RGB. Queries of the texture's red, green and blue component
- sizes will return zero. The YCbCr colors are converted to RGB during
- texture sampling using an implementation dependent conversion.
-
-
- In section 3.8.1, Texture Image Specification, on page 126, add
- another item to the list of TexImage1D and TexImage2D equivalence
- exceptions:
-
- * The value of internalformat and format can not be YCBCR_MESA.
-
-
- In section 3.8.2, Alternate Texture Image Specification Commands, on
- page 129, insert this paragraph after the first full paragraph on the
- page:
-
- "If the internal storage format of the image being updated by
- TexSubImage2D is YCBCR_MESA then format must be YCBCR_MESA.
- The error INVALID_OPERATION will be generated otherwise."
-
-
-Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
-Operations and the Frame Buffer)
-
- None
-
-Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
-
- None
-
-Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
-State Requests)
-
- None
-
-Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
-
- None
-
-Additions to the AGL/GLX/WGL Specifications
-
- None
-
-GLX Protocol
-
- None
-
-Errors
-
- INVALID_ENUM is generated by TexImage2D if <internalFormat> is
- MESA_YCBCR but <format> is not MESA_YCBCR.
-
- INVALID_ENUM is generated by TexImage2D if <format> is MESA_YCBCR but
- <internalFormat> is not MESA_YCBCR.
-
- INVALID_VALUE is generated by TexImage2D if <format> is MESA_YCBCR and
- <internalFormat> is MESA_YCBCR and <border> is not zero.
-
- INVALID_OPERATION is generated by TexSubImage2D if the internal image
- format is YCBCR_MESA and <format> is not YCBCR_MESA.
-
- INVALID_OPERATION is generated by CopyTexSubImage2D if the internal
- image is YCBCR_MESA.
-
-New State
-
- Edit table 6.16 on page 231: change the type of TEXTURE_INTERNAL_FORMAT
- from n x Z42 to n x Z43 to indicate that internal format may also be
- YCBCR_MESA.
-
-Revision History
-
- 20 September 2002 - Initial draft
- 29 April 2003 - minor updates
- 3 September 2003 - further clarify when YCbCr->RGB conversion takes place
- 19 September 2003 - a few more updates prior to submitting to extension
- registry.
- 3 April 2004 - fix assorted inaccuracies
diff --git a/nx-X11/extras/Mesa/docs/MiniGLX.html b/nx-X11/extras/Mesa/docs/MiniGLX.html
deleted file mode 100644
index 342981299..000000000
--- a/nx-X11/extras/Mesa/docs/MiniGLX.html
+++ /dev/null
@@ -1,547 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <title>Mini GLX Specification</title>
-</head>
-<body>
-<h1>
-<center>Mini GLX Specification</center>
-</h1>
-<h2>
-<center>Tungsten Graphics, Inc.<br>
-<br>
-January 20, 2003<br>
-<br>
-</center>
-</h2>
-<p> Copyright &copy; 2002-2003 by Tungsten Graphics, Inc., Cedar Park,
-Texas. All Rights Reserved. <br>
-<br>
-Permission is granted to make and distribute verbatim copies of this
-document provided the copyright notice and this permission notice are
-preserved on all copies.<br>
-<br>
-</p>
-<h1>1. Introduction</h1>
-<p>The Mini GLX interface facilitates OpenGL rendering on embedded
-devices. The interface is a subset of the GLX interface, plus a minimal
-set of Xlib-like functions.</p>
-<p>Programs written to the Mini GLX specification should run unchanged
-on systems with the X Window System and the GLX extension. The intention
-is to allow flexibility for prototyping and testing.</p>
-<p>This document serves as both the reference guide and programming
-guide for Mini GLX.<br>
-<br>
-</p>
-<h1>2. Mini GLX Concepts</h1>
-<p>The OpenGL specification does not describe how OpenGL rendering
-contexts and drawing surfaces (i.e. the frame buffer) are created and
-managed. Rather, this is handled by an OpenGL window system interface,
-such as Mini GLX.</p>
-<p>There are three main datatypes or resources managed by Mini GLX. The
-resources and their corresponding GLX or Xlib data types are:</p>
-<table cellspacing="10" align="center">
- <tbody>
- <tr>
- <td><u>Resource</u></td>
- <td><u>Data type</u></td>
- </tr>
- <tr>
- <td>pixel formats</td>
- <td>X Visual and XVisualInfo</td>
- </tr>
- <tr>
- <td>drawing surfaces</td>
- <td>X Window or GLXDrawable</td>
- </tr>
- <tr>
- <td>rendering contexts</td>
- <td>GLXContext</td>
- </tr>
- </tbody>
-</table>
-<p>Pixel formats or X Visuals describe the per-pixel attributes of the
-frame buffer. For example, bits per color component, Z buffer size,
-stencil size, TrueColor vs PseudoColor, etc.</p>
-<p>Drawing surfaces or X Windows typically describe a spatial
-allocation of the frame buffer (i.e. the position and size of a
-rectangular region of pixels). Since MiniGLX doesn't really support a
-window system, the window is effectively the entire frame buffer.</p>
-<p>A rendering context represents the current OpenGL state such as
-current drawing color, line width, blending mode, texture parameters,
-etc. Several rendering contexts can be created but only one can be in
-use at any given time.</p>
-<p>The Mini GLX interface provides all the functions needed for
-choosing pixel formats, create drawing surfaces, creating rendering
-contexts and binding rendering contexts to drawing surfaces.<br>
-<br>
-</p>
-<h1>3. Using Mini GLX</h1>
-<p>To use the Mini GLX interface in your application, include the
-GL/miniglx.h header file at compile time:</p>
-<blockquote><code> #include &lt;GL/miniglx.h&gt;<br>
- </code></blockquote>
-<code></code>Applications should link with libGL.so (i.e. <code>gcc
-myprogram.o -lGL -o myprogram</code>). &nbsp;libGL.so implements the
-MiniGLX API functions and, in turn, loads a hardware-specific device
-driver (such as <code>radeon_dri.so</code>) at runtime. &nbsp;The
-environment variable <code>LIBGL_DRIVERS_PATH</code> should name the
-directory where these modules are located.<br>
-<br>
-Prior to running a MiniGXL application, the following kernel modules
-must be installed:<br>
-<br>
-<div style="margin-left: 40px;"> agpgart.o<br>
-radeonfb.o &nbsp;(assuming Radeon hardware)<br>
-radeon.o &nbsp;(assuming Radeon hardware)<br>
-</div>
-<code></code> <br>
-Finally, MiniGLX reads a configuration file (by default,<code>
-/etc/miniglx.conf</code>) to determine basic configuration information.
-&nbsp;The configuration file may also be located in the directory
-specified by the <code>MINIGLX_CONF</code> environment variable).<br>
-<br>
-The remainder of this section describes the MiniGLX API functions.<br>
-<br>
-<h2>3.1 Initialization</h2>
-<p>The XOpenDisplay function is used to initialize the graphics system:</p>
-<blockquote>
- <pre>Display *XOpenDisplay(const char *displayname)<br></pre>
-</blockquote>
-<p>The <code>displayName</code> parameter is currently ignored in Mini
-GLX. It is recommended that <code>NULL</code> be passed as the<code>displayName</code>
-parameter.</p>
-<p>If XOpenDisplay is able to initialize the graphics system a pointer
-to a Display will be returned. Otherwise, NULL will be returned.</p>
-<h2>3.2 Choosing a Visual</h2>
-<p>A visual (i.e. pixel format) must be chosen before a drawing surface
-or rendering context can be created. This is done with the
-glXChooseVisual function:</p>
-<blockquote>
- <pre>XVisualInfo *glXChooseVisual(Display *dpy, int screen, const int *attribList)<br></pre>
-</blockquote>
-<p><code>dpy</code> is a pointer to the display returned by
-XOpenDisplay. </p>
-<p><code>screen</code> is currently ignored by Mini GLX and should be
-zero. </p>
-<p><code>attribList</code> is a list of GLX attributes which describe
-the desired pixel format. It is terminated by the token <code>None</code>.
-The attributes are as follows:</p>
-<blockquote>
- <dl>
- <dt><code>GLX_USE_GL</code></dt>
- <dd>This attribute should always be present in order to maintain
-compatibility with GLX.</dd>
- <dt><code>GLX_RGBA</code></dt>
- <dd>If present, only RGBA pixel formats will be considered.
-Otherwise, only color index formats are considered.</dd>
- <dt><code>GLX_DOUBLEBUFFER</code></dt>
- <dd>if present, only double-buffered pixel formats will be chosen.</dd>
- <dt><code>GLX_RED_SIZE n</code></dt>
- <dd>Must be followed by a non-negative integer indicating the
-minimum number of bits per red pixel component that is acceptable.</dd>
- <dt><code>GLX_GREEN_SIZE n</code></dt>
- <dd>Must be followed by a non-negative integer indicating the
-minimum number of bits per green pixel component that is acceptable.</dd>
- <dt><code>GLX_BLUE_SIZE n</code></dt>
- <dd>Must be followed by a non-negative integer indicating the
-minimum number of bits per blue pixel component that is acceptable.</dd>
- <dt><code>GLX_ALPHA_SIZE n</code></dt>
- <dd>Must be followed by a non-negative integer indicating the
-minimum number of bits per alpha pixel component that is acceptable.</dd>
- <dt><code>GLX_STENCIL_SIZE n</code></dt>
- <dd>Must be followed by a non-negative integer indicating the
-minimum number of bits per stencil value that is acceptable.</dd>
- <dt><code>None</code></dt>
- <dd>This token is used to terminate the attribute list.</dd>
- </dl>
-</blockquote>
-<p>glXChooseVisual will return a pointer to an XVisualInfo object which
-most closely matches the requirements of the attribute list. If there
-is no visual which matches the request, NULL will be returned.</p>
-<p>Note that visuals with accumulation buffers and depth buffers are
-not available.<br>
-<br>
-</p>
-<h2>3.3 Creating a Drawing Surface</h2>
-<p>Drawing surfaces are created as X windows. &nbsp;For Mini GLX,
-windows are <i>full-screen</i>; they cover the entire frame buffer.
-&nbsp;Also, Mini GLX imposes a limit of one window. A second window
-cannot be created until the first one is destroyed.</p>
-<h3>3.3.1 Window Creation</h3>
-<p>The XCreateWindow function is used to create a drawing surface:</p>
-<blockquote>
- <pre>Window XCreateWindow( Display *display,<br> Window parent,<br> int x, int y,<br> unsigned int width, unsigned int height,<br> unsigned int borderWidth,<br> int depth,<br> unsigned int class,<br> Visual *visual,<br> unsigned long valuemask,<br> XSetWindowAttributes *attributes )<br></pre>
-</blockquote>
-<p>The parameters are as follows:</p>
-<blockquote>
- <dl>
- <dt><code>display</code></dt>
- <dd>A Display pointer, as returned by XOpenDisplay.</dd>
- <dt><code>parent</code></dt>
- <dd>The parent window for the new window. For Mini GLX, this
-should be<code>RootWindow(dpy, 0)</code>.</dd>
- <dt><code>x, y</code></dt>
- <dd>The position of the window. For Mini GLX, both values should
-be zero.</dd>
- <dt><code>width, height</code></dt>
- <dd>The size of the window. For Mini GLX, this specifies the
-desired screen size such as 1024, 768 or 1280, 1024.</dd>
- <dt><code>borderWidth</code></dt>
- <dd>This parameter should be zero.</dd>
- <dt><code>depth</code></dt>
- <dd>The pixel depth for the window. For Mini GLX this should be
-the depth found in the XVisualInfo object returned by <code>glxChooseVisual</code>.</dd>
- <dt><code>class</code></dt>
- <dd>The window class. For Mini GLX this value should be <code>InputOutput</code>.</dd>
- <dt><code>visual</code></dt>
- <dd>This parameter should be the <code>visual</code> field of the <code>XVisualInfo</code>
-object returned by <code>glxChooseVisual</code>.</dd>
- <dt><code>valuemask</code></dt>
- <dd>This parameter indicates which fields of the <code>XSetWindowAttributes</code>
-are to be used. For Mini GLX this is typically the bitmask<code>CWBackPixel
-| CWBorderPixel | CWColormap</code>.</dd>
- <dt><code>attributes</code></dt>
- <dd>Initial window attributes. Of the fields in the <code>XSetWindowAttributes</code>
-structure, the<code>background_pixel</code>, <code>border_pixel</code>
-and <code>colormap</code> fields should be set. &nbsp;See the discussion
-below regarding colormaps.</dd>
- </dl>
-</blockquote>
-<p><code>XCreateWindow</code> will return a window handle if it succeeds
-or zero if it fails.</p>
-<h3>3.3.2 Window Mapping</h3>
-<p>To display the window the XMapWindow function must be called:</p>
-<blockquote>
- <pre>void XMapWindow(Display *dpy, Window w)</pre>
-</blockquote>
-<p>This function does nothing in Mini GLX but is required for Xlib/GLX
-compatibility</p>
-<h3>3.3.3 Colormaps<br>
-</h3>
-<p>Xlib requires specification of a colormap when creating a window.
-&nbsp;For purposes of interoperability, Mini GLX requires this as well,
-though the colormap is not actually used. &nbsp;The XCreateColormap
-function is used to create a colormap:</p>
-<blockquote><code>Colormap XCreateColormap(Display *dpy, Window window,
-Visual *visual, int alloc)</code><br>
- <code></code></blockquote>
-<p>The parameters are as follows:<br>
-</p>
-<blockquote>
- <dl>
- <dt><code>dpy</code></dt>
- <dd>The display handle as returned by XOpenDisplay.</dd>
- <dt><code>window</code></dt>
- <dd> This parameter is ignored by Mini GLX but should be the value
-returned by the <code>RootWindow(dpy, 0)</code> macro.<br>
- </dd>
- <dt><code>visual</code></dt>
- <dd>This parameter is ignored by Mini GLX but should be the visual
-field of the XVisualInfo object returned by glXChooseVisual. </dd>
- <dt><code>alloc</code></dt>
- <dd>This parameter is ignored by Mini GLX but should be set to <code>AllocNone</code>.</dd>
- </dl>
-</blockquote>
-<br>
-<h2>3.4 Creating a Rendering Context</h2>
-<p>An OpenGL rendering context is created with the <code>glXCreateContext</code>
-function:</p>
-<blockquote>
- <pre>GLXContext glXCreateContext(Display *dpy, XVisualInfo *visInfo, GLXContext shareList, Bool direct)<br></pre>
-</blockquote>
-<p>The parameters are as follows:</p>
-<blockquote>
- <dl>
- <dt><code>dpy</code></dt>
- <dd>The display handle as returned by XOpenDisplay.</dd>
- <dt><code>visInfo</code></dt>
- <dd>The visual as returned by glXChooseVisual.</dd>
- <dt><code>shareList</code></dt>
- <dd>If non-zero, texture objects and display lists are shared with
-the named rendering context. If zero, texture objects and display lists
-will (initially) be private to this context. They may be shared when a
-subsequent context is created.</dd>
- <dt><code>direct</code></dt>
- <dd>Specifies whether direct or indirect rendering is desired. For
-Mini GLX this value is ignored but it should be set to <code>True</code>.</dd>
- </dl>
-</blockquote>
-<p><code>glXCreateContext</code> will return a GLXContext handle if it
-succeeds or zero if it fails due to invalid parameter or insufficient
-resources.<br>
-<br>
-</p>
-<h2>3.5 Binding a Rendering Context</h2>
-<p>The final step before beginning OpenGL rendering is to bind (i.e.
-activate) a rendering context and drawing surface with the
-glXMakeCurrent function:</p>
-<blockquote>
- <pre>Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)<br></pre>
-</blockquote>
-<p>The parameters are as follows:</p>
-<blockquote>
- <dl>
- <dt><code>dpy</code></dt>
- <dd>The display handle, as returned by XOpenDisplay.</dd>
- <dt><code>drawable</code></dt>
- <dd>The window or drawable to bind to the rendering context. This
-should be the value returned by XCreateWindow.</dd>
- <dt><code>ctx</code></dt>
- <dd>The rendering context to bind, as returned by glXCreateContext.</dd>
- </dl>
-</blockquote>
-<p>If glXMakeCurrent succeeds True is returned. Otherwise False is
-returned to indicate an invalid display, window or context parameter.</p>
-<p>After the rendering context has been bound to the drawing surface
-OpenGL rendering can begin.</p>
-<p>The current rendering context may be unbound by calling
-glXMakeCurrent with the window and context parameters set to zero.</p>
-<p>An application may create any number of rendering contexts and bind
-them as needed. Note that binding a rendering context is generally not a
-light-weight operation. &nbsp;Most simple OpenGL applications create
-only one rendering context.<br>
-<br>
-</p>
-<h2>3.6 Color Buffer Swapping</h2>
-<p>A double buffered window has two color buffers: a front buffer and a
-back buffer. Normally, rendering is directed to the back buffer while
-the front buffer is displayed. When rendering of a frame is finished
-the front and back buffers are swapped to provide the illusion of
-instanteous screen updates.</p>
-<p>The color buffers for a particular window (i.e. drawable) may be
-swapped with the glXSwapBuffers command:</p>
-<blockquote>
- <pre>void glXSwapBuffers(Display *dpy, GLXDrawable drawable)<br></pre>
-</blockquote>
-Any pending rendering commands will be completed before the buffer swap
-takes place.<br>
-<br>
-Calling glXSwapBuffers on a window which is single-buffered has no
-effect.<br>
-<br>
-<h2>3.7 Releasing Resources</h2>
-<h3>3.7.1 Releasing Rendering Contexts</h3>
-<p>A rendering context may be destroyed by calling glXDestroyContext:</p>
-<blockquote>
- <pre>void glXDestroyContext(Display *dpy, GLXContext ctx)<br></pre>
-</blockquote>
-<h3>3.7.2 Releasing Windows</h3>
-<p>A window may be destroyed by calling XDestroyWindow:</p>
-<blockquote>
- <pre>void XDestroyWindow(Display *dpy, Window window)<br></pre>
-</blockquote>
-<h3>3.7.3 Releasing Visuals</h3>
-<p>An XVisualInfo object may be freed by calling XFree:</p>
-<blockquote>
- <pre>void XFree(void *data)<br></pre>
-</blockquote>
-<h3>3.7.4 Releasing Colormaps</h3>
-<p>A colormap may be freed by calling XFreeColormap:</p>
-<blockquote>
- <pre>void XFreeColormap(Display *dpy, Colormap colormap)<br></pre>
-</blockquote>
-<h3>3.7.4 Releasing Display Resources</h3>
-<p>When the application is about to exit, the resources associated with
-the graphics system can be released by calling XCloseDisplay:</p>
-<blockquote>
- <pre>void XCloseDisplay(Display *dpy)<br></pre>
-</blockquote>
-<p>The display handle becomes invalid at this point.<br>
-<br>
-</p>
-<h2>3.8 Query Functions</h2>
-<h3>3.8.1 Querying Available Visuals</h3>
-A list of all available visuals can be obtained with the XGetVisualInfo
-function:<br>
-<br>
-<div style="margin-left: 40px;"><code>XVisualInfo
-*XGetVisualInfo(Display *dpy, long vinfo_mask, XVisualInfo
-*vinfo_template, int *nitems_return)<br>
-</code></div>
-<br>
-The parameters are as follows:<br>
-<blockquote>
- <dl>
- <dt><code>dpy</code></dt>
- <dd>The display handle, as returned by XOpenDisplay.</dd>
- <dt><code>vinfo_mask</code></dt>
- <dd>A bitmask indicating which fields of the vinfo_template are to
-be matched. &nbsp;The value must be VisualScreenMask.</dd>
- <dt><code>vinfo_template</code></dt>
- <dd>A template whose fields indicate which visual attributes must
-be matched by the results. &nbsp;The screen field of this structure must
-be zero.</dd>
- <dt><code>nitems_return</code></dt>
- <dd>Returns the number of visuals returned. </dd>
- </dl>
-</blockquote>
-The return value is the address of an array of all available visuals.<br>
-<br>
-An example of using XGetVisualInfo to get all available visuals follows:<br>
-<br>
-<div style="margin-left: 40px;"><code>XVisualInfo visTemplate, *results;</code><br>
-<code>int numVisuals;</code><br>
-<code>Display *dpy = XOpenDisplay(NULL);</code><br>
-<code>visTemplate.screen = 0;</code><br>
-<code>results = XGetVisualInfo(dpy, VisualScreenMask, &amp;visTemplate,
-&amp;numVisuals);</code><br>
-<code></code></div>
-<br>
-<h3>3.8.2 Querying Visual Attributes</h3>
-<p>The GLX attributes of an X visual may be queried with the
-glXGetConfig function:</p>
-<blockquote>
- <pre>int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute, int *value)<br></pre>
-</blockquote>
-<p>The parameters are as follows:</p>
-<blockquote>
- <dl>
- <dt><code>dpy</code></dt>
- <dd>The display handle, as returned by XOpenDisplay.</dd>
- <dt><code>vis</code></dt>
- <dd>The visual, as returned by glXChooseVisual.</dd>
- <dt><code>attribute</code></dt>
- <dd>The attribute to query. The attributes are listed below.</dd>
- <dt><code>value</code></dt>
- <dd>Pointer to an integer in which the result of the query will be
-stored. </dd>
- </dl>
-</blockquote>
-<p>The return value will be zero if no error occurs.<code>
-&nbsp;GLX_INVALID_ATTRIBUTE</code> will be returned if the attribute
-parameter is invalid.<code> &nbsp;GLX_BAD_VISUAL</code> will be returned
-if the XVisualInfo parameter is invalid.</p>
-<p>The following attributes may be queried:</p>
-<blockquote>
- <dl>
- <dt><code>GLX_USE_GL</code></dt>
- <dd>The result will be <code>True</code> or <code>False</code> to
-indicate if OpenGL rendering is supported with the visual. Mini GLX
-always return <code>True</code>.</dd>
- <dt><code>GLX_RGBA</code></dt>
- <dd>The result will be <code>True</code> for RGBA visuals or <code>False</code>
-for color index visuals.</dd>
- <dt><code>GLX_DOUBLEBUFFER</code></dt>
- <dd>The result will be <code>True</code> if the visual has two
-color buffers or <code>False</code> if the visual has one color buffer.</dd>
- <dt><code>GLX_RED_SIZE</code></dt>
- <dd>The result will be the number of red bits per pixel.</dd>
- <dt><code>GLX_GREEN_SIZE</code></dt>
- <dd>The result will be the number of green bits per pixel.</dd>
- <dt><code>GLX_BLUE_SIZE</code></dt>
- <dd>The result will be the number of blue bits per pixel.</dd>
- <dt><code>GLX_ALPHA_SIZE</code></dt>
- <dd>The result will be the number of alpha bits per pixel.</dd>
- <dt><code>GLX_DEPTH_SIZE</code></dt>
- <dd>The result will be the number of bits per Z value.</dd>
- <dt><code>GLX_STENCIL_SIZE</code></dt>
- <dd>The result will be the number of bits per stencil value.<br>
- <br>
- </dd>
- </dl>
-</blockquote>
-<h3>3.8.3 Querying the Current Rendering Context</h3>
-<p>The current rendering context can be queried with
-glXGetCurrentContext: </p>
-<blockquote>
- <pre>GLXContext glXGetCurrentContext(void)<br></pre>
-</blockquote>
-<p>Zero will be returned if no context is currently bound.<br>
-<br>
-</p>
-<h3>3.8.4 Querying the Current Drawable</h3>
-<p>The current drawable (i.e. window or drawing surface) can be queried
-with glXGetCurrentDrawable:</p>
-<blockquote>
- <pre>GLXDrawable glXGetCurrentDrawable(void)<br></pre>
-</blockquote>
-<p>Zero will be returned if no drawable is currently bound.<br>
-<br>
-</p>
-<h3>3.8.5 Function Address Queries</h3>
-<p>The glXGetProcAddress function will return the address of any
-available OpenGL or Mini GLX function:</p>
-<blockquote>
- <pre>void *glXGetProcAddress(const GLubyte *procName)<br></pre>
-</blockquote>
-<p>If <code>procName</code> is a valid function name, a pointer to that
-function will be returned. &nbsp;Otherwise, NULL will be returned.</p>
-<p>The purpose of glXGetProcAddress is to facilitate using future
-extensions to OpenGL or Mini GLX. If a future version of the library
-adds new extension functions they'll be accessible via
-glXGetProcAddress. The alternative is to hard-code calls to the new
-functions in the application but doing so will prevent linking the
-application with older versions of the library.<br>
-<br>
-</p>
-<h2>3.9 Versioning</h2>
-The Mini GLX version can be queried at run time with glXQueryVersion:
-<blockquote>
- <pre>Bool glXQueryVersion(Display *dpy, int *major, int *minor)<br></pre>
-</blockquote>
-<p><code>major</code> will be set to the major version number and<code>minor</code>
-will be set to the minor version number.<code>True</code> will be
-returned if the function succeeds. <code>False</code> will be returned
-if the function fails due to invalid parameters. The <code>dpy</code>
-argument is currently ignored, but should be the value returned by
-XOpenDisplay.</p>
-<p>At compile time, the Mini GLX interface version can be tested with
-the MINI_GLX_VERSION_1_<i>x</i> preprocessor tokens. For example, if
-version 1.0 of Mini GLX is supported, then<code> MINI_GLX_VERSION_1_0</code>
-will be defined. If version 1.1 of Mini GLX is supported, then<code>
-MINI_GLX_VERSION_1_1</code> will be defined.</p>
-<p>At the time of writing the current Mini GLX version is 1.0.<br>
-<br>
-</p>
-<h1>4.0 Interoperability with GLX and Xlib</h1>
-While Mini GLX strives to be compatible with GLX and Xlib there are
-some unavoidable differences which must be taken into consideration.<br>
-<h2>4.1 Public vs Private Structures</h2>
-The structure of many X data types is public. &nbsp;For example, the <code>Display</code>
-data type is defined as a structure in /usr/include/X11/Xlib.h and
-programmers may access any fields of that structure at will. &nbsp;Mini
-GLX also defines a Display data type but its fields are hidden and not
-visiblein <code>miniglx.h</code>. &nbsp;Duplicating the Xlib
-declaration for the <code>Display</code> data type in minigl.h would
-require defining a large number of other superfluous Xlib datatypes.<br>
-<br>
-Mini GLX users are discouraged from directly accessing the fields of
-Xlib data types to maximize portability - though this is unavoidable to
-some extent. &nbsp;For example, the <code>XVisualInfo</code> and <code>XSetWindowAtttributes</code>
-data types must be completely public.
-<h2>4.2 Macros</h2>
-In some cases, Xlib defines macros which are meant to be used instead
-of direct structure accesses. &nbsp;For example, the <code>RootWindow(dpy,
-screen)</code> macro returns the root window for a given screen on a
-given display. &nbsp;Unfortunately, macros do nothing to aid in ABI
-compatibility since they are resolved at compile time instead of at
-link/run time.<br>
-<br>
-Mini GLX also defines a <code>RootWindow</code> macro since it's
-essential for creating windows. &nbsp;But the implementation of this
-macro by Xlib and Mini GLX is completely different.<br>
-<h2>4.3 Summary</h2>
-Because Xlib and Mini GLX define data types and macros differently,
-Mini GLX applications must be recompiled when retargeting Mini GLX or
-native Xlib/GLX. &nbsp;That is, applications can't simply be re-linked
-because of ABI incompatibilities.<br>
-<br>
-Nevertheless, the fact that Mini GLX programs can be recompiled for
-Xlib and GLX increases portability and flexibility for testing and
-prototyping.<br>
-<br>
-<h1>5.0 Example Program</h1>
-<p>This section shows an example program which uses the Mini GLX
-interface. The program simply draws several frames of a rotating square.<br>
-</p>
-<p>The program may be compiled for use with Xlib/GLX or Mini GLX by
-setting the <code>USE_MINIGLX</code> token to 0 or 1, respectively.
-&nbsp;Note that the only difference is the header files which are
-included.<br>
-</p>
-<p> </p>
-<pre><code><br></code>#define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */<br><br>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;GL/gl.h&gt;<br><br>#if USE_MINIGLX<br>#include &lt;GL/miniglx.h&gt;<br>#else<br>#include &lt;GL/glx.h&gt;<br>#include &lt;X11/Xlib.h&gt;<br>#endif<br><br><code>/*<br> * Create a simple double-buffered RGBA window.<br> */<br>static Window<br>MakeWindow(Display * dpy, unsigned int width, unsigned int height)<br>{<br> int visAttributes[] = {<br> GLX_RGBA,<br> GLX_RED_SIZE, 1,<br> GLX_GREEN_SIZE, 1,<br> GLX_BLUE_SIZE, 1,<br> GLX_DOUBLEBUFFER,<br> None<br> };<br> XSetWindowAttributes attr;<br> unsigned long attrMask;<br> Window root;<br> Window win;<br> GLXContext ctx;<br> XVisualInfo *visinfo;<br><br> root = RootWindow(dpy, 0);<br><br> /* Choose GLX visual / pixel format */<br> visinfo = glXChooseVisual(dpy, 0, visAttributes);<br> if (!visinfo) {<br> printf("Error: couldn't get an RGB, Double-buffered visual\n");<br> exit(1);<br> }<br><br> /* Create the window */<br> attr.background_pixel = 0;<br> attr.border_pixel = 0;<br> attr.colormap = XCreateColormap(dpy, root, visinfo-&gt;visual, AllocNone);<br> attrMask = CWBackPixel | CWBorderPixel | CWColormap;<br> win = XCreateWindow(dpy, root, 0, 0, width, height,<br> 0, visinfo-&gt;depth, InputOutput,<br> visinfo-&gt;visual, attrMask, &amp;attr);<br> if (!win) {<br> printf("Error: XCreateWindow failed\n");<br> exit(1);<br> }<br><br> /* Display the window */<br> XMapWindow(dpy, win);<br><br> /* Create GLX rendering context */<br> ctx = glXCreateContext(dpy, visinfo, NULL, True);<br> if (!ctx) {<br> printf("Error: glXCreateContext failed\n");<br> exit(1);<br> }<br><br> /* Bind the rendering context and window */<br> glXMakeCurrent(dpy, win, ctx);<br><br> return win;<br>}<br><br><br>/*<br> * Draw a few frames of a rotating square.<br> */<br>static void<br>DrawFrames(Display * dpy, Window win)<br>{<br> int angle;<br> glShadeModel(GL_FLAT);<br> glClearColor(0.5, 0.5, 0.5, 1.0);<br> for (angle = 0; angle &lt; 360; angle += 10) {<br> glClear(GL_COLOR_BUFFER_BIT);<br> glColor3f(1.0, 1.0, 0.0);<br> glPushMatrix();<br> glRotatef(angle, 0, 0, 1);<br> glRectf(-0.8, -0.8, 0.8, 0.8);<br> glPopMatrix();<br> glXSwapBuffers(dpy, win);<br> }<br>}<br><br><br>int<br>main(int argc, char *argv[])<br>{<br> Display *dpy;<br> Window win;<br><br> dpy = XOpenDisplay(NULL);<br> if (!dpy) {<br> printf("Error: XOpenDisplay failed\n");<br> return 1;<br> }<br><br> win = MakeWindow(dpy, 300, 300);<br><br> DrawFrames(dpy, win);<br><br> return 0;<br>}<br></code></pre>
-<br>
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/README.3DFX b/nx-X11/extras/Mesa/docs/README.3DFX
deleted file mode 100644
index 037e8fa7c..000000000
--- a/nx-X11/extras/Mesa/docs/README.3DFX
+++ /dev/null
@@ -1,830 +0,0 @@
-
- 3Dfx Glide device driver
-
-
-
-Requirements:
--------------
-
-A Voodoo-based videocard/accelerator
-DOS (with DJGPP), Windows9x/2k (with MinGW), Linux
-Glide3x library for your OS
-
-http://sourceforge.net/projects/glide/
-
-
-
-How to compile:
----------------
-
-DJGPP:
- Place the Glide3 SDK in the top Mesa directory:
- $(MESA)/glide3/include/
- 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
- $(MESA)/glide3/lib/
- libgld3x.a, libgld3i.a, glide3x.dxe
- Type:
- make -f Makefile.DJ X86=1 FX=1
- Look into the makefile for further information.
-
-MinGW:
- Place the Glide3 SDK in the top Mesa directory:
- $(MESA)/glide3/include/
- 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
- $(MESA)/glide3/lib/
- libglide3x.a, glide3x.dll
- Type:
- make -f Makefile.mgw X86=1 FX=1
- Look into the makefile for further information.
-
-Linux:
- Place the Glide3 SDK in /usr/local/glide
- /usr/local/glide/include/
- 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
- /usr/local/glide/lib/
- libglide3x.a, libglide3x.so
- Type:
- make linux-glide
- or
- make linux-x86-glide
-
-
-
-Compilation defines:
---------------------
-
-FX_DEBUG
- enable driver debug code
-FX_TRAP_GLIDE
- enable Glide trace code
-FX_PACKEDCOLOR
- use packed color in vertex structure
-FX_TC_NAPALM
- map GL_COMPRESSED_RGB[A] to FXT1. Works with VSA100-based cards only.
-FX_COMPRESS_S3TC_AS_FXT1_HACK
- map S3TC to FXT1
-FX_RESCALE_BIG_TEXURES_HACK
- fake textures larger than HW can support
- (see MESA_FX_MAXLOD environment variable)
-
-
-
-Environment variables:
-----------------------
-
-The following environment variables affect MesaFX. Those that affect Glide
-only, are beyond the scope of this section. Entries that don't have a "Value"
-field, can have any value whatsoever
- ex: set MESA_FX_IGNORE_CMBEXT=y
-
-"Note" (*) means that the environment variable affects Glide, too; also, if
-the var is not found in the environment, it is searched in windoze registry.
-"Note" (!) means that the environment variable is not working as expected;
-may have undefined effects, might have effects only at Glide level or might
-not have any effect whatsoever. Caveat emptor! Those are to be revised soon.
-
-It is recommended to leave the envvars alone, so that Mesa/Glide will run with
-default values. Use them only when you experience crashes or strange behavior.
-
-FX_GLIDE_NUM_TMU
- OS: all
- HW: dual-TMU cards (Voodoo2, Avenger, Napalm)
- Desc: force single-TMU
- Note: (*)
- Value: "1"
-FX_GLIDE_SWAPPENDINGCOUNT
- OS: all
- HW: all
- Desc: max # of buffers allowed to build up
- Note: (*) (!)
- Value: "0", "1", "2", "3", "4", "5" or "6"
-FX_GLIDE_SWAPINTERVAL
- OS: all
- HW: all
- Desc: number of vertical retraces to wait before swapping
- Note: (*) (!) works only at Glide-level?
-SSTH3_SLI_AA_CONFIGURATION
- OS: all
- HW: VSA100-based cards
- Desc: SLI/AA setup
- Note: (*) (!) works only at Glide-level?
- Value:
- 1, 2, 4 chip cards
- "0" - SLI & AA disable
- "1" - SLI disabled, 2 sample AA enabled
- 2, 4 chip cards
- "2" - 2-way SLI enabled, AA disabled
- "3" - 2-way SLI enabled, 2 sample AA enabled
- "4" - SLI disabled, 4 sample AA enabled
- 4 chip cards
- "5" - 4-way SLI enabled, AA disabled
- "6" - 4-way SLI enabled, 2 sample AA enabled
- "7" - 2-way SLI enabled, 4 sample AA enabled
- "8" - SLI disabled, 8 sample AA enabled
-SST_DUALHEAD
- OS: win32
- HW: ?
- Desc: ?
- Note: (!) disabled?
-MESA_FX_NO_SIGNALS
- OS: linux
- HW: all
- Desc: avoid installing signals
- Note: (!) untested!
-MESA_FX_INFO
- OS: all
- HW: all
- Desc: verbose to stderr
- Value: any; special value "r" to redirect stderr to MESA.LOG
-MESA_FX_NOSNAP
- OS: all
- HW: Voodoo1, Rush, Banshee
- Desc: do not snap vertices inside Mesa
- Note: to be used with Glide3x that snaps vertices internally
-MESA_FX_POINTCAST
- OS: all
- HW: dual-TMU cards (some Voodoo1, Voodoo2, Avenger, Napalm)
- Desc: try to use pointcast palette
- Note: may give adverse effects on UMA cards (Avenger, Napalm)
-MESA_FX_IGNORE_PALEXT
- OS: all
- HW: all
- Desc: disable 6666 palette
-MESA_FX_IGNORE_PIXEXT
- OS: all
- HW: Napalm
- Desc: force 565 16bpp mode (traditional Voodoo, no 32/15bpp)
-MESA_FX_IGNORE_TEXFMT
- OS: all
- HW: Napalm
- Desc: disable 32bit textures
-MESA_FX_IGNORE_CMBEXT
- OS: all
- HW: Napalm
- Desc: disable Napalm combiners (color/alpha/texture)
- Note: this option allows dual-TMU cards perform single-pass
- trilinear, but some advanced (multi)texturing modes
- won't work (GL_EXT_texture_env_combine)
-MESA_FX_IGNORE_MIREXT
- OS: all
- HW: all
- Desc: disable mirror extension
-MESA_FX_IGNORE_TEXUMA
- OS: all
- HW: all
- Desc: disable UMA
-MESA_FX_IGNORE_TEXUS2
- OS: all
- HW: all
- Desc: disable Texus2
-MESA_FX_MAXLOD
- OS: all
- HW: non VSA-100 cards
- Desc: enable large texture support using SW rescaling
- Value:
- "9" - 512x512 textures
- "10" - 1024x1024 textures
- "11" - 2048x2048 textures
-MESA_FX_ALLOW_VP
- OS: all
- HW: all
- Desc: allow vertex program extensions
-MESA_GLX_FX
- OS: linux
- HW: Voodoo1, Rush, Voodoo2
- Desc: display mode
- Note: (!) experimental
- Value:
- "w" - windowed mode
- "f" - fullscreen mode
- "d" - disable glide driver
- OS: win32
- HW: Rush, Banshee, Avenger, Napalm
- Desc: display mode
- Note: (!) experimental
- Value:
- "w" - windowed mode
-
-
-
-Contact:
---------
-
-Daniel Borca <dborca 'at' users 'dot' sourceforge 'dot' net>
-Hiroshi Morii <koolsmoky 'at' users 'dot' sourceforge 'dot' net>
-
-
-
-WARNING! The info below this line is outdated (yet some of it useful). WARNING!
-*******************************************************************************
-
-
-
-Info for Mesa 4.1
------------------
-
-The 3dfx Glide driver in Mesa is disabled by default. Not too many people
-use this driver anymore and at some point down the road it will be dropped.
-
-To use/enable the Glide driver either do this:
-
-'./configure --with-glide=DIR' Where DIR is the location of Glide, like
- /usr/ or /usr/local
-
-OR
-
-'make linux-x86-glide' If using the old-style Makefile system.
-
-The rest of this file hasn't changed since Mesa 3.3. Some of it's out of
-date, but some is still valid.
-
-
-
-What do you need ?
-------------------
-
- - A PC with a 3Dfx Voodoo1/2 Graphics or Voodoo Rush based board
- (Pure3D, Monster 3D, R3D, Obsidian, Stingray 128/3D, etc.).
- The Quantum3D Obsidian3D-2 X-24 requires some special env. setting
- under Linux (more information in the "Useful Glide Environment
- Variables");
-
- - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine).
- The Voodoo2 requires the Glide library 2.51. The Glide 3.1 is not
- compatible with the Glide 2.x so it doesn't work with the current
- version of the driver;
-
- - A compiler supported by the Glide library (Micro$oft VC++ (tested),
- Watcom (tested), GCC for Linux (tested), etc.);
-
- - It's nice to have two monitors - one for your normal graphics
- card and one for your 3Dfx card. If something goes wrong with
- an application using the 3Dfx hardware you can still see your
- normal screen in order to recover.
-
-
-
-Tested on:
-----------
- Windows 95 - David Bucciarelli
- Windows NT - Henri Fousse
- MS-DOS
- Linux - Daryll Strauss, Brian Paul, David Bucciarelli
- FreeBSD
- BeOS - Duncan Wilcox
- MacOS - Fazekas Miklos
-
-
-What is able to do ?
---------------------
-
- - It is able accelerate points, lines and polygon with flat
- shading, gouraud shading, Z-buffer, texture mapping, blending, fog and
- antialiasing (when possible). There is also the support for rendering
- in a window with a slow trick for the Voodoo Graphics (available only
- for Linux) and at full speed with the Voodoo Rush chipset.
- Under Linux is also possible to switch on-the-fly between the fullscreen
- and in-window rendering hack.
- There is also the support for using more than one Voodoo Graphics in the
- some application/PC (you can create one context for each board and use
- multiple video outputs for driving monitors, videoprojectors or HMDs).
- The driver is able to fallback to pure software rendering when afeature
- isn't supported by the Voodoo hardware (however software rendering is
- very slow compared to hardware supported rendering)
-
-
-
-How to compile:
----------------
-
-Linux:
-------
- Here are the basic steps for using the 3Dfx hardware with Mesa
- on Linux:
-
- - You'll need the Glide library and headers. Mesa expects:
- /usr/local/glide/include/*.h // all the Glide headers
- /usr/local/glide/lib/libglide2x.so
-
- If your Glide libraries and headers are in a different directory
- you'll have to modify the Mesa-config and mklib.glide files.
-
- - Unpack the MesaLib-3.1.tar.gz and MesaDemos-3.1.tar.gz archives;
-
- - If you're going to use a newer Mesa/Glide driver than v0.27 then
- unpack the new driver archive over the Mesa directory.
-
- - In the Mesa-3.1 directory type "make linux-glide"
-
- - Compilation _should_ finish without errors;
-
- - Set your LD_LIBRARY_PATH environment variable so that the
- libglide2x.so and Mesa library files can be found. For example:
- setenv LD_LIBRARY_PATH "/usr/local/glide/lib:/SOMEDIR/Mesa-3.1/lib"
-
- - You'll have to run Glide-based programs as root or set the suid
- bit on executables;
-
- - Try a demo:
- cd gdemos
- su
- setenv MESA_GLX_FX f
- ./gears (hit ESC to exit)
-
- - You can find the demos especially designed for the Voodoo driver in
- in the Mesa-3.1/3Dfx/demos directory (type "make" in order to compile
- everything).
-
-MacOS:
-------
- Check the WEB page at http://valerie.inf.elte.hu/~boga/Mesa.html
-
-MS Windows:
------------
-
- For the MSVC++:
- - The glide2x.lib have to be in the default MSVC++ lib directory;
-
- - The Glide headers have to be in the default MSVC++ include directory;
-
- - You must have the vcvars32.bat script in your PATH;
-
- - Go to the directory Mesa-3.1 and run the mesafx.bat;
-
- - The script will compile everything (Mesa-3.1/lib/OpenGL32.{lib,dll},
- Mesa-3.1/lib/GLU32.{lib,dll}, Mesa-3.1/lib/GLUT32.{lib,dll} and
- Voodoo demos);
-
- - At the end, you will be in the Mesa-3.1/3Dfx/demos directory;
-
- - Try some demo (fire.exe, teapot.exe, etc.) in order to check if
- everything is OK (you can use Alt-Tab or Ctrl-F9 to switch between
- the Voodoo screen and the windows desktop);
-
- - Remember to copy the Mesa OpenGL32.dll, GLU32.dll and GLUT32.dll in the
- some directory were you run your Mesa based applications.
-
- - I think that you can easy change the Makefile.fx files in order
- to work with other kind of compilers;
-
- - To discover how open the 3Dfx screen, read the sources under
- the Mesa-3.1/3Dfx/demos directory. You can use the GLUT library or
- the Diego Picciani's wgl emulator.
-
- NOTE: the MSVC++ 5.0 optimizer is really buggy. Also if you install the
- SP3, you could have some problem (you can disable optimization in order
- solve these kind of problems).
-
-
-Doing more with Mesa & Linux Glide:
------------------------------------
-
- The MESA_GLX_FX environment variable can be used to coax most
- GLX-based programs into using Glide (and the __GLUT library
- is GLX-based__).
-
- Full-screen 3Dfx rendering:
- ---------------------------
-
- 1. Set the MESA_GLX_FX variable to "fullscreen":
-
- ksh:
- export MESA_GLX_FX = "fullscreen"
- csh:
- setenv MESA_GLX_FX fullscreen
-
- 2. As root, run a GLX-based program (any GLUT demo on Linux).
-
- 3. Be careful: once the 3Dfx screen appears you won't be able
- to see the GLUT windows on your X display. This can make using
- the mouse tricky! One solution is to hook up your 3Dfx card to
- a second monitor. If you can do this then set these env vars
- first:
-
- setenv SST_VGA_PASS 1
- setenv SST_NOSHUTDOWN
-
- or for the Voodoo2:
-
- setenv SSTV2_VGA_PASS 1
- setenv SSTV2_NOSHUTDOWN
-
- Rendering into an X window with the help of the Voodoo hardware:
- ----------------------------------------------------------------
-
- 1. Start your X server in 16 bpp mode (XFree86: startx -- -bpp 16)
- in order to have the best performance and the best visual
- quality. However you can use any visual depth supported by X.
-
- 2. Set the following environment variables:
- export MESA_GLX_FX="window" # to enable window rendering
- export SST_VGA_PASS=1 # to stop video signal switching
- export SST_NOSHUTDOWN=1 # to stop video signal switching
- OR
- setenv MESA_GLX_FX window
- setenv SST_VGA_PASS 1
- setenv SST_NOSHUTDOWN 1
-
- (the Voodoo2 requires to use "SSTV2_" instead "SST_").
-
- 3. As root, try running a GLX-based program
-
- How does it work? We use the 3Dfx hardware to do rendering then
- copy the image from the 3Dfx frame buffer into an X window when
- the SwapBuffers() function is called. The problem with this
- idea is it's slow. The image must be copied from the 3Dfx frame
- buffer to main memory then copied into the X window (and when the X
- visual depth doesn't match the Voodoo framebufffer bit per pixel, it
- is required also a pixel format translation).
-
- NOTE: the in-window rendering feature only works with double-buffering.
-
-
- On the fly switching between in window rendering and full screen rendering
- --------------------------------------------------------------------------
-
- The Mesa 2.6 has introduced the capability of switching
- on-the-fly between the fullscreen/fullspeed rendering and the in-window
- hack and vice versa. The on-the-fly switching requires a direct support
- by the application but it is really easy to add. You have to start
- your X server in 16 bpp mode and to add the following lines to your
- application:
-
- #if defined(FX) && define(XMESA)
- #include <GL/xmesa.h>
-
- static int fullscreen=1;
- #endif
-
- ...
-
- /* In the GLUT keyboard event callback */
-
- #if defined(FX) && !define(WIN32)
- case ' ':
- fullscreen=(!fullscreen);
- XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW);
- break;
- #endif
- ...
-
- See the 3Dfx/demos/tunnel.c program
- for an example. You have to set the -DXMESA flag in the Makefile's COPTS
- to enable it.
-
- Rendering into an X window with the X11 software driver:
- --------------------------------------------------------
-
- Set the MESA_GLX_FX variable to "disable" your GLX-based program will use
- the X11 software driver (the 3Dfx hardware isn't used at all).
-
-
-
-Useful Glide Environment Variables:
------------------------------------
-
- - To disable the 3Dfx logo, set the FX_GLIDE_NO_SPLASH variable.
-
- - To disable video signal switching:
- setenv SST_VGA_PASS 1
- setenv SST_NOSHUTDOWN
- or for the Voodoo2:
- setenv SSTV2_VGA_PASS 1
- setenv SSTV2_NOSHUTDOWN
-
- - To set the default screen refresh rate:
- setenv SST_SCREENREFRESH=75
-
- the supported values are 60, 70, 72, 75, 80, 85, 90, 100, 120.
-
- - To force the Mesa library to swap buffers as fast as possible,
- without any vertical blanking synchronization (useful for benchmarks):
- setenv FX_GLIDE_SWAPINTERVAL 0
- setenv SST_SWAP_EN_WAIT_ON_VIDSYNC 0
-
- - You can slight improve the performances of your Voodoo1 board with
- the following env. var.:
- setenv SST_FASTMEM 1
- setenv SST_PCIRD 1
- setenv SST_GRXCLK 57
-
- (don't use this setting with the Quantum3D 100SB or with any other
- SLI configuration: it will hang everything !).
- The following setting can be used with the Voodoo2:
- setenv SSTV2_FASTMEM_RAS_READS=1
- setenv SSTV2_FASTPCIRD=1
- setenv SSTV2_GRXCLK=95
-
- - The Quantum3D Obsidian3D-2 X-24 requires some special env. setting
- in order to work under Linux:
-
- export SSTV2_FT_CLKDEL=5
- export SSTV2_TF0_CLKDEL=7
- export SSTV2_TF1_CLKDEL=7
- export SSTV2_TF2_CLKDEL=7
- export SSTV2_SLIM_VIN_CLKDEL=3
- export SSTV2_SLIM_VOUT_CLKDEL=2
- export SSTV2_SLIS_VIN_CLKDEL=3
- export SSTV2_SLIS_VOUT_CLKDEL=2
-
- (Thanks to Phil Ross for this trick).
-
-
-
-
-The Mesa/Voodoo Environment Variables:
---------------------------------------
-
- - Only for Windows/Voodoo Rush users, if you define the
- env. var. MESA_WGL_FX:
- export MESA_WGL_FX=fullscreen
- you will get fullscreen rendering;
-
- - Only for Windows/Voodoo Rush users, if you define the
- env. var. MESA_WGL_FX:
- export MESA_WGL_FX=window
- you will get window rendering (default value);
-
- - Only for Linux users, you can find more informations about
- the env. var. MESA_GLX_FX in the "Doing more with Mesa & Linux Glide"
- section;
-
- - If you define the env. var. MESA_FX_SWAP_PENDING:
- export MESA_FX_SWAP_PENDING=4
- you will able to set the maximum number of swapbuffers
- commands in the Voodoo FIFO after a swapbuffer (default value: 2);
-
- - If you define the env. var. MESA_FX_INFO:
- export MESA_FX_INFO=1
- you will get some useful statistic.
-
- - If you define the env. var. MESA_FX_NO_SIGNALS:
- export MESA_FX_NO_SIGNALS=1
- Mesa/FX will not install atexit() or signal() handlers.
-
-
-
-Know BUGS and Problems:
------------------------
-
- - fog doesn't work in the right way when using the glDepthRange() function;
-
- - Maximum texture size: 256x256 (this is an hardware limit);
-
- - Texture border aren't yet supported;
-
- - A GL_BLEND in a glTexEnv() is not supported (it is an hardware limit);
-
- - Use the glBindTexture extension (standard in OpenGL 1.1) for texture
- mapping (the old way: glTexImage inside a display list, download
- the texture map each time that you call the display list !!!);
-
- - Stencil buffer and Accumulation buffer are emulated in software (they are not
- directly supported by the Hardware);
-
- - Color index mode not implemented (this is an hardware limit);
-
- - Thre is an know bug in the Linux Glide library so the in-window-rendering hack
- and any other operations that requires to read the Voodoo frame buffer
- (like the accumulation buffer support) doesn't work on Voodoo SLI cards.
-
- - The driver switch to pure software (_slow_) rendering when:
-
- - Stencil enabled;
- - Using the Accumulation buffer;
- - Blend enabled and blend equation != GL_FUNC_ADD_EXT;
- - Color logic operation enabled and color logic operation != GL_COPY;
- - Using GL_SEPARATE_SPECULAR_COLOR;
- - The four values of glColorMask() aren't the some;
- - Texture 1D or 3D enabled;
- - Texture function is GL_BLEND;
- - Using the Multitexture extension with Voodoo cards with only one TMU;
- - Using the Multitexture extension with Voodoo cards with more than
- one TMU, and texture function isn't GL_MODULATE;
- - Point size is != 1.0 or point params vector != (1.0,0.0,0.0);
- - Line width != 1.0 or using stipple lines.
- - Using polygon offset or stipple polygons;
-
- NOTE: this is list is not yet complete.
-
-
-Hints and Special Features:
----------------------------
-
- - Under Linux and with a Voodoo Graphics board, you can use
- XMesaSetFXmode(XMESA_FX_FULLSCREEN or XMESA_FX_WINDOW) in order to
- switch on the fly between fullscreen rendering and the in-window-rendering
- hack.
-
- - The driver is able to use all the texture memory available: 2/4MB on
- Voodoo1 boards and 8MB (!) on high-end Voodoo1 and Voodoo2 boards.
-
- - Trilinear filtering is fully supported on Voodoo boards with two TMUs
- (high-end Voodoo1 boards and Voodoo2 boards). When only one TMU is
- available the driver fallback to bilinear filter also if you ask
- for trilinear filtering.
-
- - The Voodoo driver support multiple Voodoo Graphics boards in the
- some PC. Using this feature, you can write applications that use
- multiple monitors, videoprojectors or HMDs for the output. See
- Mesa-3.1/3Dfx/demos/tunnel2.c for an example of how setup one
- context for each board.
-
- - The v0.19 introduces a new powerful texture memory manager: the
- texture memory is used as a cache of the set of all defined texture
- maps. You can now define several MBs of texture maps also with a 2MB
- of texture memory (the texture memory manager will do automatically
- all the swap out/swap in
- texture memory work). The new texture memory manager has also
- solved a lot of other bugs/no specs compliance/problems
- related to the texture memory usage.
-
- - Use triangles and quads strip: they are a LOT faster than sparse
- triangles and quads.
-
- - The Voodoo driver supports the GL_EXT_paletted_texture. it works
- only with GL_COLOR_INDEX8_EXT, GL_RGBA palettes and the alpha value
- is ignored because this is a limitation of the the current Glide
- version and of the Voodoo hardware. See Mesa-3.1/3Dfx/demos/paltex.c for
- a demo of this extension.
-
- - The Voodoo driver directly supports 3Dfx Global Palette extension.
- It was written for GLQuake and I think that it isn't a good idea
- to use this extension for any other purpose (it is a trick). See
- Mesa-3.1/3Dfx/demos/glbpaltex.c for a demo of this extension.
-
- - The Voodoo driver chooses the screen resolution according to the
- requested window size. If you open a 640x480 window, you will get
- a 640x480 screen resolution, if you open a 800x600 window, you
- will get a 800x600 screen resolution, etc.
- Most GLUT demos support the '-geometry' option, so you can choose
- the screen resolution: 'tunnel -geometry 800x600'.
- Clearly, you Voodoo board must have enough framebuffer RAM (otherwise
- the window creation will fail).
-
- - The glGetString(GL_RENDERER) returns more information
- about the hardware configuration: "Mesa Glide <version>
- <Voodoo_Graphics|Voodoo_Rush|UNKNOWN> <num> CARD/<num> FB/
- <num> TM/<num> TMU/<NOSLI|SLI>"
- where: <num> CARD is the card used for the current context,
- <num> FB is the number of MB for the framebuffer,
- <num> TM is the number of MB for the texture memory,
- <num> TMU is the number of TMU. You can try to run
- Mesa/demos/glinfo in order to have an example of the output.
-
-Did you find a lot BUGs and problems ? Good, send me an email.
-
-
-
-FAQ:
-----
-
-For a complete FAQ check the Bernd Kreimeier's Linux 3Dfx HOWTO
-available at http://www.gamers.org/dEngine/xf3D (it includes also
-a lot of informations not strictly related to Linux, so it can be
-useful also if you don't use Linux)
-
-1. What is 3Dfx?
-
-3Dfx Interactive, Inc. is the company which builds the VooDoo 3-D graphics
-chipset (and others) used in popular PC cards such as the Diamond Monster 3D
-and the Orchid Righteous 3D (more informations at http://www.3dfx.com).
-
-
-2. What is Glide?
-
-Glide is a "thin" programming interface for the 3Dfx hardware. It was
-originally written for Windows/Intel but has been ported to Linux/Intel
-by Daryll Strauss.
-
-3Dfx, Inc. should be applauded for allowing the Linux version of Glide
-to be written.
-
-You can directly program with the Glide library if you wish. You can
-obtain Glide from the "Developer" section of the 3Dfx website: www.3dfx.com
-There's a Linux/Glide newsgroup at news://news.3dfx.com/3dfx.glide.linux
-
-
-3. What is fxmesa?
-
-"fxmesa" is the name of the Mesa device driver for the 3Dfx Glide library.
-It was written by David Bucciarelli and others. It works on both Linux
-and Windows. Basically, it allows you to write and run OpenGL-style programs
-on the 3Dfx hardware.
-
-
-4. What is GLQuake?
-
-Quake is a very popular game from id software, Inc. See www.idsoftware.com
-GLQuake is a version of Quake written for OpenGL. There is now a Linux
-version of GLQuake with works with the Mesa/3Dfx/Glide combo.
-
-Here's what you need to run GLQuake on Linux:
- PC with 100MHz Pentium or better
- a 3Dfx-based card
- Mesa 3.1 libraries: libMesaGL.so libMesaGLU.so
- Glide 2.4 libraries: libglide2x.so libtexus.so
- GLQuake for Linux.
-
-Also, the windows version of GLQuake works fine with the Mesa OpenGL32.dll,
-you have only to copy the Mesa-3.1/lib/OpenGL32.dll in the GLQuake directory
-in order to test 'MesaQuake'.
-
-
-5. What is GLUT?
-
-GLUT is Mark Kilgard's OpenGL Utility Toolkit. It provides an API for
-writing portable OpenGL programs with support for multiple windows, pop-
-up menus, event handling, etc.
-
-Check the Mark's home page for more informations (http://reality.sgi.com/mjk_asd).
-
-Every OpenGL programmer should check out GLUT.
-
-GLUT on Linux uses GLX.
-
-
-6. What is GLX?
-
-GLX is the OpenGL extension to the X Window System. I defines both a
-programming API (glX*() functions) and a network protocol. Mesa implements
-an emulation of GLX on Linux. A real GLX implementation would requires
-hooks into the X server. The 3Dfx hardware can be used with GLX-based
-programs via the MESA_GLX_FX environment variable.
-
-
-7. Is the Voodoo driver able to use the 4Mb texture memory of
-the Pure3D boards ?
-
-Yes, the Voodoo driver v0.20 includes the support for Voodoo
-Graphics boards with more than 2Mb of texture memory.
-
-
-8. Do the Voodoo driver support the Voodoo Rush under Windows ?
-
-Yes, Diego Picciani has developed the support for the Voodoo
-Rush but David Bucciarelli has a Pure3D and a Monster3D and Brian Paul
-has a Monster3D, so the new versions of the Mesa/Voodoo sometime are
-not tested with the Voodoo Rush.
-
-
-9. Do the Voodoo driver support the Voodoo Rush under Linux ?
-
-No because the Linux Glide doesn't (yet) support the Voodoo Rush.
-
-
-10. Can I sell my Mesa/Voodoo based software and include
-a binary copy of the Mesa in order to make the software
-working out of the box ?
-
-Yes.
-
-
-11. Which is the best make target for compiling the Mesa for
-Linux GLQuake ('make linux-glide', 'make linux-386-glide', etc.) ?
-
-'make linux-386-opt-glide' for Voodoo1 and 'make linux-386-opt-V2-glide'
-for Voodoo2 boards because it doesn't include the '-fPIC'
-option (4-5% faster).
-
-
-12. Can I use a Mesa compiled with a 'make linux-386-opt-V2-glide'
-for my applications/programs/demos ?
-
-Yes, there is only one constrain: you can't run two Mesa applications
-at the some time. This isn't a big issue with the today Voodoo Graphics.
-
-
-Thanks to:
-----------
-
-Henri Fousse (he has written several parts of the v0.15 and the old GLUT
- emulator for Win);
-
-Diego Picciani (he has developed all the Voodoo Rush support and the wgl
- emulator);
-
-Daryll Strauss (for the Linux Glide and the first Linux support);
-
-Brian Paul (of course);
-
-Dave 'Zoid' Kirsch (for the Linux GLQuake and Linux Quake2test/Q2 ports)
-
-Bernd Kreimeier (for the Linux 3Dfx HOWTO and for pushing companies to offer
- a better Linux support)
-
-3Dfx and Quantum3D (for actively supporting Linux)
-
-The most update places where find Mesa VooDoo driver related informations are
-the Mesa mailing list and my driver WEB page
-(http://www-hmw.caribel.pisa.it/fxmesa/index.shtml)
-
-
-David Bucciarelli (davibu@tin.it)
-
-Humanware s.r.l.
-Via XXIV Maggio 62
-Pisa, Italy
-Tel./Fax +39-50-554108
-email: info.hmw@plus.it
-www: www-hmw.caribel.pisa.it
diff --git a/nx-X11/extras/Mesa/docs/README.AMIWIN b/nx-X11/extras/Mesa/docs/README.AMIWIN
deleted file mode 100644
index 47cf696cc..000000000
--- a/nx-X11/extras/Mesa/docs/README.AMIWIN
+++ /dev/null
@@ -1,181 +0,0 @@
-AMIGA AMIWIN PORT of MESA: THE OPENGL SOFTWARE EMULATION
-========================================================
-Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu)
-Original Author (Brian Paul (brianp@ssec.wisc.edu)
-
-Dec.1 , 1995: Port of release Mesa 1.2.5
- - Modifications made to minimize changes to Mesa distribution.
-
-Nov.25, 1995: Port of release Mesa 1.2.4
-
-
-HISTORY
-=======
-As a 3D graphics progammer, I was increasingly frustrated to see OpenGL
-appearing on so many platforms EXCEPT the Amiga. Up to now, the task
-of porting OpenGL directly from native Amiga drawing routines seemed like
-a daunting task. However, two important events made this port possible.
-
-First of all, Brian Paul wrote Mesa, the OpenGL software emulator that
-can be found on many platforms - except the Amiga and Atari (who cares
-about the latter!). This was pretty ironic considering that Mesa was
-originally prototyped on an Amiga! The second great event was when
-Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely
-register for this great piece of software) and released a development kit
-so one could compile X programs with SAS/C.
-
-Since Mesa had X routines as its primitive drawing operations, this made
-a marriage of Mesa and Amiwin feasible. I copied over the sources from
-an ftp site, played with the code, wrote some Smakefiles, and voila,
-I had OpenGL programs displaying on my Amiga.
-
-Although the speed is nothing to be impressed about, this port can be
-potentially useful to those who want to quickly test their code in
-wireframe or perhaps learn more about programming with the OpenGL API.
-
-I hope Amiga developers will continue to write excellent software for
-their machine, especially more X clients for Amiwin. If you have any
-solutions so some of my problems in the porting notes, please send me
-some email!
-
-See you around,
-Vic.
-
-HOW TO CREATE THE LIBRARIES AND SAMPLE CODE
-===========================================
-
-Just run the shell script mklib.amiwin in the mesa directory. This will
-make all the libraries and copy them into the mesa/lib directory. If you
-don't want to compile everything, just go to the desired directory and
-type smake in that directory.
-
-Change any of the variables in the smakefiles as necessary. You will REQUIRE
-the Amiwin development kit to compile these libraries since you need X11.LIB
-and the shareable X libraries. Some examples require the AmiTCP4.0
-net.lib static link library and related header files for unix related
-header files and functions like sleep().
-
-HOW TO USE THE MESA LIBRARIES
-=============================
-
-Study the Smakefiles in the demos, samples and book directories for the
-proper SAS/C options and linkable libraries to use. Basically aux calls
-require Mesaaux.LIB, gl calls require MesaGL.LIB, glu calls MesaGLU.LIB,
-tk calls Mesatk.LIB. There is a preliminary port of MesaGLUT.LIB toolkit
-available in the lib directory with the other Mesa libraries. However,
-it seems to cause crashes on some of the sample code. Someone else may want
-to attempt a more stable port.
-
-PORTING NOTES TO AMIWIN
-=======================
-
-My strategy of porting was to leave as much of the code untouched as
-possible. I surrounded any amiga specific changes with
-#ifdef AMIWIN ... #endif or #ifndef AMIWIN ... #endif preprocessor
-symbols. The code was ported on an Amiga 2000, with Fusion 40 accelerator
-and a Picasso II graphics card. The SAS/C 6.56 compiler was used, with
-the AmiWin 2.16 X development kit.
-
-All compilations were done for a 68040 CPU with 68882 math coprocessor for
-maximum speed. Please edit the smakefile for other compilers.
-I wrote smakefiles for the directories I ported. I omitted the Windows
-and Widgets directories. The former is for MS Windows and the latter
-requires Motif, which is not easily available for the Amiga.
-
-Here are the changes I did per directory:
-
-* mesa
-Nov. 25, 1995 v 1.2.4
- - added a mklib.amiwin shell script that will make all the libraries and
- sample code for Mesa
- - created this readme file: readme.AMIGA
-
-* mesa/include
-Dec. 1, 1995 v 1.2.5
- - added the following to GL/xmesa.h
- #ifdef AMIWIN
- #include <pragmas/xlib_pragmas.h>
- extern struct Library *XLibBase;
- #endif
-NET CHANGE: xmesa.h
-
-* mesa/src
-Nov. 25, 1995 v 1.2.4
- - added the necessary pragma calls for X functions to the following:
- xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c
- This prevents undefined symbols errors during the linking phase for
- X library calls
- - created smakefile
-Dec. 1, 1995 v 1.2.5
- - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c,
- glx.c since they are now defined in include/GL/xmesa.h
-NET CHANGE: smakefile
-
-* mesa/src-tk
-Nov. 25, 1995 v 1.2.4
- - added the necessary pragma calls for X functions to the following:
- private.h
- - created smakefile
-Dec. 1, 1995 v 1.2.5
- - removed AMIWIN includes from private.h since it is now defined in
- include/GL/xmesa.h
-NET CHANGE: smakefile
-
-* mesa/src-glu
-Nov. 25, 1995 v 1.2.4
- - created smakefile
-NET CHANGE: smakefile
-
-* mesa/src-aux
-Nov. 25, 1995 v 1.2.4
- - added the necessary pragma calls for X functions to the following:
- glaux.c
- - created smakefile
-NET CHANGE: glaux.c, smakefile
-
-* mesa/demos
-Nov. 25, 1995 v 1.2.4
- - added the necessary pragma calls for X functions to the following:
- xdemo.c, glxdemo.c, offset.c
- - created smakefile
- - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since
- they are not part of AmigaDOS.
-Dec. 1, 1995 v 1.2.5
- - removed AMIWIN defines from xdemo.c, glxdemo.c, offset.c since
- already defined in include/GL/xmesa.h
- - modified Smakefile to include header and includes from the AmiTCP4.0
- net.lib linkable library to provide unix-compatible sys/time.h and
- the sleep() function
- - removed AMIWIN defines in xdemo.c since sleep() now defined
-NET CHANGE: smakefile
-
-* mesa/samples
-Nov. 25, 1995 v 1.2.4
- - added the necessary pragma calls for X functions to the following:
- oglinfo.c
- - created smakefile
- - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c
- - removed olympic from smakefile targets since <sys/time.h> not defined
-Dec. 1, 1995 v 1.2.5
- - removed AMIWIN defines from oglinfo.c, since already defined in
- include/GL/xmesa.h
- - modified Smakefile to include header and includes from the AmiTCP4.0
- net.lib linkable library to provide unix-compatible sys/time.h and
- the sleep() function
- - removed AMIWIN defines in blendxor.c for sleep()
- - added AMIWIN defines around _MACHTEN_ in olympic.c since xrandom()
- functions are not defined in any libraries
- - added olympic back into the Smakefile targets
-NET CHANGE: smakefile, olympic.c
-
-* mesa/book
-Nov. 25, 1995 v 1.2.4
-- created smakefile
-- removed accpersp and dof from smakefile targets since the SAS/C compile seems to
- confuse the near,far variables with near/far memory models.
-NET CHANGE: smakefile
-
-* mesa/windows
-Dec. 1, 1995 v 1.2.5
-- Removed directory to save space since this is only needed for Windows based
- machines.
diff --git a/nx-X11/extras/Mesa/docs/README.BEOS b/nx-X11/extras/Mesa/docs/README.BEOS
deleted file mode 100644
index 6e97d6317..000000000
--- a/nx-X11/extras/Mesa/docs/README.BEOS
+++ /dev/null
@@ -1,137 +0,0 @@
-
- Mesa / BeOS Information
-
-
-
-* Introduction
-
-Brian Paul added in Mesa 3.1 a driver for BeOS R4.5 operating system.
-This driver implements a clone of the BGLView class. This class,
-derived from BView, allows OpenGL rendering into any BeOS window. His
-driver was updated in Mesa 4.1 and again in version 6.1 by Philippe
-Houdoin, who's maintaining this driver since.
-
-Any application which uses the BGLView should be able to use Mesa
-instead of Be's OpenGL without changing any code.
-
-Since Be's OpenGL implementation (as of R5) is basically just the
-SGI sample implementation, it's pretty slow. You'll see that Mesa
-is considerably faster.
-
-
-* Source Code
-
-The source code for the driver is in src/mesa/drivers/beos/ directory.
-It's not 100% finished at this time but many GLUT-based demos are
-working. No optimizations have been made at this time.
-
-
-* Compiling
-
-Since Mesa 6.x, it can be build under BeOS with both the R5 builtin gcc version
-or more recent gcc versions available for BeOS, like this gcc version 2.95.3 for BeOS
-you can find at http://www.bebits.com/app/2157.
-Anyway, keep in mind that to take full advantage of Mesa x86 optimizations, you better
-want to use gcc 2.95.3 or sooner versions...
-
-To build Mesa-powered BeOS libGL.so version, open an Terminal window,
-move to Mesa root folder and type this command:
-
-$ make beos
-
-Note that the "beos" argument is only needed the first time to setup build config.
-Next times, typing "make" will be enough.
-
-When it finishes the Mesa based libGL.so library for
-BeOS will be in the lib/ directory, along libglut.so library.
-Several demo/test programs should have been build too under progs/* folders.
-If it stop when building one of the progs/* programs, you may want to ignore it
-and force make to move on next target by adding the -k make option:
-
-$ cd progs
-$ make -k
-
-To install it as Be's default libGL.so replacement, put it in your
-/boot/home/config/lib/ directory. All your GL/GLUT apps will use
-the Mesa based then.
-
-By default, it build a non-debug version library.
-The x86 (MMX, SSE and 3DNOW) optimizations are also supported for x86 target.
-For PowerPC BeOS flavor, sorry, Mesa don't have ppc (Altivec) optimizations
-yet.
-
-To build a DEBUG version, type instead this :
-
-$ DEBUG=1 make
-
-
-* Example Programs
-
-Look under progs/beos/ for some BGLView-based programs.
-You should find under progs/samples and progs/redbook directories GLUT-based programs too.
-They all should have been compiled along with the Mesa library.
-
-
-* GLUT
-
-A beta version of GLUT 3.7 port for BeOS, made by Jake Hamby, can be found at
-http://anobject.com/jehamby/Code/Glut-3.7-x86.zip.
-This is the version currently included in Mesa source code, and
-build in lib/libglut.so.
-
-A previous 3.5 version of this GLUT BeOS port used to be available at
-http://home.beoscentral.com/jehamby/Glut-3.5-x86.zip.
-
-They're special versions of GLUT for the BeOS platform. I don't
-believe Mark Kilgard's normal GLUT distribution includes BeOS
-support.
-
-
-* Special Features
-
-Mesa's implementation of the BGLView class has an extra member
-function: CopySubBufferMESA(). It basically works like SwapBuffers()
-but it only copies a sub region from the back buffer to the front
-buffer. This is a useful optimization for some applications.
-If you use this method in your code be sure that you check at runtime
-that you're actually using Mesa (with glGetString) so you don't
-cause a fatal error when running with Be's OpenGL.
-
-
-* Work Left To Do
-
-- BDirectWindow single buffering support is not implemented yet.
-- Color index mode is not implemented yet.
-- Reading pixels from the front buffer not implemented yet.
-- There is also a BGLScreen class in BeOS for full-screen OpenGL rendering.
- This should also be implemented for Mesa.
-- Multiple renderers add-ons support, first step toward hardware acceleration
- support.
-
-* Other contributors to this BeOS port
-
-Jake Hamby jhamby <at> anobject <dot> com
-Marcin Konicki ahwayakchih <at> neoni <dot> net
-Francois Revol revol <at> free <dot> fr
-Nathan Whitehorn nathanw <at> uchicago <dot> edu
-
-
-* Older BeOS Driver
-
-Mesa 2.6 had an earlier BeOS driver. It was based on Mesa's Off-screen
-rendering interface, not BGLView. If you're interested in the older
-driver you should get Mesa 2.6.
-
-
-* BeOS and Glide
-
-Mesa 3.0 supported the 3Dfx/Glide library on Beos. Download Mesa 3.0
-if interested. Ideally, the 3Dfx/Glide support should be updated to
-work with the new Mesa 3.1 BGLView implementation.
-
-The Glide library hasn't been updated for BeOS R4 and newer, to my knowledge,
-as of February, 1999.
-
-
-----------------------------------------------------------------------
-$Id: README.BEOS,v 1.1.1.6 2005/07/31 16:45:49 ajax Exp $
diff --git a/nx-X11/extras/Mesa/docs/README.CYGWIN b/nx-X11/extras/Mesa/docs/README.CYGWIN
deleted file mode 100644
index 58d5af3e2..000000000
--- a/nx-X11/extras/Mesa/docs/README.CYGWIN
+++ /dev/null
@@ -1,256 +0,0 @@
-
- Mesa Cygwin/X11 Information
-
-
-WARNING
-=======
-
-If you installed X11 (packages xorg-x11-devel and xorg-x11-bin-dlls ) with the
-latest setup.exe from Cygwin the GL (Mesa) libraries and include are already
-installed in /usr/X11R6.
-
-The following will explain how to "replace" them.
-
-Installation
-============
-
-How to compile Mesa on Cygwin/X11 systems:
-
-1. Shared libs:
- type 'make cygwin-sl'.
-
- When finished, the Mesa DLL will be in the Mesa-x.y/lib/ and
- Mesa-x.y/bin directories.
-
-
-2. Static libs:
- type 'make cygwin-static'.
- When finished, the Mesa libraries will be in the Mesa-x.y/lib/ directory.
-
-Header and library files:
- After you've compiled Mesa and tried the demos I recommend the following
- procedure for "installing" Mesa.
-
- Copy the Mesa include/GL directory to /usr/X11R6/include:
- cp -a include/GL /usr/X11R6/include
-
- Copy the Mesa library files to /usr/X11R6/lib:
- cp -a lib/* /usr/X11R6ocal/lib
-
- Copy the Mesa bin files (used by the DLL stuff) to /usr/X11R6/bin:
- cp -a lib/cyg* /usr/X11R6/bin
-
-Xt/Motif widgets:
- If you want to use Mesa or OpenGL in your Xt/Motif program you can build
- the widgets found in either the widgets-mesa or widgets-sgi directories.
- The former were written for Mesa and the later are the original SGI
- widgets. Look in those directories for more information.
- For the Motif widgets you must have downloaded the lesstif package.
-
-
-Using the library
-=================
-
-Configuration options:
- The file src/mesa/main/config.h has many parameters which you can adjust
- such as maximum number of lights, clipping planes, maximum texture size,
- etc. In particular, you may want to change DEPTH_BITS from 16 to 32
- if a 16-bit depth buffer isn't precise enough for your application.
-
-
-Shared libraries:
- If you compile shared libraries (Win32 DLLS) you may have to set an
- environment variable to specify where the Mesa libraries are located.
- Set the PATH variable to include /your-dir/Mesa-2.6/bin.
- Otherwise, when you try to run a demo it may fail with a message saying
- that one or more DLL couldn't be found.
-
-
-Xt/Motif Widgets:
- Two versions of the Xt/Motif OpenGL drawing area widgets are included:
-
- widgets-sgi/ SGI's stock widgets
- widgets-mesa/ Mesa-tuned widgets
-
- Look in those directories for details
-
-
-Togl:
- Togl is an OpenGL/Mesa widget for Tcl/Tk.
- See http://togl.sourceforge.net for more information.
-
-
-
-X Display Modes:
- Mesa supports RGB(A) rendering into almost any X visual type and depth.
-
- The glXChooseVisual function tries its best to pick an appropriate visual
- for the given attribute list. However, if this doesn't suit your needs
- you can force Mesa to use any X visual you want (any supported by your
- X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL
- environment variables. When an RGB visual is requested, glXChooseVisual
- will first look if the MESA_RGB_VISUAL variable is defined. If so, it
- will try to use the specified visual. Similarly, when a color index
- visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL
- variable.
-
- The format of accepted values is: <visual-class> <depth>
- Here are some examples:
-
- using the C-shell:
- % setenv MESA_RGB_VISUAL "TrueColor 8" // 8-bit TrueColor
- % setenv MESA_CI_VISUAL "PseudoColor 12" // 12-bit PseudoColor
- % setenv MESA_RGB_VISUAL "PseudoColor 8" // 8-bit PseudoColor
-
- using the KornShell:
- $ export MESA_RGB_VISUAL="TrueColor 8"
- $ export MESA_CI_VISUAL="PseudoColor 12"
- $ export MESA_RGB_VISUAL="PseudoColor 8"
-
-
-Double buffering:
- Mesa can use either an X Pixmap or XImage as the backbuffer when in
- double buffer mode. Using GLX, the default is to use an XImage. The
- MESA_BACK_BUFFER environment variable can override this. The valid
- values for MESA_BACK_BUFFER are: Pixmap and XImage (only the first
- letter is checked, case doesn't matter).
-
- A pixmap is faster when drawing simple lines and polygons while an
- XImage is faster when Mesa has to do pixel-by-pixel rendering. If you
- need depth buffering the XImage will almost surely be faster. Exper-
- iment with the MESA_BACK_BUFFER variable to see which is faster for
- your application.
-
-
-Colormaps:
- When using Mesa directly or with GLX, it's up to the application writer
- to create a window with an appropriate colormap. The aux, tk, and GLUT
- toolkits try to minimize colormap "flashing" by sharing colormaps when
- possible. Specifically, if the visual and depth of the window matches
- that of the root window, the root window's colormap will be shared by
- the Mesa window. Otherwise, a new, private colormap will be allocated.
-
- When sharing the root colormap, Mesa may be unable to allocate the colors
- it needs, resulting in poor color quality. This can happen when a
- large number of colorcells in the root colormap are already allocated.
- To prevent colormap sharing in aux, tk and GLUT, define the environment
- variable MESA_PRIVATE_CMAP. The value isn't significant.
-
-
-Gamma correction:
- To compensate for the nonlinear relationship between pixel values
- and displayed intensities, there is a gamma correction feature in
- Mesa. Some systems, such as Silicon Graphics, support gamma
- correction in hardware (man gamma) so you won't need to use Mesa's
- gamma facility. Other systems, however, may need gamma adjustment
- to produce images which look correct. If in the past you thought
- Mesa's images were too dim, read on.
-
- Gamma correction is controlled with the MESA_GAMMA environment
- variable. Its value is of the form "Gr Gg Gb" or just "G" where
- Gr is the red gamma value, Gg is the green gamma value, Gb is the
- blue gamma value and G is one gamma value to use for all three
- channels. Each value is a positive real number typically in the
- range 1.0 to 2.5. The defaults are all 1.0, effectively disabling
- gamma correction. Examples using csh:
-
- % setenv MESA_GAMMA "2.3 2.2 2.4" // separate R,G,B values
- % setenv MESA_GAMMA "2.0" // same gamma for R,G,B
-
- The demos/gamma.c program may help you to determine reasonable gamma
- value for your display. With correct gamma values, the color intensities
- displayed in the top row (drawn by dithering) should nearly match those
- in the bottom row (drawn as grays).
-
- Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well
- on HP displays using the HP-ColorRecovery technology.
-
- Mesa implements gamma correction with a lookup table which translates
- a "linear" pixel value to a gamma-corrected pixel value. There is a
- small performance penalty. Gamma correction only works in RGB mode.
- Also be aware that pixel values read back from the frame buffer will
- not be "un-corrected" so glReadPixels may not return the same data
- drawn with glDrawPixels.
-
- For more information about gamma correction see:
- http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html
-
-
-Overlay Planes
-
- Overlay planes in the frame buffer are supported by Mesa but require
- hardware and X server support. To determine if your X server has
- overlay support you can test for the SERVER_OVERLAY_VISUALS property:
-
- xprop -root | grep SERVER_OVERLAY_VISUALS
-
-
-HPCR glClear(GL_COLOR_BUFFER_BIT) dithering
-
- If you set the MESA_HPCR_CLEAR environment variable then dithering
- will be used when clearing the color buffer. This is only applicable
- to HP systems with the HPCR (Color Recovery) system.
-
-
-Extensions
-==========
- There are three Mesa-specific GLX extensions at this time.
-
- GLX_MESA_pixmap_colormap
-
- This extension adds the GLX function:
-
- GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap, Colormap cmap )
-
- It is an alternative to the standard glXCreateGLXPixmap() function.
- Since Mesa supports RGB rendering into any X visual, not just True-
- Color or DirectColor, Mesa needs colormap information to convert RGB
- values into pixel values. An X window carries this information but a
- pixmap does not. This function associates a colormap to a GLX pixmap.
- See the xdemos/glxpixmap.c file for an example of how to use this
- extension.
-
- GLX_MESA_release_buffers
-
- Mesa associates a set of ancillary (depth, accumulation, stencil and
- alpha) buffers with each X window it draws into. These ancillary
- buffers are allocated for each X window the first time the X window
- is passed to glXMakeCurrent(). Mesa, however, can't detect when an
- X window has been destroyed in order to free the ancillary buffers.
-
- The best it can do is to check for recently destroyed windows whenever
- the client calls the glXCreateContext() or glXDestroyContext()
- functions. This may not be sufficient in all situations though.
-
- The GLX_MESA_release_buffers extension allows a client to explicitly
- deallocate the ancillary buffers by calling glxReleaseBuffersMESA()
- just before an X window is destroyed. For example:
-
- #ifdef GLX_MESA_release_buffers
- glXReleaseBuffersMESA( dpy, window );
- #endif
- XDestroyWindow( dpy, window );
-
- This extension is new in Mesa 2.0.
-
- GLX_MESA_copy_sub_buffer
-
- This extension adds the glXCopySubBufferMESA() function. It works
- like glXSwapBuffers() but only copies a sub-region of the window
- instead of the whole window.
-
- This extension is new in Mesa version 2.6
-
-
-
-Summary of X-related environment variables:
- MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
- MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
- MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
- MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
- MESA_GAMMA - gamma correction coefficients (X only)
-
-
-----------------------------------------------------------------------
-README.CYGWIN - lassauge April 2004 - based on README.X11
diff --git a/nx-X11/extras/Mesa/docs/README.D3D b/nx-X11/extras/Mesa/docs/README.D3D
deleted file mode 100644
index b41fcb620..000000000
--- a/nx-X11/extras/Mesa/docs/README.D3D
+++ /dev/null
@@ -1,124 +0,0 @@
-
- DirectX 6 Driver for Mesa 3.0
-
-
-This software is distributed under the terms of the GNU Library
-General Public License, see the LICENSE file for details.
-
-
-
-What do you need ?
-------------------
-
- - A PC with a DirectX 6 video driver installed.
-
- - Mesa 3.0
-
- - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine).
- The Voodoo2 requires the Glide library 2.51. The Glide 3.0 is not
- compatible with the Glide 2.x so it doesn't work with the current
- version of the driver;
-
- - Visual C++ 5.0 is only compiler test but others should be ok with
- changes to the makefiles (CFLAGS/LFLAGS).
-
- - DirectX 6 SDK (was a MS download but not sure if still available).
-
- - SoftIce or another debugger that will get DPF's is nice.
-
-
-Tested on:
-----------
- Windows 95
- Windows 98
- Windows NT 5.0 (beta 2)
-
-
-What is able to do ?
---------------------
-
- - the driver will try and use DirectX to rasterize the OpenGL primitives
- that are sent to the driver. The driver will fall back to SW if the rendering
- context is too big. The fallback to SW still uses DirectDraw. If the driver
- fails to support and operation (accum, stencil, etc) then it will try and get
- Mesa to render it in SW. DirectX 6 features that are unsupported by the
- installed DirectX 6 driver will be mapped to some other best fit feature.
-
-
-How to compile:
----------------
-
- These instructions assume you have Visual C++ installed.
-
- You might need to increase you enviroment space. You can do this by
- adding the following statement to you config.sys.
-
- shell=C:\COMMAND.COM C:\ /p /e:8198
-
- Next setup you compiler enviroment by running vcvars32.bat in the Visual C++
- 'bin' directoy.
-
- c:\DevStudio\VC\bin\vcvars32.bat
-
- Modify the D3D makefile to point at your SDK install. Example has the SDK
- installed on my 'f' drive in the root.
-
- file: \Mesa-3.0\src\makefile.d3d
-
- SDKROOT=f:\mssdk
-
- Now you can simply make the project. If you look in the makefile you can see
- I have some different targets like 'install'.
-
- nmake /f makefile.d3d
-
-
-FAQ:
-----
-
- 1) I don't think the driver is using my DirectX driver.
-
- This maybe true as the current version will only select the Primary D3D driver
- installed. If you 3D card is the secondary (3dfx) then your out of luck for this
- release.
-
- 2) The driver seems like its not HW accelerated.
-
- If you have a video card with limited memory then you might want to try and
- change your destop resolution to a low setting (640x480x16) so that the 3D part
- of the card has more resources. Remeber the driver can't make the card better...
-
- 3) Nothing works.
-
- Make sure you have a DirectX '6' driver installed. Check you driver docs for this
- info or use the SDK info utilities.
- The final 'dll' is named opengl32.dll and is either in the same directory as the
- OpenGL program or in your system directory (x:\windows\system or x:\winnt\system32).
- Check your destop resolution. Most DirectX 6 drivers will only support 16bit and
- 32bit color depth. To find out for sure you can check the DirectX Info Viewer in
- the SDK.
-
-
- 4) Rendering doesn't look right.
-
- Sometimes this is because the card doesn't support a feature that that is required.
- This is usually due to unsupported alpha functions (test/blend) or texture mapping.
- Some cards suffer from too small of an alpha channel. The driver does its best to
- fallback on unsupported features. This is not to say the driver may not have a bug(s).
-
- 5) Textures look bad.
-
- No mipmapping in this release.
-
-
-Thanks to:
-----------
-
-Brian Paul
-
-
-
-
-Leigh McRae (leigh@altsoftware.com)
-February 9, 1999
-
diff --git a/nx-X11/extras/Mesa/docs/README.DJ b/nx-X11/extras/Mesa/docs/README.DJ
deleted file mode 100644
index 7180223c2..000000000
--- a/nx-X11/extras/Mesa/docs/README.DJ
+++ /dev/null
@@ -1,275 +0,0 @@
- Mesa 6.3 DOS/DJGPP Port v1.7
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-
-Description:
-~~~~~~~~~~~~
-
-Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa!
-The driver has its origins in ddsample.c, written by Brian Paul and found by me
-in Mesa 3.4.2.
-
-
-
-Legal:
-~~~~~~
-
-Mesa copyright applies, provided this package is used within Mesa. For anything
-else, see GPL.
-
-
-
-Installation:
-~~~~~~~~~~~~~
-
-Unzip and type:
-
- make -f Makefile.DJ [OPTIONS...]
-
-Available options:
-
- Environment variables:
- CPU optimize for the given processor.
- default = pentium
- GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
- or `mesa'.
- default = mesa
- GLIDE path to Glide3 SDK; used with FX.
- default = $(TOP)/glide3
- FX=1 build for 3dfx Glide3. Note that this disables
- compilation of most DMesa code and requires fxMesa.
- As a consequence, you'll need the DJGPP Glide3
- library to build any application.
- default = no
- X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
- default = no
-
- Targets:
- all: build everything
- libgl: build GL
- libglu: build GLU
- libglut: build GLUT
- clean: remove object files
- realclean: remove all generated files
-
-
-
-Tested on:
- CPU: AMD Athlon XP 1800+
- Mainboard: GA-7VTXE w/ 512 MB DDRAM
- Video card: Voodoo5 6000 AGP w/ 128 MB SDRAM
- DJGPP: djdev 2.04 + gcc v3.4.3 + make v3.80
- OS: DOS and Win98SE
-
-
-
-FAQ:
-~~~~
-
-1. Compilation
-
- Q) `make' barfs and exits because it cannot find some stupid file.
- A) You need LFN support.
- A) When compiling for Glide (FX=1), pay attention to Glide path.
-
- Q) Libraries built OK, but linker complains about `vsnprintf' every time I
- compile some demo.
- A) Upgrade to DJGPP 2.04.
- A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!).
- A) Patch `src/mesa/main/imports.c' with the following line:
- #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg)
- This hack should be safe in 90% of the cases, but if anything goes wrong,
- don't come back to me crying.
-
- Q) `make' complains about DXE3 or something, yet it builds the libraries.
- A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest
- DJGPP distro, or download the separate package from my web page. Read the
- DXE3 documentation on how to use them.
- A) When compiling for Glide (FX=1), make sure `glide3x.dxe' can be found in
- LD_LIBRARY_PATH (or top `lib' directory).
-
-2. Using Mesa for DJGPP
-
- Q) Every test I tried crashes badly.
- A) If you have compiled with SSE and you're running under plain DOS, you
- have to disable SSE at run-time. See environment variables below.
-
- Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
- A) Is that a question? If you have a 3dfx Voodoo (any model), you're
- lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
- If you haven't, sorry; everything is done in software. Suggestions?
-
- Q) I tried to set refresh rate w/ DMesa, but without success.
- A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in
- which case FX_GLIDE_REFRESH will be overwritten if it is defined and
- is not 0).
-
- Q) I made a simple application and it does nothing. It exits right away. Not
- even a blank screen.
- A) Pure software drivers (VESA/VGA/NUL) support only double-buffered modes.
- A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
- lazy programmer and I found that the easiest way to keep buffer handling
- at peak performance ;-).
-
- Q) I'm getting a "bad font!" fatal error.
- A) Always use GLUT_STROKE_* and GLUT_BITMAP_* constants when dealing with
- GLUT fonts. If you're using `glut.dxe', then make sure GLUT_STROKE_* and
- GLUT_BITMAP_* are mapped to integer constants, not to the actual font
- address (same mechanism used for Win32 _DLL).
-
- Q) What is NUL driver good for, if I don't get any output at all?
- A) For debugging. The NUL driver is very much like OSMesa. Everything is
- done just the same as VESA/VGA drivers, only it doesn't touch your video
- hardware. You can query the actual buffer by issuing:
- DMesaGetIntegerv(DMESA_GET_BUFFER_ADDR, &buffer);
- and dump it to a file.
-
- Q) How do I query for a list of available video modes to choose as a visual?
- A) This is an ugly hack, for which I'm sure I'll burn in hell.
- First, query for a list of modes:
- n = DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, NULL);
- If `n' is strictly positive, you allocate an array of pointers to a given
- struct (which is guaranteed to be extended only - not changed in future):
- struct {
- int xres, yres;
- int bpp;
- } **l = malloc(n * sizeof(void *));
- Now pass the newly allocated buffer to fill in:
- DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l);
- And collect the info:
- for (i = 0; i < n; i++) {
- printf("%dx%d:%d\n", l[i]->xres, l[i]->yres, l[i]->bpp);
- }
-
- Q) The GLUT is incomplete.
- A) See below.
-
-
-
-libGLUT (the toolkit):
-~~~~~~~~~~~~~~~~~~~~~~
-
-Well, this "skeletal" GLUT implementation was taken from AllegGL project and
-heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian
-Paul and probably others (or probably not ;-). GLUT functionality will be
-extended only on an "as needed" basis.
-
-GLUT talks to hardware via PC_HW package which was put together from various
-pieces I wrote long time ago. It consists from the keyboard, mouse and timer
-drivers.
-
-My keyboard driver used only scancodes; as GLUT requires ASCII values for keys,
-I borrowed the translation tables (and maybe more) from Allegro -- many thanks
-to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users)
-will shut down the GLUT engine unconditionally: it will raise SIGINT, which in
-turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-)
-NB: since the DJGPP guys ensured signal handlers won't go beyond program's
-space (and since dynamic modules shall) the SIGINT can't be hooked (well, it
-can, but it is useless), therefore you must live with the 'Exiting due to
-signal SIGINT' message...
-
-The mouse driver is far from complete (lack of drawing, etc), but is enough to
-make almost all the demos work. Supports the CuteMouse WheelAPI.
-
-The timer is pretty versatile for it supports multiple timers with different
-frequencies. While not being the most accurate timer in the known universe, I
-think it's OK. Take this example: you have timer A with a very high rate, and
-then you have timer B with very low rate compared to A; now, A ticks OK, but
-timer B will probably loose precision!
-
-As an addition, stdout and stderr are redirected and dumped upon exit. This
-means that `printf' can be safely called during graphics. A bit of a hack, I
-know, because all messages come in bulk, but I think it's better than nothing.
-"Borrowed" from LIBRHUTI (Robert Hoehne).
-
-Window creating defaults: (0, 0, 300, 300), 16bpp. However, the video mode is
-chosen in such a way that first window will fit. If you need high resolution
-with small windows, set initial position far to the right (or way down); then
-you can move them back to any position right before the main loop.
-
-
-
-Environment variables:
-~~~~~~~~~~~~~~~~~~~~~~
- DMESA_NULDRV - (any value) force NUL driver
- GLUT_FPS - print frames/second statistics to stderr
- MESA_NO_SSE - (any value) safe option under pure DOS
- DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
- DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
- DMESA_GLUT_ALPHA - set default alpha bits (8)
- DMESA_GLUT_DEPTH - set default depth bits (16)
- DMESA_GLUT_STENCIL - set default stencil bits (8)
- DMESA_GLUT_ACCUM - set default accum bits (16)
-
-
-
-History:
-~~~~~~~~
-
-v1.0 (mar-2002)
- initial release
-
-v1.1 (sep-2002)
- + added 3dfx Glide3 support
- + added refresh rate control
- + added fonts in GLUT
- * lots of minor changes
-
-v1.2 (nov-2002)
- * synced w/ Mesa-4.1
- - removed dmesadxe.h
-
-v1.3 (mar-2003)
- + enabled OpenGL 1.4 support
- + added MMX clear/blit routines
- + enabled SGI's GLU compilation
- + added samples makefile
- + added new GLUT functions
- + added color-index modes
- + added Matrox Millennium MGA2064W driver
- + added 8bit FakeColor (thanks to Neil Funk)
- + added VGA support (to keep Ben Decker happy)
- ! fixed some compilation errors (reported by Chan Kar Heng)
- * optimized driver for faster callback access... yeah, right :)
- * overhauled virtual buffer and internal video drivers
- * better fxMesa integration
- * revamped GLUT
- * switched to DXE3
-
-v1.4 (dec-2003)
- + enabled GLUT fonts with DXE
- + truly added multi-window support in GLUT (for Adrian Woodward)
- * accomodated makefiles with the new sourcetree
- * fixed some ALPHA issues
- * minor changes to PC_HW/timer interface
- x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
-
-v1.5 (jan-2004)
- + added interface to query available "visuals" (GLFW - Marcus Geelnard)
- + added GLUT timer callback
- - removed Matrox Millennium MGA2064W driver
- x more changes to the 3dfx driver
-
-v1.6 (aug-2004)
- + implemented NUL driver
- + added DMesaGetProcAddress and glutGetProcAddress
- * reorganized fxMesa wrapper to handle multiple contexts
- ! fixed a horrible bug in VGA initialization routine
- ! fixed partial clears
-
-v1.7 (???-2005)
- + enabled OpenGL 2.0 support
- + added support for sw texture compression
- + added FreeGLUT specific functions
- * no more GLX sources in DOS GLUT
- * made GLUT timer callbacks less accurate but safer
-
-
-
-Contact:
-~~~~~~~~
-
-Name: Daniel Borca
-E-mail: dborca@users.sourceforge.net
-WWW: http://www.geocities.com/dborca/
diff --git a/nx-X11/extras/Mesa/docs/README.GGI b/nx-X11/extras/Mesa/docs/README.GGI
deleted file mode 100644
index ddb67725f..000000000
--- a/nx-X11/extras/Mesa/docs/README.GGI
+++ /dev/null
@@ -1,26 +0,0 @@
-GGIMesa for LibGGI 2.x
-
-Requirements:
--------------
-LibGGI 2.0 or greater
-
-Installation:
--------------
-To install GGIMesa, follow the instructions in INSTALL.GNU. If you
-wish to install GGIGLUT as well, first install GGIMesa and then run
-
-make
-make install (must be root)
-
-in ggi/ggiglut.
-
-Notes:
-------
-
-* Set the environment variables GGIMESA_DEBUG and/or GGIGLUT_DEBUG
-to 255 to see lots of debugging output.
-
-* GGIGLUT contains support for all of the GLUT 3.6 API except for the
-high-level primitive drawing functions, but many of the functions (in
-particular the menu drawing functions) are just stubs.
-
diff --git a/nx-X11/extras/Mesa/docs/README.LYNXOS b/nx-X11/extras/Mesa/docs/README.LYNXOS
deleted file mode 100644
index e3ab9804b..000000000
--- a/nx-X11/extras/Mesa/docs/README.LYNXOS
+++ /dev/null
@@ -1,64 +0,0 @@
-
-Mesa 3.0 for LynxOS builds in the following way:
-
-make lynxos
-
-This will build all the libraries and demo applications. You should have
-around 400 megabytes free for everything since everything is done with
-static
-libraries.
-
-Before using this make file however, you should perform the following
-actions:
-0) cd to the Mesa-3.0 directory
-1) Copy the GL directory under the include directory to /usr/include.
-2) Copy the files in the lib directory to /lib.
-3) Make links so that the Mesa libraries look like ordinary OpenGL
-libraries
-in /lib. This is important for compatibility with other OpenGL apps. This
-is done as follows:
-
-cd /lib
-ln -s libMesaGL.a libGL.a
-ln -s libMesaGLU.a libGLU.a
-
-Mesa 3.0 includes the GLUT (GL Utility Toolkit) by default.
-The demo applications are done using this toolkit.
-
-Mesa makefiles for building their apps could be used as well, but the
-following one is much more concise. Note that the order of the X libraries
-is important to the linker so that all symbols get resolved correctly.
-Changing the order may result in having to list a library twice to make
-sure all linkages are made correctly.
-
-----cut here for Makefile -----
-
-FILES = your_app.x
-
-SPECIAL_INCLUDES = -I/usr/include/GL
-
-SPECIAL_CFLAGS = -g -ansi -pedantic -funroll-loops -ffast-math -DSHM
-
-SPECIAL_LIBS = -lglut -lGLU -lGL -lm -L/usr/X11/lib -lXext -lXmu -lXi \
--lX11 -lbsd -g
-
-STANDARD_OFILES = $(FILES:.x=.o)
-
-%.o: %.c
- gcc -c $(SPECIAL_CFLAGS) $(SPECIAL_INCLUDES) $< -o $@
-
-all: $(STANDARD_OFILES)
- gcc -o your_app $(STANDARD_OFILES) $(SPECIAL_LIBS)
-
-
-----cut here for Makefile-----
-
-I have tested Mesa under LynxOS 3.0 and 3.01. It should build fine under
-other
-versions as well. Note, however, that LynxOS versions prior to 3.0 are not
-binary compatible, so you will have to rebuild from source.
-
-
-Vik Sohal
-vik@lynx.com
-January 13, 1999
diff --git a/nx-X11/extras/Mesa/docs/README.MINGW32 b/nx-X11/extras/Mesa/docs/README.MINGW32
deleted file mode 100644
index 2b39f1209..000000000
--- a/nx-X11/extras/Mesa/docs/README.MINGW32
+++ /dev/null
@@ -1,90 +0,0 @@
- Mesa 6.1 for MinGW32
- ~~~~~~~~~~~~~~~~~~~~
-
-
-
-Quick & dirty start:
---------------------
-
- mingw32-make -f Makefile.mgw [OPTIONS...]
-
- Look into the corresponding makefiles for further information.
- Check README.3DFX to find out how to compile Mesa Glide3 driver
- with MinGW32!
-
-
-
-*******************************************************************************
-The Mingw port for Mesa 3-D Graphics Library was created August 30, 1998 by Paul Garceau.
-
-Updated January 13, 2000; June 3, 2005 -- Paul Garceau <pgarceau@users.sourceforge.net>
-
-DISCLAIMER: I make this port of the Mesa 3-D Graphics Library as a service
-to the general public. I can, in no way support or make any guarantee that the
-build will work for your system.
-
-Acknowledgements:
-
- Daniel Borca, whose work and commitment to maintaining the Mingw port of the Mesa 3-D Graphics Library has been, and will continue to be greatly appreciated by an overworked and underpaid developer such as myself.
- Without the creative inspiration and personal commitment provided by Mumit Khan, Jan-Jaap Vanderhagen and Colin Peters, Mingw would never have existed. Acknowledgements also need to be given to all of the developers who have worked on Mingw, Mesa and Msys over the years.
- Last, but certainly far from the least, Brian Paul, who has dedicated at least the last seven or eight years of his life to making Mesa 3-D Graphics Library what it is today and managing the development for all of those years.
-*********************************************************************************
-
-Greetings,
-
- Feel free to modify or change things related to the Mingw build as you see fit, just remember that, the author of the current build may not be able to support any modifications you might want to make to the files which have been included for the build.
-
-Mesa core components are licensed under XFree-86 (for more on licensing of Mesa 3-D Graphics Library, check out the Mesa homepage (http://www.mesa3d.org).
-
-The Mingw generated libraries themselves are licensed under the GNU-LGPL license. Source code for Mingw can be found at http://www.mingw.org. For licensing terms on Mingw, please visit http://www.mingw.org.
-
- It is recommended that you use the latest "stable" release of Mingw. "Candidates" are beta testing distributions for Mingw. Mingw is available at http://www.mingw.org.
-
- This build has been tested under WinNT4/SP6. Win9x and WinNT5 remain untested by me. I have not tested any of the demos included with Mesa3d.
-
-Installation:
-
- This readme assumes that you already have extracted the necessary files to a working directory/folder that Mingw can use to build the Mesa3D libraries and that you know where that directory/folder is located on your Windows system. If you have any questions about how to set things up properly which is specific to Mesa3D, the folks on the Mesa3D mailing lists (http://www.mesa3d.org) would probably be happy to assist you. Also you can probably ask anyone on the Mingw mailing lists for any questions specific to Mingw (http://www.mingw.org)
-
-Targets and Environment variables used for Mingw build:
-
- Before going into the actual build of the libraries, here is a list of available targets for the make process:
-
- "all" or "libgl" -- this target will build libopengl.a, a static library. It will not build the demos, etc.
-
- clean -- this target will clean up most of the Mesa 3-D Graphics Library/object code from your hard drive.
-
- realclean -- this target will clean up all of the Mesa 3D Graphics Library and the Mesa object code that it can find.
-
- Environment Variables:
-
- The environment variables are used to determine what sort of graphics driver support needs to be included in the finished Mesa 3-D Graphics Library.
-
- GLIDE path to Glide3 SDK; used with FX.
- default = $(TOP)/glide3
- FX=1 build for 3dfx Glide3. Note that this disables
- compilation of most WMesa code and requires fxMesa.
- As a consequence, you'll need the Win32 Glide3
- library to build any application.
- default = no
- ICD=1 build the installable client driver interface
- (windows opengl driver interface)
- default = no
- X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
- default = no
-
-
-Running the Build:
-
- Launch Mingw.
- From the Windows Command Prompt:
- Set Environment Variables (as needed).
- "cd" to your Mesa3D 'root' directory.
- Enter "mingw32-make -f makefile.mgw <target>
-
- That's all there is to it.
-
- Enjoy!
-
- Paul G. <pgarceau@users.sourceforge.net>
- Daniel Borca <dborca@users.sourceforge.net>
diff --git a/nx-X11/extras/Mesa/docs/README.MITS b/nx-X11/extras/Mesa/docs/README.MITS
deleted file mode 100644
index a89176a62..000000000
--- a/nx-X11/extras/Mesa/docs/README.MITS
+++ /dev/null
@@ -1,102 +0,0 @@
-
- Mesa 3.0 MITS Information
-
-
-This software is distributed under the terms of the GNU Library
-General Public License, see the LICENSE file for details.
-
-
-This document is a preliminary introduction to help you get
-started. For more detaile information consult the web page.
-
-http://10-dencies.zkm.de/~mesa/
-
-
-
-Version 0.1 (Yes it's very alpha code so be warned!)
-Contributors:
- Emil Briggs (briggs@bucky.physics.ncsu.edu)
- David Bucciarelli (tech.hmw@plus.it)
- Andreas Schiffler (schiffler@zkm.de)
-
-
-
-1. Requirements:
- Mesa 3.0.
- An SMP capable machine running Linux 2.x
- libpthread installed on your machine.
-
-
-2. What does MITS stand for?
- MITS stands for Mesa Internal Threading System. By adding
- internal threading to Mesa it should be possible to improve
- performance of OpenGL applications on SMP machines.
-
-
-3. Do applications have to be recoded to take advantage of MITS?
- No. The threading is internal to Mesa and transparent to
- applications.
-
-
-4. Will all applications benefit from the current implementation of MITS?
- No. This implementation splits the processing of the vertex buffer
- over two threads. There is a certain amount of overhead involved
- with the thread synchronization and if there is not enough work
- to be done the extra overhead outweighs any speedup from using
- dual processors. You will not for example see any speedup when
- running Quake because it uses GL_POLYGON and there is only one
- polygon for each vertex buffer processed. Test results on a
- dual 200 Mhz. Pentium Pro system show that one needs around
- 100-200 vertices in the vertex buffer before any there is any
- appreciable benefit from the threading.
-
-
-5. Are there any parameters that I can tune to try to improve performance.
- Yes. You can try to vary the size of the vertex buffer which is
- define in VB_MAX located in the file src/vb.h from your top level
- Mesa distribution. The number needs to be a multiple of 12 and
- the optimum value will probably depend on the capabilities of
- your machine and the particular application you are running.
-
-
-6. Are there any ways I can modify the application to improve its
- performance with the MITS?
- Yes. Try to use as many vertices between each Begin/End pair
- as possbile. This will reduce the thread synchronization
- overhead.
-
-
-7. What sort of speedups can I expect?
- On some benchmarks performance gains of up to 30% have been
- observerd. Others may see no gain at all and in a few rare
- cases even some degradation.
-
-
-8. What still needs to be done?
- Lots of testing and benchmarking.
- A portable implementation that works within the Mesa thread API.
- Threading of additional areas of Mesa to improve performance
- even more.
-
-
-
-Installation:
-
- 1. This assumes that you already have a working Mesa 3.0 installation
- from source.
- 2. Place the tarball MITS.tar.gz in your top level Mesa directory.
- 3. Unzip it and untar it. It will replace the following files in
- your Mesa source tree so back them up if you want to save them.
-
-
- README.MITS
- Make-config
- Makefile
- mklib.glide
- src/vbxform.c
- src/vb.h
-
- 4. Rebuild Mesa using the command
-
- make linux-386-glide-mits
-
diff --git a/nx-X11/extras/Mesa/docs/README.NeXT b/nx-X11/extras/Mesa/docs/README.NeXT
deleted file mode 100644
index 1ad9a9e5c..000000000
--- a/nx-X11/extras/Mesa/docs/README.NeXT
+++ /dev/null
@@ -1,6 +0,0 @@
-The NeXT support has now been incorporated into the OpenStep support.
-You can build NeXT libraries simply by typing "make next", though before
-linking they will need to be ranlib'd by hand. For more information see
-the README.OpenStep file, together with the README files in OpenStep/Old_Demos.
-
--Pete French. (pete@ohm.york.ac.uk) 28/5/1998
diff --git a/nx-X11/extras/Mesa/docs/README.OS2 b/nx-X11/extras/Mesa/docs/README.OS2
deleted file mode 100644
index b3374ea23..000000000
--- a/nx-X11/extras/Mesa/docs/README.OS2
+++ /dev/null
@@ -1,96 +0,0 @@
- README for port of Mesa 3.x to XFree86 on OS/2 (X/2)
- (as of 19990514)
-
-
- Contents:
-
- 1) Binary release
- 2) Building from sources
- 3) History
- 4) Todo
- 5) Mesa Home Page
-
-
-1) Binary release
-
- Though the Mesa sources should build in a quite reasonable time even on
- a 585 class machine a binary relase is available (check topic 4) for an URL)
- This package includes:
-
- - lib/MesaGL.dll, MesaGL.a
- - lib/MesaGLU.dll, MesaGLU.a
- - lib/glut.dll, glut.a
- - include/GL/*.h
-
- Installing this in your XFree86 tree will enable you to build and
- run all applications compatible with Mesa (and the current DLL
- interface, of course ;-)
- As usual the OMF-style libraries can be created using emxomf.
- (e.g. "emxomf foo.a" creates the foo.lib omf-style library).
- The static libraries are rarely used and you have to rebuild
- Mesa to get them. They're a supported target, so you get
- them in a straightforward way (see below).
-
- The testing of these libraries was limited to the supplied
- demos/examples and a quite small number of third-party apps.
- No warranty ... as usual ... ;-)
-
-
-2) Instructions to build Mesa 3.x for XFree86/OS2 from sources:
-
- Except the official Mesa source distribution you need:
- - a recent version of XFree86 (3.3.x or above) including
- the programming libraries
- - EMX 0.9c (0.9d might work, never checked)
- - GNU make
- - REXX (!)
-
- The creation of the DLLs as well as of the static libraries
- (if you want to have them) is handled in "mklib-emx.cmd",
- a small REXX script. Perhaps not the best idea, but this
- way it fits best in the scheme used to build libraries
- on all platforms in Mesa 3.x.
-
- To actually build the libraries and demos, check mklib-emx.cmd
- and modify it as desired. Then type
- make os2-x11
- and wait for completion ;-)
-
-
-3) History
-
- Initially Darren Abbott (abbott@hiwaay.net) ported Mesa versions 2.x
- to XFree86 OS/2. This port might still be available from
- http://fly.HiWAAY.net/~abbott/xfree86-os2/xfree86.html
-
- The current port picked up things during the beta test for 3.0.
- No major changes in the source were done. The build mechanism under OS/2
- has been made very similar to other platforms (if you treat mklib-emx.cmd
- as a "black box").
- Advantage is that X/2 is now a valid target and all files are
- integrated in the official source distribution.
- Disadvantage is that this port (i.e. the DLLs' interface itself) is
- definitly NOT COMPATIBLE to those of version 2.x.
- It's uncertain whether this would be at all possible but since there
- a _very_ few those apps it's not worth to find out anyway.
- Also some libs (MesaTK, MesaAUX) are withdrawn from the Mesa distribution,
- and accordingly from the OS/2 port.
-
-4) Todo
-
- By now binary compatiblity is ensured by using the function names
- as entry points instead of ordinals. This might cost performance and
- is subject to change in future. In addition the supplied X86 assembler
- source is not used yet.
-
-5) Mesa Home Page
-
- You can get the source code and more information about Mesa from
- http://www.mesa3d.org/
-
- The OS/2 ports should be available from
- http://r350.ee.ntu.edu.tw/~hcchu/os2/ports
-
---
-Alexander Mai
-st002279@hrzpub.tu-darmstadt.de
diff --git a/nx-X11/extras/Mesa/docs/README.OpenStep b/nx-X11/extras/Mesa/docs/README.OpenStep
deleted file mode 100644
index a566eca67..000000000
--- a/nx-X11/extras/Mesa/docs/README.OpenStep
+++ /dev/null
@@ -1,35 +0,0 @@
-This is a port of the GL and GLU libraries to NeXT/Apple object
-orientated systems. As these systems have their own window handling
-systems we simply use the offscreen rendering capability of Mesa
-to generate bitmaps which may then be displayed by the application
-with a View as required. Example pieces of code may be found in the
-OpenStep directory.
-
-Sadly there are now a proliferation of different system that we need to
-support compilation for: The original NextStep system, The OpenStep
-system, the Rhapsody/Mac OS X system and also the windows implementations
-of the latter two systems. This version of the code has been compiled and
-tested under the following architectures:
-
- NextStep 3.3
- OpenStep 4.2
- Rhapsody DR2
- WebObjects for NT 3.5
- WebObjects for NT 4.0
-
-All tests were done with Intel processors. Feedback on other systems would,
-however, be appreciated !
-
-On UNIX systems simply type "make openstep". Under Windows systems
-with WebObjects run the "win32-openstep.sh" script from within the Bourne
-shell provided with the development environment. In both cases this will
-build the libraries and place them into the "lib" directory. Some examples
-may be found in the OpenStep directory showing how to use the code in an
-actual application (MesaView) as well as some command line demos.
-
-The CC variable may be specified on the command line for doing such things
-as building FFAT libraries or using alternative compilers to the standard 'cc'
-e.g. make CC='cc -arch m68k -arch i386' openstep" will build the libraries
-with both intel and motorola architectures.
-
--Pete French. (pete@ohm.york.ac.uk) 7/6/1999
diff --git a/nx-X11/extras/Mesa/docs/README.QUAKE b/nx-X11/extras/Mesa/docs/README.QUAKE
deleted file mode 100644
index 729c0e514..000000000
--- a/nx-X11/extras/Mesa/docs/README.QUAKE
+++ /dev/null
@@ -1,208 +0,0 @@
-
- Info on using Mesa 3.0 with Linux Quake I and Quake II
-
-
-
-Disclaimer
-----------
-
-I am _not_ a Quake expert by any means. I pretty much only run it to
-test Mesa. There have been a lot of questions about Linux Quake and
-Mesa so I'm trying to provide some useful info here. If this file
-doesn't help you then you should look elsewhere for help. The Mesa
-mailing list or the news://news.3dfx.com/3dfx.linux.glide newsgroup
-might be good.
-
-Again, all the information I have is in this file. Please don't email
-me with questions.
-
-If you have information to contribute to this file please send it to
-me at brianp@elastic.avid.com
-
-
-
-Linux Quake
------------
-
-You can get Linux Quake from http://www.idsoftware.com/
-
-Quake I and II for Linux were tested with, and include, Mesa 2.6. You
-shouldn't have too many problems if you simply follow the instructions
-in the Quake distribution.
-
-
-
-RedHat 5.0 Linux problems
--------------------------
-
-RedHat Linux 5.x uses the GNU C library ("glibc" or "libc6") whereas
-previous RedHat and other Linux distributions use "libc5" for its
-runtime C library.
-
-Linux Quake I and II were compiled for libc5. If you compile Mesa
-on a RedHat 5.x system the resulting libMesaGL.so file will not work
-with Linux Quake because of the different C runtime libraries.
-The symptom of this is a segmentation fault soon after starting Quake.
-
-If you want to use a newer version of Mesa (like 3.x) with Quake on
-RedHat 5.x then read on.
-
-The solution to the C library problem is to force Mesa to use libc5.
-libc5 is in /usr/i486-linux-libc5/lib on RedHat 5.x systems.
-
-Emil Briggs (briggs@tick.physics.ncsu.edu) nicely gave me the following
-info:
-
-> I only know what works on a RedHat 5.0 distribution. RH5 includes
-> a full set of libraries for both libc5 and glibc. The loader ld.so
-> uses the libc5 libraries in /usr/i486-linux-libc5/lib for programs
-> linked against libc5 while it uses the glibc libraries in /lib and
-> /usr/lib for programs linked against glibc.
->
-> Anyway I changed line 41 of mklib.glide to
-> GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib"
->
-> And I started quake2 up with a script like this
-> #!/bin/csh
-> setenv LD_LIBRARY_PATH /usr/i486-linux-libc5/lib
-> setenv MESA_GLX_FX f
-> ./quake2 +set vid_ref gl
-> kbd_mode -a
-> reset
-
-
-I've already patched the mklib.glide file. You'll have to start Quake
-with the script shown above though.
-
-
-
-**********************
-
-Daryll Strauss writes:
-
-Here's my thoughts on the problem. On a RH 5.x system, you can NOT build
-a libc5 executable or library. Red Hat just doesn't include the right
-stuff to do it.
-
-Since Quake is a libc5 based application, you are in trouble. You need
-libc5 libraries.
-
-What can you do about it? Well there's a package called gcc5 that does
-MOST of the right stuff to compile with libc5. (It brings back older
-header files, makes appropriate symbolic links for libraries, and sets
-up the compiler to use the correct directories) You can find gcc5 here:
-ftp://ecg.mit.edu/pub/linux/gcc5-1.0-1.i386.rpm
-
-No, this isn't quite enough. There are still a few tricks to getting
-Mesa to compile as a libc5 application. First you have to make sure that
-every compile uses gcc5 instead of gcc. Second, in some cases the link
-line actually lists -L/usr/lib which breaks gcc5 (because it forces you
-to use the glibc version of things)
-
-If you get all the stuff correctly compiled with gcc5 it should work.
-I've run Mesa 3.0B6 and its demos in a window with my Rush on a Red Hat
-5.1 system. It is a big hassle, but it can be done. I've only made Quake
-segfault, but I think that's from my libRush using the wrong libc.
-
-Yes, mixing libc5 and glibc is a major pain. I've been working to get
-all my libraries compiling correctly with this setup. Someone should
-make an RPM out of it and feed changes back to Brian once they get it
-all working. If no one else has done so by the time I get the rest of my
-stuff straightened out, I'll try to do it myself.
-
- - |Daryll
-
-
-
-*********************
-
-David Bucciarelli (tech.hmw@plus.it) writes:
-
-I'm using the Mesa-3.0beta7 and the RedHat 5.1 and QuakeII is
-working fine for me. I had only to make a small change to the
-Mesa-3.0/mklib.glide file, from:
-
-
- GLIDELIBS="-L/usr/local/glide/lib -lglide2x
--L/usr/i486-linux-libc5/lib -lm"
-
-to:
-
- GLIDELIBS="-L/usr/i486-linux-libc5/lib -lglide2x"
-
-and to make two symbolic links:
-
-[david@localhost Mesa]$ ln -s libMesaGL.so libMesaGL.so.2
-[david@localhost Mesa]$ ln -s libMesaGLU.so libMesaGLU.so.2
-
-I'm using the Daryll's Linux glide rpm for the Voodoo2 and glibc (it
-includes also the Glide for the libc5). I'm not using the /dev/3Dfx and
-running QuakeII as root with the following env. var:
-
-export
-LD_LIBRARY_PATH=/dsk1/home/david/src/gl/Mesa/lib:/usr/i486-linux-libc5/lib
-
-I think that all problems are related to the glibc, Quake will never
-work if you get the following output:
-
-[david@localhost Mesa]$ ldd lib/libMesaGL.so
- libglide2x.so => /usr/lib/libglide2x.so (0x400f8000)
- libm.so.6 => /lib/libm.so.6 (0x40244000)
- libc.so.6 => /lib/libc.so.6 (0x4025d000)
- /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
-
-You must get the following outputs:
-
-[david@localhost Mesa]# ldd lib/libMesaGL.so
- libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so
-(0x400f3000)
-
-[root@localhost quake2]# ldd quake2
- libdl.so.1 => /lib/libdl.so.1 (0x40005000)
- libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x40008000)
- libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x40010000)
-
-[root@localhost quake2]# ldd ref_gl.so
- libMesaGL.so.2 =>
-/dsk1/home/david/src/gl/Mesa/lib/libMesaGL.so.2 (0x400eb000)
- libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so
-(0x401d9000)
- libX11.so.6 => /usr/i486-linux-libc5/lib/libX11.so.6
-(0x40324000)
- libXext.so.6 => /usr/i486-linux-libc5/lib/libXext.so.6
-(0x403b7000)
- libvga.so.1 => /usr/i486-linux-libc5/lib/libvga.so.1
-(0x403c1000)
- libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x403f5000)
- libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x403fd000)
-
-
-***********************
-
-Steve Davies (steve@one47.demon.co.uk) writes:
-
-
-Try using:
-
- export LD_LIBRARY_PATH=/usr/i486-linux-libc5/lib
- ./quake2 +set vid_ref gl
-
-to start the game... Works for me, but assumes that you have the
-compatability libc5 RPMs installed.
-
-
-***************************
-
-WWW resources - you may find additional Linux Quake help at these URLs:
-
-
-http://quake.medina.net/howto
-
-http://webpages.mr.net/bobz
-
-http://www.linuxgames.com/quake2/
-
-
-
-----------------------------------------------------------------------
-$Id: README.QUAKE,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/README.THREADS b/nx-X11/extras/Mesa/docs/README.THREADS
deleted file mode 100644
index fb6e0ff3d..000000000
--- a/nx-X11/extras/Mesa/docs/README.THREADS
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-Mesa Threads README
--------------------
-
-Thread safety was introduced in Mesa 2.6 by John Stone and
-Christoph Poliwoda.
-
-It was redesigned in Mesa 3.3 so that thread safety is
-supported by default (on systems which support threads,
-that is). There is no measurable penalty on single
-threaded applications.
-
-NOTE that the only _driver_ which is thread safe at this time
-is the OS/Mesa driver!
-
-
-At present the mthreads code supports three thread APIS:
- 1) POSIX threads (aka pthreads).
- 2) Solaris / Unix International threads.
- 3) Win32 threads (Win 95/NT).
-
-Support for other thread libraries can be added src/glthread.[ch]
-
-
-In order to guarantee proper operation, it is
-necessary for both Mesa and application code to use the same threads API.
-So, if your application uses Sun's thread API, then you should build Mesa
-using one of the targets for Sun threads.
-
-The mtdemos directory contains some example programs which use
-multiple threads to render to osmesa rendering context(s).
-
-Linux users should be aware that there exist many different POSIX
-threads packages. The best solution is the linuxthreads package
-(http://pauillac.inria.fr/~xleroy/linuxthreads/) as this package is the
-only one that really supports multiprocessor machines (AFAIK). See
-http://pauillac.inria.fr/~xleroy/linuxthreads/README for further
-information about the usage of linuxthreads.
-
-If you are interested in helping with thread safety work in Mesa
-join the Mesa developers mailing list and post your proposal.
-
-
-Regards,
- John Stone -- j.stone@acm.org johns@cs.umr.edu
- Christoph Poliwoda -- poliwoda@volumegraphics.com
-
-
-Version info:
- Mesa 2.6 - initial thread support.
- Mesa 3.3 - thread support mostly rewritten (Brian Paul)
diff --git a/nx-X11/extras/Mesa/docs/README.VMS b/nx-X11/extras/Mesa/docs/README.VMS
deleted file mode 100644
index c435727c0..000000000
--- a/nx-X11/extras/Mesa/docs/README.VMS
+++ /dev/null
@@ -1,32 +0,0 @@
-
-VMS support contributed by Jouk Jansen (joukj@hrem.stm.tudelft.nl)
-
-
-The latest version was tested on a VMSAlpha7.2 system using DECC6.0, but
-probably also works for other versions.
-
-At the moment only the libraries LIBMESGL.EXE/LIBMESGL.OLB,
-LIBMESAGLU.EXE/LIBMESAGLU.OLB and LIBGLUT.EXE/LIBGLUT.OLB and the demos of the
-directory [.DEMOS] can be build.
-However, feel free to create the missing "decrip.mms-files" in the other
-directories.
-
- The make files were tested
-using the DIGITAL make utility called MMS. There is also a public domain
-clone available (MMK) and I think, but it is not tested, that this
-utility will give (hardly) any problem.
-
-To make everything just type MMS (or MMK) in the main directory of
-mesagl. For MMS the deafult makefile is called descrip.mms, and
-that is what I have called it. I included alse some config files,
-all having mms somewhere in the name which all the makefiles need
-(just as your unix makefiles).
-
-On Alpha platforms at default a sharable images for the libraries are created.
-To get a static library make it by typing MMS/MACRO=(NOSHARE=1).
-On VAX platforms only static libraries can be build.
-
-
-You may want to compile Mesa to use IEEE floating point arithmetic, instead
-of VAX floating point by specifying the /float=IEEE flag to the compiler.
-For more information see https://bugs.freedesktop.org/show_bug.cgi?id=4270
diff --git a/nx-X11/extras/Mesa/docs/README.WIN32 b/nx-X11/extras/Mesa/docs/README.WIN32
deleted file mode 100644
index 675a3b364..000000000
--- a/nx-X11/extras/Mesa/docs/README.WIN32
+++ /dev/null
@@ -1,139 +0,0 @@
-File: docs/README.WIN32
-
-Last updated: Jul 01, 2005 - Karl Schultz - kschultz@users.sourceforge.net
-
-Quick Start
------ -----
-
-Unzip both ZIP files (MesaLib and MesaDemos) into the same directory.
-The libs and demos build separately, so if you do not care about the
-demos, you do not have to unzip that zip file. But if you do, it does
-need to be unzipped into the same directory as the lib zip file
-because the demos depend on the libs.
-
-The Windows build system uses Microsoft Visual Studio. Project files
-for a specific version of Visual Studio are in their own directory in
-the top-level "windows" directory. For example, Visual Studio 6 files
-are in windows/VC6. If a directory does not exist for your version of
-Visual Studio, you can try importing the project files from an earlier
-version of Visual Studio. At this time, project files exist for
-Version 6 and Version 7. The code has been built with a beta version
-of Version 8 and it runs on 64-bit Windows. If you want to try this,
-start by importing the VC7 files and create the 64-bit targets in the
-configuration manager.
-
-The project files to build the core Mesa library, Windows Mesa
-drivers, OSMesa, and GLU are in the mesa directory. The project files
-to build GLUT and some demo programs are in the progs directory.
-
-Makefiles are no longer shipped or supported, but can be generated
-from the projects using Visual Studio.
-
-
-Windows Drivers
-------- -------
-
-At this time, only the GDI driver is known to work, as it has been
-ported and rewritten to the latest Mesa DD interfaces. Source code
-also exists in the tree for other drivers in src/mesa/drivers/windows,
-but the status of this code is unknown.
-
-The GDI driver operates basically by writing pixel spans into a DIB
-section and then blitting the DIB to the window. The driver was
-recently cleaned up and rewitten and so may have bugs or may be
-missing some functionality. The older versions of the CVS source may
-be useful in figuring out any problems, or report them to me.
-
-To build Mesa with the GDI driver, build the mesa, gdi, and glu
-projects in the Visual Studio workspace found at
-
- windows/VC6/mesa/mesa.dsw
-or
- windows/VC7/mesa/mesa.sln
-
-The osmesa DLL can also be built with the osmesa project.
-
-The build system creates a lib top-level directory and copies
-resulting LIB and DLL files to this lib directory. The files are:
-
- OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
- OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
-
-If the MesaDemos ZIP file was extracted, the DLL files are also copied
-to the demos directory. This facilitates running the demos as described
-below.
-
-
-GLUT and Demos
----- --- -----
-
-A Visual Studio workspace can be found at
-
- windows/VC6/progs/progs.dsw
-or
- windows/VC7/progs/progs.sln
-
-It can be used to build GLUT and a few demos. The GLUT lib and DLL
-are copied to the top-level lib directory, along with the Mesa libs.
-
-The demo build system expects to find the LIB files in the top level
-lib directory, so you must build the Mesa libs first. The demo
-executables are placed in the demos directory, because some of them
-rely on data files found there. Also, the Mesa lib DLL's were copied
-there by the Mesa lib build process. Therefore, you should be able to
-simply run the demo executables from the demo directory.
-
-If you want to run the demos from the Visual Studio, you may have to
-change the startup directory and explicitly state where the executables are.
-
-
-Build System Notes
------ ------ -----
-
-VC6
----
-
-Visual Studio 6 does not recognize files with the .cc extension as C++
-language files, without a lot of unnatural tweaking. So, the VC6
-build process uses custom build steps to compile these files in the
-GLU library.
-
-
-VC7
----
-
-The above-mentioned .cc problem does not exist in this version.
-
-
-General
--------
-
-After building, you can copy the above DLL files to a place in your
-PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
-in a system directory, place them in the same directory as the
-executable(s). Be careful about accidentially overwriting files of
-the same name in the SYSTEM32 directory.
-
-The DLL files are built so that the external entry points use the
-stdcall calling convention.
-
-Static LIB files are not built. The LIB files that are built with are
-the linker import files associated with the DLL files.
-
-The si-glu sources are used to build the GLU libs. This was done
-mainly to get the better tessellator code.
-
-To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
-to the project settings. You will also need to edit src/mesa.def to
-change all the gl* symbols to mgl*. Because this is easy to do with a
-global replace operation in a text editor, no additional mangled
-version of mesa.def is maintained or shipped.
-
-If you have a Windows-related build problem or question, it is
-probably better to direct it to me (kschultz@users.sourceforge.net),
-rather than directly to the other Mesa developers. I will help you as
-much as I can. I also monitor the Mesa mailing lists and will answer
-questions in this area there as well.
-
-
-Karl Schultz
diff --git a/nx-X11/extras/Mesa/docs/README.WINDML b/nx-X11/extras/Mesa/docs/README.WINDML
deleted file mode 100644
index 448db71f8..000000000
--- a/nx-X11/extras/Mesa/docs/README.WINDML
+++ /dev/null
@@ -1,146 +0,0 @@
-
- WindML Driver for Mesa 4.0
-
-
-Requirements
-------------
-
-Tornado 2 + WindML, Cumulative Patchs are recommended.
-
-I suppose you have a valid WindML installation. Double buffer hardware
-gives better performance than double buffer software so if you can
-compile your WindML driver with this option, just do it. I/O
-redirection is adviced in target server.
-
-
-Tested on
----------
-
-During the development, my main target was a CoolMonster:
-- Video card: CT69000
-- CPU: PENTIUM 266MHz
-
-and my host a Windows NT + Tornado 2.
-
-
-Installation
-------------
-
-1. Mesa sources must be in root directory (C:\)
-
-2. Add the following line to your torVars.bat:
-set MESA_BASE=C:\Mesa
-
-OR copy the new torVars.bat in your bin path:
-c:/Mesa/src/ugl/tornado/torVars.sample ->
-/mnt/nt/Tornado/host/x86-win32/bin/torVars (for example)
-
-3. In a command prompt:
-$ torVars
-$ cd c:\Mesa
-$ make -f Makefile.ugl CPU=PENTIUM
-
-Take a long while...
-
-5. Include all the files from ugldemos folder to build some downloadable
- application modules
-
-4. Download UGL/Mesa object files on target
-
-For example via the WindShell:
-ld < c:\Tornado\target\lib\objMesaGL.o
-ld < c:\Tornado\target\lib\objMesaUGL.o
-ld < c:\Tornado\target\lib\objMesaGLU.o
-ld < c:\Tornado\target\lib\objGLUTshapes.o
-ld < c:\Tornado\target\lib\objMesaOS.o
-
-You can put the previous lines in a file and use:
-< filename
-
-6. Download the application modules.
-
-7. In WindShell, run:
--> uglalldemos
-
-During the show some messages will appear, it provides some useful
-information on key management.
-
-
-Coding
-------
-
-Sample Usage:
-
-In addition to the usual ugl calls to initialize UGL, (may be find an
-input driver), you must do the following to use the UGL/Mesa interface:
-
-1. Call uglMesaCreateContext() to create a UGL/Mesa rendering context,
- given the display format.
-
-2. Call uglMesaMakeCurrent() to bind the UGL/Mesa buffers to an
- UGL/Mesa Context and to make the context the current one.
-
-3. Make gl* calls to render your graphics.
-
-4. Use uglMesaSwapBuffers() when double buffering to swap front/back buffers.
-
-5. Before the UGL is destroyed, call MesaDestroyContext().
-
-6. Before exiting, call if required uglEventQDestroy and then
- uglDeinitialize();
-
-Limitations
------------
-
-I found the following limitations in my driver :
- - Color Indexed management is only in 8 bits
- - It's possible to mix UGL/OpenGL application with a software
- double buffer
-
-Modifications
-------------
-
-New files in Mesa:
-- Makefile.ugl
-- rules.windmlmesa
-- docs/README.UGL
-- include/GL/uglmesa.h
-- si-glu/Makefile.ugl
-- src/Makefile.ugl
-- src/ugl/torGLUTShapesInit.c
-- src/ugl/torMesaUGLInit.c
-- src/ugl/ugl_api.c
-- src/ugl/ugl_dd.c
-- src/ugl/ugl_glutshapes.c
-- src/ugl/ugl_line.c
-- src/ugl/ugl_span.c
-- src/ugl/ugl_tri.c
-- src/ugl/uglmesaP.h
-- ugldemos/*
-
-Modified files in Tornado 2.0:
-- c:\Tornado\host\x86-win32\bin\torVars.bat
-rem Command line build environments
-set WIND_HOST_TYPE=x86-win32
-set WIND_BASE=C:\Tornado
-set MESA_BASE=C:\Mesa
-set PATH=%WIND_BASE%\host\%WIND_HOST_TYPE%\bin;%PATH%
-- c:\Tornado\target\config\comps\VxWorks\01uglmesa.cdf
-- c:\Tornado\target\h\GL\*
-
-Todo
-----
-- GCC 2.96, ASM compilation
-
-Thanks to:
-----------
-
-Precision Insight team for their great job around Mesa, XFree, and DRI.
-Wind River Systems to take me as an intern.
-
-
-Stephane Raimbault
-<stephane.raimbault@windriver.com>
-<stephane.raimbault@deesse.univ-lemans.fr>
-
-July 24, 2001
diff --git a/nx-X11/extras/Mesa/docs/README.X11 b/nx-X11/extras/Mesa/docs/README.X11
deleted file mode 100644
index 45c424273..000000000
--- a/nx-X11/extras/Mesa/docs/README.X11
+++ /dev/null
@@ -1,314 +0,0 @@
-
- Mesa Unix/X11 Information
-
-
-
-Installation
-============
-
-There are two ways to compile Mesa on Unix/X11 systems:
-
-1. The old way:
- First type 'make' alone to see the list of system
- configurations currently supported. If you see your configuration on the
- list, type 'make <config>'. Most popular Unix/X workstations are currently
- supported.
-
- If your system configuration is not listed by 'make', you'll have to modify
- the top-level Makefile and Make-config files. There are instructions in
- each file.
-
- When finished, the Mesa libraries will be in the Mesa-x.y/lib/ directory.
-
-
-2. The new way:
- Type './configure' and then 'make'. This uses GNU autoconfig.
- Run 'make check' to build the demos.
- See docs/INSTALL for more details.
- When finished, the Mesa libraries will be in the Mesa-x.y/src/.libs/,
- Mesa-x.y/si-glu/.libs, etc directories.
-
-
-Notes on assembly language optimizations:
-
- When using the old-style Makefiles, you can specify a configuration
- that uses X86 assembly language optimizations (linux-3dnow for example).
-
- The detection of MMX, 3DNow!, PIII/SSE, etc capability is done at
- runtime. That means you can compile Mesa for 3DNow! optimizations
- even if you don't have an AMD CPU.
-
- However, your Linux binutils and assembler must understand the
- special instructions in order to compile them. If you have
- compilation problems, try upgrading your binutils.
-
-
-Header and library files:
- After you've compiled Mesa and tried the demos I recommend the following
- procedure for "installing" Mesa.
-
- Copy the Mesa include/GL directory to /usr/local/include:
- cp -r include/GL /usr/local/include
-
- Copy the Mesa library files to /usr/local/lib:
- cp lib/* /usr/local/lib
-
- (actually, use "cp -d" on Linux to preserve symbolic links)
-
-
-Xt/Motif widgets:
- If you want to use Mesa or OpenGL in your Xt/Motif program you can build
- the widgets found in either the widgets-mesa or widgets-sgi directories.
- The former were written for Mesa and the later are the original SGI
- widgets. Look in those directories for more information.
-
-
-Notes:
- HP users: a Mesa user reports that the HP-UX 10.01 C compiler has
- a bug which effects glReadPixels. A patch for the compiler (PHSS_5743) is
- available. Otherwise be sure your compiler is version 10.13 or later.
-
- QNX users: if you have problems running the demos try setting the
- stack size to 200K or larger with -N200K, for example.
-
- SunOS 5.x users: The X shared memory extension may not work
- correctly. If Mesa prints an error message to the effect of "Shared memory
- error" then you'll have to append the following three lines to the end of
- your /etc/system file then reboot:
- set shmsys:shminfo_shmmax = 0x2000000
- set shmsys:shminfo_shmmni = 0x1000
- set shmsys:shminfo_shmseg = 0x100
-
-
-
-Using the library
-=================
-
-Configuration options:
- The file src/mesa/main/config.h has many parameters which you can adjust
- such as maximum number of lights, clipping planes, maximum texture size,
- etc. In particular, you may want to change DEPTH_BITS from 16 to 32
- if a 16-bit depth buffer isn't precise enough for your application.
-
-
-Shared libraries:
- If you compile shared libraries you may have to set an environment
- variable to specify where the Mesa libraries are located. On Linux and
- Sun systems for example, set the LD_LIBRARY_PATH variable to include
- /your-dir/Mesa-2.6/lib. Otherwise, when you try to run a demo it
- may fail with a message saying that one or more libraries couldn't be
- found.
-
-
-Remote display of OpenGL/GLX programs:
- As of version 1.2.3, Mesa's header files use the same GLenum and GLUenum
- values as SGI's (and most/all other vendor's) OpenGL headers. This means
- you can freely mix object files compiled with OpenGL or Mesa headers.
- In fact, on systems with dynamic runtime linkers it's possible to dynam-
- ically link with Mesa or OpenGL shared libraries at runtime, without
- recompiling or relinking anything!
-
- Using IRIX 5.x as an example, you can run SGI's OpenGL demos with the
- Mesa shared libraries as follows. Let's assume you're installing Mesa
- in /usr/local/Mesa and using the C-shell:
- % cd /usr/local/Mesa
- % make irix5-dso
- % setenv _RLD_LIST "/usr/local/Mesa/lib/libGL.so:DEFAULT"
- % /usr/demos/bin/ideas_ogl // this is a test
-
- You can now run OpenGL executables on almost any X display! There may
- be some problems from the fact that Mesa supports many X visual types
- that an OpenGL client may not expect (grayscale for example). In this
- case the application may abort, print error messages, or just behave
- strangely. You may have to experiment with the MESA_RGB_VISUAL envi-
- ronment variable.
-
-
-Xt/Motif Widgets:
- Two versions of the Xt/Motif OpenGL drawing area widgets are included:
-
- widgets-sgi/ SGI's stock widgets
- widgets-mesa/ Mesa-tuned widgets
-
- Look in those directories for details
-
-
-Togl:
- Togl is an OpenGL/Mesa widget for Tcl/Tk.
- See http://togl.sourceforge.net for more information.
-
-
-
-X Display Modes:
- Mesa supports RGB(A) rendering into almost any X visual type and depth.
-
- The glXChooseVisual function tries its best to pick an appropriate visual
- for the given attribute list. However, if this doesn't suit your needs
- you can force Mesa to use any X visual you want (any supported by your
- X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL
- environment variables. When an RGB visual is requested, glXChooseVisual
- will first look if the MESA_RGB_VISUAL variable is defined. If so, it
- will try to use the specified visual. Similarly, when a color index
- visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL
- variable.
-
- The format of accepted values is: <visual-class> <depth>
- Here are some examples:
-
- using the C-shell:
- % setenv MESA_RGB_VISUAL "TrueColor 8" // 8-bit TrueColor
- % setenv MESA_CI_VISUAL "PseudoColor 12" // 12-bit PseudoColor
- % setenv MESA_RGB_VISUAL "PseudoColor 8" // 8-bit PseudoColor
-
- using the KornShell:
- $ export MESA_RGB_VISUAL="TrueColor 8"
- $ export MESA_CI_VISUAL="PseudoColor 12"
- $ export MESA_RGB_VISUAL="PseudoColor 8"
-
-
-Double buffering:
- Mesa can use either an X Pixmap or XImage as the backbuffer when in
- double buffer mode. Using GLX, the default is to use an XImage. The
- MESA_BACK_BUFFER environment variable can override this. The valid
- values for MESA_BACK_BUFFER are: Pixmap and XImage (only the first
- letter is checked, case doesn't matter).
-
- A pixmap is faster when drawing simple lines and polygons while an
- XImage is faster when Mesa has to do pixel-by-pixel rendering. If you
- need depth buffering the XImage will almost surely be faster. Exper-
- iment with the MESA_BACK_BUFFER variable to see which is faster for
- your application.
-
-
-Colormaps:
- When using Mesa directly or with GLX, it's up to the application writer
- to create a window with an appropriate colormap. The aux, tk, and GLUT
- toolkits try to minimize colormap "flashing" by sharing colormaps when
- possible. Specifically, if the visual and depth of the window matches
- that of the root window, the root window's colormap will be shared by
- the Mesa window. Otherwise, a new, private colormap will be allocated.
-
- When sharing the root colormap, Mesa may be unable to allocate the colors
- it needs, resulting in poor color quality. This can happen when a
- large number of colorcells in the root colormap are already allocated.
- To prevent colormap sharing in aux, tk and GLUT, define the environment
- variable MESA_PRIVATE_CMAP. The value isn't significant.
-
-
-Gamma correction:
- To compensate for the nonlinear relationship between pixel values
- and displayed intensities, there is a gamma correction feature in
- Mesa. Some systems, such as Silicon Graphics, support gamma
- correction in hardware (man gamma) so you won't need to use Mesa's
- gamma facility. Other systems, however, may need gamma adjustment
- to produce images which look correct. If in the past you thought
- Mesa's images were too dim, read on.
-
- Gamma correction is controlled with the MESA_GAMMA environment
- variable. Its value is of the form "Gr Gg Gb" or just "G" where
- Gr is the red gamma value, Gg is the green gamma value, Gb is the
- blue gamma value and G is one gamma value to use for all three
- channels. Each value is a positive real number typically in the
- range 1.0 to 2.5. The defaults are all 1.0, effectively disabling
- gamma correction. Examples using csh:
-
- % setenv MESA_GAMMA "2.3 2.2 2.4" // separate R,G,B values
- % setenv MESA_GAMMA "2.0" // same gamma for R,G,B
-
- The demos/gamma.c program may help you to determine reasonable gamma
- value for your display. With correct gamma values, the color intensities
- displayed in the top row (drawn by dithering) should nearly match those
- in the bottom row (drawn as grays).
-
- Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well
- on HP displays using the HP-ColorRecovery technology.
-
- Mesa implements gamma correction with a lookup table which translates
- a "linear" pixel value to a gamma-corrected pixel value. There is a
- small performance penalty. Gamma correction only works in RGB mode.
- Also be aware that pixel values read back from the frame buffer will
- not be "un-corrected" so glReadPixels may not return the same data
- drawn with glDrawPixels.
-
- For more information about gamma correction see:
- http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html
-
-
-Overlay Planes
-
- Overlay planes in the frame buffer are supported by Mesa but require
- hardware and X server support. To determine if your X server has
- overlay support you can test for the SERVER_OVERLAY_VISUALS property:
-
- xprop -root | grep SERVER_OVERLAY_VISUALS
-
-
-HPCR glClear(GL_COLOR_BUFFER_BIT) dithering
-
- If you set the MESA_HPCR_CLEAR environment variable then dithering
- will be used when clearing the color buffer. This is only applicable
- to HP systems with the HPCR (Color Recovery) system.
-
-
-Extensions
-==========
- There are three Mesa-specific GLX extensions at this time.
-
- GLX_MESA_pixmap_colormap
-
- This extension adds the GLX function:
-
- GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap, Colormap cmap )
-
- It is an alternative to the standard glXCreateGLXPixmap() function.
- Since Mesa supports RGB rendering into any X visual, not just True-
- Color or DirectColor, Mesa needs colormap information to convert RGB
- values into pixel values. An X window carries this information but a
- pixmap does not. This function associates a colormap to a GLX pixmap.
- See the xdemos/glxpixmap.c file for an example of how to use this
- extension.
-
- GLX_MESA_release_buffers
-
- Mesa associates a set of ancillary (depth, accumulation, stencil and
- alpha) buffers with each X window it draws into. These ancillary
- buffers are allocated for each X window the first time the X window
- is passed to glXMakeCurrent(). Mesa, however, can't detect when an
- X window has been destroyed in order to free the ancillary buffers.
-
- The best it can do is to check for recently destroyed windows whenever
- the client calls the glXCreateContext() or glXDestroyContext()
- functions. This may not be sufficient in all situations though.
-
- The GLX_MESA_release_buffers extension allows a client to explicitly
- deallocate the ancillary buffers by calling glxReleaseBuffersMESA()
- just before an X window is destroyed. For example:
-
- #ifdef GLX_MESA_release_buffers
- glXReleaseBuffersMESA( dpy, window );
- #endif
- XDestroyWindow( dpy, window );
-
- This extension is new in Mesa 2.0.
-
- GLX_MESA_copy_sub_buffer
-
- This extension adds the glXCopySubBufferMESA() function. It works
- like glXSwapBuffers() but only copies a sub-region of the window
- instead of the whole window.
-
- This extension is new in Mesa version 2.6
-
-
-
-Summary of X-related environment variables:
- MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
- MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
- MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
- MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
- MESA_GAMMA - gamma correction coefficients (X only)
-
-
-----------------------------------------------------------------------
-$Id: README.X11,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/README.directfb b/nx-X11/extras/Mesa/docs/README.directfb
deleted file mode 100644
index 169ebe486..000000000
--- a/nx-X11/extras/Mesa/docs/README.directfb
+++ /dev/null
@@ -1,28 +0,0 @@
-
- Mesa DirectFB Information
-
-
-Requirements
-============
-
- To build Mesa with DirectFB (DirectFBGL) support you need:
- - DirectFB at least 0.9.21 (http://directfb.org)
- - pkg-config at least 0.9 (http://pkgconfig.sf.net)
-
-
-Installation
-============
- Run
-
- make linux-directfb
-
- to build Mesa and DirectFBGL module,
-
- make install
-
- to install OpenGL libraries and
-
- make linux-directfb-install
-
- to install DirectFBGL module in the proper location.
-
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.1 b/nx-X11/extras/Mesa/docs/RELNOTES-3.1
deleted file mode 100644
index c1d5d8f9f..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.1
+++ /dev/null
@@ -1,146 +0,0 @@
-
- Mesa 3.1 release notes
-
- PLEASE READ!!!!
-
-
-New copyright
--------------
-
-Mesa 3.1 will be distributed under an XFree86-style copyright instead
-of the GNU LGPL.
-
-
-New directories
----------------
-
-All documentation files are now in the docs/ directory.
-All shell scripts are now in the bin/ directory.
-
-
-New library names
------------------
-
-Formerly, the main Mesa library was named libMesaGL.so (or libMesaGL.a)
-and the GLU library was named libMesaGLU.so (or libMesaGLU.a).
-
-Now, the main library is named libGL.so (or libGL.a) and the GLU library
-is named libGLU.so (or libGLU.a).
-
-The change allows Mesa to be more easily substituted for OpenGL.
-Specifically, the linker/loader on some Unix-like systems won't
-allow libMesaGL.so to be used instead of libGL.so if the application
-was linked with the former.
-
-Warning: if you have another OpenGL implementation installed on your
-system (i.e. you have another OpenGL libGL.so) you'll have to be
-carefull about which library (OpenGL or Mesa) you link against. Be
-aware of -L linker flags and the value of the LD_LIBRARY_PATH environment
-variable.
-
-
-New library versioning
-----------------------
-
-Previously, the Mesa GL library was named libMesaGL.so.3.0
-To better support Linux/OpenGL standards, the Mesa GL library is now
-named libGL.so.1.2.030100 This indicates version 1.2 of the OpenGL spec
-and Mesa implementation 3.1.0
-
-In the long term this will allow better interoperability with other
-OpenGL implementations, especially on Linux. In the short term,
-OpenGL apps may have to be relinked to use the new library naming.
-
-
-
-New makefiles
--------------
-
-The old Makefiles found in the various directories have been renamed
-to Makefile.X11 in order to prevent filename collisions with autoconfig-
-generated Makefiles.
-
-The top-level Makefile simply includes Makefile.X11
-If your top-level Makefile get's overwritten/destroyed you can restore
-it by copying Makefile.X11 to Makefile
-
-
-New extensions
---------------
-
-GL_EXT_stencil_wrap
- Implements two new stencil operations: GL_INCR_WRAP_EXT and
- GL_DECR_WRAP_EXT which allow stencil increment and decrement
- without clamping.
-
-GL_INGR_blend_func_separate
- Allows specification of blend factors for RGB and Alpha independently.
- (INGR = Intergraph)
-
-GL_ARB_multitexture
- Multiple simultaneous textures. (ARB = Architecture Review Board)
-
-GL_NV_texgen_reflection
- nVidia texgen extension for better reflection mapping.
-
-GL_PGI_misc_hints
- Assorted transformation hints.
-
-GL_EXT_compiled_vertex_array
- Compiled vertex arrays.
-
-GL_EXT_clip_volume_hint
- Allows one to disable clip volume (frustum) testing.
-
-
-
-Extensions removed
-------------------
-
-GL_EXT_multitexture - obsolete in favor of GL_ARB_multitexture
-
-
-
-Config file
------------
-
-By default, /etc/mesa.conf will be read when Mesa starts. This
-file controls default hints, enable/disable of extensions, and
-more. See the CONFIG file for documentation.
-
-
-
-Optimizations
--------------
-
-Keith Whitwell has contributed significant optimizations to Mesa's
-vertex transformation code. Basically, the whole transformation
-stage of Mesa has been rewritten.
-
-It's impossible to give a speedup factor. You'll just have to
-try your app and see how it performs.
-
-
-
-Device Driver changes
----------------------
-
-A bunch of new device driver functions have been added. See src/dd.h
-Keith Harrison contributed many of them. I've been planning on adding
-a bunch of functions like these to make writing hardware drivers easier.
-More such function will probably be added in the near future.
-
-
-
-Miscellaneous
--------------
-
-util/glstate.c has some handy functions for debugging. Basically, it
-offers a simple function for printing GL state variables. It's not
-finished yet. There's a LOT more GLenum records to be added (see the
-code). Anyone want to help?
-
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.1,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.2 b/nx-X11/extras/Mesa/docs/RELNOTES-3.2
deleted file mode 100644
index 476d97545..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.2
+++ /dev/null
@@ -1,12 +0,0 @@
-
- Mesa 3.2 release notes
-
- PLEASE READ!!!!
-
-
-Mesa 3.2 is a stabilization of the Mesa 3.1 release. No new features
-have been added. For a list of bug fixes please read the VERSIONS file.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.2,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.2.1 b/nx-X11/extras/Mesa/docs/RELNOTES-3.2.1
deleted file mode 100644
index 5245a2ed6..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.2.1
+++ /dev/null
@@ -1,32 +0,0 @@
-
- Mesa 3.2.1 release notes
-
- PLEASE READ!!!!
-
-
-
-The Mesa 3.2.1 release mainly just fixes bugs since the 3.2 release.
-See the VERSIONS file for the exact list.
-
-
-
-GLU Polygon Tessellator
------------------------
-
-The GLU tessellator has been reverted back to the version included
-with Mesa 3.0 since it's more stable. The Mesa 3.1/3.2 tessellator
-implemented the GLU 1.3 specification but suffered from a number of
-bugs.
-
-Mesa implements GLU 1.1.
-
-Ideally, people should use the GLU 1.3 library included in SGI's
-OpenGL Sample Implementation (SI) available from
-http://oss.sgi.com/projects/ogl-sample/
-People are working to make easy-to-install Linux RPMs of the
-GLU library.
-
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.2.1,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.3 b/nx-X11/extras/Mesa/docs/RELNOTES-3.3
deleted file mode 100644
index 552d07674..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.3
+++ /dev/null
@@ -1,271 +0,0 @@
-
- Mesa 3.3 release notes
-
- July 21, 2000
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.2.1) designate stable releases.
-
-Mesa 3.3 has a undergone many internal changes since version 3.2
-and features a lot of new extensions. 3.3 is expected to be pretty
-stable, but perhaps not as stable as 3.2 which has been used by
-thousands of users over the past months.
-
-Everyone is encouraged to try Mesa 3.3. Bugs should be reported to
-the Mesa bug database on www.sourceforge.net.
-
-
-
-Header file / GLenum changes
-----------------------------
-
-The gl.h and glu.h headers now use #defines to define all GL_* tokens
-instead of C-language enums. This change improves Mesa/OpenGL
-interoperability.
-
-
-
-New API dispatch code
----------------------
-
-The core Mesa gl* functions are now implemented with a new dispatch
-(jump table) which will allow simultaneous direct/indirect rendering.
-
-The code is found in the glapi*.[ch] files.
-
-Of interest: the actual "glFooBar" functions are generated with
-templatized code defined in glapitemp.h and included by glapi.c
-The glapitemp.h template should be reusable for all sorts of OpenGL
-projects.
-
-The new dispatch code has also optimized with x86 assembly code.
-This optimization eliminates copying the function arguments during
-dispatch.
-
-
-
-New thread support
-------------------
-
-Thread support in Mesa has been rewritten. The glthread.[ch] files
-replace mthreads.[ch]. Thread safety is always enabled (on platforms
-which support threads, that is). There is virtually no performance
-penalty for typical single-thread applications. See the glapi.c
-file for details.
-
-The Xlib driver (XMesa) is now thread-safe as well. Be sure to
-call XInitThreads() in your app first. See the xdemos/glthreads.c
-demo for an example.
-
-
-
-Make configuration changes
---------------------------
-
-If you use the old-style (non GNU automake) method to build Mesa note
-that several of the configuration names have changed:
-
- Old name New name
- ------------- ----------------
- linux-elf linux
- linux linux-static
- linux-386-elf linux-386
- linux-386 linux-386-static
- etc.
-
-
-
-New extensions
---------------
-
-GL_ARB_transpose_matrix
- Adds glLoadTransposeMatrixARB() and glMultTransposeMatrixARB()
- functions.
-
-GL_ARB_texture_cube_map
- For cube-based reflection mapping.
-
-GL_EXT_texture_add_env
- Adds GL_ADD texture environment mode.
- See http://www.berkelium.com/OpenGL/EXT/texture_env_add.txt
-
-GL_EXT_texture_lod_bias
- Allows mipmapped texture blurring and sharpening.
-
-GLX_EXT_visual_rating extension
- This extension has no effect in stand-alone Mesa (used for DRI).
-
-GL_HP_occlusion_test
- Used for bounding box occlusion testing (see demos/occlude.c).
-
-GL_SGIX_pixel_texture / GL_SGIS_pixel_texture
- Lets glDraw/CopyPixels draw a texture coordinate image.
-
-GL_SGI_color_matrix
- Adds a color matrix and another set of scale and bias parameters
- to the glDraw/CopyPixels paths.
-
-GL_SGI_color_table
- Adds additional color tables to the glDraw/Read/CopyPixels paths.
-
-GL_EXT_histogram
- Compute histograms for glDraw/Read/CopyPixels.
-
-GL_EXT_blend_func_separate
- This is the same as GL_INGR_blend_func_separate.
-
-GL_ARB_texture_cube_mapping
- 6-face cube mapping, nicer than sphere mapping
-
-GL_EXT_texture_env_combine
- For advanced texture environment effects.
-
-
-Documentation for all these functions can be found at
-http://oss.sgi.com/projects/ogl-sample/registry/
-
-
-
-GLX_SGI_make_current_read functionality
----------------------------------------
-
-The functionality of this extension is needed for GLX 1.3 (and required
-for the Linux/OpenGL standards base).
-
-Implementing this function required a **DEVICE DRIVER CHANGE**.
-The old SetBuffer() function has been replaced by SetReadBuffer() and
-SetDrawBuffer(). All device drivers will have to be updated because
-of this change.
-
-The new function, glXMakeContextCurrent(), in GLX 1.3 now works in Mesa.
-The xdemos/wincopy.c program demonstrates it.
-
-
-
-Image-related code changes
---------------------------
-
-The imaging path code used by glDrawPixels, glTexImage[123]D,
-glTexSubImage[123], etc has been rewritten. It's now faster,
-uses less memory and has several bug fixes. This work was
-actually started in Mesa 3.1 with the glTexImage paths but has now
-been carried over to glDrawPixels as well.
-
-
-
-Device driver interface changes
--------------------------------
-
-Added new functions for hardware stencil buffer support:
- WriteStencilSpan
- ReadStencilSpan
- WriteStencilPixels
- ReadStencilPixels
-
-
-Removed old depth buffer functions:
- AllocDepthBuffer
- DepthTestSpan
- DepthTestPixels
- ReadDepthSpanFloat
- ReadDepthSpanInt
-
-
-Added new depth buffer functions:
- WriteDepthSpan
- ReadDepthSpan
- WriteDepthPixels
- ReadDepthPixels
-
- These functions always read/write 32-bit GLuints. This will allow
- drivers to have anywhere from 0 to 32-bit Z buffers without
- recompiling for 16 vs 32 bits as was previously needed.
-
-
-New texture image functions
- The entire interface for texture image specification has been updated.
- With the new functions, it's optional for Mesa to keep an internal copy
- of all textures. Texture download should be a lot faster when the extra
- copy isn't made.
-
-Misc changes
- TexEnv now takes a target argument
- Removed UseGlobalTexturePalette (use Enable function instead)
-
-
-Also added
- ReadPixels
- CopyPixels
-
-
-The SetBufffer function has been replaced by SetDrawBuffer and
-SetReadBuffer functions. This lets core Mesa independently
-specify which buffer is to be used for reading and which for
-drawing.
-
-The Clear function's mask parameter has changed. Instead of
-mask being the flags specified by the user to glClear, the
-mask is now a bitmask of the DD_*_BIT flags in dd.h. Now
-multiple color buffers can be specified for clearing (ala
-glDrawBuffers). The driver's Clear function must also
-check the glColorMask glIndexMask, and glStencilMask settings
-and do the right thing. See the X/Mesa, OS/Mesa, or FX/Mesa
-drivers for examples.
-
-
-The depth buffer changes shouldn't be hard to make for existing
-drivers. In fact, it should simply the code. Be careful with
-the depthBits value passed to gl_create_context(). 1 is a bad
-value! It should normally be 0, 16, 24, or 32.
-
-
-gl_create_framebuffer() takes new arguments which explicitly tell
-core Mesa which ancillary buffers (depth, stencil, accum, alpha)
-should be implemented in software. Mesa hardware drivers should
-carefully set these flags depending on which buffers are in the
-graphics card.
-
-
-
-Internal constants
-------------------
-
-Point and line size range and granularity limits are now stored
-in the gl_constants struct, which is the Const member of GLcontext.
-The limits are initialized from values in config.h but may be
-overridden by device drivers to reflect the limits of that driver's
-hardware.
-
-Also added constants for NumAuxBuffers and SubPixelBits.
-
-
-
-OpenGL Conformance
-------------------
-
-Mesa now passes all the OpenGL 1.1 conformance tests, except for
-antialiased lines. AA lines fail on some, but not all, the tests.
-In order to fix the remaining failures, a new AA line algorithm will
-be needed (which computes coverage values for end-point fragments).
-This will be done for Mesa 3.5/3.6.
-
-
-
-OpenGL 1.2 GL_ARB_imaging subset
---------------------------------
-
-Mesa 3.3 implements all the features of GL_ARB_imaging except for
-image convolution. This will (hopefully) be done for Mesa 3.5/3.6.
-
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.3,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.4 b/nx-X11/extras/Mesa/docs/RELNOTES-3.4
deleted file mode 100644
index 9d61b9ded..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.4
+++ /dev/null
@@ -1,22 +0,0 @@
-
- Mesa 3.4 release notes
-
- November 3, 2000
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa 3.4 simply fixes bugs found in the Mesa 3.3 release. For details,
-see the VERSIONS file.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.4,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.4.1 b/nx-X11/extras/Mesa/docs/RELNOTES-3.4.1
deleted file mode 100644
index 4d343bef1..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.4.1
+++ /dev/null
@@ -1,22 +0,0 @@
-
- Mesa 3.4.1 release notes
-
- February 9, 2001
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa 3.4.1 is a maintenance release that simply fixes bugs found since
-the Mesa 3.4 release. For details, see the VERSIONS file.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.4.1,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.4.2 b/nx-X11/extras/Mesa/docs/RELNOTES-3.4.2
deleted file mode 100644
index 3d4be7e76..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.4.2
+++ /dev/null
@@ -1,22 +0,0 @@
-
- Mesa 3.4.2 release notes
-
- May 17, 2001
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa 3.4.2 is a maintenance release that simply fixes bugs found since
-the Mesa 3.4.1 release. For details, see the VERSIONS file.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.4.2,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-3.5 b/nx-X11/extras/Mesa/docs/RELNOTES-3.5
deleted file mode 100644
index d0bba7f5b..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-3.5
+++ /dev/null
@@ -1,228 +0,0 @@
-
- Mesa 3.5 release notes
-
- June 21, 2001
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.5) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-The biggest change in Mesa 3.5 is a complete overhaul of the source
-code in order to make it more modular. This was driven by the DRI
-hardware drivers. It simplifies the DRI drivers and opens the door
-to hardware transform/clip/lighting (TCL). Keith Whitwell can take
-the credit for that.
-
-
-
-Driver Support
---------------
-
-The device driver interface in Mesa 3.5 has changed a lot since Mesa 3.4
-Not all of the older Mesa drivers have been updated. Here's the status:
-
-Driver Status
----------------------- -----------
-XMesa (Xlib) updated
-OSMesa (off-screen) updated
-FX (3dfx Voodoo1/2) updated
-SVGA updated
-GGI not updated
-Windows/Win32 not updated
-DOS/DJGPP not updated
-BeOS not updated
-Allegro not updated
-D3D not updated
-DOS not updated
-
-We're looking for volunteers to update the remaining drivers. Please
-post to the Mesa3d-dev mailing list if you can help.
-
-
-
-GLU 1.3
--------
-
-Mesa 3.5 includes the SGI Sample Implementation (SI) GLU library.
-This version of GLU supports the GLU 1.3 specification. The old
-Mesa GLU library implemented the 1.1 specification. The SI GLU
-library should work much better.
-
-You'll need a C++ compiler to compile the SI GLU library. This may
-be a problem on some systems.
-
-
-
-New Extensions
---------------
-
-GL_EXT_convolution
- Adds image convolution to glRead/Copy/DrawPixels/TexImage.
-
-GL_ARB_imaging
- This is the optional imaging subset of OpenGL 1.2.
- It's the GL_EXT_convolution, GL_HP_convolution_border_modes,
- GL_EXT_histogram, GL_EXT_color_table, GL_EXT_color_subtable
- GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract
- and GL_SGI_color_matrix extensions all rolled together.
- This is supported in all software renderers but not in all
- hardware drivers (3dfx for example).
-
-GL_ARB_texture_compression
- This is supported in Mesa but only used by the 3dfx DRI drivers
- for Voodoo4 and later.
-
-GL_ARB_texture_env_add
- This is identical to GL_EXT_texture_env_add.
-
-GL_NV_blend_square
- Adds extra blend source and dest factors which allow squaring
- of color values.
-
-GL_EXT_fog_coord
- Allows specification of a per-vertex fog coordinate instead of
- having fog always computed from the eye distance.
-
-GL_EXT_secondary_color
- Allows specifying the secondary (specular) color for each vertex
- instead of getting it only from lighting in GL_SEPARATE_SPECULAR_COLOR
- mode.
-
-GL_ARB_texture_env_combine
- Basically the same as GL_EXT_texture_env_combine
-
-GL_ARB_texture_env_add extension
- Texture addition mode.
-
-GL_ARB_texture_env_dot3 extension
- Dot product texture environment.
-
-GL_ARB_texture_border_clamp
- Adds GL_CLAMP_TO_BORDER_ARB texture wrap mode
-
-GL_SGIX_depth_texture, GL_SGIX_shadow and GL_SGIX_shadow_ambient
- Implements a shadow casting algorithm based on depth map textures
-
-GL_SGIS_generate_mipmap
- Automatically generate lower mipmap images whenever the base mipmap
- image is changed with glTexImage, glCopyTexImage, etc.
-
-
-
-libOSMesa.so
-------------
-
-libOSMesa.so is a new library which contains the OSMesa interface for
-off-screen rendering. Apps which need the OSMesa interface should link
-with both -lOSMesa and -lGL. This change was made so that stand-alone
-Mesa works the same way as XFree86/DRI's libGL.
-
-
-
-Device Driver Changes / Core Mesa Changes
------------------------------------------
-
-The ctx->Driver.LogicOp() function has been removed. It used to
-be called during state update in order to determine if the driver
-could do glLogicOp() operations, and if not, set the SWLogicOpEnabled
-flag. Drivers should instead examine the LogicOp state themselves
-and choose specialized point, line, and triangle functions appropriately,
-or fall back to software rendering. The Xlib driver was the only driver
-to use this function. And since the Xlib driver no longer draws
-points, lines or triangles using Xlib, the LogicOp function isn't needed.
-
-The ctx->Driver.Dither() function has been removed. Drivers should
-detect dither enable/disable via ctx->Driver.Enable() instead.
-
-The ctx->Driver.IndexMask() and ctx->Driver.ColorMask() functions
-are now just called from glIndexMask and glColorMask like the other
-GL state-changing functions. They are no longer called from inside
-gl_update_state(). Also, they now return void. The change was made
-mostly for sake of uniformity.
-
-The NEW_DRVSTATE[0123] flags have been removed. They weren't being used
-and are obsolete w.r.t. the way state updates are done in DRI drivers.
-
-
-Removed obsolete gl_create_visual() and gl_destroy_visual().
-
-Renamed functions (new namespace):
-
-old new
-gl_create_framebuffer _mesa_create_framebuffer
-gl_destroy_framebuffer _mesa_destroy_framebuffer
-gl_create_context _mesa_create_context
-gl_destroy_context _mesa_destroy_context
-gl_context_initialize _mesa_context_initialize
-gl_copy_context _mesa_copy_context
-gl_make_current _mesa_make_current
-gl_make_current2 _mesa_make_current2
-gl_get_current_context _mesa_get_current_context
-gl_flush_vb _mesa_flush_vb
-gl_warning _mesa_warning
-gl_compile_error _mesa_compile_error
-
-
-All the drivers have been updated, but not all of them have been
-tested since I can't test some platforms (DOS, Windows, Allegro, etc).
-
-
-X/Mesa Driver
--------------
-
-The source files for the X/Mesa driver in src/X have been renamed.
-The xmesa[1234].c files are gone. The new files are xm_api.c,
-xm_dd.c, xm_line.c, xm_span.c and xm_tri.c.
-
-
-
-Multitexture
-------------
-
-Eight texture units are now supported by default.
-
-
-
-OpenGL SI related changes
--------------------------
-
-In an effort to make Mesa's internal interfaces more like the OpenGL
-SI interfaces, a number of changes have been made:
-
-1. Importing the SI's glcore.h file which defines a number of
-interface structures like __GLimports and __GLexports.
-
-2. Renamed "struct gl_context" to "struct __GLcontextRec".
-
-3. Added __glCoreCreateContext() and __glCoreNopDispatch() functions.
-
-4. The GLcontext member Visual is no longer a pointer.
-
-5. New file: imports.c to setup default import functions for Mesa.
-
-
-
-
-16-bit color channels
----------------------
-
-There's experimental support for 16-bit color channels (64-bit pixels)
-in Mesa 3.5. Only the OSMesa interface can be used for 16-bit rendering.
-Type "make linux-osmesa16" in the top-level directory to build the
-special libOSMesa16.so library.
-
-This hasn't been tested very thoroughly yet so please file bug reports
-if you have trouble.
-
-In the future I hope to implement support for 32-bit, floating point
-color channels.
-
-----------------------------------------------------------------------
-$Id: RELNOTES-3.5,v 1.1.1.3 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-4.0 b/nx-X11/extras/Mesa/docs/RELNOTES-4.0
deleted file mode 100644
index 125a7020e..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-4.0
+++ /dev/null
@@ -1,163 +0,0 @@
-
- Mesa 4.0 release notes
-
- October 18, 2001
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa version 4.0 signifies two things:
-
- 1. A stabilization of the 3.5 development release
- 2. Implementation of the OpenGL 1.3 specification
-
-
-Note that the Mesa major version number is incremented with the OpenGL
-minor version number:
-
- Mesa 1.x == OpenGL 1.0
- Mesa 2.x == OpenGL 1.1
- Mesa 3.x == OpenGL 1.2
- Mesa 4.x == OpenGL 1.3
-
-
-
-New Features
-------------
-
-Mesa 3.5 already had all the new features of OpenGL 1.3, implemented as
-extensions. These extensions were simply promoted to standard features:
-
- GL_ARB_multisample
- GL_ARB_multitexture
- GL_ARB_texture_border_clamp
- GL_ARB_texture_compression
- GL_ARB_texture_cube_map
- GL_ARB_texture_env_add
- GL_ARB_texture_env_combine
- GL_ARB_texture_env_dot3
- GL_ARB_transpose_matrix
-
-In Mesa 4.0 the functions defined by these extensions are now available
-without the "ARB" suffix. For example, glLoadTransposeMatrixf() is now
-a standard API function. The new functions in OpenGL 1.3 and Mesa 4.0 are:
-
- glActiveTexture
- glClientActiveTexture
- glCompressedTexImage1D
- glCompressedTexImage2D
- glCompressedTexImage3D
- glCompressedTexSubImage1D
- glCompressedTexSubImage2D
- glCompressedTexSubImage3D
- glGetCompressedTexImage
- glLoadTransposeMatrixd
- glLoadTransposeMatrixf
- glMultiTexCoord1d
- glMultiTexCoord1dv
- glMultiTexCoord1f
- glMultiTexCoord1fv
- glMultiTexCoord1i
- glMultiTexCoord1iv
- glMultiTexCoord1s
- glMultiTexCoord1sv
- glMultiTexCoord2d
- glMultiTexCoord2dv
- glMultiTexCoord2f
- glMultiTexCoord2fv
- glMultiTexCoord2i
- glMultiTexCoord2iv
- glMultiTexCoord2s
- glMultiTexCoord2sv
- glMultiTexCoord3d
- glMultiTexCoord3dv
- glMultiTexCoord3f
- glMultiTexCoord3fv
- glMultiTexCoord3i
- glMultiTexCoord3iv
- glMultiTexCoord3s
- glMultiTexCoord3sv
- glMultiTexCoord4d
- glMultiTexCoord4dv
- glMultiTexCoord4f
- glMultiTexCoord4fv
- glMultiTexCoord4i
- glMultiTexCoord4iv
- glMultiTexCoord4s
- glMultiTexCoord4sv
- glMultTransposeMatrixd
- glMultTransposeMatrixf
- glSampleCoverage
- glSamplePass
-
-
-GLX 1.4 is the companion to OpenGL 1.3. The only new features in GLX 1.4
-are support for multisampling and the GLX_ARB_get_proc_address extension.
-glXGetProcAddress() is the only new function in GLX 1.4.
-
-
-
-Multisample and Texture Compression
------------------------------------
-
-The OpenGL 1.3 specification allows the multisample and texture compression
-features to essentially be no-ops. For example, if you query for multisample
-support you'll find none, but the API functions work.
-
-Similarly, texture compression is not implemented by any of the software
-drivers but you can specify a generic compressed texture format (like
-GL_COMPRESSED_RGBA) to glTexImage2D and it'll be accepted.
-
-
-
-Device Drivers
---------------
-
-Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the
-device driver. If the driver enables all the ARB extensions which are part
-of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise,
-it'll return "1.2".
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of the drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.3
-OSMesa (off-screen) implements OpenGL 1.3
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.3
-GGI needs updating
-DOS/DJGPP needs updating
-BeOS needs updating
-Allegro needs updating
-D3D needs updating
-DOS needs updating
-
-Special thanks go to Karl Schultz for updating the Windows driver.
-
-The XFree86/DRI drivers have not yet been updated to use Mesa 4.0 as of
-September 2001, but that should happen eventually.
-
-
-
-Other Changes
--------------
-
-See the VERSIONS file for more details about bug fixes, etc. in Mesa 4.0.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-4.0,v 1.1.1.4 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-4.0.1 b/nx-X11/extras/Mesa/docs/RELNOTES-4.0.1
deleted file mode 100644
index 52490d23b..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-4.0.1
+++ /dev/null
@@ -1,22 +0,0 @@
-
- Mesa 4.0.1 release notes
-
- December 17, 2001
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa 4.0.1 only contains bug fixes since version 4.0.
-
-See the docs/VERSIONS file for the list of bug fixes.
-
-----------------------------------------------------------------------
-$Id: RELNOTES-4.0.1,v 1.1.1.4 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-4.0.2 b/nx-X11/extras/Mesa/docs/RELNOTES-4.0.2
deleted file mode 100644
index ed697ca50..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-4.0.2
+++ /dev/null
@@ -1,50 +0,0 @@
-
- Mesa 4.0.2 release notes
-
- March 25, 2002
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa 4.0.2 only contains bug fixes and a new DOS driver since version 4.0.1.
-
-See the docs/VERSIONS file for the list of bug fixes.
-
-
-Device Drivers
---------------
-
-Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the
-device driver. If the driver enables all the ARB extensions which are part
-of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise,
-it'll return "1.2".
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of the drivers.
-Here's the current status of all included drivers:
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.3
-OSMesa (off-screen) implements OpenGL 1.3
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.3
-DOS/DJGPP implements OpenGL 1.3 (new in Mesa 4.0.2)
-GGI needs updating
-BeOS needs updating
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-4.0.2,v 1.1.1.5 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-4.0.3 b/nx-X11/extras/Mesa/docs/RELNOTES-4.0.3
deleted file mode 100644
index 053813dd0..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-4.0.3
+++ /dev/null
@@ -1,52 +0,0 @@
-
- Mesa 4.0.3 release notes
-
- June 25, 2002
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 3.3) designate new developmental releases.
-Even numbered versions (such as 3.4) designate stable releases.
-
-Mesa 4.0.3 basically just contains bug fixes version 4.0.2.
-
-See the docs/VERSIONS file for the list of bug fixes.
-
-The GGI driver has been updated, thanks to Filip Spacek.
-
-
-Device Drivers
---------------
-
-Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the
-device driver. If the driver enables all the ARB extensions which are part
-of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise,
-it'll return "1.2".
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of the drivers.
-Here's the current status of all included drivers:
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.3
-OSMesa (off-screen) implements OpenGL 1.3
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.3
-DOS/DJGPP implements OpenGL 1.3 (new in Mesa 4.0.2)
-GGI implements OpenGL 1.3
-BeOS needs updating
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-4.0.3,v 1.1.1.5 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-4.1 b/nx-X11/extras/Mesa/docs/RELNOTES-4.1
deleted file mode 100644
index 7bb790190..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-4.1
+++ /dev/null
@@ -1,308 +0,0 @@
-
- Mesa 4.1 release notes
-
- October 29, 2002
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Even numbered versions (such as 4.0) designate stable releases.
-Odd numbered versions (such as 4.1) designate new developmental releases.
-
-
-New Features in Mesa 4.1
-------------------------
-
-New extensions. Docs at http://oss.sgi.com/projects/ogl-sample/registry/
-
-GL_NV_vertex_program
-
- NVIDIA's vertex programming extension
-
-GL_NV_vertex_program1_1
-
- A few features built on top of GL_NV_vertex_program
-
-GL_ARB_window_pos
-
- This is the ARB-approved version of GL_MESA_window_pos
-
-GL_ARB_depth_texture
-
- This is the ARB-approved version of GL_SGIX_depth_texture.
- It allows depth (Z buffer) data to be stored in textures.
- This is used by GL_ARB_shadow
-
-GL_ARB_shadow
-
- Shadow mapping with depth textures.
- This is the ARB-approved version of GL_SGIX_shadow.
-
-GL_ARB_shadow_ambient
-
- Allows one to specify the luminance of shadowed pixels.
- This is the ARB-approved version of GL_SGIX_shadow_ambient.
-
-GL_EXT_shadow_funcs
-
- Extends the set of GL_ARB_shadow texture comparision functions to
- include all eight of standard OpenGL dept-test functions.
-
-GL_ARB_point_parameters
-
- This is basically the same as GL_EXT_point_parameters.
-
-GL_ARB_texture_env_crossbar
-
- Allows any texture combine stage to reference any texture source unit.
-
-GL_NV_point_sprite
-
- For rendering points as textured quads. Useful for particle effects.
-
-GL_NV_texture_rectangle (new in 4.0.4 actually)
-
- Allows one to use textures with sizes that are not powers of two.
- Note that mipmapping and several texture wrap modes are not allowed.
-
-GL_EXT_multi_draw_arrays
-
- Allows arrays of vertex arrays to be rendered with one call.
-
-GL_EXT_stencil_two_side
-
- Separate stencil modes for front and back-facing polygons.
-
-GLX_SGIX_fbconfig & GLX_SGIX_pbuffer
-
- Off-screen rendering support.
-
-GL_ATI_texture_mirror_once
-
- Adds two new texture wrap modes: GL_MIRROR_CLAMP_ATI and
- GL_MIRROR_CLAMP_TO_EDGE_ATI.
-
-
-
-Device Driver Status
---------------------
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of these drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.3
-OSMesa (off-screen) implements OpenGL 1.3
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.3
-DOS/DJGPP implements OpenGL 1.3
-GGI implements OpenGL 1.3
-BeOS needs updating (underway)
-Allegro needs updating
-D3D needs updating
-DOS needs updating
-
-
-
-New features in GLUT
---------------------
-
-1. Frames per second printing
-
- GLUT now looks for an environment variable called "GLUT_FPS". If it's
- set, GLUT will print out a frames/second statistic to stderr when
- glutSwapBuffers() is called. By default, frames/second is computed
- and displayed once every 5 seconds. You can specify a different
- interval (in milliseconds) when you set the env var. For example
- 'export GLUT_FPS=1000' or 'setenv GLUT_FPS 1000' will set the interval
- to one second.
-
- NOTE: the demo or application must call the glutInit() function for
- this to work. Otherwise, the env var will be ignored.
-
- Finally, this feature may not be reliable in multi-window programs.
-
-
-2. glutGetProcAddress() function
-
- The new function:
-
- void *glutGetProcAddress(const char *procName)
-
- is a wrapper for glXGetProcAddressARB() and wglGetProcAddress(). It
- lets you dynamically get the address of an OpenGL function at runtime.
- The GLUT_API_VERSION has been bumped to 5, but I haven't bumped the
- GLUT version number from 3.7 since that's probably Mark Kilgard's role.
-
- This function should probably also be able to return the address of
- GLUT functions themselves, but it doesn't do that yet.
-
-
-
-XXX Things To Do Yet XXXX
--------------------------
-
-isosurf with vertex program exhibits some missing triangles (probably
-when recycling the vertex buffer for long prims).
-
-
-
-Porting Info
-------------
-
-If you're porting a DRI or other driver from Mesa 4.0.x to Mesa 4.1 here
-are some things to change:
-
-1. ctx->Texture._ReallyEnabled is obsolete.
-
- Since there are now 5 texture targets (1D, 2D, 3D, cube and rect) that
- left room for only 6 units (6*5 < 32) in this field.
- This field is being replaced by ctx->Texture._EnabledUnits which has one
- bit per texture unit. If the bit k of _EnabledUnits is set, that means
- ctx->Texture.Unit[k]._ReallyEnabled is non-zero. You'll have to look at
- ctx->Texture.Unit[k]._ReallyEnabled to learn if the 1D, 2D, 3D, cube or
- rect texture is enabled for unit k.
-
- This also means that the constants TEXTURE1_*, TEXTURE2_*, etc are
- obsolete.
-
- The tokens TEXTURE0_* have been replaced as well (since there's no
- significance to the "0" part:
-
- old token new token
- TEXTURE0_1D TEXTURE_1D_BIT
- TEXTURE0_2D TEXTURE_2D_BIT
- TEXTURE0_3D TEXTURE_3D_BIT
- TEXTURE0_CUBE TEXTURE_CUBE_BIT
- <none> TEXTURE_RECT_BIT
-
- These tokens are only used for the ctx->Texture.Unit[i].Enabled and
- ctx->Texture.Unit[i]._ReallyEnabled fields. Exactly 0 or 1 bits will
- be set in _ReallyEnabled at any time!
-
- Q: "What's the purpose of Unit[i].Enabled vs Unit[i]._ReallyEnabled?"
- A: The user can enable GL_TEXTURE_1D, GL_TEXTURE_2D, etc for any
- texure unit all at once (an unusual thing to do).
- OpenGL defines priorities that basically say GL_TEXTURE_2D has
- higher priority than GL_TEXTURE_1D, etc. Also, just because a
- texture target is enabled by the user doesn't mean we'll actually
- use that texture! If a texture object is incomplete (missing mip-
- map levels, etc) it's as if texturing is disabled for that target.
- The _ReallyEnabled field will have a bit set ONLY if the texture
- target is enabled and complete. This spares the driver writer from
- examining a _lot_ of GL state to determine which texture target is
- to be used.
-
-
-2. Tnl tokens changes
-
- During the implementation of GL_NV_vertex_program some of the vertex
- buffer code was changed. Specifically, the VERT_* bits defined in
- tnl/t_context.h have been renamed to better match the conventions of
- GL_NV_vertex_program. The old names are still present but obsolete.
- Drivers should use the newer names.
-
- For example: VERT_RGBA is now VERT_BIT_COLOR0 and
- VERT_SPEC_RGB is now VERT_BIT_COLOR1.
-
-
-
-3. Read/Draw Buffer changes
-
- The business of setting the current read/draw buffers in Mesa 4.0.x
- was complicated. It's much simpler now in Mesa 4.1.
-
- Here are the changes:
-
- - Renamed ctx->Color.DrawDestMask to ctx->Color._DrawDestMask
- - Removed ctx->Color.DriverDrawBuffer
- - Removed ctx->Pixel.DriverReadBuffer
- - Removed ctx->Color.MultiDrawBuffer
- - Removed ctx->Driver.SetDrawBuffer()
- - Removed swrast->Driver.SetReadBuffer().
- - Added ctx->Color._DrawDestMask - a bitmask of FRONT/BACK_LEFT/RIGHT_BIT
- values to indicate the current draw buffers.
- - Added ctx->Pixel._ReadSrcMask to indicate the source for pixel reading.
- The value is _one_ of the FRONT/BACK_LEFT/RIGHT_BIT values.
- - Added ctx->Driver.DrawBuffer() and ctx->Driver.ReadBuffer().
- These functions exactly correspond to glDrawBuffer and glReadBuffer calls.
- Many drivers will set ctx->Driver.DrawBuffer = _swrast_DrawBuffer and
- leave ctx->Draw.ReadBuffer NULL.
- DRI drivers should implement their own function for ctx->Driver.DrawBuffer
- and use it to set the current hardware drawing buffer. You'll probably
- also want to check for GL_FRONT_AND_BACK mode and fall back to software.
- Call _swrast_DrawBuffer() too, to update the swrast state.
- - Added swrast->Driver.SetBuffer().
- This function should be implemented by all device drivers that use swrast.
- Mesa will call it to specify the buffer to use for span reading AND
- writing and point/line/triangle rendering.
- There should be no confusion between current read or draw buffer anymore.
- - Added swrast->CurrentBuffer to indicate which color buffer to read/draw.
- Will be FRONT_LEFT_BIT, BACK_LEFT_BIT, FRONT_RIGHT_BIT or BACK_RIGHT_BIT.
- This value is usually passed to swrast->Driver.SetBuffer().
-
-
-4. _mesa_create_context() changes. This function now takes a pointer to
- a __GLimports object. The __GLimports structure contains function
- pointers to system functions like fprintf(), malloc(), etc.
- The _mesa_init_default_imports() function can be used to initialize
- a __GLimports object. Most device drivers (like the DRI drivers)
- should use this.
-
-
-5. In tnl's struct vertex_buffer, the field "ProjectedClipCoords"
- has been replaced by "NdcPtr" to better match the OpenGL spec's
- terminology.
-
-
-6. Since GL_EXT_stencil_two_side has been implemented, many of the
- ctx->Stencil fields are now 2-element arrays. For example,
- "GLenum Ref" is now "GLenum Ref[2]" The [0] elements are the front-face
- values and the [1] elements are the back-face values.
- ctx->Stencil.ActiveFace is 0 or 1 to indicate the current face for
- the glStencilOp/Func/Mask() functions.
- ctx->Stencil.TestTwoSide controls whether or not 1 or 2-sided stenciling
- is enabled.
-
-
-7. Removed ctx->Polygon._OffsetAny. Removed ctx->Polygon.OffsetMRD.
-
-
-8. GLfloat / GLchan changes:
-
- - Changed ctx->Driver.ClearColor() to take GLfloat[4] instead of GLchan[4].
- ctx->Color.ClearColor is now GLfloat[4] too.
- - Changed ctx->Driver.AlphaRef() to take GLfloat instead of GLchan.
- - ctx->Color.AlphaRef is now GLfloat.
- - texObj->BorderColor is now GLfloat[4]. texObj->_BorderChan is GLchan[4].
-
- This is part of an effort to remove all GLchan types from core Mesa so
- that someday we can support 8, 16 and 32-bit color channels dynamically
- at runtime, instead of at compile-time.
-
-
-9. GLboolean ctx->Tranform.ClipEnabled[MAX_CLIP_PLANES] has been replaced
- by GLuint ctx->Transform.ClipPlanesEnabled. The later is a bitfield.
-
-
-10. There's a new matrix_stack type in mtypes.h used for the Modelview,
- Projection, Color and Texcoord matrix stacks.
-
-
-11. The ctx->Current.* fields have changed a lot. Now, there's a
- ctx->Current.Attrib[] array for all vertex attributes which matches
- the NV vertex program conventions.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-4.1,v 1.1.1.5 2004/08/12 23:43:27 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-5.0 b/nx-X11/extras/Mesa/docs/RELNOTES-5.0
deleted file mode 100644
index f83e9e35b..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-5.0
+++ /dev/null
@@ -1,85 +0,0 @@
-
- Mesa 5.0 release notes
-
- November 13, 2002
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Even-numbered versions (such as 5.0) designate stable releases.
-Odd-numbered versions (such as 4.1) designate new developmental releases.
-
-Mesa 5.0 is basically just a stabilization of Mesa 4.1. To see a list of
-bug fixes, etc. see the VERSIONS file.
-
-
-
-New Features in Mesa 5.0
-------------------------
-
-Mesa 5.0 supports OpenGL 1.4. Note Mesa's versioning convention:
-
- OpenGL Version Mesa Version
- ------------------------------
- 1.0 1.x
- 1.1 2.x
- 1.2 3.x
- 1.3 4.x
- 1.4 5.x
-
-OpenGL 1.4 (and Mesa 5.0) incorporates the following OpenGL extensions as
-standard features:
-
- GL_ARB_depth_texture
- GL_ARB_shadow
- GL_ARB_texture_env_crossbar
- GL_ARB_texture_mirror_repeat
- GL_ARB_window_pos
- GL_EXT_blend_color
- GL_EXT_blend_func_separate
- GL_EXT_blend_logic_op
- GL_EXT_blend_minmax
- GL_EXT_blend_subtract
- GL_EXT_fog_coord
- GL_EXT_multi_draw_arrays
- GL_EXT_point_parameters
- GL_EXT_secondary_color
- GL_EXT_stencil_wrap
- GL_SGIS_generate_mipmap
-
-
-
-Device Driver Status
---------------------
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of these drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.4
-OSMesa (off-screen) implements OpenGL 1.4
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.4
-DOS/DJGPP implements OpenGL 1.3
-GGI implements OpenGL 1.3
-DOS implements OpenGL 1.4
-BeOS needs updating (underway)
-Allegro needs updating
-D3D needs updating
-
-Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the
-driver call the _mesa_enable_1_4_extensions() function.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-5.0,v 1.1.1.5 2004/08/12 23:43:28 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-5.0.1 b/nx-X11/extras/Mesa/docs/RELNOTES-5.0.1
deleted file mode 100644
index d84b46464..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-5.0.1
+++ /dev/null
@@ -1,46 +0,0 @@
-
- Mesa 5.0.1 release notes
-
- March 30, 2003
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Even-numbered versions (such as 5.0.x) designate stable releases.
-Odd-numbered versions (such as 4.1.x) designate new developmental releases.
-
-Mesa 5.0.1 just fixes bugs found since the 5.0 release. See the VERSIONS
-file for details.
-
-
-Device Driver Status
---------------------
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of these drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.4
-OSMesa (off-screen) implements OpenGL 1.4
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.4
-DJGPP implements OpenGL 1.4
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.4
-Allegro needs updating
-D3D needs updating
-
-Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the
-driver call the _mesa_enable_1_4_extensions() function.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-5.0.1,v 1.1.1.6 2004/08/12 23:43:28 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-5.0.2 b/nx-X11/extras/Mesa/docs/RELNOTES-5.0.2
deleted file mode 100644
index 3d3a5e5d9..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-5.0.2
+++ /dev/null
@@ -1,46 +0,0 @@
-
- Mesa 5.0.2 release notes
-
- September 5, 2003
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Even-numbered versions (such as 5.0.x) designate stable releases.
-Odd-numbered versions (such as 4.1.x) designate new developmental releases.
-
-Mesa 5.0.2 just fixes bugs found since the 5.0.1 release. See the VERSIONS
-file for details.
-
-
-Device Driver Status
---------------------
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of these drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.4
-OSMesa (off-screen) implements OpenGL 1.4
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.4
-DJGPP implements OpenGL 1.4
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.4
-Allegro needs updating
-D3D needs updating
-
-Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the
-driver call the _mesa_enable_1_4_extensions() function.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-5.0.2,v 1.1.1.6 2004/08/12 23:43:28 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-5.1 b/nx-X11/extras/Mesa/docs/RELNOTES-5.1
deleted file mode 100644
index aed6e102b..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-5.1
+++ /dev/null
@@ -1,279 +0,0 @@
-
- Mesa 5.1 release notes
-
- December 17, 2003
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Even-numbered versions (such as 5.0) designate stable releases.
-Odd-numbered versions (such as 5.1) designate new developmental releases.
-
-
-Bug fixes
----------
-See the VERSIONS file for a list of bugs fixed in this release.
-
-
-
-New Features in Mesa 5.1
-------------------------
-
-GL_ARB_vertex_program / GL_ARB_fragment_program
- Michal Krol and Karl Rasche implemented these extensions. Thanks!
- Be aware that there may be some rough edges and lurking bugs.
-
-GL_ATI_texture_env_combine3 extension
- This adds a few new texture combine modes.
- Contributed by Ian Romanick.
-
-GL_SGI_texture_color_table
- Adds a color table lookup to the RGBA texture path. There's a separate
- color table for each texture unit.
- Contributed by Eric Plante.
-
-GL_NV_fragment_program
- NVIDIA's fragment-level programming feature.
- Possible lurking bugs:
- - the DDX and DDY commands aren't fully tested
- - there may be bugs in the parser
- - the TEX and TXP instructions both do perspective correction
- - the pack/unpack instructions may not be correct
-
-GL_EXT_depth_bounds_test
- This extension adds a scissor-like test for the Z axis. It's used to
- optimize stencil-volume shadow algorithms.
-
-GL_NV_light_max_exponent
- Lifts the 128 limit for max light exponent.
-
-GL_EXT_texture_rectangle
- Identical to GL_NV_texture_rectangle
-
-GL_ARB_occlusion_query
- Useful for visibility-based culling.
-
-GL_ARB_texture_non_power_of_two
- Removes the restriction that texture dimensions must be powers of two.
-
-GL_ARB_vertex_buffer_object
- Allows server-side vertex arrays, optimized host/card data transfers, etc.
-
-GL_ARB_point_sprite
- ARB-approved version of GL_NV_point_sprite. Basically allows textures
- to be applied to points.
-
-GL_IBM_multimode_draw_arrays
- Allows multiple vertex arrays to be drawn with one call, including arrays
- of different types of primitives.
-
-GL_SUN_multi_draw_arrays
- An alias for GL_EXT_multi_draw_arrays, standard in OpenGL 1.4.
-
-Faster glDrawPixels / glCopyPixels in X11 driver
- If your X screen is 32bpp, glDrawPixels to the front color buffer will
- be accelerated (via XPutImage()) if the image format is GL_BGRA and the
- type is GL_UNSIGNED_BYTE. No raster operations, such as depth test,
- blend, fog, etc. can be enabled.
-
- If your X screen is 16bpp, glDrawPixels to the front color buffer will
- be accelerated (via XPutImage()) if the image format is GL_RGB and the
- type is GL_UNSIGNED_SHORT_5_6_5. No raster operations, such as depth
- test, blend, fog, etc. can be enabled.
-
- glCopyPixels() calls for the front color buffer will be accelerated
- (via XCopyArea()) if no raster operations, such as depth test, blend,
- fog, pixel zoom, etc. are enabled.
-
- The speed-up over typical software rendering is a factor of 10 for
- glDrawPixels and 100 for glCopyPixels.
-
-
-With the addition of GL_ARB_occlusion_query, GL_ARB_vertex_buffer_object,
-GL_ARB_texture_non_power_of_two and GL_EXT_shadow_funcs, Mesa 5.1 supports
-all the new features of OpenGL 1.5. Mesa 6.0 (the next stable release)
-will advertise GL_VERSION = "1.5".
-
-
-
-Vertex/Fragment program debugger
---------------------------------
-
-GL_MESA_program_debug is an experimental extension to support
-interactive debugging of vertex and fragment programs. See the
-docs/MESA_program_debug.spec file for details.
-
-The bulk of the vertex/fragment program debugger is implemented
-outside of Mesa. The GL_MESA_program_debug extension just has minimal
-hooks for stopping running programs and inspecting programs.
-
-The progs/tests/debugger.c (only in CVS) program is an example of how
-the extension can be used. Presently, the debugger code and demo code
-is in the same file. Eventually the debugger code should be moved
-into a reusable module.
-
-As it is now, the demo lets you set breakpoings in vertex/fragment
-programs, single step, and print intermediate register values. It's
-basically just a proof of concept.
-
-
-
-Directory tree reorganization
------------------------------
-
-The directory structure for Mesa has been overhauled to improve its layout.
-All source code for Mesa, GLU, GLUT, etc is now under the src/ directory
-in appropriate subdirectories.
-
-The Mesa source code and drivers has been reorganized under src/mesa/.
-
-All demonstration programs and tests are now in subdirectories under progs/.
-
-
-
-Build System Changes
---------------------
-
-The GNU automake/autoconf support has been removed. As it was, it seldom
-worked on anything but Linux. The Mesa developers aren't big fans of
-automake/autoconf/libtool and didn't have the time to maintain it.
-If someone wants to contribute new automake/autoconf support (and is
-willing to maintain it), it may be re-incorporated into Mesa, subject
-to some requirements.
-
-The "old style" makefile system has been updated:
- 1. Make-config has been trimmed down to fewer, modern configurations.
- 2. Most of the bin/mklib.* scripts have been rolled into a new "mklib"
- script that works on all sorts of systems. There are probably some
- bugs in it, but it's been tested on Linux, SunOS 5.8 and IRIX 6.5.
- Improvements/contributes are greatly appreciated.
- 3. The Makefile.X11 files have been cleaned up in various ways
-
-
-
-Source File Changes
--------------------
-
-The mmath.[ch] files are obsolete. Their contents have been moved
-into the imports.[ch] and macros.[ch] files.
-
-The files related to vertex and fragment programming have changed.
-Old files:
- vpexec.[ch]
- vpparse.[ch]
- vpstate.[ch]
-New files:
- program.[ch] - generic ARB/NV program code
- arbprogram.[ch] - ARB program API functions
- arbfragparse.[ch] - ARB fragment program parsing
- arbvertparse.[ch] - ARB vertex program parsing
- arbparse.[ch] - ARB vertex/fragment parsing
- arbparse_syn.h - vertex/fragment program syntax
- nvprogram.[ch] - NV program API functions
- nvvertprog.h - NV vertex program definitions
- nvfragprog.h - NV fragment program definitions
- nvvertparse.[ch] - NV vertex program parser
- nvfragparse.[ch] - NV fragment program parser
- nvvertexec.[ch] - NV vertex program execution
- swrast/s_nvfragprog.[ch] - NV fragment program execution
-
-The files related to per-vertex handling have changed.
-Old files:
- tnl/t_eval_api.c - old per-vertex code
- tnl/t_imm_alloc.c - old per-vertex code
- tnl/t_imm_api.c - old per-vertex code
- tnl/t_imm_debug.c - old per-vertex code
- tnl/t_imm_dlist.c - old per-vertex code
- tnl/t_imm_elt.c - old per-vertex code
- tnl/t_imm_eval.c - old per-vertex code
- tnl/t_imm_exec.c - old per-vertex code
- tnl/t_imm_fixup.c - old per-vertex code
- tnl/t_vtx_sse.c - old per-vertex code
- tnl/t_vtx_x86.c - old per-vertex code
-New files:
- tnl/t_save_api.c - new per-vertex code
- tnl/t_save_loopback.c - new per-vertex code
- tnl/t_save_playback.c - new per-vertex code
- tnl/t_vtx_eval.c - old per-vertex code
-
-Other new files:
- bufferobj.[ch] - GL_ARB_vertex_buffer_object functions
- version.h - defines the Mesa version info
-
-Other removed files:
- swrast/s_histogram.[ch] - moved into src/histogram.c
-
-
-
-Other Changes
--------------
-
-The ctx->Driver.CreateTexture function has been removed - it wasn't used.
-
-New device driver hook functions:
- NewTextureObject - used to allocate struct gl_texture_objects
- NewTextureImage - used to allocate struct gl_texture_images
-
-New ctx->Texture._EnabledCoordUnits field:
- With the addition of GL_NV_fragment_program we may need to interpolate
- various sets of texture coordinates even when the corresponding texture
- unit is not enabled. That is, glEnable(GL_TEXTURE_xD) may never get
- called but we still may have to interpolate texture coordinates across
- triangles so that the fragment program will get them.
- This new field indicates which sets of texture coordinates are needed.
- If a bit is set in the ctx->Texture._EnabledUnits bitmask is set, the
- same bit MUST be set in ctx->Texture._EnabledCoordUnits.
-
-The ctx->_TriangleCaps field is deprecated.
- Instead of testing the DD_* bits in _TriangleCaps, you should instead
- directly test the relevant state variables, or use one of the helper
- functions like NEED_SECONDARY_COLOR() at the bottom of context.h
- While testing _TriangleCaps bits was fast, it was kludgey, and setting
- the bits in the first place could be error prone.
-
-New vertex processing code.
- The code behind glBegin, glEnd, glVertex, glNormal, etc. has been
- totally rewritten. It's a cleaner implementation now and should use
- less memory. (Keith)
-
-
-
-To Do
------
-Add screen-awareness to fakeglx.c
-
-
-
-
-Device Driver Status
---------------------
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of these drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.4
-OSMesa (off-screen) implements OpenGL 1.4
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.4
-DJGPP implements OpenGL 1.4
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.4
-Allegro needs updating
-D3D needs updating
-
-Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the
-driver call the _mesa_enable_1_4_extensions() function.
-
-
-----------------------------------------------------------------------
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.0 b/nx-X11/extras/Mesa/docs/RELNOTES-6.0
deleted file mode 100644
index c154472af..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.0
+++ /dev/null
@@ -1,87 +0,0 @@
-
- Mesa 6.0 release notes
-
- January 16, 2004
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 5.1) designate new developmental releases.
-Even numbered versions (such as 6.0) designate stable releases.
-
-Mesa version 6.0 signifies two things:
-
- 1. A stabilization of the 5.1 development release
- 2. Implementation of the OpenGL 1.5 specification. When you query
- glGetString(GL_VERSION) "1.5" will be returned (as long as the
- driver supports all the required features).
-
-
-Note that the Mesa major version number is incremented with the OpenGL
-minor version number:
-
- Mesa 1.x == OpenGL 1.0
- Mesa 2.x == OpenGL 1.1
- Mesa 3.x == OpenGL 1.2
- Mesa 4.x == OpenGL 1.3
- Mesa 5.x == OpenGL 1.4
- Mesa 6.x == OpenGL 1.5
-
-
-
-New Features
-------------
-
-Mesa 5.1 already had all the new features of OpenGL 1.5, implemented as
-extensions. These extensions were simply promoted to standard features:
-
- GL_ARB_occlusion_query extension
- GL_ARB_texture_non_power_of_two extension
- GL_ARB_vertex_buffer_object extension
- GL_EXT_shadow_funcs
-
-
-
-Device Drivers
---------------
-
-Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on
-the device driver. For example, if the driver enables all the ARB
-extensions which are part of OpenGL 1.3 then glGetString(GL_VERSION)
-will return "1.3". Otherwise, it'll return "1.2".
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of the drivers.
-Here's the current status of all included drivers:
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-
-
-Other Changes
--------------
-
-See the VERSIONS file for more details about bug fixes, etc. in Mesa 6.0.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.0,v 1.1.1.3 2004/08/12 23:43:28 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.0.1 b/nx-X11/extras/Mesa/docs/RELNOTES-6.0.1
deleted file mode 100644
index 063d6f2d4..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.0.1
+++ /dev/null
@@ -1,50 +0,0 @@
-
- Mesa 6.0.1 release notes
-
- April 2, 2003
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Even-numbered versions (such as 6.0.x) designate stable releases.
-Odd-numbered versions (such as 6.1.x) designate new developmental releases.
-
-Mesa 6.0.1 just fixes bugs found since the 6.0 release. See the VERSIONS
-file for details.
-
-
-
-Device Drivers
---------------
-
-Mesa advertises itself as supporting OpenGL 1.2, 1.3, 1.4 or 1.5
-depending on the device driver's capabilities. For example, if the
-driver enables all the ARB extensions which are part of OpenGL 1.5
-then glGetString(GL_VERSION) will return "1.5". Otherwise, it'll
-return "1.4" or the next lower version that implements all required
-functionality.
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of the drivers.
-Here's the current status of all included drivers:
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-FX (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.0.1,v 1.1.1.3 2004/08/12 23:43:28 anholt Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.1 b/nx-X11/extras/Mesa/docs/RELNOTES-6.1
deleted file mode 100644
index 3ae3f02c8..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.1
+++ /dev/null
@@ -1,112 +0,0 @@
-
- Mesa 6.1 release notes
-
- August 18, 2004
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.1) designate new developmental releases.
-Even numbered versions (such as 6.0) designate stable releases.
-
-
-New Features
-------------
-
-Half-precision floating point (GLhalf) pixel formats are supported
-in Mesa, but the feature isn't exposed yet since the ARB extension
-hasn't been finalized yet.
-
-
-Texture image handling
-----------------------
-
-The code which implements image conversion, pixel transfer ops, etc
-for glTexImage commands has been rewritten.
-
-Now the gl_texture_format struct has a new StoreImage function
-pointer. Each texture format must implement this function. The
-function is totally responsible for converting the user's texture
-image into the specific format. A few helper functions makes this
-relatively simple.
-
-Overall, the code is much simpler, cleaner and easier to work with
-now. Adding new texture formats is straight-forward and there's no
-longer any distinction between "hardware" and "software" formats.
-
-Finally, the code for compressed texture images has been reorganized
-as well.
-
-Removed files:
- texutil.c
- texutil.h
- texutil_tmp.h
-
-New files:
- texcompress_s3tc.c
- texcompress_fxt1.c
-
-
-
-Driver / context changes
-------------------------
-
-The _mesa_create_context() and _mesa_initialize_context() function
-parameters have changed. They now take a pointer to a struct
-dd_function_table. Drivers can initialize this table by calling
-_mesa_init_driver_functions(). Drivers should then plug in the special
-functions they implement. In particular, the ctx->Driver.NewTextureObject
-pointer _must_ be set so that the default texture objects created in
-_mesa_create/initialize_context() are correctly built.
-
-The _mesa_init_driver_functions() function allows a lot of redundant code
-to be removed from the device drivers (such as initializing
-ctx->Driver.Accum to point to _swrast_Accum). Adding new functions to
-the dd_function_table can be done with less hassle since the pointer can
-be initialized in _mesa_init_driver_functions() rather than in _all_ the
-drivers.
-
-
-Device Drivers
---------------
-
-Mesa advertises itself as supporting OpenGL 1.2, 1.3, 1.4 or 1.5
-depending on the device driver's capabilities. For example, if the
-driver enables all the ARB extensions which are part of OpenGL 1.5
-then glGetString(GL_VERSION) will return "1.5". Otherwise, it'll
-return "1.4" or the next lower version that implements all required
-functionality.
-
-A number of Mesa's software drivers haven't been actively maintained for
-some time. We rely on volunteers to maintain many of the drivers.
-Here's the current status of all included drivers:
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-
-Other Changes
--------------
-
-See the VERSIONS file for more details about bug fixes, etc. in Mesa 6.1.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.1,v 1.1.1.4 2004/08/28 04:27:00 kem Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.2 b/nx-X11/extras/Mesa/docs/RELNOTES-6.2
deleted file mode 100644
index ad931d065..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.2
+++ /dev/null
@@ -1,52 +0,0 @@
-
- Mesa 6.2 release notes
-
- October 2, 2004
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.1) designate new developmental releases.
-Even numbered versions (such as 6.2) designate stable releases.
-
-
-This release primarily just fixes bugs found in the Mesa 6.1 release.
-See the VERSIONS file for details.
-
-
-ToDo: PBO for polygon stipple, convolution filter, etc.
-
-
-
-Known Issues
-------------
-
-The GL_EXT_pixel_buffer_object extension isn't fully implemented for
-functions like glPolygonStipple, glConvolutionFilter, glColorTable,
-etc. The important functions like glRead/DrawPixels, glTex[Sub]Image,
-and glBitmap work with PBOs.
-
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.2,v 1.1.1.2 2005/07/31 16:45:50 ajax Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.2.1 b/nx-X11/extras/Mesa/docs/RELNOTES-6.2.1
deleted file mode 100644
index ec33f9113..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.2.1
+++ /dev/null
@@ -1,50 +0,0 @@
-
- Mesa 6.2.1 release notes
-
- December 9, 2004
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.1) designate new developmental releases.
-Even numbered versions (such as 6.2.x) designate stable releases.
-
-
-This release primarily just fixes bugs found in the Mesa 6.2 release.
-See the VERSIONS file for details.
-
-
-
-Known Issues
-------------
-
-The GL_EXT_pixel_buffer_object extension isn't fully implemented for
-functions like glPolygonStipple, glConvolutionFilter, glColorTable,
-etc. The important functions like glRead/DrawPixels, glTex[Sub]Image,
-and glBitmap work with PBOs. This has been fixed for Mesa 6.3.
-
-
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.2.1,v 1.1.1.2 2005/07/31 16:45:45 ajax Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.3 b/nx-X11/extras/Mesa/docs/RELNOTES-6.3
deleted file mode 100644
index c61fa98a6..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.3
+++ /dev/null
@@ -1,115 +0,0 @@
-
- Mesa 6.3 release notes
-
- July 20, 2005
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.3) designate new developmental releases.
-Even numbered versions (such as 6.2) designate stable releases.
-
-
-
-New Features
-------------
-
-GL_ARB_draw_buffers - allows a fragment program to write to a number of
- separate color buffers, instead of just one.
-
-GL_OES_read_format - allows one to query the fastest glReadPixels format
- and datatype.
-
-GL_ARB_pixel_buffer_object - buffer objects for pixel read/write functions.
-
-GL_EXT_framebuffer_object - allows render-to-texture and provides a
- window-system indepedent Pbuffer facility.
- The Mesa CVS tree contains a couple tests of this extension.
-
-DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb
-for details.
-
-
-
-Vertex/Fragment Program PRINT Instruction
------------------------------------------
-
-The GL_NV_vertex_program and GL_NV_fragment_program languages have been
-extended with a PRINT instruction.
-
-
-
-glDeleteTextures(), glDeletePrograms() and glDeleteBuffers() Changed
---------------------------------------------------------------------
-
-To match the behaviour of other OpenGL implementations, glDeleteTextures,
-glDeletePrograms and glDeleteBuffers have been modified so that:
-
- * The named texture/program/buffer ID is immediately freed for re-use.
-
- * The actual texture object, program or buffers isn't really deleted until
- it is no longer bound in any rendering context (the reference count
- is zero).
-
-Previously, the texture/program/buffer ID wasn't freed until the object
-was really deleted.
-
-Note that textures, programs and buffers can be shared by several rendering
-contexts so they can't be deleted until they're unbound in _all_ contexts.
-
-
-
-GL_EXT_framebuffer_object changes
----------------------------------
-
-Implementing this extension involved changing a lot of code (for the better).
-
-The gl_framebuffer object now a collection of gl_renderbuffer objects.
-Renderbuffers may store colors, stencil indices, or depth values. The
-gl_framebuffer and gl_renderbuffer types are object-oriented in design.
-
-All the old RGB, color index, stencil and depth-related span functions for
-reading/writing pixels from/to buffers has changed. Now, all pixels are
-read/written through a set of common renderbuffer functions (methods).
-
-Most device drivers have been updated for these changes, but some haven't.
-
-
-
-To Do (someday) items
----------------------
- Switch to freeglut
- Increase MAX_DRAWBUFFERS
- driver hooks for BeginQuery/EndQuery
-
-
-
-Miscellaneous
--------------
-
-The main/get.c file is now generated with a Python script (get_gen.py).
-
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.3,v 1.1.1.1 2005/07/31 16:45:49 ajax Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.3.1 b/nx-X11/extras/Mesa/docs/RELNOTES-6.3.1
deleted file mode 100644
index 7d2e4d030..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.3.1
+++ /dev/null
@@ -1,49 +0,0 @@
-
- Mesa 6.3.1 release notes
-
- July XX, 2005
-
- PLEASE READ!!!!
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.3) designate new developmental releases.
-Even numbered versions (such as 6.2) designate stable releases.
-
-
-
-DRI drivers
------------
-
-This release includes the DRI drivers and GLX code for hardware rendering.
-
-
-
-Bug fixes
----------
-
-Bugs fixed in 6.3.1 are listed in the VERSIONS file.
-
-
-
-Driver Status
----------------------- ---------------------
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.3.1,v 1.1.1.1 2005/07/31 16:45:45 ajax Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.3.2 b/nx-X11/extras/Mesa/docs/RELNOTES-6.3.2
deleted file mode 100644
index 7cdb08131..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.3.2
+++ /dev/null
@@ -1,37 +0,0 @@
-
- Mesa 6.3.2 Release Notes
-
- August 19, 2005
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.3) designate new developmental releases.
-Even numbered versions (such as 6.2) designate stable releases.
-
-
-6.3.2 is primarily a bug-fix release. See the VERSIONS file for details.
-
-
-
-Driver Status
----------------------- ----------------------
-DRI drivers varies with the driver
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) implements OpenGL 1.3
-SVGA implements OpenGL 1.3
-Wind River UGL implements OpenGL 1.3
-Windows/Win32 implements OpenGL 1.5
-DJGPP implements OpenGL 1.5
-GGI implements OpenGL 1.3
-BeOS implements OpenGL 1.5
-Allegro needs updating
-D3D needs updating
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.3.2,v 1.1.1.1 2005/10/18 02:51:43 kem Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.4 b/nx-X11/extras/Mesa/docs/RELNOTES-6.4
deleted file mode 100644
index b9ab4975e..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.4
+++ /dev/null
@@ -1,50 +0,0 @@
-
- Mesa 6.4 Release Notes
-
- October 24, 2005
-
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.3) designate new developmental releases.
-Even numbered versions (such as 6.4) designate stable releases.
-
-
-6.4 is a bug-fix release. See the VERSIONS file for details.
-
-
-
-GLUT tarball
-------------
-
-Starting with 6.4, the GLUT library sources are distributed in a separate
-tarball. This was done at the request of Linux distro vendors who prefer
-to use freeglut.
-
-
-
-
-Driver Status
----------------------- ----------------------
-DRI drivers varies with the driver
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Windows/Win32 implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) requires updates
-SVGA requires updates
-DJGPP requires updates
-GGI requires updates
-BeOS requires updates
-Allegro requires updates
-D3D requires updates
-
-The drivers which require updates mostly need to be updated to work
-with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
-in Mesa 6.3.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.4,v 1.1.1.2 2005/11/09 01:13:43 kem Exp $
diff --git a/nx-X11/extras/Mesa/docs/RELNOTES-6.4.1 b/nx-X11/extras/Mesa/docs/RELNOTES-6.4.1
deleted file mode 100644
index 0386f6026..000000000
--- a/nx-X11/extras/Mesa/docs/RELNOTES-6.4.1
+++ /dev/null
@@ -1,47 +0,0 @@
-
- Mesa 6.4.1 Release Notes
-
-
-Introduction
-------------
-
-Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.3) designate new developmental releases.
-Even numbered versions (such as 6.4) designate stable releases.
-
-
-6.4.1 is a bug-fix release. See the VERSIONS file for details.
-
-
-
-GLUT tarball
-------------
-
-Starting with 6.4, the GLUT library sources are distributed in a separate
-tarball. This was done at the request of Linux distro vendors who prefer
-to use freeglut.
-
-
-
-
-Driver Status
----------------------- ----------------------
-DRI drivers varies with the driver
-XMesa (Xlib) implements OpenGL 1.5
-OSMesa (off-screen) implements OpenGL 1.5
-Windows/Win32 implements OpenGL 1.5
-Glide (3dfx Voodoo1/2) requires updates
-SVGA requires updates
-DJGPP requires updates
-GGI requires updates
-BeOS requires updates
-Allegro requires updates
-D3D requires updates
-
-The drivers which require updates mostly need to be updated to work
-with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
-in Mesa 6.3.
-
-
-----------------------------------------------------------------------
-$Id: RELNOTES-6.4.1,v 1.1.1.1 2005/12/01 03:11:29 kem Exp $
diff --git a/nx-X11/extras/Mesa/docs/VERSIONS b/nx-X11/extras/Mesa/docs/VERSIONS
deleted file mode 100644
index 52d394bd4..000000000
--- a/nx-X11/extras/Mesa/docs/VERSIONS
+++ /dev/null
@@ -1,1423 +0,0 @@
-
-
-Mesa Version History
-====================
-
-1.0 beta February 1995
- Initial release
-
-1.1 beta March 4, 1995
- Changes:
- faster point and line drawing (2x faster)
- more systems supported, better Makefiles
- Renamed lib*.a files to avoid collisions
- many small bug fixes
- New:
- pseudo-GLX functions added
- new implementation of evaluators (eval2.c)
- GLUT support
-
-1.1.1 beta March 7, 1995
- Changes:
- Reverted from eval2.c to eval.c due to FPE on Linux
- more speed improvements
- more Makefile changes
-
-1.1.2 beta March 14, 1995
- New:
- implementation of SGI's blending extensions
- glXUseXFont implemented
- added MESA_DEBUG environment variable support
- Changes:
- Using eval2.c again
- more FPE-prevention checks (0-length normals are OK)
- a few small bug fixes
- much faster pixel logic ops!
- faster transformation arithmetic
-
-1.1.3 beta March 31, 1995
- New:
- gluScaleImage() and gluBuild2DMipMaps() implemented
- Mesa widgets for Xt/Motif
- blendEXT demos
- added environment variables for selecting visuals
- Changes:
- almost all GLUT demos work correctly now
- faster X device driver functions
- more bug fixes
-
-1.1.4 beta April 20, 1995
- Bug fixes:
- - missing #define SEEK_SET in src-tk/image.c
- - compile glShadeModel into display lists
- - fixed pow() domain error in src/light.c
- - fixed "flickering bitmaps" in double buffer mode
- - fixed tk.h and aux.h for C++
- - state of LIGHT_MODEL_LOCAL_VIEWER was inverted
- New features:
- - MUCH, MUCH nicer dithering in 8-bit RGB mode
- - updated widgets and widget demos
- - Implemented GLXPixmap functions
- - Added GLU 1.1 and GLX 1.1 functions
- - Changed the X/Mesa interface API, more versatile
- - Implemented gluPartialDisk()
-
-1.2 May 22, 1995
- Bug fixes:
- - IRIX 4.x makefile problem
- - modified tk to share root colormap as needed
- - gluLookAt normalization problem
- - suppress Expose, NoExpose events in swapbuffers
- - glBitmap() and glDrawPixels() clipping
- New features:
- - GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture
- modes implemented
- - texture maps stored more efficiently
- - texture maps can be compiled into display lists
- - Bogdan Sikorski's GLU polygon tesselation code
- - Linas Vepstas's sweep and extrusion library
- - glXCreateContext()'s shareList parameter works as it's supposed to.
- XMesaCreateContext() updated to accept a shareList parameter too.
- - Mesa can be compiled with real OpenGL .h files
- - MESA_BACK_BUFFER environment variable
- - better GLX error checking
-
-1.2.1 June 22, 1995
- Bug fixes:
- - X/Mesa double buffer window resize crash
- - widgets now pass PointerMotion events
- - X/Mesa incorrect default clear color and drawing color
- - more robust X MIT-SHM support in X/Mesa
- - glTexImage( format=GL_LUMINANCE ) didn't work
- - GL_LINE mode polygons with line width > 1.0 could cause a crash
- - numerous feedback bugs
- - glReadPixels() from depth buffer was wrong
- - error prone depth and stencil buffer allocation
- New features:
- - Preliminary Microsoft Windows driver
- - Implemented a number of missing functions: glEvalCoord[12][df]v(),
- glGet...(), etc.
- - Added a few missing symbols to gl.h and glu.h
- - Faster rendering of smooth-shaded, RGBA, depth-buffered polygons.
- - Faster rendering of lines when width=2.0
- - Stencil-related functions now work in display lists
- Changes:
- - renamed aux.h as glaux.h (MS-DOS names can't start with aux)
- - most filenames are in 8.3 format to accomodate MS-DOS
- - use GLubytes to store arrays of colors instead of GLints
-
-1.2.2 August 2, 1995
- New features:
- - texture mapped points and lines
- - NURBS! (but not 100% complete)
- - viewports may safely extend beyond window boundaries
- - MESA_PRIVATE_CMAP environment variable
- - Grayscale X display support
- - two new demos: demos/gears.c and demos/shadow.c
- - MachTen for Macintosh configuration
- Bug fixes:
- - glGet*(GL_DEPTH_BITS) returned bytes, not bits
- - point, line, and bitmap rasterization suffered from roundoff errors
- - fixed a division by zero error in line clippping
- - occasional wrong default background color really fixed!
- - glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work
- - gluBuild2DMipmaps malloc problem fixed
- - view volume clipping of smooth shaded lines resulted in bad colors
- Changes:
- - new visual selection method in glXChooseVisual()
- - improved GLU quadric functions
- - call XSync for glFinish and XFlush for glFlush
- - glVertex() calls now use a function pointer to avoid conditionals
- - removed contrib directory from Mesa tar file (available on ftp site)
- - AIX shared library support
- - Removed GLUenum type as it's not in OpenGL
-
-1.2.3 September 26, 1995
- New features:
- - Mesa header files now equivalent to SGI OpenGL headers
- - Support for HP's Color Recovery dithering displays
- - Faster vertex transformation
- - Faster raster operations into X windows under certain conditions
- - New configurations: HP w/ shared libs, Ultrix w/ GCC, Data General
- - 4-bit visuals now supported
- Bug fixes:
- - glScissor bug fixed
- - round-off errors in clipping lines against clip planes fixed
- - byte swapping between hosts and display servers implemented
- - glGetError() can be called without a current rendering context
- - problem with accidentally culled polygons is fixed
- - fixed some widget compilation problems
-
-1.2.4 November 17, 1995
- New features:
- - More speed improvements (lighting, fogging, polygon drawing)
- - Window system and OS-independent off-screen rendering
- - Preliminary Fortran bindings
- - glPolygonOffsetEXT implemented
- - glColorMask and glIndexMask now fully implemented
- - glPixelZoom implemented
- - display lists fully implemented
- - gamma correction
- - dithering in 8-bit TrueColor/DirectColor visuals
- Changes:
- - Improved device driver interface
- - tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk
- - Dithering support moved from core into device driver
- Bug fixes:
- - glEnable/Disable( GL_LIGHTING ) didn't always take effect
- - glReadPixels byte swapping was broken
- - glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken
- - duplicate glColor4b() prototype in GL/gl.h removed
- - stripes in wave -ci demo fixed
- - GL_LINEAR_MIPMAP_NEAREST had wrong value
- - bugs in HP Color Recovery support fixed
- - fixed bug when blending lines, points, bitmaps outside of window
-
-1.2.5 November 30, 1995
- New Features:
- - updated MS Windows driver
- - new implementation of StaticGray/GrayScale visual support
- Bug fixes:
- - pixelzooming with gamma correction or blending didn't work
- - HP color recovery visual wasn't being picked by glXChooseVisual
- - glClear didn't always observe glColorMask changes
- - olympic and offset demos didn't compile on some Suns
- - texcoord clamping wasn't correct
- - a polygon optimization introduced an occasional sampling problem
-
-1.2.6 January 26, 1996
- New Features:
- - faster line and polygon rendering under certain conditions. See
- Performance Tips 9 and 10 in README
- - profiling
- - lighting is a bit faster
- - better perspective corrected texture mapping
- - Amiga AmiWin (X11) support
- - preliminary Linux SVGA driver
- Changes:
- - now using a 16-bit depth buffer, faster, smaller
- - GL_NORMALIZE is disabled by default
- Bug fixes:
- - projective texture mapping
- - fixed a memory leak in the context destroy function
- - GL_POLYGON with less than 3 vertices caused a crash
- - glGet*() returned wrong result for GL_INDEX_MODE
- - reading pixels from an unmapped X window caused a BadMatch error
-
-1.2.7 March 5, 1996
- New:
- - faster lighting
- - faster 16-bit TrueColor rendering on Linux
- - faster 32-bit TrueColor rendering on Linux, HP, IBM
- - non-depth-buffered XImage polygons are faster
- - vertex array extension
- - software alpha planes
- - updated Macintosh driver
- - new NeXT driver
- - GLU quadric functions generate texture coordinates
- - reflect.c demo - reflective, textured surface demo
- Changes:
- - gamma correction code moved into the X driver for better performance
- Bug fixes:
- - multiple glClipPlane()'s didn't work reliably
- - glPolygonMode() didn't always work
- - glCullFace( GL_FRONT_AND_BACK ) didn't work
- - texture mapping with gamma correction was buggy
- - floating point exceptions in texture coordinate interpolation
- - XImage byte swapping didn't always work
- - polygon edge flags weren't always used correctly
-
-1.2.8 May 22, 1996
- New:
- - overlay planes on X servers with the SERVER_OVERLAY_VISUALS property
- - better monochrome output
- - more IRIX 6.x configurations
- - more robust RGB mode color allocation
- - added MESA_XSYNC environment variable
- - GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions
- - GL_MESA_window_pos extension
- - faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT
- and GL_UNSIGNED_INT
- - driver for prototype Cirrus Mondello 3-D board
- - updated AmigaDOS driver
- - a few small speed optimizations in polygon rendering
- Changes:
- - internal device driver interface modified to simplify device
- driver implementations and to support hardware Z buffers
- - several changes to the X/Mesa interface (xmesa.h)
- Bug fixes:
- - fixed pow(0,0) domain error triggered on some systems
- - glStencilClear() in a display list caused an infinite loop
- - glRasterPos*() was sometimes off by +/-0.5 in X and Y
- - color masking and blending were performed in wrong order
- - auxSolidCylinder() sometimes drew a wire-frame cylinder
- - fixed file writing bug in osdemo.c
- - pixel mapping didn't always work
- - the GL_GEQUAL stencil func didn't work
- - the GL_INVERT stencil op didn't work
- - the stencil write mask didn't work
- - glPush/PopAttrib() didn't do enough error checking
- - glIsList() didn't always work correctly
-
-2.0 October 10, 1996
- New:
- - Implements OpenGL 1.1 API functions
- - all texture filtering modes supported (mipmapping)
- - faster texture mapping, see Performance Tip 11 in README
- - antialiased RGB points
- - X support for line and polygon stippling
- - glDrawBuffer( GL_FRONT_AND_BACK ) works
- - util/ directory of useful stuff
- - demos/texobj demo of texture objects
- Changes:
- - major internal changes for thread-safeness
- - new device driver interface
- - MESA_ALPHA env variable removed
- - triangle rasterizer replaces polygon rasterizer
- Bug fixes:
- - glPopAttrib() bug
- - glDrawBuffer(GL_NONE) works now
-
-2.1 December 14, 1996
- New:
- - VMS support
- - MS-DOS driver
- - OpenStep support
- - updated, combined Windows 95/NT driver
- - implemented glGetLighti() and glGetTexGen*()
- - GLX does garbage collection of ancillary buffers
- Bug fixes:
- - removed unused _EXT constants from gl.h
- - fixed polygon offset bugs
- - Z coordinates of clipped lines were incorrect
- - glEdgeFlag() in display lists didn't always work
- - glLight*() in display lists didn't work
- - fixed X line stipple bugs (Michael Pichler)
- - glXUseXfonts XFreeFont/XFreeFontInfo bug fixed
- - fixed a feedback bug
- - glTexGen*() now transforms GL_EYE_PLANE by inverse modelview matrix
- - polygons were sometimes culled instead of clipped
- - triangle rasterizer suffered from float/int overflow exceptions
- - fixed FP underflow exception in lighting (specular exponent)
- - glEnable/glDisable of GL_EXT_vertex_array enums didn't work
- - fixed free(NULL) in GLU tesselator code
- - using 24-bit color on some X servers resulted in garbage rendering
- - 32-bit per pixel mode for XFree86 now works
- - glRotate(a,0,0,0) gave unpredictable results
- - GL_LINE_STRIP with > 480 vertices had occasional clipping problems
- - 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap
- - glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled
- - glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right
- - accumulation buffer was limited to positive values
- - projective textures didn't work
- - selection buffer overflows weren't handled correctly
- Changes:
- - restored the GL_EXT_polygon_offset extension
- - slightly faster RGB dithering
- - the SVGA driver works again
- - Amiga driver now distributed separately
- - NeXT driver updated for Mesa 2.x
-
-2.2 March 14, 1997
- New:
- - better color selection when dithering
- - added GL_EXT_texture_object extension
- - updated MS-DOS driver for DJGPP
- - added openbsd make configuration
- - faster dithered flat-shaded triangles
- - various compilation problems with Motif widgets fixed
- - gl.h, glx.h and glu.h name mangling option
- - BeOS driver
- - 3D texture mapping extension
- - GL_MESA_resize_buffers extension
- - morph3d, stex3d and spectex demos
- - 3Dfx support
- Bug fixes:
- - glColorMaterial should finally work right in all respects
- - linear interpolation of mipmap levels was incorrectly weighted
- - readpix.c didn't compile on Macintosh
- - GL_INVERT and related logic ops didn't work right
- - glTexImage[12]D() didn't check its parameters consistantly
- - fixed a memory leak in glTexImage[12]D()
- - kludged around a SunOS 5.x/GCC compiler bug in the feedback code
- - glReadPixels aborted instead of normally catching some errors
- - a few 1.1 constants were missing or misnamed in gl.h
- - glBegin(p); glBegin(q); didn't generate an error
- - fixed a memory leak in GLX code
- - clipping of concave polygons could cause a core dump
- - 1-component alpha texture maps didn't work
- - fixed a GLU polygon tesselator bug
- - polygons with colinear vertices were sometimes culled
- - feedback triangle colors were wrong when using smooth shading
- - textures with borders didn't work correctly
- - colors returned in feedback mode were wrong when using lighting
- - spotlights didn't effect ambient lighting correctly
- - gluPartialDisk() had a few bugs
- Changes:
- - device driver interface expanded to support texture mapping
- - faster matrix inversion subroutine
- - commented out #include "wmesa_extend.h" from src/wmesa.c
- - fixed many compiler warnings in the demo programs
-
-2.3 June 30, 1997
- New:
- - Mesa distribution divided into two pieces: library code and demos
- - faster vertex transformation, clip testing, lighting
- - faster line drawing
- - TrueColor visuals how have dithering (for depths < 24 bits)
- - added MESA_NO_DITHER environment variable
- - new device driver function: NearFar(), RenderVB(), RasterSetup()
- - added LynxOS configuration
- - added cygnus Win32 configuration
- - added texcyl.c GLUT demo
- - added XMesaDitherColor() to X/Mesa interface
- - new NURBS code from Bogdan Sikorski
- - added demos/shape.c (non-rectangular X window!)
- Bug fixes:
- - glEnable/DisableClientState() were missing from GL/gl.h
- - GL_SPHERE_MAP texcoord generation didn't work correctly
- - glXGetConfig() returned wrong number of depth, stencil, accum bits
- - glDrawPixels feedback/selection didn't examine RasterPos valid bit
- - black and white were reversed on some monochrome displays
- - fixed potential image memory leak (wasn't setting reference counter)
- - glDrawPixels sometimes didn't recognize some GL state changes
- - gluProject/UnProject() didn't check for divide by zero
- - stex3d demo called random() and srandom(), not portable
- - fixed memory leaks in context.c and drawpix.c
- - fixed NULL dereferencing problem in gl_update_texture_state()
- - glReadPixels between glBegin/glEnd didn't generate an error.
- - fixed memory leak in polygon tesselator (Randy Frank)
- - fixed seg fault bug drawing flat-shaded, depth-tested lines
- - clipped GL_TRIANGLE_STRIPs sometimes had wrong color when flat-shaded
- - glBindTexture sometimes didn't work
- - fixed a bug deep in glXReleaseBuffersMESA()
- - fog was mistakenly applied to alpha
- - glPopMatrix didn't set "dirty matrix" flag
- - glPolygonStipple pattern was sometimes wrong
- - glClear wasn't disabled during feedback and selection
- - fixed memory leak in glTexSubImage[123]D
- Changes:
- - many library source files reorganized
- - faster X color allocation, colors also freed when finished with them
- - new texture sampling function pointer in texture objects
- - incorporated 3Dfx VooDoo driver v0.16 into main source tree
- - many 3Dfx driver updates
- - cygnus Makefiles now included
- - updated DOS driver
- - made a few changes to dosmesa.c and wmesa.c (VB->Unclipped)
- - internally, colors now stored in GLubytes, not GLfixed
- - optimized changing of GL_SHININESS parameter
-
-2.4 September 18, 1997
- New:
- - updated 3Dfx Glide driver
- - hacks for 3Dfx rendering into an X window or fullscreen
- - added depth buffer access functions to X/Mesa and OS/Mesa interfaces
- Bug fixes:
- - pixel buffer could overflow with long, wide lines
- - fixed FP underflow problems in lighting
- - glTexSubImage1D() had an unitialized variable
- - incomplete texture objects could cause a segfault
- - glDrawPixels with GL_COMPILE_AND_EXECUTE caused infinite loop
- - flat-shaded quads in a strip were miscolored if clipped
- - mipmapped triangle lod computation now works correctly
- - fixed a few under/overflow bugs in triangle rasterizer
- - glArrayElement() assigned bad normal if normal array disabled
- - changed argument to glXReleaseBuffersMESA()
- - fixed small triangle underflow bugs in tritemp.h (hopefully)
- - glBindTexture(target, 0) caused a crash
- - glTexImage[123]D() with NULL image pointer caused crash
- - glPixelStore parameters are now ignored during display list execution
- - fixed a two-sided lighting w/ clipping bug (black vertices)
- - textures with width!=height were sometimes mis-rendered
- - "weird" projection matrices could cause div by 0, other fp errors
- Changes:
- - changed precompiled header symbol from PCH to PC_HEADER
- - split api.c into api1.c and api2.c
- - added hash.c source file (but not used yet)
- - a few Sun and HP configuration file changes
- - MESA_GLX_FX env var replaces MESA_FX_WINDOW and MESA_FX_FULLSCREEN
- - fixed a few cygnus build problems (src/Makefile.cygnus, src/wmesa.c)
-
-2.5 November 20, 1997
- New:
- - updated 3Dfx driver (v20) for GLQuake
- - added GL_EXT_paletted_texture extension
- - added GL_EXT_shared_texture_palette extension
- - added GL_EXT_point_parameters extension
- - now including Mark Kilgard's GLUT library v3.6
- - new GLUT-based demos in gdemos/
- - added a few more Unix config targets
- - added Intel X86 assembly language vertex transformation code
- - 3Dfx/Glide driver for Mesa now recognizes SST_SCREENREFRESH env var
- - Windows 95 S3 Virge driver
- Bug fixes:
- - glCopyTexImage?D would crash due to uninitialized variable
- - glColor w/ glColorMaterial in a display list caused a bug
- - fixed several glDrawPixels() and ReadPixels() bugs in 3Dfx driver
- - glVertex4*() vertices weren't always projected correctly
- - trying to use mipmapped textured points or lines caused crash
- - glColor[34][fd]() values now clamped to [0,1] before int conversion
- Changes:
- - new device driver functions for texture mapping
- - hash tables used for display list and texture object lookup
- - fixed GLX visual handling code to avoid saving redundant visuals
- - 3Dfx Glide libraries automatically linked to libMesaGL.so
- - dropped the Cirrus Logic Mondello code since it's obsolete
- - updated Cygnus Makefiles (Stephane Rehel)
- - updated Windows MSVC++ Makefiles (Oleg Letsinsky)
- - procedure for making library files has changed: scripts now take
- a major and minor version arguments. Make-config changed a lot.
- - new implementation of glTexSubImage2D()
- - updated widgets-mesa directory to create libMesaGLwM.a (Motif widget)
- - separate linux-glide and linux-386-glide configurations
-
-2.6 February 12, 1998
- New:
- - Windows WGL functions
- - updated VMS, DOS, Windows, Cygnus, BeOS, Amiga compilation support
- - v0.22 of 3Dfx Glide driver
- - more X86 assembly language optimizations
- - faster blending for some modes
- - XMesaSetFXmode() to switch between 3Dfx window and full-screen mode
- - added preliminary thread support
- - added GLX_MESA_copy_sub_buffer extension
- - some clipping optimizations
- Bug fixes:
- - fixed shading/material bug when drawing long primitive strips
- - fixed clipping problem in long primitive strips
- - fixed clipping bug when using 3Dfx driver
- - fixed a problem when trying to use X fonts w/ 3Dfx driver
- - fixed a texture filter bug in 3Dfx/Glide driver
- - fixed bug in 3Dfx/Glide driver involving depth mask & clearing
- - glLoadMatrix to set projection matrix confused the 3Dfx driver
- - non-identity texture matrices didn't work with linux-386 configs
- - glGenTextures() didn't reserve the returned texture IDs
- - NULL proxy image sent to glTexImageXD() caused crash
- - added texture state validation optimization (Henk Kok)
- - fixed colormap reuse problem when using both RGB and CI windows
- - 32bpp True/DirectColor X visuals weren't recognized
- - fixed potential problem in evaluators memory allocation
- - fixed assorted demo compilation bugs
- Changes:
- - replaced old Mesa/windows/ directory with Mesa/WIN32/ directory
- - converted a few old glaux/gltk demos to GLUT
- - renamed directories: demos -> xdemos, gdemos -> demos
-
-
-3.0 September 17, 1998
- New:
- - OpenGL 1.2 API
- - GL_EXT_abgr pixel format extension
- - GL_SGIS_texture_edge_clamp extension
- - GL_SGIS_multitexture extension (to be replaced by GL_ARB_multitex)
- - GL_EXT_multitexture extension (to be replaced by GL_ARB_multitex)
- - GL_EXT_rescale_normal extension and renormal.c demo
- - GLX_SGI_video_sync extension (a no-op)
- - antialiased lines
- - glGetTexImage() now implemented
- - glDraw/Copy/ReadPixels() optimizations
- - optimized textured triangle code (Marten Stromberg)
- - more optimization of dithered TrueColor triangles in X driver
- - Linux GGI driver
- - updated MGL driver
- Bug fixes:
- - lots of assorted compilation fixes
- - glInitNames didn't write initial hit record
- - glBitmap didn't always check for invalid raster position
- - switching between GLX and OSMesa contexts caused a crash
- - fixed uninitialized variable in Mesa widget code
- - fixed typo in texture code which caused book/texgen to crash
- - fixed texture sampling bug when filter=GL_LINEAR and wrap=GL_CLAMP
- - gluDisk() in POINT or LINE mode sometimes failed
- - fixed texture + fog bug
- - GL_COMPILE_AND_EXECUTE mode didn't work reliably
- - glMultMatrix in projection matrix mode w/ 3Dfx driver could fail
- - glDrawPixels(color index pixels) weren't converted to RGBA
- - fixed possible getenv() buffer overflow security bug
- - glBitmap in feedback mode was offset by xOrig, yOrig params
- - device driver's DrawPixels hook was never used
- - glDrawPixels with zoomY!=1 and top/bottom clipping didn't work
- - glDrawPixels optimized for GL_LUMINANCE, GL_LUMINANCE_ALPHA, GLubyte
- - fixed MakeCurrent bug in GLwRedrawObjects() in MesaWorkstation.c
- - glCopyTexSubImage2D() didn't work with 3Dfx driver
- - lines with width = 2 could cause crash
- - glClear with scissor rect sometimes cleared whole buffer
- - glTexSubImage2D( .. GL_COLOR_INDEX .. ) didn't work
- - glTexImageXD( .. GL_ABGR_EXT .. ) didn't work
- - computation of inverse modelview matrix sometimes failed
- - fixed GL_CLAMP mode texture sampling bug
- - textured line interpolation was somewhat broken
- - textured triangle interpolation was also somewhat broken
- - glGet(MODELVIEW/PROJECTION/TEXTURE_MATRIX_STACK_DEPTH) off by one
- - evaluator state wasn't fully initialized
- - texture coordinate clipping was buggy
- - evaluator surfaces could be mis-colored
- - glAccum(GL_RETURN, s) didn't obey glColorMask() settings
- - zero area polygons shouldn't be culled if polygon mode is point/line
- - clipped width and height of glReadPixels was sometimes off by one
- - blending with alpha = 0 or 1.0 wasn't always exact
- - reading of pixels from clipped region was buggy
- - minor tweaking of X visual management in GLX emulator
- - glPolygonStipple now obeys pixel unpacking parameters
- - glGetPolygonStipple now obeys pixel packing parameters
- - interleaved vertex array texture coordinates were broken
- - query of proxy texture internal format was broken
- - alpha channel wasn't reliably cleared
- - fixed divide by zero error in gluScaleImage if dest size = 1 x 1
- Conformance bug fixes:
- - GL_SELECTION_BUFFER_POINTER and GL_SELECTION_BUFFER_SIZE were missing
- - GL_TEXTURE_INTERNAL_FORMAT was missing
- - glGet*(GL_POLYGON_STIPPLE) was broken
- - glPush/PopAttrib() didn't save/restore all texture state
- - glBitmap in feedback mode didn't work
- - feedback of texture coords didn't always work
- - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLbyte was broke
- - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLubyte was broke
- - glDrawPixels w/ format=GL_STENCIL_INDEX, type=GL_BITMAP was broke
- Changes:
- - upgraded GLUT to version 3.7
- - only GL and GLU library code included in MesaLib.tar.gz
- - GLUT and all demos now in MesaDemos.tar.gz
- - glaux and gltk libraries removed
- - IRIX -n32 and -64 libs go in lib32/ and lib64/ directories
-
-
-3.1 beta 1 November 19, 1998
- New:
- - GL_EXT_stencil_wrap extension
- - GL_INGR_blend_func_separate extension
- - GL_ARB_multitexture extension
- - GL_NV_texgen_reflection extension
- - newly optimized vertex transformation code
- - updated GLUT 3.7 code
- - better precision when using 32-bit Z buffer
- - Allegro DJGPP driver
- Bug fixes:
- - glCopyPixels between front/back buffers didn't copy alpha correctly
- - fixed out-of-bounds memory access in optimized 2-D texture code
- - glPixelStorei didn't accept GL_PACK/UNPACK_IMAGE_HEIGHT parameter
- - glGet*() didn't accept GL_MAX_3D_TEXTURE_SIZE parameter
- - clipping of texture coordinates sometimes had bad R,Q values
- - GL_CLAMP_TO_EDGE texture sampling was off by 0.5 texels
- - glEdgeFlagPointer() now takes a GLvoid * instead of GLboolean *
- - texture was sometimes applied twice with 3Dfx driver
- - glPush/PopAttrib() fouled up texture object reference counts
- - glDeleteLists(0, n) caused assertion failure
- - bilinear texture sampling wasn't accurate enough
- - glClear w/ glDepthMask(GL_FALSE) didn't work right on 3Dfx
- - color components were reversed on big endian 32 bpp X visuals
- Changes:
- - removed GL_EXT_multitexture extension
-
-
-3.1 beta 2 May 24, 1999
- New:
- - multi-textured points and lines (mjk@nvidia.com)
- - optimized 24bpp X rendering (bernd.paysan@gmx.de)
- - added allegro support (bernie-t@geocities.com)
- - cleaned-up Windows-related stuff (Ted Jump)
- - minor stereo changes (KendallB@scitechsoft.com)
- - new BeOS driver which implements BGLView class
- - new Direct3D driver (see src/D3D)
- - more efficient filled gluCylinder() function
- - utilities: util/showbuffer.[ch] and util/glstate.[ch]
- - fixed some IRIX compiler warnings
- - added support for building Mesa in XFree86 with
- SGI's GLX (kevin@precisioninsight.com)
- Bug fixes:
- - a variety of Windows/Mesa bug fixes (mjk@nvidia.com)
- - packed pixel images weren't unpacked correctly
- - patches some win32 files in GLUT (mjk@nvidia.com)
- - glTexImage[123]D() didn't accept internalFormat == GL_COLOR_INDEX
- - fixed lighting bug in Keith's new shading code
- - fixed texture segfault seen in Lament screensaver
- - fixed miscellaneous low-memory bugs
- - glClear(GL_COLOR_BUFFER_BIT) with RGBA or CI masking was broken
- - GL_LINEAR sampling of 3D textures was broken
- - fixed SVR4 'cc' compiler macro problem (dawes@xfree86.org)
- - added GL_TEXTURE_PRIORITY fix (keithh@netcomuk.co.uk)
- - fixed wide point and wide line conformance bugs (brianp)
- Changes:
- - some device driver changes (see src/dd.h)
- - new copyright on core Mesa code
-
-
-3.1 beta 3 September 17, 1999
- New:
- - optimized glAccum function
- - optimized 24bpp rendering in XMesa driver
- - GLU 1.2 polygon tessellator
- Bug Fixes:
- - glGetTexLevelParameter wasn't fully implemented
- - glXUseXFont now handles multi-byte fonts
- - glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result
- - alpha channel of blending points, lines was sometimes incorrect
- Changes:
- - New library names: "libGL" instead of "libMesaGL"
- - New library numbering: libGL.so.1.2.310
- - New subdirectories: docs/ and bin/
- - New Makefile-system (autoconf,automake,libtool)
-
-
-3.1 final December 14, 1999
- New:
- - added demos/gloss.c
- - added xdemos/glxdpyinfo.c
- - added GLX_ARB_get_proc_address extension
- - rewritten glTexImage code paths (faster, less memory, bug fixes)
- Bug Fixes:
- - several vertex array bug fixes
- - overlapping glCopyPixels with pixel zooming now works
- - glXUseXFont() bitmaps were vertically shifted by one pixel
- - glCopyPixels with pixel zooming now works
-
-
-3.2 final April 24, 2000
- Bug fixes:
- - fixed memcpy bugs in span.c
- - fixed missing glEnd problem in demos/tessdemo.c
- - fixed bug when clearing 24bpp Ximages
- - fixed clipping problem found in Unreal Tournament
- - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2
- - fixed Loki's 3dfx RGB vs BGR bug
- - fixed Loki's 3dfx smooth/flat shading bug in SoF
- Changes:
- - updated docs/README file
- - use bcopy() optimizations on FreeBSD
- - re-enabled the optimized persp_textured_triangle() function
-
-
-3.2.1 July 19, 2000
- Bug fixes:
- - gluBuild2DMipmaps() didn't accept GL_BGRA
- - Fixed compile/makefile problems on IRIX
- - fixed segfault in 3dfx driver when using GL selection/feedback
- - no longer cull very, very tiny triangles
- - blending w/ drawbuffer==GL_FRONT_BACK caused segfault (sw rendering)
- - fixed Motif detection code in widgets-mesa/configure.in
- - glColorMaterial and glMaterial updates to emissive and ambient
- didn't always work right
- - Specular highlights weren't always in the right place
- - clipped GL_LINE mode polygons had interior lines appear
- - blend term GL_ONE_MINUS_CONSTANT_ALPHA was broken
- - GL_NICEST fog didn't always work with flat shading
- - glRect commands in display lists were sometimes miscolored
- - Line Z offset didn't always work
- - fixed texgen normal vector problem (gloss's teapot)
- - numerous GL conformance bugs fixed
- Changes:
- - glColorMask(false, false, false, false) handled better/faster
- - reverted to old GLU polygon tessellator, GLU 1.1
- - updated Win32 build files
-
-
-3.3 July 21, 2000
- New:
- - antialiased triangles now implemented
- - GL_EXT_texture_env_add texture mode extension
- - GLX 1.3 API
- - support for separate draw/read buffers (ie GL_SGI_make_current_read)
- - thread-safe API dispath
- - improved glxinfo program
- - demos/texdown program to measure texture download performance
- - glext.h header file
- - demos/geartrain program
- - GL_EXT_texture_lod_bias extension
- - demos/lodbias program
- - further optimized glRead/DrawPixels for 16-bit TrueColor X visuals
- - GLX_EXT_visual_rating extension (a no-op, however)
- - GL_HP_occlusion_test extension (for X and OS/Mesa drivers)
- - demos/occlude program
- - GL_SGIS_pixel_texture and GL_SGIX_pixel_texture extensions
- - demos/pixeltex program
- - GL_SGI_color_matrix extension
- - GL_SGI_color_table extension
- - GL_EXT_histogram extension
- - GL_ARB_texture_cube_map extension
- - added xdemos/glxheads and xdemos/manywin
- - demos/texenv.c demo
- - GL_EXT_texture_env_combine extension (by Holger Waechtler)
- - Xlib driver is now thread-safe (see xdemos/glthreads)
- Bug Fixes:
- - various GL conformance failures fixed since 3.2.1
- Changes:
- - gl.h now uses #defines instead of C enums for all tokens
- - glu.h now uses #defines instead of C enums for all tokens
- - moved programs from 3Dfx/demos/ into demos/ directory
-
-
-3.4 November 3, 2000
- New:
- - optimized glDrawPixels for glPixelZoom(1,-1)
- Bug Fixes:
- - widgets-mesa/src/*.c files were missing from 3.3 distro
- - include/GL/mesa_wgl.h file was missing from 3.3 distro
- - fixed some Win32 compile problems
- - texture object priorities weren't getting initialized to 1.0
- - glAreTexturesResident return value was wrong when using hardware
- - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX)
- - glReadPixels with GLushort packed types was broken
- - fixed a few bugs in the GL_EXT_texture_env_combine texture code
- - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables
- - fixed some typos/bugs in the VB code
- - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work
- - optimized glDrawPixels paths weren't being used
- - per-fragment fog calculation didn't work without a Z buffer
- - improved blending accuracy, fixes Glean blendFunc test failures
- - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly
- - glXGetProcAddressARB() didn't always return the right address
- - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format
- - texture matrix changes weren't always detected (GLUT projtex demo)
- - fixed random color problem in vertex fog code
- - fixed Glide-related bug that let Quake get a 24-bit Z buffer
- Changes:
- - finished internal support for compressed textures for DRI
-
-
-3.4.1 February 14, 2001
- New:
- - fixed some Linux build problems
- - fixed some Windows build problems
- - GL_EXT_texture_env_dot3 extension (Gareth Hughes)
- Bug fixes:
- - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
- - various state-update code changes needed for DRI bugs
- - disabled pixel transfer ops in glColorTable commands, not needed
- - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter
- - updated sources and fixed compile problems in widgets-mesa/
- - GLX_PBUFFER enum value was wrong in glx.h
- - fixed a glColorMaterial lighting bug
- - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
- - glXCopySubBufferMESA() Y position was off by one
- - Error checking of glTexSubImage3D() was broken (bug 128775)
- - glPopAttrib() didn't restore all derived Mesa state correctly
- - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
- conformance problems at 16bpp.
- - clearing depth buffer with scissoring was broken, would segfault
- - OSMesaGetDepthBuffer() returned bad bytesPerValue value
- - fixed a line clipping bug (reported by Craig McDaniel)
- - fixed RGB color over/underflow bug for very tiny triangles
- Known problems:
- - NURBS or evaluator surfaces inside display lists don't always work
-
-
-3.4.2 May 17, 2001
- Bug fixes:
- - deleting the currently bound texture could cause bad problems
- - using fog could result in random vertex alpha values
- - AA triangle rendering could touch pixels outside right window bound
- - fixed byteswapping problem in clear_32bit_ximage() function
- - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
- - fixed memory leak in glXUseXFont()
- - fragment sampling in AA triangle function was off by 1/2 pixel
- - Windows: reading pixels from framebuffer didn't always work
- - glConvolutionFilter2D could segfault or cause FP exception
- - fixed segfaults in FX and X drivers when using tex unit 1 but not 0
- - GL_NAND logicop didn't work right in RGBA mode
- - fixed a memory corruption bug in vertex buffer reset code
- - clearing the softwara alpha buffer with scissoring was broken
- - fixed a few color index mode fog bugs
- - fixed some bad assertions in color index mode
- - fixed FX line 'stipple' bug #420091
- - fixed stencil buffer clear width/height typo
- - fixed GL error glitches in gl[Client]ActiveTextureARB()
- - fixed Windows compilation problem in texutil.c
- - fixed 1/8-pixel AA triangle sampling error
- Changes:
- - optimized writing mono-colored pixel spans to X pixmaps
- - increased max viewport size to 2048 x 2048
-
-
-3.5 June 21, 2001
- New:
- - internals of Mesa divided into modular pieces (Keith Whitwell)
- - 100% OpenGL 1.2 conformance (passes all conformance tests)
- - new AA line algorithm
- - GL_EXT_convolution extension
- - GL_ARB_imaging subset
- - OSMesaCreateContextExt() function
- - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
- - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
- - GL_EXT_fog_coord extension (Keith Whitwell)
- - GL_EXT_secondary_color extension (Keith Whitwell)
- - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
- - GL_SGIX_depth_texture extension
- - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
- - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
- - GL_ARB_texture_env_combine extension
- - GL_ARB_texture_env_dot3 extension
- - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
- - OSMesaCreateContextExt() function
- - libOSMesa.so library, contains the OSMesa driver interface
- - GL/glxext.h header file for GLX extensions
- - somewhat faster software texturing, fogging, depth testing
- - all color-index conformance tests now pass (only 8bpp tested)
- - SPARC assembly language TCL optimizations (David Miller)
- - GL_SGIS_generate_mipmap extension
- Bug Fixes:
- - fbiRev and tmuRev were unitialized when using Glide3
- - fixed a few color index mode conformance failures; all pass now
- - now appling antialiasing coverage to alpha after texturing
- - colors weren't getting clamped to [0,1] before color table lookup
- - fixed RISC alignment errors caused by COPY_4UBV macro
- - drawing wide, flat-shaded lines could cause a segfault
- - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
- Changes:
- - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
- - new libOSMesa.so library, contains the OSMesa driver interface
-
-
-4.0 October 22, 2001
- New:
- - Mesa 4.0 implements the OpenGL 1.3 specification
- - GL_IBM_rasterpos_clip extension
- - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp)
- - GL_ARB_texture_mirrored_repeat extension
- - WindML UGL driver (Stephane Raimbault)
- - added OSMESA_MAX_WIDTH/HEIGHT queries
- - attempted compiliation fixes for Solaris 5, 7 and 8
- - updated glext.h and glxext.h files
- - updated Windows driver (Karl Schultz)
- Bug fixes:
- - added some missing GLX 1.3 tokens to include/GL/glx.h
- - GL_COLOR_MATRIX changes weren't recognized by teximage functions
- - glCopyPixels with scale and bias was broken
- - glRasterPos with lighting could segfault
- - glDeleteTextures could leave a dangling pointer
- - Proxy textures for cube maps didn't work
- - fixed a number of 16-bit color channel bugs
- - fixed a few minor memory leaks
- - GLX context sharing was broken in 3.5
- - fixed state-update bugs in glPopClientAttrib()
- - fixed glDrawRangeElements() bug
- - fixed a glPush/PopAttrib() bug related to texture binding
- - flat-shaded, textured lines were broken
- - fixed a dangling pointer problem in the XMesa code (Chris Burghart)
- - lighting didn't always produce the correct alpha value
- - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
-
-
-4.0.1 December 17, 2001
- New:
- - better sub-pixel sample positions for AA triangles (Ray Tice)
- - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
- Bug fixes:
- - added missing break statements in glGet*() for multisample cases
- - fixed uninitialized hash table mutex bug (display lists / texobjs)
- - fixed bad teximage error check conditional (bug 476846)
- - fixed demos readtex.c compilation problem on Windows (Karl Schultz)
- - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
- - silence some compiler warnings (gcc 2.96)
- - enable the #define GL_VERSION_1_3 in GL/gl.h
- - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
- - fixed glu.h typedef problem found with MSDev 6.0
- - build libGL.so with -Bsymbolic (fixes bug found with Chromium)
- - added missing 'const' to glXGetContextIDEXT() in glxext.h
- - fixed a few glXGetProcAddress() errors (texture compression, etc)
- - fixed start index bug in compiled vertex arrays (Keith)
- - fixed compilation problems in src/SPARC/glapi_sparc.S
- - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
- - use glXGetProcAddressARB in GLUT to avoid extension linking problems
- - provoking vertex of flat-shaded, color-index triangles was wrong
- - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
- - glTexParameter didn't flush the vertex buffer (Ray Tice)
- - feedback attributes for glDraw/CopyPixels and glBitmap were wrong
- - fixed bug in normal length caching (ParaView lighting bug)
- - fixed separate_specular color bug found in Chimera (18 Dec 2001)
-
-
-4.0.2 April 2, 2002
- New:
- - New DOS (DJGPP) driver written by Daniel Borca
- - New driver interface functions for TCL drivers (such as Radeon DRI)
- - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
- if using deep color channels
- - latest GL/glext.h and GL/glxext.h headers from SGI
- Bug fixes:
- - GL_BLEND with non-black texture env color wasn't always correct
- - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
- - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
- - glReadPixels was sometimes mistakenly clipped by the scissor box
- - glDraw/ReadPixels didn't catch all the errors that they should have
- - Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
- - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
- - Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP)
- - glColorMask as sometimes effecting glXSwapBuffers()
- - fixed a potential bug in XMesaGarbageCollect()
- - N threads rendering into one window didn't work reliably
- - glCopyPixels didn't work for deep color channels
- - improved 8 -> 16bit/channel texture image conversion (Gerk Huisma)
- - glPopAttrib() didn't correctly restore user clip planes
- - user clip planes failed for some perspective projections (Chromium)
- Known bugs:
- - mipmap LOD computation
-
-
-4.0.3 June 25, 2002
- New:
- - updated GL/glext.h file (version 15)
- - corrected MMX blend code (Jose Fonseca)
- - support for software-based alpha planes in Windows driver
- - updated GGI driver (Filip Spacek)
- Bug fixes:
- - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens
- - OSMesaMakeCurrent() didn't recognize buffer size changes
- - assorted conformance fixes for 16-bit/channel rendering
- - texcombine alpha subtraction mode was broken
- - fixed lighting bug with non-uniform scaling and display lists
- - fixed bug when deleting shared display lists
- - disabled SPARC cliptest assembly code (Mesa bug 544665)
- - fixed a couple Solaris compilation/link problems
- - blending clipped glDrawPixels didn't always work
- - glGetTexImage() didn't accept packed pixel types
- - glPixelMapu[is]v() could explode given too large of pixelmap
- - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT
- - glXCopyContext() could lead to segfaults
- - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665)
- Changes:
- - lots of C++ (g++) code clean-ups
- - lots of T&L updates for the Radeon DRI driver
- Known bugs:
- - mipmap LOD computation (fixed for Mesa 4.1)
-
-
-4.0.4 October 3, 2002
- New:
- - GL_NV_texture_rectangle extension
- - updated glext.h header (version 17)
- - updated DOS driver (Daniel Borca)
- - updated BeOS R5 driver (Philippe Houdoin)
- - added GL_IBM_texture_mirror_repeat
- - glxinfo now takes -l option to print interesting OpenGL limits info
- - GL_MESA_ycbcr_texture extension
- - GL_APPLE_client_storage extension (for some DRI drivers only)
- - GL_MESA_pack_invert extension
- Bug fixes:
- - fixed GL_LINEAR fog bug by adding clamping
- - fixed FP exceptions found using Alpha CPU
- - 3dfx MESA_GLX_FX=window (render to window) didn't work
- - fixed memory leak in wglCreateContest (Karl Schultz)
- - define GLAPIENTRY and GLAPI if undefined in glu.h
- - wglGetProcAddress didn't handle all API functions
- - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map
- - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc()
- - error checking in compressed tex image functions had some glitches
- - fixed AIX compile problem in src/config.c
- - glGetTexImage was using pixel unpacking instead of packing params
- - auto-mipmap generation for cube maps was incorrect
- Changes:
- - max texture units reduced to six to accomodate texture rectangles
- - removed unfinished GL_MESA_sprite_point extension code
-
-
-4.1 October 29, 2002
- New:
- - GL_NV_vertex_program extension
- - GL_NV_vertex_program1_1 extension
- - GL_ARB_window_pos extension
- - GL_ARB_depth_texture extension
- - GL_ARB_shadow extension
- - GL_ARB_shadow_ambient extension
- - GL_EXT_shadow_funcs extension
- - GL_ARB_point_parameters extension
- - GL_ARB_texture_env_crossbar
- - GL_NV_point_sprite extension
- - GL_NV_texture_rectangle extension
- - GL_EXT_multi_draw_arrays extension
- - GL_EXT_stencil_two_side extension
- - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions
- - GL_ATI_texture_mirror_once extension (Ian Romanick)
- - massive overhaul/simplification of software rasterizer module,
- many contributions from Klaus Niederkrueger
- - faster software texturing in some cases (i.e. trilinear filtering)
- - new OSMesaGetProcAddress() function
- - more blend modes implemented with MMX code (Jose Fonseca)
- - added glutGetProcAddress() to GLUT
- - added GLUT_FPS env var to compute frames/second in glutSwapBuffers()
- - pbinfo and pbdemo PBuffer programs
- - glxinfo -v prints transprent pixel info (Gerd Sussner)
- Bug fixes:
- - better mipmap LOD computation (prevents excessive blurriness)
- - OSMesaMakeCurrent() didn't recognize buffer size changes
- - assorted conformance fixes for 16-bit/channel rendering
- - texcombine alpha subtraction mode was broken
- - fixed some blend problems when GLchan==GLfloat (Gerk Huisma)
- - clamp colors to [0,inf] in OSMesa if GLchan==GLfloat (Gerk Huisma)
- - fixed divide by zero error in NURBS tessellator (Jon Perry)
- - fixed GL_LINEAR fog bug by adding clamping
- - fixed FP exceptions found using Alpha CPU
- - 3dfx/glide driver render-to-window feature was broken
- - added missing GLX_TRANSPARENT_RGB token to glx.h
- - fixed error checking related to paletted textures
- - fixed reference count error in glDeleteTextures (Randy Fayan)
- Changes:
- - New spec file and Python code to generate some GL dispatch files
- - Glide driver defaults to "no" with autoconf/automake
- - updated demos/stex3d with new options
-
-
-5.0 November 13, 2002
- New:
- - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4")
- - removed some overlooked debugging code
- - glxinfo updated to support GLX_ARB_multisample
- - GLUT now support GLX_ARB_multisample
- - updated DOS driver (Daniel Borca)
- Bug fixes:
- - GL_POINT and GL_LINE-mode polygons didn't obey cull state
- - fixed potential bug in _mesa_align_malloc/calloc()
- - fixed missing triangle bug when running vertex programs
- - fixed a few HPUX compilation problems
- - FX (Glide) driver didn't compile
- - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work
- - a few EXT functions, like glGenTexturesEXT, were no-ops
- - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate,
- glMultiDrawArrays and glMultiDrawElements were missing
- - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken
- - Pentium 4 Mobile was mistakenly identified as having 3DNow!
- - fixed one-bit error in point/line fragment Z calculation
- - fixed potential segfault in fakeglx code
- - fixed color overflow problem in DOT3 texture env mode
-
-
-5.0.1 March 30, 2003
- New:
- - DOS driver updates from Daniel Borca
- - updated GL/gl_mangle.h file (Bill Hoffman)
- Bug fixes:
- - auto mipmap generation for cube maps was broken (bug 641363)
- - writing/clearing software alpha channels was unreliable
- - minor compilation fixes for OS/2 (Evgeny Kotsuba)
- - fixed some bad assertions found with shadowtex demo
- - fixed error checking bug in glCopyTexSubImage2D (bug 659020)
- - glRotate(angle, -x, 0, 0) was incorrect (bug 659677)
- - fixed potential segfault in texture object validation (bug 659012)
- - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus)
- - fix fog stride bug in tnl code for h/w drivers (Michel Danzer)
- - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080)
- - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3
- - fixed compilation problem on Solaris7/x86 (bug 536406)
- - fixed prefetch bug in 3DNow! code (Felix Kuhling)
- - fixed NeXT build problem (FABSF macro)
- - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811)
- - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964)
- - AA line and triangle Z values are now rounded, not truncated
- - fixed color interpolation bug when GLchan==GLfloat (bug 694461)
- - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca)
- - fixed a minor GL_COLOR_MATERIAL bug
- - NV vertex program EXP instruction was broken
- - glColorMask misbehaved with X window / pixmap rendering
- - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack)
- - attempt to fix GGI compilation problem when MesaDemos not present
- - NV vertex program ARL-relative fetches didn't work
- Changes:
- - use glPolygonOffset in gloss demo to avoid z-fighting artifacts
- - updated winpos and pointblast demos to use ARB extensions
- - disable SPARC normal transformation code (bug 673938)
- - GLU fixes for OS/2 (Evgeny Kotsuba)
-
-
-5.0.2 September 5, 2003
- Bug fixes:
- - fixed texgen problem causing texcoord's Q to be zero (stex3d)
- - default GL_TEXTURE_COMPARE_MODE_ARB was wrong
- - GL_CURRENT_MATRIX_NV query was wrong
- - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one
- - GL_LIST_MODE query wasn't correct
- - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported
- - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value
- - blended, wide lines didn't always work correctly (bug 711595)
- - glVertexAttrib4svNV w component was always 1
- - fixed bug in GL_IBM_rasterpos_clip (missing return)
- - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly
- - a few Solaris compilation fixes
- - fixed glClear() problem for DRI drivers (non-existant stencil, etc)
- - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux)
- - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz)
- - glFog() didn't clamp fog colors
- - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the
- gl[Get]TexParameteri[v] functions
- - fixed invalid memory references in glTexGen functions (bug 781602)
- - integer-valued color arrays weren't handled correctly
- - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work
- - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1
- Changes:
- - build GLUT with -fexceptions so C++ apps propogate exceptions
-
-
-5.1 December 17, 2003
- New:
- - reorganized directory tree
- - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
- - GL_ATI_texture_env_combine3 extension (Ian Romanick)
- - GL_SGI_texture_color_table extension (Eric Plante)
- - GL_NV_fragment_program extension
- - GL_NV_light_max_exponent extension
- - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle)
- - GL_ARB_occlusion_query extension
- - GL_ARB_point_sprite extension
- - GL_ARB_texture_non_power_of_two extension
- - GL_IBM_multimode_draw_arrays extension
- - GL_EXT_texture_mirror_clamp extension (Ian Romanick)
- - GL_ARB_vertex_buffer_object extension
- - new X86 feature detection code (Petr Sebor)
- - less memory used for display lists and vertex buffers
- - demo of per-pixel lighting with a fragment program (demos/fplight.c)
- - new version (18) of glext.h header
- - new spriteblast.c demo of GL_ARB_point_sprite
- - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1)
- - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1)
- Bug fixes:
- - really enable OpenGL 1.4 features in DOS driver.
- - fixed issues in glDrawPixels and glCopyPixels for very wide images
- - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint
- - fixed some texgen bugs reported by Daniel Borca
- - fixed wglMakeCurrent(NULL, NULL) bug (#835861)
- - fixed glTexSubImage3D z-offset bug (Cedric Gautier)
- - fixed RGBA blend enable bug (Ville Syrjala)
- - glAccum is supposed to be a no-op in selection/feedback mode
- - fixed texgen bug #597589 (John Popplewell)
- Changes:
- - dropped API trace feature (src/Trace/)
- - documentation overhaul. merged with website content. more html.
- - glxgears.c demo updated to use GLX swap rate extensions
- - glTexImage1/2/3D now allows width/height/depth = 0
- - disable SPARC asm code on Linux (bug 852204)
-
-
-6.0 January 16, 2004
- New:
- - full OpenGL 1.5 support
- - updated GL/glext.h file to version 21
- Changes:
- - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h)
- Bug fixes:
- - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color
- clamping issue
- - updated suno5-gcc configs
- - glColor3 functions sometimes resulted in undefined alpha values
- - fixed FP divide by zero error seen on VMS with xlockmore, others
- - fixed vertex/fragment program debug problem (bug 873011)
- - building on AIX with gcc works now
- - glDeleteProgramsARB failed for ARB fragment programs (bug 876160)
- - glDrawRangeElements tried to modify potentially read-only storage
- - updated files for building on Windows
-
-
-6.0.1 April 2, 2004
- New:
- - upgraded glext.h to version 22
- - new build targets (Dan Schikore)
- - new linux-x86-opteron build target (Heath Feather)
- Bug fixes:
- - glBindProgramARB didn't update all necessary state
- - fixed build problems on OpenBSD
- - omit CVS directories from tarballs
- - glGetTexImage(GL_COLOR_INDEX) was broken
- - fixed an infinite loop in t&l module
- - silenced some valgrind warnings about using unitialized memory
- - fixed some compilation/link glitches on IRIX (Mike Stephens)
- - glBindProgram wasn't getting compiled into display lists
- - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079)
- - two-sided lighting and vertex program didn't work (bug 887330)
- - stores to program parameter registers in vertex state programs
- didn't work.
- - fixed glOrtho bug found with gcc 3.2.2 (RH9)
- - glXCreateWindow() wasn't fully implemented (bug 890894)
- - generic vertex attribute arrays didn't work in display lists
- - vertex buffer objects' default usage and access fields were wrong
- - glDrawArrays with start!=0 was broken
- - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken
- - linux-osmesa16-static config didn't work
- - fixed a few color index rendering problems (bug 910687)
- - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE
- - OSMesa RGB and BGR modes were broken
- - glProgramStringARB mistakenly required a null-terminated string
- - fragment program XPD instruction was incorrect
- - glGetMaterial() didn't work reliably
- - ARB_fragment_program KIL instruction was incorrect
-
-
-6.1 August 18, 2004
- New:
- - Revamped Makefile system
- - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c)
- - internal driver interface changes related to texture object
- allocation, vertex/fragment programs, BlendEquationSeparate, etc.
- - option to walk triangle edges with double-precision floats
- (Justin Novosad of Discreet) (see config.h file)
- - support for AUX buffers in software GLX driver
- - updated glext.h to version 24 and glxext.h to version 6
- - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars
- - updated BeOS support (Philippe Houdoin)
- Changes:
- - fragment fog interpolation is perspective corrected now
- - new glTexImage code, much cleaner, may be a bit faster
- Bug fixes:
- - glArrayElement in display lists didn't handle generic vertex attribs
- - glFogCoord didn't always work properly
- - ARB_fragment_program fog options didn't work
- - frag prog TEX instruction no longer incorrectly divides s,t,r by q
- - ARB frag prog TEX and TEXP instructions now use LOD=0
- - glTexEnviv in display lists didn't work
- - glRasterPos didn't do texgen or apply texture matrix
- - GL_DOUBLE-valued vertex arrays were broken in some cases
- - fixed texture rectangle edge/border sampling bugs
- - sampling an incomplete texture in a fragment program would segfault
- - glTexImage was missing a few error checks
- - fixed some minor glGetTexParameter glitches
- - GL_INTENSITY was mistakenly accepted as a <format> to glTexImage
- - fragment program writes to RC/HC register were broken
- - fixed a few glitches in GL_HP_occlusion_test extension
- - glBeginQueryARB and glEndQueryARB didn't work inside display lists
- - vertex program state references were broken
- - fixed triangle color interpolation bug on AIX (Shane Blackett)
- - fixed a number of minor memory leaks (bug #1002030)
-
-
-6.2 October 2, 2004
- New:
- - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- - updated Doxygen support (Jose Fonseca)
- Changes:
- - some GGI driver updates (Christoph Egger, bug 1025977)
- Bug fixes:
- - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
- - fixed a few compilation issues on IRIX
- - fixed a matrix classification bug (reported by Wes Bethel)
- - we weren't reseting the vertex/fragment program error state
- before parsing (Dave Reveman)
- - adjust texcoords for sampling texture rectangles (Dave Reveman)
- - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
- - repeated calls to glDeleteTexture(t) could lead to a crash
- - fixed potential ref count bugs in VBOs and vertex/fragment programs
- - spriteblast demo didn't handle window size changes correctly
- - glTexSubImage didn't handle pixels=NULL correctly for PBOs
- - fixed color index mode glDrawPixels bug (Karl Schultz)
-
-
-6.2.1 December 9, 2004
- Bug fixes:
- - don't apply regular fog or color sum when using a fragment program
- - glProgramEnvParameter4fARB always generated an error on
- GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- - glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- - fixed width/height mix-up in glSeparableFilter2D()
- - fixed regression in glCopyPixels + convolution
- - glReadPixels from a clipped front color buffer didn't always work
- - glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- - Attempting queries/accesses of VBO 0 weren't detected as errors
- - paletted textures failed if the palette had fewer than 256 entries
- Changes:
- - fixed a bunch of compiler warnings found with gcc 3.4
- - bug reports should to go bugzilla.freedesktop.org
-
-
-6.3 July 20, 2005
- New:
- - GL_EXT_framebuffer_object extension
- - GL_ARB_draw_buffers extension
- - GL_ARB_pixel_buffer_object extension
- - GL_OES_read_format extension (Ian Romanick)
- - DirectFB driver (Claudio Ciccani)
- - x86_64 vertex transformation code (Mikko T.)
- - Updated GL/glext.h to version 29
- Changes:
- - added -stereo option for glxgears demo (Jacek Rosik)
- - updated the PBuffer demo code in xdemos/ directory
- - glDeleteTextures/Programs/Buffers() now makes the object ID
- available for immediate re-use
- - assorted 64-bit clean-ups fixes (x86_64 and Win64)
- - lots of internal changes for GL_EXT_framebuffer_object
- Bug fixes:
- - some functions didn't support PBO functionality
- - glGetTexImage didn't convert color index images to RGBA as required
- - fragment program texcoords were sometimes wrong for points and lines
- - fixed problem with negative dot product in arbfplight, fplight demos
- - fixed bug in perspective correction of antialiased, textured lines
- - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
- - fixed a couple per-pixel fog bugs (Soju Matsumoto)
- - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
- - fixed float parsing bug in ARB frag/vert programs (bug 2520)
- - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
- - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
- - glXChooseFBConfig() crashed if attribList pointer was NULL
- - program state.light[n].spot.direction.w was wrong value (bug 3083)
- - fragment program fog option required glEnable(GL_FOG) - wrong.
- - glColorTable() could produce a Mesa implementation error (bug 3135)
- - RasterPos could get corrupted by color index rendering path
- - Removed bad XTranslateCoordinates call when rendering to Pixmaps
- - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- - fixed a few Darwin compilation problems
-
-
-6.3.1
- This was an intermediate release for X.org which wasn't otherwise released.
-
-
-6.3.2 August 19, 2005
- New:
- - The distribution now includes the DRI drivers and GLX code
- Changes:
- - Made the DRI "new" driver interface standard, remove old code
- Bug fixes:
- - GL_ARB_vertex/fragment_shader were mistakenly listed in the
- extensions string
- - negative relative addressing in vertex programs was broken
- - update/fix SPARC assembly code for vertex transformation
- - fixed memory leak when freeing GLX drawables/renderbuffers
- - fixed display list memory leak
- - the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer
- - wglGetProcAddress() didn't handle wgl-functions
- - fixed glxext.h cross-compile issue (Colin Harrison)
- - assorted DRI driver fixes
-
-
-6.4 October 24, 2005
- New:
- - Added a fast XOR line drawing function in Xlib driver
- - Added support for GL_ARB_texture_mirrored_repeat to savage
- driver (supported only on Savage4 hardware).
- Changes:
- - Mesa now packaged in three parts: Library, Demos and GLUT
- Bug fixes:
- - GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig
- - Some files were present multiple times in the 6.3.2 tarballs
- - r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207)
- - glxgears_fbconfig demo didn't work (bug 4237)
- - fixed bug when bilinear sampling 2d textures with borders
- - glXCreatePbuffer() could segfault instead of returning 0 (bug 4235)
- - fixed undefined frexp and rand in X.org libGLcore.a (bug 4242)
- - fixed a few problems with proxy color tables (bug 4270)
- - fixed precision problem in Z clearing (bug 4395)
- - glBitmap, glDraw/CopyPixels mistakenly generated selection hits
- - fixed potential segfault caused by reading pixels outside
- of renderbuffer bounds
- - glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB
- - fixed memory corruption bug involving software alpha buffers
- - glReadPixels clipped by window bounds was sometimes broken
- - glDraw/CopyPixels of stencil data ignored the stencil write mask
- - glReadPixels from a texture bound to a framebuffer object didn't work
- - glIsRender/FramebufferEXT weren't totally correct
- - fixed a number of point size attenuation/fade bugs
- - fixed glFogCoord bug 4729
- - GLX encoding for transpose matrix functions was broken
- - fixed broken fragment program KIL and SWZ instructions
- - fragment programs that wrote result.depth.z didn't work
-
-
-6.4.1 November 30, 2005
- Bug fixes:
- - redefining a vertex program string didn't take effect in TNL module
- - fixed occasional segfault upon vertex/fragment parsing error
- - vertex program LIT instruction didn't handle 0^0=1 correctly
- - fragment program fog option didn't work with glDrawPixels, glBitmap
- - USE_MGL_NAMESPACE didn't work for x86-64
- - OSMesa demos were missing from previous release tarballs
- - fixed problem with float->ushort conversion in glClear (bug 4992)
- - popping of GL_EYE_PLANE texgen state was broken (bug 4996)
- - popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
- - fixed occasional triangle color interpolation problem on VMS
- - work around invalid free() call (bug 5131)
- - fixed BSD X server compilation problem by including stdint.h
diff --git a/nx-X11/extras/Mesa/docs/banner.html b/nx-X11/extras/Mesa/docs/banner.html
deleted file mode 100644
index 9cb27bb6d..000000000
--- a/nx-X11/extras/Mesa/docs/banner.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <title>Banner</title>
-</head>
-<body bgcolor="#000000" text="#ffffff">
-<center>
-<table style="width: 95%; text-align: left;" border="0" cellpadding="2"
- cellspacing="2">
- <tbody>
- <tr>
- <td style="vertical-align: top;">
- <p><img src="gears.png"> </p>
- </td>
- <td style="text-align: center;"><font face="sans-serif" size="5">The
-Mesa 3D Graphics Library</font></td>
- <td style="vertical-align: top; text-align: right;">
- <p><img src="gears.png"> </p>
- </td>
- </tr>
- </tbody>
-</table>
-<p><font face="sans-serif" size="5"><br>
-</font></p>
-</center>
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/bugs.html b/nx-X11/extras/Mesa/docs/bugs.html
deleted file mode 100644
index d255f4292..000000000
--- a/nx-X11/extras/Mesa/docs/bugs.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Bug Reporting</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Bug Database</H1>
-
-<p>
-The Mesa bug database is now hosted on
-<a href="http://freedesktop.org" target="_parent">freedesktop.org</a>
-instead of SourceForge.
-</p>
-
-<p>
-To file a Mesa bug, go to
-<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"
-target="_parent">
-Bugzilla on freedesktop.org</a>
-</p>
-
-<p>
-Please follow these bug reporting guidelines:
-</p>
-
-<ul>
-<li>Make sure you're using the most recent version of Mesa
-<li>Make sure your bug isn't already reported
-<li>Include as much information as possible in the report
-<li>Provide a simple GLUT-based test program if possible
-<li>Check back for follow-ups to the report
-</ul>
-
-<p>
-Bug reports will automatically be forwarded to the Mesa developer's mailing
-list.
-</p>
-
-<p>
-The easier a bug is to reproduce, the sooner it will be fixed.
-Please do everything you can to facilitate quickly fixing bugs.
-If your bug report is vague or your test program doesn't compile
-easily, the problem may not be fixed very quickly.
-</p>
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/conform.html b/nx-X11/extras/Mesa/docs/conform.html
deleted file mode 100644
index 3611f8c6f..000000000
--- a/nx-X11/extras/Mesa/docs/conform.html
+++ /dev/null
@@ -1,695 +0,0 @@
-<HTML>
-
-<TITLE>Conformance</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Conformance</H1>
-
-<p>
-The SGI OpenGL conformance tests verify correct operation of OpenGL
-implementations. I, Brian Paul, have been given a copy of the tests
-for testing Mesa. The tests are not publically available.
-</p>
-<p>
-This file has the latest results of testing Mesa with the OpenGL 1.2
-conformance tests. Testing with the preliminary OpenGL 1.3 tests has
-also been done. Mesa passes all the 1.3 tests.
-</p>
-<p>
-The tests were run using the software X11 device driver on 24-bpp
-and 16-bpp displays.
-</p>
-<p>
-Mesa 4.0 and later pass all conformance tests at all path levels.
-Note that this says nothing about the conformance of hardware drivers
-based upon Mesa.
-</p>
-
-
-<pre>
-
-COVERAGE TESTS
---------------
-
-Test that all API functions accept the legal parameters and reject
-illegal parameters. The result of each test is either pass or fail.
-
-% covgl
-OpenGL Coverage Test.
-Version 1.2
-
-covgl passed.
-
-covgl passed at 1.1 level.
-
-covgl passed at 1.2 level.
-
-covgl passed for ARB_multitexture.
-
-
-% covglu
-OpenGL GLU Coverage Test.
-Version 1.3
-
-covglu passed.
-
-covglu passed at 1.1 level.
-
-
-% covglx
-OpenGL X Coverage Test.
-Version 1.1.1
-
-covglx passed.
-
-
-% primtest -v
-Open GL Primitives Test.
-Version 1.2
-
-[lots of output deleted]
-
-292159 Combinations.
-primtest passed.
-
-
-
-
-GL CONFORMANCE TEST
-===================
-
-Render test images, read them back, then test for expected results.
-
-
-----------------------------------------------------------------------
-% conform -v 2
-
-OpenGL Conformance Test
-Version 1.2
-
-Setup Report.
- Verbose level = 2.
- Random number seed = 1.
- Path inactive.
-
-Visual Report.
- Display ID = 35. Indirect Rendering.
- Double Buffered.
- RGBA (5, 6, 5, 0).
- Stencil (8).
- Depth (16).
- Accumulation (16, 16, 16, 16).
-
-Epsilon Report.
- zero error epsilon = 0.000122.
- RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
- Depth buffer error epsilon = 0.000137.
- Stencil plane error epsilon = 0.00404.
- Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
-
-Default State test passed.
-Must Pass test passed.
-Divide By Zero test passed.
-Viewport Clamp test passed.
-Matrix Stack test passed.
-Matrix Stack Mixing test passed.
-Vertex Order test passed.
-Transformations test passed.
-Transformation Normal test passed.
-Viewport Transformation test passed.
-Buffer Clear test passed.
-Buffer Corners test passed.
-Buffer Color test passed.
-Color Ramp test passed.
-Mask test passed.
-Buffer Invariance test passed.
-Accumulation Buffer test passed.
-Select test passed.
-Feedback test passed.
-Scissor test passed.
-Alpha Plane Function test passed.
-Stencil Plane Clear test passed.
-Stencil Plane Corners test passed.
-Stencil Plane Operation test passed.
-Stencil Plane Function test passed.
-Depth Buffer Clear test passed.
-Depth Buffer Function test passed.
-Blend test passed.
-Dither test passed.
-LogicOp Function test does not exist for an RGB visual.
-DrawPixels test passed.
-CopyPixels test passed.
-Bitmap Rasterization test passed.
-Point Rasterization test passed.
-Anti-aliased Point test passed.
-Line Rasterization test passed.
-Line Stipple test passed.
-Anti-aliased Line test passed.
-Horizontal and Vertical Line test passed.
-Triangle Rasterization test passed.
-Triangle Tile test passed.
-Triangle Stipple test passed.
-Anti-aliased Triangles test passed.
-Quad Rasterization test passed.
-Polygon Face test passed.
-Polygon Cull test passed.
-Polygon Stipple test passed.
-Polygon Edge test passed.
-Ambient Material test passed.
-Ambient Scene test passed.
-Attenuation Position test passed.
-Diffuse Light test passed.
-Diffuse Material test passed.
-Diffuse Material Normal test passed.
-Diffuse Material Positioning test passed.
-Emissive Material test passed.
-Specular Exponent test passed.
-Specular Exponent Normal test passed.
-Specular Local Eye Half Angle test passed.
-Specular Light test passed.
-Specular Material test passed.
-Specular Normal test passed.
-Spot Positioning test passed.
-Spot Exponent and Positioning test passed.
-Spot Exponent and Direction test passed.
-Fog Exponential test passed.
-Fog Linear test passed.
-Texture Decal test passed.
-Texture Border test passed.
-Mipmaps Selection test passed.
-Mipmaps Interpolation test passed.
-Display Lists test passed.
-Evaluator test passed.
-Evaluator Color test passed.
-Texture Edge Clamp test passed.
-Packed Pixels test passed.
-Texture LOD test passed.
-Rescale Normal test passed.
-Color Table test passed.
-Convolution test passed.
-Convolution Border test passed.
-Histogram test passed.
-MinMax test passed.
-MultiTexture test passed.
-
-Conform passed.
-
-----------------------------------------------------------------------
-% conform -v 2 -p 1
-
-OpenGL Conformance Test
-Version 1.2
-
-Setup Report.
- Verbose level = 2.
- Random number seed = 1.
- Path level = 1.
-
-Visual Report.
- Display ID = 35. Indirect Rendering.
- Double Buffered.
- RGBA (5, 6, 5, 0).
- Stencil (8).
- Depth (16).
- Accumulation (16, 16, 16, 16).
-
-Epsilon Report.
- zero error epsilon = 0.000122.
- RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
- Depth buffer error epsilon = 0.000137.
- Stencil plane error epsilon = 0.00404.
- Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
-
-Default State test passed.
-Must Pass test passed.
-Divide By Zero test passed.
-Viewport Clamp test passed.
-Matrix Stack test passed.
-Matrix Stack Mixing test passed.
-Vertex Order test passed.
-Transformations test passed.
-Transformation Normal test passed.
-Viewport Transformation test passed.
-Buffer Clear test passed.
-Buffer Corners test passed.
-Buffer Color test passed.
-Color Ramp test passed.
-Mask test passed.
-Buffer Invariance test passed.
-Accumulation Buffer test passed.
-Select test passed.
-Feedback test passed.
-Scissor test passed.
-Alpha Plane Function test passed.
-Stencil Plane Clear test passed.
-Stencil Plane Corners test passed.
-Stencil Plane Operation test passed.
-Stencil Plane Function test passed.
-Depth Buffer Clear test passed.
-Depth Buffer Function test passed.
-Blend test passed.
-Dither test passed.
-LogicOp Function test does not exist for an RGB visual.
-DrawPixels test passed.
-CopyPixels test passed.
-Bitmap Rasterization test passed.
-Point Rasterization test passed.
-Anti-aliased Point test passed.
-Line Rasterization test passed.
-Line Stipple test passed.
-Anti-aliased Line test passed.
-Horizontal and Vertical Line test passed.
-Triangle Rasterization test passed.
-Triangle Tile test passed.
-Triangle Stipple test passed.
-Anti-aliased Triangles test passed.
-Quad Rasterization test passed.
-Polygon Face test passed.
-Polygon Cull test passed.
-Polygon Stipple test passed.
-Polygon Edge test passed.
-Ambient Material test passed.
-Ambient Scene test passed.
-Attenuation Position test passed.
-Diffuse Light test passed.
-Diffuse Material test passed.
-Diffuse Material Normal test passed.
-Diffuse Material Positioning test passed.
-Emissive Material test passed.
-Specular Exponent test passed.
-Specular Exponent Normal test passed.
-Specular Local Eye Half Angle test passed.
-Specular Light test passed.
-Specular Material test passed.
-Specular Normal test passed.
-Spot Positioning test passed.
-Spot Exponent and Positioning test passed.
-Spot Exponent and Direction test passed.
-Fog Exponential test passed.
-Fog Linear test passed.
-Texture Decal test passed.
-Texture Border test passed.
-Mipmaps Selection test passed.
-Mipmaps Interpolation test passed.
-Display Lists test passed.
-Evaluator test passed.
-Evaluator Color test passed.
-Texture Edge Clamp test passed.
-Packed Pixels test passed.
-Texture LOD test passed.
-Rescale Normal test passed.
-Color Table test passed.
-Convolution test passed.
-Convolution Border test passed.
-Histogram test passed.
-MinMax test passed.
-MultiTexture test passed.
-
-Conform passed.
-
-----------------------------------------------------------------------
-% conform -v 2 -p 2
-
-OpenGL Conformance Test
-Version 1.2
-
-Setup Report.
- Verbose level = 2.
- Random number seed = 1.
- Path level = 2.
-
-Visual Report.
- Display ID = 35. Indirect Rendering.
- Double Buffered.
- RGBA (5, 6, 5, 0).
- Stencil (8).
- Depth (16).
- Accumulation (16, 16, 16, 16).
-
-Epsilon Report.
- zero error epsilon = 0.000122.
- RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
- Depth buffer error epsilon = 0.000137.
- Stencil plane error epsilon = 0.00404.
- Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
-
-Default State test passed.
-Must Pass test passed.
-Divide By Zero test passed.
-Viewport Clamp test passed.
-Matrix Stack test passed.
-Matrix Stack Mixing test passed.
-Vertex Order test passed.
-Transformations test passed.
-Transformation Normal test passed.
-Viewport Transformation test passed.
-Buffer Clear test passed.
-Buffer Corners test passed.
-Buffer Color test passed.
-Color Ramp test passed.
-Mask test passed.
-Buffer Invariance test passed.
-Accumulation Buffer test passed.
-Select test passed.
-Feedback test passed.
-Scissor test passed.
-Alpha Plane Function test passed.
-Stencil Plane Clear test passed.
-Stencil Plane Corners test passed.
-Stencil Plane Operation test passed.
-Stencil Plane Function test passed.
-Depth Buffer Clear test passed.
-Depth Buffer Function test passed.
-Blend test passed.
-Dither test passed.
-LogicOp Function test does not exist for an RGB visual.
-DrawPixels test passed.
-CopyPixels test passed.
-Bitmap Rasterization test passed.
-Point Rasterization test passed.
-Anti-aliased Point test passed.
-Line Rasterization test passed.
-Line Stipple test passed.
-Anti-aliased Line test passed.
-Horizontal and Vertical Line test passed.
-Triangle Rasterization test passed.
-Triangle Tile test passed.
-Triangle Stipple test passed.
-Anti-aliased Triangles test passed.
-Quad Rasterization test passed.
-Polygon Face test passed.
-Polygon Cull test passed.
-Polygon Stipple test passed.
-Polygon Edge test passed.
-Ambient Material test passed.
-Ambient Scene test passed.
-Attenuation Position test passed.
-Diffuse Light test passed.
-Diffuse Material test passed.
-Diffuse Material Normal test passed.
-Diffuse Material Positioning test passed.
-Emissive Material test passed.
-Specular Exponent test passed.
-Specular Exponent Normal test passed.
-Specular Local Eye Half Angle test passed.
-Specular Light test passed.
-Specular Material test passed.
-Specular Normal test passed.
-Spot Positioning test passed.
-Spot Exponent and Positioning test passed.
-Spot Exponent and Direction test passed.
-Fog Exponential test passed.
-Fog Linear test passed.
-Texture Decal test passed.
-Texture Border test passed.
-Mipmaps Selection test passed.
-Mipmaps Interpolation test passed.
-Display Lists test passed.
-Evaluator test passed.
-Evaluator Color test passed.
-Texture Edge Clamp test passed.
-Packed Pixels test passed.
-Texture LOD test passed.
-Rescale Normal test passed.
-Color Table test passed.
-Convolution test passed.
-Convolution Border test passed.
-Histogram test passed.
-MinMax test passed.
-MultiTexture test passed.
-
-Conform passed.
-
-----------------------------------------------------------------------
-% conform -v 2 -p 3
-
-OpenGL Conformance Test
-Version 1.2
-
-Setup Report.
- Verbose level = 2.
- Random number seed = 1.
- Path level = 3.
-
-Visual Report.
- Display ID = 35. Indirect Rendering.
- Double Buffered.
- RGBA (5, 6, 5, 0).
- Stencil (8).
- Depth (16).
- Accumulation (16, 16, 16, 16).
-
-Epsilon Report.
- zero error epsilon = 0.000122.
- RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
- Depth buffer error epsilon = 0.000137.
- Stencil plane error epsilon = 0.00404.
- Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
-
-Default State test passed.
-Must Pass test passed.
-Divide By Zero test passed.
-Viewport Clamp test passed.
-Matrix Stack test passed.
-Matrix Stack Mixing test passed.
-Vertex Order test passed.
-Transformations test passed.
-Transformation Normal test passed.
-Viewport Transformation test passed.
-Buffer Clear test passed.
-Buffer Corners test passed.
-Buffer Color test passed.
-Color Ramp test passed.
-Mask test passed.
-Buffer Invariance test passed.
-Accumulation Buffer test passed.
-Select test passed.
-Feedback test passed.
-Scissor test passed.
-Alpha Plane Function test passed.
-Stencil Plane Clear test passed.
-Stencil Plane Corners test passed.
-Stencil Plane Operation test passed.
-Stencil Plane Function test passed.
-Depth Buffer Clear test passed.
-Depth Buffer Function test passed.
-Blend test passed.
-Dither test passed.
-LogicOp Function test does not exist for an RGB visual.
-DrawPixels test passed.
-CopyPixels test passed.
-Bitmap Rasterization test passed.
-Point Rasterization test passed.
-Anti-aliased Point test passed.
-Line Rasterization test passed.
-Line Stipple test passed.
-Anti-aliased Line test passed.
-Horizontal and Vertical Line test passed.
-Triangle Rasterization test passed.
-Triangle Tile test passed.
-Triangle Stipple test passed.
-Anti-aliased Triangles test passed.
-Quad Rasterization test passed.
-Polygon Face test passed.
-Polygon Cull test passed.
-Polygon Stipple test passed.
-Polygon Edge test passed.
-Ambient Material test passed.
-Ambient Scene test passed.
-Attenuation Position test passed.
-Diffuse Light test passed.
-Diffuse Material test passed.
-Diffuse Material Normal test passed.
-Diffuse Material Positioning test passed.
-Emissive Material test passed.
-Specular Exponent test passed.
-Specular Exponent Normal test passed.
-Specular Local Eye Half Angle test passed.
-Specular Light test passed.
-Specular Material test passed.
-Specular Normal test passed.
-Spot Positioning test passed.
-Spot Exponent and Positioning test passed.
-Spot Exponent and Direction test passed.
-Fog Exponential test passed.
-Fog Linear test passed.
-Texture Decal test passed.
-Texture Border test passed.
-Mipmaps Selection test passed.
-Mipmaps Interpolation test passed.
-Display Lists test passed.
-Evaluator test passed.
-Evaluator Color test passed.
-Texture Edge Clamp test passed.
-Packed Pixels test passed.
-Texture LOD test passed.
-Rescale Normal test passed.
-Color Table test passed.
-Convolution test passed.
-Convolution Border test passed.
-Histogram test passed.
-MinMax test passed.
-MultiTexture test passed.
-
-Conform passed.
-
-----------------------------------------------------------------------
-% conform -v 2 -p 4
-
-OpenGL Conformance Test
-Version 1.2
-
-Setup Report.
- Verbose level = 2.
- Random number seed = 1.
- Path level = 4.
-
-Visual Report.
- Display ID = 35. Indirect Rendering.
- Double Buffered.
- RGBA (5, 6, 5, 0).
- Stencil (8).
- Depth (16).
- Accumulation (16, 16, 16, 16).
-
-Epsilon Report.
- zero error epsilon = 0.000122.
- RGBA error epsilon = 0.0324, 0.016, 0.0324, 0.000122.
- Depth buffer error epsilon = 0.000137.
- Stencil plane error epsilon = 0.00404.
- Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
-
-Default State test passed.
-Must Pass test passed.
-Divide By Zero test passed.
-Viewport Clamp test passed.
-Matrix Stack test passed.
-Matrix Stack Mixing test passed.
-Vertex Order test passed.
-Transformations test passed.
-Transformation Normal test passed.
-Viewport Transformation test passed.
-Buffer Clear test passed.
-Buffer Corners test passed.
-Buffer Color test passed.
-Color Ramp test passed.
-Mask test passed.
-Buffer Invariance test passed.
-Accumulation Buffer test passed.
-Select test passed.
-Feedback test passed.
-Scissor test passed.
-Alpha Plane Function test passed.
-Stencil Plane Clear test passed.
-Stencil Plane Corners test passed.
-Stencil Plane Operation test passed.
-Stencil Plane Function test passed.
-Depth Buffer Clear test passed.
-Depth Buffer Function test passed.
-Blend test passed.
-Dither test passed.
-LogicOp Function test does not exist for an RGB visual.
-DrawPixels test passed.
-CopyPixels test passed.
-Bitmap Rasterization test passed.
-Point Rasterization test passed.
-Anti-aliased Point test passed.
-Line Rasterization test passed.
-Line Stipple test passed.
-Anti-aliased Line test passed.
-Horizontal and Vertical Line test passed.
-Triangle Rasterization test passed.
-Triangle Tile test passed.
-Triangle Stipple test passed.
-Anti-aliased Triangles test passed.
-Quad Rasterization test passed.
-Polygon Face test passed.
-Polygon Cull test passed.
-Polygon Stipple test passed.
-Polygon Edge test passed.
-Ambient Material test passed.
-Ambient Scene test passed.
-Attenuation Position test passed.
-Diffuse Light test passed.
-Diffuse Material test passed.
-Diffuse Material Normal test passed.
-Diffuse Material Positioning test passed.
-Emissive Material test passed.
-Specular Exponent test passed.
-Specular Exponent Normal test passed.
-Specular Local Eye Half Angle test passed.
-Specular Light test passed.
-Specular Material test passed.
-Specular Normal test passed.
-Spot Positioning test passed.
-Spot Exponent and Positioning test passed.
-Spot Exponent and Direction test passed.
-Fog Exponential test passed.
-Fog Linear test passed.
-Texture Decal test passed.
-Texture Border test passed.
-Mipmaps Selection test passed.
-Mipmaps Interpolation test passed.
-Display Lists test passed.
-Evaluator test passed.
-Evaluator Color test passed.
-Texture Edge Clamp test passed.
-Packed Pixels test passed.
-Texture LOD test passed.
-Rescale Normal test passed.
-Color Table test passed.
-Convolution test passed.
-Convolution Border test passed.
-Histogram test passed.
-MinMax test passed.
-MultiTexture test passed.
-
-Conform passed.
-
-
-
-GLX CONFORMANCE TEST
-====================
-
-% conformx -v 2
-
-OpenGL X Conformance Test
-Version 1.1.1
-
-Setup Report.
- Verbose level = 2.
- Random number seed = 1.
- Path inactive.
-
-Visual Report.
- Display ID = 34. Direct Rendering.
- Double Buffered.
- RGBA (8, 8, 8, 0).
- Stencil (8).
- Depth (16).
- Accumulation (16, 16, 16, 16).
-
-Epsilon Report.
- zero error epsilon = 0.000122.
- RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122.
- Depth buffer error epsilon = 0.000137.
- Stencil plane error epsilon = 0.00404.
- Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137.
-
-Default State test passed.
-glReadPixels() test passed.
-Font test passed.
-
-Conformx passed.
-
-
-</pre>
-
-NOTE: conformx passes for all machine path levels (-p option).
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/contents.html b/nx-X11/extras/Mesa/docs/contents.html
deleted file mode 100644
index 88b7bc7de..000000000
--- a/nx-X11/extras/Mesa/docs/contents.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<html>
-
-<title>Contents</title>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<!--Override a few values from the style sheet: -->
-<style>
-<!--
-body {
- background-color: #cccccc;
- color: black;
-}
-a:link {
- color: #000;
-}
-a:visited {
- color: #000;
-}
--->
-</style>
-
-
-<b>Documentation</b>
-<ul>
-<li><a href="intro.html" target="MainFrame">Introduction</a>
-<li><a href="news.html" target="MainFrame">News</a>
-<li><a href="systems.html" target="MainFrame">Platforms and Drivers</a>
-<li><a href="license.html" target="MainFrame">License & Copyright</a>
-<li><a href="faq.html" target="MainFrame">FAQ</a>
-<li><a href="VERSIONS" target="MainFrame">Version History</a>
-<li><a href="relnotes.html" target="MainFrame">Release Notes</a>
-<li><a href="thanks.html" target="MainFrame">Acknowledgements</a>
-<li><a href="conform.html" target="MainFrame">Conformance Testing</a>
-<li>more docs below...
-</ul>
-
-<b>Download / Install</b>
-<ul>
-<li><a href="download.html" target="MainFrame">Downloading/Unpacking</a>
-<li><a href="install.html" target="MainFrame">Compilation/Installation</a>
-<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
-<li><a href="precompiled.html" target="MainFrame">Precompiled Libraries</a>
-</ul>
-
-<b>Resources</b>
-<ul>
-<li><a href="lists.html" target="MainFrame">Mailing Lists</a>
-<li><a href="bugs.html" target="MainFrame">Bug Database</a>
-<li><a href="webmaster.html" target="MainFrame">Webmaster</a>
-</ul>
-
-<b>User Topics</b>
-<ul>
-<LI><A HREF="envvars.html" target="MainFrame">Environment Variables</A>
-<LI><A HREF="osmesa.html" target="MainFrame">Off-Screen Rendering</A>
-<LI><A HREF="pbuffers.html" target="MainFrame">Pbuffer Rendering</A>
-<LI><A HREF="debugging.html" target="MainFrame">Debugging Tips</A>
-<LI><A HREF="perf.html" target="MainFrame">Performance Tips</A>
-<LI><A HREF="extensions.html" target="MainFrame">Mesa Extensions</A>
-<LI><A HREF="mangling.html" target="MainFrame">Function Name Mangling</A>
-</ul>
-
-<b>Developer Topics</b>
-<ul>
-<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
-<li><a href="cvs_access.html" target="MainFrame">CVS Access</a>
-<li><a href="cvs_branches.html" target="MainFrame">CVS Branch Info</a>
-<li><a href="utilities.html" target="MainFrame">Utilities</a>
-<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
-<li><a href="devinfo.html" target="MainFrame">Development Notes</a>
-<li><a href="sourcedocs.html" target="MainFrame">Source Documentation</a>
-<li><a href="subset.html" target="MainFrame">Subset Information</a>
-<li><a href="fbdev-dri.html" target="MainFrame">fbdev/DRI Environment</a>
-<li><a href="glfbdev-driver.html" target="MainFrame">glFBDev Driver</a>
-<LI><A HREF="custom.html" target="MainFrame">Custom Development</A>
-</ul>
-
-<b>Links</b>
-<ul>
-<li><a href="http://www.opengl.org" target="_parent">OpenGL website</a>
-<li><a href="http://dri.sourceforge.net" target="_parent">DRI website</a>
-<li><a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>
-<li><a href="games.html" target="MainFrame">Games and Entertainment</a>
-<li><a href="libraries.html" target="MainFrame">Libraries and Toolkits</a>
-<li><a href="modelers.html" target="MainFrame">Modeling and Rendering</a>
-<li><a href="science.html" target="MainFrame">Science and Technical</a>
-<li><a href="utility.html" target="MainFrame">Utilities</a>
-<li><a href="demos.html" target="MainFrame">Demos / other</a>
-</ul>
-
-<b>Hosted by:</b>
-<br>
-<blockquote>
-<A HREF="http://sourceforge.net"
-target="_parent"><IMG SRC="http://sourceforge.net/sflogo.php?group_id=3&type=1"
-WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A>
-</blockquote>
-
-</body>
-</html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/custom.html b/nx-X11/extras/Mesa/docs/custom.html
deleted file mode 100644
index e9beba6fa..000000000
--- a/nx-X11/extras/Mesa/docs/custom.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<HTML>
-
-<TITLE>Custom Development</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Custom Development</H1>
-
-<p>
-Mesa is primarily developed and maintained on a volunteer basis.
-Some Mesa development work has been done in conjuction with contracted
-projects, such as the XFree86/DRI drivers.
-</p>
-
-<p>
-<pre>[Begin shameless plug]</pre>
-If you have a need for specific or custom Mesa development work,
-<a href="http://www.tungstengraphics.com/" target="_parent">
-Tungsten Graphics, Inc.</a> may be able to help you.
-<pre>[End shameless plug]</pre>
-</p>
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/cvs_access.html b/nx-X11/extras/Mesa/docs/cvs_access.html
deleted file mode 100644
index c57f1c832..000000000
--- a/nx-X11/extras/Mesa/docs/cvs_access.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<HTML>
-
-<TITLE>CVS Access</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<h1>CVS Access</h1>
-
-<p>
-Mesa's CVS repository (code management system) is hosted on
-<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
-</p>
-
-<p>
-You may access the repository either as an
-<a href="#anonymous">anonymous user</a> (read-only) or as a
-<a href="#developer">developer</a>
-(read/write).
-</p>
-
-<p>
-You may also
-<a href="http://freedesktop.org/cgi-bin/viewcvs.cgi/mesa/Mesa/"
-target="_parent">browse the CVS repository</a>.
-</p>
-
-
-<a name="anonymous">
-<H2>Anonymous CVS Access</H2>
-
-<p>
-Anonymous, public, read-only access to the CVS repository is available.
-Here are the basic instructions for Unix systems:
-</p>
-
-<ol>
-<li>Install CVS client software on your computer if needed.
- Version 1.9.28 is known to work.
-<li>Login as an anonymous user:
- <pre>
- cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa login
- </pre>
- Just press Enter/Return when prompted for a password.
- <br>
- <br>
-<li>Check out the code:
- <pre>
- cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa co Mesa
- </pre>
-</ol>
-
-
-<p>To update your Mesa CVS source to the latest CVS source:</p>
-
-<ol>
-<li><code>cd Mesa</code>
-<li><code>cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa update</code>
-</ol>
-
-
-<a name="developer">
-<H2>Developer CVS Access</H2>
-
-<p>
-Mesa developers working with the Mesa CVS repository need to first
-have an account on <a href="http://www.freedesktop.org" target="_parent">
-freedesktop.org</a>.
-To get an account, please ask Brian or the other Mesa developers for
-permission.
-Then, if there are no objections, follow this
-<a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent">
-procedure</a>.
-</p>
-
-<p>
-Once your account is established, you can check out the Mesa CVS tree
-with:
-<pre>
- setenv CVS_RSH ssh (if using a csh-like shell)
-</pre>
-<em>OR</em>
-<pre>
- export CVS_RSH=rsh (if using a bash-like shell)
-</pre>
-followed by:
-<pre>
- cvs -d:ext:yourusername@pdx.freedesktop.org:/cvs/mesa co Mesa
-</pre>
-
-<p>
-Of course, replace <em>yourusername</em> with your actual login name.
-</p>
-
-<p>
-Subsequent updates should only require:
-</p>
-<pre>
- cvs update
-</pre>
-
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/cvs_branches.html b/nx-X11/extras/Mesa/docs/cvs_branches.html
deleted file mode 100644
index 98df3d0f4..000000000
--- a/nx-X11/extras/Mesa/docs/cvs_branches.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<HTML>
-
-<TITLE>CVS Branches</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>CVS Branch Information</H1>
-
-<p>
-At any given time, there may be several active branches in Mesa's
-CVS repository.
-
-Generally, the CVS trunk contains the latest development (unstable)
-code while a CVS branch has the latest stable code.
-</p>
-
-<p>
-Currently (Oct 2004), the trunk is the Mesa 6.3 development code
-while the mesa_6_2_branch branch has the stable Mesa 6.2.x code.
-</p>
-
-<p>
-Mesa releases use an even/odd numbering scheme to represent stable/development
-releases.
-
-For example, Mesa 6.2 (0 is considered even) is a stable release while
-Mesa 6.3 is a development release.
-</p>
-
-<p>
-To checkout a specific CVS branch pass <code>-r</code> and
-the branch tag after your CVS command.
-
-For example <code>cvs checkout -r mesa_6_2_branch Mesa</code> will
-checkout the 6.2 branch and <code>cvs update -r
-mesa_6_2_branch</code> will convert your current CVS tree to the 6.2
-branch.
-
-Consult <a href="http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54"
-target="_parent">http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54</a>
-for more on branching in CVS.
-</p>
-
-<p>
-To see a list of all the CVS branches run <code>cvs log README</code> (or any
-other file) and look for the section labeled <code>symbolic names</code>.
-You'll see something like this:
-</p>
-
-<pre> symbolic names:
- mesa_4_0: 1.3
- mesa_4_0_branch: 1.3.0.6
- mesa_3_5: 1.3
- mesa_3_4_2: 1.3
- mesa_3_4_1: 1.3
- mesa_3_4: 1.3
- mesa_3_4_branch: 1.3.0.4
- mesa_3_3: 1.3
- mesa_3_2_1: 1.1.1.1
- mesa_3_3_texture_env_combine2: 1.3.0.2
- mesa_3_2: 1.1.1.1
- mesa_3_2_beta_1: 1.1.1.1
- mesa_3_1: 1.1.1.1
- mesa_3_2_dev: 1.1.1.1.0.2
- mesa_3_1_beta_3: 1.1.1.1
- start: 1.1.1.1
- mesa: 1.1.1
-</pre>
-
-<p>
-Most will be obsolete branches. Generally, the newer branches are at
-the top. Ask on the mesa3d-dev mailing list to learn which branches
-are active.
-</p>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/debugging.html b/nx-X11/extras/Mesa/docs/debugging.html
deleted file mode 100644
index 2df62f56e..000000000
--- a/nx-X11/extras/Mesa/docs/debugging.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<HTML>
-
-<TITLE>Debugging Tips</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Debugging Tips</H1>
-
-<p>
- Normally Mesa (and OpenGL) records but does not notify the user of
- errors. It is up to the application to call
- <code>glGetError</code> to check for errors. Mesa supports an
- environment variable, MESA_DEBUG, to help with debugging. If
- MESA_DEBUG is defined, a message will be printed to stdout whenever
- an error occurs.
-</p>
-
-<p>
- More extensive error checking is done when Mesa is compiled with the
- DEBUG symbol defined. You'll have to edit the Make-config file and
- add -DDEBUG to the CFLAGS line for your system configuration. You may
- also want to replace any optimization flags with the -g flag so you can
- use your debugger. After you've edited Make-config type 'make clean'
- before recompiling.
-</p>
-<p>
- In your debugger you can set a breakpoint in _mesa_error() to trap Mesa
- errors.
-</p>
-<p>
- There is a display list printing/debugging facility. See the end of
- src/dlist.c for details.
-</p>
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/demos.html b/nx-X11/extras/Mesa/docs/demos.html
deleted file mode 100644
index b4a2cc5e3..000000000
--- a/nx-X11/extras/Mesa/docs/demos.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<HTML>
-
-<TITLE>Demos</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Demos</H1>
-
-
-<ul>
-<li><a href="http://www.geocities.com/shobhand/homepage.html">Shobhan Dutta's Geartrain and Walkthrough Demos</a>
-</li></ul>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/devinfo.html b/nx-X11/extras/Mesa/docs/devinfo.html
deleted file mode 100644
index 9fcd8cf53..000000000
--- a/nx-X11/extras/Mesa/docs/devinfo.html
+++ /dev/null
@@ -1,206 +0,0 @@
-<HTML>
-
-<TITLE>Development Notes</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Development Notes</H1>
-
-
-<H2>Adding Extentions</H2>
-
-<p>
-To add a new GL extension to Mesa you have to do at least the following.
-
-<ul>
-<li>
- If glext.h doesn't define the extension, edit include/GL/gl.h and add
- code like this:
- <pre>
- #ifndef GL_EXT_the_extension_name
- #define GL_EXT_the_extension_name 1
- /* declare the new enum tokens */
- /* prototype the new functions */
- /* TYPEDEFS for the new functions */
- #endif
- </pre>
-</li>
-<li>
- In the src/mesa/glapi/ directory, add the new extension functions and
- enums to the gl_API.xml file.
- Then, a bunch of source files must be regenerated by executing the
- corresponding Python scripts.
-</li>
-<li>
- Find an existing extension that's similar to the new one and search
- the sources for code related to that extension.
- Implement new code as needed.
- In general, new state variables will be added to mtypes.h. If the
- extension is rather large, try to implement it in a new source file.
-</li>
-<li>
- If the new extension adds new GL state, the functions in get.c, enable.c
- and attrib.c will most likely require new code.
-</li>
-</ul>
-
-
-
-<H2>Coding Style</H2>
-
-<p>
-Mesa's code style has changed over the years. Here's the latest.
-</p>
-
-<p>
-Comment your code! It's extremely important that open-source code be
-well documented. Also, strive to write clean, easily understandable code.
-</p>
-
-<p>
-3-space indentation
-</p>
-
-<p>
-If you use tabs, set them to 8 columns
-</p>
-
-<p>
-Brace example:
-</p>
-<pre>
- if (condition) {
- foo;
- }
- else {
- bar;
- }
-</pre>
-
-<p>
-Here's the GNU indent command which will best approximate my preferred style:
-</p>
-<pre>
- indent -br -i3 -npcs infile.c -o outfile.c
-</pre>
-
-
-<p>
-Local variable name example: localVarName (no underscores)
-</p>
-
-<p>
-Constants and macros are ALL_UPPERCASE, with _ between words
-</p>
-
-<p>
-Global variables are not allowed.
-</p>
-
-<p>
-Function name examples:
-</p>
-<pre>
- glFooBar() - a public GL entry point (in dispatch.c)
- _mesa_FooBar() - the internal immediate mode function
- save_FooBar() - retained mode (display list) function in dlist.c
- foo_bar() - a static (private) function
- _mesa_foo_bar() - an internal non-static Mesa function
-</pre>
-
-
-<H2>Making a New Mesa Release</H2>
-
-<p>
-These are the instructions for making a new Mesa release.
-</p>
-
-<H3>Get latest source files</H3>
-<p>
-Use "cvs update -dAP " to get the latest Mesa files from CVS.
-</p>
-
-
-<H3>Verify and update version info</H3>
-<p>
-Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
-Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
-Update the docs/VERSIONS file too.
-</p>
-
-<p>
-Edit configs/default and change the MESA_MAJOR, MESA_MINOR and MESA_TINY
-version numbers.
-</p>
-
-<p>
-Make sure the values in src/mesa/main/version.h is correct.
-</p>
-
-<p>
-Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
-DEMO_NAME are correct.
-</p>
-
-<p>
-Update the docs/news.html file and docs/contents.html files.
-</p>
-
-<p>
-Check in all updates to CVS.
-</p>
-
-<p>
-Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
-</p>
-
-
-<H3>Make the tarballs</H3>
-<p>
-Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
-ln -s Mesa Mesa-6.3
-This is needed in order to make a correct tar file in the next step.
-</p>
-
-<p>
-Make the distribution files. From inside the Mesa directory:
-<pre>
- make tarballs
-</pre>
-
-<p>
-After the tarballs are created, the md5 checksums for the files will
-be computed.
-Add them to the docs/news.html file.
-</p>
-
-<p>
-Copy the distribution files to a temporary directory, unpack them,
-compile everything, and run some demos to be sure everything works.
-</p>
-
-<H3>Update the website and announce the release</H3>
-<p>
-Follow the directions on SourceForge for creating a new "release" and
-uploading the tarballs.
-</p>
-
-<p>
-Update the web site by copying the docs/ directory's files to
-/home/users/b/br/brianp/mesa-www/htdocs/
-</p>
-
-<p>
-Make an announcement on the mailing lists:
-<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
-<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
-and
-<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
-</p>
-
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/download.html b/nx-X11/extras/Mesa/docs/download.html
deleted file mode 100644
index 60d76756e..000000000
--- a/nx-X11/extras/Mesa/docs/download.html
+++ /dev/null
@@ -1,130 +0,0 @@
-<HTML>
-
-<TITLE>Getting Mesa</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Downloading</H1>
-
-<p>
-Current stable release: <b>6.4.1</b>
-</p>
-
-<p>
-Primary download site:
-<a href="http://sourceforge.net/project/showfiles.php?group_id=3"
-target="_parent">SourceForge</a>
-</p>
-
-
-<p>
-Mesa is distributed in several parts:
-</p>
-<ul>
-<li><b>MesaLib-x.y.z</b> - the main Mesa library source code, drivers
- and documentation.
-</li>
-<li><b>MesaDemos-x.y.z</b> - OpenGL demonstration and test programs.
- Most of the programs require GLUT (either the
- <a href="http://www.opengl.org/resources/libraries/glut.html"
- target="_parent">original GLUT by Mark Kilgard</a> or
- <a href="http://freeglut.sourceforge.net" target="_parent">freeglut</a> or
- <a href="http://freeglut.sourceforge.net" target="_parent">OpenGLUT</a>).
-</li>
-<li><b>MesaGLUT-x.y.z</b> - Mark Kilgard's GLUT, easily compiled and used
- with Mesa. Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc.
-</li>
-</ul>
-
-<p>
-If you're not interested in running the demos, you'll only need the first
-package.
-</p>
-
-<p>
-The packages are available in .tar.gz, .tar.bz2 and .zip formats.
-Other organizations might offer additional package formats.
-</p>
-
-<H1>Unpacking</H1>
-
-<p>
-All the packages should be in the same directory prior to unpacking.
-</p>
-
-<ul>
-<li>To unpack .tar.gz files:
-<pre>
- tar zxf MesaLib-X.Y.tar.gz
- tar zxf MesaDemos-X.Y.tar.gz
- tar zxf MesaGLUT-X.Y.tar.gz
-</pre>
-or
-<pre>
- gzcat MesaLib-X.Y.tar.gz | tar xf -
- gzcat MesaDemos-X.Y.tar.gz | tar xf -
- gzcat MesaGLUT-X.Y.tar.gz | tar xf -
-</pre>
-or
-<pre>
- gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
- gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar
- gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar
-</pre>
-<li>To unpack .tar.bz2 files:
-<pre>
- bunzip2 -c MesaLib-X.Y.tar.gz | tar xf -
- bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf -
- bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf -
-</pre>
-<li>To unpack .zip files:
-<pre>
- unzip MesaLib-X.Y.zip
- unzip MesaDemos-X.Y.zip
- unzip MesaGLUT-X.Y.zip
-</pre>
-</ul>
-
-
-<h1>Contents</h1>
-
-<p>
-After unpacking you'll have these directories:
-</p>
-<pre>
-Makefile - top-level Makefile for most systems
-configs/ - makefile parameter files for various systems
-include/ - GL header (include) files
-bin/ - shell scripts for making shared libraries, etc
-docs/ - documentation
-src/ - source code for libraries
-src/mesa - sources for the main Mesa library and device drivers
-src/glu - libGLU source code
-src/glw - Xt/Motif/OpenGL widget code
-</pre>
-
-If you downloaded and unpacked the MesaDemos.X.Y package:
-
-<pre>
-progs/demos - original Mesa demos
-progs/xdemos - GLX OpenGL/Mesa demos
-progs/redbook - examples from the OpenGL Programming Guide
-progs/samples - examples from SGI
-progs/images/ - image files
-</pre>
-
-If you downloaded and unpacked the MesaGLUT.X.Y package:
-<pre>
-src/glut - GLUT library source code
-</pre>
-
-<p>
-Proceed to the <a href="install.html">compilation and installation
-instructions</a>.
-</p>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/enums.txt b/nx-X11/extras/Mesa/docs/enums.txt
deleted file mode 100644
index 218391c30..000000000
--- a/nx-X11/extras/Mesa/docs/enums.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-
-Blocks allocated to Mesa:
- 0x8750-0x875F
- 0x8BB0-0x8BBF
-
-
-GL_MESA_packed_depth_stencil
- GL_DEPTH_STENCIL_MESA 0x8750
- GL_UNSIGNED_INT_24_8_MESA 0x8751
- GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
- GL_UNSIGNED_SHORT_15_1_MESA 0x8753
- GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
-
-GL_MESA_trace.spec:
- GL_TRACE_ALL_BITS_MESA 0xFFFF
- GL_TRACE_OPERATIONS_BIT_MESA 0x0001
- GL_TRACE_PRIMITIVES_BIT_MESA 0x0002
- GL_TRACE_ARRAYS_BIT_MESA 0x0004
- GL_TRACE_TEXTURES_BIT_MESA 0x0008
- GL_TRACE_PIXELS_BIT_MESA 0x0010
- GL_TRACE_ERRORS_BIT_MESA 0x0020
- GL_TRACE_MASK_MESA 0x8755
- GL_TRACE_NAME_MESA 0x8756
-
-MESA_ycbcr_texture.spec:
- GL_YCBCR_MESA 0x8757
- GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */
- GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */
-
-GL_MESA_pack_invert.spec
- GL_PACK_INVERT_MESA 0x8758
-
-GL_MESA_program_debug.spec:
- GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x????
- GL_VERTEX_PROGRAM_CALLBACK_MESA 0x????
- GL_FRAGMENT_PROGRAM_POSITION_MESA 0x????
- GL_VERTEX_PROGRAM_POSITION_MESA 0x????
- GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x????
- GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x????
- GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x????
- GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x????
-
diff --git a/nx-X11/extras/Mesa/docs/envvars.html b/nx-X11/extras/Mesa/docs/envvars.html
deleted file mode 100644
index 60cfd3f0c..000000000
--- a/nx-X11/extras/Mesa/docs/envvars.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<HTML>
-
-<TITLE>Environment Variables</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Environment Variables</H1>
-
-<p>
-Mesa supports the following environment variables:
-</p>
-<ul>
-<li>MESA_NO_ASM - if set, disables all assembly language optimizations
-<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
-<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
-<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
-<li>MESA_DEBUG - if set, error messages are printed to stderr.
-If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
-generate exceptions.
-<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
-</ul>
-
-<p>
-The following environment variables are only applicable to the Xlib/X11
-software driver:
-</p>
-<ul>
-<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
-<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
-<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
-<li>MESA_GAMMA - gamma correction coefficients (X only)
-<li>MESA_XSYNC - enable synchronous X behavior (for X debugging only)
-<li>MESA_GLX_FORCE_CI - if set, force GLX to treak 8bpp visuals as CI visuals
-<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
- "window" to render into a window, or "disable" to disable the Glide driver.
-<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
-<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
-</ul>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/extensions.html b/nx-X11/extras/Mesa/docs/extensions.html
deleted file mode 100644
index dbb8ebada..000000000
--- a/nx-X11/extras/Mesa/docs/extensions.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Extensions</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Mesa Extensions</H1>
-
-<p>
-A number of extensions have been developed especially for Mesa.
-The specifications follow.
-</p>
-
-
-<UL>
-<LI><A HREF="MESA_agp_offset.spec">MESA_agp_offset.spec</A>
-<LI><A HREF="MESA_copy_sub_buffer.spec">MESA_copy_sub_buffer.spec</A>
-<LI><A HREF="MESA_packed_depth_stencil.spec">MESA_packed_depth_stencil.spec</A>
-<LI><A HREF="MESA_pack_invert.spec">MESA_pack_invert.spec</A>
-<LI><A HREF="MESA_pixmap_colormap.spec">MESA_pixmap_colormap.spec</A>
-<LI><A HREF="MESA_release_buffers.spec">MESA_release_buffers.spec</A>
-<LI><A HREF="MESA_resize_buffers.spec">MESA_resize_buffers.spec</A>
-<LI><A HREF="MESA_set_3dfx_mode.spec">MESA_set_3dfx_mode.spec</A>
-<LI><A HREF="MESA_sprite_point.spec">MESA_sprite_point.spec</A> (obsolete)
-<LI><A HREF="MESA_trace.spec">MESA_trace.spec</A> (obsolete)
-<LI><A HREF="MESA_window_pos.spec">MESA_window_pos.spec</A>
-<LI><A HREF="MESA_ycbcr_texture.spec">MESA_ycbcr_texture.spec</A>
-</UL>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/faq.html b/nx-X11/extras/Mesa/docs/faq.html
deleted file mode 100644
index b93d5007d..000000000
--- a/nx-X11/extras/Mesa/docs/faq.html
+++ /dev/null
@@ -1,394 +0,0 @@
-<html>
-
-<head><title>Mesa FAQ</title></head>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-
-<center>
-<h1>Mesa Frequently Asked Questions</h1>
-Last updated: 21 October 2004
-</center>
-
-<br>
-<br>
-<h2>Index</h2>
-<a href="#part1">1. High-level Questions and Answers</a>
-<br>
-<a href="#part2">2. Compilation and Installation Problems</a>
-<br>
-<a href="#part3">3. Runtime / Rendering Problems</a>
-<br>
-<a href="#part4">4. Developer Questions</a>
-<br>
-<br>
-<br>
-
-
-
-<a name="part1">
-</a><h1><a name="part1">1. High-level Questions and Answers</a></h1>
-
-<h2><a name="part1">1.1 What is Mesa?</a></h2>
-<p>
-<a name="part1">Mesa is an open-source implementation of the OpenGL specification.
-OpenGL is a programming library for writing interactive 3D applications.
-See the </a><a href="http://www.opengl.org/">OpenGL website</a> for more
-information.
-</p>
-<p>
-Mesa 6.x supports the OpenGL 1.5 specification.
-</p>
-
-
-<h2>1.2 Does Mesa support/use graphics hardware?</h2>
-<p>
-Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
-drivers for XFree86/X.org. See the <a href="http://dri.sf.net/">DRI
-website</a> for more information.
-</p>
-<p>
-There have been other hardware drivers for Mesa over the years (such as
-the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
-are the modern ones.
-</p>
-
-<h2>1.3 What purpose does Mesa serve today?</h2>
-<p>
-Hardware-accelerated OpenGL implementations are available for most popular
-operating systems today.
-Still, Mesa serves at least these purposes:
-</p>
-<ul>
-<li>Mesa is used as the core of the open-source XFree86/X.org DRI
- hardware drivers.
-</li>
-<li>Mesa is quite portable and allows OpenGL to be used on systems
- that have no other OpenGL solution.
-</li>
-<li>Software rendering with Mesa serves as a reference for validating the
- hardware drivers.
-</li>
-<li>A software implementation of OpenGL is useful for experimentation,
- such as testing new rendering techniques.
-</li>
-<li>Mesa can render images with deep color channels: 16-bit integer
- and 32-bit floating point color channels are supported.
- This capability is only now appearing in hardware.
-</li>
-<li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
- changed for special needs (hardware limits are hard to overcome).
-</li>
-</ul>
-
-
-<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
-<p>
-<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
-On systems running the X Window System it does all its rendering through
-the Xlib API:
-<ul>
-<li>The GLX API is supported, but it's really just an emulation of the
- real thing.
-<li>The GLX wire protocol is not supported and there's no OpenGL extension
- loaded by the X server.
-<li>There is no hardware acceleration.
-<li>The OpenGL library, libGL.so, contains everything (the programming API,
- the GLX functions and all the rendering code).
-</ul>
-</p>
-<p>
-Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
-within the DRI (Direct Rendering Infrastructure):
-<ul>
-<li>The libGL.so library provides the GL and GLX API functions, a GLX
- protocol encoder, and a device driver loader.
-<li>The device driver modules (such as r200_dri.so) contain a built-in
- copy of the core Mesa code.
-<li>The X server loads the GLX module.
- The GLX module decodes incoming GLX protocol and dispatches the commands
- to a rendering module.
- For the DRI, this module is basically a software Mesa renderer.
-</ul>
-
-
-
-<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
-<p>
-This wasn't easy in the past.
-Now, the DRI drivers are included in the Mesa tree and can be compiled
-separately from the X server.
-Just follow the Mesa <a href="install.html">compilation instructions</a>.
-</p>
-
-
-<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
-<p>
-Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
-target="_parent">
-OpenGL Sample Implemenation (SI)</a> is available.
-The SI was written during the time that OpenGL was originally designed.
-Unfortunately, development of the SI has stagnated.
-Mesa is much more up to date with modern features and extensions.
-</p>
-
-<p>
-<a href="http://ogl-es.sourceforge.net" target="_parent">Vincent</a> is
-an open-source implementation of OpenGL ES for mobile devices.
-
-<p>
-<a href="http://www.dsbox.com/minigl.html" target="_parent">miniGL</a>
-is a subset of OpenGL for PalmOS devices.
-
-<p>
-<a href="http://fabrice.bellard.free.fr/TinyGL/"
-target="_parent">TinyGL</a> is a subset of OpenGL.
-</p>
-
-<p>
-<a href="http://softgl.studierstube.org/" target="_parent">SoftGL</a>
-is an OpenGL subset for mobile devices.
-</p>
-
-<p>
-<a href="http://chromium.sourceforge.net/" target="_parent">Chromium</a>
-isn't a conventional OpenGL implementation (it's layered upon OpenGL),
-but it does export the OpenGL API. It allows tiled rendering, sort-last
-rendering, etc.
-</p>
-
-<p>
-There may be other open OpenGL implementations, but Mesa is the most
-popular and feature-complete.
-</p>
-
-
-
-<br>
-<br>
-
-
-<a name="part2">
-</a><h1><a name="part2">2. Compilation and Installation Problems</a></h1>
-
-
-<h2><a name="part2">2.1 What's the easiest way to install Mesa?</a></h2>
-<p>
-<a name="part2">If you're using a Linux-based system, your distro CD most likely already
-has Mesa packages (like RPM or DEB) which you can easily install.
-</a></p>
-
-
-<h2><a name="part2">2.2 Running <code>configure; make</code> doesn't Work</a></h2>
-<p>
-Mesa no longer supports GNU autoconf/automake. Why?
-<ul>
-<li>It seemed to seldom work on anything but Linux
-<li>The config files were hard to maintain and hard to understand
-<li>libtool caused a lot of grief
-</ul>
-
-<p>
-Now Mesa again uses a conventional Makefile system (as it did originally).
-Basically, each Makefile in the tree includes one of the configuration
-files from the config/ directory.
-The config files specify all the variables for a variety of popular systems.
-</p>
-
-
-<h2><a name="part2">2.3 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
-<p>
-<a name="part2">You're application is written in IRIS GL, not OpenGL.
-IRIS GL was the predecessor to OpenGL and is a different thing (almost)
-entirely.
-Mesa's not the solution.
-</a></p>
-
-
-<h2><a name="part2">2.4 Where is the GLUT library?</a></h2>
-<p>
-<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaGLUT-x.y.z.tar.gz file.
-If you don't already have GLUT installed, you should grab the MesaGLUT
-package and compile it with the rest of Mesa.
-</a></p>
-
-
-
-<h2><a name="part2">2.5 What's the proper place for the libraries and headers?</a></h2>
-<p>
-<a name="part2">On Linux-based systems you'll want to follow the
-</a><a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"
-target="_parent">Linux ABI</a> standard.
-Basically you'll want the following:
-</p>
-<ul>
-<li>/usr/include/GL/gl.h - the main OpenGL header
-</li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
-</li><li>/usr/include/GL/glx.h - the OpenGL GLX header
-</li><li>/usr/include/GL/glext.h - the OpenGL extensions header
-</li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
-</li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
-</li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
-</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
-</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
-Mesa version number.
-</li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
-</li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
-</li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
-version number.
-</li></ul>
-<p>
-After installing XFree86/X.org and the DRI drivers, some of these files
-may be symlinks into the /usr/X11R6/ tree.
-</p>
-<p>
-The old-style Makefile system doesn't install the Mesa libraries; it's
-up to you to copy them (and the headers) to the right place.
-</p>
-<p>
-The GLUT header and library should go in the same directories.
-</p>
-<br>
-<br>
-
-
-<a name="part3">
-</a><h1><a name="part3">3. Runtime / Rendering Problems</a></h1>
-
-<h2><a name="part3">3.1 Rendering is slow / why isn't my graphics hardware being used?</a></h2>
-<p>
-<a name="part3">Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
-support for hardware acceleration (with the exception of the 3DFX Voodoo
-driver).
-</a></p>
-<p>
-<a name="part3">What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
-for your particular hardware.
-</a></p>
-<p>
-<a name="part3">You can run the <code>glxinfo</code> program to learn about your OpenGL
-library.
-Look for the GL_VENDOR and GL_RENDERER values.
-That will identify who's OpenGL library you're using and what sort of
-hardware it has detected.
-</a></p>
-<p>
-<a name="part3">If your DRI-based driver isn't working, go to the
-</a><a href="http://dri.sf.net/" target="_parent">DRI website</a> for trouble-shooting information.
-</p>
-
-
-<h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
-<p>
-Make sure the ratio of the far to near clipping planes isn't too great.
-Look
-<a href="http://www.sgi.com/software/opengl/advanced97/notes/node18.html"
-target="_parent">
-here</a> for details.
-</p>
-<p>
-Mesa uses a 16-bit depth buffer by default which is smaller and faster
-to clear than a 32-bit buffer but not as accurate.
-If you need a deeper you can modify the parameters to
-<code> glXChooseVisual</code> in your code.
-</p>
-
-
-<h2>3.3 Why Isn't depth buffering working at all?</h2>
-<p>
-Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
-environment variable it will warn you about trying to enable depth testing
-when you don't have a depth buffer.
-</p>
-<p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
-with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
-called with a non-zero value for GLX_DEPTH_SIZE.
-</p>
-<p>This discussion applies to stencil buffers, accumulation buffers and
-alpha channels too.
-</p>
-
-
-<h2>3.4 Why does glGetString() always return NULL?</h2>
-<p>
-Be sure you have an active/current OpenGL rendering context before
-calling glGetString.
-</p>
-
-
-<h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
-<p>
-If you're trying to draw a filled region by using GL_POINTS or GL_LINES
-and seeing holes or gaps it's because of a float-to-int rounding problem.
-But this is not a bug.
-See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
-Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
-will fix the problem.
-</p>
-
-<br>
-<br>
-
-
-<a name="part4">
-</a><h1><a name="part4">4. Developer Questions</a></h1>
-
-<h2><a name="part4">4.1 How can I contribute?</a></h2>
-<p>
-<a name="part4">First, join the Mesa3d-dev mailing list. That's where Mesa development
-is discussed.
-</a></p>
-<p>
-<a name="part4">The </a><a href="http://www.opengl.org/developers/documentation/specs.html" target="_parent">
-OpenGL Specification</a> is the bible for OpenGL implemention work.
-You should read it.
-</p>
-<p>Most of the Mesa development work involves implementing new OpenGL
-extensions, writing hardware drivers (for the DRI), and code optimization.
-</p>
-
-<h2>4.2 How do I write a new device driver?</h2>
-<p>
-Unfortunately, writing a device driver isn't easy.
-It requires detailed understanding of OpenGL, the Mesa code, and your
-target hardware/operating system.
-3D graphics are not simple.
-</p>
-<p>
-The best way to get started is to use an existing driver as your starting
-point.
-For a software driver, the X11 and OSMesa drivers are good examples.
-For a hardware driver, the Radeon and R200 DRI drivers are good examples.
-</p>
-<p>The DRI website has more information about writing hardware drivers.
-The process isn't well document because the Mesa driver interface changes
-over time, and we seldome have spare time for writing documentation.
-That being said, many people have managed to figure out the process.
-</p>
-<p>
-Joining the appropriate mailing lists and asking questions (and searching
-the archives) is a good way to get information.
-</p>
-
-
-<h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa and/or the DRI drivers?</h2>
-<p>
-The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt" target="_parent">specification for the extension</a>
-indicates that there are intellectual property (IP) and/or patent issues
-to be dealt with.
-</p>
-<p>We've been unsucessful in getting a response from S3 (or whoever owns
-the IP nowadays) to indicate whether or not an open source project can
-implement the extension (specifically the compression/decompression
-algorithms).
-</p>
-<p>
-Until we can get official permission to do so, this extension will not
-be implemented in Mesa.
-</p>
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/fbdev-dri.html b/nx-X11/extras/Mesa/docs/fbdev-dri.html
deleted file mode 100644
index 18b0ca815..000000000
--- a/nx-X11/extras/Mesa/docs/fbdev-dri.html
+++ /dev/null
@@ -1,315 +0,0 @@
-<html>
-
-<TITLE>Mesa fbdev/DRI Environment</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<center><H1>Mesa fbdev/DRI Drivers</H1></center>
-
-
-<H1>1. Introduction</H1>
-
-<p>
-The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL
-rendering to the Linux fbdev environment.
-The X Window System / XFree86 is not needed.
-</p>
-
-<p>
-Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware
-accelerated OpenGL for XFree86 have been ported to fbdev so that X is
-not needed.
-This means fbdev/DRI works in full-screen mode only.
-</p>
-
-<p>
-DRI driver writers may find this simplified environment easier to work in,
-compared to the full XFree86/DRI environment.
-</p>
-
-<p>
-Much of the work for this project has been done by Jon Smirl and
-Keith Whitwell.
-</p>
-
-<p>
-To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel.
-</p>
-
-<h3>Background Info</h3>
-
-<p>
-The Mesa-based DRI drivers used to be hosted in the DRI tree (which is
-basically a copy of the XFree86 tree).
-Since the Mesa-based DRI drivers are moreso "Mesa drivers" than "XFree86
-drivers" and the fact that with some work, the drivers could be used
-without X, the driver code was moved into the Mesa tree.
-</p>
-
-<p>
-So now the DRI drivers can be compiled for two different environments:
-fbdev and XFree86.
-To build the drivers for XFree86, one has to download/build the DRI
-source tree.
-Eventually, we'd like to be able to build the drivers for XFree86 outside
-of the XFree86/DRI trees.
-</p>
-
-
-
-
-<h1>2. Compilation</h1>
-
-<h2>2.1 Compiling the DRM modules</h2>
-
-<p>
-First, you'll need the DRM (Direct Rendering Manager) kernel module sources.
-They're found in a module of the DRI CVS tree.
-To obtain the code do the following:
-</p>
-<pre>
- cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri login
-</pre>
-<p>
-Press Enter/Return when prompted for a password. Then,
-</p>
-<pre>
- cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
-</pre>
-
-<p>
-Compile the DRM kernel modules:
-</p>
-<pre>
- cd drm/linux
- make
-</pre>
-
-<p>
-Note: you may need to be root in order to make a few symlinks.
-</p>
-<p>
-When compilation is done, you should have at least the following
-kernel modules:
-</p>
-<pre>
- gamma.o
- i810.o
- i830.o
- mach64.o
- mga.o
- r128.o
- radeon.o
- savage.o
- sis.o
- tdfx.o
- via.o
-</pre>
-<p>
-You'll probably want to copy/move them into your kernel module directory
-(for example: <code>/lib/modules/2.4.18-14/kernel/drivers/char/drm/</code>).
-</p>
-
-
-
-<h2>2.2 Compiling the Mesa drivers</h2>
-
-<p>
-Begin by editing the <code>Mesa/configs/default</code> file to set
-the <code>DRM_SOURCE_PATH</code> variable.
-Set it to the location where the DRM module sources are located.
-For example, if your current directory in step 2.1 was <code>/home/fred/</code>
-set DRM_SOURCE_PATH to <code>/home/fred/drm</code>
-</p>
-
-<p>
-Next, assuming you're starting with a fresh Mesa CVS checkout,
-do the following:
-</p>
-<pre>
- make linux-solo
-</pre>
-
-<p>
-If you previously built the source tree, run <code>make realclean</code>
-first to remove the old object files.
-</p>
-
-<p>
-When this is finished, check the <code>Mesa/lib/</code> directory
-to verify that the following files were made:
-</p>
-
-<ul>
-<li><code>libGL.so.1.2</code> - the client-side OpenGL library
- (and a few symlinks to it).
-<li><code>libGLU.so.1.1</code> - the GLU library (and a few symlinks to it).
-<li><code>libglut.so.3.7</code> - the GLUT library (and a few symlinks to it).
-<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
-<li><code>r128_dri.so</code> - DRI driver for ATI Rage 128 cards.
-<li><code>r200_dri.so</code> - DRI driver for ATI R200 Radeon cards.
-<li><code>radeon_dri.so</code> - DRI driver for original ATI Radeon cards.
-<li><code>i810_dri.so</code> - DRI driver for Intel i810/i815 chips.
-<li><code>i830_dri.so</code> - DRI driver for Intel i830/i845 chips.
-<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
-<li><code>sis_dri.so</code> - DRI driver for SIS cards.
-<li><code>tdfx_dri.so</code> - DRI driver for 3dfx Voodoo 3/4/5 cards.
-<li><code>gamma_dri.so</code> - DRI driver for 3Dlabs gamma cards.
-<li><code>fb_dri.so</code> - software-only fbdev driver.
-<li><code>miniglx.conf</code> - configuration file for the MiniGLX interface
-</ul>
-
-
-<h1>3. Using fbdev/DRI</h1>
-
-<p>
-If XFree86 is currently running, exit/stop the X server so you're
-working from the console.
-</p>
-
-
-<h2>3.1 Load Kernel Modules</h2>
-
-<p>
-You'll need to load the kernel modules specific to your graphics hardware.
-Typically, this consists of the agpgart module, an fbdev driver module
-and the DRM kernel module (from step 2.1).
-</p>
-
-
-<p>
-If you have ATI Radeon/R200 hardware, run as root:
-</p>
-<pre>
- modprobe agpgart # the AGP GART module
- modprobe radeonfb # the Radeon fbdev driver
- modprobe radeon # the Radeon DRI kernel module
-</pre>
-
-<p>
-If you have ATI Rage 128 hardware, run as root:
-</p>
-<pre>
- modprobe agpgart # the AGP GART module
- modprobe aty128fb # the Rage 128 fbdev driver
- modprobe r128 # the Rage 128 DRI kernel module
-</pre>
-
-<p>
-If you have Matrox G200/G400 hardware, run as root:
-</p>
-<pre>
- modprobe agpgart # the AGP GART module
- modprobe mgafb # the Matrox fbdev driver
- modprobe mga # the Matrox DRI kernel module
-</pre>
-
-<p>
-Then run <code>lsmod</code> to be sure the modules are loaded.
-For a Radeon card, you should see something like this:
-</p>
-<pre>
-Module Size Used by Not tainted
-radeon 110308 0 (unused)
-radeonfb 21900 0 (unused)
-agpgart 43072 1
-</pre>
-
-
-
-<h2>3.2 Configuration File</h2>
-
-<p>
-The <code>Mesa/lib/miniglx.conf</code> file should be installed
-in <code>/etc/</code>.
-</p>
-
-<p>
-Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
-for your hardware.
-Comments in the file explain the options.
-</p>
-
-
-<h2>3.3 Running fbdev/DRI Programs</h2>
-
-<p>
-Make sure your LD_LIBRARY_PATH environment variable is set to the
-<code>Mesa/lib/</code> directory.
-</p>
-
-<p>
-Change to the <code>Mesa/progs/miniglx/</code> directory and
-start the sample_server program in the background:
-</p>
-<pre>
- ./sample_server &
-</pre>
-
-<p>
-Then try running the <code>miniglxtest</code> program:
-</p>
-<pre>
- ./miniglxtest
-</pre>
-<p>
-You should see a rotating quadrilateral which changes color as it rotates.
-It will exit automatically after a bit.
-</p>
-
-<p>
-If you run other tests in the miniglx/ directory, you may want to run
-them from a remote shell so that you can stop them with ctrl-C.
-</p>
-
-
-
-<h1>4.0 Troubleshooting</h1>
-
-<p>
-If you try to run miniglxtest and get the following:
-</p>
-<pre>
- [miniglx] failed to probe chipset
- connect: Connection refused
- server connection lost
-</pre>
-<p>
-It means that the sample_server process is not running.
-</p>
-
-
-
-
-<h1>5.0 Programming Information</h1>
-
-<p>
-The full OpenGL API is available with fbdev/DRI.
-</p>
-
-<p>
-OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
-interface.
-MiniGLX is a subset of Xlib and GLX API functions which provides just
-enough functionality to setup OpenGL rendering and respond to simple
-input events.
-</p>
-
-<p>
-Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
-to the MiniGLX API can also be run on full Xlib/GLX implementations.
-This allows some degree of flexibility for software development and testing.
-</p>
-
-<p>
-However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
-Some of the structures are different and some macros/functions work
-differently.
-See the <code>GL/miniglx.h</code> header file for details.
-</p>
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/games.html b/nx-X11/extras/Mesa/docs/games.html
deleted file mode 100644
index dcf5cf2d0..000000000
--- a/nx-X11/extras/Mesa/docs/games.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<HTML>
-
-<TITLE>Games</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Games</H1>
-
-
-<ul>
- <li><a href="http://www.psc.edu/%7Esmp/a3d/">Asteroids3D</a> - 3D asteroids game
- </li><li><a href="http://evlweb.eecs.uic.edu/aej/AndyBattalion.html" target="_parent">Battalion</a>
- - battle game
- </li><li><a href="http://bzflag.sourceforge.net/" target="_parent">BZFLAG</a> - 3-D tank
- battle game
- </li><li><a href="http://www.speakeasy.org/%7Emorse/copter-commander">Copter Commander</a> - 2d multiplayer side scroller
- </li><li><a href="http://www.crystalspace.org/" target="_parent">CrystalSpace</a> - Free
- 3d game engine
- </li><li><a href="http://www.afn.org/%7Ecthugha/" target="_parent">Cthugha</a> - music-sync'ed
- graphical effects
- </li><li><a href="http://www.sics.se/dive/" target="_parent">DIVE</a> - Distributed Interactive
- Virtual Environment
- </li><li><a href="http://www.newdoom.com/doomlegacy/" target="_parent">Doom Legacy</a>
- - an OpenGL port of id software's popular game, Doom
- </li><li><a href="http://www.asimov.de/intern_dropit.html" target="_parent">DropIt</a> - 3-D tetris game
- </li><li><a href="http://www.flightgear.org/" target="_parent">Flight Gear</a> - Flight
- simulator
- </li><li><a href="http://freetrek.linuxgames.com/" target="_parent">Free Trek</a> - Star
- Trek battle simulator
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">Gepetto</a> - Dance Choreography
- </li><li><a href="http://glchess.sourceforge.net/" target="_parent">GLChess</a> - chess game
- </li><li><a href="http://heretic.linuxgames.com/" target="_parent">GLHeretic</a> - Heretic
- for Linux
- </li><li><a href="http://glider3d.free.fr/" target="_parent">Glider3D</a> - flight simulator
- </li><li><a href="http://www.gltron.org/" target="_parent">glTron</a> - Tron lightcycles
- game
- </li><li><a href="http://gracer.sourceforge.net/" target="_parent">GRacer</a> - 3D Motor
- Sports Simulator
- </li><li><a href="http://jongl.home.pages.de/" target="_parent">JONGL</a> - Juggling simulator
- </li><li><a href="http://samba.anu.edu.au/KnightCap/" target="_parent">KnightCap</a> -
- chess game
- </li><li><a href="http://www.hackcraft.de/games/linwarrior_3d/">LinWarrior 3D</a> - A Battle Mech Simulator
- </li><li><a href="http://www.nada.kth.se/%7Ef96-lfo/lunar/" target="_parent">Lunar Lander
- 2000</a> - 3D version of the classis lunar lander game
- </li><li><a href="http://www.majik3d.org/" target="_parent">Majik 3D</a> - an online role-playing
- world
- </li><li><a href="http://www.pobox.com/%7Eshankel/opentrek.html" target="_parent">OpenTrek</a>
- - Super Star Trek
- </li><li><a href="http://www.idsoftware.com/" target="_parent">Quake(2,3)</a> - the popular
- games from id software
- </li><li><a href="http://torcs.free.fr/indexm.html" target="_parent">TORCS</a> - car racing
- simulator
- </li><li><a href="http://www.woodsoup.org/projs/tux_aqfh" target="_parent">TUX-AQFH</a>
- - Tux the Penguin - a Quest for Herring
- </li><li><a href="http://mordred.8m.com/voidrunner/" target="_parent">Void Runner</a>
- - freeware arcade style game
- </li><li><a href="http://xracer.annexia.org/" target="_parent">XRacer</a> - Free spaceship
- racing game, similar to Wipeout
-</li></ul>
-
-
-</body></html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/gears.png b/nx-X11/extras/Mesa/docs/gears.png
deleted file mode 100644
index 4052b30ed..000000000
--- a/nx-X11/extras/Mesa/docs/gears.png
+++ /dev/null
Binary files differ
diff --git a/nx-X11/extras/Mesa/docs/glfbdev-driver.html b/nx-X11/extras/Mesa/docs/glfbdev-driver.html
deleted file mode 100644
index b49950eb9..000000000
--- a/nx-X11/extras/Mesa/docs/glfbdev-driver.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<HTML>
-
-<TITLE>Mesa glFBDev Driver</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<center><H1>Mesa glFBDev Driver</H1></center>
-
-
-<H1>1. Introduction</H1>
-
-<p>
-The GLFBDev driver interface allows one to do OpenGL rendering into a
-framebuffer managed with the Linux's fbdev interface.
-</p>
-
-<p>
-Basically, the programmer uses the fbdev functions to initialize the
-graphics hardware and setup the framebuffer.
-Then, using a calls to Mesa's glFBDev API functions, one can render
-into the framebuffer with the OpenGL API functions.
-</p>
-
-<p>
-Note, only software rendering is supported; there is no hardware
-acceleration.
-</p>
-
-
-<p>
-The GL/glfbdev.h header file defines the glFBDev interface.
-</p>
-
-<p>
-The progs/fbdev/glfbdevtest.c demonstrates how to use the glFBDev interface.
-</p>
-
-<p>
-For more information about fbdev, see the
-<a href="http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html" target="_parent">
-Framebuffer Howto</a>
-</p>
-
-
-<h1>2. Compilation</h1>
-
-<p>
-To compile Mesa with support for the glFBDev interface:
-<pre>
- XXX todo
-</pre>
-
-<p>
-When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo.
-</p>
-
-</p>
-xxx todo
-</p>
-
-
-<h1>3. Compiling and linking glFBDev programs</h1>
-
-<p>
-xxx todo
-</p>
-
-
-
-<h1>4. Running glFBDev programs</h1>
-
-<p>
-First, you need to have a working fbdev environment.
-See the
-<a href="http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html" target="_parent">
-Framebuffer Howto</a> for information.
-</p>
-
-<p>
-Programs must be run with root permission.
-</p>
-
-</p>
-
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/glu.html b/nx-X11/extras/Mesa/docs/glu.html
deleted file mode 100644
index 8adaf42bc..000000000
--- a/nx-X11/extras/Mesa/docs/glu.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<HTML>
-
-<TITLE>SGI GLU</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>SGI SI GLU</H1>
-
-(Silicon Graphics, Inc. Sample Implementation of the OpenGL Utility library)
-
-<p>
-SGI open-sourced their OpenGL Sample Implementation (SI) in January, 2000.
-This includes the GLU library.
-</p>
-
-<p>
-The SI GLU library implements GLU version 1.3 whereas the original
-Mesa GLU library only implemented version 1.2.
-We recommend using the SI GLU library instead of Mesa's GLU library
-since it's more up-to-date, complete and reliable.
-We're no longer developing the original Mesa GLU library.
-</p>
-
-<p>
-The SI GLU library code is included in the Mesa distribution.
-You don't have to download it separately.
-</p>
-
-
-<p>
-<b>Olivier Michel</b> has made Linux RPMs of GLU for i386 and PowerPC.
-You can download them from the
-<a href="http://www.sourceforge.net/project/showfiles.php?group_id=3"
-target="_parent">download area</a> under <b>Miscellaneous</b>.
-</p>
-
-<p>
-Visit the <a href="http://oss.sgi.com/projects/ogl-sample/" target="_parent">
-OpenGL Sample Implementation home page</a> for more information about the SI.
-</p>
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/helpwanted.html b/nx-X11/extras/Mesa/docs/helpwanted.html
deleted file mode 100644
index 346f093d6..000000000
--- a/nx-X11/extras/Mesa/docs/helpwanted.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<HTML>
-
-<TITLE>Help Wanted</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Help Wanted</H1>
-
-<p>
-We can always use more help with the Mesa project.
-Here are some specific ideas and areas where help would be appreciated:
-</p>
-
-<ol>
-<li><p>
- Generate the src/mesa/main/enums.c file with a Python script which
- uses the gl_API.xml file.
- </p>
-<li><p>
- Try to auto-generate the display list "save" functions seen in dlist.c
- using a Python script and the gl_API.xml file.
- The gl_API.xml file will probably need a new tag to indicate whether or
- not each function gets compiled into display lists.
- </p>
-<li><p>
- Maintenance of assembly language files on Linux, Windows and SPARC systems.
- </p>
-<li><p>
- Help to incorporate the 3Dlabs' shading language compiler for OpenGL 2.0.
- </p>
-<li><p>
- Implement assembly language (SSE/MMX) code generation for
- vertex/fragment programs.
- </p>
-<li><p>
- Windows 98/NT driver building, maintenance and testing
- (Karl Schultz has been doing a great job of this lately).
- </p>
-<li><p>
- Maintenance and testing of various drivers, such as DOS/DJGPP, GGI, etc.
- </p>
-<li><p>
- Write new tests for Glean.
- </p>
-</ol>
-
-
-<p>
-If you want to help with Mesa, first join the Mesa developer's
-mailing list.
-Then post a message to propose what you want to do, just to make sure
-there's no issues.
-</p>
-
-</p>
-Anyone is welcome to contribute code to the Mesa project.
-By doing so, it's assumed that you agree to the code's licensing terms.
-</p>
-
-<p>
-Finally:
-<p>
-
-<ol>
-<li>Try to write high-quality code that follows the existing style.
-<li>Use uniform indentation, write comments, use meaningful identifiers, etc.
-<li>Test your code thoroughly. Include test programs if appropriate.
-</ol>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/index.html b/nx-X11/extras/Mesa/docs/index.html
deleted file mode 100644
index eec4d725c..000000000
--- a/nx-X11/extras/Mesa/docs/index.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
-<html>
-
-<head>
-<title>Mesa Home Page</title>
-</head>
-
-<frameset rows="80,*" border="0" frameborder="yes">
-
- <frame src="banner.html" name="BannerFrame"
- scrolling="no" marginwidth="1" marginheight="1">
-
- <frameset cols="28%,72% " border="1" frameborder="yes">
-
- <frame src="contents.html" name="ContentsFrame"
- marginwidth="2" marginheight="1" noresize="noresize">
-
- <frame src="news.html" name="MainFrame"
- marginwidth="3" marginheight="1" noresize="noresize">
-
- </frameset>
-
-<noframes>
-<p>Sorry, this site requires frame support</p>
-</noframes>
-
-</frameset>
-
-</html>
diff --git a/nx-X11/extras/Mesa/docs/install.html b/nx-X11/extras/Mesa/docs/install.html
deleted file mode 100644
index 129daced4..000000000
--- a/nx-X11/extras/Mesa/docs/install.html
+++ /dev/null
@@ -1,309 +0,0 @@
-<HTML>
-
-<TITLE>Compilation and Installation</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-
-<H1>Compilation and Installation</H1>
-
-<ol>
-<li><a href="#unix-x11">Unix / X11</a>
-<li><a href="#windows">Windows</a>
-<li><a href="#vms">VMS</a>
-<li><a href="#other">Other</a>
-</ol>
-
-
-
-<a name="unix-x11">
-<H2>1. Unix/X11 Compilation and Installation</H1>
-
-<h3>1.1 Compilation</h3>
-
-<p>
-Mesa may be compiled in several different ways:
-</p>
-<ul>
-<li><b><em>Stand-alone/Xlib mode</em></b> - Mesa is compiled as
-a software renderer using Xlib to do all rendering.
-libGL.so is a self-contained rendering library.
-<p>
-To compile stand-alone Mesa type <b>make</b> in the top-level directory.
-You'll see a list of supported system configurations.
-Choose one from the list (such as linux-x86), and type:
-</p>
-<pre>
- make linux-x86
-</pre>
-<p>This will produce libGL.so and several other libraries</p>
-</li>
-
-<li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers (for ATI,
-Intel, Matrox, etc) are built.
-libGL.so implements the GLX extension and dynamically loads the DRI drivers.
-<p>
-To build the DRI drivers you'll first need to have the DRM (Direct
-Rendering Manager) kernel drivers and header files.
-They're available from the <a href="http://dri.sf.net/" target="_parent">DRI</a> project.
-</p>
-<p>
-You can get them from CVS by doing:
-<pre>
-cvs -d:pserver:anonymous@pds.freedesktop.org:/cvs/dri login
-(hit enter when prompted for a password)
-cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
-</pre>
-<p>
-Make note of the directory in which the drm files are placed.
-</p>
-<p>
-See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
-DRI Building Instructions</a> for the steps to build the DRM modules.
-</p>
-<p>
-Next, in the <code>Mesa-x.y.z/configs/default</code> file, set the
-<code>DRM_SOURCE_PATH</code> variable to indicate where the DRM files
-are located.
-</p>
-<p>
-Now build Mesa and the DRI drivers by running
-</p>
-<pre>
-make linux-dri
-</pre>
-<p>
-There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
-and <code>linux-ppc</code> configurations, optimized for those architectures.
-</p>
-
-<p>
-Finally, you'll need a DRI-enabled X server from
-<a href="http://freedesktop.org/wiki/Software_2fXserver" target="_parent">
-X.org</a> or <a href="http://www.xfree86.org" target="_parent">XFree86</a>.
-Visit those projects' home pages for more information.
-</p>
-
-</li>
-</ul>
-
-
-<p>
-Later, if you want to rebuild for a different configuration run
-<code>make realclean</code> before rebuilding.
-</p>
-
-
-<h3>1.2 The libraries</h3>
-
-<p>
-When compilation has finished, look in the top-level <code>lib/</code>
-directory.
-You'll see a set of library files similar to this:
-</p>
-<pre>
-lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
-lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
--rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
-lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
-lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
--rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
-lrwxrwxrwx 1 brian users 12 Mar 26 07:53 libglut.so -> libglut.so.3*
-lrwxrwxrwx 1 brian users 16 Mar 26 07:53 libglut.so.3 -> libglut.so.3.7.1*
--rwxr-xr-x 1 brian users 597754 Mar 26 07:53 libglut.so.3.7.1*
-lrwxrwxrwx 1 brian users 11 Mar 26 08:04 libGLw.so -> libGLw.so.1*
-lrwxrwxrwx 1 brian users 15 Mar 26 08:04 libGLw.so.1 -> libGLw.so.1.0.0*
--rwxr-xr-x 1 brian users 20750 Mar 26 08:04 libGLw.so.1.0.0*
-lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
-lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
--rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
-</pre>
-
-<p>
-<b>libGL</b> is the main OpenGL library (i.e. Mesa).
-<br>
-<b>libGLU</b> is the OpenGL Utility library.
-<br>
-<b>libglut</b> is the GLUT library.
-<br>
-<b>libGLw</b> is the Xt/Motif OpenGL drawing area widget library.
-<br>
-<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
-</p>
-
-<p>
-If you built the DRI hardware drivers, you'll also see the DRI drivers:
-</p>
-<pre>
--rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
--rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
--rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
--rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
--rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
--rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
--rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
--rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
--rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
--rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
--rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
-</pre>
-
-
-<h3>1.3 Running the demos</h3>
-
-<p>
-If you downloaded/unpacked the MesaDemos-x.y.z.tar.gz archive or
-obtained Mesa from CVS, the <b>progs/</b> directory will contain a
-bunch of demonstration programs.
-</p>
-
-<p>
-Before running a demo, you may have to set an environment variable
-(such as <b>LD_LIBRARY_PATH</b> on Linux) to indicate where the
-libraries are located. For example:
-<p>
-<blockquote>
-<b>cd</b> into the Mesa <b>lib/</b> directory.
-<br>
-<b>setenv LD_LIBRARY_PATH ${cwd}</b> (if using csh or tcsh shell)
-<br>
-or,
-<br>
-<b>export LD_LIBRARY_PATH=${PWD}</b> (if using bash or sh shell)
-</blockquote>
-
-<p>
-Next, change to the Mesa/demos/ directory:
-</p>
-<blockquote>
-<b>cd ../progs/demos</b>
-</blockquote>
-
-<p>
-Run a demo such as gears:
-</p>
-<blockquote>
-<b>./gears</b>
-</blockquote>
-
-<p>
-If this doesn't work, try the <b>Mesa/progs/xdemos/glxinfo</b> program
-and see that it prints the expected Mesa version number.
-</p>
-
-<p>
-If you're using Linux or a similar OS, verify that the demo program is
-being linked with the proper library files:
-</p>
-<blockquote>
-<b>ldd gears</b>
-</blockquote>
-
-<p>
-You should see something like this:
-</p>
-<pre>
- libglut.so.3 => /home/brian/Mesa/lib/libglut.so.3 (0x40013000)
- libGLU.so.1 => /home/brian/Mesa/lib/libGLU.so.1 (0x40051000)
- libGL.so.1 => /home/brian/Mesa/lib/libGL.so.1 (0x400e0000)
- libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
- libm.so.6 => /lib/i686/libm.so.6 (0x403da000)
- libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403fc000)
- libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x404da000)
- libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404f1000)
- libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40543000)
- libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4054b000)
- libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405fd000)
- libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40605000)
- libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40613000)
- /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
- libdl.so.2 => /lib/libdl.so.2 (0x40644000)
- libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40647000)
- libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40650000)
-</pre>
-
-<p>
-Retrace your steps if this doesn't look right.
-</p>
-
-
-<H3>1.4 Installing the header and library files</H3>
-
-<p>
-The standard location for the OpenGL header files on Unix-type systems is
-in <code>/usr/include/GL/</code>.
-The standard location for the libraries is <code>/usr/lib/</code>.
-For more information see, the
-<a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent">
-Linux/OpenGL ABI specification</a>.
-</p>
-
-<p>
-If you'd like Mesa to co-exist with another implementation of OpenGL that's
-already installed, you'll have to choose different directories, like
-<code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>.
-</p>
-
-<p>
-To install Mesa's headers and libraries, run <code>make install</code>
-You'll be prompted to enter alternative directories for the headers
-and libraries.
-</p>
-
-<p>
-Note: at runtime, you can set the LD_LIBRARY_PATH (on Linux) to switch
-between the Mesa libs and another vendor libs whenever you want.
-This is a handy way to compare multiple OpenGL implementations.
-</p>
-
-
-
-<a name="windows">
-<H2>2. Windows Compilation and Installation</H1>
-
-<p>
-Please see the <a href="README.WIN32">README.WIN32</a> file.
-</p>
-
-
-
-
-<a name="vms">
-<H2>3. VMS Compilation and Installation</H1>
-
-<p>
-Please see the <a href="README.VMS">README.VMS</a> file.
-</p>
-
-
-
-
-<a name="other">
-<H2>4. Other systems</H1>
-
-<p>
-Documentation for other environments (some may be very out of date):
-</p>
-
-<UL>
-<LI><A HREF="README.GGI">README.GGI</A> - GGI
-<LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
-<LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
-<LI><A HREF="README.BEOS">README.BEOS</A> - BeOS
-<LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
-<LI><A HREF="README.DJ">README.DJ</A> - DJGPP
-<LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
-<LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
-<LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
-<LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
-<LI><A HREF="README.OS2">README.OS2</A> - OS/2
-<LI><A HREF="README.WINDML">README.WINDML</A> - WindML
-</UL>
-
-
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/intro.html b/nx-X11/extras/Mesa/docs/intro.html
deleted file mode 100644
index 374d124b3..000000000
--- a/nx-X11/extras/Mesa/docs/intro.html
+++ /dev/null
@@ -1,306 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Introduction</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Introduction</H1>
-
-<p>
-Mesa is a 3-D graphics library with an API which is very similar to
-that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
-To the extent that Mesa utilizes the OpenGL command syntax or state
-machine, it is being used with authorization from <a
-href="http://www.sgi.com/" target="_parent">Silicon Graphics,
-Inc.</a>(SGI). However, the author does not possess an OpenGL license
-from SGI, and makes no claim that Mesa is in any way a compatible
-replacement for OpenGL or associated with SGI. Those who want a
-licensed implementation of OpenGL should contact a licensed
-vendor.
-</p>
-
-<p>
-Please do not refer to the library as <em>MesaGL</em> (for legal
-reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
-library</em>. <br>
-</p>
-
-<p>
-* OpenGL is a trademark of <a href="http://www.sgi.com/"
-target="_parent">Silicon Graphics Incorporated</a>.
-</p>
-
-
-<H1>Project History</H1>
-
-<p>
-The Mesa project was founded by me, Brian Paul. Here's a short history
-of the project.
-</p>
-
-<p>
-August, 1993: I begin working on Mesa in my spare time. The project
-has no name at that point. I was simply interested in writing a simple
-3D graphics library that used the then-new OpenGL API. I was partially
-inspired by the <em>VOGL</em> library which emulated a subset of IRIS GL.
-I had been programming with IRIS GL since 1991.
-</p>
-
-<p>
-November 1994: I contact SGI to ask permission to distribute my OpenGL-like
-graphics library on the internet. SGI was generally receptive to the
-idea and after negotiations with SGI's legal department, I get permission
-to release it.
-</p>
-
-<p>
-February 1995: Mesa 1.0 is released on the internet. I expected that
-a few people would be interested in it, but not thousands.
-I was soon receiving patches, new features and thank-you notes on a
-daily basis. That encouraged me to continue working on Mesa. The
-name Mesa just popped into my head one day. SGI had asked me not to use
-the terms <em>"Open"</em> or <em>"GL"</em> in the project name and I didn't
-want to make up a new acronym. Later, I heard of the Mesa programming
-language and the Mesa spreadsheet for NeXTStep.
-</p>
-
-<p>
-In the early days, OpenGL wasn't available on too many systems.
-It even took a while for SGI to support it across their product line.
-Mesa filled a big hole during that time.
-For a lot of people, Mesa was their first introduction to OpenGL.
-I think SGI recognized that Mesa actually helped to promote
-the OpenGL API, so they didn't feel threatened by the project.
-</p>
-
-
-<p>
-1995-1996: I continue working on Mesa both during my spare time and during
-my work hours at the Space Science and Engineering Center at the University
-of Wisconsin in Madison. My supervisor, Bill Hibbard, lets me do this because
-Mesa is now being using for the <a href="http://www.ssec.wisc.edu/%7Ebillh/vis.html" target="_parent">Vis5D</a> project.
-</p><p>
-October 1996: Mesa 2.0 is released. It implements the OpenGL 1.1 specification.
-</p>
-
-<p>
-March 1997: Mesa 2.2 is released. It supports the new 3dfx Voodoo graphics
-card via the Glide library. It's the first really popular hardware OpenGL
-implementation for Linux.
-</p>
-
-<p>
-September 1998: Mesa 3.0 is released. It's the first publicly-available
-implementation of the OpenGL 1.2 API.
-</p>
-
-<p>
-March 1999: I attend my first OpenGL ARB meeting. I contribute to the
-development of several official OpenGL extensions over the years.
-</p>
-
-<p>
-September 1999: I'm hired by Precision Insight, Inc. Mesa is a key
-component of 3D hardware acceleration in the new DRI project for XFree86.
-Drivers for 3dfx, 3dLabs, Intel, Matrox and ATI hardware soon follow.
-</p>
-
-<p>
-October 2001: Mesa 4.0 is released.
-It implements the OpenGL 1.3 specification.
-</p>
-
-
-<p>
-November 2001: I cofound <a href="http://www.tungstengraphics.com" target="_parent">
-Tungsten Graphics, Inc.</a> with Keith Whitwell, Jens Owen, David Dawes and
-Frank LaMonica.
-I continue to develop Mesa as part of my resposibilities with Tungsten
-Graphics and as a spare-time project.
-</p>
-
-<p>
-November 2002: Mesa 5.0 is released.
-It implements the OpenGL 1.4 specification.
-</p>
-
-<p>
-January 2003: Mesa 6.0 is released. It implements the OpenGL 1.5
-specification as well as the GL_ARB_vertex_program and
-GL_ARB_fragment_program extensions.
-</p>
-
-
-<p>
-Ongoing: Mesa is used as the core of many hardware OpenGL drivers for
-the XFree86 X.org X servers within the
-<A href="http://dri.sourceforge.net/" target="_parent">DRI project</A>.
-I continue to enhance Mesa with new extensions and features.
-</p>
-
-
-
-<H1>Major Versions</H1>
-
-<p>
-This is a summary of the major versions of Mesa. Note that Mesa's major
-version number tracks OpenGL's minor version number (+1).
-Work is underway to implement the OpenGL 2.0 specification.
-</p>
-
-
-<H2>Version 6.x features</H2>
-<p>
-Version 6.x of Mesa implements the OpenGL 1.5 API with the following
-extensions incorporated as standard features:
-</p>
-<ul>
-<li>GL_ARB_occlusion_query
-<li>GL_ARB_vertex_buffer_object
-<li>GL_EXT_shadow_funcs
-</ul>
-<p>
-Also note that several OpenGL tokens were renamed in OpenGL 1.5
-for the sake of consistency.
-The old tokens are still available.
-</p>
-<pre>
-New Token Old Token
-------------------------------------------------------------
-GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
-GL_FOG_COORD GL_FOG_COORDINATE
-GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
-GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
-GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
-GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
-GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
-GL_SRC0_RGB GL_SOURCE0_RGB
-GL_SRC1_RGB GL_SOURCE1_RGB
-GL_SRC2_RGB GL_SOURCE2_RGB
-GL_SRC0_ALPHA GL_SOURCE0_ALPHA
-GL_SRC1_ALPHA GL_SOURCE1_ALPHA
-GL_SRC2_ALPHA GL_SOURCE2_ALPHA
-</pre>
-<p>
-See the
-<a href="http://www.opengl.org/documentation/spec.html" target="_parent">
-OpenGL specification</a> for more details.
-</p>
-
-
-
-<H2>Version 5.x features</H2>
-<p>
-Version 5.x of Mesa implements the OpenGL 1.4 API with the following
-extensions incorporated as standard features:
-</p>
-<ul>
-<li>GL_ARB_depth_texture
-<li>GL_ARB_shadow
-<li>GL_ARB_texture_env_crossbar
-<li>GL_ARB_texture_mirror_repeat
-<li>GL_ARB_window_pos
-<li>GL_EXT_blend_color
-<li>GL_EXT_blend_func_separate
-<li>GL_EXT_blend_logic_op
-<li>GL_EXT_blend_minmax
-<li>GL_EXT_blend_subtract
-<li>GL_EXT_fog_coord
-<li>GL_EXT_multi_draw_arrays
-<li>GL_EXT_point_parameters
-<li>GL_EXT_secondary_color
-<li>GL_EXT_stencil_wrap
-<li>GL_EXT_texture_lod_bias (plus, a per-texture LOD bias parameter)
-<li>GL_SGIS_generate_mipmap
-</ul>
-
-
-<H2>Version 4.x features</H2>
-
-<p>
-Version 4.x of Mesa implements the OpenGL 1.3 API with the following
-extensions incorporated as standard features:
-</p>
-
-<ul>
-<li>GL_ARB_multisample
-<li>GL_ARB_multitexture
-<li>GL_ARB_texture_border_clamp
-<li>GL_ARB_texture_compression
-<li>GL_ARB_texture_cube_map
-<li>GL_ARB_texture_env_add
-<li>GL_ARB_texture_env_combine
-<li>GL_ARB_texture_env_dot3
-<li>GL_ARB_transpose_matrix
-</ul>
-
-<H2>Version 3.x features</H2>
-
-<p>
-Version 3.x of Mesa implements the OpenGL 1.2 API with the following
-features:
-</p>
-<ul>
-<li>BGR, BGRA and packed pixel formats
-<li>New texture border clamp mode
-<li>glDrawRangeElements()
-<li>standard 3-D texturing
-<li>advanced MIPMAP control
-<li>separate specular color interpolation
-</ul>
-
-
-<H2>Version 2.x features</H2>
-<p>
-Version 2.x of Mesa implements the OpenGL 1.1 API with the following
-features.
-</p>
-<ul>
-<li>Texture mapping:
- <ul>
- <li>glAreTexturesResident
- <li>glBindTexture
- <li>glCopyTexImage1D
- <li>glCopyTexImage2D
- <li>glCopyTexSubImage1D
- <li>glCopyTexSubImage2D
- <li>glDeleteTextures
- <li>glGenTextures
- <li>glIsTexture
- <li>glPrioritizeTextures
- <li>glTexSubImage1D
- <li>glTexSubImage2D
- </ul>
-<li>Vertex Arrays:
- <ul>
- <li>glArrayElement
- <li>glColorPointer
- <li>glDrawElements
- <li>glEdgeFlagPointer
- <li>glIndexPointer
- <li>glInterleavedArrays
- <li>glNormalPointer
- <li>glTexCoordPointer
- <li>glVertexPointer
- </ul>
-<li>Client state management:
- <ul>
- <li>glDisableClientState
- <li>glEnableClientState
- <li>glPopClientAttrib
- <li>glPushClientAttrib
- </ul>
-<li>Misc:
- <ul>
- <li>glGetPointer
- <li>glIndexub
- <li>glIndexubv
- <li>glPolygonOffset
- </ul>
-</ul>
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/libraries.html b/nx-X11/extras/Mesa/docs/libraries.html
deleted file mode 100644
index ce0ee70e6..000000000
--- a/nx-X11/extras/Mesa/docs/libraries.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<HTML>
-
-<TITLE>Libraries and Toolkits</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Libraries and Toolkits</H1>
-
-<ul>
-<li><a href="http://mrpowers.com/Apprentice/">Apprentice</a> - free OpenInventor work-alike
-<li><a href="http://www.coin3d.org/coin.html" target="_parent">Coin</a> - OSS Open Inventor clone
-<li><a href="http://www.softintegration.com/products/toolkit/opengl/" target="_parent">Ch</a> - OpenGL bindings for the Ch C/C++ interpreter
-<li><a href="http://www.cfdrc.com/FOX/fox.html" target="_parent">FOX</a> - GUI Library
-<li><a href="http://www.jausoft.com/gl4java.html" target="_parent">GL4Java</a> - a Java wrapper for OpenGL
-<li><a href="http://www.student.oulu.fi/%7Ejlof/gtkglarea/" target="_parent">GtkGLArea</a> - OpenGL Gtk widget
-<li><a href="http://www.ece.ucdavis.edu/%7Ekenelson/gtk-glarea/" target="_parent">GtkGLArea--</a> - OpenGL Gtk-- widget for C++
-<li><a href="http://gtkpas.sourceforge.net/" target="_parent">GTKpas</a> - OpenGL Gtk widget for <a href="http://www.freepascal.org/" target="_parent">FreePascal</a>
-<li><a href="http://freeglut.sourceforge.net/" target="_parent">FreeGLUT</a> - a GLUT work-alike
-<li><a href="http://math.nist.gov/f90gl" target="_parent">Fortran77/90 bindings for OpenGL and Mesa</a> - by William Mitchell
-<li><a href="http://glow.sourceforge.net/" target="_parent">GLOW</a> - a GUI toolkit for GLUT and OpenGL
-<li><a href="http://www.nigels.com/glt/">Glt</a> - an OpenGL C++ toolkit
-<li><a href="http://www.opengl.org/developers/documentation/glut/" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
-<li><a href="http://atrey.karlin.mff.cuni.cz/%7E0rfelyus/guileGL/" target="_parent">GuileGL</a> - OpenGL and GtkGLArea language bindings for Guile
-<li><a href="http://www.rsinc.com/" target="_parent">IDL</a> - Interactive Data Language
-<li><a href="http://www.newplanetsoftware.com/jx/" target="_parent">JX</a> - C++ application framework and GUI library
-<li><a href="http://www.vrs3d.org/" target="_parent">MAM/VRS</a> - object-oriented toolkit for 3D graphics
-<li><a href="http://www.jwdt.com/%7Epaysan/bigforth.html" target="_parent">MINOS</a> - GUI library
-<li><a href="http://sourceforge.net/project/?group_id=2795" target="_parent">OglCLib</a> - C++ wrapper for OpenGL
-<li><a href="http://oss.sgi.com/projects/inventor" target="_parent"> Open Inventor</a> - the Open Inventor toolkit from SGI
-<li><a href="http://www.tgs.com/" target="_parent">Open Inventor</a> - the Open Inventor toolkit from Template Graphics Software, Inc.
-<li><a href="http://openrm.sourceforge.net/" target="_parent">OpenRM</a>
-- Open Source, multithreaded, parallel scene graph API
-<li><a href="http://www.opensg.org/OpenSGPLUS/index.EN.html" target="_parent">
-Open SG PLUS</a> - a scene-graph library
-<li><a href="http://www.openscenegraph.org/" target="_parent">Open Scene Graph
-</a> - a scene-graph library
-<li><a href="http://www.openvrml.org/" target="_parent">OpenVRML</a>
-- a VRML parsing/display library with "lookat" - an example VRML browser
-<li><a href="http://plib.sourceforge.net/" target="_parent">PLIB</a> - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API
-<li><a href="ftp://ftp.troll.no/contest/Pryan-1.2.tar.gz" target="_parent">Pryan</a> - an OpenInventor-like toolkit
-<li><a href="http://starship.python.net:9673/crew/da/Code/PyOpenGL" target="_parent">PyOpenGL</a> - OpenGL interface for Python
-<li><a href="http://www.quesa.org/" target="_parent">Quesa</a> - QuickDraw3D-compatible library based on OpenGL, Mesa or Direct3D
-<li><a href="http://www.mesa3d.org/brianp/repgl.txt" target="_parent">repGL</a> - IRIS GL emulated with OpenGL
-<li><a href="http://www.scitechsoft.com/dp_mgl.html" target="_parent">SciTech MGL</a> - A multiplatform (Windows, Linux, OS/2, DOS, QNX, SMX, RT-Target &amp; more) graphics library
-<li><a href="http://sgl.sourceforge.net/" target="_parent">SGL</a> - a 3D Scene Graph Library
-<li><a href="http://www.lal.in2p3.fr/SI/SoFree/" target="_parent">SoFree</a> - a free implementation of Open Inventor
-<li><a href="http://togl.sourceforge.net/" target="_parent">Togl</a> - Tcl/Tk widget for OpenGL
-<li><a href="http://mesa3d.sourceforge.net/notfound.html">VLE</a> - Virtual Reality Toolkit
-<li><a href="http://www.int.com/" target="_parent">View3D Widget</a> - 3-D GUI widget
-<li><a href="http://www.vtk.org/" target="_parent">VTK</a> - Visualization Toolkit
-<li><a href="http://home.earthlink.net/%7Erzeh/YAJOGLB/doc/YAJOGLB.html" target="_parent">YAJOGL</a> - Yet Another Java GL Binding.
-</ul>
-
-
-</body></html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/license.html b/nx-X11/extras/Mesa/docs/license.html
deleted file mode 100644
index dd878619b..000000000
--- a/nx-X11/extras/Mesa/docs/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<HTML>
-
-<TITLE>License / Cppyright Information</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>License / Copyright Information</H1>
-
-<p>
-The Mesa distribution consists of several components. Different copyrights
-and licenses apply to different components. For example, GLUT is copyrighted
-by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa
-device drivers are copyrighted by their authors. See below for a list of
-Mesa's main components and the license for each.
-</p>
-<p>
-The core Mesa library is licensed according to the terms of the MIT license.
-This allows integration with the XFree86, Xorg and DRI projects.
-</p>
-<p>
-The default Mesa license is as follows:
-</p>
-
-<pre>
-Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-</pre>
-
-
-<H1>Attention, Contributors</H1>
-
-<p>
-When contributing to the Mesa project you must agree to the licensing terms
-of the component to which you're contributing.
-The following section lists the primary components of the Mesa distribution
-and their respective licenses.
-</p>
-
-
-<H1>Mesa Component Licenses</H1>
-
-<pre>
-Component Location Primary Author License
-----------------------------------------------------------------------------
-Main Mesa code src/mesa/ Brian Paul Mesa (MIT)
-
-Device drivers src/mesa/drivers/* See drivers See drivers
-
-Ext headers include/GL/glext.h SGI SGI Free B
- include/GL/glxext.h
-
-GLUT src/glut/ Mark Kilgard Mark's copyright
-
-Mesa GLU library src/glu/mesa/ Brian Paul GNU-LGPL
-
-SGI GLU library src/glu/sgi/ SGI SGI Free B
-
-demo programs progs/demos/ various see source files
-
-X demos progs/xdemos/ Brian Paul see source files
-
-SGI demos progs/samples/ SGI SGI copyright
-
-RedBook demos progs/redbook/ SGI SGI copyright
-</pre>
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/lists.html b/nx-X11/extras/Mesa/docs/lists.html
deleted file mode 100644
index 76ebf32c3..000000000
--- a/nx-X11/extras/Mesa/docs/lists.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Mailing Lists</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Mailing Lists</H1>
-
-
-<p>There are four Mesa mailing lists:</p>
-<ul>
-<li><b>mesa3d-users</b> - intended for users of the Mesa library.
-Newbie questions are appropriate, but please try reading the Mesa documentation first.
-</li><li><b>mesa3d-dev</b> - intended for developers of the Mesa library.
-This is not for beginners.
-</li><li><b>mesa3d-cvs</b> - CVS check-in messages are sent to this list.
-This is useful for tracking ongoing development changes.
-</li><li><b>mesa3d-announce</b> - announcements of new Mesa versions are sent to this list.
-</li></ul>
-
-<p>
-To subscribe or unsubscribe, go to the
-<a href="http://www.sourceforge.net/mail/?group_id=3" target="_parent">
-SourceForge lists page.</a>
-</p>
-
-<p>The mailing lists are managed by SourceForge. If you're having trouble
-with the mailing lists please contact the SourceForge administrators for help.</p>
-
-<p>Archives of the old Mesa mailing list which was hosted by unicamp.br
-are available <a href="http://groups.yahoo.com/group/mesa/messages/"
-target="_parent">here</a>.</p>
-
-<p>
-Here are some other OpenGL-related forums you might find useful:
-</p>
-
-<p>
-Usenet newsgroups:
-<ul>
-<li>comp.graphics.algorithms
-<li>comp.graphics.api.opengl
-<li>comp.os.linux.x
-</ul>
-</p>
-
-<p>
-<a href="http://www.opengl.org/" target="_parent">OpenGL discussion forums</A>
-at www.opengl.org
-</p>
-
-</HTML>
-</BODY>
diff --git a/nx-X11/extras/Mesa/docs/mangling.html b/nx-X11/extras/Mesa/docs/mangling.html
deleted file mode 100644
index cb19e7568..000000000
--- a/nx-X11/extras/Mesa/docs/mangling.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<HTML>
-
-<TITLE>Function Name Mangling</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Function Name Mangling</H1>
-
-<p>
-If you want to use Mesa and native OpenGL in the same application at
-the same time you may find it useful to compile Mesa with
-<i>name mangling</i>.
-This results in all the Mesa functions being prefixed with
-<b>mgl</b> instead of <b>gl</b>.
-</p>
-
-<p>
-To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE.
-Add the flag to the other compiler flags in Make-config (if using the
-old-style build system) or in src/Makefile if using GNU autoconf/
-automake to build Mesa.
-</p>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/mesa.css b/nx-X11/extras/Mesa/docs/mesa.css
deleted file mode 100644
index a53a9df8b..000000000
--- a/nx-X11/extras/Mesa/docs/mesa.css
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Mesa CSS */
-body {
- background-color: #ffffff;
- font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;
- color: black;
- link: #111188;
-}
-
-h1 {
- font: 24px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;
- font-weight: bold;
- color: black;
-}
-
-h2 {
- font: 18px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif, bold;
- font-weight: bold;
- color: black;
-}
-
-code {
- font-family: monospace;
- font-size: 10pt;
- color: black;
-}
-
-
-pre {
- /*font-family: monospace;*/
- font-size: 10pt;
- /*color: black;*/
-}
-
diff --git a/nx-X11/extras/Mesa/docs/modelers.html b/nx-X11/extras/Mesa/docs/modelers.html
deleted file mode 100644
index 617a03159..000000000
--- a/nx-X11/extras/Mesa/docs/modelers.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<HTML>
-
-<TITLE>Modelers, Renderers and Viewers</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Modelers, Renderers and Viewers</H1>
-
-<ul>
- <li><a href="http://www.aqsis.com/" target="_parent">Aqsis</a> - a RenderMan compatible renderer</li>
- <li><a href="http://www.ac3d.org/" target="_parent">AC3D</a> - 3-D modeler
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">ARCAD</a> - CAD program
- </li><li><a href="http://www.mediascape.com/" target="_parent">Artstream</a> - provides
- functionality like Corel Draw and Illustrator
- </li><li><a href="http://www.blender.nl/" target="_parent">Blender</a> - 3-D animation
- software
- </li><li><a href="http://www.arq.net/%7Ekasten/demtools/" target="_parent">Demtools</a>
- - Map viewer
- </li><li><a href="http://www.holometric.de/dimension/" target="_parent">DIMENSION</a>
- - freeform surface reconstruction
- </li><li><a href="http://www.vectaport.com/vhclmaps/demviewer.html" target="_parent">demviewer</a>
- - interactive terrain viewer
- </li><li><a href="http://www.crc.ca/FreeWRL" target="_parent">FreeWRL</a> - VRML browser
- </li><li><a href="http://www.geomview.org/" target="_parent">Geomview</a> - 3-D geometry
- exploration
- </li><li><a href="http://innovation3d.sourceforge.net/" target="_parent">Innovation3D</a>
- - 3D modeling program
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html" target="_parent">KWRL</a> - VRML browser
- </li><li><a href="http://www.vermontel.com/%7Ecmorley/vrml.html" target="_parent">LibVRML97/Lookat</a>
- - VRML viewer
- </li><li><a href="http://aig.cs.man.ac.uk/systems/Maverik/" target="_parent">Maverik</a>
- - VR graphics and interaction system
- </li><li><a href="http://www.swissquake.ch/chumbalum-soft/md2v" target="_parent">MD2 Viewer</a>
- - View .MD2 files
- </li><li><a href="http://www.megacads.dlr.de/" target="_parent">MegaCads</a>
- - Multiblock-Elliptic-Grid-Generation-And-CAD-System
- </li><li><a href="http://www.swissquake.ch/chumbalum-soft/" target="_parent">MilkShape
- 3D</a> - 3D modeler/animator
- </li><li><a href="http://mindseye.sourceforge.net/" target="_parent">Mindseye</a> - Rendering/Modeling
- Package
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">Moonlight Atelier</a> - modeling and rendering package
- </li><li><a href="http://www.neuralvr.com/" target="_parent">Pansophica</a> - Virtual Reality web organizer
- </li><li><a href="http://www.sim.no/reducer.html" target="_parent">Rational Reducer</a>
- - polygon reduction tool
- </li><li><a href="http://www.cs.kuleuven.ac.be/cwis/research/graphics/RENDERPARK/" target="_parent">RenderPark</a>
- - photorealistic rendering
- </li><li><a href="http://www.hardgeus.com/revolution" target="_parent">Revolution 3D Engine</a>
- - .3ds rendering engine
- </li><li><a href="http://www.dgp.toronto.edu/%7Emjmcguff/eversion/" target="_parent">sphereEversion</a>
- - inside-out sphere visualization
- </li><li><a href="http://www.cs.kuleuven.ac.be/cwis/research/graphics/3DOM/" target="_parent">3Dom</a>
- - 3-D modeler
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">3D Studio file viewer</a> - by David Farrell
- </li><li><a href="http://www.microform.se/" target="_parent">VARKON</a> - product engineering,
- design, modeling
- </li><li><a href="http://www.sim.no/vrmlview.html" target="_parent">VRMLview</a> - VRML
- model viewer
- </li><li><a href="http://www.iicm.edu/vrwave/" target="_parent">VRWave</a> - a VRML 2.0
- browser
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">VRweb</a> - VRML browser
- </li><li><a href="http://www.csv.ica.uni-stuttgart.de/vrml/dune/" target="_parent">white_dune</a>
- - graphical VRML97 Editor and animation tool
- </li><li><a href="http://www.wings3d.org/" target="_parent">Wings 3D</a> - static 3D modeller
- with VRML export. Uses SDL library.
-</li></ul>
-
-
-</body></html>
diff --git a/nx-X11/extras/Mesa/docs/news.html b/nx-X11/extras/Mesa/docs/news.html
deleted file mode 100644
index 8e9d5d33e..000000000
--- a/nx-X11/extras/Mesa/docs/news.html
+++ /dev/null
@@ -1,1136 +0,0 @@
-<HTML>
-
-<TITLE>Mesa News</TITLE>
-
-<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<body bgcolor="#eeeeee">
-
-<H1>News</H1>
-
-
-<h2>November 29, 2005</h2>
-<p>
-Mesa 6.4.1 has been released. This is a stable, bug-fix release.
-</p>
-<pre>
- Bug fixes:
- - redefining a vertex program string didn't take effect in TNL module
- - fixed occasional segfault upon vertex/fragment parsing error
- - vertex program LIT instruction didn't handle 0^0=1 correctly
- - fragment program fog option didn't work with glDrawPixels, glBitmap
- - USE_MGL_NAMESPACE didn't work for x86-64
- - OSMesa demos were missing from previous release tarballs
- - fixed problem with float->ushort conversion in glClear (bug 4992)
- - popping of GL_EYE_PLANE texgen state was broken (bug 4996)
- - popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
- - fixed occasional triangle color interpolation problem on VMS
- - work around invalid free() call (bug 5131)
- - fixed BSD X server compilation problem by including stdint.h
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-TBD
-</pre>
-
-
-
-
-<h2>October 24, 2005</h2>
-<p>
-Mesa 6.4 has been released. This is a stable, bug-fix release.
-</p>
-<pre>
- New:
- - Added a fast XOR line drawing function in Xlib driver
- - Added support for GL_ARB_texture_mirrored_repeat to savage
- driver (supported only on Savage4 hardware).
- Changes:
- - Mesa now packaged in three parts: Library, Demos and GLUT
- Bug fixes:
- - GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig
- - Some files were present multiple times in the 6.3.2 tarballs
- - r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207)
- - glxgears_fbconfig demo didn't work (bug 4237)
- - fixed bug when bilinear sampling 2d textures with borders
- - glXCreatePbuffer() could segfault instead of returning 0 (bug 4235)
- - fixed undefined frexp and rand in X.org libGLcore.a (bug 4242)
- - fixed a few problems with proxy color tables (bug 4270)
- - fixed precision problem in Z clearing (bug 4395)
- - glBitmap, glDraw/CopyPixels mistakenly generated selection hits
- - fixed potential segfault caused by reading pixels outside
- of renderbuffer bounds
- - glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB
- - fixed memory corruption bug involving software alpha buffers
- - glReadPixels clipped by window bounds was sometimes broken
- - glDraw/CopyPixels of stencil data ignored the stencil write mask
- - glReadPixels from a texture bound to a framebuffer object didn't work
- - glIsRender/FramebufferEXT weren't totally correct
- - fixed a number of point size attenuation/fade bugs
- - fixed glFogCoord bug 4729
- - GLX encoding for transpose matrix functions was broken
- - fixed broken fragment program KIL and SWZ instructions
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-1cce0c1eb4fd15e9dfe837a1ce0c9812 MesaLib-6.4.tar.gz
-85a84e47a3f718f752f306b9e0954ef6 MesaLib-6.4.tar.bz2
-b976fea4f3ee06354c53f91b6e3f2ffc MesaLib-6.4.zip
-d8734f2c69bcf7ef9f5ae454a85743ba MesaDemos-6.4.tar.gz
-1a8c4d4fc699233f5fdb902b8753099e MesaDemos-6.4.tar.bz2
-607ab7c7a7de0cc5febbdde2bfa03098 MesaDemos-6.4.zip
-3260156f66174322a092be0767962d34 MesaGLUT-6.4.tar.gz
-0465d053f83775f44a12dec4050dfd78 MesaGLUT-6.4.tar.bz2
-02abfcdcdf72ba938ae00f6e3b70fbe0 MesaGLUT-6.4.zip
-</pre>
-
-
-<h2>August 19, 2005</h2>
-<p>
-Mesa 6.3.2 has been released.
-Note: there was no public release of version 6.3.1.
-</p>
-<pre>
- New:
- - The distribution now includes the DRI drivers and GLX code
- Changes:
- - Made the DRI "new" driver interface standard, remove old code
- Bug fixes:
- - GL_ARB_vertex/fragment_shader were mistakenly listed in the
- extensions string
- - negative relative addressing in vertex programs was broken
- - update/fix SPARC assembly code for vertex transformation
- - fixed memory leak when freeing GLX drawables/renderbuffers
- - fixed display list memory leak
- - the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer
- - wglGetProcAddress() didn't handle wgl-functions
- - fixed glxext.h cross-compile issue (Colin Harrison)
- - assorted DRI driver fixes
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-98192e45ed8d69113688f89f90869346 MesaLib-6.3.2.tar.gz
-0df27701df0924d17ddf41185efa8ce1 MesaLib-6.3.2.tar.bz2
-ccb2423aab77fc7e81ce628734586140 MesaLib-6.3.2.zip
-9d0fca0a7d051c34a0b485423fb3e85d MesaDemos-6.3.2.tar.gz
-96708868450c188205e42229b5d813c4 MesaDemos-6.3.2.tar.bz2
-c5102501e609aa8996d832fafacb8ab9 MesaDemos-6.3.2.zip
-</pre>
-
-
-<h2>July 20, 2005</h2>
-<p>
-Mesa 6.3 has been released.
-This is a development release with new features, changes and bug fixes.
-</p>
-<pre>
- New:
- - GL_EXT_framebuffer_object extension
- - GL_ARB_draw_buffers extension
- - GL_ARB_pixel_buffer_object extension
- - GL_OES_read_format extension (Ian Romanick)
- - DirectFB driver (Claudio Ciccani)
- - x86_64 vertex transformation code (Mikko T.)
- Changes:
- - added -stereo option for glxgears demo (Jacek Rosik)
- - updated the PBuffer demo code in xdemos/ directory
- - glDeleteTextures/Programs/Buffers() now makes the object ID
- available for immediate re-use
- - assorted 64-bit clean-ups fixes (x86_64 and Win64)
- - lots of internal changes for GL_EXT_framebuffer_object
- Bug fixes:
- - some functions didn't support PBO functionality
- - glGetTexImage didn't convert color index images to RGBA as required
- - fragment program texcoords were sometimes wrong for points and lines
- - fixed problem with negative dot product in arbfplight, fplight demos
- - fixed bug in perspective correction of antialiased, textured lines
- - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
- - fixed a couple per-pixel fog bugs (Soju Matsumoto)
- - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
- - fixed float parsing bug in ARB frag/vert programs (bug 2520)
- - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
- - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
- - glXChooseFBConfig() crashed if attribList pointer was NULL
- - program state.light[n].spot.direction.w was wrong value (bug 3083)
- - fragment program fog option required glEnable(GL_FOG) - wrong.
- - glColorTable() could produce a Mesa implementation error (bug 3135)
- - RasterPos could get corrupted by color index rendering path
- - Removed bad XTranslateCoordinates call when rendering to Pixmaps
- - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- - fixed a few Darwin compilation problems
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-0236f552d37514776945d5a013e5bb7b MesaLib-6.3.tar.gz
-60e1a8f78c4a8c7750a1e95753190986 MesaLib-6.3.tar.bz2
-ca7c950fbace68c70caa822322db7223 MesaLib-6.3.zip
-25ea801645b376c014051804fe4974b2 MesaDemos-6.3.tar.gz
-9248e74872ea88c57ec25c900c295057 MesaDemos-6.3.tar.bz2
-8537dfa734ef258dcc7272097558d434 MesaDemos-6.3.zip
-</pre>
-
-
-<h2>December 9, 2004</h2>
-<p>
-Mesa 6.2.1 has been released.
-This is a stable release which just fixes bugs since the 6.2 release.
-</p>
-<pre>
- Bug fixes:
- - don't apply regular fog or color sum when using a fragment program
- - glProgramEnvParameter4fARB always generated an error on
- GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- - glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- - fixed width/height mix-up in glSeparableFilter2D()
- - fixed regression in glCopyPixels + convolution
- - glReadPixels from a clipped front color buffer didn't always work
- - glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- - Attempting queries/accesses of VBO 0 weren't detected as errors
- - paletted textures failed if the palette had fewer than 256 entries
- Changes:
- - fixed a bunch of compiler warnings found with gcc 3.4
- - bug reports should to go bugzilla.freedesktop.org
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-80008a92f6e055d3bfdde2cf331ec3fa MesaLib-6.2.1.tar.gz
-f43228cd2bf70f583ef3275c1c545421 MesaLib-6.2.1.tar.bz2
-dec26cfd40116ad021020fea2d94f652 MesaLib-6.2.1.zip
-2c7af3c986a7571c8713c8bfee7e49e3 MesaDemos-6.2.1.tar.gz
-3cac74667b50bcbd4f67f594fb4224a2 MesaDemos-6.2.1.tar.bz2
-75b3edd12eb2b370caf05f29b99e508a MesaDemos-6.2.1.zip
-</pre>
-
-
-<h2>October 2, 2004</h2>
-<p>
-Mesa 6.2 has been released.
-This is a stable release which just fixes bugs since the 6.1 release.
-</p>
-<pre>
- New:
- - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- - updated Doxygen support (Jose Fonseca)
- Changes:
- - some GGI driver updates (Christoph Egger, bug 1025977)
- Bug fixes:
- - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
- - fixed a few compilation issues on IRIX
- - fixed a matrix classification bug (reported by Wes Bethel)
- - we weren't reseting the vertex/fragment program error state
- before parsing (Dave Reveman)
- - adjust texcoords for sampling texture rectangles (Dave Reveman)
- - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
- - repeated calls to glDeleteTexture(t) could lead to a crash
- - fixed potential ref count bugs in VBOs and vertex/fragment programs
- - spriteblast demo didn't handle window size changes correctly
- - glTexSubImage didn't handle pixels=NULL correctly for PBOs
- - fixed color index mode glDrawPixels bug (Karl Schultz)
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-9e8f34b059272dbb8e1f2c968b33bbf0 MesaLib-6.2.tar.gz
-3d6a6362390b6a37d3cb2e615f3ac7db MesaLib-6.2.tar.bz2
-6cfd7895d28e695c0dbbed9469564091 MesaLib-6.2.zip
-3e06e33b0809f09855cb60883b8bdfef MesaDemos-6.2.tar.gz
-9d160009c3dfdb35fe7e4088c9ba8f85 MesaDemos-6.2.tar.bz2
-856f7ec947122eb3c8985ebc2f654dcd MesaDemos-6.2.zip
-</pre>
-
-
-<h2>August 18, 2004</h2>
-<p>
-Mesa 6.1 has been released.
-This is a new development release (version 6.2 will be a stabilization
-release).
-</p>
-<pre>
- New:
- - Revamped Makefile system
- - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c)
- - internal driver interface changes related to texture object
- allocation, vertex/fragment programs, BlendEquationSeparate, etc.
- - option to walk triangle edges with double-precision floats
- (Justin Novosad of Discreet) (see config.h file)
- - support for AUX buffers in software GLX driver
- - updated glext.h to version 24 and glxext.h to version 6
- - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars
- - updated BeOS support (Philippe Houdoin)
- Changes:
- - fragment fog interpolation is perspective corrected now
- - new glTexImage code, much cleaner, may be a bit faster
- Bug fixes:
- - glArrayElement in display lists didn't handle generic vertex attribs
- - glFogCoord didn't always work properly
- - ARB_fragment_program fog options didn't work
- - frag prog TEX instruction no longer incorrectly divides s,t,r by q
- - ARB frag prog TEX and TEXP instructions now use LOD=0
- - glTexEnviv in display lists didn't work
- - glRasterPos didn't do texgen or apply texture matrix
- - GL_DOUBLE-valued vertex arrays were broken in some cases
- - fixed texture rectangle edge/border sampling bugs
- - sampling an incomplete texture in a fragment program would segfault
- - glTexImage was missing a few error checks
- - fixed some minor glGetTexParameter glitches
- - GL_INTENSITY was mistakenly accepted as a <format> to glTexImage
- - fragment program writes to RC/HC register were broken
- - fixed a few glitches in GL_HP_occlusion_test extension
- - glBeginQueryARB and glEndQueryARB didn't work inside display lists
- - vertex program state references were broken
- - fixed triangle color interpolation bug on AIX (Shane Blackett)
- - fixed a number of minor memory leaks (bug #1002030)
-</pre>
-The MD5 checksums are:
-</p>
-<pre>
-c9284d295ebcd2e0486cc3cd54e5863c MesaLib-6.1.tar.gz
-5de1f53ec0709f60fc68fdfed57351f3 MesaLib-6.1.tar.bz2
-483e77cac4789a5d36c42f3c0136d6d8 MesaLib-6.1.zip
-8c46cfa6f9732acc6f6c25724aad0246 MesaDemos-6.1.tar.gz
-89bfe0f6c69b39fd0ebd9fff481a4e9b MesaDemos-6.1.tar.bz2
-161268531fcc6f0c5a056430ee97e0c1 MesaDemos-6.1.zip
-</pre>
-
-
-
-<h2>April 2, 2004</h2>
-
-<p>
-Mesa 6.0.1 has been released.
-This release basically just fixes bugs since the 6.0. release.
-</p>
-<pre>
- New:
- - upgraded glext.h to version 22
- - new build targets (Dan Schikore)
- - new linux-x86-opteron build target (Heath Feather)
- Bug fixes:
- - glBindProgramARB didn't update all necessary state
- - fixed build problems on OpenBSD
- - omit CVS directories from tarballs
- - glGetTexImage(GL_COLOR_INDEX) was broken
- - fixed an infinite loop in t&l module
- - silenced some valgrind warnings about using unitialized memory
- - fixed some compilation/link glitches on IRIX (Mike Stephens)
- - glBindProgram wasn't getting compiled into display lists
- - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079)
- - two-sided lighting and vertex program didn't work (bug 887330)
- - stores to program parameter registers in vertex state programs
- didn't work.
- - fixed glOrtho bug found with gcc 3.2.2 (RH9)
- - glXCreateWindow() wasn't fully implemented (bug 890894)
- - generic vertex attribute arrays didn't work in display lists
- - vertex buffer objects' default usage and access fields were wrong
- - glDrawArrays with start!=0 was broken
- - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken
- - linux-osmesa16-static config didn't work
- - fixed a few color index rendering problems (bug 910687)
- - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE
- - OSMesa RGB and BGR modes were broken
- - glProgramStringARB mistakenly required a null-terminated string
- - fragment program XPD instruction was incorrect
- - glGetMaterial() didn't work reliably
-</pre>
-The MD5 checksums are:
-</p>
-<pre>
-011be0e79666c7a6eb9693fbf9348653 MesaLib-6.0.1.tar.gz
-b7f14088c5c2f14490d2739a91102112 MesaLib-6.0.1.tar.bz2
-bf0510cf0a2b87d64cdd317eca3f1db1 MesaLib-6.0.1.zip
-b7b648599e0aaee1c4ffc554a2a9139e MesaDemos-6.0.1.tar.gz
-dd6aadfd9ca8e1cfa90c6ee492bc6f43 MesaDemos-6.0.1.tar.bz2
-eff71d59c211825e949199852f5a2316 MesaDemos-6.0.1.zip
-</pre>
-
-
-
-<h2>January 16, 2004</h2>
-
-<p>
-Mesa 6.0 has been released. This is a stabilization of the 5.1 release
-and primarily just incorporates bug fixes.
-</p>
-<pre>
- New:
- - full OpenGL 1.5 support
- - updated GL/glext.h file to version 21
- Changes:
- - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h)
- Bug fixes:
- - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color
- clamping issue
- - updated suno5-gcc configs
- - glColor3 functions sometimes resulted in undefined alpha values
- - fixed FP divide by zero error seen on VMS with xlockmore, others
- - fixed vertex/fragment program debug problem (bug 873011)
- - building on AIX with gcc works now
- - glDeleteProgramsARB failed for ARB fragment programs (bug 876160)
- - glDrawRangeElements tried to modify potentially read-only storage
- - updated files for building on Windows
-</pre>
-
-
-
-<h2>December 28, 2003</h2>
-
-<p>
-The Mesa CVS server has been moved to <a href="http://www.freedesktop.org"
-target="_parent">
-freedesktop.org</a> because of problems with SourceForge's anonymous
-CVS service.
-</p>
-
-<p>Please see the <a href="cvs_access.html">CVS access page</a> for details.
-</p>
-
-
-<h2>December 17, 2003</h2>
-
-<p>
-Mesa 5.1 has been released. This is a new development release.
-Mesa 6.0 will be the next stable release and will support all
-OpenGL 1.5 features.
-</p>
-<pre>
- New features:
- - reorganized directory tree
- - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
- - GL_ATI_texture_env_combine3 extension (Ian Romanick)
- - GL_SGI_texture_color_table extension (Eric Plante)
- - GL_NV_fragment_program extension
- - GL_NV_light_max_exponent extension
- - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle)
- - GL_ARB_occlusion_query extension
- - GL_ARB_point_sprite extension
- - GL_ARB_texture_non_power_of_two extension
- - GL_IBM_multimode_draw_arrays extension
- - GL_EXT_texture_mirror_clamp extension (Ian Romanick)
- - GL_ARB_vertex_buffer_object extension
- - new X86 feature detection code (Petr Sebor)
- - less memory used for display lists and vertex buffers
- - demo of per-pixel lighting with a fragment program (demos/fplight.c)
- - new version (18) of glext.h header
- - new spriteblast.c demo of GL_ARB_point_sprite
- - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1)
- - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1)
- Bug fixes:
- - really enable OpenGL 1.4 features in DOS driver.
- - fixed issues in glDrawPixels and glCopyPixels for very wide images
- - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint
- - fixed some texgen bugs reported by Daniel Borca
- - fixed wglMakeCurrent(NULL, NULL) bug (#835861)
- - fixed glTexSubImage3D z-offset bug (Cedric Gautier)
- - fixed RGBA blend enable bug (Ville Syrjala)
- - glAccum is supposed to be a no-op in selection/feedback mode
- - fixed texgen bug #597589 (John Popplewell)
- Changes:
- - dropped API trace feature (src/Trace/)
- - documentation overhaul. merged with website content. more html.
- - glxgears.c demo updated to use GLX swap rate extensions
- - glTexImage1/2/3D now allows width/height/depth = 0
- - disable SPARC asm code on Linux (bug 852204)
-</pre>
-
-The MD5 checksums are:
-</p>
-<pre>
-78f452f6c55478471a744f07147612b5 MesaLib-5.1.tar.gz
-67b3b8d3f7f4c8c44904551b851d01af MesaLib-5.1.tar.bz2
-6dd19ffa750ec7f634e370a987505c9d MesaLib-5.1.zip
-e0214d4ebb22409dfa9262f2b52fd828 MesaDemos-5.1.tar.gz
-066c9aff4fd924405de1ae9bad5ec9a7 MesaDemos-5.1.tar.bz2
-d2b5ba32b53e0ad0576c637a4cc1fb41 MesaDemos-5.1.zip
-</pre>
-
-
-<H2>November 12, 2003</H2>
-
-<p>
-New Mesa 5.0.2 tarballs have been uploaded to SourceForge which fix a
-number of automake/libtool problems.
-</p>
-<p>
-The new MD5 checksums are:
-</p>
-<pre>
-a9dcf3ff9ad1b7d6ce73a0df7cff8b5b MesaLib-5.0.2.tar.gz
-7b4bf9261657c2fca03796d4955e6f50 MesaLib-5.0.2.tar.bz2
-79c141bddcbad557647535d02194f346 MesaLib-5.0.2.zip
-952d9dc823dd818981d1a648d7b2668a MesaDemos-5.0.2.tar.gz
-b81fafff90995025d2f25ea02b786642 MesaDemos-5.0.2.tar.bz2
-a21be975589e8a2d1871b6bb7874fffa MesaDemos-5.0.2.zip
-</pre>
-
-
-
-<h2>September 5, 2003</h2>
-
-<p>
-Mesa 5.0.2 has been released. This is a stable, bug-fix release.
-</p>
-<pre>
- Bug fixes:
- - fixed texgen problem causing texcoord's Q to be zero (stex3d)
- - default GL_TEXTURE_COMPARE_MODE_ARB was wrong
- - GL_CURRENT_MATRIX_NV query was wrong
- - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one
- - GL_LIST_MODE query wasn't correct
- - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported
- - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value
- - blended, wide lines didn't always work correctly (bug 711595)
- - glVertexAttrib4svNV w component was always 1
- - fixed bug in GL_IBM_rasterpos_clip (missing return)
- - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly
- - a few Solaris compilation fixes
- - fixed glClear() problem for DRI drivers (non-existant stencil, etc)
- - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux)
- - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz)
- - glFog() didn't clamp fog colors
- - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the
- gl[Get]TexParameteri[v] functions
- - fixed invalid memory references in glTexGen functions (bug 781602)
- - integer-valued color arrays weren't handled correctly
- - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work
- - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1
- Changes:
- - build GLUT with -fexceptions so C++ apps propogate exceptions
-</pre>
-
-
-
-<h2>June 2003</h2>
-
-<p>
-Mesa's directory tree has been overhauled.
-Things are better organized now with some thought toward future needs.
-</p>
-<p>
-In CVS, the latest Mesa 5.1 development code is now rooted under the
-<b>Mesa-newtree/</b> directory. The old top-level <b>Mesa/</b> directory
-holds the Mesa 5.0.x code which will be abandoned at some point.
-</p>
-
-
-
-<h2>March 30, 2003</h2>
-
-<p>
-Mesa 5.0.1 has been released. This is a stable, bug-fix release.
-</p>
-<pre>
- New:
- - DOS driver updates from Daniel Borca
- - updated GL/gl_mangle.h file (Bill Hoffman)
- Bug fixes:
- - auto mipmap generation for cube maps was broken (bug 641363)
- - writing/clearing software alpha channels was unreliable
- - minor compilation fixes for OS/2 (Evgeny Kotsuba)
- - fixed some bad assertions found with shadowtex demo
- - fixed error checking bug in glCopyTexSubImage2D (bug 659020)
- - glRotate(angle, -x, 0, 0) was incorrect (bug 659677)
- - fixed potential segfault in texture object validation (bug 659012)
- - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus)
- - fix fog stride bug in tnl code for h/w drivers (Michel Danzer)
- - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080)
- - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3
- - fixed compilation problem on Solaris7/x86 (bug 536406)
- - fixed prefetch bug in 3DNow! code (Felix Kuhling)
- - fixed NeXT build problem (FABSF macro)
- - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811)
- - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964)
- - AA line and triangle Z values are now rounded, not truncated
- - fixed color interpolation bug when GLchan==GLfloat (bug 694461)
- - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca)
- - fixed a minor GL_COLOR_MATERIAL bug
- - NV vertex program EXP instruction was broken
- - glColorMask misbehaved with X window / pixmap rendering
- - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack)
- - attempt to fix GGI compilation problem when MesaDemos not present
- - NV vertex program ARL-relative fetches didn't work
- Changes:
- - use glPolygonOffset in gloss demo to avoid z-fighting artifacts
- - updated winpos and pointblast demos to use ARB extensions
- - disable SPARC normal transformation code (bug 673938)
- - GLU fixes for OS/2 (Evgeny Kotsuba)
-</pre>
-<p>
-MD5 checksums follow:
-</p>
-<pre>
-b80f8b5d53a3e9f19b9fde5af0c542f0 MesaLib-5.0.1.tar.gz
-513b4bbd7d38951f05027179063d876b MesaLib-5.0.1.tar.bz2
-eebd395678f4520d33b267e5d5c22651 MesaLib-5.0.1.zip
-49d7feaec6dc1d2091d7c3cc72a9b320 MesaDemos-5.0.1.tar.gz
-37190374a98c3c892f0698be9ca3acf0 MesaDemos-5.0.1.tar.bz2
-becd8bf17f5791361b4a54ba2a78e5c9 MesaDemos-5.0.1.zip
-</pre>
-
-
-
-<h2>March 7, 2003</h2>
-<p>
-Website and documentation overhaul.
-</p>
-<p>
-The website content and Mesa documentation (from the doc/ directory) have
-been merged together.
-All the documentation files have been entered into the CVS repository.
-Many of the old plain-text files have been converted to html and modernized.
-</p>
-
-
-<h2>November 13, 2002</h2>
-<p>Mesa 5.0 has been released. This is a stable release which
-implements the OpenGL 1.4 specification.
-</p><pre>New:
- - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4")
- - removed some overlooked debugging code
- - glxinfo updated to support GLX_ARB_multisample
- - GLUT now support GLX_ARB_multisample
- - updated DOS driver (Daniel Borca)
-Bug fixes:
- - GL_POINT and GL_LINE-mode polygons didn't obey cull state
- - fixed potential bug in _mesa_align_malloc/calloc()
- - fixed missing triangle bug when running vertex programs
- - fixed a few HPUX compilation problems
- - FX (Glide) driver didn't compile
- - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work
- - a few EXT functions, like glGenTexturesEXT, were no-ops
- - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate,
- glMultiDrawArrays and glMultiDrawElements were missing
- - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken
- - Pentium 4 Mobile was mistakenly identified as having 3DNow!
- - fixed one-bit error in point/line fragment Z calculation
- - fixed potential segfault in fakeglx code
- - fixed color overflow problem in DOT3 texture env mode
-</pre>
-
-
-<h2>October 29, 2002</h2>
-<p>Mesa 4.1 has been released. This is a new development release.
-For a stable release, get 4.0.4.
-</p><pre>New:
- - GL_NV_vertex_program extension
- - GL_NV_vertex_program1_1 extension
- - GL_ARB_window_pos extension
- - GL_ARB_depth_texture extension
- - GL_ARB_shadow extension
- - GL_ARB_shadow_ambient extension
- - GL_EXT_shadow_funcs extension
- - GL_ARB_point_parameters extension
- - GL_ARB_texture_env_crossbar
- - GL_NV_point_sprite extension
- - GL_NV_texture_rectangle extension
- - GL_EXT_multi_draw_arrays extension
- - GL_EXT_stencil_two_side extension
- - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions
- - GL_ATI_texture_mirror_once extension (Ian Romanick)
- - massive overhaul/simplification of software rasterizer module,
- many contributions from Klaus Niederkrueger
- - faster software texturing in some cases (i.e. trilinear filtering)
- - new OSMesaGetProcAddress() function
- - more blend modes implemented with MMX code (Jose Fonseca)
- - added glutGetProcAddress() to GLUT
- - added GLUT_FPS env var to compute frames/second in glutSwapBuffers()
- - pbinfo and pbdemo PBuffer programs
- - glxinfo -v prints transprent pixel info (Gerd Sussner)
-Bug fixes:
- - better mipmap LOD computation (prevents excessive blurriness)
- - OSMesaMakeCurrent() didn't recognize buffer size changes
- - assorted conformance fixes for 16-bit/channel rendering
- - texcombine alpha subtraction mode was broken
- - fixed some blend problems when GLchan==GLfloat (Gerk Huisma)
- - clamp colors to [0,1] in OSMesa if GLchan==GLfloat (Gerk Huisma)
- - fixed divide by zero error in NURBS tessellator (Jon Perry)
- - fixed GL_LINEAR fog bug by adding clamping
- - fixed FP exceptions found using Alpha CPU
- - 3dfx/glide driver render-to-window feature was broken
- - added missing GLX_TRANSPARENT_RGB token to glx.h
- - fixed error checking related to paletted textures
- - fixed reference count error in glDeleteTextures (Randy Fayan)
-Changes:
- - New spec file and Python code to generate some GL dispatch files
- - Glide driver defaults to "no" with autoconf/automake
- - floating point color channels now clamped to [0,inf)
- - updated demos/stex3d with new options
-</pre>
-
-
-<h2>October 4, 2002</h2>
-<p>
-The <a href="http://mesa3d.sourceforge.net/docs/MesaFAQ.html">Mesa FAQ</a> has been rewritten.
-</p>
-
-<h2>October 3, 2002</h2>
-<p>Mesa 4.0.4 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - GL_NV_texture_rectangle extension
- - updated glext.h header (version 17)
- - updated DOS driver (Daniel Borca)
- - updated BeOS R5 driver (Philippe Houdoin)
- - added GL_IBM_texture_mirror_repeat
- - glxinfo now takes -l option to print interesting OpenGL limits info
- - GL_MESA_ycbcr_texture extension
- - GL_APPLE_client_storage extension (for some DRI drivers only)
- - GL_MESA_pack_invert extension
- Bug fixes:
- - fixed GL_LINEAR fog bug by adding clamping
- - fixed FP exceptions found using Alpha CPU
- - 3dfx MESA_GLX_FX=window (render to window) didn't work
- - fixed memory leak in wglCreateContest (Karl Schultz)
- - define GLAPIENTRY and GLAPI if undefined in glu.h
- - wglGetProcAddress didn't handle all API functions
- - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map
- - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc()
- - error checking in compressed tex image functions had some glitches
- - fixed AIX compile problem in src/config.c
- - glGetTexImage was using pixel unpacking instead of packing params
- - auto-mipmap generation for cube maps was incorrect
- Changes:
- - max texture units reduced to six to accomodate texture rectangles
- - removed unfinished GL_MESA_sprite_point extension code
-</pre>
-
-<h2>June 25, 2002</h2>
-<p>Mesa 4.0.3 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - updated GL/glext.h file (version 15)
- - corrected MMX blend code (Jose Fonseca)
- - support for software-based alpha planes in Windows driver
- - updated GGI driver (Filip Spacek)
- Bug fixes:
- - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens
- - OSMesaMakeCurrent() didn't recognize buffer size changes
- - assorted conformance fixes for 16-bit/channel rendering
- - texcombine alpha subtraction mode was broken
- - fixed lighting bug with non-uniform scaling and display lists
- - fixed bug when deleting shared display lists
- - disabled SPARC cliptest assembly code (Mesa bug 544665)
- - fixed a couple Solaris compilation/link problems
- - blending clipped glDrawPixels didn't always work
- - glGetTexImage() didn't accept packed pixel types
- - glPixelMapu[is]v() could explode given too large of pixelmap
- - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT
- - glXCopyContext() could lead to segfaults
- - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665)
- Changes:
- - lots of C++ (g++) code clean-ups
- - lots of T&amp;L updates for the Radeon DRI driver
- Known bugs:
- - mipmap LOD computation (fixed for Mesa 4.1)
-</pre>
-
-<h2>April 2, 2002</h2>
-<p>Mesa 4.0.2 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - New DOS (DJGPP) driver written by Daniel Borca
- - New driver interface functions for TCL drivers (such as Radeon DRI)
- - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
- if using deep color channels
- - latest GL/glext.h and GL/glxext.h headers from SGI
- Bug fixes:
- - GL_BLEND with non-black texture env color wasn't always correct
- - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
- - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
- - glReadPixels was sometimes mistakenly clipped by the scissor box
- - glDraw/ReadPixels didn't catch all the errors that they should have
- - Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
- - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
- - Fixed 1-bit float-&gt;int conversion bug in glDrawPixels(GL_DEPTH_COMP)
- - glColorMask as sometimes effecting glXSwapBuffers()
- - fixed a potential bug in XMesaGarbageCollect()
- - N threads rendering into one window didn't work reliably
- - glCopyPixels didn't work for deep color channels
- - improved 8 -&gt; 16bit/channel texture image conversion (Gerk Huisma)
- - glPopAttrib() didn't correctly restore user clip planes
- - user clip planes failed for some perspective projections (Chromium)
-</pre>
-
-<h2>December 17, 2001</h2>
-<p>Mesa 4.0.1 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - better sub-pixel sample positions for AA triangles (Ray Tice)
- - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
- Bug fixes:
- - added missing break statements in glGet*() for multisample cases
- - fixed uninitialized hash table mutex bug (display lists / texobjs)
- - fixed bad teximage error check conditional (bug 476846)
- - fixed demos readtex.c compilation problem on Windows (Karl Schultz)
- - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
- - silence some compiler warnings (gcc 2.96)
- - enable the #define GL_VERSION_1_3 in GL/gl.h
- - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
- - fixed glu.h typedef problem found with MSDev 6.0
- - build libGL.so with -Bsymbolic (fixes bug found with Chromium)
- - added missing 'const' to glXGetContextIDEXT() in glxext.h
- - fixed a few glXGetProcAddress() errors (texture compression, etc)
- - fixed start index bug in compiled vertex arrays (Keith)
- - fixed compilation problems in src/SPARC/glapi_sparc.S
- - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
- - use glXGetProcAddressARB in GLUT to avoid extension linking problems
- - provoking vertex of flat-shaded, color-index triangles was wrong
- - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
- - glTexParameter didn't flush the vertex buffer (Ray Tice)
- - feedback attributes for glDraw/CopyPixels and glBitmap were wrong
- - fixed bug in normal length caching (ParaView lighting bug)
-</pre>
-
-<h2>October 22, 2001</h2>
-<p>Mesa 4.0 has been released. This is a stable release.
-</p><pre> New:
- - Mesa 4.0 implements the OpenGL 1.3 specification
- - GL_IBM_rasterpos_clip extension
- - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp)
- - GL_ARB_texture_mirrored_repeat extension
- - WindML UGL driver (Stephane Raimbault)
- - added OSMESA_MAX_WIDTH/HEIGHT queries
- - attempted compiliation fixes for Solaris 5, 7 and 8
- - updated glext.h and glxext.h files
- - updated Windows driver (Karl Schultz)
- Bug fixes:
- - added some missing GLX 1.3 tokens to include/GL/glx.h
- - GL_COLOR_MATRIX changes weren't recognized by teximage functions
- - glCopyPixels with scale and bias was broken
- - glRasterPos with lighting could segfault
- - glDeleteTextures could leave a dangling pointer
- - Proxy textures for cube maps didn't work
- - fixed a number of 16-bit color channel bugs
- - fixed a few minor memory leaks
- - GLX context sharing was broken in 3.5
- - fixed state-update bugs in glPopClientAttrib()
- - fixed glDrawRangeElements() bug
- - fixed a glPush/PopAttrib() bug related to texture binding
- - flat-shaded, textured lines were broken
- - fixed a dangling pointer problem in the XMesa code (Chris Burghart)
- - lighting didn't always produce the correct alpha value
- - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
-</pre>
-
-
-<h2>June 21, 2001</h2>
-<p>Mesa 3.5 has been released. This is a new development release.
-</p><pre> New:
- - internals of Mesa divided into modular pieces (Keith Whitwell)
- - 100% OpenGL 1.2 conformance (passes all conformance tests)
- - new AA line algorithm
- - GL_EXT_convolution extension
- - GL_ARB_imaging subset
- - OSMesaCreateContextExt() function
- - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
- - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
- - GL_EXT_fog_coord extension (Keith Whitwell)
- - GL_EXT_secondary_color extension (Keith Whitwell)
- - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
- - GL_SGIX_depth_texture extension
- - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
- - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
- - GL_ARB_texture_env_combine extension
- - GL_ARB_texture_env_dot3 extension
- - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
- - OSMesaCreateContextExt() function
- - libOSMesa.so library, contains the OSMesa driver interface
- - GL/glxext.h header file for GLX extensions
- - somewhat faster software texturing, fogging, depth testing
- - all color-index conformance tests now pass (only 8bpp tested)
- - SPARC assembly language TCL optimizations (David Miller)
- - GL_SGIS_generate_mipmap extension
- Bug Fixes:
- - fbiRev and tmuRev were unitialized when using Glide3
- - fixed a few color index mode conformance failures; all pass now
- - now appling antialiasing coverage to alpha after texturing
- - colors weren't getting clamped to [0,1] before color table lookup
- - fixed RISC alignment errors caused by COPY_4UBV macro
- - drawing wide, flat-shaded lines could cause a segfault
- - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
- Changes:
- - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
- - new libOSMesa.so library, contains the OSMesa driver interface
-</pre>
-
-
-<h2>May 17, 2001</h2>
-<p>Mesa 3.4.2 has been released. This is basically just a bug-fix release.
-Here's what's new:</p>
-<pre> Bug fixes:
- - deleting the currently bound texture could cause bad problems
- - using fog could result in random vertex alpha values
- - AA triangle rendering could touch pixels outside right window bound
- - fixed byteswapping problem in clear_32bit_ximage() function
- - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
- - fixed memory leak in glXUseXFont()
- - fragment sampling in AA triangle function was off by 1/2 pixel
- - Windows: reading pixels from framebuffer didn't always work
- - glConvolutionFilter2D could segfault or cause FP exception
- - fixed segfaults in FX and X drivers when using tex unit 1 but not 0
- - GL_NAND logicop didn't work right in RGBA mode
- - fixed a memory corruption bug in vertex buffer reset code
- - clearing the softwara alpha buffer with scissoring was broken
- - fixed a few color index mode fog bugs
- - fixed some bad assertions in color index mode
- - fixed FX line 'stipple' bug #420091
- Changes:
- - optimized writing mono-colored pixel spans to X pixmaps
- - increased max viewport size to 2048 x 2048
-</pre>
-
-
-<h2>April 29, 2001</h2>
-<p>New Mesa website</p>
-<p>Mark Manning produced the new website.<br>Thanks, Mark!</p>
-
-
-<h2>February 14, 2001</h2>
-<p>Mesa 3.4.1 has been released. Here's what's new:</p>
-<pre> New:
- - fixed some Linux build problems
- - fixed some Windows build problems
- - GL_EXT_texture_env_dot3 extension (Gareth Hughes)
- Bug fixes:
- - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
- - various state-update code changes needed for DRI bugs
- - disabled pixel transfer ops in glColorTable commands, not needed
- - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter
- - updated sources and fixed compile problems in widgets-mesa/
- - GLX_PBUFFER enum value was wrong in glx.h
- - fixed a glColorMaterial lighting bug
- - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
- - glXCopySubBufferMESA() Y position was off by one
- - Error checking of glTexSubImage3D() was broken (bug 128775)
- - glPopAttrib() didn't restore all derived Mesa state correctly
- - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
- conformance problems at 16bpp.
- - clearing depth buffer with scissoring was broken, would segfault
- - OSMesaGetDepthBuffer() returned bad bytesPerValue value
- - fixed a line clipping bug (reported by Craig McDaniel)
- - fixed RGB color over/underflow bug for very tiny triangles
- Known problems:
- - NURBS or evaluator surfaces inside display lists don't always work
-</pre>
-<p>
-</p><h2>November 3, 2000</h2>
-<p>Mesa 3.4 has been released. Here's what's new since the 3.3 release:</p>
-<pre> New:
- - optimized glDrawPixels for glPixelZoom(1,-1)
- Bug Fixes:
- - widgets-mesa/src/*.c files were missing from 3.3 distro
- - include/GL/mesa_wgl.h file was missing from 3.3 distro
- - fixed some Win32 compile problems
- - texture object priorities weren't getting initialized to 1.0
- - glAreTexturesResident return value was wrong when using hardware
- - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX)
- - glReadPixels with GLushort packed types was broken
- - fixed a few bugs in the GL_EXT_texture_env_combine texture code
- - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables
- - fixed some typos/bugs in the VB code
- - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work
- - optimized glDrawPixels paths weren't being used
- - per-fragment fog calculation didn't work without a Z buffer
- - improved blending accuracy, fixes Glean blendFunc test failures
- - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly
- - glXGetProcAddressARB() didn't always return the right address
- - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format
- - texture matrix changes weren't always detected (GLUT projtex demo)
- - fixed random color problem in vertex fog code
- - fixed Glide-related bug that let Quake get a 24-bit Z buffer
- Changes:
- - finished internal support for compressed textures for DRI
-</pre>
-<p>
-</p><h2>April 24, 2000</h2>
-<p>Mesa 3.2 has been released. Here's what's new since the beta release:</p>
-<pre> Bug fixes:
- - fixed memcpy bugs in span.c
- - fixed missing glEnd problem in demos/tessdemo.c
- - fixed bug when clearing 24bpp Ximages
- - fixed clipping problem found in Unreal Tournament
- - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2
- - fixed Loki's 3dfx RGB vs BGR bug
- - fixed Loki's 3dfx smooth/flat shading bug in SoF
- Changes:
- - updated docs/README file
- - use bcopy() optimizations on FreeBSD
- - re-enabled the optimized persp_textured_triangle() function
-</pre>
-<p>
-</p><h2>March 23, 2000</h2>
-<p>I've just upload the Mesa 3.2 beta 1 files to SourceForge at <a href="http://sourceforge.net/project/showfiles.php?group_id=3" target="_parent">http://sourceforge.net/project/filelist.php?group_id=3</a><a href="http://sourceforge.net/project/showfiles.php?group_id=3"></a></p>
-<p>3.2 (note even number) is a stabilization release of Mesa 3.1 meaning it's mainly
-just bug fixes.</p>
-<p>Here's what's changed:
-
-</p><ul>
- Bug fixes:
- <ul>
- - mixed drawing of lines and bitmaps sometimes had wrong colors<br>
- - added missing glHintPGI() function<br>
- - fixed a polygon culling bug<br>
- - fixed bugs in gluPartialDisk()<br>
- - Z values in selection mode were wrong<br>
- - added missing tokens:
- <ul>
- GL_SMOOTH_POINT_SIZE_RANGE<br>
- GL_SMOOTH_POINT_SIZE_GRANULARITY<br>
- GL_SMOOTH_LINE_WIDTH_RANGE<br>
- GL_SMOOTH_LINE_WIDTH_GRANULARITY<br>
- GL_ALIASED_POINT_SIZE_RANGE<br>
- GL_ALIASED_LINE_WIDTH_RANGE
- </ul>
- - fixed glCopyPixels when copying from back to front buffer<br>
- - GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT<br>
- - glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken<br>
- - glDeleteTextures() didn't decrement reference count correctly<br>
- - GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly<br>
- - Actual depth of transformation matrix stacks was off by one<br>
- - 24bpp visuals didn't address pixels correctly<br>
- - mipmap level of detail (lambda) calculation simplified, more accurate<br>
- - 101691 - Polygon clipping and GL_LINE<br>
- - 101928 - Polygon clipping and GL_LINE (same fix as above)<br>
- - 101808 - Non-glVertexArrays tristrip bug<br>
- - 101971 - find_last_3f on Dec OSF (worked around)<br>
- - 102369 - segv on dec osf (possibly a duplicate of the above)<br>
- - 102893 - orientations of modelview cause segfault
- </ul>
- New:
- <ul>
- - updated SVGA Linux driver<br>
- - added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX<br>
- - build libGLw.a (Xt/OpenGL drawing area widget) library by default<br>
- - changed -O2 to -O3 for a number of gcc configs
- </ul>
- Changes:
- <ul>
- - glXCopyContext's mask parameter is now unsigned long, per GLX spec
- </ul>
-</ul>
-
-<p>Please report any problems with this release ASAP. Bugs should be filed on the
-Mesa3D website at sourceforge.<br>
-After 3.2 is wrapped up I hope to release 3.3 beta 1 soon afterward.</p>
-<p>-- Brian</p>
-<p>
-</p><h2>December 17, 1999</h2>
-<p>A Slashdot interview with Brian about Mesa (questions submitted by Slashdot readers)
-can be found at <a href="http://slashdot.org/interviews/99/12/17/0927212.shtml" target="_parent">http://slashdot.org/interviews/99/12/17/0927212.shtml</a>.</p>
-<p>
-</p><h2>December 14, 1999</h2>
-<p>Mesa 3.1 is released!</p>
-<p>
-</p><h2>September 21, 1999</h2>
-<p>There appear to be two new files on the ftp site, <a href="ftp://ftp.mesa3d.org/mesa/beta/MesaLib-3.1beta3.tar.gz">MesaLib-3.1beta3.tar.gz</a>
-and <a href="ftp://ftp.mesa3d.org/mesa/beta/MesaDemos-3.1beta3.tar.gz">MesaDemos-3.1beta3.tar.gz</a>,
-that seem to be... yes, I've just received confirmation from the beta center, they
-are indeed the <b>THIRD</b> beta release of Mesa 3.1! Happy Days. Happy Days. Thanks
-Keith Whitwell for preparing these for us during Brian's absence.</p>
-<p>
-</p><h2>August 30, 1999</h2>
-<p>I'm pleased to announce that I've accepted a position with Precision Insight,
-Inc. effective October, 1999. I'll be leaving Avid Technology in September.</p>
-<p>I've been working on Mesa in my spare time for over five years. With Precision
-Insight I now have the opportunity to devote my full attention to advancing Mesa
-and OpenGL on Linux.</p>
-<p>While I'll be focused on Linux, the X Window System, and hardware acceleration,
-my work will continue to be open sourced and available to any other programmers who
-may want to contribute to it, or use it for other projects or platforms</p>
-<p>PS: I'm going to be traveling until Sep 6 and won't be reading email until then.</p>
-<p>
-</p><h2>August 23, 1999</h2>
-<p>Anonymous CVS access is back online so suck up all the bandwidth you can afford.
-Note that this is a new archive, so you will need to re-checkout the archive. That
-means don't <i>cvs update</i> from a previous download.</p>
-<p>
-</p><h2>August 17, 1999</h2>
-<p>A report from the SIGGRAPH '99 Linux/OpenGL
-BOF meeting is now available.</p>
-<p>-Brian</p>
-<p>
-</p><h2>August 14, 1999</h2>
-<p>www.mesa3d.org is having technical problems due to hardware failures at VA Linux
-systems. The Mac pages, ftp, and CVS services aren't fully restored yet. Please be
-patient.</p>
-<p>-Brian</p>
-<p>
-</p><h2>June 7, 1999</h2>
-<p>RPMS of the nVidia RIVA server can be found at <a href="ftp://ftp.mesa3d.org/mesa/misc/nVidia/">ftp://ftp.mesa3d.org/mesa/misc/nVidia/</a>.</p>
-<p>
-</p><h2>June 2, 1999</h2>
-<p><a href="http://www.nvidia.com/">nVidia</a> has released some Linux binaries for
-xfree86 3.3.3.1, along with the <b>full source</b>, which includes GLX acceleration
-based on Mesa 3.0. They can be downloaded from <a href="http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html">http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html</a>.</p>
-<p>
-</p><h2>May 24, 1999</h2>
-<p>Beta 2 of Mesa 3.1 has been make available at <a href="ftp://ftp.mesa3d.org/mesa/beta/">ftp://ftp.mesa3d.org/mesa/beta/</a>.
-If you are into the quake scene, you may want to try this out, as it contains some
-optimizations specifically in the Q3A rendering path.
-<p>
-</p><h2>May 13, 1999</h2>
-<p>For those interested in the integration of Mesa into XFree86 4.0, Precision Insight
-has posted their lowlevel design documents at http://www.precisioninsight.com.</p>
-<p>
-</p><h2>May 13, 1999</h2>
-<pre>May 1999 - John Carmack of id Software, Inc. has made a donation of
-US$10,000 to the Mesa project to support its continuing development.
-Mesa is a free implementation of the OpenGL 3D graphics library and id's
-newest game, Quake 3 Arena, will use Mesa as the 3D renderer on Linux.
-
-The donation will go to Keith Whitwell, who has been optimizing Mesa to
-improve performance on 3d hardware. Thanks to Keith's work, many
-applications using Mesa 3.1 will see a dramatic performance increase
-over Mesa 3.0. The donation will allow Keith to continue working on
-Mesa full time for some time to come.
-
-For more information about Mesa see www.mesa3d.org. For more
-information about id Software, Inc. see www.idsoftware.com.
-
---------------------------------
-
-This donation from John/id is very generous. Keith and I are very
-grateful.
-
-</pre>
-<p>
-</p><h2>May 1, 1999</h2>
-<p>John Carmack made an interesting .plan update yesterday:
-
-</p><ul>
- <i>"I put together a document on optimizing OpenGL drivers for Q3 that
- should be helpful to the various Linux 3D teams. <br>
- </i>http://www.quake3arena.com/news/glopt.html</i>"
-</ul>
-
-<p>
-</p><h2>April 7, 1999</h2>
-<p>Updated the Mesa contributors section and added links to RPM Mesa packages.</p>
-<p>
-</p><h2>March 18, 1999</h2>
-<p>The new webpages are now online. Enjoy, and let me know if you find any errors.
-For an eye-candy free version you can use <a href="http://www.mesa3d.org/txt/">http://www.mesa3d.org/txt/</a>.</p>
-<p>
-</p><h2>February 16, 1999</h2>
-<p><a href="http://www.sgi.com/">SGI</a> releases its <a href="http://www.sgi.com/software/opensource/glx/">GLX
-source code</a>.</p>
-<p>
-</p><h2>January 22, 1999</h2>
-<p>www.mesa3d.org established</p>
-
-
-</p>
-
-
-<hr>
-$Id: news.html,v 1.1.1.8 2005/12/01 03:11:30 kem Exp $
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/osmesa.html b/nx-X11/extras/Mesa/docs/osmesa.html
deleted file mode 100644
index 6feb8df52..000000000
--- a/nx-X11/extras/Mesa/docs/osmesa.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<HTML>
-
-<TITLE>Off-screen Rendering</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Off-screen Rendering</H1>
-
-
-<p>
-Mesa 1.2.4 introduced off-screen rendering, a facility for generating
-3-D imagery without having to open a window on your display. Mesa's
-simple off-screen rendering interface is completely operating system
-and window system independent so programs which use off-screen
-rendering should be very portable. This feature effectively
-enables you to use Mesa as an off-line, batch-oriented renderer.
-</p>
-<p>
-The "OSMesa" API provides 3 functions for making off-screen
-renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
-OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for
-more information. See the demos/osdemo.c file for an example program.
-There is no facility for writing images to files. That's up to you.
-</p>
-<p>
-If you want to generate large images (larger than 1280x1024) you'll
-have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
-then recompile Mesa. Image size should only be limited by available
-memory.
-</p>
-
-
-<H2>Deep color channels</H2>
-
-<p>
- For some applications 8-bit color channels don't have sufficient
- accuracy (film and IBR, for example). If you're in this situation
- you'll be happy to know that Mesa supports 16-bit and 32-bit color
- channels through the OSMesa interface. When using 16-bit channels,
- channels are GLushorts and RGBA pixels occupy 8 bytes. When using 32-bit
- channels, channels are GLfloats and RGBA pixels occupy 16 bytes.
-</p>
-<p>
- To build Mesa/OSMesa with 16-bit color channels:
-<pre>
- make realclean
- make linux-osmesa16
-</pre>
-
- For 32-bit channels:
-<pre>
- make realclean
- make linux-osmesa32
-</pre>
-
-<p>
-You'll wind up with a library named libOSMesa16.so or libOSMesa32.so.
-</p>
-
-<p>
-If you need to compile on a non-Linux platform, copy Mesa/configs/linux-osmesa16
-to a new config file and edit it as needed. Then, add the new config name to
-the top-level Makefile. Send a patch to the Mesa developers too, if you're
-inclined.
-</p>
-
-<p>
-BE WARNED: 16 and 32-bit channel support has not been exhaustively
-tested and there may be some bugs. However, a number of people have
-been using this feature successfully so it can't be too broken.
-</p>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/pbuffers.html b/nx-X11/extras/Mesa/docs/pbuffers.html
deleted file mode 100644
index 259910155..000000000
--- a/nx-X11/extras/Mesa/docs/pbuffers.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<HTML>
-
-<TITLE>PBuffer Rendering</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>PBuffer Rendering</H1>
-
-<p>
-Basically, FBconfigs and PBuffers allow you to do off-screen rendering
-with OpenGL. The OSMesa interface does basically the same thing, but
-fbconfigs and pbuffers are supported by more vendors.
-PBuffer rendering may also be hardware accelerated.
-</p>
-
-<p>
-PBuffers are getting more use nowadays, though they've actually been
-around for a long time on IRIX systems and other workstations.
-</p>
-
-<p>
-The
-<a href="http://oss.sgi.com/projects/ogl-sample/registry/SGIX/fbconfig.txt"
-target="_parent">GL_SGIX_fbconfig</a>
-and
-<a href="http://oss.sgi.com/projects/ogl-sample/registry/SGIX/pbuffer.txt"
-target="_parent">
-GL_SGIX_pbuffer</a> extensions describe the functionality.
-More recently, these extensions have been promoted to ARB extensions (on
-Windows at least).
-</p>
-
-<p>
-The Mesa/progs/xdemos/ directory has some useful code for working
-with pbuffers:
-</p>
-
-<ul>
-<li><b>pbinfo.c</b> - like glxinfo, it prints a list of available
- fbconfigs and whether each supports pbuffers.
-<li><b>pbutil.c</b> - a few utility functions for dealing with
- fbconfigs and pbuffers.
-<li><b>pbdemo.c</b> - a demonstration of off-screen rendering with pbuffers.
-</ul>
-
-<p>
-Mesa 4.1 and later support GL_SGIX_fbconfig and GL_SGIX_pbuffer (software
-rendering only).
-</p>
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/perf.html b/nx-X11/extras/Mesa/docs/perf.html
deleted file mode 100644
index ee9c4b117..000000000
--- a/nx-X11/extras/Mesa/docs/perf.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<HTML>
-
-<TITLE>Performance Tips</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Performance Tips</H1>
-
-<p>
-Performance tips for software rendering:
-</P>
-<ol>
-
-<li> Turn off smooth shading when you don't need it (glShadeModel)
-<li> Turn off depth buffering when you don't need it.
-<li> Turn off dithering when not needed.
-<li> Use double buffering as it's often faster than single buffering
-<li> Compile in the X Shared Memory extension option if it's supported
- on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
- your system in the Make-config file.
-<li> Recompile Mesa with more optimization if possible.
-<li> Try to maximize the amount of drawing done between glBegin/glEnd pairs.
-<li> Use the MESA_BACK_BUFFER variable to find best performance in double
- buffered mode. (X users only)
-<li> Optimized polygon rasterizers are employed when:
- rendering into back buffer which is an XImage
- RGB mode, not grayscale, not monochrome
- depth buffering is GL_LESS, or disabled
- flat or smooth shading
- dithered or non-dithered
- no other rasterization operations enabled (blending, stencil, etc)
-<li> Optimized line drawing is employed when:
- rendering into back buffer which is an XImage
- RGB mode, not grayscale, not monochrome
- depth buffering is GL_LESS or disabled
- flat shading
- dithered or non-dithered
- no other rasterization operations enabled (blending, stencil, etc)
-<li> Textured polygons are fastest when:
- using a 3-component (RGB), 2-D texture
- minification and magnification filters are GL_NEAREST
- texture coordinate wrap modes for S and T are GL_REPEAT
- GL_DECAL environment mode
- glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST )
- depth buffering is GL_LESS or disabled
-<li> Lighting is fastest when:
- Two-sided lighting is disabled
- GL_LIGHT_MODEL_LOCAL_VIEWER is false
- GL_COLOR_MATERIAL is disabled
- No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
- No local lights are used (all position W's are 0.0)
- All material and light coefficients are >= zero
-<li> XFree86 users: if you want to use 24-bit color try starting your
- X server in 32-bit per pixel mode for better performance. That is,
- start your X server with
- startx -- -bpp 32
- instead of
- startx -- -bpp 24
-<li> Try disabling dithering with the MESA_NO_DITHER environment variable.
- If this env var is defined Mesa will disable dithering and the
- command glEnable(GL_DITHER) will be ignored.
-</ol>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/precompiled.html b/nx-X11/extras/Mesa/docs/precompiled.html
deleted file mode 100644
index 166d33d82..000000000
--- a/nx-X11/extras/Mesa/docs/precompiled.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<HTML>
-
-<TITLE>Precompiled libraries</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Precompiled Libraries</H1>
-
-<p>
-In general, precompiled libraries are not available.
-However, people occasionally prepare packages of precompiled libraries
-for some systems.
-</p>
-
-<H2>Mesa-6.0 for Solaris</H2>
-
-<p>
-Steve Christensen has submitted precompiled Mesa-6.0 libraries for
-Solaris at <a href="http://sunfreeware.com/" target="_parent">
-sunfreeware.com</a>.
-</p>
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/relnotes.html b/nx-X11/extras/Mesa/docs/relnotes.html
deleted file mode 100644
index fb4321e73..000000000
--- a/nx-X11/extras/Mesa/docs/relnotes.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Release Notes</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Release Notes</H1>
-
-<p>
-The release notes summarize what's new or changed in each Mesa release.
-</p>
-
-<UL>
-<LI><A HREF="RELNOTES-6.4.1">RELNOTES-6.4.1</A>
-<LI><A HREF="RELNOTES-6.4">RELNOTES-6.4</A>
-<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
-<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
-<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
-<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>
-<LI><A HREF="RELNOTES-6.1">RELNOTES-6.1</A>
-<LI><A HREF="RELNOTES-6.0">RELNOTES-6.0</A>
-<LI><A HREF="RELNOTES-5.1">RELNOTES-5.1</A>
-<LI><A HREF="RELNOTES-5.0.2">RELNOTES-5.0.2</A>
-<LI><A HREF="RELNOTES-5.0.1">RELNOTES-5.0.1</A>
-<LI><A HREF="RELNOTES-5.0">RELNOTES-5.0</A>
-<LI><A HREF="RELNOTES-4.1">RELNOTES-4.1</A>
-<LI><A HREF="RELNOTES-4.0.3">RELNOTES-4.0.3</A>
-<LI><A HREF="RELNOTES-4.0.2">RELNOTES-4.0.2</A>
-<LI><A HREF="RELNOTES-4.0.1">RELNOTES-4.0.1</A>
-<LI><A HREF="RELNOTES-4.0">RELNOTES-4.0</A>
-<LI><A HREF="RELNOTES-3.5">RELNOTES-3.5</A>
-<LI><A HREF="RELNOTES-3.4.2">RELNOTES-3.4.2</A>
-<LI><A HREF="RELNOTES-3.4.1">RELNOTES-3.4.1</A>
-<LI><A HREF="RELNOTES-3.4">RELNOTES-3.4</A>
-<LI><A HREF="RELNOTES-3.3">RELNOTES-3.3</A>
-<LI><A HREF="RELNOTES-3.2.1">RELNOTES-3.2.1</A>
-<LI><A HREF="RELNOTES-3.2">RELNOTES-3.2</A>
-<LI><A HREF="RELNOTES-3.1">RELNOTES-3.1</A>
-</UL>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/science.html b/nx-X11/extras/Mesa/docs/science.html
deleted file mode 100644
index f55cf3124..000000000
--- a/nx-X11/extras/Mesa/docs/science.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<HTML>
-
-<TITLE>Science and Technical</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Science and Technical</H1>
-
-<ul>
- <li><a href="http://www.softintegration.com/products/toolkit/opengl/" target="_parent">Ch</a> - OpenGL bindings for the Ch C/C++ interpreter
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">CLEO3D</a> - event displayer for the CLEOIII detector
- </li><li><a href="http://www.bioz.unibas.ch/%7Exray/dino/" target="_parent">DINO</a> - Visualizing
- Structural Biology
- </li><li><a href="http://www-xdiv.lanl.gov/XCM/gmv/GMVHome.html" target="_parent">General
- Mesh Viewer (GMV)</a> - scientific vis.
- </li><li><a href="http://gid.cimne.upc.es/" target="_parent">GiD</a> - finite element
- analysis
- </li><li><a href="http://sig.co.za/download.htm" target="_parent">glpoisson</a> - A finite
- element analysis program that simulates wave in an arbitrary region.
- </li><li><a href="http://glwaves.sourceforge.net/" target="_parent">GLWaves</a> -
- Electromagnetic wave visualization
- </li><li><a href="http://www.geuz.org/gmsh/" target="_parent">Gmsh</a> -
- finite element mesh generator / viewer
- </li><li><a href="http://laaksonen.csc.fi/gopenmol/gopenmol.htmls" target="_parent">gOpenMol</a>
- - computational chemistry
- </li><li><a href="http://www.mgix.com/gps3d/" target="_parent">GPS 3D</a> - GPS-based map visualization
- </li><li><a href="http://hirame.hiram.edu/%7Eworleyam/" target="_parent">Hitchhiker</a>
- - virtual solar system
- </li><li><a href="http://www-xdiv.lanl.gov/XCM/Hydra/" target="_parent">Hydra</a> - physics
- and engineering pkg
- </li><li><a href="http://fox.mit.edu/skunk/soft/lightspeed/" target="_parent">Light Speed</a>
- - a real-time, interactive relativistic simulator
- </li><li><a href="http://linkwinds.jpl.nasa.gov/" target="_parent">LinkWinds</a> - scientific
- vis
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html" target="_parent">MathGL3d</a> - Mathematica viewer
- </li><li><a href="http://www.mathworks.com/products/matlab" target="_parent">Mathworks</a>
- - mathematics and visualization
- </li><li><a href="http://www-rocq.inria.fr/gamma/medit/medit.html" target="_parent">Medit</a> - 3D surface mesh viewer
- </li><li><a href="http://www.mol.biol.ethz.ch/wuthrich/software/molmol/" target="_parent">MOLMOL</a>
- - molecular modeling and analysis
- </li><li><a href="http://www.avatar.se/molscript/" target="_parent">Molscript</a> - molecular
- modeling
- </li>
- <li><a href="http://www.opendx.org/" target="_parent">OpenDX</a> - Data visualization
- system
- </li>
- <li><a href="http://orsa.sourceforge.net/" target="_parent">ORSA</a> - An interactive tool for Celestial Mechanics
- </li>
- <li><a href="http://www.paraview.org/" target="_parent">ParaView</a> - Scientific visualization package
- </li>
- <li><a href="http://mesa3d.sourceforge.net/notfound.html">PHLEX</a> - Finite element vis
- </li><li><a href="http://root.cern.ch/" target="_parent">ROOT</a> - Object Oriented Data
- Analysis Framework
- </li><li><a href="http://www.slffea.com/" target="_parent">SLFFEA</a> - GNU finite element
- package
- </li><li><a href="http://quorum.tamu.edu/jon/spock" target="_parent">Spock</a> - molecular
- modeling
- </li><li><a href="http://www1.las.es/%7Eamil/ssystem" target="_parent">Ssystem</a> - solar
- system simulation
- </li><li><a href="http://mesa3d.sourceforge.net/notfound.html">SPARROW</a> - robot simulation
- </li><li><a href="http://www.ssec.wisc.edu/%7Ebillh/vis5d.html" target="_parent">Vis5D</a>
- - atmospheric visualization
- </li><li><a href="http://www.ks.uiuc.edu/Research/vmd/" target="_parent">VMD</a> - molecular
- modeling
- </li><li><a href="http://www.cyberbotics.com/" target="_parent">Webots</a> - 3-D mobile
- robot simulator
-</li></ul>
-
-
-</body></html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/sourcedocs.html b/nx-X11/extras/Mesa/docs/sourcedocs.html
deleted file mode 100644
index a5248d988..000000000
--- a/nx-X11/extras/Mesa/docs/sourcedocs.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<HTML>
-
-<TITLE>Source Code Documentation</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Source Code Documentation</H1>
-
-<p>
-<A HREF="http://www.doxygen.org" target="_parent">Doxygen</A>
-is used to automatically
-produce cross-referenced documentation from the Mesa sources.
-This is not included in the normal Mesa distribution.
-Download Mesa from CVS if interested.
-</P>
-
-<P>
-If you're reading this page from your local copy of Mesa, and have
-run the doxygen scripts, you can read the documentation
-<A HREF="../doxygen/main/index.html" target="_parent">here</A>
-</P>
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/subset-A.html b/nx-X11/extras/Mesa/docs/subset-A.html
deleted file mode 100644
index dac66a61b..000000000
--- a/nx-X11/extras/Mesa/docs/subset-A.html
+++ /dev/null
@@ -1,3579 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <title>Mini GLX Specification</title>
-</head>
-<body>
-<span style="font-style: italic;"></span><span
- style="font-weight: bold;"></span>
-<h1>
-<center>Mesa Subset Specification</center>
-</h1>
-<h2>
-<center>
-<h3>Tungsten Graphics, Inc.</h3>
-<h3>February 26, 2003<br>
-</h3>
-</center>
-</h2>
-<p> Copyright &copy; 2002-2003 by <a
- href="http://www.tungstengraphics.com/">Tungsten Graphics, Inc.</a>,
-Cedar Park, Texas. All Rights Reserved. <br>
-<br>
-Permission is granted to make and distribute verbatim copies of this
-document provided the copyright notice and this permission notice are
-preserved on all copies.<br>
-</p>
-<p> OpenGL is a trademark of <a href="http://www.sgi.com">Silicon
-Graphics, Inc.</a>.</p>
-<h1>1. Introduction</h1>
-This document describes a subset of the Mesa implemented by Tungsten
-Graphics, Inc. for embedded devices. &nbsp;Prior to reading this
-document the reader should be familiar with the OpenGL 1.2.1
-specification dated April 1, 1999 (available from <a
- href="http://www.opengl.org/developers/documentation/specs.html">http://www.opengl.org/developers/documentation/specs.html</a>.)
-&nbsp;Experience with OpenGL programming is highly advisable.<a
- href="http://www.opengl.org/developers/documentation/specs.html"><br>
-</a><br>
-Tungsten Graphics, Inc. is working with industry standards
-organizations +in an attempt to standardize this Mesa subset and any
-other possible subsets +as a result of this work. <br>
-<br>
-Appendix A contains a list of issues of which some may not be resolved.<br>
-<br>
-To summarize, the following major features of Mesa are omitted from the
-subset:<br>
-<ul>
- <li>Vertex arrays</li>
- <li>Texture coordinate generation</li>
- <li>Lighting</li>
- <li>Point size</li>
- <li>Polygon stipple</li>
- <li>DrawPixels, CopyPixels, PixelZoom</li>
- <li>1-D and 3-D textures</li>
- <li>CopyTex[Sub]Image</li>
- <li>Fog</li>
- <li>Depth test</li>
- <li>Color Index mode</li>
- <li>Accumulation buffer</li>
- <li>Feedback mode</li>
- <li>Evaluators</li>
- <li>Push/Pop attributes</li>
- <li>Display lists<br>
- </li>
-</ul>
-<p>Further reductions are made at a lower level of detail.<br>
-</p>
-<p>Mesa function names are printed in <span style="font-weight: bold;">bold
-face</span>. &nbsp;Function parameters are printed in <span
- style="font-style: italic;">italics</span>.<br>
-</p>
-<p>The Tungsten Graphics, Inc. Mesa subset library is hereafter
-referred to as <span style="font-style: italic;">the subset.</span><br>
-<br>
-</p>
-<h1>2. Primitive Specification</h1>
-<h2>2.1 glBegin, glEnd and glVertex Commands</h2>
-The basic rendering primitives are points, lines and triangles.
-&nbsp;Quadrilaterals and polygons are composed of triangles.
-&nbsp;Primitives are drawn with the <span style="font-weight: bold;">glBegin</span>
-and <span style="font-weight: bold;">glEnd</span> commands and a subset
-of the <span style="font-weight: bold;">glVertex</span> commands:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBegin</span>(GLenum<span
- style="font-style: italic;">mode</span>)<br>
-void <span style="font-weight: bold;">glEnd</span>(void)<br>
-<br>
-void <span style="font-weight: bold;">glVertex2f</span>(GLfloat <span
- style="font-style: italic;">x</span>, GLfloat <span
- style="font-style: italic;">y</span>)<br>
-void <span style="font-weight: bold;">glVertex2fv</span>(const GLfloat
-*<span style="font-style: italic;">v</span>)<br>
-void <span style="font-weight: bold;">glVertex3f</span>(GLfloat <span
- style="font-style: italic;">x</span>, GLfloat <span
- style="font-style: italic;">y</span>, GLfloat <span
- style="font-style: italic;">z</span>)<br>
-void <span style="font-weight: bold;">glVertex3fv</span>(const GLfloat
-*<span style="font-style: italic;">v</span>)<br>
-</div>
-<br>
-The <span style="font-style: italic;">mode</span> parameter to <span
- style="font-weight: bold;">glBegin</span> may be one of the following<br>
-<br>
-<div style="margin-left: 40px;">GL_POINTS - a series of individual
-points<br>
-GL_LINES - a series of disjoint line segments<br>
-GL_LINE_STRIP - series of connected line segments<br>
-GL_LINE_LOOP - a closed loop of line segments<br>
-GL_TRIANGLES - a series of individual triangles<br>
-GL_TRIANGLE_STRIP - a connected strip of triangles<br>
-GL_TRIANGLE_FAN - a sequence of triangles all sharing a common vertex<br>
-GL_QUADS - a sequence of individual quadrilaterals<br>
-GL_QUAD_STRIP - a connected strip of quadrilaterals<br>
-GL_POLYGON - a closed, convex polygon<br>
-<br>
-</div>
-<br>
-The <span style="font-weight: bold;">glVertex</span> commands take two
-or three floating point coordinates, or a pointer to an array of two or
-three floating point coordinates. &nbsp;Vertices are actually 4-element
-homogeneous coordinates. &nbsp;The fourth component, unspecified by the
-subset's <span style="font-weight: bold;">glVertex</span> commands, is
-one.<br>
-<br>
-<span style="font-weight: bold;"></span>
-<h2>2.2 Other Per-vertex Commands<br>
-</h2>
-The <span style="font-weight: bold;">glColor</span> and <span
- style="font-weight: bold;">glTexCoord</span> commands may be used to
-specify colors and texture coordinates for each vertex:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glColor3f</span>(GLfloat<span
- style="font-style: italic;">red</span>, GLfloat <span
- style="font-style: italic;">green</span>, GLfloat <span
- style="font-style: italic;">blue</span>)<br>
-void <span style="font-weight: bold;">glColor3fv</span>(const GLfloat *<span
- style="font-style: italic;">rgb</span>)<br>
-void <span style="font-weight: bold;">glColor4f</span>(GLfloat <span
- style="font-style: italic;">red,</span> GLfloat <span
- style="font-style: italic;">green,</span> GLfloat <span
- style="font-style: italic;">blue,</span> GLfloat <span
- style="font-style: italic;">alpha</span>)<br>
-void <span style="font-weight: bold;">glColor4fv</span>(const GLfloat *<span
- style="font-style: italic;">rgba</span>)<br>
-void <span style="font-weight: bold;">glTexCoord2f</span>(GLfloat <span
- style="font-style: italic;">s</span>, GLfloat<span
- style="font-style: italic;"> t</span>)<br>
-void <span style="font-weight: bold;">glTexCoord2fv</span>(const
-GLfloat *<span style="font-style: italic;">c</span>)<br>
-<br>
-</div>
-The <span style="font-weight: bold;">glColor</span> commands specify
-the color and optionally, the alpha value, for subsequent vertices.
-&nbsp;For the <span style="font-weight: bold;">glColor3</span> commands,
-alpha is set to one.<br>
-<br>
-The <span style="font-weight: bold;">glTexCoord2</span> commands
-specify the texture coordinate for subsequent vertices. &nbsp;Texture
-coordinates are actually four-component coordinates: (s, t, r, q).
-&nbsp;The <span style="font-weight: bold;">glTexCoord2</span> commands
-set s and t explicitly. &nbsp;The r and q components are zero and one,
-respectively.<br>
-<br>
-<span style="font-weight: bold;"></span>Only <span
- style="font-weight: bold;">glVertex, glColor</span> and <span
- style="font-weight: bold;">glTexCoord</span> commands are allowed
-between <span style="font-weight: bold;">glBegin</span> and <span
- style="font-weight: bold;">glEnd.</span> &nbsp;Calling any other
-command between <span style="font-weight: bold;">glBegin</span> and <span
- style="font-weight: bold;">glEnd</span> will result in the error
-GL_INVALID_OPERATION.<br>
-<br>
-<h2>2.3 Unsupported Commands</h2>
-None of the following commands related to primitive specification are
-supported by the subset:<br>
-<br>
-<div style="margin-left: 40px;">Per-Vertex commands:<br>
-</div>
-<div style="margin-left: 40px;">
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glVertex2d,
-glVertex2i, glVertex2s, glVertex3d, glVertex3i, glVertex3s, glVertex4d,
-glVertex4i, glVertex4s, glVertex2dv, glVertex2iv, glVertex2sv,
-glVertex3dv, glVertex3iv, glVertex3sv, glVertex4dv, glVertex4iv,
-glVertex4sv,<br>
-glNormal3b, glNormal3d, glNormal3f, glNormal3i, glNormal3s, </span><span
- style="font-weight: bold;">glNormal3bv, glNormal3dv, glNormal3fv,
-glNormal3iv, glNormal3sv,<br>
-glIndexd, glIndexf, glIndexi, glIndexs, glIndexub, glIndexdv,
-glIndexfv, glIndexiv, glIndexsv, glIndexubv,<br>
-glColor3b, glColor3d, glColor3i, glColor3s, glColor3ub, glColor3ui,
-glColor3us, </span><span style="font-weight: bold;">glColor3bv,
-glColor3dv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv,
-glColor3usv,</span><span style="font-weight: bold;"> lColor4b,
-glColor4d, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, </span><span
- style="font-weight: bold;">glColor4bv, glColor4dv, glColor4iv,
-glColor4sv, glColor4ubv, glColor4uiv, glColor4usv,<br>
-</span><span style="font-weight: bold;">glTexCoord1d, glTexCoord1f,
-glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2i, glTexCoord2s,
-glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, glTexCoord4d,
-glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv,
-glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2iv,
-glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv,
-glTexCoord3sv, glTexCoord4dv, glTexCoord4fv, glTexCoord4iv,
-glTexCoord4sv,<br>
-glEdgeFlag, glEdgeFlagv</span><br style="font-weight: bold;">
-<br>
-</div>
-Vertex array commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glVertexPointer,
-glColorPointer, glIndexPointer, glTexCoordPointer, glEdgeFlagPointer,
-glNormalPointer, glInterleavedArrays, glArrayElement, glDrawArrays,
-glDrawElements, glDrawRangeElements, glEnableClientState,
-glDisableClientState</span><br>
-</div>
-</div>
-<div style="margin-left: 40px;"><br>
-Rectangle commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glRects,
-glRecti, glRectf, glRectd, glRectsv, glRectiv, glRectfv, glRectdv,<br>
-<br>
-</span></div>
-</div>
-<div style="margin-left: 40px;">Lighting commands:<br>
-</div>
-<div style="margin-left: 80px;"><span style="font-weight: bold;">glMaterialf,
-glMateriali, glMaterialfv, glMaterialiv<br>
-</span><br>
-</div>
-<div style="margin-left: 40px;"> Evaluator commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glEvalCoord1d,
-glEvalCoord1f, glEvalCoord1dv, glEvalCoord1fv,&nbsp;</span><span
- style="font-weight: bold;">glEvalCoord2d, glEvalCoord2f,
-glEvalCoord2dv, glEvalCoord2fv,<br>
-</span><span style="font-weight: bold;">glEvalPoint1, glEvalPoint2</span><br>
-<br>
-</div>
-</div>
-<h1>3. Coordinate Transformation</h1>
-<h2>3.1 Vertex Transformation</h2>
-Vertex coordinates are transformed by the current modelview and
-projection matrices then mapped to window coordinates as specified by
-the viewport. &nbsp;The following coordinate transformation commands are
-supported by the subset<br>
-<br>
-<div style="margin-left: 40px; font-weight: bold;">glMatrixMode<span
- style="font-weight: normal;">(GLenum <span style="font-style: italic;">mode</span>)</span><br>
-glLoadIdentity<span style="font-weight: normal;">(void)</span><br>
-glPushMatrix<span style="font-weight: normal;">(void)</span><br>
-glPopMatrix<span style="font-weight: normal;">(void)</span><br>
-glLoadMatrixf<span style="font-weight: normal;">(const GLfloat *<span
- style="font-style: italic;">m</span>)</span><br>
-glMultMatrixf<span style="font-weight: normal;">(const GLfloat *<span
- style="font-style: italic;">m</span>)</span><br>
-glRotatef<span style="font-weight: normal;">(GLfloat <span
- style="font-style: italic;">angle</span>, GLfloat <span
- style="font-style: italic;">x</span>, GLfloat <span
- style="font-style: italic;">y</span>, GLfloat <span
- style="font-style: italic;">z</span>)</span><br>
-glTranslatef<span style="font-weight: normal;">(GLfloat <span
- style="font-style: italic;">x</span>, GLfloat <span
- style="font-style: italic;">y</span>, GLfloat <span
- style="font-style: italic;">z</span>)</span><br>
-glScalef<span style="font-weight: normal;">(GLfloat <span
- style="font-style: italic;">x</span>, GLfloat <span
- style="font-style: italic;">y</span>, GLfloat <span
- style="font-style: italic;">z</span>)<br>
-<span style="font-weight: bold;">glFrustum(</span>GLdouble <span
- style="font-style: italic;">left,</span> GLdouble <span
- style="font-style: italic;">right,</span> GLdouble <span
- style="font-style: italic;">bottom,</span> GLdouble <span
- style="font-style: italic;">top,</span> GLdouble <span
- style="font-style: italic;">near,</span> GLdouble <span
- style="font-style: italic;">far</span>)</span><br>
-<span style="font-weight: normal;"><span style="font-weight: bold;">glOrtho(</span>GLdouble<span
- style="font-style: italic;"> left,</span> GLdouble <span
- style="font-style: italic;">right,</span> GLdouble <span
- style="font-style: italic;">bottom,</span> GLdouble <span
- style="font-style: italic;">top,</span> GLdouble <span
- style="font-style: italic;">near,</span> GLdouble <span
- style="font-style: italic;">far</span>)</span><br>
-glViewport<span style="font-weight: normal;">(GLint <span
- style="font-style: italic;">x</span>, GLint <span
- style="font-style: italic;">y</span>, GLsize <span
- style="font-style: italic;">width,</span> GLsizei <span
- style="font-style: italic;">height</span>)</span><br>
-</div>
-<br>
-The <span style="font-weight: bold;">glMatrixMode</span> command
-specifies the <span style="font-style: italic;">current matrix.</span>
-&nbsp;The mode parameter may be GL_MODELVIEW or GL_PROJECTION to specify
-the modelview matrix or projection matrix. &nbsp;Subsequent matrix
-commands will effect the current matrix. &nbsp;Also associated with the
-modelview and projection matrices are a modelview matrix stack and
-projection matrix stack.<br>
-<br>
-The <span style="font-weight: bold;">glLoadIdentity</span> command
-replaces the current matrix with the identity matrix. &nbsp;The matrix
-elements are specified in column-major order.<br>
-<br>
-The <span style="font-weight: bold;">glPushMatrix</span> command pushes
-a copy of the current matrix onto either the modelview matrix stack or
-the projection matrix stack. &nbsp;The <span style="font-weight: bold;">glPopMatrix</span>
-command replaces the current matrix with a copy of the top matrix off
-the modelview matrix stack or projection matrix stack, the pops the
-stack. &nbsp;Matrix stacks are useful for traversing and rendering
-hierarchical models.<br>
-<br>
-The <span style="font-weight: bold;">glMultMatrixf</span> command
-post-multiplies the current matrix by the specified matrix. &nbsp;The
-matrix elements are specified in column-major order.<br>
-<br>
-The <span style="font-weight: bold;">glRotatef</span> command
-post-multiplies the current matrix by a rotation matrix defined by the
-angle and rotation axis defined by x, y and z.<br>
-<br>
-The <span style="font-weight: bold;">glTranslatef</span> command
-post-multiplies the current matrix by a translation matrix defined by
-the <span style="font-style: italic;">x</span>, <span
- style="font-style: italic;">y</span> and <span
- style="font-style: italic;">z</span> translation parameters.<br>
-<span style="font-weight: bold;"></span><br>
-The <span style="font-weight: bold;">glScalef</span> command
-post-multiplies the current matrix by a scaling matrix defined by the <span
- style="font-style: italic;">x</span>, <span
- style="font-style: italic;">y</span> and <span
- style="font-style: italic;">z</span> scale factors.<br>
-<span style="font-weight: bold;"></span><br>
-The <span style="font-weight: bold;">glFrustum</span> command
-post-multiplies the current matrix by a perspective projection matrix.
-&nbsp;The <span style="font-style: italic;">near</span> and <span
- style="font-style: italic;">far</span> values specify the position of
-the hither and yon Z-axis clipping planes. &nbsp;The <span
- style="font-style: italic;">left, right, bottom</span> and <span
- style="font-style: italic;">top</span> parameters are the X and Y
-extents at the near clipping plane. &nbsp;<span
- style="font-weight: bold;">glFrustum</span> is normally used to modify
-the projection matrix.<br>
-<br>
-The <span style="font-weight: bold;">glOrtho</span> command
-post-multiplies the current matrix by an orthographic projection matrix.
-&nbsp;The <span style="font-style: italic;">near</span> and <span
- style="font-style: italic;">far</span> values specify the position of
-the hither and yon Z-axis clipping planes. &nbsp;The <span
- style="font-style: italic;">left, right, bottom</span> and <span
- style="font-style: italic;">top</span> parameters specify the X and
-Y-axis clipping planes. &nbsp;<span style="font-weight: bold;">glOrtho</span>
-is normally used to modify the projection matrix.<br>
-<br>
-The <span style="font-weight: bold;">glViewport</span> command
-specifies the mapping of coordinates from normalized device coordinates
-to window coordinates. &nbsp;The <span style="font-style: italic;">x</span>
-and <span style="font-style: italic;">y</span> parameters specify the
-viewport's lower-left corner in the window and the <span
- style="font-style: italic;">width</span> and <span
- style="font-style: italic;">height</span> parameters specify the size
-of the viewport. &nbsp;<span style="font-weight: bold;">glViewport</span>
-does not effect the current matrix.<br>
-<br>
-A coordinate transformed to window coordinates is hereafter known as (x<sub>w</sub>,
-y<sub>w</sub>, z<sub>w</sub>).<br>
-<br>
-<h2>3.2 Clipping</h2>
-View-volume clipping automatically discards or trims primitives which
-lie completely or partially outside of the view volume specified by <span
- style="font-weight: bold;">glFrustum</span> and <span
- style="font-weight: bold;">glOrtho</span>. &nbsp;Note that the <span
- style="font-weight: bold;">glViewport</span> command does not define a
-clipping region.<br>
-<br>
-Clipping occurs in <span style="font-style: italic;">clip coordinate
-space - </span>the coordinates produced after applying the projection
-matrix.<br>
-<br>
-<h2>3.3 Current Raster Position</h2>
-The current raster position specifies the location for drawing images
-with <span style="font-weight: bold;">glBitmap.</span> &nbsp;The current
-raster position is set with the commands:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glRasterPos2f</span>(GLfloat<span
- style="font-style: italic;">x</span>, GLfloat <span
- style="font-style: italic;">y</span>)<br>
-void <span style="font-weight: bold;">glRasterPos2fv</span>(const
-GLfloat *<span style="font-style: italic;">v</span>)<br>
-void <span style="font-weight: bold;">glRasterPos2i</span>(GLint <span
- style="font-style: italic;">x</span>, GLint <span
- style="font-style: italic;">y</span>)<br>
-void <span style="font-weight: bold;">glRasterPos2iv</span>(const
-GLint *<span style="font-style: italic;">v</span>)<br>
-</div>
-<br>
-<span style="font-weight: bold;">glRasterPos</span> specifies a
-4-component coordinate (x, y, 0, 1). &nbsp;The coordinate is processed
-like a vertex; it is transformed by the modelview matrix, the projection
-matrix and mapped to the viewport. &nbsp;The resulting window coordinate
-is stored as the current raster position. &nbsp;The coordinate is
-clipped-tested against the frustum like a vertex. &nbsp;If the
-coordinate is clipped, then the current raster position becomes invalid
-and subsequent <span style="font-weight: bold;">glBitmap</span> commands
-have no effect.<br>
-<br>
-<span style="font-weight: bold;">glRasterPos</span> also updates the
-current raster color and current raster texture coordinates. &nbsp;The
-current raster color is updated (copied) from the current color (as
-specified by <span style="font-weight: bold;">glColor</span>).
-&nbsp;The current raster texture coordinate is updated (copied) from the
-current texture coordinate (as specified by <span
- style="font-weight: bold;">glTexCoord</span>).<br>
-<br>
-<h2>3.4 Unsupported Commands</h2>
-The following commands related to vertex transformation are not
-supported by the subset:<br>
-<br>
-<div style="margin-left: 40px;">User-defined clip plane commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glClipPlane</span><br>
-</div>
-<span style="font-weight: bold;"></span></div>
-<br>
-<div style="margin-left: 40px;">Lighting and material commands:</div>
-<div style="margin-left: 80px;"><span style="font-weight: bold;">glLightModeli,
-glLightModelf,&nbsp;</span><span style="font-weight: bold;">glLightModeliv,
-glLightModelfv,</span><span style="font-weight: bold;"> glLightf,
-glLighti, glLightfv, glLightiv, glColorMaterial</span><br>
-</div>
-<br>
-<div style="margin-left: 40px;">Automatic texture coordinate generation
-commands:<br>
-</div>
-<div style="margin-left: 40px;">
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glTexGend,
-glTexGenf, glTexGeni, </span><span style="font-weight: bold;">glTexGendv,
-glTexGenfv, glTexGeniv, </span><br>
-<br style="font-weight: bold;">
-</div>
-Double-valued commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glLoadMatrixd,
-glMultMatrixd, glRotated, glTranslated, glScaled</span><br
- style="font-weight: bold;">
-</div>
-<br>
-Depth Range command:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glDepthRange</span>
-(the near value is always 0.0 and the far value is always 1.0)<br>
-</div>
-<br>
-Extra RasterPos commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glRasterPos2d,
-glRasterPos2s, glRasterPos3d, glRasterPos3f, glRasterPos3i,
-glRasterPos3s, glRasterPos4d, glRasterPos4f, glRasterPos4i,
-glRasterPos4s, glRasterPos2dv, glRasterPos2sv, glRasterPos3dv,
-glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, glRasterPos4dv,
-glRasterPos4fv, glRasterPos4iv, glRasterPos4sv</span><br>
-</div>
-<br>
-<br>
-</div>
-<h1>4. Rasterization</h1>
-This section describes the commands and options for drawing points,
-lines, triangles and bitmaps. &nbsp;<span style="font-style: italic;">Rasterization</span>
-is the term for the process which produces fragments from the geometric
-description of a primitive (a point, line, polygon or bitmap). &nbsp;For
-example, given the two coordinates for the end-points of a line segment,
-rasterization determines which pixels in the frame buffer are modified
-to <span style="font-style: italic;">draw</span> the line. &nbsp;A
-fragment is a tuple which consists of a window coordinate, colors and
-texture coordinates. &nbsp;The fragments produced by rasterization are
-subsequently processed by the per-fragment operations described later.<br>
-<br>
-<h2>4.1 Point Rasterization</h2>
-Points are rendered with the command sequence <span
- style="font-weight: bold;">glBegin</span>(GL_POINTS), <span
- style="font-weight: bold;">glVertex</span>, ... <span
- style="font-weight: bold;">glEnd</span>. &nbsp;The window coordinate (x<sub>w</sub>,
-y<sub>w</sub>, z<sub>w</sub>) is truncated to rasterize the point.
-&nbsp;The truncated coordinate with its associated color and texture
-coordinate is sent as a single fragment to the per-fragment processing
-stages.<br>
-<br>
-The <span style="font-weight: bold;">glPointSize</span> command is not
-supported; only 1-pixel points are supported.<br>
-<br>
-Point smoothing (antialiasing) is also not supported.<br>
-<br>
-<h2>4.2 Line Rasterization</h2>
-Lines are rendered with the command sequence <span
- style="font-weight: bold;">glBegin</span>(<span
- style="font-style: italic;">mode</span>), <span
- style="font-weight: bold;">glVertex</span>, <span
- style="font-weight: bold;">glVertex</span>, ... <span
- style="font-weight: bold;">glEnd</span> where <span
- style="font-style: italic;">mode</span> is one of GL_LINES,
-GL_LINE_STRIP or GL_LINE_LOOP. &nbsp;Lines are rasterized as described
-in the OpenGL specification. &nbsp;Note that OpenGL specifies the <span
- style="font-style: italic;">half-open</span> convention for drawing
-lines: the last fragment in a line segment is omitted so that endpoint
-pixels shared by two line segments will only be drawn once instead of
-twice.<br>
-<br>
-<h3>4.2.1 Line Width</h3>
-The width of lines can be controlled by<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glLineWidth</span>(GLfloat<span
- style="font-style: italic;">width</span>)<br>
-</div>
-<br>
-where <span style="font-style: italic;">width</span> is the line width
-in pixels. &nbsp;The width defaults to 1.0. &nbsp;Attempting to set the
-width to a value less than or equal to zero will raise the error
-GL_INVALID_VALUE.<br>
-<br>
-<h3>4.2.2 Line Stipple<br>
-</h3>
-Lines may be stippled (i.e. dashed) with the command<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glLineStipple</span>(GLint<span
- style="font-style: italic;">factor</span>, GLushort <span
- style="font-style: italic;">pattern</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">pattern</span> describes an on/off
-pattern for the fragments produced by rasterization and <span
- style="font-style: italic;">factor</span> specifies how many subsequent
-fragments are kept or culled for each pattern bit. &nbsp;Line stippling
-can be enabled or disabled by the commands <span
- style="font-weight: bold;">glEnable</span>(GL_LINE_STIPPLE) and <span
- style="font-weight: bold;">glDisable</span>(GL_LINE_STIPPLE).<br>
-<br>
-<h3>4.2.3 Line Antialiasing</h3>
-Lines may be antialiased. &nbsp;For antialiased lines, each fragment
-produced by rasterization is assigned a <span
- style="font-style: italic;">coverage value</span> which describes how
-much of the fragment's area is considered to be <span
- style="font-style: italic;">inside</span> the line. &nbsp;Later, the
-alpha value of each fragment is multiplied by the coverage value.
-&nbsp;By blending the fragments into the frame buffer, the edges of
-lines appear smoothed.<br>
-<br>
-Line antialiasing can be enabled or disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_LINE_SMOOTH) and <span
- style="font-weight: bold;">glDisable</span>(GL_LINE_SMOOTH).<br>
-<br>
-<h2>4.3 Polygon Rasterization</h2>
-Polygons, quadrilaterals and triangles share the same polygon
-rasterization options. <br>
-<br>
-Triangles are rendered by the command sequence <span
- style="font-weight: bold;">glBegin</span><span
- style="font-style: italic;"><span style="font-style: italic;">(mode</span></span>),<span
- style="font-weight: bold;">glVertex</span>, <span
- style="font-weight: bold;">glVertex</span>, ... <span
- style="font-weight: bold;">glEnd</span> where <span
- style="font-style: italic;">mode</span> may be one of GL_TRIANGLES,
-GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN.<span style="font-weight: bold;"></span>
-&nbsp;For GL_TRIANGLES mode, the number of vertices should be a multiple
-of three - extra vertices will be ignored. &nbsp;For GL_TRIANGLE_STRIP
-and GL_TRIANGLE_FAN, at least three vertices should be specified.
-&nbsp;If less than three are specified, nothing is drawn. &nbsp;<br>
-<br>
-Quadrilaterals are <span style="font-weight: bold;"></span>rendered by
-the command sequence <span style="font-weight: bold;">glBegin</span>(<span
- style="font-style: italic;"><span style="font-style: italic;">mode</span></span>),<span
- style="font-weight: bold;">glVertex</span>, <span
- style="font-weight: bold;">glVertex</span>, ... <span
- style="font-weight: bold;">glEnd</span> where <span
- style="font-style: italic;">mode</span> may be one of GL_QUADS or
-GL_QUAD_STRIP.<span style="font-weight: bold;"></span> &nbsp; For
-GL_QUADS, the number of vertices should be a multiple of four - extra
-vertices will be ignored. &nbsp;For GL_QUAD_STRIP, the number of
-vertices should be even and at least four. &nbsp;Extra vertices (one)
-will be ignored.<br>
-<br>
-Convex polygons are <span style="font-weight: bold;"></span>rendered
-by the command sequence <span style="font-weight: bold;">glBegin</span><span
- style="font-style: italic;"><span style="font-style: italic;"></span></span>(GL_POLYGON),<span
- style="font-weight: bold;">glVertex</span>, <span
- style="font-weight: bold;">glVertex</span>, ... <span
- style="font-weight: bold;">glEnd</span>.<span
- style="font-style: italic;"></span><span style="font-weight: bold;"></span>
-&nbsp;If less than three vertices are specified, nothing is drawn.<br>
-<br>
-<h3>4.3.1 Polygon Orientation</h3>
-The <span style="font-style: italic;">winding order</span> of vertices
-(clockwise or counter-clockwise) is significant. &nbsp;It is used to
-determine the <span style="font-style: italic;">front-facing</span> or <span
- style="font-style: italic;">back-facing</span> orientation of polygons.
-&nbsp;By default, a front-facing polygon's vertices are in
-counter-clockwise order (in window coordinates). &nbsp;Figures 2.4 and
-2.5 of the OpenGL 1.2.1 specification illustrate the winding order for
-front-facing triangles and quadrilaterals, respectively.<br>
-<br>
-The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glFrontFace</span>(GLenum<span
- style="font-style: italic;"> mode</span>)<br>
-</div>
-<br>
-specifies whether clockwise or counter-clockwise winding indicates a
-front-facing polygon. &nbsp;If <span style="font-style: italic;">mode</span>
-is GL_CW then polygons with clockwise winding are front-facing. &nbsp;If <span
- style="font-style: italic;">mode</span> is GL_CCW then polygons with
-counter-clockwise winding are front-facing. &nbsp;The default value is
-GL_CCW. &nbsp;If <span style="font-style: italic;">mode</span> is not
-GL_CCW or GL_CW then the error GL_INVALID_ENUM will be raised.<span
- style="font-style: italic;"></span><span style="font-style: italic;"></span><br>
-<br>
-<h3>4.3.2 Polygon Culling</h3>
-Polygons may be culled (discarded) depending on whether they are
-front-facing or back-facing. &nbsp;The command<br>
-<br>
-<div style="margin-left: 40px;">void<span style="font-weight: bold;">
-glCullFace</span>(GLenum <span style="font-style: italic;">mode</span>)<br>
-</div>
-<br>
-specifies whether front-facing, back-facing or all polygons should be
-culled. &nbsp;If <span style="font-style: italic;">mode</span> is
-GL_FRONT then front-facing polygons will be culled. &nbsp;If <span
- style="font-style: italic;">mode</span> is GL_BACK then back-facing
-polygons will be culled. Otherwise, if <span style="font-style: italic;">mode</span>
-is GL_FRONT_AND_BACK then all polygons will be culled. &nbsp;Any other
-value for <span style="font-style: italic;">mode</span> will raise the
-error GL_INVALID_ENUM.<br>
-<br>
-Polygon culling is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_CULL_FACE) and <span
- style="font-weight: bold;">glDisable</span>(GL_CULL_FACE),
-respectively.<br>
-<br>
-<h3>4.3.3 Polygon Antialiasing</h3>
-Polygons may be antialiased in order to smooth their edges.
-&nbsp;Polygon antialiasing is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_POLYGON_SMOOTH) and <span
- style="font-weight: bold;">glDisable</span>(GL_POLYGON_SMOOTH).<br>
-<br>
-When polygon antialiasing is enabled each fragment produced by polygon,
-triangle and quadrilateral rasterization will be given a <span
- style="font-style: italic;">coverage</span> value which indicates how
-much of the fragment is covered by the polygon. &nbsp;Fragments
-completely inside the polygon have coverage 1.0. &nbsp;Fragments
-completely outside the polygon have zero coverage (in theory).
-&nbsp;Fragments which intersect the polygon's edge have a coverage value
-in the range (0, 1).<br>
-<br>
-The fragment's alpha value is multiplied by the coverage value.
-&nbsp;By enabling the appropriate blending mode, polygon edges will
-appear smoothed.<br>
-<br>
-<h2>4.4 Shading</h2>
-The command<br>
-<br>
-<div style="margin-left: 40px;"> void <span style="font-weight: bold;">glShadeModel</span>(GLenum<span
- style="font-style: italic;">mode</span>)<br>
-</div>
-<br>
-determines whether colors are interpolated between vertices during
-rasterization. &nbsp;If <span style="font-style: italic;">mode</span> is
-GL_FLAT then vertex colors are not interpolated. &nbsp;The color used
-for drawing lines, triangles and quadrilaterals is that of the last
-vertex used to specify each primitive. &nbsp;For polygons, the color of
-the first vertex specifies the color for the entire polygon. &nbsp;If <span
- style="font-style: italic;">mode</span> is GL_SMOOTH then vertex colors
-are linearly interpolated to produce the fragment colors.<br>
-<br>
-<h2>4.5 Bitmap Rasterization</h2>
-A bitmap is a monochromatic, binary image in which each image element
-(or pixel) is represented by one bit. &nbsp;Fragments are only generated
-for the bits (pixels) which are set. &nbsp;Bitmaps are commonly used to
-draw text (glyphs) and markers.<br>
-<br>
-A bitmap is drawn with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBitmap</span>(GLsizei<span
- style="font-style: italic;">width</span>, GLsizei <span
- style="font-style: italic;">height</span>, GLfloat <span
- style="font-style: italic;">xOrig</span>, GLfloat <span
- style="font-style: italic;">yOrig</span>, GLfloat <span
- style="font-style: italic;">xMove</span>, GLfloat <span
- style="font-style: italic;">yMove</span>, const &nbsp;GLubyte *<span
- style="font-style: italic;">image</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">width </span>and <span
- style="font-style: italic;">height</span> specify the image size in
-pixels. &nbsp;<span style="font-style: italic;">xOrig</span> and <span
- style="font-style: italic;">yOrig</span> specify the bitmap origin.
-&nbsp;<span style="font-style: italic;">xMove</span> and <span
- style="font-style: italic;">yMove</span> are added to the current
-raster position after the bitmap is rasterized. &nbsp;<span
- style="font-style: italic;">image</span> is a pointer to the bitmap
-data.<br>
-<br>
-If the current raster position is not valid, <span
- style="font-weight: bold;">glBitmap</span> has no effect.<br>
-<br>
-<h3>4.5.1 Bitmap Unpacking</h3>
-The first step in bitmap rendering is <span style="font-style: italic;">unpacking.
-&nbsp;</span>Unpacking is the process of extracting image data from
-client memory subject to byte swapping, non-default row strides, etc.
-&nbsp;The unpacking parameters are specified with the command<br>
-<br>
-<div style="margin-left: 40px;">void<span style="font-weight: bold;">
-glPixelStorei</span>(GLenum pname, GLint value)<br>
-</div>
-<span style="font-style: italic;"></span><br>
-The following unpacking parameters may be set:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 90%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">Parameter (<span
- style="font-style: italic;">pname</span>)<br>
- </td>
- <td style="vertical-align: top;">Value (<span
- style="font-style: italic;">value</span>)<br>
- </td>
- <td style="vertical-align: top;">Default<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_UNPACK_ROW_LENGTH<br>
- </td>
- <td style="vertical-align: top;">Width of the image in memory, in
-pixels.<br>
- </td>
- <td style="vertical-align: top;">0<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_UNPACK_LSB_FIRST<br>
- </td>
- <td style="vertical-align: top;">GL_FALSE indicates that the most
-significant bit is unpacked first from each byte. &nbsp;GL_TRUE
-indicates that the least significant bit is unpacked first from each
-byte. <br>
- </td>
- <td style="vertical-align: top;">GL_FALSE<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-<br>
-The GL_UNPACK_ROW_LENGTH specifies the stride (in pixels) for advancing
-from one row of the image to the next.&nbsp; If it's zero, the <span
- style="font-style: italic;">width</span> parameter to <span
- style="font-weight: bold;">glBitmap</span> specifies the width of the
-image in memory.<br>
-<br>
-GL_UNPACK_LSB_FIRST determines whether the least significant or most
-significant bit in each byte is unpacked first. &nbsp;Unpacking occurs
-in left to right order (in image space).<br>
-<br>
-The value of bit (i, j) of the image (where i is the image row and j is
-the image column) is found as follows:<br>
-<br>
-<div style="margin-left: 40px;">rowLength = (GL_UNPACK_ROW_LENGTH != 0)
-? GL_UNPACK_ROW_LENGTH : <span style="font-style: italic;">width</span>;<br>
-<br>
-byte = <span style="font-style: italic;">image</span>[((rowLength + 7)
-/ 8) * i + j / 8];<br>
-<br>
-if (GL_UNPACK_LSB_FIRST != 0)<br>
-&nbsp;&nbsp;&nbsp; bitMask = 1 &lt;&lt; (j % 8);<br>
-else<br>
-&nbsp;&nbsp;&nbsp; bitMask = 128 &gt;&gt; (j % 8);<br>
-<br>
-if (byte &amp; bitMask)<br>
-&nbsp;&nbsp;&nbsp; bit = 1;<br>
-else<br>
-&nbsp;&nbsp;&nbsp; bit = 0;<br>
-<br>
-</div>
-<span style="font-style: italic;"><span style="font-style: italic;"></span></span>
-<h3>4.5.2 Rasterization</h3>
-If the current raster position is (x<sub>rp</sub>, y<sub>rp</sub>, z<sub>rp</sub>,
-w<sub>rp</sub>), then the bitmap is rasterized according to the
-following algorithm:<br>
-<br>
-for (j = 0; j &lt; <span style="font-style: italic;">height</span>;
-j++) {<br>
-&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; <span style="font-style: italic;">width</span>;
-i++) {<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (bit(i,j)) {<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fragment.x =
-floor(x<sub>rp</sub> - <span style="font-style: italic;">xOrig</span>)
-+ i;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fragment.y =
-floor(y<sub>rp</sub> - <span style="font-style: italic;">yOrig</span>)
-+ j;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fragment.color
-= GL_CURRENT_RASTER_COLOR;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
-fragment.texture = GL_CURRENT_RASTER_TEXTURE_COORDS;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
-ProcessFragment(fragment)<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
-&nbsp;&nbsp;&nbsp; }<br>
-}<br>
-<br>
-After the bitmap has been rendered the current raster position is
-updated as follows:<br>
-<br>
-<div style="margin-left: 40px;">x<sub>rp</sub> = x<sub>rp</sub> + <span
- style="font-style: italic;">xMove</span><br>
-y<sub>rp</sub> = y<sub>rp</sub> + <span style="font-style: italic;">yMove</span><br>
-</div>
-<br>
-<h3>4.5.3 Per-fragment Operations</h3>
-XXX supported? &nbsp;See issue in appendix A.<br>
-<br>
-<h2>4.6 Unsupported Commands</h2>
-The following commands related to rasterization are not supported by
-the subset.<br>
-<br>
-<div style="margin-left: 40px;">Point commands:<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glPointSize</span><br>
-</div>
-<br>
-Polygon commands:<br>
-<div style="margin-left: 40px; font-weight: bold;">glPolygonStipple<br>
-glPolygonOffset<br>
-glPolygonMode<br>
-<br>
-</div>
-</div>
-<div style="margin-left: 40px;">Pixel storage commands:<br>
-</div>
-<div style="font-weight: bold; margin-left: 80px;">glPixelStoref<br>
-</div>
-<br>
-<br>
-<h1>5. Texture Mapping<br>
-</h1>
-There are four elements to texture mapping: texture coordinate
-specification, texture image specification, texture sampling and texture
-application.<br>
-<br>
-Texture mapping is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_TEXTURE_2D) and <span
- style="font-weight: bold;">glDisable</span>(GL_TEXTURE_2D).<br>
-<br>
-<h2>5.1 Texture Image Specification</h2>
-A texture image is specified with the command:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glTexImage2D</span>(GLenum<span
- style="font-style: italic;"> target</span>, GLint <span
- style="font-style: italic;">level</span>, GLint <span
- style="font-style: italic;">internalFormat,</span> GLsizei <span
- style="font-style: italic;">width,</span> GLsizei <span
- style="font-style: italic;">height,</span> GLint <span
- style="font-style: italic;">border,</span> GLenum <span
- style="font-style: italic;">format,</span> GLenum <span
- style="font-style: italic;">type,</span> const GLvoid *<span
- style="font-style: italic;">pixels</span> )<br>
-</div>
-<br>
-<span style="font-style: italic;">target</span> must be GL_TEXTURE_2D.
-&nbsp;<span style="font-style: italic;">level </span>indicates the
-mipmap level for mipmap textures. &nbsp;<span style="font-style: italic;">internalFormat</span>
-is a hint to indicate the preferred internal storage format for the
-texture. &nbsp;<span style="font-style: italic;">width</span> and <span
- style="font-style: italic;">height </span>indicate the image size in
-pixels (or texels). &nbsp;<span style="font-style: italic;">border </span>must
-be zero. &nbsp;<span style="font-style: italic;">format</span> and <span
- style="font-style: italic;">type</span> describe the pixel format and
-data type for the incoming image. &nbsp;<span style="font-style: italic;">pixels</span>
-points to the incoming texture image. &nbsp;These parameters are
-described in more detail below.<br>
-<br>
-<h3>5.1.1 Texture Image Size and Mipmaps</h3>
-<h3><span style="font-style: italic;"></span></h3>
-Texture images must have dimensions (width and height) that are powers
-of two. For example: 256 x 256, 32 x 1024, 1 x 8, etc. &nbsp;That is, it
-must be the case that <span style="font-style: italic;">width </span>=
-2<sup>n</sup> and <span style="font-style: italic;">height</span> = 2<sup>m</sup>
-for some positive integers n and m.<br>
-<br>
-Mipmapping is a method of antialiasing or filtering textures to improve
-their appearance. &nbsp;A mipmap is a set of images consisting of a base
-image and a set of filtered, reduced-resolution images. &nbsp;If the
-base image (<span style="font-style: italic;">level</span>=0) is of
-width 2<sup>n</sup> and height 2<sup>m</sup> then the level 1 image must
-be of width 2<sup>n-1</sup> and height 2<sup>m-1</sup>. &nbsp;Each mipmap
-level is half the width and height of the previous level, or at least
-one. &nbsp;The last mipmap level has a width and height of one.<br>
-<br>
-The following is an example of a mipmap's image levels:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 50%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">mipmap level<br>
- </td>
- <td style="vertical-align: top;">width<br>
- </td>
- <td style="vertical-align: top;">height<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">0<br>
- </td>
- <td style="vertical-align: top;">256<br>
- </td>
- <td style="vertical-align: top;">64<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">128<br>
- </td>
- <td style="vertical-align: top;">32<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">2<br>
- </td>
- <td style="vertical-align: top;">64<br>
- </td>
- <td style="vertical-align: top;">16<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">3<br>
- </td>
- <td style="vertical-align: top;">32<br>
- </td>
- <td style="vertical-align: top;">8<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">16<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">5<br>
- </td>
- <td style="vertical-align: top;">8<br>
- </td>
- <td style="vertical-align: top;">2<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">6<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">7<br>
- </td>
- <td style="vertical-align: top;">2<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">8<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-If the <span style="font-style: italic;">width</span> or <span
- style="font-style: italic;">height</span> parameters are not powers of
-two, the error GL_INVALID_VALUE is raised. &nbsp;If the image levels in
-a mipmap do not satisfy the restrictions listed above the texture is
-considered to be <span style="font-style: italic;">inconsistent</span>
-and the system will behave as if the texturing is disabled.<br>
-<br>
-<h3>5.1.2 Texture Image Formats and Unpacking</h3>
-The <span style="font-weight: bold;">glTexImage2D</span> command's <span
- style="font-style: italic;"><span style="font-weight: bold;"></span></span><span
- style="font-style: italic;">format</span> and <span
- style="font-style: italic;">type</span> parameters describe the format
-of the incoming texture image.&nbsp; Accepted values for <span
- style="font-style: italic;">format</span> are GL_INTENSITY, GL_RGB and
-GL_RGBA. &nbsp;The <span style="font-style: italic;">type</span>
-parameter must be GL_UNSIGNED_BYTE. &nbsp;Pixel component values are
-thus in the range 0 through 255.<br>
-<br>
-If <span style="font-style: italic;">format</span> is GL_INTENSITY then
-the image has one byte per pixel which specifies the pixel's red, green,
-blue and alpha values.<span style="font-style: italic;"></span><br>
-<br>
-If <span style="font-style: italic;">format</span> is GL_RGB then the
-image has three bytes per pixel which specify the pixel's red, green and
-blue values (in that order). &nbsp;The alpha value defaults to 255.<br>
-<br>
-If <span style="font-style: italic;">format</span> is GL_RGBA then the
-image has four bytes per pixel which specify the pixel's red, green,
-blue and alpha values (in that order).<br>
-<br>
-The command<br>
-<br>
-<div style="margin-left: 40px;">void<span style="font-weight: bold;">
-glPixelStorei</span>(GLenum <span style="font-style: italic;">pname</span>,
-GLint <span style="font-style: italic;">value</span>)<br>
-</div>
-<br>
-controls the unpacking of texture image data from client memory. &nbsp;<span
- style="font-style: italic;">pname</span> may be GL_UNPACK_ROW_LENGTH to
-indicate the stride, in pixels, between subsequent rows of the image in
-client memory. &nbsp;If GL_UNPACK_ROW_LENGTH is zero (the default) then
-the <span style="font-style: italic;">width</span> parameter to <span
- style="font-weight: bold;">glTexImage2D </span>determines the stride.<span
- style="font-style: italic;"></span><br>
-<br>
-<h3>5.1.3 Internal Texture Format</h3>
-<span style="font-weight: bold;">glTexImage2D<span
- style="font-style: italic;"> </span></span>converts the incoming
-texture image to one of the supported internal texture formats.<br>
-<br>
-The <span style="font-style: italic;">internalFormat</span> parameter
-indicates the desired internal format for the texture and may be either
-GL_INTENSITY8, GL_RGB5 or GL_RGBA8.<br>
-<br>
-If <span style="font-style: italic;">internalFormat</span> is
-GL_INTENSITY8 then the texture has one byte per texel (texture element)
-which indicates the texel's intensity (or brightness). &nbsp;The
-intensity is obtained from the incoming image's red channel.<br>
-<br>
-If <span style="font-style: italic;">internalFormat</span> is GL_RGB5
-then the texture is stored with two bytes per texel: &nbsp;5 bits per
-red value, 5 bits per green value and 5 bits per blue value.<br>
-<br>
-If <span style="font-style: italic;">internalFormat </span>is
-GL_RGBA8 then the texture is stored with four bytes per texel: &nbsp;8
-bits for each of the red, green, &nbsp;blue and alpha values.<br>
-<br>
-The internal format is also significant to texture application (see
-section 5.4).<br>
-<br>
-<h2>5.2 Texture Coordinates</h2>
-Texture coordinates control the mapping from local polygon space to
-texture image space. &nbsp;Texture coordinates are set for each vertex
-with the <span style="font-weight: bold;">glTexCoord</span> commands.
-&nbsp;During line and polygon rasterization the vertex's texture
-coordinates are interpolated across the primitive to produce a texture
-coordinate for each fragment. &nbsp;The fragment texture coordinates are
-used to sample the current texture image.<br>
-<br>
-Texture coordinates are normally in the range [0, 1]. &nbsp;Values
-outside that range are processed according to the <span
- style="font-style: italic;">texture wrap mode</span>. &nbsp;The
-texture wrap mode is set with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glTexParameteri</span>(GLenum<span
- style="font-style: italic;"> target</span>, GLenum <span
- style="font-style: italic;">pname</span>, GLint <span
- style="font-style: italic;">value</span>)<br>
-<br>
-</div>
-<span style="font-style: italic;">target</span> must be GL_TEXTURE_2D.
-&nbsp;If <span style="font-style: italic;">pname</span> is
-GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T then <span
- style="font-style: italic;">value</span> must be either
-GL_CLAMP_TO_EDGE or GL_REPEAT.<br>
-<br>
-For GL_CLAMP_TO_EDGE, texture coordinates are effectively clamped to
-the interval [0, 1].<br>
-<br>
-For GL_REPEAT, the integer part of texture coordinates is ignored; only
-the fractional part of the texture coordinates is used. &nbsp;This
-allows texture images to repeated or tiled across an object.<br>
-<br>
-<h2>5.3 Texture Sampling</h2>
-Texture sampling is the process of using texture coordinates to extract
-a color from the texture image. &nbsp;Multiple, weighted samples may be
-taken from the texture and combined during the filtering step.<br>
-<br>
-During texture coordinate interpolation a <span
- style="font-style: italic;">level of detail</span> value (lambda) is
-computed for each fragment. &nbsp;For a mipmapped texture, lambda
-determines which level (or levels) of the mipmap will be sampled to
-obtain the texture color.<br>
-<br>
-If lambda indicates that multiple texels map to a single screen pixel,
-then the texture <span style="font-style: italic;">minification</span>
-filter will be used. &nbsp;Otherwise, if lambda indicates that a single
-texel maps to multiple screen pixels, then the texture <span
- style="font-style: italic;">magnification</span> filter will be used.<br>
-<span style="font-weight: bold;"></span><span
- style="font-style: italic;"></span><br>
-<h3>5.3.1 Texture Minification</h3>
-The texture minification filter is set with the <span
- style="font-weight: bold;">glTexParameteri </span><span
- style="font-style: italic;"></span><span style="font-weight: bold;"></span><span
- style="font-style: italic;"></span> command by setting <span
- style="font-style: italic;">target</span> to GL_TEXTURE_2D, setting <span
- style="font-style: italic;">pname</span> to GL_TEXTURE_MIN_FILTER and
-setting <span style="font-style: italic;">value</span> to GL_NEAREST,
-GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST,&nbsp;
-GL_NEAREST_MIPMAP_LINEAR,&nbsp; &nbsp;GL_LINEAR_MIPMAP_NEAREST or
-GL_LINEAR_MIPMAP_LINEAR.<br>
-<br>
-GL_NEAREST samples the texel nearest the texture coordinate in the
-level 0 texture image.<br>
-<br>
-GL_LINEAR samples the four texels around the texture coordinate in the
-level 0 texture image. &nbsp;The four texels are linearly weighted to
-compute the final texel value.<br>
-<br>
-GL_NEAREST_MIPMAP_NEAREST samples the texel nearest the texture
-coordinate in the level N texture image. &nbsp;N is the level of detail
-and is computed by the partial derivatives of the texture coordinates
-with respect to the window coordinates.<br>
-<br>
-GL_NEAREST_MIPMAP_LINEAR samples two texels nearest the texture
-coordinates in the level N and N+1 texture images. &nbsp;The two texels
-are linearly weighted to compute the final texel value. &nbsp;N is the
-level of detail and is computed by the partial derivatives of the
-texture coordinates with respect to the window coordinates.<br>
-<br>
-GL_LINEAR_MIPMAP_NEAREST samples four texels around the texture
-coordinate in the level N texture image. &nbsp;The four texels are
-linearly weighted to compute the final texel value. &nbsp;N is the level
-of detail and is computed by the partial derivatives of the texture
-coordinates with respect to the window coordinates.<br>
-<br>
-GL_LINEAR_MIPMAP_LINEAR samples four texels around the texture
-coordinate in the level N texture image and four texels around the
-texture coordinate in the level N+1 texture image. &nbsp;The eight
-texels are linearly weighted to compute the final texel value. &nbsp;N
-is the level of detail and is computed by the partial derivatives of the
-texture coordinates with respect to the window coordinates.<br>
-<br>
-Filter modes other than GL_LINEAR and GL_NEAREST requires that the
-texture have a complete set of mipmaps. &nbsp;If the mipmap is
-incomplete, it is as if texturing is disabled.<br>
-&nbsp;<br>
-<h3>5.3.2 Texture Magnification</h3>
-The texture magnification filter is set with the <span
- style="font-weight: bold;">glTexParameteri </span><span
- style="font-style: italic;"></span><span style="font-weight: bold;"></span>command
-by setting <span style="font-style: italic;">target</span> to
-GL_TEXTURE_2D, setting <span style="font-style: italic;">pname</span> to
-GL_TEXTURE_MAG_FILTER and setting <span style="font-style: italic;">value</span>
-to GL_NEAREST or GL_LINEAR.<br>
-<br>
-GL_NEAREST samples the texel nearest the texture coordinate in the
-level 0 texture image.<br>
-<br>
-GL_LINEAR samples the four texels around the texture coordinate in the
-level 0 texture image. &nbsp;The four texels are linearly weighted to
-compute the final texel value.<br>
-<br>
-<h2>5.4 Texture Application</h2>
-The sampled texture value is combined with the incoming fragment color
-to produce a new fragment color. &nbsp;The fragment and texture colors
-are combined according to the texture environment mode and the current
-texture's base internal format. &nbsp;The texture environment mode is
-set with the command<br>
-<br>
-<div style="margin-left: 40px;">void<span style="font-weight: bold;">
-glTexEnvi</span>(GLenum <span style="font-style: italic;">target</span>,
-GLenum <span style="font-style: italic;">pname</span>, GLint <span
- style="font-style: italic;">value</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">target</span> must be GL_TEXTURE_ENV.
-&nbsp;If <span style="font-style: italic;">pname</span> is
-GL_TEXTURE_ENV_MODE then <span style="font-style: italic;">value</span>
-must be one of GL_REPLACE, GL_MODULATE, GL_DECAL, or GL_BLEND.<br>
-<br>
-There is also a <span style="font-style: italic;">texture environment
-color</span> that can factor into texture application. &nbsp;The texture
-environment color can be set with the command<br>
-<br>
-<div style="margin-left: 40px;">void<span style="font-weight: bold;">
-glTexEnvfv</span>(GLenum <span style="font-style: italic;">target</span>,
-GLenum <span style="font-style: italic;">pname</span>, const GLfloat *<span
- style="font-style: italic;">value</span>)<br>
-</div>
-<span style="font-style: italic;"></span><br>
-<span style="font-style: italic;">target</span> must be GL_TEXTURE_ENV.
-&nbsp;If <span style="font-style: italic;">pname</span> is
-GL_TEXTURE_ENV_COLOR then <span style="font-style: italic;">value </span>must
-point to an array of four values which specify the red, green, blue,
-and alpha values of the texture environment color. &nbsp;The values are
-clamped to the range [0, 1]. &nbsp;The default color is (0, 0, 0, 0).<br>
-<span style="font-style: italic;"></span><br>
-The following table describes the arithmetic used for each combination
-of environment mode and base internal format. &nbsp;(Rf, Gf, Bf, Af) is
-the incoming fragment color. &nbsp;(Rt, Gt, Bt, At) is the sampled
-texture color. &nbsp;Lt is the sampled texture luminance. &nbsp;<span
- style="font-style: italic;"></span>'It' is the sampled texture
-intensity. &nbsp;(Rc, Gc, Bc, Ac) is the texture environment color.
-&nbsp;(Rv, Gv, Bv, Av) is the resulting value.<br>
-<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 90%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">Base Internal Format<br>
- </td>
- <td style="vertical-align: top;">GL_REPLACE<br>
- </td>
- <td style="vertical-align: top;">GL_MODULATE<br>
- </td>
- <td style="vertical-align: top;">GL_DECAL<br>
- </td>
- <td style="vertical-align: top;">GL_BLEND<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INTENSITY<br>
- </td>
- <td style="vertical-align: top;">Rv = It<br>
-Gv = It<br>
-Bv = It<br>
-Bf = It<br>
- </td>
- <td style="vertical-align: top;">Rv = Rf * It<br>
-Gv = Gf * It<br>
-Bv = Bf * It<br>
-Av = Af * It</td>
- <td style="vertical-align: top;">undefined<br>
- </td>
- <td style="vertical-align: top;">Rv = Rf*(1-It) + Rc*It<br>
-Gv = Gf*(1-It) + Gc*It<br>
-Bv = Bf*(1-It) + Bc*It<br>
-Av = Af*(1-It) + Ac*It</td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_RGB<br>
- </td>
- <td style="vertical-align: top;">Rv = Rt<br>
-Gv = Gt<br>
-Bv = Bt<br>
-Av = Af<br>
- </td>
- <td style="vertical-align: top;">Rv = Rf * Rt<br>
-Gv = Gf * Gt<br>
-Bv = Bf * Bt<br>
-Av = Af<br>
- </td>
- <td style="vertical-align: top;">Rv = Rt<br>
-Gv = Gt<br>
-Bv = Bt<br>
-Av = Af</td>
- <td style="vertical-align: top;">Rv = Rf*(1-Rt) + Rc*Rt<br>
-Gv = Gf*(1-Gt) + Gc*Gt<br>
-Bv = Bf*(1-Bt) + Bc*Bt<br>
-Av = Af</td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_RGBA<br>
- </td>
- <td style="vertical-align: top;">Rv = Rt<br>
-Gv = Gt<br>
-Bv = Bt<br>
-Av = At<br>
- </td>
- <td style="vertical-align: top;">Rv = Rf * Rt<br>
-Gv = Gf * Gt<br>
-Bv = Bf * Bt<br>
-Av = Af * At</td>
- <td style="vertical-align: top;">Rv = Rf*(1-At) + Rt*At<br>
-Gv = Gf*(1-At) + Gt*At<br>
-Bv = Bf*(1-At) + Bt*At<br>
-Av = Af<br>
- </td>
- <td style="vertical-align: top;">Rv = Rf*(1-Rt) + Rc*Rt<br>
-Gv = Gf*(1-Gt) + Gc*Gt<br>
-Bv = Bf*(1-Bt) + Bc*Bt<br>
-Av = Af*At</td>
- </tr>
- </tbody>
-</table>
-<br>
-<br>
-<br>
-<h2>5.5 Texture Objects</h2>
-Texture objects encapsulate a set of texture images (mipmap) and
-related state into a named object. &nbsp;This facilitates use of
-multiple textures in an application. &nbsp;Texture objects are named
-with GLuints (unsigned integers). &nbsp;There is a default texture
-object with the name/identifier zero which can never be deleted.<br>
-<br>
-<h3>5.5.1 Creating Texture Objects</h3>
-A texture object is created by binding a new GLuint identifier to the
-GL_TEXTURE_2D target with the command:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBindTexture</span>(GLenum<span
- style="font-style: italic;"> target</span>, GLuint <span
- style="font-style: italic;">textureID</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">target</span> must be GL_TEXTURE_2D.
-&nbsp;<span style="font-style: italic;">textureID</span> may be any
-unsigned integer. &nbsp;If <span style="font-style: italic;">textureID</span>
-does not name an existing texture object, a new texture object with that
-ID will be created, initialized to the default state. &nbsp;Whether the
-ID is new or existed previously, that named texture object is bound as
-the <span style="font-style: italic;">current texture object</span>.
-&nbsp;Subsequent <span style="font-weight: bold;">glTexParameter </span>and<span
- style="font-weight: bold;">glTexImage2D<span
- style="font-style: italic;"> </span></span>calls will effect the
-current texture object.<br>
-<span style="font-style: italic;"></span><span
- style="font-weight: bold;"><span style="font-style: italic;"> </span></span><br>
-<h3>5.5.2 Deleting Texture Objects</h3>
-One or more texture objects may be deleted with the command:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glDeleteTextures</span>(GLsizei<span
- style="font-style: italic;">n</span>, const GLuint *<span
- style="font-style: italic;">textureIDs</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">textureIDs</span> is an array of <span
- style="font-style: italic;">n</span> texture IDs. &nbsp;The named
-texture objects will be deleted. &nbsp;If the current texture object is
-deleted the default texture object (number 0) will be bound as the
-current texture object.<br>
-<br>
-<h3>5.5.3 Allocating Texture Object Identifiers</h3>
-A list of new, unused texture IDs can be obtained by calling the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glGenTextures</span>(GLsizei<span
- style="font-style: italic;"> n</span>, GLuint *<span
- style="font-style: italic;">textureIDs</span>)<br>
-</div>
-<br>
-An array of <span style="font-style: italic;">n</span> unused texture
-IDs will be returned in the <span style="font-style: italic;">textureIDs</span>
-array.<br>
-<br>
-<br>
-<h1>6. Per-fragment Operations</h1>
-The fragments produced by rasterization are subjected to a number of
-operations which either modify the fragment or test the fragment
-(discarding the fragment if the test fails.) &nbsp;This chapter
-describes the per-fragment operations. &nbsp;They are presented in the
-order in which they're performed. &nbsp;If a fragment fails a test it is
-discarded and not subjected to subsequent tests or modifications.<br>
-<br>
-<h2>6.1 Scissor Test</h2>
-The scissor test limits rendering to a 2-D rectangular region of the
-framebuffer. &nbsp;The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glScissor</span>(GLint<span
- style="font-style: italic;">x</span>, GLint <span
- style="font-style: italic;">y</span>, GLsizei <span
- style="font-style: italic;">width</span>, GLsizei<span
- style="font-style: italic;"> height</span>)<br>
-</div>
-<br>
-defines a clipping region with the lower-left corner at (<span
- style="font-style: italic;">x, y</span>) and the given <span
- style="font-style: italic;">width</span> and <span
- style="font-style: italic;">height</span>. &nbsp;The scissor test is
-enabled and disabled with the command <span style="font-weight: bold;">glEnable</span>(GL_SCISSOR_TEST)
-and <span style="font-weight: bold;">glDisable</span>(GL_SCISSOR_TEST).<br>
-<br>
-If the incoming fragment's position is (x<sub>f</sub>, y<sub>f</sub>)
-then the fragment will pass the test if <span
- style="font-style: italic;">x</span> &lt;= x<sub>f</sub> &lt; <span
- style="font-style: italic;">x</span> + <span
- style="font-style: italic;">width</span> and <span
- style="font-style: italic;">y</span> &lt;= y<sub>f</sub> &lt; <span
- style="font-style: italic;">y</span> + <span
- style="font-style: italic;">height. &nbsp;</span>Otherwise, the
-fragment is discarded.<br>
-<br>
-If <span style="font-style: italic;">width</span> or <span
- style="font-style: italic;">height</span> is less than zero the error
-GL_INVALID_VALUE is raised. &nbsp;The default scissor rectangle bounds
-are (0, 0, w, h) where w is the initial window width and h is the
-initial window height. &nbsp;The scissor test is disabled by default.<br>
-<br>
-<h2>6.2 Alpha Test</h2>
-The alpha test compares the fragment's alpha value against a reference
-value and discards the fragment if the comparison fails. &nbsp;The test
-is specified by the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glAlphaFunc</span>(GLenum<span
- style="font-style: italic;">mode</span>, GLclampf <span
- style="font-style: italic;">reference</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">mode</span> specifies an inequality
-and <span style="font-style: italic;">reference</span> specifies a value
-to compare against. &nbsp;The following table lists all possible
-modes&nbsp;<span style="font-style: italic;"></span>and the
-corresponding test:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 50%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">Comparison mode<br>
- </td>
- <td style="vertical-align: top;">The test passes if<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LESS<br>
- </td>
- <td style="vertical-align: top;">alpha &lt; <span
- style="font-style: italic;">reference</span><br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LEQUAL<br>
- </td>
- <td style="vertical-align: top;">alpha &lt;= <span
- style="font-style: italic;">reference</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_GREATER<br>
- </td>
- <td style="vertical-align: top;">alpha &gt; <span
- style="font-style: italic;">reference</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_GEQUAL<br>
- </td>
- <td style="vertical-align: top;">alpha &gt;= <span
- style="font-style: italic;">reference</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_EQUAL<br>
- </td>
- <td style="vertical-align: top;">alpha == <span
- style="font-style: italic;">reference</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NOTEQUAL<br>
- </td>
- <td style="vertical-align: top;">alpha != <span
- style="font-style: italic;">reference</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NEVER<br>
- </td>
- <td style="vertical-align: top;">never pass<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ALWAYS<br>
- </td>
- <td style="vertical-align: top;">always passes<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-The <span style="font-style: italic;">reference</span> parameter is
-clamped to the range [0, 1].<br>
-<br>
-The alpha test is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_ALPHA_TEST) and <span
- style="font-weight: bold;">glDisable</span>(GL_ALPHA_TEST).<br>
-<br>
-The default mode is GL_ALWAYS and the default reference value is 0.<br>
-<br>
-<h2>6.3 Stencil Test</h2>
-The stencil buffer stores an N-bit integer value for each pixel in the
-frame buffer. &nbsp;The stencil test compares the stencil buffer value
-at the fragment's position to a reference value and possibly discards
-the fragment based on the outcome. &nbsp;Furthermore, the stencil buffer
-value may be updated or modified depending on the outcome. &nbsp;If
-there is no stencil buffer the stencil test is bypassed.<br>
-<br>
-Stenciling is controlled by the commands<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glStencilFunc</span>(GLenum<span
- style="font-style: italic;">func</span>, GLint <span
- style="font-style: italic;">ref</span>, GLuint <span
- style="font-style: italic;">mask</span>)<br>
-void <span style="font-weight: bold;">glStencilOp</span>(GLenum <span
- style="font-style: italic;">stencilFail</span>, GLenum <span
- style="font-style: italic;">depthTestFail</span>, GLenum <span
- style="font-style: italic;">depthTestPass</span>)<br>
-</div>
-<br>
-The <span style="font-weight: bold;">glStencilFunc<span
- style="font-style: italic;"> </span></span>command controls the
-stencil test while <span style="font-weight: bold;">glStencilOp</span>
-command controls the how the stencil buffer is updated/modified after
-the test.<br>
-<br>
-<span style="font-style: italic;">ref</span> is clamped to the range [0,
-2<sup>N</sup>-1] where N is the number of bits per stencil value in the
-stencil buffer.<span style="font-style: italic;"></span><br>
-<br>
-The following table lists all possible values for the <span
- style="font-style: italic;">func</span> parameter and when the stencil
-test will pass. &nbsp;Both the stencil buffer value and the stencil
-reference value are bit-wise ANDed with the <span
- style="font-style: italic;">mask</span> parameter before the test.<br>
-<br>
-<span style="font-style: italic;"></span><span
- style="font-style: italic;"></span><span style="font-style: italic;"></span>
-<table
- style="text-align: left; margin-left: auto; margin-right: auto; width: 70%;"
- border="1" cellspacing="2" cellpadding="2">
- <tbody>
- <tr>
- <td style="vertical-align: top;">Stencil <span
- style="font-style: italic;">func</span> value<br>
- </td>
- <td style="vertical-align: top;">Stencil test passes if<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LESS<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>&amp;<span
- style="font-style: italic;">mask)</span> &lt; (stencil buffer value
-&amp; <span style="font-style: italic;">mask)</span><br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LEQUAL<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
-&amp; <span style="font-style: italic;">mask) </span>&lt;= (stencil
-buffer value &amp; <span style="font-style: italic;">mask)</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_GREATER<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
-&amp; <span style="font-style: italic;">mask) </span>&gt; (stencil
-buffer value &amp; <span style="font-style: italic;">mask)</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_GEQUAL<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
-&amp; <span style="font-style: italic;">mask) </span>&gt;= (stencil
-buffer value &amp; <span style="font-style: italic;">mask)</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_EQUAL<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
-&amp; <span style="font-style: italic;">mask) </span>== (stencil
-buffer value &amp; <span style="font-style: italic;">mask)</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NOTEQUAL<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">(ref</span>
-&amp; <span style="font-style: italic;">mask) </span>!= (stencil
-buffer value &amp; <span style="font-style: italic;">mask)</span></td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NEVER<br>
- </td>
- <td style="vertical-align: top;">never passes<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ALWAYS<br>
- </td>
- <td style="vertical-align: top;">always passes<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-<span style="font-style: italic;"></span><br>
-If the stencil test passes, the fragment is passed to the next
-per-fragment operation. &nbsp;Otherwise, if the stencil test fails, the
-value in the stencil buffer is updated according to the value of the <span
- style="font-style: italic;">stencilFail</span> parameter to <span
- style="font-weight: bold;">glStencilOp</span>.<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 70%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;"><span style="font-style: italic;">stencilFail</span>
-value<br>
- </td>
- <td style="vertical-align: top;">New stencil buffer value<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_KEEP<br>
- </td>
- <td style="vertical-align: top;">originalValue<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ZERO<br>
- </td>
- <td style="vertical-align: top;">0<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INVERT<br>
- </td>
- <td style="vertical-align: top;">BitWiseInvert(originalValue)
-i.e. ~originalValue<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_REPLACE<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">ref</span><br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INCR<br>
- </td>
- <td style="vertical-align: top;">originalValue + 1, clamped to
-[0, 2<sup>N</sup>-1]</td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_DECR<br>
- </td>
- <td style="vertical-align: top;">originalValue - 1, clamped to
-[0, 2<sup>N</sup>-1]</td>
- </tr>
- </tbody>
-</table>
-<span style="font-style: italic;"></span><span
- style="font-style: italic;"></span><br>
-<br>
-The <span style="font-style: italic;">depthTestFail</span> and <span
- style="font-style: italic;">depthTestPass</span> parameters to <span
- style="font-weight: bold;">glStencilOp</span> are ignored. &nbsp;Values
-for <span style="font-style: italic;">func</span> and <span
- style="font-style: italic;">stencilFail</span> other than those listed
-in the table will cause the error GL_INVALID_ENUM to be raised.<br>
-<br>
-The stencil test is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_STENCIL_TEST) and <span
- style="font-weight: bold;">glDisable</span>(GL_STENCIL_TEST).<br>
-<br>
-The default stencil function is GL_ALWAYS. &nbsp;The default stencil
-reference value is 0. &nbsp;The default stencil mask is ~0. &nbsp;The
-default stencil fail operation is GL_KEEP.<br>
-<br>
-Values written into the stencil buffer are masked with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glStencilMask</span>(GLuint<span
- style="font-style: italic;">mask</span>)<br>
-</div>
-<br>
-Only the bits which are set in <span style="font-style: italic;">mask</span>
-will be modified in the stencil buffer when written to. &nbsp;If each
-stencil buffer value has N bits, only the least significant N bits of <span
- style="font-style: italic;">mask</span> are relevant. &nbsp;The default
-stencil mask is ~0.<br>
-<br>
-<h2>6.4 Blending and Logicop</h2>
-Blending or a logic operation combines the incoming fragment color with
-the destination frame buffer color according to a blending equation or
-bit-wise Boolean logical operation.<br>
-<br>
-Blending is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_BLEND) and <span
- style="font-weight: bold;">glDisable</span>(GL_BLEND).<br>
-<br>
-The logic operation is enabled and disabled with the commands <span
- style="font-weight: bold;">glEnable</span>(GL_LOGIC_OP) and <span
- style="font-weight: bold;">glDisable</span>(GL_LOGIC_OP).<br>
-<br>
-If both blending and the logic operation are enabled, the logic
-operation has higher priority; blending is bypassed.<br>
-<br>
-<h3>6.4.1 Logic Op</h3>
-The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glLogicop</span>(GLenum<span
- style="font-style: italic;">mode</span>)<br>
-<br>
-</div>
-Specifies the Boolean logic operation for combining the incoming
-fragment color with the destination frame buffer color. &nbsp;Both the
-incoming fragment color and destination frame buffer colors are
-interpreted as four-tuples of unsigned integer color components in the
-range [0, 2<sup>N</sup>-1] where N is the number of bits per color
-channel. &nbsp;N may not be the same for all color channels.<br>
-<br>
-The following table lists all values for <span
- style="font-style: italic;">mode</span> and the boolean arithmetic used
-to combine the incoming fragment color value (src)<span
- style="font-style: italic;"></span><span style="font-style: italic;"></span><span
- style="font-style: italic;"></span><span style="font-style: italic;"></span><span
- style="font-style: italic;"></span> with the destination framebuffer
-color value (dst). &nbsp;Standard ANSI C operators used.<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 50%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">LogicOp <span
- style="font-style: italic;">mode</span><br>
- </td>
- <td style="vertical-align: top;">Resulting channel value<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CLEAR<br>
- </td>
- <td style="vertical-align: top;">0<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SET<br>
- </td>
- <td style="vertical-align: top;">~0<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_COPY<br>
- </td>
- <td style="vertical-align: top;">src<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_COPY_INVERTED<br>
- </td>
- <td style="vertical-align: top;">~s<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NOOP<br>
- </td>
- <td style="vertical-align: top;">dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INVERT<br>
- </td>
- <td style="vertical-align: top;">~dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_AND<br>
- </td>
- <td style="vertical-align: top;">src &amp; dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NAND<br>
- </td>
- <td style="vertical-align: top;">~(src &amp; dst)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_AND_REVERSE<br>
- </td>
- <td style="vertical-align: top;">src &amp; ~dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_AND_INVERTED<br>
- </td>
- <td style="vertical-align: top;">~src &amp; dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_OR<br>
- </td>
- <td style="vertical-align: top;">src | dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NOR<br>
- </td>
- <td style="vertical-align: top;">~(src | dst)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_OR_REVERSE<br>
- </td>
- <td style="vertical-align: top;">src | ~dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_OR_INVERTED<br>
- </td>
- <td style="vertical-align: top;">~src | dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_XOR<br>
- </td>
- <td style="vertical-align: top;">src ^ dst<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_EQUIV<br>
- </td>
- <td style="vertical-align: top;">~(src ^ dst)<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-The fragment's color is replaced by the result of the logic operation.<br>
-<br>
-Specifying any value for <span style="font-style: italic;">mode</span>
-other than those listed in the above table will cause the error
-GL_INVALID_ENUM to be raised.<br>
-<br>
-The default value for <span style="font-style: italic;">mode</span> is
-GL_COPY. &nbsp;The logic operation is disabled by default.<br>
-<br>
-<h3>6.4.2 Blending</h3>
-The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glBlendFunc</span>(GLenum<span
- style="font-style: italic;">srcTerm</span>, GLenum <span
- style="font-style: italic;">dstTerm</span>)<br>
-</div>
-<br>
-specifies the terms of the blending equation. &nbsp;If Cf = (Rf, Gf,
-Bf, Af) is the incoming fragment color and Cb = (Rb, Gb, Bb, Ab) is the
-frame buffer color, then the resulting color Cv = (Rv, Gv, Bv, Av) is
-computed by:<br>
-<br>
-<div style="margin-left: 40px;">Cv = Cf * <span
- style="font-style: italic;">srcTerm</span> + Cb * <span
- style="font-style: italic;">dstTerm</span><br>
-<span style="font-style: italic;"></span></div>
-<span style="font-style: italic;"> </span><br>
-All possible values for <span style="font-style: italic;">srcTerm</span>
-and the corresponding arithmetic term are listed in the following table:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 70%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;"><span style="font-style: italic;">srcTerm</span><br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">srcTerm</span>Arithmetic<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ZERO<br>
- </td>
- <td style="vertical-align: top;">(0, 0, 0, 0)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE<br>
- </td>
- <td style="vertical-align: top;">(1, 1, 1, 1)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_DST_COLOR<br>
- </td>
- <td style="vertical-align: top;">(Rb, Gb, Bb, Ab)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE_MINUS_DST_COLOR<br>
- </td>
- <td style="vertical-align: top;">(1-Rb, 1-Gb, 1-Bb, 1-Ab)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SRC_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(Af, Af, Af, AF)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE_MINUS_SRC_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(1-Af, 1-Af, 1-Af, 1-Af)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_DST_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(Ab, Ab, Ab, Ab)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE_MINUS_DST_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(1-Ab, 1-Ab, 1-Ab, 1-Ab)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SRC_ALPHA_SATURATE<br>
- </td>
- <td style="vertical-align: top;">(m, m, m, 1) where m = MIN(Af,
-1-Ab)<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-All possible values for <span style="font-style: italic;">srcTerm</span>
-and the corresponding arithmetic term are listed in the following table:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 70%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;"><span style="font-style: italic;">dstTerm</span><br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">dstTerm</span>Arithmetic<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ZERO<br>
- </td>
- <td style="vertical-align: top;">(0, 0, 0, 0)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE<br>
- </td>
- <td style="vertical-align: top;">(1, 1, 1, 1)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SRC_COLOR<br>
- </td>
- <td style="vertical-align: top;">(Rf, Gf, Bf, Af)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE_MINUS_SRC_COLOR<br>
- </td>
- <td style="vertical-align: top;">(1-Rf, 1-Gf, 1-Bf, 1-Af)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SRC_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(Af, Af, Af, AF)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE_MINUS_SRC_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(1-Af, 1-Af, 1-Af, 1-Af)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_DST_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(Ab, Ab, Ab, Ab)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ONE_MINUS_DST_ALPHA<br>
- </td>
- <td style="vertical-align: top;">(1-Ab, 1-Ab, 1-Ab, 1-Ab)<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-The fragment's color is replaced by the result of the blending equation.<br>
-<br>
-Values for <span style="font-style: italic;">srcTerm</span> and <span
- style="font-style: italic;">dstTerm</span> other than those listed in
-the table will cause the error GL_INVALID_ENUM to be raised.<br>
-<br>
-The default value for <span style="font-style: italic;">srcTerm</span>
-is GL_ONE. &nbsp;The default value for <span style="font-style: italic;">dstTerm</span>
-is GL_ZERO. &nbsp;Blending is disabled by default.<br>
-<br>
-<h2>6.5 Color Mask</h2>
-The final fragment color is written into the current color buffer at
-the end of the per-fragment operations. &nbsp;Normally, all color
-channels in the frame buffer are replaced with the final fragment color.
-&nbsp;However, the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glColorMask</span>(GLboolean<span
- style="font-style: italic;">redMask</span>, GLboolean <span
- style="font-style: italic;">greenMask</span>, GLboolean <span
- style="font-style: italic;">blueMask</span>, GLboolean <span
- style="font-style: italic;">alphaMask</span>)<br>
-</div>
-<br>
-allows selective writing to individual color channels. &nbsp;If <span
- style="font-style: italic;">redMask</span> is GL_TRUE then writing to
-the red color channel is enabled, otherwise it's disabled.
-&nbsp;Similarly, the green, blue and alpha channels can also be masked.<br>
-<br>
-Initially all four mask values are GL_TRUE.<br>
-<br>
-Color masking is not enabled/disabled with the <span
- style="font-weight: bold;">glEnable</span>/<span
- style="font-weight: bold;">glDisable</span> commands.<br>
-<br>
-<h1>7. Frame Buffer Operations</h1>
-The frame buffer is considered to be a two-dimensional array of pixels.
-&nbsp;The frame buffer is also organized into layers or logical buffers.
-&nbsp;There may be a front color buffer, back color buffer and stencil
-buffer. &nbsp;A double-buffered frame buffer has both a front color
-buffer and back color buffer. &nbsp;A single-buffered framebuffer only
-has a front color buffer. &nbsp;Each pixel in a color buffer has a red,
-green and blue value and an optional alpha value.<br>
-<br>
-<h2>7.1 Clearing Buffers</h2>
-Buffers are cleared (set to uniform values) with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glClear</span>(GLbitfield<span
- style="font-style: italic;">buffers</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">buffers</span> is a bitmask for which
-the value may be the bitwise-OR of the values GL_COLOR_BUFFER_BIT and
-GL_STENCIL_BUFFER_BIT. &nbsp;If the GL_COLOR_BUFFER_BIT bit is
-specified, the current color buffer will be cleared. &nbsp;If the
-GL_STENCIL_BUFFER_BIT bit is specified, the stencil buffer will be
-cleared.<br>
-<br>
-The current color buffer is specified with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glDrawBuffer</span>(GLenum<span
- style="font-style: italic;"> buffer</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">buffer</span> may be either GL_FRONT,
-GL_BACK or GL_NONE. &nbsp;GL_FRONT indicates that the front color buffer
-will be modified by <span style="font-weight: bold;">glClear</span> and
-any drawing command. &nbsp;GL_BACK indicates that the back color buffer
-will be modified by <span style="font-weight: bold;">glClear</span> and
-any drawing command. &nbsp;GL_NONE indicates that neither color buffer
-will be modified by <span style="font-weight: bold;">glClear</span> or
-any drawing command. &nbsp;GL_BACK is only valid for double-buffered
-frame buffers.<br>
-<br>
-The current scissor rectangle, set by the <span
- style="font-weight: bold;">glScissor</span> command, effects <span
- style="font-weight: bold;">glClear</span><span
- style="font-style: italic;">,</span><span style="font-style: italic;"> </span>limiting
-the clear to the scissor rectangle, if it's enabled. &nbsp;Furthermore, <span
- style="font-weight: bold;"></span>only the color channels enabled by <span
- style="font-weight: bold;">glColorMask</span> will be effected by <span
- style="font-weight: bold;">glClear</span>(GL_COLOR_BUFFER_BIT).
-&nbsp;Likewise, only the stencil bits enabled by <span
- style="font-weight: bold;">glStencilMask</span> will be effected by <span
- style="font-weight: bold;">glClear</span>(GL_STENCIL_BUFFER_BIT).<br>
-<br>
-The current clear color is set with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glClearColor</span>(GLclampf<span
- style="font-style: italic;">red</span>, GLclampf <span
- style="font-style: italic;">green</span>, GLclampf <span
- style="font-style: italic;">blue</span>, GLclampf <span
- style="font-style: italic;">alpha</span>)<br>
-</div>
-<br>
-Subsequent calls to <span style="font-weight: bold;">glClear</span>
-will use the color (<span style="font-style: italic;">red, green, blue,
-alpha</span>) to clear the front or back color buffers.<br>
-<span style="font-style: italic;"></span><br>
-The current stencil clear value is set with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glClearStencil</span>(GLint<span
- style="font-style: italic;">clearValue</span>)<br>
-</div>
-<br>
-If the stencil buffer is N bits deep, the least significant N bits of <span
- style="font-style: italic;">clearValue</span> will be used to clear the
-stencil buffer.<br>
-<br>
-<br>
-<h1>8. Other Features</h1>
-<h2>8.1 Frame Buffer Readback</h2>
-A rectangular region of pixels can be read from the frame buffer and
-placed in client memory with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glReadPixels</span>(GLint<span
- style="font-style: italic;">x</span>, GLint <span
- style="font-style: italic;">y</span>, GLsizei <span
- style="font-style: italic;">width</span>, GLsizei <span
- style="font-style: italic;">height</span>, GLenum <span
- style="font-style: italic;">format</span>, GLenum <span
- style="font-style: italic;">type</span>, GLvoid *<span
- style="font-style: italic;">data</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">x</span> and <span
- style="font-style: italic;">y</span> specify the coordinate of the
-lower-left corner of the region to read and <span
- style="font-style: italic;">width</span> and <span
- style="font-style: italic;">height</span> specify the size of the
-rectangular region to read. &nbsp;<span style="font-style: italic;">format</span>
-specifies the format of image data and must be either GL_RGB or
-GL_RGBA.&nbsp; <span style="font-style: italic;">type</span> specify the
-data type of the image data and must be either GL_UNSIGNED_BYTE or
-GL_FLOAT. &nbsp;Other values for <span style="font-style: italic;">format</span>
-or <span style="font-style: italic;">type</span> will cause the error
-GL_INVALID_ENUM to be raised.<br>
-<br>
-The framebuffer may contain 3-component colors (red, green, blue) or
-4-component colors (red, green, blue, alpha). &nbsp;If an alpha channel
-is not present, alpha values default to 1.0.<br>
-<br>
-The frame buffer color components (red, green, blue, alpha) are either
-converted to 8-bit unsigned integers in the range[0, 255] if <span
- style="font-style: italic;">type </span>is GL_UNSIGNED_BYTE or
-converted to floating point values in the range [0, 1] if <span
- style="font-style: italic;">type</span> is GL_FLOAT. &nbsp;The (red,
-green, blue, alpha) tuples are then stored as GL_RGB triplets (by
-dropping the alpha component) or GL_RGBA quadruples in client memory.<br>
-<br>
-Image data is <span style="font-style: italic;">packed</span> into
-client memory according to the pixel packing parameters which are set by
-the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glPixelStorei</span>(GLenum<span
- style="font-style: italic;"> pname</span>, GLint <span
- style="font-style: italic;">value</span>)<br>
-</div>
-<br>
-<span style="font-style: italic;">pname</span> must be
-GL_PACK_ROW_LENGTH. &nbsp;<span style="font-style: italic;">value</span>
-indicates the stride (in pixels) between subsequent rows in the
-destination image. &nbsp;If GL_PACK_ROW_LENGTH is zero (the default)
-then the <span style="font-style: italic;">width</span> parameter to <span
- style="font-weight: bold;">glReadPixels</span> indicates the row stride.<br>
-<br>
-Pixel readback takes place as follows:<br>
-<br>
-<div style="margin-left: 40px;">if (GL_PACK_ROW_LENGTH == 0)<br>
-&nbsp;&nbsp;&nbsp; rowLength = <span style="font-style: italic;">width</span>;<br>
-else<br>
-&nbsp;&nbsp;&nbsp; rowLength = GL_PACK_ROW_LENGTH<br>
-<br>
-if (<span style="font-style: italic;">format</span> == GL_RGB) {<br>
-&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; <span style="font-style: italic;">height</span>;
-i++) {<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (j = 0; j &lt; <span
- style="font-style: italic;">width</span>; j++) {<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; k = (i *
-rowLength + j) * 3;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+0] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).red;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+1] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).green;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+2] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).blue;<span
- style="font-style: italic;"></span><br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
-&nbsp;&nbsp;&nbsp; }<br>
-}<br>
-else {<br>
-&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; <span style="font-style: italic;">height</span>;
-i++) {<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (j = 0; j &lt; <span
- style="font-style: italic;">width</span>; j++) {<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; k = (i *
-rowLength + j) * 4;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+0] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).red;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+1] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).green;<br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+2] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).blue;<span
- style="font-style: italic;"></span><br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
- style="font-style: italic;">data</span>[k+3] = FrameBuffer(<span
- style="font-style: italic;">x</span> + j, <span
- style="font-style: italic;">y</span> + i).alpha;<span
- style="font-style: italic;"></span><br>
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
-&nbsp;&nbsp;&nbsp; }<br>
-}<br>
-</div>
-<br>
-The function FrameBuffer(<span style="font-style: italic;">c, r</span>)
-returns the pixel in the frame buffer at column <span
- style="font-style: italic;">c</span> of row <span
- style="font-style: italic;">r. &nbsp;</span><span
- style="font-style: italic;">data</span> is considered to be either a
-GLubyte pointer or a GLfloat pointer, depending on the <span
- style="font-style: italic;">type</span> parameter. &nbsp;Similarly, the
-FrameBuffer function returns either GLubyte values in the range [0, 255]
-or GLfloat values in the range [0,1], depending on the <span
- style="font-style: italic;">type</span> parameter.<br>
-<br>
-Pixels may be read from either the front or back color buffer.
-&nbsp;The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glReadBuffer</span>(GLenum<span
- style="font-style: italic;">buffer</span>)<br>
-</div>
-<br>
-specifies the source for reading images with <span
- style="font-weight: bold;">glReadPixels</span>. &nbsp;If <span
- style="font-style: italic;">buffer</span> is GL_FRONT then front color
-buffer is the source. &nbsp;If <span style="font-style: italic;">buffer</span>
-is GL_BACK then the back color buffer is the source. &nbsp;It is illegal
-to specify GL_BACK when the color buffer is not double buffered.
-&nbsp;Any invalid value for <span style="font-style: italic;">buffer</span>
-will raise the error GL_INVALID_ENUM.<br>
-<br>
-The default read source is GL_BACK if the frame buffer is double
-buffered. &nbsp;Otherwise, the default read source is GL_FRONT.<br>
-<br>
-<h2>8.2 Selection Mode</h2>
-Selection mode is typically used to implement <span
- style="font-style: italic;">picking</span>: determining which
-primitive(s) are present at particular window positions. &nbsp;The
-command<br>
-<br>
-<div style="margin-left: 40px;">GLint <span style="font-weight: bold;">glRenderMode</span>(GLenum<span
- style="font-style: italic;">mode</span>)<br>
-</div>
-<br>
-is used to enable selection mode. &nbsp;If <span
- style="font-style: italic;">mode</span> is GL_SELECTION the graphics
-library is put into selection mode. &nbsp;If <span
- style="font-style: italic;">mode</span> is GL_RENDER the graphic
-library is put into normal rendering mode. &nbsp;Any other value for <span
- style="font-style: italic;">mode</span> will raise the error
-GL_INVALID_ENUM.<br>
-<br>
-When in selection mode rendering commands will not effect the
-framebuffer. &nbsp;Instead, a record of the primitives that would have
-been drawn is placed in the <span style="font-style: italic;">selection</span> <span
- style="font-style: italic;">buffer</span>. &nbsp;The selection buffer
-is specified with the command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glSelectionBuffer</span>(GLsizei<span
- style="font-style: italic;">n</span>, GLuint *<span
- style="font-style: italic;">buffer</span>)<br>
-</div>
-<span style="font-style: italic;"></span><span
- style="font-style: italic;"><br>
-buffer</span> is an array of <span style="font-style: italic;">n</span>
-unsigned integers. &nbsp;No more than <span style="font-style: italic;">n</span>
-values will be placed in the buffer.<br>
-<br>
-The <span style="font-style: italic;">name stack</span> is a stack
-(LIFO) of unsigned integer names. &nbsp;The following commands
-manipulate the name stack:<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glInitNames</span>(void)<br>
-void <span style="font-weight: bold;">glPushName</span>(GLuint <span
- style="font-style: italic;">name</span>)<br>
-void <span style="font-weight: bold;">glPopName</span>(void)<br>
-void <span style="font-weight: bold;">glLoadName</span>(GLuint <span
- style="font-style: italic;">name</span>)<br>
-</div>
-<br>
-<span style="font-weight: bold;">glInitNames</span> resets the name
-stack to an empty state. &nbsp;<span style="font-weight: bold;">glPushName<span
- style="font-style: italic;"> </span></span>pushes the given <span
- style="font-style: italic;">name</span> value onto the stack. &nbsp;<span
- style="font-weight: bold;">glPopName</span> pops the top name from the
-stack. &nbsp;<span style="font-weight: bold;">glLoadName<span
- style="font-style: italic;"> </span></span>replaces the top value on
-the stack with the specified <span style="font-style: italic;">name</span>.
-&nbsp;Stack underflow and overflow conditions cause the errors
-GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW to be raised.<br>
-<br>
-While in selection mode, primitives (points, lines, polygons) are
-transformed and clip-tested normally. &nbsp;Primitives which aren't
-discarded by clipping cause the <span style="font-style: italic;">hit</span> <span
- style="font-style: italic;">data</span> to be updated. &nbsp;The hit
-data consists of three pieces of information: a hit flag, a minimum Z
-value and a maximum Z value. &nbsp;First, the hit flag is set.
-&nbsp;Then, for each of the primitive's vertices, the vertex Z value is
-compared to the minimum and maximum Z values. &nbsp;The minimum Z value
-is updated if the vertex's Z value is less than the minimum Z value.
-&nbsp;The maximum Z value is updated if the vertex's Z value is greater
-than the maximum Z value.<br>
-<br>
-When any of <span style="font-weight: bold;">glInitNames</span><span
- style="font-style: italic;"><span style="font-style: italic;">, </span></span><span
- style="font-weight: bold;">glPushName</span>, <span
- style="font-weight: bold;">glPopName</span>, <span
- style="font-weight: bold;">glLoadName</span> or <span
- style="font-weight: bold;">glRenderMode</span> are called and the hit
-flag is set, a <span style="font-style: italic;">hit record</span> is
-written to the selection buffer.<br>
-<br>
-A hit record consists of a sequence of unsigned integers. &nbsp;The
-first value is the size of the name stack. &nbsp;The second value is the
-minimum Z value multiplied by 2<sup>32</sup>-1. &nbsp;The third value is
-the maximum Z value multiplied by 2<sup>32</sup>-1. &nbsp;The remaining
-values are the values in the name stack, in bottom to top order.
-&nbsp;The hit flag is cleared after a hit record is written to the
-selection buffer. &nbsp;Hit records are places sequentially into the
-selection buffer until it is full or selection mode is terminated.<br>
-<br>
-Selection mode is terminated by calling <span
- style="font-weight: bold;">glRenderMode</span>(GL_RENDER). &nbsp; The
-return value of <span style="font-weight: bold;">glRenderMode</span>
-will be -1 if the selection buffer overflowed. &nbsp;Otherwise, the
-return value will indicate the number of values written into the
-selection buffer.<br>
-<br>
-<h2>8.3 Synchronization</h2>
-The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glFlush</span>(void)<br>
-</div>
-<br>
-makes the graphics library to flush all pending graphics commands.
-&nbsp;The command<br>
-<div style="margin-left: 40px;"><br>
-void <span style="font-weight: bold;">glFinish</span>(void)<br>
-</div>
-<br>
-makes the graphics library flush the command queue and wait until those
-commands are completed. &nbsp;<span style="font-weight: bold;">glFlush</span>
-will not return until all previous graphics commands have been fully
-completed.<br>
-<br>
-These commands are typically used to force completion of rendering to
-the front color buffer. &nbsp;Otherwise, rendering to the front color
-buffer may not appear. &nbsp;The <span style="font-style: italic;">swapbuffers</span>
-command (part of the window system binding library) does an implicit
-flush before swapping the front and back color buffers. &nbsp;The <span
- style="font-weight: bold;">glReadPixels</span> command also does an
-implicit flush before reading pixel data from the frame buffer.<br>
-<br>
-<h1>9. State Queries</h1>
-The current value of nearly all library state variables can be queried.
-&nbsp;This chapter describes the commands used for querying the value of
-state variables.<br>
-<br>
-<h2>9.1 General State Queries</h2>
-The command<br>
-<br>
-<div style="margin-left: 40px;">void <span style="font-weight: bold;">glGetFloatv</span>(GLenum<span
- style="font-style: italic;">pname</span>, GLfloat *<span
- style="font-style: italic;">values</span>)<br>
-</div>
-<br>
-returns the value(s) of the state variable specified by <span
- style="font-style: italic;">pname</span>. &nbsp;The following table
-lists all accepted values for <span style="font-style: italic;">pname</span>
-and a description of the value(s). &nbsp;Specifying any other value for <span
- style="font-style: italic;">pname</span> causes the error
-GL_INVALID_ENUM to be raised.<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 90%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">Variable (<span
- style="font-style: italic;">pname)</span><br>
- </td>
- <td style="vertical-align: top;">Number of values<br>
- </td>
- <td style="vertical-align: top;">Value(s) Description<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ALPHA_BITS<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Number of bits per alpha value
-in the frame buffer.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ALPHA_TEST<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if the alpha test is
-disabled.<br>
-One if the alpha test is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ALPHA_TEST_FUNC<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">The alpha test function.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_BLEND<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if blending is disabled.<br>
-One if blending is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_BLEND_DST<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Blend destination function/term.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_BLEND_SRC<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Blend source function/term.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_BLUE_BITS<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Number of bits per blue value in
-the frame buffer.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_COLOR_CLEAR_VALUE<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Clear color (red, green, blue,
-alpha).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_COLOR_WRITE_MASK<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Color buffer writemask (red,
-green, blue, alpha).<br>
-Zero if writing is disabled.<br>
-One if writing is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CULL_FACE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if polygon culling is
-disabled.<br>
-One if polygon culling is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CULL_FACE_MODE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Polygon cull mode: GL_FRONT,
-GL_BACK or GL_FRONT_AND_BACK.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CURRENT_COLOR<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Current color (red, green, blue,
-alpha).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CURRENT_RASTER_COLOR<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Current raster position color
-(red, green, blue, alpha).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CURRENT_RASTER_TEXTURE_COORDS<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Current raster position texture
-coordinates (s, t, r, q).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CURRENT_RASTER_POSITION<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Current raster position (x, y,
-z, w).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CURRENT_POSITION_VALID<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if current raster position
-is invalid.<br>
-One if current raster position is valid.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_CURRENT_TEXTURE_COORDS<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Current texture coordinates (s,
-t, r, q)<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_DOUBLEBUFFER<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if color buffer is
-single-buffered.<br>
-One if color buffer is double-buffered.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_DRAW_BUFFER<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Current color draw buffer:
-GL_FRONT or GL_BACK.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_FRONT_FACE</td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Polygon front-face winding:
-GL_CW or GL_CCW.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_GREEN_BITS<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Number of bits per green value
-in the frame buffer.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_SMOOTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if line smoothing is
-disabled.<br>
-One if line smoothing is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_STIPPLE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if line stippling is
-disabled.<br>
-One if line stippling is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_STIPPLE_PATTERN<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Line stipple pattern.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_STIPPLE_REPEAT<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Line stipple repeat factor.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_WIDTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Line width in pixels.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_WIDTH_GRANULARITY<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Aliased line width granularity.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LINE_WIDTH_RANGE<br>
- </td>
- <td style="vertical-align: top;">2<br>
- </td>
- <td style="vertical-align: top;">Minimum and maximum aliased line
-widths.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_ALIASED_LINE_WIDTH_RANGE<br>
- </td>
- <td style="vertical-align: top;">2<br>
- </td>
- <td style="vertical-align: top;">Minimum and maximum antialiased
-line widths.</td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_COLOR_LOGIC_OP<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if logicop is disabled.<br>
-One if logicop is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_LOGIC_OP_MODE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Logicop function.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MATRIX_MODE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Matrix mode: GL_MODELVIEW or
-GL_PROJECTION.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MAX_MODELVIEW_STACK_DEPTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Maximum size of the modelview
-matrix stack.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MAX_NAME_STACK_DEPTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Maximum size of the selection
-name stack.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MAX_PROJECTION_STACK_DEPTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Maximum size of the projection
-matrix stack.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MAX_TEXTURE_SIZE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Maximum 2D texture image width
-and height.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MAX_VIEWPORT_DIMS<br>
- </td>
- <td style="vertical-align: top;">2</td>
- <td style="vertical-align: top;">Maximum viewport width and
-height in pixels.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MODELVIEW_MATRIX<br>
- </td>
- <td style="vertical-align: top;">16<br>
- </td>
- <td style="vertical-align: top;">Current/top modelview matrix
-values.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_MODELVIEW_MATRIX_STACK_DEPTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Current size of the modelview
-matrix stack.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NAME_STACK_DEPTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Current size of the selection
-name stack.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_PACK_ROW_LENGTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Pixel packing row length.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_POLYGON_SMOOTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if polygon smoothing is
-disabled.<br>
-One if polygon smoothing is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_PROJECTION_MATRIX<br>
- </td>
- <td style="vertical-align: top;">16<br>
- </td>
- <td style="vertical-align: top;">Current/top projection matrix
-values.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_PROJECTION_STACK_DEPTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Current size of projection
-matrix stack.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_READ_BUFFER<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Current read buffer: GL_FRONT or
-GL_BACK.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_RED_BITS<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Number of bits per red value in
-the frame buffer.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_RENDER_MODE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Current rendering mode:
-GL_RENDER or GL_SELECTION.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_RGBA_MODE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Always one.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SCISSOR_BOX<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Scissor box (x, y, width,
-height).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SCISSOR_TEST<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if scissor test is disabled.<br>
-One if scissor test is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SELECTION_BUFFER_SIZE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Size of selection buffer.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_SHADE_MODEL<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Shade model: GL_FLAT or
-GL_SMOOTH.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_BITS<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Number of bits per stencil value
-in the frame buffer.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_CLEAR_VALUE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Stencil buffer clear value.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_FAIL<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Stencil fail operation.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_FUNC<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Stencil function.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_REF<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Stencil reference value.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_TEST<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if stencil test is disabled.<br>
-One if stencil test is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_VALUE_MASK<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Stencil mask value.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STENCIL_WRITE_MASK<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Stencil buffer write mask.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_TEXTURE_2D<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if 2D texture mapping is
-disabled.<br>
-One if 2D texture mapping is enabled.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_TEXTURE_BINDING_2D</td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Name of currently bound 2D
-texture object.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_TEXTURE_ENV_COLOR<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Texture environment color (red,
-green, blue, alpha).<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_TEXTURE_ENV_MODE<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Texture environment mode.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_UNPACK_ROW_LENGTH<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Pixel unpacking row length.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_UNPACK_LSB_FIRST<br>
- </td>
- <td style="vertical-align: top;">1<br>
- </td>
- <td style="vertical-align: top;">Zero if most significant bit is
-unpacked first for bitmaps.<br>
-One if least significant bit is unpacked first for bitmaps.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_VIEWPORT<br>
- </td>
- <td style="vertical-align: top;">4<br>
- </td>
- <td style="vertical-align: top;">Current viewport (x, y, width,
-height).<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-<br>
-<h2>9.2 String Queries</h2>
-The command<br>
-<br>
-<div style="margin-left: 40px;">const GLubyte *<span
- style="font-weight: bold;">glGetString</span>(GLenum <span
- style="font-style: italic;">name</span>)<br>
-</div>
-<br>
-is used to query string-valued values. &nbsp;The legal values for <span
- style="font-style: italic;">name</span> are described in the following
-table:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 80%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;"><span style="font-style: italic;">name</span><br>
- </td>
- <td style="vertical-align: top;">Return value<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_VERSION<br>
- </td>
- <td style="vertical-align: top;">The library version, such as
-"1.2".<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_RENDERER<br>
- </td>
- <td style="vertical-align: top;">The renderer, such as "Mesa DRI
-Radeon".<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_VENDOR<br>
- </td>
- <td style="vertical-align: top;">The vendor of this
-implementation, such as "Tungsten Graphics, Inc."<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_EXTENSIONS<br>
- </td>
- <td style="vertical-align: top;">A white-space separated list of
-the supported extensions. </td>
- </tr>
- </tbody>
-</table>
-<br>
-<h2>9.3 Error Queries</h2>
-The command<br>
-<br>
-<div style="margin-left: 40px;">GLenum <span style="font-weight: bold;">glGetError</span>(void)<br>
-</div>
-<br>
-returns the current error code. &nbsp;The current error code will be
-set by a GL command when an error condition has been detected. &nbsp;If
-the current error code is already set, subsequent errors will not be
-recorded. &nbsp;The error code is reset/cleared to GL_NO_ERROR when <span
- style="font-weight: bold;">glGetError</span> returns. &nbsp;The
-following error codes are possible:<br>
-<br>
-<table cellpadding="2" cellspacing="2" border="1"
- style="text-align: left; width: 80%; margin-left: auto; margin-right: auto;">
- <tbody>
- <tr>
- <td style="vertical-align: top;">Error code<br>
- </td>
- <td style="vertical-align: top;">Meaning<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_NO_ERROR<br>
- </td>
- <td style="vertical-align: top;">No error has been recorded.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INVALID_ENUM<br>
- </td>
- <td style="vertical-align: top;">An enum parameter had an invalid
-value.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INVALID_VALUE<br>
- </td>
- <td style="vertical-align: top;">A numeric parameter had an
-invalid value.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_INVALID_OPERATION<br>
- </td>
- <td style="vertical-align: top;">A function was called when not
-legal to do so.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STACK_OVERFLOW<br>
- </td>
- <td style="vertical-align: top;">The current transformation
-matrix stack is full.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_STACK_UNDERFLOW<br>
- </td>
- <td style="vertical-align: top;">The current transformation
-matrix stack is empty.<br>
- </td>
- </tr>
- <tr>
- <td style="vertical-align: top;">GL_OUT_OF_MEMORY<br>
- </td>
- <td style="vertical-align: top;">The system ran out of dynamic
-memory.<br>
- </td>
- </tr>
- </tbody>
-</table>
-<br>
-<br>
-<h1>10. Unsupported Features</h1>
-This section lists other features and functions which are not supported
-and not previously discussed.<br>
-<br>
-<h2>10.1 Feedback Mode</h2>
-Feedback mode and the following related functions are not supported.<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glFeedbackBuffer</span><br>
-<span style="font-weight: bold;">glPassThrough</span><br>
-</div>
-<br>
-<h2>10.2 1D and 3D Textures<br>
-</h2>
-Only 2D texture images are supported. &nbsp;The following functions
-used to specify 1D and 3D texture images are not supported:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glTexImage1D</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTexImage3D</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTexSubImage1D</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glTexSubImage3D</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glCopyTexImage1D</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glCopyTexSubImage1D</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glCopyTexSubImage3D</span><br>
-</div>
-<br>
-<h2>10.3 Alternate Texture Image Commands<br>
-</h2>
-Texture images may only be specified with <span
- style="font-weight: bold;">glTexImage2D</span>. &nbsp;The following
-alternate texture image commands are not supported:<br>
-<br>
-<div style="margin-left: 40px; font-weight: bold;">glTexSubImage2D<br>
-glCopyTexImage2D<br>
-glCopyTexSubImage2D<br>
-</div>
-<br>
-<h2>10.4 Proxy Textures</h2>
-Proxy textures are not supported and the GL_PROXY_TEXTURE_2D token is
-not supported by any function.<br>
-<br>
-<br>
-<h2>10.5 Other Texture Commands</h2>
-The following commands related to texture mapping are not supported by
-the subset:<br>
-<br>
-<div style="margin-left: 40px; font-weight: bold;"> glPrioritizeTextures<br>
-glAreTexturesResident<br>
-glIsTexture<br>
-glTexEnviv<br>
-glTexEnvf<br>
-glTexParameterf<br>
-glTexParameteriv<br>
-glTexParameterfv<br>
-</div>
-<br>
-<br>
-<h2>10.6 Copy and Draw Pixels<br>
-</h2>
-The following commands are not supported:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glDrawPixels<br>
-glCopyPixels<br>
-glPixelZoom<br>
-<br>
-</span></div>
-<h2>10.7 Color Index Mode<br>
-</h2>
-Color index mode and the following related commands are not supported:<br>
-<br>
-<span style="font-weight: bold;"></span>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glIndexub<br>
-</span><span style="font-weight: bold;">glIndexi</span><br>
-<span style="font-weight: bold;">glIndexs<br>
-glIndexf<br>
-glIndexd<br>
-</span><span style="font-weight: bold;">glIndexubv<br>
-</span><span style="font-weight: bold;">glIndexiv</span><br>
-<span style="font-weight: bold;">glIndexsv<br>
-glIndexfv<br>
-glIndexdv</span><span style="font-weight: bold;"><br>
-glIndexMask<br>
-</span><span style="font-weight: bold;">glClearIndex<br>
-glIndexPointer</span><br style="font-weight: bold;">
-<br>
-</div>
-<h2>10.8 Pixel Transfer Operations</h2>
-The pixel transfer operations (scale, bias, look-up table, etc) are not
-supported and the following commands are omitted:<br>
-<br style="font-weight: bold;">
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glPixelTransferf</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glPixelTransferi</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glPixelMapfv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glPixelMapuiv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glPixelMapusv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glGetPixelMapfv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glGetPixelMapuiv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glGetPixelMapusv</span><br>
-</div>
-<br>
-<h2>10.9 Hints</h2>
-Hints and the following related command is not supported:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glHint<br>
-</span><br>
-</div>
-<h2>10.10 State Query Commands<br>
-</h2>
-The following state query commands are not supported:<br>
-<br>
-<div style="margin-left: 40px; font-weight: bold;">glGetBooleanv<br>
-glGetIntegerv<br>
-glGetDoublev<br>
-glGetPointerv<br>
-glGetTexEnvi<br>
-glGetTexEnvf<br>
-glGetTexParameteriv<br>
-glGetTexParameterfv<br>
-glGetTexLevelParameteriv<br>
-glGetTexLevelParameterfv<br>
-glGetTexImage<br>
-glGetClipPlane<br>
-</div>
-<br>
-<h2>10.11 Attribute Stacks</h2>
-State attribute stacks and the following related commands are not
-supported:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glPushAttrib</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glPopAtttrib</span><br>
-<br style="font-weight: bold;">
-</div>
-<h2>10.12 Double-Valued Functions</h2>
-All functions which take double-precision floating point values, but
-for which there is an equivalent single-precision valued function, are
-omitted. &nbsp;This includes, but is not limited to:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glVertex2d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glVertex2dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glVertex3d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glVertex3dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glVertex4d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glVertex4dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glColor3d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glColor3d</span><span
- style="font-weight: bold;">v</span><br style="font-weight: bold;">
-<span style="font-weight: bold;">glColor4d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glColor4dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTexCoord1d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTexCoord1d</span><span
- style="font-weight: bold;">v</span><br style="font-weight: bold;">
-<span style="font-weight: bold;">glTexCoord2d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glTexCoord2dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTexCoord3d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glTexCoord3dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTexCoord4d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glTexCoord4dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glRasterPos2d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glRasterPos2dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glRasterPos3d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glRasterPos3dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glRasterPos4d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;"> glRasterPos4dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glLoadMatrixd</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMultMatrixd</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glScaled</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glRotated</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glTranslated<br>
-glRectd<br>
-glRectdv<br>
-</span> <span style="font-weight: bold;"><br>
-</span> </div>
-<h2>10.13 Evaluators</h2>
-Evaluators and the following related commands are not supported:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glMap1f</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMap2d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMap2f</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glGetMapdv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glGetMapfv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glGetMapiv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord1d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord1f</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord1dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord1fv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord2d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord2f</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord2dv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalCoord2fv</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMapGrid1d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMapGrid1f</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMapGrid2d</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glMapGrid2f</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalPoint1</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalPoint2</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalMesh1</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glEvalMesh2</span><br
- style="font-weight: bold;">
-</div>
-<br>
-<h2>10.14 Display Lists</h2>
-Display lists and the following related commands are not supported:<br>
-<br>
-<div style="margin-left: 40px; font-weight: bold;">glIsList<br>
-glDeleteLists<br>
-glGenLists<br>
-glNewList<br>
-glEndList<br>
-glCallList<br>
-glCallLists<br>
-glListBase<br>
-</div>
-<br>
-<h2>10.15 Accumulation Buffer</h2>
-The accumulation buffer and the following related commands are not
-supported:<br>
-<br style="font-weight: bold;">
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glAccum</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glClearAccum</span><br>
-</div>
-<br>
-<h2>10.16 Fog</h2>
-Fog and the following related commands are not supported:<br>
-<br>
-<div style="margin-left: 40px; font-weight: bold;"> glFogi<br>
-glFogf<br>
-glFogiv<br>
-glFogfv<br>
-</div>
-<br>
-<h2>10.17 Depth Test</h2>
-Depth testing and the following related commands are not supported:<br>
-<br>
-<div style="margin-left: 40px;"><span style="font-weight: bold;">glDepthFunc</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glDepthMask</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glDepthRange</span><br
- style="font-weight: bold;">
-<span style="font-weight: bold;">glClearDepth</span><br>
-</div>
-<br>
-<h2>10.18 Imaging Subset</h2>
-The OpenGL imaging subset (which implements features such as
-convolution, histogram, min/max recording, color matrix and color
-tables) is not supported.<br>
-<br>
-<br>
-<h1>Appendix A: Issues</h1>
-This appendix lists documentation and subset issues with their current
-status. &nbsp;For items which are still open, the documentation (above)
-follows the recommended solution.<br>
-<br>
-<h2>A.1 Vertex Arrays</h2>
-Should vertex arrays be supported? &nbsp;Is there a performance
-advantage?<br>
-<br>
-RESOLUTION: No, there isn't enough of a performance advantage to
-justify them.<br>
-<br>
-<h2>A.2 Polygon Antialiasing and Edge Flags</h2>
-Should edge flags be supported for antialiasing?<br>
-<br>
-Edge flags don't effect antialiasing, at least not normally. &nbsp;A
-number of approaches to antialiasing have been summarized in email.<br>
-<br>
-RECOMMENDATION: don't support edge flags. &nbsp;They don't effect
-polygon antialiasing.<br>
-<br>
-RESOLUTION: closed, as of 26 Feb 2003.<br>
-<br>
-<h2>A.3 glRasterPos vs. glWindowPos</h2>
-Should glRasterPos and/or glWindowPos commands be supported?<br>
-<br>
-RESOLUTION: Closed: implement glRasterPos commands, but not glWindowPos
-commands.<br>
-<br>
-<h2>A.4 GL_IBM_rasterpos_clip extension</h2>
-Should the GL_IBM_rasterpos_clip extension be implemented?<br>
-<br>
-RESOLUTION: &nbsp;No. &nbsp;It's not required.<br>
-<br>
-<h2>A.5 Image Formats and Types</h2>
-Which image formats and types should be supported for <span
- style="font-weight: bold;">glTexImage2D</span> and <span
- style="font-weight: bold;">glReadPixels</span>?<br>
-<br>
-OpenGL specifies a <span style="font-weight: bold;">large</span>
-variety of image formats and data types. &nbsp;Only a few are commonly
-used.<br>
-<br>
-RECOMMENDATION: &nbsp;we propose a subset:<br>
-<br>
-For <span style="font-weight: bold;">glTexImage2D</span> only allow <span
- style="font-style: italic;">type</span>=GL_UNSIGNED_BYTE and <span
- style="font-style: italic;">format</span>=GL_RGBA, GL_RGB,
-GL_INTENSITY. &nbsp; Only allow <span style="font-style: italic;">internalFormat</span>
-to be GL_RGBA, GL_RGB or GL_INTENSITY as well.&nbsp; Basically, only
-support image formats/types that are directly supported by the Radeon
-hardware. &nbsp;This will allow <span style="font-weight: bold;">glTexImage2D</span>
-to basically just use <span style="font-weight: bold;">memcpy</span> to
-copy texture images.<br>
-<br>
-For <span style="font-weight: bold;">glReadPixels</span>, only allow <span
- style="font-style: italic;">type</span> = GL_UNSIGNED_BYTE or GL_FLOAT.
-&nbsp;Only allow <span style="font-style: italic;">format</span> =
-GL_RGB or GL_RGBA. &nbsp;This is just enough to support the OpenGL
-conformance tests.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.6 Texture Environment Modes</h2>
-Which texture environment modes should be supported? &nbsp;OpenGL 1.2
-has GL_REPLACE, GL_MODULATE, GL_DECAL and GL_BLEND. &nbsp;GL_DECAL isn't
-defined for all base internal texture formats. &nbsp;GL_ADD is another
-useful mode. &nbsp;Perhaps drop GL_DECAL mode and add GL_ADD mode.<br>
-<br>
-RECOMMENDATION: implement the standard modes GL_REPLACE, GL_MODULATE,
-GL_DECAL and GL_BLEND.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.7 Truncated Mipmaps and LOD Control</h2>
-Should we support the GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL,
-GL_TEXTURE_MIN_LOD and GL_TEXTURE_MAX_LOD texture parameters?<br>
-<br>
-RECOMMENDATION: &nbsp;We propose omitting these features at this time,
-in the interest of simplifying the driver.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.8 Texture Priorities and Residency</h2>
-Should the subset support texture priorities via <span
- style="font-weight: bold;">glPrioritizeTextures</span> and the <span
- style="font-weight: bold;">glAreTexturesResident</span> command?<br>
-<br>
-RECOMMENDATION: &nbsp;Few applications use these features and
-functions. &nbsp;We propose omitting them to simplify the driver.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.9 Pixel Pack/Unpack Alignment Control</h2>
-Should we support the GL_PACK_ALIGNMENT and GL_UNPACK_ALIGNMENT options?<br>
-<br>
-These are used to align pixel data addresses to 1, 2 and 4-byte
-multiples for <span style="font-weight: bold;">glBitmap, glTexImage2D</span>
-and <span style="font-weight: bold;">glReadPixels</span>. &nbsp;These
-aren't strictly needed since the user can provide a 1, 2 or 4-byte
-aligned address and appropriate GL_PACK_ROW_LENGTH or
-GL_UNPACK_ROW_LENGTH values instead.<br>
-<br>
-RECOMMENDATION: &nbsp;We recommend omitting them to simplify the driver.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.10 Pixel Pack/Unpack Skip Rows/Pixels Control</h2>
-Should we support the GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS,
-GL_PACK_SKIP_PIXELS and GL_PACK_SKIP_ROWS options for pixel
-unpacking/packing?<br>
-<br>
-These options aren't really needed since the user can adjust the start
-address and GL_PACK/UNPACK_ROW_LENGTH parameters to achieve the same
-effect.<br>
-<br>
-RECOMMENDATION: &nbsp;omit these parameters.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.11 Texture State Queries</h2>
-Should we support the command <span style="font-weight: bold;">glGetTexEnvi/fv,
-glGetTexParameteri/fv</span> and <span style="font-weight: bold;">glGetTexLevelParameteri/fv</span>?<br>
-<br>
-RECOMMENDATION: &nbsp;No.&nbsp;They're seldom needed and their
-implementation is several hundred lines of code in length.<br>
-<br>
-RESOLUTION: &nbsp;open<br>
-<br>
-<h2>A.12 glGetIntegerv, glGetBooleanv and glGetDoublev</h2>
-Should we support the commands <span style="font-weight: bold;">glGetIntegerv,
-glGetBooleanv </span>and <span style="font-weight: bold;">glGetDoublev</span>
-in addition to <span style="font-weight: bold;">glGetFloatv</span>?<br>
-<br>
-RECOMMENDATION: &nbsp;Omit the boolean, integer and double-valued
-functions. All state values which can be queried by these commands can
-be expressed as floating point values and queried with <span
- style="font-weight: bold;">glGetFloatv</span>. &nbsp;The
-implementation of the other three commands involves many lines of code.<br>
-<br>
-RESOLUTION: &nbsp;open<br>
-<br>
-<h2>A.13 glBitmap and Per-Fragment Operations</h2>
-Should bitmaps rendered with <span style="font-weight: bold;">glBitmap</span>
-be subjected to the per-fragment operations?<br>
-<br>
-If bitmaps are implemented with points it will be easy to implement the
-per-fragment operations. &nbsp;Otherwise, it could be difficult.<br>
-<br>
-RECOMMENDATION: &nbsp;Implement glBitmap by drawing points/pixels with
-the hardware. &nbsp;This will make supporting the per-fragments
-trivially easy. &nbsp;Also, it makes portrait-mode display relatively
-easy.<br>
-<br>
-RESOLUTION: &nbsp;open<br>
-<br>
-<h2>A.14 Reduced gl.h Header File</h2>
-Should we produce a reduced gl.h header file which only defines the
-tokens and functions which are implemented by the subset?<br>
-<br>
-RECOMMENDATION: yes. &nbsp;It would be a useful reference to
-programmers to quickly determine which functions and tokens are
-supported.<br>
-<br>
-RESOLUTION: open<br>
-<br>
-<h2>A.15 glPolygonMode</h2>
-Is <span style="font-weight: bold;">glPolygonMode</span> needed?<br>
-<br>
-RECOMMENDATION: No. &nbsp;Omit it.<br>
-<br>
-RESOLUTION: closed, as of 26 Feb 2003<br>
-<br>
-<br>
-<p> </p>
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/subset.html b/nx-X11/extras/Mesa/docs/subset.html
deleted file mode 100644
index dd1d742a8..000000000
--- a/nx-X11/extras/Mesa/docs/subset.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Subset</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Mesa Subset</H1>
-
-<p>
-In 2002/2003 Tungsten Graphics was contracted to develop a subset Mesa/Radeon
-driver for an embedded environment. The result is a reduced-size DRI driver
-for the ATI R200 chip, for use with Linux fbdev rather than XFree86.
-</p>
-
-<p>
-The specification for this subset can be found
-<a href="subset-A.html">here</a>.
-</p>
-
-<p>
-The <a href="MiniGLX.html">MiniGLX specification</a> describes the
-interface between fbdev and Mesa.
-</p>
-
-<p>
-More info to come...
-</p>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/systems.html b/nx-X11/extras/Mesa/docs/systems.html
deleted file mode 100644
index 3a6594f5f..000000000
--- a/nx-X11/extras/Mesa/docs/systems.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<HTML>
-
-<TITLE>Supported Systems and Drivers</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Supported Systems and Drivers</H1>
-
-<p>
-Mesa was originally designed for Unix/X11 systems and is still best
-supported on those systems. All you need is an ANSI C compiler and the
-X development environment to use Mesa.
-</p>
-
-<p>
-The DRI hardware drivers for the X.org server and XFree86 provide
-hardware accelerated rendering for chips from ATI, Intel, Matrox, 3dfx
-and others on Linux and FreeBSD.
-</p>
-
-<p>
-Drivers for other assorted platforms include:
-the Amiga, Apple Macintosh, BeOS, NeXT, OS/2, MS-DOS, VMS, Windows
-9x/NT, and Direct3D.
-</p>
-
-<p>
-Details about particular drivers follows.
-Be warned that some drivers may be out of date and no longer function.
-</p>
-
-<UL>
-<LI>Xlib driver for the X Window System <A HREF="README.X11">(README.X11)</A>
-<li><a href="http://dri.sourceforge.net/" target="_parent">
-DRI hardware drivers</a> for the X window system
-<LI>Microsoft Windows <A HREF="README.WIN32">(README.WIN32)</A>
-<LI>DEC VMS <A HREF="README.VMS">(README.VMS)</A>
-<LI>3dfx/Glide <A HREF="README.3DFX">(README.3DFX)</A>
-<LI>GGI <A HREF="README.GGI">(README.GGI)</A>
-<LI>Amiga Amiwin <A HREF="README.AMIWIN">(README.AMIWIN)</A>
-<LI>BeOS <A HREF="README.BEOS">(README.BEOS)</A>
-<LI>Direct3D driver <A HREF="README.D3D">(README.D3D)</A>
-<LI>DJGPP <A HREF="README.DJ">(README.DJ)</A>
-<LI>LynxOS <A HREF="README.LYNXOS">(README.LYNXOS)</A>
-<LI>Mingw32 <A HREF="README.MINGW32">(README.MINGW32)</A>
-<LI>NeXT <A HREF="README.NeXT">(README.NeXT)</A>
-<LI>OpenStep <A HREF="README.OpenStep">(README.OpenStep)</A>
-<LI>OS/2 <A HREF="README.OS2">(README.OS2)</A>
-<LI>WindML <A HREF="README.WINDML">(README.WINDML)</A>
-<LI><a href="http://utah-glx.sourceforge.net/" target="_parent">Utah GLX drivers</a>
-</UL>
-
-</body>
-</html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/thanks.html b/nx-X11/extras/Mesa/docs/thanks.html
deleted file mode 100644
index 78b9e3e5e..000000000
--- a/nx-X11/extras/Mesa/docs/thanks.html
+++ /dev/null
@@ -1,134 +0,0 @@
-<HTML>
-
-<HEAD>
-<TITLE>Acknowledgements</TITLE>
-</HEAD>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Acknowledgments</H1>
-
-
-The following individuals and groups are to be acknowledged for their
-contributions to Mesa over the years.
-This list is far from complete and somewhat dated, unfortunately.
-
-
-<ul>
-<li>Early Mesa development was done while Brian was part of the
-<A HREF="http://www.ssec.wisc.edu/~billh/vis.html"
-target="_parent">SSEC Visualization Project</A> at the University of
-Wisconsin. He'd like to thank Bill Hibbard for letting him work on
-Mesa as part of that project.
-<br>
-<br>
-<li>John Carmack of id Software, Inc. funded Keith Whitwell in 1999 in
-order to optimize Mesa's vertex transformation module. This is a very
-substantial piece of work.
-<br>
-<br>
-<li>Precision Insight, Inc., VA Linux Systems, Inc., and most recently,
-Tungsten Graphics, Inc. have supported the ongoing development of Mesa.
-<br>
-<br>
-<li>The
-<A HREF="http://sourceforge.net/projects/mesa3d" target="_parent">Mesa</A>
-website is hosted by
-<A HREF="http://sourceforge.net" target="_parent">
-<IMG SRC="http://sourceforge.net/sflogo.php?group_id=3&type=1"
-WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A>
-<br>
-<br>
-
-<li>The Mesa CVS repository is hosted by
-<a href="http://freedesktop.org/" target="_parent">freedesktop.org</a>.
-<br>
-<br>
-
-
-<li><a href="http://www.altsoftware.com/"
-target="_parent">alt.software</a> contributed the Direct3D driver.
-
-<li><b>Bernd Barsuhn</b> wrote the evaluator code for (splines,
-patches) in Mesa.
-
-<li><b>Bernhard Tschirren</b> wrote the Allegro DJGPP driver.
-
-<li><b>Bogdan Sikorski</b> wrote the GLU NURBS and polygon tessellator
-in Mesa.
-
-<li><b>Charlie Wallace</b> wrote the MS-DOS driver.
-
-<li><b>CJ Beyer</b> was the www.mesa3d.org webmaster.
-
-<li><b>Darren Abbott</b> provided the OS/2 driver.
-
-<li><b>David Bucciarelli</b> wrote and maintained the 3Dfx Glide
-driver. Thousands of Linux/Quake players thank David!
-
-<li><b>Gareth Hughes</b> wrote new GLU 1.2 Polygon Tessellation code
-(now superceded by SGI SI GLU).
-
-<li><b>Holger Waechtler</b> contributed AMD 3DNow! assembly code which
-accelerates vertex transformation in Mesa 3.1. Holger also implemented
-the GL_EXT_texture_env_combine extension.
-
-<li><b>Jeroen van der Zijp</b> and <b>Thorsten Ohl</b> contributed the
-Xt/Motif widget code.
-
-<li><b>John Stone</b> provided the multi-threading support in Mesa 3.0.
-
-<li><b>John Watson</b> assisted with web page design.
-
-<li><b>Josh Vanderhoof</b> contributed Intel x86 assembly code which
-accelerates vertex transformation in Mesa 3.x.
-
-<li><b>Jouk Jansen</b> contributed and continues to maintain the VMS
-support.
-
-<li><b>Karl Schultz</b> has been maintaining the Windows driver.
-
-<li><b>Keith Whitwell</b> has made extension contributions to Mesa
-since 1999.
-
-<li><b>Kendall Bennett</b> wrote the SciTech MGL driver.
-
-<li><b>Klaus Niederkrueger</b> contributed many improvements to Mesa's
-software rasterizer.
-
-<li><b>Mark Kilgard</b> contributed antialiased line improvements and
-several extensions.
-
-<li><b>Michael Pichler</b> contributed <em>many</em> bug fixes
-
-<li><b>Miklos Fazekas</b> wrote and maintains the Macintosh driver.
-
-<li><b>Pascal Thibaudeau</b> wrote the NeXT driver.
-
-<li><b>Pedro Vazquez</b> setup and maintains the Mesa Mailing list.
-
-<li><b>Randy Frank</b> contributed <em>many</em> bug fixes.
-
-<li><b>Stefan Zivkovic</b> wrote the Amiga driver.
-
-<li><b>Stephane Rehel</b> provided the Cygnus Win32 support
-
-<li><b>Ted Jump</b> maintained the
-makefiles and project files for Windows 95/98/NT compilation for some time.
-
-<li><b>Uwe Maurer</b> wrote the LibGGI driver for Mesa-3.0.
-
-<li><b>Victor Ng-Thow-Hing</b> wrote the Amiwin driver for the Amiga.
-
-</ul>
-
-<p>
-Apologies to anyone who's been omitted.
-Please send corrections and additions to Brian.
-</p>
-
-
-</BODY>
-</HTML>
diff --git a/nx-X11/extras/Mesa/docs/utilities.html b/nx-X11/extras/Mesa/docs/utilities.html
deleted file mode 100644
index 4693639b8..000000000
--- a/nx-X11/extras/Mesa/docs/utilities.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<HTML>
-
-<TITLE>Development Utilities</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Development Utilities</H1>
-
-<ul>
-
-<li>The Mesa distribution includes several utility routines in the
-progs/util/ directory
-
-<li>Allen Akin's <a href="http://glean.sourceforge.net/"
-target="_parent">glean</a> is a framework for OpenGL testing.
-
-<li><a href="http://developer.kde.org/~sewardj/"
-target="_parent">Valgrind</a> is a very useful tool for tracking down
-memory-related problems in your code.
-
-</ul>
-
-</body>
-</html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/docs/utility.html b/nx-X11/extras/Mesa/docs/utility.html
deleted file mode 100644
index c7cad0114..000000000
--- a/nx-X11/extras/Mesa/docs/utility.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<HTML>
-
-<TITLE>Utilities</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Utilities</H1>
-
-<ul>
-<li><a href="http://fsv.sourceforge.net/"
- target="_parent">fsv</a> - 3D file system visualizer
-
-<li><a href="http://www.dgp.utoronto.ca/%7Emac/projects/glbiff.html"
- target="_parent">glbiff</a> - GL version of xbiff
-
-<li><a href="http://glload.netpedia.net/" target="_parent">glload</a>
- - CPU load meter
-
-<li><a href="http://www.scitechsoft.com/gldirect.html"
- target="_parent">SciTech GLDirect</a> - Driver to run OpenGL
- apps using Direct3D under Windows
-
-<li><a href="http://threedsia.sourceforge.net/"
- target="_parent">3Dsia</a> - 3D user interface
-
-<li><a href="http://mesa3d.sourceforge.net/notfound.html">VRML Site
-Map</a> - 3D GUI
-
-<li><a href="http://www.vros.com/" target="_parent">VR/OS</a> - VR
-user interface
-
-<li><a href="http://wauug.erols.com/%7Ebagleyd/"
-target="_parent">xlockmore</a> - an X screen saver
-
-<li><a href="http://www.jwz.org/xscreensaver"
-target="_parent">xscreensaver</a> - X screen saver
-
-</ul>
-
-
-</body>
-</html>
diff --git a/nx-X11/extras/Mesa/docs/webmaster.html b/nx-X11/extras/Mesa/docs/webmaster.html
deleted file mode 100644
index e645b90ba..000000000
--- a/nx-X11/extras/Mesa/docs/webmaster.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<HTML>
-
-<TITLE>Mesa Introduction</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Webmaster</font></H1>
-
-<p>
-If you have problems, edits or additions for this website send them
-to Brian
-(<em>b</em><em>r</em><em>i</em><em>a</em><em>n</em><em>_</em><em>e</em><em>_</em><em>p</em><em>a</em><em>u</em><em>l</em><em>@</em><em>y</em><em>a</em><em>h</em><em>o</em><em>o</em><em>.</em><em>c</em><em>o</em><em>m</em>)</a>.
-</p>
-
-<p>
-Mark Manning made the frame-based layout for the website.
-Brian's modified it a lot since then.
-</p>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/include/GL/Makefile.am b/nx-X11/extras/Mesa/include/GL/Makefile.am
deleted file mode 100644
index 199bd5c8f..000000000
--- a/nx-X11/extras/Mesa/include/GL/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-GLincludedir = $(includedir)/GL
-
-INC_FX = fxmesa.h
-INC_GGI = ggimesa.h
-INC_OSMESA = osmesa.h
-INC_SVGA = svgamesa.h
-INC_X11 = glx.h glxext.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h
-INC_GLUT = glut.h glutf90.h
-
-if HAVE_FX
-sel_inc_fx = $(INC_FX)
-endif
-
-if HAVE_GGI
-sel_inc_ggi = $(INC_GGI)
-endif
-
-if HAVE_OSMESA
-sel_inc_osmesa = $(INC_OSMESA)
-endif
-
-if HAVE_SVGA
-sel_inc_svga = $(INC_SVGA)
-endif
-
-if HAVE_X11
-sel_inc_x11 = $(INC_X11)
-endif
-
-if NEED_GLUT
-sel_inc_glut = $(INC_GLUT)
-endif
-
-EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \
- vms_x_fix.h wmesa.h \
- $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT)
-
-GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \
- $(sel_inc_fx) $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \
- $(sel_inc_x11) $(sel_inc_glut)
-include $(top_srcdir)/common_rules.make
diff --git a/nx-X11/extras/Mesa/include/GL/amesa.h b/nx-X11/extras/Mesa/include/GL/amesa.h
deleted file mode 100644
index 852d34cf4..000000000
--- a/nx-X11/extras/Mesa/include/GL/amesa.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */
-
-
-#ifndef AMESA_H
-#define AMESA_H
-
-
-#define AMESA_MAJOR_VERSION 3
-#define AMESA_MINOR_VERSION 3
-
-
-typedef struct amesa_visual *AMesaVisual;
-typedef struct amesa_buffer *AMesaBuffer;
-typedef struct amesa_context *AMesaContext;
-
-
-extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth,
- GLint depthSize,
- GLint stencilSize,
- GLint accumSize);
-
-extern void AMesaDestroyVisual(AMesaVisual visual);
-
-extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual,
- GLint width, GLint height);
-
-extern void AMesaDestroyBuffer(AMesaBuffer buffer);
-
-
-extern AMesaContext AMesaCreateContext(AMesaVisual visual,
- AMesaContext sharelist);
-
-extern void AMesaDestroyContext(AMesaContext context);
-
-extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer);
-
-extern void AMesaSwapBuffers(AMesaBuffer buffer);
-
-
-#endif /* AMESA_H */
diff --git a/nx-X11/extras/Mesa/include/GL/directfbgl.h b/nx-X11/extras/Mesa/include/GL/directfbgl.h
deleted file mode 100644
index 984c4b142..000000000
--- a/nx-X11/extras/Mesa/include/GL/directfbgl.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- (c) Copyright 2001 convergence integrated media GmbH.
- All rights reserved.
-
- Written by Denis Oliver Kropp <dok@convergence.de> and
- Andreas Hundt <andi@convergence.de>.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#ifndef __DIRECTFBGL_H__
-#define __DIRECTFBGL_H__
-
-#include <directfb.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-typedef struct {
- int buffer_size;
- int depth_size;
- int stencil_size;
- int aux_buffers;
-
- int red_size;
- int green_size;
- int blue_size;
- int alpha_size;
-
- int accum_red_size;
- int accum_green_size;
- int accum_blue_size;
- int accum_alpha_size;
-
- DFBBoolean double_buffer;
- DFBBoolean stereo;
-} DFBGLAttributes;
-
-
-DEFINE_INTERFACE( IDirectFBGL,
-
- /** Context handling **/
-
- /*
- * Acquire the hardware lock.
- */
- DFBResult (*Lock) (
- IDirectFBGL *thiz
- );
-
- /*
- * Release the lock.
- */
- DFBResult (*Unlock) (
- IDirectFBGL *thiz
- );
-
- /*
- * Query the OpenGL attributes.
- */
- DFBResult (*GetAttributes) (
- IDirectFBGL *thiz,
- DFBGLAttributes *attributes
- );
-)
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/include/GL/dmesa.h b/nx-X11/extras/Mesa/include/GL/dmesa.h
deleted file mode 100644
index e67b3426f..000000000
--- a/nx-X11/extras/Mesa/include/GL/dmesa.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * DOS/DJGPP device driver v1.7 for Mesa
- *
- * Copyright (C) 2002 - Daniel Borca
- * Email : dborca@users.sourceforge.net
- * Web : http://www.geocities.com/dborca
- */
-
-
-#ifndef DMESA_H_included
-#define DMESA_H_included
-
-#define DMESA_MAJOR_VERSION 6
-#define DMESA_MINOR_VERSION 3
-
-/* Sample Usage:
- *
- * 1. Call DMesaCreateVisual() to initialize graphics.
- * 2. Call DMesaCreateContext() to create a DMesa rendering context.
- * 3. Call DMesaCreateBuffer() to define the window.
- * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
- * 5. Make gl* calls to render your graphics.
- * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
- * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
- */
-
-typedef struct dmesa_context *DMesaContext;
-typedef struct dmesa_visual *DMesaVisual;
-typedef struct dmesa_buffer *DMesaBuffer;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Create a new Visual and set graphics mode.
- */
-DMesaVisual DMesaCreateVisual (GLint width, /* X res */
- GLint height, /* Y res */
- GLint colDepth, /* BPP */
- GLint refresh, /* refresh rate: 0=default */
- GLboolean dbFlag, /* double-buffered */
- GLboolean rgbFlag, /* RGB mode */
- GLint alphaSize, /* requested bits/alpha */
- GLint depthSize, /* requested bits/depth */
- GLint stencilSize, /* requested bits/stencil */
- GLint accumSize); /* requested bits/accum */
-
-/*
- * Destroy Visual and restore screen.
- */
-void DMesaDestroyVisual (DMesaVisual v);
-
-
-
-/*
- * Create a new Context for rendering.
- */
-DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
-
-/*
- * Destroy Context.
- */
-void DMesaDestroyContext (DMesaContext c);
-
-/*
- * Return a handle to the current context.
- */
-DMesaContext DMesaGetCurrentContext (void);
-
-
-
-/*
- * Create a new Buffer (window).
- */
-DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
- GLint xpos, GLint ypos,
- GLint width, GLint height);
-
-/*
- * Destroy Buffer.
- */
-void DMesaDestroyBuffer (DMesaBuffer b);
-
-/*
- * Return a handle to the current buffer.
- */
-DMesaBuffer DMesaGetCurrentBuffer (void);
-
-/*
- * Swap the front and back buffers for the given Buffer.
- * No action is taken if the buffer is not double buffered.
- */
-void DMesaSwapBuffers (DMesaBuffer b);
-
-/*
- * Bind Buffer to Context and make the Context the current one.
- */
-GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
-
-
-
-/*
- * Move/Resize current Buffer.
- */
-GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
-GLboolean DMesaResizeBuffer (GLint width, GLint height);
-
-/*
- * Set palette index, using normalized values.
- */
-void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
-
-/*
- * DMesa functions
- */
-typedef void (*DMesaProc) (void);
-DMesaProc DMesaGetProcAddress (const char *name);
-
-/*
- * DMesa state retrieval.
- */
-#define DMESA_GET_SCREEN_SIZE 0x0100
-#define DMESA_GET_DRIVER_CAPS 0x0200
-#define DMESA_GET_VIDEO_MODES 0x0300
-#define DMESA_GET_BUFFER_ADDR 0x0400
-
-#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
-#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
-int DMesaGetIntegerv (GLenum pname, GLint *params);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/foomesa.h b/nx-X11/extras/Mesa/include/GL/foomesa.h
deleted file mode 100644
index 8517d8838..000000000
--- a/nx-X11/extras/Mesa/include/GL/foomesa.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 3.0
- * Copyright (C) 1995-1998 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-/*
- * Example Foo/Mesa interface. See src/ddsample.c for more info.
- */
-
-
-
-#ifndef FOOMESA_H
-#define FOOMESA_H
-
-
-
-typedef struct foo_mesa_visual *FooMesaVisual;
-
-typedef struct foo_mesa_buffer *FooMesaBuffer;
-
-typedef struct foo_mesa_context *FooMesaContext;
-
-
-
-#ifdef BEOS
-#pragma export on
-#endif
-
-
-extern FooMesaVisual FooMesaChooseVisual( /* your params */ );
-
-extern void FooMesaDestroyVisual( FooMesaVisual visual );
-
-
-extern FooMesaBuffer FooMesaCreateBuffer( FooMesaVisual visual,
- void *your_window_id );
-
-extern void FooMesaDestroyBuffer( FooMesaBuffer buffer );
-
-
-extern FooMesaContext FooMesaCreateContext( FooMesaVisual visual,
- FooMesaContext sharelist );
-
-extern void FooMesaDestroyContext( FooMesaContext context );
-
-
-extern void FooMesaMakeCurrent( FooMesaContext context, FooMesaBuffer buffer );
-
-
-extern void FooMesaSwapBuffers( FooMesaBuffer buffer );
-
-
-/* Probably some more functions... */
-
-
-#ifdef BEOS
-#pragma export off
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/fxmesa.h b/nx-X11/extras/Mesa/include/GL/fxmesa.h
deleted file mode 100644
index f8e9661f9..000000000
--- a/nx-X11/extras/Mesa/include/GL/fxmesa.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- * Copyright (C) 1995-2001 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-/*
- * FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli
- *
- * NOTE: This version requires Glide3 (http://sourceforge.net/projects/glide)
- */
-
-
-#ifndef FXMESA_H
-#define FXMESA_H
-
-
-#include <glide.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define FXMESA_MAJOR_VERSION 6
-#define FXMESA_MINOR_VERSION 3
-
-
-/*
- * Values for attribList parameter to fxMesaCreateContext():
- */
-#define FXMESA_NONE 0 /* to terminate attribList */
-#define FXMESA_DOUBLEBUFFER 10
-#define FXMESA_ALPHA_SIZE 11 /* followed by an integer */
-#define FXMESA_DEPTH_SIZE 12 /* followed by an integer */
-#define FXMESA_STENCIL_SIZE 13 /* followed by an integer */
-#define FXMESA_ACCUM_SIZE 14 /* followed by an integer */
-#define FXMESA_COLORDEPTH 20 /* followed by an integer */
-#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */
-
-
-
-typedef struct tfxMesaContext *fxMesaContext;
-
-
-#if defined (__BEOS__)
-#pragma export on
-#endif
-
-
-GLAPI fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, GrScreenResolution_t,
- GrScreenRefresh_t,
- const GLint attribList[]);
-
-GLAPI fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win,
- GLint width, GLint height,
- const GLint attribList[]);
-GLAPI void GLAPIENTRY fxMesaDestroyContext(fxMesaContext ctx);
-
-GLAPI GLint GLAPIENTRY fxMesaSelectCurrentBoard(int n);
-
-GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx);
-
-GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void);
-
-GLAPI void GLAPIENTRY fxMesaSwapBuffers(void);
-
-GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal);
-
-GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx);
-
-GLAPI void GLAPIENTRY fxCloseHardware(void);
-
-GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h);
-
-
-#if defined (__BEOS__)
-#pragma export off
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/ggimesa.h b/nx-X11/extras/Mesa/include/GL/ggimesa.h
deleted file mode 100644
index 90e0b4222..000000000
--- a/nx-X11/extras/Mesa/include/GL/ggimesa.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Mesa 3-D graphics library GGI bindings (GGIGL [giggle])
- * Version: 4.0
- * Copyright (C) 1995-2000 Brian Paul
- * Copyright (C) 1998 Uwe Maurer
- * Copyrigth (C) 2001 Filip Spacek
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-#ifndef GGIMESA_H
-#define GGIMESA_H
-
-#define GGIMESA_MAJOR_VERSION 4
-#define GGIMESA_MINOR_VERSION 0
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <ggi/ggi.h>
-#include "GL/gl.h"
-
-typedef struct ggi_mesa_context *ggi_mesa_context_t;
-
-/*
- * Initialize Mesa GGI extension
- */
-int ggiMesaInit(void);
-/*
- * Clean up Mesa GGI exension
- */
-int ggiMesaExit(void);
-
-/*
- * Attach Mesa GGI extension to the visual 'vis'
- */
-int ggiMesaAttach(ggi_visual_t vis);
-/*
- * Detach Mesa GGI extension from the visual 'vis'
- */
-int ggiMesaDetach(ggi_visual_t vis);
-
-int ggiMesaExtendVisual(ggi_visual_t vis, GLboolean alpha_flag,
- GLboolean stereo_flag, GLint depth_size,
- GLint stencil_size, GLint accum_red_size,
- GLint accum_green_size, GLint accum_blue_size,
- GLint accum_alpha_size, GLint num_samples);
-
-/*
- * Create a new context capable of displaying on the visual vis.
- */
-ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis);
-/*
- * Destroy the context 'ctx'
- */
-void ggiMesaDestroyContext(ggi_mesa_context_t ctx);
-
-/*
- * Make context 'ctx' the current context and bind it to visual 'vis'.
- * Note that the context must have been created with respect to that visual.
- */
-void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis);
-
-void ggiMesaSwapBuffers(void);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/gl_mangle.h b/nx-X11/extras/Mesa/include/GL/gl_mangle.h
deleted file mode 100644
index c1b443c6b..000000000
--- a/nx-X11/extras/Mesa/include/GL/gl_mangle.h
+++ /dev/null
@@ -1,1472 +0,0 @@
-#if 0
-#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
-#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
- files="gl.h glext.h"
-#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
- awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
- echo ""
-#define GL_MANGLE_C4 get aliases
- grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq
- echo ""
- echo "#endif /* GL_MANGLE_H */"
- exit
-#endif /* REGENERATION */
-
-/*
- * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link
- * your application both with OpenGL and Mesa. The Mesa functions will
- * be redefined so they are prefixed with "mgl" instead of "gl".
- * Mgl contributed by Randy Frank (rfrank@rsinc.com)
- * Regneration code contributed by Ray Tice (rayt@ma.ultra.net)
- */
-
-#ifndef GL_MANGLE_H
-#define GL_MANGLE_H
-
-#ifndef MANGLE
-#define MANGLE(x) mgl##x
-#endif /*MANGLE*/
-
-/* Internal symbols which may collide with other OpenGL implementations. */
-#define __glCoreCreateContext __mglCoreCreateContext
-#define __glCoreNopDispatch __mglCoreNopDispatch
-
-/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
-
-#define glAccum MANGLE(Accum)
-#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
-#define glActiveTextureARB MANGLE(ActiveTextureARB)
-#define glActiveTexture MANGLE(ActiveTexture)
-#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
-#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI)
-#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI)
-#define glAlphaFunc MANGLE(AlphaFunc)
-#define glApplyTextureEXT MANGLE(ApplyTextureEXT)
-#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV)
-#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT)
-#define glAreTexturesResident MANGLE(AreTexturesResident)
-#define glArrayElementEXT MANGLE(ArrayElementEXT)
-#define glArrayElement MANGLE(ArrayElement)
-#define glArrayObjectATI MANGLE(ArrayObjectATI)
-#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
-#define glAttachObjectARB MANGLE(AttachObjectARB)
-#define glAttachShader MANGLE(AttachShader)
-#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
-#define glBegin MANGLE(Begin)
-#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
-#define glBeginQueryARB MANGLE(BeginQueryARB)
-#define glBeginQuery MANGLE(BeginQuery)
-#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
-#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
-#define glBindAttribLocation MANGLE(BindAttribLocation)
-#define glBindBufferARB MANGLE(BindBufferARB)
-#define glBindBuffer MANGLE(BindBuffer)
-#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
-#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
-#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
-#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
-#define glBindParameterEXT MANGLE(BindParameterEXT)
-#define glBindProgramARB MANGLE(BindProgramARB)
-#define glBindProgramNV MANGLE(BindProgramNV)
-#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
-#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
-#define glBindTextureEXT MANGLE(BindTextureEXT)
-#define glBindTexture MANGLE(BindTexture)
-#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
-#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
-#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
-#define glBinormal3bEXT MANGLE(Binormal3bEXT)
-#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
-#define glBinormal3dEXT MANGLE(Binormal3dEXT)
-#define glBinormal3dvEXT MANGLE(Binormal3dvEXT)
-#define glBinormal3fEXT MANGLE(Binormal3fEXT)
-#define glBinormal3fvEXT MANGLE(Binormal3fvEXT)
-#define glBinormal3iEXT MANGLE(Binormal3iEXT)
-#define glBinormal3ivEXT MANGLE(Binormal3ivEXT)
-#define glBinormal3sEXT MANGLE(Binormal3sEXT)
-#define glBinormal3svEXT MANGLE(Binormal3svEXT)
-#define glBinormalPointerEXT MANGLE(BinormalPointerEXT)
-#define glBitmap MANGLE(Bitmap)
-#define glBlendColorEXT MANGLE(BlendColorEXT)
-#define glBlendColor MANGLE(BlendColor)
-#define glBlendEquationEXT MANGLE(BlendEquationEXT)
-#define glBlendEquation MANGLE(BlendEquation)
-#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
-#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
-#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
-#define glBlendFunc MANGLE(BlendFunc)
-#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
-#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
-#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
-#define glBufferDataARB MANGLE(BufferDataARB)
-#define glBufferData MANGLE(BufferData)
-#define glBufferSubDataARB MANGLE(BufferSubDataARB)
-#define glBufferSubData MANGLE(BufferSubData)
-#define glCallList MANGLE(CallList)
-#define glCallLists MANGLE(CallLists)
-#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
-#define glClampColorARB MANGLE(ClampColorARB)
-#define glClearAccum MANGLE(ClearAccum)
-#define glClearColor MANGLE(ClearColor)
-#define glClearDepth MANGLE(ClearDepth)
-#define glClearIndex MANGLE(ClearIndex)
-#define glClear MANGLE(Clear)
-#define glClearStencil MANGLE(ClearStencil)
-#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
-#define glClientActiveTexture MANGLE(ClientActiveTexture)
-#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
-#define glClipPlane MANGLE(ClipPlane)
-#define glColor3b MANGLE(Color3b)
-#define glColor3bv MANGLE(Color3bv)
-#define glColor3d MANGLE(Color3d)
-#define glColor3dv MANGLE(Color3dv)
-#define glColor3f MANGLE(Color3f)
-#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN)
-#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN)
-#define glColor3fv MANGLE(Color3fv)
-#define glColor3hNV MANGLE(Color3hNV)
-#define glColor3hvNV MANGLE(Color3hvNV)
-#define glColor3i MANGLE(Color3i)
-#define glColor3iv MANGLE(Color3iv)
-#define glColor3s MANGLE(Color3s)
-#define glColor3sv MANGLE(Color3sv)
-#define glColor3ub MANGLE(Color3ub)
-#define glColor3ubv MANGLE(Color3ubv)
-#define glColor3ui MANGLE(Color3ui)
-#define glColor3uiv MANGLE(Color3uiv)
-#define glColor3us MANGLE(Color3us)
-#define glColor3usv MANGLE(Color3usv)
-#define glColor4b MANGLE(Color4b)
-#define glColor4bv MANGLE(Color4bv)
-#define glColor4d MANGLE(Color4d)
-#define glColor4dv MANGLE(Color4dv)
-#define glColor4f MANGLE(Color4f)
-#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN)
-#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN)
-#define glColor4fv MANGLE(Color4fv)
-#define glColor4hNV MANGLE(Color4hNV)
-#define glColor4hvNV MANGLE(Color4hvNV)
-#define glColor4i MANGLE(Color4i)
-#define glColor4iv MANGLE(Color4iv)
-#define glColor4s MANGLE(Color4s)
-#define glColor4sv MANGLE(Color4sv)
-#define glColor4ub MANGLE(Color4ub)
-#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN)
-#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN)
-#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN)
-#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN)
-#define glColor4ubv MANGLE(Color4ubv)
-#define glColor4ui MANGLE(Color4ui)
-#define glColor4uiv MANGLE(Color4uiv)
-#define glColor4us MANGLE(Color4us)
-#define glColor4usv MANGLE(Color4usv)
-#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
-#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
-#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
-#define glColorMask MANGLE(ColorMask)
-#define glColorMaterial MANGLE(ColorMaterial)
-#define glColorPointerEXT MANGLE(ColorPointerEXT)
-#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
-#define glColorPointer MANGLE(ColorPointer)
-#define glColorPointervINTEL MANGLE(ColorPointervINTEL)
-#define glColorSubTableEXT MANGLE(ColorSubTableEXT)
-#define glColorSubTable MANGLE(ColorSubTable)
-#define glColorTableEXT MANGLE(ColorTableEXT)
-#define glColorTable MANGLE(ColorTable)
-#define glColorTableParameterfv MANGLE(ColorTableParameterfv)
-#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI)
-#define glColorTableParameteriv MANGLE(ColorTableParameteriv)
-#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI)
-#define glColorTableSGI MANGLE(ColorTableSGI)
-#define glCombinerInputNV MANGLE(CombinerInputNV)
-#define glCombinerOutputNV MANGLE(CombinerOutputNV)
-#define glCombinerParameterfNV MANGLE(CombinerParameterfNV)
-#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV)
-#define glCombinerParameteriNV MANGLE(CombinerParameteriNV)
-#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
-#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
-#define glCompileShaderARB MANGLE(CompileShaderARB)
-#define glCompileShader MANGLE(CompileShader)
-#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB)
-#define glCompressedTexImage1D MANGLE(CompressedTexImage1D)
-#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB)
-#define glCompressedTexImage2D MANGLE(CompressedTexImage2D)
-#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB)
-#define glCompressedTexImage3D MANGLE(CompressedTexImage3D)
-#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB)
-#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D)
-#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB)
-#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D)
-#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB)
-#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D)
-#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
-#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
-#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
-#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D)
-#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT)
-#define glConvolutionParameterf MANGLE(ConvolutionParameterf)
-#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT)
-#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv)
-#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT)
-#define glConvolutionParameteri MANGLE(ConvolutionParameteri)
-#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT)
-#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv)
-#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT)
-#define glCopyColorSubTable MANGLE(CopyColorSubTable)
-#define glCopyColorTable MANGLE(CopyColorTable)
-#define glCopyColorTableSGI MANGLE(CopyColorTableSGI)
-#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT)
-#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
-#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
-#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
-#define glCopyPixels MANGLE(CopyPixels)
-#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
-#define glCopyTexImage1D MANGLE(CopyTexImage1D)
-#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT)
-#define glCopyTexImage2D MANGLE(CopyTexImage2D)
-#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT)
-#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D)
-#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT)
-#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D)
-#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT)
-#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D)
-#define glCreateProgram MANGLE(CreateProgram)
-#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
-#define glCreateShader MANGLE(CreateShader)
-#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
-#define glCullFace MANGLE(CullFace)
-#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
-#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
-#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
-#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
-#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
-#define glDeformSGIX MANGLE(DeformSGIX)
-#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX)
-#define glDeleteBuffersARB MANGLE(DeleteBuffersARB)
-#define glDeleteBuffers MANGLE(DeleteBuffers)
-#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
-#define glDeleteFencesNV MANGLE(DeleteFencesNV)
-#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
-#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
-#define glDeleteLists MANGLE(DeleteLists)
-#define glDeleteObjectARB MANGLE(DeleteObjectARB)
-#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
-#define glDeleteProgram MANGLE(DeleteProgram)
-#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
-#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
-#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
-#define glDeleteQueries MANGLE(DeleteQueries)
-#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
-#define glDeleteShader MANGLE(DeleteShader)
-#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
-#define glDeleteTextures MANGLE(DeleteTextures)
-#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
-#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
-#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
-#define glDepthFunc MANGLE(DepthFunc)
-#define glDepthMask MANGLE(DepthMask)
-#define glDepthRange MANGLE(DepthRange)
-#define glDetachObjectARB MANGLE(DetachObjectARB)
-#define glDetachShader MANGLE(DetachShader)
-#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
-#define glDisableClientState MANGLE(DisableClientState)
-#define glDisable MANGLE(Disable)
-#define glDisableTraceMESA MANGLE(DisableTraceMESA)
-#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
-#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
-#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
-#define glDrawArraysEXT MANGLE(DrawArraysEXT)
-#define glDrawArrays MANGLE(DrawArrays)
-#define glDrawBuffer MANGLE(DrawBuffer)
-#define glDrawBuffersARB MANGLE(DrawBuffersARB)
-#define glDrawBuffersATI MANGLE(DrawBuffersATI)
-#define glDrawBuffers MANGLE(DrawBuffers)
-#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
-#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
-#define glDrawElements MANGLE(DrawElements)
-#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
-#define glDrawPixels MANGLE(DrawPixels)
-#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
-#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
-#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
-#define glDrawRangeElements MANGLE(DrawRangeElements)
-#define glEdgeFlag MANGLE(EdgeFlag)
-#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
-#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
-#define glEdgeFlagPointer MANGLE(EdgeFlagPointer)
-#define glEdgeFlagv MANGLE(EdgeFlagv)
-#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
-#define glElementPointerATI MANGLE(ElementPointerATI)
-#define glEnableClientState MANGLE(EnableClientState)
-#define glEnable MANGLE(Enable)
-#define glEnableTraceMESA MANGLE(EnableTraceMESA)
-#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
-#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
-#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
-#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
-#define glEndList MANGLE(EndList)
-#define glEnd MANGLE(End)
-#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
-#define glEndQueryARB MANGLE(EndQueryARB)
-#define glEndQuery MANGLE(EndQuery)
-#define glEndTraceMESA MANGLE(EndTraceMESA)
-#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
-#define glEvalCoord1d MANGLE(EvalCoord1d)
-#define glEvalCoord1dv MANGLE(EvalCoord1dv)
-#define glEvalCoord1f MANGLE(EvalCoord1f)
-#define glEvalCoord1fv MANGLE(EvalCoord1fv)
-#define glEvalCoord2d MANGLE(EvalCoord2d)
-#define glEvalCoord2dv MANGLE(EvalCoord2dv)
-#define glEvalCoord2f MANGLE(EvalCoord2f)
-#define glEvalCoord2fv MANGLE(EvalCoord2fv)
-#define glEvalMapsNV MANGLE(EvalMapsNV)
-#define glEvalMesh1 MANGLE(EvalMesh1)
-#define glEvalMesh2 MANGLE(EvalMesh2)
-#define glEvalPoint1 MANGLE(EvalPoint1)
-#define glEvalPoint2 MANGLE(EvalPoint2)
-#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
-#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
-#define glFeedbackBuffer MANGLE(FeedbackBuffer)
-#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
-#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
-#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
-#define glFinishFenceNV MANGLE(FinishFenceNV)
-#define glFinish MANGLE(Finish)
-#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE)
-#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
-#define glFlush MANGLE(Flush)
-#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
-#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
-#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
-#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV)
-#define glFogCoorddEXT MANGLE(FogCoorddEXT)
-#define glFogCoordd MANGLE(FogCoordd)
-#define glFogCoorddvEXT MANGLE(FogCoorddvEXT)
-#define glFogCoorddv MANGLE(FogCoorddv)
-#define glFogCoordfEXT MANGLE(FogCoordfEXT)
-#define glFogCoordf MANGLE(FogCoordf)
-#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
-#define glFogCoordfv MANGLE(FogCoordfv)
-#define glFogCoordhNV MANGLE(FogCoordhNV)
-#define glFogCoordhvNV MANGLE(FogCoordhvNV)
-#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT)
-#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM)
-#define glFogCoordPointer MANGLE(FogCoordPointer)
-#define glFogf MANGLE(Fogf)
-#define glFogFuncSGIS MANGLE(FogFuncSGIS)
-#define glFogfv MANGLE(Fogfv)
-#define glFogi MANGLE(Fogi)
-#define glFogiv MANGLE(Fogiv)
-#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX)
-#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX)
-#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX)
-#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX)
-#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX)
-#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX)
-#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX)
-#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX)
-#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX)
-#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX)
-#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
-#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
-#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
-#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
-#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
-#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
-#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
-#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
-#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
-#define glFrontFace MANGLE(FrontFace)
-#define glFrustum MANGLE(Frustum)
-#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
-#define glGenBuffersARB MANGLE(GenBuffersARB)
-#define glGenBuffers MANGLE(GenBuffers)
-#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
-#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
-#define glGenFencesNV MANGLE(GenFencesNV)
-#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
-#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
-#define glGenLists MANGLE(GenLists)
-#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
-#define glGenProgramsARB MANGLE(GenProgramsARB)
-#define glGenProgramsNV MANGLE(GenProgramsNV)
-#define glGenQueriesARB MANGLE(GenQueriesARB)
-#define glGenQueries MANGLE(GenQueries)
-#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
-#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
-#define glGenTexturesEXT MANGLE(GenTexturesEXT)
-#define glGenTextures MANGLE(GenTextures)
-#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
-#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
-#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
-#define glGetActiveAttrib MANGLE(GetActiveAttrib)
-#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
-#define glGetActiveUniform MANGLE(GetActiveUniform)
-#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI)
-#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI)
-#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB)
-#define glGetAttachedShaders MANGLE(GetAttachedShaders)
-#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
-#define glGetAttribLocation MANGLE(GetAttribLocation)
-#define glGetBooleanv MANGLE(GetBooleanv)
-#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
-#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
-#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
-#define glGetBufferPointerv MANGLE(GetBufferPointerv)
-#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB)
-#define glGetBufferSubData MANGLE(GetBufferSubData)
-#define glGetClipPlane MANGLE(GetClipPlane)
-#define glGetColorTableEXT MANGLE(GetColorTableEXT)
-#define glGetColorTable MANGLE(GetColorTable)
-#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT)
-#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv)
-#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI)
-#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT)
-#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv)
-#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI)
-#define glGetColorTableSGI MANGLE(GetColorTableSGI)
-#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV)
-#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV)
-#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV)
-#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV)
-#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV)
-#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
-#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
-#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
-#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
-#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
-#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv)
-#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT)
-#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
-#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
-#define glGetDoublev MANGLE(GetDoublev)
-#define glGetError MANGLE(GetError)
-#define glGetFenceivNV MANGLE(GetFenceivNV)
-#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
-#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
-#define glGetFloatv MANGLE(GetFloatv)
-#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
-#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
-#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
-#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
-#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
-#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
-#define glGetHandleARB MANGLE(GetHandleARB)
-#define glGetHistogramEXT MANGLE(GetHistogramEXT)
-#define glGetHistogram MANGLE(GetHistogram)
-#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT)
-#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv)
-#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT)
-#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv)
-#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP)
-#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
-#define glGetInfoLogARB MANGLE(GetInfoLogARB)
-#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
-#define glGetIntegerv MANGLE(GetIntegerv)
-#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
-#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
-#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT)
-#define glGetLightfv MANGLE(GetLightfv)
-#define glGetLightiv MANGLE(GetLightiv)
-#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX)
-#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX)
-#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT)
-#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT)
-#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT)
-#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV)
-#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV)
-#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV)
-#define glGetMapdv MANGLE(GetMapdv)
-#define glGetMapfv MANGLE(GetMapfv)
-#define glGetMapiv MANGLE(GetMapiv)
-#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV)
-#define glGetMapParameterivNV MANGLE(GetMapParameterivNV)
-#define glGetMaterialfv MANGLE(GetMaterialfv)
-#define glGetMaterialiv MANGLE(GetMaterialiv)
-#define glGetMinmaxEXT MANGLE(GetMinmaxEXT)
-#define glGetMinmax MANGLE(GetMinmax)
-#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT)
-#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
-#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
-#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
-#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
-#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
-#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
-#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
-#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
-#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
-#define glGetPixelMapfv MANGLE(GetPixelMapfv)
-#define glGetPixelMapuiv MANGLE(GetPixelMapuiv)
-#define glGetPixelMapusv MANGLE(GetPixelMapusv)
-#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS)
-#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS)
-#define glGetPointervEXT MANGLE(GetPointervEXT)
-#define glGetPointerv MANGLE(GetPointerv)
-#define glGetPolygonStipple MANGLE(GetPolygonStipple)
-#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
-#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
-#define glGetProgramInfoLog MANGLE(GetProgramInfoLog)
-#define glGetProgramivARB MANGLE(GetProgramivARB)
-#define glGetProgramiv MANGLE(GetProgramiv)
-#define glGetProgramivNV MANGLE(GetProgramivNV)
-#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
-#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
-#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV)
-#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
-#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
-#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
-#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
-#define glGetProgramStringARB MANGLE(GetProgramStringARB)
-#define glGetProgramStringNV MANGLE(GetProgramStringNV)
-#define glGetQueryivARB MANGLE(GetQueryivARB)
-#define glGetQueryiv MANGLE(GetQueryiv)
-#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
-#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
-#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
-#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
-#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
-#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
-#define glGetSeparableFilter MANGLE(GetSeparableFilter)
-#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
-#define glGetShaderiv MANGLE(GetShaderiv)
-#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
-#define glGetShaderSource MANGLE(GetShaderSource)
-#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
-#define glGetString MANGLE(GetString)
-#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
-#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
-#define glGetTexEnvfv MANGLE(GetTexEnvfv)
-#define glGetTexEnviv MANGLE(GetTexEnviv)
-#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS)
-#define glGetTexGendv MANGLE(GetTexGendv)
-#define glGetTexGenfv MANGLE(GetTexGenfv)
-#define glGetTexGeniv MANGLE(GetTexGeniv)
-#define glGetTexImage MANGLE(GetTexImage)
-#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv)
-#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
-#define glGetTexParameterfv MANGLE(GetTexParameterfv)
-#define glGetTexParameteriv MANGLE(GetTexParameteriv)
-#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
-#define glGetUniformfvARB MANGLE(GetUniformfvARB)
-#define glGetUniformfv MANGLE(GetUniformfv)
-#define glGetUniformivARB MANGLE(GetUniformivARB)
-#define glGetUniformiv MANGLE(GetUniformiv)
-#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
-#define glGetUniformLocation MANGLE(GetUniformLocation)
-#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
-#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
-#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
-#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
-#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
-#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
-#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
-#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI)
-#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
-#define glGetVertexAttribdv MANGLE(GetVertexAttribdv)
-#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV)
-#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
-#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
-#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
-#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
-#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
-#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
-#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
-#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
-#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
-#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN)
-#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN)
-#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN)
-#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN)
-#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN)
-#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN)
-#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN)
-#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN)
-#define glHint MANGLE(Hint)
-#define glHintPGI MANGLE(HintPGI)
-#define glHistogramEXT MANGLE(HistogramEXT)
-#define glHistogram MANGLE(Histogram)
-#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX)
-#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP)
-#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP)
-#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP)
-#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP)
-#define glIndexd MANGLE(Indexd)
-#define glIndexdv MANGLE(Indexdv)
-#define glIndexf MANGLE(Indexf)
-#define glIndexFuncEXT MANGLE(IndexFuncEXT)
-#define glIndexfv MANGLE(Indexfv)
-#define glIndexi MANGLE(Indexi)
-#define glIndexiv MANGLE(Indexiv)
-#define glIndexMask MANGLE(IndexMask)
-#define glIndexMaterialEXT MANGLE(IndexMaterialEXT)
-#define glIndexPointerEXT MANGLE(IndexPointerEXT)
-#define glIndexPointerListIBM MANGLE(IndexPointerListIBM)
-#define glIndexPointer MANGLE(IndexPointer)
-#define glIndexs MANGLE(Indexs)
-#define glIndexsv MANGLE(Indexsv)
-#define glIndexub MANGLE(Indexub)
-#define glIndexubv MANGLE(Indexubv)
-#define glInitNames MANGLE(InitNames)
-#define glInsertComponentEXT MANGLE(InsertComponentEXT)
-#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX)
-#define glInterleavedArrays MANGLE(InterleavedArrays)
-#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
-#define glIsBufferARB MANGLE(IsBufferARB)
-#define glIsBuffer MANGLE(IsBuffer)
-#define glIsEnabled MANGLE(IsEnabled)
-#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
-#define glIsFenceNV MANGLE(IsFenceNV)
-#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
-#define glIsList MANGLE(IsList)
-#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
-#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
-#define glIsProgramARB MANGLE(IsProgramARB)
-#define glIsProgram MANGLE(IsProgram)
-#define glIsProgramNV MANGLE(IsProgramNV)
-#define glIsQueryARB MANGLE(IsQueryARB)
-#define glIsQuery MANGLE(IsQuery)
-#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
-#define glIsShader MANGLE(IsShader)
-#define glIsTextureEXT MANGLE(IsTextureEXT)
-#define glIsTexture MANGLE(IsTexture)
-#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
-#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
-#define glLightEnviSGIX MANGLE(LightEnviSGIX)
-#define glLightf MANGLE(Lightf)
-#define glLightfv MANGLE(Lightfv)
-#define glLighti MANGLE(Lighti)
-#define glLightiv MANGLE(Lightiv)
-#define glLightModelf MANGLE(LightModelf)
-#define glLightModelfv MANGLE(LightModelfv)
-#define glLightModeli MANGLE(LightModeli)
-#define glLightModeliv MANGLE(LightModeliv)
-#define glLineStipple MANGLE(LineStipple)
-#define glLineWidth MANGLE(LineWidth)
-#define glLinkProgramARB MANGLE(LinkProgramARB)
-#define glLinkProgram MANGLE(LinkProgram)
-#define glListBase MANGLE(ListBase)
-#define glListParameterfSGIX MANGLE(ListParameterfSGIX)
-#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX)
-#define glListParameteriSGIX MANGLE(ListParameteriSGIX)
-#define glListParameterivSGIX MANGLE(ListParameterivSGIX)
-#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX)
-#define glLoadIdentity MANGLE(LoadIdentity)
-#define glLoadMatrixd MANGLE(LoadMatrixd)
-#define glLoadMatrixf MANGLE(LoadMatrixf)
-#define glLoadName MANGLE(LoadName)
-#define glLoadProgramNV MANGLE(LoadProgramNV)
-#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB)
-#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd)
-#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB)
-#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf)
-#define glLockArraysEXT MANGLE(LockArraysEXT)
-#define glLogicOp MANGLE(LogicOp)
-#define glMap1d MANGLE(Map1d)
-#define glMap1f MANGLE(Map1f)
-#define glMap2d MANGLE(Map2d)
-#define glMap2f MANGLE(Map2f)
-#define glMapBufferARB MANGLE(MapBufferARB)
-#define glMapBuffer MANGLE(MapBuffer)
-#define glMapControlPointsNV MANGLE(MapControlPointsNV)
-#define glMapGrid1d MANGLE(MapGrid1d)
-#define glMapGrid1f MANGLE(MapGrid1f)
-#define glMapGrid2d MANGLE(MapGrid2d)
-#define glMapGrid2f MANGLE(MapGrid2f)
-#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
-#define glMapParameterfvNV MANGLE(MapParameterfvNV)
-#define glMapParameterivNV MANGLE(MapParameterivNV)
-#define glMaterialf MANGLE(Materialf)
-#define glMaterialfv MANGLE(Materialfv)
-#define glMateriali MANGLE(Materiali)
-#define glMaterialiv MANGLE(Materialiv)
-#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB)
-#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
-#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
-#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
-#define glMatrixMode MANGLE(MatrixMode)
-#define glMinmaxEXT MANGLE(MinmaxEXT)
-#define glMinmax MANGLE(Minmax)
-#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
-#define glMultiDrawArrays MANGLE(MultiDrawArrays)
-#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
-#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
-#define glMultiDrawElements MANGLE(MultiDrawElements)
-#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
-#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
-#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
-#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB)
-#define glMultiTexCoord1d MANGLE(MultiTexCoord1d)
-#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB)
-#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv)
-#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB)
-#define glMultiTexCoord1f MANGLE(MultiTexCoord1f)
-#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB)
-#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv)
-#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV)
-#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV)
-#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB)
-#define glMultiTexCoord1i MANGLE(MultiTexCoord1i)
-#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB)
-#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv)
-#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB)
-#define glMultiTexCoord1s MANGLE(MultiTexCoord1s)
-#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB)
-#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv)
-#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB)
-#define glMultiTexCoord2d MANGLE(MultiTexCoord2d)
-#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB)
-#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv)
-#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB)
-#define glMultiTexCoord2f MANGLE(MultiTexCoord2f)
-#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB)
-#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv)
-#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV)
-#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV)
-#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB)
-#define glMultiTexCoord2i MANGLE(MultiTexCoord2i)
-#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB)
-#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv)
-#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB)
-#define glMultiTexCoord2s MANGLE(MultiTexCoord2s)
-#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB)
-#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv)
-#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB)
-#define glMultiTexCoord3d MANGLE(MultiTexCoord3d)
-#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB)
-#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv)
-#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB)
-#define glMultiTexCoord3f MANGLE(MultiTexCoord3f)
-#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB)
-#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv)
-#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV)
-#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV)
-#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB)
-#define glMultiTexCoord3i MANGLE(MultiTexCoord3i)
-#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB)
-#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv)
-#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB)
-#define glMultiTexCoord3s MANGLE(MultiTexCoord3s)
-#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB)
-#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv)
-#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB)
-#define glMultiTexCoord4d MANGLE(MultiTexCoord4d)
-#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB)
-#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv)
-#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB)
-#define glMultiTexCoord4f MANGLE(MultiTexCoord4f)
-#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB)
-#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv)
-#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV)
-#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV)
-#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB)
-#define glMultiTexCoord4i MANGLE(MultiTexCoord4i)
-#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB)
-#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv)
-#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB)
-#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
-#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
-#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
-#define glMultMatrixd MANGLE(MultMatrixd)
-#define glMultMatrixf MANGLE(MultMatrixf)
-#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
-#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd)
-#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
-#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
-#define glNewList MANGLE(NewList)
-#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
-#define glNewTraceMESA MANGLE(NewTraceMESA)
-#define glNormal3b MANGLE(Normal3b)
-#define glNormal3bv MANGLE(Normal3bv)
-#define glNormal3d MANGLE(Normal3d)
-#define glNormal3dv MANGLE(Normal3dv)
-#define glNormal3f MANGLE(Normal3f)
-#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN)
-#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN)
-#define glNormal3fv MANGLE(Normal3fv)
-#define glNormal3hNV MANGLE(Normal3hNV)
-#define glNormal3hvNV MANGLE(Normal3hvNV)
-#define glNormal3i MANGLE(Normal3i)
-#define glNormal3iv MANGLE(Normal3iv)
-#define glNormal3s MANGLE(Normal3s)
-#define glNormal3sv MANGLE(Normal3sv)
-#define glNormalPointerEXT MANGLE(NormalPointerEXT)
-#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
-#define glNormalPointer MANGLE(NormalPointer)
-#define glNormalPointervINTEL MANGLE(NormalPointervINTEL)
-#define glNormalStream3bATI MANGLE(NormalStream3bATI)
-#define glNormalStream3bvATI MANGLE(NormalStream3bvATI)
-#define glNormalStream3dATI MANGLE(NormalStream3dATI)
-#define glNormalStream3dvATI MANGLE(NormalStream3dvATI)
-#define glNormalStream3fATI MANGLE(NormalStream3fATI)
-#define glNormalStream3fvATI MANGLE(NormalStream3fvATI)
-#define glNormalStream3iATI MANGLE(NormalStream3iATI)
-#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
-#define glNormalStream3sATI MANGLE(NormalStream3sATI)
-#define glNormalStream3svATI MANGLE(NormalStream3svATI)
-#define glOrtho MANGLE(Ortho)
-#define glPassTexCoordATI MANGLE(PassTexCoordATI)
-#define glPassThrough MANGLE(PassThrough)
-#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
-#define glPixelMapfv MANGLE(PixelMapfv)
-#define glPixelMapuiv MANGLE(PixelMapuiv)
-#define glPixelMapusv MANGLE(PixelMapusv)
-#define glPixelStoref MANGLE(PixelStoref)
-#define glPixelStorei MANGLE(PixelStorei)
-#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS)
-#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS)
-#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS)
-#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS)
-#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX)
-#define glPixelTransferf MANGLE(PixelTransferf)
-#define glPixelTransferi MANGLE(PixelTransferi)
-#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT)
-#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT)
-#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT)
-#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT)
-#define glPixelZoom MANGLE(PixelZoom)
-#define glPNTrianglesfATI MANGLE(PNTrianglesfATI)
-#define glPNTrianglesiATI MANGLE(PNTrianglesiATI)
-#define glPointParameterfARB MANGLE(PointParameterfARB)
-#define glPointParameterfEXT MANGLE(PointParameterfEXT)
-#define glPointParameterf MANGLE(PointParameterf)
-#define glPointParameterfSGIS MANGLE(PointParameterfSGIS)
-#define glPointParameterfvARB MANGLE(PointParameterfvARB)
-#define glPointParameterfvEXT MANGLE(PointParameterfvEXT)
-#define glPointParameterfv MANGLE(PointParameterfv)
-#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS)
-#define glPointParameteri MANGLE(PointParameteri)
-#define glPointParameteriNV MANGLE(PointParameteriNV)
-#define glPointParameteriv MANGLE(PointParameteriv)
-#define glPointParameterivNV MANGLE(PointParameterivNV)
-#define glPointSize MANGLE(PointSize)
-#define glPollAsyncSGIX MANGLE(PollAsyncSGIX)
-#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX)
-#define glPolygonMode MANGLE(PolygonMode)
-#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT)
-#define glPolygonOffset MANGLE(PolygonOffset)
-#define glPolygonStipple MANGLE(PolygonStipple)
-#define glPopAttrib MANGLE(PopAttrib)
-#define glPopClientAttrib MANGLE(PopClientAttrib)
-#define glPopMatrix MANGLE(PopMatrix)
-#define glPopName MANGLE(PopName)
-#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV)
-#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
-#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
-#define glPrioritizeTextures MANGLE(PrioritizeTextures)
-#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
-#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
-#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
-#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
-#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
-#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
-#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
-#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
-#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
-#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV)
-#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV)
-#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV)
-#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV)
-#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV)
-#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
-#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
-#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
-#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
-#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
-#define glProgramStringARB MANGLE(ProgramStringARB)
-#define glPushAttrib MANGLE(PushAttrib)
-#define glPushClientAttrib MANGLE(PushClientAttrib)
-#define glPushMatrix MANGLE(PushMatrix)
-#define glPushName MANGLE(PushName)
-#define glRasterPos2d MANGLE(RasterPos2d)
-#define glRasterPos2dv MANGLE(RasterPos2dv)
-#define glRasterPos2f MANGLE(RasterPos2f)
-#define glRasterPos2fv MANGLE(RasterPos2fv)
-#define glRasterPos2i MANGLE(RasterPos2i)
-#define glRasterPos2iv MANGLE(RasterPos2iv)
-#define glRasterPos2s MANGLE(RasterPos2s)
-#define glRasterPos2sv MANGLE(RasterPos2sv)
-#define glRasterPos3d MANGLE(RasterPos3d)
-#define glRasterPos3dv MANGLE(RasterPos3dv)
-#define glRasterPos3f MANGLE(RasterPos3f)
-#define glRasterPos3fv MANGLE(RasterPos3fv)
-#define glRasterPos3i MANGLE(RasterPos3i)
-#define glRasterPos3iv MANGLE(RasterPos3iv)
-#define glRasterPos3s MANGLE(RasterPos3s)
-#define glRasterPos3sv MANGLE(RasterPos3sv)
-#define glRasterPos4d MANGLE(RasterPos4d)
-#define glRasterPos4dv MANGLE(RasterPos4dv)
-#define glRasterPos4f MANGLE(RasterPos4f)
-#define glRasterPos4fv MANGLE(RasterPos4fv)
-#define glRasterPos4i MANGLE(RasterPos4i)
-#define glRasterPos4iv MANGLE(RasterPos4iv)
-#define glRasterPos4s MANGLE(RasterPos4s)
-#define glRasterPos4sv MANGLE(RasterPos4sv)
-#define glReadBuffer MANGLE(ReadBuffer)
-#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
-#define glReadPixels MANGLE(ReadPixels)
-#define glRectd MANGLE(Rectd)
-#define glRectdv MANGLE(Rectdv)
-#define glRectf MANGLE(Rectf)
-#define glRectfv MANGLE(Rectfv)
-#define glRecti MANGLE(Recti)
-#define glRectiv MANGLE(Rectiv)
-#define glRects MANGLE(Rects)
-#define glRectsv MANGLE(Rectsv)
-#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
-#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
-#define glRenderMode MANGLE(RenderMode)
-#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
-#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
-#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN)
-#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN)
-#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN)
-#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN)
-#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN)
-#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN)
-#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN)
-#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN)
-#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN)
-#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN)
-#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN)
-#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN)
-#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN)
-#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN)
-#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN)
-#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV)
-#define glResetHistogramEXT MANGLE(ResetHistogramEXT)
-#define glResetHistogram MANGLE(ResetHistogram)
-#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
-#define glResetMinmax MANGLE(ResetMinmax)
-#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
-#define glRotated MANGLE(Rotated)
-#define glRotatef MANGLE(Rotatef)
-#define glSampleCoverageARB MANGLE(SampleCoverageARB)
-#define glSampleCoverage MANGLE(SampleCoverage)
-#define glSampleMapATI MANGLE(SampleMapATI)
-#define glSampleMaskEXT MANGLE(SampleMaskEXT)
-#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
-#define glSamplePatternEXT MANGLE(SamplePatternEXT)
-#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
-#define glScaled MANGLE(Scaled)
-#define glScalef MANGLE(Scalef)
-#define glScissor MANGLE(Scissor)
-#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
-#define glSecondaryColor3b MANGLE(SecondaryColor3b)
-#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT)
-#define glSecondaryColor3bv MANGLE(SecondaryColor3bv)
-#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT)
-#define glSecondaryColor3d MANGLE(SecondaryColor3d)
-#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT)
-#define glSecondaryColor3dv MANGLE(SecondaryColor3dv)
-#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT)
-#define glSecondaryColor3f MANGLE(SecondaryColor3f)
-#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT)
-#define glSecondaryColor3fv MANGLE(SecondaryColor3fv)
-#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV)
-#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV)
-#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT)
-#define glSecondaryColor3i MANGLE(SecondaryColor3i)
-#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT)
-#define glSecondaryColor3iv MANGLE(SecondaryColor3iv)
-#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT)
-#define glSecondaryColor3s MANGLE(SecondaryColor3s)
-#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT)
-#define glSecondaryColor3sv MANGLE(SecondaryColor3sv)
-#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT)
-#define glSecondaryColor3ub MANGLE(SecondaryColor3ub)
-#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT)
-#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv)
-#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT)
-#define glSecondaryColor3ui MANGLE(SecondaryColor3ui)
-#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT)
-#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv)
-#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT)
-#define glSecondaryColor3us MANGLE(SecondaryColor3us)
-#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
-#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
-#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
-#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
-#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
-#define glSelectBuffer MANGLE(SelectBuffer)
-#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT)
-#define glSeparableFilter2D MANGLE(SeparableFilter2D)
-#define glSetFenceAPPLE MANGLE(SetFenceAPPLE)
-#define glSetFenceNV MANGLE(SetFenceNV)
-#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI)
-#define glSetInvariantEXT MANGLE(SetInvariantEXT)
-#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
-#define glShadeModel MANGLE(ShadeModel)
-#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
-#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
-#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
-#define glShaderSourceARB MANGLE(ShaderSourceARB)
-#define glShaderSource MANGLE(ShaderSource)
-#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS)
-#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX)
-#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX)
-#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX)
-#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX)
-#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX)
-#define glStencilFunc MANGLE(StencilFunc)
-#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI)
-#define glStencilFuncSeparate MANGLE(StencilFuncSeparate)
-#define glStencilMask MANGLE(StencilMask)
-#define glStencilMaskSeparate MANGLE(StencilMaskSeparate)
-#define glStencilOp MANGLE(StencilOp)
-#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
-#define glStencilOpSeparate MANGLE(StencilOpSeparate)
-#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
-#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
-#define glSwizzleEXT MANGLE(SwizzleEXT)
-#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
-#define glTangent3bEXT MANGLE(Tangent3bEXT)
-#define glTangent3bvEXT MANGLE(Tangent3bvEXT)
-#define glTangent3dEXT MANGLE(Tangent3dEXT)
-#define glTangent3dvEXT MANGLE(Tangent3dvEXT)
-#define glTangent3fEXT MANGLE(Tangent3fEXT)
-#define glTangent3fvEXT MANGLE(Tangent3fvEXT)
-#define glTangent3iEXT MANGLE(Tangent3iEXT)
-#define glTangent3ivEXT MANGLE(Tangent3ivEXT)
-#define glTangent3sEXT MANGLE(Tangent3sEXT)
-#define glTangent3svEXT MANGLE(Tangent3svEXT)
-#define glTangentPointerEXT MANGLE(TangentPointerEXT)
-#define glTbufferMask3DFX MANGLE(TbufferMask3DFX)
-#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
-#define glTestFenceNV MANGLE(TestFenceNV)
-#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
-#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
-#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
-#define glTexCoord1d MANGLE(TexCoord1d)
-#define glTexCoord1dv MANGLE(TexCoord1dv)
-#define glTexCoord1f MANGLE(TexCoord1f)
-#define glTexCoord1fv MANGLE(TexCoord1fv)
-#define glTexCoord1hNV MANGLE(TexCoord1hNV)
-#define glTexCoord1hvNV MANGLE(TexCoord1hvNV)
-#define glTexCoord1i MANGLE(TexCoord1i)
-#define glTexCoord1iv MANGLE(TexCoord1iv)
-#define glTexCoord1s MANGLE(TexCoord1s)
-#define glTexCoord1sv MANGLE(TexCoord1sv)
-#define glTexCoord2d MANGLE(TexCoord2d)
-#define glTexCoord2dv MANGLE(TexCoord2dv)
-#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN)
-#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN)
-#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN)
-#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN)
-#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN)
-#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN)
-#define glTexCoord2f MANGLE(TexCoord2f)
-#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN)
-#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN)
-#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN)
-#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN)
-#define glTexCoord2fv MANGLE(TexCoord2fv)
-#define glTexCoord2hNV MANGLE(TexCoord2hNV)
-#define glTexCoord2hvNV MANGLE(TexCoord2hvNV)
-#define glTexCoord2i MANGLE(TexCoord2i)
-#define glTexCoord2iv MANGLE(TexCoord2iv)
-#define glTexCoord2s MANGLE(TexCoord2s)
-#define glTexCoord2sv MANGLE(TexCoord2sv)
-#define glTexCoord3d MANGLE(TexCoord3d)
-#define glTexCoord3dv MANGLE(TexCoord3dv)
-#define glTexCoord3f MANGLE(TexCoord3f)
-#define glTexCoord3fv MANGLE(TexCoord3fv)
-#define glTexCoord3hNV MANGLE(TexCoord3hNV)
-#define glTexCoord3hvNV MANGLE(TexCoord3hvNV)
-#define glTexCoord3i MANGLE(TexCoord3i)
-#define glTexCoord3iv MANGLE(TexCoord3iv)
-#define glTexCoord3s MANGLE(TexCoord3s)
-#define glTexCoord3sv MANGLE(TexCoord3sv)
-#define glTexCoord4d MANGLE(TexCoord4d)
-#define glTexCoord4dv MANGLE(TexCoord4dv)
-#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN)
-#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN)
-#define glTexCoord4f MANGLE(TexCoord4f)
-#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN)
-#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN)
-#define glTexCoord4fv MANGLE(TexCoord4fv)
-#define glTexCoord4hNV MANGLE(TexCoord4hNV)
-#define glTexCoord4hvNV MANGLE(TexCoord4hvNV)
-#define glTexCoord4i MANGLE(TexCoord4i)
-#define glTexCoord4iv MANGLE(TexCoord4iv)
-#define glTexCoord4s MANGLE(TexCoord4s)
-#define glTexCoord4sv MANGLE(TexCoord4sv)
-#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
-#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
-#define glTexCoordPointer MANGLE(TexCoordPointer)
-#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL)
-#define glTexEnvf MANGLE(TexEnvf)
-#define glTexEnvfv MANGLE(TexEnvfv)
-#define glTexEnvi MANGLE(TexEnvi)
-#define glTexEnviv MANGLE(TexEnviv)
-#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS)
-#define glTexGend MANGLE(TexGend)
-#define glTexGendv MANGLE(TexGendv)
-#define glTexGenf MANGLE(TexGenf)
-#define glTexGenfv MANGLE(TexGenfv)
-#define glTexGeni MANGLE(TexGeni)
-#define glTexGeniv MANGLE(TexGeniv)
-#define glTexImage1D MANGLE(TexImage1D)
-#define glTexImage2D MANGLE(TexImage2D)
-#define glTexImage3DEXT MANGLE(TexImage3DEXT)
-#define glTexImage3D MANGLE(TexImage3D)
-#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
-#define glTexParameterf MANGLE(TexParameterf)
-#define glTexParameterfv MANGLE(TexParameterfv)
-#define glTexParameteri MANGLE(TexParameteri)
-#define glTexParameteriv MANGLE(TexParameteriv)
-#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
-#define glTexSubImage1D MANGLE(TexSubImage1D)
-#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT)
-#define glTexSubImage2D MANGLE(TexSubImage2D)
-#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
-#define glTexSubImage3D MANGLE(TexSubImage3D)
-#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
-#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
-#define glTextureLightEXT MANGLE(TextureLightEXT)
-#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
-#define glTextureNormalEXT MANGLE(TextureNormalEXT)
-#define glTraceAssertAttribMESA MANGLE(TraceAssertAttribMESA)
-#define glTraceCommentMESA MANGLE(TraceCommentMESA)
-#define glTraceListMESA MANGLE(TraceListMESA)
-#define glTracePointerMESA MANGLE(TracePointerMESA)
-#define glTracePointerRangeMESA MANGLE(TracePointerRangeMESA)
-#define glTraceTextureMESA MANGLE(TraceTextureMESA)
-#define glTrackMatrixNV MANGLE(TrackMatrixNV)
-#define glTranslated MANGLE(Translated)
-#define glTranslatef MANGLE(Translatef)
-#define glUniform1fARB MANGLE(Uniform1fARB)
-#define glUniform1f MANGLE(Uniform1f)
-#define glUniform1fvARB MANGLE(Uniform1fvARB)
-#define glUniform1fv MANGLE(Uniform1fv)
-#define glUniform1iARB MANGLE(Uniform1iARB)
-#define glUniform1i MANGLE(Uniform1i)
-#define glUniform1ivARB MANGLE(Uniform1ivARB)
-#define glUniform1iv MANGLE(Uniform1iv)
-#define glUniform2fARB MANGLE(Uniform2fARB)
-#define glUniform2f MANGLE(Uniform2f)
-#define glUniform2fvARB MANGLE(Uniform2fvARB)
-#define glUniform2fv MANGLE(Uniform2fv)
-#define glUniform2iARB MANGLE(Uniform2iARB)
-#define glUniform2i MANGLE(Uniform2i)
-#define glUniform2ivARB MANGLE(Uniform2ivARB)
-#define glUniform2iv MANGLE(Uniform2iv)
-#define glUniform3fARB MANGLE(Uniform3fARB)
-#define glUniform3f MANGLE(Uniform3f)
-#define glUniform3fvARB MANGLE(Uniform3fvARB)
-#define glUniform3fv MANGLE(Uniform3fv)
-#define glUniform3iARB MANGLE(Uniform3iARB)
-#define glUniform3i MANGLE(Uniform3i)
-#define glUniform3ivARB MANGLE(Uniform3ivARB)
-#define glUniform3iv MANGLE(Uniform3iv)
-#define glUniform4fARB MANGLE(Uniform4fARB)
-#define glUniform4f MANGLE(Uniform4f)
-#define glUniform4fvARB MANGLE(Uniform4fvARB)
-#define glUniform4fv MANGLE(Uniform4fv)
-#define glUniform4iARB MANGLE(Uniform4iARB)
-#define glUniform4i MANGLE(Uniform4i)
-#define glUniform4ivARB MANGLE(Uniform4ivARB)
-#define glUniform4iv MANGLE(Uniform4iv)
-#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
-#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
-#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
-#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
-#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
-#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
-#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
-#define glUnmapBufferARB MANGLE(UnmapBufferARB)
-#define glUnmapBuffer MANGLE(UnmapBuffer)
-#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
-#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
-#define glUseProgram MANGLE(UseProgram)
-#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
-#define glValidateProgramARB MANGLE(ValidateProgramARB)
-#define glValidateProgram MANGLE(ValidateProgram)
-#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
-#define glVariantbvEXT MANGLE(VariantbvEXT)
-#define glVariantdvEXT MANGLE(VariantdvEXT)
-#define glVariantfvEXT MANGLE(VariantfvEXT)
-#define glVariantivEXT MANGLE(VariantivEXT)
-#define glVariantPointerEXT MANGLE(VariantPointerEXT)
-#define glVariantsvEXT MANGLE(VariantsvEXT)
-#define glVariantubvEXT MANGLE(VariantubvEXT)
-#define glVariantuivEXT MANGLE(VariantuivEXT)
-#define glVariantusvEXT MANGLE(VariantusvEXT)
-#define glVertex2d MANGLE(Vertex2d)
-#define glVertex2dv MANGLE(Vertex2dv)
-#define glVertex2f MANGLE(Vertex2f)
-#define glVertex2fv MANGLE(Vertex2fv)
-#define glVertex2hNV MANGLE(Vertex2hNV)
-#define glVertex2hvNV MANGLE(Vertex2hvNV)
-#define glVertex2i MANGLE(Vertex2i)
-#define glVertex2iv MANGLE(Vertex2iv)
-#define glVertex2s MANGLE(Vertex2s)
-#define glVertex2sv MANGLE(Vertex2sv)
-#define glVertex3d MANGLE(Vertex3d)
-#define glVertex3dv MANGLE(Vertex3dv)
-#define glVertex3f MANGLE(Vertex3f)
-#define glVertex3fv MANGLE(Vertex3fv)
-#define glVertex3hNV MANGLE(Vertex3hNV)
-#define glVertex3hvNV MANGLE(Vertex3hvNV)
-#define glVertex3i MANGLE(Vertex3i)
-#define glVertex3iv MANGLE(Vertex3iv)
-#define glVertex3s MANGLE(Vertex3s)
-#define glVertex3sv MANGLE(Vertex3sv)
-#define glVertex4d MANGLE(Vertex4d)
-#define glVertex4dv MANGLE(Vertex4dv)
-#define glVertex4f MANGLE(Vertex4f)
-#define glVertex4fv MANGLE(Vertex4fv)
-#define glVertex4hNV MANGLE(Vertex4hNV)
-#define glVertex4hvNV MANGLE(Vertex4hvNV)
-#define glVertex4i MANGLE(Vertex4i)
-#define glVertex4iv MANGLE(Vertex4iv)
-#define glVertex4s MANGLE(Vertex4s)
-#define glVertex4sv MANGLE(Vertex4sv)
-#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
-#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
-#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
-#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
-#define glVertexAttrib1d MANGLE(VertexAttrib1d)
-#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
-#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB)
-#define glVertexAttrib1dv MANGLE(VertexAttrib1dv)
-#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV)
-#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB)
-#define glVertexAttrib1f MANGLE(VertexAttrib1f)
-#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV)
-#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB)
-#define glVertexAttrib1fv MANGLE(VertexAttrib1fv)
-#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV)
-#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV)
-#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV)
-#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB)
-#define glVertexAttrib1s MANGLE(VertexAttrib1s)
-#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV)
-#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB)
-#define glVertexAttrib1sv MANGLE(VertexAttrib1sv)
-#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV)
-#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB)
-#define glVertexAttrib2d MANGLE(VertexAttrib2d)
-#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV)
-#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB)
-#define glVertexAttrib2dv MANGLE(VertexAttrib2dv)
-#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV)
-#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB)
-#define glVertexAttrib2f MANGLE(VertexAttrib2f)
-#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV)
-#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB)
-#define glVertexAttrib2fv MANGLE(VertexAttrib2fv)
-#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV)
-#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV)
-#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV)
-#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB)
-#define glVertexAttrib2s MANGLE(VertexAttrib2s)
-#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV)
-#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB)
-#define glVertexAttrib2sv MANGLE(VertexAttrib2sv)
-#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV)
-#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB)
-#define glVertexAttrib3d MANGLE(VertexAttrib3d)
-#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV)
-#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB)
-#define glVertexAttrib3dv MANGLE(VertexAttrib3dv)
-#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV)
-#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB)
-#define glVertexAttrib3f MANGLE(VertexAttrib3f)
-#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV)
-#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB)
-#define glVertexAttrib3fv MANGLE(VertexAttrib3fv)
-#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV)
-#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV)
-#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV)
-#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB)
-#define glVertexAttrib3s MANGLE(VertexAttrib3s)
-#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV)
-#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB)
-#define glVertexAttrib3sv MANGLE(VertexAttrib3sv)
-#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV)
-#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB)
-#define glVertexAttrib4bv MANGLE(VertexAttrib4bv)
-#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB)
-#define glVertexAttrib4d MANGLE(VertexAttrib4d)
-#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV)
-#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB)
-#define glVertexAttrib4dv MANGLE(VertexAttrib4dv)
-#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV)
-#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB)
-#define glVertexAttrib4f MANGLE(VertexAttrib4f)
-#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV)
-#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB)
-#define glVertexAttrib4fv MANGLE(VertexAttrib4fv)
-#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV)
-#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV)
-#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV)
-#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB)
-#define glVertexAttrib4iv MANGLE(VertexAttrib4iv)
-#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB)
-#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv)
-#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB)
-#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv)
-#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB)
-#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv)
-#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB)
-#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub)
-#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB)
-#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv)
-#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB)
-#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv)
-#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB)
-#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv)
-#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB)
-#define glVertexAttrib4s MANGLE(VertexAttrib4s)
-#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV)
-#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB)
-#define glVertexAttrib4sv MANGLE(VertexAttrib4sv)
-#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV)
-#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV)
-#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB)
-#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv)
-#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV)
-#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB)
-#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv)
-#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
-#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
-#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
-#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
-#define glVertexAttribPointer MANGLE(VertexAttribPointer)
-#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
-#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV)
-#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV)
-#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV)
-#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV)
-#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV)
-#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV)
-#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV)
-#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV)
-#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV)
-#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV)
-#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV)
-#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV)
-#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV)
-#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV)
-#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV)
-#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV)
-#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV)
-#define glVertexBlendARB MANGLE(VertexBlendARB)
-#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
-#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
-#define glVertexPointerEXT MANGLE(VertexPointerEXT)
-#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
-#define glVertexPointer MANGLE(VertexPointer)
-#define glVertexPointervINTEL MANGLE(VertexPointervINTEL)
-#define glVertexStream1dATI MANGLE(VertexStream1dATI)
-#define glVertexStream1dvATI MANGLE(VertexStream1dvATI)
-#define glVertexStream1fATI MANGLE(VertexStream1fATI)
-#define glVertexStream1fvATI MANGLE(VertexStream1fvATI)
-#define glVertexStream1iATI MANGLE(VertexStream1iATI)
-#define glVertexStream1ivATI MANGLE(VertexStream1ivATI)
-#define glVertexStream1sATI MANGLE(VertexStream1sATI)
-#define glVertexStream1svATI MANGLE(VertexStream1svATI)
-#define glVertexStream2dATI MANGLE(VertexStream2dATI)
-#define glVertexStream2dvATI MANGLE(VertexStream2dvATI)
-#define glVertexStream2fATI MANGLE(VertexStream2fATI)
-#define glVertexStream2fvATI MANGLE(VertexStream2fvATI)
-#define glVertexStream2iATI MANGLE(VertexStream2iATI)
-#define glVertexStream2ivATI MANGLE(VertexStream2ivATI)
-#define glVertexStream2sATI MANGLE(VertexStream2sATI)
-#define glVertexStream2svATI MANGLE(VertexStream2svATI)
-#define glVertexStream3dATI MANGLE(VertexStream3dATI)
-#define glVertexStream3dvATI MANGLE(VertexStream3dvATI)
-#define glVertexStream3fATI MANGLE(VertexStream3fATI)
-#define glVertexStream3fvATI MANGLE(VertexStream3fvATI)
-#define glVertexStream3iATI MANGLE(VertexStream3iATI)
-#define glVertexStream3ivATI MANGLE(VertexStream3ivATI)
-#define glVertexStream3sATI MANGLE(VertexStream3sATI)
-#define glVertexStream3svATI MANGLE(VertexStream3svATI)
-#define glVertexStream4dATI MANGLE(VertexStream4dATI)
-#define glVertexStream4dvATI MANGLE(VertexStream4dvATI)
-#define glVertexStream4fATI MANGLE(VertexStream4fATI)
-#define glVertexStream4fvATI MANGLE(VertexStream4fvATI)
-#define glVertexStream4iATI MANGLE(VertexStream4iATI)
-#define glVertexStream4ivATI MANGLE(VertexStream4ivATI)
-#define glVertexStream4sATI MANGLE(VertexStream4sATI)
-#define glVertexStream4svATI MANGLE(VertexStream4svATI)
-#define glVertexWeightfEXT MANGLE(VertexWeightfEXT)
-#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT)
-#define glVertexWeighthNV MANGLE(VertexWeighthNV)
-#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
-#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
-#define glViewport MANGLE(Viewport)
-#define glWeightbvARB MANGLE(WeightbvARB)
-#define glWeightdvARB MANGLE(WeightdvARB)
-#define glWeightfvARB MANGLE(WeightfvARB)
-#define glWeightivARB MANGLE(WeightivARB)
-#define glWeightPointerARB MANGLE(WeightPointerARB)
-#define glWeightsvARB MANGLE(WeightsvARB)
-#define glWeightubvARB MANGLE(WeightubvARB)
-#define glWeightuivARB MANGLE(WeightuivARB)
-#define glWeightusvARB MANGLE(WeightusvARB)
-#define glWindowPos2dARB MANGLE(WindowPos2dARB)
-#define glWindowPos2d MANGLE(WindowPos2d)
-#define glWindowPos2dMESA MANGLE(WindowPos2dMESA)
-#define glWindowPos2dvARB MANGLE(WindowPos2dvARB)
-#define glWindowPos2dv MANGLE(WindowPos2dv)
-#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA)
-#define glWindowPos2fARB MANGLE(WindowPos2fARB)
-#define glWindowPos2f MANGLE(WindowPos2f)
-#define glWindowPos2fMESA MANGLE(WindowPos2fMESA)
-#define glWindowPos2fvARB MANGLE(WindowPos2fvARB)
-#define glWindowPos2fv MANGLE(WindowPos2fv)
-#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA)
-#define glWindowPos2iARB MANGLE(WindowPos2iARB)
-#define glWindowPos2i MANGLE(WindowPos2i)
-#define glWindowPos2iMESA MANGLE(WindowPos2iMESA)
-#define glWindowPos2ivARB MANGLE(WindowPos2ivARB)
-#define glWindowPos2iv MANGLE(WindowPos2iv)
-#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA)
-#define glWindowPos2sARB MANGLE(WindowPos2sARB)
-#define glWindowPos2s MANGLE(WindowPos2s)
-#define glWindowPos2sMESA MANGLE(WindowPos2sMESA)
-#define glWindowPos2svARB MANGLE(WindowPos2svARB)
-#define glWindowPos2sv MANGLE(WindowPos2sv)
-#define glWindowPos2svMESA MANGLE(WindowPos2svMESA)
-#define glWindowPos3dARB MANGLE(WindowPos3dARB)
-#define glWindowPos3d MANGLE(WindowPos3d)
-#define glWindowPos3dMESA MANGLE(WindowPos3dMESA)
-#define glWindowPos3dvARB MANGLE(WindowPos3dvARB)
-#define glWindowPos3dv MANGLE(WindowPos3dv)
-#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA)
-#define glWindowPos3fARB MANGLE(WindowPos3fARB)
-#define glWindowPos3f MANGLE(WindowPos3f)
-#define glWindowPos3fMESA MANGLE(WindowPos3fMESA)
-#define glWindowPos3fvARB MANGLE(WindowPos3fvARB)
-#define glWindowPos3fv MANGLE(WindowPos3fv)
-#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA)
-#define glWindowPos3iARB MANGLE(WindowPos3iARB)
-#define glWindowPos3i MANGLE(WindowPos3i)
-#define glWindowPos3iMESA MANGLE(WindowPos3iMESA)
-#define glWindowPos3ivARB MANGLE(WindowPos3ivARB)
-#define glWindowPos3iv MANGLE(WindowPos3iv)
-#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA)
-#define glWindowPos3sARB MANGLE(WindowPos3sARB)
-#define glWindowPos3s MANGLE(WindowPos3s)
-#define glWindowPos3sMESA MANGLE(WindowPos3sMESA)
-#define glWindowPos3svARB MANGLE(WindowPos3svARB)
-#define glWindowPos3sv MANGLE(WindowPos3sv)
-#define glWindowPos3svMESA MANGLE(WindowPos3svMESA)
-#define glWindowPos4dMESA MANGLE(WindowPos4dMESA)
-#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA)
-#define glWindowPos4fMESA MANGLE(WindowPos4fMESA)
-#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA)
-#define glWindowPos4iMESA MANGLE(WindowPos4iMESA)
-#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA)
-#define glWindowPos4sMESA MANGLE(WindowPos4sMESA)
-#define glWindowPos4svMESA MANGLE(WindowPos4svMESA)
-#define glWriteMaskEXT MANGLE(WriteMaskEXT)
-
-#endif /* GL_MANGLE_H */
diff --git a/nx-X11/extras/Mesa/include/GL/glfbdev.h b/nx-X11/extras/Mesa/include/GL/glfbdev.h
deleted file mode 100644
index 6af3ac314..000000000
--- a/nx-X11/extras/Mesa/include/GL/glfbdev.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef GLFBDEV_H
-#define GLFBDEV_H
-
-
-/* avoid including linux/fb.h */
-struct fb_fix_screeninfo;
-struct fb_var_screeninfo;
-
-
-/* public types */
-typedef struct GLFBDevVisualRec *GLFBDevVisualPtr;
-typedef struct GLFBDevBufferRec *GLFBDevBufferPtr;
-typedef struct GLFBDevContextRec *GLFBDevContextPtr;
-
-
-/* API version */
-#define GLFBDEV_VERSION_1_0 1
-
-
-/* For glFBDevCreateVisual */
-#define GLFBDEV_DOUBLE_BUFFER 100
-#define GLFBDEV_COLOR_INDEX 101
-#define GLFBDEV_DEPTH_SIZE 102
-#define GLFBDEV_STENCIL_SIZE 103
-#define GLFBDEV_ACCUM_SIZE 104
-#define GLFBDEV_LEVEL 105
-#define GLFBDEV_NONE 0
-
-/* For glFBDevGetString */
-#define GLFBDEV_VERSION 200
-#define GLFBDEV_VENDOR 201
-
-
-/* Misc functions */
-
-extern const char *
-glFBDevGetString( int str );
-
-
-typedef void (*GLFBDevProc)();
-
-
-extern const GLFBDevProc
-glFBDevGetProcAddress( const char *procName );
-
-
-
-/**
- * Create a GLFBDevVisual.
- * \param fixInfo - needed to get the visual types, etc.
- * \param varInfo - needed to get the bits_per_pixel, etc.
- * \param attribs - for requesting depth, stencil, accum buffers, etc.
- */
-extern GLFBDevVisualPtr
-glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
- const struct fb_var_screeninfo *varInfo,
- const int *attribs );
-
-extern void
-glFBDevDestroyVisual( GLFBDevVisualPtr visual );
-
-extern int
-glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib);
-
-
-
-/**
- * Create a GLFBDevBuffer.
- * \param fixInfo, varInfo - needed in order to get the screen size
- * (resolution), etc.
- * \param visual - as returned by glFBDevCreateVisual()
- * \param frontBuffer - address of front color buffer
- * \param backBuffer - address of back color buffer (may be NULL)
- * \param size - size of the color buffer(s) in bytes.
- */
-extern GLFBDevBufferPtr
-glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
- const struct fb_var_screeninfo *varInfo,
- const GLFBDevVisualPtr visual,
- void *frontBuffer, void *backBuffer, size_t size );
-
-extern void
-glFBDevDestroyBuffer( GLFBDevBufferPtr buffer );
-
-extern int
-glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib);
-
-extern GLFBDevBufferPtr
-glFBDevGetCurrentDrawBuffer( void );
-
-extern GLFBDevBufferPtr
-glFBDevGetCurrentReadBuffer( void );
-
-extern void
-glFBDevSwapBuffers( GLFBDevBufferPtr buffer );
-
-
-
-/**
- * Create a GLFBDevContext.
- * \param visual - as created by glFBDevCreateVisual.
- * \param share - specifies another context with which to share textures,
- * display lists, etc. (may be NULL).
- */
-extern GLFBDevContextPtr
-glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share );
-
-extern void
-glFBDevDestroyContext( GLFBDevContextPtr context );
-
-extern int
-glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib);
-
-extern GLFBDevContextPtr
-glFBDevGetCurrentContext( void );
-
-extern int
-glFBDevMakeCurrent( GLFBDevContextPtr context,
- GLFBDevBufferPtr drawBuffer,
- GLFBDevBufferPtr readBuffer );
-
-
-#endif /* GLFBDEV_H */
diff --git a/nx-X11/extras/Mesa/include/GL/glu.h b/nx-X11/extras/Mesa/include/GL/glu.h
deleted file mode 100644
index c0bac75a8..000000000
--- a/nx-X11/extras/Mesa/include/GL/glu.h
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#ifndef __glu_h__
-#define __glu_h__
-
-#if defined(USE_MGL_NAMESPACE)
-#include "glu_mangle.h"
-#endif
-
-#include <GL/gl.h>
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#ifndef GLAPIENTRYP
-#define GLAPIENTRYP GLAPIENTRY *
-#endif
-
-#ifndef GLAPI
-#define GLAPI
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*************************************************************/
-
-/* Extensions */
-#define GLU_EXT_object_space_tess 1
-#define GLU_EXT_nurbs_tessellator 1
-
-/* Boolean */
-#define GLU_FALSE 0
-#define GLU_TRUE 1
-
-/* Version */
-#define GLU_VERSION_1_1 1
-#define GLU_VERSION_1_2 1
-#define GLU_VERSION_1_3 1
-
-/* StringName */
-#define GLU_VERSION 100800
-#define GLU_EXTENSIONS 100801
-
-/* ErrorCode */
-#define GLU_INVALID_ENUM 100900
-#define GLU_INVALID_VALUE 100901
-#define GLU_OUT_OF_MEMORY 100902
-#define GLU_INCOMPATIBLE_GL_VERSION 100903
-#define GLU_INVALID_OPERATION 100904
-
-/* NurbsDisplay */
-/* GLU_FILL */
-#define GLU_OUTLINE_POLYGON 100240
-#define GLU_OUTLINE_PATCH 100241
-
-/* NurbsCallback */
-#define GLU_NURBS_ERROR 100103
-#define GLU_ERROR 100103
-#define GLU_NURBS_BEGIN 100164
-#define GLU_NURBS_BEGIN_EXT 100164
-#define GLU_NURBS_VERTEX 100165
-#define GLU_NURBS_VERTEX_EXT 100165
-#define GLU_NURBS_NORMAL 100166
-#define GLU_NURBS_NORMAL_EXT 100166
-#define GLU_NURBS_COLOR 100167
-#define GLU_NURBS_COLOR_EXT 100167
-#define GLU_NURBS_TEXTURE_COORD 100168
-#define GLU_NURBS_TEX_COORD_EXT 100168
-#define GLU_NURBS_END 100169
-#define GLU_NURBS_END_EXT 100169
-#define GLU_NURBS_BEGIN_DATA 100170
-#define GLU_NURBS_BEGIN_DATA_EXT 100170
-#define GLU_NURBS_VERTEX_DATA 100171
-#define GLU_NURBS_VERTEX_DATA_EXT 100171
-#define GLU_NURBS_NORMAL_DATA 100172
-#define GLU_NURBS_NORMAL_DATA_EXT 100172
-#define GLU_NURBS_COLOR_DATA 100173
-#define GLU_NURBS_COLOR_DATA_EXT 100173
-#define GLU_NURBS_TEXTURE_COORD_DATA 100174
-#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
-#define GLU_NURBS_END_DATA 100175
-#define GLU_NURBS_END_DATA_EXT 100175
-
-/* NurbsError */
-#define GLU_NURBS_ERROR1 100251
-#define GLU_NURBS_ERROR2 100252
-#define GLU_NURBS_ERROR3 100253
-#define GLU_NURBS_ERROR4 100254
-#define GLU_NURBS_ERROR5 100255
-#define GLU_NURBS_ERROR6 100256
-#define GLU_NURBS_ERROR7 100257
-#define GLU_NURBS_ERROR8 100258
-#define GLU_NURBS_ERROR9 100259
-#define GLU_NURBS_ERROR10 100260
-#define GLU_NURBS_ERROR11 100261
-#define GLU_NURBS_ERROR12 100262
-#define GLU_NURBS_ERROR13 100263
-#define GLU_NURBS_ERROR14 100264
-#define GLU_NURBS_ERROR15 100265
-#define GLU_NURBS_ERROR16 100266
-#define GLU_NURBS_ERROR17 100267
-#define GLU_NURBS_ERROR18 100268
-#define GLU_NURBS_ERROR19 100269
-#define GLU_NURBS_ERROR20 100270
-#define GLU_NURBS_ERROR21 100271
-#define GLU_NURBS_ERROR22 100272
-#define GLU_NURBS_ERROR23 100273
-#define GLU_NURBS_ERROR24 100274
-#define GLU_NURBS_ERROR25 100275
-#define GLU_NURBS_ERROR26 100276
-#define GLU_NURBS_ERROR27 100277
-#define GLU_NURBS_ERROR28 100278
-#define GLU_NURBS_ERROR29 100279
-#define GLU_NURBS_ERROR30 100280
-#define GLU_NURBS_ERROR31 100281
-#define GLU_NURBS_ERROR32 100282
-#define GLU_NURBS_ERROR33 100283
-#define GLU_NURBS_ERROR34 100284
-#define GLU_NURBS_ERROR35 100285
-#define GLU_NURBS_ERROR36 100286
-#define GLU_NURBS_ERROR37 100287
-
-/* NurbsProperty */
-#define GLU_AUTO_LOAD_MATRIX 100200
-#define GLU_CULLING 100201
-#define GLU_SAMPLING_TOLERANCE 100203
-#define GLU_DISPLAY_MODE 100204
-#define GLU_PARAMETRIC_TOLERANCE 100202
-#define GLU_SAMPLING_METHOD 100205
-#define GLU_U_STEP 100206
-#define GLU_V_STEP 100207
-#define GLU_NURBS_MODE 100160
-#define GLU_NURBS_MODE_EXT 100160
-#define GLU_NURBS_TESSELLATOR 100161
-#define GLU_NURBS_TESSELLATOR_EXT 100161
-#define GLU_NURBS_RENDERER 100162
-#define GLU_NURBS_RENDERER_EXT 100162
-
-/* NurbsSampling */
-#define GLU_OBJECT_PARAMETRIC_ERROR 100208
-#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
-#define GLU_OBJECT_PATH_LENGTH 100209
-#define GLU_OBJECT_PATH_LENGTH_EXT 100209
-#define GLU_PATH_LENGTH 100215
-#define GLU_PARAMETRIC_ERROR 100216
-#define GLU_DOMAIN_DISTANCE 100217
-
-/* NurbsTrim */
-#define GLU_MAP1_TRIM_2 100210
-#define GLU_MAP1_TRIM_3 100211
-
-/* QuadricDrawStyle */
-#define GLU_POINT 100010
-#define GLU_LINE 100011
-#define GLU_FILL 100012
-#define GLU_SILHOUETTE 100013
-
-/* QuadricCallback */
-/* GLU_ERROR */
-
-/* QuadricNormal */
-#define GLU_SMOOTH 100000
-#define GLU_FLAT 100001
-#define GLU_NONE 100002
-
-/* QuadricOrientation */
-#define GLU_OUTSIDE 100020
-#define GLU_INSIDE 100021
-
-/* TessCallback */
-#define GLU_TESS_BEGIN 100100
-#define GLU_BEGIN 100100
-#define GLU_TESS_VERTEX 100101
-#define GLU_VERTEX 100101
-#define GLU_TESS_END 100102
-#define GLU_END 100102
-#define GLU_TESS_ERROR 100103
-#define GLU_TESS_EDGE_FLAG 100104
-#define GLU_EDGE_FLAG 100104
-#define GLU_TESS_COMBINE 100105
-#define GLU_TESS_BEGIN_DATA 100106
-#define GLU_TESS_VERTEX_DATA 100107
-#define GLU_TESS_END_DATA 100108
-#define GLU_TESS_ERROR_DATA 100109
-#define GLU_TESS_EDGE_FLAG_DATA 100110
-#define GLU_TESS_COMBINE_DATA 100111
-
-/* TessContour */
-#define GLU_CW 100120
-#define GLU_CCW 100121
-#define GLU_INTERIOR 100122
-#define GLU_EXTERIOR 100123
-#define GLU_UNKNOWN 100124
-
-/* TessProperty */
-#define GLU_TESS_WINDING_RULE 100140
-#define GLU_TESS_BOUNDARY_ONLY 100141
-#define GLU_TESS_TOLERANCE 100142
-
-/* TessError */
-#define GLU_TESS_ERROR1 100151
-#define GLU_TESS_ERROR2 100152
-#define GLU_TESS_ERROR3 100153
-#define GLU_TESS_ERROR4 100154
-#define GLU_TESS_ERROR5 100155
-#define GLU_TESS_ERROR6 100156
-#define GLU_TESS_ERROR7 100157
-#define GLU_TESS_ERROR8 100158
-#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
-#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
-#define GLU_TESS_MISSING_END_POLYGON 100153
-#define GLU_TESS_MISSING_END_CONTOUR 100154
-#define GLU_TESS_COORD_TOO_LARGE 100155
-#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
-
-/* TessWinding */
-#define GLU_TESS_WINDING_ODD 100130
-#define GLU_TESS_WINDING_NONZERO 100131
-#define GLU_TESS_WINDING_POSITIVE 100132
-#define GLU_TESS_WINDING_NEGATIVE 100133
-#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
-
-/*************************************************************/
-
-
-#ifdef __cplusplus
-class GLUnurbs;
-class GLUquadric;
-class GLUtesselator;
-#else
-typedef struct GLUnurbs GLUnurbs;
-typedef struct GLUquadric GLUquadric;
-typedef struct GLUtesselator GLUtesselator;
-#endif
-
-typedef GLUnurbs GLUnurbsObj;
-typedef GLUquadric GLUquadricObj;
-typedef GLUtesselator GLUtesselatorObj;
-typedef GLUtesselator GLUtriangulatorObj;
-
-#define GLU_TESS_MAX_COORD 1.0e150
-
-/* Internal convenience typedefs */
-typedef void (GLAPIENTRYP _GLUfuncptr)();
-
-GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
-GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
-GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
-GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
-GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
-GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
-GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
-GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
-GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
-GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
-GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
-GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
-GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
-GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
-GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
-GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
-GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
-GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
-GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
-GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
-GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
-GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
-GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
-GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
-GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
-GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
-GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
-GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
-GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
-GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
-GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
-GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
-GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
-GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
-GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
-GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
-GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
-GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
-GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
-GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glu_h__ */
diff --git a/nx-X11/extras/Mesa/include/GL/glu_mangle.h b/nx-X11/extras/Mesa/include/GL/glu_mangle.h
deleted file mode 100644
index 9c25aa864..000000000
--- a/nx-X11/extras/Mesa/include/GL/glu_mangle.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 3.0
- * Copyright (C) 1995-1998 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-#ifndef GLU_MANGLE_H
-#define GLU_MANGLE_H
-
-
-#define gluLookAt mgluLookAt
-#define gluOrtho2D mgluOrtho2D
-#define gluPerspective mgluPerspective
-#define gluPickMatrix mgluPickMatrix
-#define gluProject mgluProject
-#define gluUnProject mgluUnProject
-#define gluErrorString mgluErrorString
-#define gluScaleImage mgluScaleImage
-#define gluBuild1DMipmaps mgluBuild1DMipmaps
-#define gluBuild2DMipmaps mgluBuild2DMipmaps
-#define gluNewQuadric mgluNewQuadric
-#define gluDeleteQuadric mgluDeleteQuadric
-#define gluQuadricDrawStyle mgluQuadricDrawStyle
-#define gluQuadricOrientation mgluQuadricOrientation
-#define gluQuadricNormals mgluQuadricNormals
-#define gluQuadricTexture mgluQuadricTexture
-#define gluQuadricCallback mgluQuadricCallback
-#define gluCylinder mgluCylinder
-#define gluSphere mgluSphere
-#define gluDisk mgluDisk
-#define gluPartialDisk mgluPartialDisk
-#define gluNewNurbsRenderer mgluNewNurbsRenderer
-#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
-#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
-#define gluNurbsProperty mgluNurbsProperty
-#define gluGetNurbsProperty mgluGetNurbsProperty
-#define gluBeginCurve mgluBeginCurve
-#define gluEndCurve mgluEndCurve
-#define gluNurbsCurve mgluNurbsCurve
-#define gluBeginSurface mgluBeginSurface
-#define gluEndSurface mgluEndSurface
-#define gluNurbsSurface mgluNurbsSurface
-#define gluBeginTrim mgluBeginTrim
-#define gluEndTrim mgluEndTrim
-#define gluPwlCurve mgluPwlCurve
-#define gluNurbsCallback mgluNurbsCallback
-#define gluNewTess mgluNewTess
-#define gluDeleteTess mgluDeleteTess
-#define gluTessBeginPolygon mgluTessBeginPolygon
-#define gluTessBeginContour mgluTessBeginContour
-#define gluTessVertex mgluTessVertex
-#define gluTessEndPolygon mgluTessEndPolygon
-#define gluTessEndContour mgluTessEndContour
-#define gluTessProperty mgluTessProperty
-#define gluTessNormal mgluTessNormal
-#define gluTessCallback mgluTessCallback
-#define gluGetTessProperty mgluGetTessProperty
-#define gluBeginPolygon mgluBeginPolygon
-#define gluNextContour mgluNextContour
-#define gluEndPolygon mgluEndPolygon
-#define gluGetString mgluGetString
-#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
-#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
-#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
-#define gluBuild3DMipmaps mgluBuild3DMipmaps
-#define gluCheckExtension mgluCheckExtension
-#define gluUnProject4 mgluUnProject4
-#define gluNurbsCallbackData mgluNurbsCallbackData
-#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/glut.h b/nx-X11/extras/Mesa/include/GL/glut.h
deleted file mode 100644
index 23c740ee1..000000000
--- a/nx-X11/extras/Mesa/include/GL/glut.h
+++ /dev/null
@@ -1,748 +0,0 @@
-#ifndef __glut_h__
-#define __glut_h__
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
-
-/* This program is freely distributable without licensing fees and is
- provided without guarantee or warrantee expressed or implied. This
- program is -not- in the public domain. */
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_WIN32)
-
-/* GLUT 3.7 now tries to avoid including <windows.h>
- to avoid name space pollution, but Win32's <GL/gl.h>
- needs APIENTRY and WINGDIAPI defined properly.
-
- tjump@spgs.com contributes:
- If users are building glut code on MS Windows, then they should
- make sure they include windows.h early, let's not get into a
- header definitions war since MS has proven it's capability to
- change header dependencies w/o publishing they have done so.
-
- So, let's not include windows.h here, as it's not really required and
- MS own gl/gl.h *should* include it if the dependency is there. */
-
-/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
- in your compile preprocessor options. */
-# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
-# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
-/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
- define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
-# ifdef GLUT_USE_SGI_OPENGL
-# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
-# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
-# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
-# else
-# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
-# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
-# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
-# endif
-# endif
-
-/* To disable supression of annoying warnings about floats being promoted
- to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
- options. */
-# ifndef GLUT_NO_WARNING_DISABLE
-# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
-# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
-# endif
-
-/* Win32 has an annoying issue where there are multiple C run-time
- libraries (CRTs). If the executable is linked with a different CRT
- from the GLUT DLL, the GLUT DLL will not share the same CRT static
- data seen by the executable. In particular, atexit callbacks registered
- in the executable will not be called if GLUT calls its (different)
- exit routine). GLUT is typically built with the
- "/MD" option (the CRT with multithreading DLL support), but the Visual
- C++ linker default is "/ML" (the single threaded CRT).
-
- One workaround to this issue is requiring users to always link with
- the same CRT as GLUT is compiled with. That requires users supply a
- non-standard option. GLUT 3.7 has its own built-in workaround where
- the executable's "exit" function pointer is covertly passed to GLUT.
- GLUT then calls the executable's exit function pointer to ensure that
- any "atexit" calls registered by the application are called if GLUT
- needs to exit.
-
- Note that the __glut*WithExit routines should NEVER be called directly.
- To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
-
-/* XXX This is from Win32's <process.h> */
-# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
- /* Define __cdecl for non-Microsoft compilers. */
-# define __cdecl
-# define GLUT_DEFINED___CDECL
-# endif
-# ifndef _CRTIMP
-# ifdef _NTSDK
- /* Definition compatible with NT SDK */
-# define _CRTIMP
-# else
- /* Current definition */
-# ifdef _DLL
-# define _CRTIMP __declspec(dllimport)
-# else
-# define _CRTIMP
-# endif
-# endif
-# define GLUT_DEFINED__CRTIMP
-# endif
-# ifndef GLUT_BUILDING_LIB
-extern _CRTIMP void __cdecl exit(int);
-# endif
-
-/* GLUT callback calling convention for Win32. */
-# define GLUTCALLBACK __cdecl
-
-/* for callback/function pointer defs */
-# define GLUTAPIENTRYV __cdecl
-
-/* glut-win32 specific macros, defined to prevent collision with
- and redifinition of Windows system defs, also removes requirement of
- pretty much any standard windows header from this file */
-
-#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
-# define GLUTAPIENTRY __stdcall
-#else
-# define GLUTAPIENTRY
-#endif
-
-/* GLUT API entry point declarations for Win32. */
-#if defined(GLUT_BUILDING_LIB) && defined(_DLL)
-# define GLUTAPI __declspec(dllexport)
-#elif defined(_DLL)
-# define GLUTAPI __declspec(dllimport)
-#else
-# define GLUTAPI extern
-#endif
-
-#if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA)
-# if !defined(MESA_MINWARN)
-# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
-# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
-# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
-# endif
-# define CALLBACK __stdcall
-typedef int (GLUTAPIENTRY *PROC)();
-typedef void *HGLRC;
-typedef void *HDC;
-typedef unsigned long COLORREF;
-#endif
-
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA)
-# if !defined(MESA_MINWARN)
-# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
-# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
-# pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" )
-# endif
-# define WGL_FONT_LINES 0
-# define WGL_FONT_POLYGONS 1
-# ifdef UNICODE
-# define wglUseFontBitmaps wglUseFontBitmapsW
-# define wglUseFontOutlines wglUseFontOutlinesW
-# else
-# define wglUseFontBitmaps wglUseFontBitmapsA
-# define wglUseFontOutlines wglUseFontOutlinesA
-# endif /* !UNICODE */
-typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
-typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
-# pragma warning( push )
-# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
-# define WGLAPI __declspec(dllimport)
-WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
-WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
-WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
-WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
-WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
-WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
-WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
-WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
-WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
-WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
-WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
-WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
-WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
-WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
-WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
-WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
-WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
-WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
-WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
-WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
-WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
-WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
-WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
-WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
-WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
-WGLAPI int GLAPIENTRY SwapBuffers(HDC);
-WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
-WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
-WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
-WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
-# undef WGLAPI
-# pragma warning( pop )
-#endif
-
-#else /* _WIN32 not defined */
-
-/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
-# define GLUTAPIENTRY GLAPIENTRY
-# define GLUTAPIENTRYV
-# define GLUTCALLBACK
-# define GLUTAPI extern
-
-#endif
-
-
-/**
- GLUT API revision history:
-
- GLUT_API_VERSION is updated to reflect incompatible GLUT
- API changes (interface changes, semantic changes, deletions,
- or additions).
-
- GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
-
- GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
- extension. Supports new input devices like tablet, dial and button
- box, and Spaceball. Easy to query OpenGL extensions.
-
- GLUT_API_VERSION=3 glutMenuStatus added.
-
- GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
- glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
- video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
- glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
- glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
-
- GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
-**/
-#ifndef GLUT_API_VERSION /* allow this to be overriden */
-#define GLUT_API_VERSION 5
-#endif
-
-/**
- GLUT implementation revision history:
-
- GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
- API revisions and implementation revisions (ie, bug fixes).
-
- GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
- GLUT Xlib-based implementation. 11/29/94
-
- GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
- GLUT Xlib-based implementation providing GLUT version 2
- interfaces.
-
- GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
-
- GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
-
- GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
-
- GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
-
- GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
- and video resize. 1/3/97
-
- GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
-
- GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
-
- GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
-
- GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
-
- GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
-
- GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
-**/
-#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
-#define GLUT_XLIB_IMPLEMENTATION 15
-#endif
-
-/* Display mode bit masks. */
-#define GLUT_RGB 0
-#define GLUT_RGBA GLUT_RGB
-#define GLUT_INDEX 1
-#define GLUT_SINGLE 0
-#define GLUT_DOUBLE 2
-#define GLUT_ACCUM 4
-#define GLUT_ALPHA 8
-#define GLUT_DEPTH 16
-#define GLUT_STENCIL 32
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_MULTISAMPLE 128
-#define GLUT_STEREO 256
-#endif
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_LUMINANCE 512
-#endif
-
-/* Mouse buttons. */
-#define GLUT_LEFT_BUTTON 0
-#define GLUT_MIDDLE_BUTTON 1
-#define GLUT_RIGHT_BUTTON 2
-
-/* Mouse button state. */
-#define GLUT_DOWN 0
-#define GLUT_UP 1
-
-#if (GLUT_API_VERSION >= 2)
-/* function keys */
-#define GLUT_KEY_F1 1
-#define GLUT_KEY_F2 2
-#define GLUT_KEY_F3 3
-#define GLUT_KEY_F4 4
-#define GLUT_KEY_F5 5
-#define GLUT_KEY_F6 6
-#define GLUT_KEY_F7 7
-#define GLUT_KEY_F8 8
-#define GLUT_KEY_F9 9
-#define GLUT_KEY_F10 10
-#define GLUT_KEY_F11 11
-#define GLUT_KEY_F12 12
-/* directional keys */
-#define GLUT_KEY_LEFT 100
-#define GLUT_KEY_UP 101
-#define GLUT_KEY_RIGHT 102
-#define GLUT_KEY_DOWN 103
-#define GLUT_KEY_PAGE_UP 104
-#define GLUT_KEY_PAGE_DOWN 105
-#define GLUT_KEY_HOME 106
-#define GLUT_KEY_END 107
-#define GLUT_KEY_INSERT 108
-#endif
-
-/* Entry/exit state. */
-#define GLUT_LEFT 0
-#define GLUT_ENTERED 1
-
-/* Menu usage state. */
-#define GLUT_MENU_NOT_IN_USE 0
-#define GLUT_MENU_IN_USE 1
-
-/* Visibility state. */
-#define GLUT_NOT_VISIBLE 0
-#define GLUT_VISIBLE 1
-
-/* Window status state. */
-#define GLUT_HIDDEN 0
-#define GLUT_FULLY_RETAINED 1
-#define GLUT_PARTIALLY_RETAINED 2
-#define GLUT_FULLY_COVERED 3
-
-/* Color index component selection values. */
-#define GLUT_RED 0
-#define GLUT_GREEN 1
-#define GLUT_BLUE 2
-
-/* Layers for use. */
-#define GLUT_NORMAL 0
-#define GLUT_OVERLAY 1
-
-#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN ((void*)0)
-#define GLUT_STROKE_MONO_ROMAN ((void*)1)
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 ((void*)2)
-#define GLUT_BITMAP_8_BY_13 ((void*)3)
-#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
-#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
-#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
-#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
-#endif
-#else
-/* Stroke font opaque addresses (use constants instead in source code). */
-GLUTAPI void *glutStrokeRoman;
-GLUTAPI void *glutStrokeMonoRoman;
-
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
-#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
-
-/* Bitmap font opaque addresses (use constants instead in source code). */
-GLUTAPI void *glutBitmap9By15;
-GLUTAPI void *glutBitmap8By13;
-GLUTAPI void *glutBitmapTimesRoman10;
-GLUTAPI void *glutBitmapTimesRoman24;
-GLUTAPI void *glutBitmapHelvetica10;
-GLUTAPI void *glutBitmapHelvetica12;
-GLUTAPI void *glutBitmapHelvetica18;
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
-#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
-#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
-#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
-#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
-#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
-#endif
-#endif
-
-/* glutGet parameters. */
-#define GLUT_WINDOW_X 100
-#define GLUT_WINDOW_Y 101
-#define GLUT_WINDOW_WIDTH 102
-#define GLUT_WINDOW_HEIGHT 103
-#define GLUT_WINDOW_BUFFER_SIZE 104
-#define GLUT_WINDOW_STENCIL_SIZE 105
-#define GLUT_WINDOW_DEPTH_SIZE 106
-#define GLUT_WINDOW_RED_SIZE 107
-#define GLUT_WINDOW_GREEN_SIZE 108
-#define GLUT_WINDOW_BLUE_SIZE 109
-#define GLUT_WINDOW_ALPHA_SIZE 110
-#define GLUT_WINDOW_ACCUM_RED_SIZE 111
-#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
-#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
-#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
-#define GLUT_WINDOW_DOUBLEBUFFER 115
-#define GLUT_WINDOW_RGBA 116
-#define GLUT_WINDOW_PARENT 117
-#define GLUT_WINDOW_NUM_CHILDREN 118
-#define GLUT_WINDOW_COLORMAP_SIZE 119
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_WINDOW_NUM_SAMPLES 120
-#define GLUT_WINDOW_STEREO 121
-#endif
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_WINDOW_CURSOR 122
-#endif
-#define GLUT_SCREEN_WIDTH 200
-#define GLUT_SCREEN_HEIGHT 201
-#define GLUT_SCREEN_WIDTH_MM 202
-#define GLUT_SCREEN_HEIGHT_MM 203
-#define GLUT_MENU_NUM_ITEMS 300
-#define GLUT_DISPLAY_MODE_POSSIBLE 400
-#define GLUT_INIT_WINDOW_X 500
-#define GLUT_INIT_WINDOW_Y 501
-#define GLUT_INIT_WINDOW_WIDTH 502
-#define GLUT_INIT_WINDOW_HEIGHT 503
-#define GLUT_INIT_DISPLAY_MODE 504
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_ELAPSED_TIME 700
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-#define GLUT_WINDOW_FORMAT_ID 123
-#endif
-
-#if (GLUT_API_VERSION >= 2)
-/* glutDeviceGet parameters. */
-#define GLUT_HAS_KEYBOARD 600
-#define GLUT_HAS_MOUSE 601
-#define GLUT_HAS_SPACEBALL 602
-#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
-#define GLUT_HAS_TABLET 604
-#define GLUT_NUM_MOUSE_BUTTONS 605
-#define GLUT_NUM_SPACEBALL_BUTTONS 606
-#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
-#define GLUT_NUM_DIALS 608
-#define GLUT_NUM_TABLET_BUTTONS 609
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
-#define GLUT_DEVICE_KEY_REPEAT 611
-#define GLUT_HAS_JOYSTICK 612
-#define GLUT_OWNS_JOYSTICK 613
-#define GLUT_JOYSTICK_BUTTONS 614
-#define GLUT_JOYSTICK_AXES 615
-#define GLUT_JOYSTICK_POLL_RATE 616
-#endif
-
-#if (GLUT_API_VERSION >= 3)
-/* glutLayerGet parameters. */
-#define GLUT_OVERLAY_POSSIBLE 800
-#define GLUT_LAYER_IN_USE 801
-#define GLUT_HAS_OVERLAY 802
-#define GLUT_TRANSPARENT_INDEX 803
-#define GLUT_NORMAL_DAMAGED 804
-#define GLUT_OVERLAY_DAMAGED 805
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-/* glutVideoResizeGet parameters. */
-#define GLUT_VIDEO_RESIZE_POSSIBLE 900
-#define GLUT_VIDEO_RESIZE_IN_USE 901
-#define GLUT_VIDEO_RESIZE_X_DELTA 902
-#define GLUT_VIDEO_RESIZE_Y_DELTA 903
-#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
-#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
-#define GLUT_VIDEO_RESIZE_X 906
-#define GLUT_VIDEO_RESIZE_Y 907
-#define GLUT_VIDEO_RESIZE_WIDTH 908
-#define GLUT_VIDEO_RESIZE_HEIGHT 909
-#endif
-
-/* glutUseLayer parameters. */
-#define GLUT_NORMAL 0
-#define GLUT_OVERLAY 1
-
-/* glutGetModifiers return mask. */
-#define GLUT_ACTIVE_SHIFT 1
-#define GLUT_ACTIVE_CTRL 2
-#define GLUT_ACTIVE_ALT 4
-
-/* glutSetCursor parameters. */
-/* Basic arrows. */
-#define GLUT_CURSOR_RIGHT_ARROW 0
-#define GLUT_CURSOR_LEFT_ARROW 1
-/* Symbolic cursor shapes. */
-#define GLUT_CURSOR_INFO 2
-#define GLUT_CURSOR_DESTROY 3
-#define GLUT_CURSOR_HELP 4
-#define GLUT_CURSOR_CYCLE 5
-#define GLUT_CURSOR_SPRAY 6
-#define GLUT_CURSOR_WAIT 7
-#define GLUT_CURSOR_TEXT 8
-#define GLUT_CURSOR_CROSSHAIR 9
-/* Directional cursors. */
-#define GLUT_CURSOR_UP_DOWN 10
-#define GLUT_CURSOR_LEFT_RIGHT 11
-/* Sizing cursors. */
-#define GLUT_CURSOR_TOP_SIDE 12
-#define GLUT_CURSOR_BOTTOM_SIDE 13
-#define GLUT_CURSOR_LEFT_SIDE 14
-#define GLUT_CURSOR_RIGHT_SIDE 15
-#define GLUT_CURSOR_TOP_LEFT_CORNER 16
-#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
-#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
-#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
-/* Inherit from parent window. */
-#define GLUT_CURSOR_INHERIT 100
-/* Blank cursor. */
-#define GLUT_CURSOR_NONE 101
-/* Fullscreen crosshair (if available). */
-#define GLUT_CURSOR_FULL_CROSSHAIR 102
-#endif
-
-/* GLUT initialization sub-API. */
-GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
-#define glutInit glutInit_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
-#endif
-GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
-GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
-GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
-
-/* GLUT window sub-API. */
-GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
-#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
-GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
-GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
-GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
-#endif
-GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
-GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
-GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
-GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
-GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
-GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
-GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
-GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
-GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
-GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
-GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
-GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
-GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
-#endif
-
-/* GLUT overlay sub-API. */
-GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
-GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
-GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
-GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
-GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
-#endif
-GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
-GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
-#endif
-
-/* GLUT menu sub-API. */
-GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
-#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
-GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
-GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
-GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
-GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
-GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
-GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
-GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
-GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
-GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
-
-/* GLUT window callback sub-API. */
-GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
-GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
-GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
-GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
-GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
-GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
-GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
-GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
-GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
-#if (GLUT_API_VERSION >= 2)
-GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
-GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
-GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
-GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
-GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
-GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
-GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
-GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
-GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
-GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
-#endif
-#endif
-#endif
-
-/* GLUT color index sub-API. */
-GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
-GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
-GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
-
-/* GLUT state retrieval sub-API. */
-GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
-GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
-#if (GLUT_API_VERSION >= 2)
-/* GLUT extension support sub-API */
-GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
-#endif
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
-GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
-#endif
-#if (GLUT_API_VERSION >= 5)
-typedef void (*GLUTproc)();
-GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
-#endif
-
-/* GLUT font sub-API */
-GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
-GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
-GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
-GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
-GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
-#endif
-
-/* GLUT pre-built models sub-API */
-GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
-GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
-GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
-GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
-GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
-GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
-GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
-GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
-GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
-GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
-GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
-GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-/* GLUT video resize sub-API. */
-GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
-GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
-GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
-GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
-GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
-
-/* GLUT debugging sub-API. */
-GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
-#endif
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-/* GLUT device control sub-API. */
-/* glutSetKeyRepeat modes. */
-#define GLUT_KEY_REPEAT_OFF 0
-#define GLUT_KEY_REPEAT_ON 1
-#define GLUT_KEY_REPEAT_DEFAULT 2
-
-/* Joystick button masks. */
-#define GLUT_JOYSTICK_BUTTON_A 1
-#define GLUT_JOYSTICK_BUTTON_B 2
-#define GLUT_JOYSTICK_BUTTON_C 4
-#define GLUT_JOYSTICK_BUTTON_D 8
-
-GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
-GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
-GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
-
-/* GLUT game mode sub-API. */
-/* glutGameModeGet. */
-#define GLUT_GAME_MODE_ACTIVE 0
-#define GLUT_GAME_MODE_POSSIBLE 1
-#define GLUT_GAME_MODE_WIDTH 2
-#define GLUT_GAME_MODE_HEIGHT 3
-#define GLUT_GAME_MODE_PIXEL_DEPTH 4
-#define GLUT_GAME_MODE_REFRESH_RATE 5
-#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
-
-GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
-GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
-GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
-GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glut_h__ */
diff --git a/nx-X11/extras/Mesa/include/GL/glut_h.dja b/nx-X11/extras/Mesa/include/GL/glut_h.dja
deleted file mode 100644
index e76dcb985..000000000
--- a/nx-X11/extras/Mesa/include/GL/glut_h.dja
+++ /dev/null
@@ -1,340 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- * Copyright (C) 1995-1998 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-/*
- * This header file is based on the REAL glut.h by Mark J. Kilgard.
- *
- * The DJGPP/ALLEGRO (DJA) GLUT implementation was written by
- * Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose
- * of compiling all the sample programs (which use GLUT). Therefore,
- * is NOT AT ALL a complete version of GLUT!
- */
-
-
-#ifndef __AGLUT_H__
-#define __AGLUT_H__
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#define GLUTCALLBACK
-#define APIENTRY
-#define GLUTAPI extern
-
-#define GLUT_RGB 0
-#define GLUT_RGBA GLUT_RGB
-#define GLUT_INDEX 1
-#define GLUT_SINGLE 0
-#define GLUT_DOUBLE 2
-#define GLUT_ACCUM 4
-#define GLUT_ALPHA 8
-#define GLUT_DEPTH 16
-#define GLUT_STENCIL 32
-
-/* Mouse buttons. */
-#define GLUT_LEFT_BUTTON 0
-#define GLUT_MIDDLE_BUTTON 1
-#define GLUT_RIGHT_BUTTON 2
-
-/* Mouse button state. */
-#define GLUT_DOWN 0
-#define GLUT_UP 1
-
-/* function keys */
-#define GLUT_KEY_F1 1
-#define GLUT_KEY_F2 2
-#define GLUT_KEY_F3 3
-#define GLUT_KEY_F4 4
-#define GLUT_KEY_F5 5
-#define GLUT_KEY_F6 6
-#define GLUT_KEY_F7 7
-#define GLUT_KEY_F8 8
-#define GLUT_KEY_F9 9
-#define GLUT_KEY_F10 10
-#define GLUT_KEY_F11 11
-#define GLUT_KEY_F12 12
-
-/* directional keys */
-#define GLUT_KEY_LEFT 100
-#define GLUT_KEY_UP 101
-#define GLUT_KEY_RIGHT 102
-#define GLUT_KEY_DOWN 103
-#define GLUT_KEY_PAGE_UP 104
-#define GLUT_KEY_PAGE_DOWN 105
-#define GLUT_KEY_HOME 106
-#define GLUT_KEY_END 107
-#define GLUT_KEY_INSERT 108
-
-/* Entry/exit state. */
-#define GLUT_LEFT 0
-#define GLUT_ENTERED 1
-
-/* Visibility state. */
-#define GLUT_NOT_VISIBLE 0
-#define GLUT_VISIBLE 1
-
-/* Color index component selection values. */
-#define GLUT_RED 0
-#define GLUT_GREEN 1
-#define GLUT_BLUE 2
-
-/* Layers for use. */
-#define GLUT_NORMAL 0
-#define GLUT_OVERLAY 1
-
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN ((void*)0)
-#define GLUT_STROKE_MONO_ROMAN ((void*)1)
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 ((void*)2)
-#define GLUT_BITMAP_8_BY_13 ((void*)3)
-#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
-#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
-#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
-#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
-#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
-
-/* glutGet parameters. */
-#define GLUT_WINDOW_X 100
-#define GLUT_WINDOW_Y 101
-#define GLUT_WINDOW_WIDTH 102
-#define GLUT_WINDOW_HEIGHT 103
-#define GLUT_WINDOW_BUFFER_SIZE 104
-#define GLUT_WINDOW_STENCIL_SIZE 105
-#define GLUT_WINDOW_DEPTH_SIZE 106
-#define GLUT_WINDOW_RED_SIZE 107
-#define GLUT_WINDOW_GREEN_SIZE 108
-#define GLUT_WINDOW_BLUE_SIZE 109
-#define GLUT_WINDOW_ALPHA_SIZE 110
-#define GLUT_WINDOW_ACCUM_RED_SIZE 111
-#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
-#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
-#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
-#define GLUT_WINDOW_DOUBLEBUFFER 115
-#define GLUT_WINDOW_RGBA 116
-#define GLUT_WINDOW_PARENT 117
-#define GLUT_WINDOW_NUM_CHILDREN 118
-#define GLUT_WINDOW_COLORMAP_SIZE 119
-#define GLUT_WINDOW_NUM_SAMPLES 120
-#define GLUT_WINDOW_STEREO 121
-#define GLUT_WINDOW_CURSOR 122
-#define GLUT_SCREEN_WIDTH 200
-#define GLUT_SCREEN_HEIGHT 201
-#define GLUT_SCREEN_WIDTH_MM 202
-#define GLUT_SCREEN_HEIGHT_MM 203
-#define GLUT_MENU_NUM_ITEMS 300
-#define GLUT_DISPLAY_MODE_POSSIBLE 400
-#define GLUT_INIT_WINDOW_X 500
-#define GLUT_INIT_WINDOW_Y 501
-#define GLUT_INIT_WINDOW_WIDTH 502
-#define GLUT_INIT_WINDOW_HEIGHT 503
-#define GLUT_INIT_DISPLAY_MODE 504
-#define GLUT_ELAPSED_TIME 700
-#define GLUT_WINDOW_FORMAT_ID 123
-
-/* glutDeviceGet parameters. */
-#define GLUT_HAS_KEYBOARD 600
-#define GLUT_HAS_MOUSE 601
-#define GLUT_HAS_SPACEBALL 602
-#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
-#define GLUT_HAS_TABLET 604
-#define GLUT_NUM_MOUSE_BUTTONS 605
-#define GLUT_NUM_SPACEBALL_BUTTONS 606
-#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
-#define GLUT_NUM_DIALS 608
-#define GLUT_NUM_TABLET_BUTTONS 609
-#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
-#define GLUT_DEVICE_KEY_REPEAT 611
-#define GLUT_HAS_JOYSTICK 612
-#define GLUT_OWNS_JOYSTICK 613
-#define GLUT_JOYSTICK_BUTTONS 614
-#define GLUT_JOYSTICK_AXES 615
-#define GLUT_JOYSTICK_POLL_RATE 616
-
-/* glutLayerGet parameters. */
-#define GLUT_OVERLAY_POSSIBLE 800
-#define GLUT_LAYER_IN_USE 801
-#define GLUT_HAS_OVERLAY 802
-#define GLUT_TRANSPARENT_INDEX 803
-#define GLUT_NORMAL_DAMAGED 804
-#define GLUT_OVERLAY_DAMAGED 805
-
-/* glutVideoResizeGet parameters. */
-#define GLUT_VIDEO_RESIZE_POSSIBLE 900
-#define GLUT_VIDEO_RESIZE_IN_USE 901
-#define GLUT_VIDEO_RESIZE_X_DELTA 902
-#define GLUT_VIDEO_RESIZE_Y_DELTA 903
-#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
-#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
-#define GLUT_VIDEO_RESIZE_X 906
-#define GLUT_VIDEO_RESIZE_Y 907
-#define GLUT_VIDEO_RESIZE_WIDTH 908
-#define GLUT_VIDEO_RESIZE_HEIGHT 909
-
-/* glutUseLayer parameters. */
-#define GLUT_NORMAL 0
-#define GLUT_OVERLAY 1
-
-/* glutGetModifiers return mask. */
-#define GLUT_ACTIVE_SHIFT 1
-#define GLUT_ACTIVE_CTRL 2
-#define GLUT_ACTIVE_ALT 4
-
-/* glutSetCursor parameters. */
-/* Basic arrows. */
-#define GLUT_CURSOR_RIGHT_ARROW 0
-#define GLUT_CURSOR_LEFT_ARROW 1
-/* Symbolic cursor shapes. */
-#define GLUT_CURSOR_INFO 2
-#define GLUT_CURSOR_DESTROY 3
-#define GLUT_CURSOR_HELP 4
-#define GLUT_CURSOR_CYCLE 5
-#define GLUT_CURSOR_SPRAY 6
-#define GLUT_CURSOR_WAIT 7
-#define GLUT_CURSOR_TEXT 8
-#define GLUT_CURSOR_CROSSHAIR 9
-/* Directional cursors. */
-#define GLUT_CURSOR_UP_DOWN 10
-#define GLUT_CURSOR_LEFT_RIGHT 11
-/* Sizing cursors. */
-#define GLUT_CURSOR_TOP_SIDE 12
-#define GLUT_CURSOR_BOTTOM_SIDE 13
-#define GLUT_CURSOR_LEFT_SIDE 14
-#define GLUT_CURSOR_RIGHT_SIDE 15
-#define GLUT_CURSOR_TOP_LEFT_CORNER 16
-#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
-#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
-#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
-/* Inherit from parent window. */
-#define GLUT_CURSOR_INHERIT 100
-/* Blank cursor. */
-#define GLUT_CURSOR_NONE 101
-/* Fullscreen crosshair (if available). */
-#define GLUT_CURSOR_FULL_CROSSHAIR 102
-
-/* GLUT initialization sub-API. */
-GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
-GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
-GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
-GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
-GLUTAPI void APIENTRY glutMainLoop(void);
-
-/* GLUT window sub-API. */
-GLUTAPI int APIENTRY glutCreateWindow(const char *title);
-GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
-GLUTAPI void APIENTRY glutDestroyWindow(int win);
-GLUTAPI void APIENTRY glutPostRedisplay(void);
-GLUTAPI void APIENTRY glutSwapBuffers(void);
-GLUTAPI int APIENTRY glutGetWindow(void);
-GLUTAPI void APIENTRY glutSetWindow(int win);
-GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
-GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
-GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
-GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
-GLUTAPI void APIENTRY glutPopWindow(void);
-GLUTAPI void APIENTRY glutPushWindow(void);
-GLUTAPI void APIENTRY glutIconifyWindow(void);
-GLUTAPI void APIENTRY glutShowWindow(void);
-GLUTAPI void APIENTRY glutHideWindow(void);
-
-/* GLUT overlay sub-API. */
-GLUTAPI void APIENTRY glutEstablishOverlay(void);
-GLUTAPI void APIENTRY glutRemoveOverlay(void);
-GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
-GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
-GLUTAPI void APIENTRY glutShowOverlay(void);
-GLUTAPI void APIENTRY glutHideOverlay(void);
-
-/* GLUT menu sub-API. */
-GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int));
-GLUTAPI void APIENTRY glutDestroyMenu(int menu);
-GLUTAPI int APIENTRY glutGetMenu(void);
-GLUTAPI void APIENTRY glutSetMenu(int menu);
-GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
-GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
-GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
-GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
-GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
-GLUTAPI void APIENTRY glutAttachMenu(int button);
-GLUTAPI void APIENTRY glutDetachMenu(int button);
-
-/* GLUT window callback sub-API. */
-GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void));
-GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height));
-GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
-GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
-GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
-GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
-GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state));
-GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state));
-GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void));
-GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value);
-GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state));
-GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
-GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state));
-GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state));
-GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value));
-GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
-GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
-GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y));
-GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void));
-GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state));
-
-/* GLUT color index sub-API. */
-GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
-GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
-GLUTAPI void APIENTRY glutCopyColormap(int win);
-
-/* GLUT state retrieval sub-API. */
-GLUTAPI int APIENTRY glutGet(GLenum type);
-GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
-
-/* GLUT font sub-API */
-GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
-GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
-
-/* GLUT pre-built models sub-API */
-GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCube(GLdouble size);
-GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
-GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutWireDodecahedron(void);
-GLUTAPI void APIENTRY glutSolidDodecahedron(void);
-GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutWireOctahedron(void);
-GLUTAPI void APIENTRY glutSolidOctahedron(void);
-GLUTAPI void APIENTRY glutWireTetrahedron(void);
-GLUTAPI void APIENTRY glutSolidTetrahedron(void);
-GLUTAPI void APIENTRY glutWireIcosahedron(void);
-GLUTAPI void APIENTRY glutSolidIcosahedron(void);
-
-#endif /* __AGLUT_H__ */
diff --git a/nx-X11/extras/Mesa/include/GL/glutf90.h b/nx-X11/extras/Mesa/include/GL/glutf90.h
deleted file mode 100644
index 7ba3e19ef..000000000
--- a/nx-X11/extras/Mesa/include/GL/glutf90.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef __glutf90_h__
-#define __glutf90_h__
-
-/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */
-
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
- implied. This program is -not- in the public domain. */
-
-/* This header provides the binding interface for William Mitchell's
- f90gl Fortran 90 GLUT binding. Other GLUT language bindings
- can and should use this interace. */
-
-/* I appreciate the guidance from William Mitchell
- (mitchell@cam.nist.gov) in developing this friend interface
- for use by the f90gl package. See ../../README.fortran */
-
-#include <GL/glut.h>
-
-/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */
-/* NOTE These values are part of a binary interface for the f90gl Fortran
- 90 binding and so must NOT changes (additions are allowed). */
-
-/* GLUTwindow callbacks. */
-#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */
-#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */
-#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */
-#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */
-#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */
-#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */
-#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */
-#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */
-#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */
-#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */
-#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */
-#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */
-#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */
-#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */
-#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */
-#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */
-#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */
-#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */
-#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */
-#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */
-/* Non-GLUTwindow callbacks. */
-#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */
-#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */
-#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */
-
-/* GLUT Fortran callback function types. */
-typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void);
-typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *);
-/* NOTE the pressed key is int, not unsigned char for Fortran! */
-typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *);
-typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *);
-typedef void (GLUTCALLBACK *GLUTentryFCB) (int *);
-typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *);
-typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *);
-typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *);
-typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *);
-typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *);
-typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *);
-typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z);
-
-typedef void (GLUTCALLBACK *GLUTselectFCB) (int *);
-typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *);
-typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */
-typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *);
-typedef void (GLUTCALLBACK *GLUTidleFCB) (void);
-
-/* Functions that set and return Fortran callback functions. */
-GLUTAPI void* APIENTRY __glutGetFCB(int which);
-GLUTAPI void APIENTRY __glutSetFCB(int which, void *func);
-
-#endif /* __glutf90_h__ */
diff --git a/nx-X11/extras/Mesa/include/GL/glx.h b/nx-X11/extras/Mesa/include/GL/glx.h
deleted file mode 100644
index ab0467c18..000000000
--- a/nx-X11/extras/Mesa/include/GL/glx.h
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef GLX_H
-#define GLX_H
-
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-# ifdef __cplusplus
-/* VMS Xlib.h gives problems with C++.
- * this avoids a bunch of trivial warnings */
-#pragma message disable nosimpint
-#endif
-#endif
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#ifdef __VMS
-# ifdef __cplusplus
-#pragma message enable nosimpint
-#endif
-#endif
-#include <GL/gl.h>
-
-
-#if defined(USE_MGL_NAMESPACE)
-#include "glx_mangle.h"
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define GLX_VERSION_1_1 1
-#define GLX_VERSION_1_2 1
-#define GLX_VERSION_1_3 1
-#define GLX_VERSION_1_4 1
-
-#define GLX_EXTENSION_NAME "GLX"
-
-
-
-/*
- * Tokens for glXChooseVisual and glXGetConfig:
- */
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-
-
-/*
- * Error codes returned by glXGetConfig:
- */
-#define GLX_BAD_SCREEN 1
-#define GLX_BAD_ATTRIBUTE 2
-#define GLX_NO_EXTENSION 3
-#define GLX_BAD_VISUAL 4
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-
-/*
- * GLX 1.1 and later:
- */
-#define GLX_VENDOR 1
-#define GLX_VERSION 2
-#define GLX_EXTENSIONS 3
-
-
-/*
- * GLX 1.3 and later:
- */
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_DONT_CARE 0xFFFFFFFF
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_AUX_BUFFERS_BIT 0x00000010
-#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_VISUAL_ID 0x800B
-#define GLX_SCREEN 0x800C
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_PBUFFER_HEIGHT 0x8040
-#define GLX_PBUFFER_WIDTH 0x8041
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-
-
-/*
- * GLX 1.4 and later:
- */
-#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
-#define GLX_SAMPLES 0x186a1 /*100001*/
-
-
-
-typedef struct __GLXcontextRec *GLXContext;
-typedef XID GLXPixmap;
-typedef XID GLXDrawable;
-/* GLX 1.3 and later */
-typedef struct __GLXFBConfigRec *GLXFBConfig;
-typedef XID GLXFBConfigID;
-typedef XID GLXContextID;
-typedef XID GLXWindow;
-typedef XID GLXPbuffer;
-
-
-
-extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
- int *attribList );
-
-extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
- GLXContext shareList, Bool direct );
-
-extern void glXDestroyContext( Display *dpy, GLXContext ctx );
-
-extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
- GLXContext ctx);
-
-extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
- unsigned long mask );
-
-extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
-
-extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap );
-
-extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
-
-extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
-
-extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
-
-extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
-
-extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
- int attrib, int *value );
-
-extern GLXContext glXGetCurrentContext( void );
-
-extern GLXDrawable glXGetCurrentDrawable( void );
-
-extern void glXWaitGL( void );
-
-extern void glXWaitX( void );
-
-extern void glXUseXFont( Font font, int first, int count, int list );
-
-
-
-/* GLX 1.1 and later */
-extern const char *glXQueryExtensionsString( Display *dpy, int screen );
-
-extern const char *glXQueryServerString( Display *dpy, int screen, int name );
-
-extern const char *glXGetClientString( Display *dpy, int name );
-
-
-/* GLX 1.2 and later */
-extern Display *glXGetCurrentDisplay( void );
-
-
-/* GLX 1.3 and later */
-extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
- const int *attribList, int *nitems );
-
-extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
- int attribute, int *value );
-
-extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
- int *nelements );
-
-extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
- GLXFBConfig config );
-
-extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
- Window win, const int *attribList );
-
-extern void glXDestroyWindow( Display *dpy, GLXWindow window );
-
-extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
- Pixmap pixmap, const int *attribList );
-
-extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
-
-extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
- const int *attribList );
-
-extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
-
-extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
- unsigned int *value );
-
-extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
- int renderType, GLXContext shareList,
- Bool direct );
-
-extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
- GLXDrawable read, GLXContext ctx );
-
-extern GLXDrawable glXGetCurrentReadDrawable( void );
-
-extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
- int *value );
-
-extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
- unsigned long mask );
-
-extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
- unsigned long *mask );
-
-
-/* GLX 1.4 and later */
-extern void (*glXGetProcAddress(const GLubyte *procname))( void );
-
-
-#ifndef GLX_GLXEXT_LEGACY
-
-#include <GL/glxext.h>
-
-#else
-
-
-/*
- * 28. GLX_EXT_visual_info extension
- */
-#ifndef GLX_EXT_visual_info
-#define GLX_EXT_visual_info 1
-
-#define GLX_X_VISUAL_TYPE_EXT 0x22
-#define GLX_TRANSPARENT_TYPE_EXT 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
-#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
-#define GLX_TRUE_COLOR_EXT 0x8002
-#define GLX_DIRECT_COLOR_EXT 0x8003
-#define GLX_PSEUDO_COLOR_EXT 0x8004
-#define GLX_STATIC_COLOR_EXT 0x8005
-#define GLX_GRAY_SCALE_EXT 0x8006
-#define GLX_STATIC_GRAY_EXT 0x8007
-#define GLX_NONE_EXT 0x8000
-#define GLX_TRANSPARENT_RGB_EXT 0x8008
-#define GLX_TRANSPARENT_INDEX_EXT 0x8009
-
-#endif /* 28. GLX_EXT_visual_info extension */
-
-
-
-/*
- * 41. GLX_SGI_video_sync
- */
-#ifndef GLX_SGI_video_sync
-#define GLX_SGI_video_sync 1
-
-extern int glXGetVideoSyncSGI(unsigned int *count);
-extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
-
-#endif /* GLX_SGI_video_sync */
-
-
-
-/*
- * 42. GLX_EXT_visual_rating
- */
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating 1
-
-#define GLX_VISUAL_CAVEAT_EXT 0x20
-/*#define GLX_NONE_EXT 0x8000*/
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-
-#endif /* GLX_EXT_visual_rating */
-
-
-
-/*
- * 47. GLX_EXT_import_context
- */
-#ifndef GLX_EXT_import_context
-#define GLX_EXT_import_context 1
-
-#define GLX_SHARE_CONTEXT_EXT 0x800A
-#define GLX_VISUAL_ID_EXT 0x800B
-#define GLX_SCREEN_EXT 0x800C
-
-extern void glXFreeContextEXT(Display *dpy, GLXContext context);
-
-extern GLXContextID glXGetContextIDEXT(const GLXContext context);
-
-extern Display *glXGetCurrentDisplayEXT(void);
-
-extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
-
-extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
- int attribute,int *value);
-
-#endif /* GLX_EXT_import_context */
-
-
-
-/*
- * 215. GLX_MESA_copy_sub_buffer
- */
-#ifndef GLX_MESA_copy_sub_buffer
-#define GLX_MESA_copy_sub_buffer 1
-
-extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height );
-
-#endif
-
-
-
-/*
- * 216. GLX_MESA_pixmap_colormap
- */
-#ifndef GLX_MESA_pixmap_colormap
-#define GLX_MESA_pixmap_colormap 1
-
-extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap, Colormap cmap );
-
-#endif /* GLX_MESA_pixmap_colormap */
-
-
-
-/*
- * 217. GLX_MESA_release_buffers
- */
-#ifndef GLX_MESA_release_buffers
-#define GLX_MESA_release_buffers 1
-
-extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
-
-#endif /* GLX_MESA_release_buffers */
-
-
-
-/*
- * 218. GLX_MESA_set_3dfx_mode
- */
-#ifndef GLX_MESA_set_3dfx_mode
-#define GLX_MESA_set_3dfx_mode 1
-
-#define GLX_3DFX_WINDOW_MODE_MESA 0x1
-#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
-
-extern Bool glXSet3DfxModeMESA( int mode );
-
-#endif /* GLX_MESA_set_3dfx_mode */
-
-
-
-/*
- * ARB 2. GLX_ARB_get_proc_address
- */
-#ifndef GLX_ARB_get_proc_address
-#define GLX_ARB_get_proc_address 1
-
-extern void (*glXGetProcAddressARB(const GLubyte *procName))();
-
-#endif /* GLX_ARB_get_proc_address */
-
-
-
-#endif /* GLX_GLXEXT_LEGACY */
-
-
-/**
- ** The following aren't in glxext.h yet.
- **/
-
-
-/*
- * ???. GLX_NV_vertex_array_range
- */
-#ifndef GLX_NV_vertex_array_range
-#define GLX_NV_vertex_array_range
-
-extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-extern void glXFreeMemoryNV(GLvoid *pointer);
-typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
-
-#endif /* GLX_NV_vertex_array_range */
-
-
-
-/*
- * ???. GLX_MESA_agp_offset
- */
-#ifndef GLX_MESA_agp_offset
-#define GLX_MESA_agp_offset 1
-
-extern GLuint glXGetAGPOffsetMESA(const GLvoid *pointer);
-typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer);
-
-#endif /* GLX_MESA_agp_offset */
-
-
-/*
- * ???. GLX_MESA_allocate_memory
- */
-#ifndef GLX_MESA_allocate_memory
-#define GLX_MESA_allocate_memory 1
-
-extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
-extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
-extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
-typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
-typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
-typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
-
-#endif /* GLX_MESA_allocate_memory */
-
-/*
- * ARB ?. GLX_ARB_render_texture
- */
-#ifndef GLX_ARB_render_texture
-#define GLX_ARB_render_texture 1
-
-extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
-extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
-extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
-
-#endif /* GLX_ARB_render_texture */
-
-
-/*
- * Remove this when glxext.h is updated.
- */
-#ifndef GLX_NV_float_buffer
-#define GLX_NV_float_buffer 1
-
-#define GLX_FLOAT_COMPONENTS_NV 0x20B0
-
-#endif /* GLX_NV_float_buffer */
-
-
-/*** Should these go here, or in another header? */
-/*
-** GLX Events
-*/
-typedef struct {
- int event_type; /* GLX_DAMAGED or GLX_SAVED */
- int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came for SendEvent request */
- Display *display; /* display the event was read from */
- GLXDrawable drawable; /* XID of Drawable */
- unsigned int buffer_mask; /* mask indicating which buffers are affected */
- unsigned int aux_buffer; /* which aux buffer was affected */
- int x, y;
- int width, height;
- int count; /* if nonzero, at least this many more */
-} GLXPbufferClobberEvent;
-
-typedef union __GLXEvent {
- GLXPbufferClobberEvent glxpbufferclobber;
- long pad[24];
-} GLXEvent;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/glx_mangle.h b/nx-X11/extras/Mesa/include/GL/glx_mangle.h
deleted file mode 100644
index d0b47d94e..000000000
--- a/nx-X11/extras/Mesa/include/GL/glx_mangle.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.1
- * Copyright (C) 1995-1998 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-#ifndef GLX_MANGLE_H
-#define GLX_MANGLE_H
-
-#define glXChooseVisual mglXChooseVisual
-#define glXCreateContext mglXCreateContext
-#define glXDestroyContext mglXDestroyContext
-#define glXMakeCurrent mglXMakeCurrent
-#define glXCopyContext mglXCopyContext
-#define glXSwapBuffers mglXSwapBuffers
-#define glXCreateGLXPixmap mglXCreateGLXPixmap
-#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
-#define glXQueryExtension mglXQueryExtension
-#define glXQueryVersion mglXQueryVersion
-#define glXIsDirect mglXIsDirect
-#define glXGetConfig mglXGetConfig
-#define glXGetCurrentContext mglXGetCurrentContext
-#define glXGetCurrentDrawable mglXGetCurrentDrawable
-#define glXWaitGL mglXWaitGL
-#define glXWaitX mglXWaitX
-#define glXUseXFont mglXUseXFont
-#define glXQueryExtensionsString mglXQueryExtensionsString
-#define glXQueryServerString mglXQueryServerString
-#define glXGetClientString mglXGetClientString
-#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
-#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
-#define glXCopySubBufferMESA mglXCopySubBufferMESA
-#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
-#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
-
-/* GLX 1.4 */
-#define glXGetProcAddress mglXGetProcAddress
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/internal/dri_interface.h b/nx-X11/extras/Mesa/include/GL/internal/dri_interface.h
deleted file mode 100644
index 0f3555b57..000000000
--- a/nx-X11/extras/Mesa/include/GL/internal/dri_interface.h
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file dri_interface.h
- *
- * This file contains all the types and functions that define the interface
- * between a DRI driver and driver loader. Currently, the most common driver
- * loader is the XFree86 libGL.so. However, other loaders do exist, and in
- * the future the server-side libglx.a will also be a loader.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#ifndef DRI_INTERFACE_H
-#define DRI_INTERFACE_H
-
-#include <GL/internal/glcore.h>
-#include <drm.h>
-
-/**
- * \name DRI interface structures
- *
- * The following structures define the interface between the GLX client
- * side library and the DRI (direct rendering infrastructure).
- */
-/*@{*/
-typedef struct __DRIdisplayRec __DRIdisplay;
-typedef struct __DRIscreenRec __DRIscreen;
-typedef struct __DRIcontextRec __DRIcontext;
-typedef struct __DRIdrawableRec __DRIdrawable;
-typedef struct __DRIdriverRec __DRIdriver;
-typedef struct __DRIframebufferRec __DRIframebuffer;
-typedef struct __DRIversionRec __DRIversion;
-typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
-typedef unsigned long __DRIid;
-typedef void __DRInativeDisplay;
-/*@}*/
-
-
-/**
- * \name Functions provided by the driver loader.
- */
-/*@{*/
-/**
- * Type of a pointer to \c glXGetScreenDriver, as returned by
- * \c glXGetProcAddress. This function is used to get the name of the DRI
- * driver for the specified screen of the specified display. The driver
- * name is typically used with \c glXGetDriverConfig.
- *
- * \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig
- */
-typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
-
-/**
- * Type of a pointer to \c glXGetDriverConfig, as returned by
- * \c glXGetProcAddress. This function is used to get the XML document
- * describing the configuration options available for the specified driver.
- *
- * \sa glXGetDriverConfig, glXGetProcAddress, glXGetScreenDriver
- */
-typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
-
-/**
- * Type of a pointer to \c glxEnableExtension, as returned by
- * \c __DRIinterfaceMethods::getProcAddress. This function is used to enable
- * a GLX extension on the specified screen.
- */
-typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
-/*@}*/
-
-
-/**
- * \name Functions and data provided by the driver.
- */
-/*@{*/
-
-typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
- __DRIscreen *psc, const __GLcontextModes * modes,
- const __DRIversion * ddx_version, const __DRIversion * dri_version,
- const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
- void * pSAREA, int fd, int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes);
-typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
-extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
-
-
-/**
- * XML document describing the configuration options supported by the
- * driver.
- */
-extern const char __driConfigOptions[];
-
-/*@}*/
-
-
-/**
- * Stored version of some component (i.e., server-side DRI module, kernel-side
- * DRM, etc.).
- *
- * \todo
- * There are several data structures that explicitly store a major version,
- * minor version, and patch level. These structures should be modified to
- * have a \c __DRIversionRec instead.
- */
-struct __DRIversionRec {
- int major; /**< Major version number. */
- int minor; /**< Minor version number. */
- int patch; /**< Patch-level. */
-};
-
-
-typedef void (*__DRIfuncPtr)(void);
-
-struct __DRIinterfaceMethodsRec {
- /**
- * Get pointer to named function.
- */
- __DRIfuncPtr (*getProcAddress)( const char * proc_name );
-
- /**
- * Create a list of \c __GLcontextModes structures.
- */
- __GLcontextModes * (*createContextModes)(unsigned count,
- size_t minimum_bytes_per_struct);
-
- /**
- * Destroy a list of \c __GLcontextModes structures.
- *
- * \todo
- * Determine if the drivers actually need to call this.
- */
- void (*destroyContextModes)( __GLcontextModes * modes );
-
- /**
- * Get the \c __DRIscreen for a given display and screen number.
- */
- __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
-
-
- /**
- * \name Client/server protocol functions.
- *
- * These functions implement the DRI client/server protocol for
- * context and drawable operations. Platforms that do not implement
- * the wire protocol (e.g., EGL) will implement glorified no-op functions.
- */
- /*@{*/
- /**
- * Determine if the specified window ID still exists.
- *
- * \note
- * Implementations may assume that the driver will only pass an ID into
- * this function that actually corresponds to a window. On
- * implementations where windows can only be destroyed by the DRI driver
- * (e.g., EGL), this function is allowed to always return \c GL_TRUE.
- */
- GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
-
- /**
- * Create the server-side portion of the GL context.
- */
- GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
- int configID, void * contextID, drm_context_t * hw_context );
-
- /**
- * Destroy the server-side portion of the GL context.
- */
- GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
- __DRIid context );
-
- /**
- * Create the server-side portion of the drawable.
- */
- GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable, drm_drawable_t * hHWDrawable );
-
- /**
- * Destroy the server-side portion of the drawable.
- */
- GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable );
-
- /**
- * This function is used to get information about the position, size, and
- * clip rects of a drawable.
- */
- GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
- __DRIid draw, unsigned int * index, unsigned int * stamp,
- int * x, int * y, int * width, int * height,
- int * numClipRects, drm_clip_rect_t ** pClipRects,
- int * backX, int * backY,
- int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
- /*@}*/
-
-
- /**
- * \name Timing related functions.
- */
- /*@{*/
- /**
- * Get the 64-bit unadjusted system time (UST).
- */
- int (*getUST)(int64_t * ust);
-
- /**
- * Get the media stream counter (MSC) rate.
- *
- * Matching the definition in GLX_OML_sync_control, this function returns
- * the rate of the "media stream counter". In practical terms, this is
- * the frame refresh rate of the display.
- */
- GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
- int32_t * numerator, int32_t * denominator);
- /*@}*/
-};
-
-
-/**
- * Framebuffer information record. Used by libGL to communicate information
- * about the framebuffer to the driver's \c __driCreateNewScreen function.
- *
- * In XFree86, most of this information is derrived from data returned by
- * calling \c XF86DRIGetDeviceInfo.
- *
- * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
- * __driUtilCreateNewScreen CallCreateNewScreen
- *
- * \bug This structure could be better named.
- */
-struct __DRIframebufferRec {
- unsigned char *base; /**< Framebuffer base address in the CPU's
- * address space. This value is calculated by
- * calling \c drmMap on the framebuffer handle
- * returned by \c XF86DRIGetDeviceInfo (or a
- * similar function).
- */
- int size; /**< Framebuffer size, in bytes. */
- int stride; /**< Number of bytes from one line to the next. */
- int width; /**< Pixel width of the framebuffer. */
- int height; /**< Pixel height of the framebuffer. */
- int dev_priv_size; /**< Size of the driver's dev-priv structure. */
- void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
-};
-
-
-/**
- * Screen dependent methods. This structure is initialized during the
- * \c __DRIdisplayRec::createScreen call.
- */
-struct __DRIscreenRec {
- /**
- * Method to destroy the private DRI screen data.
- */
- void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
-
- /**
- * Method to create the private DRI drawable data and initialize the
- * drawable dependent methods.
- */
- void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
- __DRIid draw, __DRIdrawable *pdraw,
- int renderType, const int *attrs);
-
- /**
- * Method to return a pointer to the DRI drawable data.
- */
- __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw,
- void *drawablePrivate);
-
- /**
- * Opaque pointer to private per screen direct rendering data. \c NULL
- * if direct rendering is not supported on this screen. Never
- * dereferenced in libGL.
- */
- void *private;
-
- /**
- * Get the number of vertical refreshes since some point in time before
- * this function was first called (i.e., system start up).
- *
- * \since Internal API version 20030317.
- */
- int (*getMSC)( void *screenPrivate, int64_t *msc );
-
- /**
- * Opaque pointer that points back to the containing
- * \c __GLXscreenConfigs. This data structure is shared with DRI drivers
- * but \c __GLXscreenConfigs is not. However, they are needed by some GLX
- * functions called by DRI drivers.
- *
- * \since Internal API version 20030813.
- */
- void *screenConfigs;
-
- /**
- * Functions associated with MESA_allocate_memory.
- *
- * \since Internal API version 20030815.
- */
- /*@{*/
- void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
- GLfloat readfreq, GLfloat writefreq,
- GLfloat priority);
-
- void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
-
- GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
- /*@}*/
-
- /**
- * Method to create the private DRI context data and initialize the
- * context dependent methods.
- *
- * \since Internal API version 20031201.
- */
- void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
- int render_type,
- void *sharedPrivate, __DRIcontext *pctx);
-};
-
-/**
- * Context dependent methods. This structure is initialized during the
- * \c __DRIscreenRec::createContext call.
- */
-struct __DRIcontextRec {
- /**
- * Method to destroy the private DRI context data.
- */
- void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
-
- /**
- * Opaque pointer to private per context direct rendering data.
- * \c NULL if direct rendering is not supported on the display or
- * screen used to create this context. Never dereferenced in libGL.
- */
- void *private;
-
- /**
- * Pointer to the mode used to create this context.
- *
- * \since Internal API version 20040317.
- */
- const __GLcontextModes * mode;
-
- /**
- * Method to bind a DRI drawable to a DRI graphics context.
- *
- * \since Internal API version 20050727.
- */
- GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
- __DRIid read, __DRIcontext *ctx);
-
- /**
- * Method to unbind a DRI drawable from a DRI graphics context.
- *
- * \since Internal API version 20050727.
- */
- GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
- __DRIid read, __DRIcontext *ctx);
-};
-
-/**
- * Drawable dependent methods. This structure is initialized during the
- * \c __DRIscreenRec::createDrawable call. \c createDrawable is not called
- * by libGL at this time. It's currently used via the dri_util.c utility code
- * instead.
- */
-struct __DRIdrawableRec {
- /**
- * Method to destroy the private DRI drawable data.
- */
- void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
-
- /**
- * Method to swap the front and back buffers.
- */
- void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
-
- /**
- * Opaque pointer to private per drawable direct rendering data.
- * \c NULL if direct rendering is not supported on the display or
- * screen used to create this drawable. Never dereferenced in libGL.
- */
- void *private;
-
- /**
- * Get the number of completed swap buffers for this drawable.
- *
- * \since Internal API version 20030317.
- */
- int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
-
- /**
- * Wait for the SBC to be greater than or equal target_sbc.
- *
- * \since Internal API version 20030317.
- */
- int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
- int64_t target_sbc,
- int64_t * msc, int64_t * sbc );
-
- /**
- * Wait for the MSC to equal target_msc, or, if that has already passed,
- * the next time (MSC % divisor) is equal to remainder. If divisor is
- * zero, the function will return as soon as MSC is greater than or equal
- * to target_msc.
- *
- * \since Internal API version 20030317.
- */
- int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
- int64_t target_msc, int64_t divisor, int64_t remainder,
- int64_t * msc, int64_t * sbc );
-
- /**
- * Like \c swapBuffers, but does NOT have an implicit \c glFlush. Once
- * rendering is complete, waits until MSC is equal to target_msc, or
- * if that has already passed, waits until (MSC % divisor) is equal
- * to remainder. If divisor is zero, the swap will happen as soon as
- * MSC is greater than or equal to target_msc.
- *
- * \since Internal API version 20030317.
- */
- int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
- int64_t target_msc,
- int64_t divisor, int64_t remainder);
-
- /**
- * Enable or disable frame usage tracking.
- *
- * \since Internal API version 20030317.
- */
- int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable);
-
- /**
- * Retrieve frame usage information.
- *
- * \since Internal API version 20030317.
- */
- int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
- int64_t * sbc, int64_t * missedFrames,
- float * lastMissedUsage, float * usage );
-
- /**
- * Used by drivers that implement the GLX_SGI_swap_control or
- * GLX_MESA_swap_control extension.
- *
- * \since Internal API version 20030317.
- */
- unsigned swap_interval;
-};
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/internal/sarea.h b/nx-X11/extras/Mesa/include/GL/internal/sarea.h
deleted file mode 100644
index 77c16e0ef..000000000
--- a/nx-X11/extras/Mesa/include/GL/internal/sarea.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
-/**
- * \file sarea.h
- * SAREA definitions.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Jens Owen <jens@tungstengraphics.com>
- * \author Rickard E. (Rik) Faith <faith@valinux.com>
- */
-
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL 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.
- */
-
-/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
-
-#ifndef _SAREA_H_
-#define _SAREA_H_
-
-#include "xf86drm.h"
-
-/* SAREA area needs to be at least a page */
-#if defined(__alpha__)
-#define SAREA_MAX 0x2000
-#elif defined(__ia64__)
-#define SAREA_MAX 0x10000 /* 64kB */
-#else
-/* Intel 830M driver needs at least 8k SAREA */
-#define SAREA_MAX 0x2000
-#endif
-
-#define SAREA_MAX_DRAWABLES 256
-
-#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
-
-/**
- * SAREA per drawable information.
- *
- * \sa _XF86DRISAREA.
- */
-typedef struct _XF86DRISAREADrawable {
- unsigned int stamp;
- unsigned int flags;
-} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
-
-/**
- * SAREA frame information.
- *
- * \sa _XF86DRISAREA.
- */
-typedef struct _XF86DRISAREAFrame {
- unsigned int x;
- unsigned int y;
- unsigned int width;
- unsigned int height;
- unsigned int fullscreen;
-} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
-
-/**
- * SAREA definition.
- */
-typedef struct _XF86DRISAREA {
- /** first thing is always the DRM locking structure */
- drmLock lock;
- /** \todo Use readers/writer lock for drawable_lock */
- drmLock drawable_lock;
- XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
- XF86DRISAREAFrameRec frame;
- drm_context_t dummy_context;
-} XF86DRISAREARec, *XF86DRISAREAPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/mesa_wgl.h b/nx-X11/extras/Mesa/include/GL/mesa_wgl.h
deleted file mode 100644
index 21473763e..000000000
--- a/nx-X11/extras/Mesa/include/GL/mesa_wgl.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/* prototypes for the Mesa WGL functions */
-/* relocated here so that I could make GLUT get them properly */
-
-#define _mesa_wgl_h_
-
-#ifndef _mesa_wgl_h_
-#define _mesa_wgl_h_
-
-
-#include <GL/gl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
-# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
-# define GLAPI __declspec(dllexport)
-# define WGLAPI __declspec(dllexport)
-# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
-# define GLAPI __declspec(dllimport)
-# define WGLAPI __declspec(dllimport)
-# else /* for use with static link lib build of Win32 edition only */
-# define GLAPI extern
-# define WGLAPI __declspec(dllimport)
-# endif /* _STATIC_MESA support */
-# define GLAPIENTRY __stdcall
-#else
-/* non-Windows compilation */
-# define GLAPI extern
-# define GLAPIENTRY
-#endif /* WIN32 / CYGWIN32 bracket */
-
-
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
-#ifndef _GNU_H_WINDOWS32_FUNCTIONS
-# ifdef UNICODE
-# define wglUseFontBitmaps wglUseFontBitmapsW
-# define wglUseFontOutlines wglUseFontOutlinesW
-# else
-# define wglUseFontBitmaps wglUseFontBitmapsA
-# define wglUseFontOutlines wglUseFontOutlinesA
-# endif /* !UNICODE */
-#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
-typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
-typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
-typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
-#endif
-
-
-#ifdef _MSC_VER
-# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
-# pragma warning( push )
-# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
-#endif
-
-WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
-WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
-WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
-WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
-WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
-WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
-WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
-WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
-WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
-WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
-WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
-WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
-WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
-WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
-WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
-WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
-WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
-WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
-WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
-WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
-WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
-WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
-WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
-WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
-WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
-WGLAPI int GLAPIENTRY SwapBuffers(HDC);
-WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
-WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
-WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
-WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
-
-#ifdef _MSC_VER
-# pragma warning( pop )
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _mesa_wgl_h_ */
diff --git a/nx-X11/extras/Mesa/include/GL/mglmesa.h b/nx-X11/extras/Mesa/include/GL/mglmesa.h
deleted file mode 100644
index d9ba61c17..000000000
--- a/nx-X11/extras/Mesa/include/GL/mglmesa.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-*
-* Mesa bindings for SciTech MGL
-*
-* Copyright (C) 1996 SciTech Software.
-* All rights reserved.
-*
-* Filename: mglmesa.h
-* Version: Revision: 1.1.1.1
-*
-* Language: ANSI C
-* Environment: Any
-*
-* Description: Header file for the Mesa/OpenGL interface bindings for the
-* SciTech MGL graphics library. Uses the MGL internal
-* device context structures to get direct access to the
-* high performance MGL rasterization functions for maximum
-* performance. Utilizes the VESA VBE/AF Accelerator Functions
-* via the MGL's accelerated device driver functions, as well
-* as basic DirectDraw accelerated functions provided by the
-* MGL.
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Library General Public
-* License as published by the Free Software Foundation; either
-* version 2 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Library General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public
-* License along with this library; if not, write to the Free
-* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*
-****************************************************************************/
-
-#ifndef __MGLMESA_H
-#define __MGLMESA_H
-
-#include "mgraph.h"
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef __cplusplus
-extern "C" { /* Use "C" linkage when in C++ mode */
-#endif
-
-#ifndef __WINDOWS__
-#define GLAPIENTRY
-#endif
-
-#ifdef __WINDOWS__
-bool GLAPIENTRY MGLMesaInitDLL(MGLCallbacks *cb,char *version);
-#endif
-void GLAPIENTRY MGLMesaChooseVisual(MGLDC *dc,MGLVisual *visual);
-bool GLAPIENTRY MGLMesaSetVisual(MGLDC *dc,MGLVisual *visual);
-bool GLAPIENTRY MGLMesaCreateContext(MGLDC *dc,bool forceMemDC);
-void GLAPIENTRY MGLMesaDestroyContext(MGLDC *dc);
-void GLAPIENTRY MGLMesaMakeCurrent(MGLDC *dc);
-void GLAPIENTRY MGLMesaSwapBuffers(MGLDC *dc,bool waitVRT);
-
-/* Palette manipulation support. The reason we provide palette manipulation
- * routines is so that when rendering in double buffered modes with a
- * software backbuffer, the palette for the backbuffer is kept consistent
- * with the hardware front buffer.
- */
-
-void GLAPIENTRY MGLMesaSetPaletteEntry(MGLDC *dc,int entry,uchar red,uchar green,uchar blue);
-void GLAPIENTRY MGLMesaSetPalette(MGLDC *dc,palette_t *pal,int numColors,int startIndex);
-void GLAPIENTRY MGLMesaRealizePalette(MGLDC *dc,int numColors,int startIndex,int waitVRT);
-
-#ifdef __cplusplus
-} /* End of "C" linkage for C++ */
-#endif /* __cplusplus */
-
-#endif /* __MGLMESA_H */
diff --git a/nx-X11/extras/Mesa/include/GL/miniglx.h b/nx-X11/extras/Mesa/include/GL/miniglx.h
deleted file mode 100644
index 8c6180be6..000000000
--- a/nx-X11/extras/Mesa/include/GL/miniglx.h
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file miniglx.h
- * \brief Mini GLX interface functions.
- * \author Brian Paul
- *
- * See comments miniglx.c for more information.
- */
-
-#ifndef MINIGLX_H
-#define MINIGLX_H
-
-#include <GL/gl.h>
-#include <stdlib.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * \name Replacement Xlib/GLX types
- */
-/*@{*/
-/**
- * \brief Boolean type.
- *
- * It can have the values #True or #False.
- */
-#ifndef MINIGLX_NO_XTYPES
-typedef int Bool;
-#endif
-typedef int MINI_Bool;
-
-/**
- * \brief Color map.
- *
- * Alias for private ::MiniGLXColormapRec structure.
- */
-typedef struct MiniGLXColormapRec *MINI_Colormap;
-#ifndef MINIGLX_NO_XTYPES
-typedef struct MiniGLXColormapRec *Colormap;
-#endif
-
-/**
- * \brief Window attributes.
- */
-typedef struct MiniGLXSetWindowAttributesRec {
- int background_pixel; /**< \brief background pixel */
- int border_pixel; /**< \brief border pixel value */
- MINI_Colormap colormap; /**< \brief color map to be associated with window */
- int event_mask; /**< \brief set of events that should be saved */
-} XSetWindowAttributes;
-
-/**
- * \brief Visual.
- *
- * Alias for the private ::MiniGLXVisualRec structure.
- *
- * \sa \ref datatypes.
- */
-typedef struct MiniGLXVisualRec Visual;
-
-/**
- * \brief Visual information.
- *
- * \sa \ref datatypes.
- */
-#ifndef MINIGLX_NO_XTYPES
-typedef unsigned long VisualID;
-#endif
-typedef unsigned long MINI_VisualID;
-typedef struct MiniGLXXVisualInfoRec {
- Visual *visual; /**< \brief pointer to the GLX Visual */
- MINI_VisualID visualid; /**< \brief visual ID */
- int screen; /**< \brief screen number */
- int depth; /**< \brief bit depth */
-#if defined(__cplusplus) || defined(c_plusplus)
- int c_class; /**< \brief class */
-#else
- int class; /**< \brief class */
-#endif
- int bits_per_rgb; /**< \brief total bits per pixel */
-} XVisualInfo;
-
-/**
- * \brief GLX Frame Buffer Configuration (for pbuffers)
- * \sa \ref datatypes.
- */
-typedef struct MiniGLXFBConfigRec {
- XVisualInfo *visInfo;
-} GLXFBConfig;
-
-
-/**
- * \brief Display handle.
- *
- * Alias for the private ::MiniGLXDisplayRec structure.
- *
- * \sa \ref datatypes.
- */
-#ifndef MINIGLX_NO_XTYPES
-typedef struct MiniGLXDisplayRec Display;
-#endif
-typedef struct MiniGLXDisplayRec MINI_Display;
-
-/**
- * \brief Window handle.
- *
- * Alias for the private ::MiniGLXWindowRec structure.
- *
- * \sa \ref datatypes.
- */
-#ifndef MINIGLX_NO_XTYPES
-typedef struct MiniGLXWindowRec *Window;
-#endif
-typedef struct MiniGLXWindowRec *MINI_Window;
-
-/**
- * \brief Drawable.
- *
- * Alias for the private ::MiniGLXWindowRec structure.
- *
- * For Mini GLX only the full-screen window can be used as source and
- * destination in graphics operations.
- *
- * \sa \ref datatypes.
- */
-#ifndef MINIGLX_NO_XTYPES
-typedef struct MiniGLXWindowRec *Drawable;
-#endif
-typedef struct MiniGLXWindowRec *MINI_Drawable;
-
-/**
- * \brief GLX drawable.
- *
- * Alias for the private ::MiniGLXWindowRec structure.
- *
- * Same as #Drawable.
- *
- * \sa \ref datatypes.
- */
-typedef struct MiniGLXWindowRec *GLXDrawable;
-
-/**
- * \brief GLX pbuffer.
- *
- * Alias for the private ::MiniGLXWindowRec structure.
- *
- * Same as #Drawable.
- *
- * \sa \ref datatypes.
- */
-typedef struct MiniGLXWindowRec *GLXPbuffer;
-
-/**
- * \brief GLX context.
- *
- * Alias for the private ::MiniGLXContext structure.
- *
- * \sa \ref datatypes.
- */
-typedef struct MiniGLXContextRec *GLXContext;
-/*@}*/
-
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- MINI_Bool send_event; /* true if this came from a SendEvent request */
- MINI_Display *display; /* Display the event was read from */
- MINI_Window window;
- int x, y;
- int width, height;
- int count; /* if non-zero, at least this many more */
-} XExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- MINI_Bool send_event; /* true if this came from a SendEvent request */
- MINI_Display *display; /* Display the event was read from */
- MINI_Window parent; /* parent of the window */
- MINI_Window window; /* window id of window created */
- int x, y; /* window location */
- int width, height; /* size of window */
- int border_width; /* border width */
- MINI_Bool override_redirect; /* creation should be overridden */
-} XCreateWindowEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- MINI_Bool send_event; /* true if this came from a SendEvent request */
- MINI_Display *display; /* Display the event was read from */
- MINI_Window event;
- MINI_Window window;
-} XDestroyWindowEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- MINI_Bool send_event; /* true if this came from a SendEvent request */
- MINI_Display *display; /* Display the event was read from */
- MINI_Window event;
- MINI_Window window;
- MINI_Bool from_configure;
-} XUnmapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- MINI_Bool send_event; /* true if this came from a SendEvent request */
- MINI_Display *display; /* Display the event was read from */
- MINI_Window event;
- MINI_Window window;
- MINI_Bool override_redirect; /* boolean, is override set... */
-} XMapEvent;
-
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- MINI_Bool send_event; /* true if this came from a SendEvent request */
- MINI_Display *display; /* Display the event was read from */
- MINI_Window parent;
- MINI_Window window;
-} XMapRequestEvent;
-
-typedef union _XEvent {
- int type; /* must not be changed; first element */
- XExposeEvent xexpose;
- XCreateWindowEvent xcreatewindow;
- XDestroyWindowEvent xdestroywindow;
- XUnmapEvent xunmap;
- XMapEvent xmap;
- XMapRequestEvent xmaprequest;
- long pad[24];
-} XEvent;
-
-
-/**
- * \name Xlib constants
- */
-/*@{*/
-#define False 0
-#define True 1
-#define None 0
-#define AllocNone 0
-#define InputOutput 1
-#define ExposureMask (1L<<15)
-#define StructureNotifyMask (1L<<17)
-#define CWBackPixel (1L<<1)
-#define CWBorderPixel (1L<<3)
-#define CWEventMask (1L<<11)
-#define CWColormap (1L<<13)
-#define PseudoColor 3
-#define TrueColor 4
-#define VisualIDMask 0x1
-#define VisualScreenMask 0x2
-#define Expose 12
-#define CreateNotify 16
-#define DestroyNotify 17
-#define UnmapNotify 18
-#define MapNotify 19
-#define MapRequest 20
-
-/*@}*/
-
-/**
- * \name Standard GLX tokens
- */
-/*@{*/
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-#define GLX_BAD_ATTRIBUTE 1
-#define GLX_BAD_VISUAL 4
-/*@}*/
-
-
-/**
- * \name Unique to Mini GLX
- *
- * At compile time, the Mini GLX interface version can be tested with the
- * MINI_GLX_VERSION_1_x preprocessor tokens.
- *
- * \sa glXQueryVersion()
- */
-/*@{*/
-/** \brief Defined if version 1.0 of Mini GLX is supported. */
-#define MINI_GLX_VERSION_1_0 1
-/** \brief Defined if version 1.1 of Mini GLX is supported. */
-#define MINI_GLX_VERSION_1_1 1
-/*@}*/
-
-
-/**
- * \name Server-specific functions
- */
-extern MINI_Display *
-__miniglx_StartServer( const char *display_name );
-
-extern int
-__miniglx_Select( MINI_Display *dpy, int maxfd,
- fd_set *rfds, fd_set *wfds, fd_set *xfds,
- struct timeval *tv );
-
-
-/**
- * \name Simulated Xlib functions
- */
-/*@{*/
-extern MINI_Display *
-XOpenDisplay( const char *dpy_name );
-
-
-extern void
-XCloseDisplay( MINI_Display *display );
-
-extern MINI_Window
-XCreateWindow( MINI_Display *display, MINI_Window parent, int x, int y,
- unsigned int width, unsigned int height,
- unsigned int border_width, int depth, unsigned int winclass,
- Visual *visual, unsigned long valuemask,
- XSetWindowAttributes *attributes );
-
-extern int
-XNextEvent(MINI_Display *display, XEvent *event_return);
-
-extern MINI_Bool
-XCheckMaskEvent( MINI_Display *dpy, long event_mask, XEvent *event_return );
-
-/**
- * \brief Return the root window.
- *
- * \param display the display handle. It is ignored by Mini GLX, but should be
- * the value returned by XOpenDisplay().
- * \param screen the screen number on the host server. It is ignored by Mini
- * GLX but should be zero.
- *
- * \return the root window. Always zero on Mini GLX.
- */
-#define RootWindow(display, screen) 0
-#define DefaultScreen(dpy) 0
-
-extern void
-XDestroyWindow( MINI_Display *display, MINI_Window w );
-
-extern void
-XMapWindow( MINI_Display *display, MINI_Window w );
-
-/* Should clients have access to this?
- */
-extern void
-XUnmapWindow( MINI_Display *display, MINI_Window w );
-
-extern MINI_Colormap
-XCreateColormap( MINI_Display *display, MINI_Window w, Visual *visual, int alloc );
-
-extern void
-XFreeColormap( MINI_Display *display, MINI_Colormap cmap );
-
-extern void
-XFree( void *data );
-
-extern XVisualInfo *
-XGetVisualInfo( MINI_Display *display, long vinfo_mask,
- XVisualInfo *vinfo_template, int *nitems_return );
-/*@}*/
-
-
-
-/**
- * \name GLX functions
- */
-/*@{*/
-extern XVisualInfo*
-glXChooseVisual( MINI_Display *dpy, int screen, int *attribList );
-
-extern int
-glXGetConfig( MINI_Display *dpy, XVisualInfo *vis, int attrib, int *value );
-
-extern GLXContext
-glXCreateContext( MINI_Display *dpy, XVisualInfo *vis,
- GLXContext shareList, MINI_Bool direct );
-
-extern void
-glXDestroyContext( MINI_Display *dpy, GLXContext ctx );
-
-extern MINI_Bool
-glXMakeCurrent( MINI_Display *dpy, GLXDrawable drawable, GLXContext ctx);
-
-extern void
-glXSwapBuffers( MINI_Display *dpy, GLXDrawable drawable );
-
-extern GLXContext
-glXGetCurrentContext( void );
-
-extern GLXDrawable
-glXGetCurrentDrawable( void );
-
-extern void
-(*glXGetProcAddress(const GLubyte *procname))( void );
-
-extern MINI_Bool
-glXQueryVersion( MINI_Display *dpy, int *major, int *minor );
-
-/* Added in MiniGLX 1.1 */
-extern GLXPbuffer
-glXCreatePbuffer( MINI_Display *dpy, GLXFBConfig config, const int *attribList );
-
-extern void
-glXDestroyPbuffer( MINI_Display *dpy, GLXPbuffer pbuf );
-
-extern GLXFBConfig *
-glXChooseFBConfig( MINI_Display *dpy, int screen, const int *attribList,
- int *nitems );
-
-extern XVisualInfo *
-glXGetVisualFromFBConfig( MINI_Display *dpy, GLXFBConfig config );
-
-extern void *glXAllocateMemoryMESA(Display *dpy, int scrn,
- size_t size, float readFreq,
- float writeFreq, float priority);
-
-extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
-
-extern GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn,
- const void *pointer );
-/*@}*/
-
-extern void
-__glXScrEnableExtension( void *, const char * name );
-
-/*@}*/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MINIGLX_H */
diff --git a/nx-X11/extras/Mesa/include/GL/svgamesa.h b/nx-X11/extras/Mesa/include/GL/svgamesa.h
deleted file mode 100644
index 67c0e4c5c..000000000
--- a/nx-X11/extras/Mesa/include/GL/svgamesa.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- * Copyright (C) 1995-2001 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-/*
- * SVGA/Mesa interface for Linux.
- */
-
-
-/*
- * Intro to using the VGA/Mesa interface
- *
- * 1. #include the <vga.h> file
- * 2. Call vga_init() to initialize the SVGA library.
- * 3. Call vga_setmode() to specify the screen size and color depth.
- * 4. Call SVGAMesaCreateContext() to setup a Mesa context. If using 8-bit
- * color Mesa assumes color index mode, if using 16-bit or deeper color
- * Mesa assumes RGB mode.
- * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context.
- * 6. You can now use the Mesa API functions.
- * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT)
- * to restore the original text screen.
- *
- * Notes
- * 1. You must run your executable as root (or use the set UID-bit) because
- * the SVGA library requires it.
- * 2. The SVGA driver is not fully implemented yet. See svgamesa.c for what
- * has to be done yet.
- */
-
-
-#ifndef SVGAMESA_H
-#define SVGAMESA_H
-
-
-#define SVGAMESA_MAJOR_VERSION 4
-#define SVGAMESA_MINOR_VERSION 0
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#include "GL/gl.h"
-
-
-
-/*
- * This is the SVGAMesa context 'handle':
- */
-typedef struct svgamesa_context *SVGAMesaContext;
-
-
-
-/*
- * doubleBuffer flag new in version 2.4
- */
-extern int SVGAMesaInit( int GraphMode );
-
-extern int SVGAMesaClose( void );
-
-extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer );
-
-extern void SVGAMesaDestroyContext( SVGAMesaContext ctx );
-
-extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx );
-
-extern void SVGAMesaSwapBuffers( void );
-
-extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue);
-
-extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/uglglutshapes.h b/nx-X11/extras/Mesa/include/GL/uglglutshapes.h
deleted file mode 100644
index 28192de2d..000000000
--- a/nx-X11/extras/Mesa/include/GL/uglglutshapes.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* uglglutshapes.h - Public header GLUT Shapes */
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
-
-/* This program is freely distributable without licensing fees and is
- provided without guarantee or warrantee expressed or implied. This
- program is -not- in the public domain. */
-
-#ifndef GLUTSHAPES_H
-#define GLUTSHAPES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <GL/gl.h>
-
-void glutWireSphere (GLdouble radius, GLint slices, GLint stacks);
-void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks);
-void glutWireCone (GLdouble base, GLdouble height,
- GLint slices, GLint stacks);
-void glutSolidCone (GLdouble base, GLdouble height,
- GLint slices, GLint stacks);
-void glutWireCube (GLdouble size);
-void glutSolidCube (GLdouble size);
-void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius,
- GLint sides, GLint rings);
-void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius,
- GLint sides, GLint rings);
-void glutWireDodecahedron (void);
-void glutSolidDodecahedron (void);
-void glutWireOctahedron (void);
-void glutSolidOctahedron (void);
-void glutWireTetrahedron (void);
-void glutSolidTetrahedron (void);
-void glutWireIcosahedron (void);
-void glutSolidIcosahedron (void);
-void glutWireTeapot (GLdouble size);
-void glutSolidTeapot (GLdouble size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/uglmesa.h b/nx-X11/extras/Mesa/include/GL/uglmesa.h
deleted file mode 100644
index 7ef584350..000000000
--- a/nx-X11/extras/Mesa/include/GL/uglmesa.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* uglmesa.h - Public header UGL/Mesa */
-
-/* Copyright (C) 2001 by Wind River Systems, Inc */
-
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * The MIT License
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Author:
- * Stephane Raimbault <stephane.raimbault@windriver.com>
- */
-
-#ifndef UGLMESA_H
-#define UGLMESA_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define UGL_MESA_MAJOR_VERSION 4
-#define UGL_MESA_MINOR_VERSION 0
-
-#include <GL/gl.h>
-#include <ugl/ugl.h>
-
-/*
- * Values for display mode of uglMesaCreateContext ()
- */
-
-/*
- * With these mask values, it's possible to test double buffer mode
- * with UGL_MESA_DOUBLE mask
- *
- * SINGLE 0000 0001
- * DOUBLE 0000 0110
- * - SOFT 0000 0010
- * - HARD 0000 0100
- * WINDML 0001 0000
- *
- *
- */
-#define UGL_MESA_SINGLE 0x01
-#define UGL_MESA_DOUBLE 0x06
-#define UGL_MESA_DOUBLE_SOFTWARE 0x02
-#define UGL_MESA_DOUBLE_HARDWARE 0x04
-
-#define UGL_MESA_WINDML_EXCLUSIVE 0x10
-
-#define UGL_MESA_FULLSCREEN_WIDTH 0x0
-#define UGL_MESA_FULLSCREEN_HEIGHT 0x0
-
-/*
- * uglMesaPixelStore() parameters:
- */
-
-#define UGL_MESA_ROW_LENGTH 0x20
-#define UGL_MESA_Y_UP 0x21
-
-/*
- * Accepted by uglMesaGetIntegerv:
- */
-
-#define UGL_MESA_LEFT_X 0x01
-#define UGL_MESA_TOP_Y 0x02
-#define UGL_MESA_WIDTH 0x03
-#define UGL_MESA_HEIGHT 0x04
-#define UGL_MESA_DISPLAY_WIDTH 0x05
-#define UGL_MESA_DISPLAY_HEIGHT 0x06
-#define UGL_MESA_COLOR_FORMAT 0x07
-#define UGL_MESA_COLOR_MODEL 0x08
-#define UGL_MESA_PIXEL_FORMAT 0x09
-#define UGL_MESA_TYPE 0x0A
-#define UGL_MESA_RGB 0x0B
-#define UGL_MESA_COLOR_INDEXED 0x0C
-#define UGL_MESA_SINGLE_BUFFER 0x0D
-#define UGL_MESA_DOUBLE_BUFFER 0x0E
-#define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F
-#define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10
-
-/*
- * typedefs
- */
-
-typedef struct uglMesaContext * UGL_MESA_CONTEXT;
-
-UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode,
- UGL_MESA_CONTEXT share_list);
-
-UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum mode,
- GLint depth_bits,
- GLint stencil_bits,
- GLint accum_red_bits,
- GLint accum_green_bits,
- GLint accum_blue_bits,
- GLint accum_alpha_bits,
- UGL_MESA_CONTEXT share_list);
-
-GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc,
- GLsizei left, GLsizei top,
- GLsizei width, GLsizei height);
-
-GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy);
-
-GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top);
-
-GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh);
-
-GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height);
-
-void uglMesaDestroyContext (void);
-
-UGL_MESA_CONTEXT uglMesaGetCurrentContext (void);
-
-void uglMesaSwapBuffers (void);
-
-void uglMesaPixelStore (GLint pname, GLint value);
-
-void uglMesaGetIntegerv (GLint pname, GLint *value);
-
-GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height,
- GLint *bytesPerValue, void **buffer);
-
-GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height,
- GLint *format, void **buffer);
-
-GLboolean uglMesaSetColor (GLubyte index, GLfloat red,
- GLfloat green, GLfloat blue);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/vms_x_fix.h b/nx-X11/extras/Mesa/include/GL/vms_x_fix.h
deleted file mode 100644
index db754f655..000000000
--- a/nx-X11/extras/Mesa/include/GL/vms_x_fix.h
+++ /dev/null
@@ -1,880 +0,0 @@
-/***************************************************************************
- * *
- * Repair definitions of Xlib when compileing with /name=(as_is) on VMS *
- * *
- * Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl) *
- * *
- * Last revision : 22 August 2000 *
- * *
- ***************************************************************************/
-
-#ifndef VMS_X_FIX
-#define VMS_X_FIX
-
-#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
-#define XAllocClassHint XALLOCCLASSHINT
-#define XAllocColor XALLOCCOLOR
-#define XAllocColorCells XALLOCCOLORCELLS
-#define XAllocSizeHints XALLOCSIZEHINTS
-#define XAllocWMHints XALLOCWMHINTS
-#define XAutoRepeatOff XAUTOREPEATOFF
-#define XAutoRepeatOn XAUTOREPEATON
-#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
-#define XBell XBELL
-#define XBitmapPad XBITMAPPAD
-#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
-#define XChangeGC XCHANGEGC
-#define XChangeProperty XCHANGEPROPERTY
-#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
-#define XCheckIfEvent XCHECKIFEVENT
-#define XCheckMaskEvent XCHECKMASKEVENT
-#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
-#define XCheckWindowEvent XCHECKWINDOWEVENT
-#define XClearArea XCLEARAREA
-#define XClearWindow XCLEARWINDOW
-#define XClipBox XCLIPBOX
-#define XCloseDisplay XCLOSEDISPLAY
-#define XCloseIM XCLOSEIM
-#define XConfigureWindow XCONFIGUREWINDOW
-#define XConvertSelection XCONVERTSELECTION
-#define XCopyArea XCOPYAREA
-#define XCopyGC XCOPYGC
-#define XCopyPlane XCOPYPLANE
-#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
-#define XCreateColormap XCREATECOLORMAP
-#define XCreateFontCursor XCREATEFONTCURSOR
-#define XCreateFontSet XCREATEFONTSET
-#define XCreateGC XCREATEGC
-#define XCreateIC XCREATEIC
-#define XCreateImage XCREATEIMAGE
-#define XCreatePixmap XCREATEPIXMAP
-#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
-#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
-#define XCreateRegion XCREATEREGION
-#define XCreateSimpleWindow XCREATESIMPLEWINDOW
-#define XCreateWindow XCREATEWINDOW
-#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
-#define XDefineCursor XDEFINECURSOR
-#define XDeleteProperty XDELETEPROPERTY
-#define XDestroyIC XDESTROYIC
-#define XDestroyRegion XDESTROYREGION
-#define XDestroyWindow XDESTROYWINDOW
-#define XDisplayName XDISPLAYNAME
-#define XDisplayOfScreen XDISPLAYOFSCREEN
-#define XDrawArc XDRAWARC
-#define XDrawImageString XDRAWIMAGESTRING
-#define XDrawImageString16 XDRAWIMAGESTRING16
-#define XDrawLine XDRAWLINE
-#define XDrawLines XDRAWLINES
-#define XDrawPoint XDRAWPOINT
-#define XDrawPoints XDRAWPOINTS
-#define XDrawRectangle XDRAWRECTANGLE
-#define XDrawSegments XDRAWSEGMENTS
-#define XDrawString XDRAWSTRING
-#define XDrawString16 XDRAWSTRING16
-#define XEmptyRegion XEMPTYREGION
-#define XEqualRegion XEQUALREGION
-#define XEventsQueued XEVENTSQUEUED
-#define XExtentsOfFontSet XEXTENTSOFFONTSET
-#define XFillArc XFILLARC
-#define XFillPolygon XFILLPOLYGON
-#define XFillRectangle XFILLRECTANGLE
-#define XFillRectangles XFILLRECTANGLES
-#define XFilterEvent XFILTEREVENT
-#define XFlush XFLUSH
-#define XFontsOfFontSet XFONTSOFFONTSET
-#define XFree XFREE
-#define XFreeColormap XFREECOLORMAP
-#define XFreeColors XFREECOLORS
-#define XFreeCursor XFREECURSOR
-#define XFreeFont XFREEFONT
-#define XFreeFontInfo XFREEFONTINFO
-#define XFreeFontNames XFREEFONTNAMES
-#define XFreeFontSet XFREEFONTSET
-#define XFreeGC XFREEGC
-#define XFreeModifiermap XFREEMODIFIERMAP
-#define XFreePixmap XFREEPIXMAP
-#define XFreeStringList XFREESTRINGLIST
-#define XGetAtomName XGETATOMNAME
-#define XGetDefault XGETDEFAULT
-#define XGetErrorDatabaseText XGETERRORDATABASETEXT
-#define XGetErrorText XGETERRORTEXT
-#define XGetFontProperty XGETFONTPROPERTY
-#define XGetGCValues XGETGCVALUES
-#define XGetGeometry XGETGEOMETRY
-#define XGetICValues XGETICVALUES
-#define XGetIMValues XGETIMVALUES
-#define XGetImage XGETIMAGE
-#define XGetKeyboardControl XGETKEYBOARDCONTROL
-#define XGetModifierMapping XGETMODIFIERMAPPING
-#define XGetMotionEvents XGETMOTIONEVENTS
-#define XGetNormalHints XGETNORMALHINTS
-#define XGetSelectionOwner XGETSELECTIONOWNER
-#define XGetSubImage XGETSUBIMAGE
-#define XGetVisualInfo XGETVISUALINFO
-#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
-#define XGetWMHints XGETWMHINTS
-#define XGetWMName XGETWMNAME
-#define XGetWMNormalHints XGETWMNORMALHINTS
-#define XGetWindowAttributes XGETWINDOWATTRIBUTES
-#define XGetWindowProperty XGETWINDOWPROPERTY
-#define XGrabKeyboard XGRABKEYBOARD
-#define XGrabPointer XGRABPOINTER
-#define XGrabServer XGRABSERVER
-#define XHeightOfScreen XHEIGHTOFSCREEN
-#define XIfEvent XIFEVENT
-#define XInternAtom XINTERNATOM
-#define XIntersectRegion XINTERSECTREGION
-#define XKeycodeToKeysym XKEYCODETOKEYSYM
-#define XKeysymToKeycode XKEYSYMTOKEYCODE
-#define XKeysymToString XKEYSYMTOSTRING
-#define XListFonts XLISTFONTS
-#define XListFontsWithInfo XLISTFONTSWITHINFO
-#define XListPixmapFormats XLISTPIXMAPFORMATS
-#define XListProperties XLISTPROPERTIES
-#define XLoadQueryFont XLOADQUERYFONT
-#define XLookupString XLOOKUPSTRING
-#define XLowerWindow XLOWERWINDOW
-#define XMapRaised XMAPRAISED
-#define XMapWindow XMAPWINDOW
-#define XMatchVisualInfo XMATCHVISUALINFO
-#define XMoveResizeWindow XMOVERESIZEWINDOW
-#define XMoveWindow XMOVEWINDOW
-#define XNextEvent XNEXTEVENT
-#define XOffsetRegion XOFFSETREGION
-#define XOpenDisplay XOPENDISPLAY
-#define XOpenIM XOPENIM
-#define XParseColor XPARSECOLOR
-#define XParseGeometry XPARSEGEOMETRY
-#define XPeekEvent XPEEKEVENT
-#define XPending XPENDING
-#define XPointInRegion XPOINTINREGION
-#define XPolygonRegion XPOLYGONREGION
-#define XPutBackEvent XPUTBACKEVENT
-#define XPutImage XPUTIMAGE
-#define XQueryColor XQUERYCOLOR
-#define XQueryColors XQUERYCOLORS
-#define XQueryExtension XQUERYEXTENSION
-#define XQueryPointer XQUERYPOINTER
-#define XQueryTree XQUERYTREE
-#define XRaiseWindow XRAISEWINDOW
-#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
-#define XRectInRegion XRECTINREGION
-#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
-#define XReparentWindow XREPARENTWINDOW
-#define XResizeWindow XRESIZEWINDOW
-#define XRestackWindows XRESTACKWINDOWS
-#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
-#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
-#define XSelectAsyncEvent XSELECTASYNCEVENT
-#define XSelectAsyncInput XSELECTASYNCINPUT
-#define XSelectInput XSELECTINPUT
-#define XSendEvent XSENDEVENT
-#define XServerVendor XSERVERVENDOR
-#define XSetBackground XSETBACKGROUND
-#define XSetClassHint XSETCLASSHINT
-#define XSetClipMask XSETCLIPMASK
-#define XSetClipOrigin XSETCLIPORIGIN
-#define XSetClipRectangles XSETCLIPRECTANGLES
-#define XSetCloseDownMode XSETCLOSEDOWNMODE
-#define XSetCommand XSETCOMMAND
-#define XSetDashes XSETDASHES
-#define XSetErrorHandler XSETERRORHANDLER
-#define XSetFillStyle XSETFILLSTYLE
-#define XSetFont XSETFONT
-#define XSetForeground XSETFOREGROUND
-#define XSetFunction XSETFUNCTION
-#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
-#define XSetICFocus XSETICFOCUS
-#define XSetICValues XSETICVALUES
-#define XSetIOErrorHandler XSETIOERRORHANDLER
-#define XSetInputFocus XSETINPUTFOCUS
-#define XSetLineAttributes XSETLINEATTRIBUTES
-#define XSetLocaleModifiers XSETLOCALEMODIFIERS
-#define XSetNormalHints XSETNORMALHINTS
-#define XSetRegion XSETREGION
-#define XSetSelectionOwner XSETSELECTIONOWNER
-#define XSetStipple XSETSTIPPLE
-#define XSetSubwindowMode XSETSUBWINDOWMODE
-#define XSetTSOrigin XSETTSORIGIN
-#define XSetTile XSETTILE
-#define XSetTransientForHint XSETTRANSIENTFORHINT
-#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
-#define XSetWMHints XSETWMHINTS
-#define XSetWMIconName XSETWMICONNAME
-#define XSetWMName XSETWMNAME
-#define XSetWMNormalHints XSETWMNORMALHINTS
-#define XSetWMProperties XSETWMPROPERTIES
-#define XSetWMProtocols XSETWMPROTOCOLS
-#define XSetWindowBackground XSETWINDOWBACKGROUND
-#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
-#define XSetWindowColormap XSETWINDOWCOLORMAP
-#define XShapeCombineMask XSHAPECOMBINEMASK
-#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
-#define XShapeGetRectangles XSHAPEGETRECTANGLES
-#define XShrinkRegion XSHRINKREGION
-#define XStoreColor XSTORECOLOR
-#define XStoreColors XSTORECOLORS
-#define XStoreName XSTORENAME
-#define XStringToKeysym XSTRINGTOKEYSYM
-#define XSubtractRegion XSUBTRACTREGION
-#define XSupportsLocale XSUPPORTSLOCALE
-#define XSync XSYNC
-#define XSynchronize XSYNCHRONIZE
-#define XTextExtents XTEXTEXTENTS
-#define XTextExtents16 XTEXTEXTENTS16
-#define XTextWidth XTEXTWIDTH
-#define XTextWidth16 XTEXTWIDTH16
-#define XTranslateCoordinates XTRANSLATECOORDINATES
-#define XUndefineCursor XUNDEFINECURSOR
-#define XUngrabKeyboard XUNGRABKEYBOARD
-#define XUngrabPointer XUNGRABPOINTER
-#define XUngrabServer XUNGRABSERVER
-#define XUnionRectWithRegion XUNIONRECTWITHREGION
-#define XUnionRegion XUNIONREGION
-#define XUnmapWindow XUNMAPWINDOW
-#define _XUnregisterFilter _XUNREGISTERFILTER
-#define XUnsetICFocus XUNSETICFOCUS
-#define XVaCreateNestedList XVACREATENESTEDLIST
-#define XVisualIDFromVisual XVISUALIDFROMVISUAL
-#define XWidthOfScreen XWIDTHOFSCREEN
-#define XWindowEvent XWINDOWEVENT
-#define XWithdrawWindow XWITHDRAWWINDOW
-#define XXorRegion XXORREGION
-#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
-#define XmAddProtocols XMADDPROTOCOLS
-#define XmChangeColor XMCHANGECOLOR
-#define XmClipboardCopy XMCLIPBOARDCOPY
-#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
-#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
-#define XmClipboardLock XMCLIPBOARDLOCK
-#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
-#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
-#define XmClipboardUnlock XMCLIPBOARDUNLOCK
-#define XmCreateArrowButton XMCREATEARROWBUTTON
-#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
-#define XmCreateCascadeButton XMCREATECASCADEBUTTON
-#define XmCreateDialogShell XMCREATEDIALOGSHELL
-#define XmCreateDragIcon XMCREATEDRAGICON
-#define XmCreateDrawingArea XMCREATEDRAWINGAREA
-#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
-#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
-#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
-#define XmCreateForm XMCREATEFORM
-#define XmCreateFormDialog XMCREATEFORMDIALOG
-#define XmCreateFrame XMCREATEFRAME
-#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
-#define XmCreateLabelGadget XMCREATELABELGADGET
-#define XmCreateMainWindow XMCREATEMAINWINDOW
-#define XmCreateMenuBar XMCREATEMENUBAR
-#define XmCreateMessageBox XMCREATEMESSAGEBOX
-#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
-#define XmCreateOptionMenu XMCREATEOPTIONMENU
-#define XmCreatePanedWindow XMCREATEPANEDWINDOW
-#define XmCreatePopupMenu XMCREATEPOPUPMENU
-#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
-#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
-#define XmCreatePushButton XMCREATEPUSHBUTTON
-#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
-#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
-#define XmCreateRadioBox XMCREATERADIOBOX
-#define XmCreateRowColumn XMCREATEROWCOLUMN
-#define XmCreateScale XMCREATESCALE
-#define XmCreateScrollBar XMCREATESCROLLBAR
-#define XmCreateScrolledList XMCREATESCROLLEDLIST
-#define XmCreateScrolledText XMCREATESCROLLEDTEXT
-#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
-#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
-#define XmCreateSeparator XMCREATESEPARATOR
-#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
-#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
-#define XmCreateText XMCREATETEXT
-#define XmCreateTextField XMCREATETEXTFIELD
-#define XmCreateToggleButton XMCREATETOGGLEBUTTON
-#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
-#define XmDragStart XMDRAGSTART
-#define XmDropSiteRegister XMDROPSITEREGISTER
-#define XmDropSiteUnregister XMDROPSITEUNREGISTER
-#define XmDropSiteUpdate XMDROPSITEUPDATE
-#define XmDropTransferStart XMDROPTRANSFERSTART
-#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
-#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
-#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
-#define XmFontListCopy XMFONTLISTCOPY
-#define XmFontListCreate XMFONTLISTCREATE
-#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
-#define XmFontListEntryFree XMFONTLISTENTRYFREE
-#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
-#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
-#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
-#define XmFontListFree XMFONTLISTFREE
-#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
-#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
-#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
-#define XmFontListNextEntry XMFONTLISTNEXTENTRY
-#define XmGetColors XMGETCOLORS
-#define XmGetFocusWidget XMGETFOCUSWIDGET
-#define XmGetMenuCursor XMGETMENUCURSOR
-#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
-#define XmGetTearOffControl XMGETTEAROFFCONTROL
-#define XmGetXmDisplay XMGETXMDISPLAY
-#define XmImMbLookupString XMIMMBLOOKUPSTRING
-#define XmImRegister XMIMREGISTER
-#define XmImSetFocusValues XMIMSETFOCUSVALUES
-#define XmImSetValues XMIMSETVALUES
-#define XmImUnregister XMIMUNREGISTER
-#define XmImUnsetFocus XMIMUNSETFOCUS
-#define XmInternAtom XMINTERNATOM
-#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
-#define XmListAddItem XMLISTADDITEM
-#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
-#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
-#define XmListDeleteAllItems XMLISTDELETEALLITEMS
-#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
-#define XmListDeletePos XMLISTDELETEPOS
-#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
-#define XmListDeselectPos XMLISTDESELECTPOS
-#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
-#define XmListGetMatchPos XMLISTGETMATCHPOS
-#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
-#define XmListPosSelected XMLISTPOSSELECTED
-#define XmListSelectItem XMLISTSELECTITEM
-#define XmListSelectPos XMLISTSELECTPOS
-#define XmListSetBottomPos XMLISTSETBOTTOMPOS
-#define XmListSetItem XMLISTSETITEM
-#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
-#define XmListSetPos XMLISTSETPOS
-#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
-#define XmMenuPosition XMMENUPOSITION
-#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
-#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
-#define XmOptionLabelGadget XMOPTIONLABELGADGET
-#define XmProcessTraversal XMPROCESSTRAVERSAL
-#define XmQmotif XMQMOTIF
-#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
-#define XmRepTypeGetId XMREPTYPEGETID
-#define XmRepTypeGetRecord XMREPTYPEGETRECORD
-#define XmRepTypeRegister XMREPTYPEREGISTER
-#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
-#define XmScrollBarSetValues XMSCROLLBARSETVALUES
-#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
-#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
-#define XmStringByteCompare XMSTRINGBYTECOMPARE
-#define XmStringCompare XMSTRINGCOMPARE
-#define XmStringConcat XMSTRINGCONCAT
-#define XmStringCopy XMSTRINGCOPY
-#define XmStringCreate XMSTRINGCREATE
-#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
-#define XmStringCreateLtoR XMSTRINGCREATELTOR
-#define XmStringCreateSimple XMSTRINGCREATESIMPLE
-#define XmStringDraw XMSTRINGDRAW
-#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
-#define XmStringExtent XMSTRINGEXTENT
-#define XmStringFree XMSTRINGFREE
-#define XmStringFreeContext XMSTRINGFREECONTEXT
-#define XmStringGetLtoR XMSTRINGGETLTOR
-#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
-#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
-#define XmStringInitContext XMSTRINGINITCONTEXT
-#define XmStringLength XMSTRINGLENGTH
-#define XmStringLtoRCreate XMSTRINGLTORCREATE
-#define XmStringNConcat XMSTRINGNCONCAT
-#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
-#define XmStringWidth XMSTRINGWIDTH
-#define XmTextClearSelection XMTEXTCLEARSELECTION
-#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
-#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
-#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
-#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
-#define XmTextFieldGetString XMTEXTFIELDGETSTRING
-#define XmTextFieldInsert XMTEXTFIELDINSERT
-#define XmTextFieldRemove XMTEXTFIELDREMOVE
-#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
-#define XmTextFieldSetString XMTEXTFIELDSETSTRING
-#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
-#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
-#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
-#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
-#define XmTextGetSelection XMTEXTGETSELECTION
-#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
-#define XmTextGetString XMTEXTGETSTRING
-#define XmTextInsert XMTEXTINSERT
-#define XmTextRemove XMTEXTREMOVE
-#define XmTextReplace XMTEXTREPLACE
-#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
-#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
-#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
-#define XmTextSetSelection XMTEXTSETSELECTION
-#define XmTextSetString XMTEXTSETSTRING
-#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
-#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
-#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
-#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
-#define XmUpdateDisplay XMUPDATEDISPLAY
-#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
-#define XmbDrawString XMBDRAWSTRING
-#define XmbLookupString XMBLOOKUPSTRING
-#define XmbResetIC XMBRESETIC
-#define XmbSetWMProperties XMBSETWMPROPERTIES
-#define XmbTextEscapement XMBTEXTESCAPEMENT
-#define XmbTextExtents XMBTEXTEXTENTS
-#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
-#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
-#define XmuClientWindow XMUCLIENTWINDOW
-#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
-#define XrmGetDatabase XRMGETDATABASE
-#define XrmGetResource XRMGETRESOURCE
-#define XrmPutStringResource XRMPUTSTRINGRESOURCE
-#define XrmQuarkToString XRMQUARKTOSTRING
-#define XrmStringToQuark XRMSTRINGTOQUARK
-#define XtAddCallback XTADDCALLBACK
-#define XtAddCallbacks XTADDCALLBACKS
-#define XtAddEventHandler XTADDEVENTHANDLER
-#define XtAddGrab XTADDGRAB
-#define XtAllocateGC XTALLOCATEGC
-#define XtAppAddActions XTAPPADDACTIONS
-#define XtAppAddInput XTAPPADDINPUT
-#define XtAppAddTimeOut XTAPPADDTIMEOUT
-#define XtAppCreateShell XTAPPCREATESHELL
-#define XtAppInitialize XTAPPINITIALIZE
-#define XtAppNextEvent XTAPPNEXTEVENT
-#define XtAppPeekEvent XTAPPPEEKEVENT
-#define XtAppPending XTAPPPENDING
-#define XtAppProcessEvent XTAPPPROCESSEVENT
-#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
-#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
-#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
-#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
-#define XtAppWarning XTAPPWARNING
-#define XtCallActionProc XTCALLACTIONPROC
-#define XtCallCallbackList XTCALLCALLBACKLIST
-#define XtCallCallbacks XTCALLCALLBACKS
-#define XtConfigureWidget XTCONFIGUREWIDGET
-#define XtConvertAndStore XTCONVERTANDSTORE
-#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
-#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
-#define XtCreatePopupShell XTCREATEPOPUPSHELL
-#define XtCreateWidget XTCREATEWIDGET
-#define XtDatabase XTDATABASE
-#define XtDestroyWidget XTDESTROYWIDGET
-#define XtDisownSelection XTDISOWNSELECTION
-#define XtDispatchEvent XTDISPATCHEVENT
-#define XtDisplayOfObject XTDISPLAYOFOBJECT
-#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
-#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
-#define XtAppAddWorkProc XTAPPADDWORKPROC
-#define XtRemoveWorkProc XTREMOVEWORKPROC
-#define XtFree XTFREE
-#define XtGetActionKeysym XTGETACTIONKEYSYM
-#define XtGetActionList XTGETACTIONLIST
-#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
-#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
-#define XtGetGC XTGETGC
-#define XtGetMultiClickTime XTGETMULTICLICKTIME
-#define XtGetSelectionValue XTGETSELECTIONVALUE
-#define XtGetSelectionValues XTGETSELECTIONVALUES
-#define XtGetSubresources XTGETSUBRESOURCES
-#define XtGetValues XTGETVALUES
-#define XtGrabKeyboard XTGRABKEYBOARD
-#define XtGrabPointer XTGRABPOINTER
-#define XtHasCallbacks XTHASCALLBACKS
-#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
-#define XtInsertEventHandler XTINSERTEVENTHANDLER
-#define XtIsManaged XTISMANAGED
-#define XtIsObject XTISOBJECT
-#define XtIsSensitive XTISSENSITIVE
-#define XtIsSubclass XTISSUBCLASS
-#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
-#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
-#define XtMakeResizeRequest XTMAKERESIZEREQUEST
-#define XtMalloc XTMALLOC
-#define XtManageChild XTMANAGECHILD
-#define XtManageChildren XTMANAGECHILDREN
-#define XtMergeArgLists XTMERGEARGLISTS
-#define XtMoveWidget XTMOVEWIDGET
-#define XtName XTNAME
-#define XtNameToWidget XTNAMETOWIDGET
-#define XtOpenDisplay XTOPENDISPLAY
-#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
-#define XtOwnSelection XTOWNSELECTION
-#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
-#define XtPopdown XTPOPDOWN
-#define XtPopup XTPOPUP
-#define XtQueryGeometry XTQUERYGEOMETRY
-#define XtRealizeWidget XTREALIZEWIDGET
-#define XtRealloc XTREALLOC
-#define XtReleaseGC XTRELEASEGC
-#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
-#define XtRemoveCallback XTREMOVECALLBACK
-#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
-#define XtRemoveGrab XTREMOVEGRAB
-#define XtRemoveInput XTREMOVEINPUT
-#define XtRemoveTimeOut XTREMOVETIMEOUT
-#define XtResizeWidget XTRESIZEWIDGET
-#define XtResolvePathname XTRESOLVEPATHNAME
-#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
-#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
-#define XtSetSensitive XTSETSENSITIVE
-#define XtSetTypeConverter XTSETTYPECONVERTER
-#define XtSetValues XTSETVALUES
-#define XtShellStrings XTSHELLSTRINGS
-#define XtStrings XTSTRINGS
-#define XtToolkitInitialize XTTOOLKITINITIALIZE
-#define XtTranslateCoords XTTRANSLATECOORDS
-#define XtTranslateKeycode XTTRANSLATEKEYCODE
-#define XtUngrabKeyboard XTUNGRABKEYBOARD
-#define XtUngrabPointer XTUNGRABPOINTER
-#define XtUnmanageChild XTUNMANAGECHILD
-#define XtUnmanageChildren XTUNMANAGECHILDREN
-#define XtUnrealizeWidget XTUNREALIZEWIDGET
-#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
-#define XtVaCreateWidget XTVACREATEWIDGET
-#define XtVaGetValues XTVAGETVALUES
-#define XtVaSetValues XTVASETVALUES
-#define XtWarning XTWARNING
-#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
-#define XtWindowOfObject XTWINDOWOFOBJECT
-#define XtWindowToWidget XTWINDOWTOWIDGET
-#define XwcDrawString XWCDRAWSTRING
-#define XwcFreeStringList XWCFREESTRINGLIST
-#define XwcTextEscapement XWCTEXTESCAPEMENT
-#define XwcTextExtents XWCTEXTEXTENTS
-#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
-#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
-#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
-#define _XmClearBorder _XMCLEARBORDER
-#define _XmConfigureObject _XMCONFIGUREOBJECT
-#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
-#define _XmDrawArrow _XMDRAWARROW
-#define _XmDrawShadows _XMDRAWSHADOWS
-#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
-#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
-#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
-#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
-#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
-#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
-#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
-#define _XmGrabKeyboard _XMGRABKEYBOARD
-#define _XmGrabPointer _XMGRABPOINTER
-#define _XmInheritClass _XMINHERITCLASS
-#define _XmInputInGadget _XMINPUTINGADGET
-#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
-#define _XmMenuPopDown _XMMENUPOPDOWN
-#define _XmMoveObject _XMMOVEOBJECT
-#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
-#define _XmOSBuildFileList _XMOSBUILDFILELIST
-#define _XmOSFileCompare _XMOSFILECOMPARE
-#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
-#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
-#define _XmPostPopupMenu _XMPOSTPOPUPMENU
-#define _XmPrimitiveEnter _XMPRIMITIVEENTER
-#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
-#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
-#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
-#define _XmStringDraw _XMSTRINGDRAW
-#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
-#define _XmStrings _XMSTRINGS
-#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
-#define _XmToVerticalPixels _XMTOVERTICALPIXELS
-#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
-#define _Xm_fastPtr _XM_FASTPTR
-#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
-#define _XtInherit _XTINHERIT
-#define _XtInheritTranslations _XTINHERITTRANSLATIONS
-#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
-#define compositeWidgetClass COMPOSITEWIDGETCLASS
-#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
-#define shellWidgetClass SHELLWIDGETCLASS
-#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
-#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
-#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
-#define vendorShellClassRec VENDORSHELLCLASSREC
-#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
-#define wmShellWidgetClass WMSHELLWIDGETCLASS
-#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
-#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
-#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
-#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
-#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
-#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
-#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
-#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
-#define xmFormWidgetClass XMFORMWIDGETCLASS
-#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
-#define xmGadgetClass XMGADGETCLASS
-#define xmLabelGadgetClass XMLABELGADGETCLASS
-#define xmLabelWidgetClass XMLABELWIDGETCLASS
-#define xmListWidgetClass XMLISTWIDGETCLASS
-#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
-#define xmManagerClassRec XMMANAGERCLASSREC
-#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
-#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
-#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
-#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
-#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
-#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
-#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
-#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
-#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
-#define xmSashWidgetClass XMSASHWIDGETCLASS
-#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
-#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
-#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
-#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
-#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
-#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
-#define xmTextWidgetClass XMTEXTWIDGETCLASS
-#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
-#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
-#define XtRegisterDrawable _XTREGISTERWINDOW
-#define XtUnregisterDrawable _XTUNREGISTERWINDOW
-#define XQueryFont XQUERYFONT
-#define XSetPlaneMask XSETPLANEMASK
-#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
-#define XDestroySubwindows XDESTROYSUBWINDOWS
-#define XFreeDeviceList XFREEDEVICELIST
-#define XFreeDeviceState XFREEDEVICESTATE
-#define XGetExtensionVersion XGETEXTENSIONVERSION
-#define XGetRGBColormaps XGETRGBCOLORMAPS
-#define XIconifyWindow XICONIFYWINDOW
-#define XInstallColormap XINSTALLCOLORMAP
-#define XListInputDevices XLISTINPUTDEVICES
-#define XLookupKeysym XLOOKUPKEYSYM
-#define XOpenDevice XOPENDEVICE
-#define XQueryDeviceState XQUERYDEVICESTATE
-#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
-#define XWarpPointer XWARPPOINTER
-#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
-#define XAllocNamedColor XALLOCNAMEDCOLOR
-#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
-#define XDefaultColormap XDEFAULTCOLORMAP
-#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
-#define XDefaultDepth XDEFAULTDEPTH
-#define XDefaultScreen XDEFAULTSCREEN
-#define XDefaultVisual XDEFAULTVISUAL
-#define XSetIconName XSETICONNAME
-#define XtInitialize XTINITIALIZE
-#define XtMainLoop XTMAINLOOP
-#define DtSaverGetWindows DTSAVERGETWINDOWS
-#define XAddHosts XADDHOSTS
-#define XDisableAccessControl XDISABLEACCESSCONTROL
-#define XEnableAccessControl XENABLEACCESSCONTROL
-#define XFillArcs XFILLARCS
-#define XForceScreenSaver XFORCESCREENSAVER
-#define XGetScreenSaver XGETSCREENSAVER
-#define XListHosts XLISTHOSTS
-#define XReadBitmapFile XREADBITMAPFILE
-#define XRemoveHosts XREMOVEHOSTS
-#define XResetScreenSaver XRESETSCREENSAVER
-#define XResourceManagerString XRESOURCEMANAGERSTRING
-#define XSetScreenSaver XSETSCREENSAVER
-#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
-#define XrmDestroyDatabase XRMDESTROYDATABASE
-#define XrmGetFileDatabase XRMGETFILEDATABASE
-#define XrmGetStringDatabase XRMGETSTRINGDATABASE
-#define XrmInitialize XRMINITIALIZE
-#define XrmMergeDatabases XRMMERGEDATABASES
-#define XrmParseCommand XRMPARSECOMMAND
-#define XrmPutLineResource XRMPUTLINERESOURCE
-#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
-#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
-#define XrmStringToQuark XRMSTRINGTOQUARK
-#define XmCreateLabel XMCREATELABEL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void XtFree(char*);
-#ifdef __cplusplus
-}
-#endif
-
-#define pthread_attr_create PTHREAD_ATTR_CREATE
-#define pthread_attr_delete PTHREAD_ATTR_DELETE
-#define pthread_attr_destroy PTHREAD_ATTR_DESTROY
-#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP
-#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP
-#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED
-#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
-#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
-#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
-#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
-#define pthread_attr_init PTHREAD_ATTR_INIT
-#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
-#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE
-#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP
-#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED
-#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO
-#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
-#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
-#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
-#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
-#define pthread_cancel PTHREAD_CANCEL
-#define pthread_cancel_e PTHREAD_CANCEL_E
-#define pthread_cond_broadcast PTHREAD_COND_BROADCAST
-#define pthread_cond_destroy PTHREAD_COND_DESTROY
-#define pthread_cond_init PTHREAD_COND_INIT
-#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP
-#define pthread_cond_signal PTHREAD_COND_SIGNAL
-#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP
-#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
-#define pthread_cond_wait PTHREAD_COND_WAIT
-#define pthread_condattr_create PTHREAD_CONDATTR_CREATE
-#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE
-#define pthread_condattr_init PTHREAD_CONDATTR_INIT
-#define pthread_create PTHREAD_CREATE
-#define pthread_delay_np PTHREAD_DELAY_NP
-#define pthread_detach PTHREAD_DETACH
-#define pthread_equal PTHREAD_EQUAL
-#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
-#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
-#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
-#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
-#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
-#define pthread_exit PTHREAD_EXIT
-#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
-#define pthread_getprio PTHREAD_GETPRIO
-#define pthread_getschedparam PTHREAD_GETSCHEDPARAM
-#define pthread_getscheduler PTHREAD_GETSCHEDULER
-#define pthread_getspecific PTHREAD_GETSPECIFIC
-#define pthread_getunique_np PTHREAD_GETUNIQUE_NP
-#define pthread_join PTHREAD_JOIN
-#define pthread_join32 PTHREAD_JOIN32
-#define pthread_keycreate PTHREAD_KEYCREATE
-#define pthread_key_create PTHREAD_KEY_CREATE
-#define pthread_kill PTHREAD_KILL
-#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
-#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
-#define pthread_mutex_init PTHREAD_MUTEX_INIT
-#define pthread_mutex_lock PTHREAD_MUTEX_LOCK
-#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK
-#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
-#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE
-#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE
-#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY
-#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP
-#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT
-#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP
-#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP
-#define pthread_once PTHREAD_ONCE
-#define pthread_resume_np PTHREAD_RESUME_NP
-#define pthread_self PTHREAD_SELF
-#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
-#define pthread_setcancel PTHREAD_SETCANCEL
-#define pthread_setcancelstate PTHREAD_SETCANCELSTATE
-#define pthread_setprio PTHREAD_SETPRIO
-#define pthread_setschedparam PTHREAD_SETSCHEDPARAM
-#define pthread_setscheduler PTHREAD_SETSCHEDULER
-#define pthread_setspecific PTHREAD_SETSPECIFIC
-#define pthread_suspend_np PTHREAD_SUSPEND_NP
-#define pthread_testcancel PTHREAD_TESTCANCEL
-#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
-#define pthread_yield PTHREAD_YIELD
-#define pthread_yield_np PTHREAD_YIELD_NP
-#define XDefaultRootWindow XDEFAULTROOTWINDOW
-#define XDisplayCells XDISPLAYCELLS
-#define XMaxRequestSize XMAXREQUESTSIZE
-#define XScreenOfDisplay XSCREENOFDISPLAY
-#define XSetFillRule XSETFILLRULE
-#define XmActivateProtocol XMACTIVATEPROTOCOL
-#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
-#define XmCreateErrorDialog XMCREATEERRORDIALOG
-#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
-#define XmCvtCTToXmString XMCVTCTTOXMSTRING
-#define XmDestroyPixmap XMDESTROYPIXMAP
-#define XmGetPixmap XMGETPIXMAP
-#define XmInstallImage XMINSTALLIMAGE
-#define XmListAddItems XMLISTADDITEMS
-#define XmListDeleteItem XMLISTDELETEITEM
-#define XmListItemExists XMLISTITEMEXISTS
-#define XmListItemPos XMLISTITEMPOS
-#define XmListReplaceItems XMLISTREPLACEITEMS
-#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
-#define XmRemoveProtocols XMREMOVEPROTOCOLS
-#define XmRemoveTabGroup XMREMOVETABGROUP
-#define XmSetColorCalculation XMSETCOLORCALCULATION
-#define XmTextCopy XMTEXTCOPY
-#define XmTextCut XMTEXTCUT
-#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
-#define XmTextFieldCopy XMTEXTFIELDCOPY
-#define XmTextFieldCut XMTEXTFIELDCUT
-#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
-#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
-#define XmTextFieldPaste XMTEXTFIELDPASTE
-#define XmTextFieldReplace XMTEXTFIELDREPLACE
-#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
-#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
-#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
-#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
-#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
-#define XmTextGetEditable XMTEXTGETEDITABLE
-#define XmTextPaste XMTEXTPASTE
-#define XmTextPosToXY XMTEXTPOSTOXY
-#define XmTextSetEditable XMTEXTSETEDITABLE
-#define XmTextShowPosition XMTEXTSHOWPOSITION
-#define XmUninstallImage XMUNINSTALLIMAGE
-#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
-#define XrmPutFileDatabase XRMPUTFILEDATABASE
-#define XtAddConverter XTADDCONVERTER
-#define XtError XTERROR
-#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
-#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
-#define pthread_key_delete PTHREAD_KEY_DELETE
-#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
-#define xmScaleWidgetClass XMSCALEWIDGETCLASS
-#define XtDisplay XTDISPLAY
-#define XtScreen XTSCREEN
-#define XAllocIconSize XALLOCICONSIZE
-#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
-#define XAllowEvents XALLOWEVENTS
-#define XBlackPixel XBLACKPIXEL
-#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
-#define XDefaultGC XDEFAULTGC
-#define XDisplayHeight XDISPLAYHEIGHT
-#define XDisplayWidth XDISPLAYWIDTH
-#define XGetCommand XGETCOMMAND
-#define XGetIconSizes XGETICONSIZES
-#define XKillClient XKILLCLIENT
-#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
-#define XRootWindow XROOTWINDOW
-#define XWMGeometry XWMGEOMETRY
-#define XWhitePixel XWHITEPIXEL
-#define XrmCombineDatabase XRMCOMBINEDATABASE
-#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
-#define XSetStandardProperties XSETSTANDARDPROPERTIES
-#define XSetState XSETSTATE
-#define XDrawRectangles XDRAWRECTANGLES
-#define XGrabButton XGRABBUTTON
-#define XLookupColor XLOOKUPCOLOR
-#define XMapSubwindows XMAPSUBWINDOWS
-#define XRecolorCursor XRECOLORCURSOR
-#define XStoreBytes XSTOREBYTES
-#define XUngrabButton XUNGRABBUTTON
-#define XUninstallColormap XUNINSTALLCOLORMAP
-#define lib$wait LIB$WAIT
-#define lib$find_file LIB$FIND_FILE
-#define lib$find_file_end LIB$FIND_FILE_END
-#define lib$set_symbol LIB$SET_SYMBOL
-#define lib$sfree1_dd LIB$SFREE1_DD
-#define lib$spawn LIB$SPAWN
-#define sys$assign SYS$ASSIGN
-#define sys$crembx SYS$CREMBX
-#define sys$dassgn SYS$DASSGN
-#define sys$dclexh SYS$DCLEXH
-#define sys$getdviw SYS$GETDVIW
-#define sys$getsyiw SYS$GETSYIW
-#define sys$qio SYS$QIO
-#define sys$qiow SYS$QIOW
-#define sys$setef SYS$SETEF
-#define sys$synch SYS$SYNCH
-#define XDrawText XDRAWTEXT
-#define XtCloseDisplay XTCLOSEDISPLAY
-#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
-#define lib$ediv LIB$EDIV
-#define lib$subx LIB$SUBX
-#define sys$bintim SYS$BINTIM
-#define sys$gettim SYS$GETTIM
-#define XFetchName XFETCHNAME
-#define XPeekIfEvent XPEEKIFEVENT
-#define XQueryKeymap XQUERYKEYMAP
-#endif
diff --git a/nx-X11/extras/Mesa/include/GL/wmesa.h b/nx-X11/extras/Mesa/include/GL/wmesa.h
deleted file mode 100644
index 0a6e8b642..000000000
--- a/nx-X11/extras/Mesa/include/GL/wmesa.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 3.0
- * Copyright (C) 1995-1998 Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-/*
- * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
- * Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
- *
- *
- ***************************************************************
- * WMesa *
- * version 2.3 *
- * *
- * By *
- * Li Wei *
- * Institute of Artificial Intelligence & Robotics *
- * Xi'an Jiaotong University *
- * Email: liwei@aiar.xjtu.edu.cn *
- * Web page: http://sun.aiar.xjtu.edu.cn *
- * *
- * July 7th, 1997 *
- ***************************************************************
- */
-
-
-#ifndef WMESA_H
-#define WMESA_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#include "GL/gl.h"
-
-#if defined(_MSV_VER) && !defined(__GNUC__)
-# pragma warning (disable:4273)
-# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
-# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
-# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
-# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
-# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
-# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
-# if (MESA_WARNQUIET>1)
-# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
-# endif
-#endif
-
-/*
- * This is the WMesa context 'handle':
- */
-typedef struct wmesa_context *WMesaContext;
-
-
-
-/*
- * Create a new WMesaContext for rendering into a window. You must
- * have already created the window of correct visual type and with an
- * appropriate colormap.
- *
- * Input:
- * hWnd - Window handle
- * Pal - Palette to use
- * rgb_flag - GL_TRUE = RGB mode,
- * GL_FALSE = color index mode
- * db_flag - GL_TRUE = double-buffered,
- * GL_FALSE = single buffered
- * alpha_flag - GL_TRUE = create software alpha buffer,
- * GL_FALSE = no software alpha buffer
- *
- * Note: Indexed mode requires double buffering under Windows.
- *
- * Return: a WMesa_context or NULL if error.
- */
-extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal,
- GLboolean rgb_flag,
- GLboolean db_flag,
- GLboolean alpha_flag);
-
-
-/*
- * Destroy a rendering context as returned by WMesaCreateContext()
- */
-/*extern void WMesaDestroyContext( WMesaContext ctx );*/
-extern void WMesaDestroyContext( void );
-
-
-
-/*
- * Make the specified context the current one.
- */
-extern void WMesaMakeCurrent( WMesaContext ctx );
-
-
-/*
- * Return a handle to the current context.
- */
-extern WMesaContext WMesaGetCurrentContext( void );
-
-
-/*
- * Swap the front and back buffers for the current context. No action
- * taken if the context is not double buffered.
- */
-extern void WMesaSwapBuffers(void);
-
-
-/*
- * In indexed color mode we need to know when the palette changes.
- */
-extern void WMesaPaletteChange(HPALETTE Pal);
-
-extern void WMesaMove(void);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/include/GL/xmesa_x.h b/nx-X11/extras/Mesa/include/GL/xmesa_x.h
deleted file mode 100644
index 1455c88ad..000000000
--- a/nx-X11/extras/Mesa/include/GL/xmesa_x.h
+++ /dev/null
@@ -1,84 +0,0 @@
-
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- * When we're building the XMesa driver for stand-alone Mesa we
- * include this file when building the xm_*.c files.
- * We need to define some types and macros differently when building
- * in the Xserver vs. stand-alone Mesa.
- */
-
-#ifndef _XMESA_X_H_
-#define _XMESA_X_H_
-
-typedef Display XMesaDisplay;
-typedef Pixmap XMesaPixmap;
-typedef Colormap XMesaColormap;
-typedef Drawable XMesaDrawable;
-typedef Window XMesaWindow;
-typedef GC XMesaGC;
-typedef XVisualInfo *XMesaVisualInfo;
-typedef XImage XMesaImage;
-typedef XPoint XMesaPoint;
-typedef XColor XMesaColor;
-
-#define XMesaDestroyImage XDestroyImage
-
-#define XMesaPutPixel XPutPixel
-#define XMesaGetPixel XGetPixel
-
-#define XMesaSetForeground XSetForeground
-#define XMesaSetBackground XSetBackground
-#define XMesaSetPlaneMask XSetPlaneMask
-#define XMesaSetFunction XSetFunction
-#define XMesaSetFillStyle XSetFillStyle
-#define XMesaSetTile XSetTile
-
-#define XMesaDrawPoint XDrawPoint
-#define XMesaDrawPoints XDrawPoints
-#define XMesaFillRectangle XFillRectangle
-#define XMesaPutImage XPutImage
-#define XMesaCopyArea XCopyArea
-
-#define XMesaCreatePixmap XCreatePixmap
-#define XMesaFreePixmap XFreePixmap
-#define XMesaFreeGC XFreeGC
-
-#define GET_COLORMAP_SIZE(__v) __v->visinfo->colormap_size
-#define GET_REDMASK(__v) __v->mesa_visual.redMask
-#define GET_GREENMASK(__v) __v->mesa_visual.greenMask
-#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask
-#define GET_VISUAL_DEPTH(__v) __v->visinfo->depth
-#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->mesa_visual.screen)
-#define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display)
-#define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True)
-
-#endif
diff --git a/nx-X11/extras/Mesa/include/GLES/egl.h b/nx-X11/extras/Mesa/include/GLES/egl.h
deleted file mode 100644
index d62786d03..000000000
--- a/nx-X11/extras/Mesa/include/GLES/egl.h
+++ /dev/null
@@ -1,274 +0,0 @@
-#ifndef _EGL_H
-#define _EGL_H
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-#if 0/*XXX TEMPORARY HACK*/
-#include <GLES/gl.h>
-#else
-#include <GL/gl.h>
-#endif
-#include <GLES/egltypes.h>
-
-/* XXX should go in eglext.h */
-#define GL_OES_VERSION_1_0 1
-#define GL_OES_read_format 1
-#define GL_OES_compressed_paletted_texture 1
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-/* XXX */
-
-/*
-** Versioning and extensions
-*/
-#define EGL_VERSION_1_0 1
-#if 0
-#define EGL_VERSION_1_1 1
-#endif
-
-/*
-** Boolean
-*/
-#define EGL_FALSE 0
-#define EGL_TRUE 1
-
-/*
-** Errors
-*/
-#define EGL_SUCCESS 0x3000
-#define EGL_NOT_INITIALIZED 0x3001
-#define EGL_BAD_ACCESS 0x3002
-#define EGL_BAD_ALLOC 0x3003
-#define EGL_BAD_ATTRIBUTE 0x3004
-#define EGL_BAD_CONFIG 0x3005
-#define EGL_BAD_CONTEXT 0x3006
-#define EGL_BAD_CURRENT_SURFACE 0x3007
-#define EGL_BAD_DISPLAY 0x3008
-#define EGL_BAD_MATCH 0x3009
-#define EGL_BAD_NATIVE_PIXMAP 0x300A
-#define EGL_BAD_NATIVE_WINDOW 0x300B
-#define EGL_BAD_PARAMETER 0x300C
-#define EGL_BAD_SURFACE 0x300D
-#define EGL_CONTEXT_LOST 0x300E
-/* 0x300F - 0x301F reserved for additional errors. */
-
-/*
-** Config attributes
-*/
-#define EGL_BUFFER_SIZE 0x3020
-#define EGL_ALPHA_SIZE 0x3021
-#define EGL_BLUE_SIZE 0x3022
-#define EGL_GREEN_SIZE 0x3023
-#define EGL_RED_SIZE 0x3024
-#define EGL_DEPTH_SIZE 0x3025
-#define EGL_STENCIL_SIZE 0x3026
-#define EGL_CONFIG_CAVEAT 0x3027
-#define EGL_CONFIG_ID 0x3028
-#define EGL_LEVEL 0x3029
-#define EGL_MAX_PBUFFER_HEIGHT 0x302A
-#define EGL_MAX_PBUFFER_PIXELS 0x302B
-#define EGL_MAX_PBUFFER_WIDTH 0x302C
-#define EGL_NATIVE_RENDERABLE 0x302D
-#define EGL_NATIVE_VISUAL_ID 0x302E
-#define EGL_NATIVE_VISUAL_TYPE 0x302F
-/*#define EGL_PRESERVED_RESOURCES 0x3030*/
-#define EGL_SAMPLES 0x3031
-#define EGL_SAMPLE_BUFFERS 0x3032
-#define EGL_SURFACE_TYPE 0x3033
-#define EGL_TRANSPARENT_TYPE 0x3034
-#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
-#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
-#define EGL_TRANSPARENT_RED_VALUE 0x3037
-#define EGL_NONE 0x3038 /* Also a config value */
-#define EGL_BIND_TO_TEXTURE_RGB 0x3039
-#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
-#define EGL_MIN_SWAP_INTERVAL 0x303B
-#define EGL_MAX_SWAP_INTERVAL 0x303C
-
-/*
-** Config values
-*/
-#define EGL_DONT_CARE ((EGLint) -1)
-
-#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
-#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */
-#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
-#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */
-#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */
-#define EGL_TEXTURE_RGBA 0x305E /* " */
-#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */
-
-/*
-** Config attribute mask bits
-*/
-#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */
-#define EGL_PIXMAP_BIT 0x02 /* " */
-#define EGL_WINDOW_BIT 0x04 /* " */
-
-/*
-** String names
-*/
-#define EGL_VENDOR 0x3053 /* eglQueryString target */
-#define EGL_VERSION 0x3054 /* " */
-#define EGL_EXTENSIONS 0x3055 /* " */
-
-/*
-** Surface attributes
-*/
-#define EGL_HEIGHT 0x3056
-#define EGL_WIDTH 0x3057
-#define EGL_LARGEST_PBUFFER 0x3058
-#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */
-#define EGL_TEXTURE_TARGET 0x3081 /* " */
-#define EGL_MIPMAP_TEXTURE 0x3082 /* " */
-#define EGL_MIPMAP_LEVEL 0x3083 /* " */
-
-/*
-** BindTexImage / ReleaseTexImage buffer target
-*/
-#define EGL_BACK_BUFFER 0x3084
-
-/*
-** Current surfaces
-*/
-#define EGL_DRAW 0x3059
-#define EGL_READ 0x305A
-
-/*
-** Engines
-*/
-#define EGL_CORE_NATIVE_ENGINE 0x305B
-
-/* 0x305C-0x3FFFF reserved for future use */
-
-/*
-** Functions
-*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-GLAPI EGLint APIENTRY eglGetError (void);
-
-GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display);
-GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
-GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy);
-GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
-GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(void);
-
-GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
-
-GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
-GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
-GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
-GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
-
-/* EGL 1.1 render-to-texture APIs */
-GLAPI EGLBoolean APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
-GLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-GLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-
-/* EGL 1.1 swap control API */
-GLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
-
-GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
-GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
-GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
-GLAPI EGLContext APIENTRY eglGetCurrentContext (void);
-GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw);
-GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void);
-GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
-
-GLAPI EGLBoolean APIENTRY eglWaitGL (void);
-GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine);
-GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
-GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
-
-
-
-/* EGL_MESA_screen extension >>> PRELIMINARY <<< */
-#ifndef EGL_MESA_screen_surface
-#define EGL_MESA_screen_surface 1
-
-#define EGL_BAD_SCREEN_MESA 0x4000
-#define EGL_BAD_MODE_MESA 0x4001
-#define EGL_SCREEN_COUNT_MESA 0x4002
-#define EGL_SCREEN_POSITION_MESA 0x4003
-#define EGL_MODE_ID_MESA 0x4004
-#define EGL_REFRESH_RATE_MESA 0x4005
-#define EGL_OPTIMAL_MODE_MESA 0x4006
-#define EGL_SCREEN_BIT_MESA 0x08
-
-GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
-GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
-GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
-GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
-GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
-GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
-GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
-GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
-GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
-GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
-
-#endif /* EGL_MESA_screen_surface */
-
-
-#ifndef EGL_MESA_copy_context
-#define EGL_MESA_copy_context 1
-
-GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
-
-#endif /* EGL_MESA_copy_context */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _EGL_H */
diff --git a/nx-X11/extras/Mesa/include/GLES/egltypes.h b/nx-X11/extras/Mesa/include/GLES/egltypes.h
deleted file mode 100644
index 65cba8d57..000000000
--- a/nx-X11/extras/Mesa/include/GLES/egltypes.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-** egltypes.h for Mesa
-**
-** ONLY egl.h SHOULD INCLUDE THIS FILE!
-**
-** See comments about egltypes.h in the standard egl.h file.
-*/
-
-
-#include <sys/types.h>
-
-
-/*
-** These opaque EGL types are implemented as unsigned 32-bit integers:
-*/
-typedef u_int32_t EGLDisplay;
-typedef u_int32_t EGLConfig;
-typedef u_int32_t EGLSurface;
-typedef u_int32_t EGLContext;
-
-/* EGL_MESA_screen_surface */
-typedef u_int32_t EGLModeMESA;
-typedef u_int32_t EGLScreenMESA;
-
-
-/*
-** Other basic EGL types:
-*/
-typedef u_int8_t EGLBoolean;
-typedef int32_t EGLint;
-
-typedef void * NativeDisplayType;
-typedef int NativePixmapType;
-typedef int NativeWindowType;
-
-/*
-** EGL and native handle null values:
-*/
-#define EGL_DEFAULT_DISPLAY ((NativeDisplayType) 0)
-#define EGL_NO_CONTEXT ((EGLContext) 0)
-#define EGL_NO_DISPLAY ((EGLDisplay) 0)
-#define EGL_NO_SURFACE ((EGLSurface) 0)
-
-/* EGL_MESA_screen_surface */
-#define EGL_NO_MODE_MESA ((EGLModeMESA) 0)
diff --git a/nx-X11/extras/Mesa/mms-config. b/nx-X11/extras/Mesa/mms-config.
deleted file mode 100644
index 6a960084b..000000000
--- a/nx-X11/extras/Mesa/mms-config.
+++ /dev/null
@@ -1,23 +0,0 @@
-# Makefile for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-
-#vms
-.ifdef SHARE
-GL_SHAR = libMesaGL.exe
-GLU_SHAR = libMesaGLU.exe
-GLUT_SHAR = libglut.exe
-.endif
-GL_LIB = libMesaGL.olb
-GLU_LIB = libMesaGLU.olb
-GLUT_LIB = libglut.olb
-CC = cc
-CXX = cxx/define=(LIBRARYBUILD=1)/assume=(nostdnew,noglobal_array_new)
-CFLAGS1 =
-MAKELIB = library/create
-RANLIB = true
-.ifdef SHARE
-XLIBS = [--.vms]xlib_share/opt
-.else
-XLIBS = [--.vms]xlib/opt
-.endif
diff --git a/nx-X11/extras/Mesa/src/Makefile b/nx-X11/extras/Mesa/src/Makefile
deleted file mode 100644
index ffe2dbc6a..000000000
--- a/nx-X11/extras/Mesa/src/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# src/Makefile
-
-TOP = ..
-
-include $(TOP)/configs/current
-
-SUBDIRS = $(SRC_DIRS)
-
-
-default: message $(LIB_DIR) subdirs
-
-
-message:
- @echo "Making sources for" $(CONFIG_NAME)
-
-
-subdirs:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir ; $(MAKE)) || exit 1 ; \
- fi \
- done
-
-
-$(LIB_DIR):
- -mkdir $(LIB_DIR)
-
-
-clean:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir ; $(MAKE) clean) ; \
- fi \
- done
diff --git a/nx-X11/extras/Mesa/src/descrip.mms b/nx-X11/extras/Mesa/src/descrip.mms
deleted file mode 100644
index 71b8ea16a..000000000
--- a/nx-X11/extras/Mesa/src/descrip.mms
+++ /dev/null
@@ -1,43 +0,0 @@
-# Makefile for Mesa for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-.include [-]mms-config.
-
-all :
- set default [.mesa]
- $(MMS)$(MMSQUALIFIERS)
- set default [-]
-.ifdef SHARE
- $(MMS)$(MMSQUALIFIERS) [-.lib]$(GL_SHAR)
-.endif
- set default [.glu]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.glut.glx]
- $(MMS)$(MMSQUALIFIERS)
- set default [--]
-
-[-.lib]$(GL_SHAR) : [-.lib]$(GL_LIB)
- @ WRITE_ SYS$OUTPUT " generating libmesa.opt"
- @ library/extract=* [-.lib]$(GL_LIB)
- @ OPEN_/WRITE FILE libmesa.opt
- @ WRITE_ FILE "!"
- @ WRITE_ FILE "! libmesa.opt generated by DESCRIP.$(MMS_EXT)"
- @ WRITE_ FILE "!"
- @ WRITE_ FILE "IDENTIFICATION=""mesa5.1"""
- @ WRITE_ FILE "GSMATCH=LEQUAL,5,1
- @ WRITE_ FILE "libmesagl.obj"
- @ write_ file "sys$share:decw$xextlibshr/share"
- @ write_ file "sys$share:decw$xlibshr/share"
- @ write_ file "sys$share:pthread$rtl/share"
- @ CLOSE_ FILE
- @ $(MMS)$(MMSQUALIFIERS)/ignore=warning mesa_vms
- @ WRITE_ SYS$OUTPUT " linking ..."
- @ LINK_/NODEB/SHARE=[-.lib]$(GL_SHAR)/MAP=libmesa.map/FULL libmesa.opt/opt,\
- mesa_vms.opt/opt
- @ delete libmesagl.obj;*
-
-mesa_vms :
- @ WRITE_ SYS$OUTPUT " generating libmesa.map ..."
- @ LINK_/NODEB/NOSHARE/NOEXE/MAP=libmesa.map/FULL libmesa.opt/OPT
- @ WRITE_ SYS$OUTPUT " analyzing libmesa.map ..."
- @ @[-.vms]analyze_map.com libmesa.map mesa_vms.opt
diff --git a/nx-X11/extras/Mesa/src/glw/GLwDrawA.c b/nx-X11/extras/Mesa/src/glw/GLwDrawA.c
deleted file mode 100644
index 30304a408..000000000
--- a/nx-X11/extras/Mesa/src/glw/GLwDrawA.c
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-
-/*
- *
- * This file has been slightly modified from the original for use with Mesa
- *
- * Jeroen van der Zijp
- *
- * jvz@cyberia.cfdrc.com
- *
- */
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#include <GL/glx.h>
-#include <GL/gl.h>
-#ifdef __GLX_MOTIF
-#include <Xm/PrimitiveP.h>
-#include "GLwMDrawAP.h"
-#else
-#include "GLwDrawAP.h"
-#endif
-#include <assert.h>
-#include <stdio.h>
-
-#ifdef __GLX_MOTIF
-#define GLwDrawingAreaWidget GLwMDrawingAreaWidget
-#define GLwDrawingAreaClassRec GLwMDrawingAreaClassRec
-#define glwDrawingAreaClassRec glwMDrawingAreaClassRec
-#define glwDrawingAreaWidgetClass glwMDrawingAreaWidgetClass
-#define GLwDrawingAreaRec GLwMDrawingAreaRec
-#endif
-
-#define ATTRIBLIST_SIZE 32
-
-#define offset(field) XtOffset(GLwDrawingAreaWidget,glwDrawingArea.field)
-
-
-/* forward definitions */
-static void createColormap(GLwDrawingAreaWidget w,int offset,XrmValue *value);
-static void Initialize(GLwDrawingAreaWidget req,GLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args);
-static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes);
-static void Redraw(GLwDrawingAreaWidget w,XEvent *event,Region region);
-static void Resize(GLwDrawingAreaWidget glw);
-static void Destroy(GLwDrawingAreaWidget glw);
-static void glwInput(GLwDrawingAreaWidget glw,XEvent *event,String *params,Cardinal *numParams);
-
-
-
-static char defaultTranslations[] =
-#ifdef __GLX_MOTIF
- "<Key>osfHelp:PrimitiveHelp() \n"
-#endif
- "<KeyDown>: glwInput() \n\
- <KeyUp>: glwInput() \n\
- <BtnDown>: glwInput() \n\
- <BtnUp>: glwInput() \n\
- <BtnMotion>: glwInput() ";
-
-
-static XtActionsRec actions[] = {
- {"glwInput",(XtActionProc)glwInput}, /* key or mouse input */
- };
-
-
-/*
- * There is a bit of unusual handling of the resources here.
- * Because Xt insists on allocating the colormap resource when it is
- * processing the core resources (even if we redeclare the colormap
- * resource here, we need to do a little trick. When Xt first allocates
- * the colormap, we allow it to allocate the default one, since we have
- * not yet determined the appropriate visual (which is determined from
- * resources parsed after the colormap). We also let it allocate colors
- * in that default colormap.
- *
- * In the initialize proc we calculate the actual visual. Then, we
- * reobtain the colormap resource using XtGetApplicationResources in
- * the initialize proc. If requested, we also reallocate colors in
- * that colormap using the same method.
- */
-
-static XtResource resources[] = {
- /* The GLX attributes. Add any new attributes here */
-
- {GLwNbufferSize, GLwCBufferSize, XtRInt, sizeof (int),
- offset(bufferSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNlevel, GLwCLevel, XtRInt, sizeof (int),
- offset(level), XtRImmediate, (XtPointer) 0},
-
- {GLwNrgba, GLwCRgba, XtRBoolean, sizeof (Boolean),
- offset(rgba), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNdoublebuffer, GLwCDoublebuffer, XtRBoolean, sizeof (Boolean),
- offset(doublebuffer), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNstereo, GLwCStereo, XtRBoolean, sizeof (Boolean),
- offset(stereo), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNauxBuffers, GLwCAuxBuffers, XtRInt, sizeof (int),
- offset(auxBuffers), XtRImmediate, (XtPointer) 0},
-
- {GLwNredSize, GLwCColorSize, XtRInt, sizeof (int),
- offset(redSize), XtRImmediate, (XtPointer) 1},
-
- {GLwNgreenSize, GLwCColorSize, XtRInt, sizeof (int),
- offset(greenSize), XtRImmediate, (XtPointer) 1},
-
- {GLwNblueSize, GLwCColorSize, XtRInt, sizeof (int),
- offset(blueSize), XtRImmediate, (XtPointer) 1},
-
- {GLwNalphaSize, GLwCAlphaSize, XtRInt, sizeof (int),
- offset(alphaSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNdepthSize, GLwCDepthSize, XtRInt, sizeof (int),
- offset(depthSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNstencilSize, GLwCStencilSize, XtRInt, sizeof (int),
- offset(stencilSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumRedSize, GLwCAccumColorSize, XtRInt, sizeof (int),
- offset(accumRedSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumGreenSize, GLwCAccumColorSize, XtRInt, sizeof (int),
- offset(accumGreenSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumBlueSize, GLwCAccumColorSize, XtRInt, sizeof (int),
- offset(accumBlueSize), XtRImmediate, (XtPointer) 0},
-
- {GLwNaccumAlphaSize, GLwCAccumAlphaSize, XtRInt, sizeof (int),
- offset(accumAlphaSize), XtRImmediate, (XtPointer) 0},
-
- /* the attribute list */
- {GLwNattribList, GLwCAttribList, XtRPointer, sizeof(int *),
- offset(attribList), XtRImmediate, (XtPointer) NULL},
-
- /* the visual info */
- {GLwNvisualInfo, GLwCVisualInfo, GLwRVisualInfo, sizeof (XVisualInfo *),
- offset(visualInfo), XtRImmediate, (XtPointer) NULL},
-
- /* miscellaneous resources */
- {GLwNinstallColormap, GLwCInstallColormap, XtRBoolean, sizeof (Boolean),
- offset(installColormap), XtRImmediate, (XtPointer) TRUE},
-
- {GLwNallocateBackground, GLwCAllocateColors, XtRBoolean, sizeof (Boolean),
- offset(allocateBackground), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNallocateOtherColors, GLwCAllocateColors, XtRBoolean, sizeof (Boolean),
- offset(allocateOtherColors), XtRImmediate, (XtPointer) FALSE},
-
- {GLwNinstallBackground, GLwCInstallBackground, XtRBoolean, sizeof (Boolean),
- offset(installBackground), XtRImmediate, (XtPointer) TRUE},
-
- {GLwNginitCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(ginitCallback), XtRImmediate, (XtPointer) NULL},
-
- {GLwNinputCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(inputCallback), XtRImmediate, (XtPointer) NULL},
-
- {GLwNresizeCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(resizeCallback), XtRImmediate, (XtPointer) NULL},
-
- {GLwNexposeCallback, GLwCCallback, XtRCallback, sizeof (XtCallbackList),
- offset(exposeCallback), XtRImmediate, (XtPointer) NULL},
-
- /* Changes to Motif primitive resources */
-#ifdef __GLX_MOTIF
- {XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean),
- XtOffset (GLwDrawingAreaWidget, primitive.traversal_on), XmRImmediate,
- (XtPointer)FALSE},
-
- /* highlighting is normally disabled, as when Motif tries to disable
- * highlighting, it tries to reset the color back to the parent's
- * background (usually Motif blue). Unfortunately, that is in a
- * different colormap, and doesn't work too well.
- */
- {XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean),
- XtOffset (GLwDrawingAreaWidget, primitive.highlight_on_enter),
- XmRImmediate, (XtPointer) FALSE},
-
- {XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension,
- sizeof (Dimension),
- XtOffset (GLwDrawingAreaWidget, primitive.highlight_thickness),
- XmRImmediate, (XtPointer) 0},
-#endif
- };
-
-
-/*
-** The following resources are reobtained using XtGetApplicationResources
-** in the initialize proc.
-*/
-
-/* The colormap */
-static XtResource initializeResources[] = {
- /* reobtain the colormap with the new visual */
- {XtNcolormap, XtCColormap, XtRColormap, sizeof(Colormap),
- XtOffset(GLwDrawingAreaWidget, core.colormap),
- XtRCallProc,(XtPointer) createColormap},
- };
-
-
-/* reallocate any colors we need in the new colormap */
-
-/* The background is obtained only if the allocateBackground resource is TRUE*/
-static XtResource backgroundResources[] = {
-#ifdef __GLX_MOTIF
- {XmNbackground, XmCBackground,XmRPixel,
- sizeof(Pixel),XtOffset(GLwDrawingAreaWidget,core.background_pixel),
- XmRString,(XtPointer)"lightgrey"},
- /*XmRCallProc,(XtPointer)_XmBackgroundColorDefault},*/
-
- {XmNbackgroundPixmap,XmCPixmap,XmRXmBackgroundPixmap,
- sizeof(Pixmap),XtOffset(GLwDrawingAreaWidget,core.background_pixmap),
- XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP},
-
-#else
- {XtNbackground,XtCBackground,XtRPixel,sizeof(Pixel),
- XtOffset(GLwDrawingAreaWidget,core.background_pixel),
- XtRString,(XtPointer)"lightgrey"},
- /*XtRString,(XtPointer)"XtDefaultBackground"},*/
-
- {XtNbackgroundPixmap, XtCPixmap, XtRPixmap, sizeof(Pixmap),
- XtOffset(GLwDrawingAreaWidget,core.background_pixmap),
- XtRImmediate,(XtPointer)XtUnspecifiedPixmap},
-#endif
- };
-
-
-
-/* The other colors such as the foreground are allocated only if
- * allocateOtherColors are set. These resources only exist in Motif.
- */
-#ifdef __GLX_MOTIF
-static XtResource otherColorResources[] = {
- {XmNforeground,XmCForeground,XmRPixel,
- sizeof(Pixel),XtOffset(GLwDrawingAreaWidget,primitive.foreground),
- XmRString,(XtPointer)"lighgrey"},
- /*XmRCallProc, (XtPointer) _XmForegroundColorDefault},*/
-
- {XmNhighlightColor,XmCHighlightColor,XmRPixel,sizeof(Pixel),
- XtOffset(GLwDrawingAreaWidget,primitive.highlight_color),
- XmRString,(XtPointer)"lightgrey"},
- /*XmRCallProc,(XtPointer)_XmHighlightColorDefault},*/
-
- {XmNhighlightPixmap,XmCHighlightPixmap,XmRPrimHighlightPixmap,
- sizeof(Pixmap),
- XtOffset(GLwDrawingAreaWidget,primitive.highlight_pixmap),
- XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP},
- /*XmRCallProc,(XtPointer)_XmPrimitiveHighlightPixmapDefault},*/
- };
-#endif
-
-
-#undef offset
-
-
-GLwDrawingAreaClassRec glwDrawingAreaClassRec = {
- { /* core fields */
-#ifdef __GLX_MOTIF
- /* superclass */ (WidgetClass) &xmPrimitiveClassRec,
- /* class_name */ "GLwMDrawingArea",
-#else /* not __GLX_MOTIF */
- /* superclass */ (WidgetClass) &widgetClassRec,
- /* class_name */ "GLwDrawingArea",
-#endif /* __GLX_MOTIF */
- /* widget_size */ sizeof(GLwDrawingAreaRec),
- /* class_initialize */ NULL,
- /* class_part_initialize */ NULL,
- /* class_inited */ FALSE,
- /* initialize */ (XtInitProc) Initialize,
- /* initialize_hook */ NULL,
- /* realize */ Realize,
- /* actions */ actions,
- /* num_actions */ XtNumber(actions),
- /* resources */ resources,
- /* num_resources */ XtNumber(resources),
- /* xrm_class */ NULLQUARK,
- /* compress_motion */ TRUE,
- /* compress_exposure */ TRUE,
- /* compress_enterleave */ TRUE,
- /* visible_interest */ TRUE,
- /* destroy */ (XtWidgetProc) Destroy,
- /* resize */ (XtWidgetProc) Resize,
- /* expose */ (XtExposeProc) Redraw,
- /* set_values */ NULL,
- /* set_values_hook */ NULL,
- /* set_values_almost */ XtInheritSetValuesAlmost,
- /* get_values_hook */ NULL,
- /* accept_focus */ NULL,
- /* version */ XtVersion,
- /* callback_private */ NULL,
- /* tm_table */ defaultTranslations,
- /* query_geometry */ XtInheritQueryGeometry,
- /* display_accelerator */ XtInheritDisplayAccelerator,
- /* extension */ NULL
- },
-#ifdef __GLX_MOTIF /* primitive resources */
- {
- /* border_highlight */ XmInheritBorderHighlight,
- /* border_unhighlight */ XmInheritBorderUnhighlight,
- /* translations */ XtInheritTranslations,
- /* arm_and_activate */ NULL,
- /* get_resources */ NULL,
- /* num get_resources */ 0,
- /* extension */ NULL,
- }
-#endif
- };
-
-WidgetClass glwDrawingAreaWidgetClass=(WidgetClass)&glwDrawingAreaClassRec;
-
-
-
-static void error(Widget w,char* string){
- char buf[100];
-#ifdef __GLX_MOTIF
- sprintf(buf,"GLwMDrawingArea: %s\n",string);
-#else
- sprintf(buf,"GLwDrawingArea: %s\n",string);
-#endif
- XtAppError(XtWidgetToApplicationContext(w),buf);
- }
-
-
-static void warning(Widget w,char* string){
- char buf[100];
-#ifdef __GLX_MOTIF
- sprintf (buf, "GLwMDraw: %s\n", string);
-#else
- sprintf (buf, "GLwDraw: %s\n", string);
-#endif
- XtAppWarning(XtWidgetToApplicationContext(w), buf);
- }
-
-
-
-/* Initialize the attribList based on the attributes */
-static void createAttribList(GLwDrawingAreaWidget w){
- int *ptr;
- w->glwDrawingArea.attribList = (int*)XtMalloc(ATTRIBLIST_SIZE*sizeof(int));
- if(!w->glwDrawingArea.attribList){
- error((Widget)w,"Unable to allocate attribute list");
- }
- ptr = w->glwDrawingArea.attribList;
- *ptr++ = GLX_BUFFER_SIZE;
- *ptr++ = w->glwDrawingArea.bufferSize;
- *ptr++ = GLX_LEVEL;
- *ptr++ = w->glwDrawingArea.level;
- if(w->glwDrawingArea.rgba) *ptr++ = GLX_RGBA;
- if(w->glwDrawingArea.doublebuffer) *ptr++ = GLX_DOUBLEBUFFER;
- if(w->glwDrawingArea.stereo) *ptr++ = GLX_STEREO;
- *ptr++ = GLX_AUX_BUFFERS;
- *ptr++ = w->glwDrawingArea.auxBuffers;
- *ptr++ = GLX_RED_SIZE;
- *ptr++ = w->glwDrawingArea.redSize;
- *ptr++ = GLX_GREEN_SIZE;
- *ptr++ = w->glwDrawingArea.greenSize;
- *ptr++ = GLX_BLUE_SIZE;
- *ptr++ = w->glwDrawingArea.blueSize;
- *ptr++ = GLX_ALPHA_SIZE;
- *ptr++ = w->glwDrawingArea.alphaSize;
- *ptr++ = GLX_DEPTH_SIZE;
- *ptr++ = w->glwDrawingArea.depthSize;
- *ptr++ = GLX_STENCIL_SIZE;
- *ptr++ = w->glwDrawingArea.stencilSize;
- *ptr++ = GLX_ACCUM_RED_SIZE;
- *ptr++ = w->glwDrawingArea.accumRedSize;
- *ptr++ = GLX_ACCUM_GREEN_SIZE;
- *ptr++ = w->glwDrawingArea.accumGreenSize;
- *ptr++ = GLX_ACCUM_BLUE_SIZE;
- *ptr++ = w->glwDrawingArea.accumBlueSize;
- *ptr++ = GLX_ACCUM_ALPHA_SIZE;
- *ptr++ = w->glwDrawingArea.accumAlphaSize;
- *ptr++ = None;
- assert((ptr-w->glwDrawingArea.attribList)<ATTRIBLIST_SIZE);
- }
-
-
-
-/* Initialize the visualInfo based on the attribute list */
-static void createVisualInfo(GLwDrawingAreaWidget w){
- assert(w->glwDrawingArea.attribList);
- w->glwDrawingArea.visualInfo=glXChooseVisual(XtDisplay(w),XScreenNumberOfScreen(XtScreen(w)),w->glwDrawingArea.attribList);
- if(!w->glwDrawingArea.visualInfo) error((Widget)w,"requested visual not supported");
- }
-
-
-
-/* Initialize the colormap based on the visual info.
- * This routine maintains a cache of visual-infos to colormaps. If two
- * widgets share the same visual info, they share the same colormap.
- * This function is called by the callProc of the colormap resource entry.
- */
-static void createColormap(GLwDrawingAreaWidget w,int offset,XrmValue *value){
- static struct cmapCache { Visual *visual; Colormap cmap; } *cmapCache;
- static int cacheEntries=0;
- static int cacheMalloced=0;
- register int i;
-
- assert(w->glwDrawingArea.visualInfo);
-
- /* see if we can find it in the cache */
- for(i=0; i<cacheEntries; i++){
- if(cmapCache[i].visual==w->glwDrawingArea.visualInfo->visual){
- value->addr=(XtPointer)(&cmapCache[i].cmap);
- return;
- }
- }
-
- /* not in the cache, create a new entry */
- if(cacheEntries >= cacheMalloced){
- /* need to malloc a new one. Since we are likely to have only a
- * few colormaps, we allocate one the first time, and double
- * each subsequent time.
- */
- if(cacheMalloced==0){
- cacheMalloced=1;
- cmapCache=(struct cmapCache*)XtMalloc(sizeof(struct cmapCache));
- }
- else{
- cacheMalloced<<=1;
- cmapCache=(struct cmapCache*)XtRealloc((char*)cmapCache,sizeof(struct cmapCache)*cacheMalloced);
- }
- }
-
- cmapCache[cacheEntries].cmap=XCreateColormap(XtDisplay(w),
- RootWindow(XtDisplay(w),
- w->glwDrawingArea.visualInfo->screen),
- w->glwDrawingArea.visualInfo->visual,
- AllocNone);
- cmapCache[cacheEntries].visual=w->glwDrawingArea.visualInfo->visual;
- value->addr=(XtPointer)(&cmapCache[cacheEntries++].cmap);
- }
-
-
-
-static void Initialize(GLwDrawingAreaWidget req,GLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args){
-
- /* fix size */
- if(req->core.width==0) neww->core.width=100;
- if(req->core.height==0) neww->core.width=100;
-
- /* create the attribute list if needed */
- neww->glwDrawingArea.myList=FALSE;
- if(neww->glwDrawingArea.attribList==NULL){
- neww->glwDrawingArea.myList=TRUE;
- createAttribList(neww);
- }
-
- /* Gotta have it */
- assert(neww->glwDrawingArea.attribList);
-
- /* determine the visual info if needed */
- neww->glwDrawingArea.myVisual=FALSE;
- if(neww->glwDrawingArea.visualInfo==NULL){
- neww->glwDrawingArea.myVisual=TRUE;
- createVisualInfo(neww);
- }
-
- /* Gotta have that too */
- assert(neww->glwDrawingArea.visualInfo);
-
- neww->core.depth=neww->glwDrawingArea.visualInfo->depth;
-
- /* Reobtain the colormap and colors in it using XtGetApplicationResources*/
- XtGetApplicationResources((Widget)neww,neww,initializeResources,XtNumber(initializeResources),args,*num_args);
-
- /* obtain the color resources if appropriate */
- if(req->glwDrawingArea.allocateBackground){
- XtGetApplicationResources((Widget)neww,neww,backgroundResources,XtNumber(backgroundResources),args,*num_args);
- }
-
-#ifdef __GLX_MOTIF
- if(req->glwDrawingArea.allocateOtherColors){
- XtGetApplicationResources((Widget)neww,neww,otherColorResources,XtNumber(otherColorResources),args,*num_args);
- }
-#endif
- }
-
-
-
-static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes){
- register GLwDrawingAreaWidget glw=(GLwDrawingAreaWidget)w;
- GLwDrawingAreaCallbackStruct cb;
- Widget parentShell;
- Status status;
- Window windows[2],*windowsReturn,*windowList;
- int countReturn,i;
-
- /* if we haven't requested that the background be both installed and
- * allocated, don't install it.
- */
- if(!(glw->glwDrawingArea.installBackground && glw->glwDrawingArea.allocateBackground)){
- *valueMask&=~CWBackPixel;
- }
-
- XtCreateWindow(w,(unsigned int)InputOutput,glw->glwDrawingArea.visualInfo->visual,*valueMask,attributes);
-
- /* if appropriate, call XSetWMColormapWindows to install the colormap */
- if(glw->glwDrawingArea.installColormap){
-
- /* Get parent shell */
- for(parentShell=XtParent(w); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell));
-
- if(parentShell && XtWindow(parentShell)){
-
- /* check to see if there is already a property */
- status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn);
-
- /* if no property, just create one */
- if(!status){
- windows[0]=XtWindow(w);
- windows[1]=XtWindow(parentShell);
- XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windows,2);
- }
-
- /* there was a property, add myself to the beginning */
- else{
- windowList=(Window *)XtMalloc((sizeof(Window))*(countReturn+1));
- windowList[0]=XtWindow(w);
- for(i=0; i<countReturn; i++) windowList[i+1]=windowsReturn[i];
- XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windowList,countReturn+1);
- XtFree((char*)windowList);
- XtFree((char*)windowsReturn);
- }
- }
- else{
- warning(w,"Could not set colormap property on parent shell");
- }
- }
-
- /* Invoke callbacks */
- cb.reason=GLwCR_GINIT;
- cb.event=NULL;
- cb.width=glw->core.width;
- cb.height=glw->core.height;
- XtCallCallbackList((Widget)glw,glw->glwDrawingArea.ginitCallback,&cb);
- }
-
-
-
-static void Redraw(GLwDrawingAreaWidget w,XEvent *event,Region region){
- GLwDrawingAreaCallbackStruct cb;
- if(!XtIsRealized((Widget)w)) return;
- cb.reason=GLwCR_EXPOSE;
- cb.event=event;
- cb.width=w->core.width;
- cb.height=w->core.height;
- XtCallCallbackList((Widget)w,w->glwDrawingArea.exposeCallback,&cb);
- }
-
-
-
-static void Resize(GLwDrawingAreaWidget glw){
- GLwDrawingAreaCallbackStruct cb;
- if(!XtIsRealized((Widget)glw)) return;
- cb.reason=GLwCR_RESIZE;
- cb.event=NULL;
- cb.width=glw->core.width;
- cb.height=glw->core.height;
- XtCallCallbackList((Widget)glw,glw->glwDrawingArea.resizeCallback,&cb);
- }
-
-
-
-static void Destroy(GLwDrawingAreaWidget glw){
- Window *windowsReturn;
- Widget parentShell;
- Status status;
- int countReturn;
- register int i;
-
- if(glw->glwDrawingArea.myList && glw->glwDrawingArea.attribList){
- XtFree((XtPointer)glw->glwDrawingArea.attribList);
- }
-
- if(glw->glwDrawingArea.myVisual && glw->glwDrawingArea.visualInfo){
- XtFree((XtPointer)glw->glwDrawingArea.visualInfo);
- }
-
- /* if my colormap was installed, remove it */
- if(glw->glwDrawingArea.installColormap){
-
- /* Get parent shell */
- for(parentShell=XtParent(glw); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell));
-
- if(parentShell && XtWindow(parentShell)){
-
- /* make sure there is a property */
- status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn);
-
- /* if no property, just return. If there was a property, continue */
- if(status){
-
- /* search for a match */
- for(i=0; i<countReturn; i++){
- if(windowsReturn[i]==XtWindow(glw)){
-
- /* we found a match, now copy the rest down */
- for(i++; i<countReturn; i++){ windowsReturn[i-1]=windowsReturn[i]; }
-
- XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windowsReturn,countReturn-1);
- break;
- }
- }
- XtFree((char *)windowsReturn);
- }
- }
- }
- }
-
-
-
-/* Action routine for keyboard and mouse events */
-static void glwInput(GLwDrawingAreaWidget glw,XEvent *event,String *params,Cardinal *numParams){
- GLwDrawingAreaCallbackStruct cb;
- cb.reason=GLwCR_INPUT;
- cb.event=event;
- cb.width=glw->core.width;
- cb.height=glw->core.height;
- XtCallCallbackList((Widget)glw,glw->glwDrawingArea.inputCallback,&cb);
- }
-
-
-#ifdef __GLX_MOTIF
-
-/* Create routine */
-Widget GLwCreateMDrawingArea(Widget parent, char *name,ArgList arglist,Cardinal argcount){
- return XtCreateWidget(name,glwMDrawingAreaWidgetClass, parent, arglist,argcount);
- }
-
-#endif
-
-
-#ifndef __GLX_MOTIF
-
-/* Make context current */
-void GLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx){
- glXMakeCurrent(XtDisplay(w),XtWindow(w),ctx);
- }
-
-
-/* Swap buffers convenience function */
-void GLwDrawingAreaSwapBuffers(Widget w){
- glXSwapBuffers(XtDisplay(w),XtWindow(w));
- }
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/glw/GLwDrawA.h b/nx-X11/extras/Mesa/src/glw/GLwDrawA.h
deleted file mode 100644
index cd631b4fb..000000000
--- a/nx-X11/extras/Mesa/src/glw/GLwDrawA.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef _GLwDrawA_h
-#define _GLwDrawA_h
-
-#include <GL/glx.h>
-#include <GL/gl.h>
-
-/****************************************************************
- *
- * GLwDrawingArea widgets
- *
- ****************************************************************/
-
-/* Resources:
-
- Name Class RepType Default Value
- ---- ----- ------- -------------
- attribList AttribList int * NULL
- visualInfo VisualInfo VisualInfo NULL
- installColormap InstallColormap Boolean TRUE
- allocateBackground AllocateColors Boolean FALSE
- allocateOtherColors AllocateColors Boolean FALSE
- installBackground InstallBackground Boolean TRUE
- exposeCallback Callback Pointer NULL
- ginitCallback Callback Pointer NULL
- inputCallback Callback Pointer NULL
- resizeCallback Callback Pointer NULL
-
-*** The following resources all correspond to the GLX configuration
-*** attributes and are used to create the attribList if it is NULL
- bufferSize BufferSize int 0
- level Level int 0
- rgba Rgba Boolean FALSE
- doublebuffer Doublebuffer Boolean FALSE
- stereo Stereo Boolean FALSE
- auxBuffers AuxBuffers int 0
- redSize ColorSize int 1
- greenSize ColorSize int 1
- blueSize ColorSize int 1
- alphaSize AlphaSize int 0
- depthSize DepthSize int 0
- stencilSize StencilSize int 0
- accumRedSize AccumColorSize int 0
- accumGreenSize AccumColorSize int 0
- accumBlueSize AccumColorSize int 0
- accumAlphaSize AccumAlphaSize int 0
-*/
-
-#define GLwNattribList "attribList"
-#define GLwCAttribList "AttribList"
-#define GLwNvisualInfo "visualInfo"
-#define GLwCVisualInfo "VisualInfo"
-#define GLwRVisualInfo "VisualInfo"
-
-#define GLwNinstallColormap "installColormap"
-#define GLwCInstallColormap "InstallColormap"
-#define GLwNallocateBackground "allocateBackground"
-#define GLwNallocateOtherColors "allocateOtherColors"
-#define GLwCAllocateColors "AllocateColors"
-#define GLwNinstallBackground "installBackground"
-#define GLwCInstallBackground "InstallBackground"
-
-#define GLwCCallback "Callback"
-#define GLwNexposeCallback "exposeCallback"
-#define GLwNginitCallback "ginitCallback"
-#define GLwNresizeCallback "resizeCallback"
-#define GLwNinputCallback "inputCallback"
-
-#define GLwNbufferSize "bufferSize"
-#define GLwCBufferSize "BufferSize"
-#define GLwNlevel "level"
-#define GLwCLevel "Level"
-#define GLwNrgba "rgba"
-#define GLwCRgba "Rgba"
-#define GLwNdoublebuffer "doublebuffer"
-#define GLwCDoublebuffer "Doublebuffer"
-#define GLwNstereo "stereo"
-#define GLwCStereo "Stereo"
-#define GLwNauxBuffers "auxBuffers"
-#define GLwCAuxBuffers "AuxBuffers"
-#define GLwNredSize "redSize"
-#define GLwNgreenSize "greenSize"
-#define GLwNblueSize "blueSize"
-#define GLwCColorSize "ColorSize"
-#define GLwNalphaSize "alphaSize"
-#define GLwCAlphaSize "AlphaSize"
-#define GLwNdepthSize "depthSize"
-#define GLwCDepthSize "DepthSize"
-#define GLwNstencilSize "stencilSize"
-#define GLwCStencilSize "StencilSize"
-#define GLwNaccumRedSize "accumRedSize"
-#define GLwNaccumGreenSize "accumGreenSize"
-#define GLwNaccumBlueSize "accumBlueSize"
-#define GLwCAccumColorSize "AccumColorSize"
-#define GLwNaccumAlphaSize "accumAlphaSize"
-#define GLwCAccumAlphaSize "AccumAlphaSize"
-
-#ifdef __GLX_MOTIF
-
-typedef struct _GLwMDrawingAreaClassRec *GLwMDrawingAreaWidgetClass;
-typedef struct _GLwMDrawingAreaRec *GLwMDrawingAreaWidget;
-
-extern WidgetClass glwMDrawingAreaWidgetClass;
-
-
-#else
-
-typedef struct _GLwDrawingAreaClassRec *GLwDrawingAreaWidgetClass;
-typedef struct _GLwDrawingAreaRec *GLwDrawingAreaWidget;
-
-extern WidgetClass glwDrawingAreaWidgetClass;
-
-
-#endif
-
-
-/* Callback reasons */
-#ifdef __GLX_MOTIF
-#define GLwCR_EXPOSE XmCR_EXPOSE
-#define GLwCR_RESIZE XmCR_RESIZE
-#define GLwCR_INPUT XmCR_INPUT
-#else
-/* The same values as Motif, but don't use Motif constants */
-#define GLwCR_EXPOSE 38
-#define GLwCR_RESIZE 39
-#define GLwCR_INPUT 40
-#endif
-
-#define GLwCR_GINIT 32135 /* Arbitrary number that should neverr clash */
-
-typedef struct
- {
- int reason;
- XEvent *event;
- Dimension width,height;
- }
- GLwDrawingAreaCallbackStruct;
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* front ends to glXMakeCurrent and glXSwapBuffers */
-extern void GLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx);
-extern void GLwDrawingAreaSwapBuffers(Widget w);
-
-#ifdef __GLX_MOTIF
-#ifdef _NO_PROTO
-GLAPI Widget GLwCreateMDrawingArea();
-#else
-GLAPI Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
-#endif
-#endif
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/glw/GLwDrawAP.h b/nx-X11/extras/Mesa/src/glw/GLwDrawAP.h
deleted file mode 100644
index f12170195..000000000
--- a/nx-X11/extras/Mesa/src/glw/GLwDrawAP.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef _GLwDrawAP_h
-#define _GLwDrawAP_h
-
-
-/* MOTIF */
-#ifdef __GLX_MOTIF
-#include "GLwMDrawA.h"
-#else
-#include "GLwDrawA.h"
-#endif
-
-typedef struct _GLwDrawingAreaClassPart {
- caddr_t extension;
- } GLwDrawingAreaClassPart;
-
-
-#ifdef __GLX_MOTIF
-typedef struct _GLwMDrawingAreaClassRec {
- CoreClassPart core_class;
- XmPrimitiveClassPart primitive_class;
- GLwDrawingAreaClassPart glwDrawingArea_class;
- } GLwMDrawingAreaClassRec;
-
-
-extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec;
-
-
-/* XT */
-#else
-
-typedef struct _GLwDrawingAreaClassRec {
- CoreClassPart core_class;
- GLwDrawingAreaClassPart glwDrawingArea_class;
- } GLwDrawingAreaClassRec;
-
-extern GLwDrawingAreaClassRec glwDrawingAreaClassRec;
-
-
-#endif
-
-
-
-typedef struct {
- /* resources */
- int * attribList;
- XVisualInfo * visualInfo;
- Boolean myList; /* TRUE if we malloced the attribList*/
- Boolean myVisual; /* TRUE if we created the visualInfo*/
- Boolean installColormap;
- Boolean allocateBackground;
- Boolean allocateOtherColors;
- Boolean installBackground;
- XtCallbackList ginitCallback;
- XtCallbackList resizeCallback;
- XtCallbackList exposeCallback;
- XtCallbackList inputCallback;
- /* specific attributes; add as we get new attributes */
- int bufferSize;
- int level;
- Boolean rgba;
- Boolean doublebuffer;
- Boolean stereo;
- int auxBuffers;
- int redSize;
- int greenSize;
- int blueSize;
- int alphaSize;
- int depthSize;
- int stencilSize;
- int accumRedSize;
- int accumGreenSize;
- int accumBlueSize;
- int accumAlphaSize;
- } GLwDrawingAreaPart;
-
-#ifdef __GLX_MOTIF
-
-typedef struct _GLwMDrawingAreaRec {
- CorePart core;
- XmPrimitivePart primitive;
- GLwDrawingAreaPart glwDrawingArea;
- } GLwMDrawingAreaRec;
-
-#else
-
-typedef struct _GLwDrawingAreaRec {
- CorePart core;
- GLwDrawingAreaPart glwDrawingArea;
- } GLwDrawingAreaRec;
-
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/glw/GLwMDrawA.c b/nx-X11/extras/Mesa/src/glw/GLwMDrawA.c
deleted file mode 100644
index bdefe92a6..000000000
--- a/nx-X11/extras/Mesa/src/glw/GLwMDrawA.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef __GLX_MOTIF
-#define __GLX_MOTIF 1
-#endif
-#include "GLwDrawA.c"
diff --git a/nx-X11/extras/Mesa/src/glw/GLwMDrawA.h b/nx-X11/extras/Mesa/src/glw/GLwMDrawA.h
deleted file mode 100644
index 2e2458904..000000000
--- a/nx-X11/extras/Mesa/src/glw/GLwMDrawA.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef __GLX_MOTIF
-#define __GLX_MOTIF 1
-#endif
-#include "GLwDrawA.h"
diff --git a/nx-X11/extras/Mesa/src/glw/GLwMDrawAP.h b/nx-X11/extras/Mesa/src/glw/GLwMDrawAP.h
deleted file mode 100644
index a0a689bb9..000000000
--- a/nx-X11/extras/Mesa/src/glw/GLwMDrawAP.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-#ifndef __GLX_MOTIF
-#define __GLX_MOTIF 1
-#endif
-#include "GLwDrawAP.h"
diff --git a/nx-X11/extras/Mesa/src/glw/Makefile b/nx-X11/extras/Mesa/src/glw/Makefile
deleted file mode 100644
index 3c66c6778..000000000
--- a/nx-X11/extras/Mesa/src/glw/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-# src/glw/Makefile
-
-TOP = ../..
-include $(TOP)/configs/current
-
-MAJOR = 1
-MINOR = 0
-TINY = 0
-
-INCDIRS = -I$(TOP)/include -I/usr/include/Motif1.2 -I/usr/contrib/X11R6/include -I/usr/X11R6/include
-
-
-OBJECTS = $(GLW_SOURCES:.c=.o)
-
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCDIRS) $(CFLAGS) $<
-
-
-
-##### TARGETS #####
-
-default: $(LIB_DIR)/$(GLW_LIB_NAME)
-
-
-clean:
- -rm depend depend.bak
- -rm -f *.o *~
-
-
-# Make the library
-$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' \
- -major $(MAJOR) -minor $(MINOR) -patch $(TINY) \
- $(MKLIB_OPTIONS) -install $(LIB_DIR) \
- $(GLW_LIB_DEPS) $(OBJECTS)
-
-
-#
-# Run 'make depend' to update the dependencies if you change what's included
-# by any source file.
-#
-depend: $(GLW_SOURCES)
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(GLW_SOURCES) \
- > /dev/null
-
-
-include depend
diff --git a/nx-X11/extras/Mesa/src/glw/README b/nx-X11/extras/Mesa/src/glw/README
deleted file mode 100644
index 70f4f7bc2..000000000
--- a/nx-X11/extras/Mesa/src/glw/README
+++ /dev/null
@@ -1,56 +0,0 @@
-
- widgets README file
-
-
-This directory contains the source code for SGI's OpenGL Xt/Motif widgets,
-slightly modified by Jeroen van der Zijp to work better with Mesa.
-
-To compile the widget code (producing lib/libGLw.a) cd to the widgets/
-directory and type 'make <config>' where <config> is the system configuration
-you used to compile Mesa (like 'make linux'). This hasn't been tested on
-many systems so let us know if you have trouble.
-
-If you want to make a Linux ELF shared lib instead of the non-shared .a
-file see the notes in the Makefile.
-
-If you want to build with Motif support, edit Makefile.X11, looking
-for the "Motif" information.
-
-The SGI copyright is as follows.
-
-
- * (c) Copyright 1993, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
diff --git a/nx-X11/extras/Mesa/src/glx/Makefile b/nx-X11/extras/Mesa/src/glx/Makefile
deleted file mode 100644
index bd486cf81..000000000
--- a/nx-X11/extras/Mesa/src/glx/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-TOP = ../..
-include $(TOP)/configs/current
-
-
-default:
- cd mini ; $(MAKE)
-
-
-clean:
- cd mini ; $(MAKE) clean
-
diff --git a/nx-X11/extras/Mesa/src/glx/mini/Makefile b/nx-X11/extras/Mesa/src/glx/mini/Makefile
deleted file mode 100644
index e87905acb..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/Makefile
+++ /dev/null
@@ -1,86 +0,0 @@
-# Build a subset DRI-based libGL.so library.
-# Indirect rendering not supported, etc.
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-
-DEFINES += -DGLX_DIRECT_RENDERING -DIN_MINI_GLX -UIN_DRI_DRIVER
-
-C_SOURCES = \
- $(TOP)/src/mesa/main/dispatch.c \
- $(TOP)/src/mesa/glapi/glapi.c \
- $(TOP)/src/mesa/glapi/glthread.c \
- $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c \
- $(DRM_SOURCE_PATH)/libdrm/xf86drm.c \
- $(DRM_SOURCE_PATH)/libdrm/xf86drmHash.c \
- $(DRM_SOURCE_PATH)/libdrm/xf86drmRandom.c \
- miniglx.c \
- miniglx_events.c
-
-X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o)
-
-INCLUDES = -I. $(INCLUDE_DIRS)
-
-INCLUDE_DIRS = \
- -I$(TOP)/include \
- -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/swrast \
- -I$(TOP)/src/mesa/swrast_setup \
- -I$(TOP)/src/mesa/drivers/dri/common \
- -I$(DRM_SOURCE_PATH)/libdrm \
- -I$(DRM_SOURCE_PATH)/shared
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend $(LIB_DIR)/$(GL_LIB_NAME)
-
-
-# Make libGL
-$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
- $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
- -major 1 -minor 2 $(MKLIB_OPTIONS) \
- -install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
- rm -f $(LIB_DIR)/miniglx.conf
- install example.miniglx.conf $(LIB_DIR)/miniglx.conf
-
-
-drmtest: xf86drm.o drmtest.o
- rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o
-
-
-depend: $(C_SOURCES) $(ASM_SOURCES)
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
- > /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean:
- -rm -f drmtest $(LIB_DIR)/libGL.so*
- -rm -f *.o *~
- -rm -f depend
-
-include depend
diff --git a/nx-X11/extras/Mesa/src/glx/mini/NOTES b/nx-X11/extras/Mesa/src/glx/mini/NOTES
deleted file mode 100644
index 1774107d6..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/NOTES
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-Getting MiniGLX up and running
-------------------------------
-
-It's necessary to do a bit of work to set up an environment to run miniglx.
-
-For the radeon driver, it's necessary to get the right set of kernel
-modules installed before attempting to run any programs:
-
- rmmod radeon agpgart;
- insmod agpgart;
- insmod $(MESA)/src/kernel/radeonfb/radeonfb.o;
- insmod $(MESA)/src/kernel/radeon/radeon.o;
-
-For all drivers, its necessary to reach the compiled libraries, and
-tell MiniGLX where to find it's configuration file:
-
- export LD_LIBRARY_PATH=$(MESA)/lib;
- export MINIGLX_CONF=$(MESA)/lib/miniglx.conf
-
-------------------------------------------------------------
-
-MiniGLX Example Programs
-------------------------
-
-The following programs will work with miniglx:
-
- $(MESA)/tests/miniglx
- $(MESA)/xdemos/glxgears
-
-Thanks to the miniglut stub library, most of the mesa glut demos will
-work. In particular, the following have been tested. (Note there is
-no keyboard or mouse interaction with these demos).
-
- $(MESA)/demos/gears
- $(MESA)/demos/geartrain
- $(MESA)/demos/morph3d
- $(MESA)/demos/isosurf
- $(MESA)/demos/texobj
- $(MESA)/demos/texcyl
- $(MESA)/demos/gloss
- $(MESA)/demos/fire
- $(MESA)/demos/tunnel
- $(MESA)/demos/teapot
- $(MESA)/samples/prim
- $(MESA)/samples/olympic
- $(MESA)/samples/star
- $(MESA)/samples/wave
- ...etc
-
-In fact most of the glut demos seem to work within the constraints of
-having no keyboard/mouse interactivity. Furthermore, the use of the
-glut wrapper means that these programs don't require recompilation to
-run under MiniGLX -- the same binary works with both regular GLX and
-MiniGLX.
-
-
-------------------------------------------------------------
-
-Porting GLX apps to MiniGLX
----------------------------
-
-A quick list of issues encountered in porting existing GLX apps to
-MiniGLX. Listed in no particular order.
-
-1) No input events
-
-MiniGLX doesn't provide an input layer, so any X11 input event
-handling in the existing app will have to be redone for whatever
-input devices exist on the target.
-
-2) No configuration, expose events
-
-Many GLX and Xlib programs wait on an event to ensure the window has
-become visible after being mapped. MiniGLX provides no equivalent
-facility.
-
-3) Different headers
-
-X11/Xlib.h, GL/GLX.h, etc must not be used if the program is being
-compiled against MiniGLX.
-
-The equivalent header is GL/MiniGLX.h.
-
-4) Different library
-
-It may be necessary to link directly against the minGLX libGL.so.
-
-5) Reduced number of Xlib and GLX entrypoints.
-
-By definition (MiniGLX is a subset of GLX), many Xlib and GLX
-entrypoints, structures and macros are not present in MiniGLX. It
-will be necessary to find and eliminate all references to
-non-supported entrypoints.
-
-
----------------------------------------------------------------
-
-Bugs in radeonfb.o -- the radeon framebuffer driver.
-----------------------------------------------------
-
-Several bugs have been found in the radeonfb.o framebuffer driver.
-Most of these are resolved in the version included in the MiniGLX
-sources, but some remain:
-
-1) Occasionally, after entering graphics mode, colors appear 'shifted'
-or 'translated', particularly in higher resolution modes. This is
-definitely a bug in radeonfb.o as this can be provoked even when using
-the software dri driver (fb_dri.so). Importance: High. Workaround:
-Use 800x600 as it seems to be less frequent at this resolution,
-otherwise, restart the application.
-
-
-
diff --git a/nx-X11/extras/Mesa/src/glx/mini/dispatch.c b/nx-X11/extras/Mesa/src/glx/mini/dispatch.c
deleted file mode 100644
index ac24df9e7..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/dispatch.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * \file miniglx/dispatch.c
- *
- * \brief C-based dispatch of the OpenGL entry points (glAccum(), glBegin(),
- * etc).
- *
- * \author Brian Paul <brian@precisioninsight.com>
- *
- * \note This code IS NOT USED if we're compiling on an x86 system and using
- * the glapi_x86.S assembly code.
- */
-
-/*
- * 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.
- */
-
-#include "glheader.h"
-#include "glapi.h"
-#include "glapitable.h"
-
-
-#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
-
-#define KEYWORD1
-
-#define KEYWORD2
-
-#define NAME(func) gl##func
-
-#define DISPATCH(func, args, msg) \
- const struct _glapi_table *dispatch; \
- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
- (dispatch->func) args
-
-#define RETURN_DISPATCH(func, args, msg) \
- const struct _glapi_table *dispatch; \
- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
- return (dispatch->func) args
-
-
-#include "glapitemp.h"
-
-#endif /* USE_X86_ASM */
diff --git a/nx-X11/extras/Mesa/src/glx/mini/driver.h b/nx-X11/extras/Mesa/src/glx/mini/driver.h
deleted file mode 100644
index 27402641b..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/driver.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/**
- * \file driver.h
- * \brief 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.
- *
- * Look for more comments in the dri_util.c file.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Brian Paul <brian@precisioninsight.com>
- */
-
-/*
- * 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 _driver_H_
-#define _driver_H_
-
-#define CAPI /* XXX this should be globally defined somewhere */
-
-#include "GL/gl.h"
-#include "GL/internal/glcore.h"
-
-#include "drm.h"
-#include "drm_sarea.h"
-
-/**
- * \brief DRIDriverContext type.
- */
-typedef struct DRIDriverContextRec {
- const char *pciBusID;
- int pciBus;
- int pciDevice;
- int pciFunc;
- int chipset;
- int bpp;
- int cpp;
- int agpmode;
- int isPCI;
-
- int colorTiling; /**< \brief color tiling is enabled */
-
- unsigned long FBStart; /**< \brief physical address of the framebuffer */
- unsigned long MMIOStart; /**< \brief physical address of the MMIO region */
-
- int FBSize; /**< \brief size of the mmap'd framebuffer in bytes */
- int MMIOSize; /**< \brief size of the mmap'd MMIO region in bytes */
-
- void *FBAddress; /**< \brief start of the mmap'd framebuffer */
- void *MMIOAddress; /**< \brief start of the mmap'd MMIO region */
-
- /**
- * \brief Client configuration details
- *
- * These are computed on the server and sent to clients as part of
- * the initial handshaking.
- */
- struct {
- unsigned long hSAREA;
- int SAREASize;
- unsigned long hFrameBuffer;
- int fbOrigin;
- int fbSize;
- int fbStride;
- int virtualWidth;
- int virtualHeight;
- } shared;
-
- /**
- * \name From DRIInfoRec
- */
- /*@{*/
- int drmFD; /**< \brief DRM device file descriptor */
- drm_sarea_t *pSAREA;
- unsigned int serverContext; /**< \brief DRM context only active on server */
- /*@}*/
-
-
- /**
- * \name Driver private
- *
- * Populated by __driInitFBDev()
- */
- /*@{*/
- void *driverPrivate;
- void *driverClientMsg;
- int driverClientMsgSize;
- /*@}*/
-} DRIDriverContext;
-
-/**
- * \brief Interface to the DRI driver.
- *
- * This structure is retrieved from the loadable driver by the \e
- * __driDriver symbol to access the Mini GLX specific hardware
- * initialization and take down routines.
- */
-typedef struct DRIDriverRec {
- /**
- * \brief Validate the framebuffer device mode
- */
- int (*validateMode)( const DRIDriverContext *context );
-
- /**
- * \brief Examine mode returned by fbdev (may differ from the one
- * requested), restore any hw regs clobbered by fbdev.
- */
- int (*postValidateMode)( const DRIDriverContext *context );
-
- /**
- * \brief Initialize the framebuffer device.
- */
- int (*initFBDev)( DRIDriverContext *context );
-
- /**
- * \brief Halt the framebuffer device.
- */
- void (*haltFBDev)( DRIDriverContext *context );
-
-
- /**
- * \brief Idle and shutdown hardware in preparation for a VT switch.
- */
- int (*shutdownHardware)( const DRIDriverContext *context );
-
- /**
- * \brief Restore hardware state after regaining the VT.
- */
- int (*restoreHardware)( const DRIDriverContext *context );
-
- /**
- * \brief Notify hardware driver of gain/loose focus. May be zero
- * as this is of limited utility for most drivers.
- */
- void (*notifyFocus)( int have_focus );
-} DRIDriver;
-
-#endif /* _driver_H_ */
diff --git a/nx-X11/extras/Mesa/src/glx/mini/example.miniglx.conf b/nx-X11/extras/Mesa/src/glx/mini/example.miniglx.conf
deleted file mode 100644
index 62dd4f65e..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/example.miniglx.conf
+++ /dev/null
@@ -1,36 +0,0 @@
-# Example miniglx configuration file (/etc/miniglx.conf)
-#
-
-# Framebuffer device to open: Might need to change this on dual-head
-# systems.
-fbdevDevice=/dev/fb0
-
-# Which driver?
-# radeon_dri.so -- HW accelerated radeon driver
-# fb_dri.so -- Software rasterizer
-clientDriverName=radeon_dri.so
-
-# The pci bus id of the video card. Find this with scanpci, lspci or
-# look in /proc/pci.
-pciBusID=PCI:1:0:0
-
-# Is the card PCI or AGP ?
-isPCI=0
-
-# Virtual screen dimensions. Can reduce this to save videocard memory
-# at the expense of maximum window size available.
-virtualWidth=1280
-virtualHeight=1024
-
-# Screen depth. Only 16 & 32bpp supported.
-bpp=32
-
-# AGP Mode. Not all cards supported (1, 2 or 4)
-agpmode=1
-
-# Rotated monitor? -- NOTE: only works with subsetted radeon driver!
-rotateMode=0
-
-# Do we want to use color tiling ?
-colorTiling=0
-
diff --git a/nx-X11/extras/Mesa/src/glx/mini/miniglx.c b/nx-X11/extras/Mesa/src/glx/mini/miniglx.c
deleted file mode 100644
index c1c4446ab..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/miniglx.c
+++ /dev/null
@@ -1,2563 +0,0 @@
-/**
- * \file miniglx.c
- * \brief Mini GLX interface functions.
- * \author Brian Paul
- *
- * The Mini GLX interface is a subset of the GLX interface, plus a
- * minimal set of Xlib functions.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.0.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \mainpage Mini GLX
- *
- * \section miniglxIntro Introduction
- *
- * The Mini GLX interface facilitates OpenGL rendering on embedded devices. The
- * interface is a subset of the GLX interface, plus a minimal set of Xlib-like
- * functions.
- *
- * Programs written to the Mini GLX specification should run unchanged
- * on systems with the X Window System and the GLX extension (after
- * recompilation). The intention is to allow flexibility for
- * prototyping and testing.
- *
- * The files in the src/miniglx/ directory are compiled to build the
- * libGL.so library. This is the library which applications link with.
- * libGL.so in turn, loads the hardware-specific device driver.
- *
- *
- * \section miniglxDoxygen About Doxygen
- *
- * For a list of all files, select <b>File List</b>. Choose a file from
- * the list for a list of all functions in the file.
- *
- * For a list of all functions, types, constants, etc.
- * select <b>File Members</b>.
- *
- *
- * \section miniglxReferences References
- *
- * - <A HREF="file:../../docs/MiniGLX.html">Mini GLX Specification</A>,
- * Tungsten Graphics, Inc.
- * - OpenGL Graphics with the X Window System, Silicon Graphics, Inc.,
- * ftp://ftp.sgi.com/opengl/doc/opengl1.2/glx1.3.ps
- * - Xlib - C Language X Interface, X Consortium Standard, X Version 11,
- * Release 6.4, ftp://ftp.x.org/pub/R6.4/xc/doc/hardcopy/X11/xlib.PS.gz
- * - XFree86 Man pages, The XFree86 Project, Inc.,
- * http://www.xfree86.org/current/manindex3.html
- *
- */
-
-/**
- * \page datatypes Notes on the XVisualInfo, Visual, and __GLXvisualConfig data types
- *
- * -# X (unfortunately) has two (or three) data types which
- * describe visuals. Ideally, there would just be one.
- * -# We need the #__GLXvisualConfig type to augment #XVisualInfo and #Visual
- * because we need to describe the GLX-specific attributes of visuals.
- * -# In this interface there is a one-to-one-to-one correspondence between
- * the three types and they're all interconnected.
- * -# The #XVisualInfo type has a pointer to a #Visual. The #Visual structure
- * (aka MiniGLXVisualRec) has a pointer to the #__GLXvisualConfig. The
- * #Visual structure also has a pointer pointing back to the #XVisualInfo.
- * -# The #XVisualInfo structure is the only one who's contents are public.
- * -# The glXChooseVisual() and XGetVisualInfo() are the only functions that
- * return #XVisualInfo structures. They can be freed with XFree(), though
- * there is a small memory leak.
- */
-
-
-#include <assert.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/time.h> /* for gettimeofday */
-#include <linux/kd.h>
-#include <linux/vt.h>
-
-#include "miniglxP.h"
-#include "dri_util.h"
-
-#include "imports.h"
-#include "glcontextmodes.h"
-#include "glapi.h"
-
-
-static GLboolean __glXCreateContextWithConfig(__DRInativeDisplay *dpy,
- int screen, int fbconfigID, void *contextID,
- drm_context_t *hHWContext);
-
-static GLboolean __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
- __DRIid draw, unsigned int * index, unsigned int * stamp,
- int * x, int * y, int * width, int * height,
- int * numClipRects, drm_clip_rect_t ** pClipRects,
- int * backX, int * backY,
- int * numBackClipRects, drm_clip_rect_t ** pBackClipRects);
-
-static __DRIscreen * __glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
-
-static GLboolean __glXWindowExists(__DRInativeDisplay *dpy, __DRIid draw);
-
-static int __glXGetUST( int64_t * ust );
-
-static GLboolean __glXGetMscRate(__DRInativeDisplay * dpy, __DRIid drawable,
- int32_t * numerator, int32_t * denominator);
-
-static GLboolean xf86DRI_DestroyContext(__DRInativeDisplay *dpy, int screen,
- __DRIid context_id );
-
-static GLboolean xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen,
- __DRIid drawable, drm_drawable_t *hHWDrawable );
-
-static GLboolean xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen,
- __DRIid drawable);
-
-
-/** Wrapper around either malloc() */
-void *
-_mesa_malloc(size_t bytes)
-{
- return malloc(bytes);
-}
-
-/** Wrapper around either calloc() */
-void *
-_mesa_calloc(size_t bytes)
-{
- return calloc(1, bytes);
-}
-
-/** Wrapper around either free() */
-void
-_mesa_free(void *ptr)
-{
- free(ptr);
-}
-
-
-/**
- * \brief Current GLX context.
- *
- * \sa glXGetCurrentContext().
- */
-static GLXContext CurrentContext = NULL;
-
-
-
-static Display *SignalDisplay = 0;
-
-static void SwitchVT(int sig)
-{
- fprintf(stderr, "SwitchVT %d dpy %p\n", sig, SignalDisplay);
-
- if (SignalDisplay) {
- SignalDisplay->vtSignalFlag = 1;
- switch( sig )
- {
- case SIGUSR1: /* vt has been released */
- SignalDisplay->haveVT = 0;
- break;
- case SIGUSR2: /* vt has been acquired */
- SignalDisplay->haveVT = 1;
- break;
- }
- }
-}
-
-/**********************************************************************/
-/** \name Framebuffer device functions */
-/**********************************************************************/
-/*@{*/
-
-/**
- * \brief Do the first part of setting up the framebuffer device.
- *
- * \param dpy the display handle.
- * \param use_vt use a VT for display or not
- *
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \sa This is called during XOpenDisplay().
- *
- * \internal
- * Gets the VT number, opens the respective console TTY device. Saves its state
- * to restore when exiting and goes into graphics mode.
- *
- * Opens the framebuffer device and make a copy of the original variable screen
- * information and gets the fixed screen information. Maps the framebuffer and
- * MMIO region into the process address space.
- */
-static GLboolean
-OpenFBDev( Display *dpy, int use_vt )
-{
- char ttystr[1000];
- int fd, vtnumber, ttyfd;
-
- assert(dpy);
-
- if (geteuid()) {
- fprintf(stderr, "error: you need to be root\n");
- return GL_FALSE;
- }
-
- if (use_vt) {
-
- /* open /dev/tty0 and get the VT number */
- if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) {
- fprintf(stderr, "error opening /dev/tty0\n");
- return GL_FALSE;
- }
- if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) {
- fprintf(stderr, "error: couldn't get a free vt\n");
- return GL_FALSE;
- }
-
- fprintf(stderr, "*** got vt nr: %d\n", vtnumber);
- close(fd);
-
- /* open the console tty */
- sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */
- dpy->ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0);
- if (dpy->ConsoleFD < 0) {
- fprintf(stderr, "error couldn't open console fd\n");
- return GL_FALSE;
- }
-
- /* save current vt number */
- {
- struct vt_stat vts;
- if (ioctl(dpy->ConsoleFD, VT_GETSTATE, &vts) == 0)
- dpy->OriginalVT = vts.v_active;
- }
-
- /* disconnect from controlling tty */
- ttyfd = open("/dev/tty", O_RDWR);
- if (ttyfd >= 0) {
- ioctl(ttyfd, TIOCNOTTY, 0);
- close(ttyfd);
- }
-
- /* some magic to restore the vt when we exit */
- {
- struct vt_mode vt;
- struct sigaction sig_tty;
-
- /* Set-up tty signal handler to catch the signal we request below */
- SignalDisplay = dpy;
- memset( &sig_tty, 0, sizeof( sig_tty ) );
- sig_tty.sa_handler = SwitchVT;
- sigemptyset( &sig_tty.sa_mask );
- if( sigaction( SIGUSR1, &sig_tty, &dpy->OrigSigUsr1 ) ||
- sigaction( SIGUSR2, &sig_tty, &dpy->OrigSigUsr2 ) )
- {
- fprintf(stderr, "error: can't set up signal handler (%s)",
- strerror(errno) );
- return GL_FALSE;
- }
-
-
-
- vt.mode = VT_PROCESS;
- vt.waitv = 0;
- vt.relsig = SIGUSR1;
- vt.acqsig = SIGUSR2;
- if (ioctl(dpy->ConsoleFD, VT_SETMODE, &vt) < 0) {
- fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
-
- if (ioctl(dpy->ConsoleFD, VT_ACTIVATE, vtnumber) != 0)
- printf("ioctl VT_ACTIVATE: %s\n", strerror(errno));
- if (ioctl(dpy->ConsoleFD, VT_WAITACTIVE, vtnumber) != 0)
- printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno));
-
- if (ioctl(dpy->ConsoleFD, VT_GETMODE, &vt) < 0) {
- fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno));
- return GL_FALSE;
- }
-
-
-
- }
-
- /* go into graphics mode */
- if (ioctl(dpy->ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) {
- fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
- }
-
- /* open the framebuffer device */
- dpy->FrameBufferFD = open(dpy->fbdevDevice, O_RDWR);
- if (dpy->FrameBufferFD < 0) {
- fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
- return GL_FALSE;
- }
-
- /* get the original variable screen info */
- if (ioctl(dpy->FrameBufferFD, FBIOGET_VSCREENINFO, &dpy->OrigVarInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
- /* make copy */
- dpy->VarInfo = dpy->OrigVarInfo; /* structure copy */
-
- /* Turn off hw accels (otherwise mmap of mmio region will be
- * refused)
- */
- dpy->VarInfo.accel_flags = 0;
- if (ioctl(dpy->FrameBufferFD, FBIOPUT_VSCREENINFO, &dpy->VarInfo)) {
- fprintf(stderr, "error: ioctl(FBIOPUT_VSCREENINFO) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
-
-
- /* Get the fixed screen info */
- if (ioctl(dpy->FrameBufferFD, FBIOGET_FSCREENINFO, &dpy->FixedInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
-
-
- /* mmap the framebuffer into our address space */
- dpy->driverContext.FBStart = dpy->FixedInfo.smem_start;
- dpy->driverContext.FBSize = dpy->FixedInfo.smem_len;
- dpy->driverContext.shared.fbSize = dpy->FixedInfo.smem_len;
- dpy->driverContext.FBAddress = (caddr_t) mmap(0, /* start */
- dpy->driverContext.shared.fbSize, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- dpy->FrameBufferFD, /* fd */
- 0 /* offset */);
- if (dpy->driverContext.FBAddress == (caddr_t) - 1) {
- fprintf(stderr, "error: unable to mmap framebuffer: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
- /* mmap the MMIO region into our address space */
- dpy->driverContext.MMIOStart = dpy->FixedInfo.mmio_start;
- dpy->driverContext.MMIOSize = dpy->FixedInfo.mmio_len;
- dpy->driverContext.MMIOAddress = (caddr_t) mmap(0, /* start */
- dpy->driverContext.MMIOSize, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- dpy->FrameBufferFD, /* fd */
- dpy->FixedInfo.smem_len /* offset */);
- if (dpy->driverContext.MMIOAddress == (caddr_t) - 1) {
- fprintf(stderr, "error: unable to mmap mmio region: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
- fprintf(stderr, "got MMIOAddress %p offset %d\n",
- dpy->driverContext.MMIOAddress,
- dpy->FixedInfo.smem_len);
-
- return GL_TRUE;
-}
-
-
-
-
-/**
- * \brief Setup up the desired framebuffer device mode.
- *
- * \param dpy the display handle.
- *
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \sa This is called during __miniglx_StartServer().
- *
- * \internal
- *
- * Bumps the size of the window the the next supported mode. Sets the
- * variable screen information according to the desired mode and asks
- * the driver to validate the mode. Certifies that a DirectColor or
- * TrueColor visual is used from the updated fixed screen information.
- * In the case of DirectColor visuals, sets up an 'identity' colormap to
- * mimic a TrueColor visual.
- *
- * Calls the driver hooks 'ValidateMode' and 'PostValidateMode' to
- * allow the driver to make modifications to the chosen mode according
- * to hardware constraints, or to save and restore videocard registers
- * that may be clobbered by the fbdev driver.
- *
- * \todo Timings are hard-coded in the source for a set of supported modes.
- */
-static GLboolean
-SetupFBDev( Display *dpy )
-{
- int width, height;
-
- assert(dpy);
-
- width = dpy->driverContext.shared.virtualWidth;
- height = dpy->driverContext.shared.virtualHeight;
-
- if (width==832)
- width=800;
- /* Bump size up to next supported mode.
- */
- if (width <= 720 && height <= 480) {
- width = 720; height = 480;
- }
- else if (width <= 960 && height <= 540) {
- width = 960; height = 540;
- }
- else if (width <= 800 && height <= 600) {
- width = 800; height = 600;
- }
- else if (width <= 1024 && height <= 768) {
- width = 1024; height = 768;
- }
- else if (width <= 768 && height <= 1024) {
- width = 768; height = 1024;
- }
- else if (width <= 1280 && height <= 1024) {
- width = 1280; height = 1024;
- }
-
-
- dpy->driverContext.shared.fbStride = width * (dpy->driverContext.bpp / 8);
-
- /* set the depth, resolution, etc */
- dpy->VarInfo = dpy->OrigVarInfo;
- dpy->VarInfo.bits_per_pixel = dpy->driverContext.bpp;
- dpy->VarInfo.xres_virtual = dpy->driverContext.shared.virtualWidth;
- dpy->VarInfo.yres_virtual = dpy->driverContext.shared.virtualHeight;
- dpy->VarInfo.xres = width;
- dpy->VarInfo.yres = height;
- dpy->VarInfo.xoffset = 0;
- dpy->VarInfo.yoffset = 0;
- dpy->VarInfo.nonstd = 0;
- dpy->VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */
-
- if (dpy->VarInfo.bits_per_pixel == 32) {
- dpy->VarInfo.red.offset = 16;
- dpy->VarInfo.green.offset = 8;
- dpy->VarInfo.blue.offset = 0;
- dpy->VarInfo.transp.offset = 24;
- dpy->VarInfo.red.length = 8;
- dpy->VarInfo.green.length = 8;
- dpy->VarInfo.blue.length = 8;
- dpy->VarInfo.transp.length = 8;
- }
- else if (dpy->VarInfo.bits_per_pixel == 16) {
- dpy->VarInfo.red.offset = 11;
- dpy->VarInfo.green.offset = 5;
- dpy->VarInfo.blue.offset = 0;
- dpy->VarInfo.red.length = 5;
- dpy->VarInfo.green.length = 6;
- dpy->VarInfo.blue.length = 5;
- dpy->VarInfo.transp.offset = 0;
- dpy->VarInfo.transp.length = 0;
- }
- else {
- fprintf(stderr, "Only 32bpp and 16bpp modes supported at the moment\n");
- return 0;
- }
-
- if (!dpy->driver->validateMode( &dpy->driverContext )) {
- fprintf(stderr, "Driver validateMode() failed\n");
- return 0;
- }
-
- /* These should be calculated with the gtf.c program, and then we could
- remove all this... AlanH. */
- if (dpy->VarInfo.xres == 1280 &&
- dpy->VarInfo.yres == 1024) {
- /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */
- dpy->VarInfo.pixclock = 7408;
- dpy->VarInfo.left_margin = 248;
- dpy->VarInfo.right_margin = 16;
- dpy->VarInfo.upper_margin = 38;
- dpy->VarInfo.lower_margin = 1;
- dpy->VarInfo.hsync_len = 144;
- dpy->VarInfo.vsync_len = 3;
- }
- else if (dpy->VarInfo.xres == 1024 &&
- dpy->VarInfo.yres == 768) {
- /* timing values taken from /etc/fb.modes (1024x768 @ 75Hz) */
- dpy->VarInfo.pixclock = 12699;
- dpy->VarInfo.left_margin = 176;
- dpy->VarInfo.right_margin = 16;
- dpy->VarInfo.upper_margin = 28;
- dpy->VarInfo.lower_margin = 1;
- dpy->VarInfo.hsync_len = 96;
- dpy->VarInfo.vsync_len = 3;
- }
- else if (dpy->VarInfo.xres == 800 &&
- dpy->VarInfo.yres == 600) {
- /* timing values taken from /etc/fb.modes (800x600 @ 75Hz) */
- dpy->VarInfo.pixclock = 27778;
- dpy->VarInfo.left_margin = 128;
- dpy->VarInfo.right_margin = 24;
- dpy->VarInfo.upper_margin = 22;
- dpy->VarInfo.lower_margin = 1;
- dpy->VarInfo.hsync_len = 72;
- dpy->VarInfo.vsync_len = 2;
- }
- else if (dpy->VarInfo.xres == 720 &&
- dpy->VarInfo.yres == 480) {
- dpy->VarInfo.pixclock = 37202;
- dpy->VarInfo.left_margin = 88;
- dpy->VarInfo.right_margin = 16;
- dpy->VarInfo.upper_margin = 14;
- dpy->VarInfo.lower_margin = 1;
- dpy->VarInfo.hsync_len = 72;
- dpy->VarInfo.vsync_len = 3;
- }
- else if (dpy->VarInfo.xres == 960 &&
- dpy->VarInfo.yres == 540) {
- dpy->VarInfo.pixclock = 24273;
- dpy->VarInfo.left_margin = 128;
- dpy->VarInfo.right_margin = 32;
- dpy->VarInfo.upper_margin = 16;
- dpy->VarInfo.lower_margin = 1;
- dpy->VarInfo.hsync_len = 96;
- dpy->VarInfo.vsync_len = 3;
- }
- else if (dpy->VarInfo.xres == 768 &&
- dpy->VarInfo.yres == 1024) {
- /* timing values for 768x1024 @ 75Hz */
- dpy->VarInfo.pixclock = 11993;
- dpy->VarInfo.left_margin = 136;
- dpy->VarInfo.right_margin = 32;
- dpy->VarInfo.upper_margin = 41;
- dpy->VarInfo.lower_margin = 1;
- dpy->VarInfo.hsync_len = 80;
- dpy->VarInfo.vsync_len = 3;
- }
- else {
- /* XXX need timings for other screen sizes */
- fprintf(stderr, "XXXX screen size %d x %d not supported at this time!\n",
- dpy->VarInfo.xres, dpy->VarInfo.yres);
- return GL_FALSE;
- }
-
- fprintf(stderr, "[miniglx] Setting mode: visible %dx%d virtual %dx%dx%d\n",
- dpy->VarInfo.xres, dpy->VarInfo.yres,
- dpy->VarInfo.xres_virtual, dpy->VarInfo.yres_virtual,
- dpy->VarInfo.bits_per_pixel);
-
- /* set variable screen info */
- if (ioctl(dpy->FrameBufferFD, FBIOPUT_VSCREENINFO, &dpy->VarInfo)) {
- fprintf(stderr, "error: ioctl(FBIOPUT_VSCREENINFO) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
- /* get the variable screen info, in case it has been modified */
- if (ioctl(dpy->FrameBufferFD, FBIOGET_VSCREENINFO, &dpy->VarInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
-
- fprintf(stderr, "[miniglx] Readback mode: visible %dx%d virtual %dx%dx%d\n",
- dpy->VarInfo.xres, dpy->VarInfo.yres,
- dpy->VarInfo.xres_virtual, dpy->VarInfo.yres_virtual,
- dpy->VarInfo.bits_per_pixel);
-
- /* Get the fixed screen info */
- if (ioctl(dpy->FrameBufferFD, FBIOGET_FSCREENINFO, &dpy->FixedInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
- strerror(errno));
- return GL_FALSE;
- }
-
- if (dpy->FixedInfo.visual != FB_VISUAL_TRUECOLOR &&
- dpy->FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) {
- fprintf(stderr, "non-TRUECOLOR visuals not supported.\n");
- return GL_FALSE;
- }
-
- if (dpy->FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
- struct fb_cmap cmap;
- unsigned short red[256], green[256], blue[256];
- int rcols = 1 << dpy->VarInfo.red.length;
- int gcols = 1 << dpy->VarInfo.green.length;
- int bcols = 1 << dpy->VarInfo.blue.length;
- int i;
-
- cmap.start = 0;
- cmap.len = gcols;
- cmap.red = red;
- cmap.green = green;
- cmap.blue = blue;
- cmap.transp = NULL;
-
- for (i = 0; i < rcols ; i++)
- red[i] = (65536/(rcols-1)) * i;
-
- for (i = 0; i < gcols ; i++)
- green[i] = (65536/(gcols-1)) * i;
-
- for (i = 0; i < bcols ; i++)
- blue[i] = (65536/(bcols-1)) * i;
-
- if (ioctl(dpy->FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) {
- fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
- exit(1);
- }
- }
-
- /* May need to restore regs fbdev has clobbered:
- */
- if (!dpy->driver->postValidateMode( &dpy->driverContext )) {
- fprintf(stderr, "Driver postValidateMode() failed\n");
- return 0;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * \brief Restore the framebuffer device to state it was in before we started
- *
- * Undoes the work done by SetupFBDev().
- *
- * \param dpy the display handle.
- *
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \sa Called from XDestroyWindow().
- *
- * \internal
- * Restores the original variable screen info.
- */
-static GLboolean
-RestoreFBDev( Display *dpy )
-{
- /* restore original variable screen info */
- if (ioctl(dpy->FrameBufferFD, FBIOPUT_VSCREENINFO, &dpy->OrigVarInfo)) {
- fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
- return GL_FALSE;
- }
- dpy->VarInfo = dpy->OrigVarInfo;
-
- return GL_TRUE;
-}
-
-
-/**
- * \brief Close the framebuffer device.
- *
- * \param dpy the display handle.
- *
- * \sa Called from XCloseDisplay().
- *
- * \internal
- * Unmaps the framebuffer and MMIO region. Restores the text mode and the
- * original virtual terminal. Closes the console and framebuffer devices.
- */
-static void
-CloseFBDev( Display *dpy )
-{
- struct vt_mode VT;
-
- munmap(dpy->driverContext.FBAddress, dpy->driverContext.FBSize);
- munmap(dpy->driverContext.MMIOAddress, dpy->driverContext.MMIOSize);
-
- if (dpy->ConsoleFD) {
- /* restore text mode */
- ioctl(dpy->ConsoleFD, KDSETMODE, KD_TEXT);
-
- /* set vt */
- if (ioctl(dpy->ConsoleFD, VT_GETMODE, &VT) != -1) {
- VT.mode = VT_AUTO;
- ioctl(dpy->ConsoleFD, VT_SETMODE, &VT);
- }
-
- /* restore original vt */
- if (dpy->OriginalVT >= 0) {
- ioctl(dpy->ConsoleFD, VT_ACTIVATE, dpy->OriginalVT);
- dpy->OriginalVT = -1;
- }
-
- close(dpy->ConsoleFD);
- }
- close(dpy->FrameBufferFD);
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Misc functions needed for DRI drivers */
-/**********************************************************************/
-/*@{*/
-
-/**
- * \brief Find the DRI screen dependent methods associated with the display.
- *
- * \param dpy a display handle, as returned by XOpenDisplay().
- * \param scrn the screen number. Not referenced.
- *
- * \returns a pointer to a __DRIscreenRec structure.
- *
- * \internal
- * Returns the MiniGLXDisplayRec::driScreen attribute.
- */
-static __DRIscreen *
-__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn)
-{
- (void) scrn;
- return &((Display*)dpy)->driScreen;
-}
-
-/**
- * \brief Validate a drawable.
- *
- * \param dpy a display handle, as returned by XOpenDisplay().
- * \param draw drawable to validate.
- *
- * \internal
- * Since Mini GLX only supports one window, compares the specified drawable with
- * the MiniGLXDisplayRec::TheWindow attribute.
- */
-static GLboolean
-__glXWindowExists(__DRInativeDisplay *dpy, __DRIid draw)
-{
- const Display * const display = (Display*)dpy;
- if (display->TheWindow == (Window) draw)
- return True;
- else
- return False;
-}
-
-/**
- * \brief Get current thread ID.
- *
- * \return thread ID.
- *
- * \internal
- * Always returns 0.
- */
-/*unsigned long
-_glthread_GetID(void)
-{
- return 0;
-}*/
-
-/*@}*/
-
-
-/**
- * \brief Scan Linux /prog/bus/pci/devices file to determine hardware
- * chipset based on supplied bus ID.
- *
- * \return probed chipset (non-zero) on success, zero otherwise.
- *
- * \internal
- */
-static int get_chipset_from_busid( Display *dpy )
-{
- char buf[0x200];
- FILE *file;
- const char *fname = "/proc/bus/pci/devices";
- int retval = 0;
-
- if (!(file = fopen(fname,"r"))) {
- fprintf(stderr, "couldn't open %s: %s\n", fname, strerror(errno));
- return 0;
- }
-
- while (fgets(buf, sizeof(buf)-1, file)) {
- unsigned int nr, bus, dev, fn, vendor, device, encode;
- nr = sscanf(buf, "%04x\t%04x%04x", &encode,
- &vendor, &device);
-
- bus = encode >> 8;
- dev = (encode & 0xFF) >> 3;
- fn = encode & 0x7;
-
- if (nr != 3)
- break;
-
- if (bus == dpy->driverContext.pciBus &&
- dev == dpy->driverContext.pciDevice &&
- fn == dpy->driverContext.pciFunc) {
- retval = device;
- break;
- }
- }
-
- fclose(file);
-
- if (retval)
- fprintf(stderr, "[miniglx] probed chipset 0x%x\n", retval);
- else
- fprintf(stderr, "[miniglx] failed to probe chipset\n");
-
- return retval;
-}
-
-
-/**
- * \brief Read settings from a configuration file.
- *
- * The configuration file is usually "/etc/miniglx.conf", but can be overridden
- * with the MINIGLX_CONF environment variable.
- *
- * The format consists in \code option = value \endcode lines. The option names
- * corresponds to the fields in MiniGLXDisplayRec.
- *
- * \param dpy the display handle as.
- *
- * \return non-zero on success, zero otherwise.
- *
- * \internal
- * Sets some defaults. Opens and parses the the Mini GLX configuration file and
- * fills in the MiniGLXDisplayRec field that corresponds for each option.
- */
-static int __read_config_file( Display *dpy )
-{
- FILE *file;
- const char *fname;
-
- /* Fallback/defaults
- */
- dpy->fbdevDevice = "/dev/fb0";
- dpy->clientDriverName = "fb_dri.so";
- dpy->driverContext.pciBus = 0;
- dpy->driverContext.pciDevice = 0;
- dpy->driverContext.pciFunc = 0;
- dpy->driverContext.chipset = 0;
- dpy->driverContext.pciBusID = 0;
- dpy->driverContext.shared.virtualWidth = 1280;
- dpy->driverContext.shared.virtualHeight = 1024;
- dpy->driverContext.bpp = 32;
- dpy->driverContext.cpp = 4;
- dpy->rotateMode = 0;
- dpy->driverContext.agpmode = 1;
- dpy->driverContext.isPCI = 0;
- dpy->driverContext.colorTiling = 0;
-
- fname = getenv("MINIGLX_CONF");
- if (!fname) fname = "/etc/miniglx.conf";
-
- file = fopen(fname, "r");
- if (!file) {
- fprintf(stderr, "couldn't open config file %s: %s\n", fname, strerror(errno));
- return 0;
- }
-
-
- while (!feof(file)) {
- char buf[81], *opt = buf, *val, *tmp1, *tmp2;
- fgets(buf, sizeof(buf), file);
-
- /* Parse 'opt = val' -- must be easier ways to do this.
- */
- while (isspace(*opt)) opt++;
- val = opt;
- if (*val == '#') continue; /* comment */
- while (!isspace(*val) && *val != '=' && *val) val++;
- tmp1 = val;
- while (isspace(*val)) val++;
- if (*val != '=') continue;
- *tmp1 = 0;
- val++;
- while (isspace(*val)) val++;
- tmp2 = val;
- while (!isspace(*tmp2) && *tmp2 != '\n' && *tmp2) tmp2++;
- *tmp2 = 0;
-
-
- if (strcmp(opt, "fbdevDevice") == 0)
- dpy->fbdevDevice = strdup(val);
- else if (strcmp(opt, "clientDriverName") == 0)
- dpy->clientDriverName = strdup(val);
- else if (strcmp(opt, "rotateMode") == 0)
- dpy->rotateMode = atoi(val) ? 1 : 0;
- else if (strcmp(opt, "pciBusID") == 0) {
- if (sscanf(val, "PCI:%d:%d:%d",
- &dpy->driverContext.pciBus,
- &dpy->driverContext.pciDevice,
- &dpy->driverContext.pciFunc) != 3) {
- fprintf(stderr, "malformed bus id: %s\n", val);
- continue;
- }
- dpy->driverContext.pciBusID = strdup(val);
- }
- else if (strcmp(opt, "chipset") == 0) {
- if (sscanf(val, "0x%x", &dpy->driverContext.chipset) != 1)
- fprintf(stderr, "malformed chipset: %s\n", opt);
- }
- else if (strcmp(opt, "virtualWidth") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.shared.virtualWidth) != 1)
- fprintf(stderr, "malformed virtualWidth: %s\n", opt);
- }
- else if (strcmp(opt, "virtualHeight") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.shared.virtualHeight) != 1)
- fprintf(stderr, "malformed virutalHeight: %s\n", opt);
- }
- else if (strcmp(opt, "bpp") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.bpp) != 1)
- fprintf(stderr, "malformed bpp: %s\n", opt);
- dpy->driverContext.cpp = dpy->driverContext.bpp / 8;
- }
- else if (strcmp(opt, "agpmode") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.agpmode) != 1)
- fprintf(stderr, "malformed agpmode: %s\n", opt);
- }
- else if (strcmp(opt, "isPCI") == 0) {
- dpy->driverContext.isPCI = atoi(val) ? 1 : 0;
- }
- else if (strcmp(opt, "colorTiling") == 0) {
- dpy->driverContext.colorTiling = atoi(val) ? 1 : 0;
- }
- }
-
- fclose(file);
-
- if (dpy->driverContext.chipset == 0 && dpy->driverContext.pciBusID != 0)
- dpy->driverContext.chipset = get_chipset_from_busid( dpy );
-
- return 1;
-}
-
-/**
- * Versioned name of the expected \c __driCreateNewScreen function.
- *
- * The version of the last incompatible loader/driver inteface change is
- * appended to the name of the \c __driCreateNewScreen function. This
- * prevents loaders from trying to load drivers that are too old.
- *
- * \todo
- * Create a macro or something so that this is automatically updated.
- */
-static const char createNewScreenName[] = "__driCreateNewScreen_20050727";
-
-
-static int InitDriver( Display *dpy )
-{
- /*
- * Begin DRI setup.
- * We're kind of combining the per-display and per-screen information
- * which was kept separate in XFree86/DRI's libGL.
- */
- dpy->dlHandle = dlopen(dpy->clientDriverName, RTLD_NOW | RTLD_GLOBAL);
- if (!dpy->dlHandle) {
- fprintf(stderr, "Unable to open %s: %s\n", dpy->clientDriverName,
- dlerror());
- goto failed;
- }
-
- /* Pull in Mini GLX specific hooks:
- */
- dpy->driver = (struct DRIDriverRec *) dlsym(dpy->dlHandle,
- "__driDriver");
- if (!dpy->driver) {
- fprintf(stderr, "Couldn't find __driDriver in %s\n",
- dpy->clientDriverName);
- goto failed;
- }
-
- /* Pull in standard DRI client-side driver hooks:
- */
- dpy->createNewScreen = (PFNCREATENEWSCREENFUNC)
- dlsym(dpy->dlHandle, createNewScreenName);
- if (!dpy->createNewScreen) {
- fprintf(stderr, "Couldn't find %s in %s\n", createNewScreenName,
- dpy->clientDriverName);
- goto failed;
- }
-
- return GL_TRUE;
-
-failed:
- if (dpy->dlHandle) {
- dlclose(dpy->dlHandle);
- dpy->dlHandle = 0;
- }
- return GL_FALSE;
-}
-
-
-/**********************************************************************/
-/** \name Public API functions (Xlib and GLX) */
-/**********************************************************************/
-/*@{*/
-
-
-/**
- * \brief Initialize the graphics system.
- *
- * \param display_name currently ignored. It is recommended to pass it as NULL.
- * \return a pointer to a #Display if the function is able to initialize
- * the graphics system, NULL otherwise.
- *
- * Allocates a MiniGLXDisplayRec structure and fills in with information from a
- * configuration file.
- *
- * Calls OpenFBDev() to open the framebuffer device and calls
- * DRIDriverRec::initFBDev to do the client-side initialization on it.
- *
- * Loads the DRI driver and pulls in Mini GLX specific hooks into a
- * DRIDriverRec structure, and the standard DRI \e __driCreateScreen hook.
- * Asks the driver for a list of supported visuals. Performs the per-screen
- * client-side initialization. Also setups the callbacks in the screen private
- * information.
- *
- * Does the framebuffer device setup. Calls __miniglx_open_connections() to
- * serve clients.
- */
-Display *
-__miniglx_StartServer( const char *display_name )
-{
- Display *dpy;
- int use_vt = 0;
-
- dpy = (Display *)calloc(1, sizeof(Display));
- if (!dpy)
- return NULL;
-
- dpy->IsClient = False;
-
- if (!__read_config_file( dpy )) {
- fprintf(stderr, "Couldn't get configuration details\n");
- free(dpy);
- return NULL;
- }
-
- /* Open the fbdev device
- */
- if (!OpenFBDev(dpy, use_vt)) {
- fprintf(stderr, "OpenFBDev failed\n");
- free(dpy);
- return NULL;
- }
-
- if (!InitDriver(dpy)) {
- fprintf(stderr, "InitDriver failed\n");
- free(dpy);
- return NULL;
- }
-
- /* Perform the initialization normally done in the X server
- */
- if (!dpy->driver->initFBDev( &dpy->driverContext )) {
- fprintf(stderr, "%s: __driInitFBDev failed\n", __FUNCTION__);
- dlclose(dpy->dlHandle);
- return GL_FALSE;
- }
-
- /* do fbdev setup
- */
- if (!SetupFBDev(dpy)) {
- fprintf(stderr, "SetupFBDev failed\n");
- free(dpy);
- return NULL;
- }
-
- /* unlock here if not using VT -- JDS */
- if (!use_vt) {
- if (dpy->driver->restoreHardware)
- dpy->driver->restoreHardware( &dpy->driverContext );
- DRM_UNLOCK( dpy->driverContext.drmFD,
- dpy->driverContext.pSAREA,
- dpy->driverContext.serverContext );
- dpy->hwActive = 1;
- }
-
- /* Ready for clients:
- */
- if (!__miniglx_open_connections(dpy)) {
- free(dpy);
- return NULL;
- }
-
- return dpy;
-}
-
-
-/**
- * Implement \c __DRIinterfaceMethods::getProcAddress.
- */
-static __DRIfuncPtr get_proc_address( const char * proc_name )
-{
- (void) proc_name;
- return NULL;
-}
-
-
-/**
- * Table of functions exported by the loader to the driver.
- */
-static const __DRIinterfaceMethods interface_methods = {
- get_proc_address,
-
- _gl_context_modes_create,
- _gl_context_modes_destroy,
-
- __glXFindDRIScreen,
- __glXWindowExists,
-
- __glXCreateContextWithConfig,
- xf86DRI_DestroyContext,
-
- xf86DRI_CreateDrawable,
- xf86DRI_DestroyDrawable,
- __glXGetDrawableInfo,
-
- __glXGetUST,
- __glXGetMscRate,
-};
-
-
-static void *
-CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
-{
- void *psp = NULL;
- drm_handle_t hSAREA;
- drmAddress pSAREA;
- const char *BusID;
- int i;
- __DRIversion ddx_version;
- __DRIversion dri_version;
- __DRIversion drm_version;
- __DRIframebuffer framebuffer;
- int fd = -1;
- int status;
- const char * err_msg;
- const char * err_extra;
- drmVersionPtr version;
- drm_handle_t hFB;
- drm_magic_t magic;
-
-
- hSAREA = dpy->driverContext.shared.hSAREA;
- BusID = dpy->driverContext.pciBusID;
-
- fd = drmOpen(NULL, BusID);
-
- err_msg = "open DRM";
- err_extra = strerror( -fd );
-
- if (fd < 0) goto done;
-
- err_msg = "drmGetMagic";
- err_extra = NULL;
-
- if (drmGetMagic(fd, &magic)) goto done;
-
- dpy->authorized = False;
- send_char_msg( dpy, 0, _Authorize );
- send_msg( dpy, 0, &magic, sizeof(magic));
-
- /* force net buffer flush */
- while (!dpy->authorized)
- handle_fd_events( dpy, 0 );
-
- version = drmGetVersion(fd);
- if (version) {
- drm_version.major = version->version_major;
- drm_version.minor = version->version_minor;
- drm_version.patch = version->version_patchlevel;
- drmFreeVersion(version);
- }
- else {
- drm_version.major = -1;
- drm_version.minor = -1;
- drm_version.patch = -1;
- }
-
- /*
- * Get device name (like "tdfx") and the ddx version numbers.
- * We'll check the version in each DRI driver's "createScreen"
- * function.
- */
- ddx_version.major = 4;
- ddx_version.minor = 0;
- ddx_version.patch = 0;
-
- /*
- * Get the DRI X extension version.
- */
- dri_version.major = 4;
- dri_version.minor = 0;
- dri_version.patch = 0;
-
- /*
- * Get device-specific info. pDevPriv will point to a struct
- * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h)
- * that has information about the screen size, depth, pitch,
- * ancilliary buffers, DRM mmap handles, etc.
- */
- hFB = dpy->driverContext.shared.hFrameBuffer;
- framebuffer.size = dpy->driverContext.shared.fbSize;
- framebuffer.stride = dpy->driverContext.shared.fbStride;
- framebuffer.dev_priv_size = dpy->driverContext.driverClientMsgSize;
- framebuffer.dev_priv = dpy->driverContext.driverClientMsg;
- framebuffer.width = dpy->driverContext.shared.virtualWidth;
- framebuffer.height = dpy->driverContext.shared.virtualHeight;
-
- /*
- * Map the framebuffer region.
- */
- status = drmMap(fd, hFB, framebuffer.size,
- (drmAddressPtr)&framebuffer.base);
-
- err_msg = "drmMap of framebuffer";
- err_extra = strerror( -status );
-
- if ( status != 0 ) goto done;
-
- /*
- * Map the SAREA region. Further mmap regions may be setup in
- * each DRI driver's "createScreen" function.
- */
- status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA);
-
- err_msg = "drmMap of sarea";
- err_extra = strerror( -status );
-
- if ( status == 0 ) {
- err_msg = "InitDriver";
- err_extra = NULL;
- psp = dpy->createNewScreen(dpy, scrn, psc, NULL,
- & ddx_version,
- & dri_version,
- & drm_version,
- & framebuffer,
- pSAREA,
- fd,
- 20050727,
- & interface_methods,
- (__GLcontextModes **) &dpy->driver_modes);
-
- /* fill in dummy visual ids */
- {
- __GLcontextModes *temp;
- temp = (__GLcontextModes *)dpy->driver_modes;
- i = 1;
- while (temp)
- {
- temp->visualID = i++;
- temp=temp->next;
- }
- }
- }
-
-done:
- if ( psp == NULL ) {
- if ( pSAREA != MAP_FAILED ) {
- (void)drmUnmap(pSAREA, SAREA_MAX);
- }
-
- if ( framebuffer.base != MAP_FAILED ) {
- (void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size);
- }
-
- if ( framebuffer.dev_priv != NULL ) {
- free(framebuffer.dev_priv);
- }
-
- if ( fd >= 0 ) {
- (void)drmClose(fd);
- }
-
- if ( err_extra != NULL ) {
- fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg,
- err_extra);
- }
- else {
- fprintf(stderr, "libGL error: %s failed\n", err_msg );
- }
-
- fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n");
- }
-
- return psp;
-}
-
-/**
- * \brief Initialize the graphics system.
- *
- * \param display_name currently ignored. It is recommended to pass it as NULL.
- * \return a pointer to a #Display if the function is able to initialize
- * the graphics system, NULL otherwise.
- *
- * Allocates a MiniGLXDisplayRec structure and fills in with information from a
- * configuration file.
- *
- * Calls __miniglx_open_connections() to connect to the server.
- *
- * Loads the DRI driver and pulls in Mini GLX specific hooks into a
- * DRIDriverRec structure, and the standard DRI \e __driCreateScreen hook.
- * Asks the driver for a list of supported visuals. Performs the per-screen
- * client-side initialization. Also setups the callbacks in the screen private
- * information.
- *
- * \todo
- * - read config file
- * - what about virtualWidth, etc?
- * - determine dpy->driverClientMsgSize,
- * - allocate dpy->driverClientMsg
- */
-Display *
-XOpenDisplay( const char *display_name )
-{
- Display *dpy;
-
- dpy = (Display *)calloc(1, sizeof(Display));
- if (!dpy)
- return NULL;
-
- dpy->IsClient = True;
-
- /* read config file
- */
- if (!__read_config_file( dpy )) {
- fprintf(stderr, "Couldn't get configuration details\n");
- free(dpy);
- return NULL;
- }
-
- /* Connect to the server and receive driverClientMsg
- */
- if (!__miniglx_open_connections(dpy)) {
- free(dpy);
- return NULL;
- }
-
- /* dlopen the driver .so file
- */
- if (!InitDriver(dpy)) {
- fprintf(stderr, "InitDriver failed\n");
- free(dpy);
- return NULL;
- }
-
- /* Perform the client-side initialization.
- *
- * Clearly there is a limit of one on the number of windows in
- * existence at any time.
- *
- * Need to shut down DRM and free DRI data in XDestroyWindow(), too.
- */
- dpy->driScreen.private = CallCreateNewScreen(dpy, 0, &dpy->driScreen);
- if (!dpy->driScreen.private) {
- fprintf(stderr, "%s: __driCreateScreen failed\n", __FUNCTION__);
- dlclose(dpy->dlHandle);
- free(dpy);
- return NULL;
- }
-
- /* Anything more to do?
- */
- return dpy;
-}
-
-
-/**
- * \brief Release display resources.
- *
- * When the application is about to exit, the resources associated with the
- * graphics system can be released by calling this function.
- *
- * \param dpy display handle. It becomes invalid at this point.
- *
- * Destroys the window if any, and destroys the per-screen
- * driver private information.
- * Calls __miniglx_close_connections().
- *
- * If a server, puts the the framebuffer back into the initial state.
- *
- * Finally frees the display structure.
- */
-void
-XCloseDisplay( Display *dpy )
-{
- glXMakeCurrent( dpy, NULL, NULL);
-
- if (dpy->NumWindows)
- XDestroyWindow( dpy, dpy->TheWindow );
-
- /* As this is done in XOpenDisplay, need to undo it here:
- */
- dpy->driScreen.destroyScreen(dpy, 0, dpy->driScreen.private);
-
- __miniglx_close_connections( dpy );
-
- if (!dpy->IsClient) {
- /* put framebuffer back to initial state
- */
- (*dpy->driver->haltFBDev)( &dpy->driverContext );
- RestoreFBDev(dpy);
- CloseFBDev(dpy);
- }
-
- dlclose(dpy->dlHandle);
- free(dpy);
-}
-
-
-/**
- * \brief Window creation.
- *
- * \param display a display handle, as returned by XOpenDisplay().
- * \param parent the parent window for the new window. For Mini GLX this should
- * be
- * \code RootWindow(display, 0) \endcode
- * \param x the window abscissa. For Mini GLX, it should be zero.
- * \param y the window ordinate. For Mini GLX, it should be zero.
- * \param width the window width. For Mini GLX, this specifies the desired
- * screen width such as 1024 or 1280.
- * \param height the window height. For Mini GLX, this specifies the desired
- * screen height such as 768 or 1024.
- * \param border_width the border width. For Mini GLX, it should be zero.
- * \param depth the window pixel depth. For Mini GLX, this should be the depth
- * found in the #XVisualInfo object returned by glXChooseVisual()
- * \param winclass the window class. For Mini GLX this value should be
- * #InputOutput.
- * \param visual the visual type. It should be the visual field of the
- * #XVisualInfo object returned by glXChooseVisual().
- * \param valuemask which fields of the XSetWindowAttributes() are to be used.
- * For Mini GLX this is typically the bitmask
- * \code CWBackPixel | CWBorderPixel | CWColormap \endcode
- * \param attributes initial window attributes. The
- * XSetWindowAttributes::background_pixel, XSetWindowAttributes::border_pixel
- * and XSetWindowAttributes::colormap fields should be set.
- *
- * \return a window handle if it succeeds or zero if it fails.
- *
- * \note For Mini GLX, windows are full-screen; they cover the entire frame
- * buffer. Also, Mini GLX imposes a limit of one window. A second window
- * cannot be created until the first one is destroyed.
- *
- * This function creates and initializes a ::MiniGLXWindowRec structure after
- * ensuring that there is no other window created. Performs the per-drawable
- * client-side initialization calling the __DRIscreenRec::createDrawable
- * method.
- *
- */
-Window
-XCreateWindow( Display *dpy, Window parent, int x, int y,
- unsigned int width, unsigned int height,
- unsigned int border_width, int depth, unsigned int winclass,
- Visual *visual, unsigned long valuemask,
- XSetWindowAttributes *attributes )
-{
- const int empty_attribute_list[1] = { None };
-
- Window win;
-
- /* ignored */
- (void) x;
- (void) y;
- (void) border_width;
- (void) depth;
- (void) winclass;
- (void) valuemask;
- (void) attributes;
-
- if (!dpy->IsClient) {
- fprintf(stderr, "Server process may not create windows (currently)\n");
- return NULL;
- }
-
- if (dpy->NumWindows > 0)
- return NULL; /* only allow one window */
-
- assert(dpy->TheWindow == NULL);
-
- win = malloc(sizeof(struct MiniGLXWindowRec));
- if (!win)
- return NULL;
-
- /* In rotated mode, translate incoming x,y,width,height into
- * 'normal' coordinates.
- */
- if (dpy->rotateMode) {
- int tmp;
- tmp = width; width = height; height = tmp;
- tmp = x; x = y; y = tmp;
- }
-
- /* init other per-window fields */
- win->x = 0;
- win->y = 0;
- win->w = width;
- win->h = height;
- win->visual = visual; /* ptr assignment */
-
- win->bytesPerPixel = dpy->driverContext.cpp;
- win->rowStride = dpy->driverContext.shared.virtualWidth * win->bytesPerPixel;
- win->size = win->rowStride * height;
- win->frontStart = dpy->driverContext.FBAddress;
- win->frontBottom = (GLubyte *) win->frontStart + (height-1) * win->rowStride;
-
- /* This is incorrect: the hardware driver could put the backbuffer
- * just about anywhere. These fields, including the above are
- * hardware dependent & don't really belong here.
- */
- if (visual->mode->doubleBufferMode) {
- win->backStart = (GLubyte *) win->frontStart +
- win->rowStride * dpy->driverContext.shared.virtualHeight;
- win->backBottom = (GLubyte *) win->backStart
- + (height - 1) * win->rowStride;
- win->curBottom = win->backBottom;
- }
- else {
- /* single buffered */
- win->backStart = NULL;
- win->backBottom = NULL;
- win->curBottom = win->frontBottom;
- }
-
- dpy->driScreen.createNewDrawable(dpy, visual->mode, (int) win,
- &win->driDrawable, GLX_WINDOW_BIT, empty_attribute_list);
-
- if (!win->driDrawable.private) {
- fprintf(stderr, "%s: dri.createDrawable failed\n", __FUNCTION__);
- free(win);
- return NULL;
- }
-
- dpy->NumWindows++;
- dpy->TheWindow = win;
-
- return win;
-}
-
-
-/**
- * \brief Destroy window.
- *
- * \param display display handle.
- * \param w window handle.
- *
- * This function calls XUnmapWindow() and frees window \p w.
- *
- * In case of destroying the current buffer first unbinds the GLX context
- * by calling glXMakeCurrent() with no drawable.
- */
-void
-XDestroyWindow( Display *display, Window win )
-{
- if (display && display->IsClient && win) {
- /* check if destroying the current buffer */
- Window curDraw = glXGetCurrentDrawable();
- if (win == curDraw) {
- glXMakeCurrent( display, NULL, NULL);
- }
-
- XUnmapWindow( display, win );
-
- /* Destroy the drawable. */
- win->driDrawable.destroyDrawable(display, win->driDrawable.private);
- free(win);
-
- /* unlink window from display */
- display->NumWindows--;
- assert(display->NumWindows == 0);
- display->TheWindow = NULL;
- }
-}
-
-
-
-
-/**
- * \brief Create color map structure.
- *
- * \param dpy the display handle as returned by XOpenDisplay().
- * \param w the window on whose screen you want to create a color map. This
- * parameter is ignored by Mini GLX but should be the value returned by the
- * \code RootWindow(display, 0) \endcode macro.
- * \param visual a visual type supported on the screen. This parameter is
- * ignored by Mini GLX but should be the XVisualInfo::visual returned by
- * glXChooseVisual().
- * \param alloc the color map entries to be allocated. This parameter is ignored
- * by Mini GLX but should be set to #AllocNone.
- *
- * \return the color map.
- *
- * This function is only provided to ease porting. Practically a no-op -
- * returns a pointer to a dynamically allocated chunk of memory (one byte).
- */
-Colormap
-XCreateColormap( Display *dpy, Window w, Visual *visual, int alloc )
-{
- (void) dpy;
- (void) w;
- (void) visual;
- (void) alloc;
- return (Colormap) malloc(1);
-}
-
-
-/**
- * \brief Destroy color map structure.
- *
- * \param display The display handle as returned by XOpenDisplay().
- * \param colormap the color map to destroy.
- *
- * This function is only provided to ease porting. Practically a no-op.
- *
- * Frees the memory pointed by \p colormap.
- */
-void
-XFreeColormap( Display *display, Colormap colormap )
-{
- (void) display;
- (void) colormap;
- free(colormap);
-}
-
-
-/**
- * \brief Free client data.
- *
- * \param data the data that is to be freed.
- *
- * Frees the memory pointed by \p data.
- */
-void
-XFree( void *data )
-{
- free(data);
-}
-
-
-/**
- * \brief Query available visuals.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param vinfo_mask a bitmask indicating which fields of the \p vinfo_template
- * are to be matched. The value must be \c VisualScreenMask.
- * \param vinfo_template a template whose fields indicate which visual
- * attributes must be matched by the results. The XVisualInfo::screen field of
- * this structure must be zero.
- * \param nitens_return will hold the number of visuals returned.
- *
- * \return the address of an array of all available visuals.
- *
- * An example of using XGetVisualInfo() to get all available visuals follows:
- *
- * \code
- * XVisualInfo vinfo_template, *results;
- * int nitens_return;
- * Display *dpy = XOpenDisplay(NULL);
- * vinfo_template.screen = 0;
- * results = XGetVisualInfo(dpy, VisualScreenMask, &vinfo_template, &nitens_return);
- * \endcode
- *
- * Returns the list of all ::XVisualInfo available, one per
- * ::__GLcontextMode stored in MiniGLXDisplayRec::modes.
- */
-XVisualInfo *
-XGetVisualInfo( Display *dpy, long vinfo_mask, XVisualInfo *vinfo_template, int *nitens_return )
-{
- const __GLcontextModes *mode;
- XVisualInfo *results;
- Visual *visResults;
- int i, n=0;
-
- // ASSERT(vinfo_mask == VisualScreenMask);
- ASSERT(vinfo_template.screen == 0);
-
- if (vinfo_mask == VisualIDMask)
- {
- for ( mode = dpy->driver_modes ; mode != NULL ; mode= mode->next )
- if (mode->visualID == vinfo_template->visualid)
- n=1;
-
- if (n==0)
- return NULL;
-
- results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo));
- if (!results) {
- *nitens_return = 0;
- return NULL;
- }
-
- visResults = (Visual *)calloc(1, n * sizeof(Visual));
- if (!results) {
- free(results);
- *nitens_return = 0;
- return NULL;
- }
-
- for ( mode = dpy->driver_modes ; mode != NULL ; mode= mode->next )
- if (mode->visualID == vinfo_template->visualid)
- {
- visResults[0].mode=mode;
- visResults[0].visInfo = results;
- visResults[0].dpy = dpy;
- if (dpy->driverContext.bpp == 32)
- visResults[0].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */
- else
- visResults[0].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */
-
- results[0].visual = visResults;
- results[0].visualid = mode->visualID;
-#if defined(__cplusplus) || defined(c_plusplus)
- results[0].c_class = TrueColor;
-#else
- results[0].class = TrueColor;
-#endif
- results[0].depth = mode->redBits +
- mode->redBits +
- mode->redBits +
- mode->redBits;
- results[0].bits_per_rgb = dpy->driverContext.bpp;
-
- }
-
- }
- else // if (vinfo_mask == VisualScreenMask)
- {
- n = 0;
- for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next )
- n++;
-
- results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo));
- if (!results) {
- *nitens_return = 0;
- return NULL;
- }
-
- visResults = (Visual *)calloc(1, n * sizeof(Visual));
- if (!results) {
- free(results);
- *nitens_return = 0;
- return NULL;
- }
-
- for ( mode = dpy->driver_modes, i = 0 ; mode != NULL ; mode = mode->next, i++ ) {
- visResults[i].mode = mode;
- visResults[i].visInfo = results + i;
- visResults[i].dpy = dpy;
-
- if (dpy->driverContext.bpp == 32)
- visResults[i].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */
- else
- visResults[i].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */
-
- results[i].visual = visResults + i;
- results[i].visualid = mode->visualID;
-#if defined(__cplusplus) || defined(c_plusplus)
- results[i].c_class = TrueColor;
-#else
- results[i].class = TrueColor;
-#endif
- results[i].depth = mode->redBits +
- mode->redBits +
- mode->redBits +
- mode->redBits;
- results[i].bits_per_rgb = dpy->driverContext.bpp;
- }
- }
- *nitens_return = n;
- return results;
-}
-
-
-/**
- * \brief Return a visual that matches specified attributes.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param screen the screen number. It is currently ignored by Mini GLX and
- * should be zero.
- * \param attribList a list of GLX attributes which describe the desired pixel
- * format. It is terminated by the token \c None.
- *
- * The attributes are as follows:
- * \arg GLX_USE_GL:
- * This attribute should always be present in order to maintain compatibility
- * with GLX.
- * \arg GLX_RGBA:
- * If present, only RGBA pixel formats will be considered. Otherwise, only
- * color index formats are considered.
- * \arg GLX_DOUBLEBUFFER:
- * if present, only double-buffered pixel formats will be chosen.
- * \arg GLX_RED_SIZE \e n:
- * Must be followed by a non-negative integer indicating the minimum number of
- * bits per red pixel component that is acceptable.
- * \arg GLX_GREEN_SIZE \e n:
- * Must be followed by a non-negative integer indicating the minimum number of
- * bits per green pixel component that is acceptable.
- * \arg GLX_BLUE_SIZE \e n:
- * Must be followed by a non-negative integer indicating the minimum number of
- * bits per blue pixel component that is acceptable.
- * \arg GLX_ALPHA_SIZE \e n:
- * Must be followed by a non-negative integer indicating the minimum number of
- * bits per alpha pixel component that is acceptable.
- * \arg GLX_STENCIL_SIZE \e n:
- * Must be followed by a non-negative integer indicating the minimum number of
- * bits per stencil value that is acceptable.
- * \arg GLX_DEPTH_SIZE \e n:
- * Must be followed by a non-negative integer indicating the minimum number of
- * bits per depth component that is acceptable.
- * \arg None:
- * This token is used to terminate the attribute list.
- *
- * \return a pointer to an #XVisualInfo object which most closely matches the
- * requirements of the attribute list. If there is no visual which matches the
- * request, \c NULL will be returned.
- *
- * \note Visuals with accumulation buffers are not available.
- *
- * This function searches the list of available visual configurations in
- * MiniGLXDisplayRec::configs for a configuration which best matches the GLX
- * attribute list parameter. A new ::XVisualInfo object is created which
- * describes the visual configuration. The match criteria is described in the
- * specification.
- */
-XVisualInfo*
-glXChooseVisual( Display *dpy, int screen, int *attribList )
-{
- const __GLcontextModes *mode;
- Visual *vis;
- XVisualInfo *visInfo;
- const int *attrib;
- GLboolean rgbFlag = GL_FALSE, dbFlag = GL_FALSE, stereoFlag = GL_FALSE;
- GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0;
- GLint indexBits = 0, depthBits = 0, stencilBits = 0;
- GLint numSamples = 0;
- int i=0;
-
- /*
- * XXX in the future, <screen> might be interpreted as a VT
- */
- ASSERT(dpy);
- ASSERT(screen == 0);
-
- vis = (Visual *)calloc(1, sizeof(Visual));
- if (!vis)
- return NULL;
-
- visInfo = (XVisualInfo *)malloc(sizeof(XVisualInfo));
- if (!visInfo) {
- free(vis);
- return NULL;
- }
-
- visInfo->visual = vis;
- vis->visInfo = visInfo;
- vis->dpy = dpy;
-
- /* parse the attribute list */
- for (attrib = attribList; attrib && *attrib != None; attrib++) {
- switch (attrib[0]) {
- case GLX_DOUBLEBUFFER:
- dbFlag = GL_TRUE;
- break;
- case GLX_RGBA:
- rgbFlag = GL_TRUE;
- break;
- case GLX_RED_SIZE:
- redBits = attrib[1];
- attrib++;
- break;
- case GLX_GREEN_SIZE:
- greenBits = attrib[1];
- attrib++;
- break;
- case GLX_BLUE_SIZE:
- blueBits = attrib[1];
- attrib++;
- break;
- case GLX_ALPHA_SIZE:
- alphaBits = attrib[1];
- attrib++;
- break;
- case GLX_STENCIL_SIZE:
- stencilBits = attrib[1];
- attrib++;
- break;
- case GLX_DEPTH_SIZE:
- depthBits = attrib[1];
- attrib++;
- break;
-#if 0
- case GLX_ACCUM_RED_SIZE:
- accumRedBits = attrib[1];
- attrib++;
- break;
- case GLX_ACCUM_GREEN_SIZE:
- accumGreenBits = attrib[1];
- attrib++;
- break;
- case GLX_ACCUM_BLUE_SIZE:
- accumBlueBits = attrib[1];
- attrib++;
- break;
- case GLX_ACCUM_ALPHA_SIZE:
- accumAlphaBits = attrib[1];
- attrib++;
- break;
- case GLX_LEVEL:
- /* ignored for now */
- break;
-#endif
- default:
- /* unexpected token */
- fprintf(stderr, "unexpected token in glXChooseVisual attrib list\n");
- free(vis);
- free(visInfo);
- return NULL;
- }
- }
-
- /* search screen configs for suitable visual */
- (void) numSamples;
- (void) indexBits;
- (void) redBits;
- (void) greenBits;
- (void) blueBits;
- (void) alphaBits;
- (void) stereoFlag;
- for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) {
- i++;
- if (mode->rgbMode == rgbFlag &&
- mode->doubleBufferMode == dbFlag &&
- mode->redBits >= redBits &&
- mode->greenBits >= greenBits &&
- mode->blueBits >= blueBits &&
- mode->alphaBits >= alphaBits &&
- mode->depthBits >= depthBits &&
- mode->stencilBits >= stencilBits) {
- /* found it */
- visInfo->visualid = i;
- vis->mode = mode;
- break;
- }
- }
- if (!vis->mode)
- return NULL;
-
- /* compute depth and bpp */
- if (rgbFlag) {
- /* XXX maybe support depth 16 someday */
-#if defined(__cplusplus) || defined(c_plusplus)
- visInfo->c_class = TrueColor;
-#else
- visInfo->class = TrueColor;
-#endif
- visInfo->depth = dpy->driverContext.bpp;
- visInfo->bits_per_rgb = dpy->driverContext.bpp;
- if (dpy->driverContext.bpp == 32)
- vis->pixelFormat = PF_B8G8R8A8;
- else
- vis->pixelFormat = PF_B5G6R5;
- }
- else {
- /* color index mode */
-#if defined(__cplusplus) || defined(c_plusplus)
- visInfo->c_class = PseudoColor;
-#else
- visInfo->class = PseudoColor;
-#endif
- visInfo->depth = 8;
- visInfo->bits_per_rgb = 8; /* bits/pixel */
- vis->pixelFormat = PF_CI8;
- }
-
- return visInfo;
-}
-
-
-/**
- * \brief Return information about GLX visuals.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param vis the visual to be queried, as returned by glXChooseVisual().
- * \param attrib the visual attribute to be returned.
- * \param value pointer to an integer in which the result of the query will be
- * stored.
- *
- * \return zero if no error occurs, \c GLX_INVALID_ATTRIBUTE if the attribute
- * parameter is invalid, or \c GLX_BAD_VISUAL if the \p vis parameter is
- * invalid.
- *
- * Returns the appropriate attribute of ::__GLXvisualConfig pointed by
- * MiniGLXVisualRec::glxConfig of XVisualInfo::visual.
- *
- * \sa data types.
- */
-int
-glXGetConfig( Display *dpy, XVisualInfo *vis, int attrib, int *value )
-{
- const __GLcontextModes *mode = vis->visual->mode;
- if (!mode) {
- *value = 0;
- return GLX_BAD_VISUAL;
- }
-
- switch (attrib) {
- case GLX_USE_GL:
- *value = True;
- return 0;
- case GLX_RGBA:
- *value = mode->rgbMode;
- return 0;
- case GLX_DOUBLEBUFFER:
- *value = mode->doubleBufferMode;
- return 0;
- case GLX_RED_SIZE:
- *value = mode->redBits;
- return 0;
- case GLX_GREEN_SIZE:
- *value = mode->greenBits;
- return 0;
- case GLX_BLUE_SIZE:
- *value = mode->blueBits;
- return 0;
- case GLX_ALPHA_SIZE:
- *value = mode->alphaBits;
- return 0;
- case GLX_DEPTH_SIZE:
- *value = mode->depthBits;
- return 0;
- case GLX_STENCIL_SIZE:
- *value = mode->stencilBits;
- return 0;
- default:
- *value = 0;
- return GLX_BAD_ATTRIBUTE;
- }
- return 0;
-}
-
-
-/**
- * \brief Create a new GLX rendering context.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param vis the visual that defines the frame buffer resources available to
- * the rendering context, as returned by glXChooseVisual().
- * \param shareList If non-zero, texture objects and display lists are shared
- * with the named rendering context. If zero, texture objects and display lists
- * will (initially) be private to this context. They may be shared when a
- * subsequent context is created.
- * \param direct whether direct or indirect rendering is desired. For Mini GLX
- * this value is ignored but it should be set to \c True.
- *
- * \return a ::GLXContext handle if it succeeds or zero if it fails due to
- * invalid parameter or insufficient resources.
- *
- * This function creates and initializes a ::MiniGLXContextRec structure and
- * calls the __DRIscreenRec::createContext method to initialize the client
- * private data.
- */
-GLXContext
-glXCreateContext( Display *dpy, XVisualInfo *vis,
- GLXContext shareList, Bool direct )
-{
- GLXContext ctx;
- void *sharePriv;
-
- ASSERT(vis);
-
- ctx = (struct MiniGLXContextRec *)calloc(1, sizeof(struct MiniGLXContextRec));
- if (!ctx)
- return NULL;
-
- ctx->vid = vis->visualid;
-
- if (shareList)
- sharePriv = shareList->driContext.private;
- else
- sharePriv = NULL;
-
- ctx->driContext.mode = vis->visual->mode;
- ctx->driContext.private = dpy->driScreen.createNewContext(dpy, vis->visual->mode,
- GLX_WINDOW_BIT, sharePriv, &ctx->driContext);
-
- if (!ctx->driContext.private) {
- free(ctx);
- return NULL;
- }
-
- return ctx;
-}
-
-
-/**
- * \brief Destroy a GLX context.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param ctx the GLX context to be destroyed.
- *
- * This function frees the \p ctx parameter after unbinding the current context
- * by calling the __DRIcontextRec::bindContext method with zeros and calling
- * the __DRIcontextRec::destroyContext method.
- */
-void
-glXDestroyContext( Display *dpy, GLXContext ctx )
-{
- GLXContext glxctx = glXGetCurrentContext();
-
- if (ctx) {
- if (glxctx == ctx) {
- /* destroying current context */
- ctx->driContext.bindContext(dpy, 0, 0, 0, 0);
- CurrentContext = 0;
- }
- ctx->driContext.destroyContext(dpy, 0, ctx->driContext.private);
- free(ctx);
- }
-}
-
-
-/**
- * \brief Bind a GLX context to a window or a pixmap.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param drawable the window or drawable to bind to the rendering context.
- * This should be the value returned by XCreateWindow().
- * \param ctx the GLX context to be destroyed.
- *
- * \return \c True if it succeeds, \c False otherwise to indicate an invalid
- * display, window or context parameter.
- *
- * The current rendering context may be unbound by calling glXMakeCurrent()
- * with the window and context parameters set to zero.
- *
- * An application may create any number of rendering contexts and bind them as
- * needed. Note that binding a rendering context is generally not a
- * light-weight operation. Most simple OpenGL applications create only one
- * rendering context.
- *
- * This function first unbinds any old context via
- * __DRIcontextRec::unbindContext and binds the new one via
- * __DRIcontextRec::bindContext.
- *
- * If \p drawable is zero it unbinds the GLX context by calling
- * __DRIcontextRec::bindContext with zeros.
- */
-Bool
-glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx)
-{
- if (dpy && drawable && ctx) {
- GLXContext oldContext = glXGetCurrentContext();
- GLXDrawable oldDrawable = glXGetCurrentDrawable();
- /* unbind old */
- if (oldContext) {
- oldContext->driContext.unbindContext(dpy, 0,
- (__DRIid) oldDrawable, (__DRIid) oldDrawable,
- &oldContext->driContext);
- }
- /* bind new */
- CurrentContext = ctx;
- ctx->driContext.bindContext(dpy, 0, (__DRIid) drawable,
- (__DRIid) drawable, &ctx->driContext);
- ctx->drawBuffer = drawable;
- ctx->curBuffer = drawable;
- }
- else if (ctx && dpy) {
- /* unbind */
- ctx->driContext.bindContext(dpy, 0, 0, 0, 0);
- }
- else if (dpy) {
- CurrentContext = 0; /* kw: this seems to be intended??? */
- }
-
- return True;
-}
-
-
-/**
- * \brief Exchange front and back buffers.
- *
- * \param dpy the display handle, as returned by XOpenDisplay().
- * \param drawable the drawable whose buffers are to be swapped.
- *
- * Any pending rendering commands will be completed before the buffer swap
- * takes place.
- *
- * Calling glXSwapBuffers() on a window which is single-buffered has no effect.
- *
- * This function just calls the __DRIdrawableRec::swapBuffers method to do the
- * work.
- */
-void
-glXSwapBuffers( Display *dpy, GLXDrawable drawable )
-{
- if (!dpy || !drawable)
- return;
-
- drawable->driDrawable.swapBuffers(dpy, drawable->driDrawable.private);
-}
-
-
-/**
- * \brief Return the current context
- *
- * \return the current context, as specified by glXMakeCurrent(), or zero if no
- * context is currently bound.
- *
- * \sa glXCreateContext(), glXMakeCurrent()
- *
- * Returns the value of the ::CurrentContext global variable.
- */
-GLXContext
-glXGetCurrentContext( void )
-{
- return CurrentContext;
-}
-
-
-/**
- * \brief Return the current drawable.
- *
- * \return the current drawable, as specified by glXMakeCurrent(), or zero if
- * no drawable is currently bound.
- *
- * This function gets the current context via glXGetCurrentContext() and
- * returns the MiniGLXContextRec::drawBuffer attribute.
- */
-GLXDrawable
-glXGetCurrentDrawable( void )
-{
- GLXContext glxctx = glXGetCurrentContext();
- if (glxctx)
- return glxctx->drawBuffer;
- else
- return NULL;
-}
-
-
-static GLboolean
-__glXCreateContextWithConfig(__DRInativeDisplay *dpy, int screen,
- int fbconfigID, void *contextID, drm_context_t *hHWContext)
-{
- __DRIscreen *pDRIScreen;
- __DRIscreenPrivate *psp;
-
- pDRIScreen = __glXFindDRIScreen(dpy, screen);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return GL_FALSE;
- }
-
- psp = (__DRIscreenPrivate *) pDRIScreen->private;
-
- if (psp->fd) {
- if (drmCreateContext(psp->fd, hHWContext)) {
- fprintf(stderr, ">>> drmCreateContext failed\n");
- return GL_FALSE;
- }
- *(void**)contextID = (void*) *hHWContext;
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean
-__glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
- __DRIid draw, unsigned int * index, unsigned int * stamp,
- int * x, int * y, int * width, int * height,
- int * numClipRects, drm_clip_rect_t ** pClipRects,
- int * backX, int * backY,
- int * numBackClipRects, drm_clip_rect_t ** pBackClipRects)
-{
- GLXDrawable drawable = (GLXDrawable) draw;
- drm_clip_rect_t * cliprect;
- Display* display = (Display*)dpy;
- __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private;
- if (drawable == 0) {
- return GL_FALSE;
- }
-
- cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t));
- cliprect->x1 = drawable->x;
- cliprect->y1 = drawable->y;
- cliprect->x2 = drawable->x + drawable->w;
- cliprect->y2 = drawable->y + drawable->h;
-
- /* the drawable index is by client id */
- *index = display->clientID;
-
- *stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp;
- *x = drawable->x;
- *y = drawable->y;
- *width = drawable->w;
- *height = drawable->h;
- *numClipRects = 1;
- *pClipRects = cliprect;
-
- *backX = drawable->x;
- *backY = drawable->y;
- *numBackClipRects = 0;
- *pBackClipRects = 0;
-
- return GL_TRUE;
-}
-
-
-static GLboolean
-xf86DRI_DestroyContext(__DRInativeDisplay *dpy, int screen, __DRIid context_id )
-{
- return GL_TRUE;
-}
-
-
-static GLboolean
-xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable,
- drm_drawable_t *hHWDrawable )
-{
- return GL_TRUE;
-}
-
-
-static GLboolean
-xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable)
-{
- return GL_TRUE;
-}
-
-
-/**
- * \brief Query function address.
- *
- * The glXGetProcAddress() function will return the address of any available
- * OpenGL or Mini GLX function.
- *
- * \param procName name of the function to be returned.
- *
- * \return If \p procName is a valid function name, a pointer to that function
- * will be returned. Otherwise, \c NULL will be returned.
- *
- * The purpose of glXGetProcAddress() is to facilitate using future extensions
- * to OpenGL or Mini GLX. If a future version of the library adds new extension
- * functions they'll be accessible via glXGetProcAddress(). The alternative is
- * to hard-code calls to the new functions in the application but doing so will
- * prevent linking the application with older versions of the library.
- *
- * Returns the function address by looking up its name in a static (name,
- * address) pair list.
- */
-void (*glXGetProcAddress(const GLubyte *procname))( void )
-{
- struct name_address {
- const char *name;
- const void *func;
- };
- static const struct name_address functions[] = {
- { "glXChooseVisual", (void *) glXChooseVisual },
- { "glXCreateContext", (void *) glXCreateContext },
- { "glXDestroyContext", (void *) glXDestroyContext },
- { "glXMakeCurrent", (void *) glXMakeCurrent },
- { "glXSwapBuffers", (void *) glXSwapBuffers },
- { "glXGetCurrentContext", (void *) glXGetCurrentContext },
- { "glXGetCurrentDrawable", (void *) glXGetCurrentDrawable },
- { "glXGetProcAddress", (void *) glXGetProcAddress },
- { "XOpenDisplay", (void *) XOpenDisplay },
- { "XCloseDisplay", (void *) XCloseDisplay },
- { "XCreateWindow", (void *) XCreateWindow },
- { "XDestroyWindow", (void *) XDestroyWindow },
- { "XMapWindow", (void *) XMapWindow },
- { "XCreateColormap", (void *) XCreateColormap },
- { "XFreeColormap", (void *) XFreeColormap },
- { "XFree", (void *) XFree },
- { "XGetVisualinfo", (void *) XGetVisualInfo },
- { "glXCreatePbuffer", (void *) glXCreatePbuffer },
- { "glXDestroyPbuffer", (void *) glXDestroyPbuffer },
- { "glXChooseFBConfig", (void *) glXChooseFBConfig },
- { "glXGetVisualFromFBConfig", (void *) glXGetVisualFromFBConfig },
- { NULL, NULL }
- };
- const struct name_address *entry;
- for (entry = functions; entry->name; entry++) {
- if (strcmp(entry->name, (const char *) procname) == 0) {
- return entry->func;
- }
- }
- return _glapi_get_proc_address((const char *) procname);
-}
-
-
-/**
- * \brief Query the Mini GLX version.
- *
- * \param dpy the display handle. It is currently ignored, but should be the
- * value returned by XOpenDisplay().
- * \param major receives the major version number of Mini GLX.
- * \param minor receives the minor version number of Mini GLX.
- *
- * \return \c True if the function succeeds, \c False if the function fails due
- * to invalid parameters.
- *
- * \sa #MINI_GLX_VERSION_1_0.
- *
- * Returns the hard-coded Mini GLX version.
- */
-Bool
-glXQueryVersion( Display *dpy, int *major, int *minor )
-{
- (void) dpy;
- *major = 1;
- *minor = 0;
- return True;
-}
-
-
-/**
- * \brief Create a new pbuffer.
- */
-GLXPbuffer
-glXCreatePbuffer( Display *dpy, GLXFBConfig config, const int *attribList )
-{
- return NULL;
-}
-
-
-void
-glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf )
-{
- free(pbuf);
-}
-
-
-GLXFBConfig *
-glXChooseFBConfig( Display *dpy, int screen, const int *attribList,
- int *nitems )
-{
- GLXFBConfig *f = (GLXFBConfig *) malloc(sizeof(GLXFBConfig));
- f->visInfo = glXChooseVisual( dpy, screen, (int *) attribList );
- if (f->visInfo) {
- *nitems = 1;
- return f;
- }
- else {
- *nitems = 0;
- free(f);
- return NULL;
- }
-}
-
-
-XVisualInfo *
-glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
-{
- /* XVisualInfo and GLXFBConfig are the same structure */
- (void) dpy;
- return config.visInfo;
-}
-
-void *glXAllocateMemoryMESA(Display *dpy, int scrn,
- size_t size, float readFreq,
- float writeFreq, float priority)
-{
- if (dpy->driScreen.private && dpy->driScreen.allocateMemory) {
- return (*dpy->driScreen.allocateMemory)( dpy, scrn, size,
- readFreq, writeFreq,
- priority );
- }
-
- return NULL;
-}
-
-void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer)
-{
- if (dpy->driScreen.private && dpy->driScreen.freeMemory) {
- (*dpy->driScreen.freeMemory)( dpy, scrn, pointer );
- }
-}
-
-GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn,
- const void *pointer )
-{
- if (dpy->driScreen.private && dpy->driScreen.memoryOffset) {
- return (*dpy->driScreen.memoryOffset)( dpy, scrn, pointer );
- }
-
- return 0;
-}
-
-
-/**
- * Get the unadjusted system time (UST). Currently, the UST is measured in
- * microseconds since Epoc. The actual resolution of the UST may vary from
- * system to system, and the units may vary from release to release.
- * Drivers should not call this function directly. They should instead use
- * \c glXGetProcAddress to obtain a pointer to the function.
- *
- * \param ust Location to store the 64-bit UST
- * \returns Zero on success or a negative errno value on failure.
- *
- * \note
- * This function was copied directly from src/glx/x11/glxcmds.c.
- */
-static int __glXGetUST( int64_t * ust )
-{
- struct timeval tv;
-
- if ( ust == NULL ) {
- return -EFAULT;
- }
-
- if ( gettimeofday( & tv, NULL ) == 0 ) {
- ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
- return 0;
- } else {
- return -errno;
- }
-}
-
-
-/**
- *
- * \bug
- * This needs to be implemented for miniGlx.
- */
-static GLboolean __glXGetMscRate(__DRInativeDisplay * dpy, __DRIid drawable,
- int32_t * numerator, int32_t * denominator)
-{
- *numerator = 0;
- *denominator = 0;
- return False;
-}
-/*@}*/
diff --git a/nx-X11/extras/Mesa/src/glx/mini/miniglxP.h b/nx-X11/extras/Mesa/src/glx/mini/miniglxP.h
deleted file mode 100644
index 96ed0e81c..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/miniglxP.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * \file miniglxP.h
- * \brief Define replacements for some X data types and define the DRI-related
- * data structures.
- *
- * \note Cut down version of glxclient.h.
- *
- */
-
-#ifndef _mini_GLX_client_h_
-#define _mini_GLX_client_h_
-
-#include <signal.h>
-#include <linux/fb.h>
-
-#include <GL/miniglx.h>
-#include "glheader.h"
-#include "mtypes.h"
-
-#include "driver.h"
-#include "GL/internal/dri_interface.h"
-
-/**
- * \brief Supported pixel formats.
- */
-enum PixelFormat {
- PF_B8G8R8, /**< \brief 24-bit BGR */
- PF_B8G8R8A8, /**< \brief 32-bit BGRA */
- PF_B5G6R5, /**< \brief 16-bit BGR */
- PF_B5G5R5, /**< \brief 15-bit BGR */
- PF_CI8 /**< \brief 8-bit color index */
-};
-
-/**
- * \brief X Visual type.
- *
- * \sa ::Visual, \ref datatypes.
- */
-struct MiniGLXVisualRec {
- /** \brief GLX visual information */
- const __GLcontextModes *mode;
-
- /** \brief pointer back to corresponding ::XVisualInfo */
- XVisualInfo *visInfo;
-
- /** \brief display handle */
- Display *dpy;
-
- /** \brief pixel format */
- enum PixelFormat pixelFormat;
-};
-
-
-
-/**
- * \brief X Window type.
- *
- * \sa ::Window, \ref datatypes.
- */
-struct MiniGLXWindowRec {
- Visual *visual;
- /** \brief position (always 0,0) */
- int x, y;
- /** \brief size */
- unsigned int w, h;
- void *frontStart; /**< \brief start of front color buffer */
- void *backStart; /**< \brief start of back color buffer */
- size_t size; /**< \brief color buffer size, in bytes */
- GLuint bytesPerPixel;
- GLuint rowStride; /**< \brief in bytes */
- GLubyte *frontBottom; /**< \brief pointer to last row */
- GLubyte *backBottom; /**< \brief pointer to last row */
- GLubyte *curBottom; /**< = frontBottom or backBottom */
- __DRIdrawable driDrawable;
- GLuint ismapped;
-};
-
-
-/**
- * \brief GLXContext type.
- *
- * \sa ::GLXContext, \ref datatypes.
- */
-struct MiniGLXContextRec {
- Window drawBuffer; /**< \brief drawing buffer */
- Window curBuffer; /**< \brief current buffer */
- VisualID vid; /**< \brief visual ID */
- __DRIcontext driContext; /**< \brief context dependent methods */
-};
-
-#define MINIGLX_BUF_SIZE 512
-#define MINIGLX_MAX_SERVER_FDS 10
-#define MINIGLX_MAX_CLIENT_FDS 1
-#define MINIGLX_EVENT_QUEUE_SZ 16
-#define MINIGLX_EVENT_QUEUE_MASK (MINIGLX_EVENT_QUEUE_SZ-1)
-
-/**
- * A connection to/from the server
- *
- * All information is to/from the server is buffered and then dispatched by
- * __miniglx_Select() to avoid blocking the server.
- */
-struct MiniGLXConnection {
- int fd; /**< \brief file descriptor */
- char readbuf[MINIGLX_BUF_SIZE]; /**< \brief read buffer */
- char writebuf[MINIGLX_BUF_SIZE]; /**< \brief write buffer */
- int readbuf_count; /**< \brief count of bytes waiting to be read */
- int writebuf_count; /**< \brief count of bytes waiting to be written */
-};
-
-
-/**
- * \brief X Display type
- *
- * \sa ::Display, \ref datatypes.
- */
-struct MiniGLXDisplayRec {
- /** \brief fixed framebuffer screen info */
- struct fb_fix_screeninfo FixedInfo;
- /** \brief original and current variable framebuffer screen info */
- struct fb_var_screeninfo OrigVarInfo, VarInfo;
- struct sigaction OrigSigUsr1;
- struct sigaction OrigSigUsr2;
- int OriginalVT;
- int ConsoleFD; /**< \brief console TTY device file descriptor */
- int FrameBufferFD; /**< \brief framebuffer device file descriptor */
- int NumWindows; /**< \brief number of open windows */
- Window TheWindow; /**< \brief open window - only allow one window for now */
- int rotateMode;
-
-
- volatile int vtSignalFlag;
- volatile int haveVT; /**< \brief whether the VT is hold */
- int hwActive; /**< \brief whether the hardware is active -- mimics
- the variations of MiniGLXDisplayRec::haveVT */
-
-
- int IsClient; /**< \brief whether it's a client or the server */
- int clientID;
- int nrFds; /**< \brief number of connections (usually just one for the clients) */
- struct MiniGLXConnection *fd; /**< \brief connections */
- int drmFd; /**< \brief handle to drm device */
- int authorized; /**< \brief has server authorized this process? */
-
- struct {
- int nr, head, tail;
- XEvent queue[MINIGLX_EVENT_QUEUE_SZ];
- } eventqueue;
-
- /**
- * \name Visuals
- *
- * Visuals (configs) in this screen.
- */
- /*@{*/
- const __GLcontextModes *driver_modes; /**< \brief Modes filtered by driver. */
- /*@}*/
-
- /**
- * \name From __GLXdisplayPrivate
- */
- /*@{*/
- PFNCREATENEWSCREENFUNC createNewScreen; /**< \brief \e __driCreateScreen hook */
- __DRIscreen driScreen; /**< \brief Screen dependent methods */
- void *dlHandle; /**<
- * \brief handle to the client dynamic
- * library
- */
- /*@}*/
-
- /**
- * \brief Mini GLX specific driver hooks
- */
- struct DRIDriverRec *driver;
- struct DRIDriverContextRec driverContext;
-
- /**
- * \name Configuration details
- *
- * They are read from a configuration file by __read_config_file().
- */
- /*@{*/
- const char *fbdevDevice;
- const char *clientDriverName;
- /*@}*/
-};
-
-/** Character messages. */
-enum msgs {
- _CanIHaveFocus,
- _IDontWantFocus,
- _YouveGotFocus,
- _YouveLostFocus,
- _RepaintPlease,
- _Authorize,
-};
-extern int send_msg( Display *dpy, int i, const void *msg, size_t sz );
-extern int send_char_msg( Display *dpy, int i, char msg );
-extern int blocking_read( Display *dpy, int connection, char *msg, size_t msg_size );
-extern int handle_fd_events( Display *dpy, int nonblock );
-
-extern int __miniglx_open_connections( Display *dpy );
-extern void __miniglx_close_connections( Display *dpy );
-
-#endif /* !_mini_GLX_client_h_ */
diff --git a/nx-X11/extras/Mesa/src/glx/mini/miniglx_events.c b/nx-X11/extras/Mesa/src/glx/mini/miniglx_events.c
deleted file mode 100644
index 7e54ec491..000000000
--- a/nx-X11/extras/Mesa/src/glx/mini/miniglx_events.c
+++ /dev/null
@@ -1,978 +0,0 @@
-/**
- * \file miniglx_events.c
- * \brief Mini GLX client/server communication functions.
- * \author Keith Whitwell
- *
- * The Mini GLX interface is a subset of the GLX interface, plus a
- * minimal set of Xlib functions. This file adds interfaces to
- * arbitrate a single cliprect between multiple direct rendering
- * clients.
- *
- * A fairly complete client/server non-blocking communication
- * mechanism. Probably overkill given that none of our messages
- * currently exceed 1 byte in length and take place over the
- * relatively benign channel provided by a Unix domain socket.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.0
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* $Id: miniglx_events.c,v 1.1.1.3 2005/10/18 02:51:50 kem Exp $ */
-
-
-#include <assert.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/stat.h>
-
-#include <linux/kd.h>
-#include <linux/vt.h>
-
-#include "xf86drm.h"
-#include "miniglxP.h"
-
-
-#define MINIGLX_FIFO_NAME "/tmp/miniglx.fifo"
-
-/**
- * \brief Allocate an XEvent structure on the event queue.
- *
- * \param dpy the display handle.
- *
- * \return Pointer to the queued event structure or NULL on failure.
- *
- * \internal
- * If there is space on the XEvent queue, return a pointer
- * to the next free event and increment the eventqueue tail value.
- * Otherwise return null.
- */
-static XEvent *queue_event( Display *dpy )
-{
- int incr = (dpy->eventqueue.tail + 1) & MINIGLX_EVENT_QUEUE_MASK;
- if (incr == dpy->eventqueue.head) {
- return 0;
- }
- else {
- XEvent *ev = &dpy->eventqueue.queue[dpy->eventqueue.tail];
- dpy->eventqueue.tail = incr;
- return ev;
- }
-}
-
-/**
- * \brief Dequeue an XEvent and copy it into provided storage.
- *
- * \param dpy the display handle.
- * \param event_return pointer to copy the queued event to.
- *
- * \return True or False depending on success.
- *
- * \internal
- * If there is a queued XEvent on the queue, copy it to the provided
- * pointer and increment the eventqueue head value. Otherwise return
- * null.
- */
-static int dequeue_event( Display *dpy, XEvent *event_return )
-{
- if (dpy->eventqueue.tail == dpy->eventqueue.head) {
- return False;
- }
- else {
- *event_return = dpy->eventqueue.queue[dpy->eventqueue.head];
- dpy->eventqueue.head += 1;
- dpy->eventqueue.head &= MINIGLX_EVENT_QUEUE_MASK;
- return True;
- }
-}
-
-/**
- * \brief Shutdown a socket connection.
- *
- * \param dpy the display handle.
- * \param i the index in dpy->fd of the socket connection.
- *
- * \internal
- * Shutdown and close the file descriptor. If this is the special
- * connection in fd[0], issue an error message and exit - there's been
- * some sort of failure somewhere. Otherwise, let the application
- * know about whats happened by issuing a DestroyNotify event.
- */
-static void shut_fd( Display *dpy, int i )
-{
- if (dpy->fd[i].fd < 0)
- return;
-
- shutdown (dpy->fd[i].fd, SHUT_RDWR);
- close (dpy->fd[i].fd);
- dpy->fd[i].fd = -1;
- dpy->fd[i].readbuf_count = 0;
- dpy->fd[i].writebuf_count = 0;
-
- if (i == 0) {
- fprintf(stderr, "server connection lost\n");
- exit(1);
- }
- else {
- /* Pass this to the application as a DestroyNotify event.
- */
- XEvent *er = queue_event(dpy);
- if (!er) return;
- er->xdestroywindow.type = DestroyNotify;
- er->xdestroywindow.serial = 0;
- er->xdestroywindow.send_event = 0;
- er->xdestroywindow.display = dpy;
- er->xdestroywindow.window = (Window)i;
- }
-}
-
-/**
- * \brief Send a message to a socket connection.
- *
- * \param dpy the display handle.
- * \param i the index in dpy->fd of the socket connection.
- * \param msg the message to send.
- * \param sz the size of the message
- *
- * \internal
- * Copy the message to the write buffer for the nominated connection.
- * This will be actually sent to that file descriptor from
- * __miniglx_Select().
- */
-int send_msg( Display *dpy, int i,
- const void *msg, size_t sz )
-{
- int cnt = dpy->fd[i].writebuf_count;
- if (MINIGLX_BUF_SIZE - cnt < sz) {
- fprintf(stderr, "client %d: writebuf overflow\n", i);
- return False;
- }
-
- memcpy( dpy->fd[i].writebuf + cnt, msg, sz ); cnt += sz;
- dpy->fd[i].writebuf_count = cnt;
- return True;
-}
-
-/**
- * \brief Send a message to a socket connection.
- *
- * \param dpy the display handle.
- * \param i the index in dpy->fd of the socket connection.
- * \param msg the message to send.
- *
- * \internal
- * Use send_msg() to send a one-byte message to a socket.
- */
-int send_char_msg( Display *dpy, int i, char msg )
-{
- return send_msg( dpy, i, &msg, sizeof(char));
-}
-
-
-/**
- * \brief Block and receive a message from a socket connection.
- *
- * \param dpy the display handle.
- * \param connection the index in dpy->fd of the socket connection.
- * \param msg storage for the received message.
- * \param msg_size the number of bytes to read.
- *
- * \internal
- * Block and read from the connection's file descriptor
- * until msg_size bytes have been received.
- *
- * Only called from welcome_message_part().
- */
-int blocking_read( Display *dpy, int connection,
- char *msg, size_t msg_size )
-{
- int i, r;
-
- for (i = 0 ; i < msg_size ; i += r) {
- r = read(dpy->fd[connection].fd, msg + i, msg_size - i);
- if (r < 1) {
- fprintf(stderr, "blocking_read: %d %s\n", r, strerror(errno));
- shut_fd(dpy,connection);
- return False;
- }
- }
-
- return True;
-}
-
-/**
- * \brief Send/receive a part of the welcome message.
- *
- * \param dpy the display handle.
- * \param i the index in dpy->fd of the socket connection.
- * \param msg storage for the sent/received message.
- * \param sz the number of bytes to write/read.
- *
- * \return True on success, or False on failure.
- *
- * This function is called by welcome_message_part(), to either send or receive
- * (via blocking_read()) part of the welcome message, according to whether
- * Display::IsClient is set.
- *
- * Each part of the welcome message on the wire consists of a count and then the
- * actual message data with that number of bytes.
- */
-static int welcome_message_part( Display *dpy, int i, void **msg, int sz )
-{
- if (dpy->IsClient) {
- int sz;
- if (!blocking_read( dpy, i, (char *)&sz, sizeof(sz))) return False;
- if (!*msg) *msg = malloc(sz);
- if (!*msg) return False;
- if (!blocking_read( dpy, i, *msg, sz )) return False;
- return sz;
- }
- else {
- if (!send_msg( dpy, i, &sz, sizeof(sz))) return False;
- if (!send_msg( dpy, i, *msg, sz )) return False;
- }
-
- return True;
-}
-
-/**
- * \brief Send/receive the welcome message.
- *
- * \param dpy the display handle.
- * \param i the index in dpy->fd of the socket connection.
- *
- * \return True on success, or False on failure.
- *
- * Using welcome_message_part(), sends/receives the client ID, the client
- * configuration details in DRIDriverContext::shared, and the driver private
- * message in DRIDriverContext::driverClientMsg.
- */
-static int welcome_message( Display *dpy, int i )
-{
- void *tmp = &dpy->driverContext.shared;
- int *clientid = dpy->IsClient ? &dpy->clientID : &i;
- int size;
- if (!welcome_message_part( dpy, i, (void **)&clientid, sizeof(*clientid)))
- return False;
-
- if (!welcome_message_part( dpy, i, &tmp, sizeof(dpy->driverContext.shared)))
- return False;
-
- size=welcome_message_part( dpy, i,
- (void **)&dpy->driverContext.driverClientMsg,
- dpy->driverContext.driverClientMsgSize );
- if (!size)
- return False;
- if (dpy->IsClient) {
- dpy->driverContext.driverClientMsgSize = size;
- }
- return True;
-}
-
-
-/**
- * \brief Handle a new client connection.
- *
- * \param dpy the display handle.
- *
- * \return True on success or False on failure.
- *
- * Accepts the connection, sets it in non-blocking operation, and finds a free
- * slot in Display::fd for it.
- */
-static int handle_new_client( Display *dpy )
-{
- struct sockaddr_un client_address;
- unsigned int l = sizeof(client_address);
- int r, i;
-
- r = accept(dpy->fd[0].fd, (struct sockaddr *) &client_address, &l);
- if (r < 0) {
- perror ("accept()");
- shut_fd(dpy,0);
- return False;
- }
-
- if (fcntl(r, F_SETFL, O_NONBLOCK) != 0) {
- perror("fcntl");
- close(r);
- return False;
- }
-
-
- /* Some rough & ready adaption of the XEvent semantics.
- */
- for (i = 1 ; i < dpy->nrFds ; i++) {
- if (dpy->fd[i].fd < 0) {
- XEvent *er = queue_event(dpy);
- if (!er) {
- close(r);
- return False;
- }
-
- dpy->fd[i].fd = r;
- er->xcreatewindow.type = CreateNotify;
- er->xcreatewindow.serial = 0;
- er->xcreatewindow.send_event = 0;
- er->xcreatewindow.display = dpy;
- er->xcreatewindow.window = (Window)i; /* fd slot == window, now? */
-
- /* Send the driver client message - this is expected as the
- * first message on a new connection. The recpient already
- * knows the size of the message.
- */
- welcome_message( dpy, i );
- return True;
- }
- }
-
-
- fprintf(stderr, "[miniglx] %s: Max nr clients exceeded\n", __FUNCTION__);
- close(r);
- return False;
-}
-
-/**
- * This routine "puffs out" the very basic communications between
- * client and server to full-sized X Events that can be handled by the
- * application.
- *
- * \param dpy the display handle.
- * \param i the index in dpy->fd of the socket connection.
- *
- * \return True on success or False on failure.
- *
- * \internal
- * Interprets the message (see msg) into a XEvent and advances the file FIFO
- * buffer.
- */
-static int
-handle_fifo_read( Display *dpy, int i )
-{
- drm_magic_t magic;
- int err;
-
- while (dpy->fd[i].readbuf_count) {
- char id = dpy->fd[i].readbuf[0];
- XEvent *er;
- int count = 1;
-
- if (dpy->IsClient) {
- switch (id) {
- /* The server has called XMapWindow on a client window */
- case _YouveGotFocus:
- er = queue_event(dpy);
- if (!er) return False;
- er->xmap.type = MapNotify;
- er->xmap.serial = 0;
- er->xmap.send_event = False;
- er->xmap.display = dpy;
- er->xmap.event = dpy->TheWindow;
- er->xmap.window = dpy->TheWindow;
- er->xmap.override_redirect = False;
- if (dpy->driver->notifyFocus)
- dpy->driver->notifyFocus( 1 );
- break;
-
- /* The server has called XMapWindow on a client window */
- case _RepaintPlease:
- er = queue_event(dpy);
- if (!er) return False;
- er->xexpose.type = Expose;
- er->xexpose.serial = 0;
- er->xexpose.send_event = False;
- er->xexpose.display = dpy;
- er->xexpose.window = dpy->TheWindow;
- if (dpy->rotateMode) {
- er->xexpose.x = dpy->TheWindow->y;
- er->xexpose.y = dpy->TheWindow->x;
- er->xexpose.width = dpy->TheWindow->h;
- er->xexpose.height = dpy->TheWindow->w;
- }
- else {
- er->xexpose.x = dpy->TheWindow->x;
- er->xexpose.y = dpy->TheWindow->y;
- er->xexpose.width = dpy->TheWindow->w;
- er->xexpose.height = dpy->TheWindow->h;
- }
- er->xexpose.count = 0;
- break;
-
- /* The server has called 'XUnmapWindow' on a client
- * window.
- */
- case _YouveLostFocus:
- er = queue_event(dpy);
- if (!er) return False;
- er->xunmap.type = UnmapNotify;
- er->xunmap.serial = 0;
- er->xunmap.send_event = False;
- er->xunmap.display = dpy;
- er->xunmap.event = dpy->TheWindow;
- er->xunmap.window = dpy->TheWindow;
- er->xunmap.from_configure = False;
- if (dpy->driver->notifyFocus)
- dpy->driver->notifyFocus( 0 );
- break;
-
- case _Authorize:
- dpy->authorized = True;
- break;
-
- default:
- fprintf(stderr, "Client received unhandled message type %d\n", id);
- shut_fd(dpy, i); /* Actually shuts down the client */
- return False;
- }
- }
- else {
- switch (id) {
- /* Lets the server know that the client is ready to render
- * (having called 'XMapWindow' locally).
- */
- case _CanIHaveFocus:
- er = queue_event(dpy);
- if (!er) return False;
- er->xmaprequest.type = MapRequest;
- er->xmaprequest.serial = 0;
- er->xmaprequest.send_event = False;
- er->xmaprequest.display = dpy;
- er->xmaprequest.parent = 0;
- er->xmaprequest.window = (Window)i;
- break;
-
- /* Both _YouveLostFocus and _IDontWantFocus generate unmap
- * events. The idea is that _YouveLostFocus lets the client
- * know that it has had focus revoked by the server, whereas
- * _IDontWantFocus lets the server know that the client has
- * unmapped its own window.
- */
- case _IDontWantFocus:
- er = queue_event(dpy);
- if (!er) return False;
- er->xunmap.type = UnmapNotify;
- er->xunmap.serial = 0;
- er->xunmap.send_event = False;
- er->xunmap.display = dpy;
- er->xunmap.event = (Window)i;
- er->xunmap.window = (Window)i;
- er->xunmap.from_configure = False;
- break;
-
- case _Authorize:
- /* is full message here yet? */
- if (dpy->fd[i].readbuf_count < count + sizeof(magic)) {
- count = 0;
- break;
- }
- memcpy(&magic, dpy->fd[i].readbuf + count, sizeof(magic));
- fprintf(stderr, "Authorize - magic %d\n", magic);
-
- err = drmAuthMagic(dpy->driverContext.drmFD, magic);
- count += sizeof(magic);
-
- send_char_msg( dpy, i, _Authorize );
- break;
-
- default:
- fprintf(stderr, "Server received unhandled message type %d\n", id);
- shut_fd(dpy, i); /* Generates DestroyNotify event */
- return False;
- }
- }
-
- dpy->fd[i].readbuf_count -= count;
-
- if (dpy->fd[i].readbuf_count) {
- memmove(dpy->fd[i].readbuf,
- dpy->fd[i].readbuf + count,
- dpy->fd[i].readbuf_count);
- }
- }
-
- return True;
-}
-
-/**
- * Handle a VT signal
- *
- * \param dpy display handle.
- *
- * The VT switches is detected by comparing Display::haveVT and
- * Display::hwActive. When loosing the VT the hardware lock is acquired, the
- * hardware is shutdown via a call to DRIDriverRec::shutdownHardware(), and the
- * VT released. When acquiring the VT back the hardware state is restored via a
- * call to DRIDriverRec::restoreHardware() and the hardware lock released.
- */
-static void __driHandleVtSignals( Display *dpy )
-{
- dpy->vtSignalFlag = 0;
-
- fprintf(stderr, "%s: haveVT %d hwActive %d\n", __FUNCTION__,
- dpy->haveVT, dpy->hwActive);
-
- if (!dpy->haveVT && dpy->hwActive) {
- /* Need to get lock and shutdown hardware */
- DRM_LIGHT_LOCK( dpy->driverContext.drmFD,
- dpy->driverContext.pSAREA,
- dpy->driverContext.serverContext );
- dpy->driver->shutdownHardware( &dpy->driverContext );
-
- /* Can now give up control of the VT */
- ioctl( dpy->ConsoleFD, VT_RELDISP, 1 );
- dpy->hwActive = 0;
- }
- else if (dpy->haveVT && !dpy->hwActive) {
- /* Get VT (wait??) */
- ioctl( dpy->ConsoleFD, VT_RELDISP, VT_ACTIVATE );
-
- /* restore HW state, release lock */
- dpy->driver->restoreHardware( &dpy->driverContext );
- DRM_UNLOCK( dpy->driverContext.drmFD,
- dpy->driverContext.pSAREA,
- dpy->driverContext.serverContext );
- dpy->hwActive = 1;
- }
-}
-
-
-#undef max
-#define max(x,y) ((x) > (y) ? (x) : (y))
-
-/**
- * Logic for the select() call.
- *
- * \param dpy display handle.
- * \param n highest fd in any set plus one.
- * \param rfds fd set to be watched for reading, or NULL to create one.
- * \param wfds fd set to be watched for writing, or NULL to create one.
- * \param xfds fd set to be watched for exceptions or error, or NULL to create one.
- * \param tv timeout value, or NULL for no timeout.
- *
- * \return number of file descriptors contained in the sets, or a negative number on failure.
- *
- * \note
- * This all looks pretty complex, but is necessary especially on the
- * server side to prevent a poorly-behaved client from causing the
- * server to block in a read or write and hence not service the other
- * clients.
- *
- * \sa
- * See select_tut in the Linux manual pages for more discussion.
- *
- * \internal
- * Creates and initializes the file descriptor sets by inspecting Display::fd
- * if these aren't passed in the function call. Calls select() and fulfill the
- * demands by trying to fill MiniGLXConnection::readbuf and draining
- * MiniGLXConnection::writebuf.
- * The server fd[0] is handled specially for new connections, by calling
- * handle_new_client().
- *
- */
-int
-__miniglx_Select( Display *dpy, int n, fd_set *rfds, fd_set *wfds, fd_set *xfds,
- struct timeval *tv )
-{
- int i;
- int retval;
- fd_set my_rfds, my_wfds;
- struct timeval my_tv;
-
- if (!rfds) {
- rfds = &my_rfds;
- FD_ZERO(rfds);
- }
-
- if (!wfds) {
- wfds = &my_wfds;
- FD_ZERO(wfds);
- }
-
- /* Don't block if there are events queued. Review this if the
- * flush in XMapWindow is changed to blocking. (Test case:
- * miniglxtest).
- */
- if (dpy->eventqueue.head != dpy->eventqueue.tail) {
- my_tv.tv_sec = my_tv.tv_usec = 0;
- tv = &my_tv;
- }
-
- for (i = 0 ; i < dpy->nrFds; i++) {
- if (dpy->fd[i].fd < 0)
- continue;
-
- if (dpy->fd[i].writebuf_count)
- FD_SET(dpy->fd[i].fd, wfds);
-
- if (dpy->fd[i].readbuf_count < MINIGLX_BUF_SIZE)
- FD_SET(dpy->fd[i].fd, rfds);
-
- n = max(n, dpy->fd[i].fd + 1);
- }
-
- if (dpy->vtSignalFlag)
- __driHandleVtSignals( dpy );
-
- retval = select( n, rfds, wfds, xfds, tv );
-
- if (dpy->vtSignalFlag) {
- int tmp = errno;
- __driHandleVtSignals( dpy );
- errno = tmp;
- }
-
- if (retval < 0) {
- FD_ZERO(rfds);
- FD_ZERO(wfds);
- return retval;
- }
-
- /* Handle server fd[0] specially on the server - accept new client
- * connections.
- */
- if (!dpy->IsClient) {
- if (FD_ISSET(dpy->fd[0].fd, rfds)) {
- FD_CLR(dpy->fd[0].fd, rfds);
- handle_new_client( dpy );
- }
- }
-
- /* Otherwise, try and fill readbuffer and drain writebuffer:
- */
- for (i = 0 ; i < dpy->nrFds ; i++) {
- if (dpy->fd[i].fd < 0)
- continue;
-
- /* If there aren't any event slots left, don't examine
- * any more file events. This will prevent lost events.
- */
- if (dpy->eventqueue.head ==
- ((dpy->eventqueue.tail + 1) & MINIGLX_EVENT_QUEUE_MASK)) {
- fprintf(stderr, "leaving event loop as event queue is full\n");
- return retval;
- }
-
- if (FD_ISSET(dpy->fd[i].fd, wfds)) {
- int r = write(dpy->fd[i].fd,
- dpy->fd[i].writebuf,
- dpy->fd[i].writebuf_count);
-
- if (r < 1)
- shut_fd(dpy,i);
- else {
- dpy->fd[i].writebuf_count -= r;
- if (dpy->fd[i].writebuf_count) {
- memmove(dpy->fd[i].writebuf,
- dpy->fd[i].writebuf + r,
- dpy->fd[i].writebuf_count);
- }
- }
- }
-
- if (FD_ISSET(dpy->fd[i].fd, rfds)) {
- int r = read(dpy->fd[i].fd,
- dpy->fd[i].readbuf + dpy->fd[i].readbuf_count,
- MINIGLX_BUF_SIZE - dpy->fd[i].readbuf_count);
-
- if (r < 1)
- shut_fd(dpy,i);
- else {
- dpy->fd[i].readbuf_count += r;
-
- handle_fifo_read( dpy, i );
- }
- }
- }
-
- return retval;
-}
-
-/**
- * \brief Handle socket events.
- *
- * \param dpy the display handle.
- * \param nonblock whether to return immediately or wait for an event.
- *
- * \return True on success, False on failure. Aborts on critical error.
- *
- * \internal
- * This function is the select() main loop.
- */
-int handle_fd_events( Display *dpy, int nonblock )
-{
- while (1) {
- struct timeval tv = {0, 0};
- int r = __miniglx_Select( dpy, 0, 0, 0, 0, nonblock ? &tv : 0 );
- if (r >= 0)
- return True;
- if (errno == EINTR || errno == EAGAIN)
- continue;
- perror ("select()");
- exit (1);
- }
-}
-
-/**
- * Initializes the connections.
- *
- * \param dpy the display handle.
- *
- * \return True on success or False on failure.
- *
- * Allocates and initializes the Display::fd array and create a Unix socket on
- * the first entry. For a server binds the socket to a filename and listen for
- * connections. For a client connects to the server and waits for a welcome
- * message. Sets the socket in nonblocking mode.
- */
-int __miniglx_open_connections( Display *dpy )
-{
- struct sockaddr_un sa;
- int i;
-
- dpy->nrFds = dpy->IsClient ? 1 : MINIGLX_MAX_SERVER_FDS;
- dpy->fd = calloc(1, dpy->nrFds * sizeof(struct MiniGLXConnection));
- if (!dpy->fd)
- return False;
-
- for (i = 0 ; i < dpy->nrFds ; i++)
- dpy->fd[i].fd = -1;
-
- if (!dpy->IsClient) {
- if (unlink(MINIGLX_FIFO_NAME) != 0 && errno != ENOENT) {
- perror("unlink " MINIGLX_FIFO_NAME);
- return False;
- }
-
- }
-
- /* Create a Unix socket -- Note this is *not* a network connection!
- */
- dpy->fd[0].fd = socket(PF_UNIX, SOCK_STREAM, 0);
- if (dpy->fd[0].fd < 0) {
- perror("socket " MINIGLX_FIFO_NAME);
- return False;
- }
-
- memset(&sa, 0, sizeof(sa));
- sa.sun_family = AF_UNIX;
- strcpy(sa.sun_path, MINIGLX_FIFO_NAME);
-
- if (dpy->IsClient) {
- /* Connect to server
- */
- if (connect(dpy->fd[0].fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) {
- perror("connect");
- shut_fd(dpy,0);
- return False;
- }
-
- /* Wait for configuration messages from the server.
- */
- welcome_message( dpy, 0 );
- }
- else {
- mode_t tmp = umask( 0000 ); /* open to everybody ? */
-
- /* Bind socket to our filename
- */
- if (bind(dpy->fd[0].fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) {
- perror("bind");
- shut_fd(dpy,0);
- return False;
- }
-
- umask( tmp );
-
- /* Listen for connections
- */
- if (listen(dpy->fd[0].fd, 5) != 0) {
- perror("listen");
- shut_fd(dpy,0);
- return False;
- }
- }
-
- if (fcntl(dpy->fd[0].fd, F_SETFL, O_NONBLOCK) != 0) {
- perror("fcntl");
- shut_fd(dpy,0);
- return False;
- }
-
-
- return True;
-}
-
-
-/**
- * Frees the connections initialized by __miniglx_open_connections().
- *
- * \param dpy the display handle.
- */
-void __miniglx_close_connections( Display *dpy )
-{
- int i;
-
- for (i = 0 ; i < dpy->nrFds ; i++) {
- if (dpy->fd[i].fd >= 0) {
- shutdown (dpy->fd[i].fd, SHUT_RDWR);
- close (dpy->fd[i].fd);
- }
- }
-
- dpy->nrFds = 0;
- free(dpy->fd);
-}
-
-
-/**
- * Set a drawable flag.
- *
- * \param dpy the display handle.
- * \param w drawable (window).
- * \param flag flag.
- *
- * Sets the specified drawable flag in the SAREA and increment its stamp while
- * holding the light hardware lock.
- */
-static void set_drawable_flag( Display *dpy, int w, int flag )
-{
- if (dpy->driverContext.pSAREA) {
- if (dpy->hwActive)
- DRM_LIGHT_LOCK( dpy->driverContext.drmFD,
- dpy->driverContext.pSAREA,
- dpy->driverContext.serverContext );
-
- dpy->driverContext.pSAREA->drawableTable[w].stamp++;
- dpy->driverContext.pSAREA->drawableTable[w].flags = flag;
-
- if (dpy->hwActive)
- DRM_UNLOCK( dpy->driverContext.drmFD,
- dpy->driverContext.pSAREA,
- dpy->driverContext.serverContext );
- }
-}
-
-
-
-/**
- * \brief Map Window.
- *
- * \param dpy the display handle as returned by XOpenDisplay().
- * \param w the window handle.
- *
- * If called by a client, sends a request for focus to the server. If
- * called by the server, will generate a MapNotify and Expose event at
- * the client.
- *
- */
-void
-XMapWindow( Display *dpy, Window w )
-{
- if (dpy->IsClient)
- send_char_msg( dpy, 0, _CanIHaveFocus );
- else {
- set_drawable_flag( dpy, (int)w, 1 );
- send_char_msg( dpy, (int)w, _YouveGotFocus );
- send_char_msg( dpy, (int)w, _RepaintPlease );
- dpy->TheWindow = w;
- }
- handle_fd_events( dpy, 0 ); /* flush write queue */
-}
-
-/**
- * \brief Unmap Window.
- *
- * \param dpy the display handle as returned by XOpenDisplay().
- * \param w the window handle.
- *
- * Called from the client: Lets the server know that the window won't
- * be updated anymore.
- *
- * Called from the server: Tells the specified client that it no longer
- * holds the focus.
- */
-void
-XUnmapWindow( Display *dpy, Window w )
-{
- if (dpy->IsClient) {
- send_char_msg( dpy, 0, _IDontWantFocus );
- }
- else {
- dpy->TheWindow = 0;
- set_drawable_flag( dpy, (int)w, 0 );
- send_char_msg( dpy, (int)w, _YouveLostFocus );
- }
- handle_fd_events( dpy, 0 ); /* flush write queue */
-}
-
-
-/**
- * \brief Block and wait for next X event.
- *
- * \param dpy the display handle as returned by XOpenDisplay().
- * \param event_return a pointer to an XEvent structure for the returned data.
- *
- * Wait until there is a new XEvent pending.
- */
-int XNextEvent(Display *dpy, XEvent *event_return)
-{
- for (;;) {
- if ( dpy->eventqueue.head != dpy->eventqueue.tail )
- return dequeue_event( dpy, event_return );
-
- handle_fd_events( dpy, 0 );
- }
-}
-
-/**
- * \brief Non-blocking check for next X event.
- *
- * \param dpy the display handle as returned by XOpenDisplay().
- * \param event_mask ignored.
- * \param event_return a pointer to an XEvent structure for the returned data.
- *
- * Check if there is a new XEvent pending. Note that event_mask is
- * ignored and any pending event will be returned.
- */
-Bool XCheckMaskEvent(Display *dpy, long event_mask, XEvent *event_return)
-{
- if ( dpy->eventqueue.head != dpy->eventqueue.tail )
- return dequeue_event( dpy, event_return );
-
- handle_fd_events( dpy, 1 );
-
- return dequeue_event( dpy, event_return );
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/Makefile b/nx-X11/extras/Mesa/src/glx/x11/Makefile
deleted file mode 100644
index 415ec02dd..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/Makefile
+++ /dev/null
@@ -1,94 +0,0 @@
-TOP = ../../..
-include $(TOP)/configs/current
-
-DEFINES += -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER
-
-C_SOURCES = \
- $(TOP)/src/mesa/glapi/glapi.c \
- $(TOP)/src/mesa/glapi/glthread.c \
- $(TOP)/src/mesa/main/dispatch.c \
- glcontextmodes.c \
- clientattrib.c \
- compsize.c \
- eval.c \
- glxcmds.c \
- glxext.c \
- glxextensions.c \
- indirect.c \
- indirect_init.c \
- indirect_size.c \
- indirect_window_pos.c \
- indirect_transpose_matrix.c \
- indirect_vertex_array.c \
- indirect_vertex_program.c \
- pixel.c \
- pixelstore.c \
- render2.c \
- renderpix.c \
- single2.c \
- singlepix.c \
- vertarr.c \
- xfont.c \
- glx_pbuffer.c \
- glx_query.c \
- glx_texture_compression.c \
- dri_glx.c \
- XF86dri.c \
-
-X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S
-X86-64_SOURCES = $(TOP)/src/mesa/x86-64/glapi_x86-64.S
-
-# ASM_SOURCES = $(X86_SOURCES)
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o)
-
-INCLUDES = -I. \
- -I$(TOP)/include \
- -I$(TOP)/include/GL/internal \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mesa/glapi \
- -I$(TOP)/src/mesa/drivers/dri/common \
- `pkg-config --cflags libdrm` \
- $(X11_INCLUDES)
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
-
-##### TARGETS #####
-
-default: depend $(LIB_DIR)/$(GL_LIB_NAME)
-
-glcontextmodes.c:
- ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c .
-
-# Make libGL
-$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
- $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
- -major 1 -minor 2 $(MKLIB_OPTIONS) \
- -install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
-
-
-depend: $(C_SOURCES) $(ASM_SOURCES) Makefile
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES)
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean:
- -rm -f $(LIB_DIR)/libGL.so*
- -rm -f *.o *~
- -rm -f depend
-
-include depend
diff --git a/nx-X11/extras/Mesa/src/glx/x11/XF86dri.c b/nx-X11/extras/Mesa/src/glx/x11/XF86dri.c
deleted file mode 100644
index 03fa4e57b..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/XF86dri.c
+++ /dev/null
@@ -1,617 +0,0 @@
-/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.13 2002/10/30 12:51:25 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL 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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Jens Owen <jens@tungstengraphics.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#define NEED_REPLIES
-#include <X11/Xlibint.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include "glheader.h"
-#include "xf86dristr.h"
-
-static XExtensionInfo _xf86dri_info_data;
-static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
-static char xf86dri_extension_name[] = XF86DRINAME;
-
-#define XF86DRICheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, xf86dri_extension_name, val)
-
-/*****************************************************************************
- * *
- * private utility routines *
- * *
- *****************************************************************************/
-
-static int close_display(Display *dpy, XExtCodes *extCodes);
-static /* const */ XExtensionHooks xf86dri_extension_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- close_display, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86dri_info,
- xf86dri_extension_name,
- &xf86dri_extension_hooks,
- 0, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86dri_info)
-
-
-/*****************************************************************************
- * *
- * public XFree86-DRI Extension routines *
- * *
- *****************************************************************************/
-
-#if 0
-#include <stdio.h>
-#define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg);
-#else
-#define TRACE(msg)
-#endif
-
-
-PUBLIC Bool XF86DRIQueryExtension (dpy, event_basep, error_basep)
- Display *dpy;
- int *event_basep, *error_basep;
-{
- XExtDisplayInfo *info = find_display (dpy);
-
- TRACE("QueryExtension...");
- if (XextHasExtension(info)) {
- *event_basep = info->codes->first_event;
- *error_basep = info->codes->first_error;
- TRACE("QueryExtension... return True");
- return True;
- } else {
- TRACE("QueryExtension... return False");
- return False;
- }
-}
-
-PUBLIC Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
- Display* dpy;
- int* majorVersion;
- int* minorVersion;
- int* patchVersion;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIQueryVersionReply rep;
- xXF86DRIQueryVersionReq *req;
-
- TRACE("QueryVersion...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIQueryVersion;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("QueryVersion... return False");
- return False;
- }
- *majorVersion = rep.majorVersion;
- *minorVersion = rep.minorVersion;
- *patchVersion = rep.patchVersion;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("QueryVersion... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
- Display* dpy;
- int screen;
- Bool* isCapable;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIQueryDirectRenderingCapableReply rep;
- xXF86DRIQueryDirectRenderingCapableReq *req;
-
- TRACE("QueryDirectRenderingCapable...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIQueryDirectRenderingCapable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIQueryDirectRenderingCapable;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("QueryDirectRenderingCapable... return False");
- return False;
- }
- *isCapable = rep.isCapable;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("QueryDirectRenderingCapable... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
- Display* dpy;
- int screen;
- drm_handle_t * hSAREA;
- char **busIdString;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIOpenConnectionReply rep;
- xXF86DRIOpenConnectionReq *req;
-
- TRACE("OpenConnection...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIOpenConnection, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIOpenConnection;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("OpenConnection... return False");
- return False;
- }
-
- *hSAREA = rep.hSAREALow;
-#ifdef LONG64
- *hSAREA |= ((drm_handle_t)rep.hSAREAHigh) << 32;
-#endif
-
- if (rep.length) {
- if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) {
- _XEatData(dpy, ((rep.busIdStringLength+3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("OpenConnection... return False");
- return False;
- }
- _XReadPad(dpy, *busIdString, rep.busIdStringLength);
- } else {
- *busIdString = NULL;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("OpenConnection... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIAuthConnection(dpy, screen, magic)
- Display* dpy;
- int screen;
- drm_magic_t magic;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIAuthConnectionReq *req;
- xXF86DRIAuthConnectionReply rep;
-
- TRACE("AuthConnection...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIAuthConnection, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIAuthConnection;
- req->screen = screen;
- req->magic = magic;
- rep.authenticated = 0;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.authenticated) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("AuthConnection... return False");
- return False;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("AuthConnection... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRICloseConnection(dpy, screen)
- Display* dpy;
- int screen;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRICloseConnectionReq *req;
-
- TRACE("CloseConnection...");
-
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRICloseConnection, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRICloseConnection;
- req->screen = screen;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("CloseConnection... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
- ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
- Display* dpy;
- int screen;
- int* ddxDriverMajorVersion;
- int* ddxDriverMinorVersion;
- int* ddxDriverPatchVersion;
- char** clientDriverName;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIGetClientDriverNameReply rep;
- xXF86DRIGetClientDriverNameReq *req;
-
- TRACE("GetClientDriverName...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIGetClientDriverName, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIGetClientDriverName;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetClientDriverName... return False");
- return False;
- }
-
- *ddxDriverMajorVersion = rep.ddxDriverMajorVersion;
- *ddxDriverMinorVersion = rep.ddxDriverMinorVersion;
- *ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
-
- if (rep.length) {
- if (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) {
- _XEatData(dpy, ((rep.clientDriverNameLength+3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetClientDriverName... return False");
- return False;
- }
- _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength);
- } else {
- *clientDriverName = NULL;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetClientDriverName... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
- hHWContext)
- Display* dpy;
- int screen;
- int configID;
- XID* context;
- drm_context_t * hHWContext;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRICreateContextReply rep;
- xXF86DRICreateContextReq *req;
-
- TRACE("CreateContext...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRICreateContext, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRICreateContext;
- req->visual = configID;
- req->screen = screen;
- *context = XAllocID(dpy);
- req->context = *context;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("CreateContext... return False");
- return False;
- }
- *hHWContext = rep.hHWContext;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("CreateContext... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
- Display* dpy;
- int screen;
- Visual* visual;
- XID* context;
- drm_context_t * hHWContext;
-{
- return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
- context, hHWContext );
-}
-
-PUBLIC GLboolean XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen,
- __DRIid context )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIDestroyContextReq *req;
-
- TRACE("DestroyContext...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIDestroyContext, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIDestroyContext;
- req->screen = screen;
- req->context = context;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("DestroyContext... return True");
- return True;
-}
-
-PUBLIC GLboolean XF86DRICreateDrawable( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable, drm_drawable_t * hHWDrawable )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRICreateDrawableReply rep;
- xXF86DRICreateDrawableReq *req;
-
- TRACE("CreateDrawable...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRICreateDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRICreateDrawable;
- req->screen = screen;
- req->drawable = drawable;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("CreateDrawable... return False");
- return False;
- }
- *hHWDrawable = rep.hHWDrawable;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("CreateDrawable... return True");
- return True;
-}
-
-PUBLIC GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIDestroyDrawableReq *req;
-
- TRACE("DestroyDrawable...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIDestroyDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIDestroyDrawable;
- req->screen = screen;
- req->drawable = drawable;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("DestroyDrawable... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable,
- unsigned int* index, unsigned int* stamp,
- int* X, int* Y, int* W, int* H,
- int* numClipRects, drm_clip_rect_t ** pClipRects,
- int* backX, int* backY,
- int* numBackClipRects, drm_clip_rect_t ** pBackClipRects )
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIGetDrawableInfoReply rep;
- xXF86DRIGetDrawableInfoReq *req;
- int total_rects;
-
- TRACE("GetDrawableInfo...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIGetDrawableInfo, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIGetDrawableInfo;
- req->screen = screen;
- req->drawable = drawable;
-
- if (!_XReply(dpy, (xReply *)&rep, 1, xFalse))
- {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDrawableInfo... return False");
- return False;
- }
- *index = rep.drawableTableIndex;
- *stamp = rep.drawableTableStamp;
- *X = (int)rep.drawableX;
- *Y = (int)rep.drawableY;
- *W = (int)rep.drawableWidth;
- *H = (int)rep.drawableHeight;
- *numClipRects = rep.numClipRects;
- total_rects = *numClipRects;
-
- *backX = rep.backX;
- *backY = rep.backY;
- *numBackClipRects = rep.numBackClipRects;
- total_rects += *numBackClipRects;
-
-#if 0
- /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks
- * backwards compatibility (Because of the >> 2 shift) but the fix
- * enables multi-threaded apps to work.
- */
- if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) -
- SIZEOF(xGenericReply) +
- total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) {
- _XEatData(dpy, rep.length);
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDrawableInfo... return False");
- return False;
- }
-#endif
-
- if (*numClipRects) {
- int len = sizeof(drm_clip_rect_t) * (*numClipRects);
-
- *pClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
- if (*pClipRects)
- _XRead(dpy, (char*)*pClipRects, len);
- } else {
- *pClipRects = NULL;
- }
-
- if (*numBackClipRects) {
- int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
-
- *pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
- if (*pBackClipRects)
- _XRead(dpy, (char*)*pBackClipRects, len);
- } else {
- *pBackClipRects = NULL;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDrawableInfo... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
- fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate)
- Display* dpy;
- int screen;
- drm_handle_t * hFrameBuffer;
- int* fbOrigin;
- int* fbSize;
- int* fbStride;
- int* devPrivateSize;
- void** pDevPrivate;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIGetDeviceInfoReply rep;
- xXF86DRIGetDeviceInfoReq *req;
-
- TRACE("GetDeviceInfo...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIGetDeviceInfo, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIGetDeviceInfo;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDeviceInfo... return False");
- return False;
- }
-
- *hFrameBuffer = rep.hFrameBufferLow;
-#ifdef LONG64
- *hFrameBuffer |= ((drm_handle_t)rep.hFrameBufferHigh) << 32;
-#endif
-
- *fbOrigin = rep.framebufferOrigin;
- *fbSize = rep.framebufferSize;
- *fbStride = rep.framebufferStride;
- *devPrivateSize = rep.devPrivateSize;
-
- if (rep.length) {
- if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) {
- _XEatData(dpy, ((rep.devPrivateSize+3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDeviceInfo... return False");
- return False;
- }
- _XRead(dpy, (char*)*pDevPrivate, rep.devPrivateSize);
- } else {
- *pDevPrivate = NULL;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDeviceInfo... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIOpenFullScreen(dpy, screen, drawable)
- Display* dpy;
- int screen;
- Drawable drawable;
-{
- /* This function and the underlying X protocol are deprecated.
- */
- (void) dpy;
- (void) screen;
- (void) drawable;
- return False;
-}
-
-PUBLIC Bool XF86DRICloseFullScreen(dpy, screen, drawable)
- Display* dpy;
- int screen;
- Drawable drawable;
-{
- /* This function and the underlying X protocol are deprecated.
- */
- (void) dpy;
- (void) screen;
- (void) drawable;
- return True;
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/clientattrib.c b/nx-X11/extras/Mesa/src/glx/x11/clientattrib.c
deleted file mode 100644
index bfb263ced..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/clientattrib.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include <assert.h>
-#include "glxclient.h"
-#include "indirect.h"
-#include "indirect_vertex_array.h"
-
-/*****************************************************************************/
-
-static void
-do_enable_disable(GLenum array, GLboolean val )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- unsigned index = 0;
-
- if ( array == GL_TEXTURE_COORD_ARRAY ) {
- index = __glXGetActiveTextureUnit( state );
- }
-
- if ( ! __glXSetArrayEnable( state, array, index, val ) ) {
- __glXSetError(gc, GL_INVALID_ENUM);
- }
-}
-
-void __indirect_glEnableClientState(GLenum array)
-{
- do_enable_disable( array, GL_TRUE );
-}
-
-void __indirect_glDisableClientState(GLenum array)
-{
- do_enable_disable( array, GL_FALSE );
-}
-
-/************************************************************************/
-
-void __indirect_glPushClientAttrib(GLuint mask)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- __GLXattribute **spp = gc->attributes.stackPointer, *sp;
-
- if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
- if (!(sp = *spp)) {
- sp = (__GLXattribute *)Xmalloc(sizeof(__GLXattribute));
- *spp = sp;
- }
- sp->mask = mask;
- gc->attributes.stackPointer = spp + 1;
- if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
- sp->storePack = state->storePack;
- sp->storeUnpack = state->storeUnpack;
- }
- if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- __glXPushArrayState( state );
- }
- } else {
- __glXSetError(gc, GL_STACK_OVERFLOW);
- return;
- }
-}
-
-void __indirect_glPopClientAttrib(void)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- __GLXattribute **spp = gc->attributes.stackPointer, *sp;
- GLuint mask;
-
- if (spp > &gc->attributes.stack[0]) {
- --spp;
- sp = *spp;
- assert(sp != 0);
- mask = sp->mask;
- gc->attributes.stackPointer = spp;
-
- if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
- state->storePack = sp->storePack;
- state->storeUnpack = sp->storeUnpack;
- }
- if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- __glXPopArrayState( state );
- }
-
- sp->mask = 0;
- } else {
- __glXSetError(gc, GL_STACK_UNDERFLOW);
- return;
- }
-}
-
-void __glFreeAttributeState(__GLXcontext *gc)
-{
- __GLXattribute *sp, **spp;
-
- for (spp = &gc->attributes.stack[0];
- spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
- spp++) {
- sp = *spp;
- if (sp) {
- XFree((char *)sp);
- } else {
- break;
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/dri_glx.c b/nx-X11/extras/Mesa/src/glx/x11/dri_glx.c
deleted file mode 100644
index 516ca508c..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/dri_glx.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.14 2003/07/16 00:54:00 dawes Exp $ */
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- * Brian Paul <brian@precisioninsight.com>
- *
- */
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include <unistd.h>
-#include <X11/Xlibint.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include "glxclient.h"
-#include "xf86dri.h"
-#include "sarea.h"
-#include <stdio.h>
-#include <dlfcn.h>
-#include "dri_glx.h"
-#include <sys/types.h>
-#include <stdarg.h>
-
-#ifndef RTLD_NOW
-#define RTLD_NOW 0
-#endif
-#ifndef RTLD_GLOBAL
-#define RTLD_GLOBAL 0
-#endif
-
-
-#ifndef DEFAULT_DRIVER_DIR
-/* this is normally defined in the Imakefile */
-#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
-#endif
-
-static __DRIdriver *Drivers = NULL;
-
-
-/*
- * printf wrappers
- */
-
-static void InfoMessageF(const char *f, ...)
-{
- va_list args;
- const char *env;
-
- if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) {
- fprintf(stderr, "libGL: ");
- va_start(args, f);
- vfprintf(stderr, f, args);
- va_end(args);
- }
-}
-
-static void ErrorMessageF(const char *f, ...)
-{
- va_list args;
-
- if (getenv("LIBGL_DEBUG")) {
- fprintf(stderr, "libGL error: ");
- va_start(args, f);
- vfprintf(stderr, f, args);
- va_end(args);
- }
-}
-
-
-/**
- * Extract the ith directory path out of a colon-separated list of paths. No
- * more than \c dirLen characters, including the terminating \c NUL, will be
- * written to \c dir.
- *
- * \param index Index of path to extract (starting at zero)
- * \param paths The colon-separated list of paths
- * \param dirLen Maximum length of result to store in \c dir
- * \param dir Buffer to hold the extracted directory path
- *
- * \returns
- * The number of characters that would have been written to \c dir had there
- * been enough room. This does not include the terminating \c NUL. When
- * extraction fails, zero will be returned.
- *
- * \todo
- * It seems like this function could be rewritten to use \c strchr.
- */
-static size_t
-ExtractDir(int index, const char *paths, int dirLen, char *dir)
-{
- int i, len;
- const char *start, *end;
-
- /* find ith colon */
- start = paths;
- i = 0;
- while (i < index) {
- if (*start == ':') {
- i++;
- start++;
- }
- else if (*start == 0) {
- /* end of string and couldn't find ith colon */
- dir[0] = 0;
- return 0;
- }
- else {
- start++;
- }
- }
-
- while (*start == ':')
- start++;
-
- /* find next colon, or end of string */
- end = start + 1;
- while (*end != ':' && *end != 0) {
- end++;
- }
-
- /* copy string between <start> and <end> into result string */
- len = end - start;
- if (len > dirLen - 1)
- len = dirLen - 1;
- strncpy(dir, start, len);
- dir[len] = 0;
-
- return( end - start );
-}
-
-
-/**
- * Versioned name of the expected \c __driCreateNewScreen function.
- *
- * The version of the last incompatible loader/driver inteface change is
- * appended to the name of the \c __driCreateNewScreen function. This
- * prevents loaders from trying to load drivers that are too old.
- *
- * \todo
- * Create a macro or something so that this is automatically updated.
- */
-static const char createNewScreenName[] = "__driCreateNewScreen_20050727";
-
-
-/**
- * Try to \c dlopen the named driver.
- *
- * This function adds the "_dri.so" suffix to the driver name and searches the
- * directories specified by the \c LIBGL_DRIVERS_PATH environment variable in
- * order to find the driver.
- *
- * \param driverName - a name like "tdfx", "i810", "mga", etc.
- *
- * \returns
- * A handle from \c dlopen, or \c NULL if driver file not found.
- */
-static __DRIdriver *OpenDriver(const char *driverName)
-{
- char *libPaths = NULL;
- char libDir[1000];
- int i;
- __DRIdriver *driver;
-
- /* First, search Drivers list to see if we've already opened this driver */
- for (driver = Drivers; driver; driver = driver->next) {
- if (strcmp(driver->name, driverName) == 0) {
- /* found it */
- return driver;
- }
- }
-
- if (geteuid() == getuid()) {
- /* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
- libPaths = getenv("LIBGL_DRIVERS_PATH");
- if (!libPaths)
- libPaths = getenv("LIBGL_DRIVERS_DIR"); /* deprecated */
- }
- if (!libPaths)
- libPaths = DEFAULT_DRIVER_DIR;
-
- for ( i = 0 ; ExtractDir(i, libPaths, 1000, libDir) != 0 ; i++ ) {
- char realDriverName[200];
- void *handle = NULL;
-
-
- /* If TLS support is enabled, try to open the TLS version of the driver
- * binary first. If that fails, try the non-TLS version.
- */
-#ifdef GLX_USE_TLS
- snprintf(realDriverName, 200, "%s/tls/%s_dri.so", libDir, driverName);
- InfoMessageF("OpenDriver: trying %s\n", realDriverName);
- handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
-#endif
-
- if ( handle == NULL ) {
- snprintf(realDriverName, 200, "%s/%s_dri.so", libDir, driverName);
- InfoMessageF("OpenDriver: trying %s\n", realDriverName);
- handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
- }
-
- if ( handle != NULL ) {
- /* allocate __DRIdriver struct */
- driver = (__DRIdriver *) Xmalloc(sizeof(__DRIdriver));
- if (!driver)
- return NULL; /* out of memory! */
- /* init the struct */
- driver->name = __glXstrdup(driverName);
- if (!driver->name) {
- Xfree(driver);
- return NULL; /* out of memory! */
- }
-
- driver->createNewScreenFunc = (PFNCREATENEWSCREENFUNC)
- dlsym(handle, createNewScreenName);
-
- if ( driver->createNewScreenFunc == NULL ) {
- /* If the driver doesn't have this symbol then something's
- * really, really wrong.
- */
- ErrorMessageF("%s not defined in %s_dri.so!\n"
- "Your driver may be too old for this libGL.\n",
- createNewScreenName, driverName);
- Xfree(driver);
- dlclose(handle);
- continue;
- }
- driver->handle = handle;
- /* put at head of linked list */
- driver->next = Drivers;
- Drivers = driver;
- return driver;
- }
- else {
- ErrorMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror());
- }
- }
-
- ErrorMessageF("unable to find driver: %s_dri.so\n", driverName);
- return NULL;
-}
-
-
-/*
- * Given a display pointer and screen number, determine the name of
- * the DRI driver for the screen. (I.e. "r128", "tdfx", etc).
- * Return True for success, False for failure.
- */
-static Bool GetDriverName(Display *dpy, int scrNum, char **driverName)
-{
- int directCapable;
- Bool b;
- int driverMajor, driverMinor, driverPatch;
-
- *driverName = NULL;
-
- if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) {
- ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n");
- return False;
- }
- if (!directCapable) {
- ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n");
- return False;
- }
-
- b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor,
- &driverPatch, driverName);
- if (!b) {
- ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum);
- return False;
- }
-
- InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
- driverMajor, driverMinor, driverPatch, *driverName, scrNum);
-
- return True;
-}
-
-
-/*
- * Given a display pointer and screen number, return a __DRIdriver handle.
- * Return NULL if anything goes wrong.
- */
-__DRIdriver *driGetDriver(Display *dpy, int scrNum)
-{
- char *driverName;
- if (GetDriverName(dpy, scrNum, &driverName)) {
- __DRIdriver *ret;
- ret = OpenDriver(driverName);
- if (driverName)
- Xfree(driverName);
- return ret;
- }
- return NULL;
-}
-
-
-/*
- * Exported function for querying the DRI driver for a given screen.
- *
- * The returned char pointer points to a static array that will be
- * overwritten by subsequent calls.
- */
-const char *glXGetScreenDriver (Display *dpy, int scrNum) {
- static char ret[32];
- char *driverName;
- if (GetDriverName(dpy, scrNum, &driverName)) {
- int len;
- if (!driverName)
- return NULL;
- len = strlen (driverName);
- if (len >= 31)
- return NULL;
- memcpy (ret, driverName, len+1);
- Xfree(driverName);
- return ret;
- }
- return NULL;
-}
-
-
-/*
- * Exported function for obtaining a driver's option list (UTF-8 encoded XML).
- *
- * The returned char pointer points directly into the driver. Therefore
- * it should be treated as a constant.
- *
- * If the driver was not found or does not support configuration NULL is
- * returned.
- *
- * Note: The driver remains opened after this function returns.
- */
-const char *glXGetDriverConfig (const char *driverName) {
- __DRIdriver *driver = OpenDriver (driverName);
- if (driver)
- return dlsym (driver->handle, "__driConfigOptions");
- else
- return NULL;
-}
-
-
-/* This function isn't currently used.
- */
-static void driDestroyDisplay(Display *dpy, void *private)
-{
- __DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private;
-
- if (pdpyp) {
- const int numScreens = ScreenCount(dpy);
- int i;
- for (i = 0; i < numScreens; i++) {
- if (pdpyp->libraryHandles[i])
- dlclose(pdpyp->libraryHandles[i]);
- }
- Xfree(pdpyp->libraryHandles);
- Xfree(pdpyp);
- }
-}
-
-
-/*
- * Allocate, initialize and return a __DRIdisplayPrivate object.
- * This is called from __glXInitialize() when we are given a new
- * display pointer.
- */
-void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
-{
- const int numScreens = ScreenCount(dpy);
- __DRIdisplayPrivate *pdpyp;
- int eventBase, errorBase;
- int major, minor, patch;
- int scrn;
-
- /* Initialize these fields to NULL in case we fail.
- * If we don't do this we may later get segfaults trying to free random
- * addresses when the display is closed.
- */
- pdisp->private = NULL;
- pdisp->destroyDisplay = NULL;
-
- if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
- return NULL;
- }
-
- if (!XF86DRIQueryVersion(dpy, &major, &minor, &patch)) {
- return NULL;
- }
-
- pdpyp = (__DRIdisplayPrivate *)Xmalloc(sizeof(__DRIdisplayPrivate));
- if (!pdpyp) {
- return NULL;
- }
-
- pdpyp->driMajor = major;
- pdpyp->driMinor = minor;
- pdpyp->driPatch = patch;
-
- pdisp->destroyDisplay = driDestroyDisplay;
-
- /* allocate array of pointers to createNewScreen funcs */
- pdisp->createNewScreen = (PFNCREATENEWSCREENFUNC *)
- Xmalloc(numScreens * sizeof(void *));
- if (!pdisp->createNewScreen) {
- Xfree(pdpyp);
- return NULL;
- }
-
- /* allocate array of library handles */
- pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
- if (!pdpyp->libraryHandles) {
- Xfree(pdisp->createNewScreen);
- Xfree(pdpyp);
- return NULL;
- }
-
- /* dynamically discover DRI drivers for all screens, saving each
- * driver's "__driCreateScreen" function pointer. That's the bootstrap
- * entrypoint for all DRI drivers.
- */
- for (scrn = 0; scrn < numScreens; scrn++) {
- __DRIdriver *driver = driGetDriver(dpy, scrn);
- if (driver) {
- pdisp->createNewScreen[scrn] = driver->createNewScreenFunc;
- pdpyp->libraryHandles[scrn] = driver->handle;
- }
- else {
- pdisp->createNewScreen[scrn] = NULL;
- pdpyp->libraryHandles[scrn] = NULL;
- }
- }
-
- return (void *)pdpyp;
-}
-
-#endif /* GLX_DIRECT_RENDERING */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/dri_glx.h b/nx-X11/extras/Mesa/src/glx/x11/dri_glx.h
deleted file mode 100644
index 75561685c..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/dri_glx.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- * Brian Paul <brian@precisioninsight.com>
- *
- */
-
-#ifndef _DRI_GLX_H_
-#define _DRI_GLX_H_
-
-#ifdef GLX_DIRECT_RENDERING
-
-struct __DRIdisplayPrivateRec {
- /*
- ** XFree86-DRI version information
- */
- int driMajor;
- int driMinor;
- int driPatch;
-
- /*
- ** Array of library handles [indexed by screen number]
- */
- void **libraryHandles;
-};
-
-typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
-typedef struct __DRIscreenPrivateRec __DRIscreenPrivate;
-typedef struct __DRIvisualPrivateRec __DRIvisualPrivate;
-typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
-typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate;
-
-#endif
-#endif /* _DRI_GLX_H_ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/eval.c b/nx-X11/extras/Mesa/src/glx/x11/eval.c
deleted file mode 100644
index 0f94e6da6..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/eval.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* $XFree86$ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "packrender.h"
-
-/*
-** Routines to pack evaluator maps into the transport buffer. Maps are
-** allowed to have extra arbitrary data, so these routines extract just
-** the information that the GL needs.
-*/
-
-void __glFillMap1f(GLint k, GLint order, GLint stride,
- const GLfloat *points, GLubyte *pc)
-{
- if (stride == k) {
- /* Just copy the data */
- __GLX_PUT_FLOAT_ARRAY(0, points, order * k);
- } else {
- GLint i;
-
- for (i = 0; i < order; i++) {
- __GLX_PUT_FLOAT_ARRAY(0, points, k);
- points += stride;
- pc += k * __GLX_SIZE_FLOAT32;
- }
- }
-}
-
-void __glFillMap1d(GLint k, GLint order, GLint stride,
- const GLdouble *points, GLubyte *pc)
-{
- if (stride == k) {
- /* Just copy the data */
- __GLX_PUT_DOUBLE_ARRAY(0, points, order * k);
- } else {
- GLint i;
- for (i = 0; i < order; i++) {
- __GLX_PUT_DOUBLE_ARRAY(0, points, k);
- points += stride;
- pc += k * __GLX_SIZE_FLOAT64;
- }
- }
-}
-
-void __glFillMap2f(GLint k, GLint majorOrder, GLint minorOrder,
- GLint majorStride, GLint minorStride,
- const GLfloat *points, GLfloat *data)
-{
- GLint i, j, x;
-
- if ((minorStride == k) && (majorStride == minorOrder*k)) {
- /* Just copy the data */
- __GLX_MEM_COPY(data, points, majorOrder * majorStride *
- __GLX_SIZE_FLOAT32);
- return;
- }
- for (i = 0; i < majorOrder; i++) {
- for (j = 0; j < minorOrder; j++) {
- for (x = 0; x < k; x++) {
- data[x] = points[x];
- }
- points += minorStride;
- data += k;
- }
- points += majorStride - minorStride * minorOrder;
- }
-}
-
-void __glFillMap2d(GLint k, GLint majorOrder, GLint minorOrder,
- GLint majorStride, GLint minorStride,
- const GLdouble *points, GLdouble *data)
-{
- int i,j,x;
-
- if ((minorStride == k) && (majorStride == minorOrder*k)) {
- /* Just copy the data */
- __GLX_MEM_COPY(data, points, majorOrder * majorStride *
- __GLX_SIZE_FLOAT64);
- return;
- }
-
-#ifdef __GLX_ALIGN64
- x = k * __GLX_SIZE_FLOAT64;
-#endif
- for (i = 0; i<majorOrder; i++) {
- for (j = 0; j<minorOrder; j++) {
-#ifdef __GLX_ALIGN64
- __GLX_MEM_COPY(data, points, x);
-#else
- for (x = 0; x<k; x++) {
- data[x] = points[x];
- }
-#endif
- points += minorStride;
- data += k;
- }
- points += majorStride - minorStride * minorOrder;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glx_pbuffer.c b/nx-X11/extras/Mesa/src/glx/x11/glx_pbuffer.c
deleted file mode 100644
index 83c550559..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glx_pbuffer.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 glx_pbuffer.c
- * Implementation of pbuffer related functions.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <inttypes.h>
-#include "glxclient.h"
-#include <X11/extensions/extutil.h>
-#include <X11/extensions/Xext.h>
-#include <assert.h>
-#include <string.h>
-#include "glapi.h"
-#include "glxextensions.h"
-#include "glcontextmodes.h"
-#include "glheader.h"
-
-static void ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
- const CARD32 * attribs, size_t num_attribs );
-
-static void DestroyPbuffer( Display * dpy, GLXDrawable drawable );
-
-static GLXDrawable CreatePbuffer( Display *dpy,
- const __GLcontextModes * fbconfig, unsigned int width, unsigned int height,
- const int *attrib_list, GLboolean size_in_attribs );
-
-static int GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
- int attribute, unsigned int *value );
-
-
-/**
- * Change a drawable's attribute.
- *
- * This function is used to implement \c glXSelectEvent and
- * \c glXSelectEventSGIX.
- *
- * \note
- * This function dynamically determines whether to use the SGIX_pbuffer
- * version of the protocol or the GLX 1.3 version of the protocol.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
- */
-static void
-ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
- const CARD32 * attribs, size_t num_attribs )
-{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
- CARD32 * output;
-
-
- if ( (dpy == NULL) || (drawable == 0) ) {
- return;
- }
-
-
- LockDisplay(dpy);
-
- if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
- xGLXChangeDrawableAttributesReq *req;
-
- GetReqExtra( GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req );
- output = (CARD32 *) (req + 1);
-
- req->reqType = __glXSetupForCommand(dpy);
- req->glxCode = X_GLXChangeDrawableAttributes;
- req->drawable = drawable;
- req->numAttribs = (CARD32) num_attribs;
- }
- else {
- xGLXVendorPrivateWithReplyReq *vpreq;
-
- GetReqExtra( GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq );
- output = (CARD32 *) (vpreq + 1);
-
- vpreq->reqType = __glXSetupForCommand(dpy);
- vpreq->glxCode = X_GLXVendorPrivateWithReply;
- vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
-
- output[0] = (CARD32) drawable;
- output++;
- }
-
- (void) memcpy( output, attribs, sizeof( CARD32 ) * 2 * num_attribs );
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return;
-}
-
-
-/**
- * Destroy a pbuffer.
- *
- * This function is used to implement \c glXDestroyPbuffer and
- * \c glXDestroyGLXPbufferSGIX.
- *
- * \note
- * This function dynamically determines whether to use the SGIX_pbuffer
- * version of the protocol or the GLX 1.3 version of the protocol.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
- */
-static void
-DestroyPbuffer( Display * dpy, GLXDrawable drawable )
-{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
-
- if ( (dpy == NULL) || (drawable == 0) ) {
- return;
- }
-
-
- LockDisplay(dpy);
-
- if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
- xGLXDestroyPbufferReq * req;
-
- GetReqExtra( GLXDestroyPbuffer, 4, req );
- req->reqType = __glXSetupForCommand(dpy);
- req->glxCode = X_GLXDestroyPbuffer;
- req->pbuffer = (GLXPbuffer) drawable;
- }
- else {
- xGLXVendorPrivateWithReplyReq *vpreq;
- CARD32 * data;
-
- GetReqExtra( GLXVendorPrivateWithReply, 4, vpreq );
- data = (CARD32 *) (vpreq + 1);
-
- data[0] = (CARD32) drawable;
-
- vpreq->reqType = __glXSetupForCommand(dpy);
- vpreq->glxCode = X_GLXVendorPrivateWithReply;
- vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return;
-}
-
-
-/**
- * Get a drawable's attribute.
- *
- * This function is used to implement \c glXGetSelectedEvent and
- * \c glXGetSelectedEventSGIX.
- *
- * \note
- * This function dynamically determines whether to use the SGIX_pbuffer
- * version of the protocol or the GLX 1.3 version of the protocol.
- *
- * \todo
- * The number of attributes returned is likely to be small, probably less than
- * 10. Given that, this routine should try to use an array on the stack to
- * capture the reply rather than always calling Xmalloc.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
- */
-static int
-GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
- int attribute, unsigned int *value )
-{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
- xGLXGetDrawableAttributesReply reply;
- CARD32 * data;
- unsigned int length;
- unsigned int i;
- unsigned int num_attributes;
- GLboolean use_glx_1_3 = ((priv->majorVersion > 1)
- || (priv->minorVersion >= 3));
-
-
- if ( (dpy == NULL) || (drawable == 0) ) {
- return 0;
- }
-
-
- LockDisplay(dpy);
-
- if ( use_glx_1_3 ) {
- xGLXGetDrawableAttributesReq *req;
-
- GetReqExtra( GLXGetDrawableAttributes, 4, req );
- req->reqType = __glXSetupForCommand(dpy);
- req->glxCode = X_GLXGetDrawableAttributes;
- req->drawable = drawable;
- }
- else {
- xGLXVendorPrivateWithReplyReq *vpreq;
-
- GetReqExtra( GLXVendorPrivateWithReply, 4, vpreq );
- data = (CARD32 *) (vpreq + 1);
- data[0] = (CARD32) drawable;
-
- vpreq->reqType = __glXSetupForCommand(dpy);
- vpreq->glxCode = X_GLXVendorPrivateWithReply;
- vpreq->vendorCode = X_GLXvop_GetDrawableAttributesSGIX;
- }
-
- _XReply(dpy, (xReply*) &reply, 0, False);
-
- length = reply.length;
- num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
- data = (CARD32 *) Xmalloc( length * sizeof(CARD32) );
- if ( data == NULL ) {
- /* Throw data on the floor */
- _XEatData(dpy, length);
- } else {
- _XRead(dpy, (char *)data, length * sizeof(CARD32) );
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
-
- /* Search the set of returned attributes for the attribute requested by
- * the caller.
- */
-
- for ( i = 0 ; i < num_attributes ; i++ ) {
- if ( data[i*2] == attribute ) {
- *value = data[ (i*2) + 1 ];
- break;
- }
- }
-
- Xfree( data );
-
- return 0;
-}
-
-
-/**
- * Create a non-pbuffer GLX drawable.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
- */
-static GLXDrawable
-CreateDrawable( Display *dpy, const __GLcontextModes * fbconfig,
- Drawable drawable, const int *attrib_list,
- CARD8 glxCode )
-{
- xGLXCreateWindowReq * req;
- CARD32 * data;
- unsigned int i;
-
- i = 0;
- if (attrib_list) {
- while (attrib_list[i * 2] != None)
- i++;
- }
-
- LockDisplay(dpy);
- GetReqExtra( GLXCreateWindow, 8 * i, req );
- data = (CARD32 *) (req + 1);
-
- req->reqType = __glXSetupForCommand(dpy);
- req->glxCode = glxCode;
- req->screen = (CARD32) fbconfig->screen;
- req->fbconfig = fbconfig->fbconfigID;
- req->window = (GLXPbuffer) drawable;
- req->glxwindow = (GLXWindow) XAllocID(dpy);
- req->numAttribs = (CARD32) i;
-
- memcpy( data, attrib_list, 8 * i );
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return (GLXDrawable)req->glxwindow;
-}
-
-
-/**
- * Destroy a non-pbuffer GLX drawable.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
- */
-static void
-DestroyDrawable( Display * dpy, GLXDrawable drawable, CARD32 glxCode )
-{
- xGLXDestroyPbufferReq * req;
-
- if ( (dpy == NULL) || (drawable == 0) ) {
- return;
- }
-
-
- LockDisplay(dpy);
-
- GetReqExtra( GLXDestroyPbuffer, 4, req );
- req->reqType = __glXSetupForCommand(dpy);
- req->glxCode = glxCode;
- req->pbuffer = (GLXPbuffer) drawable;
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return;
-}
-
-
-/**
- * Create a pbuffer.
- *
- * This function is used to implement \c glXCreatePbuffer and
- * \c glXCreateGLXPbufferSGIX.
- *
- * \note
- * This function dynamically determines whether to use the SGIX_pbuffer
- * version of the protocol or the GLX 1.3 version of the protocol.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
- */
-static GLXDrawable
-CreatePbuffer( Display *dpy, const __GLcontextModes * fbconfig,
- unsigned int width, unsigned int height,
- const int *attrib_list, GLboolean size_in_attribs )
-{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
- GLXDrawable id = 0;
- CARD32 * data;
- unsigned int i;
-
- i = 0;
- if (attrib_list) {
- while (attrib_list[i * 2])
- i++;
- }
-
- LockDisplay(dpy);
- id = XAllocID(dpy);
-
- if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
- xGLXCreatePbufferReq * req;
- unsigned int extra = (size_in_attribs) ? 0 : 2;
-
- GetReqExtra( GLXCreatePbuffer, (8 * (i + extra)), req );
- data = (CARD32 *) (req + 1);
-
- req->reqType = __glXSetupForCommand(dpy);
- req->glxCode = X_GLXCreatePbuffer;
- req->screen = (CARD32) fbconfig->screen;
- req->fbconfig = fbconfig->fbconfigID;
- req->pbuffer = (GLXPbuffer) id;
- req->numAttribs = (CARD32) (i + extra);
-
- if ( ! size_in_attribs ) {
- data[(2 * i) + 0] = GLX_PBUFFER_WIDTH;
- data[(2 * i) + 1] = width;
- data[(2 * i) + 2] = GLX_PBUFFER_HEIGHT;
- data[(2 * i) + 3] = height;
- data += 4;
- }
- }
- else {
- xGLXVendorPrivateReq *vpreq;
-
- GetReqExtra( GLXVendorPrivate, 20 + (8 * i), vpreq );
- data = (CARD32 *) (vpreq + 1);
-
- vpreq->reqType = __glXSetupForCommand(dpy);
- vpreq->glxCode = X_GLXVendorPrivate;
- vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX;
-
- data[0] = (CARD32) fbconfig->screen;
- data[1] = (CARD32) fbconfig->fbconfigID;
- data[2] = (CARD32) id;
- data[3] = (CARD32) width;
- data[4] = (CARD32) height;
- data += 5;
- }
-
- (void) memcpy( data, attrib_list, sizeof(CARD32) * 2 * i );
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return id;
-}
-
-
-/**
- * Create a new pbuffer.
- */
-PUBLIC GLXPbufferSGIX
-glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config,
- unsigned int width, unsigned int height,
- int *attrib_list)
-{
- return (GLXPbufferSGIX) CreatePbuffer( dpy, (__GLcontextModes *) config,
- width, height,
- attrib_list, GL_FALSE );
-}
-
-
-/**
- * Create a new pbuffer.
- */
-PUBLIC GLXPbuffer
-glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attrib_list)
-{
- return (GLXPbuffer) CreatePbuffer( dpy, (__GLcontextModes *) config,
- 0, 0,
- attrib_list, GL_TRUE );
-}
-
-
-/**
- * Destroy an existing pbuffer.
- */
-PUBLIC void
-glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf)
-{
- DestroyPbuffer( dpy, pbuf );
-}
-
-
-/**
- * Query an attribute of a drawable.
- */
-PUBLIC void
-glXQueryDrawable(Display *dpy, GLXDrawable drawable,
- int attribute, unsigned int *value)
-{
- GetDrawableAttribute( dpy, drawable, attribute, value );
-}
-
-
-/**
- * Query an attribute of a pbuffer.
- */
-PUBLIC int
-glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX drawable,
- int attribute, unsigned int *value)
-{
- return GetDrawableAttribute( dpy, drawable, attribute, value );
-}
-
-
-/**
- * Select the event mask for a drawable.
- */
-PUBLIC void
-glXSelectEvent(Display *dpy, GLXDrawable drawable, unsigned long mask)
-{
- CARD32 attribs[2];
-
- attribs[0] = (CARD32) GLX_EVENT_MASK;
- attribs[1] = (CARD32) mask;
-
- ChangeDrawableAttribute( dpy, drawable, attribs, 1 );
-}
-
-
-/**
- * Get the selected event mask for a drawable.
- */
-PUBLIC void
-glXGetSelectedEvent(Display *dpy, GLXDrawable drawable, unsigned long *mask)
-{
- unsigned int value;
-
-
- /* The non-sense with value is required because on LP64 platforms
- * sizeof(unsigned int) != sizeof(unsigned long). On little-endian
- * we could just type-cast the pointer, but why?
- */
-
- GetDrawableAttribute( dpy, drawable, GLX_EVENT_MASK_SGIX, & value );
- *mask = value;
-}
-
-
-PUBLIC GLXPixmap
-glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
- const int *attrib_list )
-{
- return CreateDrawable( dpy, (__GLcontextModes *) config,
- (Drawable) pixmap, attrib_list,
- X_GLXCreatePixmap );
-}
-
-
-PUBLIC GLXWindow
-glXCreateWindow( Display *dpy, GLXFBConfig config, Window win,
- const int *attrib_list )
-{
- return CreateDrawable( dpy, (__GLcontextModes *) config,
- (Drawable) win, attrib_list,
- X_GLXCreateWindow );
-}
-
-
-PUBLIC void
-glXDestroyPixmap(Display *dpy, GLXPixmap pixmap)
-{
- DestroyDrawable( dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap );
-}
-
-
-PUBLIC void
-glXDestroyWindow(Display *dpy, GLXWindow win)
-{
- DestroyDrawable( dpy, (GLXDrawable) win, X_GLXDestroyWindow );
-}
-
-
-PUBLIC GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
- (Display *dpy, GLXPbufferSGIX pbuf),
- (dpy, pbuf),
- glXDestroyPbuffer)
-
-PUBLIC GLX_ALIAS_VOID(glXSelectEventSGIX,
- (Display *dpy, GLXDrawable drawable, unsigned long mask),
- (dpy, drawable, mask),
- glXSelectEvent)
-
-PUBLIC GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
- (Display *dpy, GLXDrawable drawable, unsigned long *mask),
- (dpy, drawable, mask),
- glXGetSelectedEvent)
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glx_query.c b/nx-X11/extras/Mesa/src/glx/x11/glx_query.c
deleted file mode 100644
index e93cd2afd..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glx_query.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 glx_query.c
- * Generic utility functions to query internal data from the server.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "glxclient.h"
-
-/**
- * GLX protocol structure for the ficticious "GXLGenericGetString" request.
- *
- * This is a non-existant protocol packet. It just so happens that all of
- * the real protocol packets used to request a string from the server have
- * an identical binary layout. The only difference between them is the
- * meaning of the \c for_whom field and the value of the \c glxCode.
- */
-typedef struct GLXGenericGetString {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 for_whom B32;
- CARD32 name B32;
-} xGLXGenericGetStringReq;
-
-/* These defines are only needed to make the GetReq macro happy.
- */
-#define sz_xGLXGenericGetStringReq 12
-#define X_GLXGenericGetString 0
-
-/**
- * Query the Server GLX string and cache it in the display private.
- * This routine will allocate the necessay space for the string.
- */
-char *
-__glXGetStringFromServer( Display * dpy, int opcode, CARD32 glxCode,
- CARD32 for_whom, CARD32 name )
-{
- xGLXGenericGetStringReq *req;
- xGLXSingleReply reply;
- int length;
- int numbytes;
- char * buf;
-
-
- LockDisplay( dpy );
-
-
- /* All of the GLX protocol requests for getting a string from the server
- * look the same. The exact meaning of the for_whom field is usually
- * either the screen number (for glXQueryServerString) or the context tag
- * (for GLXSingle).
- */
-
- GetReq( GLXGenericGetString, req );
- req->reqType = opcode;
- req->glxCode = glxCode;
- req->for_whom = for_whom;
- req->name = name;
-
- _XReply( dpy, (xReply *) & reply, 0, False );
-
- length = reply.length * 4;
- numbytes = reply.size;
-
- buf = (char *) Xmalloc( numbytes );
- if ( buf != NULL ) {
- _XRead( dpy, buf, numbytes );
- length -= numbytes;
- }
-
- _XEatData( dpy, length );
-
- UnlockDisplay( dpy );
- SyncHandle();
-
- return buf;
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glx_texture_compression.c b/nx-X11/extras/Mesa/src/glx/x11/glx_texture_compression.c
deleted file mode 100644
index 567685801..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glx_texture_compression.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file glx_texture_compression.c
- * Contains the routines required to implement GLX protocol for
- * ARB_texture_compression and related extensions.
- *
- * \sa http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_compression.txt
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "packrender.h"
-#include "packsingle.h"
-#include "indirect.h"
-
-#include <assert.h>
-
-
-void
-__indirect_glGetCompressedTexImageARB( GLenum target, GLint level,
- GLvoid * img )
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
- xGLXGetTexImageReply reply;
- size_t image_bytes;
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN( X_GLsop_GetCompressedTexImage, 8 );
- __GLX_SINGLE_PUT_LONG( 0, target );
- __GLX_SINGLE_PUT_LONG( 4, level );
- __GLX_SINGLE_READ_XREPLY();
-
- image_bytes = reply.width;
- assert( image_bytes <= ((4 * reply.length) - 0) );
- assert( image_bytes >= ((4 * reply.length) - 3) );
-
- if ( image_bytes != 0 ) {
- _XRead( dpy, (char *) img, image_bytes );
- if ( image_bytes < (4 * reply.length) ) {
- _XEatData( dpy, (4 * reply.length) - image_bytes );
- }
- }
-
- __GLX_SINGLE_END();
-}
-
-
-/**
- * Internal function used for \c glCompressedTexImage1D and
- * \c glCompressedTexImage2D.
- */
-static void
-CompressedTexImage1D2D( GLenum target, GLint level,
- GLenum internal_format,
- GLsizei width, GLsizei height,
- GLint border, GLsizei image_size,
- const GLvoid *data, CARD32 rop )
-{
- __GLX_DECLARE_VARIABLES();
-
- __GLX_LOAD_VARIABLES();
- if ( gc->currentDpy == NULL ) {
- return;
- }
-
- if ( (target == GL_PROXY_TEXTURE_1D)
- || (target == GL_PROXY_TEXTURE_2D)
- || (target == GL_PROXY_TEXTURE_CUBE_MAP) ) {
- compsize = 0;
- }
- else {
- compsize = image_size;
- }
-
- cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE
- + compsize );
- if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
- __GLX_BEGIN_VARIABLE( rop, cmdlen );
- __GLX_PUT_LONG( 4, target );
- __GLX_PUT_LONG( 8, level );
- __GLX_PUT_LONG( 12, internal_format );
- __GLX_PUT_LONG( 16, width );
- __GLX_PUT_LONG( 20, height );
- __GLX_PUT_LONG( 24, border );
- __GLX_PUT_LONG( 28, image_size );
- if ( compsize != 0 ) {
- __GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE,
- data, image_size );
- }
- __GLX_END( cmdlen );
- }
- else {
- assert( compsize != 0 );
-
- __GLX_BEGIN_VARIABLE_LARGE( rop, cmdlen + 4 );
- __GLX_PUT_LONG( 8, target );
- __GLX_PUT_LONG( 12, level );
- __GLX_PUT_LONG( 16, internal_format );
- __GLX_PUT_LONG( 20, width );
- __GLX_PUT_LONG( 24, height );
- __GLX_PUT_LONG( 28, border );
- __GLX_PUT_LONG( 32, image_size );
- __glXSendLargeCommand( gc, gc->pc,
- __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + 4,
- data, image_size );
- }
-}
-
-
-/**
- * Internal function used for \c glCompressedTexSubImage1D and
- * \c glCompressedTexSubImage2D.
- */
-static void
-CompressedTexSubImage1D2D( GLenum target, GLint level,
- GLsizei xoffset, GLsizei yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLsizei image_size,
- const GLvoid *data, CARD32 rop )
-{
- __GLX_DECLARE_VARIABLES();
-
- __GLX_LOAD_VARIABLES();
- if ( gc->currentDpy == NULL ) {
- return;
- }
-
- if ( target == GL_PROXY_TEXTURE_3D ) {
- compsize = 0;
- }
- else {
- compsize = image_size;
- }
-
- cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE
- + compsize );
- if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
- __GLX_BEGIN_VARIABLE( rop, cmdlen );
- __GLX_PUT_LONG( 4, target );
- __GLX_PUT_LONG( 8, level );
- __GLX_PUT_LONG( 12, xoffset );
- __GLX_PUT_LONG( 16, yoffset );
- __GLX_PUT_LONG( 20, width );
- __GLX_PUT_LONG( 24, height );
- __GLX_PUT_LONG( 28, format );
- __GLX_PUT_LONG( 32, image_size );
- if ( compsize != 0 ) {
- __GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE,
- data, image_size );
- }
- __GLX_END( cmdlen );
- }
- else {
- assert( compsize != 0 );
-
- __GLX_BEGIN_VARIABLE_LARGE( rop, cmdlen + 4 );
- __GLX_PUT_LONG( 8, target );
- __GLX_PUT_LONG( 12, level );
- __GLX_PUT_LONG( 16, xoffset );
- __GLX_PUT_LONG( 20, yoffset );
- __GLX_PUT_LONG( 24, width );
- __GLX_PUT_LONG( 28, height );
- __GLX_PUT_LONG( 32, format );
- __GLX_PUT_LONG( 36, image_size );
- __glXSendLargeCommand( gc, gc->pc,
- __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + 4,
- data, image_size );
- }
-}
-
-
-void
-__indirect_glCompressedTexImage1DARB( GLenum target, GLint level,
- GLenum internal_format, GLsizei width,
- GLint border, GLsizei image_size,
- const GLvoid *data )
-{
- CompressedTexImage1D2D( target, level, internal_format, width, 0,
- border, image_size, data,
- X_GLrop_CompressedTexImage1D );
-}
-
-
-void
-__indirect_glCompressedTexImage2DARB( GLenum target, GLint level,
- GLenum internal_format,
- GLsizei width, GLsizei height,
- GLint border, GLsizei image_size,
- const GLvoid *data )
-{
- CompressedTexImage1D2D( target, level, internal_format, width, height,
- border, image_size, data,
- X_GLrop_CompressedTexImage2D );
-}
-
-
-void
-__indirect_glCompressedTexImage3DARB( GLenum target, GLint level,
- GLenum internal_format,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLsizei image_size,
- const GLvoid *data )
-{
- __GLX_DECLARE_VARIABLES();
-
- __GLX_LOAD_VARIABLES();
- if ( gc->currentDpy == NULL ) {
- return;
- }
-
- cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE
- + image_size );
- if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
- __GLX_BEGIN_VARIABLE( X_GLrop_CompressedTexImage3D, cmdlen );
- __GLX_PUT_LONG( 4, target );
- __GLX_PUT_LONG( 8, level );
- __GLX_PUT_LONG( 12, internal_format );
- __GLX_PUT_LONG( 16, width );
- __GLX_PUT_LONG( 20, height );
- __GLX_PUT_LONG( 24, depth );
- __GLX_PUT_LONG( 28, border );
- __GLX_PUT_LONG( 32, image_size );
- if ( image_size != 0 ) {
- __GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE,
- data, image_size );
- }
- __GLX_END( cmdlen );
- }
- else {
- __GLX_BEGIN_VARIABLE_LARGE( X_GLrop_CompressedTexImage3D,
- cmdlen + 4 );
- __GLX_PUT_LONG( 8, target );
- __GLX_PUT_LONG( 12, level );
- __GLX_PUT_LONG( 16, internal_format );
- __GLX_PUT_LONG( 20, width );
- __GLX_PUT_LONG( 24, height );
- __GLX_PUT_LONG( 28, depth );
- __GLX_PUT_LONG( 32, border );
- __GLX_PUT_LONG( 36, image_size );
- __glXSendLargeCommand( gc, gc->pc,
- __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + 4,
- data, image_size );
- }
-}
-
-
-void
-__indirect_glCompressedTexSubImage1DARB( GLenum target, GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLsizei image_size,
- const GLvoid *data )
-{
- CompressedTexSubImage1D2D( target, level, xoffset, 0, width, 0,
- format, image_size, data,
- X_GLrop_CompressedTexSubImage1D );
-}
-
-
-void
-__indirect_glCompressedTexSubImage2DARB( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLsizei image_size,
- const GLvoid *data )
-{
- CompressedTexSubImage1D2D( target, level, xoffset, yoffset, width, height,
- format, image_size, data,
- X_GLrop_CompressedTexSubImage2D );
-}
-
-
-void
-__indirect_glCompressedTexSubImage3DARB( GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLsizei image_size,
- const GLvoid *data )
-{
- __GLX_DECLARE_VARIABLES();
-
- __GLX_LOAD_VARIABLES();
- if ( gc->currentDpy == NULL ) {
- return;
- }
-
- cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE
- + image_size );
- if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
- __GLX_BEGIN_VARIABLE( X_GLrop_CompressedTexSubImage3D, cmdlen );
- __GLX_PUT_LONG( 4, target );
- __GLX_PUT_LONG( 8, level );
- __GLX_PUT_LONG( 12, xoffset );
- __GLX_PUT_LONG( 16, yoffset );
- __GLX_PUT_LONG( 20, zoffset );
- __GLX_PUT_LONG( 24, width );
- __GLX_PUT_LONG( 28, height );
- __GLX_PUT_LONG( 32, depth );
- __GLX_PUT_LONG( 36, format );
- __GLX_PUT_LONG( 40, image_size );
- if ( image_size != 0 ) {
- __GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE,
- data, image_size );
- }
- __GLX_END( cmdlen );
- }
- else {
- __GLX_BEGIN_VARIABLE_LARGE( X_GLrop_CompressedTexSubImage3D,
- cmdlen + 4 );
- __GLX_PUT_LONG( 8, target );
- __GLX_PUT_LONG( 12, level );
- __GLX_PUT_LONG( 16, xoffset );
- __GLX_PUT_LONG( 20, yoffset );
- __GLX_PUT_LONG( 24, zoffset );
- __GLX_PUT_LONG( 28, width );
- __GLX_PUT_LONG( 32, height );
- __GLX_PUT_LONG( 36, depth );
- __GLX_PUT_LONG( 40, format );
- __GLX_PUT_LONG( 44, image_size );
- __glXSendLargeCommand( gc, gc->pc,
- __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE + 4,
- data, image_size );
- }
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glxclient.h b/nx-X11/extras/Mesa/src/glx/x11/glxclient.h
deleted file mode 100644
index bc9a94c5d..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glxclient.h
+++ /dev/null
@@ -1,690 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.21 2004/02/09 23:46:31 alanh Exp $ */
-
-/**
- * \file glxclient.h
- * Direct rendering support added by Precision Insight, Inc.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- */
-
-#ifndef _GLX_client_h_
-#define _GLX_client_h_
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <X11/Xproto.h>
-#include <X11/Xlibint.h>
-#define GLX_GLXEXT_PROTOTYPES
-#include <GL/glx.h>
-#include <GL/glxext.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#ifdef WIN32
-#include <stdint.h>
-#endif
-#include "GL/glxint.h"
-#include "GL/glxproto.h"
-#include "GL/internal/glcore.h"
-#include "glapitable.h"
-#include "glxextensions.h"
-#if defined( USE_XTHREADS )
-# include <X11/Xthreads.h>
-#elif defined( PTHREADS )
-# include <pthread.h>
-#endif
-
-#define GLX_MAJOR_VERSION 1 /* current version numbers */
-#define GLX_MINOR_VERSION 4
-
-#define __GLX_MAX_TEXTURE_UNITS 32
-
-typedef struct __GLXcontextRec __GLXcontext;
-typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
-typedef struct _glapi_table __GLapi;
-
-/************************************************************************/
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include <GL/internal/dri_interface.h>
-
-
-/**
- * Display dependent methods. This structure is initialized during the
- * \c driCreateDisplay call.
- */
-struct __DRIdisplayRec {
- /**
- * Method to destroy the private DRI display data.
- */
- void (*destroyDisplay)(Display *dpy, void *displayPrivate);
-
- /**
- * Opaque pointer to private per display direct rendering data.
- * \c NULL if direct rendering is not supported on this display.
- */
- struct __DRIdisplayPrivateRec *private;
-
- /**
- * Array of pointers to methods to create and initialize the private DRI
- * screen data.
- */
- PFNCREATENEWSCREENFUNC * createNewScreen;
-};
-
-
-/*
-** We keep a linked list of these structures, one per DRI device driver.
-*/
-struct __DRIdriverRec {
- const char *name;
- void *handle;
- PFNCREATENEWSCREENFUNC createNewScreenFunc;
- struct __DRIdriverRec *next;
-};
-
-/*
-** Function to create and DRI display data and initialize the display
-** dependent methods.
-*/
-extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
-
-extern __DRIdriver *driGetDriver(Display *dpy, int scrNum);
-
-extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
-
-/*
-** Functions to obtain driver configuration information from a direct
-** rendering client application
-*/
-extern const char *glXGetScreenDriver (Display *dpy, int scrNum);
-
-extern const char *glXGetDriverConfig (const char *driverName);
-
-extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
-
-#endif
-
-/************************************************************************/
-
-#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
-
-typedef struct __GLXpixelStoreModeRec {
- GLboolean swapEndian;
- GLboolean lsbFirst;
- GLuint rowLength;
- GLuint imageHeight;
- GLuint imageDepth;
- GLuint skipRows;
- GLuint skipPixels;
- GLuint skipImages;
- GLuint alignment;
-} __GLXpixelStoreMode;
-
-
-typedef struct __GLXattributeRec {
- GLuint mask;
-
- /**
- * Pixel storage state. Most of the pixel store mode state is kept
- * here and used by the client code to manage the packing and
- * unpacking of data sent to/received from the server.
- */
- __GLXpixelStoreMode storePack, storeUnpack;
-
- /**
- * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically
- * disabled?
- */
- GLboolean NoDrawArraysProtocol;
-
- /**
- * Vertex Array storage state. The vertex array component
- * state is stored here and is used to manage the packing of
- * DrawArrays data sent to the server.
- */
- struct array_state_vector * array_state;
-} __GLXattribute;
-
-typedef struct __GLXattributeMachineRec {
- __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
- __GLXattribute **stackPointer;
-} __GLXattributeMachine;
-
-/**
- * GLX state that needs to be kept on the client. One of these records
- * exist for each context that has been made current by this client.
- */
-struct __GLXcontextRec {
- /**
- * \name Drawing command buffer.
- *
- * Drawing commands are packed into this buffer before being sent as a
- * single GLX protocol request. The buffer is sent when it overflows or
- * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location
- * in the buffer to be filled. \c limit is described above in the buffer
- * slop discussion.
- *
- * Commands that require large amounts of data to be transfered will
- * also use this buffer to hold a header that describes the large
- * command.
- *
- * These must be the first 6 fields since they are static initialized
- * in the dummy context in glxext.c
- */
- /*@{*/
- GLubyte *buf;
- GLubyte *pc;
- GLubyte *limit;
- GLubyte *bufEnd;
- GLint bufSize;
- /*@}*/
-
- /**
- * The XID of this rendering context. When the context is created a
- * new XID is allocated. This is set to None when the context is
- * destroyed but is still current to some thread. In this case the
- * context will be freed on next MakeCurrent.
- */
- XID xid;
-
- /**
- * The XID of the \c shareList context.
- */
- XID share_xid;
-
- /**
- * Visual id.
- *
- * \deprecated
- * This filed has been largely been replaced by the \c mode field, but
- * the work is not quite done.
- */
- VisualID vid;
-
- /**
- * Screen number.
- */
- GLint screen;
-
- /**
- * \c GL_TRUE if the context was created with ImportContext, which
- * means the server-side context was created by another X client.
- */
- GLboolean imported;
-
- /**
- * The context tag returned by MakeCurrent when this context is made
- * current. This tag is used to identify the context that a thread has
- * current so that proper server context management can be done. It is
- * used for all context specific commands (i.e., \c Render, \c RenderLarge,
- * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old
- * context)).
- */
- GLXContextTag currentContextTag;
-
- /**
- * \name Rendering mode
- *
- * The rendering mode is kept on the client as well as the server.
- * When \c glRenderMode is called, the buffer associated with the
- * previous rendering mode (feedback or select) is filled.
- */
- /*@{*/
- GLenum renderMode;
- GLfloat *feedbackBuf;
- GLuint *selectBuf;
- /*@}*/
-
- /**
- * This is \c GL_TRUE if the pixel unpack modes are such that an image
- * can be unpacked from the clients memory by just copying. It may
- * still be true that the server will have to do some work. This
- * just promises that a straight copy will fetch the correct bytes.
- */
- GLboolean fastImageUnpack;
-
- /**
- * Fill newImage with the unpacked form of \c oldImage getting it
- * ready for transport to the server.
- */
- void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
- GLenum, const GLvoid*, GLubyte*, GLubyte*);
-
- /**
- * Client side attribs.
- */
- __GLXattributeMachine attributes;
-
- /**
- * Client side error code. This is set when client side gl API
- * routines need to set an error because of a bad enumerant or
- * running out of memory, etc.
- */
- GLenum error;
-
- /**
- * Whether this context does direct rendering.
- */
- Bool isDirect;
-
- /**
- * \c dpy of current display for this context. Will be \c NULL if not
- * current to any display, or if this is the "dummy context".
- */
- Display *currentDpy;
-
- /**
- * The current drawable for this context. Will be None if this
- * context is not current to any drawable. currentReadable is below.
- */
- GLXDrawable currentDrawable;
-
- /**
- * \name GL Constant Strings
- *
- * Constant strings that describe the server implementation
- * These pertain to GL attributes, not to be confused with
- * GLX versioning attributes.
- */
- /*@{*/
- GLubyte *vendor;
- GLubyte *renderer;
- GLubyte *version;
- GLubyte *extensions;
- /*@}*/
-
- /**
- * Record the dpy this context was created on for later freeing
- */
- Display *createDpy;
-
- /**
- * Maximum small render command size. This is the smaller of 64k and
- * the size of the above buffer.
- */
- GLint maxSmallRenderCommandSize;
-
- /**
- * Major opcode for the extension. Copied here so a lookup isn't
- * needed.
- */
- GLint majorOpcode;
-
-#ifdef GLX_DIRECT_RENDERING
- /**
- * Per context direct rendering interface functions and data.
- */
- __DRIcontext driContext;
-#endif
-
- /**
- * \c GLXFBConfigID used to create this context. May be \c None. This
- * field has been replaced by the \c mode field.
- *
- * \since Internal API version 20030317.
- *
- * \deprecated
- * This filed has been largely been replaced by the \c mode field, but
- * the work is not quite done.
- */
- GLXFBConfigID fbconfigID;
-
- /**
- * The current read-drawable for this context. Will be None if this
- * context is not current to any drawable.
- *
- * \since Internal API version 20030606.
- */
- GLXDrawable currentReadable;
-
- /**
- * Pointer to client-state data that is private to libGL. This is only
- * used for indirect rendering contexts.
- *
- * No internal API version change was made for this change. Client-side
- * drivers should NEVER use this data or even care that it exists.
- */
- void * client_state_private;
-
- /**
- * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE.
- */
- int renderType;
-
- /**
- * \name Raw server GL version
- *
- * True core GL version supported by the server. This is the raw value
- * returned by the server, and it may not reflect what is actually
- * supported (or reported) by the client-side library.
- */
- /*@{*/
- int server_major; /**< Major version number. */
- int server_minor; /**< Minor version number. */
- /*@}*/
-
- char gl_extension_bits[ __GL_EXT_BYTES ];
-};
-
-#define __glXSetError(gc,code) \
- if (!(gc)->error) { \
- (gc)->error = code; \
- }
-
-extern void __glFreeAttributeState(__GLXcontext *);
-
-/************************************************************************/
-
-/**
- * The size of the largest drawing command known to the implementation
- * that will use the GLXRender GLX command. In this case it is
- * \c glPolygonStipple.
- */
-#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156
-
-/**
- * To keep the implementation fast, the code uses a "limit" pointer
- * to determine when the drawing command buffer is too full to hold
- * another fixed size command. This constant defines the amount of
- * space that must always be available in the drawing command buffer
- * at all times for the implementation to work. It is important that
- * the number be just large enough, but not so large as to reduce the
- * efficacy of the buffer. The "+32" is just to keep the code working
- * in case somebody counts wrong.
- */
-#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32)
-
-/**
- * This implementation uses a smaller threshold for switching
- * to the RenderLarge protocol than the protcol requires so that
- * large copies don't occur.
- */
-#define __GLX_RENDER_CMD_SIZE_LIMIT 4096
-
-/**
- * One of these records exists per screen of the display. It contains
- * a pointer to the config data for that screen (if the screen supports GL).
- */
-typedef struct __GLXscreenConfigsRec {
- /**
- * GLX extension string reported by the X-server.
- */
- const char *serverGLXexts;
-
- /**
- * GLX extension string to be reported to applications. This is the
- * set of extensions that the application can actually use.
- */
- char *effectiveGLXexts;
-
-#ifdef GLX_DIRECT_RENDERING
- /**
- * Per screen direct rendering interface functions and data.
- */
- __DRIscreen driScreen;
-#endif
-
- /**
- * Linked list of configurations for this screen.
- */
- __GLcontextModes *configs;
-
- /**
- * Per-screen dynamic GLX extension tracking. The \c direct_support
- * field only contains enough bits for 64 extensions. Should libGL
- * ever need to track more than 64 GLX extensions, we can safely grow
- * this field. The \c __GLXscreenConfigs structure is not used outside
- * libGL.
- */
- /*@{*/
- unsigned char direct_support[8];
- GLboolean ext_list_first_time;
- /*@}*/
-
-} __GLXscreenConfigs;
-
-/**
- * Per display private data. One of these records exists for each display
- * that is using the OpenGL (GLX) extension.
- */
-struct __GLXdisplayPrivateRec {
- /**
- * Back pointer to the display
- */
- Display *dpy;
-
- /**
- * The \c majorOpcode is common to all connections to the same server.
- * It is also copied into the context structure.
- */
- int majorOpcode;
-
- /**
- * \name Server Version
- *
- * Major and minor version returned by the server during initialization.
- */
- /*@{*/
- int majorVersion, minorVersion;
- /*@}*/
-
- /**
- * \name Storage for the servers GLX vendor and versions strings.
- *
- * These are the same for all screens on this display. These fields will
- * be filled in on demand.
- */
- /*@{*/
- const char *serverGLXvendor;
- const char *serverGLXversion;
- /*@}*/
-
- /**
- * Configurations of visuals for all screens on this display.
- * Also, per screen data which now includes the server \c GLX_EXTENSION
- * string.
- */
- __GLXscreenConfigs *screenConfigs;
-
-#ifdef GLX_DIRECT_RENDERING
- /**
- * Per display direct rendering interface functions and data.
- */
- __DRIdisplay driDisplay;
-#endif
-};
-
-void __glXFreeContext(__GLXcontext*);
-
-extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
-
-extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
- GLint totalRequests,
- const GLvoid * data, GLint dataLen);
-
-extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
- const GLvoid *, GLint);
-
-/* Initialize the GLX extension for dpy */
-extern __GLXdisplayPrivate *__glXInitialize(Display*);
-
-/************************************************************************/
-
-extern int __glXDebug;
-
-/* This is per-thread storage in an MT environment */
-#if defined( USE_XTHREADS ) || defined( PTHREADS )
-
-extern void __glXSetCurrentContext(__GLXcontext *c);
-
-# if defined( GLX_USE_TLS )
-
-extern __thread void * __glX_tls_Context
- __attribute__((tls_model("initial-exec")));
-
-# define __glXGetCurrentContext() __glX_tls_Context
-
-# else
-
-extern __GLXcontext *__glXGetCurrentContext(void);
-
-# endif /* defined( GLX_USE_TLS ) */
-
-#else
-
-extern __GLXcontext *__glXcurrentContext;
-#define __glXGetCurrentContext() __glXcurrentContext
-#define __glXSetCurrentContext(gc) __glXcurrentContext = gc
-
-#endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */
-
-
-/*
-** Global lock for all threads in this address space using the GLX
-** extension
-*/
-#if defined( USE_XTHREADS )
-extern xmutex_rec __glXmutex;
-#define __glXLock() xmutex_lock(&__glXmutex)
-#define __glXUnlock() xmutex_unlock(&__glXmutex)
-#elif defined( PTHREADS )
-extern pthread_mutex_t __glXmutex;
-#define __glXLock() pthread_mutex_lock(&__glXmutex)
-#define __glXUnlock() pthread_mutex_unlock(&__glXmutex)
-#else
-#define __glXLock()
-#define __glXUnlock()
-#endif
-
-/*
-** Setup for a command. Initialize the extension for dpy if necessary.
-*/
-extern CARD8 __glXSetupForCommand(Display *dpy);
-
-/************************************************************************/
-
-/*
-** Data conversion and packing support.
-*/
-
-extern const GLuint __glXDefaultPixelStore[9];
-
-/* Send an image to the server using RenderLarge. */
-extern void __glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim,
- GLint width, GLint height, GLint depth, GLenum format, GLenum type,
- const GLvoid *src, GLubyte *pc, GLubyte *modes);
-
-/* Return the size, in bytes, of some pixel data */
-extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum);
-
-/* Return the number of elements per group of a specified format*/
-extern GLint __glElementsPerGroup(GLenum format, GLenum type);
-
-/* Return the number of bytes per element, based on the element type (other
-** than GL_BITMAP).
-*/
-extern GLint __glBytesPerElement(GLenum type);
-
-/*
-** Fill the transport buffer with the data from the users buffer,
-** applying some of the pixel store modes (unpack modes) to the data
-** first. As a side effect of this call, the "modes" field is
-** updated to contain the modes needed by the server to decode the
-** sent data.
-*/
-extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
- GLenum, const GLvoid*, GLubyte*, GLubyte*);
-
-/* Copy map data with a stride into a packed buffer */
-extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *);
-extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *);
-extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint,
- const GLfloat *, GLfloat *);
-extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint,
- const GLdouble *, GLdouble *);
-
-/*
-** Empty an image out of the reply buffer into the clients memory applying
-** the pack modes to pack back into the clients requested format.
-*/
-extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
- GLenum, const GLubyte *, GLvoid *);
-
-
-/*
-** Allocate and Initialize Vertex Array client state
-*/
-extern void __glXInitVertexArrayState(__GLXcontext*);
-
-/*
-** Inform the Server of the major and minor numbers and of the client
-** libraries extension string.
-*/
-extern void __glXClientInfo ( Display *dpy, int opcode );
-
-/************************************************************************/
-
-/*
-** Declarations that should be in Xlib
-*/
-#ifdef __GL_USE_OUR_PROTOTYPES
-extern void _XFlush(Display*);
-extern Status _XReply(Display*, xReply*, int, Bool);
-extern void _XRead(Display*, void*, long);
-extern void _XSend(Display*, const void*, long);
-#endif
-
-
-extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
- int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
-
-extern char * __glXGetStringFromServer( Display * dpy, int opcode,
- CARD32 glxCode, CARD32 for_whom, CARD32 name );
-
-extern char *__glXstrdup(const char *str);
-
-
-extern const char __glXGLClientVersion[];
-extern const char __glXGLClientExtensions[];
-
-/* Determine the internal API version */
-extern int __glXGetInternalVersion(void);
-
-/* Get the unadjusted system time */
-extern int __glXGetUST( int64_t * ust );
-
-#endif /* !__GLX_client_h__ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glxcmds.c b/nx-X11/extras/Mesa/src/glx/x11/glxcmds.c
deleted file mode 100644
index 6a31f24dd..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glxcmds.c
+++ /dev/null
@@ -1,2969 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.30 2004/01/30 20:33:06 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/**
- * \file glxcmds.c
- * Client-side GLX interface.
- */
-
-#include <inttypes.h>
-#include "glxclient.h"
-#include <X11/extensions/extutil.h>
-#include <X11/extensions/Xext.h>
-#include <assert.h>
-#include <string.h>
-#include "glapi.h"
-#ifdef GLX_DIRECT_RENDERING
-#include "indirect_init.h"
-#include <X11/extensions/xf86vmode.h>
-#include "xf86dri.h"
-#endif
-#include "glxextensions.h"
-#include "glcontextmodes.h"
-#include "glheader.h"
-#include <sys/time.h>
-
-static const char __glXGLXClientVendorName[] = "SGI";
-static const char __glXGLXClientVersion[] = "1.4";
-
-
-/****************************************************************************/
-/**
- * Get the __DRIdrawable for the drawable associated with a GLXContext
- *
- * \param dpy The display associated with \c drawable.
- * \param drawable GLXDrawable whose __DRIdrawable part is to be retrieved.
- * \returns A pointer to the context's __DRIdrawable on success, or NULL if
- * the drawable is not associated with a direct-rendering context.
- */
-
-#ifdef GLX_DIRECT_RENDERING
-static __DRIdrawable *
-GetDRIDrawable( Display *dpy, GLXDrawable drawable, int * const scrn_num )
-{
- __GLXdisplayPrivate * const priv = __glXInitialize(dpy);
-
- if ( (priv != NULL) && (priv->driDisplay.private != NULL) ) {
- const unsigned screen_count = ScreenCount(dpy);
- unsigned i;
-
- for ( i = 0 ; i < screen_count ; i++ ) {
- __DRIscreen * const psc = &priv->screenConfigs[i].driScreen;
- __DRIdrawable * const pdraw = (psc->private != NULL)
- ? (*psc->getDrawable)(dpy, drawable, psc->private) : NULL;
-
- if ( pdraw != NULL ) {
- if ( scrn_num != NULL ) {
- *scrn_num = i;
- }
- return pdraw;
- }
- }
- }
-
- return NULL;
-}
-#endif
-
-
-/**
- * Get the GLX per-screen data structure associated with a GLX context.
- *
- * \param dpy Display for which the GLX per-screen information is to be
- * retrieved.
- * \param scrn Screen on \c dpy for which the GLX per-screen information is
- * to be retrieved.
- * \returns A pointer to the GLX per-screen data if \c dpy and \c scrn
- * specify a valid GLX screen, or NULL otherwise.
- *
- * \todo Should this function validate that \c scrn is within the screen
- * number range for \c dpy?
- */
-
-static __GLXscreenConfigs *
-GetGLXScreenConfigs(Display *dpy, int scrn)
-{
- __GLXdisplayPrivate * const priv = __glXInitialize(dpy);
-
- return (priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL;
-}
-
-
-static int
-GetGLXPrivScreenConfig( Display *dpy, int scrn, __GLXdisplayPrivate ** ppriv,
- __GLXscreenConfigs ** ppsc )
-{
- /* Initialize the extension, if needed . This has the added value
- * of initializing/allocating the display private
- */
-
- if ( dpy == NULL ) {
- return GLX_NO_EXTENSION;
- }
-
- *ppriv = __glXInitialize(dpy);
- if ( *ppriv == NULL ) {
- return GLX_NO_EXTENSION;
- }
-
- /* Check screen number to see if its valid */
- if ((scrn < 0) || (scrn >= ScreenCount(dpy))) {
- return GLX_BAD_SCREEN;
- }
-
- /* Check to see if the GL is supported on this screen */
- *ppsc = &((*ppriv)->screenConfigs[scrn]);
- if ( (*ppsc)->configs == NULL ) {
- /* No support for GL on this screen regardless of visual */
- return GLX_BAD_VISUAL;
- }
-
- return Success;
-}
-
-
-/**
- * Determine if a \c GLXFBConfig supplied by the application is valid.
- *
- * \param dpy Application supplied \c Display pointer.
- * \param config Application supplied \c GLXFBConfig.
- *
- * \returns If the \c GLXFBConfig is valid, the a pointer to the matching
- * \c __GLcontextModes structure is returned. Otherwise, \c NULL
- * is returned.
- */
-static __GLcontextModes *
-ValidateGLXFBConfig( Display * dpy, GLXFBConfig config )
-{
- __GLXdisplayPrivate * const priv = __glXInitialize(dpy);
- const unsigned num_screens = ScreenCount(dpy);
- unsigned i;
- const __GLcontextModes * modes;
-
-
- if ( priv != NULL ) {
- for ( i = 0 ; i < num_screens ; i++ ) {
- for ( modes = priv->screenConfigs[i].configs
- ; modes != NULL
- ; modes = modes->next ) {
- if ( modes == (__GLcontextModes *) config ) {
- return (__GLcontextModes *) config;
- }
- }
- }
- }
-
- return NULL;
-}
-
-
-/**
- * \todo It should be possible to move the allocate of \c client_state_private
- * later in the function for direct-rendering contexts. Direct-rendering
- * contexts don't need to track client state, so they don't need that memory
- * at all.
- *
- * \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new
- * function called \c __glXAllocateClientState that allocates the memory and
- * does all the initialization (including the pixel pack / unpack).
- */
-static
-GLXContext AllocateGLXContext( Display *dpy )
-{
- GLXContext gc;
- int bufSize;
- CARD8 opcode;
- __GLXattribute *state;
-
- if (!dpy)
- return NULL;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return NULL;
- }
-
- /* Allocate our context record */
- gc = (GLXContext) Xmalloc(sizeof(struct __GLXcontextRec));
- if (!gc) {
- /* Out of memory */
- return NULL;
- }
- memset(gc, 0, sizeof(struct __GLXcontextRec));
-
- state = Xmalloc(sizeof(struct __GLXattributeRec));
- if (state == NULL) {
- /* Out of memory */
- Xfree(gc);
- return NULL;
- }
- gc->client_state_private = state;
- memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec));
- state->NoDrawArraysProtocol = (getenv("LIBGL_NO_DRAWARRAYS") != NULL);
-
- /*
- ** Create a temporary buffer to hold GLX rendering commands. The size
- ** of the buffer is selected so that the maximum number of GLX rendering
- ** commands can fit in a single X packet and still have room in the X
- ** packet for the GLXRenderReq header.
- */
-
- bufSize = (XMaxRequestSize(dpy) * 4) - sz_xGLXRenderReq;
- gc->buf = (GLubyte *) Xmalloc(bufSize);
- if (!gc->buf) {
- Xfree(gc->client_state_private);
- Xfree(gc);
- return NULL;
- }
- gc->bufSize = bufSize;
-
- /* Fill in the new context */
- gc->renderMode = GL_RENDER;
-
- state->storePack.alignment = 4;
- state->storeUnpack.alignment = 4;
-
- gc->attributes.stackPointer = &gc->attributes.stack[0];
-
- /*
- ** PERFORMANCE NOTE: A mode dependent fill image can speed things up.
- ** Other code uses the fastImageUnpack bit, but it is never set
- ** to GL_TRUE.
- */
- gc->fastImageUnpack = GL_FALSE;
- gc->fillImage = __glFillImage;
- gc->isDirect = GL_FALSE;
- gc->pc = gc->buf;
- gc->bufEnd = gc->buf + bufSize;
- if (__glXDebug) {
- /*
- ** Set limit register so that there will be one command per packet
- */
- gc->limit = gc->buf;
- } else {
- gc->limit = gc->buf + bufSize - __GLX_BUFFER_LIMIT_SIZE;
- }
- gc->createDpy = dpy;
- gc->majorOpcode = opcode;
-
- /*
- ** Constrain the maximum drawing command size allowed to be
- ** transfered using the X_GLXRender protocol request. First
- ** constrain by a software limit, then constrain by the protocl
- ** limit.
- */
- if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) {
- bufSize = __GLX_RENDER_CMD_SIZE_LIMIT;
- }
- if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) {
- bufSize = __GLX_MAX_RENDER_CMD_SIZE;
- }
- gc->maxSmallRenderCommandSize = bufSize;
- return gc;
-}
-
-
-/**
- * Create a new context. Exactly one of \c vis and \c fbconfig should be
- * non-NULL.
- *
- * \param use_glx_1_3 For FBConfigs, should GLX 1.3 protocol or
- * SGIX_fbconfig protocol be used?
- * \param renderType For FBConfigs, what is the rendering type?
- */
-
-static GLXContext
-CreateContext(Display *dpy, XVisualInfo *vis,
- const __GLcontextModes * const fbconfig,
- GLXContext shareList,
- Bool allowDirect, GLXContextID contextID,
- Bool use_glx_1_3, int renderType)
-{
- GLXContext gc;
-
- if ( dpy == NULL )
- return NULL;
-
- gc = AllocateGLXContext(dpy);
- if (!gc)
- return NULL;
-
- if (None == contextID) {
- if ( (vis == NULL) && (fbconfig == NULL) )
- return NULL;
-
-#ifdef GLX_DIRECT_RENDERING
- if (allowDirect) {
- int screen = (fbconfig == NULL) ? vis->screen : fbconfig->screen;
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
- const __GLcontextModes * mode;
-
- /* The value of fbconfig cannot change because it is tested
- * later in the function.
- */
- if ( fbconfig == NULL ) {
- /* FIXME: Is it possible for the __GLcontextModes structure
- * FIXME: to not be found?
- */
- mode = _gl_context_modes_find_visual( psc->configs,
- vis->visualid );
- assert( mode != NULL );
- assert( mode->screen == screen );
- }
- else {
- mode = fbconfig;
- }
-
- if (psc && psc->driScreen.private) {
- void * const shared = (shareList != NULL)
- ? shareList->driContext.private : NULL;
- gc->driContext.private =
- (*psc->driScreen.createNewContext)( dpy, mode, renderType,
- shared,
- &gc->driContext );
- if (gc->driContext.private) {
- gc->isDirect = GL_TRUE;
- gc->screen = mode->screen;
- gc->vid = mode->visualID;
- gc->fbconfigID = mode->fbconfigID;
- gc->driContext.mode = mode;
- }
- }
- }
-#endif
-
- LockDisplay(dpy);
- if ( fbconfig == NULL ) {
- xGLXCreateContextReq *req;
-
- /* Send the glXCreateContext request */
- GetReq(GLXCreateContext,req);
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXCreateContext;
- req->context = gc->xid = XAllocID(dpy);
- req->visual = vis->visualid;
- req->screen = vis->screen;
- req->shareList = shareList ? shareList->xid : None;
- req->isDirect = gc->isDirect;
- }
- else if ( use_glx_1_3 ) {
- xGLXCreateNewContextReq *req;
-
- /* Send the glXCreateNewContext request */
- GetReq(GLXCreateNewContext,req);
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXCreateNewContext;
- req->context = gc->xid = XAllocID(dpy);
- req->fbconfig = fbconfig->fbconfigID;
- req->screen = fbconfig->screen;
- req->renderType = renderType;
- req->shareList = shareList ? shareList->xid : None;
- req->isDirect = gc->isDirect;
- }
- else {
- xGLXVendorPrivateWithReplyReq *vpreq;
- xGLXCreateContextWithConfigSGIXReq *req;
-
- /* Send the glXCreateNewContext request */
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXCreateContextWithConfigSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq);
- req = (xGLXCreateContextWithConfigSGIXReq *)vpreq;
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXVendorPrivateWithReply;
- req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX;
- req->context = gc->xid = XAllocID(dpy);
- req->fbconfig = fbconfig->fbconfigID;
- req->screen = fbconfig->screen;
- req->renderType = renderType;
- req->shareList = shareList ? shareList->xid : None;
- req->isDirect = gc->isDirect;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- gc->imported = GL_FALSE;
- }
- else {
- gc->xid = contextID;
- gc->imported = GL_TRUE;
- }
-
- return gc;
-}
-
-PUBLIC GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
- GLXContext shareList, Bool allowDirect)
-{
- return CreateContext(dpy, vis, NULL, shareList, allowDirect, None,
- False, 0);
-}
-
-void __glXFreeContext(__GLXcontext *gc)
-{
- if (gc->vendor) XFree((char *) gc->vendor);
- if (gc->renderer) XFree((char *) gc->renderer);
- if (gc->version) XFree((char *) gc->version);
- if (gc->extensions) XFree((char *) gc->extensions);
- __glFreeAttributeState(gc);
- XFree((char *) gc->buf);
- Xfree((char *) gc->client_state_private);
- XFree((char *) gc);
-
-}
-
-/*
-** Destroy the named context
-*/
-static void
-DestroyContext(Display *dpy, GLXContext gc)
-{
- xGLXDestroyContextReq *req;
- GLXContextID xid;
- CARD8 opcode;
- GLboolean imported;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode || !gc) {
- return;
- }
-
- __glXLock();
- xid = gc->xid;
- imported = gc->imported;
- gc->xid = None;
-
-#ifdef GLX_DIRECT_RENDERING
- /* Destroy the direct rendering context */
- if (gc->isDirect) {
- if (gc->driContext.private) {
- (*gc->driContext.destroyContext)(dpy, gc->screen,
- gc->driContext.private);
- gc->driContext.private = NULL;
- }
- }
-#endif
-
- if (gc->currentDpy) {
- /* Have to free later cuz it's in use now */
- __glXUnlock();
- } else {
- /* Destroy the handle if not current to anybody */
- __glXUnlock();
- __glXFreeContext(gc);
- }
-
- if (!imported) {
- /*
- ** This dpy also created the server side part of the context.
- ** Send the glXDestroyContext request.
- */
- LockDisplay(dpy);
- GetReq(GLXDestroyContext,req);
- req->reqType = opcode;
- req->glxCode = X_GLXDestroyContext;
- req->context = xid;
- UnlockDisplay(dpy);
- SyncHandle();
- }
-}
-
-PUBLIC void glXDestroyContext(Display *dpy, GLXContext gc)
-{
- DestroyContext(dpy, gc);
-}
-
-/*
-** Return the major and minor version #s for the GLX extension
-*/
-PUBLIC Bool glXQueryVersion(Display *dpy, int *major, int *minor)
-{
- __GLXdisplayPrivate *priv;
-
- /* Init the extension. This fetches the major and minor version. */
- priv = __glXInitialize(dpy);
- if (!priv) return GL_FALSE;
-
- if (major) *major = priv->majorVersion;
- if (minor) *minor = priv->minorVersion;
- return GL_TRUE;
-}
-
-/*
-** Query the existance of the GLX extension
-*/
-PUBLIC Bool glXQueryExtension(Display *dpy, int *errorBase, int *eventBase)
-{
- int major_op, erb, evb;
- Bool rv;
-
- rv = XQueryExtension(dpy, GLX_EXTENSION_NAME, &major_op, &evb, &erb);
- if (rv) {
- if (errorBase) *errorBase = erb;
- if (eventBase) *eventBase = evb;
- }
- return rv;
-}
-
-/*
-** Put a barrier in the token stream that forces the GL to finish its
-** work before X can proceed.
-*/
-PUBLIC void glXWaitGL(void)
-{
- xGLXWaitGLReq *req;
- GLXContext gc = __glXGetCurrentContext();
- Display *dpy = gc->currentDpy;
-
- if (!dpy) return;
-
- /* Flush any pending commands out */
- __glXFlushRenderBuffer(gc, gc->pc);
-
-#ifdef GLX_DIRECT_RENDERING
- if (gc->isDirect) {
-/* This bit of ugliness unwraps the glFinish function */
-#ifdef glFinish
-#undef glFinish
-#endif
- glFinish();
- return;
- }
-#endif
-
- /* Send the glXWaitGL request */
- LockDisplay(dpy);
- GetReq(GLXWaitGL,req);
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXWaitGL;
- req->contextTag = gc->currentContextTag;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-/*
-** Put a barrier in the token stream that forces X to finish its
-** work before GL can proceed.
-*/
-PUBLIC void glXWaitX(void)
-{
- xGLXWaitXReq *req;
- GLXContext gc = __glXGetCurrentContext();
- Display *dpy = gc->currentDpy;
-
- if (!dpy) return;
-
- /* Flush any pending commands out */
- __glXFlushRenderBuffer(gc, gc->pc);
-
-#ifdef GLX_DIRECT_RENDERING
- if (gc->isDirect) {
- XSync(dpy, False);
- return;
- }
-#endif
-
- /*
- ** Send the glXWaitX request.
- */
- LockDisplay(dpy);
- GetReq(GLXWaitX,req);
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXWaitX;
- req->contextTag = gc->currentContextTag;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-PUBLIC void glXUseXFont(Font font, int first, int count, int listBase)
-{
- xGLXUseXFontReq *req;
- GLXContext gc = __glXGetCurrentContext();
- Display *dpy = gc->currentDpy;
-
- if (!dpy) return;
-
- /* Flush any pending commands out */
- (void) __glXFlushRenderBuffer(gc, gc->pc);
-
-#ifdef GLX_DIRECT_RENDERING
- if (gc->isDirect) {
- DRI_glXUseXFont(font, first, count, listBase);
- return;
- }
-#endif
-
- /* Send the glXUseFont request */
- LockDisplay(dpy);
- GetReq(GLXUseXFont,req);
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXUseXFont;
- req->contextTag = gc->currentContextTag;
- req->font = font;
- req->first = first;
- req->count = count;
- req->listBase = listBase;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-/************************************************************************/
-
-/*
-** Copy the source context to the destination context using the
-** attribute "mask".
-*/
-PUBLIC void glXCopyContext(Display *dpy, GLXContext source,
- GLXContext dest, unsigned long mask)
-{
- xGLXCopyContextReq *req;
- GLXContext gc = __glXGetCurrentContext();
- GLXContextTag tag;
- CARD8 opcode;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return;
- }
-
-#ifdef GLX_DIRECT_RENDERING
- if (gc->isDirect) {
- /* NOT_DONE: This does not work yet */
- }
-#endif
-
- /*
- ** If the source is the current context, send its tag so that the context
- ** can be flushed before the copy.
- */
- if (source == gc && dpy == gc->currentDpy) {
- tag = gc->currentContextTag;
- } else {
- tag = 0;
- }
-
- /* Send the glXCopyContext request */
- LockDisplay(dpy);
- GetReq(GLXCopyContext,req);
- req->reqType = opcode;
- req->glxCode = X_GLXCopyContext;
- req->source = source ? source->xid : None;
- req->dest = dest ? dest->xid : None;
- req->mask = mask;
- req->contextTag = tag;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-/**
- * Determine if a context uses direct rendering.
- *
- * \param dpy Display where the context was created.
- * \param contextID ID of the context to be tested.
- *
- * \returns \c GL_TRUE if the context is direct rendering or not.
- */
-static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
-{
- xGLXIsDirectReq *req;
- xGLXIsDirectReply reply;
- CARD8 opcode;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return GL_FALSE;
- }
-
- /* Send the glXIsDirect request */
- LockDisplay(dpy);
- GetReq(GLXIsDirect,req);
- req->reqType = opcode;
- req->glxCode = X_GLXIsDirect;
- req->context = contextID;
- _XReply(dpy, (xReply*) &reply, 0, False);
- UnlockDisplay(dpy);
- SyncHandle();
-
- return reply.isDirect;
-}
-
-/**
- * \todo
- * Shouldn't this function \b always return \c GL_FALSE when
- * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with
- * the GLX protocol here at all?
- */
-PUBLIC Bool glXIsDirect(Display *dpy, GLXContext gc)
-{
- if (!gc) {
- return GL_FALSE;
-#ifdef GLX_DIRECT_RENDERING
- } else if (gc->isDirect) {
- return GL_TRUE;
-#endif
- }
- return __glXIsDirect(dpy, gc->xid);
-}
-
-PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
- Pixmap pixmap)
-{
- xGLXCreateGLXPixmapReq *req;
- GLXPixmap xid;
- CARD8 opcode;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return None;
- }
-
- /* Send the glXCreateGLXPixmap request */
- LockDisplay(dpy);
- GetReq(GLXCreateGLXPixmap,req);
- req->reqType = opcode;
- req->glxCode = X_GLXCreateGLXPixmap;
- req->screen = vis->screen;
- req->visual = vis->visualid;
- req->pixmap = pixmap;
- req->glxpixmap = xid = XAllocID(dpy);
- UnlockDisplay(dpy);
- SyncHandle();
- return xid;
-}
-
-/*
-** Destroy the named pixmap
-*/
-PUBLIC void glXDestroyGLXPixmap(Display *dpy, GLXPixmap glxpixmap)
-{
- xGLXDestroyGLXPixmapReq *req;
- CARD8 opcode;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return;
- }
-
- /* Send the glXDestroyGLXPixmap request */
- LockDisplay(dpy);
- GetReq(GLXDestroyGLXPixmap,req);
- req->reqType = opcode;
- req->glxCode = X_GLXDestroyGLXPixmap;
- req->glxpixmap = glxpixmap;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
-{
- xGLXSwapBuffersReq *req;
- GLXContext gc;
- GLXContextTag tag;
- CARD8 opcode;
-#ifdef GLX_DIRECT_RENDERING
- __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, NULL );
-
- if ( pdraw != NULL ) {
- (*pdraw->swapBuffers)(dpy, pdraw->private);
- return;
- }
-#endif
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return;
- }
-
- /*
- ** The calling thread may or may not have a current context. If it
- ** does, send the context tag so the server can do a flush.
- */
- gc = __glXGetCurrentContext();
- if ((gc != NULL) && (dpy == gc->currentDpy) &&
- ((drawable == gc->currentDrawable) || (drawable == gc->currentReadable)) ) {
- tag = gc->currentContextTag;
- } else {
- tag = 0;
- }
-
- /* Send the glXSwapBuffers request */
- LockDisplay(dpy);
- GetReq(GLXSwapBuffers,req);
- req->reqType = opcode;
- req->glxCode = X_GLXSwapBuffers;
- req->drawable = drawable;
- req->contextTag = tag;
- UnlockDisplay(dpy);
- SyncHandle();
- XFlush(dpy);
-}
-
-
-/*
-** Return configuration information for the given display, screen and
-** visual combination.
-*/
-PUBLIC int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute,
- int *value_return)
-{
- __GLXdisplayPrivate *priv;
- __GLXscreenConfigs *psc;
- int status;
-
- status = GetGLXPrivScreenConfig( dpy, vis->screen, & priv, & psc );
- if ( status == Success ) {
- const __GLcontextModes * const modes = _gl_context_modes_find_visual(
- psc->configs, vis->visualid );
-
- /* Lookup attribute after first finding a match on the visual */
- if ( modes != NULL ) {
- return _gl_get_context_mode_data( modes, attribute, value_return );
- }
-
- status = GLX_BAD_VISUAL;
- }
-
- /*
- ** If we can't find the config for this visual, this visual is not
- ** supported by the OpenGL implementation on the server.
- */
- if ( (status == GLX_BAD_VISUAL) && (attribute == GLX_USE_GL) ) {
- *value_return = GL_FALSE;
- status = Success;
- }
-
- return status;
-}
-
-/************************************************************************/
-
-static void
-init_fbconfig_for_chooser( __GLcontextModes * config,
- GLboolean fbconfig_style_tags )
-{
- memset( config, 0, sizeof( __GLcontextModes ) );
- config->visualID = (XID) GLX_DONT_CARE;
- config->visualType = GLX_DONT_CARE;
-
- /* glXChooseFBConfig specifies different defaults for these two than
- * glXChooseVisual.
- */
- if ( fbconfig_style_tags ) {
- config->rgbMode = GL_TRUE;
- config->doubleBufferMode = GLX_DONT_CARE;
- }
-
- config->visualRating = GLX_DONT_CARE;
- config->transparentPixel = GLX_NONE;
- config->transparentRed = GLX_DONT_CARE;
- config->transparentGreen = GLX_DONT_CARE;
- config->transparentBlue = GLX_DONT_CARE;
- config->transparentAlpha = GLX_DONT_CARE;
- config->transparentIndex = GLX_DONT_CARE;
-
- config->drawableType = GLX_WINDOW_BIT;
- config->renderType = (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
- config->xRenderable = GLX_DONT_CARE;
- config->fbconfigID = (GLXFBConfigID)(GLX_DONT_CARE);
-
- config->swapMethod = GLX_DONT_CARE;
-}
-
-#define MATCH_DONT_CARE( param ) \
- do { \
- if ( (a-> param != GLX_DONT_CARE) \
- && (a-> param != b-> param) ) { \
- return False; \
- } \
- } while ( 0 )
-
-#define MATCH_MINIMUM( param ) \
- do { \
- if ( (a-> param != GLX_DONT_CARE) \
- && (a-> param > b-> param) ) { \
- return False; \
- } \
- } while ( 0 )
-
-#define MATCH_EXACT( param ) \
- do { \
- if ( a-> param != b-> param) { \
- return False; \
- } \
- } while ( 0 )
-
-/**
- * Determine if two GLXFBConfigs are compatible.
- *
- * \param a Application specified config to test.
- * \param b Server specified config to test against \c a.
- */
-static Bool
-fbconfigs_compatible( const __GLcontextModes * const a,
- const __GLcontextModes * const b )
-{
- MATCH_DONT_CARE( doubleBufferMode );
- MATCH_DONT_CARE( visualType );
- MATCH_DONT_CARE( visualRating );
- MATCH_DONT_CARE( xRenderable );
- MATCH_DONT_CARE( fbconfigID );
- MATCH_DONT_CARE( swapMethod );
-
- MATCH_MINIMUM( rgbBits );
- MATCH_MINIMUM( numAuxBuffers );
- MATCH_MINIMUM( redBits );
- MATCH_MINIMUM( greenBits );
- MATCH_MINIMUM( blueBits );
- MATCH_MINIMUM( alphaBits );
- MATCH_MINIMUM( depthBits );
- MATCH_MINIMUM( stencilBits );
- MATCH_MINIMUM( accumRedBits );
- MATCH_MINIMUM( accumGreenBits );
- MATCH_MINIMUM( accumBlueBits );
- MATCH_MINIMUM( accumAlphaBits );
- MATCH_MINIMUM( sampleBuffers );
- MATCH_MINIMUM( maxPbufferWidth );
- MATCH_MINIMUM( maxPbufferHeight );
- MATCH_MINIMUM( maxPbufferPixels );
- MATCH_MINIMUM( samples );
-
- MATCH_DONT_CARE( stereoMode );
- MATCH_EXACT( level );
-
- if ( ((a->drawableType & b->drawableType) == 0)
- || ((a->renderType & b->renderType) == 0) ) {
- return False;
- }
-
-
- /* There is a bug in a few of the XFree86 DDX drivers. They contain
- * visuals with a "transparent type" of 0 when they really mean GLX_NONE.
- * Technically speaking, it is a bug in the DDX driver, but there is
- * enough of an installed base to work around the problem here. In any
- * case, 0 is not a valid value of the transparent type, so we'll treat 0
- * from the app as GLX_DONT_CARE. We'll consider GLX_NONE from the app and
- * 0 from the server to be a match to maintain backward compatibility with
- * the (broken) drivers.
- */
-
- if ( a->transparentPixel != GLX_DONT_CARE
- && a->transparentPixel != 0 ) {
- if ( a->transparentPixel == GLX_NONE ) {
- if ( b->transparentPixel != GLX_NONE && b->transparentPixel != 0 )
- return False;
- } else {
- MATCH_EXACT( transparentPixel );
- }
-
- switch ( a->transparentPixel ) {
- case GLX_TRANSPARENT_RGB:
- MATCH_DONT_CARE( transparentRed );
- MATCH_DONT_CARE( transparentGreen );
- MATCH_DONT_CARE( transparentBlue );
- MATCH_DONT_CARE( transparentAlpha );
- break;
-
- case GLX_TRANSPARENT_INDEX:
- MATCH_DONT_CARE( transparentIndex );
- break;
-
- default:
- break;
- }
- }
-
- return True;
-}
-
-
-/* There's some trickly language in the GLX spec about how this is supposed
- * to work. Basically, if a given component size is either not specified
- * or the requested size is zero, it is supposed to act like PERFER_SMALLER.
- * Well, that's really hard to do with the code as-is. This behavior is
- * closer to correct, but still not technically right.
- */
-#define PREFER_LARGER_OR_ZERO(comp) \
- do { \
- if ( ((*a)-> comp) != ((*b)-> comp) ) { \
- if ( ((*a)-> comp) == 0 ) { \
- return -1; \
- } \
- else if ( ((*b)-> comp) == 0 ) { \
- return 1; \
- } \
- else { \
- return ((*b)-> comp) - ((*a)-> comp) ; \
- } \
- } \
- } while( 0 )
-
-#define PREFER_LARGER(comp) \
- do { \
- if ( ((*a)-> comp) != ((*b)-> comp) ) { \
- return ((*b)-> comp) - ((*a)-> comp) ; \
- } \
- } while( 0 )
-
-#define PREFER_SMALLER(comp) \
- do { \
- if ( ((*a)-> comp) != ((*b)-> comp) ) { \
- return ((*a)-> comp) - ((*b)-> comp) ; \
- } \
- } while( 0 )
-
-/**
- * Compare two GLXFBConfigs. This function is intended to be used as the
- * compare function passed in to qsort.
- *
- * \returns If \c a is a "better" config, according to the specification of
- * SGIX_fbconfig, a number less than zero is returned. If \c b is
- * better, then a number greater than zero is return. If both are
- * equal, zero is returned.
- * \sa qsort, glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX
- */
-static int
-fbconfig_compare( const __GLcontextModes * const * const a,
- const __GLcontextModes * const * const b )
-{
- /* The order of these comparisons must NOT change. It is defined by
- * the GLX 1.3 spec and ARB_multisample.
- */
-
- PREFER_SMALLER( visualSelectGroup );
-
- /* The sort order for the visualRating is GLX_NONE, GLX_SLOW, and
- * GLX_NON_CONFORMANT_CONFIG. It just so happens that this is the
- * numerical sort order of the enums (0x8000, 0x8001, and 0x800D).
- */
- PREFER_SMALLER( visualRating );
-
- /* This isn't quite right. It is supposed to compare the sum of the
- * components the user specifically set minimums for.
- */
- PREFER_LARGER_OR_ZERO( redBits );
- PREFER_LARGER_OR_ZERO( greenBits );
- PREFER_LARGER_OR_ZERO( blueBits );
- PREFER_LARGER_OR_ZERO( alphaBits );
-
- PREFER_SMALLER( rgbBits );
-
- if ( ((*a)->doubleBufferMode != (*b)->doubleBufferMode) ) {
- /* Prefer single-buffer.
- */
- return ( !(*a)->doubleBufferMode ) ? -1 : 1;
- }
-
- PREFER_SMALLER( numAuxBuffers );
-
- PREFER_LARGER_OR_ZERO( depthBits );
- PREFER_SMALLER( stencilBits );
-
- /* This isn't quite right. It is supposed to compare the sum of the
- * components the user specifically set minimums for.
- */
- PREFER_LARGER_OR_ZERO( accumRedBits );
- PREFER_LARGER_OR_ZERO( accumGreenBits );
- PREFER_LARGER_OR_ZERO( accumBlueBits );
- PREFER_LARGER_OR_ZERO( accumAlphaBits );
-
- PREFER_SMALLER( visualType );
-
- /* None of the multisample specs say where this comparison should happen,
- * so I put it near the end.
- */
- PREFER_SMALLER( sampleBuffers );
- PREFER_SMALLER( samples );
-
- /* None of the pbuffer or fbconfig specs say that this comparison needs
- * to happen at all, but it seems like it should.
- */
- PREFER_LARGER( maxPbufferWidth );
- PREFER_LARGER( maxPbufferHeight );
- PREFER_LARGER( maxPbufferPixels );
-
- return 0;
-}
-
-
-/**
- * Selects and sorts a subset of the supplied configs based on the attributes.
- * This function forms to basis of \c glXChooseVisual, \c glXChooseFBConfig,
- * and \c glXChooseFBConfigSGIX.
- *
- * \param configs Array of pointers to possible configs. The elements of
- * this array that do not meet the criteria will be set to
- * NULL. The remaining elements will be sorted according to
- * the various visual / FBConfig selection rules.
- * \param num_configs Number of elements in the \c configs array.
- * \param attribList Attributes used select from \c configs. This array is
- * terminated by a \c None tag. The array can either take
- * the form expected by \c glXChooseVisual (where boolean
- * tags do not have a value) or by \c glXChooseFBConfig
- * (where every tag has a value).
- * \param fbconfig_style_tags Selects whether \c attribList is in
- * \c glXChooseVisual style or
- * \c glXChooseFBConfig style.
- * \returns The number of valid elements left in \c configs.
- *
- * \sa glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX
- */
-static int
-choose_visual( __GLcontextModes ** configs, int num_configs,
- const int *attribList, GLboolean fbconfig_style_tags )
-{
- __GLcontextModes test_config;
- int base;
- int i;
-
- /* This is a fairly direct implementation of the selection method
- * described by GLX_SGIX_fbconfig. Start by culling out all the
- * configs that are not compatible with the selected parameter
- * list.
- */
-
- init_fbconfig_for_chooser( & test_config, fbconfig_style_tags );
- __glXInitializeVisualConfigFromTags( & test_config, 512,
- (const INT32 *) attribList,
- GL_TRUE, fbconfig_style_tags );
-
- base = 0;
- for ( i = 0 ; i < num_configs ; i++ ) {
- if ( fbconfigs_compatible( & test_config, configs[i] ) ) {
- configs[ base ] = configs[ i ];
- base++;
- }
- }
-
- if ( base == 0 ) {
- return 0;
- }
-
- if ( base < num_configs ) {
- (void) memset( & configs[ base ], 0,
- sizeof( void * ) * (num_configs - base) );
- }
-
- /* After the incompatible configs are removed, the resulting
- * list is sorted according to the rules set out in the various
- * specifications.
- */
-
- qsort( configs, base, sizeof( __GLcontextModes * ),
- (int (*)(const void*, const void*)) fbconfig_compare );
- return base;
-}
-
-
-
-
-/*
-** Return the visual that best matches the template. Return None if no
-** visual matches the template.
-*/
-PUBLIC XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *attribList)
-{
- XVisualInfo *visualList = NULL;
- __GLXdisplayPrivate *priv;
- __GLXscreenConfigs *psc;
- __GLcontextModes test_config;
- __GLcontextModes *modes;
- const __GLcontextModes *best_config = NULL;
-
- /*
- ** Get a list of all visuals, return if list is empty
- */
- if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) {
- return None;
- }
-
-
- /*
- ** Build a template from the defaults and the attribute list
- ** Free visual list and return if an unexpected token is encountered
- */
- init_fbconfig_for_chooser( & test_config, GL_FALSE );
- __glXInitializeVisualConfigFromTags( & test_config, 512,
- (const INT32 *) attribList,
- GL_TRUE, GL_FALSE );
-
- /*
- ** Eliminate visuals that don't meet minimum requirements
- ** Compute a score for those that do
- ** Remember which visual, if any, got the highest score
- */
- for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) {
- if ( fbconfigs_compatible( & test_config, modes )
- && ((best_config == NULL)
- || (fbconfig_compare( (const __GLcontextModes * const * const)&modes, &best_config ) < 0)) ) {
- best_config = modes;
- }
- }
-
- /*
- ** If no visual is acceptable, return None
- ** Otherwise, create an XVisualInfo list with just the selected X visual
- ** and return this.
- */
- if (best_config != NULL) {
- XVisualInfo visualTemplate;
- int i;
-
- visualTemplate.screen = screen;
- visualTemplate.visualid = best_config->visualID;
- visualList = XGetVisualInfo( dpy, VisualScreenMask|VisualIDMask,
- &visualTemplate, &i );
- }
-
- return visualList;
-}
-
-
-PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen )
-{
- __GLXscreenConfigs *psc;
- __GLXdisplayPrivate *priv;
-
- if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) {
- return NULL;
- }
-
- if (!psc->effectiveGLXexts) {
- if (!psc->serverGLXexts) {
- psc->serverGLXexts = __glXGetStringFromServer(dpy, priv->majorOpcode,
- X_GLXQueryServerString,
- screen, GLX_EXTENSIONS);
- }
-
- __glXCalculateUsableExtensions(psc,
-#ifdef GLX_DIRECT_RENDERING
- (psc->driScreen.private != NULL),
-#else
- GL_FALSE,
-#endif
- priv->minorVersion);
- }
-
- return psc->effectiveGLXexts;
-}
-
-PUBLIC const char *glXGetClientString( Display *dpy, int name )
-{
- switch(name) {
- case GLX_VENDOR:
- return (__glXGLXClientVendorName);
- case GLX_VERSION:
- return (__glXGLXClientVersion);
- case GLX_EXTENSIONS:
- return (__glXGetClientExtensions());
- default:
- return NULL;
- }
-}
-
-PUBLIC const char *glXQueryServerString( Display *dpy, int screen, int name )
-{
- __GLXscreenConfigs *psc;
- __GLXdisplayPrivate *priv;
- const char ** str;
-
-
- if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) {
- return NULL;
- }
-
- switch(name) {
- case GLX_VENDOR:
- str = & priv->serverGLXvendor;
- break;
- case GLX_VERSION:
- str = & priv->serverGLXversion;
- break;
- case GLX_EXTENSIONS:
- str = & psc->serverGLXexts;
- break;
- default:
- return NULL;
- }
-
- if ( *str == NULL ) {
- *str = __glXGetStringFromServer(dpy, priv->majorOpcode,
- X_GLXQueryServerString, screen, name);
- }
-
- return *str;
-}
-
-void __glXClientInfo ( Display *dpy, int opcode )
-{
- xGLXClientInfoReq *req;
- int size;
- char * ext_str = __glXGetClientGLExtensionString();
-
- /* Send the glXClientInfo request */
- LockDisplay(dpy);
- GetReq(GLXClientInfo,req);
- req->reqType = opcode;
- req->glxCode = X_GLXClientInfo;
- req->major = GLX_MAJOR_VERSION;
- req->minor = GLX_MINOR_VERSION;
-
- size = strlen( ext_str ) + 1;
- req->length += (size + 3) >> 2;
- req->numbytes = size;
- Data(dpy, ext_str, size);
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- Xfree( ext_str );
-}
-
-
-/*
-** EXT_import_context
-*/
-
-PUBLIC Display *glXGetCurrentDisplay(void)
-{
- GLXContext gc = __glXGetCurrentContext();
- if (NULL == gc) return NULL;
- return gc->currentDpy;
-}
-
-PUBLIC GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (),
- glXGetCurrentDisplay)
-
-/**
- * Used internally by libGL to send \c xGLXQueryContextinfoExtReq requests
- * to the X-server.
- *
- * \param dpy Display where \c ctx was created.
- * \param ctx Context to query.
- * \returns \c Success on success. \c GLX_BAD_CONTEXT if \c ctx is invalid,
- * or zero if the request failed due to internal problems (i.e.,
- * unable to allocate temporary memory, etc.)
- *
- * \note
- * This function dynamically determines whether to use the EXT_import_context
- * version of the protocol or the GLX 1.3 version of the protocol.
- */
-static int __glXQueryContextInfo(Display *dpy, GLXContext ctx)
-{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
- xGLXQueryContextReply reply;
- CARD8 opcode;
- GLuint numValues;
- int retval;
-
- if (ctx == NULL) {
- return GLX_BAD_CONTEXT;
- }
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return 0;
- }
-
- /* Send the glXQueryContextInfoEXT request */
- LockDisplay(dpy);
-
- if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
- xGLXQueryContextReq *req;
-
- GetReq(GLXQueryContext, req);
-
- req->reqType = opcode;
- req->glxCode = X_GLXQueryContext;
- req->context = (unsigned int)(ctx->xid);
- }
- else {
- xGLXVendorPrivateReq *vpreq;
- xGLXQueryContextInfoEXTReq *req;
-
- GetReqExtra( GLXVendorPrivate,
- sz_xGLXQueryContextInfoEXTReq - sz_xGLXVendorPrivateReq,
- vpreq );
- req = (xGLXQueryContextInfoEXTReq *)vpreq;
- req->reqType = opcode;
- req->glxCode = X_GLXVendorPrivateWithReply;
- req->vendorCode = X_GLXvop_QueryContextInfoEXT;
- req->context = (unsigned int)(ctx->xid);
- }
-
- _XReply(dpy, (xReply*) &reply, 0, False);
-
- numValues = reply.n;
- if (numValues == 0)
- retval = Success;
- else if (numValues > __GLX_MAX_CONTEXT_PROPS)
- retval = 0;
- else
- {
- int *propList, *pProp;
- int nPropListBytes;
- int i;
-
- nPropListBytes = numValues << 3;
- propList = (int *) Xmalloc(nPropListBytes);
- if (NULL == propList) {
- retval = 0;
- } else {
- _XRead(dpy, (char *)propList, nPropListBytes);
- pProp = propList;
- for (i=0; i < numValues; i++) {
- switch (*pProp++) {
- case GLX_SHARE_CONTEXT_EXT:
- ctx->share_xid = *pProp++;
- break;
- case GLX_VISUAL_ID_EXT:
- ctx->vid = *pProp++;
- break;
- case GLX_SCREEN:
- ctx->screen = *pProp++;
- break;
- case GLX_FBCONFIG_ID:
- ctx->fbconfigID = *pProp++;
- break;
- case GLX_RENDER_TYPE:
- ctx->renderType = *pProp++;
- break;
- default:
- pProp++;
- continue;
- }
- }
- Xfree((char *)propList);
- retval = Success;
- }
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return retval;
-}
-
-PUBLIC int
-glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
-{
- int retVal;
-
- /* get the information from the server if we don't have it already */
- if (!ctx->isDirect && (ctx->vid == None)) {
- retVal = __glXQueryContextInfo(dpy, ctx);
- if (Success != retVal) return retVal;
- }
- switch (attribute) {
- case GLX_SHARE_CONTEXT_EXT:
- *value = (int)(ctx->share_xid);
- break;
- case GLX_VISUAL_ID_EXT:
- *value = (int)(ctx->vid);
- break;
- case GLX_SCREEN:
- *value = (int)(ctx->screen);
- break;
- case GLX_FBCONFIG_ID:
- *value = (int)(ctx->fbconfigID);
- break;
- case GLX_RENDER_TYPE:
- *value = (int)(ctx->renderType);
- break;
- default:
- return GLX_BAD_ATTRIBUTE;
- }
- return Success;
-}
-
-PUBLIC GLX_ALIAS( int, glXQueryContextInfoEXT,
- (Display *dpy, GLXContext ctx, int attribute, int *value),
- (dpy, ctx, attribute, value),
- glXQueryContext )
-
-PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
-{
- return ctx->xid;
-}
-
-PUBLIC GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID)
-{
- GLXContext ctx;
-
- if (contextID == None) {
- return NULL;
- }
- if (__glXIsDirect(dpy, contextID)) {
- return NULL;
- }
-
- ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, False, 0);
- if (NULL != ctx) {
- if (Success != __glXQueryContextInfo(dpy, ctx)) {
- return NULL;
- }
- }
- return ctx;
-}
-
-PUBLIC void glXFreeContextEXT(Display *dpy, GLXContext ctx)
-{
- DestroyContext(dpy, ctx);
-}
-
-
-
-/*
- * GLX 1.3 functions - these are just stubs for now!
- */
-
-PUBLIC GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
- const int *attribList, int *nitems)
-{
- __GLcontextModes ** config_list;
- int list_size;
-
-
- config_list = (__GLcontextModes **)
- glXGetFBConfigs( dpy, screen, & list_size );
-
- if ( (config_list != NULL) && (list_size > 0) && (attribList != NULL) ) {
- list_size = choose_visual( config_list, list_size, attribList,
- GL_TRUE );
- if ( list_size == 0 ) {
- XFree( config_list );
- config_list = NULL;
- }
- }
-
- *nitems = list_size;
- return (GLXFBConfig *) config_list;
-}
-
-
-PUBLIC GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
- int renderType, GLXContext shareList,
- Bool allowDirect)
-{
- return CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList,
- allowDirect, None, True, renderType );
-}
-
-
-PUBLIC GLXDrawable glXGetCurrentReadDrawable(void)
-{
- GLXContext gc = __glXGetCurrentContext();
- return gc->currentReadable;
-}
-
-
-PUBLIC GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements)
-{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
- __GLcontextModes ** config = NULL;
- int i;
-
- if ( (priv->screenConfigs != NULL)
- && (screen >= 0) && (screen <= ScreenCount(dpy))
- && (priv->screenConfigs[screen].configs != NULL)
- && (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE) ) {
- unsigned num_configs = 0;
- __GLcontextModes * modes;
-
-
- for ( modes = priv->screenConfigs[screen].configs
- ; modes != NULL
- ; modes = modes->next ) {
- if ( modes->fbconfigID != GLX_DONT_CARE ) {
- num_configs++;
- }
- }
-
- config = (__GLcontextModes **) Xmalloc( sizeof(__GLcontextModes *)
- * num_configs );
- if ( config != NULL ) {
- *nelements = num_configs;
- i = 0;
- for ( modes = priv->screenConfigs[screen].configs
- ; modes != NULL
- ; modes = modes->next ) {
- config[i] = modes;
- i++;
- }
- }
- }
- return (GLXFBConfig *) config;
-}
-
-
-PUBLIC int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
- int attribute, int *value)
-{
- __GLcontextModes * const modes = ValidateGLXFBConfig( dpy, config );
-
- return (modes != NULL)
- ? _gl_get_context_mode_data( modes, attribute, value )
- : GLXBadFBConfig;
-}
-
-
-PUBLIC XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config)
-{
- XVisualInfo visualTemplate;
- __GLcontextModes * fbconfig = (__GLcontextModes *) config;
- int count;
-
- /*
- ** Get a list of all visuals, return if list is empty
- */
- visualTemplate.visualid = fbconfig->visualID;
- return XGetVisualInfo(dpy,VisualIDMask,&visualTemplate,&count);
-}
-
-
-/*
-** GLX_SGI_make_current_read
-*/
-
-PUBLIC GLX_ALIAS(GLXDrawable, glXGetCurrentReadDrawableSGI, (void), (),
- glXGetCurrentReadDrawable)
-
-
-/*
-** GLX_SGI_swap_control
-*/
-PUBLIC int glXSwapIntervalSGI(int interval)
-{
- xGLXVendorPrivateReq *req;
- GLXContext gc = __glXGetCurrentContext();
- Display * dpy;
- CARD32 * interval_ptr;
- CARD8 opcode;
-
- if ( gc == NULL ) {
- return GLX_BAD_CONTEXT;
- }
-
- if ( interval <= 0 ) {
- return GLX_BAD_VALUE;
- }
-
-#ifdef GLX_DIRECT_RENDERING
- if ( gc->isDirect ) {
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
- gc->screen );
- __DRIdrawable * const pdraw = GetDRIDrawable( gc->currentDpy,
- gc->currentDrawable,
- NULL );
- if ( __glXExtensionBitIsEnabled( psc, SGI_swap_control_bit )
- && (pdraw != NULL) ) {
- pdraw->swap_interval = interval;
- return 0;
- }
- else {
- return GLX_BAD_CONTEXT;
- }
- }
-#endif
- dpy = gc->currentDpy;
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return 0;
- }
-
- /* Send the glXSwapIntervalSGI request */
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivate,sizeof(CARD32),req);
- req->reqType = opcode;
- req->glxCode = X_GLXVendorPrivate;
- req->vendorCode = X_GLXvop_SwapIntervalSGI;
- req->contextTag = gc->currentContextTag;
-
- interval_ptr = (CARD32 *) req + 1;
- *interval_ptr = interval;
-
- UnlockDisplay(dpy);
- SyncHandle();
- XFlush(dpy);
-
- return 0;
-}
-
-
-/*
-** GLX_MESA_swap_control
-*/
-PUBLIC GLint glXSwapIntervalMESA(unsigned interval)
-{
-#ifdef GLX_DIRECT_RENDERING
- GLXContext gc = __glXGetCurrentContext();
-
- if ( interval < 0 ) {
- return GLX_BAD_VALUE;
- }
-
- if ( (gc != NULL) && gc->isDirect ) {
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
- gc->screen );
-
- if ( (psc != NULL) && (psc->driScreen.private != NULL)
- && __glXExtensionBitIsEnabled( psc, MESA_swap_control_bit ) ) {
- __DRIdrawable * const pdraw =
- (*psc->driScreen.getDrawable)(gc->currentDpy,
- gc->currentDrawable,
- psc->driScreen.private);
- if ( pdraw != NULL ) {
- pdraw->swap_interval = interval;
- return 0;
- }
- }
- }
-#else
- (void) interval;
-#endif
-
- return GLX_BAD_CONTEXT;
-}
-
-PUBLIC GLint glXGetSwapIntervalMESA( void )
-{
-#ifdef GLX_DIRECT_RENDERING
- GLXContext gc = __glXGetCurrentContext();
-
- if ( (gc != NULL) && gc->isDirect ) {
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
- gc->screen );
-
- if ( (psc != NULL) && (psc->driScreen.private != NULL)
- && __glXExtensionBitIsEnabled( psc, MESA_swap_control_bit ) ) {
- __DRIdrawable * const pdraw =
- (*psc->driScreen.getDrawable)(gc->currentDpy,
- gc->currentDrawable,
- psc->driScreen.private);
- if ( pdraw != NULL ) {
- return pdraw->swap_interval;
- }
- }
- }
-#endif
-
- return 0;
-}
-
-
-/*
-** GLX_MESA_swap_frame_usage
-*/
-
-PUBLIC GLint glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen);
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
-
- if ( (pdraw != NULL) && (pdraw->frameTracking != NULL)
- && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- status = pdraw->frameTracking( dpy, pdraw->private, GL_TRUE );
- }
-#else
- (void) dpy;
- (void) drawable;
-#endif
- return status;
-}
-
-
-PUBLIC GLint glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen);
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
-
- if ( (pdraw != NULL) && (pdraw->frameTracking != NULL)
- && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- status = pdraw->frameTracking( dpy, pdraw->private, GL_FALSE );
- }
-#else
- (void) dpy;
- (void) drawable;
-#endif
- return status;
-}
-
-
-PUBLIC GLint glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable,
- GLfloat *usage)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen);
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
-
- if ( (pdraw != NULL ) && (pdraw->queryFrameTracking != NULL)
- && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- int64_t sbc, missedFrames;
- float lastMissedUsage;
-
- status = pdraw->queryFrameTracking( dpy, pdraw->private, &sbc,
- &missedFrames, &lastMissedUsage,
- usage );
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) usage;
-#endif
- return status;
-}
-
-
-PUBLIC GLint glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable,
- int64_t *sbc, int64_t *missedFrames,
- GLfloat *lastMissedUsage)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen);
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
-
- if ( (pdraw != NULL ) && (pdraw->queryFrameTracking != NULL)
- && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- float usage;
-
- status = pdraw->queryFrameTracking( dpy, pdraw->private, sbc,
- missedFrames, lastMissedUsage,
- & usage );
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) sbc;
- (void) missedFrames;
- (void) lastMissedUsage;
-#endif
- return status;
-}
-
-
-/*
-** GLX_SGI_video_sync
-*/
-PUBLIC int glXGetVideoSyncSGI(unsigned int *count)
-{
- /* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
- * FIXME: there should be a GLX encoding for this call. I can find no
- * FIXME: documentation for the GLX encoding.
- */
-#ifdef GLX_DIRECT_RENDERING
- GLXContext gc = __glXGetCurrentContext();
-
-
- if ( (gc != NULL) && gc->isDirect ) {
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
- gc->screen );
- if ( __glXExtensionBitIsEnabled( psc, SGI_video_sync_bit )
- && psc->driScreen.private && psc->driScreen.getMSC) {
- int ret;
- int64_t temp;
-
- ret = psc->driScreen.getMSC( psc->driScreen.private, & temp );
- *count = (unsigned) temp;
- return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
- }
- }
-#else
- (void) count;
-#endif
- return GLX_BAD_CONTEXT;
-}
-
-PUBLIC int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
-{
-#ifdef GLX_DIRECT_RENDERING
- GLXContext gc = __glXGetCurrentContext();
-
- if ( divisor <= 0 || remainder < 0 )
- return GLX_BAD_VALUE;
-
- if ( (gc != NULL) && gc->isDirect ) {
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
- gc->screen );
- if ( __glXExtensionBitIsEnabled( psc, SGI_video_sync_bit )
- && psc->driScreen.private ) {
- __DRIdrawable * const pdraw =
- (*psc->driScreen.getDrawable)(gc->currentDpy,
- gc->currentDrawable,
- psc->driScreen.private);
- if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL) ) {
- int ret;
- int64_t msc;
- int64_t sbc;
-
- ret = (*pdraw->waitForMSC)( gc->currentDpy, pdraw->private,
- 0, divisor, remainder,
- & msc, & sbc );
- *count = (unsigned) msc;
- return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
- }
- }
- }
-#else
- (void) count;
-#endif
- return GLX_BAD_CONTEXT;
-}
-
-
-/*
-** GLX_SGIS_video_source
-*/
-#if defined(_VL_H)
-
-PUBLIC GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX(Display *dpy,
- int screen, VLServer server, VLPath path,
- int nodeClass, VLNode drainNode)
-{
- (void) dpy;
- (void) screen;
- (void) server;
- (void) path;
- (void) nodeClass;
- (void) drainNode;
- return 0;
-}
-
-PUBLIC void glXDestroyGLXVideoSourceSGIX(Display *dpy, GLXVideoSourceSGIX src)
-{
- (void) dpy;
- (void) src;
-}
-
-#endif
-
-
-/*
-** GLX_SGIX_fbconfig
-** Many of these functions are aliased to GLX 1.3 entry points in the
-** GLX_functions table.
-*/
-
-PUBLIC GLX_ALIAS(int, glXGetFBConfigAttribSGIX,
- (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value),
- (dpy, config, attribute, value),
- glXGetFBConfigAttrib)
-
-PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
- (Display *dpy, int screen, int *attrib_list, int *nelements),
- (dpy, screen, attrib_list, nelements),
- glXChooseFBConfig)
-
-PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
- (Display * dpy, GLXFBConfigSGIX config),
- (dpy, config),
- glXGetVisualFromFBConfig)
-
-PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy,
- GLXFBConfigSGIX config, Pixmap pixmap)
-{
- xGLXVendorPrivateWithReplyReq *vpreq;
- xGLXCreateGLXPixmapWithConfigSGIXReq *req;
- GLXPixmap xid = None;
- CARD8 opcode;
- const __GLcontextModes * const fbconfig = (__GLcontextModes *) config;
- __GLXscreenConfigs * psc;
-
-
- if ( (dpy == NULL) || (config == NULL) ) {
- return None;
- }
-
- psc = GetGLXScreenConfigs( dpy, fbconfig->screen );
- if ( (psc != NULL)
- && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) {
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return None;
- }
-
- /* Send the glXCreateGLXPixmapWithConfigSGIX request */
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXCreateGLXPixmapWithConfigSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq);
- req = (xGLXCreateGLXPixmapWithConfigSGIXReq *)vpreq;
- req->reqType = opcode;
- req->glxCode = X_GLXVendorPrivateWithReply;
- req->vendorCode = X_GLXvop_CreateGLXPixmapWithConfigSGIX;
- req->screen = fbconfig->screen;
- req->fbconfig = fbconfig->fbconfigID;
- req->pixmap = pixmap;
- req->glxpixmap = xid = XAllocID(dpy);
- UnlockDisplay(dpy);
- SyncHandle();
- }
-
- return xid;
-}
-
-PUBLIC GLXContext glXCreateContextWithConfigSGIX(Display *dpy,
- GLXFBConfigSGIX config, int renderType,
- GLXContext shareList, Bool allowDirect)
-{
- GLXContext gc = NULL;
- const __GLcontextModes * const fbconfig = (__GLcontextModes *) config;
- __GLXscreenConfigs * psc;
-
-
- if ( (dpy == NULL) || (config == NULL) ) {
- return None;
- }
-
- psc = GetGLXScreenConfigs( dpy, fbconfig->screen );
- if ( (psc != NULL)
- && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) {
- gc = CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList,
- allowDirect, None, False, renderType );
- }
-
- return gc;
-}
-
-
-PUBLIC GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy,
- XVisualInfo *vis)
-{
- __GLXdisplayPrivate *priv;
- __GLXscreenConfigs *psc;
-
- if ( (GetGLXPrivScreenConfig( dpy, vis->screen, & priv, & psc ) != Success)
- && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit )
- && (psc->configs->fbconfigID != GLX_DONT_CARE) ) {
- return (GLXFBConfigSGIX) _gl_context_modes_find_visual( psc->configs,
- vis->visualid );
- }
-
- return NULL;
-}
-
-
-/*
-** GLX_SGI_cushion
-*/
-PUBLIC void glXCushionSGI(Display *dpy, Window win, float cushion)
-{
- (void) dpy;
- (void) win;
- (void) cushion;
-}
-
-
-/*
-** GLX_SGIX_video_resize
-*/
-PUBLIC int glXBindChannelToWindowSGIX(Display *dpy, int screen,
- int channel , Window window)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) window;
- return 0;
-}
-
-PUBLIC int glXChannelRectSGIX(Display *dpy, int screen, int channel,
- int x, int y, int w, int h)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) x;
- (void) y;
- (void) w;
- (void) h;
- return 0;
-}
-
-PUBLIC int glXQueryChannelRectSGIX(Display *dpy, int screen, int channel,
- int *x, int *y, int *w, int *h)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) x;
- (void) y;
- (void) w;
- (void) h;
- return 0;
-}
-
-int glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel,
- int *dx, int *dy, int *dw, int *dh)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) dx;
- (void) dy;
- (void) dw;
- (void) dh;
- return 0;
-}
-
-PUBLIC int glXChannelRectSyncSGIX(Display *dpy, int screen,
- int channel, GLenum synctype)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) synctype;
- return 0;
-}
-
-
-#if defined(_DM_BUFFER_H_)
-
-PUBLIC Bool glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer,
- DMparams *params, DMbuffer dmbuffer)
-{
- (void) dpy;
- (void) pbuffer;
- (void) params;
- (void) dmbuffer;
- return False;
-}
-
-#endif
-
-
-/*
-** GLX_SGIX_swap_group
-*/
-PUBLIC void glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable,
- GLXDrawable member)
-{
- (void) dpy;
- (void) drawable;
- (void) member;
-}
-
-
-/*
-** GLX_SGIX_swap_barrier
-*/
-PUBLIC void glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable,
- int barrier)
-{
- (void) dpy;
- (void) drawable;
- (void) barrier;
-}
-
-PUBLIC Bool glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max)
-{
- (void) dpy;
- (void) screen;
- (void) max;
- return False;
-}
-
-
-/*
-** GLX_SUN_get_transparent_index
-*/
-PUBLIC Status glXGetTransparentIndexSUN(Display *dpy, Window overlay,
- Window underlay, long *pTransparent)
-{
- (void) dpy;
- (void) overlay;
- (void) underlay;
- (void) pTransparent;
- return 0;
-}
-
-
-/*
-** GLX_OML_sync_control
-*/
-PUBLIC Bool glXGetSyncValuesOML(Display *dpy, GLXDrawable drawable,
- int64_t *ust, int64_t *msc, int64_t *sbc)
-{
-#ifdef GLX_DIRECT_RENDERING
- __GLXdisplayPrivate * const priv = __glXInitialize(dpy);
-
- if ( priv != NULL ) {
- int i;
- __DRIdrawable * const pdraw = GetDRIDrawable( dpy, drawable, & i );
- __GLXscreenConfigs * const psc = &priv->screenConfigs[i];
-
- assert( (pdraw == NULL) || (i != -1) );
- return ( (pdraw && pdraw->getSBC && psc->driScreen.getMSC)
- && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )
- && ((*psc->driScreen.getMSC)( psc->driScreen.private, msc ) == 0)
- && ((*pdraw->getSBC)( dpy, psc->driScreen.private, sbc ) == 0)
- && (__glXGetUST( ust ) == 0) );
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) ust;
- (void) msc;
- (void) sbc;
-#endif
- return False;
-}
-
-
-/**
- * Determine the refresh rate of the specified drawable and display.
- *
- * \param dpy Display whose refresh rate is to be determined.
- * \param drawable Drawable whose refresh rate is to be determined.
- * \param numerator Numerator of the refresh rate.
- * \param demoninator Denominator of the refresh rate.
- * \return If the refresh rate for the specified display and drawable could
- * be calculated, True is returned. Otherwise False is returned.
- *
- * \note This function is implemented entirely client-side. A lot of other
- * functionality is required to export GLX_OML_sync_control, so on
- * XFree86 this function can be called for direct-rendering contexts
- * when GLX_OML_sync_control appears in the client extension string.
- */
-
-PUBLIC Bool glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
- int32_t * numerator, int32_t * denominator)
-{
-#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
- __GLXdisplayPrivate * const priv = __glXInitialize(dpy);
-
-
- if ( priv != NULL ) {
- XF86VidModeModeLine mode_line;
- int dot_clock;
- int screen_num;
- int i;
-
-
- GetDRIDrawable( dpy, drawable, & screen_num );
- if ( (screen_num != -1)
- && XF86VidModeQueryVersion( dpy, & i, & i )
- && XF86VidModeGetModeLine( dpy, screen_num, & dot_clock,
- & mode_line ) ) {
- unsigned n = dot_clock * 1000;
- unsigned d = mode_line.vtotal * mode_line.htotal;
-
-# define V_INTERLACE 0x010
-# define V_DBLSCAN 0x020
-
- if ( (mode_line.flags & V_INTERLACE) ) {
- n *= 2;
- }
- else if ( (mode_line.flags & V_DBLSCAN) ) {
- d *= 2;
- }
-
- /* The OML_sync_control spec requires that if the refresh rate is a
- * whole number, that the returned numerator be equal to the refresh
- * rate and the denominator be 1.
- */
-
- if ( (n % d) == 0 ) {
- n /= d;
- d = 1;
- }
- else {
- static const unsigned f[] = { 13, 11, 7, 5, 3, 2, 0 };
-
-
- /* This is a poor man's way to reduce a fraction. It's far from
- * perfect, but it will work well enough for this situation.
- */
-
- for ( i = 0 ; f[i] != 0 ; i++ ) {
- while ( ((n % f[i]) == 0) && ((d % f[i]) == 0) ) {
- d /= f[i];
- n /= f[i];
- }
- }
- }
-
- *numerator = n;
- *denominator = d;
-
- (void) drawable;
- return True;
- }
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) numerator;
- (void) denominator;
-#endif
- return False;
-}
-
-
-PUBLIC int64_t glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable,
- int64_t target_msc, int64_t divisor,
- int64_t remainder)
-{
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen );
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
-
- /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
- * error", but it also says "It [glXSwapBuffersMscOML] will return a value
- * of -1 if the function failed because of errors detected in the input
- * parameters"
- */
- if ( divisor < 0 || remainder < 0 || target_msc < 0 )
- return -1;
- if ( divisor > 0 && remainder >= divisor )
- return -1;
-
- if ( (pdraw != NULL) && (pdraw->swapBuffersMSC != NULL)
- && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) {
- return (*pdraw->swapBuffersMSC)(dpy, pdraw->private, target_msc,
- divisor, remainder);
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) target_msc;
- (void) divisor;
- (void) remainder;
-#endif
- return 0;
-}
-
-
-PUBLIC Bool glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
- int64_t target_msc, int64_t divisor,
- int64_t remainder, int64_t *ust,
- int64_t *msc, int64_t *sbc)
-{
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen );
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
- int ret;
-
- /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
- * error", but the return type in the spec is Bool.
- */
- if ( divisor < 0 || remainder < 0 || target_msc < 0 )
- return False;
- if ( divisor > 0 && remainder >= divisor )
- return False;
-
- if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL)
- && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) {
- ret = (*pdraw->waitForMSC)( dpy, pdraw->private, target_msc,
- divisor, remainder, msc, sbc );
-
- /* __glXGetUST returns zero on success and non-zero on failure.
- * This function returns True on success and False on failure.
- */
- return ( (ret == 0) && (__glXGetUST( ust ) == 0) );
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) target_msc;
- (void) divisor;
- (void) remainder;
- (void) ust;
- (void) msc;
- (void) sbc;
-#endif
- return False;
-}
-
-
-PUBLIC Bool glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
- int64_t target_sbc, int64_t *ust,
- int64_t *msc, int64_t *sbc )
-{
-#ifdef GLX_DIRECT_RENDERING
- int screen;
- __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen );
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
- int ret;
-
- /* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE
- * error", but the return type in the spec is Bool.
- */
- if ( target_sbc < 0 )
- return False;
-
- if ( (pdraw != NULL) && (pdraw->waitForSBC != NULL)
- && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )) {
- ret = (*pdraw->waitForSBC)( dpy, pdraw->private, target_sbc, msc, sbc );
-
- /* __glXGetUST returns zero on success and non-zero on failure.
- * This function returns True on success and False on failure.
- */
- return( (ret == 0) && (__glXGetUST( ust ) == 0) );
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) target_sbc;
- (void) ust;
- (void) msc;
- (void) sbc;
-#endif
- return False;
-}
-
-
-/**
- * GLX_MESA_allocate_memory
- */
-/*@{*/
-
-PUBLIC void *glXAllocateMemoryMESA(Display *dpy, int scrn,
- size_t size, float readFreq,
- float writeFreq, float priority)
-{
-#ifdef GLX_DIRECT_RENDERING
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
-
- if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) {
- if (psc && psc->driScreen.private && psc->driScreen.allocateMemory) {
- return (*psc->driScreen.allocateMemory)( dpy, scrn, size,
- readFreq, writeFreq,
- priority );
- }
- }
-#else
- (void) dpy;
- (void) scrn;
- (void) size;
- (void) readFreq;
- (void) writeFreq;
- (void) priority;
-#endif /* GLX_DIRECT_RENDERING */
-
- return NULL;
-}
-
-
-PUBLIC void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer)
-{
-#ifdef GLX_DIRECT_RENDERING
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
-
- if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) {
- if (psc && psc->driScreen.private && psc->driScreen.freeMemory) {
- (*psc->driScreen.freeMemory)( dpy, scrn, pointer );
- }
- }
-#else
- (void) dpy;
- (void) scrn;
- (void) pointer;
-#endif /* GLX_DIRECT_RENDERING */
-}
-
-
-PUBLIC GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn,
- const void *pointer )
-{
-#ifdef GLX_DIRECT_RENDERING
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
-
- if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) {
- if (psc && psc->driScreen.private && psc->driScreen.memoryOffset) {
- return (*psc->driScreen.memoryOffset)( dpy, scrn, pointer );
- }
- }
-#else
- (void) dpy;
- (void) scrn;
- (void) pointer;
-#endif /* GLX_DIRECT_RENDERING */
-
- return ~0L;
-}
-/*@}*/
-
-
-/**
- * Mesa extension stubs. These will help reduce portability problems.
- */
-/*@{*/
-
-/**
- * Release all buffers associated with the specified GLX drawable.
- *
- * \todo
- * This function was intended for stand-alone Mesa. The issue there is that
- * the library doesn't get any notification when a window is closed. In
- * DRI there is a similar but slightly different issue. When GLX 1.3 is
- * supported, there are 3 different functions to destroy a drawable. It
- * should be possible to create GLX protocol (or have it determine which
- * protocol to use based on the type of the drawable) to have one function
- * do the work of 3. For the direct-rendering case, this function could
- * just call the driver's \c __DRIdrawableRec::destroyDrawable function.
- * This would reduce the frequency with which \c __driGarbageCollectDrawables
- * would need to be used. This really should be done as part of the new DRI
- * interface work.
- *
- * \sa http://oss.sgi.com/projects/ogl-sample/registry/MESA/release_buffers.txt
- * __driGarbageCollectDrawables
- * glXDestroyGLXPixmap
- * glXDestroyPbuffer glXDestroyPixmap glXDestroyWindow
- * glXDestroyGLXPbufferSGIX glXDestroyGLXVideoSourceSGIX
- */
-PUBLIC Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d )
-{
- (void) dpy;
- (void) d;
- return False;
-}
-
-
-PUBLIC GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
- Pixmap pixmap, Colormap cmap )
-{
- (void) dpy;
- (void) visual;
- (void) pixmap;
- (void) cmap;
- return 0;
-}
-
-
-PUBLIC void glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height)
-{
- (void) dpy;
- (void) drawable;
- (void) x;
- (void) y;
- (void) width;
- (void) height;
-}
-
-
-PUBLIC Bool glXSet3DfxModeMESA( int mode )
-{
- (void) mode;
- return GL_FALSE;
-}
-/*@}*/
-
-
-
-/**
- * \c strdup is actually not a standard ANSI C or POSIX routine.
- * Irix will not define it if ANSI mode is in effect.
- *
- * \sa strdup
- */
-char *
-__glXstrdup(const char *str)
-{
- char *copy;
- copy = (char *) Xmalloc(strlen(str) + 1);
- if (!copy)
- return NULL;
- strcpy(copy, str);
- return copy;
-}
-
-/*
-** glXGetProcAddress support
-*/
-
-struct name_address_pair {
- const char *Name;
- GLvoid *Address;
-};
-
-#define GLX_FUNCTION(f) { # f, (GLvoid *) f }
-#define GLX_FUNCTION2(n,f) { # n, (GLvoid *) f }
-
-static const struct name_address_pair GLX_functions[] = {
- /*** GLX_VERSION_1_0 ***/
- GLX_FUNCTION( glXChooseVisual ),
- GLX_FUNCTION( glXCopyContext ),
- GLX_FUNCTION( glXCreateContext ),
- GLX_FUNCTION( glXCreateGLXPixmap ),
- GLX_FUNCTION( glXDestroyContext ),
- GLX_FUNCTION( glXDestroyGLXPixmap ),
- GLX_FUNCTION( glXGetConfig ),
- GLX_FUNCTION( glXGetCurrentContext ),
- GLX_FUNCTION( glXGetCurrentDrawable ),
- GLX_FUNCTION( glXIsDirect ),
- GLX_FUNCTION( glXMakeCurrent ),
- GLX_FUNCTION( glXQueryExtension ),
- GLX_FUNCTION( glXQueryVersion ),
- GLX_FUNCTION( glXSwapBuffers ),
- GLX_FUNCTION( glXUseXFont ),
- GLX_FUNCTION( glXWaitGL ),
- GLX_FUNCTION( glXWaitX ),
-
- /*** GLX_VERSION_1_1 ***/
- GLX_FUNCTION( glXGetClientString ),
- GLX_FUNCTION( glXQueryExtensionsString ),
- GLX_FUNCTION( glXQueryServerString ),
-
- /*** GLX_VERSION_1_2 ***/
- GLX_FUNCTION( glXGetCurrentDisplay ),
-
- /*** GLX_VERSION_1_3 ***/
- GLX_FUNCTION( glXChooseFBConfig ),
- GLX_FUNCTION( glXCreateNewContext ),
- GLX_FUNCTION( glXCreatePbuffer ),
- GLX_FUNCTION( glXCreatePixmap ),
- GLX_FUNCTION( glXCreateWindow ),
- GLX_FUNCTION( glXDestroyPbuffer ),
- GLX_FUNCTION( glXDestroyPixmap ),
- GLX_FUNCTION( glXDestroyWindow ),
- GLX_FUNCTION( glXGetCurrentReadDrawable ),
- GLX_FUNCTION( glXGetFBConfigAttrib ),
- GLX_FUNCTION( glXGetFBConfigs ),
- GLX_FUNCTION( glXGetSelectedEvent ),
- GLX_FUNCTION( glXGetVisualFromFBConfig ),
- GLX_FUNCTION( glXMakeContextCurrent ),
- GLX_FUNCTION( glXQueryContext ),
- GLX_FUNCTION( glXQueryDrawable ),
- GLX_FUNCTION( glXSelectEvent ),
-
- /*** GLX_SGI_swap_control ***/
- GLX_FUNCTION( glXSwapIntervalSGI ),
-
- /*** GLX_SGI_video_sync ***/
- GLX_FUNCTION( glXGetVideoSyncSGI ),
- GLX_FUNCTION( glXWaitVideoSyncSGI ),
-
- /*** GLX_SGI_make_current_read ***/
- GLX_FUNCTION2( glXMakeCurrentReadSGI, glXMakeContextCurrent ),
- GLX_FUNCTION2( glXGetCurrentReadDrawableSGI, glXGetCurrentReadDrawable ),
-
- /*** GLX_SGIX_video_source ***/
-#if defined(_VL_H)
- GLX_FUNCTION( glXCreateGLXVideoSourceSGIX ),
- GLX_FUNCTION( glXDestroyGLXVideoSourceSGIX ),
-#endif
-
- /*** GLX_EXT_import_context ***/
- GLX_FUNCTION( glXFreeContextEXT ),
- GLX_FUNCTION( glXGetContextIDEXT ),
- GLX_FUNCTION2( glXGetCurrentDisplayEXT, glXGetCurrentDisplay ),
- GLX_FUNCTION( glXImportContextEXT ),
- GLX_FUNCTION2( glXQueryContextInfoEXT, glXQueryContext ),
-
- /*** GLX_SGIX_fbconfig ***/
- GLX_FUNCTION2( glXGetFBConfigAttribSGIX, glXGetFBConfigAttrib ),
- GLX_FUNCTION2( glXChooseFBConfigSGIX, glXChooseFBConfig ),
- GLX_FUNCTION( glXCreateGLXPixmapWithConfigSGIX ),
- GLX_FUNCTION( glXCreateContextWithConfigSGIX ),
- GLX_FUNCTION2( glXGetVisualFromFBConfigSGIX, glXGetVisualFromFBConfig ),
- GLX_FUNCTION( glXGetFBConfigFromVisualSGIX ),
-
- /*** GLX_SGIX_pbuffer ***/
- GLX_FUNCTION( glXCreateGLXPbufferSGIX ),
- GLX_FUNCTION( glXDestroyGLXPbufferSGIX ),
- GLX_FUNCTION( glXQueryGLXPbufferSGIX ),
- GLX_FUNCTION( glXSelectEventSGIX ),
- GLX_FUNCTION( glXGetSelectedEventSGIX ),
-
- /*** GLX_SGI_cushion ***/
- GLX_FUNCTION( glXCushionSGI ),
-
- /*** GLX_SGIX_video_resize ***/
- GLX_FUNCTION( glXBindChannelToWindowSGIX ),
- GLX_FUNCTION( glXChannelRectSGIX ),
- GLX_FUNCTION( glXQueryChannelRectSGIX ),
- GLX_FUNCTION( glXQueryChannelDeltasSGIX ),
- GLX_FUNCTION( glXChannelRectSyncSGIX ),
-
- /*** GLX_SGIX_dmbuffer **/
-#if defined(_DM_BUFFER_H_)
- GLX_FUNCTION( glXAssociateDMPbufferSGIX ),
-#endif
-
- /*** GLX_SGIX_swap_group ***/
- GLX_FUNCTION( glXJoinSwapGroupSGIX ),
-
- /*** GLX_SGIX_swap_barrier ***/
- GLX_FUNCTION( glXBindSwapBarrierSGIX ),
- GLX_FUNCTION( glXQueryMaxSwapBarriersSGIX ),
-
- /*** GLX_SUN_get_transparent_index ***/
- GLX_FUNCTION( glXGetTransparentIndexSUN ),
-
- /*** GLX_MESA_allocate_memory ***/
- GLX_FUNCTION( glXAllocateMemoryMESA ),
- GLX_FUNCTION( glXFreeMemoryMESA ),
- GLX_FUNCTION( glXGetMemoryOffsetMESA ),
-
- /*** GLX_MESA_copy_sub_buffer ***/
- GLX_FUNCTION( glXCopySubBufferMESA ),
-
- /*** GLX_MESA_pixmap_colormap ***/
- GLX_FUNCTION( glXCreateGLXPixmapMESA ),
-
- /*** GLX_MESA_release_buffers ***/
- GLX_FUNCTION( glXReleaseBuffersMESA ),
-
- /*** GLX_MESA_set_3dfx_mode ***/
- GLX_FUNCTION( glXSet3DfxModeMESA ),
-
- /*** GLX_MESA_swap_control ***/
- GLX_FUNCTION( glXSwapIntervalMESA ),
- GLX_FUNCTION( glXGetSwapIntervalMESA ),
-
- /*** GLX_MESA_swap_frame_usage ***/
- GLX_FUNCTION( glXBeginFrameTrackingMESA ),
- GLX_FUNCTION( glXEndFrameTrackingMESA ),
- GLX_FUNCTION( glXGetFrameUsageMESA ),
- GLX_FUNCTION( glXQueryFrameTrackingMESA ),
-
- /*** GLX_ARB_get_proc_address ***/
- GLX_FUNCTION( glXGetProcAddressARB ),
-
- /*** GLX 1.4 ***/
- GLX_FUNCTION2( glXGetProcAddress, glXGetProcAddressARB ),
-
- /*** GLX_OML_sync_control ***/
- GLX_FUNCTION( glXWaitForSbcOML ),
- GLX_FUNCTION( glXWaitForMscOML ),
- GLX_FUNCTION( glXSwapBuffersMscOML ),
- GLX_FUNCTION( glXGetMscRateOML ),
- GLX_FUNCTION( glXGetSyncValuesOML ),
-
-#ifdef GLX_DIRECT_RENDERING
- /*** DRI configuration ***/
- GLX_FUNCTION( glXGetScreenDriver ),
- GLX_FUNCTION( glXGetDriverConfig ),
-#endif
-
- { NULL, NULL } /* end of list */
-};
-
-
-static const GLvoid *
-get_glx_proc_address(const char *funcName)
-{
- GLuint i;
-
- /* try static functions */
- for (i = 0; GLX_functions[i].Name; i++) {
- if (strcmp(GLX_functions[i].Name, funcName) == 0)
- return GLX_functions[i].Address;
- }
-
- return NULL;
-}
-
-
-/**
- * Get the address of a named GL function. This is the pre-GLX 1.4 name for
- * \c glXGetProcAddress.
- *
- * \param procName Name of a GL or GLX function.
- * \returns A pointer to the named function
- *
- * \sa glXGetProcAddress
- */
-PUBLIC void (*glXGetProcAddressARB(const GLubyte *procName))( void )
-{
- typedef void (*gl_function)( void );
- gl_function f;
-
-
- /* Search the table of GLX and internal functions first. If that
- * fails and the supplied name could be a valid core GL name, try
- * searching the core GL function table. This check is done to prevent
- * DRI based drivers from searching the core GL function table for
- * internal API functions.
- */
-
- f = (gl_function) get_glx_proc_address((const char *) procName);
- if ( (f == NULL) && (procName[0] == 'g') && (procName[1] == 'l')
- && (procName[2] != 'X') ) {
- f = (gl_function) _glapi_get_proc_address((const char *) procName);
- }
-
- return f;
-}
-
-/**
- * Get the address of a named GL function. This is the GLX 1.4 name for
- * \c glXGetProcAddressARB.
- *
- * \param procName Name of a GL or GLX function.
- * \returns A pointer to the named function
- *
- * \sa glXGetProcAddressARB
- */
-PUBLIC void (*glXGetProcAddress(const GLubyte *procName))( void )
-#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
- __attribute__ ((alias ("glXGetProcAddressARB")));
-#else
-{
- return glXGetProcAddressARB(procName);
-}
-#endif /* __GNUC__ */
-
-
-#ifdef GLX_DIRECT_RENDERING
-/**
- * Retrieves the verion of the internal libGL API in YYYYMMDD format. This
- * might be used by the DRI drivers to determine how new libGL is at runtime.
- * Drivers should not call this function directly. They should instead use
- * \c glXGetProcAddress to obtain a pointer to the function.
- *
- * \returns An 8-digit decimal number representing the internal libGL API in
- * YYYYMMDD format.
- *
- * \sa glXGetProcAddress, PFNGLXGETINTERNALVERSIONPROC
- *
- * \since Internal API version 20021121.
- */
-int __glXGetInternalVersion(void)
-{
- /* History:
- * 20021121 - Initial version
- * 20021128 - Added __glXWindowExists() function
- * 20021207 - Added support for dynamic GLX extensions,
- * GLX_SGI_swap_control, GLX_SGI_video_sync,
- * GLX_OML_sync_control, and GLX_MESA_swap_control.
- * Never officially released. Do NOT test against
- * this version. Use 20030317 instead.
- * 20030317 - Added support GLX_SGIX_fbconfig,
- * GLX_MESA_swap_frame_usage, GLX_OML_swap_method,
- * GLX_{ARB,SGIS}_multisample, and
- * GLX_SGIX_visual_select_group.
- * 20030606 - Added support for GLX_SGI_make_current_read.
- * 20030813 - Made support for dynamic extensions multi-head aware.
- * 20030818 - Added support for GLX_MESA_allocate_memory in place of the
- * deprecated GLX_NV_vertex_array_range & GLX_MESA_agp_offset
- * interfaces.
- * 20031201 - Added support for the first round of DRI interface changes.
- * Do NOT test against this version! It has binary
- * compatibility bugs, use 20040317 instead.
- * 20040317 - Added the 'mode' field to __DRIcontextRec.
- * 20040415 - Added support for bindContext3 and unbindContext3.
- * 20040602 - Add __glXGetDrawableInfo. I though that was there
- * months ago. :(
- * 20050727 - Gut all the old interfaces. This breaks compatability with
- * any DRI driver built to any previous version.
- */
- return 20050727;
-}
-
-
-
-static Bool windowExistsFlag;
-
-static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr)
-{
- if (xerr->error_code == BadWindow) {
- windowExistsFlag = GL_FALSE;
- }
- return 0;
-}
-
-/**
- * Determine if a window associated with a \c GLXDrawable exists on the
- * X-server. This function is not used internally by libGL. It is provided
- * as a utility function for DRI drivers.
- * Drivers should not call this function directly. They should instead use
- * \c glXGetProcAddress to obtain a pointer to the function.
- *
- * \param dpy Display associated with the drawable to be queried.
- * \param draw \c GLXDrawable to test.
- *
- * \returns \c GL_TRUE if a window exists that is associated with \c draw,
- * otherwise \c GL_FALSE is returned.
- *
- * \warning This function is not currently thread-safe.
- *
- * \sa glXGetProcAddress
- *
- * \since Internal API version 20021128.
- */
-Bool __glXWindowExists(Display *dpy, GLXDrawable draw)
-{
- XWindowAttributes xwa;
- int (*oldXErrorHandler)(Display *, XErrorEvent *);
-
- XSync(dpy, GL_FALSE);
- windowExistsFlag = GL_TRUE;
- oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler);
- XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */
- XSetErrorHandler(oldXErrorHandler);
- return windowExistsFlag;
-}
-
-
-/**
- * Get the unadjusted system time (UST). Currently, the UST is measured in
- * microseconds since Epoc. The actual resolution of the UST may vary from
- * system to system, and the units may vary from release to release.
- * Drivers should not call this function directly. They should instead use
- * \c glXGetProcAddress to obtain a pointer to the function.
- *
- * \param ust Location to store the 64-bit UST
- * \returns Zero on success or a negative errno value on failure.
- *
- * \sa glXGetProcAddress, PFNGLXGETUSTPROC
- *
- * \since Internal API version 20030317.
- */
-int __glXGetUST( int64_t * ust )
-{
- struct timeval tv;
-
- if ( ust == NULL ) {
- return -EFAULT;
- }
-
- if ( gettimeofday( & tv, NULL ) == 0 ) {
- ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
- return 0;
- } else {
- return -errno;
- }
-}
-#endif /* GLX_DIRECT_RENDERING */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glxext.c b/nx-X11/extras/Mesa/src/glx/x11/glxext.c
deleted file mode 100644
index eb6e870e9..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glxext.c
+++ /dev/null
@@ -1,1864 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.22 2003/12/08 17:35:28 dawes Exp $ */
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/**
- * \file glxext.c
- * GLX protocol interface boot-strap code.
- *
- * Direct rendering support added by Precision Insight, Inc.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- */
-
-#include "glxclient.h"
-#include <stdio.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include <assert.h>
-#include "indirect_init.h"
-#include "glapi.h"
-#include "glxextensions.h"
-#include "glcontextmodes.h"
-#include "glheader.h"
-
-#ifdef GLX_DIRECT_RENDERING
-#include <inttypes.h>
-#include <sys/mman.h>
-#include "xf86dri.h"
-#include "sarea.h"
-#include "dri_glx.h"
-#endif
-
-#ifdef USE_XCB
-#include <X11/xcl.h>
-#include <X11/XCB/xcb.h>
-#include <X11/XCB/glx.h>
-#endif
-
-#include <assert.h>
-
-#ifdef DEBUG
-void __glXDumpDrawBuffer(__GLXcontext *ctx);
-#endif
-
-#ifdef USE_SPARC_ASM
-/*
- * This is where our dispatch table's bounds are.
- * And the static mesa_init is taken directly from
- * Mesa's 'sparc.c' initializer.
- *
- * We need something like this here, because this version
- * of openGL/glx never initializes a Mesa context, and so
- * the address of the dispatch table pointer never gets stuffed
- * into the dispatch jump table otherwise.
- *
- * It matters only on SPARC, and only if you are using assembler
- * code instead of C-code indirect dispatch.
- *
- * -- FEM, 04.xii.03
- */
-extern unsigned int _mesa_sparc_glapi_begin;
-extern unsigned int _mesa_sparc_glapi_end;
-extern void __glapi_sparc_icache_flush(unsigned int *);
-static void _glx_mesa_init_sparc_glapi_relocs(void);
-static int _mesa_sparc_needs_init = 1;
-#define INIT_MESA_SPARC { \
- if(_mesa_sparc_needs_init) { \
- _glx_mesa_init_sparc_glapi_relocs(); \
- _mesa_sparc_needs_init = 0; \
- } \
-}
-#else
-#define INIT_MESA_SPARC
-#endif
-
-#ifdef GLX_DIRECT_RENDERING
-static __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
-#endif /* GLX_DIRECT_RENDERING */
-
-static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
- GLXDrawable read, GLXContext gc);
-
-/*
-** We setup some dummy structures here so that the API can be used
-** even if no context is current.
-*/
-
-static GLubyte dummyBuffer[__GLX_BUFFER_LIMIT_SIZE];
-
-/*
-** Dummy context used by small commands when there is no current context.
-** All the
-** gl and glx entry points are designed to operate as nop's when using
-** the dummy context structure.
-*/
-static __GLXcontext dummyContext = {
- &dummyBuffer[0],
- &dummyBuffer[0],
- &dummyBuffer[0],
- &dummyBuffer[__GLX_BUFFER_LIMIT_SIZE],
- sizeof(dummyBuffer),
-};
-
-
-/*
-** All indirect rendering contexts will share the same indirect dispatch table.
-*/
-static __GLapi *IndirectAPI = NULL;
-
-
-/*
- * Current context management and locking
- */
-
-#if defined( USE_XTHREADS )
-
-/* thread safe */
-static GLboolean TSDinitialized = GL_FALSE;
-static xthread_key_t ContextTSD;
-
-__GLXcontext *__glXGetCurrentContext(void)
-{
- if (!TSDinitialized) {
- xthread_key_create(&ContextTSD, NULL);
- TSDinitialized = GL_TRUE;
- return &dummyContext;
- }
- else {
- void *p;
- xthread_get_specific(ContextTSD, &p);
- if (!p)
- return &dummyContext;
- else
- return (__GLXcontext *) p;
- }
-}
-
-void __glXSetCurrentContext(__GLXcontext *c)
-{
- if (!TSDinitialized) {
- xthread_key_create(&ContextTSD, NULL);
- TSDinitialized = GL_TRUE;
- }
- xthread_set_specific(ContextTSD, c);
-}
-
-
-/* Used by the __glXLock() and __glXUnlock() macros */
-xmutex_rec __glXmutex;
-
-#elif defined( PTHREADS )
-
-pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER;
-
-# if defined( GLX_USE_TLS )
-
-/**
- * Per-thread GLX context pointer.
- *
- * \c __glXSetCurrentContext is written is such a way that this pointer can
- * \b never be \c NULL. This is important! Because of this
- * \c __glXGetCurrentContext can be implemented as trivial macro.
- */
-__thread void * __glX_tls_Context __attribute__((tls_model("initial-exec")))
- = &dummyContext;
-
-void __glXSetCurrentContext( __GLXcontext * c )
-{
- __glX_tls_Context = (c != NULL) ? c : &dummyContext;
-}
-
-# else
-
-static pthread_once_t once_control = PTHREAD_ONCE_INIT;
-
-/**
- * Per-thread data key.
- *
- * Once \c init_thread_data has been called, the per-thread data key will
- * take a value of \c NULL. As each new thread is created the default
- * value, in that thread, will be \c NULL.
- */
-static pthread_key_t ContextTSD;
-
-/**
- * Initialize the per-thread data key.
- *
- * This function is called \b exactly once per-process (not per-thread!) to
- * initialize the per-thread data key. This is ideally done using the
- * \c pthread_once mechanism.
- */
-static void init_thread_data( void )
-{
- if ( pthread_key_create( & ContextTSD, NULL ) != 0 ) {
- perror( "pthread_key_create" );
- exit( -1 );
- }
-}
-
-void __glXSetCurrentContext( __GLXcontext * c )
-{
- pthread_once( & once_control, init_thread_data );
- pthread_setspecific( ContextTSD, c );
-}
-
-__GLXcontext * __glXGetCurrentContext( void )
-{
- void * v;
-
- pthread_once( & once_control, init_thread_data );
-
- v = pthread_getspecific( ContextTSD );
- return (v == NULL) ? & dummyContext : (__GLXcontext *) v;
-}
-
-# endif /* defined( GLX_USE_TLS ) */
-
-#elif defined( THREADS )
-
-#error Unknown threading method specified.
-
-#else
-
-/* not thread safe */
-__GLXcontext *__glXcurrentContext = &dummyContext;
-
-#endif
-
-
-/*
-** You can set this cell to 1 to force the gl drawing stuff to be
-** one command per packet
-*/
-int __glXDebug = 0;
-
-/*
-** forward prototype declarations
-*/
-int __glXCloseDisplay(Display *dpy, XExtCodes *codes);
-
-
-/************************************************************************/
-
-/* Extension required boiler plate */
-
-static char *__glXExtensionName = GLX_EXTENSION_NAME;
-XExtensionInfo *__glXExtensionInfo = NULL;
-
-static /* const */ char *error_list[] = {
- "GLXBadContext",
- "GLXBadContextState",
- "GLXBadDrawable",
- "GLXBadPixmap",
- "GLXBadContextTag",
- "GLXBadCurrentWindow",
- "GLXBadRenderRequest",
- "GLXBadLargeRequest",
- "GLXUnsupportedPrivateRequest",
-};
-
-int __glXCloseDisplay(Display *dpy, XExtCodes *codes)
-{
- GLXContext gc;
-
- gc = __glXGetCurrentContext();
- if (dpy == gc->currentDpy) {
- __glXSetCurrentContext(&dummyContext);
-#ifdef GLX_DIRECT_RENDERING
- _glapi_set_dispatch(NULL); /* no-op functions */
-#endif
- __glXFreeContext(gc);
- }
-
- return XextRemoveDisplay(__glXExtensionInfo, dpy);
-}
-
-
-static XEXT_GENERATE_ERROR_STRING(__glXErrorString, __glXExtensionName,
- __GLX_NUMBER_ERRORS, error_list)
-
-static /* const */ XExtensionHooks __glXExtensionHooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- __glXCloseDisplay, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- __glXErrorString, /* error_string */
-};
-
-static
-XEXT_GENERATE_FIND_DISPLAY(__glXFindDisplay, __glXExtensionInfo,
- __glXExtensionName, &__glXExtensionHooks,
- __GLX_NUMBER_EVENTS, NULL)
-
-/************************************************************************/
-
-/*
-** Free the per screen configs data as well as the array of
-** __glXScreenConfigs.
-*/
-static void FreeScreenConfigs(__GLXdisplayPrivate *priv)
-{
- __GLXscreenConfigs *psc;
- GLint i, screens;
-
- /* Free screen configuration information */
- psc = priv->screenConfigs;
- screens = ScreenCount(priv->dpy);
- for (i = 0; i < screens; i++, psc++) {
- if (psc->configs) {
- _gl_context_modes_destroy( psc->configs );
- if(psc->effectiveGLXexts)
- Xfree(psc->effectiveGLXexts);
-
- psc->configs = NULL; /* NOTE: just for paranoia */
- }
-
-#ifdef GLX_DIRECT_RENDERING
- /* Free the direct rendering per screen data */
- if (psc->driScreen.private)
- (*psc->driScreen.destroyScreen)(priv->dpy, i,
- psc->driScreen.private);
- psc->driScreen.private = NULL;
-#endif
- }
- XFree((char*) priv->screenConfigs);
-}
-
-/*
-** Release the private memory referred to in a display private
-** structure. The caller will free the extension structure.
-*/
-static int __glXFreeDisplayPrivate(XExtData *extension)
-{
- __GLXdisplayPrivate *priv;
-
- priv = (__GLXdisplayPrivate*) extension->private_data;
- FreeScreenConfigs(priv);
- if(priv->serverGLXvendor) {
- Xfree((char*)priv->serverGLXvendor);
- priv->serverGLXvendor = 0x0; /* to protect against double free's */
- }
- if(priv->serverGLXversion) {
- Xfree((char*)priv->serverGLXversion);
- priv->serverGLXversion = 0x0; /* to protect against double free's */
- }
-
-#if 0 /* GLX_DIRECT_RENDERING */
- /* Free the direct rendering per display data */
- if (priv->driDisplay.private)
- (*priv->driDisplay.destroyDisplay)(priv->dpy,
- priv->driDisplay.private);
- priv->driDisplay.private = NULL;
-#endif
-
- Xfree((char*) priv);
- return 0;
-}
-
-/************************************************************************/
-
-/*
-** Query the version of the GLX extension. This procedure works even if
-** the client extension is not completely set up.
-*/
-static Bool QueryVersion(Display *dpy, int opcode, int *major, int *minor)
-{
- xGLXQueryVersionReq *req;
- xGLXQueryVersionReply reply;
-
- /* Send the glXQueryVersion request */
- LockDisplay(dpy);
- GetReq(GLXQueryVersion,req);
- req->reqType = opcode;
- req->glxCode = X_GLXQueryVersion;
- req->majorVersion = GLX_MAJOR_VERSION;
- req->minorVersion = GLX_MINOR_VERSION;
- _XReply(dpy, (xReply*) &reply, 0, False);
- UnlockDisplay(dpy);
- SyncHandle();
-
- if (reply.majorVersion != GLX_MAJOR_VERSION) {
- /*
- ** The server does not support the same major release as this
- ** client.
- */
- return GL_FALSE;
- }
- *major = reply.majorVersion;
- *minor = min(reply.minorVersion, GLX_MINOR_VERSION);
- return GL_TRUE;
-}
-
-
-void
-__glXInitializeVisualConfigFromTags( __GLcontextModes *config, int count,
- const INT32 *bp, Bool tagged_only,
- Bool fbconfig_style_tags )
-{
- int i;
-
- if (!tagged_only) {
- /* Copy in the first set of properties */
- config->visualID = *bp++;
-
- config->visualType = _gl_convert_from_x_visual_type( *bp++ );
-
- config->rgbMode = *bp++;
-
- config->redBits = *bp++;
- config->greenBits = *bp++;
- config->blueBits = *bp++;
- config->alphaBits = *bp++;
- config->accumRedBits = *bp++;
- config->accumGreenBits = *bp++;
- config->accumBlueBits = *bp++;
- config->accumAlphaBits = *bp++;
-
- config->doubleBufferMode = *bp++;
- config->stereoMode = *bp++;
-
- config->rgbBits = *bp++;
- config->depthBits = *bp++;
- config->stencilBits = *bp++;
- config->numAuxBuffers = *bp++;
- config->level = *bp++;
-
- count -= __GLX_MIN_CONFIG_PROPS;
- }
-
- /*
- ** Additional properties may be in a list at the end
- ** of the reply. They are in pairs of property type
- ** and property value.
- */
-
-#define FETCH_OR_SET(tag) \
- config-> tag = ( fbconfig_style_tags ) ? *bp++ : 1
-
- for (i = 0; i < count; i += 2 ) {
- switch(*bp++) {
- case GLX_RGBA:
- FETCH_OR_SET( rgbMode );
- break;
- case GLX_BUFFER_SIZE:
- config->rgbBits = *bp++;
- break;
- case GLX_LEVEL:
- config->level = *bp++;
- break;
- case GLX_DOUBLEBUFFER:
- FETCH_OR_SET( doubleBufferMode );
- break;
- case GLX_STEREO:
- FETCH_OR_SET( stereoMode );
- break;
- case GLX_AUX_BUFFERS:
- config->numAuxBuffers = *bp++;
- break;
- case GLX_RED_SIZE:
- config->redBits = *bp++;
- break;
- case GLX_GREEN_SIZE:
- config->greenBits = *bp++;
- break;
- case GLX_BLUE_SIZE:
- config->blueBits = *bp++;
- break;
- case GLX_ALPHA_SIZE:
- config->alphaBits = *bp++;
- break;
- case GLX_DEPTH_SIZE:
- config->depthBits = *bp++;
- break;
- case GLX_STENCIL_SIZE:
- config->stencilBits = *bp++;
- break;
- case GLX_ACCUM_RED_SIZE:
- config->accumRedBits = *bp++;
- break;
- case GLX_ACCUM_GREEN_SIZE:
- config->accumGreenBits = *bp++;
- break;
- case GLX_ACCUM_BLUE_SIZE:
- config->accumBlueBits = *bp++;
- break;
- case GLX_ACCUM_ALPHA_SIZE:
- config->accumAlphaBits = *bp++;
- break;
- case GLX_VISUAL_CAVEAT_EXT:
- config->visualRating = *bp++;
- break;
- case GLX_X_VISUAL_TYPE:
- config->visualType = *bp++;
- break;
- case GLX_TRANSPARENT_TYPE:
- config->transparentPixel = *bp++;
- break;
- case GLX_TRANSPARENT_INDEX_VALUE:
- config->transparentIndex = *bp++;
- break;
- case GLX_TRANSPARENT_RED_VALUE:
- config->transparentRed = *bp++;
- break;
- case GLX_TRANSPARENT_GREEN_VALUE:
- config->transparentGreen = *bp++;
- break;
- case GLX_TRANSPARENT_BLUE_VALUE:
- config->transparentBlue = *bp++;
- break;
- case GLX_TRANSPARENT_ALPHA_VALUE:
- config->transparentAlpha = *bp++;
- break;
- case GLX_VISUAL_ID:
- config->visualID = *bp++;
- break;
- case GLX_DRAWABLE_TYPE:
- config->drawableType = *bp++;
- break;
- case GLX_RENDER_TYPE:
- config->renderType = *bp++;
- break;
- case GLX_X_RENDERABLE:
- config->xRenderable = *bp++;
- break;
- case GLX_FBCONFIG_ID:
- config->fbconfigID = *bp++;
- break;
- case GLX_MAX_PBUFFER_WIDTH:
- config->maxPbufferWidth = *bp++;
- break;
- case GLX_MAX_PBUFFER_HEIGHT:
- config->maxPbufferHeight = *bp++;
- break;
- case GLX_MAX_PBUFFER_PIXELS:
- config->maxPbufferPixels = *bp++;
- break;
- case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
- config->optimalPbufferWidth = *bp++;
- break;
- case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX:
- config->optimalPbufferHeight = *bp++;
- break;
- case GLX_VISUAL_SELECT_GROUP_SGIX:
- config->visualSelectGroup = *bp++;
- break;
- case GLX_SWAP_METHOD_OML:
- config->swapMethod = *bp++;
- break;
- case GLX_SAMPLE_BUFFERS_SGIS:
- config->sampleBuffers = *bp++;
- break;
- case GLX_SAMPLES_SGIS:
- config->samples = *bp++;
- break;
- case None:
- i = count;
- break;
- default:
- break;
- }
- }
-
- config->renderType = (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
-
- config->haveAccumBuffer = ((config->accumRedBits +
- config->accumGreenBits +
- config->accumBlueBits +
- config->accumAlphaBits) > 0);
- config->haveDepthBuffer = (config->depthBits > 0);
- config->haveStencilBuffer = (config->stencilBits > 0);
-}
-
-
-#ifdef GLX_DIRECT_RENDERING
-static unsigned
-filter_modes( __GLcontextModes ** server_modes,
- const __GLcontextModes * driver_modes )
-{
- __GLcontextModes * m;
- __GLcontextModes ** prev_next;
- const __GLcontextModes * check;
- unsigned modes_count = 0;
-
- if ( driver_modes == NULL ) {
- fprintf(stderr, "libGL warning: 3D driver returned no fbconfigs.\n");
- return 0;
- }
-
- /* For each mode in server_modes, check to see if a matching mode exists
- * in driver_modes. If not, then the mode is not available.
- */
-
- prev_next = server_modes;
- for ( m = *prev_next ; m != NULL ; m = *prev_next ) {
- GLboolean do_delete = GL_TRUE;
-
- for ( check = driver_modes ; check != NULL ; check = check->next ) {
- if ( _gl_context_modes_are_same( m, check ) ) {
- do_delete = GL_FALSE;
- break;
- }
- }
-
- /* The 3D has to support all the modes that match the GLX visuals
- * sent from the X server.
- */
- if ( do_delete && (m->visualID != 0) ) {
- do_delete = GL_FALSE;
-
- fprintf(stderr, "libGL warning: 3D driver claims to not support "
- "visual 0x%02x\n", m->visualID);
- }
-
- if ( do_delete ) {
- *prev_next = m->next;
-
- m->next = NULL;
- _gl_context_modes_destroy( m );
- }
- else {
- modes_count++;
- prev_next = & m->next;
- }
- }
-
- return modes_count;
-}
-
-
-/**
- * Implement \c __DRIinterfaceMethods::getProcAddress.
- */
-static __DRIfuncPtr get_proc_address( const char * proc_name )
-{
- if (strcmp( proc_name, "glxEnableExtension" ) == 0) {
- return (__DRIfuncPtr) __glXScrEnableExtension;
- }
-
- return NULL;
-}
-
-
-/**
- * Table of functions exported by the loader to the driver.
- */
-static const __DRIinterfaceMethods interface_methods = {
- get_proc_address,
-
- _gl_context_modes_create,
- _gl_context_modes_destroy,
-
- __glXFindDRIScreen,
- __glXWindowExists,
-
- XF86DRICreateContextWithConfig,
- XF86DRIDestroyContext,
-
- XF86DRICreateDrawable,
- XF86DRIDestroyDrawable,
- XF86DRIGetDrawableInfo,
-
- __glXGetUST,
- glXGetMscRateOML,
-};
-
-
-/**
- * Perform the required libGL-side initialization and call the client-side
- * driver's \c __driCreateNewScreen function.
- *
- * \param dpy Display pointer.
- * \param scrn Screen number on the display.
- * \param psc DRI screen information.
- * \param driDpy DRI display information.
- * \param createNewScreen Pointer to the client-side driver's
- * \c __driCreateNewScreen function.
- * \returns A pointer to the \c __DRIscreenPrivate structure returned by
- * the client-side driver on success, or \c NULL on failure.
- *
- * \todo This function needs to be modified to remove context-modes from the
- * list stored in the \c __GLXscreenConfigsRec to match the list
- * returned by the client-side driver.
- */
-static void *
-CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
- __DRIdisplay * driDpy,
- PFNCREATENEWSCREENFUNC createNewScreen)
-{
- __DRIscreenPrivate *psp = NULL;
-#ifndef GLX_USE_APPLEGL
- drm_handle_t hSAREA;
- drmAddress pSAREA = MAP_FAILED;
- char *BusID;
- __DRIversion ddx_version;
- __DRIversion dri_version;
- __DRIversion drm_version;
- __DRIframebuffer framebuffer;
- int fd = -1;
- int status;
- const char * err_msg;
- const char * err_extra;
- int api_ver = __glXGetInternalVersion();
-
-
- dri_version.major = driDpy->private->driMajor;
- dri_version.minor = driDpy->private->driMinor;
- dri_version.patch = driDpy->private->driPatch;
-
-
- err_msg = "XF86DRIOpenConnection";
- err_extra = NULL;
-
- framebuffer.base = MAP_FAILED;
- framebuffer.dev_priv = NULL;
-
- if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
- fd = drmOpen(NULL,BusID);
- Xfree(BusID); /* No longer needed */
-
- err_msg = "open DRM";
- err_extra = strerror( -fd );
-
- if (fd >= 0) {
- drm_magic_t magic;
-
- err_msg = "drmGetMagic";
- err_extra = NULL;
-
- if (!drmGetMagic(fd, &magic)) {
- drmVersionPtr version = drmGetVersion(fd);
- if (version) {
- drm_version.major = version->version_major;
- drm_version.minor = version->version_minor;
- drm_version.patch = version->version_patchlevel;
- drmFreeVersion(version);
- }
- else {
- drm_version.major = -1;
- drm_version.minor = -1;
- drm_version.patch = -1;
- }
-
- err_msg = "XF86DRIAuthConnection";
- if (XF86DRIAuthConnection(dpy, scrn, magic)) {
- char *driverName;
-
- /*
- * Get device name (like "tdfx") and the ddx version
- * numbers. We'll check the version in each DRI driver's
- * "createNewScreen" function.
- */
- err_msg = "XF86DRIGetClientDriverName";
- if (XF86DRIGetClientDriverName(dpy, scrn,
- &ddx_version.major,
- &ddx_version.minor,
- &ddx_version.patch,
- &driverName)) {
- drm_handle_t hFB;
- int junk;
-
- /* No longer needed. */
- Xfree( driverName );
-
-
- /*
- * Get device-specific info. pDevPriv will point to a struct
- * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h)
- * that has information about the screen size, depth, pitch,
- * ancilliary buffers, DRM mmap handles, etc.
- */
- err_msg = "XF86DRIGetDeviceInfo";
- if (XF86DRIGetDeviceInfo(dpy, scrn,
- &hFB,
- &junk,
- &framebuffer.size,
- &framebuffer.stride,
- &framebuffer.dev_priv_size,
- &framebuffer.dev_priv)) {
- framebuffer.width = DisplayWidth(dpy, scrn);
- framebuffer.height = DisplayHeight(dpy, scrn);
-
- /*
- * Map the framebuffer region.
- */
- status = drmMap(fd, hFB, framebuffer.size,
- (drmAddressPtr)&framebuffer.base);
-
- err_msg = "drmMap of framebuffer";
- err_extra = strerror( -status );
-
- if ( status == 0 ) {
- /*
- * Map the SAREA region. Further mmap regions
- * may be setup in each DRI driver's
- * "createNewScreen" function.
- */
- status = drmMap(fd, hSAREA, SAREA_MAX,
- &pSAREA);
-
- err_msg = "drmMap of sarea";
- err_extra = strerror( -status );
-
- if ( status == 0 ) {
- __GLcontextModes * driver_modes = NULL;
- __GLXscreenConfigs *configs = psc->screenConfigs;
-
- err_msg = "InitDriver";
- err_extra = NULL;
- psp = (*createNewScreen)(dpy, scrn,
- psc,
- configs->configs,
- & ddx_version,
- & dri_version,
- & drm_version,
- & framebuffer,
- pSAREA,
- fd,
- api_ver,
- & interface_methods,
- & driver_modes );
-
- filter_modes( & configs->configs,
- driver_modes );
- _gl_context_modes_destroy( driver_modes );
- }
- }
- }
- }
- }
- }
- }
- }
-
- if ( psp == NULL ) {
- if ( pSAREA != MAP_FAILED ) {
- (void)drmUnmap(pSAREA, SAREA_MAX);
- }
-
- if ( framebuffer.base != MAP_FAILED ) {
- (void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size);
- }
-
- if ( framebuffer.dev_priv != NULL ) {
- Xfree(framebuffer.dev_priv);
- }
-
- if ( fd >= 0 ) {
- (void)drmClose(fd);
- }
-
- (void)XF86DRICloseConnection(dpy, scrn);
-
- if ( err_extra != NULL ) {
- fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg,
- err_extra);
- }
- else {
- fprintf(stderr, "libGL error: %s failed\n", err_msg );
- }
-
- fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n");
- }
-#endif /* !GLX_USE_APPLEGL */
-
- return psp;
-}
-#endif /* GLX_DIRECT_RENDERING */
-
-
-/*
-** Allocate the memory for the per screen configs for each screen.
-** If that works then fetch the per screen configs data.
-*/
-static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
-{
- xGLXGetVisualConfigsReq *req;
- xGLXGetFBConfigsReq *fb_req;
- xGLXVendorPrivateWithReplyReq *vpreq;
- xGLXGetFBConfigsSGIXReq *sgi_req;
- xGLXGetVisualConfigsReply reply;
- __GLXscreenConfigs *psc;
- __GLcontextModes *config;
- GLint i, j, nprops, screens;
- INT32 buf[__GLX_TOTAL_CONFIG], *props;
- unsigned supported_request = 0;
- unsigned prop_size;
-
- /*
- ** First allocate memory for the array of per screen configs.
- */
- screens = ScreenCount(dpy);
- psc = (__GLXscreenConfigs*) Xmalloc(screens * sizeof(__GLXscreenConfigs));
- if (!psc) {
- return GL_FALSE;
- }
- memset(psc, 0, screens * sizeof(__GLXscreenConfigs));
- priv->screenConfigs = psc;
-
- priv->serverGLXversion = __glXGetStringFromServer(dpy, priv->majorOpcode,
- X_GLXQueryServerString,
- 0, GLX_VERSION);
- if ( priv->serverGLXversion == NULL ) {
- FreeScreenConfigs(priv);
- return GL_FALSE;
- }
-
- if ( atof( priv->serverGLXversion ) >= 1.3 ) {
- supported_request = 1;
- }
-
- /*
- ** Now fetch each screens configs structures. If a screen supports
- ** GL (by returning a numVisuals > 0) then allocate memory for our
- ** config structure and then fill it in.
- */
- for (i = 0; i < screens; i++, psc++) {
- if ( supported_request != 1 ) {
- psc->serverGLXexts = __glXGetStringFromServer(dpy, priv->majorOpcode,
- X_GLXQueryServerString,
- i, GLX_EXTENSIONS);
- if ( strstr( psc->serverGLXexts, "GLX_SGIX_fbconfig" ) != NULL ) {
- supported_request = 2;
- }
- else {
- supported_request = 3;
- }
- }
-
-
- LockDisplay(dpy);
- switch( supported_request ) {
- case 1:
- GetReq(GLXGetFBConfigs,fb_req);
- fb_req->reqType = priv->majorOpcode;
- fb_req->glxCode = X_GLXGetFBConfigs;
- fb_req->screen = i;
- break;
-
- case 2:
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXGetFBConfigsSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq);
- sgi_req = (xGLXGetFBConfigsSGIXReq *) vpreq;
- sgi_req->reqType = priv->majorOpcode;
- sgi_req->glxCode = X_GLXVendorPrivateWithReply;
- sgi_req->vendorCode = X_GLXvop_GetFBConfigsSGIX;
- sgi_req->screen = i;
- break;
-
- case 3:
- GetReq(GLXGetVisualConfigs,req);
- req->reqType = priv->majorOpcode;
- req->glxCode = X_GLXGetVisualConfigs;
- req->screen = i;
- break;
- }
-
- if (!_XReply(dpy, (xReply*) &reply, 0, False)) {
- /* Something is busted. Punt. */
- UnlockDisplay(dpy);
- FreeScreenConfigs(priv);
- return GL_FALSE;
- }
-
- UnlockDisplay(dpy);
- if (!reply.numVisuals) {
- /* This screen does not support GL rendering */
- UnlockDisplay(dpy);
- continue;
- }
-
- /* FIXME: Is the __GLX_MIN_CONFIG_PROPS test correct for
- * FIXME: FBconfigs?
- */
- /* Check number of properties */
- nprops = reply.numProps;
- if ((nprops < __GLX_MIN_CONFIG_PROPS) ||
- (nprops > __GLX_MAX_CONFIG_PROPS)) {
- /* Huh? Not in protocol defined limits. Punt */
- UnlockDisplay(dpy);
- SyncHandle();
- FreeScreenConfigs(priv);
- return GL_FALSE;
- }
-
- /* Allocate memory for our config structure */
- psc->configs = _gl_context_modes_create(reply.numVisuals,
- sizeof(__GLcontextModes));
- if (!psc->configs) {
- UnlockDisplay(dpy);
- SyncHandle();
- FreeScreenConfigs(priv);
- return GL_FALSE;
- }
-
- /* Allocate memory for the properties, if needed */
- if ( supported_request != 3 ) {
- nprops *= 2;
- }
-
- prop_size = nprops * __GLX_SIZE_INT32;
-
- if (prop_size <= sizeof(buf)) {
- props = buf;
- } else {
- props = (INT32 *) Xmalloc(prop_size);
- }
-
- /* Read each config structure and convert it into our format */
- config = psc->configs;
- for (j = 0; j < reply.numVisuals; j++) {
- assert( config != NULL );
- _XRead(dpy, (char *)props, prop_size);
-
- if ( supported_request != 3 ) {
- config->rgbMode = GL_TRUE;
- config->drawableType = GLX_WINDOW_BIT;
- }
- else {
- config->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
- }
-
- __glXInitializeVisualConfigFromTags( config, nprops, props,
- (supported_request != 3),
- GL_TRUE );
- if ( config->fbconfigID == GLX_DONT_CARE ) {
- config->fbconfigID = config->visualID;
- }
- config->screen = i;
- config = config->next;
- }
- if (props != buf) {
- Xfree((char *)props);
- }
- UnlockDisplay(dpy);
-
-#ifdef GLX_DIRECT_RENDERING
- /* Initialize per screen dynamic client GLX extensions */
- psc->ext_list_first_time = GL_TRUE;
- /* Initialize the direct rendering per screen data and functions */
- if (priv->driDisplay.private != NULL) {
- /* FIXME: Should it be some sort of an error if createNewScreen[i]
- * FIXME: is NULL?
- */
- if (priv->driDisplay.createNewScreen &&
- priv->driDisplay.createNewScreen[i]) {
-
- psc->driScreen.screenConfigs = (void *)psc;
- psc->driScreen.private =
- CallCreateNewScreen(dpy, i, & psc->driScreen,
- & priv->driDisplay,
- priv->driDisplay.createNewScreen[i] );
- }
- }
-#endif
- }
- SyncHandle();
- return GL_TRUE;
-}
-
-/*
-** Initialize the client side extension code.
-*/
-__GLXdisplayPrivate *__glXInitialize(Display* dpy)
-{
- XExtDisplayInfo *info = __glXFindDisplay(dpy);
- XExtData **privList, *private, *found;
- __GLXdisplayPrivate *dpyPriv;
- XEDataObject dataObj;
- int major, minor;
-
-#if defined(USE_XTHREADS)
- {
- static int firstCall = 1;
- if (firstCall) {
- /* initialize the GLX mutexes */
- xmutex_init(&__glXmutex);
- firstCall = 0;
- }
- }
-#endif
-
- INIT_MESA_SPARC
- /* The one and only long long lock */
- __glXLock();
-
- if (!XextHasExtension(info)) {
- /* No GLX extension supported by this server. Oh well. */
- __glXUnlock();
- XMissingExtension(dpy, __glXExtensionName);
- return 0;
- }
-
- /* See if a display private already exists. If so, return it */
- dataObj.display = dpy;
- privList = XEHeadOfExtensionList(dataObj);
- found = XFindOnExtensionList(privList, info->codes->extension);
- if (found) {
- __glXUnlock();
- return (__GLXdisplayPrivate *) found->private_data;
- }
-
- /* See if the versions are compatible */
- if (!QueryVersion(dpy, info->codes->major_opcode, &major, &minor)) {
- /* The client and server do not agree on versions. Punt. */
- __glXUnlock();
- return 0;
- }
-
- /*
- ** Allocate memory for all the pieces needed for this buffer.
- */
- private = (XExtData *) Xmalloc(sizeof(XExtData));
- if (!private) {
- __glXUnlock();
- return 0;
- }
- dpyPriv = (__GLXdisplayPrivate *) Xmalloc(sizeof(__GLXdisplayPrivate));
- if (!dpyPriv) {
- __glXUnlock();
- Xfree((char*) private);
- return 0;
- }
-
- /*
- ** Init the display private and then read in the screen config
- ** structures from the server.
- */
- dpyPriv->majorOpcode = info->codes->major_opcode;
- dpyPriv->majorVersion = major;
- dpyPriv->minorVersion = minor;
- dpyPriv->dpy = dpy;
-
- dpyPriv->serverGLXvendor = 0x0;
- dpyPriv->serverGLXversion = 0x0;
-
-#ifdef GLX_DIRECT_RENDERING
- /*
- ** Initialize the direct rendering per display data and functions.
- ** Note: This _must_ be done before calling any other DRI routines
- ** (e.g., those called in AllocAndFetchScreenConfigs).
- */
- if (getenv("LIBGL_ALWAYS_INDIRECT")) {
- /* Assinging zero here assures we'll never go direct */
- dpyPriv->driDisplay.private = 0;
- dpyPriv->driDisplay.destroyDisplay = 0;
- }
- else {
- dpyPriv->driDisplay.private =
- driCreateDisplay(dpy, &dpyPriv->driDisplay);
- }
-#endif
-
- if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
- __glXUnlock();
- Xfree((char*) dpyPriv);
- Xfree((char*) private);
- return 0;
- }
-
- /*
- ** Fill in the private structure. This is the actual structure that
- ** hangs off of the Display structure. Our private structure is
- ** referred to by this structure. Got that?
- */
- private->number = info->codes->extension;
- private->next = 0;
- private->free_private = __glXFreeDisplayPrivate;
- private->private_data = (char *) dpyPriv;
- XAddToExtensionList(privList, private);
-
- if (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion >= 1) {
- __glXClientInfo(dpy, dpyPriv->majorOpcode);
- }
- __glXUnlock();
-
- return dpyPriv;
-}
-
-/*
-** Setup for sending a GLX command on dpy. Make sure the extension is
-** initialized. Try to avoid calling __glXInitialize as its kinda slow.
-*/
-CARD8 __glXSetupForCommand(Display *dpy)
-{
- GLXContext gc;
- __GLXdisplayPrivate *priv;
-
- /* If this thread has a current context, flush its rendering commands */
- gc = __glXGetCurrentContext();
- if (gc->currentDpy) {
- /* Flush rendering buffer of the current context, if any */
- (void) __glXFlushRenderBuffer(gc, gc->pc);
-
- if (gc->currentDpy == dpy) {
- /* Use opcode from gc because its right */
- INIT_MESA_SPARC
- return gc->majorOpcode;
- } else {
- /*
- ** Have to get info about argument dpy because it might be to
- ** a different server
- */
- }
- }
-
- /* Forced to lookup extension via the slow initialize route */
- priv = __glXInitialize(dpy);
- if (!priv) {
- return 0;
- }
- return priv->majorOpcode;
-}
-
-/**
- * Flush the drawing command transport buffer.
- *
- * \param ctx Context whose transport buffer is to be flushed.
- * \param pc Pointer to first unused buffer location.
- *
- * \todo
- * Modify this function to use \c ctx->pc instead of the explicit
- * \c pc parameter.
- */
-GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
-{
- Display * const dpy = ctx->currentDpy;
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
-#else
- xGLXRenderReq *req;
-#endif /* USE_XCB */
- const GLint size = pc - ctx->buf;
-
- if ( (dpy != NULL) && (size > 0) ) {
-#ifdef USE_XCB
- XCBGlxRender(c, ctx->currentContextTag, size, (char *)ctx->buf);
-#else
- /* Send the entire buffer as an X request */
- LockDisplay(dpy);
- GetReq(GLXRender,req);
- req->reqType = ctx->majorOpcode;
- req->glxCode = X_GLXRender;
- req->contextTag = ctx->currentContextTag;
- req->length += (size + 3) >> 2;
- _XSend(dpy, (char *)ctx->buf, size);
- UnlockDisplay(dpy);
- SyncHandle();
-#endif
- }
-
- /* Reset pointer and return it */
- ctx->pc = ctx->buf;
- return ctx->pc;
-}
-
-
-/**
- * Send a portion of a GLXRenderLarge command to the server. The advantage of
- * this function over \c __glXSendLargeCommand is that callers can use the
- * data buffer in the GLX context and may be able to avoid allocating an
- * extra buffer. The disadvantage is the clients will have to do more
- * GLX protocol work (i.e., calculating \c totalRequests, etc.).
- *
- * \sa __glXSendLargeCommand
- *
- * \param gc GLX context
- * \param requestNumber Which part of the whole command is this? The first
- * request is 1.
- * \param totalRequests How many requests will there be?
- * \param data Command data.
- * \param dataLen Size, in bytes, of the command data.
- */
-void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
- GLint totalRequests,
- const GLvoid * data, GLint dataLen)
-{
- Display *dpy = gc->currentDpy;
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- XCBGlxRenderLarge(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data);
-#else
- xGLXRenderLargeReq *req;
-
- if ( requestNumber == 1 ) {
- LockDisplay(dpy);
- }
-
- GetReq(GLXRenderLarge,req);
- req->reqType = gc->majorOpcode;
- req->glxCode = X_GLXRenderLarge;
- req->contextTag = gc->currentContextTag;
- req->length += (dataLen + 3) >> 2;
- req->requestNumber = requestNumber;
- req->requestTotal = totalRequests;
- req->dataBytes = dataLen;
- Data(dpy, data, dataLen);
-
- if ( requestNumber == totalRequests ) {
- UnlockDisplay(dpy);
- SyncHandle();
- }
-#endif /* USE_XCB */
-}
-
-
-/**
- * Send a command that is too large for the GLXRender protocol request.
- *
- * Send a large command, one that is too large for some reason to
- * send using the GLXRender protocol request. One reason to send
- * a large command is to avoid copying the data.
- *
- * \param ctx GLX context
- * \param header Header data.
- * \param headerLen Size, in bytes, of the header data. It is assumed that
- * the header data will always be small enough to fit in
- * a single X protocol packet.
- * \param data Command data.
- * \param dataLen Size, in bytes, of the command data.
- */
-void __glXSendLargeCommand(__GLXcontext *ctx,
- const GLvoid *header, GLint headerLen,
- const GLvoid *data, GLint dataLen)
-{
- GLint maxSize;
- GLint totalRequests, requestNumber;
-
- /*
- ** Calculate the maximum amount of data can be stuffed into a single
- ** packet. sz_xGLXRenderReq is added because bufSize is the maximum
- ** packet size minus sz_xGLXRenderReq.
- */
- maxSize = (ctx->bufSize + sz_xGLXRenderReq) - sz_xGLXRenderLargeReq;
- totalRequests = 1 + (dataLen / maxSize);
- if (dataLen % maxSize) totalRequests++;
-
- /*
- ** Send all of the command, except the large array, as one request.
- */
- assert( headerLen <= maxSize );
- __glXSendLargeChunk(ctx, 1, totalRequests, header, headerLen);
-
- /*
- ** Send enough requests until the whole array is sent.
- */
- for ( requestNumber = 2 ; requestNumber <= (totalRequests - 1) ; requestNumber++ ) {
- __glXSendLargeChunk(ctx, requestNumber, totalRequests, data, maxSize);
- data = (const GLvoid *) (((const GLubyte *) data) + maxSize);
- dataLen -= maxSize;
- assert( dataLen > 0 );
- }
-
- assert( dataLen <= maxSize );
- __glXSendLargeChunk(ctx, requestNumber, totalRequests, data, dataLen);
-}
-
-/************************************************************************/
-
-GLXContext glXGetCurrentContext(void)
-{
- GLXContext cx = __glXGetCurrentContext();
-
- if (cx == &dummyContext) {
- return NULL;
- } else {
- return cx;
- }
-}
-
-GLXDrawable glXGetCurrentDrawable(void)
-{
- GLXContext gc = __glXGetCurrentContext();
- return gc->currentDrawable;
-}
-
-
-/************************************************************************/
-
-#ifdef GLX_DIRECT_RENDERING
-/* Return the DRI per screen structure */
-__DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn)
-{
- __DRIscreen *pDRIScreen = NULL;
- XExtDisplayInfo *info = __glXFindDisplay(dpy);
- XExtData **privList, *found;
- __GLXdisplayPrivate *dpyPriv;
- XEDataObject dataObj;
-
- __glXLock();
- dataObj.display = dpy;
- privList = XEHeadOfExtensionList(dataObj);
- found = XFindOnExtensionList(privList, info->codes->extension);
- __glXUnlock();
-
- if (found) {
- dpyPriv = (__GLXdisplayPrivate *)found->private_data;
- pDRIScreen = &dpyPriv->screenConfigs[scrn].driScreen;
- }
-
- return pDRIScreen;
-}
-#endif
-
-/************************************************************************/
-
-static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
- GLXContextID gc, GLXContextTag old_gc, GLXDrawable draw, GLXDrawable read,
- xGLXMakeCurrentReply * reply );
-
-/**
- * Sends a GLX protocol message to the specified display to make the context
- * and the drawables current.
- *
- * \param dpy Display to send the message to.
- * \param opcode Major opcode value for the display.
- * \param gc_id Context tag for the context to be made current.
- * \param draw Drawable ID for the "draw" drawable.
- * \param read Drawable ID for the "read" drawable.
- * \param reply Space to store the X-server's reply.
- *
- * \warning
- * This function assumes that \c dpy is locked with \c LockDisplay on entry.
- */
-static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
- GLXContextID gc_id, GLXContextTag gc_tag,
- GLXDrawable draw, GLXDrawable read,
- xGLXMakeCurrentReply * reply )
-{
- if ( draw == read ) {
- xGLXMakeCurrentReq *req;
-
- GetReq(GLXMakeCurrent,req);
- req->reqType = opcode;
- req->glxCode = X_GLXMakeCurrent;
- req->drawable = draw;
- req->context = gc_id;
- req->oldContextTag = gc_tag;
- }
- else {
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
-
- /* If the server can support the GLX 1.3 version, we should
- * perfer that. Not only that, some servers support GLX 1.3 but
- * not the SGI extension.
- */
-
- if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
- xGLXMakeContextCurrentReq *req;
-
- GetReq(GLXMakeContextCurrent,req);
- req->reqType = opcode;
- req->glxCode = X_GLXMakeContextCurrent;
- req->drawable = draw;
- req->readdrawable = read;
- req->context = gc_id;
- req->oldContextTag = gc_tag;
- }
- else {
- xGLXVendorPrivateWithReplyReq *vpreq;
- xGLXMakeCurrentReadSGIReq *req;
-
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXMakeCurrentReadSGIReq-sz_xGLXVendorPrivateWithReplyReq,vpreq);
- req = (xGLXMakeCurrentReadSGIReq *)vpreq;
- req->reqType = opcode;
- req->glxCode = X_GLXVendorPrivateWithReply;
- req->vendorCode = X_GLXvop_MakeCurrentReadSGI;
- req->drawable = draw;
- req->readable = read;
- req->context = gc_id;
- req->oldContextTag = gc_tag;
- }
- }
-
- return _XReply(dpy, (xReply*) reply, 0, False);
-}
-
-
-#ifdef GLX_DIRECT_RENDERING
-static Bool BindContextWrapper( Display *dpy, GLXContext gc,
- GLXDrawable draw, GLXDrawable read )
-{
- return (*gc->driContext.bindContext)(dpy, gc->screen, draw, read,
- & gc->driContext);
-}
-
-
-static Bool UnbindContextWrapper( GLXContext gc )
-{
- return (*gc->driContext.unbindContext)(gc->currentDpy, gc->screen,
- gc->currentDrawable,
- gc->currentReadable,
- & gc->driContext );
-}
-#endif /* GLX_DIRECT_RENDERING */
-
-
-/*
-** Make a particular context current.
-** NOTE: this is in this file so that it can access dummyContext.
-*/
-USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
- GLXDrawable read, GLXContext gc)
-{
- xGLXMakeCurrentReply reply;
- GLXContext oldGC;
- CARD8 opcode, oldOpcode;
- Bool sentRequestToOldDpy = False;
- Bool bindReturnValue = True;
-
- opcode = __glXSetupForCommand(dpy);
- if (!opcode) {
- return GL_FALSE;
- }
-
- /*
- ** Make sure that the new context has a nonzero ID. In the request,
- ** a zero context ID is used only to mean that we bind to no current
- ** context.
- */
- if ((gc != NULL) && (gc->xid == None)) {
- return GL_FALSE;
- }
-
- oldGC = __glXGetCurrentContext();
- oldOpcode = (gc == oldGC) ? opcode : __glXSetupForCommand(dpy);
- if (!oldOpcode) {
- return GL_FALSE;
- }
-
- if ((dpy != oldGC->currentDpy || (gc && gc->isDirect)) &&
- !oldGC->isDirect && oldGC != &dummyContext) {
- /*
- ** We are either switching from one dpy to another and have to
- ** send a request to the previous dpy to unbind the previous
- ** context, or we are switching away from a indirect context to
- ** a direct context and have to send a request to the dpy to
- ** unbind the previous context.
- */
- sentRequestToOldDpy = True;
- LockDisplay(oldGC->currentDpy);
- if ( ! SendMakeCurrentRequest( oldGC->currentDpy, oldOpcode, None,
- oldGC->currentContextTag, None, None,
- &reply ) ) {
- /* The make current failed. Just return GL_FALSE. */
- UnlockDisplay(oldGC->currentDpy);
- SyncHandle();
- return GL_FALSE;
- }
-
- oldGC->currentContextTag = 0;
- }
-
- _glapi_check_multithread();
-
-#ifdef GLX_DIRECT_RENDERING
- /* Unbind the old direct rendering context */
- if (oldGC->isDirect) {
- if (oldGC->driContext.private) {
- if (! UnbindContextWrapper( oldGC )) {
- /* The make current failed. Just return GL_FALSE. */
- return GL_FALSE;
- }
- }
- oldGC->currentContextTag = 0;
- }
-
- /* Bind the direct rendering context to the drawable */
- if (gc && gc->isDirect) {
- if (gc->driContext.private) {
- bindReturnValue = BindContextWrapper( dpy, gc, draw, read );
- }
- } else {
-#endif
- /* Send a glXMakeCurrent request to bind the new context. */
- LockDisplay(dpy);
-
- bindReturnValue = SendMakeCurrentRequest( dpy, opcode,
- gc ? gc->xid : None,
- oldGC->currentContextTag,
- draw, read, &reply );
- UnlockDisplay(dpy);
-#ifdef GLX_DIRECT_RENDERING
- }
-#endif
-
-
- if (!bindReturnValue) {
- /* The make current failed. */
- if (gc && !gc->isDirect) {
- SyncHandle();
- }
-
-#ifdef GLX_DIRECT_RENDERING
- /* If the old context was direct rendering, then re-bind to it. */
- if (oldGC->isDirect) {
- if (oldGC->driContext.private) {
- if (! BindContextWrapper( oldGC->currentDpy, oldGC,
- oldGC->currentDrawable,
- oldGC->currentReadable )) {
- /*
- ** The request failed; this cannot happen with the
- ** current API. If in the future the API is
- ** extended to allow context sharing between
- ** clients, then this may fail (because another
- ** client may have grabbed the context); in that
- ** case, we cannot undo the previous request, and
- ** cannot adhere to the "no-op" behavior.
- */
- }
- }
- } else
-#endif
- /*
- ** If we had just sent a request to a previous dpy, we have to
- ** undo that request (because if a command fails, it should act
- ** like a no-op) by making current to the previous context and
- ** drawable.
- */
- if (sentRequestToOldDpy) {
- if ( !SendMakeCurrentRequest( oldGC->currentDpy, oldOpcode,
- oldGC->xid, 0,
- oldGC->currentDrawable,
- oldGC->currentReadable, &reply ) ) {
- UnlockDisplay(oldGC->currentDpy);
- SyncHandle();
- /*
- ** The request failed; this cannot happen with the
- ** current API. If in the future the API is extended to
- ** allow context sharing between clients, then this may
- ** fail (because another client may have grabbed the
- ** context); in that case, we cannot undo the previous
- ** request, and cannot adhere to the "no-op" behavior.
- */
- }
- else {
- UnlockDisplay(oldGC->currentDpy);
- }
- oldGC->currentContextTag = reply.contextTag;
- }
- return GL_FALSE;
- }
-
- /* Update our notion of what is current */
- __glXLock();
- if (gc == oldGC) {
- /*
- ** Even though the contexts are the same the drawable might have
- ** changed. Note that gc cannot be the dummy, and that oldGC
- ** cannot be NULL, therefore if they are the same, gc is not
- ** NULL and not the dummy.
- */
- gc->currentDrawable = draw;
- gc->currentReadable = read;
- } else {
- if (oldGC != &dummyContext) {
- /* Old current context is no longer current to anybody */
- oldGC->currentDpy = 0;
- oldGC->currentDrawable = None;
- oldGC->currentReadable = None;
- oldGC->currentContextTag = 0;
-
- if (oldGC->xid == None) {
- /*
- ** We are switching away from a context that was
- ** previously destroyed, so we need to free the memory
- ** for the old handle.
- */
-#ifdef GLX_DIRECT_RENDERING
- /* Destroy the old direct rendering context */
- if (oldGC->isDirect) {
- if (oldGC->driContext.private) {
- (*oldGC->driContext.destroyContext)
- (dpy, oldGC->screen, oldGC->driContext.private);
- oldGC->driContext.private = NULL;
- }
- }
-#endif
- __glXFreeContext(oldGC);
- }
- }
- if (gc) {
- __glXSetCurrentContext(gc);
-#ifdef GLX_DIRECT_RENDERING
- if (!gc->isDirect) {
- if (!IndirectAPI)
- IndirectAPI = __glXNewIndirectAPI();
- _glapi_set_dispatch(IndirectAPI);
-# ifdef GLX_USE_APPLEGL
- do {
- extern void XAppleDRIUseIndirectDispatch(void);
- XAppleDRIUseIndirectDispatch();
- } while (0);
-# endif
- }
-#else
- /* if not direct rendering, always need indirect dispatch */
- if (!IndirectAPI)
- IndirectAPI = __glXNewIndirectAPI();
- _glapi_set_dispatch(IndirectAPI);
-#endif
- gc->currentDpy = dpy;
- gc->currentDrawable = draw;
- gc->currentReadable = read;
-
- if ( ! gc->isDirect ) {
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
-
- gc->currentContextTag = reply.contextTag;
- if ( state->array_state == NULL ) {
- (void) glGetString( GL_EXTENSIONS );
- (void) glGetString( GL_VERSION );
- __glXInitVertexArrayState(gc);
- }
- }
- else {
- gc->currentContextTag = -1;
- }
- } else {
- __glXSetCurrentContext(&dummyContext);
-#ifdef GLX_DIRECT_RENDERING
- _glapi_set_dispatch(NULL); /* no-op functions */
-#endif
- }
- }
- __glXUnlock();
- return GL_TRUE;
-}
-
-
-PUBLIC Bool glXMakeCurrent(Display *dpy, GLXDrawable draw, GLXContext gc)
-{
- return MakeContextCurrent( dpy, draw, draw, gc );
-}
-
-PUBLIC GLX_ALIAS(Bool, glXMakeCurrentReadSGI,
- (Display *dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx),
- (dpy, d, r, ctx), MakeContextCurrent)
-
-PUBLIC GLX_ALIAS(Bool, glXMakeContextCurrent,
- (Display *dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx),
- (dpy, d, r, ctx), MakeContextCurrent)
-
-
-#ifdef DEBUG
-void __glXDumpDrawBuffer(__GLXcontext *ctx)
-{
- GLubyte *p = ctx->buf;
- GLubyte *end = ctx->pc;
- GLushort opcode, length;
-
- while (p < end) {
- /* Fetch opcode */
- opcode = *((GLushort*) p);
- length = *((GLushort*) (p + 2));
- printf("%2x: %5d: ", opcode, length);
- length -= 4;
- p += 4;
- while (length > 0) {
- printf("%08x ", *((unsigned *) p));
- p += 4;
- length -= 4;
- }
- printf("\n");
- }
-}
-#endif
-
-#ifdef USE_SPARC_ASM
-/*
- * Used only when we are sparc, using sparc assembler.
- *
- */
-
-static void
-_glx_mesa_init_sparc_glapi_relocs(void)
-{
- unsigned int *insn_ptr, *end_ptr;
- unsigned long disp_addr;
-
- insn_ptr = &_mesa_sparc_glapi_begin;
- end_ptr = &_mesa_sparc_glapi_end;
- disp_addr = (unsigned long) &_glapi_Dispatch;
-
- /*
- * Verbatim from Mesa sparc.c. It's needed because there doesn't
- * seem to be a better way to do this:
- *
- * UNCONDITIONAL_JUMP ( (*_glapi_Dispatch) + entry_offset )
- *
- * This code is patching in the ADDRESS of the pointer to the
- * dispatch table. Hence, it must be called exactly once, because
- * that address is not going to change.
- *
- * What it points to can change, but Mesa (and hence, we) assume
- * that there is only one pointer.
- *
- */
- while (insn_ptr < end_ptr) {
-#if ( defined(__sparc_v9__) && ( !defined(__linux__) || defined(__linux_64__) ) )
-/*
- This code patches for 64-bit addresses. This had better
- not happen for Sparc/Linux, no matter what architecture we
- are building for. So, don't do this.
-
- The 'defined(__linux_64__)' is used here as a placeholder for
- when we do do 64-bit usermode on sparc linux.
- */
- insn_ptr[0] |= (disp_addr >> (32 + 10));
- insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10);
- __glapi_sparc_icache_flush(&insn_ptr[0]);
- insn_ptr[2] |= ((disp_addr >> 32) & ((1 << 10) - 1));
- insn_ptr[3] |= (disp_addr & ((1 << 10) - 1));
- __glapi_sparc_icache_flush(&insn_ptr[2]);
- insn_ptr += 11;
-#else
- insn_ptr[0] |= (disp_addr >> 10);
- insn_ptr[1] |= (disp_addr & ((1 << 10) - 1));
- __glapi_sparc_icache_flush(&insn_ptr[0]);
- insn_ptr += 5;
-#endif
- }
-}
-#endif /* sparc ASM in use */
-
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glxextensions.c b/nx-X11/extras/Mesa/src/glx/x11/glxextensions.c
deleted file mode 100644
index d2597981c..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glxextensions.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * (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
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file glxextensions.c
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "glxclient.h"
-#include <X11/extensions/extutil.h>
-#include <X11/extensions/Xext.h>
-#include <string.h>
-#include "glapi.h"
-#include "glxextensions.h"
-#include "simple_list.h"
-
-#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8)))
-#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8)))
-#define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0)
-#define CONCAT(a,b) a ## b
-#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit)
-#define GL(n) "GL_" # n, 3 + sizeof( # n ) - 1, GL_ ## n ## _bit
-#define VER(a,b) a, b
-#define Y 1
-#define N 0
-#define EXT_ENABLED(bit,supported) (IS_SET( supported, bit ))
-
-
-struct extension_info {
- const char * const name;
- unsigned name_len;
-
- unsigned char bit;
-
- /* This is the lowest version of GLX that "requires" this extension.
- * For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and
- * SGI_make_current_read. If the extension is not required by any known
- * version of GLX, use 0, 0.
- */
- unsigned char version_major;
- unsigned char version_minor;
- unsigned char client_support;
- unsigned char direct_support;
- unsigned char client_only; /** Is the extension client-side only? */
- unsigned char direct_only; /** Is the extension for direct
- * contexts only?
- */
-};
-
-static const struct extension_info known_glx_extensions[] = {
- { GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N },
- { GLX(ARB_multisample), VER(1,4), Y, Y, N, N },
- { GLX(ARB_render_texture), VER(0,0), N, N, N, N },
- { GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N },
- { GLX(EXT_import_context), VER(0,0), Y, Y, N, N },
- { GLX(EXT_visual_info), VER(0,0), Y, Y, N, N },
- { GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N },
- { GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */
- { GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y },
- { GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N }, /* Deprecated? */
- { GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */
- { GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */
- { GLX(MESA_set_3dfx_mode), VER(0,0), N, N, N, N }, /* Deprecated */
- { GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
- { GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y },
- { GLX(NV_float_buffer), VER(0,0), N, N, N, N },
- { GLX(NV_render_depth_texture), VER(0,0), N, N, N, N },
- { GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N },
- { GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */
- { GLX(OML_swap_method), VER(0,0), Y, Y, N, N },
- { GLX(OML_sync_control), VER(0,0), Y, N, N, Y },
- { GLX(SGI_cushion), VER(0,0), N, N, N, N },
- { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N },
- { GLX(SGI_swap_control), VER(0,0), Y, N, N, N },
- { GLX(SGI_video_sync), VER(0,0), Y, N, N, Y },
- { GLX(SGIS_blended_overlay), VER(0,0), N, N, N, N },
- { GLX(SGIS_color_range), VER(0,0), N, N, N, N },
- { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
- { GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N },
- { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N },
- { GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N },
- { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N },
- { GLX(SGIX_swap_group), VER(0,0), N, N, N, N },
- { GLX(SGIX_video_resize), VER(0,0), N, N, N, N },
- { GLX(SGIX_video_source), VER(0,0), N, N, N, N },
- { GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N },
- { GLX(SUN_get_transparent_index), VER(0,0), N, N, N, N },
- { NULL }
-};
-
-static const struct extension_info known_gl_extensions[] = {
- { GL(ARB_depth_texture), VER(1,4), Y, N, N, N },
- { GL(ARB_draw_buffers), VER(0,0), Y, N, N, N },
- { GL(ARB_fragment_program), VER(0,0), Y, N, N, N },
- { GL(ARB_fragment_program_shadow), VER(0,0), Y, N, N, N },
- { GL(ARB_imaging), VER(0,0), Y, N, N, N },
- { GL(ARB_multisample), VER(1,3), Y, N, N, N },
- { GL(ARB_multitexture), VER(1,3), Y, N, N, N },
- { GL(ARB_occlusion_query), VER(1,5), Y, N, N, N },
- { GL(ARB_point_parameters), VER(1,4), Y, N, N, N },
- { GL(ARB_point_sprite), VER(0,0), Y, N, N, N },
- { GL(ARB_shadow), VER(1,4), Y, N, N, N },
- { GL(ARB_shadow_ambient), VER(0,0), Y, N, N, N },
- { GL(ARB_texture_border_clamp), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_compression), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_cube_map), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_env_add), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_env_combine), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_env_crossbar), VER(1,4), Y, N, N, N },
- { GL(ARB_texture_env_dot3), VER(1,3), Y, N, N, N },
- { GL(ARB_texture_mirrored_repeat), VER(1,4), Y, N, N, N },
- { GL(ARB_texture_non_power_of_two), VER(1,5), Y, N, N, N },
- { GL(ARB_texture_rectangle), VER(0,0), Y, N, N, N },
- { GL(ARB_transpose_matrix), VER(1,3), Y, N, Y, N },
- { GL(ARB_vertex_buffer_object), VER(1,5), N, N, N, N },
- { GL(ARB_vertex_program), VER(0,0), Y, N, N, N },
- { GL(ARB_window_pos), VER(1,4), Y, N, N, N },
- { GL(EXT_abgr), VER(0,0), Y, N, N, N },
- { GL(EXT_bgra), VER(1,2), Y, N, N, N },
- { GL(EXT_blend_color), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_equation_separate), VER(0,0), N, N, N, N },
- { GL(EXT_blend_func_separate), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_logic_op), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_minmax), VER(1,4), Y, N, N, N },
- { GL(EXT_blend_subtract), VER(1,4), Y, N, N, N },
- { GL(EXT_clip_volume_hint), VER(0,0), Y, N, N, N },
- { GL(EXT_compiled_vertex_array), VER(0,0), N, N, N, N },
- { GL(EXT_convolution), VER(0,0), N, N, N, N },
- { GL(EXT_copy_texture), VER(1,1), Y, N, N, N },
- { GL(EXT_cull_vertex), VER(0,0), N, N, N, N },
- { GL(EXT_depth_bounds_test), VER(0,0), N, N, N, N },
- { GL(EXT_draw_range_elements), VER(1,2), Y, N, Y, N },
- { GL(EXT_fog_coord), VER(1,4), Y, N, N, N },
- { GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N },
- { GL(EXT_packed_pixels), VER(1,2), Y, N, N, N },
- { GL(EXT_paletted_texture), VER(0,0), Y, N, N, N },
- { GL(EXT_pixel_buffer_object), VER(0,0), N, N, N, N },
- { GL(EXT_point_parameters), VER(1,4), Y, N, N, N },
- { GL(EXT_polygon_offset), VER(1,1), Y, N, N, N },
- { GL(EXT_rescale_normal), VER(1,2), Y, N, N, N },
- { GL(EXT_secondary_color), VER(1,4), Y, N, N, N },
- { GL(EXT_separate_specular_color), VER(1,2), Y, N, N, N },
- { GL(EXT_shadow_funcs), VER(1,5), Y, N, N, N },
- { GL(EXT_shared_texture_palette), VER(0,0), Y, N, N, N },
- { GL(EXT_stencil_two_side), VER(0,0), Y, N, N, N },
- { GL(EXT_stencil_wrap), VER(1,4), Y, N, N, N },
- { GL(EXT_subtexture), VER(1,1), Y, N, N, N },
- { GL(EXT_texture), VER(1,1), Y, N, N, N },
- { GL(EXT_texture3D), VER(1,2), Y, N, N, N },
- { GL(EXT_texture_compression_dxt1), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_compression_s3tc), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_edge_clamp), VER(1,2), Y, N, N, N },
- { GL(EXT_texture_env_add), VER(1,3), Y, N, N, N },
- { GL(EXT_texture_env_combine), VER(1,3), Y, N, N, N },
- { GL(EXT_texture_env_dot3), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_filter_anisotropic), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_lod), VER(1,2), Y, N, N, N },
- { GL(EXT_texture_lod_bias), VER(1,4), Y, N, N, N },
- { GL(EXT_texture_mirror_clamp), VER(0,0), Y, N, N, N },
- { GL(EXT_texture_object), VER(1,1), Y, N, N, N },
- { GL(EXT_texture_rectangle), VER(0,0), Y, N, N, N },
- { GL(EXT_vertex_array), VER(0,0), Y, N, N, N },
- { GL(3DFX_texture_compression_FXT1), VER(0,0), Y, N, N, N },
- { GL(APPLE_packed_pixels), VER(1,2), Y, N, N, N },
- { GL(APPLE_ycbcr_422), VER(0,0), Y, N, N, N },
- { GL(ATI_draw_buffers), VER(0,0), Y, N, N, N },
- { GL(ATI_text_fragment_shader), VER(0,0), Y, N, N, N },
- { GL(ATI_texture_env_combine3), VER(0,0), Y, N, N, N },
- { GL(ATI_texture_float), VER(0,0), Y, N, N, N },
- { GL(ATI_texture_mirror_once), VER(0,0), Y, N, N, N },
- { GL(ATIX_texture_env_combine3), VER(0,0), Y, N, N, N },
- { GL(HP_convolution_border_modes), VER(0,0), Y, N, N, N },
- { GL(HP_occlusion_test), VER(0,0), Y, N, N, N },
- { GL(IBM_cull_vertex), VER(0,0), Y, N, N, N },
- { GL(IBM_pixel_filter_hint), VER(0,0), Y, N, N, N },
- { GL(IBM_rasterpos_clip), VER(0,0), Y, N, N, N },
- { GL(IBM_texture_clamp_nodraw), VER(0,0), Y, N, N, N },
- { GL(IBM_texture_mirrored_repeat), VER(0,0), Y, N, N, N },
- { GL(INGR_blend_func_separate), VER(0,0), Y, N, N, N },
- { GL(INGR_interlace_read), VER(0,0), Y, N, N, N },
- { GL(MESA_pack_invert), VER(0,0), Y, N, N, N },
- { GL(MESA_ycbcr_texture), VER(0,0), Y, N, N, N },
- { GL(NV_blend_square), VER(1,4), Y, N, N, N },
- { GL(NV_copy_depth_to_color), VER(0,0), Y, N, N, N },
- { GL(NV_depth_clamp), VER(0,0), Y, N, N, N },
- { GL(NV_fog_distance), VER(0,0), Y, N, N, N },
- { GL(NV_fragment_program), VER(0,0), Y, N, N, N },
- { GL(NV_fragment_program_option), VER(0,0), Y, N, N, N },
- { GL(NV_fragment_program2), VER(0,0), Y, N, N, N },
- { GL(NV_light_max_exponent), VER(0,0), Y, N, N, N },
- { GL(NV_multisample_filter_hint), VER(0,0), Y, N, N, N },
- { GL(NV_point_sprite), VER(0,0), Y, N, N, N },
- { GL(NV_texgen_reflection), VER(0,0), Y, N, N, N },
- { GL(NV_texture_compression_vtc), VER(0,0), Y, N, N, N },
- { GL(NV_texture_env_combine4), VER(0,0), Y, N, N, N },
- { GL(NV_texture_rectangle), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program1_1), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program2), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program2_option), VER(0,0), Y, N, N, N },
- { GL(NV_vertex_program3), VER(0,0), Y, N, N, N },
- { GL(OES_read_format), VER(0,0), Y, N, N, N },
- { GL(OES_compressed_paletted_texture),VER(0,0), Y, N, N, N },
- { GL(SGI_color_matrix), VER(0,0), Y, N, N, N },
- { GL(SGI_texture_color_table), VER(0,0), Y, N, N, N },
- { GL(SGIS_generate_mipmap), VER(1,4), Y, N, N, N },
- { GL(SGIS_multisample), VER(0,0), Y, N, N, N },
- { GL(SGIS_texture_border_clamp), VER(1,3), Y, N, N, N },
- { GL(SGIS_texture_edge_clamp), VER(1,2), Y, N, N, N },
- { GL(SGIS_texture_lod), VER(1,2), Y, N, N, N },
- { GL(SGIX_blend_alpha_minmax), VER(0,0), Y, N, N, N },
- { GL(SGIX_clipmap), VER(0,0), Y, N, N, N },
- { GL(SGIX_depth_texture), VER(0,0), Y, N, N, N },
- { GL(SGIX_fog_offset), VER(0,0), Y, N, N, N },
- { GL(SGIX_shadow), VER(0,0), Y, N, N, N },
- { GL(SGIX_shadow_ambient), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_coordinate_clamp), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_lod_bias), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_range), VER(0,0), Y, N, N, N },
- { GL(SGIX_texture_scale_bias), VER(0,0), Y, N, N, N },
- { GL(SGIX_vertex_preclip), VER(0,0), Y, N, N, N },
- { GL(SGIX_vertex_preclip_hint), VER(0,0), Y, N, N, N },
- { GL(SGIX_ycrcb), VER(0,0), Y, N, N, N },
- { GL(SUN_convolution_border_modes), VER(0,0), Y, N, N, N },
- { GL(SUN_multi_draw_arrays), VER(0,0), Y, N, Y, N },
- { GL(SUN_slice_accum), VER(0,0), Y, N, N, N },
- { NULL }
-};
-
-
-/* global bit-fields of available extensions and their characteristics */
-static unsigned char client_glx_support[8];
-static unsigned char client_glx_only[8];
-static unsigned char direct_glx_only[8];
-static unsigned char client_gl_support[ __GL_EXT_BYTES ];
-static unsigned char client_gl_only[ __GL_EXT_BYTES ];
-
-/**
- * Bits representing the set of extensions that are enabled by default in all
- * direct rendering drivers.
- */
-static unsigned char direct_glx_support[8];
-
-/**
- * Highest core GL version that can be supported for indirect rendering.
- */
-static const unsigned gl_major = 1;
-static const unsigned gl_minor = 4;
-
-/* client extensions string */
-static const char * __glXGLXClientExtensions = NULL;
-
-static void __glXExtensionsCtr( void );
-static void __glXExtensionsCtrScreen( __GLXscreenConfigs *psc );
-static void __glXProcessServerString( const struct extension_info * ext,
- const char * server_string, unsigned char * server_support );
-
-/**
- * Set the state of a GLX extension.
- *
- * \param name Name of the extension.
- * \param name_len Length, in characters, of the extension name.
- * \param state New state (either enabled or disabled) of the extension.
- * \param supported Table in which the state of the extension is to be set.
- */
-static void
-set_glx_extension( const struct extension_info * ext,
- const char * name, unsigned name_len, GLboolean state,
- unsigned char * supported )
-{
- unsigned i;
-
-
- for ( i = 0 ; ext[i].name != NULL ; i++ ) {
- if ( (name_len == ext[i].name_len)
- && (strncmp( ext[i].name, name, name_len ) == 0) ) {
- if ( state ) {
- SET_BIT( supported, ext[i].bit );
- }
- else {
- CLR_BIT( supported, ext[i].bit );
- }
-
- return;
- }
- }
-}
-
-
-#define NUL '\0'
-#define SEPARATOR ' '
-
-/**
- * Convert the server's extension string to a bit-field.
- *
- * \param server_string GLX extension string from the server.
- * \param server_support Bit-field of supported extensions.
- */
-static void
-__glXProcessServerString( const struct extension_info * ext,
- const char * server_string,
- unsigned char * server_support )
-{
- unsigned base;
- unsigned len;
-
- (void) memset( server_support, 0, sizeof( server_support ) );
-
- for ( base = 0 ; server_string[ base ] != NUL ; /* empty */ ) {
- /* Determine the length of the next extension name.
- */
- for ( len = 0
- ; (server_string[ base + len ] != SEPARATOR)
- && (server_string[ base + len ] != NUL)
- ; len++ ) {
- /* empty */
- }
-
- /* Set the bit for the extension in the server_support table.
- */
- set_glx_extension( ext, & server_string[ base ], len, GL_TRUE,
- server_support );
-
-
- /* Advance to the next extension string. This means that we skip
- * over the previous string and any trialing white-space.
- */
- for ( base += len ;
- (server_string[ base ] == SEPARATOR)
- && (server_string[ base ] != NUL)
- ; base++ ) {
- /* empty */
- }
- }
-}
-
-
-/**
- * Enable a named GLX extension on a given screen.
- * Drivers should not call this function directly. They should instead use
- * \c glXGetProcAddress to obtain a pointer to the function.
- *
- * \param psc Pointer to GLX per-screen record.
- * \param name Name of the extension to enable.
- *
- * \sa glXGetProcAddress
- *
- * \since Internal API version 20030813.
- */
-void
-__glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name )
-{
- __glXExtensionsCtr();
- __glXExtensionsCtrScreen(psc);
- set_glx_extension( known_glx_extensions, name, strlen( name ), GL_TRUE,
- psc->direct_support );
-}
-
-
-/**
- * Initialize global extension support tables.
- */
-
-static void
-__glXExtensionsCtr( void )
-{
- unsigned i;
- static GLboolean ext_list_first_time = GL_TRUE;
-
-
- if ( ext_list_first_time ) {
- ext_list_first_time = GL_FALSE;
-
- (void) memset( client_glx_support, 0, sizeof( client_glx_support ) );
- (void) memset( direct_glx_support, 0, sizeof( direct_glx_support ) );
- (void) memset( client_glx_only, 0, sizeof( client_glx_only ) );
- (void) memset( direct_glx_only, 0, sizeof( direct_glx_only ) );
-
- (void) memset( client_gl_support, 0, sizeof( client_gl_support ) );
- (void) memset( client_gl_only, 0, sizeof( client_gl_only ) );
-
- for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) {
- const unsigned bit = known_glx_extensions[i].bit;
-
- if ( known_glx_extensions[i].client_support ) {
- SET_BIT( client_glx_support, bit );
- }
-
- if ( known_glx_extensions[i].direct_support ) {
- SET_BIT( direct_glx_support, bit );
- }
-
- if ( known_glx_extensions[i].client_only ) {
- SET_BIT( client_glx_only, bit );
- }
-
- if ( known_glx_extensions[i].direct_only ) {
- SET_BIT( direct_glx_only, bit );
- }
- }
-
- for ( i = 0 ; known_gl_extensions[i].name != NULL ; i++ ) {
- const unsigned bit = known_gl_extensions[i].bit;
-
- if ( known_gl_extensions[i].client_support ) {
- SET_BIT( client_gl_support, bit );
- }
-
- if ( known_gl_extensions[i].client_only ) {
- SET_BIT( client_gl_only, bit );
- }
- }
-
-#if 0
- fprintf( stderr, "[%s:%u] Maximum client library version: %u.%u\n",
- __func__, __LINE__, gl_major, gl_minor );
-#endif
- }
-}
-
-
-/**
- * Make sure that per-screen direct-support table is initialized.
- *
- * \param psc Pointer to GLX per-screen record.
- */
-
-static void
-__glXExtensionsCtrScreen( __GLXscreenConfigs *psc )
-{
- if (psc->ext_list_first_time) {
- psc->ext_list_first_time = GL_FALSE;
- (void) memcpy( psc->direct_support, direct_glx_support,
- sizeof( direct_glx_support ) );
- }
-}
-
-
-/**
- * Check if a certain extension is enabled on a given screen.
- *
- * \param psc Pointer to GLX per-screen record.
- * \param bit Bit index in the direct-support table.
- * \returns If the extension bit is enabled for the screen, \c GL_TRUE is
- * returned. If the extension bit is not enabled or if \c psc is
- * \c NULL, then \c GL_FALSE is returned.
- */
-GLboolean
-__glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit )
-{
- GLboolean enabled = GL_FALSE;
-
- if ( psc != NULL ) {
- __glXExtensionsCtr();
- __glXExtensionsCtrScreen( psc );
- enabled = EXT_ENABLED( bit, psc->direct_support );
- }
-
- return enabled;
-}
-
-
-/**
- * Check if a certain extension is enabled in a given context.
- *
- */
-GLboolean
-__glExtensionBitIsEnabled( const __GLXcontext * gc, unsigned bit )
-{
- GLboolean enabled = GL_FALSE;
-
- if ( gc != NULL ) {
- enabled = EXT_ENABLED( bit, gc->gl_extension_bits );
- }
-
- return enabled;
-}
-
-
-
-/**
- * Convert a bit-field to a string of supported extensions.
- */
-static char *
-__glXGetStringFromTable( const struct extension_info * ext,
- const unsigned char * supported )
-{
- unsigned i;
- unsigned ext_str_len;
- char * ext_str;
- char * point;
-
-
- ext_str_len = 0;
- for ( i = 0 ; ext[i].name != NULL ; i++ ) {
- if ( EXT_ENABLED( ext[i].bit, supported ) ) {
- ext_str_len += ext[i].name_len + 1;
- }
- }
-
- ext_str = Xmalloc( ext_str_len + 1 );
- if ( ext_str != NULL ) {
- point = ext_str;
-
- for ( i = 0 ; ext[i].name != NULL ; i++ ) {
- if ( EXT_ENABLED( ext[i].bit, supported ) ) {
- (void) memcpy( point, ext[i].name, ext[i].name_len );
- point += ext[i].name_len;
-
- *point = ' ';
- point++;
- }
- }
-
- *point = '\0';
- }
-
- return ext_str;
-}
-
-
-/**
- * Get the string of client library supported extensions.
- */
-const char *
-__glXGetClientExtensions( void )
-{
- if ( __glXGLXClientExtensions == NULL ) {
- __glXExtensionsCtr();
- __glXGLXClientExtensions = __glXGetStringFromTable( known_glx_extensions,
- client_glx_support );
- }
-
- return __glXGLXClientExtensions;
-}
-
-
-/**
- * Calculate the list of application usable extensions. The resulting
- * string is stored in \c psc->effectiveGLXexts.
- *
- * \param psc Pointer to GLX per-screen record.
- * \param display_is_direct_capable True if the display is capable of
- * direct rendering.
- * \param minor_version GLX minor version from the server.
- */
-
-void
-__glXCalculateUsableExtensions( __GLXscreenConfigs *psc,
- GLboolean display_is_direct_capable,
- int minor_version )
-{
- unsigned char server_support[8];
- unsigned char usable[8];
- unsigned i;
-
- __glXExtensionsCtr();
- __glXExtensionsCtrScreen( psc );
- __glXProcessServerString( known_glx_extensions,
- psc->serverGLXexts, server_support );
-
-
- /* This is a hack. Some servers support GLX 1.3 but don't export
- * all of the extensions implied by GLX 1.3. If the server claims
- * support for GLX 1.3, enable support for the extensions that can be
- * "emulated" as well.
- */
-
- if ( minor_version >= 3 ) {
- SET_BIT( server_support, EXT_visual_info_bit );
- SET_BIT( server_support, EXT_visual_rating_bit );
- SET_BIT( server_support, SGI_make_current_read_bit );
- SET_BIT( server_support, SGIX_fbconfig_bit );
- SET_BIT( server_support, SGIX_pbuffer_bit );
-
- /* This one is a little iffy. GLX 1.3 doesn't incorporate all of this
- * extension. However, the only part that is not strictly client-side
- * is shared. That's the glXQueryContext / glXQueryContextInfoEXT
- * function.
- */
-
- SET_BIT( server_support, EXT_import_context_bit );
- }
-
-
- /* An extension is supported if the client-side (i.e., libGL) supports
- * it and the "server" supports it. In this case that means that either
- * the true server supports it or it is only for direct-rendering and
- * the direct rendering driver supports it.
- *
- * If the display is not capable of direct rendering, then the extension
- * is enabled if and only if the client-side library and the server
- * support it.
- */
-
- if ( display_is_direct_capable ) {
- for ( i = 0 ; i < 8 ; i++ ) {
- usable[i] = (client_glx_support[i] & client_glx_only[i])
- | (client_glx_support[i] & psc->direct_support[i] & server_support[i])
- | (client_glx_support[i] & psc->direct_support[i] & direct_glx_only[i]);
- }
- }
- else {
- for ( i = 0 ; i < 8 ; i++ ) {
- usable[i] = (client_glx_support[i] & client_glx_only[i])
- | (client_glx_support[i] & server_support[i]);
- }
- }
-
- psc->effectiveGLXexts = __glXGetStringFromTable( known_glx_extensions,
- usable );
-}
-
-
-/**
- * Calculate the list of application usable extensions. The resulting
- * string is stored in \c gc->extensions.
- *
- * \param gc Pointer to GLX context.
- * \param server_string Extension string from the server.
- * \param major_version GL major version from the server.
- * \param minor_version GL minor version from the server.
- */
-
-void
-__glXCalculateUsableGLExtensions( __GLXcontext * gc,
- const char * server_string,
- int major_version, int minor_version )
-{
- unsigned char server_support[ __GL_EXT_BYTES ];
- unsigned char usable[ __GL_EXT_BYTES ];
- unsigned i;
-
-
- __glXExtensionsCtr();
-
- (void) memset( server_support, 0, sizeof( server_support ) );
- __glXProcessServerString( known_gl_extensions, server_string,
- server_support );
-
-
- /* Handle lazy servers that don't export all the extensions strings that
- * are part of the GL core version that they support.
- */
-
- for ( i = 0 ; i < __GL_EXT_BYTES ; i++ ) {
- if ( (known_gl_extensions[i].version_major != 0)
- && ((major_version > known_gl_extensions[i].version_major)
- || ((major_version == known_gl_extensions[i].version_major)
- && (minor_version >= known_gl_extensions[i].version_minor))) ) {
- SET_BIT( server_support, known_gl_extensions[i].bit );
- }
- }
-
-
- /* An extension is supported if the client-side (i.e., libGL) supports
- * it and the server supports it or the client-side library supports it
- * and it only needs client-side support.
- */
-
- for ( i = 0 ; i < __GL_EXT_BYTES ; i++ ) {
- usable[i] = (client_gl_support[i] & client_gl_only[i])
- | (client_gl_support[i] & server_support[i]);
- }
-
- gc->extensions = (unsigned char *)
- __glXGetStringFromTable( known_gl_extensions, usable );
- (void) memcpy( gc->gl_extension_bits, usable, sizeof( usable ) );
-}
-
-
-/**
- * Calculates the maximum core GL version that can be supported for indirect
- * rendering.
- */
-void
-__glXGetGLVersion( int * major_version, int * minor_version )
-{
- __glXExtensionsCtr();
- *major_version = gl_major;
- *minor_version = gl_minor;
-}
-
-
-/**
- * Get a string representing the set of extensions supported by the client
- * library. This is currently only used to send the list of extensions
- * supported by the client to the server.
- */
-char *
-__glXGetClientGLExtensionString( void )
-{
- __glXExtensionsCtr();
- return __glXGetStringFromTable( known_gl_extensions, client_gl_support );
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/glxextensions.h b/nx-X11/extras/Mesa/src/glx/x11/glxextensions.h
deleted file mode 100644
index b4b03729c..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/glxextensions.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * (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
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file glxextensions.h
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#ifndef GLX_GLXEXTENSIONS_H
-#define GLX_GLXEXTENSIONS_H
-
-enum {
- ARB_get_proc_address_bit = 0,
- ARB_multisample_bit,
- ARB_render_texture_bit,
- ATI_pixel_format_float_bit,
- EXT_visual_info_bit,
- EXT_visual_rating_bit,
- EXT_import_context_bit,
- MESA_agp_offset_bit,
- MESA_allocate_memory_bit, /* Replaces MESA_agp_offset & NV_vertex_array_range */
- MESA_copy_sub_buffer_bit,
- MESA_depth_float_bit,
- MESA_pixmap_colormap_bit,
- MESA_release_buffers_bit,
- MESA_set_3dfx_mode_bit,
- MESA_swap_control_bit,
- MESA_swap_frame_usage_bit,
- NV_float_buffer_bit,
- NV_render_depth_texture_bit,
- NV_render_texture_rectangle_bit,
- NV_vertex_array_range_bit,
- OML_swap_method_bit,
- OML_sync_control_bit,
- SGI_cushion_bit,
- SGI_make_current_read_bit,
- SGI_swap_control_bit,
- SGI_video_sync_bit,
- SGIS_blended_overlay_bit,
- SGIS_color_range_bit,
- SGIS_multisample_bit,
- SGIX_dm_buffer_bit,
- SGIX_fbconfig_bit,
- SGIX_pbuffer_bit,
- SGIX_swap_barrier_bit,
- SGIX_swap_group_bit,
- SGIX_video_resize_bit,
- SGIX_video_source_bit,
- SGIX_visual_select_group_bit,
- SUN_get_transparent_index_bit
-};
-
-enum {
- GL_ARB_depth_texture_bit = 0,
- GL_ARB_draw_buffers_bit,
- GL_ARB_fragment_program_bit,
- GL_ARB_fragment_program_shadow_bit,
- GL_ARB_imaging_bit,
- GL_ARB_multisample_bit,
- GL_ARB_multitexture_bit,
- GL_ARB_occlusion_query_bit,
- GL_ARB_point_parameters_bit,
- GL_ARB_point_sprite_bit,
- GL_ARB_shadow_bit,
- GL_ARB_shadow_ambient_bit,
- GL_ARB_texture_border_clamp_bit,
- GL_ARB_texture_cube_map_bit,
- GL_ARB_texture_compression_bit,
- GL_ARB_texture_env_add_bit,
- GL_ARB_texture_env_combine_bit,
- GL_ARB_texture_env_crossbar_bit,
- GL_ARB_texture_env_dot3_bit,
- GL_ARB_texture_mirrored_repeat_bit,
- GL_ARB_texture_non_power_of_two_bit,
- GL_ARB_texture_rectangle_bit,
- GL_ARB_transpose_matrix_bit,
- GL_ARB_vertex_buffer_object_bit,
- GL_ARB_vertex_program_bit,
- GL_ARB_window_pos_bit,
- GL_EXT_abgr_bit,
- GL_EXT_bgra_bit,
- GL_EXT_blend_color_bit,
- GL_EXT_blend_equation_separate_bit,
- GL_EXT_blend_func_separate_bit,
- GL_EXT_blend_logic_op_bit,
- GL_EXT_blend_minmax_bit,
- GL_EXT_blend_subtract_bit,
- GL_EXT_clip_volume_hint_bit,
- GL_EXT_compiled_vertex_array_bit,
- GL_EXT_convolution_bit,
- GL_EXT_copy_texture_bit,
- GL_EXT_cull_vertex_bit,
- GL_EXT_depth_bounds_test_bit,
- GL_EXT_draw_range_elements_bit,
- GL_EXT_fog_coord_bit,
- GL_EXT_multi_draw_arrays_bit,
- GL_EXT_packed_pixels_bit,
- GL_EXT_paletted_texture_bit,
- GL_EXT_pixel_buffer_object_bit,
- GL_EXT_polygon_offset_bit,
- GL_EXT_rescale_normal_bit,
- GL_EXT_secondary_color_bit,
- GL_EXT_separate_specular_color_bit,
- GL_EXT_shadow_funcs_bit,
- GL_EXT_shared_texture_palette_bit,
- GL_EXT_stencil_two_side_bit,
- GL_EXT_stencil_wrap_bit,
- GL_EXT_subtexture_bit,
- GL_EXT_texture_bit,
- GL_EXT_texture3D_bit,
- GL_EXT_texture_compression_dxt1_bit,
- GL_EXT_texture_compression_s3tc_bit,
- GL_EXT_texture_edge_clamp_bit,
- GL_EXT_texture_env_combine_bit,
- GL_EXT_texture_env_dot3_bit,
- GL_EXT_texture_filter_anisotropic_bit,
- GL_EXT_texture_lod_bit,
- GL_EXT_texture_lod_bias_bit,
- GL_EXT_texture_mirror_clamp_bit,
- GL_EXT_texture_object_bit,
- GL_EXT_vertex_array_bit,
- GL_3DFX_texture_compression_FXT1_bit,
- GL_APPLE_packed_pixels_bit,
- GL_APPLE_ycbcr_422_bit,
- GL_ATI_text_fragment_shader_bit,
- GL_ATI_texture_env_combine3_bit,
- GL_ATI_texture_float_bit,
- GL_ATI_texture_mirror_once_bit,
- GL_HP_convolution_border_modes_bit,
- GL_HP_occlusion_test_bit,
- GL_IBM_cull_vertex_bit,
- GL_IBM_pixel_filter_hint_bit,
- GL_IBM_rasterpos_clip_bit,
- GL_IBM_texture_clamp_nodraw_bit,
- GL_INGR_interlace_read_bit,
- GL_MESA_pack_invert_bit,
- GL_MESA_ycbcr_texture_bit,
- GL_NV_blend_square_bit,
- GL_NV_copy_depth_to_color_bit,
- GL_NV_depth_clamp_bit,
- GL_NV_fog_distance_bit,
- GL_NV_fragment_program_bit,
- GL_NV_fragment_program_option_bit,
- GL_NV_fragment_program2_bit,
- GL_NV_light_max_exponent_bit,
- GL_NV_multisample_filter_hint_bit,
- GL_NV_point_sprite_bit,
- GL_NV_texgen_reflection_bit,
- GL_NV_texture_compression_vtc_bit,
- GL_NV_texture_env_combine4_bit,
- GL_NV_vertex_program_bit,
- GL_NV_vertex_program1_1_bit,
- GL_NV_vertex_program2_bit,
- GL_NV_vertex_program2_option_bit,
- GL_NV_vertex_program3_bit,
- GL_OES_compressed_paletted_texture_bit,
- GL_OES_read_format_bit,
- GL_SGI_color_matrix_bit,
- GL_SGI_texture_color_table_bit,
- GL_SGIS_generate_mipmap_bit,
- GL_SGIS_multisample_bit,
- GL_SGIS_texture_lod_bit,
- GL_SGIX_blend_alpha_minmax_bit,
- GL_SGIX_clipmap_bit,
- GL_SGIX_depth_texture_bit,
- GL_SGIX_fog_offset_bit,
- GL_SGIX_shadow_bit,
- GL_SGIX_texture_coordinate_clamp_bit,
- GL_SGIX_texture_lod_bias_bit,
- GL_SGIX_texture_range_bit,
- GL_SGIX_texture_scale_bias_bit,
- GL_SGIX_vertex_preclip_bit,
- GL_SGIX_vertex_preclip_hint_bit,
- GL_SGIX_ycrcb_bit,
- GL_SUN_convolution_border_modes_bit,
- GL_SUN_slice_accum_bit,
-
- /* This *MUST* go here. If it gets put after the duplicate values it will
- * get the value after the last duplicate.
- */
- __NUM_GL_EXTS,
-
-
- /* Alias extension bits. These extensions exist in either vendor-specific
- * or EXT form and were later promoted to either EXT or ARB form. In all
- * cases, the meaning is *exactly* the same. That's why
- * EXT_texture_env_combine is *NOT* an alias of ARB_texture_env_combine and
- * EXT_texture_env_dot3 is *NOT* an alias of ARB_texture_env_dot3. Be
- * careful! When in doubt, src/mesa/main/extensions.c in the Mesa tree
- * is a great reference.
- */
-
- GL_ATI_blend_equation_separate_bit = GL_EXT_blend_equation_separate_bit,
- GL_ATI_draw_buffers_bit = GL_ARB_draw_buffers_bit,
- GL_ATIX_texture_env_combine3_bit = GL_ATI_texture_env_combine3_bit,
- GL_EXT_point_parameters_bit = GL_ARB_point_parameters_bit,
- GL_EXT_texture_env_add_bit = GL_ARB_texture_env_add_bit,
- GL_EXT_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
- GL_IBM_texture_mirrored_repeat_bit = GL_ARB_texture_mirrored_repeat_bit,
- GL_INGR_blend_func_separate_bit = GL_EXT_blend_func_separate_bit,
- GL_MESA_window_pos_bit = GL_ARB_window_pos_bit,
- GL_NV_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
- GL_SGIS_texture_border_clamp_bit = GL_ARB_texture_border_clamp_bit,
- GL_SGIS_texture_edge_clamp_bit = GL_EXT_texture_edge_clamp_bit,
- GL_SGIX_shadow_ambient_bit = GL_ARB_shadow_ambient_bit,
- GL_SUN_multi_draw_arrays_bit = GL_EXT_multi_draw_arrays_bit
-};
-
-#define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8)
-
-struct __GLXscreenConfigsRec;
-struct __GLXcontextRec;
-
-extern GLboolean __glXExtensionBitIsEnabled( struct __GLXscreenConfigsRec *psc, unsigned bit );
-extern const char * __glXGetClientExtensions( void );
-extern void __glXCalculateUsableExtensions( struct __GLXscreenConfigsRec *psc,
- GLboolean display_is_direct_capable, int server_minor_version );
-extern void __glXScrEnableExtension( struct __GLXscreenConfigsRec *psc, const char * name );
-extern void __glXCalculateUsableGLExtensions( struct __GLXcontextRec * gc,
- const char * server_string, int major_version, int minor_version );
-extern void __glXGetGLVersion( int * major_version, int * minor_version );
-extern char * __glXGetClientGLExtensionString( void );
-
-extern GLboolean __glExtensionBitIsEnabled( const struct __GLXcontextRec * gc,
- unsigned bit );
-
-
-/* Source-level backwards compatibility with old drivers. They won't
- * find the respective functions, though.
- */
-typedef void (* PFNGLXENABLEEXTENSIONPROC) ( const char * name,
- GLboolean force_client );
-typedef void (* PFNGLXDISABLEEXTENSIONPROC) ( const char * name );
-
-/* GLX_ALIAS should be used for functions with a non-void return type.
- GLX_ALIAS_VOID is for functions with a void return type. */
-#ifdef GLX_NO_STATIC_EXTENSION_FUNCTIONS
-# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func)
-# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func)
-#else
-# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
-# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
- return_type real_func proto_args \
- __attribute__ ((alias( # aliased_func ) ));
-# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
- GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
-# else
-# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
- return_type real_func proto_args \
- { return aliased_func args ; }
-# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
- void real_func proto_args \
- { aliased_func args ; }
-# endif /* __GNUC__ */
-#endif /* GLX_NO_STATIC_EXTENSION_FUNCTIONS */
-
-#endif /* GLX_GLXEXTENSIONS_H */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect.c b/nx-X11/extras/Mesa/src/glx/x11/indirect.c
deleted file mode 100644
index 2a4db6578..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect.c
+++ /dev/null
@@ -1,8472 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */
-
-/*
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * 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 <GL/gl.h>
-#include "indirect.h"
-#include "glxclient.h"
-#include "indirect_size.h"
-#include <GL/glxproto.h>
-#ifdef USE_XCB
-#include <X11/xcl.h>
-#include <X11/XCB/xcb.h>
-#include <X11/XCB/glx.h>
-#endif /* USE_XCB */
-
-#define __GLX_PAD(n) (((n) + 3) & ~3)
-
-# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-# define FASTCALL __attribute__((fastcall))
-# else
-# define FASTCALL
-# endif
-# if defined(__GNUC__)
-# define NOINLINE __attribute__((noinline))
-# else
-# define NOINLINE
-# endif
-
-#if !defined __GNUC__ || __GNUC__ < 3
-# define __builtin_expect(x, y) x
-#endif
-
-/* If the size and opcode values are known at compile-time, this will, on
- * x86 at least, emit them with a single instruction.
- */
-#define emit_header(dest, op, size) \
- do { union { short s[2]; int i; } temp; \
- temp.s[0] = (size); temp.s[1] = (op); \
- *((int *)(dest)) = temp.i; } while(0)
-
-NOINLINE CARD32
-__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array )
-{
- xGLXSingleReply reply;
-
- (void) _XReply(dpy, (xReply *) & reply, 0, False);
- if (size != 0) {
- if ((reply.length > 0) || reply_is_always_array) {
- const GLint bytes = (reply_is_always_array)
- ? (4 * reply.length) : (reply.size * size);
- const GLint extra = 4 - (bytes & 3);
-
- _XRead(dpy, dest, bytes);
- if ( extra < 4 ) {
- _XEatData(dpy, extra);
- }
- }
- else {
- (void) memcpy( dest, &(reply.pad3), size);
- }
- }
-
- return reply.retval;
-}
-
-NOINLINE void
-__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim,
- GLint width, GLint height, GLint depth, GLenum format, GLenum type,
- void * dest, GLboolean dimensions_in_reply )
-{
- xGLXSingleReply reply;
- GLint size;
-
- (void) _XReply(dpy, (xReply *) & reply, 0, False);
-
- if ( dimensions_in_reply ) {
- width = reply.pad3;
- height = reply.pad4;
- depth = reply.pad5;
-
- if ((height == 0) || (max_dim < 2)) { height = 1; }
- if ((depth == 0) || (max_dim < 3)) { depth = 1; }
- }
-
- size = reply.length * 4;
- if (size != 0) {
- void * buf = Xmalloc( size );
-
- if ( buf == NULL ) {
- _XEatData(dpy, size);
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- }
- else {
- const GLint extra = 4 - (size & 3);
-
- _XRead(dpy, buf, size);
- if ( extra < 4 ) {
- _XEatData(dpy, extra);
- }
-
- __glEmptyImage(gc, 3, width, height, depth, format, type,
- buf, dest);
- Xfree(buf);
- }
- }
-}
-
-#define X_GLXSingle 0
-
-NOINLINE FASTCALL GLubyte *
-__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen )
-{
- xGLXSingleReq * req;
- Display * const dpy = gc->currentDpy;
-
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- LockDisplay(dpy);
- GetReqExtra(GLXSingle, cmdlen, req);
- req->reqType = gc->majorOpcode;
- req->contextTag = gc->currentContextTag;
- req->glxCode = sop;
- return (GLubyte *)(req) + sz_xGLXSingleReq;
-}
-
-NOINLINE FASTCALL GLubyte *
-__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen )
-{
- xGLXVendorPrivateReq * req;
- Display * const dpy = gc->currentDpy;
-
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivate, cmdlen, req);
- req->reqType = gc->majorOpcode;
- req->glxCode = code;
- req->vendorCode = vop;
- req->contextTag = gc->currentContextTag;
- return (GLubyte *)(req) + sz_xGLXVendorPrivateReq;
-}
-
-const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
-#define zero (__glXDefaultPixelStore+0)
-#define one (__glXDefaultPixelStore+8)
-#define default_pixel_store_1D (__glXDefaultPixelStore+4)
-#define default_pixel_store_1D_size 20
-#define default_pixel_store_2D (__glXDefaultPixelStore+4)
-#define default_pixel_store_2D_size 20
-#define default_pixel_store_3D (__glXDefaultPixelStore+0)
-#define default_pixel_store_3D_size 36
-#define default_pixel_store_4D (__glXDefaultPixelStore+0)
-#define default_pixel_store_4D_size 36
-
-static FASTCALL NOINLINE void
-generic_3_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_4_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_6_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_8_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_12_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 12);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_16_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_24_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 24);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static FASTCALL NOINLINE void
-generic_32_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, 32);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLsop_NewList 101
-void
-__indirect_glNewList(GLuint list, GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxNewList(c, gc->currentContextTag, list, mode);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_NewList, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&list), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&mode), 4);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_EndList 102
-void
-__indirect_glEndList(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 0;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxEndList(c, gc->currentContextTag);
-#else
- (void) __glXSetupSingleRequest(gc, X_GLsop_EndList, cmdlen);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLrop_CallList 1
-void
-__indirect_glCallList(GLuint list)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_CallList, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&list), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CallLists 2
-void
-__indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glCallLists_size(type);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * n));
- if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_CallLists, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&type), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(lists), (compsize * n));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_CallLists;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&type), 4);
- __glXSendLargeCommand(gc, pc, 16, lists, (compsize * n));
- }
- }
-}
-
-#define X_GLsop_DeleteLists 103
-void
-__indirect_glDeleteLists(GLuint list, GLsizei range)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxDeleteLists(c, gc->currentContextTag, list, range);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteLists, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&list), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&range), 4);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GenLists 104
-GLuint
-__indirect_glGenLists(GLsizei range)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLuint retval = (GLuint) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGenListsRep *reply = XCBGlxGenListsReply(c, XCBGlxGenLists(c, gc->currentContextTag, range), NULL);
- retval = reply->ret_val;
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&range), 4);
- retval = (GLuint) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return retval;
-}
-
-#define X_GLrop_ListBase 3
-void
-__indirect_glListBase(GLuint base)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ListBase, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&base), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Begin 4
-void
-__indirect_glBegin(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Begin, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Bitmap 5
-void
-__indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0;
- const GLuint cmdlen = 48 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_Bitmap, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&xorig), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&yorig), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&xmove), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&ymove), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_Bitmap;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&xorig), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&yorig), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&xmove), 4);
- (void) memcpy((void *)(pc + 48), (void *)(&ymove), 4);
- __glXSendLargeImage(gc, compsize, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52, pc + 8);
- }
- }
-}
-
-#define X_GLrop_Color3bv 6
-void
-__indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Color3bv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3bv 6
-void
-__indirect_glColor3bv(const GLbyte * v)
-{
- generic_3_byte( X_GLrop_Color3bv, v );
-}
-
-#define X_GLrop_Color3dv 7
-void
-__indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_Color3dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3dv 7
-void
-__indirect_glColor3dv(const GLdouble * v)
-{
- generic_24_byte( X_GLrop_Color3dv, v );
-}
-
-#define X_GLrop_Color3fv 8
-void
-__indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Color3fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3fv 8
-void
-__indirect_glColor3fv(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_Color3fv, v );
-}
-
-#define X_GLrop_Color3iv 9
-void
-__indirect_glColor3i(GLint red, GLint green, GLint blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Color3iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3iv 9
-void
-__indirect_glColor3iv(const GLint * v)
-{
- generic_12_byte( X_GLrop_Color3iv, v );
-}
-
-#define X_GLrop_Color3sv 10
-void
-__indirect_glColor3s(GLshort red, GLshort green, GLshort blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Color3sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3sv 10
-void
-__indirect_glColor3sv(const GLshort * v)
-{
- generic_6_byte( X_GLrop_Color3sv, v );
-}
-
-#define X_GLrop_Color3ubv 11
-void
-__indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Color3ubv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3ubv 11
-void
-__indirect_glColor3ubv(const GLubyte * v)
-{
- generic_3_byte( X_GLrop_Color3ubv, v );
-}
-
-#define X_GLrop_Color3uiv 12
-void
-__indirect_glColor3ui(GLuint red, GLuint green, GLuint blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Color3uiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3uiv 12
-void
-__indirect_glColor3uiv(const GLuint * v)
-{
- generic_12_byte( X_GLrop_Color3uiv, v );
-}
-
-#define X_GLrop_Color3usv 13
-void
-__indirect_glColor3us(GLushort red, GLushort green, GLushort blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Color3usv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color3usv 13
-void
-__indirect_glColor3usv(const GLushort * v)
-{
- generic_6_byte( X_GLrop_Color3usv, v );
-}
-
-#define X_GLrop_Color4bv 14
-void
-__indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Color4bv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- (void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4bv 14
-void
-__indirect_glColor4bv(const GLbyte * v)
-{
- generic_4_byte( X_GLrop_Color4bv, v );
-}
-
-#define X_GLrop_Color4dv 15
-void
-__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_Color4dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&alpha), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4dv 15
-void
-__indirect_glColor4dv(const GLdouble * v)
-{
- generic_32_byte( X_GLrop_Color4dv, v );
-}
-
-#define X_GLrop_Color4fv 16
-void
-__indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Color4fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4fv 16
-void
-__indirect_glColor4fv(const GLfloat * v)
-{
- generic_16_byte( X_GLrop_Color4fv, v );
-}
-
-#define X_GLrop_Color4iv 17
-void
-__indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Color4iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4iv 17
-void
-__indirect_glColor4iv(const GLint * v)
-{
- generic_16_byte( X_GLrop_Color4iv, v );
-}
-
-#define X_GLrop_Color4sv 18
-void
-__indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Color4sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4sv 18
-void
-__indirect_glColor4sv(const GLshort * v)
-{
- generic_8_byte( X_GLrop_Color4sv, v );
-}
-
-#define X_GLrop_Color4ubv 19
-void
-__indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Color4ubv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- (void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4ubv 19
-void
-__indirect_glColor4ubv(const GLubyte * v)
-{
- generic_4_byte( X_GLrop_Color4ubv, v );
-}
-
-#define X_GLrop_Color4uiv 20
-void
-__indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Color4uiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4uiv 20
-void
-__indirect_glColor4uiv(const GLuint * v)
-{
- generic_16_byte( X_GLrop_Color4uiv, v );
-}
-
-#define X_GLrop_Color4usv 21
-void
-__indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Color4usv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Color4usv 21
-void
-__indirect_glColor4usv(const GLushort * v)
-{
- generic_8_byte( X_GLrop_Color4usv, v );
-}
-
-#define X_GLrop_EdgeFlagv 22
-void
-__indirect_glEdgeFlag(GLboolean flag)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EdgeFlagv 22
-void
-__indirect_glEdgeFlagv(const GLboolean * flag)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(flag), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_End 23
-void
-__indirect_glEnd(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_End, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexdv 24
-void
-__indirect_glIndexd(GLdouble c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Indexdv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexdv 24
-void
-__indirect_glIndexdv(const GLdouble * c)
-{
- generic_8_byte( X_GLrop_Indexdv, c );
-}
-
-#define X_GLrop_Indexfv 25
-void
-__indirect_glIndexf(GLfloat c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Indexfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexfv 25
-void
-__indirect_glIndexfv(const GLfloat * c)
-{
- generic_4_byte( X_GLrop_Indexfv, c );
-}
-
-#define X_GLrop_Indexiv 26
-void
-__indirect_glIndexi(GLint c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Indexiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexiv 26
-void
-__indirect_glIndexiv(const GLint * c)
-{
- generic_4_byte( X_GLrop_Indexiv, c );
-}
-
-#define X_GLrop_Indexsv 27
-void
-__indirect_glIndexs(GLshort c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Indexsv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexsv 27
-void
-__indirect_glIndexsv(const GLshort * c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Indexsv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(c), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Normal3bv 28
-void
-__indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Normal3bv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&ny), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&nz), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Normal3bv 28
-void
-__indirect_glNormal3bv(const GLbyte * v)
-{
- generic_3_byte( X_GLrop_Normal3bv, v );
-}
-
-#define X_GLrop_Normal3dv 29
-void
-__indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_Normal3dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&ny), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&nz), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Normal3dv 29
-void
-__indirect_glNormal3dv(const GLdouble * v)
-{
- generic_24_byte( X_GLrop_Normal3dv, v );
-}
-
-#define X_GLrop_Normal3fv 30
-void
-__indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Normal3fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Normal3fv 30
-void
-__indirect_glNormal3fv(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_Normal3fv, v );
-}
-
-#define X_GLrop_Normal3iv 31
-void
-__indirect_glNormal3i(GLint nx, GLint ny, GLint nz)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Normal3iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Normal3iv 31
-void
-__indirect_glNormal3iv(const GLint * v)
-{
- generic_12_byte( X_GLrop_Normal3iv, v );
-}
-
-#define X_GLrop_Normal3sv 32
-void
-__indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Normal3sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&ny), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&nz), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Normal3sv 32
-void
-__indirect_glNormal3sv(const GLshort * v)
-{
- generic_6_byte( X_GLrop_Normal3sv, v );
-}
-
-#define X_GLrop_RasterPos2dv 33
-void
-__indirect_glRasterPos2d(GLdouble x, GLdouble y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_RasterPos2dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos2dv 33
-void
-__indirect_glRasterPos2dv(const GLdouble * v)
-{
- generic_16_byte( X_GLrop_RasterPos2dv, v );
-}
-
-#define X_GLrop_RasterPos2fv 34
-void
-__indirect_glRasterPos2f(GLfloat x, GLfloat y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_RasterPos2fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos2fv 34
-void
-__indirect_glRasterPos2fv(const GLfloat * v)
-{
- generic_8_byte( X_GLrop_RasterPos2fv, v );
-}
-
-#define X_GLrop_RasterPos2iv 35
-void
-__indirect_glRasterPos2i(GLint x, GLint y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_RasterPos2iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos2iv 35
-void
-__indirect_glRasterPos2iv(const GLint * v)
-{
- generic_8_byte( X_GLrop_RasterPos2iv, v );
-}
-
-#define X_GLrop_RasterPos2sv 36
-void
-__indirect_glRasterPos2s(GLshort x, GLshort y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_RasterPos2sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos2sv 36
-void
-__indirect_glRasterPos2sv(const GLshort * v)
-{
- generic_4_byte( X_GLrop_RasterPos2sv, v );
-}
-
-#define X_GLrop_RasterPos3dv 37
-void
-__indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_RasterPos3dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos3dv 37
-void
-__indirect_glRasterPos3dv(const GLdouble * v)
-{
- generic_24_byte( X_GLrop_RasterPos3dv, v );
-}
-
-#define X_GLrop_RasterPos3fv 38
-void
-__indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_RasterPos3fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos3fv 38
-void
-__indirect_glRasterPos3fv(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_RasterPos3fv, v );
-}
-
-#define X_GLrop_RasterPos3iv 39
-void
-__indirect_glRasterPos3i(GLint x, GLint y, GLint z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_RasterPos3iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos3iv 39
-void
-__indirect_glRasterPos3iv(const GLint * v)
-{
- generic_12_byte( X_GLrop_RasterPos3iv, v );
-}
-
-#define X_GLrop_RasterPos3sv 40
-void
-__indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_RasterPos3sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos3sv 40
-void
-__indirect_glRasterPos3sv(const GLshort * v)
-{
- generic_6_byte( X_GLrop_RasterPos3sv, v );
-}
-
-#define X_GLrop_RasterPos4dv 41
-void
-__indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_RasterPos4dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos4dv 41
-void
-__indirect_glRasterPos4dv(const GLdouble * v)
-{
- generic_32_byte( X_GLrop_RasterPos4dv, v );
-}
-
-#define X_GLrop_RasterPos4fv 42
-void
-__indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_RasterPos4fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos4fv 42
-void
-__indirect_glRasterPos4fv(const GLfloat * v)
-{
- generic_16_byte( X_GLrop_RasterPos4fv, v );
-}
-
-#define X_GLrop_RasterPos4iv 43
-void
-__indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_RasterPos4iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos4iv 43
-void
-__indirect_glRasterPos4iv(const GLint * v)
-{
- generic_16_byte( X_GLrop_RasterPos4iv, v );
-}
-
-#define X_GLrop_RasterPos4sv 44
-void
-__indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_RasterPos4sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&w), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_RasterPos4sv 44
-void
-__indirect_glRasterPos4sv(const GLshort * v)
-{
- generic_8_byte( X_GLrop_RasterPos4sv, v );
-}
-
-#define X_GLrop_Rectdv 45
-void
-__indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_Rectdv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y1), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&x2), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&y2), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectdv 45
-void
-__indirect_glRectdv(const GLdouble * v1, const GLdouble * v2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_Rectdv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 16);
- (void) memcpy((void *)(gc->pc + 20), (void *)(v2), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectfv 46
-void
-__indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Rectfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectfv 46
-void
-__indirect_glRectfv(const GLfloat * v1, const GLfloat * v2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Rectfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v2), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectiv 47
-void
-__indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Rectiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectiv 47
-void
-__indirect_glRectiv(const GLint * v1, const GLint * v2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Rectiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v2), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectsv 48
-void
-__indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Rectsv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y1), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x2), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y2), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rectsv 48
-void
-__indirect_glRectsv(const GLshort * v1, const GLshort * v2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Rectsv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord1dv 49
-void
-__indirect_glTexCoord1d(GLdouble s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_TexCoord1dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord1dv 49
-void
-__indirect_glTexCoord1dv(const GLdouble * v)
-{
- generic_8_byte( X_GLrop_TexCoord1dv, v );
-}
-
-#define X_GLrop_TexCoord1fv 50
-void
-__indirect_glTexCoord1f(GLfloat s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_TexCoord1fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord1fv 50
-void
-__indirect_glTexCoord1fv(const GLfloat * v)
-{
- generic_4_byte( X_GLrop_TexCoord1fv, v );
-}
-
-#define X_GLrop_TexCoord1iv 51
-void
-__indirect_glTexCoord1i(GLint s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_TexCoord1iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord1iv 51
-void
-__indirect_glTexCoord1iv(const GLint * v)
-{
- generic_4_byte( X_GLrop_TexCoord1iv, v );
-}
-
-#define X_GLrop_TexCoord1sv 52
-void
-__indirect_glTexCoord1s(GLshort s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord1sv 52
-void
-__indirect_glTexCoord1sv(const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord2dv 53
-void
-__indirect_glTexCoord2d(GLdouble s, GLdouble t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_TexCoord2dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord2dv 53
-void
-__indirect_glTexCoord2dv(const GLdouble * v)
-{
- generic_16_byte( X_GLrop_TexCoord2dv, v );
-}
-
-#define X_GLrop_TexCoord2fv 54
-void
-__indirect_glTexCoord2f(GLfloat s, GLfloat t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_TexCoord2fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord2fv 54
-void
-__indirect_glTexCoord2fv(const GLfloat * v)
-{
- generic_8_byte( X_GLrop_TexCoord2fv, v );
-}
-
-#define X_GLrop_TexCoord2iv 55
-void
-__indirect_glTexCoord2i(GLint s, GLint t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_TexCoord2iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord2iv 55
-void
-__indirect_glTexCoord2iv(const GLint * v)
-{
- generic_8_byte( X_GLrop_TexCoord2iv, v );
-}
-
-#define X_GLrop_TexCoord2sv 56
-void
-__indirect_glTexCoord2s(GLshort s, GLshort t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_TexCoord2sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord2sv 56
-void
-__indirect_glTexCoord2sv(const GLshort * v)
-{
- generic_4_byte( X_GLrop_TexCoord2sv, v );
-}
-
-#define X_GLrop_TexCoord3dv 57
-void
-__indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_TexCoord3dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord3dv 57
-void
-__indirect_glTexCoord3dv(const GLdouble * v)
-{
- generic_24_byte( X_GLrop_TexCoord3dv, v );
-}
-
-#define X_GLrop_TexCoord3fv 58
-void
-__indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexCoord3fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord3fv 58
-void
-__indirect_glTexCoord3fv(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_TexCoord3fv, v );
-}
-
-#define X_GLrop_TexCoord3iv 59
-void
-__indirect_glTexCoord3i(GLint s, GLint t, GLint r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexCoord3iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord3iv 59
-void
-__indirect_glTexCoord3iv(const GLint * v)
-{
- generic_12_byte( X_GLrop_TexCoord3iv, v );
-}
-
-#define X_GLrop_TexCoord3sv 60
-void
-__indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_TexCoord3sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&r), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord3sv 60
-void
-__indirect_glTexCoord3sv(const GLshort * v)
-{
- generic_6_byte( X_GLrop_TexCoord3sv, v );
-}
-
-#define X_GLrop_TexCoord4dv 61
-void
-__indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_TexCoord4dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&q), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord4dv 61
-void
-__indirect_glTexCoord4dv(const GLdouble * v)
-{
- generic_32_byte( X_GLrop_TexCoord4dv, v );
-}
-
-#define X_GLrop_TexCoord4fv 62
-void
-__indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_TexCoord4fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&q), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord4fv 62
-void
-__indirect_glTexCoord4fv(const GLfloat * v)
-{
- generic_16_byte( X_GLrop_TexCoord4fv, v );
-}
-
-#define X_GLrop_TexCoord4iv 63
-void
-__indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_TexCoord4iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&q), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord4iv 63
-void
-__indirect_glTexCoord4iv(const GLint * v)
-{
- generic_16_byte( X_GLrop_TexCoord4iv, v );
-}
-
-#define X_GLrop_TexCoord4sv 64
-void
-__indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_TexCoord4sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&r), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&q), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexCoord4sv 64
-void
-__indirect_glTexCoord4sv(const GLshort * v)
-{
- generic_8_byte( X_GLrop_TexCoord4sv, v );
-}
-
-#define X_GLrop_Vertex2dv 65
-void
-__indirect_glVertex2d(GLdouble x, GLdouble y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Vertex2dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex2dv 65
-void
-__indirect_glVertex2dv(const GLdouble * v)
-{
- generic_16_byte( X_GLrop_Vertex2dv, v );
-}
-
-#define X_GLrop_Vertex2fv 66
-void
-__indirect_glVertex2f(GLfloat x, GLfloat y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Vertex2fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex2fv 66
-void
-__indirect_glVertex2fv(const GLfloat * v)
-{
- generic_8_byte( X_GLrop_Vertex2fv, v );
-}
-
-#define X_GLrop_Vertex2iv 67
-void
-__indirect_glVertex2i(GLint x, GLint y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Vertex2iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex2iv 67
-void
-__indirect_glVertex2iv(const GLint * v)
-{
- generic_8_byte( X_GLrop_Vertex2iv, v );
-}
-
-#define X_GLrop_Vertex2sv 68
-void
-__indirect_glVertex2s(GLshort x, GLshort y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Vertex2sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex2sv 68
-void
-__indirect_glVertex2sv(const GLshort * v)
-{
- generic_4_byte( X_GLrop_Vertex2sv, v );
-}
-
-#define X_GLrop_Vertex3dv 69
-void
-__indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_Vertex3dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex3dv 69
-void
-__indirect_glVertex3dv(const GLdouble * v)
-{
- generic_24_byte( X_GLrop_Vertex3dv, v );
-}
-
-#define X_GLrop_Vertex3fv 70
-void
-__indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Vertex3fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex3fv 70
-void
-__indirect_glVertex3fv(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_Vertex3fv, v );
-}
-
-#define X_GLrop_Vertex3iv 71
-void
-__indirect_glVertex3i(GLint x, GLint y, GLint z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Vertex3iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex3iv 71
-void
-__indirect_glVertex3iv(const GLint * v)
-{
- generic_12_byte( X_GLrop_Vertex3iv, v );
-}
-
-#define X_GLrop_Vertex3sv 72
-void
-__indirect_glVertex3s(GLshort x, GLshort y, GLshort z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Vertex3sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex3sv 72
-void
-__indirect_glVertex3sv(const GLshort * v)
-{
- generic_6_byte( X_GLrop_Vertex3sv, v );
-}
-
-#define X_GLrop_Vertex4dv 73
-void
-__indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_Vertex4dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex4dv 73
-void
-__indirect_glVertex4dv(const GLdouble * v)
-{
- generic_32_byte( X_GLrop_Vertex4dv, v );
-}
-
-#define X_GLrop_Vertex4fv 74
-void
-__indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Vertex4fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex4fv 74
-void
-__indirect_glVertex4fv(const GLfloat * v)
-{
- generic_16_byte( X_GLrop_Vertex4fv, v );
-}
-
-#define X_GLrop_Vertex4iv 75
-void
-__indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Vertex4iv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex4iv 75
-void
-__indirect_glVertex4iv(const GLint * v)
-{
- generic_16_byte( X_GLrop_Vertex4iv, v );
-}
-
-#define X_GLrop_Vertex4sv 76
-void
-__indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Vertex4sv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&w), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Vertex4sv 76
-void
-__indirect_glVertex4sv(const GLshort * v)
-{
- generic_8_byte( X_GLrop_Vertex4sv, v );
-}
-
-#define X_GLrop_ClipPlane 77
-void
-__indirect_glClipPlane(GLenum plane, const GLdouble * equation)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_ClipPlane, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(equation), 32);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&plane), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ColorMaterial 78
-void
-__indirect_glColorMaterial(GLenum face, GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_ColorMaterial, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CullFace 79
-void
-__indirect_glCullFace(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_CullFace, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Fogf 80
-void
-__indirect_glFogf(GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Fogf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Fogfv 81
-void
-__indirect_glFogfv(GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glFogfv_size(pname);
- const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_Fogfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Fogi 82
-void
-__indirect_glFogi(GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Fogi, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Fogiv 83
-void
-__indirect_glFogiv(GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glFogiv_size(pname);
- const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_Fogiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FrontFace 84
-void
-__indirect_glFrontFace(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_FrontFace, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Hint 85
-void
-__indirect_glHint(GLenum target, GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Hint, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Lightf 86
-void
-__indirect_glLightf(GLenum light, GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Lightf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Lightfv 87
-void
-__indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glLightfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_Lightfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Lighti 88
-void
-__indirect_glLighti(GLenum light, GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Lighti, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Lightiv 89
-void
-__indirect_glLightiv(GLenum light, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glLightiv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_Lightiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LightModelf 90
-void
-__indirect_glLightModelf(GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_LightModelf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LightModelfv 91
-void
-__indirect_glLightModelfv(GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glLightModelfv_size(pname);
- const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_LightModelfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LightModeli 92
-void
-__indirect_glLightModeli(GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_LightModeli, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LightModeliv 93
-void
-__indirect_glLightModeliv(GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glLightModeliv_size(pname);
- const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_LightModeliv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LineStipple 94
-void
-__indirect_glLineStipple(GLint factor, GLushort pattern)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_LineStipple, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pattern), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LineWidth 95
-void
-__indirect_glLineWidth(GLfloat width)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_LineWidth, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&width), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Materialf 96
-void
-__indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Materialf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Materialfv 97
-void
-__indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glMaterialfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_Materialfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Materiali 98
-void
-__indirect_glMateriali(GLenum face, GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Materiali, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Materialiv 99
-void
-__indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glMaterialiv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_Materialiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PointSize 100
-void
-__indirect_glPointSize(GLfloat size)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_PointSize, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&size), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PolygonMode 101
-void
-__indirect_glPolygonMode(GLenum face, GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PolygonMode, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PolygonStipple 102
-void
-__indirect_glPolygonStipple(const GLubyte * mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0;
- const GLuint cmdlen = 24 + __GLX_PAD(compsize);
- emit_header(gc->pc, X_GLrop_PolygonStipple, cmdlen);
- if (compsize > 0) {
- (*gc->fillImage)(gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, gc->pc + 24, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Scissor 103
-void
-__indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Scissor, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ShadeModel 104
-void
-__indirect_glShadeModel(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ShadeModel, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexParameterf 105
-void
-__indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexParameterf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexParameterfv 106
-void
-__indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexParameterfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_TexParameterfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexParameteri 107
-void
-__indirect_glTexParameteri(GLenum target, GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexParameteri, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexParameteriv 108
-void
-__indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexParameteriv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_TexParameteriv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static void
-__glx_TexImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glImageSize(width, height, 1, format, type, target);
- const GLuint cmdlen = 56 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, opcode, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&border), 4);
- (void) memcpy((void *)(gc->pc + 48), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 52), (void *)(&type), 4);
- if ((compsize > 0) && (pixels != NULL)) {
- (*gc->fillImage)(gc, dim, width, height, 1, format, type, pixels, gc->pc + 56, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = opcode;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&internalformat), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 48), (void *)(&border), 4);
- (void) memcpy((void *)(pc + 52), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 56), (void *)(&type), 4);
- __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 60, pc + 8);
- }
- }
-}
-
-#define X_GLrop_TexImage1D 109
-void
-__indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __glx_TexImage_1D2D(X_GLrop_TexImage1D, 1, target, level, internalformat, width, 1, border, format, type, pixels );
-}
-
-#define X_GLrop_TexImage2D 110
-void
-__indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __glx_TexImage_1D2D(X_GLrop_TexImage2D, 2, target, level, internalformat, width, height, border, format, type, pixels );
-}
-
-#define X_GLrop_TexEnvf 111
-void
-__indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexEnvf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexEnvfv 112
-void
-__indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexEnvfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_TexEnvfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexEnvi 113
-void
-__indirect_glTexEnvi(GLenum target, GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexEnvi, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexEnviv 114
-void
-__indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexEnviv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_TexEnviv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexGend 115
-void
-__indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_TexGend, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&param), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&coord), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&pname), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexGendv 116
-void
-__indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexGendv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8));
- emit_header(gc->pc, X_GLrop_TexGendv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 8));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexGenf 117
-void
-__indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexGenf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexGenfv 118
-void
-__indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexGenfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_TexGenfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexGeni 119
-void
-__indirect_glTexGeni(GLenum coord, GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_TexGeni, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_TexGeniv 120
-void
-__indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glTexGeniv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_TexGeniv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_InitNames 121
-void
-__indirect_glInitNames(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_InitNames, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LoadName 122
-void
-__indirect_glLoadName(GLuint name)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_LoadName, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&name), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PassThrough 123
-void
-__indirect_glPassThrough(GLfloat token)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_PassThrough, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&token), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PopName 124
-void
-__indirect_glPopName(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_PopName, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PushName 125
-void
-__indirect_glPushName(GLuint name)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_PushName, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&name), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_DrawBuffer 126
-void
-__indirect_glDrawBuffer(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_DrawBuffer, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Clear 127
-void
-__indirect_glClear(GLbitfield mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Clear, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ClearAccum 128
-void
-__indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_ClearAccum, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ClearIndex 129
-void
-__indirect_glClearIndex(GLfloat c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ClearIndex, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ClearColor 130
-void
-__indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_ClearColor, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ClearStencil 131
-void
-__indirect_glClearStencil(GLint s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ClearStencil, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ClearDepth 132
-void
-__indirect_glClearDepth(GLclampd depth)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_ClearDepth, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&depth), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_StencilMask 133
-void
-__indirect_glStencilMask(GLuint mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_StencilMask, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ColorMask 134
-void
-__indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ColorMask, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- (void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_DepthMask 135
-void
-__indirect_glDepthMask(GLboolean flag)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_DepthMask, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_IndexMask 136
-void
-__indirect_glIndexMask(GLuint mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_IndexMask, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Accum 137
-void
-__indirect_glAccum(GLenum op, GLfloat value)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_Accum, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&value), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PopAttrib 141
-void
-__indirect_glPopAttrib(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_PopAttrib, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PushAttrib 142
-void
-__indirect_glPushAttrib(GLbitfield mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_PushAttrib, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MapGrid1d 147
-void
-__indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MapGrid1d, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&un), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MapGrid1f 148
-void
-__indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MapGrid1f, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&un), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MapGrid2d 149
-void
-__indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_MapGrid2d, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&v2), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&un), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&vn), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MapGrid2f 150
-void
-__indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_MapGrid2f, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&un), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&vn), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&v2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalCoord1dv 151
-void
-__indirect_glEvalCoord1d(GLdouble u)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_EvalCoord1dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalCoord1dv 151
-void
-__indirect_glEvalCoord1dv(const GLdouble * u)
-{
- generic_8_byte( X_GLrop_EvalCoord1dv, u );
-}
-
-#define X_GLrop_EvalCoord1fv 152
-void
-__indirect_glEvalCoord1f(GLfloat u)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_EvalCoord1fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalCoord1fv 152
-void
-__indirect_glEvalCoord1fv(const GLfloat * u)
-{
- generic_4_byte( X_GLrop_EvalCoord1fv, u );
-}
-
-#define X_GLrop_EvalCoord2dv 153
-void
-__indirect_glEvalCoord2d(GLdouble u, GLdouble v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_EvalCoord2dv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalCoord2dv 153
-void
-__indirect_glEvalCoord2dv(const GLdouble * u)
-{
- generic_16_byte( X_GLrop_EvalCoord2dv, u );
-}
-
-#define X_GLrop_EvalCoord2fv 154
-void
-__indirect_glEvalCoord2f(GLfloat u, GLfloat v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_EvalCoord2fv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalCoord2fv 154
-void
-__indirect_glEvalCoord2fv(const GLfloat * u)
-{
- generic_8_byte( X_GLrop_EvalCoord2fv, u );
-}
-
-#define X_GLrop_EvalMesh1 155
-void
-__indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_EvalMesh1, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalPoint1 156
-void
-__indirect_glEvalPoint1(GLint i)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_EvalPoint1, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&i), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalMesh2 157
-void
-__indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_EvalMesh2, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&j1), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&j2), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EvalPoint2 158
-void
-__indirect_glEvalPoint2(GLint i, GLint j)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_EvalPoint2, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&i), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&j), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_AlphaFunc 159
-void
-__indirect_glAlphaFunc(GLenum func, GLclampf ref)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_AlphaFunc, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_BlendFunc 160
-void
-__indirect_glBlendFunc(GLenum sfactor, GLenum dfactor)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_BlendFunc, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&sfactor), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&dfactor), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LogicOp 161
-void
-__indirect_glLogicOp(GLenum opcode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_LogicOp, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&opcode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_StencilFunc 162
-void
-__indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_StencilFunc, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&mask), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_StencilOp 163
-void
-__indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_StencilOp, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&fail), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&zfail), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&zpass), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_DepthFunc 164
-void
-__indirect_glDepthFunc(GLenum func)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_DepthFunc, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PixelZoom 165
-void
-__indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PixelZoom, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&xfactor), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&yfactor), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PixelTransferf 166
-void
-__indirect_glPixelTransferf(GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PixelTransferf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PixelTransferi 167
-void
-__indirect_glPixelTransferi(GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PixelTransferi, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PixelMapfv 168
-void
-__indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4));
- if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_PixelMapfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(values), (mapsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_PixelMapfv;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&map), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4);
- __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 4));
- }
- }
-}
-
-#define X_GLrop_PixelMapuiv 169
-void
-__indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4));
- if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_PixelMapuiv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(values), (mapsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_PixelMapuiv;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&map), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4);
- __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 4));
- }
- }
-}
-
-#define X_GLrop_PixelMapusv 170
-void
-__indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 2));
- if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_PixelMapusv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(values), (mapsize * 2));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_PixelMapusv;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&map), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4);
- __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 2));
- }
- }
-}
-
-#define X_GLrop_ReadBuffer 171
-void
-__indirect_glReadBuffer(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ReadBuffer, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyPixels 172
-void
-__indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_CopyPixels, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&type), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLsop_ReadPixels 111
-void
-__indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 28;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxReadPixelsRep *reply = XCBGlxReadPixelsReply(c, XCBGlxReadPixels(c, gc->currentContextTag, x, y, width, height, format, type, state->storePack.swapEndian, 0), NULL);
- (void)memcpy(pixels, XCBGlxReadPixelsData(reply), XCBGlxReadPixelsDataLength(reply) * sizeof(GLvoid));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_ReadPixels, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&x), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&y), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 16), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 20), (void *)(&type), 4);
- *(int32_t *)(pc + 24) = 0;
- * (int8_t *)(pc + 24) = state->storePack.swapEndian;
- __glXReadPixelReply(dpy, gc, 2, width, height, 1, format, type, pixels, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLrop_DrawPixels 173
-void
-__indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, 0) : 0;
- const GLuint cmdlen = 40 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_DrawPixels, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&type), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, 2, width, height, 1, format, type, pixels, gc->pc + 40, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_DrawPixels;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&type), 4);
- __glXSendLargeImage(gc, compsize, 2, width, height, 1, format, type, pixels, pc + 44, pc + 8);
- }
- }
-}
-
-#define X_GLsop_GetClipPlane 113
-void
-__indirect_glGetClipPlane(GLenum plane, GLdouble * equation)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetClipPlaneRep *reply = XCBGlxGetClipPlaneReply(c, XCBGlxGetClipPlane(c, gc->currentContextTag, plane), NULL);
- (void)memcpy(equation, XCBGlxGetClipPlaneData(reply), XCBGlxGetClipPlaneDataLength(reply) * sizeof(GLdouble));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&plane), 4);
- (void) __glXReadReply(dpy, 8, equation, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetLightfv 118
-void
-__indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetLightfvRep *reply = XCBGlxGetLightfvReply(c, XCBGlxGetLightfv(c, gc->currentContextTag, light, pname), NULL);
- if (XCBGlxGetLightfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetLightfvData(reply), XCBGlxGetLightfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&light), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetLightiv 119
-void
-__indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetLightivRep *reply = XCBGlxGetLightivReply(c, XCBGlxGetLightiv(c, gc->currentContextTag, light, pname), NULL);
- if (XCBGlxGetLightivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetLightivData(reply), XCBGlxGetLightivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightiv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&light), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMapdv 120
-void
-__indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMapdvRep *reply = XCBGlxGetMapdvReply(c, XCBGlxGetMapdv(c, gc->currentContextTag, target, query), NULL);
- if (XCBGlxGetMapdvDataLength(reply) == 0)
- (void)memcpy(v, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(v, XCBGlxGetMapdvData(reply), XCBGlxGetMapdvDataLength(reply) * sizeof(GLdouble));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapdv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&query), 4);
- (void) __glXReadReply(dpy, 8, v, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMapfv 121
-void
-__indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMapfvRep *reply = XCBGlxGetMapfvReply(c, XCBGlxGetMapfv(c, gc->currentContextTag, target, query), NULL);
- if (XCBGlxGetMapfvDataLength(reply) == 0)
- (void)memcpy(v, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(v, XCBGlxGetMapfvData(reply), XCBGlxGetMapfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&query), 4);
- (void) __glXReadReply(dpy, 4, v, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMapiv 122
-void
-__indirect_glGetMapiv(GLenum target, GLenum query, GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMapivRep *reply = XCBGlxGetMapivReply(c, XCBGlxGetMapiv(c, gc->currentContextTag, target, query), NULL);
- if (XCBGlxGetMapivDataLength(reply) == 0)
- (void)memcpy(v, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(v, XCBGlxGetMapivData(reply), XCBGlxGetMapivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapiv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&query), 4);
- (void) __glXReadReply(dpy, 4, v, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMaterialfv 123
-void
-__indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMaterialfvRep *reply = XCBGlxGetMaterialfvReply(c, XCBGlxGetMaterialfv(c, gc->currentContextTag, face, pname), NULL);
- if (XCBGlxGetMaterialfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetMaterialfvData(reply), XCBGlxGetMaterialfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&face), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMaterialiv 124
-void
-__indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMaterialivRep *reply = XCBGlxGetMaterialivReply(c, XCBGlxGetMaterialiv(c, gc->currentContextTag, face, pname), NULL);
- if (XCBGlxGetMaterialivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetMaterialivData(reply), XCBGlxGetMaterialivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialiv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&face), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetPixelMapfv 125
-void
-__indirect_glGetPixelMapfv(GLenum map, GLfloat * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetPixelMapfvRep *reply = XCBGlxGetPixelMapfvReply(c, XCBGlxGetPixelMapfv(c, gc->currentContextTag, map), NULL);
- if (XCBGlxGetPixelMapfvDataLength(reply) == 0)
- (void)memcpy(values, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(values, XCBGlxGetPixelMapfvData(reply), XCBGlxGetPixelMapfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&map), 4);
- (void) __glXReadReply(dpy, 4, values, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetPixelMapuiv 126
-void
-__indirect_glGetPixelMapuiv(GLenum map, GLuint * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetPixelMapuivRep *reply = XCBGlxGetPixelMapuivReply(c, XCBGlxGetPixelMapuiv(c, gc->currentContextTag, map), NULL);
- if (XCBGlxGetPixelMapuivDataLength(reply) == 0)
- (void)memcpy(values, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(values, XCBGlxGetPixelMapuivData(reply), XCBGlxGetPixelMapuivDataLength(reply) * sizeof(GLuint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&map), 4);
- (void) __glXReadReply(dpy, 4, values, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetPixelMapusv 127
-void
-__indirect_glGetPixelMapusv(GLenum map, GLushort * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetPixelMapusvRep *reply = XCBGlxGetPixelMapusvReply(c, XCBGlxGetPixelMapusv(c, gc->currentContextTag, map), NULL);
- if (XCBGlxGetPixelMapusvDataLength(reply) == 0)
- (void)memcpy(values, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(values, XCBGlxGetPixelMapusvData(reply), XCBGlxGetPixelMapusvDataLength(reply) * sizeof(GLushort));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&map), 4);
- (void) __glXReadReply(dpy, 2, values, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetPolygonStipple 128
-void
-__indirect_glGetPolygonStipple(GLubyte * mask)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetPolygonStippleRep *reply = XCBGlxGetPolygonStippleReply(c, XCBGlxGetPolygonStipple(c, gc->currentContextTag, 0), NULL);
- (void)memcpy(mask, XCBGlxGetPolygonStippleData(reply), XCBGlxGetPolygonStippleDataLength(reply) * sizeof(GLubyte));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPolygonStipple, cmdlen);
- *(int32_t *)(pc + 0) = 0;
- __glXReadPixelReply(dpy, gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexEnvfv 130
-void
-__indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexEnvfvRep *reply = XCBGlxGetTexEnvfvReply(c, XCBGlxGetTexEnvfv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetTexEnvfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexEnvfvData(reply), XCBGlxGetTexEnvfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnvfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexEnviv 131
-void
-__indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexEnvivRep *reply = XCBGlxGetTexEnvivReply(c, XCBGlxGetTexEnviv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetTexEnvivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexEnvivData(reply), XCBGlxGetTexEnvivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnviv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexGendv 132
-void
-__indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexGendvRep *reply = XCBGlxGetTexGendvReply(c, XCBGlxGetTexGendv(c, gc->currentContextTag, coord, pname), NULL);
- if (XCBGlxGetTexGendvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexGendvData(reply), XCBGlxGetTexGendvDataLength(reply) * sizeof(GLdouble));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGendv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&coord), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 8, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexGenfv 133
-void
-__indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexGenfvRep *reply = XCBGlxGetTexGenfvReply(c, XCBGlxGetTexGenfv(c, gc->currentContextTag, coord, pname), NULL);
- if (XCBGlxGetTexGenfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexGenfvData(reply), XCBGlxGetTexGenfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGenfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&coord), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexGeniv 134
-void
-__indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexGenivRep *reply = XCBGlxGetTexGenivReply(c, XCBGlxGetTexGeniv(c, gc->currentContextTag, coord, pname), NULL);
- if (XCBGlxGetTexGenivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexGenivData(reply), XCBGlxGetTexGenivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGeniv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&coord), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexImage 135
-void
-__indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 20;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexImageRep *reply = XCBGlxGetTexImageReply(c, XCBGlxGetTexImage(c, gc->currentContextTag, target, level, format, type, state->storePack.swapEndian), NULL);
- (void)memcpy(pixels, XCBGlxGetTexImageData(reply), XCBGlxGetTexImageDataLength(reply) * sizeof(GLvoid));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexImage, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&type), 4);
- *(int32_t *)(pc + 16) = 0;
- * (int8_t *)(pc + 16) = state->storePack.swapEndian;
- __glXReadPixelReply(dpy, gc, 3, 0, 0, 0, format, type, pixels, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexParameterfv 136
-void
-__indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexParameterfvRep *reply = XCBGlxGetTexParameterfvReply(c, XCBGlxGetTexParameterfv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetTexParameterfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexParameterfvData(reply), XCBGlxGetTexParameterfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameterfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexParameteriv 137
-void
-__indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexParameterivRep *reply = XCBGlxGetTexParameterivReply(c, XCBGlxGetTexParameteriv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetTexParameterivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexParameterivData(reply), XCBGlxGetTexParameterivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameteriv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexLevelParameterfv 138
-void
-__indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexLevelParameterfvRep *reply = XCBGlxGetTexLevelParameterfvReply(c, XCBGlxGetTexLevelParameterfv(c, gc->currentContextTag, target, level, pname), NULL);
- if (XCBGlxGetTexLevelParameterfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexLevelParameterfvData(reply), XCBGlxGetTexLevelParameterfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameterfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetTexLevelParameteriv 139
-void
-__indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetTexLevelParameterivRep *reply = XCBGlxGetTexLevelParameterivReply(c, XCBGlxGetTexLevelParameteriv(c, gc->currentContextTag, target, level, pname), NULL);
- if (XCBGlxGetTexLevelParameterivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetTexLevelParameterivData(reply), XCBGlxGetTexLevelParameterivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameteriv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_IsList 141
-GLboolean
-__indirect_glIsList(GLuint list)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxIsListRep *reply = XCBGlxIsListReply(c, XCBGlxIsList(c, gc->currentContextTag, list), NULL);
- retval = reply->ret_val;
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsList, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&list), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return retval;
-}
-
-#define X_GLrop_DepthRange 174
-void
-__indirect_glDepthRange(GLclampd zNear, GLclampd zFar)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_DepthRange, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&zNear), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&zFar), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Frustum 175
-void
-__indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 52;
- emit_header(gc->pc, X_GLrop_Frustum, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&left), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&right), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&top), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 8);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LoadIdentity 176
-void
-__indirect_glLoadIdentity(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_LoadIdentity, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LoadMatrixf 177
-void
-__indirect_glLoadMatrixf(const GLfloat * m)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 68;
- emit_header(gc->pc, X_GLrop_LoadMatrixf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(m), 64);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_LoadMatrixd 178
-void
-__indirect_glLoadMatrixd(const GLdouble * m)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 132;
- emit_header(gc->pc, X_GLrop_LoadMatrixd, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(m), 128);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MatrixMode 179
-void
-__indirect_glMatrixMode(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_MatrixMode, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultMatrixf 180
-void
-__indirect_glMultMatrixf(const GLfloat * m)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 68;
- emit_header(gc->pc, X_GLrop_MultMatrixf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(m), 64);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultMatrixd 181
-void
-__indirect_glMultMatrixd(const GLdouble * m)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 132;
- emit_header(gc->pc, X_GLrop_MultMatrixd, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(m), 128);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Ortho 182
-void
-__indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 52;
- emit_header(gc->pc, X_GLrop_Ortho, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&left), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&right), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&top), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 8);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PopMatrix 183
-void
-__indirect_glPopMatrix(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_PopMatrix, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PushMatrix 184
-void
-__indirect_glPushMatrix(void)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 4;
- emit_header(gc->pc, X_GLrop_PushMatrix, cmdlen);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rotated 185
-void
-__indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_Rotated, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Rotatef 186
-void
-__indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Rotatef, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Scaled 187
-void
-__indirect_glScaled(GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_Scaled, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Scalef 188
-void
-__indirect_glScalef(GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Scalef, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Translated 189
-void
-__indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_Translated, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Translatef 190
-void
-__indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Translatef, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Viewport 191
-void
-__indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Viewport, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_BindTexture 4117
-void
-__indirect_glBindTexture(GLenum target, GLuint texture)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_BindTexture, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&texture), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexubv 194
-void
-__indirect_glIndexub(GLubyte c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Indexubv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Indexubv 194
-void
-__indirect_glIndexubv(const GLubyte * c)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_Indexubv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(c), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PolygonOffset 192
-void
-__indirect_glPolygonOffset(GLfloat factor, GLfloat units)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PolygonOffset, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&units), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLsop_AreTexturesResident 143
-GLboolean
-__indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxAreTexturesResidentRep *reply = XCBGlxAreTexturesResidentReply(c, XCBGlxAreTexturesResident(c, gc->currentContextTag, n, textures), NULL);
- (void)memcpy(residences, XCBGlxAreTexturesResidentData(reply), XCBGlxAreTexturesResidentDataLength(reply) * sizeof(GLboolean));
- retval = reply->ret_val;
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_AreTexturesResident, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 4), (void *)(textures), (n * 4));
- retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return retval;
-}
-
-#define X_GLrop_CopyTexImage1D 4119
-void
-__indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_CopyTexImage1D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&border), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyTexImage2D 4120
-void
-__indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_CopyTexImage2D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&border), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyTexSubImage1D 4121
-void
-__indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_CopyTexSubImage1D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyTexSubImage2D 4122
-void
-__indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 36;
- emit_header(gc->pc, X_GLrop_CopyTexSubImage2D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&height), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_DeleteTextures 12
-void
-__indirect_glDeleteTextures(GLsizei n, const GLuint * textures)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteTextures, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 4), (void *)(textures), (n * 4));
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLsop_GenTextures 145
-void
-__indirect_glGenTextures(GLsizei n, GLuint * textures)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGenTexturesRep *reply = XCBGlxGenTexturesReply(c, XCBGlxGenTextures(c, gc->currentContextTag, n), NULL);
- (void)memcpy(textures, XCBGlxGenTexturesData(reply), XCBGlxGenTexturesDataLength(reply) * sizeof(GLuint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) __glXReadReply(dpy, 4, textures, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_IsTexture 146
-GLboolean
-__indirect_glIsTexture(GLuint texture)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxIsTextureRep *reply = XCBGlxIsTextureReply(c, XCBGlxIsTexture(c, gc->currentContextTag, texture), NULL);
- retval = reply->ret_val;
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsTexture, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&texture), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return retval;
-}
-
-#define X_GLrop_PrioritizeTextures 4118
-void
-__indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8 + __GLX_PAD((n * 4)) + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_PrioritizeTextures, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(textures), (n * 4));
- (void) memcpy((void *)(gc->pc + 8 + (n * 4)), (void *)(priorities), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-static void
-__glx_TexSubImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0;
- const GLuint cmdlen = 60 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, opcode, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&xoffset), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&yoffset), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 48), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 52), (void *)(&type), 4);
- (void) memcpy((void *)(gc->pc + 56), (void *)((pixels == NULL) ? one : zero), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, dim, width, height, 1, format, type, pixels, gc->pc + 60, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = opcode;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&xoffset), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&yoffset), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 48), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 52), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 56), (void *)(&type), 4);
- (void) memcpy((void *)(pc + 60), zero, 4);
- __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 64, pc + 8);
- }
- }
-}
-
-#define X_GLrop_TexSubImage1D 4099
-void
-__indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __glx_TexSubImage_1D2D(X_GLrop_TexSubImage1D, 1, target, level, xoffset, 1, width, 1, format, type, pixels );
-}
-
-#define X_GLrop_TexSubImage2D 4100
-void
-__indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __glx_TexSubImage_1D2D(X_GLrop_TexSubImage2D, 2, target, level, xoffset, yoffset, width, height, format, type, pixels );
-}
-
-#define X_GLrop_BlendColor 4096
-void
-__indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_BlendColor, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_BlendEquation 4097
-void
-__indirect_glBlendEquation(GLenum mode)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_BlendEquation, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ColorTable 2053
-void
-__indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (table != NULL) ? __glImageSize(width, 1, 1, format, type, target) : 0;
- const GLuint cmdlen = 44 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_ColorTable, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&type), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, 1, width, 1, 1, format, type, table, gc->pc + 44, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_ColorTable;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&internalformat), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&type), 4);
- __glXSendLargeImage(gc, compsize, 1, width, 1, 1, format, type, table, pc + 48, pc + 8);
- }
- }
-}
-
-#define X_GLrop_ColorTableParameterfv 2054
-void
-__indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glColorTableParameterfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_ColorTableParameterfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ColorTableParameteriv 2055
-void
-__indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glColorTableParameteriv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_ColorTableParameteriv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyColorTable 2056
-void
-__indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_CopyColorTable, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLsop_GetColorTable 147
-void
-__indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 16;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetColorTableRep *reply = XCBGlxGetColorTableReply(c, XCBGlxGetColorTable(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL);
- (void)memcpy(table, XCBGlxGetColorTableData(reply), XCBGlxGetColorTableDataLength(reply) * sizeof(GLvoid));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTable, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&type), 4);
- *(int32_t *)(pc + 12) = 0;
- * (int8_t *)(pc + 12) = state->storePack.swapEndian;
- __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetColorTableParameterfv 148
-void
-__indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetColorTableParameterfvRep *reply = XCBGlxGetColorTableParameterfvReply(c, XCBGlxGetColorTableParameterfv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetColorTableParameterfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetColorTableParameterfvData(reply), XCBGlxGetColorTableParameterfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameterfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetColorTableParameteriv 149
-void
-__indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetColorTableParameterivRep *reply = XCBGlxGetColorTableParameterivReply(c, XCBGlxGetColorTableParameteriv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetColorTableParameterivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetColorTableParameterivData(reply), XCBGlxGetColorTableParameterivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameteriv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLrop_ColorSubTable 195
-void
-__indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0;
- const GLuint cmdlen = 44 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_ColorSubTable, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&start), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&count), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&type), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, 1, count, 1, 1, format, type, data, gc->pc + 44, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_ColorSubTable;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&start), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&count), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&type), 4);
- __glXSendLargeImage(gc, compsize, 1, count, 1, 1, format, type, data, pc + 48, pc + 8);
- }
- }
-}
-
-#define X_GLrop_CopyColorSubTable 196
-void
-__indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_CopyColorSubTable, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&start), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static void
-__glx_ConvolutionFilter_1D2D( unsigned opcode, unsigned dim, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (image != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0;
- const GLuint cmdlen = 48 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, opcode, cmdlen);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&type), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, dim, width, height, 1, format, type, image, gc->pc + 48, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = opcode;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 28), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 32), (void *)(&internalformat), 4);
- (void) memcpy((void *)(pc + 36), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 40), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 48), (void *)(&type), 4);
- __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, image, pc + 52, pc + 8);
- }
- }
-}
-
-#define X_GLrop_ConvolutionFilter1D 4101
-void
-__indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
-{
- __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter1D, 1, target, internalformat, width, 1, format, type, image );
-}
-
-#define X_GLrop_ConvolutionFilter2D 4102
-void
-__indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
-{
- __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter2D, 2, target, internalformat, width, height, format, type, image );
-}
-
-#define X_GLrop_ConvolutionParameterf 4103
-void
-__indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_ConvolutionParameterf, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&params), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ConvolutionParameterfv 4104
-void
-__indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glConvolutionParameterfv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_ConvolutionParameterfv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ConvolutionParameteri 4105
-void
-__indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_ConvolutionParameteri, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&params), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ConvolutionParameteriv 4106
-void
-__indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glConvolutionParameteriv_size(pname);
- const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_ConvolutionParameteriv, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyConvolutionFilter1D 4107
-void
-__indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_CopyConvolutionFilter1D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_CopyConvolutionFilter2D 4108
-void
-__indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_CopyConvolutionFilter2D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&height), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLsop_GetConvolutionFilter 150
-void
-__indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 16;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetConvolutionFilterRep *reply = XCBGlxGetConvolutionFilterReply(c, XCBGlxGetConvolutionFilter(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL);
- (void)memcpy(image, XCBGlxGetConvolutionFilterData(reply), XCBGlxGetConvolutionFilterDataLength(reply) * sizeof(GLvoid));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionFilter, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&type), 4);
- *(int32_t *)(pc + 12) = 0;
- * (int8_t *)(pc + 12) = state->storePack.swapEndian;
- __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetConvolutionParameterfv 151
-void
-__indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetConvolutionParameterfvRep *reply = XCBGlxGetConvolutionParameterfvReply(c, XCBGlxGetConvolutionParameterfv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetConvolutionParameterfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetConvolutionParameterfvData(reply), XCBGlxGetConvolutionParameterfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameterfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetConvolutionParameteriv 152
-void
-__indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetConvolutionParameterivRep *reply = XCBGlxGetConvolutionParameterivReply(c, XCBGlxGetConvolutionParameteriv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetConvolutionParameterivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetConvolutionParameterivData(reply), XCBGlxGetConvolutionParameterivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameteriv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetHistogram 154
-void
-__indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 16;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetHistogramRep *reply = XCBGlxGetHistogramReply(c, XCBGlxGetHistogram(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL);
- (void)memcpy(values, XCBGlxGetHistogramData(reply), XCBGlxGetHistogramDataLength(reply) * sizeof(GLvoid));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogram, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&type), 4);
- *(int32_t *)(pc + 12) = 0;
- * (int8_t *)(pc + 12) = state->storePack.swapEndian;
- * (int8_t *)(pc + 13) = reset;
- __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetHistogramParameterfv 155
-void
-__indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetHistogramParameterfvRep *reply = XCBGlxGetHistogramParameterfvReply(c, XCBGlxGetHistogramParameterfv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetHistogramParameterfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetHistogramParameterfvData(reply), XCBGlxGetHistogramParameterfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameterfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetHistogramParameteriv 156
-void
-__indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetHistogramParameterivRep *reply = XCBGlxGetHistogramParameterivReply(c, XCBGlxGetHistogramParameteriv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetHistogramParameterivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetHistogramParameterivData(reply), XCBGlxGetHistogramParameterivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameteriv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMinmax 157
-void
-__indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const __GLXattribute * const state = gc->client_state_private;
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 16;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMinmaxRep *reply = XCBGlxGetMinmaxReply(c, XCBGlxGetMinmax(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL);
- (void)memcpy(values, XCBGlxGetMinmaxData(reply), XCBGlxGetMinmaxDataLength(reply) * sizeof(GLvoid));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmax, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&type), 4);
- *(int32_t *)(pc + 12) = 0;
- * (int8_t *)(pc + 12) = state->storePack.swapEndian;
- * (int8_t *)(pc + 13) = reset;
- __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMinmaxParameterfv 158
-void
-__indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMinmaxParameterfvRep *reply = XCBGlxGetMinmaxParameterfvReply(c, XCBGlxGetMinmaxParameterfv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetMinmaxParameterfvDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetMinmaxParameterfvData(reply), XCBGlxGetMinmaxParameterfvDataLength(reply) * sizeof(GLfloat));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameterfv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetMinmaxParameteriv 159
-void
-__indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetMinmaxParameterivRep *reply = XCBGlxGetMinmaxParameterivReply(c, XCBGlxGetMinmaxParameteriv(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetMinmaxParameterivDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetMinmaxParameterivData(reply), XCBGlxGetMinmaxParameterivDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameteriv, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLrop_Histogram 4110
-void
-__indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_Histogram, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&sink), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_Minmax 4111
-void
-__indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_Minmax, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&sink), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ResetHistogram 4112
-void
-__indirect_glResetHistogram(GLenum target)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ResetHistogram, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ResetMinmax 4113
-void
-__indirect_glResetMinmax(GLenum target)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ResetMinmax, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-static void
-__glx_TexImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid * pixels )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0;
- const GLuint cmdlen = 84 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, opcode, cmdlen);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 48), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 52), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 56), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 60), (void *)(&depth), 4);
- (void) memcpy((void *)(gc->pc + 64), (void *)(&extent), 4);
- (void) memcpy((void *)(gc->pc + 68), (void *)(&border), 4);
- (void) memcpy((void *)(gc->pc + 72), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 76), (void *)(&type), 4);
- (void) memcpy((void *)(gc->pc + 80), (void *)((pixels == NULL) ? one : zero), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, dim, width, height, depth, format, type, pixels, gc->pc + 84, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = opcode;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 48), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 52), (void *)(&internalformat), 4);
- (void) memcpy((void *)(pc + 56), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 60), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 64), (void *)(&depth), 4);
- (void) memcpy((void *)(pc + 68), (void *)(&extent), 4);
- (void) memcpy((void *)(pc + 72), (void *)(&border), 4);
- (void) memcpy((void *)(pc + 76), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 80), (void *)(&type), 4);
- (void) memcpy((void *)(pc + 84), zero, 4);
- __glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 88, pc + 8);
- }
- }
-}
-
-#define X_GLrop_TexImage3D 4114
-void
-__indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __glx_TexImage_3D4D(X_GLrop_TexImage3D, 3, target, level, internalformat, width, height, depth, 1, border, format, type, pixels );
-}
-
-static void
-__glx_TexSubImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid * pixels )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0;
- const GLuint cmdlen = 92 + __GLX_PAD(compsize);
- if (__builtin_expect(gc->currentDpy != NULL, 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, opcode, cmdlen);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 48), (void *)(&xoffset), 4);
- (void) memcpy((void *)(gc->pc + 52), (void *)(&yoffset), 4);
- (void) memcpy((void *)(gc->pc + 56), (void *)(&zoffset), 4);
- (void) memcpy((void *)(gc->pc + 60), (void *)(&woffset), 4);
- (void) memcpy((void *)(gc->pc + 64), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 68), (void *)(&height), 4);
- (void) memcpy((void *)(gc->pc + 72), (void *)(&depth), 4);
- (void) memcpy((void *)(gc->pc + 76), (void *)(&extent), 4);
- (void) memcpy((void *)(gc->pc + 80), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 84), (void *)(&type), 4);
- (void) memcpy((void *)(gc->pc + 88), (void *)((pixels == NULL) ? one : zero), 4);
- if (compsize > 0) {
- (*gc->fillImage)(gc, dim, width, height, depth, format, type, pixels, gc->pc + 92, gc->pc + 4);
- }
- else {
- (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size );
- }
- gc->pc += cmdlen;
- if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = opcode;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 44), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 48), (void *)(&level), 4);
- (void) memcpy((void *)(pc + 52), (void *)(&xoffset), 4);
- (void) memcpy((void *)(pc + 56), (void *)(&yoffset), 4);
- (void) memcpy((void *)(pc + 60), (void *)(&zoffset), 4);
- (void) memcpy((void *)(pc + 64), (void *)(&woffset), 4);
- (void) memcpy((void *)(pc + 68), (void *)(&width), 4);
- (void) memcpy((void *)(pc + 72), (void *)(&height), 4);
- (void) memcpy((void *)(pc + 76), (void *)(&depth), 4);
- (void) memcpy((void *)(pc + 80), (void *)(&extent), 4);
- (void) memcpy((void *)(pc + 84), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 88), (void *)(&type), 4);
- (void) memcpy((void *)(pc + 92), zero, 4);
- __glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 96, pc + 8);
- }
- }
-}
-
-#define X_GLrop_TexSubImage3D 4115
-void
-__indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
-{
- __glx_TexSubImage_3D4D(X_GLrop_TexSubImage3D, 3, target, level, xoffset, yoffset, zoffset, 1, width, height, depth, 1, format, type, pixels );
-}
-
-#define X_GLrop_CopyTexSubImage3D 4123
-void
-__indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_CopyTexSubImage3D, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&zoffset), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&height), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ActiveTextureARB 197
-void
-__indirect_glActiveTextureARB(GLenum texture)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ActiveTextureARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&texture), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1dvARB 198
-void
-__indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1dvARB 198
-void
-__indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1fvARB 199
-void
-__indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1fvARB 199
-void
-__indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1ivARB 200
-void
-__indirect_glMultiTexCoord1iARB(GLenum target, GLint s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1ivARB 200
-void
-__indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1svARB 201
-void
-__indirect_glMultiTexCoord1sARB(GLenum target, GLshort s)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord1svARB 201
-void
-__indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2dvARB 202
-void
-__indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2dvARB 202
-void
-__indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 16);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2fvARB 203
-void
-__indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2fvARB 203
-void
-__indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2ivARB 204
-void
-__indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2ivARB 204
-void
-__indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2svARB 205
-void
-__indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord2svARB 205
-void
-__indirect_glMultiTexCoord2svARB(GLenum target, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3dvARB 206
-void
-__indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3dvARB 206
-void
-__indirect_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 24);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3fvARB 207
-void
-__indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3fvARB 207
-void
-__indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3ivARB 208
-void
-__indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3ivARB 208
-void
-__indirect_glMultiTexCoord3ivARB(GLenum target, const GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3svARB 209
-void
-__indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord3svARB 209
-void
-__indirect_glMultiTexCoord3svARB(GLenum target, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 6);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4dvARB 210
-void
-__indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&q), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4dvARB 210
-void
-__indirect_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 32);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4fvARB 211
-void
-__indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&q), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4fvARB 211
-void
-__indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4ivARB 212
-void
-__indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&q), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4ivARB 212
-void
-__indirect_glMultiTexCoord4ivARB(GLenum target, const GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4svARB 213
-void
-__indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 2);
- (void) memcpy((void *)(gc->pc + 14), (void *)(&q), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_MultiTexCoord4svARB 213
-void
-__indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SampleCoverageARB 229
-void
-__indirect_glSampleCoverageARB(GLclampf value, GLboolean invert)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_SampleCoverageARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&value), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_DrawBuffersARB 233
-void
-__indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_DrawBuffersARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(bufs), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_DrawBuffersARB;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&n), 4);
- __glXSendLargeCommand(gc, pc, 12, bufs, (n * 4));
- }
- }
-}
-
-#define X_GLvop_AreTexturesResidentEXT 11
-GLboolean
-__indirect_glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreTexturesResidentEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 4), (void *)(textures), (n * 4));
- retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLvop_GenTexturesEXT 13
-void
-__indirect_glGenTexturesEXT(GLsizei n, GLuint * textures)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenTexturesEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) __glXReadReply(dpy, 4, textures, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_IsTextureEXT 14
-GLboolean
-__indirect_glIsTextureEXT(GLuint texture)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsTextureEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&texture), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLrop_SampleMaskSGIS 2048
-void
-__indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_SampleMaskSGIS, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&value), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SamplePatternSGIS 2049
-void
-__indirect_glSamplePatternSGIS(GLenum pattern)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_SamplePatternSGIS, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pattern), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PointParameterfEXT 2065
-void
-__indirect_glPointParameterfEXT(GLenum pname, GLfloat param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PointParameterfEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PointParameterfvEXT 2066
-void
-__indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glPointParameterfvEXT_size(pname);
- const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_PointParameterfvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_WindowPos3fvMESA 230
-void
-__indirect_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_WindowPos3fvMESA, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_WindowPos3fvMESA 230
-void
-__indirect_glWindowPos3fvMESA(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_WindowPos3fvMESA, v );
-}
-
-#define X_GLrop_BlendFuncSeparateEXT 4134
-void
-__indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_BlendFuncSeparateEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&sfactorRGB), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&dfactorRGB), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&sfactorAlpha), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&dfactorAlpha), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FogCoordfvEXT 4124
-void
-__indirect_glFogCoordfEXT(GLfloat coord)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_FogCoordfvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FogCoordfvEXT 4124
-void
-__indirect_glFogCoordfvEXT(const GLfloat * coord)
-{
- generic_4_byte( X_GLrop_FogCoordfvEXT, coord );
-}
-
-#define X_GLrop_FogCoorddvEXT 4125
-void
-__indirect_glFogCoorddEXT(GLdouble coord)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_FogCoorddvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FogCoorddvEXT 4125
-void
-__indirect_glFogCoorddvEXT(const GLdouble * coord)
-{
- generic_8_byte( X_GLrop_FogCoorddvEXT, coord );
-}
-
-#define X_GLrop_SecondaryColor3bvEXT 4126
-void
-__indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_SecondaryColor3bvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3bvEXT 4126
-void
-__indirect_glSecondaryColor3bvEXT(const GLbyte * v)
-{
- generic_3_byte( X_GLrop_SecondaryColor3bvEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3dvEXT 4130
-void
-__indirect_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_SecondaryColor3dvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3dvEXT 4130
-void
-__indirect_glSecondaryColor3dvEXT(const GLdouble * v)
-{
- generic_24_byte( X_GLrop_SecondaryColor3dvEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3fvEXT 4129
-void
-__indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_SecondaryColor3fvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3fvEXT 4129
-void
-__indirect_glSecondaryColor3fvEXT(const GLfloat * v)
-{
- generic_12_byte( X_GLrop_SecondaryColor3fvEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3ivEXT 4128
-void
-__indirect_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_SecondaryColor3ivEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3ivEXT 4128
-void
-__indirect_glSecondaryColor3ivEXT(const GLint * v)
-{
- generic_12_byte( X_GLrop_SecondaryColor3ivEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3svEXT 4127
-void
-__indirect_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_SecondaryColor3svEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3svEXT 4127
-void
-__indirect_glSecondaryColor3svEXT(const GLshort * v)
-{
- generic_6_byte( X_GLrop_SecondaryColor3svEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3ubvEXT 4131
-void
-__indirect_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_SecondaryColor3ubvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
- (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3ubvEXT 4131
-void
-__indirect_glSecondaryColor3ubvEXT(const GLubyte * v)
-{
- generic_3_byte( X_GLrop_SecondaryColor3ubvEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3uivEXT 4133
-void
-__indirect_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_SecondaryColor3uivEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3uivEXT 4133
-void
-__indirect_glSecondaryColor3uivEXT(const GLuint * v)
-{
- generic_12_byte( X_GLrop_SecondaryColor3uivEXT, v );
-}
-
-#define X_GLrop_SecondaryColor3usvEXT 4132
-void
-__indirect_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_SecondaryColor3usvEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
- (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_SecondaryColor3usvEXT 4132
-void
-__indirect_glSecondaryColor3usvEXT(const GLushort * v)
-{
- generic_6_byte( X_GLrop_SecondaryColor3usvEXT, v );
-}
-
-#define X_GLvop_AreProgramsResidentNV 1293
-GLboolean
-__indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreProgramsResidentNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 4), (void *)(ids), (n * 4));
- retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLrop_BindProgramNV 4180
-void
-__indirect_glBindProgramNV(GLenum target, GLuint program)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_BindProgramNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&program), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_DeleteProgramsNV 1294
-void
-__indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteProgramsNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 4), (void *)(programs), (n * 4));
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLrop_ExecuteProgramNV 4181
-void
-__indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ExecuteProgramNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_GenProgramsNV 1295
-void
-__indirect_glGenProgramsNV(GLsizei n, GLuint * programs)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenProgramsNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) __glXReadReply(dpy, 4, programs, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetProgramParameterdvNV 1297
-void
-__indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterdvNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 8, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetProgramParameterfvNV 1296
-void
-__indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterfvNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetProgramivNV 1298
-void
-__indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetProgramStringNV 1299
-void
-__indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 1, program, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetTrackMatrixivNV 1300
-void
-__indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetTrackMatrixivNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&address), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_IsProgramNV 1304
-GLboolean
-__indirect_glIsProgramNV(GLuint program)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsProgramNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&program), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLrop_LoadProgramNV 4183
-void
-__indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16 + __GLX_PAD(len);
- if (__builtin_expect(len >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_LoadProgramNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&len), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(program), len);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_ProgramParameter4dvNV 4185
-void
-__indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_ProgramParameter4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramParameter4dvNV 4185
-void
-__indirect_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_ProgramParameter4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 32);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramParameter4fvNV 4184
-void
-__indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ProgramParameter4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramParameter4fvNV 4184
-void
-__indirect_glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ProgramParameter4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramParameters4dvNV 4187
-void
-__indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16 + __GLX_PAD((num * 32));
- if (__builtin_expect(num >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_ProgramParameters4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&num), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(params), (num * 32));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_ProgramParameters4fvNV 4186
-void
-__indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16 + __GLX_PAD((num * 16));
- if (__builtin_expect(num >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_ProgramParameters4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&num), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(params), (num * 16));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_RequestResidentProgramsNV 4182
-void
-__indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8 + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_RequestResidentProgramsNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(ids), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_TrackMatrixNV 4188
-void
-__indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_TrackMatrixNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&address), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&matrix), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&transform), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1dvARB 4197
-void
-__indirect_glVertexAttrib1dARB(GLuint index, GLdouble x)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1dvARB 4197
-void
-__indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1fvARB 4193
-void
-__indirect_glVertexAttrib1fARB(GLuint index, GLfloat x)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1fvARB 4193
-void
-__indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1svARB 4189
-void
-__indirect_glVertexAttrib1sARB(GLuint index, GLshort x)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1svARB 4189
-void
-__indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2dvARB 4198
-void
-__indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2dvARB 4198
-void
-__indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 16);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2fvARB 4194
-void
-__indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2fvARB 4194
-void
-__indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2svARB 4190
-void
-__indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2svARB 4190
-void
-__indirect_glVertexAttrib2svARB(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3dvARB 4199
-void
-__indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3dvARB 4199
-void
-__indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 24);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3fvARB 4195
-void
-__indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3fvARB 4195
-void
-__indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3svARB 4191
-void
-__indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3svARB 4191
-void
-__indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 6);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4dvARB 4200
-void
-__indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4dvARB 4200
-void
-__indirect_glVertexAttrib4dvARB(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 32);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&index), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4fvARB 4196
-void
-__indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4fvARB 4196
-void
-__indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4svARB 4192
-void
-__indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
- (void) memcpy((void *)(gc->pc + 14), (void *)(&w), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4svARB 4192
-void
-__indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NubvARB 4201
-void
-__indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1);
- (void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1);
- (void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NubvARB 4201
-void
-__indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttribs1dvNV 4210
-void
-__indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 8));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs1dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 8));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs1fvNV 4206
-void
-__indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs1fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs1svNV 4202
-void
-__indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 2));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs1svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 2));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs2dvNV 4211
-void
-__indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 16));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs2dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 16));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs2fvNV 4207
-void
-__indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 8));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs2fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 8));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs2svNV 4203
-void
-__indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs2svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs3dvNV 4212
-void
-__indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 24));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs3dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 24));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs3fvNV 4208
-void
-__indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 12));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs3fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 12));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs3svNV 4204
-void
-__indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 6));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs3svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 6));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs4dvNV 4213
-void
-__indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 32));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 32));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs4fvNV 4209
-void
-__indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 16));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 16));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs4svNV 4205
-void
-__indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 8));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs4svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 8));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_VertexAttribs4ubvNV 4214
-void
-__indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12 + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_VertexAttribs4ubvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_PointParameteriNV 4221
-void
-__indirect_glPointParameteriNV(GLenum pname, GLint param)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_PointParameteriNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_PointParameterivNV 4222
-void
-__indirect_glPointParameterivNV(GLenum pname, const GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint compsize = __glPointParameterivNV_size(pname);
- const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4));
- emit_header(gc->pc, X_GLrop_PointParameterivNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ActiveStencilFaceEXT 4220
-void
-__indirect_glActiveStencilFaceEXT(GLenum face)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_ActiveStencilFaceEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4bvARB 4230
-void
-__indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4bvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4ivARB 4231
-void
-__indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4ivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4ubvARB 4232
-void
-__indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4ubvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4usvARB 4233
-void
-__indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4usvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4uivARB 4234
-void
-__indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4uivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NbvARB 4235
-void
-__indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NbvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NsvARB 4236
-void
-__indirect_glVertexAttrib4NsvARB(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NsvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NivARB 4237
-void
-__indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NusvARB 4238
-void
-__indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NusvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4NuivARB 4239
-void
-__indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4NuivARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramStringARB 4217
-void
-__indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16 + __GLX_PAD(len);
- if (__builtin_expect((len >= 0) && (gc->currentDpy != NULL), 1)) {
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- if ( (gc->pc + cmdlen) > gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- emit_header(gc->pc, X_GLrop_ProgramStringARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&format), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&len), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(string), len);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
- else {
- const GLint op = X_GLrop_ProgramStringARB;
- const GLuint cmdlenLarge = cmdlen + 4;
- GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
- (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&op), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 12), (void *)(&format), 4);
- (void) memcpy((void *)(pc + 16), (void *)(&len), 4);
- __glXSendLargeCommand(gc, pc, 20, string, len);
- }
- }
-}
-
-#define X_GLrop_ProgramEnvParameter4dvARB 4185
-void
-__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramEnvParameter4dvARB 4185
-void
-__indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 32);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramEnvParameter4fvARB 4184
-void
-__indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramEnvParameter4fvARB 4184
-void
-__indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramLocalParameter4dvARB 4216
-void
-__indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramLocalParameter4dvARB 4216
-void
-__indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44;
- emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 32);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramLocalParameter4fvARB 4215
-void
-__indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_ProgramLocalParameter4fvARB 4215
-void
-__indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_GetProgramivARB 1307
-void
-__indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetProgramStringARB 1308
-void
-__indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 1, string, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLrop_ProgramNamedParameter4fvNV 4218
-void
-__indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28 + __GLX_PAD(len);
- if (__builtin_expect(len >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&id), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&len), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
- (void) memcpy((void *)(gc->pc + 28), (void *)(name), len);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_ProgramNamedParameter4dvNV 4219
-void
-__indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44 + __GLX_PAD(len);
- if (__builtin_expect(len >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&id), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&len), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(name), len);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_ProgramNamedParameter4fvNV 4218
-void
-__indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28 + __GLX_PAD(len);
- if (__builtin_expect(len >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&id), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&len), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(v), 16);
- (void) memcpy((void *)(gc->pc + 28), (void *)(name), len);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLrop_ProgramNamedParameter4dvNV 4219
-void
-__indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 44 + __GLX_PAD(len);
- if (__builtin_expect(len >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(v), 32);
- (void) memcpy((void *)(gc->pc + 36), (void *)(&id), 4);
- (void) memcpy((void *)(gc->pc + 40), (void *)(&len), 4);
- (void) memcpy((void *)(gc->pc + 44), (void *)(name), len);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLvop_GetProgramNamedParameterfvNV 1310
-void
-__indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8 + __GLX_PAD(len);
- if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterfvNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&len), 4);
- (void) memcpy((void *)(pc + 8), (void *)(name), len);
- (void) __glXReadReply(dpy, 4, params, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetProgramNamedParameterdvNV 1311
-void
-__indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8 + __GLX_PAD(len);
- if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterdvNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&len), 4);
- (void) memcpy((void *)(pc + 8), (void *)(name), len);
- (void) __glXReadReply(dpy, 8, params, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLsop_GenQueriesARB 162
-void
-__indirect_glGenQueriesARB(GLsizei n, GLuint * ids)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGenQueriesARBRep *reply = XCBGlxGenQueriesARBReply(c, XCBGlxGenQueriesARB(c, gc->currentContextTag, n), NULL);
- (void)memcpy(ids, XCBGlxGenQueriesARBData(reply), XCBGlxGenQueriesARBDataLength(reply) * sizeof(GLuint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenQueriesARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) __glXReadReply(dpy, 4, ids, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_DeleteQueriesARB 161
-void
-__indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxDeleteQueriesARB(c, gc->currentContextTag, n, ids);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteQueriesARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) memcpy((void *)(pc + 4), (void *)(ids), (n * 4));
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_IsQueryARB 163
-GLboolean
-__indirect_glIsQueryARB(GLuint id)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxIsQueryARBRep *reply = XCBGlxIsQueryARBReply(c, XCBGlxIsQueryARB(c, gc->currentContextTag, id), NULL);
- retval = reply->ret_val;
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsQueryARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return retval;
-}
-
-#define X_GLrop_BeginQueryARB 231
-void
-__indirect_glBeginQueryARB(GLenum target, GLuint id)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_BeginQueryARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_EndQueryARB 232
-void
-__indirect_glEndQueryARB(GLenum target)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_EndQueryARB, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLsop_GetQueryivARB 164
-void
-__indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetQueryivARBRep *reply = XCBGlxGetQueryivARBReply(c, XCBGlxGetQueryivARB(c, gc->currentContextTag, target, pname), NULL);
- if (XCBGlxGetQueryivARBDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetQueryivARBData(reply), XCBGlxGetQueryivARBDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryivARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetQueryObjectivARB 165
-void
-__indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetQueryObjectivARBRep *reply = XCBGlxGetQueryObjectivARBReply(c, XCBGlxGetQueryObjectivARB(c, gc->currentContextTag, id, pname), NULL);
- if (XCBGlxGetQueryObjectivARBDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetQueryObjectivARBData(reply), XCBGlxGetQueryObjectivARBDataLength(reply) * sizeof(GLint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectivARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLsop_GetQueryObjectuivARB 166
-void
-__indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
-#ifdef USE_XCB
- XCBConnection *c = XCBConnectionOfDisplay(dpy);
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- XCBGlxGetQueryObjectuivARBRep *reply = XCBGlxGetQueryObjectuivARBReply(c, XCBGlxGetQueryObjectuivARB(c, gc->currentContextTag, id, pname), NULL);
- if (XCBGlxGetQueryObjectuivARBDataLength(reply) == 0)
- (void)memcpy(params, &reply->datum, sizeof(reply->datum));
- else
- (void)memcpy(params, XCBGlxGetQueryObjectuivARBData(reply), XCBGlxGetQueryObjectuivARBDataLength(reply) * sizeof(GLuint));
- free(reply);
-#else
- GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectuivARB, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&id), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
-#endif /* USE_XCB */
- }
- return;
-}
-
-#define X_GLvop_GetVertexAttribdvNV 1301
-void
-__indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribdvNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&index), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 8, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetVertexAttribfvNV 1302
-void
-__indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribfvNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&index), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_GetVertexAttribivNV 1303
-void
-__indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribivNV, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&index), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLrop_VertexAttrib1dvNV 4197
-void
-__indirect_glVertexAttrib1dNV(GLuint index, GLdouble x)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1dvNV 4197
-void
-__indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1fvNV 4193
-void
-__indirect_glVertexAttrib1fNV(GLuint index, GLfloat x)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1fvNV 4193
-void
-__indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1svNV 4189
-void
-__indirect_glVertexAttrib1sNV(GLuint index, GLshort x)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib1svNV 4189
-void
-__indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2dvNV 4198
-void
-__indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2dvNV 4198
-void
-__indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2fvNV 4194
-void
-__indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2fvNV 4194
-void
-__indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2svNV 4190
-void
-__indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib2svNV 4190
-void
-__indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3dvNV 4199
-void
-__indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3dvNV 4199
-void
-__indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 32;
- emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 24);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3fvNV 4195
-void
-__indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3fvNV 4195
-void
-__indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3svNV 4191
-void
-__indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib3svNV 4191
-void
-__indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 6);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4dvNV 4200
-void
-__indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8);
- (void) memcpy((void *)(gc->pc + 32), (void *)(&w), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4dvNV 4200
-void
-__indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 40;
- emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 32);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4fvNV 4196
-void
-__indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&w), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4fvNV 4196
-void
-__indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4svNV 4192
-void
-__indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
- (void) memcpy((void *)(gc->pc + 14), (void *)(&w), 2);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4svNV 4192
-void
-__indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 16;
- emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4ubvNV 4201
-void
-__indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1);
- (void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1);
- (void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1);
- (void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_VertexAttrib4ubvNV 4201
-void
-__indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_IsRenderbufferEXT 1422
-GLboolean
-__indirect_glIsRenderbufferEXT(GLuint renderbuffer)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsRenderbufferEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&renderbuffer), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLrop_BindRenderbufferEXT 4316
-void
-__indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_BindRenderbufferEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&renderbuffer), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_DeleteRenderbuffersEXT 4317
-void
-__indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8 + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_DeleteRenderbuffersEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(renderbuffers), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLvop_GenRenderbuffersEXT 1423
-void
-__indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenRenderbuffersEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) __glXReadReply(dpy, 4, renderbuffers, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLrop_RenderbufferStorageEXT 4318
-void
-__indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_RenderbufferStorageEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_GetRenderbufferParameterivEXT 1424
-void
-__indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetRenderbufferParameterivEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_IsFramebufferEXT 1425
-GLboolean
-__indirect_glIsFramebufferEXT(GLuint framebuffer)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLboolean retval = (GLboolean) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsFramebufferEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&framebuffer), 4);
- retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLrop_BindFramebufferEXT 4319
-void
-__indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 12;
- emit_header(gc->pc, X_GLrop_BindFramebufferEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&framebuffer), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_DeleteFramebuffersEXT 4320
-void
-__indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8 + __GLX_PAD((n * 4));
- if (__builtin_expect(n >= 0, 1)) {
- emit_header(gc->pc, X_GLrop_DeleteFramebuffersEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(framebuffers), (n * 4));
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
- }
-}
-
-#define X_GLvop_GenFramebuffersEXT 1426
-void
-__indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 4;
- if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenFramebuffersEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&n), 4);
- (void) __glXReadReply(dpy, 4, framebuffers, GL_TRUE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLvop_CheckFramebufferStatusEXT 1427
-GLenum
-__indirect_glCheckFramebufferStatusEXT(GLenum target)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- GLenum retval = (GLenum) 0;
- const GLuint cmdlen = 4;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_CheckFramebufferStatusEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- retval = (GLenum) __glXReadReply(dpy, 0, NULL, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return retval;
-}
-
-#define X_GLrop_FramebufferTexture1DEXT 4321
-void
-__indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_FramebufferTexture1DEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FramebufferTexture2DEXT 4322
-void
-__indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 24;
- emit_header(gc->pc, X_GLrop_FramebufferTexture2DEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FramebufferTexture3DEXT 4323
-void
-__indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 28;
- emit_header(gc->pc, X_GLrop_FramebufferTexture3DEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4);
- (void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4);
- (void) memcpy((void *)(gc->pc + 24), (void *)(&zoffset), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLrop_FramebufferRenderbufferEXT 4324
-void
-__indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 20;
- emit_header(gc->pc, X_GLrop_FramebufferRenderbufferEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
- (void) memcpy((void *)(gc->pc + 12), (void *)(&renderbuffertarget), 4);
- (void) memcpy((void *)(gc->pc + 16), (void *)(&renderbuffer), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-#define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428
-void
-__indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetFramebufferAttachmentParameterivEXT, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
- (void) memcpy((void *)(pc + 4), (void *)(&attachment), 4);
- (void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
- (void) __glXReadReply(dpy, 4, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-#define X_GLrop_GenerateMipmapEXT 4325
-void
-__indirect_glGenerateMipmapEXT(GLenum target)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = 8;
- emit_header(gc->pc, X_GLrop_GenerateMipmapEXT, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-
-
-# undef FASTCALL
-# undef NOINLINE
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect.h b/nx-X11/extras/Mesa/src/glx/x11/indirect.h
deleted file mode 100644
index 1c45fa28a..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect.h
+++ /dev/null
@@ -1,707 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */
-
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#if !defined( _INDIRECT_H_ )
-# define _INDIRECT_H_
-
-/**
- * \file
- * Prototypes for indirect rendering functions.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
-# define HIDDEN __attribute__((visibility("hidden")))
-# else
-# define HIDDEN
-# endif
-# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-# define FASTCALL __attribute__((fastcall))
-# else
-# define FASTCALL
-# endif
-# if defined(__GNUC__)
-# define NOINLINE __attribute__((noinline))
-# else
-# define NOINLINE
-# endif
-
-#include "glxclient.h"
-
-extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size,
- void * dest, GLboolean reply_is_always_array );
-
-extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy,
- __GLXcontext * gc, unsigned max_dim, GLint width, GLint height,
- GLint depth, GLenum format, GLenum type, void * dest,
- GLboolean dimensions_in_reply );
-
-extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest(
- __GLXcontext * gc, GLint sop, GLint cmdlen );
-
-extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest(
- __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen );
-
-extern HIDDEN void __indirect_glNewList(GLuint list, GLenum mode);
-extern HIDDEN void __indirect_glEndList(void);
-extern HIDDEN void __indirect_glCallList(GLuint list);
-extern HIDDEN void __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists);
-extern HIDDEN void __indirect_glDeleteLists(GLuint list, GLsizei range);
-extern HIDDEN GLuint __indirect_glGenLists(GLsizei range);
-extern HIDDEN void __indirect_glListBase(GLuint base);
-extern HIDDEN void __indirect_glBegin(GLenum mode);
-extern HIDDEN void __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
-extern HIDDEN void __indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue);
-extern HIDDEN void __indirect_glColor3bv(const GLbyte * v);
-extern HIDDEN void __indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue);
-extern HIDDEN void __indirect_glColor3dv(const GLdouble * v);
-extern HIDDEN void __indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue);
-extern HIDDEN void __indirect_glColor3fv(const GLfloat * v);
-extern HIDDEN void __indirect_glColor3i(GLint red, GLint green, GLint blue);
-extern HIDDEN void __indirect_glColor3iv(const GLint * v);
-extern HIDDEN void __indirect_glColor3s(GLshort red, GLshort green, GLshort blue);
-extern HIDDEN void __indirect_glColor3sv(const GLshort * v);
-extern HIDDEN void __indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue);
-extern HIDDEN void __indirect_glColor3ubv(const GLubyte * v);
-extern HIDDEN void __indirect_glColor3ui(GLuint red, GLuint green, GLuint blue);
-extern HIDDEN void __indirect_glColor3uiv(const GLuint * v);
-extern HIDDEN void __indirect_glColor3us(GLushort red, GLushort green, GLushort blue);
-extern HIDDEN void __indirect_glColor3usv(const GLushort * v);
-extern HIDDEN void __indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-extern HIDDEN void __indirect_glColor4bv(const GLbyte * v);
-extern HIDDEN void __indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-extern HIDDEN void __indirect_glColor4dv(const GLdouble * v);
-extern HIDDEN void __indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-extern HIDDEN void __indirect_glColor4fv(const GLfloat * v);
-extern HIDDEN void __indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha);
-extern HIDDEN void __indirect_glColor4iv(const GLint * v);
-extern HIDDEN void __indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha);
-extern HIDDEN void __indirect_glColor4sv(const GLshort * v);
-extern HIDDEN void __indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-extern HIDDEN void __indirect_glColor4ubv(const GLubyte * v);
-extern HIDDEN void __indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha);
-extern HIDDEN void __indirect_glColor4uiv(const GLuint * v);
-extern HIDDEN void __indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha);
-extern HIDDEN void __indirect_glColor4usv(const GLushort * v);
-extern HIDDEN void __indirect_glEdgeFlag(GLboolean flag);
-extern HIDDEN void __indirect_glEdgeFlagv(const GLboolean * flag);
-extern HIDDEN void __indirect_glEnd(void);
-extern HIDDEN void __indirect_glIndexd(GLdouble c);
-extern HIDDEN void __indirect_glIndexdv(const GLdouble * c);
-extern HIDDEN void __indirect_glIndexf(GLfloat c);
-extern HIDDEN void __indirect_glIndexfv(const GLfloat * c);
-extern HIDDEN void __indirect_glIndexi(GLint c);
-extern HIDDEN void __indirect_glIndexiv(const GLint * c);
-extern HIDDEN void __indirect_glIndexs(GLshort c);
-extern HIDDEN void __indirect_glIndexsv(const GLshort * c);
-extern HIDDEN void __indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz);
-extern HIDDEN void __indirect_glNormal3bv(const GLbyte * v);
-extern HIDDEN void __indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz);
-extern HIDDEN void __indirect_glNormal3dv(const GLdouble * v);
-extern HIDDEN void __indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
-extern HIDDEN void __indirect_glNormal3fv(const GLfloat * v);
-extern HIDDEN void __indirect_glNormal3i(GLint nx, GLint ny, GLint nz);
-extern HIDDEN void __indirect_glNormal3iv(const GLint * v);
-extern HIDDEN void __indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz);
-extern HIDDEN void __indirect_glNormal3sv(const GLshort * v);
-extern HIDDEN void __indirect_glRasterPos2d(GLdouble x, GLdouble y);
-extern HIDDEN void __indirect_glRasterPos2dv(const GLdouble * v);
-extern HIDDEN void __indirect_glRasterPos2f(GLfloat x, GLfloat y);
-extern HIDDEN void __indirect_glRasterPos2fv(const GLfloat * v);
-extern HIDDEN void __indirect_glRasterPos2i(GLint x, GLint y);
-extern HIDDEN void __indirect_glRasterPos2iv(const GLint * v);
-extern HIDDEN void __indirect_glRasterPos2s(GLshort x, GLshort y);
-extern HIDDEN void __indirect_glRasterPos2sv(const GLshort * v);
-extern HIDDEN void __indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glRasterPos3dv(const GLdouble * v);
-extern HIDDEN void __indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glRasterPos3fv(const GLfloat * v);
-extern HIDDEN void __indirect_glRasterPos3i(GLint x, GLint y, GLint z);
-extern HIDDEN void __indirect_glRasterPos3iv(const GLint * v);
-extern HIDDEN void __indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z);
-extern HIDDEN void __indirect_glRasterPos3sv(const GLshort * v);
-extern HIDDEN void __indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glRasterPos4dv(const GLdouble * v);
-extern HIDDEN void __indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glRasterPos4fv(const GLfloat * v);
-extern HIDDEN void __indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w);
-extern HIDDEN void __indirect_glRasterPos4iv(const GLint * v);
-extern HIDDEN void __indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w);
-extern HIDDEN void __indirect_glRasterPos4sv(const GLshort * v);
-extern HIDDEN void __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-extern HIDDEN void __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2);
-extern HIDDEN void __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-extern HIDDEN void __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2);
-extern HIDDEN void __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2);
-extern HIDDEN void __indirect_glRectiv(const GLint * v1, const GLint * v2);
-extern HIDDEN void __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-extern HIDDEN void __indirect_glRectsv(const GLshort * v1, const GLshort * v2);
-extern HIDDEN void __indirect_glTexCoord1d(GLdouble s);
-extern HIDDEN void __indirect_glTexCoord1dv(const GLdouble * v);
-extern HIDDEN void __indirect_glTexCoord1f(GLfloat s);
-extern HIDDEN void __indirect_glTexCoord1fv(const GLfloat * v);
-extern HIDDEN void __indirect_glTexCoord1i(GLint s);
-extern HIDDEN void __indirect_glTexCoord1iv(const GLint * v);
-extern HIDDEN void __indirect_glTexCoord1s(GLshort s);
-extern HIDDEN void __indirect_glTexCoord1sv(const GLshort * v);
-extern HIDDEN void __indirect_glTexCoord2d(GLdouble s, GLdouble t);
-extern HIDDEN void __indirect_glTexCoord2dv(const GLdouble * v);
-extern HIDDEN void __indirect_glTexCoord2f(GLfloat s, GLfloat t);
-extern HIDDEN void __indirect_glTexCoord2fv(const GLfloat * v);
-extern HIDDEN void __indirect_glTexCoord2i(GLint s, GLint t);
-extern HIDDEN void __indirect_glTexCoord2iv(const GLint * v);
-extern HIDDEN void __indirect_glTexCoord2s(GLshort s, GLshort t);
-extern HIDDEN void __indirect_glTexCoord2sv(const GLshort * v);
-extern HIDDEN void __indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r);
-extern HIDDEN void __indirect_glTexCoord3dv(const GLdouble * v);
-extern HIDDEN void __indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
-extern HIDDEN void __indirect_glTexCoord3fv(const GLfloat * v);
-extern HIDDEN void __indirect_glTexCoord3i(GLint s, GLint t, GLint r);
-extern HIDDEN void __indirect_glTexCoord3iv(const GLint * v);
-extern HIDDEN void __indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r);
-extern HIDDEN void __indirect_glTexCoord3sv(const GLshort * v);
-extern HIDDEN void __indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-extern HIDDEN void __indirect_glTexCoord4dv(const GLdouble * v);
-extern HIDDEN void __indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-extern HIDDEN void __indirect_glTexCoord4fv(const GLfloat * v);
-extern HIDDEN void __indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q);
-extern HIDDEN void __indirect_glTexCoord4iv(const GLint * v);
-extern HIDDEN void __indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q);
-extern HIDDEN void __indirect_glTexCoord4sv(const GLshort * v);
-extern HIDDEN void __indirect_glVertex2d(GLdouble x, GLdouble y);
-extern HIDDEN void __indirect_glVertex2dv(const GLdouble * v);
-extern HIDDEN void __indirect_glVertex2f(GLfloat x, GLfloat y);
-extern HIDDEN void __indirect_glVertex2fv(const GLfloat * v);
-extern HIDDEN void __indirect_glVertex2i(GLint x, GLint y);
-extern HIDDEN void __indirect_glVertex2iv(const GLint * v);
-extern HIDDEN void __indirect_glVertex2s(GLshort x, GLshort y);
-extern HIDDEN void __indirect_glVertex2sv(const GLshort * v);
-extern HIDDEN void __indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glVertex3dv(const GLdouble * v);
-extern HIDDEN void __indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glVertex3fv(const GLfloat * v);
-extern HIDDEN void __indirect_glVertex3i(GLint x, GLint y, GLint z);
-extern HIDDEN void __indirect_glVertex3iv(const GLint * v);
-extern HIDDEN void __indirect_glVertex3s(GLshort x, GLshort y, GLshort z);
-extern HIDDEN void __indirect_glVertex3sv(const GLshort * v);
-extern HIDDEN void __indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glVertex4dv(const GLdouble * v);
-extern HIDDEN void __indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glVertex4fv(const GLfloat * v);
-extern HIDDEN void __indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w);
-extern HIDDEN void __indirect_glVertex4iv(const GLint * v);
-extern HIDDEN void __indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w);
-extern HIDDEN void __indirect_glVertex4sv(const GLshort * v);
-extern HIDDEN void __indirect_glClipPlane(GLenum plane, const GLdouble * equation);
-extern HIDDEN void __indirect_glColorMaterial(GLenum face, GLenum mode);
-extern HIDDEN void __indirect_glCullFace(GLenum mode);
-extern HIDDEN void __indirect_glFogf(GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glFogfv(GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glFogi(GLenum pname, GLint param);
-extern HIDDEN void __indirect_glFogiv(GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glFrontFace(GLenum mode);
-extern HIDDEN void __indirect_glHint(GLenum target, GLenum mode);
-extern HIDDEN void __indirect_glLightf(GLenum light, GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glLighti(GLenum light, GLenum pname, GLint param);
-extern HIDDEN void __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glLightModelf(GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glLightModelfv(GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glLightModeli(GLenum pname, GLint param);
-extern HIDDEN void __indirect_glLightModeliv(GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glLineStipple(GLint factor, GLushort pattern);
-extern HIDDEN void __indirect_glLineWidth(GLfloat width);
-extern HIDDEN void __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glMateriali(GLenum face, GLenum pname, GLint param);
-extern HIDDEN void __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glPointSize(GLfloat size);
-extern HIDDEN void __indirect_glPolygonMode(GLenum face, GLenum mode);
-extern HIDDEN void __indirect_glPolygonStipple(const GLubyte * mask);
-extern HIDDEN void __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
-extern HIDDEN void __indirect_glShadeModel(GLenum mode);
-extern HIDDEN void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param);
-extern HIDDEN void __indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param);
-extern HIDDEN void __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param);
-extern HIDDEN void __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params);
-extern HIDDEN void __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param);
-extern HIDDEN void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer);
-extern HIDDEN void __indirect_glSelectBuffer(GLsizei size, GLuint * buffer);
-extern HIDDEN GLint __indirect_glRenderMode(GLenum mode);
-extern HIDDEN void __indirect_glInitNames(void);
-extern HIDDEN void __indirect_glLoadName(GLuint name);
-extern HIDDEN void __indirect_glPassThrough(GLfloat token);
-extern HIDDEN void __indirect_glPopName(void);
-extern HIDDEN void __indirect_glPushName(GLuint name);
-extern HIDDEN void __indirect_glDrawBuffer(GLenum mode);
-extern HIDDEN void __indirect_glClear(GLbitfield mask);
-extern HIDDEN void __indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-extern HIDDEN void __indirect_glClearIndex(GLfloat c);
-extern HIDDEN void __indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-extern HIDDEN void __indirect_glClearStencil(GLint s);
-extern HIDDEN void __indirect_glClearDepth(GLclampd depth);
-extern HIDDEN void __indirect_glStencilMask(GLuint mask);
-extern HIDDEN void __indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-extern HIDDEN void __indirect_glDepthMask(GLboolean flag);
-extern HIDDEN void __indirect_glIndexMask(GLuint mask);
-extern HIDDEN void __indirect_glAccum(GLenum op, GLfloat value);
-extern HIDDEN void __indirect_glDisable(GLenum cap);
-extern HIDDEN void __indirect_glEnable(GLenum cap);
-extern HIDDEN void __indirect_glFinish(void);
-extern HIDDEN void __indirect_glFlush(void);
-extern HIDDEN void __indirect_glPopAttrib(void);
-extern HIDDEN void __indirect_glPushAttrib(GLbitfield mask);
-extern HIDDEN void __indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points);
-extern HIDDEN void __indirect_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points);
-extern HIDDEN void __indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points);
-extern HIDDEN void __indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points);
-extern HIDDEN void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
-extern HIDDEN void __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2);
-extern HIDDEN void __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-extern HIDDEN void __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-extern HIDDEN void __indirect_glEvalCoord1d(GLdouble u);
-extern HIDDEN void __indirect_glEvalCoord1dv(const GLdouble * u);
-extern HIDDEN void __indirect_glEvalCoord1f(GLfloat u);
-extern HIDDEN void __indirect_glEvalCoord1fv(const GLfloat * u);
-extern HIDDEN void __indirect_glEvalCoord2d(GLdouble u, GLdouble v);
-extern HIDDEN void __indirect_glEvalCoord2dv(const GLdouble * u);
-extern HIDDEN void __indirect_glEvalCoord2f(GLfloat u, GLfloat v);
-extern HIDDEN void __indirect_glEvalCoord2fv(const GLfloat * u);
-extern HIDDEN void __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2);
-extern HIDDEN void __indirect_glEvalPoint1(GLint i);
-extern HIDDEN void __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-extern HIDDEN void __indirect_glEvalPoint2(GLint i, GLint j);
-extern HIDDEN void __indirect_glAlphaFunc(GLenum func, GLclampf ref);
-extern HIDDEN void __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor);
-extern HIDDEN void __indirect_glLogicOp(GLenum opcode);
-extern HIDDEN void __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask);
-extern HIDDEN void __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
-extern HIDDEN void __indirect_glDepthFunc(GLenum func);
-extern HIDDEN void __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor);
-extern HIDDEN void __indirect_glPixelTransferf(GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glPixelTransferi(GLenum pname, GLint param);
-extern HIDDEN void __indirect_glPixelStoref(GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glPixelStorei(GLenum pname, GLint param);
-extern HIDDEN void __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values);
-extern HIDDEN void __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values);
-extern HIDDEN void __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values);
-extern HIDDEN void __indirect_glReadBuffer(GLenum mode);
-extern HIDDEN void __indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-extern HIDDEN void __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels);
-extern HIDDEN void __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glGetBooleanv(GLenum pname, GLboolean * params);
-extern HIDDEN void __indirect_glGetClipPlane(GLenum plane, GLdouble * equation);
-extern HIDDEN void __indirect_glGetDoublev(GLenum pname, GLdouble * params);
-extern HIDDEN GLenum __indirect_glGetError(void);
-extern HIDDEN void __indirect_glGetFloatv(GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetIntegerv(GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v);
-extern HIDDEN void __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v);
-extern HIDDEN void __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v);
-extern HIDDEN void __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetPixelMapfv(GLenum map, GLfloat * values);
-extern HIDDEN void __indirect_glGetPixelMapuiv(GLenum map, GLuint * values);
-extern HIDDEN void __indirect_glGetPixelMapusv(GLenum map, GLushort * values);
-extern HIDDEN void __indirect_glGetPolygonStipple(GLubyte * mask);
-extern HIDDEN const GLubyte * __indirect_glGetString(GLenum name);
-extern HIDDEN void __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params);
-extern HIDDEN void __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels);
-extern HIDDEN void __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params);
-extern HIDDEN GLboolean __indirect_glIsEnabled(GLenum cap);
-extern HIDDEN GLboolean __indirect_glIsList(GLuint list);
-extern HIDDEN void __indirect_glDepthRange(GLclampd zNear, GLclampd zFar);
-extern HIDDEN void __indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-extern HIDDEN void __indirect_glLoadIdentity(void);
-extern HIDDEN void __indirect_glLoadMatrixf(const GLfloat * m);
-extern HIDDEN void __indirect_glLoadMatrixd(const GLdouble * m);
-extern HIDDEN void __indirect_glMatrixMode(GLenum mode);
-extern HIDDEN void __indirect_glMultMatrixf(const GLfloat * m);
-extern HIDDEN void __indirect_glMultMatrixd(const GLdouble * m);
-extern HIDDEN void __indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-extern HIDDEN void __indirect_glPopMatrix(void);
-extern HIDDEN void __indirect_glPushMatrix(void);
-extern HIDDEN void __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
-extern HIDDEN void __indirect_glArrayElement(GLint i);
-extern HIDDEN void __indirect_glBindTexture(GLenum target, GLuint texture);
-extern HIDDEN void __indirect_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glDisableClientState(GLenum array);
-extern HIDDEN void __indirect_glDrawArrays(GLenum mode, GLint first, GLsizei count);
-extern HIDDEN void __indirect_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices);
-extern HIDDEN void __indirect_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glEnableClientState(GLenum array);
-extern HIDDEN void __indirect_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glIndexub(GLubyte c);
-extern HIDDEN void __indirect_glIndexubv(const GLubyte * c);
-extern HIDDEN void __indirect_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glNormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glPolygonOffset(GLfloat factor, GLfloat units);
-extern HIDDEN void __indirect_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN GLboolean __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences);
-extern HIDDEN void __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-extern HIDDEN void __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-extern HIDDEN void __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-extern HIDDEN void __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-extern HIDDEN void __indirect_glDeleteTextures(GLsizei n, const GLuint * textures);
-extern HIDDEN void __indirect_glGenTextures(GLsizei n, GLuint * textures);
-extern HIDDEN void __indirect_glGetPointerv(GLenum pname, GLvoid ** params);
-extern HIDDEN GLboolean __indirect_glIsTexture(GLuint texture);
-extern HIDDEN void __indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities);
-extern HIDDEN void __indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glPopClientAttrib(void);
-extern HIDDEN void __indirect_glPushClientAttrib(GLbitfield mask);
-extern HIDDEN void __indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-extern HIDDEN void __indirect_glBlendEquation(GLenum mode);
-extern HIDDEN void __indirect_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
-extern HIDDEN void __indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table);
-extern HIDDEN void __indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-extern HIDDEN void __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table);
-extern HIDDEN void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data);
-extern HIDDEN void __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-extern HIDDEN void __indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image);
-extern HIDDEN void __indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image);
-extern HIDDEN void __indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params);
-extern HIDDEN void __indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params);
-extern HIDDEN void __indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-extern HIDDEN void __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-extern HIDDEN void __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image);
-extern HIDDEN void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
-extern HIDDEN void __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column);
-extern HIDDEN void __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-extern HIDDEN void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-extern HIDDEN void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-extern HIDDEN void __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink);
-extern HIDDEN void __indirect_glResetHistogram(GLenum target);
-extern HIDDEN void __indirect_glResetMinmax(GLenum target);
-extern HIDDEN void __indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels);
-extern HIDDEN void __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-extern HIDDEN void __indirect_glActiveTextureARB(GLenum texture);
-extern HIDDEN void __indirect_glClientActiveTextureARB(GLenum texture);
-extern HIDDEN void __indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s);
-extern HIDDEN void __indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v);
-extern HIDDEN void __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s);
-extern HIDDEN void __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v);
-extern HIDDEN void __indirect_glMultiTexCoord1iARB(GLenum target, GLint s);
-extern HIDDEN void __indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v);
-extern HIDDEN void __indirect_glMultiTexCoord1sARB(GLenum target, GLshort s);
-extern HIDDEN void __indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v);
-extern HIDDEN void __indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
-extern HIDDEN void __indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v);
-extern HIDDEN void __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
-extern HIDDEN void __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v);
-extern HIDDEN void __indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
-extern HIDDEN void __indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v);
-extern HIDDEN void __indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
-extern HIDDEN void __indirect_glMultiTexCoord2svARB(GLenum target, const GLshort * v);
-extern HIDDEN void __indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
-extern HIDDEN void __indirect_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v);
-extern HIDDEN void __indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
-extern HIDDEN void __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v);
-extern HIDDEN void __indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
-extern HIDDEN void __indirect_glMultiTexCoord3ivARB(GLenum target, const GLint * v);
-extern HIDDEN void __indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
-extern HIDDEN void __indirect_glMultiTexCoord3svARB(GLenum target, const GLshort * v);
-extern HIDDEN void __indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-extern HIDDEN void __indirect_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v);
-extern HIDDEN void __indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-extern HIDDEN void __indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v);
-extern HIDDEN void __indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
-extern HIDDEN void __indirect_glMultiTexCoord4ivARB(GLenum target, const GLint * v);
-extern HIDDEN void __indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-extern HIDDEN void __indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v);
-extern HIDDEN void __indirect_glLoadTransposeMatrixfARB(const GLfloat * m);
-extern HIDDEN void __indirect_glLoadTransposeMatrixdARB(const GLdouble * m);
-extern HIDDEN void __indirect_glMultTransposeMatrixfARB(const GLfloat * m);
-extern HIDDEN void __indirect_glMultTransposeMatrixdARB(const GLdouble * m);
-extern HIDDEN void __indirect_glSampleCoverageARB(GLclampf value, GLboolean invert);
-extern HIDDEN void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs);
-extern HIDDEN GLboolean __indirect_glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences);
-extern HIDDEN void __indirect_glGenTexturesEXT(GLsizei n, GLuint * textures);
-extern HIDDEN GLboolean __indirect_glIsTextureEXT(GLuint texture);
-extern HIDDEN void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert);
-extern HIDDEN void __indirect_glSamplePatternSGIS(GLenum pattern);
-extern HIDDEN void __indirect_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer);
-extern HIDDEN void __indirect_glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean * pointer);
-extern HIDDEN void __indirect_glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer);
-extern HIDDEN void __indirect_glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer);
-extern HIDDEN void __indirect_glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer);
-extern HIDDEN void __indirect_glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer);
-extern HIDDEN void __indirect_glPointParameterfEXT(GLenum pname, GLfloat param);
-extern HIDDEN void __indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params);
-extern HIDDEN void __indirect_glWindowPos2dMESA(GLdouble x, GLdouble y);
-extern HIDDEN void __indirect_glWindowPos2dvMESA(const GLdouble * v);
-extern HIDDEN void __indirect_glWindowPos2fMESA(GLfloat x, GLfloat y);
-extern HIDDEN void __indirect_glWindowPos2fvMESA(const GLfloat * v);
-extern HIDDEN void __indirect_glWindowPos2iMESA(GLint x, GLint y);
-extern HIDDEN void __indirect_glWindowPos2ivMESA(const GLint * v);
-extern HIDDEN void __indirect_glWindowPos2sMESA(GLshort x, GLshort y);
-extern HIDDEN void __indirect_glWindowPos2svMESA(const GLshort * v);
-extern HIDDEN void __indirect_glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glWindowPos3dvMESA(const GLdouble * v);
-extern HIDDEN void __indirect_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glWindowPos3fvMESA(const GLfloat * v);
-extern HIDDEN void __indirect_glWindowPos3iMESA(GLint x, GLint y, GLint z);
-extern HIDDEN void __indirect_glWindowPos3ivMESA(const GLint * v);
-extern HIDDEN void __indirect_glWindowPos3sMESA(GLshort x, GLshort y, GLshort z);
-extern HIDDEN void __indirect_glWindowPos3svMESA(const GLshort * v);
-extern HIDDEN void __indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-extern HIDDEN void __indirect_glFogCoordfEXT(GLfloat coord);
-extern HIDDEN void __indirect_glFogCoordfvEXT(const GLfloat * coord);
-extern HIDDEN void __indirect_glFogCoorddEXT(GLdouble coord);
-extern HIDDEN void __indirect_glFogCoorddvEXT(const GLdouble * coord);
-extern HIDDEN void __indirect_glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data);
-extern HIDDEN void __indirect_glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data);
-extern HIDDEN void __indirect_glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data);
-extern HIDDEN void __indirect_glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data);
-extern HIDDEN void __indirect_glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data);
-extern HIDDEN void __indirect_glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data);
-extern HIDDEN void __indirect_glGetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img);
-extern HIDDEN void __indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue);
-extern HIDDEN void __indirect_glSecondaryColor3bvEXT(const GLbyte * v);
-extern HIDDEN void __indirect_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue);
-extern HIDDEN void __indirect_glSecondaryColor3dvEXT(const GLdouble * v);
-extern HIDDEN void __indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue);
-extern HIDDEN void __indirect_glSecondaryColor3fvEXT(const GLfloat * v);
-extern HIDDEN void __indirect_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue);
-extern HIDDEN void __indirect_glSecondaryColor3ivEXT(const GLint * v);
-extern HIDDEN void __indirect_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue);
-extern HIDDEN void __indirect_glSecondaryColor3svEXT(const GLshort * v);
-extern HIDDEN void __indirect_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue);
-extern HIDDEN void __indirect_glSecondaryColor3ubvEXT(const GLubyte * v);
-extern HIDDEN void __indirect_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue);
-extern HIDDEN void __indirect_glSecondaryColor3uivEXT(const GLuint * v);
-extern HIDDEN void __indirect_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue);
-extern HIDDEN void __indirect_glSecondaryColor3usvEXT(const GLushort * v);
-extern HIDDEN void __indirect_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN GLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences);
-extern HIDDEN void __indirect_glBindProgramNV(GLenum target, GLuint program);
-extern HIDDEN void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs);
-extern HIDDEN void __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params);
-extern HIDDEN void __indirect_glGenProgramsNV(GLsizei n, GLuint * programs);
-extern HIDDEN void __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params);
-extern HIDDEN void __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program);
-extern HIDDEN void __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params);
-extern HIDDEN void __indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** params);
-extern HIDDEN GLboolean __indirect_glIsProgramNV(GLuint program);
-extern HIDDEN void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program);
-extern HIDDEN void __indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * params);
-extern HIDDEN void __indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat * params);
-extern HIDDEN void __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble * params);
-extern HIDDEN void __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat * params);
-extern HIDDEN void __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids);
-extern HIDDEN void __indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform);
-extern HIDDEN void __indirect_glVertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glVertexAttrib1dARB(GLuint index, GLdouble x);
-extern HIDDEN void __indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x);
-extern HIDDEN void __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib1sARB(GLuint index, GLshort x);
-extern HIDDEN void __indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y);
-extern HIDDEN void __indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y);
-extern HIDDEN void __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y);
-extern HIDDEN void __indirect_glVertexAttrib2svARB(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z);
-extern HIDDEN void __indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glVertexAttrib4dvARB(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-extern HIDDEN void __indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-extern HIDDEN void __indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte * v);
-extern HIDDEN void __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v);
-extern HIDDEN void __indirect_glPointParameteriNV(GLenum pname, GLint param);
-extern HIDDEN void __indirect_glPointParameterivNV(GLenum pname, const GLint * params);
-extern HIDDEN void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount);
-extern HIDDEN void __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount);
-extern HIDDEN void __indirect_glActiveStencilFaceEXT(GLenum face);
-extern HIDDEN void __indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte * v);
-extern HIDDEN void __indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v);
-extern HIDDEN void __indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v);
-extern HIDDEN void __indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v);
-extern HIDDEN void __indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v);
-extern HIDDEN void __indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte * v);
-extern HIDDEN void __indirect_glVertexAttrib4NsvARB(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v);
-extern HIDDEN void __indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v);
-extern HIDDEN void __indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v);
-extern HIDDEN void __indirect_glVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer);
-extern HIDDEN void __indirect_glEnableVertexAttribArrayARB(GLuint index);
-extern HIDDEN void __indirect_glDisableVertexAttribArrayARB(GLuint index);
-extern HIDDEN void __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string);
-extern HIDDEN void __indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params);
-extern HIDDEN void __indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params);
-extern HIDDEN void __indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params);
-extern HIDDEN void __indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params);
-extern HIDDEN void __indirect_glGetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params);
-extern HIDDEN void __indirect_glGetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params);
-extern HIDDEN void __indirect_glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params);
-extern HIDDEN void __indirect_glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params);
-extern HIDDEN void __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string);
-extern HIDDEN void __indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v);
-extern HIDDEN void __indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v);
-extern HIDDEN void __indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params);
-extern HIDDEN void __indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params);
-extern HIDDEN void __indirect_glGenQueriesARB(GLsizei n, GLuint * ids);
-extern HIDDEN void __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids);
-extern HIDDEN GLboolean __indirect_glIsQueryARB(GLuint id);
-extern HIDDEN void __indirect_glBeginQueryARB(GLenum target, GLuint id);
-extern HIDDEN void __indirect_glEndQueryARB(GLenum target);
-extern HIDDEN void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params);
-extern HIDDEN void __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params);
-extern HIDDEN void __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params);
-extern HIDDEN void __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x);
-extern HIDDEN void __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x);
-extern HIDDEN void __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib1sNV(GLuint index, GLshort x);
-extern HIDDEN void __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y);
-extern HIDDEN void __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y);
-extern HIDDEN void __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y);
-extern HIDDEN void __indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z);
-extern HIDDEN void __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z);
-extern HIDDEN void __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z);
-extern HIDDEN void __indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-extern HIDDEN void __indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v);
-extern HIDDEN void __indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-extern HIDDEN void __indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v);
-extern HIDDEN void __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-extern HIDDEN void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v);
-extern HIDDEN void __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-extern HIDDEN void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v);
-extern HIDDEN GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer);
-extern HIDDEN void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
-extern HIDDEN void __indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers);
-extern HIDDEN void __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers);
-extern HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-extern HIDDEN void __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
-extern HIDDEN GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer);
-extern HIDDEN void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer);
-extern HIDDEN void __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers);
-extern HIDDEN void __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers);
-extern HIDDEN GLenum __indirect_glCheckFramebufferStatusEXT(GLenum target);
-extern HIDDEN void __indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-extern HIDDEN void __indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-extern HIDDEN void __indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-extern HIDDEN void __indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-extern HIDDEN void __indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params);
-extern HIDDEN void __indirect_glGenerateMipmapEXT(GLenum target);
-
-# undef HIDDEN
-# undef FASTCALL
-# undef NOINLINE
-
-#endif /* !defined( _INDIRECT_H_ ) */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_init.c b/nx-X11/extras/Mesa/src/glx/x11/indirect_init.c
deleted file mode 100644
index 6627edfeb..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_init.c
+++ /dev/null
@@ -1,779 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */
-
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT, 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 indirect_init.c
- * Initialize indirect rendering dispatch table.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Brian Paul <brian@precisioninsight.com>
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "indirect_init.h"
-#include "indirect.h"
-#include "glapi.h"
-
-
-/**
- * No-op function used to initialize functions that have no GLX protocol
- * support.
- */
-static int NoOp(void)
-{
- return 0;
-}
-
-/**
- * Create and initialize a new GL dispatch table. The table is initialized
- * with GLX indirect rendering protocol functions.
- */
-__GLapi * __glXNewIndirectAPI( void )
-{
- __GLapi *glAPI;
- GLuint entries;
-
- entries = _glapi_get_dispatch_table_size();
- glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *));
-
- /* first, set all entries to point to no-op functions */
- {
- int i;
- void **dispatch = (void **) glAPI;
- for (i = 0; i < entries; i++) {
- dispatch[i] = (void *) NoOp;
- }
- }
-
- /* now, initialize the entries we understand */
-
- /* 1.0 */
-
- glAPI->NewList = __indirect_glNewList;
- glAPI->EndList = __indirect_glEndList;
- glAPI->CallList = __indirect_glCallList;
- glAPI->CallLists = __indirect_glCallLists;
- glAPI->DeleteLists = __indirect_glDeleteLists;
- glAPI->GenLists = __indirect_glGenLists;
- glAPI->ListBase = __indirect_glListBase;
- glAPI->Begin = __indirect_glBegin;
- glAPI->Bitmap = __indirect_glBitmap;
- glAPI->Color3b = __indirect_glColor3b;
- glAPI->Color3bv = __indirect_glColor3bv;
- glAPI->Color3d = __indirect_glColor3d;
- glAPI->Color3dv = __indirect_glColor3dv;
- glAPI->Color3f = __indirect_glColor3f;
- glAPI->Color3fv = __indirect_glColor3fv;
- glAPI->Color3i = __indirect_glColor3i;
- glAPI->Color3iv = __indirect_glColor3iv;
- glAPI->Color3s = __indirect_glColor3s;
- glAPI->Color3sv = __indirect_glColor3sv;
- glAPI->Color3ub = __indirect_glColor3ub;
- glAPI->Color3ubv = __indirect_glColor3ubv;
- glAPI->Color3ui = __indirect_glColor3ui;
- glAPI->Color3uiv = __indirect_glColor3uiv;
- glAPI->Color3us = __indirect_glColor3us;
- glAPI->Color3usv = __indirect_glColor3usv;
- glAPI->Color4b = __indirect_glColor4b;
- glAPI->Color4bv = __indirect_glColor4bv;
- glAPI->Color4d = __indirect_glColor4d;
- glAPI->Color4dv = __indirect_glColor4dv;
- glAPI->Color4f = __indirect_glColor4f;
- glAPI->Color4fv = __indirect_glColor4fv;
- glAPI->Color4i = __indirect_glColor4i;
- glAPI->Color4iv = __indirect_glColor4iv;
- glAPI->Color4s = __indirect_glColor4s;
- glAPI->Color4sv = __indirect_glColor4sv;
- glAPI->Color4ub = __indirect_glColor4ub;
- glAPI->Color4ubv = __indirect_glColor4ubv;
- glAPI->Color4ui = __indirect_glColor4ui;
- glAPI->Color4uiv = __indirect_glColor4uiv;
- glAPI->Color4us = __indirect_glColor4us;
- glAPI->Color4usv = __indirect_glColor4usv;
- glAPI->EdgeFlag = __indirect_glEdgeFlag;
- glAPI->EdgeFlagv = __indirect_glEdgeFlagv;
- glAPI->End = __indirect_glEnd;
- glAPI->Indexd = __indirect_glIndexd;
- glAPI->Indexdv = __indirect_glIndexdv;
- glAPI->Indexf = __indirect_glIndexf;
- glAPI->Indexfv = __indirect_glIndexfv;
- glAPI->Indexi = __indirect_glIndexi;
- glAPI->Indexiv = __indirect_glIndexiv;
- glAPI->Indexs = __indirect_glIndexs;
- glAPI->Indexsv = __indirect_glIndexsv;
- glAPI->Normal3b = __indirect_glNormal3b;
- glAPI->Normal3bv = __indirect_glNormal3bv;
- glAPI->Normal3d = __indirect_glNormal3d;
- glAPI->Normal3dv = __indirect_glNormal3dv;
- glAPI->Normal3f = __indirect_glNormal3f;
- glAPI->Normal3fv = __indirect_glNormal3fv;
- glAPI->Normal3i = __indirect_glNormal3i;
- glAPI->Normal3iv = __indirect_glNormal3iv;
- glAPI->Normal3s = __indirect_glNormal3s;
- glAPI->Normal3sv = __indirect_glNormal3sv;
- glAPI->RasterPos2d = __indirect_glRasterPos2d;
- glAPI->RasterPos2dv = __indirect_glRasterPos2dv;
- glAPI->RasterPos2f = __indirect_glRasterPos2f;
- glAPI->RasterPos2fv = __indirect_glRasterPos2fv;
- glAPI->RasterPos2i = __indirect_glRasterPos2i;
- glAPI->RasterPos2iv = __indirect_glRasterPos2iv;
- glAPI->RasterPos2s = __indirect_glRasterPos2s;
- glAPI->RasterPos2sv = __indirect_glRasterPos2sv;
- glAPI->RasterPos3d = __indirect_glRasterPos3d;
- glAPI->RasterPos3dv = __indirect_glRasterPos3dv;
- glAPI->RasterPos3f = __indirect_glRasterPos3f;
- glAPI->RasterPos3fv = __indirect_glRasterPos3fv;
- glAPI->RasterPos3i = __indirect_glRasterPos3i;
- glAPI->RasterPos3iv = __indirect_glRasterPos3iv;
- glAPI->RasterPos3s = __indirect_glRasterPos3s;
- glAPI->RasterPos3sv = __indirect_glRasterPos3sv;
- glAPI->RasterPos4d = __indirect_glRasterPos4d;
- glAPI->RasterPos4dv = __indirect_glRasterPos4dv;
- glAPI->RasterPos4f = __indirect_glRasterPos4f;
- glAPI->RasterPos4fv = __indirect_glRasterPos4fv;
- glAPI->RasterPos4i = __indirect_glRasterPos4i;
- glAPI->RasterPos4iv = __indirect_glRasterPos4iv;
- glAPI->RasterPos4s = __indirect_glRasterPos4s;
- glAPI->RasterPos4sv = __indirect_glRasterPos4sv;
- glAPI->Rectd = __indirect_glRectd;
- glAPI->Rectdv = __indirect_glRectdv;
- glAPI->Rectf = __indirect_glRectf;
- glAPI->Rectfv = __indirect_glRectfv;
- glAPI->Recti = __indirect_glRecti;
- glAPI->Rectiv = __indirect_glRectiv;
- glAPI->Rects = __indirect_glRects;
- glAPI->Rectsv = __indirect_glRectsv;
- glAPI->TexCoord1d = __indirect_glTexCoord1d;
- glAPI->TexCoord1dv = __indirect_glTexCoord1dv;
- glAPI->TexCoord1f = __indirect_glTexCoord1f;
- glAPI->TexCoord1fv = __indirect_glTexCoord1fv;
- glAPI->TexCoord1i = __indirect_glTexCoord1i;
- glAPI->TexCoord1iv = __indirect_glTexCoord1iv;
- glAPI->TexCoord1s = __indirect_glTexCoord1s;
- glAPI->TexCoord1sv = __indirect_glTexCoord1sv;
- glAPI->TexCoord2d = __indirect_glTexCoord2d;
- glAPI->TexCoord2dv = __indirect_glTexCoord2dv;
- glAPI->TexCoord2f = __indirect_glTexCoord2f;
- glAPI->TexCoord2fv = __indirect_glTexCoord2fv;
- glAPI->TexCoord2i = __indirect_glTexCoord2i;
- glAPI->TexCoord2iv = __indirect_glTexCoord2iv;
- glAPI->TexCoord2s = __indirect_glTexCoord2s;
- glAPI->TexCoord2sv = __indirect_glTexCoord2sv;
- glAPI->TexCoord3d = __indirect_glTexCoord3d;
- glAPI->TexCoord3dv = __indirect_glTexCoord3dv;
- glAPI->TexCoord3f = __indirect_glTexCoord3f;
- glAPI->TexCoord3fv = __indirect_glTexCoord3fv;
- glAPI->TexCoord3i = __indirect_glTexCoord3i;
- glAPI->TexCoord3iv = __indirect_glTexCoord3iv;
- glAPI->TexCoord3s = __indirect_glTexCoord3s;
- glAPI->TexCoord3sv = __indirect_glTexCoord3sv;
- glAPI->TexCoord4d = __indirect_glTexCoord4d;
- glAPI->TexCoord4dv = __indirect_glTexCoord4dv;
- glAPI->TexCoord4f = __indirect_glTexCoord4f;
- glAPI->TexCoord4fv = __indirect_glTexCoord4fv;
- glAPI->TexCoord4i = __indirect_glTexCoord4i;
- glAPI->TexCoord4iv = __indirect_glTexCoord4iv;
- glAPI->TexCoord4s = __indirect_glTexCoord4s;
- glAPI->TexCoord4sv = __indirect_glTexCoord4sv;
- glAPI->Vertex2d = __indirect_glVertex2d;
- glAPI->Vertex2dv = __indirect_glVertex2dv;
- glAPI->Vertex2f = __indirect_glVertex2f;
- glAPI->Vertex2fv = __indirect_glVertex2fv;
- glAPI->Vertex2i = __indirect_glVertex2i;
- glAPI->Vertex2iv = __indirect_glVertex2iv;
- glAPI->Vertex2s = __indirect_glVertex2s;
- glAPI->Vertex2sv = __indirect_glVertex2sv;
- glAPI->Vertex3d = __indirect_glVertex3d;
- glAPI->Vertex3dv = __indirect_glVertex3dv;
- glAPI->Vertex3f = __indirect_glVertex3f;
- glAPI->Vertex3fv = __indirect_glVertex3fv;
- glAPI->Vertex3i = __indirect_glVertex3i;
- glAPI->Vertex3iv = __indirect_glVertex3iv;
- glAPI->Vertex3s = __indirect_glVertex3s;
- glAPI->Vertex3sv = __indirect_glVertex3sv;
- glAPI->Vertex4d = __indirect_glVertex4d;
- glAPI->Vertex4dv = __indirect_glVertex4dv;
- glAPI->Vertex4f = __indirect_glVertex4f;
- glAPI->Vertex4fv = __indirect_glVertex4fv;
- glAPI->Vertex4i = __indirect_glVertex4i;
- glAPI->Vertex4iv = __indirect_glVertex4iv;
- glAPI->Vertex4s = __indirect_glVertex4s;
- glAPI->Vertex4sv = __indirect_glVertex4sv;
- glAPI->ClipPlane = __indirect_glClipPlane;
- glAPI->ColorMaterial = __indirect_glColorMaterial;
- glAPI->CullFace = __indirect_glCullFace;
- glAPI->Fogf = __indirect_glFogf;
- glAPI->Fogfv = __indirect_glFogfv;
- glAPI->Fogi = __indirect_glFogi;
- glAPI->Fogiv = __indirect_glFogiv;
- glAPI->FrontFace = __indirect_glFrontFace;
- glAPI->Hint = __indirect_glHint;
- glAPI->Lightf = __indirect_glLightf;
- glAPI->Lightfv = __indirect_glLightfv;
- glAPI->Lighti = __indirect_glLighti;
- glAPI->Lightiv = __indirect_glLightiv;
- glAPI->LightModelf = __indirect_glLightModelf;
- glAPI->LightModelfv = __indirect_glLightModelfv;
- glAPI->LightModeli = __indirect_glLightModeli;
- glAPI->LightModeliv = __indirect_glLightModeliv;
- glAPI->LineStipple = __indirect_glLineStipple;
- glAPI->LineWidth = __indirect_glLineWidth;
- glAPI->Materialf = __indirect_glMaterialf;
- glAPI->Materialfv = __indirect_glMaterialfv;
- glAPI->Materiali = __indirect_glMateriali;
- glAPI->Materialiv = __indirect_glMaterialiv;
- glAPI->PointSize = __indirect_glPointSize;
- glAPI->PolygonMode = __indirect_glPolygonMode;
- glAPI->PolygonStipple = __indirect_glPolygonStipple;
- glAPI->Scissor = __indirect_glScissor;
- glAPI->ShadeModel = __indirect_glShadeModel;
- glAPI->TexParameterf = __indirect_glTexParameterf;
- glAPI->TexParameterfv = __indirect_glTexParameterfv;
- glAPI->TexParameteri = __indirect_glTexParameteri;
- glAPI->TexParameteriv = __indirect_glTexParameteriv;
- glAPI->TexImage1D = __indirect_glTexImage1D;
- glAPI->TexImage2D = __indirect_glTexImage2D;
- glAPI->TexEnvf = __indirect_glTexEnvf;
- glAPI->TexEnvfv = __indirect_glTexEnvfv;
- glAPI->TexEnvi = __indirect_glTexEnvi;
- glAPI->TexEnviv = __indirect_glTexEnviv;
- glAPI->TexGend = __indirect_glTexGend;
- glAPI->TexGendv = __indirect_glTexGendv;
- glAPI->TexGenf = __indirect_glTexGenf;
- glAPI->TexGenfv = __indirect_glTexGenfv;
- glAPI->TexGeni = __indirect_glTexGeni;
- glAPI->TexGeniv = __indirect_glTexGeniv;
- glAPI->FeedbackBuffer = __indirect_glFeedbackBuffer;
- glAPI->SelectBuffer = __indirect_glSelectBuffer;
- glAPI->RenderMode = __indirect_glRenderMode;
- glAPI->InitNames = __indirect_glInitNames;
- glAPI->LoadName = __indirect_glLoadName;
- glAPI->PassThrough = __indirect_glPassThrough;
- glAPI->PopName = __indirect_glPopName;
- glAPI->PushName = __indirect_glPushName;
- glAPI->DrawBuffer = __indirect_glDrawBuffer;
- glAPI->Clear = __indirect_glClear;
- glAPI->ClearAccum = __indirect_glClearAccum;
- glAPI->ClearIndex = __indirect_glClearIndex;
- glAPI->ClearColor = __indirect_glClearColor;
- glAPI->ClearStencil = __indirect_glClearStencil;
- glAPI->ClearDepth = __indirect_glClearDepth;
- glAPI->StencilMask = __indirect_glStencilMask;
- glAPI->ColorMask = __indirect_glColorMask;
- glAPI->DepthMask = __indirect_glDepthMask;
- glAPI->IndexMask = __indirect_glIndexMask;
- glAPI->Accum = __indirect_glAccum;
- glAPI->Disable = __indirect_glDisable;
- glAPI->Enable = __indirect_glEnable;
- glAPI->Finish = __indirect_glFinish;
- glAPI->Flush = __indirect_glFlush;
- glAPI->PopAttrib = __indirect_glPopAttrib;
- glAPI->PushAttrib = __indirect_glPushAttrib;
- glAPI->Map1d = __indirect_glMap1d;
- glAPI->Map1f = __indirect_glMap1f;
- glAPI->Map2d = __indirect_glMap2d;
- glAPI->Map2f = __indirect_glMap2f;
- glAPI->MapGrid1d = __indirect_glMapGrid1d;
- glAPI->MapGrid1f = __indirect_glMapGrid1f;
- glAPI->MapGrid2d = __indirect_glMapGrid2d;
- glAPI->MapGrid2f = __indirect_glMapGrid2f;
- glAPI->EvalCoord1d = __indirect_glEvalCoord1d;
- glAPI->EvalCoord1dv = __indirect_glEvalCoord1dv;
- glAPI->EvalCoord1f = __indirect_glEvalCoord1f;
- glAPI->EvalCoord1fv = __indirect_glEvalCoord1fv;
- glAPI->EvalCoord2d = __indirect_glEvalCoord2d;
- glAPI->EvalCoord2dv = __indirect_glEvalCoord2dv;
- glAPI->EvalCoord2f = __indirect_glEvalCoord2f;
- glAPI->EvalCoord2fv = __indirect_glEvalCoord2fv;
- glAPI->EvalMesh1 = __indirect_glEvalMesh1;
- glAPI->EvalPoint1 = __indirect_glEvalPoint1;
- glAPI->EvalMesh2 = __indirect_glEvalMesh2;
- glAPI->EvalPoint2 = __indirect_glEvalPoint2;
- glAPI->AlphaFunc = __indirect_glAlphaFunc;
- glAPI->BlendFunc = __indirect_glBlendFunc;
- glAPI->LogicOp = __indirect_glLogicOp;
- glAPI->StencilFunc = __indirect_glStencilFunc;
- glAPI->StencilOp = __indirect_glStencilOp;
- glAPI->DepthFunc = __indirect_glDepthFunc;
- glAPI->PixelZoom = __indirect_glPixelZoom;
- glAPI->PixelTransferf = __indirect_glPixelTransferf;
- glAPI->PixelTransferi = __indirect_glPixelTransferi;
- glAPI->PixelStoref = __indirect_glPixelStoref;
- glAPI->PixelStorei = __indirect_glPixelStorei;
- glAPI->PixelMapfv = __indirect_glPixelMapfv;
- glAPI->PixelMapuiv = __indirect_glPixelMapuiv;
- glAPI->PixelMapusv = __indirect_glPixelMapusv;
- glAPI->ReadBuffer = __indirect_glReadBuffer;
- glAPI->CopyPixels = __indirect_glCopyPixels;
- glAPI->ReadPixels = __indirect_glReadPixels;
- glAPI->DrawPixels = __indirect_glDrawPixels;
- glAPI->GetBooleanv = __indirect_glGetBooleanv;
- glAPI->GetClipPlane = __indirect_glGetClipPlane;
- glAPI->GetDoublev = __indirect_glGetDoublev;
- glAPI->GetError = __indirect_glGetError;
- glAPI->GetFloatv = __indirect_glGetFloatv;
- glAPI->GetIntegerv = __indirect_glGetIntegerv;
- glAPI->GetLightfv = __indirect_glGetLightfv;
- glAPI->GetLightiv = __indirect_glGetLightiv;
- glAPI->GetMapdv = __indirect_glGetMapdv;
- glAPI->GetMapfv = __indirect_glGetMapfv;
- glAPI->GetMapiv = __indirect_glGetMapiv;
- glAPI->GetMaterialfv = __indirect_glGetMaterialfv;
- glAPI->GetMaterialiv = __indirect_glGetMaterialiv;
- glAPI->GetPixelMapfv = __indirect_glGetPixelMapfv;
- glAPI->GetPixelMapuiv = __indirect_glGetPixelMapuiv;
- glAPI->GetPixelMapusv = __indirect_glGetPixelMapusv;
- glAPI->GetPolygonStipple = __indirect_glGetPolygonStipple;
- glAPI->GetString = __indirect_glGetString;
- glAPI->GetTexEnvfv = __indirect_glGetTexEnvfv;
- glAPI->GetTexEnviv = __indirect_glGetTexEnviv;
- glAPI->GetTexGendv = __indirect_glGetTexGendv;
- glAPI->GetTexGenfv = __indirect_glGetTexGenfv;
- glAPI->GetTexGeniv = __indirect_glGetTexGeniv;
- glAPI->GetTexImage = __indirect_glGetTexImage;
- glAPI->GetTexParameterfv = __indirect_glGetTexParameterfv;
- glAPI->GetTexParameteriv = __indirect_glGetTexParameteriv;
- glAPI->GetTexLevelParameterfv = __indirect_glGetTexLevelParameterfv;
- glAPI->GetTexLevelParameteriv = __indirect_glGetTexLevelParameteriv;
- glAPI->IsEnabled = __indirect_glIsEnabled;
- glAPI->IsList = __indirect_glIsList;
- glAPI->DepthRange = __indirect_glDepthRange;
- glAPI->Frustum = __indirect_glFrustum;
- glAPI->LoadIdentity = __indirect_glLoadIdentity;
- glAPI->LoadMatrixf = __indirect_glLoadMatrixf;
- glAPI->LoadMatrixd = __indirect_glLoadMatrixd;
- glAPI->MatrixMode = __indirect_glMatrixMode;
- glAPI->MultMatrixf = __indirect_glMultMatrixf;
- glAPI->MultMatrixd = __indirect_glMultMatrixd;
- glAPI->Ortho = __indirect_glOrtho;
- glAPI->PopMatrix = __indirect_glPopMatrix;
- glAPI->PushMatrix = __indirect_glPushMatrix;
- glAPI->Rotated = __indirect_glRotated;
- glAPI->Rotatef = __indirect_glRotatef;
- glAPI->Scaled = __indirect_glScaled;
- glAPI->Scalef = __indirect_glScalef;
- glAPI->Translated = __indirect_glTranslated;
- glAPI->Translatef = __indirect_glTranslatef;
- glAPI->Viewport = __indirect_glViewport;
-
- /* 1.1 */
-
- glAPI->ArrayElement = __indirect_glArrayElement;
- glAPI->BindTexture = __indirect_glBindTexture;
- glAPI->ColorPointer = __indirect_glColorPointer;
- glAPI->DisableClientState = __indirect_glDisableClientState;
- glAPI->DrawArrays = __indirect_glDrawArrays;
- glAPI->DrawElements = __indirect_glDrawElements;
- glAPI->EdgeFlagPointer = __indirect_glEdgeFlagPointer;
- glAPI->EnableClientState = __indirect_glEnableClientState;
- glAPI->IndexPointer = __indirect_glIndexPointer;
- glAPI->Indexub = __indirect_glIndexub;
- glAPI->Indexubv = __indirect_glIndexubv;
- glAPI->InterleavedArrays = __indirect_glInterleavedArrays;
- glAPI->NormalPointer = __indirect_glNormalPointer;
- glAPI->PolygonOffset = __indirect_glPolygonOffset;
- glAPI->TexCoordPointer = __indirect_glTexCoordPointer;
- glAPI->VertexPointer = __indirect_glVertexPointer;
- glAPI->AreTexturesResident = __indirect_glAreTexturesResident;
- glAPI->CopyTexImage1D = __indirect_glCopyTexImage1D;
- glAPI->CopyTexImage2D = __indirect_glCopyTexImage2D;
- glAPI->CopyTexSubImage1D = __indirect_glCopyTexSubImage1D;
- glAPI->CopyTexSubImage2D = __indirect_glCopyTexSubImage2D;
- glAPI->DeleteTextures = __indirect_glDeleteTextures;
- glAPI->GenTextures = __indirect_glGenTextures;
- glAPI->GetPointerv = __indirect_glGetPointerv;
- glAPI->IsTexture = __indirect_glIsTexture;
- glAPI->PrioritizeTextures = __indirect_glPrioritizeTextures;
- glAPI->TexSubImage1D = __indirect_glTexSubImage1D;
- glAPI->TexSubImage2D = __indirect_glTexSubImage2D;
- glAPI->PopClientAttrib = __indirect_glPopClientAttrib;
- glAPI->PushClientAttrib = __indirect_glPushClientAttrib;
-
- /* 1.2 */
-
- glAPI->BlendColor = __indirect_glBlendColor;
- glAPI->BlendEquation = __indirect_glBlendEquation;
- glAPI->DrawRangeElements = __indirect_glDrawRangeElements;
- glAPI->ColorTable = __indirect_glColorTable;
- glAPI->ColorTableParameterfv = __indirect_glColorTableParameterfv;
- glAPI->ColorTableParameteriv = __indirect_glColorTableParameteriv;
- glAPI->CopyColorTable = __indirect_glCopyColorTable;
- glAPI->GetColorTable = __indirect_glGetColorTable;
- glAPI->GetColorTableParameterfv = __indirect_glGetColorTableParameterfv;
- glAPI->GetColorTableParameteriv = __indirect_glGetColorTableParameteriv;
- glAPI->ColorSubTable = __indirect_glColorSubTable;
- glAPI->CopyColorSubTable = __indirect_glCopyColorSubTable;
- glAPI->ConvolutionFilter1D = __indirect_glConvolutionFilter1D;
- glAPI->ConvolutionFilter2D = __indirect_glConvolutionFilter2D;
- glAPI->ConvolutionParameterf = __indirect_glConvolutionParameterf;
- glAPI->ConvolutionParameterfv = __indirect_glConvolutionParameterfv;
- glAPI->ConvolutionParameteri = __indirect_glConvolutionParameteri;
- glAPI->ConvolutionParameteriv = __indirect_glConvolutionParameteriv;
- glAPI->CopyConvolutionFilter1D = __indirect_glCopyConvolutionFilter1D;
- glAPI->CopyConvolutionFilter2D = __indirect_glCopyConvolutionFilter2D;
- glAPI->GetConvolutionFilter = __indirect_glGetConvolutionFilter;
- glAPI->GetConvolutionParameterfv = __indirect_glGetConvolutionParameterfv;
- glAPI->GetConvolutionParameteriv = __indirect_glGetConvolutionParameteriv;
- glAPI->GetSeparableFilter = __indirect_glGetSeparableFilter;
- glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D;
- glAPI->GetHistogram = __indirect_glGetHistogram;
- glAPI->GetHistogramParameterfv = __indirect_glGetHistogramParameterfv;
- glAPI->GetHistogramParameteriv = __indirect_glGetHistogramParameteriv;
- glAPI->GetMinmax = __indirect_glGetMinmax;
- glAPI->GetMinmaxParameterfv = __indirect_glGetMinmaxParameterfv;
- glAPI->GetMinmaxParameteriv = __indirect_glGetMinmaxParameteriv;
- glAPI->Histogram = __indirect_glHistogram;
- glAPI->Minmax = __indirect_glMinmax;
- glAPI->ResetHistogram = __indirect_glResetHistogram;
- glAPI->ResetMinmax = __indirect_glResetMinmax;
- glAPI->TexImage3D = __indirect_glTexImage3D;
- glAPI->TexSubImage3D = __indirect_glTexSubImage3D;
- glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D;
-
- /* 1. GL_ARB_multitexture */
-
- glAPI->MultiTexCoord2dARB = __indirect_glMultiTexCoord2dARB;
- glAPI->MultiTexCoord2dvARB = __indirect_glMultiTexCoord2dvARB;
- glAPI->MultiTexCoord2fARB = __indirect_glMultiTexCoord2fARB;
- glAPI->MultiTexCoord2fvARB = __indirect_glMultiTexCoord2fvARB;
- glAPI->MultiTexCoord2iARB = __indirect_glMultiTexCoord2iARB;
- glAPI->MultiTexCoord2ivARB = __indirect_glMultiTexCoord2ivARB;
- glAPI->MultiTexCoord2sARB = __indirect_glMultiTexCoord2sARB;
- glAPI->MultiTexCoord2svARB = __indirect_glMultiTexCoord2svARB;
- glAPI->MultiTexCoord3dARB = __indirect_glMultiTexCoord3dARB;
- glAPI->MultiTexCoord3dvARB = __indirect_glMultiTexCoord3dvARB;
- glAPI->MultiTexCoord3fARB = __indirect_glMultiTexCoord3fARB;
- glAPI->MultiTexCoord3fvARB = __indirect_glMultiTexCoord3fvARB;
- glAPI->MultiTexCoord3iARB = __indirect_glMultiTexCoord3iARB;
- glAPI->MultiTexCoord3ivARB = __indirect_glMultiTexCoord3ivARB;
- glAPI->MultiTexCoord3sARB = __indirect_glMultiTexCoord3sARB;
- glAPI->MultiTexCoord3svARB = __indirect_glMultiTexCoord3svARB;
- glAPI->MultiTexCoord4dARB = __indirect_glMultiTexCoord4dARB;
- glAPI->MultiTexCoord4dvARB = __indirect_glMultiTexCoord4dvARB;
- glAPI->MultiTexCoord4fARB = __indirect_glMultiTexCoord4fARB;
- glAPI->MultiTexCoord4fvARB = __indirect_glMultiTexCoord4fvARB;
- glAPI->MultiTexCoord4iARB = __indirect_glMultiTexCoord4iARB;
- glAPI->MultiTexCoord4ivARB = __indirect_glMultiTexCoord4ivARB;
- glAPI->MultiTexCoord4sARB = __indirect_glMultiTexCoord4sARB;
- glAPI->MultiTexCoord4svARB = __indirect_glMultiTexCoord4svARB;
- glAPI->ActiveTextureARB = __indirect_glActiveTextureARB;
- glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB;
- glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB;
- glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB;
- glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB;
- glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB;
- glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB;
- glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB;
- glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB;
- glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB;
-
- /* 3. GL_ARB_transpose_matrix */
-
- glAPI->LoadTransposeMatrixfARB = __indirect_glLoadTransposeMatrixfARB;
- glAPI->LoadTransposeMatrixdARB = __indirect_glLoadTransposeMatrixdARB;
- glAPI->MultTransposeMatrixfARB = __indirect_glMultTransposeMatrixfARB;
- glAPI->MultTransposeMatrixdARB = __indirect_glMultTransposeMatrixdARB;
-
- /* 5. GL_ARB_multisample */
-
- glAPI->SampleCoverageARB = __indirect_glSampleCoverageARB;
-
- /* 12. GL_ARB_texture_compression */
-
- glAPI->CompressedTexImage3DARB = __indirect_glCompressedTexImage3DARB;
- glAPI->CompressedTexImage2DARB = __indirect_glCompressedTexImage2DARB;
- glAPI->CompressedTexImage1DARB = __indirect_glCompressedTexImage1DARB;
- glAPI->CompressedTexSubImage3DARB = __indirect_glCompressedTexSubImage3DARB;
- glAPI->CompressedTexSubImage2DARB = __indirect_glCompressedTexSubImage2DARB;
- glAPI->CompressedTexSubImage1DARB = __indirect_glCompressedTexSubImage1DARB;
- glAPI->GetCompressedTexImageARB = __indirect_glGetCompressedTexImageARB;
-
- /* 26. GL_ARB_vertex_program */
-
- glAPI->VertexAttrib4bvARB = __indirect_glVertexAttrib4bvARB;
- glAPI->VertexAttrib4ivARB = __indirect_glVertexAttrib4ivARB;
- glAPI->VertexAttrib4ubvARB = __indirect_glVertexAttrib4ubvARB;
- glAPI->VertexAttrib4usvARB = __indirect_glVertexAttrib4usvARB;
- glAPI->VertexAttrib4uivARB = __indirect_glVertexAttrib4uivARB;
- glAPI->VertexAttrib4NbvARB = __indirect_glVertexAttrib4NbvARB;
- glAPI->VertexAttrib4NsvARB = __indirect_glVertexAttrib4NsvARB;
- glAPI->VertexAttrib4NivARB = __indirect_glVertexAttrib4NivARB;
- glAPI->VertexAttrib4NusvARB = __indirect_glVertexAttrib4NusvARB;
- glAPI->VertexAttrib4NuivARB = __indirect_glVertexAttrib4NuivARB;
- glAPI->VertexAttribPointerARB = __indirect_glVertexAttribPointerARB;
- glAPI->EnableVertexAttribArrayARB = __indirect_glEnableVertexAttribArrayARB;
- glAPI->DisableVertexAttribArrayARB = __indirect_glDisableVertexAttribArrayARB;
- glAPI->ProgramStringARB = __indirect_glProgramStringARB;
- glAPI->ProgramEnvParameter4dARB = __indirect_glProgramEnvParameter4dARB;
- glAPI->ProgramEnvParameter4dvARB = __indirect_glProgramEnvParameter4dvARB;
- glAPI->ProgramEnvParameter4fARB = __indirect_glProgramEnvParameter4fARB;
- glAPI->ProgramEnvParameter4fvARB = __indirect_glProgramEnvParameter4fvARB;
- glAPI->ProgramLocalParameter4dARB = __indirect_glProgramLocalParameter4dARB;
- glAPI->ProgramLocalParameter4dvARB = __indirect_glProgramLocalParameter4dvARB;
- glAPI->ProgramLocalParameter4fARB = __indirect_glProgramLocalParameter4fARB;
- glAPI->ProgramLocalParameter4fvARB = __indirect_glProgramLocalParameter4fvARB;
- glAPI->GetProgramEnvParameterdvARB = __indirect_glGetProgramEnvParameterdvARB;
- glAPI->GetProgramEnvParameterfvARB = __indirect_glGetProgramEnvParameterfvARB;
- glAPI->GetProgramLocalParameterdvARB = __indirect_glGetProgramLocalParameterdvARB;
- glAPI->GetProgramLocalParameterfvARB = __indirect_glGetProgramLocalParameterfvARB;
- glAPI->GetProgramivARB = __indirect_glGetProgramivARB;
- glAPI->GetProgramStringARB = __indirect_glGetProgramStringARB;
- glAPI->GetVertexAttribdvARB = __indirect_glGetVertexAttribdvARB;
- glAPI->GetVertexAttribfvARB = __indirect_glGetVertexAttribfvARB;
- glAPI->GetVertexAttribivARB = __indirect_glGetVertexAttribivARB;
- glAPI->VertexAttrib1dARB = __indirect_glVertexAttrib1dARB;
- glAPI->VertexAttrib1dvARB = __indirect_glVertexAttrib1dvARB;
- glAPI->VertexAttrib1fARB = __indirect_glVertexAttrib1fARB;
- glAPI->VertexAttrib1fvARB = __indirect_glVertexAttrib1fvARB;
- glAPI->VertexAttrib1sARB = __indirect_glVertexAttrib1sARB;
- glAPI->VertexAttrib1svARB = __indirect_glVertexAttrib1svARB;
- glAPI->VertexAttrib2dARB = __indirect_glVertexAttrib2dARB;
- glAPI->VertexAttrib2dvARB = __indirect_glVertexAttrib2dvARB;
- glAPI->VertexAttrib2fARB = __indirect_glVertexAttrib2fARB;
- glAPI->VertexAttrib2fvARB = __indirect_glVertexAttrib2fvARB;
- glAPI->VertexAttrib2sARB = __indirect_glVertexAttrib2sARB;
- glAPI->VertexAttrib2svARB = __indirect_glVertexAttrib2svARB;
- glAPI->VertexAttrib3dARB = __indirect_glVertexAttrib3dARB;
- glAPI->VertexAttrib3dvARB = __indirect_glVertexAttrib3dvARB;
- glAPI->VertexAttrib3fARB = __indirect_glVertexAttrib3fARB;
- glAPI->VertexAttrib3fvARB = __indirect_glVertexAttrib3fvARB;
- glAPI->VertexAttrib3sARB = __indirect_glVertexAttrib3sARB;
- glAPI->VertexAttrib3svARB = __indirect_glVertexAttrib3svARB;
- glAPI->VertexAttrib4dARB = __indirect_glVertexAttrib4dARB;
- glAPI->VertexAttrib4dvARB = __indirect_glVertexAttrib4dvARB;
- glAPI->VertexAttrib4fARB = __indirect_glVertexAttrib4fARB;
- glAPI->VertexAttrib4fvARB = __indirect_glVertexAttrib4fvARB;
- glAPI->VertexAttrib4sARB = __indirect_glVertexAttrib4sARB;
- glAPI->VertexAttrib4svARB = __indirect_glVertexAttrib4svARB;
- glAPI->VertexAttrib4NubARB = __indirect_glVertexAttrib4NubARB;
- glAPI->VertexAttrib4NubvARB = __indirect_glVertexAttrib4NubvARB;
-
- /* 29. GL_ARB_occlusion_query */
-
- glAPI->EndQueryARB = __indirect_glEndQueryARB;
- glAPI->GetQueryivARB = __indirect_glGetQueryivARB;
- glAPI->GetQueryObjectivARB = __indirect_glGetQueryObjectivARB;
- glAPI->GetQueryObjectuivARB = __indirect_glGetQueryObjectuivARB;
- glAPI->GenQueriesARB = __indirect_glGenQueriesARB;
- glAPI->DeleteQueriesARB = __indirect_glDeleteQueriesARB;
- glAPI->IsQueryARB = __indirect_glIsQueryARB;
- glAPI->BeginQueryARB = __indirect_glBeginQueryARB;
-
- /* 37. GL_ARB_draw_buffers */
-
- glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB;
-
- /* 20. GL_EXT_texture_object */
-
- glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT;
- glAPI->IsTextureEXT = __indirect_glIsTextureEXT;
- glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT;
-
- /* 25. GL_SGIS_multisample */
-
- glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
- glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS;
-
- /* 30. GL_EXT_vertex_array */
-
- glAPI->ColorPointerEXT = __indirect_glColorPointerEXT;
- glAPI->EdgeFlagPointerEXT = __indirect_glEdgeFlagPointerEXT;
- glAPI->IndexPointerEXT = __indirect_glIndexPointerEXT;
- glAPI->NormalPointerEXT = __indirect_glNormalPointerEXT;
- glAPI->TexCoordPointerEXT = __indirect_glTexCoordPointerEXT;
- glAPI->VertexPointerEXT = __indirect_glVertexPointerEXT;
-
- /* 54. GL_EXT_point_parameters */
-
- glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT;
- glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT;
-
- /* 145. GL_EXT_secondary_color */
-
- glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT;
- glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT;
- glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3bEXT;
- glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bvEXT;
- glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3dEXT;
- glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dvEXT;
- glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3fEXT;
- glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fvEXT;
- glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3iEXT;
- glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3ivEXT;
- glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3sEXT;
- glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3svEXT;
- glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ubEXT;
- glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubvEXT;
- glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3uiEXT;
- glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT;
- glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT;
-
- /* 148. GL_EXT_multi_draw_arrays */
-
- glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT;
- glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT;
-
- /* 149. GL_EXT_fog_coord */
-
- glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT;
- glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT;
- glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT;
- glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT;
- glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT;
-
- /* 173. GL_EXT_blend_func_separate */
-
- glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT;
-
- /* 197. GL_MESA_window_pos */
-
- glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA;
- glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA;
- glAPI->WindowPos2fMESA = __indirect_glWindowPos2fMESA;
- glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvMESA;
- glAPI->WindowPos2iMESA = __indirect_glWindowPos2iMESA;
- glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivMESA;
- glAPI->WindowPos2sMESA = __indirect_glWindowPos2sMESA;
- glAPI->WindowPos2svMESA = __indirect_glWindowPos2svMESA;
- glAPI->WindowPos3dMESA = __indirect_glWindowPos3dMESA;
- glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvMESA;
- glAPI->WindowPos3fMESA = __indirect_glWindowPos3fMESA;
- glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvMESA;
- glAPI->WindowPos3iMESA = __indirect_glWindowPos3iMESA;
- glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivMESA;
- glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA;
- glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA;
-
- /* 233. GL_NV_vertex_program */
-
- glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV;
- glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV;
- glAPI->VertexAttrib3fNV = __indirect_glVertexAttrib3fNV;
- glAPI->VertexAttrib3fvNV = __indirect_glVertexAttrib3fvNV;
- glAPI->VertexAttrib3sNV = __indirect_glVertexAttrib3sNV;
- glAPI->VertexAttrib3svNV = __indirect_glVertexAttrib3svNV;
- glAPI->VertexAttrib4dNV = __indirect_glVertexAttrib4dNV;
- glAPI->VertexAttrib3dvNV = __indirect_glVertexAttrib3dvNV;
- glAPI->VertexAttrib4fNV = __indirect_glVertexAttrib4fNV;
- glAPI->VertexAttrib4fvNV = __indirect_glVertexAttrib4fvNV;
- glAPI->VertexAttrib4sNV = __indirect_glVertexAttrib4sNV;
- glAPI->VertexAttrib4svNV = __indirect_glVertexAttrib4svNV;
- glAPI->VertexAttrib4ubNV = __indirect_glVertexAttrib4ubNV;
- glAPI->VertexAttrib4ubvNV = __indirect_glVertexAttrib4ubvNV;
- glAPI->VertexAttrib1fvNV = __indirect_glVertexAttrib1fvNV;
- glAPI->VertexAttrib3dNV = __indirect_glVertexAttrib3dNV;
- glAPI->VertexAttrib4dvNV = __indirect_glVertexAttrib4dvNV;
- glAPI->VertexAttrib1sNV = __indirect_glVertexAttrib1sNV;
- glAPI->VertexAttrib1fNV = __indirect_glVertexAttrib1fNV;
- glAPI->VertexAttrib1svNV = __indirect_glVertexAttrib1svNV;
- glAPI->VertexAttrib1dvNV = __indirect_glVertexAttrib1dvNV;
- glAPI->AreProgramsResidentNV = __indirect_glAreProgramsResidentNV;
- glAPI->BindProgramNV = __indirect_glBindProgramNV;
- glAPI->DeleteProgramsNV = __indirect_glDeleteProgramsNV;
- glAPI->ExecuteProgramNV = __indirect_glExecuteProgramNV;
- glAPI->GenProgramsNV = __indirect_glGenProgramsNV;
- glAPI->GetProgramParameterdvNV = __indirect_glGetProgramParameterdvNV;
- glAPI->GetProgramParameterfvNV = __indirect_glGetProgramParameterfvNV;
- glAPI->GetProgramivNV = __indirect_glGetProgramivNV;
- glAPI->GetProgramStringNV = __indirect_glGetProgramStringNV;
- glAPI->GetTrackMatrixivNV = __indirect_glGetTrackMatrixivNV;
- glAPI->GetVertexAttribPointervNV = __indirect_glGetVertexAttribPointervNV;
- glAPI->IsProgramNV = __indirect_glIsProgramNV;
- glAPI->LoadProgramNV = __indirect_glLoadProgramNV;
- glAPI->ProgramParameter4dNV = __indirect_glProgramParameter4dNV;
- glAPI->ProgramParameter4dvNV = __indirect_glProgramParameter4dvNV;
- glAPI->ProgramParameter4fNV = __indirect_glProgramParameter4fNV;
- glAPI->ProgramParameter4fvNV = __indirect_glProgramParameter4fvNV;
- glAPI->ProgramParameters4dvNV = __indirect_glProgramParameters4dvNV;
- glAPI->ProgramParameters4fvNV = __indirect_glProgramParameters4fvNV;
- glAPI->RequestResidentProgramsNV = __indirect_glRequestResidentProgramsNV;
- glAPI->TrackMatrixNV = __indirect_glTrackMatrixNV;
- glAPI->VertexAttribPointerNV = __indirect_glVertexAttribPointerNV;
- glAPI->VertexAttrib2dNV = __indirect_glVertexAttrib2dNV;
- glAPI->VertexAttrib2sNV = __indirect_glVertexAttrib2sNV;
- glAPI->VertexAttrib2dvNV = __indirect_glVertexAttrib2dvNV;
- glAPI->VertexAttrib2fNV = __indirect_glVertexAttrib2fNV;
- glAPI->VertexAttrib2svNV = __indirect_glVertexAttrib2svNV;
- glAPI->VertexAttrib2fvNV = __indirect_glVertexAttrib2fvNV;
- glAPI->GetVertexAttribdvNV = __indirect_glGetVertexAttribdvNV;
- glAPI->GetVertexAttribfvNV = __indirect_glGetVertexAttribfvNV;
- glAPI->GetVertexAttribivNV = __indirect_glGetVertexAttribivNV;
- glAPI->VertexAttrib1dNV = __indirect_glVertexAttrib1dNV;
- glAPI->VertexAttribs1dvNV = __indirect_glVertexAttribs1dvNV;
- glAPI->VertexAttribs1fvNV = __indirect_glVertexAttribs1fvNV;
- glAPI->VertexAttribs1svNV = __indirect_glVertexAttribs1svNV;
- glAPI->VertexAttribs2dvNV = __indirect_glVertexAttribs2dvNV;
- glAPI->VertexAttribs2fvNV = __indirect_glVertexAttribs2fvNV;
- glAPI->VertexAttribs2svNV = __indirect_glVertexAttribs2svNV;
- glAPI->VertexAttribs3dvNV = __indirect_glVertexAttribs3dvNV;
- glAPI->VertexAttribs3fvNV = __indirect_glVertexAttribs3fvNV;
- glAPI->VertexAttribs3svNV = __indirect_glVertexAttribs3svNV;
- glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV;
- glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV;
-
- /* 262. GL_NV_point_sprite */
-
- glAPI->PointParameteriNV = __indirect_glPointParameteriNV;
- glAPI->PointParameterivNV = __indirect_glPointParameterivNV;
-
- /* 268. GL_EXT_stencil_two_side */
-
- glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
-
- /* 282. GL_NV_fragment_program */
-
- glAPI->ProgramNamedParameter4fNV = __indirect_glProgramNamedParameter4fNV;
- glAPI->ProgramNamedParameter4dNV = __indirect_glProgramNamedParameter4dNV;
- glAPI->ProgramNamedParameter4fvNV = __indirect_glProgramNamedParameter4fvNV;
- glAPI->ProgramNamedParameter4dvNV = __indirect_glProgramNamedParameter4dvNV;
- glAPI->GetProgramNamedParameterfvNV = __indirect_glGetProgramNamedParameterfvNV;
- glAPI->GetProgramNamedParameterdvNV = __indirect_glGetProgramNamedParameterdvNV;
-
- /* 310. GL_EXT_framebuffer_object */
-
- glAPI->RenderbufferStorageEXT = __indirect_glRenderbufferStorageEXT;
- glAPI->GetRenderbufferParameterivEXT = __indirect_glGetRenderbufferParameterivEXT;
- glAPI->IsFramebufferEXT = __indirect_glIsFramebufferEXT;
- glAPI->BindFramebufferEXT = __indirect_glBindFramebufferEXT;
- glAPI->DeleteFramebuffersEXT = __indirect_glDeleteFramebuffersEXT;
- glAPI->GenFramebuffersEXT = __indirect_glGenFramebuffersEXT;
- glAPI->CheckFramebufferStatusEXT = __indirect_glCheckFramebufferStatusEXT;
- glAPI->FramebufferTexture1DEXT = __indirect_glFramebufferTexture1DEXT;
- glAPI->FramebufferTexture2DEXT = __indirect_glFramebufferTexture2DEXT;
- glAPI->FramebufferTexture3DEXT = __indirect_glFramebufferTexture3DEXT;
- glAPI->FramebufferRenderbufferEXT = __indirect_glFramebufferRenderbufferEXT;
- glAPI->GetFramebufferAttachmentParameterivEXT = __indirect_glGetFramebufferAttachmentParameterivEXT;
- glAPI->GenerateMipmapEXT = __indirect_glGenerateMipmapEXT;
- glAPI->IsRenderbufferEXT = __indirect_glIsRenderbufferEXT;
- glAPI->BindRenderbufferEXT = __indirect_glBindRenderbufferEXT;
- glAPI->DeleteRenderbuffersEXT = __indirect_glDeleteRenderbuffersEXT;
- glAPI->GenRenderbuffersEXT = __indirect_glGenRenderbuffersEXT;
-
- return glAPI;
-}
-
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_init.h b/nx-X11/extras/Mesa/src/glx/x11/indirect_init.h
deleted file mode 100644
index 62d04ba6d..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_init.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/indirect_init.h,v 1.2 2000/02/08 17:18:33 dawes Exp $ */
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- */
-
-#ifndef _INDIRECT_INIT_H_
-#define _INDIRECT_INIT_H_
-
-#include "glxclient.h"
-
-extern __GLapi *__glXNewIndirectAPI(void);
-
-#endif /* _INDIRECT_INIT_H_ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_transpose_matrix.c b/nx-X11/extras/Mesa/src/glx/x11/indirect_transpose_matrix.c
deleted file mode 100644
index 2144410e5..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_transpose_matrix.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <GL/gl.h>
-#include "indirect.h"
-
-static void TransposeMatrixf(const GLfloat s[16], GLfloat d[16])
-{
- int i, j;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- d[i*4+j] = s[j*4+i];
- }
- }
-}
-
-static void TransposeMatrixd(const GLdouble s[16], GLdouble d[16])
-{
- int i, j;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- d[i*4+j] = s[j*4+i];
- }
- }
-}
-
-
-void
-__indirect_glLoadTransposeMatrixdARB( const GLdouble * m )
-{
- GLdouble mt[16];
-
- TransposeMatrixd( m, mt );
- __indirect_glLoadMatrixd( mt );
-}
-
-void
-__indirect_glLoadTransposeMatrixfARB( const GLfloat * m )
-{
- GLfloat mt[16];
-
- TransposeMatrixf( m, mt );
- __indirect_glLoadMatrixf( mt );
-}
-
-void
-__indirect_glMultTransposeMatrixdARB( const GLdouble * m )
-{
- GLdouble mt[16];
-
- TransposeMatrixd( m, mt );
- __indirect_glMultMatrixd( mt );
-}
-
-void
-__indirect_glMultTransposeMatrixfARB( const GLfloat * m )
-{
- GLfloat mt[16];
-
- TransposeMatrixf( m, mt );
- __indirect_glMultMatrixf( mt );
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_va_private.h b/nx-X11/extras/Mesa/src/glx/x11/indirect_va_private.h
deleted file mode 100644
index ab97dc645..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_va_private.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * 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.
- */
-
-#ifndef _INDIRECT_VA_PRIVATE_
-#define _INDIRECT_VA_PRIVATE_
-
-/**
- * \file indirect_va_private.h
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <inttypes.h>
-
-#include "glxclient.h"
-#include "indirect.h"
-#include <GL/glxproto.h>
-
-
-/**
- * State descriptor for a single array of vertex data.
- */
-struct array_state {
- /**
- * Pointer to the application supplied data.
- */
- const void * data;
-
- /**
- * Enum representing the type of the application supplied data.
- */
- GLenum data_type;
-
- /**
- * Stride value supplied by the application. This value is not used
- * internally. It is only kept so that it can be queried by the
- * application using glGet*v.
- */
- GLsizei user_stride;
-
- /**
- * Calculated size, in bytes, of a single element in the array. This
- * is calculated based on \c count and the size of the data type
- * represented by \c data_type.
- */
- GLsizei element_size;
-
- /**
- * Actual byte-stride from one element to the next. This value will
- * be equal to either \c user_stride or \c element_stride.
- */
- GLsizei true_stride;
-
- /**
- * Number of data values in each element.
- */
- GLint count;
-
- /**
- * "Normalized" data is on the range [0,1] (unsigned) or [-1,1] (signed).
- * This is used for mapping integral types to floating point types.
- */
- GLboolean normalized;
-
- /**
- * Pre-calculated GLX protocol command header.
- */
- uint32_t header[2];
-
- /**
- * Size of the header data. For simple data, like glColorPointerfv,
- * this is 4. For complex data that requires either a count (e.g.,
- * glWeightfvARB), an index (e.g., glVertexAttrib1fvARB), or a
- * selector enum (e.g., glMultiTexCoord2fv) this is 8.
- */
- unsigned header_size;
-
- /**
- * Set to \c GL_TRUE if this array is enabled. Otherwise, it is set
- * to \c GL_FALSE.
- */
- GLboolean enabled;
-
- /**
- * For multi-arrayed data (e.g., texture coordinates, generic vertex
- * program attributes, etc.), this specifies which array this is.
- */
- unsigned index;
-
- /**
- * Per-array-type key. For most arrays, this will be the GL enum for
- * that array (e.g., GL_VERTEX_ARRAY for vertex data, GL_NORMAL_ARRAY
- * for normal data, GL_TEXTURE_COORD_ARRAY for texture coordinate data,
- * etc.).
- */
- GLenum key;
-
- /**
- * If this array can be used with the "classic" \c glDrawArrays protocol,
- * this is set to \c GL_TRUE. Otherwise, it is set to \c GL_FALSE.
- */
- GLboolean old_DrawArrays_possible;
-};
-
-
-/**
- * Array state that is pushed / poped by \c glPushClientAttrib and
- * \c glPopClientAttrib.
- */
-struct array_stack_state {
- /**
- * Pointer to the application supplied data.
- */
- const void * data;
-
- /**
- * Enum representing the type of the application supplied data.
- */
- GLenum data_type;
-
- /**
- * Stride value supplied by the application. This value is not used
- * internally. It is only kept so that it can be queried by the
- * application using glGet*v.
- */
- GLsizei user_stride;
-
- /**
- * Number of data values in each element.
- */
- GLint count;
-
- /**
- * Per-array-type key. For most arrays, this will be the GL enum for
- * that array (e.g., GL_VERTEX_ARRAY for vertex data, GL_NORMAL_ARRAY
- * for normal data, GL_TEXTURE_COORD_ARRAY for texture coordinate data,
- * etc.).
- */
- GLenum key;
-
- /**
- * For multi-arrayed data (e.g., texture coordinates, generic vertex
- * program attributes, etc.), this specifies which array this is.
- */
- unsigned index;
-
- /**
- * Set to \c GL_TRUE if this array is enabled. Otherwise, it is set
- * to \c GL_FALSE.
- */
- GLboolean enabled;
-};
-
-
-/**
- * Collection of all the vertex array state.
- */
-struct array_state_vector {
- /**
- * Number of arrays tracked by \c ::arrays.
- */
- size_t num_arrays;
-
- /**
- * Array of vertex array state. This array contains all of the valid
- * vertex arrays. If a vertex array isn't in this array, then it isn't
- * valid. For example, if an implementation does not support
- * EXT_fog_coord, there won't be a GL_FOG_COORD_ARRAY entry in this
- * array.
- */
- struct array_state * arrays;
-
- /**
- * Number of currently enabled client-side arrays. The value of this
- * field is only valid if \c array_info_cache_valid is true.
- */
- size_t enabled_client_array_count;
-
- /**
- * \name ARRAY_INFO cache.
- *
- * These fields track the state of the ARRAY_INFO cache. The
- * \c array_info_cache_size is the size of the actual data stored in
- * \c array_info_cache. \c array_info_cache_buffer_size is the size of
- * the buffer. This will always be greater than or equal to
- * \c array_info_cache_size.
- *
- * \note
- * There are some bytes of extra data before \c array_info_cache that is
- * used to hold the header for RenderLarge commands. This is
- * \b not included in \c array_info_cache_size or
- * \c array_info_cache_buffer_size. \c array_info_cache_base stores a
- * pointer to the true start of the buffer (i.e., what malloc returned).
- */
- /*@{*/
- size_t array_info_cache_size;
- size_t array_info_cache_buffer_size;
- void * array_info_cache;
- void * array_info_cache_base;
- /*@}*/
-
-
- /**
- * Is the cache of ARRAY_INFO data valid? The cache can become invalid
- * when one of several state changes occur. Among these chages are
- * modifying the array settings for an enabled array and enabling /
- * disabling an array.
- */
- GLboolean array_info_cache_valid;
-
- /**
- * Is it possible to use the GL 1.1 / EXT_vertex_arrays protocol? Use
- * of this protocol is disabled with really old servers (i.e., servers
- * that don't support GL 1.1 or EXT_vertex_arrays) or when an environment
- * variable is set.
- *
- * \todo
- * GL 1.1 and EXT_vertex_arrays use identical protocol, but have different
- * opcodes for \c glDrawArrays. For servers that advertise one or the
- * other, there should be a way to select which opcode to use.
- */
- GLboolean old_DrawArrays_possible;
-
- /**
- * Is it possible to use the new GL X.X / ARB_vertex_buffer_object
- * protocol?
- *
- * \todo
- * This protocol has not yet been defined by the ARB, but is currently a
- * work in progress. This field is a place-holder.
- */
- GLboolean new_DrawArrays_possible;
-
- /**
- * Active texture unit set by \c glClientActiveTexture.
- *
- * \sa __glXGetActiveTextureUnit
- */
- unsigned active_texture_unit;
-
- /**
- * Number of supported texture units. Even if ARB_multitexture /
- * GL 1.3 are not supported, this will be at least 1. When multitexture
- * is supported, this will be the value queried by calling
- * \c glGetIntegerv with \c GL_MAX_TEXTURE_UNITS.
- *
- * \todo
- * Investigate if this should be the value of \c GL_MAX_TEXTURE_COORDS
- * instead (if GL 2.0 / ARB_fragment_shader / ARB_fragment_program /
- * NV_fragment_program are supported).
- */
- unsigned num_texture_units;
-
- /**
- * Number of generic vertex program attribs. If GL_ARB_vertex_program
- * is not supported, this will be zero. Otherwise it will be the value
- * queries by calling \c glGetProgramiv with \c GL_VERTEX_PROGRAM_ARB
- * and \c GL_MAX_PROGRAM_ATTRIBS_ARB.
- */
- unsigned num_vertex_program_attribs;
-
- /**
- * \n Methods for implementing various GL functions.
- *
- * These method pointers are only valid \c array_info_cache_valid is set.
- * When each function starts, it much check \c array_info_cache_valid.
- * If it is not set, it must call \c fill_array_info_cache and call
- * the new method.
- *
- * \sa fill_array_info_cache
- *
- * \todo
- * Write code to plug these functions directly into the dispatch table.
- */
- /*@{*/
- void (*DrawArrays)( GLenum, GLint, GLsizei );
- void (*DrawElements)( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices );
- /*@}*/
-
- struct array_stack_state * stack;
- unsigned active_texture_unit_stack[ __GL_CLIENT_ATTRIB_STACK_DEPTH ];
- unsigned stack_index;
-};
-
-#endif /* _INDIRECT_VA_PRIVATE_ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.c b/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.c
deleted file mode 100644
index 62a101e66..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.c
+++ /dev/null
@@ -1,1847 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * 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 <inttypes.h>
-#include <assert.h>
-#include <string.h>
-
-#include "glxclient.h"
-#include "indirect.h"
-#include <GL/glxproto.h>
-#include "glxextensions.h"
-#include "indirect_vertex_array.h"
-#include "indirect_va_private.h"
-
-#define __GLX_PAD(n) (((n)+3) & ~3)
-
-/**
- * \file indirect_vertex_array.c
- * Implement GLX protocol for vertex arrays and vertex buffer objects.
- *
- * The most important function in this fill is \c fill_array_info_cache.
- * The \c array_state_vector contains a cache of the ARRAY_INFO data sent
- * in the DrawArrays protocol. Certain operations, such as enabling or
- * disabling an array, can invalidate this cache. \c fill_array_info_cache
- * fills-in this data. Additionally, it examines the enabled state and
- * other factors to determine what "version" of DrawArrays protocoal can be
- * used.
- *
- * Current, only two versions of DrawArrays protocol are implemented. The
- * first version is the "none" protocol. This is the fallback when the
- * server does not support GL 1.1 / EXT_vertex_arrays. It is implemented
- * by sending batches of immediate mode commands that are equivalent to the
- * DrawArrays protocol.
- *
- * The other protocol that is currently implemented is the "old" protocol.
- * This is the GL 1.1 DrawArrays protocol. The only difference between GL
- * 1.1 and EXT_vertex_arrays is the opcode used for the DrawArrays command.
- * This protocol is called "old" because the ARB is in the process of
- * defining a new protocol, which will probably be called wither "new" or
- * "vbo", to support multiple texture coordinate arrays, generic attributes,
- * and vertex buffer objects.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-static void emit_DrawArrays_none( GLenum mode, GLint first, GLsizei count );
-static void emit_DrawArrays_old ( GLenum mode, GLint first, GLsizei count );
-
-static void emit_DrawElements_none( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices );
-static void emit_DrawElements_old ( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices );
-
-
-static GLubyte * emit_element_none( GLubyte * dst,
- const struct array_state_vector * arrays, unsigned index );
-static GLubyte * emit_element_old( GLubyte * dst,
- const struct array_state_vector * arrays, unsigned index );
-static struct array_state * get_array_entry(
- const struct array_state_vector * arrays, GLenum key, unsigned index );
-static void fill_array_info_cache( struct array_state_vector * arrays );
-static GLboolean validate_mode(__GLXcontext *gc, GLenum mode);
-static GLboolean validate_count(__GLXcontext *gc, GLsizei count);
-static GLboolean validate_type(__GLXcontext *gc, GLenum type);
-
-
-/**
- * Table of sizes, in bytes, of a GL types. All of the type enums are be in
- * the range 0x1400 - 0x140F. That includes types added by extensions (i.e.,
- * \c GL_HALF_FLOAT_NV). This elements of this table correspond to the
- * type enums masked with 0x0f.
- *
- * \notes
- * \c GL_HALF_FLOAT_NV is not included. Neither are \c GL_2_BYTES,
- * \c GL_3_BYTES, or \c GL_4_BYTES.
- */
-const GLuint __glXTypeSize_table[16] = {
- 1, 1, 2, 2, 4, 4, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0
-};
-
-
-
-/**
- * Initialize vertex array state of a GLX context.
- *
- * \param gc GLX context whose vertex array state is to be initialized.
- *
- * \warning
- * This function may only be called after __GLXcontext::gl_extension_bits,
- * __GLXcontext::server_minor, and __GLXcontext::server_major have been
- * initialized. These values are used to determine what vertex arrays are
- * supported.
- *
- * \bug
- * Return values from malloc are not properly tested.
- */
-void
-__glXInitVertexArrayState( __GLXcontext * gc )
-{
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays;
-
- unsigned array_count;
- unsigned texture_units = 1;
- unsigned i;
- unsigned j;
- unsigned vertex_program_attribs = 0;
-
- GLboolean got_fog = GL_FALSE;
- GLboolean got_secondary_color = GL_FALSE;
-
-
- arrays = calloc( 1, sizeof( struct array_state_vector ) );
- state->array_state = arrays;
-
- arrays->old_DrawArrays_possible = !state->NoDrawArraysProtocol;
- arrays->new_DrawArrays_possible = GL_FALSE;
- arrays->DrawArrays = NULL;
-
- arrays->active_texture_unit = 0;
-
-
- /* Determine how many arrays are actually needed. Only arrays that
- * are supported by the server are create. For example, if the server
- * supports only 2 texture units, then only 2 texture coordinate arrays
- * are created.
- *
- * At the very least, GL_VERTEX_ARRAY, GL_NORMAL_ARRAY,
- * GL_COLOR_ARRAY, GL_INDEX_ARRAY, GL_TEXTURE_COORD_ARRAY, and
- * GL_EDGE_FLAG_ARRAY are supported.
- */
-
- array_count = 5;
-
- if ( __glExtensionBitIsEnabled( gc, GL_EXT_fog_coord_bit )
- || (gc->server_major > 1) || (gc->server_minor >= 4) ) {
- got_fog = GL_TRUE;
- array_count++;
- }
-
- if ( __glExtensionBitIsEnabled( gc, GL_EXT_secondary_color_bit )
- || (gc->server_major > 1) || (gc->server_minor >= 4) ) {
- got_secondary_color = GL_TRUE;
- array_count++;
- }
-
- if ( __glExtensionBitIsEnabled( gc, GL_ARB_multitexture_bit )
- || (gc->server_major > 1) || (gc->server_minor >= 3) ) {
- __indirect_glGetIntegerv( GL_MAX_TEXTURE_UNITS, & texture_units );
- }
-
- if ( __glExtensionBitIsEnabled( gc, GL_ARB_vertex_program_bit ) ) {
- __indirect_glGetProgramivARB( GL_VERTEX_PROGRAM_ARB,
- GL_MAX_PROGRAM_ATTRIBS_ARB,
- & vertex_program_attribs );
- }
-
- arrays->num_texture_units = texture_units;
- arrays->num_vertex_program_attribs = vertex_program_attribs;
- array_count += texture_units + vertex_program_attribs;
- arrays->num_arrays = array_count;
- arrays->arrays = calloc( array_count, sizeof( struct array_state ) );
-
- arrays->arrays[0].data_type = GL_FLOAT;
- arrays->arrays[0].count = 3;
- arrays->arrays[0].key = GL_NORMAL_ARRAY;
- arrays->arrays[0].normalized = GL_TRUE;
- arrays->arrays[0].old_DrawArrays_possible = GL_TRUE;
-
- arrays->arrays[1].data_type = GL_FLOAT;
- arrays->arrays[1].count = 4;
- arrays->arrays[1].key = GL_COLOR_ARRAY;
- arrays->arrays[1].normalized = GL_TRUE;
- arrays->arrays[1].old_DrawArrays_possible = GL_TRUE;
-
- arrays->arrays[2].data_type = GL_FLOAT;
- arrays->arrays[2].count = 1;
- arrays->arrays[2].key = GL_INDEX_ARRAY;
- arrays->arrays[2].old_DrawArrays_possible = GL_TRUE;
-
- arrays->arrays[3].data_type = GL_UNSIGNED_BYTE;
- arrays->arrays[3].count = 1;
- arrays->arrays[3].key = GL_EDGE_FLAG_ARRAY;
- arrays->arrays[3].old_DrawArrays_possible = GL_TRUE;
-
- for ( i = 0 ; i < texture_units ; i++ ) {
- arrays->arrays[4 + i].data_type = GL_FLOAT;
- arrays->arrays[4 + i].count = 4;
- arrays->arrays[4 + i].key = GL_TEXTURE_COORD_ARRAY;
-
- arrays->arrays[4 + i].old_DrawArrays_possible = (i == 0);
- arrays->arrays[4 + i].index = i;
-
- arrays->arrays[4 + i].header[1] = i + GL_TEXTURE0;
- }
-
- i = 4 + texture_units;
-
- if ( got_fog ) {
- arrays->arrays[i].data_type = GL_FLOAT;
- arrays->arrays[i].count = 1;
- arrays->arrays[i].key = GL_FOG_COORDINATE_ARRAY;
- arrays->arrays[i].old_DrawArrays_possible = GL_TRUE;
- i++;
- }
-
- if ( got_secondary_color ) {
- arrays->arrays[i].data_type = GL_FLOAT;
- arrays->arrays[i].count = 3;
- arrays->arrays[i].key = GL_SECONDARY_COLOR_ARRAY;
- arrays->arrays[i].old_DrawArrays_possible = GL_TRUE;
- arrays->arrays[i].normalized = GL_TRUE;
- i++;
- }
-
-
- for ( j = 0 ; j < vertex_program_attribs ; j++ ) {
- const unsigned idx = (vertex_program_attribs - (j + 1));
-
-
- arrays->arrays[idx + i].data_type = GL_FLOAT;
- arrays->arrays[idx + i].count = 4;
- arrays->arrays[idx + i].key = GL_VERTEX_ATTRIB_ARRAY_POINTER;
-
- arrays->arrays[idx + i].old_DrawArrays_possible = 0;
- arrays->arrays[idx + i].index = idx;
-
- arrays->arrays[idx + i].header[1] = idx;
- }
-
- i += vertex_program_attribs;
-
-
- /* Vertex array *must* be last becuase of the way that
- * emit_DrawArrays_none works.
- */
-
- arrays->arrays[i].data_type = GL_FLOAT;
- arrays->arrays[i].count = 4;
- arrays->arrays[i].key = GL_VERTEX_ARRAY;
- arrays->arrays[i].old_DrawArrays_possible = GL_TRUE;
-
- assert( (i + 1) == arrays->num_arrays );
-
- arrays->stack_index = 0;
- arrays->stack = malloc( sizeof( struct array_stack_state )
- * arrays->num_arrays );
-}
-
-
-/**
- * Calculate the size of a single vertex for the "none" protocol. This is
- * essentially the size of all the immediate-mode commands required to
- * implement the enabled vertex arrays.
- */
-static size_t
-calculate_single_vertex_size_none( const struct array_state_vector * arrays )
-{
- size_t single_vertex_size = 0;
- unsigned i;
-
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( arrays->arrays[i].enabled ) {
- single_vertex_size += ((uint16_t *)arrays->arrays[i].header)[0];
- }
- }
-
- return single_vertex_size;
-}
-
-
-/**
- * Emit a single element using non-DrawArrays protocol.
- */
-GLubyte *
-emit_element_none( GLubyte * dst,
- const struct array_state_vector * arrays,
- unsigned index )
-{
- unsigned i;
-
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( arrays->arrays[i].enabled ) {
- const size_t offset = index * arrays->arrays[i].true_stride;
-
- /* The generic attributes can have more data than is in the
- * elements. This is because a vertex array can be a 2 element,
- * normalized, unsigned short, but the "closest" immediate mode
- * protocol is for a 4Nus. Since the sizes are small, the
- * performance impact on modern processors should be negligible.
- */
- (void) memset( dst, 0,
- ((uint16_t *)arrays->arrays[i].header)[0] );
-
- (void) memcpy( dst, arrays->arrays[i].header,
- arrays->arrays[i].header_size );
-
- dst += arrays->arrays[i].header_size;
-
- (void) memcpy( dst, ((GLubyte *) arrays->arrays[i].data) + offset,
- arrays->arrays[i].element_size );
-
- dst += __GLX_PAD( arrays->arrays[i].element_size );
- }
- }
-
- return dst;
-}
-
-
-/**
- * Emit a single element using "old" DrawArrays protocol from
- * EXT_vertex_arrays / OpenGL 1.1.
- */
-GLubyte *
-emit_element_old( GLubyte * dst,
- const struct array_state_vector * arrays,
- unsigned index )
-{
- unsigned i;
-
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( arrays->arrays[i].enabled ) {
- const size_t offset = index * arrays->arrays[i].true_stride;
-
- (void) memcpy( dst, ((GLubyte *) arrays->arrays[i].data) + offset,
- arrays->arrays[i].element_size );
-
- dst += __GLX_PAD( arrays->arrays[i].element_size );
- }
- }
-
- return dst;
-}
-
-
-struct array_state *
-get_array_entry( const struct array_state_vector * arrays,
- GLenum key, unsigned index )
-{
- unsigned i;
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( (arrays->arrays[i].key == key)
- && (arrays->arrays[i].index == index) ) {
- return & arrays->arrays[i];
- }
- }
-
- return NULL;
-}
-
-
-static GLboolean
-allocate_array_info_cache( struct array_state_vector * arrays,
- size_t required_size )
-{
-#define MAX_HEADER_SIZE 20
- if ( arrays->array_info_cache_buffer_size < required_size ) {
- GLubyte * temp = realloc( arrays->array_info_cache_base,
- required_size + MAX_HEADER_SIZE );
-
- if ( temp == NULL ) {
- return GL_FALSE;
- }
-
- arrays->array_info_cache_base = temp;
- arrays->array_info_cache = temp + MAX_HEADER_SIZE;
- arrays->array_info_cache_buffer_size = required_size;
- }
-
- arrays->array_info_cache_size = required_size;
- return GL_TRUE;
-}
-
-
-/**
- */
-void
-fill_array_info_cache( struct array_state_vector * arrays )
-{
- GLboolean old_DrawArrays_possible;
- unsigned i;
-
-
- /* Determine how many arrays are enabled.
- */
-
- arrays->enabled_client_array_count = 0;
- old_DrawArrays_possible = arrays->old_DrawArrays_possible;
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( arrays->arrays[i].enabled ) {
- arrays->enabled_client_array_count++;
- old_DrawArrays_possible &= arrays->arrays[i].old_DrawArrays_possible;
- }
- }
-
-
- if ( arrays->new_DrawArrays_possible ) {
- assert( ! arrays->new_DrawArrays_possible );
- }
- else if ( old_DrawArrays_possible ) {
- const size_t required_size = arrays->enabled_client_array_count * 12;
- uint32_t * info;
-
-
- if ( ! allocate_array_info_cache( arrays, required_size ) ) {
- return;
- }
-
-
- info = (uint32_t *) arrays->array_info_cache;
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( arrays->arrays[i].enabled ) {
- *(info++) = arrays->arrays[i].data_type;
- *(info++) = arrays->arrays[i].count;
- *(info++) = arrays->arrays[i].key;
- }
- }
-
- arrays->DrawArrays = emit_DrawArrays_old;
- arrays->DrawElements = emit_DrawElements_old;
- }
- else {
- arrays->DrawArrays = emit_DrawArrays_none;
- arrays->DrawElements = emit_DrawElements_none;
- }
-
- arrays->array_info_cache_valid = GL_TRUE;
-}
-
-
-/**
- * Emit a \c glDrawArrays command using the "none" protocol. That is,
- * emit immediate-mode commands that are equivalent to the requiested
- * \c glDrawArrays command. This is used with servers that don't support
- * the OpenGL 1.1 / EXT_vertex_arrays DrawArrays protocol or in cases where
- * vertex state is enabled that is not compatible with that protocol.
- */
-void
-emit_DrawArrays_none( GLenum mode, GLint first, GLsizei count )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
- size_t single_vertex_size;
- GLubyte * pc;
- unsigned i;
- static const uint16_t begin_cmd[2] = { 8, X_GLrop_Begin };
- static const uint16_t end_cmd[2] = { 4, X_GLrop_End };
-
-
- single_vertex_size = calculate_single_vertex_size_none( arrays );
-
- pc = gc->pc;
-
- (void) memcpy( pc, begin_cmd, 4 );
- *(int *)(pc + 4) = mode;
-
- pc += 8;
-
- for ( i = 0 ; i < count ; i++ ) {
- if ( (pc + single_vertex_size) >= gc->bufEnd ) {
- pc = __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- pc = emit_element_none( pc, arrays, first + i );
- }
-
- if ( (pc + 4) >= gc->bufEnd ) {
- pc = __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- (void) memcpy( pc, end_cmd, 4 );
- pc += 4;
-
- gc->pc = pc;
- if ( gc->pc > gc->limit ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
-}
-
-
-/**
- * Emit the header data for the GL 1.1 / EXT_vertex_arrays DrawArrays
- * protocol.
- *
- * \param gc GLX context.
- * \param arrays Array state.
- * \param elements_per_request Location to store the number of elements that
- * can fit in a single Render / RenderLarge
- * command.
- * \param total_request Total number of requests for a RenderLarge
- * command. If a Render command is used, this
- * will be zero.
- * \param mode Drawing mode.
- * \param count Number of vertices.
- *
- * \returns
- * A pointer to the buffer for array data.
- */
-static GLubyte *
-emit_DrawArrays_header_old( __GLXcontext * gc,
- struct array_state_vector * arrays,
- size_t * elements_per_request,
- size_t * total_requests,
- GLenum mode, GLsizei count )
-{
- size_t command_size;
- size_t single_vertex_size;
- const unsigned header_size = 16;
- unsigned i;
- GLubyte * pc;
-
-
- /* Determine the size of the whole command. This includes the header,
- * the ARRAY_INFO data and the array data. Once this size is calculated,
- * it will be known whether a Render or RenderLarge command is needed.
- */
-
- single_vertex_size = 0;
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- if ( arrays->arrays[i].enabled ) {
- single_vertex_size += __GLX_PAD( arrays->arrays[i].element_size );
- }
- }
-
- command_size = arrays->array_info_cache_size + header_size
- + (single_vertex_size * count);
-
-
- /* Write the header for either a Render command or a RenderLarge
- * command. After the header is written, write the ARRAY_INFO data.
- */
-
- if ( command_size > gc->maxSmallRenderCommandSize ) {
- /* maxSize is the maximum amount of data can be stuffed into a single
- * packet. sz_xGLXRenderReq is added because bufSize is the maximum
- * packet size minus sz_xGLXRenderReq.
- */
- const size_t maxSize = (gc->bufSize + sz_xGLXRenderReq)
- - sz_xGLXRenderLargeReq;
- unsigned vertex_requests;
-
-
- /* Calculate the number of data packets that will be required to send
- * the whole command. To do this, the number of verticies that
- * will fit in a single buffer must be calculated.
- *
- * The important value here is elements_per_request. This is the
- * number of complete array elements that will fit in a single
- * buffer. There may be some wasted space at the end of the buffer,
- * but splitting elements across buffer boundries would be painful.
- */
-
- elements_per_request[0] = maxSize / single_vertex_size;
-
- vertex_requests = (count + elements_per_request[0] - 1)
- / elements_per_request[0];
-
- *total_requests = vertex_requests + 1;
-
-
- __glXFlushRenderBuffer(gc, gc->pc);
-
- command_size += 4;
-
- pc = ((GLubyte *) arrays->array_info_cache) - (header_size + 4);
- *(uint32_t *)(pc + 0) = command_size;
- *(uint32_t *)(pc + 4) = X_GLrop_DrawArrays;
- *(uint32_t *)(pc + 8) = count;
- *(uint32_t *)(pc + 12) = arrays->enabled_client_array_count;
- *(uint32_t *)(pc + 16) = mode;
-
- __glXSendLargeChunk( gc, 1, *total_requests, pc,
- header_size + 4 + arrays->array_info_cache_size );
-
- pc = gc->pc;
- }
- else {
- if ( (gc->pc + command_size) >= gc->bufEnd ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- pc = gc->pc;
- *(uint16_t *)(pc + 0) = command_size;
- *(uint16_t *)(pc + 2) = X_GLrop_DrawArrays;
- *(uint32_t *)(pc + 4) = count;
- *(uint32_t *)(pc + 8) = arrays->enabled_client_array_count;
- *(uint32_t *)(pc + 12) = mode;
-
- pc += header_size;
-
- (void) memcpy( pc, arrays->array_info_cache,
- arrays->array_info_cache_size );
- pc += arrays->array_info_cache_size;
-
- *elements_per_request = count;
- *total_requests = 0;
- }
-
-
- return pc;
-}
-
-
-/**
- */
-void
-emit_DrawArrays_old( GLenum mode, GLint first, GLsizei count )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
- GLubyte * pc;
- size_t elements_per_request;
- unsigned total_requests = 0;
- unsigned i;
- size_t total_sent = 0;
-
-
- pc = emit_DrawArrays_header_old( gc, arrays, & elements_per_request,
- & total_requests, mode, count);
-
-
- /* Write the arrays.
- */
-
- if ( total_requests == 0 ) {
- assert( elements_per_request >= count );
-
- for ( i = 0 ; i < count ; i++ ) {
- pc = emit_element_old( pc, arrays, i + first );
- }
-
- assert( pc <= gc->bufEnd );
-
- gc->pc = pc;
- if ( gc->pc > gc->limit ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- }
- else {
- unsigned req;
-
-
- for ( req = 2 ; req <= total_requests ; req++ ) {
- if ( count < elements_per_request ) {
- elements_per_request = count;
- }
-
- pc = gc->pc;
- for ( i = 0 ; i < elements_per_request ; i++ ) {
- pc = emit_element_old( pc, arrays, i + first );
- }
-
- first += elements_per_request;
-
- total_sent += (size_t) (pc - gc->pc);
- __glXSendLargeChunk( gc, req, total_requests, gc->pc,
- pc - gc->pc );
-
- count -= elements_per_request;
- }
- }
-}
-
-
-void
-emit_DrawElements_none( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- static const uint16_t begin_cmd[2] = { 8, X_GLrop_Begin };
- static const uint16_t end_cmd[2] = { 4, X_GLrop_End };
-
- GLubyte * pc;
- size_t single_vertex_size;
- unsigned i;
-
-
- single_vertex_size = calculate_single_vertex_size_none( arrays );
-
-
- if ( (gc->pc + single_vertex_size) >= gc->bufEnd ) {
- gc->pc = __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- pc = gc->pc;
-
- (void) memcpy( pc, begin_cmd, 4 );
- *(int *)(pc + 4) = mode;
-
- pc += 8;
-
- for ( i = 0 ; i < count ; i++ ) {
- unsigned index = 0;
-
- if ( (pc + single_vertex_size) >= gc->bufEnd ) {
- pc = __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- switch( type ) {
- case GL_UNSIGNED_INT:
- index = (unsigned) (((GLuint *) indices)[i]);
- break;
- case GL_UNSIGNED_SHORT:
- index = (unsigned) (((GLushort *) indices)[i]);
- break;
- case GL_UNSIGNED_BYTE:
- index = (unsigned) (((GLubyte *) indices)[i]);
- break;
- }
- pc = emit_element_none( pc, arrays, index );
- }
-
- if ( (pc + 4) >= gc->bufEnd ) {
- pc = __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- (void) memcpy( pc, end_cmd, 4 );
- pc += 4;
-
- gc->pc = pc;
- if ( gc->pc > gc->limit ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
-}
-
-
-/**
- */
-void
-emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
- GLubyte * pc;
- size_t elements_per_request;
- unsigned total_requests = 0;
- unsigned i;
- unsigned req;
-
-
- pc = emit_DrawArrays_header_old( gc, arrays, & elements_per_request,
- & total_requests, mode, count);
-
-
- /* Write the arrays.
- */
-
- req = 2;
- while ( count > 0 ) {
- if ( count < elements_per_request ) {
- elements_per_request = count;
- }
-
- switch( type ) {
- case GL_UNSIGNED_INT: {
- const GLuint * ui_ptr = (const GLuint *) indices;
-
- for ( i = 0 ; i < elements_per_request ; i++ ) {
- const GLint index = (GLint) *(ui_ptr++);
- pc = emit_element_old( pc, arrays, index );
- }
- break;
- }
- case GL_UNSIGNED_SHORT: {
- const GLushort * us_ptr = (const GLushort *) indices;
-
- for ( i = 0 ; i < elements_per_request ; i++ ) {
- const GLint index = (GLint) *(us_ptr++);
- pc = emit_element_old( pc, arrays, index );
- }
- break;
- }
- case GL_UNSIGNED_BYTE: {
- const GLubyte * ub_ptr = (const GLubyte *) indices;
-
- for ( i = 0 ; i < elements_per_request ; i++ ) {
- const GLint index = (GLint) *(ub_ptr++);
- pc = emit_element_old( pc, arrays, index );
- }
- break;
- }
- }
-
- if ( total_requests != 0 ) {
- __glXSendLargeChunk( gc, req, total_requests, gc->pc,
- pc - gc->pc );
- pc = gc->pc;
- req++;
- }
-
- count -= elements_per_request;
- }
-
-
- assert( (total_requests == 0) || ((req - 1) == total_requests) );
-
- if ( total_requests == 0 ) {
- assert( pc <= gc->bufEnd );
-
- gc->pc = pc;
- if ( gc->pc > gc->limit ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
- }
-}
-
-
-/**
- * Validate that the \c mode parameter to \c glDrawArrays, et. al. is valid.
- * If it is not valid, then an error code is set in the GLX context.
- *
- * \returns
- * \c GL_TRUE if the argument is valid, \c GL_FALSE if is not.
- */
-static GLboolean
-validate_mode(__GLXcontext *gc, GLenum mode)
-{
- switch(mode) {
- case GL_POINTS:
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- case GL_LINES:
- case GL_TRIANGLE_STRIP:
- case GL_TRIANGLE_FAN:
- case GL_TRIANGLES:
- case GL_QUAD_STRIP:
- case GL_QUADS:
- case GL_POLYGON:
- break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Validate that the \c count parameter to \c glDrawArrays, et. al. is valid.
- * A value less than zero is invalid and will result in \c GL_INVALID_VALUE
- * being set. A value of zero will not result in an error being set, but
- * will result in \c GL_FALSE being returned.
- *
- * \returns
- * \c GL_TRUE if the argument is valid, \c GL_FALSE if it is not.
- */
-static GLboolean
-validate_count(__GLXcontext *gc, GLsizei count)
-{
- if (count < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- }
-
- return (count > 0);
-}
-
-
-/**
- * Validate that the \c type parameter to \c glDrawElements, et. al. is
- * valid. Only \c GL_UNSIGNED_BYTE, \c GL_UNSIGNED_SHORT, and
- * \c GL_UNSIGNED_INT are valid.
- *
- * \returns
- * \c GL_TRUE if the argument is valid, \c GL_FALSE if it is not.
- */
-static GLboolean validate_type(__GLXcontext *gc, GLenum type)
-{
- switch( type ) {
- case GL_UNSIGNED_INT:
- case GL_UNSIGNED_SHORT:
- case GL_UNSIGNED_BYTE:
- return GL_TRUE;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return GL_FALSE;
- }
-}
-
-
-void __indirect_glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
-
- if ( validate_mode(gc, mode) && validate_count(gc, count) ) {
- if ( ! arrays->array_info_cache_valid ) {
- fill_array_info_cache( arrays );
- }
-
- arrays->DrawArrays(mode, first, count);
- }
-}
-
-
-void __indirect_glArrayElement(GLint index)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
- size_t single_vertex_size;
-
-
- single_vertex_size = calculate_single_vertex_size_none( arrays );
-
- if ( (gc->pc + single_vertex_size) >= gc->bufEnd ) {
- gc->pc = __glXFlushRenderBuffer(gc, gc->pc);
- }
-
- gc->pc = emit_element_none( gc->pc, arrays, index );
-
- if ( gc->pc > gc->limit ) {
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- }
-}
-
-
-void __indirect_glDrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
-
- if ( validate_mode(gc, mode) && validate_count(gc, count)
- && validate_type(gc, type) ) {
- if ( ! arrays->array_info_cache_valid ) {
- fill_array_info_cache( arrays );
- }
-
- arrays->DrawElements(mode, count, type, indices);
- }
-}
-
-
-void __indirect_glDrawRangeElements(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
-
-
- if ( validate_mode(gc, mode) && validate_count(gc, count)
- && validate_type(gc, type) ) {
- if (end < start) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- if ( ! arrays->array_info_cache_valid ) {
- fill_array_info_cache( arrays );
- }
-
- arrays->DrawElements(mode, count, type, indices);
- }
-}
-
-
-void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count,
- GLsizei primcount)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- GLsizei i;
-
-
- if ( validate_mode(gc, mode) ) {
- if ( ! arrays->array_info_cache_valid ) {
- fill_array_info_cache( arrays );
- }
-
- for ( i = 0 ; i < primcount ; i++ ) {
- if ( validate_count( gc, count[i] ) ) {
- arrays->DrawArrays(mode, first[i], count[i]);
- }
- }
- }
-}
-
-
-void __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count,
- GLenum type, const GLvoid ** indices,
- GLsizei primcount)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- const __GLXattribute * state =
- (const __GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- GLsizei i;
-
-
- if ( validate_mode(gc, mode) && validate_type(gc, type) ) {
- if ( ! arrays->array_info_cache_valid ) {
- fill_array_info_cache( arrays );
- }
-
- for ( i = 0 ; i < primcount ; i++ ) {
- if ( validate_count( gc, count[i] ) ) {
- arrays->DrawElements(mode, count[i], type, indices[i]);
- }
- }
- }
-}
-
-
-#define COMMON_ARRAY_DATA_INIT(a, PTR, TYPE, STRIDE, COUNT, NORMALIZED, HDR_SIZE, OPCODE) \
- do { \
- (a)->data = PTR; \
- (a)->data_type = TYPE; \
- (a)->user_stride = STRIDE; \
- (a)->count = COUNT; \
- (a)->normalized = NORMALIZED; \
- \
- (a)->element_size = __glXTypeSize( TYPE ) * COUNT; \
- (a)->true_stride = (STRIDE == 0) \
- ? (a)->element_size : STRIDE; \
- \
- (a)->header_size = HDR_SIZE; \
- ((uint16_t *) (a)->header)[0] = __GLX_PAD((a)->header_size + (a)->element_size); \
- ((uint16_t *) (a)->header)[1] = OPCODE; \
- } while(0)
-
-
-void __indirect_glVertexPointer( GLint size, GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- static const uint16_t short_ops[5] = {
- 0, 0, X_GLrop_Vertex2sv, X_GLrop_Vertex3sv, X_GLrop_Vertex4sv
- };
- static const uint16_t int_ops[5] = {
- 0, 0, X_GLrop_Vertex2iv, X_GLrop_Vertex3iv, X_GLrop_Vertex4iv
- };
- static const uint16_t float_ops[5] = {
- 0, 0, X_GLrop_Vertex2fv, X_GLrop_Vertex3fv, X_GLrop_Vertex4fv
- };
- static const uint16_t double_ops[5] = {
- 0, 0, X_GLrop_Vertex2dv, X_GLrop_Vertex3dv, X_GLrop_Vertex4dv
- };
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (size < 2 || size > 4 || stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- switch ( type ) {
- case GL_SHORT: opcode = short_ops[size]; break;
- case GL_INT: opcode = int_ops[size]; break;
- case GL_FLOAT: opcode = float_ops[size]; break;
- case GL_DOUBLE: opcode = double_ops[size]; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- a = get_array_entry( arrays, GL_VERTEX_ARRAY, 0 );
- assert( a != NULL );
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, size, GL_FALSE, 4,
- opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glNormalPointer( GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- switch ( type ) {
- case GL_BYTE: opcode = X_GLrop_Normal3bv; break;
- case GL_SHORT: opcode = X_GLrop_Normal3sv; break;
- case GL_INT: opcode = X_GLrop_Normal3iv; break;
- case GL_FLOAT: opcode = X_GLrop_Normal3fv; break;
- case GL_DOUBLE: opcode = X_GLrop_Normal3dv; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- a = get_array_entry( arrays, GL_NORMAL_ARRAY, 0 );
- assert( a != NULL );
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, 3, GL_TRUE, 4,
- opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glColorPointer( GLint size, GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- static const uint16_t byte_ops[5] = {
- 0, 0, 0, X_GLrop_Color3bv, X_GLrop_Color4bv
- };
- static const uint16_t ubyte_ops[5] = {
- 0, 0, 0, X_GLrop_Color3ubv, X_GLrop_Color4ubv
- };
- static const uint16_t short_ops[5] = {
- 0, 0, 0, X_GLrop_Color3sv, X_GLrop_Color4sv
- };
- static const uint16_t ushort_ops[5] = {
- 0, 0, 0, X_GLrop_Color3usv, X_GLrop_Color4usv
- };
- static const uint16_t int_ops[5] = {
- 0, 0, 0, X_GLrop_Color3iv, X_GLrop_Color4iv
- };
- static const uint16_t uint_ops[5] = {
- 0, 0, 0, X_GLrop_Color3uiv, X_GLrop_Color4uiv
- };
- static const uint16_t float_ops[5] = {
- 0, 0, 0, X_GLrop_Color3fv, X_GLrop_Color4fv
- };
- static const uint16_t double_ops[5] = {
- 0, 0, 0, X_GLrop_Color3dv, X_GLrop_Color4dv
- };
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (size < 3 || size > 4 || stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- switch ( type ) {
- case GL_BYTE: opcode = byte_ops[size]; break;
- case GL_UNSIGNED_BYTE: opcode = ubyte_ops[size]; break;
- case GL_SHORT: opcode = short_ops[size]; break;
- case GL_UNSIGNED_SHORT: opcode = ushort_ops[size]; break;
- case GL_INT: opcode = int_ops[size]; break;
- case GL_UNSIGNED_INT: opcode = uint_ops[size]; break;
- case GL_FLOAT: opcode = float_ops[size]; break;
- case GL_DOUBLE: opcode = double_ops[size]; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- a = get_array_entry( arrays, GL_COLOR_ARRAY, 0 );
- assert( a != NULL );
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, size, GL_TRUE, 4,
- opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glIndexPointer( GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- switch ( type ) {
- case GL_UNSIGNED_BYTE: opcode = X_GLrop_Indexubv; break;
- case GL_SHORT: opcode = X_GLrop_Indexsv; break;
- case GL_INT: opcode = X_GLrop_Indexiv; break;
- case GL_FLOAT: opcode = X_GLrop_Indexfv; break;
- case GL_DOUBLE: opcode = X_GLrop_Indexdv; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- a = get_array_entry( arrays, GL_INDEX_ARRAY, 0 );
- assert( a != NULL );
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, 1, GL_FALSE, 4,
- opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glEdgeFlagPointer( GLsizei stride, const GLvoid * pointer )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
-
- a = get_array_entry( arrays, GL_EDGE_FLAG_ARRAY, 0 );
- assert( a != NULL );
- COMMON_ARRAY_DATA_INIT( a, pointer, GL_UNSIGNED_BYTE, stride, 1, GL_FALSE,
- 4, X_GLrop_EdgeFlagv );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glTexCoordPointer( GLint size, GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- static const uint16_t short_ops[5] = {
- 0, X_GLrop_TexCoord1sv, X_GLrop_TexCoord2sv, X_GLrop_TexCoord3sv, X_GLrop_TexCoord4sv
- };
- static const uint16_t int_ops[5] = {
- 0, X_GLrop_TexCoord1iv, X_GLrop_TexCoord2iv, X_GLrop_TexCoord3iv, X_GLrop_TexCoord4iv
- };
- static const uint16_t float_ops[5] = {
- 0, X_GLrop_TexCoord1dv, X_GLrop_TexCoord2fv, X_GLrop_TexCoord3fv, X_GLrop_TexCoord4fv
- };
- static const uint16_t double_ops[5] = {
- 0, X_GLrop_TexCoord1dv, X_GLrop_TexCoord2dv, X_GLrop_TexCoord3dv, X_GLrop_TexCoord4dv
- };
-
- static const uint16_t mshort_ops[5] = {
- 0, X_GLrop_MultiTexCoord1svARB, X_GLrop_MultiTexCoord2svARB, X_GLrop_MultiTexCoord3svARB, X_GLrop_MultiTexCoord4svARB
- };
- static const uint16_t mint_ops[5] = {
- 0, X_GLrop_MultiTexCoord1ivARB, X_GLrop_MultiTexCoord2ivARB, X_GLrop_MultiTexCoord3ivARB, X_GLrop_MultiTexCoord4ivARB
- };
- static const uint16_t mfloat_ops[5] = {
- 0, X_GLrop_MultiTexCoord1dvARB, X_GLrop_MultiTexCoord2fvARB, X_GLrop_MultiTexCoord3fvARB, X_GLrop_MultiTexCoord4fvARB
- };
- static const uint16_t mdouble_ops[5] = {
- 0, X_GLrop_MultiTexCoord1dvARB, X_GLrop_MultiTexCoord2dvARB, X_GLrop_MultiTexCoord3dvARB, X_GLrop_MultiTexCoord4dvARB
- };
-
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
- unsigned header_size;
- unsigned index;
-
-
- if (size < 1 || size > 4 || stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- index = arrays->active_texture_unit;
- if ( index == 0 ) {
- switch ( type ) {
- case GL_SHORT: opcode = short_ops[size]; break;
- case GL_INT: opcode = int_ops[size]; break;
- case GL_FLOAT: opcode = float_ops[size]; break;
- case GL_DOUBLE: opcode = double_ops[size]; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- header_size = 4;
- }
- else {
- switch ( type ) {
- case GL_SHORT: opcode = mshort_ops[size]; break;
- case GL_INT: opcode = mint_ops[size]; break;
- case GL_FLOAT: opcode = mfloat_ops[size]; break;
- case GL_DOUBLE: opcode = mdouble_ops[size]; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- header_size = 8;
- }
-
- a = get_array_entry( arrays, GL_TEXTURE_COORD_ARRAY, index );
- assert( a != NULL );
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, size, GL_FALSE,
- header_size, opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glSecondaryColorPointerEXT( GLint size, GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (size != 3 || stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- switch ( type ) {
- case GL_BYTE: opcode = 4126; break;
- case GL_UNSIGNED_BYTE: opcode = 4131; break;
- case GL_SHORT: opcode = 4127; break;
- case GL_UNSIGNED_SHORT: opcode = 4132; break;
- case GL_INT: opcode = 4128; break;
- case GL_UNSIGNED_INT: opcode = 4133; break;
- case GL_FLOAT: opcode = 4129; break;
- case GL_DOUBLE: opcode = 4130; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- a = get_array_entry( arrays, GL_SECONDARY_COLOR_ARRAY, 0 );
- if ( a == NULL ) {
- __glXSetError(gc, GL_INVALID_OPERATION);
- return;
- }
-
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, size, GL_TRUE, 4,
- opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glFogCoordPointerEXT( GLenum type, GLsizei stride,
- const GLvoid * pointer )
-{
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if (stride < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- switch ( type ) {
- case GL_FLOAT: opcode = 4124; break;
- case GL_DOUBLE: opcode = 4125; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- a = get_array_entry( arrays, GL_FOG_COORD_ARRAY, 0 );
- if ( a == NULL ) {
- __glXSetError(gc, GL_INVALID_OPERATION);
- return;
- }
-
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, 1, GL_FALSE, 4,
- opcode );
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-void __indirect_glVertexAttribPointerARB(GLuint index, GLint size,
- GLenum type, GLboolean normalized,
- GLsizei stride,
- const GLvoid * pointer)
-{
- static const uint16_t short_ops[5] = { 0, 4189, 4190, 4191, 4192 };
- static const uint16_t float_ops[5] = { 0, 4193, 4194, 4195, 4196 };
- static const uint16_t double_ops[5] = { 0, 4197, 4198, 4199, 4200 };
-
- uint16_t opcode;
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
- unsigned true_immediate_count;
- unsigned true_immediate_size;
-
-
- if ( (size < 1) || (size > 4) || (stride < 0)
- || (index > arrays->num_vertex_program_attribs) ){
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
- if ( normalized && (type != GL_FLOAT) && (type != GL_DOUBLE)) {
- switch( type ) {
- case GL_BYTE: opcode = X_GLrop_VertexAttrib4NbvARB; break;
- case GL_UNSIGNED_BYTE: opcode = X_GLrop_VertexAttrib4NubvARB; break;
- case GL_SHORT: opcode = X_GLrop_VertexAttrib4NsvARB; break;
- case GL_UNSIGNED_SHORT: opcode = X_GLrop_VertexAttrib4NusvARB; break;
- case GL_INT: opcode = X_GLrop_VertexAttrib4NivARB; break;
- case GL_UNSIGNED_INT: opcode = X_GLrop_VertexAttrib4NuivARB; break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- true_immediate_count = 4;
- }
- else {
- true_immediate_count = size;
-
- switch( type ) {
- case GL_BYTE:
- opcode = X_GLrop_VertexAttrib4bvARB;
- true_immediate_count = 4;
- break;
- case GL_UNSIGNED_BYTE:
- opcode = X_GLrop_VertexAttrib4ubvARB;
- true_immediate_count = 4;
- break;
- case GL_SHORT:
- opcode = short_ops[size];
- break;
- case GL_UNSIGNED_SHORT:
- opcode = X_GLrop_VertexAttrib4usvARB;
- true_immediate_count = 4;
- break;
- case GL_INT:
- opcode = X_GLrop_VertexAttrib4ivARB;
- true_immediate_count = 4;
- break;
- case GL_UNSIGNED_INT:
- opcode = X_GLrop_VertexAttrib4uivARB;
- true_immediate_count = 4;
- break;
- case GL_FLOAT:
- opcode = float_ops[size];
- break;
- case GL_DOUBLE:
- opcode = double_ops[size];
- break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
- }
-
- a = get_array_entry( arrays, GL_VERTEX_ATTRIB_ARRAY_POINTER, index );
- if ( a == NULL ) {
- __glXSetError(gc, GL_INVALID_OPERATION);
- return;
- }
-
- COMMON_ARRAY_DATA_INIT( a, pointer, type, stride, size, normalized, 8,
- opcode );
-
- true_immediate_size = __glXTypeSize(type) * true_immediate_count;
- ((uint16_t *) (a)->header)[0] = __GLX_PAD(a->header_size
- + true_immediate_size);
-
- if ( a->enabled ) {
- arrays->array_info_cache_valid = GL_FALSE;
- }
-}
-
-
-/**
- * I don't have 100% confidence that this is correct. The different rules
- * about whether or not generic vertex attributes alias "classic" vertex
- * attributes (i.e., attrib1 ?= primary color) between ARB_vertex_program,
- * ARB_vertex_shader, and NV_vertex_program are a bit confusing. My
- * feeling is that the client-side doesn't have to worry about it. The
- * client just sends all the data to the server and lets the server deal
- * with it.
- */
-void __indirect_glVertexAttribPointerNV( GLuint index, GLint size,
- GLenum type, GLsizei stride,
- const GLvoid * pointer)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- GLboolean normalized = GL_FALSE;
-
-
- switch( type ) {
- case GL_UNSIGNED_BYTE:
- if ( size != 4 ) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- normalized = GL_TRUE;
-
- case GL_SHORT:
- case GL_FLOAT:
- case GL_DOUBLE:
- __indirect_glVertexAttribPointerARB(index, size, type,
- normalized,
- stride, pointer);
- return;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-}
-
-
-void __indirect_glClientActiveTextureARB(GLenum texture)
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- __GLXattribute * const state = (__GLXattribute *)(gc->client_state_private);
- struct array_state_vector * const arrays = state->array_state;
- const GLint unit = (GLint) texture - GL_TEXTURE0;
-
-
- if ( (unit < 0) || (unit > arrays->num_texture_units) ) {
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- arrays->active_texture_unit = unit;
-}
-
-
-/**
- */
-GLboolean
-__glXSetArrayEnable( __GLXattribute * state,
- GLenum key, unsigned index, GLboolean enable )
-{
- struct array_state_vector * arrays = state->array_state;
- struct array_state * a;
-
-
- if ( key == GL_TEXTURE_COORD_ARRAY ) {
- index = arrays->active_texture_unit;
- }
-
- a = get_array_entry( arrays, key, index );
-
- if ( (a != NULL) && (a->enabled != enable) ) {
- a->enabled = enable;
- arrays->array_info_cache_valid = GL_FALSE;
- }
-
- return (a != NULL);
-}
-
-
-void
-__glXArrayDisableAll( __GLXattribute * state )
-{
- struct array_state_vector * arrays = state->array_state;
- unsigned i;
-
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- arrays->arrays[i].enabled = GL_FALSE;
- }
-
- arrays->array_info_cache_valid = GL_FALSE;
-}
-
-
-/**
- */
-GLboolean
-__glXGetArrayEnable( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest )
-{
- const struct array_state_vector * arrays = state->array_state;
- const struct array_state * a = get_array_entry( (struct array_state_vector *) arrays,
- key, index );
-
- if ( a != NULL ) {
- *dest = (GLintptr) a->enabled;
- }
-
- return (a != NULL);
-}
-
-
-/**
- */
-GLboolean
-__glXGetArrayType( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest )
-{
- const struct array_state_vector * arrays = state->array_state;
- const struct array_state * a = get_array_entry( (struct array_state_vector *) arrays,
- key, index );
-
- if ( a != NULL ) {
- *dest = (GLintptr) a->enabled;
- }
-
- return (a != NULL);
-}
-
-
-/**
- */
-GLboolean
-__glXGetArraySize( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest )
-{
- const struct array_state_vector * arrays = state->array_state;
- const struct array_state * a = get_array_entry( (struct array_state_vector *) arrays,
- key, index );
-
- if ( a != NULL ) {
- *dest = (GLintptr) a->count;
- }
-
- return (a != NULL);
-}
-
-
-/**
- */
-GLboolean
-__glXGetArrayStride( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest )
-{
- const struct array_state_vector * arrays = state->array_state;
- const struct array_state * a = get_array_entry( (struct array_state_vector *) arrays,
- key, index );
-
- if ( a != NULL ) {
- *dest = (GLintptr) a->user_stride;
- }
-
- return (a != NULL);
-}
-
-
-/**
- */
-GLboolean
-__glXGetArrayPointer( const __GLXattribute * const state,
- GLenum key, unsigned index, void ** dest )
-{
- const struct array_state_vector * arrays = state->array_state;
- const struct array_state * a = get_array_entry( (struct array_state_vector *) arrays,
- key, index );
-
-
- if ( a != NULL ) {
- *dest = (void *) (a->data);
- }
-
- return (a != NULL);
-}
-
-
-/**
- */
-GLboolean
-__glXGetArrayNormalized( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest )
-{
- const struct array_state_vector * arrays = state->array_state;
- const struct array_state * a = get_array_entry( (struct array_state_vector *) arrays,
- key, index );
-
-
- if ( a != NULL ) {
- *dest = (GLintptr) a->normalized;
- }
-
- return (a != NULL);
-}
-
-
-/**
- */
-GLuint
-__glXGetActiveTextureUnit( const __GLXattribute * const state )
-{
- return state->array_state->active_texture_unit;
-}
-
-
-void
-__glXPushArrayState( __GLXattribute * state )
-{
- struct array_state_vector * arrays = state->array_state;
- struct array_stack_state * stack = & arrays->stack[ (arrays->stack_index * arrays->num_arrays)];
- unsigned i;
-
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- stack[i].data = arrays->arrays[i].data;
- stack[i].data_type = arrays->arrays[i].data_type;
- stack[i].user_stride = arrays->arrays[i].user_stride;
- stack[i].count = arrays->arrays[i].count;
- stack[i].key = arrays->arrays[i].key;
- stack[i].enabled = arrays->arrays[i].enabled;
- }
-
- arrays->active_texture_unit_stack[ arrays->stack_index ] =
- arrays->active_texture_unit;
-
- arrays->stack_index++;
-}
-
-
-void
-__glXPopArrayState( __GLXattribute * state )
-{
- struct array_state_vector * arrays = state->array_state;
- struct array_stack_state * stack;
- unsigned i;
-
-
- arrays->stack_index--;
- stack = & arrays->stack[ (arrays->stack_index * arrays->num_arrays) ];
-
- for ( i = 0 ; i < arrays->num_arrays ; i++ ) {
- switch ( stack[i].key ) {
- case GL_NORMAL_ARRAY:
- __indirect_glNormalPointer( stack[i].data_type,
- stack[i].user_stride,
- stack[i].data );
- break;
- case GL_COLOR_ARRAY:
- __indirect_glColorPointer( stack[i].count,
- stack[i].data_type,
- stack[i].user_stride,
- stack[i].data );
- break;
- case GL_INDEX_ARRAY:
- __indirect_glIndexPointer( stack[i].data_type,
- stack[i].user_stride,
- stack[i].data );
- break;
- case GL_EDGE_FLAG_ARRAY:
- __indirect_glEdgeFlagPointer( stack[i].user_stride,
- stack[i].data );
- break;
- case GL_TEXTURE_COORD_ARRAY:
- arrays->active_texture_unit = stack[i].index;
- __indirect_glTexCoordPointer( stack[i].count,
- stack[i].data_type,
- stack[i].user_stride,
- stack[i].data );
- break;
- case GL_SECONDARY_COLOR_ARRAY:
- __indirect_glSecondaryColorPointerEXT( stack[i].count,
- stack[i].data_type,
- stack[i].user_stride,
- stack[i].data );
- break;
- case GL_FOG_COORDINATE_ARRAY:
- __indirect_glFogCoordPointerEXT( stack[i].data_type,
- stack[i].user_stride,
- stack[i].data );
- break;
-
- }
-
- __glXSetArrayEnable( state, stack[i].key, stack[i].index,
- stack[i].enabled );
- }
-
- arrays->active_texture_unit =
- arrays->active_texture_unit_stack[ arrays->stack_index ];
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.h b/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.h
deleted file mode 100644
index caab62b67..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_array.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * 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.
- */
-
-#ifndef INDIRECT_VERTEX_ARRAY_H
-#define INDIRECT_VERTEX_ARRAY_H
-
-extern const GLuint __glXTypeSize_table[16];
-
-#define __glXTypeSize(e) ((((e) & ~0x0f) != 0x1400) \
- ? 0 : __glXTypeSize_table[ (e) & 0x0f ])
-
-extern void __glXArrayDisableAll( __GLXattribute * state );
-
-extern GLboolean __glXSetArrayEnable( __GLXattribute * state,
- GLenum key, unsigned index, GLboolean enable );
-
-extern GLboolean __glXGetArrayEnable( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest );
-extern GLboolean __glXGetArraySize( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest );
-extern GLboolean __glXGetArrayType( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest );
-extern GLboolean __glXGetArrayStride( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest );
-extern GLboolean __glXGetArrayPointer( const __GLXattribute * const state,
- GLenum key, unsigned index, void ** dest );
-extern GLboolean __glXGetArrayNormalized( const __GLXattribute * const state,
- GLenum key, unsigned index, GLintptr * dest );
-
-extern void __glXPushArrayState( __GLXattribute * state );
-extern void __glXPopArrayState( __GLXattribute * state );
-
-extern GLuint __glXGetActiveTextureUnit( const __GLXattribute * const state );
-
-#endif /* INDIRECT_VERTEX_ARRAY_H */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_program.c b/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_program.c
deleted file mode 100644
index 158327175..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_vertex_program.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * (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 <inttypes.h>
-#include <GL/gl.h>
-#include "indirect.h"
-#include "glxclient.h"
-#include "indirect_vertex_array.h"
-#include <GL/glxproto.h>
-
-#if !defined __GNUC__ || __GNUC__ < 3
-# define __builtin_expect(x, y) x
-#endif
-
-void do_vertex_attrib_enable( GLuint index, GLboolean val )
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
-
- if ( ! __glXSetArrayEnable( state, GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB,
- index, val ) ) {
- __glXSetError(gc, GL_INVALID_ENUM);
- }
-}
-
-
-void __indirect_glEnableVertexAttribArrayARB( GLuint index )
-{
- do_vertex_attrib_enable( index, GL_TRUE );
-}
-
-
-void __indirect_glDisableVertexAttribArrayARB( GLuint index )
-{
- do_vertex_attrib_enable( index, GL_FALSE );
-}
-
-
-static void
-get_parameter( unsigned opcode, unsigned size, GLenum target, GLuint index,
- void * params )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 12;
-
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupVendorRequest(gc,
- X_GLXVendorPrivateWithReply,
- opcode, cmdlen);
-
- *((GLenum *)(pc + 0)) = target;
- *((GLuint *)(pc + 4)) = index;
- *((GLuint *)(pc + 8)) = 0;
-
- (void) __glXReadReply(dpy, size, params, GL_FALSE);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-
-void __indirect_glGetProgramEnvParameterfvARB( GLenum target, GLuint index,
- GLfloat * params )
-{
- get_parameter( 1296, 4, target, index, params );
-}
-
-
-void __indirect_glGetProgramEnvParameterdvARB( GLenum target, GLuint index,
- GLdouble * params )
-{
- get_parameter( 1297, 8, target, index, params );
-}
-
-
-void __indirect_glGetProgramLocalParameterfvARB( GLenum target, GLuint index,
- GLfloat * params )
-{
- get_parameter( 1305, 4, target, index, params );
-}
-
-
-void __indirect_glGetProgramLocalParameterdvARB( GLenum target, GLuint index,
- GLdouble * params )
-{
- get_parameter( 1306, 8, target, index, params );
-}
-
-
-void __indirect_glGetVertexAttribPointervNV( GLuint index, GLenum pname,
- GLvoid ** pointer )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
-
- if ( pname != GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB ) {
- __glXSetError( gc, GL_INVALID_ENUM );
- }
-
- if ( ! __glXGetArrayPointer( state, GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB,
- index, pointer ) ) {
- __glXSetError( gc, GL_INVALID_VALUE );
- }
-}
-
-
-/**
- * Get the selected attribute from the vertex array state vector.
- *
- * \returns
- * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
- */
-static GLboolean
-get_attrib_array_data( __GLXattribute * state, GLuint index, GLenum cap,
- GLintptr * data )
-{
- GLboolean retval = GL_FALSE;
- const GLenum attrib = GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB;
-
- switch( cap ) {
- case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
- retval = __glXGetArrayEnable( state, attrib, index, data );
- break;
-
- case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB:
- retval = __glXGetArraySize( state, attrib, index, data );
- break;
-
- case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB:
- retval = __glXGetArrayStride( state, attrib, index, data );
- break;
-
- case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB:
- retval = __glXGetArrayType( state, attrib, index, data );
- break;
-
- case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB:
- retval = __glXGetArrayNormalized( state, attrib, index, data );
- break;
- }
-
-
- return retval;
-}
-
-
-static void get_vertex_attrib( __GLXcontext * gc, unsigned vop,
- GLuint index, GLenum pname,
- xReply * reply )
-{
- Display * const dpy = gc->currentDpy;
- GLubyte * const pc = __glXSetupVendorRequest(gc,
- X_GLXVendorPrivateWithReply,
- vop, 8);
-
- *((uint32_t *)(pc + 0)) = index;
- *((uint32_t *)(pc + 4)) = pname;
-
- (void) _XReply( dpy, reply, 0, False );
-}
-
-
-void __indirect_glGetVertexAttribivARB( GLuint index, GLenum pname,
- GLint * params )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
-
- get_vertex_attrib( gc, 1303, index, pname, (xReply *) & reply );
-
- if ( reply.size != 0 ) {
- if ( ! get_attrib_array_data( state, index, pname, params ) ) {
- if (reply.size == 1) {
- *params = (GLint) reply.pad3;
- }
- else {
- _XRead(dpy, (void *) params, 4 * reply.size);
- }
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-void __indirect_glGetVertexAttribfvARB( GLuint index, GLenum pname,
- GLfloat * params )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
-
- get_vertex_attrib( gc, 1302, index, pname, (xReply *) & reply );
-
- if ( reply.size != 0 ) {
- GLintptr data;
-
-
- if ( get_attrib_array_data( state, index, pname, & data ) ) {
- *params = (GLfloat) data;
- }
- else {
- if (reply.size == 1) {
- (void) memcpy( params, & reply.pad3, sizeof( GLfloat ) );
- }
- else {
- _XRead(dpy, (void *) params, 4 * reply.size);
- }
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-void __indirect_glGetVertexAttribdvARB( GLuint index, GLenum pname,
- GLdouble * params )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- Display * const dpy = gc->currentDpy;
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
-
- get_vertex_attrib( gc, 1301, index, pname, (xReply *) & reply );
-
- if ( reply.size != 0 ) {
- GLintptr data;
-
-
- if ( get_attrib_array_data( state, index, pname, & data ) ) {
- *params = (GLdouble) data;
- }
- else {
- if (reply.size == 1) {
- (void) memcpy( params, & reply.pad3, sizeof( GLdouble ) );
- }
- else {
- _XRead(dpy, (void *) params, 8 * reply.size);
- }
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/indirect_window_pos.c b/nx-X11/extras/Mesa/src/glx/x11/indirect_window_pos.c
deleted file mode 100644
index 533f8ef1a..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/indirect_window_pos.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT, 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 <GL/gl.h>
-#include "indirect.h"
-
-void __indirect_glWindowPos2dMESA(GLdouble x, GLdouble y)
-{
- __indirect_glWindowPos3fMESA(x, y, 0.0);
-}
-
-void __indirect_glWindowPos2iMESA(GLint x, GLint y)
-{
- __indirect_glWindowPos3fMESA(x, y, 0.0);
-}
-
-void __indirect_glWindowPos2fMESA(GLfloat x, GLfloat y)
-{
- __indirect_glWindowPos3fMESA(x, y, 0.0);
-}
-
-void __indirect_glWindowPos2sMESA(GLshort x, GLshort y)
-{
- __indirect_glWindowPos3fMESA(x, y, 0.0);
-}
-
-void __indirect_glWindowPos2dvMESA(const GLdouble * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], 0.0);
-}
-
-void __indirect_glWindowPos2fvMESA(const GLfloat * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], 0.0);
-}
-
-void __indirect_glWindowPos2ivMESA(const GLint * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], 0.0);
-}
-
-void __indirect_glWindowPos2svMESA(const GLshort * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], 0.0);
-}
-
-void __indirect_glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
-{
- __indirect_glWindowPos3fMESA(x, y, z);
-}
-
-void __indirect_glWindowPos3iMESA(GLint x, GLint y, GLint z)
-{
- __indirect_glWindowPos3fMESA(x, y, z);
-}
-
-void __indirect_glWindowPos3sMESA(GLshort x, GLshort y, GLshort z)
-{
- __indirect_glWindowPos3fMESA(x, y, z);
-}
-
-void __indirect_glWindowPos3dvMESA(const GLdouble * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], p[2]);
-}
-
-void __indirect_glWindowPos3ivMESA(const GLint * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], p[2]);
-}
-
-void __indirect_glWindowPos3svMESA(const GLshort * p)
-{
- __indirect_glWindowPos3fMESA(p[0], p[1], p[2]);
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/packrender.h b/nx-X11/extras/Mesa/src/glx/x11/packrender.h
deleted file mode 100644
index ce2a1616d..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/packrender.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/packrender.h,v 1.7tsi Exp $ */
-#ifndef __GLX_packrender_h__
-#define __GLX_packrender_h__
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "glxclient.h"
-
-/*
-** The macros in this header convert the client machine's native data types to
-** wire protocol data types. The header is part of the porting layer of the
-** client library, and it is intended that hardware vendors will rewrite this
-** header to suit their own machines.
-*/
-
-/*
-** Pad a count of bytes to the nearest multiple of 4. The X protocol
-** transfers data in 4 byte quantities, so this macro is used to
-** insure the right amount of data being sent.
-*/
-#define __GLX_PAD(a) (((a)+3) & ~3)
-
-/*
- ** Network size parameters
- */
-#define sz_double 8
-
-/* Setup for all commands */
-#define __GLX_DECLARE_VARIABLES() \
- __GLXcontext *gc; \
- GLubyte *pc, *pixelHeaderPC; \
- GLuint compsize, cmdlen
-
-#define __GLX_LOAD_VARIABLES() \
- gc = __glXGetCurrentContext(); \
- pc = gc->pc; \
- /* Muffle compilers */ \
- cmdlen = 0; (void)cmdlen; \
- compsize = 0; (void)compsize; \
- pixelHeaderPC = 0; (void)pixelHeaderPC
-
-/*
-** Variable sized command support macro. This macro is used by calls
-** that are potentially larger than __GLX_SMALL_RENDER_CMD_SIZE.
-** Because of their size, they may not automatically fit in the buffer.
-** If the buffer can't hold the command then it is flushed so that
-** the command will fit in the next buffer.
-*/
-#define __GLX_BEGIN_VARIABLE(opcode,size) \
- if (pc + (size) > gc->bufEnd) { \
- pc = __glXFlushRenderBuffer(gc, pc); \
- } \
- __GLX_PUT_SHORT(0,size); \
- __GLX_PUT_SHORT(2,opcode)
-
-#define __GLX_BEGIN_VARIABLE_LARGE(opcode,size) \
- pc = __glXFlushRenderBuffer(gc, pc); \
- __GLX_PUT_LONG(0,size); \
- __GLX_PUT_LONG(4,opcode)
-
-#define __GLX_BEGIN_VARIABLE_WITH_PIXEL(opcode,size) \
- if (pc + (size) > gc->bufEnd) { \
- pc = __glXFlushRenderBuffer(gc, pc); \
- } \
- __GLX_PUT_SHORT(0,size); \
- __GLX_PUT_SHORT(2,opcode); \
- pc += __GLX_RENDER_HDR_SIZE; \
- pixelHeaderPC = pc; \
- pc += __GLX_PIXEL_HDR_SIZE
-
-#define __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL(opcode,size) \
- pc = __glXFlushRenderBuffer(gc, pc); \
- __GLX_PUT_LONG(0,size); \
- __GLX_PUT_LONG(4,opcode); \
- pc += __GLX_RENDER_LARGE_HDR_SIZE; \
- pixelHeaderPC = pc; \
- pc += __GLX_PIXEL_HDR_SIZE
-
-#define __GLX_BEGIN_VARIABLE_WITH_PIXEL_3D(opcode,size) \
- if (pc + (size) > gc->bufEnd) { \
- pc = __glXFlushRenderBuffer(gc, pc); \
- } \
- __GLX_PUT_SHORT(0,size); \
- __GLX_PUT_SHORT(2,opcode); \
- pc += __GLX_RENDER_HDR_SIZE; \
- pixelHeaderPC = pc; \
- pc += __GLX_PIXEL_3D_HDR_SIZE
-
-#define __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL_3D(opcode,size) \
- pc = __glXFlushRenderBuffer(gc, pc); \
- __GLX_PUT_LONG(0,size); \
- __GLX_PUT_LONG(4,opcode); \
- pc += __GLX_RENDER_LARGE_HDR_SIZE; \
- pixelHeaderPC = pc; \
- pc += __GLX_PIXEL_3D_HDR_SIZE
-
-/*
-** Fixed size command support macro. This macro is used by calls that
-** are never larger than __GLX_SMALL_RENDER_CMD_SIZE. Because they
-** always fit in the buffer, and because the buffer promises to
-** maintain enough room for them, we don't need to check for space
-** before doing the storage work.
-*/
-#define __GLX_BEGIN(opcode,size) \
- __GLX_PUT_SHORT(0,size); \
- __GLX_PUT_SHORT(2,opcode)
-
-/*
-** Finish a rendering command by advancing the pc. If the pc is now past
-** the limit pointer then there is no longer room for a
-** __GLX_SMALL_RENDER_CMD_SIZE sized command, which will break the
-** assumptions present in the __GLX_BEGIN macro. In this case the
-** rendering buffer is flushed out into the X protocol stream (which may
-** or may not do I/O).
-*/
-#define __GLX_END(size) \
- pc += size; \
- if (pc > gc->limit) { \
- (void) __glXFlushRenderBuffer(gc, pc); \
- } else { \
- gc->pc = pc; \
- }
-
-/* Array copy macros */
-#define __GLX_MEM_COPY(dest,src,bytes) \
- if (src && dest) \
- memcpy(dest, src, bytes)
-
-/* Single item copy macros */
-#define __GLX_PUT_CHAR(offset,a) \
- *((INT8 *) (pc + offset)) = a
-
-#ifndef _CRAY
-#define __GLX_PUT_SHORT(offset,a) \
- *((INT16 *) (pc + offset)) = a
-
-#define __GLX_PUT_LONG(offset,a) \
- *((INT32 *) (pc + offset)) = a
-
-#define __GLX_PUT_FLOAT(offset,a) \
- *((FLOAT32 *) (pc + offset)) = a
-
-#else
-#define __GLX_PUT_SHORT(offset,a) \
- { GLubyte *cp = (pc+offset); \
- int shift = (64-16) - ((int)(cp) >> (64-6)); \
- *(int *)cp = (*(int *)cp & ~(0xffff << shift)) | ((a & 0xffff) << shift); }
-
-#define __GLX_PUT_LONG(offset,a) \
- { GLubyte *cp = (pc+offset); \
- int shift = (64-32) - ((int)(cp) >> (64-6)); \
- *(int *)cp = (*(int *)cp & ~(0xffffffff << shift)) | ((a & 0xffffffff) << shift); }
-
-#define __GLX_PUT_FLOAT(offset,a) \
- gl_put_float((pc + offset),a)
-
-#define __GLX_PUT_DOUBLE(offset,a) \
- gl_put_double(pc + offset, a)
-
-extern void gl_put_float(/*GLubyte *, struct cray_single*/);
-extern void gl_put_double(/*GLubyte *, struct cray_double*/);
-#endif
-
-#ifndef _CRAY
-
-#ifdef __GLX_ALIGN64
-/*
-** This can certainly be done better for a particular machine
-** architecture!
-*/
-#define __GLX_PUT_DOUBLE(offset,a) \
- __GLX_MEM_COPY(pc + offset, &a, 8)
-#else
-#define __GLX_PUT_DOUBLE(offset,a) \
- *((FLOAT64 *) (pc + offset)) = a
-#endif
-
-#endif
-
-#define __GLX_PUT_CHAR_ARRAY(offset,a,alen) \
- __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_INT8)
-
-#ifndef _CRAY
-#define __GLX_PUT_SHORT_ARRAY(offset,a,alen) \
- __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_INT16)
-
-#define __GLX_PUT_LONG_ARRAY(offset,a,alen) \
- __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_INT32)
-
-#define __GLX_PUT_FLOAT_ARRAY(offset,a,alen) \
- __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_FLOAT32)
-
-#define __GLX_PUT_DOUBLE_ARRAY(offset,a,alen) \
- __GLX_MEM_COPY(pc + offset, a, alen * __GLX_SIZE_FLOAT64)
-
-#else
-#define __GLX_PUT_SHORT_ARRAY(offset,a,alen) \
- gl_put_short_array((GLubyte *)(pc + offset), a, alen * __GLX_SIZE_INT16)
-
-#define __GLX_PUT_LONG_ARRAY(offset,a,alen) \
- gl_put_long_array((GLubyte *)(pc + offset), (long *)a, alen * __GLX_SIZE_INT32)
-
-#define __GLX_PUT_FLOAT_ARRAY(offset,a,alen) \
- gl_put_float_array((GLubyte *)(pc + offset), (float *)a, alen * __GLX_SIZE_FLOAT32)
-
-#define __GLX_PUT_DOUBLE_ARRAY(offset,a,alen) \
- gl_put_double_array((GLubyte *)(pc + offset), (double *)a, alen * __GLX_SIZE_FLOAT64)
-
-extern gl_put_short_array (GLubyte *, short *, int);
-extern gl_put_long_array (GLubyte *, long *, int);
-extern gl_put_float_array (GLubyte *, float *, int);
-extern gl_put_double_array (GLubyte *, double *, int);
-
-#endif /* _CRAY */
-
-#endif /* !__GLX_packrender_h__ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/packsingle.h b/nx-X11/extras/Mesa/src/glx/x11/packsingle.h
deleted file mode 100644
index 16b054f1e..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/packsingle.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/packsingle.h,v 1.5tsi Exp $ */
-#ifndef __GLX_packsingle_h__
-#define __GLX_packsingle_h__
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "packrender.h"
-
-/*
-** The macros in this header convert wire protocol data types to the client
-** machine's native data types. The header is part of the porting layer of
-** the client library, and it is intended that hardware vendors will rewrite
-** this header to suit their own machines.
-*/
-
-/*
-** Dummy define to make the GetReqExtra macro happy. The value is not
-** used, but instead the code in __GLX_SINGLE_BEGIN issues its own store
-** to req->reqType with the proper code (our extension code).
-*/
-#define X_GLXSingle 0
-
-/* Declare common variables used during a single command */
-#define __GLX_SINGLE_DECLARE_VARIABLES() \
- __GLXcontext *gc = __glXGetCurrentContext(); \
- GLubyte *pc, *pixelHeaderPC; \
- GLuint compsize, cmdlen; \
- Display *dpy = gc->currentDpy; \
- xGLXSingleReq *req
-
-#define __GLX_SINGLE_LOAD_VARIABLES() \
- pc = gc->pc; \
- /* Muffle compilers */ \
- pixelHeaderPC = 0; (void)pixelHeaderPC; \
- compsize = 0; (void)compsize; \
- cmdlen = 0; (void)cmdlen
-
-/* Start a single command */
-#define __GLX_SINGLE_BEGIN(opcode,bytes) \
- if (dpy) { \
- (void) __glXFlushRenderBuffer(gc, pc); \
- LockDisplay(dpy); \
- GetReqExtra(GLXSingle,bytes,req); \
- req->reqType = gc->majorOpcode; \
- req->glxCode = opcode; \
- req->contextTag = gc->currentContextTag; \
- pc = ((GLubyte *)(req) + sz_xGLXSingleReq)
-
-/* End a single command */
-#define __GLX_SINGLE_END() \
- UnlockDisplay(dpy); \
- SyncHandle(); \
- }
-
-/* Store data to sending for a single command */
-#define __GLX_SINGLE_PUT_CHAR(offset,a) \
- *((INT8 *) (pc + offset)) = a
-
-#ifndef CRAY
-#define __GLX_SINGLE_PUT_SHORT(offset,a) \
- *((INT16 *) (pc + offset)) = a
-
-#define __GLX_SINGLE_PUT_LONG(offset,a) \
- *((INT32 *) (pc + offset)) = a
-
-#define __GLX_SINGLE_PUT_FLOAT(offset,a) \
- *((FLOAT32 *) (pc + offset)) = a
-
-#else
-#define __GLX_SINGLE_PUT_SHORT(offset,a) \
- { GLubyte *cp = (pc+offset); \
- int shift = (64-16) - ((int)(cp) >> (64-6)); \
- *(int *)cp = (*(int *)cp & ~(0xffff << shift)) | ((a & 0xffff) << shift); }
-
-#define __GLX_SINGLE_PUT_LONG(offset,a) \
- { GLubyte *cp = (pc+offset); \
- int shift = (64-32) - ((int)(cp) >> (64-6)); \
- *(int *)cp = (*(int *)cp & ~(0xffffffff << shift)) | ((a & 0xffffffff) << shift); }
-
-#define __GLX_SINGLE_PUT_FLOAT(offset,a) \
- gl_put_float(pc + offset, a)
-#endif
-
-/* Read support macros */
-#define __GLX_SINGLE_READ_XREPLY() \
- (void) _XReply(dpy, (xReply*) &reply, 0, False)
-
-#define __GLX_SINGLE_GET_RETVAL(a,cast) \
- a = (cast) reply.retval
-
-#define __GLX_SINGLE_GET_SIZE(a) \
- a = (GLint) reply.size
-
-#ifndef _CRAY
-#define __GLX_SINGLE_GET_CHAR(p) \
- *p = *(GLbyte *)&reply.pad3;
-
-#define __GLX_SINGLE_GET_SHORT(p) \
- *p = *(GLshort *)&reply.pad3;
-
-#define __GLX_SINGLE_GET_LONG(p) \
- *p = *(GLint *)&reply.pad3;
-
-#define __GLX_SINGLE_GET_FLOAT(p) \
- *p = *(GLfloat *)&reply.pad3;
-
-#else
-#define __GLX_SINGLE_GET_CHAR(p) \
- *p = reply.pad3 >> 24;
-
-#define __GLX_SINGLE_GET_SHORT(p) \
- {int t = reply.pad3 >> 16; \
- *p = (t & 0x8000) ? (t | ~0xffff) : (t & 0xffff);}
-
-#define __GLX_SINGLE_GET_LONG(p) \
- {int t = reply.pad3; \
- *p = (t & 0x80000000) ? (t | ~0xffffffff) : (t & 0xffffffff);}
-
-#define PAD3OFFSET 16
-#define __GLX_SINGLE_GET_FLOAT(p) \
- *p = gl_ntoh_float((GLubyte *)&reply + PAD3OFFSET);
-
-#define __GLX_SINGLE_GET_DOUBLE(p) \
- *p = gl_ntoh_double((GLubyte *)&reply + PAD3OFFSET);
-
-extern float gl_ntoh_float(GLubyte *);
-extern float gl_ntoh_double(GLubyte *);
-#endif
-
-#ifndef _CRAY
-
-#ifdef __GLX_ALIGN64
-#define __GLX_SINGLE_GET_DOUBLE(p) \
- __GLX_MEM_COPY(p, &reply.pad3, 8)
-#else
-#define __GLX_SINGLE_GET_DOUBLE(p) \
- *p = *(GLdouble *)&reply.pad3
-#endif
-
-#endif
-
-/* Get an array of typed data */
-#define __GLX_SINGLE_GET_VOID_ARRAY(a,alen) \
-{ \
- GLint slop = alen*__GLX_SIZE_INT8 & 3; \
- _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT8); \
- if (slop) _XEatData(dpy,4-slop); \
-}
-
-#define __GLX_SINGLE_GET_CHAR_ARRAY(a,alen) \
-{ \
- GLint slop = alen*__GLX_SIZE_INT8 & 3; \
- _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT8); \
- if (slop) _XEatData(dpy,4-slop); \
-}
-
-
-#define __GLX_SINGLE_GET_SHORT_ARRAY(a,alen) \
-{ \
- GLint slop = (alen*__GLX_SIZE_INT16) & 3; \
- _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT16);\
- if (slop) _XEatData(dpy,4-slop); \
-}
-
-#define __GLX_SINGLE_GET_LONG_ARRAY(a,alen) \
- _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT32);
-
-#ifndef _CRAY
-#define __GLX_SINGLE_GET_FLOAT_ARRAY(a,alen) \
- _XRead(dpy,(char *)a,alen*__GLX_SIZE_FLOAT32);
-
-#define __GLX_SINGLE_GET_DOUBLE_ARRAY(a,alen) \
- _XRead(dpy,(char *)a,alen*__GLX_SIZE_FLOAT64);
-
-#else
-#define __GLX_SINGLE_GET_FLOAT_ARRAY(a,alen) \
- gl_get_float_array(dpy,a,alen);
-
-#define __GLX_SINGLE_GET_DOUBLE_ARRAY(a,alen) \
- gl_get_double_array(dpy, a, alen);
-
-extern void gl_get_float_array(Display *dpy, float *a, int alen);
-extern void gl_get_double_array(Display *dpy, double *a, int alen);
-#endif
-
-#endif /* !__GLX_packsingle_h__ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/pixel.c b/nx-X11/extras/Mesa/src/glx/x11/pixel.c
deleted file mode 100644
index 3b3a1811a..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/pixel.c
+++ /dev/null
@@ -1,443 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/pixel.c,v 1.8 2003/09/28 20:15:04 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "packrender.h"
-
-static const GLubyte MsbToLsbTable[256] = {
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
- 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
- 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
- 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
- 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
- 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
- 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
- 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
- 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
- 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
- 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
- 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
- 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
- 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
- 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
- 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
- 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
- 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
- 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
- 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
- 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
- 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
- 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
- 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
- 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
- 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
- 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
- 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
- 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
- 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
- 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
-};
-
-static const GLubyte LowBitsMask[9] = {
- 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff,
-};
-
-static const GLubyte HighBitsMask[9] = {
- 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff,
-};
-
-
-/*
-** Copy bitmap data from clients packed memory applying unpacking modes as the
-** data is transfered into the destImage buffer. Return in modes the
-** set of pixel modes that are to be done by the server.
-*/
-static void FillBitmap(__GLXcontext *gc, GLint width, GLint height,
- GLenum format, const GLvoid *userdata,
- GLubyte *destImage)
-{
- const __GLXattribute * state = gc->client_state_private;
- GLint rowLength = state->storeUnpack.rowLength;
- GLint alignment = state->storeUnpack.alignment;
- GLint skipPixels = state->storeUnpack.skipPixels;
- GLint skipRows = state->storeUnpack.skipRows;
- GLint lsbFirst = state->storeUnpack.lsbFirst;
- GLint elementsLeft, bitOffset, currentByte, nextByte, highBitMask;
- GLint lowBitMask, i;
- GLint components, groupsPerRow, rowSize, padding, elementsPerRow;
- const GLubyte *start, *iter;
-
- if (rowLength > 0) {
- groupsPerRow = rowLength;
- } else {
- groupsPerRow = width;
- }
- components = __glElementsPerGroup(format,GL_BITMAP);
- rowSize = (groupsPerRow * components + 7) >> 3;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
- start = ((const GLubyte*) userdata) + skipRows * rowSize +
- ((skipPixels * components) >> 3);
- bitOffset = (skipPixels * components) & 7;
- highBitMask = LowBitsMask[8-bitOffset];
- lowBitMask = HighBitsMask[bitOffset];
- elementsPerRow = width * components;
- for (i = 0; i < height; i++) {
- elementsLeft = elementsPerRow;
- iter = start;
- while (elementsLeft) {
- /* First retrieve low bits from current byte */
- if (lsbFirst) {
- currentByte = MsbToLsbTable[iter[0]];
- } else {
- currentByte = iter[0];
- }
- if (bitOffset) {
- /* Need to read next byte to finish current byte */
- if (elementsLeft > (8 - bitOffset)) {
- if (lsbFirst) {
- nextByte = MsbToLsbTable[iter[1]];
- } else {
- nextByte = iter[1];
- }
- currentByte =
- ((currentByte & highBitMask) << bitOffset) |
- ((nextByte & lowBitMask) >> (8 - bitOffset));
- } else {
- currentByte =
- ((currentByte & highBitMask) << bitOffset);
- }
- }
- if (elementsLeft >= 8) {
- *destImage = currentByte;
- elementsLeft -= 8;
- } else {
- *destImage = currentByte & HighBitsMask[elementsLeft];
- elementsLeft = 0;
- }
- destImage++;
- iter++;
- }
- start += rowSize;
- }
-}
-
-/*
-** Extract array from user's data applying all pixel store modes.
-** The internal packed array format used has LSB_FIRST = FALSE and
-** ALIGNMENT = 1.
-*/
-void __glFillImage(__GLXcontext *gc, GLint dim, GLint width, GLint height,
- GLint depth, GLenum format, GLenum type,
- const GLvoid *userdata, GLubyte *newimage, GLubyte *modes)
-{
- const __GLXattribute * state = gc->client_state_private;
- GLint rowLength = state->storeUnpack.rowLength;
- GLint imageHeight = state->storeUnpack.imageHeight;
- GLint alignment = state->storeUnpack.alignment;
- GLint skipPixels = state->storeUnpack.skipPixels;
- GLint skipRows = state->storeUnpack.skipRows;
- GLint skipImages = state->storeUnpack.skipImages;
- GLint swapBytes = state->storeUnpack.swapEndian;
- GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize;
- GLint elementsPerRow, imageSize, rowsPerImage, h, i, j, k;
- const GLubyte *start, *iter, *itera, *iterb, *iterc;
- GLubyte *iter2;
-
- if (type == GL_BITMAP) {
- FillBitmap(gc, width, height, format, userdata, newimage);
- } else {
- components = __glElementsPerGroup(format,type);
- if (rowLength > 0) {
- groupsPerRow = rowLength;
- } else {
- groupsPerRow = width;
- }
- if (imageHeight > 0) {
- rowsPerImage = imageHeight;
- } else {
- rowsPerImage = height;
- }
-
- elementSize = __glBytesPerElement(type);
- groupSize = elementSize * components;
- if (elementSize == 1) swapBytes = 0;
-
- rowSize = groupsPerRow * groupSize;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
- imageSize = rowSize * rowsPerImage;
- start = ((const GLubyte*) userdata) + skipImages * imageSize +
- skipRows * rowSize + skipPixels * groupSize;
- iter2 = newimage;
- elementsPerRow = width * components;
-
- if (swapBytes) {
- itera = start;
- for (h = 0; h < depth; h++) {
- iterb = itera;
- for (i = 0; i < height; i++) {
- iterc = iterb;
- for (j = 0; j < elementsPerRow; j++) {
- for (k = 1; k <= elementSize; k++) {
- iter2[k-1] = iterc[elementSize - k];
- }
- iter2 += elementSize;
- iterc += elementSize;
- }
- iterb += rowSize;
- }
- itera += imageSize;
- }
- } else {
- itera = start;
- for (h = 0; h < depth; h++) {
- if (rowSize == elementsPerRow * elementSize) {
- /* Ha! This is mondo easy! */
- __GLX_MEM_COPY(iter2, itera,
- elementsPerRow * elementSize * height);
- iter2 += elementsPerRow * elementSize * height;
- } else {
- iter = itera;
- for (i = 0; i < height; i++) {
- __GLX_MEM_COPY(iter2, iter, elementsPerRow*elementSize);
- iter2 += elementsPerRow * elementSize;
- iter += rowSize;
- }
- }
- itera += imageSize;
- }
- }
- }
-
- /* Setup store modes that describe what we just did */
- if (modes) {
- if ( dim < 3 ) {
- (void) memcpy( modes, __glXDefaultPixelStore + 4, 20 );
- }
- else {
- (void) memcpy( modes, __glXDefaultPixelStore + 0, 36 );
- }
- }
-}
-
-/*
-** Empty a bitmap in LSB_FIRST=GL_FALSE and ALIGNMENT=4 format packing it
-** into the clients memory using the pixel store PACK modes.
-*/
-static void EmptyBitmap(__GLXcontext *gc, GLint width, GLint height,
- GLenum format, const GLubyte *sourceImage,
- GLvoid *userdata)
-{
- const __GLXattribute * state = gc->client_state_private;
- GLint rowLength = state->storePack.rowLength;
- GLint alignment = state->storePack.alignment;
- GLint skipPixels = state->storePack.skipPixels;
- GLint skipRows = state->storePack.skipRows;
- GLint lsbFirst = state->storePack.lsbFirst;
- GLint components, groupsPerRow, rowSize, padding, elementsPerRow;
- GLint sourceRowSize, sourcePadding, sourceSkip;
- GLubyte *start, *iter;
- GLint elementsLeft, bitOffset, currentByte, highBitMask, lowBitMask;
- GLint writeMask, i;
- GLubyte writeByte;
-
- components = __glElementsPerGroup(format,GL_BITMAP);
- if (rowLength > 0) {
- groupsPerRow = rowLength;
- } else {
- groupsPerRow = width;
- }
-
- rowSize = (groupsPerRow * components + 7) >> 3;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
- sourceRowSize = (width * components + 7) >> 3;
- sourcePadding = (sourceRowSize % 4);
- if (sourcePadding) {
- sourceSkip = 4 - sourcePadding;
- } else {
- sourceSkip = 0;
- }
- start = ((GLubyte*) userdata) + skipRows * rowSize +
- ((skipPixels * components) >> 3);
- bitOffset = (skipPixels * components) & 7;
- highBitMask = LowBitsMask[8-bitOffset];
- lowBitMask = HighBitsMask[bitOffset];
- elementsPerRow = width * components;
- for (i = 0; i < height; i++) {
- elementsLeft = elementsPerRow;
- iter = start;
- writeMask = highBitMask;
- writeByte = 0;
- while (elementsLeft) {
- /* Set up writeMask (to write to current byte) */
- if (elementsLeft + bitOffset < 8) {
- /* Need to trim writeMask */
- writeMask &= HighBitsMask[bitOffset+elementsLeft];
- }
-
- if (lsbFirst) {
- currentByte = MsbToLsbTable[iter[0]];
- } else {
- currentByte = iter[0];
- }
-
- if (bitOffset) {
- writeByte |= (sourceImage[0] >> bitOffset);
- currentByte = (currentByte & ~writeMask) |
- (writeByte & writeMask);
- writeByte = (sourceImage[0] << (8 - bitOffset));
- } else {
- currentByte = (currentByte & ~writeMask) |
- (sourceImage[0] & writeMask);
- }
-
- if (lsbFirst) {
- iter[0] = MsbToLsbTable[currentByte];
- } else {
- iter[0] = currentByte;
- }
-
- if (elementsLeft >= 8) {
- elementsLeft -= 8;
- } else {
- elementsLeft = 0;
- }
- sourceImage++;
- iter++;
- writeMask = 0xff;
- }
- if (writeByte) {
- /* Some data left over that still needs writing */
- writeMask &= lowBitMask;
- if (lsbFirst) {
- currentByte = MsbToLsbTable[iter[0]];
- } else {
- currentByte = iter[0];
- }
- currentByte = (currentByte & ~writeMask) | (writeByte & writeMask);
- if (lsbFirst) {
- iter[0] = MsbToLsbTable[currentByte];
- } else {
- iter[0] = currentByte;
- }
- }
- start += rowSize;
- sourceImage += sourceSkip;
- }
-}
-
-/*
-** Insert array into user's data applying all pixel store modes.
-** The packed array format from the server is LSB_FIRST = FALSE,
-** SWAP_BYTES = the current pixel storage pack mode, and ALIGNMENT = 4.
-** Named __glEmptyImage() because it is the opposite of __glFillImage().
-*/
-/* ARGSUSED */
-void __glEmptyImage(__GLXcontext *gc, GLint dim, GLint width, GLint height,
- GLint depth, GLenum format, GLenum type,
- const GLubyte *sourceImage, GLvoid *userdata)
-{
- const __GLXattribute * state = gc->client_state_private;
- GLint rowLength = state->storePack.rowLength;
- GLint imageHeight = state->storePack.imageHeight;
- GLint alignment = state->storePack.alignment;
- GLint skipPixels = state->storePack.skipPixels;
- GLint skipRows = state->storePack.skipRows;
- GLint skipImages = state->storePack.skipImages;
- GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize;
- GLint elementsPerRow, sourceRowSize, sourcePadding, h, i;
- GLint imageSize, rowsPerImage;
- GLubyte *start, *iter, *itera;
-
- if (type == GL_BITMAP) {
- EmptyBitmap(gc, width, height, format, sourceImage, userdata);
- } else {
- components = __glElementsPerGroup(format,type);
- if (rowLength > 0) {
- groupsPerRow = rowLength;
- } else {
- groupsPerRow = width;
- }
- if (imageHeight > 0) {
- rowsPerImage = imageHeight;
- } else {
- rowsPerImage = height;
- }
- elementSize = __glBytesPerElement(type);
- groupSize = elementSize * components;
- rowSize = groupsPerRow * groupSize;
- padding = (rowSize % alignment);
- if (padding) {
- rowSize += alignment - padding;
- }
- sourceRowSize = width * groupSize;
- sourcePadding = (sourceRowSize % 4);
- if (sourcePadding) {
- sourceRowSize += 4 - sourcePadding;
- }
- imageSize = sourceRowSize * rowsPerImage;
- start = ((GLubyte*) userdata) + skipImages * imageSize +
- skipRows * rowSize + skipPixels * groupSize;
- elementsPerRow = width * components;
-
- itera = start;
- for (h = 0; h < depth; h++) {
- if ((rowSize == sourceRowSize) && (sourcePadding == 0)) {
- /* Ha! This is mondo easy! */
- __GLX_MEM_COPY(itera, sourceImage,
- elementsPerRow * elementSize * height);
- sourceImage += elementsPerRow * elementSize * height;
- } else {
- iter = itera;
- for (i = 0; i < height; i++) {
- __GLX_MEM_COPY(iter, sourceImage,
- elementsPerRow * elementSize);
- sourceImage += sourceRowSize;
- iter += rowSize;
- }
- }
- itera += imageSize;
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/pixelstore.c b/nx-X11/extras/Mesa/src/glx/x11/pixelstore.c
deleted file mode 100644
index 8996ee879..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/pixelstore.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/pixelstore.c,v 1.4 2004/01/28 18:11:43 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "glxclient.h"
-#include "indirect.h"
-
-#if !defined __GNUC__ || __GNUC__ < 3
-# define __builtin_expect(x, y) x
-#endif
-
-/**
- * Send glPixelStore command to the server
- *
- * \param gc Current GLX context
- * \param sop Either \c X_GLsop_PixelStoref or \c X_GLsop_PixelStorei
- * \param pname Selector of which pixel parameter is to be set.
- * \param param Value that \c pname is set to.
- *
- * \sa __indirect_glPixelStorei, __indirect_glPixelStoref
- */
-static void
-send_PixelStore( __GLXcontext * gc, unsigned sop, GLenum pname,
- const void * param )
-{
- Display * const dpy = gc->currentDpy;
- const GLuint cmdlen = 8;
- if (__builtin_expect(dpy != NULL, 1)) {
- GLubyte const * pc = __glXSetupSingleRequest(gc, sop, cmdlen);
- (void) memcpy((void *)(pc + 0), (void *)(&pname), 4);
- (void) memcpy((void *)(pc + 4), param, 4);
- UnlockDisplay(dpy); SyncHandle();
- }
- return;
-}
-
-/*
-** Specify parameters that control the storage format of pixel arrays.
-*/
-void __indirect_glPixelStoref(GLenum pname, GLfloat param)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = gc->client_state_private;
- Display *dpy = gc->currentDpy;
- GLuint a;
-
- if (!dpy) return;
-
- switch (pname) {
- case GL_PACK_ROW_LENGTH:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.rowLength = a;
- break;
- case GL_PACK_IMAGE_HEIGHT:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.imageHeight = a;
- break;
- case GL_PACK_SKIP_ROWS:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.skipRows = a;
- break;
- case GL_PACK_SKIP_PIXELS:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.skipPixels = a;
- break;
- case GL_PACK_SKIP_IMAGES:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.skipImages = a;
- break;
- case GL_PACK_ALIGNMENT:
- a = (GLint) (param + 0.5);
- switch (a) {
- case 1: case 2: case 4: case 8:
- state->storePack.alignment = a;
- break;
- default:
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- break;
- case GL_PACK_SWAP_BYTES:
- state->storePack.swapEndian = (param != 0);
- break;
- case GL_PACK_LSB_FIRST:
- state->storePack.lsbFirst = (param != 0);
- break;
-
- case GL_UNPACK_ROW_LENGTH:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.rowLength = a;
- break;
- case GL_UNPACK_IMAGE_HEIGHT:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.imageHeight = a;
- break;
- case GL_UNPACK_SKIP_ROWS:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.skipRows = a;
- break;
- case GL_UNPACK_SKIP_PIXELS:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.skipPixels = a;
- break;
- case GL_UNPACK_SKIP_IMAGES:
- a = (GLuint) (param + 0.5);
- if (((GLint) a) < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.skipImages = a;
- break;
- case GL_UNPACK_ALIGNMENT:
- a = (GLint) (param + 0.5);
- switch (a) {
- case 1: case 2: case 4: case 8:
- state->storeUnpack.alignment = a;
- break;
- default:
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- break;
- case GL_UNPACK_SWAP_BYTES:
- state->storeUnpack.swapEndian = (param != 0);
- break;
- case GL_UNPACK_LSB_FIRST:
- state->storeUnpack.lsbFirst = (param != 0);
- break;
-
- /* Group all of the pixel store modes that need to be sent to the
- * server here. Care must be used to only send modes to the server that
- * won't affect the size of the data sent to or received from the
- * server. GL_PACK_INVERT_MESA is safe in this respect, but other,
- * future modes may not be.
- */
- case GL_PACK_INVERT_MESA:
- send_PixelStore( gc, X_GLsop_PixelStoref, pname, & param );
- break;
-
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- break;
- }
-}
-
-void __indirect_glPixelStorei(GLenum pname, GLint param)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = gc->client_state_private;
- Display *dpy = gc->currentDpy;
-
- if (!dpy) return;
-
- switch (pname) {
- case GL_PACK_ROW_LENGTH:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.rowLength = param;
- break;
- case GL_PACK_IMAGE_HEIGHT:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.imageHeight = param;
- break;
- case GL_PACK_SKIP_ROWS:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.skipRows = param;
- break;
- case GL_PACK_SKIP_PIXELS:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.skipPixels = param;
- break;
- case GL_PACK_SKIP_IMAGES:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storePack.skipImages = param;
- break;
- case GL_PACK_ALIGNMENT:
- switch (param) {
- case 1: case 2: case 4: case 8:
- state->storePack.alignment = param;
- break;
- default:
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- break;
- case GL_PACK_SWAP_BYTES:
- state->storePack.swapEndian = (param != 0);
- break;
- case GL_PACK_LSB_FIRST:
- state->storePack.lsbFirst = (param != 0);
- break;
-
- case GL_UNPACK_ROW_LENGTH:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.rowLength = param;
- break;
- case GL_UNPACK_IMAGE_HEIGHT:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.imageHeight = param;
- break;
- case GL_UNPACK_SKIP_ROWS:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.skipRows = param;
- break;
- case GL_UNPACK_SKIP_PIXELS:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.skipPixels = param;
- break;
- case GL_UNPACK_SKIP_IMAGES:
- if (param < 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- state->storeUnpack.skipImages = param;
- break;
- case GL_UNPACK_ALIGNMENT:
- switch (param) {
- case 1: case 2: case 4: case 8:
- state->storeUnpack.alignment = param;
- break;
- default:
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- break;
- case GL_UNPACK_SWAP_BYTES:
- state->storeUnpack.swapEndian = (param != 0);
- break;
- case GL_UNPACK_LSB_FIRST:
- state->storeUnpack.lsbFirst = (param != 0);
- break;
-
- /* Group all of the pixel store modes that need to be sent to the
- * server here. Care must be used to only send modes to the server that
- * won't affect the size of the data sent to or received from the
- * server. GL_PACK_INVERT_MESA is safe in this respect, but other,
- * future modes may not be.
- */
- case GL_PACK_INVERT_MESA:
- send_PixelStore( gc, X_GLsop_PixelStorei, pname, & param );
- break;
-
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- break;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/render2.c b/nx-X11/extras/Mesa/src/glx/x11/render2.c
deleted file mode 100644
index 21ba27099..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/render2.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/render2.c,v 1.6 2004/01/31 09:29:33 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "packrender.h"
-#include "indirect.h"
-#include "indirect_size.h"
-
-/*
-** This file contains routines that might need to be transported as
-** GLXRender or GLXRenderLarge commands, and these commands don't
-** use the pixel header. See renderpix.c for those routines.
-*/
-
-void __indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
- GLint order, const GLdouble *pnts)
-{
- __GLX_DECLARE_VARIABLES();
- GLint k;
-
- __GLX_LOAD_VARIABLES();
- k = __glMap1d_size(target);
- if (k == 0) {
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- } else if (stride < k || order <= 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- compsize = k * order * __GLX_SIZE_FLOAT64;
- cmdlen = 28+compsize;
- if (!gc->currentDpy) return;
-
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- /* Use GLXRender protocol to send small command */
- __GLX_BEGIN_VARIABLE(X_GLrop_Map1d,cmdlen);
- __GLX_PUT_DOUBLE(4,u1);
- __GLX_PUT_DOUBLE(12,u2);
- __GLX_PUT_LONG(20,target);
- __GLX_PUT_LONG(24,order);
- /*
- ** NOTE: the doubles that follow are not aligned because of 3
- ** longs preceeding
- */
- __glFillMap1d(k, order, stride, pnts, (pc+28));
- __GLX_END(cmdlen);
- } else {
- /* Use GLXRenderLarge protocol to send command */
- __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map1d,cmdlen+4);
- __GLX_PUT_DOUBLE(8,u1);
- __GLX_PUT_DOUBLE(16,u2);
- __GLX_PUT_LONG(24,target);
- __GLX_PUT_LONG(28,order);
-
- /*
- ** NOTE: the doubles that follow are not aligned because of 3
- ** longs preceeding
- */
- if (stride != k) {
- GLubyte *buf;
-
- buf = (GLubyte *) Xmalloc(compsize);
- if (!buf) {
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- return;
- }
- __glFillMap1d(k, order, stride, pnts, buf);
- __glXSendLargeCommand(gc, pc, 32, buf, compsize);
- Xfree((char*) buf);
- } else {
- /* Data is already packed. Just send it out */
- __glXSendLargeCommand(gc, pc, 32, pnts, compsize);
- }
- }
-}
-
-void __indirect_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *pnts)
-{
- __GLX_DECLARE_VARIABLES();
- GLint k;
-
- __GLX_LOAD_VARIABLES();
- k = __glMap1f_size(target);
- if (k == 0) {
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- } else if (stride < k || order <= 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- compsize = k * order * __GLX_SIZE_FLOAT32;
- cmdlen = 20+compsize;
- if (!gc->currentDpy) return;
-
- /*
- ** The order that arguments are packed is different from the order
- ** for glMap1d.
- */
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- /* Use GLXRender protocol to send small command */
- __GLX_BEGIN_VARIABLE(X_GLrop_Map1f,cmdlen);
- __GLX_PUT_LONG(4,target);
- __GLX_PUT_FLOAT(8,u1);
- __GLX_PUT_FLOAT(12,u2);
- __GLX_PUT_LONG(16,order);
- __glFillMap1f(k, order, stride, pnts, (GLubyte*) (pc+20));
- __GLX_END(cmdlen);
- } else {
- /* Use GLXRenderLarge protocol to send command */
- __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map1f,cmdlen+4);
- __GLX_PUT_LONG(8,target);
- __GLX_PUT_FLOAT(12,u1);
- __GLX_PUT_FLOAT(16,u2);
- __GLX_PUT_LONG(20,order);
-
- if (stride != k) {
- GLubyte *buf;
-
- buf = (GLubyte *) Xmalloc(compsize);
- if (!buf) {
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- return;
- }
- __glFillMap1f(k, order, stride, pnts, buf);
- __glXSendLargeCommand(gc, pc, 24, buf, compsize);
- Xfree((char*) buf);
- } else {
- /* Data is already packed. Just send it out */
- __glXSendLargeCommand(gc, pc, 24, pnts, compsize);
- }
- }
-}
-
-void __indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustr, GLint uord,
- GLdouble v1, GLdouble v2, GLint vstr, GLint vord,
- const GLdouble *pnts)
-{
- __GLX_DECLARE_VARIABLES();
- GLint k;
-
- __GLX_LOAD_VARIABLES();
- k = __glMap2d_size(target);
- if (k == 0) {
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- } else if (vstr < k || ustr < k || vord <= 0 || uord <= 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- compsize = k * uord * vord * __GLX_SIZE_FLOAT64;
- cmdlen = 48+compsize;
- if (!gc->currentDpy) return;
-
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- /* Use GLXRender protocol to send small command */
- __GLX_BEGIN_VARIABLE(X_GLrop_Map2d,cmdlen);
- __GLX_PUT_DOUBLE(4,u1);
- __GLX_PUT_DOUBLE(12,u2);
- __GLX_PUT_DOUBLE(20,v1);
- __GLX_PUT_DOUBLE(28,v2);
- __GLX_PUT_LONG(36,target);
- __GLX_PUT_LONG(40,uord);
- __GLX_PUT_LONG(44,vord);
- /*
- ** Pack into a u-major ordering.
- ** NOTE: the doubles that follow are not aligned because of 5
- ** longs preceeding
- */
- __glFillMap2d(k, uord, vord, ustr, vstr, pnts, (GLdouble*) (pc+48));
- __GLX_END(cmdlen);
- } else {
- /* Use GLXRenderLarge protocol to send command */
- __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map2d,cmdlen+4);
- __GLX_PUT_DOUBLE(8,u1);
- __GLX_PUT_DOUBLE(16,u2);
- __GLX_PUT_DOUBLE(24,v1);
- __GLX_PUT_DOUBLE(32,v2);
- __GLX_PUT_LONG(40,target);
- __GLX_PUT_LONG(44,uord);
- __GLX_PUT_LONG(48,vord);
-
- /*
- ** NOTE: the doubles that follow are not aligned because of 5
- ** longs preceeding
- */
- if ((vstr != k) || (ustr != k*vord)) {
- GLdouble *buf;
-
- buf = (GLdouble *) Xmalloc(compsize);
- if (!buf) {
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- return;
- }
- /*
- ** Pack into a u-major ordering.
- */
- __glFillMap2d(k, uord, vord, ustr, vstr, pnts, buf);
- __glXSendLargeCommand(gc, pc, 52, buf, compsize);
- Xfree((char*) buf);
- } else {
- /* Data is already packed. Just send it out */
- __glXSendLargeCommand(gc, pc, 52, pnts, compsize);
- }
- }
-}
-
-void __indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustr, GLint uord,
- GLfloat v1, GLfloat v2, GLint vstr, GLint vord,
- const GLfloat *pnts)
-{
- __GLX_DECLARE_VARIABLES();
- GLint k;
-
- __GLX_LOAD_VARIABLES();
- k = __glMap2f_size(target);
- if (k == 0) {
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- } else if (vstr < k || ustr < k || vord <= 0 || uord <= 0) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
- compsize = k * uord * vord * __GLX_SIZE_FLOAT32;
- cmdlen = 32+compsize;
- if (!gc->currentDpy) return;
-
- /*
- ** The order that arguments are packed is different from the order
- ** for glMap2d.
- */
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- /* Use GLXRender protocol to send small command */
- __GLX_BEGIN_VARIABLE(X_GLrop_Map2f,cmdlen);
- __GLX_PUT_LONG(4,target);
- __GLX_PUT_FLOAT(8,u1);
- __GLX_PUT_FLOAT(12,u2);
- __GLX_PUT_LONG(16,uord);
- __GLX_PUT_FLOAT(20,v1);
- __GLX_PUT_FLOAT(24,v2);
- __GLX_PUT_LONG(28,vord);
- /*
- ** Pack into a u-major ordering.
- */
- __glFillMap2f(k, uord, vord, ustr, vstr, pnts, (GLfloat*) (pc+32));
- __GLX_END(cmdlen);
- } else {
- /* Use GLXRenderLarge protocol to send command */
- __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_Map2f,cmdlen+4);
- __GLX_PUT_LONG(8,target);
- __GLX_PUT_FLOAT(12,u1);
- __GLX_PUT_FLOAT(16,u2);
- __GLX_PUT_LONG(20,uord);
- __GLX_PUT_FLOAT(24,v1);
- __GLX_PUT_FLOAT(28,v2);
- __GLX_PUT_LONG(32,vord);
-
- if ((vstr != k) || (ustr != k*vord)) {
- GLfloat *buf;
-
- buf = (GLfloat *) Xmalloc(compsize);
- if (!buf) {
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- return;
- }
- /*
- ** Pack into a u-major ordering.
- */
- __glFillMap2f(k, uord, vord, ustr, vstr, pnts, buf);
- __glXSendLargeCommand(gc, pc, 36, buf, compsize);
- Xfree((char*) buf);
- } else {
- /* Data is already packed. Just send it out */
- __glXSendLargeCommand(gc, pc, 36, pnts, compsize);
- }
- }
-}
-
-void __indirect_glEnable(GLenum cap)
-{
- __GLX_DECLARE_VARIABLES();
-
- __GLX_LOAD_VARIABLES();
- if (!gc->currentDpy) return;
-
- switch(cap) {
- case GL_COLOR_ARRAY:
- case GL_EDGE_FLAG_ARRAY:
- case GL_INDEX_ARRAY:
- case GL_NORMAL_ARRAY:
- case GL_TEXTURE_COORD_ARRAY:
- case GL_VERTEX_ARRAY:
- case GL_SECONDARY_COLOR_ARRAY:
- case GL_FOG_COORD_ARRAY:
- __indirect_glEnableClientState(cap);
- return;
- default:
- break;
- }
-
- __GLX_BEGIN(X_GLrop_Enable,8);
- __GLX_PUT_LONG(4,cap);
- __GLX_END(8);
-}
-
-void __indirect_glDisable(GLenum cap)
-{
- __GLX_DECLARE_VARIABLES();
-
- __GLX_LOAD_VARIABLES();
- if (!gc->currentDpy) return;
-
- switch(cap) {
- case GL_COLOR_ARRAY:
- case GL_EDGE_FLAG_ARRAY:
- case GL_INDEX_ARRAY:
- case GL_NORMAL_ARRAY:
- case GL_TEXTURE_COORD_ARRAY:
- case GL_VERTEX_ARRAY:
- case GL_SECONDARY_COLOR_ARRAY:
- case GL_FOG_COORD_ARRAY:
- __indirect_glDisableClientState(cap);
- return;
- default:
- break;
- }
-
- __GLX_BEGIN(X_GLrop_Disable,8);
- __GLX_PUT_LONG(4,cap);
- __GLX_END(8);
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/renderpix.c b/nx-X11/extras/Mesa/src/glx/x11/renderpix.c
deleted file mode 100644
index b7d01dc67..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/renderpix.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/renderpix.c,v 1.5 2003/09/28 20:15:04 alanh Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-/*
- * (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 "packrender.h"
-#include "indirect.h"
-
-/**
- * Send a large image to the server. If necessary, a buffer is allocated
- * to hold the unpacked data that is copied from the clients memory.
- *
- * \param gc Current GLX context
- * \param compsize Size, in bytes, of the image portion
- * \param dim Number of dimensions of the image
- * \param width Width of the image
- * \param height Height of the image, must be 1 for 1D images
- * \param depth Depth of the image, must be 1 for 1D or 2D images
- * \param format Format of the image
- * \param type Data type of the image
- * \param src Pointer to the image data
- * \param pc Pointer to end of the command header
- * \param modes Pointer to the pixel unpack data
- *
- * \todo
- * Modify this function so that \c NULL images are sent using
- * \c __glXSendLargeChunk instead of __glXSendLargeCommand. Doing this
- * will eliminate the need to allocate a buffer for that case.
- *
- * \bugs
- * The \c fastImageUnpack path, which is thankfully never used, is completely
- * broken.
- */
-void
-__glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type, const GLvoid *src,
- GLubyte *pc, GLubyte *modes)
-{
- if ( !gc->fastImageUnpack || (src == NULL) ) {
- /* Allocate a temporary holding buffer */
- GLubyte *buf = (GLubyte *) Xmalloc(compsize);
- if (!buf) {
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- return;
- }
-
- /* Apply pixel store unpack modes to copy data into buf */
- if ( src != NULL ) {
- (*gc->fillImage)(gc, dim, width, height, depth, format, type,
- src, buf, modes);
- }
- else {
- if ( dim < 3 ) {
- (void) memcpy( modes, __glXDefaultPixelStore + 4, 20 );
- }
- else {
- (void) memcpy( modes, __glXDefaultPixelStore + 0, 36 );
- }
- }
-
- /* Send large command */
- __glXSendLargeCommand(gc, gc->pc, pc - gc->pc, buf, compsize);
-
- /* Free buffer */
- Xfree((char*) buf);
- } else {
- /* Just send the data straight as is */
- __glXSendLargeCommand(gc, gc->pc, pc - gc->pc, pc, compsize);
- }
-}
-
-/************************************************************************/
-
-/**
- * Implement GLX protocol for \c glSeparableFilter2D.
- *
- * \bugs
- * The \c fastImageUnpack path, which is thankfully never used, is completely
- * broken.
- */
-void __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *row,
- const GLvoid *column)
-{
- __GLX_DECLARE_VARIABLES();
- GLuint compsize2, hdrlen, totalhdrlen, image1len, image2len;
-
- __GLX_LOAD_VARIABLES();
- compsize = __glImageSize(width, 1, 1, format, type, 0);
- compsize2 = __glImageSize(height, 1, 1, format, type, 0);
- totalhdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
- hdrlen = __GLX_PAD(__GLX_CONV_FILT_HDR_SIZE);
- image1len = __GLX_PAD(compsize);
- image2len = __GLX_PAD(compsize2);
- cmdlen = totalhdrlen + image1len + image2len;
- if (!gc->currentDpy) return;
-
- if (cmdlen <= gc->maxSmallRenderCommandSize) {
- /* Use GLXRender protocol to send small command */
- __GLX_BEGIN_VARIABLE_WITH_PIXEL(X_GLrop_SeparableFilter2D, cmdlen);
- __GLX_PUT_LONG(0,target);
- __GLX_PUT_LONG(4,internalformat);
- __GLX_PUT_LONG(8,width);
- __GLX_PUT_LONG(12,height);
- __GLX_PUT_LONG(16,format);
- __GLX_PUT_LONG(20,type);
- pc += hdrlen;
- if (compsize > 0) {
- (*gc->fillImage)(gc, 1, width, 1, 1, format, type,
- row, pc, pixelHeaderPC);
- pc += image1len;
- }
- if (compsize2 > 0) {
- (*gc->fillImage)(gc, 1, height, 1, 1, format, type,
- column, pc, NULL);
- pc += image2len;
- }
- if ((compsize == 0) && (compsize2 == 0)) {
- /* Setup default store modes */
- (void) memcpy( pixelHeaderPC, __glXDefaultPixelStore + 4, 20 );
- }
- __GLX_END(0);
- } else {
- const GLint bufsize = image1len + image2len;
-
- /* Use GLXRenderLarge protocol to send command */
- __GLX_BEGIN_VARIABLE_LARGE_WITH_PIXEL(X_GLrop_SeparableFilter2D,cmdlen+4);
- __GLX_PUT_LONG(0,target);
- __GLX_PUT_LONG(4,internalformat);
- __GLX_PUT_LONG(8,width);
- __GLX_PUT_LONG(12,height);
- __GLX_PUT_LONG(16,format);
- __GLX_PUT_LONG(20,type);
- pc += hdrlen;
-
- if (!gc->fastImageUnpack) {
- /* Allocate a temporary holding buffer */
- GLubyte *buf = (GLubyte *) Xmalloc(bufsize);
- if (!buf) {
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- return;
- }
- (*gc->fillImage)(gc, 1, width, 1, 1, format, type, row, buf, pixelHeaderPC);
-
- (*gc->fillImage)(gc, 1, height, 1, 1, format, type, column,
- buf + image1len, pixelHeaderPC);
-
- /* Send large command */
- __glXSendLargeCommand(gc, gc->pc, (GLint)(pc - gc->pc), buf, bufsize);
- /* Free buffer */
- Xfree((char*) buf);
- } else {
- /* Just send the data straight as is */
- __glXSendLargeCommand(gc, gc->pc, (GLint)(pc - gc->pc), pc, bufsize);
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/single2.c b/nx-X11/extras/Mesa/src/glx/x11/single2.c
deleted file mode 100644
index 1c3b8f08e..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/single2.c
+++ /dev/null
@@ -1,833 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/single2.c,v 1.10 2004/02/11 19:48:16 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include <stdio.h>
-#include <assert.h>
-#include "glxclient.h"
-#include "packsingle.h"
-#include "glxextensions.h"
-#include "indirect.h"
-#include "indirect_vertex_array.h"
-
-/* Used for GL_ARB_transpose_matrix */
-static void TransposeMatrixf(GLfloat m[16])
-{
- int i, j;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < i; j++) {
- GLfloat tmp = m[i*4+j];
- m[i*4+j] = m[j*4+i];
- m[j*4+i] = tmp;
- }
- }
-}
-
-/* Used for GL_ARB_transpose_matrix */
-static void TransposeMatrixb(GLboolean m[16])
-{
- int i, j;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < i; j++) {
- GLboolean tmp = m[i*4+j];
- m[i*4+j] = m[j*4+i];
- m[j*4+i] = tmp;
- }
- }
-}
-
-/* Used for GL_ARB_transpose_matrix */
-static void TransposeMatrixd(GLdouble m[16])
-{
- int i, j;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < i; j++) {
- GLdouble tmp = m[i*4+j];
- m[i*4+j] = m[j*4+i];
- m[j*4+i] = tmp;
- }
- }
-}
-
-/* Used for GL_ARB_transpose_matrix */
-static void TransposeMatrixi(GLint m[16])
-{
- int i, j;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < i; j++) {
- GLint tmp = m[i*4+j];
- m[i*4+j] = m[j*4+i];
- m[j*4+i] = tmp;
- }
- }
-}
-
-
-/**
- * Remap a transpose-matrix enum to a non-transpose-matrix enum. Enums
- * that are not transpose-matrix enums are unaffected.
- */
-static GLenum
-RemapTransposeEnum( GLenum e )
-{
- switch( e ) {
- case GL_TRANSPOSE_MODELVIEW_MATRIX:
- case GL_TRANSPOSE_PROJECTION_MATRIX:
- case GL_TRANSPOSE_TEXTURE_MATRIX:
- return e - (GL_TRANSPOSE_MODELVIEW_MATRIX - GL_MODELVIEW_MATRIX);
- case GL_TRANSPOSE_COLOR_MATRIX:
- return GL_COLOR_MATRIX;
- default:
- return e;
- };
-}
-
-
-GLenum __indirect_glGetError(void)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
- GLuint retval = GL_NO_ERROR;
- xGLXGetErrorReply reply;
-
- if (gc->error) {
- /* Use internal error first */
- retval = gc->error;
- gc->error = GL_NO_ERROR;
- return retval;
- }
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_GetError,0);
- __GLX_SINGLE_READ_XREPLY();
- retval = reply.error;
- __GLX_SINGLE_END();
-
- return retval;
-}
-
-
-/**
- * Get the selected attribute from the client state.
- *
- * \returns
- * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
- */
-static GLboolean
-get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data )
-{
- GLboolean retval = GL_TRUE;
- const GLint tex_unit = __glXGetActiveTextureUnit( state );
-
-
- switch( cap ) {
- case GL_VERTEX_ARRAY:
- case GL_NORMAL_ARRAY:
- case GL_COLOR_ARRAY:
- case GL_INDEX_ARRAY:
- case GL_EDGE_FLAG_ARRAY:
- case GL_SECONDARY_COLOR_ARRAY:
- case GL_FOG_COORD_ARRAY:
- retval = __glXGetArrayEnable( state, cap, 0, data );
- break;
-
- case GL_VERTEX_ARRAY_SIZE:
- retval = __glXGetArraySize( state, GL_VERTEX_ARRAY, 0, data );
- break;
- case GL_COLOR_ARRAY_SIZE:
- retval = __glXGetArraySize( state, GL_COLOR_ARRAY, 0, data );
- break;
- case GL_SECONDARY_COLOR_ARRAY_SIZE:
- retval = __glXGetArraySize( state, GL_SECONDARY_COLOR_ARRAY, 0, data );
- break;
-
- case GL_VERTEX_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_VERTEX_ARRAY, 0, data );
- break;
- case GL_NORMAL_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_NORMAL_ARRAY, 0, data );
- break;
- case GL_INDEX_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_INDEX_ARRAY, 0, data );
- break;
- case GL_COLOR_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_COLOR_ARRAY, 0, data );
- break;
- case GL_SECONDARY_COLOR_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_SECONDARY_COLOR_ARRAY, 0, data );
- break;
- case GL_FOG_COORD_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_FOG_COORD_ARRAY, 0, data );
- break;
-
- case GL_VERTEX_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_VERTEX_ARRAY, 0, data );
- break;
- case GL_NORMAL_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_NORMAL_ARRAY, 0, data );
- break;
- case GL_INDEX_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_INDEX_ARRAY, 0, data );
- break;
- case GL_EDGE_FLAG_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_EDGE_FLAG_ARRAY, 0, data );
- break;
- case GL_COLOR_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_COLOR_ARRAY, 0, data );
- break;
- case GL_SECONDARY_COLOR_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_SECONDARY_COLOR_ARRAY, 0, data );
- break;
- case GL_FOG_COORD_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_FOG_COORD_ARRAY, 0, data );
- break;
-
- case GL_TEXTURE_COORD_ARRAY:
- retval = __glXGetArrayEnable( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
- break;
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- retval = __glXGetArraySize( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
- break;
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- retval = __glXGetArrayType( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
- break;
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- retval = __glXGetArrayStride( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
- break;
-
- case GL_MAX_ELEMENTS_VERTICES:
- case GL_MAX_ELEMENTS_INDICES:
- retval = GL_TRUE;
- *data = ~0UL;
- break;
-
-
- case GL_PACK_ROW_LENGTH:
- *data = (GLintptr)state->storePack.rowLength;
- break;
- case GL_PACK_IMAGE_HEIGHT:
- *data = (GLintptr)state->storePack.imageHeight;
- break;
- case GL_PACK_SKIP_ROWS:
- *data = (GLintptr)state->storePack.skipRows;
- break;
- case GL_PACK_SKIP_PIXELS:
- *data = (GLintptr)state->storePack.skipPixels;
- break;
- case GL_PACK_SKIP_IMAGES:
- *data = (GLintptr)state->storePack.skipImages;
- break;
- case GL_PACK_ALIGNMENT:
- *data = (GLintptr)state->storePack.alignment;
- break;
- case GL_PACK_SWAP_BYTES:
- *data = (GLintptr)state->storePack.swapEndian;
- break;
- case GL_PACK_LSB_FIRST:
- *data = (GLintptr)state->storePack.lsbFirst;
- break;
- case GL_UNPACK_ROW_LENGTH:
- *data = (GLintptr)state->storeUnpack.rowLength;
- break;
- case GL_UNPACK_IMAGE_HEIGHT:
- *data = (GLintptr)state->storeUnpack.imageHeight;
- break;
- case GL_UNPACK_SKIP_ROWS:
- *data = (GLintptr)state->storeUnpack.skipRows;
- break;
- case GL_UNPACK_SKIP_PIXELS:
- *data = (GLintptr)state->storeUnpack.skipPixels;
- break;
- case GL_UNPACK_SKIP_IMAGES:
- *data = (GLintptr)state->storeUnpack.skipImages;
- break;
- case GL_UNPACK_ALIGNMENT:
- *data = (GLintptr)state->storeUnpack.alignment;
- break;
- case GL_UNPACK_SWAP_BYTES:
- *data = (GLintptr)state->storeUnpack.swapEndian;
- break;
- case GL_UNPACK_LSB_FIRST:
- *data = (GLintptr)state->storeUnpack.lsbFirst;
- break;
- case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
- *data = (GLintptr)__GL_CLIENT_ATTRIB_STACK_DEPTH;
- break;
- case GL_CLIENT_ACTIVE_TEXTURE:
- *data = (GLintptr)(tex_unit + GL_TEXTURE0);
- break;
-
- default:
- retval = GL_FALSE;
- break;
- }
-
-
- return retval;
-}
-
-
-void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
-{
- const GLenum origVal = val;
- __GLX_SINGLE_DECLARE_VARIABLES();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
- val = RemapTransposeEnum( val );
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_GetBooleanv,4);
- __GLX_SINGLE_PUT_LONG(0,val);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_GET_SIZE(compsize);
-
- if (compsize == 0) {
- /*
- ** Error occured; don't modify user's buffer.
- */
- } else {
- GLintptr data;
-
- /*
- ** We still needed to send the request to the server in order to
- ** find out whether it was legal to make a query (it's illegal,
- ** for example, to call a query between glBegin() and glEnd()).
- */
-
- if ( get_client_data( state, val, & data ) ) {
- *b = (GLboolean) data;
- }
- else {
- /*
- ** Not a local value, so use what we got from the server.
- */
- if (compsize == 1) {
- __GLX_SINGLE_GET_CHAR(b);
- } else {
- __GLX_SINGLE_GET_CHAR_ARRAY(b,compsize);
- if (val != origVal) {
- /* matrix transpose */
- TransposeMatrixb(b);
- }
- }
- }
- }
- __GLX_SINGLE_END();
-}
-
-void __indirect_glGetDoublev(GLenum val, GLdouble *d)
-{
- const GLenum origVal = val;
- __GLX_SINGLE_DECLARE_VARIABLES();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
- val = RemapTransposeEnum( val );
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_GetDoublev,4);
- __GLX_SINGLE_PUT_LONG(0,val);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_GET_SIZE(compsize);
-
- if (compsize == 0) {
- /*
- ** Error occured; don't modify user's buffer.
- */
- } else {
- GLintptr data;
-
- /*
- ** We still needed to send the request to the server in order to
- ** find out whether it was legal to make a query (it's illegal,
- ** for example, to call a query between glBegin() and glEnd()).
- */
-
- if ( get_client_data( state, val, & data ) ) {
- *d = (GLdouble) data;
- }
- else {
- /*
- ** Not a local value, so use what we got from the server.
- */
- if (compsize == 1) {
- __GLX_SINGLE_GET_DOUBLE(d);
- } else {
- __GLX_SINGLE_GET_DOUBLE_ARRAY(d,compsize);
- if (val != origVal) {
- /* matrix transpose */
- TransposeMatrixd(d);
- }
- }
- }
- }
- __GLX_SINGLE_END();
-}
-
-void __indirect_glGetFloatv(GLenum val, GLfloat *f)
-{
- const GLenum origVal = val;
- __GLX_SINGLE_DECLARE_VARIABLES();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
- val = RemapTransposeEnum( val );
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_GetFloatv,4);
- __GLX_SINGLE_PUT_LONG(0,val);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_GET_SIZE(compsize);
-
- if (compsize == 0) {
- /*
- ** Error occured; don't modify user's buffer.
- */
- } else {
- GLintptr data;
-
- /*
- ** We still needed to send the request to the server in order to
- ** find out whether it was legal to make a query (it's illegal,
- ** for example, to call a query between glBegin() and glEnd()).
- */
-
- if ( get_client_data( state, val, & data ) ) {
- *f = (GLfloat) data;
- }
- else {
- /*
- ** Not a local value, so use what we got from the server.
- */
- if (compsize == 1) {
- __GLX_SINGLE_GET_FLOAT(f);
- } else {
- __GLX_SINGLE_GET_FLOAT_ARRAY(f,compsize);
- if (val != origVal) {
- /* matrix transpose */
- TransposeMatrixf(f);
- }
- }
- }
- }
- __GLX_SINGLE_END();
-}
-
-void __indirect_glGetIntegerv(GLenum val, GLint *i)
-{
- const GLenum origVal = val;
- __GLX_SINGLE_DECLARE_VARIABLES();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
-
- val = RemapTransposeEnum( val );
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_GetIntegerv,4);
- __GLX_SINGLE_PUT_LONG(0,val);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_GET_SIZE(compsize);
-
- if (compsize == 0) {
- /*
- ** Error occured; don't modify user's buffer.
- */
- } else {
- GLintptr data;
-
- /*
- ** We still needed to send the request to the server in order to
- ** find out whether it was legal to make a query (it's illegal,
- ** for example, to call a query between glBegin() and glEnd()).
- */
-
- if ( get_client_data( state, val, & data ) ) {
- *i = (GLint) data;
- }
- else {
- /*
- ** Not a local value, so use what we got from the server.
- */
- if (compsize == 1) {
- __GLX_SINGLE_GET_LONG(i);
- } else {
- __GLX_SINGLE_GET_LONG_ARRAY(i,compsize);
- if (val != origVal) {
- /* matrix transpose */
- TransposeMatrixi(i);
- }
- }
- }
- }
- __GLX_SINGLE_END();
-}
-
-/*
-** Send all pending commands to server.
-*/
-void __indirect_glFlush(void)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
-
- if (!dpy) return;
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_Flush,0);
- __GLX_SINGLE_END();
-
- /* And finally flush the X protocol data */
- XFlush(dpy);
-}
-
-void __indirect_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
-
- if (!dpy) return;
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_FeedbackBuffer,8);
- __GLX_SINGLE_PUT_LONG(0,size);
- __GLX_SINGLE_PUT_LONG(4,type);
- __GLX_SINGLE_END();
-
- gc->feedbackBuf = buffer;
-}
-
-void __indirect_glSelectBuffer(GLsizei numnames, GLuint *buffer)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
-
- if (!dpy) return;
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_SelectBuffer,4);
- __GLX_SINGLE_PUT_LONG(0,numnames);
- __GLX_SINGLE_END();
-
- gc->selectBuf = buffer;
-}
-
-GLint __indirect_glRenderMode(GLenum mode)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
- GLint retval = 0;
- xGLXRenderModeReply reply;
-
- if (!dpy) return -1;
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_RenderMode,4);
- __GLX_SINGLE_PUT_LONG(0,mode);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_GET_RETVAL(retval,GLint);
-
- if (reply.newMode != mode) {
- /*
- ** Switch to new mode did not take effect, therefore an error
- ** occured. When an error happens the server won't send us any
- ** other data.
- */
- } else {
- /* Read the feedback or selection data */
- if (gc->renderMode == GL_FEEDBACK) {
- __GLX_SINGLE_GET_SIZE(compsize);
- __GLX_SINGLE_GET_FLOAT_ARRAY(gc->feedbackBuf, compsize);
- } else
- if (gc->renderMode == GL_SELECT) {
- __GLX_SINGLE_GET_SIZE(compsize);
- __GLX_SINGLE_GET_LONG_ARRAY(gc->selectBuf, compsize);
- }
- gc->renderMode = mode;
- }
- __GLX_SINGLE_END();
-
- return retval;
-}
-
-void __indirect_glFinish(void)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
- xGLXSingleReply reply;
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_Finish,0);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_END();
-}
-
-
-/**
- * Extract the major and minor version numbers from a version string.
- */
-static void
-version_from_string( const char * ver,
- int * major_version, int * minor_version )
-{
- const char * end;
- long major;
- long minor;
-
- major = strtol( ver, (char **) & end, 10 );
- minor = strtol( end + 1, NULL, 10 );
- *major_version = major;
- *minor_version = minor;
-}
-
-
-const GLubyte *__indirect_glGetString(GLenum name)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- Display *dpy = gc->currentDpy;
- GLubyte *s = NULL;
-
- if (!dpy) return 0;
-
- /*
- ** Return the cached copy if the string has already been fetched
- */
- switch(name) {
- case GL_VENDOR:
- if (gc->vendor) return gc->vendor;
- break;
- case GL_RENDERER:
- if (gc->renderer) return gc->renderer;
- break;
- case GL_VERSION:
- if (gc->version) return gc->version;
- break;
- case GL_EXTENSIONS:
- if (gc->extensions) return gc->extensions;
- break;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return 0;
- }
-
- /*
- ** Get requested string from server
- */
-
- (void) __glXFlushRenderBuffer( gc, gc->pc );
- s = (GLubyte *) __glXGetStringFromServer( dpy, gc->majorOpcode,
- X_GLsop_GetString, gc->currentContextTag,
- name );
- if (!s) {
- /* Throw data on the floor */
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- } else {
- /*
- ** Update local cache
- */
- switch(name) {
- case GL_VENDOR:
- gc->vendor = s;
- break;
-
- case GL_RENDERER:
- gc->renderer = s;
- break;
-
- case GL_VERSION: {
- int client_major;
- int client_minor;
-
- version_from_string( (char *) s,
- & gc->server_major, & gc->server_minor );
- __glXGetGLVersion( & client_major, & client_minor );
-
- if ( (gc->server_major < client_major)
- || ((gc->server_major == client_major)
- && (gc->server_minor <= client_minor)) ) {
- gc->version = s;
- }
- else {
- /* Allow 7 bytes for the client-side GL version. This allows
- * for upto version 999.999. I'm not holding my breath for
- * that one! The extra 4 is for the ' ()\0' that will be
- * added.
- */
- const size_t size = 7 + strlen( (char *) s ) + 4;
-
- gc->version = Xmalloc( size );
- if ( gc->version == NULL ) {
- /* If we couldn't allocate memory for the new string,
- * make a best-effort and just copy the client-side version
- * to the string and use that. It probably doesn't
- * matter what is done here. If there not memory available
- * for a short string, the system is probably going to die
- * soon anyway.
- */
- snprintf( (char *) s, strlen( (char *) s ) + 1, "%u.%u",
- client_major, client_minor );
- gc->version = s;
- }
- else {
- snprintf( (char *)gc->version, size, "%u.%u (%s)",
- client_major, client_minor, s );
- Xfree( s );
- s = gc->version;
- }
- }
- break;
- }
-
- case GL_EXTENSIONS: {
- int major = 1;
- int minor = 0;
-
- /* This code is currently disabled. I was reminded that some
- * vendors intentionally exclude some extensions from their
- * extension string that are part of the core version they
- * advertise. In particular, on Nvidia drivers this means that
- * the functionality is supported by the driver, but is not
- * hardware accelerated. For example, a TNT will show core
- * version 1.5, but most of the post-1.2 functionality is a
- * software fallback.
- *
- * I don't want to break applications that rely on this odd
- * behavior. At the same time, the code is written and tested,
- * so I didn't want to throw it away. Therefore, the code is here
- * but disabled. In the future, we may wish to and an environment
- * variable to enable it.
- */
-
-#if 0
- /* Call glGetString just to make sure that gc->server_major and
- * gc->server_minor are set. This version may be higher than we
- * can completely support, but it may imply support for some
- * extensions that we can support.
- *
- * For example, at the time of this writing, the client-side
- * library only supports upto core GL version 1.2. However, cubic
- * textures, multitexture, multisampling, and some other 1.3
- * features are supported. If the server reports back version
- * 1.3, but does not report all of those extensions, we will
- * enable them.
- */
- (void *) glGetString( GL_VERSION );
- major = gc->server_major,
- minor = gc->server_minor;
-#endif
-
- __glXCalculateUsableGLExtensions( gc, (char *) s, major, minor );
- XFree( s );
- s = gc->extensions;
- break;
- }
- }
- }
- return s;
-}
-
-GLboolean __indirect_glIsEnabled(GLenum cap)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- xGLXSingleReply reply;
- GLboolean retval = 0;
- GLintptr enable;
-
- if (!dpy) return 0;
-
- switch(cap) {
- case GL_VERTEX_ARRAY:
- case GL_NORMAL_ARRAY:
- case GL_COLOR_ARRAY:
- case GL_INDEX_ARRAY:
- case GL_EDGE_FLAG_ARRAY:
- case GL_SECONDARY_COLOR_ARRAY:
- case GL_FOG_COORD_ARRAY:
- retval = __glXGetArrayEnable( state, cap, 0, & enable );
- assert( retval );
- return (GLboolean) enable;
- break;
- case GL_TEXTURE_COORD_ARRAY:
- retval = __glXGetArrayEnable( state, GL_TEXTURE_COORD_ARRAY,
- __glXGetActiveTextureUnit( state ), & enable );
- assert( retval );
- return (GLboolean) enable;
- break;
- }
-
- __GLX_SINGLE_LOAD_VARIABLES();
- __GLX_SINGLE_BEGIN(X_GLsop_IsEnabled,4);
- __GLX_SINGLE_PUT_LONG(0,cap);
- __GLX_SINGLE_READ_XREPLY();
- __GLX_SINGLE_GET_RETVAL(retval, GLboolean);
- __GLX_SINGLE_END();
- return retval;
-}
-
-void __indirect_glGetPointerv(GLenum pname, void **params)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
- Display *dpy = gc->currentDpy;
-
- if (!dpy) return;
-
- switch(pname) {
- case GL_VERTEX_ARRAY_POINTER:
- case GL_NORMAL_ARRAY_POINTER:
- case GL_COLOR_ARRAY_POINTER:
- case GL_INDEX_ARRAY_POINTER:
- case GL_EDGE_FLAG_ARRAY_POINTER:
- __glXGetArrayPointer( state, pname - GL_VERTEX_ARRAY_POINTER
- + GL_VERTEX_ARRAY,
- 0, params );
- return;
- case GL_TEXTURE_COORD_ARRAY_POINTER:
- __glXGetArrayPointer( state, GL_TEXTURE_COORD_ARRAY,
- __glXGetActiveTextureUnit( state ), params );
- return;
- case GL_SECONDARY_COLOR_ARRAY_POINTER:
- case GL_FOG_COORD_ARRAY_POINTER:
- __glXGetArrayPointer( state, pname - GL_FOG_COORD_ARRAY_POINTER
- + GL_FOG_COORD_ARRAY,
- 0, params );
- return;
- case GL_FEEDBACK_BUFFER_POINTER:
- *params = (void *)gc->feedbackBuf;
- return;
- case GL_SELECTION_BUFFER_POINTER:
- *params = (void *)gc->selectBuf;
- return;
- default:
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/glx/x11/singlepix.c b/nx-X11/extras/Mesa/src/glx/x11/singlepix.c
deleted file mode 100644
index 4a10083b8..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/singlepix.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/singlepix.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "packsingle.h"
-#include "indirect.h"
-
-void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *row, GLvoid *column, GLvoid *span)
-{
- __GLX_SINGLE_DECLARE_VARIABLES();
- const __GLXattribute * state;
- xGLXGetSeparableFilterReply reply;
- GLubyte *rowBuf, *colBuf;
-
- if (!dpy) return;
- __GLX_SINGLE_LOAD_VARIABLES();
- state = gc->client_state_private;
-
- /* Send request */
- __GLX_SINGLE_BEGIN(X_GLsop_GetSeparableFilter, __GLX_PAD(13));
- __GLX_SINGLE_PUT_LONG(0,target);
- __GLX_SINGLE_PUT_LONG(4,format);
- __GLX_SINGLE_PUT_LONG(8,type);
- __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian);
- __GLX_SINGLE_READ_XREPLY();
- compsize = reply.length << 2;
-
- if (compsize != 0) {
- GLint width, height;
- GLint widthsize, heightsize;
-
- width = reply.width;
- height = reply.height;
-
- widthsize = __glImageSize(width,1,1,format, type, 0);
- heightsize = __glImageSize(height,1,1,format, type, 0);
-
- /* Allocate a holding buffer to transform the data from */
- rowBuf = (GLubyte*) Xmalloc(widthsize);
- if (!rowBuf) {
- /* Throw data away */
- _XEatData(dpy, compsize);
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- UnlockDisplay(dpy);
- SyncHandle();
- return;
- } else {
- __GLX_SINGLE_GET_CHAR_ARRAY(((char*)rowBuf),widthsize);
- __glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row);
- Xfree((char*) rowBuf);
- }
- colBuf = (GLubyte*) Xmalloc(heightsize);
- if (!colBuf) {
- /* Throw data away */
- _XEatData(dpy, compsize - __GLX_PAD(widthsize));
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- UnlockDisplay(dpy);
- SyncHandle();
- return;
- } else {
- __GLX_SINGLE_GET_CHAR_ARRAY(((char*)colBuf),heightsize);
- __glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column);
- Xfree((char*) colBuf);
- }
- } else {
- /*
- ** don't modify user's buffer.
- */
- }
- __GLX_SINGLE_END();
-
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/vertarr.c b/nx-X11/extras/Mesa/src/glx/x11/vertarr.c
deleted file mode 100644
index 483a166ea..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/vertarr.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/vertarr.c,v 1.4 2001/03/25 05:32:00 tsi Exp $ */
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-*/
-
-#include "glxclient.h"
-#include "indirect.h"
-#include "indirect_vertex_array.h"
-
-
-/*****************************************************************************/
-
-/**
- * \name Vertex array pointer bridge functions
- *
- * When EXT_vertex_array was moved into the core GL spec, the \c count
- * parameter was lost. This libGL really only wants to implement the GL 1.1
- * version, but we need to support applications that were written to the old
- * interface. These bridge functions are part of the glue that makes this
- * happen.
- */
-/*@{*/
-void __indirect_glColorPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid * pointer )
-{
- (void) count; __indirect_glColorPointer( size, type, stride, pointer );
-}
-
-void __indirect_glEdgeFlagPointerEXT(GLsizei stride,
- GLsizei count, const GLboolean * pointer )
-{
- (void) count; __indirect_glEdgeFlagPointer( stride, pointer );
-}
-
-void __indirect_glIndexPointerEXT(GLenum type, GLsizei stride,
- GLsizei count, const GLvoid * pointer )
-{
- (void) count; __indirect_glIndexPointer( type, stride, pointer );
-}
-
-void __indirect_glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid * pointer )
-{
- (void) count; __indirect_glNormalPointer( type, stride, pointer );
-}
-
-void __indirect_glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid * pointer )
-{
- (void) count; __indirect_glTexCoordPointer( size, type, stride, pointer );
-}
-
-void __indirect_glVertexPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid * pointer )
-{
- (void) count; __indirect_glVertexPointer( size, type, stride, pointer );
-}
-/*@}*/
-
-/*****************************************************************************/
-
-void __indirect_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
-{
- __GLXcontext *gc = __glXGetCurrentContext();
- __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
-
-#define NONE {0, 0, 0}
-#define F(x) {GL_FLOAT, x, x * sizeof(GLfloat)}
-#define UB4 {GL_UNSIGNED_BYTE, 4, 4 * sizeof(GLubyte)}
-
- /* Each row in this array describes the elements of a particular
- * interleaved array mode. Each column describes, in the order in which
- * they appear in the interleaved arrays, one of the four possible types
- * of vertex data that can appear in an interleaved array.
- */
- struct {
- /**
- * The enum describing the GL type, as would be passed to the
- * appropriate gl*Pointer function.
- */
- GLushort type;
-
- /**
- * Number of elements in the subarray, as would be passed (as the
- * \c size parameter) to the appropriate gl*Pointer function.
- */
- GLubyte count;
-
- /**
- * True size of a single element in the subarray, as would be passed
- * (as the \c stride parameter) to the appropriate gl*Pointer
- * function.
- */
- GLubyte size;
- }
- static const modes[14][4] = {
- /* texture color normal vertex */
- {NONE, NONE, NONE, F(2)}, /* GL_V2F */
- {NONE, NONE, NONE, F(3)}, /* GL_V3F */
- {NONE, UB4, NONE, F(2)}, /* GL_C4UB_V2F */
- {NONE, UB4, NONE, F(3)}, /* GL_C4UB_V3F */
- {NONE, F(3), NONE, F(3)}, /* GL_C3F_V3F */
- {NONE, NONE, F(3), F(3)}, /* GL_N3F_V3F */
- {NONE, F(4), F(3), F(3)}, /* GL_C4F_N3F_V3F */
- {F(2), NONE, NONE, F(3)}, /* GL_T2F_V3F */
- {F(4), NONE, NONE, F(4)}, /* GL_T4F_V4F */
- {F(2), UB4, NONE, F(3)}, /* GL_T2F_C4UB_V3F */
- {F(2), F(3), NONE, F(3)}, /* GL_T2F_C3F_V3F */
- {F(2), NONE, F(3), F(3)}, /* GL_T2F_N3F_V3F */
- {F(2), F(4), F(3), F(3)}, /* GL_T2F_C4F_N3F_V3F */
- {F(4), F(4), F(3), F(4)}, /* GL_T4F_C4F_N3F_V4F */
- };
-#undef NONE
-#undef F
-#undef UB4
-
- GLint trueStride, size;
- int offsets[4];
- unsigned i;
- const int idx = format - GL_V2F;
-
-
- /* All valid formats are on the range [GL_V2F, GL_V2F+0x0D]. Since idx
- * is just the format biased by -GL_V2F, all valid idx values are on the
- * range [0, 0x0D].
- */
- if ( (idx < 0) || (idx > 0x0D) ) {
- __glXSetError(gc, GL_INVALID_ENUM);
- return;
- }
-
- if ( stride < 0 ) {
- __glXSetError(gc, GL_INVALID_VALUE);
- return;
- }
-
-
- /* If the 'count' for a subarray is non-zero, then the offset of its
- * first element is at the currently accumulated 'size'.
- */
- size = 0;
- for ( i = 0 ; i < 4 ; i++ ) {
- offsets[i] = (modes[idx][i].count != 0) ? size : -1;
- size += modes[idx][i].size;
- }
-
- trueStride = (stride == 0) ? size : stride;
-
- __glXArrayDisableAll( state );
-
- if ( offsets[0] >= 0 ) {
- __indirect_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- __indirect_glTexCoordPointer( modes[idx][0].count, GL_FLOAT,
- trueStride,
- (const char *) pointer );
- }
- if ( offsets[1] >= 0 ) {
- __indirect_glEnableClientState(GL_COLOR_ARRAY);
- __indirect_glColorPointer( modes[idx][1].count, modes[idx][1].type,
- trueStride,
- (const char *) pointer + offsets[1] );
- }
- if ( offsets[2] >= 0 ) {
- __indirect_glEnableClientState(GL_NORMAL_ARRAY);
- __indirect_glNormalPointer( GL_FLOAT, trueStride,
- (const char *)pointer + offsets[2] );
- }
- __indirect_glEnableClientState(GL_VERTEX_ARRAY);
- __indirect_glVertexPointer( modes[idx][3].count, GL_FLOAT,
- trueStride,
- (const char *)pointer + offsets[3] );
-}
diff --git a/nx-X11/extras/Mesa/src/glx/x11/xf86dri.h b/nx-X11/extras/Mesa/src/glx/x11/xf86dri.h
deleted file mode 100644
index 0a2bb2497..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/xf86dri.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/**
- * \file xf86dri.h
- * Protocol numbers and function prototypes for DRI X protocol.
- *
- * \author Kevin E. Martin <martin@valinux.com>
- * \author Jens Owen <jens@tungstengraphics.com>
- * \author Rickard E. (Rik) Faith <faith@valinux.com>
- */
-
-#ifndef _XF86DRI_H_
-#define _XF86DRI_H_
-
-#include <X11/Xfuncproto.h>
-#include <xf86drm.h>
-
-#define X_XF86DRIQueryVersion 0
-#define X_XF86DRIQueryDirectRenderingCapable 1
-#define X_XF86DRIOpenConnection 2
-#define X_XF86DRICloseConnection 3
-#define X_XF86DRIGetClientDriverName 4
-#define X_XF86DRICreateContext 5
-#define X_XF86DRIDestroyContext 6
-#define X_XF86DRICreateDrawable 7
-#define X_XF86DRIDestroyDrawable 8
-#define X_XF86DRIGetDrawableInfo 9
-#define X_XF86DRIGetDeviceInfo 10
-#define X_XF86DRIAuthConnection 11
-#define X_XF86DRIOpenFullScreen 12 /* Deprecated */
-#define X_XF86DRICloseFullScreen 13 /* Deprecated */
-
-#define XF86DRINumberEvents 0
-
-#define XF86DRIClientNotLocal 0
-#define XF86DRIOperationNotSupported 1
-#define XF86DRINumberErrors (XF86DRIOperationNotSupported + 1)
-
-#ifndef _XF86DRI_SERVER_
-
-#include <GL/internal/dri_interface.h>
-
-_XFUNCPROTOBEGIN
-
-Bool XF86DRIQueryExtension( Display *dpy, int *event_base, int *error_base );
-
-Bool XF86DRIQueryVersion( Display *dpy, int *majorVersion, int *minorVersion,
- int *patchVersion );
-
-Bool XF86DRIQueryDirectRenderingCapable( Display *dpy, int screen,
- Bool *isCapable );
-
-Bool XF86DRIOpenConnection( Display *dpy, int screen, drm_handle_t *hSAREA,
- char **busIDString );
-
-Bool XF86DRIAuthConnection( Display *dpy, int screen, drm_magic_t magic );
-
-Bool XF86DRICloseConnection( Display *dpy, int screen );
-
-Bool XF86DRIGetClientDriverName( Display *dpy, int screen,
- int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
- int *ddxDriverPatchVersion, char **clientDriverName );
-
-Bool XF86DRICreateContext( Display *dpy, int screen, Visual *visual,
- XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-
-Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID,
- XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-
-extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
- __DRIid context_id );
-
-extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
- __DRIid drawable, drm_drawable_t *hHWDrawable );
-
-extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
- __DRIid drawable);
-
-Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable,
- unsigned int *index, unsigned int *stamp,
- int *X, int *Y, int *W, int *H,
- int *numClipRects, drm_clip_rect_t ** pClipRects,
- int *backX, int *backY,
- int *numBackClipRects, drm_clip_rect_t **pBackClipRects );
-
-Bool XF86DRIGetDeviceInfo( Display *dpy, int screen,
- drm_handle_t *hFrameBuffer, int *fbOrigin, int *fbSize,
- int *fbStride, int *devPrivateSize, void **pDevPrivate );
-
-_XFUNCPROTOEND
-
-#endif /* _XF86DRI_SERVER_ */
-
-#endif /* _XF86DRI_H_ */
-
diff --git a/nx-X11/extras/Mesa/src/glx/x11/xf86dristr.h b/nx-X11/extras/Mesa/src/glx/x11/xf86dristr.h
deleted file mode 100644
index ac05b183b..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/xf86dristr.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/* $XFree86: xc/lib/GL/dri/xf86dristr.h,v 1.10 2002/10/30 12:51:25 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL 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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Jens Owen <jens@tungstengraphics.com>
- * Rickard E. (Rik) Fiath <faith@valinux.com>
- *
- */
-
-#ifndef _XF86DRISTR_H_
-#define _XF86DRISTR_H_
-
-#include "xf86dri.h"
-
-#define XF86DRINAME "XFree86-DRI"
-
-/* The DRI version number. This was originally set to be the same of the
- * XFree86 version number. However, this version is really indepedent of
- * the XFree86 version.
- *
- * Version History:
- * 4.0.0: Original
- * 4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02
- * 4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02
- */
-#define XF86DRI_MAJOR_VERSION 4
-#define XF86DRI_MINOR_VERSION 1
-#define XF86DRI_PATCH_VERSION 0
-
-typedef struct _XF86DRIQueryVersion {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIQueryVersion */
- CARD16 length B16;
-} xXF86DRIQueryVersionReq;
-#define sz_xXF86DRIQueryVersionReq 4
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 majorVersion B16; /* major version of DRI protocol */
- CARD16 minorVersion B16; /* minor version of DRI protocol */
- CARD32 patchVersion B32; /* patch version of DRI protocol */
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xXF86DRIQueryVersionReply;
-#define sz_xXF86DRIQueryVersionReply 32
-
-typedef struct _XF86DRIQueryDirectRenderingCapable {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */
- CARD16 length B16;
- CARD32 screen B32;
-} xXF86DRIQueryDirectRenderingCapableReq;
-#define sz_xXF86DRIQueryDirectRenderingCapableReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- BOOL isCapable;
- BOOL pad2;
- BOOL pad3;
- BOOL pad4;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- CARD32 pad8 B32;
- CARD32 pad9 B32;
-} xXF86DRIQueryDirectRenderingCapableReply;
-#define sz_xXF86DRIQueryDirectRenderingCapableReply 32
-
-typedef struct _XF86DRIOpenConnection {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIOpenConnection */
- CARD16 length B16;
- CARD32 screen B32;
-} xXF86DRIOpenConnectionReq;
-#define sz_xXF86DRIOpenConnectionReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 hSAREALow B32;
- CARD32 hSAREAHigh B32;
- CARD32 busIdStringLength B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- CARD32 pad8 B32;
-} xXF86DRIOpenConnectionReply;
-#define sz_xXF86DRIOpenConnectionReply 32
-
-typedef struct _XF86DRIAuthConnection {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICloseConnection */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 magic B32;
-} xXF86DRIAuthConnectionReq;
-#define sz_xXF86DRIAuthConnectionReq 12
-
-typedef struct {
- BYTE type;
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 authenticated B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xXF86DRIAuthConnectionReply;
-#define zx_xXF86DRIAuthConnectionReply 32
-
-typedef struct _XF86DRICloseConnection {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICloseConnection */
- CARD16 length B16;
- CARD32 screen B32;
-} xXF86DRICloseConnectionReq;
-#define sz_xXF86DRICloseConnectionReq 8
-
-typedef struct _XF86DRIGetClientDriverName {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIGetClientDriverName */
- CARD16 length B16;
- CARD32 screen B32;
-} xXF86DRIGetClientDriverNameReq;
-#define sz_xXF86DRIGetClientDriverNameReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 ddxDriverMajorVersion B32;
- CARD32 ddxDriverMinorVersion B32;
- CARD32 ddxDriverPatchVersion B32;
- CARD32 clientDriverNameLength B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xXF86DRIGetClientDriverNameReply;
-#define sz_xXF86DRIGetClientDriverNameReply 32
-
-typedef struct _XF86DRICreateContext {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICreateContext */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 visual B32;
- CARD32 context B32;
-} xXF86DRICreateContextReq;
-#define sz_xXF86DRICreateContextReq 16
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 hHWContext B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xXF86DRICreateContextReply;
-#define sz_xXF86DRICreateContextReply 32
-
-typedef struct _XF86DRIDestroyContext {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIDestroyContext */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 context B32;
-} xXF86DRIDestroyContextReq;
-#define sz_xXF86DRIDestroyContextReq 12
-
-typedef struct _XF86DRICreateDrawable {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICreateDrawable */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xXF86DRICreateDrawableReq;
-#define sz_xXF86DRICreateDrawableReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 hHWDrawable B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xXF86DRICreateDrawableReply;
-#define sz_xXF86DRICreateDrawableReply 32
-
-typedef struct _XF86DRIDestroyDrawable {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIDestroyDrawable */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xXF86DRIDestroyDrawableReq;
-#define sz_xXF86DRIDestroyDrawableReq 12
-
-typedef struct _XF86DRIGetDrawableInfo {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIGetDrawableInfo */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xXF86DRIGetDrawableInfoReq;
-#define sz_xXF86DRIGetDrawableInfoReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 drawableTableIndex B32;
- CARD32 drawableTableStamp B32;
- INT16 drawableX B16;
- INT16 drawableY B16;
- INT16 drawableWidth B16;
- INT16 drawableHeight B16;
- CARD32 numClipRects B32;
- INT16 backX B16;
- INT16 backY B16;
- CARD32 numBackClipRects B32;
-} xXF86DRIGetDrawableInfoReply;
-
-#define sz_xXF86DRIGetDrawableInfoReply 36
-
-
-typedef struct _XF86DRIGetDeviceInfo {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIGetDeviceInfo */
- CARD16 length B16;
- CARD32 screen B32;
-} xXF86DRIGetDeviceInfoReq;
-#define sz_xXF86DRIGetDeviceInfoReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 hFrameBufferLow B32;
- CARD32 hFrameBufferHigh B32;
- CARD32 framebufferOrigin B32;
- CARD32 framebufferSize B32;
- CARD32 framebufferStride B32;
- CARD32 devPrivateSize B32;
-} xXF86DRIGetDeviceInfoReply;
-#define sz_xXF86DRIGetDeviceInfoReply 32
-
-typedef struct _XF86DRIOpenFullScreen {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIOpenFullScreen */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xXF86DRIOpenFullScreenReq;
-#define sz_xXF86DRIOpenFullScreenReq 12
-
-typedef struct {
- BYTE type;
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 isFullScreen B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xXF86DRIOpenFullScreenReply;
-#define sz_xXF86DRIOpenFullScreenReply 32
-
-typedef struct _XF86DRICloseFullScreen {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICloseFullScreen */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xXF86DRICloseFullScreenReq;
-#define sz_xXF86DRICloseFullScreenReq 12
-
-typedef struct {
- BYTE type;
- BOOL pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
-} xXF86DRICloseFullScreenReply;
-#define sz_xXF86DRICloseFullScreenReply 32
-
-
-#endif /* _XF86DRISTR_H_ */
diff --git a/nx-X11/extras/Mesa/src/glx/x11/xfont.c b/nx-X11/extras/Mesa/src/glx/x11/xfont.c
deleted file mode 100644
index 5f23a7962..000000000
--- a/nx-X11/extras/Mesa/src/glx/x11/xfont.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/* $XFree86: xc/lib/GL/glx/xfont.c,v 1.6 2001/05/02 15:06:02 dawes Exp $ */
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/* xfonts.c -- glXUseXFont() for Mesa written by
- * Copyright (C) 1995 Thorsten.Ohl @ Physik.TH-Darmstadt.de
- */
-
-/*
- This was take from Mesa and modified to work in the real GLX structure.
- It provides a fully client side implementation of glXUseXFont and is
- called by that routine when direct rendering is enabled.
-*/
-
-
-#include "glxclient.h"
-
-/* Some debugging info. */
-
-#ifdef DEBUG
-#undef _R
-#undef _G
-#undef _B
-#include <ctype.h>
-
-int debug_xfonts = 0;
-
-static void
-dump_char_struct (XCharStruct *ch, char *prefix)
-{
- printf ("%slbearing = %d, rbearing = %d, width = %d\n",
- prefix, ch->lbearing, ch->rbearing, ch->width);
- printf ("%sascent = %d, descent = %d, attributes = %u\n",
- prefix, ch->ascent, ch->descent, (unsigned int) ch->attributes);
-}
-
-static void
-dump_font_struct (XFontStruct *font)
-{
- printf ("ascent = %d, descent = %d\n", font->ascent, font->descent);
- printf ("char_or_byte2 = (%u,%u)\n",
- font->min_char_or_byte2, font->max_char_or_byte2);
- printf ("byte1 = (%u,%u)\n", font->min_byte1, font->max_byte1);
- printf ("all_chars_exist = %s\n", font->all_chars_exist ? "True" :
-"False");
- printf ("default_char = %c (\\%03o)\n",
- (char) (isprint (font->default_char) ? font->default_char : ' '),
- font->default_char);
- dump_char_struct (&font->min_bounds, "min> ");
- dump_char_struct (&font->max_bounds, "max> ");
-#if 0
- for (c = font->min_char_or_byte2; c <= font->max_char_or_byte2; c++)
- {
- char prefix[8];
- sprintf (prefix, "%d> ", c);
- dump_char_struct (&font->per_char[c], prefix);
- }
-#endif
-}
-
-static void
-dump_bitmap (unsigned int width, unsigned int height, GLubyte *bitmap)
-{
- unsigned int x, y;
-
- printf (" ");
- for (x = 0; x < 8*width; x++)
- printf ("%o", 7 - (x % 8));
- putchar ('\n');
- for (y = 0; y < height; y++)
- {
- printf ("%3o:", y);
- for (x = 0; x < 8*width; x++)
- putchar ((bitmap[width*(height - y - 1) + x/8] & (1 << (7 - (x %
-8))))
- ? '*' : '.');
- printf (" ");
- for (x = 0; x < width; x++)
- printf ("0x%02x, ", bitmap[width*(height - y - 1) + x]);
- putchar ('\n');
- }
-}
-#endif /* DEBUG */
-
-
-/* Implementation. */
-
-/* Fill a BITMAP with a character C from thew current font
- in the graphics context GC. WIDTH is the width in bytes
- and HEIGHT is the height in bits.
-
- Note that the generated bitmaps must be used with
-
- glPixelStorei (GL_UNPACK_SWAP_BYTES, GL_FALSE);
- glPixelStorei (GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
-
- Possible optimizations:
-
- * use only one reusable pixmap with the maximum dimensions.
- * draw the entire font into a single pixmap (careful with
- proportional fonts!).
-*/
-
-
-/*
- * Generate OpenGL-compatible bitmap.
- */
-static void
-fill_bitmap (Display *dpy, Window win, GC gc,
- unsigned int width, unsigned int height,
- int x0, int y0, unsigned int c, GLubyte *bitmap)
-{
- XImage *image;
- unsigned int x, y;
- Pixmap pixmap;
- XChar2b char2b;
-
- pixmap = XCreatePixmap (dpy, win, 8*width, height, 1);
- XSetForeground(dpy, gc, 0);
- XFillRectangle (dpy, pixmap, gc, 0, 0, 8*width, height);
- XSetForeground(dpy, gc, 1);
-
- char2b.byte1 = (c >> 8) & 0xff;
- char2b.byte2 = (c & 0xff);
-
- XDrawString16 (dpy, pixmap, gc, x0, y0, &char2b, 1);
-
- image = XGetImage (dpy, pixmap, 0, 0, 8*width, height, 1, XYPixmap);
- if (image) {
- /* Fill the bitmap (X11 and OpenGL are upside down wrt each other). */
- for (y = 0; y < height; y++)
- for (x = 0; x < 8*width; x++)
- if (XGetPixel (image, x, y))
- bitmap[width*(height - y - 1) + x/8] |= (1 << (7 - (x % 8)));
- XDestroyImage (image);
- }
-
- XFreePixmap (dpy, pixmap);
-}
-
-/*
- * determine if a given glyph is valid and return the
- * corresponding XCharStruct.
- */
-static XCharStruct *isvalid(XFontStruct *fs, int which)
-{
- unsigned int rows,pages;
- int byte1 = 0, byte2 = 0;
- int i,valid = 1;
-
- rows = fs->max_byte1 - fs->min_byte1 + 1;
- pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1;
-
- if (rows == 1) {
- /* "linear" fonts */
- if ((fs->min_char_or_byte2 > which) ||
- (fs->max_char_or_byte2 < which)) valid = 0;
- } else {
- /* "matrix" fonts */
- byte2 = which & 0xff;
- byte1 = which >> 8;
- if ((fs->min_char_or_byte2 > byte2) ||
- (fs->max_char_or_byte2 < byte2) ||
- (fs->min_byte1 > byte1) ||
- (fs->max_byte1 < byte1)) valid = 0;
- }
-
- if (valid) {
- if (fs->per_char) {
- if (rows == 1) {
- /* "linear" fonts */
- return(fs->per_char + (which-fs->min_char_or_byte2) );
- } else {
- /* "matrix" fonts */
- i = ((byte1 - fs->min_byte1) * pages) +
- (byte2 - fs->min_char_or_byte2);
- return(fs->per_char + i);
- }
- } else {
- return(&fs->min_bounds);
- }
- }
- return(NULL);
-}
-
-
-void DRI_glXUseXFont( Font font, int first, int count, int listbase )
-{
- GLXContext CC;
- Display *dpy;
- Window win;
- Pixmap pixmap;
- GC gc;
- XGCValues values;
- unsigned long valuemask;
- XFontStruct *fs;
-
- GLint swapbytes, lsbfirst, rowlength;
- GLint skiprows, skippixels, alignment;
-
- unsigned int max_width, max_height, max_bm_width, max_bm_height;
- GLubyte *bm;
-
- int i;
-
- CC = __glXGetCurrentContext();
- dpy = CC->currentDpy;
- win = CC->currentDrawable;
-
- fs = XQueryFont (dpy, font);
- if (!fs)
- {
- __glXSetError(CC, GL_INVALID_VALUE);
- return;
- }
-
- /* Allocate a bitmap that can fit all characters. */
- max_width = fs->max_bounds.rbearing - fs->min_bounds.lbearing;
- max_height = fs->max_bounds.ascent + fs->max_bounds.descent;
- max_bm_width = (max_width + 7) / 8;
- max_bm_height = max_height;
-
- bm = (GLubyte *) Xmalloc((max_bm_width * max_bm_height) * sizeof
-(GLubyte));
- if (!bm) {
- XFreeFontInfo( NULL, fs, 1 );
- __glXSetError(CC, GL_OUT_OF_MEMORY);
- return;
- }
-
-#if 0
- /* get the page info */
- pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1;
- firstchar = (fs->min_byte1 << 8) + fs->min_char_or_byte2;
- lastchar = (fs->max_byte1 << 8) + fs->max_char_or_byte2;
- rows = fs->max_byte1 - fs->min_byte1 + 1;
- unsigned int first_char, last_char, pages, rows;
-#endif
-
- /* Save the current packing mode for bitmaps. */
- glGetIntegerv (GL_UNPACK_SWAP_BYTES, &swapbytes);
- glGetIntegerv (GL_UNPACK_LSB_FIRST, &lsbfirst);
- glGetIntegerv (GL_UNPACK_ROW_LENGTH, &rowlength);
- glGetIntegerv (GL_UNPACK_SKIP_ROWS, &skiprows);
- glGetIntegerv (GL_UNPACK_SKIP_PIXELS, &skippixels);
- glGetIntegerv (GL_UNPACK_ALIGNMENT, &alignment);
-
- /* Enforce a standard packing mode which is compatible with
- fill_bitmap() from above. This is actually the default mode,
- except for the (non)alignment. */
- glPixelStorei (GL_UNPACK_SWAP_BYTES, GL_FALSE);
- glPixelStorei (GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
-
- pixmap = XCreatePixmap (dpy, win, 10, 10, 1);
- values.foreground = BlackPixel (dpy, DefaultScreen (dpy));
- values.background = WhitePixel (dpy, DefaultScreen (dpy));
- values.font = fs->fid;
- valuemask = GCForeground | GCBackground | GCFont;
- gc = XCreateGC (dpy, pixmap, valuemask, &values);
- XFreePixmap (dpy, pixmap);
-
-#ifdef DEBUG
- if (debug_xfonts)
- dump_font_struct (fs);
-#endif
-
- for (i = 0; i < count; i++)
- {
- unsigned int width, height, bm_width, bm_height;
- GLfloat x0, y0, dx, dy;
- XCharStruct *ch;
- int x, y;
- unsigned int c = first + i;
- int list = listbase + i;
- int valid;
-
- /* check on index validity and get the bounds */
- ch = isvalid(fs, c);
- if (!ch) {
- ch = &fs->max_bounds;
- valid = 0;
- } else {
- valid = 1;
- }
-
-#ifdef DEBUG
- if (debug_xfonts) {
- char s[7];
- sprintf (s, isprint (c) ? "%c> " : "\\%03o> ", c);
- dump_char_struct (ch, s);
- }
-#endif
-
- /* glBitmap()' parameters:
- straight from the glXUseXFont(3) manpage. */
- width = ch->rbearing - ch->lbearing;
- height = ch->ascent + ch->descent;
- x0 = - ch->lbearing;
- y0 = ch->descent - 1;
- dx = ch->width;
- dy = 0;
-
- /* X11's starting point. */
- x = - ch->lbearing;
- y = ch->ascent;
-
- /* Round the width to a multiple of eight. We will use this also
- for the pixmap for capturing the X11 font. This is slightly
- inefficient, but it makes the OpenGL part real easy. */
- bm_width = (width + 7) / 8;
- bm_height = height;
-
- glNewList (list, GL_COMPILE);
- if (valid && (bm_width > 0) && (bm_height > 0)) {
-
- memset (bm, '\0', bm_width * bm_height);
- fill_bitmap (dpy, win, gc, bm_width, bm_height, x, y, c, bm);
-
- glBitmap (width, height, x0, y0, dx, dy, bm);
-#ifdef DEBUG
- if (debug_xfonts) {
- printf ("width/height = %u/%u\n", width, height);
- printf ("bm_width/bm_height = %u/%u\n", bm_width,
-bm_height);
- dump_bitmap (bm_width, bm_height, bm);
- }
-#endif
- } else {
- glBitmap (0, 0, 0.0, 0.0, dx, dy, NULL);
- }
- glEndList ();
- }
-
- Xfree(bm);
- XFreeFontInfo( NULL, fs, 1 );
- XFreeGC (dpy, gc);
-
- /* Restore saved packing modes. */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
-}
-
-/* The End. */
diff --git a/nx-X11/extras/Mesa/src/mesa/Makefile b/nx-X11/extras/Mesa/src/mesa/Makefile
deleted file mode 100644
index b6c0b85f4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/Makefile
+++ /dev/null
@@ -1,230 +0,0 @@
-# src/mesa/Makefile
-
-TOP = ../..
-include $(TOP)/configs/current
-
-include sources
-
-
-GL_MAJOR = 1
-GL_MINOR = 5
-GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
-
-
-.SUFFIXES : .cpp
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-.cpp.o:
- $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-
-# Figure out what to make here
-default:
- @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
- $(MAKE) linux-solo ; \
- elif [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
- $(MAKE) osmesa-only ; \
- elif [ "$(DRIVER_DIRS)" = "beos" ]; then \
- $(MAKE) beos ; \
- elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
- $(MAKE) directfb; \
- else \
- $(MAKE) stand-alone ; \
- fi
-
-# BeOS driver target
-beos: depend subdirs mesa.a
- cd drivers/beos; $(MAKE)
-
-
-install: default
- @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
- cd drivers/dri ; $(MAKE) install ; \
- fi
-
-######################################################################
-# Linux solo DRI drivers
-
-SOLO_C_SOURCES = \
- $(MAIN_SOURCES) \
- $(MATH_SOURCES) \
- $(ARRAY_CACHE_SOURCES) \
- $(TNL_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
- $(SHADER_SOURCES) \
- $(SLANG_SOURCES) \
- $(ASM_C_SOURCES)
-
-SOLO_OBJECTS = $(SOLO_C_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o)
-
-linux-solo: depend subdirs mesa.a drivers-dri
-
-# Make archive of core object files
-mesa.a: $(SOLO_OBJECTS)
- rm -f $@
- ar rcv $@ $(SOLO_OBJECTS)
- ranlib $@
- @if [ "${CONFIG_NAME}" = "beos" ] ; then \
- mimeset -f "$@" ; \
- fi
-
-# note: cannot use the name of the directory ("drivers") as the
-# target, otherwise make will look & see that the "drivers" directory
-# already exists, so not try to rebuild it...
-drivers-dri:
- cd drivers/dri ; $(MAKE)
-
-
-
-#####################################################################
-# Stand-alone Mesa libGL, no built-in drivers (DirectFB)
-
-LIBGL_CORE_SOURCES = \
- $(CORE_SOURCES) \
- $(ASM_SOURCES)
-
-LIBGL_CORE_OBJECTS = \
- $(CORE_OBJECTS) \
- $(ASM_SOURCES:.S=.o)
-
-# Make libGL from core object files
-libgl-core: $(LIBGL_CORE_OBJECTS)
- @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
- -install $(LIB_DIR) $(MKLIB_OPTIONS) $(LIBGL_CORE_OBJECTS) $(GL_LIB_DEPS)
-
-# DirectFB driver target
-directfb: depend subdirs libgl-core
- cd drivers/directfb; $(MAKE)
-
-
-
-######################################################################
-# Stand-alone Mesa libGL and libOSMesa
-
-STAND_ALONE_DRIVER_SOURCES = \
- $(COMMON_DRIVER_SOURCES) \
- $(X11_DRIVER_SOURCES) \
- $(GLIDE_DRIVER_SOURCES) \
- $(SVGA_DRIVER_SOURCES) \
- $(FBDEV_DRIVER_SOURCES)
-
-STAND_ALONE_SOURCES = \
- $(CORE_SOURCES) \
- $(ASM_SOURCES) \
- $(STAND_ALONE_DRIVER_SOURCES)
-
-# ASM_SOURCES is defined in the config file
-ASM_OBJECTS = $(ASM_SOURCES:.S=.o)
-
-STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
-
-STAND_ALONE_OBJECTS = \
- $(CORE_OBJECTS) \
- $(ASM_OBJECTS) \
- $(STAND_ALONE_DRIVER_OBJECTS)
-
-# For libOSMesa16 or libOSMesa32 we link _all_ the objects into the library,
-# not just the osmesa.o object (i.e. we don't have a libGL).
-OSMESA16_OBJECTS = \
- $(CORE_OBJECTS) \
- $(ASM_OBJECTS) \
- $(COMMON_DRIVER_OBJECTS) \
- $(OSMESA_DRIVER_OBJECTS)
-
-
-stand-alone: depend subdirs $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(OSMESA_LIB_NAME)
-
-osmesa-only: depend subdirs $(LIB_DIR)/$(OSMESA_LIB_NAME)
-
-subdirs:
- @ (cd x86 ; $(MAKE))
- @ (cd x86-64 ; $(MAKE))
-
-# Make the GL library
-$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
- @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
- -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
- -install $(LIB_DIR) \
- $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS)
-
-# Make the OSMesa library
-$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
- @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
- $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
- -major $(MESA_MAJOR) \
- -minor $(MESA_MINOR) -patch $(MESA_TINY) \
- -install $(LIB_DIR) $(MKLIB_OPTIONS) \
- $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
- else \
- $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
- -major $(MESA_MAJOR) \
- -minor $(MESA_MINOR) -patch $(GL_TINY) \
- -install $(LIB_DIR) $(MKLIB_OPTIONS) \
- $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \
- fi
-
-
-######################################################################
-# 16 (or 32) bit/channel OSMesa
-
-# $(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA16_OBJECTS)
-# $(TOP)/bin/mklib -o $(OSMESA_LIB) \
-# -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
-# -install $(LIB_DIR) \
-# $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OSMESA16_OBJECTS)
-
-
-
-######################################################################
-# Generic stuff
-
-ALL_SOURCES = \
- $(GLAPI_SOURCES) \
- $(MAIN_SOURCES) \
- $(MATH_SOURCES) \
- $(ARRAY_CACHE_SOURCES) \
- $(TNL_SOURCES) \
- $(SHADER_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
- $(ASM_C_SOURCES) \
- $(X86_SOURCES) \
- $(COMMON_DRIVER_SOURCES)\
- $(X11_DRIVER_SOURCES) \
- $(OSMESA_DRIVER_SOURCES)
-
-
-SUBDIRS = array_cache drivers/dri glapi main math sparc swrast swrast_setup \
- tnl tnl_dd
-
-
-# Update dependencies
-depend: $(ALL_SOURCES)
- @ echo "running $(MKDEP)"
- @ touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
- > /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
-
-clean:
- -rm -f */*.o
- -rm -f */*/*.o
- -rm -f depend depend.bak mesa.a
- -rm -f drivers/*/*.o
- (cd drivers/dri ; $(MAKE) clean)
- (cd x86 ; $(MAKE) clean)
- (cd x86-64 ; $(MAKE) clean)
-
-include depend
diff --git a/nx-X11/extras/Mesa/src/mesa/Makefile.DJ b/nx-X11/extras/Mesa/src/mesa/Makefile.DJ
deleted file mode 100644
index 53c437070..000000000
--- a/nx-X11/extras/Mesa/src/mesa/Makefile.DJ
+++ /dev/null
@@ -1,168 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 5.1
-#
-# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# DOS/DJGPP core makefile v1.7 for Mesa
-#
-# Copyright (C) 2002 - Daniel Borca
-# Email : dborca@users.sourceforge.net
-# Web : http://www.geocities.com/dborca
-
-
-#
-# Available options:
-#
-# Environment variables:
-# CFLAGS
-#
-# GLIDE path to Glide3 SDK; used with FX.
-# default = $(TOP)/glide3
-# FX=1 build for 3dfx Glide3. Note that this disables
-# compilation of most DMesa code and requires fxMesa.
-# As a consequence, you'll need the DJGPP Glide3
-# library to build any application.
-# default = no
-# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
-# default = no
-#
-# Targets:
-# all: build GL
-# clean: remove object files
-#
-
-
-
-.PHONY: all clean
-.INTERMEDIATE: x86/gen_matypes.exe
-
-TOP = ../..
-GLIDE ?= $(TOP)/glide3
-LIBDIR = $(TOP)/lib
-GL_LIB = libgl.a
-GL_DXE = gl.dxe
-GL_IMP = libigl.a
-
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
-
-CC = gcc
-CFLAGS += $(INCLUDE_DIRS)
-CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1
-ifeq ($(FX),1)
-CFLAGS += -D__DOS__
-CFLAGS += -I$(GLIDE)/include -DFX
-LIBNAME = "Mesa/FX DJGPP"
-else
-LIBNAME = "Mesa DJGPP"
-endif
-
-AR = ar
-ARFLAGS = crus
-
-HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
-
-ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
-UNLINK = del $(subst /,\,$(1))
-else
-UNLINK = $(RM) $(1)
-endif
-
-include sources
-
-ifeq ($(X86),1)
-CFLAGS += -DUSE_X86_ASM
-CFLAGS += -DUSE_MMX_ASM
-CFLAGS += -DUSE_SSE_ASM
-CFLAGS += -DUSE_3DNOW_ASM
-X86_SOURCES += $(X86_API)
-else
-X86_SOURCES =
-endif
-
-DRIVER_SOURCES = \
- drivers/dos/dmesa.c
-ifeq ($(FX),1)
-DRIVER_SOURCES += \
- $(GLIDE_DRIVER_SOURCES)
-else
-DRIVER_SOURCES += \
- drivers/dos/video.c \
- drivers/dos/virtual.S \
- drivers/dos/vesa.c \
- drivers/dos/blit.S \
- drivers/dos/vga.c \
- drivers/dos/null.c \
- drivers/dos/dpmi.c
-endif
-
-#DRIVER_SOURCES += $(OSMESA_DRIVER_SOURCES)
-
-SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES)
-
-OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
-
-X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
-
-.c.o:
- $(CC) -o $@ $(CFLAGS) -c $<
-.S.o:
- $(CC) -o $@ $(CFLAGS) -c $<
-.s.o:
- $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
-
-all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
-
-$(LIBDIR)/$(GL_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $@ $^
-
-$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
-ifeq ($(HAVEDXE3),)
- $(warning Missing DXE3 package... Skipping $(GL_DXE))
-else
-ifeq ($(FX),1)
- -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glide3x.dxe -U $^
-else
- -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
-endif
-endif
-
-$(X86_OBJECTS): x86/matypes.h
-
-x86/matypes.h: x86/gen_matypes.exe
- $< > $@
-
-x86/gen_matypes.exe: x86/gen_matypes.c
- $(CC) -o $@ $(CFLAGS) -s $<
-
-clean:
- -$(call UNLINK,array_cache/*.o)
- -$(call UNLINK,glapi/*.o)
- -$(call UNLINK,main/*.o)
- -$(call UNLINK,math/*.o)
- -$(call UNLINK,shader/*.o)
- -$(call UNLINK,sparc/*.o)
- -$(call UNLINK,ppc/*.o)
- -$(call UNLINK,swrast/*.o)
- -$(call UNLINK,swrast_setup/*.o)
- -$(call UNLINK,tnl/*.o)
- -$(call UNLINK,x86/*.o)
- -$(call UNLINK,drivers/common/*.o)
- -$(call UNLINK,drivers/dos/*.o)
- -$(call UNLINK,drivers/glide/*.o)
diff --git a/nx-X11/extras/Mesa/src/mesa/Makefile.mgw b/nx-X11/extras/Mesa/src/mesa/Makefile.mgw
deleted file mode 100644
index ebec5c055..000000000
--- a/nx-X11/extras/Mesa/src/mesa/Makefile.mgw
+++ /dev/null
@@ -1,206 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 5.1
-#
-# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# MinGW core makefile v1.4 for Mesa
-#
-# Copyright (C) 2002 - Daniel Borca
-# Email : dborca@users.sourceforge.net
-# Web : http://www.geocities.com/dborca
-
-
-#
-# Available options:
-#
-# Environment variables:
-# CFLAGS
-#
-# GLIDE path to Glide3 SDK; used with FX.
-# default = $(TOP)/glide3
-# FX=1 build for 3dfx Glide3. Note that this disables
-# compilation of most WMesa code and requires fxMesa.
-# As a consequence, you'll need the Win32 Glide3
-# library to build any application.
-# default = no
-# ICD=1 build the installable client driver interface
-# (windows opengl driver interface)
-# default = no
-# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
-# default = no
-#
-# Targets:
-# all: build GL
-# clean: remove object files
-#
-
-
-
-.PHONY: all clean
-.INTERMEDIATE: x86/gen_matypes.exe
-.SUFFIXES: .rc .res
-
-# Set this to the prefix of your build tools, i.e. mingw32-
-TOOLS_PREFIX = mingw32-
-
-TOP = ../..
-GLIDE ?= $(TOP)/glide3
-LIBDIR = $(TOP)/lib
-ifeq ($(ICD),1)
- GL_DLL = mesa32.dll
- GL_IMP = libmesa32.a
-else
- GL_DLL = opengl32.dll
- GL_IMP = libopengl32.a
-endif
-
-LDLIBS = -lgdi32
-
-CC = $(TOOLS_PREFIX)gcc
-CFLAGS += -DBUILD_GL32 -D_OPENGL32_
-CFLAGS += $(INCLUDE_DIRS)
-CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1
-ifeq ($(FX),1)
- CFLAGS += -I$(GLIDE)/include -DFX
- LDLIBS += -L$(GLIDE)/lib -lglide3x
- GL_DEF = drivers/windows/fx/fxopengl.def
- GL_RES = drivers/windows/fx/fx.rc
-else
- ifeq ($(ICD),1)
- CFLAGS += -DUSE_MGL_NAMESPACE
- GL_DEF = drivers/windows/icd/mesa.def
- else
- GL_DEF = drivers/windows/gdi/mesa.def
- endif
-endif
-
-AR = ar
-ARFLAGS = crus
-
-UNLINK = del $(subst /,\,$(1))
-ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
-UNLINK = $(RM) $(1)
-endif
-ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
-UNLINK = $(RM) $(1)
-endif
-
-include sources
-
-ifeq ($(X86),1)
-CFLAGS += -DUSE_X86_ASM
-CFLAGS += -DUSE_MMX_ASM
-CFLAGS += -DUSE_SSE_ASM
-CFLAGS += -DUSE_3DNOW_ASM
-X86_SOURCES += $(X86_API)
-else
-X86_SOURCES =
-endif
-
-ifeq ($(FX),1)
-DRIVER_SOURCES = \
- $(GLIDE_DRIVER_SOURCES) \
- drivers/windows/fx/fxwgl.c
-else
-ifeq ($(ICD),1)
-DRIVER_SOURCES = \
- drivers/windows/gdi/wmesa.c \
- drivers/windows/icd/icd.c
-else
-DRIVER_SOURCES = \
- drivers/windows/gdi/wmesa.c \
- drivers/windows/gdi/wgl.c
-endif
-endif
-
-SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES)
-
-OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
-
-X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
-
-RESOURCE = $(GL_RES:.rc=.res)
-
-.c.o:
- $(CC) -o $@ $(CFLAGS) -c $<
-.S.o:
- $(CC) -o $@ $(CFLAGS) -c $<
-.s.o:
- $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
-.rc.res:
- windres -o $@ -Irc -Ocoff $<
-
-all: $(LIBDIR) $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP)
-
-$(LIBDIR):
- mkdir -p $(LIBDIR)
-
-$(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) $(RESOURCE)
- $(TOOLS_PREFIX)dllwrap -o $(LIBDIR)/$(GL_DLL) --output-lib $(LIBDIR)/$(GL_IMP) \
- --target i386-mingw32 --def $(GL_DEF) -Wl,-enable-stdcall-fixup \
- $^ $(LDLIBS)
-
-$(X86_OBJECTS): x86/matypes.h
-
-x86/matypes.h: x86/gen_matypes.exe
- $(subst /,\,$< > $@)
-
-x86/gen_matypes.exe: x86/gen_matypes.c
- $(CC) -o $@ $(CFLAGS) -s $<
-
-# [dBorca]
-# glapi_x86.S needs some adjustments
-# in order to generate correct entrypoints
-# Trick: change the following condition to
-# be always false if you need C entrypoints
-# with USE_X86_ASM (useful for trace/debug)
-ifeq (1,1)
-x86/glapi_x86.o: x86/glapi_x86.S
- $(CC) -o $@ $(CFLAGS) -DSTDCALL_API -c $<
-else
-main/dispatch.o: main/dispatch.c
- $(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $<
-glapi/glapi.o: glapi/glapi.c
- $(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $<
-endif
-
-# [dBorca]
-# if we want codegen, we have to stdcall
-tnl/t_vtx_x86_gcc.o: tnl/t_vtx_x86_gcc.S
- $(CC) -o $@ $(CFLAGS) -DSTDCALL_API -c $<
-
-clean:
- -$(call UNLINK,array_cache/*.o)
- -$(call UNLINK,glapi/*.o)
- -$(call UNLINK,main/*.o)
- -$(call UNLINK,math/*.o)
- -$(call UNLINK,shader/*.o)
- -$(call UNLINK,sparc/*.o)
- -$(call UNLINK,ppc/*.o)
- -$(call UNLINK,swrast/*.o)
- -$(call UNLINK,swrast_setup/*.o)
- -$(call UNLINK,tnl/*.o)
- -$(call UNLINK,x86/*.o)
- -$(call UNLINK,drivers/common/*.o)
- -$(call UNLINK,drivers/glide/*.o)
- -$(call UNLINK,drivers/windows/fx/*.o)
- -$(call UNLINK,drivers/windows/fx/*.res)
- -$(call UNLINK,drivers/windows/gdi/*.o)
- -$(call UNLINK,drivers/windows/icd/*.o)
diff --git a/nx-X11/extras/Mesa/src/mesa/array_cache/descrip.mms b/nx-X11/extras/Mesa/src/mesa/array_cache/descrip.mms
deleted file mode 100644
index 3555f83d8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/array_cache/descrip.mms
+++ /dev/null
@@ -1,37 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [---.include.gl]
- define math [-.math]
- define array_cache [-.array_cache]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main],[-.glapi]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = ac_context.c ac_import.c
-
-OBJECTS = ac_context.obj,ac_import.obj
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-ac_context.obj : ac_context.c
-ac_import.obj : ac_import.c
diff --git a/nx-X11/extras/Mesa/src/mesa/descrip.mms b/nx-X11/extras/Mesa/src/mesa/descrip.mms
deleted file mode 100644
index a12e3fc1b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/descrip.mms
+++ /dev/null
@@ -1,26 +0,0 @@
-# Makefile for Mesa for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-all :
- set default [.main]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.glapi]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.shader]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.drivers.common]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.x11]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.osmesa]
- $(MMS)$(MMSQUALIFIERS)
- set default [--.math]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.tnl]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.swrast]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.swrast_setup]
- $(MMS)$(MMSQUALIFIERS)
- set default [-.array_cache]
- $(MMS)$(MMSQUALIFIERS)
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/common/descrip.mms b/nx-X11/extras/Mesa/src/mesa/drivers/common/descrip.mms
deleted file mode 100644
index aa4b8ae21..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/common/descrip.mms
+++ /dev/null
@@ -1,37 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [----.include.gl]
- define math [--.math]
- define swrast [--.swrast]
-
-.include [----]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [----.include],[--.main],[--.glapi],[--.shader]
-LIBDIR = [----.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = driverfuncs.c
-
-OBJECTS =driverfuncs.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-driverfuncs.obj : driverfuncs.c
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile
deleted file mode 100644
index 8db675431..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# 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
deleted file mode 100644
index c8fef8aac..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/Makefile.template
+++ /dev/null
@@ -1,109 +0,0 @@
-# -*-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
deleted file mode 100644
index 1875d157b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/depthtmp.h
+++ /dev/null
@@ -1,253 +0,0 @@
-
-/*
- * 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
deleted file mode 100644
index 3edeb03f9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.c
+++ /dev/null
@@ -1,1073 +0,0 @@
-/* $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 <assert.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdio.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#include "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
deleted file mode 100644
index b9b38f39c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/dri_util.h
+++ /dev/null
@@ -1,555 +0,0 @@
-/* $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 <kevin@precisioninsight.com>
- * \author Brian Paul <brian@precisioninsight.com>
- */
-
-/*
- * 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 <GL/gl.h>
-#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
deleted file mode 100644
index 44826958d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ /dev/null
@@ -1,98 +0,0 @@
-
-#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
deleted file mode 100644
index 627f1d41d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/drirenderbuffer.h
+++ /dev/null
@@ -1,39 +0,0 @@
-
-/**
- * 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
deleted file mode 100644
index 4a6606819..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/extension_helper.h
+++ /dev/null
@@ -1,5887 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by extension_helper.py (from Mesa) script */
-
-/*
- * (C) Copyright IBM Corporation 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "utils.h"
-#include "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.NX.original b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c.NX.original
deleted file mode 100644
index 066c5ffba..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c.NX.original
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * (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 <idr@us.ibm.com>
- */
-
-#if defined(IN_MINI_GLX)
-# include <stdlib.h>
-# include <string.h>
-# include <GL/gl.h>
-# include "GL/internal/dri_interface.h"
-# include "imports.h"
-# define __glXMemset memset
-#else
-# include <X11/X.h>
-# include <GL/glx.h>
-# include "GL/glxint.h"
-
-# ifdef XFree86Server
-void *memset( void * ptr, int val, size_t size);
-# 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 <X11/Xlibint.h>
-# 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.c.X.original b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c.X.original
deleted file mode 100644
index 5e9e352f2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c.X.original
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * (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 <idr@us.ibm.com>
- */
-
-#if defined(IN_MINI_GLX)
-# include <stdlib.h>
-# include <string.h>
-# include <GL/gl.h>
-# include "GL/internal/dri_interface.h"
-# include "imports.h"
-# define __glXMemset memset
-#else
-# include <X11/X.h>
-# include <GL/glx.h>
-# 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 <X11/Xlibint.h>
-# 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/memops.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h
deleted file mode 100644
index 4952d788e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/memops.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#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<size;i++)
- *((char *)address + i)=c;
-#else
- memset(address,c,size);
-#endif
-}
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmio.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmio.h
deleted file mode 100644
index 2b7b4123e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmio.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 mmio.h
- * Functions for properly handling memory mapped IO on various platforms.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-
-#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
deleted file mode 100644
index 49ce7e3e3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/mmx.h
+++ /dev/null
@@ -1,560 +0,0 @@
-/* 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 <stdio.h>
-
-#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
deleted file mode 100644
index f726e8305..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp.h
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * 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 <keithw@tungstengraphics.com>
- * Gareth Hughes <gareth@nvidia.com>
- */
-
-#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;i<n;i++)
- {
- if (mask[i]) {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- else
- {
- for (i=0;i<n;i++)
- {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBASpan)( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- y = Y_FLIP( y );
-
- if (DBG) fprintf(stderr, "WriteMonoRGBASpan\n");
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_PIXEL( x1, y, p );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_PIXEL( x1, y, p );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBAPixels)( 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;i<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(ReadRGBASpan)( 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);
- for (;n1>0;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<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_RGBA( rgba[i], x[i], fy );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_RGBA( rgba[i], x[i], fy );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-
-
-
-#undef WRITE_PIXEL
-#undef WRITE_RGBA
-#undef READ_RGBA
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp2.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp2.h
deleted file mode 100644
index 1a20a4597..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp2.h
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file spantmp2.h
- *
- * Template file of span read / write functions.
- *
- * \author Keith Whitwell <keithw@tungstengraphics.com>
- * \author Gareth Hughes <gareth@nvidia.com>
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "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;i<n;i++)
- {
- if (mask[i]) {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- else
- {
- for (i=0;i<n;i++)
- {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBASpan)( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- y = Y_FLIP( y );
-
- if (DBG) fprintf(stderr, "WriteMonoRGBASpan\n");
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_PIXEL( x1, y, p );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_PIXEL( x1, y, p );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBAPixels)( 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;i<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(ReadRGBASpan)( 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);
- for (;n1>0;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;i<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_RGBA( rgba[i], x[i], fy );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_RGBA( rgba[i], x[i], fy );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-static void TAG(InitPointers)(struct gl_renderbuffer *rb)
-{
- rb->PutRow = TAG(WriteRGBASpan);
- rb->PutRowRGB = TAG(WriteRGBSpan);
- rb->PutMonoRow = TAG(WriteMonoRGBASpan);
- rb->PutValues = TAG(WriteRGBAPixels);
- rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
- rb->GetValues = TAG(ReadRGBAPixels);
-
-#if defined(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
deleted file mode 100644
index a4509a569..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/spantmp_common.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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
deleted file mode 100644
index dccab0660..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/stenciltmp.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/* $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;i<n;i++)
- {
- if (mask[i]) {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_STENCIL( x[i], fy, stencil[i] );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-/* Read stencil spans and pixels
- */
-static void TAG(ReadStencilSpan)( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- HW_READ_LOCK()
- {
- GLubyte *stencil = (GLubyte *) values;
- GLint x1,n1;
- LOCAL_STENCIL_VARS;
-
- y = Y_FLIP(y);
-
- if (DBG) fprintf(stderr, "ReadStencilSpan\n");
-
- HW_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- for (;n1>0;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<n;i++) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_STENCIL( stencil[i], x[i], fy );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-
-
-
-#undef WRITE_STENCIL
-#undef READ_STENCIL
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.c
deleted file mode 100644
index acefce0f5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.c
+++ /dev/null
@@ -1,1339 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * (C) Copyright IBM Corporation 2002, 2003
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Ian Romanick <idr@us.ibm.com>
- * Keith Whitwell <keithw@tungstengraphics.com>
- * Kevin E. Martin <kem@users.sourceforge.net>
- * Gareth Hughes <gareth@nvidia.com>
- */
-/* $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 <assert.h>
-
-
-
-static unsigned dummy_swap_counter;
-
-
-/**
- * Calculate \f$\log_2\f$ of a value. This is a particularly poor
- * implementation of this function. However, since system performance is in
- * no way dependent on this function, the slowness of the implementation is
- * irrelevent.
- *
- * \param n Value whose \f$\log_2\f$ is to be calculated
- */
-
-static GLuint
-driLog2( GLuint n )
-{
- GLuint log2;
-
- for ( log2 = 1 ; n > 1 ; log2++ ) {
- n >>= 1;
- }
-
- return log2;
-}
-
-
-
-
-/**
- * Determine if a texture is resident in textureable memory. Depending on
- * the driver, this may or may not be on-card memory. It could be AGP memory
- * or anyother type of memory from which the hardware can directly read
- * texels.
- *
- * This function is intended to be used as the \c IsTextureResident function
- * in the device's \c dd_function_table.
- *
- * \param ctx GL context pointer (currently unused)
- * \param texObj Texture object to be tested
- */
-
-GLboolean
-driIsTextureResident( 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
deleted file mode 100644
index 705cd4d34..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/texmem.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * 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 <idr@us.ibm.com>
- * Keith Whitwell <keithw@tungstengraphics.com>
- * Kevin E. Martin <kem@users.sourceforge.net>
- * Gareth Hughes <gareth@nvidia.com>
- */
-/* $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
deleted file mode 100644
index fbe1991fa..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.c
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * (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 <idr@us.ibm.com>
- */
-
-#include <string.h>
-#include <stdlib.h>
-#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 <chip> <driver date> <AGP speed) <CPU information>"
- *
- * 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
deleted file mode 100644
index 26d178f74..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/utils.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * (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 <idr@us.ibm.com>
- */
-/* $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
deleted file mode 100644
index eebe42d96..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/* -*- 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 <idr@us.ibm.com>
- */
-/* $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
deleted file mode 100644
index 3dc965def..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/vblank.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- 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 <idr@us.ibm.com>
- */
-/* $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 <unistd.h> /* for usleep() */
-#include <sched.h> /* for sched_yield() */
-
-#ifdef linux
-#include <sched.h> /* 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
deleted file mode 100644
index b635894fe..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.c
+++ /dev/null
@@ -1,1002 +0,0 @@
-/*
- * 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 <string.h>
-#include <assert.h>
-#include <expat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#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 <sys/param.h>
-#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 <osreldate.h>
-# if (__FreeBSD_version >= 440000)
-# include <stdlib.h>
-# define GET_PROGRAM_NAME() getprogname()
-# endif
-#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
-# include <stdlib.h>
-# 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]<exponent>, where <exponent> 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 <driinfo> elements.");
- if (attr[0])
- XML_FATAL1 ("attributes specified on <driinfo> element.");
- data->inDriInfo = GL_TRUE;
- break;
- case OI_SECTION:
- if (!data->inDriInfo)
- XML_FATAL1 ("<section> must be inside <driinfo>.");
- if (data->inSection)
- XML_FATAL1 ("nested <section> elements.");
- if (attr[0])
- XML_FATAL1 ("attributes specified on <section> element.");
- data->inSection = GL_TRUE;
- break;
- case OI_DESCRIPTION:
- if (!data->inSection && !data->inOption)
- XML_FATAL1 ("<description> must be inside <description> or <option.");
- if (data->inDesc)
- XML_FATAL1 ("nested <description> elements.");
- data->inDesc = GL_TRUE;
- parseDescAttr (data, attr);
- break;
- case OI_OPTION:
- if (!data->inSection)
- XML_FATAL1 ("<option> must be inside <section>.");
- if (data->inDesc)
- XML_FATAL1 ("<option> nested in <description> element.");
- if (data->inOption)
- XML_FATAL1 ("nested <option> elements.");
- data->inOption = GL_TRUE;
- parseOptInfoAttr (data, attr);
- break;
- case OI_ENUM:
- if (!(data->inOption && data->inDesc))
- XML_FATAL1 ("<enum> must be inside <option> and <description>.");
- if (data->inEnum)
- XML_FATAL1 ("nested <enum> elements.");
- data->inEnum = GL_TRUE;
- parseEnumAttr (data, attr);
- break;
- default:
- XML_FATAL ("unknown element: %s.", name);
- }
-}
-
-/** \brief Handler for end element events. */
-static void optInfoEndElem (void *userData, const XML_Char *name) {
- struct OptInfoData *data = (struct OptInfoData *)userData;
- enum OptInfoElem elem = bsearchStr (name, OptInfoElems, OI_COUNT);
- switch (elem) {
- case OI_DRIINFO:
- data->inDriInfo = GL_FALSE;
- break;
- case OI_SECTION:
- data->inSection = GL_FALSE;
- break;
- case OI_DESCRIPTION:
- data->inDesc = GL_FALSE;
- break;
- case OI_OPTION:
- data->inOption = GL_FALSE;
- break;
- case OI_ENUM:
- data->inEnum = GL_FALSE;
- break;
- default:
- assert (0); /* should have been caught by StartElem */
- }
-}
-
-void driParseOptionInfo (driOptionCache *info,
- const char *configOptions, GLuint nConfigOptions) {
- XML_Parser p;
- int status;
- struct OptInfoData userData;
- struct OptInfoData *data = &userData;
- GLuint realNoptions;
-
- /* determine hash table size and allocate memory:
- * 3/2 of the number of options, rounded up, so there remains always
- * at least one free entry. This is needed for detecting undefined
- * options in configuration files without getting a hash table overflow.
- * Round this up to a power of two. */
- GLuint minSize = (nConfigOptions*3 + 1) / 2;
- GLuint size, log2size;
- for (size = 1, log2size = 0; size < minSize; size <<= 1, ++log2size);
- info->tableSize = log2size;
- info->info = CALLOC (size * sizeof (driOptionInfo));
- info->values = CALLOC (size * sizeof (driOptionValue));
- if (info->info == NULL || info->values == NULL) {
- fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
- abort();
- }
-
- p = XML_ParserCreate ("UTF-8"); /* always UTF-8 */
- XML_SetElementHandler (p, optInfoStartElem, optInfoEndElem);
- XML_SetUserData (p, data);
-
- userData.name = "__driConfigOptions";
- userData.parser = p;
- userData.cache = info;
- userData.inDriInfo = GL_FALSE;
- userData.inSection = GL_FALSE;
- userData.inDesc = GL_FALSE;
- userData.inOption = GL_FALSE;
- userData.inEnum = GL_FALSE;
- userData.curOption = -1;
-
- status = XML_Parse (p, configOptions, strlen (configOptions), 1);
- if (!status)
- XML_FATAL ("%s.", XML_ErrorString(XML_GetErrorCode(p)));
-
- XML_ParserFree (p);
-
- /* Check if the actual number of options matches nConfigOptions.
- * A mismatch is not fatal (a hash table overflow would be) but we
- * want the driver developer's attention anyway. */
- realNoptions = countOptions (info);
- if (realNoptions != nConfigOptions) {
- fprintf (stderr,
- "Error: nConfigOptions (%u) does not match the actual number of options in\n"
- " __driConfigOptions (%u).\n",
- nConfigOptions, realNoptions);
- }
-}
-
-/** \brief Parser context for configuration files. */
-struct OptConfData {
- const char *name;
- XML_Parser parser;
- driOptionCache *cache;
- GLint screenNum;
- const char *driverName, *execName;
- GLuint ignoringDevice;
- GLuint ignoringApp;
- GLuint inDriConf;
- GLuint inDevice;
- GLuint inApp;
- GLuint inOption;
-};
-
-/** \brief Elements in configuration files. */
-enum OptConfElem {
- OC_APPLICATION = 0, OC_DEVICE, OC_DRICONF, OC_OPTION, OC_COUNT
-};
-static const XML_Char *OptConfElems[] = {
- "application", "device", "driconf", "option"
-};
-
-/** \brief Parse attributes of a device element. */
-static void parseDeviceAttr (struct OptConfData *data, const XML_Char **attr) {
- GLuint i;
- const XML_Char *driver = NULL, *screen = NULL;
- for (i = 0; attr[i]; i += 2) {
- if (!strcmp (attr[i], "driver")) driver = attr[i+1];
- else if (!strcmp (attr[i], "screen")) screen = attr[i+1];
- else XML_WARNING("unkown device attribute: %s.", attr[i]);
- }
- if (driver && strcmp (driver, data->driverName))
- data->ignoringDevice = data->inDevice;
- else if (screen) {
- driOptionValue screenNum;
- if (!parseValue (&screenNum, DRI_INT, screen))
- XML_WARNING("illegal screen number: %s.", screen);
- else if (screenNum._int != data->screenNum)
- data->ignoringDevice = data->inDevice;
- }
-}
-
-/** \brief Parse attributes of an application element. */
-static void parseAppAttr (struct OptConfData *data, const XML_Char **attr) {
- GLuint i;
- const XML_Char *name = NULL, *exec = NULL;
- for (i = 0; attr[i]; i += 2) {
- if (!strcmp (attr[i], "name")) name = attr[i+1];
- else if (!strcmp (attr[i], "executable")) exec = attr[i+1];
- else XML_WARNING("unkown application attribute: %s.", attr[i]);
- }
- if (exec && strcmp (exec, data->execName))
- data->ignoringApp = data->inApp;
-}
-
-/** \brief Parse attributes of an option element. */
-static void parseOptConfAttr (struct OptConfData *data, const XML_Char **attr) {
- GLuint i;
- const XML_Char *name = NULL, *value = NULL;
- for (i = 0; attr[i]; i += 2) {
- if (!strcmp (attr[i], "name")) name = attr[i+1];
- else if (!strcmp (attr[i], "value")) value = attr[i+1];
- else XML_WARNING("unkown option attribute: %s.", attr[i]);
- }
- if (!name) XML_WARNING1 ("name attribute missing in option.");
- if (!value) XML_WARNING1 ("value attribute missing in option.");
- if (name && value) {
- driOptionCache *cache = data->cache;
- GLuint opt = findOption (cache, name);
- if (cache->info[opt].name == NULL)
- XML_WARNING ("undefined option: %s.", name);
- else if (getenv (cache->info[opt].name))
- /* don't use XML_WARNING, we want the user to see this! */
- fprintf (stderr, "ATTENTION: option value of option %s ignored.\n",
- cache->info[opt].name);
- else if (!parseValue (&cache->values[opt], cache->info[opt].type, value))
- XML_WARNING ("illegal option value: %s.", value);
- }
-}
-
-/** \brief Handler for start element events. */
-static void optConfStartElem (void *userData, const XML_Char *name,
- const XML_Char **attr) {
- struct OptConfData *data = (struct OptConfData *)userData;
- enum OptConfElem elem = bsearchStr (name, OptConfElems, OC_COUNT);
- switch (elem) {
- case OC_DRICONF:
- if (data->inDriConf)
- XML_WARNING1 ("nested <driconf> elements.");
- if (attr[0])
- XML_WARNING1 ("attributes specified on <driconf> element.");
- data->inDriConf++;
- break;
- case OC_DEVICE:
- if (!data->inDriConf)
- XML_WARNING1 ("<device> should be inside <driconf>.");
- if (data->inDevice)
- XML_WARNING1 ("nested <device> elements.");
- data->inDevice++;
- if (!data->ignoringDevice && !data->ignoringApp)
- parseDeviceAttr (data, attr);
- break;
- case OC_APPLICATION:
- if (!data->inDevice)
- XML_WARNING1 ("<application> should be inside <device>.");
- if (data->inApp)
- XML_WARNING1 ("nested <application> elements.");
- data->inApp++;
- if (!data->ignoringDevice && !data->ignoringApp)
- parseAppAttr (data, attr);
- break;
- case OC_OPTION:
- if (!data->inApp)
- XML_WARNING1 ("<option> should be inside <application>.");
- if (data->inOption)
- XML_WARNING1 ("nested <option> elements.");
- data->inOption++;
- if (!data->ignoringDevice && !data->ignoringApp)
- parseOptConfAttr (data, attr);
- break;
- default:
- XML_WARNING ("unknown element: %s.", name);
- }
-}
-
-/** \brief Handler for end element events. */
-static void optConfEndElem (void *userData, const XML_Char *name) {
- struct OptConfData *data = (struct OptConfData *)userData;
- enum OptConfElem elem = bsearchStr (name, OptConfElems, OC_COUNT);
- switch (elem) {
- case OC_DRICONF:
- data->inDriConf--;
- break;
- case OC_DEVICE:
- if (data->inDevice-- == data->ignoringDevice)
- data->ignoringDevice = 0;
- break;
- case OC_APPLICATION:
- if (data->inApp-- == data->ignoringApp)
- data->ignoringApp = 0;
- break;
- case OC_OPTION:
- data->inOption--;
- break;
- default:
- /* unknown element, warning was produced on start tag */;
- }
-}
-
-/** \brief Initialize an option cache based on info */
-static void initOptionCache (driOptionCache *cache, const driOptionCache *info) {
- cache->info = info->info;
- cache->tableSize = info->tableSize;
- cache->values = MALLOC ((1<<info->tableSize) * sizeof (driOptionValue));
- if (cache->values == NULL) {
- fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
- abort();
- }
- memcpy (cache->values, info->values,
- (1<<info->tableSize) * sizeof (driOptionValue));
-}
-
-/** \brief Parse the named configuration file */
-static void parseOneConfigFile (XML_Parser p) {
-#define BUF_SIZE 0x1000
- struct OptConfData *data = (struct OptConfData *)XML_GetUserData (p);
- int status;
- int fd;
-
- if ((fd = open (data->name, O_RDONLY)) == -1) {
- __driUtilMessage ("Can't open configuration file %s: %s.",
- data->name, strerror (errno));
- return;
- }
-
- while (1) {
- int bytesRead;
- void *buffer = XML_GetBuffer (p, BUF_SIZE);
- if (!buffer) {
- __driUtilMessage ("Can't allocate parser buffer.");
- break;
- }
- bytesRead = read (fd, buffer, BUF_SIZE);
- if (bytesRead == -1) {
- __driUtilMessage ("Error reading from configuration file %s: %s.",
- data->name, strerror (errno));
- break;
- }
- status = XML_ParseBuffer (p, bytesRead, bytesRead == 0);
- if (!status) {
- XML_ERROR ("%s.", XML_ErrorString(XML_GetErrorCode(p)));
- break;
- }
- if (bytesRead == 0)
- break;
- }
-
- close (fd);
-#undef BUF_SIZE
-}
-
-void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
- GLint screenNum, const char *driverName) {
- char *filenames[2] = {"/etc/drirc", NULL};
- char *home;
- GLuint i;
- struct OptConfData userData;
-
- initOptionCache (cache, info);
-
- userData.cache = cache;
- userData.screenNum = screenNum;
- userData.driverName = driverName;
- userData.execName = GET_PROGRAM_NAME();
-
- if ((home = getenv ("HOME"))) {
- GLuint len = strlen (home);
- filenames[1] = MALLOC (len + 7+1);
- if (filenames[1] == NULL)
- __driUtilMessage ("Can't allocate memory for %s/.drirc.", home);
- else {
- memcpy (filenames[1], home, len);
- memcpy (filenames[1] + len, "/.drirc", 7+1);
- }
- }
-
- for (i = 0; i < 2; ++i) {
- XML_Parser p;
- if (filenames[i] == NULL)
- continue;
-
- p = XML_ParserCreate (NULL); /* use encoding specified by file */
- XML_SetElementHandler (p, optConfStartElem, optConfEndElem);
- XML_SetUserData (p, &userData);
- userData.parser = p;
- userData.name = filenames[i];
- userData.ignoringDevice = 0;
- userData.ignoringApp = 0;
- userData.inDriConf = 0;
- userData.inDevice = 0;
- userData.inApp = 0;
- userData.inOption = 0;
-
- parseOneConfigFile (p);
- XML_ParserFree (p);
- }
-
- if (filenames[1])
- FREE (filenames[1]);
-}
-
-void driDestroyOptionInfo (driOptionCache *info) {
- driDestroyOptionCache (info);
- if (info->info) {
- GLuint i, size = 1 << info->tableSize;
- for (i = 0; i < size; ++i) {
- if (info->info[i].name) {
- FREE (info->info[i].name);
- if (info->info[i].ranges)
- FREE (info->info[i].ranges);
- }
- }
- FREE (info->info);
- }
-}
-
-void driDestroyOptionCache (driOptionCache *cache) {
- if (cache->values)
- FREE (cache->values);
-}
-
-GLboolean driCheckOption (const driOptionCache *cache, const char *name,
- driOptionType type) {
- GLuint i = findOption (cache, name);
- return cache->info[i].name != NULL && cache->info[i].type == type;
-}
-
-GLboolean driQueryOptionb (const driOptionCache *cache, const char *name) {
- GLuint i = findOption (cache, name);
- /* make sure the option is defined and has the correct type */
- assert (cache->info[i].name != NULL);
- assert (cache->info[i].type == DRI_BOOL);
- return cache->values[i]._bool;
-}
-
-GLint driQueryOptioni (const driOptionCache *cache, const char *name) {
- GLuint i = findOption (cache, name);
- /* make sure the option is defined and has the correct type */
- assert (cache->info[i].name != NULL);
- assert (cache->info[i].type == DRI_INT || cache->info[i].type == DRI_ENUM);
- return cache->values[i]._int;
-}
-
-GLfloat driQueryOptionf (const driOptionCache *cache, const char *name) {
- GLuint i = findOption (cache, name);
- /* make sure the option is defined and has the correct type */
- assert (cache->info[i].name != NULL);
- assert (cache->info[i].type == DRI_FLOAT);
- return cache->values[i]._float;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.h
deleted file mode 100644
index c363af764..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlconfig.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * 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.h
- * \brief Driver-independent client-side part of the XML configuration
- * \author Felix Kuehling
- */
-
-#ifndef __XMLCONFIG_H
-#define __XMLCONFIG_H
-
-/** \brief Option data types */
-typedef enum driOptionType {
- DRI_BOOL, DRI_ENUM, DRI_INT, DRI_FLOAT
-} driOptionType;
-
-/** \brief Option value */
-typedef union driOptionValue {
- GLboolean _bool; /**< \brief Boolean */
- GLint _int; /**< \brief Integer or Enum */
- GLfloat _float; /**< \brief Floating-point */
-} driOptionValue;
-
-/** \brief Single range of valid values
- *
- * For empty ranges (a single value) start == end */
-typedef struct driOptionRange {
- driOptionValue start; /**< \brief Start */
- driOptionValue end; /**< \brief End */
-} driOptionRange;
-
-/** \brief Information about an option */
-typedef struct driOptionInfo {
- char *name; /**< \brief Name */
- driOptionType type; /**< \brief Type */
- driOptionRange *ranges; /**< \brief Array of ranges */
- GLuint nRanges; /**< \brief Number of ranges */
-} driOptionInfo;
-
-/** \brief Option cache
- *
- * \li One in <driver>Screen caching option info and the default values
- * \li One in each <driver>Context with the actual values for that context */
-typedef struct driOptionCache {
- driOptionInfo *info;
- /**< \brief Array of option infos
- *
- * Points to the same array in the screen and all contexts */
- driOptionValue *values;
- /**< \brief Array of option values
- *
- * \li Default values in screen
- * \li Actual values in contexts
- */
- GLuint tableSize;
- /**< \brief Size of the arrays
- *
- * Depending on the hash function this may differ from __driNConfigOptions.
- * In the current implementation it's not actually a size but log2(size).
- * The value is the same in the screen and all contexts. */
-} driOptionCache;
-
-/** \brief Parse XML option info from configOptions
- *
- * To be called in <driver>CreateScreen
- *
- * \param info pointer to a driOptionCache that will store the option info
- * \param configOptions XML document describing available configuration opts
- * \param nConfigOptions number of options, used to choose a hash table size
- *
- * For the option information to be available to external configuration tools
- * it must be a public symbol __driConfigOptions. It is also passed as a
- * parameter to driParseOptionInfo in order to avoid driver-independent code
- * depending on symbols in driver-specific code. */
-void driParseOptionInfo (driOptionCache *info,
- const char *configOptions, GLuint nConfigOptions);
-/** \brief Initialize option cache from info and parse configuration files
- *
- * To be called in <driver>CreateContext. screenNum and driverName select
- * device sections. */
-void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
- GLint screenNum, const char *driverName);
-/** \brief Destroy option info
- *
- * To be called in <driver>DestroyScreen */
-void driDestroyOptionInfo (driOptionCache *info);
-/** \brief Destroy option cache
- *
- * To be called in <driver>DestroyContext */
-void driDestroyOptionCache (driOptionCache *cache);
-
-/** \brief Check if there exists a certain option */
-GLboolean driCheckOption (const driOptionCache *cache, const char *name,
- driOptionType type);
-
-/** \brief Query a boolean option value */
-GLboolean driQueryOptionb (const driOptionCache *cache, const char *name);
-/** \brief Query an integer option value */
-GLint driQueryOptioni (const driOptionCache *cache, const char *name);
-/** \brief Query a floating-point option value */
-GLfloat driQueryOptionf (const driOptionCache *cache, const char *name);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool.h
deleted file mode 100644
index 7fbc6e800..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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 xmlpool.h
- * \brief Pool of common options
- * \author Felix Kuehling
- *
- * This file defines macros that can be used to construct
- * driConfigOptions in the drivers. Common options are defined in
- * xmlpool/t_options.h from which xmlpool/options.h is generated with
- * translations. This file defines generic helper macros and includes
- * xmlpool/options.h.
- */
-
-#ifndef __XMLPOOL_H
-#define __XMLPOOL_H
-
-/*
- * generic macros
- */
-
-/** \brief Begin __driConfigOptions */
-#define DRI_CONF_BEGIN \
-"<driinfo>\n"
-
-/** \brief End __driConfigOptions */
-#define DRI_CONF_END \
-"</driinfo>\n"
-
-/** \brief Begin a section of related options */
-#define DRI_CONF_SECTION_BEGIN \
-"<section>\n"
-
-/** \brief End a section of related options */
-#define DRI_CONF_SECTION_END \
-"</section>\n"
-
-/** \brief Begin an option definition */
-#define DRI_CONF_OPT_BEGIN(name,type,def) \
-"<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n"
-
-/** \brief Begin an option definition with restrictions on valid values */
-#define DRI_CONF_OPT_BEGIN_V(name,type,def,valid) \
-"<option name=\""#name"\" type=\""#type"\" default=\""#def"\" valid=\""valid"\">\n"
-
-/** \brief End an option description */
-#define DRI_CONF_OPT_END \
-"</option>\n"
-
-/** \brief A verbal description in a specified language (empty version) */
-#define DRI_CONF_DESC(lang,text) \
-"<description lang=\""#lang"\" text=\""text"\"/>\n"
-
-/** \brief A verbal description in a specified language */
-#define DRI_CONF_DESC_BEGIN(lang,text) \
-"<description lang=\""#lang"\" text=\""text"\">\n"
-
-/** \brief End a description */
-#define DRI_CONF_DESC_END \
-"</description>\n"
-
-/** \brief A verbal description of an enum value */
-#define DRI_CONF_ENUM(value,text) \
-"<enum value=\""#value"\" text=\""text"\"/>\n"
-
-
-/*
- * Predefined option sections and options with multi-lingual descriptions
- * are now automatically generated.
- */
-#include "xmlpool/options.h"
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/Makefile
deleted file mode 100644
index ef94541c3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/Makefile
+++ /dev/null
@@ -1,96 +0,0 @@
-# Convenient makefile for managing translations.
-
-# Prerequisites:
-# - GNU gettext
-# - Python
-
-# Adding new translations
-# -----------------------
-
-# To start working on a new translation edit the POS=... line
-# below. If you want to add for example a french translation, add
-# fr.po.
-
-# Then run "make po" to generate a fresh .po file from translatable
-# strings in t_options.h. Now you can edit the new .po file (fr.po in
-# the example above) to translate the strings. Please make sure that
-# your editor encodes the file in UTF-8.
-
-# Updating existing translations
-# ------------------------------
-
-# Run "make po" to update .po files with new translatable strings from
-# t_options.h. Now you can edit the .po files you're interested
-# in. Please make sure that your editor encodes the file in UTF-8.
-
-# Updating options.h
-# ------------------
-
-# Finally run "make" to generate options.h from t_options.h with all
-# translations. Now you can rebuild the drivers. Any common options
-# used by the drivers will have option descriptions with the latest
-# translations.
-
-# Publishing translations
-# -----------------------
-
-# To get your translation(s) into Mesa CVS, please send me your
-# <lang>.po file.
-
-# More information:
-# - info gettext
-
-# The set of supported languages. Add languages as needed.
-POS=de.po es.po nl.po fr.po
-
-#
-# Don't change anything below, unless you know what you're doing.
-#
-LANGS=$(POS:%.po=%)
-MOS=$(POS:%.po=%/LC_MESSAGES/options.mo)
-POT=xmlpool.pot
-
-.PHONY: all clean pot po mo
-
-all: options.h
-
-# Only intermediate files are cleaned up. options.h is not deleted because
-# it's in CVS.
-clean:
- rm -f $(POT) *~
- rm -rf $(LANGS)
-
-# Default target options.h
-options.h: t_options.h mo
- python gen_xmlpool.py $(LANGS) > options.h
-
-# Update .mo files from the corresponding .po files.
-mo:
- @for mo in $(MOS); do \
- lang=$${mo%%/*}; \
- echo "Updating $$mo from $$lang.po."; \
- mkdir -p $${mo%/*}; \
- msgfmt -o $$mo $$lang.po; \
- done
-
-# Use this target to create or update .po files with new messages in
-# driconf.py.
-po: $(POS)
-
-pot: $(POT)
-
-# Extract message catalog from driconf.py.
-$(POT): t_options.h
- xgettext -L C --from-code utf-8 -o $(POT) t_options.h
-
-# Create or update a .po file for a specific language.
-%.po: $(POT)
- @if [ -f $@ ]; then \
- echo "Merging new strings from $(POT) into $@."; \
- mv $@ $@~; \
- msgmerge -o $@ $@~ $(POT); \
- else \
- echo "Initializing $@ from $(POT)."; \
- msginit -i $(POT) -o $@~ --locale=$*; \
- sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $@~ > $@; \
- fi
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/de.po b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/de.po
deleted file mode 100644
index e287d0fe7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/de.po
+++ /dev/null
@@ -1,231 +0,0 @@
-# German translations for DRI driver options.
-# Copyright (C) 2005 Felix Kuehling
-# This file is distributed under the same license as the Mesa package.
-# Felix Kuehling <fxkuehl@gmx.de>, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Mesa 6.3\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-04-11 23:19+0200\n"
-"PO-Revision-Date: 2005-04-11 01:34+0200\n"
-"Last-Translator: Felix Kuehling <fxkuehl@gmx.de>\n"
-"Language-Team: German <de@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: t_options.h:53
-msgid "Debugging"
-msgstr "Fehlersuche"
-
-#: t_options.h:57
-msgid "Disable 3D acceleration"
-msgstr "3D-Beschleunigung abschalten"
-
-#: t_options.h:62
-msgid "Show performance boxes"
-msgstr "Zeige Performanceboxen"
-
-#: t_options.h:69
-msgid "Image Quality"
-msgstr "Bildqualität"
-
-#: t_options.h:77
-msgid "Texture color depth"
-msgstr "Texturfarbtiefe"
-
-#: t_options.h:78
-msgid "Prefer frame buffer color depth"
-msgstr "Bevorzuge Farbtiefe des Framebuffers"
-
-#: t_options.h:79
-msgid "Prefer 32 bits per texel"
-msgstr "Bevorzuge 32 bits pro Texel"
-
-#: t_options.h:80
-msgid "Prefer 16 bits per texel"
-msgstr "Bevorzuge 16 bits pro Texel"
-
-#: t_options.h:81
-msgid "Force 16 bits per texel"
-msgstr "Erzwinge 16 bits pro Texel"
-
-#: t_options.h:87
-msgid "Initial maximum value for anisotropic texture filtering"
-msgstr "Initialer Maximalwert für anisotropische Texturfilterung"
-
-#: t_options.h:92
-msgid "Forbid negative texture LOD bias"
-msgstr "Verbiete negative Textur-Detailgradverschiebung"
-
-#: t_options.h:97
-msgid ""
-"Enable S3TC texture compression even if software support is not available"
-msgstr ""
-"Aktiviere S3TC Texturkomprimierung auch wenn die nötige "
-"Softwareunterstützung fehlt"
-
-#: t_options.h:104
-msgid "Initial color reduction method"
-msgstr "Initiale Farbreduktionsmethode"
-
-#: t_options.h:105
-msgid "Round colors"
-msgstr "Farben runden"
-
-#: t_options.h:106
-msgid "Dither colors"
-msgstr "Farben rastern"
-
-#: t_options.h:114
-msgid "Color rounding method"
-msgstr "Farbrundungsmethode"
-
-#: t_options.h:115
-msgid "Round color components downward"
-msgstr "Farbkomponenten abrunden"
-
-#: t_options.h:116
-msgid "Round to nearest color"
-msgstr "Zur ähnlichsten Farbe runden"
-
-#: t_options.h:125
-msgid "Color dithering method"
-msgstr "Farbrasterungsmethode"
-
-#: t_options.h:126
-msgid "Horizontal error diffusion"
-msgstr "Horizontale Fehlerstreuung"
-
-#: t_options.h:127
-msgid "Horizontal error diffusion, reset error at line start"
-msgstr "Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen"
-
-#: t_options.h:128
-msgid "Ordered 2D color dithering"
-msgstr "Geordnete 2D Farbrasterung"
-
-#: t_options.h:134
-msgid "Floating point depth buffer"
-msgstr "Fließkomma z-Puffer"
-
-#: t_options.h:140
-msgid "Performance"
-msgstr "Leistung"
-
-#: t_options.h:148
-msgid "TCL mode (Transformation, Clipping, Lighting)"
-msgstr "TCL-Modus (Transformation, Clipping, Licht)"
-
-#: t_options.h:149
-msgid "Use software TCL pipeline"
-msgstr "Benutze die Software-TCL-Pipeline"
-
-#: t_options.h:150
-msgid "Use hardware TCL as first TCL pipeline stage"
-msgstr "Benutze Hardware TCL als erste Stufe der TCL-Pipeline"
-
-#: t_options.h:151
-msgid "Bypass the TCL pipeline"
-msgstr "Umgehe die TCL-Pipeline"
-
-#: t_options.h:152
-msgid ""
-"Bypass the TCL pipeline with state-based machine code generated on-the-fly"
-msgstr ""
-"Umgehe die TCL-Pipeline mit zur Laufzeit erzeugtem, zustandsbasiertem "
-"Maschinencode"
-
-#: t_options.h:161
-msgid "Method to limit rendering latency"
-msgstr "Methode zur Begrenzung der Bildverzögerung"
-
-#: t_options.h:162
-msgid "Busy waiting for the graphics hardware"
-msgstr "Aktives Warten auf die Grafikhardware"
-
-#: t_options.h:163
-msgid "Sleep for brief intervals while waiting for the graphics hardware"
-msgstr "Kurze Schlafintervalle beim Warten auf die Grafikhardware"
-
-#: t_options.h:164
-msgid "Let the graphics hardware emit a software interrupt and sleep"
-msgstr ""
-"Die Grafikhardware eine Softwareunterbrechnung erzeugen lassen und schlafen"
-
-#: t_options.h:174
-msgid "Synchronization with vertical refresh (swap intervals)"
-msgstr "Synchronisation mit der vertikalen Bildwiederholung"
-
-#: t_options.h:175
-msgid "Never synchronize with vertical refresh, ignore application's choice"
-msgstr ""
-"Niemals mit der Bildwiederholung synchronisieren, Anweisungen der Anwendung "
-"ignorieren"
-
-#: t_options.h:176
-msgid "Initial swap interval 0, obey application's choice"
-msgstr "Initiales Bildinterval 0, Anweisungen der Anwendung gehorchen"
-
-#: t_options.h:177
-msgid "Initial swap interval 1, obey application's choice"
-msgstr "Initiales Bildinterval 1, Anweisungen der Anwendung gehorchen"
-
-#: t_options.h:178
-msgid ""
-"Always synchronize with vertical refresh, application chooses the minimum "
-"swap interval"
-msgstr ""
-"Immer mit der Bildwiederholung synchronisieren, Anwendung wählt das minmale "
-"Bildinterval"
-
-#: t_options.h:186
-msgid "Use HyperZ to boost performance"
-msgstr "HyperZ zur Leistungssteigerung verwenden"
-
-#: t_options.h:191
-msgid "Number of texture units used"
-msgstr "Anzahl der benutzten Textureinheiten"
-
-#: t_options.h:196
-msgid ""
-"Enable hack to allow larger textures with texture compression on radeon/r200"
-msgstr ""
-"Hack aktivieren, der mit Texturkompression auf radeon/r200 größere Texturen "
-"erlaubt"
-
-#: t_options.h:201
-msgid "Texture filtering quality vs. speed, AKA “brilinear†texture filtering"
-msgstr ""
-"Texturfilterqualität versus -geschwindigkeit, auch bekannt als „brilineare“ "
-"Texturfilterung"
-
-#: t_options.h:209
-msgid "Used types of texture memory"
-msgstr "Benutzte Arten von Texturspeicher"
-
-#: t_options.h:210
-msgid "All available memory"
-msgstr "Aller verfügbarer Speicher"
-
-#: t_options.h:211
-msgid "Only card memory (if available)"
-msgstr "Nur Grafikspeicher (falls verfügbar)"
-
-#: t_options.h:212
-msgid "Only GART (AGP/PCIE) memory (if available)"
-msgstr "Nur GART-Speicher (AGP/PCIE) (falls verfügbar)"
-
-#: t_options.h:220
-msgid "Features that are not hardware-accelerated"
-msgstr "Funktionalität, die nicht hardwarebeschleunigt ist"
-
-#: t_options.h:224
-msgid "Enable extension GL_ARB_vertex_program"
-msgstr "Erweiterung GL_ARB_vertex_program aktivieren"
-
-#: t_options.h:229
-msgid "Enable extension GL_NV_vertex_program"
-msgstr "Erweiterung GL_NV_vertex_program aktivieren"
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/es.po b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/es.po
deleted file mode 100644
index 82ad177cb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/es.po
+++ /dev/null
@@ -1,219 +0,0 @@
-# translation of es.po to Spanish
-# Spanish translations for PACKAGE package.
-# Copyright (C) 2005 THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# David <deifo@ono.com>, 2005.
-# David Rubio Miguélez <deifo@ono.com>, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: es\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-04-12 12:18+0200\n"
-"PO-Revision-Date: 2005-04-12 20:26+0200\n"
-"Last-Translator: David Rubio Miguélez <deifo@ono.com>\n"
-"Language-Team: Spanish <es@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: KBabel 1.10\n"
-
-#: t_options.h:53
-msgid "Debugging"
-msgstr "Depurando"
-
-#: t_options.h:57
-msgid "Disable 3D acceleration"
-msgstr "Desactivar aceleración 3D"
-
-#: t_options.h:62
-msgid "Show performance boxes"
-msgstr "Mostrar cajas de rendimiento"
-
-#: t_options.h:69
-msgid "Image Quality"
-msgstr "Calidad de imagen"
-
-#: t_options.h:77
-msgid "Texture color depth"
-msgstr "Profundidad de color de textura"
-
-#: t_options.h:78
-msgid "Prefer frame buffer color depth"
-msgstr "Preferir profundidad de color del \"framebuffer\""
-
-#: t_options.h:79
-msgid "Prefer 32 bits per texel"
-msgstr "Preferir 32 bits por texel"
-
-#: t_options.h:80
-msgid "Prefer 16 bits per texel"
-msgstr "Preferir 16 bits por texel"
-
-#: t_options.h:81
-msgid "Force 16 bits per texel"
-msgstr "Forzar a 16 bits por texel"
-
-#: t_options.h:87
-msgid "Initial maximum value for anisotropic texture filtering"
-msgstr "Valor máximo inicial para filtrado anisotrópico de textura"
-
-#: t_options.h:92
-msgid "Forbid negative texture LOD bias"
-msgstr "Prohibir valores negativos de Nivel De Detalle (LOD) de texturas"
-
-#: t_options.h:97
-msgid "Enable S3TC texture compression even if software support is not available"
-msgstr "Activar la compresión de texturas S3TC incluso si el soporte por software no está disponible"
-
-#: t_options.h:104
-msgid "Initial color reduction method"
-msgstr "Método inicial de reducción de color"
-
-#: t_options.h:105
-msgid "Round colors"
-msgstr "Colores redondeados"
-
-#: t_options.h:106
-msgid "Dither colors"
-msgstr "Colores suavizados"
-
-#: t_options.h:114
-msgid "Color rounding method"
-msgstr "Método de redondeo de colores"
-
-#: t_options.h:115
-msgid "Round color components downward"
-msgstr "Redondear hacia abajo los componentes de color"
-
-#: t_options.h:116
-msgid "Round to nearest color"
-msgstr "Redondear al color más cercano"
-
-#: t_options.h:125
-msgid "Color dithering method"
-msgstr "Método de suavizado de color"
-
-#: t_options.h:126
-msgid "Horizontal error diffusion"
-msgstr "Difusión de error horizontal"
-
-#: t_options.h:127
-msgid "Horizontal error diffusion, reset error at line start"
-msgstr "Difusión de error horizontal, reiniciar error al comienzo de línea"
-
-#: t_options.h:128
-msgid "Ordered 2D color dithering"
-msgstr "Suavizado de color 2D ordenado"
-
-#: t_options.h:134
-msgid "Floating point depth buffer"
-msgstr "Búfer de profundidad en coma flotante"
-
-#: t_options.h:140
-msgid "Performance"
-msgstr "Rendimiento"
-
-#: t_options.h:148
-msgid "TCL mode (Transformation, Clipping, Lighting)"
-msgstr "Modo TCL (Transformación, Recorte, Iluminación)"
-
-#: t_options.h:149
-msgid "Use software TCL pipeline"
-msgstr "Usar tubería TCL por software"
-
-#: t_options.h:150
-msgid "Use hardware TCL as first TCL pipeline stage"
-msgstr "Usar TCL por hardware en la primera fase de la tubería TCL"
-
-#: t_options.h:151
-msgid "Bypass the TCL pipeline"
-msgstr "Pasar por alto la tubería TCL"
-
-#: t_options.h:152
-msgid "Bypass the TCL pipeline with state-based machine code generated on-the-fly"
-msgstr "Pasar por alto la tubería TCL con código máquina basado en estados generado al vuelo"
-
-#: t_options.h:161
-msgid "Method to limit rendering latency"
-msgstr "Método para limitar la latencia de rénder"
-
-#: t_options.h:162
-msgid "Busy waiting for the graphics hardware"
-msgstr "Esperar activamente al hardware gráfico"
-
-#: t_options.h:163
-msgid "Sleep for brief intervals while waiting for the graphics hardware"
-msgstr "Dormir en intervalos cortos mientras se espera al hardware gráfico"
-
-#: t_options.h:164
-msgid "Let the graphics hardware emit a software interrupt and sleep"
-msgstr "Permitir que el hardware gráfico emita una interrupción de software y duerma"
-
-#: t_options.h:174
-msgid "Synchronization with vertical refresh (swap intervals)"
-msgstr "Sincronización con el refresco vertical (intervalos de intercambio)"
-
-#: t_options.h:175
-msgid "Never synchronize with vertical refresh, ignore application's choice"
-msgstr "No sincronizar nunca con el refresco vertical, ignorar la elección de la aplicación"
-
-#: t_options.h:176
-msgid "Initial swap interval 0, obey application's choice"
-msgstr "Intervalo de intercambio inicial 0, obedecer la elección de la aplicación"
-
-#: t_options.h:177
-msgid "Initial swap interval 1, obey application's choice"
-msgstr "Intervalo de intercambio inicial 1, obedecer la elección de la aplicación"
-
-#: t_options.h:178
-msgid ""
-"Always synchronize with vertical refresh, application chooses the minimum "
-"swap interval"
-msgstr "Sincronizar siempre con el refresco vertical, la aplicación elige el intervalo de intercambio mínimo"
-
-#: t_options.h:186
-msgid "Use HyperZ to boost performance"
-msgstr "Usar HyperZ para potenciar rendimiento"
-
-#: t_options.h:191
-msgid "Number of texture units used"
-msgstr "Número de unidades de textura usadas"
-
-#: t_options.h:196
-msgid "Enable hack to allow larger textures with texture compression on radeon/r200"
-msgstr "Activar \"hack\" para permitir texturas más grandes con compresión de textura activada en la Radeon/r200"
-
-#: t_options.h:201
-msgid "Texture filtering quality vs. speed, AKA “brilinear†texture filtering"
-msgstr "Calidad de filtrado de textura vs. velocidad, alias filtrado \"brilinear\" de textura"
-
-#: t_options.h:209
-msgid "Used types of texture memory"
-msgstr "Tipos de memoria de textura usados"
-
-#: t_options.h:210
-msgid "All available memory"
-msgstr "Toda la memoria disponible"
-
-#: t_options.h:211
-msgid "Only card memory (if available)"
-msgstr "Sólo la memoria de la tarjeta (si disponible)"
-
-#: t_options.h:212
-msgid "Only GART (AGP/PCIE) memory (if available)"
-msgstr "Sólo memoria GART (AGP/PCIE) (si disponible)"
-
-#: t_options.h:220
-msgid "Features that are not hardware-accelerated"
-msgstr "Características no aceleradas por hardware"
-
-#: t_options.h:224
-msgid "Enable extension GL_ARB_vertex_program"
-msgstr "Activar la extensión GL_ARB_vertex_program"
-
-#: t_options.h:229
-msgid "Enable extension GL_NV_vertex_program"
-msgstr "Activar extensión GL_NV_vertex_program"
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/fr.po b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/fr.po
deleted file mode 100644
index 19f3b4a4e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/fr.po
+++ /dev/null
@@ -1,225 +0,0 @@
-# French translations for DRI driver options.
-# Copyright (C) 2005 Stephane Marchesin
-# This file is distributed under the same license as the Mesa package.
-# Stephane Marchesin <marchesin@icps.u-strasbg.fr>, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Mesa 6.3\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-04-11 23:19+0200\n"
-"PO-Revision-Date: 2005-04-11 01:34+0200\n"
-"Last-Translator: Stephane Marchesin <marchesin@icps.u-strasbg.fr>\n"
-"Language-Team: French <fr@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: t_options.h:53
-msgid "Debugging"
-msgstr "Debogage"
-
-#: t_options.h:57
-msgid "Disable 3D acceleration"
-msgstr "Désactiver l'accélération 3D"
-
-#: t_options.h:62
-msgid "Show performance boxes"
-msgstr "Afficher les boîtes de performance"
-
-#: t_options.h:69
-msgid "Image Quality"
-msgstr "Qualité d'image"
-
-#: t_options.h:77
-msgid "Texture color depth"
-msgstr "Profondeur de texture"
-
-#: t_options.h:78
-msgid "Prefer frame buffer color depth"
-msgstr "Profondeur de couleur"
-
-#: t_options.h:79
-msgid "Prefer 32 bits per texel"
-msgstr "Préférer 32 bits par texel"
-
-#: t_options.h:80
-msgid "Prefer 16 bits per texel"
-msgstr "Prérérer 16 bits par texel"
-
-#: t_options.h:81
-msgid "Force 16 bits per texel"
-msgstr "Forcer 16 bits par texel"
-
-#: t_options.h:87
-msgid "Initial maximum value for anisotropic texture filtering"
-msgstr "Valeur maximale initiale pour le filtrage anisotropique de texture"
-
-#: t_options.h:92
-msgid "Forbid negative texture LOD bias"
-msgstr "Interdire le LOD bias negatif"
-
-#: t_options.h:97
-msgid ""
-"Enable S3TC texture compression even if software support is not available"
-msgstr ""
-"Activer la compression de texture S3TC même si le support logiciel est absent"
-
-#: t_options.h:104
-msgid "Initial color reduction method"
-msgstr "Technique de réduction de couleurs"
-
-#: t_options.h:105
-msgid "Round colors"
-msgstr "Arrondir les valeurs de couleur"
-
-#: t_options.h:106
-msgid "Dither colors"
-msgstr "Tramer les couleurs"
-
-#: t_options.h:114
-msgid "Color rounding method"
-msgstr "Méthode d'arrondi des couleurs"
-
-#: t_options.h:115
-msgid "Round color components downward"
-msgstr "Arrondi à l'inférieur"
-
-#: t_options.h:116
-msgid "Round to nearest color"
-msgstr "Arrondi au plus proche"
-
-#: t_options.h:125
-msgid "Color dithering method"
-msgstr "Méthode de tramage"
-
-#: t_options.h:126
-msgid "Horizontal error diffusion"
-msgstr "Diffusion d'erreur horizontale"
-
-#: t_options.h:127
-msgid "Horizontal error diffusion, reset error at line start"
-msgstr "Diffusion d'erreur horizontale, réinitialisé pour chaque ligne"
-
-#: t_options.h:128
-msgid "Ordered 2D color dithering"
-msgstr "Tramage ordonné des couleurs"
-
-#: t_options.h:134
-msgid "Floating point depth buffer"
-msgstr "Z-buffer en virgule flottante"
-
-#: t_options.h:140
-msgid "Performance"
-msgstr "Performance"
-
-#: t_options.h:148
-msgid "TCL mode (Transformation, Clipping, Lighting)"
-msgstr "Mode de TCL (Transformation, Clipping, Eclairage)"
-
-#: t_options.h:149
-msgid "Use software TCL pipeline"
-msgstr "Utiliser un pipeline TCL logiciel"
-
-#: t_options.h:150
-msgid "Use hardware TCL as first TCL pipeline stage"
-msgstr "Utiliser le TCL matériel pour le premier niveau de pipeline"
-
-#: t_options.h:151
-msgid "Bypass the TCL pipeline"
-msgstr "Court-circuiter le pipeline TCL"
-
-#: t_options.h:152
-msgid ""
-"Bypass the TCL pipeline with state-based machine code generated on-the-fly"
-msgstr ""
-"Court-circuiter le pipeline TCL par une machine à états qui génère le code"
-"de TCL à la volée"
-
-#: t_options.h:161
-msgid "Method to limit rendering latency"
-msgstr "Méthode d'attente de la carte graphique"
-
-#: t_options.h:162
-msgid "Busy waiting for the graphics hardware"
-msgstr "Attente active de la carte graphique"
-
-#: t_options.h:163
-msgid "Sleep for brief intervals while waiting for the graphics hardware"
-msgstr "Attente utilisant usleep()"
-
-#: t_options.h:164
-msgid "Let the graphics hardware emit a software interrupt and sleep"
-msgstr "Utiliser les interruptions"
-
-#: t_options.h:174
-msgid "Synchronization with vertical refresh (swap intervals)"
-msgstr "Synchronisation de l'affichage avec le balayage vertical"
-
-#: t_options.h:175
-msgid "Never synchronize with vertical refresh, ignore application's choice"
-msgstr "Ne jamais synchroniser avec le balayage vertical, ignorer le choix de l'application"
-
-#: t_options.h:176
-msgid "Initial swap interval 0, obey application's choice"
-msgstr "Ne pas synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application"
-
-#: t_options.h:177
-msgid "Initial swap interval 1, obey application's choice"
-msgstr "Synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application"
-
-#: t_options.h:178
-msgid ""
-"Always synchronize with vertical refresh, application chooses the minimum "
-"swap interval"
-msgstr ""
-"Toujours synchroniser avec le balayage vertical, l'application choisit l'intervalle minimal"
-
-#: t_options.h:186
-msgid "Use HyperZ to boost performance"
-msgstr "Utiliser le HyperZ pour améliorer les performances"
-
-#: t_options.h:191
-msgid "Number of texture units used"
-msgstr "Nombre d'unités de texture"
-
-#: t_options.h:196
-msgid ""
-"Enable hack to allow larger textures with texture compression on radeon/r200"
-msgstr ""
-"Activer le hack permettant l'utilisation de textures de grande taille avec la "
-"compression de textures sur radeon/r200"
-
-#: t_options.h:201
-msgid "Texture filtering quality vs. speed, AKA “brilinear†texture filtering"
-msgstr ""
-"Qualité/performance du filtrage trilinéaire de texture (filtrage brilinéaire)"
-
-#: t_options.h:209
-msgid "Used types of texture memory"
-msgstr "Types de mémoire de texture"
-
-#: t_options.h:210
-msgid "All available memory"
-msgstr "Utiliser toute la mémoire disponible"
-
-#: t_options.h:211
-msgid "Only card memory (if available)"
-msgstr "Utiliser uniquement la mémoire graphique (si disponible)"
-
-#: t_options.h:212
-msgid "Only GART (AGP/PCIE) memory (if available)"
-msgstr "Utiliser uniquement la mémoire GART (AGP/PCIE) (si disponible)"
-
-#: t_options.h:220
-msgid "Features that are not hardware-accelerated"
-msgstr "Fonctionnalités ne bénéficiant pas d'une accélération matérielle"
-
-#: t_options.h:224
-msgid "Enable extension GL_ARB_vertex_program"
-msgstr "Activer l'extension GL_ARB_vertex_program"
-
-#: t_options.h:229
-msgid "Enable extension GL_NV_vertex_program"
-msgstr "Activer l'extension GL_NV_vertex_program"
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py
deleted file mode 100644
index 7398c4cd0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import gettext
-import re
-
-# List of supported languages
-languages = sys.argv[1:]
-
-# Escape special characters in C strings
-def escapeCString (s):
- escapeSeqs = {'\a' : '\\a', '\b' : '\\b', '\f' : '\\f', '\n' : '\\n',
- '\r' : '\\r', '\t' : '\\t', '\v' : '\\v', '\\' : '\\\\'}
- # " -> '' is a hack. Quotes (") aren't possible in XML attributes.
- # Better use Unicode characters for typographic quotes in option
- # descriptions and translations.
- i = 0
- r = ''
- while i < len(s):
- # Special case: escape double quote with \u201c or \u201d, depending
- # on whether it's an open or close quote. This is needed because plain
- # double quotes are not possible in XML attributes.
- if s[i] == '"':
- if i == len(s)-1 or s[i+1].isspace():
- # close quote
- q = u'\u201c'
- else:
- # open quote
- q = u'\u201d'
- r = r + q
- elif escapeSeqs.has_key(s[i]):
- r = r + escapeSeqs[s[i]]
- else:
- r = r + s[i]
- i = i + 1
- return r
-
-# Expand escape sequences in C strings (needed for gettext lookup)
-def expandCString (s):
- escapeSeqs = {'a' : '\a', 'b' : '\b', 'f' : '\f', 'n' : '\n',
- 'r' : '\r', 't' : '\t', 'v' : '\v',
- '"' : '"', '\\' : '\\'}
- i = 0
- escape = False
- hexa = False
- octa = False
- num = 0
- digits = 0
- r = ''
- while i < len(s):
- if not escape:
- if s[i] == '\\':
- escape = True
- else:
- r = r + s[i]
- elif hexa:
- if (s[i] >= '0' and s[i] <= '9') or \
- (s[i] >= 'a' and s[i] <= 'f') or \
- (s[i] >= 'A' and s[i] <= 'F'):
- num = num * 16 + int(s[i],16)
- digits = digits + 1
- else:
- digits = 2
- if digits >= 2:
- hexa = False
- escape = False
- r = r + chr(num)
- elif octa:
- if s[i] >= '0' and s[i] <= '7':
- num = num * 8 + int(s[i],8)
- digits = digits + 1
- else:
- digits = 3
- if digits >= 3:
- octa = False
- escape = False
- r = r + chr(num)
- else:
- if escapeSeqs.has_key(s[i]):
- r = r + escapeSeqs[s[i]]
- escape = False
- elif s[i] >= '0' and s[i] <= '7':
- octa = True
- num = int(s[i],8)
- if num <= 3:
- digits = 1
- else:
- digits = 2
- elif s[i] == 'x' or s[i] == 'X':
- hexa = True
- num = 0
- digits = 0
- else:
- r = r + s[i]
- escape = False
- i = i + 1
- return r
-
-# Expand matches. The first match is always a DESC or DESC_BEGIN match.
-# Subsequent matches are ENUM matches.
-#
-# DESC, DESC_BEGIN format: \1 \2=<lang> \3 \4=gettext(" \5=<text> \6=") \7
-# ENUM format: \1 \2=gettext(" \3=<text> \4=") \5
-def expandMatches (matches, translations, end=None):
- assert len(matches) > 0
- nTranslations = len(translations)
- i = 0
- # Expand the description+enums for all translations
- for lang,trans in translations:
- i = i + 1
- # Make sure that all but the last line of a simple description
- # are extended with a backslash.
- suffix = ''
- if len(matches) == 1 and i < len(translations) and \
- not matches[0].expand (r'\7').endswith('\\'):
- suffix = ' \\'
- # Expand the description line. Need to use ugettext in order to allow
- # non-ascii unicode chars in the original English descriptions.
- text = escapeCString (trans.ugettext (unicode (expandCString (
- matches[0].expand (r'\5')), "utf-8"))).encode("utf-8")
- print matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix
- # Expand any subsequent enum lines
- for match in matches[1:]:
- text = escapeCString (trans.ugettext (unicode (expandCString (
- match.expand (r'\3')), "utf-8"))).encode("utf-8")
- print match.expand (r'\1"' + text + r'"\5')
-
- # Expand description end
- if end:
- print end,
-
-# Compile a list of translation classes to all supported languages.
-# The first translation is always a NullTranslations.
-translations = [("en", gettext.NullTranslations())]
-for lang in languages:
- try:
- trans = gettext.translation ("options", ".", [lang])
- except IOError:
- sys.stderr.write ("Warning: language '%s' not found.\n" % lang)
- continue
- translations.append ((lang, trans))
-
-# Regular expressions:
-reLibintl_h = re.compile (r'#\s*include\s*<libintl.h>')
-reDESC = re.compile (r'(\s*DRI_CONF_DESC\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$')
-reDESC_BEGIN = re.compile (r'(\s*DRI_CONF_DESC_BEGIN\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$')
-reENUM = re.compile (r'(\s*DRI_CONF_ENUM\s*\([^,]+,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$')
-reDESC_END = re.compile (r'\s*DRI_CONF_DESC_END')
-
-# Print a header
-print \
-"/***********************************************************************\n" \
-" *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! ***\n" \
-" ***********************************************************************/"
-
-# Process the options template and generate options.h with all
-# translations.
-template = file ("t_options.h", "r")
-descMatches = []
-for line in template:
- if len(descMatches) > 0:
- matchENUM = reENUM .match (line)
- matchDESC_END = reDESC_END.match (line)
- if matchENUM:
- descMatches.append (matchENUM)
- elif matchDESC_END:
- expandMatches (descMatches, translations, line)
- descMatches = []
- else:
- sys.stderr.write (
- "Warning: unexpected line inside description dropped:\n%s\n" \
- % line)
- continue
- if reLibintl_h.search (line):
- # Ignore (comment out) #include <libintl.h>
- print "/* %s * commented out by gen_xmlpool.py */" % line
- continue
- matchDESC = reDESC .match (line)
- matchDESC_BEGIN = reDESC_BEGIN.match (line)
- if matchDESC:
- assert len(descMatches) == 0
- expandMatches ([matchDESC], translations)
- elif matchDESC_BEGIN:
- assert len(descMatches) == 0
- descMatches = [matchDESC_BEGIN]
- else:
- print line,
-
-if len(descMatches) > 0:
- sys.stderr.write ("Warning: unterminated description at end of file.\n")
- expandMatches (descMatches, translations)
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/nl.po b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/nl.po
deleted file mode 100644
index 1e4cf167b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/nl.po
+++ /dev/null
@@ -1,230 +0,0 @@
-# Dutch translations for PACKAGE package.
-# Copyright (C) 2005 THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# <manfred.stienstra@dwerg.net>, 2005.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-04-12 20:09+0200\n"
-"PO-Revision-Date: 2005-04-12 20:09+0200\n"
-"Last-Translator: Manfred Stienstra <manfred.stienstra@dwerg.net>\n"
-"Language-Team: Dutch <vertaling@nl.linux.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#: t_options.h:53
-msgid "Debugging"
-msgstr "Debuggen"
-
-#: t_options.h:57
-msgid "Disable 3D acceleration"
-msgstr "3D versnelling uitschakelen"
-
-#: t_options.h:62
-msgid "Show performance boxes"
-msgstr "Laat prestatie boxjes zien"
-
-#: t_options.h:69
-msgid "Image Quality"
-msgstr "Beeldkwaliteit"
-
-#: t_options.h:77
-msgid "Texture color depth"
-msgstr "Textuurkleurendiepte"
-
-#: t_options.h:78
-msgid "Prefer frame buffer color depth"
-msgstr "Prefereer kaderbufferkleurdiepte"
-
-#: t_options.h:79
-msgid "Prefer 32 bits per texel"
-msgstr "Prefereer 32 bits per texel"
-
-#: t_options.h:80
-msgid "Prefer 16 bits per texel"
-msgstr "Prefereer 16 bits per texel"
-
-#: t_options.h:81
-msgid "Force 16 bits per texel"
-msgstr "Dwing 16 bits per texel af"
-
-#: t_options.h:87
-msgid "Initial maximum value for anisotropic texture filtering"
-msgstr "Initïele maximum waarde voor anisotrophische textuur filtering"
-
-#: t_options.h:92
-msgid "Forbid negative texture LOD bias"
-msgstr "Verbied negatief niveau detailonderscheid (LOD) van texturen"
-
-#: t_options.h:97
-msgid ""
-"Enable S3TC texture compression even if software support is not available"
-msgstr ""
-"Schakel S3TC textuurcompressie in, zelfs als softwareondersteuning niet "
-"aanwezig is"
-
-#: t_options.h:104
-msgid "Initial color reduction method"
-msgstr "Initïele kleurreductie methode"
-
-#: t_options.h:105
-msgid "Round colors"
-msgstr "Rond kleuren af"
-
-#: t_options.h:106
-msgid "Dither colors"
-msgstr "Rasteriseer kleuren"
-
-#: t_options.h:114
-msgid "Color rounding method"
-msgstr "Kleurafrondingmethode"
-
-#: t_options.h:115
-msgid "Round color components downward"
-msgstr "Rond kleurencomponenten af naar beneden"
-
-#: t_options.h:116
-msgid "Round to nearest color"
-msgstr "Rond af naar dichtsbijzijnde kleur"
-
-#: t_options.h:125
-msgid "Color dithering method"
-msgstr "Kleurrasteriseringsmethode"
-
-#: t_options.h:126
-msgid "Horizontal error diffusion"
-msgstr "Horizontale foutdiffusie"
-
-#: t_options.h:127
-msgid "Horizontal error diffusion, reset error at line start"
-msgstr "Horizontale foutdiffusie, zet fout bij lijnbegin terug"
-
-#: t_options.h:128
-msgid "Ordered 2D color dithering"
-msgstr "Geordende 2D kleurrasterisering"
-
-#: t_options.h:134
-msgid "Floating point depth buffer"
-msgstr "Dieptebuffer als commagetal"
-
-#: t_options.h:140
-msgid "Performance"
-msgstr "Prestatie"
-
-#: t_options.h:148
-msgid "TCL mode (Transformation, Clipping, Lighting)"
-msgstr "TCL-modus (Transformatie, Clipping, Licht)"
-
-#: t_options.h:149
-msgid "Use software TCL pipeline"
-msgstr "Gebruik software TCL pijpleiding"
-
-#: t_options.h:150
-msgid "Use hardware TCL as first TCL pipeline stage"
-msgstr "Gebruik hardware TCL as eerste TCL pijpleiding trap"
-
-#: t_options.h:151
-msgid "Bypass the TCL pipeline"
-msgstr "Omzeil de TCL pijpleiding"
-
-#: t_options.h:152
-msgid ""
-"Bypass the TCL pipeline with state-based machine code generated on-the-fly"
-msgstr ""
-"Omzeil de TCL pijpleiding met staatgebaseerde machinecode die tijdens "
-"executie gegenereerd wordt"
-
-#: t_options.h:161
-msgid "Method to limit rendering latency"
-msgstr "Methode om beeldopbouwvertraging te onderdrukken"
-
-#: t_options.h:162
-msgid "Busy waiting for the graphics hardware"
-msgstr "Actief wachten voor de grafische hardware"
-
-#: t_options.h:163
-msgid "Sleep for brief intervals while waiting for the graphics hardware"
-msgstr "Slaap voor korte intervallen tijdens het wachten op de grafische "
-"hardware"
-
-#: t_options.h:164
-msgid "Let the graphics hardware emit a software interrupt and sleep"
-msgstr "Laat de grafische hardware een software onderbreking uitzenden en in "
-"slaap vallen"
-
-#: t_options.h:174
-msgid "Synchronization with vertical refresh (swap intervals)"
-msgstr "Synchronisatie met verticale verversing (interval omwisselen)"
-
-#: t_options.h:175
-msgid "Never synchronize with vertical refresh, ignore application's choice"
-msgstr "Nooit synchroniseren met verticale verversing, negeer de keuze van de "
-"applicatie"
-
-#: t_options.h:176
-msgid "Initial swap interval 0, obey application's choice"
-msgstr "Initïeel omwisselingsinterval 0, honoreer de keuze van de applicatie"
-
-#: t_options.h:177
-msgid "Initial swap interval 1, obey application's choice"
-msgstr "Initïeel omwisselingsinterval 1, honoreer de keuze van de applicatie"
-
-#: t_options.h:178
-msgid ""
-"Always synchronize with vertical refresh, application chooses the minimum "
-"swap interval"
-msgstr ""
-"Synchroniseer altijd met verticale verversing, de applicatie kiest het "
-"minimum omwisselingsinterval"
-
-#: t_options.h:186
-msgid "Use HyperZ to boost performance"
-msgstr "Gebruik HyperZ om de prestaties te verbeteren"
-
-#: t_options.h:191
-msgid "Number of texture units used"
-msgstr "Aantal textuureenheden in gebruik"
-
-#: t_options.h:196
-msgid ""
-"Enable hack to allow larger textures with texture compression on radeon/r200"
-msgstr ""
-"Schakel hack in om met textuurcompressie grotere texturen toe te staan op "
-"een radeon/r200"
-
-#: t_options.h:201
-msgid "Texture filtering quality vs. speed, AKA “brilinear†texture filtering"
-msgstr "Textuurfilterkwaliteit versus -snelheid, ookwel bekend als "
-"“brilineaire†textuurfiltering"
-
-#: t_options.h:209
-msgid "Used types of texture memory"
-msgstr "Gebruikte soorten textuurgeheugen"
-
-#: t_options.h:210
-msgid "All available memory"
-msgstr "Al het beschikbaar geheugen"
-
-#: t_options.h:211
-msgid "Only card memory (if available)"
-msgstr "Alleen geheugen op de kaart (als het aanwezig is)"
-
-#: t_options.h:212
-msgid "Only GART (AGP/PCIE) memory (if available)"
-msgstr "Alleen GART (AGP/PCIE) geheugen (als het aanwezig is)"
-
-#: t_options.h:220
-msgid "Features that are not hardware-accelerated"
-msgstr "Eigenschappen die niet hardwareversneld zijn"
-
-#: t_options.h:224
-msgid "Enable extension GL_ARB_vertex_program"
-msgstr "Zet uitbreiding GL_ARB_vertex_program aan"
-
-#: t_options.h:229
-msgid "Enable extension GL_NV_vertex_program"
-msgstr "Zet uitbreiding GL_NV_vertex_program aan"
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/options.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/options.h
deleted file mode 100644
index 86d17d024..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/options.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/***********************************************************************
- *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! ***
- ***********************************************************************/
-/*
- * 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 t_options.h
- * \brief Templates of common options
- * \author Felix Kuehling
- *
- * This file defines macros for common options that can be used to
- * construct driConfigOptions in the drivers. This file is only a
- * template containing English descriptions for options wrapped in
- * gettext(). xgettext can be used to extract translatable
- * strings. These strings can then be translated by anyone familiar
- * with GNU gettext. gen_xmlpool.py takes this template and fills in
- * all the translations. The result (options.h) is included by
- * xmlpool.h which in turn can be included by drivers.
- *
- * The macros used to describe otions in this file are defined in
- * ../xmlpool.h.
- */
-
-/* This is needed for xgettext to extract translatable strings.
- * gen_xmlpool.py will discard this line. */
-/* #include <libintl.h>
- * commented out by gen_xmlpool.py */
-
-/*
- * predefined option sections and options with multi-lingual descriptions
- */
-
-/** \brief Debugging options */
-#define DRI_CONF_SECTION_DEBUG \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,"Debugging") \
- DRI_CONF_DESC(de,"Fehlersuche") \
- DRI_CONF_DESC(es,"Depurando") \
- DRI_CONF_DESC(nl,"Debuggen") \
- DRI_CONF_DESC(fr,"Debogage")
-
-#define DRI_CONF_NO_RAST(def) \
-DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
- DRI_CONF_DESC(en,"Disable 3D acceleration") \
- DRI_CONF_DESC(de,"3D-Beschleunigung abschalten") \
- DRI_CONF_DESC(es,"Desactivar aceleración 3D") \
- DRI_CONF_DESC(nl,"3D versnelling uitschakelen") \
- DRI_CONF_DESC(fr,"Désactiver l'accélération 3D") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_PERFORMANCE_BOXES(def) \
-DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
- DRI_CONF_DESC(en,"Show performance boxes") \
- DRI_CONF_DESC(de,"Zeige Performanceboxen") \
- DRI_CONF_DESC(es,"Mostrar cajas de rendimiento") \
- DRI_CONF_DESC(nl,"Laat prestatie boxjes zien") \
- DRI_CONF_DESC(fr,"Afficher les boîtes de performance") \
-DRI_CONF_OPT_END
-
-
-/** \brief Texture-related options */
-#define DRI_CONF_SECTION_QUALITY \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,"Image Quality") \
- DRI_CONF_DESC(de,"Bildqualität") \
- DRI_CONF_DESC(es,"Calidad de imagen") \
- DRI_CONF_DESC(nl,"Beeldkwaliteit") \
- DRI_CONF_DESC(fr,"Qualité d'image")
-
-#define DRI_CONF_TEXTURE_DEPTH_FB 0
-#define DRI_CONF_TEXTURE_DEPTH_32 1
-#define DRI_CONF_TEXTURE_DEPTH_16 2
-#define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
-#define DRI_CONF_TEXTURE_DEPTH(def) \
-DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
- DRI_CONF_DESC_BEGIN(en,"Texture color depth") \
- DRI_CONF_ENUM(0,"Prefer frame buffer color depth") \
- DRI_CONF_ENUM(1,"Prefer 32 bits per texel") \
- DRI_CONF_ENUM(2,"Prefer 16 bits per texel") \
- DRI_CONF_ENUM(3,"Force 16 bits per texel") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Texturfarbtiefe") \
- DRI_CONF_ENUM(0,"Bevorzuge Farbtiefe des Framebuffers") \
- DRI_CONF_ENUM(1,"Bevorzuge 32 bits pro Texel") \
- DRI_CONF_ENUM(2,"Bevorzuge 16 bits pro Texel") \
- DRI_CONF_ENUM(3,"Erzwinge 16 bits pro Texel") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Profundidad de color de textura") \
- DRI_CONF_ENUM(0,"Preferir profundidad de color del â€framebuffer“") \
- DRI_CONF_ENUM(1,"Preferir 32 bits por texel") \
- DRI_CONF_ENUM(2,"Preferir 16 bits por texel") \
- DRI_CONF_ENUM(3,"Forzar a 16 bits por texel") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Textuurkleurendiepte") \
- DRI_CONF_ENUM(0,"Prefereer kaderbufferkleurdiepte") \
- DRI_CONF_ENUM(1,"Prefereer 32 bits per texel") \
- DRI_CONF_ENUM(2,"Prefereer 16 bits per texel") \
- DRI_CONF_ENUM(3,"Dwing 16 bits per texel af") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Profondeur de texture") \
- DRI_CONF_ENUM(0,"Profondeur de couleur") \
- DRI_CONF_ENUM(1,"Préférer 32 bits par texel") \
- DRI_CONF_ENUM(2,"Prérérer 16 bits par texel") \
- DRI_CONF_ENUM(3,"Forcer 16 bits par texel") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \
-DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
- DRI_CONF_DESC(en,"Initial maximum value for anisotropic texture filtering") \
- DRI_CONF_DESC(de,"Initialer Maximalwert für anisotropische Texturfilterung") \
- DRI_CONF_DESC(es,"Valor máximo inicial para filtrado anisotrópico de textura") \
- DRI_CONF_DESC(nl,"Initïele maximum waarde voor anisotrophische textuur filtering") \
- DRI_CONF_DESC(fr,"Valeur maximale initiale pour le filtrage anisotropique de texture") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_NO_NEG_LOD_BIAS(def) \
-DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
- DRI_CONF_DESC(en,"Forbid negative texture LOD bias") \
- DRI_CONF_DESC(de,"Verbiete negative Textur-Detailgradverschiebung") \
- DRI_CONF_DESC(es,"Prohibir valores negativos de Nivel De Detalle (LOD) de texturas") \
- DRI_CONF_DESC(nl,"Verbied negatief niveau detailonderscheid (LOD) van texturen") \
- DRI_CONF_DESC(fr,"Interdire le LOD bias negatif") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_FORCE_S3TC_ENABLE(def) \
-DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \
- DRI_CONF_DESC(en,"Enable S3TC texture compression even if software support is not available") \
- DRI_CONF_DESC(de,"Aktiviere S3TC Texturkomprimierung auch wenn die nötige Softwareunterstützung fehlt") \
- DRI_CONF_DESC(es,"Activar la compresión de texturas S3TC incluso si el soporte por software no está disponible") \
- DRI_CONF_DESC(nl,"Schakel S3TC textuurcompressie in, zelfs als softwareondersteuning niet aanwezig is") \
- DRI_CONF_DESC(fr,"Activer la compression de texture S3TC même si le support logiciel est absent") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_COLOR_REDUCTION_ROUND 0
-#define DRI_CONF_COLOR_REDUCTION_DITHER 1
-#define DRI_CONF_COLOR_REDUCTION(def) \
-DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
- DRI_CONF_DESC_BEGIN(en,"Initial color reduction method") \
- DRI_CONF_ENUM(0,"Round colors") \
- DRI_CONF_ENUM(1,"Dither colors") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Initiale Farbreduktionsmethode") \
- DRI_CONF_ENUM(0,"Farben runden") \
- DRI_CONF_ENUM(1,"Farben rastern") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Método inicial de reducción de color") \
- DRI_CONF_ENUM(0,"Colores redondeados") \
- DRI_CONF_ENUM(1,"Colores suavizados") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Initïele kleurreductie methode") \
- DRI_CONF_ENUM(0,"Rond kleuren af") \
- DRI_CONF_ENUM(1,"Rasteriseer kleuren") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Technique de réduction de couleurs") \
- DRI_CONF_ENUM(0,"Arrondir les valeurs de couleur") \
- DRI_CONF_ENUM(1,"Tramer les couleurs") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_ROUND_TRUNC 0
-#define DRI_CONF_ROUND_ROUND 1
-#define DRI_CONF_ROUND_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
- DRI_CONF_DESC_BEGIN(en,"Color rounding method") \
- DRI_CONF_ENUM(0,"Round color components downward") \
- DRI_CONF_ENUM(1,"Round to nearest color") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Farbrundungsmethode") \
- DRI_CONF_ENUM(0,"Farbkomponenten abrunden") \
- DRI_CONF_ENUM(1,"Zur ähnlichsten Farbe runden") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Método de redondeo de colores") \
- DRI_CONF_ENUM(0,"Redondear hacia abajo los componentes de color") \
- DRI_CONF_ENUM(1,"Redondear al color más cercano") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Kleurafrondingmethode") \
- DRI_CONF_ENUM(0,"Rond kleurencomponenten af naar beneden") \
- DRI_CONF_ENUM(1,"Rond af naar dichtsbijzijnde kleur") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Méthode d'arrondi des couleurs") \
- DRI_CONF_ENUM(0,"Arrondi à l'inférieur") \
- DRI_CONF_ENUM(1,"Arrondi au plus proche") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_DITHER_XERRORDIFF 0
-#define DRI_CONF_DITHER_XERRORDIFFRESET 1
-#define DRI_CONF_DITHER_ORDERED 2
-#define DRI_CONF_DITHER_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
- DRI_CONF_DESC_BEGIN(en,"Color dithering method") \
- DRI_CONF_ENUM(0,"Horizontal error diffusion") \
- DRI_CONF_ENUM(1,"Horizontal error diffusion, reset error at line start") \
- DRI_CONF_ENUM(2,"Ordered 2D color dithering") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Farbrasterungsmethode") \
- DRI_CONF_ENUM(0,"Horizontale Fehlerstreuung") \
- DRI_CONF_ENUM(1,"Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen") \
- DRI_CONF_ENUM(2,"Geordnete 2D Farbrasterung") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Método de suavizado de color") \
- DRI_CONF_ENUM(0,"Difusión de error horizontal") \
- DRI_CONF_ENUM(1,"Difusión de error horizontal, reiniciar error al comienzo de línea") \
- DRI_CONF_ENUM(2,"Suavizado de color 2D ordenado") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Kleurrasteriseringsmethode") \
- DRI_CONF_ENUM(0,"Horizontale foutdiffusie") \
- DRI_CONF_ENUM(1,"Horizontale foutdiffusie, zet fout bij lijnbegin terug") \
- DRI_CONF_ENUM(2,"Geordende 2D kleurrasterisering") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Méthode de tramage") \
- DRI_CONF_ENUM(0,"Diffusion d'erreur horizontale") \
- DRI_CONF_ENUM(1,"Diffusion d'erreur horizontale, réinitialisé pour chaque ligne") \
- DRI_CONF_ENUM(2,"Tramage ordonné des couleurs") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_FLOAT_DEPTH(def) \
-DRI_CONF_OPT_BEGIN(float_depth,bool,def) \
- DRI_CONF_DESC(en,"Floating point depth buffer") \
- DRI_CONF_DESC(de,"Fließkomma z-Puffer") \
- DRI_CONF_DESC(es,"Búfer de profundidad en coma flotante") \
- DRI_CONF_DESC(nl,"Dieptebuffer als commagetal") \
- DRI_CONF_DESC(fr,"Z-buffer en virgule flottante") \
-DRI_CONF_OPT_END
-
-/** \brief Performance-related options */
-#define DRI_CONF_SECTION_PERFORMANCE \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,"Performance") \
- DRI_CONF_DESC(de,"Leistung") \
- DRI_CONF_DESC(es,"Rendimiento") \
- DRI_CONF_DESC(nl,"Prestatie") \
- DRI_CONF_DESC(fr,"Performance")
-
-#define DRI_CONF_TCL_SW 0
-#define DRI_CONF_TCL_PIPELINED 1
-#define DRI_CONF_TCL_VTXFMT 2
-#define DRI_CONF_TCL_CODEGEN 3
-#define DRI_CONF_TCL_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
- DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \
- DRI_CONF_ENUM(0,"Use software TCL pipeline") \
- DRI_CONF_ENUM(1,"Use hardware TCL as first TCL pipeline stage") \
- DRI_CONF_ENUM(2,"Bypass the TCL pipeline") \
- DRI_CONF_ENUM(3,"Bypass the TCL pipeline with state-based machine code generated on-the-fly") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"TCL-Modus (Transformation, Clipping, Licht)") \
- DRI_CONF_ENUM(0,"Benutze die Software-TCL-Pipeline") \
- DRI_CONF_ENUM(1,"Benutze Hardware TCL als erste Stufe der TCL-Pipeline") \
- DRI_CONF_ENUM(2,"Umgehe die TCL-Pipeline") \
- DRI_CONF_ENUM(3,"Umgehe die TCL-Pipeline mit zur Laufzeit erzeugtem, zustandsbasiertem Maschinencode") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Modo TCL (Transformación, Recorte, Iluminación)") \
- DRI_CONF_ENUM(0,"Usar tubería TCL por software") \
- DRI_CONF_ENUM(1,"Usar TCL por hardware en la primera fase de la tubería TCL") \
- DRI_CONF_ENUM(2,"Pasar por alto la tubería TCL") \
- DRI_CONF_ENUM(3,"Pasar por alto la tubería TCL con código máquina basado en estados generado al vuelo") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"TCL-modus (Transformatie, Clipping, Licht)") \
- DRI_CONF_ENUM(0,"Gebruik software TCL pijpleiding") \
- DRI_CONF_ENUM(1,"Gebruik hardware TCL as eerste TCL pijpleiding trap") \
- DRI_CONF_ENUM(2,"Omzeil de TCL pijpleiding") \
- DRI_CONF_ENUM(3,"Omzeil de TCL pijpleiding met staatgebaseerde machinecode die tijdens executie gegenereerd wordt") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Mode de TCL (Transformation, Clipping, Eclairage)") \
- DRI_CONF_ENUM(0,"Utiliser un pipeline TCL logiciel") \
- DRI_CONF_ENUM(1,"Utiliser le TCL matériel pour le premier niveau de pipeline") \
- DRI_CONF_ENUM(2,"Court-circuiter le pipeline TCL") \
- DRI_CONF_ENUM(3,"Court-circuiter le pipeline TCL par une machine à états qui génère le codede TCL à la volée") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_FTHROTTLE_BUSY 0
-#define DRI_CONF_FTHROTTLE_USLEEPS 1
-#define DRI_CONF_FTHROTTLE_IRQS 2
-#define DRI_CONF_FTHROTTLE_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
- DRI_CONF_DESC_BEGIN(en,"Method to limit rendering latency") \
- DRI_CONF_ENUM(0,"Busy waiting for the graphics hardware") \
- DRI_CONF_ENUM(1,"Sleep for brief intervals while waiting for the graphics hardware") \
- DRI_CONF_ENUM(2,"Let the graphics hardware emit a software interrupt and sleep") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Methode zur Begrenzung der Bildverzögerung") \
- DRI_CONF_ENUM(0,"Aktives Warten auf die Grafikhardware") \
- DRI_CONF_ENUM(1,"Kurze Schlafintervalle beim Warten auf die Grafikhardware") \
- DRI_CONF_ENUM(2,"Die Grafikhardware eine Softwareunterbrechnung erzeugen lassen und schlafen") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Método para limitar la latencia de rénder") \
- DRI_CONF_ENUM(0,"Esperar activamente al hardware gráfico") \
- DRI_CONF_ENUM(1,"Dormir en intervalos cortos mientras se espera al hardware gráfico") \
- DRI_CONF_ENUM(2,"Permitir que el hardware gráfico emita una interrupción de software y duerma") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Methode om beeldopbouwvertraging te onderdrukken") \
- DRI_CONF_ENUM(0,"Actief wachten voor de grafische hardware") \
- DRI_CONF_ENUM(1,"Slaap voor korte intervallen tijdens het wachten op de grafische hardware") \
- DRI_CONF_ENUM(2,"Laat de grafische hardware een software onderbreking uitzenden en in slaap vallen") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Méthode d'attente de la carte graphique") \
- DRI_CONF_ENUM(0,"Attente active de la carte graphique") \
- DRI_CONF_ENUM(1,"Attente utilisant usleep()") \
- DRI_CONF_ENUM(2,"Utiliser les interruptions") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_VBLANK_NEVER 0
-#define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
-#define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
-#define DRI_CONF_VBLANK_ALWAYS_SYNC 3
-#define DRI_CONF_VBLANK_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
- DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \
- DRI_CONF_ENUM(0,"Never synchronize with vertical refresh, ignore application's choice") \
- DRI_CONF_ENUM(1,"Initial swap interval 0, obey application's choice") \
- DRI_CONF_ENUM(2,"Initial swap interval 1, obey application's choice") \
- DRI_CONF_ENUM(3,"Always synchronize with vertical refresh, application chooses the minimum swap interval") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Synchronisation mit der vertikalen Bildwiederholung") \
- DRI_CONF_ENUM(0,"Niemals mit der Bildwiederholung synchronisieren, Anweisungen der Anwendung ignorieren") \
- DRI_CONF_ENUM(1,"Initiales Bildinterval 0, Anweisungen der Anwendung gehorchen") \
- DRI_CONF_ENUM(2,"Initiales Bildinterval 1, Anweisungen der Anwendung gehorchen") \
- DRI_CONF_ENUM(3,"Immer mit der Bildwiederholung synchronisieren, Anwendung wählt das minmale Bildinterval") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Sincronización con el refresco vertical (intervalos de intercambio)") \
- DRI_CONF_ENUM(0,"No sincronizar nunca con el refresco vertical, ignorar la elección de la aplicación") \
- DRI_CONF_ENUM(1,"Intervalo de intercambio inicial 0, obedecer la elección de la aplicación") \
- DRI_CONF_ENUM(2,"Intervalo de intercambio inicial 1, obedecer la elección de la aplicación") \
- DRI_CONF_ENUM(3,"Sincronizar siempre con el refresco vertical, la aplicación elige el intervalo de intercambio mínimo") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Synchronisatie met verticale verversing (interval omwisselen)") \
- DRI_CONF_ENUM(0,"Nooit synchroniseren met verticale verversing, negeer de keuze van de applicatie") \
- DRI_CONF_ENUM(1,"Initïeel omwisselingsinterval 0, honoreer de keuze van de applicatie") \
- DRI_CONF_ENUM(2,"Initïeel omwisselingsinterval 1, honoreer de keuze van de applicatie") \
- DRI_CONF_ENUM(3,"Synchroniseer altijd met verticale verversing, de applicatie kiest het minimum omwisselingsinterval") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Synchronisation de l'affichage avec le balayage vertical") \
- DRI_CONF_ENUM(0,"Ne jamais synchroniser avec le balayage vertical, ignorer le choix de l'application") \
- DRI_CONF_ENUM(1,"Ne pas synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \
- DRI_CONF_ENUM(2,"Synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \
- DRI_CONF_ENUM(3,"Toujours synchroniser avec le balayage vertical, l'application choisit l'intervalle minimal") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_HYPERZ_DISABLED 0
-#define DRI_CONF_HYPERZ_ENABLED 1
-#define DRI_CONF_HYPERZ(def) \
-DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
- DRI_CONF_DESC(en,"Use HyperZ to boost performance") \
- DRI_CONF_DESC(de,"HyperZ zur Leistungssteigerung verwenden") \
- DRI_CONF_DESC(es,"Usar HyperZ para potenciar rendimiento") \
- DRI_CONF_DESC(nl,"Gebruik HyperZ om de prestaties te verbeteren") \
- DRI_CONF_DESC(fr,"Utiliser le HyperZ pour améliorer les performances") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
-DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
- DRI_CONF_DESC(en,"Number of texture units used") \
- DRI_CONF_DESC(de,"Anzahl der benutzten Textureinheiten") \
- DRI_CONF_DESC(es,"Número de unidades de textura usadas") \
- DRI_CONF_DESC(nl,"Aantal textuureenheden in gebruik") \
- DRI_CONF_DESC(fr,"Nombre d'unités de texture") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_TEXTURE_LEVEL_HACK(def) \
-DRI_CONF_OPT_BEGIN(texture_level_hack,bool,def) \
- DRI_CONF_DESC(en,"Enable hack to allow larger textures with texture compression on radeon/r200") \
- DRI_CONF_DESC(de,"Hack aktivieren, der mit Texturkompression auf radeon/r200 größere Texturen erlaubt") \
- DRI_CONF_DESC(es,"Activar â€hack“ para permitir texturas más grandes con compresión de textura activada en la Radeon/r200") \
- DRI_CONF_DESC(nl,"Schakel hack in om met textuurcompressie grotere texturen toe te staan op een radeon/r200") \
- DRI_CONF_DESC(fr,"Activer le hack permettant l'utilisation de textures de grande taille avec la compression de textures sur radeon/r200") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
-DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
- DRI_CONF_DESC(en,"Texture filtering quality vs. speed, AKA “brilinear†texture filtering") \
- DRI_CONF_DESC(de,"Texturfilterqualität versus -geschwindigkeit, auch bekannt als „brilineare“ Texturfilterung") \
- DRI_CONF_DESC(es,"Calidad de filtrado de textura vs. velocidad, alias filtrado â€brilinear“ de textura") \
- DRI_CONF_DESC(nl,"Textuurfilterkwaliteit versus -snelheid, ookwel bekend als “brilineaire†textuurfiltering") \
- DRI_CONF_DESC(fr,"Qualité/performance du filtrage trilinéaire de texture (filtrage brilinéaire)") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_TEXTURE_HEAPS_ALL 0
-#define DRI_CONF_TEXTURE_HEAPS_CARD 1
-#define DRI_CONF_TEXTURE_HEAPS_GART 2
-#define DRI_CONF_TEXTURE_HEAPS(def) \
-DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
- DRI_CONF_DESC_BEGIN(en,"Used types of texture memory") \
- DRI_CONF_ENUM(0,"All available memory") \
- DRI_CONF_ENUM(1,"Only card memory (if available)") \
- DRI_CONF_ENUM(2,"Only GART (AGP/PCIE) memory (if available)") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(de,"Benutzte Arten von Texturspeicher") \
- DRI_CONF_ENUM(0,"Aller verfügbarer Speicher") \
- DRI_CONF_ENUM(1,"Nur Grafikspeicher (falls verfügbar)") \
- DRI_CONF_ENUM(2,"Nur GART-Speicher (AGP/PCIE) (falls verfügbar)") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(es,"Tipos de memoria de textura usados") \
- DRI_CONF_ENUM(0,"Toda la memoria disponible") \
- DRI_CONF_ENUM(1,"Sólo la memoria de la tarjeta (si disponible)") \
- DRI_CONF_ENUM(2,"Sólo memoria GART (AGP/PCIE) (si disponible)") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(nl,"Gebruikte soorten textuurgeheugen") \
- DRI_CONF_ENUM(0,"Al het beschikbaar geheugen") \
- DRI_CONF_ENUM(1,"Alleen geheugen op de kaart (als het aanwezig is)") \
- DRI_CONF_ENUM(2,"Alleen GART (AGP/PCIE) geheugen (als het aanwezig is)") \
- DRI_CONF_DESC_END \
- DRI_CONF_DESC_BEGIN(fr,"Types de mémoire de texture") \
- DRI_CONF_ENUM(0,"Utiliser toute la mémoire disponible") \
- DRI_CONF_ENUM(1,"Utiliser uniquement la mémoire graphique (si disponible)") \
- DRI_CONF_ENUM(2,"Utiliser uniquement la mémoire GART (AGP/PCIE) (si disponible)") \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-/* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
- On cards where there is no documentation (r200) or on rasterization-only hardware). */
-#define DRI_CONF_SECTION_SOFTWARE \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,"Features that are not hardware-accelerated") \
- DRI_CONF_DESC(de,"Funktionalität, die nicht hardwarebeschleunigt ist") \
- DRI_CONF_DESC(es,"Características no aceleradas por hardware") \
- DRI_CONF_DESC(nl,"Eigenschappen die niet hardwareversneld zijn") \
- DRI_CONF_DESC(fr,"Fonctionnalités ne bénéficiant pas d'une accélération matérielle")
-
-#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
-DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
- DRI_CONF_DESC(en,"Enable extension GL_ARB_vertex_program") \
- DRI_CONF_DESC(de,"Erweiterung GL_ARB_vertex_program aktivieren") \
- DRI_CONF_DESC(es,"Activar la extensión GL_ARB_vertex_program") \
- DRI_CONF_DESC(nl,"Zet uitbreiding GL_ARB_vertex_program aan") \
- DRI_CONF_DESC(fr,"Activer l'extension GL_ARB_vertex_program") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_NV_VERTEX_PROGRAM(def) \
-DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
- DRI_CONF_DESC(en,"Enable extension GL_NV_vertex_program") \
- DRI_CONF_DESC(de,"Erweiterung GL_NV_vertex_program aktivieren") \
- DRI_CONF_DESC(es,"Activar extensión GL_NV_vertex_program") \
- DRI_CONF_DESC(nl,"Zet uitbreiding GL_NV_vertex_program aan") \
- DRI_CONF_DESC(fr,"Activer l'extension GL_NV_vertex_program") \
-DRI_CONF_OPT_END
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/t_options.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/t_options.h
deleted file mode 100644
index ab9245ee2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/xmlpool/t_options.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * 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 t_options.h
- * \brief Templates of common options
- * \author Felix Kuehling
- *
- * This file defines macros for common options that can be used to
- * construct driConfigOptions in the drivers. This file is only a
- * template containing English descriptions for options wrapped in
- * gettext(). xgettext can be used to extract translatable
- * strings. These strings can then be translated by anyone familiar
- * with GNU gettext. gen_xmlpool.py takes this template and fills in
- * all the translations. The result (options.h) is included by
- * xmlpool.h which in turn can be included by drivers.
- *
- * The macros used to describe otions in this file are defined in
- * ../xmlpool.h.
- */
-
-/* This is needed for xgettext to extract translatable strings.
- * gen_xmlpool.py will discard this line. */
-#include <libintl.h>
-
-/*
- * predefined option sections and options with multi-lingual descriptions
- */
-
-/** \brief Debugging options */
-#define DRI_CONF_SECTION_DEBUG \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,gettext("Debugging"))
-
-#define DRI_CONF_NO_RAST(def) \
-DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
- DRI_CONF_DESC(en,gettext("Disable 3D acceleration")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_PERFORMANCE_BOXES(def) \
-DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
- DRI_CONF_DESC(en,gettext("Show performance boxes")) \
-DRI_CONF_OPT_END
-
-
-/** \brief Texture-related options */
-#define DRI_CONF_SECTION_QUALITY \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,gettext("Image Quality"))
-
-#define DRI_CONF_TEXTURE_DEPTH_FB 0
-#define DRI_CONF_TEXTURE_DEPTH_32 1
-#define DRI_CONF_TEXTURE_DEPTH_16 2
-#define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
-#define DRI_CONF_TEXTURE_DEPTH(def) \
-DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
- DRI_CONF_DESC_BEGIN(en,gettext("Texture color depth")) \
- DRI_CONF_ENUM(0,gettext("Prefer frame buffer color depth")) \
- DRI_CONF_ENUM(1,gettext("Prefer 32 bits per texel")) \
- DRI_CONF_ENUM(2,gettext("Prefer 16 bits per texel")) \
- DRI_CONF_ENUM(3,gettext("Force 16 bits per texel")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \
-DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
- DRI_CONF_DESC(en,gettext("Initial maximum value for anisotropic texture filtering")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_NO_NEG_LOD_BIAS(def) \
-DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
- DRI_CONF_DESC(en,gettext("Forbid negative texture LOD bias")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_FORCE_S3TC_ENABLE(def) \
-DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \
- DRI_CONF_DESC(en,gettext("Enable S3TC texture compression even if software support is not available")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_COLOR_REDUCTION_ROUND 0
-#define DRI_CONF_COLOR_REDUCTION_DITHER 1
-#define DRI_CONF_COLOR_REDUCTION(def) \
-DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
- DRI_CONF_DESC_BEGIN(en,gettext("Initial color reduction method")) \
- DRI_CONF_ENUM(0,gettext("Round colors")) \
- DRI_CONF_ENUM(1,gettext("Dither colors")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_ROUND_TRUNC 0
-#define DRI_CONF_ROUND_ROUND 1
-#define DRI_CONF_ROUND_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
- DRI_CONF_DESC_BEGIN(en,gettext("Color rounding method")) \
- DRI_CONF_ENUM(0,gettext("Round color components downward")) \
- DRI_CONF_ENUM(1,gettext("Round to nearest color")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_DITHER_XERRORDIFF 0
-#define DRI_CONF_DITHER_XERRORDIFFRESET 1
-#define DRI_CONF_DITHER_ORDERED 2
-#define DRI_CONF_DITHER_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
- DRI_CONF_DESC_BEGIN(en,gettext("Color dithering method")) \
- DRI_CONF_ENUM(0,gettext("Horizontal error diffusion")) \
- DRI_CONF_ENUM(1,gettext("Horizontal error diffusion, reset error at line start")) \
- DRI_CONF_ENUM(2,gettext("Ordered 2D color dithering")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_FLOAT_DEPTH(def) \
-DRI_CONF_OPT_BEGIN(float_depth,bool,def) \
- DRI_CONF_DESC(en,gettext("Floating point depth buffer")) \
-DRI_CONF_OPT_END
-
-/** \brief Performance-related options */
-#define DRI_CONF_SECTION_PERFORMANCE \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,gettext("Performance"))
-
-#define DRI_CONF_TCL_SW 0
-#define DRI_CONF_TCL_PIPELINED 1
-#define DRI_CONF_TCL_VTXFMT 2
-#define DRI_CONF_TCL_CODEGEN 3
-#define DRI_CONF_TCL_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
- DRI_CONF_DESC_BEGIN(en,gettext("TCL mode (Transformation, Clipping, Lighting)")) \
- DRI_CONF_ENUM(0,gettext("Use software TCL pipeline")) \
- DRI_CONF_ENUM(1,gettext("Use hardware TCL as first TCL pipeline stage")) \
- DRI_CONF_ENUM(2,gettext("Bypass the TCL pipeline")) \
- DRI_CONF_ENUM(3,gettext("Bypass the TCL pipeline with state-based machine code generated on-the-fly")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_FTHROTTLE_BUSY 0
-#define DRI_CONF_FTHROTTLE_USLEEPS 1
-#define DRI_CONF_FTHROTTLE_IRQS 2
-#define DRI_CONF_FTHROTTLE_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
- DRI_CONF_DESC_BEGIN(en,gettext("Method to limit rendering latency")) \
- DRI_CONF_ENUM(0,gettext("Busy waiting for the graphics hardware")) \
- DRI_CONF_ENUM(1,gettext("Sleep for brief intervals while waiting for the graphics hardware")) \
- DRI_CONF_ENUM(2,gettext("Let the graphics hardware emit a software interrupt and sleep")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_VBLANK_NEVER 0
-#define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
-#define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
-#define DRI_CONF_VBLANK_ALWAYS_SYNC 3
-#define DRI_CONF_VBLANK_MODE(def) \
-DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
- DRI_CONF_DESC_BEGIN(en,gettext("Synchronization with vertical refresh (swap intervals)")) \
- DRI_CONF_ENUM(0,gettext("Never synchronize with vertical refresh, ignore application's choice")) \
- DRI_CONF_ENUM(1,gettext("Initial swap interval 0, obey application's choice")) \
- DRI_CONF_ENUM(2,gettext("Initial swap interval 1, obey application's choice")) \
- DRI_CONF_ENUM(3,gettext("Always synchronize with vertical refresh, application chooses the minimum swap interval")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_HYPERZ_DISABLED 0
-#define DRI_CONF_HYPERZ_ENABLED 1
-#define DRI_CONF_HYPERZ(def) \
-DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
- DRI_CONF_DESC(en,gettext("Use HyperZ to boost performance")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
-DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
- DRI_CONF_DESC(en,gettext("Number of texture units used")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_TEXTURE_LEVEL_HACK(def) \
-DRI_CONF_OPT_BEGIN(texture_level_hack,bool,def) \
- DRI_CONF_DESC(en,gettext("Enable hack to allow larger textures with texture compression on radeon/r200")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
-DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
- DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA “brilinear†texture filtering")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_TEXTURE_HEAPS_ALL 0
-#define DRI_CONF_TEXTURE_HEAPS_CARD 1
-#define DRI_CONF_TEXTURE_HEAPS_GART 2
-#define DRI_CONF_TEXTURE_HEAPS(def) \
-DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
- DRI_CONF_DESC_BEGIN(en,gettext("Used types of texture memory")) \
- DRI_CONF_ENUM(0,gettext("All available memory")) \
- DRI_CONF_ENUM(1,gettext("Only card memory (if available)")) \
- DRI_CONF_ENUM(2,gettext("Only GART (AGP/PCIE) memory (if available)")) \
- DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
-/* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
- On cards where there is no documentation (r200) or on rasterization-only hardware). */
-#define DRI_CONF_SECTION_SOFTWARE \
-DRI_CONF_SECTION_BEGIN \
- DRI_CONF_DESC(en,gettext("Features that are not hardware-accelerated"))
-
-#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
-DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
- DRI_CONF_DESC(en,gettext("Enable extension GL_ARB_vertex_program")) \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_NV_VERTEX_PROGRAM(def) \
-DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
- DRI_CONF_DESC(en,gettext("Enable extension GL_NV_vertex_program")) \
-DRI_CONF_OPT_END
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Doxyfile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Doxyfile
deleted file mode 100644
index 31256db83..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Doxyfile
+++ /dev/null
@@ -1,232 +0,0 @@
-# Doxyfile 1.3.2-Gideon
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = fb
-PROJECT_NUMBER = $VERSION$
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = /home/temp/Mesa/src/drv/fb
-FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.c++ \
- *.java \
- *.ii \
- *.ixx \
- *.ipp \
- *.i++ \
- *.inl \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.h++ \
- *.idl \
- *.odl \
- *.cs \
- *.C \
- *.H \
- *.tlh \
- *.diff \
- *.patch \
- *.moc \
- *.xpm
-RECURSIVE = yes
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS = *
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = YES
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = yes
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 1000
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME = search.cgi
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH = /usr/local/bin/
-EXT_DOC_PATHS =
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Makefile
deleted file mode 100644
index 12465c9f4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# src/mesa/drivers/dri/fb/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = fb_dri.so
-
-DRIVER_SOURCES = \
- fb_dri.c \
- fb_egl.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_dri.c
deleted file mode 100644
index e2ba66d2e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_dri.c
+++ /dev/null
@@ -1,786 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Minimal swrast-based dri loadable driver.
- *
- * Todo:
- * -- Use malloced (rather than framebuffer) memory for backbuffer
- * -- 32bpp is hardwared -- fix
- *
- * NOTES:
- * -- No mechanism for cliprects or resize notification --
- * assumes this is a fullscreen device.
- * -- No locking -- assumes this is the only driver accessing this
- * device.
- * -- Doesn't (yet) make use of any acceleration or other interfaces
- * provided by fb. Would be entirely happy working against any
- * fullscreen interface.
- * -- HOWEVER: only a small number of pixelformats are supported, and
- * the mechanism for choosing between them makes some assumptions
- * that may not be valid everywhere.
- */
-
-#include "driver.h"
-#include "drm.h"
-#include "utils.h"
-#include "drirenderbuffer.h"
-
-#include "buffers.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "drivers/common/driverfuncs.h"
-
-void fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
-
-typedef struct {
- GLcontext *glCtx; /* Mesa context */
-
- struct {
- __DRIcontextPrivate *context;
- __DRIscreenPrivate *screen;
- __DRIdrawablePrivate *drawable; /* drawable bound to this ctx */
- } dri;
-
-} fbContext, *fbContextPtr;
-
-#define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx))
-
-
-static const GLubyte *
-get_string(GLcontext *ctx, GLenum pname)
-{
- (void) ctx;
- switch (pname) {
- case GL_RENDERER:
- return (const GLubyte *) "Mesa dumb framebuffer";
- default:
- return NULL;
- }
-}
-
-
-static void
-update_state( GLcontext *ctx, GLuint new_state )
-{
- /* not much to do here - pass it on */
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-
-/**
- * Called by ctx->Driver.GetBufferSize from in core Mesa to query the
- * current framebuffer size.
- */
-static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- fbContextPtr fbmesa = FB_CONTEXT(ctx);
-
- *width = fbmesa->dri.drawable->w;
- *height = fbmesa->dri.drawable->h;
-}
-
-
-static void
-viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- _mesa_ResizeBuffersMESA();
-}
-
-
-static void
-init_core_functions( struct dd_function_table *functions )
-{
- functions->GetString = get_string;
- functions->UpdateState = update_state;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetBufferSize = get_buffer_size;
- functions->Viewport = viewport;
-
- functions->Clear = _swrast_Clear; /* could accelerate with blits */
-}
-
-
-/*
- * Generate code for span functions.
- */
-
-/* 24-bit BGR */
-#define NAME(PREFIX) PREFIX##_B8G8R8
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- driRenderbuffer *drb = (driRenderbuffer *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 3;
-#define INC_PIXEL_PTR(P) P += 3
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = VALUE[BCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[RCOMP]
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[2]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[0]; \
- DST[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-
-/* 32-bit BGRA */
-#define NAME(PREFIX) PREFIX##_B8G8R8A8
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- driRenderbuffer *drb = (driRenderbuffer *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 4;
-#define INC_PIXEL_PTR(P) P += 4
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = VALUE[BCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[RCOMP]; \
- DST[3] = VALUE[ACOMP]
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
- DST[0] = VALUE[BCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[RCOMP]; \
- DST[3] = 0xff
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[2]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[0]; \
- DST[ACOMP] = SRC[3]
-
-#include "swrast/s_spantemp.h"
-
-
-/* 16-bit BGR (XXX implement dithering someday) */
-#define NAME(PREFIX) PREFIX##_B5G6R5
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- driRenderbuffer *drb = (driRenderbuffer *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 2;
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) )
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = ( (((SRC[0]) >> 8) & 0xf8) | (((SRC[0]) >> 11) & 0x7) ); \
- DST[GCOMP] = ( (((SRC[0]) >> 3) & 0xfc) | (((SRC[0]) >> 5) & 0x3) ); \
- DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \
- DST[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-
-/* 15-bit BGR (XXX implement dithering someday) */
-#define NAME(PREFIX) PREFIX##_B5G5R5
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- driRenderbuffer *drb = (driRenderbuffer *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 2;
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 7) | (((VALUE[GCOMP]) & 0xf8) << 2) | ((VALUE[BCOMP]) >> 3) )
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = ( (((SRC[0]) >> 7) & 0xf8) | (((SRC[0]) >> 10) & 0x7) ); \
- DST[GCOMP] = ( (((SRC[0]) >> 2) & 0xf8) | (((SRC[0]) >> 5) & 0x7) ); \
- DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \
- DST[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-
-/* 8-bit color index */
-#define NAME(PREFIX) PREFIX##_CI8
-#define FORMAT GL_COLOR_INDEX8_EXT
-#define SPAN_VARS \
- driRenderbuffer *drb = (driRenderbuffer *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- *DST = VALUE[0]
-#define FETCH_PIXEL(DST, SRC) \
- DST = SRC[0]
-
-#include "swrast/s_spantemp.h"
-
-
-
-void
-fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- ASSERT(drb->Base.InternalFormat == GL_RGBA);
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = get_row_B5G6R5;
- drb->Base.GetValues = get_values_B5G6R5;
- drb->Base.PutRow = put_row_B5G6R5;
- drb->Base.PutMonoRow = put_mono_row_B5G6R5;
- drb->Base.PutRowRGB = put_row_rgb_B5G6R5;
- drb->Base.PutValues = put_values_B5G6R5;
- drb->Base.PutMonoValues = put_mono_values_B5G6R5;
- }
- else if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
- drb->Base.GetRow = get_row_B5G5R5;
- drb->Base.GetValues = get_values_B5G5R5;
- drb->Base.PutRow = put_row_B5G5R5;
- drb->Base.PutMonoRow = put_mono_row_B5G5R5;
- drb->Base.PutRowRGB = put_row_rgb_B5G5R5;
- drb->Base.PutValues = put_values_B5G5R5;
- drb->Base.PutMonoValues = put_mono_values_B5G5R5;
- }
- else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8
- && vis->alphaBits == 8) {
- drb->Base.GetRow = get_row_B8G8R8A8;
- drb->Base.GetValues = get_values_B8G8R8A8;
- drb->Base.PutRow = put_row_B8G8R8A8;
- drb->Base.PutMonoRow = put_mono_row_B8G8R8A8;
- drb->Base.PutRowRGB = put_row_rgb_B8G8R8A8;
- drb->Base.PutValues = put_values_B8G8R8A8;
- drb->Base.PutMonoValues = put_mono_values_B8G8R8A8;
- }
- else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8
- && vis->alphaBits == 0) {
- drb->Base.GetRow = get_row_B8G8R8;
- drb->Base.GetValues = get_values_B8G8R8;
- drb->Base.PutRow = put_row_B8G8R8;
- drb->Base.PutMonoRow = put_mono_row_B8G8R8;
- drb->Base.PutRowRGB = put_row_rgb_B8G8R8;
- drb->Base.PutValues = put_values_B8G8R8;
- drb->Base.PutMonoValues = put_mono_values_B8G8R8;
- }
- else if (vis->indexBits == 8) {
- drb->Base.GetRow = get_row_CI8;
- drb->Base.GetValues = get_values_CI8;
- drb->Base.PutRow = put_row_CI8;
- drb->Base.PutMonoRow = put_mono_row_CI8;
- drb->Base.PutValues = put_values_CI8;
- drb->Base.PutMonoValues = put_mono_values_CI8;
- }
- }
- else {
- /* hardware z/stencil/etc someday */
- }
-}
-
-
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-fbInitDriver( __DRIscreenPrivate *sPriv )
-{
- sPriv->private = NULL;
- return GL_TRUE;
-}
-
-static void
-fbDestroyScreen( __DRIscreenPrivate *sPriv )
-{
-}
-
-void fbSetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- /* NOP until SetBuffer is fully removed */
-}
-
-/* Create the device specific context.
- */
-static GLboolean
-fbCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- fbContextPtr fbmesa;
- GLcontext *ctx, *shareCtx;
- struct dd_function_table functions;
-
- assert(glVisual);
- assert(driContextPriv);
-
- /* Allocate the Fb context */
- fbmesa = (fbContextPtr) _mesa_calloc( sizeof(*fbmesa) );
- if ( !fbmesa )
- return GL_FALSE;
-
- /* Init default driver functions then plug in our FBdev-specific functions
- */
- _mesa_init_driver_functions(&functions);
- init_core_functions(&functions);
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((fbContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- ctx = fbmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *) fbmesa);
- if (!fbmesa->glCtx) {
- _mesa_free(fbmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = fbmesa;
-
- /* Create module contexts */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
- _swsetup_Wakeup( ctx );
-
-
- /* swrast init -- need to verify these tests - I just plucked the
- * numbers out of the air. (KW)
- */
- {
- struct swrast_device_driver *swdd;
- swdd = _swrast_GetDeviceDriverReference( ctx );
- swdd->SetBuffer = fbSetBuffer;
- }
-
- /* use default TCL pipeline */
- {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- }
-
- _mesa_enable_sw_extensions(ctx);
-
- return GL_TRUE;
-}
-
-
-static void
-fbDestroyContext( __DRIcontextPrivate *driContextPriv )
-{
- GET_CURRENT_CONTEXT(ctx);
- fbContextPtr fbmesa = (fbContextPtr) driContextPriv->driverPrivate;
- fbContextPtr current = ctx ? FB_CONTEXT(ctx) : NULL;
-
- /* check if we're deleting the currently bound context */
- if (fbmesa == current) {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- /* Free fb context resources */
- if ( fbmesa ) {
- _swsetup_DestroyContext( fbmesa->glCtx );
- _tnl_DestroyContext( fbmesa->glCtx );
- _ac_DestroyContext( fbmesa->glCtx );
- _swrast_DestroyContext( fbmesa->glCtx );
-
- /* free the Mesa context */
- fbmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context( fbmesa->glCtx );
-
- _mesa_free( fbmesa );
- }
-}
-
-
-/* Create and initialize the Mesa and driver specific pixmap buffer
- * data.
- */
-static GLboolean
-fbCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- struct gl_framebuffer *mesa_framebuffer;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- const GLboolean swDepth = mesaVis->depthBits > 0;
- const GLboolean swAlpha = mesaVis->alphaBits > 0;
- const GLboolean swAccum = mesaVis->accumRedBits > 0;
- const GLboolean swStencil = mesaVis->stencilBits > 0;
-
- mesa_framebuffer = _mesa_create_framebuffer(mesaVis);
- if (!mesa_framebuffer)
- return 0;
-
- /* XXX double-check these parameters (bpp vs cpp, etc) */
- {
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, driScrnPriv->fbBPP / 8,
- driScrnPriv->fbOrigin,
- driScrnPriv->fbStride);
- fbSetSpanFunctions(drb, mesaVis);
- drb->Base.Data = driScrnPriv->pFB;
- _mesa_add_renderbuffer(mesa_framebuffer,
- BUFFER_FRONT_LEFT, &drb->Base);
- }
- if (mesaVis->doubleBufferMode) {
- /* XXX what are the correct origin/stride values? */
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, driScrnPriv->fbBPP /8,
- driScrnPriv->fbOrigin,
- driScrnPriv->fbStride);
- fbSetSpanFunctions(drb, mesaVis);
- drb->Base.Data = _mesa_malloc(driScrnPriv->fbStride * driScrnPriv->fbHeight);
- _mesa_add_renderbuffer(mesa_framebuffer,
- BUFFER_BACK_LEFT, &drb->Base);
- }
-
- _mesa_add_soft_renderbuffers(mesa_framebuffer,
- GL_FALSE, /* color */
- swDepth,
- swStencil,
- swAccum,
- 0,
- GL_FALSE /* aux */);
-
- driDrawPriv->driverPrivate = mesa_framebuffer;
-
- return 1;
- }
-}
-
-
-static void
-fbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- struct gl_framebuffer *mesa_framebuffer = (struct gl_framebuffer *)driDrawPriv->driverPrivate;
-
- _mesa_free(mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data);
- _mesa_destroy_framebuffer(mesa_framebuffer);
- driDrawPriv->driverPrivate = NULL;
-}
-
-
-
-/* If the backbuffer is on a videocard, this is extraordinarily slow!
- */
-static void
-fbSwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- struct gl_framebuffer *mesa_framebuffer = (struct gl_framebuffer *)dPriv->driverPrivate;
- struct gl_renderbuffer * front_renderbuffer = mesa_framebuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
- void *frontBuffer = front_renderbuffer->Data;
- int currentPitch = ((driRenderbuffer *)front_renderbuffer)->pitch;
- void *backBuffer = mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data;
-
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- fbContextPtr fbmesa = (fbContextPtr) dPriv->driContextPriv->driverPrivate;
- GLcontext *ctx = fbmesa->glCtx;
-
- if (ctx->Visual.doubleBufferMode) {
- int i;
- int offset = 0;
- char *tmp = _mesa_malloc(currentPitch);
-
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
-
- ASSERT(frontBuffer);
- ASSERT(backBuffer);
-
- for (i = 0; i < dPriv->h; i++) {
- _mesa_memcpy(tmp, (char *) backBuffer + offset,
- currentPitch);
- _mesa_memcpy((char *) frontBuffer + offset, tmp,
- currentPitch);
- offset += currentPitch;
- }
-
- _mesa_free(tmp);
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "fbSwapBuffers: drawable has no context!\n");
- }
-}
-
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-static GLboolean
-fbMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( driContextPriv ) {
- fbContextPtr newFbCtx =
- (fbContextPtr) driContextPriv->driverPrivate;
-
- newFbCtx->dri.drawable = driDrawPriv;
-
- _mesa_make_current( newFbCtx->glCtx,
- driDrawPriv->driverPrivate,
- driReadPriv->driverPrivate);
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-
-/* Force the context `c' to be unbound from its buffer.
- */
-static GLboolean
-fbUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
-
-static struct __DriverAPIRec fbAPI = {
- .InitDriver = fbInitDriver,
- .DestroyScreen = fbDestroyScreen,
- .CreateContext = fbCreateContext,
- .DestroyContext = fbDestroyContext,
- .CreateBuffer = fbCreateBuffer,
- .DestroyBuffer = fbDestroyBuffer,
- .SwapBuffers = fbSwapBuffers,
- .MakeCurrent = fbMakeCurrent,
- .UnbindContext = fbUnbindContext,
-};
-
-
-
-static int
-__driValidateMode(const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-static int
-__driInitFBDev( struct DRIDriverContextRec *ctx )
-{
- /* Note that drmOpen will try to load the kernel module, if needed. */
- /* we need a fbdev drm driver - it will only track maps */
- ctx->drmFD = drmOpen("radeon", NULL );
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
-
- ctx->shared.SAREASize = SAREA_MAX;
-
- if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap( ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
-#ifndef _EMBEDDED
- 0,
-#else
- DRM_READ_ONLY,
-#endif
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
-
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
- return 1;
-}
-
-static void
-__driHaltFBDev( struct DRIDriverContextRec *ctx )
-{
-}
-
-struct DRIDriverRec __driDriver = {
- __driValidateMode,
- __driValidateMode,
- __driInitFBDev,
- __driHaltFBDev
-};
-
-static __GLcontextModes *
-fbFillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_RGBA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- __GLcontextModes ** driver_modes )
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 4, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 5, 0 };
-
-
- if ( ! driCheckDriDdxDrmVersions2( "fb",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &fbAPI);
- if ( psp != NULL ) {
- *driver_modes = fbFillInModes( psp->fbBPP,
- (psp->fbBPP == 16) ? 16 : 24,
- (psp->fbBPP == 16) ? 0 : 8,
- 1);
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_egl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_egl.c
deleted file mode 100644
index 2cea48808..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/fb/fb_egl.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * Test egl driver for fb_dri.so
- */
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <linux/fb.h>
-
-#include "utils.h"
-#include "buffers.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "drivers/common/driverfuncs.h"
-#include "drirenderbuffer.h"
-
-#include "eglconfig.h"
-#include "eglcontext.h"
-#include "egldisplay.h"
-#include "egldriver.h"
-#include "eglglobals.h"
-#include "eglmode.h"
-#include "eglscreen.h"
-#include "eglsurface.h"
-
-extern void
-fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
-extern void
-fbSetBuffer( GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit);
-
-/**
- * fb driver-specific driver class derived from _EGLDriver
- */
-typedef struct fb_driver
-{
- _EGLDriver Base; /* base class/object */
- GLuint fbStuff;
-} fbDriver;
-
-/**
- * fb display-specific driver class derived from _EGLDisplay
- */
-typedef struct fb_display
-{
- _EGLDisplay Base; /* base class/object */
- void *pFB;
-} fbDisplay;
-
-/**
- * fb driver-specific screen class derived from _EGLScreen
- */
-typedef struct fb_screen
-{
- _EGLScreen Base;
- char fb[NAME_MAX];
-} fbScreen;
-
-
-/**
- * fb driver-specific surface class derived from _EGLSurface
- */
-typedef struct fb_surface
-{
- _EGLSurface Base; /* base class/object */
- struct gl_framebuffer *mesa_framebuffer;
-} fbSurface;
-
-
-/**
- * fb driver-specific context class derived from _EGLContext
- */
-typedef struct fb_context
-{
- _EGLContext Base; /* base class/object */
- GLcontext *glCtx;
-} fbContext;
-
-
-static EGLBoolean
-fbFillInConfigs(_EGLDisplay *disp, unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer) {
- _EGLConfig *configs;
- _EGLConfig *c;
- unsigned int i, num_configs;
- unsigned int depth_buffer_factor;
- unsigned int back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_configs = depth_buffer_factor * back_buffer_factor * 2;
-
- if (pixel_bits == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- } else {
- fb_format = GL_RGBA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- configs = calloc(sizeof(*configs), num_configs);
- c = configs;
- if (!_eglFillInConfigs(c, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__);
- return EGL_FALSE;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for (i = 0, c = configs; i < num_configs; i++, c++) {
- int stencil = GET_CONFIG_ATTRIB(c, EGL_STENCIL_SIZE);
- if ((stencil != 0) && (stencil != stencil_bits)) {
- SET_CONFIG_ATTRIB(c, EGL_CONFIG_CAVEAT, EGL_SLOW_CONFIG);
- }
- }
-
- for (i = 0, c = configs; i < num_configs; i++, c++)
- _eglAddConfig(disp, c);
-
- free(configs);
-
- return EGL_TRUE;
-}
-
-static EGLBoolean
-fbSetupFramebuffer(fbDisplay *disp, char *fbdev)
-{
- int fd;
- char dev[20];
- struct fb_var_screeninfo varInfo;
- struct fb_fix_screeninfo fixedInfo;
-
- snprintf(dev, sizeof(dev), "/dev/%s", fbdev);
-
- /* open the framebuffer device */
- fd = open(dev, O_RDWR);
- if (fd < 0) {
- fprintf(stderr, "Error opening %s: %s\n", fbdev, strerror(errno));
- return EGL_FALSE;
- }
-
- /* get the original variable screen info */
- if (ioctl(fd, FBIOGET_VSCREENINFO, &varInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
- strerror(errno));
- return EGL_FALSE;
- }
-
- /* Turn off hw accels (otherwise mmap of mmio region will be
- * refused)
- */
- if (varInfo.accel_flags) {
- varInfo.accel_flags = 0;
- if (ioctl(fd, FBIOPUT_VSCREENINFO, &varInfo)) {
- fprintf(stderr, "error: ioctl(FBIOPUT_VSCREENINFO) failed: %s\n",
- strerror(errno));
- return EGL_FALSE;
- }
- }
-
- /* Get the fixed screen info */
- if (ioctl(fd, FBIOGET_FSCREENINFO, &fixedInfo)) {
- fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
- strerror(errno));
- return EGL_FALSE;
- }
-
- if (fixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
- struct fb_cmap cmap;
- unsigned short red[256], green[256], blue[256];
- int rcols = 1 << varInfo.red.length;
- int gcols = 1 << varInfo.green.length;
- int bcols = 1 << varInfo.blue.length;
- int i;
-
- cmap.start = 0;
- cmap.len = gcols;
- cmap.red = red;
- cmap.green = green;
- cmap.blue = blue;
- cmap.transp = NULL;
-
- for (i = 0; i < rcols ; i++)
- red[i] = (65536/(rcols-1)) * i;
-
- for (i = 0; i < gcols ; i++)
- green[i] = (65536/(gcols-1)) * i;
-
- for (i = 0; i < bcols ; i++)
- blue[i] = (65536/(bcols-1)) * i;
-
- if (ioctl(fd, FBIOPUTCMAP, (void *) &cmap) < 0) {
- fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
- exit(1);
- }
- }
-
- /* mmap the framebuffer into our address space */
- if (!disp->pFB)
- disp->pFB = (caddr_t)mmap(0, /* start */
- fixedInfo.smem_len, /* bytes */
- PROT_READ | PROT_WRITE, /* prot */
- MAP_SHARED, /* flags */
- fd, /* fd */
- 0); /* offset */
- if (disp->pFB == (caddr_t)-1) {
- fprintf(stderr, "error: unable to mmap framebuffer: %s\n",
- strerror(errno));
- return EGL_FALSE;
- }
-
- return EGL_TRUE;
-}
-
-const char *sysfs = "/sys/class/graphics";
-
-static EGLBoolean
-fbInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- fbDisplay *display;
- fbScreen *s;
- _EGLScreen *scrn;
- char c;
- unsigned int x, y, r;
- DIR *dir;
- FILE *file;
- struct dirent *dirent;
- char path[NAME_MAX];
-
- /* Switch display structure to one with our private fields */
- display = calloc(1, sizeof(*display));
- display->Base = *disp;
- _eglHashInsert(_eglGlobal.Displays, disp->Handle, display);
- free(disp);
-
- *major = 1;
- *minor = 0;
-
- dir = opendir(sysfs);
- if (!dir) {
- printf("EGL - %s framebuffer device not found.", sysfs);
- return EGL_FALSE;
- }
-
- while ((dirent = readdir(dir))) { /* assignment! */
-
- if (dirent->d_name[0] != 'f')
- continue;
- if (dirent->d_name[1] != 'b')
- continue;
-
- if (fbSetupFramebuffer(display, dirent->d_name) == EGL_FALSE)
- continue;
-
- /* Create a screen */
- s = (fbScreen *) calloc(1, sizeof(fbScreen));
- if (!s)
- return EGL_FALSE;
-
- strncpy(s->fb, dirent->d_name, NAME_MAX);
- scrn = &s->Base;
- _eglInitScreen(scrn);
- _eglAddScreen(&display->Base, scrn);
-
- snprintf(path, sizeof(path), "%s/%s/modes", sysfs, s->fb);
- file = fopen(path, "r");
- while (fgets(path, sizeof(path), file)) {
- sscanf(path, "%c:%ux%u-%u", &c, &x, &y, &r);
- _eglAddMode(scrn, x, y, r * 1000, path);
- }
- fclose(file);
-
- fbFillInConfigs(&display->Base, 32, 24, 8, 1);
-
- }
- closedir(dir);
-
- drv->Initialized = EGL_TRUE;
- return EGL_TRUE;
-}
-
-
-static fbDisplay *
-Lookup_fbDisplay(EGLDisplay dpy)
-{
- _EGLDisplay *d = _eglLookupDisplay(dpy);
- return (fbDisplay *) d;
-}
-
-
-static fbScreen *
-Lookup_fbScreen(EGLDisplay dpy, EGLScreenMESA screen)
-{
- _EGLScreen *s = _eglLookupScreen(dpy, screen);
- return (fbScreen *) s;
-}
-
-
-static fbContext *
-Lookup_fbContext(EGLContext ctx)
-{
- _EGLContext *c = _eglLookupContext(ctx);
- return (fbContext *) c;
-}
-
-
-static fbSurface *
-Lookup_fbSurface(EGLSurface surf)
-{
- _EGLSurface *s = _eglLookupSurface(surf);
- return (fbSurface *) s;
-}
-
-
-static EGLBoolean
-fbTerminate(_EGLDriver *drv, EGLDisplay dpy)
-{
- fbDisplay *display = Lookup_fbDisplay(dpy);
- _eglCleanupDisplay(&display->Base);
- free(display);
- free(drv);
- return EGL_TRUE;
-}
-
-
-static const GLubyte *
-get_string(GLcontext *ctx, GLenum pname)
-{
- (void) ctx;
- switch (pname) {
- case GL_RENDERER:
- return (const GLubyte *) "Mesa dumb framebuffer";
- default:
- return NULL;
- }
-}
-
-
-static void
-update_state( GLcontext *ctx, GLuint new_state )
-{
- /* not much to do here - pass it on */
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-
-/**
- * Called by ctx->Driver.GetBufferSize from in core Mesa to query the
- * current framebuffer size.
- */
-static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
- *width = buffer->Width;
- *height = buffer->Height;
-}
-
-
-static void
-viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- _mesa_ResizeBuffersMESA();
-}
-
-
-static void
-init_core_functions( struct dd_function_table *functions )
-{
- functions->GetString = get_string;
- functions->UpdateState = update_state;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetBufferSize = get_buffer_size;
- functions->Viewport = viewport;
-
- functions->Clear = _swrast_Clear; /* could accelerate with blits */
-}
-
-
-static EGLContext
-fbCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
-{
- GLcontext *ctx;
- _EGLConfig *conf;
- fbContext *c;
- _EGLDisplay *disp = _eglLookupDisplay(dpy);
- struct dd_function_table functions;
- GLvisual vis;
- int i;
-
- conf = _eglLookupConfig(drv, dpy, config);
- if (!conf) {
- _eglError(EGL_BAD_CONFIG, "eglCreateContext");
- return EGL_NO_CONTEXT;
- }
-
- for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
- switch (attrib_list[i]) {
- /* no attribs defined for now */
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglCreateContext");
- return EGL_NO_CONTEXT;
- }
- }
-
- c = (fbContext *) calloc(1, sizeof(fbContext));
- if (!c)
- return EGL_NO_CONTEXT;
-
- _eglInitContext(&c->Base);
- c->Base.Display = disp;
- c->Base.Config = conf;
- c->Base.DrawSurface = EGL_NO_SURFACE;
- c->Base.ReadSurface = EGL_NO_SURFACE;
-
- /* generate handle and insert into hash table */
- _eglSaveContext(&c->Base);
- assert(c->Base.Handle);
-
- /* Init default driver functions then plug in our FBdev-specific functions
- */
- _mesa_init_driver_functions(&functions);
- init_core_functions(&functions);
-
- _eglConfigToContextModesRec(conf, &vis);
-
- ctx = c->glCtx = _mesa_create_context(&vis, NULL, &functions, (void *)c);
- if (!c->glCtx) {
- _mesa_free(c);
- return GL_FALSE;
- }
-
- /* Create module contexts */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
- _swsetup_Wakeup( ctx );
-
-
- /* swrast init -- need to verify these tests - I just plucked the
- * numbers out of the air. (KW)
- */
- {
- struct swrast_device_driver *swdd;
- swdd = _swrast_GetDeviceDriverReference( ctx );
- swdd->SetBuffer = fbSetBuffer;
- }
-
- /* use default TCL pipeline */
- {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- }
-
- _mesa_enable_sw_extensions(ctx);
-
- return c->Base.Handle;
-}
-
-
-static EGLSurface
-fbCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list)
-{
- int i;
- for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
- switch (attrib_list[i]) {
- /* no attribs at this time */
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglCreateWindowSurface");
- return EGL_NO_SURFACE;
- }
- }
- printf("eglCreateWindowSurface()\n");
- /* XXX unfinished */
-
- return EGL_NO_SURFACE;
-}
-
-
-static EGLSurface
-fbCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list)
-{
- _EGLConfig *conf;
- EGLint i;
-
- conf = _eglLookupConfig(drv, dpy, config);
- if (!conf) {
- _eglError(EGL_BAD_CONFIG, "eglCreatePixmapSurface");
- return EGL_NO_SURFACE;
- }
-
- for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
- switch (attrib_list[i]) {
- /* no attribs at this time */
- default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglCreatePixmapSurface");
- return EGL_NO_SURFACE;
- }
- }
-
- if (conf->Attrib[EGL_SURFACE_TYPE - FIRST_ATTRIB] == 0) {
- _eglError(EGL_BAD_MATCH, "eglCreatePixmapSurface");
- return EGL_NO_SURFACE;
- }
-
- printf("eglCreatePixmapSurface()\n");
- return EGL_NO_SURFACE;
-}
-
-
-static EGLSurface
-fbCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
-{
- fbSurface *surf;
-
- surf = (fbSurface *) calloc(1, sizeof(fbSurface));
- if (!surf) {
- return EGL_NO_SURFACE;
- }
-
- if (_eglInitPbufferSurface(&surf->Base, drv, dpy, config, attrib_list) == EGL_NO_SURFACE) {
- free(surf);
- return EGL_NO_SURFACE;
- }
-
- /* create software-based pbuffer */
- {
- GLcontext *ctx = NULL; /* this _should_ be OK */
- GLvisual vis;
- _EGLConfig *conf = _eglLookupConfig(drv, dpy, config);
- assert(conf); /* bad config should be caught earlier */
- _eglConfigToContextModesRec(conf, &vis);
-
- surf->mesa_framebuffer = _mesa_create_framebuffer(&vis);
- _mesa_add_soft_renderbuffers(surf->mesa_framebuffer,
- GL_TRUE, /* color bufs */
- vis.haveDepthBuffer,
- vis.haveStencilBuffer,
- vis.haveAccumBuffer,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */ );
-
- /* set pbuffer/framebuffer size */
- _mesa_resize_framebuffer(ctx, surf->mesa_framebuffer,
- surf->Base.Width, surf->Base.Height);
- }
-
- return surf->Base.Handle;
-}
-
-
-static EGLBoolean
-fbDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
-{
- fbSurface *fs = Lookup_fbSurface(surface);
- _eglRemoveSurface(&fs->Base);
- if (fs->Base.IsBound) {
- fs->Base.DeletePending = EGL_TRUE;
- }
- else {
- free(fs);
- }
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-fbDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context)
-{
- fbContext *fc = Lookup_fbContext(context);
- _eglRemoveContext(&fc->Base);
- if (fc->Base.IsBound) {
- fc->Base.DeletePending = EGL_TRUE;
- }
- else {
- free(fc);
- }
- return EGL_TRUE;
-}
-
-
-static EGLBoolean
-fbMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context)
-{
- fbSurface *readSurf = Lookup_fbSurface(read);
- fbSurface *drawSurf = Lookup_fbSurface(draw);
- fbContext *ctx = Lookup_fbContext(context);
- EGLBoolean b;
-
- b = _eglMakeCurrent(drv, dpy, draw, read, context);
- if (!b)
- return EGL_FALSE;
-
- if (ctx) {
- _mesa_make_current( ctx->glCtx,
- drawSurf->mesa_framebuffer,
- readSurf->mesa_framebuffer);
- } else
- _mesa_make_current( NULL, NULL, NULL );
-
- return EGL_TRUE;
-}
-
-
-/**
- * Create a drawing surface which can be directly displayed on a screen.
- */
-static EGLSurface
-fbCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg,
- const EGLint *attrib_list)
-{
- _EGLConfig *config = _eglLookupConfig(drv, dpy, cfg);
- fbDisplay *display = Lookup_fbDisplay(dpy);
- fbSurface *surface;
- EGLSurface surf;
- GLvisual vis;
- GLcontext *ctx = NULL; /* this should be OK */
- int origin, bytesPerPixel;
- int width, height, stride;
-
- surface = (fbSurface *) malloc(sizeof(*surface));
- if (!surface) {
- return EGL_NO_SURFACE;
- }
-
- /* init base class, error check, etc. */
- surf = _eglInitScreenSurface(&surface->Base, drv, dpy, cfg, attrib_list);
- if (surf == EGL_NO_SURFACE) {
- free(surface);
- return EGL_NO_SURFACE;
- }
-
- /* convert EGLConfig to GLvisual */
- _eglConfigToContextModesRec(config, &vis);
-
- /* create Mesa framebuffer */
- surface->mesa_framebuffer = _mesa_create_framebuffer(&vis);
- if (!surface->mesa_framebuffer) {
- free(surface);
- _eglRemoveSurface(&surface->Base);
- return EGL_NO_SURFACE;
- }
-
- width = surface->Base.Width;
- height = surface->Base.Height;
- bytesPerPixel = vis.rgbBits / 8;
- stride = width * bytesPerPixel;
- origin = 0;
-
- /* front color renderbuffer */
- {
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, bytesPerPixel,
- origin, stride);
- fbSetSpanFunctions(drb, &vis);
- drb->Base.Data = display->pFB;
- _mesa_add_renderbuffer(surface->mesa_framebuffer,
- BUFFER_FRONT_LEFT, &drb->Base);
- }
-
- /* back color renderbuffer */
- if (vis.doubleBufferMode) {
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, bytesPerPixel,
- origin, stride);
- fbSetSpanFunctions(drb, &vis);
- drb->Base.Data = _mesa_malloc(stride * height);
- _mesa_add_renderbuffer(surface->mesa_framebuffer,
- BUFFER_BACK_LEFT, &drb->Base);
- }
-
- /* other renderbuffers- software based */
- _mesa_add_soft_renderbuffers(surface->mesa_framebuffer,
- GL_FALSE, /* color */
- vis.haveDepthBuffer,
- vis.haveStencilBuffer,
- vis.haveAccumBuffer,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
-
- _mesa_resize_framebuffer(ctx, surface->mesa_framebuffer, width, height);
-
- return surf;
-}
-
-
-/**
- * Show the given surface on the named screen.
- * If surface is EGL_NO_SURFACE, disable the screen's output.
- */
-static EGLBoolean
-fbShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLSurface surface, EGLModeMESA m)
-{
- fbDisplay *display = Lookup_fbDisplay(dpy);
- fbScreen *scrn = Lookup_fbScreen(dpy, screen);
- fbSurface *surf = Lookup_fbSurface(surface);
- FILE *file;
- char buffer[NAME_MAX];
- _EGLMode *mode = _eglLookupMode(dpy, m);
- int bits;
-
- if (!_eglShowSurfaceMESA(drv, dpy, screen, surface, m))
- return EGL_FALSE;
-
- snprintf(buffer, sizeof(buffer), "%s/%s/blank", sysfs, scrn->fb);
-
- file = fopen(buffer, "r+");
- if (!file) {
-err:
- printf("chown all fb sysfs attrib to allow write - %s\n", buffer);
- return EGL_FALSE;
- }
- snprintf(buffer, sizeof(buffer), "%d", (m == EGL_NO_MODE_MESA ? VESA_POWERDOWN : VESA_VSYNC_SUSPEND));
- fputs(buffer, file);
- fclose(file);
-
- if (m == EGL_NO_MODE_MESA)
- return EGL_TRUE;
-
- snprintf(buffer, sizeof(buffer), "%s/%s/mode", sysfs, scrn->fb);
-
- file = fopen(buffer, "r+");
- if (!file)
- goto err;
- fputs(mode->Name, file);
- fclose(file);
-
- snprintf(buffer, sizeof(buffer), "%s/%s/bits_per_pixel", sysfs, scrn->fb);
-
- file = fopen(buffer, "r+");
- if (!file)
- goto err;
- bits = GET_CONFIG_ATTRIB(surf->Base.Config, EGL_BUFFER_SIZE);
- snprintf(buffer, sizeof(buffer), "%d", bits);
- fputs(buffer, file);
- fclose(file);
-
- fbSetupFramebuffer(display, scrn->fb);
-
- snprintf(buffer, sizeof(buffer), "%s/%s/blank", sysfs, scrn->fb);
-
- file = fopen(buffer, "r+");
- if (!file)
- goto err;
-
- snprintf(buffer, sizeof(buffer), "%d", VESA_NO_BLANKING);
- fputs(buffer, file);
- fclose(file);
-
- return EGL_TRUE;
-}
-
-
-/* If the backbuffer is on a videocard, this is extraordinarily slow!
- */
-static EGLBoolean
-fbSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
-{
- fbContext *context = (fbContext *)_eglGetCurrentContext();
- fbSurface *fs = Lookup_fbSurface(draw);
- struct gl_renderbuffer * front_renderbuffer = fs->mesa_framebuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
- void *frontBuffer = front_renderbuffer->Data;
- int currentPitch = ((driRenderbuffer *)front_renderbuffer)->pitch;
- void *backBuffer = fs->mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data;
-
- if (!_eglSwapBuffers(drv, dpy, draw))
- return EGL_FALSE;
-
- if (context) {
- GLcontext *ctx = context->glCtx;
-
- if (ctx->Visual.doubleBufferMode) {
- int i;
- int offset = 0;
- char *tmp = _mesa_malloc(currentPitch);
-
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
-
- ASSERT(frontBuffer);
- ASSERT(backBuffer);
-
- for (i = 0; i < fs->Base.Height; i++) {
- _mesa_memcpy(tmp, (char *) backBuffer + offset,
- currentPitch);
- _mesa_memcpy((char *) frontBuffer + offset, tmp,
- currentPitch);
- offset += currentPitch;
- }
-
- _mesa_free(tmp);
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "fbSwapBuffers: drawable has no context!\n");
- return EGL_FALSE;
- }
- return EGL_TRUE;
-}
-
-
-/**
- * The bootstrap function. Return a new fbDriver object and
- * plug in API functions.
- */
-_EGLDriver *
-_eglMain(_EGLDisplay *dpy)
-{
- fbDriver *fb;
-
- fb = (fbDriver *) calloc(1, sizeof(fbDriver));
- if (!fb) {
- return NULL;
- }
-
- /* First fill in the dispatch table with defaults */
- _eglInitDriverFallbacks(&fb->Base);
-
- /* then plug in our fb-specific functions */
- fb->Base.Initialize = fbInitialize;
- fb->Base.Terminate = fbTerminate;
- fb->Base.CreateContext = fbCreateContext;
- fb->Base.MakeCurrent = fbMakeCurrent;
- fb->Base.CreateWindowSurface = fbCreateWindowSurface;
- fb->Base.CreatePixmapSurface = fbCreatePixmapSurface;
- fb->Base.CreatePbufferSurface = fbCreatePbufferSurface;
- fb->Base.DestroySurface = fbDestroySurface;
- fb->Base.DestroyContext = fbDestroyContext;
- fb->Base.CreateScreenSurfaceMESA = fbCreateScreenSurfaceMESA;
- fb->Base.ShowSurfaceMESA = fbShowSurfaceMESA;
- fb->Base.SwapBuffers = fbSwapBuffers;
-
- /* enable supported extensions */
- fb->Base.MESA_screen_surface = EGL_TRUE;
- fb->Base.MESA_copy_context = EGL_TRUE;
-
- return &fb->Base;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/Makefile
deleted file mode 100644
index cb73238c0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# src/mesa/drivers/dri/ffb/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = ffb_dri.so
-
-# not yet
-# MINIGLX_SOURCES = server/ffb_dri.c
-
-DRIVER_SOURCES = \
- ffb_bitmap.c \
- ffb_clear.c \
- ffb_dd.c \
- ffb_depth.c \
- ffb_fog.c \
- ffb_lines.c \
- ffb_points.c \
- ffb_span.c \
- ffb_state.c \
- ffb_stencil.c \
- ffb_tex.c \
- ffb_tris.c \
- ffb_vb.c \
- ffb_xmesa.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.c
deleted file mode 100644
index 7263e8381..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_bitmap.c,v 1.1 2002/02/22 21:32:58 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "ffb_context.h"
-#include "ffb_state.h"
-#include "ffb_lock.h"
-#include "ffb_bitmap.h"
-#include "swrast/swrast.h"
-#include "image.h"
-#include "macros.h"
-
-/* Compute ceiling of integer quotient of A divided by B: */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
-
-#undef FFB_BITMAP_TRACE
-
-static void
-ffb_bitmap(GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_fbcPtr ffb = fmesa->regs;
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- unsigned int ppc, pixel;
- GLint row, col, row_stride;
- const GLubyte *src;
- char *buf;
-
- if (fmesa->bad_fragment_attrs != 0)
- _swrast_Bitmap(ctx, px, py, width,
- height, unpack, bitmap);
-
- pixel = (((((GLuint)(ctx->Current.RasterColor[0] * 255.0f)) & 0xff) << 0) |
- ((((GLuint)(ctx->Current.RasterColor[1] * 255.0f)) & 0xff) << 8) |
- ((((GLuint)(ctx->Current.RasterColor[2] * 255.0f)) & 0xff) << 16) |
- ((((GLuint)(ctx->Current.RasterColor[3] * 255.0f)) & 0xff) << 24));
-
-#ifdef FFB_BITMAP_TRACE
- fprintf(stderr, "ffb_bitmap: ppc(%08x) fbc(%08x) cmp(%08x) pixel(%08x)\n",
- fmesa->ppc, fmesa->fbc, fmesa->cmp, pixel);
-#endif
-
- LOCK_HARDWARE(fmesa);
- fmesa->hw_locked = 1;
-
- if (fmesa->state_dirty)
- ffbSyncHardware(fmesa);
-
- ppc = fmesa->ppc;
-
- FFBFifo(fmesa, 4);
- ffb->ppc = ((ppc &
- ~(FFB_PPC_TBE_MASK | FFB_PPC_ZS_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK))
- | (FFB_PPC_TBE_TRANSPARENT | FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST |
- (ctx->Color.BlendEnabled ? FFB_PPC_XS_CONST : FFB_PPC_XS_WID)));
- ffb->constz = ((GLuint) (ctx->Current.RasterPos[2] * 0x0fffffff));
- ffb->fg = pixel;
- ffb->fontinc = (0 << 16) | 32;
-
- buf = (char *)(fmesa->sfb32 + (dPriv->x << 2) + (dPriv->y << 13));
-
- row_stride = (unpack->Alignment * CEILING(width, 8 * unpack->Alignment));
- src = (const GLubyte *) (bitmap +
- (unpack->SkipRows * row_stride) +
- (unpack->SkipPixels / 8));
- if (unpack->LsbFirst == GL_TRUE) {
- for (row = 0; row < height; row++, src += row_stride) {
- const GLubyte *row_src = src;
- GLuint base_x, base_y;
-
- base_x = dPriv->x + px;
- base_y = dPriv->y + (dPriv->h - (py + row));
-
- FFBFifo(fmesa, 1);
- ffb->fontxy = (base_y << 16) | base_x;
-
- for (col = 0; col < width; col += 32, row_src += 4) {
- GLint bitnum, font_w = (width - col);
- GLuint font_data;
-
- if (font_w > 32)
- font_w = 32;
- font_data = 0;
- for (bitnum = 0; bitnum < 32; bitnum++) {
- const GLubyte val = row_src[bitnum >> 3];
-
- if (val & (1 << (bitnum & (8 - 1))))
- font_data |= (1 << (31 - bitnum));
- }
-
- FFBFifo(fmesa, 2);
- ffb->fontw = font_w;
- ffb->font = font_data;
- }
- }
- } else {
- for (row = 0; row < height; row++, src += row_stride) {
- const GLubyte *row_src = src;
- GLuint base_x, base_y;
-
- base_x = dPriv->x + px;
- base_y = dPriv->y + (dPriv->h - (py + row));
-
- FFBFifo(fmesa, 1);
- ffb->fontxy = (base_y << 16) | base_x;
-
- for (col = 0; col < width; col += 32, row_src += 4) {
- GLint font_w = (width - col);
-
- if (font_w > 32)
- font_w = 32;
- FFBFifo(fmesa, 2);
- ffb->fontw = font_w;
- ffb->font = (((unsigned int)row_src[0]) << 24 |
- ((unsigned int)row_src[1]) << 16 |
- ((unsigned int)row_src[2]) << 8 |
- ((unsigned int)row_src[3]) << 0);
- }
- }
- }
-
- FFBFifo(fmesa, 1);
- ffb->ppc = ppc;
- fmesa->ffbScreen->rp_active = 1;
-
- UNLOCK_HARDWARE(fmesa);
- fmesa->hw_locked = 0;
-}
-
-void ffbDDInitBitmapFuncs(GLcontext *ctx)
-{
- ctx->Driver.Bitmap = ffb_bitmap;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.h
deleted file mode 100644
index 4f8d2ea2a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_bitmap.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_bitmap.h,v 1.1 2002/02/22 21:32:58 dawes Exp $ */
-
-#ifndef _FFB_BITMAP_H
-#define _FFB_BITMAP_H
-
-extern void ffbDDInitBitmapFuncs(GLcontext *);
-
-#endif /* !(_FFB_BITMAP_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.c
deleted file mode 100644
index c63179149..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_clear.c,v 1.2 2002/02/22 21:32:58 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "extensions.h"
-
-#include "mm.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "ffb_tris.h"
-#include "ffb_clear.h"
-#include "ffb_lock.h"
-
-#undef CLEAR_TRACE
-
-#define BOX_AREA(__w, __h) ((int)(__w) * (int)(__h))
-
-/* Compute the page aligned box for a page mode fast fill.
- * In 'ework' this returns greater than zero if there are some odd
- * edges to take care of which are outside of the page aligned area.
- * It will place less than zero there if the box is too small,
- * indicating that a different method must be used to fill it.
- */
-#define CreatorPageFillParms(ffp, x, y, w, h, px, py, pw, ph, ework) \
-do { int xdiff, ydiff; \
- int pf_bh = ffp->pagefill_height; \
- int pf_bw = ffp->pagefill_width; \
- py = ((y + (pf_bh - 1)) & ~(pf_bh - 1)); \
- ydiff = py - y; \
- px = ffp->Pf_AlignTab[x + (pf_bw - 1)]; \
- xdiff = px - x; \
- ph = ((h - ydiff) & ~(pf_bh - 1)); \
- if(ph <= 0) \
- ework = -1; \
- else { \
- pw = ffp->Pf_AlignTab[w - xdiff]; \
- if(pw <= 0) { \
- ework = -1; \
- } else { \
- ework = (((xdiff > 0) || \
- (ydiff > 0) || \
- ((w - pw) > 0) || \
- ((h - ph) > 0))) ? 1 : 0; \
- } \
- } \
-} while(0);
-
-struct ff_fixups {
- int x, y, width, height;
-};
-
-/* Compute fixups of non-page aligned areas after a page fill.
- * Return the number of fixups needed.
- */
-static __inline__ int
-CreatorComputePageFillFixups(struct ff_fixups *fixups,
- int x, int y, int w, int h,
- int paligned_x, int paligned_y,
- int paligned_w, int paligned_h)
-{
- int nfixups = 0;
-
- /* FastFill Left */
- if(paligned_x != x) {
- fixups[nfixups].x = x;
- fixups[nfixups].y = paligned_y;
- fixups[nfixups].width = paligned_x - x;
- fixups[nfixups].height = paligned_h;
- nfixups++;
- }
- /* FastFill Top */
- if(paligned_y != y) {
- fixups[nfixups].x = x;
- fixups[nfixups].y = y;
- fixups[nfixups].width = w;
- fixups[nfixups].height = paligned_y - y;
- nfixups++;
- }
- /* FastFill Right */
- if((x+w) != (paligned_x+paligned_w)) {
- fixups[nfixups].x = (paligned_x+paligned_w);
- fixups[nfixups].y = paligned_y;
- fixups[nfixups].width = (x+w) - fixups[nfixups].x;
- fixups[nfixups].height = paligned_h;
- nfixups++;
- }
- /* FastFill Bottom */
- if((y+h) != (paligned_y+paligned_h)) {
- fixups[nfixups].x = x;
- fixups[nfixups].y = (paligned_y+paligned_h);
- fixups[nfixups].width = w;
- fixups[nfixups].height = (y+h) - fixups[nfixups].y;
- nfixups++;
- }
- return nfixups;
-}
-
-static void
-ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv,
- GLboolean all, GLint cx, GLint cy, GLint cwidth,
- GLint cheight)
-{
- FFBDRIPtr gDRIPriv = (FFBDRIPtr) fmesa->driScreen->pDevPriv;
- ffb_fbcPtr ffb = fmesa->regs;
- drm_clip_rect_t *box = dPriv->pClipRects;
- int nc = dPriv->numClipRects;
-
- cy = dPriv->h - cy - cheight;
- cx += dPriv->x;
- cy += dPriv->y;
-
- while (nc--) {
- GLint x = box[nc].x1;
- GLint y = box[nc].y1;
- GLint width = box[nc].x2 - x;
- GLint height = box[nc].y2 - y;
- int paligned_y, paligned_x;
- int paligned_h, paligned_w = 0;
- int extra_work;
-
- if (!all) {
- if (x < cx) {
- width -= cx - x;
- x = cx;
- }
- if (y < cy) {
- height -= cy - y;
- y = cy;
- }
- if (x + width > cx + cwidth)
- width = cx + cwidth - x;
- if (y + height > cy + cheight)
- height = cy + cheight - y;
- if (width <= 0)
- continue;
- if (height <= 0)
- continue;
- }
-
- if (BOX_AREA(width, height) < gDRIPriv->fastfill_small_area) {
- FFBFifo(fmesa, 5);
- ffb->drawop = FFB_DRAWOP_RECTANGLE;
- ffb->by = y;
- ffb->bx = x;
- ffb->bh = height;
- ffb->bw = width;
- continue;
- }
-
- FFBFifo(fmesa, 1);
- ffb->drawop = FFB_DRAWOP_FASTFILL;
-
- if (gDRIPriv->disable_pagefill ||
- (width < (gDRIPriv->pagefill_width<<1)) ||
- (height < (gDRIPriv->pagefill_height<<1)))
- goto do_fastfill;
-
- CreatorPageFillParms(gDRIPriv,
- x, y, width, height,
- paligned_x, paligned_y,
- paligned_w, paligned_h, extra_work);
-
- if (extra_work < 0 ||
- BOX_AREA(paligned_w, paligned_h) < gDRIPriv->pagefill_small_area) {
- do_fastfill:
- FFBFifo(fmesa, 10);
- ffb->by = FFB_FASTFILL_COLOR_BLK;
- ffb->dy = 0;
- ffb->dx = 0;
- ffb->bh = gDRIPriv->fastfill_height;
- ffb->bw = (gDRIPriv->fastfill_width * 4);
- ffb->by = FFB_FASTFILL_BLOCK;
- ffb->dy = y;
- ffb->dx = x;
- ffb->bh = (height + (y & (gDRIPriv->fastfill_height - 1)));
- ffb->bx = (width + (x & (gDRIPriv->fastfill_width - 1)));
- continue;
- }
-
- /* Ok, page fill is possible and worth it. */
- FFBFifo(fmesa, 15);
- ffb->by = FFB_FASTFILL_COLOR_BLK;
- ffb->dy = 0;
- ffb->dx = 0;
- ffb->bh = gDRIPriv->fastfill_height;
- ffb->bw = gDRIPriv->fastfill_width * 4;
- ffb->by = FFB_FASTFILL_BLOCK_X;
- ffb->dy = 0;
- ffb->dx = 0;
- ffb->bh = gDRIPriv->pagefill_height;
- ffb->bw = gDRIPriv->pagefill_width * 4;
- ffb->by = FFB_FASTFILL_PAGE;
- ffb->dy = paligned_y;
- ffb->dx = paligned_x;
- ffb->bh = paligned_h;
- ffb->bx = paligned_w;
-
- if (extra_work) {
- struct ff_fixups local_fixups[4];
- int nfixups;
-
- nfixups = CreatorComputePageFillFixups(local_fixups,
- x, y, width, height,
- paligned_x, paligned_y,
- paligned_w, paligned_h);
- FFBFifo(fmesa, 5 + (nfixups * 5));
- ffb->by = FFB_FASTFILL_COLOR_BLK;
- ffb->dy = 0;
- ffb->dx = 0;
- ffb->bh = gDRIPriv->fastfill_height;
- ffb->bw = gDRIPriv->fastfill_width * 4;
-
- while (--nfixups >= 0) {
- int xx, yy, ww, hh;
-
- xx = local_fixups[nfixups].x;
- yy = local_fixups[nfixups].y;
- ffb->dy = yy;
- ffb->dx = xx;
- ww = (local_fixups[nfixups].width +
- (xx & (gDRIPriv->fastfill_width - 1)));
- hh = (local_fixups[nfixups].height +
- (yy & (gDRIPriv->fastfill_height - 1)));
- if (nfixups != 0) {
- ffb->by = FFB_FASTFILL_BLOCK;
- ffb->bh = hh;
- ffb->bw = ww;
- } else {
- ffb->bh = hh;
- ffb->by = FFB_FASTFILL_BLOCK;
- ffb->bx = ww;
- }
- }
- }
- }
-}
-
-void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cwidth, GLint cheight)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- unsigned int stcmask = BUFFER_BIT_STENCIL;
-
-#ifdef CLEAR_TRACE
- fprintf(stderr, "ffbDDClear: mask(%08x) all(%d) "
- "[x(%x)y(%x)w(%x)h(%x)]\n",
- mask, (int) all, cx, cy, cwidth, cheight);
-#endif
- if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS))
- stcmask = 0;
-
- if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH | stcmask)) {
- ffb_fbcPtr ffb = fmesa->regs;
- unsigned int fbc, ppc;
-
- fbc = (FFB_FBC_XE_ON);
- ppc = (FFB_PPC_ACE_DISABLE | FFB_PPC_DCE_DISABLE |
- FFB_PPC_ABE_DISABLE | FFB_PPC_VCE_DISABLE |
- FFB_PPC_APE_DISABLE | FFB_PPC_XS_WID |
- FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST);
-
- /* Y/X enables must be both on or both off. */
- if (mask & (BUFFER_BIT_DEPTH | stcmask)) {
- fbc |= (FFB_FBC_ZE_ON | FFB_FBC_YE_ON | FFB_FBC_WB_C);
- } else
- fbc |= FFB_FBC_ZE_OFF | FFB_FBC_YE_OFF;
-
- /* All RGB enables must be both on or both off. */
- if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) {
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_B;
- else
- fbc |= FFB_FBC_WB_A;
- }
- if (mask & BUFFER_BIT_BACK_LEFT) {
- if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_A;
- else
- fbc |= FFB_FBC_WB_B;
- }
- fbc |= FFB_FBC_RGBE_ON;
- } else
- fbc |= FFB_FBC_RGBE_OFF;
-
- LOCK_HARDWARE(fmesa);
-
- if (dPriv->numClipRects) {
- FFBFifo(fmesa, 8);
- ffb->fbc = fbc;
- ffb->ppc = ppc;
- ffb->xclip = FFB_XCLIP_TEST_ALWAYS;
- ffb->cmp = 0x80808080;
- ffb->rop = FFB_ROP_NEW;
-
- if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT))
- ffb->fg = fmesa->clear_pixel;
- if (mask & BUFFER_BIT_DEPTH)
- ffb->constz = fmesa->clear_depth;
- if (mask & stcmask)
- ffb->consty = fmesa->clear_stencil;
-
- ffb_do_clear(fmesa, dPriv, all, cx, cy, cwidth, cheight);
-
- FFBFifo(fmesa, 6);
- ffb->ppc = fmesa->ppc;
- ffb->fbc = fmesa->fbc;
- ffb->xclip = fmesa->xclip;
- ffb->cmp = fmesa->cmp;
- ffb->rop = fmesa->rop;
- ffb->drawop = fmesa->drawop;
- if (mask & stcmask)
- ffb->consty = fmesa->consty;
- fmesa->ffbScreen->rp_active = 1;
- }
-
- UNLOCK_HARDWARE(fmesa);
-
- mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT |
- BUFFER_BIT_DEPTH | stcmask);
- }
-
- if (mask)
- _swrast_Clear(ctx, mask, all, cx, cy, cwidth, cheight);
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.h
deleted file mode 100644
index 4b707f19b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_clear.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_clear.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
-
-#ifndef _FFB_CLEAR_H
-#define _FFB_CLEAR_H
-
-extern void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cwidth, GLint cheight);
-
-#endif /* !(_FFB_CLEAR_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_context.h
deleted file mode 100644
index 33f6f7cff..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_context.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_context.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
-
-#ifndef _FFB_CONTEXT_H
-#define _FFB_CONTEXT_H
-
-#include "dri_util.h"
-#include "drm.h"
-
-#include "mtypes.h"
-
-#include "ffb_xmesa.h"
-
-typedef struct {
- GLfloat alpha;
- GLfloat red;
- GLfloat green;
- GLfloat blue;
-} ffb_color;
-
-#define FFB_GET_ALPHA(VTX) \
- FFB_COLOR_FROM_FLOAT((VTX)->color[0].alpha)
-#define FFB_GET_RED(VTX) \
- FFB_COLOR_FROM_FLOAT((VTX)->color[0].red)
-#define FFB_GET_GREEN(VTX) \
- FFB_COLOR_FROM_FLOAT((VTX)->color[0].green)
-#define FFB_GET_BLUE(VTX) \
- FFB_COLOR_FROM_FLOAT((VTX)->color[0].blue)
-
-typedef struct {
- GLfloat x, y, z;
- ffb_color color[2];
-} ffb_vertex;
-
-#define FFB_DELAYED_VIEWPORT_VARS \
- GLfloat VP_SX = fmesa->hw_viewport[MAT_SX]; \
- GLfloat VP_TX = fmesa->hw_viewport[MAT_TX]; \
- GLfloat VP_SY = fmesa->hw_viewport[MAT_SY]; \
- GLfloat VP_TY = fmesa->hw_viewport[MAT_TY]; \
- GLfloat VP_SZ = fmesa->hw_viewport[MAT_SZ]; \
- GLfloat VP_TZ = fmesa->hw_viewport[MAT_TZ]; \
- (void) VP_SX; (void) VP_SY; (void) VP_SZ; \
- (void) VP_TX; (void) VP_TY; (void) VP_TZ
-
-#define FFB_GET_Z(VTX) \
- FFB_Z_FROM_FLOAT(VP_SZ * (VTX)->z + VP_TZ)
-#define FFB_GET_Y(VTX) \
- FFB_XY_FROM_FLOAT(VP_SY * (VTX)->y + VP_TY)
-#define FFB_GET_X(VTX) \
- FFB_XY_FROM_FLOAT(VP_SX * (VTX)->x + VP_TX)
-
-typedef void (*ffb_point_func)(GLcontext *, ffb_vertex *);
-typedef void (*ffb_line_func)(GLcontext *, ffb_vertex *, ffb_vertex *);
-typedef void (*ffb_tri_func)(GLcontext *, ffb_vertex *, ffb_vertex *,
- ffb_vertex *);
-typedef void (*ffb_quad_func)(GLcontext *, ffb_vertex *, ffb_vertex *,
- ffb_vertex *, ffb_vertex *);
-
-/* Immediate mode fast-path support. */
-typedef struct {
- GLfloat obj[4];
- GLfloat normal[4];
- GLfloat clip[4];
- GLuint mask;
- GLfloat color[4];
- GLfloat win[4];
- GLfloat eye[4];
-} ffbTnlVertex, *ffbTnlVertexPtr;
-
-typedef void (*ffb_interp_func)(GLfloat t,
- ffbTnlVertex *O,
- const ffbTnlVertex *I,
- const ffbTnlVertex *J);
-
-struct ffb_current_state {
- GLfloat color[4];
- GLfloat normal[4];
- GLfloat specular[4];
-};
-
-struct ffb_light_state {
- GLfloat base_color[3];
- GLfloat base_alpha;
-};
-
-struct ffb_vertex_state {
- struct ffb_current_state current;
- struct ffb_light_state light;
-};
-
-struct ffb_imm_vertex {
- ffbTnlVertex vertices[8];
- ffbTnlVertex *v0;
- ffbTnlVertex *v1;
- ffbTnlVertex *v2;
- ffbTnlVertex *v3;
-
- void (*save_vertex)(GLcontext *ctx, ffbTnlVertex *v);
- void (*flush_vertex)(GLcontext *ctx, ffbTnlVertex *v);
-
- ffb_interp_func interp;
-
- GLuint prim, format;
-
- GLvertexformat vtxfmt;
-};
-
-typedef struct ffb_context_t {
- GLcontext *glCtx;
- GLframebuffer *glBuffer;
-
- ffb_fbcPtr regs;
- volatile char *sfb32;
-
- int hw_locked;
-
- int back_buffer; /* 0 = bufferA, 1 = bufferB */
-
- /* Viewport matrix. */
- GLfloat hw_viewport[16];
-#define SUBPIXEL_X (-0.5F)
-#define SUBPIXEL_Y (-0.5F + 0.125)
-
- /* Vertices in driver format. */
- ffb_vertex *verts;
-
- /* Rasterization functions. */
- ffb_point_func draw_point;
- ffb_line_func draw_line;
- ffb_tri_func draw_tri;
- ffb_quad_func draw_quad;
-
- GLenum raster_primitive;
- GLenum render_primitive;
-
- GLfloat backface_sign;
- GLfloat depth_scale;
-
- GLfloat ffb_2_30_fixed_scale;
- GLfloat ffb_one_over_2_30_fixed_scale;
- GLfloat ffb_16_16_fixed_scale;
- GLfloat ffb_one_over_16_16_fixed_scale;
- GLfloat ffb_ubyte_color_scale;
- GLfloat ffb_zero;
-
- /* Immediate mode state. */
- struct ffb_vertex_state vtx_state;
- struct ffb_imm_vertex imm;
-
- /* Debugging knobs. */
- GLboolean debugFallbacks;
-
- /* This records state bits when a per-fragment attribute has
- * been set which prevents us from rendering in hardware.
- *
- * As attributes change, some of these bits may clear as
- * we move back within the chips capabilities. If they
- * all clear, we return to full hw rendering.
- */
- unsigned int bad_fragment_attrs;
-#define FFB_BADATTR_FOG 0x00000001 /* Bad fog possible only when < FFB2 */
-#define FFB_BADATTR_BLENDFUNC 0x00000002 /* Any non-const func based upon dst alpha */
-#define FFB_BADATTR_BLENDROP 0x00000004 /* Blend enabled and LogicOP != GL_COPY */
-#define FFB_BADATTR_BLENDEQN 0x00000008 /* Blend equation other than ADD */
-#define FFB_BADATTR_STENCIL 0x00000010 /* Stencil enabled when < FFB2+ */
-#define FFB_BADATTR_TEXTURE 0x00000020 /* Texture enabled */
-#define FFB_BADATTR_SWONLY 0x00000040 /* Environment var set */
-
- unsigned int state_dirty;
- unsigned int state_fifo_ents;
-#define FFB_STATE_FBC 0x00000001
-#define FFB_STATE_PPC 0x00000002
-#define FFB_STATE_DRAWOP 0x00000004
-#define FFB_STATE_ROP 0x00000008
-#define FFB_STATE_LPAT 0x00000010
-#define FFB_STATE_PMASK 0x00000020
-#define FFB_STATE_XPMASK 0x00000040
-#define FFB_STATE_YPMASK 0x00000080
-#define FFB_STATE_ZPMASK 0x00000100
-#define FFB_STATE_XCLIP 0x00000200
-#define FFB_STATE_CMP 0x00000400
-#define FFB_STATE_MATCHAB 0x00000800
-#define FFB_STATE_MAGNAB 0x00001000
-#define FFB_STATE_MATCHC 0x00002000
-#define FFB_STATE_MAGNC 0x00004000
-#define FFB_STATE_DCUE 0x00008000
-#define FFB_STATE_BLEND 0x00010000
-#define FFB_STATE_CLIP 0x00020000
-#define FFB_STATE_STENCIL 0x00040000
-#define FFB_STATE_APAT 0x00080000
-#define FFB_STATE_WID 0x00100000
-#define FFB_STATE_ALL 0x001fffff
-
- unsigned int state_all_fifo_ents;
-
-#define FFB_MAKE_DIRTY(FMESA, STATE_MASK, FIFO_ENTS) \
-do { if ((STATE_MASK) & ~((FMESA)->state_dirty)) { \
- (FMESA)->state_dirty |= (STATE_MASK); \
- (FMESA)->state_fifo_ents += FIFO_ENTS; \
- } \
-} while (0)
-
- /* General hw reg state. */
- unsigned int fbc;
- unsigned int ppc;
- unsigned int drawop;
- unsigned int rop;
-
- unsigned int lpat;
-#define FFB_LPAT_BAD 0xffffffff
-
- unsigned int wid;
- unsigned int pmask;
- unsigned int xpmask;
- unsigned int ypmask;
- unsigned int zpmask;
- unsigned int xclip;
- unsigned int cmp;
- unsigned int matchab;
- unsigned int magnab;
- unsigned int matchc;
- unsigned int magnc;
-
- /* Depth cue unit hw reg state. */
- unsigned int dcss; /* All FFB */
- unsigned int dcsf; /* All FFB */
- unsigned int dcsb; /* All FFB */
- unsigned int dczf; /* All FFB */
- unsigned int dczb; /* All FFB */
- unsigned int dcss1; /* >=FFB2 only */
- unsigned int dcss2; /* >=FFB2 only */
- unsigned int dcss3; /* >=FFB2 only */
- unsigned int dcs2; /* >=FFB2 only */
- unsigned int dcs3; /* >=FFB2 only */
- unsigned int dcs4; /* >=FFB2 only */
- unsigned int dcd2; /* >=FFB2 only */
- unsigned int dcd3; /* >=FFB2 only */
- unsigned int dcd4; /* >=FFB2 only */
-
- /* Blend unit hw reg state. */
- unsigned int blendc;
- unsigned int blendc1;
- unsigned int blendc2;
-
- /* ViewPort clipping hw reg state. */
- unsigned int vclipmin;
- unsigned int vclipmax;
- unsigned int vclipzmin;
- unsigned int vclipzmax;
- struct {
- unsigned int min;
- unsigned int max;
- } aux_clips[4];
-
- /* Stencil control hw reg state. >=FFB2+ only. */
- unsigned int stencil;
- unsigned int stencilctl;
- unsigned int consty; /* Stencil Ref */
-
- /* Area pattern (used for polygon stipples). */
- unsigned int pattern[32];
-
- /* Fog state. */
- float Znear, Zfar;
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
-
- unsigned int clear_pixel;
- unsigned int clear_depth;
- unsigned int clear_stencil;
-
- unsigned int setupindex;
- unsigned int setupnewinputs;
- unsigned int new_gl_state;
-
- __DRIdrawablePrivate *driDrawable;
- __DRIscreenPrivate *driScreen;
- ffbScreenPrivate *ffbScreen;
- ffb_dri_state_t *ffb_sarea;
-} ffbContextRec, *ffbContextPtr;
-
-#define FFB_CONTEXT(ctx) ((ffbContextPtr)((ctx)->DriverCtx))
-
-/* We want the depth values written during software rendering
- * to match what the hardware is going to put there when we
- * hw render.
- *
- * The Z buffer is 28 bits deep. Smooth shaded primitives
- * specify a 2:30 signed fixed point Z value in the range 0.0
- * to 1.0 inclusive.
- *
- * So for example, when hw rendering, the largest Z value of
- * 1.0 would produce a value of 0x0fffffff in the actual Z
- * buffer, which is the maximum value.
- *
- * Mesa's depth type is a 32-bit int, so we use the following macro
- * to convert to/from FFB hw Z values. Note we also have to clear
- * out the top bits as that is where the Y (stencil) buffer is stored
- * and during hw Z buffer reads it is always there. (During writes
- * we tell the hw to discard those top 4 bits).
- */
-#define Z_TO_MESA(VAL) ((GLdepth)(((VAL) & 0x0fffffff) << (32 - 28)))
-#define Z_FROM_MESA(VAL) (((GLuint)((GLdouble)(VAL))) >> (32 - 28))
-
-#endif /* !(_FFB_CONTEXT_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.c
deleted file mode 100644
index 53423bbae..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.4 2002/09/11 19:49:07 tsi Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "mm.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "ffb_tris.h"
-#include "ffb_clear.h"
-#include "ffb_lock.h"
-#include "extensions.h"
-
-#define FFB_DATE "20021125"
-
-PUBLIC const char __driConfigOptions[] = { 0 };
-const GLuint __driNConfigOptions = 0;
-
-/* Mesa's Driver Functions */
-
-static const GLubyte *ffbDDGetString(GLcontext *ctx, GLenum name)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- static char buffer[128];
-
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *) "David S. Miller";
-
- case GL_RENDERER:
- sprintf(buffer, "Mesa DRI FFB " FFB_DATE);
-
- if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2)
- strncat(buffer, " FFB2", 5);
- if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)
- strncat(buffer, " FFB2PLUS", 9);
- if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1)
- strncat(buffer, " PAC1", 5);
- if (fmesa->ffb_sarea->flags & FFB_DRI_PAC2)
- strncat(buffer, " PAC2", 5);
-
-#ifdef USE_SPARC_ASM
- strncat(buffer, " Sparc", 6);
-#endif
-
- return (GLubyte *) buffer;
-
- default:
- return NULL;
- };
-}
-
-
-static void ffbBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- LOCK_HARDWARE(fmesa);
- *width = fmesa->driDrawable->w;
- *height = fmesa->driDrawable->h;
- UNLOCK_HARDWARE(fmesa);
-}
-
-void ffbDDExtensionsInit(GLcontext *ctx)
-{
- /* Nothing for now until we start to add
- * real acceleration. -DaveM
- */
-
- /* XXX Need to turn off GL_EXT_blend_func_separate for one.
- * XXX Also BlendEquation should be turned off too, what
- * XXX EXT is that assosciated with?
- */
-}
-
-static void ffbDDFinish(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- LOCK_HARDWARE(fmesa);
- FFBWait(fmesa, fmesa->regs);
- UNLOCK_HARDWARE(fmesa);
-}
-
-void ffbDDInitDriverFuncs(GLcontext *ctx)
-{
- ctx->Driver.GetBufferSize = ffbBufferSize;
- ctx->Driver.GetString = ffbDDGetString;
- ctx->Driver.Clear = ffbDDClear;
-
- ctx->Driver.Finish = ffbDDFinish;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.h
deleted file mode 100644
index 4ffcbe666..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_dd.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.h,v 1.1 2000/06/20 05:08:38 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D.
- * Copyright (C) 2000 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#ifndef _FFB_DD_H
-#define _FFB_DD_H
-
-#include "context.h"
-
-void ffbDDInitDriverFuncs(GLcontext *ctx);
-void ffbDDExtensionsInit(GLcontext *ctx);
-
-#endif /* !(_FFB_DD_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.c
deleted file mode 100644
index 68a2450eb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_depth.c,v 1.2 2002/02/22 21:32:58 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_context.h"
-#include "ffb_depth.h"
-#include "ffb_lock.h"
-
-#include "swrast/swrast.h"
-
-#undef DEPTH_TRACE
-
-static void FFBWriteDepthSpan( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte mask[] )
-{
- const GLuint *depth = (const GLuint *) values;
-#ifdef DEPTH_TRACE
- fprintf(stderr, "FFBWriteDepthSpan: n(%d) x(%d) y(%d)\n",
- (int) n, x, y);
-#endif
- if (ctx->Depth.Mask) {
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- GLuint *zptr;
- GLuint i;
-
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_ON |
- FFB_FBC_YE_OFF | FFB_FBC_RGBE_OFF);
- fmesa->regs->ppc = FFB_PPC_ZS_VAR;
- FFBWait(fmesa, fmesa->regs);
-
- y = (dPriv->h - y);
- zptr = (GLuint *)
- ((char *)fmesa->sfb32 +
- ((dPriv->x + x) << 2) +
- ((dPriv->y + y) << 13));
-
- for (i = 0; i < n; i++) {
- if (mask[i]) {
- *zptr = Z_FROM_MESA(depth[i]);
- }
- zptr++;
- }
-
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->regs->ppc = fmesa->ppc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
- }
-}
-
-static void FFBWriteMonoDepthSpan( 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;
- FFBWriteDepthSpan(ctx, rb, n, x, y, depths, mask);
-}
-
-static void FFBWriteDepthPixels( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[],
- const GLint y[],
- const void *values,
- const GLubyte mask[] )
-{
- const GLuint *depth = (const GLuint *) values;
-#ifdef DEPTH_TRACE
- fprintf(stderr, "FFBWriteDepthPixels: n(%d)\n", (int) n);
-#endif
- if (ctx->Depth.Mask) {
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- char *zbase;
- GLuint i;
-
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_ON |
- FFB_FBC_YE_OFF | FFB_FBC_RGBE_OFF);
- fmesa->regs->ppc = FFB_PPC_ZS_VAR;
- fmesa->ffbScreen->rp_active = 1;
- FFBWait(fmesa, fmesa->regs);
-
- zbase = ((char *)fmesa->sfb32 +
- (dPriv->x << 2) + (dPriv->y << 13));
-
- for (i = 0; i < n; i++) {
- GLint y1 = (dPriv->h - y[i]);
- GLint x1 = x[i];
- GLuint *zptr;
-
- zptr = (GLuint *)
- (zbase + (x1 << 2) + (y1 << 13));
- if (mask[i])
- *zptr = Z_FROM_MESA(depth[i]);
- }
-
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->regs->ppc = fmesa->ppc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
- }
-}
-
-static void FFBReadDepthSpan( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values )
-{
- GLuint *depth = (GLuint *) values;
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- GLuint *zptr;
- GLuint i;
-
-#ifdef DEPTH_TRACE
- fprintf(stderr, "FFBReadDepthSpan: n(%d) x(%d) y(%d)\n",
- (int) n, x, y);
-#endif
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = FFB_FBC_RB_C;
- fmesa->ffbScreen->rp_active = 1;
- FFBWait(fmesa, fmesa->regs);
-
- y = (dPriv->h - y);
- zptr = (GLuint *)
- ((char *)fmesa->sfb32 +
- ((dPriv->x + x) << 2) +
- ((dPriv->y + y) << 13));
-
- for (i = 0; i < n; i++) {
- depth[i] = Z_TO_MESA(*zptr);
- zptr++;
- }
-
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
-}
-
-static void FFBReadDepthPixels( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- void *values )
-{
- GLuint *depth = (GLuint *) values;
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- char *zbase;
- GLuint i;
-
-#ifdef DEPTH_TRACE
- fprintf(stderr, "FFBReadDepthPixels: n(%d)\n", (int) n);
-#endif
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = FFB_FBC_RB_C;
- fmesa->ffbScreen->rp_active = 1;
- FFBWait(fmesa, fmesa->regs);
-
- zbase = ((char *)fmesa->sfb32 +
- (dPriv->x << 2) + (dPriv->y << 13));
-
- for (i = 0; i < n; i++) {
- GLint y1 = (dPriv->h - y[i]);
- GLint x1 = x[i];
- GLuint *zptr;
-
- zptr = (GLuint *)
- (zbase + (x1 << 2) + (y1 << 13));
- depth[i] = Z_TO_MESA(*zptr);
- }
-
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
-}
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- assert(drb->Base.InternalFormat == GL_DEPTH_COMPONENT16);
- drb->Base.GetRow = FFBReadDepthSpan;
- drb->Base.GetValues = FFBReadDepthPixels;
- drb->Base.PutRow = FFBWriteDepthSpan;
- drb->Base.PutMonoRow = FFBWriteMonoDepthSpan;
- drb->Base.PutValues = FFBWriteDepthPixels;
- drb->Base.PutMonoValues = NULL;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.h
deleted file mode 100644
index db908e7a6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_depth.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_depth.h,v 1.1 2000/06/20 05:08:38 dawes Exp $ */
-
-#ifndef _FFB_DEPTH_H
-#define _FFB_DEPTH_H
-
-void ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis);
-
-#endif /* !(_FFB_DEPTH_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fifo.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fifo.h
deleted file mode 100644
index 886d71b76..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fifo.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_fifo.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
-
-#ifndef _FFB_FIFO_H
-#define _FFB_FIFO_H
-
-#define FFBFifo(__fmesa, __n) \
-do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \
- int __cur_slots = __fScrn->fifo_cache; \
- if ((__cur_slots - (__n)) < 0) { \
- ffb_fbcPtr __ffb = __fmesa->regs; \
- do { __cur_slots = (((int)__ffb->ucsr & FFB_UCSR_FIFO_MASK) - 4); \
- } while ((__cur_slots - (__n)) < 0); \
- } (__fScrn)->fifo_cache = (__cur_slots - (__n)); \
-} while(0)
-
-#define FFBWait(__fmesa, __ffb) \
-do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \
- if (__fScrn->rp_active) { \
- unsigned int __regval = (__ffb)->ucsr; \
- while((__regval & FFB_UCSR_ALL_BUSY) != 0) { \
- __regval = (__ffb)->ucsr; \
- } \
- __fScrn->fifo_cache = ((int)(__regval & FFB_UCSR_FIFO_MASK)) - 4; \
- __fScrn->rp_active = 0; \
- } \
-} while(0)
-
-#endif /* !(_FFB_FIFO_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fog.c
deleted file mode 100644
index e6eca2390..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_fog.c
+++ /dev/null
@@ -1,73 +0,0 @@
-
-/* FFB fog support:
- *
- * There are two levels of support for FOG in the Creator3D series.
- * Both involve a depth cue unit and 1 or 4 slope factors and scales
- * for varying the pixel intensity.
- *
- * Chips prior to FFB2 only have a single set of such settings, FFB2
- * and later have 4 settings.
- *
- * The basic depth cueing equation is:
- *
- * C_final = dcsf(z) * C_orig + (1 - dcsf(z)) * C_fog
- *
- * C_final -- The final color passed to blend unit or frame
- * buffer (if blending is disabled).
- *
- * C_orig -- The color we start with, which comes either from
- * the raster processor or cpu writes to the smart
- * framebuffer aperture.
- *
- * C_fog -- This is the "fog" color, ie. the desired color
- * at the deepest Z.
- *
- * dcsf(z) -- The depth cue scale as a function of Z.
- *
- * With pre-FFB2 chips there are four parameters to control the depth
- * cue scaling. Here is a diagram:
- *
- * 1.0 -------------
- * | | | |
- * | | | |
- * Sfront XXXXX---+---+
- * | |X | |
- * dcsf(z) | | X | |
- * | | X| |
- * Sback +---+---XXXXX
- * | | | |
- * 0.0 -------------
- * 0.0 Zf Zb 1.0
- *
- * z
- * Therefore:
- *
- * for Zf < z < Zb
- *
- * dcsf(z) = Sback + ((Sfront - Sback) / (Zf - Zb)) * (Zb - z)
- *
- * for z <= Zf
- *
- * dcsf(z) = Sfront
- *
- * for z >= Zb
- *
- * dcsf(z) = Sback
- *
- * With FFB2 and later, 3 more slope regions are provided, the first of
- * them starts at the end of the region defined above and ends at a
- * specified depth value, the next slop region starts there and ends
- * at the next specified depth value, and so on. Each of the 3 slope
- * regions also have scale and slope settings of their own.
- *
- * The C_fog color is programmed into the alpha blending unit color1
- * and color2 registers as follows:
- *
- * color1: -(C_fog)
- * color2: C_fog - bg
- *
- * If alpha blending is disabled, the bg factor is zero. Note that
- * the alpha blending color registers specify each of the RGB values
- * as 9 bit 1:8 signed numbers in the range -1.00 to 0.ff inclusive.
- * (ie. 0x100 == -1.00 and 0x0ff == +0.ff)
- */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.c
deleted file mode 100644
index da1de18f3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c,v 1.2 2002/02/22 21:32:58 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "mm.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "ffb_lines.h"
-#include "ffb_tris.h"
-#include "ffb_lock.h"
-#include "extensions.h"
-
-#undef FFB_LINE_TRACE
-
-#define FFB_LINE_FLAT_BIT 0x01
-#define FFB_LINE_ALPHA_BIT 0x02
-#define MAX_FFB_LINE_FUNCS 0x04
-
-static ffb_line_func ffb_line_tab[MAX_FFB_LINE_FUNCS];
-
-/* If the line is not wide, we can support all of the line
- * patterning and smooth shading features of OpenGL fully.
- */
-
-#define IND (0)
-#define TAG(x) x
-#include "ffb_linetmp.h"
-
-#define IND (FFB_LINE_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "ffb_linetmp.h"
-
-#define IND (FFB_LINE_ALPHA_BIT)
-#define TAG(x) x##_alpha
-#include "ffb_linetmp.h"
-
-#define IND (FFB_LINE_ALPHA_BIT|FFB_LINE_FLAT_BIT)
-#define TAG(x) x##_alpha_flat
-#include "ffb_linetmp.h"
-
-void ffbDDLinefuncInit(void)
-{
- init();
- init_flat();
- init_alpha();
- init_alpha_flat();
-}
-
-static void ffb_dd_line( GLcontext *ctx, GLuint e0, GLuint e1 )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_vertex *v0 = &fmesa->verts[e0];
- ffb_vertex *v1 = &fmesa->verts[e1];
- fmesa->draw_line( ctx, v0, v1 );
-}
-
-void ffbChooseLineState(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint ind = 0;
-
- tnl->Driver.Render.Line = ffb_dd_line;
-
- if (flags & DD_FLATSHADE)
- ind |= FFB_LINE_FLAT_BIT;
-
- if ((flags & DD_LINE_STIPPLE) != 0 &&
- fmesa->lpat == FFB_LPAT_BAD) {
- fmesa->draw_line = ffb_fallback_line;
- return;
- }
-
- /* If blending or the alpha test is enabled we need to
- * provide alpha components to the chip, else we can
- * do without it and thus feed vertex data to the chip
- * more efficiently.
- */
- if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled)
- ind |= FFB_LINE_ALPHA_BIT;
-
- fmesa->draw_line = ffb_line_tab[ind];
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.h
deleted file mode 100644
index d508c243e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lines.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
-
-#ifndef _FFB_LINES_H
-#define _FFB_LINES_H
-
-#include "ffb_context.h"
-
-#define _FFB_NEW_LINE (_DD_NEW_FLATSHADE | \
- _DD_NEW_LINE_WIDTH | \
- _DD_NEW_LINE_STIPPLE | \
- _DD_NEW_LINE_SMOOTH | \
- _NEW_COLOR)
-
-extern void ffbDDLinefuncInit(void);
-extern void ffbChooseLineState(GLcontext *);
-extern void ffb_fallback_line( GLcontext *ctx, ffb_vertex *v0, ffb_vertex *v1 );
-
-#endif /* !(_FFB_LINES_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_linetmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_linetmp.h
deleted file mode 100644
index 0951513ca..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_linetmp.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_linetmp.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
-
-static __inline void TAG(ffb_line)(GLcontext *ctx, ffb_vertex *v0,
- ffb_vertex *v1 )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_fbcPtr ffb = fmesa->regs;
-#if (IND & FFB_LINE_FLAT_BIT)
- const GLuint const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( v1->color[0] );
-#endif
- FFB_DELAYED_VIEWPORT_VARS;
-
-#ifdef FFB_LINE_TRACE
- fprintf(stderr, "FFB: ffb_line ["
-#if (IND & FFB_LINE_FLAT_BIT)
- " FLAT"
-#endif
-#if (IND & FFB_LINE_ALPHA_BIT)
- " ALPHA"
-#endif
- " ]\n");
-#endif
-
-#if (IND & FFB_LINE_FLAT_BIT)
- FFBFifo(fmesa, 1);
- ffb->fg = const_fg;
-#ifdef FFB_LINE_TRACE
- fprintf(stderr, "FFB: ffb_line confg_fg[%08x]\n", const_fg);
-#endif
-#endif
-
-#if (IND & FFB_LINE_FLAT_BIT)
- /* (2 * 3) + 1 */
- FFBFifo(fmesa, 7);
-#else
-#if (IND & FFB_LINE_ALPHA_BIT)
- /* (2 * 7) + 1 */
- FFBFifo(fmesa, 15);
-#else
- /* (2 * 6) + 1 */
- FFBFifo(fmesa, 13);
-#endif
-#endif
-
- /* Using DDLINE or AALINE, init the line pattern state. */
- ffb->lpat = fmesa->lpat;
-
-#if !(IND & FFB_LINE_FLAT_BIT)
-#if (IND & FFB_LINE_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v0);
-#endif
- ffb->red = FFB_GET_RED(v0);
- ffb->green = FFB_GET_GREEN(v0);
- ffb->blue = FFB_GET_BLUE(v0);
-#endif
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
-#if !(IND & FFB_LINE_FLAT_BIT)
-#if (IND & FFB_LINE_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v1);
-#endif
- ffb->red = FFB_GET_RED(v1);
- ffb->green = FFB_GET_GREEN(v1);
- ffb->blue = FFB_GET_BLUE(v1);
-#endif
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(init)(void)
-{
- ffb_line_tab[IND] = TAG(ffb_line);
-}
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lock.h
deleted file mode 100644
index 7c49f740f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_lock.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lock.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_LOCK_H
-#define _FFB_LOCK_H
-
-#include "ffb_context.h"
-
-extern void ffbXMesaUpdateState(ffbContextPtr fmesa);
-#define FFB_UPDATE_STATE(fmesa) ffbXMesaUpdateState(fmesa)
-
-/* Lock the hardware and validate our state. This hardware can only ever
- * exist on SPARC platforms. Don't bother building the real LOCK_HARDWARE and
- * UNLOCK_HARDWARE code on non-SPARC platforms. The only reason the driver
- * gets built on non-SPARC is to catch build breakages earlier.
- */
-#if !defined(__sparc__)
-#define LOCK_HARDWARE(fmesa)
-#define UNLOCK_HARDWARE(fmesa)
-#else
-#define LOCK_HARDWARE(fmesa) \
- do { \
- DRM_CAS_RESULT(__ret); \
- DRM_CAS(fmesa->driHwLock, fmesa->hHWContext, \
- (DRM_LOCK_HELD | fmesa->hHWContext), __ret);\
- if (__ret) { \
- drmGetLock(fmesa->driFd, fmesa->hHWContext, 0); \
- FFB_UPDATE_STATE(fmesa); \
- } \
- } while (0)
-
-
-/* Unlock the hardware. */
-#define UNLOCK_HARDWARE(fmesa) \
- DRM_UNLOCK(fmesa->driFd, fmesa->driHwLock, fmesa->hHWContext);
-#endif
-
-#endif /* !(_FFB_LOCK_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.c
deleted file mode 100644
index a7496dd1d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.c,v 1.2 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "ffb_dd.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "ffb_points.h"
-#include "ffb_tris.h"
-#include "ffb_lock.h"
-
-
-#undef FFB_POINT_TRACE
-
-#define FFB_POINT_AA_BIT 0x01
-
-static ffb_point_func ffb_point_tab[0x08];
-
-#define IND (0)
-#define TAG(x) x
-#include "ffb_pointtmp.h"
-
-#define IND (FFB_POINT_AA_BIT)
-#define TAG(x) x##_aa
-#include "ffb_pointtmp.h"
-
-void ffbDDPointfuncInit(void)
-{
- init();
- init_aa();
-}
-
-static void ffb_dd_points( GLcontext *ctx, GLuint first, GLuint last )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_vertex *fverts = fmesa->verts;
- int i;
-
- if (VB->Elts == 0) {
- for ( i = first ; i < last ; i++ ) {
- if ( VB->ClipMask[i] == 0 ) {
- fmesa->draw_point( ctx, &fverts[i] );
- }
- }
- } else {
- for ( i = first ; i < last ; i++ ) {
- GLuint e = VB->Elts[i];
- if ( VB->ClipMask[e] == 0 ) {
- fmesa->draw_point( ctx, &fverts[e] );
- }
- }
- }
-}
-
-void ffbChoosePointState(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint ind = 0;
-
- tnl->Driver.Render.Points = ffb_dd_points;
-
- if (flags & DD_POINT_SMOOTH)
- ind |= FFB_POINT_AA_BIT;
-
- fmesa->draw_point = ffb_point_tab[ind];
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.h
deleted file mode 100644
index 7d5c1f8a0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_points.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_POINTS_H
-#define _FFB_POINTS_H
-
-extern void ffbDDPointfuncInit(void);
-
-#define _FFB_NEW_POINT (_DD_NEW_POINT_SIZE | \
- _DD_NEW_POINT_SMOOTH | \
- _NEW_COLOR)
-
-extern void ffbChoosePointState(GLcontext *);
-extern void ffb_fallback_point( GLcontext *ctx, ffb_vertex *v0 );
-
-#endif /* !(_FFB_POINTS_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_pointtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_pointtmp.h
deleted file mode 100644
index 310c95d89..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_pointtmp.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_pointtmp.h,v 1.3 2002/02/22 21:32:59 dawes Exp $ */
-
-static __inline void TAG(ffb_draw_point)(GLcontext *ctx, ffb_vertex *tmp )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_fbcPtr ffb = fmesa->regs;
- FFB_DELAYED_VIEWPORT_VARS;
-
-#ifdef FFB_POINT_TRACE
- fprintf(stderr, "FFB: ffb_point ["
-#if (IND & FFB_POINT_AA_BIT)
- "AA"
-#endif
- "] X(%f) Y(%f) Z(%f)\n",
- tmp->x, tmp->y, tmp->z);
-#endif
-
-#if (IND & FFB_POINT_AA_BIT)
- FFBFifo(fmesa, 4);
-
- ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( tmp->color[0] );
- ffb->z = FFB_GET_Z(tmp);
- ffb->y = FFB_GET_Y(tmp) + 0x8000 /* FIX ME */;
- ffb->x = FFB_GET_X(tmp) + 0x8000 /* FIX ME */;
-#else
- {
- unsigned int const_fg, const_z, h, w;
-
- const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( tmp->color[0] );
- const_z = Z_FROM_MESA(FFB_Z_TO_FLOAT(FFB_GET_Z(tmp)));
- h = FFB_GET_Y(tmp) >> 16;
- w = FFB_GET_X(tmp) >> 16;
-#ifdef FFB_POINT_TRACE
- fprintf(stderr, "FFB: ffb_point fg(%08x) z(%08x) h(%08x) w(%08x)\n",
- const_fg, const_z, h, w);
-#endif
- FFBFifo(fmesa, 4);
- ffb->fg = const_fg;
- ffb->constz = const_z;
- ffb->bh = h;
- ffb->bw = w;
- }
-#endif
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-
-static void TAG(init)(void)
-{
- ffb_point_tab[IND] = TAG(ffb_draw_point);
-}
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_rendertmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_rendertmp.h
deleted file mode 100644
index 26d991b08..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_rendertmp.h
+++ /dev/null
@@ -1,646 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h,v 1.2 2003/01/29 23:00:40 dawes Exp $ */
-
-#define IMPL_LOCAL_VARS \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
- ffb_fbcPtr ffb = fmesa->regs; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- FFB_DELAYED_VIEWPORT_VARS; \
- (void) fmesa; (void) ffb; (void) elt
-
-#if (IND & FFB_FLAT_BIT)
-#define FFB_DECLARE_CACHED_COLOR(NAME) \
- unsigned int NAME;
-#define FFB_COMPUTE_CACHED_COLOR(NAME, VTX) \
- NAME = FFB_PACK_CONST_UBYTE_ARGB_COLOR((VTX)->color[0])
-#define FFB_CACHED_COLOR_SAME(NAME1, NAME2) \
- ((NAME1) == (NAME2))
-#define FFB_CACHED_COLOR_SET(NAME) \
- ffb->fg = (NAME)
-#define FFB_CACHED_COLOR_UPDATE(NAME1, NAME2) \
- ffb->fg = (NAME1) = (NAME2)
-#define FFB_SET_PRIM_COLOR(COLOR_VERTEX) \
- ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR((COLOR_VERTEX)->color[0])
-#define FFB_PRIM_COLOR_COST 1
-#define FFB_SET_VERTEX_COLOR(VTX) /**/
-#define FFB_VERTEX_COLOR_COST 0
-#else
-#define FFB_DECLARE_CACHED_COLOR(NAME) /**/
-#define FFB_COMPUTE_CACHED_COLOR(NAME, VTX) /**/
-#define FFB_CACHED_COLOR_SAME(NAME1, NAME2) 0
-#define FFB_CACHED_COLOR_SET(NAME1) /**/
-#define FFB_CACHED_COLOR_UPDATE(NAME1, NAME2) /**/
-#define FFB_SET_PRIM_COLOR(COLOR_VERTEX) /**/
-#define FFB_PRIM_COLOR_COST 0
-#if (IND & FFB_ALPHA_BIT)
-#define FFB_SET_VERTEX_COLOR(VTX) \
- ffb->alpha = FFB_GET_ALPHA(VTX); \
- ffb->red = FFB_GET_RED(VTX); \
- ffb->green = FFB_GET_GREEN(VTX); \
- ffb->blue = FFB_GET_BLUE(VTX)
-#define FFB_VERTEX_COLOR_COST 4
-#else
-#define FFB_SET_VERTEX_COLOR(VTX) \
- ffb->red = FFB_GET_RED(VTX); \
- ffb->green = FFB_GET_GREEN(VTX); \
- ffb->blue = FFB_GET_BLUE(VTX)
-#define FFB_VERTEX_COLOR_COST 3
-#endif
-#endif
-
-#define RESET_STIPPLE ffb->lpat = fmesa->lpat;
-
-#if !(IND & (FFB_TRI_CULL_BIT))
-static void TAG(ffb_vb_points)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_POINTS);
- if (ctx->_TriangleCaps & DD_POINT_SMOOTH) {
- for (i = start; i < count; i++) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i)];
-
- FFBFifo(fmesa, 4);
- ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR(v0->color[0]);
- ffb->z = FFB_GET_Z(v0);
- ffb->y = FFB_GET_Y(v0) + 0x8000 /* FIX ME */;
- ffb->x = FFB_GET_X(v0) + 0x8000 /* FIX ME */;
- }
- } else {
- for (i = start; i < count; i++) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i)];
- FFBFifo(fmesa, 4);
- ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR(v0->color[0]);
- ffb->constz = Z_FROM_MESA(FFB_Z_TO_FLOAT(FFB_GET_Z(v0)));
- ffb->bh = FFB_GET_Y(v0) >> 16;
- ffb->bw = FFB_GET_X(v0) >> 16;
- }
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_lines)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_LINES);
- for (i = start + 1; i < count; i += 2) {
- ffb_vertex *v0 = &fmesa->verts[i - 1];
- ffb_vertex *v1 = &fmesa->verts[i - 0];
-
- FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 2) + 6));
-
- RESET_STIPPLE;
-
- FFB_SET_PRIM_COLOR(v1);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
- }
-}
-
-static void TAG(ffb_vb_line_loop)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_LINE_LOOP);
- if ((flags & PRIM_BEGIN) != 0) {
- ffb_vertex *v0 = &fmesa->verts[ELT(start + 0)];
- ffb_vertex *v1 = &fmesa->verts[ELT(start + 1)];
-
- FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST +
- ((FFB_VERTEX_COLOR_COST * 2) + (3 * 2))));
-
- RESET_STIPPLE;
-
- FFB_SET_PRIM_COLOR(v1);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
- }
- for (i = start + 2; i < count; i++) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i)];
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST + 3)));
-
- FFB_SET_PRIM_COLOR(v0);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->y = FFB_GET_Y(v0);
- ffb->x = FFB_GET_X(v0);
- }
- if ((flags & PRIM_END) != 0) {
- ffb_vertex *v0 = &fmesa->verts[ELT(start)];
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST + 3)));
-
- FFB_SET_PRIM_COLOR(v0);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->y = FFB_GET_Y(v0);
- ffb->x = FFB_GET_X(v0);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_line_strip)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- FFB_DECLARE_CACHED_COLOR(cached_fg)
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_LINE_STRIP);
- FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST +
- ((FFB_VERTEX_COLOR_COST * 2) + (3 * 2))));
-
- RESET_STIPPLE;
-
- {
- ffb_vertex *v0 = &fmesa->verts[ELT(start + 0)];
- ffb_vertex *v1 = &fmesa->verts[ELT(start + 1)];
-
- FFB_COMPUTE_CACHED_COLOR(cached_fg, v0);
- FFB_CACHED_COLOR_SET(cached_fg);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
- }
-
- for (i = start + 2; i < count; i++) {
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 0)];
- FFB_DECLARE_CACHED_COLOR(new_fg)
-
- FFB_COMPUTE_CACHED_COLOR(new_fg, v1);
- if (FFB_CACHED_COLOR_SAME(cached_fg, new_fg)) {
- FFBFifo(fmesa, ((FFB_VERTEX_COLOR_COST * 1) + (3 * 1)));
- } else {
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 1) + (3 * 1)));
- FFB_CACHED_COLOR_UPDATE(cached_fg, new_fg);
- }
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-#endif /* !(IND & (FFB_TRI_CULL_BIT)) */
-
-/* OK, now things start getting fun :-) */
-#if (IND & (FFB_TRI_CULL_BIT))
-#define FFB_AREA_DECLARE GLfloat cc, ex, ey, fx, fy;
-#define FFB_COMPUTE_AREA_TRI(V0, V1, V2) \
-{ ex = (V1)->x - (V0)->x; \
- ey = (V1)->y - (V0)->y; \
- fx = (V2)->x - (V0)->x; \
- fy = (V2)->y - (V0)->y; \
- cc = ex*fy-ey*fx; \
-}
-#define FFB_COMPUTE_AREA_QUAD(V0, V1, V2, V3) \
-{ ex = (V2)->x - (V0)->x; \
- ey = (V2)->y - (V0)->y; \
- fx = (V3)->x - (V1)->x; \
- fy = (V3)->y - (V1)->y; \
- cc = ex*fy-ey*fx; \
-}
-#else
-#define FFB_AREA_DECLARE /**/
-#define FFB_COMPUTE_AREA_TRI(V0, V1, V2) do { } while(0)
-#define FFB_COMPUTE_AREA_QUAD(V0, V1, V2, V3) do { } while(0)
-#endif
-
-#if (IND & FFB_TRI_CULL_BIT)
-#define FFB_CULL_TRI(CULL_ACTION) \
- if (cc * fmesa->backface_sign > fmesa->ffb_zero) { \
- CULL_ACTION \
- }
-#define FFB_CULL_QUAD(CULL_ACTION) \
- if (cc * fmesa->backface_sign > fmesa->ffb_zero) { \
- CULL_ACTION \
- }
-#else
-#define FFB_CULL_TRI(CULL_ACTION) do { } while (0)
-#define FFB_CULL_QUAD(CULL_ACTION) do { } while (0)
-#endif
-
-static void TAG(ffb_vb_triangles)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_TRIANGLES);
- for (i = start + 2; i < count; i += 3) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i - 2)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 1)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
-
- FFB_COMPUTE_AREA_TRI(v0, v1, v2);
- FFB_CULL_TRI(continue;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 3) + 9));
- FFB_SET_PRIM_COLOR(v2);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_tri_strip)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- GLint parity = 0;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_TRIANGLE_STRIP);
-
- i = start + 2;
- goto something_clipped;
-
- something_clipped:
- for (; i < count; i++, parity ^= 1) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i - 2 + parity)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 1 - parity)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
-
- FFB_COMPUTE_AREA_TRI(v0, v1, v2);
- FFB_CULL_TRI(continue;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 3) + 9));
- FFB_SET_PRIM_COLOR(v2);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
-
- i++;
- parity ^= 1;
- break;
- }
-
- for (; i < count; i++, parity ^= 1) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i - 2 + parity)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 1 - parity)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
- (void) v0; (void) v1;
-
- FFB_COMPUTE_AREA_TRI(v0, v1, v2);
- FFB_CULL_TRI(i++; parity^=1; goto something_clipped;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 1) + 3));
- FFB_SET_PRIM_COLOR(v2);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_tri_fan)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_TRIANGLE_FAN);
-
- i = start + 2;
- goto something_clipped;
-
- something_clipped:
- for ( ; i < count; i++) {
- ffb_vertex *v0 = &fmesa->verts[ELT(start)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 1)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
-
- FFB_COMPUTE_AREA_TRI(v0, v1, v2);
- FFB_CULL_TRI(continue;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 3) + 9));
- FFB_SET_PRIM_COLOR(v2);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
-
- i++;
- break;
- }
-
- for (; i < count; i++) {
- ffb_vertex *v0 = &fmesa->verts[ELT(start)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 1)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
- (void) v0; (void) v1;
-
- FFB_COMPUTE_AREA_TRI(v0, v1, v2);
- FFB_CULL_TRI(i++; goto something_clipped;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 1) + 3));
- FFB_SET_PRIM_COLOR(v2);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->dmyf = FFB_GET_Y(v2);
- ffb->dmxf = FFB_GET_X(v2);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_poly)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_POLYGON);
-
- /* XXX Optimize XXX */
- for (i = start + 2; i < count; i++) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i - 1)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i)];
- ffb_vertex *v2 = &fmesa->verts[ELT(start)];
- FFB_AREA_DECLARE
-
- FFB_COMPUTE_AREA_TRI(v0, v1, v2);
- FFB_CULL_TRI(continue;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 3) + 9));
- FFB_SET_PRIM_COLOR(v2);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_quads)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_QUADS);
-
- for (i = start + 3; i < count; i += 4) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i - 3)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 2)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 1)];
- ffb_vertex *v3 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
-
- FFB_COMPUTE_AREA_QUAD(v0, v1, v2, v3);
- FFB_CULL_QUAD(continue;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 4) + 12));
- FFB_SET_PRIM_COLOR(v3);
-
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
-
- FFB_SET_VERTEX_COLOR(v3);
- ffb->z = FFB_GET_Z(v3);
- ffb->dmyf = FFB_GET_Y(v3);
- ffb->dmxf = FFB_GET_X(v3);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_vb_quad_strip)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- GLint i;
- IMPL_LOCAL_VARS;
-
-#ifdef FFB_RENDER_TRACE
- fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
- __FUNCTION__, start, count, flags);
-#endif
- ffbRenderPrimitive(ctx, GL_QUAD_STRIP);
-
- /* XXX Optimize XXX */
- for (i = start + 3; i < count; i += 2) {
- ffb_vertex *v0 = &fmesa->verts[ELT(i - 1)];
- ffb_vertex *v1 = &fmesa->verts[ELT(i - 3)];
- ffb_vertex *v2 = &fmesa->verts[ELT(i - 2)];
- ffb_vertex *v3 = &fmesa->verts[ELT(i - 0)];
- FFB_AREA_DECLARE
-
- FFB_COMPUTE_AREA_QUAD(v0, v1, v2, v3);
- FFB_CULL_QUAD(continue;);
-
- FFBFifo(fmesa, (FFB_PRIM_COLOR_COST +
- (FFB_VERTEX_COLOR_COST * 4) + 12));
- FFB_SET_PRIM_COLOR(v3);
-
- FFB_DUMP_VERTEX(v0);
- FFB_SET_VERTEX_COLOR(v0);
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_DUMP_VERTEX(v1);
- FFB_SET_VERTEX_COLOR(v1);
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_DUMP_VERTEX(v2);
- FFB_SET_VERTEX_COLOR(v2);
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
-
- FFB_DUMP_VERTEX(v3);
- FFB_SET_VERTEX_COLOR(v3);
- ffb->z = FFB_GET_Z(v3);
- ffb->dmyf = FFB_GET_Y(v3);
- ffb->dmxf = FFB_GET_X(v3);
- }
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void (*TAG(render_tab)[GL_POLYGON + 2])(GLcontext *, GLuint, GLuint, GLuint) =
-{
-#if !(IND & (FFB_TRI_CULL_BIT))
- TAG(ffb_vb_points),
- TAG(ffb_vb_lines),
- TAG(ffb_vb_line_loop),
- TAG(ffb_vb_line_strip),
-#else
- NULL,
- NULL,
- NULL,
- NULL,
-#endif
- TAG(ffb_vb_triangles),
- TAG(ffb_vb_tri_strip),
- TAG(ffb_vb_tri_fan),
- TAG(ffb_vb_quads),
- TAG(ffb_vb_quad_strip),
- TAG(ffb_vb_poly),
- ffb_vb_noop,
-};
-
-#undef IND
-#undef TAG
-
-#undef IMPL_LOCAL_VARS
-#undef FFB_DECLARE_CACHED_COLOR
-#undef FFB_COMPUTE_CACHED_COLOR
-#undef FFB_CACHED_COLOR_SAME
-#undef FFB_CACHED_COLOR_SET
-#undef FFB_CACHED_COLOR_UPDATE
-#undef FFB_SET_PRIM_COLOR
-#undef FFB_PRIM_COLOR_COST
-#undef FFB_SET_VERTEX_COLOR
-#undef FFB_VERTEX_COLOR_COST
-#undef RESET_STIPPLE
-#undef FFB_AREA_DECLARE
-#undef FFB_COMPUTE_AREA_TRI
-#undef FFB_COMPUTE_AREA_QUAD
-#undef FFB_CULL_TRI
-#undef FFB_CULL_QUAD
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.c
deleted file mode 100644
index f4698c64e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_span.c,v 1.2 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_context.h"
-#include "ffb_lock.h"
-
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define HW_LOCK() \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
- if (!fmesa->hw_locked) \
- LOCK_HARDWARE(fmesa);
-
-#define HW_UNLOCK() \
- if (!fmesa->hw_locked) \
- UNLOCK_HARDWARE(fmesa); \
-
-#define LOCAL_VARS \
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable; \
- GLuint height = dPriv->h; \
- GLuint p; \
- char *buf; \
- (void) p
-
-#define INIT_MONO_PIXEL(p, color) \
- p = ((color[0] << 0) | \
- (color[1] << 8) | \
- (color[2] << 16))
-
-/* We use WID clipping, so this test always passes. */
-#define CLIPPIXEL(__x, __y) (1)
-
-/* And also, due to WID clipping, we need not do anything
- * special here.
- */
-#define CLIPSPAN(__x,__y,__n,__x1,__n1,__i) \
- __n1 = __n; \
- __x1 = __x; \
-
-#define HW_CLIPLOOP() \
-do { unsigned int fbc, ppc, cmp; \
- FFBWait(fmesa, fmesa->regs); \
- fbc = fmesa->regs->fbc; ppc = fmesa->regs->ppc; cmp = fmesa->regs->cmp; \
- fmesa->regs->fbc = ((fbc & \
- ~(FFB_FBC_WB_C | FFB_FBC_ZE_MASK | FFB_FBC_RGBE_MASK)) \
- | (FFB_FBC_ZE_OFF | FFB_FBC_RGBE_MASK)); \
- fmesa->regs->ppc = ((ppc & \
- ~(FFB_PPC_XS_MASK | FFB_PPC_ABE_MASK | FFB_PPC_DCE_MASK | \
- FFB_PPC_APE_MASK | FFB_PPC_CS_MASK)) \
- | (FFB_PPC_XS_WID | FFB_PPC_ABE_DISABLE | \
- FFB_PPC_DCE_DISABLE | FFB_PPC_APE_DISABLE | \
- FFB_PPC_CS_VAR)); \
- fmesa->regs->cmp = ((cmp & ~(0xff << 16)) | (0x80 << 16)); \
- fmesa->ffbScreen->rp_active = 1; \
- FFBWait(fmesa, fmesa->regs); \
- buf = (char *)(fmesa->sfb32 + (dPriv->x << 2) + (dPriv->y << 13));\
- if (dPriv->numClipRects) {
-
-#define HW_ENDCLIPLOOP() \
- } \
- fmesa->regs->fbc = fbc; \
- fmesa->regs->ppc = ppc; \
- fmesa->regs->cmp = cmp; \
- fmesa->ffbScreen->rp_active = 1; \
-} while(0)
-
-#define Y_FLIP(__y) (height - __y)
-
-#define READ_RGBA(rgba,__x,__y) \
-do { GLuint p = *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)); \
- rgba[0] = (p >> 0) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 16) & 0xff; \
- rgba[3] = 0xff; \
-} while(0)
-
-#define WRITE_RGBA(__x, __y, __r, __g, __b, __a) \
- *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)) = \
- ((((__r) & 0xff) << 0) | \
- (((__g) & 0xff) << 8) | \
- (((__b) & 0xff) << 16))
-
-#define WRITE_PIXEL(__x, __y, __p) \
- *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)) = (__p)
-
-#define TAG(x) ffb##x##_888
-
-#include <spantmp.h>
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- assert(vis->redBits == 8);
- assert(vis->greenBits == 8);
- assert(vis->blueBits == 8);
- drb->Base.GetRow = ffbReadRGBASpan_888;
- drb->Base.GetValues = ffbReadRGBAPixels_888;
- drb->Base.PutRow = ffbWriteRGBASpan_888;
- drb->Base.PutRowRGB = ffbWriteRGBSpan_888;
- drb->Base.PutMonoRow = ffbWriteMonoRGBASpan_888;
- drb->Base.PutValues = ffbWriteRGBAPixels_888;
- drb->Base.PutMonoValues = ffbWriteMonoRGBAPixels_888;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.h
deleted file mode 100644
index 5ae227910..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_span.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_span.h,v 1.1 2000/06/20 05:08:39 dawes Exp $ */
-
-#ifndef _FFB_SPAN_H
-#define _FFB_SPAN_H
-
-#include "drirenderbuffer.h"
-
-void ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
-
-#endif /* !(_FFB_SPAN_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.c
deleted file mode 100644
index 86df5b4bc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.c
+++ /dev/null
@@ -1,1223 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.5 2002/10/30 12:51:27 alanh Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "buffers.h"
-#include "colormac.h"
-#include "mm.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "ffb_tris.h"
-#include "ffb_state.h"
-#include "ffb_lock.h"
-#include "extensions.h"
-#include "enums.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-#undef STATE_TRACE
-
-static unsigned int ffbComputeAlphaFunc(GLcontext *ctx)
-{
- unsigned int xclip;
- GLubyte alphaRef;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDAlphaFunc: func(%s) ref(%02x)\n",
- _mesa_lookup_enum_by_nr(ctx->Color.AlphaFunc),
- ctx->Color.AlphaRef & 0xff);
-#endif
-
- switch (ctx->Color.AlphaFunc) {
- case GL_NEVER: xclip = FFB_XCLIP_TEST_NEVER; break;
- case GL_LESS: xclip = FFB_XCLIP_TEST_LT; break;
- case GL_EQUAL: xclip = FFB_XCLIP_TEST_EQ; break;
- case GL_LEQUAL: xclip = FFB_XCLIP_TEST_LE; break;
- case GL_GREATER: xclip = FFB_XCLIP_TEST_GT; break;
- case GL_NOTEQUAL: xclip = FFB_XCLIP_TEST_NE; break;
- case GL_GEQUAL: xclip = FFB_XCLIP_TEST_GE; break;
- case GL_ALWAYS: xclip = FFB_XCLIP_TEST_ALWAYS; break;
-
- default:
- return FFB_XCLIP_TEST_ALWAYS | 0x00;
- }
-
- CLAMPED_FLOAT_TO_UBYTE(alphaRef, ctx->Color.AlphaRef);
- xclip |= (alphaRef & 0xff);
-
- return xclip;
-}
-
-static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- if (ctx->Color.AlphaEnabled) {
- unsigned int xclip = ffbComputeAlphaFunc(ctx);
-
- if (fmesa->xclip != xclip) {
- fmesa->xclip = xclip;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_XCLIP, 1);
- }
- }
-}
-
-static void ffbDDBlendEquationSeparate(GLcontext *ctx,
- GLenum modeRGB, GLenum modeA)
-{
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDBlendEquation: mode(%s)\n",
- _mesa_lookup_enum_by_nr(modeRGB));
-#endif
- assert( modeRGB == modeA );
- FALLBACK( ctx, (modeRGB != GL_FUNC_ADD), FFB_BADATTR_BLENDEQN);
-}
-
-static void ffbDDBlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int blendc = 1 << 4;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDBlendFuncSeparate: sRGB(%s) dRGB(%s) sA(%s) dA(%s)\n",
- _mesa_lookup_enum_by_nr(sfactorRGB),
- _mesa_lookup_enum_by_nr(dfactorRGB),
- _mesa_lookup_enum_by_nr(sfactorA),
- _mesa_lookup_enum_by_nr(dfactorA));
-#endif
- switch (ctx->Color.BlendSrcRGB) {
- case GL_ZERO:
- blendc |= (0 << 0);
- break;
-
- case GL_ONE:
- blendc |= (1 << 0);
- break;
-
- case GL_ONE_MINUS_SRC_ALPHA:
- blendc |= (2 << 0);
- break;
-
- case GL_SRC_ALPHA:
- blendc |= (3 << 0);
- break;
-
- default:
- if (ctx->Color.BlendEnabled)
- FALLBACK( ctx, FFB_BADATTR_BLENDFUNC, GL_TRUE );
- return;
- };
-
- switch (ctx->Color.BlendDstRGB) {
- case GL_ZERO:
- blendc |= (0 << 2);
- break;
-
- case GL_ONE:
- blendc |= (1 << 2);
- break;
-
- case GL_ONE_MINUS_SRC_ALPHA:
- blendc |= (2 << 2);
- break;
-
- case GL_SRC_ALPHA:
- blendc |= (3 << 2);
- break;
-
- default:
- if (ctx->Color.BlendEnabled)
- FALLBACK( ctx, FFB_BADATTR_BLENDFUNC, GL_TRUE );
- return;
- };
-
- if (ctx->Color.BlendEnabled &&
- ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY) {
- /* We could avoid this if sfactor is GL_ONE and
- * dfactor is GL_ZERO. I do not think that is even
- * worthwhile to check because if someone is using
- * blending they use more interesting settings and
- * also it would add more state tracking to a lot
- * of the code in this file.
- */
- FALLBACK(ctx, FFB_BADATTR_BLENDROP, GL_TRUE);
- return;
- }
-
- FALLBACK( ctx, (FFB_BADATTR_BLENDFUNC|FFB_BADATTR_BLENDROP), GL_FALSE );
-
- if (blendc != fmesa->blendc) {
- fmesa->blendc = blendc;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_BLEND, 1);
- }
-}
-
-static void ffbDDDepthFunc(GLcontext *ctx, GLenum func)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLuint cmp;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDDepthFunc: func(%s)\n",
- _mesa_lookup_enum_by_nr(func));
-#endif
-
- switch (func) {
- case GL_NEVER:
- cmp = FFB_CMP_MAGN_NEVER;
- break;
- case GL_ALWAYS:
- cmp = FFB_CMP_MAGN_ALWAYS;
- break;
- case GL_LESS:
- cmp = FFB_CMP_MAGN_LT;
- break;
- case GL_LEQUAL:
- cmp = FFB_CMP_MAGN_LE;
- break;
- case GL_EQUAL:
- cmp = FFB_CMP_MAGN_EQ;
- break;
- case GL_GREATER:
- cmp = FFB_CMP_MAGN_GT;
- break;
- case GL_GEQUAL:
- cmp = FFB_CMP_MAGN_GE;
- break;
- case GL_NOTEQUAL:
- cmp = FFB_CMP_MAGN_NE;
- break;
- default:
- return;
- };
-
- if (! ctx->Depth.Test)
- cmp = FFB_CMP_MAGN_ALWAYS;
-
- cmp <<= 16;
- cmp = (fmesa->cmp & ~(0xff<<16)) | cmp;
- if (cmp != fmesa->cmp) {
- fmesa->cmp = cmp;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_CMP, 1);
- }
-}
-
-static void ffbDDDepthMask(GLcontext *ctx, GLboolean flag)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLuint fbc = fmesa->fbc;
- GLboolean enabled_now;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDDepthMask: flag(%d)\n", flag);
-#endif
-
- if ((fbc & FFB_FBC_ZE_MASK) == FFB_FBC_ZE_OFF)
- enabled_now = GL_FALSE;
- else
- enabled_now = GL_TRUE;
-
- if (flag != enabled_now) {
- fbc &= ~FFB_FBC_ZE_MASK;
- if (flag) {
- fbc |= FFB_FBC_WB_C | FFB_FBC_ZE_ON;
- } else {
- fbc |= FFB_FBC_ZE_OFF;
- fbc &= ~FFB_FBC_WB_C;
- }
- fmesa->fbc = fbc;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1);
- }
-}
-
-static void ffbDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int stencil, stencilctl, consty;
-
- /* We will properly update sw/hw state when stenciling is
- * enabled.
- */
- if (! ctx->Stencil.Enabled)
- return;
-
- stencilctl = fmesa->stencilctl;
- stencilctl &= ~(7 << 16);
-
- switch (func) {
- case GL_ALWAYS: stencilctl |= (0 << 16); break;
- case GL_GREATER: stencilctl |= (1 << 16); break;
- case GL_EQUAL: stencilctl |= (2 << 16); break;
- case GL_GEQUAL: stencilctl |= (3 << 16); break;
- case GL_NEVER: stencilctl |= (4 << 16); break;
- case GL_LEQUAL: stencilctl |= (5 << 16); break;
- case GL_NOTEQUAL: stencilctl |= (6 << 16); break;
- case GL_LESS: stencilctl |= (7 << 16); break;
-
- default:
- return;
- };
-
- consty = ref & 0xf;
-
- stencil = fmesa->stencil;
- stencil &= ~(0xf << 20);
- stencil |= (mask & 0xf) << 20;
-
- if (fmesa->stencil != stencil ||
- fmesa->stencilctl != stencilctl ||
- fmesa->consty != consty) {
- fmesa->stencil = stencil;
- fmesa->stencilctl = stencilctl;
- fmesa->consty = consty;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_STENCIL, 6);
- }
-}
-
-static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- mask &= 0xf;
- if (fmesa->ypmask != mask) {
- fmesa->ypmask = mask;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_YPMASK, 1);
- }
-}
-
-static void ffbDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int stencilctl;
-
- /* We will properly update sw/hw state when stenciling is
- * enabled.
- */
- if (! ctx->Stencil.Enabled)
- return;
-
- stencilctl = fmesa->stencilctl;
- stencilctl &= ~(0xfff00000);
-
- switch (fail) {
- case GL_ZERO: stencilctl |= (0 << 28); break;
- case GL_KEEP: stencilctl |= (1 << 28); break;
- case GL_INVERT: stencilctl |= (2 << 28); break;
- case GL_REPLACE: stencilctl |= (3 << 28); break;
- case GL_INCR: stencilctl |= (4 << 28); break;
- case GL_DECR: stencilctl |= (5 << 28); break;
-
- default:
- return;
- };
-
- switch (zfail) {
- case GL_ZERO: stencilctl |= (0 << 24); break;
- case GL_KEEP: stencilctl |= (1 << 24); break;
- case GL_INVERT: stencilctl |= (2 << 24); break;
- case GL_REPLACE: stencilctl |= (3 << 24); break;
- case GL_INCR: stencilctl |= (4 << 24); break;
- case GL_DECR: stencilctl |= (5 << 24); break;
-
- default:
- return;
- };
-
- switch (zpass) {
- case GL_ZERO: stencilctl |= (0 << 20); break;
- case GL_KEEP: stencilctl |= (1 << 20); break;
- case GL_INVERT: stencilctl |= (2 << 20); break;
- case GL_REPLACE: stencilctl |= (3 << 20); break;
- case GL_INCR: stencilctl |= (4 << 20); break;
- case GL_DECR: stencilctl |= (5 << 20); break;
-
- default:
- return;
- };
-
- if (fmesa->stencilctl != stencilctl) {
- fmesa->stencilctl = stencilctl;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_STENCIL, 6);
- }
-}
-
-static void ffbCalcViewportRegs(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- GLuint xmin, xmax, ymin, ymax, zmin, zmax;
- unsigned int vcmin, vcmax;
-
- xmin = ctx->Viewport.X + dPriv->x;
- xmax = xmin + ctx->Viewport.Width;
- ymax = dPriv->y + dPriv->h - ctx->Viewport.Y;
- ymin = ymax - ctx->Viewport.Height;
- if (ctx->Scissor.Enabled) {
- GLuint sc_xmin, sc_xmax, sc_ymin, sc_ymax;
-
- sc_xmin = ctx->Viewport.X + dPriv->x;
- sc_xmax = sc_xmin + ctx->Viewport.Width;
- sc_ymax = dPriv->y + dPriv->h - ctx->Viewport.Y;
- sc_ymin = sc_ymax - ctx->Viewport.Height;
- if (sc_xmin > xmin)
- xmin = sc_xmin;
- if (sc_xmax < xmax)
- xmax = sc_xmax;
- if (sc_ymin > ymin)
- ymin = sc_ymin;
- if (sc_ymax < ymax)
- ymax = sc_ymax;
- }
- zmin = ((GLdouble)ctx->Viewport.Near * 0x0fffffff);
- zmax = ((GLdouble)ctx->Viewport.Far * 0x0fffffff);
-
- vcmin = ((ymin & 0xffff) << 16) | (xmin & 0xffff);
- vcmax = ((ymax & 0xffff) << 16) | (xmax & 0xffff);
- if (fmesa->vclipmin != vcmin ||
- fmesa->vclipmax != vcmax ||
- fmesa->vclipzmin != zmin ||
- fmesa->vclipzmax != zmax) {
- fmesa->vclipmin = vcmin;
- fmesa->vclipmax = vcmax;
- fmesa->vclipzmin = zmin;
- fmesa->vclipzmax = zmax;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_CLIP, (4 + (4 * 2)));
- }
-}
-
-void ffbCalcViewport(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = fmesa->hw_viewport;
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
-
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + dPriv->x + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + dPriv->h + dPriv->y + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * ((GLdouble)1.0 / (GLdouble)0x0fffffff);
- m[MAT_TZ] = v[MAT_TZ] * ((GLdouble)1.0 / (GLdouble)0x0fffffff);
-
- fmesa->depth_scale = ((GLdouble)1.0 / (GLdouble)0x0fffffff);
-
- ffbCalcViewportRegs(ctx);
-
- fmesa->setupnewinputs |= VERT_BIT_POS;
-}
-
-static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height)
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- ffbCalcViewport(ctx);
-}
-
-static void ffbDDDepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval)
-{
- ffbCalcViewport(ctx);
-}
-
-static void ffbDDScissor(GLcontext *ctx, GLint cx, GLint cy,
- GLsizei cw, GLsizei ch)
-{
- ffbCalcViewport(ctx);
-}
-
-static void ffbDDDrawBuffer(GLcontext *ctx, GLenum buffer)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int fbc = fmesa->fbc;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDDrawBuffer: mode(%s)\n",
- _mesa_lookup_enum_by_nr(buffer));
-#endif
- fbc &= ~(FFB_FBC_WB_AB | FFB_FBC_RB_MASK);
- switch (buffer) {
- case GL_FRONT:
- if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
- else
- fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
- break;
-
- case GL_BACK:
- if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
- else
- fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
- break;
-
- case GL_FRONT_AND_BACK:
- fbc |= FFB_FBC_WB_AB;
- break;
-
- default:
- return;
- };
-
- if (fbc != fmesa->fbc) {
- fmesa->fbc = fbc;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1);
- }
-}
-
-
-static void ffbDDReadBuffer(GLcontext *ctx, GLenum buffer)
-{
- /* no-op, unless you implement h/w glRead/CopyPixels */
-}
-
-
-/*
- * Specifies buffer for sw fallbacks (spans)
- */
-static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLuint bufferBit)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int fbc = fmesa->fbc;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDSetReadBuffer: mode(%s)\n",
- _mesa_lookup_enum_by_nr(buffer));
-#endif
- fbc &= ~(FFB_FBC_RB_MASK);
- switch (bufferBit) {
- case BUFFER_BIT_FRONT_LEFT:
- if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_RB_B;
- else
- fbc |= FFB_FBC_RB_A;
- break;
-
- case BUFFER_BIT_BACK_LEFT:
- if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_RB_A;
- else
- fbc |= FFB_FBC_RB_B;
- break;
-
- default:
- _mesa_problem(ctx, "Unexpected buffer in ffbDDSetBuffer()");
- return;
- };
-
- if (fbc != fmesa->fbc) {
- fmesa->fbc = fbc;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1);
- }
-}
-
-static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4])
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLubyte c[4];
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
-
- fmesa->clear_pixel = ((c[0] << 0) |
- (c[1] << 8) |
- (c[2] << 16));
-}
-
-static void ffbDDClearDepth(GLcontext *ctx, GLclampd depth)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- fmesa->clear_depth = Z_FROM_MESA(depth * 4294967295.0f);
-}
-
-static void ffbDDClearStencil(GLcontext *ctx, GLint stencil)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- fmesa->clear_stencil = stencil & 0xf;
-}
-
-/* XXX Actually, should I be using FBC controls for this? -DaveM */
-static void ffbDDColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int new_pmask = 0x0;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDColorMask: r(%d) g(%d) b(%d) a(%d)\n",
- r, g, b, a);
-#endif
- if (r)
- new_pmask |= 0x000000ff;
- if (g)
- new_pmask |= 0x0000ff00;
- if (b)
- new_pmask |= 0x00ff0000;
- if (a)
- new_pmask |= 0xff000000;
-
- if (fmesa->pmask != new_pmask) {
- fmesa->pmask = new_pmask;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_PMASK, 1);
- }
-}
-
-static void ffbDDLogicOp(GLcontext *ctx, GLenum op)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int rop;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDLogicOp: op(%s)\n",
- _mesa_lookup_enum_by_nr(op));
-#endif
- switch (op) {
- case GL_CLEAR: rop = FFB_ROP_ZERO; break;
- case GL_SET: rop = FFB_ROP_ONES; break;
- case GL_COPY: rop = FFB_ROP_NEW; break;
- case GL_AND: rop = FFB_ROP_NEW_AND_OLD; break;
- case GL_NAND: rop = FFB_ROP_NEW_AND_NOLD; break;
- case GL_OR: rop = FFB_ROP_NEW_OR_OLD; break;
- case GL_NOR: rop = FFB_ROP_NEW_OR_NOLD; break;
- case GL_XOR: rop = FFB_ROP_NEW_XOR_OLD; break;
- case GL_NOOP: rop = FFB_ROP_OLD; break;
- case GL_COPY_INVERTED: rop = FFB_ROP_NNEW; break;
- case GL_INVERT: rop = FFB_ROP_NOLD; break;
- case GL_EQUIV: rop = FFB_ROP_NNEW_XOR_NOLD; break;
- case GL_AND_REVERSE: rop = FFB_ROP_NEW_AND_NOLD; break;
- case GL_AND_INVERTED: rop = FFB_ROP_NNEW_AND_OLD; break;
- case GL_OR_REVERSE: rop = FFB_ROP_NEW_OR_NOLD; break;
- case GL_OR_INVERTED: rop = FFB_ROP_NNEW_OR_OLD; break;
-
- default:
- return;
- };
-
- rop |= fmesa->rop & ~0xff;
- if (rop != fmesa->rop) {
- fmesa->rop = rop;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_ROP, 1);
-
- if (op == GL_COPY)
- FALLBACK( ctx, FFB_BADATTR_BLENDROP, GL_FALSE );
- }
-}
-
-#if 0
-/* XXX Also need to track near/far just like 3dfx driver.
- * XXX
- * XXX Actually, that won't work, because the 3dfx chip works by
- * XXX having 1/w coordinates fed to it for each primitive, and
- * XXX it uses this to index it's 64 entry fog table.
- */
-static void ffb_fog_linear(GLcontext *ctx, ffbContextPtr fmesa)
-{
- GLfloat c = ctx->ProjectionMatrix.m[10];
- GLfloat d = ctx->ProjectionMatrix.m[14];
- GLfloat tz = ctx->Viewport.WindowMap.m[MAT_TZ];
- GLfloat szInv = 1.0F / ctx->Viewport.WindowMap.m[MAT_SZ];
- GLfloat fogEnd = ctx->Fog.End;
- GLfloat fogScale = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- GLfloat ndcz;
- GLfloat eyez;
- GLfloat Zzero, Zone;
- unsigned int zb, zf;
-
- /* Compute the Z at which f reaches 0.0, this is the full
- * saturation point.
- *
- * Thus compute Z (as seen by the chip during rendering),
- * such that:
- *
- * 0.0 = (fogEnd - eyez) * fogScale
- *
- * fogScale is usually not zero, thus we are looking for:
- *
- * fogEnd = eyez
- *
- * fogEnd = -d / (c + ((Z - tz) * szInv))
- * fogEnd * (c + ((Z - tz) * szInv)) = -d
- * (c + ((Z - tz) * szInv)) = -d / fogEnd
- * (Z - tz) * szInv = (-d / fogEnd) - c
- * (Z - tz) = ((-d / fogEnd) - c) / szInv
- * Z = (((-d / fogEnd) - c) / szInv) + tz
- */
- Zzero = (((-d / fogEnd) - c) / szInv) + tz;
-
- /* Compute the Z at which f reaches 1.0, this is where
- * the incoming frag's full intensity is shown. This
- * equation is:
- *
- * 1.0 = (fogEnd - eyez)
- *
- * We are looking for:
- *
- * 1.0 + eyez = fogEnd
- *
- * 1.0 + (-d / (c + ((Z - tz) * szInv))) = fogEnd
- * -d / (c + ((Z - tz) * szInv)) = fogEnd - 1.0
- * -d / (FogEnd - 1.0) = (c + ((Z - tz) * szInv))
- * (-d / (fogEnd - 1.0)) - c = ((Z - tz) * szInv)
- * ((-d / (fogEnd - 1.0)) - c) / szInv = (Z - tz)
- * (((-d / (fogEnd - 1.0)) - c) / szInv) + tz = Z
- */
- Zone = (((-d / (fogEnd - 1.0)) - c) / szInv) + tz;
-
- /* FFB's Zfront must be less than Zback, thus we may have
- * to invert Sf/Sb to satisfy this constraint.
- */
- if (Zzero < Zone) {
- sf = 0.0;
- sb = 1.0;
- zf = Z_FROM_MESA(Zzero);
- zb = Z_FROM_MESA(Zone);
- } else {
- sf = 1.0;
- sb = 0.0;
- zf = Z_FROM_MESA(Zone);
- zb = Z_FROM_MESA(Zzero);
- }
-}
-#endif
-
-static void ffbDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDFogfv: pname(%s)\n", _mesa_lookup_enum_by_nr(pname));
-#endif
-}
-
-static void ffbDDLineStipple(GLcontext *ctx, GLint factor, GLushort pattern)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDLineStipple: factor(%d) pattern(%04x)\n",
- factor, pattern);
-#endif
- if (ctx->Line.StippleFlag) {
- factor = ctx->Line.StippleFactor;
- pattern = ctx->Line.StipplePattern;
- if ((GLuint) factor > 15) {
- fmesa->lpat = FFB_LPAT_BAD;
- } else {
- fmesa->lpat = ((factor << FFB_LPAT_SCALEVAL_SHIFT) |
- (0 << FFB_LPAT_PATLEN_SHIFT) |
- ((pattern & 0xffff) << FFB_LPAT_PATTERN_SHIFT));
- }
- } else {
- fmesa->lpat = 0;
- }
-}
-
-void ffbXformAreaPattern(ffbContextPtr fmesa, const GLubyte *mask)
-{
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- int i, lines, xoff;
-
- lines = 0;
- i = (dPriv->y + dPriv->h) & (32 - 1);
- xoff = dPriv->x & (32 - 1);
- while (lines++ < 32) {
- GLuint raw =
- (((GLuint)mask[0] << 24) |
- ((GLuint)mask[1] << 16) |
- ((GLuint)mask[2] << 8) |
- ((GLuint)mask[3] << 0));
-
- fmesa->pattern[i] =
- (raw << xoff) | (raw >> (32 - xoff));
- i = (i - 1) & (32 - 1);
- mask += 4;
- }
-
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_APAT, 32);
-}
-
-static void ffbDDPolygonStipple(GLcontext *ctx, const GLubyte *mask)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDPolygonStipple: state(%d)\n",
- ctx->Polygon.StippleFlag);
-#endif
- ffbXformAreaPattern(fmesa, mask);
-}
-
-static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- unsigned int tmp;
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDEnable: %s state(%d)\n",
- _mesa_lookup_enum_by_nr(cap), state);
-#endif
- switch (cap) {
- case GL_ALPHA_TEST:
- if (state)
- tmp = ffbComputeAlphaFunc(ctx);
- else
- tmp = FFB_XCLIP_TEST_ALWAYS;
-
- if (tmp != fmesa->xclip) {
- fmesa->xclip = tmp;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_XCLIP, 1);
- }
- break;
-
- case GL_BLEND:
- tmp = (fmesa->ppc & ~FFB_PPC_ABE_MASK);
- if (state) {
- tmp |= FFB_PPC_ABE_ENABLE;
- } else {
- tmp |= FFB_PPC_ABE_DISABLE;
- }
- if (fmesa->ppc != tmp) {
- fmesa->ppc = tmp;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_PPC, 1);
- ffbDDBlendFuncSeparate(ctx, 0, 0, 0, 0 );
- }
- break;
-
- case GL_DEPTH_TEST:
- if (state)
- tmp = 0x0fffffff;
- else
- tmp = 0x00000000;
- if (tmp != fmesa->magnc) {
- unsigned int fbc = fmesa->fbc;
- fbc &= ~FFB_FBC_ZE_MASK;
- if (state)
- fbc |= FFB_FBC_ZE_ON;
- else
- fbc |= FFB_FBC_ZE_OFF;
- fmesa->fbc = fbc;
- ffbDDDepthFunc(ctx, ctx->Depth.Func);
- fmesa->magnc = tmp;
- FFB_MAKE_DIRTY(fmesa, (FFB_STATE_MAGNC | FFB_STATE_FBC), 2);
- }
- break;
-
- case GL_SCISSOR_TEST:
- ffbDDScissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height);
- break;
-
- case GL_STENCIL_TEST:
- if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) {
- FALLBACK( ctx, FFB_BADATTR_STENCIL, state );
- }
-
- tmp = fmesa->fbc & ~FFB_FBC_YE_MASK;
- if (state) {
- ffbDDStencilFunc(ctx,
- ctx->Stencil.Function[0],
- ctx->Stencil.Ref[0],
- ctx->Stencil.ValueMask[0]);
- ffbDDStencilMask(ctx, ctx->Stencil.WriteMask[0]);
- ffbDDStencilOp(ctx,
- ctx->Stencil.FailFunc[0],
- ctx->Stencil.ZFailFunc[0],
- ctx->Stencil.ZPassFunc[0]);
- tmp |= FFB_FBC_YE_MASK;
- } else {
- fmesa->stencil = 0xf0000000;
- fmesa->stencilctl = 0x33300000;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_STENCIL, 6);
- tmp |= FFB_FBC_YE_OFF;
- }
- if (tmp != fmesa->fbc) {
- fmesa->fbc = tmp;
- FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1);
- }
- break;
-
- case GL_FOG:
- /* Until I implement the fog support... */
- FALLBACK( ctx, FFB_BADATTR_FOG, state );
- break;
-
- case GL_LINE_STIPPLE:
- if (! state)
- fmesa->lpat = 0;
- else
- ffbDDLineStipple(ctx,
- ctx->Line.StippleFactor,
- ctx->Line.StipplePattern);
- break;
-
- case GL_POLYGON_STIPPLE:
- /* Do nothing, we interrogate the state during
- * reduced primitive changes. Since our caller
- * will set NEW_POLYGON in the ctx NewState this
- * will cause the driver rasterization functions
- * to be reevaluated, which will cause us to force
- * a reduced primitive change next rendering pass
- * and it all works out.
- */
- break;
-
- default:
- break;
- };
-}
-
-void ffbSyncHardware(ffbContextPtr fmesa)
-{
- ffb_fbcPtr ffb = fmesa->regs;
- unsigned int dirty;
- int i;
-
- FFBFifo(fmesa, fmesa->state_fifo_ents);
-
- dirty = fmesa->state_dirty;
- if (dirty & (FFB_STATE_FBC | FFB_STATE_PPC | FFB_STATE_DRAWOP |
- FFB_STATE_ROP | FFB_STATE_LPAT | FFB_STATE_WID)) {
- if (dirty & FFB_STATE_FBC)
- ffb->fbc = fmesa->fbc;
- if (dirty & FFB_STATE_PPC)
- ffb->ppc = fmesa->ppc;
- if (dirty & FFB_STATE_DRAWOP)
- ffb->drawop = fmesa->drawop;
- if (dirty & FFB_STATE_ROP)
- ffb->rop = fmesa->rop;
- if (dirty & FFB_STATE_LPAT)
- ffb->rop = fmesa->lpat;
- if (dirty & FFB_STATE_WID)
- ffb->wid = fmesa->wid;
- }
- if (dirty & (FFB_STATE_PMASK | FFB_STATE_XPMASK | FFB_STATE_YPMASK |
- FFB_STATE_ZPMASK | FFB_STATE_XCLIP | FFB_STATE_CMP |
- FFB_STATE_MATCHAB | FFB_STATE_MAGNAB | FFB_STATE_MATCHC |
- FFB_STATE_MAGNC)) {
- if (dirty & FFB_STATE_PMASK)
- ffb->pmask = fmesa->pmask;
- if (dirty & FFB_STATE_XPMASK)
- ffb->xpmask = fmesa->xpmask;
- if (dirty & FFB_STATE_YPMASK)
- ffb->ypmask = fmesa->ypmask;
- if (dirty & FFB_STATE_ZPMASK)
- ffb->zpmask = fmesa->zpmask;
- if (dirty & FFB_STATE_XCLIP)
- ffb->xclip = fmesa->xclip;
- if (dirty & FFB_STATE_CMP)
- ffb->cmp = fmesa->cmp;
- if (dirty & FFB_STATE_MATCHAB)
- ffb->matchab = fmesa->matchab;
- if (dirty & FFB_STATE_MAGNAB)
- ffb->magnab = fmesa->magnab;
- if (dirty & FFB_STATE_MATCHC)
- ffb->matchc = fmesa->matchc;
- if (dirty & FFB_STATE_MAGNC)
- ffb->magnc = fmesa->magnc;
- }
-
- if (dirty & FFB_STATE_DCUE) {
- ffb->dcss = fmesa->dcss;
- ffb->dcsf = fmesa->dcsf;
- ffb->dcsb = fmesa->dcsb;
- ffb->dczf = fmesa->dczf;
- ffb->dczb = fmesa->dczb;
- if (fmesa->ffb_sarea->flags & (FFB_DRI_FFB2 | FFB_DRI_FFB2PLUS)) {
- ffb->dcss1 = fmesa->dcss1;
- ffb->dcss2 = fmesa->dcss2;
- ffb->dcss3 = fmesa->dcss3;
- ffb->dcs2 = fmesa->dcs2;
- ffb->dcs3 = fmesa->dcs3;
- ffb->dcs4 = fmesa->dcs4;
- ffb->dcd2 = fmesa->dcd2;
- ffb->dcd3 = fmesa->dcd3;
- ffb->dcd4 = fmesa->dcd4;
- }
- }
-
- if (dirty & FFB_STATE_BLEND) {
- ffb->blendc = fmesa->blendc;
- ffb->blendc1 = fmesa->blendc1;
- ffb->blendc2 = fmesa->blendc2;
- }
-
- if (dirty & FFB_STATE_CLIP) {
- ffb->vclipmin = fmesa->vclipmin;
- ffb->vclipmax = fmesa->vclipmax;
- ffb->vclipzmin = fmesa->vclipzmin;
- ffb->vclipzmax = fmesa->vclipzmax;
- for (i = 0; i < 4; i++) {
- ffb->auxclip[i].min = fmesa->aux_clips[i].min;
- ffb->auxclip[i].max = fmesa->aux_clips[i].max;
- }
- }
-
- if ((dirty & FFB_STATE_STENCIL) &&
- (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) {
- ffb->stencil = fmesa->stencil;
- ffb->stencilctl = fmesa->stencilctl;
- ffb->fbc = FFB_FBC_WB_C;
- ffb->rawstencilctl = (fmesa->stencilctl | (1 << 19));
- ffb->fbc = fmesa->fbc;
- ffb->consty = fmesa->consty;
- }
-
- if (dirty & FFB_STATE_APAT) {
- for (i = 0; i < 32; i++)
- ffb->pattern[i] = fmesa->pattern[i];
- }
-
- fmesa->state_dirty = 0;
- fmesa->state_fifo_ents = 0;
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void ffbDDUpdateState(GLcontext *ctx, GLuint newstate)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- /* When we are hw rendering, changing certain kinds of
- * state does not require flushing all of our context.
- */
- if (fmesa->bad_fragment_attrs == 0 &&
- (newstate & ~_NEW_COLOR) == 0)
- return;
-
- _swrast_InvalidateState( ctx, newstate );
- _swsetup_InvalidateState( ctx, newstate );
- _ac_InvalidateState( ctx, newstate );
- _tnl_InvalidateState( ctx, newstate );
-
- if (newstate & _NEW_TEXTURE)
- FALLBACK( ctx, FFB_BADATTR_TEXTURE,
- (ctx->Texture._EnabledUnits != 0));
-
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDUpdateState: newstate(%08x)\n", newstate);
-#endif
-
- fmesa->new_gl_state |= newstate;
-
- /* Force a reduced primitive change next rendering
- * pass.
- */
- fmesa->raster_primitive = GL_POLYGON + 1;
-
-#if 0
- /* When the modelview matrix changes, this changes what
- * the eye coordinates will be so we have to recompute
- * the depth cueing parameters.
- *
- * XXX DD_HAVE_HARDWARE_FOG.
- */
- if (ctx->Fog.Enabled && (newstate & _NEW_MODELVIEW))
- ffb_update_fog();
-#endif
-}
-
-
-void ffbDDInitStateFuncs(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- ctx->Driver.UpdateState = ffbDDUpdateState;
-
- ctx->Driver.Enable = ffbDDEnable;
- ctx->Driver.AlphaFunc = ffbDDAlphaFunc;
- ctx->Driver.BlendEquationSeparate = ffbDDBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = ffbDDBlendFuncSeparate;
- ctx->Driver.DepthFunc = ffbDDDepthFunc;
- ctx->Driver.DepthMask = ffbDDDepthMask;
- ctx->Driver.Fogfv = ffbDDFogfv;
- ctx->Driver.LineStipple = ffbDDLineStipple;
- ctx->Driver.PolygonStipple = ffbDDPolygonStipple;
- ctx->Driver.Scissor = ffbDDScissor;
- ctx->Driver.ColorMask = ffbDDColorMask;
- ctx->Driver.LogicOpcode = ffbDDLogicOp;
- ctx->Driver.Viewport = ffbDDViewport;
- ctx->Driver.DepthRange = ffbDDDepthRange;
-
- if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) {
- ctx->Driver.StencilFunc = ffbDDStencilFunc;
- ctx->Driver.StencilMask = ffbDDStencilMask;
- ctx->Driver.StencilOp = ffbDDStencilOp;
- }
-
- ctx->Driver.DrawBuffer = ffbDDDrawBuffer;
- ctx->Driver.ReadBuffer = ffbDDReadBuffer;
- ctx->Driver.ClearColor = ffbDDClearColor;
- ctx->Driver.ClearDepth = ffbDDClearDepth;
- ctx->Driver.ClearStencil = ffbDDClearStencil;
-
- /* We will support color index modes later... -DaveM */
- /*
- ctx->Driver.ClearIndex = 0;
- ctx->Driver.IndexMask = 0;
- */
-
- {
- struct swrast_device_driver *swdd =
- _swrast_GetDeviceDriverReference(ctx);
- swdd->SetBuffer = ffbDDSetBuffer;
- }
-
-
-}
-
-void ffbDDInitContextHwState(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- int fifo_count = 0;
- int i;
-
- fmesa->hw_locked = 0;
-
- fmesa->bad_fragment_attrs = 0;
- fmesa->state_dirty = FFB_STATE_ALL;
- fmesa->new_gl_state = ~0;
-
- fifo_count = 1;
- fmesa->fbc = (FFB_FBC_WE_FORCEON | FFB_FBC_WM_COMBINED |
- FFB_FBC_SB_BOTH | FFB_FBC_ZE_MASK |
- FFB_FBC_YE_OFF | FFB_FBC_XE_OFF |
- FFB_FBC_RGBE_MASK);
- if (ctx->Visual.doubleBufferMode) {
- /* Buffer B is the initial back buffer. */
- fmesa->back_buffer = 1;
- fmesa->fbc |= FFB_FBC_WB_BC | FFB_FBC_RB_B;
- } else {
- fmesa->back_buffer = 0;
- fmesa->fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
- }
-
- fifo_count += 1;
- fmesa->ppc = (FFB_PPC_ACE_DISABLE | FFB_PPC_DCE_DISABLE |
- FFB_PPC_ABE_DISABLE | FFB_PPC_VCE_3D |
- FFB_PPC_APE_DISABLE | FFB_PPC_TBE_OPAQUE |
- FFB_PPC_ZS_CONST | FFB_PPC_YS_CONST |
- FFB_PPC_XS_WID | FFB_PPC_CS_VAR);
-
- fifo_count += 3;
- fmesa->drawop = FFB_DRAWOP_RECTANGLE;
-
- /* GL_COPY is the default LogicOp. */
- fmesa->rop = (FFB_ROP_NEW << 16) | (FFB_ROP_NEW << 8) | FFB_ROP_NEW;
-
- /* No line patterning enabled. */
- fmesa->lpat = 0x00000000;
-
- /* We do not know the WID value until the first context switch. */
- fifo_count += 1;
- fmesa->wid = ~0;
-
- fifo_count += 5;
-
- /* ColorMask, all enabled. */
- fmesa->pmask = 0xffffffff;
-
- fmesa->xpmask = 0x000000ff;
- fmesa->ypmask = 0x0000000f;
- fmesa->zpmask = 0x0fffffff;
-
- /* AlphaFunc GL_ALWAYS, AlphaRef 0 */
- fmesa->xclip = FFB_XCLIP_TEST_ALWAYS | 0x00;
-
- /* This sets us up to use WID clipping (so the DRI clipping
- * rectangle is unneeded by us). All other match and magnitude
- * tests are set to pass.
- */
- fifo_count += 5;
- fmesa->cmp = ((FFB_CMP_MATCH_ALWAYS << 24) | /* MATCH C */
- (FFB_CMP_MAGN_ALWAYS << 16) | /* MAGN C */
- (FFB_CMP_MATCH_EQ << 8) | /* MATCH AB */
- (FFB_CMP_MAGN_ALWAYS << 0)); /* MAGN AB */
- fmesa->matchab = 0xff000000;
- fmesa->magnab = 0x00000000;
- fmesa->matchc = 0x00000000;
- fmesa->magnc = 0x00000000;
-
- /* Depth cue parameters, all zeros to start. */
- fifo_count += 14;
- fmesa->dcss = 0x00000000;
- fmesa->dcsf = 0x00000000;
- fmesa->dcsb = 0x00000000;
- fmesa->dczf = 0x00000000;
- fmesa->dczb = 0x00000000;
- fmesa->dcss1 = 0x00000000;
- fmesa->dcss2 = 0x00000000;
- fmesa->dcss3 = 0x00000000;
- fmesa->dcs2 = 0x00000000;
- fmesa->dcs3 = 0x00000000;
- fmesa->dcs4 = 0x00000000;
- fmesa->dcd2 = 0x00000000;
- fmesa->dcd3 = 0x00000000;
- fmesa->dcd4 = 0x00000000;
-
- /* Alpha blending unit state. */
- fifo_count += 3;
- fmesa->blendc = (1 << 0) | (0 << 2); /* src(GL_ONE) | dst(GL_ZERO) */
- fmesa->blendc1 = 0x00000000;
- fmesa->blendc2 = 0x00000000;
-
- /* ViewPort clip state. */
- fifo_count += 4 + (4 * 2);
- fmesa->vclipmin = 0x00000000;
- fmesa->vclipmax = 0xffffffff;
- fmesa->vclipzmin = 0x00000000;
- fmesa->vclipzmax = 0x0fffffff;
- for (i = 0; i < 4; i++) {
- fmesa->aux_clips[0].min = 0x00000000;
- fmesa->aux_clips[0].max = 0x00000000;
- }
-
- /* Stenciling state. */
- fifo_count += 6;
- fmesa->stencil = 0xf0000000; /* Stencil MASK, Y plane */
- fmesa->stencilctl = 0x33300000; /* All stencil tests disabled */
- fmesa->consty = 0x0;
-
- /* Area pattern, used for polygon stipples. */
- fifo_count += 32;
- for (i = 0; i < 32; i++)
- fmesa->pattern[i] = 0x00000000;
-
- fmesa->state_fifo_ents = fifo_count;
- fmesa->state_all_fifo_ents = fifo_count;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.h
deleted file mode 100644
index 17b6fa20a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_state.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_STATE_H
-#define _FFB_STATE_H
-
-extern void ffbDDInitStateFuncs(GLcontext *);
-extern void ffbDDInitContextHwState(GLcontext *);
-
-extern void ffbCalcViewport(GLcontext *);
-extern void ffbXformAreaPattern(ffbContextPtr, const GLubyte *);
-extern void ffbSyncHardware(ffbContextPtr fmesa);
-
-#endif /* !(_FFB_STATE_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.c
deleted file mode 100644
index 2f13ee921..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_stencil.c,v 1.2 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "mtypes.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_context.h"
-#include "ffb_stencil.h"
-#include "ffb_lock.h"
-
-#include "swrast/swrast.h"
-
-#undef STENCIL_TRACE
-
-static void FFBWriteStencilSpan( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values, const GLubyte mask[] )
-{
- const GLubyte *stencil = (const GLubyte *) values;
-#ifdef STENCIL_TRACE
- fprintf(stderr, "FFBWriteStencilSpan: n(%d) x(%d) y(%d)\n",
- (int) n, x, y);
-#endif
- if (ctx->Depth.Mask) {
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- GLuint *zptr;
- GLuint i;
-
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_OFF |
- FFB_FBC_YE_ON | FFB_FBC_RGBE_OFF);
- fmesa->regs->ppc = FFB_PPC_YS_VAR;
- FFBWait(fmesa, fmesa->regs);
-
- y = (dPriv->h - y);
- zptr = (GLuint *)
- ((char *)fmesa->sfb32 +
- ((dPriv->x + x) << 2) +
- ((dPriv->y + y) << 13));
-
- for (i = 0; i < n; i++) {
- if (mask[i])
- *zptr = (stencil[i] & 0xf) << 28;
- zptr++;
- }
-
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->regs->ppc = fmesa->ppc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
- }
-}
-
-static void FFBWriteStencilPixels( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *values, const GLubyte mask[] )
-{
- const GLubyte *stencil = (const GLubyte *) values;
-#ifdef STENCIL_TRACE
- fprintf(stderr, "FFBWriteStencilPixels: n(%d)\n", (int) n);
-#endif
- if (ctx->Depth.Mask) {
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- char *zbase;
- GLuint i;
-
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_OFF |
- FFB_FBC_YE_ON | FFB_FBC_RGBE_OFF);
- fmesa->regs->ppc = FFB_PPC_YS_VAR;
- fmesa->ffbScreen->rp_active = 1;
- FFBWait(fmesa, fmesa->regs);
-
- zbase = ((char *)fmesa->sfb32 +
- (dPriv->x << 2) + (dPriv->y << 13));
-
- for (i = 0; i < n; i++) {
- GLint y1 = (dPriv->h - y[i]);
- GLint x1 = x[i];
- GLuint *zptr;
-
- zptr = (GLuint *)
- (zbase + (x1 << 2) + (y1 << 13));
- if (mask[i])
- *zptr = (stencil[i] & 0xf) << 28;
- }
-
- FFBFifo(fmesa, 2);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->regs->ppc = fmesa->ppc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
- }
-}
-
-static void FFBReadStencilSpan( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte *stencil = (GLubyte *) values;
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- GLuint *zptr;
- GLuint i;
-
-#ifdef STENCIL_TRACE
- fprintf(stderr, "FFBReadStencilSpan: n(%d) x(%d) y(%d)\n",
- (int) n, x, y);
-#endif
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = FFB_FBC_RB_C;
- fmesa->ffbScreen->rp_active = 1;
- FFBWait(fmesa, fmesa->regs);
-
- y = (dPriv->h - y);
- zptr = (GLuint *)
- ((char *)fmesa->sfb32 +
- ((dPriv->x + x) << 2) +
- ((dPriv->y + y) << 13));
-
- for (i = 0; i < n; i++) {
- stencil[i] = (*zptr >> 28) & 0xf;
- zptr++;
- }
-
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
-}
-
-static void FFBReadStencilPixels( GLcontext *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values )
-{
- GLubyte *stencil = (GLubyte *) values;
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- char *zbase;
- GLuint i;
-
-#ifdef STENCIL_TRACE
- fprintf(stderr, "FFBReadStencilPixels: n(%d)\n", (int) n);
-#endif
- if (!fmesa->hw_locked)
- LOCK_HARDWARE(fmesa);
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = FFB_FBC_RB_C;
- fmesa->ffbScreen->rp_active = 1;
- FFBWait(fmesa, fmesa->regs);
-
- zbase = ((char *)fmesa->sfb32 +
- (dPriv->x << 2) + (dPriv->y << 13));
-
- for (i = 0; i < n; i++) {
- GLint y1 = (dPriv->h - y[i]);
- GLint x1 = x[i];
- GLuint *zptr;
-
- zptr = (GLuint *)
- (zbase + (x1 << 2) + (y1 << 13));
- stencil[i] = (*zptr >> 28) & 0xf;
- }
-
- FFBFifo(fmesa, 1);
- fmesa->regs->fbc = fmesa->fbc;
- fmesa->ffbScreen->rp_active = 1;
- if (!fmesa->hw_locked)
- UNLOCK_HARDWARE(fmesa);
-}
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- assert(drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT);
- drb->Base.GetRow = FFBReadStencilSpan;
- drb->Base.GetValues = FFBReadStencilPixels;
- drb->Base.PutRow = FFBWriteStencilSpan;
- /*drb->Base.PutMonoRow = FFBWriteMonoStencilSpan;*/
- drb->Base.PutValues = FFBWriteStencilPixels;
- drb->Base.PutMonoValues = NULL;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.h
deleted file mode 100644
index c7da1ca68..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_stencil.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_stencil.h,v 1.1 2000/06/20 05:08:39 dawes Exp $ */
-
-#ifndef _FFB_STENCIL_H
-#define _FFB_STENCIL_H
-
-void ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis);
-
-#endif /* !(_FFB_STENCIL_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.c
deleted file mode 100644
index d6763b7cd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tex.c,v 1.1 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "ffb_tex.h"
-
-/* No texture unit, all software. */
-/* XXX this function isn't needed since _mesa_init_driver_functions()
- * will make all these assignments.
- */
-void ffbDDInitTexFuncs(GLcontext *ctx)
-{
- /*
- ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format;
- ctx->Driver.TexImage1D = _mesa_store_teximage1d;
- ctx->Driver.TexImage2D = _mesa_store_teximage2d;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d;
- ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
- ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
- ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
- ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
- */
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.h
deleted file mode 100644
index dba0e08af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tex.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tex.h,v 1.1 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D.
- * Copyright (C) 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#ifndef _FFB_TEX_H
-#define _FFB_TEX_H
-
-extern void ffbDDInitTexFuncs(GLcontext *ctx);
-
-#endif /* !(_FFB_DD_H) */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.c
deleted file mode 100644
index ca0e514dc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.c
+++ /dev/null
@@ -1,945 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c,v 1.3 2002/10/30 12:51:28 alanh Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/s_context.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "ffb_context.h"
-#include "ffb_tris.h"
-#include "ffb_lines.h"
-#include "ffb_lock.h"
-#include "ffb_points.h"
-#include "ffb_state.h"
-#include "ffb_vb.h"
-
-#undef TRI_DEBUG
-#undef FFB_RENDER_TRACE
-#undef STATE_TRACE
-
-#ifdef TRI_DEBUG
-static void ffb_print_vertex(const ffb_vertex *v)
-{
- fprintf(stderr, "Vertex @(%p): "
- "X[%f] Y[%f] Z[%f]\n",
- v, v->x, v->y, v->z);
- fprintf(stderr, "Vertex @(%p): "
- "A[%f] R[%f] G[%f] B[%f]\n",
- v,
- v->color[0].alpha,
- v->color[0].red,
- v->color[0].green,
- v->color[0].blue);
-}
-#define FFB_DUMP_VERTEX(V) ffb_print_vertex(V)
-#else
-#define FFB_DUMP_VERTEX(V) do { } while(0)
-#endif
-
-#define FFB_ALPHA_BIT 0x01
-#define FFB_FLAT_BIT 0x02
-#define FFB_TRI_CULL_BIT 0x04
-#define MAX_FFB_RENDER_FUNCS 0x08
-
-/***********************************************************************
- * Build low-level triangle/quad rasterize functions *
- ***********************************************************************/
-
-#define FFB_TRI_FLAT_BIT 0x01
-#define FFB_TRI_ALPHA_BIT 0x02
-/*#define FFB_TRI_CULL_BIT 0x04*/
-
-static ffb_tri_func ffb_tri_tab[0x8];
-static ffb_quad_func ffb_quad_tab[0x8];
-
-#define IND (0)
-#define TAG(x) x
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_CULL_BIT)
-#define TAG(x) x##_cull
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_CULL_BIT|FFB_TRI_FLAT_BIT)
-#define TAG(x) x##_cull_flat
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_ALPHA_BIT)
-#define TAG(x) x##_alpha
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_ALPHA_BIT|FFB_TRI_FLAT_BIT)
-#define TAG(x) x##_alpha_flat
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_ALPHA_BIT|FFB_TRI_CULL_BIT)
-#define TAG(x) x##_alpha_cull
-#include "ffb_tritmp.h"
-
-#define IND (FFB_TRI_ALPHA_BIT|FFB_TRI_CULL_BIT|FFB_TRI_FLAT_BIT)
-#define TAG(x) x##_alpha_cull_flat
-#include "ffb_tritmp.h"
-
-static void init_tri_tab(void)
-{
- ffb_init();
- ffb_init_flat();
- ffb_init_cull();
- ffb_init_cull_flat();
- ffb_init_alpha();
- ffb_init_alpha_flat();
- ffb_init_alpha_cull();
- ffb_init_alpha_cull_flat();
-}
-
-/* Build a SWvertex from a hardware vertex. */
-static void ffb_translate_vertex(GLcontext *ctx, const ffb_vertex *src,
- SWvertex *dst)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLfloat *m = ctx->Viewport._WindowMap.m;
- const GLfloat sx = m[0];
- const GLfloat sy = m[5];
- const GLfloat sz = m[10];
- const GLfloat tx = m[12];
- const GLfloat ty = m[13];
- const GLfloat tz = m[14];
-
- dst->win[0] = sx * src->x + tx;
- dst->win[1] = sy * src->y + ty;
- dst->win[2] = sz * src->z + tz;
- dst->win[3] = 1.0;
-
- dst->color[0] = FFB_UBYTE_FROM_COLOR(src->color[0].red);
- dst->color[1] = FFB_UBYTE_FROM_COLOR(src->color[0].green);
- dst->color[2] = FFB_UBYTE_FROM_COLOR(src->color[0].blue);
- dst->color[3] = FFB_UBYTE_FROM_COLOR(src->color[0].alpha);
-}
-
-/***********************************************************************
- * Build fallback triangle/quad rasterize functions *
- ***********************************************************************/
-
-static void ffb_fallback_triangle(GLcontext *ctx, ffb_vertex *v0,
- ffb_vertex *v1, ffb_vertex *v2)
-{
- SWvertex v[3];
-
- ffb_translate_vertex(ctx, v0, &v[0]);
- ffb_translate_vertex(ctx, v1, &v[1]);
- ffb_translate_vertex(ctx, v2, &v[2]);
-
- _swrast_Triangle(ctx, &v[0], &v[1], &v[2]);
-}
-
-static void ffb_fallback_quad(GLcontext *ctx,
- ffb_vertex *v0, ffb_vertex *v1,
- ffb_vertex *v2, ffb_vertex *v3)
-{
- SWvertex v[4];
-
- ffb_translate_vertex(ctx, v0, &v[0]);
- ffb_translate_vertex(ctx, v1, &v[1]);
- ffb_translate_vertex(ctx, v2, &v[2]);
- ffb_translate_vertex(ctx, v3, &v[3]);
-
- _swrast_Quad(ctx, &v[0], &v[1], &v[2], &v[3]);
-}
-
-void ffb_fallback_line(GLcontext *ctx, ffb_vertex *v0, ffb_vertex *v1)
-{
- SWvertex v[2];
-
- ffb_translate_vertex(ctx, v0, &v[0]);
- ffb_translate_vertex(ctx, v1, &v[1]);
-
- _swrast_Line(ctx, &v[0], &v[1]);
-}
-
-void ffb_fallback_point(GLcontext *ctx, ffb_vertex *v0)
-{
- SWvertex v[1];
-
- ffb_translate_vertex(ctx, v0, &v[0]);
-
- _swrast_Point(ctx, &v[0]);
-}
-
-/***********************************************************************
- * Rasterization functions for culled tris/quads *
- ***********************************************************************/
-
-static void ffb_nodraw_triangle(GLcontext *ctx, ffb_vertex *v0,
- ffb_vertex *v1, ffb_vertex *v2)
-{
- (void) (ctx && v0 && v1 && v2);
-}
-
-static void ffb_nodraw_quad(GLcontext *ctx,
- ffb_vertex *v0, ffb_vertex *v1,
- ffb_vertex *v2, ffb_vertex *v3)
-{
- (void) (ctx && v0 && v1 && v2 && v3);
-}
-
-static void ffb_update_cullsign(GLcontext *ctx)
-{
- GLfloat backface_sign = 1;
-
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace==GL_CCW)
- backface_sign = -1;
- break;
-
- case GL_FRONT:
- if (ctx->Polygon.FrontFace!=GL_CCW)
- backface_sign = -1;
- break;
-
- default:
- break;
- };
-
- FFB_CONTEXT(ctx)->backface_sign = backface_sign;
-}
-
-/***********************************************************************
- * Choose triangle/quad rasterize functions *
- ***********************************************************************/
-
-void ffbChooseTriangleState(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint ind = 0;
-
- if (flags & DD_TRI_SMOOTH) {
- fmesa->draw_tri = ffb_fallback_triangle;
- fmesa->draw_quad = ffb_fallback_quad;
- return;
- }
-
- if (flags & DD_FLATSHADE)
- ind |= FFB_TRI_FLAT_BIT;
-
- if (ctx->Polygon.CullFlag) {
- if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) {
- fmesa->draw_tri = ffb_nodraw_triangle;
- fmesa->draw_quad = ffb_nodraw_quad;
- return;
- }
-
- ind |= FFB_TRI_CULL_BIT;
- ffb_update_cullsign(ctx);
- } else
- FFB_CONTEXT(ctx)->backface_sign = 0;
-
- /* If blending or the alpha test is enabled we need to
- * provide alpha components to the chip, else we can
- * do without it and thus feed vertex data to the chip
- * more efficiently.
- */
- if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled)
- ind |= FFB_TRI_ALPHA_BIT;
-
- fmesa->draw_tri = ffb_tri_tab[ind];
- fmesa->draw_quad = ffb_quad_tab[ind];
-}
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-static void ffbRenderPrimitive(GLcontext *ctx, GLenum prim);
-static void ffbRasterPrimitive(GLcontext *ctx, GLenum rprim);
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define FFB_OFFSET_BIT 0x01
-#define FFB_TWOSIDE_BIT 0x02
-#define FFB_UNFILLED_BIT 0x04
-#define FFB_MAX_TRIFUNC 0x08
-
-static struct {
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[FFB_MAX_TRIFUNC];
-
-#define DO_OFFSET (IND & FFB_OFFSET_BIT)
-#define DO_UNFILLED (IND & FFB_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & FFB_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_QUAD 1
-#define DO_FULL_QUAD 1
-#define DO_TRI 1
-#define DO_LINE 0
-#define DO_POINTS 0
-
-#define QUAD( a, b, c, d ) fmesa->draw_quad( ctx, a, b, c, d )
-#define TRI( a, b, c ) fmesa->draw_tri( ctx, a, b, c )
-#define LINE( a, b ) fmesa->draw_line( ctx, a, b )
-#define POINT( a ) fmesa->draw_point( ctx, a )
-
-#define HAVE_BACK_COLORS 1
-#define HAVE_RGBA 1
-#define HAVE_SPEC 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX ffb_vertex
-#define TAB rast_tab
-
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define DEPTH_SCALE (fmesa->depth_scale)
-#define VERT_X(_v) (_v->x)
-#define VERT_Y(_v) (_v->y)
-#define VERT_Z(_v) (_v->z)
-#define AREA_IS_CCW( a ) (a < fmesa->ffb_zero)
-#define GET_VERTEX(e) (&fmesa->verts[e])
-#define INSANE_VERTICES
-#define VERT_SET_Z(v,val) ((v)->z = (val))
-#define VERT_Z_ADD(v,val) ((v)->z += (val))
-
-#define VERT_COPY_RGBA1( _v ) _v->color[0] = _v->color[1]
-#define VERT_COPY_RGBA( v0, v1 ) v0->color[0] = v1->color[0]
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->color[0]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->color[0] = color[idx]
-
-#define LOCAL_VARS(n) \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable; \
- ffb_color color[n]; \
- (void) color; (void) dPriv;
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (fmesa->raster_primitive != reduced_prim[x]) \
- ffbRasterPrimitive( ctx, reduced_prim[x] )
-#define RENDER_PRIMITIVE fmesa->render_primitive
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_TWOSIDE_BIT|FFB_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_OFFSET_BIT|FFB_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_TWOSIDE_BIT|FFB_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FFB_TWOSIDE_BIT|FFB_OFFSET_BIT|FFB_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
-}
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-static void ffbRenderClippedPolygon(GLcontext *ctx, const GLuint *elts, GLuint n)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint prim = fmesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon. */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON](ctx, 0, n, PRIM_BEGIN|PRIM_END);
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive. */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify(ctx, prim);
-}
-
-static void ffbRenderClippedLine(GLcontext *ctx, GLuint ii, GLuint jj)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line(ctx, ii, jj);
-}
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-static void ffb_vb_noop(GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
-{
- (void)(ctx && start && count && flags);
-}
-
-#define ELT(x) x
-
-#define IND 0
-#define TAG(x) x
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_ALPHA_BIT)
-#define TAG(x) x##_alpha
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT)
-#define TAG(x) x##_flat_alpha
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_TRI_CULL_BIT)
-#define TAG(x) x##_tricull
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT | FFB_TRI_CULL_BIT)
-#define TAG(x) x##_flat_tricull
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_ALPHA_BIT | FFB_TRI_CULL_BIT)
-#define TAG(x) x##_alpha_tricull
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT | FFB_TRI_CULL_BIT)
-#define TAG(x) x##_flat_alpha_tricull
-#include "ffb_rendertmp.h"
-
-#undef ELT
-#define ELT(x) elt[x]
-
-#define IND 0
-#define TAG(x) x##_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT)
-#define TAG(x) x##_flat_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_ALPHA_BIT)
-#define TAG(x) x##_alpha_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT)
-#define TAG(x) x##_flat_alpha_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_TRI_CULL_BIT)
-#define TAG(x) x##_tricull_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT | FFB_TRI_CULL_BIT)
-#define TAG(x) x##_flat_tricull_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_ALPHA_BIT | FFB_TRI_CULL_BIT)
-#define TAG(x) x##_alpha_tricull_elt
-#include "ffb_rendertmp.h"
-
-#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT | FFB_TRI_CULL_BIT)
-#define TAG(x) x##_flat_alpha_tricull_elt
-#include "ffb_rendertmp.h"
-
-static void *render_tabs[MAX_FFB_RENDER_FUNCS];
-static void *render_tabs_elt[MAX_FFB_RENDER_FUNCS];
-
-static void init_render_tab(void)
-{
- int i;
-
- render_tabs[0] = render_tab;
- render_tabs[FFB_FLAT_BIT] = render_tab_flat;
- render_tabs[FFB_ALPHA_BIT] = render_tab_alpha;
- render_tabs[FFB_FLAT_BIT|FFB_ALPHA_BIT] = render_tab_flat_alpha;
- render_tabs[FFB_TRI_CULL_BIT] = render_tab_tricull;
- render_tabs[FFB_FLAT_BIT|FFB_TRI_CULL_BIT] = render_tab_flat_tricull;
- render_tabs[FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] = render_tab_alpha_tricull;
- render_tabs[FFB_FLAT_BIT|FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] =
- render_tab_flat_alpha_tricull;
-
- render_tabs_elt[0] = render_tab_elt;
- render_tabs_elt[FFB_FLAT_BIT] = render_tab_flat_elt;
- render_tabs_elt[FFB_ALPHA_BIT] = render_tab_alpha_elt;
- render_tabs_elt[FFB_FLAT_BIT|FFB_ALPHA_BIT] = render_tab_flat_alpha_elt;
- render_tabs_elt[FFB_TRI_CULL_BIT] = render_tab_tricull_elt;
- render_tabs_elt[FFB_FLAT_BIT|FFB_TRI_CULL_BIT] = render_tab_flat_tricull_elt;
- render_tabs_elt[FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] = render_tab_alpha_tricull_elt;
- render_tabs_elt[FFB_FLAT_BIT|FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] =
- render_tab_flat_alpha_tricull_elt;
-
- for (i = 0; i < MAX_FFB_RENDER_FUNCS; i++) {
- tnl_render_func *rf = render_tabs[i];
- tnl_render_func *rfe = render_tabs_elt[i];
-
- if (i & FFB_TRI_CULL_BIT) {
- int from_idx = (i & ~FFB_TRI_CULL_BIT);
- tnl_render_func *rf_from = render_tabs[from_idx];
- tnl_render_func *rfe_from = render_tabs_elt[from_idx];
- int j;
-
- for (j = GL_POINTS; j < GL_TRIANGLES; j++) {
- rf[j] = rf_from[j];
- rfe[j] = rfe_from[j];
- }
- }
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-#ifdef FFB_RENDER_TRACE
-static void ffbPrintRenderFlags(GLuint index, GLuint render_index)
-{
- fprintf(stderr,
- "ffbChooseRenderState: "
- "index(%s%s%s) "
- "render_index(%s%s%s)\n",
- ((index & FFB_TWOSIDE_BIT) ? "twoside " : ""),
- ((index & FFB_OFFSET_BIT) ? "offset " : ""),
- ((index & FFB_UNFILLED_BIT) ? "unfilled " : ""),
- ((render_index & FFB_FLAT_BIT) ? "flat " : ""),
- ((render_index & FFB_ALPHA_BIT) ? "alpha " : ""),
- ((render_index & FFB_TRI_CULL_BIT) ? "tricull " : ""));
-}
-#endif
-
-void ffbChooseRenderState(GLcontext *ctx)
-{
- GLuint flags = ctx->_TriangleCaps;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint index = 0;
-
- /* Per-primitive fallbacks and the selection of fmesa->draw_* are
- * handled elsewhere.
- */
- if (flags & DD_TRI_LIGHT_TWOSIDE)
- index |= FFB_TWOSIDE_BIT;
-
- if (flags & DD_TRI_OFFSET)
- index |= FFB_OFFSET_BIT;
-
- if (flags & DD_TRI_UNFILLED)
- index |= FFB_UNFILLED_BIT;
-
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- GLuint render_index = 0;
-
- if (flags & DD_FLATSHADE)
- render_index |= FFB_FLAT_BIT;
-
- if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled)
- render_index |= FFB_ALPHA_BIT;
-
- if (ctx->Polygon.CullFlag)
- render_index |= FFB_TRI_CULL_BIT;
-
-#ifdef FFB_RENDER_TRACE
- ffbPrintRenderFlags(index, render_index);
-#endif
- tnl->Driver.Render.PrimTabVerts = render_tabs[render_index];
- tnl->Driver.Render.PrimTabElts = render_tabs_elt[render_index];
- } else {
-#ifdef FFB_RENDER_TRACE
- ffbPrintRenderFlags(index, 0);
-#endif
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- }
-
- tnl->Driver.Render.ClippedPolygon = ffbRenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = ffbRenderClippedLine;
-}
-
-static void ffbRunPipeline(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- if (fmesa->bad_fragment_attrs == 0 &&
- fmesa->new_gl_state) {
- if (fmesa->new_gl_state & _FFB_NEW_TRIANGLE)
- ffbChooseTriangleState(ctx);
- if (fmesa->new_gl_state & _FFB_NEW_LINE)
- ffbChooseLineState(ctx);
- if (fmesa->new_gl_state & _FFB_NEW_POINT)
- ffbChoosePointState(ctx);
- if (fmesa->new_gl_state & _FFB_NEW_RENDER)
- ffbChooseRenderState(ctx);
- if (fmesa->new_gl_state & _FFB_NEW_VERTEX)
- ffbChooseVertexState(ctx);
-
- fmesa->new_gl_state = 0;
- }
-
- _tnl_run_pipeline(ctx);
-}
-
-static void ffbRenderStart(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- LOCK_HARDWARE(fmesa);
- fmesa->hw_locked = 1;
-
- if (fmesa->state_dirty != 0)
- ffbSyncHardware(fmesa);
-}
-
-static void ffbRenderFinish(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- UNLOCK_HARDWARE(fmesa);
- fmesa->hw_locked = 0;
-}
-
-/* Even when doing full software rendering we need to
- * wrap render{start,finish} so that the hardware is kept
- * in sync (because multipass rendering changes the write
- * buffer etc.)
- */
-static void ffbSWRenderStart(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- LOCK_HARDWARE(fmesa);
- fmesa->hw_locked = 1;
-
- if (fmesa->state_dirty != 0)
- ffbSyncHardware(fmesa);
-}
-
-static void ffbSWRenderFinish(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- UNLOCK_HARDWARE(fmesa);
- fmesa->hw_locked = 0;
-}
-
-static void ffbRasterPrimitive(GLcontext *ctx, GLenum rprim)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLuint drawop, fbc, ppc;
- int do_sw = 0;
-
- fmesa->raster_primitive = rprim;
-
- drawop = fmesa->drawop;
- fbc = fmesa->fbc;
- ppc = fmesa->ppc & ~(FFB_PPC_ZS_MASK | FFB_PPC_CS_MASK);
-
-#ifdef STATE_TRACE
- fprintf(stderr,
- "ffbReducedPrimitiveChange: rprim(%d) ", rprim);
-#endif
- switch(rprim) {
- case GL_POINTS:
-#ifdef STATE_TRACE
- fprintf(stderr, "GL_POINTS ");
-#endif
- if (fmesa->draw_point == ffb_fallback_point) {
- do_sw = 1;
- break;
- }
-
- if (ctx->Point.SmoothFlag) {
- ppc |= (FFB_PPC_ZS_VAR | FFB_PPC_CS_CONST);
- drawop = FFB_DRAWOP_AADOT;
- } else {
- ppc |= (FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST);
- drawop = FFB_DRAWOP_DOT;
- }
- break;
-
- case GL_LINES:
-#ifdef STATE_TRACE
- fprintf(stderr, "GL_LINES ");
-#endif
- if (fmesa->draw_line == ffb_fallback_line) {
- do_sw = 1;
- break;
- }
-
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_CONST;
- } else {
- ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_VAR;
- }
- if (ctx->Line.SmoothFlag)
- drawop = FFB_DRAWOP_AALINE;
- else
- drawop = FFB_DRAWOP_DDLINE;
- break;
-
- case GL_TRIANGLES:
-#ifdef STATE_TRACE
- fprintf(stderr, "GL_POLYGON ");
-#endif
- if (fmesa->draw_tri == ffb_fallback_triangle) {
- do_sw = 1;
- break;
- }
-
- ppc &= ~FFB_PPC_APE_MASK;
- if (ctx->Polygon.StippleFlag)
- ppc |= FFB_PPC_APE_ENABLE;
- else
- ppc |= FFB_PPC_APE_DISABLE;
-
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_CONST;
- } else {
- ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_VAR;
- }
- drawop = FFB_DRAWOP_TRIANGLE;
- break;
-
- default:
-#ifdef STATE_TRACE
- fprintf(stderr, "unknown %d!\n", rprim);
-#endif
- return;
- };
-
-#ifdef STATE_TRACE
- fprintf(stderr, "do_sw(%d) ", do_sw);
-#endif
- if (do_sw != 0) {
- fbc &= ~(FFB_FBC_WB_C);
- fbc &= ~(FFB_FBC_ZE_MASK | FFB_FBC_RGBE_MASK);
- fbc |= FFB_FBC_ZE_OFF | FFB_FBC_RGBE_MASK;
- ppc &= ~(FFB_PPC_XS_MASK | FFB_PPC_ABE_MASK |
- FFB_PPC_DCE_MASK | FFB_PPC_APE_MASK);
- ppc |= (FFB_PPC_ZS_VAR | FFB_PPC_CS_VAR | FFB_PPC_XS_WID |
- FFB_PPC_ABE_DISABLE | FFB_PPC_DCE_DISABLE |
- FFB_PPC_APE_DISABLE);
- } else {
- fbc |= FFB_FBC_WB_C;
- fbc &= ~(FFB_FBC_RGBE_MASK);
- fbc |= FFB_FBC_RGBE_MASK;
- ppc &= ~(FFB_PPC_ABE_MASK | FFB_PPC_XS_MASK);
- if (ctx->Color.BlendEnabled) {
- if ((rprim == GL_POINTS && !ctx->Point.SmoothFlag) ||
- (rprim != GL_POINTS && ctx->_TriangleCaps & DD_FLATSHADE))
- ppc |= FFB_PPC_ABE_ENABLE | FFB_PPC_XS_CONST;
- else
- ppc |= FFB_PPC_ABE_ENABLE | FFB_PPC_XS_VAR;
- } else {
- ppc |= FFB_PPC_ABE_DISABLE | FFB_PPC_XS_WID;
- }
- }
-#ifdef STATE_TRACE
- fprintf(stderr, "fbc(%08x) ppc(%08x)\n", fbc, ppc);
-#endif
-
- FFBFifo(fmesa, 4);
- if (fmesa->drawop != drawop)
- fmesa->regs->drawop = fmesa->drawop = drawop;
- if (fmesa->fbc != fbc)
- fmesa->regs->fbc = fmesa->fbc = fbc;
- if (fmesa->ppc != ppc)
- fmesa->regs->ppc = fmesa->ppc = ppc;
- if (do_sw != 0) {
- fmesa->regs->cmp =
- (fmesa->cmp & ~(0xff<<16)) | (0x80 << 16);
- } else
- fmesa->regs->cmp = fmesa->cmp;
-}
-
-static void ffbRenderPrimitive(GLcontext *ctx, GLenum prim)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- fmesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (fmesa->raster_primitive != rprim) {
- ffbRasterPrimitive( ctx, rprim );
- }
-}
-
-
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static char *fallbackStrings[] = {
- "Fog enabled",
- "Blend function",
- "Blend ROP",
- "Blend equation",
- "Stencil",
- "Texture",
- "LIBGL_SOFTWARE_RENDERING"
-};
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
-
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-void ffbFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = fmesa->bad_fragment_attrs;
-
- if (mode) {
- fmesa->bad_fragment_attrs |= bit;
- if (oldfallback == 0) {
-/* FFB_FIREVERTICES(fmesa); */
- _swsetup_Wakeup( ctx );
- if (fmesa->debugFallbacks)
- fprintf(stderr, "FFB begin software fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- } else {
- fmesa->bad_fragment_attrs &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
-
- tnl->Driver.Render.Start = ffbRenderStart;
- tnl->Driver.Render.PrimitiveNotify = ffbRenderPrimitive;
- tnl->Driver.Render.Finish = ffbRenderFinish;
- fmesa->new_gl_state = ~0;
-
- /* Just re-choose everything:
- */
- ffbChooseVertexState(ctx);
- ffbChooseRenderState(ctx);
- ffbChooseTriangleState(ctx);
- ffbChooseLineState(ctx);
- ffbChoosePointState(ctx);
-
- if (fmesa->debugFallbacks)
- fprintf(stderr, "FFB end software fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
-}
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void ffbDDInitRenderFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- init_tri_tab();
- init_render_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = ffbRunPipeline;
- tnl->Driver.Render.Start = ffbRenderStart;
- tnl->Driver.Render.Finish = ffbRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = ffbRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
-
- swrast->Driver.SpanRenderStart = ffbSWRenderStart;
- swrast->Driver.SpanRenderFinish = ffbSWRenderFinish;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.h
deleted file mode 100644
index a803174b3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tris.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_TRIS_H
-#define _FFB_TRIS_H
-
-extern void ffbDDInitRenderFuncs( GLcontext *ctx );
-
-
-#define _FFB_NEW_RENDER (_DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_UNFILLED)
-
-extern void ffbChooseRenderState(GLcontext *ctx);
-
-
-#define _FFB_NEW_TRIANGLE (_DD_NEW_TRI_SMOOTH | \
- _DD_NEW_FLATSHADE | \
- _NEW_POLYGON | \
- _NEW_COLOR)
-
-extern void ffbChooseTriangleState(GLcontext *ctx);
-
-extern void ffbFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( ctx, bit, mode ) ffbFallback( ctx, bit, mode )
-
-#endif /* !(_FFB_TRIS_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tritmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tritmp.h
deleted file mode 100644
index 612ef2433..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_tritmp.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tritmp.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-static void TAG(ffb_triangle)( GLcontext *ctx,
- ffb_vertex *v0,
- ffb_vertex *v1,
- ffb_vertex *v2 )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_fbcPtr ffb = fmesa->regs;
-#if (IND & FFB_TRI_FLAT_BIT)
- GLuint const_fg;
-#endif
- FFB_DELAYED_VIEWPORT_VARS;
-
-#ifdef TRI_DEBUG
- fprintf(stderr, "FFB: ffb_triangle ["
-#if (IND & FFB_TRI_CULL_BIT)
- " CULL"
-#endif
-#if (IND & FFB_TRI_FLAT_BIT)
- " FLAT"
-#endif
-#if (IND & FFB_TRI_ALPHA_BIT)
- " ALPHA"
-#endif
- " ]\n");
-#endif
-
-#if (IND & FFB_TRI_CULL_BIT)
- { /* NOTE: These are not viewport transformed yet. */
- GLfloat ex = v1->x - v0->x;
- GLfloat ey = v1->y - v0->y;
- GLfloat fx = v2->x - v0->x;
- GLfloat fy = v2->y - v0->y;
- GLfloat c = ex*fy-ey*fx;
-
- /* Culled... */
- if (c * fmesa->backface_sign > fmesa->ffb_zero)
- return;
- }
-#endif
-
-#if (IND & FFB_TRI_FLAT_BIT)
- const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( v2->color[0] );
-#ifdef TRI_DEBUG
- fprintf(stderr, "FFB_tri: const_fg %08x (B[%f] G[%f] R[%f])\n",
- const_fg,
- FFB_2_30_FIXED_TO_FLOAT(v2->color[0].blue),
- FFB_2_30_FIXED_TO_FLOAT(v2->color[0].green),
- FFB_2_30_FIXED_TO_FLOAT(v2->color[0].red));
-#endif
-#endif
-
-
-#if (IND & FFB_TRI_FLAT_BIT)
- FFBFifo(fmesa, 1);
- ffb->fg = const_fg;
-#endif
-
-#if (IND & FFB_TRI_FLAT_BIT)
- FFBFifo(fmesa, 9);
-#else
-#if (IND & FFB_TRI_ALPHA_BIT)
- FFBFifo(fmesa, 21);
-#else
- FFBFifo(fmesa, 18);
-#endif
-#endif
-
- FFB_DUMP_VERTEX(v0);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v0);
-#endif
- ffb->red = FFB_GET_RED(v0);
- ffb->green = FFB_GET_GREEN(v0);
- ffb->blue = FFB_GET_BLUE(v0);
-#endif
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_DUMP_VERTEX(v1);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v1);
-#endif
- ffb->red = FFB_GET_RED(v1);
- ffb->green = FFB_GET_GREEN(v1);
- ffb->blue = FFB_GET_BLUE(v1);
-#endif
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_DUMP_VERTEX(v2);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v2);
-#endif
- ffb->red = FFB_GET_RED(v2);
- ffb->green = FFB_GET_GREEN(v2);
- ffb->blue = FFB_GET_BLUE(v2);
-#endif
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-
-static void TAG(ffb_quad)(GLcontext *ctx,
- ffb_vertex *v0,
- ffb_vertex *v1,
- ffb_vertex *v2,
- ffb_vertex *v3 )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_fbcPtr ffb = fmesa->regs;
-#if (IND & FFB_TRI_FLAT_BIT)
- GLuint const_fg;
-#endif
- FFB_DELAYED_VIEWPORT_VARS;
-
-#ifdef TRI_DEBUG
- fprintf(stderr, "FFB: ffb_quad ["
-#if (IND & FFB_TRI_CULL_BIT)
- " CULL"
-#endif
-#if (IND & FFB_TRI_FLAT_BIT)
- " FLAT"
-#endif
-#if (IND & FFB_TRI_ALPHA_BIT)
- " ALPHA"
-#endif
- " ]\n");
-#endif /* TRI_DEBUG */
-
-#if (IND & FFB_TRI_CULL_BIT)
- { /* NOTE: These are not viewport transformed yet. */
- GLfloat ex = v2->x - v0->x;
- GLfloat ey = v2->y - v0->y;
- GLfloat fx = v3->x - v1->x;
- GLfloat fy = v3->y - v1->y;
- GLfloat c = ex*fy-ey*fx;
-
- /* Culled... */
- if (c * fmesa->backface_sign > fmesa->ffb_zero)
- return;
- }
-#endif
-
-#if (IND & FFB_TRI_FLAT_BIT)
- const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( v3->color[0] );
-#ifdef TRI_DEBUG
- fprintf(stderr, "FFB_quad: const_fg %08x (B[%f] G[%f] R[%f])\n",
- const_fg,
- FFB_2_30_FIXED_TO_FLOAT(v3->color[0].blue),
- FFB_2_30_FIXED_TO_FLOAT(v3->color[0].green),
- FFB_2_30_FIXED_TO_FLOAT(v3->color[0].red));
-#endif
-#endif
-
-
-#if (IND & FFB_TRI_FLAT_BIT)
- FFBFifo(fmesa, 13);
- ffb->fg = const_fg;
-#else
-#if (IND & FFB_TRI_ALPHA_BIT)
- FFBFifo(fmesa, 28);
-#else
- FFBFifo(fmesa, 24);
-#endif
-#endif
-
- FFB_DUMP_VERTEX(v0);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v0);
-#endif
- ffb->red = FFB_GET_RED(v0);
- ffb->green = FFB_GET_GREEN(v0);
- ffb->blue = FFB_GET_BLUE(v0);
-#endif
- ffb->z = FFB_GET_Z(v0);
- ffb->ryf = FFB_GET_Y(v0);
- ffb->rxf = FFB_GET_X(v0);
-
- FFB_DUMP_VERTEX(v1);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v1);
-#endif
- ffb->red = FFB_GET_RED(v1);
- ffb->green = FFB_GET_GREEN(v1);
- ffb->blue = FFB_GET_BLUE(v1);
-#endif
- ffb->z = FFB_GET_Z(v1);
- ffb->y = FFB_GET_Y(v1);
- ffb->x = FFB_GET_X(v1);
-
- FFB_DUMP_VERTEX(v2);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v2);
-#endif
- ffb->red = FFB_GET_RED(v2);
- ffb->green = FFB_GET_GREEN(v2);
- ffb->blue = FFB_GET_BLUE(v2);
-#endif
- ffb->z = FFB_GET_Z(v2);
- ffb->y = FFB_GET_Y(v2);
- ffb->x = FFB_GET_X(v2);
-
- FFB_DUMP_VERTEX(v3);
-#if !(IND & FFB_TRI_FLAT_BIT)
-#if (IND & FFB_TRI_ALPHA_BIT)
- ffb->alpha = FFB_GET_ALPHA(v3);
-#endif
- ffb->red = FFB_GET_RED(v3);
- ffb->green = FFB_GET_GREEN(v3);
- ffb->blue = FFB_GET_BLUE(v3);
-#endif
- ffb->z = FFB_GET_Z(v3);
- ffb->dmyf = FFB_GET_Y(v3);
- ffb->dmxf = FFB_GET_X(v3);
-
- fmesa->ffbScreen->rp_active = 1;
-}
-
-static void TAG(ffb_init)(void)
-{
- ffb_tri_tab[IND] = TAG(ffb_triangle);
- ffb_quad_tab[IND] = TAG(ffb_quad);
-}
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.c
deleted file mode 100644
index 6ba1eabbf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c,v 1.4 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "ffb_xmesa.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "imports.h"
-#include "tnl/t_context.h"
-#include "swrast_setup/swrast_setup.h"
-#include "math/m_translate.h"
-
-#undef VB_DEBUG
-
-static void ffb_copy_pv_oneside(GLcontext *ctx, GLuint edst, GLuint esrc)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_vertex *dst = &fmesa->verts[edst];
- ffb_vertex *src = &fmesa->verts[esrc];
-
-#ifdef VB_DEBUG
- fprintf(stderr, "ffb_copy_pv_oneside: edst(%d) esrc(%d)\n", edst, esrc);
-#endif
- dst->color[0].alpha = src->color[0].alpha;
- dst->color[0].red = src->color[0].red;
- dst->color[0].green = src->color[0].green;
- dst->color[0].blue = src->color[0].blue;
-}
-
-static void ffb_copy_pv_twoside(GLcontext *ctx, GLuint edst, GLuint esrc)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- ffb_vertex *dst = &fmesa->verts[edst];
- ffb_vertex *src = &fmesa->verts[esrc];
-
-#ifdef VB_DEBUG
- fprintf(stderr, "ffb_copy_pv_twoside: edst(%d) esrc(%d)\n", edst, esrc);
-#endif
- dst->color[0].alpha = src->color[0].alpha;
- dst->color[0].red = src->color[0].red;
- dst->color[0].green = src->color[0].green;
- dst->color[0].blue = src->color[0].blue;
- dst->color[1].alpha = src->color[1].alpha;
- dst->color[1].red = src->color[1].red;
- dst->color[1].green = src->color[1].green;
- dst->color[1].blue = src->color[1].blue;
-}
-
-#define FFB_VB_RGBA_BIT 0x01
-#define FFB_VB_XYZ_BIT 0x02
-#define FFB_VB_TWOSIDE_BIT 0x04
-#define FFB_VB_MAX 0x08
-
-typedef void (*ffb_emit_func)(GLcontext *, GLuint, GLuint);
-
-static struct {
- ffb_emit_func emit;
- tnl_interp_func interp;
-} setup_tab[FFB_VB_MAX];
-
-
-#define IND (FFB_VB_XYZ_BIT)
-#define TAG(x) x##_w
-#include "ffb_vbtmp.h"
-
-#define IND (FFB_VB_RGBA_BIT)
-#define TAG(x) x##_g
-#include "ffb_vbtmp.h"
-
-#define IND (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "ffb_vbtmp.h"
-
-#define IND (FFB_VB_TWOSIDE_BIT)
-#define TAG(x) x##_t
-#include "ffb_vbtmp.h"
-
-#define IND (FFB_VB_XYZ_BIT | FFB_VB_TWOSIDE_BIT)
-#define TAG(x) x##_wt
-#include "ffb_vbtmp.h"
-
-#define IND (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT)
-#define TAG(x) x##_gt
-#include "ffb_vbtmp.h"
-
-#define IND (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT)
-#define TAG(x) x##_wgt
-#include "ffb_vbtmp.h"
-
-static void init_setup_tab( void )
-{
- init_w();
- init_g();
- init_wg();
- init_t();
- init_wt();
- init_gt();
- init_wgt();
-}
-
-#ifdef VB_DEBUG
-static void ffbPrintSetupFlags(char *msg, GLuint flags)
-{
- fprintf(stderr, "%s(%x): %s%s%s\n",
- msg,
- (int)flags,
- (flags & FFB_VB_XYZ_BIT) ? " xyz," : "",
- (flags & FFB_VB_RGBA_BIT) ? " rgba," : "",
- (flags & FFB_VB_TWOSIDE_BIT) ? " twoside," : "");
-}
-#endif
-
-static void ffbDDBuildVertices(GLcontext *ctx, GLuint start, GLuint count,
- GLuint newinputs)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- newinputs |= fmesa->setupnewinputs;
- fmesa->setupnewinputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[fmesa->setupindex].emit(ctx, start, count);
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT);
-
- ind &= fmesa->setupindex;
-
- if (ind)
- setup_tab[ind].emit(ctx, start, count);
- }
-}
-
-void ffbChooseVertexState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- int ind = FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT;
-
- if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE)
- ind |= FFB_VB_TWOSIDE_BIT;
-
-#ifdef VB_DEBUG
- ffbPrintSetupFlags("ffb: full setup function", ind);
-#endif
-
- fmesa->setupindex = ind;
-
- tnl->Driver.Render.BuildVertices = ffbDDBuildVertices;
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- if (ind & FFB_VB_TWOSIDE_BIT)
- tnl->Driver.Render.CopyPV = ffb_copy_pv_twoside;
- else
- tnl->Driver.Render.CopyPV = ffb_copy_pv_oneside;
-}
-
-void ffbInitVB( GLcontext *ctx )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- fmesa->verts = (ffb_vertex *)ALIGN_MALLOC(size * sizeof(ffb_vertex), 32);
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
- }
-}
-
-
-void ffbFreeVB( GLcontext *ctx )
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- if (fmesa->verts) {
- ALIGN_FREE(fmesa->verts);
- fmesa->verts = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.h
deleted file mode 100644
index 9eb6759f6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vb.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_VB_H
-#define _FFB_VB_H
-
-#include "mtypes.h"
-#include "macros.h"
-#include "tnl/t_context.h"
-#include "swrast/swrast.h"
-
-#define __FFB_2_30_FIXED_SCALE 1073741824.0f
-#define FFB_2_30_FLOAT_TO_FIXED(X) \
- (IROUND((X) * fmesa->ffb_2_30_fixed_scale))
-#define FFB_2_30_FIXED_TO_FLOAT(X) \
- (((GLfloat)(X)) * fmesa->ffb_one_over_2_30_fixed_scale)
-
-#define __FFB_16_16_FIXED_SCALE 65536.0f
-#define FFB_16_16_FLOAT_TO_FIXED(X) \
- (IROUND((X) * fmesa->ffb_16_16_fixed_scale))
-#define FFB_16_16_FIXED_TO_FLOAT(X) \
- (((GLfloat)(X)) * fmesa->ffb_one_over_16_16_fixed_scale)
-
-#define FFB_Z_FROM_FLOAT(VAL) FFB_2_30_FLOAT_TO_FIXED(VAL)
-#define FFB_Z_TO_FLOAT(VAL) FFB_2_30_FIXED_TO_FLOAT(VAL)
-#define FFB_XY_FROM_FLOAT(VAL) FFB_16_16_FLOAT_TO_FIXED(VAL)
-#define FFB_XY_TO_FLOAT(VAL) FFB_16_16_FIXED_TO_FLOAT(VAL)
-
-#define FFB_UBYTE_FROM_COLOR(VAL) ((IROUND((VAL) * fmesa->ffb_ubyte_color_scale)))
-
-#define FFB_PACK_CONST_UBYTE_ARGB_COLOR(C) \
- ((FFB_UBYTE_FROM_COLOR(C.alpha) << 24) | \
- (FFB_UBYTE_FROM_COLOR(C.blue) << 16) | \
- (FFB_UBYTE_FROM_COLOR(C.green) << 8) | \
- (FFB_UBYTE_FROM_COLOR(C.red) << 0))
-
-#define FFB_COLOR_FROM_FLOAT(VAL) FFB_2_30_FLOAT_TO_FIXED(VAL)
-
-#define _FFB_NEW_VERTEX (_DD_NEW_TRI_LIGHT_TWOSIDE)
-
-extern void ffbDDSetupInit(void);
-extern void ffbChooseVertexState(GLcontext *);
-extern void ffbInitVB( GLcontext *ctx );
-extern void ffbFreeVB( GLcontext *ctx );
-
-#endif /* !(_FFB_VB_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vbtmp.h
deleted file mode 100644
index a1d1254d9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vbtmp.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */
-
-static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-#if defined(VB_DEBUG) || (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT))
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-#endif
-#if (IND & (FFB_VB_RGBA_BIT))
- GLfloat (*col0)[4];
- GLuint col0_stride;
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- GLfloat (*col1)[4];
- GLuint col1_stride;
-#endif
-#endif
-#if (IND & FFB_VB_XYZ_BIT)
- GLfloat (*proj)[4] = VB->NdcPtr->data;
- GLuint proj_stride = VB->NdcPtr->stride;
- const GLubyte *mask = VB->ClipMask;
-#endif
- ffb_vertex *v = &fmesa->verts[start];
- int i;
-
-#ifdef VB_DEBUG
- fprintf(stderr, "FFB: ffb_emit ["
-#if (IND & (FFB_VB_XYZ_BIT))
- " XYZ"
-#endif
-#if (IND & (FFB_VB_RGBA_BIT))
- " RGBA"
-#endif
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- " TWOSIDE"
-#endif
- "] start(%d) end(%d) import(%d)\n",
- start, end,
- VB->importable_data);
-#endif
-
-#if (IND & (FFB_VB_RGBA_BIT))
- col0 = VB->ColorPtr[0]->data;
- col0_stride = VB->ColorPtr[0]->stride;
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- col1 = VB->ColorPtr[1]->data;
- col1_stride = VB->ColorPtr[1]->stride;
-#endif
-#endif
-
- {
- if (start) {
-#if (IND & (FFB_VB_XYZ_BIT))
- proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride);
-#endif
-#if (IND & (FFB_VB_RGBA_BIT))
- col0 = (GLfloat (*)[4])((GLubyte *)col0 + start * col0_stride);
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- col1 = (GLfloat (*)[4])((GLubyte *)col1 + start * col1_stride);
-#endif
-#endif
- }
- for (i = start; i < end; i++, v++) {
-#if (IND & (FFB_VB_XYZ_BIT))
- if (mask[i] == 0) {
- v->x = proj[0][0];
- v->y = proj[0][1];
- v->z = proj[0][2];
- }
- proj = (GLfloat (*)[4])((GLubyte *)proj + proj_stride);
-#endif
-#if (IND & (FFB_VB_RGBA_BIT))
- v->color[0].alpha = CLAMP(col0[0][3], 0.0f, 1.0f);
- v->color[0].red = CLAMP(col0[0][0], 0.0f, 1.0f);
- v->color[0].green = CLAMP(col0[0][1], 0.0f, 1.0f);
- v->color[0].blue = CLAMP(col0[0][2], 0.0f, 1.0f);
- col0 = (GLfloat (*)[4])((GLubyte *)col0 + col0_stride);
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- v->color[1].alpha = CLAMP(col1[0][3], 0.0f, 1.0f);
- v->color[1].red = CLAMP(col1[0][0], 0.0f, 1.0f);
- v->color[1].green = CLAMP(col1[0][1], 0.0f, 1.0f);
- v->color[1].blue = CLAMP(col1[0][2], 0.0f, 1.0f);
- col1 = (GLfloat (*)[4])((GLubyte *)col1 + col1_stride);
-#endif
-#endif
- }
- }
-}
-
-static void TAG(interp)(GLcontext *ctx, GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary)
-{
-#if (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT))
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-#endif
-#if (IND & (FFB_VB_XYZ_BIT))
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- GLfloat oow = 1.0 / dstclip[3];
-#endif
-#if (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT))
- ffb_vertex *dst = &fmesa->verts[edst];
-#endif
-#if (IND & (FFB_VB_RGBA_BIT))
- ffb_vertex *in = &fmesa->verts[eout];
- ffb_vertex *out = &fmesa->verts[ein];
-#endif
-
-#ifdef VB_DEBUG
- fprintf(stderr, "FFB: ffb_interp ["
-#if (IND & (FFB_VB_XYZ_BIT))
- " XYZ"
-#endif
-#if (IND & (FFB_VB_RGBA_BIT))
- " RGBA"
-#endif
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- " TWOSIDE"
-#endif
- "] edst(%d) eout(%d) ein(%d)\n",
- edst, eout, ein);
-#endif
-
-#if (IND & (FFB_VB_XYZ_BIT))
- dst->x = dstclip[0] * oow;
- dst->y = dstclip[1] * oow;
- dst->z = dstclip[2] * oow;
-#endif
-
-#if (IND & (FFB_VB_RGBA_BIT))
- INTERP_F(t, dst->color[0].alpha, out->color[0].alpha, in->color[0].alpha);
- INTERP_F(t, dst->color[0].red, out->color[0].red, in->color[0].red);
- INTERP_F(t, dst->color[0].green, out->color[0].green, in->color[0].green);
- INTERP_F(t, dst->color[0].blue, out->color[0].blue, in->color[0].blue);
-#if (IND & (FFB_VB_TWOSIDE_BIT))
- INTERP_F(t, dst->color[1].alpha, out->color[1].alpha, in->color[1].alpha);
- INTERP_F(t, dst->color[1].red, out->color[1].red, in->color[1].red);
- INTERP_F(t, dst->color[1].green, out->color[1].green, in->color[1].green);
- INTERP_F(t, dst->color[1].blue, out->color[1].blue, in->color[1].blue);
-#endif
-#endif
-}
-
-static void TAG(init)(void)
-{
- setup_tab[IND].emit = TAG(emit);
- setup_tab[IND].interp = TAG(interp);
-}
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c
deleted file mode 100644
index d6a61d98e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c,v 1.1 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "glheader.h"
-#include "api_noop.h"
-#include "context.h"
-#include "light.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "vtxfmt.h"
-#include "ffb_xmesa.h"
-#include "ffb_context.h"
-#include "ffb_vb.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-#include "ffb_vtxfmt.h"
-
-#ifndef __GNUC__
-#define __inline /**/
-#endif
-
-#define TNL_VERTEX ffbTnlVertex
-
-#define INTERP_RGBA(t, out, a, b) \
-do { \
- GLint i; \
- for ( i = 0 ; i < 4 ; i++ ) { \
- GLfloat fa = a[i]; \
- GLfloat fb = b[i]; \
- out[i] = LINTERP( t, fa, fb ); \
- } \
-} while (0)
-
-/* Color functions: */
-
-static __inline void ffb_recalc_base_color(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- struct gl_light *light;
-
- COPY_3V(fmesa->vtx_state.light.base_color, ctx->Light._BaseColor[0]);
- foreach (light, &ctx->Light.EnabledList) {
- ACC_3V(fmesa->vtx_state.light.base_color,
- light->_MatAmbient[0]);
- }
-
- fmesa->vtx_state.light.base_alpha = ctx->Light._BaseAlpha[0];
-}
-
-#define GET_CURRENT \
- GET_CURRENT_CONTEXT(ctx); \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx)
-
-#define CURRENT_COLOR(COMP) fmesa->vtx_state.current.color[COMP]
-#define CURRENT_SPECULAR(COMP) fmesa->vtx_state.current.specular[COMP]
-#define COLOR_IS_FLOAT
-#define RECALC_BASE_COLOR(ctx) ffb_recalc_base_color(ctx)
-
-#define TAG(x) ffb_##x
-#include "tnl_dd/t_dd_imm_capi.h"
-
-/* Normal functions: */
-
-struct ffb_norm_tab {
- void (*normal3f_multi)(GLfloat x, GLfloat y, GLfloat z);
- void (*normal3fv_multi)(const GLfloat *v);
- void (*normal3f_single)(GLfloat x, GLfloat y, GLfloat z);
- void (*normal3fv_single)(const GLfloat *v);
-};
-
-static struct ffb_norm_tab norm_tab[0x4];
-
-#define HAVE_HW_LIGHTING 0
-#define GET_CURRENT_VERTEX \
- GET_CURRENT_CONTEXT(ctx); \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
- ffbTnlVertexPtr v = fmesa->imm.v0
-
-#define CURRENT_NORMAL fmesa->vtx_state.current.normal
-#define BASE_COLOR fmesa->vtx_state.light.base_color
-#define BASE_ALPHA fmesa->vtx_state.light.base_alpha
-#define VERT_COLOR( COMP ) v->color[COMP]
-#define VERT_COLOR_IS_FLOAT
-
-#define IND (0)
-#define TAG(x) ffb_##x
-#define PRESERVE_NORMAL_DEFS
-#include "tnl_dd/t_dd_imm_napi.h"
-
-#define IND (NORM_RESCALE)
-#define TAG(x) ffb_##x##_rescale
-#define PRESERVE_NORMAL_DEFS
-#include "tnl_dd/t_dd_imm_napi.h"
-
-#define IND (NORM_NORMALIZE)
-#define TAG(x) ffb_##x##_normalize
-#include "tnl_dd/t_dd_imm_napi.h"
-
-static void ffb_init_norm_funcs(void)
-{
- ffb_init_norm();
- ffb_init_norm_rescale();
- ffb_init_norm_normalize();
-}
-
-static void choose_normals(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint index;
-
- if (ctx->Light.Enabled) {
- if (ctx->Transform.Normalize) {
- index = NORM_NORMALIZE;
- } else if (!ctx->Transform.RescaleNormals &&
- ctx->_ModelViewInvScale != 1.0) {
- index = NORM_RESCALE;
- } else {
- index = 0;
- }
-
- if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) {
- SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_single);
- SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_single);
- } else {
- SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_multi);
- SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_multi);
- }
- } else {
- SET_Normal3f(ctx->Exec, _mesa_noop_Normal3f);
- SET_Normal3fv(ctx->Exec, _mesa_noop_Normal3fv);
- }
-}
-
-static void ffb_choose_Normal3f(GLfloat x, GLfloat y, GLfloat z)
-{
- choose_normals();
- CALL_Normal3f(GET_DISPATCH(), (x, y, z));
-}
-
-static void ffb_choose_Normal3fv(const GLfloat *v)
-{
- choose_normals();
- CALL_Normal3fv(GET_DISPATCH(), (v));
-}
-
-/* Vertex functions: */
-
-#define GET_CURRENT_VERTEX \
- GET_CURRENT_CONTEXT(ctx); \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
- ffbTnlVertexPtr v = fmesa->imm.v0
-
-#define CURRENT_VERTEX v->obj
-#define SAVE_VERTEX fmesa->imm.save_vertex(ctx, v)
-
-#define TAG(x) ffb_##x
-#include "tnl_dd/t_dd_imm_vapi.h"
-
-struct ffb_vert_tab {
- void (*save_vertex)(GLcontext *ctx, ffbTnlVertexPtr v);
- void (*interpolate_vertex)(GLfloat t,
- ffbTnlVertex *O,
- const ffbTnlVertex *I,
- const ffbTnlVertex *J);
-};
-
-static struct ffb_vert_tab vert_tab[0xf];
-
-#define VTX_NORMAL 0x0
-#define VTX_RGBA 0x1
-
-#define LOCAL_VARS \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx)
-
-#define CURRENT_COLOR fmesa->vtx_state.current.color
-#define COLOR_IS_FLOAT
-#define FLUSH_VERTEX fmesa->imm.flush_vertex( ctx, v );
-
-#define IND (VTX_NORMAL)
-#define TAG(x) ffb_##x##_NORMAL
-#define PRESERVE_VERTEX_DEFS
-#include "tnl_dd/t_dd_imm_vertex.h"
-
-#define IND (VTX_RGBA)
-#define TAG(x) ffb_##x##_RGBA
-#include "tnl_dd/t_dd_imm_vertex.h"
-
-static void ffb_init_vert_funcs( void )
-{
- ffb_init_vert_NORMAL();
- ffb_init_vert_RGBA();
-}
-
-#define LOCAL_VARS \
- ffbContextPtr fmesa = FFB_CONTEXT(ctx)
-
-#define GET_INTERP_FUNC \
- ffb_interp_func interp = fmesa->imm.interp
-
-#define FLUSH_VERTEX fmesa->imm.flush_vertex
-#define IMM_VERTEX( V ) fmesa->imm.V
-#define IMM_VERTICES( n ) fmesa->imm.vertices[n]
-
-#define EMIT_VERTEX_USES_HWREGS
-
-/* XXX Implement me XXX */
-#define EMIT_VERTEX_TRI(VTX0, VTX1, VTX2) \
- do { } while (0)
-#define EMIT_VERTEX_LINE(VTX0, VTX1) \
- do { } while (0)
-#define EMIT_VERTEX_POINT(VTX0) \
- do { } while (0)
-
-#define TAG(x) ffb_##x
-#include "tnl_dd/t_dd_imm_primtmp.h"
-
-/* Bzzt: Material changes are lost on fallback. */
-static void ffb_Materialfv(GLenum face, GLenum pname,
- const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_noop_Materialfv( face, pname, params );
- ffb_recalc_base_color( ctx );
-}
-
-/* Fallback functions: */
-
-static void ffb_do_fallback(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- struct ffb_current_state *current = &fmesa->vtx_state.current;
-
- /* Tell tnl to restore its exec vtxfmt, rehook its driver callbacks
- * and revive internal state that depended on those callbacks:
- */
- _tnl_wakeup_exec(ctx);
-
- /* Replay enough vertices that the current primitive is continued
- * correctly:
- */
- if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END )
- CALL_Begin(GET_DISPATCH(), (fmesa->imm.prim));
-
- if (ctx->Light.Enabled) {
- /* Catch ColorMaterial */
- CALL_Color4fv(GET_DISPATCH(), (ctx->Current.Color));
- CALL_Normal3fv(GET_DISPATCH(), (current->normal));
- } else {
- CALL_Color4fv(GET_DISPATCH(), (current->color));
- }
-}
-
-#define PRE_LOOPBACK( FUNC ) do { \
- GET_CURRENT_CONTEXT(ctx); \
- ffb_do_fallback( ctx ); \
-} while (0)
-
-#define TAG(x) ffb_fallback_##x
-#include "vtxfmt_tmp.h"
-
-static void ffb_Begin(GLenum prim)
-{
- GET_CURRENT_CONTEXT(ctx);
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- if (prim > GL_POLYGON) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
- }
-
- if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
- return;
- }
-
- ctx->Driver.NeedFlush |= (FLUSH_STORED_VERTICES |
- FLUSH_UPDATE_CURRENT);
-
- fmesa->imm.prim = prim;
- fmesa->imm.v0 = &fmesa->imm.vertices[0];
- fmesa->imm.save_vertex = ffb_save_vertex_RGBA;
- fmesa->imm.flush_vertex = ffb_flush_tab[prim];
-
- /* XXX Lock hardware, update FBC, PPC, DRAWOP, etc. XXX */
-}
-
-static void ffb_End(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- if (fmesa->imm.prim == PRIM_OUTSIDE_BEGIN_END) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
- return;
- }
-
- fmesa->imm.prim = PRIM_OUTSIDE_BEGIN_END;
-
- ctx->Driver.NeedFlush &= ~(FLUSH_STORED_VERTICES |
- FLUSH_UPDATE_CURRENT);
-
- /* XXX Unlock hardware, etc. */
-}
-
-void ffbInitTnlModule(GLcontext *ctx)
-{
- ffbContextPtr fmesa = FFB_CONTEXT(ctx);
- GLvertexformat *vfmt = &(fmesa->imm.vtxfmt);
-
- /* Work in progress... */
- return;
-
- ffb_init_norm_funcs();
- ffb_init_vert_funcs();
-
- MEMSET(vfmt, 0, sizeof(GLvertexformat));
-
- /* Handled fully in supported states: */
- vfmt->ArrayElement = NULL; /* FIXME: ... */
- vfmt->Color3f = ffb_choose_Color3f;
- vfmt->Color3fv = ffb_choose_Color3fv;
- vfmt->Color3ub = ffb_choose_Color3ub;
- vfmt->Color3ubv = ffb_choose_Color3ubv;
- vfmt->Color4f = ffb_choose_Color4f;
- vfmt->Color4fv = ffb_choose_Color4fv;
- vfmt->Color4ub = ffb_choose_Color4ub;
- vfmt->Color4ubv = ffb_choose_Color4ubv;
- vfmt->FogCoordfvEXT = ffb_FogCoordfvEXT;
- vfmt->FogCoordfEXT = ffb_FogCoordfEXT;
- vfmt->Materialfv = ffb_Materialfv;
- vfmt->MultiTexCoord1fARB = ffb_fallback_MultiTexCoord1fARB;
- vfmt->MultiTexCoord1fvARB = ffb_fallback_MultiTexCoord1fvARB;
- vfmt->MultiTexCoord2fARB = ffb_fallback_MultiTexCoord2fARB;
- vfmt->MultiTexCoord2fvARB = ffb_fallback_MultiTexCoord2fvARB;
- vfmt->MultiTexCoord3fARB = ffb_fallback_MultiTexCoord3fARB;
- vfmt->MultiTexCoord3fvARB = ffb_fallback_MultiTexCoord3fvARB;
- vfmt->MultiTexCoord4fARB = ffb_fallback_MultiTexCoord4fARB;
- vfmt->MultiTexCoord4fvARB = ffb_fallback_MultiTexCoord4fvARB;
- vfmt->Normal3f = ffb_choose_Normal3f;
- vfmt->Normal3fv = ffb_choose_Normal3fv;
- vfmt->SecondaryColor3ubEXT = ffb_SecondaryColor3ubEXT;
- vfmt->SecondaryColor3ubvEXT = ffb_SecondaryColor3ubvEXT;
- vfmt->SecondaryColor3fEXT = ffb_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = ffb_SecondaryColor3fvEXT;
- vfmt->TexCoord1f = ffb_fallback_TexCoord1f;
- vfmt->TexCoord1fv = ffb_fallback_TexCoord1fv;
- vfmt->TexCoord2f = ffb_fallback_TexCoord2f;
- vfmt->TexCoord2fv = ffb_fallback_TexCoord2fv;
- vfmt->TexCoord3f = ffb_fallback_TexCoord3f;
- vfmt->TexCoord3fv = ffb_fallback_TexCoord3fv;
- vfmt->TexCoord4f = ffb_fallback_TexCoord4f;
- vfmt->TexCoord4fv = ffb_fallback_TexCoord4fv;
-
- vfmt->Vertex2f = ffb_Vertex2f;
- vfmt->Vertex2fv = ffb_Vertex2fv;
- vfmt->Vertex3f = ffb_Vertex3f;
- vfmt->Vertex3fv = ffb_Vertex3fv;
- vfmt->Vertex4f = ffb_Vertex4f;
- vfmt->Vertex4fv = ffb_Vertex4fv;
-
- vfmt->Begin = ffb_Begin;
- vfmt->End = ffb_End;
-
- vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
-
- vfmt->DrawArrays = NULL;
- vfmt->DrawElements = NULL;
- vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; /* discard range */
-
-
- /* Not active in supported states; just keep ctx->Current uptodate: */
- vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
- vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
- vfmt->Indexi = _mesa_noop_Indexi;
- vfmt->Indexiv = _mesa_noop_Indexiv;
-
- /* Active but unsupported -- fallback if we receive these:
- *
- * All of these fallbacks can be fixed with additional code, except
- * CallList, unless we build a play_immediate_noop() command which
- * turns an immediate back into glBegin/glEnd commands...
- */
- vfmt->CallList = ffb_fallback_CallList;
- vfmt->EvalCoord1f = ffb_fallback_EvalCoord1f;
- vfmt->EvalCoord1fv = ffb_fallback_EvalCoord1fv;
- vfmt->EvalCoord2f = ffb_fallback_EvalCoord2f;
- vfmt->EvalCoord2fv = ffb_fallback_EvalCoord2fv;
- vfmt->EvalMesh1 = ffb_fallback_EvalMesh1;
- vfmt->EvalMesh2 = ffb_fallback_EvalMesh2;
- vfmt->EvalPoint1 = ffb_fallback_EvalPoint1;
- vfmt->EvalPoint2 = ffb_fallback_EvalPoint2;
-
- vfmt->prefer_float_colors = GL_TRUE;
-
- fmesa->imm.prim = PRIM_OUTSIDE_BEGIN_END;
-
- /* THIS IS A HACK! */
- _mesa_install_exec_vtxfmt( ctx, vfmt );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h
deleted file mode 100644
index 063bb4923..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_VTXFMT_H
-#define _FFB_VTXFMT_H
-
-extern void ffbInitTnlModule(GLcontext *);
-
-#endif /* !(_FFB_VTXFMT_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.c
deleted file mode 100644
index 530c5373a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c,v 1.4 2002/02/22 21:32:59 dawes Exp $
- *
- * GLX Hardware Device Driver for Sun Creator/Creator3D
- * Copyright (C) 2000, 2001 David S. Miller
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * DAVID MILLER, 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.
- *
- *
- * David S. Miller <davem@redhat.com>
- */
-
-#include "ffb_xmesa.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "utils.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "array_cache/acache.h"
-#include "drivers/common/driverfuncs.h"
-
-#include "ffb_context.h"
-#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
-#include "ffb_stencil.h"
-#include "ffb_clear.h"
-#include "ffb_vb.h"
-#include "ffb_tris.h"
-#include "ffb_lines.h"
-#include "ffb_points.h"
-#include "ffb_state.h"
-#include "ffb_tex.h"
-#include "ffb_lock.h"
-#include "ffb_vtxfmt.h"
-#include "ffb_bitmap.h"
-
-#include "drm_sarea.h"
-
-static GLboolean
-ffbInitDriver(__DRIscreenPrivate *sPriv)
-{
- ffbScreenPrivate *ffbScreen;
- FFBDRIPtr gDRIPriv = (FFBDRIPtr) sPriv->pDevPriv;
- drmAddress map;
-
- if (getenv("LIBGL_FORCE_XSERVER"))
- return GL_FALSE;
-
-
- if (sPriv->devPrivSize != sizeof(FFBDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(FFBDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area. */
- ffbScreen = (ffbScreenPrivate *) MALLOC(sizeof(ffbScreenPrivate));
- if (!ffbScreen)
- return GL_FALSE;
-
- /* Map FBC registers. */
- if (drmMap(sPriv->fd,
- gDRIPriv->hFbcRegs,
- gDRIPriv->sFbcRegs,
- &map)) {
- FREE(ffbScreen);
- return GL_FALSE;
- }
- ffbScreen->regs = (ffb_fbcPtr) map;
-
- /* Map ramdac registers. */
- if (drmMap(sPriv->fd,
- gDRIPriv->hDacRegs,
- gDRIPriv->sDacRegs,
- &map)) {
- drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
- FREE(ffbScreen);
- return GL_FALSE;
- }
- ffbScreen->dac = (ffb_dacPtr) map;
-
- /* Map "Smart" framebuffer views. */
- if (drmMap(sPriv->fd,
- gDRIPriv->hSfb8r,
- gDRIPriv->sSfb8r,
- &map)) {
- drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
- drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
- FREE(ffbScreen);
- return GL_FALSE;
- }
- ffbScreen->sfb8r = (volatile char *) map;
-
- if (drmMap(sPriv->fd,
- gDRIPriv->hSfb32,
- gDRIPriv->sSfb32,
- &map)) {
- drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
- drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
- drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r);
- FREE(ffbScreen);
- return GL_FALSE;
- }
- ffbScreen->sfb32 = (volatile char *) map;
-
- if (drmMap(sPriv->fd,
- gDRIPriv->hSfb64,
- gDRIPriv->sSfb64,
- &map)) {
- drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
- drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
- drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r);
- drmUnmap((drmAddress)ffbScreen->sfb32, gDRIPriv->sSfb32);
- FREE(ffbScreen);
- return GL_FALSE;
- }
- ffbScreen->sfb64 = (volatile char *) map;
-
- ffbScreen->fifo_cache = 0;
- ffbScreen->rp_active = 0;
-
- ffbScreen->sPriv = sPriv;
- sPriv->private = (void *) ffbScreen;
-
- ffbDDLinefuncInit();
- ffbDDPointfuncInit();
-
- return GL_TRUE;
-}
-
-
-static void
-ffbDestroyScreen(__DRIscreenPrivate *sPriv)
-{
- ffbScreenPrivate *ffbScreen = sPriv->private;
- FFBDRIPtr gDRIPriv = (FFBDRIPtr) sPriv->pDevPriv;
-
- drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
- drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
- drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r);
- drmUnmap((drmAddress)ffbScreen->sfb32, gDRIPriv->sSfb32);
- drmUnmap((drmAddress)ffbScreen->sfb64, gDRIPriv->sSfb64);
-
- FREE(ffbScreen);
-}
-
-static const struct tnl_pipeline_stage *ffb_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- /* REMOVE: fog coord stage */
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
- &_tnl_render_stage,
- 0,
-};
-
-/* Create and initialize the Mesa and driver specific context data */
-static GLboolean
-ffbCreateContext(const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- ffbContextPtr fmesa;
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv;
- ffbScreenPrivate *ffbScreen;
- char *debug;
- struct dd_function_table functions;
-
- /* Allocate ffb context */
- fmesa = (ffbContextPtr) CALLOC(sizeof(ffbContextRec));
- if (!fmesa)
- return GL_FALSE;
-
- _mesa_init_driver_functions(&functions);
-
- /* Allocate Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((ffbContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- fmesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
- &functions, fmesa);
- if (!fmesa->glCtx) {
- FREE(fmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = fmesa;
- ctx = fmesa->glCtx;
-
- sPriv = driContextPriv->driScreenPriv;
- ffbScreen = (ffbScreenPrivate *) sPriv->private;
-
- /* Dri stuff. */
- fmesa->hHWContext = driContextPriv->hHWContext;
- fmesa->driFd = sPriv->fd;
- fmesa->driHwLock = &sPriv->pSAREA->lock;
-
- fmesa->ffbScreen = ffbScreen;
- fmesa->driScreen = sPriv;
- fmesa->ffb_sarea = FFB_DRISHARE(sPriv->pSAREA);
-
- /* Register and framebuffer hw pointers. */
- fmesa->regs = ffbScreen->regs;
- fmesa->sfb32 = ffbScreen->sfb32;
-
- ffbDDInitContextHwState(ctx);
-
- /* Default clear and depth colors. */
- {
- GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
- GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
- GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
-
- fmesa->clear_pixel = ((r << 0) |
- (g << 8) |
- (b << 16));
- }
- fmesa->clear_depth = Z_FROM_MESA(ctx->Depth.Clear * 4294967295.0f);
- fmesa->clear_stencil = ctx->Stencil.Clear & 0xf;
-
- /* No wide points. */
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
-
- /* Disable wide lines as we can't antialias them correctly in
- * hardware.
- */
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 1.0;
- ctx->Const.MaxLineWidthAA = 1.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- /* Instead of having GCC emit these constants a zillion times
- * everywhere in the driver, put them here.
- */
- fmesa->ffb_2_30_fixed_scale = __FFB_2_30_FIXED_SCALE;
- fmesa->ffb_one_over_2_30_fixed_scale = (1.0 / __FFB_2_30_FIXED_SCALE);
- fmesa->ffb_16_16_fixed_scale = __FFB_16_16_FIXED_SCALE;
- fmesa->ffb_one_over_16_16_fixed_scale = (1.0 / __FFB_16_16_FIXED_SCALE);
- fmesa->ffb_ubyte_color_scale = 255.0f;
- fmesa->ffb_zero = 0.0f;
-
- fmesa->debugFallbacks = GL_FALSE;
- debug = getenv("LIBGL_DEBUG");
- if (debug && strstr(debug, "fallbacks"))
- fmesa->debugFallbacks = GL_TRUE;
-
- /* Initialize the software rasterizer and helper modules. */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* All of this need only be done once for a new context. */
- /* XXX these should be moved right after the
- * _mesa_init_driver_functions() call above.
- */
- ffbDDExtensionsInit(ctx);
- ffbDDInitDriverFuncs(ctx);
- ffbDDInitStateFuncs(ctx);
- ffbDDInitRenderFuncs(ctx);
- /*ffbDDInitTexFuncs(ctx); not needed */
- ffbDDInitBitmapFuncs(ctx);
- ffbInitVB(ctx);
-
-#if 0
- ffbInitTnlModule(ctx);
-#endif
-
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, ffb_pipeline);
-
- return GL_TRUE;
-}
-
-static void
-ffbDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- ffbContextPtr fmesa = (ffbContextPtr) driContextPriv->driverPrivate;
-
- if (fmesa) {
- ffbFreeVB(fmesa->glCtx);
-
- _swsetup_DestroyContext( fmesa->glCtx );
- _tnl_DestroyContext( fmesa->glCtx );
- _ac_DestroyContext( fmesa->glCtx );
- _swrast_DestroyContext( fmesa->glCtx );
-
- /* free the Mesa context */
- fmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(fmesa->glCtx);
-
- FREE(fmesa);
- }
-}
-
-/* Create and initialize the Mesa and driver specific pixmap buffer data */
-static GLboolean
-ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- /* Mesa checks for pitch > 0, but ffb doesn't use pitches */
- int bogusPitch = 1;
- int bpp = 4; /* we've always got a 32bpp framebuffer */
- int offset = 0; /* always at 0 for offset */
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- } else {
- GLboolean swStencil = (mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24);
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0);
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
- ffbSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
- ffbSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, bpp, offset, bogusPitch);
- ffbSetDepthFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, bpp, offset,bogusPitch);
- ffbSetStencilFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-ffbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-#define USE_FAST_SWAP
-
-static void
-ffbSwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- ffbContextPtr fmesa = (ffbContextPtr) dPriv->driContextPriv->driverPrivate;
- unsigned int fbc, wid, wid_reg_val, dac_db_bit;
- unsigned int shadow_dac_addr, active_dac_addr;
- ffb_fbcPtr ffb;
- ffb_dacPtr dac;
-
- if (fmesa == NULL ||
- fmesa->glCtx->Visual.doubleBufferMode == 0)
- return;
-
- /* Flush pending rendering commands */
- _mesa_notifySwapBuffers(fmesa->glCtx);
-
- ffb = fmesa->regs;
- dac = fmesa->ffbScreen->dac;
-
- fbc = fmesa->fbc;
- wid = fmesa->wid;
-
- /* Swap the buffer we render into and read pixels from. */
- fmesa->back_buffer ^= 1;
-
- /* If we are writing into both buffers, don't mess with
- * the WB setting.
- */
- if ((fbc & FFB_FBC_WB_AB) != FFB_FBC_WB_AB) {
- if ((fbc & FFB_FBC_WB_A) != 0)
- fbc = (fbc & ~FFB_FBC_WB_A) | FFB_FBC_WB_B;
- else
- fbc = (fbc & ~FFB_FBC_WB_B) | FFB_FBC_WB_A;
- }
-
- /* But either way, we must flip the read buffer setting. */
- if ((fbc & FFB_FBC_RB_A) != 0)
- fbc = (fbc & ~FFB_FBC_RB_A) | FFB_FBC_RB_B;
- else
- fbc = (fbc & ~FFB_FBC_RB_B) | FFB_FBC_RB_A;
-
- LOCK_HARDWARE(fmesa);
-
- if (fmesa->fbc != fbc) {
- FFBFifo(fmesa, 1);
- ffb->fbc = fmesa->fbc = fbc;
- fmesa->ffbScreen->rp_active = 1;
- }
-
- /* And swap the buffer displayed in the WID. */
- if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1) {
- shadow_dac_addr = FFBDAC_PAC1_SPWLUT(wid);
- active_dac_addr = FFBDAC_PAC1_APWLUT(wid);
- dac_db_bit = FFBDAC_PAC1_WLUT_DB;
- } else {
- shadow_dac_addr = FFBDAC_PAC2_SPWLUT(wid);
- active_dac_addr = FFBDAC_PAC2_APWLUT(wid);
- dac_db_bit = FFBDAC_PAC2_WLUT_DB;
- }
-
- FFBWait(fmesa, ffb);
-
- wid_reg_val = DACCFG_READ(dac, active_dac_addr);
- if (fmesa->back_buffer == 0)
- wid_reg_val |= dac_db_bit;
- else
- wid_reg_val &= ~dac_db_bit;
-#ifdef USE_FAST_SWAP
- DACCFG_WRITE(dac, active_dac_addr, wid_reg_val);
-#else
- DACCFG_WRITE(dac, shadow_dac_addr, wid_reg_val);
-
- /* Schedule the window transfer. */
- DACCFG_WRITE(dac, FFBDAC_CFG_WTCTRL,
- (FFBDAC_CFG_WTCTRL_TCMD | FFBDAC_CFG_WTCTRL_TE));
-
- {
- int limit = 1000000;
- while (limit--) {
- unsigned int wtctrl = DACCFG_READ(dac, FFBDAC_CFG_WTCTRL);
-
- if ((wtctrl & FFBDAC_CFG_WTCTRL_DS) == 0)
- break;
- }
- }
-#endif
-
- UNLOCK_HARDWARE(fmesa);
-}
-
-static void ffb_init_wid(ffbContextPtr fmesa, unsigned int wid)
-{
- ffb_dacPtr dac = fmesa->ffbScreen->dac;
- unsigned int wid_reg_val, dac_db_bit, active_dac_addr;
- unsigned int shadow_dac_addr;
-
- if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1) {
- shadow_dac_addr = FFBDAC_PAC1_SPWLUT(wid);
- active_dac_addr = FFBDAC_PAC1_APWLUT(wid);
- dac_db_bit = FFBDAC_PAC1_WLUT_DB;
- } else {
- shadow_dac_addr = FFBDAC_PAC2_SPWLUT(wid);
- active_dac_addr = FFBDAC_PAC2_APWLUT(wid);
- dac_db_bit = FFBDAC_PAC2_WLUT_DB;
- }
-
- wid_reg_val = DACCFG_READ(dac, active_dac_addr);
- wid_reg_val &= ~dac_db_bit;
-#ifdef USE_FAST_SWAP
- DACCFG_WRITE(dac, active_dac_addr, wid_reg_val);
-#else
- DACCFG_WRITE(dac, shadow_dac_addr, wid_reg_val);
-
- /* Schedule the window transfer. */
- DACCFG_WRITE(dac, FFBDAC_CFG_WTCTRL,
- (FFBDAC_CFG_WTCTRL_TCMD | FFBDAC_CFG_WTCTRL_TE));
-
- {
- int limit = 1000000;
- while (limit--) {
- unsigned int wtctrl = DACCFG_READ(dac, FFBDAC_CFG_WTCTRL);
-
- if ((wtctrl & FFBDAC_CFG_WTCTRL_DS) == 0)
- break;
- }
- }
-#endif
-}
-
-/* Force the context `c' to be the current context and associate with it
- buffer `b' */
-static GLboolean
-ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- ffbContextPtr fmesa = (ffbContextPtr) driContextPriv->driverPrivate;
- int first_time;
-
- fmesa->driDrawable = driDrawPriv;
-
- _mesa_make_current(fmesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
-
- first_time = 0;
- if (fmesa->wid == ~0) {
- first_time = 1;
- if (getenv("LIBGL_SOFTWARE_RENDERING"))
- FALLBACK( fmesa->glCtx, FFB_BADATTR_SWONLY, GL_TRUE );
- }
-
- LOCK_HARDWARE(fmesa);
- if (first_time) {
- fmesa->wid = fmesa->ffb_sarea->wid_table[driDrawPriv->index];
- ffb_init_wid(fmesa, fmesa->wid);
- }
-
- fmesa->state_dirty |= FFB_STATE_ALL;
- fmesa->state_fifo_ents = fmesa->state_all_fifo_ents;
- ffbSyncHardware(fmesa);
- UNLOCK_HARDWARE(fmesa);
-
- if (first_time) {
- /* Also, at the first switch to a new context,
- * we need to clear all the hw buffers.
- */
- ffbDDClear(fmesa->glCtx,
- (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT |
- BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL),
- 1, 0, 0, 0, 0);
- }
- } else {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-/* Force the context `c' to be unbound from its buffer */
-static GLboolean
-ffbUnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- return GL_TRUE;
-}
-
-void ffbXMesaUpdateState(ffbContextPtr fmesa)
-{
- __DRIdrawablePrivate *dPriv = fmesa->driDrawable;
- __DRIscreenPrivate *sPriv = fmesa->driScreen;
- int stamp = dPriv->lastStamp;
-
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
- if (dPriv->lastStamp != stamp) {
- GLcontext *ctx = fmesa->glCtx;
-
- ffbCalcViewport(ctx);
- if (ctx->Polygon.StippleFlag)
- ffbXformAreaPattern(fmesa,
- (const GLubyte *)ctx->PolygonStipple);
- }
-}
-
-static const struct __DriverAPIRec ffbAPI = {
- .InitDriver = ffbInitDriver,
- .DestroyScreen = ffbDestroyScreen,
- .CreateContext = ffbCreateContext,
- .DestroyContext = ffbDestroyContext,
- .CreateBuffer = ffbCreateBuffer,
- .DestroyBuffer = ffbDestroyBuffer,
- .SwapBuffers = ffbSwapBuffers,
- .MakeCurrent = ffbMakeCurrent,
- .UnbindContext = ffbUnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = NULL,
- .WaitForMSC = NULL,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-static __GLcontextModes *
-ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* GLX_SWAP_COPY_OML is only supported because the FFB driver doesn't
- * support pageflipping at all.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
- };
-
- u_int8_t depth_bits_array[3];
- u_int8_t stencil_bits_array[3];
-
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = depth_bits;
- depth_bits_array[2] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = 0;
- stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
- back_buffer_factor = (have_back_buffer) ? 3 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 0, 1, 1 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 0, 0, 1 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "ffb",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &ffbAPI);
- if ( psp != NULL ) {
- *driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.h
deleted file mode 100644
index b7580780a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/ffb_xmesa.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
-
-#ifndef _FFB_XMESA_H_
-#define _FFB_XMESA_H_
-
-#include <sys/time.h>
-#include "dri_util.h"
-#include "mtypes.h"
-#include "ffb_drishare.h"
-#include "ffb_regs.h"
-#include "ffb_dac.h"
-#include "ffb_fifo.h"
-
-typedef struct {
- __DRIscreenPrivate *sPriv;
- ffb_fbcPtr regs;
- ffb_dacPtr dac;
- volatile char *sfb8r;
- volatile char *sfb32;
- volatile char *sfb64;
-
- int fifo_cache;
- int rp_active;
-} ffbScreenPrivate;
-
-#endif /* !(_FFB_XMESA_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_dac.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_dac.h
deleted file mode 100644
index 08114282e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_dac.h
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Acceleration for the Creator and Creator3D framebuffer - DAC register layout.
- *
- * Copyright (C) 2000 David S. Miller (davem@redhat.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * DAVID MILLER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.h,v 1.2 2001/04/05 17:42:33 dawes Exp $ */
-
-#ifndef _FFB_DAC_H
-#define _FFB_DAC_H
-
-#define Bool int
-
-/* FFB utilizes two different ramdac chips:
- *
- * 1) BT9068 "Pacifica1", used in all FFB1 and
- * FFB2 boards.
- *
- * 2) BT498(a) "Pacifica2", used in FFB2+ and
- * AFB boards.
- *
- * They are mostly equivalent, except in a few key areas:
- *
- * 1) WID register layout
- * 2) Number of CLUT tables
- * 3) Presence of Window Address Mask register
- * 4) Method of GAMMA correction support
- */
-
-/* NOTE: All addresses described in this file are DAC
- * indirect addresses.
- */
-
-/* DAC color values are in the following format. */
-#define FFBDAC_COLOR_BLUE 0x00ff0000
-#define FFBDAC_COLOR_BLUE_SHFT 16
-#define FFBDAC_COLOR_GREEN 0x0000ff00
-#define FFBDAC_COLOR_GREEN_SHFT 8
-#define FFBDAC_COLOR_RED 0x000000ff
-#define FFBDAC_COLOR_RED_SHFT 0
-
-/* Cursor DAC register addresses. */
-#define FFBDAC_CUR_BITMAP_P0 0x000 /* Plane 0 cursor bitmap */
-#define FFBDAC_CUR_BITMAP_P1 0x080 /* Plane 1 cursor bitmap */
-#define FFBDAC_CUR_CTRL 0x100 /* Cursor control */
-#define FFBDAC_CUR_COLOR0 0x101 /* Cursor Color 0 */
-#define FFBDAC_CUR_COLOR1 0x102 /* Cursor Color 1 (bg) */
-#define FFBDAC_CUR_COLOR2 0x103 /* Cursor Color 2 (fg) */
-#define FFBDAC_CUR_POS 0x104 /* Active cursor position */
-
-/* Cursor control register.
- * WARNING: Be careful, reverse logic on these bits.
- */
-#define FFBDAC_CUR_CTRL_P0 0x00000001 /* Plane0 display disable */
-#define FFBDAC_CUR_CTRL_P1 0x00000002 /* Plane1 display disable */
-
-/* Active cursor position register */
-#define FFBDAC_CUR_POS_Y_SIGN 0x80000000 /* Sign of Y position */
-#define FFBDAC_CUR_POS_Y 0x0fff0000 /* Y position */
-#define FFBDAC_CUR_POS_X_SIGN 0x00008000 /* Sign of X position */
-#define FFBDAC_CUR_POS_X 0x00000fff /* X position */
-
-/* Configuration and Palette DAC register addresses. */
-#define FFBDAC_CFG_PPLLCTRL 0x0000 /* Pixel PLL Control */
-#define FFBDAC_CFG_GPLLCTRL 0x0001 /* General Purpose PLL Control */
-#define FFBDAC_CFG_PFCTRL 0x1000 /* Pixel Format Control */
-#define FFBDAC_CFG_UCTRL 0x1001 /* User Control */
-#define FFBDAC_CFG_CLUP_BASE 0x2000 /* Color Lookup Palette */
-#define FFBDAC_CFG_CLUP(entry) (FFBDAC_CFG_CLUP_BASE + ((entry) * 0x100))
-#define FFBDAC_PAC2_SOVWLUT0 0x3100 /* Shadow Overlay Window Lookup 0*/
-#define FFBDAC_PAC2_SOVWLUT1 0x3101 /* Shadow Overlay Window Lookup 1*/
-#define FFBDAC_PAC2_SOVWLUT2 0x3102 /* Shadow Overlay Window Lookup 2*/
-#define FFBDAC_PAC2_SOVWLUT3 0x3103 /* Shadow Overlay Window Lookup 3*/
-#define FFBDAC_PAC2_AOVWLUT0 0x3210 /* Active Overlay Window Lookup 0*/
-#define FFBDAC_PAC2_AOVWLUT1 0x3211 /* Active Overlay Window Lookup 1*/
-#define FFBDAC_PAC2_AOVWLUT2 0x3212 /* Active Overlay Window Lookup 2*/
-#define FFBDAC_PAC2_AOVWLUT3 0x3213 /* Active Overlay Window Lookup 3*/
-#define FFBDAC_CFG_WTCTRL 0x3150 /* Window Transfer Control */
-#define FFBDAC_CFG_TMCTRL 0x3151 /* Transparent Mask Control */
-#define FFBDAC_CFG_TCOLORKEY 0x3152 /* Transparent Color Key */
-#define FFBDAC_CFG_WAMASK 0x3153 /* Window Address Mask (PAC2 only) */
-#define FFBDAC_PAC1_SPWLUT_BASE 0x3100 /* Shadow Primary Window Lookups */
-#define FFBDAC_PAC1_SPWLUT(entry) (FFBDAC_PAC1_SPWLUT_BASE + (entry))
-#define FFBDAC_PAC1_APWLUT_BASE 0x3120 /* Active Primary Window Lookups */
-#define FFBDAC_PAC1_APWLUT(entry) (FFBDAC_PAC1_APWLUT_BASE + (entry))
-#define FFBDAC_PAC2_SPWLUT_BASE 0x3200 /* Shadow Primary Window Lookups */
-#define FFBDAC_PAC2_SPWLUT(entry) (FFBDAC_PAC2_SPWLUT_BASE + (entry))
-#define FFBDAC_PAC2_APWLUT_BASE 0x3240 /* Active Primary Window Lookups */
-#define FFBDAC_PAC2_APWLUT(entry) (FFBDAC_PAC2_APWLUT_BASE + (entry))
-#define FFBDAC_CFG_SANAL 0x5000 /* Signature Analysis Control */
-#define FFBDAC_CFG_DACCTRL 0x5001 /* DAC Control */
-#define FFBDAC_CFG_TGEN 0x6000 /* Timing Generator Control */
-#define FFBDAC_CFG_VBNP 0x6001 /* Vertical Blank Negation Point */
-#define FFBDAC_CFG_VBAP 0x6002 /* Vertical Blank Assertion Point*/
-#define FFBDAC_CFG_VSNP 0x6003 /* Vertical Sync Negation Point */
-#define FFBDAC_CFG_VSAP 0x6004 /* Vertical Sync Assertion Point */
-#define FFBDAC_CFG_HSNP 0x6005 /* Horz Serration Negation Point */
-#define FFBDAC_CFG_HBNP 0x6006 /* Horz Blank Negation Point */
-#define FFBDAC_CFG_HBAP 0x6007 /* Horz Blank Assertion Point */
-#define FFBDAC_CFG_HSYNCNP 0x6008 /* Horz Sync Negation Point */
-#define FFBDAC_CFG_HSYNCAP 0x6009 /* Horz Sync Assertion Point */
-#define FFBDAC_CFG_HSCENNP 0x600A /* Horz SCEN Negation Point */
-#define FFBDAC_CFG_HSCENAP 0x600B /* Horz SCEN Assertion Point */
-#define FFBDAC_CFG_EPNP 0x600C /* Eql'zing Pulse Negation Point */
-#define FFBDAC_CFG_EINP 0x600D /* Eql'zing Intvl Negation Point */
-#define FFBDAC_CFG_EIAP 0x600E /* Eql'zing Intvl Assertion Point*/
-#define FFBDAC_CFG_TGVC 0x600F /* Timing Generator Vert Counter */
-#define FFBDAC_CFG_TGHC 0x6010 /* Timing Generator Horz Counter */
-#define FFBDAC_CFG_DID 0x8000 /* Device Identification */
-#define FFBDAC_CFG_MPDATA 0x8001 /* Monitor Port Data */
-#define FFBDAC_CFG_MPSENSE 0x8002 /* Monitor Port Sense */
-
-/* Pixel PLL Control Register */
-#define FFBDAC_CFG_PPLLCTRL_M 0x0000007f /* PLL VCO Multiplicand */
-#define FFBDAC_CFG_PPLLCTRL_D 0x00000780 /* PLL VCO Divisor */
-#define FFBDAC_CFG_PPLLCTRL_PFD 0x00001800 /* Post VCO Frequency Divider */
-#define FFBDAC_CFG_PPLLCTRL_EN 0x00004000 /* Enable PLL as pixel clock src */
-
-/* General Purpose PLL Control Register */
-#define FFBDAC_CFG_GPLLCTRL_M 0x0000007f /* PLL VCO Multiplicand */
-#define FFBDAC_CFG_GPLLCTRL_D 0x00000780 /* PLL VCO Divisor */
-#define FFBDAC_CFG_GPLLCTRL_PFD 0x00001800 /* Post VCO Frequency Divider */
-#define FFBDAC_CFG_GPLLCTRL_EN 0x00004000 /* Enable PLL as Gen. Purpose clk*/
-
-/* Pixel Format Control Register */
-#define FFBDAC_CFG_PFCTRL_2_1 0x00000000 /* 2:1 pixel interleave format */
-#define FFBDAC_CFG_PFCTRL_4_1 0x00000001 /* 4:1 pixel interleave format */
-#define FFBDAC_CFG_PFCTRL_42_1 0x00000002 /* 4/2:1 pixel interleave format */
-#define FFBDAC_CFG_PFCTRL_82_1 0x00000003 /* 8/2:1 pixel interleave format */
-
-/* User Control Register */
-#define FFBDAC_UCTRL_IPDISAB 0x00000001 /* Disable input pullup resistors*/
-#define FFBDAC_UCTRL_ABLANK 0x00000002 /* Asynchronous Blank */
-#define FFBDAC_UCTRL_DBENAB 0x00000004 /* Double-Buffer Enable */
-#define FFBDAC_UCTRL_OVENAB 0x00000008 /* Overlay Enable */
-#define FFBDAC_UCTRL_WMODE 0x00000030 /* Window Mode */
-#define FFBDAC_UCTRL_WM_COMB 0x00000000 /* Window Mode = Combined */
-#define FFBDAC_UCTRL_WM_S4 0x00000010 /* Window Mode = Seperate_4 */
-#define FFBDAC_UCTRL_WM_S8 0x00000020 /* Window Mode = Seperate_8 */
-#define FFBDAC_UCTRL_WM_RESV 0x00000030 /* Window Mode = reserved */
-#define FFBDAC_UCTRL_MANREV 0x00000f00 /* 4-bit Manufacturing Revision */
-
-/* Overlay Window Lookup Registers (PAC2 only) */
-#define FFBDAC_CFG_OVWLUT_PSEL 0x0000000f /* Palette Section, Seperate_4 */
-#define FFBDAC_CFG_OVWLUT_PTBL 0x00000030 /* Palette Table */
-#define FFBDAC_CFG_OVWLUT_LKUP 0x00000100 /* 1 = Use palette, 0 = Bypass */
-#define FFBDAC_CFG_OVWLUT_OTYP 0x00000c00 /* Overlay Type */
-#define FFBDAC_CFG_OVWLUT_O_N 0x00000000 /* Overlay Type - None */
-#define FFBDAC_CFG_OVWLUT_O_T 0x00000400 /* Overlay Type - Transparent */
-#define FFBDAC_CFG_OVWLUT_O_O 0x00000800 /* Overlay Type - Opaque */
-#define FFBDAC_CFG_OVWLUT_O_R 0x00000c00 /* Overlay Type - Reserved */
-#define FFBDAC_CFG_OVWLUT_PCS 0x00003000 /* Psuedocolor Src */
-#define FFBDAC_CFG_OVWLUT_P_XO 0x00000000 /* Psuedocolor Src - XO[7:0] */
-#define FFBDAC_CFG_OVWLUT_P_R 0x00001000 /* Psuedocolor Src - R[7:0] */
-#define FFBDAC_CFG_OVWLUT_P_G 0x00002000 /* Psuedocolor Src - G[7:0] */
-#define FFBDAC_CFG_OVWLUT_P_B 0x00003000 /* Psuedocolor Src - B[7:0] */
-
-/* Window Transfer Control Register */
-#define FFBDAC_CFG_WTCTRL_DS 0x00000001 /* Device Status, 1 = Busy */
-#define FFBDAC_CFG_WTCTRL_TCMD 0x00000002 /* Transfer Command
- * 1 = Transfer, 0 = No Action
- */
-#define FFBDAC_CFG_WTCTRL_TE 0x00000004 /* Transfer Event
- * 1 = Next Frame, 0 = Next Field
- */
-#define FFBDAC_CFG_WTCTRL_DRD 0x00000008 /* Drawing Data
- * 1 = Local Drawing Active
- * 0 = Local Drawing Idle
- */
-#define FFBDAC_CFG_WTCTRL_DRS 0x00000010 /* Drawing Status
- * 1 = Network Drawing Active
- * 0 = Network Drawing Idle
- */
-
-/* Transparent Mask Control Register */
-#define FFBDAC_CFG_TMCTRL_OMSK 0x000000ff /* Overlay Mask */
-
-/* Transparent Color Key Register */
-#define FFBDAC_CFG_TCOLORKEY_K 0x000000ff /* Overlay Color Key */
-
-/* Window Address Mask Register (PAC2 only) */
-#define FFBDAC_CFG_WAMASK_PMSK 0x0000003f /* PWLUT select PMASK */
-#define FFBDAC_CFG_WAMASK_OMSK 0x00000300 /* OWLUT control OMASK */
-
-/* (non-Overlay) Window Lookup Table Registers, PAC1 format */
-#define FFBDAC_PAC1_WLUT_DB 0x00000020 /* 0 = Buffer A, 1 = Buffer B */
-#define FFBDAC_PAC1_WLUT_C 0x0000001c /* C: Color Model Selection */
-#define FFBDAC_PAC1_WLUT_C_8P 0x00000000 /* C: 8bpp Pseudocolor */
-#define FFBDAC_PAC1_WLUT_C_8LG 0x00000004 /* C: 8bpp Linear Grey */
-#define FFBDAC_PAC1_WLUT_C_8NG 0x00000008 /* C: 8bpp Non-Linear Grey */
-#define FFBDAC_PAC1_WLUT_C_24D 0x00000010 /* C: 24bpp Directcolor */
-#define FFBDAC_PAC1_WLUT_C_24LT 0x00000014 /* C: 24bpp Linear Truecolor */
-#define FFBDAC_PAC1_WLUT_C_24NT 0x00000018 /* C: 24bpp Non-Linear Truecolor */
-#define FFBDAC_PAC1_WLUT_PCS 0x00000003 /* Pseudocolor Src */
-#define FFBDAC_PAC1_WLUT_P_XO 0x00000000 /* Pseudocolor Src - XO[7:0] */
-#define FFBDAC_PAC1_WLUT_P_R 0x00000001 /* Pseudocolor Src - R[7:0] */
-#define FFBDAC_PAC1_WLUT_P_G 0x00000002 /* Pseudocolor Src - G[7:0] */
-#define FFBDAC_PAC1_WLUT_P_B 0x00000003 /* Pseudocolor Src - B[7:0] */
-
-/* (non-Overlay) Window Lookup Table Registers, PAC2 format */
-#define FFBDAC_PAC2_WLUT_PTBL 0x00000030 /* Palette Table Entry */
-#define FFBDAC_PAC2_WLUT_LKUP 0x00000100 /* 1 = Use palette, 0 = Bypass */
-#define FFBDAC_PAC2_WLUT_PCS 0x00003000 /* Pseudocolor Src */
-#define FFBDAC_PAC2_WLUT_P_XO 0x00000000 /* Pseudocolor Src - XO[7:0] */
-#define FFBDAC_PAC2_WLUT_P_R 0x00001000 /* Pseudocolor Src - R[7:0] */
-#define FFBDAC_PAC2_WLUT_P_G 0x00002000 /* Pseudocolor Src - G[7:0] */
-#define FFBDAC_PAC2_WLUT_P_B 0x00003000 /* Pseudocolor Src - B[7:0] */
-#define FFBDAC_PAC2_WLUT_DEPTH 0x00004000 /* 0 = Pseudocolor, 1 = Truecolor*/
-#define FFBDAC_PAC2_WLUT_DB 0x00008000 /* 0 = Buffer A, 1 = Buffer B */
-
-/* Signature Analysis Control Register */
-#define FFBDAC_CFG_SANAL_SRR 0x000000ff /* DAC Seed/Result for Red */
-#define FFBDAC_CFG_SANAL_SRG 0x0000ff00 /* DAC Seed/Result for Green */
-#define FFBDAC_CFG_SANAL_SRB 0x00ff0000 /* DAC Seed/Result for Blue */
-#define FFBDAC_CFG_SANAL_RQST 0x01000000 /* Signature Capture Request */
-#define FFBDAC_CFG_SANAL_BSY 0x02000000 /* Signature Analysis Busy */
-#define FFBDAC_CFG_SANAL_DSM 0x04000000 /* Data Strobe Mode
- * 0 = Signature Analysis Mode
- * 1 = Data Strobe Mode
- */
-
-/* DAC Control Register */
-#define FFBDAC_CFG_DACCTRL_O2 0x00000003 /* Operand 2 Select
- * 00 = Normal Operation
- * 01 = Select 145mv Reference
- * 10 = Select Blue DAC Output
- * 11 = Reserved
- */
-#define FFBDAC_CFG_DACCTRL_O1 0x0000000c /* Operand 1 Select
- * 00 = Normal Operation
- * 01 = Select Green DAC Output
- * 10 = Select Red DAC Output
- * 11 = Reserved
- */
-#define FFBDAC_CFG_DACCTRL_CR 0x00000010 /* Comparator Result
- * 0 = operand1 < operand2
- * 1 = operand1 > operand2
- */
-#define FFBDAC_CFG_DACCTRL_SGE 0x00000020 /* Sync-on-Green Enable */
-#define FFBDAC_CFG_DACCTRL_PE 0x00000040 /* Pedestal Enable */
-#define FFBDAC_CFG_DACCTRL_VPD 0x00000080 /* VSYNC* Pin Disable */
-#define FFBDAC_CFG_DACCTRL_SPB 0x00000100 /* Sync Polarity Bit
- * 0 = VSYNC* and CSYNC* active low
- * 1 = VSYNC* and CSYNC* active high
- */
-
-/* Timing Generator Control Register */
-#define FFBDAC_CFG_TGEN_VIDE 0x00000001 /* Video Enable */
-#define FFBDAC_CFG_TGEN_TGE 0x00000002 /* Timing Generator Enable */
-#define FFBDAC_CFG_TGEN_HSD 0x00000004 /* HSYNC* Disabled */
-#define FFBDAC_CFG_TGEN_VSD 0x00000008 /* VSYNC* Disabled */
-#define FFBDAC_CFG_TGEN_EQD 0x00000010 /* Equalization Disabled */
-#define FFBDAC_CFG_TGEN_MM 0x00000020 /* 0 = Slave, 1 = Master */
-#define FFBDAC_CFG_TGEN_IM 0x00000040 /* 1 = Interlaced Mode */
-
-/* Device Identification Register, should be 0xA236E1AD for FFB bt497/bt498 */
-#define FFBDAC_CFG_DID_ONE 0x00000001 /* Always set */
-#define FFBDAC_CFG_DID_MANUF 0x00000ffe /* Manufacturer ID */
-#define FFBDAC_CFG_DID_PNUM 0x0ffff000 /* Device Part Number */
-#define FFBDAC_CFG_DID_REV 0xf0000000 /* Device Revision */
-
-/* Monitor Port Data Register */
-#define FFBDAC_CFG_MPDATA_SCL 0x00000001 /* SCL Data */
-#define FFBDAC_CFG_MPDATA_SDA 0x00000002 /* SDA Data */
-
-/* Monitor Port Sense Register */
-#define FFBDAC_CFG_MPSENSE_SCL 0x00000001 /* SCL Sense */
-#define FFBDAC_CFG_MPSENSE_SDA 0x00000002 /* SDA Sense */
-
-/* DAC register access shorthands. */
-#define DACCUR_READ(DAC, ADDR) ((DAC)->cur = (ADDR), (DAC)->curdata)
-#define DACCUR_WRITE(DAC, ADDR, VAL) ((DAC)->cur = (ADDR), (DAC)->curdata = (VAL))
-#define DACCFG_READ(DAC, ADDR) ((DAC)->cfg = (ADDR), (DAC)->cfgdata)
-#define DACCFG_WRITE(DAC, ADDR, VAL) ((DAC)->cfg = (ADDR), (DAC)->cfgdata = (VAL))
-
-typedef struct ffb_dac_hwstate {
- unsigned int ppllctrl;
- unsigned int gpllctrl;
- unsigned int pfctrl;
- unsigned int uctrl;
- unsigned int clut[256 * 4]; /* One 256 entry clut on PAC1, 4 on PAC2 */
- unsigned int ovluts[4]; /* Overlay WLUTS, PAC2 only */
- unsigned int wtctrl;
- unsigned int tmctrl;
- unsigned int tcolorkey;
- unsigned int wamask;
- unsigned int pwluts[64];
- unsigned int dacctrl;
- unsigned int tgen;
- unsigned int vbnp;
- unsigned int vbap;
- unsigned int vsnp;
- unsigned int vsap;
- unsigned int hsnp;
- unsigned int hbnp;
- unsigned int hbap;
- unsigned int hsyncnp;
- unsigned int hsyncap;
- unsigned int hscennp;
- unsigned int hscenap;
- unsigned int epnp;
- unsigned int einp;
- unsigned int eiap;
-} ffb_dac_hwstate_t;
-
-typedef struct {
- Bool InUse;
-
- /* The following fields are undefined unless InUse is TRUE. */
- int refcount;
- Bool canshare;
- unsigned int wlut_regval;
- int buffer; /* 0 = Buffer A, 1 = Buffer B */
- int depth; /* 8 or 32 bpp */
- int greyscale; /* 1 = greyscale, 0 = color */
- int linear; /* 1 = linear, 0 = non-linear */
- int direct; /* 1 = 24bpp directcolor */
- int channel; /* 0 = X, 1 = R, 2 = G, 3 = B */
- int palette; /* Only PAC2 has multiple CLUTs */
-} ffb_wid_info_t;
-
-#define FFB_MAX_PWIDS 64
-typedef struct {
- int num_wids;
- int wid_shift; /* To get X channel value */
- ffb_wid_info_t wid_pool[FFB_MAX_PWIDS];
-} ffb_wid_pool_t;
-
-typedef struct ffb_dac_info {
- unsigned int flags;
-#define FFB_DAC_PAC1 0x00000001 /* Pacifica1 DAC, BT9068 */
-#define FFB_DAC_PAC2 0x00000002 /* Pacifica2 DAC, BT498 */
-#define FFB_DAC_ICURCTL 0x00000004 /* Inverted CUR_CTRL bits */
-
- unsigned int kernel_wid;
-
- /* These registers need to be modified when changing DAC
- * timing state, so at init time we capture their values.
- */
- unsigned int ffbcfg0;
- unsigned int ffbcfg2;
- unsigned int ffb_passin_ctrl; /* FFB2+/AFB only */
-
- ffb_dac_hwstate_t kern_dac_state;
- ffb_dac_hwstate_t x_dac_state;
-
- ffb_wid_pool_t wid_table;
-} ffb_dac_info_t;
-
-#endif /* _FFB_DAC_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_drishare.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_drishare.h
deleted file mode 100644
index baf2f0d0a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_drishare.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_drishare.h,v 1.2 2000/06/21 00:47:37 dawes Exp $ */
-
-#ifndef _FFB_DRISHARE_H
-#define _FFB_DRISHARE_H
-
-typedef struct ffb_dri_state {
- int flags;
-#define FFB_DRI_FFB2 0x00000001
-#define FFB_DRI_FFB2PLUS 0x00000002
-#define FFB_DRI_PAC1 0x00000004
-#define FFB_DRI_PAC2 0x00000008
-
- /* Indexed by DRI drawable id. */
-#define FFB_DRI_NWIDS 64
- unsigned int wid_table[FFB_DRI_NWIDS];
-} ffb_dri_state_t;
-
-#define FFB_DRISHARE(SAREA) \
- ((ffb_dri_state_t *) (((char *)(SAREA)) + sizeof(drm_sarea_t)))
-
-typedef struct {
- drm_handle_t hFbcRegs;
- drmSize sFbcRegs;
-
- drm_handle_t hDacRegs;
- drmSize sDacRegs;
-
- drm_handle_t hSfb8r;
- drmSize sSfb8r;
-
- drm_handle_t hSfb32;
- drmSize sSfb32;
-
- drm_handle_t hSfb64;
- drmSize sSfb64;
-
- /* Fastfill/Pagefill parameters. */
- unsigned char disable_pagefill;
- int fastfill_small_area;
- int pagefill_small_area;
- int fastfill_height;
- int fastfill_width;
- int pagefill_height;
- int pagefill_width;
- short Pf_AlignTab[0x800];
-} FFBDRIRec, *FFBDRIPtr;
-
-#endif /* !(_FFB_DRISHARE_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_regs.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_regs.h
deleted file mode 100644
index 7f383d38d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/ffb/server/ffb_regs.h
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * Acceleration for the Creator and Creator3D framebuffer - register layout.
- *
- * Copyright (C) 1998,1999,2000 Jakub Jelinek (jakub@redhat.com)
- * Copyright (C) 1998 Michal Rehacek (majkl@iname.com)
- * Copyright (C) 1999 David S. Miller (davem@redhat.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * JAKUB JELINEK, MICHAL REHACEK, OR DAVID MILLER BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_regs.h,v 1.1 2000/05/18 23:21:37 dawes Exp $ */
-
-#ifndef FFBREGS_H
-#define FFBREGS_H
-
-/* Auxilliary clips. */
-typedef struct {
- volatile unsigned int min;
- volatile unsigned int max;
-} ffb_auxclip, *ffb_auxclipPtr;
-
-/* FFB register set. */
-typedef struct _ffb_fbc {
- /* Next vertex registers, on the right we list which drawops
- * use said register and the logical name the register has in
- * that context.
- */ /* DESCRIPTION DRAWOP(NAME) */
-/*0x00*/unsigned int pad1[3]; /* Reserved */
-/*0x0c*/volatile unsigned int alpha; /* ALPHA Transparency */
-/*0x10*/volatile unsigned int red; /* RED */
-/*0x14*/volatile unsigned int green; /* GREEN */
-/*0x18*/volatile unsigned int blue; /* BLUE */
-/*0x1c*/volatile unsigned int z; /* DEPTH */
-/*0x20*/volatile unsigned int y; /* Y triangle(DOYF) */
- /* aadot(DYF) */
- /* ddline(DYF) */
- /* aaline(DYF) */
-/*0x24*/volatile unsigned int x; /* X triangle(DOXF) */
- /* aadot(DXF) */
- /* ddline(DXF) */
- /* aaline(DXF) */
-/*0x28*/unsigned int pad2[2]; /* Reserved */
-/*0x30*/volatile unsigned int ryf; /* Y (alias to DOYF) ddline(RYF) */
- /* aaline(RYF) */
- /* triangle(RYF) */
-/*0x34*/volatile unsigned int rxf; /* X ddline(RXF) */
- /* aaline(RXF) */
- /* triangle(RXF) */
-/*0x38*/unsigned int pad3[2]; /* Reserved */
-/*0x40*/volatile unsigned int dmyf; /* Y (alias to DOYF) triangle(DMYF) */
-/*0x44*/volatile unsigned int dmxf; /* X triangle(DMXF) */
-/*0x48*/unsigned int pad4[2]; /* Reserved */
-/*0x50*/volatile unsigned int ebyi; /* Y (alias to RYI) polygon(EBYI) */
-/*0x54*/volatile unsigned int ebxi; /* X polygon(EBXI) */
-/*0x58*/unsigned int pad5[2]; /* Reserved */
-/*0x60*/volatile unsigned int by; /* Y brline(RYI) */
- /* fastfill(OP) */
- /* polygon(YI) */
- /* rectangle(YI) */
- /* bcopy(SRCY) */
- /* vscroll(SRCY) */
-/*0x64*/volatile unsigned int bx; /* X brline(RXI) */
- /* polygon(XI) */
- /* rectangle(XI) */
- /* bcopy(SRCX) */
- /* vscroll(SRCX) */
- /* fastfill(GO) */
-/*0x68*/volatile unsigned int dy; /* destination Y fastfill(DSTY) */
- /* bcopy(DSRY) */
- /* vscroll(DSRY) */
-/*0x6c*/volatile unsigned int dx; /* destination X fastfill(DSTX) */
- /* bcopy(DSTX) */
- /* vscroll(DSTX) */
-/*0x70*/volatile unsigned int bh; /* Y (alias to RYI) brline(DYI) */
- /* dot(DYI) */
- /* polygon(ETYI) */
- /* Height fastfill(H) */
- /* bcopy(H) */
- /* vscroll(H) */
- /* Y count fastfill(NY) */
-/*0x74*/volatile unsigned int bw; /* X dot(DXI) */
- /* brline(DXI) */
- /* polygon(ETXI) */
- /* fastfill(W) */
- /* bcopy(W) */
- /* vscroll(W) */
- /* fastfill(NX) */
-/*0x78*/unsigned int pad6[2]; /* Reserved */
-/*0x80*/unsigned int pad7[32]; /* Reserved */
-
- /* Setup Unit's vertex state register */
-/*100*/ volatile unsigned int suvtx;
-/*104*/ unsigned int pad8[63]; /* Reserved */
-
- /* Frame Buffer Control Registers */
-/*200*/ volatile unsigned int ppc; /* Pixel Processor Control */
-/*204*/ volatile unsigned int wid; /* Current WID */
-/*208*/ volatile unsigned int fg; /* FG data */
-/*20c*/ volatile unsigned int bg; /* BG data */
-/*210*/ volatile unsigned int consty; /* Constant Y */
-/*214*/ volatile unsigned int constz; /* Constant Z */
-/*218*/ volatile unsigned int xclip; /* X Clip */
-/*21c*/ volatile unsigned int dcss; /* Depth Cue Scale Slope */
-/*220*/ volatile unsigned int vclipmin; /* Viewclip XY Min Bounds */
-/*224*/ volatile unsigned int vclipmax; /* Viewclip XY Max Bounds */
-/*228*/ volatile unsigned int vclipzmin; /* Viewclip Z Min Bounds */
-/*22c*/ volatile unsigned int vclipzmax; /* Viewclip Z Max Bounds */
-/*230*/ volatile unsigned int dcsf; /* Depth Cue Scale Front Bound */
-/*234*/ volatile unsigned int dcsb; /* Depth Cue Scale Back Bound */
-/*238*/ volatile unsigned int dczf; /* Depth Cue Z Front */
-/*23c*/ volatile unsigned int dczb; /* Depth Cue Z Back */
-/*240*/ unsigned int pad9; /* Reserved */
-/*244*/ volatile unsigned int blendc; /* Alpha Blend Control */
-/*248*/ volatile unsigned int blendc1; /* Alpha Blend Color 1 */
-/*24c*/ volatile unsigned int blendc2; /* Alpha Blend Color 2 */
-/*250*/ volatile unsigned int fbramitc; /* FB RAM Interleave Test Control */
-/*254*/ volatile unsigned int fbc; /* Frame Buffer Control */
-/*258*/ volatile unsigned int rop; /* Raster OPeration */
-/*25c*/ volatile unsigned int cmp; /* Frame Buffer Compare */
-/*260*/ volatile unsigned int matchab; /* Buffer AB Match Mask */
-/*264*/ volatile unsigned int matchc; /* Buffer C(YZ) Match Mask */
-/*268*/ volatile unsigned int magnab; /* Buffer AB Magnitude Mask */
-/*26c*/ volatile unsigned int magnc; /* Buffer C(YZ) Magnitude Mask */
-/*270*/ volatile unsigned int fbcfg0; /* Frame Buffer Config 0 */
-/*274*/ volatile unsigned int fbcfg1; /* Frame Buffer Config 1 */
-/*278*/ volatile unsigned int fbcfg2; /* Frame Buffer Config 2 */
-/*27c*/ volatile unsigned int fbcfg3; /* Frame Buffer Config 3 */
-/*280*/ volatile unsigned int ppcfg; /* Pixel Processor Config */
-/*284*/ volatile unsigned int pick; /* Picking Control */
-/*288*/ volatile unsigned int fillmode; /* FillMode */
-/*28c*/ volatile unsigned int fbramwac; /* FB RAM Write Address Control */
-/*290*/ volatile unsigned int pmask; /* RGB PlaneMask */
-/*294*/ volatile unsigned int xpmask; /* X PlaneMask */
-/*298*/ volatile unsigned int ypmask; /* Y PlaneMask */
-/*29c*/ volatile unsigned int zpmask; /* Z PlaneMask */
-/*2a0*/ ffb_auxclip auxclip[4]; /* Auxilliary Viewport Clip */
-
- /* New 3dRAM III support regs */
-/*2c0*/ volatile unsigned int rawblend2;
-/*2c4*/ volatile unsigned int rawpreblend;
-/*2c8*/ volatile unsigned int rawstencil;
-/*2cc*/ volatile unsigned int rawstencilctl;
-/*2d0*/ volatile unsigned int threedram1;
-/*2d4*/ volatile unsigned int threedram2;
-/*2d8*/ volatile unsigned int passin;
-/*2dc*/ volatile unsigned int rawclrdepth;
-/*2e0*/ volatile unsigned int rawpmask;
-/*2e4*/ volatile unsigned int rawcsrc;
-/*2e8*/ volatile unsigned int rawmatch;
-/*2ec*/ volatile unsigned int rawmagn;
-/*2f0*/ volatile unsigned int rawropblend;
-/*2f4*/ volatile unsigned int rawcmp;
-/*2f8*/ volatile unsigned int rawwac;
-/*2fc*/ volatile unsigned int fbramid;
-
-/*300*/ volatile unsigned int drawop; /* Draw OPeration */
-/*304*/ unsigned int pad10[2]; /* Reserved */
-/*30c*/ volatile unsigned int lpat; /* Line Pattern control */
-/*310*/ unsigned int pad11; /* Reserved */
-/*314*/ volatile unsigned int fontxy; /* XY Font coordinate */
-/*318*/ volatile unsigned int fontw; /* Font Width */
-/*31c*/ volatile unsigned int fontinc; /* Font Increment */
-/*320*/ volatile unsigned int font; /* Font bits */
-/*324*/ unsigned int pad12[3]; /* Reserved */
-/*330*/ volatile unsigned int blend2;
-/*334*/ volatile unsigned int preblend;
-/*338*/ volatile unsigned int stencil;
-/*33c*/ volatile unsigned int stencilctl;
-
-/*340*/ unsigned int pad13[4]; /* Reserved */
-/*350*/ volatile unsigned int dcss1; /* Depth Cue Scale Slope 1 */
-/*354*/ volatile unsigned int dcss2; /* Depth Cue Scale Slope 2 */
-/*358*/ volatile unsigned int dcss3; /* Depth Cue Scale Slope 3 */
-/*35c*/ volatile unsigned int widpmask;
-/*360*/ volatile unsigned int dcs2;
-/*364*/ volatile unsigned int dcs3;
-/*368*/ volatile unsigned int dcs4;
-/*36c*/ unsigned int pad14; /* Reserved */
-/*370*/ volatile unsigned int dcd2;
-/*374*/ volatile unsigned int dcd3;
-/*378*/ volatile unsigned int dcd4;
-/*37c*/ unsigned int pad15; /* Reserved */
-/*380*/ volatile unsigned int pattern[32]; /* area Pattern */
-/*400*/ unsigned int pad16[8]; /* Reserved */
-/*420*/ volatile unsigned int reset; /* chip RESET */
-/*424*/ unsigned int pad17[247]; /* Reserved */
-/*800*/ volatile unsigned int devid; /* Device ID */
-/*804*/ unsigned int pad18[63]; /* Reserved */
-/*900*/ volatile unsigned int ucsr; /* User Control & Status Register */
-/*904*/ unsigned int pad19[31]; /* Reserved */
-/*980*/ volatile unsigned int mer; /* Mode Enable Register */
-/*984*/ unsigned int pad20[1439]; /* Reserved */
-} ffb_fbc, *ffb_fbcPtr;
-
-/* Draw operations */
-#define FFB_DRAWOP_DOT 0x00
-#define FFB_DRAWOP_AADOT 0x01
-#define FFB_DRAWOP_BRLINECAP 0x02
-#define FFB_DRAWOP_BRLINEOPEN 0x03
-#define FFB_DRAWOP_DDLINE 0x04
-#define FFB_DRAWOP_AALINE 0x05
-#define FFB_DRAWOP_TRIANGLE 0x06
-#define FFB_DRAWOP_POLYGON 0x07
-#define FFB_DRAWOP_RECTANGLE 0x08
-#define FFB_DRAWOP_FASTFILL 0x09
-#define FFB_DRAWOP_BCOPY 0x0a /* Not implemented in any FFB, VIS is faster */
-#define FFB_DRAWOP_VSCROLL 0x0b /* Up to 12x faster than BCOPY, 3-4x faster than VIS */
-
-/* FastFill operation codes. */
-#define FFB_FASTFILL_PAGE 0x01
-#define FFB_FASTFILL_BLOCK 0x02
-#define FFB_FASTFILL_COLOR_BLK 0x03
-#define FFB_FASTFILL_BLOCK_X 0x04
-
-/* Spanfill Unit Line Pattern */
-#define FFB_LPAT_SCALEPTR 0xf0000000
-#define FFB_LPAT_SCALEPTR_SHIFT 28
-#define FFB_LPAT_PATPTR 0x0f000000
-#define FFB_LPAT_PATPTR_SHIFT 24
-#define FFB_LPAT_SCALEVAL 0x00f00000
-#define FFB_LPAT_SCALEVAL_SHIFT 20
-#define FFB_LPAT_PATLEN 0x000f0000
-#define FFB_LPAT_PATLEN_SHIFT 16
-#define FFB_LPAT_PATTERN 0x0000ffff
-#define FFB_LPAT_PATTERN_SHIFT 0
-
-/* Pixel processor control */
-/* Force WID */
-#define FFB_PPC_FW_DISABLE 0x800000
-#define FFB_PPC_FW_ENABLE 0xc00000
-#define FFB_PPC_FW_MASK 0xc00000
-/* Auxiliary clip */
-#define FFB_PPC_ACE_DISABLE 0x040000
-#define FFB_PPC_ACE_AUX_SUB 0x080000
-#define FFB_PPC_ACE_AUX_ADD 0x0c0000
-#define FFB_PPC_ACE_MASK 0x0c0000
-/* Depth cue */
-#define FFB_PPC_DCE_DISABLE 0x020000
-#define FFB_PPC_DCE_ENABLE 0x030000
-#define FFB_PPC_DCE_MASK 0x030000
-/* Alpha blend */
-#define FFB_PPC_ABE_DISABLE 0x008000
-#define FFB_PPC_ABE_ENABLE 0x00c000
-#define FFB_PPC_ABE_MASK 0x00c000
-/* View clip */
-#define FFB_PPC_VCE_DISABLE 0x001000
-#define FFB_PPC_VCE_2D 0x002000
-#define FFB_PPC_VCE_3D 0x003000
-#define FFB_PPC_VCE_MASK 0x003000
-/* Area pattern */
-#define FFB_PPC_APE_DISABLE 0x000800
-#define FFB_PPC_APE_ENABLE 0x000c00
-#define FFB_PPC_APE_MASK 0x000c00
-/* Transparent background */
-#define FFB_PPC_TBE_OPAQUE 0x000200
-#define FFB_PPC_TBE_TRANSPARENT 0x000300
-#define FFB_PPC_TBE_MASK 0x000300
-/* Z source */
-#define FFB_PPC_ZS_VAR 0x000080
-#define FFB_PPC_ZS_CONST 0x0000c0
-#define FFB_PPC_ZS_MASK 0x0000c0
-/* Y source */
-#define FFB_PPC_YS_VAR 0x000020
-#define FFB_PPC_YS_CONST 0x000030
-#define FFB_PPC_YS_MASK 0x000030
-/* X source */
-#define FFB_PPC_XS_WID 0x000004
-#define FFB_PPC_XS_VAR 0x000008
-#define FFB_PPC_XS_CONST 0x00000c
-#define FFB_PPC_XS_MASK 0x00000c
-/* Color (BGR) source */
-#define FFB_PPC_CS_VAR 0x000002
-#define FFB_PPC_CS_CONST 0x000003
-#define FFB_PPC_CS_MASK 0x000003
-
-/* X Clip */
-#define FFB_XCLIP_XREF 0x000000ff
-#define FFB_XCLIP_TEST_MASK 0x00070000
-#define FFB_XCLIP_TEST_ALWAYS 0x00000000
-#define FFB_XCLIP_TEST_GT 0x00010000
-#define FFB_XCLIP_TEST_EQ 0x00020000
-#define FFB_XCLIP_TEST_GE 0x00030000
-#define FFB_XCLIP_TEST_NEVER 0x00040000
-#define FFB_XCLIP_TEST_LE 0x00050000
-#define FFB_XCLIP_TEST_NE 0x00060000
-#define FFB_XCLIP_TEST_LT 0x00070000
-
-/* FB Control register */
-/* Write buffer dest */
-#define FFB_FBC_WB_A 0x20000000
-#define FFB_FBC_WB_B 0x40000000
-#define FFB_FBC_WB_AB 0x60000000
-#define FFB_FBC_WB_C 0x80000000
-#define FFB_FBC_WB_AC 0xa0000000
-#define FFB_FBC_WB_BC 0xc0000000
-#define FFB_FBC_WB_ABC 0xe0000000
-#define FFB_FBC_WB_MASK 0xe0000000
-/* Write enable */
-#define FFB_FBC_WE_FORCEOFF 0x00100000
-#define FFB_FBC_WE_FORCEON 0x00200000
-#define FFB_FBC_WE_USE_WMASK 0x00300000
-#define FFB_FBC_WE_MASK 0x00300000
-/* Write group mode */
-#define FFB_FBC_WM_RSVD 0x00040000
-#define FFB_FBC_WM_COMBINED 0x00080000
-#define FFB_FBC_WM_SEPARATE 0x000c0000
-#define FFB_FBC_WM_MASK 0x000c0000
-/* Read buffer src */
-#define FFB_FBC_RB_A 0x00004000
-#define FFB_FBC_RB_B 0x00008000
-#define FFB_FBC_RB_C 0x0000c000
-#define FFB_FBC_RB_MASK 0x0000c000
-/* Stereo buf dest */
-#define FFB_FBC_SB_LEFT 0x00001000
-#define FFB_FBC_SB_RIGHT 0x00002000
-#define FFB_FBC_SB_BOTH 0x00003000
-#define FFB_FBC_SB_MASK 0x00003000
-/* Z plane group enable */
-#define FFB_FBC_ZE_OFF 0x00000400
-#define FFB_FBC_ZE_ON 0x00000800
-#define FFB_FBC_ZE_MASK 0x00000c00
-/* Y plane group enable */
-#define FFB_FBC_YE_OFF 0x00000100
-#define FFB_FBC_YE_ON 0x00000200
-#define FFB_FBC_YE_MASK 0x00000300
-/* X plane group enable */
-#define FFB_FBC_XE_OFF 0x00000040
-#define FFB_FBC_XE_ON 0x00000080
-#define FFB_FBC_XE_MASK 0x000000c0
-/* B plane group enable */
-#define FFB_FBC_BE_OFF 0x00000010
-#define FFB_FBC_BE_ON 0x00000020
-#define FFB_FBC_BE_MASK 0x00000030
-/* G plane group enable */
-#define FFB_FBC_GE_OFF 0x00000004
-#define FFB_FBC_GE_ON 0x00000008
-#define FFB_FBC_GE_MASK 0x0000000c
-/* R plane group enable */
-#define FFB_FBC_RE_OFF 0x00000001
-#define FFB_FBC_RE_ON 0x00000002
-#define FFB_FBC_RE_MASK 0x00000003
-/* Combined */
-#define FFB_FBC_RGBE_OFF 0x00000015
-#define FFB_FBC_RGBE_ON 0x0000002a
-#define FFB_FBC_RGBE_MASK 0x0000003f
-
-/* Raster OP */
-#define FFB_ROP_YZ_MASK 0x008f0000
-#define FFB_ROP_X_MASK 0x00008f00
-#define FFB_ROP_RGB_MASK 0x0000008f
-
-/* Now the rops themselves which get shifted into the
- * above fields.
- */
-#define FFB_ROP_EDIT_BIT 0x80
-#define FFB_ROP_ZERO 0x80
-#define FFB_ROP_NEW_AND_OLD 0x81
-#define FFB_ROP_NEW_AND_NOLD 0x82
-#define FFB_ROP_NEW 0x83
-#define FFB_ROP_NNEW_AND_OLD 0x84
-#define FFB_ROP_OLD 0x85
-#define FFB_ROP_NEW_XOR_OLD 0x86
-#define FFB_ROP_NEW_OR_OLD 0x87
-#define FFB_ROP_NNEW_AND_NOLD 0x88
-#define FFB_ROP_NNEW_XOR_NOLD 0x89
-#define FFB_ROP_NOLD 0x8a
-#define FFB_ROP_NEW_OR_NOLD 0x8b
-#define FFB_ROP_NNEW 0x8c
-#define FFB_ROP_NNEW_OR_OLD 0x8d
-#define FFB_ROP_NNEW_OR_NOLD 0x8e
-#define FFB_ROP_ONES 0x8f
-
-/* FB Compare */
-#define FFB_CMP_MATCHC_MASK 0x8f000000
-#define FFB_CMP_MAGNC_MASK 0x00870000
-#define FFB_CMP_MATCHAB_MASK 0x0000ff00
-#define FFB_CMP_MAGNAB_MASK 0x000000ff
-
-/* Compare Match codes */
-#define FFB_CMP_MATCH_EDIT_BIT 0x80
-#define FFB_CMP_MATCH_ALWAYS 0x80
-#define FFB_CMP_MATCH_NEVER 0x81
-#define FFB_CMP_MATCH_EQ 0x82
-#define FFB_CMP_MATCH_NE 0x83
-#define FFB_CMP_MATCH_A_ALWAYS 0xc0
-#define FFB_CMP_MATCH_B_ALWAYS 0xa0
-
-/* Compare Magnitude codes */
-#define FFB_CMP_MAGN_EDIT_BIT 0x80
-#define FFB_CMP_MAGN_ALWAYS 0x80
-#define FFB_CMP_MAGN_GT 0x81
-#define FFB_CMP_MAGN_EQ 0x82
-#define FFB_CMP_MAGN_GE 0x83
-#define FFB_CMP_MAGN_NEVER 0x84
-#define FFB_CMP_MAGN_LE 0x85
-#define FFB_CMP_MAGN_NE 0x86
-#define FFB_CMP_MAGN_LT 0x87
-#define FFB_CMP_MAGN_A_ALWAYS 0xc0
-#define FFB_CMP_MAGN_B_ALWAYS 0xa0
-
-/* User Control and Status */
-#define FFB_UCSR_FIFO_MASK 0x00000fff
-#define FFB_UCSR_PICK_NO_HIT 0x00020000
-#define FFB_UCSR_PICK_HIT 0x00030000
-#define FFB_UCSR_PICK_DISABLE 0x00080000
-#define FFB_UCSR_PICK_ENABLE 0x000c0000
-#define FFB_UCSR_FB_BUSY 0x01000000
-#define FFB_UCSR_RP_BUSY 0x02000000
-#define FFB_UCSR_ALL_BUSY (FFB_UCSR_RP_BUSY|FFB_UCSR_FB_BUSY)
-#define FFB_UCSR_READ_ERR 0x40000000
-#define FFB_UCSR_FIFO_OVFL 0x80000000
-#define FFB_UCSR_ALL_ERRORS (FFB_UCSR_READ_ERR|FFB_UCSR_FIFO_OVFL)
-
-/* Mode Enable Register */
-#define FFB_MER_EIRA 0x00000080 /* Enable read-ahead, increasing */
-#define FFB_MER_EDRA 0x000000c0 /* Enable read-ahead, decreasing */
-#define FFB_MER_DRA 0x00000040 /* No read-ahead */
-
-/* FBram Config 0 */
-#define FFB_FBCFG0_RFTIME 0xff800000
-#define FFB_FBCFG0_XMAX 0x007c0000
-#define FFB_FBCFG0_YMAX 0x0003ffc0
-#define FFB_FBCFG0_RES_MASK 0x00000030
-#define FFB_FBCFG0_RES_HIGH 0x00000030 /* 1920x1360 */
-#define FFB_FBCFG0_RES_STD 0x00000020 /* 1280x1024 */
-#define FFB_FBCFG0_RES_STEREO 0x00000010 /* 960x580 */
-#define FFB_FBCFG0_RES_PRTRAIT 0x00000000 /* 1280x2048 */
-#define FFB_FBCFG0_ITRLACE 0x00000000
-#define FFB_FBCFG0_SEQUENTIAL 0x00000008
-#define FFB_FBCFG0_DRENA 0x00000004
-#define FFB_FBCFG0_BPMODE 0x00000002
-#define FFB_FBCFG0_RFRSH_RST 0x00000001
-
-typedef struct _ffb_dac {
- volatile unsigned int cfg;
- volatile unsigned int cfgdata;
- volatile unsigned int cur;
- volatile unsigned int curdata;
-} ffb_dac, *ffb_dacPtr;
-
-/* Writing 2 32-bit registers at a time using 64-bit stores. -DaveM */
-#if defined(__GNUC__) && defined(USE_VIS)
-/* 64-bit register writing support.
- * Note: "lo" means "low address".
- */
-#define FFB_WRITE64_COMMON(__regp, __lo32, __hi32, REG0, REG1) \
-do { __extension__ register unsigned int __r0 __asm__(""#REG0); \
- __extension__ register unsigned int __r1 __asm__(""#REG1); \
- __r0 = (__lo32); \
- __r1 = (__hi32); \
- __asm__ __volatile__ ("sllx\t%0, 32, %%g1\n\t" \
- "srl\t%1, 0, %1\n\t" \
- "or\t%%g1, %1, %%g1\n\t" \
- "stx\t%%g1, %2" \
- : : "r" (__r0), "r" (__r1), "m" (*(__regp)) : "g1"); \
-} while(0)
-
-#define FFB_WRITE64P(__regp, __srcp) \
-do { __asm__ __volatile__ ("ldx\t%0, %%g2;" \
- "stx\t%%g2, %1" \
- : : "m" (*(__srcp)), "m" (*(__regp)) \
- : "g2"); \
-} while(0)
-
-#define FFB_WRITE64(__regp, __lo32, __hi32) \
- FFB_WRITE64_COMMON(__regp, __lo32, __hi32, g2, g3)
-#define FFB_WRITE64_2(__regp, __lo32, __hi32) \
- FFB_WRITE64_COMMON(__regp, __lo32, __hi32, g4, g5)
-#define FFB_WRITE64_3(__regp, __lo32, __hi32) \
- FFB_WRITE64_COMMON(__regp, __lo32, __hi32, o4, o5)
-
-#else /* Do not use 64-bit writes. */
-
-#define FFB_WRITE64(__regp, __lo32, __hi32) \
-do { volatile unsigned int *__p = (__regp); \
- *__p = (__lo32); \
- *(__p + 1) = (__hi32); \
-} while(0)
-
-#define FFB_WRITE64P(__regp, __srcp) \
-do { volatile unsigned int *__p = (__regp); \
- unsigned int *__q = (__srcp); \
- *__p = *__q; \
- *(__p + 1) = *(__q + 1); \
-} while(0)
-
-#define FFB_WRITE64_2(__regp, __lo32, __hi32) \
- FFB_WRITE64(__regp, __lo32, __hi32)
-#define FFB_WRITE64_3(__regp, __lo32, __hi32) \
- FFB_WRITE64(__regp, __lo32, __hi32)
-#endif
-
-#endif /* FFBREGS_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/Makefile
deleted file mode 100644
index 250d3ac08..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# src/mesa/drivers/dri/gamma/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = gamma_dri.so
-
-# Not yet
-# MINIGLX_SOURCES = server/gamma_dri.c
-
-DRIVER_SOURCES = \
- gamma_context.c \
- gamma_dd.c \
- gamma_inithw.c \
- gamma_lock.c \
- gamma_render.c \
- gamma_screen.c \
- gamma_span.c \
- gamma_state.c \
- gamma_tex.c \
- gamma_texmem.c \
- gamma_texstate.c \
- gamma_tris.c \
- gamma_vb.c \
- gamma_xmesa.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_client.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_client.h
deleted file mode 100644
index 1c1a22ebc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_client.h
+++ /dev/null
@@ -1,6185 +0,0 @@
-/* Automaticallly generated -- do not edit */
-#ifndef _GLINT_CLIENT_H_
-#define _GLINT_CLIENT_H_
-/* **********************************************************************/
-/* START OF glint_extra.h INCLUSION */
-/* **********************************************************************/
-
-/* glint_extra.h
- * Created: Fri Apr 2 23:32:05 1999 by faith@precisioninsight.com
- * Revised: Fri Apr 2 23:33:00 1999 by faith@precisioninsight.com
- *
- * Copyright 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, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * 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.
- *
- * $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_client.h,v 1.3 2002/02/22 21:33:00 dawes Exp $
- *
- */
-
-#define AreaStippleEnable 0x00001
-#define LineStippleEnable 0x00002
-#define GResetLineStipple 0x00004
-#define FastFillEnable 0x00008
-#define PrimitiveLine 0x00000
-#define PrimitiveTrapezoid 0x00040
-#define PrimitivePoint 0x00080
-#define PrimitiveRectangle 0x000C0
-#define AntialiasEnable 0x00100
-#define AntialiasingQuality 0x00200
-#define UsePointTable 0x00400
-#define SyncOnBitMask 0x00800
-#define SyncOnHostData 0x01000
-#define TextureEnable 0x02000
-#define FogEnable 0x04000
-#define CoverageEnable 0x08000
-#define SubPixelCorrectionEnable 0x10000
-#define SpanOperation 0x40000
-
-
-/* **********************************************************************/
-/* END OF glint_extra.h INCLUSION */
-/* **********************************************************************/
-
-
-#define GlintResetStatus 0x0000
-#define GlintResetStatusReg 0
-#define GlintResetStatusOff 0x0000
-#define GlintResetStatusSec 0x0000
-#define GlintResetStatusSecReg 2
-#define GlintResetStatusSecOff 0x0000
-
-#define GlintIntEnable 0x0008
-#define GlintIntEnableReg 0
-#define GlintIntEnableOff 0x0008
-#define GlintIntEnableSec 0x0008
-#define GlintIntEnableSecReg 2
-#define GlintIntEnableSecOff 0x0008
-
-#define GlintIntFlags 0x0010
-#define GlintIntFlagsReg 0
-#define GlintIntFlagsOff 0x0010
-#define GlintIntFlagsSec 0x0010
-#define GlintIntFlagsSecReg 2
-#define GlintIntFlagsSecOff 0x0010
-
-#define GlintInFIFOSpace 0x0018
-#define GlintInFIFOSpaceReg 0
-#define GlintInFIFOSpaceOff 0x0018
-#define GlintInFIFOSpaceSec 0x0018
-#define GlintInFIFOSpaceSecReg 2
-#define GlintInFIFOSpaceSecOff 0x0018
-
-#define GlintOutFIFOWords 0x0020
-#define GlintOutFIFOWordsReg 0
-#define GlintOutFIFOWordsOff 0x0020
-#define GlintOutFIFOWordsSec 0x0020
-#define GlintOutFIFOWordsSecReg 2
-#define GlintOutFIFOWordsSecOff 0x0020
-
-#define GlintDMAAddress 0x0028
-#define GlintDMAAddressReg 0
-#define GlintDMAAddressOff 0x0028
-#define GlintDMAAddressSec 0x0028
-#define GlintDMAAddressSecReg 2
-#define GlintDMAAddressSecOff 0x0028
-
-#define GlintDMACount 0x0030
-#define GlintDMACountReg 0
-#define GlintDMACountOff 0x0030
-#define GlintDMACountSec 0x0030
-#define GlintDMACountSecReg 2
-#define GlintDMACountSecOff 0x0030
-
-#define GlintErrorFlags 0x0038
-#define GlintErrorFlagsReg 0
-#define GlintErrorFlagsOff 0x0038
-#define GlintErrorFlagsSec 0x0038
-#define GlintErrorFlagsSecReg 2
-#define GlintErrorFlagsSecOff 0x0038
-
-#define GlintVClkCtl 0x0040
-#define GlintVClkCtlReg 0
-#define GlintVClkCtlOff 0x0040
-#define GlintVClkCtlSec 0x0040
-#define GlintVClkCtlSecReg 2
-#define GlintVClkCtlSecOff 0x0040
-
-#define GlintTestRegister 0x0048
-#define GlintTestRegisterReg 0
-#define GlintTestRegisterOff 0x0048
-#define GlintTestRegisterSec 0x0048
-#define GlintTestRegisterSecReg 2
-#define GlintTestRegisterSecOff 0x0048
-
-#define GlintAperture0 0x0050
-#define GlintAperture0Reg 0
-#define GlintAperture0Off 0x0050
-#define GlintAperture0Sec 0x0050
-#define GlintAperture0SecReg 2
-#define GlintAperture0SecOff 0x0050
-
-#define GlintAperture1 0x0058
-#define GlintAperture1Reg 0
-#define GlintAperture1Off 0x0058
-#define GlintAperture1Sec 0x0058
-#define GlintAperture1SecReg 2
-#define GlintAperture1SecOff 0x0058
-
-#define GlintDMAControl 0x0060
-#define GlintDMAControlReg 0
-#define GlintDMAControlOff 0x0060
-#define GlintDMAControlSec 0x0060
-#define GlintDMAControlSecReg 2
-#define GlintDMAControlSecOff 0x0060
-
-#define GlintFIFODis 0x0068
-#define GlintFIFODisReg 0
-#define GlintFIFODisOff 0x0068
-#define GlintFIFODisSec 0x0068
-#define GlintFIFODisSecReg 2
-#define GlintFIFODisSecOff 0x0068
-
-#define GlintLBMemoryCtl 0x1000
-#define GlintLBMemoryCtlReg 1
-#define GlintLBMemoryCtlOff 0x0000
-#define GlintLBMemoryCtlSec 0x1000
-#define GlintLBMemoryCtlSecReg 3
-#define GlintLBMemoryCtlSecOff 0x0000
-
-#define GlintLBMemoryEDO 0x1008
-#define GlintLBMemoryEDOReg 1
-#define GlintLBMemoryEDOOff 0x0008
-#define GlintLBMemoryEDOSec 0x1008
-#define GlintLBMemoryEDOSecReg 3
-#define GlintLBMemoryEDOSecOff 0x0008
-
-#define GlintFBMemoryCtl 0x1800
-#define GlintFBMemoryCtlReg 1
-#define GlintFBMemoryCtlOff 0x0800
-#define GlintFBMemoryCtlSec 0x1800
-#define GlintFBMemoryCtlSecReg 3
-#define GlintFBMemoryCtlSecOff 0x0800
-
-#define GlintFBModeSel 0x1808
-#define GlintFBModeSelReg 1
-#define GlintFBModeSelOff 0x0808
-#define GlintFBModeSelSec 0x1808
-#define GlintFBModeSelSecReg 3
-#define GlintFBModeSelSecOff 0x0808
-
-#define GlintFBGCWrMask 0x1810
-#define GlintFBGCWrMaskReg 1
-#define GlintFBGCWrMaskOff 0x0810
-#define GlintFBGCWrMaskSec 0x1810
-#define GlintFBGCWrMaskSecReg 3
-#define GlintFBGCWrMaskSecOff 0x0810
-
-#define GlintFBGCColorLower 0x1818
-#define GlintFBGCColorLowerReg 1
-#define GlintFBGCColorLowerOff 0x0818
-#define GlintFBGCColorLowerSec 0x1818
-#define GlintFBGCColorLowerSecReg 3
-#define GlintFBGCColorLowerSecOff 0x0818
-
-#define GlintFBTXMemCtl 0x1820
-#define GlintFBTXMemCtlReg 1
-#define GlintFBTXMemCtlOff 0x0820
-#define GlintFBTXMemCtlSec 0x1820
-#define GlintFBTXMemCtlSecReg 3
-#define GlintFBTXMemCtlSecOff 0x0820
-
-#define GlintFBWrMask 0x1830
-#define GlintFBWrMaskReg 1
-#define GlintFBWrMaskOff 0x0830
-#define GlintFBWrMaskSec 0x1830
-#define GlintFBWrMaskSecReg 3
-#define GlintFBWrMaskSecOff 0x0830
-
-#define GlintFBGCColorUpper 0x1838
-#define GlintFBGCColorUpperReg 1
-#define GlintFBGCColorUpperOff 0x0838
-#define GlintFBGCColorUpperSec 0x1838
-#define GlintFBGCColorUpperSecReg 3
-#define GlintFBGCColorUpperSecOff 0x0838
-
-#define GlintVTGHLimit 0x3000
-#define GlintVTGHLimitReg 1
-#define GlintVTGHLimitOff 0x2000
-#define GlintVTGHLimitSec 0x3000
-#define GlintVTGHLimitSecReg 3
-#define GlintVTGHLimitSecOff 0x2000
-
-#define GlintVTGHSyncStart 0x3008
-#define GlintVTGHSyncStartReg 1
-#define GlintVTGHSyncStartOff 0x2008
-#define GlintVTGHSyncStartSec 0x3008
-#define GlintVTGHSyncStartSecReg 3
-#define GlintVTGHSyncStartSecOff 0x2008
-
-#define GlintVTGHSyncEnd 0x3010
-#define GlintVTGHSyncEndReg 1
-#define GlintVTGHSyncEndOff 0x2010
-#define GlintVTGHSyncEndSec 0x3010
-#define GlintVTGHSyncEndSecReg 3
-#define GlintVTGHSyncEndSecOff 0x2010
-
-#define GlintVTGHBlankEnd 0x3018
-#define GlintVTGHBlankEndReg 1
-#define GlintVTGHBlankEndOff 0x2018
-#define GlintVTGHBlankEndSec 0x3018
-#define GlintVTGHBlankEndSecReg 3
-#define GlintVTGHBlankEndSecOff 0x2018
-
-#define GlintVTGVLimit 0x3020
-#define GlintVTGVLimitReg 1
-#define GlintVTGVLimitOff 0x2020
-#define GlintVTGVLimitSec 0x3020
-#define GlintVTGVLimitSecReg 3
-#define GlintVTGVLimitSecOff 0x2020
-
-#define GlintVTGVSyncStart 0x3028
-#define GlintVTGVSyncStartReg 1
-#define GlintVTGVSyncStartOff 0x2028
-#define GlintVTGVSyncStartSec 0x3028
-#define GlintVTGVSyncStartSecReg 3
-#define GlintVTGVSyncStartSecOff 0x2028
-
-#define GlintVTGVSyncEnd 0x3030
-#define GlintVTGVSyncEndReg 1
-#define GlintVTGVSyncEndOff 0x2030
-#define GlintVTGVSyncEndSec 0x3030
-#define GlintVTGVSyncEndSecReg 3
-#define GlintVTGVSyncEndSecOff 0x2030
-
-#define GlintVTGVBlankEnd 0x3038
-#define GlintVTGVBlankEndReg 1
-#define GlintVTGVBlankEndOff 0x2038
-#define GlintVTGVBlankEndSec 0x3038
-#define GlintVTGVBlankEndSecReg 3
-#define GlintVTGVBlankEndSecOff 0x2038
-
-#define GlintVTGHGateStart 0x3040
-#define GlintVTGHGateStartReg 1
-#define GlintVTGHGateStartOff 0x2040
-#define GlintVTGHGateStartSec 0x3040
-#define GlintVTGHGateStartSecReg 3
-#define GlintVTGHGateStartSecOff 0x2040
-
-#define GlintVTGHGateEnd 0x3048
-#define GlintVTGHGateEndReg 1
-#define GlintVTGHGateEndOff 0x2048
-#define GlintVTGHGateEndSec 0x3048
-#define GlintVTGHGateEndSecReg 3
-#define GlintVTGHGateEndSecOff 0x2048
-
-#define GlintVTGVGateStart 0x3050
-#define GlintVTGVGateStartReg 1
-#define GlintVTGVGateStartOff 0x2050
-#define GlintVTGVGateStartSec 0x3050
-#define GlintVTGVGateStartSecReg 3
-#define GlintVTGVGateStartSecOff 0x2050
-
-#define GlintVTGVGateEnd 0x3058
-#define GlintVTGVGateEndReg 1
-#define GlintVTGVGateEndOff 0x2058
-#define GlintVTGVGateEndSec 0x3058
-#define GlintVTGVGateEndSecReg 3
-#define GlintVTGVGateEndSecOff 0x2058
-
-#define GlintVTGPolarity 0x3060
-#define GlintVTGPolarityReg 1
-#define GlintVTGPolarityOff 0x2060
-#define GlintVTGPolaritySec 0x3060
-#define GlintVTGPolaritySecReg 3
-#define GlintVTGPolaritySecOff 0x2060
-
-#define GlintVTGFrameRowAddr 0x3068
-#define GlintVTGFrameRowAddrReg 1
-#define GlintVTGFrameRowAddrOff 0x2068
-#define GlintVTGFrameRowAddrSec 0x3068
-#define GlintVTGFrameRowAddrSecReg 3
-#define GlintVTGFrameRowAddrSecOff 0x2068
-
-#define GlintVTGVLineNumber 0x3070
-#define GlintVTGVLineNumberReg 1
-#define GlintVTGVLineNumberOff 0x2070
-#define GlintVTGVLineNumberSec 0x3070
-#define GlintVTGVLineNumberSecReg 3
-#define GlintVTGVLineNumberSecOff 0x2070
-
-#define GlintVTGSerialClk 0x3078
-#define GlintVTGSerialClkReg 1
-#define GlintVTGSerialClkOff 0x2078
-#define GlintVTGSerialClkSec 0x3078
-#define GlintVTGSerialClkSecReg 3
-#define GlintVTGSerialClkSecOff 0x2078
-
-#define GlintVTGModeCtl 0x3080
-#define GlintVTGModeCtlReg 1
-#define GlintVTGModeCtlOff 0x2080
-#define GlintVTGModeCtlSec 0x3080
-#define GlintVTGModeCtlSecReg 3
-#define GlintVTGModeCtlSecOff 0x2080
-
-#define GlintOutputFIFO 0x2000
-#define GlintOutputFIFOReg 1
-#define GlintOutputFIFOOff 0x1000
-#define GlintOutputFIFOSec 0x2000
-#define GlintOutputFIFOSecReg 3
-#define GlintOutputFIFOSecOff 0x1000
-
-#define GlintGInFIFOSpace 0x0018
-#define GlintGInFIFOSpaceReg 0
-#define GlintGInFIFOSpaceOff 0x0018
-
-#define GlintGDMAAddress 0x0028
-#define GlintGDMAAddressReg 0
-#define GlintGDMAAddressOff 0x0028
-
-#define GlintGDMACount 0x0030
-#define GlintGDMACountReg 0
-#define GlintGDMACountOff 0x0030
-
-#define GlintGDMAControl 0x0060
-#define GlintGDMAControlReg 0
-#define GlintGDMAControlOff 0x0060
-
-#define GlintGOutDMA 0x0080
-#define GlintGOutDMAReg 0
-#define GlintGOutDMAOff 0x0080
-
-#define GlintGOutDMACount 0x0088
-#define GlintGOutDMACountReg 0
-#define GlintGOutDMACountOff 0x0088
-
-#define GlintGResetStatus 0x0800
-#define GlintGResetStatusReg 0
-#define GlintGResetStatusOff 0x0800
-
-#define GlintGIntEnable 0x0808
-#define GlintGIntEnableReg 0
-#define GlintGIntEnableOff 0x0808
-
-#define GlintGIntFlags 0x0810
-#define GlintGIntFlagsReg 0
-#define GlintGIntFlagsOff 0x0810
-
-#define GlintGErrorFlags 0x0838
-#define GlintGErrorFlagsReg 0
-#define GlintGErrorFlagsOff 0x0838
-
-#define GlintGTestRegister 0x0848
-#define GlintGTestRegisterReg 0
-#define GlintGTestRegisterOff 0x0848
-
-#define GlintGFIFODis 0x0868
-#define GlintGFIFODisReg 0
-#define GlintGFIFODisOff 0x0868
-
-#define GlintGChipConfig 0x0870
-#define GlintGChipConfigReg 0
-#define GlintGChipConfigOff 0x0870
-
-#define GlintGCSRAperture 0x0878
-#define GlintGCSRApertureReg 0
-#define GlintGCSRApertureOff 0x0878
-
-#define GlintGPageTableAddr 0x0c00
-#define GlintGPageTableAddrReg 0
-#define GlintGPageTableAddrOff 0x0c00
-
-#define GlintGPageTableLength 0x0c08
-#define GlintGPageTableLengthReg 0
-#define GlintGPageTableLengthOff 0x0c08
-
-#define GlintGDelayTimer 0x0c38
-#define GlintGDelayTimerReg 0
-#define GlintGDelayTimerOff 0x0c38
-
-#define GlintGCommandMode 0x0c40
-#define GlintGCommandModeReg 0
-#define GlintGCommandModeOff 0x0c40
-
-#define GlintGCommandIntEnable 0x0c48
-#define GlintGCommandIntEnableReg 0
-#define GlintGCommandIntEnableOff 0x0c48
-
-#define GlintGCommandIntFlags 0x0c50
-#define GlintGCommandIntFlagsReg 0
-#define GlintGCommandIntFlagsOff 0x0c50
-
-#define GlintGCommandErrorFlags 0x0c58
-#define GlintGCommandErrorFlagsReg 0
-#define GlintGCommandErrorFlagsOff 0x0c58
-
-#define GlintGCommandStatus 0x0c60
-#define GlintGCommandStatusReg 0
-#define GlintGCommandStatusOff 0x0c60
-
-#define GlintGCommandFaultingAddr 0x0c68
-#define GlintGCommandFaultingAddrReg 0
-#define GlintGCommandFaultingAddrOff 0x0c68
-
-#define GlintGVertexFaultingAddr 0x0c70
-#define GlintGVertexFaultingAddrReg 0
-#define GlintGVertexFaultingAddrOff 0x0c70
-
-#define GlintGWriteFaultingAddr 0x0c88
-#define GlintGWriteFaultingAddrReg 0
-#define GlintGWriteFaultingAddrOff 0x0c88
-
-#define GlintGFeedbackSelectCount 0x0c98
-#define GlintGFeedbackSelectCountReg 0
-#define GlintGFeedbackSelectCountOff 0x0c98
-
-#define GlintGGammaProcessorMode 0x0cb8
-#define GlintGGammaProcessorModeReg 0
-#define GlintGGammaProcessorModeOff 0x0cb8
-
-#define GlintGVGAShadow 0x0d00
-#define GlintGVGAShadowReg 0
-#define GlintGVGAShadowOff 0x0d00
-
-#define GlintGMultGLINTAperture 0x0d08
-#define GlintGMultGLINTApertureReg 0
-#define GlintGMultGLINTApertureOff 0x0d08
-
-#define GlintGMultGLINT1 0x0d10
-#define GlintGMultGLINT1Reg 0
-#define GlintGMultGLINT1Off 0x0d10
-
-#define GlintGMultGLINT2 0x0d18
-#define GlintGMultGLINT2Reg 0
-#define GlintGMultGLINT2Off 0x0d18
-
-#define GlintStartXDom 0x8000
-#define GlintStartXDomTag 0x0000
-#define GlintStartXDomReg 1
-#define GlintStartXDomOff 0x7000
-#define GlintStartXDomSec 0x8000
-#define GlintStartXDomSecReg 3
-#define GlintStartXDomSecOff 0x7000
-
-#define GlintdXDom 0x8008
-#define GlintdXDomTag 0x0001
-#define GlintdXDomReg 1
-#define GlintdXDomOff 0x7008
-#define GlintdXDomSec 0x8008
-#define GlintdXDomSecReg 3
-#define GlintdXDomSecOff 0x7008
-
-#define GlintStartXSub 0x8010
-#define GlintStartXSubTag 0x0002
-#define GlintStartXSubReg 1
-#define GlintStartXSubOff 0x7010
-#define GlintStartXSubSec 0x8010
-#define GlintStartXSubSecReg 3
-#define GlintStartXSubSecOff 0x7010
-
-#define GlintdXSub 0x8018
-#define GlintdXSubTag 0x0003
-#define GlintdXSubReg 1
-#define GlintdXSubOff 0x7018
-#define GlintdXSubSec 0x8018
-#define GlintdXSubSecReg 3
-#define GlintdXSubSecOff 0x7018
-
-#define GlintStartY 0x8020
-#define GlintStartYTag 0x0004
-#define GlintStartYReg 1
-#define GlintStartYOff 0x7020
-#define GlintStartYSec 0x8020
-#define GlintStartYSecReg 3
-#define GlintStartYSecOff 0x7020
-
-#define GlintdY 0x8028
-#define GlintdYTag 0x0005
-#define GlintdYReg 1
-#define GlintdYOff 0x7028
-#define GlintdYSec 0x8028
-#define GlintdYSecReg 3
-#define GlintdYSecOff 0x7028
-
-#define GlintGLINTCount 0x8030
-#define GlintGLINTCountTag 0x0006
-#define GlintGLINTCountReg 1
-#define GlintGLINTCountOff 0x7030
-#define GlintGLINTCountSec 0x8030
-#define GlintGLINTCountSecReg 3
-#define GlintGLINTCountSecOff 0x7030
-
-#define GlintRender 0x8038
-#define GlintRenderTag 0x0007
-#define GlintRenderReg 1
-#define GlintRenderOff 0x7038
-#define GlintRenderSec 0x8038
-#define GlintRenderSecReg 3
-#define GlintRenderSecOff 0x7038
-
-#define GlintContinueNewLine 0x8040
-#define GlintContinueNewLineTag 0x0008
-#define GlintContinueNewLineReg 1
-#define GlintContinueNewLineOff 0x7040
-#define GlintContinueNewLineSec 0x8040
-#define GlintContinueNewLineSecReg 3
-#define GlintContinueNewLineSecOff 0x7040
-
-#define GlintContinueNewDom 0x8048
-#define GlintContinueNewDomTag 0x0009
-#define GlintContinueNewDomReg 1
-#define GlintContinueNewDomOff 0x7048
-#define GlintContinueNewDomSec 0x8048
-#define GlintContinueNewDomSecReg 3
-#define GlintContinueNewDomSecOff 0x7048
-
-#define GlintContinueNewSub 0x8050
-#define GlintContinueNewSubTag 0x000a
-#define GlintContinueNewSubReg 1
-#define GlintContinueNewSubOff 0x7050
-#define GlintContinueNewSubSec 0x8050
-#define GlintContinueNewSubSecReg 3
-#define GlintContinueNewSubSecOff 0x7050
-
-#define GlintContinue 0x8058
-#define GlintContinueTag 0x000b
-#define GlintContinueReg 1
-#define GlintContinueOff 0x7058
-#define GlintContinueSec 0x8058
-#define GlintContinueSecReg 3
-#define GlintContinueSecOff 0x7058
-
-#define GlintFlushSpan 0x8060
-#define GlintFlushSpanTag 0x000c
-#define GlintFlushSpanReg 1
-#define GlintFlushSpanOff 0x7060
-#define GlintFlushSpanSec 0x8060
-#define GlintFlushSpanSecReg 3
-#define GlintFlushSpanSecOff 0x7060
-
-#define GlintBitMaskPattern 0x8068
-#define GlintBitMaskPatternTag 0x000d
-#define GlintBitMaskPatternReg 1
-#define GlintBitMaskPatternOff 0x7068
-#define GlintBitMaskPatternSec 0x8068
-#define GlintBitMaskPatternSecReg 3
-#define GlintBitMaskPatternSecOff 0x7068
-
-#define GlintPointTable0 0x8080
-#define GlintPointTable0Tag 0x0010
-#define GlintPointTable0Reg 1
-#define GlintPointTable0Off 0x7080
-#define GlintPointTable0Sec 0x8080
-#define GlintPointTable0SecReg 3
-#define GlintPointTable0SecOff 0x7080
-
-#define GlintPointTable1 0x8088
-#define GlintPointTable1Tag 0x0011
-#define GlintPointTable1Reg 1
-#define GlintPointTable1Off 0x7088
-#define GlintPointTable1Sec 0x8088
-#define GlintPointTable1SecReg 3
-#define GlintPointTable1SecOff 0x7088
-
-#define GlintPointTable2 0x8090
-#define GlintPointTable2Tag 0x0012
-#define GlintPointTable2Reg 1
-#define GlintPointTable2Off 0x7090
-#define GlintPointTable2Sec 0x8090
-#define GlintPointTable2SecReg 3
-#define GlintPointTable2SecOff 0x7090
-
-#define GlintPointTable3 0x8098
-#define GlintPointTable3Tag 0x0013
-#define GlintPointTable3Reg 1
-#define GlintPointTable3Off 0x7098
-#define GlintPointTable3Sec 0x8098
-#define GlintPointTable3SecReg 3
-#define GlintPointTable3SecOff 0x7098
-
-#define GlintRasterizerMode 0x80a0
-#define GlintRasterizerModeTag 0x0014
-#define GlintRasterizerModeReg 1
-#define GlintRasterizerModeOff 0x70a0
-#define GlintRasterizerModeSec 0x80a0
-#define GlintRasterizerModeSecReg 3
-#define GlintRasterizerModeSecOff 0x70a0
-
-#define GlintYLimits 0x80a8
-#define GlintYLimitsTag 0x0015
-#define GlintYLimitsReg 1
-#define GlintYLimitsOff 0x70a8
-#define GlintYLimitsSec 0x80a8
-#define GlintYLimitsSecReg 3
-#define GlintYLimitsSecOff 0x70a8
-
-#define GlintScanLineOwnership 0x80b0
-#define GlintScanLineOwnershipTag 0x0016
-#define GlintScanLineOwnershipReg 1
-#define GlintScanLineOwnershipOff 0x70b0
-#define GlintScanLineOwnershipSec 0x80b0
-#define GlintScanLineOwnershipSecReg 3
-#define GlintScanLineOwnershipSecOff 0x70b0
-
-#define GlintWaitForCompletion 0x80b8
-#define GlintWaitForCompletionTag 0x0017
-#define GlintWaitForCompletionReg 1
-#define GlintWaitForCompletionOff 0x70b8
-#define GlintWaitForCompletionSec 0x80b8
-#define GlintWaitForCompletionSecReg 3
-#define GlintWaitForCompletionSecOff 0x70b8
-
-#define GlintPixelSize 0x80c0
-#define GlintPixelSizeTag 0x0018
-#define GlintPixelSizeReg 1
-#define GlintPixelSizeOff 0x70c0
-#define GlintPixelSizeSec 0x80c0
-#define GlintPixelSizeSecReg 3
-#define GlintPixelSizeSecOff 0x70c0
-
-#define GlintScissorMode 0x8180
-#define GlintScissorModeTag 0x0030
-#define GlintScissorModeReg 1
-#define GlintScissorModeOff 0x7180
-#define GlintScissorModeSec 0x8180
-#define GlintScissorModeSecReg 3
-#define GlintScissorModeSecOff 0x7180
-
-#define GlintScissorMinXY 0x8188
-#define GlintScissorMinXYTag 0x0031
-#define GlintScissorMinXYReg 1
-#define GlintScissorMinXYOff 0x7188
-#define GlintScissorMinXYSec 0x8188
-#define GlintScissorMinXYSecReg 3
-#define GlintScissorMinXYSecOff 0x7188
-
-#define GlintScissorMaxXY 0x8190
-#define GlintScissorMaxXYTag 0x0032
-#define GlintScissorMaxXYReg 1
-#define GlintScissorMaxXYOff 0x7190
-#define GlintScissorMaxXYSec 0x8190
-#define GlintScissorMaxXYSecReg 3
-#define GlintScissorMaxXYSecOff 0x7190
-
-#define GlintScreenSize 0x8198
-#define GlintScreenSizeTag 0x0033
-#define GlintScreenSizeReg 1
-#define GlintScreenSizeOff 0x7198
-#define GlintScreenSizeSec 0x8198
-#define GlintScreenSizeSecReg 3
-#define GlintScreenSizeSecOff 0x7198
-
-#define GlintAreaStippleMode 0x81a0
-#define GlintAreaStippleModeTag 0x0034
-#define GlintAreaStippleModeReg 1
-#define GlintAreaStippleModeOff 0x71a0
-#define GlintAreaStippleModeSec 0x81a0
-#define GlintAreaStippleModeSecReg 3
-#define GlintAreaStippleModeSecOff 0x71a0
-
-#define GlintLineStippleMode 0x81a8
-#define GlintLineStippleModeTag 0x0035
-#define GlintLineStippleModeReg 1
-#define GlintLineStippleModeOff 0x71a8
-#define GlintLineStippleModeSec 0x81a8
-#define GlintLineStippleModeSecReg 3
-#define GlintLineStippleModeSecOff 0x71a8
-
-#define GlintLoadLineStippleCounters 0x81b0
-#define GlintLoadLineStippleCountersTag 0x0036
-#define GlintLoadLineStippleCountersReg 1
-#define GlintLoadLineStippleCountersOff 0x71b0
-#define GlintLoadLineStippleCountersSec 0x81b0
-#define GlintLoadLineStippleCountersSecReg 3
-#define GlintLoadLineStippleCountersSecOff 0x71b0
-
-#define GlintUpdateLineStippleCounters 0x81b8
-#define GlintUpdateLineStippleCountersTag 0x0037
-#define GlintUpdateLineStippleCountersReg 1
-#define GlintUpdateLineStippleCountersOff 0x71b8
-#define GlintUpdateLineStippleCountersSec 0x81b8
-#define GlintUpdateLineStippleCountersSecReg 3
-#define GlintUpdateLineStippleCountersSecOff 0x71b8
-
-#define GlintSaveLineStippleState 0x81c0
-#define GlintSaveLineStippleStateTag 0x0038
-#define GlintSaveLineStippleStateReg 1
-#define GlintSaveLineStippleStateOff 0x71c0
-#define GlintSaveLineStippleStateSec 0x81c0
-#define GlintSaveLineStippleStateSecReg 3
-#define GlintSaveLineStippleStateSecOff 0x71c0
-
-#define GlintWindowOrigin 0x81c8
-#define GlintWindowOriginTag 0x0039
-#define GlintWindowOriginReg 1
-#define GlintWindowOriginOff 0x71c8
-#define GlintWindowOriginSec 0x81c8
-#define GlintWindowOriginSecReg 3
-#define GlintWindowOriginSecOff 0x71c8
-
-#define GlintAreaStipplePattern0 0x8200
-#define GlintAreaStipplePattern0Tag 0x0040
-#define GlintAreaStipplePattern0Reg 1
-#define GlintAreaStipplePattern0Off 0x7200
-#define GlintAreaStipplePattern0Sec 0x8200
-#define GlintAreaStipplePattern0SecReg 3
-#define GlintAreaStipplePattern0SecOff 0x7200
-
-#define GlintAreaStipplePattern1 0x8208
-#define GlintAreaStipplePattern1Tag 0x0041
-#define GlintAreaStipplePattern1Reg 1
-#define GlintAreaStipplePattern1Off 0x7208
-#define GlintAreaStipplePattern1Sec 0x8208
-#define GlintAreaStipplePattern1SecReg 3
-#define GlintAreaStipplePattern1SecOff 0x7208
-
-#define GlintAreaStipplePattern2 0x8210
-#define GlintAreaStipplePattern2Tag 0x0042
-#define GlintAreaStipplePattern2Reg 1
-#define GlintAreaStipplePattern2Off 0x7210
-#define GlintAreaStipplePattern2Sec 0x8210
-#define GlintAreaStipplePattern2SecReg 3
-#define GlintAreaStipplePattern2SecOff 0x7210
-
-#define GlintAreaStipplePattern3 0x8218
-#define GlintAreaStipplePattern3Tag 0x0043
-#define GlintAreaStipplePattern3Reg 1
-#define GlintAreaStipplePattern3Off 0x7218
-#define GlintAreaStipplePattern3Sec 0x8218
-#define GlintAreaStipplePattern3SecReg 3
-#define GlintAreaStipplePattern3SecOff 0x7218
-
-#define GlintAreaStipplePattern4 0x8220
-#define GlintAreaStipplePattern4Tag 0x0044
-#define GlintAreaStipplePattern4Reg 1
-#define GlintAreaStipplePattern4Off 0x7220
-#define GlintAreaStipplePattern4Sec 0x8220
-#define GlintAreaStipplePattern4SecReg 3
-#define GlintAreaStipplePattern4SecOff 0x7220
-
-#define GlintAreaStipplePattern5 0x8228
-#define GlintAreaStipplePattern5Tag 0x0045
-#define GlintAreaStipplePattern5Reg 1
-#define GlintAreaStipplePattern5Off 0x7228
-#define GlintAreaStipplePattern5Sec 0x8228
-#define GlintAreaStipplePattern5SecReg 3
-#define GlintAreaStipplePattern5SecOff 0x7228
-
-#define GlintAreaStipplePattern6 0x8230
-#define GlintAreaStipplePattern6Tag 0x0046
-#define GlintAreaStipplePattern6Reg 1
-#define GlintAreaStipplePattern6Off 0x7230
-#define GlintAreaStipplePattern6Sec 0x8230
-#define GlintAreaStipplePattern6SecReg 3
-#define GlintAreaStipplePattern6SecOff 0x7230
-
-#define GlintAreaStipplePattern7 0x8238
-#define GlintAreaStipplePattern7Tag 0x0047
-#define GlintAreaStipplePattern7Reg 1
-#define GlintAreaStipplePattern7Off 0x7238
-#define GlintAreaStipplePattern7Sec 0x8238
-#define GlintAreaStipplePattern7SecReg 3
-#define GlintAreaStipplePattern7SecOff 0x7238
-
-#define GlintAreaStipplePattern8 0x8240
-#define GlintAreaStipplePattern8Tag 0x0048
-#define GlintAreaStipplePattern8Reg 1
-#define GlintAreaStipplePattern8Off 0x7240
-#define GlintAreaStipplePattern8Sec 0x8240
-#define GlintAreaStipplePattern8SecReg 3
-#define GlintAreaStipplePattern8SecOff 0x7240
-
-#define GlintAreaStipplePattern9 0x8248
-#define GlintAreaStipplePattern9Tag 0x0049
-#define GlintAreaStipplePattern9Reg 1
-#define GlintAreaStipplePattern9Off 0x7248
-#define GlintAreaStipplePattern9Sec 0x8248
-#define GlintAreaStipplePattern9SecReg 3
-#define GlintAreaStipplePattern9SecOff 0x7248
-
-#define GlintAreaStipplePattern10 0x8250
-#define GlintAreaStipplePattern10Tag 0x004a
-#define GlintAreaStipplePattern10Reg 1
-#define GlintAreaStipplePattern10Off 0x7250
-#define GlintAreaStipplePattern10Sec 0x8250
-#define GlintAreaStipplePattern10SecReg 3
-#define GlintAreaStipplePattern10SecOff 0x7250
-
-#define GlintAreaStipplePattern11 0x8258
-#define GlintAreaStipplePattern11Tag 0x004b
-#define GlintAreaStipplePattern11Reg 1
-#define GlintAreaStipplePattern11Off 0x7258
-#define GlintAreaStipplePattern11Sec 0x8258
-#define GlintAreaStipplePattern11SecReg 3
-#define GlintAreaStipplePattern11SecOff 0x7258
-
-#define GlintAreaStipplePattern12 0x8260
-#define GlintAreaStipplePattern12Tag 0x004c
-#define GlintAreaStipplePattern12Reg 1
-#define GlintAreaStipplePattern12Off 0x7260
-#define GlintAreaStipplePattern12Sec 0x8260
-#define GlintAreaStipplePattern12SecReg 3
-#define GlintAreaStipplePattern12SecOff 0x7260
-
-#define GlintAreaStipplePattern13 0x8268
-#define GlintAreaStipplePattern13Tag 0x004d
-#define GlintAreaStipplePattern13Reg 1
-#define GlintAreaStipplePattern13Off 0x7268
-#define GlintAreaStipplePattern13Sec 0x8268
-#define GlintAreaStipplePattern13SecReg 3
-#define GlintAreaStipplePattern13SecOff 0x7268
-
-#define GlintAreaStipplePattern14 0x8270
-#define GlintAreaStipplePattern14Tag 0x004e
-#define GlintAreaStipplePattern14Reg 1
-#define GlintAreaStipplePattern14Off 0x7270
-#define GlintAreaStipplePattern14Sec 0x8270
-#define GlintAreaStipplePattern14SecReg 3
-#define GlintAreaStipplePattern14SecOff 0x7270
-
-#define GlintAreaStipplePattern15 0x8278
-#define GlintAreaStipplePattern15Tag 0x004f
-#define GlintAreaStipplePattern15Reg 1
-#define GlintAreaStipplePattern15Off 0x7278
-#define GlintAreaStipplePattern15Sec 0x8278
-#define GlintAreaStipplePattern15SecReg 3
-#define GlintAreaStipplePattern15SecOff 0x7278
-
-#define GlintAreaStipplePattern16 0x8280
-#define GlintAreaStipplePattern16Tag 0x0050
-#define GlintAreaStipplePattern16Reg 1
-#define GlintAreaStipplePattern16Off 0x7280
-#define GlintAreaStipplePattern16Sec 0x8280
-#define GlintAreaStipplePattern16SecReg 3
-#define GlintAreaStipplePattern16SecOff 0x7280
-
-#define GlintAreaStipplePattern17 0x8288
-#define GlintAreaStipplePattern17Tag 0x0051
-#define GlintAreaStipplePattern17Reg 1
-#define GlintAreaStipplePattern17Off 0x7288
-#define GlintAreaStipplePattern17Sec 0x8288
-#define GlintAreaStipplePattern17SecReg 3
-#define GlintAreaStipplePattern17SecOff 0x7288
-
-#define GlintAreaStipplePattern18 0x8290
-#define GlintAreaStipplePattern18Tag 0x0052
-#define GlintAreaStipplePattern18Reg 1
-#define GlintAreaStipplePattern18Off 0x7290
-#define GlintAreaStipplePattern18Sec 0x8290
-#define GlintAreaStipplePattern18SecReg 3
-#define GlintAreaStipplePattern18SecOff 0x7290
-
-#define GlintAreaStipplePattern19 0x8298
-#define GlintAreaStipplePattern19Tag 0x0053
-#define GlintAreaStipplePattern19Reg 1
-#define GlintAreaStipplePattern19Off 0x7298
-#define GlintAreaStipplePattern19Sec 0x8298
-#define GlintAreaStipplePattern19SecReg 3
-#define GlintAreaStipplePattern19SecOff 0x7298
-
-#define GlintAreaStipplePattern20 0x82a0
-#define GlintAreaStipplePattern20Tag 0x0054
-#define GlintAreaStipplePattern20Reg 1
-#define GlintAreaStipplePattern20Off 0x72a0
-#define GlintAreaStipplePattern20Sec 0x82a0
-#define GlintAreaStipplePattern20SecReg 3
-#define GlintAreaStipplePattern20SecOff 0x72a0
-
-#define GlintAreaStipplePattern21 0x82a8
-#define GlintAreaStipplePattern21Tag 0x0055
-#define GlintAreaStipplePattern21Reg 1
-#define GlintAreaStipplePattern21Off 0x72a8
-#define GlintAreaStipplePattern21Sec 0x82a8
-#define GlintAreaStipplePattern21SecReg 3
-#define GlintAreaStipplePattern21SecOff 0x72a8
-
-#define GlintAreaStipplePattern22 0x82b0
-#define GlintAreaStipplePattern22Tag 0x0056
-#define GlintAreaStipplePattern22Reg 1
-#define GlintAreaStipplePattern22Off 0x72b0
-#define GlintAreaStipplePattern22Sec 0x82b0
-#define GlintAreaStipplePattern22SecReg 3
-#define GlintAreaStipplePattern22SecOff 0x72b0
-
-#define GlintAreaStipplePattern23 0x82b8
-#define GlintAreaStipplePattern23Tag 0x0057
-#define GlintAreaStipplePattern23Reg 1
-#define GlintAreaStipplePattern23Off 0x72b8
-#define GlintAreaStipplePattern23Sec 0x82b8
-#define GlintAreaStipplePattern23SecReg 3
-#define GlintAreaStipplePattern23SecOff 0x72b8
-
-#define GlintAreaStipplePattern24 0x82c0
-#define GlintAreaStipplePattern24Tag 0x0058
-#define GlintAreaStipplePattern24Reg 1
-#define GlintAreaStipplePattern24Off 0x72c0
-#define GlintAreaStipplePattern24Sec 0x82c0
-#define GlintAreaStipplePattern24SecReg 3
-#define GlintAreaStipplePattern24SecOff 0x72c0
-
-#define GlintAreaStipplePattern25 0x82c8
-#define GlintAreaStipplePattern25Tag 0x0059
-#define GlintAreaStipplePattern25Reg 1
-#define GlintAreaStipplePattern25Off 0x72c8
-#define GlintAreaStipplePattern25Sec 0x82c8
-#define GlintAreaStipplePattern25SecReg 3
-#define GlintAreaStipplePattern25SecOff 0x72c8
-
-#define GlintAreaStipplePattern26 0x82d0
-#define GlintAreaStipplePattern26Tag 0x005a
-#define GlintAreaStipplePattern26Reg 1
-#define GlintAreaStipplePattern26Off 0x72d0
-#define GlintAreaStipplePattern26Sec 0x82d0
-#define GlintAreaStipplePattern26SecReg 3
-#define GlintAreaStipplePattern26SecOff 0x72d0
-
-#define GlintAreaStipplePattern27 0x82d8
-#define GlintAreaStipplePattern27Tag 0x005b
-#define GlintAreaStipplePattern27Reg 1
-#define GlintAreaStipplePattern27Off 0x72d8
-#define GlintAreaStipplePattern27Sec 0x82d8
-#define GlintAreaStipplePattern27SecReg 3
-#define GlintAreaStipplePattern27SecOff 0x72d8
-
-#define GlintAreaStipplePattern28 0x82e0
-#define GlintAreaStipplePattern28Tag 0x005c
-#define GlintAreaStipplePattern28Reg 1
-#define GlintAreaStipplePattern28Off 0x72e0
-#define GlintAreaStipplePattern28Sec 0x82e0
-#define GlintAreaStipplePattern28SecReg 3
-#define GlintAreaStipplePattern28SecOff 0x72e0
-
-#define GlintAreaStipplePattern29 0x82e8
-#define GlintAreaStipplePattern29Tag 0x005d
-#define GlintAreaStipplePattern29Reg 1
-#define GlintAreaStipplePattern29Off 0x72e8
-#define GlintAreaStipplePattern29Sec 0x82e8
-#define GlintAreaStipplePattern29SecReg 3
-#define GlintAreaStipplePattern29SecOff 0x72e8
-
-#define GlintAreaStipplePattern30 0x82f0
-#define GlintAreaStipplePattern30Tag 0x005e
-#define GlintAreaStipplePattern30Reg 1
-#define GlintAreaStipplePattern30Off 0x72f0
-#define GlintAreaStipplePattern30Sec 0x82f0
-#define GlintAreaStipplePattern30SecReg 3
-#define GlintAreaStipplePattern30SecOff 0x72f0
-
-#define GlintAreaStipplePattern31 0x82f8
-#define GlintAreaStipplePattern31Tag 0x005f
-#define GlintAreaStipplePattern31Reg 1
-#define GlintAreaStipplePattern31Off 0x72f8
-#define GlintAreaStipplePattern31Sec 0x82f8
-#define GlintAreaStipplePattern31SecReg 3
-#define GlintAreaStipplePattern31SecOff 0x72f8
-
-#define GlintRouterMode 0x8840
-#define GlintRouterModeTag 0x0108
-#define GlintRouterModeReg 1
-#define GlintRouterModeOff 0x7840
-#define GlintRouterModeSec 0x8840
-#define GlintRouterModeSecReg 3
-#define GlintRouterModeSecOff 0x7840
-
-#define GlintTextureAddressMode 0x8380
-#define GlintTextureAddressModeTag 0x0070
-#define GlintTextureAddressModeReg 1
-#define GlintTextureAddressModeOff 0x7380
-#define GlintTextureAddressModeSec 0x8380
-#define GlintTextureAddressModeSecReg 3
-#define GlintTextureAddressModeSecOff 0x7380
-
-#define GlintSStart 0x8388
-#define GlintSStartTag 0x0071
-#define GlintSStartReg 1
-#define GlintSStartOff 0x7388
-#define GlintSStartSec 0x8388
-#define GlintSStartSecReg 3
-#define GlintSStartSecOff 0x7388
-
-#define GlintdSdx 0x8390
-#define GlintdSdxTag 0x0072
-#define GlintdSdxReg 1
-#define GlintdSdxOff 0x7390
-#define GlintdSdxSec 0x8390
-#define GlintdSdxSecReg 3
-#define GlintdSdxSecOff 0x7390
-
-#define GlintdSdyDom 0x8398
-#define GlintdSdyDomTag 0x0073
-#define GlintdSdyDomReg 1
-#define GlintdSdyDomOff 0x7398
-#define GlintdSdyDomSec 0x8398
-#define GlintdSdyDomSecReg 3
-#define GlintdSdyDomSecOff 0x7398
-
-#define GlintTStart 0x83a0
-#define GlintTStartTag 0x0074
-#define GlintTStartReg 1
-#define GlintTStartOff 0x73a0
-#define GlintTStartSec 0x83a0
-#define GlintTStartSecReg 3
-#define GlintTStartSecOff 0x73a0
-
-#define GlintdTdx 0x83a8
-#define GlintdTdxTag 0x0075
-#define GlintdTdxReg 1
-#define GlintdTdxOff 0x73a8
-#define GlintdTdxSec 0x83a8
-#define GlintdTdxSecReg 3
-#define GlintdTdxSecOff 0x73a8
-
-#define GlintdTdyDom 0x83b0
-#define GlintdTdyDomTag 0x0076
-#define GlintdTdyDomReg 1
-#define GlintdTdyDomOff 0x73b0
-#define GlintdTdyDomSec 0x83b0
-#define GlintdTdyDomSecReg 3
-#define GlintdTdyDomSecOff 0x73b0
-
-#define GlintQStart 0x83b8
-#define GlintQStartTag 0x0077
-#define GlintQStartReg 1
-#define GlintQStartOff 0x73b8
-#define GlintQStartSec 0x83b8
-#define GlintQStartSecReg 3
-#define GlintQStartSecOff 0x73b8
-
-#define GlintdQdx 0x83c0
-#define GlintdQdxTag 0x0078
-#define GlintdQdxReg 1
-#define GlintdQdxOff 0x73c0
-#define GlintdQdxSec 0x83c0
-#define GlintdQdxSecReg 3
-#define GlintdQdxSecOff 0x73c0
-
-#define GlintdQdyDom 0x83c8
-#define GlintdQdyDomTag 0x0079
-#define GlintdQdyDomReg 1
-#define GlintdQdyDomOff 0x73c8
-#define GlintdQdyDomSec 0x83c8
-#define GlintdQdyDomSecReg 3
-#define GlintdQdyDomSecOff 0x73c8
-
-#define GlintLOD 0x83d0
-#define GlintLODTag 0x007a
-#define GlintLODReg 1
-#define GlintLODOff 0x73d0
-#define GlintLODSec 0x83d0
-#define GlintLODSecReg 3
-#define GlintLODSecOff 0x73d0
-
-#define GlintdSdy 0x83d8
-#define GlintdSdyTag 0x007b
-#define GlintdSdyReg 1
-#define GlintdSdyOff 0x73d8
-#define GlintdSdySec 0x83d8
-#define GlintdSdySecReg 3
-#define GlintdSdySecOff 0x73d8
-
-#define GlintdTdy 0x83e0
-#define GlintdTdyTag 0x007c
-#define GlintdTdyReg 1
-#define GlintdTdyOff 0x73e0
-#define GlintdTdySec 0x83e0
-#define GlintdTdySecReg 3
-#define GlintdTdySecOff 0x73e0
-
-#define GlintdQdy 0x83e8
-#define GlintdQdyTag 0x007d
-#define GlintdQdyReg 1
-#define GlintdQdyOff 0x73e8
-#define GlintdQdySec 0x83e8
-#define GlintdQdySecReg 3
-#define GlintdQdySecOff 0x73e8
-
-#define GlintTextureReadMode 0x8480
-#define GlintTextureReadModeTag 0x0090
-#define GlintTextureReadModeReg 1
-#define GlintTextureReadModeOff 0x7480
-#define GlintTextureReadModeSec 0x8480
-#define GlintTextureReadModeSecReg 3
-#define GlintTextureReadModeSecOff 0x7480
-
-#define GlintTextureFormat 0x8488
-#define GlintTextureFormatTag 0x0091
-#define GlintTextureFormatReg 1
-#define GlintTextureFormatOff 0x7488
-#define GlintTextureFormatSec 0x8488
-#define GlintTextureFormatSecReg 3
-#define GlintTextureFormatSecOff 0x7488
-
-#define GlintTextureCacheControl 0x8490
-#define GlintTextureCacheControlTag 0x0092
-#define GlintTextureCacheControlReg 1
-#define GlintTextureCacheControlOff 0x7490
-#define GlintTextureCacheControlSec 0x8490
-#define GlintTextureCacheControlSecReg 3
-#define GlintTextureCacheControlSecOff 0x7490
-
-#define GlintGLINTBorderColor 0x84a8
-#define GlintGLINTBorderColorTag 0x0095
-#define GlintGLINTBorderColorReg 1
-#define GlintGLINTBorderColorOff 0x74a8
-#define GlintGLINTBorderColorSec 0x84a8
-#define GlintGLINTBorderColorSecReg 3
-#define GlintGLINTBorderColorSecOff 0x74a8
-
-#define GlintTexelLUTIndex 0x84c0
-#define GlintTexelLUTIndexTag 0x0098
-#define GlintTexelLUTIndexReg 1
-#define GlintTexelLUTIndexOff 0x74c0
-#define GlintTexelLUTIndexSec 0x84c0
-#define GlintTexelLUTIndexSecReg 3
-#define GlintTexelLUTIndexSecOff 0x74c0
-
-#define GlintTexelLUTData 0x84c8
-#define GlintTexelLUTDataTag 0x0099
-#define GlintTexelLUTDataReg 1
-#define GlintTexelLUTDataOff 0x74c8
-#define GlintTexelLUTDataSec 0x84c8
-#define GlintTexelLUTDataSecReg 3
-#define GlintTexelLUTDataSecOff 0x74c8
-
-#define GlintTexelLUTAddress 0x84d0
-#define GlintTexelLUTAddressTag 0x009a
-#define GlintTexelLUTAddressReg 1
-#define GlintTexelLUTAddressOff 0x74d0
-#define GlintTexelLUTAddressSec 0x84d0
-#define GlintTexelLUTAddressSecReg 3
-#define GlintTexelLUTAddressSecOff 0x74d0
-
-#define GlintTexelLUTTransfer 0x84d8
-#define GlintTexelLUTTransferTag 0x009b
-#define GlintTexelLUTTransferReg 1
-#define GlintTexelLUTTransferOff 0x74d8
-#define GlintTexelLUTTransferSec 0x84d8
-#define GlintTexelLUTTransferSecReg 3
-#define GlintTexelLUTTransferSecOff 0x74d8
-
-#define GlintTextureFilterMode 0x84e0
-#define GlintTextureFilterModeTag 0x009c
-#define GlintTextureFilterModeReg 1
-#define GlintTextureFilterModeOff 0x74e0
-#define GlintTextureFilterModeSec 0x84e0
-#define GlintTextureFilterModeSecReg 3
-#define GlintTextureFilterModeSecOff 0x74e0
-
-#define GlintTextureChromaUpper 0x84e8
-#define GlintTextureChromaUpperTag 0x009d
-#define GlintTextureChromaUpperReg 1
-#define GlintTextureChromaUpperOff 0x74e8
-#define GlintTextureChromaUpperSec 0x84e8
-#define GlintTextureChromaUpperSecReg 3
-#define GlintTextureChromaUpperSecOff 0x74e8
-
-#define GlintTextureChromaLower 0x84f0
-#define GlintTextureChromaLowerTag 0x009e
-#define GlintTextureChromaLowerReg 1
-#define GlintTextureChromaLowerOff 0x74f0
-#define GlintTextureChromaLowerSec 0x84f0
-#define GlintTextureChromaLowerSecReg 3
-#define GlintTextureChromaLowerSecOff 0x74f0
-
-#define GlintTxBaseAddr0 0x8500
-#define GlintTxBaseAddr0Tag 0x00a0
-#define GlintTxBaseAddr0Reg 1
-#define GlintTxBaseAddr0Off 0x7500
-#define GlintTxBaseAddr0Sec 0x8500
-#define GlintTxBaseAddr0SecReg 3
-#define GlintTxBaseAddr0SecOff 0x7500
-
-#define GlintTxBaseAddr1 0x8508
-#define GlintTxBaseAddr1Tag 0x00a1
-#define GlintTxBaseAddr1Reg 1
-#define GlintTxBaseAddr1Off 0x7508
-#define GlintTxBaseAddr1Sec 0x8508
-#define GlintTxBaseAddr1SecReg 3
-#define GlintTxBaseAddr1SecOff 0x7508
-
-#define GlintTxBaseAddr2 0x8510
-#define GlintTxBaseAddr2Tag 0x00a2
-#define GlintTxBaseAddr2Reg 1
-#define GlintTxBaseAddr2Off 0x7510
-#define GlintTxBaseAddr2Sec 0x8510
-#define GlintTxBaseAddr2SecReg 3
-#define GlintTxBaseAddr2SecOff 0x7510
-
-#define GlintTxBaseAddr3 0x8518
-#define GlintTxBaseAddr3Tag 0x00a3
-#define GlintTxBaseAddr3Reg 1
-#define GlintTxBaseAddr3Off 0x7518
-#define GlintTxBaseAddr3Sec 0x8518
-#define GlintTxBaseAddr3SecReg 3
-#define GlintTxBaseAddr3SecOff 0x7518
-
-#define GlintTxBaseAddr4 0x8520
-#define GlintTxBaseAddr4Tag 0x00a4
-#define GlintTxBaseAddr4Reg 1
-#define GlintTxBaseAddr4Off 0x7520
-#define GlintTxBaseAddr4Sec 0x8520
-#define GlintTxBaseAddr4SecReg 3
-#define GlintTxBaseAddr4SecOff 0x7520
-
-#define GlintTxBaseAddr5 0x8528
-#define GlintTxBaseAddr5Tag 0x00a5
-#define GlintTxBaseAddr5Reg 1
-#define GlintTxBaseAddr5Off 0x7528
-#define GlintTxBaseAddr5Sec 0x8528
-#define GlintTxBaseAddr5SecReg 3
-#define GlintTxBaseAddr5SecOff 0x7528
-
-#define GlintTxBaseAddr6 0x8530
-#define GlintTxBaseAddr6Tag 0x00a6
-#define GlintTxBaseAddr6Reg 1
-#define GlintTxBaseAddr6Off 0x7530
-#define GlintTxBaseAddr6Sec 0x8530
-#define GlintTxBaseAddr6SecReg 3
-#define GlintTxBaseAddr6SecOff 0x7530
-
-#define GlintTxBaseAddr7 0x8538
-#define GlintTxBaseAddr7Tag 0x00a7
-#define GlintTxBaseAddr7Reg 1
-#define GlintTxBaseAddr7Off 0x7538
-#define GlintTxBaseAddr7Sec 0x8538
-#define GlintTxBaseAddr7SecReg 3
-#define GlintTxBaseAddr7SecOff 0x7538
-
-#define GlintTxBaseAddr8 0x8540
-#define GlintTxBaseAddr8Tag 0x00a8
-#define GlintTxBaseAddr8Reg 1
-#define GlintTxBaseAddr8Off 0x7540
-#define GlintTxBaseAddr8Sec 0x8540
-#define GlintTxBaseAddr8SecReg 3
-#define GlintTxBaseAddr8SecOff 0x7540
-
-#define GlintTxBaseAddr9 0x8548
-#define GlintTxBaseAddr9Tag 0x00a9
-#define GlintTxBaseAddr9Reg 1
-#define GlintTxBaseAddr9Off 0x7548
-#define GlintTxBaseAddr9Sec 0x8548
-#define GlintTxBaseAddr9SecReg 3
-#define GlintTxBaseAddr9SecOff 0x7548
-
-#define GlintTxBaseAddr10 0x8550
-#define GlintTxBaseAddr10Tag 0x00aa
-#define GlintTxBaseAddr10Reg 1
-#define GlintTxBaseAddr10Off 0x7550
-#define GlintTxBaseAddr10Sec 0x8550
-#define GlintTxBaseAddr10SecReg 3
-#define GlintTxBaseAddr10SecOff 0x7550
-
-#define GlintTxBaseAddr11 0x8558
-#define GlintTxBaseAddr11Tag 0x00ab
-#define GlintTxBaseAddr11Reg 1
-#define GlintTxBaseAddr11Off 0x7558
-#define GlintTxBaseAddr11Sec 0x8558
-#define GlintTxBaseAddr11SecReg 3
-#define GlintTxBaseAddr11SecOff 0x7558
-
-#define GlintTxBaseAddr12 0x8560
-#define GlintTxBaseAddr12Tag 0x00ac
-#define GlintTxBaseAddr12Reg 1
-#define GlintTxBaseAddr12Off 0x7560
-#define GlintTxBaseAddr12Sec 0x8560
-#define GlintTxBaseAddr12SecReg 3
-#define GlintTxBaseAddr12SecOff 0x7560
-
-#define GlintTexelLUT0 0x8e80
-#define GlintTexelLUT0Tag 0x01d0
-#define GlintTexelLUT0Reg 1
-#define GlintTexelLUT0Off 0x7e80
-#define GlintTexelLUT0Sec 0x8e80
-#define GlintTexelLUT0SecReg 3
-#define GlintTexelLUT0SecOff 0x7e80
-
-#define GlintTexelLUT1 0x8e88
-#define GlintTexelLUT1Tag 0x01d1
-#define GlintTexelLUT1Reg 1
-#define GlintTexelLUT1Off 0x7e88
-#define GlintTexelLUT1Sec 0x8e88
-#define GlintTexelLUT1SecReg 3
-#define GlintTexelLUT1SecOff 0x7e88
-
-#define GlintTexelLUT2 0x8e90
-#define GlintTexelLUT2Tag 0x01d2
-#define GlintTexelLUT2Reg 1
-#define GlintTexelLUT2Off 0x7e90
-#define GlintTexelLUT2Sec 0x8e90
-#define GlintTexelLUT2SecReg 3
-#define GlintTexelLUT2SecOff 0x7e90
-
-#define GlintTexelLUT3 0x8e98
-#define GlintTexelLUT3Tag 0x01d3
-#define GlintTexelLUT3Reg 1
-#define GlintTexelLUT3Off 0x7e98
-#define GlintTexelLUT3Sec 0x8e98
-#define GlintTexelLUT3SecReg 3
-#define GlintTexelLUT3SecOff 0x7e98
-
-#define GlintTexelLUT4 0x8ea0
-#define GlintTexelLUT4Tag 0x01d4
-#define GlintTexelLUT4Reg 1
-#define GlintTexelLUT4Off 0x7ea0
-#define GlintTexelLUT4Sec 0x8ea0
-#define GlintTexelLUT4SecReg 3
-#define GlintTexelLUT4SecOff 0x7ea0
-
-#define GlintTexelLUT5 0x8ea8
-#define GlintTexelLUT5Tag 0x01d5
-#define GlintTexelLUT5Reg 1
-#define GlintTexelLUT5Off 0x7ea8
-#define GlintTexelLUT5Sec 0x8ea8
-#define GlintTexelLUT5SecReg 3
-#define GlintTexelLUT5SecOff 0x7ea8
-
-#define GlintTexelLUT6 0x8eb0
-#define GlintTexelLUT6Tag 0x01d6
-#define GlintTexelLUT6Reg 1
-#define GlintTexelLUT6Off 0x7eb0
-#define GlintTexelLUT6Sec 0x8eb0
-#define GlintTexelLUT6SecReg 3
-#define GlintTexelLUT6SecOff 0x7eb0
-
-#define GlintTexelLUT7 0x8eb8
-#define GlintTexelLUT7Tag 0x01d7
-#define GlintTexelLUT7Reg 1
-#define GlintTexelLUT7Off 0x7eb8
-#define GlintTexelLUT7Sec 0x8eb8
-#define GlintTexelLUT7SecReg 3
-#define GlintTexelLUT7SecOff 0x7eb8
-
-#define GlintTexelLUT8 0x8ec0
-#define GlintTexelLUT8Tag 0x01d8
-#define GlintTexelLUT8Reg 1
-#define GlintTexelLUT8Off 0x7ec0
-#define GlintTexelLUT8Sec 0x8ec0
-#define GlintTexelLUT8SecReg 3
-#define GlintTexelLUT8SecOff 0x7ec0
-
-#define GlintTexelLUT9 0x8ec8
-#define GlintTexelLUT9Tag 0x01d9
-#define GlintTexelLUT9Reg 1
-#define GlintTexelLUT9Off 0x7ec8
-#define GlintTexelLUT9Sec 0x8ec8
-#define GlintTexelLUT9SecReg 3
-#define GlintTexelLUT9SecOff 0x7ec8
-
-#define GlintTexelLUT10 0x8ed0
-#define GlintTexelLUT10Tag 0x01da
-#define GlintTexelLUT10Reg 1
-#define GlintTexelLUT10Off 0x7ed0
-#define GlintTexelLUT10Sec 0x8ed0
-#define GlintTexelLUT10SecReg 3
-#define GlintTexelLUT10SecOff 0x7ed0
-
-#define GlintTexelLUT11 0x8ed8
-#define GlintTexelLUT11Tag 0x01db
-#define GlintTexelLUT11Reg 1
-#define GlintTexelLUT11Off 0x7ed8
-#define GlintTexelLUT11Sec 0x8ed8
-#define GlintTexelLUT11SecReg 3
-#define GlintTexelLUT11SecOff 0x7ed8
-
-#define GlintTexelLUT12 0x8ee0
-#define GlintTexelLUT12Tag 0x01dc
-#define GlintTexelLUT12Reg 1
-#define GlintTexelLUT12Off 0x7ee0
-#define GlintTexelLUT12Sec 0x8ee0
-#define GlintTexelLUT12SecReg 3
-#define GlintTexelLUT12SecOff 0x7ee0
-
-#define GlintTexelLUT13 0x8ee8
-#define GlintTexelLUT13Tag 0x01dd
-#define GlintTexelLUT13Reg 1
-#define GlintTexelLUT13Off 0x7ee8
-#define GlintTexelLUT13Sec 0x8ee8
-#define GlintTexelLUT13SecReg 3
-#define GlintTexelLUT13SecOff 0x7ee8
-
-#define GlintTexelLUT14 0x8ef0
-#define GlintTexelLUT14Tag 0x01de
-#define GlintTexelLUT14Reg 1
-#define GlintTexelLUT14Off 0x7ef0
-#define GlintTexelLUT14Sec 0x8ef0
-#define GlintTexelLUT14SecReg 3
-#define GlintTexelLUT14SecOff 0x7ef0
-
-#define GlintTexelLUT15 0x8ef8
-#define GlintTexelLUT15Tag 0x01df
-#define GlintTexelLUT15Reg 1
-#define GlintTexelLUT15Off 0x7ef8
-#define GlintTexelLUT15Sec 0x8ef8
-#define GlintTexelLUT15SecReg 3
-#define GlintTexelLUT15SecOff 0x7ef8
-
-#define GlintTexel0 0x8600
-#define GlintTexel0Tag 0x00c0
-#define GlintTexel0Reg 1
-#define GlintTexel0Off 0x7600
-#define GlintTexel0Sec 0x8600
-#define GlintTexel0SecReg 3
-#define GlintTexel0SecOff 0x7600
-
-#define GlintTexel1 0x8608
-#define GlintTexel1Tag 0x00c1
-#define GlintTexel1Reg 1
-#define GlintTexel1Off 0x7608
-#define GlintTexel1Sec 0x8608
-#define GlintTexel1SecReg 3
-#define GlintTexel1SecOff 0x7608
-
-#define GlintTexel2 0x8610
-#define GlintTexel2Tag 0x00c2
-#define GlintTexel2Reg 1
-#define GlintTexel2Off 0x7610
-#define GlintTexel2Sec 0x8610
-#define GlintTexel2SecReg 3
-#define GlintTexel2SecOff 0x7610
-
-#define GlintTexel3 0x8618
-#define GlintTexel3Tag 0x00c3
-#define GlintTexel3Reg 1
-#define GlintTexel3Off 0x7618
-#define GlintTexel3Sec 0x8618
-#define GlintTexel3SecReg 3
-#define GlintTexel3SecOff 0x7618
-
-#define GlintTexel4 0x8620
-#define GlintTexel4Tag 0x00c4
-#define GlintTexel4Reg 1
-#define GlintTexel4Off 0x7620
-#define GlintTexel4Sec 0x8620
-#define GlintTexel4SecReg 3
-#define GlintTexel4SecOff 0x7620
-
-#define GlintTexel5 0x8628
-#define GlintTexel5Tag 0x00c5
-#define GlintTexel5Reg 1
-#define GlintTexel5Off 0x7628
-#define GlintTexel5Sec 0x8628
-#define GlintTexel5SecReg 3
-#define GlintTexel5SecOff 0x7628
-
-#define GlintTexel6 0x8630
-#define GlintTexel6Tag 0x00c6
-#define GlintTexel6Reg 1
-#define GlintTexel6Off 0x7630
-#define GlintTexel6Sec 0x8630
-#define GlintTexel6SecReg 3
-#define GlintTexel6SecOff 0x7630
-
-#define GlintTexel7 0x8638
-#define GlintTexel7Tag 0x00c7
-#define GlintTexel7Reg 1
-#define GlintTexel7Off 0x7638
-#define GlintTexel7Sec 0x8638
-#define GlintTexel7SecReg 3
-#define GlintTexel7SecOff 0x7638
-
-#define GlintInterp0 0x8640
-#define GlintInterp0Tag 0x00c8
-#define GlintInterp0Reg 1
-#define GlintInterp0Off 0x7640
-#define GlintInterp0Sec 0x8640
-#define GlintInterp0SecReg 3
-#define GlintInterp0SecOff 0x7640
-
-#define GlintInterp1 0x8648
-#define GlintInterp1Tag 0x00c9
-#define GlintInterp1Reg 1
-#define GlintInterp1Off 0x7648
-#define GlintInterp1Sec 0x8648
-#define GlintInterp1SecReg 3
-#define GlintInterp1SecOff 0x7648
-
-#define GlintInterp2 0x8650
-#define GlintInterp2Tag 0x00ca
-#define GlintInterp2Reg 1
-#define GlintInterp2Off 0x7650
-#define GlintInterp2Sec 0x8650
-#define GlintInterp2SecReg 3
-#define GlintInterp2SecOff 0x7650
-
-#define GlintInterp3 0x8658
-#define GlintInterp3Tag 0x00cb
-#define GlintInterp3Reg 1
-#define GlintInterp3Off 0x7658
-#define GlintInterp3Sec 0x8658
-#define GlintInterp3SecReg 3
-#define GlintInterp3SecOff 0x7658
-
-#define GlintInterp4 0x8660
-#define GlintInterp4Tag 0x00cc
-#define GlintInterp4Reg 1
-#define GlintInterp4Off 0x7660
-#define GlintInterp4Sec 0x8660
-#define GlintInterp4SecReg 3
-#define GlintInterp4SecOff 0x7660
-
-#define GlintTextureFilter 0x8668
-#define GlintTextureFilterTag 0x00cd
-#define GlintTextureFilterReg 1
-#define GlintTextureFilterOff 0x7668
-#define GlintTextureFilterSec 0x8668
-#define GlintTextureFilterSecReg 3
-#define GlintTextureFilterSecOff 0x7668
-
-#define GlintTextureColorMode 0x8680
-#define GlintTextureColorModeTag 0x00d0
-#define GlintTextureColorModeReg 1
-#define GlintTextureColorModeOff 0x7680
-#define GlintTextureColorModeSec 0x8680
-#define GlintTextureColorModeSecReg 3
-#define GlintTextureColorModeSecOff 0x7680
-
-#define GlintTextureEnvColor 0x8688
-#define GlintTextureEnvColorTag 0x00d1
-#define GlintTextureEnvColorReg 1
-#define GlintTextureEnvColorOff 0x7688
-#define GlintTextureEnvColorSec 0x8688
-#define GlintTextureEnvColorSecReg 3
-#define GlintTextureEnvColorSecOff 0x7688
-
-#define GlintFogMode 0x8690
-#define GlintFogModeTag 0x00d2
-#define GlintFogModeReg 1
-#define GlintFogModeOff 0x7690
-#define GlintFogModeSec 0x8690
-#define GlintFogModeSecReg 3
-#define GlintFogModeSecOff 0x7690
-
-#define GlintFogColor 0x8698
-#define GlintFogColorTag 0x00d3
-#define GlintFogColorReg 1
-#define GlintFogColorOff 0x7698
-#define GlintFogColorSec 0x8698
-#define GlintFogColorSecReg 3
-#define GlintFogColorSecOff 0x7698
-
-#define GlintFStart 0x86a0
-#define GlintFStartTag 0x00d4
-#define GlintFStartReg 1
-#define GlintFStartOff 0x76a0
-#define GlintFStartSec 0x86a0
-#define GlintFStartSecReg 3
-#define GlintFStartSecOff 0x76a0
-
-#define GlintdFdx 0x86a8
-#define GlintdFdxTag 0x00d5
-#define GlintdFdxReg 1
-#define GlintdFdxOff 0x76a8
-#define GlintdFdxSec 0x86a8
-#define GlintdFdxSecReg 3
-#define GlintdFdxSecOff 0x76a8
-
-#define GlintdFdyDom 0x86b0
-#define GlintdFdyDomTag 0x00d6
-#define GlintdFdyDomReg 1
-#define GlintdFdyDomOff 0x76b0
-#define GlintdFdyDomSec 0x86b0
-#define GlintdFdyDomSecReg 3
-#define GlintdFdyDomSecOff 0x76b0
-
-#define GlintKsStart 0x86c8
-#define GlintKsStartTag 0x00d9
-#define GlintKsStartReg 1
-#define GlintKsStartOff 0x76c8
-#define GlintKsStartSec 0x86c8
-#define GlintKsStartSecReg 3
-#define GlintKsStartSecOff 0x76c8
-
-#define GlintdKsdx 0x86d0
-#define GlintdKsdxTag 0x00da
-#define GlintdKsdxReg 1
-#define GlintdKsdxOff 0x76d0
-#define GlintdKsdxSec 0x86d0
-#define GlintdKsdxSecReg 3
-#define GlintdKsdxSecOff 0x76d0
-
-#define GlintdKsdyDom 0x86d8
-#define GlintdKsdyDomTag 0x00db
-#define GlintdKsdyDomReg 1
-#define GlintdKsdyDomOff 0x76d8
-#define GlintdKsdyDomSec 0x86d8
-#define GlintdKsdyDomSecReg 3
-#define GlintdKsdyDomSecOff 0x76d8
-
-#define GlintKdStart 0x86e0
-#define GlintKdStartTag 0x00dc
-#define GlintKdStartReg 1
-#define GlintKdStartOff 0x76e0
-#define GlintKdStartSec 0x86e0
-#define GlintKdStartSecReg 3
-#define GlintKdStartSecOff 0x76e0
-
-#define GlintdKdStart 0x86e8
-#define GlintdKdStartTag 0x00dd
-#define GlintdKdStartReg 1
-#define GlintdKdStartOff 0x76e8
-#define GlintdKdStartSec 0x86e8
-#define GlintdKdStartSecReg 3
-#define GlintdKdStartSecOff 0x76e8
-
-#define GlintdKddyDom 0x86f0
-#define GlintdKddyDomTag 0x00de
-#define GlintdKddyDomReg 1
-#define GlintdKddyDomOff 0x76f0
-#define GlintdKddyDomSec 0x86f0
-#define GlintdKddyDomSecReg 3
-#define GlintdKddyDomSecOff 0x76f0
-
-#define GlintRStart 0x8780
-#define GlintRStartTag 0x00f0
-#define GlintRStartReg 1
-#define GlintRStartOff 0x7780
-#define GlintRStartSec 0x8780
-#define GlintRStartSecReg 3
-#define GlintRStartSecOff 0x7780
-
-#define GlintdRdx 0x8788
-#define GlintdRdxTag 0x00f1
-#define GlintdRdxReg 1
-#define GlintdRdxOff 0x7788
-#define GlintdRdxSec 0x8788
-#define GlintdRdxSecReg 3
-#define GlintdRdxSecOff 0x7788
-
-#define GlintdRdyDom 0x8790
-#define GlintdRdyDomTag 0x00f2
-#define GlintdRdyDomReg 1
-#define GlintdRdyDomOff 0x7790
-#define GlintdRdyDomSec 0x8790
-#define GlintdRdyDomSecReg 3
-#define GlintdRdyDomSecOff 0x7790
-
-#define GlintGStart 0x8798
-#define GlintGStartTag 0x00f3
-#define GlintGStartReg 1
-#define GlintGStartOff 0x7798
-#define GlintGStartSec 0x8798
-#define GlintGStartSecReg 3
-#define GlintGStartSecOff 0x7798
-
-#define GlintdGdx 0x87a0
-#define GlintdGdxTag 0x00f4
-#define GlintdGdxReg 1
-#define GlintdGdxOff 0x77a0
-#define GlintdGdxSec 0x87a0
-#define GlintdGdxSecReg 3
-#define GlintdGdxSecOff 0x77a0
-
-#define GlintdGdyDom 0x87a8
-#define GlintdGdyDomTag 0x00f5
-#define GlintdGdyDomReg 1
-#define GlintdGdyDomOff 0x77a8
-#define GlintdGdyDomSec 0x87a8
-#define GlintdGdyDomSecReg 3
-#define GlintdGdyDomSecOff 0x77a8
-
-#define GlintBStart 0x87b0
-#define GlintBStartTag 0x00f6
-#define GlintBStartReg 1
-#define GlintBStartOff 0x77b0
-#define GlintBStartSec 0x87b0
-#define GlintBStartSecReg 3
-#define GlintBStartSecOff 0x77b0
-
-#define GlintdBdx 0x87b8
-#define GlintdBdxTag 0x00f7
-#define GlintdBdxReg 1
-#define GlintdBdxOff 0x77b8
-#define GlintdBdxSec 0x87b8
-#define GlintdBdxSecReg 3
-#define GlintdBdxSecOff 0x77b8
-
-#define GlintdBdyDom 0x87c0
-#define GlintdBdyDomTag 0x00f8
-#define GlintdBdyDomReg 1
-#define GlintdBdyDomOff 0x77c0
-#define GlintdBdyDomSec 0x87c0
-#define GlintdBdyDomSecReg 3
-#define GlintdBdyDomSecOff 0x77c0
-
-#define GlintAStart 0x87c8
-#define GlintAStartTag 0x00f9
-#define GlintAStartReg 1
-#define GlintAStartOff 0x77c8
-#define GlintAStartSec 0x87c8
-#define GlintAStartSecReg 3
-#define GlintAStartSecOff 0x77c8
-
-#define GlintdAdx 0x87d0
-#define GlintdAdxTag 0x00fa
-#define GlintdAdxReg 1
-#define GlintdAdxOff 0x77d0
-#define GlintdAdxSec 0x87d0
-#define GlintdAdxSecReg 3
-#define GlintdAdxSecOff 0x77d0
-
-#define GlintdAdyDom 0x87d8
-#define GlintdAdyDomTag 0x00fb
-#define GlintdAdyDomReg 1
-#define GlintdAdyDomOff 0x77d8
-#define GlintdAdyDomSec 0x87d8
-#define GlintdAdyDomSecReg 3
-#define GlintdAdyDomSecOff 0x77d8
-
-#define GlintColorDDAMode 0x87e0
-#define GlintColorDDAModeTag 0x00fc
-#define GlintColorDDAModeReg 1
-#define GlintColorDDAModeOff 0x77e0
-#define GlintColorDDAModeSec 0x87e0
-#define GlintColorDDAModeSecReg 3
-#define GlintColorDDAModeSecOff 0x77e0
-
-#define GlintConstantColor 0x87e8
-#define GlintConstantColorTag 0x00fd
-#define GlintConstantColorReg 1
-#define GlintConstantColorOff 0x77e8
-#define GlintConstantColorSec 0x87e8
-#define GlintConstantColorSecReg 3
-#define GlintConstantColorSecOff 0x77e8
-
-#define GlintGLINTColor 0x87f0
-#define GlintGLINTColorTag 0x00fe
-#define GlintGLINTColorReg 1
-#define GlintGLINTColorOff 0x77f0
-#define GlintGLINTColorSec 0x87f0
-#define GlintGLINTColorSecReg 3
-#define GlintGLINTColorSecOff 0x77f0
-
-#define GlintAlphaTestMode 0x8800
-#define GlintAlphaTestModeTag 0x0100
-#define GlintAlphaTestModeReg 1
-#define GlintAlphaTestModeOff 0x7800
-#define GlintAlphaTestModeSec 0x8800
-#define GlintAlphaTestModeSecReg 3
-#define GlintAlphaTestModeSecOff 0x7800
-
-#define GlintAntialiasMode 0x8808
-#define GlintAntialiasModeTag 0x0101
-#define GlintAntialiasModeReg 1
-#define GlintAntialiasModeOff 0x7808
-#define GlintAntialiasModeSec 0x8808
-#define GlintAntialiasModeSecReg 3
-#define GlintAntialiasModeSecOff 0x7808
-
-#define GlintAlphaBlendMode 0x8810
-#define GlintAlphaBlendModeTag 0x0102
-#define GlintAlphaBlendModeReg 1
-#define GlintAlphaBlendModeOff 0x7810
-#define GlintAlphaBlendModeSec 0x8810
-#define GlintAlphaBlendModeSecReg 3
-#define GlintAlphaBlendModeSecOff 0x7810
-
-#define GlintChromaUpper 0x8f08
-#define GlintChromaUpperTag 0x01e1
-#define GlintChromaUpperReg 1
-#define GlintChromaUpperOff 0x7f08
-#define GlintChromaUpperSec 0x8f08
-#define GlintChromaUpperSecReg 3
-#define GlintChromaUpperSecOff 0x7f08
-
-#define GlintChromaLower 0x8f10
-#define GlintChromaLowerTag 0x01e2
-#define GlintChromaLowerReg 1
-#define GlintChromaLowerOff 0x7f10
-#define GlintChromaLowerSec 0x8f10
-#define GlintChromaLowerSecReg 3
-#define GlintChromaLowerSecOff 0x7f10
-
-#define GlintChromaTestMode 0x8f18
-#define GlintChromaTestModeTag 0x01e3
-#define GlintChromaTestModeReg 1
-#define GlintChromaTestModeOff 0x7f18
-#define GlintChromaTestModeSec 0x8f18
-#define GlintChromaTestModeSecReg 3
-#define GlintChromaTestModeSecOff 0x7f18
-
-#define GlintDitherMode 0x8818
-#define GlintDitherModeTag 0x0103
-#define GlintDitherModeReg 1
-#define GlintDitherModeOff 0x7818
-#define GlintDitherModeSec 0x8818
-#define GlintDitherModeSecReg 3
-#define GlintDitherModeSecOff 0x7818
-
-#define GlintFBSoftwareWriteMask 0x8820
-#define GlintFBSoftwareWriteMaskTag 0x0104
-#define GlintFBSoftwareWriteMaskReg 1
-#define GlintFBSoftwareWriteMaskOff 0x7820
-#define GlintFBSoftwareWriteMaskSec 0x8820
-#define GlintFBSoftwareWriteMaskSecReg 3
-#define GlintFBSoftwareWriteMaskSecOff 0x7820
-
-#define GlintLogicalOpMode 0x8828
-#define GlintLogicalOpModeTag 0x0105
-#define GlintLogicalOpModeReg 1
-#define GlintLogicalOpModeOff 0x7828
-#define GlintLogicalOpModeSec 0x8828
-#define GlintLogicalOpModeSecReg 3
-#define GlintLogicalOpModeSecOff 0x7828
-
-#define GlintFBWriteData 0x8830
-#define GlintFBWriteDataTag 0x0106
-#define GlintFBWriteDataReg 1
-#define GlintFBWriteDataOff 0x7830
-#define GlintFBWriteDataSec 0x8830
-#define GlintFBWriteDataSecReg 3
-#define GlintFBWriteDataSecOff 0x7830
-
-#define GlintLBReadMode 0x8880
-#define GlintLBReadModeTag 0x0110
-#define GlintLBReadModeReg 1
-#define GlintLBReadModeOff 0x7880
-#define GlintLBReadModeSec 0x8880
-#define GlintLBReadModeSecReg 3
-#define GlintLBReadModeSecOff 0x7880
-
-#define GlintLBReadFormat 0x8888
-#define GlintLBReadFormatTag 0x0111
-#define GlintLBReadFormatReg 1
-#define GlintLBReadFormatOff 0x7888
-#define GlintLBReadFormatSec 0x8888
-#define GlintLBReadFormatSecReg 3
-#define GlintLBReadFormatSecOff 0x7888
-
-#define GlintLBSourceOffset 0x8890
-#define GlintLBSourceOffsetTag 0x0112
-#define GlintLBSourceOffsetReg 1
-#define GlintLBSourceOffsetOff 0x7890
-#define GlintLBSourceOffsetSec 0x8890
-#define GlintLBSourceOffsetSecReg 3
-#define GlintLBSourceOffsetSecOff 0x7890
-
-#define GlintLBStencil 0x88a8
-#define GlintLBStencilTag 0x0115
-#define GlintLBStencilReg 1
-#define GlintLBStencilOff 0x78a8
-#define GlintLBStencilSec 0x88a8
-#define GlintLBStencilSecReg 3
-#define GlintLBStencilSecOff 0x78a8
-
-#define GlintLBDepth 0x88b0
-#define GlintLBDepthTag 0x0116
-#define GlintLBDepthReg 1
-#define GlintLBDepthOff 0x78b0
-#define GlintLBDepthSec 0x88b0
-#define GlintLBDepthSecReg 3
-#define GlintLBDepthSecOff 0x78b0
-
-#define GlintLBWindowBase 0x88b8
-#define GlintLBWindowBaseTag 0x0117
-#define GlintLBWindowBaseReg 1
-#define GlintLBWindowBaseOff 0x78b8
-#define GlintLBWindowBaseSec 0x88b8
-#define GlintLBWindowBaseSecReg 3
-#define GlintLBWindowBaseSecOff 0x78b8
-
-#define GlintLBWriteMode 0x88c0
-#define GlintLBWriteModeTag 0x0118
-#define GlintLBWriteModeReg 1
-#define GlintLBWriteModeOff 0x78c0
-#define GlintLBWriteModeSec 0x88c0
-#define GlintLBWriteModeSecReg 3
-#define GlintLBWriteModeSecOff 0x78c0
-
-#define GlintLBWriteFormat 0x88c8
-#define GlintLBWriteFormatTag 0x0119
-#define GlintLBWriteFormatReg 1
-#define GlintLBWriteFormatOff 0x78c8
-#define GlintLBWriteFormatSec 0x88c8
-#define GlintLBWriteFormatSecReg 3
-#define GlintLBWriteFormatSecOff 0x78c8
-
-#define GlintTextureData 0x88e8
-#define GlintTextureDataTag 0x011d
-#define GlintTextureDataReg 1
-#define GlintTextureDataOff 0x78e8
-#define GlintTextureDataSec 0x88e8
-#define GlintTextureDataSecReg 3
-#define GlintTextureDataSecOff 0x78e8
-
-#define GlintTextureDownloadOffset 0x88f0
-#define GlintTextureDownloadOffsetTag 0x011e
-#define GlintTextureDownloadOffsetReg 1
-#define GlintTextureDownloadOffsetOff 0x78f0
-#define GlintTextureDownloadOffsetSec 0x88f0
-#define GlintTextureDownloadOffsetSecReg 3
-#define GlintTextureDownloadOffsetSecOff 0x78f0
-
-#define GlintLBWindowOffset 0x88f8
-#define GlintLBWindowOffsetTag 0x011f
-#define GlintLBWindowOffsetReg 1
-#define GlintLBWindowOffsetOff 0x78f8
-#define GlintLBWindowOffsetSec 0x88f8
-#define GlintLBWindowOffsetSecReg 3
-#define GlintLBWindowOffsetSecOff 0x78f8
-
-#define GlintGLINTWindow 0x8980
-#define GlintGLINTWindowTag 0x0130
-#define GlintGLINTWindowReg 1
-#define GlintGLINTWindowOff 0x7980
-#define GlintGLINTWindowSec 0x8980
-#define GlintGLINTWindowSecReg 3
-#define GlintGLINTWindowSecOff 0x7980
-
-#define GlintStencilMode 0x8988
-#define GlintStencilModeTag 0x0131
-#define GlintStencilModeReg 1
-#define GlintStencilModeOff 0x7988
-#define GlintStencilModeSec 0x8988
-#define GlintStencilModeSecReg 3
-#define GlintStencilModeSecOff 0x7988
-
-#define GlintStencilData 0x8990
-#define GlintStencilDataTag 0x0132
-#define GlintStencilDataReg 1
-#define GlintStencilDataOff 0x7990
-#define GlintStencilDataSec 0x8990
-#define GlintStencilDataSecReg 3
-#define GlintStencilDataSecOff 0x7990
-
-#define GlintGLINTStencil 0x8998
-#define GlintGLINTStencilTag 0x0133
-#define GlintGLINTStencilReg 1
-#define GlintGLINTStencilOff 0x7998
-#define GlintGLINTStencilSec 0x8998
-#define GlintGLINTStencilSecReg 3
-#define GlintGLINTStencilSecOff 0x7998
-
-#define GlintDepthMode 0x89a0
-#define GlintDepthModeTag 0x0134
-#define GlintDepthModeReg 1
-#define GlintDepthModeOff 0x79a0
-#define GlintDepthModeSec 0x89a0
-#define GlintDepthModeSecReg 3
-#define GlintDepthModeSecOff 0x79a0
-
-#define GlintGLINTDepth 0x89a8
-#define GlintGLINTDepthTag 0x0135
-#define GlintGLINTDepthReg 1
-#define GlintGLINTDepthOff 0x79a8
-#define GlintGLINTDepthSec 0x89a8
-#define GlintGLINTDepthSecReg 3
-#define GlintGLINTDepthSecOff 0x79a8
-
-#define GlintZStartU 0x89b0
-#define GlintZStartUTag 0x0136
-#define GlintZStartUReg 1
-#define GlintZStartUOff 0x79b0
-#define GlintZStartUSec 0x89b0
-#define GlintZStartUSecReg 3
-#define GlintZStartUSecOff 0x79b0
-
-#define GlintZStartL 0x89b8
-#define GlintZStartLTag 0x0137
-#define GlintZStartLReg 1
-#define GlintZStartLOff 0x79b8
-#define GlintZStartLSec 0x89b8
-#define GlintZStartLSecReg 3
-#define GlintZStartLSecOff 0x79b8
-
-#define GlintdZdxU 0x89c0
-#define GlintdZdxUTag 0x0138
-#define GlintdZdxUReg 1
-#define GlintdZdxUOff 0x79c0
-#define GlintdZdxUSec 0x89c0
-#define GlintdZdxUSecReg 3
-#define GlintdZdxUSecOff 0x79c0
-
-#define GlintdZdxL 0x89c8
-#define GlintdZdxLTag 0x0139
-#define GlintdZdxLReg 1
-#define GlintdZdxLOff 0x79c8
-#define GlintdZdxLSec 0x89c8
-#define GlintdZdxLSecReg 3
-#define GlintdZdxLSecOff 0x79c8
-
-#define GlintdZdyDomU 0x89d0
-#define GlintdZdyDomUTag 0x013a
-#define GlintdZdyDomUReg 1
-#define GlintdZdyDomUOff 0x79d0
-#define GlintdZdyDomUSec 0x89d0
-#define GlintdZdyDomUSecReg 3
-#define GlintdZdyDomUSecOff 0x79d0
-
-#define GlintdZdyDomL 0x89d8
-#define GlintdZdyDomLTag 0x013b
-#define GlintdZdyDomLReg 1
-#define GlintdZdyDomLOff 0x79d8
-#define GlintdZdyDomLSec 0x89d8
-#define GlintdZdyDomLSecReg 3
-#define GlintdZdyDomLSecOff 0x79d8
-
-#define GlintFastClearDepth 0x89e0
-#define GlintFastClearDepthTag 0x013c
-#define GlintFastClearDepthReg 1
-#define GlintFastClearDepthOff 0x79e0
-#define GlintFastClearDepthSec 0x89e0
-#define GlintFastClearDepthSecReg 3
-#define GlintFastClearDepthSecOff 0x79e0
-
-#define GlintFBReadMode 0x8a80
-#define GlintFBReadModeTag 0x0150
-#define GlintFBReadModeReg 1
-#define GlintFBReadModeOff 0x7a80
-#define GlintFBReadModeSec 0x8a80
-#define GlintFBReadModeSecReg 3
-#define GlintFBReadModeSecOff 0x7a80
-
-#define GlintFBSourceOffset 0x8a88
-#define GlintFBSourceOffsetTag 0x0151
-#define GlintFBSourceOffsetReg 1
-#define GlintFBSourceOffsetOff 0x7a88
-#define GlintFBSourceOffsetSec 0x8a88
-#define GlintFBSourceOffsetSecReg 3
-#define GlintFBSourceOffsetSecOff 0x7a88
-
-#define GlintFBPixelOffset 0x8a90
-#define GlintFBPixelOffsetTag 0x0152
-#define GlintFBPixelOffsetReg 1
-#define GlintFBPixelOffsetOff 0x7a90
-#define GlintFBPixelOffsetSec 0x8a90
-#define GlintFBPixelOffsetSecReg 3
-#define GlintFBPixelOffsetSecOff 0x7a90
-
-#define GlintFBColor 0x8a98
-#define GlintFBColorTag 0x0153
-#define GlintFBColorReg 1
-#define GlintFBColorOff 0x7a98
-#define GlintFBColorSec 0x8a98
-#define GlintFBColorSecReg 3
-#define GlintFBColorSecOff 0x7a98
-
-#define GlintFBData 0x8aa0
-#define GlintFBDataTag 0x0154
-#define GlintFBDataReg 1
-#define GlintFBDataOff 0x7aa0
-#define GlintFBDataSec 0x8aa0
-#define GlintFBDataSecReg 3
-#define GlintFBDataSecOff 0x7aa0
-
-#define GlintFBSourceData 0x8aa8
-#define GlintFBSourceDataTag 0x0155
-#define GlintFBSourceDataReg 1
-#define GlintFBSourceDataOff 0x7aa8
-#define GlintFBSourceDataSec 0x8aa8
-#define GlintFBSourceDataSecReg 3
-#define GlintFBSourceDataSecOff 0x7aa8
-
-#define GlintFBWindowBase 0x8ab0
-#define GlintFBWindowBaseTag 0x0156
-#define GlintFBWindowBaseReg 1
-#define GlintFBWindowBaseOff 0x7ab0
-#define GlintFBWindowBaseSec 0x8ab0
-#define GlintFBWindowBaseSecReg 3
-#define GlintFBWindowBaseSecOff 0x7ab0
-
-#define GlintFBWriteMode 0x8ab8
-#define GlintFBWriteModeTag 0x0157
-#define GlintFBWriteModeReg 1
-#define GlintFBWriteModeOff 0x7ab8
-#define GlintFBWriteModeSec 0x8ab8
-#define GlintFBWriteModeSecReg 3
-#define GlintFBWriteModeSecOff 0x7ab8
-
-#define GlintFBHardwareWriteMask 0x8ac0
-#define GlintFBHardwareWriteMaskTag 0x0158
-#define GlintFBHardwareWriteMaskReg 1
-#define GlintFBHardwareWriteMaskOff 0x7ac0
-#define GlintFBHardwareWriteMaskSec 0x8ac0
-#define GlintFBHardwareWriteMaskSecReg 3
-#define GlintFBHardwareWriteMaskSecOff 0x7ac0
-
-#define GlintFBBlockColor 0x8ac8
-#define GlintFBBlockColorTag 0x0159
-#define GlintFBBlockColorReg 1
-#define GlintFBBlockColorOff 0x7ac8
-#define GlintFBBlockColorSec 0x8ac8
-#define GlintFBBlockColorSecReg 3
-#define GlintFBBlockColorSecOff 0x7ac8
-
-#define GlintPatternRamMode 0x8af8
-#define GlintPatternRamModeTag 0x015f
-#define GlintPatternRamModeReg 1
-#define GlintPatternRamModeOff 0x7af8
-#define GlintPatternRamModeSec 0x8af8
-#define GlintPatternRamModeSecReg 3
-#define GlintPatternRamModeSecOff 0x7af8
-
-#define GlintPatternRamData0 0x8b00
-#define GlintPatternRamData0Tag 0x0160
-#define GlintPatternRamData0Reg 1
-#define GlintPatternRamData0Off 0x7b00
-#define GlintPatternRamData0Sec 0x8b00
-#define GlintPatternRamData0SecReg 3
-#define GlintPatternRamData0SecOff 0x7b00
-
-#define GlintPatternRamData1 0x8b08
-#define GlintPatternRamData1Tag 0x0161
-#define GlintPatternRamData1Reg 1
-#define GlintPatternRamData1Off 0x7b08
-#define GlintPatternRamData1Sec 0x8b08
-#define GlintPatternRamData1SecReg 3
-#define GlintPatternRamData1SecOff 0x7b08
-
-#define GlintPatternRamData2 0x8b10
-#define GlintPatternRamData2Tag 0x0162
-#define GlintPatternRamData2Reg 1
-#define GlintPatternRamData2Off 0x7b10
-#define GlintPatternRamData2Sec 0x8b10
-#define GlintPatternRamData2SecReg 3
-#define GlintPatternRamData2SecOff 0x7b10
-
-#define GlintPatternRamData3 0x8b18
-#define GlintPatternRamData3Tag 0x0163
-#define GlintPatternRamData3Reg 1
-#define GlintPatternRamData3Off 0x7b18
-#define GlintPatternRamData3Sec 0x8b18
-#define GlintPatternRamData3SecReg 3
-#define GlintPatternRamData3SecOff 0x7b18
-
-#define GlintPatternRamData4 0x8b20
-#define GlintPatternRamData4Tag 0x0164
-#define GlintPatternRamData4Reg 1
-#define GlintPatternRamData4Off 0x7b20
-#define GlintPatternRamData4Sec 0x8b20
-#define GlintPatternRamData4SecReg 3
-#define GlintPatternRamData4SecOff 0x7b20
-
-#define GlintPatternRamData5 0x8b28
-#define GlintPatternRamData5Tag 0x0165
-#define GlintPatternRamData5Reg 1
-#define GlintPatternRamData5Off 0x7b28
-#define GlintPatternRamData5Sec 0x8b28
-#define GlintPatternRamData5SecReg 3
-#define GlintPatternRamData5SecOff 0x7b28
-
-#define GlintPatternRamData6 0x8b30
-#define GlintPatternRamData6Tag 0x0166
-#define GlintPatternRamData6Reg 1
-#define GlintPatternRamData6Off 0x7b30
-#define GlintPatternRamData6Sec 0x8b30
-#define GlintPatternRamData6SecReg 3
-#define GlintPatternRamData6SecOff 0x7b30
-
-#define GlintPatternRamData7 0x8b38
-#define GlintPatternRamData7Tag 0x0167
-#define GlintPatternRamData7Reg 1
-#define GlintPatternRamData7Off 0x7b38
-#define GlintPatternRamData7Sec 0x8b38
-#define GlintPatternRamData7SecReg 3
-#define GlintPatternRamData7SecOff 0x7b38
-
-#define GlintPatternRamData8 0x8b40
-#define GlintPatternRamData8Tag 0x0168
-#define GlintPatternRamData8Reg 1
-#define GlintPatternRamData8Off 0x7b40
-#define GlintPatternRamData8Sec 0x8b40
-#define GlintPatternRamData8SecReg 3
-#define GlintPatternRamData8SecOff 0x7b40
-
-#define GlintPatternRamData9 0x8b48
-#define GlintPatternRamData9Tag 0x0169
-#define GlintPatternRamData9Reg 1
-#define GlintPatternRamData9Off 0x7b48
-#define GlintPatternRamData9Sec 0x8b48
-#define GlintPatternRamData9SecReg 3
-#define GlintPatternRamData9SecOff 0x7b48
-
-#define GlintPatternRamData10 0x8b50
-#define GlintPatternRamData10Tag 0x016a
-#define GlintPatternRamData10Reg 1
-#define GlintPatternRamData10Off 0x7b50
-#define GlintPatternRamData10Sec 0x8b50
-#define GlintPatternRamData10SecReg 3
-#define GlintPatternRamData10SecOff 0x7b50
-
-#define GlintPatternRamData11 0x8b58
-#define GlintPatternRamData11Tag 0x016b
-#define GlintPatternRamData11Reg 1
-#define GlintPatternRamData11Off 0x7b58
-#define GlintPatternRamData11Sec 0x8b58
-#define GlintPatternRamData11SecReg 3
-#define GlintPatternRamData11SecOff 0x7b58
-
-#define GlintPatternRamData12 0x8b60
-#define GlintPatternRamData12Tag 0x016c
-#define GlintPatternRamData12Reg 1
-#define GlintPatternRamData12Off 0x7b60
-#define GlintPatternRamData12Sec 0x8b60
-#define GlintPatternRamData12SecReg 3
-#define GlintPatternRamData12SecOff 0x7b60
-
-#define GlintPatternRamData13 0x8b68
-#define GlintPatternRamData13Tag 0x016d
-#define GlintPatternRamData13Reg 1
-#define GlintPatternRamData13Off 0x7b68
-#define GlintPatternRamData13Sec 0x8b68
-#define GlintPatternRamData13SecReg 3
-#define GlintPatternRamData13SecOff 0x7b68
-
-#define GlintPatternRamData14 0x8b70
-#define GlintPatternRamData14Tag 0x016e
-#define GlintPatternRamData14Reg 1
-#define GlintPatternRamData14Off 0x7b70
-#define GlintPatternRamData14Sec 0x8b70
-#define GlintPatternRamData14SecReg 3
-#define GlintPatternRamData14SecOff 0x7b70
-
-#define GlintPatternRamData15 0x8b78
-#define GlintPatternRamData15Tag 0x016f
-#define GlintPatternRamData15Reg 1
-#define GlintPatternRamData15Off 0x7b78
-#define GlintPatternRamData15Sec 0x8b78
-#define GlintPatternRamData15SecReg 3
-#define GlintPatternRamData15SecOff 0x7b78
-
-#define GlintPatternRamData16 0x8b80
-#define GlintPatternRamData16Tag 0x0170
-#define GlintPatternRamData16Reg 1
-#define GlintPatternRamData16Off 0x7b80
-#define GlintPatternRamData16Sec 0x8b80
-#define GlintPatternRamData16SecReg 3
-#define GlintPatternRamData16SecOff 0x7b80
-
-#define GlintPatternRamData17 0x8b88
-#define GlintPatternRamData17Tag 0x0171
-#define GlintPatternRamData17Reg 1
-#define GlintPatternRamData17Off 0x7b88
-#define GlintPatternRamData17Sec 0x8b88
-#define GlintPatternRamData17SecReg 3
-#define GlintPatternRamData17SecOff 0x7b88
-
-#define GlintPatternRamData18 0x8b90
-#define GlintPatternRamData18Tag 0x0172
-#define GlintPatternRamData18Reg 1
-#define GlintPatternRamData18Off 0x7b90
-#define GlintPatternRamData18Sec 0x8b90
-#define GlintPatternRamData18SecReg 3
-#define GlintPatternRamData18SecOff 0x7b90
-
-#define GlintPatternRamData19 0x8b98
-#define GlintPatternRamData19Tag 0x0173
-#define GlintPatternRamData19Reg 1
-#define GlintPatternRamData19Off 0x7b98
-#define GlintPatternRamData19Sec 0x8b98
-#define GlintPatternRamData19SecReg 3
-#define GlintPatternRamData19SecOff 0x7b98
-
-#define GlintPatternRamData20 0x8ba0
-#define GlintPatternRamData20Tag 0x0174
-#define GlintPatternRamData20Reg 1
-#define GlintPatternRamData20Off 0x7ba0
-#define GlintPatternRamData20Sec 0x8ba0
-#define GlintPatternRamData20SecReg 3
-#define GlintPatternRamData20SecOff 0x7ba0
-
-#define GlintPatternRamData21 0x8ba8
-#define GlintPatternRamData21Tag 0x0175
-#define GlintPatternRamData21Reg 1
-#define GlintPatternRamData21Off 0x7ba8
-#define GlintPatternRamData21Sec 0x8ba8
-#define GlintPatternRamData21SecReg 3
-#define GlintPatternRamData21SecOff 0x7ba8
-
-#define GlintPatternRamData22 0x8bb0
-#define GlintPatternRamData22Tag 0x0176
-#define GlintPatternRamData22Reg 1
-#define GlintPatternRamData22Off 0x7bb0
-#define GlintPatternRamData22Sec 0x8bb0
-#define GlintPatternRamData22SecReg 3
-#define GlintPatternRamData22SecOff 0x7bb0
-
-#define GlintPatternRamData23 0x8bb8
-#define GlintPatternRamData23Tag 0x0177
-#define GlintPatternRamData23Reg 1
-#define GlintPatternRamData23Off 0x7bb8
-#define GlintPatternRamData23Sec 0x8bb8
-#define GlintPatternRamData23SecReg 3
-#define GlintPatternRamData23SecOff 0x7bb8
-
-#define GlintPatternRamData24 0x8bc0
-#define GlintPatternRamData24Tag 0x0178
-#define GlintPatternRamData24Reg 1
-#define GlintPatternRamData24Off 0x7bc0
-#define GlintPatternRamData24Sec 0x8bc0
-#define GlintPatternRamData24SecReg 3
-#define GlintPatternRamData24SecOff 0x7bc0
-
-#define GlintPatternRamData25 0x8bc8
-#define GlintPatternRamData25Tag 0x0179
-#define GlintPatternRamData25Reg 1
-#define GlintPatternRamData25Off 0x7bc8
-#define GlintPatternRamData25Sec 0x8bc8
-#define GlintPatternRamData25SecReg 3
-#define GlintPatternRamData25SecOff 0x7bc8
-
-#define GlintPatternRamData26 0x8bd0
-#define GlintPatternRamData26Tag 0x017a
-#define GlintPatternRamData26Reg 1
-#define GlintPatternRamData26Off 0x7bd0
-#define GlintPatternRamData26Sec 0x8bd0
-#define GlintPatternRamData26SecReg 3
-#define GlintPatternRamData26SecOff 0x7bd0
-
-#define GlintPatternRamData27 0x8bd8
-#define GlintPatternRamData27Tag 0x017b
-#define GlintPatternRamData27Reg 1
-#define GlintPatternRamData27Off 0x7bd8
-#define GlintPatternRamData27Sec 0x8bd8
-#define GlintPatternRamData27SecReg 3
-#define GlintPatternRamData27SecOff 0x7bd8
-
-#define GlintPatternRamData28 0x8be0
-#define GlintPatternRamData28Tag 0x017c
-#define GlintPatternRamData28Reg 1
-#define GlintPatternRamData28Off 0x7be0
-#define GlintPatternRamData28Sec 0x8be0
-#define GlintPatternRamData28SecReg 3
-#define GlintPatternRamData28SecOff 0x7be0
-
-#define GlintPatternRamData29 0x8be8
-#define GlintPatternRamData29Tag 0x017d
-#define GlintPatternRamData29Reg 1
-#define GlintPatternRamData29Off 0x7be8
-#define GlintPatternRamData29Sec 0x8be8
-#define GlintPatternRamData29SecReg 3
-#define GlintPatternRamData29SecOff 0x7be8
-
-#define GlintPatternRamData30 0x8bf0
-#define GlintPatternRamData30Tag 0x017e
-#define GlintPatternRamData30Reg 1
-#define GlintPatternRamData30Off 0x7bf0
-#define GlintPatternRamData30Sec 0x8bf0
-#define GlintPatternRamData30SecReg 3
-#define GlintPatternRamData30SecOff 0x7bf0
-
-#define GlintPatternRamData31 0x8bf8
-#define GlintPatternRamData31Tag 0x017f
-#define GlintPatternRamData31Reg 1
-#define GlintPatternRamData31Off 0x7bf8
-#define GlintPatternRamData31Sec 0x8bf8
-#define GlintPatternRamData31SecReg 3
-#define GlintPatternRamData31SecOff 0x7bf8
-
-#define GlintFBBlockColorU 0x8c68
-#define GlintFBBlockColorUTag 0x018d
-#define GlintFBBlockColorUReg 1
-#define GlintFBBlockColorUOff 0x7c68
-#define GlintFBBlockColorUSec 0x8c68
-#define GlintFBBlockColorUSecReg 3
-#define GlintFBBlockColorUSecOff 0x7c68
-
-#define GlintFBBlockColorL 0x8c70
-#define GlintFBBlockColorLTag 0x018e
-#define GlintFBBlockColorLReg 1
-#define GlintFBBlockColorLOff 0x7c70
-#define GlintFBBlockColorLSec 0x8c70
-#define GlintFBBlockColorLSecReg 3
-#define GlintFBBlockColorLSecOff 0x7c70
-
-#define GlintSuspendUntilFrameBlank 0x8c78
-#define GlintSuspendUntilFrameBlankTag 0x018f
-#define GlintSuspendUntilFrameBlankReg 1
-#define GlintSuspendUntilFrameBlankOff 0x7c78
-#define GlintSuspendUntilFrameBlankSec 0x8c78
-#define GlintSuspendUntilFrameBlankSecReg 3
-#define GlintSuspendUntilFrameBlankSecOff 0x7c78
-
-#define GlintFilterMode 0x8c00
-#define GlintFilterModeTag 0x0180
-#define GlintFilterModeReg 1
-#define GlintFilterModeOff 0x7c00
-#define GlintFilterModeSec 0x8c00
-#define GlintFilterModeSecReg 3
-#define GlintFilterModeSecOff 0x7c00
-
-#define GlintStatisticMode 0x8c08
-#define GlintStatisticModeTag 0x0181
-#define GlintStatisticModeReg 1
-#define GlintStatisticModeOff 0x7c08
-#define GlintStatisticModeSec 0x8c08
-#define GlintStatisticModeSecReg 3
-#define GlintStatisticModeSecOff 0x7c08
-
-#define GlintMinRegion 0x8c10
-#define GlintMinRegionTag 0x0182
-#define GlintMinRegionReg 1
-#define GlintMinRegionOff 0x7c10
-#define GlintMinRegionSec 0x8c10
-#define GlintMinRegionSecReg 3
-#define GlintMinRegionSecOff 0x7c10
-
-#define GlintMaxRegion 0x8c18
-#define GlintMaxRegionTag 0x0183
-#define GlintMaxRegionReg 1
-#define GlintMaxRegionOff 0x7c18
-#define GlintMaxRegionSec 0x8c18
-#define GlintMaxRegionSecReg 3
-#define GlintMaxRegionSecOff 0x7c18
-
-#define GlintResetPickResult 0x8c20
-#define GlintResetPickResultTag 0x0184
-#define GlintResetPickResultReg 1
-#define GlintResetPickResultOff 0x7c20
-#define GlintResetPickResultSec 0x8c20
-#define GlintResetPickResultSecReg 3
-#define GlintResetPickResultSecOff 0x7c20
-
-#define GlintMitHitRegion 0x8c28
-#define GlintMitHitRegionTag 0x0185
-#define GlintMitHitRegionReg 1
-#define GlintMitHitRegionOff 0x7c28
-#define GlintMitHitRegionSec 0x8c28
-#define GlintMitHitRegionSecReg 3
-#define GlintMitHitRegionSecOff 0x7c28
-
-#define GlintMaxHitRegion 0x8c30
-#define GlintMaxHitRegionTag 0x0186
-#define GlintMaxHitRegionReg 1
-#define GlintMaxHitRegionOff 0x7c30
-#define GlintMaxHitRegionSec 0x8c30
-#define GlintMaxHitRegionSecReg 3
-#define GlintMaxHitRegionSecOff 0x7c30
-
-#define GlintPickResult 0x8c38
-#define GlintPickResultTag 0x0187
-#define GlintPickResultReg 1
-#define GlintPickResultOff 0x7c38
-#define GlintPickResultSec 0x8c38
-#define GlintPickResultSecReg 3
-#define GlintPickResultSecOff 0x7c38
-
-#define GlintGLINTSync 0x8c40
-#define GlintGLINTSyncTag 0x0188
-#define GlintGLINTSyncReg 1
-#define GlintGLINTSyncOff 0x7c40
-#define GlintGLINTSyncSec 0x8c40
-#define GlintGLINTSyncSecReg 3
-#define GlintGLINTSyncSecOff 0x7c40
-
-#define GlintKsRStart 0x8c80
-#define GlintKsRStartTag 0x0190
-#define GlintKsRStartReg 1
-#define GlintKsRStartOff 0x7c80
-#define GlintKsRStartSec 0x8c80
-#define GlintKsRStartSecReg 3
-#define GlintKsRStartSecOff 0x7c80
-
-#define GlintdKsRdx 0x8c88
-#define GlintdKsRdxTag 0x0191
-#define GlintdKsRdxReg 1
-#define GlintdKsRdxOff 0x7c88
-#define GlintdKsRdxSec 0x8c88
-#define GlintdKsRdxSecReg 3
-#define GlintdKsRdxSecOff 0x7c88
-
-#define GlintdKsRdyDom 0x8c90
-#define GlintdKsRdyDomTag 0x0192
-#define GlintdKsRdyDomReg 1
-#define GlintdKsRdyDomOff 0x7c90
-#define GlintdKsRdyDomSec 0x8c90
-#define GlintdKsRdyDomSecReg 3
-#define GlintdKsRdyDomSecOff 0x7c90
-
-#define GlintKsGStart 0x8c98
-#define GlintKsGStartTag 0x0193
-#define GlintKsGStartReg 1
-#define GlintKsGStartOff 0x7c98
-#define GlintKsGStartSec 0x8c98
-#define GlintKsGStartSecReg 3
-#define GlintKsGStartSecOff 0x7c98
-
-#define GlintdKsGdx 0x8ca0
-#define GlintdKsGdxTag 0x0194
-#define GlintdKsGdxReg 1
-#define GlintdKsGdxOff 0x7ca0
-#define GlintdKsGdxSec 0x8ca0
-#define GlintdKsGdxSecReg 3
-#define GlintdKsGdxSecOff 0x7ca0
-
-#define GlintdKsGdyDom 0x8ca8
-#define GlintdKsGdyDomTag 0x0195
-#define GlintdKsGdyDomReg 1
-#define GlintdKsGdyDomOff 0x7ca8
-#define GlintdKsGdyDomSec 0x8ca8
-#define GlintdKsGdyDomSecReg 3
-#define GlintdKsGdyDomSecOff 0x7ca8
-
-#define GlintKsBStart 0x8cb0
-#define GlintKsBStartTag 0x0196
-#define GlintKsBStartReg 1
-#define GlintKsBStartOff 0x7cb0
-#define GlintKsBStartSec 0x8cb0
-#define GlintKsBStartSecReg 3
-#define GlintKsBStartSecOff 0x7cb0
-
-#define GlintdKsBdx 0x8cb8
-#define GlintdKsBdxTag 0x0197
-#define GlintdKsBdxReg 1
-#define GlintdKsBdxOff 0x7cb8
-#define GlintdKsBdxSec 0x8cb8
-#define GlintdKsBdxSecReg 3
-#define GlintdKsBdxSecOff 0x7cb8
-
-#define GlintdKsBdyDom 0x8cc0
-#define GlintdKsBdyDomTag 0x0198
-#define GlintdKsBdyDomReg 1
-#define GlintdKsBdyDomOff 0x7cc0
-#define GlintdKsBdyDomSec 0x8cc0
-#define GlintdKsBdyDomSecReg 3
-#define GlintdKsBdyDomSecOff 0x7cc0
-
-#define GlintKdRStart 0x8d00
-#define GlintKdRStartTag 0x01a0
-#define GlintKdRStartReg 1
-#define GlintKdRStartOff 0x7d00
-#define GlintKdRStartSec 0x8d00
-#define GlintKdRStartSecReg 3
-#define GlintKdRStartSecOff 0x7d00
-
-#define GlintdKdRdx 0x8d08
-#define GlintdKdRdxTag 0x01a1
-#define GlintdKdRdxReg 1
-#define GlintdKdRdxOff 0x7d08
-#define GlintdKdRdxSec 0x8d08
-#define GlintdKdRdxSecReg 3
-#define GlintdKdRdxSecOff 0x7d08
-
-#define GlintdKdRdyDom 0x8d10
-#define GlintdKdRdyDomTag 0x01a2
-#define GlintdKdRdyDomReg 1
-#define GlintdKdRdyDomOff 0x7d10
-#define GlintdKdRdyDomSec 0x8d10
-#define GlintdKdRdyDomSecReg 3
-#define GlintdKdRdyDomSecOff 0x7d10
-
-#define GlintKdGStart 0x8d18
-#define GlintKdGStartTag 0x01a3
-#define GlintKdGStartReg 1
-#define GlintKdGStartOff 0x7d18
-#define GlintKdGStartSec 0x8d18
-#define GlintKdGStartSecReg 3
-#define GlintKdGStartSecOff 0x7d18
-
-#define GlintdKdGdx 0x8d20
-#define GlintdKdGdxTag 0x01a4
-#define GlintdKdGdxReg 1
-#define GlintdKdGdxOff 0x7d20
-#define GlintdKdGdxSec 0x8d20
-#define GlintdKdGdxSecReg 3
-#define GlintdKdGdxSecOff 0x7d20
-
-#define GlintdKdGdyDom 0x8d28
-#define GlintdKdGdyDomTag 0x01a5
-#define GlintdKdGdyDomReg 1
-#define GlintdKdGdyDomOff 0x7d28
-#define GlintdKdGdyDomSec 0x8d28
-#define GlintdKdGdyDomSecReg 3
-#define GlintdKdGdyDomSecOff 0x7d28
-
-#define GlintKdBStart 0x8d30
-#define GlintKdBStartTag 0x01a6
-#define GlintKdBStartReg 1
-#define GlintKdBStartOff 0x7d30
-#define GlintKdBStartSec 0x8d30
-#define GlintKdBStartSecReg 3
-#define GlintKdBStartSecOff 0x7d30
-
-#define GlintdKdBdx 0x8d38
-#define GlintdKdBdxTag 0x01a7
-#define GlintdKdBdxReg 1
-#define GlintdKdBdxOff 0x7d38
-#define GlintdKdBdxSec 0x8d38
-#define GlintdKdBdxSecReg 3
-#define GlintdKdBdxSecOff 0x7d38
-
-#define GlintdKdBdyDom 0x8d40
-#define GlintdKdBdyDomTag 0x01a8
-#define GlintdKdBdyDomReg 1
-#define GlintdKdBdyDomOff 0x7d40
-#define GlintdKdBdyDomSec 0x8d40
-#define GlintdKdBdyDomSecReg 3
-#define GlintdKdBdyDomSecOff 0x7d40
-
-#define GlintContextDump 0x8dc0
-#define GlintContextDumpTag 0x01b8
-#define GlintContextDumpReg 1
-#define GlintContextDumpOff 0x7dc0
-
-#define GlintContextRestore 0x8dc8
-#define GlintContextRestoreTag 0x01b9
-#define GlintContextRestoreReg 1
-#define GlintContextRestoreOff 0x7dc8
-
-#define GlintContextData 0x8dd0
-#define GlintContextDataTag 0x01ba
-#define GlintContextDataReg 1
-#define GlintContextDataOff 0x7dd0
-
-#define GlintFeedbackToken 0x8f80
-#define GlintFeedbackTokenTag 0x01f0
-#define GlintFeedbackTokenReg 1
-#define GlintFeedbackTokenOff 0x7f80
-
-#define GlintFeedbackX 0x8f88
-#define GlintFeedbackXTag 0x01f1
-#define GlintFeedbackXReg 1
-#define GlintFeedbackXOff 0x7f88
-
-#define GlintFeedbackY 0x8f90
-#define GlintFeedbackYTag 0x01f2
-#define GlintFeedbackYReg 1
-#define GlintFeedbackYOff 0x7f90
-
-#define GlintFeedbackZ 0x8f98
-#define GlintFeedbackZTag 0x01f3
-#define GlintFeedbackZReg 1
-#define GlintFeedbackZOff 0x7f98
-
-#define GlintFeedbackW 0x8fa0
-#define GlintFeedbackWTag 0x01f4
-#define GlintFeedbackWReg 1
-#define GlintFeedbackWOff 0x7fa0
-
-#define GlintFeedbackRed 0x8fa8
-#define GlintFeedbackRedTag 0x01f5
-#define GlintFeedbackRedReg 1
-#define GlintFeedbackRedOff 0x7fa8
-
-#define GlintFeedbackGreen 0x8fb0
-#define GlintFeedbackGreenTag 0x01f6
-#define GlintFeedbackGreenReg 1
-#define GlintFeedbackGreenOff 0x7fb0
-
-#define GlintFeedbackBlue 0x8fb8
-#define GlintFeedbackBlueTag 0x01f7
-#define GlintFeedbackBlueReg 1
-#define GlintFeedbackBlueOff 0x7fb8
-
-#define GlintFeedbackAlpha 0x8fc0
-#define GlintFeedbackAlphaTag 0x01f8
-#define GlintFeedbackAlphaReg 1
-#define GlintFeedbackAlphaOff 0x7fc0
-
-#define GlintFeedbackS 0x8fc8
-#define GlintFeedbackSTag 0x01f9
-#define GlintFeedbackSReg 1
-#define GlintFeedbackSOff 0x7fc8
-
-#define GlintFeedbackT 0x8fd0
-#define GlintFeedbackTTag 0x01fa
-#define GlintFeedbackTReg 1
-#define GlintFeedbackTOff 0x7fd0
-
-#define GlintFeedbackR 0x8fd8
-#define GlintFeedbackRTag 0x01fb
-#define GlintFeedbackRReg 1
-#define GlintFeedbackROff 0x7fd8
-
-#define GlintFeedbackQ 0x8fe0
-#define GlintFeedbackQTag 0x01fc
-#define GlintFeedbackQReg 1
-#define GlintFeedbackQOff 0x7fe0
-
-#define GlintSelectRecord 0x8fe8
-#define GlintSelectRecordTag 0x01fd
-#define GlintSelectRecordReg 1
-#define GlintSelectRecordOff 0x7fe8
-
-#define GlintPassThrough 0x8ff0
-#define GlintPassThroughTag 0x01fe
-#define GlintPassThroughReg 1
-#define GlintPassThroughOff 0x7ff0
-
-#define GlintEndOfFeedback 0x8ff8
-#define GlintEndOfFeedbackTag 0x01ff
-#define GlintEndOfFeedbackReg 1
-#define GlintEndOfFeedbackOff 0x7ff8
-
-#define GlintV0FixedS 0x9000
-#define GlintV0FixedSTag 0x0200
-#define GlintV0FixedSReg 1
-#define GlintV0FixedSOff 0x8000
-
-#define GlintV0FixedT 0x9008
-#define GlintV0FixedTTag 0x0201
-#define GlintV0FixedTReg 1
-#define GlintV0FixedTOff 0x8008
-
-#define GlintV0FixedQ 0x9010
-#define GlintV0FixedQTag 0x0202
-#define GlintV0FixedQReg 1
-#define GlintV0FixedQOff 0x8010
-
-#define GlintV0FixedKs 0x9018
-#define GlintV0FixedKsTag 0x0203
-#define GlintV0FixedKsReg 1
-#define GlintV0FixedKsOff 0x8018
-
-#define GlintV0FixedKd 0x9020
-#define GlintV0FixedKdTag 0x0204
-#define GlintV0FixedKdReg 1
-#define GlintV0FixedKdOff 0x8020
-
-#define GlintV0FixedR 0x9028
-#define GlintV0FixedRTag 0x0205
-#define GlintV0FixedRReg 1
-#define GlintV0FixedROff 0x8028
-
-#define GlintV0FixedG 0x9030
-#define GlintV0FixedGTag 0x0206
-#define GlintV0FixedGReg 1
-#define GlintV0FixedGOff 0x8030
-
-#define GlintV0FixedB 0x9038
-#define GlintV0FixedBTag 0x0207
-#define GlintV0FixedBReg 1
-#define GlintV0FixedBOff 0x8038
-
-#define GlintV0FixedA 0x9040
-#define GlintV0FixedATag 0x0208
-#define GlintV0FixedAReg 1
-#define GlintV0FixedAOff 0x8040
-
-#define GlintV0FixedF 0x9048
-#define GlintV0FixedFTag 0x0209
-#define GlintV0FixedFReg 1
-#define GlintV0FixedFOff 0x8048
-
-#define GlintV0FixedX 0x9050
-#define GlintV0FixedXTag 0x020a
-#define GlintV0FixedXReg 1
-#define GlintV0FixedXOff 0x8050
-
-#define GlintV0FixedY 0x9058
-#define GlintV0FixedYTag 0x020b
-#define GlintV0FixedYReg 1
-#define GlintV0FixedYOff 0x8058
-
-#define GlintV0FixedZ 0x9060
-#define GlintV0FixedZTag 0x020c
-#define GlintV0FixedZReg 1
-#define GlintV0FixedZOff 0x8060
-
-#define GlintV1FixedS 0x9080
-#define GlintV1FixedSTag 0x0210
-#define GlintV1FixedSReg 1
-#define GlintV1FixedSOff 0x8080
-
-#define GlintV1FixedT 0x9088
-#define GlintV1FixedTTag 0x0211
-#define GlintV1FixedTReg 1
-#define GlintV1FixedTOff 0x8088
-
-#define GlintV1FixedQ 0x9090
-#define GlintV1FixedQTag 0x0212
-#define GlintV1FixedQReg 1
-#define GlintV1FixedQOff 0x8090
-
-#define GlintV1FixedKs 0x9098
-#define GlintV1FixedKsTag 0x0213
-#define GlintV1FixedKsReg 1
-#define GlintV1FixedKsOff 0x8098
-
-#define GlintV1FixedKd 0x90a0
-#define GlintV1FixedKdTag 0x0214
-#define GlintV1FixedKdReg 1
-#define GlintV1FixedKdOff 0x80a0
-
-#define GlintV1FixedR 0x90a8
-#define GlintV1FixedRTag 0x0215
-#define GlintV1FixedRReg 1
-#define GlintV1FixedROff 0x80a8
-
-#define GlintV1FixedG 0x90b0
-#define GlintV1FixedGTag 0x0216
-#define GlintV1FixedGReg 1
-#define GlintV1FixedGOff 0x80b0
-
-#define GlintV1FixedB 0x90b8
-#define GlintV1FixedBTag 0x0217
-#define GlintV1FixedBReg 1
-#define GlintV1FixedBOff 0x80b8
-
-#define GlintV1FixedA 0x90c0
-#define GlintV1FixedATag 0x0218
-#define GlintV1FixedAReg 1
-#define GlintV1FixedAOff 0x80c0
-
-#define GlintV1FixedF 0x90c8
-#define GlintV1FixedFTag 0x0219
-#define GlintV1FixedFReg 1
-#define GlintV1FixedFOff 0x80c8
-
-#define GlintV1FixedX 0x90d0
-#define GlintV1FixedXTag 0x021a
-#define GlintV1FixedXReg 1
-#define GlintV1FixedXOff 0x80d0
-
-#define GlintV1FixedY 0x90d8
-#define GlintV1FixedYTag 0x021b
-#define GlintV1FixedYReg 1
-#define GlintV1FixedYOff 0x80d8
-
-#define GlintV1FixedZ 0x90e0
-#define GlintV1FixedZTag 0x021c
-#define GlintV1FixedZReg 1
-#define GlintV1FixedZOff 0x80e0
-
-#define GlintV2FixedS 0x9100
-#define GlintV2FixedSTag 0x0220
-#define GlintV2FixedSReg 1
-#define GlintV2FixedSOff 0x8100
-
-#define GlintV2FixedT 0x9108
-#define GlintV2FixedTTag 0x0221
-#define GlintV2FixedTReg 1
-#define GlintV2FixedTOff 0x8108
-
-#define GlintV2FixedQ 0x9110
-#define GlintV2FixedQTag 0x0222
-#define GlintV2FixedQReg 1
-#define GlintV2FixedQOff 0x8110
-
-#define GlintV2FixedKs 0x9118
-#define GlintV2FixedKsTag 0x0223
-#define GlintV2FixedKsReg 1
-#define GlintV2FixedKsOff 0x8118
-
-#define GlintV2FixedKd 0x9120
-#define GlintV2FixedKdTag 0x0224
-#define GlintV2FixedKdReg 1
-#define GlintV2FixedKdOff 0x8120
-
-#define GlintV2FixedR 0x9128
-#define GlintV2FixedRTag 0x0225
-#define GlintV2FixedRReg 1
-#define GlintV2FixedROff 0x8128
-
-#define GlintV2FixedG 0x9130
-#define GlintV2FixedGTag 0x0226
-#define GlintV2FixedGReg 1
-#define GlintV2FixedGOff 0x8130
-
-#define GlintV2FixedB 0x9138
-#define GlintV2FixedBTag 0x0227
-#define GlintV2FixedBReg 1
-#define GlintV2FixedBOff 0x8138
-
-#define GlintV2FixedA 0x9140
-#define GlintV2FixedATag 0x0228
-#define GlintV2FixedAReg 1
-#define GlintV2FixedAOff 0x8140
-
-#define GlintV2FixedF 0x9148
-#define GlintV2FixedFTag 0x0229
-#define GlintV2FixedFReg 1
-#define GlintV2FixedFOff 0x8148
-
-#define GlintV2FixedX 0x9150
-#define GlintV2FixedXTag 0x022a
-#define GlintV2FixedXReg 1
-#define GlintV2FixedXOff 0x8150
-
-#define GlintV2FixedY 0x9158
-#define GlintV2FixedYTag 0x022b
-#define GlintV2FixedYReg 1
-#define GlintV2FixedYOff 0x8158
-
-#define GlintV2FixedZ 0x9160
-#define GlintV2FixedZTag 0x022c
-#define GlintV2FixedZReg 1
-#define GlintV2FixedZOff 0x8160
-
-#define GlintV0FloatS 0x9180
-#define GlintV0FloatSTag 0x0230
-#define GlintV0FloatSReg 1
-#define GlintV0FloatSOff 0x8180
-
-#define GlintV0FloatT 0x9188
-#define GlintV0FloatTTag 0x0231
-#define GlintV0FloatTReg 1
-#define GlintV0FloatTOff 0x8188
-
-#define GlintV0FloatQ 0x9190
-#define GlintV0FloatQTag 0x0232
-#define GlintV0FloatQReg 1
-#define GlintV0FloatQOff 0x8190
-
-#define GlintV0FloatKs 0x9198
-#define GlintV0FloatKsTag 0x0233
-#define GlintV0FloatKsReg 1
-#define GlintV0FloatKsOff 0x8198
-
-#define GlintV0FloatKd 0x91a0
-#define GlintV0FloatKdTag 0x0234
-#define GlintV0FloatKdReg 1
-#define GlintV0FloatKdOff 0x81a0
-
-#define GlintV0FloatR 0x91a8
-#define GlintV0FloatRTag 0x0235
-#define GlintV0FloatRReg 1
-#define GlintV0FloatROff 0x81a8
-
-#define GlintV0FloatG 0x91b0
-#define GlintV0FloatGTag 0x0236
-#define GlintV0FloatGReg 1
-#define GlintV0FloatGOff 0x81b0
-
-#define GlintV0FloatB 0x91b8
-#define GlintV0FloatBTag 0x0237
-#define GlintV0FloatBReg 1
-#define GlintV0FloatBOff 0x81b8
-
-#define GlintV0FloatA 0x91c0
-#define GlintV0FloatATag 0x0238
-#define GlintV0FloatAReg 1
-#define GlintV0FloatAOff 0x81c0
-
-#define GlintV0FloatF 0x91c8
-#define GlintV0FloatFTag 0x0239
-#define GlintV0FloatFReg 1
-#define GlintV0FloatFOff 0x81c8
-
-#define GlintV0FloatX 0x91d0
-#define GlintV0FloatXTag 0x023a
-#define GlintV0FloatXReg 1
-#define GlintV0FloatXOff 0x81d0
-
-#define GlintV0FloatY 0x91d8
-#define GlintV0FloatYTag 0x023b
-#define GlintV0FloatYReg 1
-#define GlintV0FloatYOff 0x81d8
-
-#define GlintV0FloatZ 0x91e0
-#define GlintV0FloatZTag 0x023c
-#define GlintV0FloatZReg 1
-#define GlintV0FloatZOff 0x81e0
-
-#define GlintV1FloatS 0x9200
-#define GlintV1FloatSTag 0x0240
-#define GlintV1FloatSReg 1
-#define GlintV1FloatSOff 0x8200
-
-#define GlintV1FloatT 0x9208
-#define GlintV1FloatTTag 0x0241
-#define GlintV1FloatTReg 1
-#define GlintV1FloatTOff 0x8208
-
-#define GlintV1FloatQ 0x9210
-#define GlintV1FloatQTag 0x0242
-#define GlintV1FloatQReg 1
-#define GlintV1FloatQOff 0x8210
-
-#define GlintV1FloatKs 0x9218
-#define GlintV1FloatKsTag 0x0243
-#define GlintV1FloatKsReg 1
-#define GlintV1FloatKsOff 0x8218
-
-#define GlintV1FloatKd 0x9220
-#define GlintV1FloatKdTag 0x0244
-#define GlintV1FloatKdReg 1
-#define GlintV1FloatKdOff 0x8220
-
-#define GlintV1FloatR 0x9228
-#define GlintV1FloatRTag 0x0245
-#define GlintV1FloatRReg 1
-#define GlintV1FloatROff 0x8228
-
-#define GlintV1FloatG 0x9230
-#define GlintV1FloatGTag 0x0246
-#define GlintV1FloatGReg 1
-#define GlintV1FloatGOff 0x8230
-
-#define GlintV1FloatB 0x9238
-#define GlintV1FloatBTag 0x0247
-#define GlintV1FloatBReg 1
-#define GlintV1FloatBOff 0x8238
-
-#define GlintV1FloatA 0x9240
-#define GlintV1FloatATag 0x0248
-#define GlintV1FloatAReg 1
-#define GlintV1FloatAOff 0x8240
-
-#define GlintV1FloatF 0x9248
-#define GlintV1FloatFTag 0x0249
-#define GlintV1FloatFReg 1
-#define GlintV1FloatFOff 0x8248
-
-#define GlintV1FloatX 0x9250
-#define GlintV1FloatXTag 0x024a
-#define GlintV1FloatXReg 1
-#define GlintV1FloatXOff 0x8250
-
-#define GlintV1FloatY 0x9258
-#define GlintV1FloatYTag 0x024b
-#define GlintV1FloatYReg 1
-#define GlintV1FloatYOff 0x8258
-
-#define GlintV1FloatZ 0x9260
-#define GlintV1FloatZTag 0x024c
-#define GlintV1FloatZReg 1
-#define GlintV1FloatZOff 0x8260
-
-#define GlintV2FloatS 0x9280
-#define GlintV2FloatSTag 0x0250
-#define GlintV2FloatSReg 1
-#define GlintV2FloatSOff 0x8280
-
-#define GlintV2FloatT 0x9288
-#define GlintV2FloatTTag 0x0251
-#define GlintV2FloatTReg 1
-#define GlintV2FloatTOff 0x8288
-
-#define GlintV2FloatQ 0x9290
-#define GlintV2FloatQTag 0x0252
-#define GlintV2FloatQReg 1
-#define GlintV2FloatQOff 0x8290
-
-#define GlintV2FloatKs 0x9298
-#define GlintV2FloatKsTag 0x0253
-#define GlintV2FloatKsReg 1
-#define GlintV2FloatKsOff 0x8298
-
-#define GlintV2FloatKd 0x92a0
-#define GlintV2FloatKdTag 0x0254
-#define GlintV2FloatKdReg 1
-#define GlintV2FloatKdOff 0x82a0
-
-#define GlintV2FloatR 0x92a8
-#define GlintV2FloatRTag 0x0255
-#define GlintV2FloatRReg 1
-#define GlintV2FloatROff 0x82a8
-
-#define GlintV2FloatG 0x92b0
-#define GlintV2FloatGTag 0x0256
-#define GlintV2FloatGReg 1
-#define GlintV2FloatGOff 0x82b0
-
-#define GlintV2FloatB 0x92b8
-#define GlintV2FloatBTag 0x0257
-#define GlintV2FloatBReg 1
-#define GlintV2FloatBOff 0x82b8
-
-#define GlintV2FloatA 0x92c0
-#define GlintV2FloatATag 0x0258
-#define GlintV2FloatAReg 1
-#define GlintV2FloatAOff 0x82c0
-
-#define GlintV2FloatF 0x92c8
-#define GlintV2FloatFTag 0x0259
-#define GlintV2FloatFReg 1
-#define GlintV2FloatFOff 0x82c8
-
-#define GlintV2FloatX 0x92d0
-#define GlintV2FloatXTag 0x025a
-#define GlintV2FloatXReg 1
-#define GlintV2FloatXOff 0x82d0
-
-#define GlintV2FloatY 0x92d8
-#define GlintV2FloatYTag 0x025b
-#define GlintV2FloatYReg 1
-#define GlintV2FloatYOff 0x82d8
-
-#define GlintV2FloatZ 0x92e0
-#define GlintV2FloatZTag 0x025c
-#define GlintV2FloatZReg 1
-#define GlintV2FloatZOff 0x82e0
-
-#define GlintDeltaMode 0x9300
-#define GlintDeltaModeTag 0x0260
-#define GlintDeltaModeReg 1
-#define GlintDeltaModeOff 0x8300
-
-#define GlintDrawTriangle 0x9308
-#define GlintDrawTriangleTag 0x0261
-#define GlintDrawTriangleReg 1
-#define GlintDrawTriangleOff 0x8308
-
-#define GlintRepeatTriangle 0x9310
-#define GlintRepeatTriangleTag 0x0262
-#define GlintRepeatTriangleReg 1
-#define GlintRepeatTriangleOff 0x8310
-
-#define GlintDrawLine01 0x9318
-#define GlintDrawLine01Tag 0x0263
-#define GlintDrawLine01Reg 1
-#define GlintDrawLine01Off 0x8318
-
-#define GlintDrawLine10 0x9320
-#define GlintDrawLine10Tag 0x0264
-#define GlintDrawLine10Reg 1
-#define GlintDrawLine10Off 0x8320
-
-#define GlintRepeatLine 0x9328
-#define GlintRepeatLineTag 0x0265
-#define GlintRepeatLineReg 1
-#define GlintRepeatLineOff 0x8328
-
-#define GlintEpilogueTag 0x9368
-#define GlintEpilogueTagTag 0x026d
-#define GlintEpilogueTagReg 1
-#define GlintEpilogueTagOff 0x8368
-
-#define GlintEpilogueData 0x9370
-#define GlintEpilogueDataTag 0x026e
-#define GlintEpilogueDataReg 1
-#define GlintEpilogueDataOff 0x8370
-
-#define GlintBroadcastMask 0x9378
-#define GlintBroadcastMaskTag 0x026f
-#define GlintBroadcastMaskReg 1
-#define GlintBroadcastMaskOff 0x8378
-
-#define GlintXBias 0x9480
-#define GlintXBiasTag 0x0290
-#define GlintXBiasReg 1
-#define GlintXBiasOff 0x8480
-
-#define GlintYBias 0x9488
-#define GlintYBiasTag 0x0291
-#define GlintYBiasReg 1
-#define GlintYBiasOff 0x8488
-
-#define GlintPointMode 0x9490
-#define GlintPointModeTag 0x0292
-#define GlintPointModeReg 1
-#define GlintPointModeOff 0x8490
-
-#define GlintPointSize 0x9498
-#define GlintPointSizeTag 0x0293
-#define GlintPointSizeReg 1
-#define GlintPointSizeOff 0x8498
-
-#define GlintAApointSize 0x94a0
-#define GlintAApointSizeTag 0x0294
-#define GlintAApointSizeReg 1
-#define GlintAApointSizeOff 0x84a0
-
-#define GlintLineMode 0x94a8
-#define GlintLineModeTag 0x0295
-#define GlintLineModeReg 1
-#define GlintLineModeOff 0x84a8
-
-#define GlintLineWidth 0x94b0
-#define GlintLineWidthTag 0x0296
-#define GlintLineWidthReg 1
-#define GlintLineWidthOff 0x84b0
-
-#define GlintLineWidthOffset 0x94b8
-#define GlintLineWidthOffsetTag 0x0297
-#define GlintLineWidthOffsetReg 1
-#define GlintLineWidthOffsetOff 0x84b8
-
-#define GlintAAlineWidth 0x94c0
-#define GlintAAlineWidthTag 0x0298
-#define GlintAAlineWidthReg 1
-#define GlintAAlineWidthOff 0x84c0
-
-#define GlintTriangleMode 0x94c8
-#define GlintTriangleModeTag 0x0299
-#define GlintTriangleModeReg 1
-#define GlintTriangleModeOff 0x84c8
-
-#define GlintRectangleMode 0x94d0
-#define GlintRectangleModeTag 0x029a
-#define GlintRectangleModeReg 1
-#define GlintRectangleModeOff 0x84d0
-
-#define GlintRectangleWidth 0x94d8
-#define GlintRectangleWidthTag 0x029b
-#define GlintRectangleWidthReg 1
-#define GlintRectangleWidthOff 0x84d8
-
-#define GlintRectangleHeight 0x94e0
-#define GlintRectangleHeightTag 0x029c
-#define GlintRectangleHeightReg 1
-#define GlintRectangleHeightOff 0x84e0
-
-#define GlintRectangle2DMode 0x94e8
-#define GlintRectangle2DModeTag 0x029d
-#define GlintRectangle2DModeReg 1
-#define GlintRectangle2DModeOff 0x84e8
-
-#define GlintRectangle2DControl 0x94f0
-#define GlintRectangle2DControlTag 0x029e
-#define GlintRectangle2DControlReg 1
-#define GlintRectangle2DControlOff 0x84f0
-
-#define GlintTransformMode 0x9508
-#define GlintTransformModeTag 0x02a1
-#define GlintTransformModeReg 1
-#define GlintTransformModeOff 0x8508
-
-#define GlintGeometryMode 0x9510
-#define GlintGeometryModeTag 0x02a2
-#define GlintGeometryModeReg 1
-#define GlintGeometryModeOff 0x8510
-
-#define GlintNormalizeMode 0x9518
-#define GlintNormalizeModeTag 0x02a3
-#define GlintNormalizeModeReg 1
-#define GlintNormalizeModeOff 0x8518
-
-#define GlintLightingMode 0x9520
-#define GlintLightingModeTag 0x02a4
-#define GlintLightingModeReg 1
-#define GlintLightingModeOff 0x8520
-
-#define GlintColorMaterialMode 0x9528
-#define GlintColorMaterialModeTag 0x02a5
-#define GlintColorMaterialModeReg 1
-#define GlintColorMaterialModeOff 0x8528
-
-#define GlintMaterialMode 0x9530
-#define GlintMaterialModeTag 0x02a6
-#define GlintMaterialModeReg 1
-#define GlintMaterialModeOff 0x8530
-
-#define GlintSelectResult 0x9580
-#define GlintSelectResultTag 0x02b0
-#define GlintSelectResultReg 1
-#define GlintSelectResultOff 0x8580
-
-#define GlintBegin 0x9590
-#define GlintBeginTag 0x02b2
-#define GlintBeginReg 1
-#define GlintBeginOff 0x8590
-
-#define GlintEnd 0x9598
-#define GlintEndTag 0x02b3
-#define GlintEndReg 1
-#define GlintEndOff 0x8598
-
-#define GlintEdgeFlag 0x95a0
-#define GlintEdgeFlagTag 0x02b4
-#define GlintEdgeFlagReg 1
-#define GlintEdgeFlagOff 0x85a0
-
-#define GlintObjectIDvalue 0x95a8
-#define GlintObjectIDvalueTag 0x02b5
-#define GlintObjectIDvalueReg 1
-#define GlintObjectIDvalueOff 0x85a8
-
-#define GlintIncrementObjectID 0x95b0
-#define GlintIncrementObjectIDTag 0x02b6
-#define GlintIncrementObjectIDReg 1
-#define GlintIncrementObjectIDOff 0x85b0
-
-#define GlintTransformCurrent 0x95b8
-#define GlintTransformCurrentTag 0x02b7
-#define GlintTransformCurrentReg 1
-#define GlintTransformCurrentOff 0x85b8
-
-#define GlintSaveCurrent 0x95c8
-#define GlintSaveCurrentTag 0x02b9
-#define GlintSaveCurrentReg 1
-#define GlintSaveCurrentOff 0x85c8
-
-#define GlintRestoreCurrent 0x95d0
-#define GlintRestoreCurrentTag 0x02ba
-#define GlintRestoreCurrentReg 1
-#define GlintRestoreCurrentOff 0x85d0
-
-#define GlintInitNames 0x95d8
-#define GlintInitNamesTag 0x02bb
-#define GlintInitNamesReg 1
-#define GlintInitNamesOff 0x85d8
-
-#define GlintPushName 0x95e0
-#define GlintPushNameTag 0x02bc
-#define GlintPushNameReg 1
-#define GlintPushNameOff 0x85e0
-
-#define GlintPopName 0x95e8
-#define GlintPopNameTag 0x02bd
-#define GlintPopNameReg 1
-#define GlintPopNameOff 0x85e8
-
-#define GlintLoadName 0x95f0
-#define GlintLoadNameTag 0x02be
-#define GlintLoadNameReg 1
-#define GlintLoadNameOff 0x85f0
-
-#define GlintGeomRectangle 0x96a0
-#define GlintGeomRectangleTag 0x02d4
-#define GlintGeomRectangleReg 1
-#define GlintGeomRectangleOff 0x86a0
-
-#define GlintDrawRectangle2D 0x97a0
-#define GlintDrawRectangle2DTag 0x02f4
-#define GlintDrawRectangle2DReg 1
-#define GlintDrawRectangle2DOff 0x87a0
-
-#define GlintNz 0x9800
-#define GlintNzTag 0x0300
-#define GlintNzReg 1
-#define GlintNzOff 0x8800
-
-#define GlintNy 0x9808
-#define GlintNyTag 0x0301
-#define GlintNyReg 1
-#define GlintNyOff 0x8808
-
-#define GlintNx 0x9810
-#define GlintNxTag 0x0302
-#define GlintNxReg 1
-#define GlintNxOff 0x8810
-
-#define GlintCa 0x9818
-#define GlintCaTag 0x0303
-#define GlintCaReg 1
-#define GlintCaOff 0x8818
-
-#define GlintCb 0x9820
-#define GlintCbTag 0x0304
-#define GlintCbReg 1
-#define GlintCbOff 0x8820
-
-#define GlintCg 0x9828
-#define GlintCgTag 0x0305
-#define GlintCgReg 1
-#define GlintCgOff 0x8828
-
-#define GlintCr3 0x9830
-#define GlintCr3Tag 0x0306
-#define GlintCr3Reg 1
-#define GlintCr3Off 0x8830
-
-#define GlintCr4 0x9838
-#define GlintCr4Tag 0x0307
-#define GlintCr4Reg 1
-#define GlintCr4Off 0x8838
-
-#define GlintTt2 0x9840
-#define GlintTt2Tag 0x0308
-#define GlintTt2Reg 1
-#define GlintTt2Off 0x8840
-
-#define GlintTs2 0x9848
-#define GlintTs2Tag 0x0309
-#define GlintTs2Reg 1
-#define GlintTs2Off 0x8848
-
-#define GlintVw 0x9850
-#define GlintVwTag 0x030a
-#define GlintVwReg 1
-#define GlintVwOff 0x8850
-
-#define GlintVz 0x9858
-#define GlintVzTag 0x030b
-#define GlintVzReg 1
-#define GlintVzOff 0x8858
-
-#define GlintVy 0x9860
-#define GlintVyTag 0x030c
-#define GlintVyReg 1
-#define GlintVyOff 0x8860
-
-#define GlintVx2 0x9868
-#define GlintVx2Tag 0x030d
-#define GlintVx2Reg 1
-#define GlintVx2Off 0x8868
-
-#define GlintVx3 0x9870
-#define GlintVx3Tag 0x030e
-#define GlintVx3Reg 1
-#define GlintVx3Off 0x8870
-
-#define GlintVx4 0x9878
-#define GlintVx4Tag 0x030f
-#define GlintVx4Reg 1
-#define GlintVx4Off 0x8878
-
-#define GlintFNz 0x9880
-#define GlintFNzTag 0x0310
-#define GlintFNzReg 1
-#define GlintFNzOff 0x8880
-
-#define GlintFNy 0x9888
-#define GlintFNyTag 0x0311
-#define GlintFNyReg 1
-#define GlintFNyOff 0x8888
-
-#define GlintFNx 0x9890
-#define GlintFNxTag 0x0312
-#define GlintFNxReg 1
-#define GlintFNxOff 0x8890
-
-#define GlintPackedColor3 0x9898
-#define GlintPackedColor3Tag 0x0313
-#define GlintPackedColor3Reg 1
-#define GlintPackedColor3Off 0x8898
-
-#define GlintPackedColor4 0x98a0
-#define GlintPackedColor4Tag 0x0314
-#define GlintPackedColor4Reg 1
-#define GlintPackedColor4Off 0x88a0
-
-#define GlintTq4 0x98a8
-#define GlintTq4Tag 0x0315
-#define GlintTq4Reg 1
-#define GlintTq4Off 0x88a8
-
-#define GlintTr4 0x98b0
-#define GlintTr4Tag 0x0316
-#define GlintTr4Reg 1
-#define GlintTr4Off 0x88b0
-
-#define GlintTt4 0x98b8
-#define GlintTt4Tag 0x0317
-#define GlintTt4Reg 1
-#define GlintTt4Off 0x88b8
-
-#define GlintTs4 0x98c0
-#define GlintTs4Tag 0x0318
-#define GlintTs4Reg 1
-#define GlintTs4Off 0x88c0
-
-#define GlintRPw 0x98c8
-#define GlintRPwTag 0x0319
-#define GlintRPwReg 1
-#define GlintRPwOff 0x88c8
-
-#define GlintRPz 0x98d0
-#define GlintRPzTag 0x031a
-#define GlintRPzReg 1
-#define GlintRPzOff 0x88d0
-
-#define GlintRPy 0x98d8
-#define GlintRPyTag 0x031b
-#define GlintRPyReg 1
-#define GlintRPyOff 0x88d8
-
-#define GlintRPx2 0x98e0
-#define GlintRPx2Tag 0x031c
-#define GlintRPx2Reg 1
-#define GlintRPx2Off 0x88e0
-
-#define GlintRPx3 0x98e8
-#define GlintRPx3Tag 0x031d
-#define GlintRPx3Reg 1
-#define GlintRPx3Off 0x88e8
-
-#define GlintRPx4 0x98f0
-#define GlintRPx4Tag 0x031e
-#define GlintRPx4Reg 1
-#define GlintRPx4Off 0x88f0
-
-#define GlintTs1 0x98f8
-#define GlintTs1Tag 0x031f
-#define GlintTs1Reg 1
-#define GlintTs1Off 0x88f8
-
-#define GlintModelViewMatrix0 0x9900
-#define GlintModelViewMatrix0Tag 0x0320
-#define GlintModelViewMatrix0Reg 1
-#define GlintModelViewMatrix0Off 0x8900
-
-#define GlintModelViewMatrix1 0x9908
-#define GlintModelViewMatrix1Tag 0x0321
-#define GlintModelViewMatrix1Reg 1
-#define GlintModelViewMatrix1Off 0x8908
-
-#define GlintModelViewMatrix2 0x9910
-#define GlintModelViewMatrix2Tag 0x0322
-#define GlintModelViewMatrix2Reg 1
-#define GlintModelViewMatrix2Off 0x8910
-
-#define GlintModelViewMatrix3 0x9918
-#define GlintModelViewMatrix3Tag 0x0323
-#define GlintModelViewMatrix3Reg 1
-#define GlintModelViewMatrix3Off 0x8918
-
-#define GlintModelViewMatrix4 0x9920
-#define GlintModelViewMatrix4Tag 0x0324
-#define GlintModelViewMatrix4Reg 1
-#define GlintModelViewMatrix4Off 0x8920
-
-#define GlintModelViewMatrix5 0x9928
-#define GlintModelViewMatrix5Tag 0x0325
-#define GlintModelViewMatrix5Reg 1
-#define GlintModelViewMatrix5Off 0x8928
-
-#define GlintModelViewMatrix6 0x9930
-#define GlintModelViewMatrix6Tag 0x0326
-#define GlintModelViewMatrix6Reg 1
-#define GlintModelViewMatrix6Off 0x8930
-
-#define GlintModelViewMatrix7 0x9938
-#define GlintModelViewMatrix7Tag 0x0327
-#define GlintModelViewMatrix7Reg 1
-#define GlintModelViewMatrix7Off 0x8938
-
-#define GlintModelViewMatrix8 0x9940
-#define GlintModelViewMatrix8Tag 0x0328
-#define GlintModelViewMatrix8Reg 1
-#define GlintModelViewMatrix8Off 0x8940
-
-#define GlintModelViewMatrix9 0x9948
-#define GlintModelViewMatrix9Tag 0x0329
-#define GlintModelViewMatrix9Reg 1
-#define GlintModelViewMatrix9Off 0x8948
-
-#define GlintModelViewMatrix10 0x9950
-#define GlintModelViewMatrix10Tag 0x032a
-#define GlintModelViewMatrix10Reg 1
-#define GlintModelViewMatrix10Off 0x8950
-
-#define GlintModelViewMatrix11 0x9958
-#define GlintModelViewMatrix11Tag 0x032b
-#define GlintModelViewMatrix11Reg 1
-#define GlintModelViewMatrix11Off 0x8958
-
-#define GlintModelViewMatrix12 0x9960
-#define GlintModelViewMatrix12Tag 0x032c
-#define GlintModelViewMatrix12Reg 1
-#define GlintModelViewMatrix12Off 0x8960
-
-#define GlintModelViewMatrix13 0x9968
-#define GlintModelViewMatrix13Tag 0x032d
-#define GlintModelViewMatrix13Reg 1
-#define GlintModelViewMatrix13Off 0x8968
-
-#define GlintModelViewMatrix14 0x9970
-#define GlintModelViewMatrix14Tag 0x032e
-#define GlintModelViewMatrix14Reg 1
-#define GlintModelViewMatrix14Off 0x8970
-
-#define GlintModelViewMatrix15 0x9978
-#define GlintModelViewMatrix15Tag 0x032f
-#define GlintModelViewMatrix15Reg 1
-#define GlintModelViewMatrix15Off 0x8978
-
-#define GlintModelViewProjectionMatrix0 0x9980
-#define GlintModelViewProjectionMatrix0Tag 0x0330
-#define GlintModelViewProjectionMatrix0Reg 1
-#define GlintModelViewProjectionMatrix0Off 0x8980
-
-#define GlintModelViewProjectionMatrix1 0x9988
-#define GlintModelViewProjectionMatrix1Tag 0x0331
-#define GlintModelViewProjectionMatrix1Reg 1
-#define GlintModelViewProjectionMatrix1Off 0x8988
-
-#define GlintModelViewProjectionMatrix2 0x9990
-#define GlintModelViewProjectionMatrix2Tag 0x0332
-#define GlintModelViewProjectionMatrix2Reg 1
-#define GlintModelViewProjectionMatrix2Off 0x8990
-
-#define GlintModelViewProjectionMatrix3 0x9998
-#define GlintModelViewProjectionMatrix3Tag 0x0333
-#define GlintModelViewProjectionMatrix3Reg 1
-#define GlintModelViewProjectionMatrix3Off 0x8998
-
-#define GlintModelViewProjectionMatrix4 0x99a0
-#define GlintModelViewProjectionMatrix4Tag 0x0334
-#define GlintModelViewProjectionMatrix4Reg 1
-#define GlintModelViewProjectionMatrix4Off 0x89a0
-
-#define GlintModelViewProjectionMatrix5 0x99a8
-#define GlintModelViewProjectionMatrix5Tag 0x0335
-#define GlintModelViewProjectionMatrix5Reg 1
-#define GlintModelViewProjectionMatrix5Off 0x89a8
-
-#define GlintModelViewProjectionMatrix6 0x99b0
-#define GlintModelViewProjectionMatrix6Tag 0x0336
-#define GlintModelViewProjectionMatrix6Reg 1
-#define GlintModelViewProjectionMatrix6Off 0x89b0
-
-#define GlintModelViewProjectionMatrix7 0x99b8
-#define GlintModelViewProjectionMatrix7Tag 0x0337
-#define GlintModelViewProjectionMatrix7Reg 1
-#define GlintModelViewProjectionMatrix7Off 0x89b8
-
-#define GlintModelViewProjectionMatrix8 0x99c0
-#define GlintModelViewProjectionMatrix8Tag 0x0338
-#define GlintModelViewProjectionMatrix8Reg 1
-#define GlintModelViewProjectionMatrix8Off 0x89c0
-
-#define GlintModelViewProjectionMatrix9 0x99c8
-#define GlintModelViewProjectionMatrix9Tag 0x0339
-#define GlintModelViewProjectionMatrix9Reg 1
-#define GlintModelViewProjectionMatrix9Off 0x89c8
-
-#define GlintModelViewProjectionMatrix10 0x99d0
-#define GlintModelViewProjectionMatrix10Tag 0x033a
-#define GlintModelViewProjectionMatrix10Reg 1
-#define GlintModelViewProjectionMatrix10Off 0x89d0
-
-#define GlintModelViewProjectionMatrix11 0x99d8
-#define GlintModelViewProjectionMatrix11Tag 0x033b
-#define GlintModelViewProjectionMatrix11Reg 1
-#define GlintModelViewProjectionMatrix11Off 0x89d8
-
-#define GlintModelViewProjectionMatrix12 0x99e0
-#define GlintModelViewProjectionMatrix12Tag 0x033c
-#define GlintModelViewProjectionMatrix12Reg 1
-#define GlintModelViewProjectionMatrix12Off 0x89e0
-
-#define GlintModelViewProjectionMatrix13 0x99e8
-#define GlintModelViewProjectionMatrix13Tag 0x033d
-#define GlintModelViewProjectionMatrix13Reg 1
-#define GlintModelViewProjectionMatrix13Off 0x89e8
-
-#define GlintModelViewProjectionMatrix14 0x99f0
-#define GlintModelViewProjectionMatrix14Tag 0x033e
-#define GlintModelViewProjectionMatrix14Reg 1
-#define GlintModelViewProjectionMatrix14Off 0x89f0
-
-#define GlintModelViewProjectionMatrix15 0x99f8
-#define GlintModelViewProjectionMatrix15Tag 0x033f
-#define GlintModelViewProjectionMatrix15Reg 1
-#define GlintModelViewProjectionMatrix15Off 0x89f8
-
-#define GlintNormalMatrix0 0x9a00
-#define GlintNormalMatrix0Tag 0x0340
-#define GlintNormalMatrix0Reg 1
-#define GlintNormalMatrix0Off 0x8a00
-
-#define GlintNormalMatrix1 0x9a08
-#define GlintNormalMatrix1Tag 0x0341
-#define GlintNormalMatrix1Reg 1
-#define GlintNormalMatrix1Off 0x8a08
-
-#define GlintNormalMatrix2 0x9a10
-#define GlintNormalMatrix2Tag 0x0342
-#define GlintNormalMatrix2Reg 1
-#define GlintNormalMatrix2Off 0x8a10
-
-#define GlintNormalMatrix3 0x9a18
-#define GlintNormalMatrix3Tag 0x0343
-#define GlintNormalMatrix3Reg 1
-#define GlintNormalMatrix3Off 0x8a18
-
-#define GlintNormalMatrix4 0x9a20
-#define GlintNormalMatrix4Tag 0x0344
-#define GlintNormalMatrix4Reg 1
-#define GlintNormalMatrix4Off 0x8a20
-
-#define GlintNormalMatrix5 0x9a28
-#define GlintNormalMatrix5Tag 0x0345
-#define GlintNormalMatrix5Reg 1
-#define GlintNormalMatrix5Off 0x8a28
-
-#define GlintNormalMatrix6 0x9a30
-#define GlintNormalMatrix6Tag 0x0346
-#define GlintNormalMatrix6Reg 1
-#define GlintNormalMatrix6Off 0x8a30
-
-#define GlintNormalMatrix7 0x9a38
-#define GlintNormalMatrix7Tag 0x0347
-#define GlintNormalMatrix7Reg 1
-#define GlintNormalMatrix7Off 0x8a38
-
-#define GlintNormalMatrix8 0x9a40
-#define GlintNormalMatrix8Tag 0x0348
-#define GlintNormalMatrix8Reg 1
-#define GlintNormalMatrix8Off 0x8a40
-
-#define GlintTextureMatrix0 0x9a80
-#define GlintTextureMatrix0Tag 0x0350
-#define GlintTextureMatrix0Reg 1
-#define GlintTextureMatrix0Off 0x8a80
-
-#define GlintTextureMatrix1 0x9a88
-#define GlintTextureMatrix1Tag 0x0351
-#define GlintTextureMatrix1Reg 1
-#define GlintTextureMatrix1Off 0x8a88
-
-#define GlintTextureMatrix2 0x9a90
-#define GlintTextureMatrix2Tag 0x0352
-#define GlintTextureMatrix2Reg 1
-#define GlintTextureMatrix2Off 0x8a90
-
-#define GlintTextureMatrix3 0x9a98
-#define GlintTextureMatrix3Tag 0x0353
-#define GlintTextureMatrix3Reg 1
-#define GlintTextureMatrix3Off 0x8a98
-
-#define GlintTextureMatrix4 0x9aa0
-#define GlintTextureMatrix4Tag 0x0354
-#define GlintTextureMatrix4Reg 1
-#define GlintTextureMatrix4Off 0x8aa0
-
-#define GlintTextureMatrix5 0x9aa8
-#define GlintTextureMatrix5Tag 0x0355
-#define GlintTextureMatrix5Reg 1
-#define GlintTextureMatrix5Off 0x8aa8
-
-#define GlintTextureMatrix6 0x9ab0
-#define GlintTextureMatrix6Tag 0x0356
-#define GlintTextureMatrix6Reg 1
-#define GlintTextureMatrix6Off 0x8ab0
-
-#define GlintTextureMatrix7 0x9ab8
-#define GlintTextureMatrix7Tag 0x0357
-#define GlintTextureMatrix7Reg 1
-#define GlintTextureMatrix7Off 0x8ab8
-
-#define GlintTextureMatrix8 0x9ac0
-#define GlintTextureMatrix8Tag 0x0358
-#define GlintTextureMatrix8Reg 1
-#define GlintTextureMatrix8Off 0x8ac0
-
-#define GlintTextureMatrix9 0x9ac8
-#define GlintTextureMatrix9Tag 0x0359
-#define GlintTextureMatrix9Reg 1
-#define GlintTextureMatrix9Off 0x8ac8
-
-#define GlintTextureMatrix10 0x9ad0
-#define GlintTextureMatrix10Tag 0x035a
-#define GlintTextureMatrix10Reg 1
-#define GlintTextureMatrix10Off 0x8ad0
-
-#define GlintTextureMatrix11 0x9ad8
-#define GlintTextureMatrix11Tag 0x035b
-#define GlintTextureMatrix11Reg 1
-#define GlintTextureMatrix11Off 0x8ad8
-
-#define GlintTextureMatrix12 0x9ae0
-#define GlintTextureMatrix12Tag 0x035c
-#define GlintTextureMatrix12Reg 1
-#define GlintTextureMatrix12Off 0x8ae0
-
-#define GlintTextureMatrix13 0x9ae8
-#define GlintTextureMatrix13Tag 0x035d
-#define GlintTextureMatrix13Reg 1
-#define GlintTextureMatrix13Off 0x8ae8
-
-#define GlintTextureMatrix14 0x9af0
-#define GlintTextureMatrix14Tag 0x035e
-#define GlintTextureMatrix14Reg 1
-#define GlintTextureMatrix14Off 0x8af0
-
-#define GlintTextureMatrix15 0x9af8
-#define GlintTextureMatrix15Tag 0x035f
-#define GlintTextureMatrix15Reg 1
-#define GlintTextureMatrix15Off 0x8af8
-
-#define GlintTexGen0 0x9b00
-#define GlintTexGen0Tag 0x0360
-#define GlintTexGen0Reg 1
-#define GlintTexGen0Off 0x8b00
-
-#define GlintTexGen1 0x9b08
-#define GlintTexGen1Tag 0x0361
-#define GlintTexGen1Reg 1
-#define GlintTexGen1Off 0x8b08
-
-#define GlintTexGen2 0x9b10
-#define GlintTexGen2Tag 0x0362
-#define GlintTexGen2Reg 1
-#define GlintTexGen2Off 0x8b10
-
-#define GlintTexGen3 0x9b18
-#define GlintTexGen3Tag 0x0363
-#define GlintTexGen3Reg 1
-#define GlintTexGen3Off 0x8b18
-
-#define GlintTexGen4 0x9b20
-#define GlintTexGen4Tag 0x0364
-#define GlintTexGen4Reg 1
-#define GlintTexGen4Off 0x8b20
-
-#define GlintTexGen5 0x9b28
-#define GlintTexGen5Tag 0x0365
-#define GlintTexGen5Reg 1
-#define GlintTexGen5Off 0x8b28
-
-#define GlintTexGen6 0x9b30
-#define GlintTexGen6Tag 0x0366
-#define GlintTexGen6Reg 1
-#define GlintTexGen6Off 0x8b30
-
-#define GlintTexGen7 0x9b38
-#define GlintTexGen7Tag 0x0367
-#define GlintTexGen7Reg 1
-#define GlintTexGen7Off 0x8b38
-
-#define GlintTexGen8 0x9b40
-#define GlintTexGen8Tag 0x0368
-#define GlintTexGen8Reg 1
-#define GlintTexGen8Off 0x8b40
-
-#define GlintTexGen9 0x9b48
-#define GlintTexGen9Tag 0x0369
-#define GlintTexGen9Reg 1
-#define GlintTexGen9Off 0x8b48
-
-#define GlintTexGen10 0x9b50
-#define GlintTexGen10Tag 0x036a
-#define GlintTexGen10Reg 1
-#define GlintTexGen10Off 0x8b50
-
-#define GlintTexGen11 0x9b58
-#define GlintTexGen11Tag 0x036b
-#define GlintTexGen11Reg 1
-#define GlintTexGen11Off 0x8b58
-
-#define GlintTexGen12 0x9b60
-#define GlintTexGen12Tag 0x036c
-#define GlintTexGen12Reg 1
-#define GlintTexGen12Off 0x8b60
-
-#define GlintTexGen13 0x9b68
-#define GlintTexGen13Tag 0x036d
-#define GlintTexGen13Reg 1
-#define GlintTexGen13Off 0x8b68
-
-#define GlintTexGen14 0x9b70
-#define GlintTexGen14Tag 0x036e
-#define GlintTexGen14Reg 1
-#define GlintTexGen14Off 0x8b70
-
-#define GlintTexGen15 0x9b78
-#define GlintTexGen15Tag 0x036f
-#define GlintTexGen15Reg 1
-#define GlintTexGen15Off 0x8b78
-
-#define GlintViewPortScaleX 0x9b80
-#define GlintViewPortScaleXTag 0x0370
-#define GlintViewPortScaleXReg 1
-#define GlintViewPortScaleXOff 0x8b80
-
-#define GlintViewPortScaleY 0x9b88
-#define GlintViewPortScaleYTag 0x0371
-#define GlintViewPortScaleYReg 1
-#define GlintViewPortScaleYOff 0x8b88
-
-#define GlintViewPortScaleZ 0x9b90
-#define GlintViewPortScaleZTag 0x0372
-#define GlintViewPortScaleZReg 1
-#define GlintViewPortScaleZOff 0x8b90
-
-#define GlintViewPortOffsetX 0x9b98
-#define GlintViewPortOffsetXTag 0x0373
-#define GlintViewPortOffsetXReg 1
-#define GlintViewPortOffsetXOff 0x8b98
-
-#define GlintViewPortOffsetY 0x9ba0
-#define GlintViewPortOffsetYTag 0x0374
-#define GlintViewPortOffsetYReg 1
-#define GlintViewPortOffsetYOff 0x8ba0
-
-#define GlintViewPortOffsetZ 0x9ba8
-#define GlintViewPortOffsetZTag 0x0375
-#define GlintViewPortOffsetZReg 1
-#define GlintViewPortOffsetZOff 0x8ba8
-
-#define GlintFogDensity 0x9bb0
-#define GlintFogDensityTag 0x0376
-#define GlintFogDensityReg 1
-#define GlintFogDensityOff 0x8bb0
-
-#define GlintFogScale 0x9bb8
-#define GlintFogScaleTag 0x0377
-#define GlintFogScaleReg 1
-#define GlintFogScaleOff 0x8bb8
-
-#define GlintFogEnd 0x9bc0
-#define GlintFogEndTag 0x0378
-#define GlintFogEndReg 1
-#define GlintFogEndOff 0x8bc0
-
-#define GlintPolygonOffsetFactor 0x9bc8
-#define GlintPolygonOffsetFactorTag 0x0379
-#define GlintPolygonOffsetFactorReg 1
-#define GlintPolygonOffsetFactorOff 0x8bc8
-
-#define GlintPolygonOffsetBias 0x9bd0
-#define GlintPolygonOffsetBiasTag 0x037a
-#define GlintPolygonOffsetBiasReg 1
-#define GlintPolygonOffsetBiasOff 0x8bd0
-
-#define GlintLineClipLengthThreshold 0x9bd8
-#define GlintLineClipLengthThresholdTag 0x037b
-#define GlintLineClipLengthThresholdReg 1
-#define GlintLineClipLengthThresholdOff 0x8bd8
-
-#define GlintTriangleClipAreaThreshold 0x9be0
-#define GlintTriangleClipAreaThresholdTag 0x037c
-#define GlintTriangleClipAreaThresholdReg 1
-#define GlintTriangleClipAreaThresholdOff 0x8be0
-
-#define GlintRasterPosXIncrement 0x9be8
-#define GlintRasterPosXIncrementTag 0x037d
-#define GlintRasterPosXIncrementReg 1
-#define GlintRasterPosXIncrementOff 0x8be8
-
-#define GlintRasterPosYIncrement 0x9bf0
-#define GlintRasterPosYIncrementTag 0x037e
-#define GlintRasterPosYIncrementReg 1
-#define GlintRasterPosYIncrementOff 0x8bf0
-
-#define GlintUserClip0X 0x9c00
-#define GlintUserClip0XTag 0x0380
-#define GlintUserClip0XReg 1
-#define GlintUserClip0XOff 0x8c00
-
-#define GlintUserClip0Y 0x9c08
-#define GlintUserClip0YTag 0x0381
-#define GlintUserClip0YReg 1
-#define GlintUserClip0YOff 0x8c08
-
-#define GlintUserClip0Z 0x9c10
-#define GlintUserClip0ZTag 0x0382
-#define GlintUserClip0ZReg 1
-#define GlintUserClip0ZOff 0x8c10
-
-#define GlintUserClip0W 0x9c18
-#define GlintUserClip0WTag 0x0383
-#define GlintUserClip0WReg 1
-#define GlintUserClip0WOff 0x8c18
-
-#define GlintUserClip1X 0x9c20
-#define GlintUserClip1XTag 0x0384
-#define GlintUserClip1XReg 1
-#define GlintUserClip1XOff 0x8c20
-
-#define GlintUserClip1Y 0x9c28
-#define GlintUserClip1YTag 0x0385
-#define GlintUserClip1YReg 1
-#define GlintUserClip1YOff 0x8c28
-
-#define GlintUserClip1Z 0x9c30
-#define GlintUserClip1ZTag 0x0386
-#define GlintUserClip1ZReg 1
-#define GlintUserClip1ZOff 0x8c30
-
-#define GlintUserClip1W 0x9c38
-#define GlintUserClip1WTag 0x0387
-#define GlintUserClip1WReg 1
-#define GlintUserClip1WOff 0x8c38
-
-#define GlintUserClip2X 0x9c40
-#define GlintUserClip2XTag 0x0388
-#define GlintUserClip2XReg 1
-#define GlintUserClip2XOff 0x8c40
-
-#define GlintUserClip2Y 0x9c48
-#define GlintUserClip2YTag 0x0389
-#define GlintUserClip2YReg 1
-#define GlintUserClip2YOff 0x8c48
-
-#define GlintUserClip2Z 0x9c50
-#define GlintUserClip2ZTag 0x038a
-#define GlintUserClip2ZReg 1
-#define GlintUserClip2ZOff 0x8c50
-
-#define GlintUserClip2W 0x9c58
-#define GlintUserClip2WTag 0x038b
-#define GlintUserClip2WReg 1
-#define GlintUserClip2WOff 0x8c58
-
-#define GlintUserClip3X 0x9c60
-#define GlintUserClip3XTag 0x038c
-#define GlintUserClip3XReg 1
-#define GlintUserClip3XOff 0x8c60
-
-#define GlintUserClip3Y 0x9c68
-#define GlintUserClip3YTag 0x038d
-#define GlintUserClip3YReg 1
-#define GlintUserClip3YOff 0x8c68
-
-#define GlintUserClip3Z 0x9c70
-#define GlintUserClip3ZTag 0x038e
-#define GlintUserClip3ZReg 1
-#define GlintUserClip3ZOff 0x8c70
-
-#define GlintUserClip3W 0x9c78
-#define GlintUserClip3WTag 0x038f
-#define GlintUserClip3WReg 1
-#define GlintUserClip3WOff 0x8c78
-
-#define GlintUserClip4X 0x9c80
-#define GlintUserClip4XTag 0x0390
-#define GlintUserClip4XReg 1
-#define GlintUserClip4XOff 0x8c80
-
-#define GlintUserClip4Y 0x9c88
-#define GlintUserClip4YTag 0x0391
-#define GlintUserClip4YReg 1
-#define GlintUserClip4YOff 0x8c88
-
-#define GlintUserClip4Z 0x9c90
-#define GlintUserClip4ZTag 0x0392
-#define GlintUserClip4ZReg 1
-#define GlintUserClip4ZOff 0x8c90
-
-#define GlintUserClip4W 0x9c98
-#define GlintUserClip4WTag 0x0393
-#define GlintUserClip4WReg 1
-#define GlintUserClip4WOff 0x8c98
-
-#define GlintUserClip5X 0x9ca0
-#define GlintUserClip5XTag 0x0394
-#define GlintUserClip5XReg 1
-#define GlintUserClip5XOff 0x8ca0
-
-#define GlintUserClip5Y 0x9ca8
-#define GlintUserClip5YTag 0x0395
-#define GlintUserClip5YReg 1
-#define GlintUserClip5YOff 0x8ca8
-
-#define GlintUserClip5Z 0x9cb0
-#define GlintUserClip5ZTag 0x0396
-#define GlintUserClip5ZReg 1
-#define GlintUserClip5ZOff 0x8cb0
-
-#define GlintUserClip5W 0x9cb8
-#define GlintUserClip5WTag 0x0397
-#define GlintUserClip5WReg 1
-#define GlintUserClip5WOff 0x8cb8
-
-#define GlintRasterPosXOffset 0x9ce8
-#define GlintRasterPosXOffsetTag 0x039d
-#define GlintRasterPosXOffsetReg 1
-#define GlintRasterPosXOffsetOff 0x8ce8
-
-#define GlintRasterPosYOffset 0x9cf0
-#define GlintRasterPosYOffsetTag 0x039e
-#define GlintRasterPosYOffsetReg 1
-#define GlintRasterPosYOffsetOff 0x8cf0
-
-#define GlintAttenuationCutOff 0x9cf8
-#define GlintAttenuationCutOffTag 0x039f
-#define GlintAttenuationCutOffReg 1
-#define GlintAttenuationCutOffOff 0x8cf8
-
-#define GlintLight0Mode 0x9d00
-#define GlintLight0ModeTag 0x03a0
-#define GlintLight0ModeReg 1
-#define GlintLight0ModeOff 0x8d00
-
-#define GlintLight0AmbientIntensityRed 0x9d08
-#define GlintLight0AmbientIntensityRedTag 0x03a1
-#define GlintLight0AmbientIntensityRedReg 1
-#define GlintLight0AmbientIntensityRedOff 0x8d08
-
-#define GlintLight0AmbientIntensityGreen 0x9d10
-#define GlintLight0AmbientIntensityGreenTag 0x03a2
-#define GlintLight0AmbientIntensityGreenReg 1
-#define GlintLight0AmbientIntensityGreenOff 0x8d10
-
-#define GlintLight0AmbientIntensityBlue 0x9d18
-#define GlintLight0AmbientIntensityBlueTag 0x03a3
-#define GlintLight0AmbientIntensityBlueReg 1
-#define GlintLight0AmbientIntensityBlueOff 0x8d18
-
-#define GlintLight0DiffuseIntensityRed 0x9d20
-#define GlintLight0DiffuseIntensityRedTag 0x03a4
-#define GlintLight0DiffuseIntensityRedReg 1
-#define GlintLight0DiffuseIntensityRedOff 0x8d20
-
-#define GlintLight0DiffuseIntensityGreen 0x9d28
-#define GlintLight0DiffuseIntensityGreenTag 0x03a5
-#define GlintLight0DiffuseIntensityGreenReg 1
-#define GlintLight0DiffuseIntensityGreenOff 0x8d28
-
-#define GlintLight0DiffuseIntensityBlue 0x9d30
-#define GlintLight0DiffuseIntensityBlueTag 0x03a6
-#define GlintLight0DiffuseIntensityBlueReg 1
-#define GlintLight0DiffuseIntensityBlueOff 0x8d30
-
-#define GlintLight0SpecularIntensityRed 0x9d38
-#define GlintLight0SpecularIntensityRedTag 0x03a7
-#define GlintLight0SpecularIntensityRedReg 1
-#define GlintLight0SpecularIntensityRedOff 0x8d38
-
-#define GlintLight0SpecularIntensityGreen 0x9d40
-#define GlintLight0SpecularIntensityGreenTag 0x03a8
-#define GlintLight0SpecularIntensityGreenReg 1
-#define GlintLight0SpecularIntensityGreenOff 0x8d40
-
-#define GlintLight0SpecularIntensityBlue 0x9d48
-#define GlintLight0SpecularIntensityBlueTag 0x03a9
-#define GlintLight0SpecularIntensityBlueReg 1
-#define GlintLight0SpecularIntensityBlueOff 0x8d48
-
-#define GlintLight0PositionX 0x9d50
-#define GlintLight0PositionXTag 0x03aa
-#define GlintLight0PositionXReg 1
-#define GlintLight0PositionXOff 0x8d50
-
-#define GlintLight0PositionY 0x9d58
-#define GlintLight0PositionYTag 0x03ab
-#define GlintLight0PositionYReg 1
-#define GlintLight0PositionYOff 0x8d58
-
-#define GlintLight0PositionZ 0x9d60
-#define GlintLight0PositionZTag 0x03ac
-#define GlintLight0PositionZReg 1
-#define GlintLight0PositionZOff 0x8d60
-
-#define GlintLight0PositionW 0x9d68
-#define GlintLight0PositionWTag 0x03ad
-#define GlintLight0PositionWReg 1
-#define GlintLight0PositionWOff 0x8d68
-
-#define GlintLight0SpotlightDirectionX 0x9d70
-#define GlintLight0SpotlightDirectionXTag 0x03ae
-#define GlintLight0SpotlightDirectionXReg 1
-#define GlintLight0SpotlightDirectionXOff 0x8d70
-
-#define GlintLight0SpotlightDirectionY 0x9d78
-#define GlintLight0SpotlightDirectionYTag 0x03af
-#define GlintLight0SpotlightDirectionYReg 1
-#define GlintLight0SpotlightDirectionYOff 0x8d78
-
-#define GlintLight0SpotlightDirectionZ 0x9d80
-#define GlintLight0SpotlightDirectionZTag 0x03b0
-#define GlintLight0SpotlightDirectionZReg 1
-#define GlintLight0SpotlightDirectionZOff 0x8d80
-
-#define GlintLight0SpotlightExponent 0x9d88
-#define GlintLight0SpotlightExponentTag 0x03b1
-#define GlintLight0SpotlightExponentReg 1
-#define GlintLight0SpotlightExponentOff 0x8d88
-
-#define GlintLight0CosSpotlightCutoffAngle 0x9d90
-#define GlintLight0CosSpotlightCutoffAngleTag 0x03b2
-#define GlintLight0CosSpotlightCutoffAngleReg 1
-#define GlintLight0CosSpotlightCutoffAngleOff 0x8d90
-
-#define GlintLight0ConstantAttenuation 0x9d98
-#define GlintLight0ConstantAttenuationTag 0x03b3
-#define GlintLight0ConstantAttenuationReg 1
-#define GlintLight0ConstantAttenuationOff 0x8d98
-
-#define GlintLight0LinearAttenuation 0x9da0
-#define GlintLight0LinearAttenuationTag 0x03b4
-#define GlintLight0LinearAttenuationReg 1
-#define GlintLight0LinearAttenuationOff 0x8da0
-
-#define GlintLight0QuadraticAttenuation 0x9da8
-#define GlintLight0QuadraticAttenuationTag 0x03b5
-#define GlintLight0QuadraticAttenuationReg 1
-#define GlintLight0QuadraticAttenuationOff 0x8da8
-
-#define GlintLight1Mode 0x9db0
-#define GlintLight1ModeTag 0x03b6
-#define GlintLight1ModeReg 1
-#define GlintLight1ModeOff 0x8db0
-
-#define GlintLight1AmbientIntensityRed 0x9db8
-#define GlintLight1AmbientIntensityRedTag 0x03b7
-#define GlintLight1AmbientIntensityRedReg 1
-#define GlintLight1AmbientIntensityRedOff 0x8db8
-
-#define GlintLight1AmbientIntensityGreen 0x9dc0
-#define GlintLight1AmbientIntensityGreenTag 0x03b8
-#define GlintLight1AmbientIntensityGreenReg 1
-#define GlintLight1AmbientIntensityGreenOff 0x8dc0
-
-#define GlintLight1AmbientIntensityBlue 0x9dc8
-#define GlintLight1AmbientIntensityBlueTag 0x03b9
-#define GlintLight1AmbientIntensityBlueReg 1
-#define GlintLight1AmbientIntensityBlueOff 0x8dc8
-
-#define GlintLight1DiffuseIntensityRed 0x9dd0
-#define GlintLight1DiffuseIntensityRedTag 0x03ba
-#define GlintLight1DiffuseIntensityRedReg 1
-#define GlintLight1DiffuseIntensityRedOff 0x8dd0
-
-#define GlintLight1DiffuseIntensityGreen 0x9dd8
-#define GlintLight1DiffuseIntensityGreenTag 0x03bb
-#define GlintLight1DiffuseIntensityGreenReg 1
-#define GlintLight1DiffuseIntensityGreenOff 0x8dd8
-
-#define GlintLight1DiffuseIntensityBlue 0x9de0
-#define GlintLight1DiffuseIntensityBlueTag 0x03bc
-#define GlintLight1DiffuseIntensityBlueReg 1
-#define GlintLight1DiffuseIntensityBlueOff 0x8de0
-
-#define GlintLight1SpecularIntensityRed 0x9de8
-#define GlintLight1SpecularIntensityRedTag 0x03bd
-#define GlintLight1SpecularIntensityRedReg 1
-#define GlintLight1SpecularIntensityRedOff 0x8de8
-
-#define GlintLight1SpecularIntensityGreen 0x9df0
-#define GlintLight1SpecularIntensityGreenTag 0x03be
-#define GlintLight1SpecularIntensityGreenReg 1
-#define GlintLight1SpecularIntensityGreenOff 0x8df0
-
-#define GlintLight1SpecularIntensityBlue 0x9df8
-#define GlintLight1SpecularIntensityBlueTag 0x03bf
-#define GlintLight1SpecularIntensityBlueReg 1
-#define GlintLight1SpecularIntensityBlueOff 0x8df8
-
-#define GlintLight1PositionX 0x9e00
-#define GlintLight1PositionXTag 0x03c0
-#define GlintLight1PositionXReg 1
-#define GlintLight1PositionXOff 0x8e00
-
-#define GlintLight1PositionY 0x9e08
-#define GlintLight1PositionYTag 0x03c1
-#define GlintLight1PositionYReg 1
-#define GlintLight1PositionYOff 0x8e08
-
-#define GlintLight1PositionZ 0x9e10
-#define GlintLight1PositionZTag 0x03c2
-#define GlintLight1PositionZReg 1
-#define GlintLight1PositionZOff 0x8e10
-
-#define GlintLight1PositionW 0x9e18
-#define GlintLight1PositionWTag 0x03c3
-#define GlintLight1PositionWReg 1
-#define GlintLight1PositionWOff 0x8e18
-
-#define GlintLight1SpotlightDirectionX 0x9e20
-#define GlintLight1SpotlightDirectionXTag 0x03c4
-#define GlintLight1SpotlightDirectionXReg 1
-#define GlintLight1SpotlightDirectionXOff 0x8e20
-
-#define GlintLight1SpotlightDirectionY 0x9e28
-#define GlintLight1SpotlightDirectionYTag 0x03c5
-#define GlintLight1SpotlightDirectionYReg 1
-#define GlintLight1SpotlightDirectionYOff 0x8e28
-
-#define GlintLight1SpotlightDirectionZ 0x9e30
-#define GlintLight1SpotlightDirectionZTag 0x03c6
-#define GlintLight1SpotlightDirectionZReg 1
-#define GlintLight1SpotlightDirectionZOff 0x8e30
-
-#define GlintLight1SpotlightExponent 0x9e38
-#define GlintLight1SpotlightExponentTag 0x03c7
-#define GlintLight1SpotlightExponentReg 1
-#define GlintLight1SpotlightExponentOff 0x8e38
-
-#define GlintLight1CosSpotlightCutoffAngle 0x9e40
-#define GlintLight1CosSpotlightCutoffAngleTag 0x03c8
-#define GlintLight1CosSpotlightCutoffAngleReg 1
-#define GlintLight1CosSpotlightCutoffAngleOff 0x8e40
-
-#define GlintLight1ConstantAttenuation 0x9e48
-#define GlintLight1ConstantAttenuationTag 0x03c9
-#define GlintLight1ConstantAttenuationReg 1
-#define GlintLight1ConstantAttenuationOff 0x8e48
-
-#define GlintLight1LinearAttenuation 0x9e50
-#define GlintLight1LinearAttenuationTag 0x03ca
-#define GlintLight1LinearAttenuationReg 1
-#define GlintLight1LinearAttenuationOff 0x8e50
-
-#define GlintLight1QuadraticAttenuation 0x9e58
-#define GlintLight1QuadraticAttenuationTag 0x03cb
-#define GlintLight1QuadraticAttenuationReg 1
-#define GlintLight1QuadraticAttenuationOff 0x8e58
-
-#define GlintLight2Mode 0x9e60
-#define GlintLight2ModeTag 0x03cc
-#define GlintLight2ModeReg 1
-#define GlintLight2ModeOff 0x8e60
-
-#define GlintLight2AmbientIntensityRed 0x9e68
-#define GlintLight2AmbientIntensityRedTag 0x03cd
-#define GlintLight2AmbientIntensityRedReg 1
-#define GlintLight2AmbientIntensityRedOff 0x8e68
-
-#define GlintLight2AmbientIntensityGreen 0x9e70
-#define GlintLight2AmbientIntensityGreenTag 0x03ce
-#define GlintLight2AmbientIntensityGreenReg 1
-#define GlintLight2AmbientIntensityGreenOff 0x8e70
-
-#define GlintLight2AmbientIntensityBlue 0x9e78
-#define GlintLight2AmbientIntensityBlueTag 0x03cf
-#define GlintLight2AmbientIntensityBlueReg 1
-#define GlintLight2AmbientIntensityBlueOff 0x8e78
-
-#define GlintLight2DiffuseIntensityRed 0x9e80
-#define GlintLight2DiffuseIntensityRedTag 0x03d0
-#define GlintLight2DiffuseIntensityRedReg 1
-#define GlintLight2DiffuseIntensityRedOff 0x8e80
-
-#define GlintLight2DiffuseIntensityGreen 0x9e88
-#define GlintLight2DiffuseIntensityGreenTag 0x03d1
-#define GlintLight2DiffuseIntensityGreenReg 1
-#define GlintLight2DiffuseIntensityGreenOff 0x8e88
-
-#define GlintLight2DiffuseIntensityBlue 0x9e90
-#define GlintLight2DiffuseIntensityBlueTag 0x03d2
-#define GlintLight2DiffuseIntensityBlueReg 1
-#define GlintLight2DiffuseIntensityBlueOff 0x8e90
-
-#define GlintLight2SpecularIntensityRed 0x9e98
-#define GlintLight2SpecularIntensityRedTag 0x03d3
-#define GlintLight2SpecularIntensityRedReg 1
-#define GlintLight2SpecularIntensityRedOff 0x8e98
-
-#define GlintLight2SpecularIntensityGreen 0x9ea0
-#define GlintLight2SpecularIntensityGreenTag 0x03d4
-#define GlintLight2SpecularIntensityGreenReg 1
-#define GlintLight2SpecularIntensityGreenOff 0x8ea0
-
-#define GlintLight2SpecularIntensityBlue 0x9ea8
-#define GlintLight2SpecularIntensityBlueTag 0x03d5
-#define GlintLight2SpecularIntensityBlueReg 1
-#define GlintLight2SpecularIntensityBlueOff 0x8ea8
-
-#define GlintLight2PositionX 0x9eb0
-#define GlintLight2PositionXTag 0x03d6
-#define GlintLight2PositionXReg 1
-#define GlintLight2PositionXOff 0x8eb0
-
-#define GlintLight2PositionY 0x9eb8
-#define GlintLight2PositionYTag 0x03d7
-#define GlintLight2PositionYReg 1
-#define GlintLight2PositionYOff 0x8eb8
-
-#define GlintLight2PositionZ 0x9ec0
-#define GlintLight2PositionZTag 0x03d8
-#define GlintLight2PositionZReg 1
-#define GlintLight2PositionZOff 0x8ec0
-
-#define GlintLight2PositionW 0x9ec8
-#define GlintLight2PositionWTag 0x03d9
-#define GlintLight2PositionWReg 1
-#define GlintLight2PositionWOff 0x8ec8
-
-#define GlintLight2SpotlightDirectionX 0x9ed0
-#define GlintLight2SpotlightDirectionXTag 0x03da
-#define GlintLight2SpotlightDirectionXReg 1
-#define GlintLight2SpotlightDirectionXOff 0x8ed0
-
-#define GlintLight2SpotlightDirectionY 0x9ed8
-#define GlintLight2SpotlightDirectionYTag 0x03db
-#define GlintLight2SpotlightDirectionYReg 1
-#define GlintLight2SpotlightDirectionYOff 0x8ed8
-
-#define GlintLight2SpotlightDirectionZ 0x9ee0
-#define GlintLight2SpotlightDirectionZTag 0x03dc
-#define GlintLight2SpotlightDirectionZReg 1
-#define GlintLight2SpotlightDirectionZOff 0x8ee0
-
-#define GlintLight2SpotlightExponent 0x9ee8
-#define GlintLight2SpotlightExponentTag 0x03dd
-#define GlintLight2SpotlightExponentReg 1
-#define GlintLight2SpotlightExponentOff 0x8ee8
-
-#define GlintLight2CosSpotlightCutoffAngle 0x9ef0
-#define GlintLight2CosSpotlightCutoffAngleTag 0x03de
-#define GlintLight2CosSpotlightCutoffAngleReg 1
-#define GlintLight2CosSpotlightCutoffAngleOff 0x8ef0
-
-#define GlintLight2ConstantAttenuation 0x9ef8
-#define GlintLight2ConstantAttenuationTag 0x03df
-#define GlintLight2ConstantAttenuationReg 1
-#define GlintLight2ConstantAttenuationOff 0x8ef8
-
-#define GlintLight2LinearAttenuation 0x9f00
-#define GlintLight2LinearAttenuationTag 0x03e0
-#define GlintLight2LinearAttenuationReg 1
-#define GlintLight2LinearAttenuationOff 0x8f00
-
-#define GlintLight2QuadraticAttenuation 0x9f08
-#define GlintLight2QuadraticAttenuationTag 0x03e1
-#define GlintLight2QuadraticAttenuationReg 1
-#define GlintLight2QuadraticAttenuationOff 0x8f08
-
-#define GlintLight3Mode 0x9f10
-#define GlintLight3ModeTag 0x03e2
-#define GlintLight3ModeReg 1
-#define GlintLight3ModeOff 0x8f10
-
-#define GlintLight3AmbientIntensityRed 0x9f18
-#define GlintLight3AmbientIntensityRedTag 0x03e3
-#define GlintLight3AmbientIntensityRedReg 1
-#define GlintLight3AmbientIntensityRedOff 0x8f18
-
-#define GlintLight3AmbientIntensityGreen 0x9f20
-#define GlintLight3AmbientIntensityGreenTag 0x03e4
-#define GlintLight3AmbientIntensityGreenReg 1
-#define GlintLight3AmbientIntensityGreenOff 0x8f20
-
-#define GlintLight3AmbientIntensityBlue 0x9f28
-#define GlintLight3AmbientIntensityBlueTag 0x03e5
-#define GlintLight3AmbientIntensityBlueReg 1
-#define GlintLight3AmbientIntensityBlueOff 0x8f28
-
-#define GlintLight3DiffuseIntensityRed 0x9f30
-#define GlintLight3DiffuseIntensityRedTag 0x03e6
-#define GlintLight3DiffuseIntensityRedReg 1
-#define GlintLight3DiffuseIntensityRedOff 0x8f30
-
-#define GlintLight3DiffuseIntensityGreen 0x9f38
-#define GlintLight3DiffuseIntensityGreenTag 0x03e7
-#define GlintLight3DiffuseIntensityGreenReg 1
-#define GlintLight3DiffuseIntensityGreenOff 0x8f38
-
-#define GlintLight3DiffuseIntensityBlue 0x9f40
-#define GlintLight3DiffuseIntensityBlueTag 0x03e8
-#define GlintLight3DiffuseIntensityBlueReg 1
-#define GlintLight3DiffuseIntensityBlueOff 0x8f40
-
-#define GlintLight3SpecularIntensityRed 0x9f48
-#define GlintLight3SpecularIntensityRedTag 0x03e9
-#define GlintLight3SpecularIntensityRedReg 1
-#define GlintLight3SpecularIntensityRedOff 0x8f48
-
-#define GlintLight3SpecularIntensityGreen 0x9f50
-#define GlintLight3SpecularIntensityGreenTag 0x03ea
-#define GlintLight3SpecularIntensityGreenReg 1
-#define GlintLight3SpecularIntensityGreenOff 0x8f50
-
-#define GlintLight3SpecularIntensityBlue 0x9f58
-#define GlintLight3SpecularIntensityBlueTag 0x03eb
-#define GlintLight3SpecularIntensityBlueReg 1
-#define GlintLight3SpecularIntensityBlueOff 0x8f58
-
-#define GlintLight3PositionX 0x9f60
-#define GlintLight3PositionXTag 0x03ec
-#define GlintLight3PositionXReg 1
-#define GlintLight3PositionXOff 0x8f60
-
-#define GlintLight3PositionY 0x9f68
-#define GlintLight3PositionYTag 0x03ed
-#define GlintLight3PositionYReg 1
-#define GlintLight3PositionYOff 0x8f68
-
-#define GlintLight3PositionZ 0x9f70
-#define GlintLight3PositionZTag 0x03ee
-#define GlintLight3PositionZReg 1
-#define GlintLight3PositionZOff 0x8f70
-
-#define GlintLight3PositionW 0x9f78
-#define GlintLight3PositionWTag 0x03ef
-#define GlintLight3PositionWReg 1
-#define GlintLight3PositionWOff 0x8f78
-
-#define GlintLight3SpotlightDirectionX 0x9f80
-#define GlintLight3SpotlightDirectionXTag 0x03f0
-#define GlintLight3SpotlightDirectionXReg 1
-#define GlintLight3SpotlightDirectionXOff 0x8f80
-
-#define GlintLight3SpotlightDirectionY 0x9f88
-#define GlintLight3SpotlightDirectionYTag 0x03f1
-#define GlintLight3SpotlightDirectionYReg 1
-#define GlintLight3SpotlightDirectionYOff 0x8f88
-
-#define GlintLight3SpotlightDirectionZ 0x9f90
-#define GlintLight3SpotlightDirectionZTag 0x03f2
-#define GlintLight3SpotlightDirectionZReg 1
-#define GlintLight3SpotlightDirectionZOff 0x8f90
-
-#define GlintLight3SpotlightExponent 0x9f98
-#define GlintLight3SpotlightExponentTag 0x03f3
-#define GlintLight3SpotlightExponentReg 1
-#define GlintLight3SpotlightExponentOff 0x8f98
-
-#define GlintLight3CosSpotlightCutoffAngle 0x9fa0
-#define GlintLight3CosSpotlightCutoffAngleTag 0x03f4
-#define GlintLight3CosSpotlightCutoffAngleReg 1
-#define GlintLight3CosSpotlightCutoffAngleOff 0x8fa0
-
-#define GlintLight3ConstantAttenuation 0x9fa8
-#define GlintLight3ConstantAttenuationTag 0x03f5
-#define GlintLight3ConstantAttenuationReg 1
-#define GlintLight3ConstantAttenuationOff 0x8fa8
-
-#define GlintLight3LinearAttenuation 0x9fb0
-#define GlintLight3LinearAttenuationTag 0x03f6
-#define GlintLight3LinearAttenuationReg 1
-#define GlintLight3LinearAttenuationOff 0x8fb0
-
-#define GlintLight3QuadraticAttenuation 0x9fb8
-#define GlintLight3QuadraticAttenuationTag 0x03f7
-#define GlintLight3QuadraticAttenuationReg 1
-#define GlintLight3QuadraticAttenuationOff 0x8fb8
-
-#define GlintLight4Mode 0x9fc0
-#define GlintLight4ModeTag 0x03f8
-#define GlintLight4ModeReg 1
-#define GlintLight4ModeOff 0x8fc0
-
-#define GlintLight4AmbientIntensityRed 0x9fc8
-#define GlintLight4AmbientIntensityRedTag 0x03f9
-#define GlintLight4AmbientIntensityRedReg 1
-#define GlintLight4AmbientIntensityRedOff 0x8fc8
-
-#define GlintLight4AmbientIntensityGreen 0x9fd0
-#define GlintLight4AmbientIntensityGreenTag 0x03fa
-#define GlintLight4AmbientIntensityGreenReg 1
-#define GlintLight4AmbientIntensityGreenOff 0x8fd0
-
-#define GlintLight4AmbientIntensityBlue 0x9fd8
-#define GlintLight4AmbientIntensityBlueTag 0x03fb
-#define GlintLight4AmbientIntensityBlueReg 1
-#define GlintLight4AmbientIntensityBlueOff 0x8fd8
-
-#define GlintLight4DiffuseIntensityRed 0x9fe0
-#define GlintLight4DiffuseIntensityRedTag 0x03fc
-#define GlintLight4DiffuseIntensityRedReg 1
-#define GlintLight4DiffuseIntensityRedOff 0x8fe0
-
-#define GlintLight4DiffuseIntensityGreen 0x9fe8
-#define GlintLight4DiffuseIntensityGreenTag 0x03fd
-#define GlintLight4DiffuseIntensityGreenReg 1
-#define GlintLight4DiffuseIntensityGreenOff 0x8fe8
-
-#define GlintLight4DiffuseIntensityBlue 0x9ff0
-#define GlintLight4DiffuseIntensityBlueTag 0x03fe
-#define GlintLight4DiffuseIntensityBlueReg 1
-#define GlintLight4DiffuseIntensityBlueOff 0x8ff0
-
-#define GlintLight4SpecularIntensityRed 0x9ff8
-#define GlintLight4SpecularIntensityRedTag 0x03ff
-#define GlintLight4SpecularIntensityRedReg 1
-#define GlintLight4SpecularIntensityRedOff 0x8ff8
-
-#define GlintLight4SpecularIntensityGreen 0xa000
-#define GlintLight4SpecularIntensityGreenTag 0x0400
-#define GlintLight4SpecularIntensityGreenReg 1
-#define GlintLight4SpecularIntensityGreenOff 0x9000
-
-#define GlintLight4SpecularIntensityBlue 0xa008
-#define GlintLight4SpecularIntensityBlueTag 0x0401
-#define GlintLight4SpecularIntensityBlueReg 1
-#define GlintLight4SpecularIntensityBlueOff 0x9008
-
-#define GlintLight4PositionX 0xa010
-#define GlintLight4PositionXTag 0x0402
-#define GlintLight4PositionXReg 1
-#define GlintLight4PositionXOff 0x9010
-
-#define GlintLight4PositionY 0xa018
-#define GlintLight4PositionYTag 0x0403
-#define GlintLight4PositionYReg 1
-#define GlintLight4PositionYOff 0x9018
-
-#define GlintLight4PositionZ 0xa020
-#define GlintLight4PositionZTag 0x0404
-#define GlintLight4PositionZReg 1
-#define GlintLight4PositionZOff 0x9020
-
-#define GlintLight4PositionW 0xa028
-#define GlintLight4PositionWTag 0x0405
-#define GlintLight4PositionWReg 1
-#define GlintLight4PositionWOff 0x9028
-
-#define GlintLight4SpotlightDirectionX 0xa030
-#define GlintLight4SpotlightDirectionXTag 0x0406
-#define GlintLight4SpotlightDirectionXReg 1
-#define GlintLight4SpotlightDirectionXOff 0x9030
-
-#define GlintLight4SpotlightDirectionY 0xa038
-#define GlintLight4SpotlightDirectionYTag 0x0407
-#define GlintLight4SpotlightDirectionYReg 1
-#define GlintLight4SpotlightDirectionYOff 0x9038
-
-#define GlintLight4SpotlightDirectionZ 0xa040
-#define GlintLight4SpotlightDirectionZTag 0x0408
-#define GlintLight4SpotlightDirectionZReg 1
-#define GlintLight4SpotlightDirectionZOff 0x9040
-
-#define GlintLight4SpotlightExponent 0xa048
-#define GlintLight4SpotlightExponentTag 0x0409
-#define GlintLight4SpotlightExponentReg 1
-#define GlintLight4SpotlightExponentOff 0x9048
-
-#define GlintLight4CosSpotlightCutoffAngle 0xa050
-#define GlintLight4CosSpotlightCutoffAngleTag 0x040a
-#define GlintLight4CosSpotlightCutoffAngleReg 1
-#define GlintLight4CosSpotlightCutoffAngleOff 0x9050
-
-#define GlintLight4ConstantAttenuation 0xa058
-#define GlintLight4ConstantAttenuationTag 0x040b
-#define GlintLight4ConstantAttenuationReg 1
-#define GlintLight4ConstantAttenuationOff 0x9058
-
-#define GlintLight4LinearAttenuation 0xa060
-#define GlintLight4LinearAttenuationTag 0x040c
-#define GlintLight4LinearAttenuationReg 1
-#define GlintLight4LinearAttenuationOff 0x9060
-
-#define GlintLight4QuadraticAttenuation 0xa068
-#define GlintLight4QuadraticAttenuationTag 0x040d
-#define GlintLight4QuadraticAttenuationReg 1
-#define GlintLight4QuadraticAttenuationOff 0x9068
-
-#define GlintLight5Mode 0xa070
-#define GlintLight5ModeTag 0x040e
-#define GlintLight5ModeReg 1
-#define GlintLight5ModeOff 0x9070
-
-#define GlintLight5AmbientIntensityRed 0xa078
-#define GlintLight5AmbientIntensityRedTag 0x040f
-#define GlintLight5AmbientIntensityRedReg 1
-#define GlintLight5AmbientIntensityRedOff 0x9078
-
-#define GlintLight5AmbientIntensityGreen 0xa080
-#define GlintLight5AmbientIntensityGreenTag 0x0410
-#define GlintLight5AmbientIntensityGreenReg 1
-#define GlintLight5AmbientIntensityGreenOff 0x9080
-
-#define GlintLight5AmbientIntensityBlue 0xa088
-#define GlintLight5AmbientIntensityBlueTag 0x0411
-#define GlintLight5AmbientIntensityBlueReg 1
-#define GlintLight5AmbientIntensityBlueOff 0x9088
-
-#define GlintLight5DiffuseIntensityRed 0xa090
-#define GlintLight5DiffuseIntensityRedTag 0x0412
-#define GlintLight5DiffuseIntensityRedReg 1
-#define GlintLight5DiffuseIntensityRedOff 0x9090
-
-#define GlintLight5DiffuseIntensityGreen 0xa098
-#define GlintLight5DiffuseIntensityGreenTag 0x0413
-#define GlintLight5DiffuseIntensityGreenReg 1
-#define GlintLight5DiffuseIntensityGreenOff 0x9098
-
-#define GlintLight5DiffuseIntensityBlue 0xa0a0
-#define GlintLight5DiffuseIntensityBlueTag 0x0414
-#define GlintLight5DiffuseIntensityBlueReg 1
-#define GlintLight5DiffuseIntensityBlueOff 0x90a0
-
-#define GlintLight5SpecularIntensityRed 0xa0a8
-#define GlintLight5SpecularIntensityRedTag 0x0415
-#define GlintLight5SpecularIntensityRedReg 1
-#define GlintLight5SpecularIntensityRedOff 0x90a8
-
-#define GlintLight5SpecularIntensityGreen 0xa0b0
-#define GlintLight5SpecularIntensityGreenTag 0x0416
-#define GlintLight5SpecularIntensityGreenReg 1
-#define GlintLight5SpecularIntensityGreenOff 0x90b0
-
-#define GlintLight5SpecularIntensityBlue 0xa0b8
-#define GlintLight5SpecularIntensityBlueTag 0x0417
-#define GlintLight5SpecularIntensityBlueReg 1
-#define GlintLight5SpecularIntensityBlueOff 0x90b8
-
-#define GlintLight5PositionX 0xa0c0
-#define GlintLight5PositionXTag 0x0418
-#define GlintLight5PositionXReg 1
-#define GlintLight5PositionXOff 0x90c0
-
-#define GlintLight5PositionY 0xa0c8
-#define GlintLight5PositionYTag 0x0419
-#define GlintLight5PositionYReg 1
-#define GlintLight5PositionYOff 0x90c8
-
-#define GlintLight5PositionZ 0xa0d0
-#define GlintLight5PositionZTag 0x041a
-#define GlintLight5PositionZReg 1
-#define GlintLight5PositionZOff 0x90d0
-
-#define GlintLight5PositionW 0xa0d8
-#define GlintLight5PositionWTag 0x041b
-#define GlintLight5PositionWReg 1
-#define GlintLight5PositionWOff 0x90d8
-
-#define GlintLight5SpotlightDirectionX 0xa0e0
-#define GlintLight5SpotlightDirectionXTag 0x041c
-#define GlintLight5SpotlightDirectionXReg 1
-#define GlintLight5SpotlightDirectionXOff 0x90e0
-
-#define GlintLight5SpotlightDirectionY 0xa0e8
-#define GlintLight5SpotlightDirectionYTag 0x041d
-#define GlintLight5SpotlightDirectionYReg 1
-#define GlintLight5SpotlightDirectionYOff 0x90e8
-
-#define GlintLight5SpotlightDirectionZ 0xa0f0
-#define GlintLight5SpotlightDirectionZTag 0x041e
-#define GlintLight5SpotlightDirectionZReg 1
-#define GlintLight5SpotlightDirectionZOff 0x90f0
-
-#define GlintLight5SpotlightExponent 0xa0f8
-#define GlintLight5SpotlightExponentTag 0x041f
-#define GlintLight5SpotlightExponentReg 1
-#define GlintLight5SpotlightExponentOff 0x90f8
-
-#define GlintLight5CosSpotlightCutoffAngle 0xa100
-#define GlintLight5CosSpotlightCutoffAngleTag 0x0420
-#define GlintLight5CosSpotlightCutoffAngleReg 1
-#define GlintLight5CosSpotlightCutoffAngleOff 0x9100
-
-#define GlintLight5ConstantAttenuation 0xa108
-#define GlintLight5ConstantAttenuationTag 0x0421
-#define GlintLight5ConstantAttenuationReg 1
-#define GlintLight5ConstantAttenuationOff 0x9108
-
-#define GlintLight5LinearAttenuation 0xa110
-#define GlintLight5LinearAttenuationTag 0x0422
-#define GlintLight5LinearAttenuationReg 1
-#define GlintLight5LinearAttenuationOff 0x9110
-
-#define GlintLight5QuadraticAttenuation 0xa118
-#define GlintLight5QuadraticAttenuationTag 0x0423
-#define GlintLight5QuadraticAttenuationReg 1
-#define GlintLight5QuadraticAttenuationOff 0x9118
-
-#define GlintLight6Mode 0xa120
-#define GlintLight6ModeTag 0x0424
-#define GlintLight6ModeReg 1
-#define GlintLight6ModeOff 0x9120
-
-#define GlintLight6AmbientIntensityRed 0xa128
-#define GlintLight6AmbientIntensityRedTag 0x0425
-#define GlintLight6AmbientIntensityRedReg 1
-#define GlintLight6AmbientIntensityRedOff 0x9128
-
-#define GlintLight6AmbientIntensityGreen 0xa130
-#define GlintLight6AmbientIntensityGreenTag 0x0426
-#define GlintLight6AmbientIntensityGreenReg 1
-#define GlintLight6AmbientIntensityGreenOff 0x9130
-
-#define GlintLight6AmbientIntensityBlue 0xa138
-#define GlintLight6AmbientIntensityBlueTag 0x0427
-#define GlintLight6AmbientIntensityBlueReg 1
-#define GlintLight6AmbientIntensityBlueOff 0x9138
-
-#define GlintLight6DiffuseIntensityRed 0xa140
-#define GlintLight6DiffuseIntensityRedTag 0x0428
-#define GlintLight6DiffuseIntensityRedReg 1
-#define GlintLight6DiffuseIntensityRedOff 0x9140
-
-#define GlintLight6DiffuseIntensityGreen 0xa148
-#define GlintLight6DiffuseIntensityGreenTag 0x0429
-#define GlintLight6DiffuseIntensityGreenReg 1
-#define GlintLight6DiffuseIntensityGreenOff 0x9148
-
-#define GlintLight6DiffuseIntensityBlue 0xa150
-#define GlintLight6DiffuseIntensityBlueTag 0x042a
-#define GlintLight6DiffuseIntensityBlueReg 1
-#define GlintLight6DiffuseIntensityBlueOff 0x9150
-
-#define GlintLight6SpecularIntensityRed 0xa158
-#define GlintLight6SpecularIntensityRedTag 0x042b
-#define GlintLight6SpecularIntensityRedReg 1
-#define GlintLight6SpecularIntensityRedOff 0x9158
-
-#define GlintLight6SpecularIntensityGreen 0xa160
-#define GlintLight6SpecularIntensityGreenTag 0x042c
-#define GlintLight6SpecularIntensityGreenReg 1
-#define GlintLight6SpecularIntensityGreenOff 0x9160
-
-#define GlintLight6SpecularIntensityBlue 0xa168
-#define GlintLight6SpecularIntensityBlueTag 0x042d
-#define GlintLight6SpecularIntensityBlueReg 1
-#define GlintLight6SpecularIntensityBlueOff 0x9168
-
-#define GlintLight6PositionX 0xa170
-#define GlintLight6PositionXTag 0x042e
-#define GlintLight6PositionXReg 1
-#define GlintLight6PositionXOff 0x9170
-
-#define GlintLight6PositionY 0xa178
-#define GlintLight6PositionYTag 0x042f
-#define GlintLight6PositionYReg 1
-#define GlintLight6PositionYOff 0x9178
-
-#define GlintLight6PositionZ 0xa180
-#define GlintLight6PositionZTag 0x0430
-#define GlintLight6PositionZReg 1
-#define GlintLight6PositionZOff 0x9180
-
-#define GlintLight6PositionW 0xa188
-#define GlintLight6PositionWTag 0x0431
-#define GlintLight6PositionWReg 1
-#define GlintLight6PositionWOff 0x9188
-
-#define GlintLight6SpotlightDirectionX 0xa190
-#define GlintLight6SpotlightDirectionXTag 0x0432
-#define GlintLight6SpotlightDirectionXReg 1
-#define GlintLight6SpotlightDirectionXOff 0x9190
-
-#define GlintLight6SpotlightDirectionY 0xa198
-#define GlintLight6SpotlightDirectionYTag 0x0433
-#define GlintLight6SpotlightDirectionYReg 1
-#define GlintLight6SpotlightDirectionYOff 0x9198
-
-#define GlintLight6SpotlightDirectionZ 0xa1a0
-#define GlintLight6SpotlightDirectionZTag 0x0434
-#define GlintLight6SpotlightDirectionZReg 1
-#define GlintLight6SpotlightDirectionZOff 0x91a0
-
-#define GlintLight6SpotlightExponent 0xa1a8
-#define GlintLight6SpotlightExponentTag 0x0435
-#define GlintLight6SpotlightExponentReg 1
-#define GlintLight6SpotlightExponentOff 0x91a8
-
-#define GlintLight6CosSpotlightCutoffAngle 0xa1b0
-#define GlintLight6CosSpotlightCutoffAngleTag 0x0436
-#define GlintLight6CosSpotlightCutoffAngleReg 1
-#define GlintLight6CosSpotlightCutoffAngleOff 0x91b0
-
-#define GlintLight6ConstantAttenuation 0xa1b8
-#define GlintLight6ConstantAttenuationTag 0x0437
-#define GlintLight6ConstantAttenuationReg 1
-#define GlintLight6ConstantAttenuationOff 0x91b8
-
-#define GlintLight6LinearAttenuation 0xa1c0
-#define GlintLight6LinearAttenuationTag 0x0438
-#define GlintLight6LinearAttenuationReg 1
-#define GlintLight6LinearAttenuationOff 0x91c0
-
-#define GlintLight6QuadraticAttenuation 0xa1c8
-#define GlintLight6QuadraticAttenuationTag 0x0439
-#define GlintLight6QuadraticAttenuationReg 1
-#define GlintLight6QuadraticAttenuationOff 0x91c8
-
-#define GlintLight7Mode 0xa1d0
-#define GlintLight7ModeTag 0x043a
-#define GlintLight7ModeReg 1
-#define GlintLight7ModeOff 0x91d0
-
-#define GlintLight7AmbientIntensityRed 0xa1d8
-#define GlintLight7AmbientIntensityRedTag 0x043b
-#define GlintLight7AmbientIntensityRedReg 1
-#define GlintLight7AmbientIntensityRedOff 0x91d8
-
-#define GlintLight7AmbientIntensityGreen 0xa1e0
-#define GlintLight7AmbientIntensityGreenTag 0x043c
-#define GlintLight7AmbientIntensityGreenReg 1
-#define GlintLight7AmbientIntensityGreenOff 0x91e0
-
-#define GlintLight7AmbientIntensityBlue 0xa1e8
-#define GlintLight7AmbientIntensityBlueTag 0x043d
-#define GlintLight7AmbientIntensityBlueReg 1
-#define GlintLight7AmbientIntensityBlueOff 0x91e8
-
-#define GlintLight7DiffuseIntensityRed 0xa1f0
-#define GlintLight7DiffuseIntensityRedTag 0x043e
-#define GlintLight7DiffuseIntensityRedReg 1
-#define GlintLight7DiffuseIntensityRedOff 0x91f0
-
-#define GlintLight7DiffuseIntensityGreen 0xa1f8
-#define GlintLight7DiffuseIntensityGreenTag 0x043f
-#define GlintLight7DiffuseIntensityGreenReg 1
-#define GlintLight7DiffuseIntensityGreenOff 0x91f8
-
-#define GlintLight7DiffuseIntensityBlue 0xa200
-#define GlintLight7DiffuseIntensityBlueTag 0x0440
-#define GlintLight7DiffuseIntensityBlueReg 1
-#define GlintLight7DiffuseIntensityBlueOff 0x9200
-
-#define GlintLight7SpecularIntensityRed 0xa208
-#define GlintLight7SpecularIntensityRedTag 0x0441
-#define GlintLight7SpecularIntensityRedReg 1
-#define GlintLight7SpecularIntensityRedOff 0x9208
-
-#define GlintLight7SpecularIntensityGreen 0xa210
-#define GlintLight7SpecularIntensityGreenTag 0x0442
-#define GlintLight7SpecularIntensityGreenReg 1
-#define GlintLight7SpecularIntensityGreenOff 0x9210
-
-#define GlintLight7SpecularIntensityBlue 0xa218
-#define GlintLight7SpecularIntensityBlueTag 0x0443
-#define GlintLight7SpecularIntensityBlueReg 1
-#define GlintLight7SpecularIntensityBlueOff 0x9218
-
-#define GlintLight7PositionX 0xa220
-#define GlintLight7PositionXTag 0x0444
-#define GlintLight7PositionXReg 1
-#define GlintLight7PositionXOff 0x9220
-
-#define GlintLight7PositionY 0xa228
-#define GlintLight7PositionYTag 0x0445
-#define GlintLight7PositionYReg 1
-#define GlintLight7PositionYOff 0x9228
-
-#define GlintLight7PositionZ 0xa230
-#define GlintLight7PositionZTag 0x0446
-#define GlintLight7PositionZReg 1
-#define GlintLight7PositionZOff 0x9230
-
-#define GlintLight7PositionW 0xa238
-#define GlintLight7PositionWTag 0x0447
-#define GlintLight7PositionWReg 1
-#define GlintLight7PositionWOff 0x9238
-
-#define GlintLight7SpotlightDirectionX 0xa240
-#define GlintLight7SpotlightDirectionXTag 0x0448
-#define GlintLight7SpotlightDirectionXReg 1
-#define GlintLight7SpotlightDirectionXOff 0x9240
-
-#define GlintLight7SpotlightDirectionY 0xa248
-#define GlintLight7SpotlightDirectionYTag 0x0449
-#define GlintLight7SpotlightDirectionYReg 1
-#define GlintLight7SpotlightDirectionYOff 0x9248
-
-#define GlintLight7SpotlightDirectionZ 0xa250
-#define GlintLight7SpotlightDirectionZTag 0x044a
-#define GlintLight7SpotlightDirectionZReg 1
-#define GlintLight7SpotlightDirectionZOff 0x9250
-
-#define GlintLight7SpotlightExponent 0xa258
-#define GlintLight7SpotlightExponentTag 0x044b
-#define GlintLight7SpotlightExponentReg 1
-#define GlintLight7SpotlightExponentOff 0x9258
-
-#define GlintLight7CosSpotlightCutoffAngle 0xa260
-#define GlintLight7CosSpotlightCutoffAngleTag 0x044c
-#define GlintLight7CosSpotlightCutoffAngleReg 1
-#define GlintLight7CosSpotlightCutoffAngleOff 0x9260
-
-#define GlintLight7ConstantAttenuation 0xa268
-#define GlintLight7ConstantAttenuationTag 0x044d
-#define GlintLight7ConstantAttenuationReg 1
-#define GlintLight7ConstantAttenuationOff 0x9268
-
-#define GlintLight7LinearAttenuation 0xa270
-#define GlintLight7LinearAttenuationTag 0x044e
-#define GlintLight7LinearAttenuationReg 1
-#define GlintLight7LinearAttenuationOff 0x9270
-
-#define GlintLight7QuadraticAttenuation 0xa278
-#define GlintLight7QuadraticAttenuationTag 0x044f
-#define GlintLight7QuadraticAttenuationReg 1
-#define GlintLight7QuadraticAttenuationOff 0x9278
-
-#define GlintLight8Mode 0xa280
-#define GlintLight8ModeTag 0x0450
-#define GlintLight8ModeReg 1
-#define GlintLight8ModeOff 0x9280
-
-#define GlintLight8AmbientIntensityRed 0xa288
-#define GlintLight8AmbientIntensityRedTag 0x0451
-#define GlintLight8AmbientIntensityRedReg 1
-#define GlintLight8AmbientIntensityRedOff 0x9288
-
-#define GlintLight8AmbientIntensityGreen 0xa290
-#define GlintLight8AmbientIntensityGreenTag 0x0452
-#define GlintLight8AmbientIntensityGreenReg 1
-#define GlintLight8AmbientIntensityGreenOff 0x9290
-
-#define GlintLight8AmbientIntensityBlue 0xa298
-#define GlintLight8AmbientIntensityBlueTag 0x0453
-#define GlintLight8AmbientIntensityBlueReg 1
-#define GlintLight8AmbientIntensityBlueOff 0x9298
-
-#define GlintLight8DiffuseIntensityRed 0xa2a0
-#define GlintLight8DiffuseIntensityRedTag 0x0454
-#define GlintLight8DiffuseIntensityRedReg 1
-#define GlintLight8DiffuseIntensityRedOff 0x92a0
-
-#define GlintLight8DiffuseIntensityGreen 0xa2a8
-#define GlintLight8DiffuseIntensityGreenTag 0x0455
-#define GlintLight8DiffuseIntensityGreenReg 1
-#define GlintLight8DiffuseIntensityGreenOff 0x92a8
-
-#define GlintLight8DiffuseIntensityBlue 0xa2b0
-#define GlintLight8DiffuseIntensityBlueTag 0x0456
-#define GlintLight8DiffuseIntensityBlueReg 1
-#define GlintLight8DiffuseIntensityBlueOff 0x92b0
-
-#define GlintLight8SpecularIntensityRed 0xa2b8
-#define GlintLight8SpecularIntensityRedTag 0x0457
-#define GlintLight8SpecularIntensityRedReg 1
-#define GlintLight8SpecularIntensityRedOff 0x92b8
-
-#define GlintLight8SpecularIntensityGreen 0xa2c0
-#define GlintLight8SpecularIntensityGreenTag 0x0458
-#define GlintLight8SpecularIntensityGreenReg 1
-#define GlintLight8SpecularIntensityGreenOff 0x92c0
-
-#define GlintLight8SpecularIntensityBlue 0xa2c8
-#define GlintLight8SpecularIntensityBlueTag 0x0459
-#define GlintLight8SpecularIntensityBlueReg 1
-#define GlintLight8SpecularIntensityBlueOff 0x92c8
-
-#define GlintLight8PositionX 0xa2d0
-#define GlintLight8PositionXTag 0x045a
-#define GlintLight8PositionXReg 1
-#define GlintLight8PositionXOff 0x92d0
-
-#define GlintLight8PositionY 0xa2d8
-#define GlintLight8PositionYTag 0x045b
-#define GlintLight8PositionYReg 1
-#define GlintLight8PositionYOff 0x92d8
-
-#define GlintLight8PositionZ 0xa2e0
-#define GlintLight8PositionZTag 0x045c
-#define GlintLight8PositionZReg 1
-#define GlintLight8PositionZOff 0x92e0
-
-#define GlintLight8PositionW 0xa2e8
-#define GlintLight8PositionWTag 0x045d
-#define GlintLight8PositionWReg 1
-#define GlintLight8PositionWOff 0x92e8
-
-#define GlintLight8SpotlightDirectionX 0xa2f0
-#define GlintLight8SpotlightDirectionXTag 0x045e
-#define GlintLight8SpotlightDirectionXReg 1
-#define GlintLight8SpotlightDirectionXOff 0x92f0
-
-#define GlintLight8SpotlightDirectionY 0xa2f8
-#define GlintLight8SpotlightDirectionYTag 0x045f
-#define GlintLight8SpotlightDirectionYReg 1
-#define GlintLight8SpotlightDirectionYOff 0x92f8
-
-#define GlintLight8SpotlightDirectionZ 0xa300
-#define GlintLight8SpotlightDirectionZTag 0x0460
-#define GlintLight8SpotlightDirectionZReg 1
-#define GlintLight8SpotlightDirectionZOff 0x9300
-
-#define GlintLight8SpotlightExponent 0xa308
-#define GlintLight8SpotlightExponentTag 0x0461
-#define GlintLight8SpotlightExponentReg 1
-#define GlintLight8SpotlightExponentOff 0x9308
-
-#define GlintLight8CosSpotlightCutoffAngle 0xa310
-#define GlintLight8CosSpotlightCutoffAngleTag 0x0462
-#define GlintLight8CosSpotlightCutoffAngleReg 1
-#define GlintLight8CosSpotlightCutoffAngleOff 0x9310
-
-#define GlintLight8ConstantAttenuation 0xa318
-#define GlintLight8ConstantAttenuationTag 0x0463
-#define GlintLight8ConstantAttenuationReg 1
-#define GlintLight8ConstantAttenuationOff 0x9318
-
-#define GlintLight8LinearAttenuation 0xa320
-#define GlintLight8LinearAttenuationTag 0x0464
-#define GlintLight8LinearAttenuationReg 1
-#define GlintLight8LinearAttenuationOff 0x9320
-
-#define GlintLight8QuadraticAttenuation 0xa328
-#define GlintLight8QuadraticAttenuationTag 0x0465
-#define GlintLight8QuadraticAttenuationReg 1
-#define GlintLight8QuadraticAttenuationOff 0x9328
-
-#define GlintLight9Mode 0xa330
-#define GlintLight9ModeTag 0x0466
-#define GlintLight9ModeReg 1
-#define GlintLight9ModeOff 0x9330
-
-#define GlintLight9AmbientIntensityRed 0xa338
-#define GlintLight9AmbientIntensityRedTag 0x0467
-#define GlintLight9AmbientIntensityRedReg 1
-#define GlintLight9AmbientIntensityRedOff 0x9338
-
-#define GlintLight9AmbientIntensityGreen 0xa340
-#define GlintLight9AmbientIntensityGreenTag 0x0468
-#define GlintLight9AmbientIntensityGreenReg 1
-#define GlintLight9AmbientIntensityGreenOff 0x9340
-
-#define GlintLight9AmbientIntensityBlue 0xa348
-#define GlintLight9AmbientIntensityBlueTag 0x0469
-#define GlintLight9AmbientIntensityBlueReg 1
-#define GlintLight9AmbientIntensityBlueOff 0x9348
-
-#define GlintLight9DiffuseIntensityRed 0xa350
-#define GlintLight9DiffuseIntensityRedTag 0x046a
-#define GlintLight9DiffuseIntensityRedReg 1
-#define GlintLight9DiffuseIntensityRedOff 0x9350
-
-#define GlintLight9DiffuseIntensityGreen 0xa358
-#define GlintLight9DiffuseIntensityGreenTag 0x046b
-#define GlintLight9DiffuseIntensityGreenReg 1
-#define GlintLight9DiffuseIntensityGreenOff 0x9358
-
-#define GlintLight9DiffuseIntensityBlue 0xa360
-#define GlintLight9DiffuseIntensityBlueTag 0x046c
-#define GlintLight9DiffuseIntensityBlueReg 1
-#define GlintLight9DiffuseIntensityBlueOff 0x9360
-
-#define GlintLight9SpecularIntensityRed 0xa368
-#define GlintLight9SpecularIntensityRedTag 0x046d
-#define GlintLight9SpecularIntensityRedReg 1
-#define GlintLight9SpecularIntensityRedOff 0x9368
-
-#define GlintLight9SpecularIntensityGreen 0xa370
-#define GlintLight9SpecularIntensityGreenTag 0x046e
-#define GlintLight9SpecularIntensityGreenReg 1
-#define GlintLight9SpecularIntensityGreenOff 0x9370
-
-#define GlintLight9SpecularIntensityBlue 0xa378
-#define GlintLight9SpecularIntensityBlueTag 0x046f
-#define GlintLight9SpecularIntensityBlueReg 1
-#define GlintLight9SpecularIntensityBlueOff 0x9378
-
-#define GlintLight9PositionX 0xa380
-#define GlintLight9PositionXTag 0x0470
-#define GlintLight9PositionXReg 1
-#define GlintLight9PositionXOff 0x9380
-
-#define GlintLight9PositionY 0xa388
-#define GlintLight9PositionYTag 0x0471
-#define GlintLight9PositionYReg 1
-#define GlintLight9PositionYOff 0x9388
-
-#define GlintLight9PositionZ 0xa390
-#define GlintLight9PositionZTag 0x0472
-#define GlintLight9PositionZReg 1
-#define GlintLight9PositionZOff 0x9390
-
-#define GlintLight9PositionW 0xa398
-#define GlintLight9PositionWTag 0x0473
-#define GlintLight9PositionWReg 1
-#define GlintLight9PositionWOff 0x9398
-
-#define GlintLight9SpotlightDirectionX 0xa3a0
-#define GlintLight9SpotlightDirectionXTag 0x0474
-#define GlintLight9SpotlightDirectionXReg 1
-#define GlintLight9SpotlightDirectionXOff 0x93a0
-
-#define GlintLight9SpotlightDirectionY 0xa3a8
-#define GlintLight9SpotlightDirectionYTag 0x0475
-#define GlintLight9SpotlightDirectionYReg 1
-#define GlintLight9SpotlightDirectionYOff 0x93a8
-
-#define GlintLight9SpotlightDirectionZ 0xa3b0
-#define GlintLight9SpotlightDirectionZTag 0x0476
-#define GlintLight9SpotlightDirectionZReg 1
-#define GlintLight9SpotlightDirectionZOff 0x93b0
-
-#define GlintLight9SpotlightExponent 0xa3b8
-#define GlintLight9SpotlightExponentTag 0x0477
-#define GlintLight9SpotlightExponentReg 1
-#define GlintLight9SpotlightExponentOff 0x93b8
-
-#define GlintLight9CosSpotlightCutoffAngle 0xa3c0
-#define GlintLight9CosSpotlightCutoffAngleTag 0x0478
-#define GlintLight9CosSpotlightCutoffAngleReg 1
-#define GlintLight9CosSpotlightCutoffAngleOff 0x93c0
-
-#define GlintLight9ConstantAttenuation 0xa3c8
-#define GlintLight9ConstantAttenuationTag 0x0479
-#define GlintLight9ConstantAttenuationReg 1
-#define GlintLight9ConstantAttenuationOff 0x93c8
-
-#define GlintLight9LinearAttenuation 0xa3d0
-#define GlintLight9LinearAttenuationTag 0x047a
-#define GlintLight9LinearAttenuationReg 1
-#define GlintLight9LinearAttenuationOff 0x93d0
-
-#define GlintLight9QuadraticAttenuation 0xa3d8
-#define GlintLight9QuadraticAttenuationTag 0x047b
-#define GlintLight9QuadraticAttenuationReg 1
-#define GlintLight9QuadraticAttenuationOff 0x93d8
-
-#define GlintLight10Mode 0xa3e0
-#define GlintLight10ModeTag 0x047c
-#define GlintLight10ModeReg 1
-#define GlintLight10ModeOff 0x93e0
-
-#define GlintLight10AmbientIntensityRed 0xa3e8
-#define GlintLight10AmbientIntensityRedTag 0x047d
-#define GlintLight10AmbientIntensityRedReg 1
-#define GlintLight10AmbientIntensityRedOff 0x93e8
-
-#define GlintLight10AmbientIntensityGreen 0xa3f0
-#define GlintLight10AmbientIntensityGreenTag 0x047e
-#define GlintLight10AmbientIntensityGreenReg 1
-#define GlintLight10AmbientIntensityGreenOff 0x93f0
-
-#define GlintLight10AmbientIntensityBlue 0xa3f8
-#define GlintLight10AmbientIntensityBlueTag 0x047f
-#define GlintLight10AmbientIntensityBlueReg 1
-#define GlintLight10AmbientIntensityBlueOff 0x93f8
-
-#define GlintLight10DiffuseIntensityRed 0xa400
-#define GlintLight10DiffuseIntensityRedTag 0x0480
-#define GlintLight10DiffuseIntensityRedReg 1
-#define GlintLight10DiffuseIntensityRedOff 0x9400
-
-#define GlintLight10DiffuseIntensityGreen 0xa408
-#define GlintLight10DiffuseIntensityGreenTag 0x0481
-#define GlintLight10DiffuseIntensityGreenReg 1
-#define GlintLight10DiffuseIntensityGreenOff 0x9408
-
-#define GlintLight10DiffuseIntensityBlue 0xa410
-#define GlintLight10DiffuseIntensityBlueTag 0x0482
-#define GlintLight10DiffuseIntensityBlueReg 1
-#define GlintLight10DiffuseIntensityBlueOff 0x9410
-
-#define GlintLight10SpecularIntensityRed 0xa418
-#define GlintLight10SpecularIntensityRedTag 0x0483
-#define GlintLight10SpecularIntensityRedReg 1
-#define GlintLight10SpecularIntensityRedOff 0x9418
-
-#define GlintLight10SpecularIntensityGreen 0xa420
-#define GlintLight10SpecularIntensityGreenTag 0x0484
-#define GlintLight10SpecularIntensityGreenReg 1
-#define GlintLight10SpecularIntensityGreenOff 0x9420
-
-#define GlintLight10SpecularIntensityBlue 0xa428
-#define GlintLight10SpecularIntensityBlueTag 0x0485
-#define GlintLight10SpecularIntensityBlueReg 1
-#define GlintLight10SpecularIntensityBlueOff 0x9428
-
-#define GlintLight10PositionX 0xa430
-#define GlintLight10PositionXTag 0x0486
-#define GlintLight10PositionXReg 1
-#define GlintLight10PositionXOff 0x9430
-
-#define GlintLight10PositionY 0xa438
-#define GlintLight10PositionYTag 0x0487
-#define GlintLight10PositionYReg 1
-#define GlintLight10PositionYOff 0x9438
-
-#define GlintLight10PositionZ 0xa440
-#define GlintLight10PositionZTag 0x0488
-#define GlintLight10PositionZReg 1
-#define GlintLight10PositionZOff 0x9440
-
-#define GlintLight10PositionW 0xa448
-#define GlintLight10PositionWTag 0x0489
-#define GlintLight10PositionWReg 1
-#define GlintLight10PositionWOff 0x9448
-
-#define GlintLight10SpotlightDirectionX 0xa450
-#define GlintLight10SpotlightDirectionXTag 0x048a
-#define GlintLight10SpotlightDirectionXReg 1
-#define GlintLight10SpotlightDirectionXOff 0x9450
-
-#define GlintLight10SpotlightDirectionY 0xa458
-#define GlintLight10SpotlightDirectionYTag 0x048b
-#define GlintLight10SpotlightDirectionYReg 1
-#define GlintLight10SpotlightDirectionYOff 0x9458
-
-#define GlintLight10SpotlightDirectionZ 0xa460
-#define GlintLight10SpotlightDirectionZTag 0x048c
-#define GlintLight10SpotlightDirectionZReg 1
-#define GlintLight10SpotlightDirectionZOff 0x9460
-
-#define GlintLight10SpotlightExponent 0xa468
-#define GlintLight10SpotlightExponentTag 0x048d
-#define GlintLight10SpotlightExponentReg 1
-#define GlintLight10SpotlightExponentOff 0x9468
-
-#define GlintLight10CosSpotlightCutoffAngle 0xa470
-#define GlintLight10CosSpotlightCutoffAngleTag 0x048e
-#define GlintLight10CosSpotlightCutoffAngleReg 1
-#define GlintLight10CosSpotlightCutoffAngleOff 0x9470
-
-#define GlintLight10ConstantAttenuation 0xa478
-#define GlintLight10ConstantAttenuationTag 0x048f
-#define GlintLight10ConstantAttenuationReg 1
-#define GlintLight10ConstantAttenuationOff 0x9478
-
-#define GlintLight10LinearAttenuation 0xa480
-#define GlintLight10LinearAttenuationTag 0x0490
-#define GlintLight10LinearAttenuationReg 1
-#define GlintLight10LinearAttenuationOff 0x9480
-
-#define GlintLight10QuadraticAttenuation 0xa488
-#define GlintLight10QuadraticAttenuationTag 0x0491
-#define GlintLight10QuadraticAttenuationReg 1
-#define GlintLight10QuadraticAttenuationOff 0x9488
-
-#define GlintLight11Mode 0xa490
-#define GlintLight11ModeTag 0x0492
-#define GlintLight11ModeReg 1
-#define GlintLight11ModeOff 0x9490
-
-#define GlintLight11AmbientIntensiveRed 0xa498
-#define GlintLight11AmbientIntensiveRedTag 0x0493
-#define GlintLight11AmbientIntensiveRedReg 1
-#define GlintLight11AmbientIntensiveRedOff 0x9498
-
-#define GlintLight11AmbientIntensityGreen 0xa4a0
-#define GlintLight11AmbientIntensityGreenTag 0x0494
-#define GlintLight11AmbientIntensityGreenReg 1
-#define GlintLight11AmbientIntensityGreenOff 0x94a0
-
-#define GlintLight11AmbientIntensityBlue 0xa4a8
-#define GlintLight11AmbientIntensityBlueTag 0x0495
-#define GlintLight11AmbientIntensityBlueReg 1
-#define GlintLight11AmbientIntensityBlueOff 0x94a8
-
-#define GlintLight11DiffuseIntensityRed 0xa4b0
-#define GlintLight11DiffuseIntensityRedTag 0x0496
-#define GlintLight11DiffuseIntensityRedReg 1
-#define GlintLight11DiffuseIntensityRedOff 0x94b0
-
-#define GlintLight11DiffuseIntensityGreen 0xa4b8
-#define GlintLight11DiffuseIntensityGreenTag 0x0497
-#define GlintLight11DiffuseIntensityGreenReg 1
-#define GlintLight11DiffuseIntensityGreenOff 0x94b8
-
-#define GlintLight11DiffuseIntensityBlue 0xa4c0
-#define GlintLight11DiffuseIntensityBlueTag 0x0498
-#define GlintLight11DiffuseIntensityBlueReg 1
-#define GlintLight11DiffuseIntensityBlueOff 0x94c0
-
-#define GlintLight11SpecularIntensityRed 0xa4c8
-#define GlintLight11SpecularIntensityRedTag 0x0499
-#define GlintLight11SpecularIntensityRedReg 1
-#define GlintLight11SpecularIntensityRedOff 0x94c8
-
-#define GlintLight11SpecularIntensityGreen 0xa4d0
-#define GlintLight11SpecularIntensityGreenTag 0x049a
-#define GlintLight11SpecularIntensityGreenReg 1
-#define GlintLight11SpecularIntensityGreenOff 0x94d0
-
-#define GlintLight11SpecularIntensityBlue 0xa4d8
-#define GlintLight11SpecularIntensityBlueTag 0x049b
-#define GlintLight11SpecularIntensityBlueReg 1
-#define GlintLight11SpecularIntensityBlueOff 0x94d8
-
-#define GlintLight11PositionX 0xa4e0
-#define GlintLight11PositionXTag 0x049c
-#define GlintLight11PositionXReg 1
-#define GlintLight11PositionXOff 0x94e0
-
-#define GlintLight11PositionY 0xa4e8
-#define GlintLight11PositionYTag 0x049d
-#define GlintLight11PositionYReg 1
-#define GlintLight11PositionYOff 0x94e8
-
-#define GlintLight11PositionZ 0xa4f0
-#define GlintLight11PositionZTag 0x049e
-#define GlintLight11PositionZReg 1
-#define GlintLight11PositionZOff 0x94f0
-
-#define GlintLight11PositionW 0xa4f8
-#define GlintLight11PositionWTag 0x049f
-#define GlintLight11PositionWReg 1
-#define GlintLight11PositionWOff 0x94f8
-
-#define GlintLight11SpotlightDirectionX 0xa500
-#define GlintLight11SpotlightDirectionXTag 0x04a0
-#define GlintLight11SpotlightDirectionXReg 1
-#define GlintLight11SpotlightDirectionXOff 0x9500
-
-#define GlintLight11SpotlightDirectionY 0xa508
-#define GlintLight11SpotlightDirectionYTag 0x04a1
-#define GlintLight11SpotlightDirectionYReg 1
-#define GlintLight11SpotlightDirectionYOff 0x9508
-
-#define GlintLight11SpotlightDirectionZ 0xa510
-#define GlintLight11SpotlightDirectionZTag 0x04a2
-#define GlintLight11SpotlightDirectionZReg 1
-#define GlintLight11SpotlightDirectionZOff 0x9510
-
-#define GlintLight11SpotlightExponent 0xa518
-#define GlintLight11SpotlightExponentTag 0x04a3
-#define GlintLight11SpotlightExponentReg 1
-#define GlintLight11SpotlightExponentOff 0x9518
-
-#define GlintLight11CosSpotlightCutoffAngle 0xa520
-#define GlintLight11CosSpotlightCutoffAngleTag 0x04a4
-#define GlintLight11CosSpotlightCutoffAngleReg 1
-#define GlintLight11CosSpotlightCutoffAngleOff 0x9520
-
-#define GlintLight11ConstantAttenuation 0xa528
-#define GlintLight11ConstantAttenuationTag 0x04a5
-#define GlintLight11ConstantAttenuationReg 1
-#define GlintLight11ConstantAttenuationOff 0x9528
-
-#define GlintLight11LinearAttenuation 0xa530
-#define GlintLight11LinearAttenuationTag 0x04a6
-#define GlintLight11LinearAttenuationReg 1
-#define GlintLight11LinearAttenuationOff 0x9530
-
-#define GlintLight11QuadraticAttenuation 0xa538
-#define GlintLight11QuadraticAttenuationTag 0x04a7
-#define GlintLight11QuadraticAttenuationReg 1
-#define GlintLight11QuadraticAttenuationOff 0x9538
-
-#define GlintLight12Mode 0xa540
-#define GlintLight12ModeTag 0x04a8
-#define GlintLight12ModeReg 1
-#define GlintLight12ModeOff 0x9540
-
-#define GlintLight12AmbientIntensityRed 0xa548
-#define GlintLight12AmbientIntensityRedTag 0x04a9
-#define GlintLight12AmbientIntensityRedReg 1
-#define GlintLight12AmbientIntensityRedOff 0x9548
-
-#define GlintLight12AmbientIntensityGreen 0xa550
-#define GlintLight12AmbientIntensityGreenTag 0x04aa
-#define GlintLight12AmbientIntensityGreenReg 1
-#define GlintLight12AmbientIntensityGreenOff 0x9550
-
-#define GlintLight12AmbientIntensityBlue 0xa558
-#define GlintLight12AmbientIntensityBlueTag 0x04ab
-#define GlintLight12AmbientIntensityBlueReg 1
-#define GlintLight12AmbientIntensityBlueOff 0x9558
-
-#define GlintLight12DiffuseIntensityRed 0xa560
-#define GlintLight12DiffuseIntensityRedTag 0x04ac
-#define GlintLight12DiffuseIntensityRedReg 1
-#define GlintLight12DiffuseIntensityRedOff 0x9560
-
-#define GlintLight12DiffuseIntensityGreen 0xa568
-#define GlintLight12DiffuseIntensityGreenTag 0x04ad
-#define GlintLight12DiffuseIntensityGreenReg 1
-#define GlintLight12DiffuseIntensityGreenOff 0x9568
-
-#define GlintLight12DiffuseIntensityBlue 0xa570
-#define GlintLight12DiffuseIntensityBlueTag 0x04ae
-#define GlintLight12DiffuseIntensityBlueReg 1
-#define GlintLight12DiffuseIntensityBlueOff 0x9570
-
-#define GlintLight12SpecularIntensityRed 0xa578
-#define GlintLight12SpecularIntensityRedTag 0x04af
-#define GlintLight12SpecularIntensityRedReg 1
-#define GlintLight12SpecularIntensityRedOff 0x9578
-
-#define GlintLight12SpecularIntensityGreen 0xa580
-#define GlintLight12SpecularIntensityGreenTag 0x04b0
-#define GlintLight12SpecularIntensityGreenReg 1
-#define GlintLight12SpecularIntensityGreenOff 0x9580
-
-#define GlintLight12SpecularIntensityBlue 0xa588
-#define GlintLight12SpecularIntensityBlueTag 0x04b1
-#define GlintLight12SpecularIntensityBlueReg 1
-#define GlintLight12SpecularIntensityBlueOff 0x9588
-
-#define GlintLight12PositionX 0xa590
-#define GlintLight12PositionXTag 0x04b2
-#define GlintLight12PositionXReg 1
-#define GlintLight12PositionXOff 0x9590
-
-#define GlintLight12PositionY 0xa598
-#define GlintLight12PositionYTag 0x04b3
-#define GlintLight12PositionYReg 1
-#define GlintLight12PositionYOff 0x9598
-
-#define GlintLight12PositionZ 0xa5a0
-#define GlintLight12PositionZTag 0x04b4
-#define GlintLight12PositionZReg 1
-#define GlintLight12PositionZOff 0x95a0
-
-#define GlintLight12PositionW 0xa5a8
-#define GlintLight12PositionWTag 0x04b5
-#define GlintLight12PositionWReg 1
-#define GlintLight12PositionWOff 0x95a8
-
-#define GlintLight12SpotlightDirectionX 0xa5b0
-#define GlintLight12SpotlightDirectionXTag 0x04b6
-#define GlintLight12SpotlightDirectionXReg 1
-#define GlintLight12SpotlightDirectionXOff 0x95b0
-
-#define GlintLight12SpotlightDirectionY 0xa5b8
-#define GlintLight12SpotlightDirectionYTag 0x04b7
-#define GlintLight12SpotlightDirectionYReg 1
-#define GlintLight12SpotlightDirectionYOff 0x95b8
-
-#define GlintLight12SpotlightDirectionZ 0xa5c0
-#define GlintLight12SpotlightDirectionZTag 0x04b8
-#define GlintLight12SpotlightDirectionZReg 1
-#define GlintLight12SpotlightDirectionZOff 0x95c0
-
-#define GlintLight12SpotlightExponent 0xa5c8
-#define GlintLight12SpotlightExponentTag 0x04b9
-#define GlintLight12SpotlightExponentReg 1
-#define GlintLight12SpotlightExponentOff 0x95c8
-
-#define GlintLight12CosSpotlightCutoffAngle 0xa5d0
-#define GlintLight12CosSpotlightCutoffAngleTag 0x04ba
-#define GlintLight12CosSpotlightCutoffAngleReg 1
-#define GlintLight12CosSpotlightCutoffAngleOff 0x95d0
-
-#define GlintLight12ConstantAttenuation 0xa5d8
-#define GlintLight12ConstantAttenuationTag 0x04bb
-#define GlintLight12ConstantAttenuationReg 1
-#define GlintLight12ConstantAttenuationOff 0x95d8
-
-#define GlintLight12LinearAttenuation 0xa5e0
-#define GlintLight12LinearAttenuationTag 0x04bc
-#define GlintLight12LinearAttenuationReg 1
-#define GlintLight12LinearAttenuationOff 0x95e0
-
-#define GlintLight12QuadraticAttenuation 0xa5e8
-#define GlintLight12QuadraticAttenuationTag 0x04bd
-#define GlintLight12QuadraticAttenuationReg 1
-#define GlintLight12QuadraticAttenuationOff 0x95e8
-
-#define GlintLight13Mode 0xa5f0
-#define GlintLight13ModeTag 0x04be
-#define GlintLight13ModeReg 1
-#define GlintLight13ModeOff 0x95f0
-
-#define GlintLight13AmbientIntensityRed 0xa5f8
-#define GlintLight13AmbientIntensityRedTag 0x04bf
-#define GlintLight13AmbientIntensityRedReg 1
-#define GlintLight13AmbientIntensityRedOff 0x95f8
-
-#define GlintLight13AmbientIntensityGreen 0xa600
-#define GlintLight13AmbientIntensityGreenTag 0x04c0
-#define GlintLight13AmbientIntensityGreenReg 1
-#define GlintLight13AmbientIntensityGreenOff 0x9600
-
-#define GlintLight13AmbientIntensityBlue 0xa608
-#define GlintLight13AmbientIntensityBlueTag 0x04c1
-#define GlintLight13AmbientIntensityBlueReg 1
-#define GlintLight13AmbientIntensityBlueOff 0x9608
-
-#define GlintLight13DiffuseIntensityRed 0xa610
-#define GlintLight13DiffuseIntensityRedTag 0x04c2
-#define GlintLight13DiffuseIntensityRedReg 1
-#define GlintLight13DiffuseIntensityRedOff 0x9610
-
-#define GlintLight13DiffuseIntensityGreen 0xa618
-#define GlintLight13DiffuseIntensityGreenTag 0x04c3
-#define GlintLight13DiffuseIntensityGreenReg 1
-#define GlintLight13DiffuseIntensityGreenOff 0x9618
-
-#define GlintLight13DiffuseIntensityBlue 0xa620
-#define GlintLight13DiffuseIntensityBlueTag 0x04c4
-#define GlintLight13DiffuseIntensityBlueReg 1
-#define GlintLight13DiffuseIntensityBlueOff 0x9620
-
-#define GlintLight13SpecularIntensityRed 0xa628
-#define GlintLight13SpecularIntensityRedTag 0x04c5
-#define GlintLight13SpecularIntensityRedReg 1
-#define GlintLight13SpecularIntensityRedOff 0x9628
-
-#define GlintLight13SpecularIntensityGreen 0xa630
-#define GlintLight13SpecularIntensityGreenTag 0x04c6
-#define GlintLight13SpecularIntensityGreenReg 1
-#define GlintLight13SpecularIntensityGreenOff 0x9630
-
-#define GlintLight13SpecularIntensityBlue 0xa638
-#define GlintLight13SpecularIntensityBlueTag 0x04c7
-#define GlintLight13SpecularIntensityBlueReg 1
-#define GlintLight13SpecularIntensityBlueOff 0x9638
-
-#define GlintLight13PositionX 0xa640
-#define GlintLight13PositionXTag 0x04c8
-#define GlintLight13PositionXReg 1
-#define GlintLight13PositionXOff 0x9640
-
-#define GlintLight13PositionY 0xa648
-#define GlintLight13PositionYTag 0x04c9
-#define GlintLight13PositionYReg 1
-#define GlintLight13PositionYOff 0x9648
-
-#define GlintLight13PositionZ 0xa650
-#define GlintLight13PositionZTag 0x04ca
-#define GlintLight13PositionZReg 1
-#define GlintLight13PositionZOff 0x9650
-
-#define GlintLight13PositionW 0xa658
-#define GlintLight13PositionWTag 0x04cb
-#define GlintLight13PositionWReg 1
-#define GlintLight13PositionWOff 0x9658
-
-#define GlintLight13SpotlightDirectionX 0xa660
-#define GlintLight13SpotlightDirectionXTag 0x04cc
-#define GlintLight13SpotlightDirectionXReg 1
-#define GlintLight13SpotlightDirectionXOff 0x9660
-
-#define GlintLight13SpotlightDirectionY 0xa668
-#define GlintLight13SpotlightDirectionYTag 0x04cd
-#define GlintLight13SpotlightDirectionYReg 1
-#define GlintLight13SpotlightDirectionYOff 0x9668
-
-#define GlintLight13SpotlightDirectionZ 0xa670
-#define GlintLight13SpotlightDirectionZTag 0x04ce
-#define GlintLight13SpotlightDirectionZReg 1
-#define GlintLight13SpotlightDirectionZOff 0x9670
-
-#define GlintLight13SpotlightExponent 0xa678
-#define GlintLight13SpotlightExponentTag 0x04cf
-#define GlintLight13SpotlightExponentReg 1
-#define GlintLight13SpotlightExponentOff 0x9678
-
-#define GlintLight13CosSpotlightCutoffAngle 0xa680
-#define GlintLight13CosSpotlightCutoffAngleTag 0x04d0
-#define GlintLight13CosSpotlightCutoffAngleReg 1
-#define GlintLight13CosSpotlightCutoffAngleOff 0x9680
-
-#define GlintLight13ConstantAttenuation 0xa688
-#define GlintLight13ConstantAttenuationTag 0x04d1
-#define GlintLight13ConstantAttenuationReg 1
-#define GlintLight13ConstantAttenuationOff 0x9688
-
-#define GlintLight13LinearAttenuation 0xa690
-#define GlintLight13LinearAttenuationTag 0x04d2
-#define GlintLight13LinearAttenuationReg 1
-#define GlintLight13LinearAttenuationOff 0x9690
-
-#define GlintLight13QuadraticAttenuation 0xa698
-#define GlintLight13QuadraticAttenuationTag 0x04d3
-#define GlintLight13QuadraticAttenuationReg 1
-#define GlintLight13QuadraticAttenuationOff 0x9698
-
-#define GlintLight14Mode 0xa6a0
-#define GlintLight14ModeTag 0x04d4
-#define GlintLight14ModeReg 1
-#define GlintLight14ModeOff 0x96a0
-
-#define GlintLight14AmbientIntensityRed 0xa6a8
-#define GlintLight14AmbientIntensityRedTag 0x04d5
-#define GlintLight14AmbientIntensityRedReg 1
-#define GlintLight14AmbientIntensityRedOff 0x96a8
-
-#define GlintLight14AmbientIntensityGreen 0xa6b0
-#define GlintLight14AmbientIntensityGreenTag 0x04d6
-#define GlintLight14AmbientIntensityGreenReg 1
-#define GlintLight14AmbientIntensityGreenOff 0x96b0
-
-#define GlintLight14AmbientIntensityBlue 0xa6b8
-#define GlintLight14AmbientIntensityBlueTag 0x04d7
-#define GlintLight14AmbientIntensityBlueReg 1
-#define GlintLight14AmbientIntensityBlueOff 0x96b8
-
-#define GlintLight14DiffuseIntensityRed 0xa6c0
-#define GlintLight14DiffuseIntensityRedTag 0x04d8
-#define GlintLight14DiffuseIntensityRedReg 1
-#define GlintLight14DiffuseIntensityRedOff 0x96c0
-
-#define GlintLight14DiffuseIntensityGreen 0xa6c8
-#define GlintLight14DiffuseIntensityGreenTag 0x04d9
-#define GlintLight14DiffuseIntensityGreenReg 1
-#define GlintLight14DiffuseIntensityGreenOff 0x96c8
-
-#define GlintLight14DiffuseIntensityBlue 0xa6d0
-#define GlintLight14DiffuseIntensityBlueTag 0x04da
-#define GlintLight14DiffuseIntensityBlueReg 1
-#define GlintLight14DiffuseIntensityBlueOff 0x96d0
-
-#define GlintLight14SpecularIntensityRed 0xa6d8
-#define GlintLight14SpecularIntensityRedTag 0x04db
-#define GlintLight14SpecularIntensityRedReg 1
-#define GlintLight14SpecularIntensityRedOff 0x96d8
-
-#define GlintLight14SpecularIntensityGreen 0xa6e0
-#define GlintLight14SpecularIntensityGreenTag 0x04dc
-#define GlintLight14SpecularIntensityGreenReg 1
-#define GlintLight14SpecularIntensityGreenOff 0x96e0
-
-#define GlintLight14SpecularIntensityBlue 0xa6e8
-#define GlintLight14SpecularIntensityBlueTag 0x04dd
-#define GlintLight14SpecularIntensityBlueReg 1
-#define GlintLight14SpecularIntensityBlueOff 0x96e8
-
-#define GlintLight14PositionX 0xa6f0
-#define GlintLight14PositionXTag 0x04de
-#define GlintLight14PositionXReg 1
-#define GlintLight14PositionXOff 0x96f0
-
-#define GlintLight14PositionY 0xa6f8
-#define GlintLight14PositionYTag 0x04df
-#define GlintLight14PositionYReg 1
-#define GlintLight14PositionYOff 0x96f8
-
-#define GlintLight14PositionZ 0xa700
-#define GlintLight14PositionZTag 0x04e0
-#define GlintLight14PositionZReg 1
-#define GlintLight14PositionZOff 0x9700
-
-#define GlintLight14PositionW 0xa708
-#define GlintLight14PositionWTag 0x04e1
-#define GlintLight14PositionWReg 1
-#define GlintLight14PositionWOff 0x9708
-
-#define GlintLight14SpotlightDirectionX 0xa710
-#define GlintLight14SpotlightDirectionXTag 0x04e2
-#define GlintLight14SpotlightDirectionXReg 1
-#define GlintLight14SpotlightDirectionXOff 0x9710
-
-#define GlintLight14SpotlightDirectionY 0xa718
-#define GlintLight14SpotlightDirectionYTag 0x04e3
-#define GlintLight14SpotlightDirectionYReg 1
-#define GlintLight14SpotlightDirectionYOff 0x9718
-
-#define GlintLight14SpotlightDirectionZ 0xa720
-#define GlintLight14SpotlightDirectionZTag 0x04e4
-#define GlintLight14SpotlightDirectionZReg 1
-#define GlintLight14SpotlightDirectionZOff 0x9720
-
-#define GlintLight14SpotlightExponent 0xa728
-#define GlintLight14SpotlightExponentTag 0x04e5
-#define GlintLight14SpotlightExponentReg 1
-#define GlintLight14SpotlightExponentOff 0x9728
-
-#define GlintLight14CosSpotlightCutoffAngle 0xa730
-#define GlintLight14CosSpotlightCutoffAngleTag 0x04e6
-#define GlintLight14CosSpotlightCutoffAngleReg 1
-#define GlintLight14CosSpotlightCutoffAngleOff 0x9730
-
-#define GlintLight14ConstantAttenuation 0xa738
-#define GlintLight14ConstantAttenuationTag 0x04e7
-#define GlintLight14ConstantAttenuationReg 1
-#define GlintLight14ConstantAttenuationOff 0x9738
-
-#define GlintLight14LinearAttenuation 0xa740
-#define GlintLight14LinearAttenuationTag 0x04e8
-#define GlintLight14LinearAttenuationReg 1
-#define GlintLight14LinearAttenuationOff 0x9740
-
-#define GlintLight14QuadraticAttenuation 0xa748
-#define GlintLight14QuadraticAttenuationTag 0x04e9
-#define GlintLight14QuadraticAttenuationReg 1
-#define GlintLight14QuadraticAttenuationOff 0x9748
-
-#define GlintLight15Mode 0xa750
-#define GlintLight15ModeTag 0x04ea
-#define GlintLight15ModeReg 1
-#define GlintLight15ModeOff 0x9750
-
-#define GlintLight15AmbientIntensityRed 0xa758
-#define GlintLight15AmbientIntensityRedTag 0x04eb
-#define GlintLight15AmbientIntensityRedReg 1
-#define GlintLight15AmbientIntensityRedOff 0x9758
-
-#define GlintLight15AmbientIntensityGreen 0xa760
-#define GlintLight15AmbientIntensityGreenTag 0x04ec
-#define GlintLight15AmbientIntensityGreenReg 1
-#define GlintLight15AmbientIntensityGreenOff 0x9760
-
-#define GlintLight15AmbientIntensityBlue 0xa768
-#define GlintLight15AmbientIntensityBlueTag 0x04ed
-#define GlintLight15AmbientIntensityBlueReg 1
-#define GlintLight15AmbientIntensityBlueOff 0x9768
-
-#define GlintLight15DiffuseIntensityRed 0xa770
-#define GlintLight15DiffuseIntensityRedTag 0x04ee
-#define GlintLight15DiffuseIntensityRedReg 1
-#define GlintLight15DiffuseIntensityRedOff 0x9770
-
-#define GlintLight15DiffuseIntensityGreen 0xa778
-#define GlintLight15DiffuseIntensityGreenTag 0x04ef
-#define GlintLight15DiffuseIntensityGreenReg 1
-#define GlintLight15DiffuseIntensityGreenOff 0x9778
-
-#define GlintLight15DiffuseIntensityBlue 0xa780
-#define GlintLight15DiffuseIntensityBlueTag 0x04f0
-#define GlintLight15DiffuseIntensityBlueReg 1
-#define GlintLight15DiffuseIntensityBlueOff 0x9780
-
-#define GlintLight15SpecularIntensityRed 0xa788
-#define GlintLight15SpecularIntensityRedTag 0x04f1
-#define GlintLight15SpecularIntensityRedReg 1
-#define GlintLight15SpecularIntensityRedOff 0x9788
-
-#define GlintLight15SpecularIntensityGreen 0xa790
-#define GlintLight15SpecularIntensityGreenTag 0x04f2
-#define GlintLight15SpecularIntensityGreenReg 1
-#define GlintLight15SpecularIntensityGreenOff 0x9790
-
-#define GlintLight15SpecularIntensityBlue 0xa798
-#define GlintLight15SpecularIntensityBlueTag 0x04f3
-#define GlintLight15SpecularIntensityBlueReg 1
-#define GlintLight15SpecularIntensityBlueOff 0x9798
-
-#define GlintLight15PositionX 0xa7a0
-#define GlintLight15PositionXTag 0x04f4
-#define GlintLight15PositionXReg 1
-#define GlintLight15PositionXOff 0x97a0
-
-#define GlintLight15PositionY 0xa7a8
-#define GlintLight15PositionYTag 0x04f5
-#define GlintLight15PositionYReg 1
-#define GlintLight15PositionYOff 0x97a8
-
-#define GlintLight15PositionZ 0xa7b0
-#define GlintLight15PositionZTag 0x04f6
-#define GlintLight15PositionZReg 1
-#define GlintLight15PositionZOff 0x97b0
-
-#define GlintLight15PositionW 0xa7b8
-#define GlintLight15PositionWTag 0x04f7
-#define GlintLight15PositionWReg 1
-#define GlintLight15PositionWOff 0x97b8
-
-#define GlintLight15SpotlightDirectionX 0xa7c0
-#define GlintLight15SpotlightDirectionXTag 0x04f8
-#define GlintLight15SpotlightDirectionXReg 1
-#define GlintLight15SpotlightDirectionXOff 0x97c0
-
-#define GlintLight15SpotlightDirectionY 0xa7c8
-#define GlintLight15SpotlightDirectionYTag 0x04f9
-#define GlintLight15SpotlightDirectionYReg 1
-#define GlintLight15SpotlightDirectionYOff 0x97c8
-
-#define GlintLight15SpotlightDirectionZ 0xa7d0
-#define GlintLight15SpotlightDirectionZTag 0x04fa
-#define GlintLight15SpotlightDirectionZReg 1
-#define GlintLight15SpotlightDirectionZOff 0x97d0
-
-#define GlintLight15SpotlightExponent 0xa7d8
-#define GlintLight15SpotlightExponentTag 0x04fb
-#define GlintLight15SpotlightExponentReg 1
-#define GlintLight15SpotlightExponentOff 0x97d8
-
-#define GlintLight15CosSpotlightCutoffAngle 0xa7e0
-#define GlintLight15CosSpotlightCutoffAngleTag 0x04fc
-#define GlintLight15CosSpotlightCutoffAngleReg 1
-#define GlintLight15CosSpotlightCutoffAngleOff 0x97e0
-
-#define GlintLight15ConstantAttenuation 0xa7e8
-#define GlintLight15ConstantAttenuationTag 0x04fd
-#define GlintLight15ConstantAttenuationReg 1
-#define GlintLight15ConstantAttenuationOff 0x97e8
-
-#define GlintLight15LinearAttenuation 0xa7f0
-#define GlintLight15LinearAttenuationTag 0x04fe
-#define GlintLight15LinearAttenuationReg 1
-#define GlintLight15LinearAttenuationOff 0x97f0
-
-#define GlintLight15QuadraticAttenuation 0xa7f8
-#define GlintLight15QuadraticAttenuationTag 0x04ff
-#define GlintLight15QuadraticAttenuationReg 1
-#define GlintLight15QuadraticAttenuationOff 0x97f8
-
-#define GlintSceneAmbientColorRed 0xa800
-#define GlintSceneAmbientColorRedTag 0x0500
-#define GlintSceneAmbientColorRedReg 1
-#define GlintSceneAmbientColorRedOff 0x9800
-
-#define GlintSceneAmbientColorGreen 0xa808
-#define GlintSceneAmbientColorGreenTag 0x0501
-#define GlintSceneAmbientColorGreenReg 1
-#define GlintSceneAmbientColorGreenOff 0x9808
-
-#define GlintSceneAmbientColorBlue 0xa810
-#define GlintSceneAmbientColorBlueTag 0x0502
-#define GlintSceneAmbientColorBlueReg 1
-#define GlintSceneAmbientColorBlueOff 0x9810
-
-#define GlintFrontAmbientColorRed 0xa880
-#define GlintFrontAmbientColorRedTag 0x0510
-#define GlintFrontAmbientColorRedReg 1
-#define GlintFrontAmbientColorRedOff 0x9880
-
-#define GlintFrontAmbientColorGreen 0xa888
-#define GlintFrontAmbientColorGreenTag 0x0511
-#define GlintFrontAmbientColorGreenReg 1
-#define GlintFrontAmbientColorGreenOff 0x9888
-
-#define GlintFrontAmbientColorBlue 0xa890
-#define GlintFrontAmbientColorBlueTag 0x0512
-#define GlintFrontAmbientColorBlueReg 1
-#define GlintFrontAmbientColorBlueOff 0x9890
-
-#define GlintFrontDiffuseColorRed 0xa898
-#define GlintFrontDiffuseColorRedTag 0x0513
-#define GlintFrontDiffuseColorRedReg 1
-#define GlintFrontDiffuseColorRedOff 0x9898
-
-#define GlintFrontDiffuseColorGreen 0xa8a0
-#define GlintFrontDiffuseColorGreenTag 0x0514
-#define GlintFrontDiffuseColorGreenReg 1
-#define GlintFrontDiffuseColorGreenOff 0x98a0
-
-#define GlintFrontDiffuseColorBlue 0xa8a8
-#define GlintFrontDiffuseColorBlueTag 0x0515
-#define GlintFrontDiffuseColorBlueReg 1
-#define GlintFrontDiffuseColorBlueOff 0x98a8
-
-#define GlintFrontAlpha 0xa8b0
-#define GlintFrontAlphaTag 0x0516
-#define GlintFrontAlphaReg 1
-#define GlintFrontAlphaOff 0x98b0
-
-#define GlintFrontSpecularColorRed 0xa8b8
-#define GlintFrontSpecularColorRedTag 0x0517
-#define GlintFrontSpecularColorRedReg 1
-#define GlintFrontSpecularColorRedOff 0x98b8
-
-#define GlintFrontSpecularColorGreen 0xa8c0
-#define GlintFrontSpecularColorGreenTag 0x0518
-#define GlintFrontSpecularColorGreenReg 1
-#define GlintFrontSpecularColorGreenOff 0x98c0
-
-#define GlintFrontSpecularColorBlue 0xa8c8
-#define GlintFrontSpecularColorBlueTag 0x0519
-#define GlintFrontSpecularColorBlueReg 1
-#define GlintFrontSpecularColorBlueOff 0x98c8
-
-#define GlintFrontEmissiveColorRed 0xa8d0
-#define GlintFrontEmissiveColorRedTag 0x051a
-#define GlintFrontEmissiveColorRedReg 1
-#define GlintFrontEmissiveColorRedOff 0x98d0
-
-#define GlintFrontEmissiveColorGreen 0xa8d8
-#define GlintFrontEmissiveColorGreenTag 0x051b
-#define GlintFrontEmissiveColorGreenReg 1
-#define GlintFrontEmissiveColorGreenOff 0x98d8
-
-#define GlintFrontEmissiveColorBlue 0xa8e0
-#define GlintFrontEmissiveColorBlueTag 0x051c
-#define GlintFrontEmissiveColorBlueReg 1
-#define GlintFrontEmissiveColorBlueOff 0x98e0
-
-#define GlintFrontSpecularExponent 0xa8e8
-#define GlintFrontSpecularExponentTag 0x051d
-#define GlintFrontSpecularExponentReg 1
-#define GlintFrontSpecularExponentOff 0x98e8
-
-#define GlintBackAmbientColorRed 0xa900
-#define GlintBackAmbientColorRedTag 0x0520
-#define GlintBackAmbientColorRedReg 1
-#define GlintBackAmbientColorRedOff 0x9900
-
-#define GlintBackAmbientColorGreen 0xa908
-#define GlintBackAmbientColorGreenTag 0x0521
-#define GlintBackAmbientColorGreenReg 1
-#define GlintBackAmbientColorGreenOff 0x9908
-
-#define GlintBackAmbientColorBlue 0xa910
-#define GlintBackAmbientColorBlueTag 0x0522
-#define GlintBackAmbientColorBlueReg 1
-#define GlintBackAmbientColorBlueOff 0x9910
-
-#define GlintBackDiffuseColorRed 0xa918
-#define GlintBackDiffuseColorRedTag 0x0523
-#define GlintBackDiffuseColorRedReg 1
-#define GlintBackDiffuseColorRedOff 0x9918
-
-#define GlintBackDiffuseColorGreen 0xa920
-#define GlintBackDiffuseColorGreenTag 0x0524
-#define GlintBackDiffuseColorGreenReg 1
-#define GlintBackDiffuseColorGreenOff 0x9920
-
-#define GlintBackDiffuseColorBlue 0xa928
-#define GlintBackDiffuseColorBlueTag 0x0525
-#define GlintBackDiffuseColorBlueReg 1
-#define GlintBackDiffuseColorBlueOff 0x9928
-
-#define GlintBackAlpha 0xa930
-#define GlintBackAlphaTag 0x0526
-#define GlintBackAlphaReg 1
-#define GlintBackAlphaOff 0x9930
-
-#define GlintBackSpecularColorRed 0xa938
-#define GlintBackSpecularColorRedTag 0x0527
-#define GlintBackSpecularColorRedReg 1
-#define GlintBackSpecularColorRedOff 0x9938
-
-#define GlintBackSpecularColorGreen 0xa940
-#define GlintBackSpecularColorGreenTag 0x0528
-#define GlintBackSpecularColorGreenReg 1
-#define GlintBackSpecularColorGreenOff 0x9940
-
-#define GlintBackSpecularColorBlue 0xa948
-#define GlintBackSpecularColorBlueTag 0x0529
-#define GlintBackSpecularColorBlueReg 1
-#define GlintBackSpecularColorBlueOff 0x9948
-
-#define GlintBackEmissiveColorRed 0xa950
-#define GlintBackEmissiveColorRedTag 0x052a
-#define GlintBackEmissiveColorRedReg 1
-#define GlintBackEmissiveColorRedOff 0x9950
-
-#define GlintBackEmissiveColorGreen 0xa958
-#define GlintBackEmissiveColorGreenTag 0x052b
-#define GlintBackEmissiveColorGreenReg 1
-#define GlintBackEmissiveColorGreenOff 0x9958
-
-#define GlintBackEmissiveColorBlue 0xa960
-#define GlintBackEmissiveColorBlueTag 0x052c
-#define GlintBackEmissiveColorBlueReg 1
-#define GlintBackEmissiveColorBlueOff 0x9960
-
-#define GlintBackSpecularExponent 0xa968
-#define GlintBackSpecularExponentTag 0x052d
-#define GlintBackSpecularExponentReg 1
-#define GlintBackSpecularExponentOff 0x9968
-
-#define GlintDMAAddr 0xa980
-#define GlintDMAAddrTag 0x0530
-#define GlintDMAAddrReg 1
-#define GlintDMAAddrOff 0x9980
-
-#define GlintGammaDMACount 0xa988
-#define GlintGammaDMACountTag 0x0531
-#define GlintGammaDMACountReg 1
-#define GlintGammaDMACountOff 0x9988
-
-#define GlintCommandInterrupt 0xa990
-#define GlintCommandInterruptTag 0x0532
-#define GlintCommandInterruptReg 1
-#define GlintCommandInterruptOff 0x9990
-
-#define GlintDMACall 0xa998
-#define GlintDMACallTag 0x0533
-#define GlintDMACallReg 1
-#define GlintDMACallOff 0x9998
-
-#define GlintDMAReturn 0xa9a0
-#define GlintDMAReturnTag 0x0534
-#define GlintDMAReturnReg 1
-#define GlintDMAReturnOff 0x99a0
-
-#define GlintDMARectangularRead 0xa9a8
-#define GlintDMARectangularReadTag 0x0535
-#define GlintDMARectangularReadReg 1
-#define GlintDMARectangularReadOff 0x99a8
-
-#define GlintDMARectangleReadAddress 0xa9b0
-#define GlintDMARectangleReadAddressTag 0x0536
-#define GlintDMARectangleReadAddressReg 1
-#define GlintDMARectangleReadAddressOff 0x99b0
-
-#define GlintDMARectangleReadLinePitch 0xa9b8
-#define GlintDMARectangleReadLinePitchTag 0x0537
-#define GlintDMARectangleReadLinePitchReg 1
-#define GlintDMARectangleReadLinePitchOff 0x99b8
-
-#define GlintDMARectangleReadTarget 0xa9c0
-#define GlintDMARectangleReadTargetTag 0x0538
-#define GlintDMARectangleReadTargetReg 1
-#define GlintDMARectangleReadTargetOff 0x99c0
-
-#define GlintDMARectangleWrite 0xa9c8
-#define GlintDMARectangleWriteTag 0x0539
-#define GlintDMARectangleWriteReg 1
-#define GlintDMARectangleWriteOff 0x99c8
-
-#define GlintDMARectangleWriteAddress 0xa9d0
-#define GlintDMARectangleWriteAddressTag 0x053a
-#define GlintDMARectangleWriteAddressReg 1
-#define GlintDMARectangleWriteAddressOff 0x99d0
-
-#define GlintDMARectangleWriteLinePitch 0xa9d8
-#define GlintDMARectangleWriteLinePitchTag 0x053b
-#define GlintDMARectangleWriteLinePitchReg 1
-#define GlintDMARectangleWriteLinePitchOff 0x99d8
-
-#define GlintDMAOutputAddress 0xa9e0
-#define GlintDMAOutputAddressTag 0x053c
-#define GlintDMAOutputAddressReg 1
-#define GlintDMAOutputAddressOff 0x99e0
-
-#define GlintDMAOutputCount 0xa9e8
-#define GlintDMAOutputCountTag 0x053d
-#define GlintDMAOutputCountReg 1
-#define GlintDMAOutputCountOff 0x99e8
-
-#define GlintDMAReadGLINTSource 0xa9f0
-#define GlintDMAReadGLINTSourceTag 0x053e
-#define GlintDMAReadGLINTSourceReg 1
-#define GlintDMAReadGLINTSourceOff 0x99f0
-
-#define GlintDMAFeedback 0xaa10
-#define GlintDMAFeedbackTag 0x0542
-#define GlintDMAFeedbackReg 1
-#define GlintDMAFeedbackOff 0x9a10
-
-#define GlintTransformModeAnd 0xaa80
-#define GlintTransformModeAndTag 0x0550
-#define GlintTransformModeAndReg 1
-#define GlintTransformModeAndOff 0x9a80
-
-#define GlintTransformModeOr 0xaa88
-#define GlintTransformModeOrTag 0x0551
-#define GlintTransformModeOrReg 1
-#define GlintTransformModeOrOff 0x9a88
-
-#define GlintGeometryModeAnd 0xaa90
-#define GlintGeometryModeAndTag 0x0552
-#define GlintGeometryModeAndReg 1
-#define GlintGeometryModeAndOff 0x9a90
-
-#define GlintGeometryModeOr 0xaa98
-#define GlintGeometryModeOrTag 0x0553
-#define GlintGeometryModeOrReg 1
-#define GlintGeometryModeOrOff 0x9a98
-
-#define GlintNormalizeModeAnd 0xaaa0
-#define GlintNormalizeModeAndTag 0x0554
-#define GlintNormalizeModeAndReg 1
-#define GlintNormalizeModeAndOff 0x9aa0
-
-#define GlintNormalizeModeOr 0xaaa8
-#define GlintNormalizeModeOrTag 0x0555
-#define GlintNormalizeModeOrReg 1
-#define GlintNormalizeModeOrOff 0x9aa8
-
-#define GlintLightingModeAnd 0xaab0
-#define GlintLightingModeAndTag 0x0556
-#define GlintLightingModeAndReg 1
-#define GlintLightingModeAndOff 0x9ab0
-
-#define GlintLightingModeOr 0xaab8
-#define GlintLightingModeOrTag 0x0557
-#define GlintLightingModeOrReg 1
-#define GlintLightingModeOrOff 0x9ab8
-
-#define GlintColorMaterialModeAnd 0xaac0
-#define GlintColorMaterialModeAndTag 0x0558
-#define GlintColorMaterialModeAndReg 1
-#define GlintColorMaterialModeAndOff 0x9ac0
-
-#define GlintColorMaterialModeOr 0xaac8
-#define GlintColorMaterialModeOrTag 0x0559
-#define GlintColorMaterialModeOrReg 1
-#define GlintColorMaterialModeOrOff 0x9ac8
-
-#define GlintDeltaModeAnd 0xaad0
-#define GlintDeltaModeAndTag 0x055a
-#define GlintDeltaModeAndReg 1
-#define GlintDeltaModeAndOff 0x9ad0
-
-#define GlintDeltaModeOr 0xaad8
-#define GlintDeltaModeOrTag 0x055b
-#define GlintDeltaModeOrReg 1
-#define GlintDeltaModeOrOff 0x9ad8
-
-#define GlintPointModeAnd 0xaae0
-#define GlintPointModeAndTag 0x055c
-#define GlintPointModeAndReg 1
-#define GlintPointModeAndOff 0x9ae0
-
-#define GlintPointModeOr 0xaae8
-#define GlintPointModeOrTag 0x055d
-#define GlintPointModeOrReg 1
-#define GlintPointModeOrOff 0x9ae8
-
-#define GlintLineModeAnd 0xaaf0
-#define GlintLineModeAndTag 0x055e
-#define GlintLineModeAndReg 1
-#define GlintLineModeAndOff 0x9af0
-
-#define GlintLineModeOr 0xaaf8
-#define GlintLineModeOrTag 0x055f
-#define GlintLineModeOrReg 1
-#define GlintLineModeOrOff 0x9af8
-
-#define GlintTriangleModeAnd 0xab00
-#define GlintTriangleModeAndTag 0x0560
-#define GlintTriangleModeAndReg 1
-#define GlintTriangleModeAndOff 0x9b00
-
-#define GlintTriangleModeOr 0xab08
-#define GlintTriangleModeOrTag 0x0561
-#define GlintTriangleModeOrReg 1
-#define GlintTriangleModeOrOff 0x9b08
-
-#define GlintMaterialModeAnd 0xab10
-#define GlintMaterialModeAndTag 0x0562
-#define GlintMaterialModeAndReg 1
-#define GlintMaterialModeAndOff 0x9b10
-
-#define GlintMaterialModeOr 0xab18
-#define GlintMaterialModeOrTag 0x0563
-#define GlintMaterialModeOrReg 1
-#define GlintMaterialModeOrOff 0x9b18
-
-#define GlintWindowAnd 0xab80
-#define GlintWindowAndTag 0x0570
-#define GlintWindowAndReg 1
-#define GlintWindowAndOff 0x9b80
-
-#define GlintWindowOr 0xab88
-#define GlintWindowOrTag 0x0571
-#define GlintWindowOrReg 1
-#define GlintWindowOrOff 0x9b88
-
-#define GlintLBReadModeAnd 0xab90
-#define GlintLBReadModeAndTag 0x0572
-#define GlintLBReadModeAndReg 1
-#define GlintLBReadModeAndOff 0x9b90
-
-#define GlintLBReadModeOr 0xab98
-#define GlintLBReadModeOrTag 0x0573
-#define GlintLBReadModeOrReg 1
-#define GlintLBReadModeOrOff 0x9b98
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.c
deleted file mode 100644
index ffaf45459..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- * 3DLabs Gamma driver.
- *
- */
-#include "gamma_context.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-#include "simple_list.h"
-#include "mm.h"
-
-
-#include "gamma_vb.h"
-#include "gamma_tris.h"
-
-extern const struct tnl_pipeline_stage _gamma_render_stage;
-
-static const struct tnl_pipeline_stage *gamma_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
-#if 1
- &_gamma_render_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-GLboolean gammaCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- gammaContextPtr gmesa;
- gammaScreenPtr gammascrn;
- GLINTSAREADRIPtr saPriv=(GLINTSAREADRIPtr)(((char*)sPriv->pSAREA)+
- sizeof(drm_sarea_t));
- struct dd_function_table functions;
-
- gmesa = (gammaContextPtr) CALLOC( sizeof(*gmesa) );
- if (!gmesa)
- return GL_FALSE;
-
- /* Init default driver functions then plug in our gamma-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions( &functions );
- gammaDDInitTextureFuncs( &functions );
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((gammaContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- gmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *) gmesa);
- if (!gmesa->glCtx) {
- FREE(gmesa);
- return GL_FALSE;
- }
-
- gmesa->driContext = driContextPriv;
- gmesa->driScreen = sPriv;
- gmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */
-
- gmesa->hHWContext = driContextPriv->hHWContext;
- gmesa->driHwLock = &sPriv->pSAREA->lock;
- gmesa->driFd = sPriv->fd;
- gmesa->sarea = saPriv;
-
- gammascrn = gmesa->gammaScreen = (gammaScreenPtr)(sPriv->private);
-
- ctx = gmesa->glCtx;
-
- ctx->Const.MaxTextureLevels = GAMMA_TEX_MAXLEVELS;
- ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */
- ctx->Const.MaxTextureImageUnits = 1;
- ctx->Const.MaxTextureCoordUnits = 1;
-
- ctx->Const.MinLineWidth = 0.0;
- ctx->Const.MaxLineWidth = 255.0;
-
- ctx->Const.MinLineWidthAA = 0.0;
- ctx->Const.MaxLineWidthAA = 65536.0;
-
- ctx->Const.MinPointSize = 0.0;
- ctx->Const.MaxPointSize = 255.0;
-
- ctx->Const.MinPointSizeAA = 0.5; /* 4x4 quality mode */
- ctx->Const.MaxPointSizeAA = 16.0;
- ctx->Const.PointSizeGranularity = 0.25;
-
- gmesa->texHeap = mmInit( 0, gmesa->gammaScreen->textureSize );
-
- make_empty_list(&gmesa->TexObjList);
- make_empty_list(&gmesa->SwappedOut);
-
- gmesa->CurrentTexObj[0] = 0;
- gmesa->CurrentTexObj[1] = 0; /* Permedia 3, second texture */
-
- gmesa->RenderIndex = ~0;
-
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, gamma_pipeline );
-
- /* Configure swrast & TNL to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
- gammaInitVB( ctx );
- gammaDDInitExtensions( ctx );
- /* XXX these should really go right after _mesa_init_driver_functions() */
- gammaDDInitDriverFuncs( ctx );
- gammaDDInitStateFuncs( ctx );
- gammaDDInitSpanFuncs( ctx );
- gammaDDInitTriFuncs( ctx );
- gammaDDInitState( gmesa );
-
- gammaInitTextureObjects( ctx );
-
- driContextPriv->driverPrivate = (void *)gmesa;
-
- GET_FIRST_DMA(gmesa->driFd, gmesa->hHWContext,
- 1, &gmesa->bufIndex, &gmesa->bufSize,
- &gmesa->buf, &gmesa->bufCount, gammascrn);
-
-#ifdef DO_VALIDATE
- GET_FIRST_DMA(gmesa->driFd, gmesa->hHWContext,
- 1, &gmesa->WCbufIndex, &gmesa->WCbufSize,
- &gmesa->WCbuf, &gmesa->WCbufCount, gammascrn);
-#endif
-
- switch (glVisual->depthBits) {
- case 16:
- gmesa->DeltaMode = DM_Depth16;
- gmesa->depth_scale = 1.0f / 0xffff;
- break;
- case 24:
- gmesa->DeltaMode = DM_Depth24;
- gmesa->depth_scale = 1.0f / 0xffffff;
- break;
- case 32:
- gmesa->DeltaMode = DM_Depth32;
- gmesa->depth_scale = 1.0f / 0xffffffff;
- break;
- default:
- break;
- }
-
- gmesa->DepthSize = glVisual->depthBits;
- gmesa->Flags = GAMMA_FRONT_BUFFER;
- gmesa->Flags |= (glVisual->doubleBufferMode ? GAMMA_BACK_BUFFER : 0);
- gmesa->Flags |= (gmesa->DepthSize > 0 ? GAMMA_DEPTH_BUFFER : 0);
-
- gmesa->EnabledFlags = GAMMA_FRONT_BUFFER;
- gmesa->EnabledFlags |= (glVisual->doubleBufferMode ? GAMMA_BACK_BUFFER : 0);
-
-
- if (gmesa->Flags & GAMMA_BACK_BUFFER) {
- gmesa->readOffset = gmesa->drawOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
- } else {
- gmesa->readOffset = gmesa->drawOffset = 0;
- }
-
- gammaInitHW( gmesa );
-
- driContextPriv->driverPrivate = (void *)gmesa;
-
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h
deleted file mode 100644
index 7745f4c3c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_context.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h,v 1.6 2002/12/16 16:18:50 dawes Exp $ */
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- */
-
-#ifndef _GAMMA_CONTEXT_H_
-#define _GAMMA_CONTEXT_H_
-
-#include "dri_util.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "colormac.h"
-#include "gamma_regs.h"
-#include "gamma_macros.h"
-#include "gamma_screen.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "glint_dri.h"
-#include "mm.h"
-
-typedef union {
- unsigned int i;
- float f;
-} dmaBufRec, *dmaBuf;
-
-/* Flags for context */
-#define GAMMA_FRONT_BUFFER 0x00000001
-#define GAMMA_BACK_BUFFER 0x00000002
-#define GAMMA_DEPTH_BUFFER 0x00000004
-#define GAMMA_STENCIL_BUFFER 0x00000008
-#define GAMMA_ACCUM_BUFFER 0x00000010
-
-#define GAMMA_MAX_TEXTURE_SIZE 2048
-
-/* These are the minimum requirements and should probably be increased */
-#define MAX_MODELVIEW_STACK 16
-#define MAX_PROJECTION_STACK 2
-#define MAX_TEXTURE_STACK 2
-
-extern void gammaDDUpdateHWState(GLcontext *ctx);
-extern gammaScreenPtr gammaCreateScreen(__DRIscreenPrivate *sPriv);
-extern void gammaDestroyScreen(__DRIscreenPrivate *sPriv);
-extern GLboolean gammaCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-#define GAMMA_UPLOAD_ALL 0xffffffff
-#define GAMMA_UPLOAD_CLIPRECTS 0x00000002
-#define GAMMA_UPLOAD_ALPHA 0x00000004
-#define GAMMA_UPLOAD_BLEND 0x00000008
-#define GAMMA_UPLOAD_DEPTH 0x00000010
-#define GAMMA_UPLOAD_VIEWPORT 0x00000020
-#define GAMMA_UPLOAD_SHADE 0x00000040
-#define GAMMA_UPLOAD_CLIP 0x00000080
-#define GAMMA_UPLOAD_MASKS 0x00000100
-#define GAMMA_UPLOAD_WINDOW 0x00000200 /* defunct */
-#define GAMMA_UPLOAD_GEOMETRY 0x00000400
-#define GAMMA_UPLOAD_POLYGON 0x00000800
-#define GAMMA_UPLOAD_DITHER 0x00001000
-#define GAMMA_UPLOAD_LOGICOP 0x00002000
-#define GAMMA_UPLOAD_FOG 0x00004000
-#define GAMMA_UPLOAD_LIGHT 0x00008000
-#define GAMMA_UPLOAD_CONTEXT 0x00010000
-#define GAMMA_UPLOAD_TEX0 0x00020000
-#define GAMMA_UPLOAD_STIPPLE 0x00040000
-#define GAMMA_UPLOAD_TRANSFORM 0x00080000
-#define GAMMA_UPLOAD_LINEMODE 0x00100000
-#define GAMMA_UPLOAD_POINTMODE 0x00200000
-#define GAMMA_UPLOAD_TRIMODE 0x00400000
-
-#define GAMMA_NEW_CLIP 0x00000001
-#define GAMMA_NEW_WINDOW 0x00000002
-#define GAMMA_NEW_CONTEXT 0x00000004
-#define GAMMA_NEW_TEXTURE 0x00000008 /* defunct */
-#define GAMMA_NEW_ALPHA 0x00000010
-#define GAMMA_NEW_DEPTH 0x00000020
-#define GAMMA_NEW_MASKS 0x00000040
-#define GAMMA_NEW_POLYGON 0x00000080
-#define GAMMA_NEW_CULL 0x00000100
-#define GAMMA_NEW_LOGICOP 0x00000200
-#define GAMMA_NEW_FOG 0x00000400
-#define GAMMA_NEW_LIGHT 0x00000800
-#define GAMMA_NEW_STIPPLE 0x00001000
-#define GAMMA_NEW_ALL 0xffffffff
-
-#define GAMMA_FALLBACK_TRI 0x00000001
-#define GAMMA_FALLBACK_TEXTURE 0x00000002
-
-#define FLUSH_BATCH(gmesa) do { \
- /*FLUSH_DMA_BUFFER(gmesa);*/ \
-} while(0)
-
-struct gamma_context;
-typedef struct gamma_context gammaContextRec;
-typedef struct gamma_context *gammaContextPtr;
-typedef struct gamma_texture_object_t *gammaTextureObjectPtr;
-
-#define VALID_GAMMA_TEXTURE_OBJECT(tobj) (tobj)
-
-#define GAMMA_TEX_MAXLEVELS 12 /* 2K x 2K */
-
-/* For shared texture space managment, these texture objects may also
- * be used as proxies for regions of texture memory containing other
- * client's textures. Such proxy textures (not to be confused with GL
- * proxy textures) are subject to the same LRU aging we use for our
- * own private textures, and thus we have a mechanism where we can
- * fairly decide between kicking out our own textures and those of
- * other clients.
- *
- * Non-local texture objects have a valid MemBlock to describe the
- * region managed by the other client, and can be identified by
- * 't->globj == 0'
- */
-struct gamma_texture_object_t {
- struct gamma_texture_object_t *next, *prev;
-
- GLuint age;
- struct gl_texture_object *globj;
-
- int Pitch;
- int Height;
- int texelBytes;
- int totalSize;
- int bound;
-
- PMemBlock MemBlock;
- char * BufAddr;
-
- GLuint min_level;
- GLuint max_level;
- GLuint dirty_images;
-
- GLint firstLevel, lastLevel; /* upload tObj->Image[0][first .. lastLevel] */
-
- struct {
- const struct gl_texture_image *image;
- int offset; /* into BufAddr */
- int height;
- int internalFormat;
- } image[GAMMA_TEX_MAXLEVELS];
-
- u_int32_t TextureBaseAddr[GAMMA_TEX_MAXLEVELS];
- u_int32_t TextureAddressMode;
- u_int32_t TextureColorMode;
- u_int32_t TextureFilterMode;
- u_int32_t TextureFormat;
- u_int32_t TextureReadMode;
- u_int32_t TextureBorderColor;
-};
-
-#define GAMMA_NO_PALETTE 0x0
-#define GAMMA_USE_PALETTE 0x1
-#define GAMMA_UPDATE_PALETTE 0x2
-#define GAMMA_FALLBACK_PALETTE 0x4
-
-void gammaUpdateTextureState( GLcontext *ctx );
-
-void gammaDestroyTexObj( gammaContextPtr gmesa, gammaTextureObjectPtr t );
-void gammaSwapOutTexObj( gammaContextPtr gmesa, gammaTextureObjectPtr t );
-void gammaUploadTexImages( gammaContextPtr gmesa, gammaTextureObjectPtr t );
-
-void gammaResetGlobalLRU( gammaContextPtr gmesa );
-void gammaUpdateTexLRU( gammaContextPtr gmesa, gammaTextureObjectPtr t );
-void gammaTexturesGone( gammaContextPtr gmesa,
- GLuint start, GLuint end,
- GLuint in_use );
-
-void gammaEmitHwState( gammaContextPtr gmesa );
-void gammaDDInitExtensions( GLcontext *ctx );
-void gammaDDInitDriverFuncs( GLcontext *ctx );
-void gammaDDInitSpanFuncs( GLcontext *ctx );
-void gammaDDInitState( gammaContextPtr gmesa );
-void gammaInitHW( gammaContextPtr gmesa );
-void gammaDDInitStateFuncs( GLcontext *ctx );
-void gammaDDInitTextureFuncs( struct dd_function_table *table );
-void gammaInitTextureObjects( GLcontext *ctx );
-void gammaDDInitTriFuncs( GLcontext *ctx );
-
-void gammaUpdateWindow( GLcontext *ctx );
-void gammaUpdateViewportOffset( GLcontext *ctx );
-
-void gammaPrintLocalLRU( gammaContextPtr gmesa );
-void gammaPrintGlobalLRU( gammaContextPtr gmesa );
-
-extern void gammaFallback( gammaContextPtr gmesa, GLuint bit, GLboolean mode );
-#define FALLBACK( imesa, bit, mode ) gammaFallback( imesa, bit, mode )
-
-/* Use the templated vertex formats. Only one of these is used in gamma.
- */
-#define TAG(x) gamma##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*gamma_quad_func)( gammaContextPtr,
- const gammaVertex *,
- const gammaVertex *,
- const gammaVertex *,
- const gammaVertex * );
-typedef void (*gamma_tri_func)( gammaContextPtr,
- const gammaVertex *,
- const gammaVertex *,
- const gammaVertex * );
-typedef void (*gamma_line_func)( gammaContextPtr,
- const gammaVertex *,
- const gammaVertex * );
-typedef void (*gamma_point_func)( gammaContextPtr,
- const gammaVertex * );
-
-
-struct gamma_context {
- GLcontext *glCtx; /* Mesa context */
-
- __DRIcontextPrivate *driContext;
- __DRIscreenPrivate *driScreen;
- __DRIdrawablePrivate *driDrawable;
-
- GLuint new_gl_state;
- GLuint new_state;
- GLuint dirty;
-
- GLINTSAREADRIPtr sarea;
-
- /* Mirrors of some DRI state
- */
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
-
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
-
- dmaBuf buf; /* DMA buffer for regular cmds */
- int bufIndex;
- int bufSize;
- int bufCount;
-
- dmaBuf WCbuf; /* DMA buffer for window changed cmds */
- int WCbufIndex;
- int WCbufSize;
- int WCbufCount;
-
- gammaScreenPtr gammaScreen; /* Screen private DRI data */
-
- int drawOffset;
- int readOffset;
-
- gamma_point_func draw_point;
- gamma_line_func draw_line;
- gamma_tri_func draw_tri;
- gamma_quad_func draw_quad;
-
- GLuint Fallback;
- GLuint RenderIndex;
- GLuint SetupNewInputs;
- GLuint SetupIndex;
-
- GLuint vertex_format;
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- GLubyte *verts;
-
- GLfloat hw_viewport[16];
- GLuint hw_primitive;
- GLenum render_primitive;
-
- GLfloat depth_scale;
-
- gammaTextureObjectPtr CurrentTexObj[2];
- struct gamma_texture_object_t TexObjList;
- struct gamma_texture_object_t SwappedOut;
- GLenum TexEnvImageFmt[2];
-
- memHeap_t *texHeap;
-
- unsigned int lastSwap;
- int texAge;
- int ctxAge;
- int dirtyAge;
- unsigned int lastStamp;
-
-
- u_int32_t ClearColor;
- u_int32_t Color;
- u_int32_t DitherMode;
- u_int32_t ClearDepth;
- u_int32_t FogMode;
- u_int32_t AreaStippleMode;
- u_int32_t LBReadFormat;
- u_int32_t LBWriteFormat;
- u_int32_t LineMode;
- u_int32_t PointMode;
- u_int32_t TriangleMode;
- u_int32_t AntialiasMode;
- GLfloat ViewportScaleX;
- GLfloat ViewportScaleY;
- GLfloat ViewportScaleZ;
- GLfloat ViewportOffsetX;
- GLfloat ViewportOffsetY;
- GLfloat ViewportOffsetZ;
- int MatrixMode;
- int DepthMode;
- int TransformMode;
- int LBReadMode;
- int FBReadMode;
- int FBWindowBase;
- int LBWindowBase;
- int ColorDDAMode;
- int GeometryMode;
- int AlphaTestMode;
- int AlphaBlendMode;
- int AB_FBReadMode;
- int AB_FBReadMode_Save;
- int DeltaMode;
- int ColorMaterialMode;
- int FBHardwareWriteMask;
- int MaterialMode;
- int NormalizeMode;
- int LightingMode;
- int Light0Mode;
- int Light1Mode;
- int Light2Mode;
- int Light3Mode;
- int Light4Mode;
- int Light5Mode;
- int Light6Mode;
- int Light7Mode;
- int Light8Mode;
- int Light9Mode;
- int Light10Mode;
- int Light11Mode;
- int Light12Mode;
- int Light13Mode;
- int Light14Mode;
- int Light15Mode;
- int LogicalOpMode;
- int ScissorMode;
- int ScissorMaxXY;
- int ScissorMinXY;
- int Window; /* GID part probably should be in draw priv */
- int WindowOrigin;
- int x, y, w, h; /* Probably should be in drawable priv */
- int FrameCount; /* Probably should be in drawable priv */
- int NotClipped; /* Probably should be in drawable priv */
- int WindowChanged; /* Probably should be in drawabl... */
- int Flags;
- int EnabledFlags;
- int DepthSize;
- int Begin;
- GLenum ErrorValue;
- int Texture1DEnabled;
- int Texture2DEnabled;
-
- float ModelView[16];
- float Proj[16];
- float ModelViewProj[16];
- float Texture[16];
-
- float ModelViewStack[(MAX_MODELVIEW_STACK-1)*16];
- int ModelViewCount;
- float ProjStack[(MAX_PROJECTION_STACK-1)*16];
- int ProjCount;
- float TextureStack[(MAX_TEXTURE_STACK-1)*16];
- int TextureCount;
-};
-
-static __inline GLuint gammaPackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return PACK_COLOR_565( r, g, b );
- case 4:
- return PACK_COLOR_8888( a, r, g, b );
- default:
- return 0;
- }
-}
-
-#define GAMMA_CONTEXT(ctx) ((gammaContextPtr)(ctx->DriverCtx))
-
-#endif /* _GAMMA_CONTEXT_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_dd.c
deleted file mode 100644
index cca382d89..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_dd.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- */
-
-#include "gamma_context.h"
-#include "gamma_vb.h"
-#include "gamma_lock.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-
-#include "context.h"
-#include "swrast/swrast.h"
-
-#define GAMMA_DATE "20021125"
-
-
-/* Return the width and height of the current color buffer.
- */
-static void gammaDDGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- GAMMAHW_LOCK( gmesa );
- *width = gmesa->driDrawable->w;
- *height = gmesa->driDrawable->h;
- GAMMAHW_UNLOCK( gmesa );
-}
-
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *gammaDDGetString( GLcontext *ctx, GLenum name )
-{
- static char buffer[128];
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *)"VA Linux Systems, Inc.";
-
- case GL_RENDERER:
- sprintf( buffer, "Mesa DRI Gamma " GAMMA_DATE );
-
- /* Append any CPU-specific information.
- */
-#ifdef USE_X86_ASM
- if ( _mesa_x86_cpu_features ) {
- strncat( buffer, " x86", 4 );
- }
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- strncat( buffer, "/MMX", 4 );
- }
-#endif
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- strncat( buffer, "/3DNow!", 7 );
- }
-#endif
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- strncat( buffer, "/SSE", 4 );
- }
-#endif
-#endif
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-/* Enable the extensions supported by this driver.
- */
-void gammaDDInitExtensions( GLcontext *ctx )
-{
- /* None... */
-}
-
-/* Initialize the driver's misc functions.
- */
-void gammaDDInitDriverFuncs( GLcontext *ctx )
-{
- ctx->Driver.GetBufferSize = gammaDDGetBufferSize;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
- ctx->Driver.GetString = gammaDDGetString;
-
- ctx->Driver.Error = NULL;
-
- /* Pixel path fallbacks
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_inithw.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_inithw.c
deleted file mode 100644
index 47eb802b4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_inithw.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c,v 1.9 2002/10/30 12:51:29 alanh Exp $ */
-
-#include "gamma_context.h"
-#include "glint_dri.h"
-
-void gammaInitHW( gammaContextPtr gmesa )
-{
- GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv;
- int i;
-
- if (gDRIPriv->numMultiDevices == 2) {
- /* Set up each MX's ScanLineOwnership for OpenGL */
- CHECK_DMA_BUFFER(gmesa, 5);
- WRITE(gmesa->buf, BroadcastMask, 1);
- WRITE(gmesa->buf, ScanLineOwnership, 5); /* Use bottom left as [0,0] */
- WRITE(gmesa->buf, BroadcastMask, 2);
- WRITE(gmesa->buf, ScanLineOwnership, 1); /* Use bottom left as [0,0] */
- /* Broadcast to both MX's */
- WRITE(gmesa->buf, BroadcastMask, 3);
- FLUSH_DMA_BUFFER(gmesa);
- }
-
- gmesa->AlphaBlendMode = (AlphaBlendModeDisable |
- AB_Src_One |
- AB_Dst_Zero |
- AB_NoAlphaBufferPresent |
- AB_ColorFmt_8888 |
- AB_ColorOrder_RGB |
- AB_OpenGLType |
- AB_AlphaDst_FBData |
- AB_ColorConversionScale |
- AB_AlphaConversionScale);
-
- gmesa->DitherMode = DitherModeEnable | DM_ColorOrder_RGB;
-
- switch (gmesa->gammaScreen->cpp) {
- case 2:
- gmesa->DitherMode |= DM_ColorFmt_5555;
- gmesa->AlphaBlendMode |= AB_ColorFmt_5555;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PixelSize, 1);
- break;
- case 4:
- gmesa->DitherMode |= DM_ColorFmt_8888;
- gmesa->AlphaBlendMode |= AB_ColorFmt_8888;
- WRITE(gmesa->buf, PixelSize, 0);
- break;
- }
-
- /* FIXME for stencil, gid, etc */
- switch (gmesa->DepthSize) {
- case 16:
- gmesa->LBReadFormat =
- (LBRF_DepthWidth16 |
- LBRF_StencilWidth8 |
- LBRF_StencilPos16 |
- LBRF_FrameCount8 |
- LBRF_FrameCountPos24 |
- LBRF_GIDWidth4 |
- LBRF_GIDPos32 );
- gmesa->LBWriteFormat =
- (LBRF_DepthWidth16 |
- LBRF_StencilWidth8 |
- LBRF_StencilPos16 |
- LBRF_FrameCount8 |
- LBRF_FrameCountPos24 |
- LBRF_GIDWidth4 |
- LBRF_GIDPos32 );
- break;
- case 24:
- gmesa->LBReadFormat =
- (LBRF_DepthWidth24 |
- LBRF_StencilWidth8 |
- LBRF_StencilPos24 |
- LBRF_FrameCount8 |
- LBRF_FrameCountPos32 |
- LBRF_GIDWidth4 |
- LBRF_GIDPos36 );
- gmesa->LBWriteFormat =
- (LBRF_DepthWidth24 |
- LBRF_StencilWidth8 |
- LBRF_StencilPos24 |
- LBRF_FrameCount8 |
- LBRF_FrameCountPos32 |
- LBRF_GIDWidth4 |
- LBRF_GIDPos36 );
- break;
- case 32:
- gmesa->LBReadFormat =
- (LBRF_DepthWidth32 |
- LBRF_StencilWidth8 |
- LBRF_StencilPos32 |
- LBRF_FrameCount8 |
- LBRF_FrameCountPos40 |
- LBRF_GIDWidth4 |
- LBRF_GIDPos44 );
- gmesa->LBWriteFormat =
- (LBRF_DepthWidth32 |
- LBRF_StencilWidth8 |
- LBRF_StencilPos32 |
- LBRF_FrameCount8 |
- LBRF_FrameCountPos40 |
- LBRF_GIDWidth4 |
- LBRF_GIDPos44 );
- break;
- }
-
- gmesa->FBHardwareWriteMask = 0xffffffff;
- gmesa->FogMode = FogModeDisable;
- gmesa->ClearDepth = 0xffffffff;
- gmesa->AreaStippleMode = AreaStippleModeDisable;
- gmesa->x = 0;
- gmesa->y = 0;
- gmesa->w = 0;
- gmesa->h = 0;
- gmesa->FrameCount = 0;
- gmesa->MatrixMode = GL_MODELVIEW;
- gmesa->ModelViewCount = 0;
- gmesa->ProjCount = 0;
- gmesa->TextureCount = 0;
- gmesa->PointMode = PM_AntialiasQuality_4x4;
- gmesa->LineMode = LM_AntialiasQuality_4x4;
- gmesa->TriangleMode = TM_AntialiasQuality_4x4;
- gmesa->AntialiasMode = AntialiasModeDisable;
-
- for (i = 0; i < 16; i++)
- if (i % 5 == 0)
- gmesa->ModelView[i] =
- gmesa->Proj[i] =
- gmesa->ModelViewProj[i] =
- gmesa->Texture[i] = 1.0;
- else
- gmesa->ModelView[i] =
- gmesa->Proj[i] =
- gmesa->ModelViewProj[i] =
- gmesa->Texture[i] = 0.0;
-
- gmesa->LBReadMode = (LBReadSrcDisable |
- LBReadDstDisable |
- LBDataTypeDefault |
- LBWindowOriginBot |
- gDRIPriv->pprod);
- gmesa->FBReadMode = (FBReadSrcDisable |
- FBReadDstDisable |
- FBDataTypeDefault |
- FBWindowOriginBot |
- gDRIPriv->pprod);
-
- if (gDRIPriv->numMultiDevices == 2) {
- gmesa->LBReadMode |= LBScanLineInt2;
- gmesa->FBReadMode |= FBScanLineInt2;
- gmesa->LBWindowBase = gmesa->driScreen->fbWidth *
- (gmesa->driScreen->fbHeight/2 - 1);
- gmesa->FBWindowBase = gmesa->driScreen->fbWidth *
- (gmesa->driScreen->fbHeight/2 - 1);
- } else {
- gmesa->LBWindowBase = gmesa->driScreen->fbWidth *
- (gmesa->driScreen->fbHeight - 1);
- gmesa->FBWindowBase = gmesa->driScreen->fbWidth *
- (gmesa->driScreen->fbHeight - 1);
- }
-
- gmesa->Begin = (B_AreaStippleDisable |
- B_LineStippleDisable |
- B_AntiAliasDisable |
- B_TextureDisable |
- B_FogDisable |
- B_SubPixelCorrectEnable |
- B_PrimType_Null);
-
- gmesa->ColorDDAMode = (ColorDDAEnable |
- ColorDDAGouraud);
-
- gmesa->GeometryMode = (GM_TextureDisable |
- GM_FogDisable |
- GM_FogExp |
- GM_FrontPolyFill |
- GM_BackPolyFill |
- GM_FrontFaceCCW |
- GM_PolyCullDisable |
- GM_PolyCullBack |
- GM_ClipShortLinesDisable |
- GM_ClipSmallTrisDisable |
- GM_RenderMode |
- GM_Feedback2D |
- GM_CullFaceNormDisable |
- GM_AutoFaceNormDisable |
- GM_GouraudShading |
- GM_UserClipNone |
- GM_PolyOffsetPointDisable |
- GM_PolyOffsetLineDisable |
- GM_PolyOffsetFillDisable |
- GM_InvertFaceNormCullDisable);
-
- gmesa->AlphaTestMode = (AlphaTestModeDisable |
- AT_Always);
-
- gmesa->AB_FBReadMode_Save = gmesa->AB_FBReadMode = 0;
-
- gmesa->Window = (WindowEnable | /* For GID testing */
- W_PassIfEqual |
- (0 << 5)); /* GID part is set from draw priv (below) */
-
- gmesa->NotClipped = GL_FALSE;
- gmesa->WindowChanged = GL_TRUE;
-
- gmesa->Texture1DEnabled = GL_FALSE;
- gmesa->Texture2DEnabled = GL_FALSE;
-
- gmesa->DepthMode |= (DepthModeDisable |
- DM_WriteMask |
- DM_Less);
-
- gmesa->DeltaMode |= (DM_SubPixlCorrectionEnable |
- DM_SmoothShadingEnable |
- DM_Target500TXMX);
-
- gmesa->LightingMode = LightingModeDisable | LightingModeSpecularEnable;
- gmesa->Light0Mode = LNM_Off;
- gmesa->Light1Mode = LNM_Off;
- gmesa->Light2Mode = LNM_Off;
- gmesa->Light3Mode = LNM_Off;
- gmesa->Light4Mode = LNM_Off;
- gmesa->Light5Mode = LNM_Off;
- gmesa->Light6Mode = LNM_Off;
- gmesa->Light7Mode = LNM_Off;
- gmesa->Light8Mode = LNM_Off;
- gmesa->Light9Mode = LNM_Off;
- gmesa->Light10Mode = LNM_Off;
- gmesa->Light11Mode = LNM_Off;
- gmesa->Light12Mode = LNM_Off;
- gmesa->Light13Mode = LNM_Off;
- gmesa->Light14Mode = LNM_Off;
- gmesa->Light15Mode = LNM_Off;
-
- gmesa->LogicalOpMode = LogicalOpModeDisable;
-
- gmesa->MaterialMode = MaterialModeDisable;
-
- gmesa->ScissorMode = UserScissorDisable | ScreenScissorDisable;
-
- gmesa->TransformMode = XM_UseModelViewProjMatrix |
- XM_TexGenModeS_None |
- XM_TexGenModeT_None |
- XM_TexGenModeR_None |
- XM_TexGenModeQ_None;
-
- CHECK_DMA_BUFFER(gmesa, 20);
- WRITE(gmesa->buf, LineStippleMode, 0);
- WRITE(gmesa->buf, RouterMode, 0);
- WRITE(gmesa->buf, TextureAddressMode, 0);
- WRITE(gmesa->buf, TextureReadMode, 0);
- WRITE(gmesa->buf, TextureFilterMode, 0);
- WRITE(gmesa->buf, TextureColorMode, 0);
- WRITE(gmesa->buf, StencilMode, 0);
- WRITE(gmesa->buf, PatternRamMode, 0);
- WRITE(gmesa->buf, ChromaTestMode, 0);
- WRITE(gmesa->buf, StatisticMode, 0);
- WRITE(gmesa->buf, AreaStippleMode, gmesa->AreaStippleMode);
- WRITE(gmesa->buf, ScissorMode, gmesa->ScissorMode);
- WRITE(gmesa->buf, FogMode, gmesa->FogMode);
- WRITE(gmesa->buf, AntialiasMode, gmesa->AntialiasMode);
- WRITE(gmesa->buf, LogicalOpMode, gmesa->LogicalOpMode);
- WRITE(gmesa->buf, TriangleMode, gmesa->TriangleMode);
- WRITE(gmesa->buf, PointMode, gmesa->PointMode);
- WRITE(gmesa->buf, LineMode, gmesa->LineMode);
- WRITE(gmesa->buf, LBWriteFormat, gmesa->LBWriteFormat);
- WRITE(gmesa->buf, LBReadFormat, gmesa->LBReadFormat);
-
- /* Framebuffer initialization */
- CHECK_DMA_BUFFER(gmesa, 10);
- WRITE(gmesa->buf, FBSourceData, 0);
- WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode);
- if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER) {
- if (gDRIPriv->numMultiDevices == 2) {
- WRITE(gmesa->buf, FBPixelOffset,
- (gmesa->driScreen->fbHeight/2)*gmesa->driScreen->fbWidth);
- } else {
- WRITE(gmesa->buf, FBPixelOffset,
- gmesa->driScreen->fbHeight*gmesa->driScreen->fbWidth);
- }
- } else
- WRITE(gmesa->buf, FBPixelOffset, 0);
- WRITE(gmesa->buf, FBSourceOffset, 0);
- WRITE(gmesa->buf, FBHardwareWriteMask, 0xffffffff);
- WRITE(gmesa->buf, FBSoftwareWriteMask, 0xffffffff);
- WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable);
- WRITE(gmesa->buf, FBWindowBase, gmesa->FBWindowBase);
- WRITE(gmesa->buf, ScreenSize, ((gmesa->driScreen->fbHeight << 16) |
- (gmesa->driScreen->fbWidth)));
- WRITE(gmesa->buf, WindowOrigin, 0x00000000);
-
- /* Localbuffer initialization */
- CHECK_DMA_BUFFER(gmesa, 5);
- WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode);
- WRITE(gmesa->buf, LBSourceOffset, 0);
- WRITE(gmesa->buf, LBWriteMode, LBWriteModeEnable);
- WRITE(gmesa->buf, LBWindowOffset, 0);
- WRITE(gmesa->buf, LBWindowBase, gmesa->LBWindowBase);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Rectangle2DControl, 1);
-
- CHECK_DMA_BUFFER(gmesa, 11);
- WRITE(gmesa->buf, DepthMode, gmesa->DepthMode);
- WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode);
- WRITE(gmesa->buf, FBBlockColor, 0x00000000);
- WRITE(gmesa->buf, ConstantColor, 0x00000000);
- WRITE(gmesa->buf, AlphaTestMode, gmesa->AlphaTestMode);
- WRITE(gmesa->buf, AlphaBlendMode, gmesa->AlphaBlendMode);
- WRITE(gmesa->buf, DitherMode, gmesa->DitherMode);
- if (gDRIPriv->numMultiDevices == 2)
- WRITE(gmesa->buf, RasterizerMode, RM_MultiGLINT | RM_BiasCoordNearHalf);
- else
- WRITE(gmesa->buf, RasterizerMode, RM_BiasCoordNearHalf);
- WRITE(gmesa->buf, GLINTWindow, gmesa->Window);
- WRITE(gmesa->buf, FastClearDepth, gmesa->ClearDepth);
- WRITE(gmesa->buf, GLINTDepth, gmesa->ClearDepth);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, EdgeFlag, EdgeFlagEnable);
-
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, ModelViewMatrix0, 1.0);
- WRITEF(gmesa->buf, ModelViewMatrix1, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix2, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix3, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix4, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix5, 1.0);
- WRITEF(gmesa->buf, ModelViewMatrix6, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix7, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix8, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix9, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix10, 1.0);
- WRITEF(gmesa->buf, ModelViewMatrix11, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix12, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix13, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix14, 0.0);
- WRITEF(gmesa->buf, ModelViewMatrix15, 1.0);
-
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix0, 1.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix1, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix2, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix3, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix4, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix5, 1.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix6, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix7, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix8, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix9, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix10, 1.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix11, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix12, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix13, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix14, 0.0);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix15, 1.0);
-
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, TextureMatrix0, 1.0);
- WRITEF(gmesa->buf, TextureMatrix1, 0.0);
- WRITEF(gmesa->buf, TextureMatrix2, 0.0);
- WRITEF(gmesa->buf, TextureMatrix3, 0.0);
- WRITEF(gmesa->buf, TextureMatrix4, 0.0);
- WRITEF(gmesa->buf, TextureMatrix5, 1.0);
- WRITEF(gmesa->buf, TextureMatrix6, 0.0);
- WRITEF(gmesa->buf, TextureMatrix7, 0.0);
- WRITEF(gmesa->buf, TextureMatrix8, 0.0);
- WRITEF(gmesa->buf, TextureMatrix9, 0.0);
- WRITEF(gmesa->buf, TextureMatrix10, 1.0);
- WRITEF(gmesa->buf, TextureMatrix11, 0.0);
- WRITEF(gmesa->buf, TextureMatrix12, 0.0);
- WRITEF(gmesa->buf, TextureMatrix13, 0.0);
- WRITEF(gmesa->buf, TextureMatrix14, 0.0);
- WRITEF(gmesa->buf, TextureMatrix15, 1.0);
-
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, TexGen0, 0.0);
- WRITEF(gmesa->buf, TexGen1, 0.0);
- WRITEF(gmesa->buf, TexGen2, 0.0);
- WRITEF(gmesa->buf, TexGen3, 0.0);
- WRITEF(gmesa->buf, TexGen4, 0.0);
- WRITEF(gmesa->buf, TexGen5, 0.0);
- WRITEF(gmesa->buf, TexGen6, 0.0);
- WRITEF(gmesa->buf, TexGen7, 0.0);
- WRITEF(gmesa->buf, TexGen8, 0.0);
- WRITEF(gmesa->buf, TexGen9, 0.0);
- WRITEF(gmesa->buf, TexGen10, 0.0);
- WRITEF(gmesa->buf, TexGen11, 0.0);
- WRITEF(gmesa->buf, TexGen12, 0.0);
- WRITEF(gmesa->buf, TexGen13, 0.0);
- WRITEF(gmesa->buf, TexGen14, 0.0);
- WRITEF(gmesa->buf, TexGen15, 0.0);
-
- CHECK_DMA_BUFFER(gmesa, 9);
- WRITEF(gmesa->buf, NormalMatrix0, 1.0);
- WRITEF(gmesa->buf, NormalMatrix1, 0.0);
- WRITEF(gmesa->buf, NormalMatrix2, 0.0);
- WRITEF(gmesa->buf, NormalMatrix3, 0.0);
- WRITEF(gmesa->buf, NormalMatrix4, 1.0);
- WRITEF(gmesa->buf, NormalMatrix5, 0.0);
- WRITEF(gmesa->buf, NormalMatrix6, 0.0);
- WRITEF(gmesa->buf, NormalMatrix7, 0.0);
- WRITEF(gmesa->buf, NormalMatrix8, 1.0);
-
- CHECK_DMA_BUFFER(gmesa, 3);
- WRITEF(gmesa->buf, FogDensity, 0.0);
- WRITEF(gmesa->buf, FogEnd, 0.0);
- WRITEF(gmesa->buf, FogScale, 0.0);
-
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITEF(gmesa->buf, LineClipLengthThreshold, 0.0);
- WRITEF(gmesa->buf, TriangleClipAreaThreshold, 0.0);
-
- CHECK_DMA_BUFFER(gmesa, 5);
- WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode);
- WRITE(gmesa->buf, NormalizeMode, NormalizeModeDisable);
- WRITE(gmesa->buf, LightingMode, gmesa->LightingMode);
- WRITE(gmesa->buf, ColorMaterialMode, ColorMaterialModeDisable);
- WRITE(gmesa->buf, MaterialMode, MaterialModeDisable);
-
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, FrontSpecularExponent, 0); /* fixed point */
- WRITE(gmesa->buf, BackSpecularExponent, 0); /* fixed point */
-
- CHECK_DMA_BUFFER(gmesa, 29);
- WRITEF(gmesa->buf, FrontAmbientColorRed, 0.2);
- WRITEF(gmesa->buf, FrontAmbientColorGreen, 0.2);
- WRITEF(gmesa->buf, FrontAmbientColorBlue, 0.2);
- WRITEF(gmesa->buf, BackAmbientColorRed, 0.2);
- WRITEF(gmesa->buf, BackAmbientColorGreen, 0.2);
- WRITEF(gmesa->buf, BackAmbientColorBlue, 0.2);
- WRITEF(gmesa->buf, FrontDiffuseColorRed, 0.8);
- WRITEF(gmesa->buf, FrontDiffuseColorGreen, 0.8);
- WRITEF(gmesa->buf, FrontDiffuseColorBlue, 0.8);
- WRITEF(gmesa->buf, BackDiffuseColorRed, 0.8);
- WRITEF(gmesa->buf, BackDiffuseColorGreen, 0.8);
- WRITEF(gmesa->buf, BackDiffuseColorBlue, 0.8);
- WRITEF(gmesa->buf, FrontSpecularColorRed, 0.0);
- WRITEF(gmesa->buf, FrontSpecularColorGreen, 0.0);
- WRITEF(gmesa->buf, FrontSpecularColorBlue, 0.0);
- WRITEF(gmesa->buf, BackSpecularColorRed, 0.0);
- WRITEF(gmesa->buf, BackSpecularColorGreen, 0.0);
- WRITEF(gmesa->buf, BackSpecularColorBlue, 0.0);
- WRITEF(gmesa->buf, FrontEmissiveColorRed, 0.0);
- WRITEF(gmesa->buf, FrontEmissiveColorGreen, 0.0);
- WRITEF(gmesa->buf, FrontEmissiveColorBlue, 0.0);
- WRITEF(gmesa->buf, BackEmissiveColorRed, 0.0);
- WRITEF(gmesa->buf, BackEmissiveColorGreen, 0.0);
- WRITEF(gmesa->buf, BackEmissiveColorBlue, 0.0);
- WRITEF(gmesa->buf, SceneAmbientColorRed, 0.2);
- WRITEF(gmesa->buf, SceneAmbientColorGreen, 0.2);
- WRITEF(gmesa->buf, SceneAmbientColorBlue, 0.2);
- WRITEF(gmesa->buf, FrontAlpha, 1.0);
- WRITEF(gmesa->buf, BackAlpha, 1.0);
-
- CHECK_DMA_BUFFER(gmesa, 7);
- WRITE(gmesa->buf, PointSize, 1);
- WRITEF(gmesa->buf, AApointSize, 1.0);
- WRITE(gmesa->buf, LineWidth, 1);
- WRITEF(gmesa->buf, AAlineWidth, 1.0);
- WRITE(gmesa->buf, LineWidthOffset, 0);
- WRITE(gmesa->buf, TransformMode, gmesa->TransformMode);
- WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode);
-
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITE(gmesa->buf, Light0Mode, LNM_Off);
- WRITE(gmesa->buf, Light1Mode, LNM_Off);
- WRITE(gmesa->buf, Light2Mode, LNM_Off);
- WRITE(gmesa->buf, Light3Mode, LNM_Off);
- WRITE(gmesa->buf, Light4Mode, LNM_Off);
- WRITE(gmesa->buf, Light5Mode, LNM_Off);
- WRITE(gmesa->buf, Light6Mode, LNM_Off);
- WRITE(gmesa->buf, Light7Mode, LNM_Off);
- WRITE(gmesa->buf, Light8Mode, LNM_Off);
- WRITE(gmesa->buf, Light9Mode, LNM_Off);
- WRITE(gmesa->buf, Light10Mode, LNM_Off);
- WRITE(gmesa->buf, Light11Mode, LNM_Off);
- WRITE(gmesa->buf, Light12Mode, LNM_Off);
- WRITE(gmesa->buf, Light13Mode, LNM_Off);
- WRITE(gmesa->buf, Light14Mode, LNM_Off);
- WRITE(gmesa->buf, Light15Mode, LNM_Off);
-
- CHECK_DMA_BUFFER(gmesa, 22);
- WRITEF(gmesa->buf, Light0AmbientIntensityBlue, 0.0);
- WRITEF(gmesa->buf, Light0AmbientIntensityGreen, 0.0);
- WRITEF(gmesa->buf, Light0AmbientIntensityRed, 0.0);
- WRITEF(gmesa->buf, Light0DiffuseIntensityBlue, 1.0);
- WRITEF(gmesa->buf, Light0DiffuseIntensityGreen, 1.0);
- WRITEF(gmesa->buf, Light0DiffuseIntensityRed, 1.0);
- WRITEF(gmesa->buf, Light0SpecularIntensityBlue, 1.0);
- WRITEF(gmesa->buf, Light0SpecularIntensityGreen, 1.0);
- WRITEF(gmesa->buf, Light0SpecularIntensityRed, 1.0);
- WRITEF(gmesa->buf, Light0SpotlightDirectionZ, 0.0);
- WRITEF(gmesa->buf, Light0SpotlightDirectionY, 0.0);
- WRITEF(gmesa->buf, Light0SpotlightDirectionX, -1.0);
- WRITEF(gmesa->buf, Light0SpotlightExponent, 0.0);
- WRITEF(gmesa->buf, Light0PositionZ, 0.0);
- WRITEF(gmesa->buf, Light0PositionY, 0.0);
- WRITEF(gmesa->buf, Light0PositionX, 1.0);
- WRITEF(gmesa->buf, Light0PositionW, 0.0);
- WRITEF(gmesa->buf, Light0CosSpotlightCutoffAngle, -1.0);
- WRITEF(gmesa->buf, Light0ConstantAttenuation, 1.0);
- WRITEF(gmesa->buf, Light0LinearAttenuation, 0.0);
- WRITEF(gmesa->buf, Light0QuadraticAttenuation,0.0);
-
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITEF(gmesa->buf, XBias, 0.0);
- WRITEF(gmesa->buf, YBias, 0.0);
-
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, ViewPortScaleX, gmesa->driScreen->fbWidth/4);
- WRITEF(gmesa->buf, ViewPortScaleY, gmesa->driScreen->fbHeight/4);
- WRITEF(gmesa->buf, ViewPortScaleZ, 1.0f);
- WRITEF(gmesa->buf, ViewPortOffsetX, gmesa->x);
- WRITEF(gmesa->buf, ViewPortOffsetY, gmesa->y);
- WRITEF(gmesa->buf, ViewPortOffsetZ, 0.0f);
-
- CHECK_DMA_BUFFER(gmesa, 3);
- WRITEF(gmesa->buf, Nz, 1.0);
- WRITEF(gmesa->buf, Ny, 0.0);
- WRITEF(gmesa->buf, Nx, 0.0);
-
- /* Send the initialization commands to the HW */
- FLUSH_DMA_BUFFER(gmesa);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.c
deleted file mode 100644
index 4c0970f09..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */
-
-#include "gamma_context.h"
-#include "gamma_lock.h"
-
-#ifdef DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void gammaGetLock( gammaContextPtr gmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = gmesa->driDrawable;
- __DRIscreenPrivate *sPriv = gmesa->driScreen;
-
- drmGetLock( gmesa->driFd, gmesa->hHWContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( gmesa->lastStamp != dPriv->lastStamp ) {
- gmesa->lastStamp = dPriv->lastStamp;
- gmesa->new_state |= GAMMA_NEW_WINDOW | GAMMA_NEW_CLIP;
- }
-
- gmesa->numClipRects = dPriv->numClipRects;
- gmesa->pClipRects = dPriv->pClipRects;
-
-#if 0
- gmesa->dirty = ~0;
-
- if ( sarea->ctxOwner != gmesa->hHWContext ) {
- sarea->ctxOwner = gmesa->hHWContext;
- gmesa->dirty = GAMMA_UPLOAD_ALL;
- }
-
- for ( i = 0 ; i < gmesa->lastTexHeap ; i++ ) {
- if ( sarea->texAge[i] != gmesa->lastTexAge[i] ) {
- gammaAgeTextures( gmesa, i );
- }
- }
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.h
deleted file mode 100644
index 2d117320d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_lock.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef __GAMMA_LOCK_H__
-#define __GAMMA_LOCK_H__
-
-extern void gammaGetLock( gammaContextPtr gmesa, GLuint flags );
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( gmesa ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( gmesa->driHwLock, gmesa->hHWContext, \
- (DRM_LOCK_HELD | gmesa->hHWContext), __ret ); \
- if ( __ret ) \
- gammaGetLock( gmesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-/* Unlock the hardware.
- */
-#define UNLOCK_HARDWARE( gmesa ) \
- do { \
- DRM_UNLOCK( gmesa->driFd, \
- gmesa->driHwLock, \
- gmesa->hHWContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-#define GAMMAHW_LOCK( gmesa ) \
- DRM_UNLOCK(gmesa->driFd, gmesa->driHwLock, gmesa->hHWContext); \
- DRM_SPINLOCK(&gmesa->driScreen->pSAREA->drawable_lock, \
- gmesa->driScreen->drawLockID); \
- VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa);
-
-#define GAMMAHW_UNLOCK( gmesa ) \
- DRM_SPINUNLOCK(&gmesa->driScreen->pSAREA->drawable_lock, \
- gmesa->driScreen->drawLockID); \
- VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa);
-
-#endif /* __GAMMA_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_macros.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_macros.h
deleted file mode 100644
index 974fe569d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_macros.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- */
-
-#ifndef _GAMMA_MACROS_H_
-#define _GAMMA_MACROS_H_
-
-#define DEBUG_DRMDMA
-#define DEBUG_ERRORS
-#define DEBUG_COMMANDS_NOT
-#define DEBUG_VERBOSE_NOT
-#define DEBUG_VERBOSE_EXTRA_NOT
-
-#define RANDOMIZE_COLORS_NOT
-#define TURN_OFF_CLEARS_NOT
-#define CULL_ALL_PRIMS_NOT
-#define TURN_OFF_DEPTH_NOT
-#define TURN_OFF_BLEND_NOT
-#define FAST_CLEAR_4_NOT
-#define FORCE_DEPTH32_NOT
-#define DONT_SEND_DMA_NOT
-#define TURN_OFF_FCP_NOT
-#define TURN_OFF_TEXTURES_NOT
-#define DO_VALIDATE
-
-#define GAMMA_DMA_BUFFER_SIZE 4096
-
-#if 0
-#define GAMMA_DMA_SEND_FLAGS DRM_DMA_PRIORITY
-#define GAMMA_DMA_SEND_FLAGS DRM_DMA_BLOCK
-#else
-/* MUST use non-blocking dma flags for drawable lock routines */
-#define GAMMA_DMA_SEND_FLAGS 0
-#endif
-
-#if 0
-#define GAMMA_DMA_GET_FLAGS \
- (DRM_DMA_SMALLER_OK | DRM_DMA_LARGER_OK | DRM_DMA_WAIT)
-#else
-#define GAMMA_DMA_GET_FLAGS DRM_DMA_WAIT
-#endif
-
-#if defined(DEBUG_DRMDMA) || defined(DEBUG_COMMANDS) || defined(DEBUG_VERBOSE)
-#include <stdio.h>
-#endif
-
-/* Note: The argument to DEBUG_GLCMDS() _must_ be enclosed in parenthesis */
-#ifdef DEBUG_VERBOSE
-#define DEBUG_GLCMDS(s) printf s
-#else
-#define DEBUG_GLCMDS(s)
-#endif
-
-/* Note: The argument to DEBUG_DMACMDS() _must_ be enclosed in parenthesis */
-#ifdef DEBUG_DRMDMA
-#define DEBUG_DMACMDS(s) printf s
-#else
-#define DEBUG_DMACMDS(s)
-#endif
-
-/* Note: The argument to DEBUG_WRITE() _must_ be enclosed in parenthesis */
-#ifdef DEBUG_COMMANDS
-#define DEBUG_WRITE(s) printf s
-#else
-#define DEBUG_WRITE(s)
-#endif
-
-/* Note: The argument to DEBUG_ERROR() _must_ be enclosed in parenthesis */
-#ifdef DEBUG_ERRORS
-#define DEBUG_ERROR(s) printf s
-#else
-#define DEBUG_ERROR(s)
-#endif
-
-#define WRITEV(buf,val1,val2,val3,val4) \
-do { \
- buf++->i = 0x9C008300; \
- buf++->f = val1; \
- buf++->f = val2; \
- buf++->f = val3; \
- buf++->f = val4; \
-} while (0)
-
-#define WRITE(buf,reg,val) \
-do { \
- buf++->i = Glint##reg##Tag; \
- buf++->i = val; \
- DEBUG_WRITE(("WRITE(buf, %s, 0x%08x);\n", #reg, (int)val)); \
-} while (0)
-
-#define WRITEF(buf,reg,val) \
-do { \
- buf++->i = Glint##reg##Tag; \
- buf++->f = val; \
- DEBUG_WRITE(("WRITEF(buf, %s, %f);\n", #reg, (float)val)); \
-} while (0)
-
-#define CHECK_WC_DMA_BUFFER(gcp,n) \
-do { \
- (gcp)->WCbufCount += (n<<1); \
-} while (0)
-
-#define CHECK_DMA_BUFFER(gcp,n) \
-do { \
- if ((gcp)->bufCount+(n<<1) >= (gcp)->bufSize) \
- PROCESS_DMA_BUFFER(gcp); \
- (gcp)->bufCount += (n<<1); \
-} while (0)
-
-#define CHECK_DMA_BUFFER2(gcp,n) \
-do { \
- if ((gcp)->bufCount+n >= (gcp)->bufSize) \
- PROCESS_DMA_BUFFER(gcp); \
- (gcp)->bufCount += n; \
-} while (0)
-
-#define FLUSH_DMA_BUFFER(gcp) \
-do { \
- if (gcp->bufCount) \
- PROCESS_DMA_BUFFER(gcp); \
-} while (0)
-
-#ifdef DONT_SEND_DMA
-#define GET_DMA(fd, hHWCtx, n, idx, size)
-#define SEND_DMA(fd, hHWCtx,n, idx, cnt)
-#else
-#define GET_DMA(fd, hHWCtx, n, idx, size) \
-do { \
- drmDMAReq dma; \
- int retcode, i; \
- \
- dma.context = (hHWCtx); \
- dma.send_count = 0; \
- dma.send_list = NULL; \
- dma.send_sizes = NULL; \
- dma.flags = GAMMA_DMA_GET_FLAGS; \
- dma.request_count = (n); \
- dma.request_size = GAMMA_DMA_BUFFER_SIZE; \
- dma.request_list = (idx); \
- dma.request_sizes = (size); \
- \
- do { \
- if ((retcode = drmDMA((fd), &dma))) { \
- DEBUG_DMACMDS(("drmDMA returned %d\n", retcode)); \
- } \
- } while (!(dma).granted_count); \
- \
- for (i = 0; i < (n); i++) { \
- (size)[i] >>= 2; /* Convert from bytes to words */ \
- } \
-} while (0)
-
-#define SEND_DMA(fd, hHWCtx, n, idx, cnt) \
-do { \
- drmDMAReq dma; \
- int retcode, i; \
- \
- for (i = 0; i < (n); i++) { \
- (cnt)[i] <<= 2; /* Convert from words to bytes */ \
- } \
- \
- dma.context = (hHWCtx); \
- dma.send_count = 1; \
- dma.send_list = (idx); \
- dma.send_sizes = (cnt); \
- dma.flags = GAMMA_DMA_SEND_FLAGS; \
- dma.request_count = 0; \
- dma.request_size = 0; \
- dma.request_list = NULL; \
- dma.request_sizes = NULL; \
- \
- if ((retcode = drmDMA((fd), &dma))) { \
- DEBUG_DMACMDS(("drmDMA returned %d\n", retcode)); \
- } \
- \
- for (i = 0; i < (n); i++) { \
- (cnt)[i] = 0; \
- } \
-} while (0)
-#endif
-
-#define GET_FIRST_DMA(fd, hHWCtx, n, idx, size, buf, cnt, gPriv) \
-do { \
- int i; \
- \
- GET_DMA(fd, hHWCtx, n, idx, size); \
- \
- for (i = 0; i < (n); i++) { \
- (buf)[i] = (dmaBuf)(gPriv)->bufs->list[(idx)[i]].address; \
- (cnt)[i] = 0; \
- } \
-} while (0)
-
-#define PROCESS_DMA_BUFFER_TOP_HALF(gcp) \
-do { \
- SEND_DMA((gcp)->driFd, \
- (gcp)->hHWContext, 1, &(gcp)->bufIndex, &(gcp)->bufCount); \
-} while (0)
-
-#define PROCESS_DMA_BUFFER_BOTTOM_HALF(gcp) \
-do { \
- GET_DMA((gcp)->driFd, \
- (gcp)->hHWContext, 1, &(gcp)->bufIndex, &(gcp)->bufSize); \
- \
- (gcp)->buf = \
- (dmaBuf)(gcp)->gammaScreen->bufs->list[(gcp)->bufIndex].address; \
-} while (0)
-
-#define PROCESS_DMA_BUFFER(gcp) \
-do { \
- VALIDATE_DRAWABLE_INFO(gcp); \
- PROCESS_DMA_BUFFER_TOP_HALF(gcp); \
- PROCESS_DMA_BUFFER_BOTTOM_HALF(gcp); \
-} while (0)
-
-#ifdef DO_VALIDATE
-#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \
-do { \
- /*__DRIscreenPrivate *psp = gcp->driScreen;*/ \
- __DRIdrawablePrivate *pdp = gcp->driDrawable; \
- \
- if (*(pdp->pStamp) != pdp->lastStamp) { \
- int old_index = pdp->index; \
- while (*(pdp->pStamp) != pdp->lastStamp) { \
- DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
- } \
- if (pdp->index != old_index) { \
- gcp->Window &= ~W_GIDMask; \
- gcp->Window |= (pdp->index << 5); \
- CHECK_WC_DMA_BUFFER(gcp, 1); \
- WRITE(gcp->WCbuf, GLINTWindow, gcp->Window|(gcp->FrameCount<<9));\
- } \
- \
- gammaUpdateViewportOffset( gcp->glCtx); \
- \
- if (pdp->numClipRects == 1 && \
- pdp->pClipRects->x1 == pdp->x && \
- pdp->pClipRects->x2 == (pdp->x+pdp->w) && \
- pdp->pClipRects->y1 == pdp->y && \
- pdp->pClipRects->y2 == (pdp->y+pdp->h)) { \
- CHECK_WC_DMA_BUFFER(gcp, 1); \
- WRITE(gcp->WCbuf, Rectangle2DControl, 0); \
- gcp->NotClipped = GL_TRUE; \
- } else { \
- CHECK_WC_DMA_BUFFER(gcp, 1); \
- WRITE(gcp->WCbuf, Rectangle2DControl, 1); \
- gcp->NotClipped = GL_FALSE; \
- } \
- gcp->WindowChanged = GL_TRUE; \
- \
- if (gcp->WCbufCount) { \
- SEND_DMA((gcp)->gammaScreen->driScreen->fd, \
- (gcp)->hHWContext, 1, &(gcp)->WCbufIndex, \
- &(gcp)->WCbufCount); \
- (gcp)->WCbufIndex = -1; \
- } \
- } \
-} while (0)
-
-#define VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gcp) \
-do { \
- if ((gcp)->WCbufIndex < 0) { \
- GET_DMA((gcp)->gammaScreen->driScreen->fd, \
- (gcp)->hHWContext, 1, &(gcp)->WCbufIndex, \
- &(gcp)->WCbufSize); \
- \
- (gcp)->WCbuf = \
- (dmaBuf)(gcp)->gammaScreen->bufs-> \
- list[(gcp)->WCbufIndex].address; \
- } \
-} while (0)
-
-#define VALIDATE_DRAWABLE_INFO(gcp) \
-do { \
- __DRIscreenPrivate *psp = gcp->driScreen; \
-if (gcp->driDrawable) { \
- DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
- VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp); \
- DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
- VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gcp); \
-} \
-} while (0)
-#else
-#define VALIDATE_DRAWABLE_INFO(gcp)
-#endif
-
-#define CALC_LOG2(l2,s) \
-do { \
- int __s = s; \
- l2 = 0; \
- while (__s > 1) { ++l2; __s >>= 1; } \
-} while (0)
-
-#endif /* _GAMMA_MACROS_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_regs.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_regs.h
deleted file mode 100644
index 2edda0722..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_regs.h
+++ /dev/null
@@ -1,659 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- */
-
-#ifndef _GAMMA_REGS_H_
-#define _GAMMA_REGS_H_
-
-#include "gamma_client.h"
-
-/**************** MX FLAGS ****************/
-/* FBReadMode */
-#define FBReadSrcDisable 0x00000000
-#define FBReadSrcEnable 0x00000200
-#define FBReadDstDisable 0x00000000
-#define FBReadDstEnable 0x00000400
-#define FBDataTypeDefault 0x00000000
-#define FBDataTypeColor 0x00008000
-#define FBWindowOriginTop 0x00000000
-#define FBWindowOriginBot 0x00010000
-#define FBScanLineInt1 0x00000000
-#define FBScanLineInt2 0x00800000
-#define FBScanLineInt4 0x01000000
-#define FBScanLineInt8 0x01800000
-#define FBSrcAddrConst 0x00000000
-#define FBSrcAddrIndex 0x10000000
-#define FBSrcAddrCoord 0x20000000
-
-/* LBReadMode */
-#define LBPartialProdMask 0x000001ff
-#define LBReadSrcDisable 0x00000000
-#define LBReadSrcEnable 0x00000200
-#define LBReadDstDisable 0x00000000
-#define LBReadDstEnable 0x00000400
-#define LBDataTypeDefault 0x00000000
-#define LBDataTypeStencil 0x00010000
-#define LBDataTypeDepth 0x00020000
-#define LBWindowOriginTop 0x00000000
-#define LBWindowOriginBot 0x00040000
-#define LBScanLineInt1 0x00000000
-#define LBScanLineInt2 0x00100000
-#define LBScanLineInt4 0x00200000
-#define LBScanLineInt8 0x00300000
-
-/* ColorDDAMode */
-#define ColorDDADisable 0x00000000
-#define ColorDDAEnable 0x00000001
-#define ColorDDAFlat 0x00000000
-#define ColorDDAGouraud 0x00000002
-#define ColorDDAShadingMask 0x00000002
-
-/* AlphaTestMode */
-#define AlphaTestModeDisable 0x00000000
-#define AlphaTestModeEnable 0x00000001
-#define AT_Never 0x00000000
-#define AT_Less 0x00000002
-#define AT_Equal 0x00000004
-#define AT_LessEqual 0x00000006
-#define AT_Greater 0x00000008
-#define AT_NotEqual 0x0000000a
-#define AT_GreaterEqual 0x0000000c
-#define AT_Always 0x0000000e
-#define AT_CompareMask 0x0000000e
-#define AT_RefValueMask 0x00000ff0
-
-/* AlphaBlendMode */
-#define AlphaBlendModeDisable 0x00000000
-#define AlphaBlendModeEnable 0x00000001
-#define AB_Src_Zero 0x00000000
-#define AB_Src_One 0x00000002
-#define AB_Src_DstColor 0x00000004
-#define AB_Src_OneMinusDstColor 0x00000006
-#define AB_Src_SrcAlpha 0x00000008
-#define AB_Src_OneMinusSrcAlpha 0x0000000a
-#define AB_Src_DstAlpha 0x0000000c
-#define AB_Src_OneMinusDstAlpha 0x0000000e
-#define AB_Src_SrcAlphaSaturate 0x00000010
-#define AB_SrcBlendMask 0x0000001e
-#define AB_Dst_Zero 0x00000000
-#define AB_Dst_One 0x00000020
-#define AB_Dst_SrcColor 0x00000040
-#define AB_Dst_OneMinusSrcColor 0x00000060
-#define AB_Dst_SrcAlpha 0x00000080
-#define AB_Dst_OneMinusSrcAlpha 0x000000a0
-#define AB_Dst_DstAlpha 0x000000c0
-#define AB_Dst_OneMinusDstAlpha 0x000000e0
-#define AB_DstBlendMask 0x000000e0
-#define AB_ColorFmt_8888 0x00000000
-#define AB_ColorFmt_5555 0x00000100
-#define AB_ColorFmt_4444 0x00000200
-#define AB_ColorFmt_4444Front 0x00000300
-#define AB_ColorFmt_4444Back 0x00000400
-#define AB_ColorFmt_332Front 0x00000500
-#define AB_ColorFmt_332Back 0x00000600
-#define AB_ColorFmt_121Front 0x00000700
-#define AB_ColorFmt_121Back 0x00000800
-#define AB_ColorFmt_555Back 0x00000d00
-#define AB_ColorFmt_CI8 0x00000e00
-#define AB_ColorFmt_CI4 0x00000f00
-#define AB_AlphaBufferPresent 0x00000000
-#define AB_NoAlphaBufferPresent 0x00001000
-#define AB_ColorOrder_BGR 0x00000000
-#define AB_ColorOrder_RGB 0x00002000
-#define AB_OpenGLType 0x00000000
-#define AB_QuickDraw3DType 0x00004000
-#define AB_AlphaDst_FBData 0x00000000
-#define AB_AlphaDst_FBSourceData 0x00008000
-#define AB_ColorConversionScale 0x00000000
-#define AB_ColorConversionShift 0x00010000
-#define AB_AlphaConversionScale 0x00000000
-#define AB_AlphaConversionShift 0x00020000
-
-/* AntialiasMode */
-#define AntialiasModeDisable 0x00000000
-#define AntialiasModeEnable 0x00000001
-
-/* AreaStippleMode */
-#define AreaStippleModeDisable 0x00000000
-#define AreaStippleModeEnable 0x00000001
-#define ASM_X32 0x00000008
-#define ASM_Y32 0x00000040
-
-/* DepthMode */
-#define DepthModeDisable 0x00000000
-#define DepthModeEnable 0x00000001
-#define DM_WriteMask 0x00000002
-#define DM_SourceFragment 0x00000000
-#define DM_SourceLBData 0x00000004
-#define DM_SourceDepthRegister 0x00000008
-#define DM_SourceLBSourceData 0x0000000c
-#define DM_SourceMask 0x0000000c
-#define DM_Never 0x00000000
-#define DM_Less 0x00000010
-#define DM_Equal 0x00000020
-#define DM_LessEqual 0x00000030
-#define DM_Greater 0x00000040
-#define DM_NotEqual 0x00000050
-#define DM_GreaterEqual 0x00000060
-#define DM_Always 0x00000070
-#define DM_CompareMask 0x00000070
-
-/* FBWriteMode */
-#define FBWriteModeDisable 0x00000000
-#define FBWriteModeEnable 0x00000001
-#define FBW_UploadColorData 0x00000008
-
-/* FogMode */
-#define FogModeDisable 0x00000000
-#define FogModeEnable 0x00000001
-
-/* LBWriteMode */
-#define LBWriteModeDisable 0x00000000
-#define LBWriteModeEnable 0x00000001
-#define LBW_UploadNone 0x00000000
-#define LBW_UploadDepth 0x00000002
-#define LBW_UploadStencil 0x00000004
-
-/* LBRead/Write Format */
-#define LBRF_DepthWidth15 0x03 /* only permedia */
-#define LBRF_DepthWidth16 0x00
-#define LBRF_DepthWidth24 0x01
-#define LBRF_DepthWidth32 0x02
-#define LBRF_StencilWidth0 (0 << 2)
-#define LBRF_StencilWidth4 (1 << 2)
-#define LBRF_StencilWidth8 (2 << 2)
-#define LBRF_StencilPos16 (0 << 4)
-#define LBRF_StencilPos20 (1 << 4)
-#define LBRF_StencilPos24 (2 << 4)
-#define LBRF_StencilPos28 (3 << 4)
-#define LBRF_StencilPos32 (4 << 4)
-#define LBRF_FrameCount0 (0 << 7)
-#define LBRF_FrameCount4 (1 << 7)
-#define LBRF_FrameCount8 (2 << 7)
-#define LBRF_FrameCountPos16 (0 << 9)
-#define LBRF_FrameCountPos20 (1 << 9)
-#define LBRF_FrameCountPos24 (2 << 9)
-#define LBRF_FrameCountPos28 (3 << 9)
-#define LBRF_FrameCountPos32 (4 << 9)
-#define LBRF_FrameCountPos36 (5 << 9)
-#define LBRF_FrameCountPos40 (6 << 9)
-#define LBRF_GIDWidth0 (0 << 12)
-#define LBRF_GIDWidth4 (1 << 12)
-#define LBRF_GIDPos16 (0 << 13)
-#define LBRF_GIDPos20 (1 << 13)
-#define LBRF_GIDPos24 (2 << 13)
-#define LBRF_GIDPos28 (3 << 13)
-#define LBRF_GIDPos32 (4 << 13)
-#define LBRF_GIDPos36 (5 << 13)
-#define LBRF_GIDPos40 (6 << 13)
-#define LBRF_GIDPos44 (7 << 13)
-#define LBRF_GIDPos48 (8 << 13)
-#define LBRF_Compact32 (1 << 17)
-
-/* StencilMode */
-#define StencilDisable 0x00000000
-#define StencilEnable 0x00000001
-
-/* RouterMode */
-#define R_Order_TextureDepth 0x00000000
-#define R_Order_DepthTexture 0x00000001
-
-/* ScissorMode */
-#define UserScissorDisable 0x00000000
-#define UserScissorEnable 0x00000001
-#define ScreenScissorDisable 0x00000000
-#define ScreenScissorEnable 0x00000002
-
-/* DitherMode */
-#define DitherModeDisable 0x00000000
-#define DitherModeEnable 0x00000001
-#define DM_DitherDisable 0x00000000
-#define DM_DitherEnable 0x00000002
-#define DM_ColorFmt_8888 0x00000000
-#define DM_ColorFmt_5555 0x00000004
-#define DM_ColorFmt_4444 0x00000008
-#define DM_ColorFmt_4444Front 0x0000000c
-#define DM_ColorFmt_4444Back 0x00000010
-#define DM_ColorFmt_332Front 0x00000014
-#define DM_ColorFmt_332Back 0x00000018
-#define DM_ColorFmt_121Front 0x0000001c
-#define DM_ColorFmt_121Back 0x00000020
-#define DM_ColorFmt_555Back 0x00000024
-#define DM_ColorFmt_CI8 0x00000028
-#define DM_ColorFmt_CI4 0x0000002c
-#define DM_XOffsetMask 0x000000c0
-#define DM_YOffsetMask 0x00000300
-#define DM_ColorOrder_BGR 0x00000000
-#define DM_ColorOrder_RGB 0x00000400
-#define DM_AlphaDitherDefault 0x00000000
-#define DM_AlphaDitherNone 0x00004000
-#define DM_Truncate 0x00000000
-#define DM_Round 0x00008000
-
-/* RasterizerMode */
-#define RM_MirrorBitMask 0x00000001
-#define RM_InvertBitMask 0x00000002
-#define RM_FractionAdjNo 0x00000000
-#define RM_FractionAdjZero 0x00000004
-#define RM_FractionAdjHalf 0x00000008
-#define RM_FractionAdjNearHalf 0x0000000c
-#define RM_BiasCoordZero 0x00000000
-#define RM_BiasCoordHalf 0x00000010
-#define RM_BiasCoordNearHalf 0x00000020
-#define RM_BitMaskByteSwap_ABCD 0x00000000
-#define RM_BitMaskByteSwap_BADC 0x00000080
-#define RM_BitMaskByteSwap_CDAB 0x00000100
-#define RM_BitMaskByteSwap_DCBA 0x00000180
-#define RM_BitMaskPacked 0x00000000
-#define RM_BitMaskEveryScanline 0x00000200
-#define RM_BitMaskOffsetMask 0x00007c00
-#define RM_HostDataByteSwap_ABCD 0x00000000
-#define RM_HostDataByteSwap_BADC 0x00008000
-#define RM_HostDataByteSwap_CDAB 0x00010000
-#define RM_HostDataByteSwap_DCBA 0x00018000
-#define RM_SingleGLINT 0x00000000
-#define RM_MultiGLINT 0x00020000
-#define RM_YLimitsEnable 0x00040000
-
-/* Window */
-#define WindowDisable 0x00000000
-#define WindowEnable 0x00000001
-#define W_AlwaysPass 0x00000000
-#define W_NeverPass 0x00000002
-#define W_PassIfEqual 0x00000004
-#define W_PassIfNotEqual 0x00000006
-#define W_CompareMask 0x00000006
-#define W_ForceLBUpdate 0x00000008
-#define W_LBUpdateFromSource 0x00000000
-#define W_LBUpdateFromRegisters 0x00000010
-#define W_GIDMask 0x000001e0
-#define W_FrameCountMask 0x0001fe00
-#define W_StencilFCP 0x00020000
-#define W_DepthFCP 0x00040000
-#define W_OverrideWriteFiltering 0x00080000
-
-/* TextureAddressMode */
-#define TextureAddressModeDisable 0x00000000
-#define TextureAddressModeEnable 0x00000001
-#define TAM_SWrap_Clamp 0x00000000
-#define TAM_SWrap_Repeat 0x00000002
-#define TAM_SWrap_Mirror 0x00000004
-#define TAM_SWrap_Mask 0x00000006
-#define TAM_TWrap_Clamp 0x00000000
-#define TAM_TWrap_Repeat 0x00000008
-#define TAM_TWrap_Mirror 0x00000010
-#define TAM_TWrap_Mask 0x00000018
-#define TAM_Operation_2D 0x00000000
-#define TAM_Operation_3D 0x00000020
-#define TAM_InhibitDDAInit 0x00000040
-#define TAM_LODDisable 0x00000000
-#define TAM_LODEnable 0x00000080
-#define TAM_DY_Disable 0x00000000
-#define TAM_DY_Enable 0x00000100
-#define TAM_WidthMask 0x00001e00
-#define TAM_HeightMask 0x0001e000
-#define TAM_TexMapType_1D 0x00000000
-#define TAM_TexMapType_2D 0x00020000
-#define TAM_TexMapType_Mask 0x00020000
-
-/* TextureReadMode */
-#define TextureReadModeDisable 0x00000000
-#define TextureReadModeEnable 0x00000001
-#define TRM_WidthMask 0x0000001e
-#define TRM_HeightMask 0x000001e0
-#define TRM_Depth1 0x00000000
-#define TRM_Depth2 0x00000200
-#define TRM_Depth4 0x00000400
-#define TRM_Depth8 0x00000600
-#define TRM_Depth16 0x00000800
-#define TRM_Depth32 0x00000a00
-#define TRM_DepthMask 0x00000e00
-#define TRM_Border 0x00001000
-#define TRM_Patch 0x00002000
-#define TRM_Mag_Nearest 0x00000000
-#define TRM_Mag_Linear 0x00004000
-#define TRM_Mag_Mask 0x00004000
-#define TRM_Min_Nearest 0x00000000
-#define TRM_Min_Linear 0x00008000
-#define TRM_Min_NearestMMNearest 0x00010000
-#define TRM_Min_NearestMMLinear 0x00018000
-#define TRM_Min_LinearMMNearest 0x00020000
-#define TRM_Min_LinearMMLinear 0x00028000
-#define TRM_Min_Mask 0x00038000
-#define TRM_UWrap_Clamp 0x00000000
-#define TRM_UWrap_Repeat 0x00040000
-#define TRM_UWrap_Mirror 0x00080000
-#define TRM_UWrap_Mask 0x000c0000
-#define TRM_VWrap_Clamp 0x00000000
-#define TRM_VWrap_Repeat 0x00100000
-#define TRM_VWrap_Mirror 0x00200000
-#define TRM_VWrap_Mask 0x00300000
-#define TRM_TexMapType_1D 0x00000000
-#define TRM_TexMapType_2D 0x00400000
-#define TRM_TexMapType_Mask 0x00400000
-#define TRM_MipMapDisable 0x00000000
-#define TRM_MipMapEnable 0x00800000
-#define TRM_PrimaryCacheDisable 0x00000000
-#define TRM_PrimaryCacheEnable 0x01000000
-#define TRM_FBSourceAddr_None 0x00000000
-#define TRM_FBSourceAddr_Index 0x02000000
-#define TRM_FBSourceAddr_Coord 0x04000000
-#define TRM_BorderClamp 0x08000000
-
-/* TextureColorMode */
-#define TextureColorModeDisable 0x00000000
-#define TextureColorModeEnable 0x00000001
-#define TCM_Modulate 0x00000000
-#define TCM_Decal 0x00000002
-#define TCM_Blend 0x00000004
-#define TCM_Replace 0x00000006
-#define TCM_ApplicationMask 0x0000000e
-#define TCM_OpenGLType 0x00000000
-#define TCM_QuickDraw3DType 0x00000010
-#define TCM_KdDDA_Disable 0x00000000
-#define TCM_KdDDA_Enable 0x00000020
-#define TCM_KsDDA_Disable 0x00000000
-#define TCM_KsDDA_Enable 0x00000040
-#define TCM_BaseFormat_Alpha 0x00000000
-#define TCM_BaseFormat_Lum 0x00000080
-#define TCM_BaseFormat_LumAlpha 0x00000100
-#define TCM_BaseFormat_Intensity 0x00000180
-#define TCM_BaseFormat_RGB 0x00000200
-#define TCM_BaseFormat_RGBA 0x00000280
-#define TCM_BaseFormatMask 0x00000380
-#define TCM_LoadMode_None 0x00000000
-#define TCM_LoadMode_Ks 0x00000400
-#define TCM_LoadMode_Kd 0x00000800
-
-/* TextureCacheControl */
-#define TCC_Invalidate 0x00000001
-#define TCC_Disable 0x00000000
-#define TCC_Enable 0x00000002
-
-/* TextureFilterMode */
-#define TextureFilterModeDisable 0x00000000
-#define TextureFilterModeEnable 0x00000001
-#define TFM_AlphaMapEnable 0x00000002
-#define TFM_AlphaMapSense 0x00000004
-
-/* TextureFormat */
-#define TF_LittleEndian 0x00000000
-#define TF_BigEndian 0x00000001
-#define TF_16Bit_565 0x00000000
-#define TF_16Bit_555 0x00000002
-#define TF_ColorOrder_BGR 0x00000000
-#define TF_ColorOrder_RGB 0x00000004
-#define TF_Compnents_1 0x00000000
-#define TF_Compnents_2 0x00000008
-#define TF_Compnents_3 0x00000010
-#define TF_Compnents_4 0x00000018
-#define TF_CompnentsMask 0x00000018
-#define TF_OutputFmt_Texel 0x00000000
-#define TF_OutputFmt_Color 0x00000020
-#define TF_OutputFmt_BitMask 0x00000040
-#define TF_OutputFmtMask 0x00000060
-#define TF_MirrorEnable 0x00000080
-#define TF_InvertEnable 0x00000100
-#define TF_ByteSwapEnable 0x00000200
-#define TF_LUTOffsetMask 0x0003fc00
-#define TF_OneCompFmt_Lum 0x00000000
-#define TF_OneCompFmt_Alpha 0x00040000
-#define TF_OneCompFmt_Intensity 0x00080000
-#define TF_OneCompFmt_Mask 0x000c0000
-/**************** MX FLAGS ****************/
-
-/************** GAMMA FLAGS ***************/
-/* GeometryMode */
-#define GM_TextureDisable 0x00000000
-#define GM_TextureEnable 0x00000001
-#define GM_FogDisable 0x00000000
-#define GM_FogEnable 0x00000002
-#define GM_FogLinear 0x00000000
-#define GM_FogExp 0x00000004
-#define GM_FogExpSquared 0x00000008
-#define GM_FogMask 0x0000000C
-#define GM_FrontPolyPoint 0x00000000
-#define GM_FrontPolyLine 0x00000010
-#define GM_FrontPolyFill 0x00000020
-#define GM_BackPolyPoint 0x00000000
-#define GM_BackPolyLine 0x00000040
-#define GM_BackPolyFill 0x00000080
-#define GM_FB_PolyMask 0x000000F0
-#define GM_FrontFaceCW 0x00000000
-#define GM_FrontFaceCCW 0x00000100
-#define GM_FFMask 0x00000100
-#define GM_PolyCullDisable 0x00000000
-#define GM_PolyCullEnable 0x00000200
-#define GM_PolyCullFront 0x00000000
-#define GM_PolyCullBack 0x00000400
-#define GM_PolyCullBoth 0x00000800
-#define GM_PolyCullMask 0x00000c00
-#define GM_ClipShortLinesDisable 0x00000000
-#define GM_ClipShortLinesEnable 0x00001000
-#define GM_ClipSmallTrisDisable 0x00000000
-#define GM_ClipSmallTrisEnable 0x00002000
-#define GM_RenderMode 0x00000000
-#define GM_SelectMode 0x00004000
-#define GM_FeedbackMode 0x00008000
-#define GM_Feedback2D 0x00000000
-#define GM_Feedback3D 0x00010000
-#define GM_Feedback3DColor 0x00020000
-#define GM_Feedback3DColorTexture 0x00030000
-#define GM_Feedback4DColorTexture 0x00040000
-#define GM_CullFaceNormDisable 0x00000000
-#define GM_CullFaceNormEnable 0x00080000
-#define GM_AutoFaceNormDisable 0x00000000
-#define GM_AutoFaceNormEnable 0x00100000
-#define GM_GouraudShading 0x00000000
-#define GM_FlatShading 0x00200000
-#define GM_ShadingMask 0x00200000
-#define GM_UserClipNone 0x00000000
-#define GM_UserClip0 0x00400000
-#define GM_UserClip1 0x00800000
-#define GM_UserClip2 0x01000000
-#define GM_UserClip3 0x02000000
-#define GM_UserClip4 0x04000000
-#define GM_UserClip5 0x08000000
-#define GM_PolyOffsetPointDisable 0x00000000
-#define GM_PolyOffsetPointEnable 0x10000000
-#define GM_PolyOffsetLineDisable 0x00000000
-#define GM_PolyOffsetLineEnable 0x20000000
-#define GM_PolyOffsetFillDisable 0x00000000
-#define GM_PolyOffsetFillEnable 0x40000000
-#define GM_InvertFaceNormCullDisable 0x00000000
-#define GM_InvertFaceNormCullEnable 0x80000000
-
-/* Begin */
-#define B_AreaStippleDisable 0x00000000
-#define B_AreaStippleEnable 0x00000001
-#define B_LineStippleDisable 0x00000000
-#define B_LineStippleEnable 0x00000002
-#define B_AntiAliasDisable 0x00000000
-#define B_AntiAliasEnable 0x00000100
-#define B_TextureDisable 0x00000000
-#define B_TextureEnable 0x00002000
-#define B_FogDisable 0x00000000
-#define B_FogEnable 0x00004000
-#define B_SubPixelCorrectDisable 0x00000000
-#define B_SubPixelCorrectEnable 0x00010000
-#define B_PrimType_Null 0x00000000
-#define B_PrimType_Points 0x10000000
-#define B_PrimType_Lines 0x20000000
-#define B_PrimType_LineLoop 0x30000000
-#define B_PrimType_LineStrip 0x40000000
-#define B_PrimType_Triangles 0x50000000
-#define B_PrimType_TriangleStrip 0x60000000
-#define B_PrimType_TriangleFan 0x70000000
-#define B_PrimType_Quads 0x80000000
-#define B_PrimType_QuadStrip 0x90000000
-#define B_PrimType_Polygon 0xa0000000
-#define B_PrimType_Mask 0xf0000000
-
-/* EdgeFlag */
-#define EdgeFlagDisable 0x00000000
-#define EdgeFlagEnable 0x00000001
-
-/* NormalizeMode */
-#define NormalizeModeDisable 0x00000000
-#define NormalizeModeEnable 0x00000001
-#define FaceNormalDisable 0x00000000
-#define FaceNormalEnable 0x00000002
-#define InvertAutoFaceNormal 0x00000004
-
-/* LightingMode */
-#define LightingModeDisable 0x00000000
-#define LightingModeEnable 0x00000001
-#define LightingModeTwoSides 0x00000004
-#define LightingModeLocalViewer 0x00000008
-#define LightingModeSpecularEnable 0x00008000
-
-/* Light0Mode */
-#define Light0ModeDisable 0x00000000
-#define Light0ModeEnable 0x00000001
-#define Light0ModeSpotLight 0x00000002
-#define Light0ModeAttenuation 0x00000004
-#define Light0ModeLocal 0x00000008
-
-/* Light0Mode */
-#define Light1ModeDisable 0x00000000
-#define Light1ModeEnable 0x00000001
-#define Light1ModeSpotLight 0x00000002
-#define Light1ModeAttenuation 0x00000004
-#define Light1ModeLocal 0x00000008
-
-/* ColorMaterialMode */
-#define ColorMaterialModeDisable 0x00000000
-#define ColorMaterialModeEnable 0x00000001
-#define ColorMaterialModeFront 0x00000000
-#define ColorMaterialModeBack 0x00000002
-#define ColorMaterialModeFrontAndBack 0x00000004
-#define ColorMaterialModeEmission 0x00000000
-#define ColorMaterialModeAmbient 0x00000008
-#define ColorMaterialModeDiffuse 0x00000010
-#define ColorMaterialModeSpecular 0x00000018
-#define ColorMaterialModeAmbAndDiff 0x00000020
-#define ColorMaterialModeMask 0x0000003e
-
-/* MaterialMode */
-#define MaterialModeDisable 0x00000000
-#define MaterialModeEnable 0x00000001
-#define MaterialModeTwoSides 0x00000080
-
-/* DeltaMode */
-#define DM_Target300SX 0x00000000
-#define DM_Target500TXMX 0x00000001
-#define DM_Depth16 0x00000004
-#define DM_Depth24 0x00000008
-#define DM_Depth32 0x0000000c
-#define DM_FogEnable 0x00000010
-#define DM_TextureEnable 0x00000020
-#define DM_SmoothShadingEnable 0x00000040
-#define DM_DepthEnable 0x00000080
-#define DM_SpecularEnable 0x00000100
-#define DM_DiffuseEnable 0x00000200
-#define DM_SubPixlCorrectionEnable 0x00000400
-#define DM_DiamondExit 0x00000800
-#define DM_NoDraw 0x00001000
-#define DM_ClampEnable 0x00002000
-#define DM_TextureParameterAsGiven 0x00000000
-#define DM_TextureParameterClamped 0x00004000
-#define DM_TextureParameterNormalized 0x00008000
-#define DM_BiasCoords 0x00080000
-#define DM_ColorDiffuse 0x00100000
-#define DM_ColorSpecular 0x00200000
-#define DM_FlatShadingMethod 0x00400000
-
-/* PointMode */
-#define PM_AntialiasDisable 0x00000000
-#define PM_AntialiasEnable 0x00000001
-#define PM_AntialiasQuality_4x4 0x00000000
-#define PM_AntialiasQuality_8x8 0x00000002
-
-/* LogicalOpMode */
-#define LogicalOpModeDisable 0x00000000
-#define LogicalOpModeEnable 0x00000001
-#define LogicalOpModeMask 0x0000001e
-
-/* LineMode */
-#define LM_StippleDisable 0x00000000
-#define LM_StippleEnable 0x00000001
-#define LM_RepeatFactorMask 0x000003fe
-#define LM_StippleMask 0x03fffc00
-#define LM_MirrorDisable 0x00000000
-#define LM_MirrorEnable 0x04000000
-#define LM_AntialiasDisable 0x00000000
-#define LM_AntialiasEnable 0x08000000
-#define LM_AntialiasQuality_4x4 0x00000000
-#define LM_AntialiasQuality_8x8 0x10000000
-
-/* TriangleMode */
-#define TM_AntialiasDisable 0x00000000
-#define TM_AntialiasEnable 0x00000001
-#define TM_AntialiasQuality_4x4 0x00000000
-#define TM_AntialiasQuality_8x8 0x00000002
-#define TM_UseTriPacketInterface 0x00000004
-
-/* TransformMode */
-#define XM_UseModelViewMatrix 0x00000001
-#define XM_UseModelViewProjMatrix 0x00000002
-#define XM_XformNormals 0x00000004
-#define XM_XformFaceNormals 0x00000008
-#define XM_XformTexture 0x00000010
-#define XM_XMask 0x00000013
-#define XM_TexGenModeS_None 0x00000000
-#define XM_TexGenModeS_ObjLinear 0x00000020
-#define XM_TexGenModeS_EyeLinear 0x00000040
-#define XM_TexGenModeS_SphereMap 0x00000060
-#define XM_TexGenModeT_None 0x00000000
-#define XM_TexGenModeT_ObjLinear 0x00000080
-#define XM_TexGenModeT_EyeLinear 0x00000100
-#define XM_TexGenModeT_SphereMap 0x00000180
-#define XM_TexGenModeR_None 0x00000000
-#define XM_TexGenModeR_ObjLinear 0x00000200
-#define XM_TexGenModeR_EyeLinear 0x00000400
-#define XM_TexGenModeR_SphereMap 0x00000600
-#define XM_TexGenModeQ_None 0x00000000
-#define XM_TexGenModeQ_ObjLinear 0x00000800
-#define XM_TexGenModeQ_EyeLinear 0x00001000
-#define XM_TexGenModeQQSphereMap 0x00001800
-#define XM_TexGenS 0x00002000
-#define XM_TexGenT 0x00004000
-#define XM_TexGenR 0x00008000
-#define XM_TexGenQ 0x00010000
-
-/* LightNMode */
-#define LNM_Off 0x00000000
-#define LNM_On 0x00000001
-/************** GAMMA FLAGS ***************/
-
-#endif /* _GAMMA_REGS_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_render.c
deleted file mode 100644
index 4b462f225..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_render.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- * 3DLabs Gamma driver.
- *
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-
-#include "tnl/t_context.h"
-
-#include "gamma_context.h"
-#include "gamma_tris.h"
-#include "gamma_vb.h"
-
-
-/* !! Should template this eventually !! */
-
-static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*coord)[4];
- GLuint coord_stride;
- GLfloat (*col)[4];
- GLuint col_stride;
- int i;
- GLuint tc0_stride = 0;
- GLfloat (*tc0)[4] = 0;
- GLuint tc0_size = 0;
-
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- tc0_stride = VB->TexCoordPtr[0]->stride;
- tc0 = VB->TexCoordPtr[0]->data;
- tc0_size = VB->TexCoordPtr[0]->size;
- coord = VB->ClipPtr->data;
- coord_stride = VB->ClipPtr->stride;
- } else {
- coord = VB->NdcPtr->data;
- coord_stride = VB->NdcPtr->stride;
- }
-
- if (ctx->Texture.Unit[0]._ReallyEnabled && tc0_size == 4) {
- for (i=start; i < end; i++) {
- CHECK_DMA_BUFFER(gmesa, 9);
- WRITEF(gmesa->buf, Tq4, tc0[i][3]);
- WRITEF(gmesa->buf, Tr4, tc0[i][2]);
- WRITEF(gmesa->buf, Tt4, tc0[i][0]);
- WRITEF(gmesa->buf, Ts4, tc0[i][1]);
- WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]);
- WRITEF(gmesa->buf, Vw, coord[i][3]);
- WRITEF(gmesa->buf, Vz, coord[i][2]);
- WRITEF(gmesa->buf, Vy, coord[i][1]);
- WRITEF(gmesa->buf, Vx4, coord[i][0]);
- }
- } else if (ctx->Texture.Unit[0]._ReallyEnabled && tc0_size == 2) {
- for (i=start; i < end; i++) {
- CHECK_DMA_BUFFER(gmesa, 7);
- WRITEF(gmesa->buf, Tt2, tc0[i][0]);
- WRITEF(gmesa->buf, Ts2, tc0[i][1]);
- WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]);
- WRITEF(gmesa->buf, Vw, coord[i][3]);
- WRITEF(gmesa->buf, Vz, coord[i][2]);
- WRITEF(gmesa->buf, Vy, coord[i][1]);
- WRITEF(gmesa->buf, Vx4, coord[i][0]);
- }
- } else {
- for (i=start; i < end; i++) {
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]);
- WRITEF(gmesa->buf, Vz, coord[i][2]);
- WRITEF(gmesa->buf, Vy, coord[i][1]);
- WRITEF(gmesa->buf, Vx3, coord[i][0]);
- }
- }
-}
-
-#define HAVE_POINTS 1
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_QUADS 1
-#define HAVE_QUAD_STRIPS 1
-#define HAVE_POLYGONS 1
-
-#define HAVE_ELTS 0
-
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- B_PrimType_Points,
- B_PrimType_Lines,
- B_PrimType_LineLoop,
- B_PrimType_LineStrip,
- B_PrimType_Triangles,
- B_PrimType_TriangleStrip,
- B_PrimType_TriangleFan,
- B_PrimType_Quads,
- B_PrimType_QuadStrip,
- B_PrimType_Polygon
-};
-
-static __inline void gammaStartPrimitive( gammaContextPtr gmesa, GLenum prim )
-{
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Begin, gmesa->Begin | hw_prim[prim]);
-}
-
-static __inline void gammaEndPrimitive( gammaContextPtr gmesa )
-{
- GLcontext *ctx = gmesa->glCtx;
-
- if ( ctx->Line.SmoothFlag ||
- ctx->Polygon.SmoothFlag ||
- ctx->Point.SmoothFlag ) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FlushSpan, 0);
- }
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, End, 0);
-}
-
-#define LOCAL_VARS gammaContextPtr gmesa = GAMMA_CONTEXT(ctx)
-#define INIT( prim ) gammaStartPrimitive( gmesa, prim )
-#define FLUSH() gammaEndPrimitive( gmesa )
-#define GET_CURRENT_VB_MAX_VERTS() \
- (gmesa->bufSize - gmesa->bufCount) / 2
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- GAMMA_DMA_BUFFER_SIZE / 2
-
-#define ALLOC_VERTS( nr ) (void *)0 /* todo: explicit alloc */
-#define EMIT_VERTS( ctx, j, nr, buf ) (gamma_emit(ctx, j, (j)+(nr)), (void *)0)
-
-#define TAG(x) gamma_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-static GLboolean gamma_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- tnl_render_func *tab;
-
- /* GH: THIS IS A HACK!!! */
- if (VB->ClipOrMask || gmesa->RenderIndex != 0)
- return GL_TRUE; /* don't handle clipping here */
-
- /* We don't do elts */
- if (VB->Elts || !gamma_validate_render( ctx, VB ))
- return GL_TRUE;
-
- tab = TAG(render_tab_verts);
-
- tnl->Driver.Render.Start( ctx );
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim);
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-const struct tnl_pipeline_stage _gamma_render_stage =
-{
- "gamma render",
- NULL,
- NULL,
- NULL,
- NULL,
- gamma_run_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.c
deleted file mode 100644
index 0b91d059e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- */
-
-#include "gamma_context.h"
-#include "gamma_vb.h"
-#include "glint_dri.h"
-
-#include "imports.h"
-
-gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv )
-{
- gammaScreenPtr gammaScreen;
- GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)sPriv->pDevPriv;
- int i;
-
- if (sPriv->devPrivSize != sizeof(GLINTDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(GLINTDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
-#if 0
- /* Check the DRI externsion version */
- if ( sPriv->driMajor != 3 || sPriv->driMinor != 1 ) {
- __driUtilMessage( "Gamma DRI driver expected DRI version 4.0.x "
- "but got version %d.%d.%d",
- sPriv->driMajor, sPriv->driMinor, sPriv->driPatch );
- return NULL;
- }
-
- /* Check that the DDX driver version is compatible */
- if ( sPriv->ddxMajor != 4 ||
- sPriv->ddxMinor != 0 ||
- sPriv->ddxPatch < 0 ) {
- __driUtilMessage( "r128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch );
- return GL_FALSE;
- }
-
- /* Check that the DRM driver version is compatible */
- if ( sPriv->drmMajor != 2 ||
- sPriv->drmMinor != 1 ||
- sPriv->drmPatch < 0 ) {
- __driUtilMessage( "r128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
- return GL_FALSE;
- }
-#endif
-
- /* Allocate the private area */
- gammaScreen = (gammaScreenPtr) CALLOC( sizeof(*gammaScreen) );
- if ( !gammaScreen ) return NULL;
-
- gammaScreen->regionCount = 4; /* Magic number. Can we fix this? */
-
- gammaScreen->regions = CALLOC(gammaScreen->regionCount *
- sizeof(gammaRegion));
-
- gammaScreen->regions[0].handle = gDRIPriv->registers0.handle;
- gammaScreen->regions[0].size = gDRIPriv->registers0.size;
- gammaScreen->regions[1].handle = gDRIPriv->registers1.handle;
- gammaScreen->regions[1].size = gDRIPriv->registers1.size;
- gammaScreen->regions[2].handle = gDRIPriv->registers2.handle;
- gammaScreen->regions[2].size = gDRIPriv->registers2.size;
- gammaScreen->regions[3].handle = gDRIPriv->registers3.handle;
- gammaScreen->regions[3].size = gDRIPriv->registers3.size;
-
- /* Next, map all the regions */
- for (i = 0; i < gammaScreen->regionCount; i++) {
- if (drmMap(sPriv->fd,
- gammaScreen->regions[i].handle,
- gammaScreen->regions[i].size,
- &gammaScreen->regions[i].map)) {
- while (--i > 0) {
- (void)drmUnmap(gammaScreen->regions[i].map,
- gammaScreen->regions[i].size);
- }
- return GL_FALSE;
- }
- }
-
- /* Get the list of dma buffers */
- gammaScreen->bufs = drmMapBufs(sPriv->fd);
-
- if (!gammaScreen->bufs) {
- while (gammaScreen->regionCount > 0) {
- (void)drmUnmap(gammaScreen->regions[gammaScreen->regionCount].map,
- gammaScreen->regions[gammaScreen->regionCount].size);
- gammaScreen->regionCount--;
- }
- return GL_FALSE;
- }
-
- gammaScreen->textureSize = gDRIPriv->textureSize;
- gammaScreen->logTextureGranularity = gDRIPriv->logTextureGranularity;
- gammaScreen->cpp = gDRIPriv->cpp;
- gammaScreen->frontOffset = gDRIPriv->frontOffset;
- gammaScreen->frontPitch = gDRIPriv->frontPitch;
- gammaScreen->backOffset = gDRIPriv->backOffset;
- gammaScreen->backPitch = gDRIPriv->backPitch;
- gammaScreen->backX = gDRIPriv->backX;
- gammaScreen->backY = gDRIPriv->backY;
- gammaScreen->depthOffset = gDRIPriv->depthOffset;
- gammaScreen->depthPitch = gDRIPriv->depthPitch;
-
- gammaScreen->driScreen = sPriv;
-
- return gammaScreen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-void gammaDestroyScreen( __DRIscreenPrivate *sPriv )
-{
- gammaScreenPtr gammaScreen = (gammaScreenPtr)sPriv->private;
-
- /* First, unmap the dma buffers */
- drmUnmapBufs( gammaScreen->bufs );
-
- /* Next, unmap all the regions */
- while (gammaScreen->regionCount > 0) {
- (void)drmUnmap(gammaScreen->regions[gammaScreen->regionCount].map,
- gammaScreen->regions[gammaScreen->regionCount].size);
- gammaScreen->regionCount--;
- }
- FREE(gammaScreen->regions);
- FREE(gammaScreen);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.h
deleted file mode 100644
index 7f0ed6f80..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_screen.h
+++ /dev/null
@@ -1,30 +0,0 @@
-typedef struct _gammaRegion {
- drm_handle_t handle;
- drmSize size;
- drmAddress map;
-} gammaRegion, *gammaRegionPtr;
-
-typedef struct {
-
- int regionCount; /* Count of register regions */
- gammaRegion *regions; /* Vector of mapped region info */
-
- drmBufMapPtr bufs; /* Map of DMA buffers */
-
- __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */
-
- int cpp;
- int frontPitch;
- int frontOffset;
-
- int backPitch;
- int backOffset;
- int backX;
- int backY;
-
- int depthOffset;
- int depthPitch;
-
- int textureSize;
- int logTextureGranularity;
-} gammaScreenRec, *gammaScreenPtr;
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_span.c
deleted file mode 100644
index 66cc961c6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_span.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */
-
-#include "gamma_context.h"
-#include "gamma_lock.h"
-#include "colormac.h"
-
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \
- gammaScreenPtr gammascrn = gmesa->gammaScreen; \
- __DRIscreenPrivate *sPriv = gmesa->driScreen; \
- __DRIdrawablePrivate *dPriv = gmesa->driDrawable; \
- GLuint pitch = sPriv->fbWidth * gammascrn->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- gmesa->drawOffset + \
- (dPriv->x * gammascrn->cpp) + \
- (dPriv->y * pitch)); \
- char *read_buf = (char *)(sPriv->pFB + \
- gmesa->readOffset + \
- (dPriv->x * gammascrn->cpp) + \
- (dPriv->y * pitch)); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-/* FIXME! Depth/Stencil read/writes don't work ! */
-#define LOCAL_DEPTH_VARS \
- gammaScreenPtr gammascrn = gmesa->gammaScreen; \
- __DRIdrawablePrivate *dPriv = gmesa->driDrawable; \
- __DRIscreenPrivate *sPriv = gmesa->driScreen; \
- GLuint pitch = gammascrn->depthPitch; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- gammascrn->depthOffset + \
- dPriv->x * gammascrn->cpp + \
- dPriv->y * pitch)
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#define HW_LOCK() \
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \
- FLUSH_DMA_BUFFER(gmesa); \
- gammaGetLock( gmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT ); \
- GAMMAHW_LOCK( gmesa );
-
-#define HW_UNLOCK() GAMMAHW_UNLOCK( gmesa )
-
-
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#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 ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (p >> 8) & 0xf8; \
- rgba[1] = (p >> 3) & 0xfc; \
- rgba[2] = (p << 3) & 0xf8; \
- rgba[3] = 0xff; \
- if ( rgba[0] & 0x08 ) rgba[0] |= 0x07; \
- if ( rgba[1] & 0x04 ) rgba[1] |= 0x03; \
- if ( rgba[2] & 0x08 ) rgba[2] |= 0x07; \
- } while (0)
-
-#define TAG(x) gamma##x##_RGB565
-#include "spantmp.h"
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-
-#undef INIT_MONO_PIXEL
-#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 ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
- (g << 8) | \
- (r << 16) | \
- (a << 24) )
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
-} while (0)
-
-#define TAG(x) gamma##x##_ARGB8888
-#include "spantmp.h"
-
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
-
-#define TAG(x) gamma##x##_16
-#include "depthtmp.h"
-
-
-#if 0 /* Unused */
-/* 32 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch);
-
-#define TAG(x) gamma##x##_32
-#include "depthtmp.h"
-#endif
-
-
-/* 24/8 bit interleaved depth/stencil functions
- */
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \
- tmp &= 0xff; \
- tmp |= (d) & 0xffffff00; \
- *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch) & ~0xff;
-
-
-#define TAG(x) gamma##x##_24_8
-#include "depthtmp.h"
-
-#if 0
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
- tmp &= 0xffffff00; \
- tmp |= d & 0xff; \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xff;
-
-#define TAG(x) gamma##x##_24_8
-#include "stenciltmp.h"
-
-static void gammaReadRGBASpan8888( const GLcontext *ctx,
- GLuint n, GLint x, GLint y,
- GLubyte rgba[][4])
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- gammaScreenPtr gammascrn = gmesa->gammaScreen;
- u_int32_t dwords1, dwords2, i = 0;
- char *src = (char *)rgba[0];
- GLuint read = n * gammascrn->cpp; /* Number of bytes we are expecting */
- u_int32_t data;
-
- FLUSH_DMA_BUFFER(gmesa);
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode & ~(LBReadSrcEnable | LBReadDstEnable));
- WRITE(gmesa->buf, ColorDDAMode, ColorDDAEnable);
- WRITE(gmesa->buf, LBWriteMode, LBWriteModeDisable);
- WRITE(gmesa->buf, FBReadMode, (gmesa->FBReadMode & ~FBReadSrcEnable) | FBReadDstEnable | FBDataTypeColor);
- WRITE(gmesa->buf, FilterMode, 0x200); /* Pass FBColorData */
- WRITE(gmesa->buf, FBWriteMode, FBW_UploadColorData | FBWriteModeDisable);
- WRITE(gmesa->buf, StartXSub, (x+n)<<16);
- WRITE(gmesa->buf, StartXDom, x<<16);
- WRITE(gmesa->buf, StartY, y<<16);
- WRITE(gmesa->buf, GLINTCount, 1);
- WRITE(gmesa->buf, dXDom, 0<<16);
- WRITE(gmesa->buf, dXSub, 0<<16);
- WRITE(gmesa->buf, dY, 1<<16);
- WRITE(gmesa->buf, Render, PrimitiveTrapezoid);
- FLUSH_DMA_BUFFER(gmesa);
-
-moredata:
-
- dwords1 = *(volatile u_int32_t*)(void *)(((u_int8_t*)gammascrn->regions[0].map) + (GlintOutFIFOWords));
- dwords2 = *(volatile u_int32_t*)(void *)(((u_int8_t*)gammascrn->regions[2].map) + (GlintOutFIFOWords));
-
- if (dwords1) {
- memcpy(src, (char*)gammascrn->regions[1].map + 0x1000, dwords1 << 2);
- src += dwords1 << 2;
- read -= dwords1 << 2;
- }
- if (dwords2) {
- memcpy(src, (char*)gammascrn->regions[3].map + 0x1000, dwords2 << 2);
- src += dwords2 << 2;
- read -= dwords2 << 2;
- }
-
- if (read)
- goto moredata;
-
-done:
-
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode);
- WRITE(gmesa->buf, LBWriteMode, LBWriteModeEnable);
- WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode);
- WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode);
- WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable);
- WRITE(gmesa->buf, FilterMode, 0x400);
-}
-#endif
-
-static void gammaSetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- gmesa->readOffset = 0;
- break;
- case BUFFER_BIT_BACK_LEFT:
- gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
- break;
- default:
- _mesa_problem(ctx, "Unexpected buffer 0x%x in gammaSetBuffer()", bufferBit);
- }
-}
-
-
-void gammaDDInitSpanFuncs( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = gammaSetBuffer;
-
- switch ( gmesa->gammaScreen->cpp ) {
- case 2:
- swdd->WriteRGBASpan = gammaWriteRGBASpan_RGB565;
- swdd->WriteRGBSpan = gammaWriteRGBSpan_RGB565;
- swdd->WriteMonoRGBASpan = gammaWriteMonoRGBASpan_RGB565;
- swdd->WriteRGBAPixels = gammaWriteRGBAPixels_RGB565;
- swdd->WriteMonoRGBAPixels = gammaWriteMonoRGBAPixels_RGB565;
- swdd->ReadRGBASpan = gammaReadRGBASpan_RGB565;
- swdd->ReadRGBAPixels = gammaReadRGBAPixels_RGB565;
- break;
-
- case 4:
- swdd->WriteRGBASpan = gammaWriteRGBASpan_ARGB8888;
- swdd->WriteRGBSpan = gammaWriteRGBSpan_ARGB8888;
- swdd->WriteMonoRGBASpan = gammaWriteMonoRGBASpan_ARGB8888;
- swdd->WriteRGBAPixels = gammaWriteRGBAPixels_ARGB8888;
- swdd->WriteMonoRGBAPixels = gammaWriteMonoRGBAPixels_ARGB8888;
-#if 1
- swdd->ReadRGBASpan = gammaReadRGBASpan_ARGB8888;
-#else
- swdd->ReadRGBASpan = gammaReadRGBASpan8888;
-#endif
- swdd->ReadRGBAPixels = gammaReadRGBAPixels_ARGB8888;
- break;
-
- default:
- break;
- }
-
- switch ( gmesa->glCtx->Visual.depthBits ) {
- case 16:
- swdd->ReadDepthSpan = gammaReadDepthSpan_16;
- swdd->WriteDepthSpan = gammaWriteDepthSpan_16;
- swdd->ReadDepthPixels = gammaReadDepthPixels_16;
- swdd->WriteDepthPixels = gammaWriteDepthPixels_16;
- break;
-
- case 24:
- swdd->ReadDepthSpan = gammaReadDepthSpan_24_8;
- swdd->WriteDepthSpan = gammaWriteDepthSpan_24_8;
- swdd->ReadDepthPixels = gammaReadDepthPixels_24_8;
- swdd->WriteDepthPixels = gammaWriteDepthPixels_24_8;
-
-#if 0
- swdd->ReadStencilSpan = gammaReadStencilSpan_24_8;
- swdd->WriteStencilSpan = gammaWriteStencilSpan_24_8;
- swdd->ReadStencilPixels = gammaReadStencilPixels_24_8;
- swdd->WriteStencilPixels = gammaWriteStencilPixels_24_8;
-#endif
- break;
-
- default:
- break;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_state.c
deleted file mode 100644
index 194313dc9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_state.c
+++ /dev/null
@@ -1,1730 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_state.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- * 3DLabs Gamma driver
- */
-
-#include "gamma_context.h"
-#include "gamma_macros.h"
-#include "buffers.h"
-#include "macros.h"
-#include "glint_dri.h"
-#include "colormac.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-
-#define ENABLELIGHTING 0
-
-/* =============================================================
- * Alpha blending
- */
-
-static void gammaUpdateAlphaMode( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- u_int32_t a = gmesa->AlphaTestMode;
- u_int32_t b = gmesa->AlphaBlendMode;
- u_int32_t f = gmesa->AB_FBReadMode_Save = 0;
- GLubyte refByte = (GLint) (ctx->Color.AlphaRef * 255.0);
-
- a &= ~(AT_CompareMask | AT_RefValueMask);
- b &= ~(AB_SrcBlendMask | AB_DstBlendMask);
-
- a |= refByte << 4;
-
- switch ( ctx->Color.AlphaFunc ) {
- case GL_NEVER:
- a |= AT_Never;
- break;
- case GL_LESS:
- a |= AT_Less;
- break;
- case GL_EQUAL:
- a |= AT_Equal;
- break;
- case GL_LEQUAL:
- a |= AT_LessEqual;
- break;
- case GL_GEQUAL:
- a |= AT_GreaterEqual;
- break;
- case GL_GREATER:
- a |= AT_Greater;
- break;
- case GL_NOTEQUAL:
- a |= AT_NotEqual;
- break;
- case GL_ALWAYS:
- a |= AT_Always;
- break;
- }
-
- if ( ctx->Color.AlphaEnabled ) {
- f |= FBReadDstEnable;
- a |= AlphaTestModeEnable;
- } else {
- a &= ~AlphaTestModeEnable;
- }
-
- switch ( ctx->Color.BlendSrcRGB ) {
- case GL_ZERO:
- b |= AB_Src_Zero;
- break;
- case GL_ONE:
- b |= AB_Src_One;
- break;
- case GL_DST_COLOR:
- b |= AB_Src_DstColor;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- b |= AB_Src_OneMinusDstColor;
- break;
- case GL_SRC_ALPHA:
- b |= AB_Src_SrcAlpha;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- b |= AB_Src_OneMinusSrcAlpha;
- break;
- case GL_DST_ALPHA:
- b |= AB_Src_DstAlpha;
- f |= FBReadSrcEnable;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- b |= AB_Src_OneMinusDstAlpha;
- f |= FBReadSrcEnable;
- break;
- case GL_SRC_ALPHA_SATURATE:
- b |= AB_Src_SrcAlphaSaturate;
- break;
- }
-
- switch ( ctx->Color.BlendDstRGB ) {
- case GL_ZERO:
- b |= AB_Dst_Zero;
- break;
- case GL_ONE:
- b |= AB_Dst_One;
- break;
- case GL_SRC_COLOR:
- b |= AB_Dst_SrcColor;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- b |= AB_Dst_OneMinusSrcColor;
- break;
- case GL_SRC_ALPHA:
- b |= AB_Dst_SrcAlpha;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- b |= AB_Dst_OneMinusSrcAlpha;
- break;
- case GL_DST_ALPHA:
- b |= AB_Dst_DstAlpha;
- f |= FBReadSrcEnable;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- b |= AB_Dst_OneMinusDstAlpha;
- f |= FBReadSrcEnable;
- break;
- }
-
- if ( ctx->Color.BlendEnabled ) {
- f |= FBReadDstEnable;
- b |= AlphaBlendModeEnable;
- } else {
- b &= ~AlphaBlendModeEnable;
- }
-
- if ( gmesa->AlphaTestMode != a ) {
- gmesa->AlphaTestMode = a;
- gmesa->dirty |= GAMMA_UPLOAD_ALPHA;
- }
- if ( gmesa->AlphaBlendMode != b) {
- gmesa->AlphaBlendMode = b;
- gmesa->dirty |= GAMMA_UPLOAD_BLEND;
- }
- gmesa->AB_FBReadMode_Save = f;
-}
-
-static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- (void) ref;
-
- FLUSH_BATCH( gmesa );
-
- gmesa->new_state |= GAMMA_NEW_ALPHA;
-}
-
-static void gammaDDBlendEquationSeparate( GLcontext *ctx,
- GLenum modeRGB, GLenum modeA )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- assert( modeRGB == modeA );
- FLUSH_BATCH( gmesa );
-
- gmesa->new_state |= GAMMA_NEW_ALPHA;
-}
-
-static void gammaDDBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
-
- gmesa->new_state |= GAMMA_NEW_ALPHA;
-}
-
-
-/* ================================================================
- * Buffer clear
- */
-
-static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv;
- GLuint temp = 0;
-
- FLUSH_BATCH( gmesa );
-
- /* Update and emit any new state. We need to do this here to catch
- * changes to the masks.
- * FIXME: Just update the masks?
- */
- if ( gmesa->new_state )
- gammaDDUpdateHWState( ctx );
-
-#ifdef DO_VALIDATE
- /* Flush any partially filled buffers */
- FLUSH_DMA_BUFFER(gmesa);
-
- DRM_SPINLOCK(&gmesa->driScreen->pSAREA->drawable_lock,
- gmesa->driScreen->drawLockID);
- VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa);
-#endif
-
- if (mask & BUFFER_BIT_DEPTH) {
- /* Turn off writes the FB */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FBWriteMode, FBWriteModeDisable);
-
- mask &= ~BUFFER_BIT_DEPTH;
-
- /*
- * Turn Rectangle2DControl off when the window is not clipped
- * (i.e., the GID tests are not necessary). This dramatically
- * increases the performance of the depth clears.
- */
- if (!gmesa->NotClipped) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Rectangle2DControl, 1);
- }
-
- temp = (gmesa->LBReadMode & LBPartialProdMask) | LBWindowOriginBot;
- if (gDRIPriv->numMultiDevices == 2) temp |= LBScanLineInt2;
-
- CHECK_DMA_BUFFER(gmesa, 5);
- WRITE(gmesa->buf, LBReadMode, temp);
- WRITE(gmesa->buf, DeltaMode, DM_DepthEnable);
- WRITE(gmesa->buf, DepthMode, (DepthModeEnable |
- DM_Always |
- DM_SourceDepthRegister |
- DM_WriteMask));
- WRITE(gmesa->buf, GLINTDepth, gmesa->ClearDepth);
-
- /* Increment the frame count */
- gmesa->FrameCount++;
-#ifdef FAST_CLEAR_4
- gmesa->FrameCount &= 0x0f;
-#else
- gmesa->FrameCount &= 0xff;
-#endif
-
- /* Force FCP to be written */
- WRITE(gmesa->buf, GLINTWindow, (WindowEnable |
- W_PassIfEqual |
- (gmesa->Window & W_GIDMask) |
- W_DepthFCP |
- W_LBUpdateFromRegisters |
- W_OverrideWriteFiltering |
- (gmesa->FrameCount << 9)));
-
- /* Clear part of the depth and FCP buffers */
- {
- int y = gmesa->driScreen->fbHeight - gmesa->driDrawable->y - gmesa->driDrawable->h;
- int x = gmesa->driDrawable->x;
- int w = gmesa->driDrawable->w;
- int h = gmesa->driDrawable->h;
-#ifndef TURN_OFF_FCP
- float hsub = h;
-
- if (gmesa->WindowChanged) {
- gmesa->WindowChanged = GL_FALSE;
- } else {
-#ifdef FAST_CLEAR_4
- hsub /= 16;
-#else
- hsub /= 256;
-#endif
-
- /* Handle the case where the height < # of FCPs */
- if (hsub < 1.0) {
- if (gmesa->FrameCount > h)
- gmesa->FrameCount = 0;
- h = 1;
- y += gmesa->FrameCount;
- } else {
- h = (gmesa->FrameCount+1)*hsub;
- h -= (int)(gmesa->FrameCount*hsub);
- y += gmesa->FrameCount*hsub;
- }
- }
-#endif
- if (h && w) {
-#if 0
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, Rectangle2DMode, ((h & 0xfff)<<12) |
- (w & 0xfff) );
- WRITE(gmesa->buf, DrawRectangle2D, ((y & 0xffff)<<16) |
- (x & 0xffff) );
-#else
- CHECK_DMA_BUFFER(gmesa, 8);
- WRITE(gmesa->buf, StartXDom, x<<16);
- WRITE(gmesa->buf, StartY, y<<16);
- WRITE(gmesa->buf, StartXSub, (x+w)<<16);
- WRITE(gmesa->buf, GLINTCount, h);
- WRITE(gmesa->buf, dY, 1<<16);
- WRITE(gmesa->buf, dXDom, 0<<16);
- WRITE(gmesa->buf, dXSub, 0<<16);
- WRITE(gmesa->buf, Render, 0x00000040); /* NOT_DONE */
-#endif
- }
- }
-
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITE(gmesa->buf, DepthMode, gmesa->DepthMode);
- WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode);
- WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode);
- WRITE(gmesa->buf, GLINTWindow, gmesa->Window);
- WRITE(gmesa->buf, FastClearDepth, gmesa->ClearDepth);
- WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable);
-
- /* Turn on Depth FCP */
- if (gmesa->Window & W_DepthFCP) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, WindowOr, (gmesa->FrameCount << 9));
- }
-
- /* Turn off GID clipping if window is not clipped */
- if (gmesa->NotClipped) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Rectangle2DControl, 0);
- }
- }
-
- if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) {
- int y = gmesa->driScreen->fbHeight - gmesa->driDrawable->y - gmesa->driDrawable->h;
- int x = gmesa->driDrawable->x;
- int w = gmesa->driDrawable->w;
- int h = gmesa->driDrawable->h;
-
- mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
-
- if (x < 0) { w -= -x; x = 0; }
-
- /* Turn on GID clipping if window is clipped */
- if (!gmesa->NotClipped) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Rectangle2DControl, 1);
- }
-
- CHECK_DMA_BUFFER(gmesa, 18);
- WRITE(gmesa->buf, FBBlockColor, gmesa->ClearColor);
- WRITE(gmesa->buf, ColorDDAMode, ColorDDADisable);
- WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable);
- WRITE(gmesa->buf, DepthMode, 0);
- WRITE(gmesa->buf, DeltaMode, 0);
- WRITE(gmesa->buf, AlphaBlendMode, 0);
-#if 1
- WRITE(gmesa->buf, dY, 1<<16);
- WRITE(gmesa->buf, dXDom, 0<<16);
- WRITE(gmesa->buf, dXSub, 0<<16);
- WRITE(gmesa->buf, StartXSub, (x+w)<<16);
- WRITE(gmesa->buf, GLINTCount, h);
- WRITE(gmesa->buf, StartXDom, x<<16);
- WRITE(gmesa->buf, StartY, y<<16);
- WRITE(gmesa->buf, Render, 0x00000048); /* NOT_DONE */
-#else
- WRITE(gmesa->buf, Rectangle2DMode, (((h & 0xfff)<<12) |
- (w & 0xfff)));
- WRITE(gmesa->buf, DrawRectangle2D, (((y & 0xffff)<<16) |
- (x & 0xffff)));
-#endif
- WRITE(gmesa->buf, DepthMode, gmesa->DepthMode);
- WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode);
- WRITE(gmesa->buf, AlphaBlendMode, gmesa->AlphaBlendMode);
- WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode);
-
- /* Turn off GID clipping if window is clipped */
- if (gmesa->NotClipped) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Rectangle2DControl, 0);
- }
- }
-
-#ifdef DO_VALIDATE
- PROCESS_DMA_BUFFER_TOP_HALF(gmesa);
-
- DRM_SPINUNLOCK(&gmesa->driScreen->pSAREA->drawable_lock,
- gmesa->driScreen->drawLockID);
- VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa);
-
- PROCESS_DMA_BUFFER_BOTTOM_HALF(gmesa);
-#endif
-
- if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-}
-
-/* =============================================================
- * Depth testing
- */
-
-static void gammaUpdateZMode( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- u_int32_t z = gmesa->DepthMode;
- u_int32_t delta = gmesa->DeltaMode;
- u_int32_t window = gmesa->Window;
- u_int32_t lbread = gmesa->LBReadMode;
-
- z &= ~DM_CompareMask;
-
- switch ( ctx->Depth.Func ) {
- case GL_NEVER:
- z |= DM_Never;
- break;
- case GL_ALWAYS:
- z |= DM_Always;
- break;
- case GL_LESS:
- z |= DM_Less;
- break;
- case GL_LEQUAL:
- z |= DM_LessEqual;
- break;
- case GL_EQUAL:
- z |= DM_Equal;
- break;
- case GL_GEQUAL:
- z |= DM_GreaterEqual;
- break;
- case GL_GREATER:
- z |= DM_Greater;
- break;
- case GL_NOTEQUAL:
- z |= DM_NotEqual;
- break;
- }
-
- if ( ctx->Depth.Test ) {
- z |= DepthModeEnable;
- delta |= DM_DepthEnable;
- window |= W_DepthFCP;
- lbread |= LBReadDstEnable;
- } else {
- z &= ~DepthModeEnable;
- delta &= ~DM_DepthEnable;
- window &= ~W_DepthFCP;
- lbread &= ~LBReadDstEnable;
- }
-
- if ( ctx->Depth.Mask ) {
- z |= DM_WriteMask;
- } else {
- z &= ~DM_WriteMask;
- }
-
-#if 0
- if ( gmesa->DepthMode != z ){
-#endif
- gmesa->DepthMode = z;
- gmesa->DeltaMode = delta;
- gmesa->Window = window;
- gmesa->LBReadMode = lbread;
- gmesa->dirty |= GAMMA_UPLOAD_DEPTH;
-#if 0
- }
-#endif
-}
-
-static void gammaDDDepthFunc( GLcontext *ctx, GLenum func )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_DEPTH;
-}
-
-static void gammaDDDepthMask( GLcontext *ctx, GLboolean flag )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_DEPTH;
-}
-
-static void gammaDDClearDepth( GLcontext *ctx, GLclampd d )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- switch ( gmesa->DepthSize ) {
- case 16:
- gmesa->ClearDepth = d * 0x0000ffff;
- break;
- case 24:
- gmesa->ClearDepth = d * 0x00ffffff;
- break;
- case 32:
- gmesa->ClearDepth = d * 0xffffffff;
- break;
- }
-}
-
-static void gammaDDFinish( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_DMA_BUFFER(gmesa);
-}
-
-static void gammaDDFlush( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_DMA_BUFFER(gmesa);
-}
-
-/* =============================================================
- * Fog
- */
-
-static void gammaUpdateFogAttrib( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- u_int32_t f = gmesa->FogMode;
- u_int32_t g = gmesa->GeometryMode;
- u_int32_t d = gmesa->DeltaMode;
-
- if (ctx->Fog.Enabled) {
- f |= FogModeEnable;
- g |= GM_FogEnable;
- d |= DM_FogEnable;
- } else {
- f &= ~FogModeEnable;
- g &= ~GM_FogEnable;
- d &= ~DM_FogEnable;
- }
-
- g &= ~GM_FogMask;
-
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- g |= GM_FogLinear;
- break;
- case GL_EXP:
- g |= GM_FogExp;
- break;
- case GL_EXP2:
- g |= GM_FogExpSquared;
- break;
- }
-
- if ( gmesa->FogMode != f ) {
- gmesa->FogMode = f;
- gmesa->dirty |= GAMMA_UPLOAD_FOG;
- }
-
- if ( gmesa->GeometryMode != g ) {
- gmesa->GeometryMode = g;
- gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY;
- }
-
- if ( gmesa->DeltaMode != d ) {
- gmesa->DeltaMode = d;
- gmesa->dirty |= GAMMA_UPLOAD_DEPTH;
- }
-}
-
-#if 0
-static void gammaDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_FOG;
-}
-#endif
-
-/* =============================================================
- * Lines
- */
-static void gammaDDLineWidth( GLcontext *ctx, GLfloat width )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- CHECK_DMA_BUFFER(gmesa, 3);
- WRITE(gmesa->buf, LineWidth, (GLuint)width);
- WRITEF(gmesa->buf, AAlineWidth, width);
- WRITE(gmesa->buf, LineWidthOffset, (GLuint)(width-1)/2);
-}
-
-static void gammaDDLineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- gmesa->LineMode &= ~(LM_StippleMask | LM_RepeatFactorMask);
- gmesa->LineMode |= ((GLuint)(factor - 1) << 1) | ((GLuint)pattern << 10);
-
- gmesa->dirty |= GAMMA_UPLOAD_LINEMODE;
-}
-
-
-
-/* =============================================================
- * Points
- */
-static void gammaDDPointSize( GLcontext *ctx, GLfloat size )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, PointSize, (GLuint)size);
- WRITEF(gmesa->buf, AApointSize, size);
-}
-
-/* =============================================================
- * Polygon
- */
-
-static void gammaUpdatePolygon( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- u_int32_t g = gmesa->GeometryMode;
-
- g &= ~(GM_PolyOffsetFillEnable | GM_PolyOffsetPointEnable |
- GM_PolyOffsetLineEnable);
-
- if (ctx->Polygon.OffsetFill) g |= GM_PolyOffsetFillEnable;
- if (ctx->Polygon.OffsetPoint) g |= GM_PolyOffsetPointEnable;
- if (ctx->Polygon.OffsetLine) g |= GM_PolyOffsetLineEnable;
-
- g &= ~GM_FB_PolyMask;
-
- switch (ctx->Polygon.FrontMode) {
- case GL_FILL:
- g |= GM_FrontPolyFill;
- break;
- case GL_LINE:
- g |= GM_FrontPolyLine;
- break;
- case GL_POINT:
- g |= GM_FrontPolyPoint;
- break;
- }
-
- switch (ctx->Polygon.BackMode) {
- case GL_FILL:
- g |= GM_BackPolyFill;
- break;
- case GL_LINE:
- g |= GM_BackPolyLine;
- break;
- case GL_POINT:
- g |= GM_BackPolyPoint;
- break;
- }
-
- if ( gmesa->GeometryMode != g ) {
- gmesa->GeometryMode = g;
- gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY;
- }
-
- gmesa->dirty |= GAMMA_UPLOAD_POLYGON;
-}
-
-static void gammaDDPolygonMode( GLcontext *ctx, GLenum face, GLenum mode)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
-
- gmesa->new_state |= GAMMA_NEW_POLYGON;
-}
-
-static void gammaUpdateStipple( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
-
- if (ctx->Polygon.StippleFlag) {
- gmesa->AreaStippleMode |= AreaStippleModeEnable/* | ASM_X32 | ASM_Y32*/;
- } else {
- gmesa->AreaStippleMode &= ~AreaStippleModeEnable;
- }
-
- gmesa->dirty |= GAMMA_UPLOAD_STIPPLE;
-}
-
-static void gammaDDPolygonStipple( GLcontext *ctx, const GLubyte *mask)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_STIPPLE;
-}
-
-/* =============================================================
- * Clipping
- */
-
-static void gammaUpdateClipping( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- GLint x1, y1, x2, y2;
-
- if ( gmesa->driDrawable ) {
- x1 = gmesa->driDrawable->x + ctx->Scissor.X;
- y1 = gmesa->driScreen->fbHeight -
- (gmesa->driDrawable->y +
- gmesa->driDrawable->h) + ctx->Scissor.Y;
- x2 = x1 + ctx->Scissor.Width;
- y2 = y1 + ctx->Scissor.Height;
-
- gmesa->ScissorMinXY = x1 | (y1 << 16);
- gmesa->ScissorMaxXY = x2 | (y2 << 16);
- if (ctx->Scissor.Enabled)
- gmesa->ScissorMode |= UserScissorEnable;
- else
- gmesa->ScissorMode &= ~UserScissorEnable;
-
- gmesa->dirty |= GAMMA_UPLOAD_CLIP;
- }
-}
-
-static void gammaDDScissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei w, GLsizei h )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_CLIP;
-}
-
-/* =============================================================
- * Culling
- */
-
-static void gammaUpdateCull( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- u_int32_t g = gmesa->GeometryMode;
-
- g &= ~(GM_PolyCullMask | GM_FFMask);
-
- if (ctx->Polygon.FrontFace == GL_CCW) {
- g |= GM_FrontFaceCCW;
- } else {
- g |= GM_FrontFaceCW;
- }
-
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_FRONT:
- g |= GM_PolyCullFront;
- break;
- case GL_BACK:
- g |= GM_PolyCullBack;
- break;
- case GL_FRONT_AND_BACK:
- g |= GM_PolyCullBoth;
- break;
- }
-
- if ( ctx->Polygon.CullFlag ) {
- g |= GM_PolyCullEnable;
- } else {
- g &= ~GM_PolyCullEnable;
- }
-
- if ( gmesa->GeometryMode != g ) {
- gmesa->GeometryMode = g;
- gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY;
- }
-}
-
-static void gammaDDCullFace( GLcontext *ctx, GLenum mode )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_CULL;
-}
-
-static void gammaDDFrontFace( GLcontext *ctx, GLenum mode )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_CULL;
-}
-
-/* =============================================================
- * Masks
- */
-
-static void gammaUpdateMasks( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
-
- GLuint mask = gammaPackColor( gmesa->gammaScreen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] );
-
- if (gmesa->gammaScreen->cpp == 2) mask |= mask << 16;
-
- if ( gmesa->FBHardwareWriteMask != mask ) {
- gmesa->FBHardwareWriteMask = mask;
- gmesa->dirty |= GAMMA_UPLOAD_MASKS;
- }
-}
-
-static void gammaDDColorMask( GLcontext *ctx, GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_MASKS;
-}
-
-/* =============================================================
- * Rendering attributes
- *
- * We really don't want to recalculate all this every time we bind a
- * texture. These things shouldn't change all that often, so it makes
- * sense to break them out of the core texture state update routines.
- */
-
-#if ENABLELIGHTING
-static void gammaDDLightfv(GLcontext *ctx, GLenum light, GLenum pname,
- const GLfloat *params, GLint nParams)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- GLfloat l,x,y,z,w;
-
- switch(light) {
- case GL_LIGHT0:
- switch (pname) {
- case GL_AMBIENT:
- CHECK_DMA_BUFFER(gmesa, 3);
- /* We don't do alpha */
- WRITEF(gmesa->buf, Light0AmbientIntensityBlue, params[2]);
- WRITEF(gmesa->buf, Light0AmbientIntensityGreen, params[1]);
- WRITEF(gmesa->buf, Light0AmbientIntensityRed, params[0]);
- break;
- case GL_DIFFUSE:
- CHECK_DMA_BUFFER(gmesa, 3);
- /* We don't do alpha */
- WRITEF(gmesa->buf, Light0DiffuseIntensityBlue, params[2]);
- WRITEF(gmesa->buf, Light0DiffuseIntensityGreen, params[1]);
- WRITEF(gmesa->buf, Light0DiffuseIntensityRed, params[0]);
- break;
- case GL_SPECULAR:
- CHECK_DMA_BUFFER(gmesa, 3);
- /* We don't do alpha */
- WRITEF(gmesa->buf, Light0SpecularIntensityBlue, params[2]);
- WRITEF(gmesa->buf, Light0SpecularIntensityGreen, params[1]);
- WRITEF(gmesa->buf, Light0SpecularIntensityRed, params[0]);
- break;
- case GL_POSITION:
- /* Normalize <x,y,z> */
- x = params[0]; y = params[1]; z = params[2]; w = params[3];
- l = sqrt(x*x + y*y + z*z + w*w);
- w /= l;
- x /= l;
- y /= l;
- z /= l;
- if (params[3] != 0.0) {
- gmesa->Light0Mode |= Light0ModeAttenuation;
- gmesa->Light0Mode |= Light0ModeLocal;
- } else {
- gmesa->Light0Mode &= ~Light0ModeAttenuation;
- gmesa->Light0Mode &= ~Light0ModeLocal;
- }
- CHECK_DMA_BUFFER(gmesa, 5);
- WRITE(gmesa->buf, Light0Mode, gmesa->Light0Mode);
- WRITEF(gmesa->buf, Light0PositionW, w);
- WRITEF(gmesa->buf, Light0PositionZ, z);
- WRITEF(gmesa->buf, Light0PositionY, y);
- WRITEF(gmesa->buf, Light0PositionX, x);
- break;
- case GL_SPOT_DIRECTION:
- CHECK_DMA_BUFFER(gmesa, 3);
- /* WRITEF(gmesa->buf, Light0SpotlightDirectionW, params[3]); */
- WRITEF(gmesa->buf, Light0SpotlightDirectionZ, params[2]);
- WRITEF(gmesa->buf, Light0SpotlightDirectionY, params[1]);
- WRITEF(gmesa->buf, Light0SpotlightDirectionX, params[0]);
- break;
- case GL_SPOT_EXPONENT:
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITEF(gmesa->buf, Light0SpotlightExponent, params[0]);
- break;
- case GL_SPOT_CUTOFF:
- if (params[0] != 180.0)
- gmesa->Light0Mode |= Light0ModeSpotLight;
- else
- gmesa->Light0Mode &= ~Light0ModeSpotLight;
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, Light0Mode, gmesa->Light0Mode);
- WRITEF(gmesa->buf, Light0CosSpotlightCutoffAngle, cos(params[0]*DEG2RAD));
- break;
- case GL_CONSTANT_ATTENUATION:
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITEF(gmesa->buf, Light0ConstantAttenuation, params[0]);
- break;
- case GL_LINEAR_ATTENUATION:
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITEF(gmesa->buf, Light0LinearAttenuation, params[0]);
- break;
- case GL_QUADRATIC_ATTENUATION:
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITEF(gmesa->buf, Light0QuadraticAttenuation, params[0]);
- break;
- }
- break;
- }
-}
-
-static void gammaDDLightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *params )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- CHECK_DMA_BUFFER(gmesa, 3);
- /* We don't do alpha */
- WRITEF(gmesa->buf, SceneAmbientColorBlue, params[2]);
- WRITEF(gmesa->buf, SceneAmbientColorGreen, params[1]);
- WRITEF(gmesa->buf, SceneAmbientColorRed, params[0]);
- break;
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- if (params[0] != 0.0)
- gmesa->LightingMode |= LightingModeLocalViewer;
- else
- gmesa->LightingMode &= ~LightingModeLocalViewer;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, LightingMode, gmesa->LightingMode);
- break;
- case GL_LIGHT_MODEL_TWO_SIDE:
- if (params[0] == 1.0f) {
- gmesa->LightingMode |= LightingModeTwoSides;
- gmesa->MaterialMode |= MaterialModeTwoSides;
- } else {
- gmesa->LightingMode &= ~LightingModeTwoSides;
- gmesa->MaterialMode &= ~MaterialModeTwoSides;
- }
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, LightingMode, gmesa->LightingMode);
- WRITE(gmesa->buf, MaterialMode, gmesa->MaterialMode);
- break;
- }
-}
-#endif
-
-static void gammaDDShadeModel( GLcontext *ctx, GLenum mode )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- u_int32_t g = gmesa->GeometryMode;
- u_int32_t c = gmesa->ColorDDAMode;
-
- g &= ~GM_ShadingMask;
- c &= ~ColorDDAShadingMask;
-
- switch ( mode ) {
- case GL_FLAT:
- g |= GM_FlatShading;
- c |= ColorDDAFlat;
- break;
- case GL_SMOOTH:
- g |= GM_GouraudShading;
- c |= ColorDDAGouraud;
- break;
- default:
- return;
- }
-
- if ( gmesa->ColorDDAMode != c ) {
- FLUSH_BATCH( gmesa );
- gmesa->ColorDDAMode = c;
-
- gmesa->dirty |= GAMMA_UPLOAD_SHADE;
- }
-
- if ( gmesa->GeometryMode != g ) {
- FLUSH_BATCH( gmesa );
- gmesa->GeometryMode = g;
-
- gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY;
- }
-}
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void gammaDDClearColor( GLcontext *ctx, const GLfloat color[4])
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- GLubyte c[4];
- UNCLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
-
- gmesa->ClearColor = gammaPackColor( gmesa->gammaScreen->cpp,
- c[0], c[1], c[2], c[3] );
-
- if (gmesa->gammaScreen->cpp == 2) gmesa->ClearColor |= gmesa->ClearColor<<16;
-}
-
-
-static void gammaDDLogicalOpcode( GLcontext *ctx, GLenum opcode )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
-
- if ( ctx->Color.ColorLogicOpEnabled ) {
- gmesa->LogicalOpMode = opcode << 1 | LogicalOpModeEnable;
- } else {
- gmesa->LogicalOpMode = LogicalOpModeDisable;
- }
-
- gmesa->dirty |= GAMMA_UPLOAD_LOGICOP;
-}
-
-static void gammaDDDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- gmesa->drawOffset = gmesa->readOffset = 0;
- break;
- case GL_BACK_LEFT:
- gmesa->drawOffset = gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
- break;
- }
-}
-
-static void gammaDDReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* XXX anything? */
-}
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-void gammaUpdateWindow( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = gmesa->driDrawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset = gmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat sx = v[MAT_SX];
- GLfloat tx = v[MAT_TX] + xoffset;
- GLfloat sy = v[MAT_SY];
- GLfloat ty = v[MAT_TY] + yoffset;
- GLfloat sz = v[MAT_SZ] * gmesa->depth_scale;
- GLfloat tz = v[MAT_TZ] * gmesa->depth_scale;
-
- gmesa->dirty |= GAMMA_UPLOAD_VIEWPORT;
-
- gmesa->ViewportScaleX = sx;
- gmesa->ViewportScaleY = sy;
- gmesa->ViewportScaleZ = sz;
- gmesa->ViewportOffsetX = tx;
- gmesa->ViewportOffsetY = ty;
- gmesa->ViewportOffsetZ = tz;
-}
-
-
-
-static void gammaDDViewport( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- gammaUpdateWindow( ctx );
-}
-
-static void gammaDDDepthRange( GLcontext *ctx, GLclampd nearval,
- GLclampd farval )
-{
- gammaUpdateWindow( ctx );
-}
-
-void gammaUpdateViewportOffset( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = gmesa->driDrawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset = gmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat tx = v[MAT_TX] + xoffset;
- GLfloat ty = v[MAT_TY] + yoffset;
-
- if ( gmesa->ViewportOffsetX != tx ||
- gmesa->ViewportOffsetY != ty )
- {
- gmesa->ViewportOffsetX = tx;
- gmesa->ViewportOffsetY = ty;
-
- gmesa->new_state |= GAMMA_NEW_WINDOW;
- }
-
- gmesa->new_state |= GAMMA_NEW_CLIP;
-}
-
-#if 0
-/*
- * Matrix
- */
-
-static void gammaLoadHWMatrix(GLcontext *ctx)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- const GLfloat *m;
-
- gmesa->TransformMode &= ~XM_XformTexture;
-
- switch (ctx->Transform.MatrixMode) {
- case GL_MODELVIEW:
- gmesa->TransformMode |= XM_UseModelViewMatrix;
- m = ctx->ModelviewMatrixStack.Top->m;
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, ModelViewMatrix0, m[0]);
- WRITEF(gmesa->buf, ModelViewMatrix1, m[1]);
- WRITEF(gmesa->buf, ModelViewMatrix2, m[2]);
- WRITEF(gmesa->buf, ModelViewMatrix3, m[3]);
- WRITEF(gmesa->buf, ModelViewMatrix4, m[4]);
- WRITEF(gmesa->buf, ModelViewMatrix5, m[5]);
- WRITEF(gmesa->buf, ModelViewMatrix6, m[6]);
- WRITEF(gmesa->buf, ModelViewMatrix7, m[7]);
- WRITEF(gmesa->buf, ModelViewMatrix8, m[8]);
- WRITEF(gmesa->buf, ModelViewMatrix9, m[9]);
- WRITEF(gmesa->buf, ModelViewMatrix10, m[10]);
- WRITEF(gmesa->buf, ModelViewMatrix11, m[11]);
- WRITEF(gmesa->buf, ModelViewMatrix12, m[12]);
- WRITEF(gmesa->buf, ModelViewMatrix13, m[13]);
- WRITEF(gmesa->buf, ModelViewMatrix14, m[14]);
- WRITEF(gmesa->buf, ModelViewMatrix15, m[15]);
- break;
- case GL_PROJECTION:
- m = ctx->ProjectionMatrixStack.Top->m;
- CHECK_DMA_BUFFER(gmesa, 16);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix0, m[0]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix1, m[1]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix2, m[2]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix3, m[3]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix4, m[4]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix5, m[5]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix6, m[6]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix7, m[7]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix8, m[8]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix9, m[9]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix10, m[10]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix11, m[11]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix12, m[12]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix13, m[13]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix14, m[14]);
- WRITEF(gmesa->buf, ModelViewProjectionMatrix15, m[15]);
- break;
- case GL_TEXTURE:
- m = ctx->TextureMatrixStack[0].Top->m;
- CHECK_DMA_BUFFER(gmesa, 16);
- gmesa->TransformMode |= XM_XformTexture;
- WRITEF(gmesa->buf, TextureMatrix0, m[0]);
- WRITEF(gmesa->buf, TextureMatrix1, m[1]);
- WRITEF(gmesa->buf, TextureMatrix2, m[2]);
- WRITEF(gmesa->buf, TextureMatrix3, m[3]);
- WRITEF(gmesa->buf, TextureMatrix4, m[4]);
- WRITEF(gmesa->buf, TextureMatrix5, m[5]);
- WRITEF(gmesa->buf, TextureMatrix6, m[6]);
- WRITEF(gmesa->buf, TextureMatrix7, m[7]);
- WRITEF(gmesa->buf, TextureMatrix8, m[8]);
- WRITEF(gmesa->buf, TextureMatrix9, m[9]);
- WRITEF(gmesa->buf, TextureMatrix10, m[10]);
- WRITEF(gmesa->buf, TextureMatrix11, m[11]);
- WRITEF(gmesa->buf, TextureMatrix12, m[12]);
- WRITEF(gmesa->buf, TextureMatrix13, m[13]);
- WRITEF(gmesa->buf, TextureMatrix14, m[14]);
- WRITEF(gmesa->buf, TextureMatrix15, m[15]);
- break;
-
- default:
- /* ERROR!!! -- how did this happen? */
- break;
- }
-
- gmesa->dirty |= GAMMA_UPLOAD_TRANSFORM;
-}
-#endif
-
-/* =============================================================
- * State enable/disable
- */
-
-static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- switch ( cap ) {
- case GL_ALPHA_TEST:
- case GL_BLEND:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_ALPHA;
- break;
-
- case GL_CULL_FACE:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_CULL;
- break;
-
- case GL_DEPTH_TEST:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_DEPTH;
- break;
-
- case GL_DITHER:
- do {
- u_int32_t d = gmesa->DitherMode;
- FLUSH_BATCH( gmesa );
-
- if ( state ) {
- d |= DM_DitherEnable;
- } else {
- d &= ~DM_DitherEnable;
- }
-
- if ( gmesa->DitherMode != d ) {
- gmesa->DitherMode = d;
- gmesa->dirty |= GAMMA_UPLOAD_DITHER;
- }
- } while (0);
- break;
-
-#if 0
- case GL_FOG:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_FOG;
- break;
-#endif
-
- case GL_INDEX_LOGIC_OP:
- case GL_COLOR_LOGIC_OP:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_LOGICOP;
- break;
-
-#if ENABLELIGHTING
- case GL_LIGHTING:
- do {
- u_int32_t l = gmesa->LightingMode;
- FLUSH_BATCH( gmesa );
-
- if ( state ) {
- l |= LightingModeEnable;
- } else {
- l &= ~LightingModeEnable;
- }
-
- if ( gmesa->LightingMode != l ) {
- gmesa->LightingMode = l;
- gmesa->dirty |= GAMMA_UPLOAD_LIGHT;
- }
- } while (0);
- break;
-
- case GL_COLOR_MATERIAL:
- do {
- u_int32_t m = gmesa->MaterialMode;
- FLUSH_BATCH( gmesa );
-
- if ( state ) {
- m |= MaterialModeEnable;
- } else {
- m &= ~MaterialModeEnable;
- }
-
- if ( gmesa->MaterialMode != m ) {
- gmesa->MaterialMode = m;
- gmesa->dirty |= GAMMA_UPLOAD_LIGHT;
- }
- } while (0);
- break;
-#endif
-
- case GL_LINE_SMOOTH:
- FLUSH_BATCH( gmesa );
- if ( state ) {
- gmesa->AntialiasMode |= AntialiasModeEnable;
- gmesa->LineMode |= LM_AntialiasEnable;
- } else {
- gmesa->AntialiasMode &= ~AntialiasModeEnable;
- gmesa->LineMode &= ~LM_AntialiasEnable;
- }
- gmesa->dirty |= GAMMA_UPLOAD_LINEMODE;
- break;
-
- case GL_POINT_SMOOTH:
- FLUSH_BATCH( gmesa );
- if ( state ) {
- gmesa->AntialiasMode |= AntialiasModeEnable;
- gmesa->PointMode |= PM_AntialiasEnable;
- } else {
- gmesa->AntialiasMode &= ~AntialiasModeEnable;
- gmesa->PointMode &= ~PM_AntialiasEnable;
- }
- gmesa->dirty |= GAMMA_UPLOAD_POINTMODE;
- break;
-
- case GL_POLYGON_SMOOTH:
- FLUSH_BATCH( gmesa );
- if ( state ) {
- gmesa->AntialiasMode |= AntialiasModeEnable;
- gmesa->TriangleMode |= TM_AntialiasEnable;
- } else {
- gmesa->AntialiasMode &= ~AntialiasModeEnable;
- gmesa->TriangleMode &= ~TM_AntialiasEnable;
- }
- gmesa->dirty |= GAMMA_UPLOAD_TRIMODE;
- break;
-
- case GL_SCISSOR_TEST:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_CLIP;
- break;
-
- case GL_POLYGON_OFFSET_FILL:
- case GL_POLYGON_OFFSET_POINT:
- case GL_POLYGON_OFFSET_LINE:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_POLYGON;
- break;
-
- case GL_LINE_STIPPLE:
- FLUSH_BATCH( gmesa );
- if ( state )
- gmesa->LineMode |= LM_StippleEnable;
- else
- gmesa->LineMode &= ~LM_StippleEnable;
- gmesa->dirty |= GAMMA_UPLOAD_LINEMODE;
- break;
-
- case GL_POLYGON_STIPPLE:
- FLUSH_BATCH( gmesa );
- gmesa->new_state |= GAMMA_NEW_STIPPLE;
- break;
-
- default:
- return;
- }
-}
-
-/* =============================================================
- * State initialization, management
- */
-
-
-/*
- * Load the current context's state into the hardware.
- *
- * NOTE: Be VERY careful about ensuring the context state is marked for
- * upload, the only place it shouldn't be uploaded is when the setup
- * state has changed in ReducedPrimitiveChange as this comes right after
- * a state update.
- *
- * Blits of any type should always upload the context and masks after
- * they are done.
- */
-void gammaEmitHwState( gammaContextPtr gmesa )
-{
- if (!gmesa->driDrawable) return;
-
- if (!gmesa->dirty) return;
-
-#ifdef DO_VALIDATE
- /* Flush any partially filled buffers */
- FLUSH_DMA_BUFFER(gmesa);
-
- DRM_SPINLOCK(&gmesa->driScreen->pSAREA->drawable_lock,
- gmesa->driScreen->drawLockID);
- VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa);
-#endif
-
- if (gmesa->dirty & GAMMA_UPLOAD_VIEWPORT) {
- gmesa->dirty &= ~GAMMA_UPLOAD_VIEWPORT;
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, ViewPortOffsetX, gmesa->ViewportOffsetX);
- WRITEF(gmesa->buf, ViewPortOffsetY, gmesa->ViewportOffsetY);
- WRITEF(gmesa->buf, ViewPortOffsetZ, gmesa->ViewportOffsetZ);
- WRITEF(gmesa->buf, ViewPortScaleX, gmesa->ViewportScaleX);
- WRITEF(gmesa->buf, ViewPortScaleY, gmesa->ViewportScaleY);
- WRITEF(gmesa->buf, ViewPortScaleZ, gmesa->ViewportScaleZ);
- }
- if ( (gmesa->dirty & GAMMA_UPLOAD_POINTMODE) ||
- (gmesa->dirty & GAMMA_UPLOAD_LINEMODE) ||
- (gmesa->dirty & GAMMA_UPLOAD_TRIMODE) ) {
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, AntialiasMode, gmesa->AntialiasMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_POINTMODE) {
- gmesa->dirty &= ~GAMMA_UPLOAD_POINTMODE;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PointMode, gmesa->PointMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_LINEMODE) {
- gmesa->dirty &= ~GAMMA_UPLOAD_LINEMODE;
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, LineMode, gmesa->LineMode);
- WRITE(gmesa->buf, LineStippleMode, gmesa->LineMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_TRIMODE) {
- gmesa->dirty &= ~GAMMA_UPLOAD_TRIMODE;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TriangleMode, gmesa->TriangleMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_FOG) {
- GLchan c[3], col;
- UNCLAMPED_FLOAT_TO_RGB_CHAN( c, gmesa->glCtx->Fog.Color );
- col = gammaPackColor(4, c[0], c[1], c[2], 0);
- gmesa->dirty &= ~GAMMA_UPLOAD_FOG;
- CHECK_DMA_BUFFER(gmesa, 5);
-#if 0
- WRITE(gmesa->buf, FogMode, gmesa->FogMode);
- WRITE(gmesa->buf, FogColor, col);
- WRITEF(gmesa->buf, FStart, gmesa->glCtx->Fog.Start);
-#endif
- WRITEF(gmesa->buf, FogEnd, gmesa->glCtx->Fog.End);
- WRITEF(gmesa->buf, FogDensity, gmesa->glCtx->Fog.Density);
- WRITEF(gmesa->buf, FogScale,
- 1.0f/(gmesa->glCtx->Fog.End - gmesa->glCtx->Fog.Start));
- }
- if (gmesa->dirty & GAMMA_UPLOAD_DITHER) {
- gmesa->dirty &= ~GAMMA_UPLOAD_DITHER;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, DitherMode, gmesa->DitherMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_LOGICOP) {
- gmesa->dirty &= ~GAMMA_UPLOAD_LOGICOP;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, LogicalOpMode, gmesa->LogicalOpMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_CLIP) {
- gmesa->dirty &= ~GAMMA_UPLOAD_CLIP;
- CHECK_DMA_BUFFER(gmesa, 3);
- WRITE(gmesa->buf, ScissorMinXY, gmesa->ScissorMinXY);
- WRITE(gmesa->buf, ScissorMaxXY, gmesa->ScissorMaxXY);
- WRITE(gmesa->buf, ScissorMode, gmesa->ScissorMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_MASKS) {
- gmesa->dirty &= ~GAMMA_UPLOAD_MASKS;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FBHardwareWriteMask, gmesa->FBHardwareWriteMask);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_ALPHA) {
- gmesa->dirty &= ~GAMMA_UPLOAD_ALPHA;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, AlphaTestMode, gmesa->AlphaTestMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_BLEND) {
- gmesa->dirty &= ~GAMMA_UPLOAD_BLEND;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, AlphaBlendMode, gmesa->AlphaBlendMode);
- }
- CHECK_DMA_BUFFER(gmesa, 1);
- if (gmesa->glCtx->Color.BlendEnabled || gmesa->glCtx->Color.AlphaEnabled) {
- WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode | gmesa->AB_FBReadMode_Save);
- } else {
- WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_LIGHT) {
- gmesa->dirty &= ~GAMMA_UPLOAD_LIGHT;
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, LightingMode, gmesa->LightingMode);
- WRITE(gmesa->buf, MaterialMode, gmesa->MaterialMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_SHADE) {
- gmesa->dirty &= ~GAMMA_UPLOAD_SHADE;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_POLYGON) {
- gmesa->dirty &= ~GAMMA_UPLOAD_POLYGON;
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITEF(gmesa->buf, PolygonOffsetBias, gmesa->glCtx->Polygon.OffsetUnits);
- WRITEF(gmesa->buf, PolygonOffsetFactor, gmesa->glCtx->Polygon.OffsetFactor);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_STIPPLE) {
- gmesa->dirty &= ~GAMMA_UPLOAD_STIPPLE;
- CHECK_DMA_BUFFER(gmesa, 33);
- WRITE(gmesa->buf, AreaStippleMode, gmesa->AreaStippleMode);
- WRITE(gmesa->buf, AreaStipplePattern0, gmesa->glCtx->PolygonStipple[0]);
- WRITE(gmesa->buf, AreaStipplePattern1, gmesa->glCtx->PolygonStipple[1]);
- WRITE(gmesa->buf, AreaStipplePattern2, gmesa->glCtx->PolygonStipple[2]);
- WRITE(gmesa->buf, AreaStipplePattern3, gmesa->glCtx->PolygonStipple[3]);
- WRITE(gmesa->buf, AreaStipplePattern4, gmesa->glCtx->PolygonStipple[4]);
- WRITE(gmesa->buf, AreaStipplePattern5, gmesa->glCtx->PolygonStipple[5]);
- WRITE(gmesa->buf, AreaStipplePattern6, gmesa->glCtx->PolygonStipple[6]);
- WRITE(gmesa->buf, AreaStipplePattern7, gmesa->glCtx->PolygonStipple[7]);
- WRITE(gmesa->buf, AreaStipplePattern8, gmesa->glCtx->PolygonStipple[8]);
- WRITE(gmesa->buf, AreaStipplePattern9, gmesa->glCtx->PolygonStipple[9]);
- WRITE(gmesa->buf, AreaStipplePattern10, gmesa->glCtx->PolygonStipple[10]);
- WRITE(gmesa->buf, AreaStipplePattern11, gmesa->glCtx->PolygonStipple[11]);
- WRITE(gmesa->buf, AreaStipplePattern12, gmesa->glCtx->PolygonStipple[12]);
- WRITE(gmesa->buf, AreaStipplePattern13, gmesa->glCtx->PolygonStipple[13]);
- WRITE(gmesa->buf, AreaStipplePattern14, gmesa->glCtx->PolygonStipple[14]);
- WRITE(gmesa->buf, AreaStipplePattern15, gmesa->glCtx->PolygonStipple[15]);
- WRITE(gmesa->buf, AreaStipplePattern16, gmesa->glCtx->PolygonStipple[16]);
- WRITE(gmesa->buf, AreaStipplePattern17, gmesa->glCtx->PolygonStipple[17]);
- WRITE(gmesa->buf, AreaStipplePattern18, gmesa->glCtx->PolygonStipple[18]);
- WRITE(gmesa->buf, AreaStipplePattern19, gmesa->glCtx->PolygonStipple[19]);
- WRITE(gmesa->buf, AreaStipplePattern20, gmesa->glCtx->PolygonStipple[20]);
- WRITE(gmesa->buf, AreaStipplePattern21, gmesa->glCtx->PolygonStipple[21]);
- WRITE(gmesa->buf, AreaStipplePattern22, gmesa->glCtx->PolygonStipple[22]);
- WRITE(gmesa->buf, AreaStipplePattern23, gmesa->glCtx->PolygonStipple[23]);
- WRITE(gmesa->buf, AreaStipplePattern24, gmesa->glCtx->PolygonStipple[24]);
- WRITE(gmesa->buf, AreaStipplePattern25, gmesa->glCtx->PolygonStipple[25]);
- WRITE(gmesa->buf, AreaStipplePattern26, gmesa->glCtx->PolygonStipple[26]);
- WRITE(gmesa->buf, AreaStipplePattern27, gmesa->glCtx->PolygonStipple[27]);
- WRITE(gmesa->buf, AreaStipplePattern28, gmesa->glCtx->PolygonStipple[28]);
- WRITE(gmesa->buf, AreaStipplePattern29, gmesa->glCtx->PolygonStipple[29]);
- WRITE(gmesa->buf, AreaStipplePattern30, gmesa->glCtx->PolygonStipple[30]);
- WRITE(gmesa->buf, AreaStipplePattern31, gmesa->glCtx->PolygonStipple[31]);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_DEPTH) {
- gmesa->dirty &= ~GAMMA_UPLOAD_DEPTH;
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITE(gmesa->buf, DepthMode, gmesa->DepthMode);
- WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode);
- WRITE(gmesa->buf, GLINTWindow,gmesa->Window | (gmesa->FrameCount << 9));
- WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_GEOMETRY) {
- gmesa->dirty &= ~GAMMA_UPLOAD_GEOMETRY;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_TRANSFORM) {
- gmesa->dirty &= ~GAMMA_UPLOAD_TRANSFORM;
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TransformMode, gmesa->TransformMode);
- }
- if (gmesa->dirty & GAMMA_UPLOAD_TEX0) {
- gammaTextureObjectPtr curTex = gmesa->CurrentTexObj[0];
- gmesa->dirty &= ~GAMMA_UPLOAD_TEX0;
- if (curTex) {
- CHECK_DMA_BUFFER(gmesa, 21);
- WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode | GM_TextureEnable);
- WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode | DM_TextureEnable);
- WRITE(gmesa->buf, TextureAddressMode, curTex->TextureAddressMode);
- WRITE(gmesa->buf, TextureReadMode, curTex->TextureReadMode);
- WRITE(gmesa->buf, TextureColorMode, curTex->TextureColorMode);
- WRITE(gmesa->buf, TextureFilterMode, curTex->TextureFilterMode);
- WRITE(gmesa->buf, TextureFormat, curTex->TextureFormat);
- WRITE(gmesa->buf, GLINTBorderColor, curTex->TextureBorderColor);
- WRITE(gmesa->buf, TxBaseAddr0, curTex->TextureBaseAddr[0]);
- WRITE(gmesa->buf, TxBaseAddr1, curTex->TextureBaseAddr[1]);
- WRITE(gmesa->buf, TxBaseAddr2, curTex->TextureBaseAddr[2]);
- WRITE(gmesa->buf, TxBaseAddr3, curTex->TextureBaseAddr[3]);
- WRITE(gmesa->buf, TxBaseAddr4, curTex->TextureBaseAddr[4]);
- WRITE(gmesa->buf, TxBaseAddr5, curTex->TextureBaseAddr[5]);
- WRITE(gmesa->buf, TxBaseAddr6, curTex->TextureBaseAddr[6]);
- WRITE(gmesa->buf, TxBaseAddr7, curTex->TextureBaseAddr[7]);
- WRITE(gmesa->buf, TxBaseAddr8, curTex->TextureBaseAddr[8]);
- WRITE(gmesa->buf, TxBaseAddr9, curTex->TextureBaseAddr[9]);
- WRITE(gmesa->buf, TxBaseAddr10, curTex->TextureBaseAddr[10]);
- WRITE(gmesa->buf, TxBaseAddr11, curTex->TextureBaseAddr[11]);
- WRITE(gmesa->buf, TextureCacheControl, (TCC_Enable | TCC_Invalidate));
- } else {
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode);
- WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode);
- WRITE(gmesa->buf, TextureAddressMode, TextureAddressModeDisable);
- WRITE(gmesa->buf, TextureReadMode, TextureReadModeDisable);
- WRITE(gmesa->buf, TextureFilterMode, TextureFilterModeDisable);
- WRITE(gmesa->buf, TextureColorMode, TextureColorModeDisable);
- }
- }
-#ifdef DO_VALIDATE
- PROCESS_DMA_BUFFER_TOP_HALF(gmesa);
-
- DRM_SPINUNLOCK(&gmesa->driScreen->pSAREA->drawable_lock,
- gmesa->driScreen->drawLockID);
- VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa);
-
- PROCESS_DMA_BUFFER_BOTTOM_HALF(gmesa);
-#endif
-}
-
-void gammaDDUpdateHWState( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- int new_state = gmesa->new_state;
-
- if ( new_state )
- {
- FLUSH_BATCH( gmesa );
-
- gmesa->new_state = 0;
-
- /* Update the various parts of the context's state.
- */
- if ( new_state & GAMMA_NEW_ALPHA )
- gammaUpdateAlphaMode( ctx );
-
- if ( new_state & GAMMA_NEW_DEPTH )
- gammaUpdateZMode( ctx );
-
- if ( new_state & GAMMA_NEW_FOG )
- gammaUpdateFogAttrib( ctx );
-
- if ( new_state & GAMMA_NEW_CLIP )
- gammaUpdateClipping( ctx );
-
- if ( new_state & GAMMA_NEW_POLYGON )
- gammaUpdatePolygon( ctx );
-
- if ( new_state & GAMMA_NEW_CULL )
- gammaUpdateCull( ctx );
-
- if ( new_state & GAMMA_NEW_MASKS )
- gammaUpdateMasks( ctx );
-
- if ( new_state & GAMMA_NEW_WINDOW )
- gammaUpdateWindow( ctx );
-
- if ( new_state & GAMMA_NEW_STIPPLE )
- gammaUpdateStipple( ctx );
- }
-
- /* HACK ! */
-
- gammaEmitHwState( gmesa );
-}
-
-
-static void gammaDDUpdateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- GAMMA_CONTEXT(ctx)->new_gl_state |= new_state;
-}
-
-
-/* Initialize the context's hardware state.
- */
-void gammaDDInitState( gammaContextPtr gmesa )
-{
- gmesa->new_state = 0;
-}
-
-/* Initialize the driver's state functions.
- */
-void gammaDDInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = gammaDDUpdateState;
-
- ctx->Driver.Clear = gammaDDClear;
- ctx->Driver.ClearIndex = NULL;
- ctx->Driver.ClearColor = gammaDDClearColor;
- ctx->Driver.DrawBuffer = gammaDDDrawBuffer;
- ctx->Driver.ReadBuffer = gammaDDReadBuffer;
-
- ctx->Driver.IndexMask = NULL;
- ctx->Driver.ColorMask = gammaDDColorMask;
-
- ctx->Driver.AlphaFunc = gammaDDAlphaFunc;
- ctx->Driver.BlendEquationSeparate = gammaDDBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = gammaDDBlendFuncSeparate;
- ctx->Driver.ClearDepth = gammaDDClearDepth;
- ctx->Driver.CullFace = gammaDDCullFace;
- ctx->Driver.FrontFace = gammaDDFrontFace;
- ctx->Driver.DepthFunc = gammaDDDepthFunc;
- ctx->Driver.DepthMask = gammaDDDepthMask;
- ctx->Driver.DepthRange = gammaDDDepthRange;
- ctx->Driver.Enable = gammaDDEnable;
- ctx->Driver.Finish = gammaDDFinish;
- ctx->Driver.Flush = gammaDDFlush;
-#if 0
- ctx->Driver.Fogfv = gammaDDFogfv;
-#endif
- ctx->Driver.Hint = NULL;
- ctx->Driver.LineWidth = gammaDDLineWidth;
- ctx->Driver.LineStipple = gammaDDLineStipple;
-#if ENABLELIGHTING
- ctx->Driver.Lightfv = gammaDDLightfv;
- ctx->Driver.LightModelfv = gammaDDLightModelfv;
-#endif
- ctx->Driver.LogicOpcode = gammaDDLogicalOpcode;
- ctx->Driver.PointSize = gammaDDPointSize;
- ctx->Driver.PolygonMode = gammaDDPolygonMode;
- ctx->Driver.PolygonStipple = gammaDDPolygonStipple;
- ctx->Driver.Scissor = gammaDDScissor;
- ctx->Driver.ShadeModel = gammaDDShadeModel;
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
- ctx->Driver.Viewport = gammaDDViewport;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tex.c
deleted file mode 100644
index d4fc93f86..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tex.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "texformat.h"
-#include "texobj.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-#include "gamma_context.h"
-#include "colormac.h"
-
-
-/*
- * Compute the 'S2.4' lod bias factor from the floating point OpenGL bias.
- */
-#if 0
-static GLuint gammaComputeLodBias(GLfloat bias)
-{
- return bias;
-}
-#endif
-
-static void gammaSetTexWrapping(gammaTextureObjectPtr t,
- GLenum wraps, GLenum wrapt)
-{
- u_int32_t t1 = t->TextureAddressMode;
- u_int32_t t2 = t->TextureReadMode;
-
- t1 &= ~(TAM_SWrap_Mask | TAM_TWrap_Mask);
- t2 &= ~(TRM_UWrap_Mask | TRM_VWrap_Mask);
-
- if (wraps != GL_CLAMP) {
- t1 |= TAM_SWrap_Repeat;
- t2 |= TRM_UWrap_Repeat;
- }
-
- if (wrapt != GL_CLAMP) {
- t1 |= TAM_TWrap_Repeat;
- t2 |= TRM_VWrap_Repeat;
- }
-
- t->TextureAddressMode = t1;
- t->TextureReadMode = t2;
-}
-
-
-static void gammaSetTexFilter(gammaContextPtr gmesa,
- gammaTextureObjectPtr t,
- GLenum minf, GLenum magf,
- GLfloat bias)
-{
- u_int32_t t1 = t->TextureAddressMode;
- u_int32_t t2 = t->TextureReadMode;
-
- t2 &= ~(TRM_Mag_Mask | TRM_Min_Mask);
-
- switch (minf) {
- case GL_NEAREST:
- t1 &= ~TAM_LODEnable;
- t2 &= ~TRM_MipMapEnable;
- t2 |= TRM_Min_Nearest;
- break;
- case GL_LINEAR:
- t1 &= ~TAM_LODEnable;
- t2 &= ~TRM_MipMapEnable;
- t2 |= TRM_Min_Linear;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- t2 |= TRM_Min_NearestMMNearest;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- t2 |= TRM_Min_LinearMMNearest;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- t2 |= TRM_Min_NearestMMLinear;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- t2 |= TRM_Min_LinearMMLinear;
- break;
- default:
- break;
- }
-
- switch (magf) {
- case GL_NEAREST:
- t2 |= TRM_Mag_Nearest;
- break;
- case GL_LINEAR:
- t2 |= TRM_Mag_Linear;
- break;
- default:
- break;
- }
-
- t->TextureAddressMode = t1;
- t->TextureReadMode = t2;
-}
-
-
-static void gammaSetTexBorderColor(gammaContextPtr gmesa,
- gammaTextureObjectPtr t,
- GLubyte color[4])
-{
- t->TextureBorderColor = PACK_COLOR_8888(color[0], color[1], color[2], color[3]);
-}
-
-
-static void gammaTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData;
- if (!t)
- return;
-
- /* Can't do the update now as we don't know whether to flush
- * vertices or not. Setting gmesa->new_state means that
- * gammaUpdateTextureState() will be called before any triangles are
- * rendered. If a statechange has occurred, it will be detected at
- * that point, and buffered vertices flushed.
- */
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- {
- GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias;
- gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias );
- }
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative for Radeon. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- gammaSwapOutTexObj( gmesa, t );
- break;
-
- default:
- return;
- }
-
- if (t == gmesa->CurrentTexObj[0])
- gmesa->dirty |= GAMMA_UPLOAD_TEX0;
-
-#if 0
- if (t == gmesa->CurrentTexObj[1]) {
- gmesa->dirty |= GAMMA_UPLOAD_TEX1;
- }
-#endif
-}
-
-
-static void gammaTexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
- GLuint unit = ctx->Texture.CurrentUnit;
-
- /* Only one env color. Need a fallback if env colors are different
- * and texture setup references env color in both units.
- */
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR: {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLfloat *fc = texUnit->EnvColor;
- GLuint r, g, b, a, col;
- CLAMPED_FLOAT_TO_UBYTE(r, fc[0]);
- CLAMPED_FLOAT_TO_UBYTE(g, fc[1]);
- CLAMPED_FLOAT_TO_UBYTE(b, fc[2]);
- CLAMPED_FLOAT_TO_UBYTE(a, fc[3]);
-
- col = ((a << 24) |
- (r << 16) |
- (g << 8) |
- (b << 0));
-
- break;
- }
- case GL_TEXTURE_ENV_MODE:
- gmesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */
- break;
-
- case GL_TEXTURE_LOD_BIAS_EXT:
-#if 0 /* ?!?!?! */
- {
- struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData;
- (void) t;
- /* XXX Looks like there's something missing here */
- }
-#endif
- break;
-
- default:
- break;
- }
-}
-
-#if 0
-static void gammaTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *pack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData;
- if (t) {
- gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t );
- }
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, pack, texObj, texImage );
-}
-#endif
-
-#if 0
-static void gammaTexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *pack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData;
- if (t) {
- gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t );
- }
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, pack, texObj,
- texImage);
-}
-#endif
-
-static void gammaTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData;
- if (t) {
- gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t );
- }
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
-}
-
-static void gammaTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData;
- if (t) {
- gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t );
- }
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-}
-
-static void gammaBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData;
-
- if (!t) {
- GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias;
- t = CALLOC_STRUCT(gamma_texture_object_t);
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->globj = tObj;
-
- t->TextureAddressMode = TextureAddressModeEnable | TAM_Operation_3D |
- TAM_DY_Enable | TAM_LODEnable;
- t->TextureReadMode = TextureReadModeEnable | TRM_PrimaryCacheEnable |
- TRM_MipMapEnable | TRM_BorderClamp | TRM_Border;
- t->TextureColorMode = TextureColorModeEnable;
- t->TextureFilterMode = TextureFilterModeEnable;
-
- if (target == GL_TEXTURE_2D) {
- t->TextureAddressMode |= TAM_TexMapType_2D;
- t->TextureReadMode |= TRM_TexMapType_2D;
- }
- else if (target == GL_TEXTURE_1D) {
- t->TextureAddressMode |= TAM_TexMapType_1D;
- t->TextureReadMode |= TRM_TexMapType_1D;
- }
-
- t->TextureColorMode = TextureColorModeEnable;
-
- t->TextureFilterMode = TextureFilterModeEnable;
-
-#ifdef MESA_LITTLE_ENDIAN
- t->TextureFormat = (TF_LittleEndian |
-#else
- t->TextureFormat = (TF_BigEndian |
-#endif
- TF_ColorOrder_RGB |
- TF_OutputFmt_Texel);
-
- t->dirty_images = ~0;
-
- tObj->DriverData = t;
- make_empty_list( t );
-
- gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT );
- gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias );
- gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan );
- }
-}
-
-static void gammaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
-
- if (t) {
- gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
-#if 0
- if (gmesa)
- GAMMA_FIREVERTICES( gmesa );
-#endif
- gammaDestroyTexObj( gmesa, t );
- tObj->DriverData = 0;
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-static GLboolean gammaIsTextureResident( GLcontext *ctx,
- struct gl_texture_object *tObj )
-{
- gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
- return t && t->MemBlock;
-}
-
-#ifdef UNUSED
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-gammaNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- return obj;
-}
-#endif
-
-void gammaInitTextureObjects( GLcontext *ctx )
-{
- struct gl_texture_object *texObj;
- GLuint tmp = ctx->Texture.CurrentUnit;
-
- ctx->Texture.CurrentUnit = 0;
-
- texObj = ctx->Texture.Unit[0].Current1D;
- gammaBindTexture( ctx, GL_TEXTURE_1D, texObj );
-
- texObj = ctx->Texture.Unit[0].Current2D;
- gammaBindTexture( ctx, GL_TEXTURE_2D, texObj );
-
-#if 0
- ctx->Texture.CurrentUnit = 1;
-
- texObj = ctx->Texture.Unit[1].Current1D;
- gammaBindTexture( ctx, GL_TEXTURE_1D, texObj );
-
- texObj = ctx->Texture.Unit[1].Current2D;
- gammaBindTexture( ctx, GL_TEXTURE_2D, texObj );
-#endif
-
- ctx->Texture.CurrentUnit = tmp;
-}
-
-
-void gammaDDInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->TexEnv = gammaTexEnv;
- functions->TexImage2D = gammaTexImage2D;
- functions->TexSubImage2D = gammaTexSubImage2D;
- functions->BindTexture = gammaBindTexture;
- functions->DeleteTexture = gammaDeleteTexture;
- functions->TexParameter = gammaTexParameter;
- functions->IsTextureResident = gammaIsTextureResident;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texmem.c
deleted file mode 100644
index 506b5c4c8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texmem.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "colormac.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
-#include "glint_dri.h"
-#include "gamma_context.h"
-#include "gamma_lock.h"
-
-void gammaDestroyTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t)
-{
- if (!t) return;
-
- /* This is sad - need to sync *in case* we upload a texture
- * to this newly free memory...
- */
- if (t->MemBlock) {
- mmFreeMem(t->MemBlock);
- t->MemBlock = 0;
-
- if (gmesa && t->age > gmesa->dirtyAge)
- gmesa->dirtyAge = t->age;
- }
-
- if (t->globj)
- t->globj->DriverData = 0;
-
- if (gmesa) {
- if (gmesa->CurrentTexObj[0] == t) {
- gmesa->CurrentTexObj[0] = 0;
- gmesa->dirty &= ~GAMMA_UPLOAD_TEX0;
- }
-
-#if 0
- if (gmesa->CurrentTexObj[1] == t) {
- gmesa->CurrentTexObj[1] = 0;
- gmesa->dirty &= ~GAMMA_UPLOAD_TEX1;
- }
-#endif
- }
-
- remove_from_list(t);
- free(t);
-}
-
-
-void gammaSwapOutTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t)
-{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (t->MemBlock) {
- mmFreeMem(t->MemBlock);
- t->MemBlock = 0;
-
- if (t->age > gmesa->dirtyAge)
- gmesa->dirtyAge = t->age;
- }
-
- t->dirty_images = ~0;
- move_to_tail(&(gmesa->SwappedOut), t);
-}
-
-
-
-/* Upload an image from mesa's internal copy.
- */
-static void gammaUploadTexLevel( gammaContextPtr gmesa, gammaTextureObjectPtr t, int level )
-{
- const struct gl_texture_image *image = t->image[level].image;
- int i,j;
- int l2d;
-#if 0
- int offset = 0;
-#endif
- int words, depthLog2;
-
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- l2d = 5; /* 32bits per texel == 1<<5 */
-
- if (level == 0) {
- t->TextureAddressMode &= ~(TAM_WidthMask | TAM_HeightMask);
- t->TextureAddressMode |= (image->WidthLog2 << 9) |
- (image->HeightLog2 << 13);
- t->TextureReadMode &= ~(TRM_WidthMask | TRM_HeightMask |
- TRM_DepthMask | TRM_Border |
- TRM_Patch);
- t->TextureReadMode |= (image->WidthLog2 << 1) |
- (image->HeightLog2 << 5) |
- (l2d << 9);
- t->TextureFormat &= ~(TF_CompnentsMask | TF_OneCompFmt_Mask);
- }
-
- t->TextureBaseAddr[level] = /* ??? */
- (unsigned long)(t->image[level].offset + t->BufAddr) << 5;
-
- CALC_LOG2(depthLog2, 1<<l2d);
- words = (image->Width * image->Height) >> (5-depthLog2);
-
- CHECK_DMA_BUFFER(gmesa, 3);
- WRITE(gmesa->buf, LBWindowBase, t->TextureBaseAddr[level] >> 5);
- WRITE(gmesa->buf, TextureCacheControl, (TCC_Enable | TCC_Invalidate));
- WRITE(gmesa->buf, WaitForCompletion, 0);
- FLUSH_DMA_BUFFER(gmesa);
-
- switch (t->image[level].internalFormat) {
- case GL_RGB:
- case 3:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- if (level == 0)
- t->TextureFormat |= TF_Compnents_3;
-
-#if 0 /* This is the texture download code we SHOULD be using */
- /* In the routines below, but this causes an DMA overrun - WHY ? */
- while (offset < words) {
- int count = gmesa->bufSize;
- int i;
- count -= 3;
- if (count > words-offset) count = words-offset;
-
- gmesa->buf->i = GlintTextureDownloadOffsetTag;
- gmesa->buf++;
- gmesa->buf->i = offset;
- gmesa->buf++;
- gmesa->buf->i = (GlintTextureDataTag | ((count-1) << 16));
- gmesa->buf++;
-
- for (i = 0; i < count; i++) {
- gmesa->buf->i = PACK_COLOR_565(src[0],src[1],src[2]);
- gmesa->buf++;
- src += 3;
- }
-
- gmesa->bufCount = count+3; /* texture data + 3 values */
- offset += count;
-
- FLUSH_DMA_BUFFER(gmesa);
- }
-#else
- /* The UGLY way, and SLOW !, but the above sometimes causes
- * a DMA overrun error ??? FIXME ! */
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureDownloadOffset, 0);
- for (i = 0; i < words; i++) {
- unsigned int data;
- data = PACK_COLOR_565(src[0],src[1],src[2]);
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureData, data);
- src += 3;
- }
- FLUSH_DMA_BUFFER(gmesa);
-#endif
- }
- break;
-
- case GL_RGBA:
- case 4:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- if (level == 0)
- t->TextureFormat |= TF_Compnents_4;
-
- /* The UGLY way, and SLOW !, but the above sometimes causes
- * a DMA overrun error ??? FIXME ! */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureDownloadOffset, 0);
- for (i = 0; i < words; i++) {
- unsigned int data;
- data = PACK_COLOR_8888(src[0],src[1],src[2],src[3]);
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureData, data);
- src += 4;
- }
- FLUSH_DMA_BUFFER(gmesa);
- }
- break;
-
- case GL_LUMINANCE:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- if (level == 0)
- t->TextureFormat |= TF_Compnents_1 | TF_OneCompFmt_Lum;
-
- /* The UGLY way, and SLOW !, but the above sometimes causes
- * a DMA overrun error ??? FIXME ! */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureDownloadOffset, 0);
- for (i = 0; i < words; i++) {
- unsigned int data;
- data = PACK_COLOR_888(src[0],src[0],src[0]);
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureData, data);
- src ++;
- }
- FLUSH_DMA_BUFFER(gmesa);
- }
- break;
-
- case GL_INTENSITY:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- if (level == 0)
- t->TextureFormat |= TF_Compnents_1 | TF_OneCompFmt_Intensity;
-
- /* The UGLY way, and SLOW !, but the above sometimes causes
- * a DMA overrun error ??? FIXME ! */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureDownloadOffset, 0);
- for (i = 0; i < words; i++) {
- unsigned int data;
- data = PACK_COLOR_8888(src[0],src[0],src[0],src[0]);
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureData, data);
- src ++;
- }
- FLUSH_DMA_BUFFER(gmesa);
- }
- break;
-
- case GL_LUMINANCE_ALPHA:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- if (level == 0)
- t->TextureFormat |= TF_Compnents_2;
-
- /* The UGLY way, and SLOW !, but the above sometimes causes
- * a DMA overrun error ??? FIXME ! */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureDownloadOffset, 0);
- for (i = 0; i < words; i++) {
- unsigned int data;
- data = PACK_COLOR_8888(src[0],src[0],src[0],src[1]);
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureData, data);
- src += 2;
- }
- FLUSH_DMA_BUFFER(gmesa);
- }
- break;
-
- case GL_ALPHA:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- if (level == 0)
- t->TextureFormat |= TF_Compnents_1 | TF_OneCompFmt_Alpha;
-
- /* The UGLY way, and SLOW !, but the above sometimes causes
- * a DMA overrun error ??? FIXME ! */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureDownloadOffset, 0);
- for (i = 0; i < words; i++) {
- unsigned int data;
- data = PACK_COLOR_8888(255,255,255,src[0]);
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, TextureData, data);
- src += 1;
- }
- FLUSH_DMA_BUFFER(gmesa);
- }
- break;
-
- /* TODO: Translate color indices *now*:
- */
- case GL_COLOR_INDEX:
- {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[level].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
- for (i = 0 ; i < image->Width ; i++) {
- dst[i] = src[0];
- src += 1;
- }
- }
- }
- break;
-
- default:
- fprintf(stderr, "Not supported texture format %s\n",
- _mesa_lookup_enum_by_nr(image->Format));
- }
-
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, WaitForCompletion, 0);
- WRITE(gmesa->buf, LBWindowBase, gmesa->LBWindowBase);
-}
-
-void gammaPrintLocalLRU( gammaContextPtr gmesa )
-{
- gammaTextureObjectPtr t;
- int sz = 1 << (gmesa->gammaScreen->logTextureGranularity);
-
- foreach( t, &gmesa->TexObjList ) {
- if (!t->globj)
- fprintf(stderr, "Placeholder %d at %x sz %x\n",
- t->MemBlock->ofs / sz,
- t->MemBlock->ofs,
- t->MemBlock->size);
- else
- fprintf(stderr, "Texture at %x sz %x\n",
- t->MemBlock->ofs,
- t->MemBlock->size);
-
- }
-}
-
-void gammaPrintGlobalLRU( gammaContextPtr gmesa )
-{
- int i, j;
- GAMMATextureRegionPtr list = gmesa->sarea->texList;
-
- for (i = 0, j = GAMMA_NR_TEX_REGIONS ; i < GAMMA_NR_TEX_REGIONS ; i++) {
- fprintf(stderr, "list[%d] age %d next %d prev %d\n",
- j, list[j].age, list[j].next, list[j].prev);
- j = list[j].next;
- if (j == GAMMA_NR_TEX_REGIONS) break;
- }
-
- if (j != GAMMA_NR_TEX_REGIONS)
- fprintf(stderr, "Loop detected in global LRU\n");
-}
-
-
-void gammaResetGlobalLRU( gammaContextPtr gmesa )
-{
- GAMMATextureRegionPtr list = gmesa->sarea->texList;
- int sz = 1 << gmesa->gammaScreen->logTextureGranularity;
- int i;
-
- /* (Re)initialize the global circular LRU list. The last element
- * in the array (GAMMA_NR_TEX_REGIONS) is the sentinal. Keeping it
- * at the end of the array allows it to be addressed rationally
- * when looking up objects at a particular location in texture
- * memory.
- */
- for (i = 0 ; (i+1) * sz <= gmesa->gammaScreen->textureSize ; i++) {
- list[i].prev = i-1;
- list[i].next = i+1;
- list[i].age = 0;
- }
-
- i--;
- list[0].prev = GAMMA_NR_TEX_REGIONS;
- list[i].prev = i-1;
- list[i].next = GAMMA_NR_TEX_REGIONS;
- list[GAMMA_NR_TEX_REGIONS].prev = i;
- list[GAMMA_NR_TEX_REGIONS].next = 0;
- gmesa->sarea->texAge = 0;
-}
-
-
-void gammaUpdateTexLRU( gammaContextPtr gmesa, gammaTextureObjectPtr t )
-{
- int i;
- int logsz = gmesa->gammaScreen->logTextureGranularity;
- int start = t->MemBlock->ofs >> logsz;
- int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz;
- GAMMATextureRegionPtr list = gmesa->sarea->texList;
-
- gmesa->texAge = ++gmesa->sarea->texAge;
-
- /* Update our local LRU
- */
- move_to_head( &(gmesa->TexObjList), t );
-
- /* Update the global LRU
- */
- for (i = start ; i <= end ; i++) {
-
- list[i].in_use = 1;
- list[i].age = gmesa->texAge;
-
- /* 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 = GAMMA_NR_TEX_REGIONS;
- list[i].next = list[GAMMA_NR_TEX_REGIONS].next;
- list[(unsigned)list[GAMMA_NR_TEX_REGIONS].next].prev = i;
- list[GAMMA_NR_TEX_REGIONS].next = i;
- }
-}
-
-
-/* Called for every shared texture region which has increased in age
- * since we last held the lock.
- *
- * Figures out which of our textures have been ejected by other clients,
- * and pushes a placeholder texture onto the LRU list to represent
- * the other client's textures.
- */
-void gammaTexturesGone( gammaContextPtr gmesa,
- GLuint offset,
- GLuint size,
- GLuint in_use )
-{
- gammaTextureObjectPtr t, tmp;
-
- foreach_s ( t, tmp, &gmesa->TexObjList ) {
-
- if (t->MemBlock->ofs >= offset + size ||
- t->MemBlock->ofs + t->MemBlock->size <= offset)
- continue;
-
- /* It overlaps - kick it off. Need to hold onto the currently bound
- * objects, however.
- */
- gammaSwapOutTexObj( gmesa, t );
- }
-
- if (in_use) {
- t = (gammaTextureObjectPtr) calloc(1,sizeof(*t));
- if (!t) return;
-
- t->MemBlock = mmAllocMem( gmesa->texHeap, size, 0, offset);
- insert_at_head( &gmesa->TexObjList, t );
- }
-
- /* Reload any lost textures referenced by current vertex buffer.
- */
-#if 0
- if (gmesa->vertex_buffer) {
- int i, j;
-
- fprintf(stderr, "\n\nreload tex\n");
-
- for (i = 0 ; i < gmesa->statenr ; i++) {
- for (j = 0 ; j < 2 ; j++) {
- gammaTextureObjectPtr t = gmesa->state_tex[j][i];
- if (t) {
- if (t->MemBlock == 0)
- gammaUploadTexImages( gmesa, t );
- }
- }
- }
-
- /* Hard to do this with the lock held:
- */
-/* GAMMA_FIREVERTICES( gmesa ); */
- }
-#endif
-}
-
-
-
-
-
-/* This is called with the lock held. May have to eject our own and/or
- * other client's texture objects to make room for the upload.
- */
-void gammaUploadTexImages( gammaContextPtr gmesa, gammaTextureObjectPtr t )
-{
- int i;
- int ofs;
- int numLevels;
-
- /* /fprintf(stderr, "%s\n", __FUNCTION__); */
-#if 0
- LOCK_HARDWARE( gmesa );
-#endif
-
- /* Do we need to eject LRU texture objects?
- */
- if (!t->MemBlock) {
- while (1)
- {
- t->MemBlock = mmAllocMem( gmesa->texHeap, t->totalSize, 12, 0 );
- if (t->MemBlock)
- break;
-
- if (gmesa->TexObjList.prev == gmesa->CurrentTexObj[0] ||
- gmesa->TexObjList.prev == gmesa->CurrentTexObj[1]) {
- fprintf(stderr, "Hit bound texture in upload\n");
- gammaPrintLocalLRU( gmesa );
- return;
- }
-
- if (gmesa->TexObjList.prev == &(gmesa->TexObjList)) {
- fprintf(stderr, "Failed to upload texture, sz %d\n", t->totalSize);
- mmDumpMemInfo( gmesa->texHeap );
- return;
- }
-
- gammaSwapOutTexObj( gmesa, gmesa->TexObjList.prev );
- }
-
- ofs = t->MemBlock->ofs;
- t->BufAddr = (char *)(unsigned long)(gmesa->LBWindowBase + ofs); /* ??? */
-
- if (t == gmesa->CurrentTexObj[0])
- gmesa->dirty |= GAMMA_UPLOAD_TEX0;
-
-#if 0
- if (t == gmesa->CurrentTexObj[1])
- gmesa->dirty |= GAMMA_UPLOAD_TEX1;
-#endif
-
- gammaUpdateTexLRU( gmesa, t );
- }
-
-#if 0
- if (gmesa->dirtyAge >= GET_DISPATCH_AGE(gmesa))
- gammaWaitAgeLocked( gmesa, gmesa->dirtyAge );
-#endif
-
- numLevels = t->lastLevel - t->firstLevel + 1;
- for (i = 0 ; i < numLevels ; i++)
- if (t->dirty_images & (1<<i))
- gammaUploadTexLevel( gmesa, t, i );
-
- t->dirty_images = 0;
-
-#if 0
- UNLOCK_HARDWARE( gmesa );
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texstate.c
deleted file mode 100644
index a8d1b253c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_texstate.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
-#include "gamma_context.h"
-
-static void gammaSetTexImages( gammaContextPtr gmesa,
- struct gl_texture_object *tObj )
-{
- GLuint height, width, pitch, i, log_pitch;
- gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint firstLevel, lastLevel, numLevels;
- GLint log2Width, log2Height;
-
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- t->texelBytes = 2;
-
- /* Compute which mipmap levels we really want to send 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.
- * Yes, this looks overly complicated, but it's all needed.
- */
- if (tObj->MinFilter == GL_LINEAR || tObj->MinFilter == GL_NEAREST) {
- 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, tObj->BaseLevel);
- lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2);
- lastLevel = MIN2(lastLevel, tObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
- }
-
- /* save these values */
- t->firstLevel = firstLevel;
- t->lastLevel = lastLevel;
-
- numLevels = lastLevel - firstLevel + 1;
-
- log2Width = tObj->Image[0][firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][firstLevel]->HeightLog2;
-
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- width = tObj->Image[0][firstLevel]->Width * t->texelBytes;
- for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 )
- log_pitch++;
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- for ( height = i = 0 ; i < numLevels ; i++ ) {
- t->image[i].image = tObj->Image[0][firstLevel + i];
- t->image[i].offset = height * pitch;
- t->image[i].internalFormat = baseImage->Format;
- height += t->image[i].image->Height;
- t->TextureBaseAddr[i] = /* ??? */
- (unsigned long)(t->image[i].offset + t->BufAddr) << 5;
-
- }
-
- t->Pitch = pitch;
- t->totalSize = height*pitch;
- t->max_level = i-1;
- gmesa->dirty |= GAMMA_UPLOAD_TEX0 /* | GAMMA_UPLOAD_TEX1*/;
-
- gammaUploadTexImages( gmesa, t );
-}
-
-static void gammaUpdateTexEnv( GLcontext *ctx, GLuint unit )
-{
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = texUnit->_Current;
- const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
- gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
- GLuint tc;
-
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- tc = t->TextureColorMode & ~(TCM_BaseFormatMask | TCM_ApplicationMask);
-
- switch (format) {
- case GL_RGB:
- tc |= TCM_BaseFormat_RGB;
- break;
- case GL_LUMINANCE:
- tc |= TCM_BaseFormat_Lum;
- break;
- case GL_ALPHA:
- tc |= TCM_BaseFormat_Alpha;
- break;
- case GL_LUMINANCE_ALPHA:
- tc |= TCM_BaseFormat_LumAlpha;
- break;
- case GL_INTENSITY:
- tc |= TCM_BaseFormat_Intensity;
- break;
- case GL_RGBA:
- tc |= TCM_BaseFormat_RGBA;
- break;
- case GL_COLOR_INDEX:
- break;
- }
-
- switch (texUnit->EnvMode) {
- case GL_REPLACE:
- tc |= TCM_Replace;
- break;
- case GL_MODULATE:
- tc |= TCM_Modulate;
- break;
- case GL_ADD:
- /* do nothing ???*/
- break;
- case GL_DECAL:
- tc |= TCM_Decal;
- break;
- case GL_BLEND:
- tc |= TCM_Blend;
- break;
- default:
- fprintf(stderr, "unknown tex env mode");
- return;
- }
-
- t->TextureColorMode = tc;
-}
-
-
-
-
-static void gammaUpdateTexUnit( GLcontext *ctx, GLuint unit )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT)
- {
- struct gl_texture_object *tObj = texUnit->_Current;
- gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
-
- /* Upload teximages (not pipelined)
- */
- if (t->dirty_images) {
- gammaSetTexImages( gmesa, tObj );
- if (!t->MemBlock) {
- FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
- }
-
-#if 0
- if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
- FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
-#endif
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if (gmesa->CurrentTexObj[unit] != t) {
- gmesa->dirty |= GAMMA_UPLOAD_TEX0 /* << unit */;
- gmesa->CurrentTexObj[unit] = t;
- gammaUpdateTexLRU( gmesa, t ); /* done too often */
- }
-
- /* Update texture environment if texture object image format or
- * texture environment state has changed.
- */
- if (tObj->Image[0][tObj->BaseLevel]->Format != gmesa->TexEnvImageFmt[unit]) {
- gmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
- gammaUpdateTexEnv( ctx, unit );
- }
- }
- else if (texUnit->_ReallyEnabled) {
- FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
- }
- else /*if (gmesa->CurrentTexObj[unit])*/ {
- gmesa->CurrentTexObj[unit] = 0;
- gmesa->TexEnvImageFmt[unit] = 0;
- gmesa->dirty &= ~(GAMMA_UPLOAD_TEX0<<unit);
- }
-}
-
-
-void gammaUpdateTextureState( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
- FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_FALSE );
- gammaUpdateTexUnit( ctx, 0 );
-#if 0
- gammaUpdateTexUnit( ctx, 1 );
-#endif
-}
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.c
deleted file mode 100644
index 83bf56a14..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- * Keith Whitwell, <keith@tungstengraphics.com>
- *
- * 3DLabs Gamma driver.
- */
-
-#include "gamma_context.h"
-#include "gamma_vb.h"
-#include "gamma_tris.h"
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-
-/***********************************************************************
- * Build hardware rasterization functions *
- ***********************************************************************/
-
-#define GAMMA_RAST_ALPHA_BIT 0x01
-#define GAMMA_RAST_TEX_BIT 0x02
-#define GAMMA_RAST_FLAT_BIT 0x04
-
-static gamma_point_func gamma_point_tab[0x8];
-static gamma_line_func gamma_line_tab[0x8];
-static gamma_tri_func gamma_tri_tab[0x8];
-static gamma_quad_func gamma_quad_tab[0x8];
-
-#define IND (0)
-#define TAG(x) x
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_ALPHA_BIT)
-#define TAG(x) x##_alpha
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_TEX_BIT)
-#define TAG(x) x##_tex
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_ALPHA_BIT|GAMMA_RAST_TEX_BIT)
-#define TAG(x) x##_alpha_tex
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_ALPHA_BIT|GAMMA_RAST_FLAT_BIT)
-#define TAG(x) x##_alpha_flat
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_TEX_BIT|GAMMA_RAST_FLAT_BIT)
-#define TAG(x) x##_tex_flat
-#include "gamma_tritmp.h"
-
-#define IND (GAMMA_RAST_ALPHA_BIT|GAMMA_RAST_TEX_BIT|GAMMA_RAST_FLAT_BIT)
-#define TAG(x) x##_alpha_tex_flat
-#include "gamma_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- gamma_init();
- gamma_init_alpha();
- gamma_init_tex();
- gamma_init_alpha_tex();
- gamma_init_flat();
- gamma_init_alpha_flat();
- gamma_init_tex_flat();
- gamma_init_alpha_tex_flat();
-}
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-gamma_fallback_quad( gammaContextPtr gmesa,
- const gammaVertex *v0,
- const gammaVertex *v1,
- const gammaVertex *v2,
- const gammaVertex *v3 )
-{
- GLcontext *ctx = gmesa->glCtx;
- SWvertex v[4];
- gamma_translate_vertex( ctx, v0, &v[0] );
- gamma_translate_vertex( ctx, v1, &v[1] );
- gamma_translate_vertex( ctx, v2, &v[2] );
- gamma_translate_vertex( ctx, v3, &v[3] );
- _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] );
-}
-
-static void
-gamma_fallback_tri( gammaContextPtr gmesa,
- const gammaVertex *v0,
- const gammaVertex *v1,
- const gammaVertex *v2 )
-{
- GLcontext *ctx = gmesa->glCtx;
- SWvertex v[3];
- gamma_translate_vertex( ctx, v0, &v[0] );
- gamma_translate_vertex( ctx, v1, &v[1] );
- gamma_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-static void
-gamma_fallback_line( gammaContextPtr gmesa,
- const gammaVertex *v0,
- const gammaVertex *v1 )
-{
- GLcontext *ctx = gmesa->glCtx;
- SWvertex v[2];
- gamma_translate_vertex( ctx, v0, &v[0] );
- gamma_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-#if 0
-static void
-gamma_fallback_point( gammaContextPtr gmesa,
- const gammaVertex *v0 )
-{
- GLcontext *ctx = gmesa->glCtx;
- SWvertex v[1];
- gamma_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-#endif
-
-
-/***********************************************************************
- * Choose rasterization functions *
- ***********************************************************************/
-
-#define _GAMMA_NEW_RASTER_STATE (_NEW_FOG | \
- _NEW_TEXTURE | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_POINT_SMOOTH | \
- _DD_NEW_TRI_STIPPLE | \
- _DD_NEW_LINE_STIPPLE)
-
-#define LINE_FALLBACK (0)
-#define TRI_FALLBACK (0)
-
-static void gammaChooseRasterState(GLcontext *ctx)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint ind = 0;
-
- if ( ctx->Line.SmoothFlag ||
- ctx->Polygon.SmoothFlag ||
- ctx->Point.SmoothFlag )
- gmesa->Begin |= B_AntiAliasEnable;
- else
- gmesa->Begin &= ~B_AntiAliasEnable;
-
- if ( ctx->Texture.Unit[0]._ReallyEnabled ) {
- ind |= GAMMA_RAST_TEX_BIT;
- gmesa->Begin |= B_TextureEnable;
- } else
- gmesa->Begin &= ~B_TextureEnable;
-
- if (flags & DD_LINE_STIPPLE)
- gmesa->Begin |= B_LineStippleEnable;
- else
- gmesa->Begin &= ~B_LineStippleEnable;
-
- if (flags & DD_TRI_STIPPLE)
- gmesa->Begin |= B_AreaStippleEnable;
- else
- gmesa->Begin &= ~B_AreaStippleEnable;
-
- if (ctx->Fog.Enabled)
- gmesa->Begin |= B_FogEnable;
- else
- gmesa->Begin &= ~B_FogEnable;
-
- if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled)
- ind |= GAMMA_RAST_ALPHA_BIT;
-
- if ( flags & DD_FLATSHADE )
- ind |= GAMMA_RAST_FLAT_BIT;
-
- gmesa->draw_line = gamma_line_tab[ind];
- gmesa->draw_tri = gamma_tri_tab[ind];
- gmesa->draw_quad = gamma_quad_tab[ind];
- gmesa->draw_point = gamma_point_tab[ind];
-
- /* Hook in fallbacks for specific primitives. CURRENTLY DISABLED
- */
- if (flags & LINE_FALLBACK)
- gmesa->draw_line = gamma_fallback_line;
-
- if (flags & TRI_FALLBACK) {
- gmesa->draw_tri = gamma_fallback_tri;
- gmesa->draw_quad = gamma_fallback_quad;
- }
-}
-
-
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- gmesa->draw_tri( gmesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- gmesa->draw_quad( gmesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- gmesa->draw_line( gmesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- gmesa->draw_point( gmesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define GAMMA_OFFSET_BIT 0x01
-#define GAMMA_TWOSIDE_BIT 0x02
-#define GAMMA_UNFILLED_BIT 0x04
-#define GAMMA_FALLBACK_BIT 0x08
-#define GAMMA_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[GAMMA_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & GAMMA_FALLBACK_BIT)
-#define DO_OFFSET 0 /* (IND & GAMMA_OFFSET_BIT) */
-#define DO_UNFILLED 0 /* (IND & GAMMA_UNFILLED_BIT) */
-#define DO_TWOSIDE (IND & GAMMA_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 0
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX gammaVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (gmesa->verts + (e * gmesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][0], (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][1], (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][2], (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][3], (c)[3]); \
-} while (0)
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4]
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx]
-
-#define LOCAL_VARS(n) \
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \
- GLuint color[n]; \
- (void) color;
-
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- B_PrimType_Points,
- B_PrimType_Lines,
- B_PrimType_Lines,
- B_PrimType_Lines,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles
-};
-
-static void gammaResetLineStipple( GLcontext *ctx );
-static void gammaRasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void gammaRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-#define RASTERIZE(x) if (gmesa->hw_primitive != hw_prim[x]) \
- gammaRasterPrimitive( ctx, hw_prim[x] )
-#define RENDER_PRIMITIVE gmesa->render_primitive
-#define TAG(x) x
-#define IND GAMMA_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_TWOSIDE_BIT|GAMMA_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_OFFSET_BIT|GAMMA_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_TWOSIDE_BIT|GAMMA_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (GAMMA_TWOSIDE_BIT|GAMMA_OFFSET_BIT|GAMMA_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-
-static void init_render_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
-}
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define VERT(x) (gammaVertex *)(gammaverts + (x * size * sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- gmesa->draw_point( gmesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- gmesa->draw_line( gmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- gmesa->draw_tri( gmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- gmesa->draw_quad( gmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) gammaRenderPrimitive( ctx, x );
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \
- const GLuint size = gmesa->vertex_size; \
- const char *gammaverts = (char *)gmesa->verts; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) stipple;
-#define RESET_STIPPLE if ( stipple ) gammaResetLineStipple( ctx );
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) gamma_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-static void gammaRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint prim = gmesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void gammaRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-
-#define _GAMMA_NEW_RENDERSTATE (_DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET)
-
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-static void gammaChooseRenderState(GLcontext *ctx)
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= GAMMA_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= GAMMA_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= GAMMA_UNFILLED_BIT;
- }
-
- if (gmesa->RenderIndex != index) {
- gmesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (gmesa->RenderIndex == 0)
- tnl->Driver.Render.PrimTabVerts = gamma_render_tab_verts;
- else
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = gammaRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = gammaRenderClippedPoly;
- }
-}
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in gammarender.c.
- */
-
-static void gammaRasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- if (gmesa->hw_primitive != hwprim)
- gmesa->hw_primitive = hwprim;
-}
-
-static void gammaRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- gmesa->render_primitive = prim;
-}
-
-static void gammaRunPipeline( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- if ( gmesa->new_state )
- gammaDDUpdateHWState( ctx );
-
- if (gmesa->new_gl_state) {
- if (gmesa->new_gl_state & _NEW_TEXTURE)
- gammaUpdateTextureState( ctx );
-
- if (!gmesa->Fallback) {
- if (gmesa->new_gl_state & _GAMMA_NEW_VERTEX)
- gammaChooseVertexState( ctx );
-
- if (gmesa->new_gl_state & _GAMMA_NEW_RASTER_STATE)
- gammaChooseRasterState( ctx );
-
- if (gmesa->new_gl_state & _GAMMA_NEW_RENDERSTATE)
- gammaChooseRenderState( ctx );
- }
-
- gmesa->new_gl_state = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-static void gammaRenderStart( GLcontext *ctx )
-{
- /* Check for projective texturing. Make sure all texcoord
- * pointers point to something. (fix in mesa?)
- */
- gammaCheckTexSizes( ctx );
-}
-
-static void gammaRenderFinish( GLcontext *ctx )
-{
- if (0)
- _swrast_flush( ctx ); /* never needed */
-}
-
-static void gammaResetLineStipple( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- /* Reset the hardware stipple counter.
- */
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, UpdateLineStippleCounters, 0);
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-
-void gammaFallback( gammaContextPtr gmesa, GLuint bit, GLboolean mode )
-{
- GLcontext *ctx = gmesa->glCtx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = gmesa->Fallback;
-
- if (mode) {
- gmesa->Fallback |= bit;
- if (oldfallback == 0) {
- _swsetup_Wakeup( ctx );
- _tnl_need_projected_coords( ctx, GL_TRUE );
- gmesa->RenderIndex = ~0;
- }
- }
- else {
- gmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = gammaRenderStart;
- tnl->Driver.Render.PrimitiveNotify = gammaRenderPrimitive;
- tnl->Driver.Render.Finish = gammaRenderFinish;
- tnl->Driver.Render.BuildVertices = gammaBuildVertices;
- tnl->Driver.Render.ResetLineStipple = gammaResetLineStipple;
- gmesa->new_gl_state |= (_GAMMA_NEW_RENDERSTATE|
- _GAMMA_NEW_RASTER_STATE|
- _GAMMA_NEW_VERTEX);
- }
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-
-void gammaDDInitTriFuncs( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- init_render_tab();
- firsttime = 0;
- }
-
- gmesa->RenderIndex = ~0;
-
- tnl->Driver.RunPipeline = gammaRunPipeline;
- tnl->Driver.Render.Start = gammaRenderStart;
- tnl->Driver.Render.Finish = gammaRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = gammaRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = gammaResetLineStipple;
- tnl->Driver.Render.BuildVertices = gammaBuildVertices;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.h
deleted file mode 100644
index 02bec2869..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tris.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- * Keith Whitwell, <keith@tungstengraphics.com>
- *
- * 3DLabs Gamma driver.
- */
-
-#ifndef _GAMMA_TRIS_H
-#define _GAMMA_TRIS_H
-
-extern void gammaDDTrifuncInit(void);
-extern void gammaDDChooseTriRenderState(GLcontext *);
-
-
-
-#endif /* !(_GAMMA_TRIS_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h
deleted file mode 100644
index 23459ff15..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h
+++ /dev/null
@@ -1,497 +0,0 @@
-/* $XFree86: xc/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h,v 1.2 2004/12/13 22:40:49 tsi Exp $ */
-
-static void TAG(gamma_point)( gammaContextPtr gmesa,
- const gammaVertex *v0 )
-{
- u_int32_t vColor;
- u_int32_t vBegin;
-
- vBegin = gmesa->Begin | B_PrimType_Points;
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Begin, vBegin);
-
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v0->v.color.alpha << 24) |
- (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v0->v.u0);
- WRITEF(gmesa->buf, Ts2, v0->v.v0);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FlushSpan, 0);
-#endif
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, End, 0);
-}
-
-static void TAG(gamma_line)( gammaContextPtr gmesa,
- const gammaVertex *v0,
- const gammaVertex *v1 )
-{
- u_int32_t vColor;
- u_int32_t vBegin;
-
- vBegin = gmesa->Begin | B_PrimType_Lines;
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Begin, vBegin);
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v0->v.color.alpha << 24) |
- (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#else
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v1->v.color.alpha << 24) |
- (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v0->v.u0);
- WRITEF(gmesa->buf, Ts2, v0->v.v0);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v1->v.color.alpha << 24) |
- (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v1->v.u0);
- WRITEF(gmesa->buf, Ts2, v1->v.v0);
- WRITEF(gmesa->buf, Vw, v1->v.w);
- WRITEF(gmesa->buf, Vz, v1->v.z);
- WRITEF(gmesa->buf, Vy, v1->v.y);
- WRITEF(gmesa->buf, Vx4, v1->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v1->v.w);
- WRITEF(gmesa->buf, Vz, v1->v.z);
- WRITEF(gmesa->buf, Vy, v1->v.y);
- WRITEF(gmesa->buf, Vx4, v1->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FlushSpan, 0);
-#endif
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, End, 0);
-}
-
-static void TAG(gamma_triangle)( gammaContextPtr gmesa,
- const gammaVertex *v0,
- const gammaVertex *v1,
- const gammaVertex *v2 )
-{
- u_int32_t vColor;
- u_int32_t vBegin;
-
- vBegin = gmesa->Begin | B_PrimType_Triangles;
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Begin, vBegin);
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v0->v.color.alpha << 24) |
- (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#else
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v2->v.color.alpha << 24) |
- (v2->v.color.blue << 16) |
- (v2->v.color.green << 8) |
- (v2->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v2->v.color.blue << 16) |
- (v2->v.color.green << 8) |
- (v2->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v0->v.u0);
- WRITEF(gmesa->buf, Ts2, v0->v.v0);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v1->v.color.alpha << 24) |
- (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v1->v.u0);
- WRITEF(gmesa->buf, Ts2, v1->v.v0);
- WRITEF(gmesa->buf, Vw, v1->v.w);
- WRITEF(gmesa->buf, Vz, v1->v.z);
- WRITEF(gmesa->buf, Vy, v1->v.y);
- WRITEF(gmesa->buf, Vx4, v1->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v1->v.w);
- WRITEF(gmesa->buf, Vz, v1->v.z);
- WRITEF(gmesa->buf, Vy, v1->v.y);
- WRITEF(gmesa->buf, Vx4, v1->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v2->v.color.alpha << 24) |
- (v2->v.color.blue << 16) |
- (v2->v.color.green << 8) |
- (v2->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v2->v.color.blue << 16) |
- (v2->v.color.green << 8) |
- (v2->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v2->v.u0);
- WRITEF(gmesa->buf, Ts2, v2->v.v0);
- WRITEF(gmesa->buf, Vw, v2->v.w);
- WRITEF(gmesa->buf, Vz, v2->v.z);
- WRITEF(gmesa->buf, Vy, v2->v.y);
- WRITEF(gmesa->buf, Vx4, v2->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v2->v.w);
- WRITEF(gmesa->buf, Vz, v2->v.z);
- WRITEF(gmesa->buf, Vy, v2->v.y);
- WRITEF(gmesa->buf, Vx4, v2->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FlushSpan, 0);
-#endif
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, End, 0);
-}
-
-static void TAG(gamma_quad)( gammaContextPtr gmesa,
- const gammaVertex *v0,
- const gammaVertex *v1,
- const gammaVertex *v2,
- const gammaVertex *v3 )
-{
- u_int32_t vColor;
- u_int32_t vBegin;
-
- vBegin = gmesa->Begin | B_PrimType_Quads;
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, Begin, vBegin);
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v0->v.color.alpha << 24) |
- (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v0->v.color.blue << 16) |
- (v0->v.color.green << 8) |
- (v0->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#else
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v3->v.color.alpha << 24) |
- (v3->v.color.blue << 16) |
- (v3->v.color.green << 8) |
- (v3->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v3->v.color.blue << 16) |
- (v3->v.color.green << 8) |
- (v3->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v0->v.u0);
- WRITEF(gmesa->buf, Ts2, v0->v.v0);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v0->v.w);
- WRITEF(gmesa->buf, Vz, v0->v.z);
- WRITEF(gmesa->buf, Vy, v0->v.y);
- WRITEF(gmesa->buf, Vx4, v0->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v1->v.color.alpha << 24) |
- (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v1->v.color.blue << 16) |
- (v1->v.color.green << 8) |
- (v1->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v1->v.u0);
- WRITEF(gmesa->buf, Ts2, v1->v.v0);
- WRITEF(gmesa->buf, Vw, v1->v.w);
- WRITEF(gmesa->buf, Vz, v1->v.z);
- WRITEF(gmesa->buf, Vy, v1->v.y);
- WRITEF(gmesa->buf, Vx4, v1->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v1->v.w);
- WRITEF(gmesa->buf, Vz, v1->v.z);
- WRITEF(gmesa->buf, Vy, v1->v.y);
- WRITEF(gmesa->buf, Vx4, v1->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v2->v.color.alpha << 24) |
- (v2->v.color.blue << 16) |
- (v2->v.color.green << 8) |
- (v2->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v2->v.color.blue << 16) |
- (v2->v.color.green << 8) |
- (v2->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v2->v.u0);
- WRITEF(gmesa->buf, Ts2, v2->v.v0);
- WRITEF(gmesa->buf, Vw, v2->v.w);
- WRITEF(gmesa->buf, Vz, v2->v.z);
- WRITEF(gmesa->buf, Vy, v2->v.y);
- WRITEF(gmesa->buf, Vx4, v2->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v2->v.w);
- WRITEF(gmesa->buf, Vz, v2->v.z);
- WRITEF(gmesa->buf, Vy, v2->v.y);
- WRITEF(gmesa->buf, Vx4, v2->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
-#if (IND & GAMMA_RAST_ALPHA_BIT)
- vColor = (v3->v.color.alpha << 24) |
- (v3->v.color.blue << 16) |
- (v3->v.color.green << 8) |
- (v3->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor4, vColor);
-#else
- vColor = (v3->v.color.blue << 16) |
- (v3->v.color.green << 8) |
- (v3->v.color.red << 0);
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, PackedColor3, vColor);
-#endif
-#endif
-
-#if (IND & GAMMA_RAST_TEX_BIT)
- CHECK_DMA_BUFFER(gmesa, 6);
- WRITEF(gmesa->buf, Tt2, v3->v.u0);
- WRITEF(gmesa->buf, Ts2, v3->v.v0);
- WRITEF(gmesa->buf, Vw, v3->v.w);
- WRITEF(gmesa->buf, Vz, v3->v.z);
- WRITEF(gmesa->buf, Vy, v3->v.y);
- WRITEF(gmesa->buf, Vx4, v3->v.x);
-#else
- CHECK_DMA_BUFFER(gmesa, 4);
- WRITEF(gmesa->buf, Vw, v3->v.w);
- WRITEF(gmesa->buf, Vz, v3->v.z);
- WRITEF(gmesa->buf, Vy, v3->v.y);
- WRITEF(gmesa->buf, Vx4, v3->v.x);
-#endif
-
-#if !(IND & GAMMA_RAST_FLAT_BIT)
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, FlushSpan, 0);
-#endif
-
- CHECK_DMA_BUFFER(gmesa, 1);
- WRITE(gmesa->buf, End, 0);
-}
-
-static void TAG(gamma_init)(void)
-{
- gamma_point_tab[IND] = TAG(gamma_point);
- gamma_line_tab[IND] = TAG(gamma_line);
- gamma_tri_tab[IND] = TAG(gamma_triangle);
- gamma_quad_tab[IND] = TAG(gamma_quad);
-}
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.c
deleted file mode 100644
index 80d35cba9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c,v 1.4 2003/03/26 20:43:48 tsi Exp $ */
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- * Keith Whitwell, <keith@tungstengraphics.com>
- *
- * 3DLabs Gamma driver.
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/tnl.h"
-
-#include "gamma_context.h"
-#include "gamma_vb.h"
-#include "gamma_tris.h"
-
-
-#define GAMMA_TEX0_BIT 0x1
-#define GAMMA_RGBA_BIT 0x2
-#define GAMMA_XYZW_BIT 0x4
-#define GAMMA_PTEX_BIT 0x8
-#define GAMMA_FOG_BIT 0x10
-#define GAMMA_SPEC_BIT 0x20
-#define GAMMA_MAX_SETUP 0x40
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_size;
- GLuint vertex_format;
-} setup_tab[GAMMA_MAX_SETUP];
-
-#define TINY_VERTEX_FORMAT 1
-#define NOTEX_VERTEX_FORMAT 2
-#define TEX0_VERTEX_FORMAT 3
-#define TEX1_VERTEX_FORMAT 0
-#define PROJ_TEX1_VERTEX_FORMAT 0
-#define TEX2_VERTEX_FORMAT 0
-#define TEX3_VERTEX_FORMAT 0
-#define PROJ_TEX3_VERTEX_FORMAT 0
-
-#define DO_XYZW (IND & GAMMA_XYZW_BIT)
-#define DO_RGBA (IND & GAMMA_RGBA_BIT)
-#define DO_SPEC (IND & GAMMA_SPEC_BIT)
-#define DO_FOG (IND & GAMMA_FOG_BIT)
-#define DO_TEX0 (IND & GAMMA_TEX0_BIT)
-#define DO_TEX1 0
-#define DO_TEX2 0
-#define DO_TEX3 0
-#define DO_PTEX (IND & GAMMA_PTEX_BIT)
-
-#define VERTEX gammaVertex
-#define VERTEX_COLOR gamma_color_t
-#define GET_VIEWPORT_MAT() 0
-#define GET_TEXSOURCE(n) n
-#define GET_VERTEX_FORMAT() GAMMA_CONTEXT(ctx)->vertex_format
-#define GET_VERTEX_STORE() GAMMA_CONTEXT(ctx)->verts
-#define GET_VERTEX_SIZE() GAMMA_CONTEXT(ctx)->vertex_size * sizeof(GLuint)
-#define INVALIDATE_STORED_VERTICES()
-
-#define HAVE_HW_VIEWPORT 1
-#define HAVE_HW_DIVIDE 1
-#define HAVE_RGBA_COLOR 0 /* we're BGRA */
-#define HAVE_TINY_VERTICES 1
-#define HAVE_NOTEX_VERTICES 1
-#define HAVE_TEX0_VERTICES 1
-#define HAVE_TEX1_VERTICES 0
-#define HAVE_TEX2_VERTICES 0
-#define HAVE_TEX3_VERTICES 0
-#define HAVE_PTEX_VERTICES 1
-
-#define PTEX_FALLBACK() /* never needed */
-
-#define INTERP_VERTEX setup_tab[GAMMA_CONTEXT(ctx)->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[GAMMA_CONTEXT(ctx)->SetupIndex].copy_pv
-
-
-
-/***********************************************************************
- * Generate pv-copying and translation functions *
- ***********************************************************************/
-
-#define TAG(x) gamma_##x
-#include "tnl_dd/t_dd_vb.c"
-
-/***********************************************************************
- * Generate vertex emit and interp functions *
- ***********************************************************************/
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT)
-#define TAG(x) x##_wgs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_TEX0_BIT|GAMMA_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_wgst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT|\
- GAMMA_PTEX_BIT)
-#define TAG(x) x##_wgspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT)
-#define TAG(x) x##_wgfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT|\
- GAMMA_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|\
- GAMMA_TEX0_BIT)
-#define TAG(x) x##_wgfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|\
- GAMMA_TEX0_BIT|GAMMA_PTEX_BIT)
-#define TAG(x) x##_wgfspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_FOG_BIT)
-#define TAG(x) x##_f
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_FOG_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_ft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT)
-#define TAG(x) x##_g
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_SPEC_BIT)
-#define TAG(x) x##_gs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_gst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT)
-#define TAG(x) x##_gf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT)
-#define TAG(x) x##_gfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT)
-#define TAG(x) x##_gfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wgs();
- init_wgt0();
- init_wgpt0();
- init_wgst0();
- init_wgspt0();
- init_wgf();
- init_wgfs();
- init_wgft0();
- init_wgfpt0();
- init_wgfst0();
- init_wgfspt0();
- init_t0();
- init_f();
- init_ft0();
- init_g();
- init_gs();
- init_gt0();
- init_gst0();
- init_gf();
- init_gfs();
- init_gft0();
- init_gfst0();
-}
-
-void gammaCheckTexSizes( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
-
- if (!setup_tab[gmesa->SetupIndex].check_tex_sizes(ctx)) {
- /* Invalidate stored verts
- */
- gmesa->SetupNewInputs = ~0;
- gmesa->SetupIndex |= GAMMA_PTEX_BIT;
-
- if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[gmesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[gmesa->SetupIndex].copy_pv;
- }
- }
-}
-
-void gammaBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
- GLuint stride = gmesa->vertex_size * sizeof(int);
- GLubyte *v = ((GLubyte *)gmesa->verts + (start * stride));
-
- newinputs |= gmesa->SetupNewInputs;
- gmesa->SetupNewInputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[gmesa->SetupIndex].emit( ctx, start, count, v, stride );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= GAMMA_RGBA_BIT;
-
- if (newinputs & VERT_BIT_COLOR1)
- ind |= GAMMA_SPEC_BIT;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= GAMMA_TEX0_BIT;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= GAMMA_FOG_BIT;
-
- if (gmesa->SetupIndex & GAMMA_PTEX_BIT)
- ind = ~0;
-
- ind &= gmesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
- }
- }
-}
-
-void gammaChooseVertexState( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint ind = GAMMA_XYZW_BIT|GAMMA_RGBA_BIT;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- ind |= GAMMA_SPEC_BIT;
-
- if (ctx->Fog.Enabled)
- ind |= GAMMA_FOG_BIT;
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- _tnl_need_projected_coords( ctx, GL_FALSE );
- ind |= GAMMA_TEX0_BIT;
- } else
- _tnl_need_projected_coords( ctx, GL_FALSE );
-
- gmesa->SetupIndex = ind;
-
- if (setup_tab[ind].vertex_format != gmesa->vertex_format) {
- gmesa->vertex_format = setup_tab[ind].vertex_format;
- gmesa->vertex_size = setup_tab[ind].vertex_size;
- }
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = gamma_interp_extras;
- tnl->Driver.Render.CopyPV = gamma_copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-}
-
-
-void gammaInitVB( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- gmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- gmesa->vertex_size = 16; /* FIXME - only one vertex setup */
- }
- }
-}
-
-
-void gammaFreeVB( GLcontext *ctx )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
- if (gmesa->verts) {
- ALIGN_FREE(gmesa->verts);
- gmesa->verts = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.h
deleted file mode 100644
index feda25c4c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_vb.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- * Keith Whitwell, <keith@tungstengraphics.com>
- *
- * 3DLabs Gamma driver.
- */
-
-#ifndef GAMMAVB_INC
-#define GAMMAVB_INC
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-
-#define _GAMMA_NEW_VERTEX (_NEW_TEXTURE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE)
-
-
-extern void gammaChooseVertexState( GLcontext *ctx );
-extern void gammaCheckTexSizes( GLcontext *ctx );
-extern void gammaBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs );
-
-
-extern void gamma_import_float_colors( GLcontext *ctx );
-extern void gamma_import_float_spec_colors( GLcontext *ctx );
-
-extern void gamma_translate_vertex( GLcontext *ctx,
- const gammaVertex *src,
- SWvertex *dst );
-
-extern void gammaInitVB( GLcontext *ctx );
-extern void gammaFreeVB( GLcontext *ctx );
-
-extern void gamma_print_vertex( GLcontext *ctx, const gammaVertex *v );
-extern void gammaPrintSetupFlags(char *msg, GLuint flags );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_xmesa.c
deleted file mode 100644
index 00f6aa32a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_xmesa.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c,v 1.14 2002/10/30 12:51:30 alanh Exp $ */
-/*
- * Copyright 2001 by Alan Hourihane.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@tungstengraphics.com>
- *
- * 3DLabs Gamma driver
- */
-
-#include "gamma_context.h"
-#include "gamma_vb.h"
-#include "context.h"
-#include "matrix.h"
-#include "glint_dri.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-static GLboolean
-gammaInitDriver(__DRIscreenPrivate *sPriv)
-{
- sPriv->private = (void *) gammaCreateScreen( sPriv );
-
- if (!sPriv->private) {
- gammaDestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static void
-gammaDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- gammaContextPtr gmesa = (gammaContextPtr)driContextPriv->driverPrivate;
-
- if (gmesa) {
- _swsetup_DestroyContext( gmesa->glCtx );
- _tnl_DestroyContext( gmesa->glCtx );
- _ac_DestroyContext( gmesa->glCtx );
- _swrast_DestroyContext( gmesa->glCtx );
-
- gammaFreeVB( gmesa->glCtx );
-
- /* free the Mesa context */
- gmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(gmesa->glCtx);
-
- FREE(gmesa);
- driContextPriv->driverPrivate = NULL;
- }
-}
-
-
-static GLboolean
-gammaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0
- );
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-gammaDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-static void
-gammaSwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- gammaContextPtr gmesa;
- __DRIscreenPrivate *driScrnPriv;
- GLcontext *ctx;
-
- gmesa = (gammaContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = gmesa->glCtx;
- driScrnPriv = gmesa->driScreen;
-
- _mesa_notifySwapBuffers(ctx);
-
- VALIDATE_DRAWABLE_INFO(gmesa);
-
- /* Flush any partially filled buffers */
- FLUSH_DMA_BUFFER(gmesa);
-
- DRM_SPINLOCK(&driScrnPriv->pSAREA->drawable_lock,
- driScrnPriv->drawLockID);
- VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa);
-
- if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER) {
- int src, dst, x0, y0, x1, h;
- int i;
- int nRect = dPriv->numClipRects;
- drm_clip_rect_t *pRect = dPriv->pClipRects;
- __DRIscreenPrivate *driScrnPriv = gmesa->driScreen;
- GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)driScrnPriv->pDevPriv;
-
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, FBReadMode, (gmesa->FBReadMode |
- FBReadSrcEnable));
- WRITE(gmesa->buf, LBWriteMode, LBWriteModeDisable);
-
- for (i = 0; i < nRect; i++, pRect++) {
- x0 = pRect->x1;
- x1 = pRect->x2;
- h = pRect->y2 - pRect->y1;
-
- y0 = driScrnPriv->fbHeight - (pRect->y1+h);
- if (gDRIPriv->numMultiDevices == 2)
- src = (y0/2)*driScrnPriv->fbWidth+x0;
- else
- src = y0*driScrnPriv->fbWidth+x0;
-
- y0 += driScrnPriv->fbHeight;
- if (gDRIPriv->numMultiDevices == 2)
- dst = (y0/2)*driScrnPriv->fbWidth+x0;
- else
- dst = y0*driScrnPriv->fbWidth+x0;
-
- CHECK_DMA_BUFFER(gmesa, 9);
- WRITE(gmesa->buf, StartXDom, x0<<16); /* X0dest */
- WRITE(gmesa->buf, StartY, y0<<16); /* Y0dest */
- WRITE(gmesa->buf, StartXSub, x1<<16); /* X1dest */
- WRITE(gmesa->buf, GLINTCount, h); /* H */
- WRITE(gmesa->buf, dY, 1<<16); /* ydir */
- WRITE(gmesa->buf, dXDom, 0<<16);
- WRITE(gmesa->buf, dXSub, 0<<16);
- WRITE(gmesa->buf, FBSourceOffset, (dst-src));
- WRITE(gmesa->buf, Render, 0x00040048); /* NOT_DONE */
- }
-
- /*
- ** NOTE: FBSourceOffset (above) is backwards from what is
- ** described in the manual (i.e., dst-src instead of src-dst)
- ** due to our using the bottom-left window origin instead of the
- ** top-left window origin.
- */
-
- /* Restore FBReadMode */
- CHECK_DMA_BUFFER(gmesa, 2);
- WRITE(gmesa->buf, FBReadMode, (gmesa->FBReadMode |
- gmesa->AB_FBReadMode));
- WRITE(gmesa->buf, LBWriteMode, LBWriteModeEnable);
- }
-
- if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER)
- PROCESS_DMA_BUFFER_TOP_HALF(gmesa);
-
- DRM_SPINUNLOCK(&driScrnPriv->pSAREA->drawable_lock,
- driScrnPriv->drawLockID);
- VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa);
-
- if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER)
- PROCESS_DMA_BUFFER_BOTTOM_HALF(gmesa);
- } else {
- _mesa_problem(NULL, "gammaSwapBuffers: drawable has no context!\n");
- }
-}
-
-static GLboolean
-gammaMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- GET_CURRENT_CONTEXT(ctx);
- gammaContextPtr oldGammaCtx = ctx ? GAMMA_CONTEXT(ctx) : NULL;
- gammaContextPtr newGammaCtx = (gammaContextPtr) driContextPriv->driverPrivate;
-
- if ( newGammaCtx != oldGammaCtx ) {
- newGammaCtx->dirty = ~0;
- }
-
- if (newGammaCtx->driDrawable != driDrawPriv) {
- newGammaCtx->driDrawable = driDrawPriv;
- gammaUpdateWindow ( newGammaCtx->glCtx );
- gammaUpdateViewportOffset( newGammaCtx->glCtx );
- }
-
-#if 0
- newGammaCtx->Window &= ~W_GIDMask;
- newGammaCtx->Window |= (driDrawPriv->index << 5);
- CHECK_DMA_BUFFER(newGammaCtx,1);
- WRITE(newGammaCtx->buf, GLINTWindow, newGammaCtx->Window);
-#endif
-
-newGammaCtx->new_state |= GAMMA_NEW_WINDOW; /* FIXME */
-
- _mesa_make_current2( newGammaCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
- } else {
- _mesa_make_current( 0, 0 );
- }
- return GL_TRUE;
-}
-
-
-static GLboolean
-gammaUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
-
-static struct __DriverAPIRec gammaAPI = {
- gammaInitDriver,
- gammaDestroyScreen,
- gammaCreateContext,
- gammaDestroyContext,
- gammaCreateBuffer,
- gammaDestroyBuffer,
- gammaSwapBuffers,
- gammaMakeCurrent,
- gammaUnbindContext
-};
-
-
-
-/*
- * This is the bootstrap function for the driver.
- * The __driCreateScreen name is the symbol that libGL.so fetches.
- * Return: pointer to a __DRIscreenPrivate.
- */
-void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config)
-{
- __DRIscreenPrivate *psp;
- psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &gammaAPI);
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_common.h
deleted file mode 100644
index ec601f942..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_common.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* glint_common.h -- common header definitions for Gamma 2D/3D/DRM suite
- *
- * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * 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.
- *
- * Converted to common header format:
- * Jens Owen <jens@tungstengraphics.com>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_common.h,v 1.2 2003/04/03 16:52:18 dawes Exp $
- *
- */
-
-#ifndef _GLINT_COMMON_H_
-#define _GLINT_COMMON_H_
-
-/*
- * WARNING: If you change any of these defines, make sure to change
- * the kernel include file as well (gamma_drm.h)
- */
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_GAMMA_INIT 0x00
-#define DRM_GAMMA_COPY 0x01
-
-typedef struct {
- enum {
- GAMMA_INIT_DMA = 0x01,
- GAMMA_CLEANUP_DMA = 0x02
- } func;
- int sarea_priv_offset;
- int pcimode;
- unsigned int mmio0;
- unsigned int mmio1;
- unsigned int mmio2;
- unsigned int mmio3;
- unsigned int buffers_offset;
- int num_rast;
-} drmGAMMAInit;
-
-extern int drmGAMMAInitDMA( int fd, drmGAMMAInit *info );
-extern int drmGAMMACleanupDMA( int fd );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_dri.h
deleted file mode 100644
index 3952759f8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/gamma/server/glint_dri.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h,v 1.7 2002/10/30 12:52:16 alanh Exp $ */
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Author:
- * Jens Owen <jens@tungstengraphics.com>
- *
- */
-
-#ifndef _GLINT_DRI_H_
-#define _GLINT_DRI_H_
-
-#include "xf86drm.h"
-#include "glint_common.h"
-
-typedef struct {
- unsigned int GDeltaMode;
- unsigned int GDepthMode;
- unsigned int GGeometryMode;
- unsigned int GTransformMode;
-} GAMMAContextRegionRec, *GAMMAContextRegionPtr;
-
-typedef struct {
- unsigned char next, prev; /* indices to form a circular LRU */
- unsigned char in_use; /* owned by a client, or free? */
- int age; /* tracked by clients to update local LRU's */
-} GAMMATextureRegionRec, *GAMMATextureRegionPtr;
-
-typedef struct {
- GAMMAContextRegionRec context_state;
-
- unsigned int dirty;
-
- /* Maintain an LRU of contiguous regions of texture space. If
- * you think you own a region of texture memory, and it has an
- * age different to the one you set, then you are mistaken and
- * it has been stolen by another client. If global texAge
- * hasn't changed, there is no need to walk the list.
- *
- * These regions can be used as a proxy for the fine-grained
- * texture information of other clients - by maintaining them
- * in the same lru which is used to age their own textures,
- * clients have an approximate lru for the whole of global
- * texture space, and can make informed decisions as to which
- * areas to kick out. There is no need to choose whether to
- * kick out your own texture or someone else's - simply eject
- * them all in LRU order.
- */
-
-#define GAMMA_NR_TEX_REGIONS 64
- GAMMATextureRegionRec texList[GAMMA_NR_TEX_REGIONS+1];
- /* Last elt is sentinal */
- int texAge; /* last time texture was uploaded */
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int last_quiescent; /* */
- int ctxOwner; /* last context to upload state */
-
- int vertex_prim;
-} GLINTSAREADRIRec, *GLINTSAREADRIPtr;
-
-/*
- * Glint specific record passed back to client driver
- * via DRIGetDeviceInfo request
- */
-typedef struct {
- drmRegion registers0;
- drmRegion registers1;
- drmRegion registers2;
- drmRegion registers3;
- int numMultiDevices;
- int pprod;
- int cpp;
- int frontOffset;
- int frontPitch;
- int backOffset;
- int backPitch;
- int backX;
- int backY;
- int depthOffset;
- int depthPitch;
- int textureSize;
- int logTextureGranularity;
-} GLINTDRIRec, *GLINTDRIPtr;
-
-#define GLINT_DRI_BUF_COUNT 256
-#define GLINT_DRI_BUF_SIZE 4096
-
-#define GAMMA_NR_TEX_REGIONS 64
-
-#define DMA_WRITE(val,reg) \
-do { \
- pGlint->buf2D++ = Glint##reg##Tag; \
- pGlint->buf2D++ = val; \
-} while (0)
-
-#endif /* _GLINT_DRI_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/Makefile
deleted file mode 100644
index a7825b49b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# src/mesa/drivers/dri/i810/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i810_dri.so
-
-# Not yet
-# MINIGLX_SOURCES = server/i810_dri.c
-
-DRIVER_SOURCES = \
- i810context.c \
- i810ioctl.c \
- i810render.c \
- i810screen.c \
- i810span.c \
- i810state.c \
- i810tex.c \
- i810texmem.c \
- i810texstate.c \
- i810tris.c \
- i810vb.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810_3d_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810_3d_reg.h
deleted file mode 100644
index dade1a826..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810_3d_reg.h
+++ /dev/null
@@ -1,636 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h,v 1.7 2002/02/22 21:33:03 dawes Exp $ */
-
-#ifndef I810_3D_REG_H
-#define I810_3D_REG_H
-
-#include "i810_reg.h"
-
-/* Registers not used in the X server
- */
-
-#define I810_NOP_ID 0x2094
-#define I810_NOP_ID_MASK ((1<<22)-1)
-
-
-/* 3D instructions
- */
-
-
-/* GFXRENDERSTATE_PV_PIXELIZATION_RULE, p149
- *
- * Format:
- * 0: GFX_OP_PV_RULE | PV_*
- *
- */
-#define GFX_OP_PV_RULE ((0x3<<29)|(0x7<<24))
-#define PV_SMALL_TRI_FILTER_ENABLE (0x1<<11)
-#define PV_UPDATE_PIXRULE (0x1<<10)
-#define PV_PIXRULE_ENABLE (0x1<<9)
-#define PV_UPDATE_LINELIST (0x1<<8)
-#define PV_LINELIST_MASK (0x3<<6)
-#define PV_LINELIST_PV0 (0x0<<6)
-#define PV_LINELIST_PV1 (0x1<<6)
-#define PV_UPDATE_TRIFAN (0x1<<5)
-#define PV_TRIFAN_MASK (0x3<<3)
-#define PV_TRIFAN_PV0 (0x0<<3)
-#define PV_TRIFAN_PV1 (0x1<<3)
-#define PV_TRIFAN_PV2 (0x2<<3)
-#define PV_UPDATE_TRISTRIP (0x1<<2)
-#define PV_TRISTRIP_MASK (0x3<<0)
-#define PV_TRISTRIP_PV0 (0x0<<0)
-#define PV_TRISTRIP_PV1 (0x1<<0)
-#define PV_TRISTRIP_PV2 (0x2<<0)
-
-
-/* GFXRENDERSTATE_SCISSOR_ENABLE, p146
- *
- * Format:
- * 0: GFX_OP_SCISSOR | SC_*
- */
-#define GFX_OP_SCISSOR ((0x3<<29)|(0x1c<<24)|(0x10<<19))
-#define SC_UPDATE_SCISSOR (0x1<<1)
-#define SC_ENABLE_MASK (0x1<<0)
-#define SC_ENABLE (0x1<<0)
-
-/* GFXRENDERSTATE_SCISSOR_INFO, p147
- *
- * Format:
- * 0: GFX_OP_SCISSOR_INFO
- * 1: SCI_MIN_*
- * 2: SCI_MAX_*
- */
-#define GFX_OP_SCISSOR_INFO ((0x3<<29)|(0x1d<<24)|(0x81<<16)|(0x1))
-#define SCI_YMIN_MASK (0xffff<<16)
-#define SCI_XMIN_MASK (0xffff<<0)
-#define SCI_YMAX_MASK (0xffff<<16)
-#define SCI_XMAX_MASK (0xffff<<0)
-
-/* GFXRENDERSTATE_DRAWING_RECT_INFO, p144
- *
- * Format:
- * 0: GFX_OP_DRAWRECT_INFO
- * 1: DR1_*
- * 2: DR2_*
- * 3: DR3_*
- * 4: DR4_*
- */
-#define GFX_OP_DRAWRECT_INFO ((0x3<<29)|(0x1d<<24)|(0x80<<16)|(0x3))
-#define DR1_RECT_CLIP_ENABLE (0x0<<31)
-#define DR1_RECT_CLIP_DISABLE (0x1<<31)
-#define DR1_X_DITHER_BIAS_MASK (0x3<<26)
-#define DR1_X_DITHER_BIAS_SHIFT 26
-#define DR1_Y_DITHER_BIAS_MASK (0x3<<24)
-#define DR1_Y_DITHER_BIAS_SHIFT 24
-#define DR2_YMIN_MASK (0xffff<<16)
-#define DR2_XMIN_MASK (0xffff<<0)
-#define DR3_YMAX_MASK (0xffff<<16)
-#define DR3_XMAX_MASK (0xffff<<0)
-#define DR4_YORG_MASK (0x3ff<<16)
-#define DR4_XORG_MASK (0x7ff<<0)
-
-
-/* GFXRENDERSTATE_LINEWIDTH_CULL_SHADE_MODE, p140
- *
- * Format:
- * 0: GFX_OP_LINEWIDTH_CULL_SHADE_MODE | LCS_*
- */
-#define GFX_OP_LINEWIDTH_CULL_SHADE_MODE ((0x3<<29)|(0x2<<24))
-#define LCS_UPDATE_ZMODE (0x1<<20)
-#define LCS_Z_MASK (0xf<<16)
-#define LCS_Z_NEVER (0x1<<16)
-#define LCS_Z_LESS (0x2<<16)
-#define LCS_Z_EQUAL (0x3<<16)
-#define LCS_Z_LEQUAL (0x4<<16)
-#define LCS_Z_GREATER (0x5<<16)
-#define LCS_Z_NOTEQUAL (0x6<<16)
-#define LCS_Z_GEQUAL (0x7<<16)
-#define LCS_Z_ALWAYS (0x8<<16)
-#define LCS_UPDATE_LINEWIDTH (0x1<<15)
-#define LCS_LINEWIDTH_MASK (0x7<<12)
-#define LCS_LINEWIDTH_SHIFT 12
-#define LCS_LINEWIDTH_0_5 (0x1<<12)
-#define LCS_LINEWIDTH_1_0 (0x2<<12)
-#define LCS_LINEWIDTH_2_0 (0x4<<12)
-#define LCS_LINEWIDTH_3_0 (0x6<<12)
-#define LCS_UPDATE_ALPHA_INTERP (0x1<<11)
-#define LCS_ALPHA_FLAT (0x1<<10)
-#define LCS_ALPHA_INTERP (0x0<<10)
-#define LCS_UPDATE_FOG_INTERP (0x1<<9)
-#define LCS_FOG_INTERP (0x0<<8)
-#define LCS_FOG_FLAT (0x1<<8)
-#define LCS_UPDATE_SPEC_INTERP (0x1<<7)
-#define LCS_SPEC_INTERP (0x0<<6)
-#define LCS_SPEC_FLAT (0x1<<6)
-#define LCS_UPDATE_RGB_INTERP (0x1<<5)
-#define LCS_RGB_INTERP (0x0<<4)
-#define LCS_RGB_FLAT (0x1<<4)
-#define LCS_UPDATE_CULL_MODE (0x1<<3)
-#define LCS_CULL_MASK (0x7<<0)
-#define LCS_CULL_DISABLE (0x1<<0)
-#define LCS_CULL_CW (0x2<<0)
-#define LCS_CULL_CCW (0x3<<0)
-#define LCS_CULL_BOTH (0x4<<0)
-
-#define LCS_INTERP_FLAT (LCS_ALPHA_FLAT|LCS_RGB_FLAT|LCS_SPEC_FLAT)
-#define LCS_UPDATE_INTERP (LCS_UPDATE_ALPHA_INTERP| \
- LCS_UPDATE_RGB_INTERP| \
- LCS_UPDATE_SPEC_INTERP)
-
-
-/* GFXRENDERSTATE_BOOLEAN_ENA_1, p142
- *
- */
-#define GFX_OP_BOOL_1 ((0x3<<29)|(0x3<<24))
-#define B1_UPDATE_SPEC_SETUP_ENABLE (1<<19)
-#define B1_SPEC_SETUP_ENABLE (1<<18)
-#define B1_UPDATE_ALPHA_SETUP_ENABLE (1<<17)
-#define B1_ALPHA_SETUP_ENABLE (1<<16)
-#define B1_UPDATE_CI_KEY_ENABLE (1<<15)
-#define B1_CI_KEY_ENABLE (1<<14)
-#define B1_UPDATE_CHROMAKEY_ENABLE (1<<13)
-#define B1_CHROMAKEY_ENABLE (1<<12)
-#define B1_UPDATE_Z_BIAS_ENABLE (1<<11)
-#define B1_Z_BIAS_ENABLE (1<<10)
-#define B1_UPDATE_SPEC_ENABLE (1<<9)
-#define B1_SPEC_ENABLE (1<<8)
-#define B1_UPDATE_FOG_ENABLE (1<<7)
-#define B1_FOG_ENABLE (1<<6)
-#define B1_UPDATE_ALPHA_TEST_ENABLE (1<<5)
-#define B1_ALPHA_TEST_ENABLE (1<<4)
-#define B1_UPDATE_BLEND_ENABLE (1<<3)
-#define B1_BLEND_ENABLE (1<<2)
-#define B1_UPDATE_Z_TEST_ENABLE (1<<1)
-#define B1_Z_TEST_ENABLE (1<<0)
-
-/* GFXRENDERSTATE_BOOLEAN_ENA_2, p143
- *
- */
-#define GFX_OP_BOOL_2 ((0x3<<29)|(0x4<<24))
-#define B2_UPDATE_MAP_CACHE_ENABLE (1<<17)
-#define B2_MAP_CACHE_ENABLE (1<<16)
-#define B2_UPDATE_ALPHA_DITHER_ENABLE (1<<15)
-#define B2_ALPHA_DITHER_ENABLE (1<<14)
-#define B2_UPDATE_FOG_DITHER_ENABLE (1<<13)
-#define B2_FOG_DITHER_ENABLE (1<<12)
-#define B2_UPDATE_SPEC_DITHER_ENABLE (1<<11)
-#define B2_SPEC_DITHER_ENABLE (1<<10)
-#define B2_UPDATE_RGB_DITHER_ENABLE (1<<9)
-#define B2_RGB_DITHER_ENABLE (1<<8)
-#define B2_UPDATE_FB_WRITE_ENABLE (1<<3)
-#define B2_FB_WRITE_ENABLE (1<<2)
-#define B2_UPDATE_ZB_WRITE_ENABLE (1<<1)
-#define B2_ZB_WRITE_ENABLE (1<<0)
-
-
-/* GFXRENDERSTATE_FOG_COLOR, p144
- */
-#define GFX_OP_FOG_COLOR ((0x3<<29)|(0x15<<24))
-#define FOG_RED_SHIFT 16
-#define FOG_GREEN_SHIFT 8
-#define FOG_BLUE_SHIFT 0
-#define FOG_RESERVED_MASK ((0x7<<16)|(0x3<<8)|(0x3))
-
-
-/* GFXRENDERSTATE_Z_BIAS_ALPHA_FUNC_REF, p139
- */
-#define GFX_OP_ZBIAS_ALPHAFUNC ((0x3<<29)|(0x14<<24))
-#define ZA_UPDATE_ZBIAS (1<<22)
-#define ZA_ZBIAS_SHIFT 14
-#define ZA_ZBIAS_MASK (0xff<<14)
-#define ZA_UPDATE_ALPHAFUNC (1<<13)
-#define ZA_ALPHA_MASK (0xf<<9)
-#define ZA_ALPHA_NEVER (1<<9)
-#define ZA_ALPHA_LESS (2<<9)
-#define ZA_ALPHA_EQUAL (3<<9)
-#define ZA_ALPHA_LEQUAL (4<<9)
-#define ZA_ALPHA_GREATER (5<<9)
-#define ZA_ALPHA_NOTEQUAL (6<<9)
-#define ZA_ALPHA_GEQUAL (7<<9)
-#define ZA_ALPHA_ALWAYS (8<<9)
-#define ZA_UPDATE_ALPHAREF (1<<8)
-#define ZA_ALPHAREF_MASK (0xff<<0)
-#define ZA_ALPHAREF_SHIFT 0
-#define ZA_ALPHAREF_RESERVED (0x7<<0)
-
-
-/* GFXRENDERSTATE_SRC_DST_BLEND_MONO, p136
- */
-#define GFX_OP_SRC_DEST_MONO ((0x3<<29)|(0x8<<24))
-#define SDM_UPDATE_MONO_ENABLE (1<<13)
-#define SDM_MONO_ENABLE (1<<12)
-#define SDM_UPDATE_SRC_BLEND (1<<11)
-#define SDM_SRC_MASK (0xf<<6)
-#define SDM_SRC_ZERO (0x1<<6)
-#define SDM_SRC_ONE (0x2<<6)
-#define SDM_SRC_SRC_COLOR (0x3<<6)
-#define SDM_SRC_INV_SRC_COLOR (0x4<<6)
-#define SDM_SRC_SRC_ALPHA (0x5<<6)
-#define SDM_SRC_INV_SRC_ALPHA (0x6<<6)
-#define SDM_SRC_DST_COLOR (0x9<<6)
-#define SDM_SRC_INV_DST_COLOR (0xa<<6)
-#define SDM_SRC_BOTH_SRC_ALPHA (0xc<<6)
-#define SDM_SRC_BOTH_INV_SRC_ALPHA (0xd<<6)
-#define SDM_UPDATE_DST_BLEND (1<<5)
-#define SDM_DST_MASK (0xf<<0)
-#define SDM_DST_ZERO (0x1<<0)
-#define SDM_DST_ONE (0x2<<0)
-#define SDM_DST_SRC_COLOR (0x3<<0)
-#define SDM_DST_INV_SRC_COLOR (0x4<<0)
-#define SDM_DST_SRC_ALPHA (0x5<<0)
-#define SDM_DST_INV_SRC_ALPHA (0x6<<0)
-#define SDM_DST_DST_COLOR (0x9<<0)
-#define SDM_DST_INV_DST_COLOR (0xa<<0)
-#define SDM_DST_BOTH_SRC_ALPHA (0xc<<0)
-#define SDM_DST_BOTH_INV_SRC_ALPHA (0xd<<0)
-
-
-/* GFXRENDERSTATE_COLOR_FACTOR, p134
- *
- * Format:
- * 0: GFX_OP_COLOR_FACTOR
- * 1: ARGB8888 color factor
- */
-#define GFX_OP_COLOR_FACTOR ((0x3<<29)|(0x1d<<24)|(0x1<<16)|0x0)
-
-/* GFXRENDERSTATE_MAP_ALPHA_BLEND_STAGES, p132
- */
-#define GFX_OP_MAP_ALPHA_STAGES ((0x3<<29)|(0x1<<24))
-#define MA_STAGE_SHIFT 20
-#define MA_STAGE_0 (0<<20)
-#define MA_STAGE_1 (1<<20)
-#define MA_STAGE_2 (2<<20)
-#define MA_UPDATE_ARG1 (1<<18)
-#define MA_ARG1_MASK ((0x7<<15)|(0x1<<13))
-#define MA_ARG1_ALPHA_FACTOR (0x1<<15)
-#define MA_ARG1_ITERATED_ALPHA (0x3<<15)
-#define MA_ARG1_CURRENT_ALPHA (0x5<<15)
-#define MA_ARG1_TEX0_ALPHA (0x6<<15)
-#define MA_ARG1_TEX1_ALPHA (0x7<<15)
-#define MA_ARG1_INVERT (0x1<<13)
-#define MA_ARG1_DONT_INVERT (0x0<<13)
-#define MA_UPDATE_ARG2 (1<<12)
-#define MA_ARG2_MASK ((0x7<<8)|(0x1<<6))
-#define MA_ARG2_ALPHA_FACTOR (0x1<<8)
-#define MA_ARG2_ITERATED_ALPHA (0x3<<8)
-#define MA_ARG2_CURRENT_ALPHA (0x5<<8)
-#define MA_ARG2_TEX0_ALPHA (0x6<<8)
-#define MA_ARG2_TEX1_ALPHA (0x7<<8)
-#define MA_ARG2_INVERT (0x1<<6)
-#define MA_ARG2_DONT_INVERT (0x0<<6)
-#define MA_UPDATE_OP (1<<5)
-#define MA_OP_MASK (0xf)
-#define MA_OP_ARG1 (0x1)
-#define MA_OP_ARG2 (0x2)
-#define MA_OP_MODULATE (0x3)
-#define MA_OP_MODULATE_X2 (0x4)
-#define MA_OP_MODULATE_X4 (0x5)
-#define MA_OP_ADD (0x6)
-#define MA_OP_ADD_SIGNED (0x7)
-#define MA_OP_LIN_BLEND_ITER_ALPHA (0x8)
-#define MA_OP_LIN_BLEND_ALPHA_FACTOR (0xa)
-#define MA_OP_LIN_BLEND_TEX0_ALPHA (0x10)
-#define MA_OP_LIN_BLEND_TEX1_ALPHA (0x11)
-
-
-/* GFXRENDERSTATE_MAP_COLOR_BLEND_STAGES, p129
- */
-#define GFX_OP_MAP_COLOR_STAGES ((0x3<<29)|(0x0<<24))
-#define MC_STAGE_SHIFT 20
-#define MC_STAGE_0 (0<<20)
-#define MC_STAGE_1 (1<<20)
-#define MC_STAGE_2 (2<<20)
-#define MC_UPDATE_DEST (1<<19)
-#define MC_DEST_MASK (1<<18)
-#define MC_DEST_CURRENT (0<<18)
-#define MC_DEST_ACCUMULATOR (1<<18)
-#define MC_UPDATE_ARG1 (1<<17)
-#define MC_ARG1_MASK ((0x7<<14)|(0x1<<13)|(0x1<<12))
-#define MC_ARG1_ONE (0x0<<14)
-#define MC_ARG1_COLOR_FACTOR (0x1<<14)
-#define MC_ARG1_ACCUMULATOR (0x2<<14)
-#define MC_ARG1_ITERATED_COLOR (0x3<<14)
-#define MC_ARG1_SPECULAR_COLOR (0x4<<14)
-#define MC_ARG1_CURRENT_COLOR (0x5<<14)
-#define MC_ARG1_TEX0_COLOR (0x6<<14)
-#define MC_ARG1_TEX1_COLOR (0x7<<14)
-#define MC_ARG1_DONT_REPLICATE_ALPHA (0x0<<13)
-#define MC_ARG1_REPLICATE_ALPHA (0x1<<13)
-#define MC_ARG1_DONT_INVERT (0x0<<12)
-#define MC_ARG1_INVERT (0x1<<12)
-#define MC_UPDATE_ARG2 (1<<11)
-#define MC_ARG2_MASK ((0x7<<8)|(0x1<<7)|(0x1<<6))
-#define MC_ARG2_ONE (0x0<<8)
-#define MC_ARG2_COLOR_FACTOR (0x1<<8)
-#define MC_ARG2_ACCUMULATOR (0x2<<8)
-#define MC_ARG2_ITERATED_COLOR (0x3<<8)
-#define MC_ARG2_SPECULAR_COLOR (0x4<<8)
-#define MC_ARG2_CURRENT_COLOR (0x5<<8)
-#define MC_ARG2_TEX0_COLOR (0x6<<8)
-#define MC_ARG2_TEX1_COLOR (0x7<<8)
-#define MC_ARG2_DONT_REPLICATE_ALPHA (0x0<<7)
-#define MC_ARG2_REPLICATE_ALPHA (0x1<<7)
-#define MC_ARG2_DONT_INVERT (0x0<<6)
-#define MC_ARG2_INVERT (0x1<<6)
-#define MC_UPDATE_OP (1<<5)
-#define MC_OP_MASK (0xf)
-#define MC_OP_DISABLE (0x0)
-#define MC_OP_ARG1 (0x1)
-#define MC_OP_ARG2 (0x2)
-#define MC_OP_MODULATE (0x3)
-#define MC_OP_MODULATE_X2 (0x4)
-#define MC_OP_MODULATE_X4 (0x5)
-#define MC_OP_ADD (0x6)
-#define MC_OP_ADD_SIGNED (0x7)
-#define MC_OP_LIN_BLEND_ITER_ALPHA (0x8)
-#define MC_OP_LIN_BLEND_ALPHA_FACTOR (0xa)
-#define MC_OP_LIN_BLEND_TEX0_ALPHA (0x10)
-#define MC_OP_LIN_BLEND_TEX1_ALPHA (0x11)
-#define MC_OP_LIN_BLEND_TEX0_COLOR (0x12)
-#define MC_OP_LIN_BLEND_TEX1_COLOR (0x13)
-#define MC_OP_SUBTRACT (0x14)
-
-/* GFXRENDERSTATE_MAP_PALETTE_LOAD, p128
- *
- * Format:
- * 0: GFX_OP_MAP_PALETTE_LOAD
- * 1: 16bpp color[0]
- * ...
- * 256: 16bpp color[255]
- */
-#define GFX_OP_MAP_PALETTE_LOAD ((0x3<<29)|(0x1d<<24)|(0x82<<16)|0xff)
-
-/* GFXRENDERSTATE_MAP_LOD_CONTROL, p127
- */
-#define GFX_OP_MAP_LOD_CTL ((0x3<<29)|(0x1c<<24)|(0x4<<19))
-#define MLC_MAP_ID_SHIFT 16
-#define MLC_MAP_0 (0<<16)
-#define MLC_MAP_1 (1<<16)
-#define MLC_UPDATE_DITHER_WEIGHT (1<<10)
-#define MLC_DITHER_WEIGHT_MASK (0x3<<8)
-#define MLC_DITHER_WEIGHT_FULL (0x0<<8)
-#define MLC_DITHER_WEIGHT_50 (0x1<<8)
-#define MLC_DITHER_WEIGHT_25 (0x2<<8)
-#define MLC_DITHER_WEIGHT_12 (0x3<<8)
-#define MLC_UPDATE_LOD_BIAS (1<<7)
-#define MLC_LOD_BIAS_MASK ((1<<7)-1)
-
-/* GFXRENDERSTATE_MAP_LOD_LIMITS, p126
- */
-#define GFX_OP_MAP_LOD_LIMITS ((0x3<<29)|(0x1c<<24)|(0x3<<19))
-#define MLL_MAP_ID_SHIFT 16
-#define MLL_MAP_0 (0<<16)
-#define MLL_MAP_1 (1<<16)
-#define MLL_UPDATE_MAX_MIP (1<<13)
-#define MLL_MAX_MIP_SHIFT 5
-#define MLL_MAX_MIP_MASK (0xff<<5)
-#define MLL_MAX_MIP_ONE (0x10<<5)
-#define MLL_UPDATE_MIN_MIP (1<<4)
-#define MLL_MIN_MIP_SHIFT 0
-#define MLL_MIN_MIP_MASK (0xf<<0)
-
-/* GFXRENDERSTATE_MAP_FILTER, p124
- */
-#define GFX_OP_MAP_FILTER ((0x3<<29)|(0x1c<<24)|(0x2<<19))
-#define MF_MAP_ID_SHIFT 16
-#define MF_MAP_0 (0<<16)
-#define MF_MAP_1 (1<<16)
-#define MF_UPDATE_ANISOTROPIC (1<<12)
-#define MF_ANISOTROPIC_MASK (1<<10)
-#define MF_ANISOTROPIC_ENABLE (1<<10)
-#define MF_UPDATE_MIP_FILTER (1<<9)
-#define MF_MIP_MASK (0x3<<6)
-#define MF_MIP_NONE (0x0<<6)
-#define MF_MIP_NEAREST (0x1<<6)
-#define MF_MIP_DITHER (0x2<<6)
-#define MF_MIP_LINEAR (0x3<<6)
-#define MF_UPDATE_MAG_FILTER (1<<5)
-#define MF_MAG_MASK (1<<3)
-#define MF_MAG_LINEAR (1<<3)
-#define MF_MAG_NEAREST (0<<3)
-#define MF_UPDATE_MIN_FILTER (1<<2)
-#define MF_MIN_MASK (1<<0)
-#define MF_MIN_LINEAR (1<<0)
-#define MF_MIN_NEAREST (0<<0)
-
-/* GFXRENDERSTATE_MAP_INFO, p118
- */
-#define GFX_OP_MAP_INFO ((0x3<<29)|(0x1d<<24)|0x2)
-#define MI1_MAP_ID_SHIFT 28
-#define MI1_MAP_0 (0<<28)
-#define MI1_MAP_1 (1<<28)
-#define MI1_FMT_MASK (0x7<<24)
-#define MI1_FMT_8CI (0x0<<24)
-#define MI1_FMT_8BPP (0x1<<24)
-#define MI1_FMT_16BPP (0x2<<24)
-#define MI1_FMT_422 (0x5<<24)
-#define MI1_PF_MASK (0x3<<21)
-#define MI1_PF_8CI_RGB565 (0x0<<21)
-#define MI1_PF_8CI_ARGB1555 (0x1<<21)
-#define MI1_PF_8CI_ARGB4444 (0x2<<21)
-#define MI1_PF_8CI_AY88 (0x3<<21)
-#define MI1_PF_16BPP_RGB565 (0x0<<21)
-#define MI1_PF_16BPP_ARGB1555 (0x1<<21)
-#define MI1_PF_16BPP_ARGB4444 (0x2<<21)
-#define MI1_PF_16BPP_AY88 (0x3<<21)
-#define MI1_PF_422_YCRCB_SWAP_Y (0x0<<21)
-#define MI1_PF_422_YCRCB (0x1<<21)
-#define MI1_PF_422_YCRCB_SWAP_UV (0x2<<21)
-#define MI1_PF_422_YCRCB_SWAP_YUV (0x3<<21)
-#define MI1_OUTPUT_CHANNEL_MASK (0x3<<19)
-#define MI1_COLOR_CONV_ENABLE (1<<18)
-#define MI1_VERT_STRIDE_MASK (1<<17)
-#define MI1_VERT_STRIDE_1 (1<<17)
-#define MI1_VERT_OFFSET_MASK (1<<16)
-#define MI1_VERT_OFFSET_1 (1<<16)
-#define MI1_ENABLE_FENCE_REGS (1<<10)
-#define MI1_TILED_SURFACE (1<<9)
-#define MI1_TILE_WALK_X (0<<8)
-#define MI1_TILE_WALK_Y (1<<8)
-#define MI1_PITCH_MASK (0xf<<0)
-#define MI2_DIMENSIONS_ARE_LOG2 (1<<31)
-#define MI2_DIMENSIONS_ARE_EXACT (0<<31)
-#define MI2_HEIGHT_SHIFT 16
-#define MI2_HEIGHT_MASK (0x1ff<<16)
-#define MI2_WIDTH_SHIFT 0
-#define MI2_WIDTH_MASK (0x1ff<<0)
-#define MI3_BASE_ADDR_MASK (~0xf)
-
-/* GFXRENDERSTATE_MAP_COORD_SETS, p116
- */
-#define GFX_OP_MAP_COORD_SETS ((0x3<<29)|(0x1c<<24)|(0x1<<19))
-#define MCS_COORD_ID_SHIFT 16
-#define MCS_COORD_0 (0<<16)
-#define MCS_COORD_1 (1<<16)
-#define MCS_UPDATE_NORMALIZED (1<<15)
-#define MCS_NORMALIZED_COORDS_MASK (1<<14)
-#define MCS_NORMALIZED_COORDS (1<<14)
-#define MCS_UPDATE_V_STATE (1<<7)
-#define MCS_V_STATE_MASK (0x3<<4)
-#define MCS_V_WRAP (0x0<<4)
-#define MCS_V_MIRROR (0x1<<4)
-#define MCS_V_CLAMP (0x2<<4)
-#define MCS_V_WRAP_SHORTEST (0x3<<4)
-#define MCS_UPDATE_U_STATE (1<<3)
-#define MCS_U_STATE_MASK (0x3<<0)
-#define MCS_U_WRAP (0x0<<0)
-#define MCS_U_MIRROR (0x1<<0)
-#define MCS_U_CLAMP (0x2<<0)
-#define MCS_U_WRAP_SHORTEST (0x3<<0)
-
-/* GFXRENDERSTATE_MAP_TEXELS, p115
- */
-#define GFX_OP_MAP_TEXELS ((0x3<<29)|(0x1c<<24)|(0x0<<19))
-#define MT_UPDATE_TEXEL1_STATE (1<<15)
-#define MT_TEXEL1_DISABLE (0<<14)
-#define MT_TEXEL1_ENABLE (1<<14)
-#define MT_TEXEL1_COORD0 (0<<11)
-#define MT_TEXEL1_COORD1 (1<<11)
-#define MT_TEXEL1_MAP0 (0<<8)
-#define MT_TEXEL1_MAP1 (1<<8)
-#define MT_UPDATE_TEXEL0_STATE (1<<7)
-#define MT_TEXEL0_DISABLE (0<<6)
-#define MT_TEXEL0_ENABLE (1<<6)
-#define MT_TEXEL0_COORD0 (0<<3)
-#define MT_TEXEL0_COORD1 (1<<3)
-#define MT_TEXEL0_MAP0 (0<<0)
-#define MT_TEXEL0_MAP1 (1<<0)
-
-/* GFXRENDERSTATE_VERTEX_FORMAT, p110
- */
-#define GFX_OP_VERTEX_FMT ((0x3<<29)|(0x5<<24))
-#define VF_TEXCOORD_COUNT_SHIFT 8
-#define VF_TEXCOORD_COUNT_0 (0<<8)
-#define VF_TEXCOORD_COUNT_1 (1<<8)
-#define VF_TEXCOORD_COUNT_2 (2<<8)
-#define VF_SPEC_FOG_ENABLE (1<<7)
-#define VF_RGBA_ENABLE (1<<6)
-#define VF_Z_OFFSET_ENABLE (1<<5)
-#define VF_XYZ (0x1<<1)
-#define VF_XYZW (0x2<<1)
-#define VF_XY (0x3<<1)
-#define VF_XYW (0x4<<1)
-
-
-#define VERT_X_MASK (~0xf)
-#define VERT_X_EDGE_V2V0 (1<<2)
-#define VERT_X_EDGE_V1V2 (1<<1)
-#define VERT_X_EDGE_V0V1 (1<<0)
-
-/* Not enabled fields should not be sent to hardware:
- */
-typedef struct {
- union {
- float x;
- unsigned int edge_flags;
- } x;
- float y;
- float z;
- float z_bias;
- float oow;
- unsigned int argb;
- unsigned int fog_spec_rgb; /* spec g and r ignored. */
- float tu0;
- float tv0;
- float tu1;
- float tv1;
-} i810_full_vertex;
-
-
-
-/* GFXCMDPARSER_BATCH_BUFFER, p105
- *
- * Not clear whether start address must be shifted or not. Not clear
- * whether address is physical system memory, or subject to GTT
- * translation. Because the address appears to be 32 bits long,
- * perhaps it refers to physical system memory...
- */
-#define CMD_OP_BATCH_BUFFER ((0x0<<29)|(0x30<<23)|0x1)
-#define BB1_START_ADDR_MASK (~0x7)
-#define BB1_PROTECTED (1<<0)
-#define BB1_UNPROTECTED (0<<0)
-#define BB2_END_ADDR_MASK (~0x7)
-
-/* Hardware seems to barf on buffers larger than this (in strange ways)...
- */
-#define MAX_BATCH (512*1024)
-
-
-/* GFXCMDPARSER_Z_BUFFER_INFO, p98
- *
- * Base address is in GTT space, and must be 4K aligned
- */
-#define CMD_OP_Z_BUFFER_INFO ((0x0<<29)|(0x16<<23))
-#define ZB_BASE_ADDR_SHIFT 0
-#define ZB_BASE_ADDR_MASK (~((1<<12)-1))
-#define ZB_PITCH_512B (0x0<<0)
-#define ZB_PITCH_1K (0x1<<0)
-#define ZB_PITCH_2K (0x2<<0)
-#define ZB_PITCH_4K (0x3<<0)
-
-/* GFXCMDPARSER_FRONT_BUFFER_INFO, p97
- *
- * Format:
- * 0: CMD_OP_FRONT_BUFFER_INFO | (pitch<<FB0_PITCH_SHIFT) | FB0_*
- * 1: FB1_*
- */
-#define CMD_OP_FRONT_BUFFER_INFO ((0x0<<29)|(0x14<<23))
-#define FB0_PITCH_SHIFT 8
-#define FB0_FLIP_SYNC (0<<6)
-#define FB0_FLIP_ASYNC (1<<6)
-#define FB0_BASE_ADDR_SHIFT 0
-#define FB0_BASE_ADDR_MASK 0x03FFFFF8
-
-/* GFXCMDPARSER_DEST_BUFFER_INFO, p96
- *
- * Format:
- */
-#define CMD_OP_DESTBUFFER_INFO ((0x0<<29)|(0x15<<23))
-#define DB1_BASE_ADDR_SHIFT 0
-#define DB1_BASE_ADDR_MASK 0x03FFF000
-#define DB1_PITCH_512B (0x0<<0)
-#define DB1_PITCH_1K (0x1<<0)
-#define DB1_PITCH_2K (0x2<<0)
-#define DB1_PITCH_4K (0x4<<0)
-
-
-/* GFXRENDERSTATE_DEST_BUFFER_VARIABLES, p152
- *
- * Format:
- * 0: GFX_OP_DESTBUFFER_VARS
- * 1: DEST_*
- */
-#define GFX_OP_DESTBUFFER_VARS ((0x3<<29)|(0x1d<<24)|(0x85<<16)|0x0)
-#define DV_HORG_BIAS_MASK (0xf<<20)
-#define DV_HORG_BIAS_OGL (0x0<<20)
-#define DV_VORG_BIAS_MASK (0xf<<16)
-#define DV_VORG_BIAS_OGL (0x0<<16)
-#define DV_PF_MASK (0x7<<8)
-#define DV_PF_INDEX (0x0<<8)
-#define DV_PF_555 (0x1<<8)
-#define DV_PF_565 (0x2<<8)
-
-#define GFX_OP_ANTIALIAS ((0x3<<29)|(0x6<<24))
-#define AA_UPDATE_EDGEFLAG (1<<13)
-#define AA_ENABLE_EDGEFLAG (1<<12)
-#define AA_UPDATE_POLYWIDTH (1<<11)
-#define AA_POLYWIDTH_05 (1<<9)
-#define AA_POLYWIDTH_10 (2<<9)
-#define AA_POLYWIDTH_20 (3<<9)
-#define AA_POLYWIDTH_40 (4<<9)
-#define AA_UPDATE_LINEWIDTH (1<<8)
-#define AA_LINEWIDTH_05 (1<<6)
-#define AA_LINEWIDTH_10 (2<<6)
-#define AA_LINEWIDTH_20 (3<<6)
-#define AA_LINEWIDTH_40 (4<<6)
-#define AA_UPDATE_BB_EXPANSION (1<<5)
-#define AA_BB_EXPANSION_SHIFT 2
-#define AA_UPDATE_AA_ENABLE (1<<1)
-#define AA_ENABLE (1<<0)
-
-#define GFX_OP_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16))
-#define ST1_ENABLE (1<<16)
-#define ST1_MASK (0xffff)
-
-#define I810_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.c
deleted file mode 100644
index 47c41c5db..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.c,v 1.3 2002/10/30 12:51:33 alanh Exp $ */
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "imports.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810state.h"
-#include "i810tex.h"
-#include "i810span.h"
-#include "i810tris.h"
-#include "i810vb.h"
-#include "i810ioctl.h"
-
-#include "utils.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#include "extension_helper.h"
-
-#ifndef I810_DEBUG
-int I810_DEBUG = (0);
-#endif
-
-PUBLIC const char __driConfigOptions[] = { 0 };
-const GLuint __driNConfigOptions = 0;
-
-#define DRIVER_DATE "20050818"
-
-static const GLubyte *i810GetString( GLcontext *ctx, GLenum name )
-{
- static char buffer[128];
-
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *)"Keith Whitwell";
- case GL_RENDERER: {
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- const char * chipset;
-
- switch (imesa->i810Screen->deviceID) {
- case PCI_CHIP_I810: chipset = "i810"; break;
- case PCI_CHIP_I810_DC100: chipset = "i810 DC-100"; break;
- case PCI_CHIP_I810_E: chipset = "i810E"; break;
- case PCI_CHIP_I815: chipset = "i815"; break;
- default: chipset = "Unknown i810-class Chipset"; break;
- }
-
- (void) driGetRendererString( buffer, chipset, DRIVER_DATE, 0 );
- return (GLubyte *) buffer;
- }
- default:
- return 0;
- }
-}
-
-static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- i810ContextPtr imesa = I810_CONTEXT(ctx);
-
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE(imesa);
- *width = imesa->driDrawable->w;
- *height = imesa->driDrawable->h;
- UNLOCK_HARDWARE(imesa);
-}
-
-/* Extension strings exported by the i810 driver.
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-extern const struct tnl_pipeline_stage _i810_render_stage;
-
-static const struct tnl_pipeline_stage *i810_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
-#if 1
- &_i810_render_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "tex", DEBUG_TEXTURE },
- { "ioctl", DEBUG_IOCTL },
- { "prim", DEBUG_PRIMS },
- { "vert", DEBUG_VERTS },
- { "state", DEBUG_STATE },
- { "verb", DEBUG_VERBOSE },
- { "dri", DEBUG_DRI },
- { "dma", DEBUG_DMA },
- { "san", DEBUG_SANITY },
- { "sync", DEBUG_SYNC },
- { "sleep", DEBUG_SLEEP },
- { NULL, 0 }
-};
-
-GLboolean
-i810CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- GLcontext *ctx, *shareCtx;
- i810ContextPtr imesa;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- i810ScreenPrivate *i810Screen = (i810ScreenPrivate *)sPriv->private;
- I810SAREAPtr saPriv = (I810SAREAPtr)
- (((GLubyte *)sPriv->pSAREA) + i810Screen->sarea_priv_offset);
- struct dd_function_table functions;
-
- /* Allocate i810 context */
- imesa = (i810ContextPtr) CALLOC_STRUCT(i810_context_t);
- if (!imesa) {
- return GL_FALSE;
- }
-
- driContextPriv->driverPrivate = imesa;
-
- imesa->i810Screen = i810Screen;
- imesa->driScreen = sPriv;
- imesa->sarea = saPriv;
- imesa->glBuffer = NULL;
-
- /* Init default driver functions then plug in our I810-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions( &functions );
- i810InitIoctlFuncs( &functions );
- i810InitTextureFuncs( &functions );
-
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((i810ContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- imesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
- &functions, (void*) imesa);
- if (!imesa->glCtx) {
- FREE(imesa);
- return GL_FALSE;
- }
-
- (void) memset( imesa->texture_heaps, 0, sizeof( imesa->texture_heaps ) );
- make_empty_list( & imesa->swapped );
-
- imesa->nr_heaps = 1;
- imesa->texture_heaps[0] = driCreateTextureHeap( 0, imesa,
- i810Screen->textureSize,
- 12,
- I810_NR_TEX_REGIONS,
- imesa->sarea->texList,
- (unsigned *) & imesa->sarea->texAge, /* XXX we shouldn't cast! */
- & imesa->swapped,
- sizeof( struct i810_texture_object_t ),
- (destroy_texture_object_t *) i810DestroyTexObj );
-
-
-
- /* Set the maximum texture size small enough that we can guarentee
- * that both texture units can bind a maximal texture and have them
- * in memory at once.
- */
-
-
-
- ctx = imesa->glCtx;
- ctx->Const.MaxTextureUnits = 2;
- ctx->Const.MaxTextureImageUnits = 2;
- ctx->Const.MaxTextureCoordUnits = 2;
-
-
- /* FIXME: driCalcualteMaxTextureLevels assumes that mipmaps are tightly
- * FIXME: packed, but they're not in Intel graphics hardware.
- */
- driCalculateMaxTextureLevels( imesa->texture_heaps,
- imesa->nr_heaps,
- & ctx->Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 0, /* 3D textures unsupported */
- 0, /* cube textures unsupported. */
- 0, /* texture rectangles unsupported. */
- 12,
- GL_FALSE );
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 3.0;
- ctx->Const.MaxLineWidthAA = 3.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 3.0;
- ctx->Const.MaxPointSizeAA = 3.0;
- ctx->Const.PointSizeGranularity = 1.0;
-
- ctx->Driver.GetBufferSize = i810BufferSize;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
- ctx->Driver.GetString = i810GetString;
-
- /* Who owns who?
- */
- ctx->DriverCtx = (void *) imesa;
- imesa->glCtx = ctx;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, i810_pipeline );
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
- /* Dri stuff
- */
- imesa->hHWContext = driContextPriv->hHWContext;
- imesa->driFd = sPriv->fd;
- imesa->driHwLock = &sPriv->pSAREA->lock;
-
- imesa->stipple_in_hw = 1;
- imesa->RenderIndex = ~0;
- imesa->dirty = I810_UPLOAD_CTX|I810_UPLOAD_BUFFERS;
- imesa->upload_cliprects = GL_TRUE;
-
- imesa->CurrentTexObj[0] = 0;
- imesa->CurrentTexObj[1] = 0;
-
- _math_matrix_ctr( &imesa->ViewportMatrix );
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
- /* XXX these should really go right after _mesa_init_driver_functions() */
- i810InitStateFuncs( ctx );
- i810InitTriFuncs( ctx );
- i810InitSpanFuncs( ctx );
- i810InitVB( ctx );
- i810InitState( ctx );
-
-#if DO_DEBUG
- I810_DEBUG = driParseDebugString( getenv( "I810_DEBUG" ),
- debug_control );
- I810_DEBUG |= driParseDebugString( getenv( "INTEL_DEBUG" ),
- debug_control );
-#endif
-
- return GL_TRUE;
-}
-
-void
-i810DestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- i810ContextPtr imesa = (i810ContextPtr) driContextPriv->driverPrivate;
-
- assert(imesa); /* should never be null */
- if (imesa) {
- GLboolean release_texture_heaps;
-
-
- release_texture_heaps = (imesa->glCtx->Shared->RefCount == 1);
- _swsetup_DestroyContext( imesa->glCtx );
- _tnl_DestroyContext( imesa->glCtx );
- _ac_DestroyContext( imesa->glCtx );
- _swrast_DestroyContext( imesa->glCtx );
-
- i810FreeVB( imesa->glCtx );
-
- /* free the Mesa context */
- imesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(imesa->glCtx);
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- unsigned int i;
-
- for ( i = 0 ; i < imesa->nr_heaps ; i++ ) {
- driDestroyTextureHeap( imesa->texture_heaps[ i ] );
- imesa->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & imesa->swapped ) );
- }
-
- FREE(imesa);
- }
-}
-
-
-void i810XMesaSetFrontClipRects( i810ContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
-
- i810EmitDrawingRectangle( imesa );
- imesa->upload_cliprects = GL_TRUE;
-}
-
-
-void i810XMesaSetBackClipRects( i810ContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- if (imesa->sarea->pf_enabled == 0 && dPriv->numBackClipRects == 0)
- {
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
- } else {
- imesa->numClipRects = dPriv->numBackClipRects;
- imesa->pClipRects = dPriv->pBackClipRects;
- imesa->drawX = dPriv->backX;
- imesa->drawY = dPriv->backY;
- }
-
- i810EmitDrawingRectangle( imesa );
- imesa->upload_cliprects = GL_TRUE;
-}
-
-
-static void i810XMesaWindowMoved( i810ContextPtr imesa )
-{
- /* Determine current color drawing buffer */
- switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- i810XMesaSetFrontClipRects( imesa );
- break;
- case BUFFER_BIT_BACK_LEFT:
- i810XMesaSetBackClipRects( imesa );
- break;
- default:
- /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
- i810XMesaSetFrontClipRects( imesa );
- }
-}
-
-
-GLboolean
-i810UnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- i810ContextPtr imesa = (i810ContextPtr) driContextPriv->driverPrivate;
- if (imesa) {
- imesa->dirty = I810_UPLOAD_CTX|I810_UPLOAD_BUFFERS;
- if (imesa->CurrentTexObj[0]) imesa->dirty |= I810_UPLOAD_TEX0;
- if (imesa->CurrentTexObj[1]) imesa->dirty |= I810_UPLOAD_TEX1;
- }
-
- return GL_TRUE;
-}
-
-
-GLboolean
-i810MakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- i810ContextPtr imesa = (i810ContextPtr) driContextPriv->driverPrivate;
-
- /* Shouldn't the readbuffer be stored also?
- */
- imesa->driDrawable = driDrawPriv;
-
- _mesa_make_current(imesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
-
- /* Are these necessary?
- */
- i810XMesaWindowMoved( imesa );
- }
- else {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-static void
-i810UpdatePageFlipping( i810ContextPtr imesa )
-{
- GLcontext *ctx = imesa->glCtx;
- int front = 0;
-
- /* Determine current color drawing buffer */
- switch (ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- front = 1;
- break;
- case BUFFER_BIT_BACK_LEFT:
- front = 0;
- break;
- default:
- return;
- }
-
- if ( imesa->sarea->pf_current_page == 1 )
- front ^= 1;
-
- if (front) {
- imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->fbOffset | imesa->i810Screen->backPitchBits;
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
- } else {
- imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->backOffset | imesa->i810Screen->backPitchBits;
- imesa->drawMap = imesa->i810Screen->back.map;
- imesa->readMap = imesa->i810Screen->back.map;
- }
-
- imesa->dirty |= I810_UPLOAD_BUFFERS;
-}
-
-void i810GetLock( i810ContextPtr imesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- __DRIscreenPrivate *sPriv = imesa->driScreen;
- I810SAREAPtr sarea = imesa->sarea;
- int me = imesa->hHWContext;
- unsigned i;
-
- drmGetLock(imesa->driFd, imesa->hHWContext, flags);
-
- /* If the window moved, may need to set a new cliprect now.
- *
- * NOTE: This releases and regains the hw lock, so all state
- * checking must be done *after* this call:
- */
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
-
- /* If we lost context, need to dump all registers to hardware.
- * Note that we don't care about 2d contexts, even if they perform
- * accelerated commands, so the DRI locking in the X server is even
- * more broken than usual.
- */
- if (sarea->ctxOwner != me) {
- imesa->upload_cliprects = GL_TRUE;
- imesa->dirty = I810_UPLOAD_CTX|I810_UPLOAD_BUFFERS;
- if (imesa->CurrentTexObj[0]) imesa->dirty |= I810_UPLOAD_TEX0;
- if (imesa->CurrentTexObj[1]) imesa->dirty |= I810_UPLOAD_TEX1;
- sarea->ctxOwner = me;
- }
-
- /* Shared texture managment - if another client has played with
- * texture space, figure out which if any of our textures have been
- * ejected, and update our global LRU.
- */
- for ( i = 0 ; i < imesa->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( imesa->texture_heaps[ i ] );
- }
-
- if (imesa->lastStamp != dPriv->lastStamp) {
- i810UpdatePageFlipping( imesa );
- i810XMesaWindowMoved( imesa );
- imesa->lastStamp = dPriv->lastStamp;
- }
-}
-
-
-void
-i810SwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- i810ContextPtr imesa;
- GLcontext *ctx;
- imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = imesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- if ( imesa->sarea->pf_active ) {
- i810PageFlip( dPriv );
- } else {
- i810CopyBuffer( dPriv );
- }
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "i810SwapBuffers: drawable has no context!\n");
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.h
deleted file mode 100644
index a2202e148..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810context.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.h,v 1.9 2002/12/16 16:18:51 dawes Exp $ */
-
-#ifndef I810CONTEXT_INC
-#define I810CONTEXT_INC
-
-typedef struct i810_context_t i810Context;
-typedef struct i810_context_t *i810ContextPtr;
-typedef struct i810_texture_object_t *i810TextureObjectPtr;
-
-#include "drm.h"
-#include "mtypes.h"
-#include "mm.h"
-
-#include "i810screen.h"
-#include "i810tex.h"
-
-
-/* Reasons to disable hardware rasterization.
- */
-#define I810_FALLBACK_TEXTURE 0x1
-#define I810_FALLBACK_DRAW_BUFFER 0x2
-#define I810_FALLBACK_READ_BUFFER 0x4
-#define I810_FALLBACK_COLORMASK 0x8
-#define I810_FALLBACK_SPECULAR 0x20
-#define I810_FALLBACK_LOGICOP 0x40
-#define I810_FALLBACK_RENDERMODE 0x80
-#define I810_FALLBACK_STENCIL 0x100
-#define I810_FALLBACK_BLEND_EQ 0x200
-#define I810_FALLBACK_BLEND_FUNC 0x400
-
-
-#ifndef PCI_CHIP_I810
-#define PCI_CHIP_I810 0x7121
-#define PCI_CHIP_I810_DC100 0x7123
-#define PCI_CHIP_I810_E 0x7125
-#define PCI_CHIP_I815 0x1132
-#endif
-
-#define IS_I810(imesa) (imesa->i810Screen->deviceID == PCI_CHIP_I810 || \
- imesa->i810Screen->deviceID == PCI_CHIP_I810_DC100 || \
- imesa->i810Screen->deviceID == PCI_CHIP_I810_E)
-#define IS_I815(imesa) (imesa->i810Screen->deviceID == PCI_CHIP_I815)
-
-
-#define I810_UPLOAD_TEX(i) (I810_UPLOAD_TEX0<<(i))
-
-/* Use the templated vertex formats:
- */
-#define TAG(x) i810##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*i810_tri_func)( i810ContextPtr, i810Vertex *, i810Vertex *,
- i810Vertex * );
-typedef void (*i810_line_func)( i810ContextPtr, i810Vertex *, i810Vertex * );
-typedef void (*i810_point_func)( i810ContextPtr, i810Vertex * );
-
-struct i810_context_t {
- GLint refcount;
- GLcontext *glCtx;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap * texture_heaps[1];
- driTextureObject swapped;
-
- struct i810_texture_object_t *CurrentTexObj[2];
-
-
- /* Bit flag to keep track of fallbacks.
- */
- GLuint Fallback;
-
- /* State for i810vb.c and i810tris.c.
- */
- GLuint new_state; /* _NEW_* flags */
- GLuint SetupNewInputs;
- GLuint SetupIndex;
- GLuint RenderIndex;
- GLmatrix ViewportMatrix;
- GLenum render_primitive;
- GLenum reduced_primitive;
- GLuint hw_primitive;
- GLubyte *verts;
-
- drmBufPtr vertex_buffer;
- char *vertex_addr;
- GLuint vertex_low;
- GLuint vertex_high;
- GLuint vertex_last_prim;
-
- GLboolean upload_cliprects;
-
-
- /* Fallback rasterization functions
- */
- i810_point_func draw_point;
- i810_line_func draw_line;
- i810_tri_func draw_tri;
-
- /* Hardware state
- */
- GLuint dirty; /* I810_UPLOAD_* */
- GLuint Setup[I810_CTX_SETUP_SIZE];
- GLuint BufferSetup[I810_DEST_SETUP_SIZE];
- int vertex_size;
- int vertex_stride_shift;
- unsigned int lastStamp;
- GLboolean stipple_in_hw;
-
- GLenum TexEnvImageFmt[2];
-
- /* State which can't be computed completely on the fly:
- */
- GLuint LcsCullMode;
- GLuint LcsLineWidth;
- GLuint LcsPointSize;
-
- /* Funny mesa mirrors
- */
- GLushort ClearColor;
-
- /* DRI stuff
- */
- GLuint needClip;
- GLframebuffer *glBuffer;
- GLboolean doPageFlip;
-
- /* These refer to the current draw (front vs. back) buffer:
- */
- char *drawMap; /* draw buffer address in virtual mem */
- char *readMap;
- int drawX; /* origin of drawable in draw buffer */
- int drawY;
- GLuint numClipRects; /* cliprects for that buffer */
- drm_clip_rect_t *pClipRects;
-
- int lastSwap;
- int texAge;
- int ctxAge;
- int dirtyAge;
-
-
- GLboolean scissor;
- drm_clip_rect_t draw_rect;
- drm_clip_rect_t scissor_rect;
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
-
- __DRIdrawablePrivate *driDrawable;
- __DRIscreenPrivate *driScreen;
- i810ScreenPrivate *i810Screen;
- I810SAREAPtr sarea;
-};
-
-
-#define I810_CONTEXT(ctx) ((i810ContextPtr)(ctx->DriverCtx))
-
-#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
-#define GET_ENQUEUE_AGE( imesa ) imesa->sarea->last_enqueue
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( imesa ) \
- do { \
- char __ret=0; \
- DRM_CAS(imesa->driHwLock, imesa->hHWContext, \
- (DRM_LOCK_HELD|imesa->hHWContext), __ret); \
- if (__ret) \
- i810GetLock( imesa, 0 ); \
- } while (0)
-
-
-
-/* Release the kernel lock.
- */
-#define UNLOCK_HARDWARE(imesa) \
- DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext);
-
-
-/* This is the wrong way to do it, I'm sure. Otherwise the drm
- * bitches that I've already got the heavyweight lock. At worst,
- * this is 3 ioctls. The best solution probably only gets me down
- * to 2 ioctls in the worst case.
- */
-#define LOCK_HARDWARE_QUIESCENT( imesa ) do { \
- LOCK_HARDWARE( imesa ); \
- i810RegetLockQuiescent( imesa ); \
-} while(0)
-
-
-extern void i810GetLock( i810ContextPtr imesa, GLuint flags );
-extern void i810EmitHwStateLocked( i810ContextPtr imesa );
-extern void i810EmitScissorValues( i810ContextPtr imesa, int box_nr, int emit );
-extern void i810EmitDrawingRectangle( i810ContextPtr imesa );
-extern void i810XMesaSetBackClipRects( i810ContextPtr imesa );
-extern void i810XMesaSetFrontClipRects( i810ContextPtr imesa );
-
-#define SUBPIXEL_X -.5
-#define SUBPIXEL_Y -.5
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-#if DO_DEBUG
-extern int I810_DEBUG;
-#else
-#define I810_DEBUG 0
-#endif
-
-#define DEBUG_TEXTURE 0x1
-#define DEBUG_STATE 0x2
-#define DEBUG_IOCTL 0x4
-#define DEBUG_PRIMS 0x8
-#define DEBUG_VERTS 0x10
-#define DEBUG_FALLBACKS 0x20
-#define DEBUG_VERBOSE 0x40
-#define DEBUG_DRI 0x80
-#define DEBUG_DMA 0x100
-#define DEBUG_SANITY 0x200
-#define DEBUG_SYNC 0x400
-#define DEBUG_SLEEP 0x800
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.c
deleted file mode 100644
index ba651555a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c,v 1.7 2002/10/30 12:51:33 alanh Exp $ */
-
-#include <unistd.h> /* for usleep() */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
-#include "swrast/swrast.h"
-#include "mm.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810ioctl.h"
-#include "i810state.h"
-
-static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa )
-{
- drmI810DMA dma;
- drmBufPtr buf;
- int retcode, i = 0;
-
- while (1) {
- retcode = drmCommandWriteRead(imesa->driFd, DRM_I810_GETBUF,
- &dma, sizeof(drmI810DMA));
-
- if (dma.granted == 1 && retcode == 0)
- break;
-
- if (++i > 1000) {
- drmCommandNone(imesa->driFd, DRM_I810_FLUSH);
- i = 0;
- }
- }
-
- buf = &(imesa->i810Screen->bufs->list[dma.request_idx]);
- buf->idx = dma.request_idx;
- buf->used = 0;
- buf->total = dma.request_size;
- buf->address = (drmAddress)dma.virtual;
-
- return buf;
-}
-
-
-
-#define DEPTH_SCALE ((1<<16)-1)
-
-static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
- drmI810Clear clear;
- unsigned int i;
-
- clear.flags = 0;
- clear.clear_color = imesa->ClearColor;
- clear.clear_depth = (GLuint) (ctx->Depth.Clear * DEPTH_SCALE);
-
- I810_FIREVERTICES( imesa );
-
- if ((mask & BUFFER_BIT_FRONT_LEFT) && colorMask == ~0U) {
- clear.flags |= I810_FRONT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ((mask & BUFFER_BIT_BACK_LEFT) && colorMask == ~0U) {
- clear.flags |= I810_BACK;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if (mask & BUFFER_BIT_DEPTH) {
- if (ctx->Depth.Mask)
- clear.flags |= I810_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if (clear.flags) {
- LOCK_HARDWARE( imesa );
-
- /* flip top to bottom */
- cy = dPriv->h-cy-ch;
- cx += imesa->drawX;
- cy += imesa->drawY;
-
- for (i = 0 ; i < imesa->numClipRects ; )
- {
- unsigned int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, imesa->numClipRects);
- drm_clip_rect_t *box = imesa->pClipRects;
- drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes;
- int n = 0;
-
- if (!all) {
- for ( ; i < nr ; i++) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if (x < cx) w -= cx - x, x = cx;
- if (y < cy) h -= cy - y, y = cy;
- if (x + w > cx + cw) w = cx + cw - x;
- if (y + h > cy + ch) h = cy + ch - y;
- if (w <= 0) continue;
- if (h <= 0) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++) {
- *b++ = box[i];
- n++;
- }
- }
-
- imesa->sarea->nbox = n;
- drmCommandWrite(imesa->driFd, DRM_I810_CLEAR,
- &clear, sizeof(drmI810Clear));
- }
-
- UNLOCK_HARDWARE( imesa );
- imesa->upload_cliprects = GL_TRUE;
- }
-
- if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-}
-
-
-
-
-/*
- * Copy the back buffer to the front buffer.
- */
-void i810CopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- i810ContextPtr imesa;
- drm_clip_rect_t *pbox;
- int nbox, i, tmp;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- I810_FIREVERTICES( imesa );
- LOCK_HARDWARE( imesa );
-
- pbox = (drm_clip_rect_t *)dPriv->pClipRects;
- nbox = dPriv->numClipRects;
-
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, dPriv->numClipRects);
- drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes;
-
- imesa->sarea->nbox = nr - i;
-
- for ( ; i < nr ; i++)
- *b++ = pbox[i];
-
- drmCommandNone(imesa->driFd, DRM_I810_SWAP);
- }
-
- tmp = GET_ENQUEUE_AGE(imesa);
- UNLOCK_HARDWARE( imesa );
-
- /* multiarb will suck the life out of the server without this throttle:
- */
- if (GET_DISPATCH_AGE(imesa) < imesa->lastSwap) {
- i810WaitAge(imesa, imesa->lastSwap);
- }
-
- imesa->lastSwap = tmp;
- imesa->upload_cliprects = GL_TRUE;
-}
-
-
-/*
- * XXX implement when full-screen extension is done.
- */
-void i810PageFlip( const __DRIdrawablePrivate *dPriv )
-{
- i810ContextPtr imesa;
- int tmp, ret;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- I810_FIREVERTICES( imesa );
- LOCK_HARDWARE( imesa );
-
- if (dPriv->pClipRects) {
- memcpy(&(imesa->sarea->boxes[0]), &(dPriv->pClipRects[0]),
- sizeof(drm_clip_rect_t));
- imesa->sarea->nbox = 1;
- }
- ret = drmCommandNone(imesa->driFd, DRM_I810_FLIP);
- if (ret) {
- fprintf(stderr, "%s: %d\n", __FUNCTION__, ret);
- UNLOCK_HARDWARE( imesa );
- exit(1);
- }
-
- tmp = GET_ENQUEUE_AGE(imesa);
- UNLOCK_HARDWARE( imesa );
-
- /* multiarb will suck the life out of the server without this throttle:
- */
- if (GET_DISPATCH_AGE(imesa) < imesa->lastSwap) {
- i810WaitAge(imesa, imesa->lastSwap);
- }
-
- /* i810SetDrawBuffer( imesa->glCtx, imesa->glCtx->Color.DriverDrawBuffer );*/
- i810DrawBuffer( imesa->glCtx, imesa->glCtx->Color.DrawBuffer[0] );
- imesa->upload_cliprects = GL_TRUE;
- imesa->lastSwap = tmp;
- return;
-}
-
-
-/* This waits for *everybody* to finish rendering -- overkill.
- */
-void i810DmaFinish( i810ContextPtr imesa )
-{
- I810_FIREVERTICES( imesa );
-
- LOCK_HARDWARE( imesa );
- i810RegetLockQuiescent( imesa );
- UNLOCK_HARDWARE( imesa );
-}
-
-
-void i810RegetLockQuiescent( i810ContextPtr imesa )
-{
- drmUnlock(imesa->driFd, imesa->hHWContext);
- i810GetLock( imesa, DRM_LOCK_QUIESCENT );
-}
-
-void i810WaitAgeLocked( i810ContextPtr imesa, int age )
-{
- int i = 0, j;
-
- while (++i < 5000) {
- drmCommandNone(imesa->driFd, DRM_I810_GETAGE);
- if (GET_DISPATCH_AGE(imesa) >= age)
- return;
- for (j = 0 ; j < 1000 ; j++)
- ;
- }
-
- drmCommandNone(imesa->driFd, DRM_I810_FLUSH);
-}
-
-
-void i810WaitAge( i810ContextPtr imesa, int age )
-{
- int i = 0, j;
-
- while (++i < 5000) {
- drmCommandNone(imesa->driFd, DRM_I810_GETAGE);
- if (GET_DISPATCH_AGE(imesa) >= age)
- return;
- for (j = 0 ; j < 1000 ; j++)
- ;
- }
-
- i = 0;
- while (++i < 1000) {
- drmCommandNone(imesa->driFd, DRM_I810_GETAGE);
- if (GET_DISPATCH_AGE(imesa) >= age)
- return;
- usleep(1000);
- }
-
- LOCK_HARDWARE(imesa);
- drmCommandNone(imesa->driFd, DRM_I810_FLUSH);
- UNLOCK_HARDWARE(imesa);
-}
-
-
-
-
-static int intersect_rect( drm_clip_rect_t *out,
- drm_clip_rect_t *a,
- drm_clip_rect_t *b )
-{
- *out = *a;
- if (b->x1 > out->x1) out->x1 = b->x1;
- if (b->x2 < out->x2) out->x2 = b->x2;
- if (out->x1 >= out->x2) return 0;
-
- if (b->y1 > out->y1) out->y1 = b->y1;
- if (b->y2 < out->y2) out->y2 = b->y2;
- if (out->y1 >= out->y2) return 0;
- return 1;
-}
-
-
-static void emit_state( i810ContextPtr imesa )
-{
- GLuint dirty = imesa->dirty;
- I810SAREAPtr sarea = imesa->sarea;
-
- if (dirty & I810_UPLOAD_BUFFERS) {
- memcpy( sarea->BufferState, imesa->BufferSetup,
- sizeof(imesa->BufferSetup) );
- }
-
- if (dirty & I810_UPLOAD_CTX) {
- memcpy( sarea->ContextState, imesa->Setup,
- sizeof(imesa->Setup) );
- }
-
- if (dirty & I810_UPLOAD_TEX0) {
- memcpy(sarea->TexState[0],
- imesa->CurrentTexObj[0]->Setup,
- sizeof(imesa->CurrentTexObj[0]->Setup));
- }
-
- if (dirty & I810_UPLOAD_TEX1) {
- GLuint *setup = sarea->TexState[1];
-
- memcpy( setup,
- imesa->CurrentTexObj[1]->Setup,
- sizeof(imesa->CurrentTexObj[1]->Setup));
-
- /* Need this for the case where both units are bound to the same
- * texobj.
- */
- setup[I810_TEXREG_MI1] ^= (MI1_MAP_0 ^ MI1_MAP_1);
- setup[I810_TEXREG_MLC] ^= (MLC_MAP_0 ^ MLC_MAP_1);
- setup[I810_TEXREG_MLL] ^= (MLL_MAP_0 ^ MLL_MAP_1);
- setup[I810_TEXREG_MCS] ^= (MCS_COORD_0 ^ MCS_COORD_1);
- setup[I810_TEXREG_MF] ^= (MF_MAP_0 ^ MF_MAP_1);
- }
-
- sarea->dirty = dirty;
- imesa->dirty = 0;
-}
-
-
-static void age_imesa( i810ContextPtr imesa, int age )
-{
- if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->base.timestamp = age;
- if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->base.timestamp = age;
-}
-
-
-void i810FlushPrimsLocked( i810ContextPtr imesa )
-{
- drm_clip_rect_t *pbox = imesa->pClipRects;
- int nbox = imesa->numClipRects;
- drmBufPtr buffer = imesa->vertex_buffer;
- I810SAREAPtr sarea = imesa->sarea;
- drmI810Vertex vertex;
- int i;
-
- if (I810_DEBUG & DEBUG_STATE)
- i810PrintDirty( __FUNCTION__, imesa->dirty );
-
- if (imesa->dirty)
- emit_state( imesa );
-
- vertex.idx = buffer->idx;
- vertex.used = imesa->vertex_low;
- vertex.discard = 0;
- sarea->vertex_prim = imesa->hw_primitive;
-
- if (!nbox) {
- vertex.used = 0;
- }
- else if (nbox > I810_NR_SAREA_CLIPRECTS) {
- imesa->upload_cliprects = GL_TRUE;
- }
-
- if (!nbox || !imesa->upload_cliprects)
- {
- if (nbox == 1)
- sarea->nbox = 0;
- else
- sarea->nbox = nbox;
-
- vertex.discard = 1;
- drmCommandWrite(imesa->driFd, DRM_I810_VERTEX,
- &vertex, sizeof(drmI810Vertex));
- age_imesa(imesa, sarea->last_enqueue);
- }
- else
- {
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, nbox);
- drm_clip_rect_t *b = (drm_clip_rect_t *)sarea->boxes;
-
- if (imesa->scissor) {
- sarea->nbox = 0;
-
- for ( ; i < nr ; i++) {
- b->x1 = pbox[i].x1 - imesa->drawX;
- b->y1 = pbox[i].y1 - imesa->drawY;
- b->x2 = pbox[i].x2 - imesa->drawX;
- b->y2 = pbox[i].y2 - imesa->drawY;
-
- if (intersect_rect(b, b, &imesa->scissor_rect)) {
- sarea->nbox++;
- b++;
- }
- }
-
- /* Culled?
- */
- if (!sarea->nbox) {
- if (nr < nbox) continue;
- vertex.used = 0;
- }
- } else {
- sarea->nbox = nr - i;
- for ( ; i < nr ; i++, b++) {
- b->x1 = pbox[i].x1 - imesa->drawX;
- b->y1 = pbox[i].y1 - imesa->drawY;
- b->x2 = pbox[i].x2 - imesa->drawX;
- b->y2 = pbox[i].y2 - imesa->drawY;
- }
- }
-
- /* Finished with the buffer?
- */
- if (nr == nbox)
- vertex.discard = 1;
-
- drmCommandWrite(imesa->driFd, DRM_I810_VERTEX,
- &vertex, sizeof(drmI810Vertex));
- age_imesa(imesa, imesa->sarea->last_enqueue);
- }
- }
-
- /* Reset imesa vars:
- */
- imesa->vertex_buffer = 0;
- imesa->vertex_addr = 0;
- imesa->vertex_low = 0;
- imesa->vertex_high = 0;
- imesa->vertex_last_prim = 0;
- imesa->dirty = 0;
- imesa->upload_cliprects = GL_FALSE;
-}
-
-void i810FlushPrimsGetBuffer( i810ContextPtr imesa )
-{
- LOCK_HARDWARE(imesa);
-
- if (imesa->vertex_buffer)
- i810FlushPrimsLocked( imesa );
-
- imesa->vertex_buffer = i810_get_buffer_ioctl( imesa );
- imesa->vertex_high = imesa->vertex_buffer->total;
- imesa->vertex_addr = (char *)imesa->vertex_buffer->address;
- imesa->vertex_low = 4; /* leave room for instruction header */
- imesa->vertex_last_prim = imesa->vertex_low;
- UNLOCK_HARDWARE(imesa);
-}
-
-
-void i810FlushPrims( i810ContextPtr imesa )
-{
- if (imesa->vertex_buffer) {
- LOCK_HARDWARE( imesa );
- i810FlushPrimsLocked( imesa );
- UNLOCK_HARDWARE( imesa );
- }
-}
-
-
-
-int i810_check_copy(int fd)
-{
- return(drmCommandNone(fd, DRM_I810_DOCOPY));
-}
-
-static void i810Flush( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- I810_FIREVERTICES( imesa );
-}
-
-static void i810Finish( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- i810DmaFinish( imesa );
-}
-
-void i810InitIoctlFuncs( struct dd_function_table *functions )
-{
- functions->Flush = i810Flush;
- functions->Clear = i810Clear;
- functions->Finish = i810Finish;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.h
deleted file mode 100644
index 61399ee7b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810ioctl.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.h,v 1.7 2002/10/30 12:51:33 alanh Exp $ */
-
-#ifndef I810_IOCTL_H
-#define I810_IOCTL_H
-
-#include "i810context.h"
-
-void i810EmitPrim( i810ContextPtr imesa );
-void i810FlushPrims( i810ContextPtr mmesa );
-void i810FlushPrimsLocked( i810ContextPtr mmesa );
-void i810FlushPrimsGetBuffer( i810ContextPtr imesa );
-
-void i810WaitAgeLocked( i810ContextPtr imesa, int age );
-void i810WaitAge( i810ContextPtr imesa, int age );
-void i810DmaFinish( i810ContextPtr imesa );
-void i810RegetLockQuiescent( i810ContextPtr imesa );
-void i810InitIoctlFuncs( struct dd_function_table *functions );
-void i810CopyBuffer( const __DRIdrawablePrivate *dpriv );
-void i810PageFlip( const __DRIdrawablePrivate *dpriv );
-int i810_check_copy(int fd);
-
-#define I810_STATECHANGE(imesa, flag) \
-do { \
- if (imesa->vertex_low != imesa->vertex_last_prim) \
- i810FlushPrims(imesa); \
- imesa->dirty |= flag; \
-} while (0) \
-
-
-#define I810_FIREVERTICES(imesa) \
-do { \
- if (imesa->vertex_buffer) { \
- i810FlushPrims(imesa); \
- } \
-} while (0)
-
-static __inline GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes )
-{
- if (imesa->vertex_low + bytes > imesa->vertex_high)
- i810FlushPrimsGetBuffer( imesa );
-
- {
- GLuint *start = (GLuint *)(imesa->vertex_addr + imesa->vertex_low);
- imesa->vertex_low += bytes;
- return start;
- }
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810render.c
deleted file mode 100644
index a31d54236..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810render.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Intel i810 DRI driver for Mesa 3.5
- *
- * Copyright (C) 1999-2000 Keith Whitwell All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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 KEITH WHITWELL BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Author:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware acceleration where possible.
- *
- */
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-
-#include "tnl/t_context.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810tris.h"
-#include "i810state.h"
-#include "i810vb.h"
-#include "i810ioctl.h"
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Try to simulate missing primitives with indexed vertices.
- */
-#define HAVE_POINTS 0
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0 /* has it, template can't use it yet */
-#define HAVE_TRI_FANS 1
-#define HAVE_POLYGONS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-
-#define HAVE_ELTS 0
-
-
-static GLuint hw_prim[GL_POLYGON+1] = {
- 0,
- PR_LINES,
- 0,
- PR_LINESTRIP,
- PR_TRIANGLES,
- PR_TRISTRIP_0,
- PR_TRIFAN,
- 0,
- 0,
- PR_POLYGON
-};
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
-
-
-#define LOCAL_VARS i810ContextPtr imesa = I810_CONTEXT(ctx)
-#define INIT( prim ) do { \
- I810_STATECHANGE(imesa, 0); \
- i810RasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); \
-} while (0)
-#define GET_CURRENT_VB_MAX_VERTS() \
- (((int)imesa->vertex_high - (int)imesa->vertex_low) / (imesa->vertex_size*4))
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- (I810_DMA_BUF_SZ-4) / (imesa->vertex_size * 4)
-
-#define ALLOC_VERTS( nr ) \
- i810AllocDmaLow( imesa, (nr) * imesa->vertex_size * 4)
-#define EMIT_VERTS( ctx, j, nr, buf ) \
- i810_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
-
-#define FLUSH() I810_FIREVERTICES( imesa )
-
-
-#define TAG(x) i810_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-static GLboolean i810_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- /* Don't handle clipping or indexed vertices.
- */
- if (imesa->RenderIndex != 0 ||
- !i810_validate_render( ctx, VB )) {
- return GL_TRUE;
- }
-
- imesa->SetupNewInputs = VERT_BIT_POS;
-
- tnl->Driver.Render.Start( ctx );
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- i810_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length,
- prim );
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-
-const struct tnl_pipeline_stage _i810_render_stage =
-{
- "i810 render",
- NULL,
- NULL,
- NULL,
- NULL,
- i810_run_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.c
deleted file mode 100644
index 991c7cb23..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810screen.c,v 1.2 2002/10/30 12:51:33 alanh Exp $ */
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "fbobject.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
-#include "utils.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810state.h"
-#include "i810tex.h"
-#include "i810span.h"
-#include "i810tris.h"
-#include "i810ioctl.h"
-
-#include "GL/internal/dri_interface.h"
-
-extern const struct dri_extension card_extensions[];
-
-static __GLcontextModes *fill_in_modes( __GLcontextModes *modes,
- unsigned pixel_bits,
- unsigned depth_bits,
- unsigned stencil_bits,
- const GLenum * db_modes,
- unsigned num_db_modes,
- int visType )
-{
- static const u_int8_t bits[1][4] = {
- { 5, 6, 5, 0 }
- };
-
- static const u_int32_t masks[1][4] = {
- { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }
- };
-
- unsigned i;
- unsigned j;
- const unsigned index = 0;
-
- for ( i = 0 ; i < num_db_modes ; i++ ) {
- for ( j = 0 ; j < 2 ; j++ ) {
-
- modes->redBits = bits[index][0];
- modes->greenBits = bits[index][1];
- modes->blueBits = bits[index][2];
- modes->alphaBits = bits[index][3];
- modes->redMask = masks[index][0];
- modes->greenMask = masks[index][1];
- modes->blueMask = masks[index][2];
- modes->alphaMask = masks[index][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[index][3] != 0) ? 16 * j : 0;
- modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG;
-
- modes->stencilBits = stencil_bits;
- modes->depthBits = depth_bits;
-
- 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 = modes->next;
- }
- }
-
- return modes;
-
-}
-
-
-static __GLcontextModes *
-i810FillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{ __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- unsigned i;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- int depth_buffer_modes[2][2];
-
-
- depth_buffer_modes[0][0] = depth_bits;
- depth_buffer_modes[1][0] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- depth_buffer_modes[0][1] = 0;
- depth_buffer_modes[1][1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
- m = fill_in_modes( m, pixel_bits,
- depth_buffer_modes[i][0], depth_buffer_modes[i][1],
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR );
- }
-
- for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
- m = fill_in_modes( m, pixel_bits,
- depth_buffer_modes[i][0], depth_buffer_modes[i][1],
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR );
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-
-}
-
-
-/* static int i810_malloc_proxy_buf(drmBufMapPtr buffers) */
-/* { */
-/* char *buffer; */
-/* drmBufPtr buf; */
-/* int i; */
-
-/* buffer = CALLOC(I810_DMA_BUF_SZ); */
-/* if(buffer == NULL) return -1; */
-/* for(i = 0; i < I810_DMA_BUF_NR; i++) { */
-/* buf = &(buffers->list[i]); */
-/* buf->address = (drmAddress)buffer; */
-/* } */
-/* return 0; */
-/* } */
-
-static drmBufMapPtr i810_create_empty_buffers(void)
-{
- drmBufMapPtr retval;
-
- retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32);
- if(retval == NULL) return NULL;
- memset(retval, 0, sizeof(drmBufMap));
- retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR, 32);
- if(retval->list == NULL) {
- ALIGN_FREE(retval);
- return NULL;
- }
- memset(retval->list, 0, sizeof(drmBuf) * I810_DMA_BUF_NR);
- return retval;
-}
-
-
-static GLboolean
-i810InitDriver(__DRIscreenPrivate *sPriv)
-{
- i810ScreenPrivate *i810Screen;
- I810DRIPtr gDRIPriv = (I810DRIPtr)sPriv->pDevPriv;
-
- if (sPriv->devPrivSize != sizeof(I810DRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(I810DRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- i810Screen = (i810ScreenPrivate *)CALLOC(sizeof(i810ScreenPrivate));
- if (!i810Screen) {
- __driUtilMessage("i810InitDriver: alloc i810ScreenPrivate struct failed");
- return GL_FALSE;
- }
-
- i810Screen->driScrnPriv = sPriv;
- sPriv->private = (void *)i810Screen;
-
- i810Screen->deviceID=gDRIPriv->deviceID;
- i810Screen->width=gDRIPriv->width;
- i810Screen->height=gDRIPriv->height;
- i810Screen->mem=gDRIPriv->mem;
- i810Screen->cpp=gDRIPriv->cpp;
- i810Screen->fbStride=gDRIPriv->fbStride;
- i810Screen->fbOffset=gDRIPriv->fbOffset;
-
- if (gDRIPriv->bitsPerPixel == 15)
- i810Screen->fbFormat = DV_PF_555;
- else
- i810Screen->fbFormat = DV_PF_565;
-
- i810Screen->backOffset=gDRIPriv->backOffset;
- i810Screen->depthOffset=gDRIPriv->depthOffset;
- i810Screen->backPitch = gDRIPriv->auxPitch;
- i810Screen->backPitchBits = gDRIPriv->auxPitchBits;
- i810Screen->textureOffset=gDRIPriv->textureOffset;
- i810Screen->textureSize=gDRIPriv->textureSize;
- i810Screen->logTextureGranularity = gDRIPriv->logTextureGranularity;
-
- i810Screen->bufs = i810_create_empty_buffers();
- if (i810Screen->bufs == NULL) {
- __driUtilMessage("i810InitDriver: i810_create_empty_buffers() failed");
- FREE(i810Screen);
- return GL_FALSE;
- }
-
- i810Screen->back.handle = gDRIPriv->backbuffer;
- i810Screen->back.size = gDRIPriv->backbufferSize;
-
- if (drmMap(sPriv->fd,
- i810Screen->back.handle,
- i810Screen->back.size,
- (drmAddress *)&i810Screen->back.map) != 0) {
- FREE(i810Screen);
- sPriv->private = NULL;
- __driUtilMessage("i810InitDriver: drmMap failed");
- return GL_FALSE;
- }
-
- i810Screen->depth.handle = gDRIPriv->depthbuffer;
- i810Screen->depth.size = gDRIPriv->depthbufferSize;
-
- if (drmMap(sPriv->fd,
- i810Screen->depth.handle,
- i810Screen->depth.size,
- (drmAddress *)&i810Screen->depth.map) != 0) {
- FREE(i810Screen);
- drmUnmap(i810Screen->back.map, i810Screen->back.size);
- sPriv->private = NULL;
- __driUtilMessage("i810InitDriver: drmMap (2) failed");
- return GL_FALSE;
- }
-
- i810Screen->tex.handle = gDRIPriv->textures;
- i810Screen->tex.size = gDRIPriv->textureSize;
-
- if (drmMap(sPriv->fd,
- i810Screen->tex.handle,
- i810Screen->tex.size,
- (drmAddress *)&i810Screen->tex.map) != 0) {
- FREE(i810Screen);
- drmUnmap(i810Screen->back.map, i810Screen->back.size);
- drmUnmap(i810Screen->depth.map, i810Screen->depth.size);
- sPriv->private = NULL;
- __driUtilMessage("i810InitDriver: drmMap (3) failed");
- return GL_FALSE;
- }
-
- i810Screen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
-
- return GL_TRUE;
-}
-
-static void
-i810DestroyScreen(__DRIscreenPrivate *sPriv)
-{
- i810ScreenPrivate *i810Screen = (i810ScreenPrivate *)sPriv->private;
-
- /* Need to unmap all the bufs and maps here:
- */
- drmUnmap(i810Screen->back.map, i810Screen->back.size);
- drmUnmap(i810Screen->depth.map, i810Screen->depth.size);
- drmUnmap(i810Screen->tex.map, i810Screen->tex.size);
-
- FREE(i810Screen);
- sPriv->private = NULL;
-}
-
-
-/**
- * Create a buffer which corresponds to the window.
- */
-static GLboolean
-i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- i810ScreenPrivate *screen = (i810ScreenPrivate *) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- /*screen->frontOffset*/0, screen->backPitch);
- i810SetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- i810SetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->backPitch);
- i810SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-i810DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-static const struct __DriverAPIRec i810API = {
- .InitDriver = i810InitDriver,
- .DestroyScreen = i810DestroyScreen,
- .CreateContext = i810CreateContext,
- .DestroyContext = i810DestroyContext,
- .CreateBuffer = i810CreateBuffer,
- .DestroyBuffer = i810DestroyBuffer,
- .SwapBuffers = i810SwapBuffers,
- .MakeCurrent = i810MakeCurrent,
- .UnbindContext = i810UnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = NULL,
- .WaitForMSC = NULL,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 2, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "i810",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &i810API);
- if ( psp != NULL ) {
- *driver_modes = i810FillInModes( 16,
- 16, 0,
- 1);
- driInitExtensions( NULL, card_extensions, GL_TRUE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.h
deleted file mode 100644
index b29937665..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810screen.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#ifndef _I810_INIT_H_
-#define _I810_INIT_H_
-
-#include <sys/time.h>
-#include "dri_util.h"
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
- char *map;
-} i810Region, *i810RegionPtr;
-
-typedef struct {
- i810Region front;
- i810Region back;
- i810Region depth;
- i810Region tex;
-
- int deviceID;
- int width;
- int height;
- int mem;
-
- int cpp; /* for front and back buffers */
- int bitsPerPixel;
-
- int fbFormat;
- int fbOffset;
- int fbStride;
-
- int backOffset;
- int depthOffset;
-
- int backPitch;
- int backPitchBits;
-
- int textureOffset;
- int textureSize;
- int logTextureGranularity;
-
- __DRIscreenPrivate *driScrnPriv;
- drmBufMapPtr bufs;
- unsigned int sarea_priv_offset;
-} i810ScreenPrivate;
-
-
-extern GLboolean
-i810CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate );
-
-extern void
-i810DestroyContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-i810UnbindContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-i810MakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv);
-
-extern void
-i810SwapBuffers(__DRIdrawablePrivate *driDrawPriv);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.c
deleted file mode 100644
index 1a976048c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.c
+++ /dev/null
@@ -1,201 +0,0 @@
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810span.h"
-#include "i810ioctl.h"
-#include "swrast/swrast.h"
-
-
-#define DBG 0
-
-#define LOCAL_VARS \
- i810ContextPtr imesa = I810_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
- i810ScreenPrivate *i810Screen = imesa->i810Screen; \
- GLuint pitch = i810Screen->backPitch; \
- GLuint height = dPriv->h; \
- GLushort p; \
- char *buf = (char *)(imesa->drawMap + \
- dPriv->x * 2 + \
- dPriv->y * pitch); \
- char *read_buf = (char *)(imesa->readMap + \
- dPriv->x * 2 + \
- dPriv->y * pitch); \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- i810ContextPtr imesa = I810_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
- i810ScreenPrivate *i810Screen = imesa->i810Screen; \
- GLuint pitch = i810Screen->backPitch; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(i810Screen->depth.map + \
- dPriv->x * 2 + \
- dPriv->y * pitch)
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_565( color[0], color[1], color[2] )
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-/* 16 bit, 565 rgb color spanline and pixel functions
- */
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ( (((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
- rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
- rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
- rgba[3] = 255; \
-} while(0)
-
-#define TAG(x) i810##x##_565
-#include "spantmp.h"
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
-
-#define TAG(x) i810##x##_16
-#include "depthtmp.h"
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void i810SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
- GLuint bufferBit )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- (void) buffer;
-
- switch(bufferBit) {
- case BUFFER_BIT_FRONT_LEFT:
- if ( imesa->sarea->pf_current_page == 1)
- imesa->readMap = imesa->i810Screen->back.map;
- else
- imesa->readMap = (char*)imesa->driScreen->pFB;
- break;
- case BUFFER_BIT_BACK_LEFT:
- if ( imesa->sarea->pf_current_page == 1)
- imesa->readMap = (char*)imesa->driScreen->pFB;
- else
- imesa->readMap = imesa->i810Screen->back.map;
- break;
- default:
- ASSERT(0);
- break;
- }
- imesa->drawMap = imesa->readMap;
-}
-
-/* Move locking out to get reasonable span performance.
- */
-void i810SpanRenderStart( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- I810_FIREVERTICES(imesa);
- LOCK_HARDWARE(imesa);
- i810RegetLockQuiescent( imesa );
-}
-
-void i810SpanRenderFinish( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( imesa );
-}
-
-void i810InitSpanFuncs( GLcontext *ctx )
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = i810SetBuffer;
-
-#if 0
- swdd->WriteRGBASpan = i810WriteRGBASpan_565;
- swdd->WriteRGBSpan = i810WriteRGBSpan_565;
- swdd->WriteMonoRGBASpan = i810WriteMonoRGBASpan_565;
- swdd->WriteRGBAPixels = i810WriteRGBAPixels_565;
- swdd->WriteMonoRGBAPixels = i810WriteMonoRGBAPixels_565;
- swdd->ReadRGBASpan = i810ReadRGBASpan_565;
- swdd->ReadRGBAPixels = i810ReadRGBAPixels_565;
-#endif
-
-#if 0
- swdd->ReadDepthSpan = i810ReadDepthSpan_16;
- swdd->WriteDepthSpan = i810WriteDepthSpan_16;
- swdd->ReadDepthPixels = i810ReadDepthPixels_16;
- swdd->WriteDepthPixels = i810WriteDepthPixels_16;
-#endif
-
- swdd->SpanRenderStart = i810SpanRenderStart;
- swdd->SpanRenderFinish = i810SpanRenderFinish;
-}
-
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-i810SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- /* always 565 RGB */
- drb->Base.GetRow = i810ReadRGBASpan_565;
- drb->Base.GetValues = i810ReadRGBAPixels_565;
- drb->Base.PutRow = i810WriteRGBASpan_565;
- drb->Base.PutRowRGB = i810WriteRGBSpan_565;
- drb->Base.PutMonoRow = i810WriteMonoRGBASpan_565;
- drb->Base.PutValues = i810WriteRGBAPixels_565;
- drb->Base.PutMonoValues = i810WriteMonoRGBAPixels_565;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = i810ReadDepthSpan_16;
- drb->Base.GetValues = i810ReadDepthPixels_16;
- drb->Base.PutRow = i810WriteDepthSpan_16;
- drb->Base.PutMonoRow = i810WriteMonoDepthSpan_16;
- drb->Base.PutValues = i810WriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- /* should never get here */
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.h
deleted file mode 100644
index 9aed253bd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810span.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _I810_SPAN_H
-#define _I810_SPAN_H
-
-#include "drirenderbuffer.h"
-
-extern void i810InitSpanFuncs( GLcontext *ctx );
-
-extern void i810SpanRenderFinish( GLcontext *ctx );
-extern void i810SpanRenderStart( GLcontext *ctx );
-
-extern void
-i810SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.c
deleted file mode 100644
index 62dc819b3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.c
+++ /dev/null
@@ -1,1025 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */
-
-#include <stdio.h>
-
-#include "glheader.h"
-#include "buffers.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-#include "colormac.h"
-
-#include "texmem.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810state.h"
-#include "i810tex.h"
-#include "i810vb.h"
-#include "i810tris.h"
-#include "i810ioctl.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-static __inline__ GLuint i810PackColor(GLuint format,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a)
-{
-
- if (I810_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch (format) {
- case DV_PF_555:
- return PACK_COLOR_1555( a, r, g, b );
- case DV_PF_565:
- return PACK_COLOR_565( r, g, b );
- default:
- fprintf(stderr, "unknown format %d\n", (int)format);
- return 0;
- }
-}
-
-
-static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint a = (ZA_UPDATE_ALPHAFUNC|ZA_UPDATE_ALPHAREF);
- GLubyte refByte;
-
- CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
- switch (ctx->Color.AlphaFunc) {
- case GL_NEVER: a |= ZA_ALPHA_NEVER; break;
- case GL_LESS: a |= ZA_ALPHA_LESS; break;
- case GL_GEQUAL: a |= ZA_ALPHA_GEQUAL; break;
- case GL_LEQUAL: a |= ZA_ALPHA_LEQUAL; break;
- case GL_GREATER: a |= ZA_ALPHA_GREATER; break;
- case GL_NOTEQUAL: a |= ZA_ALPHA_NOTEQUAL; break;
- case GL_EQUAL: a |= ZA_ALPHA_EQUAL; break;
- case GL_ALWAYS: a |= ZA_ALPHA_ALWAYS; break;
- default: return;
- }
-
- a |= ((refByte & 0xfc) << ZA_ALPHAREF_SHIFT);
-
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_ZA] &= ~(ZA_ALPHA_MASK|ZA_ALPHAREF_MASK);
- imesa->Setup[I810_CTXREG_ZA] |= a;
-}
-
-static void i810BlendEquationSeparate(GLcontext *ctx,
- GLenum modeRGB, GLenum modeA)
-{
- assert( modeRGB == modeA );
-
- /* Can only do GL_ADD equation in hardware */
- FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_BLEND_EQ,
- modeRGB != GL_FUNC_ADD);
-
- /* BlendEquation sets ColorLogicOpEnabled in an unexpected
- * manner.
- */
- FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
-}
-
-static void i810BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint a = SDM_UPDATE_SRC_BLEND | SDM_UPDATE_DST_BLEND;
- GLboolean fallback = GL_FALSE;
-
- switch (ctx->Color.BlendSrcRGB) {
- case GL_ZERO: a |= SDM_SRC_ZERO; break;
- case GL_ONE: a |= SDM_SRC_ONE; break;
- case GL_SRC_COLOR: a |= SDM_SRC_SRC_COLOR; break;
- case GL_ONE_MINUS_SRC_COLOR: a |= SDM_SRC_INV_SRC_COLOR; break;
- case GL_SRC_ALPHA: a |= SDM_SRC_SRC_ALPHA; break;
- case GL_ONE_MINUS_SRC_ALPHA: a |= SDM_SRC_INV_SRC_ALPHA; break;
- case GL_DST_ALPHA: a |= SDM_SRC_ONE; break;
- case GL_ONE_MINUS_DST_ALPHA: a |= SDM_SRC_ZERO; break;
- case GL_DST_COLOR: a |= SDM_SRC_DST_COLOR; break;
- case GL_ONE_MINUS_DST_COLOR: a |= SDM_SRC_INV_DST_COLOR; break;
-
- /* (f, f, f, 1), f = min(As, 1 - Ad) = min(As, 1 - 1) = 0
- * So (f, f, f, 1) = (0, 0, 0, 1). Since there is no destination alpha and
- * the only supported alpha operation is GL_FUNC_ADD, the result modulating
- * the source alpha with the alpha factor is largely irrelevant.
- */
- case GL_SRC_ALPHA_SATURATE: a |= SDM_SRC_ZERO; break;
-
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- fallback = GL_TRUE;
- break;
- default:
- return;
- }
-
- switch (ctx->Color.BlendDstRGB) {
- case GL_ZERO: a |= SDM_DST_ZERO; break;
- case GL_ONE: a |= SDM_DST_ONE; break;
- case GL_SRC_COLOR: a |= SDM_DST_SRC_COLOR; break;
- case GL_ONE_MINUS_SRC_COLOR: a |= SDM_DST_INV_SRC_COLOR; break;
- case GL_SRC_ALPHA: a |= SDM_DST_SRC_ALPHA; break;
- case GL_ONE_MINUS_SRC_ALPHA: a |= SDM_DST_INV_SRC_ALPHA; break;
- case GL_DST_ALPHA: a |= SDM_DST_ONE; break;
- case GL_ONE_MINUS_DST_ALPHA: a |= SDM_DST_ZERO; break;
- case GL_DST_COLOR: a |= SDM_DST_DST_COLOR; break;
- case GL_ONE_MINUS_DST_COLOR: a |= SDM_DST_INV_DST_COLOR; break;
-
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- fallback = GL_TRUE;
- break;
- default:
- return;
- }
-
- FALLBACK( imesa, I810_FALLBACK_BLEND_FUNC, fallback);
- if (!fallback) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_SDM] &= ~(SDM_SRC_MASK|SDM_DST_MASK);
- imesa->Setup[I810_CTXREG_SDM] |= a;
- }
-}
-
-
-
-static void i810DepthFunc(GLcontext *ctx, GLenum func)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- int zmode;
-
- switch(func) {
- case GL_NEVER: zmode = LCS_Z_NEVER; break;
- case GL_ALWAYS: zmode = LCS_Z_ALWAYS; break;
- case GL_LESS: zmode = LCS_Z_LESS; break;
- case GL_LEQUAL: zmode = LCS_Z_LEQUAL; break;
- case GL_EQUAL: zmode = LCS_Z_EQUAL; break;
- case GL_GREATER: zmode = LCS_Z_GREATER; break;
- case GL_GEQUAL: zmode = LCS_Z_GEQUAL; break;
- case GL_NOTEQUAL: zmode = LCS_Z_NOTEQUAL; break;
- default: return;
- }
-
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_Z_MASK;
- imesa->Setup[I810_CTXREG_LCS] |= zmode;
-}
-
-static void i810DepthMask(GLcontext *ctx, GLboolean flag)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
-
- if (flag)
- imesa->Setup[I810_CTXREG_B2] |= B2_ZB_WRITE_ENABLE;
- else
- imesa->Setup[I810_CTXREG_B2] &= ~B2_ZB_WRITE_ENABLE;
-}
-
-
-/* =============================================================
- * Polygon stipple
- *
- * The i810 supports a 4x4 stipple natively, GL wants 32x32.
- * Fortunately stipple is usually a repeating pattern.
- */
-static void i810PolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- const GLubyte *m = mask;
- GLubyte p[4];
- int i,j,k;
- int active = (ctx->Polygon.StippleFlag &&
- imesa->reduced_primitive == GL_TRIANGLES);
- GLuint newMask;
-
- if (active) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_ST1] &= ~ST1_ENABLE;
- }
-
- p[0] = mask[12] & 0xf; p[0] |= p[0] << 4;
- p[1] = mask[8] & 0xf; p[1] |= p[1] << 4;
- p[2] = mask[4] & 0xf; p[2] |= p[2] << 4;
- p[3] = mask[0] & 0xf; p[3] |= p[3] << 4;
-
- for (k = 0 ; k < 8 ; k++)
- for (j = 0 ; j < 4; j++)
- for (i = 0 ; i < 4 ; i++)
- if (*m++ != p[j]) {
- imesa->stipple_in_hw = 0;
- return;
- }
-
- newMask = ((p[0] & 0xf) << 0) |
- ((p[1] & 0xf) << 4) |
- ((p[2] & 0xf) << 8) |
- ((p[3] & 0xf) << 12);
-
- if (newMask == 0xffff) {
- /* this is needed to make conform pass */
- imesa->stipple_in_hw = 0;
- return;
- }
-
- imesa->Setup[I810_CTXREG_ST1] &= ~0xffff;
- imesa->Setup[I810_CTXREG_ST1] |= newMask;
- imesa->stipple_in_hw = 1;
-
- if (active)
- imesa->Setup[I810_CTXREG_ST1] |= ST1_ENABLE;
-}
-
-
-
-/* =============================================================
- * Hardware clipping
- */
-
-
-static void i810Scissor( GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
-
- if (ctx->Scissor.Enabled) {
- I810_FIREVERTICES(imesa); /* don't pipeline cliprect changes */
- imesa->upload_cliprects = GL_TRUE;
- }
-
- imesa->scissor_rect.x1 = x;
- imesa->scissor_rect.y1 = imesa->driDrawable->h - (y + h);
- imesa->scissor_rect.x2 = x + w;
- imesa->scissor_rect.y2 = imesa->driDrawable->h - y;
-}
-
-
-static void i810LogicOp( GLcontext *ctx, GLenum opcode )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- FALLBACK( imesa, I810_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled && opcode != GL_COPY) );
-}
-
-/* Fallback to swrast for select and feedback.
- */
-static void i810RenderMode( GLcontext *ctx, GLenum mode )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- FALLBACK( imesa, I810_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
-}
-
-
-void i810DrawBuffer(GLcontext *ctx, GLenum mode )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- int front = 0;
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- front = 1;
- break;
- case BUFFER_BIT_BACK_LEFT:
- front = 0;
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- if ( imesa->sarea->pf_current_page == 1 )
- front ^= 1;
-
- FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE );
- I810_FIREVERTICES(imesa);
- I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS);
-
- if (front)
- {
- imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset |
- imesa->i810Screen->backPitchBits);
- i810XMesaSetFrontClipRects( imesa );
- }
- else
- {
- imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset |
- imesa->i810Screen->backPitchBits);
- i810XMesaSetBackClipRects( imesa );
- }
-
- /* We want to update the s/w rast state too so that r200SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-}
-
-
-static void i810ReadBuffer(GLcontext *ctx, GLenum mode )
-{
- /* XXX anything? */
-}
-
-
-static void i810ClearColor(GLcontext *ctx, const GLfloat color[4] )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLubyte c[4];
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
- imesa->ClearColor = i810PackColor( imesa->i810Screen->fbFormat,
- c[0], c[1], c[2], c[3] );
-}
-
-
-/* =============================================================
- * Culling - the i810 isn't quite as clean here as the rest of
- * its interfaces, but it's not bad.
- */
-static void i810CullFaceFrontFace(GLcontext *ctx, GLenum unused)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint mode = LCS_CULL_BOTH;
-
- if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
- mode = LCS_CULL_CW;
- if (ctx->Polygon.CullFaceMode == GL_FRONT)
- mode ^= (LCS_CULL_CW ^ LCS_CULL_CCW);
- if (ctx->Polygon.FrontFace != GL_CCW)
- mode ^= (LCS_CULL_CW ^ LCS_CULL_CCW);
- }
-
- imesa->LcsCullMode = mode;
-
- if (ctx->Polygon.CullFlag)
- {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_CULL_MASK;
- imesa->Setup[I810_CTXREG_LCS] |= mode;
- }
-}
-
-
-static void i810LineWidth( GLcontext *ctx, GLfloat widthf )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- int width = (int)ctx->Line._Width;
-
- imesa->LcsLineWidth = 0;
- if (width & 1) imesa->LcsLineWidth |= LCS_LINEWIDTH_1_0;
- if (width & 2) imesa->LcsLineWidth |= LCS_LINEWIDTH_2_0;
-
- if (imesa->reduced_primitive == GL_LINES) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_LINEWIDTH_3_0;
- imesa->Setup[I810_CTXREG_LCS] |= imesa->LcsLineWidth;
- }
-}
-
-static void i810PointSize( GLcontext *ctx, GLfloat sz )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- int size = (int)ctx->Point._Size;
-
- imesa->LcsPointSize = 0;
- if (size & 1) imesa->LcsPointSize |= LCS_LINEWIDTH_1_0;
- if (size & 2) imesa->LcsPointSize |= LCS_LINEWIDTH_2_0;
-
- if (imesa->reduced_primitive == GL_POINTS) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_LINEWIDTH_3_0;
- imesa->Setup[I810_CTXREG_LCS] |= imesa->LcsPointSize;
- }
-}
-
-/* =============================================================
- * Color masks
- */
-
-static void i810ColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLuint tmp = 0;
-
- if (r && g && b) {
- tmp = imesa->Setup[I810_CTXREG_B2] | B2_FB_WRITE_ENABLE;
- FALLBACK( imesa, I810_FALLBACK_COLORMASK, GL_FALSE );
- } else if (!r && !g && !b) {
- tmp = imesa->Setup[I810_CTXREG_B2] & ~B2_FB_WRITE_ENABLE;
- FALLBACK( imesa, I810_FALLBACK_COLORMASK, GL_FALSE );
- } else {
- FALLBACK( imesa, I810_FALLBACK_COLORMASK, GL_TRUE );
- return;
- }
-
- if (tmp != imesa->Setup[I810_CTXREG_B2]) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_B2] = tmp;
- imesa->dirty |= I810_UPLOAD_CTX;
- }
-}
-
-/* Seperate specular not fully implemented on the i810.
- */
-static void i810LightModelfv(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- if (pname == GL_LIGHT_MODEL_COLOR_CONTROL)
- {
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- FALLBACK( imesa, I810_FALLBACK_SPECULAR,
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR));
- }
-}
-
-/* But the 815 has it...
- */
-static void i810LightModelfv_i815(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- if (pname == GL_LIGHT_MODEL_COLOR_CONTROL)
- {
- i810ContextPtr imesa = I810_CONTEXT( ctx );
-
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- imesa->Setup[I810_CTXREG_B1] |= B1_SPEC_ENABLE;
- else
- imesa->Setup[I810_CTXREG_B1] &= ~B1_SPEC_ENABLE;
- }
-}
-
-/* In Mesa 3.5 we can reliably do native flatshading.
- */
-static void i810ShadeModel(GLcontext *ctx, GLenum mode)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- if (mode == GL_FLAT)
- imesa->Setup[I810_CTXREG_LCS] |= LCS_INTERP_FLAT;
- else
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_INTERP_FLAT;
-}
-
-
-
-/* =============================================================
- * Fog
- */
-static void i810Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
-
- if (pname == GL_FOG_COLOR) {
- GLuint color = (((GLubyte)(ctx->Fog.Color[0]*255.0F) << 16) |
- ((GLubyte)(ctx->Fog.Color[1]*255.0F) << 8) |
- ((GLubyte)(ctx->Fog.Color[2]*255.0F) << 0));
-
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_FOG] = ((GFX_OP_FOG_COLOR | color) &
- ~FOG_RESERVED_MASK);
- }
-}
-
-
-/* =============================================================
- */
-static void i810Enable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
-
- switch(cap) {
- case GL_ALPHA_TEST:
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_B1] &= ~B1_ALPHA_TEST_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_B1] |= B1_ALPHA_TEST_ENABLE;
- break;
- case GL_BLEND:
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_B1] &= ~B1_BLEND_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_B1] |= B1_BLEND_ENABLE;
-
- /* For some reason enable(GL_BLEND) affects ColorLogicOpEnabled.
- */
- FALLBACK( imesa, I810_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
- break;
- case GL_DEPTH_TEST:
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_B1] &= ~B1_Z_TEST_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_B1] |= B1_Z_TEST_ENABLE;
- break;
- case GL_SCISSOR_TEST:
- /* XXX without these next two lines, conform's scissor test fails */
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS);
- I810_FIREVERTICES(imesa); /* don't pipeline cliprect changes */
- imesa->upload_cliprects = GL_TRUE;
- imesa->scissor = state;
- break;
- case GL_POLYGON_STIPPLE:
- if (imesa->stipple_in_hw && imesa->reduced_primitive == GL_TRIANGLES)
- {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_ST1] &= ~ST1_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_ST1] |= ST1_ENABLE;
- }
- break;
- case GL_LINE_SMOOTH:
- /* Need to fatten the lines by .5, or they disappear...
- */
- if (imesa->reduced_primitive == GL_LINES) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_AA] &= ~AA_ENABLE;
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_LINEWIDTH_0_5;
- if (state) {
- imesa->Setup[I810_CTXREG_AA] |= AA_ENABLE;
- imesa->Setup[I810_CTXREG_LCS] |= LCS_LINEWIDTH_0_5;
- }
- }
- break;
- case GL_POINT_SMOOTH:
- if (imesa->reduced_primitive == GL_POINTS) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_AA] &= ~AA_ENABLE;
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_LINEWIDTH_0_5;
- if (state) {
- imesa->Setup[I810_CTXREG_AA] |= AA_ENABLE;
- imesa->Setup[I810_CTXREG_LCS] |= LCS_LINEWIDTH_0_5;
- }
- }
- break;
- case GL_POLYGON_SMOOTH:
- if (imesa->reduced_primitive == GL_TRIANGLES) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_AA] &= ~AA_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_AA] |= AA_ENABLE;
- }
- break;
- case GL_FOG:
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_B1] &= ~B1_FOG_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_B1] |= B1_FOG_ENABLE;
- break;
- case GL_CULL_FACE:
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_LCS] &= ~LCS_CULL_MASK;
- if (state)
- imesa->Setup[I810_CTXREG_LCS] |= imesa->LcsCullMode;
- else
- imesa->Setup[I810_CTXREG_LCS] |= LCS_CULL_DISABLE;
- break;
- case GL_TEXTURE_2D:
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- if (ctx->Texture.CurrentUnit == 0) {
- imesa->Setup[I810_CTXREG_MT] &= ~MT_TEXEL0_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_MT] |= MT_TEXEL0_ENABLE;
- } else {
- imesa->Setup[I810_CTXREG_MT] &= ~MT_TEXEL1_ENABLE;
- if (state)
- imesa->Setup[I810_CTXREG_MT] |= MT_TEXEL1_ENABLE;
- }
- break;
- case GL_COLOR_LOGIC_OP:
- FALLBACK( imesa, I810_FALLBACK_LOGICOP,
- (state && ctx->Color.LogicOp != GL_COPY));
- break;
- case GL_STENCIL_TEST:
- FALLBACK( imesa, I810_FALLBACK_STENCIL, state );
- break;
- default:
- ;
- }
-}
-
-
-
-
-
-
-
-/* =============================================================
- */
-
-
-
-
-void i810EmitDrawingRectangle( i810ContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- i810ScreenPrivate *i810Screen = imesa->i810Screen;
- int x0 = imesa->drawX;
- int y0 = imesa->drawY;
- int x1 = x0 + dPriv->w;
- int y1 = y0 + dPriv->h;
- GLuint dr2, dr3, dr4;
-
-
- /* Coordinate origin of the window - may be offscreen.
- */
- dr4 = imesa->BufferSetup[I810_DESTREG_DR4] = ((y0<<16) |
- (((unsigned)x0)&0xFFFF));
-
- /* Clip to screen.
- */
- if (x0 < 0) x0 = 0;
- if (y0 < 0) y0 = 0;
- if (x1 > i810Screen->width-1) x1 = i810Screen->width-1;
- if (y1 > i810Screen->height-1) y1 = i810Screen->height-1;
-
-
- /* Onscreen drawing rectangle.
- */
- dr2 = imesa->BufferSetup[I810_DESTREG_DR2] = ((y0<<16) | x0);
- dr3 = imesa->BufferSetup[I810_DESTREG_DR3] = (((y1+1)<<16) | (x1+1));
-
-
- imesa->dirty |= I810_UPLOAD_BUFFERS;
-}
-
-
-
-static void i810CalcViewport( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = imesa->ViewportMatrix.m;
-
- /* See also i810_translate_vertex. SUBPIXEL adjustments can be done
- * via state vars, too.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + imesa->driDrawable->h + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * (1.0 / 0xffff);
- m[MAT_TZ] = v[MAT_TZ] * (1.0 / 0xffff);
-}
-
-static void i810Viewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- i810CalcViewport( ctx );
-}
-
-static void i810DepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- i810CalcViewport( ctx );
-}
-
-
-
-void i810PrintDirty( const char *msg, GLuint state )
-{
- fprintf(stderr, "%s (0x%x): %s%s%s%s\n",
- msg,
- (unsigned int) state,
- (state & I810_UPLOAD_TEX0) ? "upload-tex0, " : "",
- (state & I810_UPLOAD_TEX1) ? "upload-tex1, " : "",
- (state & I810_UPLOAD_CTX) ? "upload-ctx, " : "",
- (state & I810_UPLOAD_BUFFERS) ? "upload-bufs, " : ""
- );
-}
-
-
-
-void i810InitState( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- i810ScreenPrivate *i810Screen = imesa->i810Screen;
-
- memset(imesa->Setup, 0, sizeof(imesa->Setup));
-
- imesa->Setup[I810_CTXREG_VF] = 0;
-
- imesa->Setup[I810_CTXREG_MT] = (GFX_OP_MAP_TEXELS |
- MT_UPDATE_TEXEL1_STATE |
- MT_TEXEL1_COORD1 |
- MT_TEXEL1_MAP1 |
- MT_TEXEL1_DISABLE |
- MT_UPDATE_TEXEL0_STATE |
- MT_TEXEL0_COORD0 |
- MT_TEXEL0_MAP0 |
- MT_TEXEL0_DISABLE);
-
- imesa->Setup[I810_CTXREG_MC0] = ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_ITERATED_COLOR |
- MC_ARG1_DONT_REPLICATE_ALPHA |
- MC_ARG1_DONT_INVERT |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_ARG2_DONT_REPLICATE_ALPHA |
- MC_ARG2_DONT_INVERT |
- MC_UPDATE_OP |
- MC_OP_ARG1 );
-
- imesa->Setup[I810_CTXREG_MC1] = ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_ONE |
- MC_ARG1_DONT_REPLICATE_ALPHA |
- MC_ARG1_DONT_INVERT |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_ARG2_DONT_REPLICATE_ALPHA |
- MC_ARG2_DONT_INVERT |
- MC_UPDATE_OP |
- MC_OP_DISABLE );
-
-
- imesa->Setup[I810_CTXREG_MC2] = ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_2 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_CURRENT_COLOR |
- MC_ARG1_REPLICATE_ALPHA |
- MC_ARG1_DONT_INVERT |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_ARG2_DONT_REPLICATE_ALPHA |
- MC_ARG2_DONT_INVERT |
- MC_UPDATE_OP |
- MC_OP_DISABLE );
-
-
- imesa->Setup[I810_CTXREG_MA0] = ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ITERATED_ALPHA |
- MA_ARG1_DONT_INVERT |
- MA_UPDATE_ARG2 |
- MA_ARG2_CURRENT_ALPHA |
- MA_ARG2_DONT_INVERT |
- MA_UPDATE_OP |
- MA_OP_ARG1 );
-
-
- imesa->Setup[I810_CTXREG_MA1] = ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_ARG1_DONT_INVERT |
- MA_UPDATE_ARG2 |
- MA_ARG2_CURRENT_ALPHA |
- MA_ARG2_DONT_INVERT |
- MA_UPDATE_OP |
- MA_OP_ARG1 );
-
-
- imesa->Setup[I810_CTXREG_MA2] = ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_2 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_ARG1_DONT_INVERT |
- MA_UPDATE_ARG2 |
- MA_ARG2_CURRENT_ALPHA |
- MA_ARG2_DONT_INVERT |
- MA_UPDATE_OP |
- MA_OP_ARG1 );
-
-
- imesa->Setup[I810_CTXREG_SDM] = ( GFX_OP_SRC_DEST_MONO |
- SDM_UPDATE_MONO_ENABLE |
- 0 |
- SDM_UPDATE_SRC_BLEND |
- SDM_SRC_ONE |
- SDM_UPDATE_DST_BLEND |
- SDM_DST_ZERO );
-
- /* Use for colormask:
- */
- imesa->Setup[I810_CTXREG_CF0] = GFX_OP_COLOR_FACTOR;
- imesa->Setup[I810_CTXREG_CF1] = 0xffffffff;
-
- imesa->Setup[I810_CTXREG_ZA] = (GFX_OP_ZBIAS_ALPHAFUNC |
- ZA_UPDATE_ALPHAFUNC |
- ZA_ALPHA_ALWAYS |
- ZA_UPDATE_ZBIAS |
- 0 |
- ZA_UPDATE_ALPHAREF |
- 0x0);
-
- imesa->Setup[I810_CTXREG_FOG] = (GFX_OP_FOG_COLOR |
- (0xffffff & ~FOG_RESERVED_MASK));
-
- /* Choose a pipe
- */
- imesa->Setup[I810_CTXREG_B1] = ( GFX_OP_BOOL_1 |
- B1_UPDATE_SPEC_SETUP_ENABLE |
- 0 |
- B1_UPDATE_ALPHA_SETUP_ENABLE |
- B1_ALPHA_SETUP_ENABLE |
- B1_UPDATE_CI_KEY_ENABLE |
- 0 |
- B1_UPDATE_CHROMAKEY_ENABLE |
- 0 |
- B1_UPDATE_Z_BIAS_ENABLE |
- 0 |
- B1_UPDATE_SPEC_ENABLE |
- 0 |
- B1_UPDATE_FOG_ENABLE |
- 0 |
- B1_UPDATE_ALPHA_TEST_ENABLE |
- 0 |
- B1_UPDATE_BLEND_ENABLE |
- 0 |
- B1_UPDATE_Z_TEST_ENABLE |
- 0 );
-
- imesa->Setup[I810_CTXREG_B2] = ( GFX_OP_BOOL_2 |
- B2_UPDATE_MAP_CACHE_ENABLE |
- B2_MAP_CACHE_ENABLE |
- B2_UPDATE_ALPHA_DITHER_ENABLE |
- 0 |
- B2_UPDATE_FOG_DITHER_ENABLE |
- 0 |
- B2_UPDATE_SPEC_DITHER_ENABLE |
- 0 |
- B2_UPDATE_RGB_DITHER_ENABLE |
- B2_RGB_DITHER_ENABLE |
- B2_UPDATE_FB_WRITE_ENABLE |
- B2_FB_WRITE_ENABLE |
- B2_UPDATE_ZB_WRITE_ENABLE |
- B2_ZB_WRITE_ENABLE );
-
- imesa->Setup[I810_CTXREG_LCS] = ( GFX_OP_LINEWIDTH_CULL_SHADE_MODE |
- LCS_UPDATE_ZMODE |
- LCS_Z_LESS |
- LCS_UPDATE_LINEWIDTH |
- LCS_LINEWIDTH_1_0 |
- LCS_UPDATE_ALPHA_INTERP |
- LCS_ALPHA_INTERP |
- LCS_UPDATE_FOG_INTERP |
- 0 |
- LCS_UPDATE_SPEC_INTERP |
- 0 |
- LCS_UPDATE_RGB_INTERP |
- LCS_RGB_INTERP |
- LCS_UPDATE_CULL_MODE |
- LCS_CULL_DISABLE);
-
- imesa->LcsCullMode = LCS_CULL_CW;
- imesa->LcsLineWidth = LCS_LINEWIDTH_1_0;
- imesa->LcsPointSize = LCS_LINEWIDTH_1_0;
-
- imesa->Setup[I810_CTXREG_PV] = ( GFX_OP_PV_RULE |
- PV_UPDATE_PIXRULE |
- PV_PIXRULE_ENABLE |
- PV_UPDATE_LINELIST |
- PV_LINELIST_PV1 |
- PV_UPDATE_TRIFAN |
- PV_TRIFAN_PV2 |
- PV_UPDATE_TRISTRIP |
- PV_TRISTRIP_PV2 );
-
-
- imesa->Setup[I810_CTXREG_ST0] = GFX_OP_STIPPLE;
- imesa->Setup[I810_CTXREG_ST1] = 0;
-
- imesa->Setup[I810_CTXREG_AA] = ( GFX_OP_ANTIALIAS |
- AA_UPDATE_EDGEFLAG |
- 0 |
- AA_UPDATE_POLYWIDTH |
- AA_POLYWIDTH_05 |
- AA_UPDATE_LINEWIDTH |
- AA_LINEWIDTH_05 |
- AA_UPDATE_BB_EXPANSION |
- 0 |
- AA_UPDATE_AA_ENABLE |
- 0 );
-
- memset(imesa->BufferSetup, 0, sizeof(imesa->BufferSetup));
- imesa->BufferSetup[I810_DESTREG_DI0] = CMD_OP_DESTBUFFER_INFO;
-
- if (imesa->glCtx->Visual.doubleBufferMode && imesa->sarea->pf_current_page == 0) {
- /* use back buffer by default */
- imesa->drawMap = i810Screen->back.map;
- imesa->readMap = i810Screen->back.map;
- imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->backOffset |
- i810Screen->backPitchBits);
- } else {
- /* use front buffer by default */
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
- imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->fbOffset |
- i810Screen->backPitchBits);
- }
-
- imesa->BufferSetup[I810_DESTREG_DV0] = GFX_OP_DESTBUFFER_VARS;
- imesa->BufferSetup[I810_DESTREG_DV1] = (DV_HORG_BIAS_OGL |
- DV_VORG_BIAS_OGL |
- i810Screen->fbFormat);
-
- imesa->BufferSetup[I810_DESTREG_DR0] = GFX_OP_DRAWRECT_INFO;
- imesa->BufferSetup[I810_DESTREG_DR1] = DR1_RECT_CLIP_ENABLE;
-}
-
-
-static void i810InvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- I810_CONTEXT(ctx)->new_state |= new_state;
-}
-
-
-void i810InitStateFuncs(GLcontext *ctx)
-{
- /* Callbacks for internal Mesa events.
- */
- ctx->Driver.UpdateState = i810InvalidateState;
-
- /* API callbacks
- */
- ctx->Driver.AlphaFunc = i810AlphaFunc;
- ctx->Driver.BlendEquationSeparate = i810BlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = i810BlendFuncSeparate;
- ctx->Driver.ClearColor = i810ClearColor;
- ctx->Driver.ColorMask = i810ColorMask;
- ctx->Driver.CullFace = i810CullFaceFrontFace;
- ctx->Driver.DepthFunc = i810DepthFunc;
- ctx->Driver.DepthMask = i810DepthMask;
- ctx->Driver.Enable = i810Enable;
- ctx->Driver.Fogfv = i810Fogfv;
- ctx->Driver.FrontFace = i810CullFaceFrontFace;
- ctx->Driver.LineWidth = i810LineWidth;
- ctx->Driver.LogicOpcode = i810LogicOp;
- ctx->Driver.PolygonStipple = i810PolygonStipple;
- ctx->Driver.RenderMode = i810RenderMode;
- ctx->Driver.Scissor = i810Scissor;
- ctx->Driver.DrawBuffer = i810DrawBuffer;
- ctx->Driver.ReadBuffer = i810ReadBuffer;
- ctx->Driver.ShadeModel = i810ShadeModel;
- ctx->Driver.DepthRange = i810DepthRange;
- ctx->Driver.Viewport = i810Viewport;
- ctx->Driver.PointSize = i810PointSize;
-
- if (IS_I815(I810_CONTEXT(ctx))) {
- ctx->Driver.LightModelfv = i810LightModelfv_i815;
- } else {
- ctx->Driver.LightModelfv = i810LightModelfv;
- }
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.h
deleted file mode 100644
index 118b07549..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810state.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _I810_STATE_H
-#define _I810_STATE_H
-
-#include "i810context.h"
-
-extern void i810InitState( GLcontext *ctx );
-extern void i810InitStateFuncs( GLcontext *ctx );
-extern void i810PrintDirty( const char *msg, GLuint state );
-extern void i810DrawBuffer(GLcontext *ctx, GLenum mode );
-
-extern void i810Fallback( i810ContextPtr imesa, GLuint bit, GLboolean mode );
-#define FALLBACK( imesa, bit, mode ) i810Fallback( imesa, bit, mode )
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c
deleted file mode 100644
index 0aba8e8aa..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tex.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texmem.h"
-#include "texobj.h"
-#include "swrast/swrast.h"
-#include "colormac.h"
-#include "texobj.h"
-#include "mm.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810tex.h"
-#include "i810state.h"
-#include "i810ioctl.h"
-
-
-/*
- * Compute the 'S2.4' lod bias factor from the floating point OpenGL bias.
- */
-static GLuint i810ComputeLodBias(GLfloat bias)
-{
- int b = (int) (bias * 16.0) + 12;
- if (b > 63)
- b = 63;
- else if (b < -64)
- b = -64;
- return (GLuint) (b & MLC_LOD_BIAS_MASK);
-}
-
-
-static void i810SetTexWrapping(i810TextureObjectPtr tex,
- GLenum swrap, GLenum twrap)
-{
- tex->Setup[I810_TEXREG_MCS] &= ~(MCS_U_STATE_MASK| MCS_V_STATE_MASK);
-
- switch( swrap ) {
- case GL_REPEAT:
- tex->Setup[I810_TEXREG_MCS] |= MCS_U_WRAP;
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- tex->Setup[I810_TEXREG_MCS] |= MCS_U_CLAMP;
- break;
- case GL_MIRRORED_REPEAT:
- tex->Setup[I810_TEXREG_MCS] |= MCS_U_MIRROR;
- break;
- default:
- _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
- }
-
- switch( twrap ) {
- case GL_REPEAT:
- tex->Setup[I810_TEXREG_MCS] |= MCS_V_WRAP;
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- tex->Setup[I810_TEXREG_MCS] |= MCS_V_CLAMP;
- break;
- case GL_MIRRORED_REPEAT:
- tex->Setup[I810_TEXREG_MCS] |= MCS_V_MIRROR;
- break;
- default:
- _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
- }
-}
-
-
-static void i810SetTexFilter(i810ContextPtr imesa,
- i810TextureObjectPtr t,
- GLenum minf, GLenum magf,
- GLfloat bias)
-{
- t->Setup[I810_TEXREG_MF] &= ~(MF_MIN_MASK|
- MF_MAG_MASK|
- MF_MIP_MASK);
- t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK);
-
- switch (minf) {
- case GL_NEAREST:
- t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_NONE;
- break;
- case GL_LINEAR:
- t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_NEAREST;
- if (magf == GL_LINEAR) {
- /*bias -= 0.5;*/ /* this doesn't work too good */
- }
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- if (IS_I815(imesa))
- t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_LINEAR;
- else
- t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_DITHER;
- /*
- if (magf == GL_LINEAR) {
- bias -= 0.5;
- }
- */
- bias -= 0.5; /* always biasing here looks better */
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- if (IS_I815(imesa))
- t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_LINEAR;
- else
- t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_DITHER;
- break;
- default:
- return;
- }
-
- switch (magf) {
- case GL_NEAREST:
- t->Setup[I810_TEXREG_MF] |= MF_MAG_NEAREST;
- break;
- case GL_LINEAR:
- t->Setup[I810_TEXREG_MF] |= MF_MAG_LINEAR;
- break;
- default:
- return;
- }
-
- t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(bias);
-}
-
-
-static void
-i810SetTexBorderColor( i810TextureObjectPtr t, GLubyte color[4] )
-{
- /* Need a fallback.
- */
-}
-
-
-static i810TextureObjectPtr
-i810AllocTexObj( GLcontext *ctx, struct gl_texture_object *texObj )
-{
- i810TextureObjectPtr t;
- i810ContextPtr imesa = I810_CONTEXT(ctx);
-
- t = CALLOC_STRUCT( i810_texture_object_t );
- texObj->DriverData = t;
- if ( t != NULL ) {
- GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias;
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
- t->Setup[I810_TEXREG_MI0] = GFX_OP_MAP_INFO;
- t->Setup[I810_TEXREG_MI1] = MI1_MAP_0;
- t->Setup[I810_TEXREG_MI2] = MI2_DIMENSIONS_ARE_LOG2;
- t->Setup[I810_TEXREG_MLC] = (GFX_OP_MAP_LOD_CTL |
- MLC_MAP_0 |
- /*MLC_DITHER_WEIGHT_FULL |*/
- MLC_DITHER_WEIGHT_12 |
- MLC_UPDATE_LOD_BIAS |
- 0x0);
- t->Setup[I810_TEXREG_MCS] = (GFX_OP_MAP_COORD_SETS |
- MCS_COORD_0 |
- MCS_UPDATE_NORMALIZED |
- MCS_NORMALIZED_COORDS |
- MCS_UPDATE_V_STATE |
- MCS_V_WRAP |
- MCS_UPDATE_U_STATE |
- MCS_U_WRAP);
- t->Setup[I810_TEXREG_MF] = (GFX_OP_MAP_FILTER |
- MF_MAP_0 |
- MF_UPDATE_ANISOTROPIC |
- MF_UPDATE_MIP_FILTER |
- MF_UPDATE_MAG_FILTER |
- MF_UPDATE_MIN_FILTER);
-
- make_empty_list( & t->base );
-
- i810SetTexWrapping( t, texObj->WrapS, texObj->WrapT );
- /*i830SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/
- i810SetTexFilter( imesa, t, texObj->MinFilter, texObj->MagFilter, bias );
- i810SetTexBorderColor( t, texObj->_BorderChan );
- }
-
- return t;
-}
-
-
-static void i810TexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
-
- if (!t)
- return;
-
- if ( target != GL_TEXTURE_2D )
- return;
-
- /* Can't do the update now as we don't know whether to flush
- * vertices or not. Setting imesa->new_state means that
- * i810UpdateTextureState() will be called before any triangles are
- * rendered. If a statechange has occurred, it will be detected at
- * that point, and buffered vertices flushed.
- */
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- {
- GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias;
- i810SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias );
- }
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- i810SetTexWrapping( t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- i810SetTexBorderColor( t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative for Radeon. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- I810_FIREVERTICES( I810_CONTEXT(ctx) );
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-
- if (t == imesa->CurrentTexObj[0]) {
- I810_STATECHANGE( imesa, I810_UPLOAD_TEX0 );
- }
-
- if (t == imesa->CurrentTexObj[1]) {
- I810_STATECHANGE( imesa, I810_UPLOAD_TEX1 );
- }
-}
-
-
-/**
- * Setup hardware bits for new texture environment settings.
- *
- * \todo
- * Determine whether or not \c param can be used instead of
- * \c texUnit->EnvColor in the \c GL_TEXTURE_ENV_COLOR case.
- */
-static void i810TexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- const GLuint unit = ctx->Texture.CurrentUnit;
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- /* Only one env color. Need a fallback if env colors are different
- * and texture setup references env color in both units.
- */
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR: {
- GLubyte c[4];
- GLuint envColor;
-
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
- envColor = PACK_COLOR_8888( c[3], c[0], c[1], c[2] );
-
- if (imesa->Setup[I810_CTXREG_CF1] != envColor) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_CF1] = envColor;
- }
- break;
- }
-
- case GL_TEXTURE_ENV_MODE:
- imesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */
- break;
-
- case GL_TEXTURE_LOD_BIAS: {
- if ( texUnit->_Current != NULL ) {
- const struct gl_texture_object *tObj = texUnit->_Current;
- i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
-
- t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK);
- t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(*param);
- }
- break;
- }
-
- default:
- break;
- }
-}
-
-
-
-#if 0
-static void i810TexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *pack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- i810TextureObjectPtr t = (i810TextureObjectPtr) texObj->DriverData;
- if (t) {
- i810SwapOutTexObj( imesa, t );
- }
-}
-
-static void i810TexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *pack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
-}
-#endif
-
-
-static void i810TexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
- if (t) {
- I810_FIREVERTICES( I810_CONTEXT(ctx) );
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) i810AllocTexObj( ctx, texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
-}
-
-static void i810TexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject *t = (driTextureObject *)texObj->DriverData;
- if (t) {
- I810_FIREVERTICES( I810_CONTEXT(ctx) );
- driSwapOutTextureObject( t );
- }
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-}
-
-
-static void i810BindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- assert( (target != GL_TEXTURE_2D) || (tObj->DriverData != NULL) );
-}
-
-
-static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- driTextureObject * t = (driTextureObject *) tObj->DriverData;
- if (t) {
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- if (imesa)
- I810_FIREVERTICES( imesa );
- driDestroyTextureObject( t );
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-/**
- * Choose a Mesa texture format to match the requested format.
- *
- * \todo
- * Determine why \c _mesa_texformat_al88 doesn't work right for
- * \c GL_LUMINANCE_ALPHA textures. It seems to work fine for \c GL_INTENSITY,
- * but \c GL_LUMINANCE_ALPHA gets some red bands in progs/demos/texenv.
- */
-static const struct gl_texture_format *
-i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- if ( format == GL_BGRA ) {
- if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
- }
- }
- return &_mesa_texformat_argb4444;
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_rgb565;
-
- case GL_RGBA2:
- case GL_RGBA4:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_al88;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_rgb565;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
-#if 0
- return &_mesa_texformat_al88;
-#else
- return &_mesa_texformat_argb4444;
-#endif
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- default:
- fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-i810NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- i810AllocTexObj( ctx, obj );
- return obj;
-}
-
-void i810InitTextureFuncs( struct dd_function_table *functions )
-{
- functions->ChooseTextureFormat = i810ChooseTextureFormat;
- functions->TexImage2D = i810TexImage2D;
- functions->TexSubImage2D = i810TexSubImage2D;
- functions->BindTexture = i810BindTexture;
- functions->NewTextureObject = i810NewTextureObject;
- functions->DeleteTexture = i810DeleteTexture;
- functions->TexParameter = i810TexParameter;
- functions->TexEnv = i810TexEnv;
- functions->IsTextureResident = driIsTextureResident;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.h
deleted file mode 100644
index c6ab4c8e6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- *
- */
-
-#ifndef I810TEX_INC
-#define I810TEX_INC
-
-#include "mtypes.h"
-#include "mm.h"
-
-#include "i810context.h"
-#include "i810_3d_reg.h"
-#include "texmem.h"
-
-#define I810_TEX_MAXLEVELS 11
-
-/* For shared texture space managment, these texture objects may also
- * be used as proxies for regions of texture memory containing other
- * client's textures. Such proxy textures (not to be confused with GL
- * proxy textures) are subject to the same LRU aging we use for our
- * own private textures, and thus we have a mechanism where we can
- * fairly decide between kicking out our own textures and those of
- * other clients.
- *
- * Non-local texture objects have a valid MemBlock to describe the
- * region managed by the other client, and can be identified by
- * 't->globj == 0'
- */
-struct i810_texture_object_t {
- driTextureObject base;
-
- int Pitch;
- int Height;
- int texelBytes;
- char *BufAddr;
-
- GLuint max_level;
-
- struct {
- const struct gl_texture_image *image;
- int offset; /* into BufAddr */
- int height;
- int internalFormat;
- } image[I810_TEX_MAXLEVELS];
-
- GLuint Setup[I810_TEX_SETUP_SIZE];
- GLuint dirty;
-
-};
-
-void i810UpdateTextureState( GLcontext *ctx );
-void i810InitTextureFuncs( struct dd_function_table *functions );
-
-void i810DestroyTexObj( i810ContextPtr imesa, i810TextureObjectPtr t );
-int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texmem.c
deleted file mode 100644
index 08900cc67..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texmem.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- * Texmem interface changes (C) 2003 Dave Airlie
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "colormac.h"
-#include "mm.h"
-#include "texformat.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810tex.h"
-#include "i810state.h"
-#include "i810ioctl.h"
-
-
-void i810DestroyTexObj(i810ContextPtr imesa, i810TextureObjectPtr t)
-{
- /* See if it was the driver's current object.
- */
- if ( imesa != NULL ) {
- if (imesa->CurrentTexObj[0] == t) {
- imesa->CurrentTexObj[0] = 0;
- imesa->dirty &= ~I810_UPLOAD_TEX0;
- }
-
- if (imesa->CurrentTexObj[1] == t) {
- imesa->CurrentTexObj[1] = 0;
- imesa->dirty &= ~I810_UPLOAD_TEX1;
- }
- }
-}
-
-
-
-#if defined(i386) || defined(__i386__)
-/* From linux kernel i386 header files, copes with odd sizes better
- * than COPY_DWORDS would:
- */
-static __inline__ void * __memcpy(void * to, const void * from, size_t n)
-{
-int d0, d1, d2;
-__asm__ __volatile__(
- "rep ; movsl\n\t"
- "testb $2,%b4\n\t"
- "je 1f\n\t"
- "movsw\n"
- "1:\ttestb $1,%b4\n\t"
- "je 2f\n\t"
- "movsb\n"
- "2:"
- : "=&c" (d0), "=&D" (d1), "=&S" (d2)
- :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
- : "memory");
-return (to);
-}
-#else
-/* Allow compilation on other architectures */
-#define __memcpy memcpy
-#endif
-
-/* Upload an image from mesa's internal copy.
- */
-static void i810UploadTexLevel( i810ContextPtr imesa,
- i810TextureObjectPtr t, int hwlevel )
-{
- const struct gl_texture_image *image = t->image[hwlevel].image;
- int j;
-
- if (!image || !image->Data)
- return;
-
- if (image->Width * image->TexFormat->TexelBytes == t->Pitch) {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- memcpy( dst, src, t->Pitch * image->Height );
- }
- else switch (image->TexFormat->TexelBytes) {
- case 1:
- {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
- __memcpy(dst, src, image->Width );
- src += image->Width;
- }
- }
- break;
-
- case 2:
- {
- GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset);
- GLushort *src = (GLushort *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) {
- __memcpy(dst, src, image->Width * 2 );
- src += image->Width;
- }
- }
- break;
-
- default:
- fprintf(stderr, "%s: Not supported texel size %d\n",
- __FUNCTION__, image->TexFormat->TexelBytes);
- }
-}
-
-/* This is called with the lock held. May have to eject our own and/or
- * other client's texture objects to make room for the upload.
- */
-int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t )
-{
- int i;
- int ofs;
- int numLevels;
-
- /* Do we need to eject LRU texture objects?
- */
- if (!t->base.memBlock) {
- int heap;
-
- heap = driAllocateTexture( imesa->texture_heaps, imesa->nr_heaps,
- (driTextureObject *) t);
-
- if ( heap == -1 ) {
- return -1;
- }
-
- ofs = t->base.memBlock->ofs;
- t->BufAddr = imesa->i810Screen->tex.map + ofs;
- t->Setup[I810_TEXREG_MI3] = imesa->i810Screen->textureOffset + ofs;
-
- if (t == imesa->CurrentTexObj[0])
- I810_STATECHANGE(imesa, I810_UPLOAD_TEX0);
-
- if (t == imesa->CurrentTexObj[1])
- I810_STATECHANGE(imesa, I810_UPLOAD_TEX1);
-
- /* i810UpdateTexLRU( imesa, t );*/
- }
- driUpdateTextureLRU( (driTextureObject *) t );
-
- if (imesa->texture_heaps[0]->timestamp >= GET_DISPATCH_AGE(imesa))
- i810WaitAgeLocked( imesa, imesa->texture_heaps[0]->timestamp );
-
- numLevels = t->base.lastLevel - t->base.firstLevel + 1;
- for (i = 0 ; i < numLevels ; i++)
- if (t->base.dirty_images[0] & (1<<i))
- i810UploadTexLevel( imesa, t, i );
-
- t->base.dirty_images[0] = 0;
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texstate.c
deleted file mode 100644
index e100c565c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810texstate.c
+++ /dev/null
@@ -1,746 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810tex.h"
-#include "i810state.h"
-#include "i810ioctl.h"
-
-
-
-
-static void i810SetTexImages( i810ContextPtr imesa,
- struct gl_texture_object *tObj )
-{
- GLuint height, width, pitch, i, textureFormat, log_pitch;
- i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint numLevels;
- GLint log2Width, log2Height;
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- switch (baseImage->Format) {
- case GL_RGB:
- case GL_LUMINANCE:
- t->texelBytes = 2;
- textureFormat = MI1_FMT_16BPP | MI1_PF_16BPP_RGB565;
- break;
- case GL_ALPHA:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_RGBA:
- t->texelBytes = 2;
- textureFormat = MI1_FMT_16BPP | MI1_PF_16BPP_ARGB4444;
- break;
- case GL_COLOR_INDEX:
- textureFormat = MI1_FMT_8CI | MI1_PF_8CI_ARGB4444;
- t->texelBytes = 1;
- break;
- case GL_YCBCR_MESA:
- t->texelBytes = 2;
- textureFormat = MI1_FMT_422 | MI1_PF_422_YCRCB_SWAP_Y
- | MI1_COLOR_CONV_ENABLE;
- break;
-
- default:
- fprintf(stderr, "i810SetTexImages: bad image->Format\n" );
- return;
- }
-
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
-
- numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- width = tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes;
- for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 )
- log_pitch++;
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- for ( height = i = 0 ; i < numLevels ; i++ ) {
- t->image[i].image = tObj->Image[0][t->base.firstLevel + i];
- t->image[i].offset = height * pitch;
- t->image[i].internalFormat = baseImage->Format;
- height += t->image[i].image->Height;
- }
-
- t->Pitch = pitch;
- t->base.totalSize = height*pitch;
- t->max_level = i-1;
- t->dirty = I810_UPLOAD_TEX0 | I810_UPLOAD_TEX1;
- t->Setup[I810_TEXREG_MI1] = (MI1_MAP_0 | textureFormat | log_pitch);
- t->Setup[I810_TEXREG_MI2] = (MI2_DIMENSIONS_ARE_LOG2 |
- (log2Height << 16) | log2Width);
- t->Setup[I810_TEXREG_MLL] = (GFX_OP_MAP_LOD_LIMITS |
- MLL_MAP_0 |
- MLL_UPDATE_MAX_MIP |
- MLL_UPDATE_MIN_MIP |
- ((numLevels - 1) << MLL_MIN_MIP_SHIFT));
-
- LOCK_HARDWARE( imesa );
- i810UploadTexImagesLocked( imesa, t );
- UNLOCK_HARDWARE( imesa );
-}
-
-/* ================================================================
- * Texture combine functions
- */
-
-#define I810_DISABLE 0
-#define I810_PASSTHRU 1
-#define I810_REPLACE 2
-#define I810_MODULATE 3
-#define I810_DECAL 4
-#define I810_BLEND 5
-#define I810_ALPHA_BLEND 6
-#define I810_ADD 7
-#define I810_MAX_COMBFUNC 8
-
-
-static GLuint i810_color_combine[][I810_MAX_COMBFUNC] =
-{
- /* Unit 0:
- */
- {
- /* Disable combiner stage
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_ITERATED_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_UPDATE_OP |
- MC_OP_ARG1 ), /* actually passthru */
-
- /* Passthru
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_ITERATED_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_UPDATE_OP |
- MC_OP_ARG1 ),
-
- /* GL_REPLACE
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX0_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_UPDATE_OP |
- MC_OP_ARG1 ),
-
- /* GL_MODULATE
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX0_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ITERATED_COLOR |
- MC_UPDATE_OP |
- MC_OP_MODULATE ),
-
- /* GL_DECAL
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_COLOR_FACTOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_TEX0_COLOR |
- MC_UPDATE_OP |
- MC_OP_LIN_BLEND_TEX0_ALPHA ),
-
- /* GL_BLEND
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_COLOR_FACTOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ITERATED_COLOR |
- MC_UPDATE_OP |
- MC_OP_LIN_BLEND_TEX0_COLOR ),
-
- /* GL_BLEND according to alpha
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX0_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ITERATED_COLOR |
- MC_UPDATE_OP |
- MC_OP_LIN_BLEND_TEX0_ALPHA ),
-
- /* GL_ADD
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_0 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX0_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ITERATED_COLOR |
- MC_UPDATE_OP |
- MC_OP_ADD ),
- },
-
- /* Unit 1:
- */
- {
- /* Disable combiner stage (Note: disables all subsequent stages)
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_ONE |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_UPDATE_OP |
- MC_OP_DISABLE ),
-
-
- /* Passthru
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_CURRENT_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_UPDATE_OP |
- MC_OP_ARG1 ),
-
- /* GL_REPLACE
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX1_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_ONE |
- MC_UPDATE_OP |
- MC_OP_ARG1 ),
-
- /* GL_MODULATE
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX1_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_CURRENT_COLOR |
- MC_UPDATE_OP |
- MC_OP_MODULATE ),
-
- /* GL_DECAL
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_COLOR_FACTOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_TEX1_COLOR |
- MC_UPDATE_OP |
- MC_OP_LIN_BLEND_TEX1_ALPHA ),
-
- /* GL_BLEND
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_COLOR_FACTOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_CURRENT_COLOR |
- MC_UPDATE_OP |
- MC_OP_LIN_BLEND_TEX1_COLOR ),
-
- /* GL_BLEND according to alpha
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX1_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_CURRENT_COLOR |
- MC_UPDATE_OP |
- MC_OP_LIN_BLEND_TEX1_ALPHA ),
-
- /* GL_ADD
- */
- ( GFX_OP_MAP_COLOR_STAGES |
- MC_STAGE_1 |
- MC_UPDATE_DEST |
- MC_DEST_CURRENT |
- MC_UPDATE_ARG1 |
- MC_ARG1_TEX1_COLOR |
- MC_UPDATE_ARG2 |
- MC_ARG2_CURRENT_COLOR |
- MC_UPDATE_OP |
- MC_OP_ADD ),
- }
-};
-
-static GLuint i810_alpha_combine[][I810_MAX_COMBFUNC] =
-{
- /* Unit 0:
- */
- {
- /* Disable combiner stage
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ITERATED_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX0_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ARG1 ),
-
- /* Passthru
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ITERATED_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX0_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ARG1 ),
-
- /* GL_REPLACE
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ITERATED_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX0_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ARG2 ),
-
- /* GL_MODULATE
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ITERATED_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX0_ALPHA |
- MA_UPDATE_OP |
- MA_OP_MODULATE ),
-
- /* GL_DECAL
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ALPHA_FACTOR |
- MA_UPDATE_ARG2 |
- MA_ARG2_ALPHA_FACTOR |
- MA_UPDATE_OP |
- MA_OP_ARG1 ),
-
- /* GL_BLEND
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ALPHA_FACTOR |
- MA_UPDATE_ARG2 |
- MA_ARG2_ITERATED_ALPHA |
- MA_UPDATE_OP |
- MA_OP_LIN_BLEND_TEX0_ALPHA ),
-
- /* GL_BLEND according to alpha (same as above)
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ALPHA_FACTOR |
- MA_UPDATE_ARG2 |
- MA_ARG2_ITERATED_ALPHA |
- MA_UPDATE_OP |
- MA_OP_LIN_BLEND_TEX0_ALPHA ),
-
- /* GL_ADD
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_0 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ITERATED_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX0_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ADD ),
- },
-
- /* Unit 1:
- */
- {
- /* Disable combiner stage
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_CURRENT_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ARG1 ),
-
- /* Passthru
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_CURRENT_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ARG1 ),
-
- /* GL_REPLACE
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX1_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ARG2 ),
-
- /* GL_MODULATE
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX1_ALPHA |
- MA_UPDATE_OP |
- MA_OP_MODULATE ),
-
- /* GL_DECAL
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ALPHA_FACTOR |
- MA_UPDATE_ARG2 |
- MA_ARG2_ALPHA_FACTOR |
- MA_UPDATE_OP |
- MA_OP_ARG1 ),
-
- /* GL_BLEND
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ALPHA_FACTOR |
- MA_UPDATE_ARG2 |
- MA_ARG2_ITERATED_ALPHA |
- MA_UPDATE_OP |
- MA_OP_LIN_BLEND_TEX1_ALPHA ),
-
- /* GL_BLEND according to alpha (same as above)
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_ALPHA_FACTOR |
- MA_UPDATE_ARG2 |
- MA_ARG2_ITERATED_ALPHA |
- MA_UPDATE_OP |
- MA_OP_LIN_BLEND_TEX1_ALPHA ),
-
- /* GL_ADD
- */
- ( GFX_OP_MAP_ALPHA_STAGES |
- MA_STAGE_1 |
- MA_UPDATE_ARG1 |
- MA_ARG1_CURRENT_ALPHA |
- MA_UPDATE_ARG2 |
- MA_ARG2_TEX1_ALPHA |
- MA_UPDATE_OP |
- MA_OP_ADD ),
- }
-
-};
-
-
-
-static void i810UpdateTexEnv( GLcontext *ctx, GLuint unit )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = texUnit->_Current;
- const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
- GLuint color_combine, alpha_combine;
-
- switch (texUnit->EnvMode) {
- case GL_REPLACE:
- if (format == GL_ALPHA) {
- color_combine = i810_color_combine[unit][I810_PASSTHRU];
- alpha_combine = i810_alpha_combine[unit][I810_REPLACE];
- } else if (format == GL_LUMINANCE || format == GL_RGB) {
- color_combine = i810_color_combine[unit][I810_REPLACE];
- alpha_combine = i810_alpha_combine[unit][I810_PASSTHRU];
- } else {
- color_combine = i810_color_combine[unit][I810_REPLACE];
- alpha_combine = i810_alpha_combine[unit][I810_REPLACE];
- }
- break;
-
- case GL_MODULATE:
- if (format == GL_ALPHA) {
- color_combine = i810_color_combine[unit][I810_PASSTHRU];
- alpha_combine = i810_alpha_combine[unit][I810_MODULATE];
- } else {
- color_combine = i810_color_combine[unit][I810_MODULATE];
- alpha_combine = i810_alpha_combine[unit][I810_MODULATE];
- }
- break;
-
- case GL_DECAL:
- switch (format) {
- case GL_RGBA:
- color_combine = i810_color_combine[unit][I810_ALPHA_BLEND];
- alpha_combine = i810_alpha_combine[unit][I810_PASSTHRU];
- break;
- case GL_RGB:
- color_combine = i810_color_combine[unit][I810_REPLACE];
- alpha_combine = i810_alpha_combine[unit][I810_PASSTHRU];
- break;
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- color_combine = i810_color_combine[unit][I810_PASSTHRU];
- alpha_combine = i810_alpha_combine[unit][I810_PASSTHRU];
- break;
- case GL_COLOR_INDEX:
- default:
- return;
- }
- break;
-
- case GL_BLEND:
- switch (format) {
- case GL_RGB:
- case GL_LUMINANCE:
- color_combine = i810_color_combine[unit][I810_BLEND];
- alpha_combine = i810_alpha_combine[unit][I810_PASSTHRU];
- break;
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- color_combine = i810_color_combine[unit][I810_BLEND];
- alpha_combine = i810_alpha_combine[unit][I810_MODULATE];
- break;
- case GL_ALPHA:
- color_combine = i810_color_combine[unit][I810_PASSTHRU];
- alpha_combine = i810_alpha_combine[unit][I810_MODULATE];
- break;
- case GL_INTENSITY:
- color_combine = i810_color_combine[unit][I810_BLEND];
- alpha_combine = i810_alpha_combine[unit][I810_BLEND];
- break;
- case GL_COLOR_INDEX:
- default:
- return;
- }
- break;
-
- case GL_ADD:
- switch (format) {
- case GL_RGB:
- case GL_LUMINANCE:
- color_combine = i810_color_combine[unit][I810_ADD];
- alpha_combine = i810_alpha_combine[unit][I810_PASSTHRU];
- break;
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- color_combine = i810_color_combine[unit][I810_ADD];
- alpha_combine = i810_alpha_combine[unit][I810_MODULATE];
- break;
- case GL_ALPHA:
- color_combine = i810_color_combine[unit][I810_PASSTHRU];
- alpha_combine = i810_alpha_combine[unit][I810_MODULATE];
- break;
- case GL_INTENSITY:
- color_combine = i810_color_combine[unit][I810_ADD];
- alpha_combine = i810_alpha_combine[unit][I810_ADD];
- break;
- case GL_COLOR_INDEX:
- default:
- return;
- }
- break;
-
- default:
- return;
- }
-
- if (alpha_combine != imesa->Setup[I810_CTXREG_MA0 + unit] ||
- color_combine != imesa->Setup[I810_CTXREG_MC0 + unit])
- {
- I810_STATECHANGE( imesa, I810_UPLOAD_CTX );
- imesa->Setup[I810_CTXREG_MA0 + unit] = alpha_combine;
- imesa->Setup[I810_CTXREG_MC0 + unit] = color_combine;
- }
-}
-
-
-
-
-static void i810UpdateTexUnit( GLcontext *ctx, GLuint unit )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT)
- {
- struct gl_texture_object *tObj = texUnit->_Current;
- i810TextureObjectPtr t = (i810TextureObjectPtr)tObj->DriverData;
-
- /* Upload teximages (not pipelined)
- */
- if (t->base.dirty_images[0]) {
- I810_FIREVERTICES(imesa);
- i810SetTexImages( imesa, tObj );
- if (!t->base.memBlock) {
- FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
- }
-
- if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
- FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if (imesa->CurrentTexObj[unit] != t) {
- I810_STATECHANGE(imesa, (I810_UPLOAD_TEX0<<unit));
- imesa->CurrentTexObj[unit] = t;
- t->base.bound |= (1U << unit);
-
- driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked */
-
- }
-
- /* Update texture environment if texture object image format or
- * texture environment state has changed.
- */
- if (tObj->Image[0][tObj->BaseLevel]->Format != imesa->TexEnvImageFmt[unit]) {
- imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
- i810UpdateTexEnv( ctx, unit );
- }
- }
- else if (texUnit->_ReallyEnabled) {
- FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
- }
- else /*if (imesa->CurrentTexObj[unit])*/ {
- imesa->CurrentTexObj[unit] = 0;
- imesa->TexEnvImageFmt[unit] = 0;
- imesa->dirty &= ~(I810_UPLOAD_TEX0<<unit);
- imesa->Setup[I810_CTXREG_MA0 + unit] =
- i810_alpha_combine[unit][I810_DISABLE];
- imesa->Setup[I810_CTXREG_MC0 + unit] =
- i810_color_combine[unit][I810_DISABLE];
- I810_STATECHANGE( imesa, I810_UPLOAD_CTX );
- }
-}
-
-
-void i810UpdateTextureState( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- /* fprintf(stderr, "%s\n", __FUNCTION__); */
- FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_FALSE );
- i810UpdateTexUnit( ctx, 0 );
- i810UpdateTexUnit( ctx, 1 );
-}
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.c
deleted file mode 100644
index 3e09427bb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.c
+++ /dev/null
@@ -1,871 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.c,v 1.7 2002/10/30 12:51:33 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "enums.h"
-#include "colormac.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810tris.h"
-#include "i810state.h"
-#include "i810vb.h"
-#include "i810ioctl.h"
-
-static void i810RenderPrimitive( GLcontext *ctx, GLenum prim );
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertsize), \
- "D" ((long)vb), \
- "S" ((long)v) ); \
-} while (0)
-#else
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- for ( j = 0 ; j < vertsize ; j++ ) \
- vb[j] = ((GLuint *)v)[j]; \
- vb += vertsize; \
-} while (0)
-#endif
-
-static __inline__ void i810_draw_triangle( i810ContextPtr imesa,
- i810VertexPtr v0,
- i810VertexPtr v1,
- i810VertexPtr v2 )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i810AllocDmaLow( imesa, 3 * 4 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
-}
-
-
-static __inline__ void i810_draw_quad( i810ContextPtr imesa,
- i810VertexPtr v0,
- i810VertexPtr v1,
- i810VertexPtr v2,
- i810VertexPtr v3 )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i810AllocDmaLow( imesa, 6 * 4 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v3 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
- COPY_DWORDS( j, vb, vertsize, v3 );
-}
-
-
-static __inline__ void i810_draw_point( i810ContextPtr imesa,
- i810VertexPtr tmp )
-{
- GLfloat sz = imesa->glCtx->Point._Size * .5;
- int vertsize = imesa->vertex_size;
- GLuint *vb = i810AllocDmaLow( imesa, 2 * 4 * vertsize );
- int j;
-
- /* Draw a point as a horizontal line.
- */
- *(float *)&vb[0] = tmp->v.x - sz + 0.125;
- for (j = 1 ; j < vertsize ; j++)
- vb[j] = tmp->ui[j];
- vb += vertsize;
-
- *(float *)&vb[0] = tmp->v.x + sz + 0.125;
- for (j = 1 ; j < vertsize ; j++)
- vb[j] = tmp->ui[j];
- vb += vertsize;
-}
-
-
-static __inline__ void i810_draw_line( i810ContextPtr imesa,
- i810VertexPtr v0,
- i810VertexPtr v1 )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i810AllocDmaLow( imesa, 2 * 4 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
-}
-
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (0) fprintf(stderr, "hw TRI\n"); \
- if (DO_FALLBACK) \
- imesa->draw_tri( imesa, a, b, c ); \
- else \
- i810_draw_triangle( imesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (0) fprintf(stderr, "hw QUAD\n"); \
- if (DO_FALLBACK) { \
- imesa->draw_tri( imesa, a, b, d ); \
- imesa->draw_tri( imesa, b, c, d ); \
- } else \
- i810_draw_quad( imesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (0) fprintf(stderr, "hw LINE\n"); \
- if (DO_FALLBACK) \
- imesa->draw_line( imesa, v0, v1 ); \
- else \
- i810_draw_line( imesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (0) fprintf(stderr, "hw POINT\n"); \
- if (DO_FALLBACK) \
- imesa->draw_point( imesa, v0 ); \
- else \
- i810_draw_point( imesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define I810_OFFSET_BIT 0x01
-#define I810_TWOSIDE_BIT 0x02
-#define I810_UNFILLED_BIT 0x04
-#define I810_FALLBACK_BIT 0x08
-#define I810_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[I810_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & I810_FALLBACK_BIT)
-#define DO_OFFSET (IND & I810_OFFSET_BIT)
-#define DO_UNFILLED (IND & I810_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & I810_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX i810Vertex
-#define TAB rast_tab
-
-
-#define DEPTH_SCALE (1.0/0xffff)
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (imesa->verts + (e * imesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- i810_color_t *color = (i810_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v0, c ) \
-do { \
- if (havespec) { \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (havespec) { \
- v0->v.specular.red = v1->v.specular.red; \
- v0->v.specular.green = v1->v.specular.green; \
- v0->v.specular.blue = v1->v.specular.blue; \
- } \
-} while (0)
-
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
-
-#define LOCAL_VARS(n) \
- i810ContextPtr imesa = I810_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = (imesa->vertex_size == 4 ? 3 : 4); \
- GLboolean havespec = (imesa->vertex_size > 4); \
- (void) color; (void) spec; (void) coloroffset; (void) havespec;
-
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- PR_LINES,
- PR_LINES,
- PR_LINES,
- PR_LINES,
- PR_TRIANGLES,
- PR_TRIANGLES,
- PR_TRIANGLES,
- PR_TRIANGLES,
- PR_TRIANGLES,
- PR_TRIANGLES
-};
-
-#define RASTERIZE(x) if (imesa->hw_primitive != hw_prim[x]) \
- i810RasterPrimitive( ctx, x, hw_prim[x] )
-#define RENDER_PRIMITIVE imesa->render_primitive
-#define TAG(x) x
-#define IND I810_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_OFFSET_BIT|I810_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT|I810_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_OFFSET_BIT|I810_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT|I810_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_UNFILLED_BIT|I810_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_OFFSET_BIT|I810_UNFILLED_BIT|I810_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_UNFILLED_BIT|I810_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I810_TWOSIDE_BIT|I810_OFFSET_BIT|I810_UNFILLED_BIT| \
- I810_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-i810_fallback_tri( i810ContextPtr imesa,
- i810Vertex *v0,
- i810Vertex *v1,
- i810Vertex *v2 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[3];
- i810_translate_vertex( ctx, v0, &v[0] );
- i810_translate_vertex( ctx, v1, &v[1] );
- i810_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-i810_fallback_line( i810ContextPtr imesa,
- i810Vertex *v0,
- i810Vertex *v1 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[2];
- i810_translate_vertex( ctx, v0, &v[0] );
- i810_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-i810_fallback_point( i810ContextPtr imesa,
- i810Vertex *v0 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[1];
- i810_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define IND 0
-#define V(x) (i810Vertex *)(vertptr + ((x)*vertsize*sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) POINT( V(ELT(start)) );
-#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) )
-#define RENDER_TRI( v0, v1, v2 ) TRI( V(v0), V(v1), V(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) QUAD( V(v0), V(v1), V(v2), V(v3) )
-#define INIT(x) i810RenderPrimitive( ctx, x )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- i810ContextPtr imesa = I810_CONTEXT(ctx); \
- GLubyte *vertptr = (GLubyte *)imesa->verts; \
- const GLuint vertsize = imesa->vertex_size; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) x
-#define TAG(x) i810_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) i810_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void i810RenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint prim = imesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n,
- PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void i810RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-static void i810FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i810AllocDmaLow( imesa, (n-2) * 3 * 4 * vertsize );
- GLubyte *vertptr = (GLubyte *)imesa->verts;
- const GLuint *start = (const GLuint *)V(elts[0]);
- int i,j;
-
- for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, V(elts[i-1]) );
- COPY_DWORDS( j, vb, vertsize, V(elts[i]) );
- COPY_DWORDS( j, vb, vertsize, start );
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-
-#define _I810_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_POLYGONSTIPPLE)
-
-#define POINT_FALLBACK (0)
-#define LINE_FALLBACK (DD_LINE_STIPPLE)
-#define TRI_FALLBACK (0)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK|\
- DD_TRI_STIPPLE)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-static void i810ChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (I810_DEBUG & DEBUG_STATE)
- fprintf(stderr,"\n%s\n",__FUNCTION__);
-
- if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) {
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= I810_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= I810_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= I810_UNFILLED_BIT;
- }
-
- imesa->draw_point = i810_draw_point;
- imesa->draw_line = i810_draw_line;
- imesa->draw_tri = i810_draw_triangle;
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & ANY_FALLBACK_FLAGS)
- {
- if (flags & POINT_FALLBACK)
- imesa->draw_point = i810_fallback_point;
-
- if (flags & LINE_FALLBACK)
- imesa->draw_line = i810_fallback_line;
-
- if (flags & TRI_FALLBACK)
- imesa->draw_tri = i810_fallback_tri;
-
- if ((flags & DD_TRI_STIPPLE) && !imesa->stipple_in_hw)
- imesa->draw_tri = i810_fallback_tri;
-
- index |= I810_FALLBACK_BIT;
- }
- }
-
- if (imesa->RenderIndex != index) {
- imesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = i810_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = i810_render_tab_elts;
- tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */
- tnl->Driver.Render.ClippedPolygon = i810FastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = i810RenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = i810RenderClippedPoly;
- }
- }
-}
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in i810render.c.
- */
-static void i810RenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- imesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (imesa->reduced_primitive != rprim ||
- hw_prim[prim] != imesa->hw_primitive) {
- i810RasterPrimitive( ctx, rprim, hw_prim[prim] );
- }
-}
-
-static void i810RunPipeline( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
-
- if (imesa->new_state) {
- if (imesa->new_state & _NEW_TEXTURE)
- i810UpdateTextureState( ctx ); /* may modify imesa->new_state */
-
- if (!imesa->Fallback) {
- if (imesa->new_state & _I810_NEW_VERTEX)
- i810ChooseVertexState( ctx );
-
- if (imesa->new_state & _I810_NEW_RENDERSTATE)
- i810ChooseRenderState( ctx );
- }
-
- imesa->new_state = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-static void i810RenderStart( GLcontext *ctx )
-{
- /* Check for projective textureing. Make sure all texcoord
- * pointers point to something. (fix in mesa?)
- */
- i810CheckTexSizes( ctx );
-}
-
-static void i810RenderFinish( GLcontext *ctx )
-{
- if (I810_CONTEXT(ctx)->RenderIndex & I810_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-
-
-/* System to flush dma and emit state changes based on the rasterized
- * primitive.
- */
-void i810RasterPrimitive( GLcontext *ctx,
- GLenum rprim,
- GLuint hwprim )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint st1 = imesa->Setup[I810_CTXREG_ST1];
- GLuint aa = imesa->Setup[I810_CTXREG_AA];
- GLuint lcs = imesa->Setup[I810_CTXREG_LCS];
-
- st1 &= ~ST1_ENABLE;
- aa &= ~AA_ENABLE;
-
- if (I810_DEBUG & DEBUG_PRIMS) {
- /* Prints reduced prim, and hw prim */
- char *prim_name = "Unknown";
-
- switch(hwprim) {
- case PR_LINES:
- prim_name = "Lines";
- break;
- case PR_LINESTRIP:
- prim_name = "LineStrip";
- break;
- case PR_TRIANGLES:
- prim_name = "Triangles";
- break;
- case PR_TRISTRIP_0:
- prim_name = "TriStrip_0";
- break;
- case PR_TRIFAN:
- prim_name = "TriFan";
- break;
- case PR_POLYGON:
- prim_name = "Polygons";
- break;
- default:
- break;
- }
-
- fprintf(stderr, "%s : rprim(%s), hwprim(%s)\n",
- __FUNCTION__,
- _mesa_lookup_enum_by_nr(rprim),
- prim_name);
- }
-
- switch (rprim) {
- case GL_TRIANGLES:
- if (ctx->Polygon.StippleFlag)
- st1 |= ST1_ENABLE;
- if (ctx->Polygon.SmoothFlag)
- aa |= AA_ENABLE;
- break;
- case GL_LINES:
- lcs &= ~(LCS_LINEWIDTH_3_0|LCS_LINEWIDTH_0_5);
- lcs |= imesa->LcsLineWidth;
- if (ctx->Line.SmoothFlag) {
- aa |= AA_ENABLE;
- lcs |= LCS_LINEWIDTH_0_5;
- }
- break;
- case GL_POINTS:
- lcs &= ~(LCS_LINEWIDTH_3_0|LCS_LINEWIDTH_0_5);
- lcs |= imesa->LcsPointSize;
- if (ctx->Point.SmoothFlag) {
- aa |= AA_ENABLE;
- lcs |= LCS_LINEWIDTH_0_5;
- }
- break;
- default:
- return;
- }
-
- imesa->reduced_primitive = rprim;
-
- if (st1 != imesa->Setup[I810_CTXREG_ST1] ||
- aa != imesa->Setup[I810_CTXREG_AA] ||
- lcs != imesa->Setup[I810_CTXREG_LCS])
- {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->hw_primitive = hwprim;
- imesa->Setup[I810_CTXREG_LCS] = lcs;
- imesa->Setup[I810_CTXREG_ST1] = st1;
- imesa->Setup[I810_CTXREG_AA] = aa;
- }
- else if (hwprim != imesa->hw_primitive) {
- I810_STATECHANGE(imesa, 0);
- imesa->hw_primitive = hwprim;
- }
-}
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-static char *fallbackStrings[] = {
- "Texture",
- "Draw buffer",
- "Read buffer",
- "Color mask",
- "Render mode",
- "Stencil",
- "Stipple",
- "User disable"
-};
-
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-void i810Fallback( i810ContextPtr imesa, GLuint bit, GLboolean mode )
-{
- GLcontext *ctx = imesa->glCtx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = imesa->Fallback;
-
- if (0) fprintf(stderr, "%s old %x bit %x mode %d\n", __FUNCTION__,
- imesa->Fallback, bit, mode );
-
- if (mode) {
- imesa->Fallback |= bit;
- if (oldfallback == 0) {
- I810_FIREVERTICES(imesa);
- if (I810_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "ENTER FALLBACK %s\n", getFallbackString( bit ));
- _swsetup_Wakeup( ctx );
- imesa->RenderIndex = ~0;
- }
- }
- else {
- imesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- if (I810_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString( bit ));
- tnl->Driver.Render.Start = i810RenderStart;
- tnl->Driver.Render.PrimitiveNotify = i810RenderPrimitive;
- tnl->Driver.Render.Finish = i810RenderFinish;
- tnl->Driver.Render.BuildVertices = i810BuildVertices;
- imesa->new_state |= (_I810_NEW_RENDERSTATE|_I810_NEW_VERTEX);
- }
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-
-void i810InitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = i810RunPipeline;
- tnl->Driver.Render.Start = i810RenderStart;
- tnl->Driver.Render.Finish = i810RenderFinish;
- tnl->Driver.Render.PrimitiveNotify = i810RenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = i810BuildVertices;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.h
deleted file mode 100644
index 06c8b3fcd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810tris.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.h,v 1.10 2002/02/22 21:33:04 dawes Exp $ */
-
-#ifndef I810TRIS_INC
-#define I810TRIS_INC
-
-#include "mtypes.h"
-
-extern void i810PrintRenderState( const char *msg, GLuint state );
-extern void i810InitTriFuncs( GLcontext *ctx );
-extern void i810RasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.c
deleted file mode 100644
index 5ce98a991..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.c,v 1.13 2003/03/26 20:43:48 tsi Exp $ */
-
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-
-#include "i810screen.h"
-#include "i810_dri.h"
-
-#include "i810context.h"
-#include "i810vb.h"
-#include "i810ioctl.h"
-#include "i810tris.h"
-#include "i810state.h"
-
-
-#define I810_TEX1_BIT 0x1
-#define I810_TEX0_BIT 0x2
-#define I810_RGBA_BIT 0x4
-#define I810_SPEC_BIT 0x8
-#define I810_FOG_BIT 0x10
-#define I810_XYZW_BIT 0x20
-#define I810_PTEX_BIT 0x40
-#define I810_MAX_SETUP 0x80
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_size;
- GLuint vertex_format;
-} setup_tab[I810_MAX_SETUP];
-
-#define TINY_VERTEX_FORMAT (GFX_OP_VERTEX_FMT | \
- VF_TEXCOORD_COUNT_0 | \
- VF_RGBA_ENABLE | \
- VF_XYZ)
-
-#define NOTEX_VERTEX_FORMAT (GFX_OP_VERTEX_FMT | \
- VF_TEXCOORD_COUNT_0 | \
- VF_SPEC_FOG_ENABLE | \
- VF_RGBA_ENABLE | \
- VF_XYZW)
-
-#define TEX0_VERTEX_FORMAT (GFX_OP_VERTEX_FMT | \
- VF_TEXCOORD_COUNT_1 | \
- VF_SPEC_FOG_ENABLE | \
- VF_RGBA_ENABLE | \
- VF_XYZW)
-
-#define TEX1_VERTEX_FORMAT (GFX_OP_VERTEX_FMT | \
- VF_TEXCOORD_COUNT_2 | \
- VF_SPEC_FOG_ENABLE | \
- VF_RGBA_ENABLE | \
- VF_XYZW)
-
-#define PROJ_TEX1_VERTEX_FORMAT 0
-#define TEX2_VERTEX_FORMAT 0
-#define TEX3_VERTEX_FORMAT 0
-#define PROJ_TEX3_VERTEX_FORMAT 0
-
-#define DO_XYZW (IND & I810_XYZW_BIT)
-#define DO_RGBA (IND & I810_RGBA_BIT)
-#define DO_SPEC (IND & I810_SPEC_BIT)
-#define DO_FOG (IND & I810_FOG_BIT)
-#define DO_TEX0 (IND & I810_TEX0_BIT)
-#define DO_TEX1 (IND & I810_TEX1_BIT)
-#define DO_TEX2 0
-#define DO_TEX3 0
-#define DO_PTEX (IND & I810_PTEX_BIT)
-
-#define VERTEX i810Vertex
-#define VERTEX_COLOR i810_color_t
-#define GET_VIEWPORT_MAT() I810_CONTEXT(ctx)->ViewportMatrix.m
-#define GET_TEXSOURCE(n) n
-#define GET_VERTEX_FORMAT() I810_CONTEXT(ctx)->Setup[I810_CTXREG_VF]
-#define GET_VERTEX_STORE() I810_CONTEXT(ctx)->verts
-#define GET_VERTEX_SIZE() I810_CONTEXT(ctx)->vertex_size * sizeof(GLuint)
-#define INVALIDATE_STORED_VERTICES()
-
-#define HAVE_HW_VIEWPORT 0
-#define HAVE_HW_DIVIDE 0
-#define HAVE_RGBA_COLOR 0
-#define HAVE_TINY_VERTICES 1
-#define HAVE_NOTEX_VERTICES 1
-#define HAVE_TEX0_VERTICES 1
-#define HAVE_TEX1_VERTICES 1
-#define HAVE_TEX2_VERTICES 0
-#define HAVE_TEX3_VERTICES 0
-#define HAVE_PTEX_VERTICES 0
-
-#define UNVIEWPORT_VARS GLfloat h = I810_CONTEXT(ctx)->driDrawable->h
-#define UNVIEWPORT_X(x) x - SUBPIXEL_X
-#define UNVIEWPORT_Y(y) - y + h + SUBPIXEL_Y
-#define UNVIEWPORT_Z(z) z * (float)0xffff
-
-#define PTEX_FALLBACK() FALLBACK(I810_CONTEXT(ctx), I810_FALLBACK_TEXTURE, 1)
-
-#define INTERP_VERTEX setup_tab[I810_CONTEXT(ctx)->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[I810_CONTEXT(ctx)->SetupIndex].copy_pv
-
-
-/***********************************************************************
- * Generate pv-copying and translation functions *
- ***********************************************************************/
-
-#define TAG(x) i810_##x
-#include "tnl_dd/t_dd_vb.c"
-
-/***********************************************************************
- * Generate vertex emit and interp functions *
- ***********************************************************************/
-
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_SPEC_BIT)
-#define TAG(x) x##_wgs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_wgt0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_TEX0_BIT|I810_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_SPEC_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_wgst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_SPEC_BIT|I810_TEX0_BIT|\
- I810_TEX1_BIT)
-#define TAG(x) x##_wgst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_SPEC_BIT|I810_TEX0_BIT|\
- I810_PTEX_BIT)
-#define TAG(x) x##_wgspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT)
-#define TAG(x) x##_wgfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_TEX0_BIT|\
- I810_TEX1_BIT)
-#define TAG(x) x##_wgft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_TEX0_BIT|\
- I810_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT|\
- I810_TEX0_BIT)
-#define TAG(x) x##_wgfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT|\
- I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_wgfst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_XYZW_BIT|I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT|\
- I810_TEX0_BIT|I810_PTEX_BIT)
-#define TAG(x) x##_wgfspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_t0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_FOG_BIT)
-#define TAG(x) x##_f
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_FOG_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_ft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_FOG_BIT|I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_ft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT)
-#define TAG(x) x##_g
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_SPEC_BIT)
-#define TAG(x) x##_gs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_gt0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_SPEC_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_gst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_SPEC_BIT|I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_gst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_FOG_BIT)
-#define TAG(x) x##_gf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT)
-#define TAG(x) x##_gfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_FOG_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_FOG_BIT|I810_TEX0_BIT|I810_TEX1_BIT)
-#define TAG(x) x##_gft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT|I810_TEX0_BIT)
-#define TAG(x) x##_gfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (I810_RGBA_BIT|I810_FOG_BIT|I810_SPEC_BIT|I810_TEX0_BIT|\
- I810_TEX1_BIT)
-#define TAG(x) x##_gfst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wgs();
- init_wgt0();
- init_wgt0t1();
- init_wgpt0();
- init_wgst0();
- init_wgst0t1();
- init_wgspt0();
- init_wgf();
- init_wgfs();
- init_wgft0();
- init_wgft0t1();
- init_wgfpt0();
- init_wgfst0();
- init_wgfst0t1();
- init_wgfspt0();
- init_t0();
- init_t0t1();
- init_f();
- init_ft0();
- init_ft0t1();
- init_g();
- init_gs();
- init_gt0();
- init_gt0t1();
- init_gst0();
- init_gst0t1();
- init_gf();
- init_gfs();
- init_gft0();
- init_gft0t1();
- init_gfst0();
- init_gfst0t1();
-}
-
-
-
-static void i810PrintSetupFlags(const char *msg, GLuint flags )
-{
- fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & I810_XYZW_BIT) ? " xyzw," : "",
- (flags & I810_RGBA_BIT) ? " rgba," : "",
- (flags & I810_SPEC_BIT) ? " spec," : "",
- (flags & I810_FOG_BIT) ? " fog," : "",
- (flags & I810_TEX0_BIT) ? " tex-0," : "",
- (flags & I810_TEX1_BIT) ? " tex-1," : "");
-}
-
-
-
-void i810CheckTexSizes( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- i810ContextPtr imesa = I810_CONTEXT( ctx );
-
- if (!setup_tab[imesa->SetupIndex].check_tex_sizes(ctx)) {
- /* Invalidate stored verts
- */
- imesa->SetupNewInputs = ~0;
- imesa->SetupIndex |= I810_PTEX_BIT;
-
- if (!imesa->Fallback &&
- !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[imesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[imesa->SetupIndex].copy_pv;
- }
- if (imesa->Fallback) {
- tnl->Driver.Render.Start(ctx);
- }
- }
-}
-
-void i810BuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLuint stride = imesa->vertex_size * sizeof(int);
- GLubyte *v = ((GLubyte *)imesa->verts + (start * stride));
-
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- newinputs |= imesa->SetupNewInputs;
- imesa->SetupNewInputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[imesa->SetupIndex].emit( ctx, start, count, v, stride );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= I810_RGBA_BIT;
-
- if (newinputs & VERT_BIT_COLOR1)
- ind |= I810_SPEC_BIT;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= I810_TEX0_BIT;
-
- if (newinputs & VERT_BIT_TEX1)
- ind |= I810_TEX1_BIT;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= I810_FOG_BIT;
-
- if (imesa->SetupIndex & I810_PTEX_BIT)
- ind = ~0;
-
- ind &= imesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
- }
- }
-}
-
-void i810ChooseVertexState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLuint ind = I810_XYZW_BIT|I810_RGBA_BIT;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- ind |= I810_SPEC_BIT;
-
- if (ctx->Fog.Enabled)
- ind |= I810_FOG_BIT;
-
- if (ctx->Texture._EnabledUnits & 0x2)
- /* unit 1 enabled */
- ind |= I810_TEX1_BIT|I810_TEX0_BIT;
- else if (ctx->Texture._EnabledUnits & 0x1)
- /* unit 0 enabled */
- ind |= I810_TEX0_BIT;
-
- imesa->SetupIndex = ind;
-
- if (I810_DEBUG & (DEBUG_VERTS|DEBUG_STATE))
- i810PrintSetupFlags( __FUNCTION__, ind );
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = i810_interp_extras;
- tnl->Driver.Render.CopyPV = i810_copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-
- if (setup_tab[ind].vertex_format != imesa->Setup[I810_CTXREG_VF]) {
- I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
- imesa->Setup[I810_CTXREG_VF] = setup_tab[ind].vertex_format;
- imesa->vertex_size = setup_tab[ind].vertex_size;
- }
-}
-
-
-
-void *i810_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count,
- void *dest )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint stride = imesa->vertex_size * 4;
- setup_tab[imesa->SetupIndex].emit( ctx, start, count, dest, stride );
- return (void *)((char *)dest + stride * (count - start));
-}
-
-
-
-void i810InitVB( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- imesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
- }
-}
-
-
-void i810FreeVB( GLcontext *ctx )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- if (imesa->verts) {
- ALIGN_FREE(imesa->verts);
- imesa->verts = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.h
deleted file mode 100644
index 1cced86ab..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/i810vb.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.h,v 1.4 2002/02/22 21:33:04 dawes Exp $ */
-
-#ifndef I810VB_INC
-#define I810VB_INC
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-
-#define _I810_NEW_VERTEX (_NEW_TEXTURE | \
- _DD_NEW_SEPARATE_SPECULAR | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _NEW_FOG)
-
-
-extern void i810ChooseVertexState( GLcontext *ctx );
-extern void i810CheckTexSizes( GLcontext *ctx );
-extern void i810BuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs );
-
-
-extern void *i810_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count,
- void *dest );
-
-extern void i810_translate_vertex( GLcontext *ctx,
- const i810Vertex *src,
- SWvertex *dst );
-
-extern void i810InitVB( GLcontext *ctx );
-extern void i810FreeVB( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_common.h
deleted file mode 100644
index 02e548be0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_common.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/* i810_common.h -- common header definitions for I810 2D/3D/DRM suite
- *
- * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * 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.
- *
- * Converted to common header format:
- * Jens Owen <jens@tungstengraphics.com>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_common.h,v 1.1 2002/09/11 00:29:31 dawes Exp $
- *
- */
-
-/* WARNING: If you change any of these defines, make sure to change
- * the kernel include file as well (i810_drm.h)
- */
-
-#ifndef _I810_COMMON_H_
-#define _I810_COMMON_H_
-
-#ifndef _I810_DEFINES_
-#define _I810_DEFINES_
-#define I810_USE_BATCH 1
-
-#define I810_DMA_BUF_ORDER 12
-#define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
-#define I810_DMA_BUF_NR 256
-
-#define I810_NR_SAREA_CLIPRECTS 8
-
-/* Each region is a minimum of 64k, and there are at most 64 of them.
- */
-#define I810_NR_TEX_REGIONS 64
-#define I810_LOG_MIN_TEX_REGION_SIZE 16
-
-/* Destbuffer state
- * - backbuffer linear offset and pitch -- invarient in the current dri
- * - zbuffer linear offset and pitch -- also invarient
- * - drawing origin in back and depth buffers.
- *
- * Keep the depth/back buffer state here to acommodate private buffers
- * in the future.
- */
-#define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
-#define I810_DESTREG_DI1 1
-#define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
-#define I810_DESTREG_DV1 3
-#define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */
-#define I810_DESTREG_DR1 5
-#define I810_DESTREG_DR2 6
-#define I810_DESTREG_DR3 7
-#define I810_DESTREG_DR4 8
-#define I810_DEST_SETUP_SIZE 10
-
-/* Context state
- */
-#define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */
-#define I810_CTXREG_CF1 1
-#define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */
-#define I810_CTXREG_ST1 3
-#define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */
-#define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */
-#define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
-#define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
-#define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
-#define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
-#define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
-#define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
-#define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */
-#define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */
-#define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */
-#define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */
-#define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
-#define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */
-#define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */
-#define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */
-#define I810_CTX_SETUP_SIZE 20
-
-/* Texture state (per tex unit)
- */
-#define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */
-#define I810_TEXREG_MI1 1
-#define I810_TEXREG_MI2 2
-#define I810_TEXREG_MI3 3
-#define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */
-#define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */
-#define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */
-#define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */
-#define I810_TEX_SETUP_SIZE 8
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_I810_INIT 0x00
-#define DRM_I810_VERTEX 0x01
-#define DRM_I810_CLEAR 0x02
-#define DRM_I810_FLUSH 0x03
-#define DRM_I810_GETAGE 0x04
-#define DRM_I810_GETBUF 0x05
-#define DRM_I810_SWAP 0x06
-#define DRM_I810_COPY 0x07
-#define DRM_I810_DOCOPY 0x08
-#define DRM_I810_OV0INFO 0x09
-#define DRM_I810_FSTATUS 0x0a
-#define DRM_I810_OV0FLIP 0x0b
-#define DRM_I810_MC 0x0c
-#define DRM_I810_RSTATUS 0x0d
-#define DRM_I810_FLIP 0x0e
-
-#endif
-
-typedef enum _drmI810Initfunc {
- I810_INIT_DMA = 0x01,
- I810_CLEANUP_DMA = 0x02,
- I810_INIT_DMA_1_4 = 0x03
-} drmI810Initfunc;
-
-typedef struct {
- drmI810Initfunc func;
- unsigned int mmio_offset;
- unsigned int buffers_offset;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int overlay_offset;
- unsigned int overlay_physical;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
-} drmI810Init;
-
-typedef struct {
- void *virtual;
- int request_idx;
- int request_size;
- int granted;
-} drmI810DMA;
-
-/* Flags for clear ioctl
- */
-#define I810_FRONT 0x1
-#define I810_BACK 0x2
-#define I810_DEPTH 0x4
-
-typedef struct {
- int clear_color;
- int clear_depth;
- int flags;
-} drmI810Clear;
-
-typedef struct {
- int idx; /* buffer index */
- int used; /* nr bytes in use */
- int discard; /* client is finished with the buffer? */
-} drmI810Vertex;
-
-/* Flags for vertex ioctl
- */
-#define PR_TRIANGLES (0x0<<18)
-#define PR_TRISTRIP_0 (0x1<<18)
-#define PR_TRISTRIP_1 (0x2<<18)
-#define PR_TRIFAN (0x3<<18)
-#define PR_POLYGON (0x4<<18)
-#define PR_LINES (0x5<<18)
-#define PR_LINESTRIP (0x6<<18)
-#define PR_RECTS (0x7<<18)
-#define PR_MASK (0x7<<18)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.c
deleted file mode 100644
index f52797c5e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.c
+++ /dev/null
@@ -1,975 +0,0 @@
-/**
- * \file server/i810_dri.c
- * \brief File to perform the device-specific initialization tasks typically
- * done in the X server.
- *
- * Here they are converted to run in the client (or perhaps a standalone
- * process), and to work with the frame buffer device rather than the X
- * server infrastructure.
- *
- * Copyright (C) 2004 Dave Airlie (airlied@linux.ie)
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include "driver.h"
-#include "drm.h"
-
-#include "i810.h"
-#include "i810_dri.h"
-#include "i810_reg.h"
-
-
-static int i810_pitches[] = {
- 512,
- 1024,
- 2048,
- 4096,
- 0
-};
-
-static int i810_pitch_flags[] = {
- 0x0,
- 0x1,
- 0x2,
- 0x3,
- 0
-};
-
-static unsigned int i810_drm_version = 0;
-
-static int
-I810AllocLow(I810MemRange * result, I810MemRange * pool, int size)
-{
- if (size > pool->Size)
- return 0;
-
- pool->Size -= size;
- result->Size = size;
- result->Start = pool->Start;
- result->End = pool->Start += size;
-
- return 1;
-}
-
-static int
-I810AllocHigh(I810MemRange * result, I810MemRange * pool, int size)
-{
- if (size > pool->Size)
- return 0;
-
- pool->Size -= size;
- result->Size = size;
- result->End = pool->End;
- result->Start = pool->End -= size;
-
- return 1;
-}
-
-
-/**
- * \brief Wait for free FIFO entries.
- *
- * \param ctx display handle.
- * \param entries number of free entries to wait.
- *
- * It polls the free entries from the chip until it reaches the requested value
- * or a timeout (3000 tries) occurs. Aborts the program if the FIFO times out.
- */
-static void I810WaitForFifo( const DRIDriverContext *ctx,
- int entries )
-{
-}
-
-/**
- * \brief Reset graphics card to known state.
- *
- * \param ctx display handle.
- *
- * Resets the values of several I810 registers.
- */
-static void I810EngineReset( const DRIDriverContext *ctx )
-{
- unsigned char *I810MMIO = ctx->MMIOAddress;
-}
-
-/**
- * \brief Restore the drawing engine.
- *
- * \param ctx display handle
- *
- * Resets the graphics card and sets initial values for several registers of
- * the card's drawing engine.
- *
- * Turns on the i810 command processor engine (i.e., the ringbuffer).
- */
-static int I810EngineRestore( const DRIDriverContext *ctx )
-{
- I810Ptr info = ctx->driverPrivate;
- unsigned char *I810MMIO = ctx->MMIOAddress;
-
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- return 1;
-}
-
-
-/**
- * \brief Shutdown the drawing engine.
- *
- * \param ctx display handle
- *
- * Turns off the command processor engine & restores the graphics card
- * to a state that fbdev understands.
- */
-static int I810EngineShutdown( const DRIDriverContext *ctx )
-{
- drmI810Init info;
- int ret;
-
- memset(&info, 0, sizeof(drmI810Init));
- info.func = I810_CLEANUP_DMA;
-
- ret = drmCommandWrite(ctx->drmFD, DRM_I810_INIT, &info, sizeof(drmI810Init));
- if (ret>0)
- {
- fprintf(stderr,"[dri] I810 DMA Cleanup failed\n");
- return -errno;
- }
- return 0;
-}
-
-/**
- * \brief Compute base 2 logarithm.
- *
- * \param val value.
- *
- * \return base 2 logarithm of \p val.
- */
-static int I810MinBits(int val)
-{
- int bits;
-
- if (!val) return 1;
- for (bits = 0; val; val >>= 1, ++bits);
- return bits;
-}
-
-static int I810DRIAgpPreInit( const DRIDriverContext *ctx, I810Ptr info)
-{
-
- if (drmAgpAcquire(ctx->drmFD) < 0) {
- fprintf(stderr, "[gart] AGP not available\n");
- return 0;
- }
-
-
- if (drmAgpEnable(ctx->drmFD, 0) < 0) {
- fprintf(stderr, "[gart] AGP not enabled\n");
- drmAgpRelease(ctx->drmFD);
- return 0;
- }
-}
-
-/**
- * \brief Initialize the AGP state
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return one on success, or zero on failure.
- *
- * Acquires and enables the AGP device. Reserves memory in the AGP space for
- * the ring buffer, vertex buffers and textures. Initialize the I810
- * registers to point to that memory and add client mappings.
- */
-static int I810DRIAgpInit( const DRIDriverContext *ctx, I810Ptr info)
-{
- unsigned char *I810MMIO = ctx->MMIOAddress;
- int ret;
- int s, l;
- unsigned long dcacheHandle;
- unsigned long agpHandle;
- int pitch_idx = 0;
- int back_size = 0;
- int sysmem_size = 0;
- int width = ctx->shared.virtualWidth * ctx->cpp;
-
-
- info->backHandle = DRM_AGP_NO_HANDLE;
- info->zHandle = DRM_AGP_NO_HANDLE;
- info->sysmemHandle = DRM_AGP_NO_HANDLE;
- info->dcacheHandle = DRM_AGP_NO_HANDLE;
-
- memset(&info->DcacheMem, 0, sizeof(I810MemRange));
- memset(&info->BackBuffer, 0, sizeof(I810MemRange));
- memset(&info->DepthBuffer, 0, sizeof(I810MemRange));
-
- drmAgpAlloc(ctx->drmFD, 4096 * 1024, 1, NULL, &dcacheHandle);
- info->dcacheHandle = dcacheHandle;
-
- fprintf(stderr, "[agp] dcacheHandle : 0x%x\n", dcacheHandle);
-
-#define Elements(x) sizeof(x)/sizeof(*x)
- for (pitch_idx = 0; pitch_idx < Elements(i810_pitches); pitch_idx++)
- if (width <= i810_pitches[pitch_idx])
- break;
-
- if (pitch_idx == Elements(i810_pitches)) {
- fprintf(stderr,"[dri] Couldn't find depth/back buffer pitch\n");
- exit(-1);
- }
- else
- {
- int lines = (ctx->shared.virtualWidth + 15) / 16 * 16;
- back_size = i810_pitches[pitch_idx] * lines;
- back_size = ((back_size + 4096 - 1) / 4096) * 4096;
- }
-
- sysmem_size = ctx->shared.fbSize;
- fprintf(stderr,"sysmem_size is %lu back_size is %lu\n", sysmem_size, back_size);
- if (dcacheHandle != DRM_AGP_NO_HANDLE) {
- if (back_size > 4 * 1024 * 1024) {
- fprintf(stderr,"[dri] Backsize is larger then 4 meg\n");
- sysmem_size = sysmem_size - 2 * back_size;
- drmAgpFree(ctx->drmFD, dcacheHandle);
- info->dcacheHandle = dcacheHandle = DRM_AGP_NO_HANDLE;
- } else {
- sysmem_size = sysmem_size - back_size;
- }
- } else {
- sysmem_size = sysmem_size - 2 * back_size;
- }
-
- info->SysMem.Start=0;
- info->SysMem.Size = sysmem_size;
- info->SysMem.End = sysmem_size;
-
- if (dcacheHandle != DRM_AGP_NO_HANDLE) {
- if (drmAgpBind(ctx->drmFD, dcacheHandle, info->DepthOffset) == 0) {
- memset(&info->DcacheMem, 0, sizeof(I810MemRange));
- fprintf(stderr,"[agp] GART: Found 4096K Z buffer memory\n");
- info->DcacheMem.Start = info->DepthOffset;
- info->DcacheMem.Size = 1024 * 4096;
- info->DcacheMem.End = info->DcacheMem.Start + info->DcacheMem.Size;
- } else {
- fprintf(stderr, "[agp] GART: dcache bind failed\n");
- drmAgpFree(ctx->drmFD, dcacheHandle);
- info->dcacheHandle = dcacheHandle = DRM_AGP_NO_HANDLE;
- }
- } else {
- fprintf(stderr, "[agp] GART: no dcache memory found\n");
- }
-
- drmAgpAlloc(ctx->drmFD, back_size, 0, NULL, &agpHandle);
- info->backHandle = agpHandle;
-
- if (agpHandle != DRM_AGP_NO_HANDLE) {
- if (drmAgpBind(ctx->drmFD, agpHandle, info->BackOffset) == 0) {
- fprintf(stderr, "[agp] Bound backbuffer memory\n");
-
- info->BackBuffer.Start = info->BackOffset;
- info->BackBuffer.Size = back_size;
- info->BackBuffer.End = (info->BackBuffer.Start +
- info->BackBuffer.Size);
- } else {
- fprintf(stderr,"[agp] Unable to bind backbuffer. Disabling DRI.\n");
- return 0;
- }
- } else {
- fprintf(stderr, "[dri] Unable to allocate backbuffer memory. Disabling DRI.\n");
- return 0;
- }
-
- if (dcacheHandle == DRM_AGP_NO_HANDLE) {
- drmAgpAlloc(ctx->drmFD, back_size, 0, NULL, &agpHandle);
-
- info->zHandle = agpHandle;
-
- if (agpHandle != DRM_AGP_NO_HANDLE) {
- if (drmAgpBind(ctx->drmFD, agpHandle, info->DepthOffset) == 0) {
- fprintf(stderr,"[agp] Bound depthbuffer memory\n");
- info->DepthBuffer.Start = info->DepthOffset;
- info->DepthBuffer.Size = back_size;
- info->DepthBuffer.End = (info->DepthBuffer.Start +
- info->DepthBuffer.Size);
- } else {
- fprintf(stderr,"[agp] Unable to bind depthbuffer. Disabling DRI.\n");
- return 0;
- }
- } else {
- fprintf(stderr,"[agp] Unable to allocate depthbuffer memory. Disabling DRI.\n");
- return 0;
- }
- }
-
- /* Now allocate and bind the agp space. This memory will include the
- * regular framebuffer as well as texture memory.
- */
- drmAgpAlloc(ctx->drmFD, sysmem_size, 0, NULL, &agpHandle);
- info->sysmemHandle = agpHandle;
-
- if (agpHandle != DRM_AGP_NO_HANDLE) {
- if (drmAgpBind(ctx->drmFD, agpHandle, 0) == 0) {
- fprintf(stderr, "[agp] Bound System Texture Memory\n");
- } else {
- fprintf(stderr, "[agp] Unable to bind system texture memory. Disabling DRI.\n");
- return 0;
- }
- } else {
- fprintf(stderr, "[agp] Unable to allocate system texture memory. Disabling DRI.\n");
- return 0;
- }
-
- info->auxPitch = i810_pitches[pitch_idx];
- info->auxPitchBits = i810_pitch_flags[pitch_idx];
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the kernel data structures and enable the CP engine.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * This function is a wrapper around the DRM_I810_CP_INIT command, passing
- * all the parameters in a drmI810Init structure.
- */
-static int I810DRIKernelInit( const DRIDriverContext *ctx,
- I810Ptr info)
-{
- int cpp = ctx->bpp / 8;
- drmI810Init drmInfo;
- int ret;
- I810RingBuffer *ring = &(info->LpRing);
-
- /* This is the struct passed to the kernel module for its initialization */
- memset(&drmInfo, 0, sizeof(drmI810Init));
-
- /* make sure we have at least 1.4 */
- drmInfo.func = I810_INIT_DMA_1_4;
-
- drmInfo.ring_start = ring->mem.Start;
- drmInfo.ring_end = ring->mem.End;
- drmInfo.ring_size = ring->mem.Size;
-
- drmInfo.mmio_offset = (unsigned int)info->regs;
- drmInfo.buffers_offset = (unsigned int)info->buffer_map;
- drmInfo.sarea_priv_offset = sizeof(drm_sarea_t);
-
- drmInfo.front_offset = 0;
- drmInfo.back_offset = info->BackBuffer.Start;
- drmInfo.depth_offset = info->DepthBuffer.Start;
-
- drmInfo.w = ctx->shared.virtualWidth;
- drmInfo.h = ctx->shared.virtualHeight;
- drmInfo.pitch = info->auxPitch;
- drmInfo.pitch_bits = info->auxPitchBits;
-
-
- ret = drmCommandWrite(ctx->drmFD, DRM_I810_INIT, &drmInfo,
- sizeof(drmI810Init));
-
- return ret >= 0;
-}
-
-
-/**
- * \brief Add a map for the vertex buffers that will be accessed by any
- * DRI-based clients.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return one on success, or zero on failure.
- *
- * Calls drmAddBufs() with the previously allocated vertex buffers.
- */
-static int I810DRIBufInit( const DRIDriverContext *ctx, I810Ptr info )
-{
- /* Initialize vertex buffers */
- info->bufNumBufs = drmAddBufs(ctx->drmFD,
- I810_DMA_BUF_NR,
- I810_DMA_BUF_SZ,
- DRM_AGP_BUFFER,
- info->BufferMem.Start);
-
- if (info->bufNumBufs <= 0) {
- fprintf(stderr,
- "[drm] Could not create vertex/indirect buffers list\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] Added %d %d byte vertex/indirect buffers\n",
- info->bufNumBufs, I810_DMA_BUF_SZ);
-
- return 1;
-}
-
-/**
- * \brief Install an IRQ handler.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * Attempts to install an IRQ handler via drmCtlInstHandler(), falling back to
- * IRQ-free operation on failure.
- */
-static void I810DRIIrqInit(const DRIDriverContext *ctx,
- I810Ptr info)
-{
- if (!info->irq) {
- info->irq = drmGetInterruptFromBusID(ctx->drmFD,
- ctx->pciBus,
- ctx->pciDevice,
- ctx->pciFunc);
-
- if ((drmCtlInstHandler(ctx->drmFD, info->irq)) != 0) {
- fprintf(stderr,
- "[drm] failure adding irq handler, "
- "there is a device already using that irq\n"
- "[drm] falling back to irq-free operation\n");
- info->irq = 0;
- }
- }
-
- if (info->irq)
- fprintf(stderr,
- "[drm] dma control initialized, using IRQ %d\n",
- info->irq);
-}
-
-static int I810CheckDRMVersion( const DRIDriverContext *ctx,
- I810Ptr info )
-{
- drmVersionPtr version;
-
- version = drmGetVersion(ctx->drmFD);
- if (version) {
- int req_minor, req_patch;
-
- req_minor = 4;
- req_patch = 0;
-
- i810_drm_version = (version->version_major<<16) | version->version_minor;
- if (version->version_major != 1 ||
- version->version_minor < req_minor ||
- (version->version_minor == req_minor &&
- version->version_patchlevel < req_patch)) {
- /* Incompatible drm version */
- fprintf(stderr,
- "[dri] I810DRIScreenInit failed because of a version "
- "mismatch.\n"
- "[dri] i810.o kernel module version is %d.%d.%d "
- "but version 1.%d.%d or newer is needed.\n"
- "[dri] Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel,
- req_minor,
- req_patch);
- drmFreeVersion(version);
- return 0;
- }
-
- info->drmMinor = version->version_minor;
- drmFreeVersion(version);
- }
-
- return 1;
-}
-
-static int I810MemoryInit( const DRIDriverContext *ctx, I810Ptr info )
-{
- int width_bytes = ctx->shared.virtualWidth * ctx->cpp;
- int cpp = ctx->cpp;
- int bufferSize = (ctx->shared.virtualHeight * width_bytes);
- int depthSize = (((ctx->shared.virtualHeight+15) & ~15) * width_bytes);
- int l;
-
- if (drmAddMap(ctx->drmFD, (drm_handle_t) info->BackBuffer.Start,
- info->BackBuffer.Size, DRM_AGP, 0,
- &info->backbuffer) < 0) {
- fprintf(stderr, "[drm] drmAddMap(backbuffer) failed. Disabling DRI\n");
- return 0;
- }
-
- if (drmAddMap(ctx->drmFD, (drm_handle_t) info->DepthBuffer.Start,
- info->DepthBuffer.Size, DRM_AGP, 0,
- &info->depthbuffer) < 0) {
- fprintf(stderr, "[drm] drmAddMap(depthbuffer) failed. Disabling DRI.\n");
- return 0;
- }
-
- if (!I810AllocLow(&(info->FrontBuffer), &(info->SysMem), (((ctx->shared.virtualHeight * width_bytes) + 4095) & ~4095)))
- {
- fprintf(stderr,"Framebuffer allocation failed\n");
- return 0;
- }
- else
- fprintf(stderr,"Frame buffer at 0x%.8x (%luk, %lu bytes)\n",
- info->FrontBuffer.Start,
- info->FrontBuffer.Size / 1024, info->FrontBuffer.Size);
-
- memset(&(info->LpRing), 0, sizeof(I810RingBuffer));
- if (I810AllocLow(&(info->LpRing.mem), &(info->SysMem), 16 * 4096)) {
- fprintf(stderr,
- "Ring buffer at 0x%.8x (%luk, %lu bytes)\n",
- info->LpRing.mem.Start,
- info->LpRing.mem.Size / 1024, info->LpRing.mem.Size);
-
- info->LpRing.tail_mask = info->LpRing.mem.Size - 1;
- info->LpRing.virtual_start = info->LpRing.mem.Start;
- info->LpRing.head = 0;
- info->LpRing.tail = 0;
- info->LpRing.space = 0;
- } else {
- fprintf(stderr, "Ring buffer allocation failed\n");
- return (0);
- }
-
- /* Allocate buffer memory */
- I810AllocHigh(&(info->BufferMem), &(info->SysMem),
- I810_DMA_BUF_NR * I810_DMA_BUF_SZ);
-
-
- fprintf(stderr, "[dri] Buffer map : %lx\n",
- info->BufferMem.Start);
-
- if (info->BufferMem.Start == 0 ||
- info->BufferMem.End - info->BufferMem.Start >
- I810_DMA_BUF_NR * I810_DMA_BUF_SZ) {
- fprintf(stderr,"[dri] Not enough memory for dma buffers. Disabling DRI.\n");
- return 0;
- }
-
- if (drmAddMap(ctx->drmFD, (drm_handle_t) info->BufferMem.Start,
- info->BufferMem.Size, DRM_AGP, 0, &info->buffer_map) < 0) {
- fprintf(stderr, "[drm] drmAddMap(buffer_map) failed. Disabling DRI.\n");
- return 0;
- }
-
- if (drmAddMap(ctx->drmFD, (drm_handle_t) info->LpRing.mem.Start,
- info->LpRing.mem.Size, DRM_AGP, 0, &info->ring_map) < 0) {
- fprintf(stderr, "[drm] drmAddMap(ring_map) failed. Disabling DRI. \n");
- return 0;
- }
-
- /* Front, back and depth buffers - everything else texture??
- */
- info->textureSize = info->SysMem.Size;
-
- if (info->textureSize < 0)
- return 0;
-
-
- l = I810MinBits((info->textureSize-1) / I810_NR_TEX_REGIONS);
- if (l < I810_LOG_MIN_TEX_REGION_SIZE) l = I810_LOG_MIN_TEX_REGION_SIZE;
-
- /* Round the texture size up to the nearest whole number of
- * texture regions. Again, be greedy about this, don't
- * round down.
- */
- info->logTextureGranularity = l;
- info->textureSize = (info->textureSize >> l) << l;
-
- /* Set a minimum usable local texture heap size. This will fit
- * two 256x256x32bpp textures.
- */
- if (info->textureSize < 512 * 1024) {
- info->textureOffset = 0;
- info->textureSize = 0;
- }
-
- I810AllocLow(&(info->TexMem), &(info->SysMem), info->textureSize);
-
- if (drmAddMap(ctx->drmFD, (drm_handle_t) info->TexMem.Start,
- info->TexMem.Size, DRM_AGP, 0, &info->textures) < 0) {
- fprintf(stderr,
- "[drm] drmAddMap(textures) failed. Disabling DRI.\n");
- return 0;
- }
-
- /* Reserve space for textures */
- fprintf(stderr,
- "Will use back buffer at offset 0x%x\n",
- info->BackOffset);
- fprintf(stderr,
- "Will use depth buffer at offset 0x%x\n",
- info->DepthOffset);
- fprintf(stderr,
- "Will use %d kb for textures at offset 0x%x\n",
- info->TexMem.Size/1024, info->TexMem.Start);
-
- return 1;
-}
-
-
-
-/**
- * Called at the start of each server generation.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * Performs static frame buffer allocation. Opens the DRM device and add maps
- * to the SAREA, framebuffer and MMIO regions. Fills in \p info with more
- * information. Creates a \e server context to grab the lock for the
- * initialization ioctls and calls the other initilization functions in this
- * file. Starts the CP engine via the DRM_I810_CP_START command.
- *
- * Setups a I810DRIRec structure to be passed to i810_dri.so for its
- * initialization.
- */
-static int I810ScreenInit( DRIDriverContext *ctx, I810Ptr info )
-{
- I810DRIPtr pI810DRI;
- int err;
-
- usleep(100);
- /*assert(!ctx->IsClient);*/
-
- /* from XFree86 driver */
- info->DepthOffset = 0x3000000;
- info->BackOffset = 0x3800000;
- {
- int width_bytes = (ctx->shared.virtualWidth * ctx->cpp);
- int maxy = ctx->shared.fbSize / width_bytes;
-
-
- if (maxy <= ctx->shared.virtualHeight * 3) {
- fprintf(stderr,
- "Static buffer allocation failed -- "
- "need at least %d kB video memory (have %d kB)\n",
- (ctx->shared.virtualWidth * ctx->shared.virtualHeight *
- ctx->cpp * 3 + 1023) / 1024,
- ctx->shared.fbSize / 1024);
- return 0;
- }
- }
-
-
- info->regsSize = ctx->MMIOSize;
- ctx->shared.SAREASize = 0x2000;
-
- /* Note that drmOpen will try to load the kernel module, if needed. */
- ctx->drmFD = drmOpen("i810", NULL );
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
-
- if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) {
- fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
- return 0;
- }
-
- if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- if (drmAddMap(ctx->drmFD,
- ctx->MMIOStart,
- ctx->MMIOSize,
- DRM_REGISTERS,
- DRM_READ_ONLY,
- &info->regs) < 0) {
- fprintf(stderr, "[drm] drmAddMap mmio failed\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] register handle = 0x%08x\n", info->regs);
-
- I810DRIAgpPreInit(ctx, info);
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap( ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
-#ifndef _EMBEDDED
- 0,
-#else
- DRM_READ_ONLY,
-#endif
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
-
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
- /* Check the i810 DRM version */
- if (!I810CheckDRMVersion(ctx, info)) {
- return 0;
- }
-
- /* Initialize AGP */
- if (!I810DRIAgpInit(ctx, info)) {
- return 0;
- }
-
-
- /* Memory manager setup */
- if (!I810MemoryInit(ctx, info)) {
- return 0;
- }
-
- /* Initialize the SAREA private data structure */
- {
- I810SAREAPtr pSAREAPriv;
- pSAREAPriv = (I810SAREAPtr)(((char*)ctx->pSAREA) +
- sizeof(drm_sarea_t));
- memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
- // pSAREAPriv->pf_enabled=1;
- }
-
-
- /* Create a 'server' context so we can grab the lock for
- * initialization ioctls.
- */
- if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return 0;
- }
-
- DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0);
-
- /* Initialize the vertex buffers list */
- if (!I810DRIBufInit(ctx, info)) {
- fprintf(stderr, "I810DRIBufInit failed\n");
- DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);
- return 0;
- }
-
- /* Initialize the kernel data structures */
- if (!I810DRIKernelInit(ctx, info)) {
- fprintf(stderr, "I810DRIKernelInit failed\n");
- DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);
- return 0;
- }
-
- /* Initialize IRQ */
- I810DRIIrqInit(ctx, info);
-
- /* Quick hack to clear the front & back buffers. Could also use
- * the clear ioctl to do this, but would need to setup hw state
- * first.
- */
-#if 0
- memset((char *)ctx->FBAddress,
- 0,
- info->auxPitch * ctx->cpp * ctx->shared.virtualHeight );
-
- memset((char *)info->backbuffer,
- 0,
- info->auxPitch * ctx->cpp * ctx->shared.virtualHeight );
-#endif
-
- /* This is the struct passed to i810_dri.so for its initialization */
- ctx->driverClientMsg = malloc(sizeof(I810DRIRec));
- ctx->driverClientMsgSize = sizeof(I810DRIRec);
- pI810DRI = (I810DRIPtr)ctx->driverClientMsg;
-
- pI810DRI->regs = info->regs;
- pI810DRI->regsSize = info->regsSize;
- // regsMap is unused
-
- pI810DRI->backbufferSize = info->BackBuffer.Size;
- pI810DRI->backbuffer = info->backbuffer;
-
- pI810DRI->depthbufferSize = info->DepthBuffer.Size;
- pI810DRI->depthbuffer = info->depthbuffer;
-
- pI810DRI->textures = info->textures;
- pI810DRI->textureSize = info->textureSize;
-
- pI810DRI->agp_buffers = info->buffer_map;
- pI810DRI->agp_buf_size = info->BufferMem.Size;
-
- pI810DRI->deviceID = info->Chipset;
- pI810DRI->width = ctx->shared.virtualWidth;
- pI810DRI->height = ctx->shared.virtualHeight;
- pI810DRI->mem = ctx->shared.fbSize;
- pI810DRI->cpp = ctx->bpp / 8;
- pI810DRI->bitsPerPixel = ctx->bpp;
- pI810DRI->fbOffset = info->FrontBuffer.Start;
- pI810DRI->fbStride = info->auxPitch;
-
- pI810DRI->backOffset = info->BackBuffer.Start;
- pI810DRI->depthOffset = info->DepthBuffer.Start;
-
- pI810DRI->auxPitch = info->auxPitch;
- pI810DRI->auxPitchBits = info->auxPitchBits;
-
- pI810DRI->logTextureGranularity = info->logTextureGranularity;
- pI810DRI->textureOffset = info->TexMem.Start;
-
- pI810DRI->ringOffset = info->LpRing.mem.Start;
- pI810DRI->ringSize = info->LpRing.mem.Size;
-
- // drmBufs looks unused
- pI810DRI->irq = info->irq;
- pI810DRI->sarea_priv_offset = sizeof(drm_sarea_t);
-
- /* Don't release the lock now - let the VT switch handler do it. */
- return 1;
-}
-
-
-/**
- * \brief Validate the fbdev mode.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Saves some registers and returns 1.
- *
- * \sa i810ValidateMode().
- */
-static int i810ValidateMode( const DRIDriverContext *ctx )
-{
- unsigned char *I810MMIO = ctx->MMIOAddress;
- I810Ptr info = ctx->driverPrivate;
-
- return 1;
-}
-
-
-/**
- * \brief Examine mode returned by fbdev.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Restores registers that fbdev has clobbered and returns 1.
- *
- * \sa i810ValidateMode().
- */
-static int i810PostValidateMode( const DRIDriverContext *ctx )
-{
- unsigned char *I810MMIO = ctx->MMIOAddress;
- I810Ptr info = ctx->driverPrivate;
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the framebuffer device mode
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Fills in \p info with some default values and some information from \p ctx
- * and then calls I810ScreenInit() for the screen initialization.
- *
- * Before exiting clears the framebuffer memory accessing it directly.
- */
-static int i810InitFBDev( DRIDriverContext *ctx )
-{
- I810Ptr info = calloc(1, sizeof(*info));
-
- {
- int dummy = ctx->shared.virtualWidth;
-
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break;
- }
-
- ctx->shared.virtualWidth = dummy;
- }
-
- ctx->driverPrivate = (void *)info;
-
- info->Chipset = ctx->chipset;
-
- if (!I810ScreenInit( ctx, info ))
- return 0;
-
-
- return 1;
-}
-
-
-/**
- * \brief The screen is being closed, so clean up any state and free any
- * resources used by the DRI.
- *
- * \param ctx display handle.
- *
- * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver
- * private data.
- */
-static void i810HaltFBDev( DRIDriverContext *ctx )
-{
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = 0;
- }
-}
-
-
-extern void i810NotifyFocus( int );
-
-/**
- * \brief Exported driver interface for Mini GLX.
- *
- * \sa DRIDriverRec.
- */
-const struct DRIDriverRec __driDriver = {
- i810ValidateMode,
- i810PostValidateMode,
- i810InitFBDev,
- i810HaltFBDev,
- I810EngineShutdown,
- I810EngineRestore,
-#ifndef _EMBEDDED
- 0,
-#else
- i810NotifyFocus,
-#endif
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.h
deleted file mode 100644
index 408a4ebb4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_dri.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h,v 1.10 2002/12/10 01:27:04 dawes Exp $ */
-
-#ifndef _I810_DRI_
-#define _I810_DRI_
-
-#include "xf86drm.h"
-#include "i810_common.h"
-
-#define I810_MAX_DRAWABLES 256
-
-typedef struct {
- drm_handle_t regs;
- drmSize regsSize;
-
- drmSize backbufferSize;
- drm_handle_t backbuffer;
-
- drmSize depthbufferSize;
- drm_handle_t depthbuffer;
-
- drm_handle_t textures;
- int textureSize;
-
- drm_handle_t agp_buffers;
- drmSize agp_buf_size;
-
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int bitsPerPixel;
- int fbOffset;
- int fbStride;
-
- int backOffset;
- int depthOffset;
-
- int auxPitch;
- int auxPitchBits;
-
- int logTextureGranularity;
- int textureOffset;
-
- /* For non-dma direct rendering.
- */
- int ringOffset;
- int ringSize;
-
- drmBufMapPtr drmBufs;
- int irq;
- unsigned int sarea_priv_offset;
-
-} I810DRIRec, *I810DRIPtr;
-
-/* WARNING: Do not change the SAREA structure without changing the kernel
- * as well */
-
-#define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
-#define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
-#define I810_UPLOAD_CTX 0x4
-#define I810_UPLOAD_BUFFERS 0x8
-#define I810_UPLOAD_TEX0 0x10
-#define I810_UPLOAD_TEX1 0x20
-#define I810_UPLOAD_CLIPRECTS 0x40
-
-typedef struct {
- unsigned char next, prev; /* indices to form a circular LRU */
- unsigned char in_use; /* owned by a client, or free? */
- int age; /* tracked by clients to update local LRU's */
-} I810TexRegionRec, *I810TexRegionPtr;
-
-typedef struct {
- unsigned int ContextState[I810_CTX_SETUP_SIZE];
- unsigned int BufferState[I810_DEST_SETUP_SIZE];
- unsigned int TexState[2][I810_TEX_SETUP_SIZE];
- unsigned int dirty;
-
- unsigned int nbox;
- drm_clip_rect_t boxes[I810_NR_SAREA_CLIPRECTS];
-
- /* Maintain an LRU of contiguous regions of texture space. If
- * you think you own a region of texture memory, and it has an
- * age different to the one you set, then you are mistaken and
- * it has been stolen by another client. If global texAge
- * hasn't changed, there is no need to walk the list.
- *
- * These regions can be used as a proxy for the fine-grained
- * texture information of other clients - by maintaining them
- * in the same lru which is used to age their own textures,
- * clients have an approximate lru for the whole of global
- * texture space, and can make informed decisions as to which
- * areas to kick out. There is no need to choose whether to
- * kick out your own texture or someone else's - simply eject
- * them all in LRU order.
- */
-
- drmTextureRegion texList[I810_NR_TEX_REGIONS + 1];
-
- /* Last elt is sentinal */
- int texAge; /* last time texture was uploaded */
-
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int last_quiescent; /* */
-
- int ctxOwner; /* last context to upload state */
-
- int vertex_prim;
-
- int pf_enabled; /* is pageflipping allowed? */
- int pf_active; /* is pageflipping active right now? */
- int pf_current_page; /* which buffer is being displayed? */
-
-
-} I810SAREARec, *I810SAREAPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I810ConfigPrivRec, *I810ConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I810DRIContextRec, *I810DRIContextPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_reg.h
deleted file mode 100644
index c935982a7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i810/server/i810_reg.h
+++ /dev/null
@@ -1,992 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h,v 1.13 2003/02/06 04:18:04 dawes Exp $ */
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- * based on the i740 driver by
- * Kevin E. Martin <kevin@precisioninsight.com>
- *
- *
- */
-
-#ifndef _I810_REG_H
-#define _I810_REG_H
-
-/* I/O register offsets
- */
-#define SRX 0x3C4 /* p208 */
-#define GRX 0x3CE /* p213 */
-#define ARX 0x3C0 /* p224 */
-
-/* VGA Color Palette Registers */
-#define DACMASK 0x3C6 /* p232 */
-#define DACSTATE 0x3C7 /* p232 */
-#define DACRX 0x3C7 /* p233 */
-#define DACWX 0x3C8 /* p233 */
-#define DACDATA 0x3C9 /* p233 */
-
-/* CRT Controller Registers (CRX) */
-#define START_ADDR_HI 0x0C /* p246 */
-#define START_ADDR_LO 0x0D /* p247 */
-#define VERT_SYNC_END 0x11 /* p249 */
-#define EXT_VERT_TOTAL 0x30 /* p257 */
-#define EXT_VERT_DISPLAY 0x31 /* p258 */
-#define EXT_VERT_SYNC_START 0x32 /* p259 */
-#define EXT_VERT_BLANK_START 0x33 /* p260 */
-#define EXT_HORIZ_TOTAL 0x35 /* p261 */
-#define EXT_HORIZ_BLANK 0x39 /* p261 */
-#define EXT_START_ADDR 0x40 /* p262 */
-#define EXT_START_ADDR_ENABLE 0x80
-#define EXT_OFFSET 0x41 /* p263 */
-#define EXT_START_ADDR_HI 0x42 /* p263 */
-#define INTERLACE_CNTL 0x70 /* p264 */
-#define INTERLACE_ENABLE 0x80
-#define INTERLACE_DISABLE 0x00
-
-/* Miscellaneous Output Register
- */
-#define MSR_R 0x3CC /* p207 */
-#define MSR_W 0x3C2 /* p207 */
-#define IO_ADDR_SELECT 0x01
-
-#define MDA_BASE 0x3B0 /* p207 */
-#define CGA_BASE 0x3D0 /* p207 */
-
-/* CR80 - IO Control, p264
- */
-#define IO_CTNL 0x80
-#define EXTENDED_ATTR_CNTL 0x02
-#define EXTENDED_CRTC_CNTL 0x01
-
-/* GR10 - Address mapping, p221
- */
-#define ADDRESS_MAPPING 0x10
-#define PAGE_TO_LOCAL_MEM_ENABLE 0x10
-#define GTT_MEM_MAP_ENABLE 0x08
-#define PACKED_MODE_ENABLE 0x04
-#define LINEAR_MODE_ENABLE 0x02
-#define PAGE_MAPPING_ENABLE 0x01
-
-/* Blitter control, p378
- */
-#define BITBLT_CNTL 0x7000c
-#define COLEXP_MODE 0x30
-#define COLEXP_8BPP 0x00
-#define COLEXP_16BPP 0x10
-#define COLEXP_24BPP 0x20
-#define COLEXP_RESERVED 0x30
-#define BITBLT_STATUS 0x01
-
-/* p375.
- */
-#define DISPLAY_CNTL 0x70008
-#define VGA_WRAP_MODE 0x02
-#define VGA_WRAP_AT_256KB 0x00
-#define VGA_NO_WRAP 0x02
-#define GUI_MODE 0x01
-#define STANDARD_VGA_MODE 0x00
-#define HIRES_MODE 0x01
-
-/* p375
- */
-#define PIXPIPE_CONFIG_0 0x70009
-#define DAC_8_BIT 0x80
-#define DAC_6_BIT 0x00
-#define HW_CURSOR_ENABLE 0x10
-#define EXTENDED_PALETTE 0x01
-
-/* p375
- */
-#define PIXPIPE_CONFIG_1 0x7000a
-#define DISPLAY_COLOR_MODE 0x0F
-#define DISPLAY_VGA_MODE 0x00
-#define DISPLAY_8BPP_MODE 0x02
-#define DISPLAY_15BPP_MODE 0x04
-#define DISPLAY_16BPP_MODE 0x05
-#define DISPLAY_24BPP_MODE 0x06
-#define DISPLAY_32BPP_MODE 0x07
-
-/* p375
- */
-#define PIXPIPE_CONFIG_2 0x7000b
-#define DISPLAY_GAMMA_ENABLE 0x08
-#define DISPLAY_GAMMA_DISABLE 0x00
-#define OVERLAY_GAMMA_ENABLE 0x04
-#define OVERLAY_GAMMA_DISABLE 0x00
-
-
-/* p380
- */
-#define DISPLAY_BASE 0x70020
-#define DISPLAY_BASE_MASK 0x03fffffc
-
-
-/* Cursor control registers, pp383-384
- */
-/* Desktop (845G, 865G) */
-#define CURSOR_CONTROL 0x70080
-#define CURSOR_ENABLE 0x80000000
-#define CURSOR_GAMMA_ENABLE 0x40000000
-#define CURSOR_STRIDE_MASK 0x30000000
-#define CURSOR_FORMAT_SHIFT 24
-#define CURSOR_FORMAT_MASK (0x07 << CURSOR_FORMAT_SHIFT)
-#define CURSOR_FORMAT_2C (0x00 << CURSOR_FORMAT_SHIFT)
-#define CURSOR_FORMAT_3C (0x01 << CURSOR_FORMAT_SHIFT)
-#define CURSOR_FORMAT_4C (0x02 << CURSOR_FORMAT_SHIFT)
-#define CURSOR_FORMAT_ARGB (0x04 << CURSOR_FORMAT_SHIFT)
-#define CURSOR_FORMAT_XRGB (0x05 << CURSOR_FORMAT_SHIFT)
-
-/* Mobile and i810 */
-#define CURSOR_A_CONTROL CURSOR_CONTROL
-#define CURSOR_ORIGIN_SCREEN 0x00 /* i810 only */
-#define CURSOR_ORIGIN_DISPLAY 0x1 /* i810 only */
-#define CURSOR_MODE 0x27
-#define CURSOR_MODE_DISABLE 0x00
-#define CURSOR_MODE_32_4C_AX 0x01 /* i810 only */
-#define CURSOR_MODE_64_3C 0x04
-#define CURSOR_MODE_64_4C_AX 0x05
-#define CURSOR_MODE_64_4C 0x06
-#define CURSOR_MODE_64_32B_AX 0x07
-#define CURSOR_MODE_64_ARGB_AX (0x20 | CURSOR_MODE_64_32B_AX)
-#define MCURSOR_PIPE_SELECT (1 << 28)
-#define MCURSOR_PIPE_A 0x00
-#define MCURSOR_PIPE_B (1 << 28)
-#define MCURSOR_GAMMA_ENABLE (1 << 26)
-#define MCURSOR_MEM_TYPE_LOCAL (1 << 25)
-
-
-#define CURSOR_BASEADDR 0x70084
-#define CURSOR_A_BASE CURSOR_BASEADDR
-#define CURSOR_BASEADDR_MASK 0x1FFFFF00
-#define CURSOR_A_POSITION 0x70088
-#define CURSOR_POS_SIGN 0x8000
-#define CURSOR_POS_MASK 0x007FF
-#define CURSOR_X_SHIFT 0
-#define CURSOR_Y_SHIFT 16
-#define CURSOR_X_LO 0x70088
-#define CURSOR_X_HI 0x70089
-#define CURSOR_X_POS 0x00
-#define CURSOR_X_NEG 0x80
-#define CURSOR_Y_LO 0x7008A
-#define CURSOR_Y_HI 0x7008B
-#define CURSOR_Y_POS 0x00
-#define CURSOR_Y_NEG 0x80
-
-#define CURSOR_A_PALETTE0 0x70090
-#define CURSOR_A_PALETTE1 0x70094
-#define CURSOR_A_PALETTE2 0x70098
-#define CURSOR_A_PALETTE3 0x7009C
-
-#define CURSOR_SIZE 0x700A0
-#define CURSOR_SIZE_MASK 0x3FF
-#define CURSOR_SIZE_HSHIFT 0
-#define CURSOR_SIZE_VSHIFT 12
-
-
-/* Similar registers exist in Device 0 on the i810 (pp55-65), but I'm
- * not sure they refer to local (graphics) memory.
- *
- * These details are for the local memory control registers,
- * (pp301-310). The test machines are not equiped with local memory,
- * so nothing is tested. Only a single row seems to be supported.
- */
-#define DRAM_ROW_TYPE 0x3000
-#define DRAM_ROW_0 0x01
-#define DRAM_ROW_0_SDRAM 0x01
-#define DRAM_ROW_0_EMPTY 0x00
-#define DRAM_ROW_CNTL_LO 0x3001
-#define DRAM_PAGE_MODE_CTRL 0x10
-#define DRAM_RAS_TO_CAS_OVRIDE 0x08
-#define DRAM_CAS_LATENCY 0x04
-#define DRAM_RAS_TIMING 0x02
-#define DRAM_RAS_PRECHARGE 0x01
-#define DRAM_ROW_CNTL_HI 0x3002
-#define DRAM_REFRESH_RATE 0x18
-#define DRAM_REFRESH_DISABLE 0x00
-#define DRAM_REFRESH_60HZ 0x08
-#define DRAM_REFRESH_FAST_TEST 0x10
-#define DRAM_REFRESH_RESERVED 0x18
-#define DRAM_SMS 0x07
-#define DRAM_SMS_NORMAL 0x00
-#define DRAM_SMS_NOP_ENABLE 0x01
-#define DRAM_SMS_ABPCE 0x02
-#define DRAM_SMS_MRCE 0x03
-#define DRAM_SMS_CBRCE 0x04
-
-/* p307
- */
-#define DPMS_SYNC_SELECT 0x5002
-#define VSYNC_CNTL 0x08
-#define VSYNC_ON 0x00
-#define VSYNC_OFF 0x08
-#define HSYNC_CNTL 0x02
-#define HSYNC_ON 0x00
-#define HSYNC_OFF 0x02
-
-
-
-/* p317, 319
- */
-#define VCLK2_VCO_M 0x6008 /* treat as 16 bit? (includes msbs) */
-#define VCLK2_VCO_N 0x600a
-#define VCLK2_VCO_DIV_SEL 0x6012
-
-#define VCLK_DIVISOR_VGA0 0x6000
-#define VCLK_DIVISOR_VGA1 0x6004
-#define VCLK_POST_DIV 0x6010
-
-#define POST_DIV_SELECT 0x70
-#define POST_DIV_1 0x00
-#define POST_DIV_2 0x10
-#define POST_DIV_4 0x20
-#define POST_DIV_8 0x30
-#define POST_DIV_16 0x40
-#define POST_DIV_32 0x50
-#define VCO_LOOP_DIV_BY_4M 0x00
-#define VCO_LOOP_DIV_BY_16M 0x04
-
-
-/* Instruction Parser Mode Register
- * - p281
- * - 2 new bits.
- */
-#define INST_PM 0x20c0
-#define AGP_SYNC_PACKET_FLUSH_ENABLE 0x20 /* reserved */
-#define SYNC_PACKET_FLUSH_ENABLE 0x10
-#define TWO_D_INST_DISABLE 0x08
-#define THREE_D_INST_DISABLE 0x04
-#define STATE_VAR_UPDATE_DISABLE 0x02
-#define PAL_STIP_DISABLE 0x01
-
-#define INST_DONE 0x2090
-#define INST_PS 0x20c4
-
-#define MEMMODE 0x20dc
-
-
-/* Instruction parser error register. p279
- */
-#define IPEIR 0x2088
-#define IPEHR 0x208C
-
-
-/* General error reporting regs, p296
- */
-#define EIR 0x20B0
-#define EMR 0x20B4
-#define ESR 0x20B8
-#define IP_ERR 0x0001
-#define ERROR_RESERVED 0xffc6
-
-
-/* Interrupt Control Registers
- * - new bits for i810
- * - new register hwstam (mask)
- */
-#define HWSTAM 0x2098 /* p290 */
-#define IER 0x20a0 /* p291 */
-#define IIR 0x20a4 /* p292 */
-#define IMR 0x20a8 /* p293 */
-#define ISR 0x20ac /* p294 */
-#define HW_ERROR 0x8000
-#define SYNC_STATUS_TOGGLE 0x1000
-#define DPY_0_FLIP_PENDING 0x0800
-#define DPY_1_FLIP_PENDING 0x0400 /* not implemented on i810 */
-#define OVL_0_FLIP_PENDING 0x0200
-#define OVL_1_FLIP_PENDING 0x0100 /* not implemented on i810 */
-#define DPY_0_VBLANK 0x0080
-#define DPY_0_EVENT 0x0040
-#define DPY_1_VBLANK 0x0020 /* not implemented on i810 */
-#define DPY_1_EVENT 0x0010 /* not implemented on i810 */
-#define HOST_PORT_EVENT 0x0008 /* */
-#define CAPTURE_EVENT 0x0004 /* */
-#define USER_DEFINED 0x0002
-#define BREAKPOINT 0x0001
-
-
-#define INTR_RESERVED (0x6000 | \
- DPY_1_FLIP_PENDING | \
- OVL_1_FLIP_PENDING | \
- DPY_1_VBLANK | \
- DPY_1_EVENT | \
- HOST_PORT_EVENT | \
- CAPTURE_EVENT )
-
-/* FIFO Watermark and Burst Length Control Register
- *
- * - different offset and contents on i810 (p299) (fewer bits per field)
- * - some overlay fields added
- * - what does it all mean?
- */
-#define FWATER_BLC 0x20d8
-#define FWATER_BLC2 0x20dc
-#define MM_BURST_LENGTH 0x00700000
-#define MM_FIFO_WATERMARK 0x0001F000
-#define LM_BURST_LENGTH 0x00000700
-#define LM_FIFO_WATERMARK 0x0000001F
-
-
-/* Fence/Tiling ranges [0..7]
- */
-#define FENCE 0x2000
-#define FENCE_NR 8
-
-#define I830_FENCE_START_MASK 0x07f80000
-
-#define FENCE_START_MASK 0x03F80000
-#define FENCE_X_MAJOR 0x00000000
-#define FENCE_Y_MAJOR 0x00001000
-#define FENCE_SIZE_MASK 0x00000700
-#define FENCE_SIZE_512K 0x00000000
-#define FENCE_SIZE_1M 0x00000100
-#define FENCE_SIZE_2M 0x00000200
-#define FENCE_SIZE_4M 0x00000300
-#define FENCE_SIZE_8M 0x00000400
-#define FENCE_SIZE_16M 0x00000500
-#define FENCE_SIZE_32M 0x00000600
-#define FENCE_SIZE_64M 0x00000700
-#define FENCE_PITCH_MASK 0x00000070
-#define FENCE_PITCH_1 0x00000000
-#define FENCE_PITCH_2 0x00000010
-#define FENCE_PITCH_4 0x00000020
-#define FENCE_PITCH_8 0x00000030
-#define FENCE_PITCH_16 0x00000040
-#define FENCE_PITCH_32 0x00000050
-#define FENCE_PITCH_64 0x00000060
-#define FENCE_VALID 0x00000001
-
-
-/* Registers to control page table, p274
- */
-#define PGETBL_CTL 0x2020
-#define PGETBL_ADDR_MASK 0xFFFFF000
-#define PGETBL_ENABLE_MASK 0x00000001
-#define PGETBL_ENABLED 0x00000001
-
-/* Register containing pge table error results, p276
- */
-#define PGE_ERR 0x2024
-#define PGE_ERR_ADDR_MASK 0xFFFFF000
-#define PGE_ERR_ID_MASK 0x00000038
-#define PGE_ERR_CAPTURE 0x00000000
-#define PGE_ERR_OVERLAY 0x00000008
-#define PGE_ERR_DISPLAY 0x00000010
-#define PGE_ERR_HOST 0x00000018
-#define PGE_ERR_RENDER 0x00000020
-#define PGE_ERR_BLITTER 0x00000028
-#define PGE_ERR_MAPPING 0x00000030
-#define PGE_ERR_CMD_PARSER 0x00000038
-#define PGE_ERR_TYPE_MASK 0x00000007
-#define PGE_ERR_INV_TABLE 0x00000000
-#define PGE_ERR_INV_PTE 0x00000001
-#define PGE_ERR_MIXED_TYPES 0x00000002
-#define PGE_ERR_PAGE_MISS 0x00000003
-#define PGE_ERR_ILLEGAL_TRX 0x00000004
-#define PGE_ERR_LOCAL_MEM 0x00000005
-#define PGE_ERR_TILED 0x00000006
-
-
-
-/* Page table entries loaded via mmio region, p323
- */
-#define PTE_BASE 0x10000
-#define PTE_ADDR_MASK 0x3FFFF000
-#define PTE_TYPE_MASK 0x00000006
-#define PTE_LOCAL 0x00000002
-#define PTE_MAIN_UNCACHED 0x00000000
-#define PTE_MAIN_CACHED 0x00000006
-#define PTE_VALID_MASK 0x00000001
-#define PTE_VALID 0x00000001
-
-
-/* Ring buffer registers, p277, overview p19
- */
-#define LP_RING 0x2030
-#define HP_RING 0x2040
-
-#define RING_TAIL 0x00
-#define TAIL_ADDR 0x000FFFF8
-#define I830_TAIL_MASK 0x001FFFF8
-
-#define RING_HEAD 0x04
-#define HEAD_WRAP_COUNT 0xFFE00000
-#define HEAD_WRAP_ONE 0x00200000
-#define HEAD_ADDR 0x001FFFFC
-#define I830_HEAD_MASK 0x001FFFFC
-
-#define RING_START 0x08
-#define START_ADDR 0x00FFFFF8
-#define I830_RING_START_MASK 0xFFFFF000
-
-#define RING_LEN 0x0C
-#define RING_NR_PAGES 0x000FF000
-#define I830_RING_NR_PAGES 0x001FF000
-#define RING_REPORT_MASK 0x00000006
-#define RING_REPORT_64K 0x00000002
-#define RING_REPORT_128K 0x00000004
-#define RING_NO_REPORT 0x00000000
-#define RING_VALID_MASK 0x00000001
-#define RING_VALID 0x00000001
-#define RING_INVALID 0x00000000
-
-
-
-/* BitBlt Instructions
- *
- * There are many more masks & ranges yet to add.
- */
-#define BR00_BITBLT_CLIENT 0x40000000
-#define BR00_OP_COLOR_BLT 0x10000000
-#define BR00_OP_SRC_COPY_BLT 0x10C00000
-#define BR00_OP_FULL_BLT 0x11400000
-#define BR00_OP_MONO_SRC_BLT 0x11800000
-#define BR00_OP_MONO_SRC_COPY_BLT 0x11000000
-#define BR00_OP_MONO_PAT_BLT 0x11C00000
-#define BR00_OP_MONO_SRC_COPY_IMMEDIATE_BLT (0x61 << 22)
-#define BR00_OP_TEXT_IMMEDIATE_BLT 0xc000000
-
-
-#define BR00_TPCY_DISABLE 0x00000000
-#define BR00_TPCY_ENABLE 0x00000010
-
-#define BR00_TPCY_ROP 0x00000000
-#define BR00_TPCY_NO_ROP 0x00000020
-#define BR00_TPCY_EQ 0x00000000
-#define BR00_TPCY_NOT_EQ 0x00000040
-
-#define BR00_PAT_MSB_FIRST 0x00000000 /* ? */
-
-#define BR00_PAT_VERT_ALIGN 0x000000e0
-
-#define BR00_LENGTH 0x0000000F
-
-#define BR09_DEST_ADDR 0x03FFFFFF
-
-#define BR11_SOURCE_PITCH 0x00003FFF
-
-#define BR12_SOURCE_ADDR 0x03FFFFFF
-
-#define BR13_SOLID_PATTERN 0x80000000
-#define BR13_RIGHT_TO_LEFT 0x40000000
-#define BR13_LEFT_TO_RIGHT 0x00000000
-#define BR13_MONO_TRANSPCY 0x20000000
-#define BR13_USE_DYN_DEPTH 0x04000000
-#define BR13_DYN_8BPP 0x00000000
-#define BR13_DYN_16BPP 0x01000000
-#define BR13_DYN_24BPP 0x02000000
-#define BR13_ROP_MASK 0x00FF0000
-#define BR13_DEST_PITCH 0x0000FFFF
-#define BR13_PITCH_SIGN_BIT 0x00008000
-
-#define BR14_DEST_HEIGHT 0xFFFF0000
-#define BR14_DEST_WIDTH 0x0000FFFF
-
-#define BR15_PATTERN_ADDR 0x03FFFFFF
-
-#define BR16_SOLID_PAT_COLOR 0x00FFFFFF
-#define BR16_BACKGND_PAT_CLR 0x00FFFFFF
-
-#define BR17_FGND_PAT_CLR 0x00FFFFFF
-
-#define BR18_SRC_BGND_CLR 0x00FFFFFF
-#define BR19_SRC_FGND_CLR 0x00FFFFFF
-
-
-/* Instruction parser instructions
- */
-
-#define INST_PARSER_CLIENT 0x00000000
-#define INST_OP_FLUSH 0x02000000
-#define INST_FLUSH_MAP_CACHE 0x00000001
-
-
-#define GFX_OP_USER_INTERRUPT ((0<<29)|(2<<23))
-
-
-/* Registers in the i810 host-pci bridge pci config space which affect
- * the i810 graphics operations.
- */
-#define SMRAM_MISCC 0x70
-#define GMS 0x000000c0
-#define GMS_DISABLE 0x00000000
-#define GMS_ENABLE_BARE 0x00000040
-#define GMS_ENABLE_512K 0x00000080
-#define GMS_ENABLE_1M 0x000000c0
-#define USMM 0x00000030
-#define USMM_DISABLE 0x00000000
-#define USMM_TSEG_ZERO 0x00000010
-#define USMM_TSEG_512K 0x00000020
-#define USMM_TSEG_1M 0x00000030
-#define GFX_MEM_WIN_SIZE 0x00010000
-#define GFX_MEM_WIN_32M 0x00010000
-#define GFX_MEM_WIN_64M 0x00000000
-
-/* Overkill? I don't know. Need to figure out top of mem to make the
- * SMRAM calculations come out. Linux seems to have problems
- * detecting it all on its own, so this seems a reasonable double
- * check to any user supplied 'mem=...' boot param.
- *
- * ... unfortunately this reg doesn't work according to spec on the
- * test hardware.
- */
-#define WHTCFG_PAMR_DRP 0x50
-#define SYS_DRAM_ROW_0_SHIFT 16
-#define SYS_DRAM_ROW_1_SHIFT 20
-#define DRAM_MASK 0x0f
-#define DRAM_VALUE_0 0
-#define DRAM_VALUE_1 8
-/* No 2 value defined */
-#define DRAM_VALUE_3 16
-#define DRAM_VALUE_4 16
-#define DRAM_VALUE_5 24
-#define DRAM_VALUE_6 32
-#define DRAM_VALUE_7 32
-#define DRAM_VALUE_8 48
-#define DRAM_VALUE_9 64
-#define DRAM_VALUE_A 64
-#define DRAM_VALUE_B 96
-#define DRAM_VALUE_C 128
-#define DRAM_VALUE_D 128
-#define DRAM_VALUE_E 192
-#define DRAM_VALUE_F 256 /* nice one, geezer */
-#define LM_FREQ_MASK 0x10
-#define LM_FREQ_133 0x10
-#define LM_FREQ_100 0x00
-
-
-
-
-/* These are 3d state registers, but the state is invarient, so we let
- * the X server handle it:
- */
-
-
-
-/* GFXRENDERSTATE_COLOR_CHROMA_KEY, p135
- */
-#define GFX_OP_COLOR_CHROMA_KEY ((0x3<<29)|(0x1d<<24)|(0x2<<16)|0x1)
-#define CC1_UPDATE_KILL_WRITE (1<<28)
-#define CC1_ENABLE_KILL_WRITE (1<<27)
-#define CC1_DISABLE_KILL_WRITE 0
-#define CC1_UPDATE_COLOR_IDX (1<<26)
-#define CC1_UPDATE_CHROMA_LOW (1<<25)
-#define CC1_UPDATE_CHROMA_HI (1<<24)
-#define CC1_CHROMA_LOW_MASK ((1<<24)-1)
-#define CC2_COLOR_IDX_SHIFT 24
-#define CC2_COLOR_IDX_MASK (0xff<<24)
-#define CC2_CHROMA_HI_MASK ((1<<24)-1)
-
-
-#define GFX_CMD_CONTEXT_SEL ((0<<29)|(0x5<<23))
-#define CS_UPDATE_LOAD (1<<17)
-#define CS_UPDATE_USE (1<<16)
-#define CS_UPDATE_LOAD (1<<17)
-#define CS_LOAD_CTX0 0
-#define CS_LOAD_CTX1 (1<<8)
-#define CS_USE_CTX0 0
-#define CS_USE_CTX1 (1<<0)
-
-/* I810 LCD/TV registers */
-#define LCD_TV_HTOTAL 0x60000
-#define LCD_TV_C 0x60018
-#define LCD_TV_OVRACT 0x6001C
-
-#define LCD_TV_ENABLE (1 << 31)
-#define LCD_TV_VGAMOD (1 << 28)
-
-/* I830 CRTC registers */
-#define HTOTAL_A 0x60000
-#define HBLANK_A 0x60004
-#define HSYNC_A 0x60008
-#define VTOTAL_A 0x6000c
-#define VBLANK_A 0x60010
-#define VSYNC_A 0x60014
-#define PIPEASRC 0x6001c
-#define BCLRPAT_A 0x60020
-
-#define HTOTAL_B 0x61000
-#define HBLANK_B 0x61004
-#define HSYNC_B 0x61008
-#define VTOTAL_B 0x6100c
-#define VBLANK_B 0x61010
-#define VSYNC_B 0x61014
-#define PIPEBSRC 0x6101c
-#define BCLRPAT_B 0x61020
-
-#define DPLL_A 0x06014
-#define DPLL_B 0x06018
-#define FPA0 0x06040
-#define FPA1 0x06044
-
-#define I830_HTOTAL_MASK 0xfff0000
-#define I830_HACTIVE_MASK 0x7ff
-
-#define I830_HBLANKEND_MASK 0xfff0000
-#define I830_HBLANKSTART_MASK 0xfff
-
-#define I830_HSYNCEND_MASK 0xfff0000
-#define I830_HSYNCSTART_MASK 0xfff
-
-#define I830_VTOTAL_MASK 0xfff0000
-#define I830_VACTIVE_MASK 0x7ff
-
-#define I830_VBLANKEND_MASK 0xfff0000
-#define I830_VBLANKSTART_MASK 0xfff
-
-#define I830_VSYNCEND_MASK 0xfff0000
-#define I830_VSYNCSTART_MASK 0xfff
-
-#define I830_PIPEA_HORZ_MASK 0x7ff0000
-#define I830_PIPEA_VERT_MASK 0x7ff
-
-#define ADPA 0x61100
-#define ADPA_DAC_ENABLE (1<<31)
-#define ADPA_DAC_DISABLE 0
-#define ADPA_PIPE_SELECT_MASK (1<<30)
-#define ADPA_PIPE_A_SELECT 0
-#define ADPA_PIPE_B_SELECT (1<<30)
-#define ADPA_USE_VGA_HVPOLARITY (1<<15)
-#define ADPA_SETS_HVPOLARITY 0
-#define ADPA_VSYNC_CNTL_DISABLE (1<<11)
-#define ADPA_VSYNC_CNTL_ENABLE 0
-#define ADPA_HSYNC_CNTL_DISABLE (1<<10)
-#define ADPA_HSYNC_CNTL_ENABLE 0
-#define ADPA_VSYNC_ACTIVE_HIGH (1<<4)
-#define ADPA_VSYNC_ACTIVE_LOW 0
-#define ADPA_HSYNC_ACTIVE_HIGH (1<<3)
-#define ADPA_HSYNC_ACTIVE_LOW 0
-
-
-#define DVOA 0x61120
-#define DVOB 0x61140
-#define DVOC 0x61160
-#define DVO_ENABLE (1<<31)
-
-#define DVOA_SRCDIM 0x61124
-#define DVOB_SRCDIM 0x61144
-#define DVOC_SRCDIM 0x61164
-
-#define LVDS 0x61180
-
-#define PIPEACONF 0x70008
-#define PIPEACONF_ENABLE (1<<31)
-#define PIPEACONF_DISABLE 0
-#define PIPEACONF_DOUBLE_WIDE (1<<30)
-#define PIPEACONF_SINGLE_WIDE 0
-#define PIPEACONF_PIPE_UNLOCKED 0
-#define PIPEACONF_PIPE_LOCKED (1<<25)
-#define PIPEACONF_PALETTE 0
-#define PIPEACONF_GAMMA (1<<24)
-
-#define PIPEBCONF 0x71008
-#define PIPEBCONF_ENABLE (1<<31)
-#define PIPEBCONF_DISABLE 0
-#define PIPEBCONF_GAMMA (1<<24)
-#define PIPEBCONF_PALETTE 0
-
-#define DSPACNTR 0x70180
-#define DSPBCNTR 0x71180
-#define DISPLAY_PLANE_ENABLE (1<<31)
-#define DISPLAY_PLANE_DISABLE 0
-#define DISPPLANE_GAMMA_ENABLE (1<<30)
-#define DISPPLANE_GAMMA_DISABLE 0
-#define DISPPLANE_PIXFORMAT_MASK (0xf<<26)
-#define DISPPLANE_8BPP (0x2<<26)
-#define DISPPLANE_15_16BPP (0x4<<26)
-#define DISPPLANE_16BPP (0x5<<26)
-#define DISPPLANE_32BPP_NO_ALPHA (0x6<<26)
-#define DISPPLANE_32BPP (0x7<<26)
-#define DISPPLANE_STEREO_ENABLE (1<<25)
-#define DISPPLANE_STEREO_DISABLE 0
-#define DISPPLANE_SEL_PIPE_MASK (1<<24)
-#define DISPPLANE_SEL_PIPE_A 0
-#define DISPPLANE_SEL_PIPE_B (1<<24)
-#define DISPPLANE_SRC_KEY_ENABLE (1<<22)
-#define DISPPLANE_SRC_KEY_DISABLE 0
-#define DISPPLANE_LINE_DOUBLE (1<<20)
-#define DISPPLANE_NO_LINE_DOUBLE 0
-#define DISPPLANE_STEREO_POLARITY_FIRST 0
-#define DISPPLANE_STEREO_POLARITY_SECOND (1<<18)
-/* plane B only */
-#define DISPPLANE_ALPHA_TRANS_ENABLE (1<<15)
-#define DISPPLANE_ALPHA_TRANS_DISABLE 0
-#define DISPPLANE_SPRITE_ABOVE_DISPLAYA 0
-#define DISPPLANE_SPRITE_ABOVE_OVERLAY (1)
-
-#define DSPABASE 0x70184
-#define DSPASTRIDE 0x70188
-
-#define DSPBBASE 0x71184
-#define DSPBADDR DSPBBASE
-#define DSPBSTRIDE 0x71188
-
-/* Various masks for reserved bits, etc. */
-#define I830_FWATER1_MASK (~((1<<11)|(1<<10)|(1<<9)| \
- (1<<8)|(1<<26)|(1<<25)|(1<<24)|(1<<5)|(1<<4)|(1<<3)| \
- (1<<2)|(1<<1)|1|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)))
-#define I830_FWATER2_MASK ~(0)
-
-#define DV0A_RESERVED ((1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<16)|(1<<5)|(1<<1)|1)
-#define DV0B_RESERVED ((1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<16)|(1<<5)|(1<<1)|1)
-#define VGA0_N_DIVISOR_MASK ((1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
-#define VGA0_M1_DIVISOR_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8))
-#define VGA0_M2_DIVISOR_MASK ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
-#define VGA0_M1M2N_RESERVED ~(VGA0_N_DIVISOR_MASK|VGA0_M1_DIVISOR_MASK|VGA0_M2_DIVISOR_MASK)
-#define VGA0_POSTDIV_MASK ((1<<7)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
-#define VGA1_POSTDIV_MASK ((1<<15)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8))
-#define VGA_POSTDIV_RESERVED ~(VGA0_POSTDIV_MASK|VGA1_POSTDIV_MASK|(1<<7)|(1<<15))
-#define DPLLA_POSTDIV_MASK ((1<<23)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
-#define DPLLA_RESERVED ((1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<22)|(1<<15)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
-#define ADPA_RESERVED ((1<<2)|(1<<1)|1|(1<<9)|(1<<8)|(1<<7)|(1<<6)|(1<<5)|(1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
-#define SUPER_WORD 32
-#define BURST_A_MASK ((1<<11)|(1<<10)|(1<<9)|(1<<8))
-#define BURST_B_MASK ((1<<26)|(1<<25)|(1<<24))
-#define WATER_A_MASK ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
-#define WATER_B_MASK ((1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
-#define WATER_RESERVED ((1<<31)|(1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<23)|(1<<22)|(1<<21)|(1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<7)|(1<<6))
-#define PIPEACONF_RESERVED ((1<<29)|(1<<28)|(1<<27)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)|0xffff)
-#define PIPEBCONF_RESERVED ((1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<26)|(1<<25)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)|0xffff)
-#define DSPACNTR_RESERVED ((1<<23)|(1<<19)|(1<<17)|(1<<16)|0xffff)
-#define DSPBCNTR_RESERVED ((1<<23)|(1<<19)|(1<<17)|(1<<16)|0x7ffe)
-
-#define I830_GMCH_CTRL 0x52
-
-#define I830_GMCH_ENABLED 0x4
-#define I830_GMCH_MEM_MASK 0x1
-#define I830_GMCH_MEM_64M 0x1
-#define I830_GMCH_MEM_128M 0
-
-#define I830_GMCH_GMS_MASK 0x70
-#define I830_GMCH_GMS_DISABLED 0x00
-#define I830_GMCH_GMS_LOCAL 0x10
-#define I830_GMCH_GMS_STOLEN_512 0x20
-#define I830_GMCH_GMS_STOLEN_1024 0x30
-#define I830_GMCH_GMS_STOLEN_8192 0x40
-
-#define I830_RDRAM_CHANNEL_TYPE 0x03010
-#define I830_RDRAM_ND(x) (((x) & 0x20) >> 5)
-#define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3)
-
-#define I855_GMCH_GMS_MASK (0x7 << 4)
-#define I855_GMCH_GMS_DISABLED 0x00
-#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
-#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
-#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4)
-#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4)
-#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4)
-
-#define I85X_CAPID 0x44
-#define I85X_VARIANT_MASK 0x7
-#define I85X_VARIANT_SHIFT 5
-#define I855_GME 0x0
-#define I855_GM 0x4
-#define I852_GME 0x2
-#define I852_GM 0x5
-
-/* BLT commands */
-#define COLOR_BLT_CMD ((2<<29)|(0x40<<22)|(0x3))
-#define COLOR_BLT_WRITE_ALPHA (1<<21)
-#define COLOR_BLT_WRITE_RGB (1<<20)
-
-#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|(0x4))
-#define XY_COLOR_BLT_WRITE_ALPHA (1<<21)
-#define XY_COLOR_BLT_WRITE_RGB (1<<20)
-
-#define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)|1)
-
-#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6)
-#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21)
-#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20)
-
-#define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)|0x4)
-#define SRC_COPY_BLT_WRITE_ALPHA (1<<21)
-#define SRC_COPY_BLT_WRITE_RGB (1<<20)
-
-#define XY_MONO_PAT_BLT_CMD ((0x2<<29)|(0x52<<22)|0x7)
-#define XY_MONO_PAT_VERT_SEED ((1<<10)|(1<<9)|(1<<8))
-#define XY_MONO_PAT_HORT_SEED ((1<<14)|(1<<13)|(1<<12))
-#define XY_MONO_PAT_BLT_WRITE_ALPHA (1<<21)
-#define XY_MONO_PAT_BLT_WRITE_RGB (1<<20)
-
-#define XY_MONO_SRC_BLT_CMD ((0x2<<29)|(0x54<<22)|(0x6))
-#define XY_MONO_SRC_BLT_WRITE_ALPHA (1<<21)
-#define XY_MONO_SRC_BLT_WRITE_RGB (1<<20)
-
-/* 3d state */
-#define STATE3D_FOG_MODE ((3<<29)|(0x1d<<24)|(0x89<<16)|2)
-#define FOG_MODE_VERTEX (1<<31)
-#define STATE3D_MAP_COORD_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8c<<16))
-#define DISABLE_TEX_TRANSFORM (1<<28)
-#define TEXTURE_SET(x) (x<<29)
-#define STATE3D_RASTERIZATION_RULES ((3<<29)|(0x07<<24))
-#define POINT_RASTER_ENABLE (1<<15)
-#define POINT_RASTER_OGL (1<<13)
-#define STATE3D_VERTEX_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8b<<16))
-#define DISABLE_VIEWPORT_TRANSFORM (1<<31)
-#define DISABLE_PERSPECTIVE_DIVIDE (1<<29)
-
-#define MI_SET_CONTEXT (0x18<<23)
-#define CTXT_NO_RESTORE (1)
-#define CTXT_PALETTE_SAVE_DISABLE (1<<3)
-#define CTXT_PALETTE_RESTORE_DISABLE (1<<2)
-
-/* Dword 0 */
-#define MI_VERTEX_BUFFER (0x17<<23)
-#define MI_VERTEX_BUFFER_IDX(x) (x<<20)
-#define MI_VERTEX_BUFFER_PITCH(x) (x<<13)
-#define MI_VERTEX_BUFFER_WIDTH(x) (x<<6)
-/* Dword 1 */
-#define MI_VERTEX_BUFFER_DISABLE (1)
-
-/* Overlay Flip */
-#define MI_OVERLAY_FLIP (0x11<<23)
-#define MI_OVERLAY_FLIP_CONTINUE (0<<21)
-#define MI_OVERLAY_FLIP_ON (1<<21)
-#define MI_OVERLAY_FLIP_OFF (2<<21)
-
-/* Wait for Events */
-#define MI_WAIT_FOR_EVENT (0x03<<23)
-#define MI_WAIT_FOR_OVERLAY_FLIP (1<<16)
-
-/* Flush */
-#define MI_FLUSH (0x04<<23)
-#define MI_WRITE_DIRTY_STATE (1<<4)
-#define MI_END_SCENE (1<<3)
-#define MI_INHIBIT_RENDER_CACHE_FLUSH (1<<2)
-#define MI_INVALIDATE_MAP_CACHE (1<<0)
-
-/* Noop */
-#define MI_NOOP 0x00
-#define MI_NOOP_WRITE_ID (1<<22)
-#define MI_NOOP_ID_MASK (1<<22 - 1)
-
-#define STATE3D_COLOR_FACTOR ((0x3<<29)|(0x1d<<24)|(0x01<<16))
-
-/* STATE3D_FOG_MODE stuff */
-#define ENABLE_FOG_SOURCE (1<<27)
-#define ENABLE_FOG_CONST (1<<24)
-#define ENABLE_FOG_DENSITY (1<<23)
-
-
-#define MAX_DISPLAY_PIPES 2
-
-typedef enum {
- CrtIndex = 0,
- TvIndex,
- DfpIndex,
- LfpIndex,
- Tv2Index,
- Dfp2Index,
- UnknownIndex,
- Unknown2Index,
- NumDisplayTypes,
- NumKnownDisplayTypes = UnknownIndex
-} DisplayType;
-
-/* What's connected to the pipes (as reported by the BIOS) */
-#define PIPE_ACTIVE_MASK 0xff
-#define PIPE_CRT_ACTIVE (1 << CrtIndex)
-#define PIPE_TV_ACTIVE (1 << TvIndex)
-#define PIPE_DFP_ACTIVE (1 << DfpIndex)
-#define PIPE_LCD_ACTIVE (1 << LfpIndex)
-#define PIPE_TV2_ACTIVE (1 << Tv2Index)
-#define PIPE_DFP2_ACTIVE (1 << Dfp2Index)
-#define PIPE_UNKNOWN_ACTIVE ((1 << UnknownIndex) | \
- (1 << Unknown2Index))
-
-#define PIPE_SIZED_DISP_MASK (PIPE_DFP_ACTIVE | \
- PIPE_LCD_ACTIVE | \
- PIPE_DFP2_ACTIVE)
-
-#define PIPE_A_SHIFT 0
-#define PIPE_B_SHIFT 8
-#define PIPE_SHIFT(n) ((n) == 0 ? \
- PIPE_A_SHIFT : PIPE_B_SHIFT)
-
-/*
- * Some BIOS scratch area registers. The 845 (and 830?) store the amount
- * of video memory available to the BIOS in SWF1.
- */
-
-#define SWF0 0x71410
-#define SWF1 0x71414
-#define SWF2 0x71418
-#define SWF3 0x7141c
-#define SWF4 0x71420
-#define SWF5 0x71424
-#define SWF6 0x71428
-
-/*
- * 855 scratch registers.
- */
-#define SWF00 0x70410
-#define SWF01 0x70414
-#define SWF02 0x70418
-#define SWF03 0x7041c
-#define SWF04 0x70420
-#define SWF05 0x70424
-#define SWF06 0x70428
-
-#define SWF10 SWF0
-#define SWF11 SWF1
-#define SWF12 SWF2
-#define SWF13 SWF3
-#define SWF14 SWF4
-#define SWF15 SWF5
-#define SWF16 SWF6
-
-#define SWF30 0x72414
-#define SWF31 0x72418
-#define SWF32 0x7241c
-
-/*
- * Overlay registers. These are overlay registers accessed via MMIO.
- * Those loaded via the overlay register page are defined in i830_video.c.
- */
-#define OVADD 0x30000
-
-#define DOVSTA 0x30008
-#define OC_BUF (0x3<<20)
-
-#define OGAMC5 0x30010
-#define OGAMC4 0x30014
-#define OGAMC3 0x30018
-#define OGAMC2 0x3001c
-#define OGAMC1 0x30020
-#define OGAMC0 0x30024
-
-
-/*
- * Palette registers
- */
-#define PALETTE_A 0x0a000
-#define PALETTE_B 0x0a800
-
-#endif /* _I810_REG_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/Makefile
deleted file mode 100644
index 3276d396e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i830_dri.so
-
-DRIVER_SOURCES = \
- i830_context.c \
- i830_debug.c \
- i830_ioctl.c \
- i830_render.c \
- i830_screen.c \
- i830_span.c \
- i830_state.c \
- i830_tex.c \
- i830_texmem.c \
- i830_texstate.c \
- i830_tris.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(MINIGLX_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h
deleted file mode 100644
index fa6f407ef..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h
+++ /dev/null
@@ -1,677 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h,v 1.4 2002/12/10 01:26:53 dawes Exp $ */
-#define I830_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value)
-
-#define CMD_3D (0x3<<29)
-
-/* 3DPRIMITIVE, p104 */
-#define PRIM3D_INLINE (CMD_3D | (0x1f<<24))
-#define PRIM3D_INDIRECT_SEQ ((1<<23) | PRIM3D_INLINE)
-#define PRIM3D_INDICES ((1<<23) | PRIM3D_INLINE | (1<<17))
-
-#define PRIM3D_INLINE_CNT(used) ((used / 4) - 2)
-#define PRIM3D_INDICES_CNT(num_indices) ((num_indices + 1) / 2)
-#define PRIM3D_INDIRECT_CNT(verts) (verts)
-
-#define PRIM3D_TRILIST 0
-#define PRIM3D_TRISTRIP (0x1<<18)
-#define PRIM3D_TRISTRIP_RVRSE (0x2<<18)
-#define PRIM3D_TRIFAN (0x3<<18)
-#define PRIM3D_POLY (0x4<<18)
-#define PRIM3D_LINELIST (0x5<<18)
-#define PRIM3D_LINESTRIP (0x6<<18)
-#define PRIM3D_RECTLIST (0x7<<18)
-#define PRIM3D_POINTLIST (0x8<<18)
-#define PRIM3D_DIB (0x9<<18)
-
-/* STATE3D_ANTI_ALIASING, p 123 */
-#define STATE3D_AA_CMD (CMD_3D | (0x06<<24))
-
-#define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16)
-#define AA_LINE_ECAAR_WIDTH_0_5 0
-#define AA_LINE_ECAAR_WIDTH_1_0 (1<<14)
-#define AA_LINE_ECAAR_WIDTH_2_0 (2<<14)
-#define AA_LINE_ECAAR_WIDTH_4_0 (3<<14)
-
-#define AA_LINE_REGION_WIDTH_ENABLE (1<<8)
-#define AA_LINE_REGION_WIDTH_0_5 0
-#define AA_LINE_REGION_WIDTH_1_0 (1<<6)
-#define AA_LINE_REGION_WIDTH_2_0 (2<<6)
-#define AA_LINE_REGION_WIDTH_4_0 (3<<6)
-
-#define AA_LINE_ENABLE ((1<<1) | 1)
-#define AA_LINE_DISABLE (1<<1)
-
-/* STATE3D_BUFFER_INFO, p 124 */
-#define STATE3D_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1)
-/* Dword 1 */
-#define BUF_3D_ID_COLOR_BACK (0x3<<24)
-#define BUF_3D_ID_DEPTH (0x7<<24)
-#define BUF_3D_USE_FENCE (1<<23)
-#define BUF_3D_TILED_SURFACE (1<<22)
-#define BUF_3D_TILE_WALK_X 0
-#define BUF_3D_TILE_WALK_Y (1<<21)
-#define BUF_3D_PITCH(x) ((x)<<2)
-/* Dword 2 */
-#define BUF_3D_ADDR(x) ((x) & ~0x3)
-
-/* STATE3D_COLOR_FACTOR_0, p127 */
-#define STATE3D_COLOR_FACTOR_CMD(stage) (CMD_3D | (0x1d<<24) | ((0x90 + (stage))<<16))
-
-/* STATE3D_CONSTANT_BLEND_COLOR, p128 */
-#define STATE3D_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16))
-
-/* STATE3D_DEFAULT_DIFFUSE, p128 */
-#define STATE3D_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16))
-
-/* STATE3D_DEFAULT_SPECULAR, p129 */
-#define STATE3D_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16))
-
-/* STATE3D_DEFAULT_Z, p129 */
-#define STATE3D_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16))
-
-/* STATE3D_DEST_BUFFER_VARIABLES, p130 */
-#define STATE3D_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16))
-/* Dword 1 */
-#define DSTORG_HORT_BIAS(x) ((x)<<20)
-#define DSTORG_VERT_BIAS(x) ((x)<<16)
-#define COLOR_4_2_2_CHNL_WRT_ALL 0
-#define COLOR_4_2_2_CHNL_WRT_Y (1<<12)
-#define COLOR_4_2_2_CHNL_WRT_CR (2<<12)
-#define COLOR_4_2_2_CHNL_WRT_CB (3<<12)
-#define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12)
-#define COLR_BUF_8BIT 0
-#define COLR_BUF_RGB555 (1<<8)
-#define COLR_BUF_RGB565 (2<<8)
-#define COLR_BUF_ARGB8888 (3<<8)
-#define DEPTH_IS_Z 0
-#define DEPTH_IS_W (1<<6)
-#define DEPTH_FRMT_16_FIXED 0
-#define DEPTH_FRMT_16_FLOAT (1<<2)
-#define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2)
-#define DEPTH_FRMT_24_FLOAT_8_OTHER (3<<2)
-#define VERT_LINE_STRIDE_1 (1<<1)
-#define VERT_LINE_STRIDE_0 0
-#define VERT_LINE_STRIDE_OFS_1 1
-#define VERT_LINE_STRIDE_OFS_0 0
-
-/* STATE3D_DRAWING_RECTANGLE, p133 */
-#define STATE3D_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3)
-/* Dword 1 */
-#define DRAW_RECT_DIS_DEPTH_OFS (1<<30)
-#define DRAW_DITHER_OFS_X(x) ((x)<<26)
-#define DRAW_DITHER_OFS_Y(x) ((x)<<24)
-/* Dword 2 */
-#define DRAW_YMIN(x) ((x)<<16)
-#define DRAW_XMIN(x) (x)
-/* Dword 3 */
-#define DRAW_YMAX(x) ((x)<<16)
-#define DRAW_XMAX(x) (x)
-/* Dword 4 */
-#define DRAW_YORG(x) ((x)<<16)
-#define DRAW_XORG(x) (x)
-
-/* STATE3D_ENABLES_1, p136 */
-#define STATE3D_ENABLES_1_CMD (CMD_3D|(0x3<<24))
-#define ENABLE_LOGIC_OP_MASK ((1<<23)|(1<<22))
-#define ENABLE_LOGIC_OP ((1<<23)|(1<<22))
-#define DISABLE_LOGIC_OP (1<<23)
-#define ENABLE_STENCIL_TEST ((1<<21)|(1<<20))
-#define DISABLE_STENCIL_TEST (1<<21)
-#define ENABLE_DEPTH_BIAS ((1<<11)|(1<<10))
-#define DISABLE_DEPTH_BIAS (1<<11)
-#define ENABLE_SPEC_ADD_MASK ((1<<9)|(1<<8))
-#define ENABLE_SPEC_ADD ((1<<9)|(1<<8))
-#define DISABLE_SPEC_ADD (1<<9)
-#define ENABLE_DIS_FOG_MASK ((1<<7)|(1<<6))
- /* prefixed I830 because ENABLE_FOG defined elsewhere */
-#define I830_ENABLE_FOG ((1<<7)|(1<<6))
-#define I830_DISABLE_FOG (1<<7)
-#define ENABLE_DIS_ALPHA_TEST_MASK ((1<<5)|(1<<4))
-#define ENABLE_ALPHA_TEST ((1<<5)|(1<<4))
-#define DISABLE_ALPHA_TEST (1<<5)
-#define ENABLE_DIS_CBLEND_MASK ((1<<3)|(1<<2))
-#define ENABLE_COLOR_BLEND ((1<<3)|(1<<2))
-#define DISABLE_COLOR_BLEND (1<<3)
-#define ENABLE_DIS_DEPTH_TEST_MASK ((1<<1)|1)
-#define ENABLE_DEPTH_TEST ((1<<1)|1)
-#define DISABLE_DEPTH_TEST (1<<1)
-
-/* STATE3D_ENABLES_2, p138 */
-#define STATE3D_ENABLES_2_CMD (CMD_3D|(0x4<<24))
-#define ENABLE_STENCIL_WRITE ((1<<21)|(1<<20))
-#define DISABLE_STENCIL_WRITE (1<<21)
-#define ENABLE_TEX_CACHE ((1<<17)|(1<<16))
-#define DISABLE_TEX_CACHE (1<<17)
-#define ENABLE_DITHER ((1<<9)|(1<<8))
-#define DISABLE_DITHER (1<<9)
-#define ENABLE_COLOR_MASK (1<<10)
-#define WRITEMASK_ALPHA (1<<7)
-#define WRITEMASK_ALPHA_SHIFT 7
-#define WRITEMASK_RED (1<<6)
-#define WRITEMASK_RED_SHIFT 6
-#define WRITEMASK_GREEN (1<<5)
-#define WRITEMASK_GREEN_SHIFT 5
-#define WRITEMASK_BLUE (1<<4)
-#define WRITEMASK_BLUE_SHIFT 4
-#define WRITEMASK_MASK ((1<<4)|(1<<5)|(1<<6)|(1<<7))
-#define ENABLE_COLOR_WRITE ((1<<3)|(1<<2))
-#define DISABLE_COLOR_WRITE (1<<3)
-#define ENABLE_DIS_DEPTH_WRITE_MASK 0x3
-#define ENABLE_DEPTH_WRITE ((1<<1)|1)
-#define DISABLE_DEPTH_WRITE (1<<1)
-
-/* STATE3D_FOG_COLOR, p139 */
-#define STATE3D_FOG_COLOR_CMD (CMD_3D|(0x15<<24))
-#define FOG_COLOR_RED(x) ((x)<<16)
-#define FOG_COLOR_GREEN(x) ((x)<<8)
-#define FOG_COLOR_BLUE(x) (x)
-
-/* STATE3D_FOG_MODE, p140 */
-#define STATE3D_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2)
-/* Dword 1 */
-#define FOGFUNC_ENABLE (1<<31)
-#define FOGFUNC_VERTEX 0
-#define FOGFUNC_PIXEL_EXP (1<<28)
-#define FOGFUNC_PIXEL_EXP2 (2<<28)
-#define FOGFUNC_PIXEL_LINEAR (3<<28)
-#define FOGSRC_INDEX_Z (1<<27)
-#define FOGSRC_INDEX_W ((1<<27)|(1<<25))
-#define FOG_LINEAR_CONST (1<<24)
-#define FOG_CONST_1(x) ((x)<<4)
-#define ENABLE_FOG_DENSITY (1<<23)
-/* Dword 2 */
-#define FOG_CONST_2(x) (x)
-/* Dword 3 */
-#define FOG_DENSITY(x) (x)
-
-/* STATE3D_INDEPENDENT_ALPHA_BLEND, p142 */
-#define STATE3D_INDPT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24))
-#define ENABLE_INDPT_ALPHA_BLEND ((1<<23)|(1<<22))
-#define DISABLE_INDPT_ALPHA_BLEND (1<<23)
-#define ALPHA_BLENDFUNC_MASK 0x3f0000
-#define ENABLE_ALPHA_BLENDFUNC (1<<21)
-#define ABLENDFUNC_ADD 0
-#define ABLENDFUNC_SUB (1<<16)
-#define ABLENDFUNC_RVSE_SUB (2<<16)
-#define ABLENDFUNC_MIN (3<<16)
-#define ABLENDFUNC_MAX (4<<16)
-#define SRC_DST_ABLEND_MASK 0xfff
-#define ENABLE_SRC_ABLEND_FACTOR (1<<11)
-#define SRC_ABLEND_FACT(x) ((x)<<6)
-#define ENABLE_DST_ABLEND_FACTOR (1<<5)
-#define DST_ABLEND_FACT(x) (x)
-
-#define BLEND_STATE_MASK (ALPHA_BLENDFUNC_MASK | SRC_DST_ABLEND_MASK)
-
-#define BLENDFACT_ZERO 0x01
-#define BLENDFACT_ONE 0x02
-#define BLENDFACT_SRC_COLR 0x03
-#define BLENDFACT_INV_SRC_COLR 0x04
-#define BLENDFACT_SRC_ALPHA 0x05
-#define BLENDFACT_INV_SRC_ALPHA 0x06
-#define BLENDFACT_DST_ALPHA 0x07
-#define BLENDFACT_INV_DST_ALPHA 0x08
-#define BLENDFACT_DST_COLR 0x09
-#define BLENDFACT_INV_DST_COLR 0x0a
-#define BLENDFACT_SRC_ALPHA_SATURATE 0x0b
-#define BLENDFACT_CONST_COLOR 0x0c
-#define BLENDFACT_INV_CONST_COLOR 0x0d
-#define BLENDFACT_CONST_ALPHA 0x0e
-#define BLENDFACT_INV_CONST_ALPHA 0x0f
-
-/* STATE3D_MAP_BLEND_ARG, p152 */
-#define STATE3D_MAP_BLEND_ARG_CMD(stage) (CMD_3D|(0x0e<<24)|((stage)<<20))
-
-#define TEXPIPE_COLOR 0
-#define TEXPIPE_ALPHA (1<<18)
-#define TEXPIPE_KILL (2<<18)
-#define TEXBLEND_ARG0 0
-#define TEXBLEND_ARG1 (1<<15)
-#define TEXBLEND_ARG2 (2<<15)
-#define TEXBLEND_ARG3 (3<<15)
-#define TEXBLENDARG_MODIFY_PARMS (1<<6)
-#define TEXBLENDARG_REPLICATE_ALPHA (1<<5)
-#define TEXBLENDARG_INV_ARG (1<<4)
-#define TEXBLENDARG_ONE 0
-#define TEXBLENDARG_FACTOR 0x01
-#define TEXBLENDARG_ACCUM 0x02
-#define TEXBLENDARG_DIFFUSE 0x03
-#define TEXBLENDARG_SPEC 0x04
-#define TEXBLENDARG_CURRENT 0x05
-#define TEXBLENDARG_TEXEL0 0x06
-#define TEXBLENDARG_TEXEL1 0x07
-#define TEXBLENDARG_TEXEL2 0x08
-#define TEXBLENDARG_TEXEL3 0x09
-#define TEXBLENDARG_FACTOR_N 0x0e
-
-/* STATE3D_MAP_BLEND_OP, p155 */
-#define STATE3D_MAP_BLEND_OP_CMD(stage) (CMD_3D|(0x0d<<24)|((stage)<<20))
-#if 0
-#define TEXPIPE_COLOR 0
-#define TEXPIPE_ALPHA (1<<18)
-#define TEXPIPE_KILL (2<<18)
-#endif
-#define ENABLE_TEXOUTPUT_WRT_SEL (1<<17)
-#define TEXOP_OUTPUT_CURRENT 0
-#define TEXOP_OUTPUT_ACCUM (1<<15)
-#define ENABLE_TEX_CNTRL_STAGE ((1<<12)|(1<<11))
-#define DISABLE_TEX_CNTRL_STAGE (1<<12)
-#define TEXOP_SCALE_SHIFT 9
-#define TEXOP_SCALE_1X (0 << TEXOP_SCALE_SHIFT)
-#define TEXOP_SCALE_2X (1 << TEXOP_SCALE_SHIFT)
-#define TEXOP_SCALE_4X (2 << TEXOP_SCALE_SHIFT)
-#define TEXOP_MODIFY_PARMS (1<<8)
-#define TEXOP_LAST_STAGE (1<<7)
-#define TEXBLENDOP_KILLPIXEL 0x02
-#define TEXBLENDOP_ARG1 0x01
-#define TEXBLENDOP_ARG2 0x02
-#define TEXBLENDOP_MODULATE 0x03
-#define TEXBLENDOP_ADD 0x06
-#define TEXBLENDOP_ADDSIGNED 0x07
-#define TEXBLENDOP_BLEND 0x08
-#define TEXBLENDOP_BLEND_AND_ADD 0x09
-#define TEXBLENDOP_SUBTRACT 0x0a
-#define TEXBLENDOP_DOT3 0x0b
-#define TEXBLENDOP_DOT4 0x0c
-#define TEXBLENDOP_MODULATE_AND_ADD 0x0d
-#define TEXBLENDOP_MODULATE_2X_AND_ADD 0x0e
-#define TEXBLENDOP_MODULATE_4X_AND_ADD 0x0f
-
-/* STATE3D_MAP_BUMP_TABLE, p160 TODO */
-/* STATE3D_MAP_COLOR_CHROMA_KEY, p161 TODO */
-
-/* STATE3D_MAP_COORD_SET_BINDINGS, p162 */
-#define STATE3D_MAP_COORD_SETBIND_CMD (CMD_3D|(0x1d<<24)|(0x02<<16))
-#define TEXBIND_MASK3 ((1<<15)|(1<<14)|(1<<13)|(1<<12))
-#define TEXBIND_MASK2 ((1<<11)|(1<<10)|(1<<9)|(1<<8))
-#define TEXBIND_MASK1 ((1<<7)|(1<<6)|(1<<5)|(1<<4))
-#define TEXBIND_MASK0 ((1<<3)|(1<<2)|(1<<1)|1)
-
-#define TEXBIND_SET3(x) ((x)<<12)
-#define TEXBIND_SET2(x) ((x)<<8)
-#define TEXBIND_SET1(x) ((x)<<4)
-#define TEXBIND_SET0(x) (x)
-
-#define TEXCOORDSRC_KEEP 0
-#define TEXCOORDSRC_DEFAULT 0x01
-#define TEXCOORDSRC_VTXSET_0 0x08
-#define TEXCOORDSRC_VTXSET_1 0x09
-#define TEXCOORDSRC_VTXSET_2 0x0a
-#define TEXCOORDSRC_VTXSET_3 0x0b
-#define TEXCOORDSRC_VTXSET_4 0x0c
-#define TEXCOORDSRC_VTXSET_5 0x0d
-#define TEXCOORDSRC_VTXSET_6 0x0e
-#define TEXCOORDSRC_VTXSET_7 0x0f
-
-#define MAP_UNIT(unit) ((unit)<<16)
-#define MAP_UNIT_MASK (3<<16)
-
-/* STATE3D_MAP_COORD_SETS, p164 */
-#define STATE3D_MAP_COORD_SET_CMD (CMD_3D|(0x1c<<24)|(0x01<<19))
-#define ENABLE_TEXCOORD_PARAMS (1<<15)
-#define TEXCOORDS_ARE_NORMAL (1<<14)
-#define TEXCOORDS_ARE_IN_TEXELUNITS 0
-#define TEXCOORDTYPE_CARTESIAN 0
-#define TEXCOORDTYPE_HOMOGENEOUS (1<<11)
-#define TEXCOORDTYPE_VECTOR (2<<11)
-#define ENABLE_ADDR_V_CNTL (1<<7)
-#define ENABLE_ADDR_U_CNTL (1<<3)
-#define TEXCOORD_ADDR_V_MODE(x) ((x)<<4)
-#define TEXCOORD_ADDR_U_MODE(x) (x)
-#define TEXCOORDMODE_WRAP 0
-#define TEXCOORDMODE_MIRROR 1
-#define TEXCOORDMODE_CLAMP 2
-#define TEXCOORDMODE_WRAP_SHORTEST 3
-#define TEXCOORDMODE_CLAMP_BORDER 4
-#define TEXCOORD_ADDR_V_MASK 0x70
-#define TEXCOORD_ADDR_U_MASK 0x7
-
-/* STATE3D_MAP_CUBE, p168 TODO */
-#define STATE3D_MAP_CUBE (CMD_3D|(0x1c<<24)|(0x0a<<19))
-#define CUBE_NEGX_ENABLE (1<<5)
-#define CUBE_POSX_ENABLE (1<<4)
-#define CUBE_NEGY_ENABLE (1<<3)
-#define CUBE_POSY_ENABLE (1<<2)
-#define CUBE_NEGZ_ENABLE (1<<1)
-#define CUBE_POSZ_ENABLE (1<<0)
-
-
-/* STATE3D_MODES_1, p190 */
-#define STATE3D_MODES_1_CMD (CMD_3D|(0x08<<24))
-#define BLENDFUNC_MASK 0x3f0000
-#define ENABLE_COLR_BLND_FUNC (1<<21)
-#define BLENDFUNC_ADD 0
-#define BLENDFUNC_SUB (1<<16)
-#define BLENDFUNC_RVRSE_SUB (2<<16)
-#define BLENDFUNC_MIN (3<<16)
-#define BLENDFUNC_MAX (4<<16)
-#define SRC_DST_BLND_MASK 0xfff
-#define ENABLE_SRC_BLND_FACTOR (1<<11)
-#define ENABLE_DST_BLND_FACTOR (1<<5)
-#define SRC_BLND_FACT(x) ((x)<<6)
-#define DST_BLND_FACT(x) (x)
-
-/* Use the blendfact defines for BLND_FACTOR macros */
-#if 0
-#define BLENDFACT_ZERO 0x01
-#define BLENDFACT_ONE 0x02
-#define BLENDFACT_SRC_COLR 0x03
-#define BLENDFACT_INV_SRC_COLR 0x04
-#define BLENDFACT_SRC_ALPHA 0x05
-#define BLENDFACT_INV_SRC_ALPHA 0x06
-#define BLENDFACT_DST_ALPHA 0x07
-#define BLENDFACT_INV_DST_ALPHA 0x08
-#define BLENDFACT_CONST_ALPHA 0x0e
-#define BLENDFACT_INV_CONST_ALPHA 0x0f
-#endif
-
-/* STATE3D_MODES_2, p192 */
-#define STATE3D_MODES_2_CMD (CMD_3D|(0x0f<<24))
-#define ENABLE_GLOBAL_DEPTH_BIAS (1<<22)
-#define GLOBAL_DEPTH_BIAS(x) ((x)<<14)
-#define ENABLE_ALPHA_TEST_FUNC (1<<13)
-#define ENABLE_ALPHA_REF_VALUE (1<<8)
-#define ALPHA_TEST_FUNC(x) ((x)<<9)
-#define ALPHA_REF_VALUE(x) (x)
-
-#define ALPHA_TEST_REF_MASK 0x3fff
-#define COMPAREFUNC_ALWAYS 0
-#define COMPAREFUNC_NEVER 0x1
-#define COMPAREFUNC_LESS 0x2
-#define COMPAREFUNC_EQUAL 0x3
-#define COMPAREFUNC_LEQUAL 0x4
-#define COMPAREFUNC_GREATER 0x5
-#define COMPAREFUNC_NOTEQUAL 0x6
-#define COMPAREFUNC_GEQUAL 0x7
-
-/* STATE3D_MODES_3, p193 */
-#define STATE3D_MODES_3_CMD (CMD_3D|(0x02<<24))
-#define DEPTH_TEST_FUNC_MASK 0x1f0000
-#define ENABLE_DEPTH_TEST_FUNC (1<<20)
-/* Uses COMPAREFUNC */
-#define DEPTH_TEST_FUNC(x) ((x)<<16)
-#define ENABLE_ALPHA_SHADE_MODE (1<<11)
-#define ENABLE_FOG_SHADE_MODE (1<<9)
-#define ENABLE_SPEC_SHADE_MODE (1<<7)
-#define ENABLE_COLOR_SHADE_MODE (1<<5)
-#define ALPHA_SHADE_MODE(x) ((x)<<10)
-#define FOG_SHADE_MODE(x) ((x)<<8)
-#define SPEC_SHADE_MODE(x) ((x)<<6)
-#define COLOR_SHADE_MODE(x) ((x)<<4)
-#define CULLMODE_MASK 0xf
-#define ENABLE_CULL_MODE (1<<3)
-#define CULLMODE_BOTH 0
-#define CULLMODE_NONE 1
-#define CULLMODE_CW 2
-#define CULLMODE_CCW 3
-
-#define SHADE_MODE_LINEAR 0
-#define SHADE_MODE_FLAT 0x1
-
-/* STATE3D_MODES_4, p195 */
-#define STATE3D_MODES_4_CMD (CMD_3D|(0x16<<24))
-#define ENABLE_LOGIC_OP_FUNC (1<<23)
-#define LOGIC_OP_FUNC(x) ((x)<<18)
-#define LOGICOP_MASK ((1<<18)|(1<<19)|(1<<20)|(1<<21))
-#define LOGICOP_CLEAR 0
-#define LOGICOP_NOR 0x1
-#define LOGICOP_AND_INV 0x2
-#define LOGICOP_COPY_INV 0x3
-#define LOGICOP_AND_RVRSE 0x4
-#define LOGICOP_INV 0x5
-#define LOGICOP_XOR 0x6
-#define LOGICOP_NAND 0x7
-#define LOGICOP_AND 0x8
-#define LOGICOP_EQUIV 0x9
-#define LOGICOP_NOOP 0xa
-#define LOGICOP_OR_INV 0xb
-#define LOGICOP_COPY 0xc
-#define LOGICOP_OR_RVRSE 0xd
-#define LOGICOP_OR 0xe
-#define LOGICOP_SET 0xf
-#define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00))
-#define ENABLE_STENCIL_TEST_MASK (1<<17)
-#define STENCIL_TEST_MASK(x) ((x)<<8)
-#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff))
-#define ENABLE_STENCIL_WRITE_MASK (1<<16)
-#define STENCIL_WRITE_MASK(x) (x)
-
-/* STATE3D_MODES_5, p196 */
-#define STATE3D_MODES_5_CMD (CMD_3D|(0x0c<<24))
-#define ENABLE_SPRITE_POINT_TEX (1<<23)
-#define SPRITE_POINT_TEX_ON (1<<22)
-#define SPRITE_POINT_TEX_OFF 0
-#define FLUSH_RENDER_CACHE (1<<18)
-#define FLUSH_TEXTURE_CACHE (1<<16)
-#define FIXED_LINE_WIDTH_MASK 0xfc00
-#define ENABLE_FIXED_LINE_WIDTH (1<<15)
-#define FIXED_LINE_WIDTH(x) ((x)<<10)
-#define FIXED_POINT_WIDTH_MASK 0x3ff
-#define ENABLE_FIXED_POINT_WIDTH (1<<9)
-#define FIXED_POINT_WIDTH(x) (x)
-
-/* STATE3D_RASTERIZATION_RULES, p198 */
-#define STATE3D_RASTER_RULES_CMD (CMD_3D|(0x07<<24))
-#define ENABLE_POINT_RASTER_RULE (1<<15)
-#define OGL_POINT_RASTER_RULE (1<<13)
-#define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8)
-#define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5)
-#define ENABLE_TRI_STRIP_PROVOKE_VRTX (1<<2)
-#define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6)
-#define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3)
-#define TRI_STRIP_PROVOKE_VRTX(x) (x)
-
-/* STATE3D_SCISSOR_ENABLE, p200 */
-#define STATE3D_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19))
-#define ENABLE_SCISSOR_RECT ((1<<1) | 1)
-#define DISABLE_SCISSOR_RECT (1<<1)
-
-/* STATE3D_SCISSOR_RECTANGLE_0, p201 */
-#define STATE3D_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1)
-/* Dword 1 */
-#define SCISSOR_RECT_0_YMIN(x) ((x)<<16)
-#define SCISSOR_RECT_0_XMIN(x) (x)
-/* Dword 2 */
-#define SCISSOR_RECT_0_YMAX(x) ((x)<<16)
-#define SCISSOR_RECT_0_XMAX(x) (x)
-
-/* STATE3D_STENCIL_TEST, p202 */
-#define STATE3D_STENCIL_TEST_CMD (CMD_3D|(0x09<<24))
-#define ENABLE_STENCIL_PARMS (1<<23)
-#define STENCIL_OPS_MASK (0xffc000)
-#define STENCIL_FAIL_OP(x) ((x)<<20)
-#define STENCIL_PASS_DEPTH_FAIL_OP(x) ((x)<<17)
-#define STENCIL_PASS_DEPTH_PASS_OP(x) ((x)<<14)
-
-#define STENCILOP_KEEP 0
-#define STENCILOP_ZERO 0x1
-#define STENCILOP_REPLACE 0x2
-#define STENCILOP_INCRSAT 0x3
-#define STENCILOP_DECRSAT 0x4
-#define STENCILOP_INCR 0x5
-#define STENCILOP_DECR 0x6
-#define STENCILOP_INVERT 0x7
-
-#define ENABLE_STENCIL_TEST_FUNC_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9))
-#define ENABLE_STENCIL_TEST_FUNC (1<<13)
-/* Uses COMPAREFUNC */
-#define STENCIL_TEST_FUNC(x) ((x)<<9)
-#define STENCIL_REF_VALUE_MASK ((1<<8)|0xff)
-#define ENABLE_STENCIL_REF_VALUE (1<<8)
-#define STENCIL_REF_VALUE(x) (x)
-
-/* STATE3D_VERTEX_FORMAT, p204 */
-#define STATE3D_VERTEX_FORMAT_CMD (CMD_3D|(0x05<<24))
-#define VRTX_HAS_POINT_WIDTH (1<<12)
-#define VRTX_TEX_COORD_COUNT(x) ((x)<<8)
-#define VRTX_HAS_SPEC (1<<7)
-#define VRTX_HAS_DIFFUSE (1<<6)
-#define VRTX_HAS_DEPTH_OFS (1<<5)
-#define VRTX_HAS_XYZ (1<<1)
-#define VRTX_HAS_XYZW (2<<1)
-#define VRTX_HAS_XY (3<<1)
-#define VRTX_HAS_XYW (4<<1)
-
-/* STATE3D_VERTEX_FORMAT_2, p206 */
-#define STATE3D_VERTEX_FORMAT_2_CMD (CMD_3D|(0x0a<<24))
-#define VRTX_TEX_SET_7_FMT(x) ((x)<<14)
-#define VRTX_TEX_SET_6_FMT(x) ((x)<<12)
-#define VRTX_TEX_SET_5_FMT(x) ((x)<<10)
-#define VRTX_TEX_SET_4_FMT(x) ((x)<<8)
-#define VRTX_TEX_SET_3_FMT(x) ((x)<<6)
-#define VRTX_TEX_SET_2_FMT(x) ((x)<<4)
-#define VRTX_TEX_SET_1_FMT(x) ((x)<<2)
-#define VRTX_TEX_SET_0_FMT(x) (x)
-
-#define TEXCOORDFMT_2D 0
-#define TEXCOORDFMT_3D 1
-#define TEXCOORDFMT_4D 2
-#define TEXCOORDFMT_1D 3
-
-/*New stuff picked up along the way */
-
-#define MLC_LOD_BIAS_MASK ((1<<7)-1)
-
-
-/* STATE3D_VERTEX_TRANSFORM, p207 */
-#define STATE3D_VERTEX_TRANS_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|0)
-#define STATE3D_VERTEX_TRANS_MTX_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|6)
-/* Dword 1 */
-#define ENABLE_VIEWPORT_TRANSFORM ((1<<31)|(1<<30))
-#define DISABLE_VIEWPORT_TRANSFORM (1<<31)
-#define ENABLE_PERSP_DIVIDE ((1<<29)|(1<<28))
-#define DISABLE_PERSP_DIVIDE (1<<29)
-#define VRTX_TRANS_LOAD_MATRICES 0x7421
-#define VRTX_TRANS_NO_LOAD_MATRICES 0x0000
-/* Dword 2 -> 7 are matrix elements */
-
-/* STATE3D_W_STATE, p209 */
-#define STATE3D_W_STATE_CMD (CMD_3D|(0x1d<<24)|(0x8d<<16)|1)
-/* Dword 1 */
-#define MAGIC_W_STATE_DWORD1 0x00000008
-/* Dword 2 */
-#define WFAR_VALUE(x) (x)
-
-/* if defining I830_ENABLE_4_TEXTURES, do it in i830_drm.h, too */
-
-#define I830PACKCOLOR4444(r,g,b,a) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-#define I830PACKCOLOR1555(r,g,b,a) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define I830PACKCOLOR565(r,g,b) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define I830PACKCOLOR8888(r,g,b,a) \
- ((a<<24) | (r<<16) | (g<<8) | b)
-
-
-/* Stipple command, carried over from the i810, apparently:
- */
-#define GFX_OP_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16))
-#define ST1_ENABLE (1<<16)
-#define ST1_MASK (0xffff)
-
-
-
-#define STATE3D_LOAD_STATE_IMMEDIATE_2 ((0x3<<29)|(0x1d<<24)|(0x03<<16))
-#define LOAD_TEXTURE_MAP0 (1<<11)
-
-#define TM0S0_ADDRESS_MASK 0xfffffffc
-#define TM0S0_USE_FENCE (1<<1)
-
-#define TM0S1_HEIGHT_SHIFT 21
-#define TM0S1_WIDTH_SHIFT 10
-#define TM0S1_PALETTE_SELECT (1<<9)
-#define TM0S1_MAPSURF_FORMAT_MASK (0x7 << 6)
-#define TM0S1_MAPSURF_FORMAT_SHIFT 6
-#define MAPSURF_8BIT_INDEXED (0<<6)
-#define MAPSURF_8BIT (1<<6)
-#define MAPSURF_16BIT (2<<6)
-#define MAPSURF_32BIT (3<<6)
-#define MAPSURF_411 (4<<6)
-#define MAPSURF_422 (5<<6)
-#define MAPSURF_COMPRESSED (6<<6)
-#define MAPSURF_4BIT_INDEXED (7<<6)
-#define TM0S1_MT_FORMAT_MASK (0x7 << 3)
-#define TM0S1_MT_FORMAT_SHIFT 3
-#define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */
-#define MT_8BIT_IDX_RGB565 (0<<3) /* SURFACE_8BIT_INDEXED */
-#define MT_8BIT_IDX_ARGB1555 (1<<3)
-#define MT_8BIT_IDX_ARGB4444 (2<<3)
-#define MT_8BIT_IDX_AY88 (3<<3)
-#define MT_8BIT_IDX_ABGR8888 (4<<3)
-#define MT_8BIT_IDX_BUMP_88DVDU (5<<3)
-#define MT_8BIT_IDX_BUMP_655LDVDU (6<<3)
-#define MT_8BIT_IDX_ARGB8888 (7<<3)
-#define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */
-#define MT_8BIT_L8 (1<<3)
-#define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */
-#define MT_16BIT_ARGB1555 (1<<3)
-#define MT_16BIT_ARGB4444 (2<<3)
-#define MT_16BIT_AY88 (3<<3)
-#define MT_16BIT_DIB_ARGB1555_8888 (4<<3)
-#define MT_16BIT_BUMP_88DVDU (5<<3)
-#define MT_16BIT_BUMP_655LDVDU (6<<3)
-#define MT_16BIT_DIB_RGB565_8888 (7<<3)
-#define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */
-#define MT_32BIT_ABGR8888 (1<<3)
-#define MT_32BIT_BUMP_XLDVDU_8888 (6<<3)
-#define MT_32BIT_DIB_8888 (7<<3)
-#define MT_411_YUV411 (0<<3) /* SURFACE_411 */
-#define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */
-#define MT_422_YCRCB_NORMAL (1<<3)
-#define MT_422_YCRCB_SWAPUV (2<<3)
-#define MT_422_YCRCB_SWAPUVY (3<<3)
-#define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */
-#define MT_COMPRESS_DXT2_3 (1<<3)
-#define MT_COMPRESS_DXT4_5 (2<<3)
-#define MT_COMPRESS_FXT1 (3<<3)
-#define TM0S1_COLORSPACE_CONVERSION (1 << 2)
-#define TM0S1_TILED_SURFACE (1 << 1)
-#define TM0S1_TILE_WALK (1 << 0)
-
-#define TM0S2_PITCH_SHIFT 21
-#define TM0S2_CUBE_FACE_ENA_SHIFT 15
-#define TM0S2_MAP_FORMAT (1<<14)
-#define TM0S2_VERTICAL_LINE_STRIDE (1<<13)
-#define TM0S2_VERITCAL_LINE_STRIDE_OFF (1<<12)
-#define TM0S2_OUTPUT_CHAN_SHIFT 10
-#define TM0S2_OUTPUT_CHAN_MASK (3<<10)
-
-#define TM0S3_MIP_FILTER_MASK (0x3<<30)
-#define TM0S3_MIP_FILTER_SHIFT 30
-#define MIPFILTER_NONE 0
-#define MIPFILTER_NEAREST 1
-#define MIPFILTER_LINEAR 3
-#define TM0S3_MAG_FILTER_MASK (0x3<<28)
-#define TM0S3_MAG_FILTER_SHIFT 28
-#define TM0S3_MIN_FILTER_MASK (0x3<<26)
-#define TM0S3_MIN_FILTER_SHIFT 26
-#define FILTER_NEAREST 0
-#define FILTER_LINEAR 1
-#define FILTER_ANISOTROPIC 2
-
-#define TM0S3_LOD_BIAS_SHIFT 17
-#define TM0S3_LOD_BIAS_MASK (0x1ff<<17)
-#define TM0S3_MAX_MIP_SHIFT 9
-#define TM0S3_MAX_MIP_MASK (0xff<<9)
-#define TM0S3_MIN_MIP_SHIFT 3
-#define TM0S3_MIN_MIP_MASK (0x3f<<3)
-#define TM0S3_KILL_PIXEL (1<<2)
-#define TM0S3_KEYED_FILTER (1<<1)
-#define TM0S3_CHROMA_KEY (1<<0)
-
-
-/* STATE3D_MAP_TEXEL_STREAM, p188 */
-#define STATE3D_MAP_TEX_STREAM_CMD (CMD_3D|(0x1c<<24)|(0x05<<19))
-#define DISABLE_TEX_STREAM_BUMP (1<<12)
-#define ENABLE_TEX_STREAM_BUMP ((1<<12)|(1<<11))
-#define TEX_MODIFY_UNIT_0 0
-#define TEX_MODIFY_UNIT_1 (1<<8)
-#define ENABLE_TEX_STREAM_COORD_SET (1<<7)
-#define TEX_STREAM_COORD_SET(x) ((x)<<4)
-#define ENABLE_TEX_STREAM_MAP_IDX (1<<3)
-#define TEX_STREAM_MAP_IDX(x) (x)
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.c
deleted file mode 100644
index 45fcbd2e3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/**************************************************************************
- *
- * 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.
- *
- * **************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_context.c,v 1.9 2003/02/06 04:18:00 dawes Exp $ */
-
-/**
- * \file i830_context.c
- *
- * Heavily Based on I810 driver written by Keith Whitwell.
- *
- * \author Jeff Hartmann <jhartmann@2d3d.com>
- * \author Graeme Fisher <graeme@2d3d.co.za>
- * \author Abraham vd Merwe <abraham@2d3d.co.za>
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "imports.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_state.h"
-#include "i830_tex.h"
-#include "i830_span.h"
-#include "i830_tris.h"
-#include "i830_ioctl.h"
-
-
-#include "utils.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_EXT_blend_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_secondary_color
-#include "extension_helper.h"
-
-#include "xmlpool.h" /* for symbolic values of enum-type options */
-#ifndef I830_DEBUG
-int I830_DEBUG = (0);
-#endif
-
-/***************************************
- * Mesa's Driver Functions
- ***************************************/
-
-#define DRIVER_DATE "20041007"
-
-
-static const GLubyte *i830DDGetString( GLcontext *ctx, GLenum name )
-{
- const char * chipset;
- static char buffer[128];
-
- switch (name) {
- case GL_VENDOR:
- switch (I830_CONTEXT(ctx)->i830Screen->deviceID) {
- case PCI_CHIP_845_G:
- return (GLubyte *)"2d3D, Inc";
-
- case PCI_CHIP_I830_M:
- return (GLubyte *)"VA Linux, Inc";
-
- case PCI_CHIP_I855_GM:
- case PCI_CHIP_I865_G:
- default:
- return (GLubyte *)"Tungsten Graphics, Inc";
- }
- break;
-
- case GL_RENDERER:
- switch (I830_CONTEXT(ctx)->i830Screen->deviceID) {
- case PCI_CHIP_845_G:
- chipset = "Intel(R) 845G"; break;
- case PCI_CHIP_I830_M:
- chipset = "Intel(R) 830M"; break;
- case PCI_CHIP_I855_GM:
- chipset = "Intel(R) 852GM/855GM"; break;
- case PCI_CHIP_I865_G:
- chipset = "Intel(R) 865G"; break;
- default:
- chipset = "Unknown Intel Chipset"; break;
- }
-
- (void) driGetRendererString( buffer, chipset, DRIVER_DATE, 0 );
- return (GLubyte *) buffer;
-
- default:
- return NULL;
- }
-}
-
-static void i830BufferSize(GLframebuffer *buffer,
- GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE(imesa);
- *width = imesa->driDrawable->w;
- *height = imesa->driDrawable->h;
- UNLOCK_HARDWARE(imesa);
-}
-
-
-/* Extension strings exported by the i830 driver.
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_ARB_texture_env_crossbar", NULL },
- { "GL_ARB_texture_env_dot3", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_EXT_blend_color", GL_EXT_blend_color_functions },
- { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
- { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
- { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
- { "GL_EXT_blend_subtract", NULL },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_EXT_texture_env_combine", NULL },
- { "GL_EXT_texture_env_dot3", NULL },
- { "GL_EXT_texture_filter_anisotropic", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_EXT_texture_rectangle", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-
-extern const struct tnl_pipeline_stage _i830_render_stage;
-
-static const struct tnl_pipeline_stage *i830_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
-#if 1
- &_i830_render_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "tex", DEBUG_TEXTURE },
- { "ioctl", DEBUG_IOCTL },
- { "prim", DEBUG_PRIMS },
- { "vert", DEBUG_VERTS },
- { "state", DEBUG_STATE },
- { "verb", DEBUG_VERBOSE },
- { "dri", DEBUG_DRI },
- { "dma", DEBUG_DMA },
- { "san", DEBUG_SANITY },
- { "sync", DEBUG_SYNC },
- { "sleep", DEBUG_SLEEP },
- { NULL, 0 }
-};
-
-
-GLboolean i830CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- GLcontext *ctx , *shareCtx;
- i830ContextPtr imesa;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- i830ScreenPrivate *screen = (i830ScreenPrivate *)sPriv->private;
- I830SAREAPtr saPriv=(I830SAREAPtr)
- (((GLubyte *)sPriv->pSAREA)+screen->sarea_priv_offset);
- struct dd_function_table functions;
-
- /* Allocate i830 context */
- imesa = (i830ContextPtr) CALLOC_STRUCT(i830_context_t);
- if (!imesa)
- return GL_FALSE;
-
- /* Init default driver functions then plug in our I830-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions(&functions);
- i830InitIoctlFuncs(&functions);
- i830InitTextureFuncs(&functions);
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((i830ContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- imesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
- &functions, (void*) imesa);
- if (!imesa->glCtx) {
- FREE(imesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = imesa;
-
-
- imesa->i830Screen = screen;
- imesa->driScreen = sPriv;
- imesa->sarea = saPriv;
- imesa->glBuffer = NULL;
-
- driParseConfigFiles (&imesa->optionCache, &screen->optionCache,
- screen->driScrnPriv->myNum, "i830");
-
- (void) memset( imesa->texture_heaps, 0, sizeof( imesa->texture_heaps ) );
- make_empty_list( & imesa->swapped );
-
- imesa->nr_heaps = 1;
- imesa->texture_heaps[0] = driCreateTextureHeap( 0, imesa,
- screen->textureSize,
- 12,
- I830_NR_TEX_REGIONS,
- imesa->sarea->texList,
- (unsigned *) & imesa->sarea->texAge, /* XXX shouldn't need cast! */
- & imesa->swapped,
- sizeof( struct i830_texture_object_t ),
- (destroy_texture_object_t *) i830DestroyTexObj );
-
- /* Set the maximum texture size small enough that we can guarantee
- * that every texture unit can bind a maximal texture and have them
- * in memory at once.
- */
-
- ctx = imesa->glCtx;
- ctx->Const.MaxTextureUnits = driQueryOptioni(&imesa->optionCache,
- "texture_units");
- ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
- ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
-
- /* FIXME: driCalculateMaxTextureLevels assumes that mipmaps are tightly
- * FIXME: packed, but they're not in Intel graphics hardware.
- */
- driCalculateMaxTextureLevels( imesa->texture_heaps,
- imesa->nr_heaps,
- & ctx->Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 0, /* 3D textures unsupported */
- 0, /* cube textures unsupported. */
- 0, /* texture rectangles unsupported. */
- 12,
- GL_FALSE );
-
- ctx->Const.MaxTextureMaxAnisotropy = 2.0;
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 3.0;
- ctx->Const.MaxLineWidthAA = 3.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 255.0;
- ctx->Const.MaxPointSizeAA = 3.0;
- ctx->Const.PointSizeGranularity = 1.0;
-
- ctx->Driver.GetBufferSize = i830BufferSize;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
- ctx->Driver.GetString = i830DDGetString;
-
- /* Who owns who? */
- ctx->DriverCtx = (void *) imesa;
- imesa->glCtx = ctx;
-
- /* Initialize the software rasterizer and helper modules. */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline: */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, i830_pipeline );
-
- /* Configure swrast and T&L to match hardware characteristics: */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
- /* Dri stuff */
- imesa->hHWContext = driContextPriv->hHWContext;
- imesa->driFd = sPriv->fd;
- /* drmLock ptr = &drm_hw_lock_t */
- imesa->driHwLock = (drmLock *) &sPriv->pSAREA->lock;
- imesa->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
-
- switch(mesaVis->depthBits) {
- case 16:
- imesa->depth_scale = 1.0/0xffff;
- imesa->depth_clear_mask = ~0;
- imesa->ClearDepth = 0xffff;
- break;
- case 24:
- imesa->depth_scale = 1.0/0xffffff;
- imesa->depth_clear_mask = 0x00ffffff;
- imesa->stencil_clear_mask = 0xff000000;
- imesa->ClearDepth = 0x00ffffff;
- break;
- case 32: /* Not supported */
- default:
- break;
- }
- /* Completely disable stenciling for now, there are some serious issues
- * with stencil.
- */
-#if 0
- imesa->hw_stencil = 0;
-#endif
-
- imesa->RenderIndex = ~0;
- imesa->dirty = ~0;
- imesa->upload_cliprects = GL_TRUE;
-
- imesa->CurrentTexObj[0] = 0;
- imesa->CurrentTexObj[1] = 0;
-
- imesa->do_irqs = (imesa->i830Screen->irq_active &&
- !getenv("I830_NO_IRQS"));
-
- _math_matrix_ctr (&imesa->ViewportMatrix);
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
-
- if (imesa->glCtx->Mesa_DXTn) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- _mesa_enable_extension( ctx, "GL_S3_s3tc" );
- }
- else if (driQueryOptionb (&imesa->optionCache, "force_s3tc_enable")) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- }
-
- _mesa_enable_extension( ctx, "GL_3DFX_texture_compression_FXT1" );
-
- /* XXX these should really go right after _mesa_init_driver_functions() */
- i830DDInitStateFuncs( ctx );
- i830InitTriFuncs (ctx);
- i830DDInitSpanFuncs( ctx );
- i830DDInitState (ctx);
-
-#if DO_DEBUG
- I830_DEBUG = driParseDebugString( getenv( "I830_DEBUG" ),
- debug_control );
- I830_DEBUG |= driParseDebugString( getenv( "INTEL_DEBUG" ),
- debug_control );
-#endif
-
- if (getenv("I830_NO_RAST") ||
- getenv("INTEL_NO_RAST")) {
- fprintf(stderr, "disabling 3D rasterization\n");
- FALLBACK(imesa, I830_FALLBACK_USER, 1);
- }
-
- return GL_TRUE;
-}
-
-void i830DestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- i830ContextPtr imesa = (i830ContextPtr) driContextPriv->driverPrivate;
-
- assert(imesa); /* should never be null */
- if (imesa) {
- GLboolean release_texture_heaps;
-
-
- release_texture_heaps = (imesa->glCtx->Shared->RefCount == 1);
- _swsetup_DestroyContext (imesa->glCtx);
- _tnl_DestroyContext (imesa->glCtx);
- _ac_DestroyContext (imesa->glCtx);
- _swrast_DestroyContext (imesa->glCtx);
-
- /* free the Mesa context */
- imesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(imesa->glCtx);
-
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- int i;
-
- for ( i = 0 ; i < imesa->nr_heaps ; i++ ) {
- driDestroyTextureHeap( imesa->texture_heaps[ i ] );
- imesa->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & imesa->swapped ) );
- }
-
- FREE(imesa);
- }
-}
-
-void i830XMesaSetFrontClipRects( i830ContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
-
- i830EmitDrawingRectangle( imesa );
- imesa->upload_cliprects = GL_TRUE;
-}
-
-void i830XMesaSetBackClipRects( i830ContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- if (imesa->sarea->pf_enabled == 0 && dPriv->numBackClipRects == 0) {
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
- } else {
- imesa->numClipRects = dPriv->numBackClipRects;
- imesa->pClipRects = dPriv->pBackClipRects;
- imesa->drawX = dPriv->backX;
- imesa->drawY = dPriv->backY;
- }
-
- i830EmitDrawingRectangle( imesa );
- imesa->upload_cliprects = GL_TRUE;
-}
-
-static void i830XMesaWindowMoved( i830ContextPtr imesa )
-{
- switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- i830XMesaSetFrontClipRects( imesa );
- break;
- case BUFFER_BIT_BACK_LEFT:
- i830XMesaSetBackClipRects( imesa );
- break;
- default:
- /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
- i830XMesaSetFrontClipRects( imesa );
- }
-}
-
-GLboolean i830UnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- i830ContextPtr imesa = (i830ContextPtr) driContextPriv->driverPrivate;
- unsigned i;
-
- if (imesa) {
- /* Might want to change this so texblend isn't always updated */
- imesa->dirty |= (I830_UPLOAD_CTX |
- I830_UPLOAD_BUFFERS |
- I830_UPLOAD_STIPPLE |
- I830_UPLOAD_TEXBLEND0 |
- I830_UPLOAD_TEXBLEND1 |
- I830_UPLOAD_TEXBLEND2 |
- I830_UPLOAD_TEXBLEND3);
-
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if (imesa->CurrentTexObj[i]) imesa->dirty |= I830_UPLOAD_TEX_N( i );
- }
- }
- return GL_TRUE;
-}
-
-GLboolean i830MakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
-
- if (driContextPriv) {
- i830ContextPtr imesa = (i830ContextPtr) driContextPriv->driverPrivate;
-
- if ( imesa->driDrawable != driDrawPriv ) {
- imesa->driDrawable = driDrawPriv;
- i830XMesaWindowMoved( imesa );
- imesa->mesa_drawable = driDrawPriv;
- }
-
- imesa->driReadable = driReadPriv;
-
- _mesa_make_current(imesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
- } else {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-void i830GetLock( i830ContextPtr imesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- __DRIscreenPrivate *sPriv = imesa->driScreen;
- I830SAREAPtr sarea = imesa->sarea;
- int me = imesa->hHWContext;
- unsigned i;
-
- drmGetLock(imesa->driFd, imesa->hHWContext, flags);
-
- /* If the window moved, may need to set a new cliprect now.
- *
- * NOTE: This releases and regains the hw lock, so all state
- * checking must be done *after* this call:
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv);
-
- /* If we lost context, need to dump all registers to hardware.
- * Note that we don't care about 2d contexts, even if they perform
- * accelerated commands, so the DRI locking in the X server is even
- * more broken than usual.
- */
-
- if (sarea->ctxOwner != me) {
- imesa->upload_cliprects = GL_TRUE;
- imesa->dirty |= (I830_UPLOAD_CTX |
- I830_UPLOAD_BUFFERS |
- I830_UPLOAD_STIPPLE);
-
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if(imesa->CurrentTexObj[i]) imesa->dirty |= I830_UPLOAD_TEX_N( i );
- if(imesa->TexBlendWordsUsed[i]) imesa->dirty |= I830_UPLOAD_TEXBLEND_N( i );
- }
-
- sarea->perf_boxes = imesa->perf_boxes | I830_BOX_LOST_CONTEXT;
- sarea->ctxOwner = me;
- }
-
- /* Shared texture managment - if another client has played with
- * texture space, figure out which if any of our textures have been
- * ejected, and update our global LRU.
- */
-
- for ( i = 0 ; i < imesa->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( imesa->texture_heaps[ i ] );
- }
-
- if (imesa->lastStamp != dPriv->lastStamp) {
- i830XMesaWindowMoved( imesa );
- imesa->lastStamp = dPriv->lastStamp;
- }
-
- sarea->last_quiescent = -1; /* just kill it for now */
-}
-
-void i830SwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- i830ContextPtr imesa;
- GLcontext *ctx;
- imesa = (i830ContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = imesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- if ( 0 /*imesa->doPageFlip*/ ) { /* doPageFlip is never set !!! */
- i830PageFlip( dPriv );
- } else {
- i830CopyBuffer( dPriv );
- }
- }
- } else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!\n", __FUNCTION__);
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.h
deleted file mode 100644
index de141bd4a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_context.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i830
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- */
-
-/* Adapted for use in the I830M driver:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_context.h,v 1.7 2003/02/06 04:18:01 dawes Exp $ */
-
-#ifndef I830CONTEXT_INC
-#define I830CONTEXT_INC
-
-typedef struct i830_context_t i830Context;
-typedef struct i830_context_t *i830ContextPtr;
-typedef struct i830_texture_object_t *i830TextureObjectPtr;
-
-
-#include "mtypes.h"
-#include "drm.h"
-#include "mm.h"
-#include "tnl/t_vertex.h"
-
-#include "i830_screen.h"
-#include "i830_tex.h"
-
-#define TAG(x) i830##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-#define DV_PF_555 (1<<8)
-#define DV_PF_565 (2<<8)
-#define DV_PF_8888 (3<<8)
-
-#define I830_TEX_MAXLEVELS 10
-
-#define I830_CONTEXT(ctx) ((i830ContextPtr)(ctx->DriverCtx))
-#define GET_DISPATCH_AGE(imesa) imesa->sarea->last_dispatch
-#define GET_ENQUEUE_AGE(imesa) imesa->sarea->last_enqueue
-
-
-typedef void (*i830_tri_func)(i830ContextPtr, i830Vertex *, i830Vertex *,
- i830Vertex *);
-typedef void (*i830_line_func)(i830ContextPtr, i830Vertex *, i830Vertex *);
-typedef void (*i830_point_func)(i830ContextPtr, i830Vertex *);
-
-#define I830_MAX_TEXTURE_UNITS 4
-
-#define I830_FALLBACK_TEXTURE 0x1
-#define I830_FALLBACK_DRAW_BUFFER 0x2
-#define I830_FALLBACK_READ_BUFFER 0x4
-#define I830_FALLBACK_COLORMASK 0x8
-#define I830_FALLBACK_RENDERMODE 0x10
-#define I830_FALLBACK_STENCIL 0x20
-#define I830_FALLBACK_STIPPLE 0x40
-#define I830_FALLBACK_USER 0x80
-
-struct i830_context_t
-{
- GLint refcount;
- GLcontext *glCtx;
-
- /*From I830 stuff*/
- int TextureMode;
- GLuint renderindex;
- GLuint TexBlendWordsUsed[I830_MAX_TEXTURE_UNITS];
- GLuint TexBlend[I830_MAX_TEXTURE_UNITS][I830_TEXBLEND_SIZE];
- GLuint Init_TexBlend[I830_MAX_TEXTURE_UNITS][I830_TEXBLEND_SIZE];
- GLuint Init_TexBlendWordsUsed[I830_MAX_TEXTURE_UNITS];
- GLuint Init_BufferSetup[I830_DEST_SETUP_SIZE];
- GLuint LodBias[I830_MAX_TEXTURE_UNITS];
-
- GLenum palette_format;
- GLuint palette[256];
-
-
- GLuint Init_Setup[I830_CTX_SETUP_SIZE];
- GLuint vertex_prim;
- drmBufPtr vertex_dma_buffer;
-
- GLboolean mask_red;
- GLboolean mask_green;
- GLboolean mask_blue;
- GLboolean mask_alpha;
-
- GLubyte clear_red;
- GLubyte clear_green;
- GLubyte clear_blue;
- GLubyte clear_alpha;
-
- GLfloat depth_scale;
- int depth_clear_mask;
- int stencil_clear_mask;
- int ClearDepth;
- int hw_stencil;
-
- GLuint MonoColor;
-
- GLuint LastTexEnabled;
- GLuint TexEnabledMask;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap * texture_heaps[1];
- driTextureObject swapped;
-
- struct i830_texture_object_t *CurrentTexObj[I830_MAX_TEXTURE_UNITS];
-
- /* Rasterization and vertex state:
- */
- GLuint Fallback;
- GLuint NewGLState;
-
- /* Vertex state
- */
- GLuint vertex_size;
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
- char *verts; /* points to tnl->clipspace.vertex_buf */
-
-
- /* State for i830tris.c.
- */
- GLuint RenderIndex;
- GLmatrix ViewportMatrix;
- GLenum render_primitive;
- GLenum reduced_primitive;
- GLuint hw_primitive;
-
- drmBufPtr vertex_buffer;
- char *vertex_addr;
- GLuint vertex_low;
- GLuint vertex_high;
- GLuint vertex_last_prim;
-
- GLboolean upload_cliprects;
-
-
- /* Fallback rasterization functions
- */
- i830_point_func draw_point;
- i830_line_func draw_line;
- i830_tri_func draw_tri;
-
- /* Hardware state
- */
- GLuint dirty; /* I810_UPLOAD_* */
- GLuint Setup[I830_CTX_SETUP_SIZE];
- GLuint BufferSetup[I830_DEST_SETUP_SIZE];
- GLuint StippleSetup[I830_STP_SETUP_SIZE];
- unsigned int lastStamp;
- GLboolean hw_stipple;
-
- GLenum TexEnvImageFmt[2];
-
- /* State which can't be computed completely on the fly:
- */
- GLuint LcsCullMode;
- GLuint LcsLineWidth;
- GLuint LcsPointSize;
-
- /* Funny mesa mirrors
- */
- GLuint ClearColor;
-
- /* DRI stuff
- */
- GLuint needClip;
- GLframebuffer *glBuffer;
-
- /* These refer to the current draw (front vs. back) buffer:
- */
- char *drawMap; /* draw buffer address in virtual mem */
- char *readMap;
- int drawX; /* origin of drawable in draw buffer */
- int drawY;
- GLuint numClipRects; /* cliprects for that buffer */
- drm_clip_rect_t *pClipRects;
-
- int lastSwap;
- int texAge;
- int ctxAge;
- int dirtyAge;
- int perf_boxes;
-
- int do_irqs;
-
- GLboolean scissor;
- drm_clip_rect_t draw_rect;
- drm_clip_rect_t scissor_rect;
-
- drm_context_t hHWContext;
- drmLock *driHwLock;
- int driFd;
-
- __DRIdrawablePrivate *driDrawable; /**< DRI drawable bound to this
- * context for drawing.
- */
- __DRIdrawablePrivate *driReadable; /**< DRI drawable bound to this
- * context for reading.
- */
-
- /**
- * Drawable used by Mesa for software fallbacks for reading and
- * writing. It is set by Mesa's \c SetBuffer callback, and will always be
- * either \c i830_context_t::driDrawable or \c i830_context_t::driReadable.
- */
-
- __DRIdrawablePrivate * mesa_drawable;
-
- __DRIscreenPrivate *driScreen;
- i830ScreenPrivate *i830Screen;
- I830SAREAPtr sarea;
-
- /**
- * Configuration cache
- */
- driOptionCache optionCache;
-};
-
-
-#define I830_TEX_UNIT_ENABLED(unit) (1<<unit)
-#define VALID_I830_TEXTURE_OBJECT(tobj) (tobj)
-
-#define I830_CONTEXT(ctx) ((i830ContextPtr)(ctx->DriverCtx))
-#define I830_DRIVER_DATA(vb) ((i830VertexBufferPtr)((vb)->driver_data))
-#define GET_DISPATCH_AGE(imesa) imesa->sarea->last_dispatch
-#define GET_ENQUEUE_AGE(imesa) imesa->sarea->last_enqueue
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( imesa ) \
-do { \
- char __ret=0; \
- DRM_CAS(imesa->driHwLock, imesa->hHWContext, \
- (DRM_LOCK_HELD|imesa->hHWContext), __ret); \
- if (__ret) \
- i830GetLock( imesa, 0 ); \
-}while (0)
-
-
- /* Unlock the hardware using the global current context
- */
-#define UNLOCK_HARDWARE(imesa) \
-do { \
- imesa->perf_boxes |= imesa->sarea->perf_boxes; \
- DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext); \
-} while (0)
-
- /* This is the wrong way to do it, I'm sure. Otherwise the drm
- * bitches that I've already got the heavyweight lock. At worst,
- * this is 3 ioctls. The best solution probably only gets me down
- * to 2 ioctls in the worst case.
- */
-#define LOCK_HARDWARE_QUIESCENT( imesa ) do { \
- LOCK_HARDWARE( imesa ); \
- i830RegetLockQuiescent( imesa ); \
-} while(0)
-
-
-
-extern void i830GetLock(i830ContextPtr imesa, GLuint flags);
-extern void i830EmitHwStateLocked(i830ContextPtr imesa);
-extern void i830EmitDrawingRectangle(i830ContextPtr imesa);
-extern void i830XMesaSetBackClipRects(i830ContextPtr imesa);
-extern void i830XMesaSetFrontClipRects(i830ContextPtr imesa);
-extern void i830DDExtensionsInit(GLcontext *ctx);
-extern void i830DDInitDriverFuncs(GLcontext *ctx);
-extern void i830DDUpdateHwState(GLcontext *ctx);
-
-#define SUBPIXEL_X 0.125
-#define SUBPIXEL_Y 0.125
-
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-#if DO_DEBUG
-extern int I830_DEBUG;
-#else
-#define I830_DEBUG 0
-#endif
-
-#define DEBUG_TEXTURE 0x1
-#define DEBUG_STATE 0x2
-#define DEBUG_IOCTL 0x4
-#define DEBUG_PRIMS 0x8
-#define DEBUG_VERTS 0x10
-#define DEBUG_FALLBACKS 0x20
-#define DEBUG_VERBOSE 0x40
-#define DEBUG_DRI 0x80
-#define DEBUG_DMA 0x100
-#define DEBUG_SANITY 0x200
-#define DEBUG_SYNC 0x400
-#define DEBUG_SLEEP 0x800
-
-
-#define PCI_CHIP_845_G 0x2562
-#define PCI_CHIP_I830_M 0x3577
-#define PCI_CHIP_I855_GM 0x3582
-#define PCI_CHIP_I865_G 0x2572
-
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.c
deleted file mode 100644
index eee48f1c1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 2d3d Inc., Delray Beach, FL
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_debug.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "mm.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_context.h"
-#include "i830_state.h"
-#include "i830_tex.h"
-#include "i830_tris.h"
-#include "i830_ioctl.h"
-#include "i830_debug.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-
-#define TINY_VERTEX_FORMAT (STATE3D_VERTEX_FORMAT_CMD | \
- VRTX_TEX_COORD_COUNT(0) | \
- VRTX_HAS_DIFFUSE | \
- VRTX_HAS_XYZ)
-
-#define NOTEX_VERTEX_FORMAT (STATE3D_VERTEX_FORMAT_CMD | \
- VRTX_TEX_COORD_COUNT(0) | \
- VRTX_HAS_DIFFUSE | \
- VRTX_HAS_SPEC | \
- VRTX_HAS_XYZW)
-
-#define TEX0_VERTEX_FORMAT (STATE3D_VERTEX_FORMAT_CMD | \
- VRTX_TEX_COORD_COUNT(1) | \
- VRTX_HAS_DIFFUSE | \
- VRTX_HAS_SPEC | \
- VRTX_HAS_XYZW)
-
-#define TEX1_VERTEX_FORMAT (STATE3D_VERTEX_FORMAT_CMD | \
- VRTX_TEX_COORD_COUNT(2) | \
- VRTX_HAS_DIFFUSE | \
- VRTX_HAS_SPEC | \
- VRTX_HAS_XYZW)
-
-#define PROJ_VF2 (STATE3D_VERTEX_FORMAT_2_CMD | \
- VRTX_TEX_SET_0_FMT(TEXCOORDFMT_3D) | \
- VRTX_TEX_SET_1_FMT(TEXCOORDFMT_3D) | \
- VRTX_TEX_SET_2_FMT(TEXCOORDFMT_3D) | \
- VRTX_TEX_SET_3_FMT(TEXCOORDFMT_3D))
-
-#define NON_PROJ_VF2 (STATE3D_VERTEX_FORMAT_2_CMD | \
- VRTX_TEX_SET_0_FMT(TEXCOORDFMT_2D) | \
- VRTX_TEX_SET_1_FMT(TEXCOORDFMT_2D) | \
- VRTX_TEX_SET_2_FMT(TEXCOORDFMT_2D) | \
- VRTX_TEX_SET_3_FMT(TEXCOORDFMT_2D))
-
-void i830DumpContextState( i830ContextPtr imesa )
-{
- GLuint *Context = imesa->Setup;
-
- fprintf(stderr, "%s\n", __FUNCTION__);
- fprintf(stderr, "STATE1 : 0x%08x\n", Context[I830_CTXREG_STATE1]);
- fprintf(stderr, "STATE2 : 0x%08x\n", Context[I830_CTXREG_STATE2]);
- fprintf(stderr, "STATE3 : 0x%08x\n", Context[I830_CTXREG_STATE3]);
- fprintf(stderr, "STATE4 : 0x%08x\n", Context[I830_CTXREG_STATE4]);
- fprintf(stderr, "STATE5 : 0x%08x\n", Context[I830_CTXREG_STATE5]);
- fprintf(stderr, "IALPHAB : 0x%08x\n", Context[I830_CTXREG_IALPHAB]);
- fprintf(stderr, "STENCILTST : 0x%08x\n", Context[I830_CTXREG_STENCILTST]);
- fprintf(stderr, "ENABLES_1 : 0x%08x\n", Context[I830_CTXREG_ENABLES_1]);
- fprintf(stderr, "ENABLES_2 : 0x%08x\n", Context[I830_CTXREG_ENABLES_2]);
- fprintf(stderr, "AA : 0x%08x\n", Context[I830_CTXREG_AA]);
- fprintf(stderr, "FOGCOLOR : 0x%08x\n", Context[I830_CTXREG_FOGCOLOR]);
- fprintf(stderr, "BCOLOR0 : 0x%08x\n", Context[I830_CTXREG_BLENDCOLR0]);
- fprintf(stderr, "BCOLOR : 0x%08x\n", Context[I830_CTXREG_BLENDCOLR]);
- fprintf(stderr, "VF : 0x%08x\n", Context[I830_CTXREG_VF]);
- fprintf(stderr, "VF2 : 0x%08x\n", Context[I830_CTXREG_VF2]);
- fprintf(stderr, "MCSB0 : 0x%08x\n", Context[I830_CTXREG_MCSB0]);
- fprintf(stderr, "MCSB1 : 0x%08x\n", Context[I830_CTXREG_MCSB1]);
-}
-
-void i830DumpBufferState( i830ContextPtr imesa )
-{
- GLuint *Buffer = imesa->BufferSetup;
-
- fprintf(stderr, "%s\n", __FUNCTION__);
- fprintf(stderr, "CBUFADDR : 0x%08x\n", Buffer[I830_DESTREG_CBUFADDR]);
- fprintf(stderr, "DBUFADDR : 0x%08x\n", Buffer[I830_DESTREG_DBUFADDR]);
- fprintf(stderr, "DV0 : 0x%08x\n", Buffer[I830_DESTREG_DV0]);
- fprintf(stderr, "DV1 : 0x%08x\n", Buffer[I830_DESTREG_DV1]);
- fprintf(stderr, "SENABLE : 0x%08x\n", Buffer[I830_DESTREG_SENABLE]);
- fprintf(stderr, "SR0 : 0x%08x\n", Buffer[I830_DESTREG_SR0]);
- fprintf(stderr, "SR1 : 0x%08x\n", Buffer[I830_DESTREG_SR1]);
- fprintf(stderr, "SR2 : 0x%08x\n", Buffer[I830_DESTREG_SR2]);
- fprintf(stderr, "DR0 : 0x%08x\n", Buffer[I830_DESTREG_DR0]);
- fprintf(stderr, "DR1 : 0x%08x\n", Buffer[I830_DESTREG_DR1]);
- fprintf(stderr, "DR2 : 0x%08x\n", Buffer[I830_DESTREG_DR2]);
- fprintf(stderr, "DR3 : 0x%08x\n", Buffer[I830_DESTREG_DR3]);
- fprintf(stderr, "DR4 : 0x%08x\n", Buffer[I830_DESTREG_DR4]);
-}
-
-void i830DumpStippleState( i830ContextPtr imesa )
-{
- GLuint *Buffer = imesa->BufferSetup;
-
- fprintf(stderr, "%s\n", __FUNCTION__);
- fprintf(stderr, "ST1 : 0x%08x\n", Buffer[I830_STPREG_ST1]);
-}
-
-void i830DumpTextureState( i830ContextPtr imesa, int unit )
-{
- i830TextureObjectPtr t = imesa->CurrentTexObj[unit];
-
- if(t) {
- fprintf(stderr, "%s : unit %d\n", __FUNCTION__, unit);
- fprintf(stderr, "TM0LI : 0x%08x\n", t->Setup[I830_TEXREG_TM0LI]);
- fprintf(stderr, "TM0S0 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S0]);
- fprintf(stderr, "TM0S1 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S1]);
- fprintf(stderr, "TM0S2 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S2]);
- fprintf(stderr, "TM0S3 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S3]);
- fprintf(stderr, "TM0S4 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S4]);
- fprintf(stderr, "NOP0 : 0x%08x\n", t->Setup[I830_TEXREG_NOP0]);
- fprintf(stderr, "NOP1 : 0x%08x\n", t->Setup[I830_TEXREG_NOP1]);
- fprintf(stderr, "NOP2 : 0x%08x\n", t->Setup[I830_TEXREG_NOP2]);
- fprintf(stderr, "MCS : 0x%08x\n", t->Setup[I830_TEXREG_MCS]);
- }
-}
-
-void i830DumpTextureBlendState( i830ContextPtr imesa, int unit )
-{
- GLuint *TexBlend = imesa->TexBlend[unit];
- GLuint length = imesa->TexBlendWordsUsed[unit];
- int i;
-
- fprintf(stderr, "%s : unit %d : length %d\n", __FUNCTION__, unit, length);
- for(i = 0; i < length; i++) {
- fprintf(stderr, "[%d] : 0x%08x\n", i, TexBlend[i]);
- }
-}
-
-void i830VertexSanity( i830ContextPtr imesa, drmI830Vertex vertex )
-{
- I830SAREAPtr sarea = imesa->sarea;
- char *prim_name;
- int size = 0;
- int vfmt_size = 0;
- int hw_nr_vertex = 0;
- int hw_start_vertex = 0;
-
- /* Do a bunch of sanity checks on the vertices sent to the hardware */
-
- size = vertex.used - 4;
- if(imesa->vertex_size && (size % imesa->vertex_size) != 0) {
- fprintf(stderr, "\n\nVertex size does not match imesa "
- "internal state\n");
- fprintf(stderr, "Buffer size : %d\n", size);
- fprintf(stderr, "Vertex size : %d\n", imesa->vertex_size);
- }
-
- /* Check to see if the vertex format is good, and get its size */
- if (sarea->ContextState[I830_CTXREG_VF] == TINY_VERTEX_FORMAT) {
- vfmt_size = 16; /* 4 dwords */
- } else if (sarea->ContextState[I830_CTXREG_VF] ==
- NOTEX_VERTEX_FORMAT) {
- vfmt_size = 24; /* 6 dwords */
- } else if (sarea->ContextState[I830_CTXREG_VF] ==
- TEX0_VERTEX_FORMAT) {
- vfmt_size = 32; /* 8 dwords */
- if (sarea->ContextState[I830_CTXREG_VF2] != NON_PROJ_VF2) {
- fprintf(stderr, "\n\nTex 0 vertex format, but proj "
- "texturing\n");
- }
- } else if(sarea->ContextState[I830_CTXREG_VF] ==
- TEX1_VERTEX_FORMAT) {
- if (sarea->ContextState[I830_CTXREG_VF2] == NON_PROJ_VF2)
- vfmt_size = 40; /* 10 dwords */
- else
- vfmt_size = 48; /* 12 dwords */
- } else {
- fprintf(stderr, "\n\nUnknown vertex format : vf : %08x "
- "vf2 : %08x\n",
- sarea->ContextState[I830_CTXREG_VF],
- sarea->ContextState[I830_CTXREG_VF2]);
- }
-
- if(vfmt_size && (size % vfmt_size) != 0) {
- fprintf(stderr, "\n\nVertex size does not match hardware "
- "internal state\n");
- fprintf(stderr, "Buffer size : %d\n", size);
- fprintf(stderr, "Vertex size : %d\n", vfmt_size);
- }
-
- switch(sarea->vertex_prim) {
- case PRIM3D_POINTLIST:
- hw_start_vertex = 0;
- hw_nr_vertex = 1;
- prim_name = "PointList";
- break;
-
- case PRIM3D_LINELIST:
- hw_start_vertex = 0;
- hw_nr_vertex = 2;
- prim_name = "LineList";
- break;
-
- case PRIM3D_LINESTRIP:
- hw_start_vertex = 2;
- hw_nr_vertex = 1;
- prim_name = "LineStrip";
- break;
-
- case PRIM3D_TRILIST:
- hw_start_vertex = 0;
- hw_nr_vertex = 3;
- prim_name = "TriList";
- break;
-
- case PRIM3D_TRISTRIP:
- hw_start_vertex = 3;
- hw_nr_vertex = 1;
- prim_name = "TriStrip";
- break;
-
- case PRIM3D_TRIFAN:
- hw_start_vertex = 3;
- hw_nr_vertex = 1;
- prim_name = "TriFan";
- break;
-
- case PRIM3D_POLY:
- hw_start_vertex = 3;
- hw_nr_vertex = 1;
- prim_name = "Polygons";
- break;
- default:
- prim_name = "Unknown";
- fprintf(stderr, "\n\nUnknown primitive type : %08x\n",
- sarea->vertex_prim);
- }
-
- if (hw_nr_vertex && vfmt_size) {
- int temp_size = size - (hw_start_vertex * vfmt_size);
- int remaining = (temp_size % (hw_nr_vertex * vfmt_size));
-
- if (remaining != 0) {
- fprintf(stderr, "\n\nThis buffer contains an improper"
- " multiple of vertices for this primitive : %s\n",
- prim_name);
- fprintf(stderr, "Number of vertices in buffer : %d\n",
- size / vfmt_size);
- fprintf(stderr, "temp_size : %d\n", temp_size);
- fprintf(stderr, "remaining vertices : %d",
- remaining / vfmt_size);
- }
- }
- if (vfmt_size) {
- fprintf(stderr, "\n\nPrim name (%s), vertices (%d)\n",
- prim_name,
- size / vfmt_size);
- }
-}
-
-void i830EmitHwStateLockedDebug( i830ContextPtr imesa )
-{
- int i;
-
- if ((imesa->dirty & I830_UPLOAD_TEX0_IMAGE) && imesa->CurrentTexObj[0]) {
- i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[0]);
- }
-
- if ((imesa->dirty & I830_UPLOAD_TEX1_IMAGE) && imesa->CurrentTexObj[1]) {
- i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[1]);
- }
-
- if (imesa->dirty & I830_UPLOAD_CTX) {
- memcpy( imesa->sarea->ContextState,
- imesa->Setup, sizeof(imesa->Setup) );
- i830DumpContextState(imesa);
- }
-
- for(i = 0; i < I830_TEXTURE_COUNT; i++) {
- if ((imesa->dirty & I830_UPLOAD_TEX_N(i)) && imesa->CurrentTexObj[i]) {
- unsigned * TexState;
-
- imesa->sarea->dirty |= I830_UPLOAD_TEX_N(i);
-
- switch( i ) {
- case 0:
- case 1:
- TexState = imesa->sarea->TexState[i];
- break;
-
- case 2:
- TexState = imesa->sarea->TexState2;
- break;
-
- case 3:
- TexState = imesa->sarea->TexState3;
- break;
- }
-
- memcpy(TexState, imesa->CurrentTexObj[i]->Setup,
- sizeof(imesa->sarea->TexState[i]));
- i830DumpTextureState(imesa, i);
- }
- }
- /* Need to figure out if texturing state, or enable changed. */
-
- for(i = 0; i < I830_TEXBLEND_COUNT; i++) {
- if (imesa->dirty & I830_UPLOAD_TEXBLEND_N(i)) {
- unsigned * TexBlendState;
- unsigned * words_used;
-
- imesa->sarea->dirty |= I830_UPLOAD_TEXBLEND_N(i);
-
- switch( i ) {
- case 0:
- case 1:
- TexBlendState = imesa->sarea->TexBlendState[i];
- words_used = & imesa->sarea->TexBlendStateWordsUsed[i];
- break;
-
- case 2:
- TexBlendState = imesa->sarea->TexBlendState2;
- words_used = & imesa->sarea->TexBlendStateWordsUsed2;
- break;
-
- case 3:
- TexBlendState = imesa->sarea->TexBlendState3;
- words_used = & imesa->sarea->TexBlendStateWordsUsed3;
- break;
- }
-
- memcpy(TexBlendState, imesa->TexBlend[i],
- imesa->TexBlendWordsUsed[i] * 4);
- *words_used = imesa->TexBlendWordsUsed[i];
-
- i830DumpTextureBlendState(imesa, i);
- }
- }
-
- if (imesa->dirty & I830_UPLOAD_BUFFERS) {
- memcpy( imesa->sarea->BufferState,imesa->BufferSetup,
- sizeof(imesa->BufferSetup) );
- i830DumpBufferState(imesa);
- }
-
- if (imesa->dirty & I830_UPLOAD_STIPPLE) {
- fprintf(stderr, "UPLOAD_STIPPLE\n");
- memcpy( imesa->sarea->StippleState,imesa->StippleSetup,
- sizeof(imesa->StippleSetup) );
- i830DumpStippleState(imesa);
- }
-
- if (imesa->dirty & I830_UPLOAD_TEX_PALETTE_SHARED) {
- memcpy( imesa->sarea->Palette[0],imesa->palette,
- sizeof(imesa->sarea->Palette[0]));
- } else {
- i830TextureObjectPtr p;
- if (imesa->dirty & I830_UPLOAD_TEX_PALETTE_N(0)) {
- p = imesa->CurrentTexObj[0];
- memcpy( imesa->sarea->Palette[0],p->palette,
- sizeof(imesa->sarea->Palette[0]));
- }
- if (imesa->dirty & I830_UPLOAD_TEX_PALETTE_N(1)) {
- p = imesa->CurrentTexObj[1];
- memcpy( imesa->sarea->Palette[1],
- p->palette,
- sizeof(imesa->sarea->Palette[1]));
- }
- }
- imesa->sarea->dirty |= (imesa->dirty & ~(I830_UPLOAD_TEX_MASK |
- I830_UPLOAD_TEXBLEND_MASK));
-
- imesa->upload_cliprects = GL_TRUE;
- imesa->dirty = 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.h
deleted file mode 100644
index deb84f7b0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_debug.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 2d3d Inc., Delray Beach, FL
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_debug.h,v 1.3 2002/12/10 01:26:53 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-
-/* Defines for sanity checking and debug output */
-#ifndef I830DEBUG_INC
-#define I830DEBUG_INC
-
-
-void i830DumpContextState( i830ContextPtr imesa );
-void i830DumpStippleState( i830ContextPtr imesa );
-void i830DumpBufferState( i830ContextPtr imesa );
-void i830DumpTextureState( i830ContextPtr imesa, int unit );
-void i830DumpTextureBlendState( i830ContextPtr imesa, int unit );
-void i830VertexSanity( i830ContextPtr imesa, drmI830Vertex vertex );
-void i830EmitHwStateLockedDebug( i830ContextPtr imesa );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.c
deleted file mode 100644
index cd0c143df..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.c
+++ /dev/null
@@ -1,841 +0,0 @@
-
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c,v 1.5 2002/12/10 01:26:53 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- * Graeme Fisher <graeme@2d3d.co.za>
- * Abraham vd Merwe <abraham@2d3d.co.za>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_context.h"
-#include "i830_ioctl.h"
-#include "i830_state.h"
-#include "i830_debug.h"
-
-#include "drm.h"
-
-static drmBufPtr i830_get_buffer_ioctl( i830ContextPtr imesa )
-{
- drmI830DMA dma;
- drmBufPtr buf;
- int retcode,i = 0;
- while (1) {
- retcode = drmCommandWriteRead(imesa->driFd,
- DRM_I830_GETBUF,
- &dma,
- sizeof(drmI830DMA));
- if (dma.granted == 1 && retcode == 0)
- break;
-
- if (++i > 1000) {
- imesa->sarea->perf_boxes |= I830_BOX_WAIT;
- retcode = drmCommandNone(imesa->driFd, DRM_I830_FLUSH);
- i = 0;
- }
- }
-
- buf = &(imesa->i830Screen->bufs->list[dma.request_idx]);
- buf->idx = dma.request_idx;
- buf->used = 0;
- buf->total = dma.request_size;
- buf->address = (drmAddress)dma.virtual;
-
- return buf;
-}
-
-static void i830ClearDrawQuad(i830ContextPtr imesa, float left,
- float right,
- float bottom, float top, GLubyte red,
- GLubyte green, GLubyte blue, GLubyte alpha)
-{
- GLuint *vb = i830AllocDmaLowLocked( imesa, 128 );
- i830Vertex tmp;
- int i;
-
- /* PRIM3D_TRIFAN */
-
- /* initial vertex, left bottom */
- tmp.v.x = left;
- tmp.v.y = bottom;
- tmp.v.z = 1.0;
- tmp.v.w = 1.0;
- tmp.v.color.red = red;
- tmp.v.color.green = green;
- tmp.v.color.blue = blue;
- tmp.v.color.alpha = alpha;
- tmp.v.specular.red = 0;
- tmp.v.specular.green = 0;
- tmp.v.specular.blue = 0;
- tmp.v.specular.alpha = 0;
- tmp.v.u0 = 0.0f;
- tmp.v.v0 = 0.0f;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
- /* right bottom */
- vb += 8;
- tmp.v.x = right;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
- /* right top */
- vb += 8;
- tmp.v.y = top;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
- /* left top */
- vb += 8;
- tmp.v.x = left;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-}
-
-static void i830ClearWithTris(GLcontext *ctx, GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- i830ScreenPrivate *i830Screen = imesa->i830Screen;
- I830SAREAPtr sarea = imesa->sarea;
- GLuint old_vertex_prim;
- GLuint old_dirty;
- int x0, y0, x1, y1;
-
- if (I830_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "Clearing with triangles\n");
-
- old_dirty = imesa->dirty & ~I830_UPLOAD_CLIPRECTS;
- /* Discard all the dirty flags except the cliprect one, reset later */
- imesa->dirty &= I830_UPLOAD_CLIPRECTS;
-
- if(!all) {
- x0 = cx;
- y0 = cy;
- x1 = x0 + cw;
- y1 = y0 + ch;
- } else {
- x0 = 0;
- y0 = 0;
- x1 = x0 + dPriv->w;
- y1 = y0 + dPriv->h;
- }
-
- /* Clip to Screen */
- if (x0 < 0) x0 = 0;
- if (y0 < 0) y0 = 0;
- if (x1 > i830Screen->width-1) x1 = i830Screen->width-1;
- if (y1 > i830Screen->height-1) y1 = i830Screen->height-1;
-
- LOCK_HARDWARE(imesa);
- memcpy(sarea->ContextState,
- imesa->Init_Setup,
- sizeof(imesa->Setup) );
- memcpy(sarea->BufferState,
- imesa->BufferSetup,
- sizeof(imesa->BufferSetup) );
- sarea->StippleState[I830_STPREG_ST1] = 0;
-
- old_vertex_prim = imesa->hw_primitive;
- imesa->hw_primitive = PRIM3D_TRIFAN;
-
- if(mask & BUFFER_BIT_FRONT_LEFT) {
- GLuint tmp = sarea->ContextState[I830_CTXREG_ENABLES_2];
-
- sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS |
- I830_UPLOAD_TEXBLEND0);
-
- sarea->TexBlendState[0][0] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXOP_LAST_STAGE |
- TEXBLENDOP_ARG1);
- sarea->TexBlendState[0][1] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- sarea->TexBlendState[0][2] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- sarea->TexBlendState[0][3] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- sarea->TexBlendStateWordsUsed[0] = 4;
-
- tmp &= ~(ENABLE_STENCIL_WRITE | ENABLE_DEPTH_WRITE);
- tmp |= (DISABLE_STENCIL_WRITE |
- DISABLE_DEPTH_WRITE |
- (imesa->mask_red << WRITEMASK_RED_SHIFT) |
- (imesa->mask_green << WRITEMASK_GREEN_SHIFT) |
- (imesa->mask_blue << WRITEMASK_BLUE_SHIFT) |
- (imesa->mask_alpha << WRITEMASK_ALPHA_SHIFT));
- sarea->ContextState[I830_CTXREG_ENABLES_2] = tmp;
-
- if(0)
- fprintf(stderr, "fcdq : r_mask(%d) g_mask(%d) b_mask(%d) a_mask(%d)\n",
- imesa->mask_red, imesa->mask_green, imesa->mask_blue,
- imesa->mask_alpha);
-
- sarea->BufferState[I830_DESTREG_CBUFADDR] = i830Screen->fbOffset;
-
- if(0)
- fprintf(stderr, "fcdq : x0(%d) x1(%d) y0(%d) y1(%d)\n"
- "r(0x%x) g(0x%x) b(0x%x) a(0x%x)\n",
- x0, x1, y0, y1, imesa->clear_red, imesa->clear_green,
- imesa->clear_blue, imesa->clear_alpha);
-
- i830ClearDrawQuad(imesa, (float)x0, (float)x1, (float)y0, (float)y1,
- imesa->clear_red, imesa->clear_green,
- imesa->clear_blue, imesa->clear_alpha);
- i830FlushPrimsLocked( imesa );
- }
-
- if(mask & BUFFER_BIT_BACK_LEFT) {
- GLuint tmp = sarea->ContextState[I830_CTXREG_ENABLES_2];
-
- sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS |
- I830_UPLOAD_TEXBLEND0);
-
- sarea->TexBlendState[0][0] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXOP_LAST_STAGE |
- TEXBLENDOP_ARG1);
- sarea->TexBlendState[0][1] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- sarea->TexBlendState[0][2] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- sarea->TexBlendState[0][3] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG2 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- sarea->TexBlendStateWordsUsed[0] = 4;
-
- tmp &= ~(ENABLE_STENCIL_WRITE | ENABLE_DEPTH_WRITE);
- tmp |= (DISABLE_STENCIL_WRITE |
- DISABLE_DEPTH_WRITE |
- (imesa->mask_red << WRITEMASK_RED_SHIFT) |
- (imesa->mask_green << WRITEMASK_GREEN_SHIFT) |
- (imesa->mask_blue << WRITEMASK_BLUE_SHIFT) |
- (imesa->mask_alpha << WRITEMASK_ALPHA_SHIFT));
-
- if(0)
- fprintf(stderr, "bcdq : r_mask(%d) g_mask(%d) b_mask(%d) a_mask(%d)\n",
- imesa->mask_red, imesa->mask_green, imesa->mask_blue,
- imesa->mask_alpha);
-
- sarea->ContextState[I830_CTXREG_ENABLES_2] = tmp;
-
- sarea->BufferState[I830_DESTREG_CBUFADDR] = i830Screen->backOffset;
-
- if(0)
- fprintf(stderr, "bcdq : x0(%d) x1(%d) y0(%d) y1(%d)\n"
- "r(0x%x) g(0x%x) b(0x%x) a(0x%x)\n",
- x0, x1, y0, y1, imesa->clear_red, imesa->clear_green,
- imesa->clear_blue, imesa->clear_alpha);
-
- i830ClearDrawQuad(imesa, (float)x0, (float)x1, (float)y0, (float)y1,
- imesa->clear_red, imesa->clear_green,
- imesa->clear_blue, imesa->clear_alpha);
- i830FlushPrimsLocked( imesa );
- }
-
- if(mask & BUFFER_BIT_STENCIL) {
- GLuint s_mask = ctx->Stencil.WriteMask[0];
-
- sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS |
- I830_UPLOAD_TEXBLEND0);
-
- sarea->TexBlendState[0][0] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXOP_LAST_STAGE |
- TEXBLENDOP_ARG1);
- sarea->TexBlendState[0][1] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- sarea->TexBlendState[0][2] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- sarea->TexBlendState[0][3] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG2 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- sarea->TexBlendStateWordsUsed[0] = 4;
-
- sarea->ContextState[I830_CTXREG_ENABLES_1] |= (ENABLE_STENCIL_TEST |
- ENABLE_DEPTH_TEST);
-
- sarea->ContextState[I830_CTXREG_ENABLES_2] &= ~(ENABLE_STENCIL_WRITE |
- ENABLE_DEPTH_WRITE |
- ENABLE_COLOR_WRITE);
-
- sarea->ContextState[I830_CTXREG_ENABLES_2] |=
- (ENABLE_STENCIL_WRITE |
- DISABLE_DEPTH_WRITE |
- (1 << WRITEMASK_RED_SHIFT) |
- (1 << WRITEMASK_GREEN_SHIFT) |
- (1 << WRITEMASK_BLUE_SHIFT) |
- (1 << WRITEMASK_ALPHA_SHIFT) |
- ENABLE_COLOR_WRITE);
-
- sarea->ContextState[I830_CTXREG_STATE4] &=
- ~MODE4_ENABLE_STENCIL_WRITE_MASK;
-
- sarea->ContextState[I830_CTXREG_STATE4] |=
- (ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(s_mask));
-
- sarea->ContextState[I830_CTXREG_STENCILTST] &=
- ~(STENCIL_OPS_MASK |
- STENCIL_REF_VALUE_MASK |
- ENABLE_STENCIL_TEST_FUNC_MASK);
-
- sarea->ContextState[I830_CTXREG_STENCILTST] |=
- (ENABLE_STENCIL_PARMS |
- ENABLE_STENCIL_REF_VALUE |
- ENABLE_STENCIL_TEST_FUNC |
- STENCIL_FAIL_OP(STENCILOP_REPLACE) |
- STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_REPLACE) |
- STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_REPLACE) |
- STENCIL_REF_VALUE((ctx->Stencil.Clear & 0xff)) |
- STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS));
-
- if(0)
- fprintf(stderr, "Enables_1 (0x%x) Enables_2 (0x%x) StenTst (0x%x)\n"
- "Modes_4 (0x%x)\n",
- sarea->ContextState[I830_CTXREG_ENABLES_1],
- sarea->ContextState[I830_CTXREG_ENABLES_2],
- sarea->ContextState[I830_CTXREG_STENCILTST],
- sarea->ContextState[I830_CTXREG_STATE4]);
-
- sarea->BufferState[I830_DESTREG_CBUFADDR] = i830Screen->fbOffset;
-
- i830ClearDrawQuad(imesa, (float)x0, (float)x1, (float)y0, (float)y1,
- 255, 255, 255, 255);
- i830FlushPrimsLocked( imesa );
- }
-
- UNLOCK_HARDWARE(imesa);
- imesa->dirty = old_dirty;
- imesa->dirty |= (I830_UPLOAD_CTX |
- I830_UPLOAD_BUFFERS |
- I830_UPLOAD_TEXBLEND0);
-
- imesa->hw_primitive = old_vertex_prim;
-}
-
-static void i830Clear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch)
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
- drmI830Clear clear;
- GLbitfield tri_mask = 0;
- int i;
- GLint cx, cy;
-
- /* flip top to bottom */
- cy = dPriv->h-cy1-ch;
- cx = cx1 + imesa->drawX;
- cy += imesa->drawY;
-
- if(0) fprintf(stderr, "\nClearColor : 0x%08x\n", imesa->ClearColor);
-
- clear.flags = 0;
- clear.clear_color = imesa->ClearColor;
- clear.clear_depth = 0;
- clear.clear_colormask = 0;
- clear.clear_depthmask = 0;
-
- I830_FIREVERTICES( imesa );
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- if(colorMask == ~0) {
- clear.flags |= I830_FRONT;
- } else {
- tri_mask |= BUFFER_BIT_FRONT_LEFT;
- }
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if (mask & BUFFER_BIT_BACK_LEFT) {
- if(colorMask == ~0) {
- clear.flags |= I830_BACK;
- } else {
- tri_mask |= BUFFER_BIT_BACK_LEFT;
- }
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if (mask & BUFFER_BIT_DEPTH) {
- clear.flags |= I830_DEPTH;
- clear.clear_depthmask = imesa->depth_clear_mask;
- clear.clear_depth = (GLuint)(ctx->Depth.Clear * imesa->ClearDepth);
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if((mask & BUFFER_BIT_STENCIL) && imesa->hw_stencil) {
- if (ctx->Stencil.WriteMask[0] != 0xff) {
- tri_mask |= BUFFER_BIT_STENCIL;
- } else {
- clear.flags |= I830_DEPTH;
- clear.clear_depthmask |= imesa->stencil_clear_mask;
- clear.clear_depth |= (ctx->Stencil.Clear & 0xff) << 24;
- }
- mask &= ~BUFFER_BIT_STENCIL;
- }
-
- /* First check for clears that need to happen with triangles */
- if(tri_mask) {
- i830ClearWithTris(ctx, tri_mask, all, cx, cy, cw, ch);
- }
-
- if (clear.flags) {
- LOCK_HARDWARE( imesa );
-
- for (i = 0 ; i < imesa->numClipRects ; )
- {
- int nr = MIN2(i + I830_NR_SAREA_CLIPRECTS, imesa->numClipRects);
- drm_clip_rect_t *box = imesa->pClipRects;
- drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes;
- int n = 0;
-
- if (!all) {
- for ( ; i < nr ; i++) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if (x < cx) w -= cx - x, x = cx;
- if (y < cy) h -= cy - y, y = cy;
- if (x + w > cx + cw) w = cx + cw - x;
- if (y + h > cy + ch) h = cy + ch - y;
- if (w <= 0) continue;
- if (h <= 0) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++) {
- *b++ = *(drm_clip_rect_t *)&box[i];
- n++;
- }
- }
-
- imesa->sarea->nbox = n;
- drmCommandWrite(imesa->driFd, DRM_I830_CLEAR,
- &clear, sizeof(drmI830Clear));
- }
-
- UNLOCK_HARDWARE( imesa );
- imesa->upload_cliprects = GL_TRUE;
- }
-
- if (mask)
- _swrast_Clear( ctx, mask, all, cx1, cy1, cw, ch );
-}
-
-
-
-/*
- * Copy the back buffer to the front buffer.
- */
-void i830CopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- i830ContextPtr imesa;
- drm_clip_rect_t *pbox;
- int nbox, i, tmp;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- imesa = (i830ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- I830_FIREVERTICES( imesa );
- LOCK_HARDWARE( imesa );
-
- imesa->sarea->perf_boxes |= imesa->perf_boxes;
- imesa->perf_boxes = 0;
-
- pbox = dPriv->pClipRects;
- nbox = dPriv->numClipRects;
-
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + I830_NR_SAREA_CLIPRECTS, dPriv->numClipRects);
- drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes;
-
- imesa->sarea->nbox = nr - i;
-
- for ( ; i < nr ; i++)
- *b++ = pbox[i];
- drmCommandNone(imesa->driFd, DRM_I830_SWAP);
- }
-
- tmp = GET_ENQUEUE_AGE(imesa);
- UNLOCK_HARDWARE( imesa );
-
- /* multiarb will suck the life out of the server without this throttle:
- */
- if (GET_DISPATCH_AGE(imesa) < imesa->lastSwap) {
- i830WaitAge(imesa, imesa->lastSwap);
- }
-
- imesa->lastSwap = tmp;
- imesa->upload_cliprects = GL_TRUE;
-}
-
-/* Flip the front & back buffes
- */
-void i830PageFlip( const __DRIdrawablePrivate *dPriv )
-{
-#if 0
- i830ContextPtr imesa;
- int tmp, ret;
-
- if (I830_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- imesa = (i830ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- I830_FIREVERTICES( imesa );
- LOCK_HARDWARE( imesa );
-
- imesa->sarea->perf_boxes |= imesa->perf_boxes;
- imesa->perf_boxes = 0;
-
- if (dPriv->pClipRects) {
- *(drm_clip_rect_t *)imesa->sarea->boxes = dPriv->pClipRects[0];
- imesa->sarea->nbox = 1;
- }
-
- ret = drmCommandNone(imesa->driFd, DRM_I830_FLIP);
- if (ret) {
- fprintf(stderr, "%s: %d\n", __FUNCTION__, ret);
- UNLOCK_HARDWARE( imesa );
- exit(1);
- }
-
- tmp = GET_ENQUEUE_AGE(imesa);
- UNLOCK_HARDWARE( imesa );
-
- /* multiarb will suck the life out of the server without this throttle:
- */
- if (GET_DISPATCH_AGE(imesa) < imesa->lastSwap) {
- i830WaitAge(imesa, imesa->lastSwap);
- }
-
- i830SetDrawBuffer( imesa->glCtx, imesa->glCtx->Color.DriverDrawBuffer );
- imesa->upload_cliprects = GL_TRUE;
- imesa->lastSwap = tmp;
-#endif
-}
-
-/* This waits for *everybody* to finish rendering -- overkill.
- */
-void i830DmaFinish( i830ContextPtr imesa )
-{
- I830_FIREVERTICES( imesa );
- LOCK_HARDWARE_QUIESCENT( imesa );
- UNLOCK_HARDWARE( imesa );
-}
-
-void i830RegetLockQuiescent( i830ContextPtr imesa )
-{
- drmUnlock(imesa->driFd, imesa->hHWContext);
- i830GetLock( imesa, DRM_LOCK_QUIESCENT );
-}
-
-void i830WaitAgeLocked( i830ContextPtr imesa, int age )
-{
- int i = 0;
- while (++i < 5000) {
- drmCommandNone(imesa->driFd, DRM_I830_GETAGE);
- if (GET_DISPATCH_AGE(imesa) >= age) return;
- imesa->sarea->perf_boxes |= I830_BOX_WAIT;
- UNLOCK_HARDWARE( imesa );
- if (I830_DEBUG & DEBUG_SLEEP) fprintf(stderr, ".");
- usleep(1);
- LOCK_HARDWARE( imesa );
- }
- /* If that didn't work, just do a flush:
- */
- drmCommandNone(imesa->driFd, DRM_I830_FLUSH);
-}
-
-void i830WaitAge( i830ContextPtr imesa, int age )
-{
- int i = 0;
- if (GET_DISPATCH_AGE(imesa) >= age) return;
-
- while (1) {
- drmCommandNone(imesa->driFd, DRM_I830_GETAGE);
- if (GET_DISPATCH_AGE(imesa) >= age) return;
- imesa->perf_boxes |= I830_BOX_WAIT;
-
- if (imesa->do_irqs) {
- drmI830IrqEmit ie;
- drmI830IrqWait iw;
- int ret;
-
- ie.irq_seq = &iw.irq_seq;
-
- LOCK_HARDWARE( imesa );
- ret = drmCommandWriteRead( imesa->driFd, DRM_I830_IRQ_EMIT, &ie, sizeof(ie) );
- if ( ret ) {
- fprintf( stderr, "%s: drmI830IrqEmit: %d\n", __FUNCTION__, ret );
- exit(1);
- }
- UNLOCK_HARDWARE(imesa);
-
- ret = drmCommandWrite( imesa->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw) );
- if ( ret ) {
- fprintf( stderr, "%s: drmI830IrqWait: %d\n", __FUNCTION__, ret );
- exit(1);
- }
- } else {
- if (++i > 5000) usleep(1);
- }
- }
-}
-
-static void age_imesa( i830ContextPtr imesa, int age )
-{
- if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->base.timestamp = age;
- if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->base.timestamp = age;
-}
-
-void i830FlushPrimsLocked( i830ContextPtr imesa )
-{
- drm_clip_rect_t *pbox = imesa->pClipRects;
- int nbox = imesa->numClipRects;
- drmBufPtr buffer = imesa->vertex_buffer;
- I830SAREAPtr sarea = imesa->sarea;
- drmI830Vertex vertex;
- int i, nr;
-
- if (I830_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s dirty: %08x\n", __FUNCTION__, imesa->dirty);
-
-
- vertex.idx = buffer->idx;
- vertex.used = imesa->vertex_low;
- vertex.discard = 0;
- sarea->vertex_prim = imesa->hw_primitive;
-
- /* Reset imesa vars:
- */
- imesa->vertex_buffer = 0;
- imesa->vertex_addr = 0;
- imesa->vertex_low = 0;
- imesa->vertex_high = 0;
- imesa->vertex_last_prim = 0;
-
- if (imesa->dirty) {
- if (I830_DEBUG & DEBUG_SANITY)
- i830EmitHwStateLockedDebug(imesa);
- else
- i830EmitHwStateLocked(imesa);
- }
-
- if (I830_DEBUG & DEBUG_IOCTL)
- fprintf(stderr,"%s: Vertex idx %d used %d discard %d\n",
- __FUNCTION__, vertex.idx, vertex.used, vertex.discard);
-
- if (!nbox) {
- vertex.used = 0;
- vertex.discard = 1;
- if (drmCommandWrite (imesa->driFd, DRM_I830_VERTEX,
- &vertex, sizeof(drmI830Vertex))) {
- fprintf(stderr, "DRM_I830_VERTEX: %d\n", -errno);
- UNLOCK_HARDWARE(imesa);
- exit(1);
- }
- return;
- }
-
- for (i = 0 ; i < nbox ; i = nr ) {
- drm_clip_rect_t *b = sarea->boxes;
- int j;
-
- nr = MIN2(i + I830_NR_SAREA_CLIPRECTS, nbox);
- sarea->nbox = nr - i;
-
- for ( j = i ; j < nr ; j++) {
- b[j-i] = pbox[j];
- }
-
- /* Finished with the buffer?
- */
- if (nr == nbox)
- vertex.discard = 1;
-
- /* Do a bunch of sanity checks on the vertices sent to the hardware */
- if (I830_DEBUG & DEBUG_SANITY) {
- i830VertexSanity(imesa, vertex);
-
- for ( j = 0 ; j < sarea->nbox ; j++) {
- fprintf(stderr, "box %d/%d %d,%d %d,%d\n",
- j, sarea->nbox, b[j].x1, b[j].y1, b[j].x2, b[j].y2);
- }
- }
-
- drmCommandWrite (imesa->driFd, DRM_I830_VERTEX,
- &vertex, sizeof(drmI830Vertex));
- age_imesa(imesa, imesa->sarea->last_enqueue);
- }
-
- imesa->dirty = 0;
- imesa->upload_cliprects = GL_FALSE;
-}
-
-void i830FlushPrimsGetBufferLocked( i830ContextPtr imesa )
-{
- if (imesa->vertex_buffer)
- i830FlushPrimsLocked( imesa );
- imesa->vertex_buffer = i830_get_buffer_ioctl( imesa );
- imesa->vertex_addr = (char *)imesa->vertex_buffer->address;
-
- /* leave room for instruction header & footer:
- */
- imesa->vertex_high = imesa->vertex_buffer->total - 4;
- imesa->vertex_low = 4;
- imesa->vertex_last_prim = imesa->vertex_low;
-}
-
-void i830FlushPrimsGetBuffer( i830ContextPtr imesa )
-{
- LOCK_HARDWARE(imesa);
- i830FlushPrimsGetBufferLocked( imesa );
- UNLOCK_HARDWARE(imesa);
-}
-
-
-void i830FlushPrims( i830ContextPtr imesa )
-{
- if (imesa->vertex_buffer) {
- LOCK_HARDWARE( imesa );
- i830FlushPrimsLocked( imesa );
- UNLOCK_HARDWARE( imesa );
- }
-}
-
-int i830_check_copy(int fd)
-{
- return drmCommandNone(fd, DRM_I830_DOCOPY);
-}
-
-static void i830Flush( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- I830_FIREVERTICES( imesa );
-}
-
-static void i830Finish( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- i830DmaFinish( imesa );
-}
-
-void i830InitIoctlFuncs( struct dd_function_table *functions )
-{
- functions->Flush = i830Flush;
- functions->Clear = i830Clear;
- functions->Finish = i830Finish;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.h
deleted file mode 100644
index f92ff44ea..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_ioctl.h
+++ /dev/null
@@ -1,105 +0,0 @@
-
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_ioctl.h,v 1.3 2002/10/30 12:51:35 alanh Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- * Graeme Fisher <graeme@2d3d.co.za>
- * Abraham vd Merwe <abraham@2d3d.co.za>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef I830_IOCTL_H
-#define I830_IOCTL_H
-
-#include "i830_context.h"
-
-GLuint *i830AllocDwords (i830ContextPtr imesa, int dwords);
-void i830EmitPrim( i830ContextPtr imesa );
-void i830FlushPrims( i830ContextPtr mmesa );
-void i830FlushPrimsLocked( i830ContextPtr mmesa );
-void i830FlushPrimsGetBuffer( i830ContextPtr imesa );
-void i830FlushPrimsGetBufferLocked( i830ContextPtr imesa );
-void i830WaitAgeLocked( i830ContextPtr imesa, int age );
-void i830WaitAge( i830ContextPtr imesa, int age );
-void i830DmaFinish( i830ContextPtr imesa );
-void i830RegetLockQuiescent( i830ContextPtr imesa );
-void i830InitIoctlFuncs( struct dd_function_table *functions );
-void i830CopyBuffer( const __DRIdrawablePrivate *dpriv );
-void i830PageFlip( const __DRIdrawablePrivate *dpriv );
-int i830_check_copy(int fd);
-
-#define I830_STATECHANGE(imesa, flag) \
-do { \
- if (imesa->vertex_low != imesa->vertex_last_prim) \
- i830FlushPrims(imesa); \
- imesa->dirty |= flag; \
-} while (0)
-
-
-#define I830_FIREVERTICES(imesa) \
-do { \
- if (imesa->vertex_buffer) { \
- i830FlushPrims(imesa); \
-} \
-} while (0)
-
-
-static __inline GLuint *i830AllocDmaLow( i830ContextPtr imesa, int bytes )
-{
- if (imesa->vertex_low + bytes > imesa->vertex_high) {
- i830FlushPrimsGetBuffer( imesa );
- }
-
- {
- GLuint *start = (GLuint *)(imesa->vertex_addr + imesa->vertex_low);
- imesa->vertex_low += bytes;
- return start;
- }
-}
-
-static __inline GLuint *i830AllocDmaLowLocked( i830ContextPtr imesa,
- int bytes )
-{
- if (imesa->vertex_low + bytes > imesa->vertex_high) {
- i830FlushPrimsGetBufferLocked( imesa );
- }
-
- {
- GLuint *start = (GLuint *)(imesa->vertex_addr + imesa->vertex_low);
- imesa->vertex_low += bytes;
- return start;
- }
-}
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_render.c
deleted file mode 100644
index b0592e9cd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_render.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Intel i810 DRI driver for Mesa 3.5
- *
- * Copyright (C) 1999-2000 Keith Whitwell All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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 KEITH WHITWELL BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Author:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Adapted for use on the I830:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_render.c,v 1.2 2002/12/10 01:26:53 dawes Exp $ */
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware acceleration where possible.
- *
- */
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "enums.h"
-
-#include "tnl/t_context.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_context.h"
-#include "i830_tris.h"
-#include "i830_state.h"
-#include "i830_ioctl.h"
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Try to simulate missing primitives with indexed vertices.
- */
-#define HAVE_POINTS 0 /* Has it, but can't use because subpixel has to
- * be adjusted for points on the I830/I845G
- */
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0 /* has it, template can't use it yet */
-#define HAVE_TRI_FANS 1
-#define HAVE_POLYGONS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-
-#define HAVE_ELTS 0
-
-static GLuint hw_prim[GL_POLYGON+1] = {
- 0,
- PRIM3D_LINELIST,
- PRIM3D_LINESTRIP,
- PRIM3D_LINESTRIP,
- PRIM3D_TRILIST,
- PRIM3D_TRISTRIP,
- PRIM3D_TRIFAN,
- 0,
- 0,
- PRIM3D_POLY
-};
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-static const int scale_prim[GL_POLYGON+1] = {
- 0, /* fallback case */
- 1,
- 2,
- 2,
- 1,
- 3,
- 3,
- 0, /* fallback case */
- 0, /* fallback case */
- 3
-};
-
-
-#define LOCAL_VARS i830ContextPtr imesa = I830_CONTEXT(ctx)
-#define INIT( prim ) do { \
- I830_STATECHANGE(imesa, 0); \
- i830RasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); \
-} while (0)
-
-#define FLUSH() I830_FIREVERTICES( imesa )
-#define GET_CURRENT_VB_MAX_VERTS() \
- (((int)imesa->vertex_high - (int)imesa->vertex_low) / (imesa->vertex_size*4))
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- (I830_DMA_BUF_SZ-8) / (imesa->vertex_size * 4)
-
-
-#define ALLOC_VERTS( nr ) \
- i830AllocDmaLow( imesa, (nr) * imesa->vertex_size * 4)
-#define EMIT_VERTS( ctx, j, nr, buf ) \
- _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf)
-
-#define TAG(x) i830_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-/* Heuristic for i830, which can only emit a single primitive per dma
- * buffer, and has only a small number of dma buffers.
- */
-static GLboolean choose_render( struct vertex_buffer *VB, int bufsz )
-{
- int nr_prims = 0;
- int nr_rprims = 0;
- int nr_rverts = 0;
- int rprim = 0;
- int i;
-
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- if (!hw_prim[prim & PRIM_MODE_MASK])
- return GL_FALSE;
-
- nr_prims++;
- nr_rverts += length * scale_prim[prim & PRIM_MODE_MASK];
-
- if (reduced_prim[prim&PRIM_MODE_MASK] != rprim) {
- nr_rprims++;
- rprim = reduced_prim[prim&PRIM_MODE_MASK];
- }
- }
-
- nr_prims += i / bufsz;
- nr_rprims += nr_rverts / bufsz;
-
- if ((nr_prims > nr_rprims * 2) ||
- (nr_prims > nr_rprims + 3))
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-static GLboolean i830_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- /* Don't handle clipping or indexed vertices.
- */
- if (imesa->RenderIndex != 0 ||
- !i830_validate_render( ctx, VB ) ||
- !choose_render( VB, 200 )) { /* 200 is estimate of nr verts/buf */
- return GL_TRUE;
- }
-
- tnl->Driver.Render.Start( ctx );
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- i830_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length,
- prim );
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-const struct tnl_pipeline_stage _i830_render_stage =
-{
- "i830 render",
- NULL,
- NULL,
- NULL,
- NULL,
- i830_run_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.c
deleted file mode 100644
index 25def0b6f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.c
+++ /dev/null
@@ -1,557 +0,0 @@
-/**************************************************************************
- *
- * 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.
- *
- * **************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_screen.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */
-
-/**
- * \file i830_screen.c
- *
- * Adapted for use on the I830M by Jeff Hartmann.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- * \author Jeff Hartmann <jhartmann@2d3d.com>
- */
-
-
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_state.h"
-#include "i830_tex.h"
-#include "i830_span.h"
-#include "i830_tris.h"
-#include "i830_ioctl.h"
-
-#include "i830_dri.h"
-
-#include "utils.h"
-#include "xmlpool.h"
-#include "drirenderbuffer.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_MAX_TEXTURE_UNITS(4,2,4)
- DRI_CONF_FORCE_S3TC_ENABLE(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-const GLuint __driNConfigOptions = 2;
-
-extern const struct dri_extension card_extensions[];
-
-static int i830_malloc_proxy_buf(drmBufMapPtr buffers)
-{
- char *buffer;
- drmBufPtr buf;
- int i;
-
- buffer = ALIGN_MALLOC(I830_DMA_BUF_SZ, 32);
- if(buffer == NULL) return -1;
- for(i = 0; i < I830_DMA_BUF_NR; i++) {
- buf = &(buffers->list[i]);
- buf->address = (drmAddress)buffer;
- }
-
- return 0;
-}
-
-static drmBufMapPtr i830_create_empty_buffers(void)
-{
- drmBufMapPtr retval;
-
- retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32);
- if(retval == NULL) return NULL;
- memset(retval, 0, sizeof(drmBufMap));
- retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I830_DMA_BUF_NR, 32);
- if(retval->list == NULL) {
- FREE(retval);
- return NULL;
- }
-
- memset(retval->list, 0, sizeof(drmBuf) * I830_DMA_BUF_NR);
- return retval;
-}
-
-static void i830PrintDRIInfo(i830ScreenPrivate *i830Screen,
- __DRIscreenPrivate *sPriv,
- I830DRIPtr gDRIPriv)
-{
- GLuint size = (gDRIPriv->ringSize +
- i830Screen->textureSize +
- i830Screen->depth.size +
- i830Screen->back.size +
- sPriv->fbSize +
- I830_DMA_BUF_NR * I830_DMA_BUF_SZ +
- 32768 /* Context Memory */ +
- 16*4096 /* Ring buffer */ +
- 64*1024 /* Scratch buffer */ +
- 4096 /* Cursor */);
- GLuint size_low = (gDRIPriv->ringSize +
- i830Screen->textureSize +
- sPriv->fbSize +
- I830_DMA_BUF_NR * I830_DMA_BUF_SZ +
- 32768 /* Context Memory */ +
- 16*4096 /* Ring buffer */ +
- 64*1024 /* Scratch buffer */);
-
- fprintf(stderr, "\nFront size : 0x%x\n", sPriv->fbSize);
- fprintf(stderr, "Front offset : 0x%x\n", i830Screen->fbOffset);
- fprintf(stderr, "Back size : 0x%x\n", i830Screen->back.size);
- fprintf(stderr, "Back offset : 0x%x\n", i830Screen->backOffset);
- fprintf(stderr, "Depth size : 0x%x\n", i830Screen->depth.size);
- fprintf(stderr, "Depth offset : 0x%x\n", i830Screen->depthOffset);
- fprintf(stderr, "Texture size : 0x%x\n", i830Screen->textureSize);
- fprintf(stderr, "Texture offset : 0x%x\n", i830Screen->textureOffset);
- fprintf(stderr, "Ring offset : 0x%x\n", gDRIPriv->ringOffset);
- fprintf(stderr, "Ring size : 0x%x\n", gDRIPriv->ringSize);
- fprintf(stderr, "Memory : 0x%x\n", gDRIPriv->mem);
- fprintf(stderr, "Used Memory : low(0x%x) high(0x%x)\n", size_low, size);
-}
-
-static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
-{
- i830ScreenPrivate *i830Screen;
- I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- i830Screen = (i830ScreenPrivate *)CALLOC(sizeof(i830ScreenPrivate));
- if (!i830Screen) {
- fprintf(stderr,"\nERROR! Allocating private area failed\n");
- return GL_FALSE;
- }
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&i830Screen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
-
- i830Screen->driScrnPriv = sPriv;
- sPriv->private = (void *)i830Screen;
-
- i830Screen->deviceID = gDRIPriv->deviceID;
- i830Screen->width = gDRIPriv->width;
- i830Screen->height = gDRIPriv->height;
- i830Screen->mem = gDRIPriv->mem;
- i830Screen->cpp = gDRIPriv->cpp;
- i830Screen->fbStride = gDRIPriv->fbStride;
- i830Screen->fbOffset = gDRIPriv->fbOffset;
-
- switch (gDRIPriv->bitsPerPixel) {
- case 15: i830Screen->fbFormat = DV_PF_555; break;
- case 16: i830Screen->fbFormat = DV_PF_565; break;
- case 32: i830Screen->fbFormat = DV_PF_8888; break;
- }
-
- i830Screen->backOffset = gDRIPriv->backOffset;
- i830Screen->depthOffset = gDRIPriv->depthOffset;
- i830Screen->backPitch = gDRIPriv->auxPitch;
- i830Screen->backPitchBits = gDRIPriv->auxPitchBits;
- i830Screen->textureOffset = gDRIPriv->textureOffset;
- i830Screen->textureSize = gDRIPriv->textureSize;
- i830Screen->logTextureGranularity = gDRIPriv->logTextureGranularity;
-
-
- i830Screen->bufs = i830_create_empty_buffers();
- if(i830Screen->bufs == NULL) {
- fprintf(stderr,"\nERROR: Failed to create empty buffers in %s \n",
- __FUNCTION__);
- FREE(i830Screen);
- return GL_FALSE;
- }
-
- /* Check if you need to create a fake buffer */
- if(i830_check_copy(sPriv->fd) == 1) {
- i830_malloc_proxy_buf(i830Screen->bufs);
- i830Screen->use_copy_buf = 1;
- } else {
- i830Screen->use_copy_buf = 0;
- }
-
- i830Screen->back.handle = gDRIPriv->backbuffer;
- i830Screen->back.size = gDRIPriv->backbufferSize;
-
- if (drmMap(sPriv->fd,
- i830Screen->back.handle,
- i830Screen->back.size,
- (drmAddress *)&i830Screen->back.map) != 0) {
- fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
- __LINE__, __FUNCTION__, __FILE__);
- FREE(i830Screen);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- i830Screen->depth.handle = gDRIPriv->depthbuffer;
- i830Screen->depth.size = gDRIPriv->depthbufferSize;
-
- if (drmMap(sPriv->fd,
- i830Screen->depth.handle,
- i830Screen->depth.size,
- (drmAddress *)&i830Screen->depth.map) != 0) {
- fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
- __LINE__, __FUNCTION__, __FILE__);
- FREE(i830Screen);
- drmUnmap(i830Screen->back.map, i830Screen->back.size);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- i830Screen->tex.handle = gDRIPriv->textures;
- i830Screen->tex.size = gDRIPriv->textureSize;
-
- if (drmMap(sPriv->fd,
- i830Screen->tex.handle,
- i830Screen->tex.size,
- (drmAddress *)&i830Screen->tex.map) != 0) {
- fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
- __LINE__, __FUNCTION__, __FILE__);
- FREE(i830Screen);
- drmUnmap(i830Screen->back.map, i830Screen->back.size);
- drmUnmap(i830Screen->depth.map, i830Screen->depth.size);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- i830Screen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
-
- if (0) i830PrintDRIInfo(i830Screen, sPriv, gDRIPriv);
-
- i830Screen->drmMinor = sPriv->drmMinor;
-
- if (sPriv->drmMinor >= 3) {
- int ret;
- drmI830GetParam gp;
-
- gp.param = I830_PARAM_IRQ_ACTIVE;
- gp.value = &i830Screen->irq_active;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_I830_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drmI830GetParam: %d\n", ret);
- return GL_FALSE;
- }
- }
-
-#if 0
- if (sPriv->drmMinor >= 3) {
- int ret;
- drmI830SetParam sp;
-
- sp.param = I830_SETPARAM_PERF_BOXES;
- sp.value = (getenv("I830_DO_BOXES") != 0);
-
- ret = drmCommandWrite( sPriv->fd, DRM_I830_SETPARAM,
- &sp, sizeof(sp));
- if (ret)
- fprintf(stderr, "Couldn't set perfboxes: %d\n", ret);
- }
-#endif
-
- if ( glx_enable_extension != NULL ) {
- (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
- }
-
- return GL_TRUE;
-}
-
-
-static void i830DestroyScreen(__DRIscreenPrivate *sPriv)
-{
- i830ScreenPrivate *i830Screen = (i830ScreenPrivate *)sPriv->private;
-
- /* Need to unmap all the bufs and maps here:
- */
- drmUnmap(i830Screen->back.map, i830Screen->back.size);
- drmUnmap(i830Screen->depth.map, i830Screen->depth.size);
- drmUnmap(i830Screen->tex.map, i830Screen->tex.size);
- FREE(i830Screen);
- sPriv->private = NULL;
-}
-
-
-static GLboolean i830CreateBuffer(__DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- i830ScreenPrivate *screen = (i830ScreenPrivate *) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- GLboolean swStencil = (mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24);
-#else
- GLboolean swStencil = mesaVis->stencilBits > 0;
-#endif
-
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- /*screen->frontOffset*/0, screen->backPitch);
- i830SetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- i830SetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->backPitch);
- i830SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- if (mesaVis->stencilBits == 8) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->backPitch);
- i830SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else {
- /* not really 32-bit Z, but use GL_DEPTH_COMPONENT32 anyway */
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- screen->depthOffset, screen->backPitch);
- i830SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->backPitch);
- i830SetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
-
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-static void i830DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-static const struct __DriverAPIRec i830API = {
- .InitDriver = i830InitDriver,
- .DestroyScreen = i830DestroyScreen,
- .CreateContext = i830CreateContext,
- .DestroyContext = i830DestroyContext,
- .CreateBuffer = i830CreateBuffer,
- .DestroyBuffer = i830DestroyBuffer,
- .SwapBuffers = i830SwapBuffers,
- .MakeCurrent = i830MakeCurrent,
- .UnbindContext = i830UnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = NULL,
- .WaitForMSC = NULL,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-static __GLcontextModes *
-i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* GLX_SWAP_COPY_OML is only supported because the MGA driver doesn't
- * support pageflipping at all.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 3 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* There's no direct color modes on i830? */
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 3, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "i830",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &i830API);
- if ( psp != NULL ) {
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
- *driver_modes = i830FillInModes( dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.h
deleted file mode 100644
index edbe719e0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_screen.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**************************************************************************
-
-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.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Adapted for use on the I830M:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-
-#ifndef _I830_INIT_H_
-#define _I830_INIT_H_
-
-#include <sys/time.h>
-#include "dri_util.h"
-#include "xmlconfig.h"
-
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
- char *map;
-} i830Region, *i830RegionPtr;
-
-typedef struct
-{
-
- i830Region front;
- i830Region back;
- i830Region depth;
- i830Region tex;
-
- int deviceID;
- int width;
- int height;
- int mem;
-
- int cpp; /* for front and back buffers */
- int bitsPerPixel;
-
- int fbFormat;
- int fbOffset;
- int fbStride;
-
- int backOffset;
- int depthOffset;
-
- int backPitch;
- int backPitchBits;
-
- int textureOffset;
- int textureSize;
- int logTextureGranularity;
-
- __DRIscreenPrivate *driScrnPriv;
- drmBufMapPtr bufs;
- int use_copy_buf;
- unsigned int sarea_priv_offset;
-
- int drmMinor;
- int irq_active;
-
- /**
- * Configuration cache with default values for all contexts
- */
- driOptionCache optionCache;
-}i830ScreenPrivate;
-
-
-extern GLboolean
-i830CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate );
-
-extern void
-i830DestroyContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-i830UnbindContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-i830MakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv);
-
-extern void
-i830SwapBuffers(__DRIdrawablePrivate *driDrawPriv);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.c
deleted file mode 100644
index 4a86784e8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_span.c,v 1.4 2002/12/10 01:26:53 dawes Exp $ */
-
-/**
- * \file i830_span.c
- *
- * Heavily based on the I810 driver, which was written by Keith Whitwell.
- *
- * \author Jeff Hartmann <jhartmann@2d3d.com>
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_span.h"
-#include "i830_ioctl.h"
-#include "swrast/swrast.h"
-
-
-#define DBG 0
-
-#define LOCAL_VARS \
- i830ContextPtr imesa = I830_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
- i830ScreenPrivate *i830Screen = imesa->i830Screen; \
- GLuint pitch = i830Screen->backPitch * i830Screen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(imesa->drawMap + \
- dPriv->x * i830Screen->cpp + \
- dPriv->y * pitch); \
- char *read_buf = (char *)(imesa->readMap + \
- dPriv->x * i830Screen->cpp + \
- dPriv->y * pitch); \
- GLushort p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- i830ContextPtr imesa = I830_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
- i830ScreenPrivate *i830Screen = imesa->i830Screen; \
- GLuint pitch = i830Screen->backPitch * i830Screen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(i830Screen->depth.map + \
- dPriv->x * i830Screen->cpp + \
- dPriv->y * pitch)
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define INIT_MONO_PIXEL(p,color)\
- p = PACK_COLOR_565(color[0],color[1],color[2])
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-/* 16 bit, 565 rgb color spanline and pixel functions
- */
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ( (((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (((p >> 11) & 0x1f) * 255) / 31; \
- rgba[1] = (((p >> 5) & 0x3f) * 255) / 63; \
- rgba[2] = (((p >> 0) & 0x1f) * 255) / 31; \
- rgba[3] = 255; \
-} while(0)
-
-#define TAG(x) i830##x##_565
-#include "spantmp.h"
-
-/* 15 bit, 555 rgb color spanline and pixel functions
- */
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = (((r & 0xf8) << 7) | \
- ((g & 0xf8) << 3) | \
- ((b & 0xf8) >> 3))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (p >> 7) & 0xf8; \
- rgba[1] = (p >> 3) & 0xf8; \
- rgba[2] = (p << 3) & 0xf8; \
- rgba[3] = 255; \
-} while(0)
-
-#define TAG(x) i830##x##_555
-#include "spantmp.h"
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + _x*2 + _y*pitch);
-
-
-#define TAG(x) i830##x##_16
-#include "depthtmp.h"
-
-
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- i830ContextPtr imesa = I830_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
- i830ScreenPrivate *i830Screen = imesa->i830Screen; \
- GLuint pitch = i830Screen->backPitch * i830Screen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(imesa->drawMap + \
- dPriv->x * i830Screen->cpp + \
- dPriv->y * pitch); \
- char *read_buf = (char *)(imesa->readMap + \
- dPriv->x * i830Screen->cpp + \
- dPriv->y * pitch); \
- GLuint p = I830_CONTEXT( ctx )->MonoColor; \
- (void) read_buf; (void) buf; (void) p
-
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p,color)\
- p = PACK_COLOR_888(color[0],color[1],color[2])
-
-/* 32 bit, 8888 argb color spanline and pixel functions
- */
-#define WRITE_RGBA(_x, _y, r, g, b, a) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = ((r << 16) | \
- (g << 8) | \
- (b << 0) | \
- (a << 24) )
-
-#define WRITE_PIXEL(_x, _y, p) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = p
-
-
-#define READ_RGBA(rgba, _x, _y) \
- do { \
- GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
- } while (0)
-
-#define TAG(x) i830##x##_8888
-#include "spantmp.h"
-
-/* 24 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = 0xffffff & d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xffffff;
-
-#define TAG(x) i830##x##_24
-#include "depthtmp.h"
-
-/* 24/8 bit interleaved depth/stencil functions
- */
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
- tmp &= 0xff000000; \
- tmp |= (d) & 0xffffff; \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xffffff;
-
-
-#define TAG(x) i830##x##_24_8
-#include "depthtmp.h"
-
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
- tmp &= 0xffffff; \
- tmp |= (d<<24); \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) >> 24;
-
-#define TAG(x) i830##x##_24_8
-#include "stenciltmp.h"
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void i830SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLuint bufferBit)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- assert( (colorBuffer == imesa->driDrawable->driverPrivate)
- || (colorBuffer == imesa->driReadable->driverPrivate) );
-
- imesa->mesa_drawable = (colorBuffer == imesa->driDrawable->driverPrivate)
- ? imesa->driDrawable : imesa->driReadable;
-
- if (bufferBit == BUFFER_BIT_FRONT_LEFT) {
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
- } else if (bufferBit == BUFFER_BIT_BACK_LEFT) {
- imesa->drawMap = imesa->i830Screen->back.map;
- imesa->readMap = imesa->i830Screen->back.map;
- } else {
- ASSERT(0);
- }
-}
-
-
-
-/* Move locking out to get reasonable span performance.
- */
-void i830SpanRenderStart( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- I830_FIREVERTICES(imesa);
- LOCK_HARDWARE(imesa);
- i830RegetLockQuiescent( imesa );
-}
-
-void i830SpanRenderFinish( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( imesa );
-}
-
-void i830DDInitSpanFuncs( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- i830ScreenPrivate *i830Screen = imesa->i830Screen;
-
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = i830SetBuffer;
-
- switch (i830Screen->fbFormat) {
- case DV_PF_555:
-#if 0
- swdd->WriteRGBASpan = i830WriteRGBASpan_555;
- swdd->WriteRGBSpan = i830WriteRGBSpan_555;
- swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_555;
- swdd->WriteRGBAPixels = i830WriteRGBAPixels_555;
- swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_555;
- swdd->ReadRGBASpan = i830ReadRGBASpan_555;
- swdd->ReadRGBAPixels = i830ReadRGBAPixels_555;
- swdd->ReadDepthSpan = i830ReadDepthSpan_16;
- swdd->WriteDepthSpan = i830WriteDepthSpan_16;
- swdd->ReadDepthPixels = i830ReadDepthPixels_16;
- swdd->WriteDepthPixels = i830WriteDepthPixels_16;
-#endif
- break;
-
- case DV_PF_565:
-#if 0
- swdd->WriteRGBASpan = i830WriteRGBASpan_565;
- swdd->WriteRGBSpan = i830WriteRGBSpan_565;
- swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_565;
- swdd->WriteRGBAPixels = i830WriteRGBAPixels_565;
- swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_565;
- swdd->ReadRGBASpan = i830ReadRGBASpan_565;
- swdd->ReadRGBAPixels = i830ReadRGBAPixels_565;
- swdd->ReadDepthSpan = i830ReadDepthSpan_16;
- swdd->WriteDepthSpan = i830WriteDepthSpan_16;
- swdd->ReadDepthPixels = i830ReadDepthPixels_16;
- swdd->WriteDepthPixels = i830WriteDepthPixels_16;
-#endif
- break;
-
- case DV_PF_8888:
-#if 0
- swdd->WriteRGBASpan = i830WriteRGBASpan_8888;
- swdd->WriteRGBSpan = i830WriteRGBSpan_8888;
- swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_8888;
- swdd->WriteRGBAPixels = i830WriteRGBAPixels_8888;
- swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_8888;
- swdd->ReadRGBASpan = i830ReadRGBASpan_8888;
- swdd->ReadRGBAPixels = i830ReadRGBAPixels_8888;
-#endif
-
- if(imesa->hw_stencil) {
-#if 0
- swdd->ReadDepthSpan = i830ReadDepthSpan_24_8;
- swdd->WriteDepthSpan = i830WriteDepthSpan_24_8;
- swdd->ReadDepthPixels = i830ReadDepthPixels_24_8;
- swdd->WriteDepthPixels = i830WriteDepthPixels_24_8;
- swdd->WriteStencilSpan = i830WriteStencilSpan_24_8;
- swdd->ReadStencilSpan = i830ReadStencilSpan_24_8;
- swdd->WriteStencilPixels = i830WriteStencilPixels_24_8;
- swdd->ReadStencilPixels = i830ReadStencilPixels_24_8;
-#endif
- } else {
-#if 0
- swdd->ReadDepthSpan = i830ReadDepthSpan_24;
- swdd->WriteDepthSpan = i830WriteDepthSpan_24;
- swdd->ReadDepthPixels = i830ReadDepthPixels_24;
- swdd->WriteDepthPixels = i830WriteDepthPixels_24;
-#endif
- }
- break;
- }
-
- swdd->SpanRenderStart = i830SpanRenderStart;
- swdd->SpanRenderFinish = i830SpanRenderFinish;
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-i830SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
- drb->Base.GetRow = i830ReadRGBASpan_555;
- drb->Base.GetValues = i830ReadRGBAPixels_555;
- drb->Base.PutRow = i830WriteRGBASpan_555;
- drb->Base.PutRowRGB = i830WriteRGBSpan_555;
- drb->Base.PutMonoRow = i830WriteMonoRGBASpan_555;
- drb->Base.PutValues = i830WriteRGBAPixels_555;
- drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_555;
- }
- else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = i830ReadRGBASpan_565;
- drb->Base.GetValues = i830ReadRGBAPixels_565;
- drb->Base.PutRow = i830WriteRGBASpan_565;
- drb->Base.PutRowRGB = i830WriteRGBSpan_565;
- drb->Base.PutMonoRow = i830WriteMonoRGBASpan_565;
- drb->Base.PutValues = i830WriteRGBAPixels_565;
- drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_565;
- }
- else {
- assert(vis->redBits == 8);
- assert(vis->greenBits == 8);
- assert(vis->blueBits == 8);
- drb->Base.GetRow = i830ReadRGBASpan_8888;
- drb->Base.GetValues = i830ReadRGBAPixels_8888;
- drb->Base.PutRow = i830WriteRGBASpan_8888;
- drb->Base.PutRowRGB = i830WriteRGBSpan_8888;
- drb->Base.PutMonoRow = i830WriteMonoRGBASpan_8888;
- drb->Base.PutValues = i830WriteRGBAPixels_8888;
- drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_8888;
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = i830ReadDepthSpan_16;
- drb->Base.GetValues = i830ReadDepthPixels_16;
- drb->Base.PutRow = i830WriteDepthSpan_16;
- drb->Base.PutMonoRow = i830WriteMonoDepthSpan_16;
- drb->Base.PutValues = i830WriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = i830ReadDepthSpan_24_8;
- drb->Base.GetValues = i830ReadDepthPixels_24_8;
- drb->Base.PutRow = i830WriteDepthSpan_24_8;
- drb->Base.PutMonoRow = i830WriteMonoDepthSpan_24_8;
- drb->Base.PutValues = i830WriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
- /* not _really_ 32-bit Z */
- drb->Base.GetRow = i830ReadDepthSpan_24;
- drb->Base.GetValues = i830ReadDepthPixels_24;
- drb->Base.PutRow = i830WriteDepthSpan_24;
- drb->Base.PutMonoRow = i830WriteMonoDepthSpan_24;
- drb->Base.PutValues = i830WriteDepthPixels_24;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = i830ReadStencilSpan_24_8;
- drb->Base.GetValues = i830ReadStencilPixels_24_8;
- drb->Base.PutRow = i830WriteStencilSpan_24_8;
- drb->Base.PutMonoRow = i830WriteMonoStencilSpan_24_8;
- drb->Base.PutValues = i830WriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.h
deleted file mode 100644
index 4b8341971..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_span.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_span.h,v 1.2 2002/09/11 00:29:26 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef _I830_SPAN_H
-#define _I830_SPAN_H
-
-#include "drirenderbuffer.h"
-
-extern void i830DDInitSpanFuncs( GLcontext *ctx );
-
-extern void i830SpanRenderFinish( GLcontext *ctx );
-extern void i830SpanRenderStart( GLcontext *ctx );
-
-extern void
-i830SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.c
deleted file mode 100644
index 615348544..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.c
+++ /dev/null
@@ -1,1707 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 2d3d Inc., Delray Beach, FL
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_state.c,v 1.6 2003/01/28 22:47:06 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "buffers.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "texmem.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_context.h"
-#include "i830_state.h"
-#include "i830_tex.h"
-#include "i830_tris.h"
-#include "i830_ioctl.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-static __inline__ GLuint i830PackColor(GLuint format,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a)
-{
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch (format) {
- case DV_PF_555:
- return I830PACKCOLOR1555(r,g,b,a);
- case DV_PF_565:
- return I830PACKCOLOR565(r,g,b);
- case DV_PF_8888:
- return I830PACKCOLOR8888(r,g,b,a);
- default:
- fprintf(stderr, "unknown format %d\n", (int)format);
- return 0;
- }
-}
-
-static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int test = 0;
-
- mask = mask & 0xff;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s : func: %s, ref : 0x%x, mask: 0x%x\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(func), ref, mask);
-
- switch(func) {
- case GL_NEVER:
- test = COMPAREFUNC_NEVER;
- break;
- case GL_LESS:
- test = COMPAREFUNC_LESS;
- break;
- case GL_LEQUAL:
- test = COMPAREFUNC_LEQUAL;
- break;
- case GL_GREATER:
- test = COMPAREFUNC_GREATER;
- break;
- case GL_GEQUAL:
- test = COMPAREFUNC_GEQUAL;
- break;
- case GL_NOTEQUAL:
- test = COMPAREFUNC_NOTEQUAL;
- break;
- case GL_EQUAL:
- test = COMPAREFUNC_EQUAL;
- break;
- case GL_ALWAYS:
- test = COMPAREFUNC_ALWAYS;
- break;
- default:
- return;
- }
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK;
- imesa->Setup[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(mask));
- imesa->Setup[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK |
- ENABLE_STENCIL_TEST_FUNC_MASK);
- imesa->Setup[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_REF_VALUE |
- ENABLE_STENCIL_TEST_FUNC |
- STENCIL_REF_VALUE(ref) |
- STENCIL_TEST_FUNC(test));
-}
-
-static void i830StencilMask(GLcontext *ctx, GLuint mask)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s : mask 0x%x\n", __FUNCTION__, mask);
-
- mask = mask & 0xff;
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK;
- imesa->Setup[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(mask));
-}
-
-static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int fop, dfop, dpop;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(fail),
- _mesa_lookup_enum_by_nr(zfail),
- _mesa_lookup_enum_by_nr(zpass));
-
- fop = 0; dfop = 0; dpop = 0;
-
- switch(fail) {
- case GL_KEEP:
- fop = STENCILOP_KEEP;
- break;
- case GL_ZERO:
- fop = STENCILOP_ZERO;
- break;
- case GL_REPLACE:
- fop = STENCILOP_REPLACE;
- break;
- case GL_INCR:
- fop = STENCILOP_INCRSAT;
- break;
- case GL_DECR:
- fop = STENCILOP_DECRSAT;
- break;
- case GL_INCR_WRAP:
- fop = STENCILOP_INCR;
- break;
- case GL_DECR_WRAP:
- fop = STENCILOP_DECR;
- break;
- case GL_INVERT:
- fop = STENCILOP_INVERT;
- break;
- default:
- break;
- }
- switch(zfail) {
- case GL_KEEP:
- dfop = STENCILOP_KEEP;
- break;
- case GL_ZERO:
- dfop = STENCILOP_ZERO;
- break;
- case GL_REPLACE:
- dfop = STENCILOP_REPLACE;
- break;
- case GL_INCR:
- dfop = STENCILOP_INCRSAT;
- break;
- case GL_DECR:
- dfop = STENCILOP_DECRSAT;
- break;
- case GL_INCR_WRAP:
- dfop = STENCILOP_INCR;
- break;
- case GL_DECR_WRAP:
- dfop = STENCILOP_DECR;
- break;
- case GL_INVERT:
- dfop = STENCILOP_INVERT;
- break;
- default:
- break;
- }
- switch(zpass) {
- case GL_KEEP:
- dpop = STENCILOP_KEEP;
- break;
- case GL_ZERO:
- dpop = STENCILOP_ZERO;
- break;
- case GL_REPLACE:
- dpop = STENCILOP_REPLACE;
- break;
- case GL_INCR:
- dpop = STENCILOP_INCRSAT;
- break;
- case GL_DECR:
- dpop = STENCILOP_DECRSAT;
- break;
- case GL_INCR_WRAP:
- dpop = STENCILOP_INCR;
- break;
- case GL_DECR_WRAP:
- dpop = STENCILOP_DECR;
- break;
- case GL_INVERT:
- dpop = STENCILOP_INVERT;
- break;
- default:
- break;
- }
-
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK);
- imesa->Setup[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_PARMS |
- STENCIL_FAIL_OP(fop) |
- STENCIL_PASS_DEPTH_FAIL_OP(dfop) |
- STENCIL_PASS_DEPTH_PASS_OP(dpop));
-}
-
-static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int test = 0;
- GLuint refByte = (GLint) (ref * 255.0);
-
- switch(func) {
- case GL_NEVER:
- test = COMPAREFUNC_NEVER;
- break;
- case GL_LESS:
- test = COMPAREFUNC_LESS;
- break;
- case GL_LEQUAL:
- test = COMPAREFUNC_LEQUAL;
- break;
- case GL_GREATER:
- test = COMPAREFUNC_GREATER;
- break;
- case GL_GEQUAL:
- test = COMPAREFUNC_GEQUAL;
- break;
- case GL_NOTEQUAL:
- test = COMPAREFUNC_NOTEQUAL;
- break;
- case GL_EQUAL:
- test = COMPAREFUNC_EQUAL;
- break;
- case GL_ALWAYS:
- test = COMPAREFUNC_ALWAYS;
- break;
- default:
- return;
- }
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE2] &= ~ALPHA_TEST_REF_MASK;
- imesa->Setup[I830_CTXREG_STATE2] |= (ENABLE_ALPHA_TEST_FUNC |
- ENABLE_ALPHA_REF_VALUE |
- ALPHA_TEST_FUNC(test) |
- ALPHA_REF_VALUE(refByte));
-}
-
-/* This function makes sure that the proper enables are
- * set for LogicOp, Independant Alpha Blend, and Blending.
- * It needs to be called from numerous places where we
- * could change the LogicOp or Independant Alpha Blend without subsequent
- * calls to glEnable.
- */
-static void i830EvalLogicOpBlendState(GLcontext *ctx)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
-
- imesa->Setup[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
- ENABLE_LOGIC_OP_MASK);
- imesa->Setup[I830_CTXREG_IALPHAB] &= ~ENABLE_INDPT_ALPHA_BLEND;
-
- if (ctx->Color.ColorLogicOpEnabled) {
- imesa->Setup[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
- ENABLE_LOGIC_OP);
- imesa->Setup[I830_CTXREG_IALPHAB] |= DISABLE_INDPT_ALPHA_BLEND;
- } else if (ctx->Color.BlendEnabled) {
- imesa->Setup[I830_CTXREG_ENABLES_1] |= (ENABLE_COLOR_BLEND |
- DISABLE_LOGIC_OP);
-
- /* If the alpha blend state does not match the color blend state,
- * enable independent alpha blending. Otherwise, leave it disabled
- * and the hardware will use the color blend state for both.
- */
-
- if ( 0 && (imesa->Setup[I830_CTXREG_IALPHAB] & BLEND_STATE_MASK)
- != (imesa->Setup[I830_CTXREG_STATE1] & BLEND_STATE_MASK) ) {
- imesa->Setup[I830_CTXREG_IALPHAB] |= ENABLE_INDPT_ALPHA_BLEND;
- } else {
- imesa->Setup[I830_CTXREG_IALPHAB] |= DISABLE_INDPT_ALPHA_BLEND;
- }
- } else {
- imesa->Setup[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
- DISABLE_LOGIC_OP);
- imesa->Setup[I830_CTXREG_IALPHAB] |= DISABLE_INDPT_ALPHA_BLEND;
- }
-}
-
-static void i830BlendColor(GLcontext *ctx, const GLfloat color[4])
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLubyte r, g, b, a;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- FLOAT_COLOR_TO_UBYTE_COLOR(r, color[RCOMP]);
- FLOAT_COLOR_TO_UBYTE_COLOR(g, color[GCOMP]);
- FLOAT_COLOR_TO_UBYTE_COLOR(b, color[BCOMP]);
- FLOAT_COLOR_TO_UBYTE_COLOR(a, color[ACOMP]);
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_BLENDCOLR] = ((a << 24) |
- (r << 16) |
- (g << 8) |
- b);
-}
-
-/**
- * Calculate the hardware blend factor setting. This same function is used
- * for source and destination of both alpha and RGB.
- *
- * \returns
- * The hardware register value for the specified blend factor. This value
- * will need to be shifted into the correct position for either source or
- * destination factor.
- *
- * \todo
- * Since the two cases where source and destination are handled differently
- * are essentially error cases, they should never happen. Determine if these
- * cases can be removed.
- */
-static int blend_factor( GLenum factor, GLboolean is_src )
-{
- int func;
-
- switch( factor ) {
- case GL_ZERO:
- func = BLENDFACT_ZERO;
- break;
- case GL_ONE:
- func = BLENDFACT_ONE;
- break;
- case GL_SRC_COLOR:
- func = BLENDFACT_SRC_COLR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- func = BLENDFACT_INV_SRC_COLR;
- break;
- case GL_SRC_ALPHA:
- func = BLENDFACT_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- func = BLENDFACT_INV_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- func = BLENDFACT_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- func = BLENDFACT_INV_DST_ALPHA;
- break;
- case GL_DST_COLOR:
- func = BLENDFACT_DST_COLR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- func = BLENDFACT_INV_DST_COLR;
- break;
- case GL_SRC_ALPHA_SATURATE:
- func = (is_src) ? BLENDFACT_SRC_ALPHA_SATURATE : BLENDFACT_ZERO;
- break;
- case GL_CONSTANT_COLOR:
- func = BLENDFACT_CONST_COLOR;
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- func = BLENDFACT_INV_CONST_COLOR;
- break;
- case GL_CONSTANT_ALPHA:
- func = BLENDFACT_CONST_ALPHA;
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- func = BLENDFACT_INV_CONST_ALPHA;
- break;
- default:
- func = (is_src) ? BLENDFACT_ONE : BLENDFACT_ZERO;
- }
-
- return func;
-}
-
-
-/**
- * Sets both the blend equation (called "function" in i830 docs) and the
- * blend function (called "factor" in i830 docs). This is done in a single
- * function because some blend equations (i.e., \c GL_MIN and \c GL_MAX)
- * change the interpretation of the blend function.
- */
-
-static void i830_set_blend_state( GLcontext * ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int funcA;
- int funcRGB;
- int eqnA;
- int eqnRGB;
-
-
- funcRGB = SRC_BLND_FACT( blend_factor( ctx->Color.BlendSrcRGB, GL_TRUE ) )
- | DST_BLND_FACT( blend_factor( ctx->Color.BlendDstRGB, GL_FALSE ) );
-
- switch(ctx->Color.BlendEquationRGB) {
- case GL_FUNC_ADD:
- eqnRGB = BLENDFUNC_ADD;
- break;
- case GL_MIN:
- eqnRGB = BLENDFUNC_MIN;
- funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_MAX:
- eqnRGB = BLENDFUNC_MAX;
- funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_FUNC_SUBTRACT:
- eqnRGB = BLENDFUNC_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- eqnRGB = BLENDFUNC_RVRSE_SUB;
- break;
- default:
- fprintf( stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n",
- __func__, __LINE__, ctx->Color.BlendEquationRGB );
- return;
- }
-
-
- funcA = SRC_ABLEND_FACT( blend_factor( ctx->Color.BlendSrcA, GL_TRUE ) )
- | DST_ABLEND_FACT( blend_factor( ctx->Color.BlendDstA, GL_FALSE ) );
-
- switch(ctx->Color.BlendEquationA) {
- case GL_FUNC_ADD:
- eqnA = BLENDFUNC_ADD;
- break;
- case GL_MIN:
- eqnA = BLENDFUNC_MIN;
- funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_MAX:
- eqnA = BLENDFUNC_MAX;
- funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_FUNC_SUBTRACT:
- eqnA = BLENDFUNC_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- eqnA = BLENDFUNC_RVRSE_SUB;
- break;
- default:
- fprintf( stderr, "[%s:%u] Invalid alpha blend equation (0x%04x).\n",
- __func__, __LINE__, ctx->Color.BlendEquationA );
- return;
- }
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
-
- imesa->Setup[I830_CTXREG_STATE1] = eqnRGB | funcRGB
- | STATE3D_MODES_1_CMD
- | ENABLE_SRC_BLND_FACTOR | ENABLE_DST_BLND_FACTOR
- | ENABLE_COLR_BLND_FUNC;
-
- imesa->Setup[I830_CTXREG_IALPHAB] = eqnA | funcA
- | STATE3D_INDPT_ALPHA_BLEND_CMD
- | ENABLE_SRC_ABLEND_FACTOR | ENABLE_DST_ABLEND_FACTOR
- | ENABLE_ALPHA_BLENDFUNC;
-
-
- /* This will catch a logicop blend equation. It will also ensure
- * independant alpha blend is really in the correct state (either enabled
- * or disabled) if blending is already enabled.
- */
-
- i830EvalLogicOpBlendState(ctx);
-
- if (0) {
- fprintf(stderr, "[%s:%u] STATE1: 0x%08x IALPHAB: 0x%08x blend is %sabled\n",
- __func__, __LINE__,
- imesa->Setup[I830_CTXREG_STATE1],
- imesa->Setup[I830_CTXREG_IALPHAB],
- (ctx->Color.BlendEnabled) ? "en" : "dis");
- }
-}
-
-static void i830BlendEquationSeparate(GLcontext *ctx,
- GLenum modeRGB, GLenum modeA)
-{
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s -> %s, %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(modeRGB),
- _mesa_lookup_enum_by_nr(modeA));
-
- (void) modeRGB;
- (void) modeA;
- i830_set_blend_state( ctx );
-}
-
-
-
-static void i830BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s -> RGB(%s, %s) A(%s, %s)\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(sfactorRGB),
- _mesa_lookup_enum_by_nr(dfactorRGB),
- _mesa_lookup_enum_by_nr(sfactorA),
- _mesa_lookup_enum_by_nr(dfactorA));
-
- (void) sfactorRGB;
- (void) dfactorRGB;
- (void) sfactorA;
- (void) dfactorA;
- i830_set_blend_state( ctx );
-}
-
-static void i830DepthFunc(GLcontext *ctx, GLenum func)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int test = 0;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch(func) {
- case GL_NEVER:
- test = COMPAREFUNC_NEVER;
- break;
- case GL_LESS:
- test = COMPAREFUNC_LESS;
- break;
- case GL_LEQUAL:
- test = COMPAREFUNC_LEQUAL;
- break;
- case GL_GREATER:
- test = COMPAREFUNC_GREATER;
- break;
- case GL_GEQUAL:
- test = COMPAREFUNC_GEQUAL;
- break;
- case GL_NOTEQUAL:
- test = COMPAREFUNC_NOTEQUAL;
- break;
- case GL_EQUAL:
- test = COMPAREFUNC_EQUAL;
- break;
- case GL_ALWAYS:
- test = COMPAREFUNC_ALWAYS;
- break;
- default: return;
- }
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK;
- imesa->Setup[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC |
- DEPTH_TEST_FUNC(test));
-}
-
-static void i830DepthMask(GLcontext *ctx, GLboolean flag)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s flag (%d)\n", __FUNCTION__, flag);
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
-
- imesa->Setup[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
-
- if (flag && ctx->Depth.Test)
- imesa->Setup[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE;
- else
- imesa->Setup[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE;
-}
-
-/* =============================================================
- * Polygon stipple
- *
- * The i830 supports a 4x4 stipple natively, GL wants 32x32.
- * Fortunately stipple is usually a repeating pattern.
- */
-static void i830PolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- const GLubyte *m = mask;
- GLubyte p[4];
- int i,j,k;
- int active = (ctx->Polygon.StippleFlag &&
- imesa->reduced_primitive == GL_TRIANGLES);
- GLuint newMask;
-
- if (active) {
- I830_STATECHANGE(imesa, I830_UPLOAD_STIPPLE);
- imesa->StippleSetup[I830_STPREG_ST1] &= ~ST1_ENABLE;
- }
-
- p[0] = mask[12] & 0xf; p[0] |= p[0] << 4;
- p[1] = mask[8] & 0xf; p[1] |= p[1] << 4;
- p[2] = mask[4] & 0xf; p[2] |= p[2] << 4;
- p[3] = mask[0] & 0xf; p[3] |= p[3] << 4;
-
- for (k = 0 ; k < 8 ; k++)
- for (j = 3 ; j >= 0; j--)
- for (i = 0 ; i < 4 ; i++, m++)
- if (*m != p[j]) {
- imesa->hw_stipple = 0;
- return;
- }
-
- newMask = (((p[0] & 0xf) << 0) |
- ((p[1] & 0xf) << 4) |
- ((p[2] & 0xf) << 8) |
- ((p[3] & 0xf) << 12));
-
-
- if (newMask == 0xffff || newMask == 0x0) {
- /* this is needed to make conform pass */
- imesa->hw_stipple = 0;
- return;
- }
-
- imesa->StippleSetup[I830_STPREG_ST1] &= ~0xffff;
- imesa->StippleSetup[I830_STPREG_ST1] |= newMask;
- imesa->hw_stipple = 1;
-
- if (active)
- imesa->StippleSetup[I830_STPREG_ST1] |= ST1_ENABLE;
-}
-
-static void i830PolygonStippleFallback( GLcontext *ctx, const GLubyte *mask )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- imesa->hw_stipple = 0;
- (void) i830PolygonStipple;
-}
-
-/* =============================================================
- * Hardware clipping
- */
-static void i830Scissor(GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int x1 = x;
- int y1 = imesa->driDrawable->h - (y + h);
- int x2 = x + w - 1;
- int y2 = y1 + h - 1;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "[%s] x(%d) y(%d) w(%d) h(%d)\n", __FUNCTION__,
- x, y, w, h);
-
- if (x1 < 0) x1 = 0;
- if (y1 < 0) y1 = 0;
- if (x2 < 0) x2 = 0;
- if (y2 < 0) y2 = 0;
-
- if (x2 >= imesa->i830Screen->width) x2 = imesa->i830Screen->width-1;
- if (y2 >= imesa->i830Screen->height) y2 = imesa->i830Screen->height-1;
- if (x1 >= imesa->i830Screen->width) x1 = imesa->i830Screen->width-1;
- if (y1 >= imesa->i830Screen->height) y1 = imesa->i830Screen->height-1;
-
-
- I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
- imesa->BufferSetup[I830_DESTREG_SR1] = (y1 << 16) | (x1 & 0xffff);
- imesa->BufferSetup[I830_DESTREG_SR2] = (y2 << 16) | (x2 & 0xffff);
-}
-
-static void i830LogicOp(GLcontext *ctx, GLenum opcode)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int tmp = 0;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* FIXME: This should be a look-up table, like the r200 driver. */
- switch(opcode) {
- case GL_CLEAR:
- tmp = LOGICOP_CLEAR;
- break;
- case GL_AND:
- tmp = LOGICOP_AND;
- break;
- case GL_AND_REVERSE:
- tmp = LOGICOP_AND_RVRSE;
- break;
- case GL_COPY:
- tmp = LOGICOP_COPY;
- break;
- case GL_COPY_INVERTED:
- tmp = LOGICOP_COPY_INV;
- break;
- case GL_AND_INVERTED:
- tmp = LOGICOP_AND_INV;
- break;
- case GL_NOOP:
- tmp = LOGICOP_NOOP;
- break;
- case GL_XOR:
- tmp = LOGICOP_XOR;
- break;
- case GL_OR:
- tmp = LOGICOP_OR;
- break;
- case GL_OR_INVERTED:
- tmp = LOGICOP_OR_INV;
- break;
- case GL_NOR:
- tmp = LOGICOP_NOR;
- break;
- case GL_EQUIV:
- tmp = LOGICOP_EQUIV;
- break;
- case GL_INVERT:
- tmp = LOGICOP_INV;
- break;
- case GL_OR_REVERSE:
- tmp = LOGICOP_OR_RVRSE;
- break;
- case GL_NAND:
- tmp = LOGICOP_NAND;
- break;
- case GL_SET:
- tmp = LOGICOP_SET;
- break;
- default:
- return;
- }
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE4] &= ~LOGICOP_MASK;
- imesa->Setup[I830_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp);
-
- /* Make sure all the enables are correct */
- i830EvalLogicOpBlendState(ctx);
-}
-
-/* Fallback to swrast for select and feedback.
- */
-static void i830RenderMode( GLcontext *ctx, GLenum mode )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- FALLBACK( imesa, I830_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
-}
-
-static void i830DrawBuffer(GLcontext *ctx, GLenum mode )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- /*
- * _ColorDrawBufferMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- I830_FIREVERTICES(imesa);
- I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
- imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset;
- i830XMesaSetFrontClipRects( imesa );
- FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case BUFFER_BIT_BACK_LEFT:
- I830_FIREVERTICES(imesa);
- I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
- imesa->BufferSetup[I830_DESTREG_CBUFADDR] =
- imesa->i830Screen->backOffset;
- i830XMesaSetBackClipRects( imesa );
- FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that i830SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-}
-
-static void i830ReadBuffer(GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-static void i830ClearColor(GLcontext *ctx, const GLfloat color[4])
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- CLAMPED_FLOAT_TO_UBYTE(imesa->clear_red, color[0]);
- CLAMPED_FLOAT_TO_UBYTE(imesa->clear_green, color[1]);
- CLAMPED_FLOAT_TO_UBYTE(imesa->clear_blue, color[2]);
- CLAMPED_FLOAT_TO_UBYTE(imesa->clear_alpha, color[3]);
-
- imesa->ClearColor = i830PackColor(imesa->i830Screen->fbFormat,
- imesa->clear_red,
- imesa->clear_green,
- imesa->clear_blue,
- imesa->clear_alpha);
-}
-
-static void i830CullFaceFrontFace(GLcontext *ctx, GLenum unused)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLuint mode = CULLMODE_BOTH;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
- mode = CULLMODE_CW;
-
- if (ctx->Polygon.CullFaceMode == GL_FRONT)
- mode ^= (CULLMODE_CW ^ CULLMODE_CCW);
- if (ctx->Polygon.FrontFace != GL_CCW)
- mode ^= (CULLMODE_CW ^ CULLMODE_CCW);
- }
-
- imesa->LcsCullMode = mode;
-
- if (ctx->Polygon.CullFlag) {
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE3] &= ~CULLMODE_MASK;
- imesa->Setup[I830_CTXREG_STATE3] |= ENABLE_CULL_MODE | mode;
- }
-}
-
-static void i830LineWidth( GLcontext *ctx, GLfloat widthf )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- int width;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- width = FloatToInt(widthf * 2);
- CLAMP_SELF(width, 1, 15);
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE5] &= ~FIXED_LINE_WIDTH_MASK;
- imesa->Setup[I830_CTXREG_STATE5] |= (ENABLE_FIXED_LINE_WIDTH |
- FIXED_LINE_WIDTH(width));
-}
-
-static void i830PointSize(GLcontext *ctx, GLfloat size)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLint point_size = FloatToInt(size);
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- CLAMP_SELF(point_size, 1, 256);
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE5] &= ~FIXED_POINT_WIDTH_MASK;
- imesa->Setup[I830_CTXREG_STATE5] |= (ENABLE_FIXED_POINT_WIDTH |
- FIXED_POINT_WIDTH(point_size));
-}
-
-
-/* =============================================================
- * Color masks
- */
-
-static void i830ColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- GLuint tmp = 0;
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s r(%d) g(%d) b(%d) a(%d)\n", __FUNCTION__, r, g, b, a);
-
- imesa->mask_red = !r;
- imesa->mask_green = !g;
- imesa->mask_blue = !b;
- imesa->mask_alpha = !a;
-
- tmp = (imesa->Setup[I830_CTXREG_ENABLES_2] & ~WRITEMASK_MASK) |
- ENABLE_COLOR_MASK |
- ENABLE_COLOR_WRITE |
- ((!r) << WRITEMASK_RED_SHIFT) |
- ((!g) << WRITEMASK_GREEN_SHIFT) |
- ((!b) << WRITEMASK_BLUE_SHIFT) |
- ((!a) << WRITEMASK_ALPHA_SHIFT);
-
- if (tmp != imesa->Setup[I830_CTXREG_ENABLES_2]) {
- I830_FIREVERTICES(imesa);
- imesa->dirty |= I830_UPLOAD_CTX;
- imesa->Setup[I830_CTXREG_ENABLES_2] = tmp;
- }
-}
-
-static void update_specular( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK;
-
- if (NEED_SECONDARY_COLOR(ctx))
- imesa->Setup[I830_CTXREG_ENABLES_1] |= ENABLE_SPEC_ADD;
- else
- imesa->Setup[I830_CTXREG_ENABLES_1] |= DISABLE_SPEC_ADD;
-}
-
-static void i830LightModelfv(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) {
- update_specular( ctx );
- }
-}
-
-/* In Mesa 3.5 we can reliably do native flatshading.
- */
-static void i830ShadeModel(GLcontext *ctx, GLenum mode)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
-
-
-#define SHADE_MODE_MASK ((1<<10)|(1<<8)|(1<<6)|(1<<4))
-
- imesa->Setup[I830_CTXREG_STATE3] &= ~SHADE_MODE_MASK;
-
- if (mode == GL_FLAT) {
- imesa->Setup[I830_CTXREG_STATE3] |= (ALPHA_SHADE_MODE(SHADE_MODE_FLAT) |
- FOG_SHADE_MODE(SHADE_MODE_FLAT) |
- SPEC_SHADE_MODE(SHADE_MODE_FLAT) |
- COLOR_SHADE_MODE(SHADE_MODE_FLAT));
- } else {
- imesa->Setup[I830_CTXREG_STATE3] |= (ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) |
- FOG_SHADE_MODE(SHADE_MODE_LINEAR) |
- SPEC_SHADE_MODE(SHADE_MODE_LINEAR) |
- COLOR_SHADE_MODE(SHADE_MODE_LINEAR));
- }
-}
-
-/* =============================================================
- * Fog
- */
-static void i830Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (pname == GL_FOG_COLOR) {
- GLuint color = (((GLubyte)(ctx->Fog.Color[0]*255.0F) << 16) |
- ((GLubyte)(ctx->Fog.Color[1]*255.0F) << 8) |
- ((GLubyte)(ctx->Fog.Color[2]*255.0F) << 0));
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_FOGCOLOR] = (STATE3D_FOG_COLOR_CMD | color);
- }
-}
-
-/* =============================================================
- */
-
-static void i830Enable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- switch(cap) {
- case GL_LIGHTING:
- case GL_COLOR_SUM_EXT:
- update_specular( ctx );
- break;
-
- case GL_ALPHA_TEST:
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_ALPHA_TEST_MASK;
- if (state)
- imesa->Setup[I830_CTXREG_ENABLES_1] |= ENABLE_ALPHA_TEST;
- else
- imesa->Setup[I830_CTXREG_ENABLES_1] |= DISABLE_ALPHA_TEST;
-
- break;
-
- case GL_BLEND:
- case GL_COLOR_LOGIC_OP:
- case GL_INDEX_LOGIC_OP:
- i830EvalLogicOpBlendState(ctx);
- break;
-
- case GL_DITHER:
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_ENABLES_2] &= ~ENABLE_DITHER;
-
- if (state)
- imesa->Setup[I830_CTXREG_ENABLES_2] |= ENABLE_DITHER;
- else
- imesa->Setup[I830_CTXREG_ENABLES_2] |= DISABLE_DITHER;
- break;
-
- case GL_DEPTH_TEST:
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
-
- if (state)
- imesa->Setup[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST;
- else
- imesa->Setup[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST;
-
- /* Also turn off depth writes when GL_DEPTH_TEST is disabled:
- */
- i830DepthMask( ctx, state );
- break;
-
- case GL_SCISSOR_TEST:
- I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
-
- if (state)
- imesa->BufferSetup[I830_DESTREG_SENABLE] =
- (STATE3D_SCISSOR_ENABLE_CMD |
- ENABLE_SCISSOR_RECT);
- else
- imesa->BufferSetup[I830_DESTREG_SENABLE] =
- (STATE3D_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
-
- imesa->upload_cliprects = GL_TRUE;
- break;
-
- case GL_LINE_SMOOTH:
- if (imesa->reduced_primitive == GL_LINES) {
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
-
- imesa->Setup[I830_CTXREG_AA] &= ~AA_LINE_ENABLE;
- if (state)
- imesa->Setup[I830_CTXREG_AA] |= AA_LINE_ENABLE;
- else
- imesa->Setup[I830_CTXREG_AA] |= AA_LINE_DISABLE;
- }
- break;
-
- case GL_FOG:
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_FOG_MASK;
- if (state)
- imesa->Setup[I830_CTXREG_ENABLES_1] |= I830_ENABLE_FOG;
- else
- imesa->Setup[I830_CTXREG_ENABLES_1] |= I830_DISABLE_FOG;
- break;
-
- case GL_CULL_FACE:
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_STATE3] &= ~CULLMODE_MASK;
- if (state)
- imesa->Setup[I830_CTXREG_STATE3] |= (ENABLE_CULL_MODE |
- imesa->LcsCullMode);
- else
- imesa->Setup[I830_CTXREG_STATE3] |= (ENABLE_CULL_MODE |
- CULLMODE_NONE);
- break;
-
- case GL_TEXTURE_2D:
-/* I830_STATECHANGE(imesa, I830_UPLOAD_CTX); */
-/* imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK; */
- break;
-
- case GL_STENCIL_TEST:
- if (imesa->hw_stencil) {
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST;
- imesa->Setup[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE;
-
- if (state) {
- imesa->Setup[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST;
- imesa->Setup[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE;
- } else {
- imesa->Setup[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST;
- imesa->Setup[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE;
- }
- } else {
- FALLBACK( imesa, I830_FALLBACK_STENCIL, state );
- }
- break;
-
- case GL_POLYGON_STIPPLE:
-#if 0
- /* The stipple command worked on my 855GM box, but not my 845G.
- * I'll do more testing later to find out exactly which hardware
- * supports it. Disabled for now.
- */
- if (imesa->hw_stipple && imesa->reduced_primitive == GL_TRIANGLES)
- {
- I830_STATECHANGE(imesa, I830_UPLOAD_STIPPLE);
- imesa->StippleSetup[I830_STPREG_ST1] &= ~ST1_ENABLE;
- if (state)
- imesa->StippleSetup[I830_STPREG_ST1] |= ST1_ENABLE;
- }
-#endif
- break;
-
- default:
- ;
- }
-}
-
-
-void i830EmitDrawingRectangle( i830ContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- i830ScreenPrivate *i830Screen = imesa->i830Screen;
- int x0 = imesa->drawX;
- int y0 = imesa->drawY;
- int x1 = x0 + dPriv->w;
- int y1 = y0 + dPriv->h;
-
- /* Don't set drawing rectangle */
- if (I830_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s x0(%d) x1(%d) y0(%d) y1(%d)\n", __FUNCTION__,
- x0, x1, y0, y1);
-
- /* Coordinate origin of the window - may be offscreen.
- */
- imesa->BufferSetup[I830_DESTREG_DR4] = ((y0<<16) |
- (((unsigned)x0)&0xFFFF));
-
- /* Clip to screen.
- */
- if (x0 < 0) x0 = 0;
- if (y0 < 0) y0 = 0;
- if (x1 > i830Screen->width-1) x1 = i830Screen->width-1;
- if (y1 > i830Screen->height-1) y1 = i830Screen->height-1;
-
-
- /* Onscreen drawing rectangle.
- */
- imesa->BufferSetup[I830_DESTREG_DR2] = ((y0<<16) | x0);
- imesa->BufferSetup[I830_DESTREG_DR3] = (((y1+1)<<16) | (x1+1));
-
-
- /* Just add in our dirty flag, since we might be called when locked */
- /* Might want to modify how this is done. */
- imesa->dirty |= I830_UPLOAD_BUFFERS;
-
- if (0)
- fprintf(stderr, "[%s] DR2(0x%08x) DR3(0x%08x) DR4(0x%08x)\n",
- __FUNCTION__,
- imesa->BufferSetup[I830_DESTREG_DR2],
- imesa->BufferSetup[I830_DESTREG_DR3],
- imesa->BufferSetup[I830_DESTREG_DR4]);
-}
-
-/* This could be done in hardware, will do once I have the driver
- * up and running.
- */
-static void i830CalcViewport( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = imesa->ViewportMatrix.m;
-
- /* See also i830_translate_vertex. SUBPIXEL adjustments can be done
- * via state vars, too.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + imesa->driDrawable->h + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * imesa->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * imesa->depth_scale;
-}
-
-static void i830Viewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- i830CalcViewport( ctx );
-}
-
-static void i830DepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- i830CalcViewport( ctx );
-}
-
-void i830PrintDirty( const char *msg, GLuint state )
-{
- fprintf(stderr, "%s (0x%x): %s%s%s%s%s%s%s%s%s%s%s\n",
- msg,
- (unsigned int) state,
- (state & I830_UPLOAD_TEX0) ? "upload-tex0, " : "",
- (state & I830_UPLOAD_TEX1) ? "upload-tex1, " : "",
- (state & I830_UPLOAD_TEX2) ? "upload-tex2, " : "",
- (state & I830_UPLOAD_TEX3) ? "upload-tex3, " : "",
- (state & I830_UPLOAD_CTX) ? "upload-ctx, " : "",
- (state & I830_UPLOAD_BUFFERS) ? "upload-bufs, " : "",
- (state & I830_UPLOAD_TEXBLEND0) ? "upload-blend0, " : "",
- (state & I830_UPLOAD_TEXBLEND1) ? "upload-blend1, " : "",
- (state & I830_UPLOAD_TEXBLEND2) ? "upload-blend2, " : "",
- (state & I830_UPLOAD_TEXBLEND3) ? "upload-blend3, " : "",
- (state & I830_UPLOAD_STIPPLE) ? "stipple, " : ""
- );
-}
-
-/* Push the state into the sarea and/or texture memory.
- */
-void i830EmitHwStateLocked( i830ContextPtr imesa )
-{
- int i;
-
- if (I830_DEBUG & DEBUG_STATE)
- i830PrintDirty( __FUNCTION__, imesa->dirty );
-
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if ( ((imesa->dirty & I830_UPLOAD_TEX_N_IMAGE( i )) != 0)
- && (imesa->CurrentTexObj[i] != NULL) ) {
- i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[i]);
- }
- }
-
- if (imesa->dirty & I830_UPLOAD_CTX) {
- memcpy( imesa->sarea->ContextState,
- imesa->Setup, sizeof(imesa->Setup) );
- }
-
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if ((imesa->dirty & I830_UPLOAD_TEX_N(i)) && imesa->CurrentTexObj[i]) {
- unsigned * TexState;
-
- imesa->sarea->dirty |= I830_UPLOAD_TEX_N(i);
-
- switch( i ) {
- case 0:
- case 1:
- TexState = imesa->sarea->TexState[i];
- break;
-
- case 2:
- TexState = imesa->sarea->TexState2;
- break;
-
- case 3:
- TexState = imesa->sarea->TexState3;
- break;
- }
-
- memcpy(TexState, imesa->CurrentTexObj[i]->Setup,
- sizeof(imesa->sarea->TexState[i]));
-
- TexState[I830_TEXREG_TM0S3] &= ~TM0S3_LOD_BIAS_MASK;
- TexState[I830_TEXREG_TM0S3] |= imesa->LodBias[i];
-
- /* Update the LRU usage */
- if (imesa->CurrentTexObj[i]->base.memBlock)
- driUpdateTextureLRU( (driTextureObject *)
- imesa->CurrentTexObj[i] );
- }
- }
- /* Need to figure out if texturing state, or enable changed. */
-
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if (imesa->dirty & I830_UPLOAD_TEXBLEND_N(i)) {
- unsigned * TexBlendState;
- unsigned * words_used;
-
- imesa->sarea->dirty |= I830_UPLOAD_TEXBLEND_N(i);
-
- switch( i ) {
- case 0:
- case 1:
- TexBlendState = imesa->sarea->TexBlendState[i];
- words_used = & imesa->sarea->TexBlendStateWordsUsed[i];
- break;
-
- case 2:
- TexBlendState = imesa->sarea->TexBlendState2;
- words_used = & imesa->sarea->TexBlendStateWordsUsed2;
- break;
-
- case 3:
- TexBlendState = imesa->sarea->TexBlendState3;
- words_used = & imesa->sarea->TexBlendStateWordsUsed3;
- break;
- }
-
- memcpy(TexBlendState, imesa->TexBlend[i],
- imesa->TexBlendWordsUsed[i] * 4);
- *words_used = imesa->TexBlendWordsUsed[i];
- }
- }
-
- if (imesa->dirty & I830_UPLOAD_BUFFERS) {
- memcpy( imesa->sarea->BufferState,imesa->BufferSetup,
- sizeof(imesa->BufferSetup) );
- }
-
- if (imesa->dirty & I830_UPLOAD_STIPPLE) {
- memcpy( imesa->sarea->StippleState,imesa->StippleSetup,
- sizeof(imesa->StippleSetup) );
- }
-
- if (imesa->dirty & I830_UPLOAD_TEX_PALETTE_SHARED) {
- memcpy( imesa->sarea->Palette[0],imesa->palette,
- sizeof(imesa->sarea->Palette[0]));
- } else {
- i830TextureObjectPtr p;
- if (imesa->dirty & I830_UPLOAD_TEX_PALETTE_N(0)) {
- p = imesa->CurrentTexObj[0];
- memcpy( imesa->sarea->Palette[0],p->palette,
- sizeof(imesa->sarea->Palette[0]));
- }
- if (imesa->dirty & I830_UPLOAD_TEX_PALETTE_N(1)) {
- p = imesa->CurrentTexObj[1];
- memcpy( imesa->sarea->Palette[1],
- p->palette,
- sizeof(imesa->sarea->Palette[1]));
- }
- }
-
- imesa->sarea->dirty |= (imesa->dirty & ~(I830_UPLOAD_TEX_MASK |
- I830_UPLOAD_TEXBLEND_MASK));
-
- imesa->upload_cliprects = GL_TRUE;
- imesa->dirty = 0;
-}
-
-
-void i830DDInitState( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- i830ScreenPrivate *i830Screen = imesa->i830Screen;
- int i;
-
- imesa->clear_red = 0;
- imesa->clear_green = 0;
- imesa->clear_blue = 0;
- imesa->clear_alpha = 0;
-
- imesa->mask_red = GL_FALSE;
- imesa->mask_green = GL_FALSE;
- imesa->mask_blue = GL_FALSE;
- imesa->mask_alpha = GL_FALSE;
-
- /* Zero all texture state */
- for (i = 0; i < I830_MAX_TEXTURE_UNITS; i++) {
- (void) memset( imesa->TexBlend[i], 0, sizeof( imesa->TexBlend[i] ) );
- (void) memset( imesa->Init_TexBlend[i], 0, sizeof( imesa->Init_TexBlend[i] ) );
-
- imesa->TexBlendWordsUsed[i] = 0;
- imesa->Init_TexBlendWordsUsed[i] = 0;
- }
-
- /* Set default blend state */
- imesa->TexBlend[0][0] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXOP_LAST_STAGE |
- TEXBLENDOP_ARG1);
- imesa->TexBlend[0][1] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- imesa->TexBlend[0][2] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_DIFFUSE);
- imesa->TexBlend[0][3] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_DIFFUSE);
-
- imesa->TexBlendWordsUsed[0] = 4;
-
- imesa->Init_TexBlend[0][0] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXOP_LAST_STAGE |
- TEXBLENDOP_ARG1);
- imesa->Init_TexBlend[0][1] = (STATE3D_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- imesa->Init_TexBlend[0][2] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- imesa->Init_TexBlend[0][3] = (STATE3D_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- imesa->Init_TexBlendWordsUsed[0] = 4;
-
- memset(imesa->Setup, 0, sizeof(imesa->Setup));
-
- imesa->Setup[I830_CTXREG_VF] = 0;
- imesa->Setup[I830_CTXREG_VF2] = 0;
-
- imesa->Setup[I830_CTXREG_AA] = (STATE3D_AA_CMD |
- AA_LINE_ECAAR_WIDTH_ENABLE |
- AA_LINE_ECAAR_WIDTH_1_0 |
- AA_LINE_REGION_WIDTH_ENABLE |
- AA_LINE_REGION_WIDTH_1_0 |
- AA_LINE_DISABLE);
-
- imesa->Setup[I830_CTXREG_ENABLES_1] = (STATE3D_ENABLES_1_CMD |
- DISABLE_LOGIC_OP |
- DISABLE_STENCIL_TEST |
- DISABLE_DEPTH_BIAS |
- DISABLE_SPEC_ADD |
- I830_DISABLE_FOG |
- DISABLE_ALPHA_TEST |
- DISABLE_COLOR_BLEND |
- DISABLE_DEPTH_TEST);
-
- if (imesa->hw_stencil) {
- imesa->Setup[I830_CTXREG_ENABLES_2] = (STATE3D_ENABLES_2_CMD |
- ENABLE_STENCIL_WRITE |
- ENABLE_TEX_CACHE |
- ENABLE_DITHER |
- ENABLE_COLOR_MASK |
- /* set no color comps disabled */
- ENABLE_COLOR_WRITE |
- ENABLE_DEPTH_WRITE);
- } else {
- imesa->Setup[I830_CTXREG_ENABLES_2] = (STATE3D_ENABLES_2_CMD |
- DISABLE_STENCIL_WRITE |
- ENABLE_TEX_CACHE |
- ENABLE_DITHER |
- ENABLE_COLOR_MASK |
- /* set no color comps disabled */
- ENABLE_COLOR_WRITE |
- ENABLE_DEPTH_WRITE);
- }
-
- imesa->Setup[I830_CTXREG_STATE1] = (STATE3D_MODES_1_CMD |
- ENABLE_COLR_BLND_FUNC |
- BLENDFUNC_ADD |
- ENABLE_SRC_BLND_FACTOR |
- SRC_BLND_FACT(BLENDFACT_ONE) |
- ENABLE_DST_BLND_FACTOR |
- DST_BLND_FACT(BLENDFACT_ZERO) );
-
- imesa->Setup[I830_CTXREG_STATE2] = (STATE3D_MODES_2_CMD |
- ENABLE_GLOBAL_DEPTH_BIAS |
- GLOBAL_DEPTH_BIAS(0) |
- ENABLE_ALPHA_TEST_FUNC |
- ALPHA_TEST_FUNC(COMPAREFUNC_ALWAYS) |
- ALPHA_REF_VALUE(0) );
-
- imesa->Setup[I830_CTXREG_STATE3] = (STATE3D_MODES_3_CMD |
- ENABLE_DEPTH_TEST_FUNC |
- DEPTH_TEST_FUNC(COMPAREFUNC_LESS) |
- ENABLE_ALPHA_SHADE_MODE |
- ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_FOG_SHADE_MODE |
- FOG_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_SPEC_SHADE_MODE |
- SPEC_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_COLOR_SHADE_MODE |
- COLOR_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_CULL_MODE |
- CULLMODE_NONE);
-
- imesa->Setup[I830_CTXREG_STATE4] = (STATE3D_MODES_4_CMD |
- ENABLE_LOGIC_OP_FUNC |
- LOGIC_OP_FUNC(LOGICOP_COPY) |
- ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(0xff) |
- ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(0xff));
-
- imesa->Setup[I830_CTXREG_STENCILTST] = (STATE3D_STENCIL_TEST_CMD |
- ENABLE_STENCIL_PARMS |
- STENCIL_FAIL_OP(STENCILOP_KEEP) |
- STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_KEEP) |
- STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_KEEP) |
- ENABLE_STENCIL_TEST_FUNC |
- STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS) |
- ENABLE_STENCIL_REF_VALUE |
- STENCIL_REF_VALUE(0) );
-
- imesa->Setup[I830_CTXREG_STATE5] = (STATE3D_MODES_5_CMD |
- FLUSH_TEXTURE_CACHE |
- ENABLE_SPRITE_POINT_TEX |
- SPRITE_POINT_TEX_OFF |
- ENABLE_FIXED_LINE_WIDTH |
- FIXED_LINE_WIDTH(0x2) | /* 1.0 */
- ENABLE_FIXED_POINT_WIDTH |
- FIXED_POINT_WIDTH(1) );
-
- imesa->Setup[I830_CTXREG_IALPHAB] = (STATE3D_INDPT_ALPHA_BLEND_CMD |
- DISABLE_INDPT_ALPHA_BLEND |
- ENABLE_ALPHA_BLENDFUNC |
- ABLENDFUNC_ADD);
-
- imesa->Setup[I830_CTXREG_FOGCOLOR] = (STATE3D_FOG_COLOR_CMD |
- FOG_COLOR_RED(0) |
- FOG_COLOR_GREEN(0) |
- FOG_COLOR_BLUE(0));
-
- imesa->Setup[I830_CTXREG_BLENDCOLR0] = (STATE3D_CONST_BLEND_COLOR_CMD);
-
- imesa->Setup[I830_CTXREG_BLENDCOLR] = 0;
-
- imesa->Setup[I830_CTXREG_MCSB0] = STATE3D_MAP_COORD_SETBIND_CMD;
- imesa->Setup[I830_CTXREG_MCSB1] = (TEXBIND_SET3(TEXCOORDSRC_VTXSET_3) |
- TEXBIND_SET2(TEXCOORDSRC_VTXSET_2) |
- TEXBIND_SET1(TEXCOORDSRC_VTXSET_1) |
- TEXBIND_SET0(TEXCOORDSRC_VTXSET_0));
-
- imesa->LcsCullMode = CULLMODE_CW; /* GL default */
-
- memset(imesa->BufferSetup, 0, sizeof(imesa->BufferSetup));
- memset(imesa->StippleSetup, 0, sizeof(imesa->StippleSetup));
-
-
- if (imesa->glCtx->Visual.doubleBufferMode &&
- imesa->sarea->pf_current_page == 0) {
- imesa->drawMap = i830Screen->back.map;
- imesa->readMap = i830Screen->back.map;
- imesa->BufferSetup[I830_DESTREG_CBUFADDR] = i830Screen->backOffset;
- imesa->BufferSetup[I830_DESTREG_DBUFADDR] = 0;
- } else {
- /* use front buffer by default */
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
- imesa->BufferSetup[I830_DESTREG_CBUFADDR] = i830Screen->fbOffset;
- imesa->BufferSetup[I830_DESTREG_DBUFADDR] = 0;
- }
-
- imesa->BufferSetup[I830_DESTREG_DV0] = STATE3D_DST_BUF_VARS_CMD;
-
- switch (i830Screen->fbFormat) {
- case DV_PF_555:
- case DV_PF_565:
- imesa->BufferSetup[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- i830Screen->fbFormat |
- DEPTH_IS_Z |
- DEPTH_FRMT_16_FIXED);
- break;
- case DV_PF_8888:
- imesa->BufferSetup[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- i830Screen->fbFormat |
- DEPTH_IS_Z |
- DEPTH_FRMT_24_FIXED_8_OTHER);
- break;
- }
- imesa->BufferSetup[I830_DESTREG_SENABLE] = (STATE3D_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
- imesa->BufferSetup[I830_DESTREG_SR0] = STATE3D_SCISSOR_RECT_0_CMD;
- imesa->BufferSetup[I830_DESTREG_SR1] = 0;
- imesa->BufferSetup[I830_DESTREG_SR2] = 0;
-
- imesa->BufferSetup[I830_DESTREG_DR0] = STATE3D_DRAW_RECT_CMD;
- imesa->BufferSetup[I830_DESTREG_DR1] = 0;
- imesa->BufferSetup[I830_DESTREG_DR2] = 0;
- imesa->BufferSetup[I830_DESTREG_DR3] = (((i830Screen->height)<<16) |
- (i830Screen->width));
- imesa->BufferSetup[I830_DESTREG_DR4] = 0;
-
- memcpy( imesa->Init_Setup,
- imesa->Setup,
- sizeof(imesa->Setup) );
- memcpy( imesa->Init_BufferSetup,
- imesa->BufferSetup,
- sizeof(imesa->BufferSetup) );
-
-}
-
-static void i830InvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- I830_CONTEXT(ctx)->NewGLState |= new_state;
-}
-
-void i830DDInitStateFuncs(GLcontext *ctx)
-{
- /* Callbacks for internal Mesa events.
- */
- ctx->Driver.UpdateState = i830InvalidateState;
-
- /* API callbacks
- */
- ctx->Driver.AlphaFunc = i830AlphaFunc;
- ctx->Driver.BlendEquationSeparate = i830BlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = i830BlendFuncSeparate;
- ctx->Driver.BlendColor = i830BlendColor;
- ctx->Driver.ClearColor = i830ClearColor;
- ctx->Driver.ColorMask = i830ColorMask;
- ctx->Driver.CullFace = i830CullFaceFrontFace;
- ctx->Driver.DepthFunc = i830DepthFunc;
- ctx->Driver.DepthMask = i830DepthMask;
- ctx->Driver.Enable = i830Enable;
- ctx->Driver.Fogfv = i830Fogfv;
- ctx->Driver.FrontFace = i830CullFaceFrontFace;
- ctx->Driver.LineWidth = i830LineWidth;
- ctx->Driver.PointSize = i830PointSize;
- ctx->Driver.LogicOpcode = i830LogicOp;
- ctx->Driver.PolygonStipple = i830PolygonStippleFallback;
- ctx->Driver.RenderMode = i830RenderMode;
- ctx->Driver.Scissor = i830Scissor;
- ctx->Driver.DrawBuffer = i830DrawBuffer;
- ctx->Driver.ReadBuffer = i830ReadBuffer;
- ctx->Driver.ShadeModel = i830ShadeModel;
- ctx->Driver.DepthRange = i830DepthRange;
- ctx->Driver.Viewport = i830Viewport;
- ctx->Driver.LightModelfv = i830LightModelfv;
-
- ctx->Driver.StencilFunc = i830StencilFunc;
- ctx->Driver.StencilMask = i830StencilMask;
- ctx->Driver.StencilOp = i830StencilOp;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.h
deleted file mode 100644
index b65165124..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_state.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_state.h,v 1.3 2002/12/10 01:26:53 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-#ifndef _I830_STATE_H
-#define _I830_STATE_H
-
-#include "i830_context.h"
-#include "colormac.h"
-#define FloatToInt(F) ((int)(F))
-
-/*
- * * This function/macro is sensitive to precision. Test carefully
- * * if you change it.
- * */
-#define FLOAT_COLOR_TO_UBYTE_COLOR(b, f) \
- do { \
- union {GLfloat r; GLuint i; } tmp; \
- tmp.r = f; \
- b = ((tmp.i >= IEEE_ONE) \
- ? ((GLint)tmp.i < 0) ? (GLubyte)0 : (GLubyte)255 \
- : (tmp.r = tmp.r*(255.0F/256.0F) + 32768.0F, \
- (GLubyte)tmp.i)); \
- } while (0)
-
-
-
-extern void i830DDInitState( GLcontext *ctx );
-extern void i830DDInitStateFuncs( GLcontext *ctx );
-
-extern void i830PrintDirty( const char *msg, GLuint state );
-extern void i830SetDrawBuffer(GLcontext *ctx, GLenum mode );
-
-extern void i830Fallback( i830ContextPtr imesa, GLuint bit, GLboolean mode );
-#define FALLBACK( imesa, bit, mode ) i830Fallback( imesa, bit, mode )
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.c
deleted file mode 100644
index 41b5d9293..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.c
+++ /dev/null
@@ -1,700 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 2d3d Inc., Delray Beach, FL
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tex.c,v 1.5 2003/05/07 21:56:31 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keithw@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "texformat.h"
-#include "texmem.h"
-#include "texobj.h"
-#include "swrast/swrast.h"
-#include "texobj.h"
-#include "mm.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-#include "i830_context.h"
-#include "i830_tex.h"
-#include "i830_state.h"
-#include "i830_ioctl.h"
-
-/*
- * Compute the 'S2.4' lod bias factor from the floating point OpenGL bias.
- */
-static void i830ComputeLodBias( i830ContextPtr imesa, unsigned unit,
- GLfloat bias )
-{
- int b;
-
- b = (int) (bias * 16.0);
- if(b > 63) b = 63;
- else if (b < -64) b = -64;
- imesa->LodBias[ unit ] = ((b << TM0S3_LOD_BIAS_SHIFT) &
- TM0S3_LOD_BIAS_MASK);
-}
-
-
-/**
- * Set the texture wrap modes.
- *
- * The i830M (and related graphics cores) do not support GL_CLAMP. The Intel
- * drivers for "other operating systems" implement GL_CLAMP as
- * GL_CLAMP_TO_EDGE, so the same is done here.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-
-static void i830SetTexWrapping(i830TextureObjectPtr tex,
- GLenum swrap, GLenum twrap)
-{
- tex->Setup[I830_TEXREG_MCS] &= ~(TEXCOORD_ADDR_U_MASK|TEXCOORD_ADDR_V_MASK);
-
- switch( swrap ) {
- case GL_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP);
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP);
- break;
- case GL_CLAMP_TO_BORDER:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP_BORDER);
- break;
- case GL_MIRRORED_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_MIRROR);
- break;
- default:
- _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
- }
-
- switch( twrap ) {
- case GL_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP);
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP);
- break;
- case GL_CLAMP_TO_BORDER:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP_BORDER);
- break;
- case GL_MIRRORED_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_MIRROR);
- break;
- default:
- _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
- }
-}
-
-static void i830SetTexMaxAnisotropy( i830TextureObjectPtr t, GLfloat max )
-{
- t->max_anisotropy = max;
-}
-
-
-/**
- * Set the texture magnification and minification modes.
- *
- * \param t Texture whose filter modes are to be set
- * \param minf Texture minification mode
- * \param magf Texture magnification mode
- * \param bias LOD bias for this texture unit.
- */
-
-static void i830SetTexFilter( i830TextureObjectPtr t,
- GLenum minf, GLenum magf )
-{
- int minFilt = 0, mipFilt = 0, magFilt = 0;
-
- if(I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if ( t->max_anisotropy > 1.0 ) {
- minFilt = FILTER_ANISOTROPIC;
- magFilt = FILTER_ANISOTROPIC;
- }
- else {
- switch (minf) {
- case GL_NEAREST:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_NONE;
- break;
- case GL_LINEAR:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_LINEAR;
- break;
- default:
- _mesa_problem(NULL, "%s: Unsupported min. filter %d", __FUNCTION__,
- (int) minf );
- break;
- }
-
- switch (magf) {
- case GL_NEAREST:
- magFilt = FILTER_NEAREST;
- break;
- case GL_LINEAR:
- magFilt = FILTER_LINEAR;
- break;
- default:
- _mesa_problem(NULL, "%s: Unsupported mag. filter %d", __FUNCTION__,
- (int) magf );
- break;
- }
- }
-
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_FILTER_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIP_FILTER_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAG_FILTER_MASK;
- t->Setup[I830_TEXREG_TM0S3] |= ((minFilt << TM0S3_MIN_FILTER_SHIFT) |
- (mipFilt << TM0S3_MIP_FILTER_SHIFT) |
- (magFilt << TM0S3_MAG_FILTER_SHIFT));
-}
-
-static void i830SetTexBorderColor(i830TextureObjectPtr t, GLubyte color[4])
-{
- if(I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- t->Setup[I830_TEXREG_TM0S4] =
- I830PACKCOLOR8888(color[0],color[1],color[2],color[3]);
-}
-
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-static i830TextureObjectPtr i830AllocTexObj( struct gl_texture_object *texObj )
-{
- i830TextureObjectPtr t;
-
- t = CALLOC_STRUCT( i830_texture_object_t );
- texObj->DriverData = t;
- if ( t != NULL ) {
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
-
- t->Setup[I830_TEXREG_TM0LI] = STATE3D_LOAD_STATE_IMMEDIATE_2;
- t->Setup[I830_TEXREG_TM0S0] = TM0S0_USE_FENCE;
- t->Setup[I830_TEXREG_TM0S1] = 0;
- t->Setup[I830_TEXREG_TM0S2] = 0;
- t->Setup[I830_TEXREG_TM0S3] = 0;
-
- t->Setup[I830_TEXREG_NOP0] = 0;
- t->Setup[I830_TEXREG_NOP1] = 0;
- t->Setup[I830_TEXREG_NOP2] = 0;
-
- t->Setup[I830_TEXREG_MCS] = (STATE3D_MAP_COORD_SET_CMD |
- MAP_UNIT(0) |
- ENABLE_TEXCOORD_PARAMS |
- TEXCOORDS_ARE_NORMAL |
- TEXCOORDTYPE_CARTESIAN |
- ENABLE_ADDR_V_CNTL |
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) |
- ENABLE_ADDR_U_CNTL |
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP));
-
- make_empty_list( & t->base );
-
- i830SetTexWrapping( t, texObj->WrapS, texObj->WrapT );
- i830SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
- i830SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- i830SetTexBorderColor( t, texObj->_BorderChan );
- }
-
- return t;
-}
-
-
-static void i830TexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData;
- GLuint unit = ctx->Texture.CurrentUnit;
-
- if (!t)
- return;
-
- if ( target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_NV )
- return;
-
- /* Can't do the update now as we don't know whether to flush
- * vertices or not. Setting imesa->NewGLState means that
- * i830UpdateTextureState() will be called before any triangles are
- * rendered. If a statechange has occurred, it will be detected at
- * that point, and buffered vertices flushed.
- */
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- i830SetTexMaxAnisotropy( t, tObj->MaxAnisotropy );
- i830SetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- i830SetTexWrapping( t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- i830SetTexBorderColor( t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* The i830 and its successors can do a lot of this without
- * reloading the textures. A project for someone?
- */
- I830_FIREVERTICES( I830_CONTEXT(ctx) );
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-
- if (t == imesa->CurrentTexObj[unit]) {
- I830_STATECHANGE( imesa, I830_UPLOAD_TEX0 );
- }
-}
-
-
-static void i830TexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- GLuint unit = ctx->Texture.CurrentUnit;
-
- /* Only one env color. Need a fallback if env colors are different
- * and texture setup references env color in both units.
- */
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR:
- case GL_TEXTURE_ENV_MODE:
- case GL_COMBINE_RGB_EXT:
- case GL_COMBINE_ALPHA_EXT:
- case GL_SOURCE0_RGB_EXT:
- case GL_SOURCE1_RGB_EXT:
- case GL_SOURCE2_RGB_EXT:
- case GL_SOURCE0_ALPHA_EXT:
- case GL_SOURCE1_ALPHA_EXT:
- case GL_SOURCE2_ALPHA_EXT:
- case GL_OPERAND0_RGB_EXT:
- case GL_OPERAND1_RGB_EXT:
- case GL_OPERAND2_RGB_EXT:
- case GL_OPERAND0_ALPHA_EXT:
- case GL_OPERAND1_ALPHA_EXT:
- case GL_OPERAND2_ALPHA_EXT:
- case GL_RGB_SCALE_EXT:
- case GL_ALPHA_SCALE:
- imesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */
- break;
-
- case GL_TEXTURE_LOD_BIAS_EXT:
- i830ComputeLodBias( imesa, unit, *param );
- I830_STATECHANGE( imesa, I830_UPLOAD_TEX_N(unit) );
- break;
-
- default:
- break;
- }
-}
-
-static void i830TexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- if (t) {
- I830_FIREVERTICES( I830_CONTEXT(ctx) );
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) i830AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
-
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
-}
-
-static void i830TexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- if (t) {
- I830_FIREVERTICES( I830_CONTEXT(ctx) );
- driSwapOutTextureObject( t );
- }
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
-}
-
-
-
-static void i830CompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) i830AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
-
- texImage->IsClientData = GL_FALSE;
-
- if (I830_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
-
- _mesa_store_compressed_teximage2d(ctx, target, level, internalFormat, width,
- height, border, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void i830CompressedTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) i830AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2D");
- return;
- }
- }
-
- _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void i830BindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- assert( (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_NV) ||
- (tObj->DriverData != NULL) );
-}
-
-
-static void i830DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- driTextureObject * t = (driTextureObject *) tObj->DriverData;
- if ( t != NULL ) {
- i830ContextPtr imesa = I830_CONTEXT( ctx );
-
- if ( imesa ) {
- I830_FIREVERTICES( imesa );
- }
-
- driDestroyTextureObject( t );
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-
-static const struct gl_texture_format *
-i830ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- const GLboolean do32bpt = ( imesa->i830Screen->cpp == 4 &&
- imesa->i830Screen->textureSize > 4*1024*1024);
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- if ( format == GL_BGRA ) {
- if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
- return &_mesa_texformat_argb8888;
- }
- else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
- return &_mesa_texformat_argb4444;
- }
- else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
- }
- }
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
- return &_mesa_texformat_rgb565;
- }
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_al88;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_l8;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return &_mesa_texformat_al88;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_i8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return &_mesa_texformat_rgb_fxt1;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return &_mesa_texformat_rgba_fxt1;
-
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
-
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
-
- default:
- fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-i830NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- i830AllocTexObj( obj );
- return obj;
-}
-
-void i830InitTextureFuncs( struct dd_function_table *functions )
-{
- functions->NewTextureObject = i830NewTextureObject;
- functions->DeleteTexture = i830DeleteTexture;
- functions->ChooseTextureFormat = i830ChooseTextureFormat;
- functions->TexImage2D = i830TexImage2D;
- functions->TexSubImage2D = i830TexSubImage2D;
- functions->BindTexture = i830BindTexture;
- functions->TexParameter = i830TexParameter;
- functions->TexEnv = i830TexEnv;
- functions->IsTextureResident = driIsTextureResident;
- functions->CompressedTexImage2D = i830CompressedTexImage2D;
- functions->CompressedTexSubImage2D = i830CompressedTexSubImage2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.h
deleted file mode 100644
index 68c18b105..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tex.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- * Adapted for use in the I830M driver:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-
-#ifndef I830TEX_INC
-#define I830TEX_INC
-
-#include "mtypes.h"
-#include "i830_context.h"
-#include "i830_3d_reg.h"
-#include "texmem.h"
-
-#define I830_TEX_MAXLEVELS 10
-
-struct i830_texture_object_t
-{
- driTextureObject base;
-
- int texelBytes;
- int Pitch;
- int Height;
- char *BufAddr;
- GLenum palette_format;
- GLuint palette[256];
- struct {
- const struct gl_texture_image *image;
- int offset; /* into BufAddr */
- int height;
- int internalFormat;
- } image[6][I830_TEX_MAXLEVELS];
-
- /* Support for multitexture.
- */
-
- GLuint current_unit;
- GLuint Setup[I830_TEX_SETUP_SIZE];
- GLuint dirty;
-
- GLfloat max_anisotropy;
-};
-
-void i830UpdateTextureState( GLcontext *ctx );
-void i830InitTextureFuncs( struct dd_function_table *functions );
-
-void i830DestroyTexObj( i830ContextPtr imesa, i830TextureObjectPtr t );
-int i830UploadTexImagesLocked( i830ContextPtr imesa, i830TextureObjectPtr t );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texmem.c
deleted file mode 100644
index 7faf90874..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texmem.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 2d3d Inc., Delray Beach, FL
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_texmem.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */
-
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
- *
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keithw@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texformat.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_context.h"
-#include "i830_tex.h"
-#include "i830_state.h"
-#include "i830_ioctl.h"
-
-
-void i830DestroyTexObj(i830ContextPtr imesa, i830TextureObjectPtr t)
-{
- unsigned i;
-
-
- /* See if it was the driver's current object.
- */
- if ( imesa != NULL ) {
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if ( t == imesa->CurrentTexObj[ i ] ) {
- imesa->CurrentTexObj[ i ] = NULL;
- imesa->dirty &= ~I830_UPLOAD_TEX_N( i );
- }
- }
- }
-}
-
-#if defined(i386) || defined(__i386__)
-/* From linux kernel i386 header files, copes with odd sizes better
- * than COPY_DWORDS would:
- */
-static __inline__ void * __memcpy(void * to, const void * from, size_t n)
-{
-int d0, d1, d2;
-__asm__ __volatile__(
- "rep ; movsl\n\t"
- "testb $2,%b4\n\t"
- "je 1f\n\t"
- "movsw\n"
- "1:\ttestb $1,%b4\n\t"
- "je 2f\n\t"
- "movsb\n"
- "2:"
- : "=&c" (d0), "=&D" (d1), "=&S" (d2)
- :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
- : "memory");
-return (to);
-}
-#else
-/* Allow compilation on other architectures */
-#define __memcpy memcpy
-#endif
-
-/* Upload an image from mesa's internal copy.
- */
-static void i830UploadTexLevel( i830ContextPtr imesa,
- i830TextureObjectPtr t, int hwlevel )
-{
- const struct gl_texture_image *image = t->image[0][hwlevel].image;
- int j;
-
- if (!image || !image->Data)
- return;
-
- if (image->IsCompressed) {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[0][hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- if ((t->Setup[I830_TEXREG_TM0S1] & TM0S1_MT_FORMAT_MASK)==MT_COMPRESS_FXT1)
- {
- for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
- __memcpy(dst, src, (image->Width*2) );
- src += image->Width*2;
- }
- }
- else if ((t->Setup[I830_TEXREG_TM0S1] & TM0S1_MT_FORMAT_MASK)==MT_COMPRESS_DXT1)
- {
- for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
- __memcpy(dst, src, (image->Width*2) );
- src += image->Width*2;
- }
- }
- else if (((t->Setup[I830_TEXREG_TM0S1] & TM0S1_MT_FORMAT_MASK)==MT_COMPRESS_DXT2_3) || ((t->Setup[I830_TEXREG_TM0S1] & TM0S1_MT_FORMAT_MASK)==MT_COMPRESS_DXT4_5))
- {
- for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
- __memcpy(dst, src, (image->Width*4) );
- src += image->Width*4;
- }
- }
- }
- else if (image->Width * image->TexFormat->TexelBytes == t->Pitch) {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[0][hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- memcpy( dst, src, t->Pitch * image->Height );
- }
- else switch (image->TexFormat->TexelBytes) {
- case 1:
- {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[0][hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
- __memcpy(dst, src, image->Width );
- src += image->Width;
- }
- }
- break;
-
- case 2:
- {
- GLushort *dst = (GLushort *)(t->BufAddr + t->image[0][hwlevel].offset);
- GLushort *src = (GLushort *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) {
- __memcpy(dst, src, image->Width * 2 );
- src += image->Width;
- }
- }
- break;
-
- case 4:
- {
- GLuint *dst = (GLuint *)(t->BufAddr + t->image[0][hwlevel].offset);
- GLuint *src = (GLuint *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/4)) {
- __memcpy(dst, src, image->Width * 4 );
- src += image->Width;
- }
- }
- break;
-
- default:
- fprintf(stderr, "%s: Not supported texel size %d\n",
- __FUNCTION__, image->TexFormat->TexelBytes);
- }
-}
-
-
-/* This is called with the lock held. May have to eject our own and/or
- * other client's texture objects to make room for the upload.
- */
-
-int i830UploadTexImagesLocked( i830ContextPtr imesa, i830TextureObjectPtr t )
-{
- int ofs;
- int i;
-
- if ( t->base.memBlock == NULL ) {
- int heap;
-
- heap = driAllocateTexture( imesa->texture_heaps, imesa->nr_heaps,
- (driTextureObject *) t );
- if ( heap == -1 ) {
- return -1;
- }
-
- /* Set the base offset of the texture image */
- ofs = t->base.memBlock->ofs;
- t->BufAddr = imesa->i830Screen->tex.map + ofs;
- t->Setup[I830_TEXREG_TM0S0] = (TM0S0_USE_FENCE |
- (imesa->i830Screen->textureOffset + ofs));
-
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if (t == imesa->CurrentTexObj[i]) {
- imesa->dirty |= I830_UPLOAD_TEX_N( i );
- }
- }
- }
-
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( (driTextureObject *) t );
-
- if (imesa->texture_heaps[0]->timestamp >= GET_DISPATCH_AGE(imesa))
- i830WaitAgeLocked( imesa, imesa->texture_heaps[0]->timestamp );
-
- /* Upload any images that are new */
- if (t->base.dirty_images[0]) {
- const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- for (i = 0 ; i < numLevels ; i++) {
- if ( (t->base.dirty_images[0] & (1 << (i+t->base.firstLevel))) != 0 ) {
- i830UploadTexLevel( imesa, t, i );
- }
- }
- t->base.dirty_images[0] = 0;
- imesa->sarea->perf_boxes |= I830_BOX_TEXTURE_LOAD;
- }
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texstate.c
deleted file mode 100644
index 358c554f3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_texstate.c
+++ /dev/null
@@ -1,716 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 2d3d Inc., Delray Beach, FL
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_texstate.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */
-
-/**
- * \file i830_texstate.c
- *
- * Heavily based on the I810 driver, which was written by Keith Whitwell.
- *
- * \author Jeff Hartmann <jhartmann@2d3d.com>
- * \author Keith Whitwell <keithw@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texformat.h"
-#include "texstore.h"
-
-#include "mm.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_context.h"
-#include "i830_tex.h"
-#include "i830_state.h"
-#include "i830_ioctl.h"
-
-#define I830_TEX_UNIT_ENABLED(unit) (1<<unit)
-
-static void i830SetTexImages( i830ContextPtr imesa,
- struct gl_texture_object *tObj )
-{
- GLuint total_height, pitch, i, textureFormat;
- i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint numLevels;
-
- switch( baseImage->TexFormat->MesaFormat ) {
- case MESA_FORMAT_L8:
- t->texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_L8;
- break;
-
- case MESA_FORMAT_I8:
- t->texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_I8;
- break;
-
- case MESA_FORMAT_AL88:
- t->texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_AY88;
- break;
-
- case MESA_FORMAT_RGB565:
- t->texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_RGB565;
- break;
-
- case MESA_FORMAT_ARGB1555:
- t->texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB1555;
- break;
-
- case MESA_FORMAT_ARGB4444:
- t->texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB4444;
- break;
-
- case MESA_FORMAT_ARGB8888:
- t->texelBytes = 4;
- textureFormat = MAPSURF_32BIT | MT_32BIT_ARGB8888;
- break;
-
- case MESA_FORMAT_YCBCR_REV:
- t->texelBytes = 2;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_NORMAL |
- TM0S1_COLORSPACE_CONVERSION);
- break;
-
- case MESA_FORMAT_YCBCR:
- t->texelBytes = 2;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_SWAPY | /* ??? */
- TM0S1_COLORSPACE_CONVERSION);
- break;
-
- case MESA_FORMAT_RGB_FXT1:
- case MESA_FORMAT_RGBA_FXT1:
- t->texelBytes = 2;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1);
- break;
- case MESA_FORMAT_RGBA_DXT1:
- case MESA_FORMAT_RGB_DXT1:
- /*
- * DXTn pitches are Width/4 * blocksize in bytes
- * for DXT1: blocksize=8 so Width/4*8 = Width * 2
- * for DXT3/5: blocksize=16 so Width/4*16 = Width * 4
- */
- t->texelBytes = 2;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
- break;
- case MESA_FORMAT_RGBA_DXT3:
- t->texelBytes = 4;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
- break;
- case MESA_FORMAT_RGBA_DXT5:
- t->texelBytes = 4;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
- break;
- default:
- fprintf(stderr, "%s: bad image format\n", __FUNCTION__);
- free( t );
- return;
- }
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
-
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
-
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- /* Pitch would be subject to additional rules if texture memory were
- * tiled. Currently it isn't.
- */
- if (0) {
- pitch = 128;
- while (pitch < tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes)
- pitch *= 2;
- }
- else {
- pitch = tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes;
- pitch = (pitch + 3) & ~3;
- }
-
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- for ( total_height = i = 0 ; i < numLevels ; i++ ) {
- t->image[0][i].image = tObj->Image[0][t->base.firstLevel + i];
- if (!t->image[0][i].image)
- break;
-
- t->image[0][i].offset = total_height * pitch;
- if (t->image[0][i].image->IsCompressed)
- {
- if (t->image[0][i].image->Height > 4)
- total_height += t->image[0][i].image->Height/4;
- else
- total_height += 1;
- }
- else
- total_height += t->image[0][i].image->Height;
- t->image[0][i].internalFormat = baseImage->Format;
- }
-
- t->Pitch = pitch;
- t->base.totalSize = total_height*pitch;
- t->Setup[I830_TEXREG_TM0S1] =
- (((tObj->Image[0][t->base.firstLevel]->Height - 1) << TM0S1_HEIGHT_SHIFT) |
- ((tObj->Image[0][t->base.firstLevel]->Width - 1) << TM0S1_WIDTH_SHIFT) |
- textureFormat);
- t->Setup[I830_TEXREG_TM0S2] =
- ((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT));
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAX_MIP_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_MIP_MASK;
- t->Setup[I830_TEXREG_TM0S3] |= ((numLevels - 1)*4) << TM0S3_MIN_MIP_SHIFT;
- t->dirty = I830_UPLOAD_TEX0 | I830_UPLOAD_TEX1
- | I830_UPLOAD_TEX2 | I830_UPLOAD_TEX3;
-
- LOCK_HARDWARE( imesa );
- i830UploadTexImagesLocked( imesa, t );
- UNLOCK_HARDWARE( imesa );
-}
-
-/* ================================================================
- * Texture combine functions
- */
-
-
-/**
- * Calculate the hardware instuctions to setup the current texture enviromnemt
- * settings. Since \c gl_texture_unit::_CurrentCombine is used, both
- * "classic" texture enviroments and GL_ARB_texture_env_combine type texture
- * environments are treated identically.
- *
- * \todo
- * This function should return \c GLboolean. When \c GL_FALSE is returned,
- * it means that an environment is selected that the hardware cannot do. This
- * is the way the Radeon and R200 drivers work.
- *
- * \todo
- * Looking at i830_3d_regs.h, it seems the i830 can do part of
- * GL_ATI_texture_env_combine3. It can handle using \c GL_ONE and
- * \c GL_ZERO as combine inputs (which the code already supports). It can
- * also handle the \c GL_MODULATE_ADD_ATI mode. Is it worth investigating
- * partial support for the extension?
- *
- * \todo
- * Some thought needs to be put into the way combiners work. The driver
- * treats the hardware as if there's a specific combine unit tied to each
- * texture unit. That's why there's the special case for a disabled texture
- * unit. That's not the way the hardware works. In reality, there are 4
- * texture units and four general instruction slots. Each instruction slot
- * can use any texture as an input. There's no need for this wierd "no-op"
- * stuff. If texture units 0 and 3 are enabled, the instructions to combine
- * them should be in slots 0 and 1, not 0 and 3 with two no-ops inbetween.
- */
-
-static void i830UpdateTexEnv( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- const GLuint numColorArgs = texUnit->_CurrentCombine->_NumArgsRGB;
- const GLuint numAlphaArgs = texUnit->_CurrentCombine->_NumArgsA;
-
- GLboolean need_constant_color = GL_FALSE;
- GLuint blendop;
- GLuint ablendop;
- GLuint args_RGB[3];
- GLuint args_A[3];
- GLuint rgb_shift = texUnit->Combine.ScaleShiftRGB;
- GLuint alpha_shift = texUnit->Combine.ScaleShiftA;
- int i;
- unsigned used;
- static const GLuint tex_blend_rgb[3] = {
- TEXPIPE_COLOR | TEXBLEND_ARG1 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_COLOR | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_COLOR | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS,
- };
- static const GLuint tex_blend_a[3] = {
- TEXPIPE_ALPHA | TEXBLEND_ARG1 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_ALPHA | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_ALPHA | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS,
- };
- static const GLuint op_rgb[4] = {
- 0,
- TEXBLENDARG_INV_ARG,
- TEXBLENDARG_REPLICATE_ALPHA,
- TEXBLENDARG_REPLICATE_ALPHA | TEXBLENDARG_INV_ARG,
- };
-
-
-
- imesa->TexBlendWordsUsed[unit] = 0;
-
- if(I830_DEBUG&DEBUG_TEXTURE)
- fprintf(stderr, "[%s:%u] env. mode = %s\n", __FUNCTION__, __LINE__,
- _mesa_lookup_enum_by_nr(texUnit->EnvMode));
-
-
- if ( !texUnit->_ReallyEnabled ) {
- imesa->TexBlend[unit][0] = (STATE3D_MAP_BLEND_OP_CMD(unit) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- imesa->TexBlend[unit][1] = (STATE3D_MAP_BLEND_OP_CMD(unit) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- imesa->TexBlend[unit][2] = (STATE3D_MAP_BLEND_ARG_CMD(unit) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- imesa->TexBlend[unit][3] = (STATE3D_MAP_BLEND_ARG_CMD(unit) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- imesa->TexBlendWordsUsed[unit] = 4;
- }
- else {
- switch(texUnit->_CurrentCombine->ModeRGB) {
- case GL_REPLACE:
- blendop = TEXBLENDOP_ARG1;
- break;
- case GL_MODULATE:
- blendop = TEXBLENDOP_MODULATE;
- break;
- case GL_ADD:
- blendop = TEXBLENDOP_ADD;
- break;
- case GL_ADD_SIGNED:
- blendop = TEXBLENDOP_ADDSIGNED;
- break;
- case GL_INTERPOLATE:
- blendop = TEXBLENDOP_BLEND;
- break;
- case GL_SUBTRACT:
- blendop = TEXBLENDOP_SUBTRACT;
- break;
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- /* The EXT version of the DOT3 extension does not support the
- * scale factor, but the ARB version (and the version in OpenGL
- * 1.3) does.
- */
- rgb_shift = 0;
- alpha_shift = 0;
- /* FALLTHROUGH */
-
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- blendop = TEXBLENDOP_DOT3;
- break;
- default:
- return;
- }
-
- blendop |= (rgb_shift << TEXOP_SCALE_SHIFT);
-
- switch(texUnit->_CurrentCombine->ModeA) {
- case GL_REPLACE:
- ablendop = TEXBLENDOP_ARG1;
- break;
- case GL_MODULATE:
- ablendop = TEXBLENDOP_MODULATE;
- break;
- case GL_ADD:
- ablendop = TEXBLENDOP_ADD;
- break;
- case GL_ADD_SIGNED:
- ablendop = TEXBLENDOP_ADDSIGNED;
- break;
- case GL_INTERPOLATE:
- ablendop = TEXBLENDOP_BLEND;
- break;
- case GL_SUBTRACT:
- ablendop = TEXBLENDOP_SUBTRACT;
- break;
- default:
- return;
- }
-
- if ( (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT)
- || (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) ) {
- ablendop = TEXBLENDOP_DOT3;
- }
-
- ablendop |= (alpha_shift << TEXOP_SCALE_SHIFT);
-
- /* Handle RGB args */
- for( i = 0 ; i < numColorArgs ; i++ ) {
- const int op = texUnit->_CurrentCombine->OperandRGB[i] - GL_SRC_COLOR;
-
- assert( (op >= 0) && (op <= 3) );
- switch(texUnit->_CurrentCombine->SourceRGB[i]) {
- case GL_TEXTURE:
- args_RGB[i] = TEXBLENDARG_TEXEL0 + unit;
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- args_RGB[i] = TEXBLENDARG_TEXEL0
- + (texUnit->_CurrentCombine->SourceRGB[i] & 0x03);
- break;
- case GL_CONSTANT:
- args_RGB[i] = TEXBLENDARG_FACTOR_N;
- need_constant_color = GL_TRUE;
- break;
- case GL_PRIMARY_COLOR:
- args_RGB[i] = TEXBLENDARG_DIFFUSE;
- break;
- case GL_PREVIOUS:
- args_RGB[i] = TEXBLENDARG_CURRENT;
- break;
- case GL_ONE:
- args_RGB[i] = TEXBLENDARG_ONE;
- break;
- case GL_ZERO:
- args_RGB[i] = TEXBLENDARG_ONE | TEXBLENDARG_INV_ARG;
- break;
- default:
- return;
- }
-
- /* Xor is used so that GL_ONE_MINUS_SRC_COLOR with GL_ZERO
- * works correctly.
- */
- args_RGB[i] ^= op_rgb[op];
- }
-
- /* Handle A args */
- for( i = 0 ; i < numAlphaArgs ; i++ ) {
- const int op = texUnit->_CurrentCombine->OperandA[i] - GL_SRC_ALPHA;
-
- assert( (op >= 0) && (op <= 1) );
- switch(texUnit->_CurrentCombine->SourceA[i]) {
- case GL_TEXTURE:
- args_A[i] = TEXBLENDARG_TEXEL0 + unit;
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- args_A[i] = TEXBLENDARG_TEXEL0
- + (texUnit->_CurrentCombine->SourceA[i] & 0x03);
- break;
- case GL_CONSTANT:
- args_A[i] = TEXBLENDARG_FACTOR_N;
- need_constant_color = GL_TRUE;
- break;
- case GL_PRIMARY_COLOR:
- args_A[i] = TEXBLENDARG_DIFFUSE;
- break;
- case GL_PREVIOUS:
- args_A[i] = TEXBLENDARG_CURRENT;
- break;
- case GL_ONE:
- args_A[i] = TEXBLENDARG_ONE;
- break;
- case GL_ZERO:
- args_A[i] = TEXBLENDARG_ONE | TEXBLENDARG_INV_ARG;
- break;
- default:
- return;
- }
-
- /* We cheat. :) The register values for this are the same as for
- * RGB. Xor is used so that GL_ONE_MINUS_SRC_ALPHA with GL_ZERO
- * works correctly.
- */
- args_A[i] ^= op_rgb[op];
- }
-
- /* Native Arg1 == Arg0 in GL_EXT_texture_env_combine spec */
- /* Native Arg2 == Arg1 in GL_EXT_texture_env_combine spec */
- /* Native Arg0 == Arg2 in GL_EXT_texture_env_combine spec */
-
- /* Build color pipeline */
-
- used = 0;
- imesa->TexBlend[unit][used++] = (STATE3D_MAP_BLEND_OP_CMD(unit) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_MODIFY_PARMS |
- blendop);
-
- imesa->TexBlend[unit][used++] = (STATE3D_MAP_BLEND_OP_CMD(unit) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_MODIFY_PARMS |
- ablendop);
-
- for ( i = 0 ; i < numColorArgs ; i++ ) {
- imesa->TexBlend[unit][used++] = (STATE3D_MAP_BLEND_ARG_CMD(unit) |
- tex_blend_rgb[i] |
- args_RGB[i]);
- }
-
- for ( i = 0 ; i < numAlphaArgs ; i++ ) {
- imesa->TexBlend[unit][used++] = (STATE3D_MAP_BLEND_ARG_CMD(unit) |
- tex_blend_a[i] |
- args_A[i]);
- }
-
-
- if ( need_constant_color ) {
- GLubyte r, g, b, a;
- const GLfloat * const fc = texUnit->EnvColor;
-
- FLOAT_COLOR_TO_UBYTE_COLOR(r, fc[RCOMP]);
- FLOAT_COLOR_TO_UBYTE_COLOR(g, fc[GCOMP]);
- FLOAT_COLOR_TO_UBYTE_COLOR(b, fc[BCOMP]);
- FLOAT_COLOR_TO_UBYTE_COLOR(a, fc[ACOMP]);
-
- imesa->TexBlend[unit][used++] = STATE3D_COLOR_FACTOR_CMD(unit);
- imesa->TexBlend[unit][used++] = ((a << 24) | (r << 16) | (g << 8) | b);
- }
-
- imesa->TexBlendWordsUsed[unit] = used;
- }
-
- I830_STATECHANGE( imesa, I830_UPLOAD_TEXBLEND_N(unit) );
-}
-
-
-/* This is bogus -- can't load the same texture object on two units.
- */
-static void i830TexSetUnit( i830TextureObjectPtr t, GLuint unit )
-{
- if(I830_DEBUG&DEBUG_TEXTURE)
- fprintf(stderr, "%s unit(%d)\n", __FUNCTION__, unit);
-
- t->Setup[I830_TEXREG_TM0LI] = (STATE3D_LOAD_STATE_IMMEDIATE_2 |
- (LOAD_TEXTURE_MAP0 << unit) | 4);
-
- I830_SET_FIELD(t->Setup[I830_TEXREG_MCS], MAP_UNIT_MASK, MAP_UNIT(unit));
-
- t->current_unit = unit;
- t->base.bound |= (1U << unit);
-}
-
-#define TEXCOORDTYPE_MASK (~((1<<13)|(1<<12)|(1<<11)))
-
-
-static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- return GL_FALSE;
- }
-
- /* Upload teximages (not pipelined)
- */
- if (t->base.dirty_images[0]) {
- i830SetTexImages( imesa, tObj );
- if (!t->base.memBlock) {
- return GL_FALSE;
- }
- }
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if (imesa->CurrentTexObj[unit] != t) {
-
- if ( imesa->CurrentTexObj[unit] != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- imesa->CurrentTexObj[unit]->base.bound &= ~(1U << unit);
- }
-
- I830_STATECHANGE( imesa, I830_UPLOAD_TEX_N(unit) );
- imesa->CurrentTexObj[unit] = t;
- i830TexSetUnit(t, unit);
- }
-
- /* Update texture environment if texture object image format or
- * texture environment state has changed.
- *
- * KW: doesn't work -- change from tex0 only to tex0+tex1 gets
- * missed (need to update last stage flag?). Call
- * i830UpdateTexEnv always.
- */
- if (tObj->Image[0][tObj->BaseLevel]->Format !=
- imesa->TexEnvImageFmt[unit]) {
- imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
- }
- i830UpdateTexEnv( ctx, unit );
- imesa->TexEnabledMask |= I830_TEX_UNIT_ENABLED(unit);
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_rect( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
- GLuint mcs = t->Setup[I830_TEXREG_MCS];
-
- mcs &= ~TEXCOORDS_ARE_NORMAL;
- mcs |= TEXCOORDS_ARE_IN_TEXELUNITS;
-
- if (mcs != t->Setup[I830_TEXREG_MCS]) {
- I830_STATECHANGE( imesa, I830_UPLOAD_TEX_N(unit) );
- t->Setup[I830_TEXREG_MCS] = mcs;
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean enable_tex_2d( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
- GLuint mcs = t->Setup[I830_TEXREG_MCS];
-
- mcs &= ~TEXCOORDS_ARE_IN_TEXELUNITS;
- mcs |= TEXCOORDS_ARE_NORMAL;
-
- if (mcs != t->Setup[I830_TEXREG_MCS]) {
- I830_STATECHANGE( imesa, I830_UPLOAD_TEX_N(unit) );
- t->Setup[I830_TEXREG_MCS] = mcs;
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean disable_tex( GLcontext *ctx, int unit )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- /* This is happening too often. I need to conditionally send diffuse
- * state to the card. Perhaps a diffuse dirty flag of some kind.
- * Will need to change this logic if more than 2 texture units are
- * used. We need to only do this up to the last unit enabled, or unit
- * one if nothing is enabled.
- */
-
- if ( imesa->CurrentTexObj[unit] != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- imesa->CurrentTexObj[unit]->base.bound &= ~(1U << unit);
- imesa->CurrentTexObj[unit] = NULL;
- }
-
- imesa->TexEnvImageFmt[unit] = 0;
- imesa->dirty &= ~(I830_UPLOAD_TEX_N(unit));
-
- i830UpdateTexEnv( ctx, unit );
-
- return GL_TRUE;
-}
-
-static GLboolean i830UpdateTexUnit( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- imesa->TexEnabledMask &= ~(I830_TEX_UNIT_ENABLED(unit));
-
- if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) {
- return (enable_tex_common( ctx, unit ) &&
- enable_tex_2d( ctx, unit ));
- }
- else if (texUnit->_ReallyEnabled == TEXTURE_RECT_BIT) {
- return (enable_tex_common( ctx, unit ) &&
- enable_tex_rect( ctx, unit ));
- }
- else if (texUnit->_ReallyEnabled) {
- return GL_FALSE;
- }
- else {
- return disable_tex( ctx, unit );
- }
-}
-
-
-
-void i830UpdateTextureState( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int i;
- int last_stage = 0;
- GLboolean ok;
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- if ( (ctx->Texture.Unit[i]._ReallyEnabled == TEXTURE_2D_BIT)
- || (ctx->Texture.Unit[i]._ReallyEnabled == TEXTURE_RECT_BIT) ) {
- last_stage = i;
- }
- }
-
- ok = GL_TRUE;
- for ( i = 0 ; i <= last_stage ; i++ ) {
- ok = ok && i830UpdateTexUnit( ctx, i );
- }
-
- FALLBACK( imesa, I830_FALLBACK_TEXTURE, !ok );
-
-
- /* Make sure last stage is set correctly */
- imesa->TexBlend[last_stage][0] |= TEXOP_LAST_STAGE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.c
deleted file mode 100644
index e0907202d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tris.c,v 1.4 2002/12/10 01:26:54 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/*
- * Original Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Adapted for use on the I830M:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "i830_screen.h"
-#include "i830_dri.h"
-
-#include "i830_tris.h"
-#include "i830_state.h"
-#include "i830_ioctl.h"
-#include "i830_span.h"
-
-static void i830RenderPrimitive( GLcontext *ctx, GLenum prim );
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertsize), \
- "D" ((long)vb), \
- "S" ((long)v) ); \
-} while (0)
-#else
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- for ( j = 0 ; j < vertsize ; j++ ) \
- vb[j] = ((GLuint *)v)[j]; \
- vb += vertsize; \
-} while (0)
-#endif
-
-static void __inline__ i830_draw_triangle( i830ContextPtr imesa,
- i830VertexPtr v0,
- i830VertexPtr v1,
- i830VertexPtr v2 )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i830AllocDmaLow( imesa, 3 * 4 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
-}
-
-
-static void __inline__ i830_draw_quad( i830ContextPtr imesa,
- i830VertexPtr v0,
- i830VertexPtr v1,
- i830VertexPtr v2,
- i830VertexPtr v3 )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i830AllocDmaLow( imesa, 6 * 4 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v3 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
- COPY_DWORDS( j, vb, vertsize, v3 );
-}
-
-
-static __inline__ void i830_draw_point( i830ContextPtr imesa,
- i830VertexPtr tmp )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i830AllocDmaLow( imesa, 4 * vertsize );
- int j;
-
- /* Adjust for sub pixel position */
- *(float *)&vb[0] = tmp->v.x - 0.125;
- *(float *)&vb[1] = tmp->v.y - 0.125;
- for (j = 2 ; j < vertsize ; j++)
- vb[j] = tmp->ui[j];
-}
-
-
-static __inline__ void i830_draw_line( i830ContextPtr imesa,
- i830VertexPtr v0,
- i830VertexPtr v1 )
-{
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i830AllocDmaLow( imesa, 2 * 4 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
-}
-
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- imesa->draw_tri( imesa, a, b, c ); \
- else \
- i830_draw_triangle( imesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- imesa->draw_tri( imesa, a, b, d ); \
- imesa->draw_tri( imesa, b, c, d ); \
- } else \
- i830_draw_quad( imesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- imesa->draw_line( imesa, v0, v1 ); \
- else \
- i830_draw_line( imesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- imesa->draw_point( imesa, v0 ); \
- else \
- i830_draw_point( imesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define I830_OFFSET_BIT 0x01
-#define I830_TWOSIDE_BIT 0x02
-#define I830_UNFILLED_BIT 0x04
-#define I830_FALLBACK_BIT 0x08
-#define I830_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[I830_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & I830_FALLBACK_BIT)
-#define DO_OFFSET (IND & I830_OFFSET_BIT)
-#define DO_UNFILLED (IND & I830_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & I830_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX i830Vertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE (imesa->depth_scale)
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (imesa->verts + (e * imesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- i830_color_t *color = (i830_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v0, c ) \
-do { \
- if (havespec) { \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (havespec) { \
- v0->v.specular.red = v1->v.specular.red; \
- v0->v.specular.green = v1->v.specular.green; \
- v0->v.specular.blue = v1->v.specular.blue; \
- } \
-} while (0)
-
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
-
-#define LOCAL_VARS(n) \
- i830ContextPtr imesa = I830_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = (imesa->vertex_size == 4 ? 3 : 4); \
- GLboolean havespec = (imesa->vertex_size > 4); \
- (void) color; (void) spec; (void) coloroffset; (void) havespec;
-
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- PRIM3D_POINTLIST,
- PRIM3D_LINELIST,
- PRIM3D_LINELIST,
- PRIM3D_LINELIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST
-};
-
-#define RASTERIZE(x) if (imesa->hw_primitive != hw_prim[x]) \
- i830RasterPrimitive( ctx, x, hw_prim[x] )
-#define RENDER_PRIMITIVE imesa->render_primitive
-#define TAG(x) x
-#define IND I830_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_OFFSET_BIT|I830_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_OFFSET_BIT|I830_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_OFFSET_BIT|I830_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_OFFSET_BIT|I830_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_UNFILLED_BIT|I830_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_OFFSET_BIT|I830_UNFILLED_BIT|I830_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_UNFILLED_BIT|I830_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (I830_TWOSIDE_BIT|I830_OFFSET_BIT|I830_UNFILLED_BIT| \
- I830_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-i830_fallback_tri( i830ContextPtr imesa,
- i830Vertex *v0,
- i830Vertex *v1,
- i830Vertex *v2 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[3];
-
- if (0)
- fprintf(stderr, "\n%s\n", __FUNCTION__);
-
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swsetup_Translate( ctx, v2, &v[2] );
- i830SpanRenderStart( ctx );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
- i830SpanRenderFinish( ctx );
-}
-
-
-static void
-i830_fallback_line( i830ContextPtr imesa,
- i830Vertex *v0,
- i830Vertex *v1 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[2];
-
- if (0)
- fprintf(stderr, "\n%s\n", __FUNCTION__);
-
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- i830SpanRenderStart( ctx );
- _swrast_Line( ctx, &v[0], &v[1] );
- i830SpanRenderFinish( ctx );
-}
-
-
-static void
-i830_fallback_point( i830ContextPtr imesa,
- i830Vertex *v0 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[1];
-
- if (0)
- fprintf(stderr, "\n%s\n", __FUNCTION__);
-
- _swsetup_Translate( ctx, v0, &v[0] );
- i830SpanRenderStart( ctx );
- _swrast_Point( ctx, &v[0] );
- i830SpanRenderFinish( ctx );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define IND 0
-#define V(x) (i830Vertex *)(vertptr + ((x) * vertsize * sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) POINT( V(ELT(start)) );
-#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) )
-#define RENDER_TRI( v0, v1, v2 ) TRI( V(v0), V(v1), V(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) QUAD( V(v0), V(v1), V(v2), V(v3) )
-#define INIT(x) i830RenderPrimitive( ctx, x )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- i830ContextPtr imesa = I830_CONTEXT(ctx); \
- GLubyte *vertptr = (GLubyte *)imesa->verts; \
- const GLuint vertsize = imesa->vertex_size; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) x
-#define TAG(x) i830_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) i830_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void i830RenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint prim = imesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n,
- PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void i830RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-static void i830FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- i830ContextPtr imesa = I830_CONTEXT( ctx );
- GLuint vertsize = imesa->vertex_size;
- GLuint *vb = i830AllocDmaLow( imesa, (n-2) * 3 * 4 * vertsize );
- GLubyte *vertptr = (GLubyte *)imesa->verts;
- const GLuint *start = (const GLuint *)V(elts[0]);
- int i,j;
-
- for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, V(elts[i-1]) );
- COPY_DWORDS( j, vb, vertsize, V(elts[i]) );
- COPY_DWORDS( j, vb, vertsize, start );
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-
-#define _I830_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_POLYGONSTIPPLE)
-
-#define POINT_FALLBACK (0)
-#define LINE_FALLBACK (DD_LINE_STIPPLE)
-#define TRI_FALLBACK (0)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK|\
- DD_TRI_STIPPLE)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-static void i830ChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (I830_DEBUG & DEBUG_STATE)
- fprintf(stderr,"\n%s\n",__FUNCTION__);
-
- if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) {
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= I830_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= I830_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= I830_UNFILLED_BIT;
- }
-
- imesa->draw_point = i830_draw_point;
- imesa->draw_line = i830_draw_line;
- imesa->draw_tri = i830_draw_triangle;
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & ANY_FALLBACK_FLAGS)
- {
- if (flags & POINT_FALLBACK)
- imesa->draw_point = i830_fallback_point;
-
- if (flags & LINE_FALLBACK)
- imesa->draw_line = i830_fallback_line;
-
- if (flags & TRI_FALLBACK)
- imesa->draw_tri = i830_fallback_tri;
-
- if ((flags & DD_TRI_STIPPLE) && !imesa->hw_stipple) {
- imesa->draw_tri = i830_fallback_tri;
- }
-
- index |= I830_FALLBACK_BIT;
- }
- }
-
- if (imesa->RenderIndex != index) {
- imesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = i830_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = i830_render_tab_elts;
- tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */
- tnl->Driver.Render.ClippedPolygon = i830FastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = i830RenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = i830RenderClippedPoly;
- }
- }
-}
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in i810render.c.
- */
-static void i830RenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- imesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (imesa->reduced_primitive != rprim ||
- hw_prim[prim] != imesa->hw_primitive) {
- i830RasterPrimitive( ctx, rprim, hw_prim[prim] );
- }
-}
-
-static void i830RunPipeline( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
-
- if (imesa->NewGLState) {
- if (imesa->NewGLState & _NEW_TEXTURE) {
- I830_FIREVERTICES( imesa );
- i830UpdateTextureState( ctx ); /* may modify imesa->NewGLState */
- }
-
- if (!imesa->Fallback) {
- if (imesa->NewGLState & _I830_NEW_RENDERSTATE)
- i830ChooseRenderState( ctx );
- }
-
- imesa->NewGLState = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-
-#define TEXCOORDTYPE_MASK (3<<11)
-
-
-
-static void set_projective_texturing( i830ContextPtr imesa,
- GLuint i,
- GLuint mcs)
-{
- mcs |= (imesa->CurrentTexObj[i]->Setup[I830_TEXREG_MCS] &
- ~TEXCOORDTYPE_MASK);
-
- if (mcs != imesa->CurrentTexObj[i]->Setup[I830_TEXREG_MCS]) {
- I830_STATECHANGE(imesa, I830_UPLOAD_TEX_N(i));
- imesa->CurrentTexObj[i]->Setup[I830_TEXREG_MCS] = mcs;
- }
-}
-
-
-#define SZ_TO_HW(sz) ((sz-2)&0x3)
-#define EMIT_SZ(sz) (EMIT_1F + (sz) - 1)
-#define EMIT_ATTR( ATTR, STYLE, V0 ) \
-do { \
- imesa->vertex_attrs[imesa->vertex_attr_count].attrib = (ATTR); \
- imesa->vertex_attrs[imesa->vertex_attr_count].format = (STYLE); \
- imesa->vertex_attr_count++; \
- v0 |= V0; \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- imesa->vertex_attrs[imesa->vertex_attr_count].attrib = 0; \
- imesa->vertex_attrs[imesa->vertex_attr_count].format = EMIT_PAD; \
- imesa->vertex_attrs[imesa->vertex_attr_count].offset = (N); \
- imesa->vertex_attr_count++; \
-} while (0)
-
-#define VRTX_TEX_SET_FMT(n, x) ((x)<<((n)*2))
-
-/* Make sure hardware vertex format is appropriate for VB state.
- */
-static void i830RenderStart( GLcontext *ctx )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLuint v0 = STATE3D_VERTEX_FORMAT_CMD;
- GLuint v2 = STATE3D_VERTEX_FORMAT_2_CMD;
- GLuint force_emit = 0;
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- imesa->vertex_attr_count = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if (index & _TNL_BITS_TEX_ANY) {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, VRTX_HAS_XYZW );
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, VRTX_HAS_XYZ );
- }
-
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, VRTX_HAS_DIFFUSE );
-
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
-
- if (index & _TNL_BIT_COLOR1)
- {
- if (imesa->vertex_attrs[imesa->vertex_attr_count].format != EMIT_3UB_3F_BGR)
- force_emit=1;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VRTX_HAS_SPEC );
- }
- else
- {
- if (imesa->vertex_attrs[imesa->vertex_attr_count].format != EMIT_PAD)
- force_emit=1;
- EMIT_PAD( 3 );
- }
- if (index & _TNL_BIT_FOG)
- {
- if (imesa->vertex_attrs[imesa->vertex_attr_count].format != EMIT_1UB_1F)
- force_emit=1;
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, VRTX_HAS_SPEC );
- }
- else
- {
- if (imesa->vertex_attrs[imesa->vertex_attr_count].format != EMIT_PAD)
- force_emit=1;
- EMIT_PAD( 1 );
- }
- }
-
- if (index & _TNL_BITS_TEX_ANY) {
- int i, last_stage = 0;
-
- for (i = 0; i < ctx->Const.MaxTextureUnits ; i++)
- if (index & _TNL_BIT_TEX(i))
- last_stage = i+1;
-
-
- for (i = 0; i < last_stage; i++) {
- GLuint sz = VB->TexCoordPtr[i]->size;
- GLuint emit;
- GLuint mcs;
-
- /* i830 doesn't like 1D or 4D texcoords:
- */
- switch (sz) {
- case 1:
- case 2:
- case 3: /* no attempt at cube texturing so far */
- emit = EMIT_2F;
- sz = 2;
- mcs = TEXCOORDTYPE_CARTESIAN;
- break;
- case 4:
- emit = EMIT_3F_XYW;
- sz = 3;
- mcs = TEXCOORDTYPE_HOMOGENEOUS;
- break;
- default:
- continue;
- };
-
- v2 |= VRTX_TEX_SET_FMT(i, SZ_TO_HW(sz));
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_SZ(sz), 0 );
-
- if (imesa->CurrentTexObj[i])
- set_projective_texturing( imesa, i, mcs );
- }
-
- v0 |= VRTX_TEX_COORD_COUNT(last_stage);
- }
-
- /* Only need to change the vertex emit code if there has been a
- * statechange to a new hardware vertex format:
- */
- if (v0 != imesa->Setup[I830_CTXREG_VF] ||
- v2 != imesa->Setup[I830_CTXREG_VF2] ||
- force_emit == 1) {
-
- I830_STATECHANGE( imesa, I830_UPLOAD_CTX );
-
- /* Must do this *after* statechange, so as not to affect
- * buffered vertices reliant on the old state:
- */
- imesa->vertex_size =
- _tnl_install_attrs( ctx,
- imesa->vertex_attrs,
- imesa->vertex_attr_count,
- imesa->ViewportMatrix.m, 0 );
-
- imesa->vertex_size >>= 2;
-
- imesa->Setup[I830_CTXREG_VF] = v0;
- imesa->Setup[I830_CTXREG_VF2] = v2;
- }
-}
-
-
-static void i830RenderFinish( GLcontext *ctx )
-{
- if (I830_CONTEXT(ctx)->RenderIndex & I830_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-
-
-/* System to flush dma and emit state changes based on the rasterized
- * primitive.
- */
-void i830RasterPrimitive( GLcontext *ctx,
- GLenum rprim,
- GLuint hwprim )
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLuint aa = imesa->Setup[I830_CTXREG_AA];
- GLuint st1 = imesa->StippleSetup[I830_STPREG_ST1];
-
- aa &= ~AA_LINE_ENABLE;
-
- if (I830_DEBUG & DEBUG_PRIMS) {
- /* Prints reduced prim, and hw prim */
- char *prim_name = "Unknown";
-
- switch(hwprim) {
- case PRIM3D_POINTLIST:
- prim_name = "PointList";
- break;
- case PRIM3D_LINELIST:
- prim_name = "LineList";
- break;
- case PRIM3D_LINESTRIP:
- prim_name = "LineStrip";
- break;
- case PRIM3D_TRILIST:
- prim_name = "TriList";
- break;
- case PRIM3D_TRISTRIP:
- prim_name = "TriStrip";
- break;
- case PRIM3D_TRIFAN:
- prim_name = "TriFan";
- break;
- case PRIM3D_POLY:
- prim_name = "Polygons";
- break;
- default:
- break;
- }
-
- fprintf(stderr, "%s : rprim(%s), hwprim(%s)\n",
- __FUNCTION__,
- _mesa_lookup_enum_by_nr(rprim),
- prim_name);
- }
-
- switch (rprim) {
- case GL_TRIANGLES:
- aa |= AA_LINE_DISABLE;
- if (ctx->Polygon.StippleFlag)
- st1 |= ST1_ENABLE;
- else
- st1 &= ~ST1_ENABLE;
- break;
- case GL_LINES:
- st1 &= ~ST1_ENABLE;
- if (ctx->Line.SmoothFlag) {
- aa |= AA_LINE_ENABLE;
- } else {
- aa |= AA_LINE_DISABLE;
- }
- break;
- case GL_POINTS:
- st1 &= ~ST1_ENABLE;
- aa |= AA_LINE_DISABLE;
- break;
- default:
- return;
- }
-
- imesa->reduced_primitive = rprim;
-
- if (aa != imesa->Setup[I830_CTXREG_AA]) {
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_AA] = aa;
- }
-
-#if 0
- if (st1 != imesa->StippleSetup[I830_STPREG_ST1]) {
- I830_STATECHANGE(imesa, I830_UPLOAD_STIPPLE);
- imesa->StippleSetup[I830_STPREG_ST1] = st1;
- }
-#endif
-
- if (hwprim != imesa->hw_primitive) {
- I830_STATECHANGE(imesa, 0);
- imesa->hw_primitive = hwprim;
- }
-}
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static char *fallbackStrings[] = {
- "Texture",
- "Draw buffer",
- "Read buffer",
- "Color mask",
- "Render mode",
- "Stencil",
- "Stipple",
- "User disable"
-};
-
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-
-void i830Fallback( i830ContextPtr imesa, GLuint bit, GLboolean mode )
-{
- GLcontext *ctx = imesa->glCtx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = imesa->Fallback;
-
- if (mode) {
- imesa->Fallback |= bit;
- if (oldfallback == 0) {
- I830_FIREVERTICES(imesa);
- if (I830_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "ENTER FALLBACK %s\n", getFallbackString( bit ));
- _swsetup_Wakeup( ctx );
- imesa->RenderIndex = ~0;
- }
- }
- else {
- imesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- if (I830_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString( bit ));
- tnl->Driver.Render.Start = i830RenderStart;
- tnl->Driver.Render.PrimitiveNotify = i830RenderPrimitive;
- tnl->Driver.Render.Finish = i830RenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_invalidate_vertex_state( ctx, ~0 );
- _tnl_invalidate_vertices( ctx, ~0 );
- _tnl_install_attrs( ctx,
- imesa->vertex_attrs,
- imesa->vertex_attr_count,
- imesa->ViewportMatrix.m, 0 );
-
- imesa->NewGLState |= _I830_NEW_RENDERSTATE;
- }
- }
-}
-
-
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-/**
- * \bug
- * How are the magic numbers 12 and 26 in the call to \c _tnl_init_vertices
- * derived?
- */
-void i830InitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = i830RunPipeline;
- tnl->Driver.Render.Start = i830RenderStart;
- tnl->Driver.Render.Finish = i830RenderFinish;
- tnl->Driver.Render.PrimitiveNotify = i830RenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- 26 * sizeof(GLfloat) );
-
- I830_CONTEXT(ctx)->verts = (char *)tnl->clipspace.vertex_buf;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.h
deleted file mode 100644
index ae4f0a5df..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/i830_tris.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- * Adapted for use in the I830M:
- * Jeff Hartmann <jhartmann@2d3d.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tris.h,v 1.3 2002/09/09 19:18:48 dawes Exp $ */
-
-#ifndef I830TRIS_INC
-#define I830TRIS_INC
-
-#include "mtypes.h"
-
-extern void i830PrintRenderState( const char *msg, GLuint state );
-extern void i830InitTriFuncs( GLcontext *ctx );
-extern void i830RasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_common.h
deleted file mode 100644
index 3367bfc16..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_common.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.2 2002/12/10 01:27:05 dawes Exp $ */
-
-/* Author: Jeff Hartmann <jhartmann@valinux.com>
-
- Converted to common header format:
- Jens Owen <jens@tungstengraphics.com>
- */
-
-#ifndef _I830_COMMON_H_
-#define _I830_COMMON_H_
-
-/* WARNING: These defines must be the same as what the Xserver uses.
- * if you change them, you must change the defines in the Xserver.
- */
-
-#ifndef _I830_DEFINES_
-#define _I830_DEFINES_
-
-#define I830_DMA_BUF_ORDER 12
-#define I830_DMA_BUF_SZ (1<<I830_DMA_BUF_ORDER)
-#define I830_DMA_BUF_NR 256
-#define I830_NR_SAREA_CLIPRECTS 8
-
-/* Each region is a minimum of 64k, and there are at most 64 of them.
- */
-#define I830_NR_TEX_REGIONS 64
-#define I830_LOG_MIN_TEX_REGION_SIZE 16
-
-/* if defining I830_ENABLE_4_TEXTURES, do it in i830_3d_reg.h, too */
-#if !defined(I830_ENABLE_4_TEXTURES)
-#define I830_TEXTURE_COUNT 2
-#define I830_TEXBLEND_COUNT 2 /* always same as TEXTURE_COUNT? */
-#else /* defined(I830_ENABLE_4_TEXTURES) */
-#define I830_TEXTURE_COUNT 4
-#define I830_TEXBLEND_COUNT 4 /* always same as TEXTURE_COUNT? */
-#endif /* I830_ENABLE_4_TEXTURES */
-
-#define I830_TEXBLEND_SIZE 12 /* (4 args + op) * 2 + COLOR_FACTOR */
-
-#define I830_UPLOAD_CTX 0x1
-#define I830_UPLOAD_BUFFERS 0x2
-#define I830_UPLOAD_CLIPRECTS 0x4
-#define I830_UPLOAD_TEX0_IMAGE 0x100 /* handled clientside */
-#define I830_UPLOAD_TEX0_CUBE 0x200 /* handled clientside */
-#define I830_UPLOAD_TEX1_IMAGE 0x400 /* handled clientside */
-#define I830_UPLOAD_TEX1_CUBE 0x800 /* handled clientside */
-#define I830_UPLOAD_TEX2_IMAGE 0x1000 /* handled clientside */
-#define I830_UPLOAD_TEX2_CUBE 0x2000 /* handled clientside */
-#define I830_UPLOAD_TEX3_IMAGE 0x4000 /* handled clientside */
-#define I830_UPLOAD_TEX3_CUBE 0x8000 /* handled clientside */
-#define I830_UPLOAD_TEX_N_IMAGE(n) (0x100 << (n * 2))
-#define I830_UPLOAD_TEX_N_CUBE(n) (0x200 << (n * 2))
-#define I830_UPLOAD_TEXIMAGE_MASK 0xff00
-#define I830_UPLOAD_TEX0 0x10000
-#define I830_UPLOAD_TEX1 0x20000
-#define I830_UPLOAD_TEX2 0x40000
-#define I830_UPLOAD_TEX3 0x80000
-#define I830_UPLOAD_TEX_N(n) (0x10000 << (n))
-#define I830_UPLOAD_TEX_MASK 0xf0000
-#define I830_UPLOAD_TEXBLEND0 0x100000
-#define I830_UPLOAD_TEXBLEND1 0x200000
-#define I830_UPLOAD_TEXBLEND2 0x400000
-#define I830_UPLOAD_TEXBLEND3 0x800000
-#define I830_UPLOAD_TEXBLEND_N(n) (0x100000 << (n))
-#define I830_UPLOAD_TEXBLEND_MASK 0xf00000
-#define I830_UPLOAD_TEX_PALETTE_N(n) (0x1000000 << (n))
-#define I830_UPLOAD_TEX_PALETTE_SHARED 0x4000000
-#define I830_UPLOAD_STIPPLE 0x8000000
-
-/* Indices into buf.Setup where various bits of state are mirrored per
- * context and per buffer. These can be fired at the card as a unit,
- * or in a piecewise fashion as required.
- */
-
-/* Destbuffer state
- * - backbuffer linear offset and pitch -- invarient in the current dri
- * - zbuffer linear offset and pitch -- also invarient
- * - drawing origin in back and depth buffers.
- *
- * Keep the depth/back buffer state here to acommodate private buffers
- * in the future.
- */
-
-#define I830_DESTREG_CBUFADDR 0
-/* Invarient */
-#define I830_DESTREG_DBUFADDR 1
-#define I830_DESTREG_DV0 2
-#define I830_DESTREG_DV1 3
-#define I830_DESTREG_SENABLE 4
-#define I830_DESTREG_SR0 5
-#define I830_DESTREG_SR1 6
-#define I830_DESTREG_SR2 7
-#define I830_DESTREG_DR0 8
-#define I830_DESTREG_DR1 9
-#define I830_DESTREG_DR2 10
-#define I830_DESTREG_DR3 11
-#define I830_DESTREG_DR4 12
-#define I830_DEST_SETUP_SIZE 13
-
-/* Context state
- */
-#define I830_CTXREG_STATE1 0
-#define I830_CTXREG_STATE2 1
-#define I830_CTXREG_STATE3 2
-#define I830_CTXREG_STATE4 3
-#define I830_CTXREG_STATE5 4
-#define I830_CTXREG_IALPHAB 5
-#define I830_CTXREG_STENCILTST 6
-#define I830_CTXREG_ENABLES_1 7
-#define I830_CTXREG_ENABLES_2 8
-#define I830_CTXREG_AA 9
-#define I830_CTXREG_FOGCOLOR 10
-#define I830_CTXREG_BLENDCOLR0 11
-#define I830_CTXREG_BLENDCOLR 12 /* Dword 1 of 2 dword command */
-#define I830_CTXREG_VF 13
-#define I830_CTXREG_VF2 14
-#define I830_CTXREG_MCSB0 15
-#define I830_CTXREG_MCSB1 16
-#define I830_CTX_SETUP_SIZE 17
-
-/* 1.3: Stipple state
- */
-#define I830_STPREG_ST0 0
-#define I830_STPREG_ST1 1
-#define I830_STP_SETUP_SIZE 2
-
-/* Texture state (per tex unit)
- */
-#define I830_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (6 dwords) */
-#define I830_TEXREG_MI1 1
-#define I830_TEXREG_MI2 2
-#define I830_TEXREG_MI3 3
-#define I830_TEXREG_MI4 4
-#define I830_TEXREG_MI5 5
-#define I830_TEXREG_MF 6 /* GFX_OP_MAP_FILTER */
-#define I830_TEXREG_MLC 7 /* GFX_OP_MAP_LOD_CTL */
-#define I830_TEXREG_MLL 8 /* GFX_OP_MAP_LOD_LIMITS */
-#define I830_TEXREG_MCS 9 /* GFX_OP_MAP_COORD_SETS */
-#define I830_TEX_SETUP_SIZE 10
-
-/* New version. Kernel auto-detects.
- */
-#define I830_TEXREG_TM0LI 0 /* load immediate 2 texture map n */
-#define I830_TEXREG_TM0S0 1
-#define I830_TEXREG_TM0S1 2
-#define I830_TEXREG_TM0S2 3
-#define I830_TEXREG_TM0S3 4
-#define I830_TEXREG_TM0S4 5
-#define I830_TEXREG_NOP0 6 /* noop */
-#define I830_TEXREG_NOP1 7 /* noop */
-#define I830_TEXREG_NOP2 8 /* noop */
-#define __I830_TEXREG_MCS 9 /* GFX_OP_MAP_COORD_SETS -- shared */
-#define __I830_TEX_SETUP_SIZE 10
-
-
-#define I830_FRONT 0x1
-#define I830_BACK 0x2
-#define I830_DEPTH 0x4
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_I830_INIT 0x00
-#define DRM_I830_VERTEX 0x01
-#define DRM_I830_CLEAR 0x02
-#define DRM_I830_FLUSH 0x03
-#define DRM_I830_GETAGE 0x04
-#define DRM_I830_GETBUF 0x05
-#define DRM_I830_SWAP 0x06
-#define DRM_I830_COPY 0x07
-#define DRM_I830_DOCOPY 0x08
-#define DRM_I830_FLIP 0x09
-#define DRM_I830_IRQ_EMIT 0x0a
-#define DRM_I830_IRQ_WAIT 0x0b
-#define DRM_I830_GETPARAM 0x0c
-#define DRM_I830_SETPARAM 0x0d
-
-#endif /* _I830_DEFINES_ */
-
-typedef struct {
- enum {
- I830_INIT_DMA = 0x01,
- I830_CLEANUP_DMA = 0x02
- } func;
- unsigned int mmio_offset;
- unsigned int buffers_offset;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
- unsigned int back_pitch;
- unsigned int depth_pitch;
- unsigned int cpp;
-} drmI830Init;
-
-typedef struct {
- int clear_color;
- int clear_depth;
- int flags;
- unsigned int clear_colormask;
- unsigned int clear_depthmask;
-} drmI830Clear;
-
-/* These may be placeholders if we have more cliprects than
- * I830_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
- * false, indicating that the buffer will be dispatched again with a
- * new set of cliprects.
- */
-typedef struct {
- int idx; /* buffer index */
- int used; /* nr bytes in use */
- int discard; /* client is finished with the buffer? */
-} drmI830Vertex;
-
-typedef struct {
- int idx; /* buffer index */
- int used; /* nr bytes in use */
- void *address; /* Address to copy from */
-} drmI830Copy;
-
-typedef struct {
- void *virtual;
- int request_idx;
- int request_size;
- int granted;
-} drmI830DMA;
-
-typedef struct drm_i830_irq_emit {
- int *irq_seq;
-} drmI830IrqEmit;
-
-typedef struct drm_i830_irq_wait {
- int irq_seq;
-} drmI830IrqWait;
-
-typedef struct drm_i830_getparam {
- int param;
- int *value;
-} drmI830GetParam;
-
-#define I830_PARAM_IRQ_ACTIVE 1
-
-
-typedef struct drm_i830_setparam {
- int param;
- int value;
-} drmI830SetParam;
-
-#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1
-
-
-
-#endif /* _I830_DRM_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_dri.h
deleted file mode 100644
index e4b36cc16..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i830/server/i830_dri.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v 1.5 2002/12/10 01:27:05 dawes Exp $ */
-
-#ifndef _I830_DRI_H
-#define _I830_DRI_H
-
-#include "drm.h" /* HACK!!! why doesn't xf86drm.h work??? */
-/* #include "xf86drm.h" */
-#include "i830_common.h"
-
-#define I830_MAX_DRAWABLES 256
-
-#define I830_MAJOR_VERSION 1
-#define I830_MINOR_VERSION 3
-#define I830_PATCHLEVEL 0
-
-#define I830_REG_SIZE 0x80000
-
-typedef struct _I830DRIRec {
- drm_handle_t regs;
- drmSize regsSize;
-
- drmSize backbufferSize;
- drm_handle_t backbuffer;
-
- drmSize depthbufferSize;
- drm_handle_t depthbuffer;
-
- drm_handle_t textures;
- int textureSize;
-
- drm_handle_t agp_buffers;
- drmSize agp_buf_size;
-
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int bitsPerPixel;
- int fbOffset;
- int fbStride;
-
- int backOffset;
- int depthOffset;
-
- int auxPitch;
- int auxPitchBits;
-
- int logTextureGranularity;
- int textureOffset;
-
- /* For non-dma direct rendering.
- */
- int ringOffset;
- int ringSize;
-
- drmBufMapPtr drmBufs;
- int irq;
- int sarea_priv_offset;
-} I830DRIRec, *I830DRIPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830ConfigPrivRec, *I830ConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830DRIContextRec, *I830DRIContextPtr;
-
-/* Warning: If you change the SAREA structure you must change the kernel
- * structure as well */
-
-typedef struct _I830SAREA {
- unsigned int ContextState[I830_CTX_SETUP_SIZE];
- unsigned int BufferState[I830_DEST_SETUP_SIZE];
- unsigned int TexState[I830_TEXTURE_COUNT][I830_TEX_SETUP_SIZE];
- unsigned int TexBlendState[I830_TEXBLEND_COUNT][I830_TEXBLEND_SIZE];
- unsigned int TexBlendStateWordsUsed[I830_TEXBLEND_COUNT];
- unsigned int Palette[2][256];
- unsigned int dirty;
-
- unsigned int nbox;
- drm_clip_rect_t boxes[I830_NR_SAREA_CLIPRECTS];
-
- /* Maintain an LRU of contiguous regions of texture space. If
- * you think you own a region of texture memory, and it has an
- * age different to the one you set, then you are mistaken and
- * it has been stolen by another client. If global texAge
- * hasn't changed, there is no need to walk the list.
- *
- * These regions can be used as a proxy for the fine-grained
- * texture information of other clients - by maintaining them
- * in the same lru which is used to age their own textures,
- * clients have an approximate lru for the whole of global
- * texture space, and can make informed decisions as to which
- * areas to kick out. There is no need to choose whether to
- * kick out your own texture or someone else's - simply eject
- * them all in LRU order.
- */
-
- drmTextureRegion texList[I830_NR_TEX_REGIONS + 1];
- /* Last elt is sentinal */
- int texAge; /* last time texture was uploaded */
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int last_quiescent; /* */
- int ctxOwner; /* last context to upload state */
-
- int vertex_prim;
-
- int pf_enabled; /* is pageflipping allowed? */
- int pf_active; /* is pageflipping active right now? */
- int pf_current_page; /* which buffer is being displayed? */
-
- int perf_boxes; /* performance boxes to be displayed */
-
- /* Here's the state for texunits 2,3:
- */
- unsigned int TexState2[I830_TEX_SETUP_SIZE];
- unsigned int TexBlendState2[I830_TEXBLEND_SIZE];
- unsigned int TexBlendStateWordsUsed2;
-
- unsigned int TexState3[I830_TEX_SETUP_SIZE];
- unsigned int TexBlendState3[I830_TEXBLEND_SIZE];
- unsigned int TexBlendStateWordsUsed3;
-
- unsigned int StippleState[I830_STP_SETUP_SIZE];
-} I830SAREARec, *I830SAREAPtr;
-
-/* Flags for perf_boxes
- */
-#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */
-#define I830_BOX_FLIP 0x2 /* populated by kernel */
-#define I830_BOX_WAIT 0x4 /* populated by kernel & client */
-#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */
-#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/Makefile
deleted file mode 100644
index c269fb129..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i915_dri.so
-
-DRIVER_SOURCES = \
- i915_context.c \
- i915_debug.c \
- i915_fragprog.c \
- i915_metaops.c \
- i915_program.c \
- i915_state.c \
- i915_tex.c \
- i915_texprog.c \
- i915_texstate.c \
- i915_vtbl.c \
- i830_context.c \
- i830_metaops.c \
- i830_state.c \
- i830_texblend.c \
- i830_tex.c \
- i830_texstate.c \
- i830_vtbl.c \
- intel_batchbuffer.c \
- intel_context.c \
- intel_ioctl.c \
- intel_pixel.c \
- intel_render.c \
- intel_screen.c \
- intel_span.c \
- intel_state.c \
- intel_tex.c \
- intel_tris.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(MINIGLX_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.c
deleted file mode 100644
index 6088db67e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "i830_context.h"
-#include "imports.h"
-#include "texmem.h"
-#include "intel_tex.h"
-#include "tnl/tnl.h"
-#include "tnl/t_vertex.h"
-#include "tnl/t_context.h"
-#include "utils.h"
-
-/***************************************
- * Mesa's Driver Functions
- ***************************************/
-
-static const struct dri_extension i830_extensions[] =
-{
- { "GL_ARB_texture_env_crossbar", NULL },
- { NULL, NULL }
-};
-
-
-static void i830InitDriverFunctions( struct dd_function_table *functions )
-{
- intelInitDriverFunctions( functions );
- i830InitStateFuncs( functions );
- i830InitTextureFuncs( functions );
-}
-
-
-GLboolean i830CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- struct dd_function_table functions;
- i830ContextPtr i830 = (i830ContextPtr) CALLOC_STRUCT(i830_context);
- intelContextPtr intel = &i830->intel;
- GLcontext *ctx = &intel->ctx;
- if (!i830) return GL_FALSE;
-
- i830InitVtbl( i830 );
- i830InitDriverFunctions( &functions );
-
- if (!intelInitContext( intel, mesaVis, driContextPriv,
- sharedContextPrivate, &functions )) {
- FREE(i830);
- return GL_FALSE;
- }
-
- intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS;
- intel->ctx.Const.MaxTextureImageUnits = I830_TEX_UNITS;
- intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS;
-
- intel->nr_heaps = 1;
- intel->texture_heaps[0] =
- driCreateTextureHeap( 0, intel,
- intel->intelScreen->textureSize,
- 12,
- I830_NR_TEX_REGIONS,
- intel->sarea->texList,
- & intel->sarea->texAge,
- & intel->swapped,
- sizeof( struct i830_texture_object ),
- (destroy_texture_object_t *)intelDestroyTexObj );
-
- /* FIXME: driCalculateMaxTextureLevels assumes that mipmaps are tightly
- * FIXME: packed, but they're not in Intel graphics hardware.
- */
- intel->ctx.Const.MaxTextureUnits = 1;
- driCalculateMaxTextureLevels( intel->texture_heaps,
- intel->nr_heaps,
- &intel->ctx.Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 8, /* max 3D texture size is 256^3 */
- 10, /* max CUBE texture size is 1024x1024 */
- 11, /* max RECT. supported */
- 12,
- GL_FALSE );
- intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- 18 * sizeof(GLfloat) );
-
- intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf;
-
- driInitExtensions( ctx, i830_extensions, GL_FALSE );
-
- i830InitState( i830 );
-
-
- _tnl_allow_vertex_fog( ctx, 1 );
- _tnl_allow_pixel_fog( ctx, 0 );
-
- return GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.h
deleted file mode 100644
index 62e20d0a0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_context.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef I830CONTEXT_INC
-#define I830CONTEXT_INC
-
-#include "intel_context.h"
-
-#define I830_FALLBACK_TEXTURE 0x1000
-#define I830_FALLBACK_COLORMASK 0x2000
-#define I830_FALLBACK_STENCIL 0x4000
-#define I830_FALLBACK_STIPPLE 0x8000
-#define I830_FALLBACK_LOGICOP 0x10000
-
-#define I830_UPLOAD_CTX 0x1
-#define I830_UPLOAD_BUFFERS 0x2
-#define I830_UPLOAD_STIPPLE 0x4
-#define I830_UPLOAD_TEX(i) (0x10<<(i))
-#define I830_UPLOAD_TEXBLEND(i) (0x100<<(i))
-#define I830_UPLOAD_TEX_ALL (0x0f0)
-#define I830_UPLOAD_TEXBLEND_ALL (0xf00)
-
-/* State structure offsets - these will probably disappear.
- */
-#define I830_DESTREG_CBUFADDR0 0
-#define I830_DESTREG_CBUFADDR1 1
-#define I830_DESTREG_CBUFADDR2 2
-#define I830_DESTREG_DBUFADDR0 3
-#define I830_DESTREG_DBUFADDR1 4
-#define I830_DESTREG_DBUFADDR2 5
-#define I830_DESTREG_DV0 6
-#define I830_DESTREG_DV1 7
-#define I830_DESTREG_SENABLE 8
-#define I830_DESTREG_SR0 9
-#define I830_DESTREG_SR1 10
-#define I830_DESTREG_SR2 11
-#define I830_DEST_SETUP_SIZE 12
-
-#define I830_CTXREG_STATE1 0
-#define I830_CTXREG_STATE2 1
-#define I830_CTXREG_STATE3 2
-#define I830_CTXREG_STATE4 3
-#define I830_CTXREG_STATE5 4
-#define I830_CTXREG_IALPHAB 5
-#define I830_CTXREG_STENCILTST 6
-#define I830_CTXREG_ENABLES_1 7
-#define I830_CTXREG_ENABLES_2 8
-#define I830_CTXREG_AA 9
-#define I830_CTXREG_FOGCOLOR 10
-#define I830_CTXREG_BLENDCOLOR0 11
-#define I830_CTXREG_BLENDCOLOR1 12
-#define I830_CTXREG_VF 13
-#define I830_CTXREG_VF2 14
-#define I830_CTXREG_MCSB0 15
-#define I830_CTXREG_MCSB1 16
-#define I830_CTX_SETUP_SIZE 17
-
-#define I830_STPREG_ST0 0
-#define I830_STPREG_ST1 1
-#define I830_STP_SETUP_SIZE 2
-
-#define I830_TEXREG_TM0LI 0 /* load immediate 2 texture map n */
-#define I830_TEXREG_TM0S0 1
-#define I830_TEXREG_TM0S1 2
-#define I830_TEXREG_TM0S2 3
-#define I830_TEXREG_TM0S3 4
-#define I830_TEXREG_TM0S4 5
-#define I830_TEXREG_MCS 6 /* _3DSTATE_MAP_COORD_SETS */
-#define I830_TEXREG_CUBE 7 /* _3DSTATE_MAP_SUBE */
-#define I830_TEX_SETUP_SIZE 8
-
-#define I830_TEXBLEND_SIZE 12 /* (4 args + op) * 2 + COLOR_FACTOR */
-
-struct i830_texture_object
-{
- struct intel_texture_object intel;
- GLuint Setup[I830_TEX_SETUP_SIZE];
-};
-
-#define I830_TEX_UNITS 4
-
-struct i830_hw_state {
- GLuint Ctx[I830_CTX_SETUP_SIZE];
- GLuint Buffer[I830_DEST_SETUP_SIZE];
- GLuint Stipple[I830_STP_SETUP_SIZE];
- GLuint Tex[I830_TEX_UNITS][I830_TEX_SETUP_SIZE];
- GLuint TexBlend[I830_TEX_UNITS][I830_TEXBLEND_SIZE];
- GLuint TexBlendWordsUsed[I830_TEX_UNITS];
- GLuint emitted; /* I810_UPLOAD_* */
- GLuint active;
-};
-
-struct i830_context
-{
- struct intel_context intel;
-
- GLuint last_index;
-
- struct i830_hw_state meta, initial, state, *current;
-};
-
-typedef struct i830_context *i830ContextPtr;
-typedef struct i830_texture_object *i830TextureObjectPtr;
-
-#define I830_CONTEXT(ctx) ((i830ContextPtr)(ctx))
-
-
-
-#define I830_STATECHANGE(i830, flag) \
-do { \
- INTEL_FIREVERTICES( &i830->intel ); \
- i830->state.emitted &= ~flag; \
-} while (0)
-
-#define I830_ACTIVESTATE(i830, flag, mode) \
-do { \
- INTEL_FIREVERTICES( &i830->intel ); \
- if (mode) \
- i830->state.active |= flag; \
- else \
- i830->state.active &= ~flag; \
-} while (0)
-
-/* i830_vtbl.c
- */
-extern void
-i830InitVtbl( i830ContextPtr i830 );
-
-/* i830_context.c
- */
-extern GLboolean
-i830CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-/* i830_tex.c, i830_texstate.c
- */
-extern void
-i830UpdateTextureState( intelContextPtr intel );
-
-extern void
-i830InitTextureFuncs( struct dd_function_table *functions );
-
-extern intelTextureObjectPtr
-i830AllocTexObj( struct gl_texture_object *tObj );
-
-/* i830_texblend.c
- */
-extern GLuint i830SetTexEnvCombine(i830ContextPtr i830,
- const struct gl_tex_env_combine_state * combine, GLint blendUnit,
- GLuint texel_op, GLuint *state, const GLfloat *factor );
-
-extern void
-i830EmitTextureBlend( i830ContextPtr i830 );
-
-
-/* i830_state.c
- */
-extern void
-i830InitStateFuncs( struct dd_function_table *functions );
-
-extern void
-i830EmitState( i830ContextPtr i830 );
-
-extern void
-i830InitState( i830ContextPtr i830 );
-
-/* i830_metaops.c
- */
-extern GLboolean
-i830TryTextureReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels );
-
-extern GLboolean
-i830TryTextureDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels );
-
-extern void
-i830ClearWithTris( intelContextPtr intel, GLbitfield mask,
- GLboolean all, GLint cx, GLint cy, GLint cw, GLint ch);
-
-
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_metaops.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_metaops.c
deleted file mode 100644
index dd238378b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_metaops.c
+++ /dev/null
@@ -1,733 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "utils.h"
-
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-#include "intel_ioctl.h"
-
-#include "i830_context.h"
-#include "i830_reg.h"
-
-/* A large amount of state doesn't need to be uploaded.
- */
-#define ACTIVE (I830_UPLOAD_TEXBLEND(0) | \
- I830_UPLOAD_STIPPLE | \
- I830_UPLOAD_CTX | \
- I830_UPLOAD_BUFFERS | \
- I830_UPLOAD_TEX(0))
-
-
-#define SET_STATE( i830, STATE ) \
-do { \
- i830->current->emitted &= ~ACTIVE; \
- i830->current = &i830->STATE; \
- i830->current->emitted &= ~ACTIVE; \
-} while (0)
-
-/* Operations where the 3D engine is decoupled temporarily from the
- * current GL state and used for other purposes than simply rendering
- * incoming triangles.
- */
-static void set_initial_state( i830ContextPtr i830 )
-{
- memcpy(&i830->meta, &i830->initial, sizeof(i830->meta) );
- i830->meta.active = ACTIVE;
- i830->meta.emitted = 0;
-}
-
-
-static void set_no_depth_stencil_write( i830ContextPtr i830 )
-{
- /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE )
- */
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE;
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE;
-
-
- /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE )
- */
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE;
-
- i830->meta.emitted &= ~I830_UPLOAD_CTX;
-}
-
-/* Set stencil unit to replace always with the reference value.
- */
-static void set_stencil_replace( i830ContextPtr i830,
- GLuint s_mask,
- GLuint s_clear)
-{
- /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_TRUE )
- */
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE;
-
-
- /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE )
- */
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
- i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE;
-
- /* ctx->Driver.StencilMask( ctx, s_mask )
- */
- i830->meta.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK;
- i830->meta.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK((s_mask&0xff)));
-
- /* ctx->Driver.StencilOp( ctx, GL_REPLACE, GL_REPLACE, GL_REPLACE )
- */
- i830->meta.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK);
- i830->meta.Ctx[I830_CTXREG_STENCILTST] |=
- (ENABLE_STENCIL_PARMS |
- STENCIL_FAIL_OP(STENCILOP_REPLACE) |
- STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_REPLACE) |
- STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_REPLACE));
-
- /* ctx->Driver.StencilFunc( ctx, GL_ALWAYS, s_clear, ~0 )
- */
- i830->meta.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK;
- i830->meta.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(0xff));
-
- i830->meta.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK |
- ENABLE_STENCIL_TEST_FUNC_MASK);
- i830->meta.Ctx[I830_CTXREG_STENCILTST] |=
- (ENABLE_STENCIL_REF_VALUE |
- ENABLE_STENCIL_TEST_FUNC |
- STENCIL_REF_VALUE((s_clear&0xff)) |
- STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS));
-
-
-
- i830->meta.emitted &= ~I830_UPLOAD_CTX;
-}
-
-
-static void set_color_mask( i830ContextPtr i830, GLboolean state )
-{
- const GLuint mask = ((1 << WRITEMASK_RED_SHIFT) |
- (1 << WRITEMASK_GREEN_SHIFT) |
- (1 << WRITEMASK_BLUE_SHIFT) |
- (1 << WRITEMASK_ALPHA_SHIFT));
-
- if (state) {
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~mask;
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] |=
- (i830->state.Ctx[I830_CTXREG_ENABLES_2] & mask);
- }
- else
- i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= mask;
-
- i830->meta.emitted &= ~I830_UPLOAD_CTX;
-}
-
-/* Installs a one-stage passthrough texture blend pipeline. Is there
- * more that can be done to turn off texturing?
- */
-static void set_no_texture( i830ContextPtr i830 )
-{
- static const struct gl_tex_env_combine_state comb = {
- GL_NONE, GL_NONE,
- { GL_TEXTURE, 0, 0, }, { GL_TEXTURE, 0, 0, },
- { GL_SRC_COLOR, 0, 0 }, { GL_SRC_ALPHA, 0, 0 },
- 0, 0, 0, 0
- };
-
- i830->meta.TexBlendWordsUsed[0] =
- i830SetTexEnvCombine( i830, & comb, 0, TEXBLENDARG_TEXEL0,
- i830->meta.TexBlend[0], NULL);
-
- i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE;
- i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0);
-}
-
-/* Set up a single element blend stage for 'replace' texturing with no
- * funny ops.
- */
-static void enable_texture_blend_replace( i830ContextPtr i830,
- GLenum format )
-{
- static const struct gl_tex_env_combine_state comb = {
- GL_REPLACE, GL_REPLACE,
- { GL_TEXTURE, 0, 0, }, { GL_TEXTURE, 0, 0, },
- { GL_SRC_COLOR, 0, 0 }, { GL_SRC_ALPHA, 0, 0 },
- 0, 0, 1, 1
- };
-
- i830->meta.TexBlendWordsUsed[0] =
- i830SetTexEnvCombine( i830, & comb, 0, TEXBLENDARG_TEXEL0,
- i830->meta.TexBlend[0], NULL);
-
- i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE;
- i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0);
-
-/* fprintf(stderr, "%s: TexBlendWordsUsed[0]: %d\n", */
-/* __FUNCTION__, i830->meta.TexBlendWordsUsed[0]); */
-}
-
-
-
-/* Set up an arbitary piece of memory as a rectangular texture
- * (including the front or back buffer).
- */
-static void set_tex_rect_source( i830ContextPtr i830,
- GLuint offset,
- GLuint width,
- GLuint height,
- GLuint pitch,
- GLuint textureFormat )
-{
- GLint numLevels = 1;
- GLuint *setup = i830->meta.Tex[0];
-
- pitch *= i830->intel.intelScreen->cpp;
-
-/* fprintf(stderr, "%s: offset: %x w: %d h: %d pitch %d format %x\n", */
-/* __FUNCTION__, offset, width, height, pitch, textureFormat ); */
-
- setup[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
- (LOAD_TEXTURE_MAP0 << 0) | 4);
- setup[I830_TEXREG_TM0S0] = (TM0S0_USE_FENCE | offset);
- setup[I830_TEXREG_TM0S1] = (((height - 1) << TM0S1_HEIGHT_SHIFT) |
- ((width - 1) << TM0S1_WIDTH_SHIFT) |
- textureFormat);
- setup[I830_TEXREG_TM0S2] = ((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT));
- setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAX_MIP_MASK;
- setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_MIP_MASK;
- setup[I830_TEXREG_TM0S3] |= ((numLevels - 1)*4) << TM0S3_MIN_MIP_SHIFT;
-
- setup[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD |
- MAP_UNIT(0) |
- ENABLE_TEXCOORD_PARAMS |
- TEXCOORDS_ARE_IN_TEXELUNITS |
- TEXCOORDTYPE_CARTESIAN |
- ENABLE_ADDR_V_CNTL |
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) |
- ENABLE_ADDR_U_CNTL |
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP));
-
- i830->meta.emitted &= ~I830_UPLOAD_TEX(0);
-}
-
-
-/* Select between front and back draw buffers.
- */
-static void set_draw_offset( i830ContextPtr i830,
- GLuint offset )
-{
- i830->meta.Buffer[I830_DESTREG_CBUFADDR2] = offset;
- i830->meta.emitted &= ~I830_UPLOAD_BUFFERS;
-}
-
-/* Setup an arbitary draw format, useful for targeting
- * texture or agp memory.
- */
-static void set_draw_format( i830ContextPtr i830,
- GLuint format,
- GLuint depth_format)
-{
- i830->meta.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- format |
- DEPTH_IS_Z |
- depth_format);
-}
-
-
-static void set_vertex_format( i830ContextPtr i830 )
-{
- i830->meta.Ctx[I830_CTXREG_VF] = (_3DSTATE_VFT0_CMD |
- VFT0_TEX_COUNT(1) |
- VFT0_DIFFUSE |
- VFT0_SPEC |
- VFT0_XYZW);
- i830->meta.Ctx[I830_CTXREG_VF2] = (_3DSTATE_VFT1_CMD |
- VFT1_TEX0_FMT(TEXCOORDFMT_2D) |
- VFT1_TEX1_FMT(TEXCOORDFMT_2D) |
- VFT1_TEX2_FMT(TEXCOORDFMT_2D) |
- VFT1_TEX3_FMT(TEXCOORDFMT_2D));
- i830->meta.emitted &= ~I830_UPLOAD_CTX;
-}
-
-
-static void draw_quad(i830ContextPtr i830,
- GLfloat x0, GLfloat x1,
- GLfloat y0, GLfloat y1,
- GLubyte red, GLubyte green,
- GLubyte blue, GLubyte alpha,
- GLfloat s0, GLfloat s1,
- GLfloat t0, GLfloat t1 )
-{
- GLuint vertex_size = 8;
- GLuint *vb = intelEmitInlinePrimitiveLocked( &i830->intel,
- PRIM3D_TRIFAN,
- 4*vertex_size,
- vertex_size );
- intelVertex tmp;
- int i;
-
-
-/* fprintf(stderr, "%s: %f,%f-%f,%f 0x%x%x%x%x %f,%f-%f,%f\n", */
-/* __FUNCTION__, */
-/* x0,y0,x1,y1,red,green,blue,alpha,s0,t0,s1,t1); */
-
-
- /* initial vertex, left bottom */
- tmp.v.x = x0;
- tmp.v.y = y0;
- tmp.v.z = 1.0;
- tmp.v.w = 1.0;
- tmp.v.color.red = red;
- tmp.v.color.green = green;
- tmp.v.color.blue = blue;
- tmp.v.color.alpha = alpha;
- tmp.v.specular.red = 0;
- tmp.v.specular.green = 0;
- tmp.v.specular.blue = 0;
- tmp.v.specular.alpha = 0;
- tmp.v.u0 = s0;
- tmp.v.v0 = t0;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
- /* right bottom */
- vb += 8;
- tmp.v.x = x1;
- tmp.v.u0 = s1;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
- /* right top */
- vb += 8;
- tmp.v.y = y1;
- tmp.v.v0 = t1;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
- /* left top */
- vb += 8;
- tmp.v.x = x0;
- tmp.v.u0 = s0;
- for (i = 0 ; i < 8 ; i++)
- vb[i] = tmp.ui[i];
-
-/* fprintf(stderr, "%s: DV1: %x\n", */
-/* __FUNCTION__, i830->meta.Buffer[I830_DESTREG_DV1]); */
-}
-
-void
-i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
-{
- i830ContextPtr i830 = I830_CONTEXT( intel );
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- intelScreenPrivate *screen = intel->intelScreen;
- int x0, y0, x1, y1;
-
-
- SET_STATE( i830, meta );
- set_initial_state( i830 );
- set_no_texture( i830 );
- set_vertex_format( i830 );
-
- LOCK_HARDWARE(intel);
-
- if(!all) {
- x0 = cx;
- y0 = cy;
- x1 = x0 + cw;
- y1 = y0 + ch;
- } else {
- x0 = 0;
- y0 = 0;
- x1 = x0 + dPriv->w;
- y1 = y0 + dPriv->h;
- }
-
- /* Don't do any clipping to screen - these are window coordinates.
- * The active cliprects will be applied as for any other geometry.
- */
-
- if(mask & BUFFER_BIT_FRONT_LEFT) {
- set_no_depth_stencil_write( i830 );
- set_color_mask( i830, GL_TRUE );
- set_draw_offset( i830, screen->frontOffset );
- draw_quad(i830, x0, x1, y0, y1,
- intel->clear_red, intel->clear_green,
- intel->clear_blue, intel->clear_alpha,
- 0, 0, 0, 0);
- }
-
- if(mask & BUFFER_BIT_BACK_LEFT) {
- set_no_depth_stencil_write( i830 );
- set_color_mask( i830, GL_TRUE );
- set_draw_offset( i830, screen->backOffset );
-
- draw_quad(i830, x0, x1, y0, y1,
- intel->clear_red, intel->clear_green,
- intel->clear_blue, intel->clear_alpha,
- 0, 0, 0, 0);
- }
-
- if(mask & BUFFER_BIT_STENCIL) {
- set_stencil_replace( i830,
- intel->ctx.Stencil.WriteMask[0],
- intel->ctx.Stencil.Clear);
-
- set_color_mask( i830, GL_FALSE );
- set_draw_offset( i830, screen->frontOffset );
- draw_quad( i830, x0, x1, y0, y1, 0, 0, 0, 0, 0, 0, 0, 0 );
- }
-
- UNLOCK_HARDWARE(intel);
-
- SET_STATE( i830, state );
-}
-
-
-
-
-GLboolean
-i830TryTextureReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- intelScreenPrivate *screen = i830->intel.intelScreen;
- GLint pitch = pack->RowLength ? pack->RowLength : width;
- __DRIdrawablePrivate *dPriv = i830->intel.driDrawable;
- int textureFormat;
- GLenum glTextureFormat;
- int src_offset = i830->meta.Buffer[I830_DESTREG_CBUFADDR2];
- int destOffset = intelAgpOffsetFromVirtual( &i830->intel, pixels);
- int destFormat, depthFormat, destPitch;
- drm_clip_rect_t tmp;
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
- if ( ctx->_ImageTransferState ||
- pack->SwapBytes ||
- pack->LsbFirst ||
- !pack->Invert) {
- fprintf(stderr, "%s: check_color failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- switch (screen->fbFormat) {
- case DV_PF_565:
- textureFormat = MAPSURF_16BIT | MT_16BIT_RGB565;
- glTextureFormat = GL_RGB;
- break;
- case DV_PF_555:
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB1555;
- glTextureFormat = GL_RGBA;
- break;
- case DV_PF_8888:
- textureFormat = MAPSURF_32BIT | MT_32BIT_ARGB8888;
- glTextureFormat = GL_RGBA;
- break;
- default:
- fprintf(stderr, "%s: textureFormat failed %x\n", __FUNCTION__,
- screen->fbFormat);
- return GL_FALSE;
- }
-
-
- switch (type) {
- case GL_UNSIGNED_SHORT_5_6_5:
- if (format != GL_RGB) return GL_FALSE;
- destFormat = COLR_BUF_RGB565;
- depthFormat = DEPTH_FRMT_16_FIXED;
- destPitch = pitch * 2;
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- if (format != GL_BGRA) return GL_FALSE;
- destFormat = COLR_BUF_ARGB8888;
- depthFormat = DEPTH_FRMT_24_FIXED_8_OTHER;
- destPitch = pitch * 4;
- break;
- default:
- fprintf(stderr, "%s: destFormat failed %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(type));
- return GL_FALSE;
- }
-
- destFormat |= (0x02<<24);
-
-/* fprintf(stderr, "type: %s destFormat: %x\n", */
-/* _mesa_lookup_enum_by_nr(type), */
-/* destFormat); */
-
- intelFlush( ctx );
-
- SET_STATE( i830, meta );
- set_initial_state( i830 );
- set_no_depth_stencil_write( i830 );
-
- LOCK_HARDWARE( intel );
- {
- intelWaitForIdle( intel ); /* required by GL */
-
- if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
- UNLOCK_HARDWARE( intel );
- SET_STATE(i830, state);
- fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
- return GL_TRUE;
- }
-
-#if 0
- /* FIXME -- Just emit the correct state
- */
- if (i830SetParam(i830->driFd, I830_SETPARAM_CBUFFER_PITCH,
- destPitch) != 0) {
- UNLOCK_HARDWARE( intel );
- SET_STATE(i830, state);
- fprintf(stderr, "%s: setparam failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-#endif
-
-
- y = dPriv->h - y - height;
- x += dPriv->x;
- y += dPriv->y;
-
-
- /* Set the frontbuffer up as a large rectangular texture.
- */
- set_tex_rect_source( i830,
- src_offset,
- screen->width,
- screen->height,
- screen->frontPitch,
- textureFormat );
-
-
- enable_texture_blend_replace( i830, glTextureFormat );
-
-
- /* Set the 3d engine to draw into the agp memory
- */
-
- set_draw_offset( i830, destOffset );
- set_draw_format( i830, destFormat, depthFormat );
-
-
- /* Draw a single quad, no cliprects:
- */
- i830->intel.numClipRects = 1;
- i830->intel.pClipRects = &tmp;
- i830->intel.pClipRects[0].x1 = 0;
- i830->intel.pClipRects[0].y1 = 0;
- i830->intel.pClipRects[0].x2 = width;
- i830->intel.pClipRects[0].y2 = height;
-
- draw_quad( i830,
- 0, width, 0, height,
- 0, 255, 0, 0,
- x, x+width, y, y+height );
-
- intelWindowMoved( intel );
- }
- UNLOCK_HARDWARE( intel );
- intelFinish( ctx ); /* required by GL */
-
- SET_STATE( i830, state );
- return GL_TRUE;
-}
-
-
-GLboolean
-i830TryTextureDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- GLint pitch = unpack->RowLength ? unpack->RowLength : width;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- int textureFormat;
- GLenum glTextureFormat;
- int dst_offset = i830->meta.Buffer[I830_DESTREG_CBUFADDR2];
- int src_offset = intelAgpOffsetFromVirtual( intel, pixels );
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* Todo -- upload images that aren't in agp space, then texture
- * from them.
- */
-
- if ( !intelIsAgpMemory( intel, pixels, pitch*height ) ) {
- fprintf(stderr, "%s: intelIsAgpMemory failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- /* Todo -- don't want to clobber all the drawing state like we do
- * for readpixels -- most of this state can be handled just fine.
- */
- if ( ctx->_ImageTransferState ||
- unpack->SwapBytes ||
- unpack->LsbFirst ||
- ctx->Color.AlphaEnabled ||
- ctx->Depth.Test ||
- ctx->Fog.Enabled ||
- ctx->Scissor.Enabled ||
- ctx->Stencil.Enabled ||
- !ctx->Color.ColorMask[0] ||
- !ctx->Color.ColorMask[1] ||
- !ctx->Color.ColorMask[2] ||
- !ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits ||
- ctx->Depth.OcclusionTest) {
- fprintf(stderr, "%s: other tests failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- /* Todo -- remove these restrictions:
- */
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != -1.0F)
- return GL_FALSE;
-
-
-
- switch (type) {
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- if (format != GL_BGRA) return GL_FALSE;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB1555;
- glTextureFormat = GL_RGBA;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- if (format != GL_RGB) return GL_FALSE;
- textureFormat = MAPSURF_16BIT | MT_16BIT_RGB565;
- glTextureFormat = GL_RGB;
- break;
- case GL_UNSIGNED_SHORT_8_8_MESA:
- if (format != GL_YCBCR_MESA) return GL_FALSE;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_SWAPY
-/* | TM0S1_COLORSPACE_CONVERSION */
- );
- glTextureFormat = GL_YCBCR_MESA;
- break;
- case GL_UNSIGNED_SHORT_8_8_REV_MESA:
- if (format != GL_YCBCR_MESA) return GL_FALSE;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_NORMAL
-/* | TM0S1_COLORSPACE_CONVERSION */
- );
- glTextureFormat = GL_YCBCR_MESA;
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- if (format != GL_BGRA) return GL_FALSE;
- textureFormat = MAPSURF_32BIT | MT_32BIT_ARGB8888;
- glTextureFormat = GL_RGBA;
- break;
- default:
- fprintf(stderr, "%s: destFormat failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- intelFlush( ctx );
-
- SET_STATE( i830, meta );
-
- LOCK_HARDWARE( intel );
- {
- intelWaitForIdle( intel ); /* required by GL */
-
- y -= height; /* cope with pixel zoom */
-
- if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) {
- UNLOCK_HARDWARE( intel );
- SET_STATE(i830, state);
- fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__);
- return GL_TRUE;
- }
-
-
- y = dPriv->h - y - height;
-
- set_initial_state( i830 );
-
- /* Set the pixel image up as a rectangular texture.
- */
- set_tex_rect_source( i830,
- src_offset,
- width,
- height,
- pitch, /* XXXX!!!! -- /2 sometimes */
- textureFormat );
-
-
- enable_texture_blend_replace( i830, glTextureFormat );
-
-
- /* Draw to the current draw buffer:
- */
- set_draw_offset( i830, dst_offset );
-
- /* Draw a quad, use regular cliprects
- */
-/* fprintf(stderr, "x: %d y: %d width %d height %d\n", x, y, width, height); */
-
- draw_quad( i830,
- x, x+width, y, y+height,
- 0, 255, 0, 0,
- 0, width, 0, height );
-
- intelWindowMoved( intel );
- }
- UNLOCK_HARDWARE( intel );
- intelFinish( ctx ); /* required by GL */
-
- SET_STATE(i830, state);
-
- return GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_reg.h
deleted file mode 100644
index c45b88ca5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_reg.h
+++ /dev/null
@@ -1,641 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#ifndef _I830_REG_H_
-#define _I830_REG_H_
-
-
-#include "intel_reg.h"
-
-#define I830_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value)
-
-#define _3DSTATE_AA_CMD (CMD_3D | (0x06<<24))
-#define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16)
-#define AA_LINE_ECAAR_WIDTH_0_5 0
-#define AA_LINE_ECAAR_WIDTH_1_0 (1<<14)
-#define AA_LINE_ECAAR_WIDTH_2_0 (2<<14)
-#define AA_LINE_ECAAR_WIDTH_4_0 (3<<14)
-#define AA_LINE_REGION_WIDTH_ENABLE (1<<8)
-#define AA_LINE_REGION_WIDTH_0_5 0
-#define AA_LINE_REGION_WIDTH_1_0 (1<<6)
-#define AA_LINE_REGION_WIDTH_2_0 (2<<6)
-#define AA_LINE_REGION_WIDTH_4_0 (3<<6)
-#define AA_LINE_ENABLE ((1<<1) | 1)
-#define AA_LINE_DISABLE (1<<1)
-
-#define _3DSTATE_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1)
-/* Dword 1 */
-#define BUF_3D_ID_COLOR_BACK (0x3<<24)
-#define BUF_3D_ID_DEPTH (0x7<<24)
-#define BUF_3D_USE_FENCE (1<<23)
-#define BUF_3D_TILED_SURFACE (1<<22)
-#define BUF_3D_TILE_WALK_X 0
-#define BUF_3D_TILE_WALK_Y (1<<21)
-#define BUF_3D_PITCH(x) (((x)/4)<<2)
-/* Dword 2 */
-#define BUF_3D_ADDR(x) ((x) & ~0x3)
-
-
-#define _3DSTATE_COLOR_FACTOR_CMD (CMD_3D | (0x1d<<24) | (0x1<<16))
-
-#define _3DSTATE_COLOR_FACTOR_N_CMD(stage) (CMD_3D | (0x1d<<24) | \
- ((0x90+(stage))<<16))
-
-#define _3DSTATE_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16))
-
-#define _3DSTATE_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16))
-
-#define _3DSTATE_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16))
-
-#define _3DSTATE_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16))
-
-
-#define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16))
-/* Dword 1 */
-#define DSTORG_HORT_BIAS(x) ((x)<<20)
-#define DSTORG_VERT_BIAS(x) ((x)<<16)
-#define COLOR_4_2_2_CHNL_WRT_ALL 0
-#define COLOR_4_2_2_CHNL_WRT_Y (1<<12)
-#define COLOR_4_2_2_CHNL_WRT_CR (2<<12)
-#define COLOR_4_2_2_CHNL_WRT_CB (3<<12)
-#define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12)
-#define COLR_BUF_8BIT 0
-#define COLR_BUF_RGB555 (1<<8)
-#define COLR_BUF_RGB565 (2<<8)
-#define COLR_BUF_ARGB8888 (3<<8)
-#define DEPTH_IS_Z 0
-#define DEPTH_IS_W (1<<6)
-#define DEPTH_FRMT_16_FIXED 0
-#define DEPTH_FRMT_16_FLOAT (1<<2)
-#define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2)
-#define DEPTH_FRMT_24_FLOAT_8_OTHER (3<<2)
-#define VERT_LINE_STRIDE_1 (1<<1)
-#define VERT_LINE_STRIDE_0 0
-#define VERT_LINE_STRIDE_OFS_1 1
-#define VERT_LINE_STRIDE_OFS_0 0
-
-
-#define _3DSTATE_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3)
-/* Dword 1 */
-#define DRAW_RECT_DIS_DEPTH_OFS (1<<30)
-#define DRAW_DITHER_OFS_X(x) ((x)<<26)
-#define DRAW_DITHER_OFS_Y(x) ((x)<<24)
-/* Dword 2 */
-#define DRAW_YMIN(x) ((x)<<16)
-#define DRAW_XMIN(x) (x)
-/* Dword 3 */
-#define DRAW_YMAX(x) ((x)<<16)
-#define DRAW_XMAX(x) (x)
-/* Dword 4 */
-#define DRAW_YORG(x) ((x)<<16)
-#define DRAW_XORG(x) (x)
-
-
-#define _3DSTATE_ENABLES_1_CMD (CMD_3D|(0x3<<24))
-#define ENABLE_LOGIC_OP_MASK ((1<<23)|(1<<22))
-#define ENABLE_LOGIC_OP ((1<<23)|(1<<22))
-#define DISABLE_LOGIC_OP (1<<23)
-#define ENABLE_STENCIL_TEST ((1<<21)|(1<<20))
-#define DISABLE_STENCIL_TEST (1<<21)
-#define ENABLE_DEPTH_BIAS ((1<<11)|(1<<10))
-#define DISABLE_DEPTH_BIAS (1<<11)
-#define ENABLE_SPEC_ADD_MASK ((1<<9)|(1<<8))
-#define ENABLE_SPEC_ADD ((1<<9)|(1<<8))
-#define DISABLE_SPEC_ADD (1<<9)
-#define ENABLE_DIS_FOG_MASK ((1<<7)|(1<<6))
-#define ENABLE_FOG ((1<<7)|(1<<6))
-#define DISABLE_FOG (1<<7)
-#define ENABLE_DIS_ALPHA_TEST_MASK ((1<<5)|(1<<4))
-#define ENABLE_ALPHA_TEST ((1<<5)|(1<<4))
-#define DISABLE_ALPHA_TEST (1<<5)
-#define ENABLE_DIS_CBLEND_MASK ((1<<3)|(1<<2))
-#define ENABLE_COLOR_BLEND ((1<<3)|(1<<2))
-#define DISABLE_COLOR_BLEND (1<<3)
-#define ENABLE_DIS_DEPTH_TEST_MASK ((1<<1)|1)
-#define ENABLE_DEPTH_TEST ((1<<1)|1)
-#define DISABLE_DEPTH_TEST (1<<1)
-
-/* _3DSTATE_ENABLES_2, p138 */
-#define _3DSTATE_ENABLES_2_CMD (CMD_3D|(0x4<<24))
-#define ENABLE_STENCIL_WRITE ((1<<21)|(1<<20))
-#define DISABLE_STENCIL_WRITE (1<<21)
-#define ENABLE_TEX_CACHE ((1<<17)|(1<<16))
-#define DISABLE_TEX_CACHE (1<<17)
-#define ENABLE_DITHER ((1<<9)|(1<<8))
-#define DISABLE_DITHER (1<<9)
-#define ENABLE_COLOR_MASK (1<<10)
-#define WRITEMASK_ALPHA (1<<7)
-#define WRITEMASK_ALPHA_SHIFT 7
-#define WRITEMASK_RED (1<<6)
-#define WRITEMASK_RED_SHIFT 6
-#define WRITEMASK_GREEN (1<<5)
-#define WRITEMASK_GREEN_SHIFT 5
-#define WRITEMASK_BLUE (1<<4)
-#define WRITEMASK_BLUE_SHIFT 4
-#define WRITEMASK_MASK ((1<<4)|(1<<5)|(1<<6)|(1<<7))
-#define ENABLE_COLOR_WRITE ((1<<3)|(1<<2))
-#define DISABLE_COLOR_WRITE (1<<3)
-#define ENABLE_DIS_DEPTH_WRITE_MASK 0x3
-#define ENABLE_DEPTH_WRITE ((1<<1)|1)
-#define DISABLE_DEPTH_WRITE (1<<1)
-
-/* _3DSTATE_FOG_COLOR, p139 */
-#define _3DSTATE_FOG_COLOR_CMD (CMD_3D|(0x15<<24))
-#define FOG_COLOR_RED(x) ((x)<<16)
-#define FOG_COLOR_GREEN(x) ((x)<<8)
-#define FOG_COLOR_BLUE(x) (x)
-
-/* _3DSTATE_FOG_MODE, p140 */
-#define _3DSTATE_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2)
-/* Dword 1 */
-#define FOGFUNC_ENABLE (1<<31)
-#define FOGFUNC_VERTEX 0
-#define FOGFUNC_PIXEL_EXP (1<<28)
-#define FOGFUNC_PIXEL_EXP2 (2<<28)
-#define FOGFUNC_PIXEL_LINEAR (3<<28)
-#define FOGSRC_INDEX_Z (1<<27)
-#define FOGSRC_INDEX_W ((1<<27)|(1<<25))
-#define FOG_LINEAR_CONST (1<<24)
-#define FOG_CONST_1(x) ((x)<<4)
-#define ENABLE_FOG_DENSITY (1<<23)
-/* Dword 2 */
-#define FOG_CONST_2(x) (x)
-/* Dword 3 */
-#define FOG_DENSITY(x) (x)
-
-/* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p142 */
-#define _3DSTATE_INDPT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24))
-#define ENABLE_INDPT_ALPHA_BLEND ((1<<23)|(1<<22))
-#define DISABLE_INDPT_ALPHA_BLEND (1<<23)
-#define ALPHA_BLENDFUNC_MASK 0x3f0000
-#define ENABLE_ALPHA_BLENDFUNC (1<<21)
-#define ABLENDFUNC_ADD 0
-#define ABLENDFUNC_SUB (1<<16)
-#define ABLENDFUNC_RVSE_SUB (2<<16)
-#define ABLENDFUNC_MIN (3<<16)
-#define ABLENDFUNC_MAX (4<<16)
-#define SRC_DST_ABLEND_MASK 0xfff
-#define ENABLE_SRC_ABLEND_FACTOR (1<<11)
-#define SRC_ABLEND_FACT(x) ((x)<<6)
-#define ENABLE_DST_ABLEND_FACTOR (1<<5)
-#define DST_ABLEND_FACT(x) (x)
-
-
-/* _3DSTATE_MAP_BLEND_ARG, p152 */
-#define _3DSTATE_MAP_BLEND_ARG_CMD(stage) (CMD_3D|(0x0e<<24)|((stage)<<20))
-
-#define TEXPIPE_COLOR 0
-#define TEXPIPE_ALPHA (1<<18)
-#define TEXPIPE_KILL (2<<18)
-#define TEXBLEND_ARG0 0
-#define TEXBLEND_ARG1 (1<<15)
-#define TEXBLEND_ARG2 (2<<15)
-#define TEXBLEND_ARG3 (3<<15)
-#define TEXBLENDARG_MODIFY_PARMS (1<<6)
-#define TEXBLENDARG_REPLICATE_ALPHA (1<<5)
-#define TEXBLENDARG_INV_ARG (1<<4)
-#define TEXBLENDARG_ONE 0
-#define TEXBLENDARG_FACTOR 0x01
-#define TEXBLENDARG_ACCUM 0x02
-#define TEXBLENDARG_DIFFUSE 0x03
-#define TEXBLENDARG_SPEC 0x04
-#define TEXBLENDARG_CURRENT 0x05
-#define TEXBLENDARG_TEXEL0 0x06
-#define TEXBLENDARG_TEXEL1 0x07
-#define TEXBLENDARG_TEXEL2 0x08
-#define TEXBLENDARG_TEXEL3 0x09
-#define TEXBLENDARG_FACTOR_N 0x0e
-
-/* _3DSTATE_MAP_BLEND_OP, p155 */
-#define _3DSTATE_MAP_BLEND_OP_CMD(stage) (CMD_3D|(0x0d<<24)|((stage)<<20))
-#if 0
-# define TEXPIPE_COLOR 0
-# define TEXPIPE_ALPHA (1<<18)
-# define TEXPIPE_KILL (2<<18)
-#endif
-#define ENABLE_TEXOUTPUT_WRT_SEL (1<<17)
-#define TEXOP_OUTPUT_CURRENT 0
-#define TEXOP_OUTPUT_ACCUM (1<<15)
-#define ENABLE_TEX_CNTRL_STAGE ((1<<12)|(1<<11))
-#define DISABLE_TEX_CNTRL_STAGE (1<<12)
-#define TEXOP_SCALE_SHIFT 9
-#define TEXOP_SCALE_1X (0 << TEXOP_SCALE_SHIFT)
-#define TEXOP_SCALE_2X (1 << TEXOP_SCALE_SHIFT)
-#define TEXOP_SCALE_4X (2 << TEXOP_SCALE_SHIFT)
-#define TEXOP_MODIFY_PARMS (1<<8)
-#define TEXOP_LAST_STAGE (1<<7)
-#define TEXBLENDOP_KILLPIXEL 0x02
-#define TEXBLENDOP_ARG1 0x01
-#define TEXBLENDOP_ARG2 0x02
-#define TEXBLENDOP_MODULATE 0x03
-#define TEXBLENDOP_ADD 0x06
-#define TEXBLENDOP_ADDSIGNED 0x07
-#define TEXBLENDOP_BLEND 0x08
-#define TEXBLENDOP_BLEND_AND_ADD 0x09
-#define TEXBLENDOP_SUBTRACT 0x0a
-#define TEXBLENDOP_DOT3 0x0b
-#define TEXBLENDOP_DOT4 0x0c
-#define TEXBLENDOP_MODULATE_AND_ADD 0x0d
-#define TEXBLENDOP_MODULATE_2X_AND_ADD 0x0e
-#define TEXBLENDOP_MODULATE_4X_AND_ADD 0x0f
-
-/* _3DSTATE_MAP_BUMP_TABLE, p160 TODO */
-/* _3DSTATE_MAP_COLOR_CHROMA_KEY, p161 TODO */
-
-#define _3DSTATE_MAP_COORD_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8c<<16))
-#define DISABLE_TEX_TRANSFORM (1<<28)
-#define TEXTURE_SET(x) (x<<29)
-
-#define _3DSTATE_VERTEX_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8b<<16))
-#define DISABLE_VIEWPORT_TRANSFORM (1<<31)
-#define DISABLE_PERSPECTIVE_DIVIDE (1<<29)
-
-
-/* _3DSTATE_MAP_COORD_SET_BINDINGS, p162 */
-#define _3DSTATE_MAP_COORD_SETBIND_CMD (CMD_3D|(0x1d<<24)|(0x02<<16))
-#define TEXBIND_MASK3 ((1<<15)|(1<<14)|(1<<13)|(1<<12))
-#define TEXBIND_MASK2 ((1<<11)|(1<<10)|(1<<9)|(1<<8))
-#define TEXBIND_MASK1 ((1<<7)|(1<<6)|(1<<5)|(1<<4))
-#define TEXBIND_MASK0 ((1<<3)|(1<<2)|(1<<1)|1)
-
-#define TEXBIND_SET3(x) ((x)<<12)
-#define TEXBIND_SET2(x) ((x)<<8)
-#define TEXBIND_SET1(x) ((x)<<4)
-#define TEXBIND_SET0(x) (x)
-
-#define TEXCOORDSRC_KEEP 0
-#define TEXCOORDSRC_DEFAULT 0x01
-#define TEXCOORDSRC_VTXSET_0 0x08
-#define TEXCOORDSRC_VTXSET_1 0x09
-#define TEXCOORDSRC_VTXSET_2 0x0a
-#define TEXCOORDSRC_VTXSET_3 0x0b
-#define TEXCOORDSRC_VTXSET_4 0x0c
-#define TEXCOORDSRC_VTXSET_5 0x0d
-#define TEXCOORDSRC_VTXSET_6 0x0e
-#define TEXCOORDSRC_VTXSET_7 0x0f
-
-#define MAP_UNIT(unit) ((unit)<<16)
-#define MAP_UNIT_MASK (0x7<<16)
-
-/* _3DSTATE_MAP_COORD_SETS, p164 */
-#define _3DSTATE_MAP_COORD_SET_CMD (CMD_3D|(0x1c<<24)|(0x01<<19))
-#define ENABLE_TEXCOORD_PARAMS (1<<15)
-#define TEXCOORDS_ARE_NORMAL (1<<14)
-#define TEXCOORDS_ARE_IN_TEXELUNITS 0
-#define TEXCOORDTYPE_CARTESIAN 0
-#define TEXCOORDTYPE_HOMOGENEOUS (1<<11)
-#define TEXCOORDTYPE_VECTOR (2<<11)
-#define TEXCOORDTYPE_MASK (0x7<<11)
-#define ENABLE_ADDR_V_CNTL (1<<7)
-#define ENABLE_ADDR_U_CNTL (1<<3)
-#define TEXCOORD_ADDR_V_MODE(x) ((x)<<4)
-#define TEXCOORD_ADDR_U_MODE(x) (x)
-#define TEXCOORDMODE_WRAP 0
-#define TEXCOORDMODE_MIRROR 1
-#define TEXCOORDMODE_CLAMP 2
-#define TEXCOORDMODE_WRAP_SHORTEST 3
-#define TEXCOORDMODE_CLAMP_BORDER 4
-#define TEXCOORD_ADDR_V_MASK 0x70
-#define TEXCOORD_ADDR_U_MASK 0x7
-
-/* _3DSTATE_MAP_CUBE, p168 TODO */
-#define _3DSTATE_MAP_CUBE (CMD_3D|(0x1c<<24)|(0x0a<<19))
-#define CUBE_NEGX_ENABLE (1<<5)
-#define CUBE_POSX_ENABLE (1<<4)
-#define CUBE_NEGY_ENABLE (1<<3)
-#define CUBE_POSY_ENABLE (1<<2)
-#define CUBE_NEGZ_ENABLE (1<<1)
-#define CUBE_POSZ_ENABLE (1<<0)
-
-
-/* _3DSTATE_MODES_1, p190 */
-#define _3DSTATE_MODES_1_CMD (CMD_3D|(0x08<<24))
-#define BLENDFUNC_MASK 0x3f0000
-#define ENABLE_COLR_BLND_FUNC (1<<21)
-#define BLENDFUNC_ADD 0
-#define BLENDFUNC_SUB (1<<16)
-#define BLENDFUNC_RVRSE_SUB (2<<16)
-#define BLENDFUNC_MIN (3<<16)
-#define BLENDFUNC_MAX (4<<16)
-#define SRC_DST_BLND_MASK 0xfff
-#define ENABLE_SRC_BLND_FACTOR (1<<11)
-#define ENABLE_DST_BLND_FACTOR (1<<5)
-#define SRC_BLND_FACT(x) ((x)<<6)
-#define DST_BLND_FACT(x) (x)
-
-
-/* _3DSTATE_MODES_2, p192 */
-#define _3DSTATE_MODES_2_CMD (CMD_3D|(0x0f<<24))
-#define ENABLE_GLOBAL_DEPTH_BIAS (1<<22)
-#define GLOBAL_DEPTH_BIAS(x) ((x)<<14)
-#define ENABLE_ALPHA_TEST_FUNC (1<<13)
-#define ENABLE_ALPHA_REF_VALUE (1<<8)
-#define ALPHA_TEST_FUNC(x) ((x)<<9)
-#define ALPHA_REF_VALUE(x) (x)
-
-#define ALPHA_TEST_REF_MASK 0x3fff
-
-/* _3DSTATE_MODES_3, p193 */
-#define _3DSTATE_MODES_3_CMD (CMD_3D|(0x02<<24))
-#define DEPTH_TEST_FUNC_MASK 0x1f0000
-#define ENABLE_DEPTH_TEST_FUNC (1<<20)
-/* Uses COMPAREFUNC */
-#define DEPTH_TEST_FUNC(x) ((x)<<16)
-#define ENABLE_ALPHA_SHADE_MODE (1<<11)
-#define ENABLE_FOG_SHADE_MODE (1<<9)
-#define ENABLE_SPEC_SHADE_MODE (1<<7)
-#define ENABLE_COLOR_SHADE_MODE (1<<5)
-#define ALPHA_SHADE_MODE(x) ((x)<<10)
-#define FOG_SHADE_MODE(x) ((x)<<8)
-#define SPEC_SHADE_MODE(x) ((x)<<6)
-#define COLOR_SHADE_MODE(x) ((x)<<4)
-#define CULLMODE_MASK 0xf
-#define ENABLE_CULL_MODE (1<<3)
-#define CULLMODE_BOTH 0
-#define CULLMODE_NONE 1
-#define CULLMODE_CW 2
-#define CULLMODE_CCW 3
-
-#define SHADE_MODE_LINEAR 0
-#define SHADE_MODE_FLAT 0x1
-
-/* _3DSTATE_MODES_4, p195 */
-#define _3DSTATE_MODES_4_CMD (CMD_3D|(0x16<<24))
-#define ENABLE_LOGIC_OP_FUNC (1<<23)
-#define LOGIC_OP_FUNC(x) ((x)<<18)
-#define LOGICOP_MASK ((1<<18)|(1<<19)|(1<<20)|(1<<21))
-#define LOGICOP_CLEAR 0
-#define LOGICOP_NOR 0x1
-#define LOGICOP_AND_INV 0x2
-#define LOGICOP_COPY_INV 0x3
-#define LOGICOP_AND_RVRSE 0x4
-#define LOGICOP_INV 0x5
-#define LOGICOP_XOR 0x6
-#define LOGICOP_NAND 0x7
-#define LOGICOP_AND 0x8
-#define LOGICOP_EQUIV 0x9
-#define LOGICOP_NOOP 0xa
-#define LOGICOP_OR_INV 0xb
-#define LOGICOP_COPY 0xc
-#define LOGICOP_OR_RVRSE 0xd
-#define LOGICOP_OR 0xe
-#define LOGICOP_SET 0xf
-#define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00))
-#define ENABLE_STENCIL_TEST_MASK (1<<17)
-#define STENCIL_TEST_MASK(x) ((x)<<8)
-#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff))
-#define ENABLE_STENCIL_WRITE_MASK (1<<16)
-#define STENCIL_WRITE_MASK(x) (x)
-
-/* _3DSTATE_MODES_5, p196 */
-#define _3DSTATE_MODES_5_CMD (CMD_3D|(0x0c<<24))
-#define ENABLE_SPRITE_POINT_TEX (1<<23)
-#define SPRITE_POINT_TEX_ON (1<<22)
-#define SPRITE_POINT_TEX_OFF 0
-#define FLUSH_RENDER_CACHE (1<<18)
-#define FLUSH_TEXTURE_CACHE (1<<16)
-#define FIXED_LINE_WIDTH_MASK 0xfc00
-#define ENABLE_FIXED_LINE_WIDTH (1<<15)
-#define FIXED_LINE_WIDTH(x) ((x)<<10)
-#define FIXED_POINT_WIDTH_MASK 0x3ff
-#define ENABLE_FIXED_POINT_WIDTH (1<<9)
-#define FIXED_POINT_WIDTH(x) (x)
-
-/* _3DSTATE_RASTERIZATION_RULES, p198 */
-#define _3DSTATE_RASTER_RULES_CMD (CMD_3D|(0x07<<24))
-#define ENABLE_POINT_RASTER_RULE (1<<15)
-#define OGL_POINT_RASTER_RULE (1<<13)
-#define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8)
-#define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5)
-#define ENABLE_TRI_STRIP_PROVOKE_VRTX (1<<2)
-#define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6)
-#define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3)
-#define TRI_STRIP_PROVOKE_VRTX(x) (x)
-
-/* _3DSTATE_SCISSOR_ENABLE, p200 */
-#define _3DSTATE_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19))
-#define ENABLE_SCISSOR_RECT ((1<<1) | 1)
-#define DISABLE_SCISSOR_RECT (1<<1)
-
-/* _3DSTATE_SCISSOR_RECTANGLE_0, p201 */
-#define _3DSTATE_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1)
-/* Dword 1 */
-#define SCISSOR_RECT_0_YMIN(x) ((x)<<16)
-#define SCISSOR_RECT_0_XMIN(x) (x)
-/* Dword 2 */
-#define SCISSOR_RECT_0_YMAX(x) ((x)<<16)
-#define SCISSOR_RECT_0_XMAX(x) (x)
-
-/* _3DSTATE_STENCIL_TEST, p202 */
-#define _3DSTATE_STENCIL_TEST_CMD (CMD_3D|(0x09<<24))
-#define ENABLE_STENCIL_PARMS (1<<23)
-#define STENCIL_OPS_MASK (0xffc000)
-#define STENCIL_FAIL_OP(x) ((x)<<20)
-#define STENCIL_PASS_DEPTH_FAIL_OP(x) ((x)<<17)
-#define STENCIL_PASS_DEPTH_PASS_OP(x) ((x)<<14)
-
-#define ENABLE_STENCIL_TEST_FUNC_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9))
-#define ENABLE_STENCIL_TEST_FUNC (1<<13)
-/* Uses COMPAREFUNC */
-#define STENCIL_TEST_FUNC(x) ((x)<<9)
-#define STENCIL_REF_VALUE_MASK ((1<<8)|0xff)
-#define ENABLE_STENCIL_REF_VALUE (1<<8)
-#define STENCIL_REF_VALUE(x) (x)
-
-/* _3DSTATE_VERTEX_FORMAT, p204 */
-#define _3DSTATE_VFT0_CMD (CMD_3D|(0x05<<24))
-#define VFT0_POINT_WIDTH (1<<12)
-#define VFT0_TEX_COUNT_MASK (7<<8)
-#define VFT0_TEX_COUNT_SHIFT 8
-#define VFT0_TEX_COUNT(x) ((x)<<8)
-#define VFT0_SPEC (1<<7)
-#define VFT0_DIFFUSE (1<<6)
-#define VFT0_DEPTH_OFFSET (1<<5)
-#define VFT0_XYZ (1<<1)
-#define VFT0_XYZW (2<<1)
-#define VFT0_XY (3<<1)
-#define VFT0_XYW (4<<1)
-#define VFT0_XYZW_MASK (7<<1)
-
-/* _3DSTATE_VERTEX_FORMAT_2, p206 */
-#define _3DSTATE_VFT1_CMD (CMD_3D|(0x0a<<24))
-#define VFT1_TEX7_FMT(x) ((x)<<14)
-#define VFT1_TEX6_FMT(x) ((x)<<12)
-#define VFT1_TEX5_FMT(x) ((x)<<10)
-#define VFT1_TEX4_FMT(x) ((x)<<8)
-#define VFT1_TEX3_FMT(x) ((x)<<6)
-#define VFT1_TEX2_FMT(x) ((x)<<4)
-#define VFT1_TEX1_FMT(x) ((x)<<2)
-#define VFT1_TEX0_FMT(x) (x)
-#define VFT1_TEX0_MASK 3
-#define VFT1_TEX1_SHIFT 2
-#define TEXCOORDFMT_2D 0
-#define TEXCOORDFMT_3D 1
-#define TEXCOORDFMT_4D 2
-#define TEXCOORDFMT_1D 3
-
-/*New stuff picked up along the way */
-
-#define MLC_LOD_BIAS_MASK ((1<<7)-1)
-
-
-/* _3DSTATE_VERTEX_TRANSFORM, p207 */
-#define _3DSTATE_VERTEX_TRANS_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|0)
-#define _3DSTATE_VERTEX_TRANS_MTX_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|6)
-/* Dword 1 */
-#define ENABLE_VIEWPORT_TRANSFORM ((1<<31)|(1<<30))
-#define DISABLE_VIEWPORT_TRANSFORM (1<<31)
-#define ENABLE_PERSP_DIVIDE ((1<<29)|(1<<28))
-#define DISABLE_PERSP_DIVIDE (1<<29)
-#define VRTX_TRANS_LOAD_MATRICES 0x7421
-#define VRTX_TRANS_NO_LOAD_MATRICES 0x0000
-/* Dword 2 -> 7 are matrix elements */
-
-/* _3DSTATE_W_STATE, p209 */
-#define _3DSTATE_W_STATE_CMD (CMD_3D|(0x1d<<24)|(0x8d<<16)|1)
-/* Dword 1 */
-#define MAGIC_W_STATE_DWORD1 0x00000008
-/* Dword 2 */
-#define WFAR_VALUE(x) (x)
-
-
-/* Stipple command, carried over from the i810, apparently:
- */
-#define _3DSTATE_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16))
-#define ST1_ENABLE (1<<16)
-#define ST1_MASK (0xffff)
-
-
-
-#define _3DSTATE_LOAD_STATE_IMMEDIATE_2 ((0x3<<29)|(0x1d<<24)|(0x03<<16))
-#define LOAD_TEXTURE_MAP0 (1<<11)
-#define LOAD_GLOBAL_COLOR_FACTOR (1<<6)
-
-#define TM0S0_ADDRESS_MASK 0xfffffffc
-#define TM0S0_USE_FENCE (1<<1)
-
-#define TM0S1_HEIGHT_SHIFT 21
-#define TM0S1_WIDTH_SHIFT 10
-#define TM0S1_PALETTE_SELECT (1<<9)
-#define TM0S1_MAPSURF_FORMAT_MASK (0x7 << 6)
-#define TM0S1_MAPSURF_FORMAT_SHIFT 6
-#define MAPSURF_8BIT_INDEXED (0<<6)
-#define MAPSURF_8BIT (1<<6)
-#define MAPSURF_16BIT (2<<6)
-#define MAPSURF_32BIT (3<<6)
-#define MAPSURF_411 (4<<6)
-#define MAPSURF_422 (5<<6)
-#define MAPSURF_COMPRESSED (6<<6)
-#define MAPSURF_4BIT_INDEXED (7<<6)
-#define TM0S1_MT_FORMAT_MASK (0x7 << 3)
-#define TM0S1_MT_FORMAT_SHIFT 3
-#define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */
-#define MT_8BIT_IDX_RGB565 (0<<3) /* SURFACE_8BIT_INDEXED */
-#define MT_8BIT_IDX_ARGB1555 (1<<3)
-#define MT_8BIT_IDX_ARGB4444 (2<<3)
-#define MT_8BIT_IDX_AY88 (3<<3)
-#define MT_8BIT_IDX_ABGR8888 (4<<3)
-#define MT_8BIT_IDX_BUMP_88DVDU (5<<3)
-#define MT_8BIT_IDX_BUMP_655LDVDU (6<<3)
-#define MT_8BIT_IDX_ARGB8888 (7<<3)
-#define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */
-#define MT_8BIT_L8 (1<<3)
-#define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */
-#define MT_16BIT_ARGB1555 (1<<3)
-#define MT_16BIT_ARGB4444 (2<<3)
-#define MT_16BIT_AY88 (3<<3)
-#define MT_16BIT_DIB_ARGB1555_8888 (4<<3)
-#define MT_16BIT_BUMP_88DVDU (5<<3)
-#define MT_16BIT_BUMP_655LDVDU (6<<3)
-#define MT_16BIT_DIB_RGB565_8888 (7<<3)
-#define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */
-#define MT_32BIT_ABGR8888 (1<<3)
-#define MT_32BIT_BUMP_XLDVDU_8888 (6<<3)
-#define MT_32BIT_DIB_8888 (7<<3)
-#define MT_411_YUV411 (0<<3) /* SURFACE_411 */
-#define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */
-#define MT_422_YCRCB_NORMAL (1<<3)
-#define MT_422_YCRCB_SWAPUV (2<<3)
-#define MT_422_YCRCB_SWAPUVY (3<<3)
-#define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */
-#define MT_COMPRESS_DXT2_3 (1<<3)
-#define MT_COMPRESS_DXT4_5 (2<<3)
-#define MT_COMPRESS_FXT1 (3<<3)
-#define TM0S1_COLORSPACE_CONVERSION (1 << 2)
-#define TM0S1_TILED_SURFACE (1 << 1)
-#define TM0S1_TILE_WALK (1 << 0)
-
-#define TM0S2_PITCH_SHIFT 21
-#define TM0S2_CUBE_FACE_ENA_SHIFT 15
-#define TM0S2_CUBE_FACE_ENA_MASK (1<<15)
-#define TM0S2_MAP_FORMAT (1<<14)
-#define TM0S2_VERTICAL_LINE_STRIDE (1<<13)
-#define TM0S2_VERITCAL_LINE_STRIDE_OFF (1<<12)
-#define TM0S2_OUTPUT_CHAN_SHIFT 10
-#define TM0S2_OUTPUT_CHAN_MASK (3<<10)
-
-#define TM0S3_MIP_FILTER_MASK (0x3<<30)
-#define TM0S3_MIP_FILTER_SHIFT 30
-#define MIPFILTER_NONE 0
-#define MIPFILTER_NEAREST 1
-#define MIPFILTER_LINEAR 3
-#define TM0S3_MAG_FILTER_MASK (0x3<<28)
-#define TM0S3_MAG_FILTER_SHIFT 28
-#define TM0S3_MIN_FILTER_MASK (0x3<<26)
-#define TM0S3_MIN_FILTER_SHIFT 26
-#define FILTER_NEAREST 0
-#define FILTER_LINEAR 1
-#define FILTER_ANISOTROPIC 2
-
-#define TM0S3_LOD_BIAS_SHIFT 17
-#define TM0S3_LOD_BIAS_MASK (0x1ff<<17)
-#define TM0S3_MAX_MIP_SHIFT 9
-#define TM0S3_MAX_MIP_MASK (0xff<<9)
-#define TM0S3_MIN_MIP_SHIFT 3
-#define TM0S3_MIN_MIP_MASK (0x3f<<3)
-#define TM0S3_KILL_PIXEL (1<<2)
-#define TM0S3_KEYED_FILTER (1<<1)
-#define TM0S3_CHROMA_KEY (1<<0)
-
-
-/* _3DSTATE_MAP_TEXEL_STREAM, p188 */
-#define _3DSTATE_MAP_TEX_STREAM_CMD (CMD_3D|(0x1c<<24)|(0x05<<19))
-#define DISABLE_TEX_STREAM_BUMP (1<<12)
-#define ENABLE_TEX_STREAM_BUMP ((1<<12)|(1<<11))
-#define TEX_MODIFY_UNIT_0 0
-#define TEX_MODIFY_UNIT_1 (1<<8)
-#define ENABLE_TEX_STREAM_COORD_SET (1<<7)
-#define TEX_STREAM_COORD_SET(x) ((x)<<4)
-#define ENABLE_TEX_STREAM_MAP_IDX (1<<3)
-#define TEX_STREAM_MAP_IDX(x) (x)
-
-
-#define MI_FLUSH ((0<<29)|(4<<23))
-#define FLUSH_MAP_CACHE (1<<0)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_state.c
deleted file mode 100644
index ec19fe980..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_state.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "texmem.h"
-
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-
-#include "i830_context.h"
-#include "i830_reg.h"
-
-static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- int test = intel_translate_compare_func(func);
-
- mask = mask & 0xff;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s : func: %s, ref : 0x%x, mask: 0x%x\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(func), ref, mask);
-
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK;
- i830->state.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(mask));
- i830->state.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK |
- ENABLE_STENCIL_TEST_FUNC_MASK);
- i830->state.Ctx[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_REF_VALUE |
- ENABLE_STENCIL_TEST_FUNC |
- STENCIL_REF_VALUE(ref) |
- STENCIL_TEST_FUNC(test));
-}
-
-static void i830StencilMask(GLcontext *ctx, GLuint mask)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s : mask 0x%x\n", __FUNCTION__, mask);
-
- mask = mask & 0xff;
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK;
- i830->state.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(mask));
-}
-
-static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- int fop, dfop, dpop;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(fail),
- _mesa_lookup_enum_by_nr(zfail),
- _mesa_lookup_enum_by_nr(zpass));
-
- fop = 0; dfop = 0; dpop = 0;
-
- switch(fail) {
- case GL_KEEP:
- fop = STENCILOP_KEEP;
- break;
- case GL_ZERO:
- fop = STENCILOP_ZERO;
- break;
- case GL_REPLACE:
- fop = STENCILOP_REPLACE;
- break;
- case GL_INCR:
- fop = STENCILOP_INCRSAT;
- break;
- case GL_DECR:
- fop = STENCILOP_DECRSAT;
- break;
- case GL_INCR_WRAP:
- fop = STENCILOP_INCR;
- break;
- case GL_DECR_WRAP:
- fop = STENCILOP_DECR;
- break;
- case GL_INVERT:
- fop = STENCILOP_INVERT;
- break;
- default:
- break;
- }
- switch(zfail) {
- case GL_KEEP:
- dfop = STENCILOP_KEEP;
- break;
- case GL_ZERO:
- dfop = STENCILOP_ZERO;
- break;
- case GL_REPLACE:
- dfop = STENCILOP_REPLACE;
- break;
- case GL_INCR:
- dfop = STENCILOP_INCRSAT;
- break;
- case GL_DECR:
- dfop = STENCILOP_DECRSAT;
- break;
- case GL_INCR_WRAP:
- dfop = STENCILOP_INCR;
- break;
- case GL_DECR_WRAP:
- dfop = STENCILOP_DECR;
- break;
- case GL_INVERT:
- dfop = STENCILOP_INVERT;
- break;
- default:
- break;
- }
- switch(zpass) {
- case GL_KEEP:
- dpop = STENCILOP_KEEP;
- break;
- case GL_ZERO:
- dpop = STENCILOP_ZERO;
- break;
- case GL_REPLACE:
- dpop = STENCILOP_REPLACE;
- break;
- case GL_INCR:
- dpop = STENCILOP_INCRSAT;
- break;
- case GL_DECR:
- dpop = STENCILOP_DECRSAT;
- break;
- case GL_INCR_WRAP:
- dpop = STENCILOP_INCR;
- break;
- case GL_DECR_WRAP:
- dpop = STENCILOP_DECR;
- break;
- case GL_INVERT:
- dpop = STENCILOP_INVERT;
- break;
- default:
- break;
- }
-
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK);
- i830->state.Ctx[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_PARMS |
- STENCIL_FAIL_OP(fop) |
- STENCIL_PASS_DEPTH_FAIL_OP(dfop) |
- STENCIL_PASS_DEPTH_PASS_OP(dpop));
-}
-
-static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- int test = intel_translate_compare_func(func);
- GLubyte refByte;
- GLuint refInt;
-
- UNCLAMPED_FLOAT_TO_UBYTE(refByte, ref);
- refInt = (GLuint)refByte;
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE2] &= ~ALPHA_TEST_REF_MASK;
- i830->state.Ctx[I830_CTXREG_STATE2] |= (ENABLE_ALPHA_TEST_FUNC |
- ENABLE_ALPHA_REF_VALUE |
- ALPHA_TEST_FUNC(test) |
- ALPHA_REF_VALUE(refInt));
-}
-
-/**
- * Makes sure that the proper enables are set for LogicOp, Independant Alpha
- * Blend, and Blending. It needs to be called from numerous places where we
- * could change the LogicOp or Independant Alpha Blend without subsequent
- * calls to glEnable.
- *
- * \todo
- * This function is substantially different from the old i830-specific driver.
- * I'm not sure which is correct.
- */
-static void i830EvalLogicOpBlendState(GLcontext *ctx)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
-
- if (ctx->Color._LogicOpEnabled) {
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
- ENABLE_LOGIC_OP_MASK);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
- ENABLE_LOGIC_OP);
- } else if (ctx->Color.BlendEnabled) {
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
- ENABLE_LOGIC_OP_MASK);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (ENABLE_COLOR_BLEND |
- DISABLE_LOGIC_OP);
- } else {
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
- ENABLE_LOGIC_OP_MASK);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
- DISABLE_LOGIC_OP);
- }
-}
-
-static void i830BlendColor(GLcontext *ctx, const GLfloat color[4])
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- GLubyte r, g, b, a;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(a, color[ACOMP]);
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_BLENDCOLOR1] = (a<<24) | (r<<16) | (g<<8) | b;
-}
-
-/**
- * Sets both the blend equation (called "function" in i830 docs) and the
- * blend function (called "factor" in i830 docs). This is done in a single
- * function because some blend equations (i.e., \c GL_MIN and \c GL_MAX)
- * change the interpretation of the blend function.
- */
-static void i830_set_blend_state( GLcontext * ctx )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- int funcA;
- int funcRGB;
- int eqnA;
- int eqnRGB;
- int iab;
- int s1;
-
-
- funcRGB = SRC_BLND_FACT( intel_translate_blend_factor( ctx->Color.BlendSrcRGB ) )
- | DST_BLND_FACT( intel_translate_blend_factor( ctx->Color.BlendDstRGB ) );
-
- switch(ctx->Color.BlendEquationRGB) {
- case GL_FUNC_ADD:
- eqnRGB = BLENDFUNC_ADD;
- break;
- case GL_MIN:
- eqnRGB = BLENDFUNC_MIN;
- funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_MAX:
- eqnRGB = BLENDFUNC_MAX;
- funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_FUNC_SUBTRACT:
- eqnRGB = BLENDFUNC_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- eqnRGB = BLENDFUNC_RVRSE_SUB;
- break;
- default:
- fprintf( stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n",
- __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB );
- return;
- }
-
-
- funcA = SRC_ABLEND_FACT( intel_translate_blend_factor( ctx->Color.BlendSrcA ) )
- | DST_ABLEND_FACT( intel_translate_blend_factor( ctx->Color.BlendDstA ) );
-
- switch(ctx->Color.BlendEquationA) {
- case GL_FUNC_ADD:
- eqnA = BLENDFUNC_ADD;
- break;
- case GL_MIN:
- eqnA = BLENDFUNC_MIN;
- funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_MAX:
- eqnA = BLENDFUNC_MAX;
- funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_FUNC_SUBTRACT:
- eqnA = BLENDFUNC_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- eqnA = BLENDFUNC_RVRSE_SUB;
- break;
- default:
- fprintf( stderr, "[%s:%u] Invalid alpha blend equation (0x%04x).\n",
- __FUNCTION__, __LINE__, ctx->Color.BlendEquationA );
- return;
- }
-
- iab = eqnA | funcA
- | _3DSTATE_INDPT_ALPHA_BLEND_CMD
- | ENABLE_SRC_ABLEND_FACTOR | ENABLE_DST_ABLEND_FACTOR
- | ENABLE_ALPHA_BLENDFUNC;
- s1 = eqnRGB | funcRGB
- | _3DSTATE_MODES_1_CMD
- | ENABLE_SRC_BLND_FACTOR | ENABLE_DST_BLND_FACTOR
- | ENABLE_COLR_BLND_FUNC;
-
- if ( (eqnA | funcA) != (eqnRGB | funcRGB) )
- iab |= ENABLE_INDPT_ALPHA_BLEND;
- else
- iab |= DISABLE_INDPT_ALPHA_BLEND;
-
- if (iab != i830->state.Ctx[I830_CTXREG_IALPHAB] ||
- s1 != i830->state.Ctx[I830_CTXREG_STATE1]) {
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_IALPHAB] = iab;
- i830->state.Ctx[I830_CTXREG_STATE1] = s1;
- }
-
- /* This will catch a logicop blend equation. It will also ensure
- * independant alpha blend is really in the correct state (either enabled
- * or disabled) if blending is already enabled.
- */
-
- i830EvalLogicOpBlendState(ctx);
-
- if (0) {
- fprintf(stderr, "[%s:%u] STATE1: 0x%08x IALPHAB: 0x%08x blend is %sabled\n",
- __FUNCTION__, __LINE__,
- i830->state.Ctx[I830_CTXREG_STATE1],
- i830->state.Ctx[I830_CTXREG_IALPHAB],
- (ctx->Color.BlendEnabled) ? "en" : "dis");
- }
-}
-
-
-static void i830BlendEquationSeparate(GLcontext *ctx, GLenum modeRGB,
- GLenum modeA)
-{
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s -> %s, %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(modeRGB),
- _mesa_lookup_enum_by_nr(modeA));
-
- (void) modeRGB;
- (void) modeA;
- i830_set_blend_state( ctx );
-}
-
-
-static void i830BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s -> RGB(%s, %s) A(%s, %s)\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(sfactorRGB),
- _mesa_lookup_enum_by_nr(dfactorRGB),
- _mesa_lookup_enum_by_nr(sfactorA),
- _mesa_lookup_enum_by_nr(dfactorA));
-
- (void) sfactorRGB;
- (void) dfactorRGB;
- (void) sfactorA;
- (void) dfactorA;
- i830_set_blend_state( ctx );
-}
-
-
-
-static void i830DepthFunc(GLcontext *ctx, GLenum func)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- int test = intel_translate_compare_func(func);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK;
- i830->state.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC |
- DEPTH_TEST_FUNC(test));
-}
-
-static void i830DepthMask(GLcontext *ctx, GLboolean flag)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s flag (%d)\n", __FUNCTION__, flag);
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
-
- i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
-
- if (flag && ctx->Depth.Test)
- i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE;
- else
- i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE;
-}
-
-/* =============================================================
- * Polygon stipple
- *
- * The i830 supports a 4x4 stipple natively, GL wants 32x32.
- * Fortunately stipple is usually a repeating pattern.
- */
-static void i830PolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- const GLubyte *m = mask;
- GLubyte p[4];
- int i,j,k;
- int active = (ctx->Polygon.StippleFlag &&
- i830->intel.reduced_primitive == GL_TRIANGLES);
- GLuint newMask;
-
- if (active) {
- I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE);
- i830->state.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE;
- }
-
- p[0] = mask[12] & 0xf; p[0] |= p[0] << 4;
- p[1] = mask[8] & 0xf; p[1] |= p[1] << 4;
- p[2] = mask[4] & 0xf; p[2] |= p[2] << 4;
- p[3] = mask[0] & 0xf; p[3] |= p[3] << 4;
-
- for (k = 0 ; k < 8 ; k++)
- for (j = 3 ; j >= 0; j--)
- for (i = 0 ; i < 4 ; i++, m++)
- if (*m != p[j]) {
- i830->intel.hw_stipple = 0;
- return;
- }
-
- newMask = (((p[0] & 0xf) << 0) |
- ((p[1] & 0xf) << 4) |
- ((p[2] & 0xf) << 8) |
- ((p[3] & 0xf) << 12));
-
-
- if (newMask == 0xffff || newMask == 0x0) {
- /* this is needed to make conform pass */
- i830->intel.hw_stipple = 0;
- return;
- }
-
- i830->state.Stipple[I830_STPREG_ST1] &= ~0xffff;
- i830->state.Stipple[I830_STPREG_ST1] |= newMask;
- i830->intel.hw_stipple = 1;
-
- if (active)
- i830->state.Stipple[I830_STPREG_ST1] |= ST1_ENABLE;
-}
-
-
-/* =============================================================
- * Hardware clipping
- */
-static void i830Scissor(GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- intelScreenPrivate *screen = i830->intel.intelScreen;
- int x1, y1, x2, y2;
-
- if (!i830->intel.driDrawable)
- return;
-
- x1 = x;
- y1 = i830->intel.driDrawable->h - (y + h);
- x2 = x + w - 1;
- y2 = y1 + h - 1;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "[%s] x(%d) y(%d) w(%d) h(%d)\n", __FUNCTION__,
- x, y, w, h);
-
- if (x1 < 0) x1 = 0;
- if (y1 < 0) y1 = 0;
- if (x2 < 0) x2 = 0;
- if (y2 < 0) y2 = 0;
-
- if (x2 >= screen->width) x2 = screen->width-1;
- if (y2 >= screen->height) y2 = screen->height-1;
- if (x1 >= screen->width) x1 = screen->width-1;
- if (y1 >= screen->height) y1 = screen->height-1;
-
-
- I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);
- i830->state.Buffer[I830_DESTREG_SR1] = (y1 << 16) | (x1 & 0xffff);
- i830->state.Buffer[I830_DESTREG_SR2] = (y2 << 16) | (x2 & 0xffff);
-}
-
-static void i830LogicOp(GLcontext *ctx, GLenum opcode)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- int tmp = intel_translate_logic_op( opcode );
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE4] &= ~LOGICOP_MASK;
- i830->state.Ctx[I830_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp);
-}
-
-
-
-static void i830CullFaceFrontFace(GLcontext *ctx, GLenum unused)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- GLuint mode;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!ctx->Polygon.CullFlag) {
- mode = CULLMODE_NONE;
- }
- else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
- mode = CULLMODE_CW;
-
- if (ctx->Polygon.CullFaceMode == GL_FRONT)
- mode ^= (CULLMODE_CW ^ CULLMODE_CCW);
- if (ctx->Polygon.FrontFace != GL_CCW)
- mode ^= (CULLMODE_CW ^ CULLMODE_CCW);
- }
- else {
- mode = CULLMODE_BOTH;
- }
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE3] &= ~CULLMODE_MASK;
- i830->state.Ctx[I830_CTXREG_STATE3] |= ENABLE_CULL_MODE | mode;
-}
-
-static void i830LineWidth( GLcontext *ctx, GLfloat widthf )
-{
- i830ContextPtr i830 = I830_CONTEXT( ctx );
- int width;
- int state5;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- width = (int)(widthf * 2);
- CLAMP_SELF(width, 1, 15);
-
- state5 = i830->state.Ctx[I830_CTXREG_STATE5] & ~FIXED_LINE_WIDTH_MASK;
- state5 |= (ENABLE_FIXED_LINE_WIDTH | FIXED_LINE_WIDTH(width));
-
- if (state5 != i830->state.Ctx[I830_CTXREG_STATE5]) {
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE5] = state5;
- }
-}
-
-static void i830PointSize(GLcontext *ctx, GLfloat size)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- GLint point_size = (int)size;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- CLAMP_SELF(point_size, 1, 256);
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_STATE5] &= ~FIXED_POINT_WIDTH_MASK;
- i830->state.Ctx[I830_CTXREG_STATE5] |= (ENABLE_FIXED_POINT_WIDTH |
- FIXED_POINT_WIDTH(point_size));
-}
-
-
-/* =============================================================
- * Color masks
- */
-
-static void i830ColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- i830ContextPtr i830 = I830_CONTEXT( ctx );
- GLuint tmp = 0;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s r(%d) g(%d) b(%d) a(%d)\n", __FUNCTION__, r, g, b, a);
-
- tmp = ((i830->state.Ctx[I830_CTXREG_ENABLES_2] & ~WRITEMASK_MASK) |
- ENABLE_COLOR_MASK |
- ENABLE_COLOR_WRITE |
- ((!r) << WRITEMASK_RED_SHIFT) |
- ((!g) << WRITEMASK_GREEN_SHIFT) |
- ((!b) << WRITEMASK_BLUE_SHIFT) |
- ((!a) << WRITEMASK_ALPHA_SHIFT));
-
- if (tmp != i830->state.Ctx[I830_CTXREG_ENABLES_2]) {
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_ENABLES_2] = tmp;
- }
-}
-
-static void update_specular( GLcontext *ctx )
-{
- i830ContextPtr i830 = I830_CONTEXT( ctx );
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK;
-
- if (NEED_SECONDARY_COLOR(ctx))
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_SPEC_ADD;
- else
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_SPEC_ADD;
-}
-
-static void i830LightModelfv(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) {
- update_specular( ctx );
- }
-}
-
-/* In Mesa 3.5 we can reliably do native flatshading.
- */
-static void i830ShadeModel(GLcontext *ctx, GLenum mode)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
-
-
-#define SHADE_MODE_MASK ((1<<10)|(1<<8)|(1<<6)|(1<<4))
-
- i830->state.Ctx[I830_CTXREG_STATE3] &= ~SHADE_MODE_MASK;
-
- if (mode == GL_FLAT) {
- i830->state.Ctx[I830_CTXREG_STATE3] |= (ALPHA_SHADE_MODE(SHADE_MODE_FLAT) |
- FOG_SHADE_MODE(SHADE_MODE_FLAT) |
- SPEC_SHADE_MODE(SHADE_MODE_FLAT) |
- COLOR_SHADE_MODE(SHADE_MODE_FLAT));
- } else {
- i830->state.Ctx[I830_CTXREG_STATE3] |= (ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) |
- FOG_SHADE_MODE(SHADE_MODE_LINEAR) |
- SPEC_SHADE_MODE(SHADE_MODE_LINEAR) |
- COLOR_SHADE_MODE(SHADE_MODE_LINEAR));
- }
-}
-
-/* =============================================================
- * Fog
- */
-static void i830Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (pname == GL_FOG_COLOR) {
- GLuint color = (((GLubyte)(ctx->Fog.Color[0]*255.0F) << 16) |
- ((GLubyte)(ctx->Fog.Color[1]*255.0F) << 8) |
- ((GLubyte)(ctx->Fog.Color[2]*255.0F) << 0));
-
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_FOGCOLOR] = (_3DSTATE_FOG_COLOR_CMD | color);
- }
-}
-
-/* =============================================================
- */
-
-static void i830Enable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
-
- switch(cap) {
- case GL_LIGHTING:
- case GL_COLOR_SUM:
- update_specular( ctx );
- break;
-
- case GL_ALPHA_TEST:
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_ALPHA_TEST_MASK;
- if (state)
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_ALPHA_TEST;
- else
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_ALPHA_TEST;
-
- break;
-
- case GL_BLEND:
- i830EvalLogicOpBlendState(ctx);
- break;
-
- case GL_COLOR_LOGIC_OP:
- i830EvalLogicOpBlendState(ctx);
-
- /* Logicop doesn't seem to work at 16bpp:
- */
- if (i830->intel.intelScreen->cpp == 2)
- FALLBACK( &i830->intel, I830_FALLBACK_LOGICOP, state );
- break;
-
- case GL_DITHER:
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DITHER;
-
- if (state)
- i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DITHER;
- else
- i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DITHER;
- break;
-
- case GL_DEPTH_TEST:
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
-
- if (state)
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST;
- else
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST;
-
- /* Also turn off depth writes when GL_DEPTH_TEST is disabled:
- */
- i830DepthMask( ctx, ctx->Depth.Mask );
- break;
-
- case GL_SCISSOR_TEST:
- I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);
-
- if (state)
- i830->state.Buffer[I830_DESTREG_SENABLE] =
- (_3DSTATE_SCISSOR_ENABLE_CMD |
- ENABLE_SCISSOR_RECT);
- else
- i830->state.Buffer[I830_DESTREG_SENABLE] =
- (_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
-
- break;
-
- case GL_LINE_SMOOTH:
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
-
- i830->state.Ctx[I830_CTXREG_AA] &= ~AA_LINE_ENABLE;
- if (state)
- i830->state.Ctx[I830_CTXREG_AA] |= AA_LINE_ENABLE;
- else
- i830->state.Ctx[I830_CTXREG_AA] |= AA_LINE_DISABLE;
- break;
-
- case GL_FOG:
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_FOG_MASK;
- if (state)
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_FOG;
- else
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_FOG;
- break;
-
- case GL_CULL_FACE:
- i830CullFaceFrontFace(ctx, 0);
- break;
-
- case GL_TEXTURE_2D:
- break;
-
- case GL_STENCIL_TEST:
- if (i830->intel.hw_stencil) {
- I830_STATECHANGE(i830, I830_UPLOAD_CTX);
-
- if (state) {
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST;
- i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE;
- } else {
- i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST;
- i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE;
- i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST;
- i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE;
- }
- } else {
- FALLBACK( &i830->intel, I830_FALLBACK_STENCIL, state );
- }
- break;
-
- case GL_POLYGON_STIPPLE:
- /* The stipple command worked on my 855GM box, but not my 845G.
- * I'll do more testing later to find out exactly which hardware
- * supports it. Disabled for now.
- */
- if (i830->intel.hw_stipple &&
- i830->intel.reduced_primitive == GL_TRIANGLES)
- {
- I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE);
- i830->state.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE;
- if (state)
- i830->state.Stipple[I830_STPREG_ST1] |= ST1_ENABLE;
- }
- break;
-
- default:
- ;
- }
-}
-
-
-static void i830_init_packets( i830ContextPtr i830 )
-{
- intelScreenPrivate *screen = i830->intel.intelScreen;
-
- /* Zero all state */
- memset(&i830->state, 0, sizeof(i830->state));
-
- /* Set default blend state */
- i830->state.TexBlend[0][0] = (_3DSTATE_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXOP_LAST_STAGE |
- TEXBLENDOP_ARG1);
- i830->state.TexBlend[0][1] = (_3DSTATE_MAP_BLEND_OP_CMD(0) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- i830->state.TexBlend[0][2] = (_3DSTATE_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_DIFFUSE);
- i830->state.TexBlend[0][3] = (_3DSTATE_MAP_BLEND_ARG_CMD(0) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_DIFFUSE);
-
- i830->state.TexBlendWordsUsed[0] = 4;
-
-
- i830->state.Ctx[I830_CTXREG_VF] = 0;
- i830->state.Ctx[I830_CTXREG_VF2] = 0;
-
- i830->state.Ctx[I830_CTXREG_AA] = (_3DSTATE_AA_CMD |
- AA_LINE_ECAAR_WIDTH_ENABLE |
- AA_LINE_ECAAR_WIDTH_1_0 |
- AA_LINE_REGION_WIDTH_ENABLE |
- AA_LINE_REGION_WIDTH_1_0 |
- AA_LINE_DISABLE);
-
- i830->state.Ctx[I830_CTXREG_ENABLES_1] = (_3DSTATE_ENABLES_1_CMD |
- DISABLE_LOGIC_OP |
- DISABLE_STENCIL_TEST |
- DISABLE_DEPTH_BIAS |
- DISABLE_SPEC_ADD |
- DISABLE_FOG |
- DISABLE_ALPHA_TEST |
- DISABLE_COLOR_BLEND |
- DISABLE_DEPTH_TEST);
-
- if (i830->intel.hw_stencil) {
- i830->state.Ctx[I830_CTXREG_ENABLES_2] = (_3DSTATE_ENABLES_2_CMD |
- ENABLE_STENCIL_WRITE |
- ENABLE_TEX_CACHE |
- ENABLE_DITHER |
- ENABLE_COLOR_MASK |
- /* set no color comps disabled */
- ENABLE_COLOR_WRITE |
- ENABLE_DEPTH_WRITE);
- } else {
- i830->state.Ctx[I830_CTXREG_ENABLES_2] = (_3DSTATE_ENABLES_2_CMD |
- DISABLE_STENCIL_WRITE |
- ENABLE_TEX_CACHE |
- ENABLE_DITHER |
- ENABLE_COLOR_MASK |
- /* set no color comps disabled */
- ENABLE_COLOR_WRITE |
- ENABLE_DEPTH_WRITE);
- }
-
- i830->state.Ctx[I830_CTXREG_STATE1] = (_3DSTATE_MODES_1_CMD |
- ENABLE_COLR_BLND_FUNC |
- BLENDFUNC_ADD |
- ENABLE_SRC_BLND_FACTOR |
- SRC_BLND_FACT(BLENDFACT_ONE) |
- ENABLE_DST_BLND_FACTOR |
- DST_BLND_FACT(BLENDFACT_ZERO) );
-
- i830->state.Ctx[I830_CTXREG_STATE2] = (_3DSTATE_MODES_2_CMD |
- ENABLE_GLOBAL_DEPTH_BIAS |
- GLOBAL_DEPTH_BIAS(0) |
- ENABLE_ALPHA_TEST_FUNC |
- ALPHA_TEST_FUNC(COMPAREFUNC_ALWAYS) |
- ALPHA_REF_VALUE(0) );
-
- i830->state.Ctx[I830_CTXREG_STATE3] = (_3DSTATE_MODES_3_CMD |
- ENABLE_DEPTH_TEST_FUNC |
- DEPTH_TEST_FUNC(COMPAREFUNC_LESS) |
- ENABLE_ALPHA_SHADE_MODE |
- ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_FOG_SHADE_MODE |
- FOG_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_SPEC_SHADE_MODE |
- SPEC_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_COLOR_SHADE_MODE |
- COLOR_SHADE_MODE(SHADE_MODE_LINEAR) |
- ENABLE_CULL_MODE |
- CULLMODE_NONE);
-
- i830->state.Ctx[I830_CTXREG_STATE4] = (_3DSTATE_MODES_4_CMD |
- ENABLE_LOGIC_OP_FUNC |
- LOGIC_OP_FUNC(LOGICOP_COPY) |
- ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(0xff) |
- ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(0xff));
-
- i830->state.Ctx[I830_CTXREG_STENCILTST] = (_3DSTATE_STENCIL_TEST_CMD |
- ENABLE_STENCIL_PARMS |
- STENCIL_FAIL_OP(STENCILOP_KEEP) |
- STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_KEEP) |
- STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_KEEP) |
- ENABLE_STENCIL_TEST_FUNC |
- STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS) |
- ENABLE_STENCIL_REF_VALUE |
- STENCIL_REF_VALUE(0) );
-
- i830->state.Ctx[I830_CTXREG_STATE5] = (_3DSTATE_MODES_5_CMD |
- FLUSH_TEXTURE_CACHE |
- ENABLE_SPRITE_POINT_TEX |
- SPRITE_POINT_TEX_OFF |
- ENABLE_FIXED_LINE_WIDTH |
- FIXED_LINE_WIDTH(0x2) | /* 1.0 */
- ENABLE_FIXED_POINT_WIDTH |
- FIXED_POINT_WIDTH(1) );
-
- i830->state.Ctx[I830_CTXREG_IALPHAB] = (_3DSTATE_INDPT_ALPHA_BLEND_CMD |
- DISABLE_INDPT_ALPHA_BLEND |
- ENABLE_ALPHA_BLENDFUNC |
- ABLENDFUNC_ADD);
-
- i830->state.Ctx[I830_CTXREG_FOGCOLOR] = (_3DSTATE_FOG_COLOR_CMD |
- FOG_COLOR_RED(0) |
- FOG_COLOR_GREEN(0) |
- FOG_COLOR_BLUE(0));
-
- i830->state.Ctx[I830_CTXREG_BLENDCOLOR0] = _3DSTATE_CONST_BLEND_COLOR_CMD;
- i830->state.Ctx[I830_CTXREG_BLENDCOLOR1] = 0;
-
- i830->state.Ctx[I830_CTXREG_MCSB0] = _3DSTATE_MAP_COORD_SETBIND_CMD;
- i830->state.Ctx[I830_CTXREG_MCSB1] = (TEXBIND_SET3(TEXCOORDSRC_VTXSET_3) |
- TEXBIND_SET2(TEXCOORDSRC_VTXSET_2) |
- TEXBIND_SET1(TEXCOORDSRC_VTXSET_1) |
- TEXBIND_SET0(TEXCOORDSRC_VTXSET_0));
-
-
- i830->state.Stipple[I830_STPREG_ST0] = _3DSTATE_STIPPLE;
-
- i830->state.Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
- i830->state.Buffer[I830_DESTREG_CBUFADDR1] =
- (BUF_3D_ID_COLOR_BACK |
- BUF_3D_PITCH(screen->frontPitch * screen->cpp) |
- BUF_3D_USE_FENCE);
-
-
- i830->state.Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
- i830->state.Buffer[I830_DESTREG_DBUFADDR1] =
- (BUF_3D_ID_DEPTH |
- BUF_3D_PITCH(screen->depthPitch * screen->cpp) |
- BUF_3D_USE_FENCE);
- i830->state.Buffer[I830_DESTREG_DBUFADDR2] = screen->depthOffset;
-
-
- i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
-
- switch (screen->fbFormat) {
- case DV_PF_555:
- case DV_PF_565:
- i830->state.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- screen->fbFormat |
- DEPTH_IS_Z |
- DEPTH_FRMT_16_FIXED);
- break;
- case DV_PF_8888:
- i830->state.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- screen->fbFormat |
- DEPTH_IS_Z |
- DEPTH_FRMT_24_FIXED_8_OTHER);
- break;
- }
-
- i830->state.Buffer[I830_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
- i830->state.Buffer[I830_DESTREG_SR0] = _3DSTATE_SCISSOR_RECT_0_CMD;
- i830->state.Buffer[I830_DESTREG_SR1] = 0;
- i830->state.Buffer[I830_DESTREG_SR2] = 0;
-}
-
-
-void i830InitStateFuncs( struct dd_function_table *functions )
-{
- functions->AlphaFunc = i830AlphaFunc;
- functions->BlendColor = i830BlendColor;
- functions->BlendEquationSeparate = i830BlendEquationSeparate;
- functions->BlendFuncSeparate = i830BlendFuncSeparate;
- functions->ColorMask = i830ColorMask;
- functions->CullFace = i830CullFaceFrontFace;
- functions->DepthFunc = i830DepthFunc;
- functions->DepthMask = i830DepthMask;
- functions->Enable = i830Enable;
- functions->Fogfv = i830Fogfv;
- functions->FrontFace = i830CullFaceFrontFace;
- functions->LightModelfv = i830LightModelfv;
- functions->LineWidth = i830LineWidth;
- functions->LogicOpcode = i830LogicOp;
- functions->PointSize = i830PointSize;
- functions->PolygonStipple = i830PolygonStipple;
- functions->Scissor = i830Scissor;
- functions->ShadeModel = i830ShadeModel;
- functions->StencilFunc = i830StencilFunc;
- functions->StencilMask = i830StencilMask;
- functions->StencilOp = i830StencilOp;
-}
-
-void i830InitState( i830ContextPtr i830 )
-{
- GLcontext *ctx = &i830->intel.ctx;
-
- i830_init_packets( i830 );
-
- intelInitState( ctx );
-
- memcpy( &i830->initial, &i830->state, sizeof(i830->state) );
-
- i830->current = &i830->state;
- i830->state.emitted = 0;
- i830->state.active = (I830_UPLOAD_TEXBLEND(0) |
- I830_UPLOAD_STIPPLE |
- I830_UPLOAD_CTX |
- I830_UPLOAD_BUFFERS);
-}
-
-
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_tex.c
deleted file mode 100644
index d56a4df8b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_tex.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "image.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "texmem.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-
-#include "intel_ioctl.h"
-
-#include "i830_context.h"
-#include "i830_reg.h"
-
-
-
-
-/**
- * Set the texture wrap modes.
- *
- * The i830M (and related graphics cores) do not support GL_CLAMP. The Intel
- * drivers for "other operating systems" implement GL_CLAMP as
- * GL_CLAMP_TO_EDGE, so the same is done here.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-static void i830SetTexWrapping(i830TextureObjectPtr tex,
- GLenum swrap,
- GLenum twrap)
-{
- tex->Setup[I830_TEXREG_MCS] &= ~(TEXCOORD_ADDR_U_MASK|TEXCOORD_ADDR_V_MASK);
-
- switch( swrap ) {
- case GL_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP);
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP);
- break;
- case GL_CLAMP_TO_BORDER:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP_BORDER);
- break;
- case GL_MIRRORED_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_MIRROR);
- break;
- default:
- break;
- }
-
- switch( twrap ) {
- case GL_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP);
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP);
- break;
- case GL_CLAMP_TO_BORDER:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP_BORDER);
- break;
- case GL_MIRRORED_REPEAT:
- tex->Setup[I830_TEXREG_MCS] |=
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_MIRROR);
- break;
- default:
- break;
- }
-}
-
-
-/**
- * Set the texture magnification and minification modes.
- *
- * \param t Texture whose filter modes are to be set
- * \param minf Texture minification mode
- * \param magf Texture magnification mode
- * \param bias LOD bias for this texture unit.
- */
-
-static void i830SetTexFilter( i830TextureObjectPtr t, GLenum minf, GLenum magf,
- GLfloat maxanisotropy )
-{
- int minFilt = 0, mipFilt = 0, magFilt = 0;
-
- if(INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if ( maxanisotropy > 1.0 ) {
- minFilt = FILTER_ANISOTROPIC;
- magFilt = FILTER_ANISOTROPIC;
- }
- else {
- switch (minf) {
- case GL_NEAREST:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_NONE;
- break;
- case GL_LINEAR:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_LINEAR;
- break;
- default:
- break;
- }
-
- switch (magf) {
- case GL_NEAREST:
- magFilt = FILTER_NEAREST;
- break;
- case GL_LINEAR:
- magFilt = FILTER_LINEAR;
- break;
- default:
- break;
- }
- }
-
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_FILTER_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIP_FILTER_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAG_FILTER_MASK;
- t->Setup[I830_TEXREG_TM0S3] |= ((minFilt << TM0S3_MIN_FILTER_SHIFT) |
- (mipFilt << TM0S3_MIP_FILTER_SHIFT) |
- (magFilt << TM0S3_MAG_FILTER_SHIFT));
-}
-
-static void i830SetTexBorderColor(i830TextureObjectPtr t, GLubyte color[4])
-{
- if(INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- t->Setup[I830_TEXREG_TM0S4] =
- INTEL_PACKCOLOR8888(color[0],color[1],color[2],color[3]);
-}
-
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-intelTextureObjectPtr i830AllocTexObj( struct gl_texture_object *texObj )
-{
- i830TextureObjectPtr t = CALLOC_STRUCT( i830_texture_object );
- if ( !t )
- return NULL;
-
- texObj->DriverData = t;
- t->intel.base.tObj = texObj;
- t->intel.dirty = I830_UPLOAD_TEX_ALL;
- make_empty_list( &t->intel.base );
-
- t->Setup[I830_TEXREG_TM0LI] = 0; /* not used */
- t->Setup[I830_TEXREG_TM0S0] = 0;
- t->Setup[I830_TEXREG_TM0S1] = 0;
- t->Setup[I830_TEXREG_TM0S2] = 0;
- t->Setup[I830_TEXREG_TM0S3] = 0;
- t->Setup[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD |
- MAP_UNIT(0) |
- ENABLE_TEXCOORD_PARAMS |
- TEXCOORDS_ARE_NORMAL |
- TEXCOORDTYPE_CARTESIAN |
- ENABLE_ADDR_V_CNTL |
- TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) |
- ENABLE_ADDR_U_CNTL |
- TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP));
-
-
- i830SetTexWrapping( t, texObj->WrapS, texObj->WrapT );
- i830SetTexFilter( t, texObj->MinFilter, texObj->MagFilter,
- texObj->MaxAnisotropy );
- i830SetTexBorderColor( t, texObj->_BorderChan );
-
- return &t->intel;
-}
-
-
-static void i830TexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData;
- if (!t)
- return;
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- i830SetTexFilter( t, tObj->MinFilter, tObj->MagFilter,
- tObj->MaxAnisotropy);
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- i830SetTexWrapping( t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- i830SetTexBorderColor( t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* The i830 and its successors can do a lot of this without
- * reloading the textures. A project for someone?
- */
- intelFlush( ctx );
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-
- t->intel.dirty = I830_UPLOAD_TEX_ALL;
-}
-
-
-static void i830TexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- i830ContextPtr i830 = I830_CONTEXT( ctx );
- GLuint unit = ctx->Texture.CurrentUnit;
-
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR:
-#if 0
- {
- GLubyte r, g, b, a;
- GLuint col;
-
- UNCLAMPED_FLOAT_TO_UBYTE(r, param[RCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(g, param[GCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(b, param[BCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(a, param[ACOMP]);
-
- col = ((a << 24) | (r << 16) | (g << 8) | b);
-
- if (col != i830->state.TexEnv[unit][I830_TEXENVREG_COL1]) {
- I830_STATECHANGE(i830, I830_UPLOAD_TEXENV);
- i830->state.TexEnv[unit][I830_TEXENVREG_COL1] = col;
- }
-
- break;
- }
-#endif
- case GL_TEXTURE_ENV_MODE:
- case GL_COMBINE_RGB:
- case GL_COMBINE_ALPHA:
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_RGB_SCALE:
- case GL_ALPHA_SCALE:
- break;
-
- case GL_TEXTURE_LOD_BIAS: {
- int b = (int) ((*param) * 16.0);
- if (b > 63) b = 63;
- if (b < -64) b = -64;
- I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit));
- i830->state.Tex[unit][I830_TEXREG_TM0S3] &= ~TM0S3_LOD_BIAS_MASK;
- i830->state.Tex[unit][I830_TEXREG_TM0S3] |=
- ((b << TM0S3_LOD_BIAS_SHIFT) & TM0S3_LOD_BIAS_MASK);
- break;
- }
-
- default:
- break;
- }
-}
-
-
-
-
-void i830InitTextureFuncs( struct dd_function_table *functions )
-{
- functions->TexEnv = i830TexEnv;
- functions->TexParameter = i830TexParameter;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texblend.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texblend.c
deleted file mode 100644
index 49e034764..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texblend.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texformat.h"
-#include "texstore.h"
-
-#include "mm.h"
-
-#include "intel_screen.h"
-#include "intel_ioctl.h"
-#include "intel_tex.h"
-
-#include "i830_context.h"
-#include "i830_reg.h"
-
-
-/* ================================================================
- * Texture combine functions
- */
-static GLuint pass_through( GLuint *state, GLuint blendUnit )
-{
- state[0] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- state[1] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_SCALE_1X |
- TEXOP_MODIFY_PARMS |
- TEXBLENDOP_ARG1);
- state[2] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) |
- TEXPIPE_COLOR |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
- state[3] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) |
- TEXPIPE_ALPHA |
- TEXBLEND_ARG1 |
- TEXBLENDARG_MODIFY_PARMS |
- TEXBLENDARG_CURRENT);
-
- return 4;
-}
-
-static GLuint emit_factor( GLuint blendUnit, GLuint *state, GLuint count,
- const GLfloat *factor )
-{
- GLubyte r, g, b, a;
- GLuint col;
-
- if (0)
- fprintf(stderr, "emit constant %d: %.2f %.2f %.2f %.2f\n",
- blendUnit, factor[0], factor[1], factor[2], factor[3]);
-
- UNCLAMPED_FLOAT_TO_UBYTE(r, factor[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(g, factor[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(b, factor[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(a, factor[3]);
-
- col = ((a << 24) | (r << 16) | (g << 8) | b);
-
- state[count++] = _3DSTATE_COLOR_FACTOR_N_CMD(blendUnit);
- state[count++] = col;
-
- return count;
-}
-
-
-static __inline__ GLuint GetTexelOp(GLint unit)
-{
- switch(unit) {
- case 0: return TEXBLENDARG_TEXEL0;
- case 1: return TEXBLENDARG_TEXEL1;
- case 2: return TEXBLENDARG_TEXEL2;
- case 3: return TEXBLENDARG_TEXEL3;
- default: return TEXBLENDARG_TEXEL0;
- }
-}
-
-
-/**
- * Calculate the hardware instuctions to setup the current texture enviromnemt
- * settings. Since \c gl_texture_unit::_CurrentCombine is used, both
- * "classic" texture enviroments and GL_ARB_texture_env_combine type texture
- * environments are treated identically.
- *
- * \todo
- * This function should return \c GLboolean. When \c GL_FALSE is returned,
- * it means that an environment is selected that the hardware cannot do. This
- * is the way the Radeon and R200 drivers work.
- *
- * \todo
- * Looking at i830_3d_regs.h, it seems the i830 can do part of
- * GL_ATI_texture_env_combine3. It can handle using \c GL_ONE and
- * \c GL_ZERO as combine inputs (which the code already supports). It can
- * also handle the \c GL_MODULATE_ADD_ATI mode. Is it worth investigating
- * partial support for the extension?
- */
-GLuint
-i830SetTexEnvCombine(i830ContextPtr i830,
- const struct gl_tex_env_combine_state * combine,
- GLint blendUnit,
- GLuint texel_op,
- GLuint *state,
- const GLfloat *factor )
-{
- const GLuint numColorArgs = combine->_NumArgsRGB;
- const GLuint numAlphaArgs = combine->_NumArgsA;
-
- GLuint blendop;
- GLuint ablendop;
- GLuint args_RGB[3];
- GLuint args_A[3];
- GLuint rgb_shift;
- GLuint alpha_shift;
- GLboolean need_factor = 0;
- int i;
- unsigned used;
- static const GLuint tex_blend_rgb[3] = {
- TEXPIPE_COLOR | TEXBLEND_ARG1 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_COLOR | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_COLOR | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS,
- };
- static const GLuint tex_blend_a[3] = {
- TEXPIPE_ALPHA | TEXBLEND_ARG1 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_ALPHA | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS,
- TEXPIPE_ALPHA | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS,
- };
-
- if(INTEL_DEBUG&DEBUG_TEXTURE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
- /* The EXT version of the DOT3 extension does not support the
- * scale factor, but the ARB version (and the version in OpenGL
- * 1.3) does.
- */
- switch (combine->ModeRGB) {
- case GL_DOT3_RGB_EXT:
- alpha_shift = combine->ScaleShiftA;
- rgb_shift = 0;
- break;
-
- case GL_DOT3_RGBA_EXT:
- alpha_shift = 0;
- rgb_shift = 0;
- break;
-
- default:
- rgb_shift = combine->ScaleShiftRGB;
- alpha_shift = combine->ScaleShiftA;
- break;
- }
-
-
- switch(combine->ModeRGB) {
- case GL_REPLACE:
- blendop = TEXBLENDOP_ARG1;
- break;
- case GL_MODULATE:
- blendop = TEXBLENDOP_MODULATE;
- break;
- case GL_ADD:
- blendop = TEXBLENDOP_ADD;
- break;
- case GL_ADD_SIGNED:
- blendop = TEXBLENDOP_ADDSIGNED;
- break;
- case GL_INTERPOLATE:
- blendop = TEXBLENDOP_BLEND;
- break;
- case GL_SUBTRACT:
- blendop = TEXBLENDOP_SUBTRACT;
- break;
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGB:
- blendop = TEXBLENDOP_DOT3;
- break;
- case GL_DOT3_RGBA_EXT:
- case GL_DOT3_RGBA:
- blendop = TEXBLENDOP_DOT3;
- break;
- default:
- return pass_through( state, blendUnit );
- }
-
- blendop |= (rgb_shift << TEXOP_SCALE_SHIFT);
-
-
- /* Handle RGB args */
- for(i = 0; i < 3; i++) {
- switch(combine->SourceRGB[i]) {
- case GL_TEXTURE:
- args_RGB[i] = texel_op;
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- args_RGB[i] = GetTexelOp( combine->SourceRGB[i] - GL_TEXTURE0 );
- break;
- case GL_CONSTANT:
- args_RGB[i] = TEXBLENDARG_FACTOR_N;
- need_factor = 1;
- break;
- case GL_PRIMARY_COLOR:
- args_RGB[i] = TEXBLENDARG_DIFFUSE;
- break;
- case GL_PREVIOUS:
- args_RGB[i] = TEXBLENDARG_CURRENT;
- break;
- default:
- return pass_through( state, blendUnit );
- }
-
- switch(combine->OperandRGB[i]) {
- case GL_SRC_COLOR:
- args_RGB[i] |= 0;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- args_RGB[i] |= TEXBLENDARG_INV_ARG;
- break;
- case GL_SRC_ALPHA:
- args_RGB[i] |= TEXBLENDARG_REPLICATE_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- args_RGB[i] |= (TEXBLENDARG_REPLICATE_ALPHA |
- TEXBLENDARG_INV_ARG);
- break;
- default:
- return pass_through( state, blendUnit );
- }
- }
-
-
- /* Need to knobble the alpha calculations of TEXBLENDOP_DOT4 to
- * match the spec. Can't use DOT3 as it won't propogate values
- * into alpha as required:
- *
- * Note - the global factor is set up with alpha == .5, so
- * the alpha part of the DOT4 calculation should be zero.
- */
- if ( combine->ModeRGB == GL_DOT3_RGBA_EXT ||
- combine->ModeRGB == GL_DOT3_RGBA ) {
- ablendop = TEXBLENDOP_DOT4;
- args_A[0] = TEXBLENDARG_FACTOR; /* the global factor */
- args_A[1] = TEXBLENDARG_FACTOR;
- args_A[2] = TEXBLENDARG_FACTOR;
- }
- else {
- switch(combine->ModeA) {
- case GL_REPLACE:
- ablendop = TEXBLENDOP_ARG1;
- break;
- case GL_MODULATE:
- ablendop = TEXBLENDOP_MODULATE;
- break;
- case GL_ADD:
- ablendop = TEXBLENDOP_ADD;
- break;
- case GL_ADD_SIGNED:
- ablendop = TEXBLENDOP_ADDSIGNED;
- break;
- case GL_INTERPOLATE:
- ablendop = TEXBLENDOP_BLEND;
- break;
- case GL_SUBTRACT:
- ablendop = TEXBLENDOP_SUBTRACT;
- break;
- default:
- return pass_through( state, blendUnit );
- }
-
-
- ablendop |= (alpha_shift << TEXOP_SCALE_SHIFT);
-
- /* Handle A args */
- for(i = 0; i < 3; i++) {
- switch(combine->SourceA[i]) {
- case GL_TEXTURE:
- args_A[i] = texel_op;
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- args_A[i] = GetTexelOp( combine->SourceA[i] - GL_TEXTURE0 );
- break;
- case GL_CONSTANT:
- args_A[i] = TEXBLENDARG_FACTOR_N;
- need_factor = 1;
- break;
- case GL_PRIMARY_COLOR:
- args_A[i] = TEXBLENDARG_DIFFUSE;
- break;
- case GL_PREVIOUS:
- args_A[i] = TEXBLENDARG_CURRENT;
- break;
- default:
- return pass_through( state, blendUnit );
- }
-
- switch(combine->OperandA[i]) {
- case GL_SRC_ALPHA:
- args_A[i] |= 0;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- args_A[i] |= TEXBLENDARG_INV_ARG;
- break;
- default:
- return pass_through( state, blendUnit );
- }
- }
- }
-
-
-
- /* Native Arg1 == Arg0 in GL_EXT_texture_env_combine spec */
- /* Native Arg2 == Arg1 in GL_EXT_texture_env_combine spec */
- /* Native Arg0 == Arg2 in GL_EXT_texture_env_combine spec */
-
- /* When we render we need to figure out which is the last really enabled
- * tex unit, and put last stage on it
- */
-
-
- /* Build color & alpha pipelines */
-
- used = 0;
- state[used++] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) |
- TEXPIPE_COLOR |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- DISABLE_TEX_CNTRL_STAGE |
- TEXOP_MODIFY_PARMS |
- blendop);
- state[used++] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) |
- TEXPIPE_ALPHA |
- ENABLE_TEXOUTPUT_WRT_SEL |
- TEXOP_OUTPUT_CURRENT |
- TEXOP_MODIFY_PARMS |
- ablendop);
-
- for ( i = 0 ; i < numColorArgs ; i++ ) {
- state[used++] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) |
- tex_blend_rgb[i] | args_RGB[i]);
- }
-
- for ( i = 0 ; i < numAlphaArgs ; i++ ) {
- state[used++] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) |
- tex_blend_a[i] | args_A[i]);
- }
-
-
- if (need_factor)
- return emit_factor( blendUnit, state, used, factor );
- else
- return used;
-}
-
-
-static void emit_texblend( i830ContextPtr i830, GLuint unit, GLuint blendUnit,
- GLboolean last_stage )
-{
- struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit];
- GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz;
-
-
- if (0) fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit);
-
- /* Update i830->state.TexBlend
- */
- tmp_sz = i830SetTexEnvCombine(i830, texUnit->_CurrentCombine, blendUnit,
- GetTexelOp(unit), tmp,
- texUnit->EnvColor );
-
- if (last_stage)
- tmp[0] |= TEXOP_LAST_STAGE;
-
- if (tmp_sz != i830->state.TexBlendWordsUsed[blendUnit] ||
- memcmp( tmp, i830->state.TexBlend[blendUnit], tmp_sz * sizeof(GLuint))) {
-
- I830_STATECHANGE( i830, I830_UPLOAD_TEXBLEND(blendUnit) );
- memcpy( i830->state.TexBlend[blendUnit], tmp, tmp_sz * sizeof(GLuint));
- i830->state.TexBlendWordsUsed[blendUnit] = tmp_sz;
- }
-
- I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(blendUnit), GL_TRUE);
-}
-
-static void emit_passthrough( i830ContextPtr i830 )
-{
- GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz;
- GLuint unit = 0;
-
- tmp_sz = pass_through( tmp, unit );
- tmp[0] |= TEXOP_LAST_STAGE;
-
- if (tmp_sz != i830->state.TexBlendWordsUsed[unit] ||
- memcmp( tmp, i830->state.TexBlend[unit], tmp_sz * sizeof(GLuint))) {
-
- I830_STATECHANGE( i830, I830_UPLOAD_TEXBLEND(unit) );
- memcpy( i830->state.TexBlend[unit], tmp, tmp_sz * sizeof(GLuint));
- i830->state.TexBlendWordsUsed[unit] = tmp_sz;
- }
-
- I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(unit), GL_TRUE);
-}
-
-void i830EmitTextureBlend( i830ContextPtr i830 )
-{
- GLcontext *ctx = &i830->intel.ctx;
- GLuint unit, last_stage = 0, blendunit = 0;
-
- I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, GL_FALSE);
-
- if (ctx->Texture._EnabledUnits) {
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled)
- last_stage = unit;
-
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled)
- emit_texblend( i830, unit, blendunit++, last_stage == unit );
- }
- else {
- emit_passthrough( i830 );
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texstate.c
deleted file mode 100644
index ba452279b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_texstate.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texformat.h"
-#include "texstore.h"
-
-#include "mm.h"
-
-#include "intel_screen.h"
-#include "intel_ioctl.h"
-#include "intel_tex.h"
-
-#include "i830_context.h"
-#include "i830_reg.h"
-
-static const GLint initial_offsets[6][2] = { {0,0},
- {0,2},
- {1,0},
- {1,2},
- {1,1},
- {1,3} };
-
-static const GLint step_offsets[6][2] = { {0,2},
- {0,2},
- {-1,2},
- {-1,2},
- {-1,1},
- {-1,1} };
-
-#define I830_TEX_UNIT_ENABLED(unit) (1<<unit)
-
-static GLboolean i830SetTexImages( i830ContextPtr i830,
- struct gl_texture_object *tObj )
-{
- GLuint total_height, pitch, i, textureFormat;
- i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint firstLevel, lastLevel, numLevels;
-
- switch( baseImage->TexFormat->MesaFormat ) {
- case MESA_FORMAT_L8:
- t->intel.texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_L8;
- break;
-
- case MESA_FORMAT_I8:
- t->intel.texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_I8;
- break;
-
- case MESA_FORMAT_A8:
- t->intel.texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_I8; /* Kludge -- check with conform, glean */
- break;
-
- case MESA_FORMAT_AL88:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_AY88;
- break;
-
- case MESA_FORMAT_RGB565:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_RGB565;
- break;
-
- case MESA_FORMAT_ARGB1555:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB1555;
- break;
-
- case MESA_FORMAT_ARGB4444:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB4444;
- break;
-
- case MESA_FORMAT_ARGB8888:
- t->intel.texelBytes = 4;
- textureFormat = MAPSURF_32BIT | MT_32BIT_ARGB8888;
- break;
-
- case MESA_FORMAT_YCBCR_REV:
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_NORMAL |
- TM0S1_COLORSPACE_CONVERSION);
- break;
-
- case MESA_FORMAT_YCBCR:
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_SWAPY | /* ??? */
- TM0S1_COLORSPACE_CONVERSION);
- break;
-
- case MESA_FORMAT_RGB_FXT1:
- case MESA_FORMAT_RGBA_FXT1:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_COMPRESSED | MT_COMPRESS_FXT1;
- break;
-
- case MESA_FORMAT_RGBA_DXT1:
- case MESA_FORMAT_RGB_DXT1:
- /*
- * DXTn pitches are Width/4 * blocksize in bytes
- * for DXT1: blocksize=8 so Width/4*8 = Width * 2
- * for DXT3/5: blocksize=16 so Width/4*16 = Width * 4
- */
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
- break;
- case MESA_FORMAT_RGBA_DXT3:
- t->intel.texelBytes = 4;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
- break;
- case MESA_FORMAT_RGBA_DXT5:
- t->intel.texelBytes = 4;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
- break;
-
- default:
- fprintf(stderr, "%s: bad image format\n", __FUNCTION__);
- abort();
- }
-
- /* Compute which mipmap levels we really want to send 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.
- * Yes, this looks overly complicated, but it's all needed.
- */
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
-
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- firstLevel = t->intel.base.firstLevel;
- lastLevel = t->intel.base.lastLevel;
- numLevels = lastLevel - firstLevel + 1;
-
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- switch (tObj->Target) {
- case GL_TEXTURE_CUBE_MAP: {
- const GLuint dim = tObj->Image[0][firstLevel]->Width;
- GLuint face;
-
- pitch = dim * t->intel.texelBytes;
- pitch *= 2; /* double pitch for cube layouts */
- pitch = (pitch + 3) & ~3;
-
- total_height = dim * 4;
-
- for ( face = 0 ; face < 6 ; face++) {
- GLuint x = initial_offsets[face][0] * dim;
- GLuint y = initial_offsets[face][1] * dim;
- GLuint d = dim;
-
- t->intel.base.dirty_images[face] = ~0;
-
- assert(tObj->Image[face][firstLevel]->Width == dim);
- assert(tObj->Image[face][firstLevel]->Height == dim);
-
- for (i = 0; i < numLevels; i++) {
- t->intel.image[face][i].image = tObj->Image[face][firstLevel + i];
- if (!t->intel.image[face][i].image) {
- fprintf(stderr, "no image %d %d\n", face, i);
- break; /* can't happen */
- }
-
- t->intel.image[face][i].offset =
- y * pitch + x * t->intel.texelBytes;
- t->intel.image[face][i].internalFormat = baseImage->Format;
-
- d >>= 1;
- x += step_offsets[face][0] * d;
- y += step_offsets[face][1] * d;
- }
- }
- break;
- }
- default:
- pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
- pitch = (pitch + 3) & ~3;
- t->intel.base.dirty_images[0] = ~0;
-
- for ( total_height = i = 0 ; i < numLevels ; i++ ) {
- t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
- if (!t->intel.image[0][i].image)
- break;
-
- t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
- if (t->intel.image[0][i].image->IsCompressed)
- {
- if (t->intel.image[0][i].image->Height > 4)
- total_height += t->intel.image[0][i].image->Height/4;
- else
- total_height += 1;
- }
- else
- total_height += MAX2(2, t->intel.image[0][i].image->Height);
- }
- break;
- }
-
- t->intel.Pitch = pitch;
- t->intel.base.totalSize = total_height*pitch;
- t->intel.max_level = i-1;
- t->Setup[I830_TEXREG_TM0S1] =
- (((tObj->Image[0][firstLevel]->Height - 1) << TM0S1_HEIGHT_SHIFT) |
- ((tObj->Image[0][firstLevel]->Width - 1) << TM0S1_WIDTH_SHIFT) |
- textureFormat);
- t->Setup[I830_TEXREG_TM0S2] =
- (((pitch / 4) - 1) << TM0S2_PITCH_SHIFT) |
- TM0S2_CUBE_FACE_ENA_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAX_MIP_MASK;
- t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_MIP_MASK;
- t->Setup[I830_TEXREG_TM0S3] |= ((numLevels - 1)*4) << TM0S3_MIN_MIP_SHIFT;
- t->intel.dirty = I830_UPLOAD_TEX_ALL;
-
- return intelUploadTexImages( &i830->intel, &t->intel, 0 );
-}
-
-
-static void i830_import_tex_unit( i830ContextPtr i830,
- i830TextureObjectPtr t,
- GLuint unit )
-{
- if(INTEL_DEBUG&DEBUG_TEXTURE)
- fprintf(stderr, "%s unit(%d)\n", __FUNCTION__, unit);
-
- if (i830->intel.CurrentTexObj[unit])
- i830->intel.CurrentTexObj[unit]->base.bound &= ~(1U << unit);
-
- i830->intel.CurrentTexObj[unit] = (intelTextureObjectPtr)t;
- t->intel.base.bound |= (1 << unit);
-
- I830_STATECHANGE( i830, I830_UPLOAD_TEX(unit) );
-
- i830->state.Tex[unit][I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
- (LOAD_TEXTURE_MAP0 << unit) | 4);
- i830->state.Tex[unit][I830_TEXREG_TM0S0] = (TM0S0_USE_FENCE |
- t->intel.TextureOffset);
-
- i830->state.Tex[unit][I830_TEXREG_TM0S1] = t->Setup[I830_TEXREG_TM0S1];
- i830->state.Tex[unit][I830_TEXREG_TM0S2] = t->Setup[I830_TEXREG_TM0S2];
-
- i830->state.Tex[unit][I830_TEXREG_TM0S3] &= TM0S3_LOD_BIAS_MASK;
- i830->state.Tex[unit][I830_TEXREG_TM0S3] |= (t->Setup[I830_TEXREG_TM0S3] &
- ~TM0S3_LOD_BIAS_MASK);
-
- i830->state.Tex[unit][I830_TEXREG_TM0S4] = t->Setup[I830_TEXREG_TM0S4];
- i830->state.Tex[unit][I830_TEXREG_MCS] = (t->Setup[I830_TEXREG_MCS] &
- ~MAP_UNIT_MASK);
- i830->state.Tex[unit][I830_TEXREG_CUBE] = t->Setup[I830_TEXREG_CUBE];
- i830->state.Tex[unit][I830_TEXREG_MCS] |= MAP_UNIT(unit);
-
- t->intel.dirty &= ~I830_UPLOAD_TEX(unit);
-}
-
-
-
-static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
-
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- fprintf(stderr, "Texture border\n");
- return GL_FALSE;
- }
-
- /* Upload teximages (not pipelined)
- */
- if (t->intel.base.dirty_images[0]) {
- if (!i830SetTexImages( i830, tObj )) {
- return GL_FALSE;
- }
- }
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if (i830->intel.CurrentTexObj[unit] != &t->intel ||
- (t->intel.dirty & I830_UPLOAD_TEX(unit))) {
- i830_import_tex_unit( i830, t, unit);
- }
-
- I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), GL_TRUE);
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_rect( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- GLuint mcs = i830->state.Tex[unit][I830_TEXREG_MCS];
-
- mcs &= ~TEXCOORDS_ARE_NORMAL;
- mcs |= TEXCOORDS_ARE_IN_TEXELUNITS;
-
- if ((mcs != i830->state.Tex[unit][I830_TEXREG_MCS])
- || (0 != i830->state.Tex[unit][I830_TEXREG_CUBE])) {
- I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit));
- i830->state.Tex[unit][I830_TEXREG_MCS] = mcs;
- i830->state.Tex[unit][I830_TEXREG_CUBE] = 0;
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean enable_tex_2d( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- GLuint mcs = i830->state.Tex[unit][I830_TEXREG_MCS];
-
- mcs &= ~TEXCOORDS_ARE_IN_TEXELUNITS;
- mcs |= TEXCOORDS_ARE_NORMAL;
-
- if ((mcs != i830->state.Tex[unit][I830_TEXREG_MCS])
- || (0 != i830->state.Tex[unit][I830_TEXREG_CUBE])) {
- I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit));
- i830->state.Tex[unit][I830_TEXREG_MCS] = mcs;
- i830->state.Tex[unit][I830_TEXREG_CUBE] = 0;
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean enable_tex_cube( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
- GLuint mcs = i830->state.Tex[unit][I830_TEXREG_MCS];
- const GLuint cube = CUBE_NEGX_ENABLE | CUBE_POSX_ENABLE
- | CUBE_NEGY_ENABLE | CUBE_POSY_ENABLE
- | CUBE_NEGZ_ENABLE | CUBE_POSZ_ENABLE;
- GLuint face;
-
- mcs &= ~TEXCOORDS_ARE_IN_TEXELUNITS;
- mcs |= TEXCOORDS_ARE_NORMAL;
-
- if ((mcs != i830->state.Tex[unit][I830_TEXREG_MCS])
- || (cube != i830->state.Tex[unit][I830_TEXREG_CUBE])) {
- I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit));
- i830->state.Tex[unit][I830_TEXREG_MCS] = mcs;
- i830->state.Tex[unit][I830_TEXREG_CUBE] = cube;
- }
-
- /* Upload teximages (not pipelined)
- */
- if ( t->intel.base.dirty_images[0] || t->intel.base.dirty_images[1] ||
- t->intel.base.dirty_images[2] || t->intel.base.dirty_images[3] ||
- t->intel.base.dirty_images[4] || t->intel.base.dirty_images[5] ) {
- i830SetTexImages( i830, tObj );
- }
-
- /* upload (per face) */
- for (face = 0; face < 6; face++) {
- if (t->intel.base.dirty_images[face]) {
- if (!intelUploadTexImages( &i830->intel, &t->intel, face )) {
- return GL_FALSE;
- }
- }
- }
-
-
- return GL_TRUE;
-}
-
-
-static GLboolean disable_tex( GLcontext *ctx, GLuint unit )
-{
- i830ContextPtr i830 = I830_CONTEXT(ctx);
-
- /* This is happening too often. I need to conditionally send diffuse
- * state to the card. Perhaps a diffuse dirty flag of some kind.
- * Will need to change this logic if more than 2 texture units are
- * used. We need to only do this up to the last unit enabled, or unit
- * one if nothing is enabled.
- */
-
- if ( i830->intel.CurrentTexObj[unit] != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- i830->intel.CurrentTexObj[unit]->base.bound &= ~(1U << 0);
- i830->intel.CurrentTexObj[unit] = NULL;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean i830UpdateTexUnit( GLcontext *ctx, GLuint unit )
-{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (texUnit->_ReallyEnabled &&
- INTEL_CONTEXT(ctx)->intelScreen->textureSize < 2048 * 1024)
- return GL_FALSE;
-
- switch(texUnit->_ReallyEnabled) {
- case TEXTURE_1D_BIT:
- case TEXTURE_2D_BIT:
- return (enable_tex_common( ctx, unit ) &&
- enable_tex_2d( ctx, unit ));
- case TEXTURE_RECT_BIT:
- return (enable_tex_common( ctx, unit ) &&
- enable_tex_rect( ctx, unit ));
- case TEXTURE_CUBE_BIT:
- return (enable_tex_common( ctx, unit ) &&
- enable_tex_cube( ctx, unit ));
- case 0:
- return disable_tex( ctx, unit );
- default:
- return GL_FALSE;
- }
-}
-
-
-void i830UpdateTextureState( intelContextPtr intel )
-{
- i830ContextPtr i830 = I830_CONTEXT(intel);
- GLcontext *ctx = &intel->ctx;
- GLboolean ok;
-
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- I830_ACTIVESTATE(i830, I830_UPLOAD_TEX_ALL, GL_FALSE);
-
- ok = (i830UpdateTexUnit( ctx, 0 ) &&
- i830UpdateTexUnit( ctx, 1 ) &&
- i830UpdateTexUnit( ctx, 2 ) &&
- i830UpdateTexUnit( ctx, 3 ));
-
- FALLBACK( intel, I830_FALLBACK_TEXTURE, !ok );
-
- if (ok)
- i830EmitTextureBlend( i830 );
-}
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_vtbl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_vtbl.c
deleted file mode 100644
index 22939e8e5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ /dev/null
@@ -1,456 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "i830_context.h"
-#include "i830_reg.h"
-
-#include "intel_batchbuffer.h"
-
-#include "tnl/t_context.h"
-#include "tnl/t_vertex.h"
-
-static GLboolean i830_check_vertex_size( intelContextPtr intel,
- GLuint expected );
-
-#define SZ_TO_HW(sz) ((sz-2)&0x3)
-#define EMIT_SZ(sz) (EMIT_1F + (sz) - 1)
-#define EMIT_ATTR( ATTR, STYLE, V0 ) \
-do { \
- intel->vertex_attrs[intel->vertex_attr_count].attrib = (ATTR); \
- intel->vertex_attrs[intel->vertex_attr_count].format = (STYLE); \
- intel->vertex_attr_count++; \
- v0 |= V0; \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- intel->vertex_attrs[intel->vertex_attr_count].attrib = 0; \
- intel->vertex_attrs[intel->vertex_attr_count].format = EMIT_PAD; \
- intel->vertex_attrs[intel->vertex_attr_count].offset = (N); \
- intel->vertex_attr_count++; \
-} while (0)
-
-
-#define VRTX_TEX_SET_FMT(n, x) ((x)<<((n)*2))
-#define TEXBIND_SET(n, x) ((x)<<((n)*4))
-
-static void i830_render_start( intelContextPtr intel )
-{
- GLcontext *ctx = &intel->ctx;
- i830ContextPtr i830 = I830_CONTEXT(intel);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLuint v0 = _3DSTATE_VFT0_CMD;
- GLuint v2 = _3DSTATE_VFT1_CMD;
- GLuint mcsb1 = 0;
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- intel->vertex_attr_count = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if (index & _TNL_BITS_TEX_ANY) {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, VFT0_XYZW );
- intel->coloroffset = 4;
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, VFT0_XYZ );
- intel->coloroffset = 3;
- }
-
- if (index & _TNL_BIT_POINTSIZE) {
- EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, VFT0_POINT_WIDTH );
- }
-
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, VFT0_DIFFUSE );
-
- intel->specoffset = 0;
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
- if (index & _TNL_BIT_COLOR1) {
- intel->specoffset = intel->coloroffset + 1;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VFT0_SPEC );
- }
- else
- EMIT_PAD( 3 );
-
- if (index & _TNL_BIT_FOG)
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, VFT0_SPEC );
- else
- EMIT_PAD( 1 );
- }
-
- if (index & _TNL_BITS_TEX_ANY) {
- int i, count = 0;
-
- for (i = 0; i < I830_TEX_UNITS; i++) {
- if (index & _TNL_BIT_TEX(i)) {
- GLuint sz = VB->TexCoordPtr[i]->size;
- GLuint emit;
- GLuint mcs = (i830->state.Tex[i][I830_TEXREG_MCS] &
- ~TEXCOORDTYPE_MASK);
-
- switch (sz) {
- case 1:
- case 2:
- emit = EMIT_2F;
- sz = 2;
- mcs |= TEXCOORDTYPE_CARTESIAN;
- break;
- case 3:
- emit = EMIT_3F;
- sz = 3;
- mcs |= TEXCOORDTYPE_VECTOR;
- break;
- case 4:
- emit = EMIT_3F_XYW;
- sz = 3;
- mcs |= TEXCOORDTYPE_HOMOGENEOUS;
- break;
- default:
- continue;
- };
-
-
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, emit, 0 );
- v2 |= VRTX_TEX_SET_FMT(count, SZ_TO_HW(sz));
- mcsb1 |= (count+8)<<(i*4);
-
- if (mcs != i830->state.Tex[i][I830_TEXREG_MCS]) {
- I830_STATECHANGE(i830, I830_UPLOAD_TEX(i));
- i830->state.Tex[i][I830_TEXREG_MCS] = mcs;
- }
-
- count++;
- }
- }
-
- v0 |= VFT0_TEX_COUNT(count);
- }
-
- /* Only need to change the vertex emit code if there has been a
- * statechange to a new hardware vertex format:
- */
- if (v0 != i830->state.Ctx[I830_CTXREG_VF] ||
- v2 != i830->state.Ctx[I830_CTXREG_VF2] ||
- mcsb1 != i830->state.Ctx[I830_CTXREG_MCSB1] ||
- index != i830->last_index) {
-
- I830_STATECHANGE( i830, I830_UPLOAD_CTX );
-
- /* Must do this *after* statechange, so as not to affect
- * buffered vertices reliant on the old state:
- */
- intel->vertex_size =
- _tnl_install_attrs( ctx,
- intel->vertex_attrs,
- intel->vertex_attr_count,
- intel->ViewportMatrix.m, 0 );
-
- intel->vertex_size >>= 2;
-
- i830->state.Ctx[I830_CTXREG_VF] = v0;
- i830->state.Ctx[I830_CTXREG_VF2] = v2;
- i830->state.Ctx[I830_CTXREG_MCSB1] = mcsb1;
- i830->last_index = index;
-
- assert(i830_check_vertex_size( intel, intel->vertex_size ));
- }
-}
-
-static void i830_reduced_primitive_state( intelContextPtr intel,
- GLenum rprim )
-{
- i830ContextPtr i830 = I830_CONTEXT(intel);
- GLuint st1 = i830->state.Stipple[I830_STPREG_ST1];
-
- st1 &= ~ST1_ENABLE;
-
- switch (rprim) {
- case GL_TRIANGLES:
- if (intel->ctx.Polygon.StippleFlag &&
- intel->hw_stipple)
- st1 |= ST1_ENABLE;
- break;
- case GL_LINES:
- case GL_POINTS:
- default:
- break;
- }
-
- i830->intel.reduced_primitive = rprim;
-
- if (st1 != i830->state.Stipple[I830_STPREG_ST1]) {
- I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE);
- i830->state.Stipple[I830_STPREG_ST1] = st1;
- }
-}
-
-/* Pull apart the vertex format registers and figure out how large a
- * vertex is supposed to be.
- */
-static GLboolean i830_check_vertex_size( intelContextPtr intel,
- GLuint expected )
-{
- i830ContextPtr i830 = I830_CONTEXT(intel);
- int vft0 = i830->current->Ctx[I830_CTXREG_VF];
- int vft1 = i830->current->Ctx[I830_CTXREG_VF2];
- int nrtex = (vft0 & VFT0_TEX_COUNT_MASK) >> VFT0_TEX_COUNT_SHIFT;
- int i, sz = 0;
-
- switch (vft0 & VFT0_XYZW_MASK) {
- case VFT0_XY: sz = 2; break;
- case VFT0_XYZ: sz = 3; break;
- case VFT0_XYW: sz = 3; break;
- case VFT0_XYZW: sz = 4; break;
- default:
- fprintf(stderr, "no xyzw specified\n");
- return 0;
- }
-
- if (vft0 & VFT0_SPEC) sz++;
- if (vft0 & VFT0_DIFFUSE) sz++;
- if (vft0 & VFT0_DEPTH_OFFSET) sz++;
- if (vft0 & VFT0_POINT_WIDTH) sz++;
-
- for (i = 0 ; i < nrtex ; i++) {
- switch (vft1 & VFT1_TEX0_MASK) {
- case TEXCOORDFMT_2D: sz += 2; break;
- case TEXCOORDFMT_3D: sz += 3; break;
- case TEXCOORDFMT_4D: sz += 4; break;
- case TEXCOORDFMT_1D: sz += 1; break;
- }
- vft1 >>= VFT1_TEX1_SHIFT;
- }
-
- if (sz != expected)
- fprintf(stderr, "vertex size mismatch %d/%d\n", sz, expected);
-
- return sz == expected;
-}
-
-static void i830_emit_invarient_state( intelContextPtr intel )
-{
- BATCH_LOCALS;
-
- BEGIN_BATCH( 200 );
-
- OUT_BATCH(_3DSTATE_MAP_CUBE | MAP_UNIT(0));
- OUT_BATCH(_3DSTATE_MAP_CUBE | MAP_UNIT(1));
- OUT_BATCH(_3DSTATE_MAP_CUBE | MAP_UNIT(2));
- OUT_BATCH(_3DSTATE_MAP_CUBE | MAP_UNIT(3));
-
- OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_DFLT_Z_CMD);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_FOG_MODE_CMD);
- OUT_BATCH(FOGFUNC_ENABLE |
- FOG_LINEAR_CONST |
- FOGSRC_INDEX_Z |
- ENABLE_FOG_DENSITY);
- OUT_BATCH(0);
- OUT_BATCH(0);
-
-
- OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD |
- MAP_UNIT(0) |
- DISABLE_TEX_STREAM_BUMP |
- ENABLE_TEX_STREAM_COORD_SET |
- TEX_STREAM_COORD_SET(0) |
- ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(0));
- OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD |
- MAP_UNIT(1) |
- DISABLE_TEX_STREAM_BUMP |
- ENABLE_TEX_STREAM_COORD_SET |
- TEX_STREAM_COORD_SET(1) |
- ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(1));
- OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD |
- MAP_UNIT(2) |
- DISABLE_TEX_STREAM_BUMP |
- ENABLE_TEX_STREAM_COORD_SET |
- TEX_STREAM_COORD_SET(2) |
- ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(2));
- OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD |
- MAP_UNIT(3) |
- DISABLE_TEX_STREAM_BUMP |
- ENABLE_TEX_STREAM_COORD_SET |
- TEX_STREAM_COORD_SET(3) |
- ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(3));
-
- OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM);
- OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(0));
- OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM);
- OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(1));
- OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM);
- OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(2));
- OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM);
- OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(3));
-
- OUT_BATCH(_3DSTATE_RASTER_RULES_CMD |
- ENABLE_POINT_RASTER_RULE |
- OGL_POINT_RASTER_RULE |
- ENABLE_LINE_STRIP_PROVOKE_VRTX |
- ENABLE_TRI_FAN_PROVOKE_VRTX |
- ENABLE_TRI_STRIP_PROVOKE_VRTX |
- LINE_STRIP_PROVOKE_VRTX(1) |
- TRI_FAN_PROVOKE_VRTX(2) |
- TRI_STRIP_PROVOKE_VRTX(2));
-
- OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
-
- OUT_BATCH(_3DSTATE_SCISSOR_RECT_0_CMD);
- OUT_BATCH(0);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_VERTEX_TRANSFORM);
- OUT_BATCH(DISABLE_VIEWPORT_TRANSFORM | DISABLE_PERSPECTIVE_DIVIDE);
-
- OUT_BATCH(_3DSTATE_W_STATE_CMD);
- OUT_BATCH(MAGIC_W_STATE_DWORD1);
- OUT_BATCH(0x3f800000 /* 1.0 in IEEE float */ );
-
-
- OUT_BATCH(_3DSTATE_COLOR_FACTOR_CMD);
- OUT_BATCH(0x80808080); /* .5 required in alpha for GL_DOT3_RGBA_EXT */
-
- ADVANCE_BATCH();
-}
-
-
-#define emit( intel, state, size ) \
-do { \
- int k; \
- BEGIN_BATCH( size / sizeof(GLuint)); \
- for (k = 0 ; k < size / sizeof(GLuint) ; k++) \
- OUT_BATCH(state[k]); \
- ADVANCE_BATCH(); \
-} while (0);
-
-
-/* Push the state into the sarea and/or texture memory.
- */
-static void i830_emit_state( intelContextPtr intel )
-{
- i830ContextPtr i830 = I830_CONTEXT(intel);
- struct i830_hw_state *state = i830->current;
- int i;
- GLuint dirty;
- BATCH_LOCALS;
-
- dirty = state->active & ~state->emitted;
-
- if (dirty & I830_UPLOAD_CTX) {
- if (VERBOSE) fprintf(stderr, "I830_UPLOAD_CTX:\n");
- emit( i830, state->Ctx, sizeof(state->Ctx) );
- }
-
- if (dirty & I830_UPLOAD_BUFFERS) {
- if (VERBOSE) fprintf(stderr, "I830_UPLOAD_BUFFERS:\n");
- emit( i830, state->Buffer, sizeof(state->Buffer) );
- }
-
- if (dirty & I830_UPLOAD_STIPPLE) {
- if (VERBOSE) fprintf(stderr, "I830_UPLOAD_STIPPLE:\n");
- emit( i830, state->Stipple, sizeof(state->Stipple) );
- }
-
- for (i = 0; i < I830_TEX_UNITS; i++) {
- if ((dirty & I830_UPLOAD_TEX(i))) {
- if (VERBOSE) fprintf(stderr, "I830_UPLOAD_TEX(%d):\n", i);
- emit( i830, state->Tex[i], sizeof(state->Tex[i]));
- }
-
- if (dirty & I830_UPLOAD_TEXBLEND(i)) {
- if (VERBOSE) fprintf(stderr, "I830_UPLOAD_TEXBLEND(%d):\n", i);
- emit( i830, state->TexBlend[i],
- state->TexBlendWordsUsed[i] * 4 );
- }
- }
-
- state->emitted |= dirty;
-}
-
-static void i830_destroy_context( intelContextPtr intel )
-{
- _tnl_free_vertices(&intel->ctx);
-}
-
-static void i830_set_draw_offset( intelContextPtr intel, int offset )
-{
- i830ContextPtr i830 = I830_CONTEXT(intel);
- I830_STATECHANGE( i830, I830_UPLOAD_BUFFERS );
- i830->state.Buffer[I830_DESTREG_CBUFADDR2] = offset;
-}
-
-/* This isn't really handled at the moment.
- */
-static void i830_lost_hardware( intelContextPtr intel )
-{
- I830_CONTEXT(intel)->state.emitted = 0;
-}
-
-
-
-static void i830_emit_flush( intelContextPtr intel )
-{
- BATCH_LOCALS;
-
- BEGIN_BATCH(2);
- OUT_BATCH( MI_FLUSH | FLUSH_MAP_CACHE );
- OUT_BATCH( 0 );
- ADVANCE_BATCH();
-}
-
-
-
-
-void i830InitVtbl( i830ContextPtr i830 )
-{
- i830->intel.vtbl.alloc_tex_obj = i830AllocTexObj;
- i830->intel.vtbl.check_vertex_size = i830_check_vertex_size;
- i830->intel.vtbl.clear_with_tris = i830ClearWithTris;
- i830->intel.vtbl.destroy = i830_destroy_context;
- i830->intel.vtbl.emit_invarient_state = i830_emit_invarient_state;
- i830->intel.vtbl.emit_state = i830_emit_state;
- i830->intel.vtbl.lost_hardware = i830_lost_hardware;
- i830->intel.vtbl.reduced_primitive_state = i830_reduced_primitive_state;
- i830->intel.vtbl.set_draw_offset = i830_set_draw_offset;
- i830->intel.vtbl.update_texture_state = i830UpdateTextureState;
- i830->intel.vtbl.emit_flush = i830_emit_flush;
- i830->intel.vtbl.render_start = i830_render_start;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.c
deleted file mode 100644
index 42f91241b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "i915_context.h"
-#include "imports.h"
-#include "intel_tex.h"
-#include "intel_tris.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vertex.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "utils.h"
-#include "i915_reg.h"
-
-/***************************************
- * Mesa's Driver Functions
- ***************************************/
-
-static const struct dri_extension i915_extensions[] =
-{
- { "GL_ARB_depth_texture", NULL },
- { "GL_ARB_fragment_program", NULL },
- { "GL_ARB_shadow", NULL },
- { "GL_EXT_shadow_funcs", NULL },
- /* ARB extn won't work if not enabled */
- { "GL_SGIX_depth_texture", NULL },
- { NULL, NULL }
-};
-
-/* Override intel default.
- */
-static void i915InvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- _tnl_invalidate_vertex_state( ctx, new_state );
- INTEL_CONTEXT(ctx)->NewGLState |= new_state;
-
- /* Todo: gather state values under which tracked parameters become
- * invalidated, add callbacks for things like
- * ProgramLocalParameters, etc.
- */
- {
- struct i915_fragment_program *p =
- (struct i915_fragment_program *)ctx->FragmentProgram._Current;
- if (p && p->nr_params)
- p->params_uptodate = 0;
- }
-
- if (new_state & (_NEW_FOG|_NEW_HINT|_NEW_PROGRAM))
- i915_update_fog(ctx);
-}
-
-
-static void i915InitDriverFunctions( struct dd_function_table *functions )
-{
- intelInitDriverFunctions( functions );
- i915InitStateFunctions( functions );
- i915InitTextureFuncs( functions );
- i915InitFragProgFuncs( functions );
- functions->UpdateState = i915InvalidateState;
-}
-
-
-
-GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- struct dd_function_table functions;
- i915ContextPtr i915 = (i915ContextPtr) CALLOC_STRUCT(i915_context);
- intelContextPtr intel = &i915->intel;
- GLcontext *ctx = &intel->ctx;
-
- if (!i915) return GL_FALSE;
-
- i915InitVtbl( i915 );
-
- i915InitDriverFunctions( &functions );
-
- if (!intelInitContext( intel, mesaVis, driContextPriv,
- sharedContextPrivate, &functions )) {
- FREE(i915);
- return GL_FALSE;
- }
-
- ctx->Const.MaxTextureUnits = I915_TEX_UNITS;
- ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS;
- ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS;
-
- intel->nr_heaps = 1;
- intel->texture_heaps[0] =
- driCreateTextureHeap( 0, intel,
- intel->intelScreen->textureSize,
- 12,
- I830_NR_TEX_REGIONS,
- intel->sarea->texList,
- & intel->sarea->texAge,
- & intel->swapped,
- sizeof( struct i915_texture_object ),
- (destroy_texture_object_t *)intelDestroyTexObj );
-
- /* FIXME: driCalculateMaxTextureLevels assumes that mipmaps are
- * tightly packed, but they're not in Intel graphics
- * hardware.
- */
- ctx->Const.MaxTextureUnits = 1;
- driCalculateMaxTextureLevels( intel->texture_heaps,
- intel->nr_heaps,
- &intel->ctx.Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 8, /* 3D texture */
- 11, /* cube texture. */
- 11, /* rect texture */
- 12,
- GL_FALSE );
- ctx->Const.MaxTextureUnits = I915_TEX_UNITS;
-
- /* GL_ARB_fragment_program limits - don't think Mesa actually
- * validates programs against these, and in any case one ARB
- * instruction can translate to more than one HW instruction, so
- * we'll still have to check and fallback each time.
- */
-
- ctx->Const.MaxFragmentProgramTemps = I915_MAX_TEMPORARY;
- ctx->Const.MaxFragmentProgramAttribs = 11; /* 8 tex, 2 color, fog */
- ctx->Const.MaxFragmentProgramLocalParams = I915_MAX_CONSTANT;
- ctx->Const.MaxFragmentProgramEnvParams = I915_MAX_CONSTANT;
- ctx->Const.MaxFragmentProgramAluInstructions = I915_MAX_ALU_INSN;
- ctx->Const.MaxFragmentProgramTexInstructions = I915_MAX_TEX_INSN;
- ctx->Const.MaxFragmentProgramInstructions = (I915_MAX_ALU_INSN +
- I915_MAX_TEX_INSN);
- ctx->Const.MaxFragmentProgramTexIndirections = I915_MAX_TEX_INDIRECT;
- ctx->Const.MaxFragmentProgramAddressRegs = 0; /* I don't think we have one */
-
-
- driInitExtensions( ctx, i915_extensions, GL_FALSE );
-
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- 36 * sizeof(GLfloat) );
-
- intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf;
-
- i915InitState( i915 );
-
- return GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.h
deleted file mode 100644
index 804627764..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_context.h
+++ /dev/null
@@ -1,351 +0,0 @@
- /**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef I915CONTEXT_INC
-#define I915CONTEXT_INC
-
-#include "intel_context.h"
-
-#define I915_FALLBACK_TEXTURE 0x1000
-#define I915_FALLBACK_COLORMASK 0x2000
-#define I915_FALLBACK_STENCIL 0x4000
-#define I915_FALLBACK_STIPPLE 0x8000
-#define I915_FALLBACK_PROGRAM 0x10000
-#define I915_FALLBACK_LOGICOP 0x20000
-
-#define I915_UPLOAD_CTX 0x1
-#define I915_UPLOAD_BUFFERS 0x2
-#define I915_UPLOAD_STIPPLE 0x4
-#define I915_UPLOAD_PROGRAM 0x8
-#define I915_UPLOAD_CONSTANTS 0x10
-#define I915_UPLOAD_FOG 0x20
-#define I915_UPLOAD_TEX(i) (0x00010000<<(i))
-#define I915_UPLOAD_TEX_ALL (0x00ff0000)
-#define I915_UPLOAD_TEX_0_SHIFT 16
-
-
-/* State structure offsets - these will probably disappear.
- */
-#define I915_DESTREG_CBUFADDR0 0
-#define I915_DESTREG_CBUFADDR1 1
-#define I915_DESTREG_CBUFADDR2 2
-#define I915_DESTREG_DBUFADDR0 3
-#define I915_DESTREG_DBUFADDR1 4
-#define I915_DESTREG_DBUFADDR2 5
-#define I915_DESTREG_DV0 6
-#define I915_DESTREG_DV1 7
-#define I915_DESTREG_SENABLE 8
-#define I915_DESTREG_SR0 9
-#define I915_DESTREG_SR1 10
-#define I915_DESTREG_SR2 11
-#define I915_DEST_SETUP_SIZE 12
-
-#define I915_CTXREG_STATE4 0
-#define I915_CTXREG_LI 1
-#define I915_CTXREG_LIS2 2
-#define I915_CTXREG_LIS4 3
-#define I915_CTXREG_LIS5 4
-#define I915_CTXREG_LIS6 5
-#define I915_CTXREG_IAB 6
-#define I915_CTXREG_BLENDCOLOR0 7
-#define I915_CTXREG_BLENDCOLOR1 8
-#define I915_CTX_SETUP_SIZE 9
-
-#define I915_FOGREG_COLOR 0
-#define I915_FOGREG_MODE0 1
-#define I915_FOGREG_MODE1 2
-#define I915_FOGREG_MODE2 3
-#define I915_FOGREG_MODE3 4
-#define I915_FOG_SETUP_SIZE 5
-
-#define I915_STPREG_ST0 0
-#define I915_STPREG_ST1 1
-#define I915_STP_SETUP_SIZE 2
-
-#define I915_TEXREG_MS2 0
-#define I915_TEXREG_MS3 1
-#define I915_TEXREG_MS4 2
-#define I915_TEXREG_SS2 3
-#define I915_TEXREG_SS3 4
-#define I915_TEXREG_SS4 5
-#define I915_TEX_SETUP_SIZE 6
-
-#define I915_MAX_CONSTANT 32
-#define I915_CONSTANT_SIZE (2+(4*I915_MAX_CONSTANT))
-
-
-#define I915_PROGRAM_SIZE 192
-
-
-/* Hardware version of a parsed fragment program. "Derived" from the
- * mesa fragment_program struct.
- */
-struct i915_fragment_program {
- struct fragment_program FragProg;
-
- GLboolean translated;
- GLboolean params_uptodate;
- GLboolean on_hardware;
- GLboolean error; /* If program is malformed for any reason. */
-
- GLuint nr_tex_indirect;
- GLuint nr_tex_insn;
- GLuint nr_alu_insn;
- GLuint nr_decl_insn;
-
-
-
-
- /* TODO: split between the stored representation of a program and
- * the state used to build that representation.
- */
- GLcontext *ctx;
-
- GLuint declarations[I915_PROGRAM_SIZE];
- GLuint program[I915_PROGRAM_SIZE];
-
- GLfloat constant[I915_MAX_CONSTANT][4];
- GLuint constant_flags[I915_MAX_CONSTANT];
- GLuint nr_constants;
-
- GLuint *csr; /* Cursor, points into program.
- */
-
- GLuint *decl; /* Cursor, points into declarations.
- */
-
- GLuint decl_s; /* flags for which s regs need to be decl'd */
- GLuint decl_t; /* flags for which t regs need to be decl'd */
-
- GLuint temp_flag; /* Tracks temporary regs which are in
- * use.
- */
-
- GLuint utemp_flag; /* Tracks TYPE_U temporary regs which are in
- * use.
- */
-
-
-
- /* Helpers for i915_fragprog.c:
- */
- GLuint wpos_tex;
- GLboolean depth_written;
-
- struct {
- GLuint reg; /* Hardware constant idx */
- const GLfloat *values; /* Pointer to tracked values */
- } param[I915_MAX_CONSTANT];
- GLuint nr_params;
-
-
-
-
- /* Helpers for i915_texprog.c:
- */
- GLuint src_texture; /* Reg containing sampled texture color,
- * else UREG_BAD.
- */
-
- GLuint src_previous; /* Reg containing color from previous
- * stage. May need to be decl'd.
- */
-
- GLuint last_tex_stage; /* Number of last enabled texture unit */
-
- struct vertex_buffer *VB;
-};
-
-
-
-
-
-
-struct i915_texture_object
-{
- struct intel_texture_object intel;
- GLenum lastTarget;
- GLboolean refs_border_color;
- GLuint Setup[I915_TEX_SETUP_SIZE];
-};
-
-#define I915_TEX_UNITS 8
-
-
-struct i915_hw_state {
- GLuint Ctx[I915_CTX_SETUP_SIZE];
- GLuint Buffer[I915_DEST_SETUP_SIZE];
- GLuint Stipple[I915_STP_SETUP_SIZE];
- GLuint Fog[I915_FOG_SETUP_SIZE];
- GLuint Tex[I915_TEX_UNITS][I915_TEX_SETUP_SIZE];
- GLuint Constant[I915_CONSTANT_SIZE];
- GLuint ConstantSize;
- GLuint Program[I915_PROGRAM_SIZE];
- GLuint ProgramSize;
- GLuint active; /* I915_UPLOAD_* */
- GLuint emitted; /* I915_UPLOAD_* */
-};
-
-#define I915_FOG_PIXEL 2
-#define I915_FOG_VERTEX 1
-#define I915_FOG_NONE 0
-
-struct i915_context
-{
- struct intel_context intel;
-
- GLuint last_ReallyEnabled;
- GLuint vertex_fog;
-
- struct i915_fragment_program tex_program;
- struct i915_fragment_program *current_program;
-
- struct i915_hw_state meta, initial, state, *current;
-};
-
-
-typedef struct i915_context *i915ContextPtr;
-typedef struct i915_texture_object *i915TextureObjectPtr;
-
-#define I915_CONTEXT(ctx) ((i915ContextPtr)(ctx))
-
-
-
-#define I915_STATECHANGE(i915, flag) \
-do { \
- if (0) fprintf(stderr, "I915_STATECHANGE %x in %s\n", flag, __FUNCTION__); \
- INTEL_FIREVERTICES( &(i915)->intel ); \
- (i915)->state.emitted &= ~(flag); \
-} while (0)
-
-#define I915_ACTIVESTATE(i915, flag, mode) \
-do { \
- if (0) fprintf(stderr, "I915_ACTIVESTATE %x %d in %s\n", \
- flag, mode, __FUNCTION__); \
- INTEL_FIREVERTICES( &(i915)->intel ); \
- if (mode) \
- (i915)->state.active |= (flag); \
- else \
- (i915)->state.active &= ~(flag); \
-} while (0)
-
-
-/*======================================================================
- * i915_vtbl.c
- */
-extern void i915InitVtbl( i915ContextPtr i915 );
-
-
-
-#define SZ_TO_HW(sz) ((sz-2)&0x3)
-#define EMIT_SZ(sz) (EMIT_1F + (sz) - 1)
-#define EMIT_ATTR( ATTR, STYLE, S4, SZ ) \
-do { \
- intel->vertex_attrs[intel->vertex_attr_count].attrib = (ATTR); \
- intel->vertex_attrs[intel->vertex_attr_count].format = (STYLE); \
- s4 |= S4; \
- intel->vertex_attr_count++; \
- offset += (SZ); \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- intel->vertex_attrs[intel->vertex_attr_count].attrib = 0; \
- intel->vertex_attrs[intel->vertex_attr_count].format = EMIT_PAD; \
- intel->vertex_attrs[intel->vertex_attr_count].offset = (N); \
- intel->vertex_attr_count++; \
- offset += (N); \
-} while (0)
-
-
-
-/*======================================================================
- * i915_context.c
- */
-extern GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-
-/*======================================================================
- * i915_texprog.c
- */
-extern void i915ValidateTextureProgram( i915ContextPtr i915 );
-
-
-/*======================================================================
- * i915_debug.c
- */
-extern void i915_disassemble_program( const GLuint *program, GLuint sz );
-extern void i915_print_ureg( const char *msg, GLuint ureg );
-
-
-/*======================================================================
- * i915_state.c
- */
-extern void i915InitStateFunctions( struct dd_function_table *functions );
-extern void i915InitState( i915ContextPtr i915 );
-extern void i915_update_fog( GLcontext *ctx );
-
-
-/*======================================================================
- * i915_tex.c
- */
-extern void i915UpdateTextureState( intelContextPtr intel );
-extern void i915InitTextureFuncs( struct dd_function_table *functions );
-extern intelTextureObjectPtr i915AllocTexObj( struct gl_texture_object *texObj );
-
-/*======================================================================
- * i915_metaops.c
- */
-extern GLboolean
-i915TryTextureReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels );
-
-extern GLboolean
-i915TryTextureDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels );
-
-extern void
-i915ClearWithTris( intelContextPtr intel, GLbitfield mask,
- GLboolean all, GLint cx, GLint cy, GLint cw, GLint ch);
-
-
-/*======================================================================
- * i915_fragprog.c
- */
-extern void i915ValidateFragmentProgram( i915ContextPtr i915 );
-extern void i915InitFragProgFuncs( struct dd_function_table *functions );
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_debug.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_debug.c
deleted file mode 100644
index 054b56160..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_debug.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "i915_reg.h"
-#include "i915_context.h"
-#include <stdio.h>
-
-
-static const char *opcodes[0x20] = {
- "NOP",
- "ADD",
- "MOV",
- "MUL",
- "MAD",
- "DP2ADD",
- "DP3",
- "DP4",
- "FRC",
- "RCP",
- "RSQ",
- "EXP",
- "LOG",
- "CMP",
- "MIN",
- "MAX",
- "FLR",
- "MOD",
- "TRC",
- "SGE",
- "SLT",
- "TEXLD",
- "TEXLDP",
- "TEXLDB",
- "TEXKILL",
- "DCL",
- "0x1a",
- "0x1b",
- "0x1c",
- "0x1d",
- "0x1e",
- "0x1f",
-};
-
-
-static const int args[0x20] = {
- 0, /* 0 nop */
- 2, /* 1 add */
- 1, /* 2 mov */
- 2, /* 3 m ul */
- 3, /* 4 mad */
- 3, /* 5 dp2add */
- 2, /* 6 dp3 */
- 2, /* 7 dp4 */
- 1, /* 8 frc */
- 1, /* 9 rcp */
- 1, /* a rsq */
- 1, /* b exp */
- 1, /* c log */
- 3, /* d cmp */
- 2, /* e min */
- 2, /* f max */
- 1, /* 10 flr */
- 1, /* 11 mod */
- 1, /* 12 trc */
- 2, /* 13 sge */
- 2, /* 14 slt */
- 1,
- 1,
- 1,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-};
-
-
-static const char *regname[0x8] = {
- "R",
- "T",
- "CONST",
- "S",
- "OC",
- "OD",
- "U",
- "UNKNOWN",
-};
-
-static void print_reg_type_nr( GLuint type, GLuint nr )
-{
- switch (type) {
- case REG_TYPE_T:
- switch (nr) {
- case T_DIFFUSE: fprintf(stderr, "T_DIFFUSE"); return;
- case T_SPECULAR: fprintf(stderr, "T_SPECULAR"); return;
- case T_FOG_W: fprintf(stderr, "T_FOG_W"); return;
- default: fprintf(stderr, "T_TEX%d", nr); return;
- }
- case REG_TYPE_OC:
- if (nr == 0) {
- fprintf(stderr, "oC");
- return;
- }
- break;
- case REG_TYPE_OD:
- if (nr == 0) {
- fprintf(stderr, "oD");
- return;
- }
- break;
- default:
- break;
- }
-
- fprintf(stderr, "%s[%d]", regname[type], nr);
-}
-
-#define REG_SWIZZLE_MASK 0x7777
-#define REG_NEGATE_MASK 0x8888
-
-#define REG_SWIZZLE_XYZW ((SRC_X << A2_SRC2_CHANNEL_X_SHIFT) | \
- (SRC_Y << A2_SRC2_CHANNEL_Y_SHIFT) | \
- (SRC_Z << A2_SRC2_CHANNEL_Z_SHIFT) | \
- (SRC_W << A2_SRC2_CHANNEL_W_SHIFT))
-
-
-static void print_reg_neg_swizzle( GLuint reg )
-{
- int i;
-
- if ((reg & REG_SWIZZLE_MASK) == REG_SWIZZLE_XYZW &&
- (reg & REG_NEGATE_MASK) == 0)
- return;
-
- fprintf(stderr, ".");
-
- for (i = 3 ; i >= 0; i--) {
- if (reg & (1<<((i*4)+3)))
- fprintf(stderr, "-");
-
- switch ((reg>>(i*4)) & 0x7) {
- case 0: fprintf(stderr, "x"); break;
- case 1: fprintf(stderr, "y"); break;
- case 2: fprintf(stderr, "z"); break;
- case 3: fprintf(stderr, "w"); break;
- case 4: fprintf(stderr, "0"); break;
- case 5: fprintf(stderr, "1"); break;
- default: fprintf(stderr, "?"); break;
- }
- }
-}
-
-
-static void print_src_reg( GLuint dword )
-{
- GLuint nr = (dword >> A2_SRC2_NR_SHIFT) & REG_NR_MASK;
- GLuint type = (dword >> A2_SRC2_TYPE_SHIFT) & REG_TYPE_MASK;
- print_reg_type_nr( type, nr );
- print_reg_neg_swizzle( dword );
-}
-
-void i915_print_ureg( const char *msg, GLuint ureg )
-{
- fprintf(stderr, "%s: ", msg);
- print_src_reg( ureg >> 8 );
- fprintf(stderr, "\n");
-}
-
-static void print_dest_reg( GLuint dword )
-{
- GLuint nr = (dword >> A0_DEST_NR_SHIFT) & REG_NR_MASK;
- GLuint type = (dword >> A0_DEST_TYPE_SHIFT) & REG_TYPE_MASK;
- print_reg_type_nr( type, nr );
- if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL)
- return;
- fprintf(stderr, ".");
- if (dword & A0_DEST_CHANNEL_X) fprintf(stderr, "x");
- if (dword & A0_DEST_CHANNEL_Y) fprintf(stderr, "y");
- if (dword & A0_DEST_CHANNEL_Z) fprintf(stderr, "z");
- if (dword & A0_DEST_CHANNEL_W) fprintf(stderr, "w");
-}
-
-
-#define GET_SRC0_REG(r0, r1) ((r0<<14)|(r1>>A1_SRC0_CHANNEL_W_SHIFT))
-#define GET_SRC1_REG(r0, r1) ((r0<<8)|(r1>>A2_SRC1_CHANNEL_W_SHIFT))
-#define GET_SRC2_REG(r) (r)
-
-
-static void print_arith_op( GLuint opcode, const GLuint *program )
-{
- if (opcode != A0_NOP) {
- print_dest_reg(program[0]);
- if (program[0] & A0_DEST_SATURATE)
- fprintf(stderr, " = SATURATE ");
- else
- fprintf(stderr, " = ");
- }
-
- fprintf(stderr, "%s ", opcodes[opcode]);
-
- print_src_reg(GET_SRC0_REG(program[0], program[1]));
- if (args[opcode] == 1) {
- fprintf(stderr, "\n");
- return;
- }
-
- fprintf(stderr, ", ");
- print_src_reg(GET_SRC1_REG(program[1], program[2]));
- if (args[opcode] == 2) {
- fprintf(stderr, "\n");
- return;
- }
-
- fprintf(stderr, ", ");
- print_src_reg(GET_SRC2_REG(program[2]));
- fprintf(stderr, "\n");
- return;
-}
-
-
-static void print_tex_op( GLuint opcode, const GLuint *program )
-{
- print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL);
- fprintf(stderr, " = ");
-
- fprintf(stderr, "%s ", opcodes[opcode]);
-
- fprintf(stderr, "S[%d],",
- program[0] & T0_SAMPLER_NR_MASK);
-
- print_reg_type_nr( (program[1]>>T1_ADDRESS_REG_TYPE_SHIFT) & REG_TYPE_MASK,
- (program[1]>>T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK );
- fprintf(stderr, "\n");
-}
-
-static void print_dcl_op( GLuint opcode, const GLuint *program )
-{
- fprintf(stderr, "%s ", opcodes[opcode]);
- print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL);
- fprintf(stderr, "\n");
-}
-
-
-void i915_disassemble_program( const GLuint *program, GLuint sz )
-{
- GLuint size = program[0] & 0x1ff;
- GLint i;
-
- fprintf(stderr, "BEGIN\n");
-
- if (size+2 != sz) {
- fprintf(stderr, "%s: program size mismatch %d/%d\n", __FUNCTION__,
- size+2, sz);
- exit(1);
- }
-
- program ++;
- for (i = 1 ; i < sz ; i+=3, program+=3) {
- GLuint opcode = program[0] & (0x1f<<24);
-
- if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT)
- print_arith_op(opcode >> 24, program);
- else if (opcode >= T0_TEXLD && opcode <= T0_TEXKILL)
- print_tex_op(opcode >> 24, program);
- else if (opcode == D0_DCL)
- print_dcl_op(opcode >> 24, program);
- else
- fprintf(stderr, "Unknown opcode 0x%x\n", opcode);
- }
-
- fprintf(stderr, "END\n\n");
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c
deleted file mode 100644
index b69252d2a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ /dev/null
@@ -1,1065 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
-#include "tnl/t_context.h"
-#include "intel_batchbuffer.h"
-
-#include "i915_reg.h"
-#include "i915_context.h"
-#include "i915_program.h"
-
-#include "nvfragprog.h"
-#include "program.h"
-#include "arbfragparse.h"
-
-
-
-#undef PI
-#define PI 3.141592
-
-
-/* 1, -1/3!, 1/5!, -1/7! */
-static const GLfloat sin_constants[4] = { 1.0,
- -1.0/(3*2*1),
- 1.0/(5*4*3*2*1),
- -1.0/(7*6*5*4*3*2*1) };
-
-/* 1, -1/2!, 1/4!, -1/6! */
-static const GLfloat cos_constants[4] = { 1.0,
- -1.0/(2*1),
- 1.0/(4*3*2*1),
- -1.0/(6*5*4*3*2*1) };
-
-/**
- * Retrieve a ureg for the given source register. Will emit
- * constants, apply swizzling and negation as needed.
- */
-static GLuint src_vector( struct i915_fragment_program *p,
- const struct fp_src_register *source,
- const struct fragment_program *program )
-{
- GLuint src;
-
- switch (source->File) {
-
- /* Registers:
- */
- case PROGRAM_TEMPORARY:
- if (source->Index >= I915_MAX_TEMPORARY) {
- i915_program_error( p, "Exceeded max temporary reg" );
- return 0;
- }
- src = UREG( REG_TYPE_R, source->Index );
- break;
- case PROGRAM_INPUT:
- switch (source->Index) {
- case FRAG_ATTRIB_WPOS:
- src = i915_emit_decl( p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL );
- break;
- case FRAG_ATTRIB_COL0:
- src = i915_emit_decl( p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL );
- break;
- case FRAG_ATTRIB_COL1:
- src = i915_emit_decl( p, REG_TYPE_T, T_SPECULAR, D0_CHANNEL_XYZ );
- src = swizzle( src, X, Y, Z, ONE );
- break;
- case FRAG_ATTRIB_FOGC:
- src = i915_emit_decl( p, REG_TYPE_T, T_FOG_W, D0_CHANNEL_W );
- src = swizzle( src, W, W, W, W );
- break;
- case FRAG_ATTRIB_TEX0:
- case FRAG_ATTRIB_TEX1:
- case FRAG_ATTRIB_TEX2:
- case FRAG_ATTRIB_TEX3:
- case FRAG_ATTRIB_TEX4:
- case FRAG_ATTRIB_TEX5:
- case FRAG_ATTRIB_TEX6:
- case FRAG_ATTRIB_TEX7:
- src = i915_emit_decl( p, REG_TYPE_T,
- T_TEX0 + (source->Index - FRAG_ATTRIB_TEX0),
- D0_CHANNEL_ALL );
- break;
-
- default:
- i915_program_error( p, "Bad source->Index" );
- return 0;
- }
- break;
-
- /* Various paramters and env values. All emitted to
- * hardware as program constants.
- */
- case PROGRAM_LOCAL_PARAM:
- src = i915_emit_param4fv(
- p, program->Base.LocalParams[source->Index]);
- break;
-
- case PROGRAM_ENV_PARAM:
- src = i915_emit_param4fv(
- p, p->ctx->FragmentProgram.Parameters[source->Index]);
- break;
-
- case PROGRAM_STATE_VAR:
- case PROGRAM_NAMED_PARAM:
- src = i915_emit_param4fv(
- p, program->Parameters->ParameterValues[source->Index] );
- break;
-
- default:
- i915_program_error( p, "Bad source->File" );
- return 0;
- }
-
- src = swizzle(src,
- GET_SWZ(source->Swizzle, 0),
- GET_SWZ(source->Swizzle, 1),
- GET_SWZ(source->Swizzle, 2),
- GET_SWZ(source->Swizzle, 3));
-
- if (source->NegateBase)
- src = negate( src, 1,1,1,1 );
-
- return src;
-}
-
-
-static GLuint get_result_vector( struct i915_fragment_program *p,
- const struct fp_instruction *inst )
-{
- switch (inst->DstReg.File) {
- case PROGRAM_OUTPUT:
- switch (inst->DstReg.Index) {
- case FRAG_OUTPUT_COLR:
- return UREG(REG_TYPE_OC, 0);
- case FRAG_OUTPUT_DEPR:
- p->depth_written = 1;
- return UREG(REG_TYPE_OD, 0);
- default:
- i915_program_error( p, "Bad inst->DstReg.Index" );
- return 0;
- }
- case PROGRAM_TEMPORARY:
- return UREG(REG_TYPE_R, inst->DstReg.Index);
- default:
- i915_program_error( p, "Bad inst->DstReg.File" );
- return 0;
- }
-}
-
-static GLuint get_result_flags( const struct fp_instruction *inst )
-{
- GLuint flags = 0;
-
- if (inst->Saturate) flags |= A0_DEST_SATURATE;
- if (inst->DstReg.WriteMask & WRITEMASK_X) flags |= A0_DEST_CHANNEL_X;
- if (inst->DstReg.WriteMask & WRITEMASK_Y) flags |= A0_DEST_CHANNEL_Y;
- if (inst->DstReg.WriteMask & WRITEMASK_Z) flags |= A0_DEST_CHANNEL_Z;
- if (inst->DstReg.WriteMask & WRITEMASK_W) flags |= A0_DEST_CHANNEL_W;
-
- return flags;
-}
-
-static GLuint translate_tex_src_idx( struct i915_fragment_program *p,
- GLubyte bit )
-{
- switch (bit) {
- case TEXTURE_1D_INDEX: return D0_SAMPLE_TYPE_2D;
- case TEXTURE_2D_INDEX: return D0_SAMPLE_TYPE_2D;
- case TEXTURE_RECT_INDEX: return D0_SAMPLE_TYPE_2D;
- case TEXTURE_3D_INDEX: return D0_SAMPLE_TYPE_VOLUME;
- case TEXTURE_CUBE_INDEX: return D0_SAMPLE_TYPE_CUBE;
- default: i915_program_error(p, "TexSrcBit"); return 0;
- }
-}
-
-#define EMIT_TEX( OP ) \
-do { \
- GLuint dim = translate_tex_src_idx( p, inst->TexSrcIdx ); \
- GLuint sampler = i915_emit_decl(p, REG_TYPE_S, \
- inst->TexSrcUnit, dim); \
- GLuint coord = src_vector( p, &inst->SrcReg[0], program); \
- /* Texel lookup */ \
- \
- i915_emit_texld( p, \
- get_result_vector( p, inst ), \
- get_result_flags( inst ), \
- sampler, \
- coord, \
- OP); \
-} while (0)
-
-#define EMIT_ARITH( OP, N ) \
-do { \
- i915_emit_arith( p, \
- OP, \
- get_result_vector( p, inst ), \
- get_result_flags( inst ), 0, \
- (N<1)?0:src_vector( p, &inst->SrcReg[0], program), \
- (N<2)?0:src_vector( p, &inst->SrcReg[1], program), \
- (N<3)?0:src_vector( p, &inst->SrcReg[2], program)); \
-} while (0)
-
-#define EMIT_1ARG_ARITH( OP ) EMIT_ARITH( OP, 1 )
-#define EMIT_2ARG_ARITH( OP ) EMIT_ARITH( OP, 2 )
-#define EMIT_3ARG_ARITH( OP ) EMIT_ARITH( OP, 3 )
-
-
-/* Possible concerns:
- *
- * SIN, COS -- could use another taylor step?
- * LIT -- results seem a little different to sw mesa
- * LOG -- different to mesa on negative numbers, but this is conformant.
- *
- * Parse failures -- Mesa doesn't currently give a good indication
- * internally whether a particular program string parsed or not. This
- * can lead to confusion -- hopefully we cope with it ok now.
- *
- */
-static void upload_program( struct i915_fragment_program *p )
-{
- const struct fragment_program *program = p->ctx->FragmentProgram._Current;
- const struct fp_instruction *inst = program->Instructions;
-
-/* _mesa_debug_fp_inst(program->Base.NumInstructions, inst); */
-
- /* Is this a parse-failed program? Ensure a valid program is
- * loaded, as the flagging of an error isn't sufficient to stop
- * this being uploaded to hardware.
- */
- if (inst[0].Opcode == FP_OPCODE_END) {
- GLuint tmp = i915_get_utemp( p );
- i915_emit_arith( p,
- A0_MOV,
- UREG(REG_TYPE_OC, 0),
- A0_DEST_CHANNEL_ALL, 0,
- swizzle(tmp,ONE,ZERO,ONE,ONE), 0, 0);
- return;
- }
-
- while (1) {
- GLuint src0, src1, src2, flags;
- GLuint tmp = 0;
-
- switch (inst->Opcode) {
- case FP_OPCODE_ABS:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- i915_emit_arith( p,
- A0_MAX,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- src0, negate(src0, 1,1,1,1), 0);
- break;
-
- case FP_OPCODE_ADD:
- EMIT_2ARG_ARITH( A0_ADD );
- break;
-
- case FP_OPCODE_CMP:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
- src2 = src_vector( p, &inst->SrcReg[2], program);
- i915_emit_arith( p,
- A0_CMP,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- src0, src2, src1); /* NOTE: order of src2, src1 */
- break;
-
- case FP_OPCODE_COS:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- tmp = i915_get_utemp( p );
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_X, 0,
- src0,
- i915_emit_const1f(p, 1.0/(PI * 2)),
- 0);
-
- i915_emit_arith( p,
- A0_MOD,
- tmp, A0_DEST_CHANNEL_X, 0,
- tmp,
- 0, 0 );
-
- /* By choosing different taylor constants, could get rid of this mul:
- */
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_X, 0,
- tmp,
- i915_emit_const1f(p, (PI * 2)),
- 0);
-
- /*
- * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1
- * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, 1
- * t0 = MUL t0.xxz1 t0.z111 ; x^6 x^4 x^2 1
- * result = DP4 t0, cos_constants
- */
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_XY, 0,
- swizzle(tmp, X,X,ONE,ONE),
- swizzle(tmp, X,ONE,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_XYZ, 0,
- swizzle(tmp, X,Y,X,ONE),
- swizzle(tmp, X,X,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_XYZ, 0,
- swizzle(tmp, X,X,Z,ONE),
- swizzle(tmp, Z,ONE,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_DP4,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(tmp, ONE,Z,Y,X),
- i915_emit_const4fv( p, cos_constants ), 0);
-
- break;
-
- case FP_OPCODE_DP3:
- EMIT_2ARG_ARITH( A0_DP3 );
- break;
-
- case FP_OPCODE_DP4:
- EMIT_2ARG_ARITH( A0_DP4 );
- break;
-
- case FP_OPCODE_DPH:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
-
- i915_emit_arith( p,
- A0_DP4,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0, X,Y,Z,ONE), src1, 0);
- break;
-
- case FP_OPCODE_DST:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
-
- /* result[0] = 1 * 1;
- * result[1] = a[1] * b[1];
- * result[2] = a[2] * 1;
- * result[3] = 1 * b[3];
- */
- i915_emit_arith( p,
- A0_MUL,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0, ONE, Y, Z, ONE),
- swizzle(src1, ONE, Y, ONE, W ),
- 0);
- break;
-
- case FP_OPCODE_EX2:
- src0 = src_vector( p, &inst->SrcReg[0], program);
-
- i915_emit_arith( p,
- A0_EXP,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0,X,X,X,X), 0, 0);
- break;
-
- case FP_OPCODE_FLR:
- EMIT_1ARG_ARITH( A0_FLR );
- break;
-
- case FP_OPCODE_FRC:
- EMIT_1ARG_ARITH( A0_FRC );
- break;
-
- case FP_OPCODE_KIL:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- tmp = i915_get_utemp( p );
-
- i915_emit_texld( p,
- tmp, A0_DEST_CHANNEL_ALL, /* use a dummy dest reg */
- 0,
- src0,
- T0_TEXKILL );
- break;
-
- case FP_OPCODE_LG2:
- src0 = src_vector( p, &inst->SrcReg[0], program);
-
- i915_emit_arith( p,
- A0_LOG,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0,X,X,X,X), 0, 0);
- break;
-
- case FP_OPCODE_LIT:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- tmp = i915_get_utemp( p );
-
- /* tmp = max( a.xyzw, a.00zw )
- * XXX: Clamp tmp.w to -128..128
- * tmp.y = log(tmp.y)
- * tmp.y = tmp.w * tmp.y
- * tmp.y = exp(tmp.y)
- * result = cmp (a.11-x1, a.1x01, a.1xy1 )
- */
- i915_emit_arith( p, A0_MAX, tmp, A0_DEST_CHANNEL_ALL, 0,
- src0, swizzle(src0, ZERO, ZERO, Z, W), 0 );
-
- i915_emit_arith( p, A0_LOG, tmp, A0_DEST_CHANNEL_Y, 0,
- swizzle(tmp, Y, Y, Y, Y), 0, 0 );
-
- i915_emit_arith( p, A0_MUL, tmp, A0_DEST_CHANNEL_Y, 0,
- swizzle(tmp, ZERO, Y, ZERO, ZERO),
- swizzle(tmp, ZERO, W, ZERO, ZERO), 0 );
-
- i915_emit_arith( p, A0_EXP, tmp, A0_DEST_CHANNEL_Y, 0,
- swizzle(tmp, Y, Y, Y, Y), 0, 0 );
-
- i915_emit_arith( p, A0_CMP,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- negate(swizzle(tmp, ONE, ONE, X, ONE),0,0,1,0),
- swizzle(tmp, ONE, X, ZERO, ONE),
- swizzle(tmp, ONE, X, Y, ONE));
-
- break;
-
- case FP_OPCODE_LRP:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
- src2 = src_vector( p, &inst->SrcReg[2], program);
- flags = get_result_flags( inst );
- tmp = i915_get_utemp( p );
-
- /* b*a + c*(1-a)
- *
- * b*a + c - ca
- *
- * tmp = b*a + c,
- * result = (-c)*a + tmp
- */
- i915_emit_arith( p, A0_MAD, tmp,
- flags & A0_DEST_CHANNEL_ALL, 0,
- src1, src0, src2 );
-
- i915_emit_arith( p, A0_MAD,
- get_result_vector( p, inst ),
- flags, 0,
- negate(src2, 1,1,1,1), src0, tmp );
- break;
-
- case FP_OPCODE_MAD:
- EMIT_3ARG_ARITH( A0_MAD );
- break;
-
- case FP_OPCODE_MAX:
- EMIT_2ARG_ARITH( A0_MAX );
- break;
-
- case FP_OPCODE_MIN:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
- tmp = i915_get_utemp( p );
- flags = get_result_flags( inst );
-
- i915_emit_arith( p,
- A0_MAX,
- tmp, flags & A0_DEST_CHANNEL_ALL, 0,
- negate(src0,1,1,1,1),
- negate(src1,1,1,1,1), 0);
-
- i915_emit_arith( p,
- A0_MOV,
- get_result_vector( p, inst ),
- flags, 0,
- negate(tmp, 1,1,1,1), 0, 0);
- break;
-
- case FP_OPCODE_MOV:
- EMIT_1ARG_ARITH( A0_MOV );
- break;
-
- case FP_OPCODE_MUL:
- EMIT_2ARG_ARITH( A0_MUL );
- break;
-
- case FP_OPCODE_POW:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
- tmp = i915_get_utemp( p );
- flags = get_result_flags( inst );
-
- /* XXX: masking on intermediate values, here and elsewhere.
- */
- i915_emit_arith( p,
- A0_LOG,
- tmp, A0_DEST_CHANNEL_X, 0,
- swizzle(src0,X,X,X,X), 0, 0);
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_X, 0,
- tmp, src1, 0);
-
-
- i915_emit_arith( p,
- A0_EXP,
- get_result_vector( p, inst ),
- flags, 0,
- swizzle(tmp,X,X,X,X), 0, 0);
-
- break;
-
- case FP_OPCODE_RCP:
- src0 = src_vector( p, &inst->SrcReg[0], program);
-
- i915_emit_arith( p,
- A0_RCP,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0,X,X,X,X), 0, 0);
- break;
-
- case FP_OPCODE_RSQ:
-
- src0 = src_vector( p, &inst->SrcReg[0], program);
-
- i915_emit_arith( p,
- A0_RSQ,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0,X,X,X,X), 0, 0);
- break;
-
- case FP_OPCODE_SCS:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- tmp = i915_get_utemp( p );
-
- /*
- * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1
- * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x
- * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x
- * scs.x = DP4 t1, sin_constants
- * t1 = MUL t0.xxz1 t0.z111 ; x^6 x^4 x^2 1
- * scs.y = DP4 t1, cos_constants
- */
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_XY, 0,
- swizzle(src0, X,X,ONE,ONE),
- swizzle(src0, X,ONE,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_ALL, 0,
- swizzle(tmp, X,Y,X,Y),
- swizzle(tmp, X,X,ONE,ONE), 0);
-
- if (inst->DstReg.WriteMask & WRITEMASK_Y) {
- GLuint tmp1;
-
- if (inst->DstReg.WriteMask & WRITEMASK_X)
- tmp1 = i915_get_utemp( p );
- else
- tmp1 = tmp;
-
- i915_emit_arith( p,
- A0_MUL,
- tmp1, A0_DEST_CHANNEL_ALL, 0,
- swizzle(tmp, X,Y,Y,W),
- swizzle(tmp, X,Z,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_DP4,
- get_result_vector( p, inst ),
- A0_DEST_CHANNEL_Y, 0,
- swizzle(tmp1, W,Z,Y,X),
- i915_emit_const4fv( p, sin_constants ), 0);
- }
-
- if (inst->DstReg.WriteMask & WRITEMASK_X) {
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_XYZ, 0,
- swizzle(tmp, X,X,Z,ONE),
- swizzle(tmp, Z,ONE,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_DP4,
- get_result_vector( p, inst ),
- A0_DEST_CHANNEL_X, 0,
- swizzle(tmp, ONE,Z,Y,X),
- i915_emit_const4fv( p, cos_constants ), 0);
- }
- break;
-
- case FP_OPCODE_SGE:
- EMIT_2ARG_ARITH( A0_SGE );
- break;
-
- case FP_OPCODE_SIN:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- tmp = i915_get_utemp( p );
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_X, 0,
- src0,
- i915_emit_const1f(p, 1.0/(PI * 2)),
- 0);
-
- i915_emit_arith( p,
- A0_MOD,
- tmp, A0_DEST_CHANNEL_X, 0,
- tmp,
- 0, 0 );
-
- /* By choosing different taylor constants, could get rid of this mul:
- */
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_X, 0,
- tmp,
- i915_emit_const1f(p, (PI * 2)),
- 0);
-
- /*
- * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1
- * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x
- * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x
- * result = DP4 t1.wzyx, sin_constants
- */
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_XY, 0,
- swizzle(tmp, X,X,ONE,ONE),
- swizzle(tmp, X,ONE,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_ALL, 0,
- swizzle(tmp, X,Y,X,Y),
- swizzle(tmp, X,X,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_ALL, 0,
- swizzle(tmp, X,Y,Y,W),
- swizzle(tmp, X,Z,ONE,ONE), 0);
-
- i915_emit_arith( p,
- A0_DP4,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(tmp, W, Z, Y, X ),
- i915_emit_const4fv( p, sin_constants ), 0);
- break;
-
- case FP_OPCODE_SLT:
- EMIT_2ARG_ARITH( A0_SLT );
- break;
-
- case FP_OPCODE_SUB:
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
-
- i915_emit_arith( p,
- A0_ADD,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- src0, negate(src1, 1,1,1,1), 0);
- break;
-
- case FP_OPCODE_SWZ:
- EMIT_1ARG_ARITH( A0_MOV ); /* extended swizzle handled natively */
- break;
-
- case FP_OPCODE_TEX:
- EMIT_TEX( T0_TEXLD );
- break;
-
- case FP_OPCODE_TXB:
- EMIT_TEX( T0_TEXLDB );
- break;
-
- case FP_OPCODE_TXP:
- EMIT_TEX( T0_TEXLDP );
- break;
-
- case FP_OPCODE_XPD:
- /* Cross product:
- * result.x = src0.y * src1.z - src0.z * src1.y;
- * result.y = src0.z * src1.x - src0.x * src1.z;
- * result.z = src0.x * src1.y - src0.y * src1.x;
- * result.w = undef;
- */
- src0 = src_vector( p, &inst->SrcReg[0], program);
- src1 = src_vector( p, &inst->SrcReg[1], program);
- tmp = i915_get_utemp( p );
-
- i915_emit_arith( p,
- A0_MUL,
- tmp, A0_DEST_CHANNEL_ALL, 0,
- swizzle(src0,Z,X,Y,ONE),
- swizzle(src1,Y,Z,X,ONE), 0);
-
- i915_emit_arith( p,
- A0_MAD,
- get_result_vector( p, inst ),
- get_result_flags( inst ), 0,
- swizzle(src0,Y,Z,X,ONE),
- swizzle(src1,Z,X,Y,ONE),
- negate(tmp,1,1,1,0));
- break;
-
- case FP_OPCODE_END:
- return;
-
- default:
- i915_program_error( p, "bad opcode" );
- return;
- }
-
- inst++;
- i915_release_utemps( p );
- }
-}
-
-/* Rather than trying to intercept and jiggle depth writes during
- * emit, just move the value into its correct position at the end of
- * the program:
- */
-static void fixup_depth_write( struct i915_fragment_program *p )
-{
- if (p->depth_written) {
- GLuint depth = UREG(REG_TYPE_OD, 0);
-
- i915_emit_arith( p,
- A0_MOV,
- depth, A0_DEST_CHANNEL_W, 0,
- swizzle(depth,X,Y,Z,Z),
- 0, 0);
- }
-}
-
-
-#define FRAG_BIT_TEX(n) (FRAG_BIT_TEX0 << (n))
-
-
-static void check_wpos( struct i915_fragment_program *p )
-{
- GLuint inputs = p->FragProg.InputsRead;
- GLint i;
-
- p->wpos_tex = -1;
-
- for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
- if (inputs & FRAG_BIT_TEX(i))
- continue;
- else if (inputs & FRAG_BIT_WPOS) {
- p->wpos_tex = i;
- inputs &= ~FRAG_BIT_WPOS;
- }
- }
-
- if (inputs & FRAG_BIT_WPOS) {
- i915_program_error(p, "No free texcoord for wpos value");
- }
-}
-
-
-static void translate_program( struct i915_fragment_program *p )
-{
- i915ContextPtr i915 = I915_CONTEXT(p->ctx);
-
- i915_init_program( i915, p );
- check_wpos( p );
- upload_program( p );
- fixup_depth_write( p );
- i915_fini_program( p );
-
- p->translated = 1;
-}
-
-
-static void track_params( struct i915_fragment_program *p )
-{
- GLint i;
-
- if (p->nr_params)
- _mesa_load_state_parameters(p->ctx, p->FragProg.Parameters);
-
- for (i = 0; i < p->nr_params; i++) {
- GLint reg = p->param[i].reg;
- COPY_4V( p->constant[reg], p->param[i].values );
- }
-
- p->params_uptodate = 1;
- p->on_hardware = 0; /* overkill */
-}
-
-
-static void i915BindProgram( GLcontext *ctx,
- GLenum target,
- struct program *prog )
-{
- if (target == GL_FRAGMENT_PROGRAM_ARB) {
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- struct i915_fragment_program *p = (struct i915_fragment_program *)prog;
-
- if (i915->current_program == p)
- return;
-
- if (i915->current_program) {
- i915->current_program->on_hardware = 0;
- i915->current_program->params_uptodate = 0;
- }
-
- i915->current_program = p;
-
- assert(p->on_hardware == 0);
- assert(p->params_uptodate == 0);
-
- /* Hack: make sure fog is correctly enabled according to this
- * fragment program's fog options.
- */
- ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB,
- ctx->FragmentProgram.Enabled );
- }
-}
-
-static struct program *i915NewProgram( GLcontext *ctx,
- GLenum target,
- GLuint id )
-{
- switch (target) {
- case GL_VERTEX_PROGRAM_ARB:
- return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(vertex_program),
- target, id );
-
- case GL_FRAGMENT_PROGRAM_ARB: {
- struct i915_fragment_program *prog = CALLOC_STRUCT(i915_fragment_program);
- if (prog) {
- i915_init_program( I915_CONTEXT(ctx), prog );
-
- return _mesa_init_fragment_program( ctx, &prog->FragProg,
- target, id );
- }
- else
- return NULL;
- }
-
- default:
- /* Just fallback:
- */
- return _mesa_new_program( ctx, target, id );
- }
-}
-
-static void i915DeleteProgram( GLcontext *ctx,
- struct program *prog )
-{
- if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- struct i915_fragment_program *p = (struct i915_fragment_program *)prog;
-
- if (i915->current_program == p)
- i915->current_program = 0;
- }
-
- _mesa_delete_program( ctx, prog );
-}
-
-
-static GLboolean i915IsProgramNative( GLcontext *ctx,
- GLenum target,
- struct program *prog )
-{
- if (target == GL_FRAGMENT_PROGRAM_ARB) {
- struct i915_fragment_program *p = (struct i915_fragment_program *)prog;
-
- if (!p->translated)
- translate_program( p );
-
- return !p->error;
- }
- else
- return GL_TRUE;
-}
-
-static void i915ProgramStringNotify( GLcontext *ctx,
- GLenum target,
- struct program *prog )
-{
- if (target == GL_FRAGMENT_PROGRAM_ARB) {
- struct i915_fragment_program *p = (struct i915_fragment_program *)prog;
- p->translated = 0;
-
- /* Hack: make sure fog is correctly enabled according to this
- * fragment program's fog options.
- */
- ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB,
- ctx->FragmentProgram.Enabled );
- }
-}
-
-
-void i915ValidateFragmentProgram( i915ContextPtr i915 )
-{
- GLcontext *ctx = &i915->intel.ctx;
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
-
- struct i915_fragment_program *p =
- (struct i915_fragment_program *)ctx->FragmentProgram._Current;
-
- GLuint inputsRead = p->FragProg.InputsRead;
- GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
- GLuint s2 = S2_TEXCOORD_NONE;
- int i, offset = 0;
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
-
- if (!p->translated)
- translate_program( p );
-
- intel->vertex_attr_count = 0;
- intel->wpos_offset = 0;
- intel->wpos_size = 0;
- intel->coloroffset = 0;
- intel->specoffset = 0;
-
- if (inputsRead & FRAG_BITS_TEX_ANY) {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16 );
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12 );
- }
-
- if (inputsRead & FRAG_BIT_COL0) {
- intel->coloroffset = offset / 4;
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4 );
- }
-
- if ((inputsRead & (FRAG_BIT_COL1|FRAG_BIT_FOGC)) ||
- i915->vertex_fog != I915_FOG_NONE) {
-
- if (inputsRead & FRAG_BIT_COL1) {
- intel->specoffset = offset / 4;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, S4_VFMT_SPEC_FOG, 3 );
- }
- else
- EMIT_PAD(3);
-
- if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE)
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, S4_VFMT_SPEC_FOG, 1 );
- else
- EMIT_PAD( 1 );
- }
-
-#if 0
- if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) {
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 );
- }
-#endif
-
- for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
- if (inputsRead & FRAG_BIT_TEX(i)) {
- int sz = VB->TexCoordPtr[i]->size;
-
- s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK);
- s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz));
-
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_SZ(sz), 0, sz * 4 );
- }
- else if (i == p->wpos_tex) {
-
- /* If WPOS is required, duplicate the XYZ position data in an
- * unused texture coordinate:
- */
- s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK);
- s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(3));
-
- intel->wpos_offset = offset;
- intel->wpos_size = 3 * sizeof(GLuint);
-
- EMIT_PAD( intel->wpos_size );
- }
- }
-
- if (s2 != i915->state.Ctx[I915_CTXREG_LIS2] ||
- s4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
-
- I915_STATECHANGE( i915, I915_UPLOAD_CTX );
-
- /* Must do this *after* statechange, so as not to affect
- * buffered vertices reliant on the old state:
- */
- intel->vertex_size = _tnl_install_attrs( &intel->ctx,
- intel->vertex_attrs,
- intel->vertex_attr_count,
- intel->ViewportMatrix.m, 0 );
-
- intel->vertex_size >>= 2;
-
- i915->state.Ctx[I915_CTXREG_LIS2] = s2;
- i915->state.Ctx[I915_CTXREG_LIS4] = s4;
-
- assert(intel->vtbl.check_vertex_size( intel, intel->vertex_size ));
- }
-
- if (!p->params_uptodate)
- track_params( p );
-
- if (!p->on_hardware)
- i915_upload_program( i915, p );
-}
-
-void i915InitFragProgFuncs( struct dd_function_table *functions )
-{
- functions->BindProgram = i915BindProgram;
- functions->NewProgram = i915NewProgram;
- functions->DeleteProgram = i915DeleteProgram;
- functions->IsProgramNative = i915IsProgramNative;
- functions->ProgramStringNotify = i915ProgramStringNotify;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_metaops.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_metaops.c
deleted file mode 100644
index 2e9063edf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_metaops.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "utils.h"
-
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-#include "intel_ioctl.h"
-
-#include "i915_context.h"
-#include "i915_reg.h"
-
-/* A large amount of state doesn't need to be uploaded.
- */
-#define ACTIVE (I915_UPLOAD_PROGRAM | \
- I915_UPLOAD_STIPPLE | \
- I915_UPLOAD_CTX | \
- I915_UPLOAD_BUFFERS | \
- I915_UPLOAD_TEX(0))
-
-#define SET_STATE( i915, STATE ) \
-do { \
- i915->current->emitted &= ~ACTIVE; \
- i915->current = &i915->STATE; \
- i915->current->emitted &= ~ACTIVE; \
-} while (0)
-
-/* Operations where the 3D engine is decoupled temporarily from the
- * current GL state and used for other purposes than simply rendering
- * incoming triangles.
- */
-static void set_initial_state( i915ContextPtr i915 )
-{
- memcpy(&i915->meta, &i915->initial, sizeof(i915->meta) );
- i915->meta.active = ACTIVE;
- i915->meta.emitted = 0;
-}
-
-
-static void set_no_depth_stencil_write( i915ContextPtr i915 )
-{
- /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE )
- */
- i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_TEST_ENABLE |
- S5_STENCIL_WRITE_ENABLE);
-
- /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE )
- */
- i915->meta.Ctx[I915_CTXREG_LIS6] &= ~(S6_DEPTH_TEST_ENABLE |
- S6_DEPTH_WRITE_ENABLE);
-
- i915->meta.emitted &= ~I915_UPLOAD_CTX;
-}
-
-/* Set stencil unit to replace always with the reference value.
- */
-static void set_stencil_replace( i915ContextPtr i915,
- GLuint s_mask,
- GLuint s_clear)
-{
- GLuint op = STENCILOP_REPLACE;
- GLuint func = COMPAREFUNC_ALWAYS;
-
- /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_TRUE )
- */
- i915->meta.Ctx[I915_CTXREG_LIS5] |= (S5_STENCIL_TEST_ENABLE |
- S5_STENCIL_WRITE_ENABLE);
-
-
- /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE )
- */
- i915->meta.Ctx[I915_CTXREG_LIS6] &= ~(S6_DEPTH_TEST_ENABLE |
- S6_DEPTH_WRITE_ENABLE);
-
-
- /* ctx->Driver.StencilMask( ctx, s_mask )
- */
- i915->meta.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK;
-
- i915->meta.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(s_mask));
-
-
- /* ctx->Driver.StencilOp( ctx, GL_REPLACE, GL_REPLACE, GL_REPLACE )
- */
- i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_FAIL_MASK |
- S5_STENCIL_PASS_Z_FAIL_MASK |
- S5_STENCIL_PASS_Z_PASS_MASK);
-
- i915->meta.Ctx[I915_CTXREG_LIS5] |= ((op << S5_STENCIL_FAIL_SHIFT) |
- (op << S5_STENCIL_PASS_Z_FAIL_SHIFT) |
- (op << S5_STENCIL_PASS_Z_PASS_SHIFT));
-
-
- /* ctx->Driver.StencilFunc( ctx, GL_ALWAYS, s_ref, ~0 )
- */
- i915->meta.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK;
- i915->meta.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(0xff));
-
- i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_REF_MASK |
- S5_STENCIL_TEST_FUNC_MASK);
-
- i915->meta.Ctx[I915_CTXREG_LIS5] |= ((s_clear << S5_STENCIL_REF_SHIFT) |
- (func << S5_STENCIL_TEST_FUNC_SHIFT));
-
-
- i915->meta.emitted &= ~I915_UPLOAD_CTX;
-}
-
-
-static void set_color_mask( i915ContextPtr i915, GLboolean state )
-{
- const GLuint mask = (S5_WRITEDISABLE_RED |
- S5_WRITEDISABLE_GREEN |
- S5_WRITEDISABLE_BLUE |
- S5_WRITEDISABLE_ALPHA);
-
- /* Copy colormask state from "regular" hw context.
- */
- if (state) {
- i915->meta.Ctx[I915_CTXREG_LIS5] &= ~mask;
- i915->meta.Ctx[I915_CTXREG_LIS5] |=
- (i915->state.Ctx[I915_CTXREG_LIS5] & mask);
- }
- else
- i915->meta.Ctx[I915_CTXREG_LIS5] |= mask;
-
- i915->meta.emitted &= ~I915_UPLOAD_CTX;
-}
-
-
-
-
-#define REG( type, nr ) (((type)<<5)|(nr))
-
-#define REG_R(x) REG(REG_TYPE_R, x)
-#define REG_T(x) REG(REG_TYPE_T, x)
-#define REG_CONST(x) REG(REG_TYPE_CONST, x)
-#define REG_S(x) REG(REG_TYPE_S, x)
-#define REG_OC REG(REG_TYPE_OC, 0)
-#define REG_OD REG(REG_TYPE_OD, 0)
-#define REG_U(x) REG(REG_TYPE_U, x)
-
-#define REG_T_DIFFUSE REG(REG_TYPE_T, T_DIFFUSE)
-#define REG_T_SPECULAR REG(REG_TYPE_T, T_SPECULAR)
-#define REG_T_FOG_W REG(REG_TYPE_T, T_FOG_W)
-#define REG_T_TEX(x) REG(REG_TYPE_T, x)
-
-
-#define A0_DEST_REG( reg ) ( (reg) << A0_DEST_NR_SHIFT )
-#define A0_SRC0_REG( reg ) ( (reg) << A0_SRC0_NR_SHIFT )
-#define A1_SRC1_REG( reg ) ( (reg) << A1_SRC1_NR_SHIFT )
-#define A1_SRC2_REG( reg ) ( (reg) << A1_SRC2_NR_SHIFT )
-#define A2_SRC2_REG( reg ) ( (reg) << A2_SRC2_NR_SHIFT )
-#define D0_DECL_REG( reg ) ( (reg) << D0_NR_SHIFT )
-#define T0_DEST_REG( reg ) ( (reg) << T0_DEST_NR_SHIFT )
-
-#define T0_SAMPLER( unit ) ((unit)<<T0_SAMPLER_NR_SHIFT)
-
-#define T1_ADDRESS_REG( type, nr ) (((type)<<T1_ADDRESS_REG_TYPE_SHIFT)| \
- ((nr)<<T1_ADDRESS_REG_NR_SHIFT))
-
-
-#define A1_SRC0_XYZW ((SRC_X << A1_SRC0_CHANNEL_X_SHIFT) | \
- (SRC_Y << A1_SRC0_CHANNEL_Y_SHIFT) | \
- (SRC_Z << A1_SRC0_CHANNEL_Z_SHIFT) | \
- (SRC_W << A1_SRC0_CHANNEL_W_SHIFT))
-
-#define A1_SRC1_XY ((SRC_X << A1_SRC1_CHANNEL_X_SHIFT) | \
- (SRC_Y << A1_SRC1_CHANNEL_Y_SHIFT))
-
-#define A2_SRC1_ZW ((SRC_Z << A2_SRC1_CHANNEL_Z_SHIFT) | \
- (SRC_W << A2_SRC1_CHANNEL_W_SHIFT))
-
-#define A2_SRC2_XYZW ((SRC_X << A2_SRC2_CHANNEL_X_SHIFT) | \
- (SRC_Y << A2_SRC2_CHANNEL_Y_SHIFT) | \
- (SRC_Z << A2_SRC2_CHANNEL_Z_SHIFT) | \
- (SRC_W << A2_SRC2_CHANNEL_W_SHIFT))
-
-
-
-
-
-static void set_no_texture( i915ContextPtr i915 )
-{
- static const GLuint prog[] = {
- _3DSTATE_PIXEL_SHADER_PROGRAM,
-
- /* Declare incoming diffuse color:
- */
- (D0_DCL |
- D0_DECL_REG( REG_T_DIFFUSE ) |
- D0_CHANNEL_ALL),
- D1_MBZ,
- D2_MBZ,
-
- /* output-color = mov(t_diffuse)
- */
- (A0_MOV |
- A0_DEST_REG( REG_OC ) |
- A0_DEST_CHANNEL_ALL |
- A0_SRC0_REG( REG_T_DIFFUSE )),
- (A1_SRC0_XYZW),
- 0,
- };
-
-
- memcpy( i915->meta.Program, prog, sizeof(prog) );
- i915->meta.ProgramSize = sizeof(prog) / sizeof(*prog);
- i915->meta.Program[0] |= i915->meta.ProgramSize - 2;
- i915->meta.emitted &= ~I915_UPLOAD_PROGRAM;
-}
-
-#if 0
-static void enable_texture_blend_replace( i915ContextPtr i915 )
-{
- static const GLuint prog[] = {
- _3DSTATE_PIXEL_SHADER_PROGRAM,
-
- /* Declare the sampler:
- */
- (D0_DCL |
- D0_DECL_REG( REG_S(0) ) |
- D0_SAMPLE_TYPE_2D |
- D0_CHANNEL_NONE),
- D1_MBZ,
- D2_MBZ,
-
- /* Declare the interpolated texture coordinate:
- */
- (D0_DCL |
- D0_DECL_REG( REG_T_TEX(0) ) |
- D0_CHANNEL_ALL),
- D1_MBZ,
- D2_MBZ,
-
- /* output-color = texld(sample0, texcoord0)
- */
- (T0_TEXLD |
- T0_DEST_REG( REG_OC ) |
- T0_SAMPLER( 0 )),
- T1_ADDRESS_REG(REG_TYPE_T, 0),
- T2_MBZ
- };
-
- memcpy( i915->meta.Program, prog, sizeof(prog) );
- i915->meta.ProgramSize = sizeof(prog) / sizeof(*prog);
- i915->meta.Program[0] |= i915->meta.ProgramSize - 2;
- i915->meta.emitted &= ~I915_UPLOAD_PROGRAM;
-}
-
-
-
-
-
-/* Set up an arbitary piece of memory as a rectangular texture
- * (including the front or back buffer).
- */
-static void set_tex_rect_source( i915ContextPtr i915,
- GLuint offset,
- GLuint width,
- GLuint height,
- GLuint pitch,
- GLuint textureFormat )
-{
- GLuint unit = 0;
- GLint numLevels = 1;
- GLuint *state = i915->meta.Tex[0];
-
- pitch *= i915->intel.intelScreen->cpp;
-
-/* fprintf(stderr, "%s: offset: %x w: %d h: %d pitch %d format %x\n", */
-/* __FUNCTION__, offset, width, height, pitch, textureFormat ); */
-
- state[I915_TEXREG_MS2] = offset;
- state[I915_TEXREG_MS3] = (((height - 1) << MS3_HEIGHT_SHIFT) |
- ((width - 1) << MS3_WIDTH_SHIFT) |
- textureFormat |
- MS3_USE_FENCE_REGS);
-
- state[I915_TEXREG_MS4] = ((((pitch / 4) - 1) << MS4_PITCH_SHIFT) |
- MS4_CUBE_FACE_ENA_MASK |
- ((((numLevels-1) * 4)) << MS4_MAX_LOD_SHIFT));
-
- state[I915_TEXREG_SS2] = ((FILTER_NEAREST << SS2_MIN_FILTER_SHIFT) |
- (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT) |
- (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT));
- state[I915_TEXREG_SS3] = ((TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT) |
- (TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT) |
- (TEXCOORDMODE_WRAP << SS3_TCZ_ADDR_MODE_SHIFT) |
- (unit<<SS3_TEXTUREMAP_INDEX_SHIFT));
-
- state[I915_TEXREG_SS4] = 0;
-
- i915->meta.emitted &= ~I915_UPLOAD_TEX(0);
-}
-#endif
-
-/* Select between front and back draw buffers.
- */
-static void set_draw_offset( i915ContextPtr i915,
- GLuint offset )
-{
- i915->meta.Buffer[I915_DESTREG_CBUFADDR2] = offset;
- i915->meta.emitted &= ~I915_UPLOAD_BUFFERS;
-}
-
-#if 0
-/* Setup an arbitary draw format, useful for targeting texture or agp
- * memory.
- */
-static void set_draw_format( i915ContextPtr i915,
- GLuint format,
- GLuint depth_format)
-{
- i915->meta.Buffer[I915_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- format |
- LOD_PRECLAMP_OGL |
- TEX_DEFAULT_COLOR_OGL |
- depth_format);
-
- i915->meta.emitted &= ~I915_UPLOAD_BUFFERS;
-/* fprintf(stderr, "%s: DV1: %x\n", */
-/* __FUNCTION__, i915->meta.Buffer[I915_DESTREG_DV1]); */
-}
-#endif
-
-static void set_vertex_format( i915ContextPtr i915 )
-{
- i915->meta.Ctx[I915_CTXREG_LIS2] =
- (S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D) |
- S2_TEXCOORD_FMT(1, TEXCOORDFMT_NOT_PRESENT) |
- S2_TEXCOORD_FMT(2, TEXCOORDFMT_NOT_PRESENT) |
- S2_TEXCOORD_FMT(3, TEXCOORDFMT_NOT_PRESENT) |
- S2_TEXCOORD_FMT(4, TEXCOORDFMT_NOT_PRESENT) |
- S2_TEXCOORD_FMT(5, TEXCOORDFMT_NOT_PRESENT) |
- S2_TEXCOORD_FMT(6, TEXCOORDFMT_NOT_PRESENT) |
- S2_TEXCOORD_FMT(7, TEXCOORDFMT_NOT_PRESENT));
-
- i915->meta.Ctx[I915_CTXREG_LIS4] &= ~S4_VFMT_MASK;
-
- i915->meta.Ctx[I915_CTXREG_LIS4] |=
- (S4_VFMT_COLOR |
- S4_VFMT_SPEC_FOG |
- S4_VFMT_XYZW);
-
- i915->meta.emitted &= ~I915_UPLOAD_CTX;
-
-}
-
-
-static void draw_quad(i915ContextPtr i915,
- GLfloat x0, GLfloat x1,
- GLfloat y0, GLfloat y1,
- GLubyte red, GLubyte green,
- GLubyte blue, GLubyte alpha,
- GLfloat s0, GLfloat s1,
- GLfloat t0, GLfloat t1 )
-{
- GLuint vertex_size = 8;
- GLuint *vb = intelEmitInlinePrimitiveLocked( &i915->intel,
- PRIM3D_TRIFAN,
- 4 * vertex_size,
- vertex_size );
- intelVertex tmp;
- int i;
-
- if (0)
- fprintf(stderr, "%s: %f,%f-%f,%f 0x%x%x%x%x %f,%f-%f,%f\n",
- __FUNCTION__,
- x0,y0,x1,y1,red,green,blue,alpha,s0,t0,s1,t1);
-
-
- /* initial vertex, left bottom */
- tmp.v.x = x0;
- tmp.v.y = y0;
- tmp.v.z = 1.0;
- tmp.v.w = 1.0;
- tmp.v.color.red = red;
- tmp.v.color.green = green;
- tmp.v.color.blue = blue;
- tmp.v.color.alpha = alpha;
- tmp.v.specular.red = 0;
- tmp.v.specular.green = 0;
- tmp.v.specular.blue = 0;
- tmp.v.specular.alpha = 0;
- tmp.v.u0 = s0;
- tmp.v.v0 = t0;
-
- for (i = 0 ; i < vertex_size ; i++)
- vb[i] = tmp.ui[i];
-
- /* right bottom */
- vb += vertex_size;
- tmp.v.x = x1;
- tmp.v.u0 = s1;
- for (i = 0 ; i < vertex_size ; i++)
- vb[i] = tmp.ui[i];
-
- /* right top */
- vb += vertex_size;
- tmp.v.y = y1;
- tmp.v.v0 = t1;
- for (i = 0 ; i < vertex_size ; i++)
- vb[i] = tmp.ui[i];
-
- /* left top */
- vb += vertex_size;
- tmp.v.x = x0;
- tmp.v.u0 = s0;
- for (i = 0 ; i < vertex_size ; i++)
- vb[i] = tmp.ui[i];
-}
-
-void
-i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
-{
- i915ContextPtr i915 = I915_CONTEXT( intel );
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- intelScreenPrivate *screen = intel->intelScreen;
- int x0, y0, x1, y1;
-
- SET_STATE( i915, meta );
- set_initial_state( i915 );
- set_no_texture( i915 );
- set_vertex_format( i915 );
-
- LOCK_HARDWARE(intel);
-
- if(!all) {
- x0 = cx;
- y0 = cy;
- x1 = x0 + cw;
- y1 = y0 + ch;
- } else {
- x0 = 0;
- y0 = 0;
- x1 = x0 + dPriv->w;
- y1 = y0 + dPriv->h;
- }
-
- /* Don't do any clipping to screen - these are window coordinates.
- * The active cliprects will be applied as for any other geometry.
- */
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- set_no_depth_stencil_write( i915 );
- set_color_mask( i915, GL_TRUE );
- set_draw_offset( i915, screen->frontOffset );
-
- draw_quad(i915, x0, x1, y0, y1,
- intel->clear_red, intel->clear_green,
- intel->clear_blue, intel->clear_alpha,
- 0, 0, 0, 0);
- }
-
- if (mask & BUFFER_BIT_BACK_LEFT) {
- set_no_depth_stencil_write( i915 );
- set_color_mask( i915, GL_TRUE );
- set_draw_offset( i915, screen->backOffset );
-
- draw_quad(i915, x0, x1, y0, y1,
- intel->clear_red, intel->clear_green,
- intel->clear_blue, intel->clear_alpha,
- 0, 0, 0, 0);
- }
-
- if (mask & BUFFER_BIT_STENCIL) {
- set_stencil_replace( i915,
- intel->ctx.Stencil.WriteMask[0],
- intel->ctx.Stencil.Clear);
-
- set_color_mask( i915, GL_FALSE );
- set_draw_offset( i915, screen->frontOffset ); /* could be either? */
-
- draw_quad( i915, x0, x1, y0, y1, 0, 0, 0, 0, 0, 0, 0, 0 );
- }
-
- UNLOCK_HARDWARE(intel);
-
- SET_STATE( i915, state );
-}
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.c
deleted file mode 100644
index cf3ebc171..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <strings.h>
-
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
-#include "tnl/t_context.h"
-#include "intel_batchbuffer.h"
-
-#include "i915_reg.h"
-#include "i915_context.h"
-#include "i915_program.h"
-
-
-#define A0_DEST( reg ) (((reg)&UREG_TYPE_NR_MASK)>>UREG_A0_DEST_SHIFT_LEFT)
-#define D0_DEST( reg ) (((reg)&UREG_TYPE_NR_MASK)>>UREG_A0_DEST_SHIFT_LEFT)
-#define T0_DEST( reg ) (((reg)&UREG_TYPE_NR_MASK)>>UREG_A0_DEST_SHIFT_LEFT)
-#define A0_SRC0( reg ) (((reg)&UREG_MASK)>>UREG_A0_SRC0_SHIFT_LEFT)
-#define A1_SRC0( reg ) (((reg)&UREG_MASK)<<UREG_A1_SRC0_SHIFT_RIGHT)
-#define A1_SRC1( reg ) (((reg)&UREG_MASK)>>UREG_A1_SRC1_SHIFT_LEFT)
-#define A2_SRC1( reg ) (((reg)&UREG_MASK)<<UREG_A2_SRC1_SHIFT_RIGHT)
-#define A2_SRC2( reg ) (((reg)&UREG_MASK)>>UREG_A2_SRC2_SHIFT_LEFT)
-
-/* These are special, and don't have swizzle/negate bits.
- */
-#define T0_SAMPLER( reg ) (GET_UREG_NR(reg)<<T0_SAMPLER_NR_SHIFT)
-#define T1_ADDRESS_REG( reg ) ((GET_UREG_NR(reg)<<T1_ADDRESS_REG_NR_SHIFT) | \
- (GET_UREG_TYPE(reg)<<T1_ADDRESS_REG_TYPE_SHIFT))
-
-
-/* Macros for translating UREG's into the various register fields used
- * by the I915 programmable unit.
- */
-#define UREG_A0_DEST_SHIFT_LEFT (UREG_TYPE_SHIFT - A0_DEST_TYPE_SHIFT)
-#define UREG_A0_SRC0_SHIFT_LEFT (UREG_TYPE_SHIFT - A0_SRC0_TYPE_SHIFT)
-#define UREG_A1_SRC0_SHIFT_RIGHT (A1_SRC0_CHANNEL_W_SHIFT - UREG_CHANNEL_W_SHIFT)
-#define UREG_A1_SRC1_SHIFT_LEFT (UREG_TYPE_SHIFT - A1_SRC1_TYPE_SHIFT)
-#define UREG_A2_SRC1_SHIFT_RIGHT (A2_SRC1_CHANNEL_W_SHIFT - UREG_CHANNEL_W_SHIFT)
-#define UREG_A2_SRC2_SHIFT_LEFT (UREG_TYPE_SHIFT - A2_SRC2_TYPE_SHIFT)
-
-#define UREG_MASK 0xffffff00
-#define UREG_TYPE_NR_MASK ((REG_TYPE_MASK << UREG_TYPE_SHIFT) | \
- (REG_NR_MASK << UREG_NR_SHIFT))
-
-
-#define I915_CONSTFLAG_PARAM 0x1f
-
-GLuint i915_get_temp( struct i915_fragment_program *p )
-{
- int bit = ffs( ~p->temp_flag );
- if (!bit) {
- fprintf(stderr, "%s: out of temporaries\n", __FILE__);
- exit(1);
- }
-
- p->temp_flag |= 1<<(bit-1);
- return UREG(REG_TYPE_R, (bit-1));
-}
-
-
-GLuint i915_get_utemp( struct i915_fragment_program *p )
-{
- int bit = ffs( ~p->utemp_flag );
- if (!bit) {
- fprintf(stderr, "%s: out of temporaries\n", __FILE__);
- exit(1);
- }
-
- p->utemp_flag |= 1<<(bit-1);
- return UREG(REG_TYPE_U, (bit-1));
-}
-
-void i915_release_utemps( struct i915_fragment_program *p )
-{
- p->utemp_flag = ~0x7;
-}
-
-
-GLuint i915_emit_decl( struct i915_fragment_program *p,
- GLuint type, GLuint nr, GLuint d0_flags )
-{
- GLuint reg = UREG(type, nr);
-
- if (type == REG_TYPE_T) {
- if (p->decl_t & (1<<nr))
- return reg;
-
- p->decl_t |= (1<<nr);
- }
- else if (type == REG_TYPE_S) {
- if (p->decl_s & (1<<nr))
- return reg;
-
- p->decl_s |= (1<<nr);
- }
- else
- return reg;
-
- *(p->decl++) = (D0_DCL | D0_DEST( reg ) | d0_flags);
- *(p->decl++) = D1_MBZ;
- *(p->decl++) = D2_MBZ;
-
- p->nr_decl_insn++;
- return reg;
-}
-
-GLuint i915_emit_arith( struct i915_fragment_program *p,
- GLuint op,
- GLuint dest,
- GLuint mask,
- GLuint saturate,
- GLuint src0,
- GLuint src1,
- GLuint src2 )
-{
- GLuint c[3];
- GLuint nr_const = 0;
-
- assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST);
- assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
-
- if (GET_UREG_TYPE(src0) == REG_TYPE_CONST) c[nr_const++] = 0;
- if (GET_UREG_TYPE(src1) == REG_TYPE_CONST) c[nr_const++] = 1;
- if (GET_UREG_TYPE(src2) == REG_TYPE_CONST) c[nr_const++] = 2;
-
- /* Recursively call this function to MOV additional const values
- * into temporary registers. Use utemp registers for this -
- * currently shouldn't be possible to run out, but keep an eye on
- * this.
- */
- if (nr_const > 1) {
- GLuint s[3], first, i, old_utemp_flag;
-
- s[0] = src0;
- s[1] = src1;
- s[2] = src2;
- old_utemp_flag = p->utemp_flag;
-
- first = GET_UREG_NR(s[c[0]]);
- for (i = 1 ; i < nr_const ; i++) {
- if (GET_UREG_NR(s[c[i]]) != first) {
- GLuint tmp = i915_get_utemp(p);
-
- i915_emit_arith( p, A0_MOV, tmp, A0_DEST_CHANNEL_ALL, 0,
- s[c[i]], 0, 0 );
- s[c[i]] = tmp;
- }
- }
-
- src0 = s[0];
- src1 = s[1];
- src2 = s[2];
- p->utemp_flag = old_utemp_flag; /* restore */
- }
-
- *(p->csr++) = (op |
- A0_DEST( dest ) |
- mask |
- saturate |
- A0_SRC0( src0 ));
- *(p->csr++) = (A1_SRC0( src0 ) |
- A1_SRC1( src1 ));
- *(p->csr++) = (A2_SRC1( src1 ) |
- A2_SRC2( src2 ));
-
- p->nr_alu_insn++;
- return dest;
-}
-
-GLuint i915_emit_texld( struct i915_fragment_program *p,
- GLuint dest,
- GLuint destmask,
- GLuint sampler,
- GLuint coord,
- GLuint op )
-{
- assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST);
- assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
-
- if (GET_UREG_TYPE(coord) != REG_TYPE_T) {
- p->nr_tex_indirect++;
- }
-
- *(p->csr++) = (op |
- T0_DEST( dest ) |
- destmask |
- T0_SAMPLER( sampler ));
-
- *(p->csr++) = T1_ADDRESS_REG( coord );
- *(p->csr++) = T2_MBZ;
-
- p->nr_tex_insn++;
- return dest;
-}
-
-
-GLuint i915_emit_const1f( struct i915_fragment_program *p, GLfloat c0 )
-{
- GLint reg, idx;
-
- if (c0 == 0.0) return swizzle(UREG(REG_TYPE_R, 0), ZERO, ZERO, ZERO, ZERO);
- if (c0 == 1.0) return swizzle(UREG(REG_TYPE_R, 0), ONE, ONE, ONE, ONE );
-
- for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
- if (p->constant_flags[reg] == I915_CONSTFLAG_PARAM)
- continue;
- for (idx = 0; idx < 4; idx++) {
- if (!(p->constant_flags[reg] & (1<<idx)) ||
- p->constant[reg][idx] == c0) {
- p->constant[reg][idx] = c0;
- p->constant_flags[reg] |= 1<<idx;
- if (reg+1 > p->nr_constants) p->nr_constants = reg+1;
- return swizzle(UREG(REG_TYPE_CONST, reg),idx,ZERO,ZERO,ONE);
- }
- }
- }
-
- fprintf(stderr, "%s: out of constants\n", __FUNCTION__);
- p->error = 1;
- return 0;
-}
-
-GLuint i915_emit_const2f( struct i915_fragment_program *p,
- GLfloat c0, GLfloat c1 )
-{
- GLint reg, idx;
-
- if (c0 == 0.0) return swizzle(i915_emit_const1f(p, c1), ZERO, X, Z, W);
- if (c0 == 1.0) return swizzle(i915_emit_const1f(p, c1), ONE, X, Z, W);
-
- if (c1 == 0.0) return swizzle(i915_emit_const1f(p, c0), X, ZERO, Z, W);
- if (c1 == 1.0) return swizzle(i915_emit_const1f(p, c0), X, ONE, Z, W);
-
- for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
- if (p->constant_flags[reg] == 0xf ||
- p->constant_flags[reg] == I915_CONSTFLAG_PARAM)
- continue;
- for (idx = 0; idx < 3; idx++) {
- if (!(p->constant_flags[reg] & (3<<idx))) {
- p->constant[reg][idx] = c0;
- p->constant[reg][idx+1] = c1;
- p->constant_flags[reg] |= 3<<idx;
- if (reg+1 > p->nr_constants) p->nr_constants = reg+1;
- return swizzle(UREG(REG_TYPE_CONST, reg),idx,idx+1,ZERO,ONE);
- }
- }
- }
-
- fprintf(stderr, "%s: out of constants\n", __FUNCTION__);
- p->error = 1;
- return 0;
-}
-
-
-
-GLuint i915_emit_const4f( struct i915_fragment_program *p,
- GLfloat c0, GLfloat c1, GLfloat c2, GLfloat c3 )
-{
- GLint reg;
-
- for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
- if (p->constant_flags[reg] == 0xf &&
- p->constant[reg][0] == c0 &&
- p->constant[reg][1] == c1 &&
- p->constant[reg][2] == c2 &&
- p->constant[reg][3] == c3) {
- return UREG(REG_TYPE_CONST, reg);
- }
- else if (p->constant_flags[reg] == 0) {
- p->constant[reg][0] = c0;
- p->constant[reg][1] = c1;
- p->constant[reg][2] = c2;
- p->constant[reg][3] = c3;
- p->constant_flags[reg] = 0xf;
- if (reg+1 > p->nr_constants) p->nr_constants = reg+1;
- return UREG(REG_TYPE_CONST, reg);
- }
- }
-
- fprintf(stderr, "%s: out of constants\n", __FUNCTION__);
- p->error = 1;
- return 0;
-}
-
-
-GLuint i915_emit_const4fv( struct i915_fragment_program *p, const GLfloat *c )
-{
- return i915_emit_const4f( p, c[0], c[1], c[2], c[3] );
-}
-
-
-GLuint i915_emit_param4fv( struct i915_fragment_program *p,
- const GLfloat *values )
-{
- GLint reg, i;
-
- for (i = 0; i < p->nr_params; i++) {
- if (p->param[i].values == values)
- return UREG(REG_TYPE_CONST, p->param[i].reg);
- }
-
-
- for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
- if (p->constant_flags[reg] == 0) {
- p->constant_flags[reg] = I915_CONSTFLAG_PARAM;
- i = p->nr_params++;
-
- p->param[i].values = values;
- p->param[i].reg = reg;
- p->params_uptodate = 0;
-
- if (reg+1 > p->nr_constants) p->nr_constants = reg+1;
- return UREG(REG_TYPE_CONST, reg);
- }
- }
-
- fprintf(stderr, "%s: out of constants\n", __FUNCTION__);
- p->error = 1;
- return 0;
-}
-
-
-
-
-void i915_program_error( struct i915_fragment_program *p, const GLubyte *msg )
-{
- fprintf(stderr, "%s\n", msg);
- p->error = 1;
-}
-
-void i915_init_program( i915ContextPtr i915, struct i915_fragment_program *p )
-{
- GLcontext *ctx = &i915->intel.ctx;
- TNLcontext *tnl = TNL_CONTEXT( ctx );
-
- p->translated = 0;
- p->params_uptodate = 0;
- p->on_hardware = 0;
- p->error = 0;
-
- p->nr_tex_indirect = 1; /* correct? */
- p->nr_tex_insn = 0;
- p->nr_alu_insn = 0;
- p->nr_decl_insn = 0;
-
- p->ctx = ctx;
- memset( p->constant_flags, 0, sizeof(p->constant_flags) );
-
- p->nr_constants = 0;
- p->csr = p->program;
- p->decl = p->declarations;
- p->decl_s = 0;
- p->decl_t = 0;
- p->temp_flag = 0xffff000;
- p->utemp_flag = ~0x7;
- p->wpos_tex = -1;
- p->depth_written = 0;
- p->nr_params = 0;
-
- p->src_texture = UREG_BAD;
- p->src_previous = UREG(REG_TYPE_T, T_DIFFUSE);
- p->last_tex_stage = 0;
- p->VB = &tnl->vb;
-
- *(p->decl++) = _3DSTATE_PIXEL_SHADER_PROGRAM;
-}
-
-
-void i915_fini_program( struct i915_fragment_program *p )
-{
- GLuint program_size = p->csr - p->program;
- GLuint decl_size = p->decl - p->declarations;
-
- if (p->nr_tex_indirect > I915_MAX_TEX_INDIRECT)
- i915_program_error(p, "Exceeded max nr indirect texture lookups");
-
- if (p->nr_tex_insn > I915_MAX_TEX_INSN)
- i915_program_error(p, "Exceeded max TEX instructions");
-
- if (p->nr_alu_insn > I915_MAX_ALU_INSN)
- i915_program_error(p, "Exceeded max ALU instructions");
-
- if (p->nr_decl_insn > I915_MAX_DECL_INSN)
- i915_program_error(p, "Exceeded max DECL instructions");
-
- p->declarations[0] |= program_size + decl_size - 2;
-}
-
-void i915_upload_program( i915ContextPtr i915, struct i915_fragment_program *p )
-{
- GLuint program_size = p->csr - p->program;
- GLuint decl_size = p->decl - p->declarations;
-
- FALLBACK( &i915->intel, I915_FALLBACK_PROGRAM, p->error );
-
- /* Could just go straight to the batchbuffer from here:
- */
- if (i915->state.ProgramSize != (program_size + decl_size) ||
- memcmp(i915->state.Program + decl_size, p->program,
- program_size*sizeof(int)) != 0) {
- I915_STATECHANGE( i915, I915_UPLOAD_PROGRAM );
- memcpy(i915->state.Program, p->declarations, decl_size*sizeof(int));
- memcpy(i915->state.Program + decl_size, p->program,
- program_size*sizeof(int));
- i915->state.ProgramSize = decl_size + program_size;
- }
-
- /* Always seemed to get a failure if I used memcmp() to
- * shortcircuit this state upload. Needs further investigation?
- */
- if (p->nr_constants) {
- GLuint nr = p->nr_constants;
-
- I915_ACTIVESTATE( i915, I915_UPLOAD_CONSTANTS, 1 );
- I915_STATECHANGE( i915, I915_UPLOAD_CONSTANTS );
-
- i915->state.Constant[0] = _3DSTATE_PIXEL_SHADER_CONSTANTS | ((nr) * 4);
- i915->state.Constant[1] = (1<<(nr-1)) | ((1<<(nr-1))-1);
-
- memcpy(&i915->state.Constant[2], p->constant, 4*sizeof(int)*(nr));
- i915->state.ConstantSize = 2 + (nr) * 4;
-
- if (0) {
- GLuint i;
- for (i = 0; i < nr; i++) {
- fprintf(stderr, "const[%d]: %f %f %f %f\n", i,
- p->constant[i][0],
- p->constant[i][1],
- p->constant[i][2],
- p->constant[i][3]);
- }
- }
- }
- else {
- I915_ACTIVESTATE( i915, I915_UPLOAD_CONSTANTS, 0 );
- }
-
- p->on_hardware = 1;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.h
deleted file mode 100644
index c53ebead6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_program.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#ifndef I915_PROGRAM_H
-#define I915_PROGRAM_H
-
-#include "i915_context.h"
-#include "i915_reg.h"
-
-
-
-/* Having zero and one in here makes the definition of swizzle a lot
- * easier.
- */
-#define UREG_TYPE_SHIFT 29
-#define UREG_NR_SHIFT 24
-#define UREG_CHANNEL_X_NEGATE_SHIFT 23
-#define UREG_CHANNEL_X_SHIFT 20
-#define UREG_CHANNEL_Y_NEGATE_SHIFT 19
-#define UREG_CHANNEL_Y_SHIFT 16
-#define UREG_CHANNEL_Z_NEGATE_SHIFT 15
-#define UREG_CHANNEL_Z_SHIFT 12
-#define UREG_CHANNEL_W_NEGATE_SHIFT 11
-#define UREG_CHANNEL_W_SHIFT 8
-#define UREG_CHANNEL_ZERO_NEGATE_MBZ 5
-#define UREG_CHANNEL_ZERO_SHIFT 4
-#define UREG_CHANNEL_ONE_NEGATE_MBZ 1
-#define UREG_CHANNEL_ONE_SHIFT 0
-
-#define UREG_BAD 0xffffffff /* not a valid ureg */
-
-#define X SRC_X
-#define Y SRC_Y
-#define Z SRC_Z
-#define W SRC_W
-#define ZERO SRC_ZERO
-#define ONE SRC_ONE
-
-/* Construct a ureg:
- */
-#define UREG( type, nr ) (((type)<< UREG_TYPE_SHIFT) | \
- ((nr) << UREG_NR_SHIFT) | \
- (X << UREG_CHANNEL_X_SHIFT) | \
- (Y << UREG_CHANNEL_Y_SHIFT) | \
- (Z << UREG_CHANNEL_Z_SHIFT) | \
- (W << UREG_CHANNEL_W_SHIFT) | \
- (ZERO << UREG_CHANNEL_ZERO_SHIFT) | \
- (ONE << UREG_CHANNEL_ONE_SHIFT))
-
-#define GET_CHANNEL_SRC( reg, channel ) ((reg<<(channel*4)) & (0xf<<20))
-#define CHANNEL_SRC( src, channel ) (src>>(channel*4))
-
-#define GET_UREG_TYPE(reg) (((reg)>>UREG_TYPE_SHIFT)&REG_TYPE_MASK)
-#define GET_UREG_NR(reg) (((reg)>>UREG_NR_SHIFT)&REG_NR_MASK)
-
-
-
-#define UREG_XYZW_CHANNEL_MASK 0x00ffff00
-
-/* One neat thing about the UREG representation:
- */
-static __inline int swizzle( int reg, int x, int y, int z, int w )
-{
- return ((reg & ~UREG_XYZW_CHANNEL_MASK) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, x ), 0 ) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, y ), 1 ) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, z ), 2 ) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, w ), 3 ));
-}
-
-/* Another neat thing about the UREG representation:
- */
-static __inline int negate( int reg, int x, int y, int z, int w )
-{
- return reg ^ (((x&1)<<UREG_CHANNEL_X_NEGATE_SHIFT)|
- ((y&1)<<UREG_CHANNEL_Y_NEGATE_SHIFT)|
- ((z&1)<<UREG_CHANNEL_Z_NEGATE_SHIFT)|
- ((w&1)<<UREG_CHANNEL_W_NEGATE_SHIFT));
-}
-
-
-extern GLuint i915_get_temp( struct i915_fragment_program *p );
-extern GLuint i915_get_utemp( struct i915_fragment_program *p );
-extern void i915_release_utemps( struct i915_fragment_program *p );
-
-
-extern GLuint i915_emit_texld( struct i915_fragment_program *p,
- GLuint dest,
- GLuint destmask,
- GLuint sampler,
- GLuint coord,
- GLuint op );
-
-extern GLuint i915_emit_arith( struct i915_fragment_program *p,
- GLuint op,
- GLuint dest,
- GLuint mask,
- GLuint saturate,
- GLuint src0,
- GLuint src1,
- GLuint src2 );
-
-extern GLuint i915_emit_decl( struct i915_fragment_program *p,
- GLuint type, GLuint nr, GLuint d0_flags );
-
-
-extern GLuint i915_emit_const1f( struct i915_fragment_program *p,
- GLfloat c0 );
-
-extern GLuint i915_emit_const2f( struct i915_fragment_program *p,
- GLfloat c0, GLfloat c1 );
-
-extern GLuint i915_emit_const4fv( struct i915_fragment_program *p,
- const GLfloat *c );
-
-extern GLuint i915_emit_const4f( struct i915_fragment_program *p,
- GLfloat c0, GLfloat c1,
- GLfloat c2, GLfloat c3 );
-
-
-extern GLuint i915_emit_param4fv( struct i915_fragment_program *p,
- const GLfloat *values );
-
-extern void i915_program_error( struct i915_fragment_program *p,
- const GLubyte *msg );
-
-extern void i915_init_program( i915ContextPtr i915,
- struct i915_fragment_program *p );
-
-extern void i915_upload_program( i915ContextPtr i915,
- struct i915_fragment_program *p );
-
-extern void i915_fini_program( struct i915_fragment_program *p );
-
-
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_reg.h
deleted file mode 100644
index 3241b36b6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_reg.h
+++ /dev/null
@@ -1,833 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#ifndef _I915_REG_H_
-#define _I915_REG_H_
-
-
-#include "intel_reg.h"
-
-#define I915_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value)
-
-#define CMD_3D (0x3<<29)
-
-#define PRIM3D_INLINE (CMD_3D | (0x1f<<24))
-#define PRIM3D_TRILIST (0x0<<18)
-#define PRIM3D_TRISTRIP (0x1<<18)
-#define PRIM3D_TRISTRIP_RVRSE (0x2<<18)
-#define PRIM3D_TRIFAN (0x3<<18)
-#define PRIM3D_POLY (0x4<<18)
-#define PRIM3D_LINELIST (0x5<<18)
-#define PRIM3D_LINESTRIP (0x6<<18)
-#define PRIM3D_RECTLIST (0x7<<18)
-#define PRIM3D_POINTLIST (0x8<<18)
-#define PRIM3D_DIB (0x9<<18)
-#define PRIM3D_CLEAR_RECT (0xa<<18)
-#define PRIM3D_ZONE_INIT (0xd<<18)
-#define PRIM3D_MASK (0x1f<<18)
-
-/* p137 */
-#define _3DSTATE_AA_CMD (CMD_3D | (0x06<<24))
-#define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16)
-#define AA_LINE_ECAAR_WIDTH_0_5 0
-#define AA_LINE_ECAAR_WIDTH_1_0 (1<<14)
-#define AA_LINE_ECAAR_WIDTH_2_0 (2<<14)
-#define AA_LINE_ECAAR_WIDTH_4_0 (3<<14)
-#define AA_LINE_REGION_WIDTH_ENABLE (1<<8)
-#define AA_LINE_REGION_WIDTH_0_5 0
-#define AA_LINE_REGION_WIDTH_1_0 (1<<6)
-#define AA_LINE_REGION_WIDTH_2_0 (2<<6)
-#define AA_LINE_REGION_WIDTH_4_0 (3<<6)
-
-/* 3DSTATE_BACKFACE_STENCIL_OPS, p138*/
-#define _3DSTATE_BACKFACE_STENCIL_OPS (CMD_3D | (0x8<<24))
-#define BFO_ENABLE_STENCIL_REF (1<<23)
-#define BFO_STENCIL_REF_SHIFT 15
-#define BFO_STENCIL_REF_MASK (0xff<<15)
-#define BFO_ENABLE_STENCIL_FUNCS (1<<14)
-#define BFO_STENCIL_TEST_SHIFT 11
-#define BFO_STENCIL_TEST_MASK (0x7<<11)
-#define BFO_STENCIL_FAIL_SHIFT 8
-#define BFO_STENCIL_FAIL_MASK (0x7<<8)
-#define BFO_STENCIL_PASS_Z_FAIL_SHIFT 5
-#define BFO_STENCIL_PASS_Z_FAIL_MASK (0x7<<5)
-#define BFO_STENCIL_PASS_Z_PASS_SHIFT 2
-#define BFO_STENCIL_PASS_Z_PASS_MASK (0x7<<2)
-#define BFO_ENABLE_STENCIL_TWO_SIDE (1<<1)
-#define BFO_STENCIL_TWO_SIDE (1<<0)
-
-
-/* 3DSTATE_BACKFACE_STENCIL_MASKS, p140 */
-#define _3DSTATE_BACKFACE_STENCIL_MASKS (CMD_3D | (0x9<<24))
-#define BFM_ENABLE_STENCIL_TEST_MASK (1<<17)
-#define BFM_ENABLE_STENCIL_WRITE_MASK (1<<16)
-#define BFM_STENCIL_TEST_MASK_SHIFT 8
-#define BFM_STENCIL_TEST_MASK_MASK (0xff<<8)
-#define BFM_STENCIL_WRITE_MASK_SHIFT 0
-#define BFM_STENCIL_WRITE_MASK_MASK (0xff<<0)
-
-
-
-/* 3DSTATE_BIN_CONTROL p141 */
-
-/* p143 */
-#define _3DSTATE_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1)
-/* Dword 1 */
-#define BUF_3D_ID_COLOR_BACK (0x3<<24)
-#define BUF_3D_ID_DEPTH (0x7<<24)
-#define BUF_3D_USE_FENCE (1<<23)
-#define BUF_3D_TILED_SURFACE (1<<22)
-#define BUF_3D_TILE_WALK_X 0
-#define BUF_3D_TILE_WALK_Y (1<<21)
-#define BUF_3D_PITCH(x) (((x)/4)<<2)
-/* Dword 2 */
-#define BUF_3D_ADDR(x) ((x) & ~0x3)
-
-
-/* 3DSTATE_CHROMA_KEY */
-
-/* 3DSTATE_CLEAR_PARAMETERS, p150 */
-
-/* 3DSTATE_CONSTANT_BLEND_COLOR, p153 */
-#define _3DSTATE_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16))
-
-
-
-/* 3DSTATE_COORD_SET_BINDINGS, p154 */
-#define _3DSTATE_COORD_SET_BINDINGS (CMD_3D | (0x16<<24))
-#define CSB_TCB(iunit, eunit) ((eunit)<<(iunit*3))
-
-/* p156 */
-#define _3DSTATE_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16))
-
-/* p157 */
-#define _3DSTATE_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16))
-
-/* p158 */
-#define _3DSTATE_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16))
-
-
-/* 3DSTATE_DEPTH_OFFSET_SCALE, p159 */
-#define _3DSTATE_DEPTH_OFFSET_SCALE (CMD_3D | (0x1d<<24) | (0x97<<16))
-/* scale in dword 1 */
-
-
-/* 3DSTATE_DEPTH_SUBRECT_DISABLE, p160 */
-#define _3DSTATE_DEPTH_SUBRECT_DISABLE (CMD_3D | (0x1c<<24) | (0x11<19) | 0x2)
-
-/* p161 */
-#define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16))
-/* Dword 1 */
-#define TEX_DEFAULT_COLOR_OGL (0<<30)
-#define TEX_DEFAULT_COLOR_D3D (1<<30)
-#define ZR_EARLY_DEPTH (1<<29)
-#define LOD_PRECLAMP_OGL (1<<28)
-#define LOD_PRECLAMP_D3D (0<<28)
-#define DITHER_FULL_ALWAYS (0<<26)
-#define DITHER_FULL_ON_FB_BLEND (1<<26)
-#define DITHER_CLAMPED_ALWAYS (2<<26)
-#define LINEAR_GAMMA_BLEND_32BPP (1<<25)
-#define DEBUG_DISABLE_ENH_DITHER (1<<24)
-#define DSTORG_HORT_BIAS(x) ((x)<<20)
-#define DSTORG_VERT_BIAS(x) ((x)<<16)
-#define COLOR_4_2_2_CHNL_WRT_ALL 0
-#define COLOR_4_2_2_CHNL_WRT_Y (1<<12)
-#define COLOR_4_2_2_CHNL_WRT_CR (2<<12)
-#define COLOR_4_2_2_CHNL_WRT_CB (3<<12)
-#define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12)
-#define COLR_BUF_8BIT 0
-#define COLR_BUF_RGB555 (1<<8)
-#define COLR_BUF_RGB565 (2<<8)
-#define COLR_BUF_ARGB8888 (3<<8)
-#define DEPTH_FRMT_16_FIXED 0
-#define DEPTH_FRMT_16_FLOAT (1<<2)
-#define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2)
-#define VERT_LINE_STRIDE_1 (1<<1)
-#define VERT_LINE_STRIDE_0 (0<<1)
-#define VERT_LINE_STRIDE_OFS_1 1
-#define VERT_LINE_STRIDE_OFS_0 0
-
-/* p166 */
-#define _3DSTATE_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3)
-/* Dword 1 */
-#define DRAW_RECT_DIS_DEPTH_OFS (1<<30)
-#define DRAW_DITHER_OFS_X(x) ((x)<<26)
-#define DRAW_DITHER_OFS_Y(x) ((x)<<24)
-/* Dword 2 */
-#define DRAW_YMIN(x) ((x)<<16)
-#define DRAW_XMIN(x) (x)
-/* Dword 3 */
-#define DRAW_YMAX(x) ((x)<<16)
-#define DRAW_XMAX(x) (x)
-/* Dword 4 */
-#define DRAW_YORG(x) ((x)<<16)
-#define DRAW_XORG(x) (x)
-
-
-/* 3DSTATE_FILTER_COEFFICIENTS_4X4, p170 */
-
-/* 3DSTATE_FILTER_COEFFICIENTS_6X5, p172 */
-
-
-/* _3DSTATE_FOG_COLOR, p173 */
-#define _3DSTATE_FOG_COLOR_CMD (CMD_3D|(0x15<<24))
-#define FOG_COLOR_RED(x) ((x)<<16)
-#define FOG_COLOR_GREEN(x) ((x)<<8)
-#define FOG_COLOR_BLUE(x) (x)
-
-/* _3DSTATE_FOG_MODE, p174 */
-#define _3DSTATE_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2)
-/* Dword 1 */
-#define FMC1_FOGFUNC_MODIFY_ENABLE (1<<31)
-#define FMC1_FOGFUNC_VERTEX (0<<28)
-#define FMC1_FOGFUNC_PIXEL_EXP (1<<28)
-#define FMC1_FOGFUNC_PIXEL_EXP2 (2<<28)
-#define FMC1_FOGFUNC_PIXEL_LINEAR (3<<28)
-#define FMC1_FOGFUNC_MASK (3<<28)
-#define FMC1_FOGINDEX_MODIFY_ENABLE (1<<27)
-#define FMC1_FOGINDEX_Z (0<<25)
-#define FMC1_FOGINDEX_W (1<<25)
-#define FMC1_C1_C2_MODIFY_ENABLE (1<<24)
-#define FMC1_DENSITY_MODIFY_ENABLE (1<<23)
-#define FMC1_C1_ONE (1<<13)
-#define FMC1_C1_MASK (0xffff<<4)
-/* Dword 2 */
-#define FMC2_C2_ONE (1<<16)
-/* Dword 3 */
-#define FMC3_D_ONE (1<<16)
-
-
-
-/* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p177 */
-#define _3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24))
-#define IAB_MODIFY_ENABLE (1<<23)
-#define IAB_ENABLE (1<<22)
-#define IAB_MODIFY_FUNC (1<<21)
-#define IAB_FUNC_SHIFT 16
-#define IAB_MODIFY_SRC_FACTOR (1<<11)
-#define IAB_SRC_FACTOR_SHIFT 6
-#define IAB_SRC_FACTOR_MASK (BLENDFACT_MASK<<6)
-#define IAB_MODIFY_DST_FACTOR (1<<5)
-#define IAB_DST_FACTOR_SHIFT 0
-#define IAB_DST_FACTOR_MASK (BLENDFACT_MASK<<0)
-
-
-#define BLENDFUNC_ADD 0x0
-#define BLENDFUNC_SUBTRACT 0x1
-#define BLENDFUNC_REVERSE_SUBTRACT 0x2
-#define BLENDFUNC_MIN 0x3
-#define BLENDFUNC_MAX 0x4
-#define BLENDFUNC_MASK 0x7
-
-/* 3DSTATE_LOAD_INDIRECT, p180 */
-
-#define _3DSTATE_LOAD_INDIRECT (CMD_3D|(0x1d<<24)|(0x7<<16))
-#define LI0_STATE_STATIC_INDIRECT (0x01<<8)
-#define LI0_STATE_DYNAMIC_INDIRECT (0x02<<8)
-#define LI0_STATE_SAMPLER (0x04<<8)
-#define LI0_STATE_MAP (0x08<<8)
-#define LI0_STATE_PROGRAM (0x10<<8)
-#define LI0_STATE_CONSTANTS (0x20<<8)
-
-#define SIS0_BUFFER_ADDRESS(x) ((x)&~0x3)
-#define SIS0_FORCE_LOAD (1<<1)
-#define SIS0_BUFFER_VALID (1<<0)
-#define SIS1_BUFFER_LENGTH(x) ((x)&0xff)
-
-#define DIS0_BUFFER_ADDRESS(x) ((x)&~0x3)
-#define DIS0_BUFFER_RESET (1<<1)
-#define DIS0_BUFFER_VALID (1<<0)
-
-#define SSB0_BUFFER_ADDRESS(x) ((x)&~0x3)
-#define SSB0_FORCE_LOAD (1<<1)
-#define SSB0_BUFFER_VALID (1<<0)
-#define SSB1_BUFFER_LENGTH(x) ((x)&0xff)
-
-#define MSB0_BUFFER_ADDRESS(x) ((x)&~0x3)
-#define MSB0_FORCE_LOAD (1<<1)
-#define MSB0_BUFFER_VALID (1<<0)
-#define MSB1_BUFFER_LENGTH(x) ((x)&0xff)
-
-#define PSP0_BUFFER_ADDRESS(x) ((x)&~0x3)
-#define PSP0_FORCE_LOAD (1<<1)
-#define PSP0_BUFFER_VALID (1<<0)
-#define PSP1_BUFFER_LENGTH(x) ((x)&0xff)
-
-#define PSC0_BUFFER_ADDRESS(x) ((x)&~0x3)
-#define PSC0_FORCE_LOAD (1<<1)
-#define PSC0_BUFFER_VALID (1<<0)
-#define PSC1_BUFFER_LENGTH(x) ((x)&0xff)
-
-
-
-
-
-/* _3DSTATE_RASTERIZATION_RULES */
-#define _3DSTATE_RASTER_RULES_CMD (CMD_3D|(0x07<<24))
-#define ENABLE_POINT_RASTER_RULE (1<<15)
-#define OGL_POINT_RASTER_RULE (1<<13)
-#define ENABLE_TEXKILL_3D_4D (1<<10)
-#define TEXKILL_3D (0<<9)
-#define TEXKILL_4D (1<<9)
-#define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8)
-#define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5)
-#define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6)
-#define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3)
-
-/* _3DSTATE_SCISSOR_ENABLE, p256 */
-#define _3DSTATE_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19))
-#define ENABLE_SCISSOR_RECT ((1<<1) | 1)
-#define DISABLE_SCISSOR_RECT (1<<1)
-
-/* _3DSTATE_SCISSOR_RECTANGLE_0, p257 */
-#define _3DSTATE_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1)
-/* Dword 1 */
-#define SCISSOR_RECT_0_YMIN(x) ((x)<<16)
-#define SCISSOR_RECT_0_XMIN(x) (x)
-/* Dword 2 */
-#define SCISSOR_RECT_0_YMAX(x) ((x)<<16)
-#define SCISSOR_RECT_0_XMAX(x) (x)
-
-/* p189 */
-#define _3DSTATE_LOAD_STATE_IMMEDIATE_1 ((0x3<<29)|(0x1d<<24)|(0x04<<16))
-#define I1_LOAD_S(n) (1<<(4+n))
-
-#define S0_VB_OFFSET_MASK 0xffffffc
-#define S0_AUTO_CACHE_INV_DISABLE (1<<0)
-
-#define S1_VERTEX_WIDTH_SHIFT 24
-#define S1_VERTEX_WIDTH_MASK (0x3f<<24)
-#define S1_VERTEX_PITCH_SHIFT 16
-#define S1_VERTEX_PITCH_MASK (0x3f<<16)
-
-#define TEXCOORDFMT_2D 0x0
-#define TEXCOORDFMT_3D 0x1
-#define TEXCOORDFMT_4D 0x2
-#define TEXCOORDFMT_1D 0x3
-#define TEXCOORDFMT_2D_16 0x4
-#define TEXCOORDFMT_4D_16 0x5
-#define TEXCOORDFMT_NOT_PRESENT 0xf
-#define S2_TEXCOORD_FMT0_MASK 0xf
-#define S2_TEXCOORD_FMT1_SHIFT 4
-#define S2_TEXCOORD_FMT(unit, type) ((type)<<(unit*4))
-#define S2_TEXCOORD_NONE (~0)
-
-/* S3 not interesting */
-
-#define S4_POINT_WIDTH_SHIFT 23
-#define S4_POINT_WIDTH_MASK (0x1ff<<23)
-#define S4_LINE_WIDTH_SHIFT 19
-#define S4_LINE_WIDTH_ONE (0x2<<19)
-#define S4_LINE_WIDTH_MASK (0xf<<19)
-#define S4_FLATSHADE_ALPHA (1<<18)
-#define S4_FLATSHADE_FOG (1<<17)
-#define S4_FLATSHADE_SPECULAR (1<<16)
-#define S4_FLATSHADE_COLOR (1<<15)
-#define S4_CULLMODE_BOTH (0<<13)
-#define S4_CULLMODE_NONE (1<<13)
-#define S4_CULLMODE_CW (2<<13)
-#define S4_CULLMODE_CCW (3<<13)
-#define S4_CULLMODE_MASK (3<<13)
-#define S4_VFMT_POINT_WIDTH (1<<12)
-#define S4_VFMT_SPEC_FOG (1<<11)
-#define S4_VFMT_COLOR (1<<10)
-#define S4_VFMT_DEPTH_OFFSET (1<<9)
-#define S4_VFMT_XYZ (1<<6)
-#define S4_VFMT_XYZW (2<<6)
-#define S4_VFMT_XY (3<<6)
-#define S4_VFMT_XYW (4<<6)
-#define S4_VFMT_XYZW_MASK (7<<6)
-#define S4_FORCE_DEFAULT_DIFFUSE (1<<5)
-#define S4_FORCE_DEFAULT_SPECULAR (1<<4)
-#define S4_LOCAL_DEPTH_OFFSET_ENABLE (1<<3)
-#define S4_VFMT_FOG_PARAM (1<<2)
-#define S4_SPRITE_POINT_ENABLE (1<<1)
-#define S4_LINE_ANTIALIAS_ENABLE (1<<0)
-
-#define S4_VFMT_MASK (S4_VFMT_POINT_WIDTH | \
- S4_VFMT_SPEC_FOG | \
- S4_VFMT_COLOR | \
- S4_VFMT_DEPTH_OFFSET | \
- S4_VFMT_XYZW_MASK | \
- S4_VFMT_FOG_PARAM)
-
-
-#define S5_WRITEDISABLE_ALPHA (1<<31)
-#define S5_WRITEDISABLE_RED (1<<30)
-#define S5_WRITEDISABLE_GREEN (1<<29)
-#define S5_WRITEDISABLE_BLUE (1<<28)
-#define S5_WRITEDISABLE_MASK (0xf<<28)
-#define S5_FORCE_DEFAULT_POINT_SIZE (1<<27)
-#define S5_LAST_PIXEL_ENABLE (1<<26)
-#define S5_GLOBAL_DEPTH_OFFSET_ENABLE (1<<25)
-#define S5_FOG_ENABLE (1<<24)
-#define S5_STENCIL_REF_SHIFT 16
-#define S5_STENCIL_REF_MASK (0xff<<16)
-#define S5_STENCIL_TEST_FUNC_SHIFT 13
-#define S5_STENCIL_TEST_FUNC_MASK (0x7<<13)
-#define S5_STENCIL_FAIL_SHIFT 10
-#define S5_STENCIL_FAIL_MASK (0x7<<10)
-#define S5_STENCIL_PASS_Z_FAIL_SHIFT 7
-#define S5_STENCIL_PASS_Z_FAIL_MASK (0x7<<7)
-#define S5_STENCIL_PASS_Z_PASS_SHIFT 4
-#define S5_STENCIL_PASS_Z_PASS_MASK (0x7<<4)
-#define S5_STENCIL_WRITE_ENABLE (1<<3)
-#define S5_STENCIL_TEST_ENABLE (1<<2)
-#define S5_COLOR_DITHER_ENABLE (1<<1)
-#define S5_LOGICOP_ENABLE (1<<0)
-
-
-#define S6_ALPHA_TEST_ENABLE (1<<31)
-#define S6_ALPHA_TEST_FUNC_SHIFT 28
-#define S6_ALPHA_TEST_FUNC_MASK (0x7<<28)
-#define S6_ALPHA_REF_SHIFT 20
-#define S6_ALPHA_REF_MASK (0xff<<20)
-#define S6_DEPTH_TEST_ENABLE (1<<19)
-#define S6_DEPTH_TEST_FUNC_SHIFT 16
-#define S6_DEPTH_TEST_FUNC_MASK (0x7<<16)
-#define S6_CBUF_BLEND_ENABLE (1<<15)
-#define S6_CBUF_BLEND_FUNC_SHIFT 12
-#define S6_CBUF_BLEND_FUNC_MASK (0x7<<12)
-#define S6_CBUF_SRC_BLEND_FACT_SHIFT 8
-#define S6_CBUF_SRC_BLEND_FACT_MASK (0xf<<8)
-#define S6_CBUF_DST_BLEND_FACT_SHIFT 4
-#define S6_CBUF_DST_BLEND_FACT_MASK (0xf<<4)
-#define S6_DEPTH_WRITE_ENABLE (1<<3)
-#define S6_COLOR_WRITE_ENABLE (1<<2)
-#define S6_TRISTRIP_PV_SHIFT 0
-#define S6_TRISTRIP_PV_MASK (0x3<<0)
-
-#define S7_DEPTH_OFFSET_CONST_MASK ~0
-
-/* 3DSTATE_MAP_DEINTERLACER_PARAMETERS */
-/* 3DSTATE_MAP_PALETTE_LOAD_32, p206 */
-
-
-/* _3DSTATE_MODES_4, p218 */
-#define _3DSTATE_MODES_4_CMD (CMD_3D|(0x0d<<24))
-#define ENABLE_LOGIC_OP_FUNC (1<<23)
-#define LOGIC_OP_FUNC(x) ((x)<<18)
-#define LOGICOP_MASK (0xf<<18)
-#define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00))
-#define ENABLE_STENCIL_TEST_MASK (1<<17)
-#define STENCIL_TEST_MASK(x) ((x)<<8)
-#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff))
-#define ENABLE_STENCIL_WRITE_MASK (1<<16)
-#define STENCIL_WRITE_MASK(x) (x)
-
-/* _3DSTATE_MODES_5, p220 */
-#define _3DSTATE_MODES_5_CMD (CMD_3D|(0x0c<<24))
-#define PIPELINE_FLUSH_RENDER_CACHE (1<<18)
-#define PIPELINE_FLUSH_TEXTURE_CACHE (1<<16)
-
-
-/* p221 */
-#define _3DSTATE_PIXEL_SHADER_CONSTANTS (CMD_3D|(0x1d<<24)|(0x6<<16))
-#define PS1_REG(n) (1<<(n))
-#define PS2_CONST_X(n) (n)
-#define PS3_CONST_Y(n) (n)
-#define PS4_CONST_Z(n) (n)
-#define PS5_CONST_W(n) (n)
-
-/* p222 */
-
-
-#define I915_MAX_TEX_INDIRECT 4
-#define I915_MAX_TEX_INSN 32
-#define I915_MAX_ALU_INSN 64
-#define I915_MAX_DECL_INSN 27
-#define I915_MAX_TEMPORARY 16
-
-
-/* Each instruction is 3 dwords long, though most don't require all
- * this space. Maximum of 123 instructions. Smaller maxes per insn
- * type.
- */
-#define _3DSTATE_PIXEL_SHADER_PROGRAM (CMD_3D|(0x1d<<24)|(0x5<<16))
-
-#define REG_TYPE_R 0 /* temporary regs, no need to
- * dcl, must be written before
- * read -- Preserved between
- * phases.
- */
-#define REG_TYPE_T 1 /* Interpolated values, must be
- * dcl'ed before use.
- *
- * 0..7: texture coord,
- * 8: diffuse spec,
- * 9: specular color,
- * 10: fog parameter in w.
- */
-#define REG_TYPE_CONST 2 /* Restriction: only one const
- * can be referenced per
- * instruction, though it may be
- * selected for multiple inputs.
- * Constants not initialized
- * default to zero.
- */
-#define REG_TYPE_S 3 /* sampler */
-#define REG_TYPE_OC 4 /* output color (rgba) */
-#define REG_TYPE_OD 5 /* output depth (w), xyz are
- * temporaries. If not written,
- * interpolated depth is used?
- */
-#define REG_TYPE_U 6 /* unpreserved temporaries */
-#define REG_TYPE_MASK 0x7
-#define REG_NR_MASK 0xf
-
-
-/* REG_TYPE_T:
- */
-#define T_TEX0 0
-#define T_TEX1 1
-#define T_TEX2 2
-#define T_TEX3 3
-#define T_TEX4 4
-#define T_TEX5 5
-#define T_TEX6 6
-#define T_TEX7 7
-#define T_DIFFUSE 8
-#define T_SPECULAR 9
-#define T_FOG_W 10 /* interpolated fog is in W coord */
-
-/* Arithmetic instructions */
-
-/* .replicate_swizzle == selection and replication of a particular
- * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww
- */
-#define A0_NOP (0x0<<24) /* no operation */
-#define A0_ADD (0x1<<24) /* dst = src0 + src1 */
-#define A0_MOV (0x2<<24) /* dst = src0 */
-#define A0_MUL (0x3<<24) /* dst = src0 * src1 */
-#define A0_MAD (0x4<<24) /* dst = src0 * src1 + src2 */
-#define A0_DP2ADD (0x5<<24) /* dst.xyzw = src0.xy dot src1.xy + src2.replicate_swizzle */
-#define A0_DP3 (0x6<<24) /* dst.xyzw = src0.xyz dot src1.xyz */
-#define A0_DP4 (0x7<<24) /* dst.xyzw = src0.xyzw dot src1.xyzw */
-#define A0_FRC (0x8<<24) /* dst = src0 - floor(src0) */
-#define A0_RCP (0x9<<24) /* dst.xyzw = 1/(src0.replicate_swizzle) */
-#define A0_RSQ (0xa<<24) /* dst.xyzw = 1/(sqrt(abs(src0.replicate_swizzle))) */
-#define A0_EXP (0xb<<24) /* dst.xyzw = exp2(src0.replicate_swizzle) */
-#define A0_LOG (0xc<<24) /* dst.xyzw = log2(abs(src0.replicate_swizzle)) */
-#define A0_CMP (0xd<<24) /* dst = (src0 >= 0.0) ? src1 : src2 */
-#define A0_MIN (0xe<<24) /* dst = (src0 < src1) ? src0 : src1 */
-#define A0_MAX (0xf<<24) /* dst = (src0 >= src1) ? src0 : src1 */
-#define A0_FLR (0x10<<24) /* dst = floor(src0) */
-#define A0_MOD (0x11<<24) /* dst = src0 fmod 1.0 */
-#define A0_TRC (0x12<<24) /* dst = int(src0) */
-#define A0_SGE (0x13<<24) /* dst = src0 >= src1 ? 1.0 : 0.0 */
-#define A0_SLT (0x14<<24) /* dst = src0 < src1 ? 1.0 : 0.0 */
-#define A0_DEST_SATURATE (1<<22)
-#define A0_DEST_TYPE_SHIFT 19
-/* Allow: R, OC, OD, U */
-#define A0_DEST_NR_SHIFT 14
-/* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */
-#define A0_DEST_CHANNEL_X (1<<10)
-#define A0_DEST_CHANNEL_Y (2<<10)
-#define A0_DEST_CHANNEL_Z (4<<10)
-#define A0_DEST_CHANNEL_W (8<<10)
-#define A0_DEST_CHANNEL_ALL (0xf<<10)
-#define A0_DEST_CHANNEL_SHIFT 10
-#define A0_SRC0_TYPE_SHIFT 7
-#define A0_SRC0_NR_SHIFT 2
-
-#define A0_DEST_CHANNEL_XY (A0_DEST_CHANNEL_X|A0_DEST_CHANNEL_Y)
-#define A0_DEST_CHANNEL_XYZ (A0_DEST_CHANNEL_XY|A0_DEST_CHANNEL_Z)
-
-
-#define SRC_X 0
-#define SRC_Y 1
-#define SRC_Z 2
-#define SRC_W 3
-#define SRC_ZERO 4
-#define SRC_ONE 5
-
-#define A1_SRC0_CHANNEL_X_NEGATE (1<<31)
-#define A1_SRC0_CHANNEL_X_SHIFT 28
-#define A1_SRC0_CHANNEL_Y_NEGATE (1<<27)
-#define A1_SRC0_CHANNEL_Y_SHIFT 24
-#define A1_SRC0_CHANNEL_Z_NEGATE (1<<23)
-#define A1_SRC0_CHANNEL_Z_SHIFT 20
-#define A1_SRC0_CHANNEL_W_NEGATE (1<<19)
-#define A1_SRC0_CHANNEL_W_SHIFT 16
-#define A1_SRC1_TYPE_SHIFT 13
-#define A1_SRC1_NR_SHIFT 8
-#define A1_SRC1_CHANNEL_X_NEGATE (1<<7)
-#define A1_SRC1_CHANNEL_X_SHIFT 4
-#define A1_SRC1_CHANNEL_Y_NEGATE (1<<3)
-#define A1_SRC1_CHANNEL_Y_SHIFT 0
-
-#define A2_SRC1_CHANNEL_Z_NEGATE (1<<31)
-#define A2_SRC1_CHANNEL_Z_SHIFT 28
-#define A2_SRC1_CHANNEL_W_NEGATE (1<<27)
-#define A2_SRC1_CHANNEL_W_SHIFT 24
-#define A2_SRC2_TYPE_SHIFT 21
-#define A2_SRC2_NR_SHIFT 16
-#define A2_SRC2_CHANNEL_X_NEGATE (1<<15)
-#define A2_SRC2_CHANNEL_X_SHIFT 12
-#define A2_SRC2_CHANNEL_Y_NEGATE (1<<11)
-#define A2_SRC2_CHANNEL_Y_SHIFT 8
-#define A2_SRC2_CHANNEL_Z_NEGATE (1<<7)
-#define A2_SRC2_CHANNEL_Z_SHIFT 4
-#define A2_SRC2_CHANNEL_W_NEGATE (1<<3)
-#define A2_SRC2_CHANNEL_W_SHIFT 0
-
-
-
-/* Texture instructions */
-#define T0_TEXLD (0x15<<24) /* Sample texture using predeclared
- * sampler and address, and output
- * filtered texel data to destination
- * register */
-#define T0_TEXLDP (0x16<<24) /* Same as texld but performs a
- * perspective divide of the texture
- * coordinate .xyz values by .w before
- * sampling. */
-#define T0_TEXLDB (0x17<<24) /* Same as texld but biases the
- * computed LOD by w. Only S4.6 two's
- * comp is used. This implies that a
- * float to fixed conversion is
- * done. */
-#define T0_TEXKILL (0x18<<24) /* Does not perform a sampling
- * operation. Simply kills the pixel
- * if any channel of the address
- * register is < 0.0. */
-#define T0_DEST_TYPE_SHIFT 19
-/* Allow: R, OC, OD, U */
-/* Note: U (unpreserved) regs do not retain their values between
- * phases (cannot be used for feedback)
- *
- * Note: oC and OD registers can only be used as the destination of a
- * texture instruction once per phase (this is an implementation
- * restriction).
- */
-#define T0_DEST_NR_SHIFT 14
-/* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */
-#define T0_SAMPLER_NR_SHIFT 0 /* This field ignored for TEXKILL */
-#define T0_SAMPLER_NR_MASK (0xf<<0)
-
-#define T1_ADDRESS_REG_TYPE_SHIFT 24 /* Reg to use as texture coord */
-/* Allow R, T, OC, OD -- R, OC, OD are 'dependent' reads, new program phase */
-#define T1_ADDRESS_REG_NR_SHIFT 17
-#define T2_MBZ 0
-
-/* Declaration instructions */
-#define D0_DCL (0x19<<24) /* Declare a t (interpolated attrib)
- * register or an s (sampler)
- * register. */
-#define D0_SAMPLE_TYPE_SHIFT 22
-#define D0_SAMPLE_TYPE_2D (0x0<<22)
-#define D0_SAMPLE_TYPE_CUBE (0x1<<22)
-#define D0_SAMPLE_TYPE_VOLUME (0x2<<22)
-#define D0_SAMPLE_TYPE_MASK (0x3<<22)
-
-#define D0_TYPE_SHIFT 19
-/* Allow: T, S */
-#define D0_NR_SHIFT 14
-/* Allow T: 0..10, S: 0..15 */
-#define D0_CHANNEL_X (1<<10)
-#define D0_CHANNEL_Y (2<<10)
-#define D0_CHANNEL_Z (4<<10)
-#define D0_CHANNEL_W (8<<10)
-#define D0_CHANNEL_ALL (0xf<<10)
-#define D0_CHANNEL_NONE (0<<10)
-
-#define D0_CHANNEL_XY (D0_CHANNEL_X|D0_CHANNEL_Y)
-#define D0_CHANNEL_XYZ (D0_CHANNEL_XY|D0_CHANNEL_Z)
-
-/* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse
- * or specular declarations.
- *
- * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw)
- *
- * Must be zero for S (sampler) dcls
- */
-#define D1_MBZ 0
-#define D2_MBZ 0
-
-
-
-/* p207 */
-#define _3DSTATE_MAP_STATE (CMD_3D|(0x1d<<24)|(0x0<<16))
-
-#define MS1_MAPMASK_SHIFT 0
-#define MS1_MAPMASK_MASK (0x8fff<<0)
-
-#define MS2_UNTRUSTED_SURFACE (1<<31)
-#define MS2_ADDRESS_MASK 0xfffffffc
-#define MS2_VERTICAL_LINE_STRIDE (1<<1)
-#define MS2_VERTICAL_OFFSET (1<<1)
-
-#define MS3_HEIGHT_SHIFT 21
-#define MS3_WIDTH_SHIFT 10
-#define MS3_PALETTE_SELECT (1<<9)
-#define MS3_MAPSURF_FORMAT_SHIFT 7
-#define MS3_MAPSURF_FORMAT_MASK (0x7<<7)
-#define MAPSURF_8BIT (1<<7)
-#define MAPSURF_16BIT (2<<7)
-#define MAPSURF_32BIT (3<<7)
-#define MAPSURF_422 (5<<7)
-#define MAPSURF_COMPRESSED (6<<7)
-#define MAPSURF_4BIT_INDEXED (7<<7)
-#define MS3_MT_FORMAT_MASK (0x7 << 3)
-#define MS3_MT_FORMAT_SHIFT 3
-#define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */
-#define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */
-#define MT_8BIT_L8 (1<<3)
-#define MT_8BIT_A8 (4<<3)
-#define MT_8BIT_MONO8 (5<<3)
-#define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */
-#define MT_16BIT_ARGB1555 (1<<3)
-#define MT_16BIT_ARGB4444 (2<<3)
-#define MT_16BIT_AY88 (3<<3)
-#define MT_16BIT_88DVDU (5<<3)
-#define MT_16BIT_BUMP_655LDVDU (6<<3)
-#define MT_16BIT_I16 (7<<3)
-#define MT_16BIT_L16 (8<<3)
-#define MT_16BIT_A16 (9<<3)
-#define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */
-#define MT_32BIT_ABGR8888 (1<<3)
-#define MT_32BIT_XRGB8888 (2<<3)
-#define MT_32BIT_XBGR8888 (3<<3)
-#define MT_32BIT_QWVU8888 (4<<3)
-#define MT_32BIT_AXVU8888 (5<<3)
-#define MT_32BIT_LXVU8888 (6<<3)
-#define MT_32BIT_XLVU8888 (7<<3)
-#define MT_32BIT_ARGB2101010 (8<<3)
-#define MT_32BIT_ABGR2101010 (9<<3)
-#define MT_32BIT_AWVU2101010 (0xA<<3)
-#define MT_32BIT_GR1616 (0xB<<3)
-#define MT_32BIT_VU1616 (0xC<<3)
-#define MT_32BIT_xI824 (0xD<<3)
-#define MT_32BIT_xA824 (0xE<<3)
-#define MT_32BIT_xL824 (0xF<<3)
-#define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */
-#define MT_422_YCRCB_NORMAL (1<<3)
-#define MT_422_YCRCB_SWAPUV (2<<3)
-#define MT_422_YCRCB_SWAPUVY (3<<3)
-#define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */
-#define MT_COMPRESS_DXT2_3 (1<<3)
-#define MT_COMPRESS_DXT4_5 (2<<3)
-#define MT_COMPRESS_FXT1 (3<<3)
-#define MT_COMPRESS_DXT1_RGB (4<<3)
-#define MS3_USE_FENCE_REGS (1<<2)
-#define MS3_TILED_SURFACE (1<<1)
-#define MS3_TILE_WALK (1<<0)
-
-#define MS4_PITCH_SHIFT 21
-#define MS4_CUBE_FACE_ENA_NEGX (1<<20)
-#define MS4_CUBE_FACE_ENA_POSX (1<<19)
-#define MS4_CUBE_FACE_ENA_NEGY (1<<18)
-#define MS4_CUBE_FACE_ENA_POSY (1<<17)
-#define MS4_CUBE_FACE_ENA_NEGZ (1<<16)
-#define MS4_CUBE_FACE_ENA_POSZ (1<<15)
-#define MS4_CUBE_FACE_ENA_MASK (0x3f<<15)
-#define MS4_MAX_LOD_SHIFT 9
-#define MS4_MAX_LOD_MASK (0x3f<<9)
-#define MS4_MIP_LAYOUT_LEGACY (0<<8)
-#define MS4_VOLUME_DEPTH_SHIFT 0
-#define MS4_VOLUME_DEPTH_MASK (0xff<<0)
-
-/* p244 */
-#define _3DSTATE_SAMPLER_STATE (CMD_3D|(0x1d<<24)|(0x1<<16))
-
-#define SS1_MAPMASK_SHIFT 0
-#define SS1_MAPMASK_MASK (0x8fff<<0)
-
-#define SS2_REVERSE_GAMMA_ENABLE (1<<31)
-#define SS2_PACKED_TO_PLANAR_ENABLE (1<<30)
-#define SS2_COLORSPACE_CONVERSION (1<<29)
-#define SS2_CHROMAKEY_SHIFT 27
-#define SS2_BASE_MIP_LEVEL_SHIFT 22
-#define SS2_BASE_MIP_LEVEL_MASK (0x1f<<22)
-#define SS2_MIP_FILTER_SHIFT 20
-#define SS2_MIP_FILTER_MASK (0x3<<20)
-#define MIPFILTER_NONE 0
-#define MIPFILTER_NEAREST 1
-#define MIPFILTER_LINEAR 3
-#define SS2_MAG_FILTER_SHIFT 17
-#define SS2_MAG_FILTER_MASK (0x7<<17)
-#define FILTER_NEAREST 0
-#define FILTER_LINEAR 1
-#define FILTER_ANISOTROPIC 2
-#define FILTER_4X4_1 3
-#define FILTER_4X4_2 4
-#define FILTER_4X4_FLAT 5
-#define FILTER_6X5_MONO 6 /* XXX - check */
-#define SS2_MIN_FILTER_SHIFT 14
-#define SS2_MIN_FILTER_MASK (0x7<<14)
-#define SS2_LOD_BIAS_SHIFT 5
-#define SS2_LOD_BIAS_ONE (0x10<<5)
-#define SS2_LOD_BIAS_MASK (0x1ff<<5)
-/* Shadow requires:
- * MT_X8{I,L,A}24 or MT_{I,L,A}16 texture format
- * FILTER_4X4_x MIN and MAG filters
- */
-#define SS2_SHADOW_ENABLE (1<<4)
-#define SS2_MAX_ANISO_MASK (1<<3)
-#define SS2_MAX_ANISO_2 (0<<3)
-#define SS2_MAX_ANISO_4 (1<<3)
-#define SS2_SHADOW_FUNC_SHIFT 0
-#define SS2_SHADOW_FUNC_MASK (0x7<<0)
-/* SS2_SHADOW_FUNC values: see COMPAREFUNC_* */
-
-#define SS3_MIN_LOD_SHIFT 24
-#define SS3_MIN_LOD_ONE (0x10<<24)
-#define SS3_MIN_LOD_MASK (0xff<<24)
-#define SS3_KILL_PIXEL_ENABLE (1<<17)
-#define SS3_TCX_ADDR_MODE_SHIFT 12
-#define SS3_TCX_ADDR_MODE_MASK (0x7<<12)
-#define TEXCOORDMODE_WRAP 0
-#define TEXCOORDMODE_MIRROR 1
-#define TEXCOORDMODE_CLAMP_EDGE 2
-#define TEXCOORDMODE_CUBE 3
-#define TEXCOORDMODE_CLAMP_BORDER 4
-#define TEXCOORDMODE_MIRROR_ONCE 5
-#define SS3_TCY_ADDR_MODE_SHIFT 9
-#define SS3_TCY_ADDR_MODE_MASK (0x7<<9)
-#define SS3_TCZ_ADDR_MODE_SHIFT 6
-#define SS3_TCZ_ADDR_MODE_MASK (0x7<<6)
-#define SS3_NORMALIZED_COORDS (1<<5)
-#define SS3_TEXTUREMAP_INDEX_SHIFT 1
-#define SS3_TEXTUREMAP_INDEX_MASK (0xf<<1)
-#define SS3_DEINTERLACER_ENABLE (1<<0)
-
-#define SS4_BORDER_COLOR_MASK (~0)
-
-/* 3DSTATE_SPAN_STIPPLE, p258
- */
-#define _3DSTATE_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16))
-#define ST1_ENABLE (1<<16)
-#define ST1_MASK (0xffff)
-
-
-#define MI_FLUSH ((0<<29)|(4<<23))
-#define FLUSH_MAP_CACHE (1<<0)
-#define FLUSH_RENDER_CACHE (1<<1)
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_state.c
deleted file mode 100644
index adb17b218..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_state.c
+++ /dev/null
@@ -1,954 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-#include "texmem.h"
-
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-
-#include "i915_context.h"
-#include "i915_reg.h"
-
-
-
-static void i915StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- int test = intel_translate_compare_func( func );
-
- mask = mask & 0xff;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s : func: %s, ref : 0x%x, mask: 0x%x\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(func), ref, mask);
-
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK;
- i915->state.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(mask));
-
- i915->state.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_REF_MASK |
- S5_STENCIL_TEST_FUNC_MASK);
-
- i915->state.Ctx[I915_CTXREG_LIS5] |= ((ref << S5_STENCIL_REF_SHIFT) |
- (test << S5_STENCIL_TEST_FUNC_SHIFT));
-}
-
-static void i915StencilMask(GLcontext *ctx, GLuint mask)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s : mask 0x%x\n", __FUNCTION__, mask);
-
- mask = mask & 0xff;
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK;
- i915->state.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(mask));
-}
-
-
-static void i915StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- int fop = intel_translate_stencil_op(fail);
- int dfop = intel_translate_stencil_op(zfail);
- int dpop = intel_translate_stencil_op(zpass);
-
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(fail),
- _mesa_lookup_enum_by_nr(zfail),
- _mesa_lookup_enum_by_nr(zpass));
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
-
- i915->state.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_FAIL_MASK |
- S5_STENCIL_PASS_Z_FAIL_MASK |
- S5_STENCIL_PASS_Z_PASS_MASK);
-
- i915->state.Ctx[I915_CTXREG_LIS5] |= ((fop << S5_STENCIL_FAIL_SHIFT) |
- (dfop << S5_STENCIL_PASS_Z_FAIL_SHIFT) |
- (dpop << S5_STENCIL_PASS_Z_PASS_SHIFT));
-}
-
-static void i915AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- int test = intel_translate_compare_func( func );
- GLubyte refByte;
-
- UNCLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~(S6_ALPHA_TEST_FUNC_MASK |
- S6_ALPHA_REF_MASK);
- i915->state.Ctx[I915_CTXREG_LIS6] |= ((test << S6_ALPHA_TEST_FUNC_SHIFT) |
- (((GLuint)refByte) << S6_ALPHA_REF_SHIFT));
-}
-
-/* This function makes sure that the proper enables are
- * set for LogicOp, Independant Alpha Blend, and Blending.
- * It needs to be called from numerous places where we
- * could change the LogicOp or Independant Alpha Blend without subsequent
- * calls to glEnable.
- */
-static void i915EvalLogicOpBlendState(GLcontext *ctx)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
-
- if (ctx->Color._LogicOpEnabled) {
- i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE;
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
- } else {
- i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_LOGICOP_ENABLE;
-
- if (ctx->Color.BlendEnabled) {
- i915->state.Ctx[I915_CTXREG_LIS6] |= S6_CBUF_BLEND_ENABLE;
- } else {
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
- }
- }
-}
-
-static void i915BlendColor(GLcontext *ctx, const GLfloat color[4])
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- GLubyte r, g, b, a;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(a, color[ACOMP]);
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_BLENDCOLOR1] = (a<<24) | (r<<16) | (g<<8) | b;
-}
-
-
-#define DST_BLND_FACT(f) ((f)<<S6_CBUF_DST_BLEND_FACT_SHIFT)
-#define SRC_BLND_FACT(f) ((f)<<S6_CBUF_SRC_BLEND_FACT_SHIFT)
-#define DST_ABLND_FACT(f) ((f)<<IAB_DST_FACTOR_SHIFT)
-#define SRC_ABLND_FACT(f) ((f)<<IAB_SRC_FACTOR_SHIFT)
-
-
-
-static GLuint translate_blend_equation( GLenum mode )
-{
- switch (mode) {
- case GL_FUNC_ADD: return BLENDFUNC_ADD;
- case GL_MIN: return BLENDFUNC_MIN;
- case GL_MAX: return BLENDFUNC_MAX;
- case GL_FUNC_SUBTRACT: return BLENDFUNC_SUBTRACT;
- case GL_FUNC_REVERSE_SUBTRACT: return BLENDFUNC_REVERSE_SUBTRACT;
- default: return 0;
- }
-}
-
-static void i915UpdateBlendState( GLcontext *ctx )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- GLuint iab = (i915->state.Ctx[I915_CTXREG_IAB] &
- ~(IAB_SRC_FACTOR_MASK |
- IAB_DST_FACTOR_MASK |
- (BLENDFUNC_MASK << IAB_FUNC_SHIFT) |
- IAB_ENABLE));
-
- GLuint lis6 = (i915->state.Ctx[I915_CTXREG_LIS6] &
- ~(S6_CBUF_SRC_BLEND_FACT_MASK |
- S6_CBUF_DST_BLEND_FACT_MASK |
- S6_CBUF_BLEND_FUNC_MASK));
-
- GLuint eqRGB = ctx->Color.BlendEquationRGB;
- GLuint eqA = ctx->Color.BlendEquationA;
- GLuint srcRGB = ctx->Color.BlendSrcRGB;
- GLuint dstRGB = ctx->Color.BlendDstRGB;
- GLuint srcA = ctx->Color.BlendSrcA;
- GLuint dstA = ctx->Color.BlendDstA;
-
- if (eqRGB == GL_MIN || eqRGB == GL_MAX) {
- srcRGB = dstRGB = GL_ONE;
- }
-
- if (eqA == GL_MIN || eqA == GL_MAX) {
- srcA = dstA = GL_ONE;
- }
-
- lis6 |= SRC_BLND_FACT(intel_translate_blend_factor(srcRGB));
- lis6 |= DST_BLND_FACT(intel_translate_blend_factor(dstRGB));
- lis6 |= translate_blend_equation( eqRGB ) << S6_CBUF_BLEND_FUNC_SHIFT;
-
- iab |= SRC_ABLND_FACT(intel_translate_blend_factor(srcA));
- iab |= DST_ABLND_FACT(intel_translate_blend_factor(dstA));
- iab |= translate_blend_equation( eqA ) << IAB_FUNC_SHIFT;
-
- if (srcA != srcRGB || dstA != dstRGB || eqA != eqRGB)
- iab |= IAB_ENABLE;
-
- if (iab != i915->state.Ctx[I915_CTXREG_IAB] ||
- lis6 != i915->state.Ctx[I915_CTXREG_LIS6]) {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_IAB] = iab;
- i915->state.Ctx[I915_CTXREG_LIS6] = lis6;
- }
-
- /* This will catch a logicop blend equation */
- i915EvalLogicOpBlendState(ctx);
-}
-
-
-static void i915BlendFuncSeparate(GLcontext *ctx, GLenum srcRGB,
- GLenum dstRGB, GLenum srcA,
- GLenum dstA )
-{
- i915UpdateBlendState( ctx );
-}
-
-
-static void i915BlendEquationSeparate(GLcontext *ctx, GLenum eqRGB,
- GLenum eqA)
-{
- i915UpdateBlendState( ctx );
-}
-
-
-static void i915DepthFunc(GLcontext *ctx, GLenum func)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- int test = intel_translate_compare_func( func );
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_FUNC_MASK;
- i915->state.Ctx[I915_CTXREG_LIS6] |= test << S6_DEPTH_TEST_FUNC_SHIFT;
-}
-
-static void i915DepthMask(GLcontext *ctx, GLboolean flag)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s flag (%d)\n", __FUNCTION__, flag);
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
-
- if (flag && ctx->Depth.Test)
- i915->state.Ctx[I915_CTXREG_LIS6] |= S6_DEPTH_WRITE_ENABLE;
- else
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_WRITE_ENABLE;
-}
-
-/* =============================================================
- * Polygon stipple
- *
- * The i915 supports a 4x4 stipple natively, GL wants 32x32.
- * Fortunately stipple is usually a repeating pattern.
- */
-static void i915PolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- const GLubyte *m = mask;
- GLubyte p[4];
- int i,j,k;
- int active = (ctx->Polygon.StippleFlag &&
- i915->intel.reduced_primitive == GL_TRIANGLES);
- GLuint newMask;
-
- if (active) {
- I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE);
- i915->state.Stipple[I915_STPREG_ST1] &= ~ST1_ENABLE;
- }
-
- p[0] = mask[12] & 0xf; p[0] |= p[0] << 4;
- p[1] = mask[8] & 0xf; p[1] |= p[1] << 4;
- p[2] = mask[4] & 0xf; p[2] |= p[2] << 4;
- p[3] = mask[0] & 0xf; p[3] |= p[3] << 4;
-
- for (k = 0 ; k < 8 ; k++)
- for (j = 3 ; j >= 0; j--)
- for (i = 0 ; i < 4 ; i++, m++)
- if (*m != p[j]) {
- i915->intel.hw_stipple = 0;
- return;
- }
-
- newMask = (((p[0] & 0xf) << 0) |
- ((p[1] & 0xf) << 4) |
- ((p[2] & 0xf) << 8) |
- ((p[3] & 0xf) << 12));
-
-
- if (newMask == 0xffff || newMask == 0x0) {
- /* this is needed to make conform pass */
- i915->intel.hw_stipple = 0;
- return;
- }
-
- i915->state.Stipple[I915_STPREG_ST1] &= ~0xffff;
- i915->state.Stipple[I915_STPREG_ST1] |= newMask;
- i915->intel.hw_stipple = 1;
-
- if (active)
- i915->state.Stipple[I915_STPREG_ST1] |= ST1_ENABLE;
-}
-
-
-/* =============================================================
- * Hardware clipping
- */
-static void i915Scissor(GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- intelScreenPrivate *screen = i915->intel.intelScreen;
- int x1, y1, x2, y2;
-
- if (!i915->intel.driDrawable)
- return;
-
- x1 = x;
- y1 = i915->intel.driDrawable->h - (y + h);
- x2 = x + w - 1;
- y2 = y1 + h - 1;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "[%s] x(%d) y(%d) w(%d) h(%d)\n", __FUNCTION__,
- x, y, w, h);
-
- if (x1 < 0) x1 = 0;
- if (y1 < 0) y1 = 0;
- if (x2 < 0) x2 = 0;
- if (y2 < 0) y2 = 0;
-
- if (x2 >= screen->width) x2 = screen->width-1;
- if (y2 >= screen->height) y2 = screen->height-1;
- if (x1 >= screen->width) x1 = screen->width-1;
- if (y1 >= screen->height) y1 = screen->height-1;
-
-
- I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
- i915->state.Buffer[I915_DESTREG_SR1] = (y1 << 16) | (x1 & 0xffff);
- i915->state.Buffer[I915_DESTREG_SR2] = (y2 << 16) | (x2 & 0xffff);
-}
-
-static void i915LogicOp(GLcontext *ctx, GLenum opcode)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- int tmp = intel_translate_logic_op(opcode);
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_STATE4] &= ~LOGICOP_MASK;
- i915->state.Ctx[I915_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp);
-}
-
-
-
-static void i915CullFaceFrontFace(GLcontext *ctx, GLenum unused)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- GLuint mode;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!ctx->Polygon.CullFlag) {
- mode = S4_CULLMODE_NONE;
- }
- else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
- mode = S4_CULLMODE_CW;
-
- if (ctx->Polygon.CullFaceMode == GL_FRONT)
- mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
- if (ctx->Polygon.FrontFace != GL_CCW)
- mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
- }
- else {
- mode = S4_CULLMODE_BOTH;
- }
-
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_CULLMODE_MASK;
- i915->state.Ctx[I915_CTXREG_LIS4] |= mode;
-}
-
-static void i915LineWidth( GLcontext *ctx, GLfloat widthf )
-{
- i915ContextPtr i915 = I915_CONTEXT( ctx );
- int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_LINE_WIDTH_MASK;
- int width;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- width = (int)(widthf * 2);
- CLAMP_SELF(width, 1, 0xf);
- lis4 |= width << S4_LINE_WIDTH_SHIFT;
-
- if (lis4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_LIS4] = lis4;
- }
-}
-
-static void i915PointSize(GLcontext *ctx, GLfloat size)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_POINT_WIDTH_MASK;
- GLint point_size = (int)size;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- CLAMP_SELF(point_size, 1, 255);
- lis4 |= point_size << S4_POINT_WIDTH_SHIFT;
-
- if (lis4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_LIS4] = lis4;
- }
-}
-
-
-/* =============================================================
- * Color masks
- */
-
-static void i915ColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- i915ContextPtr i915 = I915_CONTEXT( ctx );
- GLuint tmp = i915->state.Ctx[I915_CTXREG_LIS5] & ~S5_WRITEDISABLE_MASK;
-
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s r(%d) g(%d) b(%d) a(%d)\n", __FUNCTION__, r, g, b, a);
-
- if (!r) tmp |= S5_WRITEDISABLE_RED;
- if (!g) tmp |= S5_WRITEDISABLE_GREEN;
- if (!b) tmp |= S5_WRITEDISABLE_BLUE;
- if (!a) tmp |= S5_WRITEDISABLE_ALPHA;
-
- if (tmp != i915->state.Ctx[I915_CTXREG_LIS5]) {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- i915->state.Ctx[I915_CTXREG_LIS5] = tmp;
- }
-}
-
-static void update_specular( GLcontext *ctx )
-{
- /* A hack to trigger the rebuild of the fragment program.
- */
- INTEL_CONTEXT(ctx)->NewGLState |= _NEW_TEXTURE;
- I915_CONTEXT(ctx)->tex_program.translated = 0;
-}
-
-static void i915LightModelfv(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- if (INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) {
- update_specular( ctx );
- }
-}
-
-static void i915ShadeModel(GLcontext *ctx, GLenum mode)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
-
- if (mode == GL_SMOOTH) {
- i915->state.Ctx[I915_CTXREG_LIS4] &= ~(S4_FLATSHADE_ALPHA |
- S4_FLATSHADE_COLOR |
- S4_FLATSHADE_SPECULAR);
- } else {
- i915->state.Ctx[I915_CTXREG_LIS4] |= (S4_FLATSHADE_ALPHA |
- S4_FLATSHADE_COLOR |
- S4_FLATSHADE_SPECULAR);
- }
-}
-
-/* =============================================================
- * Fog
- */
-void i915_update_fog( GLcontext *ctx )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- GLenum mode;
- GLboolean enabled;
- GLboolean try_pixel_fog;
-
- if (ctx->FragmentProgram._Active) {
- /* Pull in static fog state from program */
-
- mode = ctx->FragmentProgram._Current->FogOption;
- enabled = (mode != GL_NONE);
- try_pixel_fog = 0;
- }
- else {
- enabled = ctx->Fog.Enabled;
- mode = ctx->Fog.Mode;
-
- try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT &&
- ctx->Hint.Fog == GL_NICEST &&
- 0); /* XXX - DISABLE -- Need ortho fallback */
- }
-
- if (!enabled) {
- i915->vertex_fog = I915_FOG_NONE;
- }
- else if (try_pixel_fog) {
-
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
- i915->vertex_fog = I915_FOG_PIXEL;
-
- switch (mode) {
- case GL_LINEAR:
- if (ctx->Fog.End <= ctx->Fog.Start) {
- /* XXX - this won't work with fragment programs. Need to
- * either fallback or append fog instructions to end of
- * program in the case of linear fog.
- */
- i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
- i915->vertex_fog = I915_FOG_VERTEX;
- }
- else {
- GLfloat c1 = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- GLfloat c2 = 1.0/(ctx->Fog.End-ctx->Fog.Start);
-
- i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
- i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
- i915->state.Fog[I915_FOGREG_MODE1] |=
- ((GLuint)(c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
-
- if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
- i915->state.Fog[I915_FOGREG_MODE2] = (GLuint)(c2 * FMC2_C2_ONE);
- }
- else {
- union { float f; int i; } fi;
- fi.f = c2;
- i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
- }
- }
- break;
- case GL_EXP:
- i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_EXP;
- break;
- case GL_EXP2:
- i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_EXP2;
- break;
- default:
- break;
- }
- }
- else /* if (i915->vertex_fog != I915_FOG_VERTEX) */ {
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
- i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
- i915->vertex_fog = I915_FOG_VERTEX;
- }
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
- if (enabled)
- i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
- else
- i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
- }
-
- if (enabled) {
- _tnl_allow_vertex_fog( ctx, (i915->vertex_fog == I915_FOG_VERTEX) );
- _tnl_allow_pixel_fog( ctx, (i915->vertex_fog != I915_FOG_VERTEX) );
- }
-}
-
-static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
-
- switch (pname) {
- case GL_FOG_COORDINATE_SOURCE_EXT:
- case GL_FOG_MODE:
- case GL_FOG_START:
- case GL_FOG_END:
- break;
-
- case GL_FOG_DENSITY:
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
-
- if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
- i915->state.Fog[I915_FOGREG_MODE3] = (GLuint)(ctx->Fog.Density *
- FMC3_D_ONE);
- }
- else {
- union { float f; int i; } fi;
- fi.f = ctx->Fog.Density;
- i915->state.Fog[I915_FOGREG_MODE3] = fi.i;
- }
- break;
-
- case GL_FOG_COLOR:
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_COLOR] =
- (_3DSTATE_FOG_COLOR_CMD |
- ((GLubyte)(ctx->Fog.Color[0]*255.0F) << 16) |
- ((GLubyte)(ctx->Fog.Color[1]*255.0F) << 8) |
- ((GLubyte)(ctx->Fog.Color[2]*255.0F) << 0));
- break;
-
- default:
- break;
- }
-}
-
-static void i915Hint(GLcontext *ctx, GLenum target, GLenum state)
-{
- switch (target) {
- case GL_FOG_HINT:
- break;
- default:
- break;
- }
-}
-
-/* =============================================================
- */
-
-static void i915Enable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
-
- switch(cap) {
- case GL_TEXTURE_2D:
- break;
-
- case GL_LIGHTING:
- case GL_COLOR_SUM:
- update_specular( ctx );
- break;
-
- case GL_ALPHA_TEST:
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (state)
- i915->state.Ctx[I915_CTXREG_LIS6] |= S6_ALPHA_TEST_ENABLE;
- else
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_ALPHA_TEST_ENABLE;
- break;
-
- case GL_BLEND:
- i915EvalLogicOpBlendState(ctx);
- break;
-
- case GL_COLOR_LOGIC_OP:
- i915EvalLogicOpBlendState(ctx);
-
- /* Logicop doesn't seem to work at 16bpp:
- */
- if (i915->intel.intelScreen->cpp == 2)
- FALLBACK( &i915->intel, I915_FALLBACK_LOGICOP, state );
- break;
-
- case GL_FRAGMENT_PROGRAM_ARB:
- break;
-
- case GL_DITHER:
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (state)
- i915->state.Ctx[I915_CTXREG_LIS5] |= S5_COLOR_DITHER_ENABLE;
- else
- i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_COLOR_DITHER_ENABLE;
- break;
-
- case GL_DEPTH_TEST:
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (state)
- i915->state.Ctx[I915_CTXREG_LIS6] |= S6_DEPTH_TEST_ENABLE;
- else
- i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_ENABLE;
-
- i915DepthMask( ctx, ctx->Depth.Mask );
- break;
-
- case GL_SCISSOR_TEST:
- I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
- if (state)
- i915->state.Buffer[I915_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD |
- ENABLE_SCISSOR_RECT);
- else
- i915->state.Buffer[I915_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
- break;
-
- case GL_LINE_SMOOTH:
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (state)
- i915->state.Ctx[I915_CTXREG_LIS4] |= S4_LINE_ANTIALIAS_ENABLE;
- else
- i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_LINE_ANTIALIAS_ENABLE;
- break;
-
- case GL_FOG:
- break;
-
- case GL_CULL_FACE:
- i915CullFaceFrontFace(ctx, 0);
- break;
-
- case GL_STENCIL_TEST:
- if (i915->intel.hw_stencil) {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (state)
- i915->state.Ctx[I915_CTXREG_LIS5] |= (S5_STENCIL_TEST_ENABLE |
- S5_STENCIL_WRITE_ENABLE);
- else
- i915->state.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_TEST_ENABLE |
- S5_STENCIL_WRITE_ENABLE);
- } else {
- FALLBACK( &i915->intel, I915_FALLBACK_STENCIL, state );
- }
- break;
-
- case GL_POLYGON_STIPPLE:
- /* The stipple command worked on my 855GM box, but not my 845G.
- * I'll do more testing later to find out exactly which hardware
- * supports it. Disabled for now.
- */
- if (i915->intel.hw_stipple &&
- i915->intel.reduced_primitive == GL_TRIANGLES)
- {
- I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE);
- if (state)
- i915->state.Stipple[I915_STPREG_ST1] |= ST1_ENABLE;
- else
- i915->state.Stipple[I915_STPREG_ST1] &= ~ST1_ENABLE;
- }
- break;
-
- default:
- ;
- }
-}
-
-
-static void i915_init_packets( i915ContextPtr i915 )
-{
- intelScreenPrivate *screen = i915->intel.intelScreen;
-
- /* Zero all state */
- memset(&i915->state, 0, sizeof(i915->state));
-
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- /* Probably don't want to upload all this stuff every time one
- * piece changes.
- */
- i915->state.Ctx[I915_CTXREG_LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 |
- I1_LOAD_S(2) |
- I1_LOAD_S(4) |
- I1_LOAD_S(5) |
- I1_LOAD_S(6) |
- (4));
- i915->state.Ctx[I915_CTXREG_LIS2] = 0;
- i915->state.Ctx[I915_CTXREG_LIS4] = 0;
- i915->state.Ctx[I915_CTXREG_LIS5] = 0;
-
- if (screen->cpp == 2)
- i915->state.Ctx[I915_CTXREG_LIS5] |= S5_COLOR_DITHER_ENABLE;
-
-
- i915->state.Ctx[I915_CTXREG_LIS6] = (S6_COLOR_WRITE_ENABLE |
- (2 << S6_TRISTRIP_PV_SHIFT));
-
- i915->state.Ctx[I915_CTXREG_STATE4] = (_3DSTATE_MODES_4_CMD |
- ENABLE_LOGIC_OP_FUNC |
- LOGIC_OP_FUNC(LOGICOP_COPY) |
- ENABLE_STENCIL_TEST_MASK |
- STENCIL_TEST_MASK(0xff) |
- ENABLE_STENCIL_WRITE_MASK |
- STENCIL_WRITE_MASK(0xff));
-
-
- i915->state.Ctx[I915_CTXREG_IAB] = (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD |
- IAB_MODIFY_ENABLE |
- IAB_MODIFY_FUNC |
- IAB_MODIFY_SRC_FACTOR |
- IAB_MODIFY_DST_FACTOR);
-
- i915->state.Ctx[I915_CTXREG_BLENDCOLOR0] = _3DSTATE_CONST_BLEND_COLOR_CMD;
- i915->state.Ctx[I915_CTXREG_BLENDCOLOR1] = 0;
-
- }
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE);
- i915->state.Stipple[I915_STPREG_ST0] = _3DSTATE_STIPPLE;
- }
-
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_MODE0] = _3DSTATE_FOG_MODE_CMD;
- i915->state.Fog[I915_FOGREG_MODE1] = (FMC1_FOGFUNC_MODIFY_ENABLE |
- FMC1_FOGFUNC_VERTEX |
- FMC1_FOGINDEX_MODIFY_ENABLE |
- FMC1_FOGINDEX_W |
- FMC1_C1_C2_MODIFY_ENABLE |
- FMC1_DENSITY_MODIFY_ENABLE);
- i915->state.Fog[I915_FOGREG_COLOR] = _3DSTATE_FOG_COLOR_CMD;
- }
-
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
- i915->state.Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
- i915->state.Buffer[I915_DESTREG_CBUFADDR1] =
- (BUF_3D_ID_COLOR_BACK |
- BUF_3D_PITCH(screen->frontPitch * screen->cpp) |
- BUF_3D_USE_FENCE);
-
-
- i915->state.Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
- i915->state.Buffer[I915_DESTREG_DBUFADDR1] =
- (BUF_3D_ID_DEPTH |
- BUF_3D_PITCH(screen->depthPitch * screen->cpp) |
- BUF_3D_USE_FENCE);
- i915->state.Buffer[I915_DESTREG_DBUFADDR2] = screen->depthOffset;
-
-
- i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
-
- switch (screen->fbFormat) {
- case DV_PF_555:
- case DV_PF_565:
- i915->state.Buffer[I915_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- LOD_PRECLAMP_OGL |
- TEX_DEFAULT_COLOR_OGL |
- DITHER_FULL_ALWAYS |
- screen->fbFormat |
- DEPTH_FRMT_16_FIXED);
- break;
- case DV_PF_8888:
- i915->state.Buffer[I915_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- LOD_PRECLAMP_OGL |
- TEX_DEFAULT_COLOR_OGL |
- screen->fbFormat |
- DEPTH_FRMT_24_FIXED_8_OTHER);
- break;
- }
- i915->state.Buffer[I915_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
- i915->state.Buffer[I915_DESTREG_SR0] = _3DSTATE_SCISSOR_RECT_0_CMD;
- i915->state.Buffer[I915_DESTREG_SR1] = 0;
- i915->state.Buffer[I915_DESTREG_SR2] = 0;
- }
-
-
- /* These will be emitted every at the head of every buffer, unless
- * we get hardware contexts working.
- */
- i915->state.active = (I915_UPLOAD_PROGRAM |
- I915_UPLOAD_STIPPLE |
- I915_UPLOAD_CTX |
- I915_UPLOAD_BUFFERS);
-}
-
-void i915InitStateFunctions( struct dd_function_table *functions )
-{
- functions->AlphaFunc = i915AlphaFunc;
- functions->BlendColor = i915BlendColor;
- functions->BlendEquationSeparate = i915BlendEquationSeparate;
- functions->BlendFuncSeparate = i915BlendFuncSeparate;
- functions->ColorMask = i915ColorMask;
- functions->CullFace = i915CullFaceFrontFace;
- functions->DepthFunc = i915DepthFunc;
- functions->DepthMask = i915DepthMask;
- functions->Enable = i915Enable;
- functions->Fogfv = i915Fogfv;
- functions->FrontFace = i915CullFaceFrontFace;
- functions->Hint = i915Hint;
- functions->LightModelfv = i915LightModelfv;
- functions->LineWidth = i915LineWidth;
- functions->LogicOpcode = i915LogicOp;
- functions->PointSize = i915PointSize;
- functions->PolygonStipple = i915PolygonStipple;
- functions->Scissor = i915Scissor;
- functions->ShadeModel = i915ShadeModel;
- functions->StencilFunc = i915StencilFunc;
- functions->StencilMask = i915StencilMask;
- functions->StencilOp = i915StencilOp;
-}
-
-
-void i915InitState( i915ContextPtr i915 )
-{
- GLcontext *ctx = &i915->intel.ctx;
-
- i915_init_packets( i915 );
-
- intelInitState( ctx );
-
- memcpy( &i915->initial, &i915->state, sizeof(i915->state) );
- i915->current = &i915->state;
-}
-
-
-
-
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_tex.c
deleted file mode 100644
index 4f77833e1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_tex.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "image.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "texmem.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-
-#include "intel_ioctl.h"
-
-#include "i915_context.h"
-#include "i915_reg.h"
-
-
-
-
-
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-intelTextureObjectPtr i915AllocTexObj( struct gl_texture_object *texObj )
-{
- i915TextureObjectPtr t = CALLOC_STRUCT( i915_texture_object );
- if ( !t )
- return NULL;
-
- texObj->DriverData = t;
- t->intel.base.tObj = texObj;
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
- make_empty_list( &t->intel.base );
- return &t->intel;
-}
-
-
-static void i915TexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- i915TextureObjectPtr t = (i915TextureObjectPtr) tObj->DriverData;
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_BORDER_COLOR:
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
- break;
-
- case GL_TEXTURE_COMPARE_MODE:
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* The i915 and its successors can do a lot of this without
- * reloading the textures. A project for someone?
- */
- intelFlush( ctx );
- driSwapOutTextureObject( (driTextureObject *) t );
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
- break;
-
- default:
- return;
- }
-}
-
-
-static void i915TexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- i915ContextPtr i915 = I915_CONTEXT( ctx );
- GLuint unit = ctx->Texture.CurrentUnit;
-
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR: /* Should be a tracked param */
- case GL_TEXTURE_ENV_MODE:
- case GL_COMBINE_RGB:
- case GL_COMBINE_ALPHA:
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_RGB_SCALE:
- case GL_ALPHA_SCALE:
- i915->tex_program.translated = 0;
- break;
-
- case GL_TEXTURE_LOD_BIAS: {
- int b = (int) ((*param) * 16.0);
- if (b > 255) b = 255;
- if (b < -256) b = -256;
- I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit));
- i915->state.Tex[unit][I915_TEXREG_SS2] &= ~SS2_LOD_BIAS_MASK;
- i915->state.Tex[unit][I915_TEXREG_SS2] |=
- ((b << SS2_LOD_BIAS_SHIFT) & SS2_LOD_BIAS_MASK);
- break;
- }
-
- default:
- break;
- }
-}
-
-
-static void i915BindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj )
-{
- i915TextureObjectPtr tex = (i915TextureObjectPtr)texObj->DriverData;
-
- if (tex->lastTarget != texObj->Target) {
- tex->intel.dirty = I915_UPLOAD_TEX_ALL;
- tex->lastTarget = texObj->Target;
- }
-
- /* Need this if image format changes between bound textures.
- * Could try and shortcircuit by checking for differences in
- * state between incoming and outgoing textures:
- */
- I915_CONTEXT(ctx)->tex_program.translated = 0;
-}
-
-
-
-void i915InitTextureFuncs( struct dd_function_table *functions )
-{
- functions->BindTexture = i915BindTexture;
- functions->TexEnv = i915TexEnv;
- functions->TexParameter = i915TexParameter;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c
deleted file mode 100644
index 3eaf53d7d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c
+++ /dev/null
@@ -1,668 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <strings.h>
-
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
-#include "tnl/t_context.h"
-#include "intel_batchbuffer.h"
-
-#include "i915_reg.h"
-#include "i915_context.h"
-#include "i915_program.h"
-
-static GLuint translate_tex_src_bit( struct i915_fragment_program *p,
- GLubyte bit )
-{
- switch (bit) {
- case TEXTURE_1D_BIT: return D0_SAMPLE_TYPE_2D;
- case TEXTURE_2D_BIT: return D0_SAMPLE_TYPE_2D;
- case TEXTURE_RECT_BIT: return D0_SAMPLE_TYPE_2D;
- case TEXTURE_3D_BIT: return D0_SAMPLE_TYPE_VOLUME;
- case TEXTURE_CUBE_BIT: return D0_SAMPLE_TYPE_CUBE;
- default: i915_program_error(p, "TexSrcBit"); return 0;
- }
-}
-
-static GLuint get_source( struct i915_fragment_program *p,
- GLenum src, GLuint unit )
-{
- switch (src) {
- case GL_TEXTURE:
- if (p->src_texture == UREG_BAD) {
-
- /* TODO: Use D0_CHANNEL_XY where possible.
- */
- GLuint dim = translate_tex_src_bit( p, p->ctx->Texture.Unit[unit]._ReallyEnabled);
- GLuint sampler = i915_emit_decl(p, REG_TYPE_S, unit, dim);
- GLuint texcoord = i915_emit_decl(p, REG_TYPE_T, unit, D0_CHANNEL_ALL);
- GLuint tmp = i915_get_temp( p );
- GLuint op = T0_TEXLD;
-
- if (p->VB->TexCoordPtr[unit]->size == 4)
- op = T0_TEXLDP;
-
- p->src_texture = i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL,
- sampler, texcoord, op );
- }
-
- return p->src_texture;
-
- /* Crossbar: */
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- case GL_TEXTURE4:
- case GL_TEXTURE5:
- case GL_TEXTURE6:
- case GL_TEXTURE7: {
- return UREG_BAD;
- }
-
- case GL_CONSTANT:
- return i915_emit_const4fv( p, p->ctx->Texture.Unit[unit].EnvColor );
- case GL_PRIMARY_COLOR:
- return i915_emit_decl(p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL);
- case GL_PREVIOUS:
- default:
- i915_emit_decl(p,
- GET_UREG_TYPE(p->src_previous),
- GET_UREG_NR(p->src_previous), D0_CHANNEL_ALL);
- return p->src_previous;
- }
-}
-
-
-static GLuint emit_combine_source( struct i915_fragment_program *p,
- GLuint mask,
- GLuint unit,
- GLenum source,
- GLenum operand )
-{
- GLuint arg, src;
-
- src = get_source(p, source, unit);
-
- switch (operand) {
- case GL_ONE_MINUS_SRC_COLOR:
- /* Get unused tmp,
- * Emit tmp = 1.0 + arg.-x-y-z-w
- */
- arg = i915_get_temp( p );
- return i915_emit_arith( p, A0_ADD, arg, mask, 0,
- swizzle(src, ONE, ONE, ONE, ONE ),
- negate(src, 1,1,1,1), 0);
-
- case GL_SRC_ALPHA:
- if (mask == A0_DEST_CHANNEL_W)
- return src;
- else
- return swizzle( src, W, W, W, W );
- case GL_ONE_MINUS_SRC_ALPHA:
- /* Get unused tmp,
- * Emit tmp = 1.0 + arg.-w-w-w-w
- */
- arg = i915_get_temp( p );
- return i915_emit_arith( p, A0_ADD, arg, mask, 0,
- swizzle(src, ONE, ONE, ONE, ONE ),
- negate( swizzle(src,W,W,W,W), 1,1,1,1), 0);
- case GL_SRC_COLOR:
- default:
- return src;
- }
-}
-
-
-
-static int nr_args( GLenum mode )
-{
- switch (mode) {
- case GL_REPLACE: return 1;
- case GL_MODULATE: return 2;
- case GL_ADD: return 2;
- case GL_ADD_SIGNED: return 2;
- case GL_INTERPOLATE: return 3;
- case GL_SUBTRACT: return 2;
- case GL_DOT3_RGB_EXT: return 2;
- case GL_DOT3_RGBA_EXT: return 2;
- case GL_DOT3_RGB: return 2;
- case GL_DOT3_RGBA: return 2;
- default: return 0;
- }
-}
-
-
-static GLboolean args_match( struct gl_texture_unit *texUnit )
-{
- int i, nr = nr_args(texUnit->Combine.ModeRGB);
-
- for (i = 0 ; i < nr ; i++) {
- if (texUnit->Combine.SourceA[i] != texUnit->Combine.SourceRGB[i])
- return GL_FALSE;
-
- switch(texUnit->Combine.OperandA[i]) {
- case GL_SRC_ALPHA:
- switch(texUnit->Combine.OperandRGB[i]) {
- case GL_SRC_COLOR:
- case GL_SRC_ALPHA:
- break;
- default:
- return GL_FALSE;
- }
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- switch(texUnit->Combine.OperandRGB[i]) {
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_ONE_MINUS_SRC_ALPHA:
- break;
- default:
- return GL_FALSE;
- }
- break;
- default:
- return GL_FALSE; /* impossible */
- }
- }
-
- return GL_TRUE;
-}
-
-
-static GLuint emit_combine( struct i915_fragment_program *p,
- GLuint dest,
- GLuint mask,
- GLuint saturate,
- GLuint unit,
- GLenum mode,
- const GLenum *source,
- const GLenum *operand)
-{
- int tmp, src[3], nr = nr_args(mode);
- int i;
-
- for (i = 0; i < nr; i++)
- src[i] = emit_combine_source( p, mask, unit, source[i], operand[i] );
-
- switch (mode) {
- case GL_REPLACE:
- if (mask == A0_DEST_CHANNEL_ALL && !saturate)
- return src[0];
- else
- return i915_emit_arith( p, A0_MOV, dest, mask, saturate, src[0], 0, 0 );
- case GL_MODULATE:
- return i915_emit_arith( p, A0_MUL, dest, mask, saturate,
- src[0], src[1], 0 );
- case GL_ADD:
- return i915_emit_arith( p, A0_ADD, dest, mask, saturate,
- src[0], src[1], 0 );
- case GL_ADD_SIGNED:
- /* tmp = arg0 + arg1
- * result = tmp + -.5
- */
- tmp = i915_emit_const1f(p, .5);
- tmp = negate(swizzle(tmp,X,X,X,X),1,1,1,1);
- i915_emit_arith( p, A0_ADD, dest, mask, 0, src[0], src[1], 0 );
- i915_emit_arith( p, A0_ADD, dest, mask, saturate, dest, tmp, 0 );
- return dest;
- case GL_INTERPOLATE: /* TWO INSTRUCTIONS */
- /* Arg0 * (Arg2) + Arg1 * (1-Arg2)
- *
- * Arg0*Arg2 + Arg1 - Arg1Arg2
- *
- * tmp = Arg0*Arg2 + Arg1,
- * result = (-Arg1)Arg2 + tmp
- */
- tmp = i915_get_temp( p );
- i915_emit_arith( p, A0_MAD, tmp, mask, 0, src[0], src[2], src[1] );
- i915_emit_arith( p, A0_MAD, dest, mask, saturate,
- negate(src[1], 1,1,1,1), src[2], tmp );
- return dest;
- case GL_SUBTRACT:
- /* negate src[1] */
- return i915_emit_arith( p, A0_ADD, dest, mask, saturate, src[0],
- negate(src[1],1,1,1,1), 0 );
-
- case GL_DOT3_RGBA:
- case GL_DOT3_RGBA_EXT:
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGB: {
- GLuint tmp0 = i915_get_temp( p );
- GLuint tmp1 = i915_get_temp( p );
- GLuint neg1 = negate(swizzle(i915_emit_const1f(p, 1),X,X,X,X), 1,1,1,1);
- GLuint two = swizzle(i915_emit_const1f(p, 2),X,X,X,X);
- i915_emit_arith( p, A0_MAD, tmp0, A0_DEST_CHANNEL_ALL, 0,
- two, src[0], neg1);
- if (src[0] == src[1])
- tmp1 = tmp0;
- else
- i915_emit_arith( p, A0_MAD, tmp1, A0_DEST_CHANNEL_ALL, 0,
- two, src[1], neg1);
- i915_emit_arith( p, A0_DP3, dest, mask, saturate, tmp0, tmp1, 0);
- return dest;
- }
-
- default:
- return src[0];
- }
-}
-
-static GLuint get_dest( struct i915_fragment_program *p, int unit )
-{
- if (p->ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- return i915_get_temp( p );
- else if (unit != p->last_tex_stage)
- return i915_get_temp( p );
- else
- return UREG(REG_TYPE_OC, 0);
-}
-
-
-
-static GLuint emit_texenv( struct i915_fragment_program *p, int unit )
-{
- struct gl_texture_unit *texUnit = &p->ctx->Texture.Unit[unit];
- GLenum envMode = texUnit->EnvMode;
- struct gl_texture_object *tObj = texUnit->_Current;
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
- GLuint saturate = unit < p->last_tex_stage ? A0_DEST_SATURATE : 0;
-
- switch(envMode) {
- case GL_BLEND: {
- const int cf = get_source(p, GL_PREVIOUS, unit);
- const int cc = get_source(p, GL_CONSTANT, unit);
- const int cs = get_source(p, GL_TEXTURE, unit);
- const int out = get_dest(p, unit);
-
- if (format == GL_INTENSITY) {
- /* cv = cf(1 - cs) + cc.cs
- * cv = cf - cf.cs + cc.cs
- */
- /* u[2] = MAD( -cf * cs + cf )
- * cv = MAD( cc * cs + u[2] )
- */
-
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, 0,
- negate(cf,1,1,1,1), cs, cf );
-
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, saturate,
- cc, cs, out );
-
- return out;
- } else {
- /* cv = cf(1 - cs) + cc.cs
- * cv = cf - cf.cs + cc.cs
- * av = af.as
- */
- /* u[2] = MAD( cf.-x-y-zw * cs.xyzw + cf.xyz0 )
- * oC = MAD( cc.xyz0 * cs.xyz0 + u[2].xyzw )
- */
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, 0,
- negate(cf,1,1,1,0),
- cs,
- swizzle(cf,X,Y,Z,ZERO) );
-
-
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, saturate,
- swizzle(cc,X,Y,Z,ZERO),
- swizzle(cs,X,Y,Z,ZERO),
- out );
-
- return out;
- }
- }
-
- case GL_DECAL: {
- if (format == GL_RGB ||
- format == GL_RGBA) {
- int cf = get_source( p, GL_PREVIOUS, unit );
- int cs = get_source( p, GL_TEXTURE, unit );
- int out = get_dest(p, unit);
-
- /* cv = cf(1-as) + cs.as
- * cv = cf.(-as) + cf + cs.as
- * av = af
- */
-
- /* u[2] = mad( cf.xyzw * cs.-w-w-w1 + cf.xyz0 )
- * oc = mad( cs.xyz0 * cs.www0 + u[2].xyzw )
- */
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, 0,
- cf,
- negate(swizzle(cs,W,W,W,ONE),1,1,1,0),
- swizzle(cf,X,Y,Z,ZERO) );
-
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, saturate,
- swizzle(cs,X,Y,Z,ZERO),
- swizzle(cs,W,W,W,ZERO),
- out );
- return out;
- }
- else {
- return get_source( p, GL_PREVIOUS, unit );
- }
- }
-
- case GL_REPLACE: {
- const int cs = get_source( p, GL_TEXTURE, unit ); /* saturated */
- switch (format) {
- case GL_ALPHA: {
- const int cf = get_source( p, GL_PREVIOUS, unit ); /* saturated */
- i915_emit_arith( p, A0_MOV, cs, A0_DEST_CHANNEL_XYZ, 0, cf, 0, 0 );
- return cs;
- }
- case GL_RGB:
- case GL_LUMINANCE: {
- const int cf = get_source( p, GL_PREVIOUS, unit ); /* saturated */
- i915_emit_arith( p, A0_MOV, cs, A0_DEST_CHANNEL_W, 0, cf, 0, 0 );
- return cs;
- }
- default:
- return cs;
- }
- }
-
- case GL_MODULATE: {
- const int cf = get_source( p, GL_PREVIOUS, unit );
- const int cs = get_source( p, GL_TEXTURE, unit );
- const int out = get_dest(p, unit);
- switch (format) {
- case GL_ALPHA:
- i915_emit_arith( p, A0_MUL, out, A0_DEST_CHANNEL_ALL, saturate,
- swizzle(cs, ONE, ONE, ONE, W), cf, 0 );
- break;
- default:
- i915_emit_arith( p, A0_MUL, out, A0_DEST_CHANNEL_ALL, saturate,
- cs, cf, 0 );
- break;
- }
- return out;
- }
- case GL_ADD: {
- int cf = get_source( p, GL_PREVIOUS, unit );
- int cs = get_source( p, GL_TEXTURE, unit );
- const int out = get_dest( p, unit );
-
- if (format == GL_INTENSITY) {
- /* output-color.rgba = add( incoming, u[1] )
- */
- i915_emit_arith( p, A0_ADD, out, A0_DEST_CHANNEL_ALL, saturate,
- cs, cf, 0 );
- return out;
- }
- else {
- /* cv.xyz = cf.xyz + cs.xyz
- * cv.w = cf.w * cs.w
- *
- * cv.xyzw = MAD( cf.111w * cs.xyzw + cf.xyz0 )
- */
- i915_emit_arith( p, A0_MAD, out, A0_DEST_CHANNEL_ALL, saturate,
- swizzle(cf,ONE,ONE,ONE,W),
- cs,
- swizzle(cf,X,Y,Z,ZERO) );
- return out;
- }
- break;
- }
- case GL_COMBINE: {
- GLuint rgb_shift, alpha_shift, out, shift;
- GLuint dest = get_dest(p, unit);
-
- /* The EXT version of the DOT3 extension does not support the
- * scale factor, but the ARB version (and the version in OpenGL
- * 1.3) does.
- */
- switch (texUnit->Combine.ModeRGB) {
- case GL_DOT3_RGB_EXT:
- alpha_shift = texUnit->Combine.ScaleShiftA;
- rgb_shift = 0;
- break;
-
- case GL_DOT3_RGBA_EXT:
- alpha_shift = 0;
- rgb_shift = 0;
- break;
-
- default:
- rgb_shift = texUnit->Combine.ScaleShiftRGB;
- alpha_shift = texUnit->Combine.ScaleShiftA;
- break;
- }
-
-
- /* Emit the RGB and A combine ops
- */
- if (texUnit->Combine.ModeRGB == texUnit->Combine.ModeA &&
- args_match( texUnit )) {
- out = emit_combine( p, dest, A0_DEST_CHANNEL_ALL, saturate,
- unit,
- texUnit->Combine.ModeRGB,
- texUnit->Combine.SourceRGB,
- texUnit->Combine.OperandRGB );
- }
- else if (texUnit->Combine.ModeRGB == GL_DOT3_RGBA_EXT ||
- texUnit->Combine.ModeRGB == GL_DOT3_RGBA) {
-
- out = emit_combine( p, dest, A0_DEST_CHANNEL_ALL, saturate,
- unit,
- texUnit->Combine.ModeRGB,
- texUnit->Combine.SourceRGB,
- texUnit->Combine.OperandRGB );
- }
- else {
- /* Need to do something to stop from re-emitting identical
- * argument calculations here:
- */
- out = emit_combine( p, dest, A0_DEST_CHANNEL_XYZ, saturate,
- unit,
- texUnit->Combine.ModeRGB,
- texUnit->Combine.SourceRGB,
- texUnit->Combine.OperandRGB );
- out = emit_combine( p, dest, A0_DEST_CHANNEL_W, saturate,
- unit,
- texUnit->Combine.ModeA,
- texUnit->Combine.SourceA,
- texUnit->Combine.OperandA );
- }
-
- /* Deal with the final shift:
- */
- if (alpha_shift || rgb_shift) {
- if (rgb_shift == alpha_shift) {
- shift = i915_emit_const1f(p, 1<<rgb_shift);
- shift = swizzle(shift,X,X,X,X);
- }
- else {
- shift = i915_emit_const2f(p, 1<<rgb_shift, 1<<alpha_shift);
- shift = swizzle(shift,X,X,X,Y);
- }
- return i915_emit_arith( p, A0_MUL, dest, A0_DEST_CHANNEL_ALL,
- saturate, out, shift, 0 );
- }
-
- return out;
- }
-
- default:
- return get_source(p, GL_PREVIOUS, 0);
- }
-}
-
-static void emit_program_fini( struct i915_fragment_program *p )
-{
- int cf = get_source( p, GL_PREVIOUS, 0 );
- int out = UREG( REG_TYPE_OC, 0 );
-
- if (p->ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- /* Emit specular add.
- */
- GLuint s = i915_emit_decl(p, REG_TYPE_T, T_SPECULAR, D0_CHANNEL_ALL);
- i915_emit_arith( p, A0_ADD, out, A0_DEST_CHANNEL_ALL, 0, cf,
- swizzle(s, X,Y,Z,ZERO), 0 );
- }
- else if (cf != out) {
- /* Will wind up in here if no texture enabled or a couple of
- * other scenarios (GL_REPLACE for instance).
- */
- i915_emit_arith( p, A0_MOV, out, A0_DEST_CHANNEL_ALL, 0, cf, 0, 0 );
- }
-}
-
-
-static void i915EmitTextureProgram( i915ContextPtr i915 )
-{
- GLcontext *ctx = &i915->intel.ctx;
- struct i915_fragment_program *p = &i915->tex_program;
- GLuint unit;
-
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- i915_init_program( i915, p );
-
- if (ctx->Texture._EnabledUnits) {
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- p->last_tex_stage = unit;
- }
-
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- p->src_previous = emit_texenv( p, unit );
- p->src_texture = UREG_BAD;
- p->temp_flag = 0xffff000;
- p->temp_flag |= 1 << GET_UREG_NR(p->src_previous);
- }
- }
-
- emit_program_fini( p );
-
- i915_fini_program( p );
- i915_upload_program( i915, p );
-
- p->translated = 1;
-}
-
-
-void i915ValidateTextureProgram( i915ContextPtr i915 )
-{
- intelContextPtr intel = &i915->intel;
- GLcontext *ctx = &intel->ctx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- int i, offset;
- GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
- GLuint s2 = S2_TEXCOORD_NONE;
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- intel->vertex_attr_count = 0;
- intel->coloroffset = 0;
- intel->specoffset = 0;
- offset = 0;
-
- if (i915->vertex_fog == I915_FOG_PIXEL) {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16 );
- index &= ~_TNL_BIT_FOG;
- }
- else if (index & _TNL_BITS_TEX_ANY) {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16 );
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12 );
- }
-
- /* How undefined is undefined? */
- if (index & _TNL_BIT_POINTSIZE) {
- EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, S4_VFMT_POINT_WIDTH, 4 );
- }
-
- intel->coloroffset = offset / 4;
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4 );
-
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
- if (index & _TNL_BIT_COLOR1) {
- intel->specoffset = offset / 4;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, S4_VFMT_SPEC_FOG, 3 );
- } else
- EMIT_PAD( 3 );
-
- if (index & _TNL_BIT_FOG)
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, S4_VFMT_SPEC_FOG, 1 );
- else
- EMIT_PAD( 1 );
- }
-
- if (index & _TNL_BITS_TEX_ANY) {
- for (i = 0; i < 8; i++) {
- if (index & _TNL_BIT_TEX(i)) {
- int sz = VB->TexCoordPtr[i]->size;
-
- s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK);
- s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz));
-
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_SZ(sz), 0, sz * 4 );
- }
- }
- }
-
- /* Only need to change the vertex emit code if there has been a
- * statechange to a new hardware vertex format:
- */
- if (s2 != i915->state.Ctx[I915_CTXREG_LIS2] ||
- s4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
-
- I915_STATECHANGE( i915, I915_UPLOAD_CTX );
-
- i915->tex_program.translated = 0;
-
- /* Must do this *after* statechange, so as not to affect
- * buffered vertices reliant on the old state:
- */
- intel->vertex_size = _tnl_install_attrs( ctx,
- intel->vertex_attrs,
- intel->vertex_attr_count,
- intel->ViewportMatrix.m, 0 );
-
- intel->vertex_size >>= 2;
-
- i915->state.Ctx[I915_CTXREG_LIS2] = s2;
- i915->state.Ctx[I915_CTXREG_LIS4] = s4;
-
- assert(intel->vtbl.check_vertex_size( intel, intel->vertex_size ));
- }
-
- if (!i915->tex_program.translated ||
- i915->last_ReallyEnabled != ctx->Texture._EnabledUnits) {
- i915EmitTextureProgram( i915 );
- i915->last_ReallyEnabled = ctx->Texture._EnabledUnits;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c
deleted file mode 100644
index 7a274bb69..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c
+++ /dev/null
@@ -1,922 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texformat.h"
-#include "texstore.h"
-
-#include "mm.h"
-
-#include "intel_screen.h"
-#include "intel_ioctl.h"
-#include "intel_tex.h"
-
-#include "i915_context.h"
-#include "i915_reg.h"
-
-static GLint initial_offsets[6][2] = { {0,0},
- {0,2},
- {1,0},
- {1,2},
- {1,1},
- {1,3} };
-
-
-static GLint step_offsets[6][2] = { {0,2},
- {0,2},
- {-1,2},
- {-1,2},
- {-1,1},
- {-1,1} };
-
-
-#define I915_TEX_UNIT_ENABLED(unit) (1<<unit)
-
-static void i915LayoutTextureImages( i915ContextPtr i915,
- struct gl_texture_object *tObj )
-{
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- i915TextureObjectPtr t = (i915TextureObjectPtr) tObj->DriverData;
- GLint firstLevel, lastLevel, numLevels;
- GLint i, total_height, pitch;
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- firstLevel = t->intel.base.firstLevel;
- lastLevel = t->intel.base.lastLevel;
- numLevels = lastLevel - firstLevel + 1;
-
-
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- switch (tObj->Target) {
- case GL_TEXTURE_CUBE_MAP: {
- const GLuint dim = tObj->Image[0][firstLevel]->Width;
- GLuint face;
-
- pitch = dim * t->intel.texelBytes;
- pitch *= 2; /* double pitch for cube layouts */
- pitch = (pitch + 3) & ~3;
-
- total_height = dim * 4;
-
- for ( face = 0 ; face < 6 ; face++) {
- GLuint x = initial_offsets[face][0] * dim;
- GLuint y = initial_offsets[face][1] * dim;
- GLuint d = dim;
-
- t->intel.base.dirty_images[face] = ~0;
-
- assert(tObj->Image[face][firstLevel]->Width == dim);
- assert(tObj->Image[face][firstLevel]->Height == dim);
-
- for (i = 0; i < numLevels; i++) {
- t->intel.image[face][i].image = tObj->Image[face][firstLevel + i];
- if (!t->intel.image[face][i].image) {
- fprintf(stderr, "no image %d %d\n", face, i);
- break; /* can't happen */
- }
-
- t->intel.image[face][i].offset =
- y * pitch + x * t->intel.texelBytes;
- t->intel.image[face][i].internalFormat = baseImage->Format;
-
- d >>= 1;
- x += step_offsets[face][0] * d;
- y += step_offsets[face][1] * d;
- }
- }
- break;
- }
- case GL_TEXTURE_3D: {
- GLuint virtual_height;
- GLuint tmp_numLevels = numLevels;
- pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
- pitch = (pitch + 3) & ~3;
- t->intel.base.dirty_images[0] = ~0;
-
- /* Calculate the size of a single slice. Hardware demands a
- * minimum of 8 mipmaps, some of which might ultimately not be
- * used:
- */
- if (tmp_numLevels < 9)
- tmp_numLevels = 9;
-
- virtual_height = tObj->Image[0][firstLevel]->Height;
-
- for ( total_height = i = 0 ; i < tmp_numLevels ; i++ ) {
- t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
- if (t->intel.image[0][i].image) {
- t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
- }
-
- total_height += MAX2(2, virtual_height);
- virtual_height >>= 1;
- }
-
- t->intel.depth_pitch = total_height * pitch;
-
- /* Multiply slice size by texture depth for total size. It's
- * remarkable how wasteful of memory all the i8x0 texture
- * layouts are.
- */
- total_height *= t->intel.image[0][0].image->Depth;
- break;
- }
- default:
- pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
- pitch = (pitch + 3) & ~3;
- t->intel.base.dirty_images[0] = ~0;
-
- for ( total_height = i = 0 ; i < numLevels ; i++ ) {
- t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
- if (!t->intel.image[0][i].image)
- break;
-
- t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
- if (t->intel.image[0][i].image->IsCompressed)
- {
- if (t->intel.image[0][i].image->Height > 4)
- total_height += t->intel.image[0][i].image->Height/4;
- else
- total_height += 1;
- }
- else
- total_height += MAX2(2, t->intel.image[0][i].image->Height);
- }
- break;
- }
-
- t->intel.Pitch = pitch;
- t->intel.base.totalSize = total_height*pitch;
- t->intel.max_level = numLevels-1;
-}
-
-
-static void i945LayoutTextureImages( i915ContextPtr i915,
- struct gl_texture_object *tObj )
-{
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- i915TextureObjectPtr t = (i915TextureObjectPtr) tObj->DriverData;
- GLint firstLevel, lastLevel, numLevels;
- GLint i, total_height, pitch, sz, max_offset = 0, offset;
-
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- firstLevel = t->intel.base.firstLevel;
- lastLevel = t->intel.base.lastLevel;
- numLevels = lastLevel - firstLevel + 1;
-
-
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- switch (tObj->Target) {
- case GL_TEXTURE_CUBE_MAP: {
- const GLuint dim = tObj->Image[0][firstLevel]->Width;
- GLuint face;
-
- /* Depending on the size of the largest images, pitch can be
- * determined either by the old-style packing of cubemap faces,
- * or the final row of 4x4, 2x2 and 1x1 faces below this.
- */
- if (dim > 32) {
- pitch = dim * t->intel.texelBytes;
- pitch *= 2; /* double pitch for cube layouts */
- pitch = (pitch + 3) & ~3;
- }
- else {
- pitch = 14 * 8 * t->intel.texelBytes; /* determined by row of
- * little maps at
- * bottom */
- }
-
- total_height = dim * 4 + 4;
-
- for ( face = 0 ; face < 6 ; face++) {
- GLuint x = initial_offsets[face][0] * dim;
- GLuint y = initial_offsets[face][1] * dim;
- GLuint d = dim;
-
- if (dim == 4 && face >= 4) {
- y = total_height - 4;
- x = (face - 4) * 8;
- }
- else if (dim < 4) {
- y = total_height - 4;
- x = face * 8;
- }
-
- t->intel.base.dirty_images[face] = ~0;
-
- assert(tObj->Image[face][firstLevel]->Width == dim);
- assert(tObj->Image[face][firstLevel]->Height == dim);
-
- for (i = 0; i < numLevels; i++) {
-
-
- t->intel.image[face][i].image = tObj->Image[face][firstLevel + i];
- assert(t->intel.image[face][i].image);
-
- t->intel.image[face][i].offset =
- y * pitch + x * t->intel.texelBytes;
- t->intel.image[face][i].internalFormat = baseImage->Format;
-
- d >>= 1;
-
- switch (d) {
- case 4:
- switch (face) {
- case FACE_POS_X:
- case FACE_NEG_X:
- x += step_offsets[face][0] * d;
- y += step_offsets[face][1] * d;
- break;
- case FACE_POS_Y:
- case FACE_NEG_Y:
- y += 12;
- x -= 8;
- break;
- case FACE_POS_Z:
- case FACE_NEG_Z:
- y = total_height - 4;
- x = (face - 4) * 8;
- break;
- }
-
- case 2:
- y = total_height - 4;
- x = 16 + face * 8;
- break;
-
- case 1:
- x += 48;
- break;
-
- default:
- x += step_offsets[face][0] * d;
- y += step_offsets[face][1] * d;
- break;
- }
- }
- }
- max_offset = total_height * pitch;
- break;
- }
- case GL_TEXTURE_3D: {
- GLuint depth_packing = 0, depth_pack_pitch;
- GLuint tmp_numLevels = numLevels;
- pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
- pitch = (pitch + 3) & ~3;
- depth_pack_pitch = pitch;
-
- t->intel.base.dirty_images[0] = ~0;
-
-
- for ( total_height = i = 0 ; i < tmp_numLevels ; i++ ) {
- t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
- if (!t->intel.image[0][i].image)
- break;
-
-
- t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
-
-
-
- total_height += MAX2(2, t->intel.image[0][i].image->Height) *
- MAX2((t->intel.image[0][i].image->Depth >> depth_packing), 1);
-
- /* When alignment dominates, can't increase depth packing?
- * Or does pitch grow??? What are the alignment constraints,
- * anyway?
- */
- if (depth_pack_pitch > 4) {
- depth_packing++;
- depth_pack_pitch <<= 2;
- }
- }
-
- max_offset = total_height * pitch;
- break;
- }
- default:
- pitch = tObj->Image[0][firstLevel]->Width * t->intel.texelBytes;
- pitch = (pitch + 3) & ~3;
- t->intel.base.dirty_images[0] = ~0;
- max_offset = 0;
-
- for ( offset = i = 0 ; i < numLevels ; i++ ) {
- t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
- if (!t->intel.image[0][i].image)
- break;
-
- t->intel.image[0][i].offset = offset;
- t->intel.image[0][i].internalFormat = baseImage->Format;
-
- if (t->intel.image[0][i].image->IsCompressed)
- sz = MAX2(1, t->intel.image[0][i].image->Height/4) * pitch;
- else
- sz = MAX2(2, t->intel.image[0][i].image->Height) * pitch;
-
- /* Because the images are packed better, the final offset
- * might not be the maximal one:
- */
- max_offset = MAX2(max_offset, offset + sz);
-
- /* LPT change: step right after second mipmap.
- */
- if (i == 1)
- offset += pitch / 2;
- else
- offset += sz;
-
- }
- break;
- }
-
- t->intel.Pitch = pitch;
- t->intel.base.totalSize = max_offset;
- t->intel.max_level = numLevels-1;
-}
-
-
-
-
-static void i915SetTexImages( i915ContextPtr i915,
- struct gl_texture_object *tObj )
-{
- GLuint textureFormat;
- i915TextureObjectPtr t = (i915TextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint ss2 = 0;
-
- switch( baseImage->TexFormat->MesaFormat ) {
- case MESA_FORMAT_L8:
- t->intel.texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_L8;
- break;
-
- case MESA_FORMAT_I8:
- t->intel.texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_I8;
- break;
-
- case MESA_FORMAT_A8:
- t->intel.texelBytes = 1;
- textureFormat = MAPSURF_8BIT | MT_8BIT_A8;
- break;
-
- case MESA_FORMAT_AL88:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_AY88;
- break;
-
- case MESA_FORMAT_RGB565:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_RGB565;
- break;
-
- case MESA_FORMAT_ARGB1555:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB1555;
- break;
-
- case MESA_FORMAT_ARGB4444:
- t->intel.texelBytes = 2;
- textureFormat = MAPSURF_16BIT | MT_16BIT_ARGB4444;
- break;
-
- case MESA_FORMAT_ARGB8888:
- t->intel.texelBytes = 4;
- textureFormat = MAPSURF_32BIT | MT_32BIT_ARGB8888;
- break;
-
- case MESA_FORMAT_YCBCR_REV:
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_NORMAL);
- ss2 |= SS2_COLORSPACE_CONVERSION;
- break;
-
- case MESA_FORMAT_YCBCR:
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_422 | MT_422_YCRCB_SWAPY);
- ss2 |= SS2_COLORSPACE_CONVERSION;
- break;
-
- case MESA_FORMAT_RGB_FXT1:
- case MESA_FORMAT_RGBA_FXT1:
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1);
- break;
-
- case MESA_FORMAT_DEPTH_COMPONENT16:
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_16BIT | MT_16BIT_L16);
- break;
-
- case MESA_FORMAT_RGBA_DXT1:
- case MESA_FORMAT_RGB_DXT1:
- /*
- * DXTn pitches are Width/4 * blocksize in bytes
- * for DXT1: blocksize=8 so Width/4*8 = Width * 2
- * for DXT3/5: blocksize=16 so Width/4*16 = Width * 4
- */
- t->intel.texelBytes = 2;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
- break;
-
- case MESA_FORMAT_RGBA_DXT3:
- t->intel.texelBytes = 4;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
- break;
-
- case MESA_FORMAT_RGBA_DXT5:
- t->intel.texelBytes = 4;
- textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
- break;
-
-#if 0
- case MESA_FORMAT_DEPTH_COMPONENT_X8Z24:
- t->intel.texelBytes = 4;
- textureFormat = (MAPSURF_32BIT | MT_32BIT_xL824);
- break;
-#endif
-
- default:
- fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__,
- baseImage->TexFormat->MesaFormat);
- abort();
- }
-
-
- if (i915->intel.intelScreen->deviceID == PCI_CHIP_I945_G)
- i945LayoutTextureImages( i915, tObj );
- else
- i915LayoutTextureImages( i915, tObj );
-
- t->Setup[I915_TEXREG_MS3] =
- (((tObj->Image[0][t->intel.base.firstLevel]->Height - 1) << MS3_HEIGHT_SHIFT) |
- ((tObj->Image[0][t->intel.base.firstLevel]->Width - 1) << MS3_WIDTH_SHIFT) |
- textureFormat |
- MS3_USE_FENCE_REGS);
-
- t->Setup[I915_TEXREG_MS4] =
- ((((t->intel.Pitch / 4) - 1) << MS4_PITCH_SHIFT) |
- MS4_CUBE_FACE_ENA_MASK |
- (((t->intel.max_level * 4)) << MS4_MAX_LOD_SHIFT) |
- ((tObj->Image[0][t->intel.base.firstLevel]->Depth - 1) << MS4_VOLUME_DEPTH_SHIFT));
-
- t->Setup[I915_TEXREG_SS2] &= ~(SS2_COLORSPACE_CONVERSION);
- t->Setup[I915_TEXREG_SS2] |= ss2;
-
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
-
-}
-
-
-/* The i915 (and related graphics cores) do not support GL_CLAMP. The
- * Intel drivers for "other operating systems" implement GL_CLAMP as
- * GL_CLAMP_TO_EDGE, so the same is done here.
- */
-static GLuint translate_wrap_mode( GLenum wrap )
-{
- switch( wrap ) {
- case GL_REPEAT: return TEXCOORDMODE_WRAP;
- case GL_CLAMP: return TEXCOORDMODE_CLAMP_EDGE; /* not quite correct */
- case GL_CLAMP_TO_EDGE: return TEXCOORDMODE_CLAMP_EDGE;
- case GL_CLAMP_TO_BORDER: return TEXCOORDMODE_CLAMP_BORDER;
- case GL_MIRRORED_REPEAT: return TEXCOORDMODE_MIRROR;
- default: return TEXCOORDMODE_WRAP;
- }
-}
-
-
-/**
- */
-static void i915ImportTexObjState( struct gl_texture_object *texObj )
-{
- i915TextureObjectPtr t = (i915TextureObjectPtr)texObj->DriverData;
- int minFilt = 0, mipFilt = 0, magFilt = 0, shadow = 0;
-
- if(INTEL_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch (texObj->MinFilter) {
- case GL_NEAREST:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_NONE;
- break;
- case GL_LINEAR:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_NONE;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- minFilt = FILTER_NEAREST;
- mipFilt = MIPFILTER_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- minFilt = FILTER_LINEAR;
- mipFilt = MIPFILTER_LINEAR;
- break;
- default:
- break;
- }
-
- if ( texObj->MaxAnisotropy > 1.0 ) {
- minFilt = FILTER_ANISOTROPIC;
- magFilt = FILTER_ANISOTROPIC;
- }
- else {
- switch (texObj->MagFilter) {
- case GL_NEAREST:
- magFilt = FILTER_NEAREST;
- break;
- case GL_LINEAR:
- magFilt = FILTER_LINEAR;
- break;
- default:
- break;
- }
- }
-
- if (texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB &&
- texObj->Target != GL_TEXTURE_3D) {
-
- shadow = SS2_SHADOW_ENABLE;
- shadow |= intel_translate_compare_func( texObj->CompareFunc );
-
- minFilt = FILTER_4X4_FLAT;
- magFilt = FILTER_4X4_FLAT;
- }
-
-
- t->Setup[I915_TEXREG_SS2] &= ~(SS2_MIN_FILTER_MASK |
- SS2_MIP_FILTER_MASK |
- SS2_MAG_FILTER_MASK |
- SS2_SHADOW_ENABLE |
- SS2_SHADOW_FUNC_MASK);
- t->Setup[I915_TEXREG_SS2] |= ((minFilt << SS2_MIN_FILTER_SHIFT) |
- (mipFilt << SS2_MIP_FILTER_SHIFT) |
- (magFilt << SS2_MAG_FILTER_SHIFT) |
- shadow);
-
- {
- GLuint ss3 = t->Setup[I915_TEXREG_SS3] & ~(SS3_TCX_ADDR_MODE_MASK |
- SS3_TCY_ADDR_MODE_MASK |
- SS3_TCZ_ADDR_MODE_MASK);
- GLenum ws = texObj->WrapS;
- GLenum wt = texObj->WrapT;
- GLenum wr = texObj->WrapR;
-
- t->refs_border_color = 0;
-
- if (texObj->Target == GL_TEXTURE_3D &&
- (texObj->MinFilter != GL_NEAREST ||
- texObj->MagFilter != GL_NEAREST)) {
-
- /* Try to mimic GL_CLAMP functionality a little better -
- * switch to CLAMP_TO_BORDER whenever a non-NEAREST filter is
- * in use. Only do this for 3D textures at the moment --
- * doing it universally would fix the conform texbc.c
- * failure, though.
- */
- if (ws == GL_CLAMP) ws = GL_CLAMP_TO_BORDER;
- if (wt == GL_CLAMP) wt = GL_CLAMP_TO_BORDER;
- if (wr == GL_CLAMP) wr = GL_CLAMP_TO_BORDER;
-
- /* 3D textures don't seem to respect the border color.
- * Fallback if there's ever a danger that they might refer to
- * it.
- */
- if (ws == GL_CLAMP_TO_BORDER) t->refs_border_color = 1;
- if (wt == GL_CLAMP_TO_BORDER) t->refs_border_color = 1;
- if (wr == GL_CLAMP_TO_BORDER) t->refs_border_color = 1;
- }
-
- ss3 |= translate_wrap_mode(ws) << SS3_TCX_ADDR_MODE_SHIFT;
- ss3 |= translate_wrap_mode(wt) << SS3_TCY_ADDR_MODE_SHIFT;
- ss3 |= translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT;
-
- if (ss3 != t->Setup[I915_TEXREG_SS3]) {
- t->intel.dirty = I915_UPLOAD_TEX_ALL;
- t->Setup[I915_TEXREG_SS3] = ss3;
- }
- }
-
- {
- const GLubyte *color = texObj->_BorderChan;
-
- t->Setup[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(color[0],color[1],
- color[2],color[3]);
- }
-}
-
-
-
-static void i915_import_tex_unit( i915ContextPtr i915,
- i915TextureObjectPtr t,
- GLuint unit )
-{
- GLuint state[I915_TEX_SETUP_SIZE];
-
- if(INTEL_DEBUG&DEBUG_TEXTURE)
- fprintf(stderr, "%s unit(%d)\n", __FUNCTION__, unit);
-
- if (i915->intel.CurrentTexObj[unit])
- i915->intel.CurrentTexObj[unit]->base.bound &= ~(1U << unit);
-
- i915->intel.CurrentTexObj[unit] = (intelTextureObjectPtr)t;
- t->intel.base.bound |= (1 << unit);
-
- if (t->intel.dirty & I915_UPLOAD_TEX(unit)) {
- i915ImportTexObjState( t->intel.base.tObj );
- t->intel.dirty &= ~I915_UPLOAD_TEX(unit);
- }
-
- state[I915_TEXREG_MS2] = t->intel.TextureOffset;
- state[I915_TEXREG_MS3] = t->Setup[I915_TEXREG_MS3];
- state[I915_TEXREG_MS4] = t->Setup[I915_TEXREG_MS4];
-
- state[I915_TEXREG_SS2] = (i915->state.Tex[unit][I915_TEXREG_SS2] &
- SS2_LOD_BIAS_MASK);
- state[I915_TEXREG_SS2] |= (t->Setup[I915_TEXREG_SS2] & ~SS2_LOD_BIAS_MASK);
-
- state[I915_TEXREG_SS3] = (i915->state.Tex[unit][I915_TEXREG_SS3] &
- SS3_NORMALIZED_COORDS);
- state[I915_TEXREG_SS3] |= (t->Setup[I915_TEXREG_SS3] &
- ~(SS3_NORMALIZED_COORDS|
- SS3_TEXTUREMAP_INDEX_MASK));
-
- state[I915_TEXREG_SS3] |= (unit<<SS3_TEXTUREMAP_INDEX_SHIFT);
-
- state[I915_TEXREG_SS4] = t->Setup[I915_TEXREG_SS4];
-
-
- if (memcmp(state, i915->state.Tex[unit], sizeof(state)) != 0) {
- I915_STATECHANGE( i915, I915_UPLOAD_TEX(unit) );
- memcpy(i915->state.Tex[unit], state, sizeof(state));
- }
-}
-
-
-
-static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i915TextureObjectPtr t = (i915TextureObjectPtr)tObj->DriverData;
-
- if (0) fprintf(stderr, "%s %d\n", __FUNCTION__, unit);
-
- if (!(i915->state.active & I915_UPLOAD_TEX(unit))) {
- I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE);
- }
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- return GL_FALSE;
- }
-
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if (i915->intel.CurrentTexObj[unit] != &t->intel ||
- (t->intel.dirty & I915_UPLOAD_TEX(unit))) {
- i915_import_tex_unit( i915, t, unit);
- i915->tex_program.translated = 0;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_rect( GLcontext *ctx, GLuint unit )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i915TextureObjectPtr t = (i915TextureObjectPtr)tObj->DriverData;
- GLuint ss3 = i915->state.Tex[unit][I915_TEXREG_SS3];
-
- ss3 &= ~SS3_NORMALIZED_COORDS;
-
- if (ss3 != i915->state.Tex[unit][I915_TEXREG_SS3]) {
- I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit));
- i915->state.Tex[unit][I915_TEXREG_SS3] = ss3;
- }
-
- /* Upload teximages (not pipelined)
- */
- if (t->intel.base.dirty_images[0]) {
- i915SetTexImages( i915, tObj );
- if (!intelUploadTexImages( &i915->intel, &t->intel, 0 )) {
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean enable_tex_2d( GLcontext *ctx, GLuint unit )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i915TextureObjectPtr t = (i915TextureObjectPtr)tObj->DriverData;
- GLuint ss3 = i915->state.Tex[unit][I915_TEXREG_SS3];
-
- ss3 |= SS3_NORMALIZED_COORDS;
-
- if (ss3 != i915->state.Tex[unit][I915_TEXREG_SS3]) {
- I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit));
- i915->state.Tex[unit][I915_TEXREG_SS3] = ss3;
- }
-
- /* Upload teximages (not pipelined)
- */
- if (t->intel.base.dirty_images[0]) {
- i915SetTexImages( i915, tObj );
- if (!intelUploadTexImages( &i915->intel, &t->intel, 0 )) {
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_cube( GLcontext *ctx, GLuint unit )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- i915TextureObjectPtr t = (i915TextureObjectPtr)tObj->DriverData;
- GLuint ss3 = i915->state.Tex[unit][I915_TEXREG_SS3];
- GLuint face;
-
- ss3 |= SS3_NORMALIZED_COORDS;
-
- if (ss3 != i915->state.Tex[unit][I915_TEXREG_SS3]) {
- I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit));
- i915->state.Tex[unit][I915_TEXREG_SS3] = ss3;
- }
-
- /* Upload teximages (not pipelined)
- */
- if ( t->intel.base.dirty_images[0] || t->intel.base.dirty_images[1] ||
- t->intel.base.dirty_images[2] || t->intel.base.dirty_images[3] ||
- t->intel.base.dirty_images[4] || t->intel.base.dirty_images[5] ) {
- i915SetTexImages( i915, tObj );
- }
-
- /* upload (per face) */
- for (face = 0; face < 6; face++) {
- if (t->intel.base.dirty_images[face]) {
- if (!intelUploadTexImages( &i915->intel, &t->intel, face )) {
- return GL_FALSE;
- }
- }
- }
-
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_3d( GLcontext *ctx, GLuint unit )
-{
- struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
- i915TextureObjectPtr t = (i915TextureObjectPtr)tObj->DriverData;
-
- /* 3D textures on I915 seem to get bogus border colors, hence this
- * fallback:
- */
- if (t->refs_border_color)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-
-
-static GLboolean disable_tex( GLcontext *ctx, GLuint unit )
-{
- i915ContextPtr i915 = I915_CONTEXT(ctx);
-
- if (i915->state.active & I915_UPLOAD_TEX(unit)) {
- I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_FALSE);
- }
-
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
- if ( i915->intel.CurrentTexObj[unit] != NULL ) {
- i915->intel.CurrentTexObj[unit]->base.bound &= ~(1U << 0);
- i915->intel.CurrentTexObj[unit] = NULL;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean i915UpdateTexUnit( GLcontext *ctx, GLuint unit )
-{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (texUnit->_ReallyEnabled &&
- INTEL_CONTEXT(ctx)->intelScreen->textureSize < 2048 * 1024)
- return GL_FALSE;
-
- switch (texUnit->_ReallyEnabled) {
- case TEXTURE_1D_BIT:
- case TEXTURE_2D_BIT:
- return (enable_tex_2d( ctx, unit ) &&
- enable_tex_common( ctx, unit ));
- case TEXTURE_RECT_BIT:
- return (enable_tex_rect( ctx, unit ) &&
- enable_tex_common( ctx, unit ));
- case TEXTURE_CUBE_BIT:
- return (enable_tex_cube( ctx, unit ) &&
- enable_tex_common( ctx, unit ));
- case TEXTURE_3D_BIT:
- return (enable_tex_2d( ctx, unit ) &&
- enable_tex_common( ctx, unit ) &&
- enable_tex_3d( ctx, unit));
- case 0:
- return disable_tex( ctx, unit );
- default:
- return GL_FALSE;
- }
-}
-
-
-void i915UpdateTextureState( intelContextPtr intel )
-{
- GLcontext *ctx = &intel->ctx;
- GLboolean ok = GL_TRUE;
- GLuint i;
-
- for (i = 0 ; i < I915_TEX_UNITS && ok ; i++) {
- ok = i915UpdateTexUnit( ctx, i );
- }
-
- FALLBACK( intel, I915_FALLBACK_TEXTURE, !ok );
-}
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c
deleted file mode 100644
index 795286601..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "tnl/t_context.h"
-#include "tnl/t_vertex.h"
-
-#include "intel_batchbuffer.h"
-
-#include "i915_reg.h"
-#include "i915_context.h"
-
-static void i915_render_start( intelContextPtr intel )
-{
- GLcontext *ctx = &intel->ctx;
- i915ContextPtr i915 = I915_CONTEXT(intel);
-
- if (ctx->FragmentProgram._Active)
- i915ValidateFragmentProgram( i915 );
- else
- i915ValidateTextureProgram( i915 );
-}
-
-
-static void i915_reduced_primitive_state( intelContextPtr intel,
- GLenum rprim )
-{
- i915ContextPtr i915 = I915_CONTEXT(intel);
- GLuint st1 = i915->state.Stipple[I915_STPREG_ST1];
-
- st1 &= ~ST1_ENABLE;
-
- switch (rprim) {
- case GL_TRIANGLES:
- if (intel->ctx.Polygon.StippleFlag &&
- intel->hw_stipple)
- st1 |= ST1_ENABLE;
- break;
- case GL_LINES:
- case GL_POINTS:
- default:
- break;
- }
-
- i915->intel.reduced_primitive = rprim;
-
- if (st1 != i915->state.Stipple[I915_STPREG_ST1]) {
- I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE);
- i915->state.Stipple[I915_STPREG_ST1] = st1;
- }
-}
-
-
-/* Pull apart the vertex format registers and figure out how large a
- * vertex is supposed to be.
- */
-static GLboolean i915_check_vertex_size( intelContextPtr intel,
- GLuint expected )
-{
- i915ContextPtr i915 = I915_CONTEXT(intel);
- int lis2 = i915->current->Ctx[I915_CTXREG_LIS2];
- int lis4 = i915->current->Ctx[I915_CTXREG_LIS4];
- int i, sz = 0;
-
- switch (lis4 & S4_VFMT_XYZW_MASK) {
- case S4_VFMT_XY: sz = 2; break;
- case S4_VFMT_XYZ: sz = 3; break;
- case S4_VFMT_XYW: sz = 3; break;
- case S4_VFMT_XYZW: sz = 4; break;
- default:
- fprintf(stderr, "no xyzw specified\n");
- return 0;
- }
-
- if (lis4 & S4_VFMT_SPEC_FOG) sz++;
- if (lis4 & S4_VFMT_COLOR) sz++;
- if (lis4 & S4_VFMT_DEPTH_OFFSET) sz++;
- if (lis4 & S4_VFMT_POINT_WIDTH) sz++;
- if (lis4 & S4_VFMT_FOG_PARAM) sz++;
-
- for (i = 0 ; i < 8 ; i++) {
- switch (lis2 & S2_TEXCOORD_FMT0_MASK) {
- case TEXCOORDFMT_2D: sz += 2; break;
- case TEXCOORDFMT_3D: sz += 3; break;
- case TEXCOORDFMT_4D: sz += 4; break;
- case TEXCOORDFMT_1D: sz += 1; break;
- case TEXCOORDFMT_2D_16: sz += 1; break;
- case TEXCOORDFMT_4D_16: sz += 2; break;
- case TEXCOORDFMT_NOT_PRESENT: break;
- default:
- fprintf(stderr, "bad texcoord fmt %d\n", i);
- return GL_FALSE;
- }
- lis2 >>= S2_TEXCOORD_FMT1_SHIFT;
- }
-
- if (sz != expected)
- fprintf(stderr, "vertex size mismatch %d/%d\n", sz, expected);
-
- return sz == expected;
-}
-
-
-static void i915_emit_invarient_state( intelContextPtr intel )
-{
- BATCH_LOCALS;
-
- BEGIN_BATCH( 200 );
-
- OUT_BATCH(_3DSTATE_AA_CMD |
- AA_LINE_ECAAR_WIDTH_ENABLE |
- AA_LINE_ECAAR_WIDTH_1_0 |
- AA_LINE_REGION_WIDTH_ENABLE |
- AA_LINE_REGION_WIDTH_1_0);
-
- OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_DFLT_Z_CMD);
- OUT_BATCH(0);
-
- /* Don't support texture crossbar yet */
- OUT_BATCH(_3DSTATE_COORD_SET_BINDINGS |
- CSB_TCB(0, 0) |
- CSB_TCB(1, 1) |
- CSB_TCB(2, 2) |
- CSB_TCB(3, 3) |
- CSB_TCB(4, 4) |
- CSB_TCB(5, 5) |
- CSB_TCB(6, 6) |
- CSB_TCB(7, 7));
-
- OUT_BATCH(_3DSTATE_RASTER_RULES_CMD |
- ENABLE_POINT_RASTER_RULE |
- OGL_POINT_RASTER_RULE |
- ENABLE_LINE_STRIP_PROVOKE_VRTX |
- ENABLE_TRI_FAN_PROVOKE_VRTX |
- LINE_STRIP_PROVOKE_VRTX(1) |
- TRI_FAN_PROVOKE_VRTX(2) |
- ENABLE_TEXKILL_3D_4D |
- TEXKILL_4D);
-
- /* Need to initialize this to zero.
- */
- OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 |
- I1_LOAD_S(3) |
- (1));
- OUT_BATCH(0);
-
- /* XXX: Use this */
- OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
-
- OUT_BATCH(_3DSTATE_SCISSOR_RECT_0_CMD);
- OUT_BATCH(0);
- OUT_BATCH(0);
-
- OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE);
-
- OUT_BATCH(_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */
- OUT_BATCH(0);
-
-
- /* Don't support twosided stencil yet */
- OUT_BATCH(_3DSTATE_BACKFACE_STENCIL_OPS |
- BFO_ENABLE_STENCIL_TWO_SIDE |
- 0 );
-
- ADVANCE_BATCH();
-}
-
-
-#define emit( intel, state, size ) \
-do { \
- int k; \
- BEGIN_BATCH( (size) / sizeof(GLuint)); \
- for (k = 0 ; k < (size) / sizeof(GLuint) ; k++) \
- OUT_BATCH((state)[k]); \
- ADVANCE_BATCH(); \
-} while (0);
-
-
-/* Push the state into the sarea and/or texture memory.
- */
-static void i915_emit_state( intelContextPtr intel )
-{
- i915ContextPtr i915 = I915_CONTEXT(intel);
- struct i915_hw_state *state = i915->current;
- int i;
- GLuint dirty;
- BATCH_LOCALS;
-
- /* More to workaround the multitex hang - if one texture unit state
- * is modified, emit all texture units.
- */
- dirty = state->active & ~state->emitted;
- if (dirty & I915_UPLOAD_TEX_ALL)
- state->emitted &= ~I915_UPLOAD_TEX_ALL;
- dirty = state->active & ~state->emitted;
-
-
- if (VERBOSE)
- fprintf(stderr, "%s dirty: %x\n", __FUNCTION__, dirty);
-
- if (dirty & I915_UPLOAD_CTX) {
- if (VERBOSE) fprintf(stderr, "I915_UPLOAD_CTX:\n");
- emit( i915, state->Ctx, sizeof(state->Ctx) );
- }
-
- if (dirty & I915_UPLOAD_BUFFERS) {
- if (VERBOSE) fprintf(stderr, "I915_UPLOAD_BUFFERS:\n");
- emit( i915, state->Buffer, sizeof(state->Buffer) );
- }
-
- if (dirty & I915_UPLOAD_STIPPLE) {
- if (VERBOSE) fprintf(stderr, "I915_UPLOAD_STIPPLE:\n");
- emit( i915, state->Stipple, sizeof(state->Stipple) );
- }
-
- if (dirty & I915_UPLOAD_FOG) {
- if (VERBOSE) fprintf(stderr, "I915_UPLOAD_FOG:\n");
- emit( i915, state->Fog, sizeof(state->Fog) );
- }
-
- /* Combine all the dirty texture state into a single command to
- * avoid lockups on I915 hardware.
- */
- if (dirty & I915_UPLOAD_TEX_ALL) {
- int nr = 0;
-
- for (i = 0; i < I915_TEX_UNITS; i++)
- if (dirty & I915_UPLOAD_TEX(i))
- nr++;
-
- BEGIN_BATCH(2+nr*3);
- OUT_BATCH(_3DSTATE_MAP_STATE | (3*nr));
- OUT_BATCH((dirty & I915_UPLOAD_TEX_ALL) >> I915_UPLOAD_TEX_0_SHIFT);
- for (i = 0 ; i < I915_TEX_UNITS ; i++)
- if (dirty & I915_UPLOAD_TEX(i)) {
- OUT_BATCH(state->Tex[i][I915_TEXREG_MS2]);
- OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]);
- OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]);
- }
- ADVANCE_BATCH();
-
- BEGIN_BATCH(2+nr*3);
- OUT_BATCH(_3DSTATE_SAMPLER_STATE | (3*nr));
- OUT_BATCH((dirty & I915_UPLOAD_TEX_ALL) >> I915_UPLOAD_TEX_0_SHIFT);
- for (i = 0 ; i < I915_TEX_UNITS ; i++)
- if (dirty & I915_UPLOAD_TEX(i)) {
- OUT_BATCH(state->Tex[i][I915_TEXREG_SS2]);
- OUT_BATCH(state->Tex[i][I915_TEXREG_SS3]);
- OUT_BATCH(state->Tex[i][I915_TEXREG_SS4]);
- }
- ADVANCE_BATCH();
- }
-
- if (dirty & I915_UPLOAD_CONSTANTS) {
- if (VERBOSE) fprintf(stderr, "I915_UPLOAD_CONSTANTS:\n");
- emit( i915, state->Constant, state->ConstantSize * sizeof(GLuint) );
- }
-
- if (dirty & I915_UPLOAD_PROGRAM) {
- if (VERBOSE) fprintf(stderr, "I915_UPLOAD_PROGRAM:\n");
-
- assert((state->Program[0] & 0x1ff)+2 == state->ProgramSize);
-
- emit( i915, state->Program, state->ProgramSize * sizeof(GLuint) );
- if (VERBOSE)
- i915_disassemble_program( state->Program, state->ProgramSize );
- }
-
- state->emitted |= dirty;
-}
-
-static void i915_destroy_context( intelContextPtr intel )
-{
- _tnl_free_vertices(&intel->ctx);
-}
-
-static void i915_set_draw_offset( intelContextPtr intel, int offset )
-{
- i915ContextPtr i915 = I915_CONTEXT(intel);
- I915_STATECHANGE( i915, I915_UPLOAD_BUFFERS );
- i915->state.Buffer[I915_DESTREG_CBUFADDR2] = offset;
-}
-
-static void i915_lost_hardware( intelContextPtr intel )
-{
- I915_CONTEXT(intel)->state.emitted = 0;
-}
-
-static void i915_emit_flush( intelContextPtr intel )
-{
- BATCH_LOCALS;
-
- BEGIN_BATCH(2);
- OUT_BATCH( MI_FLUSH | FLUSH_MAP_CACHE | FLUSH_RENDER_CACHE );
- OUT_BATCH( 0 );
- ADVANCE_BATCH();
-}
-
-
-void i915InitVtbl( i915ContextPtr i915 )
-{
- i915->intel.vtbl.alloc_tex_obj = i915AllocTexObj;
- i915->intel.vtbl.check_vertex_size = i915_check_vertex_size;
- i915->intel.vtbl.clear_with_tris = i915ClearWithTris;
- i915->intel.vtbl.destroy = i915_destroy_context;
- i915->intel.vtbl.emit_invarient_state = i915_emit_invarient_state;
- i915->intel.vtbl.emit_state = i915_emit_state;
- i915->intel.vtbl.lost_hardware = i915_lost_hardware;
- i915->intel.vtbl.reduced_primitive_state = i915_reduced_primitive_state;
- i915->intel.vtbl.render_start = i915_render_start;
- i915->intel.vtbl.set_draw_offset = i915_set_draw_offset;
- i915->intel.vtbl.update_texture_state = i915UpdateTextureState;
- i915->intel.vtbl.emit_flush = i915_emit_flush;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.c
deleted file mode 100644
index 7c9ad87be..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include <stdio.h>
-#include <errno.h>
-
-#include "mtypes.h"
-#include "context.h"
-#include "enums.h"
-
-#include "intel_reg.h"
-#include "intel_batchbuffer.h"
-#include "intel_context.h"
-
-
-
-
-/* ================================================================
- * Performance monitoring functions
- */
-
-static void intel_fill_box( intelContextPtr intel,
- GLshort x, GLshort y,
- GLshort w, GLshort h,
- GLubyte r, GLubyte g, GLubyte b )
-{
- intelEmitFillBlitLocked( intel,
- intel->intelScreen->cpp,
- intel->intelScreen->backPitch,
- intel->intelScreen->frontOffset,
- x, y, w, h,
- INTEL_PACKCOLOR(intel->intelScreen->fbFormat,
- r,g,b,0xff));
-}
-
-static void intel_draw_performance_boxes( intelContextPtr intel )
-{
- /* Purple box for page flipping
- */
- if ( intel->perf_boxes & I830_BOX_FLIP )
- intel_fill_box( intel, 4, 4, 8, 8, 255, 0, 255 );
-
- /* Red box if we have to wait for idle at any point
- */
- if ( intel->perf_boxes & I830_BOX_WAIT )
- intel_fill_box( intel, 16, 4, 8, 8, 255, 0, 0 );
-
- /* Blue box: lost context?
- */
- if ( intel->perf_boxes & I830_BOX_LOST_CONTEXT )
- intel_fill_box( intel, 28, 4, 8, 8, 0, 0, 255 );
-
- /* Yellow box for texture swaps
- */
- if ( intel->perf_boxes & I830_BOX_TEXTURE_LOAD )
- intel_fill_box( intel, 40, 4, 8, 8, 255, 255, 0 );
-
- /* Green box if hardware never idles (as far as we can tell)
- */
- if ( !(intel->perf_boxes & I830_BOX_RING_EMPTY) )
- intel_fill_box( intel, 64, 4, 8, 8, 0, 255, 0 );
-
-
- /* Draw bars indicating number of buffers allocated
- * (not a great measure, easily confused)
- */
-#if 0
- if (intel->dma_used) {
- int bar = intel->dma_used / 10240;
- if (bar > 100) bar = 100;
- if (bar < 1) bar = 1;
- intel_fill_box( intel, 4, 16, bar, 4, 196, 128, 128 );
- intel->dma_used = 0;
- }
-#endif
-
- intel->perf_boxes = 0;
-}
-
-
-
-
-
-
-static int bad_prim_vertex_nr( int primitive, int nr )
-{
- switch (primitive & PRIM3D_MASK) {
- case PRIM3D_POINTLIST:
- return nr < 1;
- case PRIM3D_LINELIST:
- return (nr & 1) || nr == 0;
- case PRIM3D_LINESTRIP:
- return nr < 2;
- case PRIM3D_TRILIST:
- case PRIM3D_RECTLIST:
- return nr % 3 || nr == 0;
- case PRIM3D_POLY:
- case PRIM3D_TRIFAN:
- case PRIM3D_TRISTRIP:
- case PRIM3D_TRISTRIP_RVRSE:
- return nr < 3;
- default:
- return 1;
- }
-}
-
-static void intel_flush_inline_primitive( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- GLuint used = intel->batch.ptr - intel->prim.start_ptr;
- GLuint vertcount;
-
- assert(intel->prim.primitive != ~0);
-
- if (1) {
- /* Check vertex size against the vertex we're specifying to
- * hardware. If it's wrong, ditch the primitive.
- */
- if (!intel->vtbl.check_vertex_size( intel, intel->vertex_size ))
- goto do_discard;
-
- vertcount = (used - 4)/ (intel->vertex_size * 4);
-
- if (!vertcount)
- goto do_discard;
-
- if (vertcount * intel->vertex_size * 4 != used - 4) {
- fprintf(stderr, "vertex size confusion %d %d\n", used,
- intel->vertex_size * vertcount * 4);
- goto do_discard;
- }
-
- if (bad_prim_vertex_nr( intel->prim.primitive, vertcount )) {
- fprintf(stderr, "bad_prim_vertex_nr %x %d\n", intel->prim.primitive,
- vertcount);
- goto do_discard;
- }
- }
-
- if (used < 8)
- goto do_discard;
-
- *(int *)intel->prim.start_ptr = (_3DPRIMITIVE |
- intel->prim.primitive |
- (used/4-2));
-
- goto finished;
-
- do_discard:
- intel->batch.ptr -= used;
- intel->batch.space += used;
- assert(intel->batch.space >= 0);
-
- finished:
- intel->prim.primitive = ~0;
- intel->prim.start_ptr = 0;
- intel->prim.flush = 0;
-}
-
-
-/* Emit a primitive referencing vertices in a vertex buffer.
- */
-void intelStartInlinePrimitive( intelContextPtr intel, GLuint prim )
-{
- BATCH_LOCALS;
-
- if (0)
- fprintf(stderr, "%s %x\n", __FUNCTION__, prim);
-
-
- /* Finish any in-progress primitive:
- */
- INTEL_FIREVERTICES( intel );
-
- /* Emit outstanding state:
- */
- intel->vtbl.emit_state( intel );
-
- /* Make sure there is some space in this buffer:
- */
- if (intel->vertex_size * 10 * sizeof(GLuint) >= intel->batch.space)
- intelFlushBatch(intel, GL_TRUE);
-
-
-#if 1
- if (((int)intel->batch.ptr) & 0x4) {
- BEGIN_BATCH(1);
- OUT_BATCH(0);
- ADVANCE_BATCH();
- }
-#endif
-
- /* Emit a slot which will be filled with the inline primitive
- * command later.
- */
- BEGIN_BATCH(2);
- OUT_BATCH( 0 );
-
- intel->prim.start_ptr = batch_ptr;
- intel->prim.primitive = prim;
- intel->prim.flush = intel_flush_inline_primitive;
-
- OUT_BATCH( 0 );
- ADVANCE_BATCH();
-}
-
-
-void intelRestartInlinePrimitive( intelContextPtr intel )
-{
- GLuint prim = intel->prim.primitive;
-
- intel_flush_inline_primitive( &intel->ctx );
- if (1) intelFlushBatch(intel, GL_TRUE); /* GL_TRUE - is critical */
- intelStartInlinePrimitive( intel, prim );
-}
-
-
-
-void intelWrapInlinePrimitive( intelContextPtr intel )
-{
- GLuint prim = intel->prim.primitive;
-
- if (0)
- fprintf(stderr, "%s\n", __FUNCTION__);
- intel_flush_inline_primitive( &intel->ctx );
- intelFlushBatch(intel, GL_TRUE);
- intelStartInlinePrimitive( intel, prim );
-}
-
-
-/* Emit a primitive with space for inline vertices.
- */
-GLuint *intelEmitInlinePrimitiveLocked(intelContextPtr intel,
- int primitive,
- int dwords,
- int vertex_size )
-{
- GLuint *tmp = 0;
- BATCH_LOCALS;
-
- if (0)
- fprintf(stderr, "%s 0x%x %d\n", __FUNCTION__, primitive, dwords);
-
- /* Emit outstanding state:
- */
- intel->vtbl.emit_state( intel );
-
-
- if (1) {
- int used = dwords * 4;
- int vertcount;
-
- /* Check vertex size against the vertex we're specifying to
- * hardware. If it's wrong, ditch the primitive.
- */
- if (!intel->vtbl.check_vertex_size( intel, vertex_size ))
- goto do_discard;
-
- vertcount = dwords / vertex_size;
-
- if (dwords % vertex_size) {
- fprintf(stderr, "did not request a whole number of vertices\n");
- goto do_discard;
- }
-
- if (bad_prim_vertex_nr( primitive, vertcount )) {
- fprintf(stderr, "bad_prim_vertex_nr %x %d\n", primitive, vertcount);
- goto do_discard;
- }
-
- if (used < 8)
- goto do_discard;
- }
-
- /* Emit 3D_PRIMITIVE commands:
- */
- BEGIN_BATCH(1 + dwords);
- OUT_BATCH( _3DPRIMITIVE |
- primitive |
- (dwords-1) );
-
- tmp = (GLuint *)batch_ptr;
- batch_ptr += dwords * 4;
-
- ADVANCE_BATCH();
-
- do_discard:
- return tmp;
-}
-
-
-
-/*
- * Copy the back buffer to the front buffer.
- */
-void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- intelContextPtr intel;
-
- if (0)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- intel = (intelContextPtr) dPriv->driContextPriv->driverPrivate;
-
- intelFlush( &intel->ctx );
- LOCK_HARDWARE( intel );
- {
- intelScreenPrivate *intelScreen = intel->intelScreen;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- int nbox = dPriv->numClipRects;
- drm_clip_rect_t *pbox = dPriv->pClipRects;
- int pitch = intelScreen->frontPitch;
- int cpp = intelScreen->cpp;
- int i;
- GLuint CMD, BR13;
- BATCH_LOCALS;
-
- switch(cpp) {
- case 2:
- BR13 = (pitch * cpp) | (0xCC << 16) | (1<<24);
- CMD = XY_SRC_COPY_BLT_CMD;
- break;
- case 4:
- BR13 = (pitch * cpp) | (0xCC << 16) | (1<<24) | (1<<25);
- CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
- XY_SRC_COPY_BLT_WRITE_RGB);
- break;
- default:
- BR13 = (pitch * cpp) | (0xCC << 16) | (1<<24);
- CMD = XY_SRC_COPY_BLT_CMD;
- break;
- }
-
- if (0)
- intel_draw_performance_boxes( intel );
-
- for (i = 0 ; i < nbox; i++, pbox++)
- {
- if (pbox->x1 > pbox->x2 ||
- pbox->y1 > pbox->y2 ||
- pbox->x2 > intelScreen->width ||
- pbox->y2 > intelScreen->height)
- continue;
-
- BEGIN_BATCH( 8);
- OUT_BATCH( CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (pbox->y1 << 16) | pbox->x1 );
- OUT_BATCH( (pbox->y2 << 16) | pbox->x2 );
-
- if (intel->sarea->pf_current_page == 0)
- OUT_BATCH( intelScreen->frontOffset );
- else
- OUT_BATCH( intelScreen->backOffset );
-
- OUT_BATCH( (pbox->y1 << 16) | pbox->x1 );
- OUT_BATCH( BR13 & 0xffff );
-
- if (intel->sarea->pf_current_page == 0)
- OUT_BATCH( intelScreen->backOffset );
- else
- OUT_BATCH( intelScreen->frontOffset );
-
- ADVANCE_BATCH();
- }
- }
- intelFlushBatchLocked( intel, GL_TRUE, GL_TRUE, GL_TRUE );
- UNLOCK_HARDWARE( intel );
-}
-
-
-
-
-void intelEmitFillBlitLocked( intelContextPtr intel,
- GLuint cpp,
- GLshort dst_pitch,
- GLuint dst_offset,
- GLshort x, GLshort y,
- GLshort w, GLshort h,
- GLuint color )
-{
- GLuint BR13, CMD;
- BATCH_LOCALS;
-
- dst_pitch *= cpp;
-
- switch(cpp) {
- case 1:
- case 2:
- case 3:
- BR13 = dst_pitch | (0xF0 << 16) | (1<<24);
- CMD = XY_COLOR_BLT_CMD;
- break;
- case 4:
- BR13 = dst_pitch | (0xF0 << 16) | (1<<24) | (1<<25);
- CMD = (XY_COLOR_BLT_CMD | XY_COLOR_BLT_WRITE_ALPHA |
- XY_COLOR_BLT_WRITE_RGB);
- break;
- default:
- return;
- }
-
- BEGIN_BATCH( 6);
- OUT_BATCH( CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (y << 16) | x );
- OUT_BATCH( ((y+h) << 16) | (x+w) );
- OUT_BATCH( dst_offset );
- OUT_BATCH( color );
- ADVANCE_BATCH();
-}
-
-
-/* Copy BitBlt
- */
-void intelEmitCopyBlitLocked( intelContextPtr intel,
- GLuint cpp,
- GLshort src_pitch,
- GLuint src_offset,
- GLshort dst_pitch,
- GLuint dst_offset,
- GLshort src_x, GLshort src_y,
- GLshort dst_x, GLshort dst_y,
- GLshort w, GLshort h )
-{
- GLuint CMD, BR13;
- int dst_y2 = dst_y + h;
- int dst_x2 = dst_x + w;
- BATCH_LOCALS;
-
- src_pitch *= cpp;
- dst_pitch *= cpp;
-
- switch(cpp) {
- case 1:
- case 2:
- case 3:
- BR13 = dst_pitch | (0xCC << 16) | (1<<24);
- CMD = XY_SRC_COPY_BLT_CMD;
- break;
- case 4:
- BR13 = dst_pitch | (0xCC << 16) | (1<<24) | (1<<25);
- CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
- XY_SRC_COPY_BLT_WRITE_RGB);
- break;
- default:
- return;
- }
-
- if (dst_y2 < dst_y ||
- dst_x2 < dst_x) {
- return;
- }
-
- BEGIN_BATCH( 12);
- OUT_BATCH( CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (dst_y << 16) | dst_x );
- OUT_BATCH( (dst_y2 << 16) | dst_x2 );
- OUT_BATCH( dst_offset );
- OUT_BATCH( (src_y << 16) | src_x );
- OUT_BATCH( src_pitch );
- OUT_BATCH( src_offset );
- ADVANCE_BATCH();
-}
-
-
-
-void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch)
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- intelScreenPrivate *intelScreen = intel->intelScreen;
- GLuint clear_depth, clear_color;
- GLint cx, cy;
- GLint pitch = intelScreen->frontPitch;
- GLint cpp = intelScreen->cpp;
- GLint i;
- GLuint BR13, CMD, D_CMD;
- BATCH_LOCALS;
-
-
- clear_color = intel->ClearColor;
- clear_depth = 0;
-
- if (flags & BUFFER_BIT_DEPTH) {
- clear_depth = (GLuint)(ctx->Depth.Clear * intel->ClearDepth);
- }
-
- if (flags & BUFFER_BIT_STENCIL) {
- clear_depth |= (ctx->Stencil.Clear & 0xff) << 24;
- }
-
- switch(cpp) {
- case 2:
- BR13 = (0xF0 << 16) | (pitch * cpp) | (1<<24);
- D_CMD = CMD = XY_COLOR_BLT_CMD;
- break;
- case 4:
- BR13 = (0xF0 << 16) | (pitch * cpp) | (1<<24) | (1<<25);
- CMD = (XY_COLOR_BLT_CMD |
- XY_COLOR_BLT_WRITE_ALPHA |
- XY_COLOR_BLT_WRITE_RGB);
- D_CMD = XY_COLOR_BLT_CMD;
- if (flags & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB;
- if (flags & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA;
- break;
- default:
- BR13 = (0xF0 << 16) | (pitch * cpp) | (1<<24);
- D_CMD = CMD = XY_COLOR_BLT_CMD;
- break;
- }
-
- intelFlush( &intel->ctx );
- LOCK_HARDWARE( intel );
- {
- /* flip top to bottom */
- cy = intel->driDrawable->h-cy1-ch;
- cx = cx1 + intel->drawX;
- cy += intel->drawY;
-
- /* adjust for page flipping */
- if ( intel->sarea->pf_current_page == 1 ) {
- GLuint tmp = flags;
-
- flags &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
- if ( tmp & BUFFER_BIT_FRONT_LEFT ) flags |= BUFFER_BIT_BACK_LEFT;
- if ( tmp & BUFFER_BIT_BACK_LEFT ) flags |= BUFFER_BIT_FRONT_LEFT;
- }
-
- for (i = 0 ; i < intel->numClipRects ; i++)
- {
- drm_clip_rect_t *box = &intel->pClipRects[i];
- drm_clip_rect_t b;
-
- if (!all) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if (x < cx) w -= cx - x, x = cx;
- if (y < cy) h -= cy - y, y = cy;
- if (x + w > cx + cw) w = cx + cw - x;
- if (y + h > cy + ch) h = cy + ch - y;
- if (w <= 0) continue;
- if (h <= 0) continue;
-
- b.x1 = x;
- b.y1 = y;
- b.x2 = x + w;
- b.y2 = y + h;
- } else {
- b = *box;
- }
-
-
- if (b.x1 > b.x2 ||
- b.y1 > b.y2 ||
- b.x2 > intelScreen->width ||
- b.y2 > intelScreen->height)
- continue;
-
- if ( flags & BUFFER_BIT_FRONT_LEFT ) {
- BEGIN_BATCH( 6);
- OUT_BATCH( CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (b.y1 << 16) | b.x1 );
- OUT_BATCH( (b.y2 << 16) | b.x2 );
- OUT_BATCH( intelScreen->frontOffset );
- OUT_BATCH( clear_color );
- ADVANCE_BATCH();
- }
-
- if ( flags & BUFFER_BIT_BACK_LEFT ) {
- BEGIN_BATCH( 6);
- OUT_BATCH( CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (b.y1 << 16) | b.x1 );
- OUT_BATCH( (b.y2 << 16) | b.x2 );
- OUT_BATCH( intelScreen->backOffset );
- OUT_BATCH( clear_color );
- ADVANCE_BATCH();
- }
-
- if ( flags & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) {
- BEGIN_BATCH( 6);
- OUT_BATCH( D_CMD );
- OUT_BATCH( BR13 );
- OUT_BATCH( (b.y1 << 16) | b.x1 );
- OUT_BATCH( (b.y2 << 16) | b.x2 );
- OUT_BATCH( intelScreen->depthOffset );
- OUT_BATCH( clear_depth );
- ADVANCE_BATCH();
- }
- }
- }
- intelFlushBatchLocked( intel, GL_TRUE, GL_FALSE, GL_TRUE );
- UNLOCK_HARDWARE( intel );
-}
-
-
-
-
-void intelDestroyBatchBuffer( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- if (intel->alloc.ptr) {
- intelFreeAGP( intel, intel->alloc.ptr );
- intel->alloc.ptr = 0;
- }
-}
-
-
-void intelInitBatchBuffer( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- if (!intel->intelScreen->allow_batchbuffer || getenv("INTEL_NO_BATCH")) {
- intel->alloc.size = 8 * 1024;
- intel->alloc.ptr = malloc( intel->alloc.size );
- intel->alloc.offset = 0;
- }
- else {
- switch (intel->intelScreen->deviceID) {
- case PCI_CHIP_I865_G:
- /* HW bug? Seems to crash if batchbuffer crosses 4k boundary.
- */
- intel->alloc.size = 8 * 1024;
- break;
- default:
- /* This is the smallest amount of memory the kernel deals with.
- * We'd ideally like to make this smaller.
- */
- intel->alloc.size = 1 << intel->intelScreen->logTextureGranularity;
- break;
- }
-
- intel->alloc.ptr = intelAllocateAGP( intel, intel->alloc.size );
- if (intel->alloc.ptr)
- intel->alloc.offset =
- intelAgpOffsetFromVirtual( intel, intel->alloc.ptr );
- }
-
- if (!intel->alloc.ptr) {
- FALLBACK(intel, INTEL_FALLBACK_NO_BATCHBUFFER, 1);
- }
- else {
- intel->prim.flush = 0;
- intel->vtbl.emit_invarient_state( intel );
-
- /* Make sure this gets to the hardware, even if we have no cliprects:
- */
- LOCK_HARDWARE( intel );
- intelFlushBatchLocked( intel, GL_TRUE, GL_FALSE, GL_TRUE );
- UNLOCK_HARDWARE( intel );
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.h
deleted file mode 100644
index bd879af15..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_batchbuffer.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef INTEL_BATCHBUFFER_H
-#define INTEL_BATCHBUFFER_H
-
-#include "intel_context.h"
-#include "intel_ioctl.h"
-
-
-#define BATCH_LOCALS GLubyte *batch_ptr;
-
-/* #define VERBOSE 0 */
-#ifndef VERBOSE
-extern int VERBOSE;
-#endif
-
-
-#define BEGIN_BATCH(n) \
-do { \
- if (VERBOSE) fprintf(stderr, \
- "BEGIN_BATCH(%d) in %s, %d dwords free\n", \
- (n), __FUNCTION__, intel->batch.space/4); \
- if (intel->batch.space < (n)*4) \
- intelFlushBatch(intel, GL_TRUE); \
- batch_ptr = intel->batch.ptr; \
-} while (0)
-
-#define OUT_BATCH(n) \
-do { \
- *(GLuint *)batch_ptr = (n); \
- if (VERBOSE) fprintf(stderr, " -- %08x at %s/%d\n", (n), __FILE__, __LINE__); \
- batch_ptr += 4; \
-} while (0)
-
-#define ADVANCE_BATCH() \
-do { \
- if (VERBOSE) fprintf(stderr, "ADVANCE_BATCH()\n"); \
- intel->batch.space -= (batch_ptr - intel->batch.ptr); \
- intel->batch.ptr = batch_ptr; \
- assert(intel->batch.space >= 0); \
-} while(0)
-
-extern void intelInitBatchBuffer( GLcontext *ctx );
-extern void intelDestroyBatchBuffer( GLcontext *ctx );
-
-extern void intelStartInlinePrimitive( intelContextPtr intel, GLuint prim );
-extern void intelWrapInlinePrimitive( intelContextPtr intel );
-extern void intelRestartInlinePrimitive( intelContextPtr intel );
-extern GLuint *intelEmitInlinePrimitiveLocked(intelContextPtr intel,
- int primitive, int dwords,
- int vertex_size);
-extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv );
-extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx1, GLint cy1, GLint cw, GLint ch);
-
-extern void intelEmitCopyBlitLocked( intelContextPtr intel,
- GLuint cpp,
- GLshort src_pitch,
- GLuint src_offset,
- GLshort dst_pitch,
- GLuint dst_offset,
- GLshort srcx, GLshort srcy,
- GLshort dstx, GLshort dsty,
- GLshort w, GLshort h );
-
-extern void intelEmitFillBlitLocked( intelContextPtr intel,
- GLuint cpp,
- GLshort dst_pitch,
- GLuint dst_offset,
- GLshort x, GLshort y,
- GLshort w, GLshort h,
- GLuint color );
-
-
-
-
-static __inline GLuint *intelExtendInlinePrimitive( intelContextPtr intel,
- GLuint dwords )
-{
- GLuint sz = dwords * sizeof(GLuint);
- GLuint *ptr;
-
- if (intel->batch.space < sz) {
- intelWrapInlinePrimitive( intel );
-/* assert(intel->batch.space >= sz); */
- }
-
-/* assert(intel->prim.primitive != ~0); */
- ptr = (GLuint *)intel->batch.ptr;
- intel->batch.ptr += sz;
- intel->batch.space -= sz;
-
- return ptr;
-}
-
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c
deleted file mode 100644
index bdf02c766..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.c
+++ /dev/null
@@ -1,712 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "imports.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vertex.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "intel_screen.h"
-
-#include "i830_dri.h"
-#include "i830_common.h"
-
-#include "intel_tex.h"
-#include "intel_span.h"
-#include "intel_tris.h"
-#include "intel_ioctl.h"
-#include "intel_batchbuffer.h"
-
-#include "utils.h"
-#ifndef INTEL_DEBUG
-int INTEL_DEBUG = (0);
-#endif
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_point_parameters
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-#define need_GL_ARB_vertex_program
-#define need_GL_ARB_window_pos
-#define need_GL_EXT_blend_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_cull_vertex
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_multi_draw_arrays
-#define need_GL_EXT_secondary_color
-#define need_GL_NV_vertex_program
-#include "extension_helper.h"
-
-#ifndef VERBOSE
-int VERBOSE = 0;
-#endif
-
-#if DEBUG_LOCKING
-char *prevLockFile;
-int prevLockLine;
-#endif
-
-/***************************************
- * Mesa's Driver Functions
- ***************************************/
-
-#define DRIVER_DATE "20050225"
-
-const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
-{
- const char * chipset;
- static char buffer[128];
-
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *)"Tungsten Graphics, Inc";
- break;
-
- case GL_RENDERER:
- switch (INTEL_CONTEXT(ctx)->intelScreen->deviceID) {
- case PCI_CHIP_845_G:
- chipset = "Intel(R) 845G"; break;
- case PCI_CHIP_I830_M:
- chipset = "Intel(R) 830M"; break;
- case PCI_CHIP_I855_GM:
- chipset = "Intel(R) 852GM/855GM"; break;
- case PCI_CHIP_I865_G:
- chipset = "Intel(R) 865G"; break;
- case PCI_CHIP_I915_G:
- chipset = "Intel(R) 915G"; break;
- case PCI_CHIP_I915_GM:
- chipset = "Intel(R) 915GM"; break;
- case PCI_CHIP_I945_G:
- chipset = "Intel(R) 945G"; break;
- default:
- chipset = "Unknown Intel Chipset"; break;
- }
-
- (void) driGetRendererString( buffer, chipset, DRIVER_DATE, 0 );
- return (GLubyte *) buffer;
-
- default:
- return NULL;
- }
-}
-
-static void intelBufferSize(GLframebuffer *buffer,
- GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE(intel);
- *width = intel->driDrawable->w;
- *height = intel->driDrawable->h;
- UNLOCK_HARDWARE(intel);
-}
-
-
-/**
- * Extension strings exported by the intel driver.
- *
- * \note
- * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
- * old i830-specific driver.
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
- { "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_cube_map", NULL },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_ARB_texture_env_dot3", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_texture_rectangle", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
- { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
- { "GL_ARB_window_pos", GL_ARB_window_pos_functions },
- { "GL_EXT_blend_color", GL_EXT_blend_color_functions },
- { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
- { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
- { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
- { "GL_EXT_blend_subtract", NULL },
- { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_EXT_texture_env_combine", NULL },
- { "GL_EXT_texture_env_dot3", NULL },
- { "GL_EXT_texture_filter_anisotropic", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_3DFX_texture_compression_FXT1", NULL },
- { "GL_APPLE_client_storage", NULL },
- { "GL_MESA_pack_invert", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_NV_vertex_program", GL_NV_vertex_program_functions },
- { "GL_NV_vertex_program1_1", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-extern const struct tnl_pipeline_stage _intel_render_stage;
-
-static const struct tnl_pipeline_stage *intel_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_vertex_cull_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
- &_tnl_arb_vertex_program_stage,
- &_tnl_vertex_program_stage,
-#if 1
- &_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "tex", DEBUG_TEXTURE },
- { "ioctl", DEBUG_IOCTL },
- { "prim", DEBUG_PRIMS },
- { "vert", DEBUG_VERTS },
- { "state", DEBUG_STATE },
- { "verb", DEBUG_VERBOSE },
- { "dri", DEBUG_DRI },
- { "dma", DEBUG_DMA },
- { "san", DEBUG_SANITY },
- { "sync", DEBUG_SYNC },
- { "sleep", DEBUG_SLEEP },
- { "pix", DEBUG_PIXEL },
- { NULL, 0 }
-};
-
-
-static void intelInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- _tnl_invalidate_vertex_state( ctx, new_state );
- INTEL_CONTEXT(ctx)->NewGLState |= new_state;
-}
-
-
-void intelInitDriverFunctions( struct dd_function_table *functions )
-{
- _mesa_init_driver_functions( functions );
-
- functions->Flush = intelFlush;
- functions->Clear = intelClear;
- functions->Finish = intelFinish;
- functions->GetBufferSize = intelBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = intelGetString;
- functions->UpdateState = intelInvalidateState;
- functions->CopyColorTable = _swrast_CopyColorTable;
- functions->CopyColorSubTable = _swrast_CopyColorSubTable;
- functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-
- intelInitTextureFuncs( functions );
- intelInitPixelFuncs( functions );
- intelInitStateFuncs( functions );
-}
-
-
-
-GLboolean intelInitContext( intelContextPtr intel,
- const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate,
- struct dd_function_table *functions )
-{
- GLcontext *ctx = &intel->ctx;
- GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- intelScreenPrivate *intelScreen = (intelScreenPrivate *)sPriv->private;
- drmI830Sarea *saPriv = (drmI830Sarea *)
- (((GLubyte *)sPriv->pSAREA)+intelScreen->sarea_priv_offset);
-
- if (!_mesa_initialize_context(&intel->ctx,
- mesaVis, shareCtx,
- functions,
- (void*) intel))
- return GL_FALSE;
-
- driContextPriv->driverPrivate = intel;
- intel->intelScreen = intelScreen;
- intel->driScreen = sPriv;
- intel->sarea = saPriv;
-
-
- (void) memset( intel->texture_heaps, 0, sizeof( intel->texture_heaps ) );
- make_empty_list( & intel->swapped );
-
- ctx->Const.MaxTextureMaxAnisotropy = 2.0;
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 3.0;
- ctx->Const.MaxLineWidthAA = 3.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 255.0;
- ctx->Const.MaxPointSizeAA = 3.0;
- ctx->Const.PointSizeGranularity = 1.0;
-
- /* Initialize the software rasterizer and helper modules. */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline: */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, intel_pipeline );
-
- /* Configure swrast to match hardware characteristics: */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
-
- /* Dri stuff */
- intel->hHWContext = driContextPriv->hHWContext;
- intel->driFd = sPriv->fd;
- intel->driHwLock = (drmLock *) &sPriv->pSAREA->lock;
-
- intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
- intel->hw_stipple = 1;
-
- switch(mesaVis->depthBits) {
- case 0: /* what to do in this case? */
- case 16:
- intel->depth_scale = 1.0/0xffff;
- intel->polygon_offset_scale = 1.0/0xffff;
- intel->depth_clear_mask = ~0;
- intel->ClearDepth = 0xffff;
- break;
- case 24:
- intel->depth_scale = 1.0/0xffffff;
- intel->polygon_offset_scale = 2.0/0xffffff; /* req'd to pass glean */
- intel->depth_clear_mask = 0x00ffffff;
- intel->stencil_clear_mask = 0xff000000;
- intel->ClearDepth = 0x00ffffff;
- break;
- default:
- assert(0);
- break;
- }
-
- /* Initialize swrast, tnl driver tables: */
- intelInitSpanFuncs( ctx );
- intelInitTriFuncs( ctx );
-
-
- intel->RenderIndex = ~0;
-
- intel->do_irqs = (intel->intelScreen->irq_active &&
- !getenv("INTEL_NO_IRQS"));
-
- _math_matrix_ctr (&intel->ViewportMatrix);
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
-
- if (intel->ctx.Mesa_DXTn) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- _mesa_enable_extension( ctx, "GL_S3_s3tc" );
- }
- else if (driQueryOptionb (&intelScreen->optionCache, "force_s3tc_enable")) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- }
-
-/* driInitTextureObjects( ctx, & intel->swapped, */
-/* DRI_TEXMGR_DO_TEXTURE_1D | */
-/* DRI_TEXMGR_DO_TEXTURE_2D | */
-/* DRI_TEXMGR_DO_TEXTURE_RECT ); */
-
-
- intel->prim.flush = intelInitBatchBuffer;
- intel->prim.primitive = ~0;
-
-
-#if DO_DEBUG
- INTEL_DEBUG = driParseDebugString( getenv( "INTEL_DEBUG" ),
- debug_control );
- INTEL_DEBUG |= driParseDebugString( getenv( "INTEL_DEBUG" ),
- debug_control );
-#endif
-
-#ifndef VERBOSE
- if (getenv("INTEL_VERBOSE"))
- VERBOSE=1;
-#endif
-
- if (getenv("INTEL_NO_RAST") ||
- getenv("INTEL_NO_RAST")) {
- fprintf(stderr, "disabling 3D rasterization\n");
- FALLBACK(intel, INTEL_FALLBACK_USER, 1);
- }
-
- return GL_TRUE;
-}
-
-void intelDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- intelContextPtr intel = (intelContextPtr) driContextPriv->driverPrivate;
-
- assert(intel); /* should never be null */
- if (intel) {
- GLboolean release_texture_heaps;
-
-
- intel->vtbl.destroy( intel );
-
- release_texture_heaps = (intel->ctx.Shared->RefCount == 1);
- _swsetup_DestroyContext (&intel->ctx);
- _tnl_DestroyContext (&intel->ctx);
- _ac_DestroyContext (&intel->ctx);
-
- _swrast_DestroyContext (&intel->ctx);
- intel->Fallback = 0; /* don't call _swrast_Flush later */
-
- intelDestroyBatchBuffer(&intel->ctx);
-
-
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- int i;
-
- for ( i = 0 ; i < intel->nr_heaps ; i++ ) {
- driDestroyTextureHeap( intel->texture_heaps[ i ] );
- intel->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & intel->swapped ) );
- }
-
- /* free the Mesa context */
- _mesa_destroy_context(&intel->ctx);
- }
-}
-
-void intelSetFrontClipRects( intelContextPtr intel )
-{
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
-
- if (!dPriv) return;
-
- intel->numClipRects = dPriv->numClipRects;
- intel->pClipRects = dPriv->pClipRects;
- intel->drawX = dPriv->x;
- intel->drawY = dPriv->y;
-}
-
-
-void intelSetBackClipRects( intelContextPtr intel )
-{
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
-
- if (!dPriv) return;
-
- if (intel->sarea->pf_enabled == 0 && dPriv->numBackClipRects == 0) {
- intel->numClipRects = dPriv->numClipRects;
- intel->pClipRects = dPriv->pClipRects;
- intel->drawX = dPriv->x;
- intel->drawY = dPriv->y;
- } else {
- intel->numClipRects = dPriv->numBackClipRects;
- intel->pClipRects = dPriv->pBackClipRects;
- intel->drawX = dPriv->backX;
- intel->drawY = dPriv->backY;
-
- if (dPriv->numBackClipRects == 1 &&
- dPriv->x == dPriv->backX &&
- dPriv->y == dPriv->backY) {
-
- /* Repeat the calculation of the back cliprect dimensions here
- * as early versions of dri.a in the Xserver are incorrect. Try
- * very hard not to restrict future versions of dri.a which
- * might eg. allocate truly private back buffers.
- */
- int x1, y1;
- int x2, y2;
-
- x1 = dPriv->x;
- y1 = dPriv->y;
- x2 = dPriv->x + dPriv->w;
- y2 = dPriv->y + dPriv->h;
-
- if (x1 < 0) x1 = 0;
- if (y1 < 0) y1 = 0;
- if (x2 > intel->intelScreen->width) x2 = intel->intelScreen->width;
- if (y2 > intel->intelScreen->height) y2 = intel->intelScreen->height;
-
- if (x1 == dPriv->pBackClipRects[0].x1 &&
- y1 == dPriv->pBackClipRects[0].y1) {
-
- dPriv->pBackClipRects[0].x2 = x2;
- dPriv->pBackClipRects[0].y2 = y2;
- }
- }
- }
-}
-
-
-void intelWindowMoved( intelContextPtr intel )
-{
- if (!intel->ctx.DrawBuffer) {
- intelSetFrontClipRects( intel );
- }
- else {
- switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- intelSetFrontClipRects( intel );
- break;
- case BUFFER_BIT_BACK_LEFT:
- intelSetBackClipRects( intel );
- break;
- default:
- /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
- intelSetFrontClipRects( intel );
- }
- }
-}
-
-GLboolean intelUnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- return GL_TRUE;
-}
-
-GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
-
- if (driContextPriv) {
- intelContextPtr intel = (intelContextPtr) driContextPriv->driverPrivate;
-
- if ( intel->driDrawable != driDrawPriv ) {
- /* Shouldn't the readbuffer be stored also? */
- intel->driDrawable = driDrawPriv;
- intelWindowMoved( intel );
- }
-
- _mesa_make_current(&intel->ctx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
-
- intel->ctx.Driver.DrawBuffer( &intel->ctx, intel->ctx.Color.DrawBuffer[0] );
- } else {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-void intelGetLock( intelContextPtr intel, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- __DRIscreenPrivate *sPriv = intel->driScreen;
- drmI830Sarea * sarea = intel->sarea;
- int me = intel->hHWContext;
- unsigned i;
-
- drmGetLock(intel->driFd, intel->hHWContext, flags);
-
- /* If the window moved, may need to set a new cliprect now.
- *
- * NOTE: This releases and regains the hw lock, so all state
- * checking must be done *after* this call:
- */
- if (dPriv)
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
- /* If we lost context, need to dump all registers to hardware.
- * Note that we don't care about 2d contexts, even if they perform
- * accelerated commands, so the DRI locking in the X server is even
- * more broken than usual.
- */
-
- if (sarea->ctxOwner != me) {
- intel->perf_boxes |= I830_BOX_LOST_CONTEXT;
- sarea->ctxOwner = me;
- }
-
- /* Shared texture managment - if another client has played with
- * texture space, figure out which if any of our textures have been
- * ejected, and update our global LRU.
- */
-
- for ( i = 0 ; i < intel->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( intel->texture_heaps[ i ] );
- }
-
- if (dPriv && intel->lastStamp != dPriv->lastStamp) {
- intelWindowMoved( intel );
- intel->lastStamp = dPriv->lastStamp;
- }
-}
-
-void intelSwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- intelContextPtr intel;
- GLcontext *ctx;
- intel = (intelContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = &intel->ctx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- if ( 0 /*intel->doPageFlip*/ ) { /* doPageFlip is never set !!! */
- intelPageFlip( dPriv );
- } else {
- intelCopyBuffer( dPriv );
- }
- }
- } else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__);
- }
-}
-
-
-void intelInitState( GLcontext *ctx )
-{
- /* Mesa should do this for us:
- */
- ctx->Driver.AlphaFunc( ctx,
- ctx->Color.AlphaFunc,
- ctx->Color.AlphaRef);
-
- ctx->Driver.BlendColor( ctx,
- ctx->Color.BlendColor );
-
- ctx->Driver.BlendEquationSeparate( ctx,
- ctx->Color.BlendEquationRGB,
- ctx->Color.BlendEquationA);
-
- ctx->Driver.BlendFuncSeparate( ctx,
- ctx->Color.BlendSrcRGB,
- ctx->Color.BlendDstRGB,
- ctx->Color.BlendSrcA,
- ctx->Color.BlendDstA);
-
- ctx->Driver.ColorMask( ctx,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP]);
-
- ctx->Driver.CullFace( ctx, ctx->Polygon.CullFaceMode );
- ctx->Driver.DepthFunc( ctx, ctx->Depth.Func );
- ctx->Driver.DepthMask( ctx, ctx->Depth.Mask );
-
- ctx->Driver.Enable( ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled );
- ctx->Driver.Enable( ctx, GL_BLEND, ctx->Color.BlendEnabled );
- ctx->Driver.Enable( ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled );
- ctx->Driver.Enable( ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled );
- ctx->Driver.Enable( ctx, GL_CULL_FACE, ctx->Polygon.CullFlag );
- ctx->Driver.Enable( ctx, GL_DEPTH_TEST, ctx->Depth.Test );
- ctx->Driver.Enable( ctx, GL_DITHER, ctx->Color.DitherFlag );
- ctx->Driver.Enable( ctx, GL_FOG, ctx->Fog.Enabled );
- ctx->Driver.Enable( ctx, GL_LIGHTING, ctx->Light.Enabled );
- ctx->Driver.Enable( ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag );
- ctx->Driver.Enable( ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag );
- ctx->Driver.Enable( ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled );
- ctx->Driver.Enable( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled );
- ctx->Driver.Enable( ctx, GL_TEXTURE_1D, GL_FALSE );
- ctx->Driver.Enable( ctx, GL_TEXTURE_2D, GL_FALSE );
- ctx->Driver.Enable( ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE );
- ctx->Driver.Enable( ctx, GL_TEXTURE_3D, GL_FALSE );
- ctx->Driver.Enable( ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE );
-
- ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
- ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 );
- ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
- ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start );
- ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
-
- ctx->Driver.FrontFace( ctx, ctx->Polygon.FrontFace );
-
- {
- GLfloat f = (GLfloat)ctx->Light.Model.ColorControl;
- ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f );
- }
-
- ctx->Driver.LineWidth( ctx, ctx->Line.Width );
- ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp );
- ctx->Driver.PointSize( ctx, ctx->Point.Size );
- ctx->Driver.PolygonStipple( ctx, (const GLubyte *)ctx->PolygonStipple );
- ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height );
- ctx->Driver.ShadeModel( ctx, ctx->Light.ShadeModel );
- ctx->Driver.StencilFunc( ctx,
- ctx->Stencil.Function[0],
- ctx->Stencil.Ref[0],
- ctx->Stencil.ValueMask[0] );
- ctx->Driver.StencilMask( ctx, ctx->Stencil.WriteMask[0] );
- ctx->Driver.StencilOp( ctx,
- ctx->Stencil.FailFunc[0],
- ctx->Stencil.ZFailFunc[0],
- ctx->Stencil.ZPassFunc[0]);
-
-
- ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h
deleted file mode 100644
index da1ef701b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_context.h
+++ /dev/null
@@ -1,519 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef INTELCONTEXT_INC
-#define INTELCONTEXT_INC
-
-
-
-#include "mtypes.h"
-#include "drm.h"
-#include "mm.h"
-#include "texmem.h"
-
-#include "intel_screen.h"
-#include "i830_common.h"
-#include "tnl/t_vertex.h"
-
-#define TAG(x) intel##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-#define DV_PF_555 (1<<8)
-#define DV_PF_565 (2<<8)
-#define DV_PF_8888 (3<<8)
-
-#define INTEL_CONTEXT(ctx) ((intelContextPtr)(ctx))
-
-typedef struct intel_context intelContext;
-typedef struct intel_context *intelContextPtr;
-typedef struct intel_texture_object *intelTextureObjectPtr;
-
-typedef void (*intel_tri_func)(intelContextPtr, intelVertex *, intelVertex *,
- intelVertex *);
-typedef void (*intel_line_func)(intelContextPtr, intelVertex *, intelVertex *);
-typedef void (*intel_point_func)(intelContextPtr, intelVertex *);
-
-#define INTEL_FALLBACK_DRAW_BUFFER 0x1
-#define INTEL_FALLBACK_READ_BUFFER 0x2
-#define INTEL_FALLBACK_USER 0x4
-#define INTEL_FALLBACK_NO_BATCHBUFFER 0x8
-#define INTEL_FALLBACK_NO_TEXMEM 0x10
-#define INTEL_FALLBACK_RENDERMODE 0x20
-
-extern void intelFallback( intelContextPtr intel, GLuint bit, GLboolean mode );
-#define FALLBACK( intel, bit, mode ) intelFallback( intel, bit, mode )
-
-
-#define INTEL_TEX_MAXLEVELS 10
-
-
-struct intel_texture_object
-{
- driTextureObject base; /* the parent class */
-
- GLuint texelBytes;
- GLuint age;
- GLuint Pitch;
- GLuint Height;
- GLuint TextureOffset;
- GLubyte *BufAddr;
-
- GLuint min_level;
- GLuint max_level;
- GLuint depth_pitch;
-
- struct {
- const struct gl_texture_image *image;
- GLuint offset; /* into BufAddr */
- GLuint height;
- GLuint internalFormat;
- } image[6][INTEL_TEX_MAXLEVELS];
-
- GLuint dirty;
- GLuint firstLevel,lastLevel;
-};
-
-
-struct intel_context
-{
- GLcontext ctx; /* the parent class */
-
- struct {
- void (*destroy)( intelContextPtr intel );
- void (*emit_state)( intelContextPtr intel );
- void (*emit_invarient_state)( intelContextPtr intel );
- void (*lost_hardware)( intelContextPtr intel );
- void (*update_texture_state)( intelContextPtr intel );
-
- void (*render_start)( intelContextPtr intel );
- void (*set_draw_offset)( intelContextPtr intel, int offset );
- void (*emit_flush)( intelContextPtr intel );
-
- void (*reduced_primitive_state)( intelContextPtr intel, GLenum rprim );
-
- GLboolean (*check_vertex_size)( intelContextPtr intel, GLuint expected );
-
- void (*clear_with_tris)( intelContextPtr intel, GLbitfield mask,
- GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch);
-
- intelTextureObjectPtr (*alloc_tex_obj)( struct gl_texture_object *tObj );
-
- } vtbl;
-
- GLint refcount;
- GLuint Fallback;
- GLuint NewGLState;
-
- struct {
- GLuint start_offset;
- GLint size;
- GLint space;
- GLubyte *ptr;
- } batch;
-
- struct {
- void *ptr;
- GLint size;
- GLuint offset;
- GLuint active_buf;
- GLuint irq_emitted;
- } alloc;
-
- struct {
- GLuint primitive;
- GLubyte *start_ptr;
- void (*flush)( GLcontext * );
- } prim;
-
- GLboolean locked;
-
- GLubyte clear_red;
- GLubyte clear_green;
- GLubyte clear_blue;
- GLubyte clear_alpha;
- GLuint ClearColor;
- GLuint ClearDepth;
-
- GLuint coloroffset;
- GLuint specoffset;
-
- /* Support for duplicating XYZW as WPOS parameter (crutch for I915).
- */
- GLuint wpos_offset;
- GLuint wpos_size;
-
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
-
- GLfloat depth_scale;
- GLfloat polygon_offset_scale; /* dependent on depth_scale, bpp */
- GLuint depth_clear_mask;
- GLuint stencil_clear_mask;
-
- GLboolean hw_stencil;
- GLboolean hw_stipple;
-
- /* Texture object bookkeeping
- */
- GLuint nr_heaps;
- driTexHeap * texture_heaps[1];
- driTextureObject swapped;
- GLuint lastStamp;
-
- struct intel_texture_object *CurrentTexObj[MAX_TEXTURE_UNITS];
-
- /* State for intelvb.c and inteltris.c.
- */
- GLuint RenderIndex;
- GLmatrix ViewportMatrix;
- GLenum render_primitive;
- GLenum reduced_primitive;
- GLuint vertex_size;
- char *verts; /* points to tnl->clipspace.vertex_buf */
-
-
- /* Fallback rasterization functions
- */
- intel_point_func draw_point;
- intel_line_func draw_line;
- intel_tri_func draw_tri;
-
- /* These refer to the current draw (front vs. back) buffer:
- */
- char *drawMap; /* draw buffer address in virtual mem */
- char *readMap;
- GLuint drawOffset; /* agp offset of drawbuffer */
- int drawX; /* origin of drawable in draw buffer */
- int drawY;
- GLuint numClipRects; /* cliprects for that buffer */
- drm_clip_rect_t *pClipRects;
-
- int dirtyAge;
- int perf_boxes;
- int do_irqs;
-
- GLboolean scissor;
- drm_clip_rect_t draw_rect;
- drm_clip_rect_t scissor_rect;
-
- drm_context_t hHWContext;
- drmLock *driHwLock;
- int driFd;
-
- __DRIdrawablePrivate *driDrawable;
- __DRIscreenPrivate *driScreen;
- intelScreenPrivate *intelScreen;
- drmI830Sarea *sarea;
-
- /**
- * Configuration cache
- */
- driOptionCache optionCache;
-};
-
-
-#define DEBUG_LOCKING 1
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-/* Slightly less broken way of detecting recursive locking in a
- * threaded environment. The right way to do this would be to make
- * prevLockFile, prevLockLine thread-local.
- *
- * This technique instead checks to see if the same context is
- * requesting the lock twice -- this will not catch application
- * breakages where the same context is active in two different threads
- * at once, but it will catch driver breakages (recursive locking) in
- * threaded apps.
- */
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( *((volatile int *)intel->driHwLock) == \
- (DRM_LOCK_HELD | intel->hHWContext) ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- abort(); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( intel ) \
-do { \
- char __ret=0; \
- DEBUG_CHECK_LOCK(); \
- assert(!(intel)->locked); \
- DRM_CAS((intel)->driHwLock, (intel)->hHWContext, \
- (DRM_LOCK_HELD|(intel)->hHWContext), __ret); \
- if (__ret) \
- intelGetLock( (intel), 0 ); \
- DEBUG_LOCK(); \
- (intel)->locked = 1; \
-}while (0)
-
-
- /* Unlock the hardware using the global current context
- */
-#define UNLOCK_HARDWARE(intel) \
-do { \
- intel->locked = 0; \
- if (0) { \
- intel->perf_boxes |= intel->sarea->perf_boxes; \
- intel->sarea->perf_boxes = 0; \
- } \
- DRM_UNLOCK((intel)->driFd, (intel)->driHwLock, (intel)->hHWContext); \
- DEBUG_RESET(); \
-} while (0)
-
-
-#define SUBPIXEL_X 0.125
-#define SUBPIXEL_Y 0.125
-
-#define INTEL_FIREVERTICES(intel) \
-do { \
- if ((intel)->prim.flush) \
- (intel)->prim.flush(&(intel)->ctx); \
-} while (0)
-
-/* ================================================================
- * Color packing:
- */
-
-#define INTEL_PACKCOLOR4444(r,g,b,a) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-#define INTEL_PACKCOLOR1555(r,g,b,a) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define INTEL_PACKCOLOR565(r,g,b) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define INTEL_PACKCOLOR8888(r,g,b,a) \
- ((a<<24) | (r<<16) | (g<<8) | b)
-
-
-#define INTEL_PACKCOLOR(format, r, g, b, a) \
-(format == DV_PF_555 ? INTEL_PACKCOLOR1555(r,g,b,a) : \
- (format == DV_PF_565 ? INTEL_PACKCOLOR565(r,g,b) : \
- (format == DV_PF_8888 ? INTEL_PACKCOLOR8888(r,g,b,a) : \
- 0)))
-
-
-
-/* ================================================================
- * From linux kernel i386 header files, copes with odd sizes better
- * than COPY_DWORDS would:
- */
-#if defined(i386) || defined(__i386__)
-static __inline__ void * __memcpy(void * to, const void * from, size_t n)
-{
- int d0, d1, d2;
- __asm__ __volatile__(
- "rep ; movsl\n\t"
- "testb $2,%b4\n\t"
- "je 1f\n\t"
- "movsw\n"
- "1:\ttestb $1,%b4\n\t"
- "je 2f\n\t"
- "movsb\n"
- "2:"
- : "=&c" (d0), "=&D" (d1), "=&S" (d2)
- :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
- : "memory");
- return (to);
-}
-#else
-#define __memcpy(a,b,c) memcpy(a,b,c)
-#endif
-
-
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-#if DO_DEBUG
-extern int INTEL_DEBUG;
-#else
-#define INTEL_DEBUG 0
-#endif
-
-#define DEBUG_TEXTURE 0x1
-#define DEBUG_STATE 0x2
-#define DEBUG_IOCTL 0x4
-#define DEBUG_PRIMS 0x8
-#define DEBUG_VERTS 0x10
-#define DEBUG_FALLBACKS 0x20
-#define DEBUG_VERBOSE 0x40
-#define DEBUG_DRI 0x80
-#define DEBUG_DMA 0x100
-#define DEBUG_SANITY 0x200
-#define DEBUG_SYNC 0x400
-#define DEBUG_SLEEP 0x800
-#define DEBUG_PIXEL 0x1000
-
-
-#define PCI_CHIP_845_G 0x2562
-#define PCI_CHIP_I830_M 0x3577
-#define PCI_CHIP_I855_GM 0x3582
-#define PCI_CHIP_I865_G 0x2572
-#define PCI_CHIP_I915_G 0x2582
-#define PCI_CHIP_I915_GM 0x2592
-#define PCI_CHIP_I945_G 0x2772
-
-
-/* ================================================================
- * intel_context.c:
- */
-
-extern void intelInitDriverFunctions( struct dd_function_table *functions );
-
-extern GLboolean intelInitContext( intelContextPtr intel,
- const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate,
- struct dd_function_table *functions );
-
-extern void intelGetLock(intelContextPtr intel, GLuint flags);
-extern void intelSetBackClipRects(intelContextPtr intel);
-extern void intelSetFrontClipRects(intelContextPtr intel);
-extern void intelWindowMoved( intelContextPtr intel );
-
-extern void intelInitState( GLcontext *ctx );
-extern const GLubyte *intelGetString( GLcontext *ctx, GLenum name );
-
-
-/* ================================================================
- * intel_state.c:
- */
-extern void intelInitStateFuncs( struct dd_function_table *functions );
-
-#define COMPAREFUNC_ALWAYS 0
-#define COMPAREFUNC_NEVER 0x1
-#define COMPAREFUNC_LESS 0x2
-#define COMPAREFUNC_EQUAL 0x3
-#define COMPAREFUNC_LEQUAL 0x4
-#define COMPAREFUNC_GREATER 0x5
-#define COMPAREFUNC_NOTEQUAL 0x6
-#define COMPAREFUNC_GEQUAL 0x7
-
-#define STENCILOP_KEEP 0
-#define STENCILOP_ZERO 0x1
-#define STENCILOP_REPLACE 0x2
-#define STENCILOP_INCRSAT 0x3
-#define STENCILOP_DECRSAT 0x4
-#define STENCILOP_INCR 0x5
-#define STENCILOP_DECR 0x6
-#define STENCILOP_INVERT 0x7
-
-#define LOGICOP_CLEAR 0
-#define LOGICOP_NOR 0x1
-#define LOGICOP_AND_INV 0x2
-#define LOGICOP_COPY_INV 0x3
-#define LOGICOP_AND_RVRSE 0x4
-#define LOGICOP_INV 0x5
-#define LOGICOP_XOR 0x6
-#define LOGICOP_NAND 0x7
-#define LOGICOP_AND 0x8
-#define LOGICOP_EQUIV 0x9
-#define LOGICOP_NOOP 0xa
-#define LOGICOP_OR_INV 0xb
-#define LOGICOP_COPY 0xc
-#define LOGICOP_OR_RVRSE 0xd
-#define LOGICOP_OR 0xe
-#define LOGICOP_SET 0xf
-
-#define BLENDFACT_ZERO 0x01
-#define BLENDFACT_ONE 0x02
-#define BLENDFACT_SRC_COLR 0x03
-#define BLENDFACT_INV_SRC_COLR 0x04
-#define BLENDFACT_SRC_ALPHA 0x05
-#define BLENDFACT_INV_SRC_ALPHA 0x06
-#define BLENDFACT_DST_ALPHA 0x07
-#define BLENDFACT_INV_DST_ALPHA 0x08
-#define BLENDFACT_DST_COLR 0x09
-#define BLENDFACT_INV_DST_COLR 0x0a
-#define BLENDFACT_SRC_ALPHA_SATURATE 0x0b
-#define BLENDFACT_CONST_COLOR 0x0c
-#define BLENDFACT_INV_CONST_COLOR 0x0d
-#define BLENDFACT_CONST_ALPHA 0x0e
-#define BLENDFACT_INV_CONST_ALPHA 0x0f
-#define BLENDFACT_MASK 0x0f
-
-
-extern int intel_translate_compare_func( GLenum func );
-extern int intel_translate_stencil_op( GLenum op );
-extern int intel_translate_blend_factor( GLenum factor );
-extern int intel_translate_logic_op( GLenum opcode );
-
-
-/* ================================================================
- * intel_ioctl.c:
- */
-extern void intel_dump_batchbuffer( long offset,
- int *ptr,
- int count );
-
-
-/* ================================================================
- * intel_pixel.c:
- */
-extern void intelInitPixelFuncs( struct dd_function_table *functions );
-
-
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.c
deleted file mode 100644
index 83bb77f38..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sched.h>
-
-#include "mtypes.h"
-#include "context.h"
-#include "swrast/swrast.h"
-
-#include "intel_context.h"
-#include "intel_ioctl.h"
-#include "intel_batchbuffer.h"
-#include "drm.h"
-
-
-
-static int intelEmitIrqLocked( intelContextPtr intel )
-{
- drmI830IrqEmit ie;
- int ret, seq = 0;
-
- assert(((*(int *)intel->driHwLock) & ~DRM_LOCK_CONT) ==
- (DRM_LOCK_HELD|intel->hHWContext));
-
- ie.irq_seq = &seq;
-
- ret = drmCommandWriteRead( intel->driFd, DRM_I830_IRQ_EMIT,
- &ie, sizeof(ie) );
- if ( ret ) {
- fprintf( stderr, "%s: drmI830IrqEmit: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-
- if (0)
- fprintf(stderr, "%s --> %d\n", __FUNCTION__, seq );
-
- return seq;
-}
-
-static void intelWaitIrq( intelContextPtr intel, int seq )
-{
- drmI830IrqWait iw;
- int ret;
-
- if (0)
- fprintf(stderr, "%s %d\n", __FUNCTION__, seq );
-
- iw.irq_seq = seq;
-
- do {
- ret = drmCommandWrite( intel->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw) );
- } while (ret == -EAGAIN || ret == -EINTR);
-
- if ( ret ) {
- fprintf( stderr, "%s: drmI830IrqWait: %d\n", __FUNCTION__, ret );
- if (0)
- intel_dump_batchbuffer( intel->alloc.offset,
- intel->alloc.ptr,
- intel->alloc.size );
- exit(1);
- }
-}
-
-
-
-static void age_intel( intelContextPtr intel, int age )
-{
- GLuint i;
-
- for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++)
- if (intel->CurrentTexObj[i])
- intel->CurrentTexObj[i]->age = age;
-}
-
-void intel_dump_batchbuffer( long offset,
- int *ptr,
- int count )
-{
- int i;
- fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count);
- for (i = 0; i < count/4; i += 4)
- fprintf(stderr, "\t0x%lx: 0x%08x 0x%08x 0x%08x 0x%08x\n",
- (unsigned int)offset + i*4, ptr[i], ptr[i+1], ptr[i+2], ptr[i+3]);
- fprintf(stderr, "END BATCH\n\n\n");
-}
-
-void intelRefillBatchLocked( intelContextPtr intel, GLboolean allow_unlock )
-{
- GLuint last_irq = intel->alloc.irq_emitted;
- GLuint half = intel->alloc.size / 2;
- GLuint buf = (intel->alloc.active_buf ^= 1);
-
- intel->alloc.irq_emitted = intelEmitIrqLocked( intel );
-
- if (last_irq) {
- if (allow_unlock) UNLOCK_HARDWARE( intel );
- intelWaitIrq( intel, last_irq );
- if (allow_unlock) LOCK_HARDWARE( intel );
- }
-
- if (0)
- fprintf(stderr, "%s: now using half %d\n", __FUNCTION__, buf);
-
- intel->batch.start_offset = intel->alloc.offset + buf * half;
- intel->batch.ptr = (char *)intel->alloc.ptr + buf * half;
- intel->batch.size = half - 8;
- intel->batch.space = half - 8;
- assert(intel->batch.space >= 0);
-}
-
-#define MI_BATCH_BUFFER_END (0xA<<23)
-
-
-void intelFlushBatchLocked( intelContextPtr intel,
- GLboolean ignore_cliprects,
- GLboolean refill,
- GLboolean allow_unlock)
-{
- drmI830BatchBuffer batch;
-
- assert(intel->locked);
-
- if (0)
- fprintf(stderr, "%s used %d of %d offset %x..%x refill %d\n",
- __FUNCTION__,
- (intel->batch.size - intel->batch.space),
- intel->batch.size,
- intel->batch.start_offset,
- intel->batch.start_offset +
- (intel->batch.size - intel->batch.space),
- refill);
-
- /* Throw away non-effective packets. Won't work once we have
- * hardware contexts which would preserve statechanges beyond a
- * single buffer.
- */
- if (intel->numClipRects == 0 && !ignore_cliprects) {
-
- /* Without this yeild, an application with no cliprects can hog
- * the hardware. Without unlocking, the effect is much worse -
- * effectively a lock-out of other contexts.
- */
- if (allow_unlock) {
- UNLOCK_HARDWARE( intel );
- sched_yield();
- LOCK_HARDWARE( intel );
- }
-
- /* Note that any state thought to have been emitted actually
- * hasn't:
- */
- intel->batch.ptr -= (intel->batch.size - intel->batch.space);
- intel->batch.space = intel->batch.size;
- intel->vtbl.lost_hardware( intel );
- }
-
- if (intel->batch.space != intel->batch.size) {
- batch.start = intel->batch.start_offset;
- batch.used = intel->batch.size - intel->batch.space;
- batch.cliprects = intel->pClipRects;
- batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects;
- batch.DR1 = 0;
- batch.DR4 = ((((GLuint)intel->drawX) & 0xffff) |
- (((GLuint)intel->drawY) << 16));
-
- if (intel->alloc.offset) {
- if ((batch.used & 0x4) == 0) {
- ((int *)intel->batch.ptr)[0] = 0;
- ((int *)intel->batch.ptr)[1] = MI_BATCH_BUFFER_END;
- batch.used += 0x8;
- intel->batch.ptr += 0x8;
- }
- else {
- ((int *)intel->batch.ptr)[0] = MI_BATCH_BUFFER_END;
- batch.used += 0x4;
- intel->batch.ptr += 0x4;
- }
- }
-
- if (0)
- intel_dump_batchbuffer( batch.start,
- (int *)(intel->batch.ptr - batch.used),
- batch.used );
-
- if (0)
- fprintf(stderr, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n",
- __FUNCTION__,
- batch.start,
- batch.start + batch.used,
- batch.DR4, batch.num_cliprects);
-
- intel->batch.start_offset += batch.used;
- intel->batch.size -= batch.used;
-
- if (intel->batch.size < 8) {
- refill = GL_TRUE;
- intel->batch.space = intel->batch.size = 0;
- }
- else {
- intel->batch.size -= 8;
- intel->batch.space = intel->batch.size;
- }
-
-
- assert(intel->batch.space >= 0);
- assert(batch.start >= intel->alloc.offset);
- assert(batch.start < intel->alloc.offset + intel->alloc.size);
- assert(batch.start + batch.used > intel->alloc.offset);
- assert(batch.start + batch.used <=
- intel->alloc.offset + intel->alloc.size);
-
-
- if (intel->alloc.offset) {
- if (drmCommandWrite (intel->driFd, DRM_I830_BATCHBUFFER, &batch,
- sizeof(batch))) {
- fprintf(stderr, "DRM_I830_BATCHBUFFER: %d\n", -errno);
- UNLOCK_HARDWARE(intel);
- exit(1);
- }
- } else {
- drmI830CmdBuffer cmd;
- cmd.buf = (GLubyte *)intel->alloc.ptr + batch.start;
- cmd.sz = batch.used;
- cmd.DR1 = batch.DR1;
- cmd.DR4 = batch.DR4;
- cmd.num_cliprects = batch.num_cliprects;
- cmd.cliprects = batch.cliprects;
-
- if (drmCommandWrite (intel->driFd, DRM_I830_CMDBUFFER, &cmd,
- sizeof(cmd))) {
- fprintf(stderr, "DRM_I830_CMDBUFFER: %d\n", -errno);
- UNLOCK_HARDWARE(intel);
- exit(1);
- }
- }
-
-
- age_intel(intel, intel->sarea->last_enqueue);
-
- /* FIXME: use hardware contexts to avoid 'losing' hardware after
- * each buffer flush.
- */
- intel->vtbl.lost_hardware( intel );
- }
-
- if (refill)
- intelRefillBatchLocked( intel, allow_unlock );
-}
-
-void intelFlushBatch( intelContextPtr intel, GLboolean refill )
-{
- if (intel->locked) {
- intelFlushBatchLocked( intel, GL_FALSE, refill, GL_FALSE );
- }
- else {
- LOCK_HARDWARE(intel);
- intelFlushBatchLocked( intel, GL_FALSE, refill, GL_TRUE );
- UNLOCK_HARDWARE(intel);
- }
-}
-
-
-
-
-
-
-
-void intelWaitForIdle( intelContextPtr intel )
-{
- if (0)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- intel->vtbl.emit_flush( intel );
- intelFlushBatch( intel, GL_TRUE );
-
- /* Use an irq to wait for dma idle -- Need to track lost contexts
- * to shortcircuit consecutive calls to this function:
- */
- intelWaitIrq( intel, intel->alloc.irq_emitted );
- intel->alloc.irq_emitted = 0;
-}
-
-
-
-void intelFlush( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
-
- if (intel->Fallback)
- _swrast_flush( ctx );
-
- INTEL_FIREVERTICES( intel );
-
- if (intel->batch.size != intel->batch.space)
- intelFlushBatch( intel, GL_FALSE );
-}
-
-void intelFinish( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- intelFlush( ctx );
- intelWaitForIdle( intel );
-}
-
-
-void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
- GLbitfield tri_mask = 0;
- GLbitfield blit_mask = 0;
- GLbitfield swrast_mask = 0;
-
- if (0)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* Take care of cliprects, which are handled differently for
- * clears, etc.
- */
- intelFlush( &intel->ctx );
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- if (colorMask == ~0) {
- blit_mask |= BUFFER_BIT_FRONT_LEFT;
- }
- else {
- tri_mask |= BUFFER_BIT_FRONT_LEFT;
- }
- }
-
- if (mask & BUFFER_BIT_BACK_LEFT) {
- if (colorMask == ~0) {
- blit_mask |= BUFFER_BIT_BACK_LEFT;
- }
- else {
- tri_mask |= BUFFER_BIT_BACK_LEFT;
- }
- }
-
- if (mask & BUFFER_BIT_DEPTH) {
- blit_mask |= BUFFER_BIT_DEPTH;
- }
-
- if (mask & BUFFER_BIT_STENCIL) {
- if (!intel->hw_stencil) {
- swrast_mask |= BUFFER_BIT_STENCIL;
- }
- else if (ctx->Stencil.WriteMask[0] != 0xff) {
- tri_mask |= BUFFER_BIT_STENCIL;
- }
- else {
- blit_mask |= BUFFER_BIT_STENCIL;
- }
- }
-
- swrast_mask |= (mask & BUFFER_BIT_ACCUM);
-
- if (blit_mask)
- intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch );
-
- if (tri_mask)
- intel->vtbl.clear_with_tris( intel, tri_mask, all, cx, cy, cw, ch);
-
- if (swrast_mask)
- _swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch );
-}
-
-
-
-void *intelAllocateAGP( intelContextPtr intel, GLsizei size )
-{
- int region_offset = 0;
- drmI830MemAlloc alloc;
- int ret;
-
- if (0)
- fprintf(stderr, "%s: %d bytes\n", __FUNCTION__, size);
-
- alloc.region = I830_MEM_REGION_AGP;
- alloc.alignment = 0;
- alloc.size = size;
- alloc.region_offset = &region_offset;
-
- LOCK_HARDWARE(intel);
-
- /* Make sure the global heap is initialized
- */
- if (intel->texture_heaps[0])
- driAgeTextures( intel->texture_heaps[0] );
-
-
- ret = drmCommandWriteRead( intel->driFd,
- DRM_I830_ALLOC,
- &alloc, sizeof(alloc));
-
- if (ret) {
- fprintf(stderr, "%s: DRM_I830_ALLOC ret %d\n", __FUNCTION__, ret);
- UNLOCK_HARDWARE(intel);
- return NULL;
- }
-
- if (0)
- fprintf(stderr, "%s: allocated %d bytes\n", __FUNCTION__, size);
-
- /* Need to propogate this information (agp memory in use) to our
- * local texture lru. The kernel has already updated the global
- * lru. An alternative would have been to allocate memory the
- * usual way and then notify the kernel to pin the allocation.
- */
- if (intel->texture_heaps[0])
- driAgeTextures( intel->texture_heaps[0] );
-
- UNLOCK_HARDWARE(intel);
-
- return (void *)((char *)intel->intelScreen->tex.map + region_offset);
-}
-
-void intelFreeAGP( intelContextPtr intel, void *pointer )
-{
- int region_offset;
- drmI830MemFree memfree;
- int ret;
-
- region_offset = (char *)pointer - (char *)intel->intelScreen->tex.map;
-
- if (region_offset < 0 ||
- region_offset > intel->intelScreen->tex.size) {
- fprintf(stderr, "offset %d outside range 0..%d\n", region_offset,
- intel->intelScreen->tex.size);
- return;
- }
-
- memfree.region = I830_MEM_REGION_AGP;
- memfree.region_offset = region_offset;
-
- ret = drmCommandWrite( intel->driFd,
- DRM_I830_FREE,
- &memfree, sizeof(memfree));
-
- if (ret)
- fprintf(stderr, "%s: DRM_I830_FREE ret %d\n", __FUNCTION__, ret);
-}
-
-/* This version of AllocateMemoryMESA allocates only agp memory, and
- * only does so after the point at which the driver has been
- * initialized.
- *
- * Theoretically a valid context isn't required. However, in this
- * implementation, it is, as I'm using the hardware lock to protect
- * the kernel data structures, and the current context to get the
- * device fd.
- */
-void *intelAllocateMemoryMESA(__DRInativeDisplay *dpy, int scrn,
- GLsizei size, GLfloat readfreq,
- GLfloat writefreq, GLfloat priority)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (INTEL_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s sz %d %f/%f/%f\n", __FUNCTION__, size, readfreq,
- writefreq, priority);
-
- if (getenv("INTEL_NO_ALLOC"))
- return NULL;
-
- if (!ctx || INTEL_CONTEXT(ctx) == 0)
- return NULL;
-
- return intelAllocateAGP( INTEL_CONTEXT(ctx), size );
-}
-
-
-/* Called via glXFreeMemoryMESA() */
-void intelFreeMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (INTEL_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %p\n", __FUNCTION__, pointer);
-
- if (!ctx || INTEL_CONTEXT(ctx) == 0) {
- fprintf(stderr, "%s: no context\n", __FUNCTION__);
- return;
- }
-
- intelFreeAGP( INTEL_CONTEXT(ctx), pointer );
-}
-
-/* Called via glXGetMemoryOffsetMESA()
- *
- * Returns offset of pointer from the start of agp aperture.
- */
-GLuint intelGetMemoryOffsetMESA(__DRInativeDisplay *dpy, int scrn,
- const GLvoid *pointer)
-{
- GET_CURRENT_CONTEXT(ctx);
- intelContextPtr intel;
-
- if (!ctx || !(intel = INTEL_CONTEXT(ctx)) ) {
- fprintf(stderr, "%s: no context\n", __FUNCTION__);
- return ~0;
- }
-
- if (!intelIsAgpMemory( intel, pointer, 0 ))
- return ~0;
-
- return intelAgpOffsetFromVirtual( intel, pointer );
-}
-
-
-GLboolean intelIsAgpMemory( intelContextPtr intel, const GLvoid *pointer,
- GLint size )
-{
- int offset = (char *)pointer - (char *)intel->intelScreen->tex.map;
- int valid = (size >= 0 &&
- offset >= 0 &&
- offset + size < intel->intelScreen->tex.size);
-
- if (INTEL_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "intelIsAgpMemory( %p ) : %d\n", pointer, valid );
-
- return valid;
-}
-
-
-GLuint intelAgpOffsetFromVirtual( intelContextPtr intel, const GLvoid *pointer )
-{
- int offset = (char *)pointer - (char *)intel->intelScreen->tex.map;
-
- if (offset < 0 || offset > intel->intelScreen->tex.size)
- return ~0;
- else
- return intel->intelScreen->textureOffset + offset;
-}
-
-
-
-
-
-/* Flip the front & back buffes
- */
-void intelPageFlip( const __DRIdrawablePrivate *dPriv )
-{
-#if 0
- intelContextPtr intel;
- int tmp, ret;
-
- if (INTEL_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- intel = (intelContextPtr) dPriv->driContextPriv->driverPrivate;
-
- intelFlush( &intel->ctx );
- LOCK_HARDWARE( intel );
-
- if (dPriv->pClipRects) {
- *(drm_clip_rect_t *)intel->sarea->boxes = dPriv->pClipRects[0];
- intel->sarea->nbox = 1;
- }
-
- ret = drmCommandNone(intel->driFd, DRM_I830_FLIP);
- if (ret) {
- fprintf(stderr, "%s: %d\n", __FUNCTION__, ret);
- UNLOCK_HARDWARE( intel );
- exit(1);
- }
-
- tmp = intel->sarea->last_enqueue;
- intelRefillBatchLocked( intel );
- UNLOCK_HARDWARE( intel );
-
-
- intelSetDrawBuffer( &intel->ctx, intel->ctx.Color.DriverDrawBuffer );
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.h
deleted file mode 100644
index 7e6295167..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_ioctl.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef INTEL_IOCTL_H
-#define INTEL_IOCTL_H
-
-#include "intel_context.h"
-
-extern void intelWaitAgeLocked( intelContextPtr intel, int age, GLboolean unlock );
-
-extern void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch);
-
-extern void intelPageFlip( const __DRIdrawablePrivate *dpriv );
-extern void intelWaitForIdle( intelContextPtr intel );
-extern void intelFlushBatch( intelContextPtr intel, GLboolean refill );
-extern void intelFlushBatchLocked( intelContextPtr intel,
- GLboolean ignore_cliprects,
- GLboolean refill,
- GLboolean allow_unlock);
-extern void intelRefillBatchLocked( intelContextPtr intel, GLboolean allow_unlock );
-extern void intelFinish( GLcontext *ctx );
-extern void intelFlush( GLcontext *ctx );
-
-extern void *intelAllocateAGP( intelContextPtr intel, GLsizei size );
-extern void intelFreeAGP( intelContextPtr intel, void *pointer );
-
-extern void *intelAllocateMemoryMESA( __DRInativeDisplay *dpy, int scrn,
- GLsizei size, GLfloat readfreq,
- GLfloat writefreq, GLfloat priority );
-
-extern void intelFreeMemoryMESA( __DRInativeDisplay *dpy, int scrn,
- GLvoid *pointer );
-
-extern GLuint intelGetMemoryOffsetMESA( __DRInativeDisplay *dpy, int scrn, const GLvoid *pointer );
-extern GLboolean intelIsAgpMemory( intelContextPtr intel, const GLvoid *pointer,
- GLint size );
-
-extern GLuint intelAgpOffsetFromVirtual( intelContextPtr intel, const GLvoid *p );
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_pixel.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_pixel.c
deleted file mode 100644
index e56e46b4d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_pixel.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "swrast/swrast.h"
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "intel_ioctl.h"
-#include "intel_batchbuffer.h"
-
-
-
-static GLboolean
-check_color( const GLcontext *ctx, GLenum type, GLenum format,
- const struct gl_pixelstore_attrib *packing,
- const void *pixels, GLint sz, GLint pitch )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- GLuint cpp = intel->intelScreen->cpp;
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if ( (pitch & 63) ||
- ctx->_ImageTransferState ||
- packing->SwapBytes ||
- packing->LsbFirst) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: failed 1\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- if ( type == GL_UNSIGNED_INT_8_8_8_8_REV &&
- cpp == 4 &&
- format == GL_BGRA ) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: passed 2\n", __FUNCTION__);
- return GL_TRUE;
- }
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: failed\n", __FUNCTION__);
-
- return GL_FALSE;
-}
-
-static GLboolean
-check_color_per_fragment_ops( const GLcontext *ctx )
-{
- int result;
- result = (!( ctx->Color.AlphaEnabled ||
- ctx->Depth.Test ||
- ctx->Fog.Enabled ||
- ctx->Scissor.Enabled ||
- ctx->Stencil.Enabled ||
- !ctx->Color.ColorMask[0] ||
- !ctx->Color.ColorMask[1] ||
- !ctx->Color.ColorMask[2] ||
- !ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits ||
- ctx->Depth.OcclusionTest
- ) &&
- ctx->Current.RasterPosValid);
-
- return result;
-}
-
-
-
-static GLboolean
-clip_pixelrect( const GLcontext *ctx,
- const GLframebuffer *buffer,
- GLint *x, GLint *y,
- GLsizei *width, GLsizei *height,
- GLint *size )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- /* 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;
-
- *size = ((*y + *height - 1) * intel->intelScreen->frontPitch +
- (*x + *width - 1) * intel->intelScreen->cpp);
-
- return GL_TRUE;
-}
-
-static GLboolean
-intelTryReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- GLint size = 0;
- GLint pitch = pack->RowLength ? pack->RowLength : width;
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* Only accelerate reading to agp buffers.
- */
- if ( !intelIsAgpMemory(intel, pixels,
- pitch * height * intel->intelScreen->cpp ) ) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: dest not agp\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- /* Need GL_PACK_INVERT_MESA to cope with upsidedown results from
- * blitter:
- */
- if (!pack->Invert) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: MESA_PACK_INVERT not set\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- if (!check_color(ctx, type, format, pack, pixels, size, pitch))
- return GL_FALSE;
-
- switch ( intel->intelScreen->cpp ) {
- case 4:
- break;
- default:
- return GL_FALSE;
- }
-
-
- /* Although the blits go on the command buffer, need to do this and
- * fire with lock held to guarentee cliprects and drawOffset are
- * correct.
- *
- * This is an unusual situation however, as the code which flushes
- * a full command buffer expects to be called unlocked. As a
- * workaround, immediately flush the buffer on aquiring the lock.
- */
- intelFlush( &intel->ctx );
- LOCK_HARDWARE( intel );
- {
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- int nbox = dPriv->numClipRects;
- int src_offset = intel->drawOffset;
- int src_pitch = intel->intelScreen->frontPitch;
- int dst_offset = intelAgpOffsetFromVirtual( intel, pixels);
- drm_clip_rect_t *box = dPriv->pClipRects;
- int i;
-
- if (!clip_pixelrect(ctx, ctx->ReadBuffer, &x, &y, &width, &height,
- &size)) {
- UNLOCK_HARDWARE( intel );
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s totally clipped -- nothing to do\n",
- __FUNCTION__);
- return GL_TRUE;
- }
-
-
- y = dPriv->h - y - height;
- x += dPriv->x;
- y += dPriv->y;
-
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "readpixel blit src_pitch %d dst_pitch %d\n",
- src_pitch, pitch);
-
- for (i = 0 ; i < nbox ; i++)
- {
- GLint bx = box[i].x1;
- GLint by = box[i].y1;
- GLint bw = box[i].x2 - bx;
- GLint bh = box[i].y2 - by;
-
- if (bx < x) bw -= x - bx, bx = x;
- if (by < y) bh -= y - by, by = y;
- if (bx + bw > x + width) bw = x + width - bx;
- if (by + bh > y + height) bh = y + height - by;
- if (bw <= 0) continue;
- if (bh <= 0) continue;
-
- intelEmitCopyBlitLocked( intel,
- intel->intelScreen->cpp,
- src_pitch, src_offset,
- pitch, dst_offset,
- bx, by,
- bx - x, by - y,
- bw, bh );
- }
- }
- UNLOCK_HARDWARE( intel );
- intelFinish( &intel->ctx );
-
- return GL_TRUE;
-}
-
-static void
-intelReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!intelTryReadPixels( ctx, x, y, width, height, format, type, pack,
- pixels))
- _swrast_ReadPixels( ctx, x, y, width, height, format, type, pack,
- pixels);
-}
-
-
-
-
-static void do_draw_pix( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint pitch,
- const void *pixels,
- GLuint dest )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- drm_clip_rect_t *box = dPriv->pClipRects;
- int nbox = dPriv->numClipRects;
- int i;
- int size;
- int src_offset = intelAgpOffsetFromVirtual( intel, pixels);
- int src_pitch = pitch;
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- intelFlush( &intel->ctx );
- LOCK_HARDWARE( intel );
- if (ctx->DrawBuffer)
- {
- y -= height; /* cope with pixel zoom */
-
- if (!clip_pixelrect(ctx, ctx->DrawBuffer,
- &x, &y, &width, &height,
- &size)) {
- UNLOCK_HARDWARE( intel );
- return;
- }
-
- y = dPriv->h - y - height; /* convert from gl to hardware coords */
- x += dPriv->x;
- y += dPriv->y;
-
-
- for (i = 0 ; i < nbox ; i++ )
- {
- GLint bx = box[i].x1;
- GLint by = box[i].y1;
- GLint bw = box[i].x2 - bx;
- GLint bh = box[i].y2 - by;
-
- if (bx < x) bw -= x - bx, bx = x;
- if (by < y) bh -= y - by, by = y;
- if (bx + bw > x + width) bw = x + width - bx;
- if (by + bh > y + height) bh = y + height - by;
- if (bw <= 0) continue;
- if (bh <= 0) continue;
-
- intelEmitCopyBlitLocked( intel,
- intel->intelScreen->cpp,
- src_pitch, src_offset,
- intel->intelScreen->frontPitch,
- intel->drawOffset,
- bx - x, by - y,
- bx, by,
- bw, bh );
- }
- }
- UNLOCK_HARDWARE( intel );
- intelFinish( &intel->ctx );
-}
-
-
-
-
-static GLboolean
-intelTryDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- GLint pitch = unpack->RowLength ? unpack->RowLength : width;
- GLuint dest;
- GLuint cpp = intel->intelScreen->cpp;
- GLint size = width * pitch * cpp;
-
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch (format) {
- case GL_RGB:
- case GL_RGBA:
- case GL_BGRA:
- dest = intel->drawOffset;
-
- /* Planemask doesn't have full support in blits.
- */
- if (!ctx->Color.ColorMask[RCOMP] ||
- !ctx->Color.ColorMask[GCOMP] ||
- !ctx->Color.ColorMask[BCOMP] ||
- !ctx->Color.ColorMask[ACOMP]) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: planemask\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- /* Can't do conversions on agp reads/draws.
- */
- if ( !intelIsAgpMemory( intel, pixels, size ) ) {
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: not agp memory\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- if (!check_color(ctx, type, format, unpack, pixels, size, pitch)) {
- return GL_FALSE;
- }
- if (!check_color_per_fragment_ops(ctx)) {
- return GL_FALSE;
- }
-
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != -1.0F)
- return GL_FALSE;
- break;
-
- default:
- return GL_FALSE;
- }
-
- if ( intelIsAgpMemory(intel, pixels, size) )
- {
- do_draw_pix( ctx, x, y, width, height, pitch, pixels,
- dest );
- return GL_TRUE;
- }
- else if (0)
- {
- /* Pixels is in regular memory -- get dma buffers and perform
- * upload through them. No point doing this for regular uploads
- * but once we remove some of the restrictions above (colormask,
- * pixelformat conversion, zoom?, etc), this could be a win.
- */
- }
- else
- return GL_FALSE;
-}
-
-static void
-intelDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- if (INTEL_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!intelTryDrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels ))
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
-}
-
-
-
-
-/**
- * Implement glCopyPixels for the front color buffer (or back buffer Pixmap)
- * for the color buffer. Don't support zooming, pixel transfer, etc.
- * We do support copying from one window to another, ala glXMakeCurrentRead.
- */
-static void
-intelCopyPixels( GLcontext *ctx,
- GLint srcx, GLint srcy, GLsizei width, GLsizei height,
- GLint destx, GLint desty, GLenum type )
-{
-#if 0
- const XMesaContext xmesa = XMESA_CONTEXT(ctx);
- const SWcontext *swrast = SWRAST_CONTEXT( ctx );
- XMesaDisplay *dpy = xmesa->xm_visual->display;
- const XMesaDrawable drawBuffer = xmesa->xm_draw_buffer->buffer;
- const XMesaDrawable readBuffer = xmesa->xm_read_buffer->buffer;
- const XMesaGC gc = xmesa->xm_draw_buffer->gc;
-
- ASSERT(dpy);
- ASSERT(gc);
-
- if (drawBuffer && /* buffer != 0 means it's a Window or Pixmap */
- readBuffer &&
- type == GL_COLOR &&
- (swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */
- ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
- ctx->Pixel.ZoomX == 1.0 && /* no zooming */
- ctx->Pixel.ZoomY == 1.0) {
- /* Note: we don't do any special clipping work here. We could,
- * but X will do it for us.
- */
- srcy = FLIP(xmesa->xm_read_buffer, srcy) - height + 1;
- desty = FLIP(xmesa->xm_draw_buffer, desty) - height + 1;
- XCopyArea(dpy, readBuffer, drawBuffer, gc,
- srcx, srcy, width, height, destx, desty);
- }
-#else
- _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type );
-#endif
-}
-
-
-
-
-void intelInitPixelFuncs( struct dd_function_table *functions )
-{
- /* Pixel path fallbacks.
- */
- functions->Accum = _swrast_Accum;
- functions->Bitmap = _swrast_Bitmap;
- functions->CopyPixels = intelCopyPixels;
-
- if (!getenv("INTEL_NO_BLITS")) {
- functions->ReadPixels = intelReadPixels;
- functions->DrawPixels = intelDrawPixels;
- }
- else {
- functions->ReadPixels = _swrast_ReadPixels;
- functions->DrawPixels = _swrast_DrawPixels;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_reg.h
deleted file mode 100644
index 1ec153266..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_reg.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#ifndef _INTEL_REG_H_
-#define _INTEL_REG_H_
-
-
-
-#define CMD_3D (0x3<<29)
-
-
-#define _3DPRIMITIVE ((0x3<<29)|(0x1f<<24))
-#define PRIM_INDIRECT (1<<23)
-#define PRIM_INLINE (0<<23)
-#define PRIM_INDIRECT_SEQUENTIAL (0<<17)
-#define PRIM_INDIRECT_ELTS (1<<17)
-
-#define PRIM3D_TRILIST (0x0<<18)
-#define PRIM3D_TRISTRIP (0x1<<18)
-#define PRIM3D_TRISTRIP_RVRSE (0x2<<18)
-#define PRIM3D_TRIFAN (0x3<<18)
-#define PRIM3D_POLY (0x4<<18)
-#define PRIM3D_LINELIST (0x5<<18)
-#define PRIM3D_LINESTRIP (0x6<<18)
-#define PRIM3D_RECTLIST (0x7<<18)
-#define PRIM3D_POINTLIST (0x8<<18)
-#define PRIM3D_DIB (0x9<<18)
-#define PRIM3D_MASK (0x1f<<18)
-
-#define I915PACKCOLOR4444(r,g,b,a) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-#define I915PACKCOLOR1555(r,g,b,a) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define I915PACKCOLOR565(r,g,b) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define I915PACKCOLOR8888(r,g,b,a) \
- ((a<<24) | (r<<16) | (g<<8) | b)
-
-
-
-
-#define BR00_BITBLT_CLIENT 0x40000000
-#define BR00_OP_COLOR_BLT 0x10000000
-#define BR00_OP_SRC_COPY_BLT 0x10C00000
-#define BR13_SOLID_PATTERN 0x80000000
-
-#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|0x4)
-#define XY_COLOR_BLT_WRITE_ALPHA (1<<21)
-#define XY_COLOR_BLT_WRITE_RGB (1<<20)
-
-#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6)
-#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21)
-#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_render.c
deleted file mode 100644
index d9438ba0f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_render.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware acceleration where possible.
- *
- */
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "enums.h"
-
-#include "tnl/t_context.h"
-#include "tnl/t_vertex.h"
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "intel_tris.h"
-#include "intel_batchbuffer.h"
-#include "intel_reg.h"
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Try to simulate missing primitives with indexed vertices.
- */
-#define HAVE_POINTS 0 /* Has it, but can't use because subpixel has to
- * be adjusted for points on the INTEL/I845G
- */
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0 /* has it, template can't use it yet */
-#define HAVE_TRI_FANS 1
-#define HAVE_POLYGONS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-
-#define HAVE_ELTS 0
-
-static GLuint hw_prim[GL_POLYGON+1] = {
- 0,
- PRIM3D_LINELIST,
- PRIM3D_LINESTRIP,
- PRIM3D_LINESTRIP,
- PRIM3D_TRILIST,
- PRIM3D_TRISTRIP,
- PRIM3D_TRIFAN,
- 0,
- 0,
- PRIM3D_POLY
-};
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-static const int scale_prim[GL_POLYGON+1] = {
- 0, /* fallback case */
- 1,
- 2,
- 2,
- 1,
- 3,
- 3,
- 0, /* fallback case */
- 0, /* fallback case */
- 3
-};
-
-
-static void intelDmaPrimitive( intelContextPtr intel, GLenum prim )
-{
- if (0) fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(prim));
- INTEL_FIREVERTICES(intel);
- intel->vtbl.reduced_primitive_state( intel, reduced_prim[prim] );
- intelStartInlinePrimitive( intel, hw_prim[prim] );
-}
-
-
-#define LOCAL_VARS intelContextPtr intel = INTEL_CONTEXT(ctx)
-#define INIT( prim ) \
-do { \
- intelDmaPrimitive( intel, prim ); \
-} while (0)
-#define FLUSH() INTEL_FIREVERTICES( intel )
-
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- (((intel->alloc.size / 2) - 1500) / (intel->vertex_size*4))
-#define GET_CURRENT_VB_MAX_VERTS() GET_SUBSEQUENT_VB_MAX_VERTS()
-
-#define ALLOC_VERTS( nr ) \
- intelExtendInlinePrimitive( intel, (nr) * intel->vertex_size )
-
-#define EMIT_VERTS( ctx, j, nr, buf ) \
- _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf )
-
-#define TAG(x) intel_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-/* Heuristic to choose between the two render paths:
- */
-static GLboolean choose_render( intelContextPtr intel,
- struct vertex_buffer *VB )
-{
- int vertsz = intel->vertex_size;
- int cost_render = 0;
- int cost_fallback = 0;
- int nr_prims = 0;
- int nr_rprims = 0;
- int nr_rverts = 0;
- int rprim = intel->reduced_primitive;
- int i = 0;
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++) {
- GLuint prim = VB->Primitive[i].mode;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- nr_prims++;
- nr_rverts += length * scale_prim[prim & PRIM_MODE_MASK];
-
- if (reduced_prim[prim & PRIM_MODE_MASK] != rprim) {
- nr_rprims++;
- rprim = reduced_prim[prim & PRIM_MODE_MASK];
- }
- }
-
- /* One point for each generated primitive:
- */
- cost_render = nr_prims;
- cost_fallback = nr_rprims;
-
- /* One point for every 1024 dwords (4k) of dma:
- */
- cost_render += (vertsz * i) / 1024;
- cost_fallback += (vertsz * nr_rverts) / 1024;
-
- if (0)
- fprintf(stderr, "cost render: %d fallback: %d\n",
- cost_render, cost_fallback);
-
- if (cost_render > cost_fallback)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-static GLboolean intel_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- /* Don't handle clipping or indexed vertices.
- */
- if (intel->RenderIndex != 0 ||
- !intel_validate_render( ctx, VB ) ||
- !choose_render( intel, VB )) {
- return GL_TRUE;
- }
-
- tnl->clipspace.new_inputs |= VERT_BIT_POS;
-
- tnl->Driver.Render.Start( ctx );
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- intel_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length,
- prim );
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-const struct tnl_pipeline_stage _intel_render_stage =
-{
- "intel render",
- NULL,
- NULL,
- NULL,
- NULL,
- intel_run_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c
deleted file mode 100644
index 57c7504bf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
-#include "utils.h"
-#include "xmlpool.h"
-
-
-#include "intel_screen.h"
-
-#include "intel_tex.h"
-#include "intel_span.h"
-#include "intel_tris.h"
-#include "intel_ioctl.h"
-
-
-
-#include "i830_dri.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_FORCE_S3TC_ENABLE(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-const GLuint __driNConfigOptions = 1;
-
-extern const struct dri_extension card_extensions[];
-
-static void intelPrintDRIInfo(intelScreenPrivate *intelScreen,
- __DRIscreenPrivate *sPriv,
- I830DRIPtr gDRIPriv)
-{
- fprintf(stderr, "Front size : 0x%x\n", sPriv->fbSize);
- fprintf(stderr, "Front offset : 0x%x\n", intelScreen->frontOffset);
- fprintf(stderr, "Back size : 0x%x\n", intelScreen->back.size);
- fprintf(stderr, "Back offset : 0x%x\n", intelScreen->backOffset);
- fprintf(stderr, "Depth size : 0x%x\n", intelScreen->depth.size);
- fprintf(stderr, "Depth offset : 0x%x\n", intelScreen->depthOffset);
- fprintf(stderr, "Texture size : 0x%x\n", intelScreen->textureSize);
- fprintf(stderr, "Texture offset : 0x%x\n", intelScreen->textureOffset);
- fprintf(stderr, "Memory : 0x%x\n", gDRIPriv->mem);
-}
-
-static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
-{
- intelScreenPrivate *intelScreen;
- I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- intelScreen = (intelScreenPrivate *)CALLOC(sizeof(intelScreenPrivate));
- if (!intelScreen) {
- fprintf(stderr,"\nERROR! Allocating private area failed\n");
- return GL_FALSE;
- }
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&intelScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- intelScreen->driScrnPriv = sPriv;
- sPriv->private = (void *)intelScreen;
-
- intelScreen->deviceID = gDRIPriv->deviceID;
- intelScreen->width = gDRIPriv->width;
- intelScreen->height = gDRIPriv->height;
- intelScreen->mem = gDRIPriv->mem;
- intelScreen->cpp = gDRIPriv->cpp;
- intelScreen->frontPitch = gDRIPriv->fbStride;
- intelScreen->frontOffset = gDRIPriv->fbOffset;
-
- switch (gDRIPriv->bitsPerPixel) {
- case 15: intelScreen->fbFormat = DV_PF_555; break;
- case 16: intelScreen->fbFormat = DV_PF_565; break;
- case 32: intelScreen->fbFormat = DV_PF_8888; break;
- }
-
- intelScreen->backOffset = gDRIPriv->backOffset;
- intelScreen->backPitch = gDRIPriv->backPitch;
- intelScreen->depthOffset = gDRIPriv->depthOffset;
- intelScreen->depthPitch = gDRIPriv->depthPitch;
- intelScreen->textureOffset = gDRIPriv->textureOffset;
- intelScreen->textureSize = gDRIPriv->textureSize;
- intelScreen->logTextureGranularity = gDRIPriv->logTextureGranularity;
- intelScreen->back.handle = gDRIPriv->backbuffer;
- intelScreen->back.size = gDRIPriv->backbufferSize;
-
- if (drmMap(sPriv->fd,
- intelScreen->back.handle,
- intelScreen->back.size,
- (drmAddress *)&intelScreen->back.map) != 0) {
- fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
- __LINE__, __FUNCTION__, __FILE__);
- FREE(intelScreen);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- intelScreen->depth.handle = gDRIPriv->depthbuffer;
- intelScreen->depth.size = gDRIPriv->depthbufferSize;
-
- if (drmMap(sPriv->fd,
- intelScreen->depth.handle,
- intelScreen->depth.size,
- (drmAddress *)&intelScreen->depth.map) != 0) {
- fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
- __LINE__, __FUNCTION__, __FILE__);
- FREE(intelScreen);
- drmUnmap(intelScreen->back.map, intelScreen->back.size);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- intelScreen->tex.handle = gDRIPriv->textures;
- intelScreen->tex.size = gDRIPriv->textureSize;
-
- if (drmMap(sPriv->fd,
- intelScreen->tex.handle,
- intelScreen->tex.size,
- (drmAddress *)&intelScreen->tex.map) != 0) {
- fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
- __LINE__, __FUNCTION__, __FILE__);
- FREE(intelScreen);
- drmUnmap(intelScreen->back.map, intelScreen->back.size);
- drmUnmap(intelScreen->depth.map, intelScreen->depth.size);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
-
- if (0) intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
-
- intelScreen->drmMinor = sPriv->drmMinor;
-
- {
- int ret;
- drmI830GetParam gp;
-
- gp.param = I830_PARAM_IRQ_ACTIVE;
- gp.value = &intelScreen->irq_active;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_I830_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drmI830GetParam: %d\n", ret);
- return GL_FALSE;
- }
- }
-
- {
- int ret;
- drmI830GetParam gp;
-
- gp.param = I830_PARAM_ALLOW_BATCHBUFFER;
- gp.value = &intelScreen->allow_batchbuffer;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_I830_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drmI830GetParam: (%d) %d\n", gp.param, ret);
- return GL_FALSE;
- }
- }
-
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
- (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
- }
-
- sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA;
- sPriv->psc->freeMemory = (void *) intelFreeMemoryMESA;
- sPriv->psc->memoryOffset = (void *) intelGetMemoryOffsetMESA;
-
- return GL_TRUE;
-}
-
-
-static void intelDestroyScreen(__DRIscreenPrivate *sPriv)
-{
- intelScreenPrivate *intelScreen = (intelScreenPrivate *)sPriv->private;
-
- /* Need to unmap all the bufs and maps here:
- */
- drmUnmap(intelScreen->back.map, intelScreen->back.size);
- drmUnmap(intelScreen->depth.map, intelScreen->depth.size);
- drmUnmap(intelScreen->tex.map, intelScreen->tex.size);
- FREE(intelScreen);
- sPriv->private = NULL;
-}
-
-
-static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- intelScreenPrivate *screen = (intelScreenPrivate *) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- } else {
- GLboolean swStencil = (mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24);
-
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- intelSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- intelSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- intelSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- intelSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- intelSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-static void intelDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-/* There are probably better ways to do this, such as an
- * init-designated function to register chipids and createcontext
- * functions.
- */
-extern GLboolean i830CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-extern GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-
-
-
-static GLboolean intelCreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- intelScreenPrivate *intelScreen = (intelScreenPrivate *)sPriv->private;
-
- switch (intelScreen->deviceID) {
- case PCI_CHIP_845_G:
- case PCI_CHIP_I830_M:
- case PCI_CHIP_I855_GM:
- case PCI_CHIP_I865_G:
- return i830CreateContext( mesaVis, driContextPriv,
- sharedContextPrivate );
-
- case PCI_CHIP_I915_G:
- case PCI_CHIP_I915_GM:
- case PCI_CHIP_I945_G:
- return i915CreateContext( mesaVis, driContextPriv,
- sharedContextPrivate );
-
- default:
- fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID);
- return GL_FALSE;
- }
-}
-
-
-static const struct __DriverAPIRec intelAPI = {
- .InitDriver = intelInitDriver,
- .DestroyScreen = intelDestroyScreen,
- .CreateContext = intelCreateContext,
- .DestroyContext = intelDestroyContext,
- .CreateBuffer = intelCreateBuffer,
- .DestroyBuffer = intelDestroyBuffer,
- .SwapBuffers = intelSwapBuffers,
- .MakeCurrent = intelMakeCurrent,
- .UnbindContext = intelUnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = NULL,
- .WaitForMSC = NULL,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-static __GLcontextModes *
-intelFillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
- * support pageflipping at all.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
- };
-
- u_int8_t depth_bits_array[3];
- u_int8_t stencil_bits_array[3];
-
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = depth_bits;
- depth_bits_array[2] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = 0;
- stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
- back_buffer_factor = (have_back_buffer) ? 3 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 4, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 1, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "i915",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &intelAPI);
- if ( psp != NULL ) {
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
- *driver_modes = intelFillInModes( dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.h
deleted file mode 100644
index f2fb1c6bc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_screen.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef _INTEL_INIT_H_
-#define _INTEL_INIT_H_
-
-#include <sys/time.h>
-#include "dri_util.h"
-#include "xmlconfig.h"
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
- char *map;
-} intelRegion;
-
-typedef struct
-{
- intelRegion front;
- intelRegion back;
- intelRegion depth;
- intelRegion tex;
-
- int deviceID;
- int width;
- int height;
- int mem;
-
- int cpp; /* for front and back buffers */
- int bitsPerPixel;
-
- int fbFormat;
-
- int frontOffset;
- int frontPitch;
-
- int backOffset;
- int backPitch;
-
- int depthOffset;
- int depthPitch;
-
-
- int textureOffset;
- int textureSize;
- int logTextureGranularity;
-
- __DRIscreenPrivate *driScrnPriv;
- unsigned int sarea_priv_offset;
-
- int drmMinor;
-
- int irq_active;
- int allow_batchbuffer;
-
- /**
- * Configuration cache with default values for all contexts
- */
- driOptionCache optionCache;
-} intelScreenPrivate;
-
-
-extern void
-intelDestroyContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-intelUnbindContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv);
-
-extern void
-intelSwapBuffers( __DRIdrawablePrivate *dPriv);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.c
deleted file mode 100644
index 3522f4f38..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-
-#include "intel_screen.h"
-
-#include "intel_span.h"
-#include "intel_ioctl.h"
-#include "swrast/swrast.h"
-
-
-#define DBG 0
-
-#define LOCAL_VARS \
- intelContextPtr intel = INTEL_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = intel->driDrawable; \
- intelScreenPrivate *intelScreen = intel->intelScreen; \
- GLuint pitch = intelScreen->backPitch * intelScreen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(intel->drawMap + \
- dPriv->x * intelScreen->cpp + \
- dPriv->y * pitch); \
- char *read_buf = (char *)(intel->readMap + \
- dPriv->x * intelScreen->cpp + \
- dPriv->y * pitch); \
- GLushort p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- intelContextPtr intel = INTEL_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = intel->driDrawable; \
- intelScreenPrivate *intelScreen = intel->intelScreen; \
- GLuint pitch = intelScreen->backPitch * intelScreen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(intelScreen->depth.map + \
- dPriv->x * intelScreen->cpp + \
- dPriv->y * pitch)
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define INIT_MONO_PIXEL(p,color)\
- p = INTEL_PACKCOLOR565(color[0],color[1],color[2])
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-/* 16 bit, 565 rgb color spanline and pixel functions
- */
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ( (((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (((p >> 11) & 0x1f) * 255) / 31; \
- rgba[1] = (((p >> 5) & 0x3f) * 255) / 63; \
- rgba[2] = (((p >> 0) & 0x1f) * 255) / 31; \
- rgba[3] = 255; \
-} while(0)
-
-#define TAG(x) intel##x##_565
-#include "spantmp.h"
-
-/* 15 bit, 555 rgb color spanline and pixel functions
- */
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = (((r & 0xf8) << 7) | \
- ((g & 0xf8) << 3) | \
- ((b & 0xf8) >> 3))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (p >> 7) & 0xf8; \
- rgba[1] = (p >> 3) & 0xf8; \
- rgba[2] = (p << 3) & 0xf8; \
- rgba[3] = 255; \
-} while(0)
-
-#define TAG(x) intel##x##_555
-#include "spantmp.h"
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
-
-
-#define TAG(x) intel##x##_16
-#include "depthtmp.h"
-
-
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- intelContextPtr intel = INTEL_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = intel->driDrawable; \
- intelScreenPrivate *intelScreen = intel->intelScreen; \
- GLuint pitch = intelScreen->backPitch * intelScreen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(intel->drawMap + \
- dPriv->x * intelScreen->cpp + \
- dPriv->y * pitch); \
- char *read_buf = (char *)(intel->readMap + \
- dPriv->x * intelScreen->cpp + \
- dPriv->y * pitch); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p,color)\
- p = INTEL_PACKCOLOR8888(color[0],color[1],color[2],color[3])
-
-/* 32 bit, 8888 argb color spanline and pixel functions
- */
-#define WRITE_RGBA(_x, _y, r, g, b, a) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = ((r << 16) | \
- (g << 8) | \
- (b << 0) | \
- (a << 24) )
-
-#define WRITE_PIXEL(_x, _y, p) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = p
-
-
-#define READ_RGBA(rgba, _x, _y) \
- do { \
- GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
- } while (0)
-
-#define TAG(x) intel##x##_8888
-#include "spantmp.h"
-
-
-/* 24/8 bit interleaved depth/stencil functions
- */
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \
- tmp &= 0xff000000; \
- tmp |= (d) & 0xffffff; \
- *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch) & 0xffffff;
-
-
-#define TAG(x) intel##x##_24_8
-#include "depthtmp.h"
-
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \
- tmp &= 0xffffff; \
- tmp |= ((d)<<24); \
- *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch) >> 24;
-
-#define TAG(x) intel##x##_24_8
-#include "stenciltmp.h"
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void intelSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLuint bufferBit)
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- if (bufferBit == BUFFER_BIT_FRONT_LEFT) {
- intel->drawMap = (char *)intel->driScreen->pFB;
- intel->readMap = (char *)intel->driScreen->pFB;
- } else if (bufferBit == BUFFER_BIT_BACK_LEFT) {
- intel->drawMap = intel->intelScreen->back.map;
- intel->readMap = intel->intelScreen->back.map;
- } else {
- ASSERT(0);
- }
-}
-
-
-/* Move locking out to get reasonable span performance.
- */
-void intelSpanRenderStart( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- intelFlush(&intel->ctx);
- LOCK_HARDWARE(intel);
- intelWaitForIdle(intel);
-}
-
-void intelSpanRenderFinish( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( intel );
-}
-
-void intelInitSpanFuncs( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- intelScreenPrivate *intelScreen = intel->intelScreen;
-
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = intelSetBuffer;
-
- switch (intelScreen->fbFormat) {
- case DV_PF_555:
-#if 0
- swdd->WriteRGBASpan = intelWriteRGBASpan_555;
- swdd->WriteRGBSpan = intelWriteRGBSpan_555;
- swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_555;
- swdd->WriteRGBAPixels = intelWriteRGBAPixels_555;
- swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_555;
- swdd->ReadRGBASpan = intelReadRGBASpan_555;
- swdd->ReadRGBAPixels = intelReadRGBAPixels_555;
- swdd->ReadDepthSpan = intelReadDepthSpan_16;
- swdd->WriteDepthSpan = intelWriteDepthSpan_16;
- swdd->ReadDepthPixels = intelReadDepthPixels_16;
- swdd->WriteDepthPixels = intelWriteDepthPixels_16;
-#endif
- break;
-
- case DV_PF_565:
-#if 0
- swdd->WriteRGBASpan = intelWriteRGBASpan_565;
- swdd->WriteRGBSpan = intelWriteRGBSpan_565;
- swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_565;
- swdd->WriteRGBAPixels = intelWriteRGBAPixels_565;
- swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_565;
- swdd->ReadRGBASpan = intelReadRGBASpan_565;
- swdd->ReadRGBAPixels = intelReadRGBAPixels_565;
- swdd->ReadDepthSpan = intelReadDepthSpan_16;
- swdd->WriteDepthSpan = intelWriteDepthSpan_16;
- swdd->ReadDepthPixels = intelReadDepthPixels_16;
- swdd->WriteDepthPixels = intelWriteDepthPixels_16;
-#endif
- break;
-
- case DV_PF_8888:
-#if 0
- swdd->WriteRGBASpan = intelWriteRGBASpan_8888;
- swdd->WriteRGBSpan = intelWriteRGBSpan_8888;
- swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_8888;
- swdd->WriteRGBAPixels = intelWriteRGBAPixels_8888;
- swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_8888;
- swdd->ReadRGBASpan = intelReadRGBASpan_8888;
- swdd->ReadRGBAPixels = intelReadRGBAPixels_8888;
- swdd->ReadDepthSpan = intelReadDepthSpan_24_8;
- swdd->WriteDepthSpan = intelWriteDepthSpan_24_8;
- swdd->ReadDepthPixels = intelReadDepthPixels_24_8;
- swdd->WriteDepthPixels = intelWriteDepthPixels_24_8;
-
- swdd->WriteStencilSpan = intelWriteStencilSpan_24_8;
- swdd->ReadStencilSpan = intelReadStencilSpan_24_8;
- swdd->WriteStencilPixels = intelWriteStencilPixels_24_8;
- swdd->ReadStencilPixels = intelReadStencilPixels_24_8;
-#endif
- break;
- }
-
- swdd->SpanRenderStart = intelSpanRenderStart;
- swdd->SpanRenderFinish = intelSpanRenderFinish;
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-intelSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
- drb->Base.GetRow = intelReadRGBASpan_555;
- drb->Base.GetValues = intelReadRGBAPixels_555;
- drb->Base.PutRow = intelWriteRGBASpan_555;
- drb->Base.PutRowRGB = intelWriteRGBSpan_555;
- drb->Base.PutMonoRow = intelWriteMonoRGBASpan_555;
- drb->Base.PutValues = intelWriteRGBAPixels_555;
- drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_555;
- }
- else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = intelReadRGBASpan_565;
- drb->Base.GetValues = intelReadRGBAPixels_565;
- drb->Base.PutRow = intelWriteRGBASpan_565;
- drb->Base.PutRowRGB = intelWriteRGBSpan_565;
- drb->Base.PutMonoRow = intelWriteMonoRGBASpan_565;
- drb->Base.PutValues = intelWriteRGBAPixels_565;
- drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_565;
- }
- else {
- assert(vis->redBits == 8);
- assert(vis->greenBits == 8);
- assert(vis->blueBits == 8);
- drb->Base.GetRow = intelReadRGBASpan_8888;
- drb->Base.GetValues = intelReadRGBAPixels_8888;
- drb->Base.PutRow = intelWriteRGBASpan_8888;
- drb->Base.PutRowRGB = intelWriteRGBSpan_8888;
- drb->Base.PutMonoRow = intelWriteMonoRGBASpan_8888;
- drb->Base.PutValues = intelWriteRGBAPixels_8888;
- drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_8888;
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = intelReadDepthSpan_16;
- drb->Base.GetValues = intelReadDepthPixels_16;
- drb->Base.PutRow = intelWriteDepthSpan_16;
- drb->Base.PutMonoRow = intelWriteMonoDepthSpan_16;
- drb->Base.PutValues = intelWriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = intelReadDepthSpan_24_8;
- drb->Base.GetValues = intelReadDepthPixels_24_8;
- drb->Base.PutRow = intelWriteDepthSpan_24_8;
- drb->Base.PutMonoRow = intelWriteMonoDepthSpan_24_8;
- drb->Base.PutValues = intelWriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = intelReadStencilSpan_24_8;
- drb->Base.GetValues = intelReadStencilPixels_24_8;
- drb->Base.PutRow = intelWriteStencilSpan_24_8;
- drb->Base.PutMonoRow = intelWriteMonoStencilSpan_24_8;
- drb->Base.PutValues = intelWriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.h
deleted file mode 100644
index 2d4f8589d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_span.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef _INTEL_SPAN_H
-#define _INTEL_SPAN_H
-
-#include "drirenderbuffer.h"
-
-extern void intelInitSpanFuncs( GLcontext *ctx );
-
-extern void intelSpanRenderFinish( GLcontext *ctx );
-extern void intelSpanRenderStart( GLcontext *ctx );
-
-extern void
-intelSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_state.c
deleted file mode 100644
index cf1f3c580..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_state.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "swrast/swrast.h"
-
-int intel_translate_compare_func( GLenum func )
-{
- switch(func) {
- case GL_NEVER:
- return COMPAREFUNC_NEVER;
- case GL_LESS:
- return COMPAREFUNC_LESS;
- case GL_LEQUAL:
- return COMPAREFUNC_LEQUAL;
- case GL_GREATER:
- return COMPAREFUNC_GREATER;
- case GL_GEQUAL:
- return COMPAREFUNC_GEQUAL;
- case GL_NOTEQUAL:
- return COMPAREFUNC_NOTEQUAL;
- case GL_EQUAL:
- return COMPAREFUNC_EQUAL;
- case GL_ALWAYS:
- return COMPAREFUNC_ALWAYS;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
- return COMPAREFUNC_ALWAYS;
-}
-
-int intel_translate_stencil_op( GLenum op )
-{
- switch(op) {
- case GL_KEEP:
- return STENCILOP_KEEP;
- case GL_ZERO:
- return STENCILOP_ZERO;
- case GL_REPLACE:
- return STENCILOP_REPLACE;
- case GL_INCR:
- return STENCILOP_INCRSAT;
- case GL_DECR:
- return STENCILOP_DECRSAT;
- case GL_INCR_WRAP:
- return STENCILOP_INCR;
- case GL_DECR_WRAP:
- return STENCILOP_DECR;
- case GL_INVERT:
- return STENCILOP_INVERT;
- default:
- return STENCILOP_ZERO;
- }
-}
-
-int intel_translate_blend_factor( GLenum factor )
-{
- switch(factor) {
- case GL_ZERO:
- return BLENDFACT_ZERO;
- case GL_SRC_ALPHA:
- return BLENDFACT_SRC_ALPHA;
- case GL_ONE:
- return BLENDFACT_ONE;
- case GL_SRC_COLOR:
- return BLENDFACT_SRC_COLR;
- case GL_ONE_MINUS_SRC_COLOR:
- return BLENDFACT_INV_SRC_COLR;
- case GL_DST_COLOR:
- return BLENDFACT_DST_COLR;
- case GL_ONE_MINUS_DST_COLOR:
- return BLENDFACT_INV_DST_COLR;
- case GL_ONE_MINUS_SRC_ALPHA:
- return BLENDFACT_INV_SRC_ALPHA;
- case GL_DST_ALPHA:
- return BLENDFACT_DST_ALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return BLENDFACT_INV_DST_ALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return BLENDFACT_SRC_ALPHA_SATURATE;
- case GL_CONSTANT_COLOR:
- return BLENDFACT_CONST_COLOR;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- return BLENDFACT_INV_CONST_COLOR;
- case GL_CONSTANT_ALPHA:
- return BLENDFACT_CONST_ALPHA;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- return BLENDFACT_INV_CONST_ALPHA;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor);
- return BLENDFACT_ZERO;
-}
-
-int intel_translate_logic_op( GLenum opcode )
-{
- switch(opcode) {
- case GL_CLEAR:
- return LOGICOP_CLEAR;
- case GL_AND:
- return LOGICOP_AND;
- case GL_AND_REVERSE:
- return LOGICOP_AND_RVRSE;
- case GL_COPY:
- return LOGICOP_COPY;
- case GL_COPY_INVERTED:
- return LOGICOP_COPY_INV;
- case GL_AND_INVERTED:
- return LOGICOP_AND_INV;
- case GL_NOOP:
- return LOGICOP_NOOP;
- case GL_XOR:
- return LOGICOP_XOR;
- case GL_OR:
- return LOGICOP_OR;
- case GL_OR_INVERTED:
- return LOGICOP_OR_INV;
- case GL_NOR:
- return LOGICOP_NOR;
- case GL_EQUIV:
- return LOGICOP_EQUIV;
- case GL_INVERT:
- return LOGICOP_INV;
- case GL_OR_REVERSE:
- return LOGICOP_OR_RVRSE;
- case GL_NAND:
- return LOGICOP_NAND;
- case GL_SET:
- return LOGICOP_SET;
- default:
- return LOGICOP_SET;
- }
-}
-
-static void intelDrawBuffer(GLcontext *ctx, GLenum mode )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- intelScreenPrivate *screen = intel->intelScreen;
- int front = 0;
-
- if (!ctx->DrawBuffer)
- return;
-
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- front = 1;
- FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case BUFFER_BIT_BACK_LEFT:
- front = 0;
- FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that r200SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- if ( intel->sarea->pf_current_page == 1 )
- front ^= 1;
-
- intelSetFrontClipRects( intel );
-
- if (front) {
- intel->drawOffset = screen->frontOffset;
- intel->drawMap = (char *)intel->driScreen->pFB;
- intel->readMap = (char *)intel->driScreen->pFB;
- } else {
- intel->drawOffset = screen->backOffset;
- intel->drawMap = screen->back.map;
- intel->readMap = screen->back.map;
- }
-
- intel->vtbl.set_draw_offset( intel, intel->drawOffset );
-}
-
-static void intelReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-
-static void intelClearColor(GLcontext *ctx, const GLfloat color[4])
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- intelScreenPrivate *screen = intel->intelScreen;
-
- CLAMPED_FLOAT_TO_UBYTE(intel->clear_red, color[0]);
- CLAMPED_FLOAT_TO_UBYTE(intel->clear_green, color[1]);
- CLAMPED_FLOAT_TO_UBYTE(intel->clear_blue, color[2]);
- CLAMPED_FLOAT_TO_UBYTE(intel->clear_alpha, color[3]);
-
- intel->ClearColor = INTEL_PACKCOLOR(screen->fbFormat,
- intel->clear_red,
- intel->clear_green,
- intel->clear_blue,
- intel->clear_alpha);
-}
-
-
-static void intelCalcViewport( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = intel->ViewportMatrix.m;
-
- /* See also intel_translate_vertex. SUBPIXEL adjustments can be done
- * via state vars, too.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + intel->driDrawable->h + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * intel->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * intel->depth_scale;
-}
-
-static void intelViewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- intelCalcViewport( ctx );
-}
-
-static void intelDepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- intelCalcViewport( ctx );
-}
-
-/* Fallback to swrast for select and feedback.
- */
-static void intelRenderMode( GLcontext *ctx, GLenum mode )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- FALLBACK( intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
-}
-
-
-void intelInitStateFuncs( struct dd_function_table *functions )
-{
- functions->DrawBuffer = intelDrawBuffer;
- functions->ReadBuffer = intelReadBuffer;
- functions->RenderMode = intelRenderMode;
- functions->Viewport = intelViewport;
- functions->DepthRange = intelDepthRange;
- functions->ClearColor = intelClearColor;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.c
deleted file mode 100644
index 5fc904e60..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.c
+++ /dev/null
@@ -1,831 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "image.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texmem.h"
-#include "texobj.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-#include "intel_context.h"
-#include "intel_tex.h"
-#include "intel_ioctl.h"
-
-
-
-static GLboolean
-intelValidateClientStorage( intelContextPtr intel, GLenum target,
- GLint internalFormat,
- GLint srcWidth, GLint srcHeight,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-
-{
- GLcontext *ctx = &intel->ctx;
- int texelBytes;
-
- if (0)
- fprintf(stderr, "intformat %s format %s type %s\n",
- _mesa_lookup_enum_by_nr( internalFormat ),
- _mesa_lookup_enum_by_nr( format ),
- _mesa_lookup_enum_by_nr( type ));
-
- if (!ctx->Unpack.ClientStorage)
- return 0;
-
- if (ctx->_ImageTransferState ||
- texImage->IsCompressed ||
- texObj->GenerateMipmap)
- return 0;
-
-
- /* This list is incomplete
- */
- switch ( internalFormat ) {
- case GL_RGBA:
- if ( format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
- texImage->TexFormat = &_mesa_texformat_argb8888;
- texelBytes = 4;
- }
- else
- return 0;
- break;
-
- case GL_RGB:
- if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
- texImage->TexFormat = &_mesa_texformat_rgb565;
- texelBytes = 2;
- }
- else
- return 0;
- break;
-
- case GL_YCBCR_MESA:
- if ( format == GL_YCBCR_MESA &&
- type == GL_UNSIGNED_SHORT_8_8_REV_APPLE ) {
- texImage->TexFormat = &_mesa_texformat_ycbcr_rev;
- texelBytes = 2;
- }
- else if ( format == GL_YCBCR_MESA &&
- (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)) {
- texImage->TexFormat = &_mesa_texformat_ycbcr;
- texelBytes = 2;
- }
- else
- return 0;
- break;
-
-
- default:
- return 0;
- }
-
- /* Could deal with these packing issues, but currently don't:
- */
- if (packing->SkipPixels ||
- packing->SkipRows ||
- packing->SwapBytes ||
- packing->LsbFirst) {
- return 0;
- }
-
- {
- GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth,
- format, type);
-
-
- if (0)
- fprintf(stderr, "%s: srcRowStride %d/%x\n",
- __FUNCTION__, srcRowStride, srcRowStride);
-
- /* Could check this later in upload, pitch restrictions could be
- * relaxed, but would need to store the image pitch somewhere,
- * as packing details might change before image is uploaded:
- */
- if (!intelIsAgpMemory( intel, pixels, srcHeight * srcRowStride ) ||
- (srcRowStride & 63))
- return 0;
-
-
- /* Have validated that _mesa_transfer_teximage would be a straight
- * memcpy at this point. NOTE: future calls to TexSubImage will
- * overwrite the client data. This is explicitly mentioned in the
- * extension spec.
- */
- texImage->Data = (void *)pixels;
- texImage->IsClientData = GL_TRUE;
- texImage->RowStride = srcRowStride / texelBytes;
- return 1;
- }
-}
-
-
-
-static void intelTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert(t);
- intelFlush( ctx );
- driSwapOutTextureObject( t );
-
- texImage->IsClientData = GL_FALSE;
-
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, packing, texObj, texImage );
-
- t->dirty_images[0] |= (1 << level);
-}
-
-static void intelTexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert(t);
- intelFlush( ctx );
- driSwapOutTextureObject( t );
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-}
-
-
-/* Handles 2D, CUBE, RECT:
- */
-static void intelTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert(t);
- intelFlush( ctx );
- driSwapOutTextureObject( t );
- texImage->IsClientData = GL_FALSE;
-
- if (intelValidateClientStorage( INTEL_CONTEXT(ctx), target,
- internalFormat,
- width, height,
- format, type, pixels,
- packing, texObj, texImage)) {
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using client storage\n", __FUNCTION__);
- }
- else {
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
-
- t->dirty_images[face] |= (1 << level);
- }
-}
-
-static void intelTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if (texImage->IsClientData &&
- (char *)pixels == (char *)texImage->Data +
- ((xoffset + yoffset * texImage->RowStride) *
- texImage->TexFormat->TexelBytes)) {
-
- /* Notification only - no upload required */
- }
- else {
- assert( t ); /* this _should_ be true */
- intelFlush( ctx );
- driSwapOutTextureObject( t );
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[face] |= (1 << level);
- }
-}
-
-static void intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert(t);
- intelFlush( ctx );
-
- driSwapOutTextureObject( t );
- texImage->IsClientData = GL_FALSE;
-
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
-
- _mesa_store_compressed_teximage2d(ctx, target, level, internalFormat, width,
- height, border, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void intelCompressedTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert( t ); /* this _should_ be true */
- intelFlush( ctx );
- driSwapOutTextureObject( t );
-
- _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void intelTexImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert(t);
- driSwapOutTextureObject( t );
- texImage->IsClientData = GL_FALSE;
-
- _mesa_store_teximage3d(ctx, target, level, internalFormat,
- width, height, depth, border,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void
-intelTexSubImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- driSwapOutTextureObject( t );
-
- _mesa_store_texsubimage3d(ctx, target, level, xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels, packing, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-
-
-static void intelDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- driTextureObject * t = (driTextureObject *) tObj->DriverData;
-
- if ( t != NULL ) {
- intelFlush( ctx );
- driDestroyTextureObject( t );
- }
-
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-
-static const struct gl_texture_format *
-intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- const GLboolean do32bpt = ( intel->intelScreen->cpp == 4 &&
- intel->intelScreen->textureSize > 4*1024*1024);
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- if ( format == GL_BGRA ) {
- if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
- return &_mesa_texformat_argb8888;
- }
- else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
- return &_mesa_texformat_argb4444;
- }
- else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
- }
- }
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
- return &_mesa_texformat_rgb565;
- }
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_a8;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_l8;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return &_mesa_texformat_al88;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_i8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return &_mesa_texformat_rgb_fxt1;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return &_mesa_texformat_rgba_fxt1;
-
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
-
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
-
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT16:
- case GL_DEPTH_COMPONENT24:
- case GL_DEPTH_COMPONENT32:
- return &_mesa_texformat_depth_component16;
-
- default:
- fprintf(stderr, "unexpected texture format %s in %s\n",
- _mesa_lookup_enum_by_nr(internalFormat),
- __FUNCTION__);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-
-
-void intelDestroyTexObj(intelContextPtr intel, intelTextureObjectPtr t)
-{
- unsigned i;
-
- if ( intel == NULL )
- return;
-
- if ( t->age > intel->dirtyAge )
- intel->dirtyAge = t->age;
-
- for ( i = 0 ; i < MAX_TEXTURE_UNITS ; i++ ) {
- if ( t == intel->CurrentTexObj[ i ] )
- intel->CurrentTexObj[ i ] = NULL;
- }
-}
-
-
-
-/* Upload an image from mesa's internal copy. Image may be 1D, 2D or
- * 3D. Cubemaps are expanded elsewhere.
- */
-static void intelUploadTexImage( intelContextPtr intel,
- intelTextureObjectPtr t,
- const struct gl_texture_image *image,
- const GLuint offset )
-{
-
- if (!image || !image->Data)
- return;
-
- if (image->Depth == 1 && image->IsClientData) {
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Blit uploading\n");
-
- /* Do it with a blit.
- */
- intelEmitCopyBlitLocked( intel,
- image->TexFormat->TexelBytes,
- image->RowStride, /* ? */
- intelGetMemoryOffsetMESA( NULL, 0, image->Data ),
- t->Pitch / image->TexFormat->TexelBytes,
- intelGetMemoryOffsetMESA( NULL, 0, t->BufAddr + offset ),
- 0, 0,
- 0, 0,
- image->Width,
- image->Height);
- }
- else if (image->IsCompressed) {
- GLuint row_len = image->Width * 2;
- GLubyte *dst = (GLubyte *)(t->BufAddr + offset);
- GLubyte *src = (GLubyte *)image->Data;
- GLuint j;
-
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr,
- "Upload image %dx%dx%d offset %xm row_len %x "
- "pitch %x depth_pitch %x\n",
- image->Width, image->Height, image->Depth, offset,
- row_len, t->Pitch, t->depth_pitch);
-
- switch(image->IntFormat)
- {
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
- __memcpy(dst, src, row_len );
- src += row_len;
- }
- break;
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
- __memcpy(dst, src, (image->Width*4) );
- src += image->Width*4;
- }
- break;
- default:
- fprintf(stderr,"Internal Compressed format not supported %d\n", image->IntFormat);
- break;
- }
- }
- else {
- GLuint row_len = image->Width * image->TexFormat->TexelBytes;
- GLubyte *dst = (GLubyte *)(t->BufAddr + offset);
- GLubyte *src = (GLubyte *)image->Data;
- GLuint d, j;
-
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr,
- "Upload image %dx%dx%d offset %xm row_len %x "
- "pitch %x depth_pitch %x\n",
- image->Width, image->Height, image->Depth, offset,
- row_len, t->Pitch, t->depth_pitch);
-
- if (row_len == t->Pitch) {
- for (d = 0; d < image->Depth; d++) {
- memcpy( dst, src, t->Pitch * image->Height );
- dst += t->depth_pitch;
- src += row_len * image->Height;
- }
- }
- else {
- for (d = 0 ; d < image->Depth ; d++) {
- for (j = 0 ; j < image->Height ; j++) {
- __memcpy(dst, src, row_len );
- src += row_len;
- dst += t->Pitch;
- }
-
- dst += t->depth_pitch - (t->Pitch * image->Height);
- }
- }
- }
-}
-
-
-
-int intelUploadTexImages( intelContextPtr intel,
- intelTextureObjectPtr t,
- GLuint face)
-{
- const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
- const struct gl_texture_image *firstImage = t->image[face][t->base.firstLevel].image;
- int pitch = firstImage->RowStride * firstImage->TexFormat->TexelBytes;
-
- /* Can we texture out of the existing client data? */
- if ( numLevels == 1 &&
- firstImage->IsClientData &&
- (pitch & 3) == 0) {
-
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "AGP texturing from client memory\n");
-
- t->TextureOffset = intelAgpOffsetFromVirtual( intel, firstImage->Data );
- t->BufAddr = 0;
- t->dirty = ~0;
- return GL_TRUE;
- }
- else {
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Uploading client data to agp\n");
-
- INTEL_FIREVERTICES( intel );
- LOCK_HARDWARE( intel );
-
- if ( t->base.memBlock == NULL ) {
- int heap;
-
- heap = driAllocateTexture( intel->texture_heaps, intel->nr_heaps,
- (driTextureObject *) t );
- if ( heap == -1 ) {
- UNLOCK_HARDWARE( intel );
- return GL_FALSE;
- }
-
- /* Set the base offset of the texture image */
- t->BufAddr = intel->intelScreen->tex.map + t->base.memBlock->ofs;
- t->TextureOffset = intel->intelScreen->textureOffset + t->base.memBlock->ofs;
- t->dirty = ~0;
- }
-
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( (driTextureObject *) t );
-
-
- /* Upload any images that are new */
- if (t->base.dirty_images[face]) {
- int i;
-
- intelWaitForIdle( intel );
-
- for (i = 0 ; i < numLevels ; i++) {
- int level = i + t->base.firstLevel;
-
- if (t->base.dirty_images[face] & (1<<level)) {
-
- const struct gl_texture_image *image = t->image[face][i].image;
- GLuint offset = t->image[face][i].offset;
-
- if (INTEL_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "upload level %d, offset %x\n",
- level, offset);
-
- intelUploadTexImage( intel, t, image, offset );
- }
- }
- t->base.dirty_images[face] = 0;
- intel->perf_boxes |= I830_BOX_TEXTURE_LOAD;
- }
-
- UNLOCK_HARDWARE( intel );
- return GL_TRUE;
- }
-}
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-intelNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj = _mesa_new_texture_object(ctx, name, target);
- INTEL_CONTEXT(ctx)->vtbl.alloc_tex_obj( obj );
- return obj;
-}
-
-
-void intelInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->NewTextureObject = intelNewTextureObject;
- functions->ChooseTextureFormat = intelChooseTextureFormat;
- functions->TexImage1D = intelTexImage1D;
- functions->TexImage2D = intelTexImage2D;
- functions->TexImage3D = intelTexImage3D;
- functions->TexSubImage1D = intelTexSubImage1D;
- functions->TexSubImage2D = intelTexSubImage2D;
- functions->TexSubImage3D = intelTexSubImage3D;
- functions->CopyTexImage1D = _swrast_copy_teximage1d;
- functions->CopyTexImage2D = _swrast_copy_teximage2d;
- functions->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- functions->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- functions->CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- functions->DeleteTexture = intelDeleteTexture;
- functions->UpdateTexturePalette = NULL;
- functions->IsTextureResident = driIsTextureResident;
- functions->TestProxyTexImage = _mesa_test_proxy_teximage;
- functions->DeleteTexture = intelDeleteTexture;
- functions->CompressedTexImage2D = intelCompressedTexImage2D;
- functions->CompressedTexSubImage2D = intelCompressedTexSubImage2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.h
deleted file mode 100644
index 0a1f697e9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tex.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef INTELTEX_INC
-#define INTELTEX_INC
-
-#include "mtypes.h"
-#include "intel_context.h"
-#include "texmem.h"
-
-
-void intelInitTextureFuncs( struct dd_function_table *functions );
-
-void intelDestroyTexObj( intelContextPtr intel, intelTextureObjectPtr t );
-int intelUploadTexImages( intelContextPtr intel, intelTextureObjectPtr t,
- GLuint face );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.c
deleted file mode 100644
index bb0a7713e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.c
+++ /dev/null
@@ -1,920 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vertex.h"
-
-#include "intel_screen.h"
-#include "intel_tris.h"
-#include "intel_batchbuffer.h"
-#include "intel_reg.h"
-#include "intel_span.h"
-
-static void intelRenderPrimitive( GLcontext *ctx, GLenum prim );
-static void intelRasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim );
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#ifdef __i386__
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertsize), \
- "D" ((long)vb), \
- "S" ((long)v) ); \
-} while (0)
-#else
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- if (0) fprintf(stderr, "\n"); \
- for ( j = 0 ; j < vertsize ; j++ ) { \
- if (0) fprintf(stderr, " -- v(%d): %x/%f\n",j, \
- ((GLuint *)v)[j], \
- ((GLfloat *)v)[j]); \
- vb[j] = ((GLuint *)v)[j]; \
- } \
- vb += vertsize; \
-} while (0)
-#endif
-
-static void __inline__ intel_draw_quad( intelContextPtr intel,
- intelVertexPtr v0,
- intelVertexPtr v1,
- intelVertexPtr v2,
- intelVertexPtr v3 )
-{
- GLuint vertsize = intel->vertex_size;
- GLuint *vb = intelExtendInlinePrimitive( intel, 6 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v3 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
- COPY_DWORDS( j, vb, vertsize, v3 );
-}
-
-static void __inline__ intel_draw_triangle( intelContextPtr intel,
- intelVertexPtr v0,
- intelVertexPtr v1,
- intelVertexPtr v2 )
-{
- GLuint vertsize = intel->vertex_size;
- GLuint *vb = intelExtendInlinePrimitive( intel, 3 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
-}
-
-
-static __inline__ void intel_draw_line( intelContextPtr intel,
- intelVertexPtr v0,
- intelVertexPtr v1 )
-{
- GLuint vertsize = intel->vertex_size;
- GLuint *vb = intelExtendInlinePrimitive( intel, 2 * vertsize );
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
-}
-
-
-static __inline__ void intel_draw_point( intelContextPtr intel,
- intelVertexPtr v0 )
-{
- GLuint vertsize = intel->vertex_size;
- GLuint *vb = intelExtendInlinePrimitive( intel, vertsize );
- int j;
-
- /* Adjust for sub pixel position -- still required for conform. */
- *(float *)&vb[0] = v0->v.x - 0.125;
- *(float *)&vb[1] = v0->v.y - 0.125;
- for (j = 2 ; j < vertsize ; j++)
- vb[j] = v0->ui[j];
-}
-
-
-
-/***********************************************************************
- * Fixup for ARB_point_parameters *
- ***********************************************************************/
-
-static void intel_atten_point( intelContextPtr intel, intelVertexPtr v0 )
-{
- GLcontext *ctx = &intel->ctx;
- GLfloat psz[4], col[4], restore_psz, restore_alpha;
-
- _tnl_get_attr( ctx, v0, _TNL_ATTRIB_POINTSIZE, psz );
- _tnl_get_attr( ctx, v0, _TNL_ATTRIB_COLOR0, col );
-
- restore_psz = psz[0];
- restore_alpha = col[3];
-
- if (psz[0] >= ctx->Point.Threshold) {
- psz[0] = MIN2(psz[0], ctx->Point.MaxSize);
- }
- else {
- GLfloat dsize = psz[0] / ctx->Point.Threshold;
- psz[0] = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
- col[3] *= dsize * dsize;
- }
-
- if (psz[0] < 1.0)
- psz[0] = 1.0;
-
- if (restore_psz != psz[0] || restore_alpha != col[3]) {
- _tnl_set_attr( ctx, v0, _TNL_ATTRIB_POINTSIZE, psz);
- _tnl_set_attr( ctx, v0, _TNL_ATTRIB_COLOR0, col);
-
- intel_draw_point( intel, v0 );
-
- psz[0] = restore_psz;
- col[3] = restore_alpha;
-
- _tnl_set_attr( ctx, v0, _TNL_ATTRIB_POINTSIZE, psz);
- _tnl_set_attr( ctx, v0, _TNL_ATTRIB_COLOR0, col);
- }
- else
- intel_draw_point( intel, v0 );
-}
-
-
-
-
-
-/***********************************************************************
- * Fixup for I915 WPOS texture coordinate *
- ***********************************************************************/
-
-
-
-static void intel_wpos_triangle( intelContextPtr intel,
- intelVertexPtr v0,
- intelVertexPtr v1,
- intelVertexPtr v2 )
-{
- GLuint offset = intel->wpos_offset;
- GLuint size = intel->wpos_size;
-
- __memcpy( ((char *)v0) + offset, v0, size );
- __memcpy( ((char *)v1) + offset, v1, size );
- __memcpy( ((char *)v2) + offset, v2, size );
-
- intel_draw_triangle( intel, v0, v1, v2 );
-}
-
-
-static void intel_wpos_line( intelContextPtr intel,
- intelVertexPtr v0,
- intelVertexPtr v1 )
-{
- GLuint offset = intel->wpos_offset;
- GLuint size = intel->wpos_size;
-
- __memcpy( ((char *)v0) + offset, v0, size );
- __memcpy( ((char *)v1) + offset, v1, size );
-
- intel_draw_line( intel, v0, v1 );
-}
-
-
-static void intel_wpos_point( intelContextPtr intel,
- intelVertexPtr v0 )
-{
- GLuint offset = intel->wpos_offset;
- GLuint size = intel->wpos_size;
-
- __memcpy( ((char *)v0) + offset, v0, size );
-
- intel_draw_point( intel, v0 );
-}
-
-
-
-
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- intel->draw_tri( intel, a, b, c ); \
- else \
- intel_draw_triangle( intel, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- intel->draw_tri( intel, a, b, d ); \
- intel->draw_tri( intel, b, c, d ); \
- } else \
- intel_draw_quad( intel, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- intel->draw_line( intel, v0, v1 ); \
- else \
- intel_draw_line( intel, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- intel->draw_point( intel, v0 ); \
- else \
- intel_draw_point( intel, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define INTEL_OFFSET_BIT 0x01
-#define INTEL_TWOSIDE_BIT 0x02
-#define INTEL_UNFILLED_BIT 0x04
-#define INTEL_FALLBACK_BIT 0x08
-#define INTEL_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[INTEL_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & INTEL_FALLBACK_BIT)
-#define DO_OFFSET (IND & INTEL_OFFSET_BIT)
-#define DO_UNFILLED (IND & INTEL_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & INTEL_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX intelVertex
-#define TAB rast_tab
-
-/* Only used to pull back colors into vertices (ie, we know color is
- * floating point).
- */
-#define INTEL_COLOR( dst, src ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[0], (src)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[1], (src)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[2], (src)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[3], (src)[3]); \
-} while (0)
-
-#define INTEL_SPEC( dst, src ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[0], (src)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[1], (src)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE((dst)[2], (src)[0]); \
-} while (0)
-
-
-#define DEPTH_SCALE intel->polygon_offset_scale
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (intel->verts + (e * intel->vertex_size * sizeof(GLuint)))
-
-#define VERT_SET_RGBA( v, c ) if (coloroffset) INTEL_COLOR( v->ub4[coloroffset], c )
-#define VERT_COPY_RGBA( v0, v1 ) if (coloroffset) v0->ui[coloroffset] = v1->ui[coloroffset]
-#define VERT_SAVE_RGBA( idx ) if (coloroffset) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) if (coloroffset) v[idx]->ui[coloroffset] = color[idx]
-
-#define VERT_SET_SPEC( v, c ) if (specoffset) INTEL_SPEC( v->ub4[specoffset], c )
-#define VERT_COPY_SPEC( v0, v1 ) if (specoffset) COPY_3V(v0->ub4[specoffset], v1->ub4[specoffset])
-#define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx]
-
-#define LOCAL_VARS(n) \
- intelContextPtr intel = INTEL_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = intel->coloroffset; \
- GLboolean specoffset = intel->specoffset; \
- (void) color; (void) spec; (void) coloroffset; (void) specoffset;
-
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- PRIM3D_POINTLIST,
- PRIM3D_LINELIST,
- PRIM3D_LINELIST,
- PRIM3D_LINELIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST,
- PRIM3D_TRILIST
-};
-
-#define RASTERIZE(x) intelRasterPrimitive( ctx, x, hw_prim[x] )
-#define RENDER_PRIMITIVE intel->render_primitive
-#define TAG(x) x
-#define IND INTEL_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_OFFSET_BIT|INTEL_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT|INTEL_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_UNFILLED_BIT|INTEL_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT|INTEL_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_UNFILLED_BIT|INTEL_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT| \
- INTEL_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-intel_fallback_tri( intelContextPtr intel,
- intelVertex *v0,
- intelVertex *v1,
- intelVertex *v2 )
-{
- GLcontext *ctx = &intel->ctx;
- SWvertex v[3];
-
- if (0)
- fprintf(stderr, "\n%s\n", __FUNCTION__);
-
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swsetup_Translate( ctx, v2, &v[2] );
- intelSpanRenderStart( ctx );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
- intelSpanRenderFinish( ctx );
-}
-
-
-static void
-intel_fallback_line( intelContextPtr intel,
- intelVertex *v0,
- intelVertex *v1 )
-{
- GLcontext *ctx = &intel->ctx;
- SWvertex v[2];
-
- if (0)
- fprintf(stderr, "\n%s\n", __FUNCTION__);
-
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- intelSpanRenderStart( ctx );
- _swrast_Line( ctx, &v[0], &v[1] );
- intelSpanRenderFinish( ctx );
-}
-
-
-static void
-intel_fallback_point( intelContextPtr intel,
- intelVertex *v0 )
-{
- GLcontext *ctx = &intel->ctx;
- SWvertex v[1];
-
- if (0)
- fprintf(stderr, "\n%s\n", __FUNCTION__);
-
- _swsetup_Translate( ctx, v0, &v[0] );
- intelSpanRenderStart( ctx );
- _swrast_Point( ctx, &v[0] );
- intelSpanRenderFinish( ctx );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define IND 0
-#define V(x) (intelVertex *)(vertptr + ((x)*vertsize*sizeof(GLuint)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) POINT( V(ELT(start)) );
-#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) )
-#define RENDER_TRI( v0, v1, v2 ) TRI( V(v0), V(v1), V(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) QUAD( V(v0), V(v1), V(v2), V(v3) )
-#define INIT(x) intelRenderPrimitive( ctx, x )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- intelContextPtr intel = INTEL_CONTEXT(ctx); \
- GLubyte *vertptr = (GLubyte *)intel->verts; \
- const GLuint vertsize = intel->vertex_size; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) x
-#define TAG(x) intel_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) intel_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void intelRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint prim = intel->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n,
- PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void intelRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-static void intelFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- intelContextPtr intel = INTEL_CONTEXT( ctx );
- const GLuint vertsize = intel->vertex_size;
- GLuint *vb = intelExtendInlinePrimitive( intel, (n-2) * 3 * vertsize );
- GLubyte *vertptr = (GLubyte *)intel->verts;
- const GLuint *start = (const GLuint *)V(elts[0]);
- int i,j;
-
- for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, V(elts[i-1]) );
- COPY_DWORDS( j, vb, vertsize, V(elts[i]) );
- COPY_DWORDS( j, vb, vertsize, start );
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-
-
-#define POINT_FALLBACK (0)
-#define LINE_FALLBACK (DD_LINE_STIPPLE)
-#define TRI_FALLBACK (0)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK|\
- DD_TRI_STIPPLE|DD_POINT_ATTEN)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-void intelChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- intelContextPtr intel = INTEL_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- struct fragment_program *program = ctx->FragmentProgram._Current;
- GLboolean have_wpos = (program && (program->InputsRead & FRAG_BIT_WPOS));
- GLuint index = 0;
-
- if (INTEL_DEBUG & DEBUG_STATE)
- fprintf(stderr,"\n%s\n",__FUNCTION__);
-
- if ((flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) || have_wpos) {
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= INTEL_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= INTEL_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= INTEL_UNFILLED_BIT;
- }
-
- if (have_wpos) {
- intel->draw_point = intel_wpos_point;
- intel->draw_line = intel_wpos_line;
- intel->draw_tri = intel_wpos_triangle;
-
- /* Make sure these get called:
- */
- index |= INTEL_FALLBACK_BIT;
- }
- else {
- intel->draw_point = intel_draw_point;
- intel->draw_line = intel_draw_line;
- intel->draw_tri = intel_draw_triangle;
- }
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & ANY_FALLBACK_FLAGS)
- {
- if (flags & POINT_FALLBACK)
- intel->draw_point = intel_fallback_point;
-
- if (flags & LINE_FALLBACK)
- intel->draw_line = intel_fallback_line;
-
- if (flags & TRI_FALLBACK)
- intel->draw_tri = intel_fallback_tri;
-
- if ((flags & DD_TRI_STIPPLE) && !intel->hw_stipple)
- intel->draw_tri = intel_fallback_tri;
-
- if (flags & DD_POINT_ATTEN)
- intel->draw_point = intel_atten_point;
-
- index |= INTEL_FALLBACK_BIT;
- }
- }
-
- if (intel->RenderIndex != index) {
- intel->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = intel_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = intel_render_tab_elts;
- tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */
- tnl->Driver.Render.ClippedPolygon = intelFastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = intelRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = intelRenderClippedPoly;
- }
- }
-}
-
-static const GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-
-
-static void intelRunPipeline( GLcontext *ctx )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- if (intel->NewGLState) {
- if (intel->NewGLState & _NEW_TEXTURE) {
- intel->vtbl.update_texture_state( intel );
- }
-
- if (!intel->Fallback) {
- if (intel->NewGLState & _INTEL_NEW_RENDERSTATE)
- intelChooseRenderState( ctx );
- }
-
- intel->NewGLState = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-static void intelRenderStart( GLcontext *ctx )
-{
- INTEL_CONTEXT(ctx)->vtbl.render_start( INTEL_CONTEXT(ctx) );
-}
-
-static void intelRenderFinish( GLcontext *ctx )
-{
- if (INTEL_CONTEXT(ctx)->RenderIndex & INTEL_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-
-
- /* System to flush dma and emit state changes based on the rasterized
- * primitive.
- */
-static void intelRasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim )
-{
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- if (0)
- fprintf(stderr, "%s %s %x\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(rprim), hwprim);
-
- intel->vtbl.reduced_primitive_state( intel, rprim );
-
- /* Start a new primitive. Arrange to have it flushed later on.
- */
- if (hwprim != intel->prim.primitive)
- intelStartInlinePrimitive( intel, hwprim );
-}
-
-
- /*
- */
- static void intelRenderPrimitive( GLcontext *ctx, GLenum prim )
- {
- intelContextPtr intel = INTEL_CONTEXT(ctx);
-
- if (0)
- fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(prim));
-
- /* Let some clipping routines know which primitive they're dealing
- * with.
- */
- intel->render_primitive = prim;
-
- /* Shortcircuit this when called from t_dd_rendertmp.h for unfilled
- * triangles. The rasterized primitive will always be reset by
- * lower level functions in that case, potentially pingponging the
- * state:
- */
- if (reduced_prim[prim] == GL_TRIANGLES &&
- (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- /* Set some primitive-dependent state and Start? a new primitive.
- */
- intelRasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] );
- }
-
-
- /**********************************************************************/
- /* Transition to/from hardware rasterization. */
- /**********************************************************************/
-
- static char *fallbackStrings[] = {
- "Texture",
- "Draw buffer",
- "Read buffer",
- "Color mask",
- "Render mode",
- "Stencil",
- "Stipple",
- "User disable"
- };
-
-
- static char *getFallbackString(GLuint bit)
- {
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
- }
-
-
-
- void intelFallback( intelContextPtr intel, GLuint bit, GLboolean mode )
- {
- GLcontext *ctx = &intel->ctx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = intel->Fallback;
-
- if (mode) {
- intel->Fallback |= bit;
- if (oldfallback == 0) {
- intelFlush(ctx);
- if (INTEL_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "ENTER FALLBACK %x: %s\n",
- bit, getFallbackString( bit ));
- _swsetup_Wakeup( ctx );
- intel->RenderIndex = ~0;
- }
- }
- else {
- intel->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- if (INTEL_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString( bit ));
- tnl->Driver.Render.Start = intelRenderStart;
- tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive;
- tnl->Driver.Render.Finish = intelRenderFinish;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_invalidate_vertex_state( ctx, ~0 );
- _tnl_invalidate_vertices( ctx, ~0 );
- _tnl_install_attrs( ctx,
- intel->vertex_attrs,
- intel->vertex_attr_count,
- intel->ViewportMatrix.m, 0 );
-
- intel->NewGLState |= _INTEL_NEW_RENDERSTATE;
- }
- }
- }
-
-
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-
-void intelInitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = intelRunPipeline;
- tnl->Driver.Render.Start = intelRenderStart;
- tnl->Driver.Render.Finish = intelRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.h
deleted file mode 100644
index d7e382fdb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/intel_tris.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef INTELTRIS_INC
-#define INTELTRIS_INC
-
-#include "mtypes.h"
-
-#define _INTEL_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_PROGRAM | \
- _NEW_POLYGONSTIPPLE)
-
-extern void intelInitTriFuncs( GLcontext *ctx );
-
-extern void intelPrintRenderState( const char *msg, GLuint state );
-extern void intelChooseRenderState( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_common.h
deleted file mode 100644
index c03f74289..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_common.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, VA LINUX SYSTEMS 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.
-
-**************************************************************************/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.1 2002/09/11 00:29:32 dawes Exp $ */
-
-#ifndef _I830_COMMON_H_
-#define _I830_COMMON_H_
-
-
-#define I830_NR_TEX_REGIONS 255 /* maximum due to use of chars for next/prev */
-#define I830_LOG_MIN_TEX_REGION_SIZE 14
-
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_I830_INIT 0x00
-#define DRM_I830_FLUSH 0x01
-#define DRM_I830_FLIP 0x02
-#define DRM_I830_BATCHBUFFER 0x03
-#define DRM_I830_IRQ_EMIT 0x04
-#define DRM_I830_IRQ_WAIT 0x05
-#define DRM_I830_GETPARAM 0x06
-#define DRM_I830_SETPARAM 0x07
-#define DRM_I830_ALLOC 0x08
-#define DRM_I830_FREE 0x09
-#define DRM_I830_INIT_HEAP 0x0a
-#define DRM_I830_CMDBUFFER 0x0b
-
-typedef struct {
- enum {
- I830_INIT_DMA = 0x01,
- I830_CLEANUP_DMA = 0x02,
- I830_RESUME_DMA = 0x03
- } func;
- unsigned int mmio_offset;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
- unsigned int back_pitch;
- unsigned int depth_pitch;
- unsigned int cpp;
- unsigned int chipset;
-} drmI830Init;
-
-typedef struct {
- drmTextureRegion texList[I830_NR_TEX_REGIONS+1];
- int last_upload; /* last time texture was uploaded */
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int ctxOwner; /* last context to upload state */
- int texAge;
- int pf_enabled; /* is pageflipping allowed? */
- int pf_active;
- int pf_current_page; /* which buffer is being displayed? */
- int perf_boxes; /* performance boxes to be displayed */
-} drmI830Sarea;
-
-/* Flags for perf_boxes
- */
-#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */
-#define I830_BOX_FLIP 0x2 /* populated by kernel */
-#define I830_BOX_WAIT 0x4 /* populated by kernel & client */
-#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */
-#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */
-
-
-typedef struct {
- int start; /* agp offset */
- int used; /* nr bytes in use */
- int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
- int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/
- int num_cliprects; /* mulitpass with multiple cliprects? */
- drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */
-} drmI830BatchBuffer;
-
-typedef struct {
- char *buf; /* agp offset */
- int sz; /* nr bytes in use */
- int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
- int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/
- int num_cliprects; /* mulitpass with multiple cliprects? */
- drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */
-} drmI830CmdBuffer;
-
-
-typedef struct {
- int *irq_seq;
-} drmI830IrqEmit;
-
-typedef struct {
- int irq_seq;
-} drmI830IrqWait;
-
-typedef struct {
- int param;
- int *value;
-} drmI830GetParam;
-
-#define I830_PARAM_IRQ_ACTIVE 1
-#define I830_PARAM_ALLOW_BATCHBUFFER 2
-
-typedef struct {
- int param;
- int value;
-} drmI830SetParam;
-
-#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1
-#define I830_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
-#define I830_SETPARAM_ALLOW_BATCHBUFFER 3
-
-
-/* A memory manager for regions of shared memory:
- */
-#define I830_MEM_REGION_AGP 1
-
-typedef struct {
- int region;
- int alignment;
- int size;
- int *region_offset; /* offset from start of fb or agp */
-} drmI830MemAlloc;
-
-typedef struct {
- int region;
- int region_offset;
-} drmI830MemFree;
-
-typedef struct {
- int region;
- int size;
- int start;
-} drmI830MemInitHeap;
-
-
-#endif /* _I830_DRM_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_dri.h
deleted file mode 100644
index 978f47a2b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/i915/server/i830_dri.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v 1.4 2002/10/30 12:52:18 alanh Exp $ */
-
-#ifndef _I830_DRI_H
-#define _I830_DRI_H
-
-#include "xf86drm.h"
-#include "i830_common.h"
-
-#define I830_MAX_DRAWABLES 256
-
-#define I830_MAJOR_VERSION 1
-#define I830_MINOR_VERSION 3
-#define I830_PATCHLEVEL 0
-
-#define I830_REG_SIZE 0x80000
-
-/* Note: This structure has changed slightly from what is expected by
- * the i830_drv.o driver. Maybe that should be reverted.
- */
-typedef struct _I830DRIRec {
- drm_handle_t regs;
- drmSize regsSize;
-
- drmSize backbufferSize;
- drm_handle_t backbuffer;
-
- drmSize depthbufferSize;
- drm_handle_t depthbuffer;
-
- drm_handle_t textures;
- int textureSize;
-
- drm_handle_t agp_buffers;
- drmSize agp_buf_size;
-
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int bitsPerPixel;
- int fbOffset;
- int fbStride;
-
- int backOffset;
- int backPitch;
-
- int depthOffset;
- int depthPitch;
-
- int logTextureGranularity;
- int textureOffset;
-
- int irq;
- int sarea_priv_offset;
-} I830DRIRec, *I830DRIPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830ConfigPrivRec, *I830ConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830DRIContextRec, *I830DRIContextPtr;
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/Makefile
deleted file mode 100644
index 7246d51f5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# src/mesa/drivers/dri/mach64/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = mach64_dri.so
-
-# Not yet
-# MINIGLX_SOURCES = server/mach64_dri.c
-
-DRIVER_SOURCES = \
- mach64_context.c \
- mach64_ioctl.c \
- mach64_screen.c \
- mach64_span.c \
- mach64_state.c \
- mach64_tex.c \
- mach64_texmem.c \
- mach64_texstate.c \
- mach64_tris.c \
- mach64_vb.c \
- mach64_dd.c \
- mach64_lock.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.c
deleted file mode 100644
index 717b9b9e8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "mach64_context.h"
-#include "mach64_ioctl.h"
-#include "mach64_dd.h"
-#include "mach64_span.h"
-#include "mach64_state.h"
-#include "mach64_tex.h"
-#include "mach64_tris.h"
-#include "mach64_vb.h"
-
-#include "utils.h"
-#include "vblank.h"
-
-#define need_GL_ARB_multisample
-#include "extension_helper.h"
-
-#ifndef MACH64_DEBUG
-int MACH64_DEBUG = (0);
-#endif
-
-static const struct dri_debug_control debug_control[] =
-{
- { "sync", DEBUG_ALWAYS_SYNC },
- { "api", DEBUG_VERBOSE_API },
- { "msg", DEBUG_VERBOSE_MSG },
- { "lru", DEBUG_VERBOSE_LRU },
- { "dri", DEBUG_VERBOSE_DRI },
- { "ioctl", DEBUG_VERBOSE_IOCTL },
- { "prims", DEBUG_VERBOSE_PRIMS },
- { "count", DEBUG_VERBOSE_COUNT },
- { "nowait", DEBUG_NOWAIT },
- { "fall", DEBUG_VERBOSE_FALLBACK },
- { NULL, 0 }
-};
-
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-
-/* Create the device specific context.
- */
-GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *driScreen = driContextPriv->driScreenPriv;
- struct dd_function_table functions;
- mach64ContextPtr mmesa;
- mach64ScreenPtr mach64Screen;
- int i, heap;
-
-#if DO_DEBUG
- MACH64_DEBUG = driParseDebugString(getenv("MACH64_DEBUG"), debug_control);
-#endif
-
- /* Allocate the mach64 context */
- mmesa = (mach64ContextPtr) CALLOC( sizeof(*mmesa) );
- if ( !mmesa )
- return GL_FALSE;
-
- /* Init default driver functions then plug in our Mach64-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions( &functions );
- mach64InitDriverFuncs( &functions );
- mach64InitIoctlFuncs( &functions );
- mach64InitTextureFuncs( &functions );
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((mach64ContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- mmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *)mmesa);
- if (!mmesa->glCtx) {
- FREE(mmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = mmesa;
- ctx = mmesa->glCtx;
-
- mmesa->driContext = driContextPriv;
- mmesa->driScreen = driScreen;
- mmesa->driDrawable = NULL;
- mmesa->hHWContext = driContextPriv->hHWContext;
- mmesa->driHwLock = &driScreen->pSAREA->lock;
- mmesa->driFd = driScreen->fd;
-
- mach64Screen = mmesa->mach64Screen = (mach64ScreenPtr)driScreen->private;
-
- /* Parse configuration files */
- driParseConfigFiles (&mmesa->optionCache, &mach64Screen->optionCache,
- mach64Screen->driScreen->myNum, "mach64");
-
- mmesa->sarea = (drm_mach64_sarea_t *)((char *)driScreen->pSAREA +
- sizeof(drm_sarea_t));
-
- mmesa->CurrentTexObj[0] = NULL;
- mmesa->CurrentTexObj[1] = NULL;
-
- make_empty_list( &mmesa->SwappedOut );
-
- mmesa->firstTexHeap = mach64Screen->firstTexHeap;
- mmesa->lastTexHeap = mach64Screen->firstTexHeap + mach64Screen->numTexHeaps;
-
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- make_empty_list( &mmesa->TexObjList[i] );
- mmesa->texHeap[i] = mmInit( 0, mach64Screen->texSize[i] );
- mmesa->lastTexAge[i] = -1;
- }
-
- mmesa->RenderIndex = -1; /* Impossible value */
- mmesa->vert_buf = NULL;
- mmesa->num_verts = 0;
- mmesa->new_state = MACH64_NEW_ALL;
- mmesa->dirty = MACH64_UPLOAD_ALL;
-
- /* Set the maximum texture size small enough that we can
- * guarentee that both texture units can bind a maximal texture
- * and have them both in memory (on-card or AGP) at once.
- * Test for 2 textures * bytes/texel * size * size. There's no
- * need to account for mipmaps since we only upload one level.
- */
- heap = mach64Screen->IsPCI ? MACH64_CARD_HEAP : MACH64_AGP_HEAP;
-
- if ( mach64Screen->texSize[heap] >= 2 * mach64Screen->cpp * 1024*1024 ) {
- ctx->Const.MaxTextureLevels = 11; /* 1024x1024 */
- } else if ( mach64Screen->texSize[heap] >= 2 * mach64Screen->cpp * 512*512 ) {
- ctx->Const.MaxTextureLevels = 10; /* 512x512 */
- } else {
- ctx->Const.MaxTextureLevels = 9; /* 256x256 */
- }
-
- ctx->Const.MaxTextureUnits = 2;
-
-#if ENABLE_PERF_BOXES
- mmesa->boxes = ( getenv( "LIBGL_PERFORMANCE_BOXES" ) != NULL );
-#endif
-
- /* Allocate the vertex buffer
- */
- mmesa->vert_buf = ALIGN_MALLOC(MACH64_BUFFER_SIZE, 32);
- if ( !mmesa->vert_buf )
- return GL_FALSE;
- mmesa->vert_used = 0;
- mmesa->vert_total = MACH64_BUFFER_SIZE;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
-/* _tnl_destroy_pipeline( ctx ); */
-/* _tnl_install_pipeline( ctx, mach64_pipeline ); */
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
-
- mach64InitVB( ctx );
- mach64InitTriFuncs( ctx );
- mach64DDInitStateFuncs( ctx );
- mach64DDInitSpanFuncs( ctx );
- mach64DDInitState( mmesa );
-
- mmesa->do_irqs = (mmesa->mach64Screen->irq && !getenv("MACH64_NO_IRQS"));
-
- mmesa->vblank_flags = (mmesa->do_irqs)
- ? driGetDefaultVBlankFlags(&mmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
- driContextPriv->driverPrivate = (void *)mmesa;
-
- if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
- FALLBACK(mmesa, MACH64_FALLBACK_DISABLE, 1);
- }
-
- return GL_TRUE;
-}
-
-/* Destroy the device specific context.
- */
-void mach64DestroyContext( __DRIcontextPrivate *driContextPriv )
-{
- mach64ContextPtr mmesa = (mach64ContextPtr) driContextPriv->driverPrivate;
-
- assert(mmesa); /* should never be null */
- if ( mmesa ) {
- if (mmesa->glCtx->Shared->RefCount == 1) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- mach64TexObjPtr t, next_t;
- int i;
-
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- foreach_s ( t, next_t, &mmesa->TexObjList[i] ) {
- mach64DestroyTexObj( mmesa, t );
- }
- mmDestroy( mmesa->texHeap[i] );
- mmesa->texHeap[i] = NULL;
- }
-
- foreach_s ( t, next_t, &mmesa->SwappedOut ) {
- mach64DestroyTexObj( mmesa, t );
- }
- }
-
- _swsetup_DestroyContext( mmesa->glCtx );
- _tnl_DestroyContext( mmesa->glCtx );
- _ac_DestroyContext( mmesa->glCtx );
- _swrast_DestroyContext( mmesa->glCtx );
-
- mach64FreeVB( mmesa->glCtx );
-
- /* Free the vertex buffer */
- if ( mmesa->vert_buf )
- ALIGN_FREE( mmesa->vert_buf );
-
- /* free the Mesa context */
- mmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(mmesa->glCtx);
-
- FREE( mmesa );
- }
-}
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-GLboolean
-mach64MakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( driContextPriv ) {
- GET_CURRENT_CONTEXT(ctx);
- mach64ContextPtr oldMach64Ctx = ctx ? MACH64_CONTEXT(ctx) : NULL;
- mach64ContextPtr newMach64Ctx = (mach64ContextPtr) driContextPriv->driverPrivate;
-
- if ( newMach64Ctx != oldMach64Ctx ) {
- newMach64Ctx->new_state |= MACH64_NEW_CONTEXT;
- newMach64Ctx->dirty = MACH64_UPLOAD_ALL;
- }
-
-
- driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags );
-
- if ( newMach64Ctx->driDrawable != driDrawPriv ) {
- newMach64Ctx->driDrawable = driDrawPriv;
- mach64CalcViewport( newMach64Ctx->glCtx );
- }
-
- _mesa_make_current( newMach64Ctx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
-
- newMach64Ctx->new_state |= MACH64_NEW_CLIP;
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-
-/* Force the context `c' to be unbound from its buffer.
- */
-GLboolean
-mach64UnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.h
deleted file mode 100644
index c541f77ab..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_context.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_CONTEXT_H__
-#define __MACH64_CONTEXT_H__
-
-#include "dri_util.h"
-#include "drm.h"
-#include "mach64_drm.h"
-
-#include "mtypes.h"
-
-#include "mach64_reg.h"
-
-#include "texmem.h"
-
-struct mach64_context;
-typedef struct mach64_context mach64ContextRec;
-typedef struct mach64_context *mach64ContextPtr;
-
-#include "mach64_lock.h"
-#include "mach64_screen.h"
-
-/* Experimental driver options */
-#define MACH64_CLIENT_STATE_EMITS 0
-
-/* Performace monitoring */
-#define ENABLE_PERF_BOXES 1
-
-/* Native vertex format */
-#define MACH64_NATIVE_VTXFMT 1
-
-/* Flags for what context state needs to be updated:
- */
-#define MACH64_NEW_ALPHA 0x0001
-#define MACH64_NEW_DEPTH 0x0002
-#define MACH64_NEW_FOG 0x0004
-#define MACH64_NEW_CLIP 0x0008
-#define MACH64_NEW_CULL 0x0010
-#define MACH64_NEW_MASKS 0x0020
-#define MACH64_NEW_RENDER_UNUSED 0x0040
-#define MACH64_NEW_WINDOW 0x0080
-#define MACH64_NEW_TEXTURE 0x0100
-#define MACH64_NEW_CONTEXT 0x0200
-#define MACH64_NEW_ALL 0x03ff
-
-/* Flags for software fallback cases:
- */
-#define MACH64_FALLBACK_TEXTURE 0x0001
-#define MACH64_FALLBACK_DRAW_BUFFER 0x0002
-#define MACH64_FALLBACK_READ_BUFFER 0x0004
-#define MACH64_FALLBACK_STENCIL 0x0008
-#define MACH64_FALLBACK_RENDER_MODE 0x0010
-#define MACH64_FALLBACK_LOGICOP 0x0020
-#define MACH64_FALLBACK_SEP_SPECULAR 0x0040
-#define MACH64_FALLBACK_BLEND_EQ 0x0080
-#define MACH64_FALLBACK_BLEND_FUNC 0x0100
-#define MACH64_FALLBACK_DISABLE 0x0200
-
-#define CARD32 GLuint /* KW: For building in mesa tree */
-
-#if MACH64_NATIVE_VTXFMT
-
-/* The vertex structures.
- */
-
-/* The size of this union is not of relevence:
- */
-union mach64_vertex_t {
- GLfloat f[16];
- GLuint ui[16];
- GLushort us2[16][2];
- GLubyte ub4[16][4];
-};
-
-typedef union mach64_vertex_t mach64Vertex, *mach64VertexPtr;
-
-#else
-
-/* Use the templated vertex format:
- */
-#define TAG(x) mach64##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-#endif /* MACH64_NATIVE_VTXFMT */
-
-/* Subpixel offsets for window coordinates:
- * These are enough to fix most glean tests except polygonOffset.
- * There are also still some gaps that show in e.g. the tunnel Mesa demo
- * or the lament xscreensaver hack.
- */
-#define SUBPIXEL_X (0.0125F)
-#define SUBPIXEL_Y (0.15F)
-
-
-typedef void (*mach64_tri_func)( mach64ContextPtr,
- mach64Vertex *,
- mach64Vertex *,
- mach64Vertex * );
-
-typedef void (*mach64_line_func)( mach64ContextPtr,
- mach64Vertex *,
- mach64Vertex * );
-
-typedef void (*mach64_point_func)( mach64ContextPtr,
- mach64Vertex * );
-
-#ifdef TEXMEM
-struct mach64_texture_object {
- driTextureObject base;
-
- GLuint offset;
-
- GLuint dirty;
- GLuint age;
-
- GLint widthLog2;
- GLint heightLog2;
- GLint maxLog2;
-
- GLint hasAlpha;
- GLint textureFormat;
-
- /* Have to keep these separate due to how they are programmed.
- * FIXME: Why don't we just use the tObj values?
- */
- GLboolean BilinearMin;
- GLboolean BilinearMag;
- GLboolean ClampS;
- GLboolean ClampT;
-};
-#else
-struct mach64_texture_object {
- struct mach64_texture_object *next;
- struct mach64_texture_object *prev;
- struct gl_texture_object *tObj;
-
- PMemBlock memBlock;
- GLuint offset;
- GLuint size;
-
- GLuint dirty;
- GLuint age;
-
- GLint bound;
- GLint heap;
-
- GLint widthLog2;
- GLint heightLog2;
- GLint maxLog2;
-
- GLint hasAlpha;
- GLint textureFormat;
-
- /* Have to keep these separate due to how they are programmed.
- * FIXME: Why don't we just use the tObj values?
- */
- GLboolean BilinearMin;
- GLboolean BilinearMag;
- GLboolean ClampS;
- GLboolean ClampT;
-};
-#endif
-
-typedef struct mach64_texture_object mach64TexObj, *mach64TexObjPtr;
-
-
-struct mach64_context {
- GLcontext *glCtx;
-
- /* Driver and hardware state management
- */
- GLuint new_state;
- GLuint dirty; /* Hardware state to be updated */
- drm_mach64_context_regs_t setup;
-
- GLuint NewGLState;
- GLuint Fallback;
- GLuint SetupIndex;
- GLuint SetupNewInputs;
- GLuint RenderIndex;
- GLfloat hw_viewport[16];
- GLfloat depth_scale;
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- GLuint vertex_format;
- GLuint num_verts;
- GLubyte *verts;
-
- CARD32 Color; /* Current draw color */
- CARD32 ClearColor; /* Color used to clear color buffer */
- CARD32 ClearDepth; /* Value used to clear depth buffer */
-
- /* Map GL texture units onto hardware
- */
- GLint multitex;
- GLint tmu_source[2];
- GLint tex_dest[2];
-
- /* Texture object bookkeeping
- */
- mach64TexObjPtr CurrentTexObj[2];
-#ifdef TEXMEM
- unsigned nr_heaps;
- driTexHeap * texture_heaps[ R128_NR_TEX_HEAPS ];
- driTextureObject swapped;
-#else
- mach64TexObj TexObjList[MACH64_NR_TEX_HEAPS];
- mach64TexObj SwappedOut;
- memHeap_t *texHeap[MACH64_NR_TEX_HEAPS];
- GLuint lastTexAge[MACH64_NR_TEX_HEAPS];
- GLint firstTexHeap, lastTexHeap;
-#endif
-
- /* Fallback rasterization functions
- */
- mach64_point_func draw_point;
- mach64_line_func draw_line;
- mach64_tri_func draw_tri;
-
- /* Culling */
- GLfloat backface_sign;
-
- /* DMA buffers
- */
- void *vert_buf;
- size_t vert_total;
- unsigned vert_used;
-
- GLuint hw_primitive;
- GLenum render_primitive;
-
- /* Visual, drawable, cliprect and scissor information
- */
- GLint drawOffset, drawPitch;
- GLint drawX, drawY; /* origin of drawable in draw buffer */
- GLint readOffset, readPitch;
-
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
-
- GLint scissor;
- drm_clip_rect_t ScissorRect; /* Current software scissor */
-
- /* Mirrors of some DRI state
- */
- __DRIcontextPrivate *driContext; /* DRI context */
- __DRIscreenPrivate *driScreen; /* DRI screen */
- __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */
-
- unsigned int lastStamp; /* mirror driDrawable->lastStamp */
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
-
- mach64ScreenPtr mach64Screen; /* Screen private DRI data */
- drm_mach64_sarea_t *sarea; /* Private SAREA data */
-
- GLuint hardwareWentIdle;
-
-#if ENABLE_PERF_BOXES
- /* Performance counters
- */
- GLuint boxes; /* Draw performance boxes */
- GLuint c_clears;
- GLuint c_drawWaits;
- GLuint c_textureSwaps;
- GLuint c_textureBytes;
- GLuint c_agpTextureBytes;
- GLuint c_texsrc_agp;
- GLuint c_texsrc_card;
- GLuint c_vertexBuffers;
-#endif
-
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
- GLuint do_irqs;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-};
-
-#define MACH64_CONTEXT(ctx) ((mach64ContextPtr)(ctx->DriverCtx))
-
-
-extern GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate );
-
-extern void mach64DestroyContext( __DRIcontextPrivate * );
-
-extern GLboolean mach64MakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv );
-
-extern GLboolean mach64UnbindContext( __DRIcontextPrivate *driContextPriv );
-
-/* ================================================================
- * Byte ordering
- */
-#if MESA_LITTLE_ENDIAN == 1
-#define LE32_IN( x ) ( *(GLuint *)(x) )
-#define LE32_IN_FLOAT( x ) ( *(GLfloat *)(x) )
-#define LE32_OUT( x, y ) do { *(GLuint *)(x) = (y); } while (0)
-#define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)(x) = (y); } while (0)
-#else
-#include <byteswap.h>
-#define LE32_IN( x ) bswap_32( *(GLuint *)(x) )
-#define LE32_IN_FLOAT( x ) \
-({ \
- GLuint __tmp = bswap_32( *(GLuint *)(x) ); \
- *(GLfloat *)&__tmp; \
-})
-#define LE32_OUT( x, y ) do { *(GLuint *)(x) = bswap_32( y ); } while (0)
-#define LE32_OUT_FLOAT( x, y ) \
-do { \
- GLuint __tmp; \
- *(GLfloat *)&__tmp = (y); \
- *(GLuint *)(x) = bswap_32( __tmp ); \
-} while (0)
-#endif
-
-/* ================================================================
- * DMA buffers
- */
-
-#define DMALOCALS CARD32 *buf=NULL; int requested=0; int outcount=0
-
-/* called while locked for interleaved client-side state emits */
-#define DMAGETPTR( dwords ) \
-do { \
- requested = (dwords); \
- buf = (CARD32 *)mach64AllocDmaLocked( mmesa, ((dwords)*4) ); \
- outcount = 0; \
-} while(0)
-
-#define DMAOUTREG( reg, val ) \
-do { \
- LE32_OUT( &buf[outcount++], ADRINDEX( reg ) ); \
- LE32_OUT( &buf[outcount++], ( val ) ); \
-} while(0)
-
-#define DMAADVANCE() \
-do { \
- if (outcount < requested) { \
- mmesa->vert_used -= (requested - outcount) * 4; \
- } \
-} while(0)
-
-/* ================================================================
- * Debugging:
- */
-
-#define DO_DEBUG 1
-
-#if DO_DEBUG
-extern int MACH64_DEBUG;
-#else
-#define MACH64_DEBUG 0
-#endif
-
-#define DEBUG_ALWAYS_SYNC 0x001
-#define DEBUG_VERBOSE_API 0x002
-#define DEBUG_VERBOSE_MSG 0x004
-#define DEBUG_VERBOSE_LRU 0x008
-#define DEBUG_VERBOSE_DRI 0x010
-#define DEBUG_VERBOSE_IOCTL 0x020
-#define DEBUG_VERBOSE_PRIMS 0x040
-#define DEBUG_VERBOSE_COUNT 0x080
-#define DEBUG_NOWAIT 0x100
-#define DEBUG_VERBOSE_FALLBACK 0x200
-#endif /* __MACH64_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.c
deleted file mode 100644
index 7c27c5856..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_ioctl.h"
-#include "mach64_state.h"
-#include "mach64_vb.h"
-#include "mach64_dd.h"
-
-#include "context.h"
-#include "utils.h"
-#include "framebuffer.h"
-
-#define DRIVER_DATE "20051019"
-
-/* Return the current color buffer size.
- */
-static void mach64DDGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- LOCK_HARDWARE( mmesa );
- *width = mmesa->driDrawable->w;
- *height = mmesa->driDrawable->h;
- UNLOCK_HARDWARE( mmesa );
-}
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *mach64DDGetString( GLcontext *ctx, GLenum name )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- static char buffer[128];
- unsigned offset;
- const char * card_name = "Mach64 [Rage Pro]";
- GLuint agp_mode = mmesa->mach64Screen->IsPCI ? 0 :
- mmesa->mach64Screen->AGPMode;
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte*)"Gareth Hughes, Leif Delgass, José Fonseca";
-
- case GL_RENDERER:
-
- offset = driGetRendererString( buffer, card_name, DRIVER_DATE,
- agp_mode );
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-/* Send all commands to the hardware. If vertex buffers or indirect
- * buffers are in use, then we need to make sure they are sent to the
- * hardware. All commands that are normally sent to the ring are
- * already considered `flushed'.
- */
-static void mach64DDFlush( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- LOCK_HARDWARE( mmesa );
- FLUSH_DMA_LOCKED( mmesa );
- UNLOCK_HARDWARE( mmesa );
-
-#if ENABLE_PERF_BOXES
- if ( mmesa->boxes ) {
- LOCK_HARDWARE( mmesa );
- mach64PerformanceBoxesLocked( mmesa );
- UNLOCK_HARDWARE( mmesa );
- }
-
- /* Log the performance counters if necessary */
- mach64PerformanceCounters( mmesa );
-#endif
-}
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
- */
-static void mach64DDFinish( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- mmesa->c_drawWaits++;
-#endif
-
- mach64DDFlush( ctx );
- mach64WaitForIdle( mmesa );
-}
-
-/* Initialize the driver's misc functions.
- */
-void mach64InitDriverFuncs( struct dd_function_table *functions )
-{
- functions->GetBufferSize = mach64DDGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = mach64DDGetString;
- functions->Finish = mach64DDFinish;
- functions->Flush = mach64DDFlush;
-
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.h
deleted file mode 100644
index 74cf1d304..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_dd.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __MACH64_DD_H__
-#define __MACH64_DD_H__
-
-extern void mach64InitDriverFuncs( struct dd_function_table *functions );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.c
deleted file mode 100644
index 1889dc2b9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.c
+++ /dev/null
@@ -1,912 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-#include <errno.h>
-
-#include "mach64_context.h"
-#include "mach64_state.h"
-#include "mach64_ioctl.h"
-#include "mach64_tex.h"
-
-#include "imports.h"
-#include "macros.h"
-
-#include "swrast/swrast.h"
-
-#include "vblank.h"
-
-#define MACH64_TIMEOUT 10 /* the DRM already has a timeout, so keep this small */
-
-
-/* =============================================================
- * Hardware vertex buffer handling
- */
-
-/* Get a new VB from the pool of vertex buffers in AGP space.
- */
-drmBufPtr mach64GetBufferLocked( mach64ContextPtr mmesa )
-{
- int fd = mmesa->mach64Screen->driScreen->fd;
- int index = 0;
- int size = 0;
- drmDMAReq dma;
- drmBufPtr buf = NULL;
- int to = 0;
- int ret;
-
- dma.context = mmesa->hHWContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = MACH64_BUFFER_SIZE;
- dma.request_list = &index;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
- while ( !buf && ( to++ < MACH64_TIMEOUT ) ) {
- ret = drmDMA( fd, &dma );
-
- if ( ret == 0 ) {
- buf = &mmesa->mach64Screen->buffers->list[index];
- buf->used = 0;
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- mmesa->c_vertexBuffers++;
-#endif
- return buf;
- }
- }
-
- if ( !buf ) {
- drmCommandNone( fd, DRM_MACH64_RESET );
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "Error: Could not get new VB... exiting\n" );
- exit( -1 );
- }
-
- return buf;
-}
-
-void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
-{
- drm_clip_rect_t *pbox = mmesa->pClipRects;
- int nbox = mmesa->numClipRects;
- void *buffer = mmesa->vert_buf;
- int count = mmesa->vert_used;
- int prim = mmesa->hw_primitive;
- int fd = mmesa->driScreen->fd;
- drm_mach64_vertex_t vertex;
- int i, ret;
-
- mmesa->num_verts = 0;
- mmesa->vert_used = 0;
-
- if ( !count )
- return;
-
- if ( mmesa->dirty & ~MACH64_UPLOAD_CLIPRECTS )
- mach64EmitHwStateLocked( mmesa );
-
- if ( !nbox )
- count = 0;
-
- if ( nbox > MACH64_NR_SAREA_CLIPRECTS )
- mmesa->dirty |= MACH64_UPLOAD_CLIPRECTS;
-
- if ( !count || !(mmesa->dirty & MACH64_UPLOAD_CLIPRECTS) ) {
- /* FIXME: Is this really necessary */
- if ( nbox == 1 )
- mmesa->sarea->nbox = 0;
- else
- mmesa->sarea->nbox = nbox;
-
- vertex.prim = prim;
- vertex.buf = buffer;
- vertex.used = count;
- vertex.discard = 1;
- ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
- if ( ret ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
- exit( -1 );
- }
-
- } else {
-
- for ( i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- int discard = 0;
-
- mmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++ ) {
- *b++ = pbox[i];
- }
-
- /* Finished with the buffer?
- */
- if ( nr == nbox ) {
- discard = 1;
- }
-
- mmesa->sarea->dirty |= MACH64_UPLOAD_CLIPRECTS;
-
- vertex.prim = prim;
- vertex.buf = buffer;
- vertex.used = count;
- vertex.discard = discard;
- ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
- if ( ret ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
- exit( -1 );
- }
- }
- }
-
- mmesa->dirty &= ~MACH64_UPLOAD_CLIPRECTS;
-}
-
-/* ================================================================
- * Texture uploads
- */
-
-void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
- GLint offset, GLint pitch, GLint format,
- GLint x, GLint y, GLint width, GLint height )
-{
- drm_mach64_blit_t blit;
- GLint ret;
-
- blit.idx = buffer->idx;
- blit.offset = offset;
- blit.pitch = pitch;
- blit.format = format;
- blit.x = x;
- blit.y = y;
- blit.width = width;
- blit.height = height;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
- &blit, sizeof(drm_mach64_blit_t) );
-
- if ( ret ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_BLIT: return = %d\n", ret );
- exit( -1 );
- }
-}
-
-
-/* ================================================================
- * SwapBuffers with client-side throttling
- */
-static void delay( void ) {
-/* Prevent an optimizing compiler from removing a spin loop */
-}
-
-/* Throttle the frame rate -- only allow MACH64_MAX_QUEUED_FRAMES
- * pending swap buffers requests at a time.
- *
- * GH: We probably don't want a timeout here, as we can wait as
- * long as we want for a frame to complete. If it never does, then
- * the card has locked.
- */
-static int mach64WaitForFrameCompletion( mach64ContextPtr mmesa )
-{
- int fd = mmesa->driFd;
- int i;
- int wait = 0;
- int frames;
-
- while ( 1 ) {
- drm_mach64_getparam_t gp;
- int ret;
-
- if ( mmesa->sarea->frames_queued < MACH64_MAX_QUEUED_FRAMES ) {
- break;
- }
-
- if (MACH64_DEBUG & DEBUG_NOWAIT) {
- return 1;
- }
-
- gp.param = MACH64_PARAM_FRAMES_QUEUED;
- gp.value = &frames; /* also copied into sarea->frames_queued by DRM */
-
- ret = drmCommandWriteRead( fd, DRM_MACH64_GETPARAM, &gp, sizeof(gp) );
-
- if ( ret ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_GETPARAM: return = %d\n", ret );
- exit( -1 );
- }
-
- /* Spin in place a bit so we aren't hammering the register */
- wait++;
-
- for ( i = 0 ; i < 1024 ; i++ ) {
- delay();
- }
-
- }
-
- return wait;
-}
-
-/* Copy the back color buffer to the front color buffer.
- */
-void mach64CopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- mach64ContextPtr mmesa;
- GLint nbox, i, ret;
- drm_clip_rect_t *pbox;
- GLboolean missed_target;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- mmesa = (mach64ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "\n********************************\n" );
- fprintf( stderr, "\n%s( %p )\n\n",
- __FUNCTION__, mmesa->glCtx );
- fflush( stderr );
- }
-
- /* Flush any outstanding vertex buffers */
- FLUSH_BATCH( mmesa );
-
- LOCK_HARDWARE( mmesa );
-
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- */
- if ( !mach64WaitForFrameCompletion( mmesa ) ) {
- mmesa->hardwareWentIdle = 1;
- } else {
- mmesa->hardwareWentIdle = 0;
- }
-
-#if ENABLE_PERF_BOXES
- if ( mmesa->boxes ) {
- mach64PerformanceBoxesLocked( mmesa );
- }
-#endif
-
- UNLOCK_HARDWARE( mmesa );
- driWaitForVBlank( dPriv, &mmesa->vbl_seq, mmesa->vblank_flags, &missed_target );
- LOCK_HARDWARE( mmesa );
-
- /* use front buffer cliprects */
- nbox = dPriv->numClipRects;
- pbox = dPriv->pClipRects;
-
- for ( i = 0 ; i < nbox ; ) {
- GLint nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS , nbox );
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- GLint n = 0;
-
- for ( ; i < nr ; i++ ) {
- *b++ = pbox[i];
- n++;
- }
- mmesa->sarea->nbox = n;
-
- ret = drmCommandNone( mmesa->driFd, DRM_MACH64_SWAP );
-
- if ( ret ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_SWAP: return = %d\n", ret );
- exit( -1 );
- }
- }
-
- if ( MACH64_DEBUG & DEBUG_ALWAYS_SYNC ) {
- mach64WaitForIdleLocked( mmesa );
- }
-
- UNLOCK_HARDWARE( mmesa );
-
- mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
- MACH64_UPLOAD_MISC |
- MACH64_UPLOAD_CLIPRECTS);
-
-#if ENABLE_PERF_BOXES
- /* Log the performance counters if necessary */
- mach64PerformanceCounters( mmesa );
-#endif
-}
-
-#if ENABLE_PERF_BOXES
-/* ================================================================
- * Performance monitoring
- */
-
-void mach64PerformanceCounters( mach64ContextPtr mmesa )
-{
-
- if (MACH64_DEBUG & DEBUG_VERBOSE_COUNT) {
- /* report performance counters */
- fprintf( stderr, "mach64CopyBuffer: vertexBuffers:%i drawWaits:%i clears:%i\n",
- mmesa->c_vertexBuffers, mmesa->c_drawWaits, mmesa->c_clears );
- }
-
- mmesa->c_vertexBuffers = 0;
- mmesa->c_drawWaits = 0;
- mmesa->c_clears = 0;
-
- if ( mmesa->c_textureSwaps || mmesa->c_textureBytes || mmesa->c_agpTextureBytes ) {
- if (MACH64_DEBUG & DEBUG_VERBOSE_COUNT) {
- fprintf( stderr, " textureSwaps:%i textureBytes:%i agpTextureBytes:%i\n",
- mmesa->c_textureSwaps, mmesa->c_textureBytes, mmesa->c_agpTextureBytes );
- }
- mmesa->c_textureSwaps = 0;
- mmesa->c_textureBytes = 0;
- mmesa->c_agpTextureBytes = 0;
- }
-
- mmesa->c_texsrc_agp = 0;
- mmesa->c_texsrc_card = 0;
-
- if (MACH64_DEBUG & DEBUG_VERBOSE_COUNT)
- fprintf( stderr, "---------------------------------------------------------\n" );
-}
-
-
-void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
-{
- GLint ret;
- drm_mach64_clear_t clear;
- GLint x, y, w, h;
- GLuint color;
- GLint nbox;
- GLint x1, y1, x2, y2;
- drm_clip_rect_t *b = mmesa->sarea->boxes;
-
- /* save cliprects */
- nbox = mmesa->sarea->nbox;
- x1 = b[0].x1;
- y1 = b[0].y1;
- x2 = b[0].x2;
- y2 = b[0].y2;
-
- /* setup a single cliprect and call the clear ioctl for each box */
- mmesa->sarea->nbox = 1;
-
- w = h = 8;
- x = mmesa->drawX;
- y = mmesa->drawY;
- b[0].x1 = x;
- b[0].x2 = x + w;
- b[0].y1 = y;
- b[0].y2 = y + h;
-
- clear.flags = MACH64_BACK;
- clear.clear_depth = 0;
-
- /* Red box if DDFinish was called to wait for rendering to complete */
- if ( mmesa->c_drawWaits ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 255, 0, 0, 0 );
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
-
- }
-
- x += w;
- b[0].x1 = x;
- b[0].x2 = x + w;
-
- /* draw a green box if we had to wait for previous frame(s) to complete */
- if ( !mmesa->hardwareWentIdle ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 0, 255, 0, 0 );
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
-
- }
-
- x += w;
- w = 20;
- b[0].x1 = x;
-
- /* show approx. ratio of AGP/card textures used - Blue = AGP, Purple = Card */
- if ( mmesa->c_texsrc_agp || mmesa->c_texsrc_card ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 0, 0, 255, 0 );
- w = ((GLfloat)mmesa->c_texsrc_agp / (GLfloat)(mmesa->c_texsrc_agp + mmesa->c_texsrc_card))*20;
- if (w > 1) {
-
- b[0].x2 = x + w;
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
- }
-
- x += w;
- w = 20 - w;
-
- if (w > 1) {
- b[0].x1 = x;
- b[0].x2 = x + w;
-
- color = mach64PackColor( mmesa->mach64Screen->cpp, 255, 0, 255, 0 );
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
- }
- }
-
- x += w;
- w = 8;
- b[0].x1 = x;
- b[0].x2 = x + w;
-
- /* Yellow box if we swapped textures */
- if ( mmesa->c_textureSwaps ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 255, 255, 0, 0 );
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
-
- }
-
- h = 4;
- x += 8;
- b[0].x1 = x;
- b[0].y2 = y + h;
-
- /* Purple bar for card memory texture blits/uploads */
- if ( mmesa->c_textureBytes ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 255, 0, 255, 0 );
- w = mmesa->c_textureBytes / 16384;
- if ( w <= 0 )
- w = 1;
- if (w > (mmesa->driDrawable->w - 44))
- w = mmesa->driDrawable->w - 44;
-
- b[0].x2 = x + w;
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
- }
-
- /* Blue bar for AGP memory texture blits/uploads */
- if ( mmesa->c_agpTextureBytes ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 0, 0, 255, 0 );
- w = mmesa->c_agpTextureBytes / 16384;
- if ( w <= 0 )
- w = 1;
- if (w > (mmesa->driDrawable->w - 44))
- w = mmesa->driDrawable->w - 44;
-
- y += 4;
- b[0].x2 = x + w;
- b[0].y1 = y;
- b[0].y2 = y + h;
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
- }
-
- /* Pink bar for number of vertex buffers used */
- if ( mmesa->c_vertexBuffers ) {
- color = mach64PackColor( mmesa->mach64Screen->cpp, 196, 128, 128, 0 );
-
- w = mmesa->c_vertexBuffers;
- if (w > (mmesa->driDrawable->w))
- w = mmesa->driDrawable->w;
-
- h = 8;
- x = mmesa->drawX;
- y = mmesa->drawY + 8;
- b[0].x1 = x;
- b[0].x2 = x + w;
- b[0].y1 = y;
- b[0].y2 = y + h;
-
- clear.x = x;
- clear.y = y;
- clear.w = w;
- clear.h = h;
- clear.clear_color = color;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if (ret < 0) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
- }
-
- /* restore cliprects */
- mmesa->sarea->nbox = nbox;
- b[0].x1 = x1;
- b[0].y1 = y1;
- b[0].x2 = x2;
- b[0].y2 = y2;
-
-}
-
-#endif
-
-/* ================================================================
- * Buffer clear
- */
-
-static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- drm_mach64_clear_t clear;
- GLuint flags = 0;
- GLint i;
- GLint ret;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s: all=%d %d,%d %dx%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
- }
-
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- mmesa->c_clears++;
-#endif
-
- FLUSH_BATCH( mmesa );
-
- /* The only state changes we care about here are the RGBA colormask
- * and scissor/clipping. We'll just update that state, if needed.
- */
- if ( mmesa->new_state & (MACH64_NEW_MASKS | MACH64_NEW_CLIP) ) {
- const GLuint save_state = mmesa->new_state;
- mmesa->new_state &= (MACH64_NEW_MASKS | MACH64_NEW_CLIP);
- mach64DDUpdateHWState( ctx );
- mmesa->new_state = save_state & ~(MACH64_NEW_MASKS | MACH64_NEW_CLIP);
- }
-
- if ( mask & BUFFER_BIT_FRONT_LEFT ) {
- flags |= MACH64_FRONT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ( mask & BUFFER_BIT_BACK_LEFT ) {
- flags |= MACH64_BACK;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) {
- flags |= MACH64_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-
- if ( !flags )
- return;
-
- LOCK_HARDWARE( mmesa );
-
- /* This needs to be in the locked region, so updated drawable origin is used */
- /* Flip top to bottom */
- cx += mmesa->drawX;
- cy = mmesa->drawY + dPriv->h - cy - ch;
-
- /* HACK?
- */
- if ( mmesa->dirty & ~MACH64_UPLOAD_CLIPRECTS ) {
- mach64EmitHwStateLocked( mmesa );
- }
-
- for ( i = 0 ; i < mmesa->numClipRects ; ) {
- int nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS, mmesa->numClipRects );
- drm_clip_rect_t *box = mmesa->pClipRects;
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- GLint n = 0;
-
- if ( !all ) {
- for ( ; i < nr ; i++ ) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if ( x < cx ) w -= cx - x, x = cx;
- if ( y < cy ) h -= cy - y, y = cy;
- if ( x + w > cx + cw ) w = cx + cw - x;
- if ( y + h > cy + ch ) h = cy + ch - y;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- }
-
- mmesa->sarea->nbox = n;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_IOCTL ) {
- fprintf( stderr,
- "DRM_MACH64_CLEAR: flag 0x%x color %x depth %x nbox %d\n",
- flags,
- (GLuint)mmesa->ClearColor,
- (GLuint)mmesa->ClearDepth,
- mmesa->sarea->nbox );
- }
-
- clear.flags = flags;
- clear.x = cx;
- clear.y = cy;
- clear.w = cw;
- clear.h = ch;
- clear.clear_color = mmesa->ClearColor;
- clear.clear_depth = mmesa->ClearDepth;
-
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
- &clear, sizeof(drm_mach64_clear_t) );
-
- if ( ret ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret );
- exit( -1 );
- }
- }
-
- UNLOCK_HARDWARE( mmesa );
-
- mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
- MACH64_UPLOAD_MISC |
- MACH64_UPLOAD_CLIPRECTS);
-
-}
-
-
-void mach64WaitForIdleLocked( mach64ContextPtr mmesa )
-{
- int fd = mmesa->driFd;
- int to = 0;
- int ret;
-
- do {
- ret = drmCommandNone( fd, DRM_MACH64_IDLE );
- } while ( ( ret == -EBUSY ) && ( to++ < MACH64_TIMEOUT ) );
-
- if ( ret < 0 ) {
- drmCommandNone( fd, DRM_MACH64_RESET );
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "Error: Mach64 timed out... exiting\n" );
- exit( -1 );
- }
-}
-
-/* Flush the DMA queue to the hardware */
-void mach64FlushDMALocked( mach64ContextPtr mmesa )
-{
- int fd = mmesa->driFd;
- int ret;
-
- ret = drmCommandNone( fd, DRM_MACH64_FLUSH );
-
- if ( ret < 0 ) {
- drmCommandNone( fd, DRM_MACH64_RESET );
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "Error flushing DMA... exiting\n" );
- exit( -1 );
- }
-
- mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
- MACH64_UPLOAD_MISC |
- MACH64_UPLOAD_CLIPRECTS);
-
-}
-
-/* For client-side state emits - currently unused */
-void mach64UploadHwStateLocked( mach64ContextPtr mmesa )
-{
- drm_mach64_sarea_t *sarea = mmesa->sarea;
-
- drm_mach64_context_regs_t *regs = &sarea->context_state;
- unsigned int dirty = sarea->dirty;
- CARD32 offset = ((regs->tex_size_pitch & 0xf0) >> 2);
-
- DMALOCALS;
-
- DMAGETPTR( 19*2 );
-
- if ( dirty & MACH64_UPLOAD_MISC ) {
- DMAOUTREG( MACH64_DP_MIX, regs->dp_mix );
- DMAOUTREG( MACH64_DP_SRC, regs->dp_src );
- DMAOUTREG( MACH64_CLR_CMP_CNTL, regs->clr_cmp_cntl );
- DMAOUTREG( MACH64_GUI_TRAJ_CNTL, regs->gui_traj_cntl );
- DMAOUTREG( MACH64_SC_LEFT_RIGHT, regs->sc_left_right );
- DMAOUTREG( MACH64_SC_TOP_BOTTOM, regs->sc_top_bottom );
- sarea->dirty &= ~MACH64_UPLOAD_MISC;
- }
-
- if ( dirty & MACH64_UPLOAD_DST_OFF_PITCH ) {
- DMAOUTREG( MACH64_DST_OFF_PITCH, regs->dst_off_pitch );
- sarea->dirty &= ~MACH64_UPLOAD_DST_OFF_PITCH;
- }
- if ( dirty & MACH64_UPLOAD_Z_OFF_PITCH ) {
- DMAOUTREG( MACH64_Z_OFF_PITCH, regs->z_off_pitch );
- sarea->dirty &= ~MACH64_UPLOAD_Z_OFF_PITCH;
- }
- if ( dirty & MACH64_UPLOAD_Z_ALPHA_CNTL ) {
- DMAOUTREG( MACH64_Z_CNTL, regs->z_cntl );
- DMAOUTREG( MACH64_ALPHA_TST_CNTL, regs->alpha_tst_cntl );
- sarea->dirty &= ~MACH64_UPLOAD_Z_ALPHA_CNTL;
- }
- if ( dirty & MACH64_UPLOAD_SCALE_3D_CNTL ) {
- DMAOUTREG( MACH64_SCALE_3D_CNTL, regs->scale_3d_cntl );
- sarea->dirty &= ~MACH64_UPLOAD_SCALE_3D_CNTL;
- }
- if ( dirty & MACH64_UPLOAD_DP_FOG_CLR ) {
- DMAOUTREG( MACH64_DP_FOG_CLR, regs->dp_fog_clr );
- sarea->dirty &= ~MACH64_UPLOAD_DP_FOG_CLR;
- }
- if ( dirty & MACH64_UPLOAD_DP_WRITE_MASK ) {
- DMAOUTREG( MACH64_DP_WRITE_MASK, regs->dp_write_mask );
- sarea->dirty &= ~MACH64_UPLOAD_DP_WRITE_MASK;
- }
- if ( dirty & MACH64_UPLOAD_DP_PIX_WIDTH ) {
- DMAOUTREG( MACH64_DP_PIX_WIDTH, regs->dp_pix_width );
- sarea->dirty &= ~MACH64_UPLOAD_DP_PIX_WIDTH;
- }
- if ( dirty & MACH64_UPLOAD_SETUP_CNTL ) {
- DMAOUTREG( MACH64_SETUP_CNTL, regs->setup_cntl );
- sarea->dirty &= ~MACH64_UPLOAD_SETUP_CNTL;
- }
-
- if ( dirty & MACH64_UPLOAD_TEXTURE ) {
- DMAOUTREG( MACH64_TEX_SIZE_PITCH, regs->tex_size_pitch );
- DMAOUTREG( MACH64_TEX_CNTL, regs->tex_cntl );
- DMAOUTREG( MACH64_SECONDARY_TEX_OFF, regs->secondary_tex_off );
- DMAOUTREG( MACH64_TEX_0_OFF + offset, regs->tex_offset );
- sarea->dirty &= ~MACH64_UPLOAD_TEXTURE;
- }
-
-#if 0
- if ( dirty & MACH64_UPLOAD_CLIPRECTS ) {
- DMAOUTREG( MACH64_SC_LEFT_RIGHT, regs->sc_left_right );
- DMAOUTREG( MACH64_SC_TOP_BOTTOM, regs->sc_top_bottom );
- sarea->dirty &= ~MACH64_UPLOAD_CLIPRECTS;
- }
-#endif
-
- sarea->dirty = 0;
-
- DMAADVANCE();
-}
-
-void mach64InitIoctlFuncs( struct dd_function_table *functions )
-{
- functions->Clear = mach64DDClear;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.h
deleted file mode 100644
index 8bd958531..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_ioctl.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_IOCTL_H__
-#define __MACH64_IOCTL_H__
-
-#include "mach64_dri.h"
-#include "mach64_reg.h"
-#include "mach64_lock.h"
-
-#define MACH64_BUFFER_MAX_DWORDS (MACH64_BUFFER_SIZE / sizeof(CARD32))
-
-
-extern drmBufPtr mach64GetBufferLocked( mach64ContextPtr mmesa );
-extern void mach64FlushVerticesLocked( mach64ContextPtr mmesa );
-extern void mach64FlushDMALocked( mach64ContextPtr mmesa );
-extern void mach64UploadHwStateLocked( mach64ContextPtr mmesa );
-
-static __inline void *mach64AllocDmaLow( mach64ContextPtr mmesa, int bytes )
-{
- CARD32 *head;
-
- if ( mmesa->vert_used + bytes > mmesa->vert_total ) {
- LOCK_HARDWARE( mmesa );
- mach64FlushVerticesLocked( mmesa );
- UNLOCK_HARDWARE( mmesa );
- }
-
- head = (CARD32 *)((char *)mmesa->vert_buf + mmesa->vert_used);
- mmesa->vert_used += bytes;
-
- return head;
-}
-
-static __inline void *mach64AllocDmaLocked( mach64ContextPtr mmesa, int bytes )
-{
- CARD32 *head;
-
- if ( mmesa->vert_used + bytes > mmesa->vert_total ) {
- mach64FlushVerticesLocked( mmesa );
- }
-
- head = (CARD32 *)((char *)mmesa->vert_buf + mmesa->vert_used);
- mmesa->vert_used += bytes;
-
- return head;
-}
-
-extern void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
- GLint offset, GLint pitch, GLint format,
- GLint x, GLint y, GLint width, GLint height );
-
-extern void mach64CopyBuffer( const __DRIdrawablePrivate *dPriv );
-#if ENABLE_PERF_BOXES
-extern void mach64PerformanceCounters( mach64ContextPtr mmesa );
-extern void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa );
-#endif
-extern void mach64WaitForIdleLocked( mach64ContextPtr mmesa );
-
-extern void mach64InitIoctlFuncs( struct dd_function_table *functions );
-
-/* ================================================================
- * Helper macros:
- */
-
-#define FLUSH_BATCH( mmesa ) \
-do { \
- if ( MACH64_DEBUG & DEBUG_VERBOSE_IOCTL ) \
- fprintf( stderr, "FLUSH_BATCH in %s\n", __FUNCTION__ ); \
- if ( mmesa->vert_used ) { \
- mach64FlushVertices( mmesa ); \
- } \
-} while (0)
-
-/* According to a comment in ATIMach64Sync (atimach64.c) in the DDX:
- *
- * "For VTB's and later, the first CPU read of the framebuffer will return
- * zeroes [...] This appears to be due to some kind of engine
- * caching of framebuffer data I haven't found any way of disabling, or
- * otherwise circumventing."
- */
-#define FINISH_DMA_LOCKED( mmesa ) \
-do { \
- CARD32 _tmp; \
- if ( MACH64_DEBUG & DEBUG_VERBOSE_IOCTL ) \
- fprintf( stderr, "FINISH_DMA_LOCKED in %s\n", __FUNCTION__ ); \
- if ( mmesa->vert_used ) { \
- mach64FlushVerticesLocked( mmesa ); \
- } \
- mach64WaitForIdleLocked( mmesa ); \
- /* pre-read framebuffer to counter caching problem */ \
- _tmp = *(volatile CARD32 *)mmesa->driScreen->pFB; \
-} while (0)
-
-#define FLUSH_DMA_LOCKED( mmesa ) \
-do { \
- if ( MACH64_DEBUG & DEBUG_VERBOSE_IOCTL ) \
- fprintf( stderr, "FLUSH_DMA_LOCKED in %s\n", __FUNCTION__ ); \
- if ( mmesa->vert_used ) { \
- mach64FlushVerticesLocked( mmesa ); \
- } \
- mach64FlushDMALocked( mmesa ); \
-} while (0)
-
-#define mach64FlushVertices( mmesa ) \
-do { \
- LOCK_HARDWARE( mmesa ); \
- mach64FlushVerticesLocked( mmesa ); \
- UNLOCK_HARDWARE( mmesa ); \
-} while (0)
-
-#define mach64WaitForIdle( mmesa ) \
-do { \
- LOCK_HARDWARE( mmesa ); \
- mach64WaitForIdleLocked( mmesa ); \
- UNLOCK_HARDWARE( mmesa ); \
-} while (0)
-
-
-#endif /* __MACH64_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.c
deleted file mode 100644
index 3d41d71b3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_state.h"
-#include "mach64_lock.h"
-#include "mach64_tex.h"
-
-#if DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void mach64GetLock( mach64ContextPtr mmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- __DRIscreenPrivate *sPriv = mmesa->driScreen;
- drm_mach64_sarea_t *sarea = mmesa->sarea;
- int i;
-
- drmGetLock( mmesa->driFd, mmesa->hHWContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( mmesa->lastStamp != dPriv->lastStamp ) {
- mmesa->lastStamp = dPriv->lastStamp;
- if (mmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
- mach64SetCliprects( mmesa->glCtx, GL_BACK_LEFT );
- else
- mach64SetCliprects( mmesa->glCtx, GL_FRONT_LEFT );
- mach64CalcViewport( mmesa->glCtx );
- }
-
- mmesa->dirty |= (MACH64_UPLOAD_CONTEXT
- | MACH64_UPLOAD_MISC
- | MACH64_UPLOAD_CLIPRECTS);
-
- if ( sarea->ctx_owner != mmesa->hHWContext ) {
- sarea->ctx_owner = mmesa->hHWContext;
- mmesa->dirty = MACH64_UPLOAD_ALL;
- }
-
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- if ( mmesa->texHeap[i] && (sarea->tex_age[i] != mmesa->lastTexAge[i]) ) {
- mach64AgeTextures( mmesa, i );
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.h
deleted file mode 100644
index 973880ee2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_lock.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __MACH64_LOCK_H__
-#define __MACH64_LOCK_H__
-
-extern void mach64GetLock( mach64ContextPtr mmesa, GLuint flags );
-
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 1
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( mmesa ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( mmesa->driHwLock, mmesa->hHWContext, \
- (DRM_LOCK_HELD | mmesa->hHWContext), __ret ); \
- if ( __ret ) \
- mach64GetLock( mmesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-/* Unlock the hardware.
- */
-#define UNLOCK_HARDWARE( mmesa ) \
- do { \
- DRM_UNLOCK( mmesa->driFd, \
- mmesa->driHwLock, \
- mmesa->hHWContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-#endif /* __MACH64_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vb.c
deleted file mode 100644
index 7872c206f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vb.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Original authors:
- * Keith Whitwell <keithw@valinux.com>
- *
- * Adapted to Mach64 by:
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "math/m_translate.h"
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-void TAG(translate_vertex)(GLcontext *ctx,
- const VERTEX *src,
- SWvertex *dst)
-{
- LOCALVARS
- GLuint format = GET_VERTEX_FORMAT();
- UNVIEWPORT_VARS;
- CARD32 *p = (CARD32 *)src + 10 - mmesa->vertex_size;
-
- dst->win[3] = 1.0;
-
- switch ( format ) {
- case TEX1_VERTEX_FORMAT:
-#ifdef MACH64_PREMULT_TEXCOORDS
- {
- float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
-
- dst->texcoord[1][0] = rhw*LE32_IN_FLOAT( p++ );
- dst->texcoord[1][1] = rhw*LE32_IN_FLOAT( p++ );
- }
-#else
- dst->texcoord[1][0] = LE32_IN_FLOAT( p++ );
- dst->texcoord[1][1] = LE32_IN_FLOAT( p++ );
-#endif
- dst->texcoord[1][3] = 1.0;
- p++;
-
- case TEX0_VERTEX_FORMAT:
-#ifdef MACH64_PREMULT_TEXCOORDS
- {
- float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
-
- dst->texcoord[0][0] = rhw*LE32_IN_FLOAT( p++ );
- dst->texcoord[0][1] = rhw*LE32_IN_FLOAT( p++ );
- }
-#else
- dst->texcoord[0][0] = LE32_IN_FLOAT( p++ );
- dst->texcoord[0][1] = LE32_IN_FLOAT( p++ );
-#endif
- dst->texcoord[0][3] = 1.0;
- dst->win[3] = LE32_IN_FLOAT( p++ );
-
- case NOTEX_VERTEX_FORMAT:
- dst->specular[2] = ((GLubyte *)p)[0];
- dst->specular[1] = ((GLubyte *)p)[1];
- dst->specular[0] = ((GLubyte *)p)[2];
- dst->fog = ((GLubyte *)p)[3];
- p++;
-
- case TINY_VERTEX_FORMAT:
- dst->win[2] = UNVIEWPORT_Z( LE32_IN( p++ ) );
-
- dst->color[2] = ((GLubyte *)p)[0];
- dst->color[1] = ((GLubyte *)p)[1];
- dst->color[0] = ((GLubyte *)p)[2];
- dst->color[3] = ((GLubyte *)p)[3];
- p++;
-
- {
- GLuint xy = LE32_IN( p );
-
- dst->win[0] = UNVIEWPORT_X( (GLfloat)(GLshort)( xy >> 16 ) );
- dst->win[1] = UNVIEWPORT_Y( (GLfloat)(GLshort)( xy & 0xffff ) );
- }
- }
-
- assert( p + 1 - (CARD32 *)src == 10 );
-
- dst->pointSize = ctx->Point._Size;
-}
-
-
-
-void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
-{
- LOCALVARS
- GLuint format = GET_VERTEX_FORMAT();
- CARD32 *p = (CARD32 *)v + 10 - mmesa->vertex_size;
-
- switch ( format ) {
- case TEX1_VERTEX_FORMAT:
- {
- GLfloat u, v, w;
-#ifdef MACH64_PREMULT_TEXCOORDS
- float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
-
- u = rhw*LE32_IN_FLOAT( p++ );
- v = rhw*LE32_IN_FLOAT( p++ );
-#else
- u = LE32_IN_FLOAT( p++ );
- v = LE32_IN_FLOAT( p++ );
-#endif
- w = LE32_IN_FLOAT( p++ );
- fprintf( stderr, "u1 %f v1 %f w1 %f\n", u, v, w );
- }
-
- case TEX0_VERTEX_FORMAT:
- {
- GLfloat u, v, w;
-#ifdef MACH64_PREMULT_TEXCOORDS
- float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
-
- u = rhw*LE32_IN_FLOAT( p++ );
- v = rhw*LE32_IN_FLOAT( p++ );
-#else
- u = LE32_IN_FLOAT( p++ );
- v = LE32_IN_FLOAT( p++ );
-#endif
- w = LE32_IN_FLOAT( p++ );
- fprintf( stderr, "u0 %f v0 %f w0 %f\n", u, v, w );
- }
-
- case NOTEX_VERTEX_FORMAT:
- {
- GLubyte r, g, b, a;
-
- b = ((GLubyte *)p)[0];
- g = ((GLubyte *)p)[1];
- r = ((GLubyte *)p)[2];
- a = ((GLubyte *)p)[3];
- p++;
- fprintf(stderr, "spec: r %d g %d b %d a %d\n", r, g, b, a);
- }
-
- case TINY_VERTEX_FORMAT:
- {
- GLuint xy;
- GLfloat x, y, z;
- GLubyte r, g, b, a;
-
- z = LE32_IN( p++ ) / 65536.0;
-
- b = ((GLubyte *)p)[0];
- g = ((GLubyte *)p)[1];
- r = ((GLubyte *)p)[2];
- a = ((GLubyte *)p)[3];
- p++;
- xy = LE32_IN( p );
- x = (GLfloat)(GLshort)( xy >> 16 ) / 4.0;
- y = (GLfloat)(GLshort)( xy & 0xffff ) / 4.0;
-
- fprintf(stderr, "x %f y %f z %f\n", x, y, z);
- fprintf(stderr, "r %d g %d b %d a %d\n", r, g, b, a);
- }
- }
-
- assert( p + 1 - (CARD32 *)v == 10 );
-
- fprintf(stderr, "\n");
-}
-
-/* Interpolate the elements of the VB not included in typical hardware
- * vertices.
- *
- * NOTE: All these arrays are guarenteed by tnl to be writeable and
- * have good stride.
- */
-#ifndef INTERP_QUALIFIER
-#define INTERP_QUALIFIER static
-#endif
-
-#define GET_COLOR(ptr, idx) ((ptr)->data[idx])
-
-
-INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
- GLfloat t,
- GLuint dst, GLuint out, GLuint in,
- GLboolean force_boundary )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
-
- INTERP_4F( t,
- GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], out),
- GET_COLOR(VB->ColorPtr[1], in) );
-
- if (VB->SecondaryColorPtr[1]) {
- INTERP_3F( t,
- GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], out),
- GET_COLOR(VB->SecondaryColorPtr[1], in) );
- }
- }
-
- if (VB->EdgeFlag) {
- VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
- }
-
- INTERP_VERTEX(ctx, t, dst, out, in, force_boundary);
-}
-
-INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
- GLuint dst, GLuint src )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], src) );
-
- if (VB->SecondaryColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], src) );
- }
- }
-
- COPY_PV_VERTEX(ctx, dst, src);
-}
-
-
-#undef INTERP_QUALIFIER
-#undef GET_COLOR
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
deleted file mode 100644
index f64b808ee..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
+++ /dev/null
@@ -1,562 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Original authors:
- * Keith Whitwell <keithw@valinux.com>
- *
- * Adapted to Mach64 by:
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-
-/* DO_XYZW: Emit xyz and maybe w coordinates.
- * DO_RGBA: Emit color.
- * DO_SPEC: Emit specular color.
- * DO_FOG: Emit fog coordinate in specular alpha.
- * DO_TEX0: Emit tex0 u,v coordinates.
- * DO_TEX1: Emit tex1 u,v coordinates.
- * DO_PTEX: Emit tex0,1 q coordinates where possible.
- *
- * Additionally, this template assumes it is emitting *transformed*
- * vertices; the modifications to emit untransformed vertices (ie. to
- * t&l hardware) are probably too great to cooexist with the code
- * already in this file.
- */
-
-#define VIEWPORT_X(x) ((GLint) ((s[0] * (x) + s[12]) * 4.0))
-#define VIEWPORT_Y(y) ((GLint) ((s[5] * (y) + s[13]) * 4.0))
-#define VIEWPORT_Z(z) (((GLuint) (s[10] * (z) + s[14])) << 15)
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-static void TAG(emit)( GLcontext *ctx,
- GLuint start, GLuint end,
- void *dest,
- GLuint stride )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-#if DO_TEX1
- GLfloat (*tc1)[4];
- GLuint tc1_stride;
-#if DO_PTEX
- GLuint tc1_size;
-#endif
-#endif
-#if DO_TEX0
- GLfloat (*tc0)[4];
- GLuint tc0_stride;
-#if DO_PTEX
- GLuint tc0_size;
-#endif
-#endif
-#if DO_SPEC
- GLfloat (*spec)[4];
- GLuint spec_stride;
-#endif
-#if DO_FOG
- GLfloat (*fog)[4];
- GLuint fog_stride;
-#endif
-#if DO_RGBA
- GLfloat (*col)[4];
- GLuint col_stride;
-#endif
- GLfloat (*coord)[4];
- GLuint coord_stride;
- VERTEX *v = (VERTEX *)dest;
- const GLfloat *s = GET_VIEWPORT_MAT();
-#if DO_TEX1 || DO_TEX0 || DO_XYZW
- const GLubyte *mask = VB->ClipMask;
-#endif
- int i;
-
-#if !DO_XYZW
- (void) s; /* Quiet compiler */
-#endif
-/* fprintf(stderr, "%s(big) importable %d %d..%d\n", */
-/* __FUNCTION__, VB->importable_data, start, end); */
-
-#if DO_TEX1
- {
- const GLuint t1 = GET_TEXSOURCE(1);
- tc1 = VB->TexCoordPtr[t1]->data;
- tc1_stride = VB->TexCoordPtr[t1]->stride;
-#if DO_PTEX
- tc1_size = VB->TexCoordPtr[t1]->size;
-#endif
- }
-#endif
-
-#if DO_TEX0
- {
- const GLuint t0 = GET_TEXSOURCE(0);
- tc0 = VB->TexCoordPtr[t0]->data;
- tc0_stride = VB->TexCoordPtr[t0]->stride;
-#if DO_PTEX
- tc0_size = VB->TexCoordPtr[t0]->size;
-#endif
- }
-#endif
-
-#if DO_SPEC
- if (VB->SecondaryColorPtr[0]) {
- spec = VB->SecondaryColorPtr[0]->data;
- spec_stride = VB->SecondaryColorPtr[0]->stride;
- } else {
- spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
- spec_stride = 0;
- }
-#endif
-
-#if DO_FOG
- if (VB->FogCoordPtr) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
- } else {
- static GLfloat tmp[4] = {0, 0, 0, 0};
- fog = &tmp;
- fog_stride = 0;
- }
-#endif
-
-#if DO_RGBA
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
-#endif
-
- coord = VB->NdcPtr->data;
- coord_stride = VB->NdcPtr->stride;
-
- if (start) {
-#if DO_TEX1
- STRIDE_4F(tc1, start * tc1_stride);
-#endif
-#if DO_TEX0
- STRIDE_4F(tc0, start * tc0_stride);
-#endif
-#if DO_SPEC
- STRIDE_4F(spec, start * spec_stride);
-#endif
-#if DO_FOG
- STRIDE_4F(fog, start * fog_stride);
-#endif
-#if DO_RGBA
- STRIDE_4F(col, start * col_stride);
-#endif
- STRIDE_4F(coord, start * coord_stride);
- }
-
- for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
- CARD32 *p = (CARD32 *)v;
-#if DO_TEX1 || DO_TEX0
- GLfloat w;
-
- if (mask[i] == 0) {
- /* unclipped */
- w = coord[0][3];
- } else {
- /* clipped */
- w = 1.0;
- }
-#endif
-
-#if DO_TEX1
-#if DO_PTEX
- if (tc1_size == 4) {
-#ifdef MACH64_PREMULT_TEXCOORDS
- LE32_OUT_FLOAT( p++, w*tc1[0][0] ); /* VERTEX_?_SECONDARY_S */
- LE32_OUT_FLOAT( p++, w*tc1[0][1] ); /* VERTEX_?_SECONDARY_T */
- LE32_OUT_FLOAT( p++, w*tc1[0][3] ); /* VERTEX_?_SECONDARY_W */
-#else /* !MACH64_PREMULT_TEXCOORDS */
- float rhw = 1.0 / tc1[0][3];
- LE32_OUT_FLOAT( p++, rhw*tc1[0][0] ); /* VERTEX_?_SECONDARY_S */
- LE32_OUT_FLOAT( p++, rhw*tc1[0][1] ); /* VERTEX_?_SECONDARY_T */
- LE32_OUT_FLOAT( p++, w*tc1[0][3] ); /* VERTEX_?_SECONDARY_W */
-#endif /* !MACH64_PREMULT_TEXCOORDS */
- } else {
-#endif /* DO_PTEX */
-#ifdef MACH64_PREMULT_TEXCOORDS
- LE32_OUT_FLOAT( p++, w*tc1[0][0] ); /* VERTEX_?_SECONDARY_S */
- LE32_OUT_FLOAT( p++, w*tc1[0][1] ); /* VERTEX_?_SECONDARY_T */
- LE32_OUT_FLOAT( p++, w ); /* VERTEX_?_SECONDARY_W */
-#else /* !MACH64_PREMULT_TEXCOORDS */
- LE32_OUT_FLOAT( p++, tc1[0][0] ); /* VERTEX_?_SECONDARY_S */
- LE32_OUT_FLOAT( p++, tc1[0][1] ); /* VERTEX_?_SECONDARY_T */
- LE32_OUT_FLOAT( p++, w ); /* VERTEX_?_SECONDARY_W */
-#endif /* !MACH64_PREMULT_TEXCOORDS */
-#if DO_PTEX
- }
-#endif /* DO_PTEX */
- STRIDE_4F(tc1, tc1_stride);
-#else /* !DO_TEX1 */
- p += 3;
-#endif /* !DO_TEX1 */
-
-#if DO_TEX0
-#if DO_PTEX
- if (tc0_size == 4) {
-#ifdef MACH64_PREMULT_TEXCOORDS
- LE32_OUT_FLOAT( p++, w*tc0[0][0] ); /* VERTEX_?_S */
- LE32_OUT_FLOAT( p++, w*tc0[0][1] ); /* VERTEX_?_T */
- LE32_OUT_FLOAT( p++, w*tc0[0][3] ); /* VERTEX_?_W */
-#else /* !MACH64_PREMULT_TEXCOORDS */
- float rhw = 1.0 / tc0[0][3];
- LE32_OUT_FLOAT( p++, rhw*tc0[0][0] ); /* VERTEX_?_S */
- LE32_OUT_FLOAT( p++, rhw*tc0[0][1] ); /* VERTEX_?_T */
- LE32_OUT_FLOAT( p++, w*tc0[0][3] ); /* VERTEX_?_W */
-#endif /* !MACH64_PREMULT_TEXCOORDS */
- } else {
-#endif /* DO_PTEX */
-#ifdef MACH64_PREMULT_TEXCOORDS
- LE32_OUT_FLOAT( p++, w*tc0[0][0] ); /* VERTEX_?_S */
- LE32_OUT_FLOAT( p++, w*tc0[0][1] ); /* VERTEX_?_T */
- LE32_OUT_FLOAT( p++, w ); /* VERTEX_?_W */
-#else /* !MACH64_PREMULT_TEXCOORDS */
- LE32_OUT_FLOAT( p++, tc0[0][0] ); /* VERTEX_?_S */
- LE32_OUT_FLOAT( p++, tc0[0][1] ); /* VERTEX_?_T */
- LE32_OUT_FLOAT( p++, w ); /* VERTEX_?_W */
-#endif /* !MACH64_PREMULT_TEXCOORDS */
-#if DO_PTEX
- }
-#endif /* DO_PTEX */
- STRIDE_4F(tc0, tc0_stride);
-#else /* !DO_TEX0 */
- p += 3;
-#endif /* !DO_TEX0 */
-
-#if DO_SPEC
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[0], spec[0][2]); /* VERTEX_?_SPEC_B */
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[1], spec[0][1]); /* VERTEX_?_SPEC_G */
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[2], spec[0][0]); /* VERTEX_?_SPEC_R */
-
- STRIDE_4F(spec, spec_stride);
-#endif
-#if DO_FOG
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[3], fog[0][0]); /* VERTEX_?_SPEC_A */
- /* ((GLubyte *)p)[3] = fog[0][0] * 255.0; */
- STRIDE_4F(fog, fog_stride);
-#endif
- p++;
-
-#if DO_XYZW
- if (mask[i] == 0) {
- /* unclipped */
- LE32_OUT( p++, VIEWPORT_Z( coord[0][2] ) ); /* VERTEX_?_Z */
- } else {
-#endif
- p++;
-#if DO_XYZW
- }
-#endif
-
-#if DO_RGBA
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[0], col[0][2]);
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[1], col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[2], col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(((GLubyte *)p)[3], col[0][3]);
- p++;
- STRIDE_4F(col, col_stride);
-#else
- p++;
-#endif
-
-#if DO_XYZW
- if (mask[i] == 0) {
- /* unclipped */
- LE32_OUT( p,
- (VIEWPORT_X( coord[0][0] ) << 16) | /* VERTEX_?_X */
- (VIEWPORT_Y( coord[0][1] ) & 0xffff) ); /* VERTEX_?_Y */
-
- if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
- fprintf( stderr, "%s: vert %d: %.2f %.2f %.2f %x\n",
- __FUNCTION__,
- i,
- (LE32_IN( p ) >> 16)/4.0,
- (LE32_IN( p ) & 0xffff)/4.0,
- LE32_IN( p - 2 )/65536.0,
- *(GLuint *)(p - 1) );
- }
- }
-#endif
-#if DO_TEX1 || DO_TEX0 || DO_XYZW
- STRIDE_4F(coord, coord_stride);
-#endif
-
- assert( p + 1 - (CARD32 *)v == 10 );
- }
-}
-
-#if DO_XYZW && DO_RGBA
-
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* Force 'missing' texcoords to something valid.
- */
- if (DO_TEX1 && VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (DO_PTEX)
- return GL_TRUE;
-
- /* No hardware support for projective texture. Can fake it for
- * TEX0 only.
- */
- if ((DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) {
- PTEX_FALLBACK();
- return GL_FALSE;
- }
-
- if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) {
- if (DO_TEX1) {
- PTEX_FALLBACK();
- }
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte *ddverts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- GLfloat w;
- const GLfloat *s = GET_VIEWPORT_MAT();
-
- CARD32 *dst = (CARD32 *)(ddverts + (edst * size));
- CARD32 *in = (CARD32 *)(ddverts + (ein * size));
- CARD32 *out = (CARD32 *)(ddverts + (eout * size));
-
- (void)s;
-
- w = (dstclip[3] == 0.0F) ? 1.0 : (1.0 / dstclip[3]);
-
-#if DO_TEX1
- {
- GLfloat temp;
-#if DO_PTEX
- GLfloat wout = VB->NdcPtr->data[eout][3];
- GLfloat win = VB->NdcPtr->data[ein][3];
- GLfloat qout = LE32_IN_FLOAT( out + 2 ) / wout;
- GLfloat qin = LE32_IN_FLOAT( in + 2 ) / win;
- GLfloat qdst, rqdst;
-
- INTERP_F( t, qdst, qout, qin );
- rqdst = 1.0 / qdst;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_SECONDARY_S */
- dst++; out++; in++;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_SECONDARY_T */
- dst++; out++; in++;
-
- LE32_OUT_FLOAT( dst, w*rqdst ); /* VERTEX_?_SECONDARY_W */
- dst++; out++; in++;
-#else /* !DO_PTEX */
-#ifdef MACH64_PREMULT_TEXCOORDS
- GLfloat qout = w / LE32_IN_FLOAT( out + 2 );
- GLfloat qin = w / LE32_IN_FLOAT( in + 2 );
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_S */
- dst++; out++; in++;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_T */
- dst++; out++; in++;
-#else /* !MACH64_PREMULT_TEXCOORDS */
- INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_S */
- dst++; out++; in++;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_T */
- dst++; out++; in++;
-#endif /* !MACH64_PREMULT_TEXCOORDS */
- LE32_OUT_FLOAT( dst, w ); /* VERTEX_?_SECONDARY_W */
- dst++; out++; in++;
-#endif /* !DO_PTEX */
- }
-#else /* !DO_TEX1 */
- dst += 3; out += 3; in += 3;
-#endif /* !DO_TEX1 */
-
-#if DO_TEX0
- {
- GLfloat temp;
-#if DO_PTEX
- GLfloat wout = VB->NdcPtr->data[eout][3];
- GLfloat win = VB->NdcPtr->data[ein][3];
- GLfloat qout = LE32_IN_FLOAT( out + 2 ) / wout;
- GLfloat qin = LE32_IN_FLOAT( in + 2 ) / win;
- GLfloat qdst, rqdst;
-
- INTERP_F( t, qdst, qout, qin );
- rqdst = 1.0 / qdst;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_S */
- dst++; out++; in++;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_T */
- dst++; out++; in++;
-
- LE32_OUT_FLOAT( dst, w*rqdst ); /* VERTEX_?_W */
- dst++; out++; in++;
-#else /* !DO_PTEX */
-#ifdef MACH64_PREMULT_TEXCOORDS
- GLfloat qout = w / LE32_IN_FLOAT( out + 2 );
- GLfloat qin = w / LE32_IN_FLOAT( in + 2 );
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_S */
- dst++; out++; in++;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_T */
- dst++; out++; in++;
-#else /* !MACH64_PREMULT_TEXCOORDS */
- INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_S */
- dst++; out++; in++;
-
- INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) );
- LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_T */
- dst++; out++; in++;
-#endif /* !MACH64_PREMULT_TEXCOORDS */
- LE32_OUT_FLOAT( dst, w ); /* VERTEX_?_W */
- dst++; out++; in++;
-#endif /* !DO_PTEX */
- }
-#else /* !DO_TEX0 */
- dst += 3; out += 3; in += 3;
-#endif /* !DO_TEX0 */
-
-#if DO_SPEC
- INTERP_UB( t, ((GLubyte *)dst)[0], ((GLubyte *)out)[0], ((GLubyte *)in)[0] ); /* VERTEX_?_SPEC_B */
- INTERP_UB( t, ((GLubyte *)dst)[1], ((GLubyte *)out)[1], ((GLubyte *)in)[1] ); /* VERTEX_?_SPEC_G */
- INTERP_UB( t, ((GLubyte *)dst)[2], ((GLubyte *)out)[2], ((GLubyte *)in)[2] ); /* VERTEX_?_SPEC_R */
-#endif
-
-#if DO_FOG
- INTERP_UB( t, ((GLubyte *)dst)[3], ((GLubyte *)out)[3], ((GLubyte *)in)[3] ); /* VERTEX_?_SPEC_A */
-#endif /* DO_FOG */
-
- dst++; out++; in++;
-
- LE32_OUT( dst, VIEWPORT_Z( dstclip[2] * w ) ); /* VERTEX_?_Z */
- dst++; out++; in++;
-
- INTERP_UB( t, ((GLubyte *)dst)[0], ((GLubyte *)out)[0], ((GLubyte *)in)[0] ); /* VERTEX_?_B */
- INTERP_UB( t, ((GLubyte *)dst)[1], ((GLubyte *)out)[1], ((GLubyte *)in)[1] ); /* VERTEX_?_G */
- INTERP_UB( t, ((GLubyte *)dst)[2], ((GLubyte *)out)[2], ((GLubyte *)in)[2] ); /* VERTEX_?_R */
- INTERP_UB( t, ((GLubyte *)dst)[3], ((GLubyte *)out)[3], ((GLubyte *)in)[3] ); /* VERTEX_?_A */
- dst++; /*out++; in++;*/
-
- LE32_OUT( dst,
- (VIEWPORT_X( dstclip[0] * w ) << 16) | /* VERTEX_?_X */
- (VIEWPORT_Y( dstclip[1] * w ) & 0xffff) ); /* VERTEX_?_Y */
-
- assert( dst + 1 - (CARD32 *)(ddverts + (edst * size)) == 10 );
- assert( in + 2 - (CARD32 *)(ddverts + (ein * size)) == 10 );
- assert( out + 2 - (CARD32 *)(ddverts + (eout * size)) == 10 );
-
- if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
- fprintf( stderr, "%s: dst vert: %.2f %.2f %.2f %x\n",
- __FUNCTION__,
- (GLshort)(LE32_IN( dst ) >> 16)/4.0,
- (GLshort)(LE32_IN( dst ) & 0xffff)/4.0,
- LE32_IN( dst - 2 )/65536.0,
- *(GLuint *)(dst - 1) );
- }
-}
-
-#endif /* DO_RGBA && DO_XYZW */
-
-
-static void TAG(copy_pv)( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
-#if DO_SPEC || DO_FOG || DO_RGBA
- LOCALVARS
- GLubyte *verts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- GLuint *dst = (GLuint *)(verts + (edst * size));
- GLuint *src = (GLuint *)(verts + (esrc * size));
-#endif
-
-#if DO_SPEC || DO_FOG
- dst[6] = src[6]; /* VERTEX_?_SPEC_ARGB */
-#endif
-
-#if DO_RGBA
- dst[8] = src[8]; /* VERTEX_?_ARGB */
-#endif
-}
-
-static void TAG(init)( void )
-{
- setup_tab[IND].emit = TAG(emit);
-
-#if DO_XYZW && DO_RGBA
- setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes);
- setup_tab[IND].interp = TAG(interp);
-#endif
-
- setup_tab[IND].copy_pv = TAG(copy_pv);
-
-#if DO_TEX1
- setup_tab[IND].vertex_format = TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 10;
-#elif DO_TEX0
- setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 7;
-#elif DO_SPEC || DO_FOG
- setup_tab[IND].vertex_format = NOTEX_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 4;
-#else
- setup_tab[IND].vertex_format = TINY_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 3;
-#endif
-
-}
-
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_reg.h
deleted file mode 100644
index abbba295a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_reg.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_REG_H__
-#define __MACH64_REG_H__
-
-/*
- * Not sure how this compares with the G200, but the Rage Pro has two
- * banks of registers, with bank 0 at (aperture base + memmap offset - 1KB)
- * and bank 1 at (aperture base + memmap offset - 2KB). But, to send them
- * via DMA, we need to encode them as memory map select rather than physical
- * offsets.
- */
-#define DWMREG0 0x0400
-#define DWMREG0_END 0x07ff
-#define DWMREG1 0x0000
-#define DWMREG1_END 0x03ff
-
-#define ISREG0(r) ( ( (r) >= DWMREG0 ) && ( (r) <= DWMREG0_END ) )
-#define ADRINDEX0(r) ( ((r) - DWMREG0) >> 2 )
-#define ADRINDEX1(r) ( ( ((r) - DWMREG1) >> 2 ) | 0x0100 )
-#define ADRINDEX(r) ( ISREG0(r) ? ADRINDEX0(r) : ADRINDEX1(r) )
-
-#define MMREG0 0x0000
-#define MMREG0_END 0x00ff
-
-#define ISMMREG0(r) ( ( (r) >= MMREG0 ) && ( (r) <= MMREG0_END ) )
-#define MMSELECT0(r) ( ((r)<<2) + DWMREG0 )
-#define MMSELECT1(r) ( ( (((r) & 0xff)<<2) + DWMREG1 ) )
-#define MMSELECT(r) ( ISMMREG0(r) ? MMSELECT0(r) : MMSELECT1(r) )
-
-/* FIXME: If register reads are necessary, we should account for endianess here */
-#define MACH64_BASE(reg) ((CARD32)(mmesa->mach64Screen->mmio.map))
-#define MACH64_ADDR(reg) (MACH64_BASE(reg) + reg)
-
-#define MACH64_DEREF(reg) *(__volatile__ CARD32 *)MACH64_ADDR(reg)
-#define MACH64_READ(reg) MACH64_DEREF(reg)
-
-
-/* ================================================================
- * Registers
- */
-
-#define MACH64_ALPHA_TST_CNTL 0x0550
-# define MACH64_ALPHA_TEST_EN (1 << 0)
-# define MACH64_ALPHA_TEST_MASK (7 << 4)
-# define MACH64_ALPHA_TEST_NEVER (0 << 4)
-# define MACH64_ALPHA_TEST_LESS (1 << 4)
-# define MACH64_ALPHA_TEST_LEQUAL (2 << 4)
-# define MACH64_ALPHA_TEST_EQUAL (3 << 4)
-# define MACH64_ALPHA_TEST_GEQUAL (4 << 4)
-# define MACH64_ALPHA_TEST_GREATER (5 << 4)
-# define MACH64_ALPHA_TEST_NOTEQUAL (6 << 4)
-# define MACH64_ALPHA_TEST_ALWAYS (7 << 4)
-# define MACH64_ALPHA_MOD_MSB (1 << 7)
-# define MACH64_ALPHA_DST_MASK (7 << 8)
-# define MACH64_ALPHA_DST_ZERO (0 << 8)
-# define MACH64_ALPHA_DST_ONE (1 << 8)
-# define MACH64_ALPHA_DST_SRCALPHA (4 << 8)
-# define MACH64_ALPHA_DST_INVSRCALPHA (5 << 8)
-# define MACH64_ALPHA_DST_DSTALPHA (6 << 8)
-# define MACH64_ALPHA_DST_INVDSTALPHA (7 << 8)
-# define MACH64_ALPHA_TST_SRC_TEXEL (0 << 12)
-# define MACH64_ALPHA_TST_SRC_SRCALPHA (1 << 12)
-# define MACH64_REF_ALPHA_MASK (0xff << 16)
-# define MACH64_REF_ALPHA_SHIFT 16
-# define MACH64_COMPOSITE_SHADOW (1 << 30)
-# define MACH64_SPECULAR_LIGHT_EN (1 << 31)
-
-#define MACH64_BUS_CNTL 0x04a0
-# define MACH64_BUS_MSTR_RESET (1 << 1)
-# define MACH64_BUS_FLUSH_BUF (1 << 2)
-# define MACH64_BUS_MASTER_DIS (1 << 6)
-# define MACH64_BUS_EXT_REG_EN (1 << 27)
-
-#define MACH64_COMPOSITE_SHADOW_ID 0x0798
-
-#define MACH64_CLR_CMP_CLR 0x0700
-#define MACH64_CLR_CMP_CNTL 0x0708
-#define MACH64_CLR_CMP_MASK 0x0704
-
-#define MACH64_DP_BKGD_CLR 0x06c0
-#define MACH64_DP_FOG_CLR 0x06c4
-#define MACH64_DP_FGRD_BKGD_CLR 0x06e0
-#define MACH64_DP_FRGD_CLR 0x06c4
-#define MACH64_DP_FGRD_CLR_MIX 0x06dc
-
-#define MACH64_DP_MIX 0x06d4
-# define BKGD_MIX_NOT_D (0 << 0)
-# define BKGD_MIX_ZERO (1 << 0)
-# define BKGD_MIX_ONE (2 << 0)
-# define MACH64_BKGD_MIX_D (3 << 0)
-# define BKGD_MIX_NOT_S (4 << 0)
-# define BKGD_MIX_D_XOR_S (5 << 0)
-# define BKGD_MIX_NOT_D_XOR_S (6 << 0)
-# define MACH64_BKGD_MIX_S (7 << 0)
-# define BKGD_MIX_NOT_D_OR_NOT_S (8 << 0)
-# define BKGD_MIX_D_OR_NOT_S (9 << 0)
-# define BKGD_MIX_NOT_D_OR_S (10 << 0)
-# define BKGD_MIX_D_OR_S (11 << 0)
-# define BKGD_MIX_D_AND_S (12 << 0)
-# define BKGD_MIX_NOT_D_AND_S (13 << 0)
-# define BKGD_MIX_D_AND_NOT_S (14 << 0)
-# define BKGD_MIX_NOT_D_AND_NOT_S (15 << 0)
-# define BKGD_MIX_D_PLUS_S_DIV2 (23 << 0)
-# define FRGD_MIX_NOT_D (0 << 16)
-# define FRGD_MIX_ZERO (1 << 16)
-# define FRGD_MIX_ONE (2 << 16)
-# define FRGD_MIX_D (3 << 16)
-# define FRGD_MIX_NOT_S (4 << 16)
-# define FRGD_MIX_D_XOR_S (5 << 16)
-# define FRGD_MIX_NOT_D_XOR_S (6 << 16)
-# define MACH64_FRGD_MIX_S (7 << 16)
-# define FRGD_MIX_NOT_D_OR_NOT_S (8 << 16)
-# define FRGD_MIX_D_OR_NOT_S (9 << 16)
-# define FRGD_MIX_NOT_D_OR_S (10 << 16)
-# define FRGD_MIX_D_OR_S (11 << 16)
-# define FRGD_MIX_D_AND_S (12 << 16)
-# define FRGD_MIX_NOT_D_AND_S (13 << 16)
-# define FRGD_MIX_D_AND_NOT_S (14 << 16)
-# define FRGD_MIX_NOT_D_AND_NOT_S (15 << 16)
-# define FRGD_MIX_D_PLUS_S_DIV2 (23 << 16)
-
-#define MACH64_DP_PIX_WIDTH 0x06d0
-# define MACH64_COMPOSITE_PIX_WIDTH_MASK (0xf << 4)
-# define MACH64_HOST_TRIPLE_ENABLE (1 << 13)
-# define MACH64_BYTE_ORDER_MSB_TO_LSB (0 << 24)
-# define MACH64_BYTE_ORDER_LSB_TO_MSB (1 << 24)
-# define MACH64_SCALE_PIX_WIDTH_MASK (0xf << 28)
-
-#define MACH64_DP_SRC 0x06d8
-# define MACH64_BKGD_SRC_BKGD_CLR (0 << 0)
-# define MACH64_BKGD_SRC_FRGD_CLR (1 << 0)
-# define MACH64_BKGD_SRC_HOST (2 << 0)
-# define MACH64_BKGD_SRC_BLIT (3 << 0)
-# define MACH64_BKGD_SRC_PATTERN (4 << 0)
-# define MACH64_BKGD_SRC_3D (5 << 0)
-# define MACH64_FRGD_SRC_BKGD_CLR (0 << 8)
-# define MACH64_FRGD_SRC_FRGD_CLR (1 << 8)
-# define MACH64_FRGD_SRC_HOST (2 << 8)
-# define MACH64_FRGD_SRC_BLIT (3 << 8)
-# define MACH64_FRGD_SRC_PATTERN (4 << 8)
-# define MACH64_FRGD_SRC_3D (5 << 8)
-# define MACH64_MONO_SRC_ONE (0 << 16)
-# define MACH64_MONO_SRC_PATTERN (1 << 16)
-# define MACH64_MONO_SRC_HOST (2 << 16)
-# define MACH64_MONO_SRC_BLIT (3 << 16)
-
-#define MACH64_DP_WRITE_MASK 0x06c8
-
-#define MACH64_DST_CNTL 0x0530
-# define MACH64_DST_X_RIGHT_TO_LEFT (0 << 0)
-# define MACH64_DST_X_LEFT_TO_RIGHT (1 << 0)
-# define MACH64_DST_Y_BOTTOM_TO_TOP (0 << 1)
-# define MACH64_DST_Y_TOP_TO_BOTTOM (1 << 1)
-# define MACH64_DST_X_MAJOR (0 << 2)
-# define MACH64_DST_Y_MAJOR (1 << 2)
-# define MACH64_DST_X_TILE (1 << 3)
-# define MACH64_DST_Y_TILE (1 << 4)
-# define MACH64_DST_LAST_PEL (1 << 5)
-# define MACH64_DST_POLYGON_ENABLE (1 << 6)
-# define MACH64_DST_24_ROTATION_ENABLE (1 << 7)
-
-#define MACH64_DST_HEIGHT_WIDTH 0x0518
-#define MACH64_DST_OFF_PITCH 0x0500
-#define MACH64_DST_WIDTH_HEIGHT 0x06ec
-#define MACH64_DST_X_Y 0x06e8
-#define MACH64_DST_Y_X 0x050c
-
-#define MACH64_FIFO_STAT 0x0710
-# define MACH64_FIFO_SLOT_MASK 0x0000ffff
-# define MACH64_FIFO_ERR (1 << 31)
-
-#define MACH64_GEN_TEST_CNTL 0x04d0
-#define MACH64_GUI_CMDFIFO_DEBUG 0x0170
-#define MACH64_GUI_CMDFIFO_DATA 0x0174
-#define MACH64_GUI_CNTL 0x0178
-#define MACH64_GUI_STAT 0x0738
-# define MACH64_GUI_ACTIVE (1 << 0)
-#define MACH64_GUI_TRAJ_CNTL 0x0730
-
-#define MACH64_HOST_CNTL 0x0640
-#define MACH64_HOST_DATA0 0x0600
-#define MACH64_HW_DEBUG 0x047c
-
-#define MACH64_ONE_OVER_AREA 0x029c
-#define MACH64_ONE_OVER_AREA_UC 0x0300
-
-#define MACH64_PAT_REG0 0x0680
-#define MACH64_PAT_REG1 0x0684
-
-#define MACH64_SC_LEFT_RIGHT 0x06a8
-#define MACH64_SC_TOP_BOTTOM 0x06b4
-#define MACH64_SCALE_3D_CNTL 0x05fc
-# define MACH64_SCALE_PIX_EXPAND_ZERO_EXTEND (0 << 0)
-# define MACH64_SCALE_PIX_EXPAND_DYNAMIC_RANGE (1 << 0)
-# define MACH64_SCALE_DITHER_ERROR_DIFFUSE (0 << 1)
-# define MACH64_SCALE_DITHER_2D_TABLE (1 << 1)
-# define MACH64_DITHER_EN (1 << 2)
-# define MACH64_DITHER_INIT_CURRENT (O << 3)
-# define MACH64_DITHER_INIT_RESET (1 << 3)
-# define MACH64_ROUND_EN (1 << 4)
-# define MACH64_TEX_CACHE_DIS (1 << 5)
-# define MACH64_SCALE_3D_FCN_MASK (3 << 6)
-# define MACH64_SCALE_3D_FCN_NOP (0 << 6)
-# define MACH64_SCALE_3D_FCN_SCALE (1 << 6)
-# define MACH64_SCALE_3D_FCN_TEXTURE (2 << 6)
-# define MACH64_SCALE_3D_FCN_SHADE (3 << 6)
-# define MACH64_TEXTURE_DISABLE (1 << 6)
-# define MACH64_EDGE_ANTI_ALIAS (1 << 8)
-# define MACH64_TEX_CACHE_SPLIT (1 << 9)
-# define MACH64_APPLE_YUV_MODE (1 << 10)
-# define MACH64_ALPHA_FOG_EN_MASK (3 << 11)
-# define MACH64_ALPHA_FOG_DIS (0 << 11)
-# define MACH64_ALPHA_FOG_EN_ALPHA (1 << 11)
-# define MACH64_ALPHA_FOG_EN_FOG (2 << 11)
-# define MACH64_ALPHA_BLEND_SAT (1 << 13)
-# define MACH64_RED_DITHER_MAX (1 << 14)
-# define MACH64_SIGNED_DST_CLAMP (1 << 15)
-# define MACH64_ALPHA_BLEND_SRC_MASK (7 << 16)
-# define MACH64_ALPHA_BLEND_SRC_ZERO (0 << 16)
-# define MACH64_ALPHA_BLEND_SRC_ONE (1 << 16)
-# define MACH64_ALPHA_BLEND_SRC_DSTCOLOR (2 << 16)
-# define MACH64_ALPHA_BLEND_SRC_INVDSTCOLOR (3 << 16)
-# define MACH64_ALPHA_BLEND_SRC_SRCALPHA (4 << 16)
-# define MACH64_ALPHA_BLEND_SRC_INVSRCALPHA (5 << 16)
-# define MACH64_ALPHA_BLEND_SRC_DSTALPHA (6 << 16)
-# define MACH64_ALPHA_BLEND_SRC_INVDSTALPHA (7 << 16)
-# define MACH64_ALPHA_BLEND_DST_MASK (7 << 19)
-# define MACH64_ALPHA_BLEND_DST_ZERO (0 << 19)
-# define MACH64_ALPHA_BLEND_DST_ONE (1 << 19)
-# define MACH64_ALPHA_BLEND_DST_SRCCOLOR (2 << 19)
-# define MACH64_ALPHA_BLEND_DST_INVSRCCOLOR (3 << 19)
-# define MACH64_ALPHA_BLEND_DST_SRCALPHA (4 << 19)
-# define MACH64_ALPHA_BLEND_DST_INVSRCALPHA (5 << 19)
-# define MACH64_ALPHA_BLEND_DST_DSTALPHA (6 << 19)
-# define MACH64_ALPHA_BLEND_DST_INVDSTALPHA (7 << 19)
-# define MACH64_TEX_LIGHT_FCN_MASK (3 << 22)
-# define MACH64_TEX_LIGHT_FCN_REPLACE (0 << 22)
-# define MACH64_TEX_LIGHT_FCN_MODULATE (1 << 22)
-# define MACH64_TEX_LIGHT_FCN_ALPHA_DECAL (2 << 22)
-# define MACH64_MIP_MAP_DISABLE (1 << 24)
-# define MACH64_BILINEAR_TEX_EN (1 << 25)
-# define MACH64_TEX_BLEND_FCN_MASK (3 << 26)
-# define MACH64_TEX_BLEND_FCN_NEAREST (0 << 26)
-# define MACH64_TEX_BLEND_FCN_LINEAR (2 << 26)
-# define MACH64_TEX_BLEND_FCN_TRILINEAR (3 << 26)
-# define MACH64_TEX_AMASK_AEN (1 << 28)
-# define MACH64_TEX_AMASK_BLEND_EDGE (1 << 29)
-# define MACH64_TEX_MAP_AEN (1 << 30)
-# define MACH64_SRC_3D_HOST_FIFO (1 << 31)
-#define MACH64_SCRATCH_REG0 0x0480
-#define MACH64_SCRATCH_REG1 0x0484
-#define MACH64_SECONDARY_TEX_OFF 0x0778
-#define MACH64_SETUP_CNTL 0x0304
-# define MACH64_DONT_START_TRI (1 << 0)
-# define MACH64_DONT_START_ANY (1 << 2)
-# define MACH64_FLAT_SHADE_MASK (3 << 3)
-# define MACH64_FLAT_SHADE_OFF (0 << 3)
-# define MACH64_FLAT_SHADE_VERTEX_1 (1 << 3)
-# define MACH64_FLAT_SHADE_VERTEX_2 (2 << 3)
-# define MACH64_FLAT_SHADE_VERTEX_3 (3 << 3)
-# define MACH64_SOLID_MODE_OFF (0 << 5)
-# define MACH64_SOLID_MODE_ON (1 << 5)
-# define MACH64_LOG_MAX_INC_ADJ (1 << 6)
-# define MACH64_SET_UP_CONTINUE (1 << 31)
-#define MACH64_SRC_CNTL 0x05b4
-#define MACH64_SRC_HEIGHT1 0x0594
-#define MACH64_SRC_HEIGHT2 0x05ac
-#define MACH64_SRC_HEIGHT1_WIDTH1 0x0598
-#define MACH64_SRC_HEIGHT2_WIDTH2 0x05b0
-#define MACH64_SRC_OFF_PITCH 0x0580
-#define MACH64_SRC_WIDTH1 0x0590
-#define MACH64_SRC_Y_X 0x058c
-
-#define MACH64_TEX_0_OFF 0x05c0
-#define MACH64_TEX_CNTL 0x0774
-# define MACH64_LOD_BIAS_SHIFT 0
-# define MACH64_LOD_BIAS_MASK (0xf << 0)
-# define MACH64_COMP_FACTOR_SHIFT 4
-# define MACH64_COMP_FACTOR_MASK (0xf << 4)
-# define MACH64_TEXTURE_COMPOSITE (1 << 8)
-# define MACH64_COMP_COMBINE_BLEND (0 << 9)
-# define MACH64_COMP_COMBINE_MODULATE (1 << 9)
-# define MACH64_COMP_BLEND_NEAREST (0 << 11)
-# define MACH64_COMP_BLEND_BILINEAR (1 << 11)
-# define MACH64_COMP_FILTER_NEAREST (0 << 12)
-# define MACH64_COMP_FILTER_BILINEAR (1 << 12)
-# define MACH64_COMP_ALPHA (1 << 13)
-# define MACH64_TEXTURE_TILING (1 << 14)
-# define MACH64_COMPOSITE_TEX_TILING (1 << 15)
-# define MACH64_TEX_COLLISION_DISABLE (1 << 16)
-# define MACH64_TEXTURE_CLAMP_S (1 << 17)
-# define MACH64_TEXTURE_CLAMP_T (1 << 18)
-# define MACH64_TEX_ST_MULT_W (0 << 19)
-# define MACH64_TEX_ST_DIRECT (1 << 19)
-# define MACH64_TEX_SRC_LOCAL (0 << 20)
-# define MACH64_TEX_SRC_AGP (1 << 20)
-# define MACH64_TEX_UNCOMPRESSED (0 << 21)
-# define MACH64_TEX_VQ_COMPRESSED (1 << 21)
-# define MACH64_COMP_TEX_UNCOMPRESSED (0 << 22)
-# define MACH64_COMP_TEX_VQ_COMPRESSED (1 << 22)
-# define MACH64_TEX_CACHE_FLUSH (1 << 23)
-# define MACH64_SEC_TEX_CLAMP_S (1 << 24)
-# define MACH64_SEC_TEX_CLAMP_T (1 << 25)
-# define MACH64_TEX_WRAP_S (1 << 28)
-# define MACH64_TEX_WRAP_T (1 << 29)
-# define MACH64_TEX_CACHE_SIZE_4K (1 << 30)
-# define MACH64_TEX_CACHE_SIZE_2K (1 << 30)
-# define MACH64_SECONDARY_STW (1 << 31)
-#define MACH64_TEX_PALETTE 0x077c
-#define MACH64_TEX_PALETTE_INDEX 0x0740
-#define MACH64_TEX_SIZE_PITCH 0x0770
-
-#define MACH64_VERTEX_1_ARGB 0x0254
-#define MACH64_VERTEX_1_S 0x0240
-#define MACH64_VERTEX_1_SECONDARY_S 0x0328
-#define MACH64_VERTEX_1_SECONDARY_T 0x032c
-#define MACH64_VERTEX_1_SECONDARY_W 0x0330
-#define MACH64_VERTEX_1_SPEC_ARGB 0x024c
-#define MACH64_VERTEX_1_T 0x0244
-#define MACH64_VERTEX_1_W 0x0248
-#define MACH64_VERTEX_1_X_Y 0x0258
-#define MACH64_VERTEX_1_Z 0x0250
-#define MACH64_VERTEX_2_ARGB 0x0274
-#define MACH64_VERTEX_2_S 0x0260
-#define MACH64_VERTEX_2_SECONDARY_S 0x0334
-#define MACH64_VERTEX_2_SECONDARY_T 0x0338
-#define MACH64_VERTEX_2_SECONDARY_W 0x033c
-#define MACH64_VERTEX_2_SPEC_ARGB 0x026c
-#define MACH64_VERTEX_2_T 0x0264
-#define MACH64_VERTEX_2_W 0x0268
-#define MACH64_VERTEX_2_X_Y 0x0278
-#define MACH64_VERTEX_2_Z 0x0270
-#define MACH64_VERTEX_3_ARGB 0x0294
-#define MACH64_VERTEX_3_S 0x0280
-#define MACH64_VERTEX_3_SECONDARY_S 0x02a0
-#define MACH64_VERTEX_3_SECONDARY_T 0x02a4
-#define MACH64_VERTEX_3_SECONDARY_W 0x02a8
-#define MACH64_VERTEX_3_SPEC_ARGB 0x028c
-#define MACH64_VERTEX_3_T 0x0284
-#define MACH64_VERTEX_3_W 0x0288
-#define MACH64_VERTEX_3_X_Y 0x0298
-#define MACH64_VERTEX_3_Z 0x0290
-
-#define MACH64_Z_CNTL 0x054c
-# define MACH64_Z_EN (1 << 0)
-# define MACH64_Z_SRC_2D (1 << 1)
-# define MACH64_Z_TEST_MASK (7 << 4)
-# define MACH64_Z_TEST_NEVER (0 << 4)
-# define MACH64_Z_TEST_LESS (1 << 4)
-# define MACH64_Z_TEST_LEQUAL (2 << 4)
-# define MACH64_Z_TEST_EQUAL (3 << 4)
-# define MACH64_Z_TEST_GEQUAL (4 << 4)
-# define MACH64_Z_TEST_GREATER (5 << 4)
-# define MACH64_Z_TEST_NOTEQUAL (6 << 4)
-# define MACH64_Z_TEST_ALWAYS (7 << 4)
-# define MACH64_Z_MASK_EN (1 << 8)
-#define MACH64_Z_OFF_PITCH 0x0548
-
-
-
-#define MACH64_DATATYPE_CI8 2
-#define MACH64_DATATYPE_ARGB1555 3
-#define MACH64_DATATYPE_RGB565 4
-#define MACH64_DATATYPE_ARGB8888 6
-#define MACH64_DATATYPE_RGB332 7
-#define MACH64_DATATYPE_Y8 8
-#define MACH64_DATATYPE_RGB8 9
-#define MACH64_DATATYPE_VYUY422 11
-#define MACH64_DATATYPE_YVYU422 12
-#define MACH64_DATATYPE_AYUV444 14
-#define MACH64_DATATYPE_ARGB4444 15
-
-#define MACH64_LAST_FRAME_REG MACH64_PAT_REG0
-#define MACH64_LAST_DISPATCH_REG MACH64_PAT_REG1
-
-#endif /* __MACH64_REG_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.c
deleted file mode 100644
index 3403434a5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_ioctl.h"
-#include "mach64_tris.h"
-#include "mach64_vb.h"
-#include "mach64_span.h"
-
-#include "context.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#include "utils.h"
-#include "vblank.h"
-
-#include "GL/internal/dri_interface.h"
-
-/* Mach64 configuration
- */
-#include "xmlpool.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
-#if ENABLE_PERF_BOXES
- DRI_CONF_PERFORMANCE_BOXES(false)
-#endif
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-#if ENABLE_PERF_BOXES
-static const GLuint __driNConfigOptions = 3;
-#else
-static const GLuint __driNConfigOptions = 2;
-#endif
-
-extern const struct dri_extension card_extensions[];
-
-static __GLcontextModes * fill_in_modes( __GLcontextModes * modes,
- unsigned pixel_bits,
- unsigned depth_bits,
- unsigned stencil_bits,
- const GLenum * db_modes,
- unsigned num_db_modes,
- int visType )
-{
- static const u_int8_t bits[2][4] = {
- { 5, 6, 5, 0 },
- { 8, 8, 8, 0 }
- };
-
- static const u_int32_t masks[2][4] = {
- { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }
- };
-
- unsigned i;
- unsigned j;
- const unsigned index = ((pixel_bits + 15) / 16) - 1;
-
- for ( i = 0 ; i < num_db_modes ; i++ ) {
- for ( j = 0 ; j < 2 ; j++ ) {
-
- modes->redBits = bits[index][0];
- modes->greenBits = bits[index][1];
- modes->blueBits = bits[index][2];
- modes->alphaBits = bits[index][3];
- modes->redMask = masks[index][0];
- modes->greenMask = masks[index][1];
- modes->blueMask = masks[index][2];
- modes->alphaMask = masks[index][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 = 0;
- modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG;
- modes->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
- modes->stencilBits = stencil_bits;
- modes->depthBits = depth_bits;
-
- modes->visualType = visType;
- modes->renderType = GLX_RGBA_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 = modes->next;
- }
- }
-
- return modes;
-}
-
-
-static __GLcontextModes *
-mach64FillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- unsigned i;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- int depth_buffer_modes[2][2];
-
-
- depth_buffer_modes[0][0] = depth_bits;
- depth_buffer_modes[1][0] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- depth_buffer_modes[0][1] = 0;
- depth_buffer_modes[1][1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
- m = fill_in_modes( m, pixel_bits,
- depth_buffer_modes[i][0], depth_buffer_modes[i][1],
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR );
- }
-
- for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
- m = fill_in_modes( m, pixel_bits,
- depth_buffer_modes[i][0], depth_buffer_modes[i][1],
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR );
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ){
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/* Create the device specific screen private data struct.
- */
-static mach64ScreenRec *
-mach64CreateScreen( __DRIscreenPrivate *sPriv )
-{
- mach64ScreenPtr mach64Screen;
- ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(ATIDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(ATIDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI )
- fprintf( stderr, "%s\n", __FUNCTION__ );
-
- /* Allocate the private area */
- mach64Screen = (mach64ScreenPtr) CALLOC( sizeof(*mach64Screen) );
- if ( !mach64Screen ) return NULL;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&mach64Screen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- mach64Screen->IsPCI = serverInfo->IsPCI;
-
- {
- drm_mach64_getparam_t gp;
- int ret;
-
- gp.param = MACH64_PARAM_IRQ_NR;
- gp.value = (void *) &mach64Screen->irq;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_MACH64_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "DRM_MACH64_GETPARAM (MACH64_PARAM_IRQ_NR): %d\n", ret);
- FREE( mach64Screen );
- return NULL;
- }
- }
-
- mach64Screen->mmio.handle = serverInfo->regs;
- mach64Screen->mmio.size = serverInfo->regsSize;
- if ( drmMap( sPriv->fd,
- mach64Screen->mmio.handle,
- mach64Screen->mmio.size,
- (drmAddressPtr)&mach64Screen->mmio.map ) != 0 ) {
- FREE( mach64Screen );
- return NULL;
- }
-
- mach64Screen->buffers = drmMapBufs( sPriv->fd );
- if ( !mach64Screen->buffers ) {
- drmUnmap( (drmAddress)mach64Screen->mmio.map,
- mach64Screen->mmio.size );
- FREE( mach64Screen );
- return NULL;
- }
-
- if ( !mach64Screen->IsPCI ) {
- mach64Screen->agpTextures.handle = serverInfo->agp;
- mach64Screen->agpTextures.size = serverInfo->agpSize;
- if ( drmMap( sPriv->fd,
- mach64Screen->agpTextures.handle,
- mach64Screen->agpTextures.size,
- (drmAddressPtr)&mach64Screen->agpTextures.map ) ) {
- drmUnmapBufs( mach64Screen->buffers );
- drmUnmap( (drmAddress)mach64Screen->mmio.map, mach64Screen->mmio.size );
- FREE( mach64Screen );
- return NULL;
- }
- }
-
- mach64Screen->AGPMode = serverInfo->AGPMode;
-
- mach64Screen->chipset = serverInfo->chipset;
- mach64Screen->width = serverInfo->width;
- mach64Screen->height = serverInfo->height;
- mach64Screen->mem = serverInfo->mem;
- mach64Screen->cpp = serverInfo->cpp;
-
- mach64Screen->frontOffset = serverInfo->frontOffset;
- mach64Screen->frontPitch = serverInfo->frontPitch;
- mach64Screen->backOffset = serverInfo->backOffset;
- mach64Screen->backPitch = serverInfo->backPitch;
- mach64Screen->depthOffset = serverInfo->depthOffset;
- mach64Screen->depthPitch = serverInfo->depthPitch;
-
- mach64Screen->texOffset[MACH64_CARD_HEAP] = serverInfo->textureOffset;
- mach64Screen->texSize[MACH64_CARD_HEAP] = serverInfo->textureSize;
- mach64Screen->logTexGranularity[MACH64_CARD_HEAP] =
- serverInfo->logTextureGranularity;
-
- if ( mach64Screen->IsPCI ) {
- mach64Screen->numTexHeaps = MACH64_NR_TEX_HEAPS - 1;
- mach64Screen->firstTexHeap = MACH64_CARD_HEAP;
- mach64Screen->texOffset[MACH64_AGP_HEAP] = 0;
- mach64Screen->texSize[MACH64_AGP_HEAP] = 0;
- mach64Screen->logTexGranularity[MACH64_AGP_HEAP] = 0;
- } else {
- if (mach64Screen->texSize[MACH64_CARD_HEAP] > 0) {
- mach64Screen->numTexHeaps = MACH64_NR_TEX_HEAPS;
- mach64Screen->firstTexHeap = MACH64_CARD_HEAP;
- } else {
- mach64Screen->numTexHeaps = MACH64_NR_TEX_HEAPS - 1;
- mach64Screen->firstTexHeap = MACH64_AGP_HEAP;
- }
- mach64Screen->texOffset[MACH64_AGP_HEAP] = serverInfo->agpTextureOffset;
- mach64Screen->texSize[MACH64_AGP_HEAP] = serverInfo->agpSize;
- mach64Screen->logTexGranularity[MACH64_AGP_HEAP] = serverInfo->logAgpTextureGranularity;
- }
-
- mach64Screen->driScreen = sPriv;
-
- if ( glx_enable_extension != NULL ) {
- if ( mach64Screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
-
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- }
-
- return mach64Screen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-static void
-mach64DestroyScreen( __DRIscreenPrivate *driScreen )
-{
- mach64ScreenRec *mach64Screen = (mach64ScreenRec *) driScreen->private;
-
- if ( !mach64Screen )
- return;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI )
- fprintf( stderr, "%s\n", __FUNCTION__ );
-
- if ( !mach64Screen->IsPCI ) {
- drmUnmap( (drmAddress)mach64Screen->agpTextures.map,
- mach64Screen->agpTextures.size );
- }
-
- drmUnmapBufs( mach64Screen->buffers );
- drmUnmap( (drmAddress)mach64Screen->mmio.map, mach64Screen->mmio.size );
-
- FREE( mach64Screen );
- driScreen->private = NULL;
-}
-
-
-/* Create and initialize the Mesa and driver specific pixmap buffer
- * data.
- */
-static GLboolean
-mach64CreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- mach64ScreenPtr screen = (mach64ScreenPtr) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0 );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- mach64SetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- mach64SetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mach64SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mach64SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-mach64DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-/* Copy the back color buffer to the front color buffer */
-static void
-mach64SwapBuffers(__DRIdrawablePrivate *dPriv)
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- mach64ContextPtr mmesa;
- GLcontext *ctx;
- mmesa = (mach64ContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = mmesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- mach64CopyBuffer( dPriv );
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__);
- }
-}
-
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-mach64InitDriver( __DRIscreenPrivate *driScreen )
-{
- driScreen->private = (void *) mach64CreateScreen( driScreen );
-
- if ( !driScreen->private ) {
- mach64DestroyScreen( driScreen );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-static struct __DriverAPIRec mach64API = {
- .InitDriver = mach64InitDriver,
- .DestroyScreen = mach64DestroyScreen,
- .CreateContext = mach64CreateContext,
- .DestroyContext = mach64DestroyContext,
- .CreateBuffer = mach64CreateBuffer,
- .DestroyBuffer = mach64DestroyBuffer,
- .SwapBuffers = mach64SwapBuffers,
- .MakeCurrent = mach64MakeCurrent,
- .UnbindContext = mach64UnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 6, 4, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 0, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "Mach64",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &mach64API);
- if ( psp != NULL ) {
- ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
- *driver_modes = mach64FillInModes( dri_priv->cpp * 8,
- 16,
- 0,
- 1);
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.h
deleted file mode 100644
index 5305058e2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_screen.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_SCREEN_H__
-#define __MACH64_SCREEN_H__
-
-#include "xmlconfig.h"
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- drmAddress *map; /* Mapping of the DRM region */
-} mach64RegionRec, *mach64RegionPtr;
-
-typedef struct {
- int chipset;
- int width;
- int height;
- int mem;
- int cpp;
-
- unsigned int frontOffset;
- unsigned int frontPitch;
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- int IsPCI;
- int AGPMode;
- unsigned int irq; /* IRQ number (0 means none) */
-
- /* Shared Texture data */
- int firstTexHeap, numTexHeaps;
- int texOffset[MACH64_NR_TEX_HEAPS];
- int texSize[MACH64_NR_TEX_HEAPS];
- int logTexGranularity[MACH64_NR_TEX_HEAPS];
-
- mach64RegionRec mmio;
- mach64RegionRec agpTextures;
-
- drmBufMapPtr buffers;
-
- __DRIscreenPrivate *driScreen;
-
- driOptionCache optionCache;
-} mach64ScreenRec, *mach64ScreenPtr;
-
-#endif /* __MACH64_SCREEN_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.c
deleted file mode 100644
index 0ac0eeaa6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_ioctl.h"
-#include "mach64_state.h"
-#include "mach64_span.h"
-
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
- mach64ScreenRec *mach64Screen = mmesa->mach64Screen; \
- __DRIscreenPrivate *driScreen = mmesa->driScreen; \
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable; \
- GLuint pitch = mmesa->drawPitch * mach64Screen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(driScreen->pFB + \
- mmesa->drawOffset + \
- (dPriv->x * mach64Screen->cpp) + \
- (dPriv->y * pitch)); \
- char *read_buf = (char *)(driScreen->pFB + \
- mmesa->readOffset + \
- (dPriv->x * mach64Screen->cpp) + \
- (dPriv->y * pitch)); \
- GLushort p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
- mach64ScreenRec *mach64Screen = mmesa->mach64Screen; \
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable; \
- __DRIscreenPrivate *driScreen = mmesa->driScreen; \
- GLuint pitch = mach64Screen->depthPitch * 2; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(driScreen->pFB + \
- mach64Screen->depthOffset + \
- dPriv->x * 2 + \
- dPriv->y * pitch)
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#define HW_LOCK()
-
-/* FIXME could/should we use dPriv->numClipRects like the other drivers? */
-#define HW_CLIPLOOP() \
- do { \
- int _nc = mmesa->numClipRects; \
- \
- while ( _nc-- ) { \
- int minx = mmesa->pClipRects[_nc].x1 - mmesa->drawX; \
- int miny = mmesa->pClipRects[_nc].y1 - mmesa->drawY; \
- int maxx = mmesa->pClipRects[_nc].x2 - mmesa->drawX; \
- int maxy = mmesa->pClipRects[_nc].y2 - mmesa->drawY;
-
-#define HW_ENDCLIPLOOP() \
- } \
- } while (0)
-
-#define HW_UNLOCK()
-
-
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) mach64##x##_RGB565
-#define TAG2(x,y) mach64##x##_RGB565##y
-#include "spantmp2.h"
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-/* FIXME the old code always read back alpha as 0xff, i.e. fully opaque.
- Was there a reason to do so ? If so that'll won't work with that template... */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) mach64##x##_ARGB8888
-#define TAG2(x,y) mach64##x##_ARGB8888##y
-#include "spantmp2.h"
-
-
-/* ================================================================
- * Depth buffer
- */
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
-
-#define TAG(x) mach64##x##_16
-#include "depthtmp.h"
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void mach64DDSetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: BUFFER_BIT_FRONT_LEFT\n", __FUNCTION__);
- mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->frontOffset;
- mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->frontPitch;
- break;
- case BUFFER_BIT_BACK_LEFT:
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: BUFFER_BIT_BACK_LEFT\n", __FUNCTION__);
- mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->backOffset;
- mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->backPitch;
- break;
- default:
- break;
- }
-}
-
-static void mach64SpanRenderStart( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- LOCK_HARDWARE( mmesa );
- FINISH_DMA_LOCKED( mmesa );
-}
-
-static void mach64SpanRenderFinish( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( mmesa );
-}
-
-void mach64DDInitSpanFuncs( GLcontext *ctx )
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = mach64DDSetBuffer;
- swdd->SpanRenderStart = mach64SpanRenderStart;
- swdd->SpanRenderFinish = mach64SpanRenderFinish;
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-mach64SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- mach64InitPointers_RGB565(&drb->Base);
- }
- else {
- mach64InitPointers_ARGB8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = mach64ReadDepthSpan_16;
- drb->Base.GetValues = mach64ReadDepthPixels_16;
- drb->Base.PutRow = mach64WriteDepthSpan_16;
- drb->Base.PutMonoRow = mach64WriteMonoDepthSpan_16;
- drb->Base.PutValues = mach64WriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- /* never */
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- /* never */
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.h
deleted file mode 100644
index 0f4c76647..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_span.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __MACH64_SPAN_H__
-#define __MACH64_SPAN_H__
-
-#include "drirenderbuffer.h"
-
-extern void mach64DDInitSpanFuncs( GLcontext *ctx );
-
-extern void
-mach64SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.c
deleted file mode 100644
index d9b5725a6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.c
+++ /dev/null
@@ -1,1216 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jos�Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_state.h"
-#include "mach64_ioctl.h"
-#include "mach64_tris.h"
-#include "mach64_vb.h"
-#include "mach64_tex.h"
-
-#include "context.h"
-#include "buffers.h"
-#include "enums.h"
-#include "colormac.h"
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-
-/* =============================================================
- * Alpha blending
- */
-
-static void mach64UpdateAlphaMode( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint a = mmesa->setup.alpha_tst_cntl;
- GLuint s = mmesa->setup.scale_3d_cntl;
- GLuint m = mmesa->setup.dp_write_mask;
-
- if ( ctx->Color.AlphaEnabled ) {
- GLubyte ref;
-
- CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef);
-
- a &= ~(MACH64_ALPHA_TEST_MASK | MACH64_REF_ALPHA_MASK);
-
- switch ( ctx->Color.AlphaFunc ) {
- case GL_NEVER:
- a |= MACH64_ALPHA_TEST_NEVER;
- break;
- case GL_LESS:
- a |= MACH64_ALPHA_TEST_LESS;
- break;
- case GL_LEQUAL:
- a |= MACH64_ALPHA_TEST_LEQUAL;
- break;
- case GL_EQUAL:
- a |= MACH64_ALPHA_TEST_EQUAL;
- break;
- case GL_GEQUAL:
- a |= MACH64_ALPHA_TEST_GEQUAL;
- break;
- case GL_GREATER:
- a |= MACH64_ALPHA_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- a |= MACH64_ALPHA_TEST_NOTEQUAL;
- break;
- case GL_ALWAYS:
- a |= MACH64_ALPHA_TEST_ALWAYS;
- break;
- }
-
- a |= (ref << MACH64_REF_ALPHA_SHIFT);
- a |= MACH64_ALPHA_TEST_EN;
- } else {
- a &= ~MACH64_ALPHA_TEST_EN;
- }
-
- FALLBACK( mmesa, MACH64_FALLBACK_BLEND_FUNC, GL_FALSE );
-
- if ( ctx->Color.BlendEnabled ) {
- s &= ~(MACH64_ALPHA_BLEND_SRC_MASK |
- MACH64_ALPHA_BLEND_DST_MASK |
- MACH64_ALPHA_BLEND_SAT);
-
- switch ( ctx->Color.BlendSrcRGB ) {
- case GL_ZERO:
- s |= MACH64_ALPHA_BLEND_SRC_ZERO;
- break;
- case GL_ONE:
- s |= MACH64_ALPHA_BLEND_SRC_ONE;
- break;
- case GL_DST_COLOR:
- s |= MACH64_ALPHA_BLEND_SRC_DSTCOLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- s |= MACH64_ALPHA_BLEND_SRC_INVDSTCOLOR;
- break;
- case GL_SRC_ALPHA:
- s |= MACH64_ALPHA_BLEND_SRC_SRCALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- s |= MACH64_ALPHA_BLEND_SRC_INVSRCALPHA;
- break;
- case GL_DST_ALPHA:
- s |= MACH64_ALPHA_BLEND_SRC_DSTALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- s |= MACH64_ALPHA_BLEND_SRC_INVDSTALPHA;
- break;
- case GL_SRC_ALPHA_SATURATE:
- s |= (MACH64_ALPHA_BLEND_SRC_SRCALPHA |
- MACH64_ALPHA_BLEND_SAT);
- break;
- default:
- FALLBACK( mmesa, MACH64_FALLBACK_BLEND_FUNC, GL_TRUE );
- }
-
- switch ( ctx->Color.BlendDstRGB ) {
- case GL_ZERO:
- s |= MACH64_ALPHA_BLEND_DST_ZERO;
- break;
- case GL_ONE:
- s |= MACH64_ALPHA_BLEND_DST_ONE;
- break;
- case GL_SRC_COLOR:
- s |= MACH64_ALPHA_BLEND_DST_SRCCOLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- s |= MACH64_ALPHA_BLEND_DST_INVSRCCOLOR;
- break;
- case GL_SRC_ALPHA:
- s |= MACH64_ALPHA_BLEND_DST_SRCALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- s |= MACH64_ALPHA_BLEND_DST_INVSRCALPHA;
- break;
- case GL_DST_ALPHA:
- s |= MACH64_ALPHA_BLEND_DST_DSTALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- s |= MACH64_ALPHA_BLEND_DST_INVDSTALPHA;
- break;
- default:
- FALLBACK( mmesa, MACH64_FALLBACK_BLEND_FUNC, GL_TRUE );
- }
-
- m = 0xffffffff; /* Can't color mask and blend at the same time */
- s &= ~MACH64_ALPHA_FOG_EN_FOG; /* Can't fog and blend at the same time */
- s |= MACH64_ALPHA_FOG_EN_ALPHA;
- } else {
- s &= ~MACH64_ALPHA_FOG_EN_ALPHA;
- }
-
- if ( mmesa->setup.alpha_tst_cntl != a ) {
- mmesa->setup.alpha_tst_cntl = a;
- mmesa->dirty |= MACH64_UPLOAD_Z_ALPHA_CNTL;
- }
- if ( mmesa->setup.scale_3d_cntl != s ) {
- mmesa->setup.scale_3d_cntl = s;
- mmesa->dirty |= MACH64_UPLOAD_SCALE_3D_CNTL;
- }
- if ( mmesa->setup.dp_write_mask != m ) {
- mmesa->setup.dp_write_mask = m;
- mmesa->dirty |= MACH64_UPLOAD_DP_WRITE_MASK;
- }
-}
-
-static void mach64DDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_ALPHA;
-}
-
-static void mach64DDBlendEquationSeparate( GLcontext *ctx,
- GLenum modeRGB, GLenum modeA )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- assert( modeRGB == modeA );
- FLUSH_BATCH( mmesa );
-
- /* BlendEquation affects ColorLogicOpEnabled
- */
- FALLBACK( MACH64_CONTEXT(ctx), MACH64_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
-
- /* Can only do blend addition, not min, max, subtract, etc. */
- FALLBACK( MACH64_CONTEXT(ctx), MACH64_FALLBACK_BLEND_EQ,
- modeRGB != GL_FUNC_ADD);
-
- mmesa->new_state |= MACH64_NEW_ALPHA;
-}
-
-static void mach64DDBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_ALPHA;
-}
-
-
-/* =============================================================
- * Depth testing
- */
-
-static void mach64UpdateZMode( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint z = mmesa->setup.z_cntl;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_MSG ) {
- fprintf( stderr, "%s:\n", __FUNCTION__ );
- }
-
- if ( ctx->Depth.Test ) {
- z &= ~MACH64_Z_TEST_MASK;
-
- switch ( ctx->Depth.Func ) {
- case GL_NEVER:
- z |= MACH64_Z_TEST_NEVER;
- break;
- case GL_ALWAYS:
- z |= MACH64_Z_TEST_ALWAYS;
- break;
- case GL_LESS:
- z |= MACH64_Z_TEST_LESS;
- break;
- case GL_LEQUAL:
- z |= MACH64_Z_TEST_LEQUAL;
- break;
- case GL_EQUAL:
- z |= MACH64_Z_TEST_EQUAL;
- break;
- case GL_GEQUAL:
- z |= MACH64_Z_TEST_GEQUAL;
- break;
- case GL_GREATER:
- z |= MACH64_Z_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- z |= MACH64_Z_TEST_NOTEQUAL;
- break;
- }
-
- z |= MACH64_Z_EN;
- } else {
- z &= ~MACH64_Z_EN;
- }
-
- if ( ctx->Depth.Mask ) {
- z |= MACH64_Z_MASK_EN;
- } else {
- z &= ~MACH64_Z_MASK_EN;
- }
-
- if ( mmesa->setup.z_cntl != z ) {
- mmesa->setup.z_cntl = z;
- mmesa->dirty |= MACH64_UPLOAD_Z_ALPHA_CNTL;
- }
-}
-
-static void mach64DDDepthFunc( GLcontext *ctx, GLenum func )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_DEPTH;
-}
-
-static void mach64DDDepthMask( GLcontext *ctx, GLboolean flag )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_DEPTH;
-}
-
-static void mach64DDClearDepth( GLcontext *ctx, GLclampd d )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- /* Always have a 16-bit depth buffer.
- */
- mmesa->ClearDepth = d * 0xffff;
-}
-
-
-/* =============================================================
- * Fog
- */
-
-static void mach64UpdateFogAttrib( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- CARD32 s = mmesa->setup.scale_3d_cntl;
- GLubyte c[4];
- CARD32 col;
-
- /* Can't fog if blending is on */
- if ( ctx->Color.BlendEnabled )
- return;
-
- if ( ctx->Fog.Enabled ) {
- s |= MACH64_ALPHA_FOG_EN_FOG;
- s &= ~(MACH64_ALPHA_BLEND_SRC_MASK |
- MACH64_ALPHA_BLEND_DST_MASK |
- MACH64_ALPHA_BLEND_SAT);
- /* From Utah-glx: "fog color is now dest and fog factor is alpha, so
- * use GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA"
- */
- s |= (MACH64_ALPHA_BLEND_SRC_SRCALPHA |
- MACH64_ALPHA_BLEND_DST_INVSRCALPHA);
- /* From Utah-glx: "can't use texture alpha when fogging" */
- s &= ~MACH64_TEX_MAP_AEN;
- } else {
- s &= ~(MACH64_ALPHA_BLEND_SRC_MASK |
- MACH64_ALPHA_BLEND_DST_MASK |
- MACH64_ALPHA_BLEND_SAT);
- s |= (MACH64_ALPHA_BLEND_SRC_ONE |
- MACH64_ALPHA_BLEND_DST_ZERO);
- s &= ~MACH64_ALPHA_FOG_EN_FOG;
- }
-
- c[0] = FLOAT_TO_UBYTE( ctx->Fog.Color[0] );
- c[1] = FLOAT_TO_UBYTE( ctx->Fog.Color[1] );
- c[2] = FLOAT_TO_UBYTE( ctx->Fog.Color[2] );
- c[3] = FLOAT_TO_UBYTE( ctx->Fog.Color[3] );
-
- col = mach64PackColor( 4, c[0], c[1], c[2], c[3] );
-
- if ( mmesa->setup.dp_fog_clr != col ) {
- mmesa->setup.dp_fog_clr = col;
- mmesa->dirty |= MACH64_UPLOAD_DP_FOG_CLR;
- }
- if ( mmesa->setup.scale_3d_cntl != s ) {
- mmesa->setup.scale_3d_cntl = s;
- mmesa->dirty |= MACH64_UPLOAD_SCALE_3D_CNTL;
- }
-
-}
-
-static void mach64DDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_FOG;
-}
-
-
-/* =============================================================
- * Clipping
- */
-
-static void mach64UpdateClipping( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64ScreenPtr mach64Screen = mmesa->mach64Screen;
-
- if ( mmesa->driDrawable ) {
- __DRIdrawablePrivate *drawable = mmesa->driDrawable;
- int x1 = 0;
- int y1 = 0;
- int x2 = drawable->w - 1;
- int y2 = drawable->h - 1;
-
- if ( ctx->Scissor.Enabled ) {
- if ( ctx->Scissor.X > x1 ) {
- x1 = ctx->Scissor.X;
- }
- if ( drawable->h - ctx->Scissor.Y - ctx->Scissor.Height > y1 ) {
- y1 = drawable->h - ctx->Scissor.Y - ctx->Scissor.Height;
- }
- if ( ctx->Scissor.X + ctx->Scissor.Width - 1 < x2 ) {
- x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
- }
- if ( drawable->h - ctx->Scissor.Y - 1 < y2 ) {
- y2 = drawable->h - ctx->Scissor.Y - 1;
- }
- }
-
- x1 += drawable->x;
- y1 += drawable->y;
- x2 += drawable->x;
- y2 += drawable->y;
-
- /* clamp to screen borders */
- if (x1 < 0) x1 = 0;
- if (y1 < 0) y1 = 0;
- if (x2 < 0) x2 = 0;
- if (y2 < 0) y2 = 0;
- if (x2 > mach64Screen->width-1) x2 = mach64Screen->width-1;
- if (y2 > mach64Screen->height-1) y2 = mach64Screen->height-1;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_MSG ) {
- fprintf( stderr, "%s: drawable %3d %3d %3d %3d\n",
- __FUNCTION__,
- drawable->x,
- drawable->y,
- drawable->w,
- drawable->h );
- fprintf( stderr, "%s: scissor %3d %3d %3d %3d\n",
- __FUNCTION__,
- ctx->Scissor.X,
- ctx->Scissor.Y,
- ctx->Scissor.Width,
- ctx->Scissor.Height );
- fprintf( stderr, "%s: final %3d %3d %3d %3d\n",
- __FUNCTION__, x1, y1, x2, y2 );
- fprintf( stderr, "\n" );
- }
-
- mmesa->setup.sc_top_bottom = ((y1 << 0) |
- (y2 << 16));
-
- mmesa->setup.sc_left_right = ((x1 << 0) |
- (x2 << 16));
-
- /* UPLOAD_MISC reduces the dirty state, we just need to
- * emit the scissor to the SAREA. We need to dirty cliprects
- * since the scissor and cliprects are intersected to update the
- * single hardware scissor
- */
- mmesa->dirty |= MACH64_UPLOAD_MISC | MACH64_UPLOAD_CLIPRECTS;
- }
-}
-
-static void mach64DDScissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei w, GLsizei h )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_CLIP;
-}
-
-
-/* =============================================================
- * Culling
- */
-
-static void mach64UpdateCull( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLfloat backface_sign = 1;
-
- if ( ctx->Polygon.CullFlag /*&& ctx->PB->primitive == GL_POLYGON*/ ) {
- backface_sign = 1;
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_BACK:
- if ( ctx->Polygon.FrontFace == GL_CCW )
- backface_sign = -1;
- break;
- case GL_FRONT:
- if ( ctx->Polygon.FrontFace != GL_CCW )
- backface_sign = -1;
- break;
- default:
- case GL_FRONT_AND_BACK:
- backface_sign = 0;
- break;
- }
- } else {
- backface_sign = 0;
- }
-
- mmesa->backface_sign = backface_sign;
-
-}
-
-static void mach64DDCullFace( GLcontext *ctx, GLenum mode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_CULL;
-}
-
-static void mach64DDFrontFace( GLcontext *ctx, GLenum mode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_CULL;
-}
-
-
-/* =============================================================
- * Masks
- */
-
-static void mach64UpdateMasks( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint mask = 0xffffffff;
-
- /* mach64 can't color mask with alpha blending enabled */
- if ( !ctx->Color.BlendEnabled ) {
- mask = mach64PackColor( mmesa->mach64Screen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] );
- }
-
- if ( mmesa->setup.dp_write_mask != mask ) {
- mmesa->setup.dp_write_mask = mask;
- mmesa->dirty |= MACH64_UPLOAD_DP_WRITE_MASK;
- }
-}
-
-static void mach64DDColorMask( GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_MASKS;
-}
-
-
-/* =============================================================
- * Rendering attributes
- *
- * We really don't want to recalculate all this every time we bind a
- * texture. These things shouldn't change all that often, so it makes
- * sense to break them out of the core texture state update routines.
- */
-
-static void mach64UpdateSpecularLighting( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint a = mmesa->setup.alpha_tst_cntl;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_MSG ) {
- fprintf( stderr, "%s:\n", __FUNCTION__ );
- }
-
- if ( ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Light.Enabled ) {
- a |= MACH64_SPECULAR_LIGHT_EN;
- } else {
- a &= ~MACH64_SPECULAR_LIGHT_EN;
- }
-
- if ( mmesa->setup.alpha_tst_cntl != a ) {
- mmesa->setup.alpha_tst_cntl = a;
- mmesa->dirty |= MACH64_UPLOAD_Z_ALPHA_CNTL;
- mmesa->new_state |= MACH64_NEW_CONTEXT;
- }
-}
-
-static void mach64DDLightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *param )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- if ( pname == GL_LIGHT_MODEL_COLOR_CONTROL ) {
- FLUSH_BATCH( mmesa );
- mach64UpdateSpecularLighting(ctx);
- }
-}
-
-static void mach64DDShadeModel( GLcontext *ctx, GLenum mode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint s = mmesa->setup.setup_cntl;
-
- s &= ~MACH64_FLAT_SHADE_MASK;
-
- switch ( mode ) {
- case GL_FLAT:
- s |= MACH64_FLAT_SHADE_VERTEX_3;
- break;
- case GL_SMOOTH:
- s |= MACH64_FLAT_SHADE_OFF;
- break;
- default:
- return;
- }
-
- if ( mmesa->setup.setup_cntl != s ) {
- FLUSH_BATCH( mmesa );
- mmesa->setup.setup_cntl = s;
-
- mmesa->dirty |= MACH64_UPLOAD_SETUP_CNTL;
- }
-}
-
-
-/* =============================================================
- * Viewport
- */
-
-
-void mach64CalcViewport( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = mmesa->hw_viewport;
-
- /* See also mach64_translate_vertex.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + (GLfloat)mmesa->drawX + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + mmesa->driDrawable->h + (GLfloat)mmesa->drawY + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * mmesa->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * mmesa->depth_scale;
-
- mmesa->SetupNewInputs = ~0;
-}
-
-static void mach64Viewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- mach64CalcViewport( ctx );
-}
-
-static void mach64DepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- mach64CalcViewport( ctx );
-}
-
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void mach64DDClearColor( GLcontext *ctx,
- const GLfloat color[4] )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLubyte c[4];
-
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
-
- mmesa->ClearColor = mach64PackColor( mmesa->mach64Screen->cpp,
- c[0], c[1], c[2], c[3] );
-}
-
-static void mach64DDLogicOpCode( GLcontext *ctx, GLenum opcode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- if ( ctx->Color.ColorLogicOpEnabled ) {
- FLUSH_BATCH( mmesa );
-
- FALLBACK( mmesa, MACH64_FALLBACK_LOGICOP, opcode != GL_COPY);
- }
-}
-
-void mach64SetCliprects( GLcontext *ctx, GLenum mode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- mmesa->numClipRects = dPriv->numClipRects;
- mmesa->pClipRects = dPriv->pClipRects;
- mmesa->drawX = dPriv->x;
- mmesa->drawY = dPriv->y;
- break;
- case GL_BACK_LEFT:
- if ( dPriv->numBackClipRects == 0 ) {
- mmesa->numClipRects = dPriv->numClipRects;
- mmesa->pClipRects = dPriv->pClipRects;
- mmesa->drawX = dPriv->x;
- mmesa->drawY = dPriv->y;
- } else {
- mmesa->numClipRects = dPriv->numBackClipRects;
- mmesa->pClipRects = dPriv->pBackClipRects;
- mmesa->drawX = dPriv->backX;
- mmesa->drawY = dPriv->backY;
- }
- break;
- default:
- return;
- }
-
- mach64UpdateClipping( ctx );
-
- mmesa->dirty |= MACH64_UPLOAD_CLIPRECTS;
-}
-
-static void mach64DDDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE );
- mach64SetCliprects( ctx, GL_FRONT_LEFT );
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: BUFFER_BIT_FRONT_LEFT\n", __FUNCTION__);
- break;
- case BUFFER_BIT_BACK_LEFT:
- FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE );
- mach64SetCliprects( ctx, GL_BACK_LEFT );
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: BUFFER_BIT_BACK_LEFT\n", __FUNCTION__);
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_TRUE );
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: fallback (mode=%d)\n", __FUNCTION__, mode);
- break;
- }
-
- /* We want to update the s/w rast state too so that mach64SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- mmesa->setup.dst_off_pitch = (((mmesa->drawPitch/8) << 22) |
- (mmesa->drawOffset >> 3));
-
- mmesa->dirty |= MACH64_UPLOAD_DST_OFF_PITCH;
-}
-
-static void mach64DDReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-/* =============================================================
- * State enable/disable
- */
-
-static void mach64DDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s = %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( cap ),
- state ? "GL_TRUE" : "GL_FALSE" );
- }
-
- switch ( cap ) {
- case GL_ALPHA_TEST:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_ALPHA;
- break;
-
- case GL_BLEND:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_ALPHA;
-
- /* enable(GL_BLEND) affects ColorLogicOpEnabled.
- */
- FALLBACK( mmesa, MACH64_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
- break;
-
- case GL_CULL_FACE:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_CULL;
- break;
-
- case GL_DEPTH_TEST:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_DEPTH;
- break;
-
- case GL_DITHER:
- do {
- GLuint s = mmesa->setup.scale_3d_cntl;
- FLUSH_BATCH( mmesa );
-
- if ( ctx->Color.DitherFlag ) {
- /* Dithering causes problems w/ 24bpp depth */
- if ( mmesa->mach64Screen->cpp == 4 )
- s |= MACH64_ROUND_EN;
- else
- s |= MACH64_DITHER_EN;
- } else {
- s &= ~MACH64_DITHER_EN;
- s &= ~MACH64_ROUND_EN;
- }
-
- if ( mmesa->setup.scale_3d_cntl != s ) {
- mmesa->setup.scale_3d_cntl = s;
- mmesa->dirty |= ( MACH64_UPLOAD_SCALE_3D_CNTL );
- }
- } while (0);
- break;
-
- case GL_FOG:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_FOG;
- break;
-
- case GL_INDEX_LOGIC_OP:
- case GL_COLOR_LOGIC_OP:
- FLUSH_BATCH( mmesa );
- FALLBACK( mmesa, MACH64_FALLBACK_LOGICOP,
- state && ctx->Color.LogicOp != GL_COPY );
- break;
-
- case GL_LIGHTING:
- mach64UpdateSpecularLighting(ctx);
- break;
-
- case GL_SCISSOR_TEST:
- FLUSH_BATCH( mmesa );
- mmesa->scissor = state;
- mmesa->new_state |= MACH64_NEW_CLIP;
- break;
-
- case GL_STENCIL_TEST:
- FLUSH_BATCH( mmesa );
- FALLBACK( mmesa, MACH64_FALLBACK_STENCIL, state );
- break;
-
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_TEXTURE;
- break;
-
- default:
- return;
- }
-}
-
-/* =============================================================
- * Render mode
- */
-
-static void mach64DDRenderMode( GLcontext *ctx, GLenum mode )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- FALLBACK( mmesa, MACH64_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
-}
-
-/* =============================================================
- * State initialization, management
- */
-
-static void mach64DDPrintDirty( const char *msg, GLuint state )
-{
- fprintf( stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s\n",
- msg,
- state,
- (state & MACH64_UPLOAD_DST_OFF_PITCH) ? "dst_off_pitch, " : "",
- (state & MACH64_UPLOAD_Z_ALPHA_CNTL) ? "z_alpha_cntl, " : "",
- (state & MACH64_UPLOAD_SCALE_3D_CNTL) ? "scale_3d_cntl, " : "",
- (state & MACH64_UPLOAD_DP_FOG_CLR) ? "dp_fog_clr, " : "",
- (state & MACH64_UPLOAD_DP_WRITE_MASK) ? "dp_write_mask, " : "",
- (state & MACH64_UPLOAD_DP_PIX_WIDTH) ? "dp_pix_width, " : "",
- (state & MACH64_UPLOAD_SETUP_CNTL) ? "setup_cntl, " : "",
- (state & MACH64_UPLOAD_MISC) ? "misc, " : "",
- (state & MACH64_UPLOAD_TEXTURE) ? "texture, " : "",
- (state & MACH64_UPLOAD_TEX0IMAGE) ? "tex0 image, " : "",
- (state & MACH64_UPLOAD_TEX1IMAGE) ? "tex1 image, " : "",
- (state & MACH64_UPLOAD_CLIPRECTS) ? "cliprects, " : "" );
-}
-
-/*
- * Load the current context's state into the hardware.
- *
- * NOTE: Be VERY careful about ensuring the context state is marked for
- * upload, the only place it shouldn't be uploaded is when the setup
- * state has changed in ReducedPrimitiveChange as this comes right after
- * a state update.
- *
- * Blits of any type should always upload the context and masks after
- * they are done.
- */
-void mach64EmitHwStateLocked( mach64ContextPtr mmesa )
-{
- drm_mach64_sarea_t *sarea = mmesa->sarea;
- drm_mach64_context_regs_t *regs = &(mmesa->setup);
- mach64TexObjPtr t0 = mmesa->CurrentTexObj[0];
- mach64TexObjPtr t1 = mmesa->CurrentTexObj[1];
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_MSG ) {
- mach64DDPrintDirty( __FUNCTION__, mmesa->dirty );
- }
-
- if ( t0 && t1 && mmesa->mach64Screen->numTexHeaps > 1 ) {
- if (t0->heap != t1->heap ||
- (mmesa->dirty & MACH64_UPLOAD_TEX0IMAGE) ||
- (mmesa->dirty & MACH64_UPLOAD_TEX1IMAGE))
- mach64UploadMultiTexImages( mmesa, t0, t1 );
- } else {
- if ( mmesa->dirty & MACH64_UPLOAD_TEX0IMAGE ) {
- if ( t0 ) mach64UploadTexImages( mmesa, t0 );
- }
- if ( mmesa->dirty & MACH64_UPLOAD_TEX1IMAGE ) {
- if ( t1 ) mach64UploadTexImages( mmesa, t1 );
- }
- }
-
- if ( mmesa->dirty & (MACH64_UPLOAD_CONTEXT | MACH64_UPLOAD_MISC) ) {
- memcpy( &sarea->context_state, regs,
- MACH64_NR_CONTEXT_REGS * sizeof(GLuint) );
- }
-
- if ( mmesa->dirty & MACH64_UPLOAD_TEXTURE ) {
- mach64EmitTexStateLocked( mmesa, t0, t1 );
- }
-
- sarea->vertsize = mmesa->vertex_size;
-
- /* Turn off the texture cache flushing.
- */
- mmesa->setup.tex_cntl &= ~MACH64_TEX_CACHE_FLUSH;
-
- sarea->dirty |= mmesa->dirty;
-
- mmesa->dirty &= MACH64_UPLOAD_CLIPRECTS;
-}
-
-static void mach64DDPrintState( const char *msg, GLuint flags )
-{
- fprintf( stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s\n",
- msg,
- flags,
- (flags & MACH64_NEW_CONTEXT) ? "context, " : "",
- (flags & MACH64_NEW_ALPHA) ? "alpha, " : "",
- (flags & MACH64_NEW_DEPTH) ? "depth, " : "",
- (flags & MACH64_NEW_FOG) ? "fog, " : "",
- (flags & MACH64_NEW_CLIP) ? "clip, " : "",
- (flags & MACH64_NEW_TEXTURE) ? "texture, " : "",
- (flags & MACH64_NEW_CULL) ? "cull, " : "",
- (flags & MACH64_NEW_MASKS) ? "masks, " : "",
- (flags & MACH64_NEW_WINDOW) ? "window, " : "" );
-}
-
-/* Update the hardware state */
-void mach64DDUpdateHWState( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- int new_state = mmesa->new_state;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_MSG ) {
- fprintf( stderr, "%s:\n", __FUNCTION__ );
- }
-
- if ( new_state )
- {
- FLUSH_BATCH( mmesa );
-
- mmesa->new_state = 0;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_MSG )
- mach64DDPrintState( __FUNCTION__, new_state );
-
- /* Update the various parts of the context's state.
- */
- if ( new_state & MACH64_NEW_ALPHA )
- mach64UpdateAlphaMode( ctx );
-
- if ( new_state & MACH64_NEW_DEPTH )
- mach64UpdateZMode( ctx );
-
- if ( new_state & MACH64_NEW_FOG )
- mach64UpdateFogAttrib( ctx );
-
- if ( new_state & MACH64_NEW_CLIP )
- mach64UpdateClipping( ctx );
-
- if ( new_state & MACH64_NEW_WINDOW )
- mach64CalcViewport( ctx );
-
- if ( new_state & MACH64_NEW_CULL )
- mach64UpdateCull( ctx );
-
- if ( new_state & MACH64_NEW_MASKS )
- mach64UpdateMasks( ctx );
-
- if ( new_state & MACH64_NEW_TEXTURE )
- mach64UpdateTextureState( ctx );
- }
-}
-
-
-static void mach64DDInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- MACH64_CONTEXT(ctx)->NewGLState |= new_state;
-}
-
-
-/* Initialize the context's hardware state */
-void mach64DDInitState( mach64ContextPtr mmesa )
-{
- GLuint format;
-
- switch ( mmesa->mach64Screen->cpp ) {
- case 2:
- format = MACH64_DATATYPE_RGB565;
- break;
- case 4:
- format = MACH64_DATATYPE_ARGB8888;
- break;
- default:
- fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
- exit( -1 );
- }
-
- /* Always have a 16-bit depth buffer
- * but Z coordinates are specified in 16.1 format to the setup engine.
- */
- mmesa->depth_scale = 2.0;
-
- mmesa->ClearColor = 0x00000000;
- mmesa->ClearDepth = 0x0000ffff;
-
- mmesa->Fallback = 0;
-
- if ( mmesa->glCtx->Visual.doubleBufferMode ) {
- mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->backOffset;
- mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->backPitch;
- } else {
- mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->frontOffset;
- mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->frontPitch;
- }
-
- /* Harware state:
- */
- mmesa->setup.dst_off_pitch = (((mmesa->drawPitch/8) << 22) |
- (mmesa->drawOffset >> 3));
-
- mmesa->setup.z_off_pitch = (((mmesa->mach64Screen->depthPitch/8) << 22) |
- (mmesa->mach64Screen->depthOffset >> 3));
-
- mmesa->setup.z_cntl = (MACH64_Z_TEST_LESS |
- MACH64_Z_MASK_EN);
-
- mmesa->setup.alpha_tst_cntl = (MACH64_ALPHA_TEST_ALWAYS |
- MACH64_ALPHA_DST_SRCALPHA |
- MACH64_ALPHA_TST_SRC_TEXEL |
- (0 << MACH64_REF_ALPHA_SHIFT));
-
- mmesa->setup.scale_3d_cntl = (MACH64_SCALE_PIX_EXPAND_DYNAMIC_RANGE |
- /* MACH64_SCALE_DITHER_ERROR_DIFFUSE | */
- MACH64_SCALE_DITHER_2D_TABLE |
- /* MACH64_DITHER_INIT_CURRENT | */
- MACH64_DITHER_INIT_RESET |
- MACH64_SCALE_3D_FCN_SHADE |
- MACH64_ALPHA_FOG_DIS |
- MACH64_ALPHA_BLEND_SRC_ONE |
- MACH64_ALPHA_BLEND_DST_ZERO |
- MACH64_TEX_LIGHT_FCN_MODULATE |
- MACH64_MIP_MAP_DISABLE |
- MACH64_BILINEAR_TEX_EN |
- MACH64_TEX_BLEND_FCN_LINEAR);
-
- /* GL spec says dithering initially enabled, but dithering causes
- * problems w/ 24bpp depth
- */
- if ( mmesa->mach64Screen->cpp == 4 )
- mmesa->setup.scale_3d_cntl |= MACH64_ROUND_EN;
- else
- mmesa->setup.scale_3d_cntl |= MACH64_DITHER_EN;
-
- mmesa->setup.sc_left_right = 0x1fff0000;
- mmesa->setup.sc_top_bottom = 0x3fff0000;
-
- mmesa->setup.dp_fog_clr = 0x00ffffff;
- mmesa->setup.dp_write_mask = 0xffffffff;
-
- mmesa->setup.dp_pix_width = ((format << 0) |
- (format << 4) |
- (format << 8) |
- (format << 16) |
- (format << 28));
-
- mmesa->setup.dp_mix = (MACH64_BKGD_MIX_S |
- MACH64_FRGD_MIX_S);
- mmesa->setup.dp_src = (MACH64_BKGD_SRC_3D |
- MACH64_FRGD_SRC_3D |
- MACH64_MONO_SRC_ONE);
-
- mmesa->setup.clr_cmp_cntl = 0x00000000;
- mmesa->setup.gui_traj_cntl = (MACH64_DST_X_LEFT_TO_RIGHT |
- MACH64_DST_Y_TOP_TO_BOTTOM);
-
- mmesa->setup.setup_cntl = (MACH64_FLAT_SHADE_OFF |
- MACH64_SOLID_MODE_OFF |
- MACH64_LOG_MAX_INC_ADJ);
- mmesa->setup.setup_cntl = 0;
-
- mmesa->setup.tex_size_pitch = 0x00000000;
-
- mmesa->setup.tex_cntl = ((0 << MACH64_LOD_BIAS_SHIFT) |
- (0 << MACH64_COMP_FACTOR_SHIFT) |
- MACH64_COMP_COMBINE_MODULATE |
- MACH64_COMP_BLEND_NEAREST |
- MACH64_COMP_FILTER_NEAREST |
- /* MACH64_TEXTURE_TILING | */
-#ifdef MACH64_PREMULT_TEXCOORDS
- MACH64_TEX_ST_DIRECT |
-#endif
- MACH64_TEX_SRC_LOCAL |
- MACH64_TEX_UNCOMPRESSED |
- MACH64_TEX_CACHE_FLUSH |
- MACH64_TEX_CACHE_SIZE_4K);
-
- mmesa->setup.secondary_tex_off = 0x00000000;
- mmesa->setup.tex_offset = 0x00000000;
-
- mmesa->new_state = MACH64_NEW_ALL;
-}
-
-/* Initialize the driver's state functions.
- */
-void mach64DDInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = mach64DDInvalidateState;
-
- ctx->Driver.ClearIndex = NULL;
- ctx->Driver.ClearColor = mach64DDClearColor;
- ctx->Driver.DrawBuffer = mach64DDDrawBuffer;
- ctx->Driver.ReadBuffer = mach64DDReadBuffer;
-
- ctx->Driver.IndexMask = NULL;
- ctx->Driver.ColorMask = mach64DDColorMask;
- ctx->Driver.AlphaFunc = mach64DDAlphaFunc;
- ctx->Driver.BlendEquationSeparate = mach64DDBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = mach64DDBlendFuncSeparate;
- ctx->Driver.ClearDepth = mach64DDClearDepth;
- ctx->Driver.CullFace = mach64DDCullFace;
- ctx->Driver.FrontFace = mach64DDFrontFace;
- ctx->Driver.DepthFunc = mach64DDDepthFunc;
- ctx->Driver.DepthMask = mach64DDDepthMask;
- ctx->Driver.Enable = mach64DDEnable;
- ctx->Driver.Fogfv = mach64DDFogfv;
- ctx->Driver.Hint = NULL;
- ctx->Driver.Lightfv = NULL;
- ctx->Driver.LightModelfv = mach64DDLightModelfv;
- ctx->Driver.LogicOpcode = mach64DDLogicOpCode;
- ctx->Driver.PolygonMode = NULL;
- ctx->Driver.PolygonStipple = NULL;
- ctx->Driver.RenderMode = mach64DDRenderMode;
- ctx->Driver.Scissor = mach64DDScissor;
- ctx->Driver.ShadeModel = mach64DDShadeModel;
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
-
- ctx->Driver.DepthRange = mach64DepthRange;
- ctx->Driver.Viewport = mach64Viewport;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.h
deleted file mode 100644
index 95bcab365..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_state.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- */
-
-#ifndef __MACH64_STATE_H__
-#define __MACH64_STATE_H__
-
-#include "mach64_context.h"
-
-extern void mach64DDInitState( mach64ContextPtr mmesa );
-extern void mach64DDInitStateFuncs( GLcontext *ctx );
-
-extern void mach64SetCliprects( GLcontext *ctx, GLenum mode );
-extern void mach64CalcViewport( GLcontext *ctx );
-
-extern void mach64DDUpdateState( GLcontext *ctx );
-extern void mach64DDUpdateHWState( GLcontext *ctx );
-
-extern void mach64EmitHwStateLocked( mach64ContextPtr mmesa );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.c
deleted file mode 100644
index 6459deef7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ /dev/null
@@ -1,610 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_ioctl.h"
-#include "mach64_state.h"
-#include "mach64_vb.h"
-#include "mach64_tris.h"
-#include "mach64_tex.h"
-
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "imports.h"
-
-
-static void mach64SetTexWrap( mach64TexObjPtr t,
- GLenum swrap, GLenum twrap )
-{
- switch ( swrap ) {
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- case GL_CLAMP_TO_BORDER:
- t->ClampS = GL_TRUE;
- break;
- case GL_REPEAT:
- t->ClampS = GL_FALSE;
- break;
- }
-
- switch ( twrap ) {
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- case GL_CLAMP_TO_BORDER:
- t->ClampT = GL_TRUE;
- break;
- case GL_REPEAT:
- t->ClampT = GL_FALSE;
- break;
- }
-}
-
-static void mach64SetTexFilter( mach64TexObjPtr t,
- GLenum minf, GLenum magf )
-{
- switch ( minf ) {
- case GL_NEAREST:
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_NEAREST_MIPMAP_LINEAR:
- t->BilinearMin = GL_FALSE;
- break;
- case GL_LINEAR:
- case GL_LINEAR_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_LINEAR:
- t->BilinearMin = GL_TRUE;
- break;
- }
-
- switch ( magf ) {
- case GL_NEAREST:
- t->BilinearMag = GL_FALSE;
- break;
- case GL_LINEAR:
- t->BilinearMag = GL_TRUE;
- break;
- }
-}
-
-static void mach64SetTexBorderColor( mach64TexObjPtr t, GLubyte c[4] )
-{
-#if 0
- GLuint border = mach64PackColor( 4, c[0], c[1], c[2], c[3] );
-#endif
-}
-
-
-static mach64TexObjPtr
-mach64AllocTexObj( struct gl_texture_object *texObj )
-{
- mach64TexObjPtr t;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API )
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj );
-
- t = (mach64TexObjPtr) CALLOC_STRUCT( mach64_texture_object );
- if ( !t )
- return NULL;
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->tObj = texObj;
-
- t->offset = 0;
-
- t->dirty = 1;
-
- make_empty_list( t );
-
- mach64SetTexWrap( t, texObj->WrapS, texObj->WrapT );
- /*mach64SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/
- mach64SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- mach64SetTexBorderColor( t, texObj->_BorderChan );
-
- return t;
-}
-
-
-/* Called by the _mesa_store_teximage[123]d() functions. */
-static const struct gl_texture_format *
-mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- (void) format;
- (void) type;
-
- switch ( internalFormat ) {
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case 4:
- case GL_RGBA:
- case GL_RGBA2:
- if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
- else
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
- else
- return &_mesa_texformat_argb1555;
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- case GL_RGBA4:
- if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
- else
- return &_mesa_texformat_argb4444;
-
- case 3:
- case GL_RGB:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
- else
- return &_mesa_texformat_rgb565;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888; /* inefficient but accurate */
- else
- return &_mesa_texformat_argb1555;
-
- case GL_INTENSITY4:
- case GL_INTENSITY:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888; /* inefficient but accurate */
- else
- return &_mesa_texformat_argb4444;
-
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- default:
- _mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ );
- return NULL;
- }
-}
-
-static void mach64TexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
-
- if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
- }
- else {
- t = mach64AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- texObj->DriverData = t;
- }
-
- /* Note, this will call mach64ChooseTextureFormat */
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, packing, texObj, texImage );
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-}
-
-static void mach64TexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
- }
- else {
- t = mach64AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
- return;
- }
- texObj->DriverData = t;
- }
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-}
-
-static void mach64TexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
-
- if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
- }
- else {
- t = mach64AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- texObj->DriverData = t;
- }
-
- /* Note, this will call mach64ChooseTextureFormat */
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage );
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-}
-
-static void mach64TexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
- }
- else {
- t = mach64AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- texObj->DriverData = t;
- }
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-}
-
-/* Due to the way we must program texture state into the Rage Pro,
- * we must leave these calculations to the absolute last minute.
- */
-void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
- mach64TexObjPtr t0,
- mach64TexObjPtr t1 )
-{
- drm_mach64_sarea_t *sarea = mmesa->sarea;
- drm_mach64_context_regs_t *regs = &(mmesa->setup);
-
- /* for multitex, both textures must be local or AGP */
- if ( t0 && t1 )
- assert(t0->heap == t1->heap);
-
- if ( t0 ) {
- if (t0->heap == MACH64_CARD_HEAP) {
-#if ENABLE_PERF_BOXES
- mmesa->c_texsrc_card++;
-#endif
- mmesa->setup.tex_cntl &= ~MACH64_TEX_SRC_AGP;
- } else {
-#if ENABLE_PERF_BOXES
- mmesa->c_texsrc_agp++;
-#endif
- mmesa->setup.tex_cntl |= MACH64_TEX_SRC_AGP;
- }
- mmesa->setup.tex_offset = t0->offset;
- }
-
- if ( t1 ) {
- mmesa->setup.secondary_tex_off = t1->offset;
- }
-
- memcpy( &sarea->context_state.tex_size_pitch, &regs->tex_size_pitch,
- MACH64_NR_TEXTURE_REGS * sizeof(GLuint) );
-}
-
-
-/* ================================================================
- * Device Driver API texture functions
- */
-
-static void mach64DDTexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-#if 0
- struct gl_texture_unit *texUnit;
- GLubyte c[4];
-#endif
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
- }
-
- switch ( pname ) {
- case GL_TEXTURE_ENV_MODE:
- FLUSH_BATCH( mmesa );
- mmesa->new_state |= MACH64_NEW_TEXTURE | MACH64_NEW_ALPHA;
- break;
-
-#if 0
- case GL_TEXTURE_ENV_COLOR:
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- CLAMPED_FLOAT_TO_UBYTE( c[0], texUnit->EnvColor[0] );
- CLAMPED_FLOAT_TO_UBYTE( c[1], texUnit->EnvColor[1] );
- CLAMPED_FLOAT_TO_UBYTE( c[2], texUnit->EnvColor[2] );
- CLAMPED_FLOAT_TO_UBYTE( c[3], texUnit->EnvColor[3] );
- mmesa->env_color = mach64PackColor( 32, c[0], c[1], c[2], c[3] );
- if ( mmesa->setup.constant_color_c != mmesa->env_color ) {
- FLUSH_BATCH( mmesa );
- mmesa->setup.constant_color_c = mmesa->env_color;
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-
- /* More complex multitexture/multipass fallbacks for GL_BLEND
- * can be done later, but this allows a single pass GL_BLEND
- * in some cases (ie. Performer town demo).
- */
- mmesa->blend_flags &= ~MACH64_BLEND_ENV_COLOR;
- if ( mmesa->env_color != 0x00000000 &&
- mmesa->env_color != 0xff000000 &&
- mmesa->env_color != 0x00ffffff &&
- mmesa->env_color != 0xffffffff )) {
- mmesa->blend_flags |= MACH64_BLEND_ENV_COLOR;
- }
- }
- break;
-#endif
-
- default:
- return;
- }
-}
-
-static void mach64DDTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr)tObj->DriverData;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
- }
-
- if ( ( target != GL_TEXTURE_2D ) &&
- ( target != GL_TEXTURE_1D ) ) {
- return;
- }
-
- if (!t) {
- t = mach64AllocTexObj(tObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexParameter");
- return;
- }
- tObj->DriverData = t;
- }
-
- switch ( pname ) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- if ( t->bound ) FLUSH_BATCH( mmesa );
- mach64SetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- if ( t->bound ) FLUSH_BATCH( mmesa );
- mach64SetTexWrap( t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- if ( t->bound ) FLUSH_BATCH( mmesa );
- mach64SetTexBorderColor( t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- /* From Radeon/Rage128:
- * This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- *
- * For mach64 we're only concerned with the base level
- * since that's the only texture we upload.
- */
- if ( t->bound ) FLUSH_BATCH( mmesa );
- mach64SwapOutTexObj( mmesa, t );
- break;
-
- default:
- return;
- }
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-}
-
-static void mach64DDBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLint unit = ctx->Texture.CurrentUnit;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p ) unit=%d\n",
- __FUNCTION__, tObj, unit );
- }
-
- FLUSH_BATCH( mmesa );
-
- if ( mmesa->CurrentTexObj[unit] ) {
- mmesa->CurrentTexObj[unit]->bound &= ~(unit+1);
- mmesa->CurrentTexObj[unit] = NULL;
- }
-
- mmesa->new_state |= MACH64_NEW_TEXTURE;
-}
-
-static void mach64DDDeleteTexture( GLcontext *ctx,
- struct gl_texture_object *tObj )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr)tObj->DriverData;
-
- if ( t ) {
- if ( t->bound && mmesa ) {
- FLUSH_BATCH( mmesa );
-
- mmesa->CurrentTexObj[t->bound-1] = 0;
- mmesa->new_state |= MACH64_NEW_TEXTURE;
- }
-
- mach64DestroyTexObj( mmesa, t );
- tObj->DriverData = NULL;
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-
- }
-}
-
-static GLboolean mach64DDIsTextureResident( GLcontext *ctx,
- struct gl_texture_object *tObj )
-{
- mach64TexObjPtr t = (mach64TexObjPtr)tObj->DriverData;
-
- return ( t && t->memBlock );
-}
-
-
-void mach64InitTextureFuncs( struct dd_function_table *functions )
-{
- functions->TexEnv = mach64DDTexEnv;
- functions->ChooseTextureFormat = mach64ChooseTextureFormat;
- functions->TexImage1D = mach64TexImage1D;
- functions->TexSubImage1D = mach64TexSubImage1D;
- functions->TexImage2D = mach64TexImage2D;
- functions->TexSubImage2D = mach64TexSubImage2D;
- functions->TexImage3D = _mesa_store_teximage3d;
- functions->TexSubImage3D = _mesa_store_texsubimage3d;
- functions->CopyTexImage1D = _swrast_copy_teximage1d;
- functions->CopyTexImage2D = _swrast_copy_teximage2d;
- functions->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- functions->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- functions->CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- functions->TexParameter = mach64DDTexParameter;
- functions->BindTexture = mach64DDBindTexture;
- functions->DeleteTexture = mach64DDDeleteTexture;
- functions->UpdateTexturePalette = NULL;
- functions->ActiveTexture = NULL;
- functions->IsTextureResident = mach64DDIsTextureResident;
- functions->PrioritizeTexture = NULL;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.h
deleted file mode 100644
index d950dd12b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tex.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_TEX_H__
-#define __MACH64_TEX_H__
-
-extern void mach64UpdateTextureState( GLcontext *ctx );
-
-extern void mach64SwapOutTexObj( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t );
-
-extern void mach64UploadTexImages( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t );
-
-extern void mach64UploadMultiTexImages( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t0, mach64TexObjPtr t1 );
-
-extern void mach64AgeTextures( mach64ContextPtr mach64ctx, int heap );
-extern void mach64DestroyTexObj( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t );
-
-extern void mach64UpdateTexLRU( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t );
-
-extern void mach64PrintLocalLRU( mach64ContextPtr mach64ctx, int heap );
-extern void mach64PrintGlobalLRU( mach64ContextPtr mach64ctx, int heap );
-
-extern void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
- mach64TexObjPtr t0,
- mach64TexObjPtr t1 );
-
-extern void mach64InitTextureFuncs( struct dd_function_table *functions );
-
-/* ================================================================
- * Color conversion macros:
- */
-
-#define MACH64PACKCOLOR332(r, g, b) \
- (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6))
-
-#define MACH64PACKCOLOR1555(r, g, b, a) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define MACH64PACKCOLOR565(r, g, b) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define MACH64PACKCOLOR888(r, g, b) \
- (((r) << 16) | ((g) << 8) | (b))
-
-#define MACH64PACKCOLOR8888(r, g, b, a) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define MACH64PACKCOLOR4444(r, g, b, a) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-static __inline__ GLuint mach64PackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return MACH64PACKCOLOR565( r, g, b );
- case 4:
- return MACH64PACKCOLOR8888( r, g, b, a );
- default:
- return 0;
- }
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texmem.c
deleted file mode 100644
index f771818c8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texmem.c
+++ /dev/null
@@ -1,867 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 1999, 2000 ATI Technologies Inc. and 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
- * 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
- * ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * Jose Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "mach64_context.h"
-#include "mach64_state.h"
-#include "mach64_ioctl.h"
-#include "mach64_vb.h"
-#include "mach64_tris.h"
-#include "mach64_tex.h"
-
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "imports.h"
-
-
-/* Destroy hardware state associated with texture `t'.
- */
-void mach64DestroyTexObj( mach64ContextPtr mmesa, mach64TexObjPtr t )
-{
-#if ENABLE_PERF_BOXES
- /* Bump the performace counter */
- if (mmesa)
- mmesa->c_textureSwaps++;
-#endif
- if ( !t ) return;
-
-#if 0
- if ( t->tObj && t->memBlock && mmesa ) {
- /* not a placeholder, so release from global LRU if necessary */
- int heap = t->heap;
- drmTextureRegion *list = mmesa->sarea->tex_list[heap];
- int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
- int start = t->memBlock->ofs >> log2sz;
- int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
- int i;
-
- mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];
-
- /* Update the global LRU */
- for ( i = start ; i <= end ; i++ ) {
- /* do we own this block? */
- if (list[i].in_use == mmesa->hHWContext) {
- list[i].in_use = 0;
- list[i].age = mmesa->lastTexAge[heap];
-
- /* remove_from_list(i) */
- list[(GLuint)list[i].next].prev = list[i].prev;
- list[(GLuint)list[i].prev].next = list[i].next;
- }
- }
- }
-#endif
-
- if ( t->memBlock ) {
- mmFreeMem( t->memBlock );
- t->memBlock = NULL;
- }
-
- if ( t->tObj ) {
- t->tObj->DriverData = NULL;
- }
-
- if ( t->bound && mmesa )
- mmesa->CurrentTexObj[t->bound-1] = NULL;
-
- remove_from_list( t );
- FREE( t );
-}
-
-/* Keep track of swapped out texture objects.
- */
-void mach64SwapOutTexObj( mach64ContextPtr mmesa,
- mach64TexObjPtr t )
-{
-#if ENABLE_PERF_BOXES
- /* Bump the performace counter */
- if (mmesa)
- mmesa->c_textureSwaps++;
-#endif
-
-#if 0
- if ( t->tObj && t->memBlock && mmesa ) {
- /* not a placeholder, so release from global LRU if necessary */
- int heap = t->heap;
- drmTextureRegion *list = mmesa->sarea->tex_list[heap];
- int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
- int start = t->memBlock->ofs >> log2sz;
- int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
- int i;
-
- mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];
-
- /* Update the global LRU */
- for ( i = start ; i <= end ; i++ ) {
- /* do we own this block? */
- if (list[i].in_use == mmesa->hHWContext) {
- list[i].in_use = 0;
- list[i].age = mmesa->lastTexAge[heap];
-
- /* remove_from_list(i) */
- list[(GLuint)list[i].next].prev = list[i].prev;
- list[(GLuint)list[i].prev].next = list[i].next;
- }
- }
- }
-#endif
-
- if ( t->memBlock ) {
- mmFreeMem( t->memBlock );
- t->memBlock = NULL;
- }
-
- t->dirty = ~0;
- move_to_tail( &mmesa->SwappedOut, t );
-}
-
-/* Print out debugging information about texture LRU.
- */
-void mach64PrintLocalLRU( mach64ContextPtr mmesa, int heap )
-{
- mach64TexObjPtr t;
- int sz = 1 << (mmesa->mach64Screen->logTexGranularity[heap]);
-
- fprintf( stderr, "\nLocal LRU, heap %d:\n", heap );
-
- foreach( t, &mmesa->TexObjList[heap] ) {
- if ( !t->tObj ) {
- fprintf( stderr, "Placeholder %d at 0x%x sz 0x%x\n",
- t->memBlock->ofs / sz,
- t->memBlock->ofs,
- t->memBlock->size );
- } else {
- fprintf( stderr, "Texture (bound %d) at 0x%x sz 0x%x\n",
- t->bound,
- t->memBlock->ofs,
- t->memBlock->size );
- }
- }
-
- fprintf( stderr, "\n" );
-}
-
-void mach64PrintGlobalLRU( mach64ContextPtr mmesa, int heap )
-{
- drm_tex_region_t *list = mmesa->sarea->tex_list[heap];
- int i, j;
-
- fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list );
-
- for ( i = 0, j = MACH64_NR_TEX_REGIONS ; i < MACH64_NR_TEX_REGIONS ; i++ ) {
- fprintf( stderr, "list[%d] age %d in_use %d next %d prev %d\n",
- j, list[j].age, list[j].in_use, list[j].next, list[j].prev );
- j = list[j].next;
- if ( j == MACH64_NR_TEX_REGIONS ) break;
- }
-
- if ( j != MACH64_NR_TEX_REGIONS ) {
- fprintf( stderr, "Loop detected in global LRU\n" );
- for ( i = 0 ; i < MACH64_NR_TEX_REGIONS ; i++ ) {
- fprintf( stderr, "list[%d] age %d in_use %d next %d prev %d\n",
- i, list[i].age, list[i].in_use, list[i].next, list[i].prev );
- }
- }
-
- fprintf( stderr, "\n" );
-}
-
-/* Reset the global texture LRU.
- */
-/* NOTE: This function is only called while holding the hardware lock */
-static void mach64ResetGlobalLRU( mach64ContextPtr mmesa, int heap )
-{
- drm_tex_region_t *list = mmesa->sarea->tex_list[heap];
- int sz = 1 << mmesa->mach64Screen->logTexGranularity[heap];
- int i;
-
- /* (Re)initialize the global circular LRU list. The last element in
- * the array (MACH64_NR_TEX_REGIONS) is the sentinal. Keeping it at
- * the end of the array allows it to be addressed rationally when
- * looking up objects at a particular location in texture memory.
- */
- for ( i = 0 ; (i+1) * sz <= mmesa->mach64Screen->texSize[heap] ; i++ ) {
- list[i].prev = i-1;
- list[i].next = i+1;
- list[i].age = 0;
- list[i].in_use = 0;
- }
-
- i--;
- list[0].prev = MACH64_NR_TEX_REGIONS;
- list[i].prev = i-1;
- list[i].next = MACH64_NR_TEX_REGIONS;
- list[MACH64_NR_TEX_REGIONS].prev = i;
- list[MACH64_NR_TEX_REGIONS].next = 0;
- mmesa->sarea->tex_age[heap] = 0;
-}
-
-/* Update the local and global texture LRUs.
- */
-/* NOTE: This function is only called while holding the hardware lock */
-void mach64UpdateTexLRU( mach64ContextPtr mmesa,
- mach64TexObjPtr t )
-{
- int heap = t->heap;
- drm_tex_region_t *list = mmesa->sarea->tex_list[heap];
- int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
- int start = t->memBlock->ofs >> log2sz;
- int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
- int i;
-
- mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];
-
- if ( !t->memBlock ) {
- fprintf( stderr, "no memblock\n\n" );
- return;
- }
-
- /* Update our local LRU */
- move_to_head( &mmesa->TexObjList[heap], t );
-
- /* Update the global LRU */
- for ( i = start ; i <= end ; i++ ) {
- list[i].in_use = mmesa->hHWContext;
- list[i].age = mmesa->lastTexAge[heap];
-
-#if 0
- /* if this is the last region, it's not in the list */
- if ( !(i*(1<<log2sz) > mmesa->mach64Screen->texSize[heap] ) ) {
-#endif
- /* remove_from_list(i) */
- list[(GLuint)list[i].next].prev = list[i].prev;
- list[(GLuint)list[i].prev].next = list[i].next;
-#if 0
- }
-#endif
-
- /* insert_at_head(list, i) */
- list[i].prev = MACH64_NR_TEX_REGIONS;
- list[i].next = list[MACH64_NR_TEX_REGIONS].next;
- list[(GLuint)list[MACH64_NR_TEX_REGIONS].next].prev = i;
- list[MACH64_NR_TEX_REGIONS].next = i;
- }
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_LRU ) {
- mach64PrintGlobalLRU( mmesa, t->heap );
- mach64PrintLocalLRU( mmesa, t->heap );
- }
-}
-
-/* Update our notion of what textures have been changed since we last
- * 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 (tObj == NULL).
- */
-/* NOTE: This function is only called while holding the hardware lock */
-static void mach64TexturesGone( mach64ContextPtr mmesa, int heap,
- int offset, int size, int in_use )
-{
- mach64TexObjPtr t, tmp;
-
- foreach_s ( t, tmp, &mmesa->TexObjList[heap] ) {
- if ( t->memBlock->ofs >= offset + size ||
- t->memBlock->ofs + t->memBlock->size <= offset )
- continue;
-
- /* It overlaps - kick it out. Need to hold onto the currently
- * bound objects, however.
- */
- if ( t->bound ) {
- mach64SwapOutTexObj( mmesa, t );
- } else {
- mach64DestroyTexObj( mmesa, t );
- }
- }
-
- if ( in_use > 0 && in_use != mmesa->hHWContext ) {
- t = (mach64TexObjPtr) CALLOC( sizeof(*t) );
- if (!t) return;
-
- t->memBlock = mmAllocMem( mmesa->texHeap[heap], size, 0, offset );
- if ( !t->memBlock ) {
- fprintf( stderr, "Couldn't alloc placeholder sz %x ofs %x\n",
- (int)size, (int)offset );
- mmDumpMemInfo( mmesa->texHeap[heap] );
- return;
- }
- insert_at_head( &mmesa->TexObjList[heap], t );
- }
-}
-
-/* Update our client's shared texture state. If another client has
- * modified a region in which we have textures, then we need to figure
- * out which of our textures has been removed, and update our global
- * LRU.
- */
-void mach64AgeTextures( mach64ContextPtr mmesa, int heap )
-{
- drm_mach64_sarea_t *sarea = mmesa->sarea;
-
- if ( sarea->tex_age[heap] != mmesa->lastTexAge[heap] ) {
- int sz = 1 << mmesa->mach64Screen->logTexGranularity[heap];
- int nr = 0;
- int idx;
-
- /* Have to go right round from the back to ensure stuff ends up
- * LRU in our local list... Fix with a cursor pointer.
- */
- for ( idx = sarea->tex_list[heap][MACH64_NR_TEX_REGIONS].prev ;
- idx != MACH64_NR_TEX_REGIONS && nr < MACH64_NR_TEX_REGIONS ;
- idx = sarea->tex_list[heap][idx].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 ( idx * sz > mmesa->mach64Screen->texSize[heap] ) {
- nr = MACH64_NR_TEX_REGIONS;
- break;
- }
-
- if ( sarea->tex_list[heap][idx].age > mmesa->lastTexAge[heap] ) {
- mach64TexturesGone( mmesa, heap, idx * sz, sz,
- sarea->tex_list[heap][idx].in_use );
- }
- }
-
- /* If switching texturing schemes, then the SAREA might not
- * have been properly cleared, so we need to reset the
- * global texture LRU.
- */
- if ( nr == MACH64_NR_TEX_REGIONS ) {
- mach64TexturesGone( mmesa, heap, 0,
- mmesa->mach64Screen->texSize[heap], 0 );
- mach64ResetGlobalLRU( mmesa, heap );
- }
-
- if ( 0 ) {
- mach64PrintGlobalLRU( mmesa, heap );
- mach64PrintLocalLRU( mmesa, heap );
- }
-
- mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
- MACH64_UPLOAD_TEX0IMAGE |
- MACH64_UPLOAD_TEX1IMAGE);
- mmesa->lastTexAge[heap] = sarea->tex_age[heap];
- }
-}
-
-/* Upload the texture image associated with texture `t' at level `level'
- * at the address relative to `start'.
- */
-static void mach64UploadAGPSubImage( mach64ContextPtr mmesa,
- mach64TexObjPtr t, int level,
- int x, int y, int width, int height )
-{
- mach64ScreenRec *mach64Screen = mmesa->mach64Screen;
- struct gl_texture_image *image;
- int texelsPerDword = 0;
- int dwords;
-
- /* Ensure we have a valid texture to upload */
- if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) )
- return;
-
- image = t->tObj->Image[0][level];
- if ( !image )
- return;
-
- switch ( image->TexFormat->TexelBytes ) {
- case 1: texelsPerDword = 4; break;
- case 2: texelsPerDword = 2; break;
- case 4: texelsPerDword = 1; break;
- }
-
-#if 1
- /* FIXME: The subimage index calcs are wrong... */
- x = 0;
- y = 0;
- width = image->Width;
- height = image->Height;
-#endif
-
- dwords = width * height / texelsPerDword;
-
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- mmesa->c_agpTextureBytes += (dwords << 2);
-#endif
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "mach64UploadSubImage: %d,%d of %d,%d at %d,%d\n",
- width, height, image->Width, image->Height, x, y );
- fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x dwords: %d\n",
- (GLuint)t->offset, (GLint)width, dwords );
- mmDumpMemInfo( mmesa->texHeap[t->heap] );
- }
-
- assert(image->Data);
-
- {
- CARD32 *dst = (CARD32 *)((char *)mach64Screen->agpTextures.map + t->memBlock->ofs);
- const GLubyte *src = (const GLubyte *) image->Data +
- (y * image->Width + x) * image->TexFormat->TexelBytes;
- const GLuint bytes = width * height * image->TexFormat->TexelBytes;
- memcpy(dst, src, bytes);
- }
-
-}
-
-/* Upload the texture image associated with texture `t' at level `level'
- * at the address relative to `start'.
- */
-static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
- mach64TexObjPtr t, int level,
- int x, int y, int width, int height )
-{
- struct gl_texture_image *image;
- int texelsPerDword = 0;
- int imageWidth, imageHeight;
- int remaining, rows;
- int format, dwords;
- const int maxdwords = (MACH64_BUFFER_MAX_DWORDS - (MACH64_HOSTDATA_BLIT_OFFSET / 4));
- CARD32 pitch, offset;
- int i;
-
- /* Ensure we have a valid texture to upload */
- if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) )
- return;
-
- image = t->tObj->Image[0][level];
- if ( !image )
- return;
-
- switch ( image->TexFormat->TexelBytes ) {
- case 1: texelsPerDword = 4; break;
- case 2: texelsPerDword = 2; break;
- case 4: texelsPerDword = 1; break;
- }
-
-#if 1
- /* FIXME: The subimage index calcs are wrong... */
- x = 0;
- y = 0;
- width = image->Width;
- height = image->Height;
-#endif
-
- imageWidth = image->Width;
- imageHeight = image->Height;
-
- format = t->textureFormat;
-
- /* The texel upload routines have a minimum width, so force the size
- * if needed.
- */
- if ( imageWidth < texelsPerDword ) {
- int factor;
-
- factor = texelsPerDword / imageWidth;
- imageWidth = texelsPerDword;
- imageHeight /= factor;
- if ( imageHeight == 0 ) {
- /* In this case, the texel converter will actually walk a
- * texel or two off the end of the image, but normal malloc
- * alignment should prevent it from ever causing a fault.
- */
- imageHeight = 1;
- }
- }
-
- /* We can't upload to a pitch less than 64 texels so we will need to
- * linearly upload all modified rows for textures smaller than this.
- * This makes the x/y/width/height different for the blitter and the
- * texture walker.
- */
- if ( imageWidth >= 64 ) {
- /* The texture walker and the blitter look identical */
- pitch = imageWidth >> 3;
- } else {
- int factor;
- int y2;
- int start, end;
-
- start = (y * imageWidth) & ~63;
- end = (y + height) * imageWidth;
-
- if ( end - start < 64 ) {
- /* Handle the case where the total number of texels
- * uploaded is < 64.
- */
- x = 0;
- y = start / 64;
- width = end - start;
- height = 1;
- } else {
- /* Upload some number of full 64 texel blit rows */
- factor = 64 / imageWidth;
-
- y2 = y + height - 1;
- y /= factor;
- y2 /= factor;
-
- x = 0;
- width = 64;
- height = y2 - y + 1;
- }
-
- /* Fixed pitch of 64 */
- pitch = 8;
- }
-
- dwords = width * height / texelsPerDword;
- offset = t->offset;
-
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- mmesa->c_textureBytes += (dwords << 2);
-#endif
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "mach64UploadSubImage: %d,%d of %d,%d at %d,%d\n",
- width, height, image->Width, image->Height, x, y );
- fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x dwords: %d\n",
- (GLuint)offset, (GLint)width, dwords );
- mmDumpMemInfo( mmesa->texHeap[t->heap] );
- }
-
- /* Subdivide the texture if required (account for the registers added by the drm) */
- if ( dwords <= maxdwords ) {
- rows = height;
- } else {
- rows = (maxdwords * texelsPerDword) / (2 * width);
- }
-
- for ( i = 0, remaining = height ;
- remaining > 0 ;
- remaining -= rows, y += rows, i++ )
- {
- drmBufPtr buffer;
- CARD32 *dst;
-
- height = MIN2(remaining, rows);
-
- /* Grab the dma buffer for the texture blit */
- buffer = mach64GetBufferLocked( mmesa );
-
- dst = (CARD32 *)((char *)buffer->address + MACH64_HOSTDATA_BLIT_OFFSET);
-
- assert(image->Data);
-
- {
- const GLubyte *src = (const GLubyte *) image->Data +
- (y * image->Width + x) * image->TexFormat->TexelBytes;
- const GLuint bytes = width * height * image->TexFormat->TexelBytes;
- memcpy(dst, src, bytes);
- }
-
- mach64FireBlitLocked( mmesa, buffer, offset, pitch, format,
- x, y, width, height );
-
- }
-
- mmesa->new_state |= MACH64_NEW_CONTEXT;
- mmesa->dirty |= MACH64_UPLOAD_CONTEXT | MACH64_UPLOAD_MISC;
-}
-
-
-/* Upload the texture images associated with texture `t'. This might
- * require removing our own and/or other client's texture objects to
- * make room for these images.
- */
-void mach64UploadTexImages( mach64ContextPtr mmesa, mach64TexObjPtr t )
-{
- GLint heap;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %p )\n",
- __FUNCTION__, mmesa->glCtx, t );
- }
-
- assert(t);
- assert(t->tObj);
-
- /* Choose the heap appropriately */
- heap = MACH64_CARD_HEAP;
-
- if ( !mmesa->mach64Screen->IsPCI &&
- t->size > mmesa->mach64Screen->texSize[heap] ) {
- heap = MACH64_AGP_HEAP;
- }
-
- /* Do we need to eject LRU texture objects? */
- if ( !t->memBlock ) {
- t->heap = heap;
-
- /* Allocate a memory block on a 64-byte boundary */
- t->memBlock = mmAllocMem( mmesa->texHeap[heap], t->size, 6, 0 );
-
- /* Try AGP before kicking anything out of local mem */
- if ( !mmesa->mach64Screen->IsPCI && !t->memBlock && heap == MACH64_CARD_HEAP ) {
- t->memBlock = mmAllocMem( mmesa->texHeap[MACH64_AGP_HEAP],
- t->size, 6, 0 );
-
- if ( t->memBlock )
- heap = t->heap = MACH64_AGP_HEAP;
- }
-
- /* Kick out textures until the requested texture fits */
- while ( !t->memBlock ) {
- if ( mmesa->TexObjList[heap].prev->bound ) {
- fprintf( stderr,
- "mach64UploadTexImages: ran into bound texture\n" );
- return;
- }
- if ( mmesa->TexObjList[heap].prev == &mmesa->TexObjList[heap] ) {
- if ( mmesa->mach64Screen->IsPCI ) {
- fprintf( stderr, "%s: upload texture failure on "
- "local texture heaps, sz=%d\n", __FUNCTION__,
- t->size );
- return;
- } else if ( heap == MACH64_CARD_HEAP ) {
- heap = t->heap = MACH64_AGP_HEAP;
- continue;
- } else {
- int i;
- fprintf( stderr, "%s: upload texture failure on "
- "%sAGP texture heaps, sz=%d\n", __FUNCTION__,
- mmesa->firstTexHeap == MACH64_CARD_HEAP ? "both local and " : "",
- t->size );
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- mach64PrintLocalLRU( mmesa, i );
- mmDumpMemInfo( mmesa->texHeap[i] );
- }
- exit(-1);
- return;
- }
- }
-
- mach64SwapOutTexObj( mmesa, mmesa->TexObjList[heap].prev );
-
- t->memBlock = mmAllocMem( mmesa->texHeap[heap], t->size, 6, 0 );
- }
-
- /* Set the base offset of the texture image */
- t->offset = mmesa->mach64Screen->texOffset[heap] + t->memBlock->ofs;
-
- /* Force loading the new state into the hardware */
- mmesa->dirty |= (MACH64_UPLOAD_SCALE_3D_CNTL |
- MACH64_UPLOAD_TEXTURE);
- }
-
- /* Let the world know we've used this memory recently */
- mach64UpdateTexLRU( mmesa, t );
-
- /* Upload any images that are new */
- if ( t->dirty ) {
- if (t->heap == MACH64_AGP_HEAP) {
- /* Need to make sure any vertex buffers in the queue complete */
- mach64WaitForIdleLocked( mmesa );
- mach64UploadAGPSubImage( mmesa, t, t->tObj->BaseLevel, 0, 0,
- t->tObj->Image[0][t->tObj->BaseLevel]->Width,
- t->tObj->Image[0][t->tObj->BaseLevel]->Height );
- } else {
- mach64UploadLocalSubImage( mmesa, t, t->tObj->BaseLevel, 0, 0,
- t->tObj->Image[0][t->tObj->BaseLevel]->Width,
- t->tObj->Image[0][t->tObj->BaseLevel]->Height );
- }
-
- mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH;
- }
-
- mmesa->dirty |= MACH64_UPLOAD_TEXTURE;
-
- t->dirty = 0;
-}
-
-/* The mach64 needs to have both primary and secondary textures in either
- * local or AGP memory, so we need a "buddy system" to make sure that allocation
- * succeeds or fails for both textures.
- * FIXME: This needs to be optimized better.
- */
-void mach64UploadMultiTexImages( mach64ContextPtr mmesa,
- mach64TexObjPtr t0,
- mach64TexObjPtr t1 )
-{
- GLint heap;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %p %p )\n",
- __FUNCTION__, mmesa->glCtx, t0, t1 );
- }
-
- assert(t0 && t1);
- assert(t0->tObj && t1->tObj);
-
- /* Choose the heap appropriately */
- heap = MACH64_CARD_HEAP;
-
- if ( !mmesa->mach64Screen->IsPCI &&
- ((t0->size + t1->size) > mmesa->mach64Screen->texSize[heap]) ) {
- heap = MACH64_AGP_HEAP;
- }
-
- /* Do we need to eject LRU texture objects? */
- if ( !t0->memBlock || !t1->memBlock || t0->heap != t1->heap ) {
- /* FIXME: starting from scratch for now to keep it simple */
- if ( t0->memBlock ) {
- mach64SwapOutTexObj( mmesa, t0 );
- }
- if ( t1->memBlock ) {
- mach64SwapOutTexObj( mmesa, t1 );
- }
- t0->heap = t1->heap = heap;
- /* Allocate a memory block on a 64-byte boundary */
- t0->memBlock = mmAllocMem( mmesa->texHeap[heap], t0->size, 6, 0 );
- if ( t0->memBlock ) {
- t1->memBlock = mmAllocMem( mmesa->texHeap[heap], t1->size, 6, 0 );
- if ( !t1->memBlock ) {
- mmFreeMem( t0->memBlock );
- t0->memBlock = NULL;
- }
- }
- /* Try AGP before kicking anything out of local mem */
- if ( (!t0->memBlock || !t1->memBlock) && heap == MACH64_CARD_HEAP ) {
- t0->memBlock = mmAllocMem( mmesa->texHeap[MACH64_AGP_HEAP], t0->size, 6, 0 );
- if ( t0->memBlock ) {
- t1->memBlock = mmAllocMem( mmesa->texHeap[MACH64_AGP_HEAP], t1->size, 6, 0 );
- if ( !t1->memBlock ) {
- mmFreeMem( t0->memBlock );
- t0->memBlock = NULL;
- }
- }
-
- if ( t0->memBlock && t1->memBlock )
- heap = t0->heap = t1->heap = MACH64_AGP_HEAP;
- }
-
- /* Kick out textures until the requested texture fits */
- while ( !t0->memBlock || !t1->memBlock ) {
- if ( mmesa->TexObjList[heap].prev->bound ) {
- fprintf( stderr,
- "%s: ran into bound texture\n", __FUNCTION__ );
- return;
- }
- if ( mmesa->TexObjList[heap].prev == &mmesa->TexObjList[heap] ) {
- if ( mmesa->mach64Screen->IsPCI ) {
- fprintf( stderr, "%s: upload texture failure on local "
- "texture heaps, tex0 sz=%d tex1 sz=%d\n", __FUNCTION__,
- t0->size, t1->size );
- return;
- } else if ( heap == MACH64_CARD_HEAP ) {
- /* If only one allocation succeeded, start over again in AGP */
- if (t0->memBlock) {
- mmFreeMem( t0->memBlock );
- t0->memBlock = NULL;
- }
- if (t1->memBlock) {
- mmFreeMem( t1->memBlock );
- t1->memBlock = NULL;
- }
- heap = t0->heap = t1->heap = MACH64_AGP_HEAP;
- continue;
- } else {
- int i;
- fprintf( stderr, "%s: upload texture failure on %s"
- "AGP texture heaps, tex0 sz=%d tex1 sz=%d\n", __FUNCTION__,
- mmesa->firstTexHeap == MACH64_CARD_HEAP ? "both local and " : "",
- t0->size, t1->size );
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- mach64PrintLocalLRU( mmesa, i );
- mmDumpMemInfo( mmesa->texHeap[i] );
- }
- exit(-1);
- return;
- }
- }
-
- mach64SwapOutTexObj( mmesa, mmesa->TexObjList[heap].prev );
-
- if (!t0->memBlock)
- t0->memBlock = mmAllocMem( mmesa->texHeap[heap], t0->size, 6, 0 );
- if (!t1->memBlock)
- t1->memBlock = mmAllocMem( mmesa->texHeap[heap], t1->size, 6, 0 );
- }
-
- /* Set the base offset of the texture image */
- t0->offset = mmesa->mach64Screen->texOffset[heap] + t0->memBlock->ofs;
- t1->offset = mmesa->mach64Screen->texOffset[heap] + t1->memBlock->ofs;
-
- /* Force loading the new state into the hardware */
- mmesa->dirty |= (MACH64_UPLOAD_SCALE_3D_CNTL |
- MACH64_UPLOAD_TEXTURE);
- }
-
- /* Let the world know we've used this memory recently */
- mach64UpdateTexLRU( mmesa, t0 );
- mach64UpdateTexLRU( mmesa, t1 );
-
- /* Upload any images that are new */
- if ( t0->dirty ) {
- if (t0->heap == MACH64_AGP_HEAP) {
- /* Need to make sure any vertex buffers in the queue complete */
- mach64WaitForIdleLocked( mmesa );
- mach64UploadAGPSubImage( mmesa, t0, t0->tObj->BaseLevel, 0, 0,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Width,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Height );
- } else {
- mach64UploadLocalSubImage( mmesa, t0, t0->tObj->BaseLevel, 0, 0,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Width,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Height );
- }
- mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH;
- }
- if ( t1->dirty ) {
- if (t1->heap == MACH64_AGP_HEAP) {
- /* Need to make sure any vertex buffers in the queue complete */
- mach64WaitForIdleLocked( mmesa );
- mach64UploadAGPSubImage( mmesa, t1, t1->tObj->BaseLevel, 0, 0,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Width,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Height );
- } else {
- mach64UploadLocalSubImage( mmesa, t1, t1->tObj->BaseLevel, 0, 0,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Width,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Height );
- }
-
- mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH;
- }
-
- mmesa->dirty |= MACH64_UPLOAD_TEXTURE;
-
- t0->dirty = 0;
- t1->dirty = 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texstate.c
deleted file mode 100644
index ada4b056f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_texstate.c
+++ /dev/null
@@ -1,558 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-
-#include "mach64_context.h"
-#include "mach64_ioctl.h"
-#include "mach64_state.h"
-#include "mach64_vb.h"
-#include "mach64_tris.h"
-#include "mach64_tex.h"
-
-static void mach64SetTexImages( mach64ContextPtr mmesa,
- const struct gl_texture_object *tObj )
-{
- mach64TexObjPtr t = (mach64TexObjPtr) tObj->DriverData;
- struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
-#if 0
- int log2Pitch, log2Height, log2Size, log2MinSize;
- int i;
- GLint firstLevel, lastLevel;
-#endif
- int totalSize;
-
- assert(t);
- assert(baseImage);
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API )
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, tObj );
-
- switch (baseImage->TexFormat->MesaFormat) {
- case MESA_FORMAT_ARGB8888:
- t->textureFormat = MACH64_DATATYPE_ARGB8888;
- break;
- case MESA_FORMAT_ARGB4444:
- t->textureFormat = MACH64_DATATYPE_ARGB4444;
- break;
- case MESA_FORMAT_RGB565:
- t->textureFormat = MACH64_DATATYPE_RGB565;
- break;
- case MESA_FORMAT_ARGB1555:
- t->textureFormat = MACH64_DATATYPE_ARGB1555;
- break;
- case MESA_FORMAT_RGB332:
- t->textureFormat = MACH64_DATATYPE_RGB332;
- break;
- case MESA_FORMAT_RGB888:
- t->textureFormat = MACH64_DATATYPE_RGB8;
- break;
- case MESA_FORMAT_CI8:
- t->textureFormat = MACH64_DATATYPE_CI8;
- break;
- case MESA_FORMAT_YCBCR:
- t->textureFormat = MACH64_DATATYPE_YVYU422;
- break;
- case MESA_FORMAT_YCBCR_REV:
- t->textureFormat = MACH64_DATATYPE_VYUY422;
- break;
- default:
- _mesa_problem(mmesa->glCtx, "Bad texture format in %s", __FUNCTION__);
- };
-
-#if 0
- /* Compute which mipmap levels we really want to send 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.
- * Yes, this looks overly complicated, but it's all needed.
- */
- firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5);
- firstLevel = MAX2(firstLevel, tObj->BaseLevel);
- lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5);
- lastLevel = MAX2(lastLevel, tObj->BaseLevel);
- lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2);
- lastLevel = MIN2(lastLevel, tObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
-
- log2Pitch = tObj->Image[firstLevel]->WidthLog2;
- log2Height = tObj->Image[firstLevel]->HeightLog2;
- log2Size = MAX2(log2Pitch, log2Height);
- log2MinSize = log2Size;
-
- t->dirty = 0;
- totalSize = 0;
- for ( i = firstLevel; i <= lastLevel; i++ ) {
- const struct gl_texture_image *texImage;
-
- texImage = tObj->Image[i];
- if ( !texImage || !texImage->Data ) {
- lastLevel = i - 1;
- break;
- }
-
- log2MinSize = texImage->MaxLog2;
-
- t->image[i - firstLevel].offset = totalSize;
- t->image[i - firstLevel].width = tObj->Image[i]->Width;
- t->image[i - firstLevel].height = tObj->Image[i]->Height;
-
- t->dirty |= (1 << i);
-
- totalSize += (tObj->Image[i]->Height *
- tObj->Image[i]->Width *
- tObj->Image[i]->TexFormat->TexelBytes);
-
- /* Offsets must be 32-byte aligned for host data blits and tiling */
- totalSize = (totalSize + 31) & ~31;
- }
-
- t->totalSize = totalSize;
- t->firstLevel = firstLevel;
- t->lastLevel = lastLevel;
-
- /* Set the texture format */
- t->setup.tex_cntl &= ~(0xf << 16);
- t->setup.tex_cntl |= t->textureFormat;
-
- t->setup.tex_combine_cntl = 0x00000000; /* XXX is this right? */
-
- t->setup.tex_size_pitch = ((log2Pitch << R128_TEX_PITCH_SHIFT) |
- (log2Size << R128_TEX_SIZE_SHIFT) |
- (log2Height << R128_TEX_HEIGHT_SHIFT) |
- (log2MinSize << R128_TEX_MIN_SIZE_SHIFT));
-
- for ( i = 0 ; i < R128_MAX_TEXTURE_LEVELS ; i++ ) {
- t->setup.tex_offset[i] = 0x00000000;
- }
-
- if (firstLevel == lastLevel)
- t->setup.tex_cntl |= R128_MIP_MAP_DISABLE;
- else
- t->setup.tex_cntl &= ~R128_MIP_MAP_DISABLE;
-
-#else
- if ( ( baseImage->Format == GL_RGBA ) ||
- ( baseImage->Format == GL_ALPHA ) ||
- ( baseImage->Format == GL_LUMINANCE_ALPHA ) ) {
- t->hasAlpha = 1;
- } else {
- t->hasAlpha = 0;
- }
-
- totalSize = ( baseImage->Width * baseImage->Height *
- baseImage->TexFormat->TexelBytes );
- totalSize = (totalSize + 31) & ~31;
- t->size = totalSize;
- t->widthLog2 = baseImage->WidthLog2;
- t->heightLog2 = baseImage->HeightLog2;
- t->maxLog2 = baseImage->MaxLog2;
-
-#endif
-}
-
-static void mach64UpdateTextureEnv( GLcontext *ctx, int unit )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLint source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
- GLuint s = mmesa->setup.scale_3d_cntl;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %d )\n",
- __FUNCTION__, ctx, unit );
- }
-
-/* REPLACE MODULATE DECAL GL_BLEND
- *
- * ALPHA C = Cf C = Cf undef C = Cf
- * A = At A = AfAt A = AfAt
- *
- * LUMINANCE C = Ct C = CfCt undef C = Cf(1-Ct)+CcCt
- * A = Af A = Af A = Af
- *
- * LUMINANCE_ALPHA C = Ct C = CfCt undef C = Cf(1-Ct)+CcCt
- * A = At A = AfAt A = AfAt
- *
- * INTENSITY C = Ct C = CfCt undef C = Cf(1-Ct)+CcCt
- * A = At A = AfAt A = Af(1-At)+AcAt
- *
- * RGB C = Ct C = CfCt C = Ct C = Cf(1-Ct)+CcCt
- * A = Af A = Af A = Af A = Af
- *
- * RGBA C = Ct C = CfCt C = Cf(1-At)+CtAt C = Cf(1-Ct)+CcCt
- * A = At A = AfAt A = Af A = AfAt
- */
-
-
- if ( unit == 0 ) {
- s &= ~MACH64_TEX_LIGHT_FCN_MASK;
-
- /* Set the texture environment state
- * Need to verify these are working correctly, but the
- * texenv Mesa demo seems to work.
- */
- switch ( texUnit->EnvMode ) {
- case GL_REPLACE:
- switch ( format ) {
- case GL_ALPHA:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- /* Not compliant - can't get At */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- default:
- s |= MACH64_TEX_LIGHT_FCN_REPLACE;
- }
- break;
- case GL_MODULATE:
- switch ( format ) {
- case GL_ALPHA:
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- case GL_RGB:
- case GL_LUMINANCE:
- /* These should be compliant */
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- case GL_RGBA:
- /* Should fallback when blending enabled for complete compliance */
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- default:
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- }
- break;
- case GL_DECAL:
- switch ( format ) {
- case GL_RGBA:
- s |= MACH64_TEX_LIGHT_FCN_ALPHA_DECAL;
- break;
- case GL_RGB:
- s |= MACH64_TEX_LIGHT_FCN_REPLACE;
- break;
- case GL_ALPHA:
- case GL_LUMINANCE_ALPHA:
- /* undefined - disable texturing, pass fragment unmodified */
- /* Also, pass fragment alpha instead of texture alpha */
- s &= ~MACH64_TEX_MAP_AEN;
- s |= MACH64_TEXTURE_DISABLE;
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- case GL_LUMINANCE:
- case GL_INTENSITY:
- /* undefined - disable texturing, pass fragment unmodified */
- s |= MACH64_TEXTURE_DISABLE;
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- default:
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- }
- break;
- case GL_BLEND:
- /* GL_BLEND not supported by RagePRO, use software */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- case GL_ADD:
- case GL_COMBINE:
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- break;
- default:
- s |= MACH64_TEX_LIGHT_FCN_MODULATE;
- }
-
- if ( mmesa->setup.scale_3d_cntl != s ) {
- mmesa->setup.scale_3d_cntl = s;
- mmesa->dirty |= MACH64_UPLOAD_SCALE_3D_CNTL;
- }
-
- } else {
- /* blend = 0, modulate = 1 - initialize to blend */
- mmesa->setup.tex_cntl &= ~MACH64_COMP_COMBINE_MODULATE;
- /* Set the texture composite function for multitexturing*/
- switch ( texUnit->EnvMode ) {
- case GL_BLEND:
- /* GL_BLEND not supported by RagePRO, use software */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- break;
- case GL_MODULATE:
- /* Should fallback when blending enabled for complete compliance */
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- break;
- case GL_REPLACE:
- switch ( format ) {
- case GL_ALPHA:
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- break;
- default: /* not supported by RagePRO */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- }
- break;
- case GL_DECAL:
- switch ( format ) {
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- /* undefined, disable compositing and pass fragment unmodified */
- mmesa->setup.tex_cntl &= ~MACH64_TEXTURE_COMPOSITE;
- break;
- default: /* not supported by RagePRO */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- }
- break;
- case GL_ADD:
- case GL_COMBINE:
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- break;
- default:
- mmesa->setup.tex_cntl |= MACH64_COMP_COMBINE_MODULATE;
- }
- }
-}
-
-
-static void mach64UpdateTextureUnit( GLcontext *ctx, int unit )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = ctx->Texture.Unit[source]._Current;
- mach64TexObjPtr t = tObj->DriverData;
- GLuint d = mmesa->setup.dp_pix_width;
- GLuint s = mmesa->setup.scale_3d_cntl;
-
- assert(unit == 0 || unit == 1); /* only two tex units */
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %d ) enabled=0x%x 0x%x\n",
- __FUNCTION__, ctx, unit, ctx->Texture.Unit[0]._ReallyEnabled,
- ctx->Texture.Unit[1]._ReallyEnabled);
- }
-
- if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) {
-
- assert(t); /* should have driver tex data by now */
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- return;
- }
-
- /* Upload teximages */
- if (t->dirty) {
- mach64SetTexImages( mmesa, tObj );
- mmesa->dirty |= (MACH64_UPLOAD_TEX0IMAGE << unit);
- }
-
- /* Bind to the given texture unit */
- mmesa->CurrentTexObj[unit] = t;
- t->bound |= (1 << unit);
-
- if ( t->memBlock )
- mach64UpdateTexLRU( mmesa, t );
-
- /* register setup */
- if ( unit == 0 ) {
- d &= ~MACH64_SCALE_PIX_WIDTH_MASK;
- d |= (t->textureFormat << 28);
-
- s &= ~(MACH64_TEXTURE_DISABLE |
- MACH64_TEX_CACHE_SPLIT |
- MACH64_TEX_BLEND_FCN_MASK |
- MACH64_TEX_MAP_AEN);
-
- if ( mmesa->multitex ) {
- s |= MACH64_TEX_BLEND_FCN_TRILINEAR | MACH64_TEX_CACHE_SPLIT;
- } else if ( t->BilinearMin ) {
- s |= MACH64_TEX_BLEND_FCN_LINEAR;
- } else {
- s |= MACH64_TEX_BLEND_FCN_NEAREST;
- }
- if ( t->BilinearMag ) {
- s |= MACH64_BILINEAR_TEX_EN;
- } else {
- s &= ~MACH64_BILINEAR_TEX_EN;
- }
-
- if ( t->hasAlpha ) {
- s |= MACH64_TEX_MAP_AEN;
- }
-
- mmesa->setup.tex_cntl &= ~(MACH64_TEXTURE_CLAMP_S |
- MACH64_TEXTURE_CLAMP_T |
- MACH64_SECONDARY_STW);
-
- if ( t->ClampS ) {
- mmesa->setup.tex_cntl |= MACH64_TEXTURE_CLAMP_S;
- }
- if ( t->ClampT ) {
- mmesa->setup.tex_cntl |= MACH64_TEXTURE_CLAMP_T;
- }
-
- mmesa->setup.tex_size_pitch |= ((t->widthLog2 << 0) |
- (t->maxLog2 << 4) |
- (t->heightLog2 << 8));
- } else {
-
- /* Enable texture mapping mode */
- s &= ~MACH64_TEXTURE_DISABLE;
-
- d &= ~MACH64_COMPOSITE_PIX_WIDTH_MASK;
- d |= (t->textureFormat << 4);
-
- mmesa->setup.tex_cntl &= ~(MACH64_COMP_ALPHA |
- MACH64_SEC_TEX_CLAMP_S |
- MACH64_SEC_TEX_CLAMP_T);
- mmesa->setup.tex_cntl |= (MACH64_TEXTURE_COMPOSITE |
- MACH64_SECONDARY_STW);
-
- if ( t->BilinearMin ) {
- mmesa->setup.tex_cntl |= MACH64_COMP_BLEND_BILINEAR;
- } else {
- mmesa->setup.tex_cntl &= ~MACH64_COMP_BLEND_BILINEAR;
- }
- if ( t->BilinearMag ) {
- mmesa->setup.tex_cntl |= MACH64_COMP_FILTER_BILINEAR;
- } else {
- mmesa->setup.tex_cntl &= ~MACH64_COMP_FILTER_BILINEAR;
- }
-
- if ( t->hasAlpha ) {
- mmesa->setup.tex_cntl |= MACH64_COMP_ALPHA;
- }
- if ( t->ClampS ) {
- mmesa->setup.tex_cntl |= MACH64_SEC_TEX_CLAMP_S;
- }
- if ( t->ClampT ) {
- mmesa->setup.tex_cntl |= MACH64_SEC_TEX_CLAMP_T;
- }
-
- mmesa->setup.tex_size_pitch |= ((t->widthLog2 << 16) |
- (t->maxLog2 << 20) |
- (t->heightLog2 << 24));
- }
-
- if ( mmesa->setup.scale_3d_cntl != s ) {
- mmesa->setup.scale_3d_cntl = s;
- mmesa->dirty |= MACH64_UPLOAD_SCALE_3D_CNTL;
- }
-
- if ( mmesa->setup.dp_pix_width != d ) {
- mmesa->setup.dp_pix_width = d;
- mmesa->dirty |= MACH64_UPLOAD_DP_PIX_WIDTH;
- }
- }
- else if (texUnit->_ReallyEnabled) {
- /* 3D or cube map texture enabled - fallback */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_TRUE );
- }
- else {
- /* texture unit disabled */
- }
-}
-
-
-/* Update the hardware texture state */
-void mach64UpdateTextureState( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p ) en=0x%x 0x%x\n",
- __FUNCTION__, ctx, ctx->Texture.Unit[0]._ReallyEnabled,
- ctx->Texture.Unit[1]._ReallyEnabled);
- }
-
- /* Clear any texturing fallbacks */
- FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_FALSE );
-
- /* Unbind any currently bound textures */
- if ( mmesa->CurrentTexObj[0] ) mmesa->CurrentTexObj[0]->bound = 0;
- if ( mmesa->CurrentTexObj[1] ) mmesa->CurrentTexObj[1]->bound = 0;
- mmesa->CurrentTexObj[0] = NULL;
- mmesa->CurrentTexObj[1] = NULL;
-
- /* Disable all texturing until it is known to be good */
- mmesa->setup.scale_3d_cntl |= MACH64_TEXTURE_DISABLE;
- mmesa->setup.scale_3d_cntl &= ~MACH64_TEX_MAP_AEN;
- mmesa->setup.tex_cntl &= ~MACH64_TEXTURE_COMPOSITE;
-
- mmesa->setup.tex_size_pitch = 0x00000000;
-
- mmesa->tmu_source[0] = 0;
- mmesa->tmu_source[1] = 1;
- mmesa->multitex = 0;
-
- if (ctx->Texture._EnabledUnits & 0x2) {
- /* unit 1 enabled */
- if (ctx->Texture._EnabledUnits & 0x1) {
- /* units 0 and 1 enabled */
- mmesa->multitex = 1;
- mach64UpdateTextureUnit( ctx, 0 );
- mach64UpdateTextureEnv( ctx, 0 );
- mach64UpdateTextureUnit( ctx, 1 );
- mach64UpdateTextureEnv( ctx, 1 );
- } else {
- mmesa->tmu_source[0] = 1;
- mmesa->tmu_source[1] = 0;
- mach64UpdateTextureUnit( ctx, 0 );
- mach64UpdateTextureEnv( ctx, 0 );
- }
- } else if (ctx->Texture._EnabledUnits & 0x1) {
- /* only unit 0 enabled */
- mach64UpdateTextureUnit( ctx, 0 );
- mach64UpdateTextureEnv( ctx, 0 );
- }
-
- mmesa->dirty |= (MACH64_UPLOAD_SCALE_3D_CNTL |
- MACH64_UPLOAD_TEXTURE);
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.c
deleted file mode 100644
index 4a0044be8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.c
+++ /dev/null
@@ -1,1921 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "mach64_tris.h"
-#include "mach64_state.h"
-#include "mach64_context.h"
-#include "mach64_vb.h"
-#include "mach64_ioctl.h"
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- MACH64_PRIM_POINTS,
- MACH64_PRIM_LINES,
- MACH64_PRIM_LINE_LOOP,
- MACH64_PRIM_LINE_STRIP,
- MACH64_PRIM_TRIANGLES,
- MACH64_PRIM_TRIANGLE_STRIP,
- MACH64_PRIM_TRIANGLE_FAN,
- MACH64_PRIM_QUADS,
- MACH64_PRIM_QUAD_STRIP,
- MACH64_PRIM_POLYGON,
-};
-
-static void mach64RasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void mach64RenderPrimitive( GLcontext *ctx, GLenum prim );
-
-
-/* FIXME: Remove this when native template is finished. */
-#define MACH64_PRINT_BUFFER 0
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#if defined(USE_X86_ASM)
-#define DO_COPY_VERTEX( vb, vertsize, v, n, m ) \
-do { \
- register const CARD32 *__p __asm__( "esi" ) = (CARD32 *)v + 10 - vertsize; \
- register int __s __asm__( "ecx" ) = vertsize; \
- if ( vertsize > 7 ) { \
- *vb++ = (2 << 16) | ADRINDEX( MACH64_VERTEX_##n##_SECONDARY_S ); \
- __asm__ __volatile__( "movsl ; movsl ; movsl" \
- : "=D" (vb), "=S" (__p) \
- : "0" (vb), "1" (__p) ); \
- __s -= 3; \
- } \
- *vb++ = ((__s - 1 + m) << 16) | \
- (ADRINDEX( MACH64_VERTEX_##n##_X_Y ) - (__s - 1) ); \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (__s), "=D" (vb), "=S" (__p) \
- : "0" (__s), "1" (vb), "2" (__p) ); \
-} while (0)
-#else
-#define DO_COPY_VERTEX( vb, vertsize, v, n, m ) \
-do { \
- CARD32 *__p = (CARD32 *)v + 10 - vertsize; \
- int __s = vertsize; \
- if ( vertsize > 7 ) { \
- LE32_OUT( vb++, (2 << 16) | \
- ADRINDEX( MACH64_VERTEX_##n##_SECONDARY_S ) ); \
- *vb++ = *__p++; \
- *vb++ = *__p++; \
- *vb++ = *__p++; \
- __s -= 3; \
- } \
- LE32_OUT( vb++, ((__s - 1 + m) << 16) | \
- (ADRINDEX( MACH64_VERTEX_##n##_X_Y ) - (__s - 1)) ); \
- while ( __s-- ) { \
- *vb++ = *__p++; \
- } \
-} while (0)
-#endif
-
-#define COPY_VERTEX( vb, vertsize, v, n ) DO_COPY_VERTEX( vb, vertsize, v, n, 0 )
-#define COPY_VERTEX_OOA( vb, vertsize, v, n ) DO_COPY_VERTEX( vb, vertsize, v, n, 1 )
-
-
-static __inline void mach64_draw_quad( mach64ContextPtr mmesa,
- mach64VertexPtr v0,
- mach64VertexPtr v1,
- mach64VertexPtr v2,
- mach64VertexPtr v3 )
-{
-#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
- const GLuint vertsize = mmesa->vertex_size;
- GLint a;
- GLfloat ooa;
- GLuint xy;
- const GLuint xyoffset = 9;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz = (vertsize + (vertsize > 7 ? 2 : 1)) * 4 + 2;
- CARD32 *vb, *vbchk;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1:\n");
- mach64_print_vertex( ctx, v0 );
- fprintf(stderr,"Vertex 2:\n");
- mach64_print_vertex( ctx, v1 );
- fprintf(stderr,"Vertex 3:\n");
- mach64_print_vertex( ctx, v2 );
- fprintf(stderr,"Vertex 4:\n");
- mach64_print_vertex( ctx, v3 );
- }
-
- xy = LE32_IN( &v0->ui[xyoffset] );
- xx[0] = (GLshort)( xy >> 16 );
- yy[0] = (GLshort)( xy & 0xffff );
-
- xy = LE32_IN( &v1->ui[xyoffset] );
- xx[1] = (GLshort)( xy >> 16 );
- yy[1] = (GLshort)( xy & 0xffff );
-
- xy = LE32_IN( &v3->ui[xyoffset] );
- xx[2] = (GLshort)( xy >> 16 );
- yy[2] = (GLshort)( xy & 0xffff );
-
- a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]);
-
- if ( (mmesa->backface_sign &&
- ((a < 0 && !signbit( mmesa->backface_sign )) ||
- (a > 0 && signbit( mmesa->backface_sign )))) ) {
- /* cull quad */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Quad culled\n");
- return;
- }
-
- ooa = 16.0 / a;
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) );
- vbchk = vb + vbsiz;
-
- COPY_VERTEX( vb, vertsize, v0, 1 );
- COPY_VERTEX( vb, vertsize, v1, 2 );
- COPY_VERTEX_OOA( vb, vertsize, v3, 3 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- xy = LE32_IN( &v2->ui[xyoffset] );
- xx[0] = (GLshort)( xy >> 16 );
- yy[0] = (GLshort)( xy & 0xffff );
-
- a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]);
-
- ooa = 16.0 / a;
-
- COPY_VERTEX_OOA( vb, vertsize, v2, 1 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- assert( vb == vbchk );
-
-#if MACH64_PRINT_BUFFER
- {
- int i;
- fprintf(stderr, "quad:\n");
- for (i = 0; i < vbsiz; i++)
- fprintf(stderr, " %08lx\n", *(vb - vbsiz + i));
- fprintf(stderr, "\n");
- }
-#endif
-#else
- GLuint vertsize = mmesa->vertex_size;
- GLint coloridx;
- GLfloat ooa;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz =
- ((
- 1 +
- (vertsize > 6 ? 2 : 0) +
- (vertsize > 4 ? 2 : 0) +
- 3 +
- (mmesa->multitex ? 4 : 0)
- ) * 4 + 4);
- CARD32 *vb;
- unsigned vbidx = 0;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v0->v.x, v0->v.y, v0->v.z, v0->v.w, v0->v.u0, v0->v.v0, v0->v.u1, v0->v.v1);
- fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v1->v.x, v1->v.y, v1->v.z, v1->v.w, v1->v.u0, v1->v.v0, v1->v.u1, v1->v.v1);
- fprintf(stderr,"Vertex 3: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v2->v.x, v2->v.y, v2->v.z, v2->v.w, v2->v.u0, v2->v.v0, v2->v.u1, v2->v.v1);
- fprintf(stderr,"Vertex 4: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v3->v.x, v3->v.y, v3->v.z, v3->v.w, v3->v.u0, v3->v.v0, v3->v.u1, v3->v.v1);
- }
-
-#if MACH64_CLIENT_STATE_EMITS
- /* Enable for interleaved client-side state emits */
- LOCK_HARDWARE( mmesa );
- if ( mmesa->dirty ) {
- mach64EmitHwStateLocked( mmesa );
- }
- if ( mmesa->sarea->dirty ) {
- mach64UploadHwStateLocked( mmesa );
- }
- UNLOCK_HARDWARE( mmesa );
-#endif
-
- xx[0] = (GLint)(v0->v.x * 4);
- yy[0] = (GLint)(v0->v.y * 4);
-
- xx[1] = (GLint)(v1->v.x * 4);
- yy[1] = (GLint)(v1->v.y * 4);
-
- xx[2] = (GLint)(v3->v.x * 4);
- yy[2] = (GLint)(v3->v.y * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
-
- if ( ooa * mmesa->backface_sign < 0 ) {
- /* cull quad */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Quad culled\n");
- return;
- }
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 );
-
- ooa = 1.0 / ooa;
-
- coloridx = (vertsize > 4) ? 4: 3;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v0->ui[8] ); /* MACH64_VERTEX_1_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v0->ui[9] ); /* MACH64_VERTEX_1_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_SECONDARY_W */
- }
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_2_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_2_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_2_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v1->ui[6] ); /* MACH64_VERTEX_2_S */
- LE32_OUT( &vb[vbidx++], v1->ui[7] ); /* MACH64_VERTEX_2_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v1->ui[3] ); /* MACH64_VERTEX_2_W */
- LE32_OUT( &vb[vbidx++], v1->ui[5] ); /* MACH64_VERTEX_2_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v1->v.z) << 15) ); /* MACH64_VERTEX_2_Z */
- vb[vbidx++] = v1->ui[coloridx]; /* MACH64_VERTEX_2_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[1] << 16) | (yy[1] & 0xffff) ); /* MACH64_VERTEX_2_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_2_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v1->ui[8] ); /* MACH64_VERTEX_2_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v1->ui[9] ); /* MACH64_VERTEX_2_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v1->ui[3] ); /* MACH64_VERTEX_2_SECONDARY_W */
- }
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_3_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_3_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_3_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v3->ui[6] ); /* MACH64_VERTEX_3_S */
- LE32_OUT( &vb[vbidx++], v3->ui[7] ); /* MACH64_VERTEX_3_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v3->ui[3] ); /* MACH64_VERTEX_3_W */
- LE32_OUT( &vb[vbidx++], v3->ui[5] ); /* MACH64_VERTEX_3_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v3->v.z) << 15) ); /* MACH64_VERTEX_3_Z */
- vb[vbidx++] = v3->ui[coloridx]; /* MACH64_VERTEX_3_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[2] << 16) | (yy[2] & 0xffff) ); /* MACH64_VERTEX_3_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_3_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v3->ui[8] ); /* MACH64_VERTEX_3_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v3->ui[9] ); /* MACH64_VERTEX_3_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v3->ui[3] ); /* MACH64_VERTEX_3_SECONDARY_W */
- }
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- xx[0] = (GLint)(v2->v.x * 4);
- yy[0] = (GLint)(v2->v.y * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
- ooa = 1.0 / ooa;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v2->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v2->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v2->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v2->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v2->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v2->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v2->ui[8] ); /* MACH64_VERTEX_1_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v2->ui[9] ); /* MACH64_VERTEX_1_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v2->ui[3] ); /* MACH64_VERTEX_1_SECONDARY_W */
- }
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- assert(vbsiz == vbidx);
-
-#if MACH64_PRINT_BUFFER
- {
- int i;
- fprintf(stderr, "quad:\n");
- for (i = 0; i < vbsiz; i++)
- fprintf(stderr, " %08lx\n", *(vb + i));
- fprintf(stderr, "\n");
- }
-#endif
-#endif
-}
-
-static __inline void mach64_draw_triangle( mach64ContextPtr mmesa,
- mach64VertexPtr v0,
- mach64VertexPtr v1,
- mach64VertexPtr v2 )
-{
-#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
- GLuint vertsize = mmesa->vertex_size;
- GLint a;
- GLfloat ooa;
- GLuint xy;
- const GLuint xyoffset = 9;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz = (vertsize + (vertsize > 7 ? 2 : 1)) * 3 + 1;
- CARD32 *vb, *vbchk;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1:\n");
- mach64_print_vertex( ctx, v0 );
- fprintf(stderr,"Vertex 2:\n");
- mach64_print_vertex( ctx, v1 );
- fprintf(stderr,"Vertex 3:\n");
- mach64_print_vertex( ctx, v2 );
- }
-
- xy = LE32_IN( &v0->ui[xyoffset] );
- xx[0] = (GLshort)( xy >> 16 );
- yy[0] = (GLshort)( xy & 0xffff );
-
- xy = LE32_IN( &v1->ui[xyoffset] );
- xx[1] = (GLshort)( xy >> 16 );
- yy[1] = (GLshort)( xy & 0xffff );
-
- xy = LE32_IN( &v2->ui[xyoffset] );
- xx[2] = (GLshort)( xy >> 16 );
- yy[2] = (GLshort)( xy & 0xffff );
-
- a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]);
-
- if ( mmesa->backface_sign &&
- ((a < 0 && !signbit( mmesa->backface_sign )) ||
- (a > 0 && signbit( mmesa->backface_sign ))) ) {
- /* cull triangle */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Triangle culled\n");
- return;
- }
-
- ooa = 16.0 / a;
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) );
- vbchk = vb + vbsiz;
-
- COPY_VERTEX( vb, vertsize, v0, 1 );
- COPY_VERTEX( vb, vertsize, v1, 2 );
- COPY_VERTEX_OOA( vb, vertsize, v2, 3 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- assert( vb == vbchk );
-
-#if MACH64_PRINT_BUFFER
- {
- int i;
- fprintf(stderr, "tri:\n");
- for (i = 0; i < vbsiz; i++)
- fprintf(stderr, " %08lx\n", *(vb - vbsiz + i));
- fprintf(stderr, "\n");
- }
-#endif
-#else
- GLuint vertsize = mmesa->vertex_size;
- GLint coloridx;
- GLfloat ooa;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz =
- ((
- 1 +
- (vertsize > 6 ? 2 : 0) +
- (vertsize > 4 ? 2 : 0) +
- 3 +
- (mmesa->multitex ? 4 : 0)
- ) * 3 + 2);
- CARD32 *vb;
- unsigned vbidx = 0;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v0->v.x, v0->v.y, v0->v.z, v0->v.w, v0->v.u0, v0->v.v0, v0->v.u1, v0->v.v1);
- fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v1->v.x, v1->v.y, v1->v.z, v1->v.w, v1->v.u0, v1->v.v0, v1->v.u1, v1->v.v1);
- fprintf(stderr,"Vertex 3: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n",
- v2->v.x, v2->v.y, v2->v.z, v2->v.w, v2->v.u0, v2->v.v0, v2->v.u1, v2->v.v1);
- }
-
-#if MACH64_CLIENT_STATE_EMITS
- /* Enable for interleaved client-side state emits */
- LOCK_HARDWARE( mmesa );
- if ( mmesa->dirty ) {
- mach64EmitHwStateLocked( mmesa );
- }
- if ( mmesa->sarea->dirty ) {
- mach64UploadHwStateLocked( mmesa );
- }
- UNLOCK_HARDWARE( mmesa );
-#endif
-
- xx[0] = (GLint)(v0->v.x * 4);
- yy[0] = (GLint)(v0->v.y * 4);
-
- xx[1] = (GLint)(v1->v.x * 4);
- yy[1] = (GLint)(v1->v.y * 4);
-
- xx[2] = (GLint)(v2->v.x * 4);
- yy[2] = (GLint)(v2->v.y * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
-
- if ( ooa * mmesa->backface_sign < 0 ) {
- /* cull triangle */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Triangle culled\n");
- return;
- }
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 );
-
- ooa = 1.0 / ooa;
-
- coloridx = (vertsize > 4) ? 4: 3;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v0->ui[8] ); /* MACH64_VERTEX_1_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v0->ui[9] ); /* MACH64_VERTEX_1_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_SECONDARY_W */
- }
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_2_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_2_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_2_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v1->ui[6] ); /* MACH64_VERTEX_2_S */
- LE32_OUT( &vb[vbidx++], v1->ui[7] ); /* MACH64_VERTEX_2_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v1->ui[3] ); /* MACH64_VERTEX_2_W */
- LE32_OUT( &vb[vbidx++], v1->ui[5] ); /* MACH64_VERTEX_2_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v1->v.z) << 15) ); /* MACH64_VERTEX_2_Z */
- vb[vbidx++] = v1->ui[coloridx]; /* MACH64_VERTEX_2_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[1] << 16) | (yy[1] & 0xffff) ); /* MACH64_VERTEX_2_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_2_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v1->ui[8] ); /* MACH64_VERTEX_2_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v1->ui[9] ); /* MACH64_VERTEX_2_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v1->ui[3] ); /* MACH64_VERTEX_2_SECONDARY_W */
- }
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_3_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_3_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_3_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v2->ui[6] ); /* MACH64_VERTEX_3_S */
- LE32_OUT( &vb[vbidx++], v2->ui[7] ); /* MACH64_VERTEX_3_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v2->ui[3] ); /* MACH64_VERTEX_3_W */
- LE32_OUT( &vb[vbidx++], v2->ui[5] ); /* MACH64_VERTEX_3_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v2->v.z) << 15) ); /* MACH64_VERTEX_3_Z */
- vb[vbidx++] = v2->ui[coloridx]; /* MACH64_VERTEX_3_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[2] << 16) | (yy[2] & 0xffff) ); /* MACH64_VERTEX_3_X_Y */
-
- if (mmesa->multitex) {
- /* setup for 3 sequential reg writes */
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_3_SECONDARY_S) );
- LE32_OUT( &vb[vbidx++], v2->ui[8] ); /* MACH64_VERTEX_3_SECONDARY_S */
- LE32_OUT( &vb[vbidx++], v2->ui[9] ); /* MACH64_VERTEX_3_SECONDARY_T */
- LE32_OUT( &vb[vbidx++], v2->ui[3] ); /* MACH64_VERTEX_3_SECONDARY_W */
- }
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- assert(vbsiz == vbidx);
-
-#if MACH64_PRINT_BUFFER
- {
- int i;
- fprintf(stderr, "tri:\n");
- for (i = 0; i < vbsiz; ++i)
- fprintf(stderr, " %08lx\n", *(vb + i));
- fprintf(stderr, "\n");
- }
-#endif
-#endif
-}
-
-static __inline void mach64_draw_line( mach64ContextPtr mmesa,
- mach64VertexPtr v0,
- mach64VertexPtr v1 )
-{
-#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
- const GLuint vertsize = mmesa->vertex_size;
- GLint width = (GLint)(mmesa->glCtx->Line._Width * 2.0); /* 2 fractional bits for hardware */
- GLfloat ooa;
- GLuint *pxy0, *pxy1;
- GLuint xy0old, xy0, xy1old, xy1;
- const GLuint xyoffset = 9;
- GLint x0, y0, x1, y1;
- GLint dx, dy, ix, iy;
- unsigned vbsiz = (vertsize + (vertsize > 7 ? 2 : 1)) * 4 + 2;
- CARD32 *vb, *vbchk;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1:\n");
- mach64_print_vertex( ctx, v0 );
- fprintf(stderr,"Vertex 2:\n");
- mach64_print_vertex( ctx, v1 );
- }
-
- if( !width )
- width = 1; /* round to the nearest supported width */
-
- pxy0 = &v0->ui[xyoffset];
- xy0old = *pxy0;
- xy0 = LE32_IN( &xy0old );
- x0 = (GLshort)( xy0 >> 16 );
- y0 = (GLshort)( xy0 & 0xffff );
-
- pxy1 = &v1->ui[xyoffset];
- xy1old = *pxy1;
- xy1 = LE32_IN( &xy1old );
- x1 = (GLshort)( xy1 >> 16 );
- y1 = (GLshort)( xy1 & 0xffff );
-
- if ( (dx = x1 - x0) < 0 ) {
- dx = -dx;
- }
- if ( (dy = y1 - y0) < 0 ) {
- dy = -dy;
- }
-
- /* adjust vertices depending on line direction */
- if ( dx > dy ) {
- ix = 0;
- iy = width;
- ooa = 8.0 / ((x1 - x0) * width);
- } else {
- ix = width;
- iy = 0;
- ooa = 8.0 / ((y0 - y1) * width);
- }
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) );
- vbchk = vb + vbsiz;
-
- LE32_OUT( pxy0, (( x0 - ix ) << 16) | (( y0 - iy ) & 0xffff) );
- COPY_VERTEX( vb, vertsize, v0, 1 );
- LE32_OUT( pxy1, (( x1 - ix ) << 16) | (( y1 - iy ) & 0xffff) );
- COPY_VERTEX( vb, vertsize, v1, 2 );
- LE32_OUT( pxy0, (( x0 + ix ) << 16) | (( y0 + iy ) & 0xffff) );
- COPY_VERTEX_OOA( vb, vertsize, v0, 3 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- ooa = -ooa;
-
- LE32_OUT( pxy1, (( x1 + ix ) << 16) | (( y1 + iy ) & 0xffff) );
- COPY_VERTEX_OOA( vb, vertsize, v1, 1 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- *pxy0 = xy0old;
- *pxy1 = xy1old;
-#else /* !MACH64_NATIVE_VTXFMT */
- GLuint vertsize = mmesa->vertex_size;
- GLint coloridx;
- float width = 1.0; /* Only support 1 pix lines now */
- GLfloat ooa;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz =
- ((
- 1 +
- (vertsize > 6 ? 2 : 0) +
- (vertsize > 4 ? 2 : 0) +
- 3 +
- (mmesa->multitex ? 4 : 0)
- ) * 4 + 4);
- CARD32 *vb;
- unsigned vbidx = 0;
-
- GLfloat hw, dx, dy, ix, iy;
- GLfloat x0 = v0->v.x;
- GLfloat y0 = v0->v.y;
- GLfloat x1 = v1->v.x;
- GLfloat y1 = v1->v.y;
-
-#if MACH64_CLIENT_STATE_EMITS
- /* Enable for interleaved client-side state emits */
- LOCK_HARDWARE( mmesa );
- if ( mmesa->dirty ) {
- mach64EmitHwStateLocked( mmesa );
- }
- if ( mmesa->sarea->dirty ) {
- mach64UploadHwStateLocked( mmesa );
- }
- UNLOCK_HARDWARE( mmesa );
-#endif
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n",
- v0->v.x, v0->v.y, v0->v.z, v0->v.w);
- fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n",
- v1->v.x, v1->v.y, v1->v.z, v1->v.w);
- }
-
- hw = 0.5F * width;
- if (hw > 0.1F && hw < 0.5F) {
- hw = 0.5F;
- }
-
- /* adjust vertices depending on line direction */
- dx = v0->v.x - v1->v.x;
- dy = v0->v.y - v1->v.y;
- if (dx * dx > dy * dy) {
- /* X-major line */
- ix = 0.0F;
- iy = hw;
- if (x1 < x0) {
- x0 += 0.5F;
- x1 += 0.5F;
- }
- y0 -= 0.5F;
- y1 -= 0.5F;
- }
- else {
- /* Y-major line */
- ix = hw;
- iy = 0.0F;
- if (y1 > y0) {
- y0 -= 0.5F;
- y1 -= 0.5F;
- }
- x0 += 0.5F;
- x1 += 0.5F;
- }
-
- xx[0] = (GLint)((x0 - ix) * 4);
- yy[0] = (GLint)((y0 - iy) * 4);
-
- xx[1] = (GLint)((x1 - ix) * 4);
- yy[1] = (GLint)((y1 - iy) * 4);
-
- xx[2] = (GLint)((x0 + ix) * 4);
- yy[2] = (GLint)((y0 + iy) * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
-
- if ( ooa * mmesa->backface_sign < 0 ) {
- /* cull line */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Line culled\n");
- return;
- }
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 );
-
- ooa = 1.0 / ooa;
-
- coloridx = (vertsize > 4) ? 4: 3;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_2_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_2_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_2_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v1->ui[6] ); /* MACH64_VERTEX_2_S */
- LE32_OUT( &vb[vbidx++], v1->ui[7] ); /* MACH64_VERTEX_2_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v1->ui[3] ); /* MACH64_VERTEX_2_W */
- LE32_OUT( &vb[vbidx++], v1->ui[5] ); /* MACH64_VERTEX_2_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v1->v.z) << 15) ); /* MACH64_VERTEX_2_Z */
- vb[vbidx++] = v1->ui[coloridx]; /* MACH64_VERTEX_2_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[1] << 16) | (yy[1] & 0xffff) ); /* MACH64_VERTEX_2_X_Y */
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_3_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_3_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_3_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_3_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_3_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_3_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_3_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_3_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_3_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[2] << 16) | (yy[2] & 0xffff) ); /* MACH64_VERTEX_3_X_Y */
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- xx[0] = (GLint)((x1 + ix) * 4);
- yy[0] = (GLint)((y1 + iy) * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
- ooa = 1.0 / ooa;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v1->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v1->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v1->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v1->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v1->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v1->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- assert(vbsiz == vbidx);
-#endif
-}
-
-static __inline void mach64_draw_point( mach64ContextPtr mmesa,
- mach64VertexPtr v0 )
-{
-#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
- const GLuint vertsize = mmesa->vertex_size;
- GLint sz = (GLint)(mmesa->glCtx->Point._Size * 2.0); /* 2 fractional bits for hardware */
- GLfloat ooa;
- GLuint *pxy;
- GLuint xyold, xy;
- const GLuint xyoffset = 9;
- GLint x, y;
- unsigned vbsiz = (vertsize + (vertsize > 7 ? 2 : 1)) * 4 + 2;
- CARD32 *vb, *vbchk;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1:\n");
- mach64_print_vertex( ctx, v0 );
- }
-
- if( !sz )
- sz = 1; /* round to the nearest supported size */
-
- pxy = &v0->ui[xyoffset];
- xyold = *pxy;
- xy = LE32_IN( &xyold );
- x = (GLshort)( xy >> 16 );
- y = (GLshort)( xy & 0xffff );
-
- ooa = 4.0 / (sz * sz);
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) );
- vbchk = vb + vbsiz;
-
- LE32_OUT( pxy, (( x - sz ) << 16) | (( y - sz ) & 0xffff) );
- COPY_VERTEX( vb, vertsize, v0, 1 );
- LE32_OUT( pxy, (( x + sz ) << 16) | (( y - sz ) & 0xffff) );
- COPY_VERTEX( vb, vertsize, v0, 2 );
- LE32_OUT( pxy, (( x - sz ) << 16) | (( y + sz ) & 0xffff) );
- COPY_VERTEX_OOA( vb, vertsize, v0, 3 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- ooa = -ooa;
-
- LE32_OUT( pxy, (( x + sz ) << 16) | (( y + sz ) & 0xffff) );
- COPY_VERTEX_OOA( vb, vertsize, v0, 1 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- *pxy = xyold;
-#else /* !MACH64_NATIVE_VTXFMT */
- GLuint vertsize = mmesa->vertex_size;
- GLint coloridx;
- float sz = 1.0; /* Only support 1 pix points now */
- GLfloat ooa;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz =
- ((
- 1 +
- (vertsize > 6 ? 2 : 0) +
- (vertsize > 4 ? 2 : 0) +
- 3 +
- (mmesa->multitex ? 4 : 0)
- ) * 4 + 4);
- CARD32 *vb;
- unsigned vbidx = 0;
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n",
- v0->v.x, v0->v.y, v0->v.z, v0->v.w);
- }
-
-#if MACH64_CLIENT_STATE_EMITS
- /* Enable for interleaved client-side state emits */
- LOCK_HARDWARE( mmesa );
- if ( mmesa->dirty ) {
- mach64EmitHwStateLocked( mmesa );
- }
- if ( mmesa->sarea->dirty ) {
- mach64UploadHwStateLocked( mmesa );
- }
- UNLOCK_HARDWARE( mmesa );
-#endif
-
- xx[0] = (GLint)((v0->v.x - sz) * 4);
- yy[0] = (GLint)((v0->v.y - sz) * 4);
-
- xx[1] = (GLint)((v0->v.x + sz) * 4);
- yy[1] = (GLint)((v0->v.y - sz) * 4);
-
- xx[2] = (GLint)((v0->v.x - sz) * 4);
- yy[2] = (GLint)((v0->v.y + sz) * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
-
- if ( ooa * mmesa->backface_sign < 0 ) {
- /* cull quad */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Point culled\n");
- return;
- }
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 );
-
- ooa = 1.0 / ooa;
-
- coloridx = (vertsize > 4) ? 4: 3;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_2_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_2_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_2_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_2_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_2_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_2_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_2_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_2_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_2_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[1] << 16) | (yy[1] & 0xffff) ); /* MACH64_VERTEX_2_X_Y */
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_3_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_3_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_3_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_3_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_3_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_3_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_3_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_3_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_3_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[2] << 16) | (yy[2] & 0xffff) ); /* MACH64_VERTEX_3_X_Y */
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- xx[0] = (GLint)((v0->v.x + sz) * 4);
- yy[0] = (GLint)((v0->v.y + sz) * 4);
-
- ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]));
- ooa = 1.0 / ooa;
-
- /* setup for 3,5, or 7 sequential reg writes based on vertex format */
- switch (vertsize) {
- case 6:
- LE32_OUT( &vb[vbidx++], (4 << 16) | ADRINDEX(MACH64_VERTEX_1_W) );
- break;
- case 4:
- LE32_OUT( &vb[vbidx++], (2 << 16) | ADRINDEX(MACH64_VERTEX_1_Z) );
- break;
- default: /* vertsize >= 8 */
- LE32_OUT( &vb[vbidx++], (6 << 16) | ADRINDEX(MACH64_VERTEX_1_S) );
- break;
- }
- if (vertsize > 6) {
- LE32_OUT( &vb[vbidx++], v0->ui[6] ); /* MACH64_VERTEX_1_S */
- LE32_OUT( &vb[vbidx++], v0->ui[7] ); /* MACH64_VERTEX_1_T */
- }
- if (vertsize > 4) {
- LE32_OUT( &vb[vbidx++], v0->ui[3] ); /* MACH64_VERTEX_1_W */
- LE32_OUT( &vb[vbidx++], v0->ui[5] ); /* MACH64_VERTEX_1_SPEC_ARGB */
- }
- LE32_OUT( &vb[vbidx++], ((GLint)(v0->v.z) << 15) ); /* MACH64_VERTEX_1_Z */
- vb[vbidx++] = v0->ui[coloridx]; /* MACH64_VERTEX_1_ARGB */
- LE32_OUT( &vb[vbidx++], (xx[0] << 16) | (yy[0] & 0xffff) ); /* MACH64_VERTEX_1_X_Y */
-
- LE32_OUT( &vb[vbidx++], ADRINDEX(MACH64_ONE_OVER_AREA_UC) );
- LE32_OUT( &vb[vbidx++], *(GLuint *)&ooa );
-
- assert(vbsiz == vbidx);
-#endif
-}
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- mmesa->draw_tri( mmesa, a, b, c ); \
- else \
- mach64_draw_triangle( mmesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- mmesa->draw_tri( mmesa, a, b, d ); \
- mmesa->draw_tri( mmesa, b, c, d ); \
- } else \
- mach64_draw_quad( mmesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- mmesa->draw_line( mmesa, v0, v1 ); \
- else \
- mach64_draw_line( mmesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- mmesa->draw_point( mmesa, v0 ); \
- else \
- mach64_draw_point( mmesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define MACH64_OFFSET_BIT 0x01
-#define MACH64_TWOSIDE_BIT 0x02
-#define MACH64_UNFILLED_BIT 0x04
-#define MACH64_FALLBACK_BIT 0x08
-#define MACH64_MAX_TRIFUNC 0x10
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[MACH64_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & MACH64_FALLBACK_BIT)
-#define DO_OFFSET (IND & MACH64_OFFSET_BIT)
-#define DO_UNFILLED (IND & MACH64_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & MACH64_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX mach64Vertex
-#define TAB rast_tab
-
-#if MACH64_NATIVE_VTXFMT
-
-/* #define DEPTH_SCALE 65536.0 */
-#define DEPTH_SCALE 1
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) ((GLfloat)(GLshort)(LE32_IN( &(_v)->ui[xyoffset] ) & 0xffff) / 4.0)
-#define VERT_Y(_v) ((GLfloat)(GLshort)(LE32_IN( &(_v)->ui[xyoffset] ) >> 16) / 4.0)
-#define VERT_Z(_v) ((GLfloat) LE32_IN( &(_v)->ui[zoffset] ))
-#define INSANE_VERTICES
-#define VERT_SET_Z(_v,val) LE32_OUT( &(_v)->ui[zoffset], (GLuint)(val) )
-#define VERT_Z_ADD(_v,val) LE32_OUT( &(_v)->ui[zoffset], LE32_IN( &(_v)->ui[zoffset] ) + (GLuint)(val) )
-#define AREA_IS_CCW( a ) ((a) < 0)
-#define GET_VERTEX(e) (mmesa->verts + ((e) * mmesa->vertex_size * sizeof(int)))
-
-#define MACH64_COLOR( dst, src ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[0], src[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[1], src[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[2], src[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[3], src[3]); \
-} while (0)
-
-#define MACH64_SPEC( dst, src ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[0], src[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[1], src[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[2], src[0]); \
-} while (0)
-
-#define VERT_SET_RGBA( v, c ) MACH64_COLOR( v->ub4[coloroffset], c )
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-
-#define VERT_SET_SPEC( v, c ) if (havespec) MACH64_SPEC( v->ub4[specoffset], c )
-#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V( v0->ub4[specoffset], v1->ub4[specoffset] )
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[specoffset] = spec[idx]
-
-#define LOCAL_VARS(n) \
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint vertex_size = mmesa->vertex_size; \
- const GLuint xyoffset = 9; \
- const GLuint coloroffset = 8; \
- const GLuint zoffset = 7; \
- const GLuint specoffset = 6; \
- GLboolean havespec = vertex_size >= 4 ? 1 : 0; \
- (void) color; (void) spec; (void) vertex_size; \
- (void) xyoffset; (void) coloroffset; (void) zoffset; \
- (void) specoffset; (void) havespec;
-
-#else
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (mmesa->verts + ((e) * mmesa->vertex_size * sizeof(int)))
-
-#define MACH64_COLOR( dst, src ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[0], src[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[1], src[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[2], src[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[3], src[3]); \
-} while (0)
-
-#define MACH64_SPEC( dst, src ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[0], src[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[1], src[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(dst[2], src[0]); \
-} while (0)
-
-#define VERT_SET_RGBA( v, c ) MACH64_COLOR( v->ub4[coloroffset], c )
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-
-#define VERT_SET_SPEC( v, c ) if (havespec) MACH64_SPEC( v->ub4[5], c )
-#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V(v0->ub4[5], v1->ub4[5])
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
-
-#define LOCAL_VARS(n) \
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = (mmesa->vertex_size == 4 ? 3 : 4); \
- GLboolean havespec = (mmesa->vertex_size == 4 ? 0 : 1); \
- (void) color; (void) spec; (void) coloroffset; (void) havespec;
-
-#endif
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (mmesa->hw_primitive != hw_prim[x]) \
- mach64RasterPrimitive( ctx, hw_prim[x] )
-#define RENDER_PRIMITIVE mmesa->render_primitive
-#define IND MACH64_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_OFFSET_BIT|MACH64_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_OFFSET_BIT|MACH64_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_OFFSET_BIT|MACH64_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_OFFSET_BIT|MACH64_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_UNFILLED_BIT|MACH64_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_OFFSET_BIT|MACH64_UNFILLED_BIT|MACH64_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_UNFILLED_BIT|MACH64_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MACH64_TWOSIDE_BIT|MACH64_OFFSET_BIT|MACH64_UNFILLED_BIT| \
- MACH64_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-mach64_fallback_tri( mach64ContextPtr mmesa,
- mach64Vertex *v0,
- mach64Vertex *v1,
- mach64Vertex *v2 )
-{
- GLcontext *ctx = mmesa->glCtx;
- SWvertex v[3];
- mach64_translate_vertex( ctx, v0, &v[0] );
- mach64_translate_vertex( ctx, v1, &v[1] );
- mach64_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-mach64_fallback_line( mach64ContextPtr mmesa,
- mach64Vertex *v0,
- mach64Vertex *v1 )
-{
- GLcontext *ctx = mmesa->glCtx;
- SWvertex v[2];
- mach64_translate_vertex( ctx, v0, &v[0] );
- mach64_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-mach64_fallback_point( mach64ContextPtr mmesa,
- mach64Vertex *v0 )
-{
- GLcontext *ctx = mmesa->glCtx;
- SWvertex v[1];
- mach64_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define VERT(x) (mach64Vertex *)(mach64verts + ((x) * vertsize * sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- mach64_draw_point( mmesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- mach64_draw_line( mmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- mach64_draw_triangle( mmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- mach64_draw_quad( mmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) do { \
- if (0) fprintf(stderr, "%s\n", __FUNCTION__); \
- mach64RenderPrimitive( ctx, x ); \
-} while (0)
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
- const GLuint vertsize = mmesa->vertex_size; \
- const char *mach64verts = (char *)mmesa->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) mach64_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) mach64_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-static void mach64RenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint prim = mmesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-
-}
-
-static void mach64RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-#if MACH64_NATIVE_VTXFMT
-static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
- const GLuint vertsize = mmesa->vertex_size;
- GLint a;
- GLfloat ooa;
- GLuint xy;
- const GLuint xyoffset = 9;
- GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
- unsigned vbsiz = (vertsize + (vertsize > 7 ? 2 : 1)) * n + (n-2);
- CARD32 *vb, *vbchk;
- GLubyte *mach64verts = (GLubyte *)mmesa->verts;
- mach64VertexPtr v0, v1, v2;
- int i;
-
- v0 = (mach64VertexPtr)VERT(elts[1]);
- v1 = (mach64VertexPtr)VERT(elts[2]);
- v2 = (mach64VertexPtr)VERT(elts[0]);
-
- xy = LE32_IN( &v0->ui[xyoffset] );
- xx[0] = (GLshort)( xy >> 16 );
- yy[0] = (GLshort)( xy & 0xffff );
-
- xy = LE32_IN( &v1->ui[xyoffset] );
- xx[1] = (GLshort)( xy >> 16 );
- yy[1] = (GLshort)( xy & 0xffff );
-
- xy = LE32_IN( &v2->ui[xyoffset] );
- xx[2] = (GLshort)( xy >> 16 );
- yy[2] = (GLshort)( xy & 0xffff );
-
- a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]);
-
- if ( (mmesa->backface_sign &&
- ((a < 0 && !signbit( mmesa->backface_sign )) ||
- (a > 0 && signbit( mmesa->backface_sign )))) ) {
- /* cull polygon */
- if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS )
- fprintf(stderr,"Polygon culled\n");
- return;
- }
-
- ooa = 16.0 / a;
-
- vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) );
- vbchk = vb + vbsiz;
-
- COPY_VERTEX( vb, vertsize, v0, 1 );
- COPY_VERTEX( vb, vertsize, v1, 2 );
- COPY_VERTEX_OOA( vb, vertsize, v2, 3 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- i = 3;
- while (1) {
- if (i >= n)
- break;
- v0 = (mach64VertexPtr)VERT(elts[i]);
- i++;
-
- xy = LE32_IN( &v0->ui[xyoffset] );
- xx[0] = (GLshort)( xy >> 16 );
- yy[0] = (GLshort)( xy & 0xffff );
-
- a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]);
- ooa = 16.0 / a;
-
- COPY_VERTEX_OOA( vb, vertsize, v0, 1 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
-
- if (i >= n)
- break;
- v1 = (mach64VertexPtr)VERT(elts[i]);
- i++;
-
- xy = LE32_IN( &v1->ui[xyoffset] );
- xx[1] = (GLshort)( xy >> 16 );
- yy[1] = (GLshort)( xy & 0xffff );
-
- a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
- (yy[0] - yy[2]) * (xx[1] - xx[2]);
- ooa = 16.0 / a;
-
- COPY_VERTEX_OOA( vb, vertsize, v1, 2 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
- }
-
- assert( vb == vbchk );
-}
-#else
-static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
- const GLuint vertsize = mmesa->vertex_size;
- GLubyte *mach64verts = (GLubyte *)mmesa->verts;
- const GLuint *start = (const GLuint *)VERT(elts[0]);
- int i;
-
- for (i = 2 ; i < n ; i++) {
- mach64_draw_triangle( mmesa,
- VERT(elts[i-1]),
- VERT(elts[i]),
- (mach64VertexPtr) start
- );
- }
-}
-#endif /* MACH64_NATIVE_VTXFMT */
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-#define _MACH64_NEW_RENDER_STATE (_DD_NEW_POINT_SMOOTH | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_POLYGONSTIPPLE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET) \
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_SMOOTH|DD_LINE_STIPPLE)
-#define TRI_FALLBACK (DD_TRI_SMOOTH|DD_TRI_STIPPLE)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-
-static void mach64ChooseRenderState(GLcontext *ctx)
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) {
- mmesa->draw_point = mach64_draw_point;
- mmesa->draw_line = mach64_draw_line;
- mmesa->draw_tri = mach64_draw_triangle;
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= MACH64_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= MACH64_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= MACH64_UNFILLED_BIT;
- }
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)) {
- if (flags & POINT_FALLBACK) mmesa->draw_point = mach64_fallback_point;
- if (flags & LINE_FALLBACK) mmesa->draw_line = mach64_fallback_line;
- if (flags & TRI_FALLBACK) mmesa->draw_tri = mach64_fallback_tri;
- index |= MACH64_FALLBACK_BIT;
- }
- }
-
- if (index != mmesa->RenderIndex) {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = mach64_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = mach64_render_tab_elts;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.ClippedPolygon = mach64FastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = mach64RenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = mach64RenderClippedPoly;
- }
-
- mmesa->RenderIndex = index;
- }
-}
-
-/**********************************************************************/
-/* Validate state at pipeline start */
-/**********************************************************************/
-
-static void mach64RunPipeline( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- if (mmesa->new_state)
- mach64DDUpdateHWState( ctx );
-
- if (!mmesa->Fallback && mmesa->NewGLState) {
- if (mmesa->NewGLState & _MACH64_NEW_VERTEX_STATE)
- mach64ChooseVertexState( ctx );
-
- if (mmesa->NewGLState & _MACH64_NEW_RENDER_STATE)
- mach64ChooseRenderState( ctx );
-
- mmesa->NewGLState = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-/* This is called when Mesa switches between rendering triangle
- * primitives (such as GL_POLYGON, GL_QUADS, GL_TRIANGLE_STRIP, etc),
- * and lines, points and bitmaps.
- */
-
-static void mach64RasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-
- mmesa->new_state |= MACH64_NEW_CONTEXT;
- mmesa->dirty |= MACH64_UPLOAD_CONTEXT;
-
- if (mmesa->hw_primitive != hwprim) {
- FLUSH_BATCH( mmesa );
- mmesa->hw_primitive = hwprim;
- }
-}
-
-static void mach64RenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint hw = hw_prim[prim];
-
- mmesa->render_primitive = prim;
-
- if (prim >= GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- mach64RasterPrimitive( ctx, hw );
-}
-
-
-static void mach64RenderStart( GLcontext *ctx )
-{
- /* Check for projective texturing. Make sure all texcoord
- * pointers point to something. (fix in mesa?)
- */
- mach64CheckTexSizes( ctx );
-}
-
-static void mach64RenderFinish( GLcontext *ctx )
-{
- if (MACH64_CONTEXT(ctx)->RenderIndex & MACH64_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static const char * const fallbackStrings[] = {
- "Texture mode",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "glReadBuffer",
- "glEnable(GL_STENCIL) without hw stencil buffer",
- "glRenderMode(selection or feedback)",
- "glLogicOp (mode != GL_COPY)",
- "GL_SEPARATE_SPECULAR_COLOR",
- "glBlendEquation (mode != ADD)",
- "glBlendFunc",
- "Rasterization disable",
-};
-
-
-static const char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint oldfallback = mmesa->Fallback;
-
- if (mode) {
- mmesa->Fallback |= bit;
- if (oldfallback == 0) {
- FLUSH_BATCH( mmesa );
- _swsetup_Wakeup( ctx );
- mmesa->RenderIndex = ~0;
- if (MACH64_DEBUG & DEBUG_VERBOSE_FALLBACK) {
- fprintf(stderr, "Mach64 begin rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
- else {
- mmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = mach64RenderStart;
- tnl->Driver.Render.PrimitiveNotify = mach64RenderPrimitive;
- tnl->Driver.Render.Finish = mach64RenderFinish;
- tnl->Driver.Render.BuildVertices = mach64BuildVertices;
- mmesa->NewGLState |= (_MACH64_NEW_RENDER_STATE|
- _MACH64_NEW_VERTEX_STATE);
- if (MACH64_DEBUG & DEBUG_VERBOSE_FALLBACK) {
- fprintf(stderr, "Mach64 end rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
-}
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void mach64InitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = mach64RunPipeline;
- tnl->Driver.Render.Start = mach64RenderStart;
- tnl->Driver.Render.Finish = mach64RenderFinish;
- tnl->Driver.Render.PrimitiveNotify = mach64RenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = mach64BuildVertices;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.h
deleted file mode 100644
index 208703289..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_tris.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_TRIS_H__
-#define __MACH64_TRIS_H__
-
-#include "mtypes.h"
-
-extern void mach64InitTriFuncs( GLcontext *ctx );
-
-
-extern void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( mmesa, bit, mode ) mach64Fallback( mmesa->glCtx, bit, mode )
-
-
-#endif /* __MACH64_TRIS_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.c
deleted file mode 100644
index 83a5f73e6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-
-#include "mach64_context.h"
-#include "mach64_vb.h"
-#include "mach64_ioctl.h"
-#include "mach64_tris.h"
-#include "mach64_state.h"
-
-
-#define MACH64_TEX1_BIT 0x1
-#define MACH64_TEX0_BIT 0x2
-#define MACH64_RGBA_BIT 0x4
-#define MACH64_SPEC_BIT 0x8
-#define MACH64_FOG_BIT 0x10
-#define MACH64_XYZW_BIT 0x20
-#define MACH64_PTEX_BIT 0x40
-#define MACH64_MAX_SETUP 0x80
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_size;
- GLuint vertex_format;
-} setup_tab[MACH64_MAX_SETUP];
-
-#define TINY_VERTEX_FORMAT 1
-#define NOTEX_VERTEX_FORMAT 2
-#define TEX0_VERTEX_FORMAT 3
-#define TEX1_VERTEX_FORMAT 4
-#define PROJ_TEX1_VERTEX_FORMAT 0
-#define TEX2_VERTEX_FORMAT 0
-#define TEX3_VERTEX_FORMAT 0
-#define PROJ_TEX3_VERTEX_FORMAT 0
-
-#define DO_XYZW (IND & MACH64_XYZW_BIT)
-#define DO_RGBA (IND & MACH64_RGBA_BIT)
-#define DO_SPEC (IND & MACH64_SPEC_BIT)
-#define DO_FOG (IND & MACH64_FOG_BIT)
-#define DO_TEX0 (IND & MACH64_TEX0_BIT)
-#define DO_TEX1 (IND & MACH64_TEX1_BIT)
-#define DO_TEX2 0
-#define DO_TEX3 0
-#define DO_PTEX (IND & MACH64_PTEX_BIT)
-
-#define VERTEX mach64Vertex
-#define LOCALVARS mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
-#define GET_VIEWPORT_MAT() mmesa->hw_viewport
-#define GET_TEXSOURCE(n) mmesa->tmu_source[n]
-#define GET_VERTEX_FORMAT() mmesa->vertex_format
-#define GET_VERTEX_STORE() mmesa->verts
-#define GET_VERTEX_SIZE() mmesa->vertex_size * sizeof(GLuint)
-
-#define HAVE_HW_VIEWPORT 0
-#define HAVE_HW_DIVIDE 0
-#define HAVE_RGBA_COLOR 0
-#define HAVE_TINY_VERTICES 1
-#define HAVE_NOTEX_VERTICES 1
-#define HAVE_TEX0_VERTICES 1
-#define HAVE_TEX1_VERTICES 1
-#define HAVE_TEX2_VERTICES 0
-#define HAVE_TEX3_VERTICES 0
-#define HAVE_PTEX_VERTICES 0
-
-#define UNVIEWPORT_VARS \
- const GLfloat dx = - (GLfloat)mmesa->drawX - SUBPIXEL_X; \
- const GLfloat dy = (mmesa->driDrawable->h + \
- (GLfloat)mmesa->drawY + SUBPIXEL_Y); \
- const GLfloat sz = 1.0 / mmesa->depth_scale
-
-#if MACH64_NATIVE_VTXFMT
-
-#define UNVIEWPORT_X(x) ((GLfloat)(x) / 4.0) + dx
-#define UNVIEWPORT_Y(y) - ((GLfloat)(y) / 4.0) + dy
-#define UNVIEWPORT_Z(z) (GLfloat)((z) >> 15) * sz
-
-#else
-
-#define UNVIEWPORT_X(x) x + dx;
-#define UNVIEWPORT_Y(y) - y + dy;
-#define UNVIEWPORT_Z(z) z * sz;
-
-#endif
-
-#define PTEX_FALLBACK() FALLBACK(MACH64_CONTEXT(ctx), MACH64_FALLBACK_TEXTURE, 1)
-
-#define IMPORT_FLOAT_COLORS mach64_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS mach64_import_float_spec_colors
-
-#define INTERP_VERTEX setup_tab[mmesa->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[mmesa->SetupIndex].copy_pv
-
-/***********************************************************************
- * Generate pv-copying and translation functions *
- ***********************************************************************/
-
-#if MACH64_NATIVE_VTXFMT
-
-#define TAG(x) mach64_##x
-#include "mach64_native_vb.c"
-
-#else
-
-#define TAG(x) mach64_##x
-#include "tnl_dd/t_dd_vb.c"
-
-#endif
-
-/***********************************************************************
- * Generate vertex emit and interp functions *
- ***********************************************************************/
-
-
-#if MACH64_NATIVE_VTXFMT
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_wgs
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_wgt0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_TEX0_BIT|MACH64_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_wgst0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|\
- MACH64_TEX1_BIT)
-#define TAG(x) x##_wgst0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|\
- MACH64_PTEX_BIT)
-#define TAG(x) x##_wgspt0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_wgfs
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT|\
- MACH64_TEX1_BIT)
-#define TAG(x) x##_wgft0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT|\
- MACH64_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|\
- MACH64_TEX0_BIT)
-#define TAG(x) x##_wgfst0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|\
- MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_wgfst0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|\
- MACH64_TEX0_BIT|MACH64_PTEX_BIT)
-#define TAG(x) x##_wgfspt0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_t0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_FOG_BIT)
-#define TAG(x) x##_f
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_FOG_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_ft0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_FOG_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_ft0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT)
-#define TAG(x) x##_g
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_gs
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_gt0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gst0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_gst0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT)
-#define TAG(x) x##_gf
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_gfs
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_gft0t1
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gfst0
-#include "mach64_native_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|\
- MACH64_TEX1_BIT)
-#define TAG(x) x##_gfst0t1
-#include "mach64_native_vbtmp.h"
-
-#else
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_wgs
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_wgt0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_TEX0_BIT|MACH64_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_wgst0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|\
- MACH64_TEX1_BIT)
-#define TAG(x) x##_wgst0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|\
- MACH64_PTEX_BIT)
-#define TAG(x) x##_wgspt0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_wgfs
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT|\
- MACH64_TEX1_BIT)
-#define TAG(x) x##_wgft0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT|\
- MACH64_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|\
- MACH64_TEX0_BIT)
-#define TAG(x) x##_wgfst0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|\
- MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_wgfst0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_XYZW_BIT|MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|\
- MACH64_TEX0_BIT|MACH64_PTEX_BIT)
-#define TAG(x) x##_wgfspt0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_t0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_FOG_BIT)
-#define TAG(x) x##_f
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_FOG_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_ft0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_FOG_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_ft0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT)
-#define TAG(x) x##_g
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_gs
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_gt0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gst0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_gst0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT)
-#define TAG(x) x##_gf
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT)
-#define TAG(x) x##_gfs
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_TEX0_BIT|MACH64_TEX1_BIT)
-#define TAG(x) x##_gft0t1
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT)
-#define TAG(x) x##_gfst0
-#include "mach64_vbtmp.h"
-
-#define IND (MACH64_RGBA_BIT|MACH64_FOG_BIT|MACH64_SPEC_BIT|MACH64_TEX0_BIT|\
- MACH64_TEX1_BIT)
-#define TAG(x) x##_gfst0t1
-#include "mach64_vbtmp.h"
-
-#endif
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wgs();
- init_wgt0();
- init_wgt0t1();
- init_wgpt0();
- init_wgst0();
- init_wgst0t1();
- init_wgspt0();
- init_wgf();
- init_wgfs();
- init_wgft0();
- init_wgft0t1();
- init_wgfpt0();
- init_wgfst0();
- init_wgfst0t1();
- init_wgfspt0();
- init_t0();
- init_t0t1();
- init_f();
- init_ft0();
- init_ft0t1();
- init_g();
- init_gs();
- init_gt0();
- init_gt0t1();
- init_gst0();
- init_gst0t1();
- init_gf();
- init_gfs();
- init_gft0();
- init_gft0t1();
- init_gfst0();
- init_gfst0t1();
-}
-
-
-
-void mach64PrintSetupFlags( char *msg, GLuint flags )
-{
- fprintf( stderr, "%s: %d %s%s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & MACH64_XYZW_BIT) ? " xyzw," : "",
- (flags & MACH64_RGBA_BIT) ? " rgba," : "",
- (flags & MACH64_SPEC_BIT) ? " spec," : "",
- (flags & MACH64_FOG_BIT) ? " fog," : "",
- (flags & MACH64_TEX0_BIT) ? " tex-0," : "",
- (flags & MACH64_TEX1_BIT) ? " tex-1," : "",
- (flags & MACH64_PTEX_BIT) ? " ptex," : "");
-}
-
-
-
-
-void mach64CheckTexSizes( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
-
- if (!setup_tab[mmesa->SetupIndex].check_tex_sizes(ctx)) {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- /* Invalidate stored verts
- */
- mmesa->SetupNewInputs = ~0;
- mmesa->SetupIndex |= MACH64_PTEX_BIT;
-
- if (!mmesa->Fallback &&
- !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[mmesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[mmesa->SetupIndex].copy_pv;
- }
- }
-}
-
-void mach64BuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
- GLuint stride = mmesa->vertex_size * sizeof(int);
- GLubyte *v = ((GLubyte *)mmesa->verts + (start * stride));
-
- newinputs |= mmesa->SetupNewInputs;
- mmesa->SetupNewInputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= MACH64_RGBA_BIT;
-
- if (newinputs & VERT_BIT_COLOR1)
- ind |= MACH64_SPEC_BIT;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= MACH64_TEX0_BIT;
-
- if (newinputs & VERT_BIT_TEX1)
- ind |= MACH64_TEX1_BIT;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= MACH64_FOG_BIT;
-
- if (mmesa->SetupIndex & MACH64_PTEX_BIT)
- ind = ~0;
-
- ind &= mmesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
- }
- }
-}
-
-void mach64ChooseVertexState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
- GLuint ind = MACH64_XYZW_BIT|MACH64_RGBA_BIT;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- ind |= MACH64_SPEC_BIT;
-
- if (ctx->Fog.Enabled)
- ind |= MACH64_FOG_BIT;
-
- if (ctx->Texture._EnabledUnits) {
- ind |= MACH64_TEX0_BIT;
- if (ctx->Texture.Unit[0]._ReallyEnabled &&
- ctx->Texture.Unit[1]._ReallyEnabled) {
- ind |= MACH64_TEX1_BIT;
- }
- }
-
- mmesa->SetupIndex = ind;
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = mach64_interp_extras;
- tnl->Driver.Render.CopyPV = mach64_copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-
-#if 0
- if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) {
- mach64PrintSetupFlags( __FUNCTION__, ind );
- }
-#endif
-
- if (setup_tab[ind].vertex_format != mmesa->vertex_format) {
- FLUSH_BATCH(mmesa);
- mmesa->vertex_format = setup_tab[ind].vertex_format;
- mmesa->vertex_size = setup_tab[ind].vertex_size;
- }
-}
-
-
-#if 0
-void mach64_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint vertex_size = mmesa->vertex_size * 4;
- GLuint *dest = mach64AllocDmaLow( mmesa, (count-start) * vertex_size);
- setup_tab[mmesa->SetupIndex].emit( ctx, start, count, dest, vertex_size );
-}
-#endif
-
-
-void mach64InitVB( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
- }
-}
-
-
-void mach64FreeVB( GLcontext *ctx )
-{
- mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- if (mmesa->verts) {
- ALIGN_FREE(mmesa->verts);
- mmesa->verts = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.h
deleted file mode 100644
index bcc4759af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vb.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-#ifndef __MACH64_VB_H__
-#define __MACH64_VB_H__
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-#include "mach64_context.h"
-
-/* premultiply texture coordinates by homogenous coordinate */
-#define MACH64_PREMULT_TEXCOORDS
-
-#define _MACH64_NEW_VERTEX_STATE (_DD_NEW_SEPARATE_SPECULAR | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_UNFILLED | \
- _NEW_TEXTURE | \
- _NEW_FOG)
-
-
-extern void mach64CheckTexSizes( GLcontext *ctx );
-extern void mach64ChooseVertexState( GLcontext *ctx );
-
-extern void mach64BuildVertices( GLcontext *ctx, GLuint start, GLuint count,
- GLuint newinputs );
-
-extern void mach64PrintSetupFlags(char *msg, GLuint flags );
-
-extern void mach64InitVB( GLcontext *ctx );
-extern void mach64FreeVB( GLcontext *ctx );
-
-#if 0
-extern void mach64_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
-
-extern void mach64_emit_indexed_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
-#endif
-
-extern void mach64_translate_vertex( GLcontext *ctx,
- const mach64Vertex *src,
- SWvertex *dst );
-
-extern void mach64_print_vertex( GLcontext *ctx, const mach64Vertex *v );
-
-
-#endif /* __MACH64_VB_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vbtmp.h
deleted file mode 100644
index c1207cacd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/mach64_vbtmp.h
+++ /dev/null
@@ -1,770 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keithw@valinux.com>
- *
- * Modified for mach64 by:
- * Leif Delgass <ldelgass@retinalburn.net>
- * José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-
-/* Unlike the other templates here, this assumes quite a bit about the
- * underlying hardware. Specifically it assumes a d3d-like vertex
- * format, with a layout more or less constrained to look like the
- * following:
- *
- * union {
- * struct {
- * float x, y, z, w;
- * struct { char r, g, b, a; } color;
- * struct { char r, g, b, fog; } spec;
- * float u0, v0;
- * float u1, v1;
- * float u2, v2;
- * float u3, v3;
- * } v;
- * struct {
- * float x, y, z, w;
- * struct { char r, g, b, a; } color;
- * struct { char r, g, b, fog; } spec;
- * float u0, v0, q0;
- * float u1, v1, q1;
- * float u2, v2, q2;
- * float u3, v3, q3;
- * } pv;
- * struct {
- * float x, y, z;
- * struct { char r, g, b, a; } color;
- * } tv;
- * float f[16];
- * unsigned int ui[16];
- * unsigned char ub4[4][16];
- * }
- *
-
- * DO_XYZW: Emit xyz and maybe w coordinates.
- * DO_RGBA: Emit color.
- * DO_SPEC: Emit specular color.
- * DO_FOG: Emit fog coordinate in specular alpha.
- * DO_TEX0: Emit tex0 u,v coordinates.
- * DO_TEX1: Emit tex1 u,v coordinates.
- * DO_TEX2: Emit tex2 u,v coordinates.
- * DO_TEX3: Emit tex3 u,v coordinates.
- * DO_PTEX: Emit tex0,1,2,3 q coordinates where possible.
- *
- * HAVE_RGBA_COLOR: Hardware takes color in rgba order (else bgra).
- *
- * HAVE_HW_VIEWPORT: Hardware performs viewport transform.
- * HAVE_HW_DIVIDE: Hardware performs perspective divide.
- *
- * HAVE_TINY_VERTICES: Hardware understands v.tv format.
- * HAVE_PTEX_VERTICES: Hardware understands v.pv format.
- * HAVE_NOTEX_VERTICES: Hardware understands v.v format with texcount 0.
- *
- * Additionally, this template assumes it is emitting *transformed*
- * vertices; the modifications to emit untransformed vertices (ie. to
- * t&l hardware) are probably too great to cooexist with the code
- * already in this file.
- *
- * NOTE: The PTEX vertex format always includes TEX0 and TEX1, even if
- * only TEX0 is enabled, in order to maintain a vertex size which is
- * an exact number of quadwords.
- */
-
-#if (HAVE_HW_VIEWPORT)
-#define VIEWPORT_X(dst,x) dst = x
-#define VIEWPORT_Y(dst,y) dst = y
-#define VIEWPORT_Z(dst,z) dst = z
-#else
-#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12]
-#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13]
-#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14]
-#endif
-
-#if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES)
-#error "can't cope with this combination"
-#endif
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-#ifndef CHECK_HW_DIVIDE
-#define CHECK_HW_DIVIDE 1
-#endif
-
-#if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES)
-
-static void TAG(emit)( GLcontext *ctx,
- GLuint start, GLuint end,
- void *dest,
- GLuint stride )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*tc0)[4], (*tc1)[4], (*fog)[4];
- GLfloat (*tc2)[4], (*tc3)[4];
- GLfloat (*spec)[4];
- GLfloat (*col)[4];
- GLuint col_stride;
- GLuint tc0_stride, tc1_stride, spec_stride, fog_stride;
- GLuint tc2_stride, tc3_stride;
- GLuint tc0_size, tc1_size;
- GLuint tc2_size, tc3_size;
- GLfloat (*coord)[4];
- GLuint coord_stride;
- VERTEX *v = (VERTEX *)dest;
- const GLfloat *s = GET_VIEWPORT_MAT();
- const GLubyte *mask = VB->ClipMask;
- int i;
-
-/* fprintf(stderr, "%s(big) importable %d %d..%d\n", */
-/* __FUNCTION__, VB->importable_data, start, end); */
-
- if (HAVE_HW_VIEWPORT && HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
- (void) s;
- coord = VB->ClipPtr->data;
- coord_stride = VB->ClipPtr->stride;
- }
- else {
- coord = VB->NdcPtr->data;
- coord_stride = VB->NdcPtr->stride;
- }
-
- if (DO_TEX3) {
- const GLuint t3 = GET_TEXSOURCE(3);
- tc3 = VB->TexCoordPtr[t3]->data;
- tc3_stride = VB->TexCoordPtr[t3]->stride;
- if (DO_PTEX)
- tc3_size = VB->TexCoordPtr[t3]->size;
- }
-
- if (DO_TEX2) {
- const GLuint t2 = GET_TEXSOURCE(2);
- tc2 = VB->TexCoordPtr[t2]->data;
- tc2_stride = VB->TexCoordPtr[t2]->stride;
- if (DO_PTEX)
- tc2_size = VB->TexCoordPtr[t2]->size;
- }
-
- if (DO_TEX1) {
- const GLuint t1 = GET_TEXSOURCE(1);
- tc1 = VB->TexCoordPtr[t1]->data;
- tc1_stride = VB->TexCoordPtr[t1]->stride;
- if (DO_PTEX)
- tc1_size = VB->TexCoordPtr[t1]->size;
- }
-
- if (DO_TEX0) {
- const GLuint t0 = GET_TEXSOURCE(0);
- tc0_stride = VB->TexCoordPtr[t0]->stride;
- tc0 = VB->TexCoordPtr[t0]->data;
- if (DO_PTEX)
- tc0_size = VB->TexCoordPtr[t0]->size;
- }
-
- if (DO_RGBA) {
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
- }
-
- if (DO_SPEC) {
- spec = VB->SecondaryColorPtr[0]->data;
- spec_stride = VB->SecondaryColorPtr[0]->stride;
- } else {
- spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
- spec_stride = 0;
- }
-
- if (DO_FOG) {
- if (VB->FogCoordPtr) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
- } else {
- static GLfloat tmp[4] = {0, 0, 0, 0};
- fog = &tmp;
- fog_stride = 0;
- }
- }
-
- /* May have nonstandard strides:
- */
- if (start) {
- coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride);
- if (DO_TEX0)
- tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride);
- if (DO_TEX1)
- tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride);
- if (DO_TEX2)
- tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + start * tc2_stride);
- if (DO_TEX3)
- tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + start * tc3_stride);
- if (DO_RGBA)
- STRIDE_4F(col, start * col_stride);
- if (DO_SPEC)
- STRIDE_4F(spec, start * spec_stride);
- if (DO_FOG)
- STRIDE_4F(fog, start * fog_stride);
- // fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride);
- /* STRIDE_F(fog, start * fog_stride); */
- }
-
- for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
- if (DO_XYZW) {
- if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- /* unclipped */
- VIEWPORT_X(v->v.x, coord[0][0]);
- VIEWPORT_Y(v->v.y, coord[0][1]);
- VIEWPORT_Z(v->v.z, coord[0][2]);
- v->v.w = coord[0][3];
- } else {
- /* clipped */
- v->v.w = 1.0;
- }
- if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
- fprintf(stderr, "%s: vert (importable) %d: %.2f %.2f %.2f %f\n",
- __FUNCTION__, i, v->v.x, v->v.y, v->v.z, v->v.w);
- }
- coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);
- }
- if (DO_RGBA) {
- if (HAVE_RGBA_COLOR) {
- *(GLuint *)&v->v.color = *(GLuint *)&col[0];
- STRIDE_4F(col, col_stride);
- } else {
- v->v.color.blue = col[0][2];
- v->v.color.green = col[0][1];
- v->v.color.red = col[0][0];
- v->v.color.alpha = col[0][3];
- STRIDE_4F(col, col_stride);
- }
- }
- if (DO_SPEC) {
- v->v.specular.red = spec[0][0];
- v->v.specular.green = spec[0][1];
- v->v.specular.blue = spec[0][2];
- STRIDE_4F(spec, spec_stride);
- }
- if (DO_FOG) {
- v->v.specular.alpha = fog[0][0] * 255.0;
- /* STRIDE_F(fog, fog_stride); */
- fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
- }
- if (DO_TEX0) {
- v->v.u0 = tc0[0][0];
- v->v.v0 = tc0[0][1];
- if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
- fprintf(stderr, "%s: vert (importable) %d: u0: %.2f, v0: %.2f, w: %f\n",
- __FUNCTION__, i, v->v.u0, v->v.v0, v->v.w);
- }
-#ifdef MACH64_PREMULT_TEXCOORDS
- v->v.u0 *= v->v.w;
- v->v.v0 *= v->v.w;
-#endif
- if (DO_PTEX) {
- if (HAVE_PTEX_VERTICES) {
- if (tc0_size == 4)
- v->pv.q0 = tc0[0][3];
- else
- v->pv.q0 = 1.0;
- }
- else if (tc0_size == 4) {
-#ifdef MACH64_PREMULT_TEXCOORDS
- v->v.w *= tc0[0][3];
-#else
- float rhw = 1.0 / tc0[0][3];
- v->v.w *= tc0[0][3];
- v->v.u0 *= rhw;
- v->v.v0 *= rhw;
-#endif
- }
- }
- tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride);
- }
- if (DO_TEX1) {
- if (DO_PTEX) {
- v->pv.u1 = tc1[0][0];
- v->pv.v1 = tc1[0][1];
- if (tc1_size == 4)
- v->pv.q1 = tc1[0][3];
- else
- v->pv.q1 = 1.0;
- }
- else {
- v->v.u1 = tc1[0][0];
- v->v.v1 = tc1[0][1];
- }
-#ifdef MACH64_PREMULT_TEXCOORDS
- v->v.u1 *= v->v.w;
- v->v.v1 *= v->v.w;
-#endif
- tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride);
- }
- else if (DO_PTEX) {
- *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */
- }
- if (DO_TEX2) {
- if (DO_PTEX) {
- v->pv.u2 = tc2[0][0];
- v->pv.v2 = tc2[0][1];
- if (tc2_size == 4)
- v->pv.q2 = tc2[0][3];
- else
- v->pv.q2 = 1.0;
- }
- else {
- v->v.u2 = tc2[0][0];
- v->v.v2 = tc2[0][1];
- }
- tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + tc2_stride);
- }
- if (DO_TEX3) {
- if (DO_PTEX) {
- v->pv.u3 = tc3[0][0];
- v->pv.v3 = tc3[0][1];
- if (tc3_size == 4)
- v->pv.q3 = tc3[0][3];
- else
- v->pv.q3 = 1.0;
- }
- else {
- v->v.u3 = tc3[0][0];
- v->v.v3 = tc3[0][1];
- }
- tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + tc3_stride);
- }
- }
-}
-
-#else
-#if DO_XYZW
-
-#if HAVE_HW_DIVIDE
-#error "cannot use tiny vertices with hw perspective divide"
-#endif
-
-static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
- void *dest, GLuint stride )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*col)[4];
- GLuint col_stride;
- GLfloat (*coord)[4] = VB->NdcPtr->data;
- GLuint coord_stride = VB->NdcPtr->stride;
- GLfloat *v = (GLfloat *)dest;
- const GLubyte *mask = VB->ClipMask;
- const GLfloat *s = GET_VIEWPORT_MAT();
- int i;
-
- (void) s;
-
- ASSERT(stride == 4);
-
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
-
- /* Pack what's left into a 4-dword vertex. Color is in a different
- * place, and there is no 'w' coordinate.
- */
- if (start) {
- coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride);
- STRIDE_4F(col, start * col_stride);
- }
-
- for (i=start; i < end; i++, v+=4) {
- if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v[0], coord[0][0]);
- VIEWPORT_Y(v[1], coord[0][1]);
- VIEWPORT_Z(v[2], coord[0][2]);
- }
- coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);
- if (DO_RGBA) {
- if (HAVE_RGBA_COLOR) {
- *(GLuint *)&v[3] = *(GLuint *)col;
- }
- else {
- GLubyte *b = (GLubyte *)&v[3];
- UNCLAMPED_FLOAT_TO_UBYTE(b[0], col[0][2]);
- UNCLAMPED_FLOAT_TO_UBYTE(b[1], col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(b[2], col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(b[3], col[0][3]);
- }
- STRIDE_4F( col, col_stride );
- }
- if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
- fprintf(stderr, "vert (importable) %d: %.2f %.2f %.2f %x\n",
- i, v[0], v[1], v[2], *(int *)&v[3]);
- }
- }
-}
-#else
-static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
- void *dest, GLuint stride )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*col)[4];
- GLuint col_stride;
- GLfloat *v = (GLfloat *)dest;
- int i;
-
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
-
- if (start)
- STRIDE_4F(col, col_stride * start);
-
- /* Need to figure out where color is:
- */
- if (GET_VERTEX_FORMAT() == TINY_VERTEX_FORMAT)
- v += 3;
- else
- v += 4;
-
- for (i=start; i < end; i++, STRIDE_F(v, stride)) {
- if (HAVE_RGBA_COLOR) {
- *(GLuint *)v = *(GLuint *)col[0];
- }
- else {
- GLubyte *b = (GLubyte *)v;
- UNCLAMPED_FLOAT_TO_UBYTE(b[0], col[0][2]);
- UNCLAMPED_FLOAT_TO_UBYTE(b[1], col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(b[2], col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(b[3], col[0][3]);
- }
- STRIDE_4F( col, col_stride );
- }
-}
-#endif /* emit */
-#endif /* emit */
-
-#if (DO_XYZW) && (DO_RGBA)
-
-
-#if (HAVE_PTEX_VERTICES)
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* Force 'missing' texcoords to something valid.
- */
- if (DO_TEX3 && VB->TexCoordPtr[2] == 0)
- VB->TexCoordPtr[2] = VB->TexCoordPtr[3];
-
- if (DO_TEX2 && VB->TexCoordPtr[1] == 0)
- VB->TexCoordPtr[1] = VB->TexCoordPtr[2];
-
- if (DO_TEX1 && VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (DO_PTEX)
- return GL_TRUE;
-
- if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) ||
- (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) ||
- (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) ||
- (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4))
- return GL_FALSE;
-
- return GL_TRUE;
-}
-#else
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* Force 'missing' texcoords to something valid.
- */
- if (DO_TEX3 && VB->TexCoordPtr[2] == 0)
- VB->TexCoordPtr[2] = VB->TexCoordPtr[3];
-
- if (DO_TEX2 && VB->TexCoordPtr[1] == 0)
- VB->TexCoordPtr[1] = VB->TexCoordPtr[2];
-
- if (DO_TEX1 && VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (DO_PTEX)
- return GL_TRUE;
-
- /* No hardware support for projective texture. Can fake it for
- * TEX0 only.
- */
- if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) ||
- (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) ||
- (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) {
- PTEX_FALLBACK();
- return GL_FALSE;
- }
-
- if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) {
- if (DO_TEX1 || DO_TEX2 || DO_TEX3) {
- PTEX_FALLBACK();
- }
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-#endif /* ptex */
-
-
-static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte *ddverts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- GLfloat w;
- const GLfloat *s = GET_VIEWPORT_MAT();
-
- VERTEX *dst = (VERTEX *)(ddverts + (edst * size));
- VERTEX *in = (VERTEX *)(ddverts + (ein * size));
- VERTEX *out = (VERTEX *)(ddverts + (eout * size));
-
- (void)s;
-
- if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
- VIEWPORT_X( dst->v.x, dstclip[0] );
- VIEWPORT_Y( dst->v.y, dstclip[1] );
- VIEWPORT_Z( dst->v.z, dstclip[2] );
- w = dstclip[3];
- }
- else {
- w = (dstclip[3] == 0.0F) ? 1.0 : (1.0 / dstclip[3]);
- VIEWPORT_X( dst->v.x, dstclip[0] * w );
- VIEWPORT_Y( dst->v.y, dstclip[1] * w );
- VIEWPORT_Z( dst->v.z, dstclip[2] * w );
- }
-
- if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
- fprintf( stderr, "%s: dst vert: %.2f %.2f %.2f %f\n",
- __FUNCTION__,
- dst->v.x,
- dst->v.y,
- dst->v.z,
- w );
- }
-
- if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) ||
- DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 ||
- DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) {
-
- dst->v.w = w;
-
- INTERP_UB( t, dst->ub4[4][0], out->ub4[4][0], in->ub4[4][0] );
- INTERP_UB( t, dst->ub4[4][1], out->ub4[4][1], in->ub4[4][1] );
- INTERP_UB( t, dst->ub4[4][2], out->ub4[4][2], in->ub4[4][2] );
- INTERP_UB( t, dst->ub4[4][3], out->ub4[4][3], in->ub4[4][3] );
-
- if (DO_SPEC) {
- INTERP_UB( t, dst->ub4[5][0], out->ub4[5][0], in->ub4[5][0] );
- INTERP_UB( t, dst->ub4[5][1], out->ub4[5][1], in->ub4[5][1] );
- INTERP_UB( t, dst->ub4[5][2], out->ub4[5][2], in->ub4[5][2] );
- }
- if (DO_FOG) {
- INTERP_UB( t, dst->ub4[5][3], out->ub4[5][3], in->ub4[5][3] );
- }
- if (DO_TEX0) {
- if (DO_PTEX) {
- if (HAVE_PTEX_VERTICES) {
- INTERP_F( t, dst->pv.u0, out->pv.u0, in->pv.u0 );
- INTERP_F( t, dst->pv.v0, out->pv.v0, in->pv.v0 );
- INTERP_F( t, dst->pv.q0, out->pv.q0, in->pv.q0 );
- } else {
- GLfloat wout = VB->NdcPtr->data[eout][3];
- GLfloat win = VB->NdcPtr->data[ein][3];
- GLfloat qout = out->pv.w / wout;
- GLfloat qin = in->pv.w / win;
- GLfloat qdst, rqdst;
-
- ASSERT( !HAVE_HW_DIVIDE );
-
- INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin );
- INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin );
- INTERP_F( t, qdst, qout, qin );
-
- rqdst = 1.0 / qdst;
- dst->v.u0 *= rqdst;
- dst->v.v0 *= rqdst;
- dst->v.w *= rqdst;
- }
- }
- else {
-#ifdef MACH64_PREMULT_TEXCOORDS
- GLfloat qout = 1 / out->v.w;
- GLfloat qin = 1 / in->v.w;
-
- INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin);
- INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin);
-
- dst->v.u0 *= w;
- dst->v.v0 *= w;
-#else
- INTERP_F( t, dst->v.u0, out->v.u0, in->v.u0 );
- INTERP_F( t, dst->v.v0, out->v.v0, in->v.v0 );
-#endif
- }
- }
- if (DO_TEX1) {
- if (DO_PTEX) {
- INTERP_F( t, dst->pv.u1, out->pv.u1, in->pv.u1 );
- INTERP_F( t, dst->pv.v1, out->pv.v1, in->pv.v1 );
- INTERP_F( t, dst->pv.q1, out->pv.q1, in->pv.q1 );
- } else {
-#ifdef MACH64_PREMULT_TEXCOORDS
- GLfloat qout = 1 / out->v.w;
- GLfloat qin = 1 / in->v.w;
-
- INTERP_F( t, dst->v.u1, out->v.u1 * qout, in->v.u1 * qin );
- INTERP_F( t, dst->v.v1, out->v.v1 * qout, in->v.v1 * qin );
-
- dst->v.u1 *= w;
- dst->v.v1 *= w;
-#else
- INTERP_F( t, dst->v.u1, out->v.u1, in->v.u1 );
- INTERP_F( t, dst->v.v1, out->v.v1, in->v.v1 );
-#endif
- }
- }
- else if (DO_PTEX) {
- dst->pv.q0 = 0.0; /* must be a valid float on radeon */
- }
- if (DO_TEX2) {
- if (DO_PTEX) {
- INTERP_F( t, dst->pv.u2, out->pv.u2, in->pv.u2 );
- INTERP_F( t, dst->pv.v2, out->pv.v2, in->pv.v2 );
- INTERP_F( t, dst->pv.q2, out->pv.q2, in->pv.q2 );
- } else {
- INTERP_F( t, dst->v.u2, out->v.u2, in->v.u2 );
- INTERP_F( t, dst->v.v2, out->v.v2, in->v.v2 );
- }
- }
- if (DO_TEX3) {
- if (DO_PTEX) {
- INTERP_F( t, dst->pv.u3, out->pv.u3, in->pv.u3 );
- INTERP_F( t, dst->pv.v3, out->pv.v3, in->pv.v3 );
- INTERP_F( t, dst->pv.q3, out->pv.q3, in->pv.q3 );
- } else {
- INTERP_F( t, dst->v.u3, out->v.u3, in->v.u3 );
- INTERP_F( t, dst->v.v3, out->v.v3, in->v.v3 );
- }
- }
- } else {
- /* 4-dword vertex. Color is in v[3] and there is no oow coordinate.
- */
- INTERP_UB( t, dst->ub4[3][0], out->ub4[3][0], in->ub4[3][0] );
- INTERP_UB( t, dst->ub4[3][1], out->ub4[3][1], in->ub4[3][1] );
- INTERP_UB( t, dst->ub4[3][2], out->ub4[3][2], in->ub4[3][2] );
- INTERP_UB( t, dst->ub4[3][3], out->ub4[3][3], in->ub4[3][3] );
- }
-}
-
-#endif /* rgba && xyzw */
-
-
-static void TAG(init)( void )
-{
- setup_tab[IND].emit = TAG(emit);
-
-#if (DO_XYZW && DO_RGBA)
- setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes);
- setup_tab[IND].interp = TAG(interp);
-#endif
-
- if (DO_SPEC)
- setup_tab[IND].copy_pv = copy_pv_rgba4_spec5;
- else if (HAVE_HW_DIVIDE || DO_SPEC || DO_FOG || DO_TEX0 || DO_TEX1 ||
- DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES)
- setup_tab[IND].copy_pv = copy_pv_rgba4;
- else
- setup_tab[IND].copy_pv = copy_pv_rgba3;
-
- if (DO_TEX3) {
- if (DO_PTEX) {
- ASSERT(HAVE_PTEX_VERTICES);
- setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 18;
- }
- else {
- setup_tab[IND].vertex_format = TEX3_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 14;
- }
- }
- else if (DO_TEX2) {
- if (DO_PTEX) {
- ASSERT(HAVE_PTEX_VERTICES);
- setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 18;
- }
- else {
- setup_tab[IND].vertex_format = TEX2_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 12;
- }
- }
- else if (DO_TEX1) {
- if (DO_PTEX) {
- ASSERT(HAVE_PTEX_VERTICES);
- setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 12;
- }
- else {
- setup_tab[IND].vertex_format = TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 10;
- }
- }
- else if (DO_TEX0) {
- if (DO_PTEX && HAVE_PTEX_VERTICES) {
- setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 12;
- } else {
- setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 8;
- }
- }
- else if (!HAVE_HW_DIVIDE && !DO_SPEC && !DO_FOG && HAVE_TINY_VERTICES) {
- setup_tab[IND].vertex_format = TINY_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 4;
- } else if (HAVE_NOTEX_VERTICES) {
- setup_tab[IND].vertex_format = NOTEX_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 6;
- } else {
- setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 8;
- }
-
-}
-
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/server/mach64_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/server/mach64_dri.h
deleted file mode 100644
index 139668e3f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mach64/server/mach64_dri.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
-/*
- * Copyright 2000 Gareth Hughes
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION 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:
- * Gareth Hughes <gareth@valinux.com>
- * Leif Delgass <ldelgass@retinalburn.net>
- */
-
-#ifndef __MACH64_DRI_H__
-#define __MACH64_DRI_H__ 1
-
-#include "xf86drm.h"
-
-typedef struct {
- drm_handle_t fbHandle;
-
- drm_handle_t regsHandle;
- drmSize regsSize;
-
- int IsPCI;
-
- drm_handle_t agpHandle; /* Handle from drmAgpAlloc */
- unsigned long agpOffset;
- drmSize agpSize;
- int agpMode;
-
- /* DMA descriptor ring */
- unsigned long ringStart; /* Offset into AGP space */
- drm_handle_t ringHandle; /* Handle from drmAddMap */
- drmSize ringMapSize; /* Size of map */
- int ringSize; /* Size of ring (in kB) */
- drmAddress ringMap; /* Map */
-
- /* vertex buffer data */
- unsigned long bufferStart; /* Offset into AGP space */
- drm_handle_t bufferHandle; /* Handle from drmAddMap */
- drmSize bufferMapSize; /* Size of map */
- int bufferSize; /* Size of buffers (in MB) */
- drmAddress bufferMap; /* Map */
-
- drmBufMapPtr drmBuffers; /* Buffer map */
- int numBuffers; /* Number of buffers */
-
- /* AGP Texture data */
- unsigned long agpTexStart; /* Offset into AGP space */
- drm_handle_t agpTexHandle; /* Handle from drmAddMap */
- drmSize agpTexMapSize; /* Size of map */
- int agpTexSize; /* Size of AGP tex space (in MB) */
- drmAddress agpTexMap; /* Map */
- int log2AGPTexGran;
-
- int fbX;
- int fbY;
- int backX;
- int backY;
- int depthX;
- int depthY;
-
- int frontOffset;
- int frontPitch;
- int backOffset;
- int backPitch;
- int depthOffset;
- int depthPitch;
-
- int textureOffset;
- int textureSize;
- int logTextureGranularity;
-} ATIDRIServerInfoRec, *ATIDRIServerInfoPtr;
-
-typedef struct {
- int chipset;
- int width;
- int height;
- int mem;
- int cpp;
-
- int IsPCI;
- int AGPMode;
-
- unsigned int frontOffset;
- unsigned int frontPitch;
-
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- unsigned int textureOffset;
- unsigned int textureSize;
- int logTextureGranularity;
-
- drm_handle_t regs;
- drmSize regsSize;
-
- drm_handle_t agp;
- drmSize agpSize;
- unsigned int agpTextureOffset;
- unsigned int agpTextureSize;
- int logAgpTextureGranularity;
-} ATIDRIRec, *ATIDRIPtr;
-
-#endif /* __MACH64_DRI_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Doxyfile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Doxyfile
deleted file mode 100644
index 0d0c134a7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Doxyfile
+++ /dev/null
@@ -1,234 +0,0 @@
-# Doxyfile 1.3.3-Gideon
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = mga
-PROJECT_NUMBER = $VERSION$
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-SHOW_USED_FILES = YES
-SUBGROUPING = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = /home/newtree/temp/src/mesa/drivers/dri/mga
-FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.c++ \
- *.java \
- *.ii \
- *.ixx \
- *.ipp \
- *.i++ \
- *.inl \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.h++ \
- *.idl \
- *.odl \
- *.cs \
- *.C \
- *.H \
- *.tlh \
- *.diff \
- *.patch \
- *.moc \
- *.xpm \
- *.dox
-RECURSIVE = yes
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS = *
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = YES
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = yes
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 1000
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME = search.cgi
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH = /usr/local/bin/
-EXT_DOC_PATHS =
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Makefile
deleted file mode 100644
index a871064c6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# src/mesa/drivers/dri/mga/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = mga_dri.so
-
-MINIGLX_SOURCES = server/mga_dri.c
-
-DRIVER_SOURCES = \
- mgadd.c \
- mgaioctl.c \
- mgarender.c \
- mgastate.c \
- mgatris.c \
- mgapixel.c \
- mgaspan.c \
- mgatex.c \
- mgatexmem.c \
- mga_texstate.c \
- mga_texcombine.c \
- mgavb.c \
- mga_xmesa.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/README b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/README
deleted file mode 100644
index a7133fa66..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/README
+++ /dev/null
@@ -1,26 +0,0 @@
-MGA DRI driver ported from XF86DRI to FBDRI
-by Denis Oliver Kropp <dok@directfb.org>
-
-
-INFO
-
-This driver has been ported from the head branch of XFree86 to
-the embedded-1-branch of Mesa.
-
-
-STATUS
-
-Already working very well as far as I've tested it (16/32 bit).
-glxgears runs at 935 fps (G550 32MB AGP 4x, Athlon 1.33) vs 744 fps with XFree.
-Other demos (terrain, fire, etc.) have been successfully tested as well.
-
-
-TODO
-
-- mgaEngineShutdown
-- mgaEngineRestore
-- SGRAM detection
-- remove some unused bits from server/*
-- subset driver support
-- mgaWaitForVBlank
-- deinitialization (from MGADRICloseScreen) a la radeonDestroyScreen
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texcombine.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texcombine.c
deleted file mode 100644
index bbfa29be5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texcombine.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
- * Copyright (c) 2003 Ville Syrjala
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Ville Syrjala <syrjala@sci.fi>
- */
-
-#include "glheader.h"
-
-#include "mgacontext.h"
-#include "mgatex.h"
-#include "mgaregs.h"
-
-/*
- * GL_ARB_texture_env_combine
- * GL_EXT_texture_env_combine
- * GL_ARB_texture_env_crossbar
- * GL_ATI_texture_env_combine3
- */
-
-#define ARG_DISABLE 0xffffffff
-#define MGA_ARG1 0
-#define MGA_ARG2 1
-#define MGA_ALPHA 2
-
-GLboolean mgaUpdateTextureEnvCombine( GLcontext *ctx, int unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
- GLuint numColorArgs = 0, numAlphaArgs = 0;
- GLuint arg1[3], arg2[3], alpha[3];
- int args[3];
- int i;
-
- switch (texUnit->Combine.ModeRGB) {
- case GL_REPLACE:
- numColorArgs = 1;
- break;
- case GL_MODULATE:
- case GL_ADD:
- case GL_ADD_SIGNED:
- case GL_SUBTRACT:
- numColorArgs = 2;
- break;
- case GL_INTERPOLATE:
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- case GL_MODULATE_SUBTRACT_ATI:
- numColorArgs = 3;
- break;
- default:
- return GL_FALSE;
- }
-
- switch (texUnit->Combine.ModeA) {
- case GL_REPLACE:
- numAlphaArgs = 1;
- break;
- case GL_MODULATE:
- case GL_ADD:
- case GL_ADD_SIGNED:
- case GL_SUBTRACT:
- numAlphaArgs = 2;
- break;
- default:
- return GL_FALSE;
- }
-
- /* Start fresh :) */
- *reg = 0;
-
- /* COLOR */
- for (i = 0; i < 3; i++) {
- arg1[i] = 0;
- arg2[i] = 0;
- alpha[i] = 0;
- }
-
- for (i = 0;i < numColorArgs; i++) {
- switch (texUnit->Combine.SourceRGB[i]) {
- case GL_TEXTURE:
- arg1[i] |= 0;
- arg2[i] |= ARG_DISABLE;
- alpha[i] |= TD0_color_alpha_currtex;
- break;
- case GL_TEXTURE0:
- if (source == 0) {
- arg1[i] |= 0;
- arg2[i] |= ARG_DISABLE;
- alpha[i] |= TD0_color_alpha_currtex;
- } else {
- if (ctx->Texture._EnabledUnits != 0x03) {
- /* disable texturing */
- mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= DC_opcod_trap;
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- /* return GL_TRUE since we don't need a fallback */
- return GL_TRUE;
- }
- arg1[i] |= ARG_DISABLE;
- arg2[i] |= ARG_DISABLE;
- alpha[i] |= TD0_color_alpha_prevtex;
- }
- break;
- case GL_TEXTURE1:
- if (source == 0) {
- if (ctx->Texture._EnabledUnits != 0x03) {
- /* disable texturing */
- mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= DC_opcod_trap;
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- /* return GL_TRUE since we don't need a fallback */
- return GL_TRUE;
- }
- arg1[i] |= ARG_DISABLE;
- /* G400 specs (TDUALSTAGE0) */
- arg2[i] |= TD0_color_arg2_prevstage;
- alpha[i] |= TD0_color_alpha_prevstage;
- } else {
- arg1[i] |= 0;
- arg2[i] |= ARG_DISABLE;
- alpha[i] |= TD0_color_alpha_currtex;
- }
- break;
- case GL_CONSTANT:
- if (mmesa->fcol_used &&
- mmesa->envcolor[source] != mmesa->envcolor[!source])
- return GL_FALSE;
-
- arg1[i] |= ARG_DISABLE;
- arg2[i] |= TD0_color_arg2_fcol;
- alpha[i] |= TD0_color_alpha_fcol;
-
- mmesa->setup.fcol = mmesa->envcolor[source];
- mmesa->fcol_used = GL_TRUE;
- break;
- case GL_PRIMARY_COLOR:
- arg1[i] |= ARG_DISABLE;
- /* G400 specs (TDUALSTAGE1) */
- if (unit == 0 || (mmesa->setup.tdualstage0 &
- ((TD0_color_sel_mul & TD0_color_sel_add) |
- (TD0_alpha_sel_mul & TD0_alpha_sel_add)))) {
- arg2[i] |= TD0_color_arg2_diffuse;
- alpha[i] |= TD0_color_alpha_diffuse;
- } else {
- arg2[i] |= ARG_DISABLE;
- alpha[i] |= ARG_DISABLE;
- }
- break;
- case GL_PREVIOUS:
- arg1[i] |= ARG_DISABLE;
- if (unit == 0) {
- arg2[i] |= TD0_color_arg2_diffuse;
- alpha[i] |= TD0_color_alpha_diffuse;
- } else {
- arg2[i] |= TD0_color_arg2_prevstage;
- alpha[i] |= TD0_color_alpha_prevstage;
- }
- break;
- default:
- return GL_FALSE;
- }
-
- switch (texUnit->Combine.OperandRGB[i]) {
- case GL_SRC_COLOR:
- arg1[i] |= 0;
- arg2[i] |= 0;
- if (texUnit->Combine.SourceRGB[i] == GL_CONSTANT &&
- RGBA_EQUAL( mmesa->envcolor[source] )) {
- alpha[i] |= 0;
- } else {
- alpha[i] |= ARG_DISABLE;
- }
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- arg1[i] |= TD0_color_arg1_inv_enable;
- arg2[i] |= TD0_color_arg2_inv_enable;
- if (texUnit->Combine.SourceRGB[i] == GL_CONSTANT &&
- RGBA_EQUAL( mmesa->envcolor[source] )) {
- alpha[i] |= (TD0_color_alpha1inv_enable |
- TD0_color_alpha2inv_enable);
- } else {
- alpha[i] |= ARG_DISABLE;
- }
- break;
- case GL_SRC_ALPHA:
- arg1[i] |= TD0_color_arg1_replicatealpha_enable;
- arg2[i] |= TD0_color_arg2_replicatealpha_enable;
- alpha[i] |= 0;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- arg1[i] |= (TD0_color_arg1_replicatealpha_enable |
- TD0_color_arg1_inv_enable);
- arg2[i] |= (TD0_color_arg2_replicatealpha_enable |
- TD0_color_arg2_inv_enable);
- alpha[i] |= (TD0_color_alpha1inv_enable |
- TD0_color_alpha2inv_enable);
- break;
- }
- }
-
- switch (texUnit->Combine.ModeRGB) {
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- /* Special handling for ATI_texture_env_combine3.
- * If Arg1 == Arg0 or Arg1 == Arg2 we can use arg1 or arg2 as input for
- * both multiplier and adder.
- */
- /* Arg1 == arg1 */
- if (arg1[1] == arg1[0]) {
- if ((arg1[1] | arg2[2]) != ARG_DISABLE) {
- *reg |= arg1[1] | arg2[2];
- args[0] = MGA_ARG1; args[1] = MGA_ARG1; args[2] = MGA_ARG2;
- break;
- } else
- if ((arg1[1] | alpha[2]) != ARG_DISABLE) {
- *reg |= arg1[1] | alpha[2];
- args[0] = MGA_ARG1; args[1] = MGA_ARG1; args[2] = MGA_ALPHA;
- break;
- }
- }
- if (arg1[1] == arg1[2]) {
- if ((arg1[1] | arg2[0]) != ARG_DISABLE) {
- *reg |= arg1[1] | arg2[0];
- args[0] = MGA_ARG2; args[1] = MGA_ARG1; args[2] = MGA_ARG1;
- break;
- } else
- if ((arg1[1] | alpha[0]) != ARG_DISABLE) {
- *reg |= arg1[1] | alpha[0];
- args[0] = MGA_ALPHA; args[1] = MGA_ARG1; args[2] = MGA_ARG1;
- break;
- }
- }
- /* fallthrough */
- case GL_MODULATE_SUBTRACT_ATI:
- /* Arg1 == arg2 */
- if (arg2[1] == arg2[0]) {
- if ((arg2[1] | arg1[2]) != ARG_DISABLE) {
- *reg |= arg2[1] | arg1[2];
- args[0] = MGA_ARG2; args[1] = MGA_ARG2; args[2] = MGA_ARG1;
- break;
- } else
- if ((arg2[1] | alpha[2]) != ARG_DISABLE) {
- *reg |= arg2[1] | alpha[2];
- args[0] = MGA_ARG2; args[1] = MGA_ARG2; args[2] = MGA_ALPHA;
- break;
- }
- }
- if (arg2[1] == arg2[2]) {
- if ((arg2[1] | arg1[0]) != ARG_DISABLE) {
- *reg |= arg2[1] | arg1[0];
- args[0] = MGA_ARG1; args[1] = MGA_ARG2; args[2] = MGA_ARG2;
- break;
- } else
- if ((arg2[1] | alpha[0]) != ARG_DISABLE) {
- *reg |= arg2[1] | alpha[0];
- args[0] = MGA_ALPHA; args[1] = MGA_ARG2; args[2] = MGA_ARG2;
- break;
- }
- }
- /* fallthrough */
- default:
- /* Find working combo of arg1, arg2 and alpha.
- *
- * Keep the Arg0 != alpha cases first since there's
- * no way to get alpha out by itself (GL_REPLACE).
- *
- * Keep the Arg2 == alpha cases first because only alpha has the
- * capabilities to function as Arg2 (GL_INTERPOLATE). Also good for
- * GL_ADD, GL_ADD_SIGNED, GL_SUBTRACT since we can't get alpha to the
- * adder.
- *
- * Keep the Arg1 == alpha cases last for GL_MODULATE_ADD_ATI,
- * GL_MODULATE_SIGNED_ADD_ATI. Again because we can't get alpha to the
- * adder.
- *
- * GL_MODULATE_SUBTRACT_ATI needs special treatment since it requires
- * that Arg1 == arg2. This requirement clashes with those of other modes.
- */
- if ((arg1[0] | arg2[1] | alpha[2]) != ARG_DISABLE) {
- *reg |= arg1[0] | arg2[1] | alpha[2];
- args[0] = MGA_ARG1; args[1] = MGA_ARG2; args[2] = MGA_ALPHA;
- } else
- if ((arg1[1] | arg2[0] | alpha[2]) != ARG_DISABLE &&
- texUnit->Combine.ModeRGB != GL_MODULATE_SUBTRACT_ATI) {
- *reg |= arg1[1] | arg2[0] | alpha[2];
- args[0] = MGA_ARG2; args[1] = MGA_ARG1; args[2] = MGA_ALPHA;
- } else
- if ((arg1[1] | arg2[2] | alpha[0]) != ARG_DISABLE &&
- texUnit->Combine.ModeRGB != GL_MODULATE_SUBTRACT_ATI) {
- *reg |= arg1[1] | arg2[2] | alpha[0];
- args[0] = MGA_ALPHA; args[1] = MGA_ARG1; args[2] = MGA_ARG2;
- } else
- if ((arg1[2] | arg2[1] | alpha[0]) != ARG_DISABLE) {
- *reg |= arg1[2] | arg2[1] | alpha[0];
- args[0] = MGA_ALPHA; args[1] = MGA_ARG2; args[2] = MGA_ARG1;
- } else
- if ((arg1[0] | arg2[2] | alpha[1]) != ARG_DISABLE) {
- *reg |= arg1[0] | arg2[2] | alpha[1];
- args[0] = MGA_ARG1; args[1] = MGA_ALPHA; args[2] = MGA_ARG2;
- } else
- if ((arg1[2] | arg2[0] | alpha[1]) != ARG_DISABLE) {
- *reg |= arg1[2] | arg2[0] | alpha[1];
- args[0] = MGA_ARG2; args[1] = MGA_ALPHA; args[2] = MGA_ARG1;
- } else {
- /* nothing suitable */
- return GL_FALSE;
- }
- }
-
- switch (texUnit->Combine.ModeRGB) {
- case GL_REPLACE:
- if (texUnit->Combine.ScaleShiftRGB) {
- return GL_FALSE;
- }
-
- if (args[0] == MGA_ARG1) {
- *reg |= TD0_color_sel_arg1;
- } else if (args[0] == MGA_ARG2) {
- *reg |= TD0_color_sel_arg2;
- } else if (args[0] == MGA_ALPHA) {
- /* Can't get alpha out by itself */
- return GL_FALSE;
- }
- break;
- case GL_MODULATE:
- if (texUnit->Combine.ScaleShiftRGB == 1) {
- *reg |= TD0_color_modbright_2x;
- } else if (texUnit->Combine.ScaleShiftRGB == 2) {
- *reg |= TD0_color_modbright_4x;
- }
-
- *reg |= TD0_color_sel_mul;
-
- if (args[0] == MGA_ALPHA || args[1] == MGA_ALPHA) {
- if (args[0] == MGA_ARG1 || args[1] == MGA_ARG1) {
- *reg |= TD0_color_arg2mul_alpha2;
- } else if (args[0] == MGA_ARG2 || args[1] == MGA_ARG2) {
- *reg |= TD0_color_arg1mul_alpha1;
- }
- }
- break;
- case GL_ADD_SIGNED:
- *reg |= TD0_color_addbias_enable;
- /* fallthrough */
- case GL_ADD:
- if (args[0] == MGA_ALPHA || args[1] == MGA_ALPHA) {
- /* Can't get alpha to the adder */
- return GL_FALSE;
- }
- if (texUnit->Combine.ScaleShiftRGB == 1) {
- *reg |= TD0_color_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftRGB == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_color_add_add |
- TD0_color_sel_add);
- break;
- case GL_INTERPOLATE:
- if (args[2] != MGA_ALPHA) {
- /* Only alpha can function as Arg2 */
- return GL_FALSE;
- }
- if (texUnit->Combine.ScaleShiftRGB == 1) {
- *reg |= TD0_color_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftRGB == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_color_arg1mul_alpha1 |
- TD0_color_blend_enable |
- TD0_color_arg1add_mulout |
- TD0_color_arg2add_mulout |
- TD0_color_add_add |
- TD0_color_sel_add);
-
- /* Have to do this with xor since GL_ONE_MINUS_SRC_ALPHA may have
- * already touched this bit.
- */
- *reg ^= TD0_color_alpha1inv_enable;
-
- if (args[0] == MGA_ARG2) {
- /* Swap arguments */
- *reg ^= (TD0_color_arg1mul_alpha1 |
- TD0_color_arg2mul_alpha2 |
- TD0_color_alpha1inv_enable |
- TD0_color_alpha2inv_enable);
- }
-
- if (ctx->Texture._EnabledUnits != 0x03) {
- /* Linear blending mode needs dualtex enabled */
- *(reg+1) = (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2);
- mmesa->force_dualtex = GL_TRUE;
- }
- break;
- case GL_SUBTRACT:
- if (args[0] == MGA_ALPHA || args[1] == MGA_ALPHA) {
- /* Can't get alpha to the adder */
- return GL_FALSE;
- }
- if (texUnit->Combine.ScaleShiftRGB == 1) {
- *reg |= TD0_color_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftRGB == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_color_add_sub |
- TD0_color_sel_add);
-
- if (args[0] == MGA_ARG2) {
- /* Swap arguments */
- *reg ^= (TD0_color_arg1_inv_enable |
- TD0_color_arg2_inv_enable);
- }
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- *reg |= TD0_color_addbias_enable;
- /* fallthrough */
- case GL_MODULATE_ADD_ATI:
- if (args[1] == MGA_ALPHA) {
- /* Can't get alpha to the adder */
- return GL_FALSE;
- }
- if (texUnit->Combine.ScaleShiftRGB == 1) {
- *reg |= TD0_color_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftRGB == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_color_add_add |
- TD0_color_sel_add);
-
- if (args[1] == args[0] || args[1] == args[2]) {
- *reg |= TD0_color_arg1add_mulout;
- if (args[0] == MGA_ALPHA || args[2] == MGA_ALPHA)
- *reg |= TD0_color_arg1mul_alpha1;
-
- if (args[1] == MGA_ARG1) {
- /* Swap adder arguments */
- *reg ^= (TD0_color_arg1add_mulout |
- TD0_color_arg2add_mulout);
- if (args[0] == MGA_ALPHA || args[2] == MGA_ALPHA) {
- /* Swap multiplier arguments */
- *reg ^= (TD0_color_arg1mul_alpha1 |
- TD0_color_arg2mul_alpha2);
- }
- }
- } else {
- *reg |= (TD0_color_arg2mul_alpha2 |
- TD0_color_arg1add_mulout);
-
- if (args[1] == MGA_ARG1) {
- /* Swap arguments */
- *reg ^= (TD0_color_arg1mul_alpha1 |
- TD0_color_arg2mul_alpha2 |
- TD0_color_arg1add_mulout |
- TD0_color_arg2add_mulout);
- }
- }
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- if (args[1] != MGA_ARG2) {
- /* Can't swap arguments */
- return GL_FALSE;
- }
- if (texUnit->Combine.ScaleShiftRGB == 1) {
- *reg |= TD0_color_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftRGB == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_color_add_sub |
- TD0_color_sel_add);
-
- if (args[1] == args[0] || args[1] == args[2]) {
- *reg |= TD0_color_arg1add_mulout;
- if (args[0] == MGA_ALPHA || args[2] == MGA_ALPHA)
- *reg |= TD0_color_arg1mul_alpha1;
- } else {
- *reg |= (TD0_color_arg2mul_alpha2 |
- TD0_color_arg1add_mulout);
- }
- break;
- }
-
-
- /* ALPHA */
- for (i = 0; i < 2; i++) {
- arg1[i] = 0;
- arg2[i] = 0;
- }
-
- for (i = 0; i < numAlphaArgs; i++) {
- switch (texUnit->Combine.SourceA[i]) {
- case GL_TEXTURE:
- arg1[i] |= 0;
- arg2[i] |= ARG_DISABLE;
- break;
- case GL_TEXTURE0:
- if (source == 0) {
- arg1[i] |= 0;
- arg2[i] |= ARG_DISABLE;
- } else {
- if (ctx->Texture._EnabledUnits != 0x03) {
- /* disable texturing */
- mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= DC_opcod_trap;
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- /* return GL_TRUE since we don't need a fallback */
- return GL_TRUE;
- }
- arg1[i] |= ARG_DISABLE;
- arg2[i] |= TD0_alpha_arg2_prevtex;
- }
- break;
- case GL_TEXTURE1:
- if (source == 0) {
- if (ctx->Texture._EnabledUnits != 0x03) {
- /* disable texturing */
- mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= DC_opcod_trap;
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- /* return GL_TRUE since we don't need a fallback */
- return GL_TRUE;
- }
- arg1[i] |= ARG_DISABLE;
- /* G400 specs (TDUALSTAGE0) */
- arg2[i] |= TD0_alpha_arg2_prevstage;
- } else {
- arg1[i] |= 0;
- arg2[i] |= ARG_DISABLE;
- }
- break;
- case GL_CONSTANT:
- if (mmesa->fcol_used &&
- mmesa->envcolor[source] != mmesa->envcolor[!source])
- return GL_FALSE;
-
- arg1[i] |= ARG_DISABLE;
- arg2[i] |= TD0_alpha_arg2_fcol;
-
- mmesa->setup.fcol = mmesa->envcolor[source];
- mmesa->fcol_used = GL_TRUE;
- break;
- case GL_PRIMARY_COLOR:
- arg1[i] |= ARG_DISABLE;
- /* G400 specs (TDUALSTAGE1) */
- if (unit == 0 || (mmesa->setup.tdualstage0 &
- ((TD0_color_sel_mul & TD0_color_sel_add) |
- (TD0_alpha_sel_mul & TD0_alpha_sel_add)))) {
- arg2[i] |= TD0_alpha_arg2_diffuse;
- } else {
- arg2[i] |= ARG_DISABLE;
- }
- break;
- case GL_PREVIOUS:
- arg1[i] |= ARG_DISABLE;
- if (unit == 0) {
- arg2[i] |= TD0_alpha_arg2_diffuse;
- } else {
- arg2[i] |= TD0_alpha_arg2_prevstage;
- }
- break;
- default:
- return GL_FALSE;
- }
-
- switch (texUnit->Combine.OperandA[i]) {
- case GL_SRC_ALPHA:
- arg1[i] |= 0;
- arg2[i] |= 0;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- arg1[i] |= TD0_alpha_arg1_inv_enable;
- arg2[i] |= TD0_alpha_arg2_inv_enable;
- break;
- }
- }
-
- /* Find a working combo of arg1 and arg2 */
- if ((arg1[0] | arg2[1]) != ARG_DISABLE) {
- *reg |= arg1[0] | arg2[1];
- args[0] = MGA_ARG1; args[1] = MGA_ARG2;
- } else
- if ((arg1[1] | arg2[0]) != ARG_DISABLE) {
- *reg |= arg1[1] | arg2[0];
- args[0] = MGA_ARG2; args[1] = MGA_ARG1;
- } else {
- /* nothing suitable */
- return GL_FALSE;
- }
-
- switch (texUnit->Combine.ModeA) {
- case GL_REPLACE:
- if (texUnit->Combine.ScaleShiftA) {
- return GL_FALSE;
- }
-
- if (args[0] == MGA_ARG1) {
- *reg |= TD0_alpha_sel_arg1;
- } else if (args[0] == MGA_ARG2) {
- *reg |= TD0_alpha_sel_arg2;
- }
- break;
- case GL_MODULATE:
- if (texUnit->Combine.ScaleShiftA == 1) {
- *reg |= TD0_alpha_modbright_2x;
- } else if (texUnit->Combine.ScaleShiftA == 2) {
- *reg |= TD0_alpha_modbright_4x;
- }
-
- *reg |= TD0_alpha_sel_mul;
- break;
- case GL_ADD_SIGNED:
- *reg |= TD0_alpha_addbias_enable;
- /* fallthrough */
- case GL_ADD:
- if (texUnit->Combine.ScaleShiftA == 1) {
- *reg |= TD0_alpha_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftA == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_alpha_add_enable |
- TD0_alpha_sel_add);
- break;
- case GL_SUBTRACT:
- if (texUnit->Combine.ScaleShiftA == 1) {
- *reg |= TD0_alpha_add2x_enable;
- } else if (texUnit->Combine.ScaleShiftA == 2) {
- return GL_FALSE;
- }
-
- *reg |= (TD0_alpha_add_disable |
- TD0_alpha_sel_add);
-
- if (args[0] == MGA_ARG2) {
- /* Swap arguments */
- *reg ^= (TD0_alpha_arg1_inv_enable |
- TD0_alpha_arg2_inv_enable);
- }
- break;
- }
-
- return GL_TRUE;
-}
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texstate.c
deleted file mode 100644
index 8c28254cb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_texstate.c
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
- * 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 SYSTEMS, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Ian Romanick <idr@us.ibm.com>
- * Keith Whitwell <keithw@tungstengraphics.com>
- */
-/* $XFree86:$ */
-
-#include <stdlib.h>
-#include "mm.h"
-#include "mgacontext.h"
-#include "mgatex.h"
-#include "mgaregs.h"
-#include "mgatris.h"
-#include "mgaioctl.h"
-
-#include "context.h"
-#include "enums.h"
-#include "macros.h"
-#include "imports.h"
-
-#include "simple_list.h"
-#include "texformat.h"
-
-#define MGA_USE_TABLE_FOR_FORMAT
-#ifdef MGA_USE_TABLE_FOR_FORMAT
-#define TMC_nr_tformat (MESA_FORMAT_YCBCR_REV + 1)
-static const unsigned TMC_tformat[ TMC_nr_tformat ] =
-{
- [MESA_FORMAT_ARGB8888] = TMC_tformat_tw32,
- [MESA_FORMAT_RGB565] = TMC_tformat_tw16,
- [MESA_FORMAT_ARGB4444] = TMC_tformat_tw12,
- [MESA_FORMAT_ARGB1555] = TMC_tformat_tw15,
- [MESA_FORMAT_AL88] = TMC_tformat_tw8al,
- [MESA_FORMAT_I8] = TMC_tformat_tw8a,
- [MESA_FORMAT_CI8] = TMC_tformat_tw8 ,
- [MESA_FORMAT_YCBCR] = TMC_tformat_tw422uyvy,
- [MESA_FORMAT_YCBCR_REV] = TMC_tformat_tw422,
-};
-#endif
-
-static void
-mgaSetTexImages( mgaContextPtr mmesa,
- const struct gl_texture_object * tObj )
-{
- mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- struct gl_texture_image *baseImage = tObj->Image[0][ tObj->BaseLevel ];
- GLint totalSize;
- GLint width, height;
- GLint i;
- GLint numLevels;
- GLint log2Width, log2Height;
- GLuint txformat = 0;
- GLint ofs;
-
- /* Set the hardware texture format
- */
-#ifndef MGA_USE_TABLE_FOR_FORMAT
- switch (baseImage->TexFormat->MesaFormat) {
-
- case MESA_FORMAT_ARGB8888: txformat = TMC_tformat_tw32; break;
- case MESA_FORMAT_RGB565: txformat = TMC_tformat_tw16; break;
- case MESA_FORMAT_ARGB4444: txformat = TMC_tformat_tw12; break;
- case MESA_FORMAT_ARGB1555: txformat = TMC_tformat_tw15; break;
- case MESA_FORMAT_AL88: txformat = TMC_tformat_tw8al; break;
- case MESA_FORMAT_I8: txformat = TMC_tformat_tw8a; break;
- case MESA_FORMAT_CI8: txformat = TMC_tformat_tw8; break;
- case MESA_FORMAT_YCBCR: txformat = TMC_tformat_tw422uyvy; break;
- case MESA_FORMAT_YCBCR_REV: txformat = TMC_tformat_tw422; break;
-
- default:
- _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);
- return;
- }
-#else
- if ( (baseImage->TexFormat->MesaFormat >= TMC_nr_tformat)
- || (TMC_tformat[ baseImage->TexFormat->MesaFormat ] == 0) )
- {
- _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);
- return;
- }
-
- txformat = TMC_tformat[ baseImage->TexFormat->MesaFormat ];
-
-#endif /* MGA_USE_TABLE_FOR_FORMAT */
-
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
- if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- log2Width = 0;
- log2Height = 0;
- } else {
- log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
- }
-
- width = tObj->Image[0][t->base.firstLevel]->Width;
- height = tObj->Image[0][t->base.firstLevel]->Height;
-
- numLevels = MIN2( t->base.lastLevel - t->base.firstLevel + 1,
- MGA_IS_G200(mmesa) ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS);
-
-
- totalSize = 0;
- for ( i = 0 ; i < numLevels ; i++ ) {
- const struct gl_texture_image * const texImage =
- tObj->Image[0][ i + t->base.firstLevel ];
- int size;
-
- if (texImage == NULL)
- break;
-
- size = texImage->Width * texImage->Height *
- baseImage->TexFormat->TexelBytes;
-
- t->offsets[i] = totalSize;
- t->base.dirty_images[0] |= (1<<i);
-
- /* All mipmaps must be 32-byte aligned */
- totalSize += (size + 31) & ~31;
-
- /* Since G400 calculates the offsets in hardware
- * it can't handle more than one < 32 byte mipmap.
- *
- * Further testing has indicated that it can't
- * handle any < 32 byte mipmaps.
- */
- if (MGA_IS_G400( mmesa ) && size <= 32) {
- i++;
- break;
- }
- }
-
- /* save these values */
- numLevels = i;
- t->base.lastLevel = t->base.firstLevel + numLevels - 1;
- t->base.totalSize = totalSize;
-
- /* setup hardware register values */
- t->setup.texctl &= (TMC_tformat_MASK & TMC_tpitch_MASK
- & TMC_tpitchext_MASK);
- t->setup.texctl |= txformat;
-
-
- /* Set the texture width. In order to support non-power of 2 textures and
- * textures larger than 1024 texels wide, "linear" pitch must be used. For
- * the linear pitch, if the width is 2048, a value of zero is used.
- */
-
- t->setup.texctl |= TMC_tpitchlin_enable;
- t->setup.texctl |= MGA_FIELD( TMC_tpitchext, width & (2048 - 1) );
-
-
- /* G400 specifies the number of mip levels in a strange way. Since there
- * are up to 11 levels, it requires 4 bits. Three of the bits are at the
- * high end of TEXFILTER. The other bit is in the middle. Weird.
- */
- numLevels--;
- t->setup.texfilter &= TF_mapnb_MASK & TF_mapnbhigh_MASK & TF_reserved_MASK;
- t->setup.texfilter |= MGA_FIELD( TF_mapnb, numLevels & 0x7 );
- t->setup.texfilter |= MGA_FIELD( TF_mapnbhigh, (numLevels >> 3) & 0x1 );
-
- /* warp texture registers */
- ofs = MGA_IS_G200(mmesa) ? 28 : 11;
-
- t->setup.texwidth = (MGA_FIELD(TW_twmask, width - 1) |
- MGA_FIELD(TW_rfw, (10 - log2Width - 8) & 63 ) |
- MGA_FIELD(TW_tw, (log2Width + ofs ) | 0x40 ));
-
- t->setup.texheight = (MGA_FIELD(TH_thmask, height - 1) |
- MGA_FIELD(TH_rfh, (10 - log2Height - 8) & 63 ) |
- MGA_FIELD(TH_th, (log2Height + ofs ) | 0x40 ));
-
- mgaUploadTexImages( mmesa, t );
-}
-
-
-/* ================================================================
- * Texture unit state management
- */
-
-static void mgaUpdateTextureEnvG200( GLcontext *ctx, GLuint unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
- mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
-
- if (tObj != ctx->Texture.Unit[0].Current2D &&
- tObj != ctx->Texture.Unit[0].CurrentRect)
- return;
-
-
- t->setup.texctl &= ~TMC_tmodulate_enable;
- t->setup.texctl2 &= ~(TMC_decalblend_enable |
- TMC_idecal_enable |
- TMC_decaldis_enable);
-
- switch (ctx->Texture.Unit[0].EnvMode) {
- case GL_REPLACE:
- if (format == GL_ALPHA)
- t->setup.texctl2 |= TMC_idecal_enable;
-
- if (format == GL_RGB || format == GL_LUMINANCE)
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- else
- mmesa->hw.alpha_sel = AC_alphasel_fromtex;
- break;
-
- case GL_MODULATE:
- t->setup.texctl |= TMC_tmodulate_enable;
-
- if (format == GL_ALPHA)
- t->setup.texctl2 |= (TMC_idecal_enable |
- TMC_decaldis_enable);
-
- if (format == GL_RGB || format == GL_LUMINANCE)
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- else
- mmesa->hw.alpha_sel = AC_alphasel_modulated;
- break;
-
- case GL_DECAL:
- if (format == GL_RGB || format == GL_RGBA)
- t->setup.texctl2 |= TMC_decalblend_enable;
- else
- t->setup.texctl2 |= TMC_idecal_enable;
-
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- break;
-
- case GL_BLEND:
- if (format == GL_ALPHA) {
- t->setup.texctl2 |= TMC_idecal_enable;
- mmesa->hw.alpha_sel = AC_alphasel_modulated;
- } else {
- t->texenv_fallback = GL_TRUE;
- }
- break;
-
- default:
- break;
- }
-}
-
-
-#define MGA_REPLACE 0
-#define MGA_MODULATE 1
-#define MGA_DECAL 2
-#define MGA_ADD 3
-#define MGA_MAX_COMBFUNC 4
-
-static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] =
-{
- /* Unit 0:
- */
- {
- /* GL_REPLACE
- * Cv = Cs
- * Av = Af
- */
- (TD0_color_sel_arg1 |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2),
-
- /* GL_MODULATE
- * Cv = Cf Cs
- * Av = Af
- */
- (TD0_color_arg2_diffuse |
- TD0_color_sel_mul |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2),
-
- /* GL_DECAL
- * Cv = Cs
- * Av = Af
- */
- (TD0_color_sel_arg1 |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2),
-
- /* GL_ADD
- * Cv = Cf + Cs
- * Av = Af
- */
- (TD0_color_arg2_diffuse |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2),
- },
-
- /* Unit 1:
- */
- {
- /* GL_REPLACE
- * Cv = Cs
- * Av = Ap
- */
- (TD0_color_sel_arg1 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2),
-
- /* GL_MODULATE
- * Cv = Cp Cs
- * Av = Ap
- */
- (TD0_color_arg2_prevstage |
- TD0_color_sel_mul |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2),
-
- /* GL_DECAL
- * Cv = Cs
- * Av = Ap
- */
- (TD0_color_sel_arg1 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2),
-
- /* GL_ADD
- * Cv = Cp + Cs
- * Av = Ap
- */
- (TD0_color_arg2_prevstage |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2),
- },
-};
-
-static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] =
-{
- /* Unit 0:
- */
- {
- /* GL_REPLACE
- * Cv = Cs
- * Av = As
- */
- (TD0_color_sel_arg1 |
- TD0_alpha_sel_arg1),
-
- /* GL_MODULATE
- * Cv = Cf Cs
- * Av = Af As
- */
- (TD0_color_arg2_diffuse |
- TD0_color_sel_mul |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul),
-
- /* GL_DECAL
- * tmp = Cf ( 1 - As )
- * Cv = tmp + Cs As
- * Av = Af
- */
- (TD0_color_arg2_diffuse |
- TD0_color_alpha_currtex |
- TD0_color_alpha1inv_enable |
- TD0_color_arg1mul_alpha1 |
- TD0_color_blend_enable |
- TD0_color_arg1add_mulout |
- TD0_color_arg2add_mulout |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2),
-
- /* GL_ADD
- * Cv = Cf + Cs
- * Av = Af As
- */
- (TD0_color_arg2_diffuse |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul),
- },
-
- /* Unit 1:
- */
- {
- /* GL_REPLACE
- * Cv = Cs
- * Av = As
- */
- (TD0_color_sel_arg1 |
- TD0_alpha_sel_arg1),
-
- /* GL_MODULATE
- * Cv = Cp Cs
- * Av = Ap As
- */
- (TD0_color_arg2_prevstage |
- TD0_color_sel_mul |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_mul),
-
- /* GL_DECAL
- * tmp = Cp ( 1 - As )
- * Cv = tmp + Cs As
- * Av = Ap
- */
- (TD0_color_arg2_prevstage |
- TD0_color_alpha_currtex |
- TD0_color_alpha1inv_enable |
- TD0_color_arg1mul_alpha1 |
- TD0_color_blend_enable |
- TD0_color_arg1add_mulout |
- TD0_color_arg2add_mulout |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2),
-
- /* GL_ADD
- * Cv = Cp + Cs
- * Av = Ap As
- */
- (TD0_color_arg2_prevstage |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_mul),
- },
-};
-
-static const GLuint g400_alpha_combine[][MGA_MAX_COMBFUNC] =
-{
- /* Unit 0:
- */
- {
- /* GL_REPLACE
- * Cv = Cf
- * Av = As
- */
- (TD0_color_arg2_diffuse |
- TD0_color_sel_arg2 |
- TD0_alpha_sel_arg1),
-
- /* GL_MODULATE
- * Cv = Cf
- * Av = Af As
- */
- (TD0_color_arg2_diffuse |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul),
-
- /* GL_DECAL (undefined)
- * Cv = Cf
- * Av = Af
- */
- (TD0_color_arg2_diffuse |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2),
-
- /* GL_ADD
- * Cv = Cf
- * Av = Af As
- */
- (TD0_color_arg2_diffuse |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul),
- },
-
- /* Unit 1:
- */
- {
- /* GL_REPLACE
- * Cv = Cp
- * Av = As
- */
- (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2 |
- TD0_alpha_sel_arg1),
-
- /* GL_MODULATE
- * Cv = Cp
- * Av = Ap As
- */
- (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_mul),
-
- /* GL_DECAL (undefined)
- * Cv = Cp
- * Av = Ap
- */
- (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2),
-
- /* GL_ADD
- * Cv = Cp
- * Av = Ap As
- */
- (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_mul),
- },
-};
-
-static GLboolean mgaUpdateTextureEnvBlend( GLcontext *ctx, int unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
-
- *reg = 0;
-
- if (format == GL_ALPHA) {
- /* Cv = Cf */
- *reg |= (TD0_color_arg2_diffuse |
- TD0_color_sel_arg2);
- /* Av = Af As */
- *reg |= (TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul);
- return GL_TRUE;
- }
-
- /* C1 = Cf ( 1 - Cs ) */
- *reg |= (TD0_color_arg1_inv_enable |
- TD0_color_arg2_diffuse |
- TD0_color_sel_mul);
-
- if (format == GL_RGB || format == GL_LUMINANCE) {
- /* A1 = Af */
- *reg |= (TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_arg2);
- } else
- if (format == GL_RGBA || format == GL_LUMINANCE_ALPHA) {
- /* A1 = Af As */
- *reg |= (TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul);
- } else
- if (format == GL_INTENSITY) {
- /* A1 = Af ( 1 - As ) */
- *reg |= (TD0_alpha_arg1_inv_enable |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_sel_mul);
- }
-
- if (RGB_ZERO(mmesa->envcolor[source]) &&
- (format != GL_INTENSITY || ALPHA_ZERO(mmesa->envcolor[source])))
- return GL_TRUE; /* all done */
-
- if (ctx->Texture._EnabledUnits == 0x03)
- return GL_FALSE; /* need both units */
-
- mmesa->force_dualtex = GL_TRUE;
- reg = &mmesa->setup.tdualstage1;
- *reg = 0;
-
- if (RGB_ZERO(mmesa->envcolor[source])) {
- /* Cv = C1 */
- *reg |= (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2);
- } else
- if (RGB_ONE(mmesa->envcolor[source])) {
- /* Cv = C1 + Cs */
- *reg |= (TD0_color_arg2_prevstage |
- TD0_color_add_add |
- TD0_color_sel_add);
- } else
- if (RGBA_EQUAL(mmesa->envcolor[source])) {
- /* Cv = C1 + Cc Cs */
- *reg |= (TD0_color_arg2_prevstage |
- TD0_color_alpha_fcol |
- TD0_color_arg2mul_alpha2 |
- TD0_color_arg1add_mulout |
- TD0_color_add_add |
- TD0_color_sel_add);
-
- mmesa->setup.fcol = mmesa->envcolor[source];
- } else {
- return GL_FALSE;
- }
-
- if (format != GL_INTENSITY || ALPHA_ZERO(mmesa->envcolor[source])) {
- /* Av = A1 */
- *reg |= (TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2);
- } else
- if (ALPHA_ONE(mmesa->envcolor[source])) {
- /* Av = A1 + As */
- *reg |= (TD0_alpha_arg2_prevstage |
- TD0_alpha_add_enable |
- TD0_alpha_sel_add);
- } else {
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static void mgaUpdateTextureEnvG400( GLcontext *ctx, GLuint unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- const int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
- mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
-
- if (tObj != ctx->Texture.Unit[source].Current2D &&
- tObj != ctx->Texture.Unit[source].CurrentRect)
- return;
-
- switch (ctx->Texture.Unit[source].EnvMode) {
- case GL_REPLACE:
- if (format == GL_ALPHA) {
- *reg = g400_alpha_combine[unit][MGA_REPLACE];
- } else if (format == GL_RGB || format == GL_LUMINANCE) {
- *reg = g400_color_combine[unit][MGA_REPLACE];
- } else {
- *reg = g400_color_alpha_combine[unit][MGA_REPLACE];
- }
- break;
-
- case GL_MODULATE:
- if (format == GL_ALPHA) {
- *reg = g400_alpha_combine[unit][MGA_MODULATE];
- } else if (format == GL_RGB || format == GL_LUMINANCE) {
- *reg = g400_color_combine[unit][MGA_MODULATE];
- } else {
- *reg = g400_color_alpha_combine[unit][MGA_MODULATE];
- }
- break;
-
- case GL_DECAL:
- if (format == GL_RGB) {
- *reg = g400_color_combine[unit][MGA_DECAL];
- } else if (format == GL_RGBA) {
- *reg = g400_color_alpha_combine[unit][MGA_DECAL];
- if (ctx->Texture._EnabledUnits != 0x03) {
- /* Linear blending mode needs dual texturing enabled */
- *(reg+1) = (TD0_color_arg2_prevstage |
- TD0_color_sel_arg2 |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_sel_arg2);
- mmesa->force_dualtex = GL_TRUE;
- }
- } else {
- /* Undefined */
- *reg = g400_alpha_combine[unit][MGA_DECAL];
- }
- break;
-
- case GL_ADD:
- if (format == GL_ALPHA) {
- *reg = g400_alpha_combine[unit][MGA_ADD];
- } else if (format == GL_RGB || format == GL_LUMINANCE) {
- *reg = g400_color_combine[unit][MGA_ADD];
- } else if (format == GL_RGBA || format == GL_LUMINANCE_ALPHA) {
- *reg = g400_color_alpha_combine[unit][MGA_ADD];
- } else if (format == GL_INTENSITY) {
- /* Cv = Cf + Cs
- * Av = Af + As
- */
- if (unit == 0) {
- *reg = (TD0_color_arg2_diffuse |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_diffuse |
- TD0_alpha_add_enable |
- TD0_alpha_sel_add);
- } else {
- *reg = (TD0_color_arg2_prevstage |
- TD0_color_add_add |
- TD0_color_sel_add |
- TD0_alpha_arg2_prevstage |
- TD0_alpha_add_enable |
- TD0_alpha_sel_add);
- }
- }
- break;
-
- case GL_BLEND:
- if (!mgaUpdateTextureEnvBlend(ctx, unit))
- t->texenv_fallback = GL_TRUE;
- break;
-
- case GL_COMBINE:
- if (!mgaUpdateTextureEnvCombine(ctx, unit))
- t->texenv_fallback = GL_TRUE;
- break;
- default:
- break;
- }
-}
-
-static void disable_tex( GLcontext *ctx, int unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
- /* Texture unit disabled */
-
- if ( mmesa->CurrentTexObj[unit] != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- mmesa->CurrentTexObj[unit]->base.bound &= ~(1UL << unit);
- mmesa->CurrentTexObj[unit] = NULL;
- }
-
- if ( unit != 0 && !mmesa->force_dualtex ) {
- mmesa->setup.tdualstage1 = mmesa->setup.tdualstage0;
- }
-
- if ( ctx->Texture._EnabledUnits == 0 ) {
- mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= DC_opcod_trap;
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
- }
-
- mmesa->dirty |= MGA_UPLOAD_CONTEXT | (MGA_UPLOAD_TEX0 << unit);
-}
-
-static GLboolean enable_tex( GLcontext *ctx, int unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
-
- /* Upload teximages (not pipelined)
- */
- if (t->base.dirty_images[0]) {
- FLUSH_BATCH( mmesa );
- mgaSetTexImages( mmesa, tObj );
- if ( t->base.memBlock == NULL ) {
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-static GLboolean update_tex_common( GLcontext *ctx, int unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- struct gl_texture_object *tObj = texUnit->_Current;
- mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- return GL_FALSE;
- }
-
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if ( mmesa->CurrentTexObj[unit] != t ) {
- if ( mmesa->CurrentTexObj[unit] != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- mmesa->CurrentTexObj[unit]->base.bound &= ~(1UL << unit);
- }
-
- mmesa->CurrentTexObj[unit] = t;
- t->base.bound |= (1UL << unit);
-
- driUpdateTextureLRU( (driTextureObject *) t ); /* done too often */
- }
-
- /* register setup */
- if ( unit == 1 ) {
- mmesa->setup.tdualstage1 = mmesa->setup.tdualstage0;
- }
-
- t->texenv_fallback = GL_FALSE;
-
- /* Set this before mgaUpdateTextureEnvG400() since
- * GL_ARB_texture_env_crossbar may have to disable texturing.
- */
- mmesa->setup.dwgctl &= DC_opcod_MASK;
- mmesa->setup.dwgctl |= DC_opcod_texture_trap;
-
- /* FIXME: The Radeon has some cached state so that it can avoid calling
- * FIXME: UpdateTextureEnv in some cases. Is that possible here?
- */
- if (MGA_IS_G400(mmesa)) {
- /* G400: Regardless of texture env mode, we use the alpha from the
- * texture unit (AC_alphasel_fromtex) since it will have already
- * been modulated by the incoming fragment color, if needed.
- * We don't want (AC_alphasel_modulate) since that'll effectively
- * do the modulation twice.
- */
- mmesa->hw.alpha_sel = AC_alphasel_fromtex;
-
- mgaUpdateTextureEnvG400( ctx, unit );
- } else {
- mgaUpdateTextureEnvG200( ctx, unit );
- }
-
- t->setup.texctl2 &= TMC_dualtex_MASK;
- if (ctx->Texture._EnabledUnits == 0x03 || mmesa->force_dualtex) {
- t->setup.texctl2 |= TMC_dualtex_enable;
- }
-
- mmesa->dirty |= MGA_UPLOAD_CONTEXT | (MGA_UPLOAD_TEX0 << unit);
-
- FALLBACK( ctx, MGA_FALLBACK_BORDER_MODE, t->border_fallback );
- return !t->border_fallback && !t->texenv_fallback;
-}
-
-
-static GLboolean updateTextureUnit( GLcontext *ctx, int unit )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- const int source = mmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
-
-
- if ( texUnit->_ReallyEnabled == TEXTURE_2D_BIT ||
- texUnit->_ReallyEnabled == TEXTURE_RECT_BIT ) {
- return(enable_tex( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
- else if ( texUnit->_ReallyEnabled ) {
- return GL_FALSE;
- }
- else {
- disable_tex( ctx, unit );
- return GL_TRUE;
- }
-}
-
-/* The G400 is now programmed quite differently wrt texture environment.
- */
-void mgaUpdateTextureState( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- GLboolean ok;
- unsigned i;
-
- mmesa->force_dualtex = GL_FALSE;
- mmesa->fcol_used = GL_FALSE;
-
- /* This works around a quirk with the MGA hardware. If only OpenGL
- * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The
- * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used.
- */
-
- mmesa->tmu_source[0] = 0;
- mmesa->tmu_source[1] = 1;
-
- if ((ctx->Texture._EnabledUnits & 0x03) == 0x02) {
- /* only texture 1 enabled */
- mmesa->tmu_source[0] = 1;
- mmesa->tmu_source[1] = 0;
- }
-
- for ( i = 0, ok = GL_TRUE
- ; (i < ctx->Const.MaxTextureUnits) && ok
- ; i++ ) {
- ok = updateTextureUnit( ctx, i );
- }
-
- FALLBACK( ctx, MGA_FALLBACK_TEXTURE, !ok );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c
deleted file mode 100644
index d1d7799f9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ /dev/null
@@ -1,1020 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.19 2003/03/26 20:43:49 tsi Exp $ */
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file mga_xmesa.c
- * MGA screen and context initialization / creation code.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include "drm.h"
-#include "mga_drm.h"
-#include "mga_xmesa.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "mgadd.h"
-#include "mgastate.h"
-#include "mgatex.h"
-#include "mgaspan.h"
-#include "mgaioctl.h"
-#include "mgatris.h"
-#include "mgavb.h"
-#include "mgapixel.h"
-#include "mga_xmesa.h"
-#include "mga_dri.h"
-
-#include "utils.h"
-#include "vblank.h"
-
-#include "extensions.h"
-
-#include "GL/internal/dri_interface.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_program
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_multi_draw_arrays
-#define need_GL_EXT_secondary_color
-#if 0
-#define need_GL_EXT_paletted_texture
-#endif
-#define need_GL_NV_vertex_program
-#include "extension_helper.h"
-
-/* MGA configuration
- */
-#include "xmlpool.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_SOFTWARE
- DRI_CONF_ARB_VERTEX_PROGRAM(true)
- DRI_CONF_NV_VERTEX_PROGRAM(true)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driNConfigOptions = 6;
-
-#ifndef MGA_DEBUG
-int MGA_DEBUG = 0;
-#endif
-
-static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
-
-static __GLcontextModes *
-mgaFillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* GLX_SWAP_COPY_OML is only supported because the MGA driver doesn't
- * support pageflipping at all.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
- };
-
- u_int8_t depth_bits_array[3];
- u_int8_t stencil_bits_array[3];
-
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = depth_bits;
- depth_bits_array[2] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = 0;
- stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGR;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-static GLboolean
-mgaInitDriver(__DRIscreenPrivate *sPriv)
-{
- mgaScreenPrivate *mgaScreen;
- MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(MGADRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(MGADRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- mgaScreen = (mgaScreenPrivate *)MALLOC(sizeof(mgaScreenPrivate));
- if (!mgaScreen) {
- __driUtilMessage("Couldn't malloc screen struct");
- return GL_FALSE;
- }
-
- mgaScreen->sPriv = sPriv;
- sPriv->private = (void *)mgaScreen;
-
- if (sPriv->drmMinor >= 1) {
- int ret;
- drm_mga_getparam_t gp;
-
- gp.param = MGA_PARAM_IRQ_NR;
- gp.value = &mgaScreen->irq;
- mgaScreen->irq = 0;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_MGA_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drmMgaGetParam (MGA_PARAM_IRQ_NR): %d\n", ret);
- FREE(mgaScreen);
- sPriv->private = NULL;
- return GL_FALSE;
- }
- }
-
- if ( glx_enable_extension != NULL ) {
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- }
-
- if (serverInfo->chipset != MGA_CARD_TYPE_G200 &&
- serverInfo->chipset != MGA_CARD_TYPE_G400) {
- FREE(mgaScreen);
- sPriv->private = NULL;
- __driUtilMessage("Unrecognized chipset");
- return GL_FALSE;
- }
-
-
- mgaScreen->chipset = serverInfo->chipset;
- mgaScreen->cpp = serverInfo->cpp;
-
- mgaScreen->agpMode = serverInfo->agpMode;
-
- mgaScreen->frontPitch = serverInfo->frontPitch;
- mgaScreen->frontOffset = serverInfo->frontOffset;
- mgaScreen->backOffset = serverInfo->backOffset;
- mgaScreen->backPitch = serverInfo->backPitch;
- mgaScreen->depthOffset = serverInfo->depthOffset;
- mgaScreen->depthPitch = serverInfo->depthPitch;
-
-
- /* The only reason that the MMIO region needs to be accessable and the
- * primary DMA region base address needs to be known is so that the driver
- * can busy wait for certain DMA operations to complete (see
- * mgaWaitForFrameCompletion in mgaioctl.c).
- *
- * Starting with MGA DRM version 3.2, these are completely unneeded as
- * there is a new, in-kernel mechanism for handling the wait.
- */
-
- if (mgaScreen->sPriv->drmMinor < 2) {
- mgaScreen->mmio.handle = serverInfo->registers.handle;
- mgaScreen->mmio.size = serverInfo->registers.size;
- if ( drmMap( sPriv->fd,
- mgaScreen->mmio.handle, mgaScreen->mmio.size,
- &mgaScreen->mmio.map ) < 0 ) {
- FREE( mgaScreen );
- sPriv->private = NULL;
- __driUtilMessage( "Couldn't map MMIO registers" );
- return GL_FALSE;
- }
-
- mgaScreen->primary.handle = serverInfo->primary.handle;
- mgaScreen->primary.size = serverInfo->primary.size;
- }
- else {
- (void) memset( & mgaScreen->primary, 0, sizeof( mgaScreen->primary ) );
- (void) memset( & mgaScreen->mmio, 0, sizeof( mgaScreen->mmio ) );
- }
-
- mgaScreen->textureOffset[MGA_CARD_HEAP] = serverInfo->textureOffset;
- mgaScreen->textureOffset[MGA_AGP_HEAP] = (serverInfo->agpTextureOffset |
- PDEA_pagpxfer_enable | 1);
-
- mgaScreen->textureSize[MGA_CARD_HEAP] = serverInfo->textureSize;
- mgaScreen->textureSize[MGA_AGP_HEAP] = serverInfo->agpTextureSize;
-
-
- /* The texVirtual array stores the base addresses in the CPU's address
- * space of the texture memory pools. The base address of the on-card
- * memory pool is calculated as an offset of the base of video memory. The
- * AGP texture pool has to be mapped into the processes address space by
- * the DRM.
- */
-
- mgaScreen->texVirtual[MGA_CARD_HEAP] = (char *)(mgaScreen->sPriv->pFB +
- serverInfo->textureOffset);
-
- if ( serverInfo->agpTextureSize > 0 ) {
- if (drmMap(sPriv->fd, serverInfo->agpTextureOffset,
- serverInfo->agpTextureSize,
- (drmAddress *)&mgaScreen->texVirtual[MGA_AGP_HEAP]) != 0) {
- FREE(mgaScreen);
- sPriv->private = NULL;
- __driUtilMessage("Couldn't map agptexture region");
- return GL_FALSE;
- }
- }
-
-
- /* For calculating setupdma addresses.
- */
-
- mgaScreen->bufs = drmMapBufs(sPriv->fd);
- if (!mgaScreen->bufs) {
- FREE(mgaScreen);
- sPriv->private = NULL;
- __driUtilMessage("Couldn't map dma buffers");
- return GL_FALSE;
- }
- mgaScreen->sarea_priv_offset = serverInfo->sarea_priv_offset;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&mgaScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- return GL_TRUE;
-}
-
-
-static void
-mgaDestroyScreen(__DRIscreenPrivate *sPriv)
-{
- mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *) sPriv->private;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
- fprintf(stderr, "mgaDestroyScreen\n");
-
- drmUnmapBufs(mgaScreen->bufs);
-
-
- /* free all option information */
- driDestroyOptionInfo (&mgaScreen->optionCache);
-
- FREE(mgaScreen);
- sPriv->private = NULL;
-}
-
-
-extern const struct tnl_pipeline_stage _mga_render_stage;
-
-static const struct tnl_pipeline_stage *mga_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_arb_vertex_program_stage,
- &_tnl_vertex_program_stage,
-
- /* REMOVE: point attenuation stage */
-#if 0
- &_mga_render_stage, /* ADD: unclipped rastersetup-to-dma */
- /* Need new ioctl for wacceptseq */
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-
-static const struct dri_extension g400_extensions[] =
-{
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_ARB_texture_env_crossbar", NULL },
- { "GL_EXT_texture_env_combine", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_ATI_texture_env_combine3", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_rectangle", NULL },
- { "GL_EXT_blend_logic_op", NULL },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
- /* paletted_textures currently doesn't work, but we could fix them later */
-#if defined( need_GL_EXT_paletted_texture )
- { "GL_EXT_shared_texture_palette", NULL },
- { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
-#endif
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_extension ARB_vp_extension[] = {
- { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
- { NULL, NULL }
-};
-
-static const struct dri_extension NV_vp_extensions[] = {
- { "GL_NV_vertex_program", GL_NV_vertex_program_functions },
- { "GL_NV_vertex_program1_1", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_VERBOSE_FALLBACK },
- { "tex", DEBUG_VERBOSE_TEXTURE },
- { "ioctl", DEBUG_VERBOSE_IOCTL },
- { "verb", DEBUG_VERBOSE_MSG },
- { "dri", DEBUG_VERBOSE_DRI },
- { NULL, 0 }
-};
-
-
-static GLboolean
-mgaCreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- int i;
- unsigned maxlevels;
- GLcontext *ctx, *shareCtx;
- mgaContextPtr mmesa;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private;
- drm_mga_sarea_t *saPriv = (drm_mga_sarea_t *)(((char*)sPriv->pSAREA)+
- mgaScreen->sarea_priv_offset);
- struct dd_function_table functions;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
- fprintf(stderr, "mgaCreateContext\n");
-
- /* allocate mga context */
- mmesa = (mgaContextPtr) CALLOC(sizeof(mgaContext));
- if (!mmesa) {
- return GL_FALSE;
- }
-
- /* Init default driver functions then plug in our Radeon-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions( &functions );
- mgaInitDriverFuncs( &functions );
- mgaInitTextureFuncs( &functions );
- mgaInitIoctlFuncs( &functions );
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((mgaContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
- &functions, (void *) mmesa);
- if (!mmesa->glCtx) {
- FREE(mmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = mmesa;
-
- /* Init mga state */
- mmesa->hHWContext = driContextPriv->hHWContext;
- mmesa->driFd = sPriv->fd;
- mmesa->driHwLock = &sPriv->pSAREA->lock;
-
- mmesa->mgaScreen = mgaScreen;
- mmesa->driScreen = sPriv;
- mmesa->sarea = (void *)saPriv;
-
- /* Parse configuration files */
- driParseConfigFiles (&mmesa->optionCache, &mgaScreen->optionCache,
- sPriv->myNum, "mga");
-
- (void) memset( mmesa->texture_heaps, 0, sizeof( mmesa->texture_heaps ) );
- make_empty_list( & mmesa->swapped );
-
- mmesa->nr_heaps = mgaScreen->texVirtual[MGA_AGP_HEAP] ? 2 : 1;
- for ( i = 0 ; i < mmesa->nr_heaps ; i++ ) {
- mmesa->texture_heaps[i] = driCreateTextureHeap( i, mmesa,
- mgaScreen->textureSize[i],
- 6,
- MGA_NR_TEX_REGIONS,
- (drmTextureRegionPtr)mmesa->sarea->texList[i],
- &mmesa->sarea->texAge[i],
- &mmesa->swapped,
- sizeof( mgaTextureObject_t ),
- (destroy_texture_object_t *) mgaDestroyTexObj );
- }
-
- /* Set the maximum texture size small enough that we can guarentee
- * that both texture units can bind a maximal texture and have them
- * on the card at once.
- */
- ctx = mmesa->glCtx;
- if ( mgaScreen->chipset == MGA_CARD_TYPE_G200 ) {
- ctx->Const.MaxTextureUnits = 1;
- ctx->Const.MaxTextureImageUnits = 1;
- ctx->Const.MaxTextureCoordUnits = 1;
- maxlevels = G200_TEX_MAXLEVELS;
-
- }
- else {
- ctx->Const.MaxTextureUnits = 2;
- ctx->Const.MaxTextureImageUnits = 2;
- ctx->Const.MaxTextureCoordUnits = 2;
- maxlevels = G400_TEX_MAXLEVELS;
- }
-
- driCalculateMaxTextureLevels( mmesa->texture_heaps,
- mmesa->nr_heaps,
- & ctx->Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 0, /* 3D textures unsupported. */
- 0, /* cube textures unsupported. */
- 11, /* max texture rect size is 2048x2048 */
- maxlevels,
- GL_FALSE );
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 10.0;
- ctx->Const.MaxLineWidthAA = 10.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- mmesa->texture_depth = driQueryOptioni (&mmesa->optionCache,
- "texture_depth");
- if (mmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
- mmesa->texture_depth = ( mesaVis->rgbBits >= 24 ) ?
- DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
- mmesa->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
-
- switch (mesaVis->depthBits) {
- case 16:
- mmesa->depth_scale = 1.0/(GLdouble)0xffff;
- mmesa->depth_clear_mask = ~0;
- mmesa->ClearDepth = 0xffff;
- break;
- case 24:
- mmesa->depth_scale = 1.0/(GLdouble)0xffffff;
- if (mmesa->hw_stencil) {
- mmesa->depth_clear_mask = 0xffffff00;
- mmesa->stencil_clear_mask = 0x000000ff;
- } else
- mmesa->depth_clear_mask = ~0;
- mmesa->ClearDepth = 0xffffff00;
- break;
- case 32:
- mmesa->depth_scale = 1.0/(GLdouble)0xffffffff;
- mmesa->depth_clear_mask = ~0;
- mmesa->ClearDepth = 0xffffffff;
- break;
- };
-
- mmesa->haveHwStipple = GL_FALSE;
- mmesa->RenderIndex = -1; /* impossible value */
- mmesa->dirty = ~0;
- mmesa->vertex_format = 0;
- mmesa->CurrentTexObj[0] = 0;
- mmesa->CurrentTexObj[1] = 0;
- mmesa->tmu_source[0] = 0;
- mmesa->tmu_source[1] = 1;
-
- mmesa->texAge[0] = 0;
- mmesa->texAge[1] = 0;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
-
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, mga_pipeline );
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
- mmesa->primary_offset = mmesa->mgaScreen->primary.handle;
-
- ctx->DriverCtx = (void *) mmesa;
- mmesa->glCtx = ctx;
-
- driInitExtensions( ctx, card_extensions, GL_FALSE );
-
- if (MGA_IS_G400(MGA_CONTEXT(ctx))) {
- driInitExtensions( ctx, g400_extensions, GL_FALSE );
- }
-
- if ( driQueryOptionb( &mmesa->optionCache, "arb_vertex_program" ) ) {
- driInitSingleExtension( ctx, ARB_vp_extension );
- }
-
- if ( driQueryOptionb( &mmesa->optionCache, "nv_vertex_program" ) ) {
- driInitExtensions( ctx, NV_vp_extensions, GL_FALSE );
- }
-
-
- /* XXX these should really go right after _mesa_init_driver_functions() */
- mgaDDInitStateFuncs( ctx );
- mgaDDInitSpanFuncs( ctx );
- mgaDDInitPixelFuncs( ctx );
- mgaDDInitTriFuncs( ctx );
-
- mgaInitVB( ctx );
- mgaInitState( mmesa );
-
- driContextPriv->driverPrivate = (void *) mmesa;
-
-#if DO_DEBUG
- MGA_DEBUG = driParseDebugString( getenv( "MGA_DEBUG" ),
- debug_control );
-#endif
-
- mmesa->vblank_flags = (mmesa->mgaScreen->irq == 0)
- ? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(&mmesa->optionCache);
-
- (*dri_interface->getUST)( & mmesa->swap_ust );
-
- if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
- FALLBACK(mmesa->glCtx, MGA_FALLBACK_DISABLE, 1);
- }
-
- return GL_TRUE;
-}
-
-static void
-mgaDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
- fprintf( stderr, "[%s:%d] mgaDestroyContext start\n",
- __FILE__, __LINE__ );
-
- assert(mmesa); /* should never be null */
- if (mmesa) {
- GLboolean release_texture_heaps;
-
-
- release_texture_heaps = (mmesa->glCtx->Shared->RefCount == 1);
- _swsetup_DestroyContext( mmesa->glCtx );
- _tnl_DestroyContext( mmesa->glCtx );
- _ac_DestroyContext( mmesa->glCtx );
- _swrast_DestroyContext( mmesa->glCtx );
-
- mgaFreeVB( mmesa->glCtx );
-
- /* free the Mesa context */
- mmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(mmesa->glCtx);
-
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- int i;
-
- for ( i = 0 ; i < mmesa->nr_heaps ; i++ ) {
- driDestroyTextureHeap( mmesa->texture_heaps[ i ] );
- mmesa->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & mmesa->swapped ) );
- }
-
- /* free the option cache */
- driDestroyOptionCache (&mmesa->optionCache);
-
- FREE(mmesa);
- }
-
- if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
- fprintf( stderr, "[%s:%d] mgaDestroyContext done\n",
- __FILE__, __LINE__ );
-}
-
-
-static GLboolean
-mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- mgaScreenPrivate *screen = (mgaScreenPrivate *) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- GLboolean swStencil = (mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24);
-
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0 );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- mgaSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- mgaSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mgaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- /* XXX is this right? */
- if (mesaVis->stencilBits) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mgaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mgaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- }
- else if (mesaVis->depthBits == 32) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mgaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- mgaSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
-
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-mgaDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-static void
-mgaSwapBuffers(__DRIdrawablePrivate *dPriv)
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- mgaContextPtr mmesa;
- GLcontext *ctx;
- mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = mmesa->glCtx;
-
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx );
- mgaCopyBuffer( dPriv );
- }
- } else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!\n", __FUNCTION__);
- }
-}
-
-static GLboolean
-mgaUnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate;
- if (mmesa)
- mmesa->dirty = ~0;
-
- return GL_TRUE;
-}
-
-/* This looks buggy to me - the 'b' variable isn't used anywhere...
- * Hmm - It seems that the drawable is already hooked in to
- * driDrawablePriv.
- *
- * But why are we doing context initialization here???
- */
-static GLboolean
-mgaMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate;
-
- if (mmesa->driDrawable != driDrawPriv) {
- driDrawableInitVBlank( driDrawPriv, mmesa->vblank_flags );
- mmesa->driDrawable = driDrawPriv;
- mmesa->dirty = ~0;
- mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK);
- mmesa->mesa_drawable = driDrawPriv;
- }
-
- mmesa->driReadable = driReadPriv;
-
- _mesa_make_current(mmesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
- }
- else {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-
-void mgaGetLock( mgaContextPtr mmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- drm_mga_sarea_t *sarea = mmesa->sarea;
- int me = mmesa->hHWContext;
- int i;
-
- drmGetLock(mmesa->driFd, mmesa->hHWContext, flags);
-
- if (*(dPriv->pStamp) != mmesa->lastStamp) {
- mmesa->lastStamp = *(dPriv->pStamp);
- mmesa->SetupNewInputs |= VERT_BIT_POS;
- mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK);
- mgaUpdateRects( mmesa, (MGA_FRONT|MGA_BACK) );
- }
-
- mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
-
- mmesa->sarea->dirty |= MGA_UPLOAD_CONTEXT;
-
- if (sarea->ctxOwner != me) {
- mmesa->dirty |= (MGA_UPLOAD_CONTEXT | MGA_UPLOAD_TEX0 |
- MGA_UPLOAD_TEX1 | MGA_UPLOAD_PIPE);
- sarea->ctxOwner=me;
- }
-
- for ( i = 0 ; i < mmesa->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( mmesa->texture_heaps[ i ] );
- }
-}
-
-
-static const struct __DriverAPIRec mgaAPI = {
- .InitDriver = mgaInitDriver,
- .DestroyScreen = mgaDestroyScreen,
- .CreateContext = mgaCreateContext,
- .DestroyContext = mgaDestroyContext,
- .CreateBuffer = mgaCreateBuffer,
- .DestroyBuffer = mgaDestroyBuffer,
- .SwapBuffers = mgaSwapBuffers,
- .MakeCurrent = mgaMakeCurrent,
- .UnbindContext = mgaUnbindContext,
- .GetSwapInfo = getSwapInfo,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 2, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 3, 0, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "MGA",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &mgaAPI);
- if ( psp != NULL ) {
- MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
- *driver_modes = mgaFillInModes( dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- driInitExtensions( NULL, g400_extensions, GL_FALSE );
- driInitSingleExtension( NULL, ARB_vp_extension );
- driInitExtensions( NULL, NV_vp_extensions, GL_FALSE );
-
- }
-
- return (void *) psp;
-}
-
-
-/**
- * Get information about previous buffer swaps.
- */
-static int
-getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo )
-{
- mgaContextPtr mmesa;
-
- if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL)
- || (dPriv->driContextPriv->driverPrivate == NULL)
- || (sInfo == NULL) ) {
- return -1;
- }
-
- mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate;
- sInfo->swap_count = mmesa->swap_count;
- sInfo->swap_ust = mmesa->swap_ust;
- sInfo->swap_missed_count = mmesa->swap_missed_count;
-
- sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
- ? driCalculateSwapUsage( dPriv, 0, mmesa->swap_missed_ust )
- : 0.0;
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.h
deleted file mode 100644
index 0ab0c63f7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */
-
-#ifndef _MGA_INIT_H_
-#define _MGA_INIT_H_
-
-#include <sys/time.h>
-#include "dri_util.h"
-#include "mga_drm.h"
-#include "mtypes.h"
-#include "mgaregs.h"
-#include "xmlconfig.h"
-
-typedef struct mga_screen_private_s {
- /**
- * Chipset "family" of this card. Currently only \c MGA_CARD_TYPE_G200 and
- * \c MGA_CARD_TYPE_G400 are possible.
- */
- int chipset;
-
-
- /**
- * Characters (bytes) per-pixel for both the front and back buffers.
- *
- * \note
- * This is also implicitly the bytes per-pixel for the depth-buffer.
- */
- int cpp;
-
- GLint agpMode;
- unsigned int irq; /**< IRQ number (0 means none) */
-
- unsigned int frontOffset;
- unsigned int frontPitch;
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- unsigned int textureOffset[MGA_NR_TEX_HEAPS];
- unsigned int textureSize[MGA_NR_TEX_HEAPS];
- char *texVirtual[MGA_NR_TEX_HEAPS];
-
-
- __DRIscreenPrivate *sPriv;
- drmBufMapPtr bufs;
-
- drmRegion mmio;
- drmRegion primary;
- unsigned int sarea_priv_offset;
-
- /** Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} mgaScreenPrivate;
-
-
-/**
- * mgaRenderbuffer, derived from Mesa's gl_renderbuffer
- */
-typedef struct {
- struct gl_renderbuffer Base;
- /* XXX per-window info should go here */
- int foo, bar;
-} mgaRenderbuffer;
-
-
-
-#include "mgacontext.h"
-
-extern void mgaGetLock( mgaContextPtr mmesa, GLuint flags );
-extern void mgaEmitHwStateLocked( mgaContextPtr mmesa );
-extern void mgaEmitScissorValues( mgaContextPtr mmesa, int box_nr, int emit );
-
-#define GET_DISPATCH_AGE( mmesa ) mmesa->sarea->last_dispatch
-
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( mmesa ) \
- do { \
- char __ret=0; \
- DRM_CAS(mmesa->driHwLock, mmesa->hHWContext, \
- (DRM_LOCK_HELD|mmesa->hHWContext), __ret); \
- if (__ret) \
- mgaGetLock( mmesa, 0 ); \
- } while (0)
-
-
-/*
- */
-#define LOCK_HARDWARE_QUIESCENT( mmesa ) do { \
- LOCK_HARDWARE( mmesa ); \
- UPDATE_LOCK( mmesa, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH ); \
-} while (0)
-
-
-/* Unlock the hardware using the global current context
- */
-#define UNLOCK_HARDWARE(mmesa) \
- DRM_UNLOCK(mmesa->driFd, mmesa->driHwLock, mmesa->hHWContext);
-
-
-/* Freshen our snapshot of the drawables
- */
-#define REFRESH_DRAWABLE_INFO( mmesa ) \
-do { \
- LOCK_HARDWARE( mmesa ); \
- mmesa->lastX = mmesa->drawX; \
- mmesa->lastY = mmesa->drawY; \
- UNLOCK_HARDWARE( mmesa ); \
-} while (0)
-
-
-#define GET_DRAWABLE_LOCK( mmesa ) while(0)
-#define RELEASE_DRAWABLE_LOCK( mmesa ) while(0)
-
-
-/* The 2D driver macros are busted -- we can't use them here as they
- * rely on the 2D driver data structures rather than taking an explicit
- * base address.
- */
-#define MGA_BASE( reg ) ((unsigned long)(mmesa->mgaScreen->mmio.map))
-#define MGA_ADDR( reg ) (MGA_BASE(reg) + reg)
-
-#define MGA_DEREF( reg ) *(volatile u_int32_t *)MGA_ADDR( reg )
-#define MGA_READ( reg ) MGA_DEREF( reg )
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgacontext.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgacontext.h
deleted file mode 100644
index 81348b6c7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgacontext.h
+++ /dev/null
@@ -1,372 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.7 2002/12/16 16:18:52 dawes Exp $*/
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef MGALIB_INC
-#define MGALIB_INC
-
-#include <stdint.h>
-#include "drm.h"
-#include "mga_drm.h"
-#include "dri_util.h"
-#include "mtypes.h"
-#include "xf86drm.h"
-#include "mm.h"
-#include "colormac.h"
-#include "texmem.h"
-#include "macros.h"
-#include "xmlconfig.h"
-
-#define MGA_SET_FIELD(reg,mask,val) reg = ((reg) & (mask)) | ((val) & ~(mask))
-#define MGA_FIELD(field,val) (((val) << (field ## _SHIFT)) & ~(field ## _MASK))
-#define MGA_GET_FIELD(field, val) ((val & ~(field ## _MASK)) >> (field ## _SHIFT))
-
-#define MGA_IS_G200(mmesa) (mmesa->mgaScreen->chipset == MGA_CARD_TYPE_G200)
-#define MGA_IS_G400(mmesa) (mmesa->mgaScreen->chipset == MGA_CARD_TYPE_G400)
-
-
-/* SoftwareFallback
- * - texture env GL_BLEND -- can be fixed
- * - 1D and 3D textures
- * - incomplete textures
- * - GL_DEPTH_FUNC == GL_NEVER not in h/w
- */
-#define MGA_FALLBACK_TEXTURE 0x1
-#define MGA_FALLBACK_DRAW_BUFFER 0x2
-#define MGA_FALLBACK_READ_BUFFER 0x4
-#define MGA_FALLBACK_BLEND 0x8
-#define MGA_FALLBACK_RENDERMODE 0x10
-#define MGA_FALLBACK_STENCIL 0x20
-#define MGA_FALLBACK_DEPTH 0x40
-#define MGA_FALLBACK_BORDER_MODE 0x80
-#define MGA_FALLBACK_DISABLE 0x100
-
-
-/* Use the templated vertex formats:
- */
-#define TAG(x) mga##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef struct mga_context_t mgaContext;
-typedef struct mga_context_t *mgaContextPtr;
-
-typedef void (*mga_tri_func)( mgaContextPtr, mgaVertex *, mgaVertex *,
- mgaVertex * );
-typedef void (*mga_line_func)( mgaContextPtr, mgaVertex *, mgaVertex * );
-typedef void (*mga_point_func)( mgaContextPtr, mgaVertex * );
-
-
-
-/* Texture environment color
- */
-#define RGB_ZERO(c) (((c) & 0xffffff) == 0x000000)
-#define RGB_ONE(c) (((c) & 0xffffff) == 0xffffff)
-#define ALPHA_ZERO(c) (((c) >> 24) == 0x00)
-#define ALPHA_ONE(c) (((c) >> 24) == 0xff)
-#define RGBA_EQUAL(c) ((c) == PACK_COLOR_8888( (c) & 0xff, (c) & 0xff, \
- (c) & 0xff, (c) & 0xff ))
-
-struct mga_texture_object_s;
-struct mga_screen_private_s;
-
-#define G200_TEX_MAXLEVELS 5
-#define G400_TEX_MAXLEVELS 11
-
-typedef struct mga_texture_object_s
-{
- driTextureObject base;
-
- /* The G200 only has the ability to use 5 mipmap levels (including the
- * base level). The G400 does not have this restriction, but it still
- * only has 5 offset pointers in the hardware. The trick on the G400 is
- * upto the first 4 offset pointers point to mipmap levels. The last
- * offset pointer tells how large the preceeding mipmap is. This value is
- * then used to determine where the remaining mipmaps are.
- *
- * For example, if the first offsets[0] through offsets[2] are used as
- * pointers, then offset[3] will be the size of the mipmap pointed to by
- * offsets[2]. So mipmap level 3 will be at (offsets[2]+offsets[3]). For
- * each successive mipmap level, offsets[3] is divided by 4 and added to
- * the previous address. So mipmap level 4 will be at
- * (offsets[2]+offsets[3]+(offsets[3] / 4)).
- *
- * The last pointer is selected by setting TO_texorgoffsetsel in its
- * pointer. In the previous example, offset[2] would have
- * TO_texorgoffsetsel or'ed in before writing it to the hardware.
- *
- * In the current driver all of the mipmaps are packed together linearly
- * with mipmap level 0. Therefore offsets[0] points to the base of the
- * texture (and has TO_texorgoffsetsel or'ed in), and offsets[1] is the
- * size of the base texture.
- *
- * There is a possible optimization available here. At times the driver
- * may not be able to allocate a single block of memory for the complete
- * texture without ejecting some other textures from memory. It may be
- * possible to put some of the lower mipmap levels (i.e., the larger
- * mipmaps) in memory separate from the higher levels.
- *
- * The implementation should be fairly obvious, but getting "right" would
- * likely be non-trivial. A first allocation for the entire texture would
- * be attempted with a flag that says "don't eject other textures." If
- * that failed, an additional allocation would be attmpted for just the
- * base map. The process would repeat with the block of lower maps. The
- * tricky parts would be in detecting when some of the levels had been
- * ejected from texture memory by other textures and preventing the
- * 4th allocation (for all the smallest mipmap levels) from kicking out
- * any of the first three.
- *
- * This array holds G400_TEX_MAXLEVELS pointers to remove an if-statement
- * in a loop in mgaSetTexImages. Values past G200_TEX_MAXLEVELS are not
- * used.
- */
- GLuint offsets[G400_TEX_MAXLEVELS];
-
- int texelBytes;
- GLuint age;
-
- drm_mga_texture_regs_t setup;
-
- /* If one texture dimension wraps with GL_CLAMP and the other with
- * GL_CLAMP_TO_EDGE, we have to fallback to software. We would also have
- * to fallback for GL_CLAMP_TO_BORDER.
- */
- GLboolean border_fallback;
- /* Depending on multitxturing and environment color
- * GL_BLEND may have to be a software fallback.
- */
- GLboolean texenv_fallback;
-} mgaTextureObject_t;
-
-struct mga_hw_state {
- GLuint specen;
- GLuint cull;
- GLuint cull_dualtex;
- GLuint stencil;
- GLuint stencilctl;
- GLuint stencil_enable;
- GLuint zmode;
- GLuint rop;
- GLuint alpha_func;
- GLuint alpha_func_enable;
- GLuint blend_func;
- GLuint blend_func_enable;
- GLuint alpha_sel;
-};
-
-struct mga_context_t {
-
- GLcontext *glCtx;
- unsigned int lastStamp; /* fullscreen breaks dpriv->laststamp,
- * need to shadow it here. */
-
- /* Hardware state management
- */
- struct mga_hw_state hw;
-
- /* Bookkeeping for texturing
- */
- unsigned nr_heaps;
- driTexHeap * texture_heaps[ MGA_NR_TEX_HEAPS ];
- driTextureObject swapped;
-
- struct mga_texture_object_s *CurrentTexObj[2];
-
-
- /* Map GL texture units onto hardware.
- */
- GLuint tmu_source[2];
-
- int texture_depth;
-
- /* Manage fallbacks
- */
- GLuint Fallback;
-
- /* Texture environment color.
- */
- unsigned int envcolor[2];
- GLboolean fcol_used;
- GLboolean force_dualtex;
-
- /* Rasterization state
- */
- GLuint SetupNewInputs;
- GLuint SetupIndex;
- GLuint RenderIndex;
-
- GLuint hw_primitive;
- GLenum raster_primitive;
- GLenum render_primitive;
-
- GLubyte *verts;
- GLint vertex_stride_shift;
- GLuint vertex_format;
- GLuint vertex_size;
-
- /* Fallback rasterization functions
- */
- mga_point_func draw_point;
- mga_line_func draw_line;
- mga_tri_func draw_tri;
-
-
- /* Manage driver and hardware state
- */
- GLuint NewGLState;
- GLuint dirty;
-
- drm_mga_context_regs_t setup;
-
- GLuint ClearColor;
- GLuint ClearDepth;
- GLuint poly_stipple;
- GLfloat depth_scale;
-
- GLuint depth_clear_mask;
- GLuint stencil_clear_mask;
- GLuint hw_stencil;
- GLuint haveHwStipple;
- GLfloat hw_viewport[16];
-
- /* Dma buffers
- */
- drmBufPtr vertex_dma_buffer;
- drmBufPtr iload_buffer;
-
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
- int64_t swap_ust;
- int64_t swap_missed_ust;
-
- GLuint swap_count;
- GLuint swap_missed_count;
-
- uint32_t last_frame_fence;
-
- /* Drawable, cliprect and scissor information
- */
- int dirty_cliprects; /* which sets of cliprects are uptodate? */
- int draw_buffer; /* which buffer are we rendering to */
- unsigned int drawOffset; /* draw buffer address in space */
- int readOffset;
- int drawX, drawY; /* origin of drawable in draw buffer */
- int lastX, lastY; /* detect DSTORG bug */
- GLuint numClipRects; /* cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
- drm_clip_rect_t draw_rect;
- drm_clip_rect_t scissor_rect;
- int scissor;
-
- drm_clip_rect_t tmp_boxes[2][MGA_NR_SAREA_CLIPRECTS];
-
-
- /* Texture aging and DMA based aging.
- */
- unsigned int texAge[MGA_NR_TEX_HEAPS];/* texture LRU age */
- unsigned int dirtyAge; /* buffer age for synchronization */
-
- GLuint primary_offset;
-
- /* Mirrors of some DRI state.
- */
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
- __DRIdrawablePrivate *driDrawable;
- __DRIdrawablePrivate *driReadable;
-
- /**
- * Drawable used by Mesa for software fallbacks for reading and
- * writing. It is set by Mesa's \c SetBuffer callback, and will always be
- * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable.
- */
- __DRIdrawablePrivate *mesa_drawable;
-
- __DRIscreenPrivate *driScreen;
- struct mga_screen_private_s *mgaScreen;
- drm_mga_sarea_t *sarea;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-};
-
-#define MGA_CONTEXT(ctx) ((mgaContextPtr)(ctx->DriverCtx))
-
-
-
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-
-#if DO_DEBUG
-extern int MGA_DEBUG;
-#else
-#define MGA_DEBUG 0
-#endif
-
-#define DEBUG_VERBOSE_MSG 0x01
-#define DEBUG_VERBOSE_DRI 0x02
-#define DEBUG_VERBOSE_IOCTL 0x04
-#define DEBUG_VERBOSE_TEXTURE 0x08
-#define DEBUG_VERBOSE_FALLBACK 0x10
-
-static __inline__ GLuint mgaPackColor(GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a)
-{
- switch (cpp) {
- case 2:
- return PACK_COLOR_565( r, g, b );
- case 4:
- return PACK_COLOR_8888( a, r, g, b );
- default:
- return 0;
- }
-}
-
-
-/*
- * Subpixel offsets for window coordinates:
- */
-#define SUBPIXEL_X (-0.5F)
-#define SUBPIXEL_Y (-0.5F + 0.125)
-
-
-#define MGA_WA_TRIANGLES 0x18000000
-#define MGA_WA_TRISTRIP_T0 0x02010200
-#define MGA_WA_TRIFAN_T0 0x01000408
-#define MGA_WA_TRISTRIP_T0T1 0x02010400
-#define MGA_WA_TRIFAN_T0T1 0x01000810
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.c
deleted file mode 100644
index 8532ea95f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.14 2002/10/30 12:51:35 alanh Exp $ */
-
-
-#include "mtypes.h"
-#include "framebuffer.h"
-
-#include "mm.h"
-#include "mgacontext.h"
-#include "mgadd.h"
-#include "mgastate.h"
-#include "mgaspan.h"
-#include "mgatex.h"
-#include "mgatris.h"
-#include "mgavb.h"
-#include "mga_xmesa.h"
-#include "utils.h"
-
-#define DRIVER_DATE "20050609"
-
-
-/***************************************
- * Mesa's Driver Functions
- ***************************************/
-
-
-static const GLubyte *mgaGetString( GLcontext *ctx, GLenum name )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- static char buffer[128];
- unsigned offset;
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *) "VA Linux Systems Inc.";
-
- case GL_RENDERER:
- offset = driGetRendererString( buffer,
- MGA_IS_G400(mmesa) ? "G400" :
- MGA_IS_G200(mmesa) ? "G200" : "MGA",
- DRIVER_DATE,
- mmesa->mgaScreen->agpMode );
-
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-
-static void mgaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE( mmesa );
- *width = mmesa->driDrawable->w;
- *height = mmesa->driDrawable->h;
- UNLOCK_HARDWARE( mmesa );
-}
-
-
-void mgaInitDriverFuncs( struct dd_function_table *functions )
-{
- functions->GetBufferSize = mgaBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = mgaGetString;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.h
deleted file mode 100644
index f98bfdc87..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgadd.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.h,v 1.3 2002/10/30 12:51:35 alanh Exp $ */
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef MGADD_INC
-#define MGADD_INC
-
-#include "context.h"
-
-extern void mgaInitDriverFuncs( struct dd_function_table *functions );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.c
deleted file mode 100644
index df253d159..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.c
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file mgaioctl.c
- * MGA IOCTL related wrapper functions.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- * \author Gareth Hughes <gareth@valinux.com>
- */
-
-#include <errno.h>
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-#include "drm.h"
-#include "mga_drm.h"
-#include "mgacontext.h"
-#include "mgadd.h"
-#include "mgastate.h"
-#include "mgatex.h"
-#include "mgavb.h"
-#include "mgaioctl.h"
-#include "mgatris.h"
-
-#include "vblank.h"
-
-
-int
-mgaSetFence( mgaContextPtr mmesa, uint32_t * fence )
-{
- int ret = ENOSYS;
-
- if ( mmesa->driScreen->drmMinor >= 2 ) {
- ret = drmCommandWriteRead( mmesa->driScreen->fd, DRM_MGA_SET_FENCE,
- fence, sizeof( uint32_t ));
- if (ret) {
- fprintf(stderr, "drmMgaSetFence: %d\n", ret);
- exit(1);
- }
- }
-
- return ret;
-}
-
-
-int
-mgaWaitFence( mgaContextPtr mmesa, uint32_t fence, uint32_t * curr_fence )
-{
- int ret = ENOSYS;
-
- if ( mmesa->driScreen->drmMinor >= 2 ) {
- uint32_t temp = fence;
-
- ret = drmCommandWriteRead( mmesa->driScreen->fd,
- DRM_MGA_WAIT_FENCE,
- & temp, sizeof( uint32_t ));
- if (ret) {
- fprintf(stderr, "drmMgaSetFence: %d\n", ret);
- exit(1);
- }
-
- if ( curr_fence ) {
- *curr_fence = temp;
- }
- }
-
- return ret;
-}
-
-
-static void mga_iload_dma_ioctl(mgaContextPtr mmesa,
- unsigned long dest,
- int length)
-{
- drmBufPtr buf = mmesa->iload_buffer;
- drm_mga_iload_t iload;
- int ret, i;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "DRM_IOCTL_MGA_ILOAD idx %d dst %x length %d\n",
- buf->idx, (int) dest, length);
-
- if ( (length & MGA_ILOAD_MASK) != 0 ) {
- UNLOCK_HARDWARE( mmesa );
- fprintf( stderr, "%s: Invalid ILOAD datasize (%d), must be "
- "multiple of %u.\n", __FUNCTION__, length, MGA_ILOAD_ALIGN );
- exit( 1 );
- }
-
- iload.idx = buf->idx;
- iload.dstorg = dest;
- iload.length = length;
-
- i = 0;
- do {
- ret = drmCommandWrite( mmesa->driFd, DRM_MGA_ILOAD,
- &iload, sizeof(iload) );
- } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
-
- if ( ret < 0 ) {
- printf("send iload retcode = %d\n", ret);
- exit(1);
- }
-
- mmesa->iload_buffer = 0;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "finished iload dma put\n");
-
-}
-
-drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa )
-{
- int idx = 0;
- int size = 0;
- drmDMAReq dma;
- int retcode;
- drmBufPtr buf;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "Getting dma buffer\n");
-
- dma.context = mmesa->hHWContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = MGA_BUFFER_SIZE;
- dma.request_list = &idx;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "drmDMA (get) ctx %d count %d size 0x%x\n",
- dma.context, dma.request_count,
- dma.request_size);
-
- while (1) {
- retcode = drmDMA(mmesa->driFd, &dma);
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "retcode %d sz %d idx %d count %d\n",
- retcode,
- dma.request_sizes[0],
- dma.request_list[0],
- dma.granted_count);
-
- if (retcode == 0 &&
- dma.request_sizes[0] &&
- dma.granted_count)
- break;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "\n\nflush");
-
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT );
- }
-
- buf = &(mmesa->mgaScreen->bufs->list[idx]);
- buf->used = 0;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr,
- "drmDMA (get) returns size[0] 0x%x idx[0] %d\n"
- "dma_buffer now: buf idx: %d size: %d used: %d addr %p\n",
- dma.request_sizes[0], dma.request_list[0],
- buf->idx, buf->total,
- buf->used, buf->address);
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "finished getbuffer\n");
-
- return buf;
-}
-
-
-
-
-static void
-mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- GLuint flags = 0;
- GLuint clear_color = mmesa->ClearColor;
- GLuint clear_depth = 0;
- GLuint color_mask = 0;
- GLuint depth_mask = 0;
- int ret;
- int i;
- static int nrclears;
- drm_mga_clear_t clear;
-
- FLUSH_BATCH( mmesa );
-
- if ( mask & BUFFER_BIT_FRONT_LEFT ) {
- flags |= MGA_FRONT;
- color_mask = mmesa->setup.plnwt;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ( mask & BUFFER_BIT_BACK_LEFT ) {
- flags |= MGA_BACK;
- color_mask = mmesa->setup.plnwt;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ( (mask & BUFFER_BIT_DEPTH) && ctx->Depth.Mask ) {
- flags |= MGA_DEPTH;
- clear_depth = (mmesa->ClearDepth & mmesa->depth_clear_mask);
- depth_mask |= mmesa->depth_clear_mask;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if ( (mask & BUFFER_BIT_STENCIL) && mmesa->hw_stencil ) {
- flags |= MGA_DEPTH;
- clear_depth |= (ctx->Stencil.Clear & mmesa->stencil_clear_mask);
- depth_mask |= mmesa->stencil_clear_mask;
- mask &= ~BUFFER_BIT_STENCIL;
- }
-
- if ( flags ) {
- LOCK_HARDWARE( mmesa );
-
- if ( mmesa->dirty_cliprects )
- mgaUpdateRects( mmesa, (MGA_FRONT | MGA_BACK) );
-
- /* flip top to bottom */
- cy = dPriv->h-cy-ch;
- cx += mmesa->drawX;
- cy += mmesa->drawY;
-
- if ( MGA_DEBUG & DEBUG_VERBOSE_IOCTL )
- fprintf( stderr, "Clear, bufs %x nbox %d\n",
- (int)flags, (int)mmesa->numClipRects );
-
- for (i = 0 ; i < mmesa->numClipRects ; )
- {
- int nr = MIN2(i + MGA_NR_SAREA_CLIPRECTS, mmesa->numClipRects);
- drm_clip_rect_t *box = mmesa->pClipRects;
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- int n = 0;
-
- if (!all) {
- for ( ; i < nr ; i++) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if (x < cx) w -= cx - x, x = cx;
- if (y < cy) h -= cy - y, y = cy;
- if (x + w > cx + cw) w = cx + cw - x;
- if (y + h > cy + ch) h = cy + ch - y;
- if (w <= 0) continue;
- if (h <= 0) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++) {
- *b++ = box[i];
- n++;
- }
- }
-
-
- if ( MGA_DEBUG & DEBUG_VERBOSE_IOCTL )
- fprintf( stderr,
- "DRM_IOCTL_MGA_CLEAR flag 0x%x color %x depth %x nbox %d\n",
- flags, clear_color, clear_depth, mmesa->sarea->nbox );
-
- mmesa->sarea->nbox = n;
-
- clear.flags = flags;
- clear.clear_color = clear_color;
- clear.clear_depth = clear_depth;
- clear.color_mask = color_mask;
- clear.depth_mask = depth_mask;
- ret = drmCommandWrite( mmesa->driFd, DRM_MGA_CLEAR,
- &clear, sizeof(clear));
- if ( ret ) {
- fprintf( stderr, "send clear retcode = %d\n", ret );
- exit( 1 );
- }
- if ( MGA_DEBUG & DEBUG_VERBOSE_IOCTL )
- fprintf( stderr, "finished clear %d\n", ++nrclears );
- }
-
- UNLOCK_HARDWARE( mmesa );
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS|MGA_UPLOAD_CONTEXT;
- }
-
- if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-}
-
-
-/**
- * Wait for the previous frame of rendering has completed.
- *
- * \param mmesa Hardware context pointer.
- *
- * \bug
- * The loop in this function should have some sort of a timeout mechanism.
- *
- * \warning
- * This routine used to assume that the hardware lock was held on entry. It
- * now assumes that the lock is \b not held on entry.
- */
-
-static void mgaWaitForFrameCompletion( mgaContextPtr mmesa )
-{
- if ( mgaWaitFence( mmesa, mmesa->last_frame_fence, NULL ) == ENOSYS ) {
- unsigned wait = 0;
- GLuint last_frame;
- GLuint last_wrap;
-
-
- LOCK_HARDWARE( mmesa );
- last_frame = mmesa->sarea->last_frame.head;
- last_wrap = mmesa->sarea->last_frame.wrap;
-
- /* The DMA routines in the kernel track a couple values in the SAREA
- * that we use here. The number of times that the primary DMA buffer
- * has "wrapped" around is tracked in last_wrap. In addition, the
- * wrap count and the buffer position at the end of the last frame are
- * stored in last_frame.wrap and last_frame.head.
- *
- * By comparing the wrap counts and the current DMA pointer value
- * (read directly from the hardware) to last_frame.head, we can
- * determine when the graphics processor has processed all of the
- * commands for the last frame.
- *
- * In this case "last frame" means the frame of the *previous* swap-
- * buffers call. This is done to prevent queuing a second buffer swap
- * before the previous swap is executed.
- */
- while ( 1 ) {
- if ( last_wrap < mmesa->sarea->last_wrap ||
- ( last_wrap == mmesa->sarea->last_wrap &&
- last_frame <= (MGA_READ( MGAREG_PRIMADDRESS ) -
- mmesa->primary_offset) ) ) {
- break;
- }
- if ( 0 ) {
- wait++;
- fprintf( stderr, " last: head=0x%06x wrap=%d\n",
- last_frame, last_wrap );
- fprintf( stderr, " head: head=0x%06lx wrap=%d\n",
- (long)(MGA_READ( MGAREG_PRIMADDRESS ) - mmesa->primary_offset),
- mmesa->sarea->last_wrap );
- }
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
-
- UNLOCK_HARDWARE( mmesa );
- DO_USLEEP( 1 );
- LOCK_HARDWARE( mmesa );
- }
- if ( wait )
- fprintf( stderr, "\n" );
-
- UNLOCK_HARDWARE( mmesa );
- }
-}
-
-
-/*
- * Copy the back buffer to the front buffer.
- */
-void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- mgaContextPtr mmesa;
- drm_clip_rect_t *pbox;
- GLint nbox;
- GLint ret;
- GLint i;
- GLboolean missed_target;
-
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate;
-
- FLUSH_BATCH( mmesa );
-
- mgaWaitForFrameCompletion( mmesa );
- driWaitForVBlank( dPriv, & mmesa->vbl_seq, mmesa->vblank_flags,
- & missed_target );
- if ( missed_target ) {
- mmesa->swap_missed_count++;
- (void) (*dri_interface->getUST)( & mmesa->swap_missed_ust );
- }
- LOCK_HARDWARE( mmesa );
-
- /* Use the frontbuffer cliprects
- */
- if (mmesa->dirty_cliprects & MGA_FRONT)
- mgaUpdateRects( mmesa, MGA_FRONT );
-
-
- pbox = dPriv->pClipRects;
- nbox = dPriv->numClipRects;
-
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + MGA_NR_SAREA_CLIPRECTS, dPriv->numClipRects);
- drm_clip_rect_t *b = mmesa->sarea->boxes;
-
- mmesa->sarea->nbox = nr - i;
-
- for ( ; i < nr ; i++)
- *b++ = pbox[i];
-
- if (0)
- fprintf(stderr, "DRM_IOCTL_MGA_SWAP\n");
-
- ret = drmCommandNone( mmesa->driFd, DRM_MGA_SWAP );
- if ( ret ) {
- printf("send swap retcode = %d\n", ret);
- exit(1);
- }
- }
-
- (void) mgaSetFence( mmesa, & mmesa->last_frame_fence );
- UNLOCK_HARDWARE( mmesa );
-
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
- mmesa->swap_count++;
- (void) (*dri_interface->getUST)( & mmesa->swap_ust );
-}
-
-
-/**
- * Implement the hardware-specific portion of \c glFinish.
- *
- * Flushes all pending commands to the hardware and wait for them to finish.
- *
- * \param ctx Context where the \c glFinish command was issued.
- *
- * \sa glFinish, mgaFlush, mgaFlushDMA
- */
-static void mgaFinish( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- uint32_t fence;
-
-
- LOCK_HARDWARE( mmesa );
- if ( mmesa->vertex_dma_buffer != NULL ) {
- mgaFlushVerticesLocked( mmesa );
- }
-
- if ( mgaSetFence( mmesa, & fence ) == 0 ) {
- UNLOCK_HARDWARE( mmesa );
- (void) mgaWaitFence( mmesa, fence, NULL );
- }
- else {
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) {
- fprintf(stderr, "mgaRegetLockQuiescent\n");
- }
-
- UPDATE_LOCK( mmesa, DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH );
- UNLOCK_HARDWARE( mmesa );
- }
-}
-
-
-/**
- * Flush all commands upto at least a certain point to the hardware.
- *
- * \note
- * The term "wait" in the name of this function is misleading. It doesn't
- * actually wait for anything. It just makes sure that the commands have
- * been flushed to the hardware.
- *
- * \warning
- * As the name implies, this function assumes that the hardware lock is
- * held on entry.
- */
-void mgaWaitAgeLocked( mgaContextPtr mmesa, int age )
-{
- if (GET_DISPATCH_AGE(mmesa) < age) {
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
- }
-}
-
-
-static GLboolean intersect_rect( drm_clip_rect_t *out,
- const drm_clip_rect_t *a,
- const drm_clip_rect_t *b )
-{
- *out = *a;
- if (b->x1 > out->x1) out->x1 = b->x1;
- if (b->y1 > out->y1) out->y1 = b->y1;
- if (b->x2 < out->x2) out->x2 = b->x2;
- if (b->y2 < out->y2) out->y2 = b->y2;
-
- return ((out->x1 < out->x2) && (out->y1 < out->y2));
-}
-
-
-
-
-static void age_mmesa( mgaContextPtr mmesa, int age )
-{
- if (mmesa->CurrentTexObj[0]) mmesa->CurrentTexObj[0]->age = age;
- if (mmesa->CurrentTexObj[1]) mmesa->CurrentTexObj[1]->age = age;
-}
-
-
-void mgaFlushVerticesLocked( mgaContextPtr mmesa )
-{
- drm_clip_rect_t *pbox = mmesa->pClipRects;
- int nbox = mmesa->numClipRects;
- drmBufPtr buffer = mmesa->vertex_dma_buffer;
- drm_mga_vertex_t vertex;
- int i;
-
- mmesa->vertex_dma_buffer = 0;
-
- if (!buffer)
- return;
-
- if (mmesa->dirty_cliprects & mmesa->draw_buffer)
- mgaUpdateRects( mmesa, mmesa->draw_buffer );
-
- if (mmesa->dirty & ~MGA_UPLOAD_CLIPRECTS)
- mgaEmitHwStateLocked( mmesa );
-
- /* FIXME: Workaround bug in kernel module.
- */
- mmesa->sarea->dirty |= MGA_UPLOAD_CONTEXT;
-
- if (!nbox)
- buffer->used = 0;
-
- if (nbox >= MGA_NR_SAREA_CLIPRECTS)
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
-
-#if 0
- if (!buffer->used || !(mmesa->dirty & MGA_UPLOAD_CLIPRECTS))
- {
- if (nbox == 1)
- mmesa->sarea->nbox = 0;
- else
- mmesa->sarea->nbox = nbox;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "Firing vertex -- case a nbox %d\n", nbox);
-
- vertex.idx = buffer->idx;
- vertex.used = buffer->used;
- vertex.discard = 1;
- drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX,
- &vertex, sizeof(drmMGAVertex) );
-
- age_mmesa(mmesa, mmesa->sarea->last_enqueue);
- }
- else
-#endif
- {
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + MGA_NR_SAREA_CLIPRECTS, nbox);
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- int discard = 0;
-
- if (mmesa->scissor) {
- mmesa->sarea->nbox = 0;
-
- for ( ; i < nr ; i++) {
- *b = pbox[i];
- if (intersect_rect(b, b, &mmesa->scissor_rect)) {
- mmesa->sarea->nbox++;
- b++;
- }
- }
-
- /* Culled?
- */
- if (!mmesa->sarea->nbox) {
- if (nr < nbox) continue;
- buffer->used = 0;
- }
- } else {
- mmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++)
- *b++ = pbox[i];
- }
-
- /* Finished with the buffer?
- */
- if (nr == nbox)
- discard = 1;
-
- mmesa->sarea->dirty |= MGA_UPLOAD_CLIPRECTS;
-
- vertex.idx = buffer->idx;
- vertex.used = buffer->used;
- vertex.discard = discard;
- drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX,
- &vertex, sizeof(vertex) );
-
- age_mmesa(mmesa, mmesa->sarea->last_enqueue);
- }
- }
-
- mmesa->dirty &= ~MGA_UPLOAD_CLIPRECTS;
-}
-
-void mgaFlushVertices( mgaContextPtr mmesa )
-{
- LOCK_HARDWARE( mmesa );
- mgaFlushVerticesLocked( mmesa );
- UNLOCK_HARDWARE( mmesa );
-}
-
-
-void mgaFireILoadLocked( mgaContextPtr mmesa,
- GLuint offset, GLuint length )
-{
- if (!mmesa->iload_buffer) {
- fprintf(stderr, "mgaFireILoad: no buffer\n");
- return;
- }
-
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "mgaFireILoad idx %d ofs 0x%x length %d\n",
- mmesa->iload_buffer->idx, (int)offset, (int)length );
-
- mga_iload_dma_ioctl( mmesa, offset, length );
-}
-
-void mgaGetILoadBufferLocked( mgaContextPtr mmesa )
-{
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL)
- fprintf(stderr, "mgaGetIloadBuffer (buffer now %p)\n",
- (void *) mmesa->iload_buffer);
-
- mmesa->iload_buffer = mga_get_buffer_ioctl( mmesa );
-}
-
-
-/**
- * Implement the hardware-specific portion of \c glFlush.
- *
- * \param ctx Context to be flushed.
- *
- * \sa glFlush, mgaFinish, mgaFlushDMA
- */
-static void mgaFlush( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
-
- LOCK_HARDWARE( mmesa );
- if ( mmesa->vertex_dma_buffer != NULL ) {
- mgaFlushVerticesLocked( mmesa );
- }
-
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH );
- UNLOCK_HARDWARE( mmesa );
-}
-
-
-int mgaFlushDMA( int fd, drmLockFlags flags )
-{
- drm_lock_t lock;
- int ret, i = 0;
-
- memset( &lock, 0, sizeof(lock) );
-
- lock.flags = flags & (DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH
- | DRM_LOCK_FLUSH_ALL);
-
- do {
- ret = drmCommandWrite( fd, DRM_MGA_FLUSH, &lock, sizeof(lock) );
- } while ( ret && errno == EBUSY && i++ < DRM_MGA_IDLE_RETRY );
-
- if ( ret == 0 )
- return 0;
- if ( errno != EBUSY )
- return -errno;
-
- if ( lock.flags & DRM_LOCK_QUIESCENT ) {
- /* Only keep trying if we need quiescence.
- */
- lock.flags &= ~(DRM_LOCK_FLUSH | DRM_LOCK_FLUSH_ALL);
-
- do {
- ret = drmCommandWrite( fd, DRM_MGA_FLUSH, &lock, sizeof(lock) );
- } while ( ret && errno == EBUSY && i++ < DRM_MGA_IDLE_RETRY );
- }
-
- if ( ret == 0 ) {
- return 0;
- } else {
- return -errno;
- }
-}
-
-void mgaInitIoctlFuncs( struct dd_function_table *functions )
-{
- functions->Clear = mgaClear;
- functions->Flush = mgaFlush;
- functions->Finish = mgaFinish;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.h
deleted file mode 100644
index f3ae749ca..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaioctl.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.11 2002/10/30 12:51:36 alanh Exp $ */
-
-#ifndef MGA_IOCTL_H
-#define MGA_IOCTL_H
-
-#include "mgacontext.h"
-#include "mga_xmesa.h"
-
-void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv );
-void mgaWaitForVBlank( mgaContextPtr mmesa );
-
-void mgaGetILoadBufferLocked( mgaContextPtr mmesa );
-void mgaFireILoadLocked( mgaContextPtr mmesa,
- GLuint offset, GLuint length );
-
-void mgaWaitAgeLocked( mgaContextPtr mmesa, int age );
-
-void mgaFlushVertices( mgaContextPtr mmesa );
-void mgaFlushVerticesLocked( mgaContextPtr mmesa );
-int mgaFlushDMA( int fd, drmLockFlags flags );
-
-void mgaInitIoctlFuncs( struct dd_function_table *functions );
-
-#define FLUSH_BATCH(mmesa) do { \
- if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) \
- fprintf(stderr, "FLUSH_BATCH in %s\n", __FUNCTION__); \
- if (mmesa->vertex_dma_buffer) mgaFlushVertices(mmesa); \
-} while (0)
-
-#define MGA_STATECHANGE(mmesa, flag) do { \
- FLUSH_BATCH(mmesa); \
- mmesa->dirty |= flag; \
-} while (0)
-
-
-extern drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa );
-
-static __inline
-GLuint *mgaAllocDmaLow( mgaContextPtr mmesa, int bytes )
-{
- GLuint *head;
-
- /* If there is no DMA buffer currently allocated or the currently
- * allocated DMA buffer doesn't have enough room left for this request,
- * a new buffer will need to be allocated.
- */
- if ( (mmesa->vertex_dma_buffer == NULL)
- || ((mmesa->vertex_dma_buffer->used + bytes)
- > mmesa->vertex_dma_buffer->total) ) {
- LOCK_HARDWARE( mmesa );
-
- /* In the case where the existing buffer does not have enough room,
- * we need to flush it out to the hardware.
- */
- if ( mmesa->vertex_dma_buffer != NULL ) {
- mgaFlushVerticesLocked( mmesa );
- }
-
- mmesa->vertex_dma_buffer = mga_get_buffer_ioctl( mmesa );
- UNLOCK_HARDWARE( mmesa );
- }
-
- head = (GLuint *)((char *)mmesa->vertex_dma_buffer->address +
- mmesa->vertex_dma_buffer->used);
-
- mmesa->vertex_dma_buffer->used += bytes;
- return head;
-}
-
-
-#define UPDATE_LOCK( mmesa, flags ) \
-do { \
- GLint ret = mgaFlushDMA( mmesa->driFd, flags ); \
- if ( ret < 0 ) { \
- drmCommandNone( mmesa->driFd, DRM_MGA_RESET ); \
- UNLOCK_HARDWARE( mmesa ); \
- fprintf( stderr, "%s: flush return = %s (%d), flags = 0x%08x\n", \
- __FUNCTION__, strerror( -ret ), -ret, \
- (unsigned)(flags) ); \
- exit( 1 ); \
- } \
-} while (0)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.c
deleted file mode 100644
index 952b8d563..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.c
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * Copyright 2000 Compaq Computer Inc. and VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file mgapixel.c
- * Implement framebuffer pixel operations for MGA.
- *
- * \todo
- * Someday the accelerated \c glReadPixels and \c glDrawPixels paths need to
- * be resurrected. They are currently ifdef'ed out because they don't seem
- * to work and they only get activated some very rare circumstances.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- * \author Gareth Hughes <gareth@valinux.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.9 2002/11/05 17:46:08 tsi Exp $ */
-
-#include "mtypes.h"
-#include "macros.h"
-#include "mgadd.h"
-#include "mgacontext.h"
-#include "mgaioctl.h"
-#include "mgapixel.h"
-#include "mgastate.h"
-
-#include "swrast/swrast.h"
-#include "imports.h"
-
-#if 0
-#define IS_AGP_MEM( mmesa, p ) \
- ((unsigned long)mmesa->mgaScreen->buffers.map <= ((unsigned long)p) && \
- (unsigned long)mmesa->mgaScreen->buffers.map + \
- (unsigned long)mmesa->mgaScreen->buffers.size > ((unsigned long)p))
-#define AGP_OFFSET( mmesa, p ) \
- (((unsigned long)p) - (unsigned long)mmesa->mgaScreen->buffers.map)
-
-
-#if defined(MESA_packed_depth_stencil)
-static GLboolean
-check_depth_stencil_24_8( const GLcontext *ctx, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- const void *pixels, GLint sz,
- GLint pitch )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- return ( type == GL_UNSIGNED_INT_24_8_MESA &&
- ctx->Visual->DepthBits == 24 &&
- ctx->Visual->StencilBits == 8 &&
- mmesa->mgaScreen->cpp == 4 &&
- mmesa->hw_stencil &&
- !ctx->Pixel.IndexShift &&
- !ctx->Pixel.IndexOffset &&
- !ctx->Pixel.MapStencilFlag &&
- ctx->Pixel.DepthBias == 0.0 &&
- ctx->Pixel.DepthScale == 1.0 &&
- !packing->SwapBytes &&
- pitch % 32 == 0 &&
- pitch < 4096 );
-}
-#endif
-
-
-static GLboolean
-check_depth( const GLcontext *ctx, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- const void *pixels, GLint sz, GLint pitch )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- if ( IS_AGP_MEM( mmesa, pixels ) &&
- !( ( type == GL_UNSIGNED_INT && mmesa->mgaScreen->cpp == 4 ) ||
- ( type == GL_UNSIGNED_SHORT && mmesa->mgaScreen->cpp == 2 ) ) )
- return GL_FALSE;
-
- return ( ctx->Pixel.DepthBias == 0.0 &&
- ctx->Pixel.DepthScale == 1.0 &&
- !packing->SwapBytes &&
- pitch % 32 == 0 &&
- pitch < 4096 );
-}
-
-
-static GLboolean
-check_color( const GLcontext *ctx, GLenum type, GLenum format,
- const struct gl_pixelstore_attrib *packing,
- const void *pixels, GLint sz, GLint pitch )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint cpp = mmesa->mgaScreen->cpp;
-
- /* Can't do conversions on agp reads/draws.
- */
- if ( IS_AGP_MEM( mmesa, pixels ) &&
- !( pitch % 32 == 0 && pitch < 4096 &&
- ( ( type == GL_UNSIGNED_BYTE &&
- cpp == 4 && format == GL_BGRA ) ||
- ( type == GL_UNSIGNED_INT_8_8_8_8 &&
- cpp == 4 && format == GL_BGRA ) ||
- ( type == GL_UNSIGNED_SHORT_5_6_5_REV &&
- cpp == 2 && format == GL_RGB ) ) ) )
- return GL_FALSE;
-
- return (!ctx->_ImageTransferState &&
- !packing->SwapBytes &&
- !packing->LsbFirst);
-}
-
-static GLboolean
-check_color_per_fragment_ops( const GLcontext *ctx )
-{
- return (!( ctx->Color.AlphaEnabled ||
- ctx->Depth.Test ||
- ctx->Fog.Enabled ||
- ctx->Scissor.Enabled ||
- ctx->Stencil.Enabled ||
- !ctx->Color.ColorMask[0] ||
- !ctx->Color.ColorMask[1] ||
- !ctx->Color.ColorMask[2] ||
- !ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits ||
- ctx->Depth.OcclusionTest
- ) &&
- ctx->Current.RasterPosValid &&
- ctx->Pixel.ZoomX == 1.0F &&
- (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F));
-}
-
-static GLboolean
-check_depth_per_fragment_ops( const GLcontext *ctx )
-{
- return ( ctx->Current.RasterPosValid &&
- ctx->Color.ColorMask[RCOMP] == 0 &&
- ctx->Color.ColorMask[BCOMP] == 0 &&
- ctx->Color.ColorMask[GCOMP] == 0 &&
- ctx->Color.ColorMask[ACOMP] == 0 &&
- ctx->Pixel.ZoomX == 1.0F &&
- ( ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F ) );
-}
-
-/* In addition to the requirements for depth:
- */
-#if defined(MESA_packed_depth_stencil)
-static GLboolean
-check_stencil_per_fragment_ops( const GLcontext *ctx )
-{
- return ( !ctx->Pixel.IndexShift &&
- !ctx->Pixel.IndexOffset );
-}
-#endif
-
-
-static GLboolean
-clip_pixelrect( const GLcontext *ctx,
- const GLframebuffer *buffer,
- GLint *x, GLint *y,
- GLsizei *width, GLsizei *height,
- GLint *skipPixels, GLint *skipRows,
- GLint *size )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- *width = MIN2(*width, MAX_WIDTH); /* redundant? */
-
- /* left clipping */
- if (*x < buffer->_Xmin) {
- *skipPixels += (buffer->_Xmin - *x);
- *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) {
- *skipRows += (buffer->_Ymin - *y);
- *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;
-
- *size = ((*y + *height - 1) * mmesa->mgaScreen->frontPitch +
- (*x + *width - 1) * mmesa->mgaScreen->cpp);
-
- return GL_TRUE;
-}
-
-static GLboolean
-mgaTryReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLint size, skipPixels, skipRows;
- GLint pitch = pack->RowLength ? pack->RowLength : width;
- GLboolean ok;
-
- GLuint planemask;
- GLuint source;
-#if 0
- drmMGABlit blit;
- GLuint dest;
- GLint source_pitch, dest_pitch;
- GLint delta_sx, delta_sy;
- GLint delta_dx, delta_dy;
- GLint blit_height, ydir;
-#endif
-
- if (!clip_pixelrect(ctx, ctx->ReadBuffer,
- &x, &y, &width, &height,
- &skipPixels, &skipRows, &size)) {
- return GL_TRUE;
- }
-
- /* Only accelerate reading to agp buffers.
- */
- if ( !IS_AGP_MEM(mmesa, (char *)pixels) ||
- !IS_AGP_MEM(mmesa, (char *)pixels + size) )
- return GL_FALSE;
-
- switch (format) {
-#if defined(MESA_packed_depth_stencil)
- case GL_DEPTH_STENCIL_MESA:
- ok = check_depth_stencil_24_8(ctx, type, pack, pixels, size, pitch);
- planemask = ~0;
- source = mmesa->mgaScreen->depthOffset;
- break;
-#endif
-
- case GL_DEPTH_COMPONENT:
- ok = check_depth(ctx, type, pack, pixels, size, pitch);
-
- /* Can't accelerate at this depth -- planemask does the wrong
- * thing; it doesn't clear the low order bits in the
- * destination, instead it leaves them untouched.
- *
- * Could get the acclerator to solid fill the destination with
- * zeros first... Or get the cpu to do it...
- */
- if (ctx->Visual.depthBits == 24)
- return GL_FALSE;
-
- planemask = ~0;
- source = mmesa->mgaScreen->depthOffset;
- break;
-
- case GL_RGB:
- case GL_BGRA:
- ok = check_color(ctx, type, format, pack, pixels, size, pitch);
- planemask = ~0;
- source = (mmesa->draw_buffer == MGA_FRONT ?
- mmesa->mgaScreen->frontOffset :
- mmesa->mgaScreen->backOffset);
- break;
-
- default:
- return GL_FALSE;
- }
-
- if (!ok) {
- return GL_FALSE;
- }
-
-
- LOCK_HARDWARE( mmesa );
-
-#if 0
- {
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- int nbox, retcode, i;
-
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT );
-
- if (mmesa->dirty_cliprects & MGA_FRONT)
- mgaUpdateRects( mmesa, MGA_FRONT );
-
- nbox = dPriv->numClipRects;
-
- y = dPriv->h - y - height;
- x += mmesa->drawX;
- y += mmesa->drawY;
-
- dest = ((mmesa->mgaScreen->agp.handle + AGP_OFFSET(mmesa, pixels)) |
- DO_dstmap_sys | DO_dstacc_agp);
- source_pitch = mmesa->mgaScreen->frontPitch / mmesa->mgaScreen->cpp;
- dest_pitch = pitch;
- delta_sx = 0;
- delta_sy = 0;
- delta_dx = -x;
- delta_dy = -y;
- blit_height = 2*y + height;
- ydir = -1;
-
- if (0) fprintf(stderr, "XX doing readpixel blit src_pitch %d dst_pitch %d\n",
- source_pitch, dest_pitch);
-
-
-
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + MGA_NR_SAREA_CLIPRECTS, dPriv->numClipRects);
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- int n = 0;
-
- for ( ; i < nr ; i++) {
- GLint bx = box[i].x1;
- GLint by = box[i].y1;
- GLint bw = box[i].x2 - bx;
- GLint bh = box[i].y2 - by;
-
- if (bx < x) bw -= x - bx, bx = x;
- if (by < y) bh -= y - by, by = y;
- if (bx + bw > x + width) bw = x + width - bx;
- if (by + bh > y + height) bh = y + height - by;
- if (bw <= 0) continue;
- if (bh <= 0) continue;
-
- b->x1 = bx;
- b->y1 = by;
- b->x2 = bx + bw;
- b->y2 = by + bh;
- b++;
- n++;
- }
-
- mmesa->sarea->nbox = n;
-
- if (n && (retcode = drmCommandWrite( mmesa->driFd, DRM_MGA_BLIT,
- &blit, sizeof(drmMGABlit)))) {
- fprintf(stderr, "blit ioctl failed, retcode = %d\n", retcode);
- UNLOCK_HARDWARE( mmesa );
- exit(1);
- }
- }
-
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT );
- }
-#endif
-
- UNLOCK_HARDWARE( mmesa );
-
- return GL_TRUE;
-}
-
-static void
-mgaDDReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- if (!mgaTryReadPixels( ctx, x, y, width, height, format, type, pack, pixels))
- _swrast_ReadPixels( ctx, x, y, width, height, format, type, pack, pixels);
-}
-
-
-
-
-static void do_draw_pix( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint pitch,
- const void *pixels,
- GLuint dest, GLuint planemask)
-{
-#if 0
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- drmMGABlit blit;
- __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- drm_clip_rect_t pbox = dPriv->pClipRects;
- int nbox = dPriv->numClipRects;
- int retcode, i;
-
- y = dPriv->h - y - height;
- x += mmesa->drawX;
- y += mmesa->drawY;
-
- blit.dest = dest;
- blit.planemask = planemask;
- blit.source = ((mmesa->mgaScreen->agp.handle + AGP_OFFSET(mmesa, pixels))
- | SO_srcmap_sys | SO_srcacc_agp);
- blit.dest_pitch = mmesa->mgaScreen->frontPitch / mmesa->mgaScreen->cpp;
- blit.source_pitch = pitch;
- blit.delta_sx = -x;
- blit.delta_sy = -y;
- blit.delta_dx = 0;
- blit.delta_dy = 0;
- if (ctx->Pixel.ZoomY == -1) {
- blit.height = height;
- blit.ydir = 1;
- } else {
- blit.height = height;
- blit.ydir = -1;
- }
-
- if (0) fprintf(stderr,
- "doing drawpixel blit src_pitch %d dst_pitch %d\n",
- blit.source_pitch, blit.dest_pitch);
-
- for (i = 0 ; i < nbox ; )
- {
- int nr = MIN2(i + MGA_NR_SAREA_CLIPRECTS, dPriv->numClipRects);
- drm_clip_rect_t *box = mmesa->pClipRects;
- drm_clip_rect_t *b = mmesa->sarea->boxes;
- int n = 0;
-
- for ( ; i < nr ; i++) {
- GLint bx = box[i].x1;
- GLint by = box[i].y1;
- GLint bw = box[i].x2 - bx;
- GLint bh = box[i].y2 - by;
-
- if (bx < x) bw -= x - bx, bx = x;
- if (by < y) bh -= y - by, by = y;
- if (bx + bw > x + width) bw = x + width - bx;
- if (by + bh > y + height) bh = y + height - by;
- if (bw <= 0) continue;
- if (bh <= 0) continue;
-
- b->x1 = bx;
- b->y1 = by;
- b->x2 = bx + bw;
- b->y2 = by + bh;
- b++;
- n++;
- }
-
- mmesa->sarea->nbox = n;
-
- if (n && (retcode = drmCommandWrite( mmesa->driFd, DRM_MGA_BLIT,
- &blit, sizeof(drmMGABlit)))) {
- fprintf(stderr, "blit ioctl failed, retcode = %d\n", retcode);
- UNLOCK_HARDWARE( mmesa );
- exit(1);
- }
- }
-#endif
-}
-
-
-
-
-static GLboolean
-mgaTryDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLint size, skipPixels, skipRows;
- GLint pitch = unpack->RowLength ? unpack->RowLength : width;
- GLuint dest, planemask;
- GLuint cpp = mmesa->mgaScreen->cpp;
-
- if (!clip_pixelrect(ctx, ctx->DrawBuffer,
- &x, &y, &width, &height,
- &skipPixels, &skipRows, &size)) {
- return GL_TRUE;
- }
-
-
- switch (format) {
-#if defined(MESA_packed_depth_stencil)
- case GL_DEPTH_STENCIL_MESA:
- dest = mmesa->mgaScreen->depthOffset;
- planemask = ~0;
- if (!check_depth_stencil_24_8(ctx, type, unpack, pixels, size, pitch) ||
- !check_depth_per_fragment_ops(ctx) ||
- !check_stencil_per_fragment_ops(ctx))
- return GL_FALSE;
- break;
-#endif
-
- case GL_DEPTH_COMPONENT:
- dest = mmesa->mgaScreen->depthOffset;
-
- if (ctx->Visual.depthBits == 24)
- planemask = ~0xff;
- else
- planemask = ~0;
-
- if (!check_depth(ctx, type, unpack, pixels, size, pitch) ||
- !check_depth_per_fragment_ops(ctx))
- return GL_FALSE;
- break;
-
- case GL_RGB:
- case GL_BGRA:
- dest = (mmesa->draw_buffer == MGA_FRONT ?
- mmesa->mgaScreen->frontOffset :
- mmesa->mgaScreen->backOffset);
-
- planemask = mgaPackColor(cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP]);
-
- if (cpp == 2)
- planemask |= planemask << 16;
-
- if (!check_color(ctx, type, format, unpack, pixels, size, pitch)) {
- return GL_FALSE;
- }
- if (!check_color_per_fragment_ops(ctx)) {
- return GL_FALSE;
- }
- break;
-
- default:
- return GL_FALSE;
- }
-
- LOCK_HARDWARE_QUIESCENT( mmesa );
-
- if (mmesa->dirty_cliprects & MGA_FRONT)
- mgaUpdateRects( mmesa, MGA_FRONT );
-
- if ( IS_AGP_MEM(mmesa, (char *)pixels) &&
- IS_AGP_MEM(mmesa, (char *)pixels + size) )
- {
- do_draw_pix( ctx, x, y, width, height, pitch, pixels,
- dest, planemask );
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT );
- }
- else
- {
- /* Pixels is in regular memory -- get dma buffers and perform
- * upload through them.
- */
-/* drmBufPtr buf = mgaGetBufferLocked(mmesa); */
- GLuint bufferpitch = (width*cpp+31)&~31;
-
- char *address = 0; /* mmesa->mgaScreen->agp.map; */
-
- do {
-/* GLuint rows = MIN2( height, MGA_DMA_BUF_SZ / bufferpitch ); */
- GLuint rows = height;
-
-
- if (0) fprintf(stderr, "trying to upload %d rows (pitch %d)\n",
- rows, bufferpitch);
-
- /* The texture conversion code is so slow that there is only
- * negligble speedup when the buffers/images don't exactly
- * match:
- */
-#if 0
- if (cpp == 2) {
- if (!_mesa_convert_texsubimage2d( MESA_FORMAT_RGB565,
- 0, 0, width, rows,
- bufferpitch, format, type,
- unpack, pixels, address )) {
-/* mgaReleaseBufLocked( mmesa, buf ); */
- UNLOCK_HARDWARE(mmesa);
- return GL_FALSE;
- }
- } else {
- if (!_mesa_convert_texsubimage2d( MESA_FORMAT_ARGB8888,
- 0, 0, width, rows,
- bufferpitch, format, type,
- unpack, pixels, address )) {
-/* mgaReleaseBufLocked( mmesa, buf ); */
- UNLOCK_HARDWARE(mmesa);
- return GL_FALSE;
- }
- }
-#else
- MEMCPY( address, pixels, rows*bufferpitch );
-#endif
-
- do_draw_pix( ctx, x, y, width, rows,
- bufferpitch/cpp, address, dest, planemask );
-
- /* Fix me -- use multiple buffers to avoid flush.
- */
- UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT );
-
- pixels = (void *)((char *) pixels + rows * pitch);
- height -= rows;
- y += rows;
- } while (height);
-
-/* mgaReleaseBufLocked( mmesa, buf ); */
- }
-
- UNLOCK_HARDWARE( mmesa );
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
-
- return GL_TRUE;
-}
-
-static void
-mgaDDDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- if (!mgaTryDrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels ))
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
-}
-#endif
-
-
-/* Stub functions - not a real allocator, always returns pointer to
- * the same block of agp space which isn't used for anything else at
- * present.
- */
-void mgaDDInitPixelFuncs( GLcontext *ctx )
-{
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
-#if 0
- if (getenv("MGA_BLIT_PIXELS")) {
- ctx->Driver.ReadPixels = mgaDDReadPixels; /* requires agp dest */
- ctx->Driver.DrawPixels = mgaDDDrawPixels; /* works with agp/normal mem */
- }
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.h
deleted file mode 100644
index c44fd769a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgapixel.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2000-2001 Compaq Computer Inc. VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.h,v 1.5 2002/10/30 12:51:36 alanh Exp $ */
-
-#ifndef MGA_PIXELS_H
-#define MGA_PIXELS_H
-
-#include "mtypes.h"
-
-extern void mgaDDInitPixelFuncs( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaregs.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaregs.h
deleted file mode 100644
index e1291ca01..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaregs.h
+++ /dev/null
@@ -1,1395 +0,0 @@
-/* author: stephen crowley, crow@debian.org */
-
-/*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * STEPHEN CROWLEY, 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.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaregs.h,v 1.6 2003/01/12 03:55:46 tsi Exp $ */
-
-#ifndef _MGAREGS_H_
-#define _MGAREGS_H_
-
-/*************** (START) AUTOMATICLY GENERATED REGISTER FILE *****************/
-/*
- * Generated on Wed Jan 26 13:44:46 MST 2000
- */
-
-
-
-/*
- * Power Graphic Mode Memory Space Registers
- */
-
-#define MGAREG_MGA_EXEC 0x0100
-#define MGAREG_AGP_PLL 0x1e4c
-
-# define AGP_PLL_agp2xpllen_MASK 0xfffffffe /* bit 0 */
-# define AGP_PLL_agp2xpllen_disable 0x0
-# define AGP_PLL_agp2xpllen_enable 0x1
-
-#define MGAREG_CFG_OR 0x1e4c
-
-# define CFG_OR_comp_or_MASK 0xfffffff7 /* bit 3 */
-# define CFG_OR_comp_or_disable 0x0
-# define CFG_OR_comp_or_enable 0x8
-# define CFG_OR_compfreq_MASK 0xffffff0f /* bits 4-7 */
-# define CFG_OR_compfreq_SHIFT 4
-# define CFG_OR_comporup_MASK 0xfffff0ff /* bits 8-11 */
-# define CFG_OR_comporup_SHIFT 8
-# define CFG_OR_compordn_MASK 0xffff0fff /* bits 12-15 */
-# define CFG_OR_compordn_SHIFT 12
-# define CFG_OR_e2pq_MASK 0xfffeffff /* bit 16 */
-# define CFG_OR_e2pq_disable 0x0
-# define CFG_OR_e2pq_enable 0x10000
-# define CFG_OR_e2pqbypcsn_MASK 0xfffdffff /* bit 17 */
-# define CFG_OR_e2pqbypcsn_disable 0x0
-# define CFG_OR_e2pqbypcsn_enable 0x20000
-# define CFG_OR_e2pqbypd_MASK 0xfffbffff /* bit 18 */
-# define CFG_OR_e2pqbypd_disable 0x0
-# define CFG_OR_e2pqbypd_enable 0x40000
-# define CFG_OR_e2pbypclk_MASK 0xfff7ffff /* bit 19 */
-# define CFG_OR_e2pbypclk_disable 0x0
-# define CFG_OR_e2pbypclk_enable 0x80000
-# define CFG_OR_e2pbyp_MASK 0xffefffff /* bit 20 */
-# define CFG_OR_e2pbyp_disable 0x0
-# define CFG_OR_e2pbyp_enable 0x100000
-# define CFG_OR_rate_cap_or_MASK 0xff1fffff /* bits 21-23 */
-# define CFG_OR_rate_cap_or_SHIFT 21
-# define CFG_OR_rq_or_MASK 0xe0ffffff /* bits 24-28 */
-# define CFG_OR_rq_or_SHIFT 24
-
-#define MGAREG_ALPHACTRL 0x2c7c
-
-# define AC_src_MASK 0xfffffff0 /* bits 0-3 */
-# define AC_src_zero 0x0 /* val 0, shift 0 */
-# define AC_src_one 0x1 /* val 1, shift 0 */
-# define AC_src_dst_color 0x2 /* val 2, shift 0 */
-# define AC_src_om_dst_color 0x3 /* val 3, shift 0 */
-# define AC_src_src_alpha 0x4 /* val 4, shift 0 */
-# define AC_src_om_src_alpha 0x5 /* val 5, shift 0 */
-# define AC_src_dst_alpha 0x6 /* val 6, shift 0 */
-# define AC_src_om_dst_alpha 0x7 /* val 7, shift 0 */
-# define AC_src_src_alpha_sat 0x8 /* val 8, shift 0 */
-# define AC_dst_MASK 0xffffff0f /* bits 4-7 */
-# define AC_dst_zero 0x0 /* val 0, shift 4 */
-# define AC_dst_one 0x10 /* val 1, shift 4 */
-# define AC_dst_src_color 0x20 /* val 2, shift 4 */
-# define AC_dst_om_src_color 0x30 /* val 3, shift 4 */
-# define AC_dst_src_alpha 0x40 /* val 4, shift 4 */
-# define AC_dst_om_src_alpha 0x50 /* val 5, shift 4 */
-# define AC_dst_dst_alpha 0x60 /* val 6, shift 4 */
-# define AC_dst_om_dst_alpha 0x70 /* val 7, shift 4 */
-# define AC_amode_MASK 0xfffffcff /* bits 8-9 */
-# define AC_amode_FCOL 0x0 /* val 0, shift 8 */
-# define AC_amode_alpha_channel 0x100 /* val 1, shift 8 */
-# define AC_amode_video_alpha 0x200 /* val 2, shift 8 */
-# define AC_amode_RSVD 0x300 /* val 3, shift 8 */
-# define AC_astipple_MASK 0xfffff7ff /* bit 11 */
-# define AC_astipple_disable 0x0
-# define AC_astipple_enable 0x800
-# define AC_aten_MASK 0xffffefff /* bit 12 */
-# define AC_aten_disable 0x0
-# define AC_aten_enable 0x1000
-# define AC_atmode_MASK 0xffff1fff /* bits 13-15 */
-# define AC_atmode_noacmp 0x0 /* val 0, shift 13 */
-# define AC_atmode_ae 0x4000 /* val 2, shift 13 */
-# define AC_atmode_ane 0x6000 /* val 3, shift 13 */
-# define AC_atmode_alt 0x8000 /* val 4, shift 13 */
-# define AC_atmode_alte 0xa000 /* val 5, shift 13 */
-# define AC_atmode_agt 0xc000 /* val 6, shift 13 */
-# define AC_atmode_agte 0xe000 /* val 7, shift 13 */
-# define AC_atref_MASK 0xff00ffff /* bits 16-23 */
-# define AC_atref_SHIFT 16
-# define AC_alphasel_MASK 0xfcffffff /* bits 24-25 */
-# define AC_alphasel_fromtex 0x0 /* val 0, shift 24 */
-# define AC_alphasel_diffused 0x1000000 /* val 1, shift 24 */
-# define AC_alphasel_modulated 0x2000000 /* val 2, shift 24 */
-# define AC_alphasel_trans 0x3000000 /* val 3, shift 24 */
-
-#define MGAREG_ALPHASTART 0x2c70
-#define MGAREG_ALPHAXINC 0x2c74
-#define MGAREG_ALPHAYINC 0x2c78
-#define MGAREG_AR0 0x1c60
-
-# define AR0_ar0_MASK 0xfffc0000 /* bits 0-17 */
-# define AR0_ar0_SHIFT 0
-
-#define MGAREG_AR1 0x1c64
-
-# define AR1_ar1_MASK 0xff000000 /* bits 0-23 */
-# define AR1_ar1_SHIFT 0
-
-#define MGAREG_AR2 0x1c68
-
-# define AR2_ar2_MASK 0xfffc0000 /* bits 0-17 */
-# define AR2_ar2_SHIFT 0
-
-#define MGAREG_AR3 0x1c6c
-
-# define AR3_ar3_MASK 0xff000000 /* bits 0-23 */
-# define AR3_ar3_SHIFT 0
-# define AR3_spage_MASK 0xf8ffffff /* bits 24-26 */
-# define AR3_spage_SHIFT 24
-
-#define MGAREG_AR4 0x1c70
-
-# define AR4_ar4_MASK 0xfffc0000 /* bits 0-17 */
-# define AR4_ar4_SHIFT 0
-
-#define MGAREG_AR5 0x1c74
-
-# define AR5_ar5_MASK 0xfffc0000 /* bits 0-17 */
-# define AR5_ar5_SHIFT 0
-
-#define MGAREG_AR6 0x1c78
-
-# define AR6_ar6_MASK 0xfffc0000 /* bits 0-17 */
-# define AR6_ar6_SHIFT 0
-
-#define MGAREG_BCOL 0x1c20
-#define MGAREG_BESA1CORG 0x3d10
-#define MGAREG_BESA1ORG 0x3d00
-#define MGAREG_BESA2CORG 0x3d14
-#define MGAREG_BESA2ORG 0x3d04
-#define MGAREG_BESB1CORG 0x3d18
-#define MGAREG_BESB1ORG 0x3d08
-#define MGAREG_BESB2CORG 0x3d1c
-#define MGAREG_BESB2ORG 0x3d0c
-#define MGAREG_BESCTL 0x3d20
-
-# define BC_besen_MASK 0xfffffffe /* bit 0 */
-# define BC_besen_disable 0x0
-# define BC_besen_enable 0x1
-# define BC_besv1srcstp_MASK 0xffffffbf /* bit 6 */
-# define BC_besv1srcstp_even 0x0
-# define BC_besv1srcstp_odd 0x40
-# define BC_besv2srcstp_MASK 0xfffffeff /* bit 8 */
-# define BC_besv2srcstp_disable 0x0
-# define BC_besv2srcstp_enable 0x100
-# define BC_beshfen_MASK 0xfffffbff /* bit 10 */
-# define BC_beshfen_disable 0x0
-# define BC_beshfen_enable 0x400
-# define BC_besvfen_MASK 0xfffff7ff /* bit 11 */
-# define BC_besvfen_disable 0x0
-# define BC_besvfen_enable 0x800
-# define BC_beshfixc_MASK 0xffffefff /* bit 12 */
-# define BC_beshfixc_weight 0x0
-# define BC_beshfixc_coeff 0x1000
-# define BC_bescups_MASK 0xfffeffff /* bit 16 */
-# define BC_bescups_disable 0x0
-# define BC_bescups_enable 0x10000
-# define BC_bes420pl_MASK 0xfffdffff /* bit 17 */
-# define BC_bes420pl_422 0x0
-# define BC_bes420pl_420 0x20000
-# define BC_besdith_MASK 0xfffbffff /* bit 18 */
-# define BC_besdith_disable 0x0
-# define BC_besdith_enable 0x40000
-# define BC_beshmir_MASK 0xfff7ffff /* bit 19 */
-# define BC_beshmir_disable 0x0
-# define BC_beshmir_enable 0x80000
-# define BC_besbwen_MASK 0xffefffff /* bit 20 */
-# define BC_besbwen_color 0x0
-# define BC_besbwen_bw 0x100000
-# define BC_besblank_MASK 0xffdfffff /* bit 21 */
-# define BC_besblank_disable 0x0
-# define BC_besblank_enable 0x200000
-# define BC_besfselm_MASK 0xfeffffff /* bit 24 */
-# define BC_besfselm_soft 0x0
-# define BC_besfselm_hard 0x1000000
-# define BC_besfsel_MASK 0xf9ffffff /* bits 25-26 */
-# define BC_besfsel_a1 0x0 /* val 0, shift 25 */
-# define BC_besfsel_a2 0x2000000 /* val 1, shift 25 */
-# define BC_besfsel_b1 0x4000000 /* val 2, shift 25 */
-# define BC_besfsel_b2 0x6000000 /* val 3, shift 25 */
-
-#define MGAREG_BESGLOBCTL 0x3dc0
-
-# define BGC_beshzoom_MASK 0xfffffffe /* bit 0 */
-# define BGC_beshzoom_disable 0x0
-# define BGC_beshzoom_enable 0x1
-# define BGC_beshzoomf_MASK 0xfffffffd /* bit 1 */
-# define BGC_beshzoomf_disable 0x0
-# define BGC_beshzoomf_enable 0x2
-# define BGC_bescorder_MASK 0xfffffff7 /* bit 3 */
-# define BGC_bescorder_even 0x0
-# define BGC_bescorder_odd 0x8
-# define BGC_besreghup_MASK 0xffffffef /* bit 4 */
-# define BGC_besreghup_disable 0x0
-# define BGC_besreghup_enable 0x10
-# define BGC_besvcnt_MASK 0xf000ffff /* bits 16-27 */
-# define BGC_besvcnt_SHIFT 16
-
-#define MGAREG_BESHCOORD 0x3d28
-
-# define BHC_besright_MASK 0xfffff800 /* bits 0-10 */
-# define BHC_besright_SHIFT 0
-# define BHC_besleft_MASK 0xf800ffff /* bits 16-26 */
-# define BHC_besleft_SHIFT 16
-
-#define MGAREG_BESHISCAL 0x3d30
-
-# define BHISF_beshiscal_MASK 0xffe00003 /* bits 2-20 */
-# define BHISF_beshiscal_SHIFT 2
-
-#define MGAREG_BESHSRCEND 0x3d3c
-
-# define BHSE_beshsrcend_MASK 0xfc000003 /* bits 2-25 */
-# define BHSE_beshsrcend_SHIFT 2
-
-#define MGAREG_BESHSRCLST 0x3d50
-
-# define BHSL_beshsrclst_MASK 0xfc00ffff /* bits 16-25 */
-# define BHSL_beshsrclst_SHIFT 16
-
-#define MGAREG_BESHSRCST 0x3d38
-
-# define BHSS_beshsrcst_MASK 0xfc000003 /* bits 2-25 */
-# define BHSS_beshsrcst_SHIFT 2
-
-#define MGAREG_BESPITCH 0x3d24
-
-# define BP_bespitch_MASK 0xfffff000 /* bits 0-11 */
-# define BP_bespitch_SHIFT 0
-
-#define MGAREG_BESSTATUS 0x3dc4
-
-# define BS_besstat_MASK 0xfffffffc /* bits 0-1 */
-# define BS_besstat_a1 0x0 /* val 0, shift 0 */
-# define BS_besstat_a2 0x1 /* val 1, shift 0 */
-# define BS_besstat_b1 0x2 /* val 2, shift 0 */
-# define BS_besstat_b2 0x3 /* val 3, shift 0 */
-
-#define MGAREG_BESV1SRCLST 0x3d54
-
-# define BSF_besv1srclast_MASK 0xfffffc00 /* bits 0-9 */
-# define BSF_besv1srclast_SHIFT 0
-
-#define MGAREG_BESV2SRCLST 0x3d58
-
-# define BSF_besv2srclst_MASK 0xfffffc00 /* bits 0-9 */
-# define BSF_besv2srclst_SHIFT 0
-
-#define MGAREG_BESV1WGHT 0x3d48
-
-# define BSF_besv1wght_MASK 0xffff0003 /* bits 2-15 */
-# define BSF_besv1wght_SHIFT 2
-# define BSF_besv1wghts_MASK 0xfffeffff /* bit 16 */
-# define BSF_besv1wghts_disable 0x0
-# define BSF_besv1wghts_enable 0x10000
-
-#define MGAREG_BESV2WGHT 0x3d4c
-
-# define BSF_besv2wght_MASK 0xffff0003 /* bits 2-15 */
-# define BSF_besv2wght_SHIFT 2
-# define BSF_besv2wghts_MASK 0xfffeffff /* bit 16 */
-# define BSF_besv2wghts_disable 0x0
-# define BSF_besv2wghts_enable 0x10000
-
-#define MGAREG_BESVCOORD 0x3d2c
-
-# define BVC_besbot_MASK 0xfffff800 /* bits 0-10 */
-# define BVC_besbot_SHIFT 0
-# define BVC_bestop_MASK 0xf800ffff /* bits 16-26 */
-# define BVC_bestop_SHIFT 16
-
-#define MGAREG_BESVISCAL 0x3d34
-
-# define BVISF_besviscal_MASK 0xffe00003 /* bits 2-20 */
-# define BVISF_besviscal_SHIFT 2
-
-#define MGAREG_CODECADDR 0x3e44
-#define MGAREG_CODECCTL 0x3e40
-#define MGAREG_CODECHARDPTR 0x3e4c
-#define MGAREG_CODECHOSTPTR 0x3e48
-#define MGAREG_CODECLCODE 0x3e50
-#define MGAREG_CXBNDRY 0x1c80
-
-# define CXB_cxleft_MASK 0xfffff000 /* bits 0-11 */
-# define CXB_cxleft_SHIFT 0
-# define CXB_cxright_MASK 0xf000ffff /* bits 16-27 */
-# define CXB_cxright_SHIFT 16
-
-#define MGAREG_CXLEFT 0x1ca0
-#define MGAREG_CXRIGHT 0x1ca4
-#define MGAREG_DMAMAP30 0x1e30
-#define MGAREG_DMAMAP74 0x1e34
-#define MGAREG_DMAMAPB8 0x1e38
-#define MGAREG_DMAMAPFC 0x1e3c
-#define MGAREG_DMAPAD 0x1c54
-#define MGAREG_DR0_Z32LSB 0x2c50
-#define MGAREG_DR0_Z32MSB 0x2c54
-#define MGAREG_DR2_Z32LSB 0x2c60
-#define MGAREG_DR2_Z32MSB 0x2c64
-#define MGAREG_DR3_Z32LSB 0x2c68
-#define MGAREG_DR3_Z32MSB 0x2c6c
-#define MGAREG_DR0 0x1cc0
-#define MGAREG_DR2 0x1cc8
-#define MGAREG_DR3 0x1ccc
-#define MGAREG_DR4 0x1cd0
-#define MGAREG_DR6 0x1cd8
-#define MGAREG_DR7 0x1cdc
-#define MGAREG_DR8 0x1ce0
-#define MGAREG_DR10 0x1ce8
-#define MGAREG_DR11 0x1cec
-#define MGAREG_DR12 0x1cf0
-#define MGAREG_DR14 0x1cf8
-#define MGAREG_DR15 0x1cfc
-#define MGAREG_DSTORG 0x2cb8
-
-# define DO_dstmap_MASK 0xfffffffe /* bit 0 */
-# define DO_dstmap_fb 0x0
-# define DO_dstmap_sys 0x1
-# define DO_dstacc_MASK 0xfffffffd /* bit 1 */
-# define DO_dstacc_pci 0x0
-# define DO_dstacc_agp 0x2
-# define DO_dstorg_MASK 0x7 /* bits 3-31 */
-# define DO_dstorg_SHIFT 3
-
-#define MGAREG_DWG_INDIR_WT 0x1e80
-#define MGAREG_DWGCTL 0x1c00
-
-# define DC_opcod_MASK 0xfffffff0 /* bits 0-3 */
-# define DC_opcod_line_open 0x0 /* val 0, shift 0 */
-# define DC_opcod_autoline_open 0x1 /* val 1, shift 0 */
-# define DC_opcod_line_close 0x2 /* val 2, shift 0 */
-# define DC_opcod_autoline_close 0x3 /* val 3, shift 0 */
-# define DC_opcod_trap 0x4 /* val 4, shift 0 */
-# define DC_opcod_texture_trap 0x6 /* val 6, shift 0 */
-# define DC_opcod_bitblt 0x8 /* val 8, shift 0 */
-# define DC_opcod_iload 0x9 /* val 9, shift 0 */
-# define DC_atype_MASK 0xffffff8f /* bits 4-6 */
-# define DC_atype_rpl 0x0 /* val 0, shift 4 */
-# define DC_atype_rstr 0x10 /* val 1, shift 4 */
-# define DC_atype_zi 0x30 /* val 3, shift 4 */
-# define DC_atype_blk 0x40 /* val 4, shift 4 */
-# define DC_atype_i 0x70 /* val 7, shift 4 */
-# define DC_linear_MASK 0xffffff7f /* bit 7 */
-# define DC_linear_xy 0x0
-# define DC_linear_linear 0x80
-# define DC_zmode_MASK 0xfffff8ff /* bits 8-10 */
-# define DC_zmode_nozcmp 0x0 /* val 0, shift 8 */
-# define DC_zmode_ze 0x200 /* val 2, shift 8 */
-# define DC_zmode_zne 0x300 /* val 3, shift 8 */
-# define DC_zmode_zlt 0x400 /* val 4, shift 8 */
-# define DC_zmode_zlte 0x500 /* val 5, shift 8 */
-# define DC_zmode_zgt 0x600 /* val 6, shift 8 */
-# define DC_zmode_zgte 0x700 /* val 7, shift 8 */
-# define DC_solid_MASK 0xfffff7ff /* bit 11 */
-# define DC_solid_disable 0x0
-# define DC_solid_enable 0x800
-# define DC_arzero_MASK 0xffffefff /* bit 12 */
-# define DC_arzero_disable 0x0
-# define DC_arzero_enable 0x1000
-# define DC_sgnzero_MASK 0xffffdfff /* bit 13 */
-# define DC_sgnzero_disable 0x0
-# define DC_sgnzero_enable 0x2000
-# define DC_shftzero_MASK 0xffffbfff /* bit 14 */
-# define DC_shftzero_disable 0x0
-# define DC_shftzero_enable 0x4000
-# define DC_bop_MASK 0xfff0ffff /* bits 16-19 */
-# define DC_bop_SHIFT 16
-# define DC_trans_MASK 0xff0fffff /* bits 20-23 */
-# define DC_trans_SHIFT 20
-# define DC_bltmod_MASK 0xe1ffffff /* bits 25-28 */
-# define DC_bltmod_bmonolef 0x0 /* val 0, shift 25 */
-# define DC_bltmod_bmonowf 0x8000000 /* val 4, shift 25 */
-# define DC_bltmod_bplan 0x2000000 /* val 1, shift 25 */
-# define DC_bltmod_bfcol 0x4000000 /* val 2, shift 25 */
-# define DC_bltmod_bu32bgr 0x6000000 /* val 3, shift 25 */
-# define DC_bltmod_bu32rgb 0xe000000 /* val 7, shift 25 */
-# define DC_bltmod_bu24bgr 0x16000000 /* val 11, shift 25 */
-# define DC_bltmod_bu24rgb 0x1e000000 /* val 15, shift 25 */
-# define DC_pattern_MASK 0xdfffffff /* bit 29 */
-# define DC_pattern_disable 0x0
-# define DC_pattern_enable 0x20000000
-# define DC_transc_MASK 0xbfffffff /* bit 30 */
-# define DC_transc_disable 0x0
-# define DC_transc_enable 0x40000000
-# define DC_clipdis_MASK 0x7fffffff /* bit 31 */
-# define DC_clipdis_disable 0x0
-# define DC_clipdis_enable 0x80000000
-
-#define MGAREG_DWGSYNC 0x2c4c
-
-# define DS_dwgsyncaddr_MASK 0x3 /* bits 2-31 */
-# define DS_dwgsyncaddr_SHIFT 2
-
-#define MGAREG_FCOL 0x1c24
-#define MGAREG_FIFOSTATUS 0x1e10
-
-# define FS_fifocount_MASK 0xffffff80 /* bits 0-6 */
-# define FS_fifocount_SHIFT 0
-# define FS_bfull_MASK 0xfffffeff /* bit 8 */
-# define FS_bfull_disable 0x0
-# define FS_bfull_enable 0x100
-# define FS_bempty_MASK 0xfffffdff /* bit 9 */
-# define FS_bempty_disable 0x0
-# define FS_bempty_enable 0x200
-
-#define MGAREG_FOGCOL 0x1cf4
-#define MGAREG_FOGSTART 0x1cc4
-#define MGAREG_FOGXINC 0x1cd4
-#define MGAREG_FOGYINC 0x1ce4
-#define MGAREG_FXBNDRY 0x1c84
-
-# define XA_fxleft_MASK 0xffff0000 /* bits 0-15 */
-# define XA_fxleft_SHIFT 0
-# define XA_fxright_MASK 0xffff /* bits 16-31 */
-# define XA_fxright_SHIFT 16
-
-#define MGAREG_FXLEFT 0x1ca8
-#define MGAREG_FXRIGHT 0x1cac
-#define MGAREG_ICLEAR 0x1e18
-
-# define IC_softrapiclr_MASK 0xfffffffe /* bit 0 */
-# define IC_softrapiclr_disable 0x0
-# define IC_softrapiclr_enable 0x1
-# define IC_pickiclr_MASK 0xfffffffb /* bit 2 */
-# define IC_pickiclr_disable 0x0
-# define IC_pickiclr_enable 0x4
-# define IC_vlineiclr_MASK 0xffffffdf /* bit 5 */
-# define IC_vlineiclr_disable 0x0
-# define IC_vlineiclr_enable 0x20
-# define IC_wiclr_MASK 0xffffff7f /* bit 7 */
-# define IC_wiclr_disable 0x0
-# define IC_wiclr_enable 0x80
-# define IC_wciclr_MASK 0xfffffeff /* bit 8 */
-# define IC_wciclr_disable 0x0
-# define IC_wciclr_enable 0x100
-
-#define MGAREG_IEN 0x1e1c
-
-# define IE_softrapien_MASK 0xfffffffe /* bit 0 */
-# define IE_softrapien_disable 0x0
-# define IE_softrapien_enable 0x1
-# define IE_pickien_MASK 0xfffffffb /* bit 2 */
-# define IE_pickien_disable 0x0
-# define IE_pickien_enable 0x4
-# define IE_vlineien_MASK 0xffffffdf /* bit 5 */
-# define IE_vlineien_disable 0x0
-# define IE_vlineien_enable 0x20
-# define IE_extien_MASK 0xffffffbf /* bit 6 */
-# define IE_extien_disable 0x0
-# define IE_extien_enable 0x40
-# define IE_wien_MASK 0xffffff7f /* bit 7 */
-# define IE_wien_disable 0x0
-# define IE_wien_enable 0x80
-# define IE_wcien_MASK 0xfffffeff /* bit 8 */
-# define IE_wcien_disable 0x0
-# define IE_wcien_enable 0x100
-
-#define MGAREG_LEN 0x1c5c
-#define MGAREG_MACCESS 0x1c04
-
-# define MA_pwidth_MASK 0xfffffffc /* bits 0-1 */
-# define MA_pwidth_8 0x0 /* val 0, shift 0 */
-# define MA_pwidth_16 0x1 /* val 1, shift 0 */
-# define MA_pwidth_32 0x2 /* val 2, shift 0 */
-# define MA_pwidth_24 0x3 /* val 3, shift 0 */
-# define MA_zwidth_MASK 0xffffffe7 /* bits 3-4 */
-# define MA_zwidth_16 0x0 /* val 0, shift 3 */
-# define MA_zwidth_32 0x8 /* val 1, shift 3 */
-# define MA_zwidth_15 0x10 /* val 2, shift 3 */
-# define MA_zwidth_24 0x18 /* val 3, shift 3 */
-# define MA_memreset_MASK 0xffff7fff /* bit 15 */
-# define MA_memreset_disable 0x0
-# define MA_memreset_enable 0x8000
-# define MA_fogen_MASK 0xfbffffff /* bit 26 */
-# define MA_fogen_disable 0x0
-# define MA_fogen_enable 0x4000000
-# define MA_tlutload_MASK 0xdfffffff /* bit 29 */
-# define MA_tlutload_disable 0x0
-# define MA_tlutload_enable 0x20000000
-# define MA_nodither_MASK 0xbfffffff /* bit 30 */
-# define MA_nodither_disable 0x0
-# define MA_nodither_enable 0x40000000
-# define MA_dit555_MASK 0x7fffffff /* bit 31 */
-# define MA_dit555_disable 0x0
-# define MA_dit555_enable 0x80000000
-
-#define MGAREG_MCTLWTST 0x1c08
-
-# define MCWS_casltncy_MASK 0xfffffff8 /* bits 0-2 */
-# define MCWS_casltncy_SHIFT 0
-# define MCWS_rrddelay_MASK 0xffffffcf /* bits 4-5 */
-# define MCWS_rcddelay_MASK 0xfffffe7f /* bits 7-8 */
-# define MCWS_rasmin_MASK 0xffffe3ff /* bits 10-12 */
-# define MCWS_rasmin_SHIFT 10
-# define MCWS_rpdelay_MASK 0xffff3fff /* bits 14-15 */
-# define MCWS_wrdelay_MASK 0xfff3ffff /* bits 18-19 */
-# define MCWS_rddelay_MASK 0xffdfffff /* bit 21 */
-# define MCWS_rddelay_disable 0x0
-# define MCWS_rddelay_enable 0x200000
-# define MCWS_smrdelay_MASK 0xfe7fffff /* bits 23-24 */
-# define MCWS_bwcdelay_MASK 0xf3ffffff /* bits 26-27 */
-# define MCWS_bpldelay_MASK 0x1fffffff /* bits 29-31 */
-# define MCWS_bpldelay_SHIFT 29
-
-#define MGAREG_MEMRDBK 0x1e44
-
-# define MRB_mclkbrd0_MASK 0xfffffff0 /* bits 0-3 */
-# define MRB_mclkbrd0_SHIFT 0
-# define MRB_mclkbrd1_MASK 0xfffffe1f /* bits 5-8 */
-# define MRB_mclkbrd1_SHIFT 5
-# define MRB_strmfctl_MASK 0xff3fffff /* bits 22-23 */
-# define MRB_mrsopcod_MASK 0xe1ffffff /* bits 25-28 */
-# define MRB_mrsopcod_SHIFT 25
-
-#define MGAREG_OPMODE 0x1e54
-
-# define OM_dmamod_MASK 0xfffffff3 /* bits 2-3 */
-# define OM_dmamod_general 0x0 /* val 0, shift 2 */
-# define OM_dmamod_blit 0x4 /* val 1, shift 2 */
-# define OM_dmamod_vector 0x8 /* val 2, shift 2 */
-# define OM_dmamod_vertex 0xc /* val 3, shift 2 */
-# define OM_dmadatasiz_MASK 0xfffffcff /* bits 8-9 */
-# define OM_dmadatasiz_8 0x0 /* val 0, shift 8 */
-# define OM_dmadatasiz_16 0x100 /* val 1, shift 8 */
-# define OM_dmadatasiz_32 0x200 /* val 2, shift 8 */
-# define OM_dirdatasiz_MASK 0xfffcffff /* bits 16-17 */
-# define OM_dirdatasiz_8 0x0 /* val 0, shift 16 */
-# define OM_dirdatasiz_16 0x10000 /* val 1, shift 16 */
-# define OM_dirdatasiz_32 0x20000 /* val 2, shift 16 */
-
-#define MGAREG_PAT0 0x1c10
-#define MGAREG_PAT1 0x1c14
-#define MGAREG_PITCH 0x1c8c
-
-# define P_iy_MASK 0xffffe000 /* bits 0-12 */
-# define P_iy_SHIFT 0
-# define P_ylin_MASK 0xffff7fff /* bit 15 */
-# define P_ylin_disable 0x0
-# define P_ylin_enable 0x8000
-
-#define MGAREG_PLNWT 0x1c1c
-#define MGAREG_PRIMADDRESS 0x1e58
-
-# define PDCA_primod_MASK 0xfffffffc /* bits 0-1 */
-# define PDCA_primod_general 0x0 /* val 0, shift 0 */
-# define PDCA_primod_blit 0x1 /* val 1, shift 0 */
-# define PDCA_primod_vector 0x2 /* val 2, shift 0 */
-# define PDCA_primod_vertex 0x3 /* val 3, shift 0 */
-# define PDCA_primaddress_MASK 0x3 /* bits 2-31 */
-# define PDCA_primaddress_SHIFT 2
-
-#define MGAREG_PRIMEND 0x1e5c
-
-# define PDEA_primnostart_MASK 0xfffffffe /* bit 0 */
-# define PDEA_primnostart_disable 0x0
-# define PDEA_primnostart_enable 0x1
-# define PDEA_pagpxfer_MASK 0xfffffffd /* bit 1 */
-# define PDEA_pagpxfer_disable 0x0
-# define PDEA_pagpxfer_enable 0x2
-# define PDEA_primend_MASK 0x3 /* bits 2-31 */
-# define PDEA_primend_SHIFT 2
-
-#define MGAREG_PRIMPTR 0x1e50
-
-# define PLS_primptren0_MASK 0xfffffffe /* bit 0 */
-# define PLS_primptren0_disable 0x0
-# define PLS_primptren0_enable 0x1
-# define PLS_primptren1_MASK 0xfffffffd /* bit 1 */
-# define PLS_primptren1_disable 0x0
-# define PLS_primptren1_enable 0x2
-# define PLS_primptr_MASK 0x7 /* bits 3-31 */
-# define PLS_primptr_SHIFT 3
-
-#define MGAREG_RST 0x1e40
-
-# define R_softreset_MASK 0xfffffffe /* bit 0 */
-# define R_softreset_disable 0x0
-# define R_softreset_enable 0x1
-# define R_softextrst_MASK 0xfffffffd /* bit 1 */
-# define R_softextrst_disable 0x0
-# define R_softextrst_enable 0x2
-
-#define MGAREG_SECADDRESS 0x2c40
-
-# define SDCA_secmod_MASK 0xfffffffc /* bits 0-1 */
-# define SDCA_secmod_general 0x0 /* val 0, shift 0 */
-# define SDCA_secmod_blit 0x1 /* val 1, shift 0 */
-# define SDCA_secmod_vector 0x2 /* val 2, shift 0 */
-# define SDCA_secmod_vertex 0x3 /* val 3, shift 0 */
-# define SDCA_secaddress_MASK 0x3 /* bits 2-31 */
-# define SDCA_secaddress_SHIFT 2
-
-#define MGAREG_SECEND 0x2c44
-
-# define SDEA_sagpxfer_MASK 0xfffffffd /* bit 1 */
-# define SDEA_sagpxfer_disable 0x0
-# define SDEA_sagpxfer_enable 0x2
-# define SDEA_secend_MASK 0x3 /* bits 2-31 */
-# define SDEA_secend_SHIFT 2
-
-#define MGAREG_SETUPADDRESS 0x2cd0
-
-# define SETADD_mode_MASK 0xfffffffc /* bits 0-1 */
-# define SETADD_mode_vertlist 0x0 /* val 0, shift 0 */
-# define SETADD_address_MASK 0x3 /* bits 2-31 */
-# define SETADD_address_SHIFT 2
-
-#define MGAREG_SETUPEND 0x2cd4
-
-# define SETEND_agpxfer_MASK 0xfffffffd /* bit 1 */
-# define SETEND_agpxfer_disable 0x0
-# define SETEND_agpxfer_enable 0x2
-# define SETEND_address_MASK 0x3 /* bits 2-31 */
-# define SETEND_address_SHIFT 2
-
-#define MGAREG_SGN 0x1c58
-
-# define S_sdydxl_MASK 0xfffffffe /* bit 0 */
-# define S_sdydxl_y 0x0
-# define S_sdydxl_x 0x1
-# define S_scanleft_MASK 0xfffffffe /* bit 0 */
-# define S_scanleft_disable 0x0
-# define S_scanleft_enable 0x1
-# define S_sdxl_MASK 0xfffffffd /* bit 1 */
-# define S_sdxl_pos 0x0
-# define S_sdxl_neg 0x2
-# define S_sdy_MASK 0xfffffffb /* bit 2 */
-# define S_sdy_pos 0x0
-# define S_sdy_neg 0x4
-# define S_sdxr_MASK 0xffffffdf /* bit 5 */
-# define S_sdxr_pos 0x0
-# define S_sdxr_neg 0x20
-# define S_brkleft_MASK 0xfffffeff /* bit 8 */
-# define S_brkleft_disable 0x0
-# define S_brkleft_enable 0x100
-# define S_errorinit_MASK 0x7fffffff /* bit 31 */
-# define S_errorinit_disable 0x0
-# define S_errorinit_enable 0x80000000
-
-#define MGAREG_SHIFT 0x1c50
-
-# define FSC_x_off_MASK 0xfffffff0 /* bits 0-3 */
-# define FSC_x_off_SHIFT 0
-# define FSC_funcnt_MASK 0xffffff80 /* bits 0-6 */
-# define FSC_funcnt_SHIFT 0
-# define FSC_y_off_MASK 0xffffff8f /* bits 4-6 */
-# define FSC_y_off_SHIFT 4
-# define FSC_funoff_MASK 0xffc0ffff /* bits 16-21 */
-# define FSC_funoff_SHIFT 16
-# define FSC_stylelen_MASK 0xffc0ffff /* bits 16-21 */
-# define FSC_stylelen_SHIFT 16
-
-#define MGAREG_SOFTRAP 0x2c48
-
-# define STH_softraphand_MASK 0x3 /* bits 2-31 */
-# define STH_softraphand_SHIFT 2
-
-#define MGAREG_SPECBSTART 0x2c98
-#define MGAREG_SPECBXINC 0x2c9c
-#define MGAREG_SPECBYINC 0x2ca0
-#define MGAREG_SPECGSTART 0x2c8c
-#define MGAREG_SPECGXINC 0x2c90
-#define MGAREG_SPECGYINC 0x2c94
-#define MGAREG_SPECRSTART 0x2c80
-#define MGAREG_SPECRXINC 0x2c84
-#define MGAREG_SPECRYINC 0x2c88
-#define MGAREG_SRC0 0x1c30
-#define MGAREG_SRC1 0x1c34
-#define MGAREG_SRC2 0x1c38
-#define MGAREG_SRC3 0x1c3c
-#define MGAREG_SRCORG 0x2cb4
-
-# define SO_srcmap_MASK 0xfffffffe /* bit 0 */
-# define SO_srcmap_fb 0x0
-# define SO_srcmap_sys 0x1
-# define SO_srcacc_MASK 0xfffffffd /* bit 1 */
-# define SO_srcacc_pci 0x0
-# define SO_srcacc_agp 0x2
-# define SO_srcorg_MASK 0x7 /* bits 3-31 */
-# define SO_srcorg_SHIFT 3
-
-#define MGAREG_STATUS 0x1e14
-
-# define STAT_softrapen_MASK 0xfffffffe /* bit 0 */
-# define STAT_softrapen_disable 0x0
-# define STAT_softrapen_enable 0x1
-# define STAT_pickpen_MASK 0xfffffffb /* bit 2 */
-# define STAT_pickpen_disable 0x0
-# define STAT_pickpen_enable 0x4
-# define STAT_vsyncsts_MASK 0xfffffff7 /* bit 3 */
-# define STAT_vsyncsts_disable 0x0
-# define STAT_vsyncsts_enable 0x8
-# define STAT_vsyncpen_MASK 0xffffffef /* bit 4 */
-# define STAT_vsyncpen_disable 0x0
-# define STAT_vsyncpen_enable 0x10
-# define STAT_vlinepen_MASK 0xffffffdf /* bit 5 */
-# define STAT_vlinepen_disable 0x0
-# define STAT_vlinepen_enable 0x20
-# define STAT_extpen_MASK 0xffffffbf /* bit 6 */
-# define STAT_extpen_disable 0x0
-# define STAT_extpen_enable 0x40
-# define STAT_wpen_MASK 0xffffff7f /* bit 7 */
-# define STAT_wpen_disable 0x0
-# define STAT_wpen_enable 0x80
-# define STAT_wcpen_MASK 0xfffffeff /* bit 8 */
-# define STAT_wcpen_disable 0x0
-# define STAT_wcpen_enable 0x100
-# define STAT_dwgengsts_MASK 0xfffeffff /* bit 16 */
-# define STAT_dwgengsts_disable 0x0
-# define STAT_dwgengsts_enable 0x10000
-# define STAT_endprdmasts_MASK 0xfffdffff /* bit 17 */
-# define STAT_endprdmasts_disable 0x0
-# define STAT_endprdmasts_enable 0x20000
-# define STAT_wbusy_MASK 0xfffbffff /* bit 18 */
-# define STAT_wbusy_disable 0x0
-# define STAT_wbusy_enable 0x40000
-# define STAT_swflag_MASK 0xfffffff /* bits 28-31 */
-# define STAT_swflag_SHIFT 28
-
-#define MGAREG_STENCIL 0x2cc8
-
-# define S_sref_MASK 0xffffff00 /* bits 0-7 */
-# define S_sref_SHIFT 0
-# define S_smsk_MASK 0xffff00ff /* bits 8-15 */
-# define S_smsk_SHIFT 8
-# define S_swtmsk_MASK 0xff00ffff /* bits 16-23 */
-# define S_swtmsk_SHIFT 16
-
-#define MGAREG_STENCILCTL 0x2ccc
-
-# define SC_smode_MASK 0xfffffff8 /* bits 0-2 */
-# define SC_smode_salways 0x0 /* val 0, shift 0 */
-# define SC_smode_snever 0x1 /* val 1, shift 0 */
-# define SC_smode_se 0x2 /* val 2, shift 0 */
-# define SC_smode_sne 0x3 /* val 3, shift 0 */
-# define SC_smode_slt 0x4 /* val 4, shift 0 */
-# define SC_smode_slte 0x5 /* val 5, shift 0 */
-# define SC_smode_sgt 0x6 /* val 6, shift 0 */
-# define SC_smode_sgte 0x7 /* val 7, shift 0 */
-# define SC_sfailop_MASK 0xffffffc7 /* bits 3-5 */
-# define SC_sfailop_keep 0x0 /* val 0, shift 3 */
-# define SC_sfailop_zero 0x8 /* val 1, shift 3 */
-# define SC_sfailop_replace 0x10 /* val 2, shift 3 */
-# define SC_sfailop_incrsat 0x18 /* val 3, shift 3 */
-# define SC_sfailop_decrsat 0x20 /* val 4, shift 3 */
-# define SC_sfailop_invert 0x28 /* val 5, shift 3 */
-# define SC_sfailop_incr 0x30 /* val 6, shift 3 */
-# define SC_sfailop_decr 0x38 /* val 7, shift 3 */
-# define SC_szfailop_MASK 0xfffffe3f /* bits 6-8 */
-# define SC_szfailop_keep 0x0 /* val 0, shift 6 */
-# define SC_szfailop_zero 0x40 /* val 1, shift 6 */
-# define SC_szfailop_replace 0x80 /* val 2, shift 6 */
-# define SC_szfailop_incrsat 0xc0 /* val 3, shift 6 */
-# define SC_szfailop_decrsat 0x100 /* val 4, shift 6 */
-# define SC_szfailop_invert 0x140 /* val 5, shift 6 */
-# define SC_szfailop_incr 0x180 /* val 6, shift 6 */
-# define SC_szfailop_decr 0x1c0 /* val 7, shift 6 */
-# define SC_szpassop_MASK 0xfffff1ff /* bits 9-11 */
-# define SC_szpassop_keep 0x0 /* val 0, shift 9 */
-# define SC_szpassop_zero 0x200 /* val 1, shift 9 */
-# define SC_szpassop_replace 0x400 /* val 2, shift 9 */
-# define SC_szpassop_incrsat 0x600 /* val 3, shift 9 */
-# define SC_szpassop_decrsat 0x800 /* val 4, shift 9 */
-# define SC_szpassop_invert 0xa00 /* val 5, shift 9 */
-# define SC_szpassop_incr 0xc00 /* val 6, shift 9 */
-# define SC_szpassop_decr 0xe00 /* val 7, shift 9 */
-
-#define MGAREG_TDUALSTAGE0 0x2cf8
-
-# define TD0_color_arg2_MASK 0xfffffffc /* bits 0-1 */
-# define TD0_color_arg2_diffuse 0x0 /* val 0, shift 0 */
-# define TD0_color_arg2_specular 0x1 /* val 1, shift 0 */
-# define TD0_color_arg2_fcol 0x2 /* val 2, shift 0 */
-# define TD0_color_arg2_prevstage 0x3 /* val 3, shift 0 */
-# define TD0_color_alpha_MASK 0xffffffe3 /* bits 2-4 */
-# define TD0_color_alpha_diffuse 0x0 /* val 0, shift 2 */
-# define TD0_color_alpha_fcol 0x4 /* val 1, shift 2 */
-# define TD0_color_alpha_currtex 0x8 /* val 2, shift 2 */
-# define TD0_color_alpha_prevtex 0xc /* val 3, shift 2 */
-# define TD0_color_alpha_prevstage 0x10 /* val 4, shift 2 */
-# define TD0_color_arg1_replicatealpha_MASK 0xffffffdf /* bit 5 */
-# define TD0_color_arg1_replicatealpha_disable 0x0
-# define TD0_color_arg1_replicatealpha_enable 0x20
-# define TD0_color_arg1_inv_MASK 0xffffffbf /* bit 6 */
-# define TD0_color_arg1_inv_disable 0x0
-# define TD0_color_arg1_inv_enable 0x40
-# define TD0_color_arg2_replicatealpha_MASK 0xffffff7f /* bit 7 */
-# define TD0_color_arg2_replicatealpha_disable 0x0
-# define TD0_color_arg2_replicatealpha_enable 0x80
-# define TD0_color_arg2_inv_MASK 0xfffffeff /* bit 8 */
-# define TD0_color_arg2_inv_disable 0x0
-# define TD0_color_arg2_inv_enable 0x100
-# define TD0_color_alpha1inv_MASK 0xfffffdff /* bit 9 */
-# define TD0_color_alpha1inv_disable 0x0
-# define TD0_color_alpha1inv_enable 0x200
-# define TD0_color_alpha2inv_MASK 0xfffffbff /* bit 10 */
-# define TD0_color_alpha2inv_disable 0x0
-# define TD0_color_alpha2inv_enable 0x400
-# define TD0_color_arg1mul_MASK 0xfffff7ff /* bit 11 */
-# define TD0_color_arg1mul_disable 0x0 /* val 0, shift 11 */
-# define TD0_color_arg1mul_alpha1 0x800 /* val 1, shift 11 */
-# define TD0_color_arg2mul_MASK 0xffffefff /* bit 12 */
-# define TD0_color_arg2mul_disable 0x0 /* val 0, shift 12 */
-# define TD0_color_arg2mul_alpha2 0x1000 /* val 1, shift 12 */
-# define TD0_color_arg1add_MASK 0xffffdfff /* bit 13 */
-# define TD0_color_arg1add_disable 0x0 /* val 0, shift 13 */
-# define TD0_color_arg1add_mulout 0x2000 /* val 1, shift 13 */
-# define TD0_color_arg2add_MASK 0xffffbfff /* bit 14 */
-# define TD0_color_arg2add_disable 0x0 /* val 0, shift 14 */
-# define TD0_color_arg2add_mulout 0x4000 /* val 1, shift 14 */
-# define TD0_color_modbright_MASK 0xfffe7fff /* bits 15-16 */
-# define TD0_color_modbright_disable 0x0 /* val 0, shift 15 */
-# define TD0_color_modbright_2x 0x8000 /* val 1, shift 15 */
-# define TD0_color_modbright_4x 0x10000 /* val 2, shift 15 */
-# define TD0_color_add_MASK 0xfffdffff /* bit 17 */
-# define TD0_color_add_sub 0x0 /* val 0, shift 17 */
-# define TD0_color_add_add 0x20000 /* val 1, shift 17 */
-# define TD0_color_add2x_MASK 0xfffbffff /* bit 18 */
-# define TD0_color_add2x_disable 0x0
-# define TD0_color_add2x_enable 0x40000
-# define TD0_color_addbias_MASK 0xfff7ffff /* bit 19 */
-# define TD0_color_addbias_disable 0x0
-# define TD0_color_addbias_enable 0x80000
-# define TD0_color_blend_MASK 0xffefffff /* bit 20 */
-# define TD0_color_blend_disable 0x0
-# define TD0_color_blend_enable 0x100000
-# define TD0_color_sel_MASK 0xff9fffff /* bits 21-22 */
-# define TD0_color_sel_arg1 0x0 /* val 0, shift 21 */
-# define TD0_color_sel_arg2 0x200000 /* val 1, shift 21 */
-# define TD0_color_sel_add 0x400000 /* val 2, shift 21 */
-# define TD0_color_sel_mul 0x600000 /* val 3, shift 21 */
-# define TD0_alpha_arg1_inv_MASK 0xff7fffff /* bit 23 */
-# define TD0_alpha_arg1_inv_disable 0x0
-# define TD0_alpha_arg1_inv_enable 0x800000
-# define TD0_alpha_arg2_MASK 0xfcffffff /* bits 24-25 */
-# define TD0_alpha_arg2_diffuse 0x0 /* val 0, shift 24 */
-# define TD0_alpha_arg2_fcol 0x1000000 /* val 1, shift 24 */
-# define TD0_alpha_arg2_prevtex 0x2000000 /* val 2, shift 24 */
-# define TD0_alpha_arg2_prevstage 0x3000000 /* val 3, shift 24 */
-# define TD0_alpha_arg2_inv_MASK 0xfbffffff /* bit 26 */
-# define TD0_alpha_arg2_inv_disable 0x0
-# define TD0_alpha_arg2_inv_enable 0x4000000
-# define TD0_alpha_add_MASK 0xf7ffffff /* bit 27 */
-# define TD0_alpha_add_disable 0x0
-# define TD0_alpha_add_enable 0x8000000
-# define TD0_alpha_addbias_MASK 0xefffffff /* bit 28 */
-# define TD0_alpha_addbias_disable 0x0
-# define TD0_alpha_addbias_enable 0x10000000
-# define TD0_alpha_add2x_MASK 0xdfffffff /* bit 29 */
-# define TD0_alpha_add2x_disable 0x0
-# define TD0_alpha_add2x_enable 0x20000000
-# define TD0_alpha_modbright_MASK 0xcfffffff /* bits 28-29 */
-# define TD0_alpha_modbright_disable 0x0 /* val 0, shift 28 */
-# define TD0_alpha_modbright_2x 0x10000000 /* val 1, shift 28 */
-# define TD0_alpha_modbright_4x 0x20000000 /* val 2, shift 28 */
-# define TD0_alpha_sel_MASK 0x3fffffff /* bits 30-31 */
-# define TD0_alpha_sel_arg1 0x0 /* val 0, shift 30 */
-# define TD0_alpha_sel_arg2 0x40000000 /* val 1, shift 30 */
-# define TD0_alpha_sel_add 0x80000000 /* val 2, shift 30 */
-# define TD0_alpha_sel_mul 0xc0000000 /* val 3, shift 30 */
-
-#define MGAREG_TDUALSTAGE1 0x2cfc
-
-# define TD1_color_arg2_MASK 0xfffffffc /* bits 0-1 */
-# define TD1_color_arg2_diffuse 0x0 /* val 0, shift 0 */
-# define TD1_color_arg2_specular 0x1 /* val 1, shift 0 */
-# define TD1_color_arg2_fcol 0x2 /* val 2, shift 0 */
-# define TD1_color_arg2_prevstage 0x3 /* val 3, shift 0 */
-# define TD1_color_alpha_MASK 0xffffffe3 /* bits 2-4 */
-# define TD1_color_alpha_diffuse 0x0 /* val 0, shift 2 */
-# define TD1_color_alpha_fcol 0x4 /* val 1, shift 2 */
-# define TD1_color_alpha_tex0 0x8 /* val 2, shift 2 */
-# define TD1_color_alpha_prevtex 0xc /* val 3, shift 2 */
-# define TD1_color_alpha_prevstage 0x10 /* val 4, shift 2 */
-# define TD1_color_arg1_replicatealpha_MASK 0xffffffdf /* bit 5 */
-# define TD1_color_arg1_replicatealpha_disable 0x0
-# define TD1_color_arg1_replicatealpha_enable 0x20
-# define TD1_color_arg1_inv_MASK 0xffffffbf /* bit 6 */
-# define TD1_color_arg1_inv_disable 0x0
-# define TD1_color_arg1_inv_enable 0x40
-# define TD1_color_arg2_replicatealpha_MASK 0xffffff7f /* bit 7 */
-# define TD1_color_arg2_replicatealpha_disable 0x0
-# define TD1_color_arg2_replicatealpha_enable 0x80
-# define TD1_color_arg2_inv_MASK 0xfffffeff /* bit 8 */
-# define TD1_color_arg2_inv_disable 0x0
-# define TD1_color_arg2_inv_enable 0x100
-# define TD1_color_alpha1inv_MASK 0xfffffdff /* bit 9 */
-# define TD1_color_alpha1inv_disable 0x0
-# define TD1_color_alpha1inv_enable 0x200
-# define TD1_color_alpha2inv_MASK 0xfffffbff /* bit 10 */
-# define TD1_color_alpha2inv_disable 0x0
-# define TD1_color_alpha2inv_enable 0x400
-# define TD1_color_arg1mul_MASK 0xfffff7ff /* bit 11 */
-# define TD1_color_arg1mul_disable 0x0 /* val 0, shift 11 */
-# define TD1_color_arg1mul_alpha1 0x800 /* val 1, shift 11 */
-# define TD1_color_arg2mul_MASK 0xffffefff /* bit 12 */
-# define TD1_color_arg2mul_disable 0x0 /* val 0, shift 12 */
-# define TD1_color_arg2mul_alpha2 0x1000 /* val 1, shift 12 */
-# define TD1_color_arg1add_MASK 0xffffdfff /* bit 13 */
-# define TD1_color_arg1add_disable 0x0 /* val 0, shift 13 */
-# define TD1_color_arg1add_mulout 0x2000 /* val 1, shift 13 */
-# define TD1_color_arg2add_MASK 0xffffbfff /* bit 14 */
-# define TD1_color_arg2add_disable 0x0 /* val 0, shift 14 */
-# define TD1_color_arg2add_mulout 0x4000 /* val 1, shift 14 */
-# define TD1_color_modbright_MASK 0xfffe7fff /* bits 15-16 */
-# define TD1_color_modbright_disable 0x0 /* val 0, shift 15 */
-# define TD1_color_modbright_2x 0x8000 /* val 1, shift 15 */
-# define TD1_color_modbright_4x 0x10000 /* val 2, shift 15 */
-# define TD1_color_add_MASK 0xfffdffff /* bit 17 */
-# define TD1_color_add_sub 0x0 /* val 0, shift 17 */
-# define TD1_color_add_add 0x20000 /* val 1, shift 17 */
-# define TD1_color_add2x_MASK 0xfffbffff /* bit 18 */
-# define TD1_color_add2x_disable 0x0
-# define TD1_color_add2x_enable 0x40000
-# define TD1_color_addbias_MASK 0xfff7ffff /* bit 19 */
-# define TD1_color_addbias_disable 0x0
-# define TD1_color_addbias_enable 0x80000
-# define TD1_color_blend_MASK 0xffefffff /* bit 20 */
-# define TD1_color_blend_disable 0x0
-# define TD1_color_blend_enable 0x100000
-# define TD1_color_sel_MASK 0xff9fffff /* bits 21-22 */
-# define TD1_color_sel_arg1 0x0 /* val 0, shift 21 */
-# define TD1_color_sel_arg2 0x200000 /* val 1, shift 21 */
-# define TD1_color_sel_add 0x400000 /* val 2, shift 21 */
-# define TD1_color_sel_mul 0x600000 /* val 3, shift 21 */
-# define TD1_alpha_arg1_inv_MASK 0xff7fffff /* bit 23 */
-# define TD1_alpha_arg1_inv_disable 0x0
-# define TD1_alpha_arg1_inv_enable 0x800000
-# define TD1_alpha_arg2_MASK 0xfcffffff /* bits 24-25 */
-# define TD1_alpha_arg2_diffuse 0x0 /* val 0, shift 24 */
-# define TD1_alpha_arg2_fcol 0x1000000 /* val 1, shift 24 */
-# define TD1_alpha_arg2_prevtex 0x2000000 /* val 2, shift 24 */
-# define TD1_alpha_arg2_prevstage 0x3000000 /* val 3, shift 24 */
-# define TD1_alpha_arg2_inv_MASK 0xfbffffff /* bit 26 */
-# define TD1_alpha_arg2_inv_disable 0x0
-# define TD1_alpha_arg2_inv_enable 0x4000000
-# define TD1_alpha_add_MASK 0xf7ffffff /* bit 27 */
-# define TD1_alpha_add_disable 0x0
-# define TD1_alpha_add_enable 0x8000000
-# define TD1_alpha_addbias_MASK 0xefffffff /* bit 28 */
-# define TD1_alpha_addbias_disable 0x0
-# define TD1_alpha_addbias_enable 0x10000000
-# define TD1_alpha_add2x_MASK 0xdfffffff /* bit 29 */
-# define TD1_alpha_add2x_disable 0x0
-# define TD1_alpha_add2x_enable 0x20000000
-# define TD1_alpha_modbright_MASK 0xcfffffff /* bits 28-29 */
-# define TD1_alpha_modbright_disable 0x0 /* val 0, shift 28 */
-# define TD1_alpha_modbright_2x 0x10000000 /* val 1, shift 28 */
-# define TD1_alpha_modbright_4x 0x20000000 /* val 2, shift 28 */
-# define TD1_alpha_sel_MASK 0x3fffffff /* bits 30-31 */
-# define TD1_alpha_sel_arg1 0x0 /* val 0, shift 30 */
-# define TD1_alpha_sel_arg2 0x40000000 /* val 1, shift 30 */
-# define TD1_alpha_sel_add 0x80000000 /* val 2, shift 30 */
-# define TD1_alpha_sel_mul 0xc0000000 /* val 3, shift 30 */
-
-#define MGAREG_TEST0 0x1e48
-
-# define TST_ramtsten_MASK 0xfffffffe /* bit 0 */
-# define TST_ramtsten_disable 0x0
-# define TST_ramtsten_enable 0x1
-# define TST_ramtstdone_MASK 0xfffffffd /* bit 1 */
-# define TST_ramtstdone_disable 0x0
-# define TST_ramtstdone_enable 0x2
-# define TST_wramtstpass_MASK 0xfffffffb /* bit 2 */
-# define TST_wramtstpass_disable 0x0
-# define TST_wramtstpass_enable 0x4
-# define TST_tcachetstpass_MASK 0xfffffff7 /* bit 3 */
-# define TST_tcachetstpass_disable 0x0
-# define TST_tcachetstpass_enable 0x8
-# define TST_tluttstpass_MASK 0xffffffef /* bit 4 */
-# define TST_tluttstpass_disable 0x0
-# define TST_tluttstpass_enable 0x10
-# define TST_luttstpass_MASK 0xffffffdf /* bit 5 */
-# define TST_luttstpass_disable 0x0
-# define TST_luttstpass_enable 0x20
-# define TST_besramtstpass_MASK 0xffffffbf /* bit 6 */
-# define TST_besramtstpass_disable 0x0
-# define TST_besramtstpass_enable 0x40
-# define TST_ringen_MASK 0xfffffeff /* bit 8 */
-# define TST_ringen_disable 0x0
-# define TST_ringen_enable 0x100
-# define TST_apllbyp_MASK 0xfffffdff /* bit 9 */
-# define TST_apllbyp_disable 0x0
-# define TST_apllbyp_enable 0x200
-# define TST_hiten_MASK 0xfffffbff /* bit 10 */
-# define TST_hiten_disable 0x0
-# define TST_hiten_enable 0x400
-# define TST_tmode_MASK 0xffffc7ff /* bits 11-13 */
-# define TST_tmode_SHIFT 11
-# define TST_tclksel_MASK 0xfffe3fff /* bits 14-16 */
-# define TST_tclksel_SHIFT 14
-# define TST_ringcnten_MASK 0xfffdffff /* bit 17 */
-# define TST_ringcnten_disable 0x0
-# define TST_ringcnten_enable 0x20000
-# define TST_ringcnt_MASK 0xc003ffff /* bits 18-29 */
-# define TST_ringcnt_SHIFT 18
-# define TST_ringcntclksl_MASK 0xbfffffff /* bit 30 */
-# define TST_ringcntclksl_disable 0x0
-# define TST_ringcntclksl_enable 0x40000000
-# define TST_biosboot_MASK 0x7fffffff /* bit 31 */
-# define TST_biosboot_disable 0x0
-# define TST_biosboot_enable 0x80000000
-
-#define MGAREG_TEXBORDERCOL 0x2c5c
-#define MGAREG_TEXCTL 0x2c30
-
-# define TMC_tformat_MASK 0xfffffff0 /* bits 0-3 */
-# define TMC_tformat_tw4 0x0 /* val 0, shift 0 */
-# define TMC_tformat_tw8 0x1 /* val 1, shift 0 */
-# define TMC_tformat_tw15 0x2 /* val 2, shift 0 */
-# define TMC_tformat_tw16 0x3 /* val 3, shift 0 */
-# define TMC_tformat_tw12 0x4 /* val 4, shift 0 */
-# define TMC_tformat_tw32 0x6 /* val 6, shift 0 */
-# define TMC_tformat_tw8a 0x7 /* val 7, shift 0 */
-# define TMC_tformat_tw8al 0x8 /* val 8, shift 0 */
-# define TMC_tformat_tw422 0xa /* val 10, shift 0 */
-# define TMC_tformat_tw422uyvy 0xb /* val 11, shift 0 */
-# define TMC_tpitchlin_MASK 0xfffffeff /* bit 8 */
-# define TMC_tpitchlin_disable 0x0
-# define TMC_tpitchlin_enable 0x100
-# define TMC_tpitchext_MASK 0xfff001ff /* bits 9-19 */
-# define TMC_tpitchext_SHIFT 9
-# define TMC_tpitch_MASK 0xfff8ffff /* bits 16-18 */
-# define TMC_tpitch_SHIFT 16
-# define TMC_owalpha_MASK 0xffbfffff /* bit 22 */
-# define TMC_owalpha_disable 0x0
-# define TMC_owalpha_enable 0x400000
-# define TMC_azeroextend_MASK 0xff7fffff /* bit 23 */
-# define TMC_azeroextend_disable 0x0
-# define TMC_azeroextend_enable 0x800000
-# define TMC_decalckey_MASK 0xfeffffff /* bit 24 */
-# define TMC_decalckey_disable 0x0
-# define TMC_decalckey_enable 0x1000000
-# define TMC_takey_MASK 0xfdffffff /* bit 25 */
-# define TMC_takey_0 0x0
-# define TMC_takey_1 0x2000000
-# define TMC_tamask_MASK 0xfbffffff /* bit 26 */
-# define TMC_tamask_0 0x0
-# define TMC_tamask_1 0x4000000
-# define TMC_clampv_MASK 0xf7ffffff /* bit 27 */
-# define TMC_clampv_disable 0x0
-# define TMC_clampv_enable 0x8000000
-# define TMC_clampu_MASK 0xefffffff /* bit 28 */
-# define TMC_clampu_disable 0x0
-# define TMC_clampu_enable 0x10000000
-# define TMC_tmodulate_MASK 0xdfffffff /* bit 29 */
-# define TMC_tmodulate_disable 0x0
-# define TMC_tmodulate_enable 0x20000000
-# define TMC_strans_MASK 0xbfffffff /* bit 30 */
-# define TMC_strans_disable 0x0
-# define TMC_strans_enable 0x40000000
-# define TMC_itrans_MASK 0x7fffffff /* bit 31 */
-# define TMC_itrans_disable 0x0
-# define TMC_itrans_enable 0x80000000
-
-#define MGAREG_TEXCTL2 0x2c3c
-
-# define TMC_decalblend_MASK 0xfffffffe /* bit 0 */
-# define TMC_decalblend_disable 0x0
-# define TMC_decalblend_enable 0x1
-# define TMC_idecal_MASK 0xfffffffd /* bit 1 */
-# define TMC_idecal_disable 0x0
-# define TMC_idecal_enable 0x2
-# define TMC_decaldis_MASK 0xfffffffb /* bit 2 */
-# define TMC_decaldis_disable 0x0
-# define TMC_decaldis_enable 0x4
-# define TMC_ckstransdis_MASK 0xffffffef /* bit 4 */
-# define TMC_ckstransdis_disable 0x0
-# define TMC_ckstransdis_enable 0x10
-# define TMC_borderen_MASK 0xffffffdf /* bit 5 */
-# define TMC_borderen_disable 0x0
-# define TMC_borderen_enable 0x20
-# define TMC_specen_MASK 0xffffffbf /* bit 6 */
-# define TMC_specen_disable 0x0
-# define TMC_specen_enable 0x40
-# define TMC_dualtex_MASK 0xffffff7f /* bit 7 */
-# define TMC_dualtex_disable 0x0
-# define TMC_dualtex_enable 0x80
-# define TMC_tablefog_MASK 0xfffffeff /* bit 8 */
-# define TMC_tablefog_disable 0x0
-# define TMC_tablefog_enable 0x100
-# define TMC_bumpmap_MASK 0xfffffdff /* bit 9 */
-# define TMC_bumpmap_disable 0x0
-# define TMC_bumpmap_enable 0x200
-# define TMC_map1_MASK 0x7fffffff /* bit 31 */
-# define TMC_map1_disable 0x0
-# define TMC_map1_enable 0x80000000
-
-#define MGAREG_TEXFILTER 0x2c58
-
-# define TF_minfilter_MASK 0xfffffff0 /* bits 0-3 */
-# define TF_minfilter_nrst 0x0 /* val 0, shift 0 */
-# define TF_minfilter_bilin 0x2 /* val 2, shift 0 */
-# define TF_minfilter_cnst 0x3 /* val 3, shift 0 */
-# define TF_minfilter_mm1s 0x8 /* val 8, shift 0 */
-# define TF_minfilter_mm2s 0x9 /* val 9, shift 0 */
-# define TF_minfilter_mm4s 0xa /* val 10, shift 0 */
-# define TF_minfilter_mm8s 0xc /* val 12, shift 0 */
-# define TF_magfilter_MASK 0xffffff0f /* bits 4-7 */
-# define TF_magfilter_nrst 0x0 /* val 0, shift 4 */
-# define TF_magfilter_bilin 0x20 /* val 2, shift 4 */
-# define TF_magfilter_cnst 0x30 /* val 3, shift 4 */
-# define TF_uvoffset_SHIFT 17
-# define TF_uvoffset_OGL (0U << TF_uvoffset_SHIFT)
-# define TF_uvoffset_D3D (1U << TF_uvoffset_SHIFT)
-# define TF_uvoffset_MASK (~(1U << TF_uvoffset_SHIFT))
-# define TF_reserved_MASK (~0x1ff00) /* bits 8-16 */
-# define TF_mapnbhigh_SHIFT 18
-# define TF_mapnbhigh_MASK (~(1U << TF_mapnbhigh_SHIFT))
-# define TF_avgstride_MASK 0xfff7ffff /* bit 19 */
-# define TF_avgstride_disable 0x0
-# define TF_avgstride_enable 0x80000
-# define TF_filteralpha_MASK 0xffefffff /* bit 20 */
-# define TF_filteralpha_disable 0x0
-# define TF_filteralpha_enable 0x100000
-# define TF_fthres_MASK 0xe01fffff /* bits 21-28 */
-# define TF_fthres_SHIFT 21
-# define TF_mapnb_MASK 0x1fffffff /* bits 29-31 */
-# define TF_mapnb_SHIFT 29
-
-#define MGAREG_TEXHEIGHT 0x2c2c
-
-# define TH_th_MASK 0xffffffc0 /* bits 0-5 */
-# define TH_th_SHIFT 0
-# define TH_rfh_MASK 0xffff81ff /* bits 9-14 */
-# define TH_rfh_SHIFT 9
-# define TH_thmask_MASK 0xe003ffff /* bits 18-28 */
-# define TH_thmask_SHIFT 18
-
-#define MGAREG_TEXORG 0x2c24
-
-# define TO_texorgmap_MASK 0xfffffffe /* bit 0 */
-# define TO_texorgmap_fb 0x0
-# define TO_texorgmap_sys 0x1
-# define TO_texorgacc_MASK 0xfffffffd /* bit 1 */
-# define TO_texorgacc_pci 0x0
-# define TO_texorgacc_agp 0x2
-# define TO_texorgoffsetsel 0x4
-# define TO_texorg_MASK 0x1f /* bits 5-31 */
-# define TO_texorg_SHIFT 5
-
-#define MGAREG_TEXORG1 0x2ca4
-#define MGAREG_TEXORG2 0x2ca8
-#define MGAREG_TEXORG3 0x2cac
-#define MGAREG_TEXORG4 0x2cb0
-#define MGAREG_TEXTRANS 0x2c34
-
-# define TT_tckey_MASK 0xffff0000 /* bits 0-15 */
-# define TT_tckey_SHIFT 0
-# define TT_tkmask_MASK 0xffff /* bits 16-31 */
-# define TT_tkmask_SHIFT 16
-
-#define MGAREG_TEXTRANSHIGH 0x2c38
-
-# define TT_tckeyh_MASK 0xffff0000 /* bits 0-15 */
-# define TT_tckeyh_SHIFT 0
-# define TT_tkmaskh_MASK 0xffff /* bits 16-31 */
-# define TT_tkmaskh_SHIFT 16
-
-#define MGAREG_TEXWIDTH 0x2c28
-
-# define TW_tw_MASK 0xffffffc0 /* bits 0-5 */
-# define TW_tw_SHIFT 0
-# define TW_rfw_MASK 0xffff81ff /* bits 9-14 */
-# define TW_rfw_SHIFT 9
-# define TW_twmask_MASK 0xe003ffff /* bits 18-28 */
-# define TW_twmask_SHIFT 18
-
-#define MGAREG_TMR0 0x2c00
-#define MGAREG_TMR1 0x2c04
-#define MGAREG_TMR2 0x2c08
-#define MGAREG_TMR3 0x2c0c
-#define MGAREG_TMR4 0x2c10
-#define MGAREG_TMR5 0x2c14
-#define MGAREG_TMR6 0x2c18
-#define MGAREG_TMR7 0x2c1c
-#define MGAREG_TMR8 0x2c20
-#define MGAREG_VBIADDR0 0x3e08
-#define MGAREG_VBIADDR1 0x3e0c
-#define MGAREG_VCOUNT 0x1e20
-#define MGAREG_WACCEPTSEQ 0x1dd4
-
-# define WAS_seqdst0_MASK 0xffffffc0 /* bits 0-5 */
-# define WAS_seqdst0_SHIFT 0
-# define WAS_seqdst1_MASK 0xfffff03f /* bits 6-11 */
-# define WAS_seqdst1_SHIFT 6
-# define WAS_seqdst2_MASK 0xfffc0fff /* bits 12-17 */
-# define WAS_seqdst2_SHIFT 12
-# define WAS_seqdst3_MASK 0xff03ffff /* bits 18-23 */
-# define WAS_seqdst3_SHIFT 18
-# define WAS_seqlen_MASK 0xfcffffff /* bits 24-25 */
-# define WAS_wfirsttag_MASK 0xfbffffff /* bit 26 */
-# define WAS_wfirsttag_disable 0x0
-# define WAS_wfirsttag_enable 0x4000000
-# define WAS_wsametag_MASK 0xf7ffffff /* bit 27 */
-# define WAS_wsametag_disable 0x0
-# define WAS_wsametag_enable 0x8000000
-# define WAS_seqoff_MASK 0xefffffff /* bit 28 */
-# define WAS_seqoff_disable 0x0
-# define WAS_seqoff_enable 0x10000000
-
-#define MGAREG_WCODEADDR 0x1e6c
-
-# define WMA_wcodeaddr_MASK 0xff /* bits 8-31 */
-# define WMA_wcodeaddr_SHIFT 8
-
-#define MGAREG_WFLAG 0x1dc4
-
-# define WF_walustsflag_MASK 0xffffff00 /* bits 0-7 */
-# define WF_walustsflag_SHIFT 0
-# define WF_walucfgflag_MASK 0xffff00ff /* bits 8-15 */
-# define WF_walucfgflag_SHIFT 8
-# define WF_wprgflag_MASK 0xffff /* bits 16-31 */
-# define WF_wprgflag_SHIFT 16
-
-#define MGAREG_WFLAG1 0x1de0
-
-# define WF1_walustsflag1_MASK 0xffffff00 /* bits 0-7 */
-# define WF1_walustsflag1_SHIFT 0
-# define WF1_walucfgflag1_MASK 0xffff00ff /* bits 8-15 */
-# define WF1_walucfgflag1_SHIFT 8
-# define WF1_wprgflag1_MASK 0xffff /* bits 16-31 */
-# define WF1_wprgflag1_SHIFT 16
-
-#define MGAREG_WFLAGNB 0x1e64
-#define MGAREG_WFLAGNB1 0x1e08
-#define MGAREG_WGETMSB 0x1dc8
-
-# define WGV_wgetmsbmin_MASK 0xffffffe0 /* bits 0-4 */
-# define WGV_wgetmsbmin_SHIFT 0
-# define WGV_wgetmsbmax_MASK 0xffffe0ff /* bits 8-12 */
-# define WGV_wgetmsbmax_SHIFT 8
-# define WGV_wbrklefttop_MASK 0xfffeffff /* bit 16 */
-# define WGV_wbrklefttop_disable 0x0
-# define WGV_wbrklefttop_enable 0x10000
-# define WGV_wfastcrop_MASK 0xfffdffff /* bit 17 */
-# define WGV_wfastcrop_disable 0x0
-# define WGV_wfastcrop_enable 0x20000
-# define WGV_wcentersnap_MASK 0xfffbffff /* bit 18 */
-# define WGV_wcentersnap_disable 0x0
-# define WGV_wcentersnap_enable 0x40000
-# define WGV_wbrkrighttop_MASK 0xfff7ffff /* bit 19 */
-# define WGV_wbrkrighttop_disable 0x0
-# define WGV_wbrkrighttop_enable 0x80000
-
-#define MGAREG_WIADDR 0x1dc0
-
-# define WIA_wmode_MASK 0xfffffffc /* bits 0-1 */
-# define WIA_wmode_suspend 0x0 /* val 0, shift 0 */
-# define WIA_wmode_resume 0x1 /* val 1, shift 0 */
-# define WIA_wmode_jump 0x2 /* val 2, shift 0 */
-# define WIA_wmode_start 0x3 /* val 3, shift 0 */
-# define WIA_wagp_MASK 0xfffffffb /* bit 2 */
-# define WIA_wagp_pci 0x0
-# define WIA_wagp_agp 0x4
-# define WIA_wiaddr_MASK 0x7 /* bits 3-31 */
-# define WIA_wiaddr_SHIFT 3
-
-#define MGAREG_WIADDR2 0x1dd8
-
-# define WIA2_wmode_MASK 0xfffffffc /* bits 0-1 */
-# define WIA2_wmode_suspend 0x0 /* val 0, shift 0 */
-# define WIA2_wmode_resume 0x1 /* val 1, shift 0 */
-# define WIA2_wmode_jump 0x2 /* val 2, shift 0 */
-# define WIA2_wmode_start 0x3 /* val 3, shift 0 */
-# define WIA2_wagp_MASK 0xfffffffb /* bit 2 */
-# define WIA2_wagp_pci 0x0
-# define WIA2_wagp_agp 0x4
-# define WIA2_wiaddr_MASK 0x7 /* bits 3-31 */
-# define WIA2_wiaddr_SHIFT 3
-
-#define MGAREG_WIADDRNB 0x1e60
-#define MGAREG_WIADDRNB1 0x1e04
-#define MGAREG_WIADDRNB2 0x1e00
-#define MGAREG_WIMEMADDR 0x1e68
-
-# define WIMA_wimemaddr_MASK 0xffffff00 /* bits 0-7 */
-# define WIMA_wimemaddr_SHIFT 0
-
-#define MGAREG_WIMEMDATA 0x2000
-#define MGAREG_WIMEMDATA1 0x2100
-#define MGAREG_WMISC 0x1e70
-
-# define WM_wucodecache_MASK 0xfffffffe /* bit 0 */
-# define WM_wucodecache_disable 0x0
-# define WM_wucodecache_enable 0x1
-# define WM_wmaster_MASK 0xfffffffd /* bit 1 */
-# define WM_wmaster_disable 0x0
-# define WM_wmaster_enable 0x2
-# define WM_wcacheflush_MASK 0xfffffff7 /* bit 3 */
-# define WM_wcacheflush_disable 0x0
-# define WM_wcacheflush_enable 0x8
-
-#define MGAREG_WR 0x2d00
-#define MGAREG_WVRTXSZ 0x1dcc
-
-# define WVS_wvrtxsz_MASK 0xffffffc0 /* bits 0-5 */
-# define WVS_wvrtxsz_SHIFT 0
-# define WVS_primsz_MASK 0xffffc0ff /* bits 8-13 */
-# define WVS_primsz_SHIFT 8
-
-#define MGAREG_XDST 0x1cb0
-#define MGAREG_XYEND 0x1c44
-
-# define XYEA_x_end_MASK 0xffff0000 /* bits 0-15 */
-# define XYEA_x_end_SHIFT 0
-# define XYEA_y_end_MASK 0xffff /* bits 16-31 */
-# define XYEA_y_end_SHIFT 16
-
-#define MGAREG_XYSTRT 0x1c40
-
-# define XYSA_x_start_MASK 0xffff0000 /* bits 0-15 */
-# define XYSA_x_start_SHIFT 0
-# define XYSA_y_start_MASK 0xffff /* bits 16-31 */
-# define XYSA_y_start_SHIFT 16
-
-#define MGAREG_YBOT 0x1c9c
-#define MGAREG_YDST 0x1c90
-
-# define YA_ydst_MASK 0xff800000 /* bits 0-22 */
-# define YA_ydst_SHIFT 0
-# define YA_sellin_MASK 0x1fffffff /* bits 29-31 */
-# define YA_sellin_SHIFT 29
-
-#define MGAREG_YDSTLEN 0x1c88
-
-# define YDL_length_MASK 0xffff0000 /* bits 0-15 */
-# define YDL_length_SHIFT 0
-# define YDL_yval_MASK 0xffff /* bits 16-31 */
-# define YDL_yval_SHIFT 16
-
-#define MGAREG_YDSTORG 0x1c94
-#define MGAREG_YTOP 0x1c98
-#define MGAREG_ZORG 0x1c0c
-
-# define ZO_zorgmap_MASK 0xfffffffe /* bit 0 */
-# define ZO_zorgmap_fb 0x0
-# define ZO_zorgmap_sys 0x1
-# define ZO_zorgacc_MASK 0xfffffffd /* bit 1 */
-# define ZO_zorgacc_pci 0x0
-# define ZO_zorgacc_agp 0x2
-# define ZO_zorg_MASK 0x3 /* bits 2-31 */
-# define ZO_zorg_SHIFT 2
-
-
-
-
-/**************** (END) AUTOMATICLY GENERATED REGISTER FILE ******************/
-
-/* Copied from mga_drv.h kernel file.
- */
-
-#define MGA_ILOAD_ALIGN 64
-#define MGA_ILOAD_MASK (MGA_ILOAD_ALIGN - 1)
-
-#endif /* _MGAREGS_H_ */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgarender.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgarender.c
deleted file mode 100644
index 3080cea79..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgarender.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgarender.c,v 1.4 2002/10/30 12:51:36 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Simulate missing primitives with indexed vertices.
- */
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-
-#include "tnl/t_context.h"
-
-#include "mgacontext.h"
-#include "mgatris.h"
-#include "mgastate.h"
-#include "mgaioctl.h"
-#include "mgavb.h"
-
-#define HAVE_POINTS 0
-#define HAVE_LINES 0
-#define HAVE_LINE_STRIPS 0
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_POLYGONS 0
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-
-#define HAVE_ELTS 0 /* for now */
-
-static void mgaDmaPrimitive( GLcontext *ctx, GLenum prim )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint hwprim;
-
- switch (prim) {
- case GL_TRIANGLES:
- hwprim = MGA_WA_TRIANGLES;
- break;
- case GL_TRIANGLE_STRIP:
- if (mmesa->vertex_size == 8)
- hwprim = MGA_WA_TRISTRIP_T0;
- else
- hwprim = MGA_WA_TRISTRIP_T0T1;
- break;
- case GL_TRIANGLE_FAN:
- if (mmesa->vertex_size == 8)
- hwprim = MGA_WA_TRIFAN_T0;
- else
- hwprim = MGA_WA_TRIFAN_T0T1;
- break;
- default:
- return;
- }
-
- mgaRasterPrimitive( ctx, GL_TRIANGLES, hwprim );
-}
-
-
-#define LOCAL_VARS mgaContextPtr mmesa = MGA_CONTEXT(ctx)
-#define INIT( prim ) do { \
- if (0) fprintf(stderr, "%s\n", __FUNCTION__); \
- FLUSH_BATCH(mmesa); \
- mgaDmaPrimitive( ctx, prim ); \
-} while (0)
-#define FLUSH() FLUSH_BATCH( mmesa )
-#define GET_CURRENT_VB_MAX_VERTS() \
- 0 /* fix me */
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- MGA_BUFFER_SIZE / (mmesa->vertex_size * 4)
-
-
-#define ALLOC_VERTS( nr ) \
- mgaAllocDmaLow( mmesa, (nr) * mmesa->vertex_size * 4)
-#define EMIT_VERTS( ctx, j, nr, buf ) \
- mga_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
-
-
-#define TAG(x) mga_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-static GLboolean mga_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- /* Don't handle clipping or indexed vertices or vertex manipulations.
- */
- if (mmesa->RenderIndex != 0 ||
- !mga_validate_render( ctx, VB )) {
- return GL_TRUE;
- }
-
- tnl->Driver.Render.Start( ctx );
- mmesa->SetupNewInputs = ~0;
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- mga_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length,
- prim);
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-const struct tnl_pipeline_stage _mga_render_stage =
-{
- "mga render",
- NULL,
- NULL,
- NULL,
- NULL,
- mga_run_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.c
deleted file mode 100644
index c62b1c875..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.11 2002/10/30 12:51:36 alanh Exp $ */
-
-#include "mtypes.h"
-#include "mgadd.h"
-#include "mgacontext.h"
-#include "mgaspan.h"
-#include "mgaioctl.h"
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
- mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \
- __DRIscreenPrivate *sPriv = mmesa->driScreen; \
- GLuint pitch = mgaScreen->frontPitch; \
- GLuint height = dPriv->h; \
- char *read_buf = (char *)(sPriv->pFB + \
- mmesa->readOffset + \
- dPriv->x * mgaScreen->cpp + \
- dPriv->y * pitch); \
- char *buf = (char *)(sPriv->pFB + \
- mmesa->drawOffset + \
- dPriv->x * mgaScreen->cpp + \
- dPriv->y * pitch); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-
-
-#define LOCAL_DEPTH_VARS \
- mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
- mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \
- __DRIscreenPrivate *sPriv = mmesa->driScreen; \
- GLuint pitch = mgaScreen->frontPitch; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- mgaScreen->depthOffset + \
- dPriv->x * mgaScreen->cpp + \
- dPriv->y * pitch)
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define HW_LOCK()
-
-/* FIXME could/should we use dPriv->numClipRects like the other drivers? */
-#define HW_CLIPLOOP() \
- do { \
- int _nc = mmesa->numClipRects; \
- while (_nc--) { \
- int minx = mmesa->pClipRects[_nc].x1 - mmesa->drawX; \
- int miny = mmesa->pClipRects[_nc].y1 - mmesa->drawY; \
- int maxx = mmesa->pClipRects[_nc].x2 - mmesa->drawX; \
- int maxy = mmesa->pClipRects[_nc].y2 - mmesa->drawY;
-
-#define HW_ENDCLIPLOOP() \
- } \
- } while (0)
-
-#define HW_UNLOCK()
-
-
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) mga##x##_565
-#define TAG2(x,y) mga##x##_565##y
-#include "spantmp2.h"
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) mga##x##_8888
-#define TAG2(x,y) mga##x##_8888##y
-#include "spantmp2.h"
-
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
-
-#define TAG(x) mga##x##_16
-#include "depthtmp.h"
-
-
-
-
-/* 32 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch);
-
-#define TAG(x) mga##x##_32
-#include "depthtmp.h"
-
-
-
-/* 24/8 bit interleaved depth/stencil functions
- */
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \
- tmp &= 0xff; \
- tmp |= (d) << 8; \
- *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) { \
- d = (*(GLuint *)(buf + (_x)*4 + (_y)*pitch) & ~0xff) >> 8; \
-}
-
-#define TAG(x) mga##x##_24_8
-#include "depthtmp.h"
-
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
- tmp &= 0xffffff00; \
- tmp |= d & 0xff; \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xff;
-
-#define TAG(x) mga##x##_24_8
-#include "stenciltmp.h"
-
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer,
- GLuint bufferBit)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- unsigned int offset;
-
- assert((bufferBit == BUFFER_BIT_FRONT_LEFT) || (bufferBit == BUFFER_BIT_BACK_LEFT));
-
- offset = (bufferBit == BUFFER_BIT_FRONT_LEFT)
- ? mmesa->mgaScreen->frontOffset
- : mmesa->mgaScreen->backOffset;
-
- mmesa->drawOffset = offset;
- mmesa->readOffset = offset;
-
- assert( (buffer == mmesa->driDrawable->driverPrivate)
- || (buffer == mmesa->driReadable->driverPrivate) );
-
- mmesa->mesa_drawable = (buffer == mmesa->driDrawable->driverPrivate)
- ? mmesa->driDrawable : mmesa->driReadable;
-}
-
-void mgaSpanRenderStart( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- FLUSH_BATCH( mmesa );
- LOCK_HARDWARE_QUIESCENT( mmesa );
-}
-
-void mgaSpanRenderFinish( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( mmesa );
-}
-
-/**
- * Initialize the driver callbacks for the read / write span functions.
- *
- * \bug
- * To really support RGB888 and RGBA8888 visuals, we need separate read and
- * write routines for 888 and 8888. We also need to determine whether or not
- * the visual has destination alpha.
- */
-void mgaDDInitSpanFuncs( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = mgaDDSetBuffer;
-
- switch (mmesa->mgaScreen->cpp) {
- case 2:
-#if 0
- mgaInitPointers_565( swdd );
- swdd->ReadDepthSpan = mgaReadDepthSpan_16;
- swdd->WriteDepthSpan = mgaWriteDepthSpan_16;
- swdd->ReadDepthPixels = mgaReadDepthPixels_16;
- swdd->WriteDepthPixels = mgaWriteDepthPixels_16;
-#endif
- break;
-
- case 4:
-#if 0
- mgaInitPointers_8888( swdd );
-
- if (!mmesa->hw_stencil) {
- swdd->ReadDepthSpan = mgaReadDepthSpan_32;
- swdd->WriteDepthSpan = mgaWriteDepthSpan_32;
- swdd->ReadDepthPixels = mgaReadDepthPixels_32;
- swdd->WriteDepthPixels = mgaWriteDepthPixels_32;
- } else {
- swdd->ReadDepthSpan = mgaReadDepthSpan_24_8;
- swdd->WriteDepthSpan = mgaWriteDepthSpan_24_8;
- swdd->ReadDepthPixels = mgaReadDepthPixels_24_8;
- swdd->WriteDepthPixels = mgaWriteDepthPixels_24_8;
-
- swdd->ReadStencilSpan = mgaReadStencilSpan_24_8;
- swdd->WriteStencilSpan = mgaWriteStencilSpan_24_8;
- swdd->ReadStencilPixels = mgaReadStencilPixels_24_8;
- swdd->WriteStencilPixels = mgaWriteStencilPixels_24_8;
- }
-#endif
- break;
- }
- swdd->SpanRenderStart = mgaSpanRenderStart;
- swdd->SpanRenderFinish = mgaSpanRenderFinish;
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-mgaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- mgaInitPointers_565(&drb->Base);
- }
- else {
- mgaInitPointers_8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = mgaReadDepthSpan_16;
- drb->Base.GetValues = mgaReadDepthPixels_16;
- drb->Base.PutRow = mgaWriteDepthSpan_16;
- drb->Base.PutMonoRow = mgaWriteMonoDepthSpan_16;
- drb->Base.PutValues = mgaWriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = mgaReadDepthSpan_24_8;
- drb->Base.GetValues = mgaReadDepthPixels_24_8;
- drb->Base.PutRow = mgaWriteDepthSpan_24_8;
- drb->Base.PutMonoRow = mgaWriteMonoDepthSpan_24_8;
- drb->Base.PutValues = mgaWriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
- drb->Base.GetRow = mgaReadDepthSpan_32;
- drb->Base.GetValues = mgaReadDepthPixels_32;
- drb->Base.PutRow = mgaWriteDepthSpan_32;
- drb->Base.PutMonoRow = mgaWriteMonoDepthSpan_32;
- drb->Base.PutValues = mgaWriteDepthPixels_32;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = mgaReadStencilSpan_24_8;
- drb->Base.GetValues = mgaReadStencilPixels_24_8;
- drb->Base.PutRow = mgaWriteStencilSpan_24_8;
- drb->Base.PutMonoRow = mgaWriteMonoStencilSpan_24_8;
- drb->Base.PutValues = mgaWriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.h
deleted file mode 100644
index f133a51c0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgaspan.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.h,v 1.3 2002/10/30 12:51:36 alanh Exp $ */
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef _MGA_SPAN_H
-#define _MGA_SPAN_H
-
-#include "drirenderbuffer.h"
-
-extern void mgaDDInitSpanFuncs( GLcontext *ctx );
-
-extern void
-mgaSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.c
deleted file mode 100644
index 72d5c9fb0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.c
+++ /dev/null
@@ -1,1237 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.13 2002/10/30 12:51:36 alanh Exp $ */
-
-
-#include "mtypes.h"
-#include "buffers.h"
-#include "colormac.h"
-#include "dd.h"
-
-#include "mm.h"
-#include "mgacontext.h"
-#include "mgadd.h"
-#include "mgastate.h"
-#include "mgatex.h"
-#include "mgavb.h"
-#include "mgatris.h"
-#include "mgaioctl.h"
-#include "mgaregs.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "xmlpool.h"
-
-static void updateSpecularLighting( GLcontext *ctx );
-
-static const GLuint mgarop_NoBLK[16] = {
- DC_atype_rpl | 0x00000000, DC_atype_rstr | 0x00080000,
- DC_atype_rstr | 0x00040000, DC_atype_rpl | 0x000c0000,
- DC_atype_rstr | 0x00020000, DC_atype_rstr | 0x000a0000,
- DC_atype_rstr | 0x00060000, DC_atype_rstr | 0x000e0000,
- DC_atype_rstr | 0x00010000, DC_atype_rstr | 0x00090000,
- DC_atype_rstr | 0x00050000, DC_atype_rstr | 0x000d0000,
- DC_atype_rpl | 0x00030000, DC_atype_rstr | 0x000b0000,
- DC_atype_rstr | 0x00070000, DC_atype_rpl | 0x000f0000
-};
-
-/* =============================================================
- * Alpha blending
- */
-
-static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLubyte refByte;
- GLuint a;
-
- CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
- switch ( func ) {
- case GL_NEVER:
- a = AC_atmode_alt;
- refByte = 0;
- break;
- case GL_LESS:
- a = AC_atmode_alt;
- break;
- case GL_GEQUAL:
- a = AC_atmode_agte;
- break;
- case GL_LEQUAL:
- a = AC_atmode_alte;
- break;
- case GL_GREATER:
- a = AC_atmode_agt;
- break;
- case GL_NOTEQUAL:
- a = AC_atmode_ane;
- break;
- case GL_EQUAL:
- a = AC_atmode_ae;
- break;
- case GL_ALWAYS:
- a = AC_atmode_noacmp;
- break;
- default:
- a = 0;
- break;
- }
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.alpha_func = a | MGA_FIELD( AC_atref, refByte );
-}
-
-static void updateBlendLogicOp(GLcontext *ctx)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
-
- mmesa->hw.blend_func_enable =
- (ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled) ? ~0 : 0;
-
- FALLBACK( ctx, MGA_FALLBACK_BLEND,
- ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled &&
- mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
-}
-
-static void mgaDDBlendEquationSeparate(GLcontext *ctx,
- GLenum modeRGB, GLenum modeA)
-{
- assert( modeRGB == modeA );
- updateBlendLogicOp( ctx );
-}
-
-static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint src;
- GLuint dst;
-
- switch (ctx->Color.BlendSrcRGB) {
- case GL_ZERO:
- src = AC_src_zero; break;
- case GL_SRC_ALPHA:
- src = AC_src_src_alpha; break;
- case GL_ONE:
- default: /* never happens */
- src = AC_src_one; break;
- case GL_DST_COLOR:
- src = AC_src_dst_color; break;
- case GL_ONE_MINUS_DST_COLOR:
- src = AC_src_om_dst_color; break;
- case GL_ONE_MINUS_SRC_ALPHA:
- src = AC_src_om_src_alpha; break;
- case GL_DST_ALPHA:
- src = (ctx->Visual.alphaBits > 0)
- ? AC_src_dst_alpha : AC_src_one;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- src = (ctx->Visual.alphaBits > 0)
- ? AC_src_om_dst_alpha : AC_src_zero;
- break;
- case GL_SRC_ALPHA_SATURATE:
- src = (ctx->Visual.alphaBits > 0)
- ? AC_src_src_alpha_sat : AC_src_zero;
- break;
- }
-
- switch (ctx->Color.BlendDstRGB) {
- case GL_SRC_ALPHA:
- dst = AC_dst_src_alpha; break;
- case GL_ONE_MINUS_SRC_ALPHA:
- dst = AC_dst_om_src_alpha; break;
- default: /* never happens */
- case GL_ZERO:
- dst = AC_dst_zero; break;
- case GL_ONE:
- dst = AC_dst_one; break;
- case GL_SRC_COLOR:
- dst = AC_dst_src_color; break;
- case GL_ONE_MINUS_SRC_COLOR:
- dst = AC_dst_om_src_color; break;
- case GL_DST_ALPHA:
- dst = (ctx->Visual.alphaBits > 0)
- ? AC_dst_dst_alpha : AC_dst_one;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- dst = (ctx->Visual.alphaBits > 0)
- ? AC_dst_om_dst_alpha : AC_dst_zero;
- break;
- }
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.blend_func = (src | dst);
-
- FALLBACK( ctx, MGA_FALLBACK_BLEND,
- ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled &&
- mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
-}
-
-/* =============================================================
- * Depth testing
- */
-
-static void mgaDDDepthFunc(GLcontext *ctx, GLenum func)
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- int zmode;
-
- switch (func) {
- case GL_NEVER:
- /* can't do this in h/w, we'll use a s/w fallback */
- FALLBACK (ctx, MGA_FALLBACK_DEPTH, ctx->Depth.Test);
-
- /* FALLTHROUGH */
- case GL_ALWAYS:
- zmode = DC_zmode_nozcmp; break;
- case GL_LESS:
- zmode = DC_zmode_zlt; break;
- case GL_LEQUAL:
- zmode = DC_zmode_zlte; break;
- case GL_EQUAL:
- zmode = DC_zmode_ze; break;
- case GL_GREATER:
- zmode = DC_zmode_zgt; break;
- case GL_GEQUAL:
- zmode = DC_zmode_zgte; break;
- case GL_NOTEQUAL:
- zmode = DC_zmode_zne; break;
- default:
- zmode = 0; break;
- }
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.zmode &= DC_zmode_MASK;
- mmesa->hw.zmode |= zmode;
-}
-
-static void mgaDDDepthMask(GLcontext *ctx, GLboolean flag)
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.zmode &= DC_atype_MASK;
- mmesa->hw.zmode |= (flag) ? DC_atype_zi : DC_atype_i;
-}
-
-
-static void mgaDDClearDepth(GLcontext *ctx, GLclampd d)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- /* Select the Z depth. The ~ is used because the _MASK values in the
- * MGA driver are used to mask OFF the selected bits. In this case,
- * we want to mask off everything except the MA_zwidth bits.
- */
- switch (mmesa->setup.maccess & ~MA_zwidth_MASK) {
- case MA_zwidth_16: mmesa->ClearDepth = d * 0x0000ffff; break;
- case MA_zwidth_24: mmesa->ClearDepth = d * 0xffffff00; break;
- case MA_zwidth_32: mmesa->ClearDepth = d * 0xffffffff; break;
- default: return;
- }
-}
-
-
-/* =============================================================
- * Fog
- */
-
-
-static void mgaDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- if (pname == GL_FOG_COLOR) {
- GLuint color = PACK_COLOR_888((GLubyte)(ctx->Fog.Color[0]*255.0F),
- (GLubyte)(ctx->Fog.Color[1]*255.0F),
- (GLubyte)(ctx->Fog.Color[2]*255.0F));
-
- MGA_STATECHANGE(mmesa, MGA_UPLOAD_CONTEXT);
- mmesa->setup.fogcolor = color;
- }
-}
-
-
-/* =============================================================
- * Scissoring
- */
-
-
-void mgaUpdateClipping(const GLcontext *ctx)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- if (mmesa->driDrawable)
- {
- int x1 = mmesa->driDrawable->x + ctx->Scissor.X;
- int y1 = mmesa->driDrawable->y + mmesa->driDrawable->h
- - (ctx->Scissor.Y + ctx->Scissor.Height);
- int x2 = x1 + ctx->Scissor.Width;
- int y2 = y1 + ctx->Scissor.Height;
-
- if (x1 < 0) x1 = 0;
- if (y1 < 0) y1 = 0;
- if (x2 < 0) x2 = 0;
- if (y2 < 0) y2 = 0;
-
- mmesa->scissor_rect.x1 = x1;
- mmesa->scissor_rect.y1 = y1;
- mmesa->scissor_rect.x2 = x2;
- mmesa->scissor_rect.y2 = y2;
-
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
- }
-}
-
-
-static void mgaDDScissor( GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h )
-{
- if ( ctx->Scissor.Enabled ) {
- FLUSH_BATCH( MGA_CONTEXT(ctx) ); /* don't pipeline cliprect changes */
- mgaUpdateClipping( ctx );
- }
-}
-
-
-/* =============================================================
- * Culling
- */
-
-
-#define _CULL_DISABLE 0
-#define _CULL_NEGATIVE ((1<<11)|(1<<5)|(1<<16))
-#define _CULL_POSITIVE (1<<11)
-
-static void mgaDDCullFaceFrontFace(GLcontext *ctx, GLenum unused)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK)
- {
- mmesa->hw.cull = _CULL_NEGATIVE;
-
- if (ctx->Polygon.CullFaceMode == GL_FRONT)
- mmesa->hw.cull ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE);
-
- if (ctx->Polygon.FrontFace != GL_CCW)
- mmesa->hw.cull ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE);
-
- mmesa->hw.cull_dualtex = mmesa->hw.cull ^
- (_CULL_POSITIVE ^ _CULL_NEGATIVE); /* warp bug? */
- }
- else {
- mmesa->hw.cull = _CULL_DISABLE;
- mmesa->hw.cull_dualtex = _CULL_DISABLE;
- }
-}
-
-
-/* =============================================================
- * Masks
- */
-
-static void mgaDDColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- mgaScreenPrivate *mgaScreen = mmesa->mgaScreen;
-
-
- GLuint mask = mgaPackColor(mgaScreen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP]);
-
- if (mgaScreen->cpp == 2)
- mask = mask | (mask << 16);
-
- if (mmesa->setup.plnwt != mask) {
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->setup.plnwt = mask;
- }
-}
-
-
-/* =============================================================
- * Polygon state
- */
-
-static int mgaStipples[16] = {
- 0xffff,
- 0xa5a5,
- 0x5a5a,
- 0xa0a0,
- 0x5050,
- 0x0a0a,
- 0x0505,
- 0x8020,
- 0x0401,
- 0x1040,
- 0x0208,
- 0x0802,
- 0x4010,
- 0x0104,
- 0x2080,
- 0x0000
-};
-
-/**
- * The MGA supports a subset of possible 4x4 stipples natively, GL
- * wants 32x32. Fortunately stipple is usually a repeating pattern.
- *
- * \param ctx GL rendering context to be affected
- * \param mask Pointer to the 32x32 stipple mask
- */
-
-static void mgaDDPolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const GLubyte *m = mask;
- GLubyte p[4];
- int i,j,k;
- int active = (ctx->Polygon.StippleFlag &&
- mmesa->raster_primitive == GL_TRIANGLES);
- GLuint stipple;
-
- FLUSH_BATCH(mmesa);
- mmesa->haveHwStipple = 0;
-
- if (active) {
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
- mmesa->setup.dwgctl &= ~(0xf<<20);
- }
-
- p[0] = mask[0] & 0xf; p[0] |= p[0] << 4;
- p[1] = mask[4] & 0xf; p[1] |= p[1] << 4;
- p[2] = mask[8] & 0xf; p[2] |= p[2] << 4;
- p[3] = mask[12] & 0xf; p[3] |= p[3] << 4;
-
- for (k = 0 ; k < 8 ; k++)
- for (j = 0 ; j < 4; j++)
- for (i = 0 ; i < 4 ; i++)
- if (*m++ != p[j]) {
- return;
- }
-
- stipple = ( ((p[0] & 0xf) << 0) |
- ((p[1] & 0xf) << 4) |
- ((p[2] & 0xf) << 8) |
- ((p[3] & 0xf) << 12) );
-
- for (i = 0 ; i < 16 ; i++)
- if (mgaStipples[i] == stipple) {
- mmesa->poly_stipple = i<<20;
- mmesa->haveHwStipple = 1;
- break;
- }
-
- if (active) {
- mmesa->setup.dwgctl &= ~(0xf<<20);
- mmesa->setup.dwgctl |= mmesa->poly_stipple;
- }
-}
-
-
-/* =============================================================
- * Rendering attributes
- *
- * We really don't want to recalculate all this every time we bind a
- * texture. These things shouldn't change all that often, so it makes
- * sense to break them out of the core texture state update routines.
- */
-
-static void updateSpecularLighting( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- unsigned int specen;
-
- specen = NEED_SECONDARY_COLOR(ctx) ? TMC_specen_enable : 0;
-
- if ( specen != mmesa->hw.specen ) {
- mmesa->hw.specen = specen;
- mmesa->dirty |= MGA_UPLOAD_TEX0 | MGA_UPLOAD_TEX1;
- }
-}
-
-
-/* =============================================================
- * Materials
- */
-
-
-static void mgaDDLightModelfv(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) {
- FLUSH_BATCH( MGA_CONTEXT(ctx) );
- updateSpecularLighting( ctx );
- }
-}
-
-
-/* =============================================================
- * Stencil
- */
-
-
-static void mgaDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint stencil;
- GLuint stencilctl;
-
- stencil = MGA_FIELD( S_sref, ref ) | MGA_FIELD( S_smsk, mask );
- switch (func)
- {
- case GL_NEVER:
- stencilctl = SC_smode_snever;
- break;
- case GL_LESS:
- stencilctl = SC_smode_slt;
- break;
- case GL_LEQUAL:
- stencilctl = SC_smode_slte;
- break;
- case GL_GREATER:
- stencilctl = SC_smode_sgt;
- break;
- case GL_GEQUAL:
- stencilctl = SC_smode_sgte;
- break;
- case GL_NOTEQUAL:
- stencilctl = SC_smode_sne;
- break;
- case GL_EQUAL:
- stencilctl = SC_smode_se;
- break;
- case GL_ALWAYS:
- default:
- stencilctl = SC_smode_salways;
- break;
- }
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.stencil &= (S_sref_MASK & S_smsk_MASK);
- mmesa->hw.stencil |= stencil;
- mmesa->hw.stencilctl &= SC_smode_MASK;
- mmesa->hw.stencilctl |= stencilctl;
-}
-
-static void mgaDDStencilMask(GLcontext *ctx, GLuint mask)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.stencil &= S_swtmsk_MASK;
- mmesa->hw.stencil |= MGA_FIELD( S_swtmsk, mask );
-}
-
-static void mgaDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint stencilctl;
-
- stencilctl = 0;
- switch (ctx->Stencil.FailFunc[0])
- {
- case GL_KEEP:
- stencilctl |= SC_sfailop_keep;
- break;
- case GL_ZERO:
- stencilctl |= SC_sfailop_zero;
- break;
- case GL_REPLACE:
- stencilctl |= SC_sfailop_replace;
- break;
- case GL_INCR:
- stencilctl |= SC_sfailop_incrsat;
- break;
- case GL_DECR:
- stencilctl |= SC_sfailop_decrsat;
- break;
- case GL_INCR_WRAP:
- stencilctl |= SC_sfailop_incr;
- break;
- case GL_DECR_WRAP:
- stencilctl |= SC_sfailop_decr;
- break;
- case GL_INVERT:
- stencilctl |= SC_sfailop_invert;
- break;
- default:
- break;
- }
-
- switch (ctx->Stencil.ZFailFunc[0])
- {
- case GL_KEEP:
- stencilctl |= SC_szfailop_keep;
- break;
- case GL_ZERO:
- stencilctl |= SC_szfailop_zero;
- break;
- case GL_REPLACE:
- stencilctl |= SC_szfailop_replace;
- break;
- case GL_INCR:
- stencilctl |= SC_szfailop_incrsat;
- break;
- case GL_DECR:
- stencilctl |= SC_szfailop_decrsat;
- break;
- case GL_INCR_WRAP:
- stencilctl |= SC_szfailop_incr;
- break;
- case GL_DECR_WRAP:
- stencilctl |= SC_szfailop_decr;
- break;
- case GL_INVERT:
- stencilctl |= SC_szfailop_invert;
- break;
- default:
- break;
- }
-
- switch (ctx->Stencil.ZPassFunc[0])
- {
- case GL_KEEP:
- stencilctl |= SC_szpassop_keep;
- break;
- case GL_ZERO:
- stencilctl |= SC_szpassop_zero;
- break;
- case GL_REPLACE:
- stencilctl |= SC_szpassop_replace;
- break;
- case GL_INCR:
- stencilctl |= SC_szpassop_incrsat;
- break;
- case GL_DECR:
- stencilctl |= SC_szpassop_decrsat;
- break;
- case GL_INCR_WRAP:
- stencilctl |= SC_szpassop_incr;
- break;
- case GL_DECR_WRAP:
- stencilctl |= SC_szpassop_decr;
- break;
- case GL_INVERT:
- stencilctl |= SC_szpassop_invert;
- break;
- default:
- break;
- }
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.stencilctl &= (SC_sfailop_MASK & SC_szfailop_MASK
- & SC_szpassop_MASK);
- mmesa->hw.stencilctl |= stencilctl;
-}
-
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-void mgaCalcViewport( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = mmesa->hw_viewport;
-
- /* See also mga_translate_vertex.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + mmesa->drawX + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + mmesa->driDrawable->h + mmesa->drawY + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * mmesa->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * mmesa->depth_scale;
-
- mmesa->SetupNewInputs = ~0;
-}
-
-static void mgaViewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- mgaCalcViewport( ctx );
-}
-
-static void mgaDepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- mgaCalcViewport( ctx );
-}
-
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void mgaDDClearColor(GLcontext *ctx,
- const GLfloat color[4] )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLubyte c[4];
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
-
- mmesa->ClearColor = mgaPackColor( mmesa->mgaScreen->cpp,
- c[0], c[1], c[2], c[3]);
-}
-
-
-/* Fallback to swrast for select and feedback.
- */
-static void mgaRenderMode( GLcontext *ctx, GLenum mode )
-{
- FALLBACK( ctx, MGA_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
-}
-
-
-static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.rop = mgarop_NoBLK[ opcode & 0x0f ];
-}
-
-
-static void mgaXMesaSetFrontClipRects( mgaContextPtr mmesa )
-{
- __DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
-
- if (driDrawable->numClipRects == 0) {
- static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
- mmesa->numClipRects = 1;
- mmesa->pClipRects = &zeroareacliprect;
- } else {
- mmesa->numClipRects = driDrawable->numClipRects;
- mmesa->pClipRects = driDrawable->pClipRects;
- }
- mmesa->drawX = driDrawable->x;
- mmesa->drawY = driDrawable->y;
-
- mmesa->setup.dstorg = mmesa->drawOffset;
- mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
-}
-
-
-static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa )
-{
- __DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
-
- if (driDrawable->numBackClipRects == 0)
- {
- if (driDrawable->numClipRects == 0) {
- static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
- mmesa->numClipRects = 1;
- mmesa->pClipRects = &zeroareacliprect;
- } else {
- mmesa->numClipRects = driDrawable->numClipRects;
- mmesa->pClipRects = driDrawable->pClipRects;
- }
- mmesa->drawX = driDrawable->x;
- mmesa->drawY = driDrawable->y;
- } else {
- mmesa->numClipRects = driDrawable->numBackClipRects;
- mmesa->pClipRects = driDrawable->pBackClipRects;
- mmesa->drawX = driDrawable->backX;
- mmesa->drawY = driDrawable->backY;
- }
-
- mmesa->setup.dstorg = mmesa->drawOffset;
- mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
-}
-
-
-void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
-{
- __DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
- drm_mga_sarea_t *sarea = mmesa->sarea;
-
-
- DRI_VALIDATE_DRAWABLE_INFO(mmesa->driScreen, driDrawable);
- mmesa->dirty_cliprects = 0;
-
- if (mmesa->draw_buffer == MGA_FRONT)
- mgaXMesaSetFrontClipRects( mmesa );
- else
- mgaXMesaSetBackClipRects( mmesa );
-
- sarea->req_drawable = driDrawable->draw;
- sarea->req_draw_buffer = mmesa->draw_buffer;
-
- mgaUpdateClipping( mmesa->glCtx );
- mgaCalcViewport( mmesa->glCtx );
-
- mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
-}
-
-
-static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- FLUSH_BATCH( mmesa );
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
- mmesa->draw_buffer = MGA_FRONT;
- mgaXMesaSetFrontClipRects( mmesa );
- FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case BUFFER_BIT_BACK_LEFT:
- mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
- mmesa->draw_buffer = MGA_BACK;
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
- mgaXMesaSetBackClipRects( mmesa );
- FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that r200SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-}
-
-
-static void mgaDDReadBuffer(GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-
-/* =============================================================
- * State enable/disable
- */
-
-
-static void mgaDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
- switch(cap) {
- case GL_DITHER:
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- if (!ctx->Color.DitherFlag)
- mmesa->setup.maccess |= MA_nodither_enable;
- else
- mmesa->setup.maccess &= ~MA_nodither_enable;
- break;
- case GL_LIGHTING:
- case GL_COLOR_SUM_EXT:
- FLUSH_BATCH( mmesa );
- updateSpecularLighting( ctx );
- break;
- case GL_ALPHA_TEST:
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->hw.alpha_func_enable = (state) ? ~0 : 0;
- break;
- case GL_DEPTH_TEST:
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- FALLBACK (ctx, MGA_FALLBACK_DEPTH,
- ctx->Depth.Func == GL_NEVER && ctx->Depth.Test);
- break;
-
- case GL_SCISSOR_TEST:
- FLUSH_BATCH( mmesa );
- mmesa->scissor = state;
- mgaUpdateClipping( ctx );
- break;
-
- case GL_FOG:
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- if (ctx->Fog.Enabled)
- mmesa->setup.maccess |= MA_fogen_enable;
- else
- mmesa->setup.maccess &= ~MA_fogen_enable;
- break;
- case GL_CULL_FACE:
- mgaDDCullFaceFrontFace( ctx, 0 );
- break;
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- break;
- case GL_POLYGON_STIPPLE:
- if (mmesa->haveHwStipple && mmesa->raster_primitive == GL_TRIANGLES) {
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- mmesa->setup.dwgctl &= ~(0xf<<20);
- if (state)
- mmesa->setup.dwgctl |= mmesa->poly_stipple;
- }
- break;
-
- case GL_BLEND:
- case GL_COLOR_LOGIC_OP:
- updateBlendLogicOp( ctx );
- break;
-
- case GL_STENCIL_TEST:
- MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
- if (mmesa->hw_stencil) {
- mmesa->hw.stencil_enable = ( state ) ? ~0 : 0;
- }
- else {
- FALLBACK( ctx, MGA_FALLBACK_STENCIL, state );
- }
- default:
- break;
- }
-}
-
-
-/* =============================================================
- */
-
-static void mgaDDPrintDirty( const char *msg, GLuint state )
-{
- fprintf(stderr, "%s (0x%03x): %s%s%s%s%s%s%s\n",
- msg,
- (unsigned int) state,
- (state & MGA_WAIT_AGE) ? "wait-age " : "",
- (state & MGA_UPLOAD_TEX0IMAGE) ? "upload-tex0-img " : "",
- (state & MGA_UPLOAD_TEX1IMAGE) ? "upload-tex1-img " : "",
- (state & MGA_UPLOAD_CONTEXT) ? "upload-ctx " : "",
- (state & MGA_UPLOAD_TEX0) ? "upload-tex0 " : "",
- (state & MGA_UPLOAD_TEX1) ? "upload-tex1 " : "",
- (state & MGA_UPLOAD_PIPE) ? "upload-pipe " : ""
- );
-}
-
-/* Push the state into the sarea and/or texture memory.
- */
-void mgaEmitHwStateLocked( mgaContextPtr mmesa )
-{
- drm_mga_sarea_t *sarea = mmesa->sarea;
- GLcontext * ctx = mmesa->glCtx;
-
- if (MGA_DEBUG & DEBUG_VERBOSE_MSG)
- mgaDDPrintDirty( __FUNCTION__, mmesa->dirty );
-
- if (mmesa->dirty & MGA_UPLOAD_CONTEXT) {
- mmesa->setup.wflag = _CULL_DISABLE;
- if (mmesa->raster_primitive == GL_TRIANGLES) {
- if ((ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
- ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT)) {
- mmesa->setup.wflag = mmesa->hw.cull_dualtex;
- }
- else {
- mmesa->setup.wflag = mmesa->hw.cull;
- }
- }
-
- mmesa->setup.stencil = mmesa->hw.stencil
- & mmesa->hw.stencil_enable;
- mmesa->setup.stencilctl = mmesa->hw.stencilctl
- & mmesa->hw.stencil_enable;
-
- /* If depth testing is not enabled, then use the no Z-compare / no
- * Z-write mode. Otherwise, use whatever is set in hw.zmode.
- */
- mmesa->setup.dwgctl &= (DC_zmode_MASK & DC_atype_MASK);
- mmesa->setup.dwgctl |= (ctx->Depth.Test)
- ? mmesa->hw.zmode : (DC_zmode_nozcmp | DC_atype_i);
-
- mmesa->setup.dwgctl &= DC_bop_MASK;
- mmesa->setup.dwgctl |= (ctx->Color._LogicOpEnabled)
- ? mmesa->hw.rop : mgarop_NoBLK[ GL_COPY & 0x0f ];
-
- mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK
- & AC_atref_MASK & AC_alphasel_MASK;
- mmesa->setup.alphactrl |=
- (mmesa->hw.alpha_func & mmesa->hw.alpha_func_enable) |
- (mmesa->hw.blend_func & mmesa->hw.blend_func_enable) |
- ((AC_src_one | AC_dst_zero) & ~mmesa->hw.blend_func_enable) |
- mmesa->hw.alpha_sel;
-
- memcpy( &sarea->context_state, &mmesa->setup, sizeof(mmesa->setup));
- }
-
- if ((mmesa->dirty & MGA_UPLOAD_TEX0) && mmesa->CurrentTexObj[0]) {
- memcpy(&sarea->tex_state[0],
- &mmesa->CurrentTexObj[0]->setup,
- sizeof(sarea->tex_state[0]));
- }
-
- if ((mmesa->dirty & MGA_UPLOAD_TEX1) && mmesa->CurrentTexObj[1]) {
- memcpy(&sarea->tex_state[1],
- &mmesa->CurrentTexObj[1]->setup,
- sizeof(sarea->tex_state[1]));
- }
-
- if (mmesa->dirty & (MGA_UPLOAD_TEX0 | MGA_UPLOAD_TEX1)) {
- sarea->tex_state[0].texctl2 &= ~TMC_specen_enable;
- sarea->tex_state[1].texctl2 &= ~TMC_specen_enable;
- sarea->tex_state[0].texctl2 |= mmesa->hw.specen;
- sarea->tex_state[1].texctl2 |= mmesa->hw.specen;
- }
-
- if (mmesa->dirty & MGA_UPLOAD_PIPE) {
-/* mmesa->sarea->wacceptseq = mmesa->hw_primitive; */
- mmesa->sarea->warp_pipe = mmesa->vertex_format;
- mmesa->sarea->vertsize = mmesa->vertex_size;
- }
-
- mmesa->sarea->dirty |= mmesa->dirty;
- mmesa->dirty &= MGA_UPLOAD_CLIPRECTS;
-}
-
-/* =============================================================
- */
-
-
-static void mgaDDValidateState( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
- FLUSH_BATCH( mmesa );
-
- if (mmesa->NewGLState & _NEW_TEXTURE) {
- mgaUpdateTextureState(ctx);
- }
-
- if (!mmesa->Fallback) {
- if (mmesa->NewGLState & _MGA_NEW_RASTERSETUP) {
- mgaChooseVertexState( ctx );
- }
-
- if (mmesa->NewGLState & _MGA_NEW_RENDERSTATE) {
- mgaChooseRenderState( ctx );
- }
- }
-
- mmesa->NewGLState = 0;
-}
-
-
-static void mgaDDInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- MGA_CONTEXT(ctx)->NewGLState |= new_state;
-}
-
-
-static void mgaRunPipeline( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- if (mmesa->NewGLState) {
- mgaDDValidateState( ctx );
- }
-
- if (mmesa->dirty) {
- mgaEmitHwStateLocked( mmesa );
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-
-void mgaInitState( mgaContextPtr mmesa )
-{
- mgaScreenPrivate *mgaScreen = mmesa->mgaScreen;
- GLcontext *ctx = mmesa->glCtx;
-
- if (ctx->Visual.doubleBufferMode) {
- /* use back buffer by default */
- mmesa->draw_buffer = MGA_BACK;
- mmesa->drawOffset = mmesa->mgaScreen->backOffset;
- mmesa->readOffset = mmesa->mgaScreen->backOffset;
- mmesa->setup.dstorg = mgaScreen->backOffset;
- } else {
- /* use front buffer by default */
- mmesa->draw_buffer = MGA_FRONT;
- mmesa->drawOffset = mmesa->mgaScreen->frontOffset;
- mmesa->readOffset = mmesa->mgaScreen->frontOffset;
- mmesa->setup.dstorg = mgaScreen->frontOffset;
- }
-
- mmesa->setup.maccess = (MA_memreset_disable |
- MA_fogen_disable |
- MA_tlutload_disable |
- MA_nodither_disable |
- MA_dit555_disable);
- if (driQueryOptioni (&mmesa->optionCache, "color_reduction") !=
- DRI_CONF_COLOR_REDUCTION_DITHER)
- mmesa->setup.maccess |= MA_nodither_enable;
-
- switch (mmesa->mgaScreen->cpp) {
- case 2:
- mmesa->setup.maccess |= MA_pwidth_16;
- break;
- case 4:
- mmesa->setup.maccess |= MA_pwidth_32;
- break;
- default:
- fprintf( stderr, "Error: unknown cpp %d, exiting...\n",
- mmesa->mgaScreen->cpp );
- exit( 1 );
- }
-
- switch (mmesa->glCtx->Visual.depthBits) {
- case 16:
- mmesa->setup.maccess |= MA_zwidth_16;
- break;
- case 24:
- mmesa->setup.maccess |= MA_zwidth_24;
- break;
- case 32:
- mmesa->setup.maccess |= MA_zwidth_32;
- break;
- }
-
- mmesa->hw.blend_func = AC_src_one | AC_dst_zero;
- mmesa->hw.blend_func_enable = 0;
- mmesa->hw.alpha_func = AC_atmode_noacmp | MGA_FIELD( AC_atref, 0x00 );
- mmesa->hw.alpha_func_enable = 0;
- mmesa->hw.rop = mgarop_NoBLK[ GL_COPY & 0x0f ];
- mmesa->hw.zmode = DC_zmode_zlt | DC_atype_zi;
- mmesa->hw.stencil = MGA_FIELD( S_sref, 0x00) | MGA_FIELD( S_smsk, 0xff ) |
- MGA_FIELD( S_swtmsk, 0xff );
- mmesa->hw.stencilctl = SC_smode_salways | SC_sfailop_keep
- | SC_szfailop_keep | SC_szpassop_keep;
- mmesa->hw.stencil_enable = 0;
- mmesa->hw.cull = _CULL_DISABLE;
- mmesa->hw.cull_dualtex = _CULL_DISABLE;
- mmesa->hw.specen = 0;
- mmesa->hw.alpha_sel = AC_alphasel_diffused;
-
- mmesa->setup.dwgctl = (DC_opcod_trap |
- DC_linear_xy |
- DC_solid_disable |
- DC_arzero_disable |
- DC_sgnzero_disable |
- DC_shftzero_enable |
- MGA_FIELD( DC_bop, 0xC ) |
- MGA_FIELD( DC_trans, 0x0 ) |
- DC_bltmod_bmonolef |
- DC_pattern_disable |
- DC_transc_disable |
- DC_clipdis_disable);
-
- mmesa->setup.plnwt = ~0;
- mmesa->setup.alphactrl = (AC_amode_alpha_channel |
- AC_astipple_disable |
- AC_aten_disable);
-
- mmesa->setup.fogcolor = PACK_COLOR_888((GLubyte)(ctx->Fog.Color[0]*255.0F),
- (GLubyte)(ctx->Fog.Color[1]*255.0F),
- (GLubyte)(ctx->Fog.Color[2]*255.0F));
-
- mmesa->setup.wflag = 0;
- mmesa->setup.tdualstage0 = 0;
- mmesa->setup.tdualstage1 = 0;
- mmesa->setup.fcol = 0;
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
-
- mmesa->envcolor[0] = 0;
- mmesa->envcolor[1] = 0;
-}
-
-
-void mgaDDInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = mgaDDInvalidateState;
- ctx->Driver.Enable = mgaDDEnable;
- ctx->Driver.LightModelfv = mgaDDLightModelfv;
- ctx->Driver.AlphaFunc = mgaDDAlphaFunc;
- ctx->Driver.BlendEquationSeparate = mgaDDBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = mgaDDBlendFuncSeparate;
- ctx->Driver.DepthFunc = mgaDDDepthFunc;
- ctx->Driver.DepthMask = mgaDDDepthMask;
- ctx->Driver.Fogfv = mgaDDFogfv;
- ctx->Driver.Scissor = mgaDDScissor;
- ctx->Driver.CullFace = mgaDDCullFaceFrontFace;
- ctx->Driver.FrontFace = mgaDDCullFaceFrontFace;
- ctx->Driver.ColorMask = mgaDDColorMask;
-
- ctx->Driver.DrawBuffer = mgaDDDrawBuffer;
- ctx->Driver.ReadBuffer = mgaDDReadBuffer;
- ctx->Driver.ClearColor = mgaDDClearColor;
- ctx->Driver.ClearDepth = mgaDDClearDepth;
- ctx->Driver.LogicOpcode = mgaDDLogicOp;
-
- ctx->Driver.PolygonStipple = mgaDDPolygonStipple;
-
- ctx->Driver.StencilFunc = mgaDDStencilFunc;
- ctx->Driver.StencilMask = mgaDDStencilMask;
- ctx->Driver.StencilOp = mgaDDStencilOp;
-
- ctx->Driver.DepthRange = mgaDepthRange;
- ctx->Driver.Viewport = mgaViewport;
- ctx->Driver.RenderMode = mgaRenderMode;
-
- ctx->Driver.ClearIndex = 0;
- ctx->Driver.IndexMask = 0;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-
- TNL_CONTEXT(ctx)->Driver.RunPipeline = mgaRunPipeline;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.h
deleted file mode 100644
index afbe0aaf9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgastate.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.h,v 1.5 2002/10/30 12:51:36 alanh Exp $ */
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef _MGA_STATE_H
-#define _MGA_STATE_H
-
-extern void mgaInitState( mgaContextPtr mmesa );
-extern void mgaDDInitStateFuncs(GLcontext *ctx);
-extern void mgaUpdateClipping(const GLcontext *ctx);
-extern void mgaUpdateCull( GLcontext *ctx );
-extern void mgaCalcViewport( GLcontext *ctx );
-extern void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.c
deleted file mode 100644
index 8caa1f858..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.14 2002/10/30 12:51:36 alanh Exp $ */
-
-#include "glheader.h"
-#include "mm.h"
-#include "mgacontext.h"
-#include "mgatex.h"
-#include "mgaregs.h"
-#include "mgatris.h"
-#include "mgaioctl.h"
-
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "macros.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "texobj.h"
-
-#include "swrast/swrast.h"
-
-#include "xmlpool.h"
-
-/**
- * Set the texture wrap modes.
- * Currently \c GL_REPEAT, \c GL_CLAMP and \c GL_CLAMP_TO_EDGE are supported.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-
-static void
-mgaSetTexWrapping( mgaTextureObjectPtr t, GLenum swrap, GLenum twrap )
-{
- GLboolean is_clamp = GL_FALSE;
- GLboolean is_clamp_to_edge = GL_FALSE;
-
- t->setup.texctl &= (TMC_clampu_MASK & TMC_clampv_MASK);
- t->setup.texctl2 &= (TMC_borderen_MASK);
-
- switch( swrap ) {
- case GL_REPEAT:
- break;
- case GL_CLAMP:
- t->setup.texctl |= TMC_clampu_enable;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->setup.texctl |= TMC_clampu_enable;
- is_clamp_to_edge = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
- }
-
- switch( twrap ) {
- case GL_REPEAT:
- break;
- case GL_CLAMP:
- t->setup.texctl |= TMC_clampv_enable;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->setup.texctl |= TMC_clampv_enable;
- is_clamp_to_edge = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
- }
-
- if ( is_clamp ) {
- t->setup.texctl2 |= TMC_borderen_enable;
- }
-
- t->border_fallback = (is_clamp && is_clamp_to_edge);
-}
-
-
-/**
- * Set the texture magnification and minification modes.
- *
- * \param t Texture whose filter modes are to be set
- * \param minf Texture minification mode
- * \param magf Texture magnification mode
- */
-
-static void
-mgaSetTexFilter( mgaTextureObjectPtr t, GLenum minf, GLenum magf )
-{
- GLuint val = 0;
-
- switch (minf) {
- case GL_NEAREST: val = TF_minfilter_nrst; break;
- case GL_LINEAR: val = TF_minfilter_bilin; break;
- case GL_NEAREST_MIPMAP_NEAREST: val = TF_minfilter_mm1s; break;
- case GL_LINEAR_MIPMAP_NEAREST: val = TF_minfilter_mm4s; break;
- case GL_NEAREST_MIPMAP_LINEAR: val = TF_minfilter_mm2s; break;
- case GL_LINEAR_MIPMAP_LINEAR: val = TF_minfilter_mm8s; break;
- default: val = TF_minfilter_nrst; break;
- }
-
- switch (magf) {
- case GL_NEAREST: val |= TF_magfilter_nrst; break;
- case GL_LINEAR: val |= TF_magfilter_bilin; break;
- default: val |= TF_magfilter_nrst; break;
- }
-
- /* See OpenGL 1.2 specification */
- if (magf == GL_LINEAR && (minf == GL_NEAREST_MIPMAP_NEAREST ||
- minf == GL_NEAREST_MIPMAP_LINEAR)) {
- val |= MGA_FIELD( TF_fthres, 0x20 ); /* c = 0.5 */
- } else {
- val |= MGA_FIELD( TF_fthres, 0x10 ); /* c = 0 */
- }
-
-
- /* Mask off the bits for the fields we are setting. Remember, the MGA mask
- * defines have 0s for the bits in the named fields. This is the opposite
- * of most of the other drivers.
- */
-
- t->setup.texfilter &= (TF_minfilter_MASK &
- TF_magfilter_MASK &
- TF_fthres_MASK);
- t->setup.texfilter |= val;
-}
-
-static void mgaSetTexBorderColor(mgaTextureObjectPtr t, GLubyte color[4])
-{
- t->setup.texbordercol = PACK_COLOR_8888(color[3], color[0],
- color[1], color[2] );
-}
-
-
-static const struct gl_texture_format *
-mgaChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- const GLboolean do32bpt =
- ( mmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 );
- const GLboolean force16bpt =
- ( mmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 );
- (void) format;
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- switch ( type ) {
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return &_mesa_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return &_mesa_texformat_argb1555;
- default:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
- }
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- switch ( type ) {
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return &_mesa_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return &_mesa_texformat_argb1555;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- return &_mesa_texformat_rgb565;
- default:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
- }
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return !force16bpt ?
- &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- /* FIXME: This will report incorrect component sizes... */
- return MGA_IS_G400(mmesa) ? &_mesa_texformat_al88 : &_mesa_texformat_argb4444;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- /* FIXME: This will report incorrect component sizes... */
- return MGA_IS_G400(mmesa) ? &_mesa_texformat_al88 : &_mesa_texformat_rgb565;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- /* FIXME: This will report incorrect component sizes... */
- return MGA_IS_G400(mmesa) ? &_mesa_texformat_al88 : &_mesa_texformat_argb4444;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- /* FIXME: This will report incorrect component sizes... */
- return MGA_IS_G400(mmesa) ? &_mesa_texformat_i8 : &_mesa_texformat_argb4444;
-
- case GL_YCBCR_MESA:
- if (MGA_IS_G400(mmesa) &&
- (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE))
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
-
- default:
- _mesa_problem( ctx, "unexpected texture format in %s", __FUNCTION__ );
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-
-
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-static mgaTextureObjectPtr
-mgaAllocTexObj( struct gl_texture_object *tObj )
-{
- mgaTextureObjectPtr t;
-
-
- t = CALLOC( sizeof( *t ) );
- tObj->DriverData = t;
- if ( t != NULL ) {
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = tObj;
-
- t->setup.texctl = TMC_takey_1 | TMC_tamask_0;
- t->setup.texctl2 = TMC_ckstransdis_enable;
- t->setup.texfilter = TF_filteralpha_enable | TF_uvoffset_OGL;
-
- t->border_fallback = GL_FALSE;
- t->texenv_fallback = GL_FALSE;
-
- make_empty_list( & t->base );
-
- mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT );
- mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- mgaSetTexBorderColor( t, tObj->_BorderChan );
- }
-
- return( t );
-}
-
-
-static void mgaTexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-
- switch( pname ) {
- case GL_TEXTURE_ENV_COLOR: {
- GLubyte c[4];
-
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
- mmesa->envcolor[unit] = PACK_COLOR_8888( c[3], c[0], c[1], c[2] );
- break;
- }
- }
-}
-
-
-static void mgaTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) mgaAllocTexObj( texObj );
- if ( t == NULL ) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glTexImage2D" );
- return;
- }
- }
-
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
- level -= t->firstLevel;
- if (level >= 0)
- t->dirty_images[0] |= (1UL << level);
-}
-
-static void mgaTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) mgaAllocTexObj( texObj );
- if ( t == NULL ) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "glTexImage2D" );
- return;
- }
- }
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
- level -= t->firstLevel;
- if (level >= 0)
- t->dirty_images[0] |= (1UL << level);
-}
-
-
-/**
- * Changes variables and flags for a state update, which will happen at the
- * next UpdateTextureState
- */
-
-static void
-mgaTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
-
- /* If we don't have a hardware texture, it will be automatically
- * created with current state before it is used, so we don't have
- * to do anything now
- */
- if ( (t == NULL) ||
- (target != GL_TEXTURE_2D &&
- target != GL_TEXTURE_RECTANGLE_NV) ) {
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- driSwapOutTextureObject( (driTextureObject *) t );
- /* FALLTHROUGH */
- case GL_TEXTURE_MAG_FILTER:
- FLUSH_BATCH(mmesa);
- mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- FLUSH_BATCH(mmesa);
- mgaSetTexWrapping(t,tObj->WrapS,tObj->WrapT);
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- FLUSH_BATCH(mmesa);
- mgaSetTexBorderColor(t, tObj->_BorderChan);
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-}
-
-
-static void
-mgaBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- assert( (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_NV) ||
- (tObj->DriverData != NULL) );
-}
-
-
-static void
-mgaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- driTextureObject * t = (driTextureObject *) tObj->DriverData;
-
- if ( t ) {
- if ( mmesa ) {
- FLUSH_BATCH( mmesa );
- }
-
- driDestroyTextureObject( t );
- }
-}
-
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-mgaNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- mgaAllocTexObj( obj );
- return obj;
-}
-
-
-void
-mgaInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->ChooseTextureFormat = mgaChooseTextureFormat;
- functions->TexImage2D = mgaTexImage2D;
- functions->TexSubImage2D = mgaTexSubImage2D;
- functions->BindTexture = mgaBindTexture;
- functions->NewTextureObject = mgaNewTextureObject;
- functions->DeleteTexture = mgaDeleteTexture;
- functions->IsTextureResident = driIsTextureResident;
- functions->TexEnv = mgaTexEnv;
- functions->TexParameter = mgaTexParameter;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.h
deleted file mode 100644
index fb7ffcff1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatex.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.7 2002/10/30 12:51:36 alanh Exp $ */
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef MGATEX_INC
-#define MGATEX_INC
-
-#include "mgacontext.h"
-
-typedef struct mga_texture_object_s *mgaTextureObjectPtr;
-
-
-/* Called before a primitive is rendered to make sure the texture
- * state is properly setup. Texture residence is checked later
- * when we grab the lock.
- */
-void mgaUpdateTextureState( GLcontext *ctx );
-
-int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t );
-
-void mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t );
-
-void mgaInitTextureFuncs( struct dd_function_table *functions );
-
-GLboolean mgaUpdateTextureEnvCombine( GLcontext *ctx, int unit );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatexmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatexmem.c
deleted file mode 100644
index 18743331c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatexmem.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.7 2002/10/30 12:51:36 alanh Exp $ */
-
-#include "glheader.h"
-
-#include "mm.h"
-#include "mgacontext.h"
-#include "mgatex.h"
-#include "mgaregs.h"
-#include "mgaioctl.h"
-#include "mga_xmesa.h"
-
-#include "imports.h"
-#include "simple_list.h"
-
-/**
- * Destroy any device-dependent state associated with the texture. This may
- * include NULLing out hardware state that points to the texture.
- */
-void
-mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t )
-{
- unsigned i;
-
-
- /* See if it was the driver's current object.
- */
-
- if ( mmesa != NULL )
- {
- if ( t->age > mmesa->dirtyAge )
- mmesa->dirtyAge = t->age;
-
- for ( i = 0 ; i < mmesa->glCtx->Const.MaxTextureUnits ; i++ )
- {
- if ( t == mmesa->CurrentTexObj[ i ] ) {
- mmesa->CurrentTexObj[ i ] = NULL;
- }
- }
- }
-}
-
-
-/**
- * Upload a texture image from system memory to either on-card or AGP
- * memory. Uploads to on-card memory are performed using an ILOAD operation.
- * This is used for both initial loading of the entire image, and texSubImage
- * updates.
- *
- * Performed with the hardware lock held.
- *
- * Even though this function is named "upload subimage," the entire image
- * is uploaded.
- *
- * \param mmesa Driver context.
- * \param t Texture to be uploaded.
- * \param hwlevel Mipmap level of the texture to be uploaded.
- *
- * \bug As mentioned above, this fuction actually copies the entier mipmap
- * level. There should be a version of this function that performs
- * sub-rectangle uploads. This will perform quite a bit better if only
- * a small portion of a larger texture has been updated. Care would
- * need to be take with such an implementation once glCopyTexImage has
- * been hardware accelerated.
- */
-static void mgaUploadSubImage( mgaContextPtr mmesa,
- mgaTextureObjectPtr t, GLint hwlevel )
-{
- struct gl_texture_image * texImage;
- unsigned offset;
- unsigned texelBytes;
- unsigned length;
- const int level = hwlevel + t->base.firstLevel;
-
-
- if ( (hwlevel < 0)
- || (hwlevel >= (MGA_IS_G200(mmesa)
- ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS)) ) {
- fprintf( stderr, "[%s:%d] level = %d\n", __FILE__, __LINE__, level );
- return;
- }
-
- texImage = t->base.tObj->Image[0][level];
- if ( texImage == NULL ) {
- fprintf( stderr, "[%s:%d] Image[%d] = NULL\n", __FILE__, __LINE__,
- level );
- return;
- }
-
-
- if (texImage->Data == NULL) {
- fprintf(stderr, "null texture image data tObj %p level %d\n",
- (void *) t->base.tObj, level);
- return;
- }
-
-
- /* find the proper destination offset for this level */
- if ( MGA_IS_G200(mmesa) ) {
- offset = (t->base.memBlock->ofs + t->offsets[hwlevel]);
- }
- else {
- unsigned i;
-
- offset = t->base.memBlock->ofs;
- for ( i = 0 ; i < hwlevel ; i++ ) {
- offset += (t->offsets[1] >> (i * 2));
- }
- }
-
-
- /* Copy the texture from system memory to a memory space that can be
- * directly used by the hardware for texturing.
- */
-
- texelBytes = texImage->TexFormat->TexelBytes;
- length = texImage->Width * texImage->Height * texelBytes;
- if ( t->base.heap->heapId == MGA_CARD_HEAP ) {
- unsigned tex_offset = 0;
- unsigned to_copy;
-
-
- /* We may not be able to upload the entire texture in one batch due to
- * register limits or dma buffer limits. Split the copy up into maximum
- * sized chunks.
- */
-
- offset += mmesa->mgaScreen->textureOffset[ t->base.heap->heapId ];
- while ( length != 0 ) {
- mgaGetILoadBufferLocked( mmesa );
-
- /* The kernel ILOAD ioctl requires that the lenght be an even multiple
- * of MGA_ILOAD_ALIGN.
- */
- length = ((length) + MGA_ILOAD_MASK) & ~MGA_ILOAD_MASK;
-
- to_copy = MIN2( length, MGA_BUFFER_SIZE );
- (void) memcpy( mmesa->iload_buffer->address,
- (GLubyte *) texImage->Data + tex_offset, to_copy );
-
- if ( MGA_DEBUG & DEBUG_VERBOSE_TEXTURE )
- fprintf(stderr, "[%s:%d] address/size = 0x%08lx/%d\n",
- __FILE__, __LINE__,
- (long) (offset + tex_offset),
- to_copy );
-
- mgaFireILoadLocked( mmesa, offset + tex_offset, to_copy );
- tex_offset += to_copy;
- length -= to_copy;
- }
- } else {
- /* FIXME: the sync for direct copy reduces speed.. */
- /* This works, is slower for uploads to card space and needs
- * additional synchronization with the dma stream.
- */
-
- UPDATE_LOCK(mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT);
-
- memcpy( mmesa->mgaScreen->texVirtual[t->base.heap->heapId] + offset,
- texImage->Data, length );
-
- if ( MGA_DEBUG & DEBUG_VERBOSE_TEXTURE )
- fprintf(stderr, "[%s:%d] address/size = 0x%08lx/%d\n",
- __FILE__, __LINE__,
- (long) (mmesa->mgaScreen->texVirtual[t->base.heap->heapId]
- + offset),
- length);
- }
-}
-
-
-/**
- * Upload the texture images associated with texture \a t. This might
- * require the allocation of texture memory.
- *
- * \param mmesa Context pointer
- * \param t Texture to be uploaded
- */
-
-int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t )
-{
- int i;
- int ofs;
-
-
- if ( (t == NULL) || (t->base.totalSize == 0) )
- return 0;
-
- LOCK_HARDWARE( mmesa );
-
- if (t->base.memBlock == NULL ) {
- int heap;
-
- heap = driAllocateTexture( mmesa->texture_heaps, mmesa->nr_heaps,
- (driTextureObject *) t );
- if ( heap == -1 ) {
- UNLOCK_HARDWARE( mmesa );
- return -1;
- }
-
- ofs = mmesa->mgaScreen->textureOffset[ heap ]
- + t->base.memBlock->ofs;
-
- if ( MGA_IS_G200(mmesa) ) {
- t->setup.texorg = ofs;
- t->setup.texorg1 = ofs + t->offsets[1];
- t->setup.texorg2 = ofs + t->offsets[2];
- t->setup.texorg3 = ofs + t->offsets[3];
- t->setup.texorg4 = ofs + t->offsets[4];
- }
- else {
- t->setup.texorg = ofs | TO_texorgoffsetsel;
- t->setup.texorg1 = t->offsets[1];
- t->setup.texorg2 = 0;
- t->setup.texorg3 = 0;
- t->setup.texorg4 = 0;
- }
-
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
- }
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( (driTextureObject *) t );
-
- if (MGA_DEBUG&DEBUG_VERBOSE_TEXTURE)
- fprintf(stderr, "[%s:%d] dispatch age: %d age freed memory: %d\n",
- __FILE__, __LINE__,
- GET_DISPATCH_AGE(mmesa), mmesa->dirtyAge);
-
- if (mmesa->dirtyAge >= GET_DISPATCH_AGE(mmesa))
- mgaWaitAgeLocked( mmesa, mmesa->dirtyAge );
-
- if (t->base.dirty_images[0]) {
- const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- if (MGA_DEBUG&DEBUG_VERBOSE_TEXTURE)
- fprintf(stderr, "[%s:%d] dirty_images[0] = 0x%04x\n",
- __FILE__, __LINE__, t->base.dirty_images[0] );
-
- for (i = 0 ; i < numLevels ; i++) {
- if ( (t->base.dirty_images[0] & (1U << i)) != 0 ) {
- mgaUploadSubImage( mmesa, t, i );
- }
- }
- t->base.dirty_images[0] = 0;
- }
-
-
- UNLOCK_HARDWARE( mmesa );
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.c
deleted file mode 100644
index 2b7ea05b1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.c
+++ /dev/null
@@ -1,912 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.10 2002/10/30 12:51:36 alanh Exp $ */
-
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "mm.h"
-#include "mgacontext.h"
-#include "mgaioctl.h"
-#include "mgatris.h"
-#include "mgavb.h"
-#include "mgastate.h"
-
-
-static void mgaRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-/***********************************************************************
- * Functions to draw basic primitives *
- ***********************************************************************/
-
-
-#if defined (USE_X86_ASM)
-#define EMIT_VERT( j, vb, vertex_size, v ) \
-do { int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertex_size), \
- "D" ((long)vb), \
- "S" ((long)v)); \
-} while (0)
-#else
-#define EMIT_VERT( j, vb, vertex_size, v ) \
-do { \
- for ( j = 0 ; j < vertex_size ; j++ ) \
- vb[j] = (v)->ui[j]; \
- vb += vertex_size; \
-} while (0)
-#endif
-
-static void __inline__ mga_draw_triangle( mgaContextPtr mmesa,
- mgaVertexPtr v0,
- mgaVertexPtr v1,
- mgaVertexPtr v2 )
-{
- GLuint vertex_size = mmesa->vertex_size;
- GLuint *vb = mgaAllocDmaLow( mmesa, 3 * 4 * vertex_size );
- int j;
-
- EMIT_VERT( j, vb, vertex_size, v0 );
- EMIT_VERT( j, vb, vertex_size, v1 );
- EMIT_VERT( j, vb, vertex_size, v2 );
-}
-
-
-static void __inline__ mga_draw_quad( mgaContextPtr mmesa,
- mgaVertexPtr v0,
- mgaVertexPtr v1,
- mgaVertexPtr v2,
- mgaVertexPtr v3 )
-{
- GLuint vertex_size = mmesa->vertex_size;
- GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
- int j;
-
- EMIT_VERT( j, vb, vertex_size, v0 );
- EMIT_VERT( j, vb, vertex_size, v1 );
- EMIT_VERT( j, vb, vertex_size, v3 );
- EMIT_VERT( j, vb, vertex_size, v1 );
- EMIT_VERT( j, vb, vertex_size, v2 );
- EMIT_VERT( j, vb, vertex_size, v3 );
-}
-
-
-static __inline__ void mga_draw_point( mgaContextPtr mmesa,
- mgaVertexPtr tmp )
-{
- GLfloat sz = mmesa->glCtx->Point._Size * .5;
- int vertex_size = mmesa->vertex_size;
- GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
- int j;
-
-#if 0
- v0->v.x += PNT_X_OFFSET - TRI_X_OFFSET;
- v0->v.y += PNT_Y_OFFSET - TRI_Y_OFFSET;
-#endif
-
- /* Draw a point as two triangles.
- */
- *(float *)&vb[0] = tmp->v.x - sz;
- *(float *)&vb[1] = tmp->v.y - sz;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = tmp->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = tmp->v.x + sz;
- *(float *)&vb[1] = tmp->v.y - sz;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = tmp->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = tmp->v.x + sz;
- *(float *)&vb[1] = tmp->v.y + sz;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = tmp->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = tmp->v.x + sz;
- *(float *)&vb[1] = tmp->v.y + sz;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = tmp->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = tmp->v.x - sz;
- *(float *)&vb[1] = tmp->v.y + sz;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = tmp->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = tmp->v.x - sz;
- *(float *)&vb[1] = tmp->v.y - sz;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = tmp->ui[j];
-
-#if 0
- v0->v.x -= PNT_X_OFFSET - TRI_X_OFFSET;
- v0->v.y -= PNT_Y_OFFSET - TRI_Y_OFFSET;
-#endif
-}
-
-
-static __inline__ void mga_draw_line( mgaContextPtr mmesa,
- mgaVertexPtr v0,
- mgaVertexPtr v1 )
-{
- GLuint vertex_size = mmesa->vertex_size;
- GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
- GLfloat dx, dy, ix, iy;
- GLfloat width = mmesa->glCtx->Line._Width;
- GLint j;
-
-#if 0
- v0->v.x += LINE_X_OFFSET - TRI_X_OFFSET;
- v0->v.y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- v1->v.x += LINE_X_OFFSET - TRI_X_OFFSET;
- v1->v.y += LINE_Y_OFFSET - TRI_Y_OFFSET;
-#endif
-
- dx = v0->v.x - v1->v.x;
- dy = v0->v.y - v1->v.y;
-
- ix = width * .5; iy = 0;
- if (dx * dx > dy * dy) {
- iy = ix; ix = 0;
- }
-
- *(float *)&vb[0] = v0->v.x - ix;
- *(float *)&vb[1] = v0->v.y - iy;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = v0->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = v1->v.x + ix;
- *(float *)&vb[1] = v1->v.y + iy;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = v1->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = v0->v.x + ix;
- *(float *)&vb[1] = v0->v.y + iy;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = v0->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = v0->v.x - ix;
- *(float *)&vb[1] = v0->v.y - iy;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = v0->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = v1->v.x - ix;
- *(float *)&vb[1] = v1->v.y - iy;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = v1->ui[j];
- vb += vertex_size;
-
- *(float *)&vb[0] = v1->v.x + ix;
- *(float *)&vb[1] = v1->v.y + iy;
- for (j = 2 ; j < vertex_size ; j++)
- vb[j] = v1->ui[j];
- vb += vertex_size;
-
-#if 0
- v0->v.x -= LINE_X_OFFSET - TRI_X_OFFSET;
- v0->v.y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- v1->v.x -= LINE_X_OFFSET - TRI_X_OFFSET;
- v1->v.y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
-#endif
-}
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- mmesa->draw_tri( mmesa, a, b, c ); \
- else \
- mga_draw_triangle( mmesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- mmesa->draw_tri( mmesa, a, b, d ); \
- mmesa->draw_tri( mmesa, b, c, d ); \
- } else { \
- mga_draw_quad( mmesa, a, b, c, d ); \
- } \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- mmesa->draw_line( mmesa, v0, v1 ); \
- else { \
- mga_draw_line( mmesa, v0, v1 ); \
- } \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- mmesa->draw_point( mmesa, v0 ); \
- else { \
- mga_draw_point( mmesa, v0 ); \
- } \
-} while (0)
-
-
-/***********************************************************************
- * Fallback to swrast for basic primitives *
- ***********************************************************************/
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-
-static void
-mga_fallback_tri( mgaContextPtr mmesa,
- mgaVertex *v0,
- mgaVertex *v1,
- mgaVertex *v2 )
-{
- GLcontext *ctx = mmesa->glCtx;
- SWvertex v[3];
- mga_translate_vertex( ctx, v0, &v[0] );
- mga_translate_vertex( ctx, v1, &v[1] );
- mga_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-mga_fallback_line( mgaContextPtr mmesa,
- mgaVertex *v0,
- mgaVertex *v1 )
-{
- GLcontext *ctx = mmesa->glCtx;
- SWvertex v[2];
- mga_translate_vertex( ctx, v0, &v[0] );
- mga_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-mga_fallback_point( mgaContextPtr mmesa,
- mgaVertex *v0 )
-{
- GLcontext *ctx = mmesa->glCtx;
- SWvertex v[1];
- mga_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-
-#define MGA_UNFILLED_BIT 0x1
-#define MGA_OFFSET_BIT 0x2
-#define MGA_TWOSIDE_BIT 0x4
-#define MGA_FLAT_BIT 0x8 /* mga can't flatshade? */
-#define MGA_FALLBACK_BIT 0x10
-#define MGA_MAX_TRIFUNC 0x20
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[MGA_MAX_TRIFUNC];
-
-#define DO_FALLBACK (IND & MGA_FALLBACK_BIT)
-#define DO_OFFSET (IND & MGA_OFFSET_BIT)
-#define DO_UNFILLED (IND & MGA_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & MGA_TWOSIDE_BIT)
-#define DO_FLAT (IND & MGA_FLAT_BIT)
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_SPEC 1
-#define HAVE_HW_FLATSHADE 0
-#define VERTEX mgaVertex
-#define TAB rast_tab
-
-
-#define DEPTH_SCALE mmesa->depth_scale
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (mmesa->verts + (e * mmesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- mga_color_t *color = (mga_color_t *)&((v)->ui[4]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4]
-
-#define VERT_SET_SPEC( v0, c ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.blue, (c)[2]); \
-} while (0)
-
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- v0->v.specular.red = v1->v.specular.red; \
- v0->v.specular.green = v1->v.specular.green; \
- v0->v.specular.blue = v1->v.specular.blue; \
-} while (0)
-
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx]
-#define VERT_SAVE_SPEC( idx ) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) v[idx]->ui[5] = spec[idx]
-
-#define LOCAL_VARS(n) \
- mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- (void) color; (void) spec;
-
-
-
-/***********************************************************************
- * Functions to draw basic unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (mmesa->raster_primitive != x) \
- mgaRasterPrimitive( ctx, x, MGA_WA_TRIANGLES )
-#define RENDER_PRIMITIVE mmesa->render_primitive
-#define IND MGA_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Functions to draw GL primitives *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_UNFILLED_BIT|MGA_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_UNFILLED_BIT|MGA_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_UNFILLED_BIT|MGA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_UNFILLED_BIT| \
- MGA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-/* Mga doesn't support provoking-vertex flat-shading?
- */
-#define IND (MGA_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_offset_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_UNFILLED_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_UNFILLED_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_offset_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_UNFILLED_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_UNFILLED_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_offset_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_UNFILLED_BIT|MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_OFFSET_BIT|MGA_UNFILLED_BIT|MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_offset_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_UNFILLED_BIT|MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (MGA_TWOSIDE_BIT|MGA_OFFSET_BIT|MGA_UNFILLED_BIT| \
- MGA_FALLBACK_BIT|MGA_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-
- init_flat();
- init_offset_flat();
- init_twoside_flat();
- init_twoside_offset_flat();
- init_unfilled_flat();
- init_offset_unfilled_flat();
- init_twoside_unfilled_flat();
- init_twoside_offset_unfilled_flat();
- init_fallback_flat();
- init_offset_fallback_flat();
- init_twoside_fallback_flat();
- init_twoside_offset_fallback_flat();
- init_unfilled_fallback_flat();
- init_offset_unfilled_fallback_flat();
- init_twoside_unfilled_fallback_flat();
- init_twoside_offset_unfilled_fallback_flat();
-}
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-
-#define VERT(x) (mgaVertex *)(vertptr + ((x)*vertex_size*sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- mga_draw_point( mmesa, VERT(ELT(start)) );
-#define RENDER_LINE( v0, v1 ) \
- mga_draw_line( mmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- mga_draw_triangle( mmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- mga_draw_quad( mmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) mgaRenderPrimitive( ctx, x )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
- GLubyte *vertptr = (GLubyte *)mmesa->verts; \
- const GLuint vertex_size = mmesa->vertex_size; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) x
-#define TAG(x) mga_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) mga_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void mgaRenderClippedPoly( GLcontext *ctx, const GLuint *elts, GLuint n )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint prim = mmesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void mgaRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-static void mgaFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- GLuint vertex_size = mmesa->vertex_size;
- GLuint *vb = mgaAllocDmaLow( mmesa, (n-2) * 3 * 4 * vertex_size );
- GLubyte *vertptr = (GLubyte *)mmesa->verts;
- const GLuint *start = (const GLuint *)VERT(elts[0]);
- int i,j;
-
- for (i = 2 ; i < n ; i++) {
- EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) VERT(elts[i-1]) );
- EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) VERT(elts[i]) );
- EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) start );
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_SMOOTH | DD_LINE_STIPPLE)
-#define TRI_FALLBACK (DD_TRI_SMOOTH | DD_TRI_UNFILLED)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_FLATSHADE|DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET| \
- DD_TRI_UNFILLED)
-
-void mgaChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS|DD_TRI_STIPPLE)) {
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= MGA_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= MGA_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= MGA_UNFILLED_BIT;
- if (flags & DD_FLATSHADE) index |= MGA_FLAT_BIT;
- }
-
- mmesa->draw_point = mga_draw_point;
- mmesa->draw_line = mga_draw_line;
- mmesa->draw_tri = mga_draw_triangle;
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & ANY_FALLBACK_FLAGS)
- {
- if (flags & POINT_FALLBACK)
- mmesa->draw_point = mga_fallback_point;
-
- if (flags & LINE_FALLBACK)
- mmesa->draw_line = mga_fallback_line;
-
- if (flags & TRI_FALLBACK)
- mmesa->draw_tri = mga_fallback_tri;
-
- index |= MGA_FALLBACK_BIT;
- }
-
- if ((flags & DD_TRI_STIPPLE) && !mmesa->haveHwStipple) {
- mmesa->draw_tri = mga_fallback_tri;
- index |= MGA_FALLBACK_BIT;
- }
- }
-
- if (mmesa->RenderIndex != index) {
- mmesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = mga_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = mga_render_tab_elts;
- tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */
- tnl->Driver.Render.ClippedPolygon = mgaFastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = mgaRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = mgaRenderClippedPoly;
- }
- }
-}
-
-/**********************************************************************/
-/* Runtime render state and callbacks */
-/**********************************************************************/
-
-
-static GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
-
-/* Always called between RenderStart and RenderFinish --> We already
- * hold the lock.
- */
-void mgaRasterPrimitive( GLcontext *ctx, GLenum prim, GLuint hwprim )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
-
- FLUSH_BATCH( mmesa );
-
- /* Update culling */
- if (mmesa->raster_primitive != prim)
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
-
- mmesa->raster_primitive = prim;
-/* mmesa->hw_primitive = hwprim; */
- mmesa->hw_primitive = MGA_WA_TRIANGLES; /* disable mgarender.c for now */
-
- if (ctx->Polygon.StippleFlag && mmesa->haveHwStipple)
- {
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
- mmesa->setup.dwgctl &= ~(0xf<<20);
- if (mmesa->raster_primitive == GL_TRIANGLES)
- mmesa->setup.dwgctl |= mmesa->poly_stipple;
- }
-}
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in mgarender.c.
- */
-static void mgaRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- mmesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (mmesa->raster_primitive != rprim) {
- mgaRasterPrimitive( ctx, rprim, MGA_WA_TRIANGLES );
- }
-}
-
-static void mgaRenderFinish( GLcontext *ctx )
-{
- if (MGA_CONTEXT(ctx)->RenderIndex & MGA_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-
-/**********************************************************************/
-/* Manage total rasterization fallbacks */
-/**********************************************************************/
-
-static const char * const fallbackStrings[] = {
- "Texture mode",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "read buffer",
- "glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ZERO)",
- "glRenderMode(selection or feedback)",
- "No hardware stencil",
- "glDepthFunc( GL_NEVER )",
- "Mixing GL_CLAMP_TO_EDGE and GL_CLAMP",
- "rasterization fallback option"
-};
-
-static const char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-void mgaFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint oldfallback = mmesa->Fallback;
-
- if (mode) {
- mmesa->Fallback |= bit;
- if (oldfallback == 0) {
- FLUSH_BATCH(mmesa);
- _swsetup_Wakeup( ctx );
- mmesa->RenderIndex = ~0;
- if (MGA_DEBUG & DEBUG_VERBOSE_FALLBACK) {
- fprintf(stderr, "MGA begin rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
- else {
- mmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = mgaCheckTexSizes;
- tnl->Driver.Render.PrimitiveNotify = mgaRenderPrimitive;
- tnl->Driver.Render.Finish = mgaRenderFinish;
- tnl->Driver.Render.BuildVertices = mgaBuildVertices;
- mmesa->NewGLState |= (_MGA_NEW_RENDERSTATE |
- _MGA_NEW_RASTERSETUP);
- if (MGA_DEBUG & DEBUG_VERBOSE_FALLBACK) {
- fprintf(stderr, "MGA end rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
-}
-
-
-void mgaDDInitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- static int firsttime = 1;
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- mmesa->RenderIndex = ~0;
-
- tnl->Driver.Render.Start = mgaCheckTexSizes;
- tnl->Driver.Render.Finish = mgaRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = mgaRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = mgaBuildVertices;
- tnl->Driver.Render.Multipass = NULL;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.h
deleted file mode 100644
index f3ece3a05..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgatris.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.10 2002/10/30 12:51:36 alanh Exp $ */
-
-#ifndef MGATRIS_INC
-#define MGATRIS_INC
-
-#include "mtypes.h"
-
-extern void mgaDDInitTriFuncs( GLcontext *ctx );
-extern void mgaChooseRenderState( GLcontext *ctx );
-extern void mgaRasterPrimitive( GLcontext *ctx, GLenum prim, GLuint hwprim );
-
-extern void mgaFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( ctx, bit, mode ) mgaFallback( ctx, bit, mode )
-
-#define _MGA_NEW_RENDERSTATE (_DD_NEW_POINT_SMOOTH | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_FLATSHADE | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_POLYGONSTIPPLE)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.c
deleted file mode 100644
index 902d8bd1c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.15 2003/03/26 20:43:49 tsi Exp $ */
-
-#include <stdlib.h>
-#include "mgacontext.h"
-#include "mgavb.h"
-#include "mgatris.h"
-#include "mgaioctl.h"
-#include "mga_xmesa.h"
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "tnl/t_context.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/swrast.h"
-
-
-#define MGA_TEX1_BIT 0x1
-#define MGA_TEX0_BIT 0x2
-#define MGA_RGBA_BIT 0x4
-#define MGA_SPEC_BIT 0x8
-#define MGA_FOG_BIT 0x10
-#define MGA_XYZW_BIT 0x20
-#define MGA_PTEX_BIT 0x40
-#define MGA_MAX_SETUP 0x80
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_size;
- GLuint vertex_format;
-} setup_tab[MGA_MAX_SETUP];
-
-
-#define TINY_VERTEX_FORMAT 0
-#define NOTEX_VERTEX_FORMAT 0
-#define TEX0_VERTEX_FORMAT (MGA_A|MGA_S|MGA_F)
-#define TEX1_VERTEX_FORMAT (MGA_A|MGA_S|MGA_F|MGA_T2)
-#define PROJ_TEX1_VERTEX_FORMAT 0
-#define TEX2_VERTEX_FORMAT 0
-#define TEX3_VERTEX_FORMAT 0
-#define PROJ_TEX3_VERTEX_FORMAT 0
-
-#define DO_XYZW (IND & MGA_XYZW_BIT)
-#define DO_RGBA (IND & MGA_RGBA_BIT)
-#define DO_SPEC (IND & MGA_SPEC_BIT)
-#define DO_FOG (IND & MGA_FOG_BIT)
-#define DO_TEX0 (IND & MGA_TEX0_BIT)
-#define DO_TEX1 (IND & MGA_TEX1_BIT)
-#define DO_TEX2 0
-#define DO_TEX3 0
-#define DO_PTEX (IND & MGA_PTEX_BIT)
-
-
-#define VERTEX mgaVertex
-#define VERTEX_COLOR mga_color_t
-#define LOCALVARS mgaContextPtr mmesa = MGA_CONTEXT(ctx);
-#define GET_VIEWPORT_MAT() mmesa->hw_viewport
-#define GET_TEXSOURCE(n) mmesa->tmu_source[n]
-#define GET_VERTEX_FORMAT() mmesa->vertex_format
-#define GET_VERTEX_STORE() mmesa->verts
-#define GET_VERTEX_SIZE() mmesa->vertex_size * sizeof(GLuint)
-
-#define HAVE_HW_VIEWPORT 0
-#define HAVE_HW_DIVIDE 0
-#define HAVE_RGBA_COLOR 0
-#define HAVE_TINY_VERTICES 0
-#define HAVE_NOTEX_VERTICES 0
-#define HAVE_TEX0_VERTICES 1
-#define HAVE_TEX1_VERTICES 1
-#define HAVE_TEX2_VERTICES 0
-#define HAVE_TEX3_VERTICES 0
-#define HAVE_PTEX_VERTICES 0
-
-#define UNVIEWPORT_VARS \
- const GLfloat dx = - mmesa->drawX - SUBPIXEL_X; \
- const GLfloat dy = (mmesa->driDrawable->h + \
- mmesa->drawY + SUBPIXEL_Y); \
- const GLfloat sz = 1.0 / mmesa->depth_scale
-
-#define UNVIEWPORT_X(x) x + dx;
-#define UNVIEWPORT_Y(y) - y + dy;
-#define UNVIEWPORT_Z(z) z * sz;
-
-#define PTEX_FALLBACK() FALLBACK(ctx, MGA_FALLBACK_TEXTURE, 1)
-
-#define INTERP_VERTEX setup_tab[mmesa->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[mmesa->SetupIndex].copy_pv
-
-
-/***********************************************************************
- * Generate pv-copying and translation functions *
- ***********************************************************************/
-
-#define TAG(x) mga_##x
-#include "tnl_dd/t_dd_vb.c"
-
-/***********************************************************************
- * Generate vertex emit and interp functions *
- ***********************************************************************/
-
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_SPEC_BIT)
-#define TAG(x) x##_wgs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_wgt0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_TEX0_BIT|MGA_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_wgst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_wgst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT|MGA_PTEX_BIT)
-#define TAG(x) x##_wgspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT)
-#define TAG(x) x##_wgfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_wgft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_TEX0_BIT|MGA_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_wgfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_wgfst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_XYZW_BIT|MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT|MGA_PTEX_BIT)
-#define TAG(x) x##_wgfspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_t0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_FOG_BIT)
-#define TAG(x) x##_f
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_FOG_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_ft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_FOG_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_ft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT)
-#define TAG(x) x##_g
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_SPEC_BIT)
-#define TAG(x) x##_gs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_gt0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_gst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_gst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_FOG_BIT)
-#define TAG(x) x##_gf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT)
-#define TAG(x) x##_gfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_FOG_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_FOG_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_gft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT)
-#define TAG(x) x##_gfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (MGA_RGBA_BIT|MGA_FOG_BIT|MGA_SPEC_BIT|MGA_TEX0_BIT|MGA_TEX1_BIT)
-#define TAG(x) x##_gfst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wgs();
- init_wgt0();
- init_wgt0t1();
- init_wgpt0();
- init_wgst0();
- init_wgst0t1();
- init_wgspt0();
- init_wgf();
- init_wgfs();
- init_wgft0();
- init_wgft0t1();
- init_wgfpt0();
- init_wgfst0();
- init_wgfst0t1();
- init_wgfspt0();
- init_t0();
- init_t0t1();
- init_f();
- init_ft0();
- init_ft0t1();
- init_g();
- init_gs();
- init_gt0();
- init_gt0t1();
- init_gst0();
- init_gst0t1();
- init_gf();
- init_gfs();
- init_gft0();
- init_gft0t1();
- init_gfst0();
- init_gfst0t1();
-}
-
-
-
-
-void mgaPrintSetupFlags(char *msg, GLuint flags )
-{
- fprintf(stderr, "%s: %d %s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & MGA_XYZW_BIT) ? " xyzw," : "",
- (flags & MGA_RGBA_BIT) ? " rgba," : "",
- (flags & MGA_SPEC_BIT) ? " spec," : "",
- (flags & MGA_FOG_BIT) ? " fog," : "",
- (flags & MGA_TEX0_BIT) ? " tex-0," : "",
- (flags & MGA_TEX1_BIT) ? " tex-1," : "");
-}
-
-
-void mgaCheckTexSizes( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- /*fprintf(stderr, "%s\n", __FUNCTION__);*/
-
- if (!setup_tab[mmesa->SetupIndex].check_tex_sizes(ctx)) {
- mmesa->SetupIndex |= MGA_PTEX_BIT;
- mmesa->SetupNewInputs = ~0;
-
- if (!mmesa->Fallback &&
- !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[mmesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[mmesa->SetupIndex].copy_pv;
- }
- if (mmesa->Fallback) {
- tnl->Driver.Render.Start(ctx);
- }
- }
-}
-
-
-void mgaBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- GLuint stride = mmesa->vertex_size * sizeof(int);
- GLubyte *v = ((GLubyte *)mmesa->verts + (start * stride));
-
- newinputs |= mmesa->SetupNewInputs;
- mmesa->SetupNewInputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= MGA_RGBA_BIT;
-
- if (newinputs & VERT_BIT_COLOR1)
- ind |= MGA_SPEC_BIT;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= MGA_TEX0_BIT;
-
- if (newinputs & VERT_BIT_TEX1)
- ind |= MGA_TEX0_BIT|MGA_TEX1_BIT;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= MGA_FOG_BIT;
-
- if (mmesa->SetupIndex & MGA_PTEX_BIT)
- ind = ~0;
-
- ind &= mmesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
- }
- }
-}
-
-
-void mgaChooseVertexState( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint ind = MGA_XYZW_BIT|MGA_RGBA_BIT;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- ind |= MGA_SPEC_BIT;
-
- if (ctx->Fog.Enabled)
- ind |= MGA_FOG_BIT;
-
- if (ctx->Texture._EnabledUnits & 0x2) {
- /* unit 1 enabled */
- if (ctx->Texture._EnabledUnits & 0x1) {
- /* unit 0 enabled */
- ind |= MGA_TEX1_BIT|MGA_TEX0_BIT;
- }
- else {
- ind |= MGA_TEX0_BIT;
- }
- }
- else if (ctx->Texture._EnabledUnits & 0x1) {
- /* unit 0 enabled */
- ind |= MGA_TEX0_BIT;
- }
-
- mmesa->SetupIndex = ind;
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = mga_interp_extras;
- tnl->Driver.Render.CopyPV = mga_copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-
- if (setup_tab[ind].vertex_format != mmesa->vertex_format) {
- FLUSH_BATCH(mmesa);
- mmesa->dirty |= MGA_UPLOAD_PIPE;
- mmesa->vertex_format = setup_tab[ind].vertex_format;
- mmesa->vertex_size = setup_tab[ind].vertex_size;
- }
-}
-
-
-
-void *mga_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count,
- void *dest)
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint stride = mmesa->vertex_size * 4;
- setup_tab[mmesa->SetupIndex].emit( ctx, start, count, dest, stride );
- return (void *)((char *)dest + stride * (count - start));
-}
-
-
-
-void mgaInitVB( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * sizeof(mgaVertex), 32);
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
- }
-
- mmesa->dirty |= MGA_UPLOAD_PIPE;
- mmesa->vertex_format = setup_tab[0].vertex_format;
- mmesa->vertex_size = setup_tab[0].vertex_size;
-}
-
-
-void mgaFreeVB( GLcontext *ctx )
-{
- mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- if (mmesa->verts) {
- ALIGN_FREE(mmesa->verts);
- mmesa->verts = 0;
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.h
deleted file mode 100644
index 5f6454aca..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/mgavb.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.h,v 1.8 2002/10/30 12:51:36 alanh Exp $ */
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef MGAVB_INC
-#define MGAVB_INC
-
-#include "mtypes.h"
-#include "mgacontext.h"
-#include "swrast/swrast.h"
-
-#define _MGA_NEW_RASTERSETUP (_NEW_TEXTURE | \
- _DD_NEW_SEPARATE_SPECULAR | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _NEW_FOG)
-
-
-extern void mgaChooseVertexState( GLcontext *ctx );
-extern void mgaCheckTexSizes( GLcontext *ctx );
-extern void mgaBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs );
-
-extern void mgaPrintSetupFlags(char *msg, GLuint flags );
-
-extern void mgaInitVB( GLcontext *ctx );
-extern void mgaFreeVB( GLcontext *ctx );
-
-extern void *mga_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count,
- void *dest );
-
-extern void mga_translate_vertex(GLcontext *ctx,
- const mgaVertex *src,
- SWvertex *dst);
-
-extern void mga_print_vertex( GLcontext *ctx, const mgaVertex *v );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga.h
deleted file mode 100644
index 830d48d85..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.85 2002/12/16 16:19:17 dawes Exp $ */
-/*
- * MGA Millennium (MGA2064W) functions
- *
- * Copyright 1996 The XFree86 Project, Inc.
- *
- * Authors
- * Dirk Hohndel
- * hohndel@XFree86.Org
- * David Dawes
- * dawes@XFree86.Org
- */
-
-#ifndef MGA_H
-#define MGA_H
-
-
-#include "xf86drm.h"
-#include "linux/types.h"
-
-
-#define PCI_CHIP_MGA2085 0x0518
-#define PCI_CHIP_MGA2064 0x0519
-#define PCI_CHIP_MGA1064 0x051A
-#define PCI_CHIP_MGA2164 0x051B
-#define PCI_CHIP_MGA2164_AGP 0x051F
-#define PCI_CHIP_MGAG200_PCI 0x0520
-#define PCI_CHIP_MGAG200 0x0521
-#define PCI_CHIP_MGAG400 0x0525
-#define PCI_CHIP_MGAG550 0x2527
-#define PCI_CHIP_MGAG100_PCI 0x1000
-#define PCI_CHIP_MGAG100 0x1001
-
-
-# define MMIO_IN8(base, offset) \
- *(volatile unsigned char *)(((unsigned char*)(base)) + (offset))
-# define MMIO_IN16(base, offset) \
- *(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset))
-# define MMIO_IN32(base, offset) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset))
-# define MMIO_OUT8(base, offset, val) \
- *(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val)
-# define MMIO_OUT16(base, offset, val) \
- *(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
-# define MMIO_OUT32(base, offset, val) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
-
-#define INREG8(addr) MMIO_IN8(pMga->IOBase, addr)
-#define INREG16(addr) MMIO_IN16(pMga->IOBase, addr)
-#define INREG(addr) MMIO_IN32(pMga->IOBase, addr)
-#define OUTREG8(addr, val) MMIO_OUT8(pMga->IOBase, addr, val)
-#define OUTREG16(addr, val) MMIO_OUT16(pMga->IOBase, addr, val)
-#define OUTREG(addr, val) MMIO_OUT32(pMga->IOBase, addr, val)
-
-#define MGAIOMAPSIZE 0x00004000
-
-
-typedef struct {
- int Chipset; /**< \brief Chipset number */
-
- int irq; /**< \brief IRQ number */
-
-
- int frontOffset; /**< \brief Front color buffer offset */
- int frontPitch; /**< \brief Front color buffer pitch */
- int backOffset; /**< \brief Back color buffer offset */
- int backPitch; /**< \brief Back color buffer pitch */
- int depthOffset; /**< \brief Depth buffer offset */
- int depthPitch; /**< \brief Depth buffer pitch */
- int textureOffset; /**< \brief Texture area offset */
- int textureSize; /**< \brief Texture area size */
- int logTextureGranularity;
-
- /**
- * \name AGP
- */
- /*@{*/
- drmSize agpSize; /**< \brief AGP map size */
- int agpMode; /**< \brief AGP mode */
- /*@}*/
-
- drmRegion agp;
-
- /* PCI mappings */
- drmRegion registers;
- drmRegion status;
-
- /* AGP mappings */
- drmRegion warp;
- drmRegion primary;
- drmRegion buffers;
- drmRegion agpTextures;
-
- drmBufMapPtr drmBuffers;
-
- unsigned long IOAddress;
- unsigned char *IOBase;
- int HasSDRAM;
-
- __u32 reg_ien;
-} MGARec, *MGAPtr;
-
-
-
-#define MGA_FRONT 0x1
-#define MGA_BACK 0x2
-#define MGA_DEPTH 0x4
-
-#define MGA_AGP_1X_MODE 0x01
-#define MGA_AGP_2X_MODE 0x02
-#define MGA_AGP_4X_MODE 0x04
-#define MGA_AGP_MODE_MASK 0x07
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_bios.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_bios.h
deleted file mode 100644
index 8fbf619e3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_bios.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* $XConsortium: mga_bios.h /main/2 1996/10/28 04:48:23 kaleb $ */
-#ifndef MGA_BIOS_H
-#define MGA_BIOS_H
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h,v 1.3 1998/07/25 16:55:51 dawes Exp $ */
-
-/*
- * MGABiosInfo - This struct describes the video BIOS info block.
- *
- * DESCRIPTION
- * Do not mess with this, unless you know what you are doing.
- * The data lengths and types are critical.
- *
- * HISTORY
- * October 7, 1996 - [aem] Andrew E. Mileski
- * This struct was shamelessly stolen from the MGA DDK.
- * It has been reformatted, and the data types changed.
- */
-typedef struct {
- /* Length of this structure in bytes */
- __u16 StructLen;
-
- /*
- * Unique number identifying the product type
- * 0 : MGA-S1P20 (2MB base with 175MHz Ramdac)
- * 1 : MGA-S1P21 (2MB base with 220MHz Ramdac)
- * 2 : Reserved
- * 3 : Reserved
- * 4 : MGA-S1P40 (4MB base with 175MHz Ramdac)
- * 5 : MGA-S1P41 (4MB base with 220MHz Ramdac)
- */
- __u16 ProductID;
-
- /* Serial number of the board */
- __u8 SerNo[ 10 ];
-
- /*
- * Manufacturing date of the board (at product test)
- * Format: yyyy yyym mmmd dddd
- */
- __u16 ManufDate;
-
- /* Identification of manufacturing site */
- __u16 ManufId;
-
- /*
- * Number and revision level of the PCB
- * Format: nnnn nnnn nnnr rrrr
- * n = PCB number ex:576 (from 0->2047)
- * r = PCB revision (from 0->31)
- */
- __u16 PCBInfo;
-
- /* Identification of any PMBs */
- __u16 PMBInfo;
-
- /*
- * Bit 0-7 : Ramdac speed (0=175MHz, 1=220MHz)
- * Bit 8-15 : Ramdac type (0=TVP3026, 1=TVP3027)
- */
- __u16 RamdacType;
-
- /* Maximum PCLK of the ramdac */
- __u16 PclkMax;
-
- /* Maximum LDCLK supported by the WRAM memory */
- __u16 LclkMax;
-
- /* Maximum MCLK of base board */
- __u16 ClkBase;
-
- /* Maximum MCLK of 4Mb board */
- __u16 Clk4MB;
-
- /* Maximum MCLK of 8Mb board */
- __u16 Clk8MB;
-
- /* Maximum MCLK of board with multimedia module */
- __u16 ClkMod;
-
- /* Diagnostic test pass frequency */
- __u16 TestClk;
-
- /* Default VGA mode1 pixel frequency */
- __u16 VGAFreq1;
-
- /* Default VGA mode2 pixel frequency */
- __u16 VGAFreq2;
-
- /* Date of last BIOS programming/update */
- __u16 ProgramDate;
-
- /* Number of times BIOS has been programmed */
- __u16 ProgramCnt;
-
- /* Support for up to 32 hardware/software options */
- __u32 Options;
-
- /* Support for up to 32 hardware/software features */
- __u32 FeatFlag;
-
- /* Definition of VGA mode MCLK */
- __u16 VGAClk;
-
- /* Indicate the revision level of this header struct */
- __u16 StructRev;
-
- __u16 Reserved[ 3 ];
-} MGABiosInfo;
-
-/* from the PINS structure, refer pins info from MGA */
-typedef struct tagParamMGA {
- __u16 PinID; /* 0 */
- __u8 StructLen; /* 2 */
- __u8 Rsvd1; /* 3 */
- __u16 StructRev; /* 4 */
- __u16 ProgramDate; /* 6 */
- __u16 ProgramCnt; /* 8 */
- __u16 ProductID; /* 10 */
- __u8 SerNo[16]; /* 12 */
- __u8 PLInfo[6]; /* 28 */
- __u16 PCBInfo; /* 34 */
- __u32 FeatFlag; /* 36 */
- __u8 RamdacType; /* 40 */
- __u8 RamdacSpeed; /* 41 */
- __u8 PclkMax; /* 42 */
- __u8 ClkGE; /* 43 */
- __u8 ClkMem; /* 44 */
- __u8 Clk4MB; /* 45 */
- __u8 Clk8MB; /* 46 */
- __u8 ClkMod; /* 47 */
- __u8 TestClk; /* 48 */
- __u8 VGAFreq1; /* 49 */
- __u8 VGAFreq2; /* 50 */
- __u8 MCTLWTST; /* 51 */
- __u8 VidCtrl; /* 52 */
- __u8 Clk12MB; /* 53 */
- __u8 Clk16MB; /* 54 */
- __u8 Reserved[8]; /* 55-62 */
- __u8 PinCheck; /* 63 */
-} MGABios2Info;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c
deleted file mode 100644
index 258ace83a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.28 2003/02/08 21:26:58 dawes Exp $ */
-
-/*
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES
- * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "driver.h"
-#include "drm.h"
-#include "memops.h"
-
-#include "mga_reg.h"
-#include "mga.h"
-#include "mga_macros.h"
-#include "mga_dri.h"
-
-
-/* Quiescence, locking
- */
-#define MGA_TIMEOUT 2048
-
-static void MGAWaitForIdleDMA( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- drm_lock_t lock;
- int ret;
- int i = 0;
-
- memset( &lock, 0, sizeof(lock) );
-
- for (;;) {
- do {
- /* first ask for quiescent and flush */
- lock.flags = DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH;
- do {
- ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH,
- &lock, sizeof( lock ) );
- } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
-
- /* if it's still busy just try quiescent */
- if ( ret == -EBUSY ) {
- lock.flags = DRM_LOCK_QUIESCENT;
- do {
- ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH,
- &lock, sizeof( lock ) );
- } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
- }
- } while ( ( ret == -EBUSY ) && ( i++ < MGA_TIMEOUT ) );
-
- if ( ret == 0 )
- return;
-
- fprintf( stderr,
- "[dri] Idle timed out, resetting engine...\n" );
-
- drmCommandNone( ctx->drmFD, DRM_MGA_RESET );
- }
-}
-
-static unsigned int mylog2( unsigned int n )
-{
- unsigned int log2 = 1;
- while ( n > 1 ) n >>= 1, log2++;
- return log2;
-}
-
-static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
-{
- unsigned long mode;
- unsigned int vendor, device;
- int ret, count, i;
-
- if(pMga->agpSize < 12)pMga->agpSize = 12;
- if(pMga->agpSize > 64)pMga->agpSize = 64; /* cap */
-
- /* FIXME: Make these configurable...
- */
- pMga->agp.size = pMga->agpSize * 1024 * 1024;
-
- pMga->warp.offset = 0;
- pMga->warp.size = MGA_WARP_UCODE_SIZE;
-
- pMga->primary.offset = (pMga->warp.offset +
- pMga->warp.size);
- pMga->primary.size = 1024 * 1024;
-
- pMga->buffers.offset = (pMga->primary.offset +
- pMga->primary.size);
- pMga->buffers.size = MGA_NUM_BUFFERS * MGA_BUFFER_SIZE;
-
-
- pMga->agpTextures.offset = (pMga->buffers.offset +
- pMga->buffers.size);
-
- pMga->agpTextures.size = pMga->agp.size -
- pMga->agpTextures.offset;
-
- if ( drmAgpAcquire( ctx->drmFD ) < 0 ) {
- fprintf( stderr, "[agp] AGP not available\n" );
- return 0;
- }
-
- mode = drmAgpGetMode( ctx->drmFD ); /* Default mode */
- vendor = drmAgpVendorId( ctx->drmFD );
- device = drmAgpDeviceId( ctx->drmFD );
-
- mode &= ~MGA_AGP_MODE_MASK;
- switch ( pMga->agpMode ) {
- case 4:
- mode |= MGA_AGP_4X_MODE;
- case 2:
- mode |= MGA_AGP_2X_MODE;
- case 1:
- default:
- mode |= MGA_AGP_1X_MODE;
- }
-
-#if 0
- fprintf( stderr,
- "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n",
- mode, vendor, device,
- ctx->pciVendor,
- ctx->pciChipType );
-#endif
-
- if ( drmAgpEnable( ctx->drmFD, mode ) < 0 ) {
- fprintf( stderr, "[agp] AGP not enabled\n" );
- drmAgpRelease( ctx->drmFD );
- return 0;
- }
-
- if ( pMga->Chipset == PCI_CHIP_MGAG200 ) {
- switch ( pMga->agpMode ) {
- case 2:
- fprintf( stderr,
- "[drm] Enabling AGP 2x PLL encoding\n" );
- OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_ENABLE );
- break;
-
- case 1:
- default:
- fprintf( stderr,
- "[drm] Disabling AGP 2x PLL encoding\n" );
- OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_DISABLE );
- pMga->agpMode = 1;
- break;
- }
- }
-
- ret = drmAgpAlloc( ctx->drmFD, pMga->agp.size,
- 0, NULL, &pMga->agp.handle );
- if ( ret < 0 ) {
- fprintf( stderr, "[agp] Out of memory (%d)\n", ret );
- drmAgpRelease( ctx->drmFD );
- return 0;
- }
- fprintf( stderr,
- "[agp] %d kB allocated with handle 0x%08x\n",
- pMga->agp.size/1024, (unsigned int)pMga->agp.handle );
-
- if ( drmAgpBind( ctx->drmFD, pMga->agp.handle, 0 ) < 0 ) {
- fprintf( stderr, "[agp] Could not bind memory\n" );
- drmAgpFree( ctx->drmFD, pMga->agp.handle );
- drmAgpRelease( ctx->drmFD );
- return 0;
- }
-
- /* WARP microcode space
- */
- if ( drmAddMap( ctx->drmFD,
- pMga->warp.offset,
- pMga->warp.size,
- DRM_AGP, DRM_READ_ONLY,
- &pMga->warp.handle ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not add WARP microcode mapping\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] WARP microcode handle = 0x%08x\n",
- pMga->warp.handle );
-
- if ( drmMap( ctx->drmFD,
- pMga->warp.handle,
- pMga->warp.size,
- &pMga->warp.map ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not map WARP microcode\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] WARP microcode mapped at 0x%08lx\n",
- (unsigned long)pMga->warp.map );
-
- /* Primary DMA space
- */
- if ( drmAddMap( ctx->drmFD,
- pMga->primary.offset,
- pMga->primary.size,
- DRM_AGP, DRM_READ_ONLY,
- &pMga->primary.handle ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not add primary DMA mapping\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] Primary DMA handle = 0x%08x\n",
- pMga->primary.handle );
-
- if ( drmMap( ctx->drmFD,
- pMga->primary.handle,
- pMga->primary.size,
- &pMga->primary.map ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not map primary DMA\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] Primary DMA mapped at 0x%08lx\n",
- (unsigned long)pMga->primary.map );
-
- /* DMA buffers
- */
- if ( drmAddMap( ctx->drmFD,
- pMga->buffers.offset,
- pMga->buffers.size,
- DRM_AGP, 0,
- &pMga->buffers.handle ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not add DMA buffers mapping\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] DMA buffers handle = 0x%08x\n",
- pMga->buffers.handle );
-
- if ( drmMap( ctx->drmFD,
- pMga->buffers.handle,
- pMga->buffers.size,
- &pMga->buffers.map ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not map DMA buffers\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] DMA buffers mapped at 0x%08lx\n",
- (unsigned long)pMga->buffers.map );
-
- count = drmAddBufs( ctx->drmFD,
- MGA_NUM_BUFFERS, MGA_BUFFER_SIZE,
- DRM_AGP_BUFFER, pMga->buffers.offset );
- if ( count <= 0 ) {
- fprintf( stderr,
- "[drm] failure adding %d %d byte DMA buffers\n",
- MGA_NUM_BUFFERS, MGA_BUFFER_SIZE );
- return 0;
- }
- fprintf( stderr,
- "[drm] Added %d %d byte DMA buffers\n",
- count, MGA_BUFFER_SIZE );
-
- i = mylog2(pMga->agpTextures.size / MGA_NR_TEX_REGIONS);
- if(i < MGA_LOG_MIN_TEX_REGION_SIZE)
- i = MGA_LOG_MIN_TEX_REGION_SIZE;
- pMga->agpTextures.size = (pMga->agpTextures.size >> i) << i;
-
- if ( drmAddMap( ctx->drmFD,
- pMga->agpTextures.offset,
- pMga->agpTextures.size,
- DRM_AGP, 0,
- &pMga->agpTextures.handle ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not add agpTexture mapping\n" );
- return 0;
- }
-/* should i map it ? */
- fprintf( stderr,
- "[agp] agpTexture handle = 0x%08x\n",
- pMga->agpTextures.handle );
- fprintf( stderr,
- "[agp] agpTexture size: %d kb\n", pMga->agpTextures.size/1024 );
-
- return 1;
-}
-
-static int MGADRIMapInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- pMga->registers.size = MGAIOMAPSIZE;
-
- if ( drmAddMap( ctx->drmFD,
- (drm_handle_t)pMga->IOAddress,
- pMga->registers.size,
- DRM_REGISTERS, DRM_READ_ONLY,
- &pMga->registers.handle ) < 0 ) {
- fprintf( stderr,
- "[drm] Could not add MMIO registers mapping\n" );
- return 0;
- }
- fprintf( stderr,
- "[drm] Registers handle = 0x%08lx\n",
- pMga->registers.handle );
-
- pMga->status.size = SAREA_MAX;
-
- if ( drmAddMap( ctx->drmFD, 0, pMga->status.size,
- DRM_SHM, DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL,
- &pMga->status.handle ) < 0 ) {
- fprintf( stderr,
- "[drm] Could not add status page mapping\n" );
- return 0;
- }
- fprintf( stderr,
- "[drm] Status handle = 0x%08x\n",
- pMga->status.handle );
-
- if ( drmMap( ctx->drmFD,
- pMga->status.handle,
- pMga->status.size,
- &pMga->status.map ) < 0 ) {
- fprintf( stderr,
- "[agp] Could not map status page\n" );
- return 0;
- }
- fprintf( stderr,
- "[agp] Status page mapped at 0x%08lx\n",
- (unsigned long)pMga->status.map );
-
- return 1;
-}
-
-static int MGADRIKernelInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- drm_mga_init_t init;
- int ret;
-
- memset( &init, 0, sizeof(init) );
-
- init.func = MGA_INIT_DMA;
- init.sarea_priv_offset = sizeof(drm_sarea_t);
-
- switch ( pMga->Chipset ) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- init.chipset = MGA_CARD_TYPE_G400;
- break;
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- init.chipset = MGA_CARD_TYPE_G200;
- break;
- default:
- return 0;
- }
-
- init.sgram = 0; /* FIXME !pMga->HasSDRAM; */
-
-
- switch (ctx->bpp)
- {
- case 16:
- init.maccess = MGA_MACCESS_PW16;
- break;
- case 32:
- init.maccess = MGA_MACCESS_PW32;
- break;
- default:
- fprintf( stderr, "[mga] invalid bpp (%d)\n", ctx->bpp );
- return 0;
- }
-
-
- init.fb_cpp = ctx->bpp / 8;
- init.front_offset = pMga->frontOffset;
- init.front_pitch = pMga->frontPitch / init.fb_cpp;
- init.back_offset = pMga->backOffset;
- init.back_pitch = pMga->backPitch / init.fb_cpp;
-
- init.depth_cpp = ctx->bpp / 8;
- init.depth_offset = pMga->depthOffset;
- init.depth_pitch = pMga->depthPitch / init.depth_cpp;
-
- init.texture_offset[0] = pMga->textureOffset;
- init.texture_size[0] = pMga->textureSize;
-
- init.fb_offset = ctx->shared.hFrameBuffer;
- init.mmio_offset = pMga->registers.handle;
- init.status_offset = pMga->status.handle;
-
- init.warp_offset = pMga->warp.handle;
- init.primary_offset = pMga->primary.handle;
- init.buffers_offset = pMga->buffers.handle;
-
- init.texture_offset[1] = pMga->agpTextures.handle;
- init.texture_size[1] = pMga->agpTextures.size;
-
- ret = drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(init));
- if ( ret < 0 ) {
- fprintf( stderr,
- "[drm] Failed to initialize DMA! (%d)\n", ret );
- return 0;
- }
-
- return 1;
-}
-
-static void MGADRIIrqInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
-{
- if (!pMga->irq)
- {
- pMga->irq = drmGetInterruptFromBusID(ctx->drmFD,
- ctx->pciBus,
- ctx->pciDevice,
- ctx->pciFunc);
-
- fprintf(stderr, "[drm] got IRQ %d\n", pMga->irq);
-
- if((drmCtlInstHandler(ctx->drmFD, pMga->irq)) != 0)
- {
- fprintf(stderr,
- "[drm] failure adding irq handler, "
- "there is a device already using that irq\n"
- "[drm] falling back to irq-free operation\n");
- pMga->irq = 0;
- }
- else
- {
- pMga->reg_ien = INREG( MGAREG_IEN );
- }
- }
-
- if (pMga->irq)
- fprintf(stderr,
- "[drm] dma control initialized, using IRQ %d\n",
- pMga->irq);
-}
-
-static int MGADRIBuffersInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- pMga->drmBuffers = drmMapBufs( ctx->drmFD );
- if ( !pMga->drmBuffers )
- {
- fprintf( stderr,
- "[drm] Failed to map DMA buffers list\n" );
- return 0;
- }
-
- fprintf( stderr,
- "[drm] Mapped %d DMA buffers\n",
- pMga->drmBuffers->count );
-
- return 1;
-}
-
-static int MGAMemoryInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- int width_bytes = ctx->shared.virtualWidth * ctx->cpp;
- int bufferSize = ((ctx->shared.virtualHeight * width_bytes
- + MGA_BUFFER_ALIGN)
- & ~MGA_BUFFER_ALIGN);
- int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes
- + MGA_BUFFER_ALIGN)
- & ~MGA_BUFFER_ALIGN);
- int l;
-
- pMga->frontOffset = 0;
- pMga->frontPitch = ctx->shared.virtualWidth * ctx->cpp;
-
- fprintf(stderr,
- "Using %d MB AGP aperture\n", pMga->agpSize);
- fprintf(stderr,
- "Using %d MB for vertex/indirect buffers\n", pMga->buffers.size>>20);
- fprintf(stderr,
- "Using %d MB for AGP textures\n", pMga->agpTextures.size>>20);
-
- /* Front, back and depth buffers - everything else texture??
- */
- pMga->textureSize = ctx->shared.fbSize - 2 * bufferSize - depthSize;
-
- if (pMga->textureSize < 0)
- return 0;
-
- l = mylog2( pMga->textureSize / MGA_NR_TEX_REGIONS );
- if ( l < MGA_LOG_MIN_TEX_REGION_SIZE )
- l = MGA_LOG_MIN_TEX_REGION_SIZE;
-
- /* Round the texture size up to the nearest whole number of
- * texture regions. Again, be greedy about this, don't
- * round down.
- */
- pMga->logTextureGranularity = l;
- pMga->textureSize = (pMga->textureSize >> l) << l;
-
- /* Set a minimum usable local texture heap size. This will fit
- * two 256x256x32bpp textures.
- */
- if (pMga->textureSize < 512 * 1024) {
- pMga->textureOffset = 0;
- pMga->textureSize = 0;
- }
-
- /* Reserve space for textures */
- pMga->textureOffset = ((ctx->shared.fbSize - pMga->textureSize +
- MGA_BUFFER_ALIGN) &
- ~MGA_BUFFER_ALIGN);
-
- /* Reserve space for the shared depth
- * buffer.
- */
- pMga->depthOffset = ((pMga->textureOffset - depthSize +
- MGA_BUFFER_ALIGN) &
- ~MGA_BUFFER_ALIGN);
- pMga->depthPitch = ctx->shared.virtualWidth * ctx->cpp;
-
- pMga->backOffset = ((pMga->depthOffset - bufferSize +
- MGA_BUFFER_ALIGN) &
- ~MGA_BUFFER_ALIGN);
- pMga->backPitch = ctx->shared.virtualWidth * ctx->cpp;
-
-
- fprintf(stderr,
- "Will use back buffer at offset 0x%x\n",
- pMga->backOffset);
- fprintf(stderr,
- "Will use depth buffer at offset 0x%x\n",
- pMga->depthOffset);
- fprintf(stderr,
- "Will use %d kb for textures at offset 0x%x\n",
- pMga->textureSize/1024, pMga->textureOffset);
-
- return 1;
-}
-
-static int MGACheckDRMVersion( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- drmVersionPtr version;
-
- /* Check the MGA DRM version */
- version = drmGetVersion(ctx->drmFD);
- if ( version ) {
- if ( version->version_major != 3 ||
- version->version_minor < 0 ) {
- /* incompatible drm version */
- fprintf( stderr,
- "[dri] MGADRIScreenInit failed because of a version mismatch.\n"
- "[dri] mga.o kernel module version is %d.%d.%d but version 3.0.x is needed.\n"
- "[dri] Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel );
- drmFreeVersion( version );
- return 0;
- }
- drmFreeVersion( version );
- }
-
- return 1;
-}
-
-static void print_client_msg( MGADRIPtr pMGADRI )
-{
- fprintf( stderr, "chipset: %d\n", pMGADRI->chipset );
-
- fprintf( stderr, "width: %d\n", pMGADRI->width );
- fprintf( stderr, "height: %d\n", pMGADRI->height );
- fprintf( stderr, "mem: %d\n", pMGADRI->mem );
- fprintf( stderr, "cpp: %d\n", pMGADRI->cpp );
-
- fprintf( stderr, "agpMode: %d\n", pMGADRI->agpMode );
-
- fprintf( stderr, "frontOffset: %d\n", pMGADRI->frontOffset );
- fprintf( stderr, "frontPitch: %d\n", pMGADRI->frontPitch );
-
- fprintf( stderr, "backOffset: %d\n", pMGADRI->backOffset );
- fprintf( stderr, "backPitch: %d\n", pMGADRI->backPitch );
-
- fprintf( stderr, "depthOffset: %d\n", pMGADRI->depthOffset );
- fprintf( stderr, "depthPitch: %d\n", pMGADRI->depthPitch );
-
- fprintf( stderr, "textureOffset: %d\n", pMGADRI->textureOffset );
- fprintf( stderr, "textureSize: %d\n", pMGADRI->textureSize );
-
- fprintf( stderr, "logTextureGranularity: %d\n", pMGADRI->logTextureGranularity );
- fprintf( stderr, "logAgpTextureGranularity: %d\n", pMGADRI->logAgpTextureGranularity );
-
- fprintf( stderr, "agpTextureHandle: %u\n", (unsigned int)pMGADRI->agpTextureOffset );
- fprintf( stderr, "agpTextureSize: %u\n", (unsigned int)pMGADRI->agpTextureSize );
-
-#if 0
- pMGADRI->registers.handle = pMga->registers.handle;
- pMGADRI->registers.size = pMga->registers.size;
- pMGADRI->status.handle = pMga->status.handle;
- pMGADRI->status.size = pMga->status.size;
- pMGADRI->primary.handle = pMga->primary.handle;
- pMGADRI->primary.size = pMga->primary.size;
- pMGADRI->buffers.handle = pMga->buffers.handle;
- pMGADRI->buffers.size = pMga->buffers.size;
- pMGADRI->sarea_priv_offset = sizeof(drm_sarea_t);
-#endif
-}
-
-static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
-{
- int i;
- int err;
- MGADRIPtr pMGADRI;
-
- usleep(100);
- /*assert(!ctx->IsClient);*/
-
- {
- int width_bytes = (ctx->shared.virtualWidth * ctx->cpp);
- int maxy = ctx->shared.fbSize / width_bytes;
-
-
- if (maxy <= ctx->shared.virtualHeight * 3) {
- fprintf(stderr,
- "Static buffer allocation failed -- "
- "need at least %d kB video memory (have %d kB)\n",
- (ctx->shared.virtualWidth * ctx->shared.virtualHeight *
- ctx->cpp * 3 + 1023) / 1024,
- ctx->shared.fbSize / 1024);
- return 0;
- }
- }
-
- switch(pMga->Chipset) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG200:
-#if 0
- case PCI_CHIP_MGAG200_PCI:
-#endif
- break;
- default:
- fprintf(stderr, "[drm] Direct rendering only supported with G200/G400/G550 AGP\n");
- return 0;
- }
-
- fprintf( stderr,
- "[drm] bpp: %d depth: %d\n",
- ctx->bpp, ctx->bpp /* FIXME: depth */ );
-
- if ( (ctx->bpp / 8) != 2 &&
- (ctx->bpp / 8) != 4 ) {
- fprintf( stderr,
- "[dri] Direct rendering only supported in 16 and 32 bpp modes\n" );
- return 0;
- }
-
- ctx->shared.SAREASize = SAREA_MAX;
-
-
- /* Note that drmOpen will try to load the kernel module, if needed. */
- ctx->drmFD = drmOpen("mga", NULL );
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
-
- if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) {
- fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
- return 0;
- }
-
-
- if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap( ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
- 0,
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
-
-#if 0 /* will be done in MGADRIMapInit */
- if (drmAddMap(ctx->drmFD,
- ctx->FixedInfo.mmio_start,
- ctx->FixedInfo.mmio_len,
- DRM_REGISTERS,
- DRM_READ_ONLY,
- &pMga->registers.handle) < 0) {
- fprintf(stderr, "[drm] drmAddMap mmio failed\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] register handle = 0x%08lx\n", pMga->registers.handle);
-#endif
-
-
- /* Check the mga DRM version */
- if (!MGACheckDRMVersion(ctx, pMga)) {
- return 0;
- }
-
- if ( !MGADRIAgpInit( ctx, pMga ) ) {
- return 0;
- }
-
- if ( !MGADRIMapInit( ctx, pMga ) ) {
- return 0;
- }
-
- /* Memory manager setup */
- if (!MGAMemoryInit(ctx, pMga)) {
- return 0;
- }
-
-
- /* Create a 'server' context so we can grab the lock for
- * initialization ioctls.
- */
- if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return 0;
- }
-
- DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0);
-
- /* Initialize the kernel data structures */
- if (!MGADRIKernelInit(ctx, pMga)) {
- fprintf(stderr, "MGADRIKernelInit failed\n");
- DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);
- return 0;
- }
-
- /* Initialize the vertex buffers list */
- if (!MGADRIBuffersInit(ctx, pMga)) {
- fprintf(stderr, "MGADRIBuffersInit failed\n");
- DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);
- return 0;
- }
-
- /* Initialize IRQ */
- MGADRIIrqInit(ctx, pMga);
-
-
- /* Initialize the SAREA private data structure */
- {
- drm_mga_sarea_t *pSAREAPriv;
- pSAREAPriv = (drm_mga_sarea_t *)(((char*)ctx->pSAREA) +
- sizeof(drm_sarea_t));
- memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
- }
-
- /* Quick hack to clear the front & back buffers. Could also use
- * the clear ioctl to do this, but would need to setup hw state
- * first.
- */
- drimemsetio((char *)ctx->FBAddress + pMga->frontOffset,
- 0,
- pMga->frontPitch * ctx->shared.virtualHeight );
-
- drimemsetio((char *)ctx->FBAddress + pMga->backOffset,
- 0,
- pMga->backPitch * ctx->shared.virtualHeight );
-
- /* Can release the lock now */
-/* DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);*/
-
- /* This is the struct passed to radeon_dri.so for its initialization */
- ctx->driverClientMsg = malloc(sizeof(MGADRIRec));
- ctx->driverClientMsgSize = sizeof(MGADRIRec);
-
- pMGADRI = (MGADRIPtr)ctx->driverClientMsg;
-
-
- switch(pMga->Chipset) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- pMGADRI->chipset = MGA_CARD_TYPE_G400;
- break;
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- pMGADRI->chipset = MGA_CARD_TYPE_G200;
- break;
- default:
- return 0;
- }
- pMGADRI->width = ctx->shared.virtualWidth;
- pMGADRI->height = ctx->shared.virtualHeight;
- pMGADRI->mem = ctx->shared.fbSize;
- pMGADRI->cpp = ctx->bpp / 8;
-
- pMGADRI->agpMode = pMga->agpMode;
-
- pMGADRI->frontOffset = pMga->frontOffset;
- pMGADRI->frontPitch = pMga->frontPitch;
- pMGADRI->backOffset = pMga->backOffset;
- pMGADRI->backPitch = pMga->backPitch;
- pMGADRI->depthOffset = pMga->depthOffset;
- pMGADRI->depthPitch = pMga->depthPitch;
- pMGADRI->textureOffset = pMga->textureOffset;
- pMGADRI->textureSize = pMga->textureSize;
- pMGADRI->logTextureGranularity = pMga->logTextureGranularity;
-
- i = mylog2( pMga->agpTextures.size / MGA_NR_TEX_REGIONS );
- if ( i < MGA_LOG_MIN_TEX_REGION_SIZE )
- i = MGA_LOG_MIN_TEX_REGION_SIZE;
-
- pMGADRI->logAgpTextureGranularity = i;
- pMGADRI->agpTextureOffset = (unsigned int)pMga->agpTextures.handle;
- pMGADRI->agpTextureSize = (unsigned int)pMga->agpTextures.size;
-
- pMGADRI->registers.handle = pMga->registers.handle;
- pMGADRI->registers.size = pMga->registers.size;
- pMGADRI->status.handle = pMga->status.handle;
- pMGADRI->status.size = pMga->status.size;
- pMGADRI->primary.handle = pMga->primary.handle;
- pMGADRI->primary.size = pMga->primary.size;
- pMGADRI->buffers.handle = pMga->buffers.handle;
- pMGADRI->buffers.size = pMga->buffers.size;
- pMGADRI->sarea_priv_offset = sizeof(drm_sarea_t);
-
- print_client_msg( pMGADRI );
-
- return 1;
-}
-
-
-/**
- * \brief Validate the fbdev mode.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Saves some registers and returns 1.
- *
- * \sa mgaValidateMode().
- */
-static int mgaValidateMode( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Examine mode returned by fbdev.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Restores registers that fbdev has clobbered and returns 1.
- *
- * \sa mgaValidateMode().
- */
-static int mgaPostValidateMode( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Initialize the framebuffer device mode
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Fills in \p info with some default values and some information from \p ctx
- * and then calls MGAScreenInit() for the screen initialization.
- *
- * Before exiting clears the framebuffer memomry accessing it directly.
- */
-static int mgaInitFBDev( struct DRIDriverContextRec *ctx )
-{
- MGAPtr pMga = calloc(1, sizeof(*pMga));
-
- {
- int dummy = ctx->shared.virtualWidth;
-
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break;
- }
-
- ctx->shared.virtualWidth = dummy;
- }
-
- ctx->driverPrivate = (void *)pMga;
-
- pMga->agpMode = MGA_DEFAULT_AGP_MODE;
- pMga->agpSize = MGA_DEFAULT_AGP_SIZE;
-
- pMga->Chipset = ctx->chipset;
-
- pMga->IOAddress = ctx->MMIOStart;
- pMga->IOBase = ctx->MMIOAddress;
-
- pMga->frontPitch = ctx->shared.virtualWidth * ctx->cpp;
-
- if (!MGAScreenInit( ctx, pMga ))
- return 0;
-
- return 1;
-}
-
-
-/**
- * \brief The screen is being closed, so clean up any state and free any
- * resources used by the DRI.
- *
- * \param ctx display handle.
- *
- * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver
- * private data.
- */
-static void mgaHaltFBDev( struct DRIDriverContextRec *ctx )
-{
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = NULL;
- }
-}
-
-
-static int mgaEngineShutdown( const DRIDriverContext *ctx )
-{
- fprintf(stderr, "%s() is not yet implemented!\n", __FUNCTION__);
-
- return 1;
-}
-
-static int mgaEngineRestore( const DRIDriverContext *ctx )
-{
- fprintf(stderr, "%s() is not yet implemented!\n", __FUNCTION__);
-
- return 1;
-}
-
-/**
- * \brief Exported driver interface for Mini GLX.
- *
- * \sa DRIDriverRec.
- */
-struct DRIDriverRec __driDriver = {
- mgaValidateMode,
- mgaPostValidateMode,
- mgaInitFBDev,
- mgaHaltFBDev,
- mgaEngineShutdown,
- mgaEngineRestore,
- 0
-};
-
-
-
-
-#if 0
-void MGADRICloseScreen( ScreenPtr pScreen )
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- MGAPtr pMga = MGAPTR(pScrn);
- MGADRIServerPrivatePtr pMga = pMga->DRIServerInfo;
- drmMGAInit init;
-
- if ( pMga->drmBuffers ) {
- drmUnmapBufs( pMga->drmBuffers );
- pMga->drmBuffers = NULL;
- }
-
- if (pMga->irq) {
- drmCtlUninstHandler(ctx->drmFD);
- pMga->irq = 0;
- }
-
- /* Cleanup DMA */
- memset( &init, 0, sizeof(drmMGAInit) );
- init.func = MGA_CLEANUP_DMA;
- drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit) );
-
- if ( pMga->status.map ) {
- drmUnmap( pMga->status.map, pMga->status.size );
- pMga->status.map = NULL;
- }
- if ( pMga->buffers.map ) {
- drmUnmap( pMga->buffers.map, pMga->buffers.size );
- pMga->buffers.map = NULL;
- }
- if ( pMga->primary.map ) {
- drmUnmap( pMga->primary.map, pMga->primary.size );
- pMga->primary.map = NULL;
- }
- if ( pMga->warp.map ) {
- drmUnmap( pMga->warp.map, pMga->warp.size );
- pMga->warp.map = NULL;
- }
-
- if ( pMga->agpTextures.map ) {
- drmUnmap( pMga->agpTextures.map, pMga->agpTextures.size );
- pMga->agpTextures.map = NULL;
- }
-
- if ( pMga->agp.handle ) {
- drmAgpUnbind( ctx->drmFD, pMga->agp.handle );
- drmAgpFree( ctx->drmFD, pMga->agp.handle );
- pMga->agp.handle = 0;
- drmAgpRelease( ctx->drmFD );
- }
-
- DRICloseScreen( pScreen );
-
- if ( pMga->pDRIInfo ) {
- if ( pMga->pDRIpMga->devPrivate ) {
- xfree( pMga->pDRIpMga->devPrivate );
- pMga->pDRIpMga->devPrivate = 0;
- }
- DRIDestroyInfoRec( pMga->pDRIInfo );
- pMga->pDRIInfo = 0;
- }
- if ( pMga->DRIServerInfo ) {
- xfree( pMga->DRIServerInfo );
- pMga->DRIServerInfo = 0;
- }
- if ( pMga->pVisualConfigs ) {
- xfree( pMga->pVisualConfigs );
- }
- if ( pMga->pVisualConfigsPriv ) {
- xfree( pMga->pVisualConfigsPriv );
- }
-}
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.h
deleted file mode 100644
index 03b841460..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h,v 1.8 2002/11/29 11:06:42 eich Exp $ */
-
-/*
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES
- * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifndef __MGA_DRI_H__
-#define __MGA_DRI_H__
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "mga_drm.h"
-
-#define MGA_DEFAULT_AGP_SIZE 64
-#define MGA_DEFAULT_AGP_MODE 4
-#define MGA_MAX_AGP_MODE 4
-
-/* Buffer are aligned on 4096 byte boundaries.
- */
-#define MGA_BUFFER_ALIGN 0x00000fff
-
-#ifdef __GNUC__
-# define DEPRECATED __attribute__ ((deprecated))
-#else
-# define DEPRECATED
-#endif
-
-#if 1
-typedef struct _mgaDrmRegion {
- drm_handle_t handle;
- unsigned int offset;
- drmSize size;
-} mgaDrmRegion, *mgaDrmRegionPtr;
-#else
-#define mgaDrmRegion drmRegion
-#endif
-
-typedef struct {
- int chipset;
- int width DEPRECATED;
- int height DEPRECATED;
- int mem DEPRECATED;
- int cpp;
-
- int agpMode;
-
- unsigned int frontOffset;
- unsigned int frontPitch;
-
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- unsigned int textureOffset;
- unsigned int textureSize;
- int logTextureGranularity DEPRECATED;
-
- /* Allow calculation of setup dma addresses.
- */
- unsigned int agpBufferOffset DEPRECATED;
-
- unsigned int agpTextureOffset;
- unsigned int agpTextureSize;
- int logAgpTextureGranularity DEPRECATED;
-
- unsigned int mAccess DEPRECATED;
-
- /**
- * \name DRM memory regions.
- *
- * \todo
- * Several of these fields are no longer used (and will never be used
- * again) on the client-side. None of them, except \c registers, are used
- * on the server-side. At some point when it is safe to do so (probably
- * for the X.org 6.9 / 7.0 release), these fields should be removed.
- */
- /*@{*/
- mgaDrmRegion registers; /**< MMIO registers. */
- mgaDrmRegion status DEPRECATED; /**< No longer used on the client-side. */
- mgaDrmRegion primary; /**< Primary DMA region. */
- mgaDrmRegion buffers DEPRECATED; /**< No longer used on the client-side. */
- /*@}*/
-
- unsigned int sarea_priv_offset;
-} MGADRIRec, *MGADRIPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_macros.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_macros.h
deleted file mode 100644
index d985081ab..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_macros.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.22 2002/02/20 17:17:50 dawes Exp $ */
-
-#ifndef _MGA_MACROS_H_
-#define _MGA_MACROS_H_
-
-#ifndef PSZ
-#define PSZ 8
-#endif
-
-#if PSZ == 8
-#define REPLICATE(r) r &= 0xFF; r |= r << 8; r |= r << 16
-#elif PSZ == 16
-#define REPLICATE(r) r &= 0xFFFF; r |= r << 16
-#elif PSZ == 24
-#define REPLICATE(r) r &= 0xFFFFFF; r |= r << 24
-#else
-#define REPLICATE(r) /* */
-#endif
-
-#define RGBEQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
-
-#ifdef XF86DRI
-#define MGA_SYNC_XTAG 0x275f4200
-
-#define MGABUSYWAIT() do { \
-OUTREG(MGAREG_DWGSYNC, MGA_SYNC_XTAG); \
-while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \
-}while(0);
-
-#endif
-
-#define MGAISBUSY() (INREG8(MGAREG_Status + 2) & 0x01)
-
-#define WAITFIFO(cnt) \
- if(!pMga->UsePCIRetry) {\
- register int n = cnt; \
- if(n > pMga->FifoSize) n = pMga->FifoSize; \
- while(pMga->fifoCount < (n))\
- pMga->fifoCount = INREG8(MGAREG_FIFOSTATUS);\
- pMga->fifoCount -= n;\
- }
-
-#define XYADDRESS(x,y) \
- ((y) * pMga->CurrentLayout.displayWidth + (x) + pMga->YDstOrg)
-
-#define MAKEDMAINDEX(index) ((((index) >> 2) & 0x7f) | (((index) >> 6) & 0x80))
-
-#define DMAINDICES(one,two,three,four) \
- ( MAKEDMAINDEX(one) | \
- (MAKEDMAINDEX(two) << 8) | \
- (MAKEDMAINDEX(three) << 16) | \
- (MAKEDMAINDEX(four) << 24) )
-
-#if PSZ == 24
-#define SET_PLANEMASK(p) /**/
-#else
-#define SET_PLANEMASK(p) \
- if(!(pMga->AccelFlags & MGA_NO_PLANEMASK) && ((p) != pMga->PlaneMask)) { \
- pMga->PlaneMask = (p); \
- REPLICATE((p)); \
- OUTREG(MGAREG_PLNWT,(p)); \
- }
-#endif
-
-#define SET_FOREGROUND(c) \
- if((c) != pMga->FgColor) { \
- pMga->FgColor = (c); \
- REPLICATE((c)); \
- OUTREG(MGAREG_FCOL,(c)); \
- }
-
-#define SET_BACKGROUND(c) \
- if((c) != pMga->BgColor) { \
- pMga->BgColor = (c); \
- REPLICATE((c)); \
- OUTREG(MGAREG_BCOL,(c)); \
- }
-
-#define DISABLE_CLIP() { \
- pMga->AccelFlags &= ~CLIPPER_ON; \
- WAITFIFO(1); \
- OUTREG(MGAREG_CXBNDRY, 0xFFFF0000); }
-
-#ifdef XF86DRI
-#define CHECK_DMA_QUIESCENT(pMGA, pScrn) { \
- if (!pMGA->haveQuiescense) { \
- pMGA->GetQuiescence( pScrn ); \
- } \
-}
-#else
-#define CHECK_DMA_QUIESCENT(pMGA, pScrn)
-#endif
-
-#ifdef USEMGAHAL
-#define HAL_CHIPSETS ((pMga->Chipset == PCI_CHIP_MGAG200_PCI) || \
- (pMga->Chipset == PCI_CHIP_MGAG200) || \
- (pMga->Chipset == PCI_CHIP_MGAG400) || \
- (pMga->Chipset == PCI_CHIP_MGAG550))
-
-#define MGA_HAL(x) { \
- MGAPtr pMga = MGAPTR(pScrn); \
- if (pMga->HALLoaded && HAL_CHIPSETS) { x; } \
-}
-#define MGA_NOT_HAL(x) { \
- MGAPtr pMga = MGAPTR(pScrn); \
- if (!pMga->HALLoaded || !HAL_CHIPSETS) { x; } \
-}
-#else
-#define MGA_NOT_HAL(x) { x; }
-#endif
-
-#define MGAISGx50(x) ( (((x)->Chipset == PCI_CHIP_MGAG400) && ((x)->ChipRev >= 0x80)) || \
- ((x)->Chipset == PCI_CHIP_MGAG550) )
-
-#define MGA_DH_NEEDS_HAL(x) (((x)->Chipset == PCI_CHIP_MGAG400) && \
- ((x)->ChipRev < 0x80))
-
-#endif /* _MGA_MACROS_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_reg.h
deleted file mode 100644
index b8e349923..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/mga/server/mga_reg.h
+++ /dev/null
@@ -1,484 +0,0 @@
-/* $XConsortium: mgareg.h /main/2 1996/10/25 10:33:21 kaleb $ */
-
-
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.18 2001/09/26 12:59:18 alanh Exp $ */
-
-
-
-/*
- * MGA Millennium (MGA2064W) functions
- * MGA Mystique (MGA1064SG) functions
- *
- * Copyright 1996 The XFree86 Project, Inc.
- *
- * Authors
- * Dirk Hohndel
- * hohndel@XFree86.Org
- * David Dawes
- * dawes@XFree86.Org
- * Contributors:
- * Guy DESBIEF, Aix-en-provence, France
- * g.desbief@aix.pacwan.net
- * MGA1064SG Mystique register file
- */
-
-
-#ifndef _MGA_REG_H_
-#define _MGA_REG_H_
-
-#define MGAREG_DWGCTL 0x1c00
-#define MGAREG_MACCESS 0x1c04
-#define MGA_MACCESS_PW16 0x00000001
-#define MGA_MACCESS_PW32 0x00000002
-/* the following is a mystique only register */
-#define MGAREG_MCTLWTST 0x1c08
-#define MGAREG_ZORG 0x1c0c
-
-#define MGAREG_PAT0 0x1c10
-#define MGAREG_PAT1 0x1c14
-#define MGAREG_PLNWT 0x1c1c
-
-#define MGAREG_BCOL 0x1c20
-#define MGAREG_FCOL 0x1c24
-
-#define MGAREG_SRC0 0x1c30
-#define MGAREG_SRC1 0x1c34
-#define MGAREG_SRC2 0x1c38
-#define MGAREG_SRC3 0x1c3c
-
-#define MGAREG_XYSTRT 0x1c40
-#define MGAREG_XYEND 0x1c44
-
-#define MGAREG_SHIFT 0x1c50
-/* the following is a mystique only register */
-#define MGAREG_DMAPAD 0x1c54
-#define MGAREG_SGN 0x1c58
-#define MGAREG_LEN 0x1c5c
-
-#define MGAREG_AR0 0x1c60
-#define MGAREG_AR1 0x1c64
-#define MGAREG_AR2 0x1c68
-#define MGAREG_AR3 0x1c6c
-#define MGAREG_AR4 0x1c70
-#define MGAREG_AR5 0x1c74
-#define MGAREG_AR6 0x1c78
-
-#define MGAREG_CXBNDRY 0x1c80
-#define MGAREG_FXBNDRY 0x1c84
-#define MGAREG_YDSTLEN 0x1c88
-#define MGAREG_PITCH 0x1c8c
-
-#define MGAREG_YDST 0x1c90
-#define MGAREG_YDSTORG 0x1c94
-#define MGAREG_YTOP 0x1c98
-#define MGAREG_YBOT 0x1c9c
-
-#define MGAREG_CXLEFT 0x1ca0
-#define MGAREG_CXRIGHT 0x1ca4
-#define MGAREG_FXLEFT 0x1ca8
-#define MGAREG_FXRIGHT 0x1cac
-
-#define MGAREG_XDST 0x1cb0
-
-#define MGAREG_DR0 0x1cc0
-#define MGAREG_DR1 0x1cc4
-#define MGAREG_DR2 0x1cc8
-#define MGAREG_DR3 0x1ccc
-
-#define MGAREG_DR4 0x1cd0
-#define MGAREG_DR5 0x1cd4
-#define MGAREG_DR6 0x1cd8
-#define MGAREG_DR7 0x1cdc
-
-#define MGAREG_DR8 0x1ce0
-#define MGAREG_DR9 0x1ce4
-#define MGAREG_DR10 0x1ce8
-#define MGAREG_DR11 0x1cec
-
-#define MGAREG_DR12 0x1cf0
-#define MGAREG_DR13 0x1cf4
-#define MGAREG_DR14 0x1cf8
-#define MGAREG_DR15 0x1cfc
-
-#define MGAREG_SRCORG 0x2cb4
-#define MGAREG_DSTORG 0x2cb8
-
-/* add or or this to one of the previous "power registers" to start
- the drawing engine */
-
-#define MGAREG_EXEC 0x0100
-
-#define MGAREG_FIFOSTATUS 0x1e10
-#define MGAREG_Status 0x1e14
-#define MGAREG_ICLEAR 0x1e18
-#define MGAREG_IEN 0x1e1c
-
-#define MGAREG_VCOUNT 0x1e20
-
-#define MGAREG_Reset 0x1e40
-
-#define MGAREG_OPMODE 0x1e54
-
-/* Warp Registers */
-#define MGAREG_WIADDR 0x1dc0
-#define MGAREG_WIADDR2 0x1dd8
-#define MGAREG_WGETMSB 0x1dc8
-#define MGAREG_WVRTXSZ 0x1dcc
-#define MGAREG_WACCEPTSEQ 0x1dd4
-#define MGAREG_WMISC 0x1e70
-
-/* OPMODE register additives */
-
-#define MGAOPM_DMA_GENERAL (0x00 << 2)
-#define MGAOPM_DMA_BLIT (0x01 << 2)
-#define MGAOPM_DMA_VECTOR (0x10 << 2)
-
-/* DWGCTL register additives */
-
-/* Lines */
-
-#define MGADWG_LINE_OPEN 0x00
-#define MGADWG_AUTOLINE_OPEN 0x01
-#define MGADWG_LINE_CLOSE 0x02
-#define MGADWG_AUTOLINE_CLOSE 0x03
-
-/* Trapezoids */
-#define MGADWG_TRAP 0x04
-#define MGADWG_TEXTURE_TRAP 0x05
-
-/* BitBlts */
-
-#define MGADWG_BITBLT 0x08
-#define MGADWG_FBITBLT 0x0c
-#define MGADWG_ILOAD 0x09
-#define MGADWG_ILOAD_SCALE 0x0d
-#define MGADWG_ILOAD_FILTER 0x0f
-#define MGADWG_ILOAD_HIQH 0x07
-#define MGADWG_ILOAD_HIQHV 0x0e
-#define MGADWG_IDUMP 0x0a
-
-/* atype access to WRAM */
-
-#define MGADWG_RPL ( 0x00 << 4 )
-#define MGADWG_RSTR ( 0x01 << 4 )
-#define MGADWG_ZI ( 0x03 << 4 )
-#define MGADWG_BLK ( 0x04 << 4 )
-#define MGADWG_I ( 0x07 << 4 )
-
-/* specifies whether bit blits are linear or xy */
-#define MGADWG_LINEAR ( 0x01 << 7 )
-
-/* z drawing mode. use MGADWG_NOZCMP for always */
-
-#define MGADWG_NOZCMP ( 0x00 << 8 )
-#define MGADWG_ZE ( 0x02 << 8 )
-#define MGADWG_ZNE ( 0x03 << 8 )
-#define MGADWG_ZLT ( 0x04 << 8 )
-#define MGADWG_ZLTE ( 0x05 << 8 )
-#define MGADWG_GT ( 0x06 << 8 )
-#define MGADWG_GTE ( 0x07 << 8 )
-
-/* use this to force colour expansion circuitry to do its stuff */
-
-#define MGADWG_SOLID ( 0x01 << 11 )
-
-/* ar register at zero */
-
-#define MGADWG_ARZERO ( 0x01 << 12 )
-
-#define MGADWG_SGNZERO ( 0x01 << 13 )
-
-#define MGADWG_SHIFTZERO ( 0x01 << 14 )
-
-/* See table on 4-43 for bop ALU operations */
-
-/* See table on 4-44 for translucidity masks */
-
-#define MGADWG_BMONOLEF ( 0x00 << 25 )
-#define MGADWG_BMONOWF ( 0x04 << 25 )
-#define MGADWG_BPLAN ( 0x01 << 25 )
-
-/* note that if bfcol is specified and you're doing a bitblt, it causes
- a fbitblt to be performed, so check that you obey the fbitblt rules */
-
-#define MGADWG_BFCOL ( 0x02 << 25 )
-#define MGADWG_BUYUV ( 0x0e << 25 )
-#define MGADWG_BU32BGR ( 0x03 << 25 )
-#define MGADWG_BU32RGB ( 0x07 << 25 )
-#define MGADWG_BU24BGR ( 0x0b << 25 )
-#define MGADWG_BU24RGB ( 0x0f << 25 )
-
-#define MGADWG_PATTERN ( 0x01 << 29 )
-#define MGADWG_TRANSC ( 0x01 << 30 )
-#define MGAREG_MISC_WRITE 0x3c2
-#define MGAREG_MISC_READ 0x3cc
-#define MGAREG_MISC_IOADSEL (0x1 << 0)
-#define MGAREG_MISC_RAMMAPEN (0x1 << 1)
-#define MGAREG_MISC_CLK_SEL_VGA25 (0x0 << 2)
-#define MGAREG_MISC_CLK_SEL_VGA28 (0x1 << 2)
-#define MGAREG_MISC_CLK_SEL_MGA_PIX (0x2 << 2)
-#define MGAREG_MISC_CLK_SEL_MGA_MSK (0x3 << 2)
-#define MGAREG_MISC_VIDEO_DIS (0x1 << 4)
-#define MGAREG_MISC_HIGH_PG_SEL (0x1 << 5)
-
-/* MMIO VGA registers */
-#define MGAREG_SEQ_INDEX 0x1fc4
-#define MGAREG_SEQ_DATA 0x1fc5
-#define MGAREG_CRTC_INDEX 0x1fd4
-#define MGAREG_CRTC_DATA 0x1fd5
-#define MGAREG_CRTCEXT_INDEX 0x1fde
-#define MGAREG_CRTCEXT_DATA 0x1fdf
-
-
-
-/* MGA bits for registers PCI_OPTION_REG */
-#define MGA1064_OPT_SYS_CLK_PCI ( 0x00 << 0 )
-#define MGA1064_OPT_SYS_CLK_PLL ( 0x01 << 0 )
-#define MGA1064_OPT_SYS_CLK_EXT ( 0x02 << 0 )
-#define MGA1064_OPT_SYS_CLK_MSK ( 0x03 << 0 )
-
-#define MGA1064_OPT_SYS_CLK_DIS ( 0x01 << 2 )
-#define MGA1064_OPT_G_CLK_DIV_1 ( 0x01 << 3 )
-#define MGA1064_OPT_M_CLK_DIV_1 ( 0x01 << 4 )
-
-#define MGA1064_OPT_SYS_PLL_PDN ( 0x01 << 5 )
-#define MGA1064_OPT_VGA_ION ( 0x01 << 8 )
-
-/* MGA registers in PCI config space */
-#define PCI_MGA_INDEX 0x44
-#define PCI_MGA_DATA 0x48
-#define PCI_MGA_OPTION2 0x50
-#define PCI_MGA_OPTION3 0x54
-
-#define RAMDAC_OFFSET 0x3c00
-
-/* TVP3026 direct registers */
-
-#define TVP3026_INDEX 0x00
-#define TVP3026_WADR_PAL 0x00
-#define TVP3026_COL_PAL 0x01
-#define TVP3026_PIX_RD_MSK 0x02
-#define TVP3026_RADR_PAL 0x03
-#define TVP3026_CUR_COL_ADDR 0x04
-#define TVP3026_CUR_COL_DATA 0x05
-#define TVP3026_DATA 0x0a
-#define TVP3026_CUR_RAM 0x0b
-#define TVP3026_CUR_XLOW 0x0c
-#define TVP3026_CUR_XHI 0x0d
-#define TVP3026_CUR_YLOW 0x0e
-#define TVP3026_CUR_YHI 0x0f
-
-/* TVP3026 indirect registers */
-
-#define TVP3026_SILICON_REV 0x01
-#define TVP3026_CURSOR_CTL 0x06
-#define TVP3026_LATCH_CTL 0x0f
-#define TVP3026_TRUE_COLOR_CTL 0x18
-#define TVP3026_MUX_CTL 0x19
-#define TVP3026_CLK_SEL 0x1a
-#define TVP3026_PAL_PAGE 0x1c
-#define TVP3026_GEN_CTL 0x1d
-#define TVP3026_MISC_CTL 0x1e
-#define TVP3026_GEN_IO_CTL 0x2a
-#define TVP3026_GEN_IO_DATA 0x2b
-#define TVP3026_PLL_ADDR 0x2c
-#define TVP3026_PIX_CLK_DATA 0x2d
-#define TVP3026_MEM_CLK_DATA 0x2e
-#define TVP3026_LOAD_CLK_DATA 0x2f
-#define TVP3026_KEY_RED_LOW 0x32
-#define TVP3026_KEY_RED_HI 0x33
-#define TVP3026_KEY_GREEN_LOW 0x34
-#define TVP3026_KEY_GREEN_HI 0x35
-#define TVP3026_KEY_BLUE_LOW 0x36
-#define TVP3026_KEY_BLUE_HI 0x37
-#define TVP3026_KEY_CTL 0x38
-#define TVP3026_MCLK_CTL 0x39
-#define TVP3026_SENSE_TEST 0x3a
-#define TVP3026_TEST_DATA 0x3b
-#define TVP3026_CRC_LSB 0x3c
-#define TVP3026_CRC_MSB 0x3d
-#define TVP3026_CRC_CTL 0x3e
-#define TVP3026_ID 0x3f
-#define TVP3026_RESET 0xff
-
-
-/* MGA1064 DAC Register file */
-/* MGA1064 direct registers */
-
-#define MGA1064_INDEX 0x00
-#define MGA1064_WADR_PAL 0x00
-#define MGA1064_COL_PAL 0x01
-#define MGA1064_PIX_RD_MSK 0x02
-#define MGA1064_RADR_PAL 0x03
-#define MGA1064_DATA 0x0a
-
-#define MGA1064_CUR_XLOW 0x0c
-#define MGA1064_CUR_XHI 0x0d
-#define MGA1064_CUR_YLOW 0x0e
-#define MGA1064_CUR_YHI 0x0f
-
-/* MGA1064 indirect registers */
-#define MGA1064_DVI_PIPE_CTL 0x03
-#define MGA1064_CURSOR_BASE_ADR_LOW 0x04
-#define MGA1064_CURSOR_BASE_ADR_HI 0x05
-#define MGA1064_CURSOR_CTL 0x06
-#define MGA1064_CURSOR_COL0_RED 0x08
-#define MGA1064_CURSOR_COL0_GREEN 0x09
-#define MGA1064_CURSOR_COL0_BLUE 0x0a
-
-#define MGA1064_CURSOR_COL1_RED 0x0c
-#define MGA1064_CURSOR_COL1_GREEN 0x0d
-#define MGA1064_CURSOR_COL1_BLUE 0x0e
-
-#define MGA1064_CURSOR_COL2_RED 0x010
-#define MGA1064_CURSOR_COL2_GREEN 0x011
-#define MGA1064_CURSOR_COL2_BLUE 0x012
-
-#define MGA1064_VREF_CTL 0x018
-
-#define MGA1064_MUL_CTL 0x19
-#define MGA1064_MUL_CTL_8bits 0x0
-#define MGA1064_MUL_CTL_15bits 0x01
-#define MGA1064_MUL_CTL_16bits 0x02
-#define MGA1064_MUL_CTL_24bits 0x03
-#define MGA1064_MUL_CTL_32bits 0x04
-#define MGA1064_MUL_CTL_2G8V16bits 0x05
-#define MGA1064_MUL_CTL_G16V16bits 0x06
-#define MGA1064_MUL_CTL_32_24bits 0x07
-
-#define MGAGDAC_XVREFCTRL 0x18
-#define MGA1064_PIX_CLK_CTL 0x1a
-#define MGA1064_PIX_CLK_CTL_CLK_DIS ( 0x01 << 2 )
-#define MGA1064_PIX_CLK_CTL_CLK_POW_DOWN ( 0x01 << 3 )
-#define MGA1064_PIX_CLK_CTL_SEL_PCI ( 0x00 << 0 )
-#define MGA1064_PIX_CLK_CTL_SEL_PLL ( 0x01 << 0 )
-#define MGA1064_PIX_CLK_CTL_SEL_EXT ( 0x02 << 0 )
-#define MGA1064_PIX_CLK_CTL_SEL_MSK ( 0x03 << 0 )
-
-#define MGA1064_GEN_CTL 0x1d
-#define MGA1064_MISC_CTL 0x1e
-#define MGA1064_MISC_CTL_DAC_POW_DN ( 0x01 << 0 )
-#define MGA1064_MISC_CTL_VGA ( 0x01 << 1 )
-#define MGA1064_MISC_CTL_DIS_CON ( 0x03 << 1 )
-#define MGA1064_MISC_CTL_MAFC ( 0x02 << 1 )
-#define MGA1064_MISC_CTL_VGA8 ( 0x01 << 3 )
-#define MGA1064_MISC_CTL_DAC_RAM_CS ( 0x01 << 4 )
-
-#define MGA1064_GEN_IO_CTL 0x2a
-#define MGA1064_GEN_IO_DATA 0x2b
-#define MGA1064_SYS_PLL_M 0x2c
-#define MGA1064_SYS_PLL_N 0x2d
-#define MGA1064_SYS_PLL_P 0x2e
-#define MGA1064_SYS_PLL_STAT 0x2f
-#define MGA1064_ZOOM_CTL 0x38
-#define MGA1064_SENSE_TST 0x3a
-
-#define MGA1064_CRC_LSB 0x3c
-#define MGA1064_CRC_MSB 0x3d
-#define MGA1064_CRC_CTL 0x3e
-#define MGA1064_COL_KEY_MSK_LSB 0x40
-#define MGA1064_COL_KEY_MSK_MSB 0x41
-#define MGA1064_COL_KEY_LSB 0x42
-#define MGA1064_COL_KEY_MSB 0x43
-#define MGA1064_PIX_PLLA_M 0x44
-#define MGA1064_PIX_PLLA_N 0x45
-#define MGA1064_PIX_PLLA_P 0x46
-#define MGA1064_PIX_PLLB_M 0x48
-#define MGA1064_PIX_PLLB_N 0x49
-#define MGA1064_PIX_PLLB_P 0x4a
-#define MGA1064_PIX_PLLC_M 0x4c
-#define MGA1064_PIX_PLLC_N 0x4d
-#define MGA1064_PIX_PLLC_P 0x4e
-
-#define MGA1064_PIX_PLL_STAT 0x4f
-
-/*Added for G450 dual head*/
-/* Supported PLL*/
-#define __PIXEL_PLL 1
-#define __SYSTEM_PLL 2
-#define __VIDEO_PLL 3
-
-#define MGA1064_VID_PLL_P 0x8D
-#define MGA1064_VID_PLL_M 0x8E
-#define MGA1064_VID_PLL_N 0x8F
-
-#define MGA1064_DISP_CTL 0x8a
-#define MGA1064_SYNC_CTL 0x8b
-#define MGA1064_PWR_CTL 0xa0
-#define MGA1064_PAN_CTL 0xa2
-
-/* Using crtc2 */
-#define MGAREG2_C2CTL 0x10
-#define MGAREG2_C2HPARAM 0x14
-#define MGAREG2_C2HSYNC 0x18
-#define MGAREG2_C2VPARAM 0x1c
-#define MGAREG2_C2VSYNC 0x20
-#define MGAREG2_C2STARTADD0 0x28
-
-#define MGAREG2_C2OFFSET 0x40
-#define MGAREG2_C2DATACTL 0x4c
-
-#define MGAREG_C2CTL 0x3c10
-#define MGAREG_C2HPARAM 0x3c14
-#define MGAREG_C2HSYNC 0x3c18
-#define MGAREG_C2VPARAM 0x3c1c
-#define MGAREG_C2VSYNC 0x3c20
-#define MGAREG_C2STARTADD0 0x3c28
-
-#define MGAREG_C2OFFSET 0x3c40
-#define MGAREG_C2DATACTL 0x3c4c
-
-#define MGA1064_DISP_CTL 0x8a
-#define MGA1064_SYNC_CTL 0x8b
-#define MGA1064_PWR_CTL 0xa0
-
-/* video register */
-
-#define MGAREG_BESA1C3ORG 0x3d60
-#define MGAREG_BESA1CORG 0x3d10
-#define MGAREG_BESA1ORG 0x3d00
-#define MGAREG_BESCTL 0x3d20
-#define MGAREG_BESGLOBCTL 0x3dc0
-#define MGAREG_BESHCOORD 0x3d28
-#define MGAREG_BESHISCAL 0x3d30
-#define MGAREG_BESHSRCEND 0x3d3c
-#define MGAREG_BESHSRCLST 0x3d50
-#define MGAREG_BESHSRCST 0x3d38
-#define MGAREG_BESLUMACTL 0x3d40
-#define MGAREG_BESPITCH 0x3d24
-#define MGAREG_BESV1SRCLST 0x3d54
-#define MGAREG_BESV1WGHT 0x3d48
-#define MGAREG_BESVCOORD 0x3d2c
-#define MGAREG_BESVISCAL 0x3d34
-
-/* texture engine registers */
-
-#define MGAREG_TMR0 0x2c00
-#define MGAREG_TMR1 0x2c04
-#define MGAREG_TMR2 0x2c08
-#define MGAREG_TMR3 0x2c0c
-#define MGAREG_TMR4 0x2c10
-#define MGAREG_TMR5 0x2c14
-#define MGAREG_TMR6 0x2c18
-#define MGAREG_TMR7 0x2c1c
-#define MGAREG_TMR8 0x2c20
-#define MGAREG_TEXORG 0x2c24
-#define MGAREG_TEXWIDTH 0x2c28
-#define MGAREG_TEXHEIGHT 0x2c2c
-#define MGAREG_TEXCTL 0x2c30
-#define MGAREG_TEXCTL2 0x2c3c
-#define MGAREG_TEXTRANS 0x2c34
-#define MGAREG_TEXTRANSHIGH 0x2c38
-#define MGAREG_TEXFILTER 0x2c58
-#define MGAREG_ALPHASTART 0x2c70
-#define MGAREG_ALPHAXINC 0x2c74
-#define MGAREG_ALPHAYINC 0x2c78
-#define MGAREG_ALPHACTRL 0x2c7c
-#define MGAREG_DWGSYNC 0x2c4c
-
-#define MGAREG_AGP_PLL 0x1e4c
-#define MGA_AGP2XPLL_ENABLE 0x1
-#define MGA_AGP2XPLL_DISABLE 0x0
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/Makefile
deleted file mode 100644
index 796dfbc51..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# src/mesa/drivers/dri/r128/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r128_dri.so
-
-MINIGLX_SOURCES = server/r128_dri.c
-
-DRIVER_SOURCES = \
- r128_context.c \
- r128_lock.c \
- r128_state.c \
- r128_texstate.c \
- r128_dd.c \
- r128_screen.c \
- r128_tex.c \
- r128_tris.c \
- r128_ioctl.c \
- r128_span.c \
- r128_texmem.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.c
deleted file mode 100644
index f071bbecb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.8 2002/10/30 12:51:38 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "r128_context.h"
-#include "r128_ioctl.h"
-#include "r128_dd.h"
-#include "r128_state.h"
-#include "r128_span.h"
-#include "r128_tex.h"
-#include "r128_tris.h"
-
-#include "vblank.h"
-#include "utils.h"
-#include "texmem.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
-
-#ifndef R128_DEBUG
-int R128_DEBUG = 0;
-#endif
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_EXT_blend_minmax
-#include "extension_helper.h"
-
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_debug_control debug_control[] =
-{
- { "ioctl", DEBUG_VERBOSE_IOCTL },
- { "verb", DEBUG_VERBOSE_MSG },
- { "dri", DEBUG_VERBOSE_DRI },
- { "2d", DEBUG_VERBOSE_2D },
- { "sync", DEBUG_ALWAYS_SYNC },
- { "api", DEBUG_VERBOSE_API },
- { "fall", DEBUG_VERBOSE_FALL },
- { NULL, 0 }
-};
-
-/* Create the device specific context.
- */
-GLboolean r128CreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- struct dd_function_table functions;
- r128ContextPtr rmesa;
- r128ScreenPtr r128scrn;
- int i;
-
- /* Allocate the r128 context */
- rmesa = (r128ContextPtr) CALLOC( sizeof(*rmesa) );
- if ( !rmesa )
- return GL_FALSE;
-
- /* Init default driver functions then plug in our Radeon-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions( &functions );
- r128InitDriverFuncs( &functions );
- r128InitIoctlFuncs( &functions );
- r128InitTextureFuncs( &functions );
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- rmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *) rmesa);
- if (!rmesa->glCtx) {
- FREE(rmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = rmesa;
- ctx = rmesa->glCtx;
-
- rmesa->driContext = driContextPriv;
- rmesa->driScreen = sPriv;
- rmesa->driDrawable = NULL;
- rmesa->hHWContext = driContextPriv->hHWContext;
- rmesa->driHwLock = &sPriv->pSAREA->lock;
- rmesa->driFd = sPriv->fd;
-
- r128scrn = rmesa->r128Screen = (r128ScreenPtr)(sPriv->private);
-
- /* Parse configuration files */
- driParseConfigFiles (&rmesa->optionCache, &r128scrn->optionCache,
- r128scrn->driScreen->myNum, "r128");
-
- rmesa->sarea = (drm_r128_sarea_t *)((char *)sPriv->pSAREA +
- r128scrn->sarea_priv_offset);
-
- rmesa->CurrentTexObj[0] = NULL;
- rmesa->CurrentTexObj[1] = NULL;
-
- (void) memset( rmesa->texture_heaps, 0, sizeof( rmesa->texture_heaps ) );
- make_empty_list( & rmesa->swapped );
-
- rmesa->nr_heaps = r128scrn->numTexHeaps;
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- rmesa->texture_heaps[i] = driCreateTextureHeap( i, rmesa,
- r128scrn->texSize[i],
- 12,
- R128_NR_TEX_REGIONS,
- (drmTextureRegionPtr)rmesa->sarea->tex_list[i],
- &rmesa->sarea->tex_age[i],
- &rmesa->swapped,
- sizeof( r128TexObj ),
- (destroy_texture_object_t *) r128DestroyTexObj );
-
- driSetTextureSwapCounterLocation( rmesa->texture_heaps[i],
- & rmesa->c_textureSwaps );
- }
- rmesa->texture_depth = driQueryOptioni (&rmesa->optionCache,
- "texture_depth");
- if (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
- rmesa->texture_depth = ( r128scrn->cpp == 4 ) ?
- DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
-
- rmesa->RenderIndex = -1; /* Impossible value */
- rmesa->vert_buf = NULL;
- rmesa->num_verts = 0;
- rmesa->tnl_state = ~0;
-
- /* Set the maximum texture size small enough that we can guarentee that
- * all texture units can bind a maximal texture and have them both in
- * texturable memory at once.
- */
-
- ctx->Const.MaxTextureUnits = 2;
- ctx->Const.MaxTextureImageUnits = 2;
- ctx->Const.MaxTextureCoordUnits = 2;
-
- driCalculateMaxTextureLevels( rmesa->texture_heaps,
- rmesa->nr_heaps,
- & ctx->Const,
- 4,
- 10, /* max 2D texture size is 1024x1024 */
- 0, /* 3D textures unsupported. */
- 0, /* cube textures unsupported. */
- 0, /* texture rectangles unsupported. */
- 11,
- GL_FALSE );
-
- /* No wide points.
- */
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
-
- /* No wide lines.
- */
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 1.0;
- ctx->Const.MaxLineWidthAA = 1.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
-#if ENABLE_PERF_BOXES
- rmesa->boxes = driQueryOptionb(&rmesa->optionCache, "performance_boxes");
-#endif
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
-/* _tnl_destroy_pipeline( ctx ); */
-/* _tnl_install_pipeline( ctx, r128_pipeline ); */
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
- if (sPriv->drmMinor >= 4)
- _mesa_enable_extension( ctx, "GL_MESA_ycbcr_texture" );
-
- r128InitTriFuncs( ctx );
- r128DDInitStateFuncs( ctx );
- r128DDInitSpanFuncs( ctx );
- r128DDInitState( rmesa );
-
- rmesa->vblank_flags = (rmesa->r128Screen->irq != 0)
- ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
- driContextPriv->driverPrivate = (void *)rmesa;
-
-#if DO_DEBUG
- R128_DEBUG = driParseDebugString( getenv( "R128_DEBUG" ),
- debug_control );
-#endif
-
- if (driQueryOptionb(&rmesa->optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
- FALLBACK(rmesa, R128_FALLBACK_DISABLE, 1);
- }
-
- return GL_TRUE;
-}
-
-/* Destroy the device specific context.
- */
-void r128DestroyContext( __DRIcontextPrivate *driContextPriv )
-{
- r128ContextPtr rmesa = (r128ContextPtr) driContextPriv->driverPrivate;
-
- assert(rmesa); /* should never be null */
- if ( rmesa ) {
- GLboolean release_texture_heaps;
-
-
- release_texture_heaps = (rmesa->glCtx->Shared->RefCount == 1);
-
- _swsetup_DestroyContext( rmesa->glCtx );
- _tnl_DestroyContext( rmesa->glCtx );
- _ac_DestroyContext( rmesa->glCtx );
- _swrast_DestroyContext( rmesa->glCtx );
-
- /* free the Mesa context */
- rmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(rmesa->glCtx);
-
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- int i;
-
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- driDestroyTextureHeap( rmesa->texture_heaps[ i ] );
- rmesa->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & rmesa->swapped ) );
- }
-
- /* free the option cache */
- driDestroyOptionCache (&rmesa->optionCache);
-
- FREE( rmesa );
- }
-
-#if 0
- /* Use this to force shared object profiling. */
- glx_fini_prof();
-#endif
-}
-
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-GLboolean
-r128MakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( driContextPriv ) {
- GET_CURRENT_CONTEXT(ctx);
- r128ContextPtr oldR128Ctx = ctx ? R128_CONTEXT(ctx) : NULL;
- r128ContextPtr newR128Ctx = (r128ContextPtr) driContextPriv->driverPrivate;
-
- if ( newR128Ctx != oldR128Ctx ) {
- newR128Ctx->new_state |= R128_NEW_CONTEXT;
- newR128Ctx->dirty = R128_UPLOAD_ALL;
- }
-
- driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags );
- newR128Ctx->driDrawable = driDrawPriv;
-
- _mesa_make_current( newR128Ctx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- newR128Ctx->new_state |= R128_NEW_WINDOW | R128_NEW_CLIP;
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-
-/* Force the context `c' to be unbound from its buffer.
- */
-GLboolean
-r128UnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.h
deleted file mode 100644
index e91257f7f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_context.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __R128_CONTEXT_H__
-#define __R128_CONTEXT_H__
-
-#include "dri_util.h"
-#include "drm.h"
-#include "r128_drm.h"
-
-#include "mtypes.h"
-#include "tnl/t_vertex.h"
-
-#include "r128_reg.h"
-
-#include "texmem.h"
-
-struct r128_context;
-typedef struct r128_context r128ContextRec;
-typedef struct r128_context *r128ContextPtr;
-
-#include "r128_lock.h"
-#include "r128_texobj.h"
-#include "r128_screen.h"
-
-/* Flags for what context state needs to be updated:
- */
-#define R128_NEW_ALPHA 0x0001
-#define R128_NEW_DEPTH 0x0002
-#define R128_NEW_FOG 0x0004
-#define R128_NEW_CLIP 0x0008
-#define R128_NEW_CULL 0x0010
-#define R128_NEW_MASKS 0x0020
-#define R128_NEW_RENDER_NOT 0x0040
-#define R128_NEW_WINDOW 0x0080
-#define R128_NEW_CONTEXT 0x0100
-#define R128_NEW_ALL 0x01ff
-
-/* Flags for software fallback cases:
- */
-#define R128_FALLBACK_TEXTURE 0x0001
-#define R128_FALLBACK_DRAW_BUFFER 0x0002
-#define R128_FALLBACK_READ_BUFFER 0x0004
-#define R128_FALLBACK_STENCIL 0x0008
-#define R128_FALLBACK_RENDER_MODE 0x0010
-#define R128_FALLBACK_LOGICOP 0x0020
-#define R128_FALLBACK_SEP_SPECULAR 0x0040
-#define R128_FALLBACK_BLEND_EQ 0x0080
-#define R128_FALLBACK_BLEND_FUNC 0x0100
-#define R128_FALLBACK_PROJTEX 0x0200
-#define R128_FALLBACK_DISABLE 0x0400
-
-
-/* Use the templated vertex format:
- */
-#define TAG(x) r128##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-/* Reasons why the GL_BLEND fallback mightn't work:
- */
-#define R128_BLEND_ENV_COLOR 0x1
-#define R128_BLEND_MULTITEX 0x2
-
-/* Subpixel offsets for window coordinates (triangles):
- */
-#define SUBPIXEL_X (0.0F)
-#define SUBPIXEL_Y (0.125F)
-
-
-typedef void (*r128_tri_func)( r128ContextPtr,
- r128Vertex *,
- r128Vertex *,
- r128Vertex * );
-
-typedef void (*r128_line_func)( r128ContextPtr,
- r128Vertex *,
- r128Vertex * );
-
-typedef void (*r128_point_func)( r128ContextPtr,
- r128Vertex * );
-
-
-struct r128_context {
- GLcontext *glCtx; /* Mesa context */
-
- /* Driver and hardware state management
- */
- GLuint new_state;
- GLuint dirty; /* Hardware state to be updated */
- drm_r128_context_regs_t setup;
-
- /* Vertex state */
- GLuint vertex_size;
- GLuint vertex_format;
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
- char *verts; /* points to tnl->clipspace.vertex_buf */
- GLuint num_verts;
- int coloroffset, specoffset;
- int tnl_state; /* tnl->render_inputs for this _tnl_install_attrs */
-
- GLuint NewGLState;
- GLuint Fallback;
- GLuint RenderIndex;
- GLfloat hw_viewport[16];
- GLfloat depth_scale;
-
- u_int32_t ClearColor; /* Color used to clear color buffer */
- u_int32_t ClearDepth; /* Value used to clear depth buffer */
- u_int32_t ClearStencil; /* Value used to clear stencil */
-
- /* Map GL texture units onto hardware
- */
- GLint multitex;
- GLint tmu_source[2];
- GLuint tex_combine[2];
- GLuint blend_flags;
- GLuint env_color;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap * texture_heaps[ R128_NR_TEX_HEAPS ];
- driTextureObject swapped;
-
- r128TexObjPtr CurrentTexObj[2];
-
- int texture_depth;
-
- /* Fallback rasterization functions
- */
- r128_point_func draw_point;
- r128_line_func draw_line;
- r128_tri_func draw_tri;
-
- /* Vertex buffers
- */
- drmBufPtr vert_buf;
-
- GLuint hw_primitive;
- GLenum render_primitive;
-
- /* Page flipping
- */
- GLuint doPageFlip;
-
- /* Drawable, cliprect and scissor information
- */
- GLint drawOffset, drawPitch;
- GLint readOffset, readPitch;
-
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
-
- GLuint scissor;
- drm_clip_rect_t ScissorRect; /* Current software scissor */
-
- /* Mirrors of some DRI state
- */
- __DRIcontextPrivate *driContext; /* DRI context */
- __DRIscreenPrivate *driScreen; /* DRI screen */
- __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */
-
- unsigned int lastStamp; /* mirror driDrawable->lastStamp */
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
-
- r128ScreenPtr r128Screen; /* Screen private DRI data */
- drm_r128_sarea_t *sarea; /* Private SAREA data */
-
- /* Performance counters
- */
- GLuint boxes; /* Draw performance boxes */
- GLuint hardwareWentIdle;
- GLuint c_clears;
- GLuint c_drawWaits;
- GLuint c_textureSwaps;
- GLuint c_textureBytes;
- GLuint c_vertexBuffers;
-
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-};
-
-#define R128_CONTEXT(ctx) ((r128ContextPtr)(ctx->DriverCtx))
-
-#define R128_IS_PLAIN( rmesa ) \
- (rmesa->r128Screen->chipset == R128_CARD_TYPE_R128)
-#define R128_IS_PRO( rmesa ) \
- (rmesa->r128Screen->chipset == R128_CARD_TYPE_R128_PRO)
-#define R128_IS_MOBILITY( rmesa ) \
- (rmesa->r128Screen->chipset == R128_CARD_TYPE_R128_MOBILITY)
-
-
-extern GLboolean r128CreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate );
-
-extern void r128DestroyContext( __DRIcontextPrivate * );
-
-extern GLboolean r128MakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv );
-
-extern GLboolean r128UnbindContext( __DRIcontextPrivate *driContextPriv );
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-#define ENABLE_PERF_BOXES 0
-
-#if DO_DEBUG
-extern int R128_DEBUG;
-#else
-#define R128_DEBUG 0
-#endif
-
-#define DEBUG_ALWAYS_SYNC 0x01
-#define DEBUG_VERBOSE_API 0x02
-#define DEBUG_VERBOSE_MSG 0x04
-#define DEBUG_VERBOSE_LRU 0x08
-#define DEBUG_VERBOSE_DRI 0x10
-#define DEBUG_VERBOSE_IOCTL 0x20
-#define DEBUG_VERBOSE_2D 0x40
-#define DEBUG_VERBOSE_FALL 0x80
-
-#endif /* __R128_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.c
deleted file mode 100644
index 59480b25d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.15 2002/10/30 12:51:38 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#include "r128_context.h"
-#include "r128_ioctl.h"
-#include "r128_state.h"
-#include "r128_dd.h"
-#include "swrast/swrast.h"
-
-#include "context.h"
-#include "framebuffer.h"
-
-#include "utils.h"
-
-#define DRIVER_DATE "20041026"
-
-
-/* Return the width and height of the current color buffer.
- */
-static void r128GetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- LOCK_HARDWARE( rmesa );
- *width = rmesa->driDrawable->w;
- *height = rmesa->driDrawable->h;
- UNLOCK_HARDWARE( rmesa );
-}
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *r128GetString( GLcontext *ctx, GLenum name )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- static char buffer[128];
- unsigned offset;
- const char * card_name = "Rage 128";
- GLuint agp_mode = rmesa->r128Screen->IsPCI ? 0 :
- rmesa->r128Screen->AGPMode;
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *)"VA Linux Systems, Inc.";
-
- case GL_RENDERER:
- /* Select the spefic chipset.
- */
- if ( R128_IS_PRO( rmesa ) ) {
- card_name = "Rage 128 Pro";
- }
- else if ( R128_IS_MOBILITY( rmesa ) ) {
- card_name = "Rage 128 Mobility";
- }
-
- offset = driGetRendererString( buffer, card_name, DRIVER_DATE,
- agp_mode );
-
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-/* Send all commands to the hardware. If vertex buffers or indirect
- * buffers are in use, then we need to make sure they are sent to the
- * hardware. All commands that are normally sent to the ring are
- * already considered `flushed'.
- */
-static void r128Flush( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
-
-#if ENABLE_PERF_BOXES
- if ( rmesa->boxes ) {
- LOCK_HARDWARE( rmesa );
- r128PerformanceBoxesLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
- }
-
- /* Log the performance counters if necessary */
- r128PerformanceCounters( rmesa );
-#endif
-}
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
- */
-static void r128Finish( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- rmesa->c_drawWaits++;
-#endif
-
- r128Flush( ctx );
- r128WaitForIdle( rmesa );
-}
-
-
-/* Initialize the driver's misc functions.
- */
-void r128InitDriverFuncs( struct dd_function_table *functions )
-{
- functions->GetBufferSize = r128GetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = r128GetString;
- functions->Finish = r128Finish;
- functions->Flush = r128Flush;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.h
deleted file mode 100644
index 7a0abb73f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_dd.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#ifndef __R128_DD_H__
-#define __R128_DD_H__
-
-extern void r128InitDriverFuncs( struct dd_function_table *functions );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.c
deleted file mode 100644
index fc017329c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.c
+++ /dev/null
@@ -1,813 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.10 2002/12/16 16:18:53 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-#include <errno.h>
-
-#define STANDALONE_MMIO
-#include "r128_context.h"
-#include "r128_state.h"
-#include "r128_ioctl.h"
-#include "imports.h"
-#include "macros.h"
-
-#include "swrast/swrast.h"
-
-#include "vblank.h"
-#include "mmio.h"
-
-#define R128_TIMEOUT 2048
-#define R128_IDLE_RETRY 32
-
-
-/* =============================================================
- * Hardware vertex buffer handling
- */
-
-/* Get a new VB from the pool of vertex buffers in AGP space.
- */
-drmBufPtr r128GetBufferLocked( r128ContextPtr rmesa )
-{
- int fd = rmesa->r128Screen->driScreen->fd;
- int index = 0;
- int size = 0;
- drmDMAReq dma;
- drmBufPtr buf = NULL;
- int to = 0;
- int ret;
-
- dma.context = rmesa->hHWContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = R128_BUFFER_SIZE;
- dma.request_list = &index;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
- while ( !buf && ( to++ < R128_TIMEOUT ) ) {
- ret = drmDMA( fd, &dma );
-
- if ( ret == 0 ) {
- buf = &rmesa->r128Screen->buffers->list[index];
- buf->used = 0;
-#if ENABLE_PERF_BOXES
- /* Bump the performance counter */
- rmesa->c_vertexBuffers++;
-#endif
- return buf;
- }
- }
-
- if ( !buf ) {
- drmCommandNone( fd, DRM_R128_CCE_RESET);
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "Error: Could not get new VB... exiting\n" );
- exit( -1 );
- }
-
- return buf;
-}
-
-void r128FlushVerticesLocked( r128ContextPtr rmesa )
-{
- drm_clip_rect_t *pbox = rmesa->pClipRects;
- int nbox = rmesa->numClipRects;
- drmBufPtr buffer = rmesa->vert_buf;
- int count = rmesa->num_verts;
- int prim = rmesa->hw_primitive;
- int fd = rmesa->driScreen->fd;
- drm_r128_vertex_t vertex;
- int i;
-
- rmesa->num_verts = 0;
- rmesa->vert_buf = NULL;
-
- if ( !buffer )
- return;
-
- if ( rmesa->dirty & ~R128_UPLOAD_CLIPRECTS )
- r128EmitHwStateLocked( rmesa );
-
- if ( !nbox )
- count = 0;
-
- if ( nbox >= R128_NR_SAREA_CLIPRECTS )
- rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
-
- if ( !count || !(rmesa->dirty & R128_UPLOAD_CLIPRECTS) )
- {
- if ( nbox < 3 ) {
- rmesa->sarea->nbox = 0;
- } else {
- rmesa->sarea->nbox = nbox;
- }
-
- vertex.prim = prim;
- vertex.idx = buffer->idx;
- vertex.count = count;
- vertex.discard = 1;
- drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(vertex) );
- }
- else
- {
- for ( i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + R128_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- int discard = 0;
-
- rmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++ ) {
- *b++ = pbox[i];
- }
-
- /* Finished with the buffer?
- */
- if ( nr == nbox ) {
- discard = 1;
- }
-
- rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
-
- vertex.prim = prim;
- vertex.idx = buffer->idx;
- vertex.count = count;
- vertex.discard = discard;
- drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(vertex) );
- }
- }
-
- rmesa->dirty &= ~R128_UPLOAD_CLIPRECTS;
-}
-
-
-
-
-
-/* ================================================================
- * Texture uploads
- */
-
-void r128FireBlitLocked( r128ContextPtr rmesa, drmBufPtr buffer,
- GLint offset, GLint pitch, GLint format,
- GLint x, GLint y, GLint width, GLint height )
-{
- drm_r128_blit_t blit;
- GLint ret;
-
- blit.idx = buffer->idx;
- blit.offset = offset;
- blit.pitch = pitch;
- blit.format = format;
- blit.x = x;
- blit.y = y;
- blit.width = width;
- blit.height = height;
-
- ret = drmCommandWrite( rmesa->driFd, DRM_R128_BLIT,
- &blit, sizeof(blit) );
-
- if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "DRM_R128_BLIT: return = %d\n", ret );
- exit( 1 );
- }
-}
-
-
-/* ================================================================
- * SwapBuffers with client-side throttling
- */
-
-static void delay( void ) {
-/* Prevent an optimizing compiler from removing a spin loop */
-}
-
-#define R128_MAX_OUTSTANDING 2
-
-
-/* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- * GH: We probably don't want a timeout here, as we can wait as
- * long as we want for a frame to complete. If it never does, then
- * the card has locked.
- */
-static int r128WaitForFrameCompletion( r128ContextPtr rmesa )
-{
- unsigned char *R128MMIO = rmesa->r128Screen->mmio.map;
- int i;
- int wait = 0;
-
- while ( 1 ) {
- u_int32_t frame = read_MMIO_LE32( R128MMIO, R128_LAST_FRAME_REG );
-
- if ( rmesa->sarea->last_frame - frame <= R128_MAX_OUTSTANDING ) {
- break;
- }
-
- /* Spin in place a bit so we aren't hammering the register */
- wait++;
- for ( i = 0 ; i < 1024 ; i++ ) {
- delay();
- }
- }
-
- return wait;
-}
-
-/* Copy the back color buffer to the front color buffer.
- */
-void r128CopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- r128ContextPtr rmesa;
- GLint nbox, i, ret;
- GLboolean missed_target;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- rmesa = (r128ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "\n********************************\n" );
- fprintf( stderr, "\n%s( %p )\n\n",
- __FUNCTION__, (void *)rmesa->glCtx );
- fflush( stderr );
- }
-
- FLUSH_BATCH( rmesa );
-
- LOCK_HARDWARE( rmesa );
-
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- */
- if ( !r128WaitForFrameCompletion( rmesa ) ) {
- rmesa->hardwareWentIdle = 1;
- } else {
- rmesa->hardwareWentIdle = 0;
- }
-
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, &rmesa->vbl_seq, rmesa->vblank_flags, &missed_target );
- LOCK_HARDWARE( rmesa );
-
- nbox = dPriv->numClipRects; /* must be in locked region */
-
- for ( i = 0 ; i < nbox ; ) {
- GLint nr = MIN2( i + R128_NR_SAREA_CLIPRECTS , nbox );
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- GLint n = 0;
-
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- rmesa->sarea->nbox = n;
-
- ret = drmCommandNone( rmesa->driFd, DRM_R128_SWAP );
-
- if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "DRM_R128_SWAP: return = %d\n", ret );
- exit( 1 );
- }
- }
-
- if ( R128_DEBUG & DEBUG_ALWAYS_SYNC ) {
- i = 0;
- do {
- ret = drmCommandNone(rmesa->driFd, DRM_R128_CCE_IDLE);
- } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
- }
-
- UNLOCK_HARDWARE( rmesa );
-
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= (R128_UPLOAD_CONTEXT |
- R128_UPLOAD_MASKS |
- R128_UPLOAD_CLIPRECTS);
-
-#if ENABLE_PERF_BOXES
- /* Log the performance counters if necessary */
- r128PerformanceCounters( rmesa );
-#endif
-}
-
-void r128PageFlip( const __DRIdrawablePrivate *dPriv )
-{
- r128ContextPtr rmesa;
- GLint ret;
- GLboolean missed_target;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- rmesa = (r128ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "\n%s( %p ): page=%d\n\n",
- __FUNCTION__, (void *)rmesa->glCtx, rmesa->sarea->pfCurrentPage );
- }
-
- FLUSH_BATCH( rmesa );
-
- LOCK_HARDWARE( rmesa );
-
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- */
- if ( !r128WaitForFrameCompletion( rmesa ) ) {
- rmesa->hardwareWentIdle = 1;
- } else {
- rmesa->hardwareWentIdle = 0;
- }
-
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, &rmesa->vbl_seq, rmesa->vblank_flags, &missed_target );
- LOCK_HARDWARE( rmesa );
-
- /* The kernel will have been initialized to perform page flipping
- * on a swapbuffers ioctl.
- */
- ret = drmCommandNone( rmesa->driFd, DRM_R128_FLIP );
-
- UNLOCK_HARDWARE( rmesa );
-
- if ( ret ) {
- fprintf( stderr, "DRM_R128_FLIP: return = %d\n", ret );
- exit( 1 );
- }
-
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->drawOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->r128Screen->frontPitch;
- } else {
- rmesa->drawOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->r128Screen->backPitch;
- }
-
- rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
- (rmesa->drawOffset >> 5));
- rmesa->new_state |= R128_NEW_WINDOW;
-
- /* FIXME: Do we need this anymore? */
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= (R128_UPLOAD_CONTEXT |
- R128_UPLOAD_MASKS |
- R128_UPLOAD_CLIPRECTS);
-
-#if ENABLE_PERF_BOXES
- /* Log the performance counters if necessary */
- r128PerformanceCounters( rmesa );
-#endif
-}
-
-
-/* ================================================================
- * Buffer clear
- */
-
-static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->driDrawable;
- drm_r128_clear_t clear;
- GLuint flags = 0;
- GLint i;
- GLint ret;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s:\n", __FUNCTION__ );
- }
-
- FLUSH_BATCH( rmesa );
-
- /* The only state change we care about here is the RGBA colormask
- * We'll just update that state, if needed. If we do more then
- * there's some strange side-effects that the conformance tests find.
- */
- if ( rmesa->new_state & R128_NEW_MASKS) {
- const GLuint save_state = rmesa->new_state;
- rmesa->new_state = R128_NEW_MASKS;
- r128DDUpdateHWState( ctx );
- rmesa->new_state = save_state & ~R128_NEW_MASKS;
- }
-
- if ( mask & BUFFER_BIT_FRONT_LEFT ) {
- flags |= R128_FRONT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ( mask & BUFFER_BIT_BACK_LEFT ) {
- flags |= R128_BACK;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) {
- flags |= R128_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-#if 0
- /* FIXME: Add stencil support */
- if ( mask & BUFFER_BIT_STENCIL ) {
- flags |= DRM_R128_DEPTH_BUFFER;
- mask &= ~BUFFER_BIT_STENCIL;
- }
-#endif
-
- if ( flags ) {
-
- /* Flip top to bottom */
- cx += dPriv->x;
- cy = dPriv->y + dPriv->h - cy - ch;
-
- LOCK_HARDWARE( rmesa );
-
- /* FIXME: Do we actually need this?
- */
- if ( rmesa->dirty & ~R128_UPLOAD_CLIPRECTS ) {
- r128EmitHwStateLocked( rmesa );
- }
-
- for ( i = 0 ; i < rmesa->numClipRects ; ) {
- GLint nr = MIN2( i + R128_NR_SAREA_CLIPRECTS , rmesa->numClipRects );
- drm_clip_rect_t *box = rmesa->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- GLint n = 0;
-
- if ( !all ) {
- for ( ; i < nr ; i++ ) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if ( x < cx ) w -= cx - x, x = cx;
- if ( y < cy ) h -= cy - y, y = cy;
- if ( x + w > cx + cw ) w = cx + cw - x;
- if ( y + h > cy + ch ) h = cy + ch - y;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- }
-
- rmesa->sarea->nbox = n;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_IOCTL ) {
- fprintf( stderr,
- "DRM_R128_CLEAR: flag 0x%x color %x depth %x nbox %d\n",
- flags,
- (GLuint)rmesa->ClearColor,
- (GLuint)rmesa->ClearDepth,
- rmesa->sarea->nbox );
- }
-
- clear.flags = flags;
- clear.clear_color = rmesa->ClearColor;
- clear.clear_depth = rmesa->ClearDepth;
- clear.color_mask = rmesa->setup.plane_3d_mask_c;
- clear.depth_mask = ~0;
-
- ret = drmCommandWrite( rmesa->driFd, DRM_R128_CLEAR,
- &clear, sizeof(clear) );
-
- if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "DRM_R128_CLEAR: return = %d\n", ret );
- exit( 1 );
- }
- }
-
- UNLOCK_HARDWARE( rmesa );
-
- rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
- }
-
- if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-}
-
-
-/* ================================================================
- * Depth spans, pixels
- */
-
-void r128WriteDepthSpanLocked( r128ContextPtr rmesa,
- GLuint n, GLint x, GLint y,
- const GLdepth depth[],
- const GLubyte mask[] )
-{
- drm_clip_rect_t *pbox = rmesa->pClipRects;
- drm_r128_depth_t d;
- int nbox = rmesa->numClipRects;
- int fd = rmesa->driScreen->fd;
- int i;
-
- if ( !nbox || !n ) {
- return;
- }
- if ( nbox >= R128_NR_SAREA_CLIPRECTS ) {
- rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
- }
-
- if ( !(rmesa->dirty & R128_UPLOAD_CLIPRECTS) )
- {
- if ( nbox < 3 ) {
- rmesa->sarea->nbox = 0;
- } else {
- rmesa->sarea->nbox = nbox;
- }
-
- d.func = R128_WRITE_SPAN;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = (unsigned int *)depth;
- d.mask = (unsigned char *)mask;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
-
- }
- else
- {
- for (i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + R128_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = rmesa->sarea->boxes;
-
- rmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++) {
- *b++ = pbox[i];
- }
-
- rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
-
- d.func = R128_WRITE_SPAN;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = (unsigned int *)depth;
- d.mask = (unsigned char *)mask;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- }
-
- rmesa->dirty &= ~R128_UPLOAD_CLIPRECTS;
-}
-
-void r128WriteDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
- const GLint x[], const GLint y[],
- const GLdepth depth[],
- const GLubyte mask[] )
-{
- drm_clip_rect_t *pbox = rmesa->pClipRects;
- drm_r128_depth_t d;
- int nbox = rmesa->numClipRects;
- int fd = rmesa->driScreen->fd;
- int i;
-
- if ( !nbox || !n ) {
- return;
- }
- if ( nbox >= R128_NR_SAREA_CLIPRECTS ) {
- rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
- }
-
- if ( !(rmesa->dirty & R128_UPLOAD_CLIPRECTS) )
- {
- if ( nbox < 3 ) {
- rmesa->sarea->nbox = 0;
- } else {
- rmesa->sarea->nbox = nbox;
- }
-
- d.func = R128_WRITE_PIXELS;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = (unsigned int *)depth;
- d.mask = (unsigned char *)mask;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- else
- {
- for (i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + R128_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = rmesa->sarea->boxes;
-
- rmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++) {
- *b++ = pbox[i];
- }
-
- rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
-
- d.func = R128_WRITE_PIXELS;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = (unsigned int *)depth;
- d.mask = (unsigned char *)mask;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- }
-
- rmesa->dirty &= ~R128_UPLOAD_CLIPRECTS;
-}
-
-void r128ReadDepthSpanLocked( r128ContextPtr rmesa,
- GLuint n, GLint x, GLint y )
-{
- drm_clip_rect_t *pbox = rmesa->pClipRects;
- drm_r128_depth_t d;
- int nbox = rmesa->numClipRects;
- int fd = rmesa->driScreen->fd;
- int i;
-
- if ( !nbox || !n ) {
- return;
- }
- if ( nbox >= R128_NR_SAREA_CLIPRECTS ) {
- rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
- }
-
- if ( !(rmesa->dirty & R128_UPLOAD_CLIPRECTS) )
- {
- if ( nbox < 3 ) {
- rmesa->sarea->nbox = 0;
- } else {
- rmesa->sarea->nbox = nbox;
- }
-
- d.func = R128_READ_SPAN;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = NULL;
- d.mask = NULL;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- else
- {
- for (i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + R128_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = rmesa->sarea->boxes;
-
- rmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++) {
- *b++ = pbox[i];
- }
-
- rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
-
- d.func = R128_READ_SPAN;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = NULL;
- d.mask = NULL;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- }
-
- rmesa->dirty &= ~R128_UPLOAD_CLIPRECTS;
-}
-
-void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
- const GLint x[], const GLint y[] )
-{
- drm_clip_rect_t *pbox = rmesa->pClipRects;
- drm_r128_depth_t d;
- int nbox = rmesa->numClipRects;
- int fd = rmesa->driScreen->fd;
- int i;
-
- if ( !nbox || !n ) {
- return;
- }
- if ( nbox >= R128_NR_SAREA_CLIPRECTS ) {
- rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
- }
-
- if ( !(rmesa->dirty & R128_UPLOAD_CLIPRECTS) )
- {
- if ( nbox < 3 ) {
- rmesa->sarea->nbox = 0;
- } else {
- rmesa->sarea->nbox = nbox;
- }
-
- d.func = R128_READ_PIXELS;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = NULL;
- d.mask = NULL;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- else
- {
- for (i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + R128_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = rmesa->sarea->boxes;
-
- rmesa->sarea->nbox = nr - i;
- for ( ; i < nr ; i++) {
- *b++ = pbox[i];
- }
-
- rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
-
- d.func = R128_READ_PIXELS;
- d.n = n;
- d.x = (int*)&x;
- d.y = (int*)&y;
- d.buffer = NULL;
- d.mask = NULL;
-
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
- }
- }
-
- rmesa->dirty &= ~R128_UPLOAD_CLIPRECTS;
-}
-
-
-void r128WaitForIdleLocked( r128ContextPtr rmesa )
-{
- int fd = rmesa->r128Screen->driScreen->fd;
- int to = 0;
- int ret, i;
-
- do {
- i = 0;
- do {
- ret = drmCommandNone( fd, DRM_R128_CCE_IDLE);
- } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
- } while ( ( ret == -EBUSY ) && ( to++ < R128_TIMEOUT ) );
-
- if ( ret < 0 ) {
- drmCommandNone( fd, DRM_R128_CCE_RESET);
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "Error: Rage 128 timed out... exiting\n" );
- exit( -1 );
- }
-}
-
-void r128InitIoctlFuncs( struct dd_function_table *functions )
-{
- functions->Clear = r128Clear;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.h
deleted file mode 100644
index d2f2dded8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_ioctl.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h,v 1.6 2002/12/16 16:18:53 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __R128_IOCTL_H__
-#define __R128_IOCTL_H__
-
-#include "r128_dri.h"
-#include "r128_reg.h"
-#include "r128_lock.h"
-
-#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(u_int32_t))
-
-
-extern drmBufPtr r128GetBufferLocked( r128ContextPtr rmesa );
-extern void r128FlushVerticesLocked( r128ContextPtr rmesa );
-
-static __inline void *r128AllocDmaLow( r128ContextPtr rmesa, int count,
- int vert_size )
-{
- u_int32_t *head;
- int bytes = count * vert_size;
-
- if ( !rmesa->vert_buf ) {
- LOCK_HARDWARE( rmesa );
- rmesa->vert_buf = r128GetBufferLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
- } else if ( rmesa->vert_buf->used + bytes > rmesa->vert_buf->total ) {
- LOCK_HARDWARE( rmesa );
- r128FlushVerticesLocked( rmesa );
- rmesa->vert_buf = r128GetBufferLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
- }
-
- head = (u_int32_t *)((char *)rmesa->vert_buf->address + rmesa->vert_buf->used);
- rmesa->vert_buf->used += bytes;
- rmesa->num_verts += count;
-
- return head;
-}
-
-extern void r128FireBlitLocked( r128ContextPtr rmesa, drmBufPtr buffer,
- GLint offset, GLint pitch, GLint format,
- GLint x, GLint y, GLint width, GLint height );
-
-extern void r128WriteDepthSpanLocked( r128ContextPtr rmesa,
- GLuint n, GLint x, GLint y,
- const GLdepth depth[],
- const GLubyte mask[] );
-extern void r128WriteDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
- const GLint x[], const GLint y[],
- const GLdepth depth[],
- const GLubyte mask[] );
-extern void r128ReadDepthSpanLocked( r128ContextPtr rmesa,
- GLuint n, GLint x, GLint y );
-extern void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
- const GLint x[], const GLint y[] );
-
-extern void r128CopyBuffer( const __DRIdrawablePrivate *dPriv );
-extern void r128PageFlip( const __DRIdrawablePrivate *dPriv );
-void r128WaitForVBlank( r128ContextPtr rmesa );
-
-extern void r128WaitForIdleLocked( r128ContextPtr rmesa );
-
-
-extern void r128InitIoctlFuncs( struct dd_function_table *functions );
-
-
-/* ================================================================
- * Helper macros:
- */
-
-#define FLUSH_BATCH( rmesa ) \
-do { \
- if ( R128_DEBUG & DEBUG_VERBOSE_IOCTL ) \
- fprintf( stderr, "FLUSH_BATCH in %s\n", __FUNCTION__ ); \
- if ( rmesa->vert_buf ) { \
- r128FlushVertices( rmesa ); \
- } \
-} while (0)
-
-/* 64-bit align the next element address, and then make room for the
- * next indexed prim packet header.
- */
-#define ALIGN_NEXT_ELT( rmesa ) \
-do { \
- rmesa->next_elt = (GLushort *) \
- (((GLuint)rmesa->next_elt + 7) & ~0x7); \
- rmesa->next_elt = (GLushort *) \
- ((GLubyte *)rmesa->next_elt + R128_INDEX_PRIM_OFFSET); \
-} while (0)
-
-#define r128FlushVertices( rmesa ) \
-do { \
- LOCK_HARDWARE( rmesa ); \
- r128FlushVerticesLocked( rmesa ); \
- UNLOCK_HARDWARE( rmesa ); \
-} while (0)
-
-#define r128FlushElts( rmesa ) \
-do { \
- LOCK_HARDWARE( rmesa ); \
- r128FlushEltsLocked( rmesa ); \
- UNLOCK_HARDWARE( rmesa ); \
-} while (0)
-
-#define r128WaitForIdle( rmesa ) \
- do { \
- LOCK_HARDWARE( rmesa ); \
- r128WaitForIdleLocked( rmesa ); \
- UNLOCK_HARDWARE( rmesa ); \
- } while (0)
-
-#endif /* __R128_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.c
deleted file mode 100644
index ea4ccfb2e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.5 2002/10/30 12:51:38 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include "r128_context.h"
-#include "r128_lock.h"
-#include "r128_tex.h"
-#include "r128_state.h"
-
-#if DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-
-/* Turn on/off page flipping according to the flags in the sarea:
- */
-static void
-r128UpdatePageFlipping( r128ContextPtr rmesa )
-{
- int use_back;
-
- rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
-
- use_back = (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
- use_back ^= (rmesa->sarea->pfCurrentPage == 1);
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API )
- fprintf(stderr, "%s allow %d current %d\n", __FUNCTION__,
- rmesa->doPageFlip,
- rmesa->sarea->pfCurrentPage );
-
- if ( use_back ) {
- rmesa->drawOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->r128Screen->backPitch;
- } else {
- rmesa->drawOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->r128Screen->frontPitch;
- }
-
- rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
- (rmesa->drawOffset >> 5));
- rmesa->new_state |= R128_NEW_WINDOW;
-}
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void r128GetLock( r128ContextPtr rmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = rmesa->driDrawable;
- __DRIscreenPrivate *sPriv = rmesa->driScreen;
- drm_r128_sarea_t *sarea = rmesa->sarea;
- int i;
-
- drmGetLock( rmesa->driFd, rmesa->hHWContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( rmesa->lastStamp != dPriv->lastStamp ) {
- r128UpdatePageFlipping( rmesa );
- rmesa->lastStamp = dPriv->lastStamp;
- rmesa->new_state |= R128_NEW_CLIP;
- rmesa->tnl_state = ~0;
- }
-
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_CLIPRECTS;
-
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
-
- if ( sarea->ctx_owner != rmesa->hHWContext ) {
- sarea->ctx_owner = rmesa->hHWContext;
- rmesa->dirty = R128_UPLOAD_ALL;
- }
-
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( rmesa->texture_heaps[i] );
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.h
deleted file mode 100644
index 39bdde982..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_lock.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.h,v 1.4 2001/01/08 01:07:21 martin Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __R128_LOCK_H__
-#define __R128_LOCK_H__
-
-extern void r128GetLock( r128ContextPtr rmesa, GLuint flags );
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( rmesa ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( rmesa->driHwLock, rmesa->hHWContext, \
- (DRM_LOCK_HELD | rmesa->hHWContext), __ret ); \
- if ( __ret ) \
- r128GetLock( rmesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-/* Unlock the hardware.
- */
-#define UNLOCK_HARDWARE( rmesa ) \
- do { \
- DRM_UNLOCK( rmesa->driFd, \
- rmesa->driHwLock, \
- rmesa->hHWContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-#endif /* __R128_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.c
deleted file mode 100644
index 17cdd60b1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.9 2003/03/26 20:43:49 tsi Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#include "r128_dri.h"
-
-#include "r128_context.h"
-#include "r128_ioctl.h"
-#include "r128_span.h"
-#include "r128_tris.h"
-
-#include "context.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#include "utils.h"
-#include "vblank.h"
-
-#include "GL/internal/dri_interface.h"
-
-/* R128 configuration
- */
-#include "xmlpool.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
-#if ENABLE_PERF_BOXES
- DRI_CONF_PERFORMANCE_BOXES(false)
-#endif
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-#if ENABLE_PERF_BOXES
-static const GLuint __driNConfigOptions = 4;
-#else
-static const GLuint __driNConfigOptions = 3;
-#endif
-
-extern const struct dri_extension card_extensions[];
-
-#if 1
-/* Including xf86PciInfo.h introduces a bunch of errors...
- */
-#define PCI_CHIP_RAGE128LE 0x4C45
-#define PCI_CHIP_RAGE128LF 0x4C46
-#define PCI_CHIP_RAGE128PF 0x5046
-#define PCI_CHIP_RAGE128PR 0x5052
-#define PCI_CHIP_RAGE128RE 0x5245
-#define PCI_CHIP_RAGE128RF 0x5246
-#define PCI_CHIP_RAGE128RK 0x524B
-#define PCI_CHIP_RAGE128RL 0x524C
-#endif
-
-
-/* Create the device specific screen private data struct.
- */
-static r128ScreenPtr
-r128CreateScreen( __DRIscreenPrivate *sPriv )
-{
- r128ScreenPtr r128Screen;
- R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(R128DRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(R128DRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- r128Screen = (r128ScreenPtr) CALLOC( sizeof(*r128Screen) );
- if ( !r128Screen ) return NULL;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&r128Screen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- /* This is first since which regions we map depends on whether or
- * not we are using a PCI card.
- */
- r128Screen->IsPCI = r128DRIPriv->IsPCI;
- r128Screen->sarea_priv_offset = r128DRIPriv->sarea_priv_offset;
-
- if (sPriv->drmMinor >= 3) {
- drm_r128_getparam_t gp;
- int ret;
-
- gp.param = R128_PARAM_IRQ_NR;
- gp.value = &r128Screen->irq;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_R128_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drmR128GetParam (R128_PARAM_IRQ_NR): %d\n", ret);
- FREE( r128Screen );
- return NULL;
- }
- }
-
- r128Screen->mmio.handle = r128DRIPriv->registerHandle;
- r128Screen->mmio.size = r128DRIPriv->registerSize;
- if ( drmMap( sPriv->fd,
- r128Screen->mmio.handle,
- r128Screen->mmio.size,
- (drmAddressPtr)&r128Screen->mmio.map ) ) {
- FREE( r128Screen );
- return NULL;
- }
-
- r128Screen->buffers = drmMapBufs( sPriv->fd );
- if ( !r128Screen->buffers ) {
- drmUnmap( (drmAddress)r128Screen->mmio.map, r128Screen->mmio.size );
- FREE( r128Screen );
- return NULL;
- }
-
- if ( !r128Screen->IsPCI ) {
- r128Screen->agpTextures.handle = r128DRIPriv->agpTexHandle;
- r128Screen->agpTextures.size = r128DRIPriv->agpTexMapSize;
- if ( drmMap( sPriv->fd,
- r128Screen->agpTextures.handle,
- r128Screen->agpTextures.size,
- (drmAddressPtr)&r128Screen->agpTextures.map ) ) {
- drmUnmapBufs( r128Screen->buffers );
- drmUnmap( (drmAddress)r128Screen->mmio.map, r128Screen->mmio.size );
- FREE( r128Screen );
- return NULL;
- }
- }
-
- switch ( r128DRIPriv->deviceID ) {
- case PCI_CHIP_RAGE128RE:
- case PCI_CHIP_RAGE128RF:
- case PCI_CHIP_RAGE128RK:
- case PCI_CHIP_RAGE128RL:
- r128Screen->chipset = R128_CARD_TYPE_R128;
- break;
- case PCI_CHIP_RAGE128PF:
- r128Screen->chipset = R128_CARD_TYPE_R128_PRO;
- break;
- case PCI_CHIP_RAGE128LE:
- case PCI_CHIP_RAGE128LF:
- r128Screen->chipset = R128_CARD_TYPE_R128_MOBILITY;
- break;
- default:
- r128Screen->chipset = R128_CARD_TYPE_R128;
- break;
- }
-
- r128Screen->cpp = r128DRIPriv->bpp / 8;
- r128Screen->AGPMode = r128DRIPriv->AGPMode;
-
- r128Screen->frontOffset = r128DRIPriv->frontOffset;
- r128Screen->frontPitch = r128DRIPriv->frontPitch;
- r128Screen->backOffset = r128DRIPriv->backOffset;
- r128Screen->backPitch = r128DRIPriv->backPitch;
- r128Screen->depthOffset = r128DRIPriv->depthOffset;
- r128Screen->depthPitch = r128DRIPriv->depthPitch;
- r128Screen->spanOffset = r128DRIPriv->spanOffset;
-
- if ( r128DRIPriv->textureSize == 0 ) {
- r128Screen->texOffset[R128_LOCAL_TEX_HEAP] =
- r128DRIPriv->agpTexOffset + R128_AGP_TEX_OFFSET;
- r128Screen->texSize[R128_LOCAL_TEX_HEAP] = r128DRIPriv->agpTexMapSize;
- r128Screen->logTexGranularity[R128_LOCAL_TEX_HEAP] =
- r128DRIPriv->log2AGPTexGran;
- } else {
- r128Screen->texOffset[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureOffset;
- r128Screen->texSize[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureSize;
- r128Screen->logTexGranularity[R128_LOCAL_TEX_HEAP] = r128DRIPriv->log2TexGran;
- }
-
- if ( !r128Screen->agpTextures.map || r128DRIPriv->textureSize == 0 ) {
- r128Screen->numTexHeaps = R128_NR_TEX_HEAPS - 1;
- r128Screen->texOffset[R128_AGP_TEX_HEAP] = 0;
- r128Screen->texSize[R128_AGP_TEX_HEAP] = 0;
- r128Screen->logTexGranularity[R128_AGP_TEX_HEAP] = 0;
- } else {
- r128Screen->numTexHeaps = R128_NR_TEX_HEAPS;
- r128Screen->texOffset[R128_AGP_TEX_HEAP] =
- r128DRIPriv->agpTexOffset + R128_AGP_TEX_OFFSET;
- r128Screen->texSize[R128_AGP_TEX_HEAP] = r128DRIPriv->agpTexMapSize;
- r128Screen->logTexGranularity[R128_AGP_TEX_HEAP] =
- r128DRIPriv->log2AGPTexGran;
- }
-
- r128Screen->driScreen = sPriv;
-
- if ( glx_enable_extension != NULL ) {
- if ( r128Screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
-
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- }
-
- return r128Screen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-static void
-r128DestroyScreen( __DRIscreenPrivate *sPriv )
-{
- r128ScreenPtr r128Screen = (r128ScreenPtr)sPriv->private;
-
- if ( !r128Screen )
- return;
-
- if ( !r128Screen->IsPCI ) {
- drmUnmap( (drmAddress)r128Screen->agpTextures.map,
- r128Screen->agpTextures.size );
- }
- drmUnmapBufs( r128Screen->buffers );
- drmUnmap( (drmAddress)r128Screen->mmio.map, r128Screen->mmio.size );
-
- /* free all option information */
- driDestroyOptionInfo (&r128Screen->optionCache);
-
- FREE( r128Screen );
- sPriv->private = NULL;
-}
-
-
-/* Create and initialize the Mesa and driver specific pixmap buffer
- * data.
- */
-static GLboolean
-r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- r128ScreenPtr screen = (r128ScreenPtr) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0 );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- r128SetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- r128SetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- r128SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- r128SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-r128DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-/* Copy the back color buffer to the front color buffer */
-static void
-r128SwapBuffers(__DRIdrawablePrivate *dPriv)
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- r128ContextPtr rmesa;
- GLcontext *ctx;
- rmesa = (r128ContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = rmesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- if ( rmesa->doPageFlip ) {
- r128PageFlip( dPriv );
- }
- else {
- r128CopyBuffer( dPriv );
- }
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__);
- }
-}
-
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-r128InitDriver( __DRIscreenPrivate *sPriv )
-{
- sPriv->private = (void *) r128CreateScreen( sPriv );
-
- if ( !sPriv->private ) {
- r128DestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-static struct __DriverAPIRec r128API = {
- .InitDriver = r128InitDriver,
- .DestroyScreen = r128DestroyScreen,
- .CreateContext = r128CreateContext,
- .DestroyContext = r128DestroyContext,
- .CreateBuffer = r128CreateBuffer,
- .DestroyBuffer = r128DestroyBuffer,
- .SwapBuffers = r128SwapBuffers,
- .MakeCurrent = r128MakeCurrent,
- .UnbindContext = r128UnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-
-};
-
-
-static __GLcontextModes *
-r128FillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGR;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 4, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 2, 2, 0 };
-
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "Rage128",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &r128API);
- if ( psp != NULL ) {
- R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv;
- *driver_modes = r128FillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.h
deleted file mode 100644
index 8db8eea35..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_screen.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.h,v 1.7 2002/12/16 16:18:53 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#ifndef __R128_SCREEN_H__
-#define __R128_SCREEN_H__
-
-#include "xmlconfig.h"
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- unsigned char *map; /* Mapping of the DRM region */
-} r128RegionRec, *r128RegionPtr;
-
-typedef struct {
-
- GLint chipset;
- GLint cpp;
- GLint IsPCI; /* Current card is a PCI card */
- GLint AGPMode;
- unsigned int irq; /* IRQ number (0 means none) */
-
- GLuint frontOffset;
- GLuint frontPitch;
- GLuint backOffset;
- GLuint backPitch;
-
- GLuint depthOffset;
- GLuint depthPitch;
- GLuint spanOffset;
-
- /* Shared texture data */
- GLint numTexHeaps;
- GLint texOffset[R128_NR_TEX_HEAPS];
- GLint texSize[R128_NR_TEX_HEAPS];
- GLint logTexGranularity[R128_NR_TEX_HEAPS];
-
- r128RegionRec mmio;
- r128RegionRec agpTextures;
-
- drmBufMapPtr buffers;
-
- __DRIscreenPrivate *driScreen;
- unsigned int sarea_priv_offset;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-
-} r128ScreenRec, *r128ScreenPtr;
-
-
-#endif /* __R128_SCREEN_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.c
deleted file mode 100644
index fd4722b3b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.8 2002/10/30 12:51:39 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#include "r128_context.h"
-#include "r128_ioctl.h"
-#include "r128_state.h"
-#include "r128_span.h"
-#include "r128_tex.h"
-
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define HAVE_HW_DEPTH_SPANS 1
-#define HAVE_HW_DEPTH_PIXELS 1
-
-#define LOCAL_VARS \
- r128ContextPtr rmesa = R128_CONTEXT(ctx); \
- r128ScreenPtr r128scrn = rmesa->r128Screen; \
- __DRIscreenPrivate *sPriv = rmesa->driScreen; \
- __DRIdrawablePrivate *dPriv = rmesa->driDrawable; \
- GLuint pitch = r128scrn->frontPitch * r128scrn->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- rmesa->drawOffset + \
- (dPriv->x * r128scrn->cpp) + \
- (dPriv->y * pitch)); \
- char *read_buf = (char *)(sPriv->pFB + \
- rmesa->readOffset + \
- (dPriv->x * r128scrn->cpp) + \
- (dPriv->y * pitch)); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- r128ContextPtr rmesa = R128_CONTEXT(ctx); \
- r128ScreenPtr r128scrn = rmesa->r128Screen; \
- __DRIscreenPrivate *sPriv = rmesa->driScreen; \
- __DRIdrawablePrivate *dPriv = rmesa->driDrawable; \
- GLuint height = dPriv->h; \
- (void) r128scrn; (void) sPriv; (void) height
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) r128##x##_RGB565
-#define TAG2(x,y) r128##x##_RGB565##y
-#include "spantmp2.h"
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) r128##x##_ARGB8888
-#define TAG2(x,y) r128##x##_ARGB8888##y
-#include "spantmp2.h"
-
-
-/* ================================================================
- * Depth buffer
- */
-
-/* 16-bit depth buffer functions
- */
-
-#define WRITE_DEPTH_SPAN() \
- r128WriteDepthSpanLocked( rmesa, n, \
- x + dPriv->x, \
- y + dPriv->y, \
- depth, mask );
-
-#define WRITE_DEPTH_PIXELS() \
-do { \
- GLint ox[MAX_WIDTH]; \
- GLint oy[MAX_WIDTH]; \
- for ( i = 0 ; i < n ; i++ ) { \
- ox[i] = x[i] + dPriv->x; \
- oy[i] = Y_FLIP( y[i] ) + dPriv->y; \
- } \
- r128WriteDepthPixelsLocked( rmesa, n, ox, oy, depth, mask ); \
-} while (0)
-
-#define READ_DEPTH_SPAN() \
-do { \
- GLushort *buf = (GLushort *)((GLubyte *)sPriv->pFB + \
- r128scrn->spanOffset); \
- GLint i; \
- \
- r128ReadDepthSpanLocked( rmesa, n, \
- x + dPriv->x, \
- y + dPriv->y ); \
- r128WaitForIdleLocked( rmesa ); \
- \
- for ( i = 0 ; i < n ; i++ ) { \
- depth[i] = buf[i]; \
- } \
-} while (0)
-
-#define READ_DEPTH_PIXELS() \
-do { \
- GLushort *buf = (GLushort *)((GLubyte *)sPriv->pFB + \
- r128scrn->spanOffset); \
- GLint i, remaining = n; \
- \
- while ( remaining > 0 ) { \
- GLint ox[128]; \
- GLint oy[128]; \
- GLint count; \
- \
- if ( remaining <= 128 ) { \
- count = remaining; \
- } else { \
- count = 128; \
- } \
- for ( i = 0 ; i < count ; i++ ) { \
- ox[i] = x[i] + dPriv->x; \
- oy[i] = Y_FLIP( y[i] ) + dPriv->y; \
- } \
- \
- r128ReadDepthPixelsLocked( rmesa, count, ox, oy ); \
- r128WaitForIdleLocked( rmesa ); \
- \
- for ( i = 0 ; i < count ; i++ ) { \
- depth[i] = buf[i]; \
- } \
- depth += count; \
- x += count; \
- y += count; \
- remaining -= count; \
- } \
-} while (0)
-
-#define TAG(x) r128##x##_16
-#include "depthtmp.h"
-
-
-/* 24-bit depth, 8-bit stencil buffer functions
- */
-#define WRITE_DEPTH_SPAN() \
- r128WriteDepthSpanLocked( rmesa, n, \
- x + dPriv->x, \
- y + dPriv->y, \
- depth, mask );
-
-#define WRITE_DEPTH_PIXELS() \
-do { \
- GLint ox[MAX_WIDTH]; \
- GLint oy[MAX_WIDTH]; \
- for ( i = 0 ; i < n ; i++ ) { \
- ox[i] = x[i] + dPriv->x; \
- oy[i] = Y_FLIP( y[i] ) + dPriv->y; \
- } \
- r128WriteDepthPixelsLocked( rmesa, n, ox, oy, depth, mask ); \
-} while (0)
-
-#define READ_DEPTH_SPAN() \
-do { \
- GLuint *buf = (GLuint *)((GLubyte *)sPriv->pFB + \
- r128scrn->spanOffset); \
- GLint i; \
- \
- r128ReadDepthSpanLocked( rmesa, n, \
- x + dPriv->x, \
- y + dPriv->y ); \
- r128WaitForIdleLocked( rmesa ); \
- \
- for ( i = 0 ; i < n ; i++ ) { \
- depth[i] = buf[i] & 0x00ffffff; \
- } \
-} while (0)
-
-#define READ_DEPTH_PIXELS() \
-do { \
- GLuint *buf = (GLuint *)((GLubyte *)sPriv->pFB + \
- r128scrn->spanOffset); \
- GLint i, remaining = n; \
- \
- while ( remaining > 0 ) { \
- GLint ox[128]; \
- GLint oy[128]; \
- GLint count; \
- \
- if ( remaining <= 128 ) { \
- count = remaining; \
- } else { \
- count = 128; \
- } \
- for ( i = 0 ; i < count ; i++ ) { \
- ox[i] = x[i] + dPriv->x; \
- oy[i] = Y_FLIP( y[i] ) + dPriv->y; \
- } \
- \
- r128ReadDepthPixelsLocked( rmesa, count, ox, oy ); \
- r128WaitForIdleLocked( rmesa ); \
- \
- for ( i = 0 ; i < count ; i++ ) { \
- depth[i] = buf[i] & 0x00ffffff; \
- } \
- depth += count; \
- x += count; \
- y += count; \
- remaining -= count; \
- } \
-} while (0)
-
-#define TAG(x) r128##x##_24_8
-#include "depthtmp.h"
-
-
-
-/* ================================================================
- * Stencil buffer
- */
-
-/* FIXME: Add support for hardware stencil buffers.
- */
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void r128DDSetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
- } else {
- rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
- }
- break;
- case BUFFER_BIT_BACK_LEFT:
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
- } else {
- rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
- }
- break;
- default:
- break;
- }
-}
-
-void r128SpanRenderStart( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- FLUSH_BATCH(rmesa);
- LOCK_HARDWARE(rmesa);
- r128WaitForIdleLocked( rmesa );
-}
-
-void r128SpanRenderFinish( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( rmesa );
-}
-
-void r128DDInitSpanFuncs( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = r128DDSetBuffer;
- swdd->SpanRenderStart = r128SpanRenderStart;
- swdd->SpanRenderFinish = r128SpanRenderFinish;
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-r128SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- r128InitPointers_RGB565(&drb->Base);
- }
- else {
- r128InitPointers_ARGB8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = r128ReadDepthSpan_16;
- drb->Base.GetValues = r128ReadDepthPixels_16;
- drb->Base.PutRow = r128WriteDepthSpan_16;
- drb->Base.PutMonoRow = r128WriteMonoDepthSpan_16;
- drb->Base.PutValues = r128WriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = r128ReadDepthSpan_24_8;
- drb->Base.GetValues = r128ReadDepthPixels_24_8;
- drb->Base.PutRow = r128WriteDepthSpan_24_8;
- drb->Base.PutMonoRow = r128WriteMonoDepthSpan_24_8;
- drb->Base.PutValues = r128WriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.h
deleted file mode 100644
index fd7c2d139..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_span.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.h,v 1.3 2001/01/08 01:07:21 martin Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#ifndef __R128_SPAN_H__
-#define __R128_SPAN_H__
-
-#include "drirenderbuffer.h"
-
-extern void r128DDInitSpanFuncs( GLcontext *ctx );
-
-extern void
-r128SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.c
deleted file mode 100644
index 29f490da8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.c
+++ /dev/null
@@ -1,1261 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.11 2002/10/30 12:51:39 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#include "r128_context.h"
-#include "r128_state.h"
-#include "r128_ioctl.h"
-#include "r128_tris.h"
-#include "r128_tex.h"
-
-#include "context.h"
-#include "buffers.h"
-#include "enums.h"
-#include "colormac.h"
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-
-/* =============================================================
- * Alpha blending
- */
-
-
-/**
- * Calculate the hardware blend factor setting. This same function is used
- * for source and destination of both alpha and RGB.
- *
- * \returns
- * The hardware register value for the specified blend factor. This value
- * will need to be shifted into the correct position for either source or
- * destination factor.
- *
- * \todo
- * Since the two cases where source and destination are handled differently
- * are essentially error cases, they should never happen. Determine if these
- * cases can be removed.
- */
-static int blend_factor( r128ContextPtr rmesa, GLenum factor, GLboolean is_src )
-{
- int func;
-
- switch ( factor ) {
- case GL_ZERO:
- func = R128_ALPHA_BLEND_ZERO;
- break;
- case GL_ONE:
- func = R128_ALPHA_BLEND_ONE;
- break;
-
- case GL_SRC_COLOR:
- func = R128_ALPHA_BLEND_SRCCOLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- func = R128_ALPHA_BLEND_INVSRCCOLOR;
- break;
- case GL_SRC_ALPHA:
- func = R128_ALPHA_BLEND_SRCALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- func = R128_ALPHA_BLEND_INVSRCALPHA;
- break;
- case GL_SRC_ALPHA_SATURATE:
- func = (is_src) ? R128_ALPHA_BLEND_SAT : R128_ALPHA_BLEND_ZERO;
- break;
-
- case GL_DST_COLOR:
- func = R128_ALPHA_BLEND_DSTCOLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- func = R128_ALPHA_BLEND_INVDSTCOLOR;
- break;
- case GL_DST_ALPHA:
- func = R128_ALPHA_BLEND_DSTALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- func = R128_ALPHA_BLEND_INVDSTALPHA;
- break;
-
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- default:
- FALLBACK( rmesa, R128_FALLBACK_BLEND_FUNC, GL_TRUE );
- func = (is_src) ? R128_ALPHA_BLEND_ONE : R128_ALPHA_BLEND_ZERO;
- break;
- }
-
- return func;
-}
-
-
-static void r128UpdateAlphaMode( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint a = rmesa->setup.misc_3d_state_cntl_reg;
- GLuint t = rmesa->setup.tex_cntl_c;
-
- if ( ctx->Color.AlphaEnabled ) {
- GLubyte ref;
-
- CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef);
-
- a &= ~(R128_ALPHA_TEST_MASK | R128_REF_ALPHA_MASK);
-
- switch ( ctx->Color.AlphaFunc ) {
- case GL_NEVER:
- a |= R128_ALPHA_TEST_NEVER;
- break;
- case GL_LESS:
- a |= R128_ALPHA_TEST_LESS;
- break;
- case GL_LEQUAL:
- a |= R128_ALPHA_TEST_LESSEQUAL;
- break;
- case GL_EQUAL:
- a |= R128_ALPHA_TEST_EQUAL;
- break;
- case GL_GEQUAL:
- a |= R128_ALPHA_TEST_GREATEREQUAL;
- break;
- case GL_GREATER:
- a |= R128_ALPHA_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- a |= R128_ALPHA_TEST_NEQUAL;
- break;
- case GL_ALWAYS:
- a |= R128_ALPHA_TEST_ALWAYS;
- break;
- }
-
- a |= ref & R128_REF_ALPHA_MASK;
- t |= R128_ALPHA_TEST_ENABLE;
- } else {
- t &= ~R128_ALPHA_TEST_ENABLE;
- }
-
- FALLBACK( rmesa, R128_FALLBACK_BLEND_FUNC, GL_FALSE );
-
- if ( ctx->Color.BlendEnabled ) {
- a &= ~((R128_ALPHA_BLEND_MASK << R128_ALPHA_BLEND_SRC_SHIFT) |
- (R128_ALPHA_BLEND_MASK << R128_ALPHA_BLEND_DST_SHIFT)
- | R128_ALPHA_COMB_FCN_MASK);
-
- a |= blend_factor( rmesa, ctx->Color.BlendSrcRGB, GL_TRUE )
- << R128_ALPHA_BLEND_SRC_SHIFT;
- a |= blend_factor( rmesa, ctx->Color.BlendDstRGB, GL_FALSE )
- << R128_ALPHA_BLEND_DST_SHIFT;
-
- switch (ctx->Color.BlendEquationRGB) {
- case GL_FUNC_ADD:
- a |= R128_ALPHA_COMB_ADD_CLAMP;
- break;
- case GL_FUNC_SUBTRACT:
- a |= R128_ALPHA_COMB_SUB_SRC_DST_CLAMP;
- break;
- default:
- FALLBACK( rmesa, R128_FALLBACK_BLEND_EQ, GL_TRUE );
- }
-
- t |= R128_ALPHA_ENABLE;
- } else {
- t &= ~R128_ALPHA_ENABLE;
- }
-
- if ( rmesa->setup.misc_3d_state_cntl_reg != a ) {
- rmesa->setup.misc_3d_state_cntl_reg = a;
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_MASKS;
- }
- if ( rmesa->setup.tex_cntl_c != t ) {
- rmesa->setup.tex_cntl_c = t;
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_MASKS;
- }
-}
-
-static void r128DDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_ALPHA;
-}
-
-static void r128DDBlendEquationSeparate( GLcontext *ctx,
- GLenum modeRGB, GLenum modeA )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- assert( modeRGB == modeA );
- FLUSH_BATCH( rmesa );
-
- /* BlendEquation sets ColorLogicOpEnabled in an unexpected
- * manner.
- */
- FALLBACK( R128_CONTEXT(ctx), R128_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
-
- /* Can only do blend addition, not min, max, subtract, etc. */
- FALLBACK( R128_CONTEXT(ctx), R128_FALLBACK_BLEND_EQ,
- (modeRGB != GL_FUNC_ADD) && (modeRGB != GL_FUNC_SUBTRACT));
-
- rmesa->new_state |= R128_NEW_ALPHA;
-}
-
-static void r128DDBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_ALPHA;
-}
-
-
-/* =============================================================
- * Depth testing
- */
-
-static void r128UpdateZMode( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint z = rmesa->setup.z_sten_cntl_c;
- GLuint t = rmesa->setup.tex_cntl_c;
-
- if ( ctx->Depth.Test ) {
- z &= ~R128_Z_TEST_MASK;
-
- switch ( ctx->Depth.Func ) {
- case GL_NEVER:
- z |= R128_Z_TEST_NEVER;
- break;
- case GL_ALWAYS:
- z |= R128_Z_TEST_ALWAYS;
- break;
- case GL_LESS:
- z |= R128_Z_TEST_LESS;
- break;
- case GL_LEQUAL:
- z |= R128_Z_TEST_LESSEQUAL;
- break;
- case GL_EQUAL:
- z |= R128_Z_TEST_EQUAL;
- break;
- case GL_GEQUAL:
- z |= R128_Z_TEST_GREATEREQUAL;
- break;
- case GL_GREATER:
- z |= R128_Z_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- z |= R128_Z_TEST_NEQUAL;
- break;
- }
-
- t |= R128_Z_ENABLE;
- } else {
- t &= ~R128_Z_ENABLE;
- }
-
- if ( ctx->Depth.Mask ) {
- t |= R128_Z_WRITE_ENABLE;
- } else {
- t &= ~R128_Z_WRITE_ENABLE;
- }
-
- if ( rmesa->setup.z_sten_cntl_c != z ) {
- rmesa->setup.z_sten_cntl_c = z;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
- if ( rmesa->setup.tex_cntl_c != t ) {
- rmesa->setup.tex_cntl_c = t;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
-}
-
-static void r128DDDepthFunc( GLcontext *ctx, GLenum func )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_DEPTH;
-}
-
-static void r128DDDepthMask( GLcontext *ctx, GLboolean flag )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_DEPTH;
-}
-
-static void r128DDClearDepth( GLcontext *ctx, GLclampd d )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- switch ( rmesa->setup.z_sten_cntl_c & R128_Z_PIX_WIDTH_MASK ) {
- case R128_Z_PIX_WIDTH_16:
- rmesa->ClearDepth = d * 0x0000ffff;
- break;
- case R128_Z_PIX_WIDTH_24:
- rmesa->ClearDepth = d * 0x00ffffff;
- break;
- case R128_Z_PIX_WIDTH_32:
- rmesa->ClearDepth = d * 0xffffffff;
- break;
- }
-}
-
-
-/* =============================================================
- * Fog
- */
-
-static void r128UpdateFogAttrib( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint t = rmesa->setup.tex_cntl_c;
- GLubyte c[4];
- GLuint col;
-
- if ( ctx->Fog.Enabled ) {
- t |= R128_FOG_ENABLE;
- } else {
- t &= ~R128_FOG_ENABLE;
- }
-
- c[0] = FLOAT_TO_UBYTE( ctx->Fog.Color[0] );
- c[1] = FLOAT_TO_UBYTE( ctx->Fog.Color[1] );
- c[2] = FLOAT_TO_UBYTE( ctx->Fog.Color[2] );
-
- col = r128PackColor( 4, c[0], c[1], c[2], 0 );
-
- if ( rmesa->setup.fog_color_c != col ) {
- rmesa->setup.fog_color_c = col;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
- if ( rmesa->setup.tex_cntl_c != t ) {
- rmesa->setup.tex_cntl_c = t;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
-}
-
-static void r128DDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_FOG;
-}
-
-
-/* =============================================================
- * Clipping
- */
-
-static void r128UpdateClipping( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- if ( rmesa->driDrawable ) {
- __DRIdrawablePrivate *drawable = rmesa->driDrawable;
- int x1 = 0;
- int y1 = 0;
- int x2 = drawable->w - 1;
- int y2 = drawable->h - 1;
-
- if ( ctx->Scissor.Enabled ) {
- if ( ctx->Scissor.X > x1 ) {
- x1 = ctx->Scissor.X;
- }
- if ( drawable->h - ctx->Scissor.Y - ctx->Scissor.Height > y1 ) {
- y1 = drawable->h - ctx->Scissor.Y - ctx->Scissor.Height;
- }
- if ( ctx->Scissor.X + ctx->Scissor.Width - 1 < x2 ) {
- x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
- }
- if ( drawable->h - ctx->Scissor.Y - 1 < y2 ) {
- y2 = drawable->h - ctx->Scissor.Y - 1;
- }
- }
-
- x1 += drawable->x;
- y1 += drawable->y;
- x2 += drawable->x;
- y2 += drawable->y;
-
- rmesa->setup.sc_top_left_c = ((y1 << 16) | x1);
- rmesa->setup.sc_bottom_right_c = ((y2 << 16) | x2);
-
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
-}
-
-static void r128DDScissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei w, GLsizei h )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_CLIP;
-}
-
-
-/* =============================================================
- * Culling
- */
-
-static void r128UpdateCull( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint f = rmesa->setup.pm4_vc_fpu_setup;
-
- f &= ~R128_FRONT_DIR_MASK;
-
- switch ( ctx->Polygon.FrontFace ) {
- case GL_CW:
- f |= R128_FRONT_DIR_CW;
- break;
- case GL_CCW:
- f |= R128_FRONT_DIR_CCW;
- break;
- }
-
- f |= R128_BACKFACE_SOLID | R128_FRONTFACE_SOLID;
-
- if ( ctx->Polygon.CullFlag ) {
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_FRONT:
- f &= ~R128_FRONTFACE_SOLID;
- break;
- case GL_BACK:
- f &= ~R128_BACKFACE_SOLID;
- break;
- case GL_FRONT_AND_BACK:
- f &= ~(R128_BACKFACE_SOLID |
- R128_FRONTFACE_SOLID);
- break;
- }
- }
-
- if ( 1 || rmesa->setup.pm4_vc_fpu_setup != f ) {
- rmesa->setup.pm4_vc_fpu_setup = f;
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_SETUP;
- }
-}
-
-static void r128DDCullFace( GLcontext *ctx, GLenum mode )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_CULL;
-}
-
-static void r128DDFrontFace( GLcontext *ctx, GLenum mode )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_CULL;
-}
-
-
-/* =============================================================
- * Masks
- */
-
-static void r128UpdateMasks( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- GLuint mask = r128PackColor( rmesa->r128Screen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] );
-
- if ( rmesa->setup.plane_3d_mask_c != mask ) {
- rmesa->setup.plane_3d_mask_c = mask;
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_MASKS;
- }
-}
-
-static void r128DDColorMask( GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_MASKS;
-}
-
-
-/* =============================================================
- * Rendering attributes
- *
- * We really don't want to recalculate all this every time we bind a
- * texture. These things shouldn't change all that often, so it makes
- * sense to break them out of the core texture state update routines.
- */
-
-static void updateSpecularLighting( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint t = rmesa->setup.tex_cntl_c;
-
- if ( ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Light.Enabled) {
- /* XXX separate specular color just doesn't seem to work as it should.
- * For now, we fall back to s/w rendering whenever separate specular
- * is enabled.
- */
-#if 0
- if (ctx->Light.ShadeModel == GL_FLAT) {
- /* R128 can't do flat-shaded separate specular */
- t &= ~R128_SPEC_LIGHT_ENABLE;
- FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_TRUE );
- /*printf("%s fallback sep spec\n", __FUNCTION__);*/
- }
- else {
- t |= R128_SPEC_LIGHT_ENABLE;
- FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_FALSE );
- /*printf("%s enable sep spec\n", __FUNCTION__);*/
- }
-#else
- t &= ~R128_SPEC_LIGHT_ENABLE;
- FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_TRUE );
- /*printf("%s fallback sep spec\n", __FUNCTION__);*/
-#endif
- }
- else {
- t &= ~R128_SPEC_LIGHT_ENABLE;
- FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_FALSE );
- /*printf("%s disable sep spec\n", __FUNCTION__);*/
- }
-
- if ( rmesa->setup.tex_cntl_c != t ) {
- rmesa->setup.tex_cntl_c = t;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- rmesa->dirty |= R128_UPLOAD_SETUP;
- rmesa->new_state |= R128_NEW_CONTEXT;
- }
-}
-
-
-static void r128DDLightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *param )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- if ( pname == GL_LIGHT_MODEL_COLOR_CONTROL ) {
- FLUSH_BATCH( rmesa );
- updateSpecularLighting(ctx);
- }
-}
-
-static void r128DDShadeModel( GLcontext *ctx, GLenum mode )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint s = rmesa->setup.pm4_vc_fpu_setup;
-
- s &= ~R128_FPU_COLOR_MASK;
-
- switch ( mode ) {
- case GL_FLAT:
- s |= R128_FPU_COLOR_FLAT;
- break;
- case GL_SMOOTH:
- s |= R128_FPU_COLOR_GOURAUD;
- break;
- default:
- return;
- }
-
- updateSpecularLighting(ctx);
-
- if ( rmesa->setup.pm4_vc_fpu_setup != s ) {
- FLUSH_BATCH( rmesa );
- rmesa->setup.pm4_vc_fpu_setup = s;
-
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= R128_UPLOAD_SETUP;
- }
-}
-
-
-/* =============================================================
- * Window position
- */
-
-void r128UpdateWindow( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- int x = rmesa->driDrawable->x;
- int y = rmesa->driDrawable->y;
-
- rmesa->setup.window_xy_offset = ((y << R128_WINDOW_Y_SHIFT) |
- (x << R128_WINDOW_X_SHIFT));
-
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_WINDOW;
-}
-
-/* =============================================================
- * Viewport
- */
-
-
-static void r128CalcViewport( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = rmesa->hw_viewport;
-
- /* See also r128_translate_vertex.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + rmesa->driDrawable->h + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * rmesa->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * rmesa->depth_scale;
-}
-
-static void r128Viewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- r128CalcViewport( ctx );
-}
-
-static void r128DepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- r128CalcViewport( ctx );
-}
-
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void r128DDClearColor( GLcontext *ctx,
- const GLfloat color[4] )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLubyte c[4];
-
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
-
- rmesa->ClearColor = r128PackColor( rmesa->r128Screen->cpp,
- c[0], c[1], c[2], c[3] );
-}
-
-static void r128DDLogicOpCode( GLcontext *ctx, GLenum opcode )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- if ( ctx->Color.ColorLogicOpEnabled ) {
- FLUSH_BATCH( rmesa );
-
- FALLBACK( rmesa, R128_FALLBACK_LOGICOP, opcode != GL_COPY );
- }
-}
-
-static void r128DDDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
-
- /*
- * _ColorDrawBufferMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case BUFFER_BIT_BACK_LEFT:
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE );
- break;
- }
-
- /* We want to update the s/w rast state too so that r128DDSetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
- (rmesa->drawOffset >> 5));
- rmesa->new_state |= R128_NEW_WINDOW;
-}
-
-static void r128DDReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-
-/* =============================================================
- * Polygon stipple
- */
-
-static void r128DDPolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint stipple[32], i;
- drm_r128_stipple_t stippleRec;
-
- for (i = 0; i < 32; i++) {
- stipple[31 - i] = ((mask[i*4+0] << 24) |
- (mask[i*4+1] << 16) |
- (mask[i*4+2] << 8) |
- (mask[i*4+3]));
- }
-
- FLUSH_BATCH( rmesa );
- LOCK_HARDWARE( rmesa );
-
- stippleRec.mask = stipple;
- drmCommandWrite( rmesa->driFd, DRM_R128_STIPPLE,
- &stippleRec, sizeof(stippleRec) );
-
- UNLOCK_HARDWARE( rmesa );
-
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
-}
-
-
-/* =============================================================
- * Render mode
- */
-
-static void r128DDRenderMode( GLcontext *ctx, GLenum mode )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- FALLBACK( rmesa, R128_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
-}
-
-
-
-/* =============================================================
- * State enable/disable
- */
-
-static void r128DDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s = %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( cap ),
- state ? "GL_TRUE" : "GL_FALSE" );
- }
-
- switch ( cap ) {
- case GL_ALPHA_TEST:
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_ALPHA;
- break;
-
- case GL_BLEND:
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_ALPHA;
-
- /* For some reason enable(GL_BLEND) affects ColorLogicOpEnabled.
- */
- FALLBACK( rmesa, R128_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
- break;
-
- case GL_CULL_FACE:
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_CULL;
- break;
-
- case GL_DEPTH_TEST:
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_DEPTH;
- break;
-
- case GL_DITHER:
- do {
- GLuint t = rmesa->setup.tex_cntl_c;
- FLUSH_BATCH( rmesa );
-
- if ( ctx->Color.DitherFlag ) {
- t |= R128_DITHER_ENABLE;
- } else {
- t &= ~R128_DITHER_ENABLE;
- }
-
- if ( rmesa->setup.tex_cntl_c != t ) {
- rmesa->setup.tex_cntl_c = t;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
- } while (0);
- break;
-
- case GL_FOG:
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_FOG;
- break;
-
- case GL_COLOR_LOGIC_OP:
- FLUSH_BATCH( rmesa );
- FALLBACK( rmesa, R128_FALLBACK_LOGICOP,
- state && ctx->Color.LogicOp != GL_COPY );
- break;
-
- case GL_LIGHTING:
- updateSpecularLighting(ctx);
- break;
-
- case GL_SCISSOR_TEST:
- FLUSH_BATCH( rmesa );
- rmesa->scissor = state;
- rmesa->new_state |= R128_NEW_CLIP;
- break;
-
- case GL_STENCIL_TEST:
- FLUSH_BATCH( rmesa );
- FALLBACK( rmesa, R128_FALLBACK_STENCIL, state );
- break;
-
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- FLUSH_BATCH( rmesa );
- break;
-
- case GL_POLYGON_STIPPLE:
- if ( rmesa->render_primitive == GL_TRIANGLES ) {
- FLUSH_BATCH( rmesa );
- rmesa->setup.dp_gui_master_cntl_c &= ~R128_GMC_BRUSH_NONE;
- if ( state ) {
- rmesa->setup.dp_gui_master_cntl_c |=
- R128_GMC_BRUSH_32x32_MONO_FG_LA;
- } else {
- rmesa->setup.dp_gui_master_cntl_c |=
- R128_GMC_BRUSH_SOLID_COLOR;
- }
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
- break;
-
- default:
- return;
- }
-}
-
-
-/* =============================================================
- * State initialization, management
- */
-
-static void r128DDPrintDirty( const char *msg, GLuint state )
-{
- fprintf( stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s\n",
- msg,
- state,
- (state & R128_UPLOAD_CORE) ? "core, " : "",
- (state & R128_UPLOAD_CONTEXT) ? "context, " : "",
- (state & R128_UPLOAD_SETUP) ? "setup, " : "",
- (state & R128_UPLOAD_TEX0) ? "tex0, " : "",
- (state & R128_UPLOAD_TEX1) ? "tex1, " : "",
- (state & R128_UPLOAD_MASKS) ? "masks, " : "",
- (state & R128_UPLOAD_WINDOW) ? "window, " : "",
- (state & R128_UPLOAD_CLIPRECTS) ? "cliprects, " : "",
- (state & R128_REQUIRE_QUIESCENCE) ? "quiescence, " : "" );
-}
-
-/*
- * Load the current context's state into the hardware.
- *
- * NOTE: Be VERY careful about ensuring the context state is marked for
- * upload, the only place it shouldn't be uploaded is when the setup
- * state has changed in ReducedPrimitiveChange as this comes right after
- * a state update.
- *
- * Blits of any type should always upload the context and masks after
- * they are done.
- */
-void r128EmitHwStateLocked( r128ContextPtr rmesa )
-{
- drm_r128_sarea_t *sarea = rmesa->sarea;
- drm_r128_context_regs_t *regs = &(rmesa->setup);
- const r128TexObjPtr t0 = rmesa->CurrentTexObj[0];
- const r128TexObjPtr t1 = rmesa->CurrentTexObj[1];
-
- if ( R128_DEBUG & DEBUG_VERBOSE_MSG ) {
- r128DDPrintDirty( "r128EmitHwStateLocked", rmesa->dirty );
- }
-
- if ( rmesa->dirty & (R128_UPLOAD_CONTEXT |
- R128_UPLOAD_SETUP |
- R128_UPLOAD_MASKS |
- R128_UPLOAD_WINDOW |
- R128_UPLOAD_CORE) ) {
- memcpy( &sarea->context_state, regs, sizeof(sarea->context_state) );
- }
-
- if ( (rmesa->dirty & R128_UPLOAD_TEX0) && t0 ) {
- drm_r128_texture_regs_t *tex = &sarea->tex_state[0];
-
- tex->tex_cntl = t0->setup.tex_cntl;
- tex->tex_combine_cntl = rmesa->tex_combine[0];
- tex->tex_size_pitch = t0->setup.tex_size_pitch;
- memcpy( &tex->tex_offset[0], &t0->setup.tex_offset[0],
- sizeof(tex->tex_offset ) );
- tex->tex_border_color = t0->setup.tex_border_color;
- }
-
- if ( (rmesa->dirty & R128_UPLOAD_TEX1) && t1 ) {
- drm_r128_texture_regs_t *tex = &sarea->tex_state[1];
-
- tex->tex_cntl = t1->setup.tex_cntl;
- tex->tex_combine_cntl = rmesa->tex_combine[1];
- tex->tex_size_pitch = t1->setup.tex_size_pitch;
- memcpy( &tex->tex_offset[0], &t1->setup.tex_offset[0],
- sizeof(tex->tex_offset ) );
- tex->tex_border_color = t1->setup.tex_border_color;
- }
-
- sarea->vertsize = rmesa->vertex_size;
- sarea->vc_format = rmesa->vertex_format;
-
- /* Turn off the texture cache flushing */
- rmesa->setup.tex_cntl_c &= ~R128_TEX_CACHE_FLUSH;
-
- sarea->dirty |= rmesa->dirty;
- rmesa->dirty &= R128_UPLOAD_CLIPRECTS;
-}
-
-static void r128DDPrintState( const char *msg, GLuint flags )
-{
- fprintf( stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s\n",
- msg,
- flags,
- (flags & R128_NEW_CONTEXT) ? "context, " : "",
- (flags & R128_NEW_ALPHA) ? "alpha, " : "",
- (flags & R128_NEW_DEPTH) ? "depth, " : "",
- (flags & R128_NEW_FOG) ? "fog, " : "",
- (flags & R128_NEW_CLIP) ? "clip, " : "",
- (flags & R128_NEW_CULL) ? "cull, " : "",
- (flags & R128_NEW_MASKS) ? "masks, " : "",
- (flags & R128_NEW_WINDOW) ? "window, " : "" );
-}
-
-void r128DDUpdateHWState( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- int new_state = rmesa->new_state;
-
- if ( new_state || rmesa->NewGLState & _NEW_TEXTURE )
- {
- FLUSH_BATCH( rmesa );
-
- rmesa->new_state = 0;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_MSG )
- r128DDPrintState( "r128UpdateHwState", new_state );
-
- /* Update the various parts of the context's state.
- */
- if ( new_state & R128_NEW_ALPHA )
- r128UpdateAlphaMode( ctx );
-
- if ( new_state & R128_NEW_DEPTH )
- r128UpdateZMode( ctx );
-
- if ( new_state & R128_NEW_FOG )
- r128UpdateFogAttrib( ctx );
-
- if ( new_state & R128_NEW_CLIP )
- r128UpdateClipping( ctx );
-
- if ( new_state & R128_NEW_CULL )
- r128UpdateCull( ctx );
-
- if ( new_state & R128_NEW_MASKS )
- r128UpdateMasks( ctx );
-
- if ( new_state & R128_NEW_WINDOW )
- r128UpdateWindow( ctx );
-
- if ( rmesa->NewGLState & _NEW_TEXTURE ) {
- r128UpdateTextureState( ctx );
- }
- }
-}
-
-
-static void r128DDInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- R128_CONTEXT(ctx)->NewGLState |= new_state;
-}
-
-
-
-/* Initialize the context's hardware state.
- */
-void r128DDInitState( r128ContextPtr rmesa )
-{
- int dst_bpp, depth_bpp;
-
- switch ( rmesa->r128Screen->cpp ) {
- case 2:
- dst_bpp = R128_GMC_DST_16BPP;
- break;
- case 4:
- dst_bpp = R128_GMC_DST_32BPP;
- break;
- default:
- fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
- exit( -1 );
- }
-
- rmesa->ClearColor = 0x00000000;
-
- switch ( rmesa->glCtx->Visual.depthBits ) {
- case 16:
- rmesa->ClearDepth = 0x0000ffff;
- depth_bpp = R128_Z_PIX_WIDTH_16;
- rmesa->depth_scale = 1.0 / (GLfloat)0xffff;
- break;
- case 24:
- rmesa->ClearDepth = 0x00ffffff;
- depth_bpp = R128_Z_PIX_WIDTH_24;
- rmesa->depth_scale = 1.0 / (GLfloat)0xffffff;
- break;
- default:
- fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
- rmesa->glCtx->Visual.depthBits );
- exit( -1 );
- }
-
- rmesa->Fallback = 0;
-
- if ( rmesa->glCtx->Visual.doubleBufferMode && rmesa->sarea->pfCurrentPage == 0 ) {
- rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
- } else {
- rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
- }
-
- /* Harware state:
- */
- rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) |
- (rmesa->drawOffset >> 5));
-
- rmesa->setup.dp_gui_master_cntl_c = (R128_GMC_DST_PITCH_OFFSET_CNTL |
- R128_GMC_DST_CLIPPING |
- R128_GMC_BRUSH_SOLID_COLOR |
- dst_bpp |
- R128_GMC_SRC_DATATYPE_COLOR |
- R128_GMC_BYTE_MSB_TO_LSB |
- R128_GMC_CONVERSION_TEMP_6500 |
- R128_ROP3_S |
- R128_DP_SRC_SOURCE_MEMORY |
- R128_GMC_3D_FCN_EN |
- R128_GMC_CLR_CMP_CNTL_DIS |
- R128_GMC_AUX_CLIP_DIS |
- R128_GMC_WR_MSK_DIS);
-
- rmesa->setup.sc_top_left_c = 0x00000000;
- rmesa->setup.sc_bottom_right_c = 0x1fff1fff;
-
- rmesa->setup.z_offset_c = rmesa->r128Screen->depthOffset;
- rmesa->setup.z_pitch_c = ((rmesa->r128Screen->depthPitch >> 3) |
- R128_Z_TILE);
-
- rmesa->setup.z_sten_cntl_c = (depth_bpp |
- R128_Z_TEST_LESS |
- R128_STENCIL_TEST_ALWAYS |
- R128_STENCIL_S_FAIL_KEEP |
- R128_STENCIL_ZPASS_KEEP |
- R128_STENCIL_ZFAIL_KEEP);
-
- rmesa->setup.tex_cntl_c = (R128_Z_WRITE_ENABLE |
- R128_SHADE_ENABLE |
- R128_DITHER_ENABLE |
- R128_ALPHA_IN_TEX_COMPLETE_A |
- R128_LIGHT_DIS |
- R128_ALPHA_LIGHT_DIS |
- R128_TEX_CACHE_FLUSH |
- (0x3f << R128_LOD_BIAS_SHIFT));
-
- rmesa->setup.misc_3d_state_cntl_reg = (R128_MISC_SCALE_3D_TEXMAP_SHADE |
- R128_MISC_SCALE_PIX_REPLICATE |
- R128_ALPHA_COMB_ADD_CLAMP |
- R128_FOG_VERTEX |
- (R128_ALPHA_BLEND_ONE << R128_ALPHA_BLEND_SRC_SHIFT) |
- (R128_ALPHA_BLEND_ZERO << R128_ALPHA_BLEND_DST_SHIFT) |
- R128_ALPHA_TEST_ALWAYS);
-
- rmesa->setup.texture_clr_cmp_clr_c = 0x00000000;
- rmesa->setup.texture_clr_cmp_msk_c = 0xffffffff;
-
- rmesa->setup.fog_color_c = 0x00000000;
-
- rmesa->setup.pm4_vc_fpu_setup = (R128_FRONT_DIR_CCW |
- R128_BACKFACE_SOLID |
- R128_FRONTFACE_SOLID |
- R128_FPU_COLOR_GOURAUD |
- R128_FPU_SUB_PIX_4BITS |
- R128_FPU_MODE_3D |
- R128_TRAP_BITS_DISABLE |
- R128_XFACTOR_2 |
- R128_YFACTOR_2 |
- R128_FLAT_SHADE_VERTEX_OGL |
- R128_FPU_ROUND_TRUNCATE |
- R128_WM_SEL_8DW);
-
- rmesa->setup.setup_cntl = (R128_COLOR_GOURAUD |
- R128_PRIM_TYPE_TRI |
- R128_TEXTURE_ST_MULT_W |
- R128_STARTING_VERTEX_1 |
- R128_ENDING_VERTEX_3 |
- R128_SU_POLY_LINE_NOT_LAST |
- R128_SUB_PIX_4BITS);
-
- rmesa->setup.tex_size_pitch_c = 0x00000000;
- rmesa->setup.constant_color_c = 0x00ffffff;
-
- rmesa->setup.dp_write_mask = 0xffffffff;
- rmesa->setup.sten_ref_mask_c = 0xffff0000;
- rmesa->setup.plane_3d_mask_c = 0xffffffff;
-
- rmesa->setup.window_xy_offset = 0x00000000;
-
- rmesa->setup.scale_3d_cntl = (R128_SCALE_DITHER_TABLE |
- R128_TEX_CACHE_SIZE_FULL |
- R128_DITHER_INIT_RESET |
- R128_SCALE_3D_TEXMAP_SHADE |
- R128_SCALE_PIX_REPLICATE |
- R128_ALPHA_COMB_ADD_CLAMP |
- R128_FOG_VERTEX |
- (R128_ALPHA_BLEND_ONE << R128_ALPHA_BLEND_SRC_SHIFT) |
- (R128_ALPHA_BLEND_ZERO << R128_ALPHA_BLEND_DST_SHIFT) |
- R128_ALPHA_TEST_ALWAYS |
- R128_COMPOSITE_SHADOW_CMP_EQUAL |
- R128_TEX_MAP_ALPHA_IN_TEXTURE |
- R128_TEX_CACHE_LINE_SIZE_4QW);
-
- rmesa->new_state = R128_NEW_ALL;
-}
-
-/* Initialize the driver's state functions.
- */
-void r128DDInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = r128DDInvalidateState;
-
- ctx->Driver.ClearIndex = NULL;
- ctx->Driver.ClearColor = r128DDClearColor;
- ctx->Driver.DrawBuffer = r128DDDrawBuffer;
- ctx->Driver.ReadBuffer = r128DDReadBuffer;
-
- ctx->Driver.IndexMask = NULL;
- ctx->Driver.ColorMask = r128DDColorMask;
- ctx->Driver.AlphaFunc = r128DDAlphaFunc;
- ctx->Driver.BlendEquationSeparate = r128DDBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = r128DDBlendFuncSeparate;
- ctx->Driver.ClearDepth = r128DDClearDepth;
- ctx->Driver.CullFace = r128DDCullFace;
- ctx->Driver.FrontFace = r128DDFrontFace;
- ctx->Driver.DepthFunc = r128DDDepthFunc;
- ctx->Driver.DepthMask = r128DDDepthMask;
- ctx->Driver.Enable = r128DDEnable;
- ctx->Driver.Fogfv = r128DDFogfv;
- ctx->Driver.Hint = NULL;
- ctx->Driver.Lightfv = NULL;
- ctx->Driver.LightModelfv = r128DDLightModelfv;
- ctx->Driver.LogicOpcode = r128DDLogicOpCode;
- ctx->Driver.PolygonMode = NULL;
- ctx->Driver.PolygonStipple = r128DDPolygonStipple;
- ctx->Driver.RenderMode = r128DDRenderMode;
- ctx->Driver.Scissor = r128DDScissor;
- ctx->Driver.ShadeModel = r128DDShadeModel;
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
-
- ctx->Driver.DepthRange = r128DepthRange;
- ctx->Driver.Viewport = r128Viewport;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.h
deleted file mode 100644
index ac33853b1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_state.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.h,v 1.3 2001/01/08 01:07:21 martin Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#ifndef __R128_STATE_H__
-#define __R128_STATE_H__
-
-#include "r128_context.h"
-
-extern void r128DDInitState( r128ContextPtr rmesa );
-extern void r128DDInitStateFuncs( GLcontext *ctx );
-
-extern void r128DDUpdateState( GLcontext *ctx );
-extern void r128DDUpdateHWState( GLcontext *ctx );
-
-extern void r128UpdateWindow( GLcontext *ctx );
-
-extern void r128EmitHwStateLocked( r128ContextPtr rmesa );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.c
deleted file mode 100644
index 3b2d017c1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.c
+++ /dev/null
@@ -1,617 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.14 2002/11/05 17:46:08 tsi Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- * Brian Paul <brianp@valinux.com>
- */
-
-#include "r128_context.h"
-#include "r128_state.h"
-#include "r128_ioctl.h"
-#include "r128_tris.h"
-#include "r128_tex.h"
-#include "r128_texobj.h"
-
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "imports.h"
-#include "colormac.h"
-#include "texobj.h"
-
-#include "xmlpool.h"
-
-#define TEX_0 1
-#define TEX_1 2
-
-
-/**
- * Set the texture wrap modes. Currently \c GL_REPEAT, \c GL_CLAMP,
- * \c GL_CLAMP_TO_EDGE, and \c GL_MIRRORED_REPEAT are supported.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-static void r128SetTexWrap( r128TexObjPtr t, GLenum swrap, GLenum twrap )
-{
- t->setup.tex_cntl &= ~(R128_TEX_CLAMP_S_MASK | R128_TEX_CLAMP_T_MASK);
-
- switch ( swrap ) {
- case GL_CLAMP:
- t->setup.tex_cntl |= R128_TEX_CLAMP_S_BORDER_COLOR;
- break;
- case GL_CLAMP_TO_EDGE:
- t->setup.tex_cntl |= R128_TEX_CLAMP_S_CLAMP;
- break;
- case GL_REPEAT:
- t->setup.tex_cntl |= R128_TEX_CLAMP_S_WRAP;
- break;
- case GL_MIRRORED_REPEAT:
- t->setup.tex_cntl |= R128_TEX_CLAMP_S_MIRROR;
- break;
- }
-
- switch ( twrap ) {
- case GL_CLAMP:
- t->setup.tex_cntl |= R128_TEX_CLAMP_T_BORDER_COLOR;
- break;
- case GL_CLAMP_TO_EDGE:
- t->setup.tex_cntl |= R128_TEX_CLAMP_T_CLAMP;
- break;
- case GL_REPEAT:
- t->setup.tex_cntl |= R128_TEX_CLAMP_T_WRAP;
- break;
- case GL_MIRRORED_REPEAT:
- t->setup.tex_cntl |= R128_TEX_CLAMP_T_MIRROR;
- break;
- }
-}
-
-static void r128SetTexFilter( r128TexObjPtr t, GLenum minf, GLenum magf )
-{
- t->setup.tex_cntl &= ~(R128_MIN_BLEND_MASK | R128_MAG_BLEND_MASK);
-
- switch ( minf ) {
- case GL_NEAREST:
- t->setup.tex_cntl |= R128_MIN_BLEND_NEAREST;
- break;
- case GL_LINEAR:
- t->setup.tex_cntl |= R128_MIN_BLEND_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- t->setup.tex_cntl |= R128_MIN_BLEND_MIPNEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- t->setup.tex_cntl |= R128_MIN_BLEND_MIPLINEAR;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- t->setup.tex_cntl |= R128_MIN_BLEND_LINEARMIPNEAREST;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- t->setup.tex_cntl |= R128_MIN_BLEND_LINEARMIPLINEAR;
- break;
- }
-
- switch ( magf ) {
- case GL_NEAREST:
- t->setup.tex_cntl |= R128_MAG_BLEND_NEAREST;
- break;
- case GL_LINEAR:
- t->setup.tex_cntl |= R128_MAG_BLEND_LINEAR;
- break;
- }
-}
-
-static void r128SetTexBorderColor( r128TexObjPtr t, GLubyte c[4] )
-{
- t->setup.tex_border_color = r128PackColor( 4, c[0], c[1], c[2], c[3] );
-}
-
-
-static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj )
-{
- r128TexObjPtr t;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) texObj );
- }
-
- t = (r128TexObjPtr) CALLOC_STRUCT( r128_tex_obj );
- texObj->DriverData = t;
- if ( t != NULL ) {
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
-
- /* FIXME Something here to set initial values for other parts of
- * FIXME t->setup?
- */
-
- make_empty_list( (driTextureObject *) t );
-
- r128SetTexWrap( t, texObj->WrapS, texObj->WrapT );
- r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- r128SetTexBorderColor( t, texObj->_BorderChan );
- }
-
- return t;
-}
-
-
-/* Called by the _mesa_store_teximage[123]d() functions. */
-static const struct gl_texture_format *
-r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- const GLboolean do32bpt =
- ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 );
- const GLboolean force16bpt =
- ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 );
- (void) format;
- (void) type;
-
- switch ( internalFormat ) {
- /* non-sized formats with alpha */
- case GL_INTENSITY:
- case GL_COMPRESSED_INTENSITY:
- case GL_ALPHA:
- case GL_COMPRESSED_ALPHA:
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- if (do32bpt)
- return _dri_texformat_argb8888;
- else
- return _dri_texformat_argb4444;
-
- /* 16-bit formats with alpha */
- case GL_INTENSITY4:
- case GL_ALPHA4:
- case GL_LUMINANCE4_ALPHA4:
- case GL_RGBA2:
- case GL_RGBA4:
- return _dri_texformat_argb4444;
-
- /* 32-bit formats with alpha */
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_RGB5_A1:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- if (!force16bpt)
- return _dri_texformat_argb8888;
- else
- return _dri_texformat_argb4444;
-
- /* non-sized formats without alpha */
- case 1:
- case GL_LUMINANCE:
- case GL_COMPRESSED_LUMINANCE:
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- if (do32bpt)
- return _dri_texformat_argb8888;
- else
- return _dri_texformat_rgb565;
-
- /* 16-bit formats without alpha */
- case GL_LUMINANCE4:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- return _dri_texformat_rgb565;
-
- /* 32-bit formats without alpha */
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- if (!force16bpt)
- return _dri_texformat_argb8888;
- else
- return _dri_texformat_rgb565;
-
- /* color-indexed formats */
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return _dri_texformat_ci8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- default:
- _mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ );
- return NULL;
- }
-}
-
-
-static void r128TexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r128AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- }
-
- /* Note, this will call r128ChooseTextureFormat */
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, packing, texObj, texImage );
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void r128TexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r128AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
- return;
- }
- }
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void r128TexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( t ) {
- driSwapOutTextureObject( (driTextureObject *) t );
- }
- else {
- t = (driTextureObject *) r128AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
-
- /* Note, this will call r128ChooseTextureFormat */
- _mesa_store_teximage2d(ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void r128TexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r128AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void r128TexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- struct gl_texture_unit *texUnit;
- GLubyte c[4];
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
- }
-
- switch ( pname ) {
- case GL_TEXTURE_ENV_MODE:
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_ALPHA;
- break;
-
- case GL_TEXTURE_ENV_COLOR:
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- CLAMPED_FLOAT_TO_UBYTE( c[0], texUnit->EnvColor[0] );
- CLAMPED_FLOAT_TO_UBYTE( c[1], texUnit->EnvColor[1] );
- CLAMPED_FLOAT_TO_UBYTE( c[2], texUnit->EnvColor[2] );
- CLAMPED_FLOAT_TO_UBYTE( c[3], texUnit->EnvColor[3] );
- rmesa->env_color = r128PackColor( 4, c[0], c[1], c[2], c[3] );
- if ( rmesa->setup.constant_color_c != rmesa->env_color ) {
- FLUSH_BATCH( rmesa );
- rmesa->setup.constant_color_c = rmesa->env_color;
-
- /* More complex multitexture/multipass fallbacks for GL_BLEND
- * can be done later, but this allows a single pass GL_BLEND
- * in some cases (ie. Performer town demo). This is only
- * applicable to the regular Rage 128, as the Pro and M3 can
- * handle true single-pass GL_BLEND texturing.
- */
- rmesa->blend_flags &= ~R128_BLEND_ENV_COLOR;
- if ( R128_IS_PLAIN( rmesa ) &&
- rmesa->env_color != 0x00000000 &&
- rmesa->env_color != 0xff000000 &&
- rmesa->env_color != 0x00ffffff &&
- rmesa->env_color != 0xffffffff ) {
- rmesa->blend_flags |= R128_BLEND_ENV_COLOR;
- }
- }
- break;
-
- case GL_TEXTURE_LOD_BIAS:
- {
- u_int32_t t = rmesa->setup.tex_cntl_c;
- GLint bias;
- u_int32_t b;
-
- /* GTH: This isn't exactly correct, but gives good results up to a
- * certain point. It is better than completely ignoring the LOD
- * bias. Unfortunately there isn't much range in the bias, the
- * spec mentions strides that vary between 0.5 and 2.0 but these
- * numbers don't seem to relate the the GL LOD bias value at all.
- */
- if ( param[0] >= 1.0 ) {
- bias = -128;
- } else if ( param[0] >= 0.5 ) {
- bias = -64;
- } else if ( param[0] >= 0.25 ) {
- bias = 0;
- } else if ( param[0] >= 0.0 ) {
- bias = 63;
- } else {
- bias = 127;
- }
-
- b = (u_int32_t)bias & 0xff;
- t &= ~R128_LOD_BIAS_MASK;
- t |= (b << R128_LOD_BIAS_SHIFT);
-
- if ( rmesa->setup.tex_cntl_c != t ) {
- FLUSH_BATCH( rmesa );
- rmesa->setup.tex_cntl_c = t;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- }
- }
- break;
-
- default:
- return;
- }
-}
-
-
-static void r128TexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- r128TexObjPtr t = (r128TexObjPtr)tObj->DriverData;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
- }
-
- if ( ( target != GL_TEXTURE_2D ) && ( target != GL_TEXTURE_1D ) )
- return;
-
- switch ( pname ) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- if ( t->base.bound ) FLUSH_BATCH( rmesa );
- r128SetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- if ( t->base.bound ) FLUSH_BATCH( rmesa );
- r128SetTexWrap( t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- if ( t->base.bound ) FLUSH_BATCH( rmesa );
- r128SetTexBorderColor( t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative for R128. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- if ( t->base.bound ) FLUSH_BATCH( rmesa );
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-}
-
-static void r128BindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *) tObj,
- ctx->Texture.CurrentUnit );
- }
-
- assert( (target != GL_TEXTURE_2D && target != GL_TEXTURE_1D) ||
- (tObj->DriverData != NULL) );
-}
-
-
-static void r128DeleteTexture( GLcontext *ctx,
- struct gl_texture_object *tObj )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- driTextureObject * t = (driTextureObject *) tObj->DriverData;
-
- if ( t ) {
- if ( t->bound && rmesa ) {
- FLUSH_BATCH( rmesa );
- }
-
- driDestroyTextureObject( t );
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-r128NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- r128AllocTexObj( obj );
- return obj;
-}
-
-void r128InitTextureFuncs( struct dd_function_table *functions )
-{
- functions->TexEnv = r128TexEnv;
- functions->ChooseTextureFormat = r128ChooseTextureFormat;
- functions->TexImage1D = r128TexImage1D;
- functions->TexSubImage1D = r128TexSubImage1D;
- functions->TexImage2D = r128TexImage2D;
- functions->TexSubImage2D = r128TexSubImage2D;
- functions->TexParameter = r128TexParameter;
- functions->BindTexture = r128BindTexture;
- functions->NewTextureObject = r128NewTextureObject;
- functions->DeleteTexture = r128DeleteTexture;
- functions->IsTextureResident = driIsTextureResident;
-
- driInitTextureFormats();
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.h
deleted file mode 100644
index 54053b8b3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tex.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.7 2002/02/22 21:44:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#ifndef __R128_TEX_H__
-#define __R128_TEX_H__
-
-extern void r128UpdateTextureState( GLcontext *ctx );
-
-extern void r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t );
-
-extern void r128DestroyTexObj( r128ContextPtr rmesa, r128TexObjPtr t );
-
-extern void r128InitTextureFuncs( struct dd_function_table *functions );
-
-
-/* ================================================================
- * Color conversion macros:
- */
-
-#define R128PACKCOLOR332( r, g, b ) \
- (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6))
-
-#define R128PACKCOLOR1555( r, g, b, a ) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define R128PACKCOLOR565( r, g, b ) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define R128PACKCOLOR888( r, g, b ) \
- (((r) << 16) | ((g) << 8) | (b))
-
-#define R128PACKCOLOR8888( r, g, b, a ) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define R128PACKCOLOR4444( r, g, b, a ) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-static __inline__ u_int32_t r128PackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return R128PACKCOLOR565( r, g, b );
- case 4:
- return R128PACKCOLOR8888( r, g, b, a );
- default:
- return 0;
- }
-}
-
-#endif /* __R128_TEX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texmem.c
deleted file mode 100644
index d011a7567..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texmem.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texmem.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- * Brian Paul <brianp@valinux.com>
- */
-
-#include "r128_context.h"
-#include "r128_state.h"
-#include "r128_ioctl.h"
-#include "r128_tris.h"
-#include "r128_tex.h"
-
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "imports.h"
-
-#define TEX_0 1
-#define TEX_1 2
-
-
-/* Destroy hardware state associated with texture `t'.
- */
-void r128DestroyTexObj( r128ContextPtr rmesa, r128TexObjPtr t )
-{
- unsigned i;
-
-
- /* See if it was the driver's current object.
- */
-
- if ( rmesa != NULL )
- {
- for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ )
- {
- if ( t == rmesa->CurrentTexObj[ i ] ) {
- assert( t->base.bound & (1 << i) );
- rmesa->CurrentTexObj[ i ] = NULL;
- }
- }
- }
-}
-
-
-/**
- * Upload the texture image associated with texture \a t at the specified
- * level at the address relative to \a start.
- */
-static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
- GLint level,
- GLint x, GLint y, GLint width, GLint height )
-{
- struct gl_texture_image *image;
- int texelsPerDword = 0;
- int imageWidth, imageHeight;
- int remaining, rows;
- int format, dwords;
- u_int32_t pitch, offset;
- int i;
-
- /* Ensure we have a valid texture to upload */
- if ( ( level < 0 ) || ( level > R128_MAX_TEXTURE_LEVELS ) )
- return;
-
- image = t->base.tObj->Image[0][level];
- if ( !image )
- return;
-
- switch ( image->TexFormat->TexelBytes ) {
- case 1: texelsPerDword = 4; break;
- case 2: texelsPerDword = 2; break;
- case 4: texelsPerDword = 1; break;
- }
-
-#if 1
- /* FIXME: The subimage index calcs are wrong... */
- x = 0;
- y = 0;
- width = image->Width;
- height = image->Height;
-#endif
-
- imageWidth = image->Width;
- imageHeight = image->Height;
-
- format = t->textureFormat >> 16;
-
- /* The texel upload routines have a minimum width, so force the size
- * if needed.
- */
- if ( imageWidth < texelsPerDword ) {
- int factor;
-
- factor = texelsPerDword / imageWidth;
- imageWidth = texelsPerDword;
- imageHeight /= factor;
- if ( imageHeight == 0 ) {
- /* In this case, the texel converter will actually walk a
- * texel or two off the end of the image, but normal malloc
- * alignment should prevent it from ever causing a fault.
- */
- imageHeight = 1;
- }
- }
-
- /* We can't upload to a pitch less than 8 texels so we will need to
- * linearly upload all modified rows for textures smaller than this.
- * This makes the x/y/width/height different for the blitter and the
- * texture walker.
- */
- if ( imageWidth >= 8 ) {
- /* The texture walker and the blitter look identical */
- pitch = imageWidth >> 3;
- } else {
- int factor;
- int y2;
- int start, end;
-
- start = (y * imageWidth) & ~7;
- end = (y + height) * imageWidth;
-
- if ( end - start < 8 ) {
- /* Handle the case where the total number of texels
- * uploaded is < 8.
- */
- x = 0;
- y = start / 8;
- width = end - start;
- height = 1;
- } else {
- /* Upload some number of full 8 texel blit rows */
- factor = 8 / imageWidth;
-
- y2 = y + height - 1;
- y /= factor;
- y2 /= factor;
-
- x = 0;
- width = 8;
- height = y2 - y + 1;
- }
-
- /* Fixed pitch of 8 */
- pitch = 1;
- }
-
- dwords = width * height / texelsPerDword;
- offset = t->bufAddr + t->image[level - t->base.firstLevel].offset;
-
-#if ENABLE_PERF_BOXES
- /* Bump the performace counter */
- rmesa->c_textureBytes += (dwords << 2);
-#endif
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "r128UploadSubImage: %d,%d of %d,%d at %d,%d\n",
- width, height, image->Width, image->Height, x, y );
- fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x dwords: %d "
- "level: %d format: %x\n",
- (GLuint)offset, (GLuint)pitch, dwords, level, format );
- }
-
- /* Subdivide the texture if required */
- if ( dwords <= R128_BUFFER_MAX_DWORDS / 2 ) {
- rows = height;
- } else {
- rows = (R128_BUFFER_MAX_DWORDS * texelsPerDword) / (2 * width);
- }
-
- for ( i = 0, remaining = height ;
- remaining > 0 ;
- remaining -= rows, y += rows, i++ )
- {
- u_int32_t *dst;
- drmBufPtr buffer;
-
- assert(image->Data);
-
- height = MIN2(remaining, rows);
-
- /* Grab the indirect buffer for the texture blit */
- LOCK_HARDWARE( rmesa );
- buffer = r128GetBufferLocked( rmesa );
-
- dst = (u_int32_t *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET);
-
- /* Copy the next chunck of the texture image into the blit buffer */
- {
- const GLubyte *src = (const GLubyte *) image->Data +
- (y * image->Width + x) * image->TexFormat->TexelBytes;
- const GLuint bytes = width * height * image->TexFormat->TexelBytes;
- memcpy(dst, src, bytes);
- }
-
- r128FireBlitLocked( rmesa, buffer,
- offset, pitch, format,
- x, y, width, height );
- UNLOCK_HARDWARE( rmesa );
- }
-
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_MASKS;
-}
-
-
-/* Upload the texture images associated with texture `t'. This might
- * require removing our own and/or other client's texture objects to
- * make room for these images.
- */
-void r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t )
-{
- const GLint numLevels = t->base.lastLevel - t->base.firstLevel + 1;
- GLint i;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %p )\n",
- __FUNCTION__, (void *) rmesa->glCtx, (void *) t );
- }
-
- assert(t);
-
- LOCK_HARDWARE( rmesa );
-
- if ( !t->base.memBlock ) {
- int heap;
-
-
- heap = driAllocateTexture( rmesa->texture_heaps, rmesa->nr_heaps,
- (driTextureObject *) t );
- if ( heap == -1 ) {
- UNLOCK_HARDWARE( rmesa );
- return;
- }
-
- /* Set the base offset of the texture image */
- t->bufAddr = rmesa->r128Screen->texOffset[heap]
- + t->base.memBlock->ofs;
-
- /* Set texture offsets for each mipmap level */
- if ( t->setup.tex_cntl & R128_MIP_MAP_DISABLE ) {
- for ( i = 0 ; i < R128_MAX_TEXTURE_LEVELS ; i++ ) {
- t->setup.tex_offset[i] = t->bufAddr;
- }
- } else {
- for ( i = 0; i < numLevels; i++ ) {
- const int j = numLevels - i - 1;
- t->setup.tex_offset[j] = t->bufAddr + t->image[i].offset;
- }
- }
- }
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( (driTextureObject *) t );
- UNLOCK_HARDWARE( rmesa );
-
- /* Upload any images that are new */
- if ( t->base.dirty_images[0] ) {
- for ( i = 0 ; i < numLevels; i++ ) {
- const GLint j = t->base.firstLevel + i; /* the texObj's level */
- if ( t->base.dirty_images[0] & (1 << j) ) {
- uploadSubImage( rmesa, t, j, 0, 0,
- t->image[i].width, t->image[i].height );
- }
- }
-
- rmesa->setup.tex_cntl_c |= R128_TEX_CACHE_FLUSH;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
- t->base.dirty_images[0] = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texobj.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texobj.h
deleted file mode 100644
index 282e88714..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texobj.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h,v 1.5 2002/02/22 21:44:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef _R128_TEXOBJ_H_
-#define _R128_TEXOBJ_H_
-
-#include "mm.h"
-
-/* Individual texture image information.
- */
-typedef struct {
- GLuint offset; /* Relative to local texture space */
- GLuint width;
- GLuint height;
-} r128TexImage;
-
-typedef struct r128_tex_obj r128TexObj, *r128TexObjPtr;
-
-/* Texture object in locally shared texture space.
- */
-struct r128_tex_obj {
- driTextureObject base;
-
- u_int32_t bufAddr; /* Offset to start of locally
- shared texture block */
-
- GLuint age;
- r128TexImage image[R128_MAX_TEXTURE_LEVELS]; /* Image data for all
- mipmap levels */
-
- u_int32_t textureFormat; /* Actual hardware format */
-
- drm_r128_texture_regs_t setup; /* Setup regs for texture */
-};
-
-#endif /* _R128_TEXOBJ_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texstate.c
deleted file mode 100644
index c22323b68..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_texstate.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 1999, 2000 ATI Technologies Inc. and 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
-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
-ATI, PRECISION INSIGHT 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:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- * Brian Paul <brianp@valinux.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-
-#include "r128_context.h"
-#include "r128_state.h"
-#include "r128_ioctl.h"
-#include "r128_tris.h"
-#include "r128_tex.h"
-
-
-static void r128SetTexImages( r128ContextPtr rmesa,
- const struct gl_texture_object *tObj )
-{
- r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData;
- struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- int log2Pitch, log2Height, log2Size, log2MinSize;
- int totalSize;
- int i;
- GLint firstLevel, lastLevel;
-
- assert(t);
- assert(baseImage);
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API )
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) tObj );
-
- switch (baseImage->TexFormat->MesaFormat) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
- t->textureFormat = R128_DATATYPE_ARGB8888;
- break;
- case MESA_FORMAT_ARGB4444:
- case MESA_FORMAT_ARGB4444_REV:
- t->textureFormat = R128_DATATYPE_ARGB4444;
- break;
- case MESA_FORMAT_RGB565:
- case MESA_FORMAT_RGB565_REV:
- t->textureFormat = R128_DATATYPE_RGB565;
- break;
- case MESA_FORMAT_RGB332:
- t->textureFormat = R128_DATATYPE_RGB8;
- break;
- case MESA_FORMAT_CI8:
- t->textureFormat = R128_DATATYPE_CI8;
- break;
- case MESA_FORMAT_YCBCR:
- t->textureFormat = R128_DATATYPE_YVYU422;
- break;
- case MESA_FORMAT_YCBCR_REV:
- t->textureFormat = R128_DATATYPE_VYUY422;
- break;
- default:
- _mesa_problem(rmesa->glCtx, "Bad texture format in %s", __FUNCTION__);
- };
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
-
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
- firstLevel = t->base.firstLevel;
- lastLevel = t->base.lastLevel;
-
- log2Pitch = tObj->Image[0][firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][firstLevel]->HeightLog2;
- log2Size = MAX2(log2Pitch, log2Height);
- log2MinSize = log2Size;
-
- t->base.dirty_images[0] = 0;
- totalSize = 0;
- for ( i = firstLevel; i <= lastLevel; i++ ) {
- const struct gl_texture_image *texImage;
-
- texImage = tObj->Image[0][i];
- if ( !texImage || !texImage->Data ) {
- lastLevel = i - 1;
- break;
- }
-
- log2MinSize = texImage->MaxLog2;
-
- t->image[i - firstLevel].offset = totalSize;
- t->image[i - firstLevel].width = tObj->Image[0][i]->Width;
- t->image[i - firstLevel].height = tObj->Image[0][i]->Height;
-
- t->base.dirty_images[0] |= (1 << i);
-
- totalSize += (tObj->Image[0][i]->Height *
- tObj->Image[0][i]->Width *
- tObj->Image[0][i]->TexFormat->TexelBytes);
-
- /* Offsets must be 32-byte aligned for host data blits and tiling */
- totalSize = (totalSize + 31) & ~31;
- }
-
- t->base.totalSize = totalSize;
- t->base.firstLevel = firstLevel;
- t->base.lastLevel = lastLevel;
-
- /* Set the texture format */
- t->setup.tex_cntl &= ~(0xf << 16);
- t->setup.tex_cntl |= t->textureFormat;
-
- t->setup.tex_combine_cntl = 0x00000000; /* XXX is this right? */
-
- t->setup.tex_size_pitch = ((log2Pitch << R128_TEX_PITCH_SHIFT) |
- (log2Size << R128_TEX_SIZE_SHIFT) |
- (log2Height << R128_TEX_HEIGHT_SHIFT) |
- (log2MinSize << R128_TEX_MIN_SIZE_SHIFT));
-
- for ( i = 0 ; i < R128_MAX_TEXTURE_LEVELS ; i++ ) {
- t->setup.tex_offset[i] = 0x00000000;
- }
-
- if (firstLevel == lastLevel)
- t->setup.tex_cntl |= R128_MIP_MAP_DISABLE;
- else
- t->setup.tex_cntl &= ~R128_MIP_MAP_DISABLE;
-
- /* FYI: r128UploadTexImages( rmesa, t ); used to be called here */
-}
-
-
-/* ================================================================
- * Texture combine functions
- */
-
-#define COLOR_COMB_DISABLE (R128_COMB_DIS | \
- R128_COLOR_FACTOR_TEX)
-#define COLOR_COMB_COPY_INPUT (R128_COMB_COPY_INP | \
- R128_COLOR_FACTOR_TEX)
-#define COLOR_COMB_MODULATE (R128_COMB_MODULATE | \
- R128_COLOR_FACTOR_TEX)
-#define COLOR_COMB_MODULATE_NTEX (R128_COMB_MODULATE | \
- R128_COLOR_FACTOR_NTEX)
-#define COLOR_COMB_ADD (R128_COMB_ADD | \
- R128_COLOR_FACTOR_TEX)
-#define COLOR_COMB_BLEND_TEX (R128_COMB_BLEND_TEXTURE | \
- R128_COLOR_FACTOR_TEX)
-/* Rage 128 Pro/M3 only! */
-#define COLOR_COMB_BLEND_COLOR (R128_COMB_MODULATE2X | \
- R128_COMB_FCN_MSB | \
- R128_COLOR_FACTOR_CONST_COLOR)
-
-#define ALPHA_COMB_DISABLE (R128_COMB_ALPHA_DIS | \
- R128_ALPHA_FACTOR_TEX_ALPHA)
-#define ALPHA_COMB_COPY_INPUT (R128_COMB_ALPHA_COPY_INP | \
- R128_ALPHA_FACTOR_TEX_ALPHA)
-#define ALPHA_COMB_MODULATE (R128_COMB_ALPHA_MODULATE | \
- R128_ALPHA_FACTOR_TEX_ALPHA)
-#define ALPHA_COMB_MODULATE_NTEX (R128_COMB_ALPHA_MODULATE | \
- R128_ALPHA_FACTOR_NTEX_ALPHA)
-#define ALPHA_COMB_ADD (R128_COMB_ALPHA_ADD | \
- R128_ALPHA_FACTOR_TEX_ALPHA)
-
-#define INPUT_INTERP (R128_INPUT_FACTOR_INT_COLOR | \
- R128_INP_FACTOR_A_INT_ALPHA)
-#define INPUT_PREVIOUS (R128_INPUT_FACTOR_PREV_COLOR | \
- R128_INP_FACTOR_A_PREV_ALPHA)
-
-static GLboolean r128UpdateTextureEnv( GLcontext *ctx, int unit )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLint source = rmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
- GLuint combine;
-
- if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %p, %d )\n",
- __FUNCTION__, (void *) ctx, unit );
- }
-
- if ( unit == 0 ) {
- combine = INPUT_INTERP;
- } else {
- combine = INPUT_PREVIOUS;
- }
-
- /* Set the texture environment state */
- switch ( texUnit->EnvMode ) {
- case GL_REPLACE:
- switch ( format ) {
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- combine |= (COLOR_COMB_DISABLE | /* C = Ct */
- ALPHA_COMB_DISABLE); /* A = At */
- break;
- case GL_RGB:
- case GL_LUMINANCE:
- combine |= (COLOR_COMB_DISABLE | /* C = Ct */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
- case GL_ALPHA:
- combine |= (COLOR_COMB_COPY_INPUT | /* C = Cf */
- ALPHA_COMB_DISABLE); /* A = At */
- break;
- case GL_COLOR_INDEX:
- default:
- return GL_FALSE;
- }
- break;
-
- case GL_MODULATE:
- switch ( format ) {
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- combine |= (COLOR_COMB_MODULATE | /* C = CfCt */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
- case GL_RGB:
- case GL_LUMINANCE:
- combine |= (COLOR_COMB_MODULATE | /* C = CfCt */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
- case GL_ALPHA:
- combine |= (COLOR_COMB_COPY_INPUT | /* C = Cf */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
- case GL_COLOR_INDEX:
- default:
- return GL_FALSE;
- }
- break;
-
- case GL_DECAL:
- switch ( format ) {
- case GL_RGBA:
- combine |= (COLOR_COMB_BLEND_TEX | /* C = Cf(1-At)+CtAt */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
- case GL_RGB:
- combine |= (COLOR_COMB_DISABLE | /* C = Ct */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- /* Undefined behaviour - just copy the incoming fragment */
- combine |= (COLOR_COMB_COPY_INPUT | /* C = undefined */
- ALPHA_COMB_COPY_INPUT); /* A = undefined */
- break;
- case GL_COLOR_INDEX:
- default:
- return GL_FALSE;
- }
- break;
-
- case GL_BLEND:
- /* Rage 128 Pro and M3 can handle GL_BLEND texturing.
- */
- if ( !R128_IS_PLAIN( rmesa ) ) {
- /* XXX this hasn't been fully tested, I don't have a Pro card. -BP */
- switch ( format ) {
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- combine |= (COLOR_COMB_BLEND_COLOR | /* C = Cf(1-Ct)+CcCt */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
-
- case GL_RGB:
- case GL_LUMINANCE:
- combine |= (COLOR_COMB_BLEND_COLOR | /* C = Cf(1-Ct)+CcCt */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
-
- case GL_ALPHA:
- combine |= (COLOR_COMB_COPY_INPUT | /* C = Cf */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
-
- case GL_INTENSITY:
- /* GH: We could be smarter about this... */
- switch ( rmesa->env_color & 0xff000000 ) {
- case 0x00000000:
- combine |= (COLOR_COMB_BLEND_COLOR | /* C = Cf(1-It)+CcIt */
- ALPHA_COMB_MODULATE_NTEX); /* A = Af(1-It) */
- default:
- combine |= (COLOR_COMB_MODULATE | /* C = fallback */
- ALPHA_COMB_MODULATE); /* A = fallback */
- return GL_FALSE;
- }
- break;
-
- case GL_COLOR_INDEX:
- default:
- return GL_FALSE;
- }
- break;
- }
-
- /* Rage 128 has to fake some cases of GL_BLEND, otherwise fallback
- * to software rendering.
- */
- if ( rmesa->blend_flags ) {
- return GL_FALSE;
- }
- switch ( format ) {
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- switch ( rmesa->env_color & 0x00ffffff ) {
- case 0x00000000:
- combine |= (COLOR_COMB_MODULATE_NTEX | /* C = Cf(1-Ct) */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
-#if 0
- /* This isn't right - BP */
- case 0x00ffffff:
- if ( unit == 0 ) {
- combine |= (COLOR_COMB_MODULATE_NTEX | /* C = Cf(1-Ct) */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- } else {
- combine |= (COLOR_COMB_ADD | /* C = Cf+Ct */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- }
- break;
-#endif
- default:
- combine |= (COLOR_COMB_MODULATE | /* C = fallback */
- ALPHA_COMB_MODULATE); /* A = fallback */
- return GL_FALSE;
- }
- break;
- case GL_RGB:
- case GL_LUMINANCE:
- switch ( rmesa->env_color & 0x00ffffff ) {
- case 0x00000000:
- combine |= (COLOR_COMB_MODULATE_NTEX | /* C = Cf(1-Ct) */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
-#if 0
- /* This isn't right - BP */
- case 0x00ffffff:
- if ( unit == 0 ) {
- combine |= (COLOR_COMB_MODULATE_NTEX | /* C = Cf(1-Ct) */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- } else {
- combine |= (COLOR_COMB_ADD | /* C = Cf+Ct */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- }
- break;
-#endif
- default:
- combine |= (COLOR_COMB_MODULATE | /* C = fallback */
- ALPHA_COMB_COPY_INPUT); /* A = fallback */
- return GL_FALSE;
- }
- break;
- case GL_ALPHA:
- if ( unit == 0 ) {
- combine |= (COLOR_COMB_COPY_INPUT | /* C = Cf */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- } else {
- combine |= (COLOR_COMB_COPY_INPUT | /* C = Cf */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- }
- break;
- case GL_INTENSITY:
- switch ( rmesa->env_color & 0x00ffffff ) {
- case 0x00000000:
- combine |= COLOR_COMB_MODULATE_NTEX; /* C = Cf(1-It) */
- break;
-#if 0
- /* This isn't right - BP */
- case 0x00ffffff:
- if ( unit == 0 ) {
- combine |= COLOR_COMB_MODULATE_NTEX; /* C = Cf(1-It) */
- } else {
- combine |= COLOR_COMB_ADD; /* C = Cf+It */
- }
- break;
-#endif
- default:
- combine |= (COLOR_COMB_MODULATE | /* C = fallback */
- ALPHA_COMB_MODULATE); /* A = fallback */
- return GL_FALSE;
- }
- switch ( rmesa->env_color & 0xff000000 ) {
- case 0x00000000:
- combine |= ALPHA_COMB_MODULATE_NTEX; /* A = Af(1-It) */
- break;
-#if 0
- /* This isn't right - BP */
- case 0xff000000:
- if ( unit == 0 ) {
- combine |= ALPHA_COMB_MODULATE_NTEX; /* A = Af(1-It) */
- } else {
- combine |= ALPHA_COMB_ADD; /* A = Af+It */
- }
- break;
-#endif
- default:
- combine |= (COLOR_COMB_MODULATE | /* C = fallback */
- ALPHA_COMB_MODULATE); /* A = fallback */
- return GL_FALSE;
- }
- break;
- case GL_COLOR_INDEX:
- default:
- return GL_FALSE;
- }
- break;
-
- case GL_ADD:
- switch ( format ) {
- case GL_RGBA:
- case GL_LUMINANCE_ALPHA:
- combine |= (COLOR_COMB_ADD | /* C = Cf+Ct */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
- case GL_RGB:
- case GL_LUMINANCE:
- combine |= (COLOR_COMB_ADD | /* C = Cf+Ct */
- ALPHA_COMB_COPY_INPUT); /* A = Af */
- break;
- case GL_ALPHA:
- combine |= (COLOR_COMB_COPY_INPUT | /* C = Cf */
- ALPHA_COMB_MODULATE); /* A = AfAt */
- break;
- case GL_INTENSITY:
- combine |= (COLOR_COMB_ADD | /* C = Cf+Ct */
- ALPHA_COMB_ADD); /* A = Af+At */
- break;
- case GL_COLOR_INDEX:
- default:
- return GL_FALSE;
- }
- break;
-
- default:
- return GL_FALSE;
- }
-
- if ( rmesa->tex_combine[unit] != combine ) {
- rmesa->tex_combine[unit] = combine;
- rmesa->dirty |= R128_UPLOAD_TEX0 << unit;
- }
- return GL_TRUE;
-}
-
-static void disable_tex( GLcontext *ctx, int unit )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
-
- if ( rmesa->CurrentTexObj[unit] ) {
- rmesa->CurrentTexObj[unit]->base.bound &= ~(1 << unit);
- rmesa->CurrentTexObj[unit] = NULL;
- }
-
- rmesa->setup.tex_cntl_c &= ~(R128_TEXMAP_ENABLE << unit);
- rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK <<
- (R128_SEC_TEX_SIZE_PITCH_SHIFT * unit));
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
-
- /* If either texture unit is disabled, then multitexturing is not
- * happening.
- */
-
- rmesa->blend_flags &= ~R128_BLEND_MULTITEX;
-}
-
-static GLboolean enable_tex_2d( GLcontext *ctx, int unit )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- const int source = rmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData;
-
- /* Need to load the 2d images associated with this unit.
- */
- if ( t->base.dirty_images[0] ) {
- /* FIXME: For Radeon, RADEON_FIREVERTICES is called here. Should
- * FIXME: something similar be done for R128?
- */
- /* FLUSH_BATCH( rmesa ); */
-
- r128SetTexImages( rmesa, tObj );
- r128UploadTexImages( rmesa, t );
- if ( !t->base.memBlock )
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean update_tex_common( GLcontext *ctx, int unit )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- const int source = rmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
- const struct gl_texture_object *tObj = texUnit->_Current;
- r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData;
-
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- return GL_FALSE;
- }
-
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if ( rmesa->CurrentTexObj[unit] != t ) {
- if ( rmesa->CurrentTexObj[unit] != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->CurrentTexObj[unit]->base.bound &=
- ~(1UL << unit);
- }
-
- rmesa->CurrentTexObj[unit] = t;
- t->base.bound |= (1UL << unit);
- rmesa->dirty |= R128_UPLOAD_TEX0 << unit;
-
- driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked! */
- }
-
- /* FIXME: We need to update the texture unit if any texture parameters have
- * changed, but this texture was already bound. This could be changed to
- * work like the Radeon driver where the texture object has it's own
- * dirty state flags
- */
- rmesa->dirty |= R128_UPLOAD_TEX0 << unit;
-
- /* register setup */
- rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK <<
- (R128_SEC_TEX_SIZE_PITCH_SHIFT * unit));
-
- if ( unit == 0 ) {
- rmesa->setup.tex_cntl_c |= R128_TEXMAP_ENABLE;
- rmesa->setup.tex_size_pitch_c |= t->setup.tex_size_pitch << 0;
- rmesa->setup.scale_3d_cntl &= ~R128_TEX_CACHE_SPLIT;
- t->setup.tex_cntl &= ~R128_SEC_SELECT_SEC_ST;
- }
- else {
- rmesa->setup.tex_cntl_c |= R128_SEC_TEXMAP_ENABLE;
- rmesa->setup.tex_size_pitch_c |= t->setup.tex_size_pitch << 16;
- rmesa->setup.scale_3d_cntl |= R128_TEX_CACHE_SPLIT;
- t->setup.tex_cntl |= R128_SEC_SELECT_SEC_ST;
-
- /* If the second TMU is enabled, then multitexturing is happening.
- */
- if ( R128_IS_PLAIN( rmesa ) )
- rmesa->blend_flags |= R128_BLEND_MULTITEX;
- }
-
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
-
-
- /* FIXME: The Radeon has some cached state so that it can avoid calling
- * FIXME: UpdateTextureEnv in some cases. Is that possible here?
- */
- return r128UpdateTextureEnv( ctx, unit );
-}
-
-static GLboolean updateTextureUnit( GLcontext *ctx, int unit )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- const int source = rmesa->tmu_source[unit];
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
-
-
- if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) {
- return (enable_tex_2d( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
- else if ( texUnit->_ReallyEnabled ) {
- return GL_FALSE;
- }
- else {
- disable_tex( ctx, unit );
- return GL_TRUE;
- }
-}
-
-
-void r128UpdateTextureState( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLboolean ok;
-
-
- /* This works around a quirk with the R128 hardware. If only OpenGL
- * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The
- * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used.
- */
-
- rmesa->tmu_source[0] = 0;
- rmesa->tmu_source[1] = 1;
-
- if ((ctx->Texture._EnabledUnits & 0x03) == 0x02) {
- /* only texture 1 enabled */
- rmesa->tmu_source[0] = 1;
- rmesa->tmu_source[1] = 0;
- }
-
- ok = (updateTextureUnit( ctx, 0 ) &&
- updateTextureUnit( ctx, 1 ));
-
- FALLBACK( rmesa, R128_FALLBACK_TEXTURE, !ok );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.c
deleted file mode 100644
index c12ad0ccb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.c
+++ /dev/null
@@ -1,769 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.8 2002/10/30 12:51:43 alanh Exp $ */ /* -*- c-basic-offset: 3 -*- */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "r128_tris.h"
-#include "r128_state.h"
-#include "r128_tex.h"
-#include "r128_ioctl.h"
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- R128_CCE_VC_CNTL_PRIM_TYPE_POINT,
- R128_CCE_VC_CNTL_PRIM_TYPE_LINE,
- R128_CCE_VC_CNTL_PRIM_TYPE_LINE,
- R128_CCE_VC_CNTL_PRIM_TYPE_LINE,
- R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST,
- R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST,
- R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST,
- R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST,
- R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST,
- R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST,
-};
-
-static void r128RasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void r128RenderPrimitive( GLcontext *ctx, GLenum prim );
-
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#define HAVE_QUADS 0
-#define HAVE_LINES 1
-#define HAVE_POINTS 1
-#define HAVE_LE32_VERTS 1
-#define CTX_ARG r128ContextPtr rmesa
-#define GET_VERTEX_DWORDS() rmesa->vertex_size
-#define ALLOC_VERTS( n, size ) r128AllocDmaLow( rmesa, (n), (size) * 4 )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- r128ContextPtr rmesa = R128_CONTEXT(ctx); \
- const char *vertptr = rmesa->verts;
-#define VERT(x) (r128Vertex *)(vertptr + ((x) * vertsize * 4))
-#define VERTEX r128Vertex
-#undef TAG
-#define TAG(x) r128_##x
-#include "tnl_dd/t_dd_triemit.h"
-#undef TAG
-#undef LOCAL_VARS
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- rmesa->draw_tri( rmesa, a, b, c ); \
- else \
- r128_triangle( rmesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- rmesa->draw_tri( rmesa, a, b, d ); \
- rmesa->draw_tri( rmesa, b, c, d ); \
- } else \
- r128_quad( rmesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- rmesa->draw_line( rmesa, v0, v1 ); \
- else \
- r128_line( rmesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- rmesa->draw_point( rmesa, v0 ); \
- else \
- r128_point( rmesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define R128_OFFSET_BIT 0x01
-#define R128_TWOSIDE_BIT 0x02
-#define R128_UNFILLED_BIT 0x04
-#define R128_FALLBACK_BIT 0x08
-#define R128_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[R128_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & R128_FALLBACK_BIT)
-#define DO_OFFSET (IND & R128_OFFSET_BIT)
-#define DO_UNFILLED (IND & R128_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & R128_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX r128Vertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE rmesa->depth_scale
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (rmesa->verts + (e * rmesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- r128_color_t *color = (r128_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v0, c ) \
-do { \
- if (havespec) { \
- r128_color_t *spec = (r128_color_t *)&((v0)->ui[specoffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (havespec) { \
- r128_color_t *spec0 = (r128_color_t *)&((v0)->ui[specoffset]); \
- r128_color_t *spec1 = (r128_color_t *)&((v1)->ui[specoffset]); \
- spec0->red = spec1->red; \
- spec0->green = spec1->green; \
- spec0->blue = spec1->blue; \
- } \
-} while (0)
-
-/* These don't need LE32_TO_CPU() as they are used to save and restore
- * colors which are already in the correct format.
- */
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[specoffset] = spec[idx]
-
-
-#define LOCAL_VARS(n) \
- r128ContextPtr rmesa = R128_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = rmesa->coloroffset; \
- GLuint specoffset = rmesa->specoffset; \
- GLboolean havespec = (rmesa->specoffset != 0); \
- (void) color; (void) spec; (void) specoffset; \
- (void) coloroffset; (void) havespec;
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (rmesa->hw_primitive != hw_prim[x]) \
- r128RasterPrimitive( ctx, hw_prim[x] )
-#define RENDER_PRIMITIVE rmesa->render_primitive
-#define IND R128_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_OFFSET_BIT|R128_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_OFFSET_BIT|R128_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_OFFSET_BIT|R128_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_OFFSET_BIT|R128_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_UNFILLED_BIT|R128_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_OFFSET_BIT|R128_UNFILLED_BIT|R128_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_UNFILLED_BIT|R128_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R128_TWOSIDE_BIT|R128_OFFSET_BIT|R128_UNFILLED_BIT| \
- R128_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-r128_fallback_tri( r128ContextPtr rmesa,
- r128Vertex *v0,
- r128Vertex *v1,
- r128Vertex *v2 )
-{
- GLcontext *ctx = rmesa->glCtx;
- SWvertex v[3];
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swsetup_Translate( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-r128_fallback_line( r128ContextPtr rmesa,
- r128Vertex *v0,
- r128Vertex *v1 )
-{
- GLcontext *ctx = rmesa->glCtx;
- SWvertex v[2];
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-r128_fallback_point( r128ContextPtr rmesa,
- r128Vertex *v0 )
-{
- GLcontext *ctx = rmesa->glCtx;
- SWvertex v[1];
- _swsetup_Translate( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- r128_point( rmesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- r128_line( rmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- r128_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- r128_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) do { \
- if (0) fprintf(stderr, "%s\n", __FUNCTION__); \
- r128RenderPrimitive( ctx, x ); \
-} while (0)
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- r128ContextPtr rmesa = R128_CONTEXT(ctx); \
- const GLuint vertsize = rmesa->vertex_size; \
- const char *vertptr = (char *)rmesa->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) r128_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) r128_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH)
-#define TRI_FALLBACK (DD_TRI_SMOOTH)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-#define _R128_NEW_RENDER_STATE (ANY_FALLBACK_FLAGS | ANY_RASTER_FLAGS)
-
-static void r128ChooseRenderState(GLcontext *ctx)
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) {
- rmesa->draw_point = r128_point;
- rmesa->draw_line = r128_line;
- rmesa->draw_tri = r128_triangle;
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R128_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= R128_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= R128_UNFILLED_BIT;
- }
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)) {
- if (flags & POINT_FALLBACK) rmesa->draw_point = r128_fallback_point;
- if (flags & LINE_FALLBACK) rmesa->draw_line = r128_fallback_line;
- if (flags & TRI_FALLBACK) rmesa->draw_tri = r128_fallback_tri;
- index |= R128_FALLBACK_BIT;
- }
- }
-
- if (index != rmesa->RenderIndex) {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = r128_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = r128_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = r128_fast_clipped_poly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- }
-
- rmesa->RenderIndex = index;
- }
-}
-
-/**********************************************************************/
-/* Validate state at pipeline start */
-/**********************************************************************/
-
-static void r128RunPipeline( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- if (rmesa->new_state || rmesa->NewGLState & _NEW_TEXTURE)
- r128DDUpdateHWState( ctx );
-
- if (!rmesa->Fallback && rmesa->NewGLState) {
- if (rmesa->NewGLState & _R128_NEW_RENDER_STATE)
- r128ChooseRenderState( ctx );
-
- rmesa->NewGLState = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-/* This is called when Mesa switches between rendering triangle
- * primitives (such as GL_POLYGON, GL_QUADS, GL_TRIANGLE_STRIP, etc),
- * and lines, points and bitmaps.
- *
- * As the r128 uses triangles to render lines and points, it is
- * necessary to turn off hardware culling when rendering these
- * primitives.
- */
-
-static void r128RasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- rmesa->setup.dp_gui_master_cntl_c &= ~R128_GMC_BRUSH_NONE;
-
- if ( ctx->Polygon.StippleFlag && hwprim == GL_TRIANGLES ) {
- rmesa->setup.dp_gui_master_cntl_c |= R128_GMC_BRUSH_32x32_MONO_FG_LA;
- }
- else {
- rmesa->setup.dp_gui_master_cntl_c |= R128_GMC_BRUSH_SOLID_COLOR;
- }
-
- rmesa->new_state |= R128_NEW_CONTEXT;
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
-
- if (rmesa->hw_primitive != hwprim) {
- FLUSH_BATCH( rmesa );
- rmesa->hw_primitive = hwprim;
- }
-}
-
-static void r128RenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint hw = hw_prim[prim];
- rmesa->render_primitive = prim;
- if (prim >= GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
- r128RasterPrimitive( ctx, hw );
-}
-
-#define EMIT_ATTR( ATTR, STYLE, VF, SIZE ) \
-do { \
- rmesa->vertex_attrs[rmesa->vertex_attr_count].attrib = (ATTR); \
- rmesa->vertex_attrs[rmesa->vertex_attr_count].format = (STYLE); \
- rmesa->vertex_attr_count++; \
- vc_frmt |= (VF); \
- offset += (SIZE); \
-} while (0)
-
-#define EMIT_PAD( SIZE ) \
-do { \
- rmesa->vertex_attrs[rmesa->vertex_attr_count].attrib = 0; \
- rmesa->vertex_attrs[rmesa->vertex_attr_count].format = EMIT_PAD; \
- rmesa->vertex_attrs[rmesa->vertex_attr_count].offset = (SIZE); \
- rmesa->vertex_attr_count++; \
- offset += (SIZE); \
-} while (0)
-
-static void r128RenderStart( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLuint vc_frmt = 0;
- GLboolean fallback_projtex = GL_FALSE;
- GLuint offset = 0;
-
- /* Important: */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- rmesa->vertex_attr_count = 0;
- rmesa->specoffset = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if ( index & _TNL_BITS_TEX_ANY )
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, R128_CCE_VC_FRMT_RHW, 16 );
- else
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 12 );
-
- rmesa->coloroffset = offset;
-#if MESA_LITTLE_ENDIAN
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA,
- R128_CCE_VC_FRMT_DIFFUSE_ARGB, 4 );
-#else
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ARGB,
- R128_CCE_VC_FRMT_DIFFUSE_ARGB, 4 );
-#endif
-
- if ( index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG) ) {
-#if MESA_LITTLE_ENDIAN
- if ( index & _TNL_BIT_COLOR1) {
- rmesa->specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB,
- R128_CCE_VC_FRMT_SPEC_FRGB, 3 );
- } else
- EMIT_PAD( 3 );
-
- if (index & _TNL_BIT_FOG)
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R128_CCE_VC_FRMT_SPEC_FRGB,
- 1 );
- else
- EMIT_PAD( 1 );
-#else
- if (index & _TNL_BIT_FOG)
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, R128_CCE_VC_FRMT_SPEC_FRGB,
- 1 );
- else
- EMIT_PAD( 1 );
-
- if ( index & _TNL_BIT_COLOR1) {
- rmesa->specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB,
- R128_CCE_VC_FRMT_SPEC_FRGB, 3 );
- } else
- EMIT_PAD( 3 );
-#endif
- }
-
- if ( index & _TNL_BIT_TEX(rmesa->tmu_source[0]) ) {
- if ( VB->TexCoordPtr[rmesa->tmu_source[0]]->size > 2 )
- fallback_projtex = GL_TRUE;
- EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, R128_CCE_VC_FRMT_S_T, 8 );
- }
- if ( index & _TNL_BIT_TEX(rmesa->tmu_source[1]) ) {
- if ( VB->TexCoordPtr[rmesa->tmu_source[1]]->size > 2 )
- fallback_projtex = GL_TRUE;
- EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, R128_CCE_VC_FRMT_S2_T2, 8 );
- }
-
- /* projective textures are not supported by the hardware */
- FALLBACK( rmesa, R128_FALLBACK_PROJTEX, fallback_projtex );
-
- /* Only need to change the vertex emit code if there has been a
- * statechange to a TNL index.
- */
- if ( index != rmesa->tnl_state ) {
- FLUSH_BATCH( rmesa );
- rmesa->dirty |= R128_UPLOAD_CONTEXT;
-
- rmesa->vertex_size =
- _tnl_install_attrs( ctx,
- rmesa->vertex_attrs,
- rmesa->vertex_attr_count,
- rmesa->hw_viewport, 0 );
- rmesa->vertex_size >>= 2;
-
- rmesa->vertex_format = vc_frmt;
- }
-}
-
-static void r128RenderFinish( GLcontext *ctx )
-{
- if (R128_CONTEXT(ctx)->RenderIndex & R128_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static const char * const fallbackStrings[] = {
- "Texture mode",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "glReadBuffer",
- "glEnable(GL_STENCIL) without hw stencil buffer",
- "glRenderMode(selection or feedback)",
- "glLogicOp (mode != GL_COPY)",
- "GL_SEPARATE_SPECULAR_COLOR",
- "glBlendEquation(mode != ADD)",
- "glBlendFunc",
- "Projective texture",
- "Rasterization disable",
-};
-
-
-static const char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- GLuint oldfallback = rmesa->Fallback;
-
- if (mode) {
- rmesa->Fallback |= bit;
- if (oldfallback == 0) {
- FLUSH_BATCH( rmesa );
- _swsetup_Wakeup( ctx );
- rmesa->RenderIndex = ~0;
- if ( R128_DEBUG & DEBUG_VERBOSE_FALL ) {
- fprintf(stderr, "R128 begin rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
- else {
- rmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = r128RenderStart;
- tnl->Driver.Render.PrimitiveNotify = r128RenderPrimitive;
- tnl->Driver.Render.Finish = r128RenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_invalidate_vertex_state( ctx, ~0 );
- _tnl_invalidate_vertices( ctx, ~0 );
- _tnl_install_attrs( ctx,
- rmesa->vertex_attrs,
- rmesa->vertex_attr_count,
- rmesa->hw_viewport, 0 );
-
- rmesa->NewGLState |= _R128_NEW_RENDER_STATE;
- if ( R128_DEBUG & DEBUG_VERBOSE_FALL ) {
- fprintf(stderr, "R128 end rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void r128InitTriFuncs( GLcontext *ctx )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = r128RunPipeline;
- tnl->Driver.Render.Start = r128RenderStart;
- tnl->Driver.Render.Finish = r128RenderFinish;
- tnl->Driver.Render.PrimitiveNotify = r128RenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- (6 + 2 * ctx->Const.MaxTextureUnits) * sizeof(GLfloat) );
- rmesa->verts = (char *)tnl->clipspace.vertex_buf;
- rmesa->tnl_state = -1;
-
- rmesa->NewGLState |= _R128_NEW_RENDER_STATE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.h
deleted file mode 100644
index 755d3320b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/r128_tris.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.8 2002/10/30 12:51:43 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#ifndef __R128_TRIS_H__
-#define __R128_TRIS_H__
-
-#include "mtypes.h"
-
-extern void r128InitTriFuncs( GLcontext *ctx );
-
-
-extern void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( rmesa, bit, mode ) r128Fallback( rmesa->glCtx, bit, mode )
-
-
-#endif /* __R128_TRIS_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/pci_ids.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/pci_ids.h
deleted file mode 100644
index fe8b08787..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/pci_ids.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Rage128 M3 */
-#define PCI_DEVICE_ID_ATI_RAGE128_LE 0x4c45
-#define PCI_DEVICE_ID_ATI_RAGE128_LF 0x4c46
-/* Rage128 M4 */
-#define PCI_DEVICE_ID_ATI_RAGE128_MF 0x4d46
-#define PCI_DEVICE_ID_ATI_RAGE128_ML 0x4d4c
-/* Rage128 Pro GL */
-#define PCI_DEVICE_ID_ATI_RAGE128_PA 0x5041
-#define PCI_DEVICE_ID_ATI_RAGE128_PB 0x5042
-#define PCI_DEVICE_ID_ATI_RAGE128_PC 0x5043
-#define PCI_DEVICE_ID_ATI_RAGE128_PD 0x5044
-#define PCI_DEVICE_ID_ATI_RAGE128_PE 0x5045
-#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046
-/* Rage128 Pro VR */
-#define PCI_DEVICE_ID_ATI_RAGE128_PG 0x5047
-#define PCI_DEVICE_ID_ATI_RAGE128_PH 0x5048
-#define PCI_DEVICE_ID_ATI_RAGE128_PI 0x5049
-#define PCI_DEVICE_ID_ATI_RAGE128_PJ 0x504A
-#define PCI_DEVICE_ID_ATI_RAGE128_PK 0x504B
-#define PCI_DEVICE_ID_ATI_RAGE128_PL 0x504C
-#define PCI_DEVICE_ID_ATI_RAGE128_PM 0x504D
-#define PCI_DEVICE_ID_ATI_RAGE128_PN 0x504E
-#define PCI_DEVICE_ID_ATI_RAGE128_PO 0x504F
-#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050
-#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051
-#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052
-#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
-#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053
-#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054
-#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055
-#define PCI_DEVICE_ID_ATI_RAGE128_PV 0x5056
-#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057
-#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058
-/* Rage128 GL */
-#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245
-#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246
-/* Rage128 VR */
-#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245
-#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246
-#define PCI_DEVICE_ID_ATI_RAGE128_RG 0x5247
-#define PCI_DEVICE_ID_ATI_RAGE128_RK 0x524b
-#define PCI_DEVICE_ID_ATI_RAGE128_RL 0x524c
-#define PCI_DEVICE_ID_ATI_RAGE128_SE 0x5345
-#define PCI_DEVICE_ID_ATI_RAGE128_SF 0x5346
-#define PCI_DEVICE_ID_ATI_RAGE128_SG 0x5347
-#define PCI_DEVICE_ID_ATI_RAGE128_SH 0x5348
-#define PCI_DEVICE_ID_ATI_RAGE128_SK 0x534b
-#define PCI_DEVICE_ID_ATI_RAGE128_SL 0x534c
-#define PCI_DEVICE_ID_ATI_RAGE128_SM 0x534d
-#define PCI_DEVICE_ID_ATI_RAGE128_SN 0x534e
-/* Rage128 Pro Ultra */
-#define PCI_DEVICE_ID_ATI_RAGE128_TF 0x5446
-#define PCI_DEVICE_ID_ATI_RAGE128_TL 0x544C
-#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
-#define PCI_DEVICE_ID_ATI_RAGE128_TS 0x5453
-#define PCI_DEVICE_ID_ATI_RAGE128_TT 0x5454
-#define PCI_DEVICE_ID_ATI_RAGE128_TU 0x5455
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128.h
deleted file mode 100644
index ce98b1b91..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128.h
+++ /dev/null
@@ -1,465 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.24 2002/12/16 16:19:10 dawes Exp $ */
-/*
- * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
- * Precision Insight, Inc., Cedar Park, Texas, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, PRECISION INSIGHT, VA LINUX
- * SYSTEMS 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:
- * Rickard E. Faith <faith@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- */
-
-#ifndef _R128_H_
-#define _R128_H_
-
-#include "dri_util.h"
-
-#define R128_DEBUG 0 /* Turn off debugging output */
-#define R128_IDLE_RETRY 32 /* Fall out of idle loops after this count */
-#define R128_TIMEOUT 2000000 /* Fall out of wait loops after this count */
-#define R128_MMIOSIZE 0x4000
-
-#define R128_VBIOS_SIZE 0x00010000
-
-#if R128_DEBUG
-#define R128TRACE(x) \
- do { \
- ErrorF("(**) %s(%d): ", R128_NAME, pScrn->scrnIndex); \
- ErrorF x; \
- } while (0);
-#else
-#define R128TRACE(x)
-#endif
-
-
-/* Other macros */
-#define R128_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-#define R128_ALIGN(x,bytes) (((x) + ((bytes) - 1)) & ~((bytes) - 1))
-#define R128PTR(pScrn) ((R128InfoPtr)(pScrn)->driverPrivate)
-
-/**
- * \brief Chip families.
- */
-typedef enum {
- CHIP_FAMILY_UNKNOWN,
- CHIP_FAMILY_R128_PCI,
- CHIP_FAMILY_R128_AGP,
-} R128ChipFamily;
-
-typedef struct { /* All values in XCLKS */
- int ML; /* Memory Read Latency */
- int MB; /* Memory Burst Length */
- int Trcd; /* RAS to CAS delay */
- int Trp; /* RAS percentage */
- int Twr; /* Write Recovery */
- int CL; /* CAS Latency */
- int Tr2w; /* Read to Write Delay */
- int Rloop; /* Loop Latency */
- int Rloop_fudge; /* Add to ML to get Rloop */
- char *name;
-} R128RAMRec, *R128RAMPtr;
-
-typedef struct {
- /* Common registers */
- u_int32_t ovr_clr;
- u_int32_t ovr_wid_left_right;
- u_int32_t ovr_wid_top_bottom;
- u_int32_t ov0_scale_cntl;
- u_int32_t mpp_tb_config;
- u_int32_t mpp_gp_config;
- u_int32_t subpic_cntl;
- u_int32_t viph_control;
- u_int32_t i2c_cntl_1;
- u_int32_t gen_int_cntl;
- u_int32_t cap0_trig_cntl;
- u_int32_t cap1_trig_cntl;
- u_int32_t bus_cntl;
- u_int32_t config_cntl;
-
- /* Other registers to save for VT switches */
- u_int32_t dp_datatype;
- u_int32_t gen_reset_cntl;
- u_int32_t clock_cntl_index;
- u_int32_t amcgpio_en_reg;
- u_int32_t amcgpio_mask;
-
- /* CRTC registers */
- u_int32_t crtc_gen_cntl;
- u_int32_t crtc_ext_cntl;
- u_int32_t dac_cntl;
- u_int32_t crtc_h_total_disp;
- u_int32_t crtc_h_sync_strt_wid;
- u_int32_t crtc_v_total_disp;
- u_int32_t crtc_v_sync_strt_wid;
- u_int32_t crtc_offset;
- u_int32_t crtc_offset_cntl;
- u_int32_t crtc_pitch;
-
- /* CRTC2 registers */
- u_int32_t crtc2_gen_cntl;
-
- /* Flat panel registers */
- u_int32_t fp_crtc_h_total_disp;
- u_int32_t fp_crtc_v_total_disp;
- u_int32_t fp_gen_cntl;
- u_int32_t fp_h_sync_strt_wid;
- u_int32_t fp_horz_stretch;
- u_int32_t fp_panel_cntl;
- u_int32_t fp_v_sync_strt_wid;
- u_int32_t fp_vert_stretch;
- u_int32_t lvds_gen_cntl;
- u_int32_t tmds_crc;
- u_int32_t tmds_transmitter_cntl;
-
- /* Computed values for PLL */
- u_int32_t dot_clock_freq;
- u_int32_t pll_output_freq;
- int feedback_div;
- int post_div;
-
- /* PLL registers */
- u_int32_t ppll_ref_div;
- u_int32_t ppll_div_3;
- u_int32_t htotal_cntl;
-
- /* DDA register */
- u_int32_t dda_config;
- u_int32_t dda_on_off;
-
- /* Pallet */
- GLboolean palette_valid;
- u_int32_t palette[256];
-} R128SaveRec, *R128SavePtr;
-
-typedef struct {
- int Chipset;
- GLboolean Primary;
-
- GLboolean FBDev;
-
- unsigned long LinearAddr; /* Frame buffer physical address */
- unsigned long BIOSAddr; /* BIOS physical address */
-
- unsigned char *MMIO; /* Map of MMIO region */
- unsigned char *FB; /* Map of frame buffer */
-
- u_int32_t MemCntl;
- u_int32_t BusCntl;
- unsigned long FbMapSize; /* Size of frame buffer, in bytes */
- int Flags; /* Saved copy of mode flags */
-
- /* Computed values for FPs */
- int PanelXRes;
- int PanelYRes;
- int HOverPlus;
- int HSyncWidth;
- int HBlank;
- int VOverPlus;
- int VSyncWidth;
- int VBlank;
- int PanelPwrDly;
-
- unsigned long cursor_start;
- unsigned long cursor_end;
-
- /*
- * XAAForceTransBlit is used to change the behavior of the XAA
- * SetupForScreenToScreenCopy function, to make it DGA-friendly.
- */
- GLboolean XAAForceTransBlit;
-
- int fifo_slots; /* Free slots in the FIFO (64 max) */
- int pix24bpp; /* Depth of pixmap for 24bpp framebuffer */
- GLboolean dac6bits; /* Use 6 bit DAC? */
-
- /* Computed values for Rage 128 */
- int pitch;
- int datatype;
- u_int32_t dp_gui_master_cntl;
-
- /* Saved values for ScreenToScreenCopy */
- int xdir;
- int ydir;
-
- /* ScanlineScreenToScreenColorExpand support */
- unsigned char *scratch_buffer[1];
- unsigned char *scratch_save;
- int scanline_x;
- int scanline_y;
- int scanline_w;
- int scanline_h;
-
- int scanline_hpass;
- int scanline_x1clip;
- int scanline_x2clip;
- int scanline_rop;
- int scanline_fg;
- int scanline_bg;
-
- int scanline_words;
- int scanline_direct;
- int scanline_bpp; /* Only used for ImageWrite */
-
- drm_context_t drmCtx;
-
- drmSize registerSize;
- drm_handle_t registerHandle;
-
- GLboolean IsPCI; /* Current card is a PCI card */
- drmSize pciSize;
- drm_handle_t pciMemHandle;
- unsigned char *PCI; /* Map */
-
- GLboolean allowPageFlip; /* Enable 3d page flipping */
- GLboolean have3DWindows; /* Are there any 3d clients? */
- int drmMinor;
-
- drmSize agpSize;
- drm_handle_t agpMemHandle; /* Handle from drmAgpAlloc */
- unsigned long agpOffset;
- unsigned char *AGP; /* Map */
- int agpMode;
-
- GLboolean CCEInUse; /* CCE is currently active */
- int CCEMode; /* CCE mode that server/clients use */
- int CCEFifoSize; /* Size of the CCE command FIFO */
- GLboolean CCESecure; /* CCE security enabled */
- int CCEusecTimeout; /* CCE timeout in usecs */
-
- /* CCE ring buffer data */
- unsigned long ringStart; /* Offset into AGP space */
- drm_handle_t ringHandle; /* Handle from drmAddMap */
- drmSize ringMapSize; /* Size of map */
- int ringSize; /* Size of ring (in MB) */
- unsigned char *ring; /* Map */
- int ringSizeLog2QW;
-
- unsigned long ringReadOffset; /* Offset into AGP space */
- drm_handle_t ringReadPtrHandle; /* Handle from drmAddMap */
- drmSize ringReadMapSize; /* Size of map */
- unsigned char *ringReadPtr; /* Map */
-
- /* CCE vertex/indirect buffer data */
- unsigned long bufStart; /* Offset into AGP space */
- drm_handle_t bufHandle; /* Handle from drmAddMap */
- drmSize bufMapSize; /* Size of map */
- int bufSize; /* Size of buffers (in MB) */
- unsigned char *buf; /* Map */
- int bufNumBufs; /* Number of buffers */
- drmBufMapPtr buffers; /* Buffer map */
-
- /* CCE AGP Texture data */
- unsigned long agpTexStart; /* Offset into AGP space */
- drm_handle_t agpTexHandle; /* Handle from drmAddMap */
- drmSize agpTexMapSize; /* Size of map */
- int agpTexSize; /* Size of AGP tex space (in MB) */
- unsigned char *agpTex; /* Map */
- int log2AGPTexGran;
-
- /* CCE 2D accleration */
- drmBufPtr indirectBuffer;
- int indirectStart;
-
- /* DRI screen private data */
- int fbX;
- int fbY;
- int backX;
- int backY;
- int depthX;
- int depthY;
-
- int frontOffset;
- int frontPitch;
- int backOffset;
- int backPitch;
- int depthOffset;
- int depthPitch;
- int spanOffset;
- int textureOffset;
- int textureSize;
- int log2TexGran;
-
- /* Saved scissor values */
- u_int32_t sc_left;
- u_int32_t sc_right;
- u_int32_t sc_top;
- u_int32_t sc_bottom;
-
- u_int32_t re_top_left;
- u_int32_t re_width_height;
-
- u_int32_t aux_sc_cntl;
-
- int irq;
- u_int32_t gen_int_cntl;
-
- GLboolean DMAForXv;
-
-} R128InfoRec, *R128InfoPtr;
-
-#define R128WaitForFifo(pScrn, entries) \
-do { \
- if (info->fifo_slots < entries) R128WaitForFifoFunction(pScrn, entries); \
- info->fifo_slots -= entries; \
-} while (0)
-
-extern void r128WaitForFifoFunction(const DRIDriverContext *ctx, int entries);
-extern void r128WaitForIdle(const DRIDriverContext *ctx);
-
-extern void r128WaitForVerticalSync(const DRIDriverContext *ctx);
-
-extern GLboolean r128AccelInit(const DRIDriverContext *ctx);
-extern void r128EngineInit(const DRIDriverContext *ctx);
-extern GLboolean r128CursorInit(const DRIDriverContext *ctx);
-extern GLboolean r128DGAInit(const DRIDriverContext *ctx);
-
-extern void r128InitVideo(const DRIDriverContext *ctx);
-
-extern GLboolean r128DRIScreenInit(const DRIDriverContext *ctx);
-extern void r128DRICloseScreen(const DRIDriverContext *ctx);
-extern GLboolean r128DRIFinishScreenInit(const DRIDriverContext *ctx);
-
-#define R128CCE_START(ctx, info) \
-do { \
- int _ret = drmCommandNone(ctx->drmFD, DRM_R128_CCE_START); \
- if (_ret) { \
- fprintf(stderr, \
- "%s: CCE start %d\n", __FUNCTION__, _ret); \
- } \
-} while (0)
-
-#define R128CCE_STOP(ctx, info) \
-do { \
- int _ret = R128CCEStop(ctx); \
- if (_ret) { \
- fprintf(stderr, \
- "%s: CCE stop %d\n", __FUNCTION__, _ret); \
- } \
-} while (0)
-
-#define R128CCE_RESET(ctx, info) \
-do { \
- if (info->directRenderingEnabled \
- && R128CCE_USE_RING_BUFFER(info->CCEMode)) { \
- int _ret = drmCommandNone(info->drmFD, DRM_R128_CCE_RESET); \
- if (_ret) { \
- fprintf(stderr, \
- "%s: CCE reset %d\n", __FUNCTION__, _ret); \
- } \
- } \
-} while (0)
-
-
-#define CCE_PACKET0( reg, n ) \
- (R128_CCE_PACKET0 | ((n) << 16) | ((reg) >> 2))
-#define CCE_PACKET1( reg0, reg1 ) \
- (R128_CCE_PACKET1 | (((reg1) >> 2) << 11) | ((reg0) >> 2))
-#define CCE_PACKET2() \
- (R128_CCE_PACKET2)
-#define CCE_PACKET3( pkt, n ) \
- (R128_CCE_PACKET3 | (pkt) | ((n) << 16))
-
-
-#define R128_VERBOSE 0
-
-#define RING_LOCALS u_int32_t *__head; int __count;
-
-#define R128CCE_REFRESH(pScrn, info) \
-do { \
- if ( R128_VERBOSE ) { \
- fprintf(stderr, "REFRESH( %d ) in %s\n", \
- !info->CCEInUse , __FUNCTION__ ); \
- } \
- if ( !info->CCEInUse ) { \
- R128CCEWaitForIdle(pScrn); \
- BEGIN_RING( 6 ); \
- OUT_RING_REG( R128_RE_TOP_LEFT, info->re_top_left ); \
- OUT_RING_REG( R128_RE_WIDTH_HEIGHT, info->re_width_height ); \
- OUT_RING_REG( R128_AUX_SC_CNTL, info->aux_sc_cntl ); \
- ADVANCE_RING(); \
- info->CCEInUse = TRUE; \
- } \
-} while (0)
-
-#define BEGIN_RING( n ) do { \
- if ( R128_VERBOSE ) { \
- fprintf(stderr, \
- "BEGIN_RING( %d ) in %s\n", n, __FUNCTION__ ); \
- } \
- if ( !info->indirectBuffer ) { \
- info->indirectBuffer = R128CCEGetBuffer( pScrn ); \
- info->indirectStart = 0; \
- } else if ( (info->indirectBuffer->used + 4*(n)) > \
- info->indirectBuffer->total ) { \
- R128CCEFlushIndirect( pScrn, 1 ); \
- } \
- __head = (pointer)((char *)info->indirectBuffer->address + \
- info->indirectBuffer->used); \
- __count = 0; \
-} while (0)
-
-#define ADVANCE_RING() do { \
- if ( R128_VERBOSE ) { \
- fprintf(stderr, \
- "ADVANCE_RING() used: %d+%d=%d/%d\n", \
- info->indirectBuffer->used - info->indirectStart, \
- __count * sizeof(u_int32_t), \
- info->indirectBuffer->used - info->indirectStart + \
- __count * sizeof(u_int32_t), \
- info->indirectBuffer->total - info->indirectStart ); \
- } \
- info->indirectBuffer->used += __count * (int)sizeof(u_int32_t); \
-} while (0)
-
-#define OUT_RING( x ) do { \
- if ( R128_VERBOSE ) { \
- fprintf(stderr, \
- " OUT_RING( 0x%08x )\n", (unsigned int)(x) ); \
- } \
- MMIO_OUT32(&__head[__count++], 0, (x)); \
-} while (0)
-
-#define OUT_RING_REG( reg, val ) \
-do { \
- OUT_RING( CCE_PACKET0( reg, 0 ) ); \
- OUT_RING( val ); \
-} while (0)
-
-#define FLUSH_RING() \
-do { \
- if ( R128_VERBOSE ) \
- fprintf(stderr, \
- "FLUSH_RING in %s\n", __FUNCTION__ ); \
- if ( info->indirectBuffer ) { \
- R128CCEFlushIndirect( pScrn, 0 ); \
- } \
-} while (0)
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.c
deleted file mode 100644
index 5edf1e100..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.c
+++ /dev/null
@@ -1,1113 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.28 2003/02/07 20:41:14 martin Exp $ */
-/*
- * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
- * Precision Insight, Inc., Cedar Park, Texas, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, PRECISION INSIGHT, VA LINUX
- * SYSTEMS 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:
- * Kevin E. Martin <martin@valinux.com>
- * Rickard E. Faith <faith@valinux.com>
- * Daryll Strauss <daryll@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-// Fix this to use kernel pci_ids.h when all of these IDs make it into the kernel
-#include "pci_ids.h"
-
-#include "driver.h"
-#include "drm.h"
-#include "memops.h"
-
-#include "r128.h"
-#include "r128_dri.h"
-#include "r128_macros.h"
-#include "r128_reg.h"
-#include "r128_version.h"
-#include "r128_drm.h"
-
-static size_t r128_drm_page_size;
-
-/* Compute log base 2 of val. */
-static int R128MinBits(int val)
-{
- int bits;
-
- if (!val) return 1;
- for (bits = 0; val; val >>= 1, ++bits);
- return bits;
-}
-
-/* Initialize the AGP state. Request memory for use in AGP space, and
- initialize the Rage 128 registers to point to that memory. */
-static GLboolean R128DRIAgpInit(const DRIDriverContext *ctx)
-{
- unsigned char *R128MMIO = ctx->MMIOAddress;
- R128InfoPtr info = ctx->driverPrivate;
- unsigned long mode;
- unsigned int vendor, device;
- int ret;
- unsigned long cntl, chunk;
- int s, l;
- int flags;
- unsigned long agpBase;
-
- if (drmAgpAcquire(ctx->drmFD) < 0) {
- fprintf(stderr, "[agp] AGP not available\n");
- return GL_FALSE;
- }
-
- /* Modify the mode if the default mode is
- not appropriate for this particular
- combination of graphics card and AGP
- chipset. */
-
- mode = drmAgpGetMode(ctx->drmFD); /* Default mode */
- vendor = drmAgpVendorId(ctx->drmFD);
- device = drmAgpDeviceId(ctx->drmFD);
-
- mode &= ~R128_AGP_MODE_MASK;
- switch (info->agpMode) {
- case 4: mode |= R128_AGP_4X_MODE;
- case 2: mode |= R128_AGP_2X_MODE;
- case 1: default: mode |= R128_AGP_1X_MODE;
- }
-
- fprintf(stderr,
- "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n",
- mode, vendor, device,
- 0x1002,
- info->Chipset);
-
- if (drmAgpEnable(ctx->drmFD, mode) < 0) {
- fprintf(stderr, "[agp] AGP not enabled\n");
- drmAgpRelease(ctx->drmFD);
- return GL_FALSE;
- }
-
- info->agpOffset = 0;
-
- if ((ret = drmAgpAlloc(ctx->drmFD, info->agpSize*1024*1024, 0, NULL,
- &info->agpMemHandle)) < 0) {
- fprintf(stderr, "[agp] Out of memory (%d)\n", ret);
- drmAgpRelease(ctx->drmFD);
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] %d kB allocated with handle 0x%08x\n",
- info->agpSize*1024, info->agpMemHandle);
-
- if (drmAgpBind(ctx->drmFD, info->agpMemHandle, info->agpOffset) < 0) {
- fprintf(stderr, "[agp] Could not bind\n");
- drmAgpFree(ctx->drmFD, info->agpMemHandle);
- drmAgpRelease(ctx->drmFD);
- return GL_FALSE;
- }
-
- /* Initialize the CCE ring buffer data */
- info->ringStart = info->agpOffset;
- info->ringMapSize = info->ringSize*1024*1024 + r128_drm_page_size;
- info->ringSizeLog2QW = R128MinBits(info->ringSize*1024*1024/8) - 1;
-
- info->ringReadOffset = info->ringStart + info->ringMapSize;
- info->ringReadMapSize = r128_drm_page_size;
-
- /* Reserve space for vertex/indirect buffers */
- info->bufStart = info->ringReadOffset + info->ringReadMapSize;
- info->bufMapSize = info->bufSize*1024*1024;
-
- /* Reserve the rest for AGP textures */
- info->agpTexStart = info->bufStart + info->bufMapSize;
- s = (info->agpSize*1024*1024 - info->agpTexStart);
- l = R128MinBits((s-1) / R128_NR_TEX_REGIONS);
- if (l < R128_LOG_TEX_GRANULARITY) l = R128_LOG_TEX_GRANULARITY;
- info->agpTexMapSize = (s >> l) << l;
- info->log2AGPTexGran = l;
-
- if (info->CCESecure) flags = DRM_READ_ONLY;
- else flags = 0;
-
- if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize,
- DRM_AGP, flags, &info->ringHandle) < 0) {
- fprintf(stderr,
- "[agp] Could not add ring mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] ring handle = 0x%08x\n", info->ringHandle);
-
- if (drmMap(ctx->drmFD, info->ringHandle, info->ringMapSize,
- (drmAddressPtr)&info->ring) < 0) {
- fprintf(stderr, "[agp] Could not map ring\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] Ring mapped at 0x%08lx\n",
- (unsigned long)info->ring);
-
- if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize,
- DRM_AGP, flags, &info->ringReadPtrHandle) < 0) {
- fprintf(stderr,
- "[agp] Could not add ring read ptr mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] ring read ptr handle = 0x%08x\n",
- info->ringReadPtrHandle);
-
- if (drmMap(ctx->drmFD, info->ringReadPtrHandle, info->ringReadMapSize,
- (drmAddressPtr)&info->ringReadPtr) < 0) {
- fprintf(stderr,
- "[agp] Could not map ring read ptr\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] Ring read ptr mapped at 0x%08lx\n",
- (unsigned long)info->ringReadPtr);
-
- if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize,
- DRM_AGP, 0, &info->bufHandle) < 0) {
- fprintf(stderr,
- "[agp] Could not add vertex/indirect buffers mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] vertex/indirect buffers handle = 0x%08lx\n",
- info->bufHandle);
-
- if (drmMap(ctx->drmFD, info->bufHandle, info->bufMapSize,
- (drmAddressPtr)&info->buf) < 0) {
- fprintf(stderr,
- "[agp] Could not map vertex/indirect buffers\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] Vertex/indirect buffers mapped at 0x%08lx\n",
- (unsigned long)info->buf);
-
- if (drmAddMap(ctx->drmFD, info->agpTexStart, info->agpTexMapSize,
- DRM_AGP, 0, &info->agpTexHandle) < 0) {
- fprintf(stderr,
- "[agp] Could not add AGP texture map mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] AGP texture map handle = 0x%08lx\n",
- info->agpTexHandle);
-
- if (drmMap(ctx->drmFD, info->agpTexHandle, info->agpTexMapSize,
- (drmAddressPtr)&info->agpTex) < 0) {
- fprintf(stderr,
- "[agp] Could not map AGP texture map\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[agp] AGP Texture map mapped at 0x%08lx\n",
- (unsigned long)info->agpTex);
-
- /* Initialize Rage 128's AGP registers */
- cntl = INREG(R128_AGP_CNTL);
- cntl &= ~R128_AGP_APER_SIZE_MASK;
- switch (info->agpSize) {
- case 256: cntl |= R128_AGP_APER_SIZE_256MB; break;
- case 128: cntl |= R128_AGP_APER_SIZE_128MB; break;
- case 64: cntl |= R128_AGP_APER_SIZE_64MB; break;
- case 32: cntl |= R128_AGP_APER_SIZE_32MB; break;
- case 16: cntl |= R128_AGP_APER_SIZE_16MB; break;
- case 8: cntl |= R128_AGP_APER_SIZE_8MB; break;
- case 4: cntl |= R128_AGP_APER_SIZE_4MB; break;
- default:
- fprintf(stderr,
- "[agp] Illegal aperture size %d kB\n",
- info->agpSize*1024);
- return GL_FALSE;
- }
- agpBase = drmAgpBase(ctx->drmFD);
- OUTREG(R128_AGP_BASE, agpBase);
- OUTREG(R128_AGP_CNTL, cntl);
-
- /* Disable Rage 128's PCIGART registers */
- chunk = INREG(R128_BM_CHUNK_0_VAL);
- chunk &= ~(R128_BM_PTR_FORCE_TO_PCI |
- R128_BM_PM4_RD_FORCE_TO_PCI |
- R128_BM_GLOBAL_FORCE_TO_PCI);
- OUTREG(R128_BM_CHUNK_0_VAL, chunk);
-
- OUTREG(R128_PCI_GART_PAGE, 1); /* Ensure AGP GART is used (for now) */
-
- return GL_TRUE;
-}
-
-static GLboolean R128DRIPciInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- unsigned char *R128MMIO = ctx->MMIOAddress;
- u_int32_t chunk;
- int ret;
- int flags;
-
- info->agpOffset = 0;
-
- ret = drmScatterGatherAlloc(ctx->drmFD, info->agpSize*1024*1024,
- &info->pciMemHandle);
- if (ret < 0) {
- fprintf(stderr, "[pci] Out of memory (%d)\n", ret);
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] %d kB allocated with handle 0x%08x\n",
- info->agpSize*1024, info->pciMemHandle);
-
- /* Initialize the CCE ring buffer data */
- info->ringStart = info->agpOffset;
- info->ringMapSize = info->ringSize*1024*1024 + r128_drm_page_size;
- info->ringSizeLog2QW = R128MinBits(info->ringSize*1024*1024/8) - 1;
-
- info->ringReadOffset = info->ringStart + info->ringMapSize;
- info->ringReadMapSize = r128_drm_page_size;
-
- /* Reserve space for vertex/indirect buffers */
- info->bufStart = info->ringReadOffset + info->ringReadMapSize;
- info->bufMapSize = info->bufSize*1024*1024;
-
- flags = DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL;
-
- if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize,
- DRM_SCATTER_GATHER, flags, &info->ringHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add ring mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] ring handle = 0x%08lx\n", info->ringHandle);
-
- if (drmMap(ctx->drmFD, info->ringHandle, info->ringMapSize,
- (drmAddressPtr)&info->ring) < 0) {
- fprintf(stderr, "[pci] Could not map ring\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] Ring mapped at 0x%08lx\n",
- (unsigned long)info->ring);
- fprintf(stderr,
- "[pci] Ring contents 0x%08lx\n",
- *(unsigned long *)info->ring);
-
- if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize,
- DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add ring read ptr mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] ring read ptr handle = 0x%08lx\n",
- info->ringReadPtrHandle);
-
- if (drmMap(ctx->drmFD, info->ringReadPtrHandle, info->ringReadMapSize,
- (drmAddressPtr)&info->ringReadPtr) < 0) {
- fprintf(stderr,
- "[pci] Could not map ring read ptr\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] Ring read ptr mapped at 0x%08lx\n",
- (unsigned long)info->ringReadPtr);
- fprintf(stderr,
- "[pci] Ring read ptr contents 0x%08lx\n",
- *(unsigned long *)info->ringReadPtr);
-
- if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize,
- DRM_SCATTER_GATHER, 0, &info->bufHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add vertex/indirect buffers mapping\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] vertex/indirect buffers handle = 0x%08lx\n",
- info->bufHandle);
-
- if (drmMap(ctx->drmFD, info->bufHandle, info->bufMapSize,
- (drmAddressPtr)&info->buf) < 0) {
- fprintf(stderr,
- "[pci] Could not map vertex/indirect buffers\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[pci] Vertex/indirect buffers mapped at 0x%08lx\n",
- (unsigned long)info->buf);
- fprintf(stderr,
- "[pci] Vertex/indirect buffers contents 0x%08lx\n",
- *(unsigned long *)info->buf);
-
- if (!info->IsPCI) {
- /* This is really an AGP card, force PCI GART mode */
- chunk = INREG(R128_BM_CHUNK_0_VAL);
- chunk |= (R128_BM_PTR_FORCE_TO_PCI |
- R128_BM_PM4_RD_FORCE_TO_PCI |
- R128_BM_GLOBAL_FORCE_TO_PCI);
- OUTREG(R128_BM_CHUNK_0_VAL, chunk);
- OUTREG(R128_PCI_GART_PAGE, 0); /* Ensure PCI GART is used */
- }
-
- return GL_TRUE;
-}
-
-/* Add a map for the MMIO registers that will be accessed by any
- DRI-based clients. */
-static GLboolean R128DRIMapInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- int flags;
-
- if (info->CCESecure) flags = DRM_READ_ONLY;
- else flags = 0;
-
- /* Map registers */
- if (drmAddMap(ctx->drmFD, ctx->MMIOStart, ctx->MMIOSize,
- DRM_REGISTERS, flags, &info->registerHandle) < 0) {
- return GL_FALSE;
- }
- fprintf(stderr,
- "[drm] register handle = 0x%08x\n", info->registerHandle);
-
- return GL_TRUE;
-}
-
-/* Initialize the kernel data structures. */
-static int R128DRIKernelInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- drm_r128_init_t drmInfo;
-
- memset( &drmInfo, 0, sizeof(&drmInfo) );
-
- drmInfo.func = R128_INIT_CCE;
- drmInfo.sarea_priv_offset = sizeof(drm_sarea_t);
- drmInfo.is_pci = info->IsPCI;
- drmInfo.cce_mode = info->CCEMode;
- drmInfo.cce_secure = info->CCESecure;
- drmInfo.ring_size = info->ringSize*1024*1024;
- drmInfo.usec_timeout = info->CCEusecTimeout;
-
- drmInfo.fb_bpp = ctx->bpp;
- drmInfo.depth_bpp = ctx->bpp;
-
- drmInfo.front_offset = info->frontOffset;
- drmInfo.front_pitch = info->frontPitch;
-
- drmInfo.back_offset = info->backOffset;
- drmInfo.back_pitch = info->backPitch;
-
- drmInfo.depth_offset = info->depthOffset;
- drmInfo.depth_pitch = info->depthPitch;
- drmInfo.span_offset = info->spanOffset;
-
- drmInfo.fb_offset = info->LinearAddr;
- drmInfo.mmio_offset = info->registerHandle;
- drmInfo.ring_offset = info->ringHandle;
- drmInfo.ring_rptr_offset = info->ringReadPtrHandle;
- drmInfo.buffers_offset = info->bufHandle;
- drmInfo.agp_textures_offset = info->agpTexHandle;
-
- if (drmCommandWrite(ctx->drmFD, DRM_R128_INIT,
- &drmInfo, sizeof(drmInfo)) < 0)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-/* Add a map for the vertex buffers that will be accessed by any
- DRI-based clients. */
-static GLboolean R128DRIBufInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- /* Initialize vertex buffers */
- if (info->IsPCI) {
- info->bufNumBufs = drmAddBufs(ctx->drmFD,
- info->bufMapSize / R128_BUFFER_SIZE,
- R128_BUFFER_SIZE,
- DRM_SG_BUFFER,
- info->bufStart);
- } else {
- info->bufNumBufs = drmAddBufs(ctx->drmFD,
- info->bufMapSize / R128_BUFFER_SIZE,
- R128_BUFFER_SIZE,
- DRM_AGP_BUFFER,
- info->bufStart);
- }
- if (info->bufNumBufs <= 0) {
- fprintf(stderr,
- "[drm] Could not create vertex/indirect buffers list\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[drm] Added %d %d byte vertex/indirect buffers\n",
- info->bufNumBufs, R128_BUFFER_SIZE);
-
- if (!(info->buffers = drmMapBufs(ctx->drmFD))) {
- fprintf(stderr,
- "[drm] Failed to map vertex/indirect buffers list\n");
- return GL_FALSE;
- }
- fprintf(stderr,
- "[drm] Mapped %d vertex/indirect buffers\n",
- info->buffers->count);
-
- return GL_TRUE;
-}
-
-static void R128DRIIrqInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- unsigned char *R128MMIO = ctx->MMIOAddress;
-
- if (!info->irq) {
- info->irq = drmGetInterruptFromBusID(
- ctx->drmFD,
- ctx->pciBus,
- ctx->pciDevice,
- ctx->pciFunc);
-
- if((drmCtlInstHandler(ctx->drmFD, info->irq)) != 0) {
- fprintf(stderr,
- "[drm] failure adding irq handler, "
- "there is a device already using that irq\n"
- "[drm] falling back to irq-free operation\n");
- info->irq = 0;
- } else {
- info->gen_int_cntl = INREG( R128_GEN_INT_CNTL );
- }
- }
-
- if (info->irq)
- fprintf(stderr,
- "[drm] dma control initialized, using IRQ %d\n",
- info->irq);
-}
-
-static int R128CCEStop(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- drm_r128_cce_stop_t stop;
- int ret, i;
-
- stop.flush = 1;
- stop.idle = 1;
-
- ret = drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP,
- &stop, sizeof(stop) );
-
- if ( ret == 0 ) {
- return 0;
- } else if ( errno != EBUSY ) {
- return -errno;
- }
-
- stop.flush = 0;
-
- i = 0;
- do {
- ret = drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP,
- &stop, sizeof(stop) );
- } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
-
- if ( ret == 0 ) {
- return 0;
- } else if ( errno != EBUSY ) {
- return -errno;
- }
-
- stop.idle = 0;
-
- if ( drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP,
- &stop, sizeof(stop) )) {
- return -errno;
- } else {
- return 0;
- }
-}
-
-/* Initialize the CCE state, and start the CCE (if used by the X server) */
-static void R128DRICCEInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
-
- /* Turn on bus mastering */
- info->BusCntl &= ~R128_BUS_MASTER_DIS;
-
- /* CCEMode is initialized in r128_driver.c */
- switch (info->CCEMode) {
- case R128_PM4_NONPM4: info->CCEFifoSize = 0; break;
- case R128_PM4_192PIO: info->CCEFifoSize = 192; break;
- case R128_PM4_192BM: info->CCEFifoSize = 192; break;
- case R128_PM4_128PIO_64INDBM: info->CCEFifoSize = 128; break;
- case R128_PM4_128BM_64INDBM: info->CCEFifoSize = 128; break;
- case R128_PM4_64PIO_128INDBM: info->CCEFifoSize = 64; break;
- case R128_PM4_64BM_128INDBM: info->CCEFifoSize = 64; break;
- case R128_PM4_64PIO_64VCBM_64INDBM: info->CCEFifoSize = 64; break;
- case R128_PM4_64BM_64VCBM_64INDBM: info->CCEFifoSize = 64; break;
- case R128_PM4_64PIO_64VCPIO_64INDPIO: info->CCEFifoSize = 64; break;
- }
-
- /* Make sure the CCE is on for the X server */
- R128CCE_START(ctx, info);
-}
-
-
-static int R128MemoryInit(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- int width_bytes = ctx->shared.virtualWidth * ctx->cpp;
- int cpp = ctx->cpp;
- int bufferSize = ((ctx->shared.virtualHeight * width_bytes
- + R128_BUFFER_ALIGN)
- & ~R128_BUFFER_ALIGN);
- int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes
- + R128_BUFFER_ALIGN)
- & ~R128_BUFFER_ALIGN);
- int l;
-
- info->frontOffset = 0;
- info->frontPitch = ctx->shared.virtualWidth;
-
- fprintf(stderr,
- "Using %d MB AGP aperture\n", info->agpSize);
- fprintf(stderr,
- "Using %d MB for the ring buffer\n", info->ringSize);
- fprintf(stderr,
- "Using %d MB for vertex/indirect buffers\n", info->bufSize);
- fprintf(stderr,
- "Using %d MB for AGP textures\n", info->agpTexSize);
-
- /* Front, back and depth buffers - everything else texture??
- */
- info->textureSize = ctx->shared.fbSize - 2 * bufferSize - depthSize;
-
- if (info->textureSize < 0)
- return 0;
-
- l = R128MinBits((info->textureSize-1) / R128_NR_TEX_REGIONS);
- if (l < R128_LOG_TEX_GRANULARITY) l = R128_LOG_TEX_GRANULARITY;
-
- /* Round the texture size up to the nearest whole number of
- * texture regions. Again, be greedy about this, don't
- * round down.
- */
- info->log2TexGran = l;
- info->textureSize = (info->textureSize >> l) << l;
-
- /* Set a minimum usable local texture heap size. This will fit
- * two 256x256x32bpp textures.
- */
- if (info->textureSize < 512 * 1024) {
- info->textureOffset = 0;
- info->textureSize = 0;
- }
-
- /* Reserve space for textures */
- info->textureOffset = ((ctx->shared.fbSize - info->textureSize +
- R128_BUFFER_ALIGN) &
- ~R128_BUFFER_ALIGN);
-
- /* Reserve space for the shared depth
- * buffer.
- */
- info->depthOffset = ((info->textureOffset - depthSize +
- R128_BUFFER_ALIGN) &
- ~R128_BUFFER_ALIGN);
- info->depthPitch = ctx->shared.virtualWidth;
-
- info->backOffset = ((info->depthOffset - bufferSize +
- R128_BUFFER_ALIGN) &
- ~R128_BUFFER_ALIGN);
- info->backPitch = ctx->shared.virtualWidth;
-
-
- fprintf(stderr,
- "Will use back buffer at offset 0x%x\n",
- info->backOffset);
- fprintf(stderr,
- "Will use depth buffer at offset 0x%x\n",
- info->depthOffset);
- fprintf(stderr,
- "Will use %d kb for textures at offset 0x%x\n",
- info->textureSize/1024, info->textureOffset);
-
- return 1;
-}
-
-
-/* Initialize the screen-specific data structures for the DRI and the
- Rage 128. This is the main entry point to the device-specific
- initialization code. It calls device-independent DRI functions to
- create the DRI data structures and initialize the DRI state. */
-static GLboolean R128DRIScreenInit(DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- R128DRIPtr pR128DRI;
- int err, major, minor, patch;
- drmVersionPtr version;
- drm_r128_sarea_t *pSAREAPriv;
-
- switch (ctx->bpp) {
- case 8:
- /* These modes are not supported (yet). */
- case 15:
- case 24:
- fprintf(stderr,
- "[dri] R128DRIScreenInit failed (depth %d not supported). "
- "[dri] Disabling DRI.\n", ctx->bpp);
- return GL_FALSE;
-
- /* Only 16 and 32 color depths are supports currently. */
- case 16:
- case 32:
- break;
- }
- r128_drm_page_size = getpagesize();
-
- info->registerSize = ctx->MMIOSize;
- ctx->shared.SAREASize = SAREA_MAX;
-
- /* Note that drmOpen will try to load the kernel module, if needed. */
- ctx->drmFD = drmOpen("r128", NULL );
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
-
- /* Check the r128 DRM version */
- version = drmGetVersion(ctx->drmFD);
- if (version) {
- if (version->version_major != 2 ||
- version->version_minor < 2) {
- /* incompatible drm version */
- fprintf(stderr,
- "[dri] R128DRIScreenInit failed because of a version mismatch.\n"
- "[dri] r128.o kernel module version is %d.%d.%d but version 2.2 or greater is needed.\n"
- "[dri] Disabling the DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel);
- drmFreeVersion(version);
- return GL_FALSE;
- }
- info->drmMinor = version->version_minor;
- drmFreeVersion(version);
- }
-
- if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) {
- fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
- return 0;
- }
-
- if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap( ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
- 0,
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
-
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
- if (!R128MemoryInit(ctx))
- return GL_FALSE;
-
- /* Initialize AGP */
- if (!info->IsPCI && !R128DRIAgpInit(ctx)) {
- info->IsPCI = GL_TRUE;
- fprintf(stderr,
- "[agp] AGP failed to initialize -- falling back to PCI mode.\n");
- fprintf(stderr,
- "[agp] Make sure you have the agpgart kernel module loaded.\n");
- }
-
- /* Initialize PCIGART */
- if (info->IsPCI && !R128DRIPciInit(ctx)) {
- return GL_FALSE;
- }
-
- /* DRIScreenInit doesn't add all the
- common mappings. Add additional
- mappings here. */
- if (!R128DRIMapInit(ctx)) {
- return GL_FALSE;
- }
-
- /* Create a 'server' context so we can grab the lock for
- * initialization ioctls.
- */
- if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return 0;
- }
-
- DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0);
-
- /* Initialize the kernel data structures */
- if (!R128DRIKernelInit(ctx)) {
- return GL_FALSE;
- }
-
- /* Initialize the vertex buffers list */
- if (!R128DRIBufInit(ctx)) {
- return GL_FALSE;
- }
-
- /* Initialize IRQ */
- R128DRIIrqInit(ctx);
-
- /* Initialize and start the CCE if required */
- R128DRICCEInit(ctx);
-
- /* Quick hack to clear the front & back buffers. Could also use
- * the clear ioctl to do this, but would need to setup hw state
- * first.
- */
- drimemsetio((char *)ctx->FBAddress + info->frontOffset,
- 0,
- info->frontPitch * ctx->cpp * ctx->shared.virtualHeight );
-
- drimemsetio((char *)ctx->FBAddress + info->backOffset,
- 0,
- info->backPitch * ctx->cpp * ctx->shared.virtualHeight );
-
- pSAREAPriv = (drm_r128_sarea_t *)(((char*)ctx->pSAREA) +
- sizeof(drm_sarea_t));
- memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
-
- /* This is the struct passed to radeon_dri.so for its initialization */
- ctx->driverClientMsg = malloc(sizeof(R128DRIRec));
- ctx->driverClientMsgSize = sizeof(R128DRIRec);
-
- pR128DRI = (R128DRIPtr)ctx->driverClientMsg;
- pR128DRI->deviceID = info->Chipset;
- pR128DRI->width = ctx->shared.virtualWidth;
- pR128DRI->height = ctx->shared.virtualHeight;
- pR128DRI->depth = ctx->bpp;
- pR128DRI->bpp = ctx->bpp;
-
- pR128DRI->IsPCI = info->IsPCI;
- pR128DRI->AGPMode = info->agpMode;
-
- pR128DRI->frontOffset = info->frontOffset;
- pR128DRI->frontPitch = info->frontPitch;
- pR128DRI->backOffset = info->backOffset;
- pR128DRI->backPitch = info->backPitch;
- pR128DRI->depthOffset = info->depthOffset;
- pR128DRI->depthPitch = info->depthPitch;
- pR128DRI->spanOffset = info->spanOffset;
- pR128DRI->textureOffset = info->textureOffset;
- pR128DRI->textureSize = info->textureSize;
- pR128DRI->log2TexGran = info->log2TexGran;
-
- pR128DRI->registerHandle = info->registerHandle;
- pR128DRI->registerSize = info->registerSize;
-
- pR128DRI->agpTexHandle = info->agpTexHandle;
- pR128DRI->agpTexMapSize = info->agpTexMapSize;
- pR128DRI->log2AGPTexGran = info->log2AGPTexGran;
- pR128DRI->agpTexOffset = info->agpTexStart;
- pR128DRI->sarea_priv_offset = sizeof(drm_sarea_t);
-
- return GL_TRUE;
-}
-
-/* The screen is being closed, so clean up any state and free any
- resources used by the DRI. */
-void R128DRICloseScreen(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
- drm_r128_init_t drmInfo;
-
- /* Stop the CCE if it is still in use */
- R128CCE_STOP(ctx, info);
-
- if (info->irq) {
- drmCtlUninstHandler(ctx->drmFD);
- info->irq = 0;
- }
-
- /* De-allocate vertex buffers */
- if (info->buffers) {
- drmUnmapBufs(info->buffers);
- info->buffers = NULL;
- }
-
- /* De-allocate all kernel resources */
- memset(&drmInfo, 0, sizeof(drmInfo));
- drmInfo.func = R128_CLEANUP_CCE;
- drmCommandWrite(ctx->drmFD, DRM_R128_INIT,
- &drmInfo, sizeof(drmInfo));
-
- /* De-allocate all AGP resources */
- if (info->agpTex) {
- drmUnmap(info->agpTex, info->agpTexMapSize);
- info->agpTex = NULL;
- }
- if (info->buf) {
- drmUnmap(info->buf, info->bufMapSize);
- info->buf = NULL;
- }
- if (info->ringReadPtr) {
- drmUnmap(info->ringReadPtr, info->ringReadMapSize);
- info->ringReadPtr = NULL;
- }
- if (info->ring) {
- drmUnmap(info->ring, info->ringMapSize);
- info->ring = NULL;
- }
- if (info->agpMemHandle != DRM_AGP_NO_HANDLE) {
- drmAgpUnbind(ctx->drmFD, info->agpMemHandle);
- drmAgpFree(ctx->drmFD, info->agpMemHandle);
- info->agpMemHandle = 0;
- drmAgpRelease(ctx->drmFD);
- }
- if (info->pciMemHandle) {
- drmScatterGatherFree(ctx->drmFD, info->pciMemHandle);
- info->pciMemHandle = 0;
- }
-}
-
-static GLboolean R128PreInitDRI(const DRIDriverContext *ctx)
-{
- R128InfoPtr info = ctx->driverPrivate;
-
- /*info->CCEMode = R128_DEFAULT_CCE_PIO_MODE;*/
- info->CCEMode = R128_DEFAULT_CCE_BM_MODE;
- info->CCESecure = GL_TRUE;
-
- info->agpMode = R128_DEFAULT_AGP_MODE;
- info->agpSize = R128_DEFAULT_AGP_SIZE;
- info->ringSize = R128_DEFAULT_RING_SIZE;
- info->bufSize = R128_DEFAULT_BUFFER_SIZE;
- info->agpTexSize = R128_DEFAULT_AGP_TEX_SIZE;
-
- info->CCEusecTimeout = R128_DEFAULT_CCE_TIMEOUT;
-
- return GL_TRUE;
-}
-
-/**
- * \brief Initialize the framebuffer device mode
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Fills in \p info with some default values and some information from \p ctx
- * and then calls R128ScreenInit() for the screen initialization.
- *
- * Before exiting clears the framebuffer memory accessing it directly.
- */
-static int R128InitFBDev( DRIDriverContext *ctx )
-{
- R128InfoPtr info = calloc(1, sizeof(*info));
-
- {
- int dummy = ctx->shared.virtualWidth;
-
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break;
- }
-
- ctx->shared.virtualWidth = dummy;
- }
-
- ctx->driverPrivate = (void *)info;
-
- info->Chipset = ctx->chipset;
-
- switch (info->Chipset) {
- case PCI_DEVICE_ID_ATI_RAGE128_LE:
- case PCI_DEVICE_ID_ATI_RAGE128_RE:
- case PCI_DEVICE_ID_ATI_RAGE128_RK:
- case PCI_DEVICE_ID_ATI_RAGE128_PD:
- case PCI_DEVICE_ID_ATI_RAGE128_PP:
- case PCI_DEVICE_ID_ATI_RAGE128_PR:
- /* This is a PCI card */
- info->IsPCI = GL_TRUE;
- break;
- default:
- /* This is an AGP card */
- info->IsPCI = GL_FALSE;
- break;
- }
-
- info->frontPitch = ctx->shared.virtualWidth;
- info->LinearAddr = ctx->FBStart & 0xfc000000;
-
- if (!R128PreInitDRI(ctx))
- return 0;
-
- if (!R128DRIScreenInit(ctx))
- return 0;
-
- return 1;
-}
-
-
-/**
- * \brief The screen is being closed, so clean up any state and free any
- * resources used by the DRI.
- *
- * \param ctx display handle.
- *
- * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver
- * private data.
- */
-static void R128HaltFBDev( DRIDriverContext *ctx )
-{
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = 0;
- }
-}
-
-
-/**
- * \brief Validate the fbdev mode.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Saves some registers and returns 1.
- *
- * \sa R128PostValidateMode().
- */
-static int R128ValidateMode( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Examine mode returned by fbdev.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Restores registers that fbdev has clobbered and returns 1.
- *
- * \sa R128ValidateMode().
- */
-static int R128PostValidateMode( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Shutdown the drawing engine.
- *
- * \param ctx display handle
- *
- * Turns off the command processor engine & restores the graphics card
- * to a state that fbdev understands.
- */
-static int R128EngineShutdown( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-/**
- * \brief Restore the drawing engine.
- *
- * \param ctx display handle
- *
- * Resets the graphics card and sets initial values for several registers of
- * the card's drawing engine.
- *
- * Turns on the R128 command processor engine (i.e., the ringbuffer).
- */
-static int R128EngineRestore( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Exported driver interface for Mini GLX.
- *
- * \sa DRIDriverRec.
- */
-const struct DRIDriverRec __driDriver = {
- R128ValidateMode,
- R128PostValidateMode,
- R128InitFBDev,
- R128HaltFBDev,
- R128EngineShutdown,
- R128EngineRestore,
- 0,
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.h
deleted file mode 100644
index 67ade70de..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h,v 1.7 2002/10/30 12:52:12 alanh Exp $ */
-/*
- * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
- * Precision Insight, Inc., Cedar Park, Texas, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, PRECISION INSIGHT, VA LINUX
- * SYSTEMS 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:
- * Kevin E. Martin <martin@valinux.com>
- * Rickard E. Faith <faith@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef _R128_DRI_
-#define _R128_DRI_
-
-#include "xf86drm.h"
-#include "drm.h"
-
-/* DRI Driver defaults */
-#define R128_DEFAULT_CCE_PIO_MODE R128_PM4_64PIO_64VCBM_64INDBM
-#define R128_DEFAULT_CCE_BM_MODE R128_PM4_64BM_64VCBM_64INDBM
-#define R128_DEFAULT_AGP_MODE 1
-#define R128_DEFAULT_AGP_SIZE 8 /* MB (must be a power of 2 and > 4MB) */
-#define R128_DEFAULT_RING_SIZE 1 /* MB (must be page aligned) */
-#define R128_DEFAULT_BUFFER_SIZE 2 /* MB (must be page aligned) */
-#define R128_DEFAULT_AGP_TEX_SIZE 1 /* MB (must be page aligned) */
-
-#define R128_DEFAULT_CCE_TIMEOUT 10000 /* usecs */
-
-#define R128_AGP_MAX_MODE 4
-#define R128_BUFFER_ALIGN 0x00000fff
-
-#define R128_CARD_TYPE_R128 1
-#define R128_CARD_TYPE_R128_PRO 2
-#define R128_CARD_TYPE_R128_MOBILITY 3
-
-#define R128CCE_USE_RING_BUFFER(m) \
-(((m) == R128_PM4_192BM) || \
- ((m) == R128_PM4_128BM_64INDBM) || \
- ((m) == R128_PM4_64BM_128INDBM) || \
- ((m) == R128_PM4_64BM_64VCBM_64INDBM))
-
-typedef struct {
- /* DRI screen private data */
- int deviceID; /* PCI device ID */
- int width; /* Width in pixels of display */
- int height; /* Height in scanlines of display */
- int depth; /* Depth of display (8, 15, 16, 24) */
- int bpp; /* Bit depth of display (8, 16, 24, 32) */
-
- int IsPCI; /* Current card is a PCI card */
- int AGPMode;
-
- int frontOffset; /* Start of front buffer */
- int frontPitch;
- int backOffset; /* Start of shared back buffer */
- int backPitch;
- int depthOffset; /* Start of shared depth buffer */
- int depthPitch;
- int spanOffset; /* Start of scratch spanline */
- int textureOffset;/* Start of texture data in frame buffer */
- int textureSize;
- int log2TexGran;
-
- /* MMIO register data */
- drm_handle_t registerHandle;
- drmSize registerSize;
-
- /* CCE AGP Texture data */
- drm_handle_t agpTexHandle;
- drmSize agpTexMapSize;
- int log2AGPTexGran;
- int agpTexOffset;
- unsigned int sarea_priv_offset;
-} R128DRIRec, *R128DRIPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_macros.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_macros.h
deleted file mode 100644
index 93b7feb02..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_macros.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * \file server/R128_macros.h
- * \brief Macros for R128 MMIO operation.
- *
- * \authors Kevin E. Martin <martin@xfree86.org>
- * \authors Rickard E. Faith <faith@valinux.com>
- * \authors Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-
-/*
- * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, VA LINUX SYSTEMS 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.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/R128_reg.h,v 1.20 2002/10/12 01:38:07 martin Exp $ */
-
-#ifndef _R128_MACROS_H_
-#define _R128_MACROS_H_
-
-
-
-# define MMIO_IN8(base, offset) \
- *(volatile unsigned char *)(((unsigned char*)(base)) + (offset))
-# define MMIO_IN16(base, offset) \
- *(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset))
-# define MMIO_IN32(base, offset) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset))
-# define MMIO_OUT8(base, offset, val) \
- *(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val)
-# define MMIO_OUT16(base, offset, val) \
- *(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
-# define MMIO_OUT32(base, offset, val) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
-
-
- /* Memory mapped register access macros */
-#define INREG8(addr) MMIO_IN8(R128MMIO, addr)
-#define INREG16(addr) MMIO_IN16(R128MMIO, addr)
-#define INREG(addr) MMIO_IN32(R128MMIO, addr)
-#define OUTREG8(addr, val) MMIO_OUT8(R128MMIO, addr, val)
-#define OUTREG16(addr, val) MMIO_OUT16(R128MMIO, addr, val)
-#define OUTREG(addr, val) MMIO_OUT32(R128MMIO, addr, val)
-
-#define ADDRREG(addr) ((volatile GLuint *)(pointer)(R128MMIO + (addr)))
-
-
-#define OUTREGP(addr, val, mask) \
-do { \
- GLuint tmp = INREG(addr); \
- tmp &= (mask); \
- tmp |= (val); \
- OUTREG(addr, tmp); \
-} while (0)
-
-#define INPLL(dpy, addr) r128INPLL(dpy, addr)
-
-#define OUTPLL(addr, val) \
-do { \
- OUTREG8(R128_CLOCK_CNTL_INDEX, (((addr) & 0x3f) | \
- R128_PLL_WR_EN)); \
- OUTREG(R128_CLOCK_CNTL_DATA, val); \
-} while (0)
-
-#define OUTPLLP(dpy, addr, val, mask) \
-do { \
- GLuint tmp = INPLL(dpy, addr); \
- tmp &= (mask); \
- tmp |= (val); \
- OUTPLL(addr, tmp); \
-} while (0)
-
-#define OUTPAL_START(idx) \
-do { \
- OUTREG8(R128_PALETTE_INDEX, (idx)); \
-} while (0)
-
-#define OUTPAL_NEXT(r, g, b) \
-do { \
- OUTREG(R128_PALETTE_DATA, ((r) << 16) | ((g) << 8) | (b)); \
-} while (0)
-
-#define OUTPAL_NEXT_CARD32(v) \
-do { \
- OUTREG(R128_PALETTE_DATA, (v & 0x00ffffff)); \
-} while (0)
-
-#define OUTPAL(idx, r, g, b) \
-do { \
- OUTPAL_START((idx)); \
- OUTPAL_NEXT((r), (g), (b)); \
-} while (0)
-
-#define INPAL_START(idx) \
-do { \
- OUTREG(R128_PALETTE_INDEX, (idx) << 16); \
-} while (0)
-
-#define INPAL_NEXT() INREG(R128_PALETTE_DATA)
-
-#define PAL_SELECT(idx) \
-do { \
- if (!idx) { \
- OUTREG(R128_DAC_CNTL2, INREG(R128_DAC_CNTL2) & \
- (GLuint)~R128_DAC2_PALETTE_ACC_CTL); \
- } else { \
- OUTREG(R128_DAC_CNTL2, INREG(R128_DAC_CNTL2) | \
- R128_DAC2_PALETTE_ACC_CTL); \
- } \
-} while (0)
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_reg.h
deleted file mode 100644
index 00f5041c1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_reg.h
+++ /dev/null
@@ -1,1394 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v 1.15 2002/12/16 16:19:11 dawes Exp $ */
-/*
- * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
- * Precision Insight, Inc., Cedar Park, Texas, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, PRECISION INSIGHT, VA LINUX
- * SYSTEMS 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:
- * Rickard E. Faith <faith@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- * References:
- *
- * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical
- * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April
- * 1999.
- *
- * RAGE 128 Software Development Manual (Technical Reference Manual P/N
- * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999.
- *
- */
-
-#ifndef _R128_REG_H_
-#define _R128_REG_H_
-
-#define R128_ADAPTER_ID 0x0f2c /* PCI */
-#define R128_AGP_APER_OFFSET 0x0178
-#define R128_AGP_BASE 0x0170
-#define R128_AGP_CNTL 0x0174
-# define R128_AGP_APER_SIZE_256MB (0x00 << 0)
-# define R128_AGP_APER_SIZE_128MB (0x20 << 0)
-# define R128_AGP_APER_SIZE_64MB (0x30 << 0)
-# define R128_AGP_APER_SIZE_32MB (0x38 << 0)
-# define R128_AGP_APER_SIZE_16MB (0x3c << 0)
-# define R128_AGP_APER_SIZE_8MB (0x3e << 0)
-# define R128_AGP_APER_SIZE_4MB (0x3f << 0)
-# define R128_AGP_APER_SIZE_MASK (0x3f << 0)
-#define R128_AGP_CNTL_B 0x0b44
-#define R128_AGP_COMMAND 0x0f58 /* PCI */
-#define R128_AGP_PLL_CNTL 0x0010 /* PLL */
-#define R128_AGP_STATUS 0x0f54 /* PCI */
-# define R128_AGP_1X_MODE 0x01
-# define R128_AGP_2X_MODE 0x02
-# define R128_AGP_4X_MODE 0x04
-# define R128_AGP_MODE_MASK 0x07
-#define R128_AMCGPIO_A_REG 0x01a0
-#define R128_AMCGPIO_EN_REG 0x01a8
-#define R128_AMCGPIO_MASK 0x0194
-#define R128_AMCGPIO_Y_REG 0x01a4
-#define R128_ATTRDR 0x03c1 /* VGA */
-#define R128_ATTRDW 0x03c0 /* VGA */
-#define R128_ATTRX 0x03c0 /* VGA */
-#define R128_AUX_SC_CNTL 0x1660
-# define R128_AUX1_SC_EN (1 << 0)
-# define R128_AUX1_SC_MODE_OR (0 << 1)
-# define R128_AUX1_SC_MODE_NAND (1 << 1)
-# define R128_AUX2_SC_EN (1 << 2)
-# define R128_AUX2_SC_MODE_OR (0 << 3)
-# define R128_AUX2_SC_MODE_NAND (1 << 3)
-# define R128_AUX3_SC_EN (1 << 4)
-# define R128_AUX3_SC_MODE_OR (0 << 5)
-# define R128_AUX3_SC_MODE_NAND (1 << 5)
-#define R128_AUX1_SC_BOTTOM 0x1670
-#define R128_AUX1_SC_LEFT 0x1664
-#define R128_AUX1_SC_RIGHT 0x1668
-#define R128_AUX1_SC_TOP 0x166c
-#define R128_AUX2_SC_BOTTOM 0x1680
-#define R128_AUX2_SC_LEFT 0x1674
-#define R128_AUX2_SC_RIGHT 0x1678
-#define R128_AUX2_SC_TOP 0x167c
-#define R128_AUX3_SC_BOTTOM 0x1690
-#define R128_AUX3_SC_LEFT 0x1684
-#define R128_AUX3_SC_RIGHT 0x1688
-#define R128_AUX3_SC_TOP 0x168c
-#define R128_AUX_WINDOW_HORZ_CNTL 0x02d8
-#define R128_AUX_WINDOW_VERT_CNTL 0x02dc
-
-#define R128_BASE_CODE 0x0f0b
-#define R128_BIOS_0_SCRATCH 0x0010
-#define R128_BIOS_1_SCRATCH 0x0014
-#define R128_BIOS_2_SCRATCH 0x0018
-#define R128_BIOS_3_SCRATCH 0x001c
-#define R128_BIOS_4_SCRATCH 0x0020
-#define R128_BIOS_5_SCRATCH 0x0024
-# define R128_BIOS_DISPLAY_FP (1 << 0)
-# define R128_BIOS_DISPLAY_CRT (2 << 0)
-# define R128_BIOS_DISPLAY_FP_CRT (3 << 0)
-#define R128_BIOS_6_SCRATCH 0x0028
-#define R128_BIOS_7_SCRATCH 0x002c
-#define R128_BIOS_ROM 0x0f30 /* PCI */
-#define R128_BIST 0x0f0f /* PCI */
-#define R128_BM_CHUNK_0_VAL 0x0a18
-# define R128_BM_PTR_FORCE_TO_PCI (1 << 21)
-# define R128_BM_PM4_RD_FORCE_TO_PCI (1 << 22)
-# define R128_BM_GLOBAL_FORCE_TO_PCI (1 << 23)
-#define R128_BRUSH_DATA0 0x1480
-#define R128_BRUSH_DATA1 0x1484
-#define R128_BRUSH_DATA10 0x14a8
-#define R128_BRUSH_DATA11 0x14ac
-#define R128_BRUSH_DATA12 0x14b0
-#define R128_BRUSH_DATA13 0x14b4
-#define R128_BRUSH_DATA14 0x14b8
-#define R128_BRUSH_DATA15 0x14bc
-#define R128_BRUSH_DATA16 0x14c0
-#define R128_BRUSH_DATA17 0x14c4
-#define R128_BRUSH_DATA18 0x14c8
-#define R128_BRUSH_DATA19 0x14cc
-#define R128_BRUSH_DATA2 0x1488
-#define R128_BRUSH_DATA20 0x14d0
-#define R128_BRUSH_DATA21 0x14d4
-#define R128_BRUSH_DATA22 0x14d8
-#define R128_BRUSH_DATA23 0x14dc
-#define R128_BRUSH_DATA24 0x14e0
-#define R128_BRUSH_DATA25 0x14e4
-#define R128_BRUSH_DATA26 0x14e8
-#define R128_BRUSH_DATA27 0x14ec
-#define R128_BRUSH_DATA28 0x14f0
-#define R128_BRUSH_DATA29 0x14f4
-#define R128_BRUSH_DATA3 0x148c
-#define R128_BRUSH_DATA30 0x14f8
-#define R128_BRUSH_DATA31 0x14fc
-#define R128_BRUSH_DATA32 0x1500
-#define R128_BRUSH_DATA33 0x1504
-#define R128_BRUSH_DATA34 0x1508
-#define R128_BRUSH_DATA35 0x150c
-#define R128_BRUSH_DATA36 0x1510
-#define R128_BRUSH_DATA37 0x1514
-#define R128_BRUSH_DATA38 0x1518
-#define R128_BRUSH_DATA39 0x151c
-#define R128_BRUSH_DATA4 0x1490
-#define R128_BRUSH_DATA40 0x1520
-#define R128_BRUSH_DATA41 0x1524
-#define R128_BRUSH_DATA42 0x1528
-#define R128_BRUSH_DATA43 0x152c
-#define R128_BRUSH_DATA44 0x1530
-#define R128_BRUSH_DATA45 0x1534
-#define R128_BRUSH_DATA46 0x1538
-#define R128_BRUSH_DATA47 0x153c
-#define R128_BRUSH_DATA48 0x1540
-#define R128_BRUSH_DATA49 0x1544
-#define R128_BRUSH_DATA5 0x1494
-#define R128_BRUSH_DATA50 0x1548
-#define R128_BRUSH_DATA51 0x154c
-#define R128_BRUSH_DATA52 0x1550
-#define R128_BRUSH_DATA53 0x1554
-#define R128_BRUSH_DATA54 0x1558
-#define R128_BRUSH_DATA55 0x155c
-#define R128_BRUSH_DATA56 0x1560
-#define R128_BRUSH_DATA57 0x1564
-#define R128_BRUSH_DATA58 0x1568
-#define R128_BRUSH_DATA59 0x156c
-#define R128_BRUSH_DATA6 0x1498
-#define R128_BRUSH_DATA60 0x1570
-#define R128_BRUSH_DATA61 0x1574
-#define R128_BRUSH_DATA62 0x1578
-#define R128_BRUSH_DATA63 0x157c
-#define R128_BRUSH_DATA7 0x149c
-#define R128_BRUSH_DATA8 0x14a0
-#define R128_BRUSH_DATA9 0x14a4
-#define R128_BRUSH_SCALE 0x1470
-#define R128_BRUSH_Y_X 0x1474
-#define R128_BUS_CNTL 0x0030
-# define R128_BUS_MASTER_DIS (1 << 6)
-# define R128_BUS_RD_DISCARD_EN (1 << 24)
-# define R128_BUS_RD_ABORT_EN (1 << 25)
-# define R128_BUS_MSTR_DISCONNECT_EN (1 << 28)
-# define R128_BUS_WRT_BURST (1 << 29)
-# define R128_BUS_READ_BURST (1 << 30)
-#define R128_BUS_CNTL1 0x0034
-# define R128_BUS_WAIT_ON_LOCK_EN (1 << 4)
-
-#define R128_CACHE_CNTL 0x1724
-#define R128_CACHE_LINE 0x0f0c /* PCI */
-#define R128_CAP0_TRIG_CNTL 0x0950 /* ? */
-#define R128_CAP1_TRIG_CNTL 0x09c0 /* ? */
-#define R128_CAPABILITIES_ID 0x0f50 /* PCI */
-#define R128_CAPABILITIES_PTR 0x0f34 /* PCI */
-#define R128_CLK_PIN_CNTL 0x0001 /* PLL */
-#define R128_CLOCK_CNTL_DATA 0x000c
-#define R128_CLOCK_CNTL_INDEX 0x0008
-# define R128_PLL_WR_EN (1 << 7)
-# define R128_PLL_DIV_SEL (3 << 8)
-#define R128_CLR_CMP_CLR_3D 0x1a24
-#define R128_CLR_CMP_CLR_DST 0x15c8
-#define R128_CLR_CMP_CLR_SRC 0x15c4
-#define R128_CLR_CMP_CNTL 0x15c0
-# define R128_SRC_CMP_EQ_COLOR (4 << 0)
-# define R128_SRC_CMP_NEQ_COLOR (5 << 0)
-# define R128_CLR_CMP_SRC_SOURCE (1 << 24)
-#define R128_CLR_CMP_MASK 0x15cc
-# define R128_CLR_CMP_MSK 0xffffffff
-#define R128_CLR_CMP_MASK_3D 0x1A28
-#define R128_COMMAND 0x0f04 /* PCI */
-#define R128_COMPOSITE_SHADOW_ID 0x1a0c
-#define R128_CONFIG_APER_0_BASE 0x0100
-#define R128_CONFIG_APER_1_BASE 0x0104
-#define R128_CONFIG_APER_SIZE 0x0108
-#define R128_CONFIG_BONDS 0x00e8
-#define R128_CONFIG_CNTL 0x00e0
-# define APER_0_BIG_ENDIAN_16BPP_SWAP (1 << 0)
-# define APER_0_BIG_ENDIAN_32BPP_SWAP (2 << 0)
-#define R128_CONFIG_MEMSIZE 0x00f8
-#define R128_CONFIG_MEMSIZE_EMBEDDED 0x0114
-#define R128_CONFIG_REG_1_BASE 0x010c
-#define R128_CONFIG_REG_APER_SIZE 0x0110
-#define R128_CONFIG_XSTRAP 0x00e4
-#define R128_CONSTANT_COLOR_C 0x1d34
-# define R128_CONSTANT_COLOR_MASK 0x00ffffff
-# define R128_CONSTANT_COLOR_ONE 0x00ffffff
-# define R128_CONSTANT_COLOR_ZERO 0x00000000
-#define R128_CRC_CMDFIFO_ADDR 0x0740
-#define R128_CRC_CMDFIFO_DOUT 0x0744
-#define R128_CRTC_CRNT_FRAME 0x0214
-#define R128_CRTC_DEBUG 0x021c
-#define R128_CRTC_EXT_CNTL 0x0054
-# define R128_CRTC_VGA_XOVERSCAN (1 << 0)
-# define R128_VGA_ATI_LINEAR (1 << 3)
-# define R128_XCRT_CNT_EN (1 << 6)
-# define R128_CRTC_HSYNC_DIS (1 << 8)
-# define R128_CRTC_VSYNC_DIS (1 << 9)
-# define R128_CRTC_DISPLAY_DIS (1 << 10)
-# define R128_CRTC_CRT_ON (1 << 15)
-# define R128_FP_OUT_EN (1 << 22)
-# define R128_FP_ACTIVE (1 << 23)
-#define R128_CRTC_EXT_CNTL_DPMS_BYTE 0x0055
-# define R128_CRTC_HSYNC_DIS_BYTE (1 << 0)
-# define R128_CRTC_VSYNC_DIS_BYTE (1 << 1)
-# define R128_CRTC_DISPLAY_DIS_BYTE (1 << 2)
-#define R128_CRTC_GEN_CNTL 0x0050
-# define R128_CRTC_DBL_SCAN_EN (1 << 0)
-# define R128_CRTC_INTERLACE_EN (1 << 1)
-# define R128_CRTC_CSYNC_EN (1 << 4)
-# define R128_CRTC_CUR_EN (1 << 16)
-# define R128_CRTC_CUR_MODE_MASK (7 << 17)
-# define R128_CRTC_ICON_EN (1 << 20)
-# define R128_CRTC_EXT_DISP_EN (1 << 24)
-# define R128_CRTC_EN (1 << 25)
-# define R128_CRTC_DISP_REQ_EN_B (1 << 26)
-#define R128_CRTC_GUI_TRIG_VLINE 0x0218
-#define R128_CRTC_H_SYNC_STRT_WID 0x0204
-# define R128_CRTC_H_SYNC_STRT_PIX (0x07 << 0)
-# define R128_CRTC_H_SYNC_STRT_CHAR (0x1ff << 3)
-# define R128_CRTC_H_SYNC_STRT_CHAR_SHIFT 3
-# define R128_CRTC_H_SYNC_WID (0x3f << 16)
-# define R128_CRTC_H_SYNC_WID_SHIFT 16
-# define R128_CRTC_H_SYNC_POL (1 << 23)
-#define R128_CRTC_H_TOTAL_DISP 0x0200
-# define R128_CRTC_H_TOTAL (0x01ff << 0)
-# define R128_CRTC_H_TOTAL_SHIFT 0
-# define R128_CRTC_H_DISP (0x00ff << 16)
-# define R128_CRTC_H_DISP_SHIFT 16
-#define R128_CRTC_OFFSET 0x0224
-#define R128_CRTC_OFFSET_CNTL 0x0228
-#define R128_CRTC_PITCH 0x022c
-#define R128_CRTC_STATUS 0x005c
-# define R128_CRTC_VBLANK_SAVE (1 << 1)
-#define R128_CRTC_V_SYNC_STRT_WID 0x020c
-# define R128_CRTC_V_SYNC_STRT (0x7ff << 0)
-# define R128_CRTC_V_SYNC_STRT_SHIFT 0
-# define R128_CRTC_V_SYNC_WID (0x1f << 16)
-# define R128_CRTC_V_SYNC_WID_SHIFT 16
-# define R128_CRTC_V_SYNC_POL (1 << 23)
-#define R128_CRTC_V_TOTAL_DISP 0x0208
-# define R128_CRTC_V_TOTAL (0x07ff << 0)
-# define R128_CRTC_V_TOTAL_SHIFT 0
-# define R128_CRTC_V_DISP (0x07ff << 16)
-# define R128_CRTC_V_DISP_SHIFT 16
-#define R128_CRTC_VLINE_CRNT_VLINE 0x0210
-# define R128_CRTC_CRNT_VLINE_MASK (0x7ff << 16)
-#define R128_CRTC2_CRNT_FRAME 0x0314
-#define R128_CRTC2_DEBUG 0x031c
-#define R128_CRTC2_GEN_CNTL 0x03f8
-#define R128_CRTC2_GUI_TRIG_VLINE 0x0318
-#define R128_CRTC2_H_SYNC_STRT_WID 0x0304
-#define R128_CRTC2_H_TOTAL_DISP 0x0300
-#define R128_CRTC2_OFFSET 0x0324
-#define R128_CRTC2_OFFSET_CNTL 0x0328
-#define R128_CRTC2_PITCH 0x032c
-#define R128_CRTC2_STATUS 0x03fc
-#define R128_CRTC2_V_SYNC_STRT_WID 0x030c
-#define R128_CRTC2_V_TOTAL_DISP 0x0308
-#define R128_CRTC2_VLINE_CRNT_VLINE 0x0310
-#define R128_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */
-#define R128_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */
-#define R128_CUR_CLR0 0x026c
-#define R128_CUR_CLR1 0x0270
-#define R128_CUR_HORZ_VERT_OFF 0x0268
-#define R128_CUR_HORZ_VERT_POSN 0x0264
-#define R128_CUR_OFFSET 0x0260
-# define R128_CUR_LOCK (1 << 31)
-
-#define R128_DAC_CNTL 0x0058
-# define R128_DAC_RANGE_CNTL (3 << 0)
-# define R128_DAC_BLANKING (1 << 2)
-# define R128_DAC_CRT_SEL_CRTC2 (1 << 4)
-# define R128_DAC_PALETTE_ACC_CTL (1 << 5)
-# define R128_DAC_8BIT_EN (1 << 8)
-# define R128_DAC_VGA_ADR_EN (1 << 13)
-# define R128_DAC_MASK_ALL (0xff << 24)
-#define R128_DAC_CRC_SIG 0x02cc
-#define R128_DAC_DATA 0x03c9 /* VGA */
-#define R128_DAC_MASK 0x03c6 /* VGA */
-#define R128_DAC_R_INDEX 0x03c7 /* VGA */
-#define R128_DAC_W_INDEX 0x03c8 /* VGA */
-#define R128_DDA_CONFIG 0x02e0
-#define R128_DDA_ON_OFF 0x02e4
-#define R128_DEFAULT_OFFSET 0x16e0
-#define R128_DEFAULT_PITCH 0x16e4
-#define R128_DEFAULT_SC_BOTTOM_RIGHT 0x16e8
-# define R128_DEFAULT_SC_RIGHT_MAX (0x1fff << 0)
-# define R128_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16)
-#define R128_DESTINATION_3D_CLR_CMP_VAL 0x1820
-#define R128_DESTINATION_3D_CLR_CMP_MSK 0x1824
-#define R128_DEVICE_ID 0x0f02 /* PCI */
-#define R128_DP_BRUSH_BKGD_CLR 0x1478
-#define R128_DP_BRUSH_FRGD_CLR 0x147c
-#define R128_DP_CNTL 0x16c0
-# define R128_DST_X_LEFT_TO_RIGHT (1 << 0)
-# define R128_DST_Y_TOP_TO_BOTTOM (1 << 1)
-#define R128_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0
-# define R128_DST_Y_MAJOR (1 << 2)
-# define R128_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15)
-# define R128_DST_X_DIR_LEFT_TO_RIGHT (1 << 31)
-#define R128_DP_DATATYPE 0x16c4
-# define R128_HOST_BIG_ENDIAN_EN (1 << 29)
-#define R128_DP_GUI_MASTER_CNTL 0x146c
-# define R128_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0)
-# define R128_GMC_DST_PITCH_OFFSET_CNTL (1 << 1)
-# define R128_GMC_SRC_CLIPPING (1 << 2)
-# define R128_GMC_DST_CLIPPING (1 << 3)
-# define R128_GMC_BRUSH_DATATYPE_MASK (0x0f << 4)
-# define R128_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4)
-# define R128_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4)
-# define R128_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4)
-# define R128_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4)
-# define R128_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4)
-# define R128_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4)
-# define R128_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4)
-# define R128_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4)
-# define R128_GMC_BRUSH_8x8_COLOR (10 << 4)
-# define R128_GMC_BRUSH_1X8_COLOR (12 << 4)
-# define R128_GMC_BRUSH_SOLID_COLOR (13 << 4)
-# define R128_GMC_BRUSH_NONE (15 << 4)
-# define R128_GMC_DST_8BPP_CI (2 << 8)
-# define R128_GMC_DST_15BPP (3 << 8)
-# define R128_GMC_DST_16BPP (4 << 8)
-# define R128_GMC_DST_24BPP (5 << 8)
-# define R128_GMC_DST_32BPP (6 << 8)
-# define R128_GMC_DST_8BPP_RGB (7 << 8)
-# define R128_GMC_DST_Y8 (8 << 8)
-# define R128_GMC_DST_RGB8 (9 << 8)
-# define R128_GMC_DST_VYUY (11 << 8)
-# define R128_GMC_DST_YVYU (12 << 8)
-# define R128_GMC_DST_AYUV444 (14 << 8)
-# define R128_GMC_DST_ARGB4444 (15 << 8)
-# define R128_GMC_DST_DATATYPE_MASK (0x0f << 8)
-# define R128_GMC_DST_DATATYPE_SHIFT 8
-# define R128_GMC_SRC_DATATYPE_MASK (3 << 12)
-# define R128_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12)
-# define R128_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12)
-# define R128_GMC_SRC_DATATYPE_COLOR (3 << 12)
-# define R128_GMC_BYTE_PIX_ORDER (1 << 14)
-# define R128_GMC_BYTE_MSB_TO_LSB (0 << 14)
-# define R128_GMC_BYTE_LSB_TO_MSB (1 << 14)
-# define R128_GMC_CONVERSION_TEMP (1 << 15)
-# define R128_GMC_CONVERSION_TEMP_6500 (0 << 15)
-# define R128_GMC_CONVERSION_TEMP_9300 (1 << 15)
-# define R128_GMC_ROP3_MASK (0xff << 16)
-# define R128_DP_SRC_SOURCE_MASK (7 << 24)
-# define R128_DP_SRC_SOURCE_MEMORY (2 << 24)
-# define R128_DP_SRC_SOURCE_HOST_DATA (3 << 24)
-# define R128_GMC_3D_FCN_EN (1 << 27)
-# define R128_GMC_CLR_CMP_CNTL_DIS (1 << 28)
-# define R128_GMC_AUX_CLIP_DIS (1 << 29)
-# define R128_GMC_WR_MSK_DIS (1 << 30)
-# define R128_GMC_LD_BRUSH_Y_X (1 << 31)
-# define R128_ROP3_ZERO 0x00000000
-# define R128_ROP3_DSa 0x00880000
-# define R128_ROP3_SDna 0x00440000
-# define R128_ROP3_S 0x00cc0000
-# define R128_ROP3_DSna 0x00220000
-# define R128_ROP3_D 0x00aa0000
-# define R128_ROP3_DSx 0x00660000
-# define R128_ROP3_DSo 0x00ee0000
-# define R128_ROP3_DSon 0x00110000
-# define R128_ROP3_DSxn 0x00990000
-# define R128_ROP3_Dn 0x00550000
-# define R128_ROP3_SDno 0x00dd0000
-# define R128_ROP3_Sn 0x00330000
-# define R128_ROP3_DSno 0x00bb0000
-# define R128_ROP3_DSan 0x00770000
-# define R128_ROP3_ONE 0x00ff0000
-# define R128_ROP3_DPa 0x00a00000
-# define R128_ROP3_PDna 0x00500000
-# define R128_ROP3_P 0x00f00000
-# define R128_ROP3_DPna 0x000a0000
-# define R128_ROP3_D 0x00aa0000
-# define R128_ROP3_DPx 0x005a0000
-# define R128_ROP3_DPo 0x00fa0000
-# define R128_ROP3_DPon 0x00050000
-# define R128_ROP3_PDxn 0x00a50000
-# define R128_ROP3_PDno 0x00f50000
-# define R128_ROP3_Pn 0x000f0000
-# define R128_ROP3_DPno 0x00af0000
-# define R128_ROP3_DPan 0x005f0000
-
-
-#define R128_DP_GUI_MASTER_CNTL_C 0x1c84
-#define R128_DP_MIX 0x16c8
-#define R128_DP_SRC_BKGD_CLR 0x15dc
-#define R128_DP_SRC_FRGD_CLR 0x15d8
-#define R128_DP_WRITE_MASK 0x16cc
-#define R128_DST_BRES_DEC 0x1630
-#define R128_DST_BRES_ERR 0x1628
-#define R128_DST_BRES_INC 0x162c
-#define R128_DST_BRES_LNTH 0x1634
-#define R128_DST_BRES_LNTH_SUB 0x1638
-#define R128_DST_HEIGHT 0x1410
-#define R128_DST_HEIGHT_WIDTH 0x143c
-#define R128_DST_HEIGHT_WIDTH_8 0x158c
-#define R128_DST_HEIGHT_WIDTH_BW 0x15b4
-#define R128_DST_HEIGHT_Y 0x15a0
-#define R128_DST_OFFSET 0x1404
-#define R128_DST_PITCH 0x1408
-#define R128_DST_PITCH_OFFSET 0x142c
-#define R128_DST_PITCH_OFFSET_C 0x1c80
-# define R128_PITCH_SHIFT 21
-# define R128_DST_TILE (1 << 31)
-#define R128_DST_WIDTH 0x140c
-#define R128_DST_WIDTH_HEIGHT 0x1598
-#define R128_DST_WIDTH_X 0x1588
-#define R128_DST_WIDTH_X_INCY 0x159c
-#define R128_DST_X 0x141c
-#define R128_DST_X_SUB 0x15a4
-#define R128_DST_X_Y 0x1594
-#define R128_DST_Y 0x1420
-#define R128_DST_Y_SUB 0x15a8
-#define R128_DST_Y_X 0x1438
-
-#define R128_EXT_MEM_CNTL 0x0144
-
-#define R128_FCP_CNTL 0x0012 /* PLL */
-#define R128_FLUSH_1 0x1704
-#define R128_FLUSH_2 0x1708
-#define R128_FLUSH_3 0x170c
-#define R128_FLUSH_4 0x1710
-#define R128_FLUSH_5 0x1714
-#define R128_FLUSH_6 0x1718
-#define R128_FLUSH_7 0x171c
-#define R128_FOG_3D_TABLE_START 0x1810
-#define R128_FOG_3D_TABLE_END 0x1814
-#define R128_FOG_3D_TABLE_DENSITY 0x181c
-#define R128_FOG_TABLE_INDEX 0x1a14
-#define R128_FOG_TABLE_DATA 0x1a18
-#define R128_FP_CRTC_H_TOTAL_DISP 0x0250
-#define R128_FP_CRTC_V_TOTAL_DISP 0x0254
-#define R128_FP_GEN_CNTL 0x0284
-# define R128_FP_FPON (1 << 0)
-# define R128_FP_BLANK_DIS (1 << 1)
-# define R128_FP_TDMS_EN (1 << 2)
-# define R128_FP_DETECT_SENSE (1 << 8)
-# define R128_FP_SEL_CRTC2 (1 << 13)
-# define R128_FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
-# define R128_FP_CRTC_DONT_SHADOW_HEND (1 << 17)
-# define R128_FP_CRTC_USE_SHADOW_VEND (1 << 18)
-# define R128_FP_CRTC_USE_SHADOW_ROWCUR (1 << 19)
-# define R128_FP_CRTC_HORZ_DIV2_EN (1 << 20)
-# define R128_FP_CRTC_HOR_CRT_DIV2_DIS (1 << 21)
-# define R128_FP_CRT_SYNC_SEL (1 << 23)
-# define R128_FP_USE_SHADOW_EN (1 << 24)
-#define R128_FP_H_SYNC_STRT_WID 0x02c4
-#define R128_FP_HORZ_STRETCH 0x028c
-# define R128_HORZ_STRETCH_RATIO_MASK 0xffff
-# define R128_HORZ_STRETCH_RATIO_SHIFT 0
-# define R128_HORZ_STRETCH_RATIO_MAX 4096
-# define R128_HORZ_PANEL_SIZE (0xff << 16)
-# define R128_HORZ_PANEL_SHIFT 16
-# define R128_AUTO_HORZ_RATIO (0 << 24)
-# define R128_HORZ_STRETCH_PIXREP (0 << 25)
-# define R128_HORZ_STRETCH_BLEND (1 << 25)
-# define R128_HORZ_STRETCH_ENABLE (1 << 26)
-# define R128_HORZ_FP_LOOP_STRETCH (0x7 << 27)
-# define R128_HORZ_STRETCH_RESERVED (1 << 30)
-# define R128_HORZ_AUTO_RATIO_FIX_EN (1 << 31)
-
-#define R128_FP_PANEL_CNTL 0x0288
-# define R128_FP_DIGON (1 << 0)
-# define R128_FP_BLON (1 << 1)
-#define R128_FP_V_SYNC_STRT_WID 0x02c8
-#define R128_FP_VERT_STRETCH 0x0290
-# define R128_VERT_PANEL_SIZE (0x7ff << 0)
-# define R128_VERT_PANEL_SHIFT 0
-# define R128_VERT_STRETCH_RATIO_MASK 0x3ff
-# define R128_VERT_STRETCH_RATIO_SHIFT 11
-# define R128_VERT_STRETCH_RATIO_MAX 1024
-# define R128_VERT_STRETCH_ENABLE (1 << 24)
-# define R128_VERT_STRETCH_LINEREP (0 << 25)
-# define R128_VERT_STRETCH_BLEND (1 << 25)
-# define R128_VERT_AUTO_RATIO_EN (1 << 26)
-# define R128_VERT_STRETCH_RESERVED 0xf8e00000
-
-#define R128_GEN_INT_CNTL 0x0040
-#define R128_GEN_INT_STATUS 0x0044
-# define R128_VSYNC_INT_AK (1 << 2)
-# define R128_VSYNC_INT (1 << 2)
-#define R128_GEN_RESET_CNTL 0x00f0
-# define R128_SOFT_RESET_GUI (1 << 0)
-# define R128_SOFT_RESET_VCLK (1 << 8)
-# define R128_SOFT_RESET_PCLK (1 << 9)
-# define R128_SOFT_RESET_DISPENG_XCLK (1 << 11)
-# define R128_SOFT_RESET_MEMCTLR_XCLK (1 << 12)
-#define R128_GENENB 0x03c3 /* VGA */
-#define R128_GENFC_RD 0x03ca /* VGA */
-#define R128_GENFC_WT 0x03da /* VGA, 0x03ba */
-#define R128_GENMO_RD 0x03cc /* VGA */
-#define R128_GENMO_WT 0x03c2 /* VGA */
-#define R128_GENS0 0x03c2 /* VGA */
-#define R128_GENS1 0x03da /* VGA, 0x03ba */
-#define R128_GPIO_MONID 0x0068
-# define R128_GPIO_MONID_A_0 (1 << 0)
-# define R128_GPIO_MONID_A_1 (1 << 1)
-# define R128_GPIO_MONID_A_2 (1 << 2)
-# define R128_GPIO_MONID_A_3 (1 << 3)
-# define R128_GPIO_MONID_Y_0 (1 << 8)
-# define R128_GPIO_MONID_Y_1 (1 << 9)
-# define R128_GPIO_MONID_Y_2 (1 << 10)
-# define R128_GPIO_MONID_Y_3 (1 << 11)
-# define R128_GPIO_MONID_EN_0 (1 << 16)
-# define R128_GPIO_MONID_EN_1 (1 << 17)
-# define R128_GPIO_MONID_EN_2 (1 << 18)
-# define R128_GPIO_MONID_EN_3 (1 << 19)
-# define R128_GPIO_MONID_MASK_0 (1 << 24)
-# define R128_GPIO_MONID_MASK_1 (1 << 25)
-# define R128_GPIO_MONID_MASK_2 (1 << 26)
-# define R128_GPIO_MONID_MASK_3 (1 << 27)
-#define R128_GPIO_MONIDB 0x006c
-#define R128_GRPH8_DATA 0x03cf /* VGA */
-#define R128_GRPH8_IDX 0x03ce /* VGA */
-#define R128_GUI_DEBUG0 0x16a0
-#define R128_GUI_DEBUG1 0x16a4
-#define R128_GUI_DEBUG2 0x16a8
-#define R128_GUI_DEBUG3 0x16ac
-#define R128_GUI_DEBUG4 0x16b0
-#define R128_GUI_DEBUG5 0x16b4
-#define R128_GUI_DEBUG6 0x16b8
-#define R128_GUI_PROBE 0x16bc
-#define R128_GUI_SCRATCH_REG0 0x15e0
-#define R128_GUI_SCRATCH_REG1 0x15e4
-#define R128_GUI_SCRATCH_REG2 0x15e8
-#define R128_GUI_SCRATCH_REG3 0x15ec
-#define R128_GUI_SCRATCH_REG4 0x15f0
-#define R128_GUI_SCRATCH_REG5 0x15f4
-#define R128_GUI_STAT 0x1740
-# define R128_GUI_FIFOCNT_MASK 0x0fff
-# define R128_GUI_ACTIVE (1 << 31)
-
-#define R128_HEADER 0x0f0e /* PCI */
-#define R128_HOST_DATA0 0x17c0
-#define R128_HOST_DATA1 0x17c4
-#define R128_HOST_DATA2 0x17c8
-#define R128_HOST_DATA3 0x17cc
-#define R128_HOST_DATA4 0x17d0
-#define R128_HOST_DATA5 0x17d4
-#define R128_HOST_DATA6 0x17d8
-#define R128_HOST_DATA7 0x17dc
-#define R128_HOST_DATA_LAST 0x17e0
-#define R128_HOST_PATH_CNTL 0x0130
-#define R128_HTOTAL_CNTL 0x0009 /* PLL */
-#define R128_HW_DEBUG 0x0128
-#define R128_HW_DEBUG2 0x011c
-
-#define R128_I2C_CNTL_1 0x0094 /* ? */
-#define R128_INTERRUPT_LINE 0x0f3c /* PCI */
-#define R128_INTERRUPT_PIN 0x0f3d /* PCI */
-#define R128_IO_BASE 0x0f14 /* PCI */
-
-#define R128_LATENCY 0x0f0d /* PCI */
-#define R128_LEAD_BRES_DEC 0x1608
-#define R128_LEAD_BRES_ERR 0x1600
-#define R128_LEAD_BRES_INC 0x1604
-#define R128_LEAD_BRES_LNTH 0x161c
-#define R128_LEAD_BRES_LNTH_SUB 0x1624
-#define R128_LVDS_GEN_CNTL 0x02d0
-# define R128_LVDS_ON (1 << 0)
-# define R128_LVDS_DISPLAY_DIS (1 << 1)
-# define R128_LVDS_EN (1 << 7)
-# define R128_LVDS_DIGON (1 << 18)
-# define R128_LVDS_BLON (1 << 19)
-# define R128_LVDS_SEL_CRTC2 (1 << 23)
-# define R128_HSYNC_DELAY_SHIFT 28
-# define R128_HSYNC_DELAY_MASK (0xf << 28)
-
-#define R128_MAX_LATENCY 0x0f3f /* PCI */
-#define R128_MCLK_CNTL 0x000f /* PLL */
-# define R128_FORCE_GCP (1 << 16)
-# define R128_FORCE_PIPE3D_CP (1 << 17)
-# define R128_FORCE_RCP (1 << 18)
-#define R128_MDGPIO_A_REG 0x01ac
-#define R128_MDGPIO_EN_REG 0x01b0
-#define R128_MDGPIO_MASK 0x0198
-#define R128_MDGPIO_Y_REG 0x01b4
-#define R128_MEM_ADDR_CONFIG 0x0148
-#define R128_MEM_BASE 0x0f10 /* PCI */
-#define R128_MEM_CNTL 0x0140
-#define R128_MEM_INIT_LAT_TIMER 0x0154
-#define R128_MEM_INTF_CNTL 0x014c
-#define R128_MEM_SDRAM_MODE_REG 0x0158
-#define R128_MEM_STR_CNTL 0x0150
-#define R128_MEM_VGA_RP_SEL 0x003c
-#define R128_MEM_VGA_WP_SEL 0x0038
-#define R128_MIN_GRANT 0x0f3e /* PCI */
-#define R128_MM_DATA 0x0004
-#define R128_MM_INDEX 0x0000
-#define R128_MPLL_CNTL 0x000e /* PLL */
-#define R128_MPP_TB_CONFIG 0x01c0 /* ? */
-#define R128_MPP_GP_CONFIG 0x01c8 /* ? */
-
-#define R128_N_VIF_COUNT 0x0248
-
-#define R128_OVR_CLR 0x0230
-#define R128_OVR_WID_LEFT_RIGHT 0x0234
-#define R128_OVR_WID_TOP_BOTTOM 0x0238
-
-/* first overlay unit (there is only one) */
-
-#define R128_OV0_Y_X_START 0x0400
-#define R128_OV0_Y_X_END 0x0404
-#define R128_OV0_EXCLUSIVE_HORZ 0x0408
-# define R128_EXCL_HORZ_START_MASK 0x000000ff
-# define R128_EXCL_HORZ_END_MASK 0x0000ff00
-# define R128_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000
-# define R128_EXCL_HORZ_EXCLUSIVE_EN 0x80000000
-#define R128_OV0_EXCLUSIVE_VERT 0x040C
-# define R128_EXCL_VERT_START_MASK 0x000003ff
-# define R128_EXCL_VERT_END_MASK 0x03ff0000
-#define R128_OV0_REG_LOAD_CNTL 0x0410
-# define R128_REG_LD_CTL_LOCK 0x00000001L
-# define R128_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L
-# define R128_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L
-# define R128_REG_LD_CTL_LOCK_READBACK 0x00000008L
-#define R128_OV0_SCALE_CNTL 0x0420
-# define R128_SCALER_PIX_EXPAND 0x00000001L
-# define R128_SCALER_Y2R_TEMP 0x00000002L
-# define R128_SCALER_HORZ_PICK_NEAREST 0x00000003L
-# define R128_SCALER_VERT_PICK_NEAREST 0x00000004L
-# define R128_SCALER_SIGNED_UV 0x00000010L
-# define R128_SCALER_GAMMA_SEL_MASK 0x00000060L
-# define R128_SCALER_GAMMA_SEL_BRIGHT 0x00000000L
-# define R128_SCALER_GAMMA_SEL_G22 0x00000020L
-# define R128_SCALER_GAMMA_SEL_G18 0x00000040L
-# define R128_SCALER_GAMMA_SEL_G14 0x00000060L
-# define R128_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L
-# define R128_SCALER_SURFAC_FORMAT 0x00000f00L
-# define R128_SCALER_SOURCE_15BPP 0x00000300L
-# define R128_SCALER_SOURCE_16BPP 0x00000400L
-# define R128_SCALER_SOURCE_32BPP 0x00000600L
-# define R128_SCALER_SOURCE_YUV9 0x00000900L
-# define R128_SCALER_SOURCE_YUV12 0x00000A00L
-# define R128_SCALER_SOURCE_VYUY422 0x00000B00L
-# define R128_SCALER_SOURCE_YVYU422 0x00000C00L
-# define R128_SCALER_SMART_SWITCH 0x00008000L
-# define R128_SCALER_BURST_PER_PLANE 0x00ff0000L
-# define R128_SCALER_DOUBLE_BUFFER 0x01000000L
-# define R128_SCALER_DIS_LIMIT 0x08000000L
-# define R128_SCALER_PRG_LOAD_START 0x10000000L
-# define R128_SCALER_INT_EMU 0x20000000L
-# define R128_SCALER_ENABLE 0x40000000L
-# define R128_SCALER_SOFT_RESET 0x80000000L
-#define R128_OV0_V_INC 0x0424
-#define R128_OV0_P1_V_ACCUM_INIT 0x0428
-# define R128_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L
-# define R128_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L
-#define R128_OV0_P23_V_ACCUM_INIT 0x042C
-#define R128_OV0_P1_BLANK_LINES_AT_TOP 0x0430
-# define R128_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL
-# define R128_P1_ACTIVE_LINES_M1 0x0fff0000L
-#define R128_OV0_P23_BLANK_LINES_AT_TOP 0x0434
-# define R128_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL
-# define R128_P23_ACTIVE_LINES_M1 0x07ff0000L
-#define R128_OV0_VID_BUF0_BASE_ADRS 0x0440
-# define R128_VIF_BUF0_PITCH_SEL 0x00000001L
-# define R128_VIF_BUF0_TILE_ADRS 0x00000002L
-# define R128_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L
-# define R128_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L
-#define R128_OV0_VID_BUF1_BASE_ADRS 0x0444
-# define R128_VIF_BUF1_PITCH_SEL 0x00000001L
-# define R128_VIF_BUF1_TILE_ADRS 0x00000002L
-# define R128_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L
-# define R128_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L
-#define R128_OV0_VID_BUF2_BASE_ADRS 0x0448
-# define R128_VIF_BUF2_PITCH_SEL 0x00000001L
-# define R128_VIF_BUF2_TILE_ADRS 0x00000002L
-# define R128_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L
-# define R128_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L
-#define R128_OV0_VID_BUF3_BASE_ADRS 0x044C
-#define R128_OV0_VID_BUF4_BASE_ADRS 0x0450
-#define R128_OV0_VID_BUF5_BASE_ADRS 0x0454
-#define R128_OV0_VID_BUF_PITCH0_VALUE 0x0460
-#define R128_OV0_VID_BUF_PITCH1_VALUE 0x0464
-#define R128_OV0_AUTO_FLIP_CNTL 0x0470
-#define R128_OV0_DEINTERLACE_PATTERN 0x0474
-#define R128_OV0_H_INC 0x0480
-#define R128_OV0_STEP_BY 0x0484
-#define R128_OV0_P1_H_ACCUM_INIT 0x0488
-#define R128_OV0_P23_H_ACCUM_INIT 0x048C
-#define R128_OV0_P1_X_START_END 0x0494
-#define R128_OV0_P2_X_START_END 0x0498
-#define R128_OV0_P3_X_START_END 0x049C
-#define R128_OV0_FILTER_CNTL 0x04A0
-#define R128_OV0_FOUR_TAP_COEF_0 0x04B0
-#define R128_OV0_FOUR_TAP_COEF_1 0x04B4
-#define R128_OV0_FOUR_TAP_COEF_2 0x04B8
-#define R128_OV0_FOUR_TAP_COEF_3 0x04BC
-#define R128_OV0_FOUR_TAP_COEF_4 0x04C0
-#define R128_OV0_COLOUR_CNTL 0x04E0
-#define R128_OV0_VIDEO_KEY_CLR 0x04E4
-#define R128_OV0_VIDEO_KEY_MSK 0x04E8
-#define R128_OV0_GRAPHICS_KEY_CLR 0x04EC
-#define R128_OV0_GRAPHICS_KEY_MSK 0x04F0
-#define R128_OV0_KEY_CNTL 0x04F4
-# define R128_VIDEO_KEY_FN_MASK 0x00000007L
-# define R128_VIDEO_KEY_FN_FALSE 0x00000000L
-# define R128_VIDEO_KEY_FN_TRUE 0x00000001L
-# define R128_VIDEO_KEY_FN_EQ 0x00000004L
-# define R128_VIDEO_KEY_FN_NE 0x00000005L
-# define R128_GRAPHIC_KEY_FN_MASK 0x00000070L
-# define R128_GRAPHIC_KEY_FN_FALSE 0x00000000L
-# define R128_GRAPHIC_KEY_FN_TRUE 0x00000010L
-# define R128_GRAPHIC_KEY_FN_EQ 0x00000040L
-# define R128_GRAPHIC_KEY_FN_NE 0x00000050L
-# define R128_CMP_MIX_MASK 0x00000100L
-# define R128_CMP_MIX_OR 0x00000000L
-# define R128_CMP_MIX_AND 0x00000100L
-#define R128_OV0_TEST 0x04F8
-
-
-#define R128_PALETTE_DATA 0x00b4
-#define R128_PALETTE_INDEX 0x00b0
-#define R128_PC_DEBUG_MODE 0x1760
-#define R128_PC_GUI_CTLSTAT 0x1748
-#define R128_PC_GUI_MODE 0x1744
-# define R128_PC_IGNORE_UNIFY (1 << 5)
-#define R128_PC_MISC_CNTL 0x0188
-#define R128_PC_NGUI_CTLSTAT 0x0184
-# define R128_PC_FLUSH_GUI (3 << 0)
-# define R128_PC_RI_GUI (1 << 2)
-# define R128_PC_FLUSH_ALL 0x00ff
-# define R128_PC_BUSY (1 << 31)
-#define R128_PC_NGUI_MODE 0x0180
-#define R128_PCI_GART_PAGE 0x017c
-#define R128_PLANE_3D_MASK_C 0x1d44
-#define R128_PLL_TEST_CNTL 0x0013 /* PLL */
-#define R128_PMI_CAP_ID 0x0f5c /* PCI */
-#define R128_PMI_DATA 0x0f63 /* PCI */
-#define R128_PMI_NXT_CAP_PTR 0x0f5d /* PCI */
-#define R128_PMI_PMC_REG 0x0f5e /* PCI */
-#define R128_PMI_PMCSR_REG 0x0f60 /* PCI */
-#define R128_PMI_REGISTER 0x0f5c /* PCI */
-#define R128_PPLL_CNTL 0x0002 /* PLL */
-# define R128_PPLL_RESET (1 << 0)
-# define R128_PPLL_SLEEP (1 << 1)
-# define R128_PPLL_ATOMIC_UPDATE_EN (1 << 16)
-# define R128_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
-#define R128_PPLL_DIV_0 0x0004 /* PLL */
-#define R128_PPLL_DIV_1 0x0005 /* PLL */
-#define R128_PPLL_DIV_2 0x0006 /* PLL */
-#define R128_PPLL_DIV_3 0x0007 /* PLL */
-# define R128_PPLL_FB3_DIV_MASK 0x07ff
-# define R128_PPLL_POST3_DIV_MASK 0x00070000
-#define R128_PPLL_REF_DIV 0x0003 /* PLL */
-# define R128_PPLL_REF_DIV_MASK 0x03ff
-# define R128_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
-# define R128_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
-#define R128_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */
-#define R128_REG_BASE 0x0f18 /* PCI */
-#define R128_REGPROG_INF 0x0f09 /* PCI */
-#define R128_REVISION_ID 0x0f08 /* PCI */
-
-#define R128_SC_BOTTOM 0x164c
-#define R128_SC_BOTTOM_RIGHT 0x16f0
-#define R128_SC_BOTTOM_RIGHT_C 0x1c8c
-#define R128_SC_LEFT 0x1640
-#define R128_SC_RIGHT 0x1644
-#define R128_SC_TOP 0x1648
-#define R128_SC_TOP_LEFT 0x16ec
-#define R128_SC_TOP_LEFT_C 0x1c88
-#define R128_SEQ8_DATA 0x03c5 /* VGA */
-#define R128_SEQ8_IDX 0x03c4 /* VGA */
-#define R128_SNAPSHOT_F_COUNT 0x0244
-#define R128_SNAPSHOT_VH_COUNTS 0x0240
-#define R128_SNAPSHOT_VIF_COUNT 0x024c
-#define R128_SRC_OFFSET 0x15ac
-#define R128_SRC_PITCH 0x15b0
-#define R128_SRC_PITCH_OFFSET 0x1428
-#define R128_SRC_SC_BOTTOM 0x165c
-#define R128_SRC_SC_BOTTOM_RIGHT 0x16f4
-#define R128_SRC_SC_RIGHT 0x1654
-#define R128_SRC_X 0x1414
-#define R128_SRC_X_Y 0x1590
-#define R128_SRC_Y 0x1418
-#define R128_SRC_Y_X 0x1434
-#define R128_STATUS 0x0f06 /* PCI */
-#define R128_SUBPIC_CNTL 0x0540 /* ? */
-#define R128_SUB_CLASS 0x0f0a /* PCI */
-#define R128_SURFACE_DELAY 0x0b00
-#define R128_SURFACE0_INFO 0x0b0c
-#define R128_SURFACE0_LOWER_BOUND 0x0b04
-#define R128_SURFACE0_UPPER_BOUND 0x0b08
-#define R128_SURFACE1_INFO 0x0b1c
-#define R128_SURFACE1_LOWER_BOUND 0x0b14
-#define R128_SURFACE1_UPPER_BOUND 0x0b18
-#define R128_SURFACE2_INFO 0x0b2c
-#define R128_SURFACE2_LOWER_BOUND 0x0b24
-#define R128_SURFACE2_UPPER_BOUND 0x0b28
-#define R128_SURFACE3_INFO 0x0b3c
-#define R128_SURFACE3_LOWER_BOUND 0x0b34
-#define R128_SURFACE3_UPPER_BOUND 0x0b38
-#define R128_SW_SEMAPHORE 0x013c
-
-#define R128_TEST_DEBUG_CNTL 0x0120
-#define R128_TEST_DEBUG_MUX 0x0124
-#define R128_TEST_DEBUG_OUT 0x012c
-#define R128_TMDS_CRC 0x02a0
-#define R128_TMDS_TRANSMITTER_CNTL 0x02a4
-# define R128_TMDS_PLLEN (1 << 0)
-# define R128_TMDS_PLLRST (1 << 1)
-#define R128_TRAIL_BRES_DEC 0x1614
-#define R128_TRAIL_BRES_ERR 0x160c
-#define R128_TRAIL_BRES_INC 0x1610
-#define R128_TRAIL_X 0x1618
-#define R128_TRAIL_X_SUB 0x1620
-
-#define R128_VCLK_ECP_CNTL 0x0008 /* PLL */
-#define R128_VENDOR_ID 0x0f00 /* PCI */
-#define R128_VGA_DDA_CONFIG 0x02e8
-#define R128_VGA_DDA_ON_OFF 0x02ec
-#define R128_VID_BUFFER_CONTROL 0x0900
-#define R128_VIDEOMUX_CNTL 0x0190
-#define R128_VIPH_CONTROL 0x01D0 /* ? */
-
-#define R128_WAIT_UNTIL 0x1720
-
-#define R128_X_MPLL_REF_FB_DIV 0x000a /* PLL */
-#define R128_XCLK_CNTL 0x000d /* PLL */
-#define R128_XDLL_CNTL 0x000c /* PLL */
-#define R128_XPLL_CNTL 0x000b /* PLL */
-
- /* Registers for CCE and Microcode Engine */
-#define R128_PM4_MICROCODE_ADDR 0x07d4
-#define R128_PM4_MICROCODE_RADDR 0x07d8
-#define R128_PM4_MICROCODE_DATAH 0x07dc
-#define R128_PM4_MICROCODE_DATAL 0x07e0
-
-#define R128_PM4_BUFFER_OFFSET 0x0700
-#define R128_PM4_BUFFER_CNTL 0x0704
-# define R128_PM4_NONPM4 (0 << 28)
-# define R128_PM4_192PIO (1 << 28)
-# define R128_PM4_192BM (2 << 28)
-# define R128_PM4_128PIO_64INDBM (3 << 28)
-# define R128_PM4_128BM_64INDBM (4 << 28)
-# define R128_PM4_64PIO_128INDBM (5 << 28)
-# define R128_PM4_64BM_128INDBM (6 << 28)
-# define R128_PM4_64PIO_64VCBM_64INDBM (7 << 28)
-# define R128_PM4_64BM_64VCBM_64INDBM (8 << 28)
-# define R128_PM4_64PIO_64VCPIO_64INDPIO (15 << 28)
-#define R128_PM4_BUFFER_WM_CNTL 0x0708
-# define R128_WMA_SHIFT 0
-# define R128_WMB_SHIFT 8
-# define R128_WMC_SHIFT 16
-# define R128_WB_WM_SHIFT 24
-#define R128_PM4_BUFFER_DL_RPTR_ADDR 0x070c
-#define R128_PM4_BUFFER_DL_RPTR 0x0710
-#define R128_PM4_BUFFER_DL_WPTR 0x0714
-# define R128_PM4_BUFFER_DL_DONE (1 << 31)
-#define R128_PM4_BUFFER_DL_WPTR_DELAY 0x0718
-# define R128_PRE_WRITE_TIMER_SHIFT 0
-# define R128_PRE_WRITE_LIMIT_SHIFT 23
-#define R128_PM4_VC_FPU_SETUP 0x071c
-# define R128_FRONT_DIR_CW (0 << 0)
-# define R128_FRONT_DIR_CCW (1 << 0)
-# define R128_FRONT_DIR_MASK (1 << 0)
-# define R128_BACKFACE_CULL (0 << 1)
-# define R128_BACKFACE_POINTS (1 << 1)
-# define R128_BACKFACE_LINES (2 << 1)
-# define R128_BACKFACE_SOLID (3 << 1)
-# define R128_BACKFACE_MASK (3 << 1)
-# define R128_FRONTFACE_CULL (0 << 3)
-# define R128_FRONTFACE_POINTS (1 << 3)
-# define R128_FRONTFACE_LINES (2 << 3)
-# define R128_FRONTFACE_SOLID (3 << 3)
-# define R128_FRONTFACE_MASK (3 << 3)
-# define R128_FPU_COLOR_SOLID (0 << 5)
-# define R128_FPU_COLOR_FLAT (1 << 5)
-# define R128_FPU_COLOR_GOURAUD (2 << 5)
-# define R128_FPU_COLOR_GOURAUD2 (3 << 5)
-# define R128_FPU_COLOR_MASK (3 << 5)
-# define R128_FPU_SUB_PIX_2BITS (0 << 7)
-# define R128_FPU_SUB_PIX_4BITS (1 << 7)
-# define R128_FPU_MODE_2D (0 << 8)
-# define R128_FPU_MODE_3D (1 << 8)
-# define R128_TRAP_BITS_DISABLE (1 << 9)
-# define R128_EDGE_ANTIALIAS (1 << 10)
-# define R128_SUPERSAMPLE (1 << 11)
-# define R128_XFACTOR_2 (0 << 12)
-# define R128_XFACTOR_4 (1 << 12)
-# define R128_YFACTOR_2 (0 << 13)
-# define R128_YFACTOR_4 (1 << 13)
-# define R128_FLAT_SHADE_VERTEX_D3D (0 << 14)
-# define R128_FLAT_SHADE_VERTEX_OGL (1 << 14)
-# define R128_FPU_ROUND_TRUNCATE (0 << 15)
-# define R128_FPU_ROUND_NEAREST (1 << 15)
-# define R128_WM_SEL_8DW (0 << 16)
-# define R128_WM_SEL_16DW (1 << 16)
-# define R128_WM_SEL_32DW (2 << 16)
-#define R128_PM4_VC_DEBUG_CONFIG 0x07a4
-#define R128_PM4_VC_STAT 0x07a8
-#define R128_PM4_VC_TIMESTAMP0 0x07b0
-#define R128_PM4_VC_TIMESTAMP1 0x07b4
-#define R128_PM4_STAT 0x07b8
-# define R128_PM4_FIFOCNT_MASK 0x0fff
-# define R128_PM4_BUSY (1 << 16)
-# define R128_PM4_GUI_ACTIVE (1 << 31)
-#define R128_PM4_BUFFER_ADDR 0x07f0
-#define R128_PM4_MICRO_CNTL 0x07fc
-# define R128_PM4_MICRO_FREERUN (1 << 30)
-#define R128_PM4_FIFO_DATA_EVEN 0x1000
-#define R128_PM4_FIFO_DATA_ODD 0x1004
-
-#define R128_SCALE_3D_CNTL 0x1a00
-# define R128_SCALE_DITHER_ERR_DIFF (0 << 1)
-# define R128_SCALE_DITHER_TABLE (1 << 1)
-# define R128_TEX_CACHE_SIZE_FULL (0 << 2)
-# define R128_TEX_CACHE_SIZE_HALF (1 << 2)
-# define R128_DITHER_INIT_CURR (0 << 3)
-# define R128_DITHER_INIT_RESET (1 << 3)
-# define R128_ROUND_24BIT (1 << 4)
-# define R128_TEX_CACHE_DISABLE (1 << 5)
-# define R128_SCALE_3D_NOOP (0 << 6)
-# define R128_SCALE_3D_SCALE (1 << 6)
-# define R128_SCALE_3D_TEXMAP_SHADE (2 << 6)
-# define R128_SCALE_PIX_BLEND (0 << 8)
-# define R128_SCALE_PIX_REPLICATE (1 << 8)
-# define R128_TEX_CACHE_SPLIT (1 << 9)
-# define R128_APPLE_YUV_MODE (1 << 10)
-# define R128_TEX_CACHE_PALLETE_MODE (1 << 11)
-# define R128_ALPHA_COMB_ADD_CLAMP (0 << 12)
-# define R128_ALPHA_COMB_ADD_NCLAMP (1 << 12)
-# define R128_ALPHA_COMB_SUB_SRC_DST_CLAMP (2 << 12)
-# define R128_ALPHA_COMB_SUB_SRC_DST_NCLAMP (3 << 12)
-# define R128_ALPHA_COMB_FCN_MASK (3 << 12)
-# define R128_FOG_VERTEX (0 << 14)
-# define R128_FOG_TABLE (1 << 14)
-# define R128_SIGNED_DST_CLAMP (1 << 15)
-
-# define R128_ALPHA_BLEND_ZERO (0 )
-# define R128_ALPHA_BLEND_ONE (1 )
-# define R128_ALPHA_BLEND_SRCCOLOR (2 )
-# define R128_ALPHA_BLEND_INVSRCCOLOR (3 )
-# define R128_ALPHA_BLEND_SRCALPHA (4 )
-# define R128_ALPHA_BLEND_INVSRCALPHA (5 )
-# define R128_ALPHA_BLEND_DSTALPHA (6 )
-# define R128_ALPHA_BLEND_INVDSTALPHA (7 )
-# define R128_ALPHA_BLEND_DSTCOLOR (8 )
-# define R128_ALPHA_BLEND_INVDSTCOLOR (9 )
-# define R128_ALPHA_BLEND_SAT (10) /* aka SRCALPHASAT */
-# define R128_ALPHA_BLEND_BLEND (11) /* aka BOTHSRCALPHA */
-# define R128_ALPHA_BLEND_INVBLEND (12) /* aka BOTHINVSRCALPHA */
-# define R128_ALPHA_BLEND_MASK (15)
-
-# define R128_ALPHA_BLEND_SRC_SHIFT (16)
-# define R128_ALPHA_BLEND_DST_SHIFT (20)
-
-# define R128_ALPHA_TEST_NEVER (0 << 24)
-# define R128_ALPHA_TEST_LESS (1 << 24)
-# define R128_ALPHA_TEST_LESSEQUAL (2 << 24)
-# define R128_ALPHA_TEST_EQUAL (3 << 24)
-# define R128_ALPHA_TEST_GREATEREQUAL (4 << 24)
-# define R128_ALPHA_TEST_GREATER (5 << 24)
-# define R128_ALPHA_TEST_NEQUAL (6 << 24)
-# define R128_ALPHA_TEST_ALWAYS (7 << 24)
-# define R128_ALPHA_TEST_MASK (7 << 24)
-# define R128_COMPOSITE_SHADOW_CMP_EQUAL (0 << 28)
-# define R128_COMPOSITE_SHADOW_CMP_NEQUAL (1 << 28)
-# define R128_COMPOSITE_SHADOW (1 << 29)
-# define R128_TEX_MAP_ALPHA_IN_TEXTURE (1 << 30)
-# define R128_TEX_CACHE_LINE_SIZE_8QW (0 << 31)
-# define R128_TEX_CACHE_LINE_SIZE_4QW (1 << 31)
-#define R128_SCALE_3D_DATATYPE 0x1a20
-
-#define R128_SETUP_CNTL 0x1bc4
-# define R128_DONT_START_TRIANGLE (1 << 0)
-# define R128_Z_BIAS (0 << 1)
-# define R128_DONT_START_ANY_ON (1 << 2)
-# define R128_COLOR_SOLID_COLOR (0 << 3)
-# define R128_COLOR_FLAT_VERT_1 (1 << 3)
-# define R128_COLOR_FLAT_VERT_2 (2 << 3)
-# define R128_COLOR_FLAT_VERT_3 (3 << 3)
-# define R128_COLOR_GOURAUD (4 << 3)
-# define R128_PRIM_TYPE_TRI (0 << 7)
-# define R128_PRIM_TYPE_LINE (1 << 7)
-# define R128_PRIM_TYPE_POINT (2 << 7)
-# define R128_PRIM_TYPE_POLY_EDGE (3 << 7)
-# define R128_TEXTURE_ST_MULT_W (0 << 9)
-# define R128_TEXTURE_ST_DIRECT (1 << 9)
-# define R128_STARTING_VERTEX_1 (1 << 14)
-# define R128_STARTING_VERTEX_2 (2 << 14)
-# define R128_STARTING_VERTEX_3 (3 << 14)
-# define R128_ENDING_VERTEX_1 (1 << 16)
-# define R128_ENDING_VERTEX_2 (2 << 16)
-# define R128_ENDING_VERTEX_3 (3 << 16)
-# define R128_SU_POLY_LINE_LAST (0 << 18)
-# define R128_SU_POLY_LINE_NOT_LAST (1 << 18)
-# define R128_SUB_PIX_2BITS (0 << 19)
-# define R128_SUB_PIX_4BITS (1 << 19)
-# define R128_SET_UP_CONTINUE (1 << 31)
-
-#define R128_WINDOW_XY_OFFSET 0x1bcc
-# define R128_WINDOW_Y_SHIFT 4
-# define R128_WINDOW_X_SHIFT 20
-
-#define R128_Z_OFFSET_C 0x1c90
-#define R128_Z_PITCH_C 0x1c94
-# define R128_Z_TILE (1 << 16)
-#define R128_Z_STEN_CNTL_C 0x1c98
-# define R128_Z_PIX_WIDTH_16 (0 << 1)
-# define R128_Z_PIX_WIDTH_24 (1 << 1)
-# define R128_Z_PIX_WIDTH_32 (2 << 1)
-# define R128_Z_PIX_WIDTH_MASK (3 << 1)
-# define R128_Z_TEST_NEVER (0 << 4)
-# define R128_Z_TEST_LESS (1 << 4)
-# define R128_Z_TEST_LESSEQUAL (2 << 4)
-# define R128_Z_TEST_EQUAL (3 << 4)
-# define R128_Z_TEST_GREATEREQUAL (4 << 4)
-# define R128_Z_TEST_GREATER (5 << 4)
-# define R128_Z_TEST_NEQUAL (6 << 4)
-# define R128_Z_TEST_ALWAYS (7 << 4)
-# define R128_Z_TEST_MASK (7 << 4)
-# define R128_STENCIL_TEST_NEVER (0 << 12)
-# define R128_STENCIL_TEST_LESS (1 << 12)
-# define R128_STENCIL_TEST_LESSEQUAL (2 << 12)
-# define R128_STENCIL_TEST_EQUAL (3 << 12)
-# define R128_STENCIL_TEST_GREATEREQUAL (4 << 12)
-# define R128_STENCIL_TEST_GREATER (5 << 12)
-# define R128_STENCIL_TEST_NEQUAL (6 << 12)
-# define R128_STENCIL_TEST_ALWAYS (7 << 12)
-# define R128_STENCIL_S_FAIL_KEEP (0 << 16)
-# define R128_STENCIL_S_FAIL_ZERO (1 << 16)
-# define R128_STENCIL_S_FAIL_REPLACE (2 << 16)
-# define R128_STENCIL_S_FAIL_INC (3 << 16)
-# define R128_STENCIL_S_FAIL_DEC (4 << 16)
-# define R128_STENCIL_S_FAIL_INV (5 << 16)
-# define R128_STENCIL_ZPASS_KEEP (0 << 20)
-# define R128_STENCIL_ZPASS_ZERO (1 << 20)
-# define R128_STENCIL_ZPASS_REPLACE (2 << 20)
-# define R128_STENCIL_ZPASS_INC (3 << 20)
-# define R128_STENCIL_ZPASS_DEC (4 << 20)
-# define R128_STENCIL_ZPASS_INV (5 << 20)
-# define R128_STENCIL_ZFAIL_KEEP (0 << 24)
-# define R128_STENCIL_ZFAIL_ZERO (1 << 24)
-# define R128_STENCIL_ZFAIL_REPLACE (2 << 24)
-# define R128_STENCIL_ZFAIL_INC (3 << 24)
-# define R128_STENCIL_ZFAIL_DEC (4 << 24)
-# define R128_STENCIL_ZFAIL_INV (5 << 24)
-#define R128_TEX_CNTL_C 0x1c9c
-# define R128_Z_ENABLE (1 << 0)
-# define R128_Z_WRITE_ENABLE (1 << 1)
-# define R128_STENCIL_ENABLE (1 << 3)
-# define R128_SHADE_ENABLE (0 << 4)
-# define R128_TEXMAP_ENABLE (1 << 4)
-# define R128_SEC_TEXMAP_ENABLE (1 << 5)
-# define R128_FOG_ENABLE (1 << 7)
-# define R128_DITHER_ENABLE (1 << 8)
-# define R128_ALPHA_ENABLE (1 << 9)
-# define R128_ALPHA_TEST_ENABLE (1 << 10)
-# define R128_SPEC_LIGHT_ENABLE (1 << 11)
-# define R128_TEX_CHROMA_KEY_ENABLE (1 << 12)
-# define R128_ALPHA_IN_TEX_COMPLETE_A (0 << 13)
-# define R128_ALPHA_IN_TEX_LSB_A (1 << 13)
-# define R128_LIGHT_DIS (0 << 14)
-# define R128_LIGHT_COPY (1 << 14)
-# define R128_LIGHT_MODULATE (2 << 14)
-# define R128_LIGHT_ADD (3 << 14)
-# define R128_LIGHT_BLEND_CONSTANT (4 << 14)
-# define R128_LIGHT_BLEND_TEXTURE (5 << 14)
-# define R128_LIGHT_BLEND_VERTEX (6 << 14)
-# define R128_LIGHT_BLEND_CONST_COLOR (7 << 14)
-# define R128_ALPHA_LIGHT_DIS (0 << 18)
-# define R128_ALPHA_LIGHT_COPY (1 << 18)
-# define R128_ALPHA_LIGHT_MODULATE (2 << 18)
-# define R128_ALPHA_LIGHT_ADD (3 << 18)
-# define R128_ANTI_ALIAS (1 << 21)
-# define R128_TEX_CACHE_FLUSH (1 << 23)
-# define R128_LOD_BIAS_SHIFT 24
-# define R128_LOD_BIAS_MASK (0xff << 24)
-#define R128_MISC_3D_STATE_CNTL_REG 0x1ca0
-# define R128_REF_ALPHA_MASK 0xff
-# define R128_MISC_SCALE_3D_NOOP (0 << 8)
-# define R128_MISC_SCALE_3D_SCALE (1 << 8)
-# define R128_MISC_SCALE_3D_TEXMAP_SHADE (2 << 8)
-# define R128_MISC_SCALE_PIX_BLEND (0 << 10)
-# define R128_MISC_SCALE_PIX_REPLICATE (1 << 10)
-/* Bits [14:12] are the same as R128_SCALE_3D_CNTL */
-/* Bit [15] is unknown */
-/* Bits [26:16] are the same as R128_SCALE_3D_CNTL */
-/* Bits [31:27] are unknown */
-
-#define R128_TEXTURE_CLR_CMP_CLR_C 0x1ca4
-#define R128_TEXTURE_CLR_CMP_MSK_C 0x1ca8
-#define R128_FOG_COLOR_C 0x1cac
-# define R128_FOG_BLUE_SHIFT 0
-# define R128_FOG_GREEN_SHIFT 8
-# define R128_FOG_RED_SHIFT 16
-#define R128_PRIM_TEX_CNTL_C 0x1cb0
-# define R128_MIN_BLEND_NEAREST (0 << 1)
-# define R128_MIN_BLEND_LINEAR (1 << 1)
-# define R128_MIN_BLEND_MIPNEAREST (2 << 1)
-# define R128_MIN_BLEND_MIPLINEAR (3 << 1)
-# define R128_MIN_BLEND_LINEARMIPNEAREST (4 << 1)
-# define R128_MIN_BLEND_LINEARMIPLINEAR (5 << 1)
-# define R128_MIN_BLEND_MASK (7 << 1)
-# define R128_MAG_BLEND_NEAREST (0 << 4)
-# define R128_MAG_BLEND_LINEAR (1 << 4)
-# define R128_MAG_BLEND_MASK (7 << 4)
-# define R128_MIP_MAP_DISABLE (1 << 7)
-# define R128_TEX_CLAMP_S_WRAP (0 << 8)
-# define R128_TEX_CLAMP_S_MIRROR (1 << 8)
-# define R128_TEX_CLAMP_S_CLAMP (2 << 8)
-# define R128_TEX_CLAMP_S_BORDER_COLOR (3 << 8)
-# define R128_TEX_CLAMP_S_MASK (3 << 8)
-# define R128_TEX_WRAP_S (1 << 10)
-# define R128_TEX_CLAMP_T_WRAP (0 << 11)
-# define R128_TEX_CLAMP_T_MIRROR (1 << 11)
-# define R128_TEX_CLAMP_T_CLAMP (2 << 11)
-# define R128_TEX_CLAMP_T_BORDER_COLOR (3 << 11)
-# define R128_TEX_CLAMP_T_MASK (3 << 11)
-# define R128_TEX_WRAP_T (1 << 13)
-# define R128_TEX_PERSPECTIVE_DISABLE (1 << 14)
-# define R128_DATATYPE_VQ (0 << 16)
-# define R128_DATATYPE_CI4 (1 << 16)
-# define R128_DATATYPE_CI8 (2 << 16)
-# define R128_DATATYPE_ARGB1555 (3 << 16)
-# define R128_DATATYPE_RGB565 (4 << 16)
-# define R128_DATATYPE_RGB888 (5 << 16)
-# define R128_DATATYPE_ARGB8888 (6 << 16)
-# define R128_DATATYPE_RGB332 (7 << 16)
-# define R128_DATATYPE_Y8 (8 << 16)
-# define R128_DATATYPE_RGB8 (9 << 16)
-# define R128_DATATYPE_CI16 (10 << 16)
-# define R128_DATATYPE_YVYU422 (11 << 16)
-# define R128_DATATYPE_VYUY422 (12 << 16)
-# define R128_DATATYPE_AYUV444 (14 << 16)
-# define R128_DATATYPE_ARGB4444 (15 << 16)
-# define R128_PALLETE_EITHER (0 << 20)
-# define R128_PALLETE_1 (1 << 20)
-# define R128_PALLETE_2 (2 << 20)
-# define R128_PSEUDOCOLOR_DT_RGB565 (0 << 24)
-# define R128_PSEUDOCOLOR_DT_ARGB1555 (1 << 24)
-# define R128_PSEUDOCOLOR_DT_ARGB4444 (2 << 24)
-#define R128_PRIM_TEXTURE_COMBINE_CNTL_C 0x1cb4
-# define R128_COMB_DIS (0 << 0)
-# define R128_COMB_COPY (1 << 0)
-# define R128_COMB_COPY_INP (2 << 0)
-# define R128_COMB_MODULATE (3 << 0)
-# define R128_COMB_MODULATE2X (4 << 0)
-# define R128_COMB_MODULATE4X (5 << 0)
-# define R128_COMB_ADD (6 << 0)
-# define R128_COMB_ADD_SIGNED (7 << 0)
-# define R128_COMB_BLEND_VERTEX (8 << 0)
-# define R128_COMB_BLEND_TEXTURE (9 << 0)
-# define R128_COMB_BLEND_CONST (10 << 0)
-# define R128_COMB_BLEND_PREMULT (11 << 0)
-# define R128_COMB_BLEND_PREV (12 << 0)
-# define R128_COMB_BLEND_PREMULT_INV (13 << 0)
-# define R128_COMB_ADD_SIGNED2X (14 << 0)
-# define R128_COMB_BLEND_CONST_COLOR (15 << 0)
-# define R128_COMB_MASK (15 << 0)
-# define R128_COLOR_FACTOR_CONST_COLOR (0 << 4)
-# define R128_COLOR_FACTOR_NCONST_COLOR (1 << 4)
-# define R128_COLOR_FACTOR_TEX (4 << 4)
-# define R128_COLOR_FACTOR_NTEX (5 << 4)
-# define R128_COLOR_FACTOR_ALPHA (6 << 4)
-# define R128_COLOR_FACTOR_NALPHA (7 << 4)
-# define R128_COLOR_FACTOR_PREV_COLOR (8 << 4)
-# define R128_COLOR_FACTOR_MASK (15 << 4)
-# define R128_COMB_FCN_MSB (1 << 8)
-# define R128_INPUT_FACTOR_CONST_COLOR (2 << 10)
-# define R128_INPUT_FACTOR_CONST_ALPHA (3 << 10)
-# define R128_INPUT_FACTOR_INT_COLOR (4 << 10)
-# define R128_INPUT_FACTOR_INT_ALPHA (5 << 10)
-# define R128_INPUT_FACTOR_MASK (15 << 10)
-# define R128_COMB_ALPHA_DIS (0 << 14)
-# define R128_COMB_ALPHA_COPY (1 << 14)
-# define R128_COMB_ALPHA_COPY_INP (2 << 14)
-# define R128_COMB_ALPHA_MODULATE (3 << 14)
-# define R128_COMB_ALPHA_MODULATE2X (4 << 14)
-# define R128_COMB_ALPHA_MODULATE4X (5 << 14)
-# define R128_COMB_ALPHA_ADD (6 << 14)
-# define R128_COMB_ALPHA_ADD_SIGNED (7 << 14)
-# define R128_COMB_ALPHA_ADD_SIGNED2X (14 << 14)
-# define R128_COMB_ALPHA_MASK (15 << 14)
-# define R128_ALPHA_FACTOR_TEX_ALPHA (6 << 18)
-# define R128_ALPHA_FACTOR_NTEX_ALPHA (7 << 18)
-# define R128_ALPHA_FACTOR_MASK (15 << 18)
-# define R128_INP_FACTOR_A_CONST_ALPHA (1 << 25)
-# define R128_INP_FACTOR_A_INT_ALPHA (2 << 25)
-# define R128_INP_FACTOR_A_MASK (7 << 25)
-#define R128_TEX_SIZE_PITCH_C 0x1cb8
-# define R128_TEX_PITCH_SHIFT 0
-# define R128_TEX_SIZE_SHIFT 4
-# define R128_TEX_HEIGHT_SHIFT 8
-# define R128_TEX_MIN_SIZE_SHIFT 12
-# define R128_SEC_TEX_PITCH_SHIFT 16
-# define R128_SEC_TEX_SIZE_SHIFT 20
-# define R128_SEC_TEX_HEIGHT_SHIFT 24
-# define R128_SEC_TEX_MIN_SIZE_SHIFT 28
-# define R128_TEX_PITCH_MASK (0x0f << 0)
-# define R128_TEX_SIZE_MASK (0x0f << 4)
-# define R128_TEX_HEIGHT_MASK (0x0f << 8)
-# define R128_TEX_MIN_SIZE_MASK (0x0f << 12)
-# define R128_SEC_TEX_PITCH_MASK (0x0f << 16)
-# define R128_SEC_TEX_SIZE_MASK (0x0f << 20)
-# define R128_SEC_TEX_HEIGHT_MASK (0x0f << 24)
-# define R128_SEC_TEX_MIN_SIZE_MASK (0x0f << 28)
-# define R128_TEX_SIZE_PITCH_SHIFT 0
-# define R128_SEC_TEX_SIZE_PITCH_SHIFT 16
-# define R128_TEX_SIZE_PITCH_MASK (0xffff << 0)
-# define R128_SEC_TEX_SIZE_PITCH_MASK (0xffff << 16)
-#define R128_PRIM_TEX_0_OFFSET_C 0x1cbc
-#define R128_PRIM_TEX_1_OFFSET_C 0x1cc0
-#define R128_PRIM_TEX_2_OFFSET_C 0x1cc4
-#define R128_PRIM_TEX_3_OFFSET_C 0x1cc8
-#define R128_PRIM_TEX_4_OFFSET_C 0x1ccc
-#define R128_PRIM_TEX_5_OFFSET_C 0x1cd0
-#define R128_PRIM_TEX_6_OFFSET_C 0x1cd4
-#define R128_PRIM_TEX_7_OFFSET_C 0x1cd8
-#define R128_PRIM_TEX_8_OFFSET_C 0x1cdc
-#define R128_PRIM_TEX_9_OFFSET_C 0x1ce0
-#define R128_PRIM_TEX_10_OFFSET_C 0x1ce4
-# define R128_TEX_NO_TILE (0 << 30)
-# define R128_TEX_TILED_BY_HOST (1 << 30)
-# define R128_TEX_TILED_BY_STORAGE (2 << 30)
-# define R128_TEX_TILED_BY_STORAGE2 (3 << 30)
-
-#define R128_SEC_TEX_CNTL_C 0x1d00
-# define R128_SEC_SELECT_PRIM_ST (0 << 0)
-# define R128_SEC_SELECT_SEC_ST (1 << 0)
-#define R128_SEC_TEX_COMBINE_CNTL_C 0x1d04
-# define R128_INPUT_FACTOR_PREV_COLOR (8 << 10)
-# define R128_INPUT_FACTOR_PREV_ALPHA (9 << 10)
-# define R128_INP_FACTOR_A_PREV_ALPHA (4 << 25)
-#define R128_SEC_TEX_0_OFFSET_C 0x1d08
-#define R128_SEC_TEX_1_OFFSET_C 0x1d0c
-#define R128_SEC_TEX_2_OFFSET_C 0x1d10
-#define R128_SEC_TEX_3_OFFSET_C 0x1d14
-#define R128_SEC_TEX_4_OFFSET_C 0x1d18
-#define R128_SEC_TEX_5_OFFSET_C 0x1d1c
-#define R128_SEC_TEX_6_OFFSET_C 0x1d20
-#define R128_SEC_TEX_7_OFFSET_C 0x1d24
-#define R128_SEC_TEX_8_OFFSET_C 0x1d28
-#define R128_SEC_TEX_9_OFFSET_C 0x1d2c
-#define R128_SEC_TEX_10_OFFSET_C 0x1d30
-#define R128_CONSTANT_COLOR_C 0x1d34
-# define R128_CONSTANT_BLUE_SHIFT 0
-# define R128_CONSTANT_GREEN_SHIFT 8
-# define R128_CONSTANT_RED_SHIFT 16
-# define R128_CONSTANT_ALPHA_SHIFT 24
-#define R128_PRIM_TEXTURE_BORDER_COLOR_C 0x1d38
-# define R128_PRIM_TEX_BORDER_BLUE_SHIFT 0
-# define R128_PRIM_TEX_BORDER_GREEN_SHIFT 8
-# define R128_PRIM_TEX_BORDER_RED_SHIFT 16
-# define R128_PRIM_TEX_BORDER_ALPHA_SHIFT 24
-#define R128_SEC_TEXTURE_BORDER_COLOR_C 0x1d3c
-# define R128_SEC_TEX_BORDER_BLUE_SHIFT 0
-# define R128_SEC_TEX_BORDER_GREEN_SHIFT 8
-# define R128_SEC_TEX_BORDER_RED_SHIFT 16
-# define R128_SEC_TEX_BORDER_ALPHA_SHIFT 24
-#define R128_STEN_REF_MASK_C 0x1d40
-# define R128_STEN_REFERENCE_SHIFT 0
-# define R128_STEN_MASK_SHIFT 16
-# define R128_STEN_WRITE_MASK_SHIFT 24
-#define R128_PLANE_3D_MASK_C 0x1d44
-#define R128_TEX_CACHE_STAT_COUNT 0x1974
-
-
- /* Constants */
-#define R128_AGP_TEX_OFFSET 0x02000000
-
-#define R128_LAST_FRAME_REG R128_GUI_SCRATCH_REG0
-
- /* CCE packet types */
-#define R128_CCE_PACKET0 0x00000000
-#define R128_CCE_PACKET0_ONE_REG_WR 0x00008000
-#define R128_CCE_PACKET1 0x40000000
-#define R128_CCE_PACKET2 0x80000000
-#define R128_CCE_PACKET3 0xC0000000
-#define R128_CCE_PACKET3_NOP 0xC0001000
-#define R128_CCE_PACKET3_PAINT 0xC0001100
-#define R128_CCE_PACKET3_BITBLT 0xC0001200
-#define R128_CCE_PACKET3_SMALLTEXT 0xC0001300
-#define R128_CCE_PACKET3_HOSTDATA_BLT 0xC0001400
-#define R128_CCE_PACKET3_POLYLINE 0xC0001500
-#define R128_CCE_PACKET3_SCALING 0xC0001600
-#define R128_CCE_PACKET3_TRANS_SCALING 0xC0001700
-#define R128_CCE_PACKET3_POLYSCANLINES 0xC0001800
-#define R128_CCE_PACKET3_NEXT_CHAR 0xC0001900
-#define R128_CCE_PACKET3_PAINT_MULTI 0xC0001A00
-#define R128_CCE_PACKET3_BITBLT_MULTI 0xC0001B00
-#define R128_CCE_PACKET3_PLY_NEXTSCAN 0xC0001D00
-#define R128_CCE_PACKET3_SET_SCISSORS 0xC0001E00
-#define R128_CCE_PACKET3_SET_MODE24BPP 0xC0001F00
-#define R128_CCE_PACKET3_CNTL_PAINT 0xC0009100
-#define R128_CCE_PACKET3_CNTL_BITBLT 0xC0009200
-#define R128_CCE_PACKET3_CNTL_SMALLTEXT 0xC0009300
-#define R128_CCE_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400
-#define R128_CCE_PACKET3_CNTL_POLYLINE 0xC0009500
-#define R128_CCE_PACKET3_CNTL_SCALING 0xC0009600
-#define R128_CCE_PACKET3_CNTL_TRANS_SCALING 0xC0009700
-#define R128_CCE_PACKET3_CNTL_POLYSCANLINES 0xC0009800
-#define R128_CCE_PACKET3_CNTL_NEXT_CHAR 0xC0009900
-#define R128_CCE_PACKET3_CNTL_PAINT_MULTI 0xC0009A00
-#define R128_CCE_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00
-#define R128_CCE_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00
-#define R128_CCE_PACKET3_3D_SAVE_CONTEXT 0xC0002000
-#define R128_CCE_PACKET3_3D_PLAY_CONTEXT 0xC0002100
-#define R128_CCE_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300
-#define R128_CCE_PACKET3_3D_RNDR_GEN_PRIM 0xC0002500
-#define R128_CCE_PACKET3_LOAD_PALETTE 0xC0002C00
-#define R128_CCE_PACKET3_PURGE 0xC0002D00
-#define R128_CCE_PACKET3_NEXT_VERTEX_BUNDLE 0xC0002E00
-# define R128_CCE_PACKET_MASK 0xC0000000
-# define R128_CCE_PACKET_COUNT_MASK 0x3fff0000
-# define R128_CCE_PACKET_MAX_DWORDS (1 << 12)
-# define R128_CCE_PACKET0_REG_MASK 0x000007ff
-# define R128_CCE_PACKET1_REG0_MASK 0x000007ff
-# define R128_CCE_PACKET1_REG1_MASK 0x003ff800
-
-#define R128_CCE_VC_FRMT_RHW 0x00000001
-#define R128_CCE_VC_FRMT_DIFFUSE_BGR 0x00000002
-#define R128_CCE_VC_FRMT_DIFFUSE_A 0x00000004
-#define R128_CCE_VC_FRMT_DIFFUSE_ARGB 0x00000008
-#define R128_CCE_VC_FRMT_SPEC_BGR 0x00000010
-#define R128_CCE_VC_FRMT_SPEC_F 0x00000020
-#define R128_CCE_VC_FRMT_SPEC_FRGB 0x00000040
-#define R128_CCE_VC_FRMT_S_T 0x00000080
-#define R128_CCE_VC_FRMT_S2_T2 0x00000100
-#define R128_CCE_VC_FRMT_RHW2 0x00000200
-
-#define R128_CCE_VC_CNTL_PRIM_TYPE_NONE 0x00000000
-#define R128_CCE_VC_CNTL_PRIM_TYPE_POINT 0x00000001
-#define R128_CCE_VC_CNTL_PRIM_TYPE_LINE 0x00000002
-#define R128_CCE_VC_CNTL_PRIM_TYPE_POLY_LINE 0x00000003
-#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004
-#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005
-#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006
-#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_TYPE2 0x00000007
-#define R128_CCE_VC_CNTL_PRIM_WALK_IND 0x00000010
-#define R128_CCE_VC_CNTL_PRIM_WALK_LIST 0x00000020
-#define R128_CCE_VC_CNTL_PRIM_WALK_RING 0x00000030
-#define R128_CCE_VC_CNTL_NUM_SHIFT 16
-
-/* hmm copyed blindly (no specs) from radeon.h ... */
-#define R128_RE_TOP_LEFT 0x26c0
-# define R128_RE_LEFT_SHIFT 0
-# define R128_RE_TOP_SHIFT 16
-#define R128_RE_WIDTH_HEIGHT 0x1c44
-# define R128_RE_WIDTH_SHIFT 0
-# define R128_RE_HEIGHT_SHIFT 16
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_version.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_version.h
deleted file mode 100644
index 589d8d40b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r128/server/r128_version.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h,v 1.6 2003/01/01 19:16:35 tsi Exp $ */
-/*
- * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _R128_VERSION_H_
-#define _R128_VERSION_H_ 1
-
-#undef R128_NAME
-#undef R128_DRIVER_NAME
-#undef R128_VERSION_MAJOR
-#undef R128_VERSION_MINOR
-#undef R128_VERSION_PATCH
-#undef R128_VERSION_CURRENT
-#undef R128_VERSION_EVALUATE
-#undef R128_VERSION_STRINGIFY
-#undef R128_VERSION_NAME
-
-#define R128_NAME "R128"
-#define R128_DRIVER_NAME "r128"
-
-#define R128_VERSION_MAJOR 4
-#define R128_VERSION_MINOR 0
-#define R128_VERSION_PATCH 1
-
-#ifndef R128_VERSION_EXTRA
-#define R128_VERSION_EXTRA ""
-#endif
-
-#define R128_VERSION_CURRENT \
- ((R128_VERSION_MAJOR << 20) | \
- (R128_VERSION_MINOR << 10) | \
- (R128_VERSION_PATCH))
-
-#define R128_VERSION_EVALUATE(__x) #__x
-#define R128_VERSION_STRINGIFY(_x) R128_VERSION_EVALUATE(_x)
-#define R128_VERSION_NAME \
- R128_VERSION_STRINGIFY(R128_VERSION_MAJOR) "." \
- R128_VERSION_STRINGIFY(R128_VERSION_MINOR) "." \
- R128_VERSION_STRINGIFY(R128_VERSION_MINOR) R128_VERSION_EXTRA
-
-#endif /* _R128_VERSION_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Doxyfile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Doxyfile
deleted file mode 100644
index 27b3d0371..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Doxyfile
+++ /dev/null
@@ -1,232 +0,0 @@
-# Doxyfile 1.3.2-Gideon
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = r200
-PROJECT_NUMBER = $VERSION$
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = /home/temp/Mesa/src/drv/r200
-FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.c++ \
- *.java \
- *.ii \
- *.ixx \
- *.ipp \
- *.i++ \
- *.inl \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.h++ \
- *.idl \
- *.odl \
- *.cs \
- *.C \
- *.H \
- *.tlh \
- *.diff \
- *.patch \
- *.moc \
- *.xpm
-RECURSIVE = yes
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS = *
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = YES
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = yes
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 1000
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
-CGI_NAME = search.cgi
-CGI_URL =
-DOC_URL =
-DOC_ABSPATH =
-BIN_ABSPATH = /usr/local/bin/
-EXT_DOC_PATHS =
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Makefile
deleted file mode 100644
index e4fff5746..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-# src/mesa/drivers/dri/r200/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r200_dri.so
-
-MINIGLX_SOURCES = server/radeon_dri.c
-
-ifeq ($(USING_EGL), 1)
-EGL_SOURCES = server/radeon_egl.c
-endif
-
-DRIVER_SOURCES = r200_context.c \
- r200_ioctl.c \
- r200_lock.c \
- r200_screen.c \
- r200_state.c \
- r200_state_init.c \
- r200_cmdbuf.c \
- r200_pixel.c \
- r200_tex.c \
- r200_texmem.c \
- r200_texstate.c \
- r200_tcl.c \
- r200_swtcl.c \
- r200_span.c \
- r200_maos.c \
- r200_sanity.c \
- r200_vtxfmt.c \
- r200_vtxfmt_c.c \
- r200_vtxfmt_sse.c \
- r200_vtxfmt_x86.c \
- $(EGL_SOURCES)
-
-C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES)
-
-X86_SOURCES = r200_vtxtmp_x86.S
-
-SYMLINKS = \
- server/radeon_egl.c \
- server/radeon_dri.c \
- server/radeon_dri.h \
- server/radeon.h \
- server/radeon_macros.h \
- server/radeon_reg.h
-
-##### TARGETS #####
-
-
-include ../Makefile.template
-
-#INCLUDES += -I../radeon/server
-
-server:
- mkdir -p server
-
-$(SYMLINKS): server
- @[ -e $@ ] || ln -sf ../../radeon/$@ server/
-
-symlinks: $(SYMLINKS)
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_cmdbuf.c
deleted file mode 100644
index 2891054b0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_cmdbuf.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c,v 1.1 2002/10/30 12:51:51 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
-#include "swrast/swrast.h"
-#include "simple_list.h"
-
-#include "r200_context.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-#include "r200_tcl.h"
-#include "r200_sanity.h"
-#include "radeon_reg.h"
-
-static void print_state_atom( struct r200_state_atom *state )
-{
- int i;
-
- fprintf(stderr, "emit %s/%d\n", state->name, state->cmd_size);
-
- if (0 & R200_DEBUG & DEBUG_VERBOSE)
- for (i = 0 ; i < state->cmd_size ; i++)
- fprintf(stderr, "\t%s[%d]: %x\n", state->name, i, state->cmd[i]);
-
-}
-
-/* The state atoms will be emitted in the order they appear in the atom list,
- * so this step is important.
- */
-void r200SetUpAtomList( r200ContextPtr rmesa )
-{
- int i, mtu;
-
- mtu = rmesa->glCtx->Const.MaxTextureUnits;
-
- make_empty_list(&rmesa->hw.atomlist);
- rmesa->hw.atomlist.name = "atom-list";
-
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.ctx );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.set );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.lin );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.msk );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.vpt );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.vtx );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.vap );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.vte );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.msc );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.cst );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.zbs );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.tcl );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.msl );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.tcg );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.grd );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.fog );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.tam );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.tf );
- for (i = 0; i < mtu; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.tex[i] );
- for (i = 0; i < mtu; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.cube[i] );
- for (i = 0; i < 6; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.pix[i] );
-
- for (i = 0; i < 8; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.lit[i] );
- for (i = 0; i < 3 + mtu; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.mat[i] );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.eye );
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.glt );
- for (i = 0; i < 2; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.mtl[i] );
- for (i = 0; i < 6; ++i)
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.ucp[i] );
- /* FIXME: is this a good place to insert that atom ? */
- insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.prf );
-}
-
-static void r200SaveHwState( r200ContextPtr rmesa )
-{
- struct r200_state_atom *atom;
- char * dest = rmesa->backup_store.cmd_buf;
-
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- rmesa->backup_store.cmd_used = 0;
-
- foreach( atom, &rmesa->hw.atomlist ) {
- if ( atom->check( rmesa->glCtx, atom->idx ) ) {
- int size = atom->cmd_size * 4;
- memcpy( dest, atom->cmd, size);
- dest += size;
- rmesa->backup_store.cmd_used += size;
- if (R200_DEBUG & DEBUG_STATE)
- print_state_atom( atom );
- }
- }
-
- assert( rmesa->backup_store.cmd_used <= R200_CMD_BUF_SZ );
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Returning to r200EmitState\n");
-}
-
-void r200EmitState( r200ContextPtr rmesa )
-{
- char *dest;
- int mtu;
- struct r200_state_atom *atom;
-
- if (R200_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->save_on_next_emit) {
- r200SaveHwState(rmesa);
- rmesa->save_on_next_emit = GL_FALSE;
- }
-
- if (!rmesa->hw.is_dirty && !rmesa->hw.all_dirty)
- return;
-
- mtu = rmesa->glCtx->Const.MaxTextureUnits;
-
- /* To avoid going across the entire set of states multiple times, just check
- * for enough space for the case of emitting all state, and inline the
- * r200AllocCmdBuf code here without all the checks.
- */
- r200EnsureCmdBufSpace( rmesa, rmesa->hw.max_state_size );
-
- /* we need to calculate dest after EnsureCmdBufSpace
- as we may flush the buffer - airlied */
- dest = rmesa->store.cmd_buf + rmesa->store.cmd_used;
- if (R200_DEBUG & DEBUG_STATE) {
- foreach( atom, &rmesa->hw.atomlist ) {
- if ( atom->dirty || rmesa->hw.all_dirty ) {
- if ( atom->check( rmesa->glCtx, atom->idx ) )
- print_state_atom( atom );
- else
- fprintf(stderr, "skip state %s\n", atom->name);
- }
- }
- }
-
- foreach( atom, &rmesa->hw.atomlist ) {
- if ( rmesa->hw.all_dirty )
- atom->dirty = GL_TRUE;
- if ( atom->dirty ) {
- if ( atom->check( rmesa->glCtx, atom->idx ) ) {
- int size = atom->cmd_size * 4;
- memcpy( dest, atom->cmd, size);
- dest += size;
- rmesa->store.cmd_used += size;
- atom->dirty = GL_FALSE;
- }
- }
- }
-
- assert( rmesa->store.cmd_used <= R200_CMD_BUF_SZ );
-
- rmesa->hw.is_dirty = GL_FALSE;
- rmesa->hw.all_dirty = GL_FALSE;
-}
-
-/* Fire a section of the retained (indexed_verts) buffer as a regular
- * primtive.
- */
-void r200EmitVbufPrim( r200ContextPtr rmesa,
- GLuint primitive,
- GLuint vertex_nr )
-{
- drm_radeon_cmd_header_t *cmd;
-
- assert(!(primitive & R200_VF_PRIM_WALK_IND));
-
- r200EmitState( rmesa );
-
- if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_PRIMS))
- fprintf(stderr, "%s cmd_used/4: %d prim %x nr %d\n", __FUNCTION__,
- rmesa->store.cmd_used/4, primitive, vertex_nr);
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, VBUF_BUFSZ,
- __FUNCTION__ );
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
- cmd[1].i = R200_CP_CMD_3D_DRAW_VBUF_2;
- cmd[2].i = (primitive |
- R200_VF_PRIM_WALK_LIST |
- R200_VF_COLOR_ORDER_RGBA |
- (vertex_nr << R200_VF_VERTEX_NUMBER_SHIFT));
-}
-
-
-void r200FlushElts( r200ContextPtr rmesa )
-{
- int *cmd = (int *)(rmesa->store.cmd_buf + rmesa->store.elts_start);
- int dwords;
- int nr = (rmesa->store.cmd_used - (rmesa->store.elts_start + 12)) / 2;
-
- if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_PRIMS))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert( rmesa->dma.flush == r200FlushElts );
- rmesa->dma.flush = NULL;
-
- /* Cope with odd number of elts:
- */
- rmesa->store.cmd_used = (rmesa->store.cmd_used + 2) & ~2;
- dwords = (rmesa->store.cmd_used - rmesa->store.elts_start) / 4;
-
- cmd[1] |= (dwords - 3) << 16;
- cmd[2] |= nr << R200_VF_VERTEX_NUMBER_SHIFT;
-
- if (R200_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
- r200Finish( rmesa->glCtx );
- }
-}
-
-
-GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa,
- GLuint primitive,
- GLuint min_nr )
-{
- drm_radeon_cmd_header_t *cmd;
- GLushort *retval;
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d prim %x\n", __FUNCTION__, min_nr, primitive);
-
- assert((primitive & R200_VF_PRIM_WALK_IND));
-
- r200EmitState( rmesa );
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, ELTS_BUFSZ(min_nr),
- __FUNCTION__ );
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
- cmd[1].i = R200_CP_CMD_3D_DRAW_INDX_2;
- cmd[2].i = (primitive |
- R200_VF_PRIM_WALK_IND |
- R200_VF_COLOR_ORDER_RGBA);
-
-
- retval = (GLushort *)(cmd+3);
-
- if (R200_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s: header 0x%x prim %x \n",
- __FUNCTION__,
- cmd[1].i, primitive);
-
- assert(!rmesa->dma.flush);
- rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
- rmesa->dma.flush = r200FlushElts;
-
- rmesa->store.elts_start = ((char *)cmd) - rmesa->store.cmd_buf;
-
- return retval;
-}
-
-
-
-void r200EmitVertexAOS( r200ContextPtr rmesa,
- GLuint vertex_size,
- GLuint offset )
-{
- drm_radeon_cmd_header_t *cmd;
-
- if (R200_DEBUG & (DEBUG_PRIMS|DEBUG_IOCTL))
- fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n",
- __FUNCTION__, vertex_size, offset);
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, VERT_AOS_BUFSZ,
- __FUNCTION__ );
-
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
- cmd[1].i = R200_CP_CMD_3D_LOAD_VBPNTR | (2 << 16);
- cmd[2].i = 1;
- cmd[3].i = vertex_size | (vertex_size << 8);
- cmd[4].i = offset;
-}
-
-
-void r200EmitAOS( r200ContextPtr rmesa,
- struct r200_dma_region **component,
- GLuint nr,
- GLuint offset )
-{
- drm_radeon_cmd_header_t *cmd;
- int sz = AOS_BUFSZ(nr);
- int i;
- int *tmp;
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s nr arrays: %d\n", __FUNCTION__, nr);
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, sz, __FUNCTION__ );
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
- cmd[1].i = R200_CP_CMD_3D_LOAD_VBPNTR | (((sz / sizeof(int)) - 3) << 16);
- cmd[2].i = nr;
- tmp = &cmd[0].i;
- cmd += 3;
-
- for (i = 0 ; i < nr ; i++) {
- if (i & 1) {
- cmd[0].i |= ((component[i]->aos_stride << 24) |
- (component[i]->aos_size << 16));
- cmd[2].i = (component[i]->aos_start +
- offset * component[i]->aos_stride * 4);
- cmd += 3;
- }
- else {
- cmd[0].i = ((component[i]->aos_stride << 8) |
- (component[i]->aos_size << 0));
- cmd[1].i = (component[i]->aos_start +
- offset * component[i]->aos_stride * 4);
- }
- }
-
- if (R200_DEBUG & DEBUG_VERTS) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- for (i = 0 ; i < sz ; i++)
- fprintf(stderr, " %d: %x\n", i, tmp[i]);
- }
-}
-
-void r200EmitBlit( r200ContextPtr rmesa,
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty,
- GLuint w, GLuint h )
-{
- drm_radeon_cmd_header_t *cmd;
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s src %x/%x %d,%d dst: %x/%x %d,%d sz: %dx%d\n",
- __FUNCTION__,
- src_pitch, src_offset, srcx, srcy,
- dst_pitch, dst_offset, dstx, dsty,
- w, h);
-
- assert( (src_pitch & 63) == 0 );
- assert( (dst_pitch & 63) == 0 );
- assert( (src_offset & 1023) == 0 );
- assert( (dst_offset & 1023) == 0 );
- assert( w < (1<<16) );
- assert( h < (1<<16) );
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, 8 * sizeof(int),
- __FUNCTION__ );
-
-
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
- cmd[1].i = R200_CP_CMD_BITBLT_MULTI | (5 << 16);
- cmd[2].i = (RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
- RADEON_GMC_DST_PITCH_OFFSET_CNTL |
- RADEON_GMC_BRUSH_NONE |
- (color_fmt << 8) |
- RADEON_GMC_SRC_DATATYPE_COLOR |
- RADEON_ROP3_S |
- RADEON_DP_SRC_SOURCE_MEMORY |
- RADEON_GMC_CLR_CMP_CNTL_DIS |
- RADEON_GMC_WR_MSK_DIS );
-
- cmd[3].i = ((src_pitch/64)<<22) | (src_offset >> 10);
- cmd[4].i = ((dst_pitch/64)<<22) | (dst_offset >> 10);
- cmd[5].i = (srcx << 16) | srcy;
- cmd[6].i = (dstx << 16) | dsty; /* dst */
- cmd[7].i = (w << 16) | h;
-}
-
-
-void r200EmitWait( r200ContextPtr rmesa, GLuint flags )
-{
- if (rmesa->dri.drmMinor >= 6) {
- drm_radeon_cmd_header_t *cmd;
-
- assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, 1 * sizeof(int),
- __FUNCTION__ );
- cmd[0].i = 0;
- cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
- cmd[0].wait.flags = flags;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.c
deleted file mode 100644
index 04dbc180c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.c,v 1.3 2003/05/06 23:52:08 daenzer Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "state.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_state.h"
-#include "r200_span.h"
-#include "r200_pixel.h"
-#include "r200_tex.h"
-#include "r200_swtcl.h"
-#include "r200_tcl.h"
-#include "r200_vtxfmt.h"
-#include "r200_maos.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-#define need_GL_ARB_vertex_program
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_secondary_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_NV_vertex_program
-#include "extension_helper.h"
-
-#define DRIVER_DATE "20041207"
-
-#include "vblank.h"
-#include "utils.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
-#ifndef R200_DEBUG
-int R200_DEBUG = (0);
-#endif
-
-
-/* Return the width and height of the given buffer.
- */
-static void r200GetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- LOCK_HARDWARE( rmesa );
- *width = rmesa->dri.drawable->w;
- *height = rmesa->dri.drawable->h;
- UNLOCK_HARDWARE( rmesa );
-}
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- static char buffer[128];
- unsigned offset;
- GLuint agp_mode = rmesa->r200Screen->IsPCI ? 0 :
- rmesa->r200Screen->AGPMode;
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *)"Tungsten Graphics, Inc.";
-
- case GL_RENDERER:
- offset = driGetRendererString( buffer, "R200", DRIVER_DATE,
- agp_mode );
-
- sprintf( & buffer[ offset ], " %sTCL",
- !(rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE)
- ? "" : "NO-" );
-
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-
-/* Extension strings exported by the R200 driver.
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_ARB_texture_env_dot3", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
- { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
- { "GL_EXT_blend_subtract", NULL },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_EXT_texture_env_combine", NULL },
- { "GL_EXT_texture_env_dot3", NULL },
- { "GL_EXT_texture_filter_anisotropic", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_EXT_texture_mirror_clamp", NULL },
- { "GL_EXT_texture_rectangle", NULL },
- { "GL_ATI_texture_env_combine3", NULL },
- { "GL_ATI_texture_mirror_once", NULL },
- { "GL_MESA_pack_invert", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-const struct dri_extension blend_extensions[] = {
- { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
- { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
- { NULL, NULL }
-};
-
-const struct dri_extension ARB_vp_extension[] = {
- { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
-};
-
-const struct dri_extension NV_vp_extension[] = {
- { "GL_NV_vertex_program", GL_NV_vertex_program_functions }
-};
-
-extern const struct tnl_pipeline_stage _r200_render_stage;
-extern const struct tnl_pipeline_stage _r200_tcl_stage;
-
-static const struct tnl_pipeline_stage *r200_pipeline[] = {
-
- /* Try and go straight to t&l
- */
- &_r200_tcl_stage,
-
- /* Catch any t&l fallbacks
- */
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_arb_vertex_program_stage,
- &_tnl_vertex_program_stage,
-
- /* Try again to go to tcl?
- * - no good for asymmetric-twoside (do with multipass)
- * - no good for asymmetric-unfilled (do with multipass)
- * - good for material
- * - good for texgen
- * - need to manipulate a bit of state
- *
- * - worth it/not worth it?
- */
-
- /* Else do them here.
- */
-/* &_r200_render_stage, */ /* FIXME: bugs with ut2003 */
- &_tnl_render_stage, /* FALLBACK: */
- NULL,
-};
-
-
-
-/* Initialize the driver's misc functions.
- */
-static void r200InitDriverFuncs( struct dd_function_table *functions )
-{
- functions->GetBufferSize = r200GetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = r200GetString;
-
- functions->Error = NULL;
- functions->DrawPixels = NULL;
- functions->Bitmap = NULL;
-}
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "tex", DEBUG_TEXTURE },
- { "ioctl", DEBUG_IOCTL },
- { "prim", DEBUG_PRIMS },
- { "vert", DEBUG_VERTS },
- { "state", DEBUG_STATE },
- { "code", DEBUG_CODEGEN },
- { "vfmt", DEBUG_VFMT },
- { "vtxf", DEBUG_VFMT },
- { "verb", DEBUG_VERBOSE },
- { "dri", DEBUG_DRI },
- { "dma", DEBUG_DMA },
- { "san", DEBUG_SANITY },
- { "sync", DEBUG_SYNC },
- { "pix", DEBUG_PIXEL },
- { "mem", DEBUG_MEMORY },
- { NULL, 0 }
-};
-
-
-/* Create the device specific rendering context.
- */
-GLboolean r200CreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- r200ScreenPtr screen = (r200ScreenPtr)(sPriv->private);
- struct dd_function_table functions;
- r200ContextPtr rmesa;
- GLcontext *ctx, *shareCtx;
- int i;
- int tcl_mode, fthrottle_mode;
-
- assert(glVisual);
- assert(driContextPriv);
- assert(screen);
-
- /* Allocate the R200 context */
- rmesa = (r200ContextPtr) CALLOC( sizeof(*rmesa) );
- if ( !rmesa )
- return GL_FALSE;
-
- /* init exp fog table data */
- r200InitStaticFogData();
-
- /* Parse configuration files.
- * Do this here so that initialMaxAnisotropy is set before we create
- * the default textures.
- */
- driParseConfigFiles (&rmesa->optionCache, &screen->optionCache,
- screen->driScreen->myNum, "r200");
- rmesa->initialMaxAnisotropy = driQueryOptionf(&rmesa->optionCache,
- "def_max_anisotropy");
-
- if ( driQueryOptionb( &rmesa->optionCache, "hyperz" ) ) {
- if ( sPriv->drmMinor < 13 )
- fprintf( stderr, "DRM version 1.%d too old to support HyperZ, "
- "disabling.\n",sPriv->drmMinor );
- else
- rmesa->using_hyperz = GL_TRUE;
- }
-
- if ( sPriv->drmMinor >= 15 )
- rmesa->texmicrotile = GL_TRUE;
-
- /* Init default driver functions then plug in our R200-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions(&functions);
- r200InitDriverFuncs(&functions);
- r200InitIoctlFuncs(&functions);
- r200InitStateFuncs(&functions);
- r200InitTextureFuncs(&functions);
-
- /* Allocate and initialize the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((r200ContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- rmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *) rmesa);
- if (!rmesa->glCtx) {
- FREE(rmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = rmesa;
-
- /* Init r200 context data */
- rmesa->dri.context = driContextPriv;
- rmesa->dri.screen = sPriv;
- rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
- rmesa->dri.hwContext = driContextPriv->hHWContext;
- rmesa->dri.hwLock = &sPriv->pSAREA->lock;
- rmesa->dri.fd = sPriv->fd;
- rmesa->dri.drmMinor = sPriv->drmMinor;
-
- rmesa->r200Screen = screen;
- rmesa->sarea = (drm_radeon_sarea_t *)((GLubyte *)sPriv->pSAREA +
- screen->sarea_priv_offset);
-
-
- rmesa->dma.buf0_address = rmesa->r200Screen->buffers->list[0].address;
-
- (void) memset( rmesa->texture_heaps, 0, sizeof( rmesa->texture_heaps ) );
- make_empty_list( & rmesa->swapped );
-
- rmesa->nr_heaps = 1 /* screen->numTexHeaps */ ;
- assert(rmesa->nr_heaps < R200_NR_TEX_HEAPS);
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- rmesa->texture_heaps[i] = driCreateTextureHeap( i, rmesa,
- screen->texSize[i],
- 12,
- RADEON_NR_TEX_REGIONS,
- (drmTextureRegionPtr)rmesa->sarea->tex_list[i],
- & rmesa->sarea->tex_age[i],
- & rmesa->swapped,
- sizeof( r200TexObj ),
- (destroy_texture_object_t *) r200DestroyTexObj );
- }
- rmesa->texture_depth = driQueryOptioni (&rmesa->optionCache,
- "texture_depth");
- if (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
- rmesa->texture_depth = ( screen->cpp == 4 ) ?
- DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
- rmesa->swtcl.RenderIndex = ~0;
- rmesa->hw.all_dirty = 1;
-
- /* Set the maximum texture size small enough that we can guarentee that
- * all texture units can bind a maximal texture and have them both in
- * texturable memory at once.
- */
-
- ctx = rmesa->glCtx;
- ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->optionCache,
- "texture_units");
- ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
- ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
-
- driCalculateMaxTextureLevels( rmesa->texture_heaps,
- rmesa->nr_heaps,
- & ctx->Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
-#if ENABLE_HW_3D_TEXTURE
- 8, /* max 3D texture size is 256^3 */
-#else
- 0, /* 3D textures unsupported */
-#endif
- 11, /* max cube texture size is 2048x2048 */
- 11, /* max texture rectangle size is 2048x2048 */
- 12,
- GL_FALSE );
-
- /* adjust max texture size a bit. Hack, but I really want to use larger textures
- which will work just fine in 99.999999% of all cases, especially with texture compression... */
- if (driQueryOptionb( &rmesa->optionCache, "texture_level_hack" ))
- {
- if (ctx->Const.MaxTextureLevels < 12) ctx->Const.MaxTextureLevels += 1;
- }
-
- ctx->Const.MaxTextureMaxAnisotropy = 16.0;
-
- /* No wide points.
- */
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 10.0;
- ctx->Const.MaxLineWidthAA = 10.0;
- ctx->Const.LineWidthGranularity = 0.0625;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
- _ae_create_context( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, r200_pipeline );
- ctx->Driver.FlushVertices = r200FlushVertices;
-
- /* Try and keep materials and vertices separate:
- */
- _tnl_isolate_materials( ctx, GL_TRUE );
-
-
- /* Configure swrast and TNL to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
-
- for ( i = 0 ; i < R200_MAX_TEXTURE_UNITS ; i++ ) {
- _math_matrix_ctr( &rmesa->TexGenMatrix[i] );
- _math_matrix_set_identity( &rmesa->TexGenMatrix[i] );
- }
- _math_matrix_ctr( &rmesa->tmpmat );
- _math_matrix_set_identity( &rmesa->tmpmat );
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
- if (!(rmesa->r200Screen->chipset & R200_CHIPSET_YCBCR_BROKEN)) {
- /* yuv textures don't work with some chips - R200 / rv280 okay so far
- others get the bit ordering right but don't actually do YUV-RGB conversion */
- _mesa_enable_extension( ctx, "GL_MESA_ycbcr_texture" );
- }
- if (rmesa->glCtx->Mesa_DXTn) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- _mesa_enable_extension( ctx, "GL_S3_s3tc" );
- }
- else if (driQueryOptionb (&rmesa->optionCache, "force_s3tc_enable")) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- }
-
- if (rmesa->r200Screen->drmSupportsCubeMaps)
- _mesa_enable_extension( ctx, "GL_ARB_texture_cube_map" );
- if (rmesa->r200Screen->drmSupportsBlendColor) {
- driInitExtensions( ctx, blend_extensions, GL_FALSE );
- }
- if(driQueryOptionb(&rmesa->optionCache, "arb_vertex_program"))
- driInitSingleExtension( ctx, ARB_vp_extension );
- if(driQueryOptionb(&rmesa->optionCache, "nv_vertex_program"))
- driInitSingleExtension( ctx, NV_vp_extension );
-
-#if 0
- r200InitDriverFuncs( ctx );
- r200InitIoctlFuncs( ctx );
- r200InitStateFuncs( ctx );
- r200InitTextureFuncs( ctx );
-#endif
- /* plug in a few more device driver functions */
- /* XXX these should really go right after _mesa_init_driver_functions() */
- r200InitPixelFuncs( ctx );
- r200InitSpanFuncs( ctx );
- r200InitTnlFuncs( ctx );
- r200InitState( rmesa );
- r200InitSwtcl( ctx );
-
- fthrottle_mode = driQueryOptioni(&rmesa->optionCache, "fthrottle_mode");
- rmesa->iw.irq_seq = -1;
- rmesa->irqsEmitted = 0;
- rmesa->do_irqs = (rmesa->dri.drmMinor >= 6 &&
- fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
- rmesa->r200Screen->irq);
-
- rmesa->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
-
- if (!rmesa->do_irqs)
- fprintf(stderr,
- "IRQ's not enabled, falling back to %s: %d %d %d\n",
- rmesa->do_usleeps ? "usleeps" : "busy waits",
- rmesa->dri.drmMinor,
- fthrottle_mode,
- rmesa->r200Screen->irq);
-
- rmesa->vblank_flags = (rmesa->r200Screen->irq != 0)
- ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
- rmesa->prefer_gart_client_texturing =
- (getenv("R200_GART_CLIENT_TEXTURES") != 0);
-
- (*dri_interface->getUST)( & rmesa->swap_ust );
-
-
-#if DO_DEBUG
- R200_DEBUG = driParseDebugString( getenv( "R200_DEBUG" ),
- debug_control );
- R200_DEBUG |= driParseDebugString( getenv( "RADEON_DEBUG" ),
- debug_control );
-#endif
-
- tcl_mode = driQueryOptioni(&rmesa->optionCache, "tcl_mode");
- if (driQueryOptionb(&rmesa->optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
- FALLBACK(rmesa, R200_FALLBACK_DISABLE, 1);
- }
- else if (tcl_mode == DRI_CONF_TCL_SW || getenv("R200_NO_TCL") ||
- !(rmesa->r200Screen->chipset & R200_CHIPSET_TCL)) {
- if (rmesa->r200Screen->chipset & R200_CHIPSET_TCL) {
- rmesa->r200Screen->chipset &= ~R200_CHIPSET_TCL;
- fprintf(stderr, "Disabling HW TCL support\n");
- }
- TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_TCL_DISABLE, 1);
- }
-
- if (rmesa->r200Screen->chipset & R200_CHIPSET_TCL) {
- if (tcl_mode >= DRI_CONF_TCL_VTXFMT)
- r200VtxfmtInit( ctx, tcl_mode >= DRI_CONF_TCL_CODEGEN );
-
- _tnl_need_dlist_norm_lengths( ctx, GL_FALSE );
- }
- return GL_TRUE;
-}
-
-
-/* Destroy the device specific context.
- */
-/* Destroy the Mesa and driver specific context data.
- */
-void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = (r200ContextPtr) driContextPriv->driverPrivate;
- r200ContextPtr current = ctx ? R200_CONTEXT(ctx) : NULL;
-
- /* check if we're deleting the currently bound context */
- if (rmesa == current) {
- R200_FIREVERTICES( rmesa );
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- /* Free r200 context resources */
- assert(rmesa); /* should never be null */
- if ( rmesa ) {
- GLboolean release_texture_heaps;
-
-
- release_texture_heaps = (rmesa->glCtx->Shared->RefCount == 1);
- _swsetup_DestroyContext( rmesa->glCtx );
- _tnl_DestroyContext( rmesa->glCtx );
- _ac_DestroyContext( rmesa->glCtx );
- _swrast_DestroyContext( rmesa->glCtx );
-
- r200DestroySwtcl( rmesa->glCtx );
- r200ReleaseArrays( rmesa->glCtx, ~0 );
-
- if (rmesa->dma.current.buf) {
- r200ReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
- r200FlushCmdBuf( rmesa, __FUNCTION__ );
- }
-
- if (!(rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE)) {
- int tcl_mode = driQueryOptioni(&rmesa->optionCache, "tcl_mode");
- if (tcl_mode >= DRI_CONF_TCL_VTXFMT)
- r200VtxfmtDestroy( rmesa->glCtx );
- }
-
- /* free the Mesa context */
- rmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context( rmesa->glCtx );
-
- if (rmesa->state.scissor.pClipRects) {
- FREE(rmesa->state.scissor.pClipRects);
- rmesa->state.scissor.pClipRects = NULL;
- }
-
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- int i;
-
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- driDestroyTextureHeap( rmesa->texture_heaps[ i ] );
- rmesa->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & rmesa->swapped ) );
- }
-
- /* free the option cache */
- driDestroyOptionCache (&rmesa->optionCache);
-
- FREE( rmesa );
- }
-}
-
-
-
-
-void
-r200SwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- r200ContextPtr rmesa;
- GLcontext *ctx;
- rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = rmesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- if ( rmesa->doPageFlip ) {
- r200PageFlip( dPriv );
- }
- else {
- r200CopyBuffer( dPriv );
- }
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__);
- }
-}
-
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-GLboolean
-r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( driContextPriv ) {
- r200ContextPtr newCtx =
- (r200ContextPtr) driContextPriv->driverPrivate;
-
- if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx);
-
- if ( newCtx->dri.drawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags );
- newCtx->dri.drawable = driDrawPriv;
- r200UpdateWindow( newCtx->glCtx );
- r200UpdateViewportOffset( newCtx->glCtx );
- }
-
- _mesa_make_current( newCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- if (newCtx->vb.enabled)
- r200VtxfmtMakeCurrent( newCtx->glCtx );
-
- _mesa_update_state( newCtx->glCtx );
- r200ValidateState( newCtx->glCtx );
-
- } else {
- if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "End %s\n", __FUNCTION__);
- return GL_TRUE;
-}
-
-/* Force the context `c' to be unbound from its buffer.
- */
-GLboolean
-r200UnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- r200ContextPtr rmesa = (r200ContextPtr) driContextPriv->driverPrivate;
-
- if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)rmesa->glCtx);
-
- r200VtxfmtUnbindContext( rmesa->glCtx );
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.h
deleted file mode 100644
index 8169af709..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_context.h
+++ /dev/null
@@ -1,995 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_CONTEXT_H__
-#define __R200_CONTEXT_H__
-
-#include "tnl/t_vertex.h"
-#include "drm.h"
-#include "radeon_drm.h"
-#include "dri_util.h"
-#include "texmem.h"
-
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "r200_reg.h"
-
-#define ENABLE_HW_3D_TEXTURE 1 /* XXX this is temporary! */
-
-struct r200_context;
-typedef struct r200_context r200ContextRec;
-typedef struct r200_context *r200ContextPtr;
-
-#include "r200_lock.h"
-#include "r200_screen.h"
-#include "mm.h"
-
-/* Flags for software fallback cases */
-/* See correponding strings in r200_swtcl.c */
-#define R200_FALLBACK_TEXTURE 0x01
-#define R200_FALLBACK_DRAW_BUFFER 0x02
-#define R200_FALLBACK_STENCIL 0x04
-#define R200_FALLBACK_RENDER_MODE 0x08
-#define R200_FALLBACK_DISABLE 0x10
-#define R200_FALLBACK_BORDER_MODE 0x20
-
-/* The blit width for texture uploads
- */
-#define BLIT_WIDTH_BYTES 1024
-
-/* Use the templated vertex format:
- */
-#define COLOR_IS_RGBA
-#define TAG(x) r200##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*r200_tri_func)( r200ContextPtr,
- r200Vertex *,
- r200Vertex *,
- r200Vertex * );
-
-typedef void (*r200_line_func)( r200ContextPtr,
- r200Vertex *,
- r200Vertex * );
-
-typedef void (*r200_point_func)( r200ContextPtr,
- r200Vertex * );
-
-
-struct r200_colorbuffer_state {
- GLuint clear;
- GLint drawOffset, drawPitch;
- int roundEnable;
-};
-
-
-struct r200_depthbuffer_state {
- GLuint clear;
- GLfloat scale;
-};
-
-struct r200_pixel_state {
- GLint readOffset, readPitch;
-};
-
-struct r200_scissor_state {
- drm_clip_rect_t rect;
- GLboolean enabled;
-
- GLuint numClipRects; /* Cliprects active */
- GLuint numAllocedClipRects; /* Cliprects available */
- drm_clip_rect_t *pClipRects;
-};
-
-struct r200_stencilbuffer_state {
- GLboolean hwBuffer;
- GLuint clear; /* rb3d_stencilrefmask value */
-};
-
-struct r200_stipple_state {
- GLuint mask[32];
-};
-
-
-
-#define TEX_0 0x1
-#define TEX_1 0x2
-#define TEX_2 0x4
-#define TEX_3 0x8
-#define TEX_4 0x10
-#define TEX_5 0x20
-#define TEX_ALL 0x3f
-
-typedef struct r200_tex_obj r200TexObj, *r200TexObjPtr;
-
-/* Texture object in locally shared texture space.
- */
-struct r200_tex_obj {
- driTextureObject base;
-
- GLuint bufAddr; /* Offset to start of locally
- shared texture block */
-
- GLuint dirty_state; /* Flags (1 per texunit) for
- whether or not this texobj
- has dirty hardware state
- (pp_*) that needs to be
- brought into the
- texunit. */
-
- drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
- /* Six, for the cube faces */
-
- GLuint pp_txfilter; /* hardware register values */
- GLuint pp_txformat;
- GLuint pp_txformat_x;
- GLuint pp_txoffset; /* Image location in texmem.
- All cube faces follow. */
- GLuint pp_txsize; /* npot only */
- GLuint pp_txpitch; /* npot only */
- GLuint pp_border_color;
- GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
-
- GLboolean border_fallback;
-
- GLuint tile_bits; /* hw texture tile bits used on this texture */
-};
-
-
-struct r200_texture_env_state {
- r200TexObjPtr texobj;
- GLenum format;
- GLenum envMode;
-};
-
-#define R200_MAX_TEXTURE_UNITS 6
-
-struct r200_texture_state {
- struct r200_texture_env_state unit[R200_MAX_TEXTURE_UNITS];
-};
-
-
-struct r200_state_atom {
- struct r200_state_atom *next, *prev;
- const char *name; /* for debug */
- int cmd_size; /* size in bytes */
- GLuint idx;
- int *cmd; /* one or more cmd's */
- int *lastcmd; /* one or more cmd's */
- GLboolean dirty;
- GLboolean (*check)( GLcontext *, int ); /* is this state active? */
-};
-
-
-
-/* Trying to keep these relatively short as the variables are becoming
- * extravagently long. Drop the driver name prefix off the front of
- * everything - I think we know which driver we're in by now, and keep the
- * prefix to 3 letters unless absolutely impossible.
- */
-
-#define CTX_CMD_0 0
-#define CTX_PP_MISC 1
-#define CTX_PP_FOG_COLOR 2
-#define CTX_RE_SOLID_COLOR 3
-#define CTX_RB3D_BLENDCNTL 4
-#define CTX_RB3D_DEPTHOFFSET 5
-#define CTX_RB3D_DEPTHPITCH 6
-#define CTX_RB3D_ZSTENCILCNTL 7
-#define CTX_CMD_1 8
-#define CTX_PP_CNTL 9
-#define CTX_RB3D_CNTL 10
-#define CTX_RB3D_COLOROFFSET 11
-#define CTX_CMD_2 12 /* why */
-#define CTX_RB3D_COLORPITCH 13 /* why */
-#define CTX_STATE_SIZE_OLDDRM 14
-#define CTX_CMD_3 14
-#define CTX_RB3D_BLENDCOLOR 15
-#define CTX_RB3D_ABLENDCNTL 16
-#define CTX_RB3D_CBLENDCNTL 17
-#define CTX_STATE_SIZE_NEWDRM 18
-
-#define SET_CMD_0 0
-#define SET_SE_CNTL 1
-#define SET_RE_CNTL 2 /* replace se_coord_fmt */
-#define SET_STATE_SIZE 3
-
-#define VTE_CMD_0 0
-#define VTE_SE_VTE_CNTL 1
-#define VTE_STATE_SIZE 2
-
-#define LIN_CMD_0 0
-#define LIN_RE_LINE_PATTERN 1
-#define LIN_RE_LINE_STATE 2
-#define LIN_CMD_1 3
-#define LIN_SE_LINE_WIDTH 4
-#define LIN_STATE_SIZE 5
-
-#define MSK_CMD_0 0
-#define MSK_RB3D_STENCILREFMASK 1
-#define MSK_RB3D_ROPCNTL 2
-#define MSK_RB3D_PLANEMASK 3
-#define MSK_STATE_SIZE 4
-
-#define VPT_CMD_0 0
-#define VPT_SE_VPORT_XSCALE 1
-#define VPT_SE_VPORT_XOFFSET 2
-#define VPT_SE_VPORT_YSCALE 3
-#define VPT_SE_VPORT_YOFFSET 4
-#define VPT_SE_VPORT_ZSCALE 5
-#define VPT_SE_VPORT_ZOFFSET 6
-#define VPT_STATE_SIZE 7
-
-#define ZBS_CMD_0 0
-#define ZBS_SE_ZBIAS_FACTOR 1
-#define ZBS_SE_ZBIAS_CONSTANT 2
-#define ZBS_STATE_SIZE 3
-
-#define MSC_CMD_0 0
-#define MSC_RE_MISC 1
-#define MSC_STATE_SIZE 2
-
-#define TAM_CMD_0 0
-#define TAM_DEBUG3 1
-#define TAM_STATE_SIZE 2
-
-#define TEX_CMD_0 0
-#define TEX_PP_TXFILTER 1 /*2c00*/
-#define TEX_PP_TXFORMAT 2 /*2c04*/
-#define TEX_PP_TXFORMAT_X 3 /*2c08*/
-#define TEX_PP_TXSIZE 4 /*2c0c*/
-#define TEX_PP_TXPITCH 5 /*2c10*/
-#define TEX_PP_BORDER_COLOR 6 /*2c14*/
-#define TEX_CMD_1 7
-#define TEX_PP_TXOFFSET 8 /*2d00 */
-#define TEX_STATE_SIZE 9
-
-#define CUBE_CMD_0 0 /* 1 register follows */
-#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */
-#define CUBE_CMD_1 2 /* 5 registers follow */
-#define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */
-#define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */
-#define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */
-#define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */
-#define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */
-#define CUBE_STATE_SIZE 8
-
-#define PIX_CMD_0 0
-#define PIX_PP_TXCBLEND 1
-#define PIX_PP_TXCBLEND2 2
-#define PIX_PP_TXABLEND 3
-#define PIX_PP_TXABLEND2 4
-#define PIX_STATE_SIZE 5
-
-#define TF_CMD_0 0
-#define TF_TFACTOR_0 1
-#define TF_TFACTOR_1 2
-#define TF_TFACTOR_2 3
-#define TF_TFACTOR_3 4
-#define TF_TFACTOR_4 5
-#define TF_TFACTOR_5 6
-#define TF_STATE_SIZE 7
-
-#define TCL_CMD_0 0
-#define TCL_LIGHT_MODEL_CTL_0 1
-#define TCL_LIGHT_MODEL_CTL_1 2
-#define TCL_PER_LIGHT_CTL_0 3
-#define TCL_PER_LIGHT_CTL_1 4
-#define TCL_PER_LIGHT_CTL_2 5
-#define TCL_PER_LIGHT_CTL_3 6
-#define TCL_CMD_1 7
-#define TCL_UCP_VERT_BLEND_CTL 8
-#define TCL_STATE_SIZE 9
-
-#define MSL_CMD_0 0
-#define MSL_MATRIX_SELECT_0 1
-#define MSL_MATRIX_SELECT_1 2
-#define MSL_MATRIX_SELECT_2 3
-#define MSL_MATRIX_SELECT_3 4
-#define MSL_MATRIX_SELECT_4 5
-#define MSL_STATE_SIZE 6
-
-#define TCG_CMD_0 0
-#define TCG_TEX_PROC_CTL_2 1
-#define TCG_TEX_PROC_CTL_3 2
-#define TCG_TEX_PROC_CTL_0 3
-#define TCG_TEX_PROC_CTL_1 4
-#define TCG_TEX_CYL_WRAP_CTL 5
-#define TCG_STATE_SIZE 6
-
-#define MTL_CMD_0 0
-#define MTL_EMMISSIVE_RED 1
-#define MTL_EMMISSIVE_GREEN 2
-#define MTL_EMMISSIVE_BLUE 3
-#define MTL_EMMISSIVE_ALPHA 4
-#define MTL_AMBIENT_RED 5
-#define MTL_AMBIENT_GREEN 6
-#define MTL_AMBIENT_BLUE 7
-#define MTL_AMBIENT_ALPHA 8
-#define MTL_DIFFUSE_RED 9
-#define MTL_DIFFUSE_GREEN 10
-#define MTL_DIFFUSE_BLUE 11
-#define MTL_DIFFUSE_ALPHA 12
-#define MTL_SPECULAR_RED 13
-#define MTL_SPECULAR_GREEN 14
-#define MTL_SPECULAR_BLUE 15
-#define MTL_SPECULAR_ALPHA 16
-#define MTL_CMD_1 17
-#define MTL_SHININESS 18
-#define MTL_STATE_SIZE 19
-
-#define VAP_CMD_0 0
-#define VAP_SE_VAP_CNTL 1
-#define VAP_STATE_SIZE 2
-
-/* Replaces a lot of packet info from radeon
- */
-#define VTX_CMD_0 0
-#define VTX_VTXFMT_0 1
-#define VTX_VTXFMT_1 2
-#define VTX_TCL_OUTPUT_VTXFMT_0 3
-#define VTX_TCL_OUTPUT_VTXFMT_1 4
-#define VTX_CMD_1 5
-#define VTX_TCL_OUTPUT_COMPSEL 6
-#define VTX_CMD_2 7
-#define VTX_STATE_CNTL 8
-#define VTX_STATE_SIZE 9
-
-
-#define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
- R200_VTX_COLOR_MASK)
-
-/**
- * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine
- * how many components are in texture coordinate \c n.
- */
-#define VTX_TEXn_COUNT(v,n) (((v) >> (3 * n)) & 0x07)
-
-#define MAT_CMD_0 0
-#define MAT_ELT_0 1
-#define MAT_STATE_SIZE 17
-
-#define GRD_CMD_0 0
-#define GRD_VERT_GUARD_CLIP_ADJ 1
-#define GRD_VERT_GUARD_DISCARD_ADJ 2
-#define GRD_HORZ_GUARD_CLIP_ADJ 3
-#define GRD_HORZ_GUARD_DISCARD_ADJ 4
-#define GRD_STATE_SIZE 5
-
-/* position changes frequently when lighting in modelpos - separate
- * out to new state item?
- */
-#define LIT_CMD_0 0
-#define LIT_AMBIENT_RED 1
-#define LIT_AMBIENT_GREEN 2
-#define LIT_AMBIENT_BLUE 3
-#define LIT_AMBIENT_ALPHA 4
-#define LIT_DIFFUSE_RED 5
-#define LIT_DIFFUSE_GREEN 6
-#define LIT_DIFFUSE_BLUE 7
-#define LIT_DIFFUSE_ALPHA 8
-#define LIT_SPECULAR_RED 9
-#define LIT_SPECULAR_GREEN 10
-#define LIT_SPECULAR_BLUE 11
-#define LIT_SPECULAR_ALPHA 12
-#define LIT_POSITION_X 13
-#define LIT_POSITION_Y 14
-#define LIT_POSITION_Z 15
-#define LIT_POSITION_W 16
-#define LIT_DIRECTION_X 17
-#define LIT_DIRECTION_Y 18
-#define LIT_DIRECTION_Z 19
-#define LIT_DIRECTION_W 20
-#define LIT_ATTEN_QUADRATIC 21
-#define LIT_ATTEN_LINEAR 22
-#define LIT_ATTEN_CONST 23
-#define LIT_ATTEN_XXX 24
-#define LIT_CMD_1 25
-#define LIT_SPOT_DCD 26
-#define LIT_SPOT_DCM 27
-#define LIT_SPOT_EXPONENT 28
-#define LIT_SPOT_CUTOFF 29
-#define LIT_SPECULAR_THRESH 30
-#define LIT_RANGE_CUTOFF 31 /* ? */
-#define LIT_ATTEN_CONST_INV 32
-#define LIT_STATE_SIZE 33
-
-/* Fog
- */
-#define FOG_CMD_0 0
-#define FOG_R 1
-#define FOG_C 2
-#define FOG_D 3
-#define FOG_PAD 4
-#define FOG_STATE_SIZE 5
-
-/* UCP
- */
-#define UCP_CMD_0 0
-#define UCP_X 1
-#define UCP_Y 2
-#define UCP_Z 3
-#define UCP_W 4
-#define UCP_STATE_SIZE 5
-
-/* GLT - Global ambient
- */
-#define GLT_CMD_0 0
-#define GLT_RED 1
-#define GLT_GREEN 2
-#define GLT_BLUE 3
-#define GLT_ALPHA 4
-#define GLT_STATE_SIZE 5
-
-/* EYE
- */
-#define EYE_CMD_0 0
-#define EYE_X 1
-#define EYE_Y 2
-#define EYE_Z 3
-#define EYE_RESCALE_FACTOR 4
-#define EYE_STATE_SIZE 5
-
-/* CST - constant state
- */
-#define CST_CMD_0 0
-#define CST_PP_CNTL_X 1
-#define CST_CMD_1 2
-#define CST_RB3D_DEPTHXY_OFFSET 3
-#define CST_CMD_2 4
-#define CST_RE_AUX_SCISSOR_CNTL 5
-#define CST_CMD_3 6
-#define CST_RE_SCISSOR_TL_0 7
-#define CST_RE_SCISSOR_BR_0 8
-#define CST_CMD_4 9
-#define CST_SE_VAP_CNTL_STATUS 10
-#define CST_CMD_5 11
-#define CST_RE_POINTSIZE 12
-#define CST_CMD_6 13
-#define CST_SE_TCL_INPUT_VTX_0 14
-#define CST_SE_TCL_INPUT_VTX_1 15
-#define CST_SE_TCL_INPUT_VTX_2 16
-#define CST_SE_TCL_INPUT_VTX_3 17
-#define CST_STATE_SIZE 18
-
-#define PRF_CMD_0 0
-#define PRF_PP_TRI_PERF 1
-#define PRF_PP_PERF_CNTL 2
-#define PRF_STATE_SIZE 3
-
-
-struct r200_hw_state {
- /* Head of the linked list of state atoms. */
- struct r200_state_atom atomlist;
-
- /* Hardware state, stored as cmdbuf commands:
- * -- Need to doublebuffer for
- * - reviving state after loss of context
- * - eliding noop statechange loops? (except line stipple count)
- */
- struct r200_state_atom ctx;
- struct r200_state_atom set;
- struct r200_state_atom vte;
- struct r200_state_atom lin;
- struct r200_state_atom msk;
- struct r200_state_atom vpt;
- struct r200_state_atom vap;
- struct r200_state_atom vtx;
- struct r200_state_atom tcl;
- struct r200_state_atom msl;
- struct r200_state_atom tcg;
- struct r200_state_atom msc;
- struct r200_state_atom cst;
- struct r200_state_atom tam;
- struct r200_state_atom tf;
- struct r200_state_atom tex[6];
- struct r200_state_atom cube[6];
- struct r200_state_atom zbs;
- struct r200_state_atom mtl[2];
- struct r200_state_atom mat[9];
- struct r200_state_atom lit[8]; /* includes vec, scl commands */
- struct r200_state_atom ucp[6];
- struct r200_state_atom pix[6]; /* pixshader stages */
- struct r200_state_atom eye; /* eye pos */
- struct r200_state_atom grd; /* guard band clipping */
- struct r200_state_atom fog;
- struct r200_state_atom glt;
- struct r200_state_atom prf;
-
- int max_state_size; /* Number of bytes necessary for a full state emit. */
- GLboolean is_dirty, all_dirty;
-};
-
-struct r200_state {
- /* Derived state for internal purposes:
- */
- struct r200_colorbuffer_state color;
- struct r200_depthbuffer_state depth;
- struct r200_pixel_state pixel;
- struct r200_scissor_state scissor;
- struct r200_stencilbuffer_state stencil;
- struct r200_stipple_state stipple;
- struct r200_texture_state texture;
-};
-
-/* Need refcounting on dma buffers:
- */
-struct r200_dma_buffer {
- int refcount; /* the number of retained regions in buf */
- drmBufPtr buf;
-};
-
-#define GET_START(rvb) (rmesa->r200Screen->gart_buffer_offset + \
- (rvb)->address - rmesa->dma.buf0_address + \
- (rvb)->start)
-
-/* A retained region, eg vertices for indexed vertices.
- */
-struct r200_dma_region {
- struct r200_dma_buffer *buf;
- char *address; /* == buf->address */
- int start, end, ptr; /* offsets from start of buf */
- int aos_start;
- int aos_stride;
- int aos_size;
-};
-
-
-struct r200_dma {
- /* Active dma region. Allocations for vertices and retained
- * regions come from here. Also used for emitting random vertices,
- * these may be flushed by calling flush_current();
- */
- struct r200_dma_region current;
-
- void (*flush)( r200ContextPtr );
-
- char *buf0_address; /* start of buf[0], for index calcs */
- GLuint nr_released_bufs; /* flush after so many buffers released */
-};
-
-struct r200_dri_mirror {
- __DRIcontextPrivate *context; /* DRI context */
- __DRIscreenPrivate *screen; /* DRI screen */
- __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
-
- drm_context_t hwContext;
- drm_hw_lock_t *hwLock;
- int fd;
- int drmMinor;
-};
-
-
-#define R200_CMD_BUF_SZ (8*1024)
-
-struct r200_store {
- GLuint statenr;
- GLuint primnr;
- char cmd_buf[R200_CMD_BUF_SZ];
- int cmd_used;
- int elts_start;
-};
-
-
-/* r200_tcl.c
- */
-struct r200_tcl_info {
- GLuint vertex_format;
- GLint last_offset;
- GLuint hw_primitive;
-
- struct r200_dma_region *aos_components[8];
- GLuint nr_aos_components;
-
- GLuint *Elts;
-
- struct r200_dma_region indexed_verts;
- struct r200_dma_region obj;
- struct r200_dma_region rgba;
- struct r200_dma_region spec;
- struct r200_dma_region fog;
- struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
- struct r200_dma_region norm;
-};
-
-
-/* r200_swtcl.c
- */
-struct r200_swtcl_info {
- GLuint RenderIndex;
-
- /**
- * Size of a hardware vertex. This is calculated when \c ::vertex_attrs is
- * installed in the Mesa state vector.
- */
- GLuint vertex_size;
-
- /**
- * Attributes instructing the Mesa TCL pipeline where / how to put vertex
- * data in the hardware buffer.
- */
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
-
- /**
- * Number of elements of \c ::vertex_attrs that are actually used.
- */
- GLuint vertex_attr_count;
-
- /**
- * Cached pointer to the buffer where Mesa will store vertex data.
- */
- GLubyte *verts;
-
- /* Fallback rasterization functions
- */
- r200_point_func draw_point;
- r200_line_func draw_line;
- r200_tri_func draw_tri;
-
- GLuint hw_primitive;
- GLenum render_primitive;
- GLuint numverts;
-
- /**
- * Offset of the 4UB color data within a hardware (swtcl) vertex.
- */
- GLuint coloroffset;
-
- /**
- * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
- */
- GLuint specoffset;
-
- /**
- * Should Mesa project vertex data or will the hardware do it?
- */
- GLboolean needproj;
-
- struct r200_dma_region indexed_verts;
-};
-
-
-struct r200_ioctl {
- GLuint vertex_offset;
- GLuint vertex_size;
-};
-
-
-
-#define R200_MAX_PRIMS 64
-
-
-/* Want to keep a cache of these around. Each is parameterized by
- * only a single value which has only a small range. Only expect a
- * few, so just rescan the list each time?
- */
-struct dynfn {
- struct dynfn *next, *prev;
- int key[2];
- char *code;
-};
-
-struct dfn_lists {
- struct dynfn Vertex2f;
- struct dynfn Vertex2fv;
- struct dynfn Vertex3f;
- struct dynfn Vertex3fv;
- struct dynfn Color4ub;
- struct dynfn Color4ubv;
- struct dynfn Color3ub;
- struct dynfn Color3ubv;
- struct dynfn Color4f;
- struct dynfn Color4fv;
- struct dynfn Color3f;
- struct dynfn Color3fv;
- struct dynfn SecondaryColor3ubEXT;
- struct dynfn SecondaryColor3ubvEXT;
- struct dynfn SecondaryColor3fEXT;
- struct dynfn SecondaryColor3fvEXT;
- struct dynfn Normal3f;
- struct dynfn Normal3fv;
- struct dynfn TexCoord3f;
- struct dynfn TexCoord3fv;
- struct dynfn TexCoord2f;
- struct dynfn TexCoord2fv;
- struct dynfn TexCoord1f;
- struct dynfn TexCoord1fv;
- struct dynfn MultiTexCoord3fARB;
- struct dynfn MultiTexCoord3fvARB;
- struct dynfn MultiTexCoord2fARB;
- struct dynfn MultiTexCoord2fvARB;
- struct dynfn MultiTexCoord1fARB;
- struct dynfn MultiTexCoord1fvARB;
- struct dynfn FogCoordfEXT;
- struct dynfn FogCoordfvEXT;
-};
-
-struct dfn_generators {
- struct dynfn *(*Vertex2f)( GLcontext *, const int * );
- struct dynfn *(*Vertex2fv)( GLcontext *, const int * );
- struct dynfn *(*Vertex3f)( GLcontext *, const int * );
- struct dynfn *(*Vertex3fv)( GLcontext *, const int * );
- struct dynfn *(*Color4ub)( GLcontext *, const int * );
- struct dynfn *(*Color4ubv)( GLcontext *, const int * );
- struct dynfn *(*Color3ub)( GLcontext *, const int * );
- struct dynfn *(*Color3ubv)( GLcontext *, const int * );
- struct dynfn *(*Color4f)( GLcontext *, const int * );
- struct dynfn *(*Color4fv)( GLcontext *, const int * );
- struct dynfn *(*Color3f)( GLcontext *, const int * );
- struct dynfn *(*Color3fv)( GLcontext *, const int * );
- struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, const int * );
- struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, const int * );
- struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, const int * );
- struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, const int * );
- struct dynfn *(*Normal3f)( GLcontext *, const int * );
- struct dynfn *(*Normal3fv)( GLcontext *, const int * );
- struct dynfn *(*TexCoord3f)( GLcontext *, const int * );
- struct dynfn *(*TexCoord3fv)( GLcontext *, const int * );
- struct dynfn *(*TexCoord2f)( GLcontext *, const int * );
- struct dynfn *(*TexCoord2fv)( GLcontext *, const int * );
- struct dynfn *(*TexCoord1f)( GLcontext *, const int * );
- struct dynfn *(*TexCoord1fv)( GLcontext *, const int * );
- struct dynfn *(*MultiTexCoord3fARB)( GLcontext *, const int * );
- struct dynfn *(*MultiTexCoord3fvARB)( GLcontext *, const int * );
- struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, const int * );
- struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, const int * );
- struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, const int * );
- struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, const int * );
- struct dynfn *(*FogCoordfEXT)( GLcontext *, const int * );
- struct dynfn *(*FogCoordfvEXT)( GLcontext *, const int * );
-};
-
-
-
-struct r200_prim {
- GLuint start;
- GLuint end;
- GLuint prim;
-};
-
- /* A maximum total of 29 elements per vertex: 3 floats for position, 3
- * floats for normal, 4 floats for color, 4 bytes for secondary color,
- * 3 floats for each texture unit (18 floats total).
- *
- * we maybe need add. 4 to prevent segfault if someone specifies
- * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: )
- *
- * The position data is never actually stored here, so 3 elements could be
- * trimmed out of the buffer.
- */
-
-#define R200_MAX_VERTEX_SIZE ((3*6)+11)
-
-struct r200_vbinfo {
- GLint counter, initial_counter;
- GLint *dmaptr;
- void (*notify)( void );
- GLint vertex_size;
-
- union { float f; int i; r200_color_t color; } vertex[R200_MAX_VERTEX_SIZE];
-
- GLfloat *normalptr;
- GLfloat *floatcolorptr;
- GLfloat *fogptr;
- r200_color_t *colorptr;
- GLfloat *floatspecptr;
- r200_color_t *specptr;
- GLfloat *texcoordptr[8]; /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */
-
-
- GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */
- GLuint primflags;
- GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */
- GLboolean installed;
- GLboolean fell_back;
- GLboolean recheck;
- GLint nrverts;
- GLuint vtxfmt_0, vtxfmt_1;
-
- GLuint installed_vertex_format;
- GLuint installed_color_3f_sz;
-
- struct r200_prim primlist[R200_MAX_PRIMS];
- int nrprims;
-
- struct dfn_lists dfn_cache;
- struct dfn_generators codegen;
- GLvertexformat vtxfmt;
-};
-
-
-struct r200_context {
- GLcontext *glCtx; /* Mesa context */
-
- /* Driver and hardware state management
- */
- struct r200_hw_state hw;
- struct r200_state state;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap * texture_heaps[ R200_NR_TEX_HEAPS ];
- driTextureObject swapped;
- int texture_depth;
- float initialMaxAnisotropy;
-
- /* Rasterization and vertex state:
- */
- GLuint TclFallback;
- GLuint Fallback;
- GLuint NewGLState;
- GLuint tnl_index; /* index of bits for last tnl_install_attrs */
-
- /* Vertex buffers
- */
- struct r200_ioctl ioctl;
- struct r200_dma dma;
- struct r200_store store;
- /* A full state emit as of the first state emit in the main store, in case
- * the context is lost.
- */
- struct r200_store backup_store;
-
- /* Page flipping
- */
- GLuint doPageFlip;
-
- /* Busy waiting
- */
- GLuint do_usleeps;
- GLuint do_irqs;
- GLuint irqsEmitted;
- drm_radeon_irq_wait_t iw;
-
- /* Clientdata textures;
- */
- GLuint prefer_gart_client_texturing;
-
- /* Drawable, cliprect and scissor information
- */
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
- unsigned int lastStamp;
- GLboolean lost_context;
- GLboolean save_on_next_emit;
- r200ScreenPtr r200Screen; /* Screen private DRI data */
- drm_radeon_sarea_t *sarea; /* Private SAREA data */
-
- /* TCL stuff
- */
- GLmatrix TexGenMatrix[R200_MAX_TEXTURE_UNITS];
- GLboolean recheck_texgen[R200_MAX_TEXTURE_UNITS];
- GLboolean TexGenNeedNormals[R200_MAX_TEXTURE_UNITS];
- GLuint TexMatEnabled;
- GLuint TexMatCompSel;
- GLuint TexGenEnabled;
- GLuint TexGenCompSel;
- GLmatrix tmpmat;
-
- /* VBI / buffer swap
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
- int64_t swap_ust;
- int64_t swap_missed_ust;
-
- GLuint swap_count;
- GLuint swap_missed_count;
-
-
- /* r200_tcl.c
- */
- struct r200_tcl_info tcl;
-
- /* r200_swtcl.c
- */
- struct r200_swtcl_info swtcl;
-
- /* r200_vtxfmt.c
- */
- struct r200_vbinfo vb;
-
- /* Mirrors of some DRI state
- */
- struct r200_dri_mirror dri;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-
- GLboolean using_hyperz;
- GLboolean texmicrotile;
-};
-
-#define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx))
-
-
-static __inline GLuint r200PackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return PACK_COLOR_565( r, g, b );
- case 4:
- return PACK_COLOR_8888( a, r, g, b );
- default:
- return 0;
- }
-}
-
-
-extern void r200DestroyContext( __DRIcontextPrivate *driContextPriv );
-extern GLboolean r200CreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-extern void r200SwapBuffers( __DRIdrawablePrivate *dPriv );
-extern GLboolean r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv );
-extern GLboolean r200UnbindContext( __DRIcontextPrivate *driContextPriv );
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-
-#if DO_DEBUG
-extern int R200_DEBUG;
-#else
-#define R200_DEBUG 0
-#endif
-
-#define DEBUG_TEXTURE 0x001
-#define DEBUG_STATE 0x002
-#define DEBUG_IOCTL 0x004
-#define DEBUG_PRIMS 0x008
-#define DEBUG_VERTS 0x010
-#define DEBUG_FALLBACKS 0x020
-#define DEBUG_VFMT 0x040
-#define DEBUG_CODEGEN 0x080
-#define DEBUG_VERBOSE 0x100
-#define DEBUG_DRI 0x200
-#define DEBUG_DMA 0x400
-#define DEBUG_SANITY 0x800
-#define DEBUG_SYNC 0x1000
-#define DEBUG_PIXEL 0x2000
-#define DEBUG_MEMORY 0x4000
-
-#endif /* __R200_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c
deleted file mode 100644
index a2336ce4f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c,v 1.4 2002/12/17 00:32:56 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <sched.h>
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
-#include "swrast/swrast.h"
-
-#include "r200_context.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-#include "r200_tcl.h"
-#include "r200_sanity.h"
-#include "radeon_reg.h"
-
-#include "vblank.h"
-
-
-#define R200_TIMEOUT 512
-#define R200_IDLE_RETRY 16
-
-
-static void r200WaitForIdle( r200ContextPtr rmesa );
-
-
-/* At this point we were in FlushCmdBufLocked but we had lost our context, so
- * we need to unwire our current cmdbuf, hook the one with the saved state in
- * it, flush it, and then put the current one back. This is so commands at the
- * start of a cmdbuf can rely on the state being kept from the previous one.
- */
-static void r200BackUpAndEmitLostStateLocked( r200ContextPtr rmesa )
-{
- GLuint nr_released_bufs;
- struct r200_store saved_store;
-
- if (rmesa->backup_store.cmd_used == 0)
- return;
-
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Emitting backup state on lost context\n");
-
- rmesa->lost_context = GL_FALSE;
-
- nr_released_bufs = rmesa->dma.nr_released_bufs;
- saved_store = rmesa->store;
- rmesa->dma.nr_released_bufs = 0;
- rmesa->store = rmesa->backup_store;
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
- rmesa->dma.nr_released_bufs = nr_released_bufs;
- rmesa->store = saved_store;
-}
-
-int r200FlushCmdBufLocked( r200ContextPtr rmesa, const char * caller )
-{
- int ret, i;
- drm_radeon_cmd_buffer_t cmd;
-
- if (rmesa->lost_context)
- r200BackUpAndEmitLostStateLocked( rmesa );
-
- if (R200_DEBUG & DEBUG_IOCTL) {
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (0 & R200_DEBUG & DEBUG_VERBOSE)
- for (i = 0 ; i < rmesa->store.cmd_used ; i += 4 )
- fprintf(stderr, "%d: %x\n", i/4,
- *(int *)(&rmesa->store.cmd_buf[i]));
- }
-
- if (R200_DEBUG & DEBUG_DMA)
- fprintf(stderr, "%s: Releasing %d buffers\n", __FUNCTION__,
- rmesa->dma.nr_released_bufs);
-
-
- if (R200_DEBUG & DEBUG_SANITY) {
- if (rmesa->state.scissor.enabled)
- ret = r200SanityCmdBuffer( rmesa,
- rmesa->state.scissor.numClipRects,
- rmesa->state.scissor.pClipRects);
- else
- ret = r200SanityCmdBuffer( rmesa,
- rmesa->numClipRects,
- rmesa->pClipRects);
- if (ret) {
- fprintf(stderr, "drmSanityCommandWrite: %d\n", ret);
- goto out;
- }
- }
-
-
- if (R200_DEBUG & DEBUG_MEMORY) {
- if (! driValidateTextureHeaps( rmesa->texture_heaps, rmesa->nr_heaps,
- & rmesa->swapped ) ) {
- fprintf( stderr, "%s: texture memory is inconsistent - expect "
- "mangled textures\n", __FUNCTION__ );
- }
- }
-
-
- cmd.bufsz = rmesa->store.cmd_used;
- cmd.buf = rmesa->store.cmd_buf;
-
- if (rmesa->state.scissor.enabled) {
- cmd.nbox = rmesa->state.scissor.numClipRects;
- cmd.boxes = (drm_clip_rect_t *)rmesa->state.scissor.pClipRects;
- } else {
- cmd.nbox = rmesa->numClipRects;
- cmd.boxes = (drm_clip_rect_t *)rmesa->pClipRects;
- }
-
- ret = drmCommandWrite( rmesa->dri.fd,
- DRM_RADEON_CMDBUF,
- &cmd, sizeof(cmd) );
-
- if (ret)
- fprintf(stderr, "drmCommandWrite: %d\n", ret);
-
- if (R200_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "\nSyncing in %s\n\n", __FUNCTION__);
- r200WaitForIdleLocked( rmesa );
- }
-
-
- out:
- rmesa->store.primnr = 0;
- rmesa->store.statenr = 0;
- rmesa->store.cmd_used = 0;
- rmesa->dma.nr_released_bufs = 0;
- rmesa->save_on_next_emit = 1;
-
- return ret;
-}
-
-
-/* Note: does not emit any commands to avoid recursion on
- * r200AllocCmdBuf.
- */
-void r200FlushCmdBuf( r200ContextPtr rmesa, const char *caller )
-{
- int ret;
-
- LOCK_HARDWARE( rmesa );
-
- ret = r200FlushCmdBufLocked( rmesa, caller );
-
- UNLOCK_HARDWARE( rmesa );
-
- if (ret) {
- fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret);
- exit(ret);
- }
-}
-
-
-/* =============================================================
- * Hardware vertex buffer handling
- */
-
-
-void r200RefillCurrentDmaRegion( r200ContextPtr rmesa )
-{
- struct r200_dma_buffer *dmabuf;
- int fd = rmesa->dri.fd;
- int index = 0;
- int size = 0;
- drmDMAReq dma;
- int ret;
-
- if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->dma.flush) {
- rmesa->dma.flush( rmesa );
- }
-
- if (rmesa->dma.current.buf)
- r200ReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
-
- if (rmesa->dma.nr_released_bufs > 4)
- r200FlushCmdBuf( rmesa, __FUNCTION__ );
-
- dma.context = rmesa->dri.hwContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = RADEON_BUFFER_SIZE;
- dma.request_list = &index;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
- LOCK_HARDWARE(rmesa); /* no need to validate */
-
- while (1) {
- ret = drmDMA( fd, &dma );
- if (ret == 0)
- break;
-
- if (rmesa->dma.nr_released_bufs) {
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
- }
-
- if (rmesa->do_usleeps) {
- UNLOCK_HARDWARE( rmesa );
- DO_USLEEP( 1 );
- LOCK_HARDWARE( rmesa );
- }
- }
-
- UNLOCK_HARDWARE(rmesa);
-
- if (R200_DEBUG & DEBUG_DMA)
- fprintf(stderr, "Allocated buffer %d\n", index);
-
- dmabuf = CALLOC_STRUCT( r200_dma_buffer );
- dmabuf->buf = &rmesa->r200Screen->buffers->list[index];
- dmabuf->refcount = 1;
-
- rmesa->dma.current.buf = dmabuf;
- rmesa->dma.current.address = dmabuf->buf->address;
- rmesa->dma.current.end = dmabuf->buf->total;
- rmesa->dma.current.start = 0;
- rmesa->dma.current.ptr = 0;
-}
-
-void r200ReleaseDmaRegion( r200ContextPtr rmesa,
- struct r200_dma_region *region,
- const char *caller )
-{
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (!region->buf)
- return;
-
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- if (--region->buf->refcount == 0) {
- drm_radeon_cmd_header_t *cmd;
-
- if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
- fprintf(stderr, "%s -- DISCARD BUF %d\n", __FUNCTION__,
- region->buf->buf->idx);
-
- cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, sizeof(*cmd),
- __FUNCTION__ );
- cmd->dma.cmd_type = RADEON_CMD_DMA_DISCARD;
- cmd->dma.buf_idx = region->buf->buf->idx;
- FREE(region->buf);
- rmesa->dma.nr_released_bufs++;
- }
-
- region->buf = NULL;
- region->start = 0;
-}
-
-/* Allocates a region from rmesa->dma.current. If there isn't enough
- * space in current, grab a new buffer (and discard what was left of current)
- */
-void r200AllocDmaRegion( r200ContextPtr rmesa,
- struct r200_dma_region *region,
- int bytes,
- int alignment )
-{
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
-
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- if (region->buf)
- r200ReleaseDmaRegion( rmesa, region, __FUNCTION__ );
-
- alignment--;
- rmesa->dma.current.start = rmesa->dma.current.ptr =
- (rmesa->dma.current.ptr + alignment) & ~alignment;
-
- if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
- r200RefillCurrentDmaRegion( rmesa );
-
- region->start = rmesa->dma.current.start;
- region->ptr = rmesa->dma.current.start;
- region->end = rmesa->dma.current.start + bytes;
- region->address = rmesa->dma.current.address;
- region->buf = rmesa->dma.current.buf;
- region->buf->refcount++;
-
- rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */
- rmesa->dma.current.start =
- rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7;
-
- assert( rmesa->dma.current.ptr <= rmesa->dma.current.end );
-}
-
-void r200AllocDmaRegionVerts( r200ContextPtr rmesa,
- struct r200_dma_region *region,
- int numverts,
- int vertsize,
- int alignment )
-{
- r200AllocDmaRegion( rmesa, region, vertsize * numverts, alignment );
-}
-
-/* ================================================================
- * SwapBuffers with client-side throttling
- */
-
-static u_int32_t r200GetLastFrame(r200ContextPtr rmesa)
-{
- drm_radeon_getparam_t gp;
- int ret;
- u_int32_t frame;
-
- gp.param = RADEON_PARAM_LAST_FRAME;
- gp.value = (int *)&frame;
- ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp) );
- if ( ret ) {
- fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-
- return frame;
-}
-
-static void r200EmitIrqLocked( r200ContextPtr rmesa )
-{
- drm_radeon_irq_emit_t ie;
- int ret;
-
- ie.irq_seq = &rmesa->iw.irq_seq;
- ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_IRQ_EMIT,
- &ie, sizeof(ie) );
- if ( ret ) {
- fprintf( stderr, "%s: drmRadeonIrqEmit: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-}
-
-
-static void r200WaitIrq( r200ContextPtr rmesa )
-{
- int ret;
-
- do {
- ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_IRQ_WAIT,
- &rmesa->iw, sizeof(rmesa->iw) );
- } while (ret && (errno == EINTR || errno == EAGAIN));
-
- if ( ret ) {
- fprintf( stderr, "%s: drmRadeonIrqWait: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-}
-
-
-static void r200WaitForFrameCompletion( r200ContextPtr rmesa )
-{
- drm_radeon_sarea_t *sarea = rmesa->sarea;
-
- if (rmesa->do_irqs) {
- if (r200GetLastFrame(rmesa) < sarea->last_frame) {
- if (!rmesa->irqsEmitted) {
- while (r200GetLastFrame (rmesa) < sarea->last_frame)
- ;
- }
- else {
- UNLOCK_HARDWARE( rmesa );
- r200WaitIrq( rmesa );
- LOCK_HARDWARE( rmesa );
- }
- rmesa->irqsEmitted = 10;
- }
-
- if (rmesa->irqsEmitted) {
- r200EmitIrqLocked( rmesa );
- rmesa->irqsEmitted--;
- }
- }
- else {
- while (r200GetLastFrame (rmesa) < sarea->last_frame) {
- UNLOCK_HARDWARE( rmesa );
- if (rmesa->do_usleeps)
- DO_USLEEP( 1 );
- LOCK_HARDWARE( rmesa );
- }
- }
-}
-
-
-
-/* Copy the back color buffer to the front color buffer.
- */
-void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- r200ContextPtr rmesa;
- GLint nbox, i, ret;
- GLboolean missed_target;
- int64_t ust;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( R200_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *)rmesa->glCtx );
- }
-
- R200_FIREVERTICES( rmesa );
-
- LOCK_HARDWARE( rmesa );
-
-
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- */
- r200WaitForFrameCompletion( rmesa );
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
- LOCK_HARDWARE( rmesa );
-
- nbox = dPriv->numClipRects; /* must be in locked region */
-
- for ( i = 0 ; i < nbox ; ) {
- GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS , nbox );
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- GLint n = 0;
-
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- rmesa->sarea->nbox = n;
-
- ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
-
- if ( ret ) {
- fprintf( stderr, "DRM_R200_SWAP_BUFFERS: return = %d\n", ret );
- UNLOCK_HARDWARE( rmesa );
- exit( 1 );
- }
- }
-
- UNLOCK_HARDWARE( rmesa );
- rmesa->hw.all_dirty = GL_TRUE;
-
- rmesa->swap_count++;
- (*dri_interface->getUST)( & ust );
- if ( missed_target ) {
- rmesa->swap_missed_count++;
- rmesa->swap_missed_ust = ust - rmesa->swap_ust;
- }
-
- rmesa->swap_ust = ust;
-
- sched_yield();
-}
-
-void r200PageFlip( const __DRIdrawablePrivate *dPriv )
-{
- r200ContextPtr rmesa;
- GLint ret;
- GLboolean missed_target;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( R200_DEBUG & DEBUG_IOCTL ) {
- fprintf(stderr, "%s: pfCurrentPage: %d\n", __FUNCTION__,
- rmesa->sarea->pfCurrentPage);
- }
-
- R200_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
-
- if (!dPriv->numClipRects) {
- UNLOCK_HARDWARE( rmesa );
- usleep( 10000 ); /* throttle invisible client 10ms */
- return;
- }
-
- /* Need to do this for the perf box placement:
- */
- {
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- b[0] = box[0];
- rmesa->sarea->nbox = 1;
- }
-
- /* Throttle the frame rate -- only allow a few pending swap buffers
- * request at a time.
- */
- r200WaitForFrameCompletion( rmesa );
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
- if ( missed_target ) {
- rmesa->swap_missed_count++;
- (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
- }
- LOCK_HARDWARE( rmesa );
-
- ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_FLIP );
-
- UNLOCK_HARDWARE( rmesa );
-
- if ( ret ) {
- fprintf( stderr, "DRM_RADEON_FLIP: return = %d\n", ret );
- exit( 1 );
- }
-
- rmesa->swap_count++;
- (void) (*dri_interface->getUST)( & rmesa->swap_ust );
-
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
- }
-
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
- + rmesa->r200Screen->fbLocation;
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= R200_COLOR_TILE_ENABLE;
- }
-}
-
-
-/* ================================================================
- * Buffer clear
- */
-static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- GLuint flags = 0;
- GLuint color_mask = 0;
- GLint ret, i;
-
- if ( R200_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
- }
-
- {
- LOCK_HARDWARE( rmesa );
- UNLOCK_HARDWARE( rmesa );
- if ( dPriv->numClipRects == 0 )
- return;
- }
-
- r200Flush( ctx );
-
- if ( mask & BUFFER_BIT_FRONT_LEFT ) {
- flags |= RADEON_FRONT;
- color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ( mask & BUFFER_BIT_BACK_LEFT ) {
- flags |= RADEON_BACK;
- color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ( mask & BUFFER_BIT_DEPTH ) {
- flags |= RADEON_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if ( (mask & BUFFER_BIT_STENCIL) && rmesa->state.stencil.hwBuffer ) {
- flags |= RADEON_STENCIL;
- mask &= ~BUFFER_BIT_STENCIL;
- }
-
- if ( mask ) {
- if (R200_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
- }
-
- if ( !flags )
- return;
-
- if (rmesa->using_hyperz) {
- flags |= RADEON_USE_COMP_ZBUF;
-/* if (rmesa->r200Screen->chipset & R200_CHIPSET_REAL_R200)
- flags |= RADEON_USE_HIERZ; */
- if (!(rmesa->state.stencil.hwBuffer) ||
- ((flags & RADEON_DEPTH) && (flags & RADEON_STENCIL) &&
- ((rmesa->state.stencil.clear & R200_STENCIL_WRITE_MASK) == R200_STENCIL_WRITE_MASK))) {
- flags |= RADEON_CLEAR_FASTZ;
- }
- }
-
- /* Flip top to bottom */
- cx += dPriv->x;
- cy = dPriv->y + dPriv->h - cy - ch;
-
- LOCK_HARDWARE( rmesa );
-
- /* Throttle the number of clear ioctls we do.
- */
- while ( 1 ) {
- drm_radeon_getparam_t gp;
- int ret;
- int clear;
-
- gp.param = RADEON_PARAM_LAST_CLEAR;
- gp.value = (int *)&clear;
- ret = drmCommandWriteRead( rmesa->dri.fd,
- DRM_RADEON_GETPARAM, &gp, sizeof(gp) );
-
- if ( ret ) {
- fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-
- /* Clear throttling needs more thought.
- */
- if ( rmesa->sarea->last_clear - clear <= 25 ) {
- break;
- }
-
- if (rmesa->do_usleeps) {
- UNLOCK_HARDWARE( rmesa );
- DO_USLEEP( 1 );
- LOCK_HARDWARE( rmesa );
- }
- }
-
- /* Send current state to the hardware */
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
-
- for ( i = 0 ; i < dPriv->numClipRects ; ) {
- GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, dPriv->numClipRects );
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- drm_radeon_clear_t clear;
- drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
- GLint n = 0;
-
- if ( !all ) {
- for ( ; i < nr ; i++ ) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if ( x < cx ) w -= cx - x, x = cx;
- if ( y < cy ) h -= cy - y, y = cy;
- if ( x + w > cx + cw ) w = cx + cw - x;
- if ( y + h > cy + ch ) h = cy + ch - y;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- }
-
- rmesa->sarea->nbox = n;
-
- clear.flags = flags;
- clear.clear_color = rmesa->state.color.clear;
- clear.clear_depth = rmesa->state.depth.clear; /* needed for hyperz */
- clear.color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
- clear.depth_mask = rmesa->state.stencil.clear;
- clear.depth_boxes = depth_boxes;
-
- n--;
- b = rmesa->sarea->boxes;
- for ( ; n >= 0 ; n-- ) {
- depth_boxes[n].f[CLEAR_X1] = (float)b[n].x1;
- depth_boxes[n].f[CLEAR_Y1] = (float)b[n].y1;
- depth_boxes[n].f[CLEAR_X2] = (float)b[n].x2;
- depth_boxes[n].f[CLEAR_Y2] = (float)b[n].y2;
- depth_boxes[n].f[CLEAR_DEPTH] = ctx->Depth.Clear;
- }
-
- ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_CLEAR,
- &clear, sizeof(clear));
-
-
- if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "DRM_RADEON_CLEAR: return = %d\n", ret );
- exit( 1 );
- }
- }
-
- UNLOCK_HARDWARE( rmesa );
- rmesa->hw.all_dirty = GL_TRUE;
-}
-
-
-void r200WaitForIdleLocked( r200ContextPtr rmesa )
-{
- int ret;
- int i = 0;
-
- do {
- ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_CP_IDLE);
- if (ret)
- DO_USLEEP( 1 );
- } while (ret && ++i < 100);
-
- if ( ret < 0 ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "Error: R200 timed out... exiting\n" );
- exit( -1 );
- }
-}
-
-
-static void r200WaitForIdle( r200ContextPtr rmesa )
-{
- LOCK_HARDWARE(rmesa);
- r200WaitForIdleLocked( rmesa );
- UNLOCK_HARDWARE(rmesa);
-}
-
-
-void r200Flush( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- r200EmitState( rmesa );
-
- if (rmesa->store.cmd_used)
- r200FlushCmdBuf( rmesa, __FUNCTION__ );
-}
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
- */
-void r200Finish( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200Flush( ctx );
-
- if (rmesa->do_irqs) {
- LOCK_HARDWARE( rmesa );
- r200EmitIrqLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
- r200WaitIrq( rmesa );
- }
- else
- r200WaitForIdle( rmesa );
-}
-
-
-/* This version of AllocateMemoryMESA allocates only GART memory, and
- * only does so after the point at which the driver has been
- * initialized.
- *
- * Theoretically a valid context isn't required. However, in this
- * implementation, it is, as I'm using the hardware lock to protect
- * the kernel data structures, and the current context to get the
- * device fd.
- */
-void *r200AllocateMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLsizei size,
- GLfloat readfreq, GLfloat writefreq,
- GLfloat priority)
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa;
- int region_offset;
- drm_radeon_mem_alloc_t alloc;
- int ret;
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s sz %d %f/%f/%f\n", __FUNCTION__, size, readfreq,
- writefreq, priority);
-
- if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || !rmesa->r200Screen->gartTextures.map)
- return NULL;
-
- if (getenv("R200_NO_ALLOC"))
- return NULL;
-
- if (rmesa->dri.drmMinor < 6)
- return NULL;
-
- alloc.region = RADEON_MEM_REGION_GART;
- alloc.alignment = 0;
- alloc.size = size;
- alloc.region_offset = &region_offset;
-
- ret = drmCommandWriteRead( rmesa->r200Screen->driScreen->fd,
- DRM_RADEON_ALLOC,
- &alloc, sizeof(alloc));
-
- if (ret) {
- fprintf(stderr, "%s: DRM_RADEON_ALLOC ret %d\n", __FUNCTION__, ret);
- return NULL;
- }
-
- {
- char *region_start = (char *)rmesa->r200Screen->gartTextures.map;
- return (void *)(region_start + region_offset);
- }
-}
-
-
-/* Called via glXFreeMemoryMESA() */
-void r200FreeMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer)
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa;
- ptrdiff_t region_offset;
- drm_radeon_mem_free_t memfree;
- int ret;
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %p\n", __FUNCTION__, pointer);
-
- if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || !rmesa->r200Screen->gartTextures.map) {
- fprintf(stderr, "%s: no context\n", __FUNCTION__);
- return;
- }
-
- if (rmesa->dri.drmMinor < 6)
- return;
-
- region_offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map;
-
- if (region_offset < 0 ||
- region_offset > rmesa->r200Screen->gartTextures.size) {
- fprintf(stderr, "offset %d outside range 0..%d\n", region_offset,
- rmesa->r200Screen->gartTextures.size);
- return;
- }
-
- memfree.region = RADEON_MEM_REGION_GART;
- memfree.region_offset = region_offset;
-
- ret = drmCommandWrite( rmesa->r200Screen->driScreen->fd,
- DRM_RADEON_FREE,
- &memfree, sizeof(memfree));
-
- if (ret)
- fprintf(stderr, "%s: DRM_RADEON_FREE ret %d\n", __FUNCTION__, ret);
-}
-
-/* Called via glXGetMemoryOffsetMESA() */
-GLuint r200GetMemoryOffsetMESA(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer)
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa;
- GLuint card_offset;
-
- if (!ctx || !(rmesa = R200_CONTEXT(ctx)) ) {
- fprintf(stderr, "%s: no context\n", __FUNCTION__);
- return ~0;
- }
-
- if (!r200IsGartMemory( rmesa, pointer, 0 ))
- return ~0;
-
- if (rmesa->dri.drmMinor < 6)
- return ~0;
-
- card_offset = r200GartOffsetFromVirtual( rmesa, pointer );
-
- return card_offset - rmesa->r200Screen->gart_base;
-}
-
-GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer,
- GLint size )
-{
- ptrdiff_t offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map;
- int valid = (size >= 0 &&
- offset >= 0 &&
- offset + size < rmesa->r200Screen->gartTextures.size);
-
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "r200IsGartMemory( %p ) : %d\n", pointer, valid );
-
- return valid;
-}
-
-
-GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa, const GLvoid *pointer )
-{
- ptrdiff_t offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map;
-
- if (offset < 0 || offset > rmesa->r200Screen->gartTextures.size)
- return ~0;
- else
- return rmesa->r200Screen->gart_texture_offset + offset;
-}
-
-
-
-void r200InitIoctlFuncs( struct dd_function_table *functions )
-{
- functions->Clear = r200Clear;
- functions->Finish = r200Finish;
- functions->Flush = r200Flush;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h
deleted file mode 100644
index 8927acd7f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_IOCTL_H__
-#define __R200_IOCTL_H__
-
-#include "simple_list.h"
-#include "radeon_dri.h"
-#include "r200_lock.h"
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "radeon_drm.h"
-
-extern void r200EmitState( r200ContextPtr rmesa );
-extern void r200EmitVertexAOS( r200ContextPtr rmesa,
- GLuint vertex_size,
- GLuint offset );
-
-extern void r200EmitVbufPrim( r200ContextPtr rmesa,
- GLuint primitive,
- GLuint vertex_nr );
-
-extern void r200FlushElts( r200ContextPtr rmesa );
-
-extern GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa,
- GLuint primitive,
- GLuint min_nr );
-
-extern void r200EmitAOS( r200ContextPtr rmesa,
- struct r200_dma_region **regions,
- GLuint n,
- GLuint offset );
-
-extern void r200EmitBlit( r200ContextPtr rmesa,
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty,
- GLuint w, GLuint h );
-
-extern void r200EmitWait( r200ContextPtr rmesa, GLuint flags );
-
-extern void r200FlushCmdBuf( r200ContextPtr rmesa, const char * );
-extern int r200FlushCmdBufLocked( r200ContextPtr rmesa, const char * caller );
-
-extern void r200RefillCurrentDmaRegion( r200ContextPtr rmesa );
-
-extern void r200AllocDmaRegion( r200ContextPtr rmesa,
- struct r200_dma_region *region,
- int bytes,
- int alignment );
-
-extern void r200AllocDmaRegionVerts( r200ContextPtr rmesa,
- struct r200_dma_region *region,
- int numverts,
- int vertsize,
- int alignment );
-
-extern void r200ReleaseDmaRegion( r200ContextPtr rmesa,
- struct r200_dma_region *region,
- const char *caller );
-
-extern void r200CopyBuffer( const __DRIdrawablePrivate *drawable );
-extern void r200PageFlip( const __DRIdrawablePrivate *drawable );
-extern void r200Flush( GLcontext *ctx );
-extern void r200Finish( GLcontext *ctx );
-extern void r200WaitForIdleLocked( r200ContextPtr rmesa );
-extern void r200WaitForVBlank( r200ContextPtr rmesa );
-extern void r200InitIoctlFuncs( struct dd_function_table *functions );
-
-extern void *r200AllocateMemoryMESA( __DRInativeDisplay *dpy, int scrn, GLsizei size, GLfloat readfreq,
- GLfloat writefreq, GLfloat priority );
-extern void r200FreeMemoryMESA( __DRInativeDisplay *dpy, int scrn, GLvoid *pointer );
-extern GLuint r200GetMemoryOffsetMESA( __DRInativeDisplay *dpy, int scrn, const GLvoid *pointer );
-
-extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer,
- GLint size );
-
-extern GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa,
- const GLvoid *pointer );
-
-void r200SetUpAtomList( r200ContextPtr rmesa );
-
-/* ================================================================
- * Helper macros:
- */
-
-/* Close off the last primitive, if it exists.
- */
-#define R200_NEWPRIM( rmesa ) \
-do { \
- if ( rmesa->dma.flush ) \
- rmesa->dma.flush( rmesa ); \
-} while (0)
-
-/* Can accomodate several state changes and primitive changes without
- * actually firing the buffer.
- */
-#define R200_STATECHANGE( rmesa, ATOM ) \
-do { \
- R200_NEWPRIM( rmesa ); \
- rmesa->hw.ATOM.dirty = GL_TRUE; \
- rmesa->hw.is_dirty = GL_TRUE; \
-} while (0)
-
-#define R200_DB_STATE( ATOM ) \
- memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \
- rmesa->hw.ATOM.cmd_size * 4)
-
-static __inline int R200_DB_STATECHANGE(
- r200ContextPtr rmesa,
- struct r200_state_atom *atom )
-{
- if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size*4)) {
- int *tmp;
- R200_NEWPRIM( rmesa );
- atom->dirty = GL_TRUE;
- rmesa->hw.is_dirty = GL_TRUE;
- tmp = atom->cmd;
- atom->cmd = atom->lastcmd;
- atom->lastcmd = tmp;
- return 1;
- }
- else
- return 0;
-}
-
-
-/* Fire the buffered vertices no matter what.
- */
-#define R200_FIREVERTICES( rmesa ) \
-do { \
- if ( rmesa->store.cmd_used || rmesa->dma.flush ) { \
- r200Flush( rmesa->glCtx ); \
- } \
-} while (0)
-
-/* Command lengths. Note that any time you ensure ELTS_BUFSZ or VBUF_BUFSZ
- * are available, you will also be adding an rmesa->state.max_state_size because
- * r200EmitState is called from within r200EmitVbufPrim and r200FlushElts.
- */
-#define AOS_BUFSZ(nr) ((3 + ((nr / 2) * 3) + ((nr & 1) * 2)) * sizeof(int))
-#define VERT_AOS_BUFSZ (5 * sizeof(int))
-#define ELTS_BUFSZ(nr) (12 + nr * 2)
-#define VBUF_BUFSZ (3 * sizeof(int))
-
-/* Ensure that a minimum amount of space is available in the command buffer.
- * This is used to ensure atomicity of state updates with the rendering requests
- * that rely on them.
- *
- * An alternative would be to implement a "soft lock" such that when the buffer
- * wraps at an inopportune time, we grab the lock, flush the current buffer,
- * and hang on to the lock until the critical section is finished and we flush
- * the buffer again and unlock.
- */
-static __inline void r200EnsureCmdBufSpace( r200ContextPtr rmesa, int bytes )
-{
- if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ)
- r200FlushCmdBuf( rmesa, __FUNCTION__ );
- assert( bytes <= R200_CMD_BUF_SZ );
-}
-
-/* Alloc space in the command buffer
- */
-static __inline char *r200AllocCmdBuf( r200ContextPtr rmesa,
- int bytes, const char *where )
-{
- char * head;
-
- if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ)
- r200FlushCmdBuf( rmesa, where );
-
- head = rmesa->store.cmd_buf + rmesa->store.cmd_used;
- rmesa->store.cmd_used += bytes;
- assert( rmesa->store.cmd_used <= R200_CMD_BUF_SZ );
- return head;
-}
-
-#endif /* __R200_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.c
deleted file mode 100644
index 9b82c18d1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-#include <string.h>
-
-#include "r200_context.h"
-#include "r200_lock.h"
-#include "r200_tex.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-
-#if DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-/* Turn on/off page flipping according to the flags in the sarea:
- */
-static void
-r200UpdatePageFlipping( r200ContextPtr rmesa )
-{
- int use_back;
- rmesa->doPageFlip = rmesa->sarea->pfState;
-
- use_back = (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
- use_back ^= (rmesa->sarea->pfCurrentPage == 1);
-
- if (use_back) {
- rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
- }
-
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
- + rmesa->r200Screen->fbLocation;
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
-}
-
-
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void r200GetLock( r200ContextPtr rmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- __DRIscreenPrivate *sPriv = rmesa->dri.screen;
- drm_radeon_sarea_t *sarea = rmesa->sarea;
- int i;
-
- drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( rmesa->lastStamp != dPriv->lastStamp ) {
- r200UpdatePageFlipping( rmesa );
- if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
- r200SetCliprects( rmesa, GL_BACK_LEFT );
- else
- r200SetCliprects( rmesa, GL_FRONT_LEFT );
- r200UpdateViewportOffset( rmesa->glCtx );
- rmesa->lastStamp = dPriv->lastStamp;
- }
-
- R200_STATECHANGE( rmesa, ctx );
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= R200_COLOR_TILE_ENABLE;
- }
- else rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] &= ~R200_COLOR_TILE_ENABLE;
-
- if ( sarea->ctx_owner != rmesa->dri.hwContext ) {
- sarea->ctx_owner = rmesa->dri.hwContext;
- }
-
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( rmesa->texture_heaps[ i ] );
- }
-
- rmesa->lost_context = GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.h
deleted file mode 100644
index e4c3a7e93..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_lock.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_LOCK_H__
-#define __R200_LOCK_H__
-
-extern void r200GetLock( r200ContextPtr rmesa, GLuint flags );
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( rmesa ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( rmesa->dri.hwLock, rmesa->dri.hwContext, \
- (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret ); \
- if ( __ret ) \
- r200GetLock( rmesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-#define UNLOCK_HARDWARE( rmesa ) \
- do { \
- DRM_UNLOCK( rmesa->dri.fd, \
- rmesa->dri.hwLock, \
- rmesa->dri.hwContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-#endif /* __R200_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.c
deleted file mode 100644
index 23e1c962a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.c
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-/* Currently, can only use arrays, verts are not implemented, though
- * verts are suspected to be faster.
- * To get an idea how the verts path works, look at the radeon implementation.
- */
-#include <string.h>
-
-#include "r200_context.h"
-#define R200_MAOS_VERTS 0
-#if (R200_MAOS_VERTS)
-#include "r200_maos_verts.c"
-#else
-#include "r200_maos_arrays.c"
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.h
deleted file mode 100644
index b9e4d3c23..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_MAOS_H__
-#define __R200_MAOS_H__
-
-#include "r200_context.h"
-
-extern void r200EmitArrays( GLcontext *ctx, GLuint inputs );
-extern void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos_arrays.c
deleted file mode 100644
index 12ea462a4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c,v 1.3 2003/02/23 23:59:01 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "imports.h"
-#include "macros.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "math/m_translate.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_state.h"
-#include "r200_swtcl.h"
-#include "r200_maos.h"
-#include "r200_tcl.h"
-
-
-#if 0
-/* Usage:
- * - from r200_tcl_render
- * - call r200EmitArrays to ensure uptodate arrays in dma
- * - emit primitives (new type?) which reference the data
- * -- need to use elts for lineloop, quads, quadstrip/flat
- * -- other primitives are all well-formed (need tristrip-1,fake-poly)
- *
- */
-static void emit_ubyte_rgba3( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- r200_color_t *out = (r200_color_t *)(rvb->start + rvb->address);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d out %p\n",
- __FUNCTION__, count, stride, (void *)out);
-
- for (i = 0; i < count; i++) {
- out->red = *data;
- out->green = *(data+1);
- out->blue = *(data+2);
- out->alpha = 0xFF;
- out++;
- data += stride;
- }
-}
-
-static void emit_ubyte_rgba4( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 4) {
- for (i = 0; i < count; i++)
- ((int *)out)[i] = LE32_TO_CPU(((int *)data)[i]);
- } else {
- for (i = 0; i < count; i++) {
- *(int *)out++ = LE32_TO_CPU(*(int *)data);
- data += stride;
- }
- }
-}
-
-
-static void emit_ubyte_rgba( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int size,
- int stride,
- int count )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
-
- assert (!rvb->buf);
-
- if (stride == 0) {
- r200AllocDmaRegion( rmesa, rvb, 4, 4 );
- count = 1;
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = 1;
- }
- else {
- r200AllocDmaRegion( rmesa, rvb, 4 * count, 4 ); /* alignment? */
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 1;
- rvb->aos_size = 1;
- }
-
- /* Emit the data
- */
- switch (size) {
- case 3:
- emit_ubyte_rgba3( ctx, rvb, data, stride, count );
- break;
- case 4:
- emit_ubyte_rgba4( ctx, rvb, data, stride, count );
- break;
- default:
- assert(0);
- exit(1);
- break;
- }
-}
-#endif
-
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
- : "0" (nr), \
- "D" ((long)dst), \
- "S" ((long)src) ); \
-} while (0)
-#else
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int j; \
- for ( j = 0 ; j < nr ; j++ ) \
- dst[j] = ((int *)src)[j]; \
- dst += nr; \
-} while (0)
-#endif
-
-
-static void emit_vecfog( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- GLfloat *out;
-
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- assert (!rvb->buf);
-
- if (stride == 0) {
- r200AllocDmaRegion( rmesa, rvb, 4, 4 );
- count = 1;
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = 1;
- }
- else {
- r200AllocDmaRegion( rmesa, rvb, count * 4, 4 ); /* alignment? */
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 1;
- rvb->aos_size = 1;
- }
-
- /* Emit the data
- */
- out = (GLfloat *)(rvb->address + rvb->start);
- for (i = 0; i < count; i++) {
- out[0] = r200ComputeFogBlendFactor( ctx, *(GLfloat *)data );
- out++;
- data += stride;
- }
-
-}
-
-
-static void emit_vec4( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 4)
- COPY_DWORDS( out, data, count );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out++;
- data += stride;
- }
-}
-
-
-static void emit_vec8( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 8)
- COPY_DWORDS( out, data, count*2 );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out += 2;
- data += stride;
- }
-}
-
-static void emit_vec12( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d out %p data %p\n",
- __FUNCTION__, count, stride, (void *)out, (void *)data);
-
- if (stride == 12)
- COPY_DWORDS( out, data, count*3 );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out[2] = *(int *)(data+8);
- out += 3;
- data += stride;
- }
-}
-
-static void emit_vec16( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 16)
- COPY_DWORDS( out, data, count*4 );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out[2] = *(int *)(data+8);
- out[3] = *(int *)(data+12);
- out += 4;
- data += stride;
- }
-}
-
-
-static void emit_vector( GLcontext *ctx,
- struct r200_dma_region *rvb,
- char *data,
- int size,
- int stride,
- int count )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d size %d stride %d\n",
- __FUNCTION__, count, size, stride);
-
- assert (!rvb->buf);
-
- if (stride == 0) {
- r200AllocDmaRegion( rmesa, rvb, size * 4, 4 );
- count = 1;
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = size;
- }
- else {
- r200AllocDmaRegion( rmesa, rvb, size * count * 4, 4 ); /* alignment? */
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = size;
- rvb->aos_size = size;
- }
-
- /* Emit the data
- */
- switch (size) {
- case 1:
- emit_vec4( ctx, rvb, data, stride, count );
- break;
- case 2:
- emit_vec8( ctx, rvb, data, stride, count );
- break;
- case 3:
- emit_vec12( ctx, rvb, data, stride, count );
- break;
- case 4:
- emit_vec16( ctx, rvb, data, stride, count );
- break;
- default:
- assert(0);
- exit(1);
- break;
- }
-
-}
-
-
-
-/* Emit any changed arrays to new GART memory, re-emit a packet to
- * update the arrays.
- */
-void r200EmitArrays( GLcontext *ctx, GLuint inputs )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
- struct r200_dma_region **component = rmesa->tcl.aos_components;
- GLuint nr = 0;
- GLuint vfmt0 = 0, vfmt1 = 0;
- GLuint count = VB->Count;
- GLuint i;
-
- if (1) {
- if (!rmesa->tcl.obj.buf)
- emit_vector( ctx,
- &rmesa->tcl.obj,
- (char *)VB->ObjPtr->data,
- VB->ObjPtr->size,
- VB->ObjPtr->stride,
- count);
-
- switch( VB->ObjPtr->size ) {
- case 4: vfmt0 |= R200_VTX_W0;
- case 3: vfmt0 |= R200_VTX_Z0;
- case 2:
- default:
- break;
- }
- component[nr++] = &rmesa->tcl.obj;
- }
-
-
- if (inputs & VERT_BIT_NORMAL) {
- if (!rmesa->tcl.norm.buf)
- emit_vector( ctx,
- &(rmesa->tcl.norm),
- (char *)VB->NormalPtr->data,
- 3,
- VB->NormalPtr->stride,
- count);
-
- vfmt0 |= R200_VTX_N0;
- component[nr++] = &rmesa->tcl.norm;
- }
-
- if (inputs & VERT_BIT_FOG) {
- if (!rmesa->tcl.fog.buf)
- emit_vecfog( ctx,
- &(rmesa->tcl.fog),
- (char *)VB->FogCoordPtr->data,
- VB->FogCoordPtr->stride,
- count);
-
- vfmt0 |= R200_VTX_DISCRETE_FOG;
- component[nr++] = &rmesa->tcl.fog;
- }
-
- if (inputs & VERT_BIT_COLOR0) {
- int emitsize;
-
- if (VB->ColorPtr[0]->size == 4 &&
- (VB->ColorPtr[0]->stride != 0 ||
- VB->ColorPtr[0]->data[0][3] != 1.0)) {
- vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
- emitsize = 4;
- }
- else {
- vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_0_SHIFT;
- emitsize = 3;
- }
-
- if (!rmesa->tcl.rgba.buf)
- emit_vector( ctx,
- &(rmesa->tcl.rgba),
- (char *)VB->ColorPtr[0]->data,
- emitsize,
- VB->ColorPtr[0]->stride,
- count);
-
- component[nr++] = &rmesa->tcl.rgba;
- }
-
-
- if (inputs & VERT_BIT_COLOR1) {
- if (!rmesa->tcl.spec.buf) {
- emit_vector( ctx,
- &rmesa->tcl.spec,
- (char *)VB->SecondaryColorPtr[0]->data,
- 3,
- VB->SecondaryColorPtr[0]->stride,
- count);
- }
-
- /* How does this work?
- */
- vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_1_SHIFT;
- component[nr++] = &rmesa->tcl.spec;
- }
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- if (inputs & (VERT_BIT_TEX0 << i)) {
- if (!rmesa->tcl.tex[i].buf)
- emit_vector( ctx,
- &(rmesa->tcl.tex[i]),
- (char *)VB->TexCoordPtr[i]->data,
- VB->TexCoordPtr[i]->size,
- VB->TexCoordPtr[i]->stride,
- count );
-
- vfmt1 |= VB->TexCoordPtr[i]->size << (i * 3);
- component[nr++] = &rmesa->tcl.tex[i];
- }
- }
-
- if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||
- vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) {
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = vfmt0;
- rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = vfmt1;
- }
-
- rmesa->tcl.nr_aos_components = nr;
- rmesa->tcl.vertex_format = vfmt0;
-}
-
-
-void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
-{
- GLuint unit;
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
-/* if (R200_DEBUG & DEBUG_VERTS) */
-/* _tnl_print_vert_flags( __FUNCTION__, newinputs ); */
-
- if (newinputs & VERT_BIT_POS)
- r200ReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_NORMAL)
- r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_FOG)
- r200ReleaseDmaRegion( rmesa, &rmesa->tcl.fog, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_COLOR0)
- r200ReleaseDmaRegion( rmesa, &rmesa->tcl.rgba, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_COLOR1)
- r200ReleaseDmaRegion( rmesa, &rmesa->tcl.spec, __FUNCTION__ );
-
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (newinputs & VERT_BIT_TEX(unit))
- r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[unit], __FUNCTION__ );
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c
deleted file mode 100644
index adc6a2aa2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_pixel.c,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "swrast/swrast.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_pixel.h"
-#include "r200_swtcl.h"
-
-
-
-static GLboolean
-check_color( const GLcontext *ctx, GLenum type, GLenum format,
- const struct gl_pixelstore_attrib *packing,
- const void *pixels, GLint sz, GLint pitch )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint cpp = rmesa->r200Screen->cpp;
-
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if ( (pitch & 63) ||
- ctx->_ImageTransferState ||
- packing->SwapBytes ||
- packing->LsbFirst) {
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: failed 1\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- if ( type == GL_UNSIGNED_INT_8_8_8_8_REV &&
- cpp == 4 &&
- format == GL_BGRA ) {
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: passed 2\n", __FUNCTION__);
- return GL_TRUE;
- }
-
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: failed\n", __FUNCTION__);
-
- return GL_FALSE;
-}
-
-static GLboolean
-check_color_per_fragment_ops( const GLcontext *ctx )
-{
- int result;
- result = (!( ctx->Color.AlphaEnabled ||
- ctx->Depth.Test ||
- ctx->Fog.Enabled ||
- ctx->Scissor.Enabled ||
- ctx->Stencil.Enabled ||
- !ctx->Color.ColorMask[0] ||
- !ctx->Color.ColorMask[1] ||
- !ctx->Color.ColorMask[2] ||
- !ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits ||
- ctx->Depth.OcclusionTest
- ) &&
- ctx->Current.RasterPosValid);
-
- return result;
-}
-
-
-
-static GLboolean
-clip_pixelrect( const GLcontext *ctx,
- const GLframebuffer *buffer,
- GLint *x, GLint *y,
- GLsizei *width, GLsizei *height,
- GLint *size )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- /* 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;
-
- *size = ((*y + *height - 1) * rmesa->r200Screen->frontPitch +
- (*x + *width - 1) * rmesa->r200Screen->cpp);
-
- return GL_TRUE;
-}
-
-static GLboolean
-r200TryReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint pitch = pack->RowLength ? pack->RowLength : width;
- GLint blit_format;
- GLuint cpp = rmesa->r200Screen->cpp;
- GLint size = width * height * cpp;
-
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* Only accelerate reading to GART buffers.
- */
- if ( !r200IsGartMemory(rmesa, pixels,
- pitch * height * rmesa->r200Screen->cpp ) ) {
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: dest not GART\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- /* Need GL_PACK_INVERT_MESA to cope with upsidedown results from
- * blitter:
- */
- if (!pack->Invert) {
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: MESA_PACK_INVERT not set\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- if (!check_color(ctx, type, format, pack, pixels, size, pitch))
- return GL_FALSE;
-
- switch ( rmesa->r200Screen->cpp ) {
- case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
- break;
- default:
- return GL_FALSE;
- }
-
-
- /* Although the blits go on the command buffer, need to do this and
- * fire with lock held to guarentee cliprects and drawOffset are
- * correct.
- *
- * This is an unusual situation however, as the code which flushes
- * a full command buffer expects to be called unlocked. As a
- * workaround, immediately flush the buffer on aquiring the lock.
- */
- LOCK_HARDWARE( rmesa );
-
- if (rmesa->store.cmd_used)
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
-
- if (!clip_pixelrect(ctx, ctx->ReadBuffer, &x, &y, &width, &height,
- &size)) {
- UNLOCK_HARDWARE( rmesa );
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s totally clipped -- nothing to do\n",
- __FUNCTION__);
- return GL_TRUE;
- }
-
- {
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- int nbox = dPriv->numClipRects;
- int src_offset = rmesa->state.color.drawOffset
- + rmesa->r200Screen->fbLocation;
- int src_pitch = rmesa->state.color.drawPitch * rmesa->r200Screen->cpp;
- int dst_offset = r200GartOffsetFromVirtual( rmesa, pixels );
- int dst_pitch = pitch * rmesa->r200Screen->cpp;
- drm_clip_rect_t *box = dPriv->pClipRects;
- int i;
-
- r200EmitWait( rmesa, RADEON_WAIT_3D );
-
- y = dPriv->h - y - height;
- x += dPriv->x;
- y += dPriv->y;
-
-
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "readpixel blit src_pitch %d dst_pitch %d\n",
- src_pitch, dst_pitch);
-
- for (i = 0 ; i < nbox ; i++)
- {
- GLint bx = box[i].x1;
- GLint by = box[i].y1;
- GLint bw = box[i].x2 - bx;
- GLint bh = box[i].y2 - by;
-
- if (bx < x) bw -= x - bx, bx = x;
- if (by < y) bh -= y - by, by = y;
- if (bx + bw > x + width) bw = x + width - bx;
- if (by + bh > y + height) bh = y + height - by;
- if (bw <= 0) continue;
- if (bh <= 0) continue;
-
- r200EmitBlit( rmesa,
- blit_format,
- src_pitch, src_offset,
- dst_pitch, dst_offset,
- bx, by,
- bx - x, by - y,
- bw, bh );
- }
-
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
- }
- UNLOCK_HARDWARE( rmesa );
-
- r200Finish( ctx ); /* required by GL */
-
- return GL_TRUE;
-}
-
-static void
-r200ReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *pixels )
-{
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!r200TryReadPixels( ctx, x, y, width, height, format, type, pack,
- pixels))
- _swrast_ReadPixels( ctx, x, y, width, height, format, type, pack,
- pixels);
-}
-
-
-
-
-static void do_draw_pix( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint pitch,
- const void *pixels,
- GLuint planemask)
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- drm_clip_rect_t *box = dPriv->pClipRects;
- int nbox = dPriv->numClipRects;
- int i;
- int blit_format;
- int size;
- int src_offset = r200GartOffsetFromVirtual( rmesa, pixels );
- int src_pitch = pitch * rmesa->r200Screen->cpp;
-
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch ( rmesa->r200Screen->cpp ) {
- case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
- break;
- case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
- break;
- default:
- return;
- }
-
-
- LOCK_HARDWARE( rmesa );
-
- if (rmesa->store.cmd_used)
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
-
- y -= height; /* cope with pixel zoom */
-
- if (!clip_pixelrect(ctx, ctx->DrawBuffer,
- &x, &y, &width, &height,
- &size)) {
- UNLOCK_HARDWARE( rmesa );
- return;
- }
-
- y = dPriv->h - y - height; /* convert from gl to hardware coords */
- x += dPriv->x;
- y += dPriv->y;
-
-
- r200EmitWait( rmesa, RADEON_WAIT_3D );
-
- for (i = 0 ; i < nbox ; i++ )
- {
- GLint bx = box[i].x1;
- GLint by = box[i].y1;
- GLint bw = box[i].x2 - bx;
- GLint bh = box[i].y2 - by;
-
- if (bx < x) bw -= x - bx, bx = x;
- if (by < y) bh -= y - by, by = y;
- if (bx + bw > x + width) bw = x + width - bx;
- if (by + bh > y + height) bh = y + height - by;
- if (bw <= 0) continue;
- if (bh <= 0) continue;
-
- r200EmitBlit( rmesa,
- blit_format,
- src_pitch, src_offset,
- rmesa->state.color.drawPitch * rmesa->r200Screen->cpp,
- rmesa->state.color.drawOffset + rmesa->r200Screen->fbLocation,
- bx - x, by - y,
- bx, by,
- bw, bh );
- }
-
- r200FlushCmdBufLocked( rmesa, __FUNCTION__ );
- r200WaitForIdleLocked( rmesa ); /* required by GL */
- UNLOCK_HARDWARE( rmesa );
-}
-
-
-
-
-static GLboolean
-r200TryDrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint pitch = unpack->RowLength ? unpack->RowLength : width;
- GLuint planemask;
- GLuint cpp = rmesa->r200Screen->cpp;
- GLint size = width * pitch * cpp;
-
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- switch (format) {
- case GL_RGB:
- case GL_RGBA:
- case GL_BGRA:
- planemask = r200PackColor(cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP]);
-
- if (cpp == 2)
- planemask |= planemask << 16;
-
- if (planemask != ~0)
- return GL_FALSE; /* fix me -- should be possible */
-
- /* Can't do conversions on GART reads/draws.
- */
- if ( !r200IsGartMemory( rmesa, pixels, size ) ) {
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s: not GART memory\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- if (!check_color(ctx, type, format, unpack, pixels, size, pitch)) {
- return GL_FALSE;
- }
- if (!check_color_per_fragment_ops(ctx)) {
- return GL_FALSE;
- }
-
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != -1.0F)
- return GL_FALSE;
- break;
-
- default:
- return GL_FALSE;
- }
-
- if ( r200IsGartMemory(rmesa, pixels, size) )
- {
- do_draw_pix( ctx, x, y, width, height, pitch, pixels, planemask );
- return GL_TRUE;
- }
- else if (0)
- {
- /* Pixels is in regular memory -- get dma buffers and perform
- * upload through them.
- */
- }
- else
- return GL_FALSE;
-}
-
-static void
-r200DrawPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- if (R200_DEBUG & DEBUG_PIXEL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!r200TryDrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels ))
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
-}
-
-
-static void
-r200Bitmap( GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (rmesa->Fallback)
- _swrast_Bitmap( ctx, px, py, width, height, unpack, bitmap );
- else
- r200PointsBitmap( ctx, px, py, width, height, unpack, bitmap );
-}
-
-
-
-void r200InitPixelFuncs( GLcontext *ctx )
-{
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- if (!getenv("R200_NO_BLITS") && R200_CONTEXT(ctx)->dri.drmMinor >= 6) {
- ctx->Driver.ReadPixels = r200ReadPixels;
- ctx->Driver.DrawPixels = r200DrawPixels;
- if (getenv("R200_HW_BITMAP"))
- ctx->Driver.Bitmap = r200Bitmap;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.h
deleted file mode 100644
index 8f3923b6b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_pixel.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_pixel.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_PIXEL_H__
-#define __R200_PIXEL_H__
-
-extern void r200InitPixelFuncs( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_reg.h
deleted file mode 100644
index dd5f17cc3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_reg.h
+++ /dev/null
@@ -1,1454 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_reg.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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 _R200_REG_H_
-#define _R200_REG_H_
-
-#define R200_PP_MISC 0x1c14
-#define R200_REF_ALPHA_MASK 0x000000ff
-#define R200_ALPHA_TEST_FAIL (0 << 8)
-#define R200_ALPHA_TEST_LESS (1 << 8)
-#define R200_ALPHA_TEST_LEQUAL (2 << 8)
-#define R200_ALPHA_TEST_EQUAL (3 << 8)
-#define R200_ALPHA_TEST_GEQUAL (4 << 8)
-#define R200_ALPHA_TEST_GREATER (5 << 8)
-#define R200_ALPHA_TEST_NEQUAL (6 << 8)
-#define R200_ALPHA_TEST_PASS (7 << 8)
-#define R200_ALPHA_TEST_OP_MASK (7 << 8)
-#define R200_CHROMA_FUNC_FAIL (0 << 16)
-#define R200_CHROMA_FUNC_PASS (1 << 16)
-#define R200_CHROMA_FUNC_NEQUAL (2 << 16)
-#define R200_CHROMA_FUNC_EQUAL (3 << 16)
-#define R200_CHROMA_KEY_NEAREST (0 << 18)
-#define R200_CHROMA_KEY_ZERO (1 << 18)
-#define R200_RIGHT_HAND_CUBE_D3D (0 << 24)
-#define R200_RIGHT_HAND_CUBE_OGL (1 << 24)
-#define R200_PP_FOG_COLOR 0x1c18
-#define R200_FOG_COLOR_MASK 0x00ffffff
-#define R200_FOG_VERTEX (0 << 24)
-#define R200_FOG_TABLE (1 << 24)
-#define R200_FOG_USE_DEPTH (0 << 25)
-#define R200_FOG_USE_W (1 << 25)
-#define R200_FOG_USE_DIFFUSE_ALPHA (2 << 25)
-#define R200_FOG_USE_SPEC_ALPHA (3 << 25)
-#define R200_FOG_USE_VTX_FOG (4 << 25)
-#define R200_FOG_USE_MASK (7 << 25)
-#define R200_RE_SOLID_COLOR 0x1c1c
-#define R200_RB3D_BLENDCNTL 0x1c20
-#define R200_COMB_FCN_MASK (7 << 12)
-#define R200_COMB_FCN_ADD_CLAMP (0 << 12)
-#define R200_COMB_FCN_ADD_NOCLAMP (1 << 12)
-#define R200_COMB_FCN_SUB_CLAMP (2 << 12)
-#define R200_COMB_FCN_SUB_NOCLAMP (3 << 12)
-#define R200_COMB_FCN_MIN (4 << 12)
-#define R200_COMB_FCN_MAX (5 << 12)
-#define R200_COMB_FCN_RSUB_CLAMP (6 << 12)
-#define R200_COMB_FCN_RSUB_NOCLAMP (7 << 12)
-#define R200_BLEND_GL_ZERO (32)
-#define R200_BLEND_GL_ONE (33)
-#define R200_BLEND_GL_SRC_COLOR (34)
-#define R200_BLEND_GL_ONE_MINUS_SRC_COLOR (35)
-#define R200_BLEND_GL_DST_COLOR (36)
-#define R200_BLEND_GL_ONE_MINUS_DST_COLOR (37)
-#define R200_BLEND_GL_SRC_ALPHA (38)
-#define R200_BLEND_GL_ONE_MINUS_SRC_ALPHA (39)
-#define R200_BLEND_GL_DST_ALPHA (40)
-#define R200_BLEND_GL_ONE_MINUS_DST_ALPHA (41)
-#define R200_BLEND_GL_SRC_ALPHA_SATURATE (42) /* src factor only */
-#define R200_BLEND_GL_CONST_COLOR (43)
-#define R200_BLEND_GL_ONE_MINUS_CONST_COLOR (44)
-#define R200_BLEND_GL_CONST_ALPHA (45)
-#define R200_BLEND_GL_ONE_MINUS_CONST_ALPHA (46)
-#define R200_BLEND_MASK (63)
-#define R200_SRC_BLEND_SHIFT (16)
-#define R200_DST_BLEND_SHIFT (24)
-#define R200_RB3D_DEPTHOFFSET 0x1c24
-#define R200_RB3D_DEPTHPITCH 0x1c28
-#define R200_DEPTHPITCH_MASK 0x00001ff8
-#define R200_DEPTH_HYPERZ (3 << 16)
-#define R200_DEPTH_ENDIAN_NO_SWAP (0 << 18)
-#define R200_DEPTH_ENDIAN_WORD_SWAP (1 << 18)
-#define R200_DEPTH_ENDIAN_DWORD_SWAP (2 << 18)
-#define R200_RB3D_ZSTENCILCNTL 0x1c2c
-#define R200_DEPTH_FORMAT_MASK (0xf << 0)
-#define R200_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
-#define R200_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
-#define R200_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0)
-#define R200_DEPTH_FORMAT_32BIT_INT_Z (4 << 0)
-#define R200_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0)
-#define R200_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0)
-#define R200_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0)
-#define R200_Z_TEST_NEVER (0 << 4)
-#define R200_Z_TEST_LESS (1 << 4)
-#define R200_Z_TEST_LEQUAL (2 << 4)
-#define R200_Z_TEST_EQUAL (3 << 4)
-#define R200_Z_TEST_GEQUAL (4 << 4)
-#define R200_Z_TEST_GREATER (5 << 4)
-#define R200_Z_TEST_NEQUAL (6 << 4)
-#define R200_Z_TEST_ALWAYS (7 << 4)
-#define R200_Z_TEST_MASK (7 << 4)
-#define R200_Z_HIERARCHY_ENABLE (1 << 8)
-#define R200_STENCIL_TEST_NEVER (0 << 12)
-#define R200_STENCIL_TEST_LESS (1 << 12)
-#define R200_STENCIL_TEST_LEQUAL (2 << 12)
-#define R200_STENCIL_TEST_EQUAL (3 << 12)
-#define R200_STENCIL_TEST_GEQUAL (4 << 12)
-#define R200_STENCIL_TEST_GREATER (5 << 12)
-#define R200_STENCIL_TEST_NEQUAL (6 << 12)
-#define R200_STENCIL_TEST_ALWAYS (7 << 12)
-#define R200_STENCIL_TEST_MASK (0x7 << 12)
-#define R200_STENCIL_FAIL_KEEP (0 << 16)
-#define R200_STENCIL_FAIL_ZERO (1 << 16)
-#define R200_STENCIL_FAIL_REPLACE (2 << 16)
-#define R200_STENCIL_FAIL_INC (3 << 16)
-#define R200_STENCIL_FAIL_DEC (4 << 16)
-#define R200_STENCIL_FAIL_INVERT (5 << 16)
-#define R200_STENCIL_FAIL_INC_WRAP (6 << 16)
-#define R200_STENCIL_FAIL_DEC_WRAP (7 << 16)
-#define R200_STENCIL_FAIL_MASK (0x7 << 16)
-#define R200_STENCIL_ZPASS_KEEP (0 << 20)
-#define R200_STENCIL_ZPASS_ZERO (1 << 20)
-#define R200_STENCIL_ZPASS_REPLACE (2 << 20)
-#define R200_STENCIL_ZPASS_INC (3 << 20)
-#define R200_STENCIL_ZPASS_DEC (4 << 20)
-#define R200_STENCIL_ZPASS_INVERT (5 << 20)
-#define R200_STENCIL_ZPASS_INC_WRAP (6 << 20)
-#define R200_STENCIL_ZPASS_DEC_WRAP (7 << 20)
-#define R200_STENCIL_ZPASS_MASK (0x7 << 20)
-#define R200_STENCIL_ZFAIL_KEEP (0 << 24)
-#define R200_STENCIL_ZFAIL_ZERO (1 << 24)
-#define R200_STENCIL_ZFAIL_REPLACE (2 << 24)
-#define R200_STENCIL_ZFAIL_INC (3 << 24)
-#define R200_STENCIL_ZFAIL_DEC (4 << 24)
-#define R200_STENCIL_ZFAIL_INVERT (5 << 24)
-#define R200_STENCIL_ZFAIL_INC_WRAP (6 << 24)
-#define R200_STENCIL_ZFAIL_DEC_WRAP (7 << 24)
-#define R200_STENCIL_ZFAIL_MASK (0x7 << 24)
-#define R200_Z_COMPRESSION_ENABLE (1 << 28)
-#define R200_FORCE_Z_DIRTY (1 << 29)
-#define R200_Z_WRITE_ENABLE (1 << 30)
-#define R200_Z_DECOMPRESSION_ENABLE (1 << 31)
-/*gap*/
-#define R200_PP_CNTL 0x1c38
-#define R200_TEX_0_ENABLE 0x00000010
-#define R200_TEX_1_ENABLE 0x00000020
-#define R200_TEX_2_ENABLE 0x00000040
-#define R200_TEX_3_ENABLE 0x00000080
-#define R200_TEX_4_ENABLE 0x00000100
-#define R200_TEX_5_ENABLE 0x00000200
-#define R200_TEX_ENABLE_MASK 0x000003f0
-#define R200_FILTER_ROUND_MODE_MASK 0x00000400
-#define R200_TEX_BLEND_7_ENABLE 0x00000800
-#define R200_TEX_BLEND_0_ENABLE 0x00001000
-#define R200_TEX_BLEND_1_ENABLE 0x00002000
-#define R200_TEX_BLEND_2_ENABLE 0x00004000
-#define R200_TEX_BLEND_3_ENABLE 0x00008000
-#define R200_TEX_BLEND_4_ENABLE 0x00010000
-#define R200_TEX_BLEND_5_ENABLE 0x00020000
-#define R200_TEX_BLEND_6_ENABLE 0x00040000
-#define R200_MULTI_PASS_ENABLE 0x00080000
-#define R200_SPECULAR_ENABLE 0x00200000
-#define R200_FOG_ENABLE 0x00400000
-#define R200_ALPHA_TEST_ENABLE 0x00800000
-#define R200_ANTI_ALIAS_NONE 0x00000000
-#define R200_ANTI_ALIAS_LINE 0x01000000
-#define R200_ANTI_ALIAS_POLY 0x02000000
-#define R200_ANTI_ALIAS_MASK 0x03000000
-#define R200_RB3D_CNTL 0x1c3c
-#define R200_ALPHA_BLEND_ENABLE (1 << 0)
-#define R200_PLANE_MASK_ENABLE (1 << 1)
-#define R200_DITHER_ENABLE (1 << 2)
-#define R200_ROUND_ENABLE (1 << 3)
-#define R200_SCALE_DITHER_ENABLE (1 << 4)
-#define R200_DITHER_INIT (1 << 5)
-#define R200_ROP_ENABLE (1 << 6)
-#define R200_STENCIL_ENABLE (1 << 7)
-#define R200_Z_ENABLE (1 << 8)
-#define R200_DEPTH_XZ_OFFEST_ENABLE (1 << 9)
-#define R200_COLOR_FORMAT_ARGB1555 (3 << 10)
-#define R200_COLOR_FORMAT_RGB565 (4 << 10)
-#define R200_COLOR_FORMAT_ARGB8888 (6 << 10)
-#define R200_COLOR_FORMAT_RGB332 (7 << 10)
-#define R200_COLOR_FORMAT_Y8 (8 << 10)
-#define R200_COLOR_FORMAT_RGB8 (9 << 10)
-#define R200_COLOR_FORMAT_YUV422_VYUY (11 << 10)
-#define R200_COLOR_FORMAT_YUV422_YVYU (12 << 10)
-#define R200_COLOR_FORMAT_aYUV444 (14 << 10)
-#define R200_COLOR_FORMAT_ARGB4444 (15 << 10)
-#define R200_CLRCMP_FLIP_ENABLE (1 << 14)
-#define R200_SEPARATE_ALPHA_ENABLE (1 << 16)
-#define R200_RB3D_COLOROFFSET 0x1c40
-#define R200_COLOROFFSET_MASK 0xfffffff0
-#define R200_RE_WIDTH_HEIGHT 0x1c44
-#define R200_RE_WIDTH_SHIFT 0
-#define R200_RE_HEIGHT_SHIFT 16
-#define R200_RB3D_COLORPITCH 0x1c48
-#define R200_COLORPITCH_MASK 0x000001ff8
-#define R200_COLOR_TILE_ENABLE (1 << 16)
-#define R200_COLOR_MICROTILE_ENABLE (1 << 17)
-#define R200_COLOR_ENDIAN_NO_SWAP (0 << 18)
-#define R200_COLOR_ENDIAN_WORD_SWAP (1 << 18)
-#define R200_COLOR_ENDIAN_DWORD_SWAP (2 << 18)
-#define R200_SE_CNTL 0x1c4c
-#define R200_FFACE_CULL_CW (0 << 0)
-#define R200_FFACE_CULL_CCW (1 << 0)
-#define R200_FFACE_CULL_DIR_MASK (1 << 0)
-#define R200_BFACE_CULL (0 << 1)
-#define R200_BFACE_SOLID (3 << 1)
-#define R200_FFACE_CULL (0 << 3)
-#define R200_FFACE_SOLID (3 << 3)
-#define R200_FFACE_CULL_MASK (3 << 3)
-#define R200_FLAT_SHADE_VTX_0 (0 << 6)
-#define R200_FLAT_SHADE_VTX_1 (1 << 6)
-#define R200_FLAT_SHADE_VTX_2 (2 << 6)
-#define R200_FLAT_SHADE_VTX_LAST (3 << 6)
-#define R200_DIFFUSE_SHADE_SOLID (0 << 8)
-#define R200_DIFFUSE_SHADE_FLAT (1 << 8)
-#define R200_DIFFUSE_SHADE_GOURAUD (2 << 8)
-#define R200_DIFFUSE_SHADE_MASK (3 << 8)
-#define R200_ALPHA_SHADE_SOLID (0 << 10)
-#define R200_ALPHA_SHADE_FLAT (1 << 10)
-#define R200_ALPHA_SHADE_GOURAUD (2 << 10)
-#define R200_ALPHA_SHADE_MASK (3 << 10)
-#define R200_SPECULAR_SHADE_SOLID (0 << 12)
-#define R200_SPECULAR_SHADE_FLAT (1 << 12)
-#define R200_SPECULAR_SHADE_GOURAUD (2 << 12)
-#define R200_SPECULAR_SHADE_MASK (3 << 12)
-#define R200_FOG_SHADE_SOLID (0 << 14)
-#define R200_FOG_SHADE_FLAT (1 << 14)
-#define R200_FOG_SHADE_GOURAUD (2 << 14)
-#define R200_FOG_SHADE_MASK (3 << 14)
-#define R200_ZBIAS_ENABLE_POINT (1 << 16)
-#define R200_ZBIAS_ENABLE_LINE (1 << 17)
-#define R200_ZBIAS_ENABLE_TRI (1 << 18)
-#define R200_WIDELINE_ENABLE (1 << 20)
-#define R200_VTX_PIX_CENTER_D3D (0 << 27)
-#define R200_VTX_PIX_CENTER_OGL (1 << 27)
-#define R200_ROUND_MODE_TRUNC (0 << 28)
-#define R200_ROUND_MODE_ROUND (1 << 28)
-#define R200_ROUND_MODE_ROUND_EVEN (2 << 28)
-#define R200_ROUND_MODE_ROUND_ODD (3 << 28)
-#define R200_ROUND_PREC_16TH_PIX (0 << 30)
-#define R200_ROUND_PREC_8TH_PIX (1 << 30)
-#define R200_ROUND_PREC_4TH_PIX (2 << 30)
-#define R200_ROUND_PREC_HALF_PIX (3 << 30)
-#define R200_RE_CNTL 0x1c50
-#define R200_STIPPLE_ENABLE 0x1
-#define R200_SCISSOR_ENABLE 0x2
-#define R200_PATTERN_ENABLE 0x4
-#define R200_PERSPECTIVE_ENABLE 0x8
-#define R200_POINT_SMOOTH 0x20
-#define R200_VTX_STQ0_D3D 0x00010000
-#define R200_VTX_STQ1_D3D 0x00040000
-#define R200_VTX_STQ2_D3D 0x00100000
-#define R200_VTX_STQ3_D3D 0x00400000
-#define R200_VTX_STQ4_D3D 0x01000000
-#define R200_VTX_STQ5_D3D 0x04000000
-/* gap */
-#define R200_RE_STIPPLE_ADDR 0x1cc8
-#define R200_RE_STIPPLE_DATA 0x1ccc
-#define R200_RE_LINE_PATTERN 0x1cd0
-#define R200_LINE_PATTERN_MASK 0x0000ffff
-#define R200_LINE_REPEAT_COUNT_SHIFT 16
-#define R200_LINE_PATTERN_START_SHIFT 24
-#define R200_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28)
-#define R200_LINE_PATTERN_BIG_BIT_ORDER (1 << 28)
-#define R200_LINE_PATTERN_AUTO_RESET (1 << 29)
-#define R200_RE_LINE_STATE 0x1cd4
-#define R200_LINE_CURRENT_PTR_SHIFT 0
-#define R200_LINE_CURRENT_COUNT_SHIFT 8
-#define R200_RE_SCISSOR_TL_0 0x1cd8
-#define R200_RE_SCISSOR_BR_0 0x1cdc
-#define R200_RE_SCISSOR_TL_1 0x1ce0
-#define R200_RE_SCISSOR_BR_1 0x1ce4
-#define R200_RE_SCISSOR_TL_2 0x1ce8
-#define R200_RE_SCISSOR_BR_2 0x1cec
-/* gap */
-#define R200_RB3D_DEPTHXY_OFFSET 0x1d60
-#define R200_DEPTHX_SHIFT 0
-#define R200_DEPTHY_SHIFT 16
-/* gap */
-#define R200_RB3D_STENCILREFMASK 0x1d7c
-#define R200_STENCIL_REF_SHIFT 0
-#define R200_STENCIL_REF_MASK (0xff << 0)
-#define R200_STENCIL_MASK_SHIFT 16
-#define R200_STENCIL_VALUE_MASK (0xff << 16)
-#define R200_STENCIL_WRITEMASK_SHIFT 24
-#define R200_STENCIL_WRITE_MASK (0xff << 24)
-#define R200_RB3D_ROPCNTL 0x1d80
-#define R200_ROP_MASK (15 << 8)
-#define R200_ROP_CLEAR (0 << 8)
-#define R200_ROP_NOR (1 << 8)
-#define R200_ROP_AND_INVERTED (2 << 8)
-#define R200_ROP_COPY_INVERTED (3 << 8)
-#define R200_ROP_AND_REVERSE (4 << 8)
-#define R200_ROP_INVERT (5 << 8)
-#define R200_ROP_XOR (6 << 8)
-#define R200_ROP_NAND (7 << 8)
-#define R200_ROP_AND (8 << 8)
-#define R200_ROP_EQUIV (9 << 8)
-#define R200_ROP_NOOP (10 << 8)
-#define R200_ROP_OR_INVERTED (11 << 8)
-#define R200_ROP_COPY (12 << 8)
-#define R200_ROP_OR_REVERSE (13 << 8)
-#define R200_ROP_OR (14 << 8)
-#define R200_ROP_SET (15 << 8)
-#define R200_RB3D_PLANEMASK 0x1d84
-/* gap */
-#define R200_SE_VPORT_XSCALE 0x1d98
-#define R200_SE_VPORT_XOFFSET 0x1d9c
-#define R200_SE_VPORT_YSCALE 0x1da0
-#define R200_SE_VPORT_YOFFSET 0x1da4
-#define R200_SE_VPORT_ZSCALE 0x1da8
-#define R200_SE_VPORT_ZOFFSET 0x1dac
-#define R200_SE_ZBIAS_FACTOR 0x1db0
-#define R200_SE_ZBIAS_CONSTANT 0x1db4
-#define R200_SE_LINE_WIDTH 0x1db8
-#define R200_LINE_WIDTH_SHIFT 0x00000000
-#define R200_MINPOINTSIZE_SHIFT 0x00000010
-/* gap */
-#define R200_SE_VAP_CNTL 0x2080
-#define R200_VAP_TCL_ENABLE 0x00000001
-#define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010
-#define R200_VAP_FORCE_W_TO_ONE 0x00010000
-#define R200_VAP_D3D_TEX_DEFAULT 0x00020000
-#define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18
-#define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000
-#define R200_SE_VF_CNTL 0x2084
-#define R200_VF_PRIM_NONE 0x00000000
-#define R200_VF_PRIM_POINTS 0x00000001
-#define R200_VF_PRIM_LINES 0x00000002
-#define R200_VF_PRIM_LINE_STRIP 0x00000003
-#define R200_VF_PRIM_TRIANGLES 0x00000004
-#define R200_VF_PRIM_TRIANGLE_FAN 0x00000005
-#define R200_VF_PRIM_TRIANGLE_STRIP 0x00000006
-#define R200_VF_PRIM_RECT_LIST 0x00000008
-#define R200_VF_PRIM_3VRT_POINTS 0x00000009
-#define R200_VF_PRIM_3VRT_LINES 0x0000000a
-#define R200_VF_PRIM_POINT_SPRITES 0x0000000b
-#define R200_VF_PRIM_LINE_LOOP 0x0000000c
-#define R200_VF_PRIM_QUADS 0x0000000d
-#define R200_VF_PRIM_QUAD_STRIP 0x0000000e
-#define R200_VF_PRIM_POLYGON 0x0000000f
-#define R200_VF_PRIM_MASK 0x0000000f
-#define R200_VF_PRIM_WALK_IND 0x00000010
-#define R200_VF_PRIM_WALK_LIST 0x00000020
-#define R200_VF_PRIM_WALK_RING 0x00000030
-#define R200_VF_PRIM_WALK_MASK 0x00000030
-#define R200_VF_COLOR_ORDER_RGBA 0x00000040
-#define R200_VF_TCL_OUTPUT_VTX_ENABLE 0x00000200
-#define R200_VF_INDEX_SZ_4 0x00000800
-#define R200_VF_VERTEX_NUMBER_MASK 0xffff0000
-#define R200_VF_VERTEX_NUMBER_SHIFT 16
-#define R200_SE_VTX_FMT_0 0x2088
-#define R200_VTX_XY 0 /* always have xy */
-#define R200_VTX_Z0 (1<<0)
-#define R200_VTX_W0 (1<<1)
-#define R200_VTX_WEIGHT_COUNT_SHIFT (2)
-#define R200_VTX_PV_MATRIX_SEL (1<<5)
-#define R200_VTX_N0 (1<<6)
-#define R200_VTX_POINT_SIZE (1<<7)
-#define R200_VTX_DISCRETE_FOG (1<<8)
-#define R200_VTX_SHININESS_0 (1<<9)
-#define R200_VTX_SHININESS_1 (1<<10)
-#define R200_VTX_COLOR_NOT_PRESENT 0
-#define R200_VTX_PK_RGBA 1
-#define R200_VTX_FP_RGB 2
-#define R200_VTX_FP_RGBA 3
-#define R200_VTX_COLOR_MASK 3
-#define R200_VTX_COLOR_0_SHIFT 11
-#define R200_VTX_COLOR_1_SHIFT 13
-#define R200_VTX_COLOR_2_SHIFT 15
-#define R200_VTX_COLOR_3_SHIFT 17
-#define R200_VTX_COLOR_4_SHIFT 19
-#define R200_VTX_COLOR_5_SHIFT 21
-#define R200_VTX_COLOR_6_SHIFT 23
-#define R200_VTX_COLOR_7_SHIFT 25
-#define R200_VTX_XY1 (1<<28)
-#define R200_VTX_Z1 (1<<29)
-#define R200_VTX_W1 (1<<30)
-#define R200_VTX_N1 (1<<31)
-#define R200_SE_VTX_FMT_1 0x208c
-#define R200_VTX_TEX0_COMP_CNT_SHIFT 0
-#define R200_VTX_TEX1_COMP_CNT_SHIFT 3
-#define R200_VTX_TEX2_COMP_CNT_SHIFT 6
-#define R200_VTX_TEX3_COMP_CNT_SHIFT 9
-#define R200_VTX_TEX4_COMP_CNT_SHIFT 12
-#define R200_VTX_TEX5_COMP_CNT_SHIFT 15
-#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090
-#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094
-/* gap */
-#define R200_SE_VTE_CNTL 0x20b0
-#define R200_VPORT_X_SCALE_ENA 0x00000001
-#define R200_VPORT_X_OFFSET_ENA 0x00000002
-#define R200_VPORT_Y_SCALE_ENA 0x00000004
-#define R200_VPORT_Y_OFFSET_ENA 0x00000008
-#define R200_VPORT_Z_SCALE_ENA 0x00000010
-#define R200_VPORT_Z_OFFSET_ENA 0x00000020
-#define R200_VTX_XY_FMT 0x00000100
-#define R200_VTX_Z_FMT 0x00000200
-#define R200_VTX_W0_FMT 0x00000400
-#define R200_VTX_W0_NORMALIZE 0x00000800
-#define R200_VTX_ST_DENORMALIZED 0x00001000
-/* gap */
-#define R200_SE_VTX_NUM_ARRAYS 0x20c0
-#define R200_SE_VTX_AOS_ATTR01 0x20c4
-#define R200_SE_VTX_AOS_ADDR0 0x20c8
-#define R200_SE_VTX_AOS_ADDR1 0x20cc
-#define R200_SE_VTX_AOS_ATTR23 0x20d0
-#define R200_SE_VTX_AOS_ADDR2 0x20d4
-#define R200_SE_VTX_AOS_ADDR3 0x20d8
-#define R200_SE_VTX_AOS_ATTR45 0x20dc
-#define R200_SE_VTX_AOS_ADDR4 0x20e0
-#define R200_SE_VTX_AOS_ADDR5 0x20e4
-#define R200_SE_VTX_AOS_ATTR67 0x20e8
-#define R200_SE_VTX_AOS_ADDR6 0x20ec
-#define R200_SE_VTX_AOS_ADDR7 0x20f0
-#define R200_SE_VTX_AOS_ATTR89 0x20f4
-#define R200_SE_VTX_AOS_ADDR8 0x20f8
-#define R200_SE_VTX_AOS_ADDR9 0x20fc
-#define R200_SE_VTX_AOS_ATTR1011 0x2100
-#define R200_SE_VTX_AOS_ADDR10 0x2104
-#define R200_SE_VTX_AOS_ADDR11 0x2108
-#define R200_SE_VF_MAX_VTX_INDX 0x210c
-#define R200_SE_VF_MIN_VTX_INDX 0x2110
-/* gap */
-#define R200_SE_VAP_CNTL_STATUS 0x2140
-#define R200_VC_NO_SWAP (0 << 0)
-#define R200_VC_16BIT_SWAP (1 << 0)
-#define R200_VC_32BIT_SWAP (2 << 0)
-/* gap */
-#define R200_SE_VTX_STATE_CNTL 0x2180
-#define R200_VSC_COLOR_0_ASSEMBLY_CNTL_SHIFT 0x00000000
-#define R200_VSC_COLOR_1_ASSEMBLY_CNTL_SHIFT 0x00000002
-#define R200_VSC_COLOR_2_ASSEMBLY_CNTL_SHIFT 0x00000004
-#define R200_VSC_COLOR_3_ASSEMBLY_CNTL_SHIFT 0x00000006
-#define R200_VSC_COLOR_4_ASSEMBLY_CNTL_SHIFT 0x00000008
-#define R200_VSC_COLOR_5_ASSEMBLY_CNTL_SHIFT 0x0000000a
-#define R200_VSC_COLOR_6_ASSEMBLY_CNTL_SHIFT 0x0000000c
-#define R200_VSC_COLOR_7_ASSEMBLY_CNTL_SHIFT 0x0000000e
-#define R200_VSC_UPDATE_USER_COLOR_0_ENABLE 0x00010000
-#define R200_VSC_UPDATE_USER_COLOR_1_ENABLE 0x00020000
-/* gap */
-#define R200_SE_TCL_VECTOR_INDX_REG 0x2200
-#define R200_SE_TCL_VECTOR_DATA_REG 0x2204
-#define R200_SE_TCL_SCALAR_INDX_REG 0x2208
-#define R200_SE_TCL_SCALAR_DATA_REG 0x220c
-/* gap */
-#define R200_SE_TCL_MATRIX_SEL_0 0x2230
-#define R200_MODELVIEW_0_SHIFT (0)
-#define R200_MODELVIEW_1_SHIFT (8)
-#define R200_MODELVIEW_2_SHIFT (16)
-#define R200_MODELVIEW_3_SHIFT (24)
-#define R200_SE_TCL_MATRIX_SEL_1 0x2234
-#define R200_IT_MODELVIEW_0_SHIFT (0)
-#define R200_IT_MODELVIEW_1_SHIFT (8)
-#define R200_IT_MODELVIEW_2_SHIFT (16)
-#define R200_IT_MODELVIEW_3_SHIFT (24)
-#define R200_SE_TCL_MATRIX_SEL_2 0x2238
-#define R200_MODELPROJECT_0_SHIFT (0)
-#define R200_MODELPROJECT_1_SHIFT (8)
-#define R200_MODELPROJECT_2_SHIFT (16)
-#define R200_MODELPROJECT_3_SHIFT (24)
-#define R200_SE_TCL_MATRIX_SEL_3 0x223c
-#define R200_TEXMAT_0_SHIFT 0
-#define R200_TEXMAT_1_SHIFT 8
-#define R200_TEXMAT_2_SHIFT 16
-#define R200_TEXMAT_3_SHIFT 24
-#define R200_SE_TCL_MATRIX_SEL_4 0x2240
-#define R200_TEXMAT_4_SHIFT 0
-#define R200_TEXMAT_5_SHIFT 8
-/* gap */
-#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250
-#define R200_OUTPUT_XYZW (1<<0)
-#define R200_OUTPUT_COLOR_0 (1<<8)
-#define R200_OUTPUT_COLOR_1 (1<<9)
-#define R200_OUTPUT_TEX_0 (1<<16)
-#define R200_OUTPUT_TEX_1 (1<<17)
-#define R200_OUTPUT_TEX_2 (1<<18)
-#define R200_OUTPUT_TEX_3 (1<<19)
-#define R200_OUTPUT_TEX_4 (1<<20)
-#define R200_OUTPUT_TEX_5 (1<<21)
-#define R200_OUTPUT_TEX_MASK (0x3f<<16)
-#define R200_OUTPUT_DISCRETE_FOG (1<<24)
-#define R200_OUTPUT_PT_SIZE (1<<25)
-#define R200_FORCE_INORDER_PROC (1<<31)
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0 0x2254
-#define R200_VERTEX_POSITION_ADDR__SHIFT 0x00000000
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1 0x2258
-#define R200_VTX_COLOR_0_ADDR__SHIFT 0x00000000
-#define R200_VTX_COLOR_1_ADDR__SHIFT 0x00000008
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2 0x225c
-#define R200_VTX_TEX_0_ADDR__SHIFT 0x00000000
-#define R200_VTX_TEX_1_ADDR__SHIFT 0x00000008
-#define R200_VTX_TEX_2_ADDR__SHIFT 0x00000010
-#define R200_VTX_TEX_3_ADDR__SHIFT 0x00000018
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3 0x2260
-#define R200_VTX_TEX_4_ADDR__SHIFT 0x00000000
-#define R200_VTX_TEX_5_ADDR__SHIFT 0x00000008
-
-/* gap */
-#define R200_SE_TCL_LIGHT_MODEL_CTL_0 0x2268
-#define R200_LIGHTING_ENABLE (1<<0)
-#define R200_LIGHT_IN_MODELSPACE (1<<1)
-#define R200_LOCAL_VIEWER (1<<2)
-#define R200_NORMALIZE_NORMALS (1<<3)
-#define R200_RESCALE_NORMALS (1<<4)
-#define R200_SPECULAR_LIGHTS (1<<5)
-#define R200_DIFFUSE_SPECULAR_COMBINE (1<<6)
-#define R200_LIGHT_ALPHA (1<<7)
-#define R200_LOCAL_LIGHT_VEC_GL (1<<8)
-#define R200_LIGHT_NO_NORMAL_AMBIENT_ONLY (1<<9)
-#define R200_LIGHT_TWOSIDE (1<<10)
-#define R200_FRONT_SHININESS_SOURCE_SHIFT (0xb)
-#define R200_BACK_SHININESS_SOURCE_SHIFT (0xd)
-#define R200_LM0_SOURCE_MATERIAL_0 (0)
-#define R200_LM0_SOURCE_MATERIAL_1 (1)
-#define R200_LM0_SOURCE_VERTEX_SHININESS_0 (2)
-#define R200_LM0_SOURCE_VERTEX_SHININESS_1 (3)
-#define R200_SE_TCL_LIGHT_MODEL_CTL_1 0x226c
-#define R200_LM1_SOURCE_LIGHT_PREMULT (0)
-#define R200_LM1_SOURCE_MATERIAL_0 (1)
-#define R200_LM1_SOURCE_VERTEX_COLOR_0 (2)
-#define R200_LM1_SOURCE_VERTEX_COLOR_1 (3)
-#define R200_LM1_SOURCE_VERTEX_COLOR_2 (4)
-#define R200_LM1_SOURCE_VERTEX_COLOR_3 (5)
-#define R200_LM1_SOURCE_VERTEX_COLOR_4 (6)
-#define R200_LM1_SOURCE_VERTEX_COLOR_5 (7)
-#define R200_LM1_SOURCE_VERTEX_COLOR_6 (8)
-#define R200_LM1_SOURCE_VERTEX_COLOR_7 (9)
-#define R200_LM1_SOURCE_MATERIAL_1 (0xf)
-#define R200_FRONT_EMISSIVE_SOURCE_SHIFT (0)
-#define R200_FRONT_AMBIENT_SOURCE_SHIFT (4)
-#define R200_FRONT_DIFFUSE_SOURCE_SHIFT (8)
-#define R200_FRONT_SPECULAR_SOURCE_SHIFT (12)
-#define R200_BACK_EMISSIVE_SOURCE_SHIFT (16)
-#define R200_BACK_AMBIENT_SOURCE_SHIFT (20)
-#define R200_BACK_DIFFUSE_SOURCE_SHIFT (24)
-#define R200_BACK_SPECULAR_SOURCE_SHIFT (28)
-#define R200_SE_TCL_PER_LIGHT_CTL_0 0x2270
-#define R200_LIGHT_0_ENABLE (1<<0)
-#define R200_LIGHT_0_ENABLE_AMBIENT (1<<1)
-#define R200_LIGHT_0_ENABLE_SPECULAR (1<<2)
-#define R200_LIGHT_0_IS_LOCAL (1<<3)
-#define R200_LIGHT_0_IS_SPOT (1<<4)
-#define R200_LIGHT_0_DUAL_CONE (1<<5)
-#define R200_LIGHT_0_ENABLE_RANGE_ATTEN (1<<6)
-#define R200_LIGHT_0_CONSTANT_RANGE_ATTEN (1<<7)
-#define R200_LIGHT_1_ENABLE (1<<16)
-#define R200_LIGHT_1_ENABLE_AMBIENT (1<<17)
-#define R200_LIGHT_1_ENABLE_SPECULAR (1<<18)
-#define R200_LIGHT_1_IS_LOCAL (1<<19)
-#define R200_LIGHT_1_IS_SPOT (1<<20)
-#define R200_LIGHT_1_DUAL_CONE (1<<21)
-#define R200_LIGHT_1_ENABLE_RANGE_ATTEN (1<<22)
-#define R200_LIGHT_1_CONSTANT_RANGE_ATTEN (1<<23)
-#define R200_LIGHT_0_SHIFT (0)
-#define R200_LIGHT_1_SHIFT (16)
-#define R200_SE_TCL_PER_LIGHT_CTL_1 0x2274
-#define R200_LIGHT_2_SHIFT (0)
-#define R200_LIGHT_3_SHIFT (16)
-#define R200_SE_TCL_PER_LIGHT_CTL_2 0x2278
-#define R200_LIGHT_4_SHIFT (0)
-#define R200_LIGHT_5_SHIFT (16)
-#define R200_SE_TCL_PER_LIGHT_CTL_3 0x227c
-#define R200_LIGHT_6_SHIFT (0)
-#define R200_LIGHT_7_SHIFT (16)
-/* gap */
-#define R200_SE_TCL_TEX_PROC_CTL_2 0x22a8
-#define R200_TEXGEN_COMP_MASK (0xf)
-#define R200_TEXGEN_COMP_S (0x1)
-#define R200_TEXGEN_COMP_T (0x2)
-#define R200_TEXGEN_COMP_R (0x4)
-#define R200_TEXGEN_COMP_Q (0x8)
-#define R200_TEXGEN_0_COMP_MASK_SHIFT (0)
-#define R200_TEXGEN_1_COMP_MASK_SHIFT (4)
-#define R200_TEXGEN_2_COMP_MASK_SHIFT (8)
-#define R200_TEXGEN_3_COMP_MASK_SHIFT (12)
-#define R200_TEXGEN_4_COMP_MASK_SHIFT (16)
-#define R200_TEXGEN_5_COMP_MASK_SHIFT (20)
-#define R200_SE_TCL_TEX_PROC_CTL_3 0x22ac
-#define R200_TEXGEN_0_INPUT_TEX_SHIFT (0)
-#define R200_TEXGEN_1_INPUT_TEX_SHIFT (4)
-#define R200_TEXGEN_2_INPUT_TEX_SHIFT (8)
-#define R200_TEXGEN_3_INPUT_TEX_SHIFT (12)
-#define R200_TEXGEN_4_INPUT_TEX_SHIFT (16)
-#define R200_TEXGEN_5_INPUT_TEX_SHIFT (20)
-#define R200_SE_TCL_TEX_PROC_CTL_0 0x22b0
-#define R200_TEXGEN_TEXMAT_0_ENABLE (1<<0)
-#define R200_TEXGEN_TEXMAT_1_ENABLE (1<<1)
-#define R200_TEXGEN_TEXMAT_2_ENABLE (1<<2)
-#define R200_TEXGEN_TEXMAT_3_ENABLE (1<<3)
-#define R200_TEXGEN_TEXMAT_4_ENABLE (1<<4)
-#define R200_TEXGEN_TEXMAT_5_ENABLE (1<<5)
-#define R200_TEXMAT_0_ENABLE (1<<8)
-#define R200_TEXMAT_1_ENABLE (1<<9)
-#define R200_TEXMAT_2_ENABLE (1<<10)
-#define R200_TEXMAT_3_ENABLE (1<<11)
-#define R200_TEXMAT_4_ENABLE (1<<12)
-#define R200_TEXMAT_5_ENABLE (1<<13)
-#define R200_TEXGEN_FORCE_W_TO_ONE (1<<16)
-#define R200_SE_TCL_TEX_PROC_CTL_1 0x22b4
-#define R200_TEXGEN_INPUT_MASK (0xf)
-#define R200_TEXGEN_INPUT_TEXCOORD_0 (0)
-#define R200_TEXGEN_INPUT_TEXCOORD_1 (1)
-#define R200_TEXGEN_INPUT_TEXCOORD_2 (2)
-#define R200_TEXGEN_INPUT_TEXCOORD_3 (3)
-#define R200_TEXGEN_INPUT_TEXCOORD_4 (4)
-#define R200_TEXGEN_INPUT_TEXCOORD_5 (5)
-#define R200_TEXGEN_INPUT_OBJ (8)
-#define R200_TEXGEN_INPUT_EYE (9)
-#define R200_TEXGEN_INPUT_EYE_NORMAL (0xa)
-#define R200_TEXGEN_INPUT_EYE_REFLECT (0xb)
-#define R200_TEXGEN_INPUT_SPHERE (0xd)
-#define R200_TEXGEN_0_INPUT_SHIFT (0)
-#define R200_TEXGEN_1_INPUT_SHIFT (4)
-#define R200_TEXGEN_2_INPUT_SHIFT (8)
-#define R200_TEXGEN_3_INPUT_SHIFT (12)
-#define R200_TEXGEN_4_INPUT_SHIFT (16)
-#define R200_TEXGEN_5_INPUT_SHIFT (20)
-#define R200_SE_TC_TEX_CYL_WRAP_CTL 0x22b8
-/* gap */
-#define R200_SE_TCL_UCP_VERT_BLEND_CTL 0x22c0
-#define R200_UCP_IN_CLIP_SPACE (1<<0)
-#define R200_UCP_IN_MODEL_SPACE (1<<1)
-#define R200_UCP_ENABLE_0 (1<<2)
-#define R200_UCP_ENABLE_1 (1<<3)
-#define R200_UCP_ENABLE_2 (1<<4)
-#define R200_UCP_ENABLE_3 (1<<5)
-#define R200_UCP_ENABLE_4 (1<<6)
-#define R200_UCP_ENABLE_5 (1<<7)
-#define R200_TCL_FOG_MASK (3<<8)
-#define R200_TCL_FOG_DISABLE (0<<8)
-#define R200_TCL_FOG_EXP (1<<8)
-#define R200_TCL_FOG_EXP2 (2<<8)
-#define R200_TCL_FOG_LINEAR (3<<8)
-#define R200_RNG_BASED_FOG (1<<10)
-#define R200_CLIP_DISABLE (1<<11)
-#define R200_CULL_FRONT_IS_CW (0<<28)
-#define R200_CULL_FRONT_IS_CCW (1<<28)
-#define R200_CULL_FRONT (1<<29)
-#define R200_CULL_BACK (1<<30)
-#define R200_SE_TCL_POINT_SPRITE_CNTL 0x22c4
-#define R200_POINTSIZE_SEL_STATE (1<<16)
-/* gap */
-#define R200_SE_VTX_ST_POS_0_X_4 0x2300
-#define R200_SE_VTX_ST_POS_0_Y_4 0x2304
-#define R200_SE_VTX_ST_POS_0_Z_4 0x2308
-#define R200_SE_VTX_ST_POS_0_W_4 0x230c
-#define R200_SE_VTX_ST_NORM_0_X 0x2310
-#define R200_SE_VTX_ST_NORM_0_Y 0x2314
-#define R200_SE_VTX_ST_NORM_0_Z 0x2318
-#define R200_SE_VTX_ST_PVMS 0x231c
-#define R200_SE_VTX_ST_CLR_0_R 0x2320
-#define R200_SE_VTX_ST_CLR_0_G 0x2324
-#define R200_SE_VTX_ST_CLR_0_B 0x2328
-#define R200_SE_VTX_ST_CLR_0_A 0x232c
-#define R200_SE_VTX_ST_CLR_1_R 0x2330
-#define R200_SE_VTX_ST_CLR_1_G 0x2334
-#define R200_SE_VTX_ST_CLR_1_B 0x2338
-#define R200_SE_VTX_ST_CLR_1_A 0x233c
-#define R200_SE_VTX_ST_CLR_2_R 0x2340
-#define R200_SE_VTX_ST_CLR_2_G 0x2344
-#define R200_SE_VTX_ST_CLR_2_B 0x2348
-#define R200_SE_VTX_ST_CLR_2_A 0x234c
-#define R200_SE_VTX_ST_CLR_3_R 0x2350
-#define R200_SE_VTX_ST_CLR_3_G 0x2354
-#define R200_SE_VTX_ST_CLR_3_B 0x2358
-#define R200_SE_VTX_ST_CLR_3_A 0x235c
-#define R200_SE_VTX_ST_CLR_4_R 0x2360
-#define R200_SE_VTX_ST_CLR_4_G 0x2364
-#define R200_SE_VTX_ST_CLR_4_B 0x2368
-#define R200_SE_VTX_ST_CLR_4_A 0x236c
-#define R200_SE_VTX_ST_CLR_5_R 0x2370
-#define R200_SE_VTX_ST_CLR_5_G 0x2374
-#define R200_SE_VTX_ST_CLR_5_B 0x2378
-#define R200_SE_VTX_ST_CLR_5_A 0x237c
-#define R200_SE_VTX_ST_CLR_6_R 0x2380
-#define R200_SE_VTX_ST_CLR_6_G 0x2384
-#define R200_SE_VTX_ST_CLR_6_B 0x2388
-#define R200_SE_VTX_ST_CLR_6_A 0x238c
-#define R200_SE_VTX_ST_CLR_7_R 0x2390
-#define R200_SE_VTX_ST_CLR_7_G 0x2394
-#define R200_SE_VTX_ST_CLR_7_B 0x2398
-#define R200_SE_VTX_ST_CLR_7_A 0x239c
-#define R200_SE_VTX_ST_TEX_0_S 0x23a0
-#define R200_SE_VTX_ST_TEX_0_T 0x23a4
-#define R200_SE_VTX_ST_TEX_0_R 0x23a8
-#define R200_SE_VTX_ST_TEX_0_Q 0x23ac
-#define R200_SE_VTX_ST_TEX_1_S 0x23b0
-#define R200_SE_VTX_ST_TEX_1_T 0x23b4
-#define R200_SE_VTX_ST_TEX_1_R 0x23b8
-#define R200_SE_VTX_ST_TEX_1_Q 0x23bc
-#define R200_SE_VTX_ST_TEX_2_S 0x23c0
-#define R200_SE_VTX_ST_TEX_2_T 0x23c4
-#define R200_SE_VTX_ST_TEX_2_R 0x23c8
-#define R200_SE_VTX_ST_TEX_2_Q 0x23cc
-#define R200_SE_VTX_ST_TEX_3_S 0x23d0
-#define R200_SE_VTX_ST_TEX_3_T 0x23d4
-#define R200_SE_VTX_ST_TEX_3_R 0x23d8
-#define R200_SE_VTX_ST_TEX_3_Q 0x23dc
-#define R200_SE_VTX_ST_TEX_4_S 0x23e0
-#define R200_SE_VTX_ST_TEX_4_T 0x23e4
-#define R200_SE_VTX_ST_TEX_4_R 0x23e8
-#define R200_SE_VTX_ST_TEX_4_Q 0x23ec
-#define R200_SE_VTX_ST_TEX_5_S 0x23f0
-#define R200_SE_VTX_ST_TEX_5_T 0x23f4
-#define R200_SE_VTX_ST_TEX_5_R 0x23f8
-#define R200_SE_VTX_ST_TEX_5_Q 0x23fc
-#define R200_SE_VTX_ST_PNT_SPRT_SZ 0x2400
-#define R200_SE_VTX_ST_DISC_FOG 0x2404
-#define R200_SE_VTX_ST_SHININESS_0 0x2408
-#define R200_SE_VTX_ST_SHININESS_1 0x240c
-#define R200_SE_VTX_ST_BLND_WT_0 0x2410
-#define R200_SE_VTX_ST_BLND_WT_1 0x2414
-#define R200_SE_VTX_ST_BLND_WT_2 0x2418
-#define R200_SE_VTX_ST_BLND_WT_3 0x241c
-#define R200_SE_VTX_ST_POS_1_X 0x2420
-#define R200_SE_VTX_ST_POS_1_Y 0x2424
-#define R200_SE_VTX_ST_POS_1_Z 0x2428
-#define R200_SE_VTX_ST_POS_1_W 0x242c
-#define R200_SE_VTX_ST_NORM_1_X 0x2430
-#define R200_SE_VTX_ST_NORM_1_Y 0x2434
-#define R200_SE_VTX_ST_NORM_1_Z 0x2438
-#define R200_SE_VTX_ST_USR_CLR_0_R 0x2440
-#define R200_SE_VTX_ST_USR_CLR_0_G 0x2444
-#define R200_SE_VTX_ST_USR_CLR_0_B 0x2448
-#define R200_SE_VTX_ST_USR_CLR_0_A 0x244c
-#define R200_SE_VTX_ST_USR_CLR_1_R 0x2450
-#define R200_SE_VTX_ST_USR_CLR_1_G 0x2454
-#define R200_SE_VTX_ST_USR_CLR_1_B 0x2458
-#define R200_SE_VTX_ST_USR_CLR_1_A 0x245c
-#define R200_SE_VTX_ST_CLR_0_PKD 0x2460
-#define R200_SE_VTX_ST_CLR_1_PKD 0x2464
-#define R200_SE_VTX_ST_CLR_2_PKD 0x2468
-#define R200_SE_VTX_ST_CLR_3_PKD 0x246c
-#define R200_SE_VTX_ST_CLR_4_PKD 0x2470
-#define R200_SE_VTX_ST_CLR_5_PKD 0x2474
-#define R200_SE_VTX_ST_CLR_6_PKD 0x2478
-#define R200_SE_VTX_ST_CLR_7_PKD 0x247c
-#define R200_SE_VTX_ST_POS_0_X_2 0x2480
-#define R200_SE_VTX_ST_POS_0_Y_2 0x2484
-#define R200_SE_VTX_ST_PAR_CLR_LD 0x2488
-#define R200_SE_VTX_ST_USR_CLR_PKD 0x248c
-#define R200_SE_VTX_ST_POS_0_X_3 0x2490
-#define R200_SE_VTX_ST_POS_0_Y_3 0x2494
-#define R200_SE_VTX_ST_POS_0_Z_3 0x2498
-#define R200_SE_VTX_ST_END_OF_PKT 0x249c
-/* gap */
-#define R200_RE_POINTSIZE 0x2648
-#define R200_POINTSIZE_SHIFT 0
-#define R200_MAXPOINTSIZE_SHIFT 16
-/* gap */
-#define R200_RE_TOP_LEFT 0x26c0
-#define R200_RE_LEFT_SHIFT 0
-#define R200_RE_TOP_SHIFT 16
-#define R200_RE_MISC 0x26c4
-#define R200_STIPPLE_COORD_MASK 0x1f
-#define R200_STIPPLE_X_OFFSET_SHIFT 0
-#define R200_STIPPLE_X_OFFSET_MASK (0x1f << 0)
-#define R200_STIPPLE_Y_OFFSET_SHIFT 8
-#define R200_STIPPLE_Y_OFFSET_MASK (0x1f << 8)
-#define R200_STIPPLE_LITTLE_BIT_ORDER (0 << 16)
-#define R200_STIPPLE_BIG_BIT_ORDER (1 << 16)
-/* gap */
-#define R200_RE_AUX_SCISSOR_CNTL 0x26f0
-#define R200_EXCLUSIVE_SCISSOR_0 0x01000000
-#define R200_EXCLUSIVE_SCISSOR_1 0x02000000
-#define R200_EXCLUSIVE_SCISSOR_2 0x04000000
-#define R200_SCISSOR_ENABLE_0 0x10000000
-#define R200_SCISSOR_ENABLE_1 0x20000000
-#define R200_SCISSOR_ENABLE_2 0x40000000
-/* gap */
-#define R200_PP_TXFILTER_0 0x2c00
-#define R200_MAG_FILTER_NEAREST (0 << 0)
-#define R200_MAG_FILTER_LINEAR (1 << 0)
-#define R200_MAG_FILTER_MASK (1 << 0)
-#define R200_MIN_FILTER_NEAREST (0 << 1)
-#define R200_MIN_FILTER_LINEAR (1 << 1)
-#define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1)
-#define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1)
-#define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1)
-#define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1)
-#define R200_MIN_FILTER_ANISO_NEAREST (8 << 1)
-#define R200_MIN_FILTER_ANISO_LINEAR (9 << 1)
-#define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1)
-#define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1)
-#define R200_MIN_FILTER_MASK (15 << 1)
-#define R200_MAX_ANISO_1_TO_1 (0 << 5)
-#define R200_MAX_ANISO_2_TO_1 (1 << 5)
-#define R200_MAX_ANISO_4_TO_1 (2 << 5)
-#define R200_MAX_ANISO_8_TO_1 (3 << 5)
-#define R200_MAX_ANISO_16_TO_1 (4 << 5)
-#define R200_MAX_ANISO_MASK (7 << 5)
-#define R200_MAX_MIP_LEVEL_MASK (0x0f << 16)
-#define R200_MAX_MIP_LEVEL_SHIFT 16
-#define R200_YUV_TO_RGB (1 << 20)
-#define R200_YUV_TEMPERATURE_COOL (0 << 21)
-#define R200_YUV_TEMPERATURE_HOT (1 << 21)
-#define R200_YUV_TEMPERATURE_MASK (1 << 21)
-#define R200_WRAPEN_S (1 << 22)
-#define R200_CLAMP_S_WRAP (0 << 23)
-#define R200_CLAMP_S_MIRROR (1 << 23)
-#define R200_CLAMP_S_CLAMP_LAST (2 << 23)
-#define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23)
-#define R200_CLAMP_S_CLAMP_BORDER (4 << 23)
-#define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23)
-#define R200_CLAMP_S_CLAMP_GL (6 << 23)
-#define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23)
-#define R200_CLAMP_S_MASK (7 << 23)
-#define R200_WRAPEN_T (1 << 26)
-#define R200_CLAMP_T_WRAP (0 << 27)
-#define R200_CLAMP_T_MIRROR (1 << 27)
-#define R200_CLAMP_T_CLAMP_LAST (2 << 27)
-#define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27)
-#define R200_CLAMP_T_CLAMP_BORDER (4 << 27)
-#define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27)
-#define R200_CLAMP_T_CLAMP_GL (6 << 27)
-#define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27)
-#define R200_CLAMP_T_MASK (7 << 27)
-#define R200_KILL_LT_ZERO (1 << 30)
-#define R200_BORDER_MODE_OGL (0 << 31)
-#define R200_BORDER_MODE_D3D (1 << 31)
-#define R200_PP_TXFORMAT_0 0x2c04
-#define R200_TXFORMAT_I8 (0 << 0)
-#define R200_TXFORMAT_AI88 (1 << 0)
-#define R200_TXFORMAT_RGB332 (2 << 0)
-#define R200_TXFORMAT_ARGB1555 (3 << 0)
-#define R200_TXFORMAT_RGB565 (4 << 0)
-#define R200_TXFORMAT_ARGB4444 (5 << 0)
-#define R200_TXFORMAT_ARGB8888 (6 << 0)
-#define R200_TXFORMAT_RGBA8888 (7 << 0)
-#define R200_TXFORMAT_Y8 (8 << 0)
-#define R200_TXFORMAT_AVYU4444 (9 << 0)
-#define R200_TXFORMAT_VYUY422 (10 << 0)
-#define R200_TXFORMAT_YVYU422 (11 << 0)
-#define R200_TXFORMAT_DXT1 (12 << 0)
-#define R200_TXFORMAT_DXT23 (14 << 0)
-#define R200_TXFORMAT_DXT45 (15 << 0)
-#define R200_TXFORMAT_DVDU88 (18 << 0)
-#define R200_TXFORMAT_LDVDU655 (19 << 0)
-#define R200_TXFORMAT_LDVDU8888 (20 << 0)
-#define R200_TXFORMAT_GR1616 (21 << 0)
-#define R200_TXFORMAT_ABGR8888 (22 << 0)
-#define R200_TXFORMAT_BGR111110 (23 << 0)
-#define R200_TXFORMAT_FORMAT_MASK (31 << 0)
-#define R200_TXFORMAT_FORMAT_SHIFT 0
-#define R200_TXFORMAT_APPLE_YUV (1 << 5)
-#define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6)
-#define R200_TXFORMAT_NON_POWER2 (1 << 7)
-#define R200_TXFORMAT_WIDTH_MASK (15 << 8)
-#define R200_TXFORMAT_WIDTH_SHIFT 8
-#define R200_TXFORMAT_HEIGHT_MASK (15 << 12)
-#define R200_TXFORMAT_HEIGHT_SHIFT 12
-#define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */
-#define R200_TXFORMAT_F5_WIDTH_SHIFT 16
-#define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20)
-#define R200_TXFORMAT_F5_HEIGHT_SHIFT 20
-#define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)
-#define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)
-#define R200_TXFORMAT_ST_ROUTE_SHIFT 24
-#define R200_TXFORMAT_LOOKUP_DISABLE (1 << 27)
-#define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
-#define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
-#define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
-#define R200_PP_TXFORMAT_X_0 0x2c08
-#define R200_DEPTH_LOG2_MASK (0xf << 0)
-#define R200_DEPTH_LOG2_SHIFT 0
-#define R200_VOLUME_FILTER_SHIFT 4
-#define R200_VOLUME_FILTER_MASK (1 << 4)
-#define R200_VOLUME_FILTER_NEAREST (0 << 4)
-#define R200_VOLUME_FILTER_LINEAR (1 << 4)
-#define R200_WRAPEN_Q (1 << 8)
-#define R200_CLAMP_Q_WRAP (0 << 9)
-#define R200_CLAMP_Q_MIRROR (1 << 9)
-#define R200_CLAMP_Q_CLAMP_LAST (2 << 9)
-#define R200_CLAMP_Q_MIRROR_CLAMP_LAST (3 << 9)
-#define R200_CLAMP_Q_CLAMP_BORDER (4 << 9)
-#define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (5 << 9)
-#define R200_CLAMP_Q_CLAMP_GL (6 << 9)
-#define R200_CLAMP_Q_MIRROR_CLAMP_GL (7 << 9)
-#define R200_CLAMP_Q_MASK (7 << 9)
-#define R200_MIN_MIP_LEVEL_MASK (0xff << 12)
-#define R200_MIN_MIP_LEVEL_SHIFT 12
-#define R200_TEXCOORD_NONPROJ (0 << 16)
-#define R200_TEXCOORD_CUBIC_ENV (1 << 16)
-#define R200_TEXCOORD_VOLUME (2 << 16)
-#define R200_TEXCOORD_PROJ (3 << 16)
-#define R200_TEXCOORD_DEPTH (4 << 16)
-#define R200_TEXCOORD_1D_PROJ (5 << 16)
-#define R200_TEXCOORD_1D (6 << 16)
-#define R200_TEXCOORD_ZERO (7 << 16)
-#define R200_TEXCOORD_MASK (7 << 16)
-#define R200_LOD_BIAS_MASK (0xfff80000)
-#define R200_LOD_BIAS_SHIFT 19
-#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */
-#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */
-#define R200_PP_BORDER_COLOR_0 0x2c14
-#define R200_PP_CUBIC_FACES_0 0x2c18
-#define R200_FACE_WIDTH_1_SHIFT 0
-#define R200_FACE_HEIGHT_1_SHIFT 4
-#define R200_FACE_WIDTH_1_MASK (0xf << 0)
-#define R200_FACE_HEIGHT_1_MASK (0xf << 4)
-#define R200_FACE_WIDTH_2_SHIFT 8
-#define R200_FACE_HEIGHT_2_SHIFT 12
-#define R200_FACE_WIDTH_2_MASK (0xf << 8)
-#define R200_FACE_HEIGHT_2_MASK (0xf << 12)
-#define R200_FACE_WIDTH_3_SHIFT 16
-#define R200_FACE_HEIGHT_3_SHIFT 20
-#define R200_FACE_WIDTH_3_MASK (0xf << 16)
-#define R200_FACE_HEIGHT_3_MASK (0xf << 20)
-#define R200_FACE_WIDTH_4_SHIFT 24
-#define R200_FACE_HEIGHT_4_SHIFT 28
-#define R200_FACE_WIDTH_4_MASK (0xf << 24)
-#define R200_FACE_HEIGHT_4_MASK (0xf << 28)
-#define R200_PP_TXFILTER_1 0x2c20
-#define R200_PP_TXFORMAT_1 0x2c24
-#define R200_PP_TXFORMAT_X_1 0x2c28
-#define R200_PP_TXSIZE_1 0x2c2c
-#define R200_PP_TXPITCH_1 0x2c30
-#define R200_PP_BORDER_COLOR_1 0x2c34
-#define R200_PP_CUBIC_FACES_1 0x2c38
-#define R200_PP_TXFILTER_2 0x2c40
-#define R200_PP_TXFORMAT_2 0x2c44
-#define R200_PP_TXSIZE_2 0x2c4c
-#define R200_PP_TXFORMAT_X_2 0x2c48
-#define R200_PP_TXPITCH_2 0x2c50
-#define R200_PP_BORDER_COLOR_2 0x2c54
-#define R200_PP_CUBIC_FACES_2 0x2c58
-#define R200_PP_TXFILTER_3 0x2c60
-#define R200_PP_TXFORMAT_3 0x2c64
-#define R200_PP_TXSIZE_3 0x2c6c
-#define R200_PP_TXFORMAT_X_3 0x2c68
-#define R200_PP_TXPITCH_3 0x2c70
-#define R200_PP_BORDER_COLOR_3 0x2c74
-#define R200_PP_CUBIC_FACES_3 0x2c78
-#define R200_PP_TXFILTER_4 0x2c80
-#define R200_PP_TXFORMAT_4 0x2c84
-#define R200_PP_TXSIZE_4 0x2c8c
-#define R200_PP_TXFORMAT_X_4 0x2c88
-#define R200_PP_TXPITCH_4 0x2c90
-#define R200_PP_BORDER_COLOR_4 0x2c94
-#define R200_PP_CUBIC_FACES_4 0x2c98
-#define R200_PP_TXFILTER_5 0x2ca0
-#define R200_PP_TXFORMAT_5 0x2ca4
-#define R200_PP_TXSIZE_5 0x2cac
-#define R200_PP_TXFORMAT_X_5 0x2ca8
-#define R200_PP_TXPITCH_5 0x2cb0
-#define R200_PP_BORDER_COLOR_5 0x2cb4
-#define R200_PP_CUBIC_FACES_5 0x2cb8
-/* gap */
-#define R200_PP_CNTL_X 0x2cc4
-/* gap */
-#define R200_PP_TRI_PERF 0x2cf8
-#define R200_TRI_CUTOFF_MASK (0x1f << 0)
-#define R200_PP_PERF_CNTL 0x2cfc
-#define R200_PP_TXOFFSET_0 0x2d00
-#define R200_TXO_ENDIAN_NO_SWAP (0 << 0)
-#define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0)
-#define R200_TXO_ENDIAN_WORD_SWAP (2 << 0)
-#define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
-#define R200_TXO_MACRO_TILE (1 << 2)
-#define R200_TXO_MICRO_TILE (1 << 3)
-#define R200_TXO_OFFSET_MASK 0xffffffe0
-#define R200_TXO_OFFSET_SHIFT 5
-#define R200_PP_CUBIC_OFFSET_F1_0 0x2d04
-#define R200_PP_CUBIC_OFFSET_F2_0 0x2d08
-#define R200_PP_CUBIC_OFFSET_F3_0 0x2d0c
-#define R200_PP_CUBIC_OFFSET_F4_0 0x2d10
-#define R200_PP_CUBIC_OFFSET_F5_0 0x2d14
-#define R200_PP_TXOFFSET_1 0x2d18
-#define R200_PP_CUBIC_OFFSET_F1_1 0x2d1c
-#define R200_PP_CUBIC_OFFSET_F2_1 0x2d20
-#define R200_PP_CUBIC_OFFSET_F3_1 0x2d24
-#define R200_PP_CUBIC_OFFSET_F4_1 0x2d28
-#define R200_PP_CUBIC_OFFSET_F5_1 0x2d2c
-#define R200_PP_TXOFFSET_2 0x2d30
-#define R200_PP_CUBIC_OFFSET_F1_2 0x2d34
-#define R200_PP_CUBIC_OFFSET_F2_2 0x2d38
-#define R200_PP_CUBIC_OFFSET_F3_2 0x2d3c
-#define R200_PP_CUBIC_OFFSET_F4_2 0x2d40
-#define R200_PP_CUBIC_OFFSET_F5_2 0x2d44
-#define R200_PP_TXOFFSET_3 0x2d48
-#define R200_PP_CUBIC_OFFSET_F1_3 0x2d4c
-#define R200_PP_CUBIC_OFFSET_F2_3 0x2d50
-#define R200_PP_CUBIC_OFFSET_F3_3 0x2d54
-#define R200_PP_CUBIC_OFFSET_F4_3 0x2d58
-#define R200_PP_CUBIC_OFFSET_F5_3 0x2d5c
-#define R200_PP_TXOFFSET_4 0x2d60
-#define R200_PP_CUBIC_OFFSET_F1_4 0x2d64
-#define R200_PP_CUBIC_OFFSET_F2_4 0x2d68
-#define R200_PP_CUBIC_OFFSET_F3_4 0x2d6c
-#define R200_PP_CUBIC_OFFSET_F4_4 0x2d70
-#define R200_PP_CUBIC_OFFSET_F5_4 0x2d74
-#define R200_PP_TXOFFSET_5 0x2d78
-#define R200_PP_CUBIC_OFFSET_F1_5 0x2d7c
-#define R200_PP_CUBIC_OFFSET_F2_5 0x2d80
-#define R200_PP_CUBIC_OFFSET_F3_5 0x2d84
-#define R200_PP_CUBIC_OFFSET_F4_5 0x2d88
-#define R200_PP_CUBIC_OFFSET_F5_5 0x2d8c
-/* gap */
-#define R200_PP_TAM_DEBUG3 0x2d9c
-/* gap */
-#define R200_PP_TFACTOR_0 0x2ee0
-#define R200_PP_TFACTOR_1 0x2ee4
-#define R200_PP_TFACTOR_2 0x2ee8
-#define R200_PP_TFACTOR_3 0x2eec
-#define R200_PP_TFACTOR_4 0x2ef0
-#define R200_PP_TFACTOR_5 0x2ef4
-/* gap */
-#define R200_PP_TXCBLEND_0 0x2f00
-#define R200_TXC_ARG_A_ZERO (0)
-#define R200_TXC_ARG_A_CURRENT_COLOR (2)
-#define R200_TXC_ARG_A_CURRENT_ALPHA (3)
-#define R200_TXC_ARG_A_DIFFUSE_COLOR (4)
-#define R200_TXC_ARG_A_DIFFUSE_ALPHA (5)
-#define R200_TXC_ARG_A_SPECULAR_COLOR (6)
-#define R200_TXC_ARG_A_SPECULAR_ALPHA (7)
-#define R200_TXC_ARG_A_TFACTOR_COLOR (8)
-#define R200_TXC_ARG_A_TFACTOR_ALPHA (9)
-#define R200_TXC_ARG_A_R0_COLOR (10)
-#define R200_TXC_ARG_A_R0_ALPHA (11)
-#define R200_TXC_ARG_A_R1_COLOR (12)
-#define R200_TXC_ARG_A_R1_ALPHA (13)
-#define R200_TXC_ARG_A_R2_COLOR (14)
-#define R200_TXC_ARG_A_R2_ALPHA (15)
-#define R200_TXC_ARG_A_R3_COLOR (16)
-#define R200_TXC_ARG_A_R3_ALPHA (17)
-#define R200_TXC_ARG_A_R4_COLOR (18)
-#define R200_TXC_ARG_A_R4_ALPHA (19)
-#define R200_TXC_ARG_A_R5_COLOR (20)
-#define R200_TXC_ARG_A_R5_ALPHA (21)
-#define R200_TXC_ARG_A_TFACTOR1_COLOR (26)
-#define R200_TXC_ARG_A_TFACTOR1_ALPHA (27)
-#define R200_TXC_ARG_A_MASK (31 << 0)
-#define R200_TXC_ARG_A_SHIFT 0
-#define R200_TXC_ARG_B_ZERO (0<<5)
-#define R200_TXC_ARG_B_CURRENT_COLOR (2<<5)
-#define R200_TXC_ARG_B_CURRENT_ALPHA (3<<5)
-#define R200_TXC_ARG_B_DIFFUSE_COLOR (4<<5)
-#define R200_TXC_ARG_B_DIFFUSE_ALPHA (5<<5)
-#define R200_TXC_ARG_B_SPECULAR_COLOR (6<<5)
-#define R200_TXC_ARG_B_SPECULAR_ALPHA (7<<5)
-#define R200_TXC_ARG_B_TFACTOR_COLOR (8<<5)
-#define R200_TXC_ARG_B_TFACTOR_ALPHA (9<<5)
-#define R200_TXC_ARG_B_R0_COLOR (10<<5)
-#define R200_TXC_ARG_B_R0_ALPHA (11<<5)
-#define R200_TXC_ARG_B_R1_COLOR (12<<5)
-#define R200_TXC_ARG_B_R1_ALPHA (13<<5)
-#define R200_TXC_ARG_B_R2_COLOR (14<<5)
-#define R200_TXC_ARG_B_R2_ALPHA (15<<5)
-#define R200_TXC_ARG_B_R3_COLOR (16<<5)
-#define R200_TXC_ARG_B_R3_ALPHA (17<<5)
-#define R200_TXC_ARG_B_R4_COLOR (18<<5)
-#define R200_TXC_ARG_B_R4_ALPHA (19<<5)
-#define R200_TXC_ARG_B_R5_COLOR (20<<5)
-#define R200_TXC_ARG_B_R5_ALPHA (21<<5)
-#define R200_TXC_ARG_B_TFACTOR1_COLOR (26<<5)
-#define R200_TXC_ARG_B_TFACTOR1_ALPHA (27<<5)
-#define R200_TXC_ARG_B_MASK (31 << 5)
-#define R200_TXC_ARG_B_SHIFT 5
-#define R200_TXC_ARG_C_ZERO (0<<10)
-#define R200_TXC_ARG_C_CURRENT_COLOR (2<<10)
-#define R200_TXC_ARG_C_CURRENT_ALPHA (3<<10)
-#define R200_TXC_ARG_C_DIFFUSE_COLOR (4<<10)
-#define R200_TXC_ARG_C_DIFFUSE_ALPHA (5<<10)
-#define R200_TXC_ARG_C_SPECULAR_COLOR (6<<10)
-#define R200_TXC_ARG_C_SPECULAR_ALPHA (7<<10)
-#define R200_TXC_ARG_C_TFACTOR_COLOR (8<<10)
-#define R200_TXC_ARG_C_TFACTOR_ALPHA (9<<10)
-#define R200_TXC_ARG_C_R0_COLOR (10<<10)
-#define R200_TXC_ARG_C_R0_ALPHA (11<<10)
-#define R200_TXC_ARG_C_R1_COLOR (12<<10)
-#define R200_TXC_ARG_C_R1_ALPHA (13<<10)
-#define R200_TXC_ARG_C_R2_COLOR (14<<10)
-#define R200_TXC_ARG_C_R2_ALPHA (15<<10)
-#define R200_TXC_ARG_C_R3_COLOR (16<<10)
-#define R200_TXC_ARG_C_R3_ALPHA (17<<10)
-#define R200_TXC_ARG_C_R4_COLOR (18<<10)
-#define R200_TXC_ARG_C_R4_ALPHA (19<<10)
-#define R200_TXC_ARG_C_R5_COLOR (20<<10)
-#define R200_TXC_ARG_C_R5_ALPHA (21<<10)
-#define R200_TXC_ARG_C_TFACTOR1_COLOR (26<<10)
-#define R200_TXC_ARG_C_TFACTOR1_ALPHA (27<<10)
-#define R200_TXC_ARG_C_MASK (31 << 10)
-#define R200_TXC_ARG_C_SHIFT 10
-#define R200_TXC_COMP_ARG_A (1 << 16)
-#define R200_TXC_COMP_ARG_A_SHIFT (16)
-#define R200_TXC_BIAS_ARG_A (1 << 17)
-#define R200_TXC_SCALE_ARG_A (1 << 18)
-#define R200_TXC_NEG_ARG_A (1 << 19)
-#define R200_TXC_COMP_ARG_B (1 << 20)
-#define R200_TXC_COMP_ARG_B_SHIFT (20)
-#define R200_TXC_BIAS_ARG_B (1 << 21)
-#define R200_TXC_SCALE_ARG_B (1 << 22)
-#define R200_TXC_NEG_ARG_B (1 << 23)
-#define R200_TXC_COMP_ARG_C (1 << 24)
-#define R200_TXC_COMP_ARG_C_SHIFT (24)
-#define R200_TXC_BIAS_ARG_C (1 << 25)
-#define R200_TXC_SCALE_ARG_C (1 << 26)
-#define R200_TXC_NEG_ARG_C (1 << 27)
-#define R200_TXC_OP_MADD (0 << 28)
-#define R200_TXC_OP_CND0 (2 << 28)
-#define R200_TXC_OP_LERP (3 << 28)
-#define R200_TXC_OP_DOT3 (4 << 28)
-#define R200_TXC_OP_DOT4 (5 << 28)
-#define R200_TXC_OP_CONDITIONAL (6 << 28)
-#define R200_TXC_OP_DOT2_ADD (7 << 28)
-#define R200_TXC_OP_MASK (7 << 28)
-#define R200_PP_TXCBLEND2_0 0x2f04
-#define R200_TXC_TFACTOR_SEL_SHIFT 0
-#define R200_TXC_TFACTOR_SEL_MASK 0x7
-#define R200_TXC_TFACTOR1_SEL_SHIFT 4
-#define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4)
-#define R200_TXC_SCALE_SHIFT 8
-#define R200_TXC_SCALE_MASK (7 << 8)
-#define R200_TXC_SCALE_1X (0 << 8)
-#define R200_TXC_SCALE_2X (1 << 8)
-#define R200_TXC_SCALE_4X (2 << 8)
-#define R200_TXC_SCALE_8X (3 << 8)
-#define R200_TXC_SCALE_INV2 (5 << 8)
-#define R200_TXC_SCALE_INV4 (6 << 8)
-#define R200_TXC_SCALE_INV8 (7 << 8)
-#define R200_TXC_CLAMP_SHIFT 12
-#define R200_TXC_CLAMP_MASK (3 << 12)
-#define R200_TXC_CLAMP_WRAP (0 << 12)
-#define R200_TXC_CLAMP_0_1 (1 << 12)
-#define R200_TXC_CLAMP_8_8 (2 << 12)
-#define R200_TXC_OUTPUT_REG_MASK (7 << 16)
-#define R200_TXC_OUTPUT_REG_NONE (0 << 16)
-#define R200_TXC_OUTPUT_REG_R0 (1 << 16)
-#define R200_TXC_OUTPUT_REG_R1 (2 << 16)
-#define R200_TXC_OUTPUT_REG_R2 (3 << 16)
-#define R200_TXC_OUTPUT_REG_R3 (4 << 16)
-#define R200_TXC_OUTPUT_REG_R4 (5 << 16)
-#define R200_TXC_OUTPUT_REG_R5 (6 << 16)
-#define R200_TXC_OUTPUT_MASK_MASK (7 << 20)
-#define R200_TXC_OUTPUT_MASK_RGB (0 << 20)
-#define R200_TXC_OUTPUT_MASK_RG (1 << 20)
-#define R200_TXC_OUTPUT_MASK_RB (2 << 20)
-#define R200_TXC_OUTPUT_MASK_R (3 << 20)
-#define R200_TXC_OUTPUT_MASK_GB (4 << 20)
-#define R200_TXC_OUTPUT_MASK_G (5 << 20)
-#define R200_TXC_OUTPUT_MASK_B (6 << 20)
-#define R200_TXC_OUTPUT_MASK_NONE (7 << 20)
-#define R200_TXC_REPL_NORMAL 0
-#define R200_TXC_REPL_RED 1
-#define R200_TXC_REPL_GREEN 2
-#define R200_TXC_REPL_BLUE 3
-#define R200_TXC_REPL_ARG_A_SHIFT 26
-#define R200_TXC_REPL_ARG_A_MASK (3 << 26)
-#define R200_TXC_REPL_ARG_B_SHIFT 28
-#define R200_TXC_REPL_ARG_B_MASK (3 << 28)
-#define R200_TXC_REPL_ARG_C_SHIFT 30
-#define R200_TXC_REPL_ARG_C_MASK (3 << 30)
-#define R200_PP_TXABLEND_0 0x2f08
-#define R200_TXA_ARG_A_ZERO (0)
-#define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */
-#define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */
-#define R200_TXA_ARG_A_DIFFUSE_ALPHA (4)
-#define R200_TXA_ARG_A_DIFFUSE_BLUE (5)
-#define R200_TXA_ARG_A_SPECULAR_ALPHA (6)
-#define R200_TXA_ARG_A_SPECULAR_BLUE (7)
-#define R200_TXA_ARG_A_TFACTOR_ALPHA (8)
-#define R200_TXA_ARG_A_TFACTOR_BLUE (9)
-#define R200_TXA_ARG_A_R0_ALPHA (10)
-#define R200_TXA_ARG_A_R0_BLUE (11)
-#define R200_TXA_ARG_A_R1_ALPHA (12)
-#define R200_TXA_ARG_A_R1_BLUE (13)
-#define R200_TXA_ARG_A_R2_ALPHA (14)
-#define R200_TXA_ARG_A_R2_BLUE (15)
-#define R200_TXA_ARG_A_R3_ALPHA (16)
-#define R200_TXA_ARG_A_R3_BLUE (17)
-#define R200_TXA_ARG_A_R4_ALPHA (18)
-#define R200_TXA_ARG_A_R4_BLUE (19)
-#define R200_TXA_ARG_A_R5_ALPHA (20)
-#define R200_TXA_ARG_A_R5_BLUE (21)
-#define R200_TXA_ARG_A_TFACTOR1_ALPHA (26)
-#define R200_TXA_ARG_A_TFACTOR1_BLUE (27)
-#define R200_TXA_ARG_A_MASK (31 << 0)
-#define R200_TXA_ARG_A_SHIFT 0
-#define R200_TXA_ARG_B_ZERO (0<<5)
-#define R200_TXA_ARG_B_CURRENT_ALPHA (2<<5) /* guess */
-#define R200_TXA_ARG_B_CURRENT_BLUE (3<<5) /* guess */
-#define R200_TXA_ARG_B_DIFFUSE_ALPHA (4<<5)
-#define R200_TXA_ARG_B_DIFFUSE_BLUE (5<<5)
-#define R200_TXA_ARG_B_SPECULAR_ALPHA (6<<5)
-#define R200_TXA_ARG_B_SPECULAR_BLUE (7<<5)
-#define R200_TXA_ARG_B_TFACTOR_ALPHA (8<<5)
-#define R200_TXA_ARG_B_TFACTOR_BLUE (9<<5)
-#define R200_TXA_ARG_B_R0_ALPHA (10<<5)
-#define R200_TXA_ARG_B_R0_BLUE (11<<5)
-#define R200_TXA_ARG_B_R1_ALPHA (12<<5)
-#define R200_TXA_ARG_B_R1_BLUE (13<<5)
-#define R200_TXA_ARG_B_R2_ALPHA (14<<5)
-#define R200_TXA_ARG_B_R2_BLUE (15<<5)
-#define R200_TXA_ARG_B_R3_ALPHA (16<<5)
-#define R200_TXA_ARG_B_R3_BLUE (17<<5)
-#define R200_TXA_ARG_B_R4_ALPHA (18<<5)
-#define R200_TXA_ARG_B_R4_BLUE (19<<5)
-#define R200_TXA_ARG_B_R5_ALPHA (20<<5)
-#define R200_TXA_ARG_B_R5_BLUE (21<<5)
-#define R200_TXA_ARG_B_TFACTOR1_ALPHA (26<<5)
-#define R200_TXA_ARG_B_TFACTOR1_BLUE (27<<5)
-#define R200_TXA_ARG_B_MASK (31 << 5)
-#define R200_TXA_ARG_B_SHIFT 5
-#define R200_TXA_ARG_C_ZERO (0<<10)
-#define R200_TXA_ARG_C_CURRENT_ALPHA (2<<10) /* guess */
-#define R200_TXA_ARG_C_CURRENT_BLUE (3<<10) /* guess */
-#define R200_TXA_ARG_C_DIFFUSE_ALPHA (4<<10)
-#define R200_TXA_ARG_C_DIFFUSE_BLUE (5<<10)
-#define R200_TXA_ARG_C_SPECULAR_ALPHA (6<<10)
-#define R200_TXA_ARG_C_SPECULAR_BLUE (7<<10)
-#define R200_TXA_ARG_C_TFACTOR_ALPHA (8<<10)
-#define R200_TXA_ARG_C_TFACTOR_BLUE (9<<10)
-#define R200_TXA_ARG_C_R0_ALPHA (10<<10)
-#define R200_TXA_ARG_C_R0_BLUE (11<<10)
-#define R200_TXA_ARG_C_R1_ALPHA (12<<10)
-#define R200_TXA_ARG_C_R1_BLUE (13<<10)
-#define R200_TXA_ARG_C_R2_ALPHA (14<<10)
-#define R200_TXA_ARG_C_R2_BLUE (15<<10)
-#define R200_TXA_ARG_C_R3_ALPHA (16<<10)
-#define R200_TXA_ARG_C_R3_BLUE (17<<10)
-#define R200_TXA_ARG_C_R4_ALPHA (18<<10)
-#define R200_TXA_ARG_C_R4_BLUE (19<<10)
-#define R200_TXA_ARG_C_R5_ALPHA (20<<10)
-#define R200_TXA_ARG_C_R5_BLUE (21<<10)
-#define R200_TXA_ARG_C_TFACTOR1_ALPHA (26<<10)
-#define R200_TXA_ARG_C_TFACTOR1_BLUE (27<<10)
-#define R200_TXA_ARG_C_MASK (31 << 10)
-#define R200_TXA_ARG_C_SHIFT 10
-#define R200_TXA_COMP_ARG_A (1 << 16)
-#define R200_TXA_COMP_ARG_A_SHIFT (16)
-#define R200_TXA_BIAS_ARG_A (1 << 17)
-#define R200_TXA_SCALE_ARG_A (1 << 18)
-#define R200_TXA_NEG_ARG_A (1 << 19)
-#define R200_TXA_COMP_ARG_B (1 << 20)
-#define R200_TXA_COMP_ARG_B_SHIFT (20)
-#define R200_TXA_BIAS_ARG_B (1 << 21)
-#define R200_TXA_SCALE_ARG_B (1 << 22)
-#define R200_TXA_NEG_ARG_B (1 << 23)
-#define R200_TXA_COMP_ARG_C (1 << 24)
-#define R200_TXA_COMP_ARG_C_SHIFT (24)
-#define R200_TXA_BIAS_ARG_C (1 << 25)
-#define R200_TXA_SCALE_ARG_C (1 << 26)
-#define R200_TXA_NEG_ARG_C (1 << 27)
-#define R200_TXA_OP_MADD (0 << 28)
-#define R200_TXA_OP_CND0 (2 << 28)
-#define R200_TXA_OP_LERP (3 << 28)
-#define R200_TXA_OP_CONDITIONAL (6 << 28)
-#define R200_TXA_OP_MASK (7 << 28)
-#define R200_PP_TXABLEND2_0 0x2f0c
-#define R200_TXA_TFACTOR_SEL_SHIFT 0
-#define R200_TXA_TFACTOR_SEL_MASK 0x7
-#define R200_TXA_TFACTOR1_SEL_SHIFT 4
-#define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4)
-#define R200_TXA_SCALE_SHIFT 8
-#define R200_TXA_SCALE_MASK (7 << 8)
-#define R200_TXA_SCALE_1X (0 << 8)
-#define R200_TXA_SCALE_2X (1 << 8)
-#define R200_TXA_SCALE_4X (2 << 8)
-#define R200_TXA_SCALE_8X (3 << 8)
-#define R200_TXA_SCALE_INV2 (5 << 8)
-#define R200_TXA_SCALE_INV4 (6 << 8)
-#define R200_TXA_SCALE_INV8 (7 << 8)
-#define R200_TXA_CLAMP_SHIFT 12
-#define R200_TXA_CLAMP_MASK (3 << 12)
-#define R200_TXA_CLAMP_WRAP (0 << 12)
-#define R200_TXA_CLAMP_0_1 (1 << 12)
-#define R200_TXA_CLAMP_8_8 (2 << 12)
-#define R200_TXA_OUTPUT_REG_MASK (7 << 16)
-#define R200_TXA_OUTPUT_REG_NONE (0 << 16)
-#define R200_TXA_OUTPUT_REG_R0 (1 << 16)
-#define R200_TXA_OUTPUT_REG_R1 (2 << 16)
-#define R200_TXA_OUTPUT_REG_R2 (3 << 16)
-#define R200_TXA_OUTPUT_REG_R3 (4 << 16)
-#define R200_TXA_OUTPUT_REG_R4 (5 << 16)
-#define R200_TXA_OUTPUT_REG_R5 (6 << 16)
-#define R200_TXA_DOT_ALPHA (1 << 20)
-#define R200_TXA_REPL_NORMAL 0
-#define R200_TXA_REPL_RED 1
-#define R200_TXA_REPL_GREEN 2
-#define R200_TXA_REPL_ARG_A_SHIFT 26
-#define R200_TXA_REPL_ARG_A_MASK (3 << 26)
-#define R200_TXA_REPL_ARG_B_SHIFT 28
-#define R200_TXA_REPL_ARG_B_MASK (3 << 28)
-#define R200_TXA_REPL_ARG_C_SHIFT 30
-#define R200_TXA_REPL_ARG_C_MASK (3 << 30)
-#define R200_PP_TXCBLEND_1 0x2f10
-#define R200_PP_TXCBLEND2_1 0x2f14
-#define R200_PP_TXABLEND_1 0x2f18
-#define R200_PP_TXABLEND2_1 0x2f1c
-#define R200_PP_TXCBLEND_2 0x2f20
-#define R200_PP_TXCBLEND2_2 0x2f24
-#define R200_PP_TXABLEND_2 0x2f28
-#define R200_PP_TXABLEND2_2 0x2f2c
-#define R200_PP_TXCBLEND_3 0x2f30
-#define R200_PP_TXCBLEND2_3 0x2f34
-#define R200_PP_TXABLEND_3 0x2f38
-#define R200_PP_TXABLEND2_3 0x2f3c
-#define R200_PP_TXCBLEND_4 0x2f40
-#define R200_PP_TXCBLEND2_4 0x2f44
-#define R200_PP_TXABLEND_4 0x2f48
-#define R200_PP_TXABLEND2_4 0x2f4c
-#define R200_PP_TXCBLEND_5 0x2f50
-#define R200_PP_TXCBLEND2_5 0x2f54
-#define R200_PP_TXABLEND_5 0x2f58
-#define R200_PP_TXABLEND2_5 0x2f5c
-#define R200_PP_TXCBLEND_6 0x2f60
-#define R200_PP_TXCBLEND2_6 0x2f64
-#define R200_PP_TXABLEND_6 0x2f68
-#define R200_PP_TXABLEND2_6 0x2f6c
-#define R200_PP_TXCBLEND_7 0x2f70
-#define R200_PP_TXCBLEND2_7 0x2f74
-#define R200_PP_TXABLEND_7 0x2f78
-#define R200_PP_TXABLEND2_7 0x2f7c
-/* gap */
-#define R200_RB3D_BLENDCOLOR 0x3218 /* ARGB 8888 */
-#define R200_RB3D_ABLENDCNTL 0x321C /* see BLENDCTL */
-#define R200_RB3D_CBLENDCNTL 0x3220 /* see BLENDCTL */
-
-
-/*
- * Offsets in TCL vector state. NOTE: Hardwiring matrix positions.
- * Multiple contexts could collaberate to eliminate state bouncing.
- */
-#define R200_VS_LIGHT_AMBIENT_ADDR 0x00000028
-#define R200_VS_LIGHT_DIFFUSE_ADDR 0x00000030
-#define R200_VS_LIGHT_SPECULAR_ADDR 0x00000038
-#define R200_VS_LIGHT_DIRPOS_ADDR 0x00000040
-#define R200_VS_LIGHT_HWVSPOT_ADDR 0x00000048
-#define R200_VS_LIGHT_ATTENUATION_ADDR 0x00000050
-#define R200_VS_SPOT_DUAL_CONE 0x00000058
-#define R200_VS_GLOBAL_AMBIENT_ADDR 0x0000005C
-#define R200_VS_FOG_PARAM_ADDR 0x0000005D
-#define R200_VS_EYE_VECTOR_ADDR 0x0000005E
-#define R200_VS_UCP_ADDR 0x00000060
-#define R200_VS_PNT_SPRITE_VPORT_SCALE 0x00000068
-#define R200_VS_MATRIX_0_MV 0x00000080
-#define R200_VS_MATRIX_1_INV_MV 0x00000084
-#define R200_VS_MATRIX_2_MVP 0x00000088
-#define R200_VS_MATRIX_3_TEX0 0x0000008C
-#define R200_VS_MATRIX_4_TEX1 0x00000090
-#define R200_VS_MATRIX_5_TEX2 0x00000094
-#define R200_VS_MATRIX_6_TEX3 0x00000098
-#define R200_VS_MATRIX_7_TEX4 0x0000009C
-#define R200_VS_MATRIX_8_TEX5 0x000000A0
-#define R200_VS_MAT_0_EMISS 0x000000B0
-#define R200_VS_MAT_0_AMB 0x000000B1
-#define R200_VS_MAT_0_DIF 0x000000B2
-#define R200_VS_MAT_0_SPEC 0x000000B3
-#define R200_VS_MAT_1_EMISS 0x000000B4
-#define R200_VS_MAT_1_AMB 0x000000B5
-#define R200_VS_MAT_1_DIF 0x000000B6
-#define R200_VS_MAT_1_SPEC 0x000000B7
-#define R200_VS_EYE2CLIP_MTX 0x000000B8
-#define R200_VS_PNT_SPRITE_ATT_CONST 0x000000BC
-#define R200_VS_PNT_SPRITE_EYE_IN_MODEL 0x000000BD
-#define R200_VS_PNT_SPRITE_CLAMP 0x000000BE
-#define R200_VS_MAX 0x000001C0
-
-
-/*
- * Offsets in TCL scalar state
- */
-#define R200_SS_LIGHT_DCD_ADDR 0x00000000
-#define R200_SS_LIGHT_DCM_ADDR 0x00000008
-#define R200_SS_LIGHT_SPOT_EXPONENT_ADDR 0x00000010
-#define R200_SS_LIGHT_SPOT_CUTOFF_ADDR 0x00000018
-#define R200_SS_LIGHT_SPECULAR_THRESH_ADDR 0x00000020
-#define R200_SS_LIGHT_RANGE_CUTOFF_SQRD 0x00000028
-#define R200_SS_LIGHT_RANGE_ATT_CONST 0x00000030
-#define R200_SS_VERT_GUARD_CLIP_ADJ_ADDR 0x00000080
-#define R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR 0x00000081
-#define R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR 0x00000082
-#define R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 0x00000083
-#define R200_SS_MAT_0_SHININESS 0x00000100
-#define R200_SS_MAT_1_SHININESS 0x00000101
-
-
-/*
- * Matrix indices
- */
-#define R200_MTX_MV 0
-#define R200_MTX_IMV 1
-#define R200_MTX_MVP 2
-#define R200_MTX_TEX0 3
-#define R200_MTX_TEX1 4
-#define R200_MTX_TEX2 5
-#define R200_MTX_TEX3 6
-#define R200_MTX_TEX4 7
-#define R200_MTX_TEX5 8
-
-/* Color formats for 2d packets
- */
-#define R200_CP_COLOR_FORMAT_CI8 2
-#define R200_CP_COLOR_FORMAT_ARGB1555 3
-#define R200_CP_COLOR_FORMAT_RGB565 4
-#define R200_CP_COLOR_FORMAT_ARGB8888 6
-#define R200_CP_COLOR_FORMAT_RGB332 7
-#define R200_CP_COLOR_FORMAT_RGB8 9
-#define R200_CP_COLOR_FORMAT_ARGB4444 15
-
-
-/*
- * CP type-3 packets
- */
-#define R200_CP_CMD_NOP 0xC0001000
-#define R200_CP_CMD_NEXT_CHAR 0xC0001900
-#define R200_CP_CMD_PLY_NEXTSCAN 0xC0001D00
-#define R200_CP_CMD_SET_SCISSORS 0xC0001E00
-#define R200_CP_CMD_LOAD_MICROCODE 0xC0002400
-#define R200_CP_CMD_WAIT_FOR_IDLE 0xC0002600
-#define R200_CP_CMD_3D_DRAW_VBUF 0xC0002800
-#define R200_CP_CMD_3D_DRAW_IMMD 0xC0002900
-#define R200_CP_CMD_3D_DRAW_INDX 0xC0002A00
-#define R200_CP_CMD_LOAD_PALETTE 0xC0002C00
-#define R200_CP_CMD_3D_LOAD_VBPNTR 0xC0002F00
-#define R200_CP_CMD_INDX_BUFFER 0xC0003300
-#define R200_CP_CMD_3D_DRAW_VBUF_2 0xC0003400
-#define R200_CP_CMD_3D_DRAW_IMMD_2 0xC0003500
-#define R200_CP_CMD_3D_DRAW_INDX_2 0xC0003600
-#define R200_CP_CMD_PAINT 0xC0009100
-#define R200_CP_CMD_BITBLT 0xC0009200
-#define R200_CP_CMD_SMALLTEXT 0xC0009300
-#define R200_CP_CMD_HOSTDATA_BLT 0xC0009400
-#define R200_CP_CMD_POLYLINE 0xC0009500
-#define R200_CP_CMD_POLYSCANLINES 0xC0009800
-#define R200_CP_CMD_PAINT_MULTI 0xC0009A00
-#define R200_CP_CMD_BITBLT_MULTI 0xC0009B00
-#define R200_CP_CMD_TRANS_BITBLT 0xC0009C00
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c
deleted file mode 100644
index 79d0f3c55..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c
+++ /dev/null
@@ -1,1341 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_sanity.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc, Cedar Park, TX.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_sanity.h"
-#include "radeon_reg.h"
-#include "r200_reg.h"
-
-/* Set this '1' to get more verbiage.
- */
-#define MORE_VERBOSE 1
-
-#if MORE_VERBOSE
-#define VERBOSE (R200_DEBUG & DEBUG_VERBOSE)
-#define NORMAL (1)
-#else
-#define VERBOSE 0
-#define NORMAL (R200_DEBUG & DEBUG_VERBOSE)
-#endif
-
-
-/* New (1.3) state mechanism. 3 commands (packet, scalar, vector) in
- * 1.3 cmdbuffers allow all previous state to be updated as well as
- * the tcl scalar and vector areas.
- */
-static struct {
- int start;
- int len;
- const char *name;
-} packet[RADEON_MAX_STATE_PACKETS] = {
- { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
- { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
- { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
- { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
- { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
- { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
- { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
- { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
- { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
- { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
- { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
- { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
- { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
- { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
- { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
- { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
- { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
- { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
- { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
- { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
- { R200_PP_TXCBLEND_0, 4, "R200_EMIT_PP_TXCBLEND_0" },
- { R200_PP_TXCBLEND_1, 4, "R200_PP_TXCBLEND_1" },
- { R200_PP_TXCBLEND_2, 4, "R200_PP_TXCBLEND_2" },
- { R200_PP_TXCBLEND_3, 4, "R200_PP_TXCBLEND_3" },
- { R200_PP_TXCBLEND_4, 4, "R200_PP_TXCBLEND_4" },
- { R200_PP_TXCBLEND_5, 4, "R200_PP_TXCBLEND_5" },
- { R200_PP_TXCBLEND_6, 4, "R200_PP_TXCBLEND_6" },
- { R200_PP_TXCBLEND_7, 4, "R200_PP_TXCBLEND_7" },
- { R200_SE_TCL_LIGHT_MODEL_CTL_0, 6, "R200_SE_TCL_LIGHT_MODEL_CTL_0" },
- { R200_PP_TFACTOR_0, 6, "R200_PP_TFACTOR_0" },
- { R200_SE_VTX_FMT_0, 4, "R200_SE_VTX_FMT_0" },
- { R200_SE_VAP_CNTL, 1, "R200_SE_VAP_CNTL" },
- { R200_SE_TCL_MATRIX_SEL_0, 5, "R200_SE_TCL_MATRIX_SEL_0" },
- { R200_SE_TCL_TEX_PROC_CTL_2, 5, "R200_SE_TCL_TEX_PROC_CTL_2" },
- { R200_SE_TCL_UCP_VERT_BLEND_CTL, 1, "R200_SE_TCL_UCP_VERT_BLEND_CTL" },
- { R200_PP_TXFILTER_0, 6, "R200_PP_TXFILTER_0" },
- { R200_PP_TXFILTER_1, 6, "R200_PP_TXFILTER_1" },
- { R200_PP_TXFILTER_2, 6, "R200_PP_TXFILTER_2" },
- { R200_PP_TXFILTER_3, 6, "R200_PP_TXFILTER_3" },
- { R200_PP_TXFILTER_4, 6, "R200_PP_TXFILTER_4" },
- { R200_PP_TXFILTER_5, 6, "R200_PP_TXFILTER_5" },
- { R200_PP_TXOFFSET_0, 1, "R200_PP_TXOFFSET_0" },
- { R200_PP_TXOFFSET_1, 1, "R200_PP_TXOFFSET_1" },
- { R200_PP_TXOFFSET_2, 1, "R200_PP_TXOFFSET_2" },
- { R200_PP_TXOFFSET_3, 1, "R200_PP_TXOFFSET_3" },
- { R200_PP_TXOFFSET_4, 1, "R200_PP_TXOFFSET_4" },
- { R200_PP_TXOFFSET_5, 1, "R200_PP_TXOFFSET_5" },
- { R200_SE_VTE_CNTL, 1, "R200_SE_VTE_CNTL" },
- { R200_SE_TCL_OUTPUT_VTX_COMP_SEL, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
- { R200_PP_TAM_DEBUG3, 1, "R200_PP_TAM_DEBUG3" },
- { R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" },
- { R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" },
- { R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" },
- { R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" },
- { R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" },
- { R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" },
- { R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" },
- { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" },
- { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" },
- { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
- { R200_PP_CUBIC_FACES_0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */
- { R200_PP_CUBIC_OFFSET_F1_0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */
- { R200_PP_CUBIC_FACES_1, 1, "R200_PP_CUBIC_FACES_1" },
- { R200_PP_CUBIC_OFFSET_F1_1, 5, "R200_PP_CUBIC_OFFSET_F1_1" },
- { R200_PP_CUBIC_FACES_2, 1, "R200_PP_CUBIC_FACES_2" },
- { R200_PP_CUBIC_OFFSET_F1_2, 5, "R200_PP_CUBIC_OFFSET_F1_2" },
- { R200_PP_CUBIC_FACES_3, 1, "R200_PP_CUBIC_FACES_3" },
- { R200_PP_CUBIC_OFFSET_F1_3, 5, "R200_PP_CUBIC_OFFSET_F1_3" },
- { R200_PP_CUBIC_FACES_4, 1, "R200_PP_CUBIC_FACES_4" },
- { R200_PP_CUBIC_OFFSET_F1_4, 5, "R200_PP_CUBIC_OFFSET_F1_4" },
- { R200_PP_CUBIC_FACES_5, 1, "R200_PP_CUBIC_FACES_5" },
- { R200_PP_CUBIC_OFFSET_F1_5, 5, "R200_PP_CUBIC_OFFSET_F1_5" },
- { RADEON_PP_TEX_SIZE_0, 2, "RADEON_PP_TEX_SIZE_0" },
- { RADEON_PP_TEX_SIZE_1, 2, "RADEON_PP_TEX_SIZE_1" },
- { RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_2" },
- { R200_RB3D_BLENDCOLOR, 3, "R200_RB3D_BLENDCOLOR" },
- { R200_SE_TCL_POINT_SPRITE_CNTL, 1, "R200_SE_TCL_POINT_SPRITE_CNTL" },
- { RADEON_PP_CUBIC_FACES_0, 1, "RADEON_PP_CUBIC_FACES_0" },
- { RADEON_PP_CUBIC_OFFSET_T0_0, 5, "RADEON_PP_CUBIC_OFFSET_T0_0" },
- { RADEON_PP_CUBIC_FACES_1, 1, "RADEON_PP_CUBIC_FACES_1" },
- { RADEON_PP_CUBIC_OFFSET_T1_0, 5, "RADEON_PP_CUBIC_OFFSET_T1_0" },
- { RADEON_PP_CUBIC_FACES_2, 1, "RADEON_PP_CUBIC_FACES_2" },
- { RADEON_PP_CUBIC_OFFSET_T2_0, 5, "RADEON_PP_CUBIC_OFFSET_T2_0" },
- { R200_PP_TRI_PERF, 2, "R200_PP_TRI_PERF" },
-};
-
-struct reg_names {
- int idx;
- const char *name;
-};
-
-static struct reg_names reg_names[] = {
- { R200_PP_MISC, "R200_PP_MISC" },
- { R200_PP_FOG_COLOR, "R200_PP_FOG_COLOR" },
- { R200_RE_SOLID_COLOR, "R200_RE_SOLID_COLOR" },
- { R200_RB3D_BLENDCNTL, "R200_RB3D_BLENDCNTL" },
- { R200_RB3D_DEPTHOFFSET, "R200_RB3D_DEPTHOFFSET" },
- { R200_RB3D_DEPTHPITCH, "R200_RB3D_DEPTHPITCH" },
- { R200_RB3D_ZSTENCILCNTL, "R200_RB3D_ZSTENCILCNTL" },
- { R200_PP_CNTL, "R200_PP_CNTL" },
- { R200_RB3D_CNTL, "R200_RB3D_CNTL" },
- { R200_RB3D_COLOROFFSET, "R200_RB3D_COLOROFFSET" },
- { R200_RE_WIDTH_HEIGHT, "R200_RE_WIDTH_HEIGHT" },
- { R200_RB3D_COLORPITCH, "R200_RB3D_COLORPITCH" },
- { R200_SE_CNTL, "R200_SE_CNTL" },
- { R200_RE_CNTL, "R200_RE_CNTL" },
- { R200_RE_MISC, "R200_RE_MISC" },
- { R200_RE_STIPPLE_ADDR, "R200_RE_STIPPLE_ADDR" },
- { R200_RE_STIPPLE_DATA, "R200_RE_STIPPLE_DATA" },
- { R200_RE_LINE_PATTERN, "R200_RE_LINE_PATTERN" },
- { R200_RE_LINE_STATE, "R200_RE_LINE_STATE" },
- { R200_RE_SCISSOR_TL_0, "R200_RE_SCISSOR_TL_0" },
- { R200_RE_SCISSOR_BR_0, "R200_RE_SCISSOR_BR_0" },
- { R200_RE_SCISSOR_TL_1, "R200_RE_SCISSOR_TL_1" },
- { R200_RE_SCISSOR_BR_1, "R200_RE_SCISSOR_BR_1" },
- { R200_RE_SCISSOR_TL_2, "R200_RE_SCISSOR_TL_2" },
- { R200_RE_SCISSOR_BR_2, "R200_RE_SCISSOR_BR_2" },
- { R200_RB3D_DEPTHXY_OFFSET, "R200_RB3D_DEPTHXY_OFFSET" },
- { R200_RB3D_STENCILREFMASK, "R200_RB3D_STENCILREFMASK" },
- { R200_RB3D_ROPCNTL, "R200_RB3D_ROPCNTL" },
- { R200_RB3D_PLANEMASK, "R200_RB3D_PLANEMASK" },
- { R200_SE_VPORT_XSCALE, "R200_SE_VPORT_XSCALE" },
- { R200_SE_VPORT_XOFFSET, "R200_SE_VPORT_XOFFSET" },
- { R200_SE_VPORT_YSCALE, "R200_SE_VPORT_YSCALE" },
- { R200_SE_VPORT_YOFFSET, "R200_SE_VPORT_YOFFSET" },
- { R200_SE_VPORT_ZSCALE, "R200_SE_VPORT_ZSCALE" },
- { R200_SE_VPORT_ZOFFSET, "R200_SE_VPORT_ZOFFSET" },
- { R200_SE_ZBIAS_FACTOR, "R200_SE_ZBIAS_FACTOR" },
- { R200_SE_ZBIAS_CONSTANT, "R200_SE_ZBIAS_CONSTANT" },
- { R200_SE_LINE_WIDTH, "R200_SE_LINE_WIDTH" },
- { R200_SE_VAP_CNTL, "R200_SE_VAP_CNTL" },
- { R200_SE_VF_CNTL, "R200_SE_VF_CNTL" },
- { R200_SE_VTX_FMT_0, "R200_SE_VTX_FMT_0" },
- { R200_SE_VTX_FMT_1, "R200_SE_VTX_FMT_1" },
- { R200_SE_TCL_OUTPUT_VTX_FMT_0, "R200_SE_TCL_OUTPUT_VTX_FMT_0" },
- { R200_SE_TCL_OUTPUT_VTX_FMT_1, "R200_SE_TCL_OUTPUT_VTX_FMT_1" },
- { R200_SE_VTE_CNTL, "R200_SE_VTE_CNTL" },
- { R200_SE_VTX_NUM_ARRAYS, "R200_SE_VTX_NUM_ARRAYS" },
- { R200_SE_VTX_AOS_ATTR01, "R200_SE_VTX_AOS_ATTR01" },
- { R200_SE_VTX_AOS_ADDR0, "R200_SE_VTX_AOS_ADDR0" },
- { R200_SE_VTX_AOS_ADDR1, "R200_SE_VTX_AOS_ADDR1" },
- { R200_SE_VTX_AOS_ATTR23, "R200_SE_VTX_AOS_ATTR23" },
- { R200_SE_VTX_AOS_ADDR2, "R200_SE_VTX_AOS_ADDR2" },
- { R200_SE_VTX_AOS_ADDR3, "R200_SE_VTX_AOS_ADDR3" },
- { R200_SE_VTX_AOS_ATTR45, "R200_SE_VTX_AOS_ATTR45" },
- { R200_SE_VTX_AOS_ADDR4, "R200_SE_VTX_AOS_ADDR4" },
- { R200_SE_VTX_AOS_ADDR5, "R200_SE_VTX_AOS_ADDR5" },
- { R200_SE_VTX_AOS_ATTR67, "R200_SE_VTX_AOS_ATTR67" },
- { R200_SE_VTX_AOS_ADDR6, "R200_SE_VTX_AOS_ADDR6" },
- { R200_SE_VTX_AOS_ADDR7, "R200_SE_VTX_AOS_ADDR7" },
- { R200_SE_VTX_AOS_ATTR89, "R200_SE_VTX_AOS_ATTR89" },
- { R200_SE_VTX_AOS_ADDR8, "R200_SE_VTX_AOS_ADDR8" },
- { R200_SE_VTX_AOS_ADDR9, "R200_SE_VTX_AOS_ADDR9" },
- { R200_SE_VTX_AOS_ATTR1011, "R200_SE_VTX_AOS_ATTR1011" },
- { R200_SE_VTX_AOS_ADDR10, "R200_SE_VTX_AOS_ADDR10" },
- { R200_SE_VTX_AOS_ADDR11, "R200_SE_VTX_AOS_ADDR11" },
- { R200_SE_VF_MAX_VTX_INDX, "R200_SE_VF_MAX_VTX_INDX" },
- { R200_SE_VF_MIN_VTX_INDX, "R200_SE_VF_MIN_VTX_INDX" },
- { R200_SE_VTX_STATE_CNTL, "R200_SE_VTX_STATE_CNTL" },
- { R200_SE_TCL_VECTOR_INDX_REG, "R200_SE_TCL_VECTOR_INDX_REG" },
- { R200_SE_TCL_VECTOR_DATA_REG, "R200_SE_TCL_VECTOR_DATA_REG" },
- { R200_SE_TCL_SCALAR_INDX_REG, "R200_SE_TCL_SCALAR_INDX_REG" },
- { R200_SE_TCL_SCALAR_DATA_REG, "R200_SE_TCL_SCALAR_DATA_REG" },
- { R200_SE_TCL_MATRIX_SEL_0, "R200_SE_TCL_MATRIX_SEL_0" },
- { R200_SE_TCL_MATRIX_SEL_1, "R200_SE_TCL_MATRIX_SEL_1" },
- { R200_SE_TCL_MATRIX_SEL_2, "R200_SE_TCL_MATRIX_SEL_2" },
- { R200_SE_TCL_MATRIX_SEL_3, "R200_SE_TCL_MATRIX_SEL_3" },
- { R200_SE_TCL_MATRIX_SEL_4, "R200_SE_TCL_MATRIX_SEL_4" },
- { R200_SE_TCL_LIGHT_MODEL_CTL_0, "R200_SE_TCL_LIGHT_MODEL_CTL_0" },
- { R200_SE_TCL_LIGHT_MODEL_CTL_1, "R200_SE_TCL_LIGHT_MODEL_CTL_1" },
- { R200_SE_TCL_PER_LIGHT_CTL_0, "R200_SE_TCL_PER_LIGHT_CTL_0" },
- { R200_SE_TCL_PER_LIGHT_CTL_1, "R200_SE_TCL_PER_LIGHT_CTL_1" },
- { R200_SE_TCL_PER_LIGHT_CTL_2, "R200_SE_TCL_PER_LIGHT_CTL_2" },
- { R200_SE_TCL_PER_LIGHT_CTL_3, "R200_SE_TCL_PER_LIGHT_CTL_3" },
- { R200_SE_TCL_TEX_PROC_CTL_2, "R200_SE_TCL_TEX_PROC_CTL_2" },
- { R200_SE_TCL_TEX_PROC_CTL_3, "R200_SE_TCL_TEX_PROC_CTL_3" },
- { R200_SE_TCL_TEX_PROC_CTL_0, "R200_SE_TCL_TEX_PROC_CTL_0" },
- { R200_SE_TCL_TEX_PROC_CTL_1, "R200_SE_TCL_TEX_PROC_CTL_1" },
- { R200_SE_TC_TEX_CYL_WRAP_CTL, "R200_SE_TC_TEX_CYL_WRAP_CTL" },
- { R200_SE_TCL_UCP_VERT_BLEND_CTL, "R200_SE_TCL_UCP_VERT_BLEND_CTL" },
- { R200_SE_TCL_POINT_SPRITE_CNTL, "R200_SE_TCL_POINT_SPRITE_CNTL" },
- { R200_SE_VTX_ST_POS_0_X_4, "R200_SE_VTX_ST_POS_0_X_4" },
- { R200_SE_VTX_ST_POS_0_Y_4, "R200_SE_VTX_ST_POS_0_Y_4" },
- { R200_SE_VTX_ST_POS_0_Z_4, "R200_SE_VTX_ST_POS_0_Z_4" },
- { R200_SE_VTX_ST_POS_0_W_4, "R200_SE_VTX_ST_POS_0_W_4" },
- { R200_SE_VTX_ST_NORM_0_X, "R200_SE_VTX_ST_NORM_0_X" },
- { R200_SE_VTX_ST_NORM_0_Y, "R200_SE_VTX_ST_NORM_0_Y" },
- { R200_SE_VTX_ST_NORM_0_Z, "R200_SE_VTX_ST_NORM_0_Z" },
- { R200_SE_VTX_ST_PVMS, "R200_SE_VTX_ST_PVMS" },
- { R200_SE_VTX_ST_CLR_0_R, "R200_SE_VTX_ST_CLR_0_R" },
- { R200_SE_VTX_ST_CLR_0_G, "R200_SE_VTX_ST_CLR_0_G" },
- { R200_SE_VTX_ST_CLR_0_B, "R200_SE_VTX_ST_CLR_0_B" },
- { R200_SE_VTX_ST_CLR_0_A, "R200_SE_VTX_ST_CLR_0_A" },
- { R200_SE_VTX_ST_CLR_1_R, "R200_SE_VTX_ST_CLR_1_R" },
- { R200_SE_VTX_ST_CLR_1_G, "R200_SE_VTX_ST_CLR_1_G" },
- { R200_SE_VTX_ST_CLR_1_B, "R200_SE_VTX_ST_CLR_1_B" },
- { R200_SE_VTX_ST_CLR_1_A, "R200_SE_VTX_ST_CLR_1_A" },
- { R200_SE_VTX_ST_CLR_2_R, "R200_SE_VTX_ST_CLR_2_R" },
- { R200_SE_VTX_ST_CLR_2_G, "R200_SE_VTX_ST_CLR_2_G" },
- { R200_SE_VTX_ST_CLR_2_B, "R200_SE_VTX_ST_CLR_2_B" },
- { R200_SE_VTX_ST_CLR_2_A, "R200_SE_VTX_ST_CLR_2_A" },
- { R200_SE_VTX_ST_CLR_3_R, "R200_SE_VTX_ST_CLR_3_R" },
- { R200_SE_VTX_ST_CLR_3_G, "R200_SE_VTX_ST_CLR_3_G" },
- { R200_SE_VTX_ST_CLR_3_B, "R200_SE_VTX_ST_CLR_3_B" },
- { R200_SE_VTX_ST_CLR_3_A, "R200_SE_VTX_ST_CLR_3_A" },
- { R200_SE_VTX_ST_CLR_4_R, "R200_SE_VTX_ST_CLR_4_R" },
- { R200_SE_VTX_ST_CLR_4_G, "R200_SE_VTX_ST_CLR_4_G" },
- { R200_SE_VTX_ST_CLR_4_B, "R200_SE_VTX_ST_CLR_4_B" },
- { R200_SE_VTX_ST_CLR_4_A, "R200_SE_VTX_ST_CLR_4_A" },
- { R200_SE_VTX_ST_CLR_5_R, "R200_SE_VTX_ST_CLR_5_R" },
- { R200_SE_VTX_ST_CLR_5_G, "R200_SE_VTX_ST_CLR_5_G" },
- { R200_SE_VTX_ST_CLR_5_B, "R200_SE_VTX_ST_CLR_5_B" },
- { R200_SE_VTX_ST_CLR_5_A, "R200_SE_VTX_ST_CLR_5_A" },
- { R200_SE_VTX_ST_CLR_6_R, "R200_SE_VTX_ST_CLR_6_R" },
- { R200_SE_VTX_ST_CLR_6_G, "R200_SE_VTX_ST_CLR_6_G" },
- { R200_SE_VTX_ST_CLR_6_B, "R200_SE_VTX_ST_CLR_6_B" },
- { R200_SE_VTX_ST_CLR_6_A, "R200_SE_VTX_ST_CLR_6_A" },
- { R200_SE_VTX_ST_CLR_7_R, "R200_SE_VTX_ST_CLR_7_R" },
- { R200_SE_VTX_ST_CLR_7_G, "R200_SE_VTX_ST_CLR_7_G" },
- { R200_SE_VTX_ST_CLR_7_B, "R200_SE_VTX_ST_CLR_7_B" },
- { R200_SE_VTX_ST_CLR_7_A, "R200_SE_VTX_ST_CLR_7_A" },
- { R200_SE_VTX_ST_TEX_0_S, "R200_SE_VTX_ST_TEX_0_S" },
- { R200_SE_VTX_ST_TEX_0_T, "R200_SE_VTX_ST_TEX_0_T" },
- { R200_SE_VTX_ST_TEX_0_R, "R200_SE_VTX_ST_TEX_0_R" },
- { R200_SE_VTX_ST_TEX_0_Q, "R200_SE_VTX_ST_TEX_0_Q" },
- { R200_SE_VTX_ST_TEX_1_S, "R200_SE_VTX_ST_TEX_1_S" },
- { R200_SE_VTX_ST_TEX_1_T, "R200_SE_VTX_ST_TEX_1_T" },
- { R200_SE_VTX_ST_TEX_1_R, "R200_SE_VTX_ST_TEX_1_R" },
- { R200_SE_VTX_ST_TEX_1_Q, "R200_SE_VTX_ST_TEX_1_Q" },
- { R200_SE_VTX_ST_TEX_2_S, "R200_SE_VTX_ST_TEX_2_S" },
- { R200_SE_VTX_ST_TEX_2_T, "R200_SE_VTX_ST_TEX_2_T" },
- { R200_SE_VTX_ST_TEX_2_R, "R200_SE_VTX_ST_TEX_2_R" },
- { R200_SE_VTX_ST_TEX_2_Q, "R200_SE_VTX_ST_TEX_2_Q" },
- { R200_SE_VTX_ST_TEX_3_S, "R200_SE_VTX_ST_TEX_3_S" },
- { R200_SE_VTX_ST_TEX_3_T, "R200_SE_VTX_ST_TEX_3_T" },
- { R200_SE_VTX_ST_TEX_3_R, "R200_SE_VTX_ST_TEX_3_R" },
- { R200_SE_VTX_ST_TEX_3_Q, "R200_SE_VTX_ST_TEX_3_Q" },
- { R200_SE_VTX_ST_TEX_4_S, "R200_SE_VTX_ST_TEX_4_S" },
- { R200_SE_VTX_ST_TEX_4_T, "R200_SE_VTX_ST_TEX_4_T" },
- { R200_SE_VTX_ST_TEX_4_R, "R200_SE_VTX_ST_TEX_4_R" },
- { R200_SE_VTX_ST_TEX_4_Q, "R200_SE_VTX_ST_TEX_4_Q" },
- { R200_SE_VTX_ST_TEX_5_S, "R200_SE_VTX_ST_TEX_5_S" },
- { R200_SE_VTX_ST_TEX_5_T, "R200_SE_VTX_ST_TEX_5_T" },
- { R200_SE_VTX_ST_TEX_5_R, "R200_SE_VTX_ST_TEX_5_R" },
- { R200_SE_VTX_ST_TEX_5_Q, "R200_SE_VTX_ST_TEX_5_Q" },
- { R200_SE_VTX_ST_PNT_SPRT_SZ, "R200_SE_VTX_ST_PNT_SPRT_SZ" },
- { R200_SE_VTX_ST_DISC_FOG, "R200_SE_VTX_ST_DISC_FOG" },
- { R200_SE_VTX_ST_SHININESS_0, "R200_SE_VTX_ST_SHININESS_0" },
- { R200_SE_VTX_ST_SHININESS_1, "R200_SE_VTX_ST_SHININESS_1" },
- { R200_SE_VTX_ST_BLND_WT_0, "R200_SE_VTX_ST_BLND_WT_0" },
- { R200_SE_VTX_ST_BLND_WT_1, "R200_SE_VTX_ST_BLND_WT_1" },
- { R200_SE_VTX_ST_BLND_WT_2, "R200_SE_VTX_ST_BLND_WT_2" },
- { R200_SE_VTX_ST_BLND_WT_3, "R200_SE_VTX_ST_BLND_WT_3" },
- { R200_SE_VTX_ST_POS_1_X, "R200_SE_VTX_ST_POS_1_X" },
- { R200_SE_VTX_ST_POS_1_Y, "R200_SE_VTX_ST_POS_1_Y" },
- { R200_SE_VTX_ST_POS_1_Z, "R200_SE_VTX_ST_POS_1_Z" },
- { R200_SE_VTX_ST_POS_1_W, "R200_SE_VTX_ST_POS_1_W" },
- { R200_SE_VTX_ST_NORM_1_X, "R200_SE_VTX_ST_NORM_1_X" },
- { R200_SE_VTX_ST_NORM_1_Y, "R200_SE_VTX_ST_NORM_1_Y" },
- { R200_SE_VTX_ST_NORM_1_Z, "R200_SE_VTX_ST_NORM_1_Z" },
- { R200_SE_VTX_ST_USR_CLR_0_R, "R200_SE_VTX_ST_USR_CLR_0_R" },
- { R200_SE_VTX_ST_USR_CLR_0_G, "R200_SE_VTX_ST_USR_CLR_0_G" },
- { R200_SE_VTX_ST_USR_CLR_0_B, "R200_SE_VTX_ST_USR_CLR_0_B" },
- { R200_SE_VTX_ST_USR_CLR_0_A, "R200_SE_VTX_ST_USR_CLR_0_A" },
- { R200_SE_VTX_ST_USR_CLR_1_R, "R200_SE_VTX_ST_USR_CLR_1_R" },
- { R200_SE_VTX_ST_USR_CLR_1_G, "R200_SE_VTX_ST_USR_CLR_1_G" },
- { R200_SE_VTX_ST_USR_CLR_1_B, "R200_SE_VTX_ST_USR_CLR_1_B" },
- { R200_SE_VTX_ST_USR_CLR_1_A, "R200_SE_VTX_ST_USR_CLR_1_A" },
- { R200_SE_VTX_ST_CLR_0_PKD, "R200_SE_VTX_ST_CLR_0_PKD" },
- { R200_SE_VTX_ST_CLR_1_PKD, "R200_SE_VTX_ST_CLR_1_PKD" },
- { R200_SE_VTX_ST_CLR_2_PKD, "R200_SE_VTX_ST_CLR_2_PKD" },
- { R200_SE_VTX_ST_CLR_3_PKD, "R200_SE_VTX_ST_CLR_3_PKD" },
- { R200_SE_VTX_ST_CLR_4_PKD, "R200_SE_VTX_ST_CLR_4_PKD" },
- { R200_SE_VTX_ST_CLR_5_PKD, "R200_SE_VTX_ST_CLR_5_PKD" },
- { R200_SE_VTX_ST_CLR_6_PKD, "R200_SE_VTX_ST_CLR_6_PKD" },
- { R200_SE_VTX_ST_CLR_7_PKD, "R200_SE_VTX_ST_CLR_7_PKD" },
- { R200_SE_VTX_ST_POS_0_X_2, "R200_SE_VTX_ST_POS_0_X_2" },
- { R200_SE_VTX_ST_POS_0_Y_2, "R200_SE_VTX_ST_POS_0_Y_2" },
- { R200_SE_VTX_ST_PAR_CLR_LD, "R200_SE_VTX_ST_PAR_CLR_LD" },
- { R200_SE_VTX_ST_USR_CLR_PKD, "R200_SE_VTX_ST_USR_CLR_PKD" },
- { R200_SE_VTX_ST_POS_0_X_3, "R200_SE_VTX_ST_POS_0_X_3" },
- { R200_SE_VTX_ST_POS_0_Y_3, "R200_SE_VTX_ST_POS_0_Y_3" },
- { R200_SE_VTX_ST_POS_0_Z_3, "R200_SE_VTX_ST_POS_0_Z_3" },
- { R200_SE_VTX_ST_END_OF_PKT, "R200_SE_VTX_ST_END_OF_PKT" },
- { R200_RE_POINTSIZE, "R200_RE_POINTSIZE" },
- { R200_RE_TOP_LEFT, "R200_RE_TOP_LEFT" },
- { R200_RE_AUX_SCISSOR_CNTL, "R200_RE_AUX_SCISSOR_CNTL" },
- { R200_PP_TXFILTER_0, "R200_PP_TXFILTER_0" },
- { R200_PP_TXFORMAT_0, "R200_PP_TXFORMAT_0" },
- { R200_PP_TXSIZE_0, "R200_PP_TXSIZE_0" },
- { R200_PP_TXFORMAT_X_0, "R200_PP_TXFORMAT_X_0" },
- { R200_PP_TXPITCH_0, "R200_PP_TXPITCH_0" },
- { R200_PP_BORDER_COLOR_0, "R200_PP_BORDER_COLOR_0" },
- { R200_PP_CUBIC_FACES_0, "R200_PP_CUBIC_FACES_0" },
- { R200_PP_TXFILTER_1, "R200_PP_TXFILTER_1" },
- { R200_PP_TXFORMAT_1, "R200_PP_TXFORMAT_1" },
- { R200_PP_TXSIZE_1, "R200_PP_TXSIZE_1" },
- { R200_PP_TXFORMAT_X_1, "R200_PP_TXFORMAT_X_1" },
- { R200_PP_TXPITCH_1, "R200_PP_TXPITCH_1" },
- { R200_PP_BORDER_COLOR_1, "R200_PP_BORDER_COLOR_1" },
- { R200_PP_CUBIC_FACES_1, "R200_PP_CUBIC_FACES_1" },
- { R200_PP_TXFILTER_2, "R200_PP_TXFILTER_2" },
- { R200_PP_TXFORMAT_2, "R200_PP_TXFORMAT_2" },
- { R200_PP_TXSIZE_2, "R200_PP_TXSIZE_2" },
- { R200_PP_TXFORMAT_X_2, "R200_PP_TXFORMAT_X_2" },
- { R200_PP_TXPITCH_2, "R200_PP_TXPITCH_2" },
- { R200_PP_BORDER_COLOR_2, "R200_PP_BORDER_COLOR_2" },
- { R200_PP_CUBIC_FACES_2, "R200_PP_CUBIC_FACES_2" },
- { R200_PP_TXFILTER_3, "R200_PP_TXFILTER_3" },
- { R200_PP_TXFORMAT_3, "R200_PP_TXFORMAT_3" },
- { R200_PP_TXSIZE_3, "R200_PP_TXSIZE_3" },
- { R200_PP_TXFORMAT_X_3, "R200_PP_TXFORMAT_X_3" },
- { R200_PP_TXPITCH_3, "R200_PP_TXPITCH_3" },
- { R200_PP_BORDER_COLOR_3, "R200_PP_BORDER_COLOR_3" },
- { R200_PP_CUBIC_FACES_3, "R200_PP_CUBIC_FACES_3" },
- { R200_PP_TXFILTER_4, "R200_PP_TXFILTER_4" },
- { R200_PP_TXFORMAT_4, "R200_PP_TXFORMAT_4" },
- { R200_PP_TXSIZE_4, "R200_PP_TXSIZE_4" },
- { R200_PP_TXFORMAT_X_4, "R200_PP_TXFORMAT_X_4" },
- { R200_PP_TXPITCH_4, "R200_PP_TXPITCH_4" },
- { R200_PP_BORDER_COLOR_4, "R200_PP_BORDER_COLOR_4" },
- { R200_PP_CUBIC_FACES_4, "R200_PP_CUBIC_FACES_4" },
- { R200_PP_TXFILTER_5, "R200_PP_TXFILTER_5" },
- { R200_PP_TXFORMAT_5, "R200_PP_TXFORMAT_5" },
- { R200_PP_TXSIZE_5, "R200_PP_TXSIZE_5" },
- { R200_PP_TXFORMAT_X_5, "R200_PP_TXFORMAT_X_5" },
- { R200_PP_TXPITCH_5, "R200_PP_TXPITCH_5" },
- { R200_PP_BORDER_COLOR_5, "R200_PP_BORDER_COLOR_5" },
- { R200_PP_CUBIC_FACES_5, "R200_PP_CUBIC_FACES_5" },
- { R200_PP_TXOFFSET_0, "R200_PP_TXOFFSET_0" },
- { R200_PP_CUBIC_OFFSET_F1_0, "R200_PP_CUBIC_OFFSET_F1_0" },
- { R200_PP_CUBIC_OFFSET_F2_0, "R200_PP_CUBIC_OFFSET_F2_0" },
- { R200_PP_CUBIC_OFFSET_F3_0, "R200_PP_CUBIC_OFFSET_F3_0" },
- { R200_PP_CUBIC_OFFSET_F4_0, "R200_PP_CUBIC_OFFSET_F4_0" },
- { R200_PP_CUBIC_OFFSET_F5_0, "R200_PP_CUBIC_OFFSET_F5_0" },
- { R200_PP_TXOFFSET_1, "R200_PP_TXOFFSET_1" },
- { R200_PP_CUBIC_OFFSET_F1_1, "R200_PP_CUBIC_OFFSET_F1_1" },
- { R200_PP_CUBIC_OFFSET_F2_1, "R200_PP_CUBIC_OFFSET_F2_1" },
- { R200_PP_CUBIC_OFFSET_F3_1, "R200_PP_CUBIC_OFFSET_F3_1" },
- { R200_PP_CUBIC_OFFSET_F4_1, "R200_PP_CUBIC_OFFSET_F4_1" },
- { R200_PP_CUBIC_OFFSET_F5_1, "R200_PP_CUBIC_OFFSET_F5_1" },
- { R200_PP_TXOFFSET_2, "R200_PP_TXOFFSET_2" },
- { R200_PP_CUBIC_OFFSET_F1_2, "R200_PP_CUBIC_OFFSET_F1_2" },
- { R200_PP_CUBIC_OFFSET_F2_2, "R200_PP_CUBIC_OFFSET_F2_2" },
- { R200_PP_CUBIC_OFFSET_F3_2, "R200_PP_CUBIC_OFFSET_F3_2" },
- { R200_PP_CUBIC_OFFSET_F4_2, "R200_PP_CUBIC_OFFSET_F4_2" },
- { R200_PP_CUBIC_OFFSET_F5_2, "R200_PP_CUBIC_OFFSET_F5_2" },
- { R200_PP_TXOFFSET_3, "R200_PP_TXOFFSET_3" },
- { R200_PP_CUBIC_OFFSET_F1_3, "R200_PP_CUBIC_OFFSET_F1_3" },
- { R200_PP_CUBIC_OFFSET_F2_3, "R200_PP_CUBIC_OFFSET_F2_3" },
- { R200_PP_CUBIC_OFFSET_F3_3, "R200_PP_CUBIC_OFFSET_F3_3" },
- { R200_PP_CUBIC_OFFSET_F4_3, "R200_PP_CUBIC_OFFSET_F4_3" },
- { R200_PP_CUBIC_OFFSET_F5_3, "R200_PP_CUBIC_OFFSET_F5_3" },
- { R200_PP_TXOFFSET_4, "R200_PP_TXOFFSET_4" },
- { R200_PP_CUBIC_OFFSET_F1_4, "R200_PP_CUBIC_OFFSET_F1_4" },
- { R200_PP_CUBIC_OFFSET_F2_4, "R200_PP_CUBIC_OFFSET_F2_4" },
- { R200_PP_CUBIC_OFFSET_F3_4, "R200_PP_CUBIC_OFFSET_F3_4" },
- { R200_PP_CUBIC_OFFSET_F4_4, "R200_PP_CUBIC_OFFSET_F4_4" },
- { R200_PP_CUBIC_OFFSET_F5_4, "R200_PP_CUBIC_OFFSET_F5_4" },
- { R200_PP_TXOFFSET_5, "R200_PP_TXOFFSET_5" },
- { R200_PP_CUBIC_OFFSET_F1_5, "R200_PP_CUBIC_OFFSET_F1_5" },
- { R200_PP_CUBIC_OFFSET_F2_5, "R200_PP_CUBIC_OFFSET_F2_5" },
- { R200_PP_CUBIC_OFFSET_F3_5, "R200_PP_CUBIC_OFFSET_F3_5" },
- { R200_PP_CUBIC_OFFSET_F4_5, "R200_PP_CUBIC_OFFSET_F4_5" },
- { R200_PP_CUBIC_OFFSET_F5_5, "R200_PP_CUBIC_OFFSET_F5_5" },
- { R200_PP_TAM_DEBUG3, "R200_PP_TAM_DEBUG3" },
- { R200_PP_TFACTOR_0, "R200_PP_TFACTOR_0" },
- { R200_PP_TFACTOR_1, "R200_PP_TFACTOR_1" },
- { R200_PP_TFACTOR_2, "R200_PP_TFACTOR_2" },
- { R200_PP_TFACTOR_3, "R200_PP_TFACTOR_3" },
- { R200_PP_TFACTOR_4, "R200_PP_TFACTOR_4" },
- { R200_PP_TFACTOR_5, "R200_PP_TFACTOR_5" },
- { R200_PP_TXCBLEND_0, "R200_PP_TXCBLEND_0" },
- { R200_PP_TXCBLEND2_0, "R200_PP_TXCBLEND2_0" },
- { R200_PP_TXABLEND_0, "R200_PP_TXABLEND_0" },
- { R200_PP_TXABLEND2_0, "R200_PP_TXABLEND2_0" },
- { R200_PP_TXCBLEND_1, "R200_PP_TXCBLEND_1" },
- { R200_PP_TXCBLEND2_1, "R200_PP_TXCBLEND2_1" },
- { R200_PP_TXABLEND_1, "R200_PP_TXABLEND_1" },
- { R200_PP_TXABLEND2_1, "R200_PP_TXABLEND2_1" },
- { R200_PP_TXCBLEND_2, "R200_PP_TXCBLEND_2" },
- { R200_PP_TXCBLEND2_2, "R200_PP_TXCBLEND2_2" },
- { R200_PP_TXABLEND_2, "R200_PP_TXABLEND_2" },
- { R200_PP_TXABLEND2_2, "R200_PP_TXABLEND2_2" },
- { R200_PP_TXCBLEND_3, "R200_PP_TXCBLEND_3" },
- { R200_PP_TXCBLEND2_3, "R200_PP_TXCBLEND2_3" },
- { R200_PP_TXABLEND_3, "R200_PP_TXABLEND_3" },
- { R200_PP_TXABLEND2_3, "R200_PP_TXABLEND2_3" },
- { R200_PP_TXCBLEND_4, "R200_PP_TXCBLEND_4" },
- { R200_PP_TXCBLEND2_4, "R200_PP_TXCBLEND2_4" },
- { R200_PP_TXABLEND_4, "R200_PP_TXABLEND_4" },
- { R200_PP_TXABLEND2_4, "R200_PP_TXABLEND2_4" },
- { R200_PP_TXCBLEND_5, "R200_PP_TXCBLEND_5" },
- { R200_PP_TXCBLEND2_5, "R200_PP_TXCBLEND2_5" },
- { R200_PP_TXABLEND_5, "R200_PP_TXABLEND_5" },
- { R200_PP_TXABLEND2_5, "R200_PP_TXABLEND2_5" },
- { R200_PP_TXCBLEND_6, "R200_PP_TXCBLEND_6" },
- { R200_PP_TXCBLEND2_6, "R200_PP_TXCBLEND2_6" },
- { R200_PP_TXABLEND_6, "R200_PP_TXABLEND_6" },
- { R200_PP_TXABLEND2_6, "R200_PP_TXABLEND2_6" },
- { R200_PP_TXCBLEND_7, "R200_PP_TXCBLEND_7" },
- { R200_PP_TXCBLEND2_7, "R200_PP_TXCBLEND2_7" },
- { R200_PP_TXABLEND_7, "R200_PP_TXABLEND_7" },
- { R200_PP_TXABLEND2_7, "R200_PP_TXABLEND2_7" },
- { R200_RB3D_BLENDCOLOR, "R200_RB3D_BLENDCOLOR" },
- { R200_RB3D_ABLENDCNTL, "R200_RB3D_ABLENDCNTL" },
- { R200_RB3D_CBLENDCNTL, "R200_RB3D_CBLENDCNTL" },
- { R200_SE_TCL_OUTPUT_VTX_COMP_SEL, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
- { R200_PP_CNTL_X, "R200_PP_CNTL_X" },
- { R200_SE_VAP_CNTL_STATUS, "R200_SE_VAP_CNTL_STATUS" },
- { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
- { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1" },
- { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2" },
- { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3" },
- { R200_PP_TRI_PERF, "R200_PP_TRI_PERF" },
- { R200_PP_PERF_CNTL, "R200_PP_PERF_CNTL" },
-};
-
-static struct reg_names scalar_names[] = {
- { R200_SS_LIGHT_DCD_ADDR, "R200_SS_LIGHT_DCD_ADDR" },
- { R200_SS_LIGHT_DCM_ADDR, "R200_SS_LIGHT_DCM_ADDR" },
- { R200_SS_LIGHT_SPOT_EXPONENT_ADDR, "R200_SS_LIGHT_SPOT_EXPONENT_ADDR" },
- { R200_SS_LIGHT_SPOT_CUTOFF_ADDR, "R200_SS_LIGHT_SPOT_CUTOFF_ADDR" },
- { R200_SS_LIGHT_SPECULAR_THRESH_ADDR, "R200_SS_LIGHT_SPECULAR_THRESH_ADDR" },
- { R200_SS_LIGHT_RANGE_CUTOFF_SQRD, "R200_SS_LIGHT_RANGE_CUTOFF_SQRD" },
- { R200_SS_LIGHT_RANGE_ATT_CONST, "R200_SS_LIGHT_RANGE_ATT_CONST" },
- { R200_SS_VERT_GUARD_CLIP_ADJ_ADDR, "R200_SS_VERT_GUARD_CLIP_ADJ_ADDR" },
- { R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR, "R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR" },
- { R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR, "R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR" },
- { R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR, "R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR" },
- { R200_SS_MAT_0_SHININESS, "R200_SS_MAT_0_SHININESS" },
- { R200_SS_MAT_1_SHININESS, "R200_SS_MAT_1_SHININESS" },
- { 1000, "" },
-};
-
-/* Puff these out to make them look like normal (dword) registers.
- */
-static struct reg_names vector_names[] = {
- { 0, "start" },
- { R200_VS_LIGHT_AMBIENT_ADDR, "R200_VS_LIGHT_AMBIENT_ADDR" },
- { R200_VS_LIGHT_DIFFUSE_ADDR, "R200_VS_LIGHT_DIFFUSE_ADDR" },
- { R200_VS_LIGHT_SPECULAR_ADDR, "R200_VS_LIGHT_SPECULAR_ADDR" },
- { R200_VS_LIGHT_DIRPOS_ADDR, "R200_VS_LIGHT_DIRPOS_ADDR" },
- { R200_VS_LIGHT_HWVSPOT_ADDR, "R200_VS_LIGHT_HWVSPOT_ADDR" },
- { R200_VS_LIGHT_ATTENUATION_ADDR, "R200_VS_LIGHT_ATTENUATION_ADDR" },
- { R200_VS_SPOT_DUAL_CONE, "R200_VS_SPOT_DUAL_CONE" },
- { R200_VS_GLOBAL_AMBIENT_ADDR, "R200_VS_GLOBAL_AMBIENT_ADDR" },
- { R200_VS_FOG_PARAM_ADDR, "R200_VS_FOG_PARAM_ADDR" },
- { R200_VS_EYE_VECTOR_ADDR, "R200_VS_EYE_VECTOR_ADDR" },
- { R200_VS_UCP_ADDR, "R200_VS_UCP_ADDR" },
- { R200_VS_PNT_SPRITE_VPORT_SCALE, "R200_VS_PNT_SPRITE_VPORT_SCALE" },
- { R200_VS_MATRIX_0_MV, "R200_VS_MATRIX_0_MV" },
- { R200_VS_MATRIX_1_INV_MV, "R200_VS_MATRIX_1_INV_MV" },
- { R200_VS_MATRIX_2_MVP, "R200_VS_MATRIX_2_MVP" },
- { R200_VS_MATRIX_3_TEX0, "R200_VS_MATRIX_3_TEX0" },
- { R200_VS_MATRIX_4_TEX1, "R200_VS_MATRIX_4_TEX1" },
- { R200_VS_MATRIX_5_TEX2, "R200_VS_MATRIX_5_TEX2" },
- { R200_VS_MATRIX_6_TEX3, "R200_VS_MATRIX_6_TEX3" },
- { R200_VS_MATRIX_7_TEX4, "R200_VS_MATRIX_7_TEX4" },
- { R200_VS_MATRIX_8_TEX5, "R200_VS_MATRIX_8_TEX5" },
- { R200_VS_MAT_0_EMISS, "R200_VS_MAT_0_EMISS" },
- { R200_VS_MAT_0_AMB, "R200_VS_MAT_0_AMB" },
- { R200_VS_MAT_0_DIF, "R200_VS_MAT_0_DIF" },
- { R200_VS_MAT_0_SPEC, "R200_VS_MAT_0_SPEC" },
- { R200_VS_MAT_1_EMISS, "R200_VS_MAT_1_EMISS" },
- { R200_VS_MAT_1_AMB, "R200_VS_MAT_1_AMB" },
- { R200_VS_MAT_1_DIF, "R200_VS_MAT_1_DIF" },
- { R200_VS_MAT_1_SPEC, "R200_VS_MAT_1_SPEC" },
- { R200_VS_EYE2CLIP_MTX, "R200_VS_EYE2CLIP_MTX" },
- { R200_VS_PNT_SPRITE_ATT_CONST, "R200_VS_PNT_SPRITE_ATT_CONST" },
- { R200_VS_PNT_SPRITE_EYE_IN_MODEL, "R200_VS_PNT_SPRITE_EYE_IN_MODEL" },
- { R200_VS_PNT_SPRITE_CLAMP, "R200_VS_PNT_SPRITE_CLAMP" },
- { R200_VS_MAX, "R200_VS_MAX" },
- { 1000, "" },
-};
-
-union fi { float f; int i; };
-
-#define ISVEC 1
-#define ISFLOAT 2
-#define TOUCHED 4
-
-struct reg {
- int idx;
- struct reg_names *closest;
- int flags;
- union fi current;
- union fi *values;
- int nvalues;
- int nalloc;
- float vmin, vmax;
-};
-
-
-static struct reg regs[Elements(reg_names)+1];
-static struct reg scalars[512+1];
-static struct reg vectors[512*4+1];
-
-static int total, total_changed, bufs;
-
-static void init_regs( void )
-{
- struct reg_names *tmp;
- int i;
-
- for (i = 0 ; i < Elements(regs) ; i++) {
- regs[i].idx = reg_names[i].idx;
- regs[i].closest = &reg_names[i];
- regs[i].flags = 0;
- }
-
- for (i = 0, tmp = scalar_names ; i < Elements(scalars) ; i++) {
- if (tmp[1].idx == i) tmp++;
- scalars[i].idx = i;
- scalars[i].closest = tmp;
- scalars[i].flags = ISFLOAT;
- }
-
- for (i = 0, tmp = vector_names ; i < Elements(vectors) ; i++) {
- if (tmp[1].idx*4 == i) tmp++;
- vectors[i].idx = i;
- vectors[i].closest = tmp;
- vectors[i].flags = ISFLOAT|ISVEC;
- }
-
- regs[Elements(regs)-1].idx = -1;
- scalars[Elements(scalars)-1].idx = -1;
- vectors[Elements(vectors)-1].idx = -1;
-}
-
-static int find_or_add_value( struct reg *reg, int val )
-{
- int j;
-
- for ( j = 0 ; j < reg->nvalues ; j++)
- if ( val == reg->values[j].i )
- return 1;
-
- if (j == reg->nalloc) {
- reg->nalloc += 5;
- reg->nalloc *= 2;
- reg->values = (union fi *) realloc( reg->values,
- reg->nalloc * sizeof(union fi) );
- }
-
- reg->values[reg->nvalues++].i = val;
- return 0;
-}
-
-static struct reg *lookup_reg( struct reg *tab, int reg )
-{
- int i;
-
- for (i = 0 ; tab[i].idx != -1 ; i++) {
- if (tab[i].idx == reg)
- return &tab[i];
- }
-
- fprintf(stderr, "*** unknown reg 0x%x\n", reg);
- return NULL;
-}
-
-
-static const char *get_reg_name( struct reg *reg )
-{
- static char tmp[80];
-
- if (reg->idx == reg->closest->idx)
- return reg->closest->name;
-
-
- if (reg->flags & ISVEC) {
- if (reg->idx/4 != reg->closest->idx)
- sprintf(tmp, "%s+%d[%d]",
- reg->closest->name,
- (reg->idx/4) - reg->closest->idx,
- reg->idx%4);
- else
- sprintf(tmp, "%s[%d]", reg->closest->name, reg->idx%4);
- }
- else {
- if (reg->idx != reg->closest->idx)
- sprintf(tmp, "%s+%d", reg->closest->name, reg->idx - reg->closest->idx);
- else
- sprintf(tmp, "%s", reg->closest->name);
- }
-
- return tmp;
-}
-
-static int print_int_reg_assignment( struct reg *reg, int data )
-{
- int changed = (reg->current.i != data);
- int ever_seen = find_or_add_value( reg, data );
-
- if (VERBOSE || (NORMAL && (changed || !ever_seen)))
- fprintf(stderr, " %s <-- 0x%x", get_reg_name(reg), data);
-
- if (NORMAL) {
- if (!ever_seen)
- fprintf(stderr, " *** BRAND NEW VALUE");
- else if (changed)
- fprintf(stderr, " *** CHANGED");
- }
-
- reg->current.i = data;
-
- if (VERBOSE || (NORMAL && (changed || !ever_seen)))
- fprintf(stderr, "\n");
-
- return changed;
-}
-
-
-static int print_float_reg_assignment( struct reg *reg, float data )
-{
- int changed = (reg->current.f != data);
- int newmin = (data < reg->vmin);
- int newmax = (data > reg->vmax);
-
- if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
- fprintf(stderr, " %s <-- %.3f", get_reg_name(reg), data);
-
- if (NORMAL) {
- if (newmin) {
- fprintf(stderr, " *** NEW MIN (prev %.3f)", reg->vmin);
- reg->vmin = data;
- }
- else if (newmax) {
- fprintf(stderr, " *** NEW MAX (prev %.3f)", reg->vmax);
- reg->vmax = data;
- }
- else if (changed) {
- fprintf(stderr, " *** CHANGED");
- }
- }
-
- reg->current.f = data;
-
- if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
- fprintf(stderr, "\n");
-
- return changed;
-}
-
-static int print_reg_assignment( struct reg *reg, int data )
-{
- reg->flags |= TOUCHED;
- if (reg->flags & ISFLOAT)
- return print_float_reg_assignment( reg, *(float *)&data );
- else
- return print_int_reg_assignment( reg, data );
-}
-
-static void print_reg( struct reg *reg )
-{
- if (reg->flags & TOUCHED) {
- if (reg->flags & ISFLOAT) {
- fprintf(stderr, " %s == %f\n", get_reg_name(reg), reg->current.f);
- } else {
- fprintf(stderr, " %s == 0x%x\n", get_reg_name(reg), reg->current.i);
- }
- }
-}
-
-
-static void dump_state( void )
-{
- int i;
-
- for (i = 0 ; i < Elements(regs) ; i++)
- print_reg( &regs[i] );
-
- for (i = 0 ; i < Elements(scalars) ; i++)
- print_reg( &scalars[i] );
-
- for (i = 0 ; i < Elements(vectors) ; i++)
- print_reg( &vectors[i] );
-}
-
-
-
-static int radeon_emit_packets(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int id = (int)header.packet.packet_id;
- int sz = packet[id].len;
- int *data = (int *)cmdbuf->buf;
- int i;
-
- if (sz * sizeof(int) > cmdbuf->bufsz) {
- fprintf(stderr, "Packet overflows cmdbuf\n");
- return -EINVAL;
- }
-
- if (!packet[id].name) {
- fprintf(stderr, "*** Unknown packet 0 nr %d\n", id );
- return -EINVAL;
- }
-
-
- if (VERBOSE)
- fprintf(stderr, "Packet 0 reg %s nr %d\n", packet[id].name, sz );
-
- for ( i = 0 ; i < sz ; i++) {
- struct reg *reg = lookup_reg( regs, packet[id].start + i*4 );
- if (print_reg_assignment( reg, data[i] ))
- total_changed++;
- total++;
- }
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-
-static int radeon_emit_scalars(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int sz = header.scalars.count;
- int *data = (int *)cmdbuf->buf;
- int start = header.scalars.offset;
- int stride = header.scalars.stride;
- int i;
-
- if (VERBOSE)
- fprintf(stderr, "emit scalars, start %d stride %d nr %d (end %d)\n",
- start, stride, sz, start + stride * sz);
-
-
- for (i = 0 ; i < sz ; i++, start += stride) {
- struct reg *reg = lookup_reg( scalars, start );
- if (print_reg_assignment( reg, data[i] ))
- total_changed++;
- total++;
- }
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-
-static int radeon_emit_scalars2(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int sz = header.scalars.count;
- int *data = (int *)cmdbuf->buf;
- int start = header.scalars.offset + 0x100;
- int stride = header.scalars.stride;
- int i;
-
- if (VERBOSE)
- fprintf(stderr, "emit scalars2, start %d stride %d nr %d (end %d)\n",
- start, stride, sz, start + stride * sz);
-
- if (start + stride * sz > 258) {
- fprintf(stderr, "emit scalars OVERFLOW %d/%d/%d\n", start, stride, sz);
- return -1;
- }
-
- for (i = 0 ; i < sz ; i++, start += stride) {
- struct reg *reg = lookup_reg( scalars, start );
- if (print_reg_assignment( reg, data[i] ))
- total_changed++;
- total++;
- }
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-/* Check: inf/nan/extreme-size?
- * Check: table start, end, nr, etc.
- */
-static int radeon_emit_vectors(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int sz = header.vectors.count;
- int *data = (int *)cmdbuf->buf;
- int start = header.vectors.offset;
- int stride = header.vectors.stride;
- int i,j;
-
- if (VERBOSE)
- fprintf(stderr, "emit vectors, start %d stride %d nr %d (end %d) (0x%x)\n",
- start, stride, sz, start + stride * sz, header.i);
-
-/* if (start + stride * (sz/4) > 128) { */
-/* fprintf(stderr, "emit vectors OVERFLOW %d/%d/%d\n", start, stride, sz); */
-/* return -1; */
-/* } */
-
- for (i = 0 ; i < sz ; start += stride) {
- int changed = 0;
- for (j = 0 ; j < 4 ; i++,j++) {
- struct reg *reg = lookup_reg( vectors, start*4+j );
- if (print_reg_assignment( reg, data[i] ))
- changed = 1;
- }
- if (changed)
- total_changed += 4;
- total += 4;
- }
-
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-#if 0
-static int print_vertex_format( int vfmt )
-{
- if (NORMAL) {
- fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- "vertex format",
- vfmt,
- "xy,",
- (vfmt & R200_VTX_Z0) ? "z," : "",
- (vfmt & R200_VTX_W0) ? "w0," : "",
- (vfmt & R200_VTX_FPCOLOR) ? "fpcolor," : "",
- (vfmt & R200_VTX_FPALPHA) ? "fpalpha," : "",
- (vfmt & R200_VTX_PKCOLOR) ? "pkcolor," : "",
- (vfmt & R200_VTX_FPSPEC) ? "fpspec," : "",
- (vfmt & R200_VTX_FPFOG) ? "fpfog," : "",
- (vfmt & R200_VTX_PKSPEC) ? "pkspec," : "",
- (vfmt & R200_VTX_ST0) ? "st0," : "",
- (vfmt & R200_VTX_ST1) ? "st1," : "",
- (vfmt & R200_VTX_Q1) ? "q1," : "",
- (vfmt & R200_VTX_ST2) ? "st2," : "",
- (vfmt & R200_VTX_Q2) ? "q2," : "",
- (vfmt & R200_VTX_ST3) ? "st3," : "",
- (vfmt & R200_VTX_Q3) ? "q3," : "",
- (vfmt & R200_VTX_Q0) ? "q0," : "",
- (vfmt & R200_VTX_N0) ? "n0," : "",
- (vfmt & R200_VTX_XY1) ? "xy1," : "",
- (vfmt & R200_VTX_Z1) ? "z1," : "",
- (vfmt & R200_VTX_W1) ? "w1," : "",
- (vfmt & R200_VTX_N1) ? "n1," : "");
-
-
- if (!find_or_add_value( &others[V_VTXFMT], vfmt ))
- fprintf(stderr, " *** NEW VALUE");
-
- fprintf(stderr, "\n");
- }
-
- return 0;
-}
-#endif
-
-static char *primname[0x10] = {
- "NONE",
- "POINTS",
- "LINES",
- "LINE_STRIP",
- "TRIANGLES",
- "TRIANGLE_FAN",
- "TRIANGLE_STRIP",
- "RECT_LIST",
- NULL,
- "3VRT_POINTS",
- "3VRT_LINES",
- "POINT_SPRITES",
- "LINE_LOOP",
- "QUADS",
- "QUAD_STRIP",
- "POLYGON",
-};
-
-static int print_prim_and_flags( int prim )
-{
- int numverts;
-
- if (NORMAL)
- fprintf(stderr, " %s(%x): %s%s%s%s%s%s\n",
- "prim flags",
- prim,
- ((prim & 0x30) == R200_VF_PRIM_WALK_IND) ? "IND," : "",
- ((prim & 0x30) == R200_VF_PRIM_WALK_LIST) ? "LIST," : "",
- ((prim & 0x30) == R200_VF_PRIM_WALK_RING) ? "RING," : "",
- (prim & R200_VF_COLOR_ORDER_RGBA) ? "RGBA," : "BGRA, ",
- (prim & R200_VF_INDEX_SZ_4) ? "INDX-32," : "",
- (prim & R200_VF_TCL_OUTPUT_VTX_ENABLE) ? "TCL_OUT_VTX," : "");
-
- numverts = prim>>16;
-
- if (NORMAL)
- fprintf(stderr, " prim: %s numverts %d\n", primname[prim&0xf], numverts);
-
- switch (prim & 0xf) {
- case R200_VF_PRIM_NONE:
- case R200_VF_PRIM_POINTS:
- if (numverts < 1) {
- fprintf(stderr, "Bad nr verts for line %d\n", numverts);
- return -1;
- }
- break;
- case R200_VF_PRIM_LINES:
- case R200_VF_PRIM_POINT_SPRITES:
- if ((numverts & 1) || numverts == 0) {
- fprintf(stderr, "Bad nr verts for line %d\n", numverts);
- return -1;
- }
- break;
- case R200_VF_PRIM_LINE_STRIP:
- case R200_VF_PRIM_LINE_LOOP:
- if (numverts < 2) {
- fprintf(stderr, "Bad nr verts for line_strip %d\n", numverts);
- return -1;
- }
- break;
- case R200_VF_PRIM_TRIANGLES:
- case R200_VF_PRIM_3VRT_POINTS:
- case R200_VF_PRIM_3VRT_LINES:
- case R200_VF_PRIM_RECT_LIST:
- if (numverts % 3 || numverts == 0) {
- fprintf(stderr, "Bad nr verts for tri %d\n", numverts);
- return -1;
- }
- break;
- case R200_VF_PRIM_TRIANGLE_FAN:
- case R200_VF_PRIM_TRIANGLE_STRIP:
- case R200_VF_PRIM_POLYGON:
- if (numverts < 3) {
- fprintf(stderr, "Bad nr verts for strip/fan %d\n", numverts);
- return -1;
- }
- break;
- case R200_VF_PRIM_QUADS:
- if (numverts % 4 || numverts == 0) {
- fprintf(stderr, "Bad nr verts for quad %d\n", numverts);
- return -1;
- }
- break;
- case R200_VF_PRIM_QUAD_STRIP:
- if (numverts % 2 || numverts < 4) {
- fprintf(stderr, "Bad nr verts for quadstrip %d\n", numverts);
- return -1;
- }
- break;
- default:
- fprintf(stderr, "Bad primitive\n");
- return -1;
- }
- return 0;
-}
-
-/* build in knowledge about each packet type
- */
-static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int cmdsz;
- int *cmd = (int *)cmdbuf->buf;
- int *tmp;
- int i, stride, size, start;
-
- cmdsz = 2 + ((cmd[0] & RADEON_CP_PACKET_COUNT_MASK) >> 16);
-
- if ((cmd[0] & RADEON_CP_PACKET_MASK) != RADEON_CP_PACKET3 ||
- cmdsz * 4 > cmdbuf->bufsz ||
- cmdsz > RADEON_CP_PACKET_MAX_DWORDS) {
- fprintf(stderr, "Bad packet\n");
- return -EINVAL;
- }
-
- switch( cmd[0] & ~RADEON_CP_PACKET_COUNT_MASK ) {
- case R200_CP_CMD_NOP:
- if (NORMAL)
- fprintf(stderr, "PACKET3_NOP, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_NEXT_CHAR:
- if (NORMAL)
- fprintf(stderr, "PACKET3_NEXT_CHAR, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_PLY_NEXTSCAN:
- if (NORMAL)
- fprintf(stderr, "PACKET3_PLY_NEXTSCAN, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_SET_SCISSORS:
- if (NORMAL)
- fprintf(stderr, "PACKET3_SET_SCISSORS, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_LOAD_MICROCODE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_LOAD_MICROCODE, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_WAIT_FOR_IDLE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_WAIT_FOR_IDLE, %d dwords\n", cmdsz);
- break;
-
- case R200_CP_CMD_3D_DRAW_VBUF:
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_DRAW_VBUF, %d dwords\n", cmdsz);
-/* print_vertex_format(cmd[1]); */
- if (print_prim_and_flags(cmd[2]))
- return -EINVAL;
- break;
-
- case R200_CP_CMD_3D_DRAW_IMMD:
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_DRAW_IMMD, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_3D_DRAW_INDX: {
- int neltdwords;
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_DRAW_INDX, %d dwords\n", cmdsz);
-/* print_vertex_format(cmd[1]); */
- if (print_prim_and_flags(cmd[2]))
- return -EINVAL;
- neltdwords = cmd[2]>>16;
- neltdwords += neltdwords & 1;
- neltdwords /= 2;
- if (neltdwords + 3 != cmdsz)
- fprintf(stderr, "Mismatch in DRAW_INDX, %d vs cmdsz %d\n",
- neltdwords, cmdsz);
- break;
- }
- case R200_CP_CMD_LOAD_PALETTE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_LOAD_PALETTE, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_3D_LOAD_VBPNTR:
- if (NORMAL) {
- fprintf(stderr, "PACKET3_3D_LOAD_VBPNTR, %d dwords\n", cmdsz);
- fprintf(stderr, " nr arrays: %d\n", cmd[1]);
- }
-
- if (((cmd[1]/2)*3) + ((cmd[1]%2)*2) != cmdsz - 2) {
- fprintf(stderr, " ****** MISMATCH %d/%d *******\n",
- ((cmd[1]/2)*3) + ((cmd[1]%2)*2) + 2, cmdsz);
- return -EINVAL;
- }
-
- if (NORMAL) {
- tmp = cmd+2;
- for (i = 0 ; i < cmd[1] ; i++) {
- if (i & 1) {
- stride = (tmp[0]>>24) & 0xff;
- size = (tmp[0]>>16) & 0xff;
- start = tmp[2];
- tmp += 3;
- }
- else {
- stride = (tmp[0]>>8) & 0xff;
- size = (tmp[0]) & 0xff;
- start = tmp[1];
- }
- fprintf(stderr, " array %d: start 0x%x vsize %d vstride %d\n",
- i, start, size, stride );
- }
- }
- break;
- case R200_CP_CMD_PAINT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_PAINT, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_BITBLT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_BITBLT, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_SMALLTEXT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_SMALLTEXT, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_HOSTDATA_BLT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
- cmdsz);
- break;
- case R200_CP_CMD_POLYLINE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_POLYLINE, %d dwords\n", cmdsz);
- break;
- case R200_CP_CMD_POLYSCANLINES:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
- cmdsz);
- break;
- case R200_CP_CMD_PAINT_MULTI:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
- cmdsz);
- break;
- case R200_CP_CMD_BITBLT_MULTI:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
- cmdsz);
- break;
- case R200_CP_CMD_TRANS_BITBLT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
- cmdsz);
- break;
- case R200_CP_CMD_3D_DRAW_VBUF_2:
- if (NORMAL)
- fprintf(stderr, "R200_CP_CMD_3D_DRAW_VBUF_2, %d dwords\n",
- cmdsz);
- if (print_prim_and_flags(cmd[1]))
- return -EINVAL;
- break;
- case R200_CP_CMD_3D_DRAW_IMMD_2:
- if (NORMAL)
- fprintf(stderr, "R200_CP_CMD_3D_DRAW_IMMD_2, %d dwords\n",
- cmdsz);
- if (print_prim_and_flags(cmd[1]))
- return -EINVAL;
- break;
- case R200_CP_CMD_3D_DRAW_INDX_2:
- if (NORMAL)
- fprintf(stderr, "R200_CP_CMD_3D_DRAW_INDX_2, %d dwords\n",
- cmdsz);
- if (print_prim_and_flags(cmd[1]))
- return -EINVAL;
- break;
- default:
- fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz);
- break;
- }
-
- cmdbuf->buf += cmdsz * 4;
- cmdbuf->bufsz -= cmdsz * 4;
- return 0;
-}
-
-
-/* Check cliprects for bounds, then pass on to above:
- */
-static int radeon_emit_packet3_cliprect( drm_radeon_cmd_buffer_t *cmdbuf )
-{
- drm_clip_rect_t *boxes = (drm_clip_rect_t *)cmdbuf->boxes;
- int i = 0;
-
- if (VERBOSE && total_changed) {
- dump_state();
- total_changed = 0;
- }
-
- if (NORMAL) {
- do {
- if ( i < cmdbuf->nbox ) {
- fprintf(stderr, "Emit box %d/%d %d,%d %d,%d\n",
- i, cmdbuf->nbox,
- boxes[i].x1, boxes[i].y1, boxes[i].x2, boxes[i].y2);
- }
- } while ( ++i < cmdbuf->nbox );
- }
-
- if (cmdbuf->nbox == 1)
- cmdbuf->nbox = 0;
-
- return radeon_emit_packet3( cmdbuf );
-}
-
-
-int r200SanityCmdBuffer( r200ContextPtr rmesa,
- int nbox,
- drm_clip_rect_t *boxes )
-{
- int idx;
- drm_radeon_cmd_buffer_t cmdbuf;
- drm_radeon_cmd_header_t header;
- static int inited = 0;
-
- if (!inited) {
- init_regs();
- inited = 1;
- }
-
-
- cmdbuf.buf = rmesa->store.cmd_buf;
- cmdbuf.bufsz = rmesa->store.cmd_used;
- cmdbuf.boxes = (drm_clip_rect_t *)boxes;
- cmdbuf.nbox = nbox;
-
- while ( cmdbuf.bufsz >= sizeof(header) ) {
-
- header.i = *(int *)cmdbuf.buf;
- cmdbuf.buf += sizeof(header);
- cmdbuf.bufsz -= sizeof(header);
-
- switch (header.header.cmd_type) {
- case RADEON_CMD_PACKET:
- if (radeon_emit_packets( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_packets failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_SCALARS:
- if (radeon_emit_scalars( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_scalars failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_SCALARS2:
- if (radeon_emit_scalars2( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_scalars failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_VECTORS:
- if (radeon_emit_vectors( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_vectors failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_DMA_DISCARD:
- idx = header.dma.buf_idx;
- if (NORMAL)
- fprintf(stderr, "RADEON_CMD_DMA_DISCARD buf %d\n", idx);
- bufs++;
- break;
-
- case RADEON_CMD_PACKET3:
- if (radeon_emit_packet3( &cmdbuf )) {
- fprintf(stderr,"radeon_emit_packet3 failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_PACKET3_CLIP:
- if (radeon_emit_packet3_cliprect( &cmdbuf )) {
- fprintf(stderr,"radeon_emit_packet3_clip failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_WAIT:
- break;
-
- default:
- fprintf(stderr,"bad cmd_type %d at %p\n",
- header.header.cmd_type,
- cmdbuf.buf - sizeof(header));
- return -EINVAL;
- }
- }
-
- if (0)
- {
- static int n = 0;
- n++;
- if (n == 10) {
- fprintf(stderr, "Bufs %d Total emitted %d real changes %d (%.2f%%)\n",
- bufs,
- total, total_changed,
- ((float)total_changed/(float)total*100.0));
- fprintf(stderr, "Total emitted per buf: %.2f\n",
- (float)total/(float)bufs);
- fprintf(stderr, "Real changes per buf: %.2f\n",
- (float)total_changed/(float)bufs);
-
- bufs = n = total = total_changed = 0;
- }
- }
-
- fprintf(stderr, "leaving %s\n\n\n", __FUNCTION__);
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.h
deleted file mode 100644
index f4c110dba..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_sanity.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef R200_SANITY_H
-#define R200_SANITY_H
-
-extern int r200SanityCmdBuffer( r200ContextPtr rmesa,
- int nbox,
- drm_clip_rect_t *boxes );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.c
deleted file mode 100644
index 08e4a3548..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.c
+++ /dev/null
@@ -1,737 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_screen.c,v 1.4 2003/05/08 09:25:35 herrb Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/**
- * \file r200_screen.c
- * Screen initialization functions for the R200 driver.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <dlfcn.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#define STANDALONE_MMIO
-#include "r200_screen.h"
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_span.h"
-#include "radeon_macros.h"
-#include "radeon_reg.h"
-
-#include "drirenderbuffer.h"
-#include "utils.h"
-#include "vblank.h"
-#include "GL/internal/dri_interface.h"
-
-/* R200 configuration
- */
-#include "xmlpool.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_MAX_TEXTURE_UNITS(4,2,6)
- DRI_CONF_HYPERZ(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_DEF_MAX_ANISOTROPY(1.0,"1.0,2.0,4.0,8.0,16.0")
- DRI_CONF_NO_NEG_LOD_BIAS(false)
- DRI_CONF_FORCE_S3TC_ENABLE(false)
- DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
- DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
- DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
- DRI_CONF_TEXTURE_LEVEL_HACK(false)
- DRI_CONF_TEXTURE_BLEND_QUALITY(1.0,"0.0:1.0")
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_SOFTWARE
- DRI_CONF_ARB_VERTEX_PROGRAM(false)
- DRI_CONF_NV_VERTEX_PROGRAM(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driNConfigOptions = 17;
-
-extern const struct dri_extension card_extensions[];
-extern const struct dri_extension blend_extensions[];
-extern const struct dri_extension ARB_vp_extension[];
-extern const struct dri_extension NV_vp_extension[];
-
-#if 1
-/* Including xf86PciInfo.h introduces a bunch of errors...
- */
-#define PCI_CHIP_R200_QD 0x5144 /* why do they have r200 names? */
-#define PCI_CHIP_R200_QE 0x5145 /* Those are all standard radeons */
-#define PCI_CHIP_R200_QF 0x5146
-#define PCI_CHIP_R200_QG 0x5147
-#define PCI_CHIP_R200_QY 0x5159
-#define PCI_CHIP_R200_QZ 0x515A
-#define PCI_CHIP_R200_LW 0x4C57
-#define PCI_CHIP_R200_LX 0x4C58
-#define PCI_CHIP_R200_LY 0x4C59
-#define PCI_CHIP_R200_LZ 0x4C5A
-#define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */
-#define PCI_CHIP_RV200_QX 0x5158
-#define PCI_CHIP_RS100_4136 0x4136 /* IGP RS100, RS200, RS250 are not R200 */
-#define PCI_CHIP_RS200_4137 0x4137
-#define PCI_CHIP_RS250_4237 0x4237
-#define PCI_CHIP_RS100_4336 0x4336
-#define PCI_CHIP_RS200_4337 0x4337
-#define PCI_CHIP_RS250_4437 0x4437
-#define PCI_CHIP_RS300_5834 0x5834 /* All RS300's are R200 */
-#define PCI_CHIP_RS300_5835 0x5835
-#define PCI_CHIP_RS300_5836 0x5836
-#define PCI_CHIP_RS300_5837 0x5837
-#define PCI_CHIP_R200_BB 0x4242 /* r200 (non-derived) start */
-#define PCI_CHIP_R200_BC 0x4243
-#define PCI_CHIP_R200_QH 0x5148
-#define PCI_CHIP_R200_QI 0x5149
-#define PCI_CHIP_R200_QJ 0x514A
-#define PCI_CHIP_R200_QK 0x514B
-#define PCI_CHIP_R200_QL 0x514C
-#define PCI_CHIP_R200_QM 0x514D
-#define PCI_CHIP_R200_QN 0x514E
-#define PCI_CHIP_R200_QO 0x514F /* r200 (non-derived) end */
-/* are the R200 Qh (0x5168) and following needed too? They are not in
- xf86PciInfo.h but in the pci database. Maybe just secondary ports or
- something ? Ah well, better be safe than sorry */
-#define PCI_CHIP_R200_Qh 0x5168
-#define PCI_CHIP_R200_Qi 0x5169
-#define PCI_CHIP_R200_Qj 0x516A
-#define PCI_CHIP_R200_Qk 0x516B
-#define PCI_CHIP_R200_Ql 0x516C
-
-#endif
-
-
-static r200ScreenPtr __r200Screen;
-
-static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
-
-static __GLcontextModes *
-r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/* Create the device specific screen private data struct.
- */
-static r200ScreenPtr
-r200CreateScreen( __DRIscreenPrivate *sPriv )
-{
- r200ScreenPtr screen;
- RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
- unsigned char *RADEONMMIO;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- screen = (r200ScreenPtr) CALLOC( sizeof(*screen) );
- if ( !screen ) {
- __driUtilMessage("%s: Could not allocate memory for screen structure",
- __FUNCTION__);
- return NULL;
- }
-
- screen->chipset = 0;
- switch ( dri_priv->deviceID ) {
- case PCI_CHIP_R200_QD:
- case PCI_CHIP_R200_QE:
- case PCI_CHIP_R200_QF:
- case PCI_CHIP_R200_QG:
- case PCI_CHIP_R200_QY:
- case PCI_CHIP_R200_QZ:
- case PCI_CHIP_RV200_QW:
- case PCI_CHIP_RV200_QX:
- case PCI_CHIP_R200_LW:
- case PCI_CHIP_R200_LX:
- case PCI_CHIP_R200_LY:
- case PCI_CHIP_R200_LZ:
- case PCI_CHIP_RS100_4136:
- case PCI_CHIP_RS200_4137:
- case PCI_CHIP_RS250_4237:
- case PCI_CHIP_RS100_4336:
- case PCI_CHIP_RS200_4337:
- case PCI_CHIP_RS250_4437:
- __driUtilMessage("r200CreateScreen(): Device isn't an r200!\n");
- FREE( screen );
- return NULL;
-
- case PCI_CHIP_RS300_5834:
- case PCI_CHIP_RS300_5835:
- case PCI_CHIP_RS300_5836:
- case PCI_CHIP_RS300_5837:
- break;
-
- case PCI_CHIP_R200_BB:
- case PCI_CHIP_R200_BC:
- case PCI_CHIP_R200_QH:
- case PCI_CHIP_R200_QI:
- case PCI_CHIP_R200_QJ:
- case PCI_CHIP_R200_QK:
- case PCI_CHIP_R200_QL:
- case PCI_CHIP_R200_QM:
- case PCI_CHIP_R200_QN:
- case PCI_CHIP_R200_QO:
- case PCI_CHIP_R200_Qh:
- case PCI_CHIP_R200_Qi:
- case PCI_CHIP_R200_Qj:
- case PCI_CHIP_R200_Qk:
- case PCI_CHIP_R200_Ql:
- screen->chipset |= R200_CHIPSET_REAL_R200;
- /* fallthrough */
- default:
- screen->chipset |= R200_CHIPSET_TCL;
- break;
- }
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&screen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- /* This is first since which regions we map depends on whether or
- * not we are using a PCI card.
- */
- screen->IsPCI = dri_priv->IsPCI;
-
- {
- int ret;
- drm_radeon_getparam_t gp;
-
- gp.param = RADEON_PARAM_GART_BUFFER_OFFSET;
- gp.value = &screen->gart_buffer_offset;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE( screen );
- fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_GART_BUFFER_OFFSET): %d\n", ret);
- return NULL;
- }
-
- if (sPriv->drmMinor >= 6) {
- gp.param = RADEON_PARAM_GART_BASE;
- gp.value = &screen->gart_base;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE( screen );
- fprintf(stderr, "drmR200GetParam (RADEON_PARAM_GART_BASE): %d\n", ret);
- return NULL;
- }
-
-
- gp.param = RADEON_PARAM_IRQ_NR;
- gp.value = &screen->irq;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE( screen );
- fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_IRQ_NR): %d\n", ret);
- return NULL;
- }
-
- /* Check if kernel module is new enough to support cube maps */
- screen->drmSupportsCubeMaps = (sPriv->drmMinor >= 7);
- /* Check if kernel module is new enough to support blend color and
- separate blend functions/equations */
- screen->drmSupportsBlendColor = (sPriv->drmMinor >= 11);
-
- screen->drmSupportsTriPerf = (sPriv->drmMinor >= 16);
- }
- /* Check if ddx has set up a surface reg to cover depth buffer */
- screen->depthHasSurface = (sPriv->ddxMajor > 4);
- }
-
- screen->mmio.handle = dri_priv->registerHandle;
- screen->mmio.size = dri_priv->registerSize;
- if ( drmMap( sPriv->fd,
- screen->mmio.handle,
- screen->mmio.size,
- &screen->mmio.map ) ) {
- FREE( screen );
- __driUtilMessage("%s: drmMap failed\n", __FUNCTION__ );
- return NULL;
- }
-
- RADEONMMIO = screen->mmio.map;
-
- screen->status.handle = dri_priv->statusHandle;
- screen->status.size = dri_priv->statusSize;
- if ( drmMap( sPriv->fd,
- screen->status.handle,
- screen->status.size,
- &screen->status.map ) ) {
- drmUnmap( screen->mmio.map, screen->mmio.size );
- FREE( screen );
- __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ );
- return NULL;
- }
- screen->scratch = (__volatile__ u_int32_t *)
- ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET);
-
- screen->buffers = drmMapBufs( sPriv->fd );
- if ( !screen->buffers ) {
- drmUnmap( screen->status.map, screen->status.size );
- drmUnmap( screen->mmio.map, screen->mmio.size );
- FREE( screen );
- __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ );
- return NULL;
- }
-
- RADEONMMIO = screen->mmio.map;
-
- if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) {
-
- screen->gartTextures.handle = dri_priv->gartTexHandle;
- screen->gartTextures.size = dri_priv->gartTexMapSize;
- if ( drmMap( sPriv->fd,
- screen->gartTextures.handle,
- screen->gartTextures.size,
- (drmAddressPtr)&screen->gartTextures.map ) ) {
- drmUnmapBufs( screen->buffers );
- drmUnmap( screen->status.map, screen->status.size );
- drmUnmap( screen->mmio.map, screen->mmio.size );
- FREE( screen );
- __driUtilMessage("%s: drmMAP failed for GART texture area\n", __FUNCTION__);
- return NULL;
- }
-
- screen->gart_texture_offset = dri_priv->gartTexOffset + ( screen->IsPCI
- ? INREG( RADEON_AIC_LO_ADDR )
- : ( ( INREG( RADEON_MC_AGP_LOCATION ) & 0x0ffffU ) << 16 ) );
- }
-
- screen->cpp = dri_priv->bpp / 8;
- screen->AGPMode = dri_priv->AGPMode;
-
- screen->fbLocation = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff ) << 16;
-
- if ( sPriv->drmMinor >= 10 ) {
- drm_radeon_setparam_t sp;
-
- sp.param = RADEON_SETPARAM_FB_LOCATION;
- sp.value = screen->fbLocation;
-
- drmCommandWrite( sPriv->fd, DRM_RADEON_SETPARAM,
- &sp, sizeof( sp ) );
- }
-
- screen->frontOffset = dri_priv->frontOffset;
- screen->frontPitch = dri_priv->frontPitch;
- screen->backOffset = dri_priv->backOffset;
- screen->backPitch = dri_priv->backPitch;
- screen->depthOffset = dri_priv->depthOffset;
- screen->depthPitch = dri_priv->depthPitch;
-
- if ( dri_priv->textureSize == 0 ) {
- screen->texOffset[RADEON_LOCAL_TEX_HEAP] = screen->gart_texture_offset;
- screen->texSize[RADEON_GART_TEX_HEAP] = dri_priv->gartTexMapSize;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] =
- dri_priv->log2GARTTexGran;
- } else {
- screen->texOffset[RADEON_LOCAL_TEX_HEAP] = dri_priv->textureOffset
- + screen->fbLocation;
- screen->texSize[RADEON_LOCAL_TEX_HEAP] = dri_priv->textureSize;
- screen->logTexGranularity[RADEON_LOCAL_TEX_HEAP] =
- dri_priv->log2TexGran;
- }
-
- if ( !screen->gartTextures.map || dri_priv->textureSize == 0 ) {
- screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1;
- screen->texOffset[RADEON_GART_TEX_HEAP] = 0;
- screen->texSize[RADEON_GART_TEX_HEAP] = 0;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] = 0;
- } else {
- screen->numTexHeaps = RADEON_NR_TEX_HEAPS;
- screen->texOffset[RADEON_GART_TEX_HEAP] = screen->gart_texture_offset;
- screen->texSize[RADEON_GART_TEX_HEAP] = dri_priv->gartTexMapSize;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] =
- dri_priv->log2GARTTexGran;
- }
-
- screen->driScreen = sPriv;
- screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
-
- if ( glx_enable_extension != NULL ) {
- if ( screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
-
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
- }
-
- sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA;
- sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA;
- sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA;
-
- return screen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-static void
-r200DestroyScreen( __DRIscreenPrivate *sPriv )
-{
- r200ScreenPtr screen = (r200ScreenPtr)sPriv->private;
-
- if (!screen)
- return;
-
- if ( screen->gartTextures.map ) {
- drmUnmap( screen->gartTextures.map, screen->gartTextures.size );
- }
- drmUnmapBufs( screen->buffers );
- drmUnmap( screen->status.map, screen->status.size );
- drmUnmap( screen->mmio.map, screen->mmio.size );
-
- /* free all option information */
- driDestroyOptionInfo (&screen->optionCache);
-
- FREE( screen );
- sPriv->private = NULL;
-}
-
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-r200InitDriver( __DRIscreenPrivate *sPriv )
-{
- __r200Screen = r200CreateScreen( sPriv );
-
- sPriv->private = (void *) __r200Screen;
-
- return sPriv->private ? GL_TRUE : GL_FALSE;
-}
-
-
-/**
- * Create and initialize the Mesa and driver specific pixmap buffer
- * data. This is called to setup rendering to a particular window.
- *
- * \todo This function (and its interface) will need to be updated to support
- * pbuffers.
- */
-static GLboolean
-r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- r200ScreenPtr screen = (r200ScreenPtr) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- const GLboolean swDepth = GL_FALSE;
- const GLboolean swAlpha = GL_FALSE;
- const GLboolean swAccum = mesaVis->accumRedBits > 0;
- const GLboolean swStencil = mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24;
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- swDepth,
- swStencil,
- swAccum,
- swAlpha );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- r200SetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- r200SetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- r200SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- r200SetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- r200SetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- swDepth,
- swStencil,
- swAccum,
- swAlpha,
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-r200DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-
-
-static const struct __DriverAPIRec r200API = {
- .InitDriver = r200InitDriver,
- .DestroyScreen = r200DestroyScreen,
- .CreateContext = r200CreateContext,
- .DestroyContext = r200DestroyContext,
- .CreateBuffer = r200CreateBuffer,
- .DestroyBuffer = r200DestroyBuffer,
- .SwapBuffers = r200SwapBuffers,
- .MakeCurrent = r200MakeCurrent,
- .UnbindContext = r200UnbindContext,
- .GetSwapInfo = getSwapInfo,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 5, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions3( "R200",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &r200API);
- if ( psp != NULL ) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = r200FillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- driInitExtensions( NULL, blend_extensions, GL_FALSE );
- driInitSingleExtension( NULL, ARB_vp_extension );
- driInitSingleExtension( NULL, NV_vp_extension );
- }
-
- return (void *) psp;
-}
-
-
-/**
- * Get information about previous buffer swaps.
- */
-static int
-getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo )
-{
- r200ContextPtr rmesa;
-
- if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL)
- || (dPriv->driContextPriv->driverPrivate == NULL)
- || (sInfo == NULL) ) {
- return -1;
- }
-
- rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
- sInfo->swap_count = rmesa->swap_count;
- sInfo->swap_ust = rmesa->swap_ust;
- sInfo->swap_missed_count = rmesa->swap_missed_count;
-
- sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
- ? driCalculateSwapUsage( dPriv, 0, rmesa->swap_missed_ust )
- : 0.0;
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.h
deleted file mode 100644
index 91b43cbd7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_screen.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_screen.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_SCREEN_H__
-#define __R200_SCREEN_H__
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "radeon_drm.h"
-#include "dri_util.h"
-#include "xmlconfig.h"
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- drmAddress map; /* Mapping of the DRM region */
-} r200RegionRec, *r200RegionPtr;
-
-
-/* chipset features */
-#define R200_CHIPSET_TCL (1 << 0)
-#define R200_CHIPSET_REAL_R200 (1 << 1)
-#define R200_CHIPSET_YCBCR_BROKEN (1 << 2)
-
-
-#define R200_NR_TEX_HEAPS 2
-
-typedef struct {
-
- int chipset;
- int cpp;
- int IsPCI; /* Current card is a PCI card */
- int AGPMode;
- unsigned int irq; /* IRQ number (0 means none) */
-
- unsigned int fbLocation;
- unsigned int frontOffset;
- unsigned int frontPitch;
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- /* Shared texture data */
- int numTexHeaps;
- int texOffset[R200_NR_TEX_HEAPS];
- int texSize[R200_NR_TEX_HEAPS];
- int logTexGranularity[R200_NR_TEX_HEAPS];
-
- r200RegionRec mmio;
- r200RegionRec status;
- r200RegionRec gartTextures;
-
- drmBufMapPtr buffers;
-
- __volatile__ int32_t *scratch;
-
- __DRIscreenPrivate *driScreen;
- unsigned int sarea_priv_offset;
- unsigned int gart_buffer_offset; /* offset in card memory space */
- unsigned int gart_texture_offset; /* offset in card memory space */
- unsigned int gart_base;
-
- GLboolean drmSupportsCubeMaps; /* need radeon kernel module >=1.7 */
- GLboolean drmSupportsBlendColor; /* need radeon kernel module >= 1.11 */
- GLboolean drmSupportsTriPerf; /* need radeon kernel module >= 1.16 */
- GLboolean depthHasSurface;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} r200ScreenRec, *r200ScreenPtr;
-
-#endif /* __R200_SCREEN_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.c
deleted file mode 100644
index 024e89461..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "swrast/swrast.h"
-#include "colormac.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_state.h"
-#include "r200_span.h"
-#include "r200_tex.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- r200ScreenPtr r200Screen = rmesa->r200Screen; \
- __DRIscreenPrivate *sPriv = rmesa->dri.screen; \
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
- GLuint pitch = r200Screen->frontPitch * r200Screen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- rmesa->state.color.drawOffset + \
- (dPriv->x * r200Screen->cpp) + \
- (dPriv->y * pitch)); \
- char *read_buf = (char *)(sPriv->pFB + \
- rmesa->state.pixel.readOffset + \
- (dPriv->x * r200Screen->cpp) + \
- (dPriv->y * pitch)); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- r200ScreenPtr r200Screen = rmesa->r200Screen; \
- __DRIscreenPrivate *sPriv = rmesa->dri.screen; \
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
- GLuint height = dPriv->h; \
- GLuint xo = dPriv->x; \
- GLuint yo = dPriv->y; \
- char *buf = (char *)(sPriv->pFB + r200Screen->depthOffset); \
- (void) buf
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) r200##x##_RGB565
-#define TAG2(x,y) r200##x##_RGB565##y
-#include "spantmp2.h"
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) r200##x##_ARGB8888
-#define TAG2(x,y) r200##x##_ARGB8888##y
-#include "spantmp2.h"
-
-
-/* ================================================================
- * Depth buffer
- */
-
-/* The Radeon family has depth tiling on all the time, so we have to convert
- * the x,y coordinates into the memory bus address (mba) in the same
- * manner as the engine. In each case, the linear block address (ba)
- * is calculated, and then wired with x and y to produce the final
- * memory address.
- * The chip will do address translation on its own if the surface registers
- * are set up correctly. It is not quite enough to get it working with hyperz too...
- */
-
-#define BIT(x,b) ((x & (1<<b))>>b)
-static GLuint r200_mba_z32( r200ContextPtr rmesa,
- GLint x, GLint y )
-{
- GLuint pitch = rmesa->r200Screen->frontPitch;
- if (rmesa->r200Screen->depthHasSurface) {
- return 4*(x + y*pitch);
- }
- else {
- GLuint b = ((y & 0x7FF) >> 4) * ((pitch & 0xFFF) >> 5) + ((x & 0x7FF) >> 5);
- GLuint a =
- (BIT(x,0) << 2) |
- (BIT(y,0) << 3) |
- (BIT(x,1) << 4) |
- (BIT(y,1) << 5) |
- (BIT(x,3) << 6) |
- (BIT(x,4) << 7) |
- (BIT(x,2) << 8) |
- (BIT(y,2) << 9) |
- (BIT(y,3) << 10) |
- (((pitch & 0x20) ? (b & 0x01) : ((b & 0x01) ^ (BIT(y,4)))) << 11) |
- ((b >> 1) << 12);
- return a;
- }
-}
-
-static GLuint r200_mba_z16( r200ContextPtr rmesa, GLint x, GLint y )
-{
- GLuint pitch = rmesa->r200Screen->frontPitch;
- if (rmesa->r200Screen->depthHasSurface) {
- return 2*(x + y*pitch);
- }
- else {
- GLuint b = ((y & 0x7FF) >> 4) * ((pitch & 0xFFF) >> 6) + ((x & 0x7FF) >> 6);
- GLuint a =
- (BIT(x,0) << 1) |
- (BIT(y,0) << 2) |
- (BIT(x,1) << 3) |
- (BIT(y,1) << 4) |
- (BIT(x,2) << 5) |
- (BIT(x,4) << 6) |
- (BIT(x,5) << 7) |
- (BIT(x,3) << 8) |
- (BIT(y,2) << 9) |
- (BIT(y,3) << 10) |
- (((pitch & 0x40) ? (b & 0x01) : ((b & 0x01) ^ (BIT(y,4)))) << 11) |
- ((b >> 1) << 12);
- return a;
- }
-}
-
-
-/* 16-bit depth buffer functions
- */
-
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + r200_mba_z16( rmesa, _x + xo, _y + yo )) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + r200_mba_z16( rmesa, _x + xo, _y + yo ));
-
-#define TAG(x) r200##x##_16
-#include "depthtmp.h"
-
-
-/* 24 bit depth, 8 bit stencil depthbuffer functions
- */
-
-#define WRITE_DEPTH( _x, _y, d ) \
-do { \
- GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- tmp |= ((d) & 0x00ffffff); \
- *(GLuint *)(buf + offset) = tmp; \
-} while (0)
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + r200_mba_z32( rmesa, _x + xo, \
- _y + yo )) & 0x00ffffff;
-
-#define TAG(x) r200##x##_24_8
-#include "depthtmp.h"
-
-
-/* ================================================================
- * Stencil buffer
- */
-
-/* 24 bit depth, 8 bit stencil depthbuffer functions
- */
-#define WRITE_STENCIL( _x, _y, d ) \
-do { \
- GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0x00ffffff; \
- tmp |= (((d) & 0xff) << 24); \
- *(GLuint *)(buf + offset) = tmp; \
-} while (0)
-
-#define READ_STENCIL( d, _x, _y ) \
-do { \
- GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- d = tmp >> 24; \
-} while (0)
-
-#define TAG(x) r200##x##_24_8
-#include "stenciltmp.h"
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void r200SetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
- rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
- rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
- } else {
- rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
- rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
- }
- break;
- case BUFFER_BIT_BACK_LEFT:
- if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
- rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
- } else {
- rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
- rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
- rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
- }
- break;
- default:
- _mesa_problem(ctx, "Bad bufferBit in %s", __FUNCTION__);
- break;
- }
-}
-
-/* Move locking out to get reasonable span performance (10x better
- * than doing this in HW_LOCK above). WaitForIdle() is the main
- * culprit.
- */
-
-static void r200SpanRenderStart( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- R200_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
- r200WaitForIdleLocked( rmesa );
-
- /* Read & rewrite the first pixel in the frame buffer. This should
- * be a noop, right? In fact without this conform fails as reading
- * from the framebuffer sometimes produces old results -- the
- * on-card read cache gets mixed up and doesn't notice that the
- * framebuffer has been updated.
- *
- * In the worst case this is buggy too as p might get the wrong
- * value first time, so really need a hidden pixel somewhere for this.
- */
- {
- int p;
- volatile int *read_buf = (volatile int *)(rmesa->dri.screen->pFB +
- rmesa->state.pixel.readOffset);
- p = *read_buf;
- *read_buf = p;
- }
-}
-
-static void r200SpanRenderFinish( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( rmesa );
-}
-
-void r200InitSpanFuncs( GLcontext *ctx )
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = r200SetBuffer;
- swdd->SpanRenderStart = r200SpanRenderStart;
- swdd->SpanRenderFinish = r200SpanRenderFinish;
-}
-
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-r200SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- r200InitPointers_RGB565(&drb->Base);
- }
- else {
- r200InitPointers_ARGB8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = r200ReadDepthSpan_16;
- drb->Base.GetValues = r200ReadDepthPixels_16;
- drb->Base.PutRow = r200WriteDepthSpan_16;
- drb->Base.PutMonoRow = r200WriteMonoDepthSpan_16;
- drb->Base.PutValues = r200WriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = r200ReadDepthSpan_24_8;
- drb->Base.GetValues = r200ReadDepthPixels_24_8;
- drb->Base.PutRow = r200WriteDepthSpan_24_8;
- drb->Base.PutMonoRow = r200WriteMonoDepthSpan_24_8;
- drb->Base.PutValues = r200WriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = r200ReadStencilSpan_24_8;
- drb->Base.GetValues = r200ReadStencilPixels_24_8;
- drb->Base.PutRow = r200WriteStencilSpan_24_8;
- drb->Base.PutMonoRow = r200WriteMonoStencilSpan_24_8;
- drb->Base.PutValues = r200WriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.h
deleted file mode 100644
index 8b9909559..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_span.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_SPAN_H__
-#define __R200_SPAN_H__
-
-#include "drirenderbuffer.h"
-
-extern void r200InitSpanFuncs( GLcontext *ctx );
-
-extern void
-r200SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.c
deleted file mode 100644
index 9a116f108..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.c
+++ /dev/null
@@ -1,2383 +0,0 @@
-/* $XFree86$ */
-/**************************************************************************
-
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-#include "enums.h"
-#include "colormac.h"
-#include "light.h"
-#include "buffers.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "swrast_setup/swrast_setup.h"
-
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_state.h"
-#include "r200_tcl.h"
-#include "r200_tex.h"
-#include "r200_swtcl.h"
-#include "r200_vtxfmt.h"
-
-
-/* =============================================================
- * Alpha blending
- */
-
-static void r200AlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int pp_misc = rmesa->hw.ctx.cmd[CTX_PP_MISC];
- GLubyte refByte;
-
- CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
- R200_STATECHANGE( rmesa, ctx );
-
- pp_misc &= ~(R200_ALPHA_TEST_OP_MASK | R200_REF_ALPHA_MASK);
- pp_misc |= (refByte & R200_REF_ALPHA_MASK);
-
- switch ( func ) {
- case GL_NEVER:
- pp_misc |= R200_ALPHA_TEST_FAIL;
- break;
- case GL_LESS:
- pp_misc |= R200_ALPHA_TEST_LESS;
- break;
- case GL_EQUAL:
- pp_misc |= R200_ALPHA_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- pp_misc |= R200_ALPHA_TEST_LEQUAL;
- break;
- case GL_GREATER:
- pp_misc |= R200_ALPHA_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- pp_misc |= R200_ALPHA_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- pp_misc |= R200_ALPHA_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- pp_misc |= R200_ALPHA_TEST_PASS;
- break;
- }
-
- rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc;
-}
-
-static void r200BlendColor( GLcontext *ctx, const GLfloat cf[4] )
-{
- GLubyte color[4];
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- R200_STATECHANGE( rmesa, ctx );
- CLAMPED_FLOAT_TO_UBYTE(color[0], cf[0]);
- CLAMPED_FLOAT_TO_UBYTE(color[1], cf[1]);
- CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]);
- CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]);
- if (rmesa->r200Screen->drmSupportsBlendColor)
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCOLOR] = r200PackColor( 4, color[0], color[1], color[2], color[3] );
-}
-
-/**
- * Calculate the hardware blend factor setting. This same function is used
- * for source and destination of both alpha and RGB.
- *
- * \returns
- * The hardware register value for the specified blend factor. This value
- * will need to be shifted into the correct position for either source or
- * destination factor.
- *
- * \todo
- * Since the two cases where source and destination are handled differently
- * are essentially error cases, they should never happen. Determine if these
- * cases can be removed.
- */
-static int blend_factor( GLenum factor, GLboolean is_src )
-{
- int func;
-
- switch ( factor ) {
- case GL_ZERO:
- func = R200_BLEND_GL_ZERO;
- break;
- case GL_ONE:
- func = R200_BLEND_GL_ONE;
- break;
- case GL_DST_COLOR:
- func = R200_BLEND_GL_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_DST_COLOR;
- break;
- case GL_SRC_COLOR:
- func = R200_BLEND_GL_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- func = R200_BLEND_GL_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- func = R200_BLEND_GL_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_DST_ALPHA;
- break;
- case GL_SRC_ALPHA_SATURATE:
- func = (is_src) ? R200_BLEND_GL_SRC_ALPHA_SATURATE : R200_BLEND_GL_ZERO;
- break;
- case GL_CONSTANT_COLOR:
- func = R200_BLEND_GL_CONST_COLOR;
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_CONST_COLOR;
- break;
- case GL_CONSTANT_ALPHA:
- func = R200_BLEND_GL_CONST_ALPHA;
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_CONST_ALPHA;
- break;
- default:
- func = (is_src) ? R200_BLEND_GL_ONE : R200_BLEND_GL_ZERO;
- }
- return func;
-}
-
-/**
- * Sets both the blend equation and the blend function.
- * This is done in a single
- * function because some blend equations (i.e., \c GL_MIN and \c GL_MAX)
- * change the interpretation of the blend function.
- * Also, make sure that blend function and blend equation are set to their default
- * value if color blending is not enabled, since at least blend equations GL_MIN
- * and GL_FUNC_REVERSE_SUBTRACT will cause wrong results otherwise for
- * unknown reasons.
- */
-static void r200_set_blend_state( GLcontext * ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint cntl = rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &
- ~(R200_ROP_ENABLE | R200_ALPHA_BLEND_ENABLE | R200_SEPARATE_ALPHA_ENABLE);
-
- int func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT);
- int eqn = R200_COMB_FCN_ADD_CLAMP;
- int funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT);
- int eqnA = R200_COMB_FCN_ADD_CLAMP;
-
- R200_STATECHANGE( rmesa, ctx );
-
- if (rmesa->r200Screen->drmSupportsBlendColor) {
- if (ctx->Color._LogicOpEnabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = cntl | R200_ROP_ENABLE;
- rmesa->hw.ctx.cmd[CTX_RB3D_ABLENDCNTL] = eqn | func;
- rmesa->hw.ctx.cmd[CTX_RB3D_CBLENDCNTL] = eqn | func;
- return;
- } else if (ctx->Color.BlendEnabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = cntl | R200_ALPHA_BLEND_ENABLE | R200_SEPARATE_ALPHA_ENABLE;
- }
- else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = cntl;
- rmesa->hw.ctx.cmd[CTX_RB3D_ABLENDCNTL] = eqn | func;
- rmesa->hw.ctx.cmd[CTX_RB3D_CBLENDCNTL] = eqn | func;
- return;
- }
- }
- else {
- if (ctx->Color._LogicOpEnabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = cntl | R200_ROP_ENABLE;
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = eqn | func;
- return;
- } else if (ctx->Color.BlendEnabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = cntl | R200_ALPHA_BLEND_ENABLE;
- }
- else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = cntl;
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = eqn | func;
- return;
- }
- }
-
- func = (blend_factor( ctx->Color.BlendSrcRGB, GL_TRUE ) << R200_SRC_BLEND_SHIFT) |
- (blend_factor( ctx->Color.BlendDstRGB, GL_FALSE ) << R200_DST_BLEND_SHIFT);
-
- switch(ctx->Color.BlendEquationRGB) {
- case GL_FUNC_ADD:
- eqn = R200_COMB_FCN_ADD_CLAMP;
- break;
-
- case GL_FUNC_SUBTRACT:
- eqn = R200_COMB_FCN_SUB_CLAMP;
- break;
-
- case GL_FUNC_REVERSE_SUBTRACT:
- eqn = R200_COMB_FCN_RSUB_CLAMP;
- break;
-
- case GL_MIN:
- eqn = R200_COMB_FCN_MIN;
- func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- case GL_MAX:
- eqn = R200_COMB_FCN_MAX;
- func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- default:
- fprintf( stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n",
- __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB );
- return;
- }
-
- if (!rmesa->r200Screen->drmSupportsBlendColor) {
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = eqn | func;
- return;
- }
-
- funcA = (blend_factor( ctx->Color.BlendSrcA, GL_TRUE ) << R200_SRC_BLEND_SHIFT) |
- (blend_factor( ctx->Color.BlendDstA, GL_FALSE ) << R200_DST_BLEND_SHIFT);
-
- switch(ctx->Color.BlendEquationA) {
- case GL_FUNC_ADD:
- eqnA = R200_COMB_FCN_ADD_CLAMP;
- break;
-
- case GL_FUNC_SUBTRACT:
- eqnA = R200_COMB_FCN_SUB_CLAMP;
- break;
-
- case GL_FUNC_REVERSE_SUBTRACT:
- eqnA = R200_COMB_FCN_RSUB_CLAMP;
- break;
-
- case GL_MIN:
- eqnA = R200_COMB_FCN_MIN;
- funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- case GL_MAX:
- eqnA = R200_COMB_FCN_MAX;
- funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- default:
- fprintf( stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n",
- __FUNCTION__, __LINE__, ctx->Color.BlendEquationA );
- return;
- }
-
- rmesa->hw.ctx.cmd[CTX_RB3D_ABLENDCNTL] = eqnA | funcA;
- rmesa->hw.ctx.cmd[CTX_RB3D_CBLENDCNTL] = eqn | func;
-
-}
-
-static void r200BlendEquationSeparate( GLcontext *ctx,
- GLenum modeRGB, GLenum modeA )
-{
- r200_set_blend_state( ctx );
-}
-
-static void r200BlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- r200_set_blend_state( ctx );
-}
-
-
-/* =============================================================
- * Depth testing
- */
-
-static void r200DepthFunc( GLcontext *ctx, GLenum func )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_Z_TEST_MASK;
-
- switch ( ctx->Depth.Func ) {
- case GL_NEVER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_NEVER;
- break;
- case GL_LESS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_LESS;
- break;
- case GL_EQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_LEQUAL;
- break;
- case GL_GREATER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_TEST_ALWAYS;
- break;
- }
-}
-
-static void r200ClearDepth( GLcontext *ctx, GLclampd d )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint format = (rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &
- R200_DEPTH_FORMAT_MASK);
-
- switch ( format ) {
- case R200_DEPTH_FORMAT_16BIT_INT_Z:
- rmesa->state.depth.clear = d * 0x0000ffff;
- break;
- case R200_DEPTH_FORMAT_24BIT_INT_Z:
- rmesa->state.depth.clear = d * 0x00ffffff;
- break;
- }
-}
-
-static void r200DepthMask( GLcontext *ctx, GLboolean flag )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- R200_STATECHANGE( rmesa, ctx );
-
- if ( ctx->Depth.Mask ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_WRITE_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_Z_WRITE_ENABLE;
- }
-}
-
-
-/* =============================================================
- * Fog
- */
-
-
-static void r200Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- union { int i; float f; } c, d;
- GLchan col[4];
- GLuint i;
-
- c.i = rmesa->hw.fog.cmd[FOG_C];
- d.i = rmesa->hw.fog.cmd[FOG_D];
-
- switch (pname) {
- case GL_FOG_MODE:
- if (!ctx->Fog.Enabled)
- return;
- R200_STATECHANGE(rmesa, tcl);
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_TCL_FOG_MASK;
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_TCL_FOG_LINEAR;
- if (ctx->Fog.Start == ctx->Fog.End) {
- c.f = 1.0F;
- d.f = 1.0F;
- }
- else {
- c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- d.f = -1.0/(ctx->Fog.End-ctx->Fog.Start);
- }
- break;
- case GL_EXP:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_TCL_FOG_EXP;
- c.f = 0.0;
- d.f = -ctx->Fog.Density;
- break;
- case GL_EXP2:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_TCL_FOG_EXP2;
- c.f = 0.0;
- d.f = -(ctx->Fog.Density * ctx->Fog.Density);
- break;
- default:
- return;
- }
- break;
- case GL_FOG_DENSITY:
- switch (ctx->Fog.Mode) {
- case GL_EXP:
- c.f = 0.0;
- d.f = -ctx->Fog.Density;
- break;
- case GL_EXP2:
- c.f = 0.0;
- d.f = -(ctx->Fog.Density * ctx->Fog.Density);
- break;
- default:
- break;
- }
- break;
- case GL_FOG_START:
- case GL_FOG_END:
- if (ctx->Fog.Mode == GL_LINEAR) {
- if (ctx->Fog.Start == ctx->Fog.End) {
- c.f = 1.0F;
- d.f = 1.0F;
- } else {
- c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- d.f = -1.0/(ctx->Fog.End-ctx->Fog.Start);
- }
- }
- break;
- case GL_FOG_COLOR:
- R200_STATECHANGE( rmesa, ctx );
- UNCLAMPED_FLOAT_TO_RGB_CHAN( col, ctx->Fog.Color );
- i = r200PackColor( 4, col[0], col[1], col[2], 0 );
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_COLOR_MASK;
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= i;
- break;
- case GL_FOG_COORD_SRC: {
- GLuint fmt_0 = rmesa->hw.vtx.cmd[VTX_VTXFMT_0];
- GLuint out_0 = rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0];
- GLuint fog = rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR];
-
- fog &= ~R200_FOG_USE_MASK;
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
- fog |= R200_FOG_USE_VTX_FOG;
- fmt_0 |= R200_VTX_DISCRETE_FOG;
- out_0 |= R200_VTX_DISCRETE_FOG;
- }
- else {
- fog |= R200_FOG_USE_SPEC_ALPHA;
- fmt_0 &= ~R200_VTX_DISCRETE_FOG;
- out_0 &= ~R200_VTX_DISCRETE_FOG;
- }
-
- if ( fog != rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] ) {
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = fog;
- }
-
- if ( (fmt_0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0])
- || (out_0 != rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0])) {
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = fmt_0;
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] = out_0;
- }
-
- break;
- }
- default:
- return;
- }
-
- if (c.i != rmesa->hw.fog.cmd[FOG_C] || d.i != rmesa->hw.fog.cmd[FOG_D]) {
- R200_STATECHANGE( rmesa, fog );
- rmesa->hw.fog.cmd[FOG_C] = c.i;
- rmesa->hw.fog.cmd[FOG_D] = d.i;
- }
-}
-
-
-/* =============================================================
- * Scissoring
- */
-
-
-static GLboolean intersect_rect( drm_clip_rect_t *out,
- drm_clip_rect_t *a,
- drm_clip_rect_t *b )
-{
- *out = *a;
- if ( b->x1 > out->x1 ) out->x1 = b->x1;
- if ( b->y1 > out->y1 ) out->y1 = b->y1;
- if ( b->x2 < out->x2 ) out->x2 = b->x2;
- if ( b->y2 < out->y2 ) out->y2 = b->y2;
- if ( out->x1 >= out->x2 ) return GL_FALSE;
- if ( out->y1 >= out->y2 ) return GL_FALSE;
- return GL_TRUE;
-}
-
-
-void r200RecalcScissorRects( r200ContextPtr rmesa )
-{
- drm_clip_rect_t *out;
- int i;
-
- /* Grow cliprect store?
- */
- if (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
- while (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
- rmesa->state.scissor.numAllocedClipRects += 1; /* zero case */
- rmesa->state.scissor.numAllocedClipRects *= 2;
- }
-
- if (rmesa->state.scissor.pClipRects)
- FREE(rmesa->state.scissor.pClipRects);
-
- rmesa->state.scissor.pClipRects =
- MALLOC( rmesa->state.scissor.numAllocedClipRects *
- sizeof(drm_clip_rect_t) );
-
- if ( rmesa->state.scissor.pClipRects == NULL ) {
- rmesa->state.scissor.numAllocedClipRects = 0;
- return;
- }
- }
-
- out = rmesa->state.scissor.pClipRects;
- rmesa->state.scissor.numClipRects = 0;
-
- for ( i = 0 ; i < rmesa->numClipRects ; i++ ) {
- if ( intersect_rect( out,
- &rmesa->pClipRects[i],
- &rmesa->state.scissor.rect ) ) {
- rmesa->state.scissor.numClipRects++;
- out++;
- }
- }
-}
-
-
-static void r200UpdateScissor( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if ( rmesa->dri.drawable ) {
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
-
- int x = ctx->Scissor.X;
- int y = dPriv->h - ctx->Scissor.Y - ctx->Scissor.Height;
- int w = ctx->Scissor.X + ctx->Scissor.Width - 1;
- int h = dPriv->h - ctx->Scissor.Y - 1;
-
- rmesa->state.scissor.rect.x1 = x + dPriv->x;
- rmesa->state.scissor.rect.y1 = y + dPriv->y;
- rmesa->state.scissor.rect.x2 = w + dPriv->x + 1;
- rmesa->state.scissor.rect.y2 = h + dPriv->y + 1;
-
- r200RecalcScissorRects( rmesa );
- }
-}
-
-
-static void r200Scissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei w, GLsizei h )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if ( ctx->Scissor.Enabled ) {
- R200_FIREVERTICES( rmesa ); /* don't pipeline cliprect changes */
- r200UpdateScissor( ctx );
- }
-
-}
-
-
-/* =============================================================
- * Culling
- */
-
-static void r200CullFace( GLcontext *ctx, GLenum unused )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
- GLuint t = rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL];
-
- s |= R200_FFACE_SOLID | R200_BFACE_SOLID;
- t &= ~(R200_CULL_FRONT | R200_CULL_BACK);
-
- if ( ctx->Polygon.CullFlag ) {
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_FRONT:
- s &= ~R200_FFACE_SOLID;
- t |= R200_CULL_FRONT;
- break;
- case GL_BACK:
- s &= ~R200_BFACE_SOLID;
- t |= R200_CULL_BACK;
- break;
- case GL_FRONT_AND_BACK:
- s &= ~(R200_FFACE_SOLID | R200_BFACE_SOLID);
- t |= (R200_CULL_FRONT | R200_CULL_BACK);
- break;
- }
- }
-
- if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
- R200_STATECHANGE(rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] = s;
- }
-
- if ( rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] != t ) {
- R200_STATECHANGE(rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] = t;
- }
-}
-
-static void r200FrontFace( GLcontext *ctx, GLenum mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- R200_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_FFACE_CULL_DIR_MASK;
-
- R200_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_CULL_FRONT_IS_CCW;
-
- switch ( mode ) {
- case GL_CW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CW;
- break;
- case GL_CCW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CCW;
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_CULL_FRONT_IS_CCW;
- break;
- }
-}
-
-/* =============================================================
- * Point state
- */
-static void r200PointSize( GLcontext *ctx, GLfloat size )
-{
- if (0) fprintf(stderr, "%s: %f\n", __FUNCTION__, size );
-}
-
-/* =============================================================
- * Line state
- */
-static void r200LineWidth( GLcontext *ctx, GLfloat widthf )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- R200_STATECHANGE( rmesa, lin );
- R200_STATECHANGE( rmesa, set );
-
- /* Line width is stored in U6.4 format.
- */
- rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] &= ~0xffff;
- rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] |= (GLuint)(ctx->Line._Width * 16.0);
-
- if ( widthf > 1.0 ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_WIDELINE_ENABLE;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_WIDELINE_ENABLE;
- }
-}
-
-static void r200LineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- R200_STATECHANGE( rmesa, lin );
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] =
- ((((GLuint)factor & 0xff) << 16) | ((GLuint)pattern));
-}
-
-
-/* =============================================================
- * Masks
- */
-static void r200ColorMask( GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint mask = r200PackColor( rmesa->r200Screen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] );
-
- GLuint flag = rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] & ~R200_PLANE_MASK_ENABLE;
-
- if (!(r && g && b && a))
- flag |= R200_PLANE_MASK_ENABLE;
-
- if ( rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] != flag ) {
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = flag;
- }
-
- if ( rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] != mask ) {
- R200_STATECHANGE( rmesa, msk );
- rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = mask;
- }
-}
-
-
-/* =============================================================
- * Polygon state
- */
-
-static void r200PolygonOffset( GLcontext *ctx,
- GLfloat factor, GLfloat units )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat constant = units * rmesa->state.depth.scale;
-
-/* factor *= 2; */
-/* constant *= 2; */
-
-/* fprintf(stderr, "%s f:%f u:%f\n", __FUNCTION__, factor, constant); */
-
- R200_STATECHANGE( rmesa, zbs );
- rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_FACTOR] = *(GLuint *)&factor;
- rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = *(GLuint *)&constant;
-}
-
-static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint i;
- drm_radeon_stipple_t stipple;
-
- /* Must flip pattern upside down.
- */
- for ( i = 0 ; i < 32 ; i++ ) {
- rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
- }
-
- /* TODO: push this into cmd mechanism
- */
- R200_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
-
- /* FIXME: Use window x,y offsets into stipple RAM.
- */
- stipple.mask = rmesa->state.stipple.mask;
- drmCommandWrite( rmesa->dri.fd, DRM_RADEON_STIPPLE,
- &stipple, sizeof(stipple) );
- UNLOCK_HARDWARE( rmesa );
-}
-
-static void r200PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLboolean flag = (ctx->_TriangleCaps & DD_TRI_UNFILLED) != 0;
-
- /* Can't generally do unfilled via tcl, but some good special
- * cases work.
- */
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_UNFILLED, flag);
- if (rmesa->TclFallback) {
- r200ChooseRenderState( ctx );
- r200ChooseVertexState( ctx );
- }
-}
-
-
-/* =============================================================
- * Rendering attributes
- *
- * We really don't want to recalculate all this every time we bind a
- * texture. These things shouldn't change all that often, so it makes
- * sense to break them out of the core texture state update routines.
- */
-
-/* Examine lighting and texture state to determine if separate specular
- * should be enabled.
- */
-static void r200UpdateSpecular( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- u_int32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
-
- R200_STATECHANGE( rmesa, tcl );
- R200_STATECHANGE( rmesa, vtx );
-
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] &= ~(3<<R200_VTX_COLOR_0_SHIFT);
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] &= ~(3<<R200_VTX_COLOR_1_SHIFT);
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_COLOR_0;
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_COLOR_1;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_LIGHTING_ENABLE;
-
- p &= ~R200_SPECULAR_ENABLE;
-
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_DIFFUSE_SPECULAR_COMBINE;
-
-
- if (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) {
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
- ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT) |
- (R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT));
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_0;
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_1;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LIGHTING_ENABLE;
- p |= R200_SPECULAR_ENABLE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &=
- ~R200_DIFFUSE_SPECULAR_COMBINE;
- }
- else if (ctx->Light.Enabled) {
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
- ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT));
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_0;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LIGHTING_ENABLE;
- } else if (ctx->Fog.ColorSumEnabled ) {
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
- ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT) |
- (R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT));
- p |= R200_SPECULAR_ENABLE;
- } else {
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
- ((R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT));
- }
-
- if (ctx->Fog.Enabled) {
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |=
- ((R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT));
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_1;
- }
-
- if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) {
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p;
- }
-
- /* Update vertex/render formats
- */
- if (rmesa->TclFallback) {
- r200ChooseRenderState( ctx );
- r200ChooseVertexState( ctx );
- }
-}
-
-
-/* =============================================================
- * Materials
- */
-
-
-/* Update on colormaterial, material emmissive/ambient,
- * lightmodel.globalambient
- */
-static void update_global_ambient( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- float *fcmd = (float *)R200_DB_STATE( glt );
-
- /* Need to do more if both emmissive & ambient are PREMULT:
- * I believe this is not nessary when using source_material. This condition thus
- * will never happen currently, and the function has no dependencies on materials now
- */
- if ((rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] &
- ((3 << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
- (3 << R200_FRONT_AMBIENT_SOURCE_SHIFT))) == 0)
- {
- COPY_3V( &fcmd[GLT_RED],
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION]);
- ACC_SCALE_3V( &fcmd[GLT_RED],
- ctx->Light.Model.Ambient,
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT]);
- }
- else
- {
- COPY_3V( &fcmd[GLT_RED], ctx->Light.Model.Ambient );
- }
-
- R200_DB_STATECHANGE(rmesa, &rmesa->hw.glt);
-}
-
-/* Update on change to
- * - light[p].colors
- * - light[p].enabled
- */
-static void update_light_colors( GLcontext *ctx, GLuint p )
-{
- struct gl_light *l = &ctx->Light.Light[p];
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (l->Enabled) {
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- float *fcmd = (float *)R200_DB_STATE( lit[p] );
-
- COPY_4V( &fcmd[LIT_AMBIENT_RED], l->Ambient );
- COPY_4V( &fcmd[LIT_DIFFUSE_RED], l->Diffuse );
- COPY_4V( &fcmd[LIT_SPECULAR_RED], l->Specular );
-
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
- }
-}
-
-static void r200ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint light_model_ctl1 = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1];
- light_model_ctl1 &= ~((0xf << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
- (0xf << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
- (0xf << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
- (0xf << R200_FRONT_SPECULAR_SOURCE_SHIFT) |
- (0xf << R200_BACK_EMISSIVE_SOURCE_SHIFT) |
- (0xf << R200_BACK_AMBIENT_SOURCE_SHIFT) |
- (0xf << R200_BACK_DIFFUSE_SOURCE_SHIFT) |
- (0xf << R200_BACK_SPECULAR_SOURCE_SHIFT));
-
- if (ctx->Light.ColorMaterialEnabled) {
- GLuint mask = ctx->Light.ColorMaterialBitmask;
-
- if (mask & MAT_BIT_FRONT_EMISSION) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_FRONT_EMISSIVE_SOURCE_SHIFT);
- }
- else
- light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_0 <<
- R200_FRONT_EMISSIVE_SOURCE_SHIFT);
-
- if (mask & MAT_BIT_FRONT_AMBIENT) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_FRONT_AMBIENT_SOURCE_SHIFT);
- }
- else
- light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_0 <<
- R200_FRONT_AMBIENT_SOURCE_SHIFT);
-
- if (mask & MAT_BIT_FRONT_DIFFUSE) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_FRONT_DIFFUSE_SOURCE_SHIFT);
- }
- else
- light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_0 <<
- R200_FRONT_DIFFUSE_SOURCE_SHIFT);
-
- if (mask & MAT_BIT_FRONT_SPECULAR) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_FRONT_SPECULAR_SOURCE_SHIFT);
- }
- else {
- light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_0 <<
- R200_FRONT_SPECULAR_SOURCE_SHIFT);
- }
-
- if (mask & MAT_BIT_BACK_EMISSION) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_BACK_EMISSIVE_SOURCE_SHIFT);
- }
-
- else light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_1 <<
- R200_BACK_EMISSIVE_SOURCE_SHIFT);
-
- if (mask & MAT_BIT_BACK_AMBIENT) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_BACK_AMBIENT_SOURCE_SHIFT);
- }
- else light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_1 <<
- R200_BACK_AMBIENT_SOURCE_SHIFT);
-
- if (mask & MAT_BIT_BACK_DIFFUSE) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_BACK_DIFFUSE_SOURCE_SHIFT);
- }
- else light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_1 <<
- R200_BACK_DIFFUSE_SOURCE_SHIFT);
-
- if (mask & MAT_BIT_BACK_SPECULAR) {
- light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
- R200_BACK_SPECULAR_SOURCE_SHIFT);
- }
- else {
- light_model_ctl1 |= (R200_LM1_SOURCE_MATERIAL_1 <<
- R200_BACK_SPECULAR_SOURCE_SHIFT);
- }
- }
- else {
- /* Default to SOURCE_MATERIAL:
- */
- light_model_ctl1 |=
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_SPECULAR_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_EMISSIVE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_AMBIENT_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_DIFFUSE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_SPECULAR_SOURCE_SHIFT);
- }
-
- if (light_model_ctl1 != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1]) {
- R200_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] = light_model_ctl1;
- }
-
-
-}
-
-void r200UpdateMaterial( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
- GLfloat *fcmd = (GLfloat *)R200_DB_STATE( mtl[0] );
- GLfloat *fcmd2 = (GLfloat *)R200_DB_STATE( mtl[1] );
- GLuint mask = ~0;
-
- /* Might be possible and faster to update everything unconditionally? */
- if (ctx->Light.ColorMaterialEnabled)
- mask &= ~ctx->Light.ColorMaterialBitmask;
-
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (mask & MAT_BIT_FRONT_EMISSION) {
- fcmd[MTL_EMMISSIVE_RED] = mat[MAT_ATTRIB_FRONT_EMISSION][0];
- fcmd[MTL_EMMISSIVE_GREEN] = mat[MAT_ATTRIB_FRONT_EMISSION][1];
- fcmd[MTL_EMMISSIVE_BLUE] = mat[MAT_ATTRIB_FRONT_EMISSION][2];
- fcmd[MTL_EMMISSIVE_ALPHA] = mat[MAT_ATTRIB_FRONT_EMISSION][3];
- }
- if (mask & MAT_BIT_FRONT_AMBIENT) {
- fcmd[MTL_AMBIENT_RED] = mat[MAT_ATTRIB_FRONT_AMBIENT][0];
- fcmd[MTL_AMBIENT_GREEN] = mat[MAT_ATTRIB_FRONT_AMBIENT][1];
- fcmd[MTL_AMBIENT_BLUE] = mat[MAT_ATTRIB_FRONT_AMBIENT][2];
- fcmd[MTL_AMBIENT_ALPHA] = mat[MAT_ATTRIB_FRONT_AMBIENT][3];
- }
- if (mask & MAT_BIT_FRONT_DIFFUSE) {
- fcmd[MTL_DIFFUSE_RED] = mat[MAT_ATTRIB_FRONT_DIFFUSE][0];
- fcmd[MTL_DIFFUSE_GREEN] = mat[MAT_ATTRIB_FRONT_DIFFUSE][1];
- fcmd[MTL_DIFFUSE_BLUE] = mat[MAT_ATTRIB_FRONT_DIFFUSE][2];
- fcmd[MTL_DIFFUSE_ALPHA] = mat[MAT_ATTRIB_FRONT_DIFFUSE][3];
- }
- if (mask & MAT_BIT_FRONT_SPECULAR) {
- fcmd[MTL_SPECULAR_RED] = mat[MAT_ATTRIB_FRONT_SPECULAR][0];
- fcmd[MTL_SPECULAR_GREEN] = mat[MAT_ATTRIB_FRONT_SPECULAR][1];
- fcmd[MTL_SPECULAR_BLUE] = mat[MAT_ATTRIB_FRONT_SPECULAR][2];
- fcmd[MTL_SPECULAR_ALPHA] = mat[MAT_ATTRIB_FRONT_SPECULAR][3];
- }
- if (mask & MAT_BIT_FRONT_SHININESS) {
- fcmd[MTL_SHININESS] = mat[MAT_ATTRIB_FRONT_SHININESS][0];
- }
-
- if (mask & MAT_BIT_BACK_EMISSION) {
- fcmd2[MTL_EMMISSIVE_RED] = mat[MAT_ATTRIB_BACK_EMISSION][0];
- fcmd2[MTL_EMMISSIVE_GREEN] = mat[MAT_ATTRIB_BACK_EMISSION][1];
- fcmd2[MTL_EMMISSIVE_BLUE] = mat[MAT_ATTRIB_BACK_EMISSION][2];
- fcmd2[MTL_EMMISSIVE_ALPHA] = mat[MAT_ATTRIB_BACK_EMISSION][3];
- }
- if (mask & MAT_BIT_BACK_AMBIENT) {
- fcmd2[MTL_AMBIENT_RED] = mat[MAT_ATTRIB_BACK_AMBIENT][0];
- fcmd2[MTL_AMBIENT_GREEN] = mat[MAT_ATTRIB_BACK_AMBIENT][1];
- fcmd2[MTL_AMBIENT_BLUE] = mat[MAT_ATTRIB_BACK_AMBIENT][2];
- fcmd2[MTL_AMBIENT_ALPHA] = mat[MAT_ATTRIB_BACK_AMBIENT][3];
- }
- if (mask & MAT_BIT_BACK_DIFFUSE) {
- fcmd2[MTL_DIFFUSE_RED] = mat[MAT_ATTRIB_BACK_DIFFUSE][0];
- fcmd2[MTL_DIFFUSE_GREEN] = mat[MAT_ATTRIB_BACK_DIFFUSE][1];
- fcmd2[MTL_DIFFUSE_BLUE] = mat[MAT_ATTRIB_BACK_DIFFUSE][2];
- fcmd2[MTL_DIFFUSE_ALPHA] = mat[MAT_ATTRIB_BACK_DIFFUSE][3];
- }
- if (mask & MAT_BIT_BACK_SPECULAR) {
- fcmd2[MTL_SPECULAR_RED] = mat[MAT_ATTRIB_BACK_SPECULAR][0];
- fcmd2[MTL_SPECULAR_GREEN] = mat[MAT_ATTRIB_BACK_SPECULAR][1];
- fcmd2[MTL_SPECULAR_BLUE] = mat[MAT_ATTRIB_BACK_SPECULAR][2];
- fcmd2[MTL_SPECULAR_ALPHA] = mat[MAT_ATTRIB_BACK_SPECULAR][3];
- }
- if (mask & MAT_BIT_BACK_SHININESS) {
- fcmd2[MTL_SHININESS] = mat[MAT_ATTRIB_BACK_SHININESS][0];
- }
-
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.mtl[0] );
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.mtl[1] );
-
- /* currently material changes cannot trigger a global ambient change, I believe this is correct
- update_global_ambient( ctx ); */
-}
-
-/* _NEW_LIGHT
- * _NEW_MODELVIEW
- * _MESA_NEW_NEED_EYE_COORDS
- *
- * Uses derived state from mesa:
- * _VP_inf_norm
- * _h_inf_norm
- * _Position
- * _NormDirection
- * _ModelViewInvScale
- * _NeedEyeCoords
- * _EyeZDir
- *
- * which are calculated in light.c and are correct for the current
- * lighting space (model or eye), hence dependencies on _NEW_MODELVIEW
- * and _MESA_NEW_NEED_EYE_COORDS.
- */
-static void update_light( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- /* Have to check these, or have an automatic shortcircuit mechanism
- * to remove noop statechanges. (Or just do a better job on the
- * front end).
- */
- {
- GLuint tmp = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0];
-
- if (ctx->_NeedEyeCoords)
- tmp &= ~R200_LIGHT_IN_MODELSPACE;
- else
- tmp |= R200_LIGHT_IN_MODELSPACE;
-
- if (tmp != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0])
- {
- R200_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] = tmp;
- }
- }
-
- {
- GLfloat *fcmd = (GLfloat *)R200_DB_STATE( eye );
- fcmd[EYE_X] = ctx->_EyeZDir[0];
- fcmd[EYE_Y] = ctx->_EyeZDir[1];
- fcmd[EYE_Z] = - ctx->_EyeZDir[2];
- fcmd[EYE_RESCALE_FACTOR] = ctx->_ModelViewInvScale;
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.eye );
- }
-
-
-
- if (ctx->Light.Enabled) {
- GLint p;
- for (p = 0 ; p < MAX_LIGHTS; p++) {
- if (ctx->Light.Light[p].Enabled) {
- struct gl_light *l = &ctx->Light.Light[p];
- GLfloat *fcmd = (GLfloat *)R200_DB_STATE( lit[p] );
-
- if (l->EyePosition[3] == 0.0) {
- COPY_3FV( &fcmd[LIT_POSITION_X], l->_VP_inf_norm );
- COPY_3FV( &fcmd[LIT_DIRECTION_X], l->_h_inf_norm );
- fcmd[LIT_POSITION_W] = 0;
- fcmd[LIT_DIRECTION_W] = 0;
- } else {
- COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
- fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
- fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
- fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
- fcmd[LIT_DIRECTION_W] = 0;
- }
-
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
- }
- }
- }
-}
-
-static void r200Lightfv( GLcontext *ctx, GLenum light,
- GLenum pname, const GLfloat *params )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint p = light - GL_LIGHT0;
- struct gl_light *l = &ctx->Light.Light[p];
- GLfloat *fcmd = (GLfloat *)rmesa->hw.lit[p].cmd;
-
-
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- update_light_colors( ctx, p );
- break;
-
- case GL_SPOT_DIRECTION:
- /* picked up in update_light */
- break;
-
- case GL_POSITION: {
- /* positions picked up in update_light, but can do flag here */
- GLuint flag = (p&1)? R200_LIGHT_1_IS_LOCAL : R200_LIGHT_0_IS_LOCAL;
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
-
- R200_STATECHANGE(rmesa, tcl);
- if (l->EyePosition[3] != 0.0F)
- rmesa->hw.tcl.cmd[idx] |= flag;
- else
- rmesa->hw.tcl.cmd[idx] &= ~flag;
- break;
- }
-
- case GL_SPOT_EXPONENT:
- R200_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_SPOT_EXPONENT] = params[0];
- break;
-
- case GL_SPOT_CUTOFF: {
- GLuint flag = (p&1) ? R200_LIGHT_1_IS_SPOT : R200_LIGHT_0_IS_SPOT;
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
-
- R200_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_SPOT_CUTOFF] = l->_CosCutoff;
-
- R200_STATECHANGE(rmesa, tcl);
- if (l->SpotCutoff != 180.0F)
- rmesa->hw.tcl.cmd[idx] |= flag;
- else
- rmesa->hw.tcl.cmd[idx] &= ~flag;
-
- break;
- }
-
- case GL_CONSTANT_ATTENUATION:
- R200_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_CONST] = params[0];
- if ( params[0] == 0.0 )
- fcmd[LIT_ATTEN_CONST_INV] = FLT_MAX;
- else
- fcmd[LIT_ATTEN_CONST_INV] = 1.0 / params[0];
- break;
- case GL_LINEAR_ATTENUATION:
- R200_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_LINEAR] = params[0];
- break;
- case GL_QUADRATIC_ATTENUATION:
- R200_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_QUADRATIC] = params[0];
- break;
- default:
- return;
- }
-
- /* Set RANGE_ATTEN only when needed */
- switch (pname) {
- case GL_POSITION:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION: {
- GLuint *icmd = (GLuint *)R200_DB_STATE( tcl );
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
- GLuint atten_flag = ( p&1 ) ? R200_LIGHT_1_ENABLE_RANGE_ATTEN
- : R200_LIGHT_0_ENABLE_RANGE_ATTEN;
- GLuint atten_const_flag = ( p&1 ) ? R200_LIGHT_1_CONSTANT_RANGE_ATTEN
- : R200_LIGHT_0_CONSTANT_RANGE_ATTEN;
-
- if ( l->EyePosition[3] == 0.0F ||
- ( ( fcmd[LIT_ATTEN_CONST] == 0.0 || fcmd[LIT_ATTEN_CONST] == 1.0 ) &&
- fcmd[LIT_ATTEN_QUADRATIC] == 0.0 && fcmd[LIT_ATTEN_LINEAR] == 0.0 ) ) {
- /* Disable attenuation */
- icmd[idx] &= ~atten_flag;
- } else {
- if ( fcmd[LIT_ATTEN_QUADRATIC] == 0.0 && fcmd[LIT_ATTEN_LINEAR] == 0.0 ) {
- /* Enable only constant portion of attenuation calculation */
- icmd[idx] |= ( atten_flag | atten_const_flag );
- } else {
- /* Enable full attenuation calculation */
- icmd[idx] &= ~atten_const_flag;
- icmd[idx] |= atten_flag;
- }
- }
-
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.tcl );
- break;
- }
- default:
- break;
- }
-}
-
-
-
-
-static void r200LightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *param )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- update_global_ambient( ctx );
- break;
-
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- R200_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.LocalViewer)
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LOCAL_VIEWER;
- else
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_LOCAL_VIEWER;
- break;
-
- case GL_LIGHT_MODEL_TWO_SIDE:
- R200_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.TwoSide)
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_LIGHT_TWOSIDE;
- else
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~(R200_LIGHT_TWOSIDE);
- if (rmesa->TclFallback) {
- r200ChooseRenderState( ctx );
- r200ChooseVertexState( ctx );
- }
- break;
-
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- r200UpdateSpecular(ctx);
- break;
-
- default:
- break;
- }
-}
-
-static void r200ShadeModel( GLcontext *ctx, GLenum mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
-
- s &= ~(R200_DIFFUSE_SHADE_MASK |
- R200_ALPHA_SHADE_MASK |
- R200_SPECULAR_SHADE_MASK |
- R200_FOG_SHADE_MASK);
-
- switch ( mode ) {
- case GL_FLAT:
- s |= (R200_DIFFUSE_SHADE_FLAT |
- R200_ALPHA_SHADE_FLAT |
- R200_SPECULAR_SHADE_FLAT |
- R200_FOG_SHADE_FLAT);
- break;
- case GL_SMOOTH:
- s |= (R200_DIFFUSE_SHADE_GOURAUD |
- R200_ALPHA_SHADE_GOURAUD |
- R200_SPECULAR_SHADE_GOURAUD |
- R200_FOG_SHADE_GOURAUD);
- break;
- default:
- return;
- }
-
- if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
- R200_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] = s;
- }
-}
-
-
-/* =============================================================
- * User clip planes
- */
-
-static void r200ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
-{
- GLint p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
-
- R200_STATECHANGE( rmesa, ucp[p] );
- rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
- rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
- rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
- rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
-}
-
-static void r200UpdateClipPlanes( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint p;
-
- for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
- if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
- GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
-
- R200_STATECHANGE( rmesa, ucp[p] );
- rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
- rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
- rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
- rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
- }
- }
-}
-
-
-/* =============================================================
- * Stencil
- */
-
-static void r200StencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint refmask = ((ctx->Stencil.Ref[0] << R200_STENCIL_REF_SHIFT) |
- (ctx->Stencil.ValueMask[0] << R200_STENCIL_MASK_SHIFT));
-
- R200_STATECHANGE( rmesa, ctx );
- R200_STATECHANGE( rmesa, msk );
-
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_STENCIL_TEST_MASK;
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~(R200_STENCIL_REF_MASK|
- R200_STENCIL_VALUE_MASK);
-
- switch ( ctx->Stencil.Function[0] ) {
- case GL_NEVER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_NEVER;
- break;
- case GL_LESS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_LESS;
- break;
- case GL_EQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_LEQUAL;
- break;
- case GL_GREATER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_ALWAYS;
- break;
- }
-
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= refmask;
-}
-
-static void r200StencilMask( GLcontext *ctx, GLuint mask )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- R200_STATECHANGE( rmesa, msk );
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~R200_STENCIL_WRITE_MASK;
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |=
- (ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT);
-}
-
-static void r200StencilOp( GLcontext *ctx, GLenum fail,
- GLenum zfail, GLenum zpass )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~(R200_STENCIL_FAIL_MASK |
- R200_STENCIL_ZFAIL_MASK |
- R200_STENCIL_ZPASS_MASK);
-
- switch ( ctx->Stencil.FailFunc[0] ) {
- case GL_KEEP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_KEEP;
- break;
- case GL_ZERO:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_ZERO;
- break;
- case GL_REPLACE:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_REPLACE;
- break;
- case GL_INCR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_INC;
- break;
- case GL_DECR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_DEC;
- break;
- case GL_INCR_WRAP_EXT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_INC_WRAP;
- break;
- case GL_DECR_WRAP_EXT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_DEC_WRAP;
- break;
- case GL_INVERT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_INVERT;
- break;
- }
-
- switch ( ctx->Stencil.ZFailFunc[0] ) {
- case GL_KEEP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_KEEP;
- break;
- case GL_ZERO:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_ZERO;
- break;
- case GL_REPLACE:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_REPLACE;
- break;
- case GL_INCR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_INC;
- break;
- case GL_DECR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_DEC;
- break;
- case GL_INCR_WRAP_EXT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_INC_WRAP;
- break;
- case GL_DECR_WRAP_EXT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_DEC_WRAP;
- break;
- case GL_INVERT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_INVERT;
- break;
- }
-
- switch ( ctx->Stencil.ZPassFunc[0] ) {
- case GL_KEEP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_KEEP;
- break;
- case GL_ZERO:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_ZERO;
- break;
- case GL_REPLACE:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_REPLACE;
- break;
- case GL_INCR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_INC;
- break;
- case GL_DECR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_DEC;
- break;
- case GL_INCR_WRAP_EXT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_INC_WRAP;
- break;
- case GL_DECR_WRAP_EXT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_DEC_WRAP;
- break;
- case GL_INVERT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_INVERT;
- break;
- }
-}
-
-static void r200ClearStencil( GLcontext *ctx, GLint s )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- rmesa->state.stencil.clear =
- ((GLuint) ctx->Stencil.Clear |
- (0xff << R200_STENCIL_MASK_SHIFT) |
- (ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT));
-}
-
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-/*
- * To correctly position primitives:
- */
-#define SUBPIXEL_X 0.125
-#define SUBPIXEL_Y 0.125
-
-void r200UpdateWindow( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat sx = v[MAT_SX];
- GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
- GLfloat sy = - v[MAT_SY];
- GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
- GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
- GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
-
- R200_FIREVERTICES( rmesa );
- R200_STATECHANGE( rmesa, vpt );
-
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = *(GLuint *)&sx;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = *(GLuint *)&sy;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = *(GLuint *)&sz;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = *(GLuint *)&tz;
-}
-
-
-
-static void r200Viewport( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- /* Don't pipeline viewport changes, conflict with window offset
- * setting below. Could apply deltas to rescue pipelined viewport
- * values, or keep the originals hanging around.
- */
- R200_FIREVERTICES( R200_CONTEXT(ctx) );
- r200UpdateWindow( ctx );
-}
-
-static void r200DepthRange( GLcontext *ctx, GLclampd nearval,
- GLclampd farval )
-{
- r200UpdateWindow( ctx );
-}
-
-void r200UpdateViewportOffset( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
- GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
-
- if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != *(GLuint *)&tx ||
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != *(GLuint *)&ty )
- {
- /* Note: this should also modify whatever data the context reset
- * code uses...
- */
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
-
- /* update polygon stipple x/y screen offset */
- {
- GLuint stx, sty;
- GLuint m = rmesa->hw.msc.cmd[MSC_RE_MISC];
-
- m &= ~(R200_STIPPLE_X_OFFSET_MASK |
- R200_STIPPLE_Y_OFFSET_MASK);
-
- /* add magic offsets, then invert */
- stx = 31 - ((rmesa->dri.drawable->x - 1) & R200_STIPPLE_COORD_MASK);
- sty = 31 - ((rmesa->dri.drawable->y + rmesa->dri.drawable->h - 1)
- & R200_STIPPLE_COORD_MASK);
-
- m |= ((stx << R200_STIPPLE_X_OFFSET_SHIFT) |
- (sty << R200_STIPPLE_Y_OFFSET_SHIFT));
-
- if ( rmesa->hw.msc.cmd[MSC_RE_MISC] != m ) {
- R200_STATECHANGE( rmesa, msc );
- rmesa->hw.msc.cmd[MSC_RE_MISC] = m;
- }
- }
- }
-
- r200UpdateScissor( ctx );
-}
-
-
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void r200ClearColor( GLcontext *ctx, const GLfloat c[4] )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLubyte color[4];
- CLAMPED_FLOAT_TO_UBYTE(color[0], c[0]);
- CLAMPED_FLOAT_TO_UBYTE(color[1], c[1]);
- CLAMPED_FLOAT_TO_UBYTE(color[2], c[2]);
- CLAMPED_FLOAT_TO_UBYTE(color[3], c[3]);
- rmesa->state.color.clear = r200PackColor( rmesa->r200Screen->cpp,
- color[0], color[1],
- color[2], color[3] );
-}
-
-
-static void r200RenderMode( GLcontext *ctx, GLenum mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- FALLBACK( rmesa, R200_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
-}
-
-
-static GLuint r200_rop_tab[] = {
- R200_ROP_CLEAR,
- R200_ROP_AND,
- R200_ROP_AND_REVERSE,
- R200_ROP_COPY,
- R200_ROP_AND_INVERTED,
- R200_ROP_NOOP,
- R200_ROP_XOR,
- R200_ROP_OR,
- R200_ROP_NOR,
- R200_ROP_EQUIV,
- R200_ROP_INVERT,
- R200_ROP_OR_REVERSE,
- R200_ROP_COPY_INVERTED,
- R200_ROP_OR_INVERTED,
- R200_ROP_NAND,
- R200_ROP_SET,
-};
-
-static void r200LogicOpCode( GLcontext *ctx, GLenum opcode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint rop = (GLuint)opcode - GL_CLEAR;
-
- ASSERT( rop < 16 );
-
- R200_STATECHANGE( rmesa, msk );
- rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = r200_rop_tab[rop];
-}
-
-
-void r200SetCliprects( r200ContextPtr rmesa, GLenum mode )
-{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
- break;
- case GL_BACK_LEFT:
- /* Can't ignore 2d windows if we are page flipping.
- */
- if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) {
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
- }
- else {
- rmesa->numClipRects = dPriv->numBackClipRects;
- rmesa->pClipRects = dPriv->pBackClipRects;
- }
- break;
- default:
- fprintf(stderr, "bad mode in r200SetCliprects\n");
- return;
- }
-
- if (rmesa->state.scissor.enabled)
- r200RecalcScissorRects( rmesa );
-}
-
-
-static void r200DrawBuffer( GLcontext *ctx, GLenum mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( mode ));
-
- R200_FIREVERTICES(rmesa); /* don't pipeline cliprect changes */
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
- r200SetCliprects( rmesa, GL_FRONT_LEFT );
- break;
- case BUFFER_BIT_BACK_LEFT:
- FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
- r200SetCliprects( rmesa, GL_BACK_LEFT );
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that r200SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset +
- rmesa->r200Screen->fbLocation)
- & R200_COLOROFFSET_MASK);
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= R200_COLOR_TILE_ENABLE;
- }
-}
-
-
-static void r200ReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-/* =============================================================
- * State enable/disable
- */
-
-static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint p, flag;
-
- if ( R200_DEBUG & DEBUG_STATE )
- fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( cap ),
- state ? "GL_TRUE" : "GL_FALSE" );
-
- switch ( cap ) {
- /* Fast track this one...
- */
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- break;
-
- case GL_ALPHA_TEST:
- R200_STATECHANGE( rmesa, ctx );
- if (state) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_ALPHA_TEST_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_ALPHA_TEST_ENABLE;
- }
- break;
-
- case GL_BLEND:
- case GL_COLOR_LOGIC_OP:
- r200_set_blend_state( ctx );
- break;
-
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5:
- p = cap-GL_CLIP_PLANE0;
- R200_STATECHANGE( rmesa, tcl );
- if (state) {
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= (R200_UCP_ENABLE_0<<p);
- r200ClipPlane( ctx, cap, NULL );
- }
- else {
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(R200_UCP_ENABLE_0<<p);
- }
- break;
-
- case GL_COLOR_MATERIAL:
- r200ColorMaterial( ctx, 0, 0 );
- r200UpdateMaterial( ctx );
- break;
-
- case GL_CULL_FACE:
- r200CullFace( ctx, 0 );
- break;
-
- case GL_DEPTH_TEST:
- R200_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_Z_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_Z_ENABLE;
- }
- break;
-
- case GL_DITHER:
- R200_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_DITHER_ENABLE;
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~rmesa->state.color.roundEnable;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_DITHER_ENABLE;
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= rmesa->state.color.roundEnable;
- }
- break;
-
- case GL_FOG:
- R200_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_FOG_ENABLE;
- r200Fogfv( ctx, GL_FOG_MODE, NULL );
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_FOG_ENABLE;
- R200_STATECHANGE(rmesa, tcl);
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_TCL_FOG_MASK;
- }
- r200UpdateSpecular( ctx ); /* for PK_SPEC */
- if (rmesa->TclFallback)
- r200ChooseVertexState( ctx );
- _mesa_allow_light_in_model( ctx, !state );
- break;
-
- case GL_LIGHT0:
- case GL_LIGHT1:
- case GL_LIGHT2:
- case GL_LIGHT3:
- case GL_LIGHT4:
- case GL_LIGHT5:
- case GL_LIGHT6:
- case GL_LIGHT7:
- R200_STATECHANGE(rmesa, tcl);
- p = cap - GL_LIGHT0;
- if (p&1)
- flag = (R200_LIGHT_1_ENABLE |
- R200_LIGHT_1_ENABLE_AMBIENT |
- R200_LIGHT_1_ENABLE_SPECULAR);
- else
- flag = (R200_LIGHT_0_ENABLE |
- R200_LIGHT_0_ENABLE_AMBIENT |
- R200_LIGHT_0_ENABLE_SPECULAR);
-
- if (state)
- rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] |= flag;
- else
- rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] &= ~flag;
-
- /*
- */
- update_light_colors( ctx, p );
- break;
-
- case GL_LIGHTING:
- r200UpdateSpecular(ctx);
- break;
-
- case GL_LINE_SMOOTH:
- R200_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_ANTI_ALIAS_LINE;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_ANTI_ALIAS_LINE;
- }
- break;
-
- case GL_LINE_STIPPLE:
- R200_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PATTERN_ENABLE;
- } else {
- rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PATTERN_ENABLE;
- }
- break;
-
- case GL_NORMALIZE:
- R200_STATECHANGE( rmesa, tcl );
- if ( state ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_NORMALIZE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_NORMALIZE_NORMALS;
- }
- break;
-
- /* Pointsize registers on r200 don't seem to do anything. Maybe
- * have to pass pointsizes as vertex parameters? In any case,
- * setting pointmin == pointsizemax == 1.0, and doing nothing
- * for aa is enough to satisfy conform.
- */
- case GL_POINT_SMOOTH:
- break;
-
- /* These don't really do anything, as we don't use the 3vtx
- * primitives yet.
- */
-#if 0
- case GL_POLYGON_OFFSET_POINT:
- R200_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_ZBIAS_ENABLE_POINT;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_ZBIAS_ENABLE_POINT;
- }
- break;
-
- case GL_POLYGON_OFFSET_LINE:
- R200_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_ZBIAS_ENABLE_LINE;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_ZBIAS_ENABLE_LINE;
- }
- break;
-#endif
-
- case GL_POLYGON_OFFSET_FILL:
- R200_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_ZBIAS_ENABLE_TRI;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_ZBIAS_ENABLE_TRI;
- }
- break;
-
- case GL_POLYGON_SMOOTH:
- R200_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_ANTI_ALIAS_POLY;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~R200_ANTI_ALIAS_POLY;
- }
- break;
-
- case GL_POLYGON_STIPPLE:
- R200_STATECHANGE(rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_STIPPLE_ENABLE;
- } else {
- rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_STIPPLE_ENABLE;
- }
- break;
-
- case GL_RESCALE_NORMAL_EXT: {
- GLboolean tmp = ctx->_NeedEyeCoords ? state : !state;
- R200_STATECHANGE( rmesa, tcl );
- if ( tmp ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_RESCALE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_RESCALE_NORMALS;
- }
- break;
- }
-
- case GL_SCISSOR_TEST:
- R200_FIREVERTICES( rmesa );
- rmesa->state.scissor.enabled = state;
- r200UpdateScissor( ctx );
- break;
-
- case GL_STENCIL_TEST:
- if ( rmesa->state.stencil.hwBuffer ) {
- R200_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_STENCIL_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~R200_STENCIL_ENABLE;
- }
- } else {
- FALLBACK( rmesa, R200_FALLBACK_STENCIL, state );
- }
- break;
-
- case GL_TEXTURE_GEN_Q:
- case GL_TEXTURE_GEN_R:
- case GL_TEXTURE_GEN_S:
- case GL_TEXTURE_GEN_T:
- /* Picked up in r200UpdateTextureState.
- */
- rmesa->recheck_texgen[ctx->Texture.CurrentUnit] = GL_TRUE;
- break;
-
- case GL_COLOR_SUM_EXT:
- r200UpdateSpecular ( ctx );
- break;
-
- case GL_VERTEX_PROGRAM_ARB:
- TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_VERTEX_PROGRAM, state);
- break;
-
- default:
- return;
- }
-}
-
-
-void r200LightingSpaceChange( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLboolean tmp;
-
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d BEFORE %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0]);
-
- if (ctx->_NeedEyeCoords)
- tmp = ctx->Transform.RescaleNormals;
- else
- tmp = !ctx->Transform.RescaleNormals;
-
- R200_STATECHANGE( rmesa, tcl );
- if ( tmp ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_RESCALE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_RESCALE_NORMALS;
- }
-
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d AFTER %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0]);
-}
-
-/* =============================================================
- * Deferred state management - matrices, textures, other?
- */
-
-
-
-
-static void upload_matrix( r200ContextPtr rmesa, GLfloat *src, int idx )
-{
- float *dest = ((float *)R200_DB_STATE( mat[idx] ))+MAT_ELT_0;
- int i;
-
-
- for (i = 0 ; i < 4 ; i++) {
- *dest++ = src[i];
- *dest++ = src[i+4];
- *dest++ = src[i+8];
- *dest++ = src[i+12];
- }
-
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
-}
-
-static void upload_matrix_t( r200ContextPtr rmesa, const GLfloat *src, int idx )
-{
- float *dest = ((float *)R200_DB_STATE( mat[idx] ))+MAT_ELT_0;
- memcpy(dest, src, 16*sizeof(float));
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
-}
-
-
-static void update_texturematrix( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- GLuint tpc = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0];
- GLuint compsel = rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL];
- int unit;
-
- if (R200_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s before COMPSEL: %x\n", __FUNCTION__,
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL]);
-
- rmesa->TexMatEnabled = 0;
- rmesa->TexMatCompSel = 0;
-
- for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
- if (!ctx->Texture.Unit[unit]._ReallyEnabled)
- continue;
-
- if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
- rmesa->TexMatEnabled |= (R200_TEXGEN_TEXMAT_0_ENABLE|
- R200_TEXMAT_0_ENABLE) << unit;
-
- rmesa->TexMatCompSel |= R200_OUTPUT_TEX_0 << unit;
-
- if (rmesa->TexGenEnabled & (R200_TEXMAT_0_ENABLE << unit)) {
- /* Need to preconcatenate any active texgen
- * obj/eyeplane matrices:
- */
- _math_matrix_mul_matrix( &rmesa->tmpmat,
- ctx->TextureMatrixStack[unit].Top,
- &rmesa->TexGenMatrix[unit] );
- upload_matrix( rmesa, rmesa->tmpmat.m, R200_MTX_TEX0+unit );
- }
- else {
- upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m,
- R200_MTX_TEX0+unit );
- }
- }
- else if (rmesa->TexGenEnabled & (R200_TEXMAT_0_ENABLE << unit)) {
- upload_matrix( rmesa, rmesa->TexGenMatrix[unit].m,
- R200_MTX_TEX0+unit );
- }
- }
-
- tpc = (rmesa->TexMatEnabled | rmesa->TexGenEnabled);
- if (tpc != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0]) {
- R200_STATECHANGE(rmesa, tcg);
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = tpc;
- }
-
- compsel &= ~R200_OUTPUT_TEX_MASK;
- compsel |= rmesa->TexMatCompSel | rmesa->TexGenCompSel;
- if (compsel != rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL]) {
- R200_STATECHANGE(rmesa, vtx);
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = compsel;
- }
-}
-
-
-
-void r200ValidateState( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint new_state = rmesa->NewGLState;
-
- if (new_state & _NEW_TEXTURE) {
- r200UpdateTextureState( ctx );
- new_state |= rmesa->NewGLState; /* may add TEXTURE_MATRIX */
- }
-
- /* Need an event driven matrix update?
- */
- if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
- upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, R200_MTX_MVP );
-
- /* Need these for lighting (shouldn't upload otherwise)
- */
- if (new_state & (_NEW_MODELVIEW)) {
- upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, R200_MTX_MV );
- upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, R200_MTX_IMV );
- }
-
- /* Does this need to be triggered on eg. modelview for
- * texgen-derived objplane/eyeplane matrices?
- */
- if (new_state & (_NEW_TEXTURE|_NEW_TEXTURE_MATRIX)) {
- update_texturematrix( ctx );
- }
-
- if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW|_MESA_NEW_NEED_EYE_COORDS)) {
- update_light( ctx );
- }
-
- /* emit all active clip planes if projection matrix changes.
- */
- if (new_state & (_NEW_PROJECTION)) {
- if (ctx->Transform.ClipPlanesEnabled)
- r200UpdateClipPlanes( ctx );
- }
-
-
- rmesa->NewGLState = 0;
-}
-
-
-static void r200InvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- _ae_invalidate_state( ctx, new_state );
- R200_CONTEXT(ctx)->NewGLState |= new_state;
- r200VtxfmtInvalidate( ctx );
-}
-
-/* A hack. The r200 can actually cope just fine with materials
- * between begin/ends, so fix this. But how ?
- */
-static GLboolean check_material( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLint i;
-
- for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT;
- i < _TNL_ATTRIB_MAT_BACK_INDEXES;
- i++)
- if (tnl->vb.AttribPtr[i] &&
- tnl->vb.AttribPtr[i]->stride)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-static void r200WrapRunPipeline( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLboolean has_material;
-
- if (0)
- fprintf(stderr, "%s, newstate: %x\n", __FUNCTION__, rmesa->NewGLState);
-
- /* Validate state:
- */
- if (rmesa->NewGLState)
- r200ValidateState( ctx );
-
- has_material = (ctx->Light.Enabled && check_material( ctx ));
-
- if (has_material) {
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_MATERIAL, GL_TRUE );
- }
-
- /* Run the pipeline.
- */
- _tnl_run_pipeline( ctx );
-
- if (has_material) {
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_MATERIAL, GL_FALSE );
- }
-}
-
-
-/* Initialize the driver's state functions.
- */
-void r200InitStateFuncs( struct dd_function_table *functions )
-{
- functions->UpdateState = r200InvalidateState;
- functions->LightingSpaceChange = r200LightingSpaceChange;
-
- functions->DrawBuffer = r200DrawBuffer;
- functions->ReadBuffer = r200ReadBuffer;
-
- functions->AlphaFunc = r200AlphaFunc;
- functions->BlendColor = r200BlendColor;
- functions->BlendEquationSeparate = r200BlendEquationSeparate;
- functions->BlendFuncSeparate = r200BlendFuncSeparate;
- functions->ClearColor = r200ClearColor;
- functions->ClearDepth = r200ClearDepth;
- functions->ClearIndex = NULL;
- functions->ClearStencil = r200ClearStencil;
- functions->ClipPlane = r200ClipPlane;
- functions->ColorMask = r200ColorMask;
- functions->CullFace = r200CullFace;
- functions->DepthFunc = r200DepthFunc;
- functions->DepthMask = r200DepthMask;
- functions->DepthRange = r200DepthRange;
- functions->Enable = r200Enable;
- functions->Fogfv = r200Fogfv;
- functions->FrontFace = r200FrontFace;
- functions->Hint = NULL;
- functions->IndexMask = NULL;
- functions->LightModelfv = r200LightModelfv;
- functions->Lightfv = r200Lightfv;
- functions->LineStipple = r200LineStipple;
- functions->LineWidth = r200LineWidth;
- functions->LogicOpcode = r200LogicOpCode;
- functions->PolygonMode = r200PolygonMode;
- functions->PolygonOffset = r200PolygonOffset;
- functions->PolygonStipple = r200PolygonStipple;
- functions->PointSize = r200PointSize;
- functions->RenderMode = r200RenderMode;
- functions->Scissor = r200Scissor;
- functions->ShadeModel = r200ShadeModel;
- functions->StencilFunc = r200StencilFunc;
- functions->StencilMask = r200StencilMask;
- functions->StencilOp = r200StencilOp;
- functions->Viewport = r200Viewport;
-
- /* Swrast hooks for imaging extensions:
- */
- functions->CopyColorTable = _swrast_CopyColorTable;
- functions->CopyColorSubTable = _swrast_CopyColorSubTable;
- functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
-
-
-void r200InitTnlFuncs( GLcontext *ctx )
-{
- TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange = r200UpdateMaterial;
- TNL_CONTEXT(ctx)->Driver.RunPipeline = r200WrapRunPipeline;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.h
deleted file mode 100644
index d467d73bd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state.h,v 1.2 2002/11/05 17:46:08 tsi Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_STATE_H__
-#define __R200_STATE_H__
-
-#include "r200_context.h"
-
-extern void r200InitState( r200ContextPtr rmesa );
-extern void r200InitStateFuncs( struct dd_function_table *functions );
-extern void r200InitTnlFuncs( GLcontext *ctx );
-
-extern void r200UpdateMaterial( GLcontext *ctx );
-
-extern void r200SetCliprects( r200ContextPtr rmesa, GLenum mode );
-extern void r200RecalcScissorRects( r200ContextPtr rmesa );
-extern void r200UpdateViewportOffset( GLcontext *ctx );
-extern void r200UpdateWindow( GLcontext *ctx );
-
-extern void r200ValidateState( GLcontext *ctx );
-
-extern void r200PrintDirty( r200ContextPtr rmesa,
- const char *msg );
-
-
-extern void r200Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( rmesa, bit, mode ) do { \
- if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n", \
- __FUNCTION__, bit, mode ); \
- r200Fallback( rmesa->glCtx, bit, mode ); \
-} while (0)
-
-extern void r200LightingSpaceChange( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state_init.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state_init.c
deleted file mode 100644
index f004cf79c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_state_init.c
+++ /dev/null
@@ -1,798 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state_init.c,v 1.4 2003/02/22 06:21:11 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "enums.h"
-#include "colormac.h"
-#include "api_arrayelt.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_state.h"
-#include "r200_tcl.h"
-#include "r200_tex.h"
-#include "r200_swtcl.h"
-#include "r200_vtxfmt.h"
-
-#include "xmlpool.h"
-
-/* =============================================================
- * State initialization
- */
-
-void r200PrintDirty( r200ContextPtr rmesa, const char *msg )
-{
- struct r200_state_atom *l;
-
- fprintf(stderr, msg);
- fprintf(stderr, ": ");
-
- foreach(l, &rmesa->hw.atomlist) {
- if (l->dirty || rmesa->hw.all_dirty)
- fprintf(stderr, "%s, ", l->name);
- }
-
- fprintf(stderr, "\n");
-}
-
-static int cmdpkt( int id )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.packet.cmd_type = RADEON_CMD_PACKET;
- h.packet.packet_id = id;
- return h.i;
-}
-
-static int cmdvec( int offset, int stride, int count )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.vectors.cmd_type = RADEON_CMD_VECTORS;
- h.vectors.offset = offset;
- h.vectors.stride = stride;
- h.vectors.count = count;
- return h.i;
-}
-
-static int cmdscl( int offset, int stride, int count )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.scalars.cmd_type = RADEON_CMD_SCALARS;
- h.scalars.offset = offset;
- h.scalars.stride = stride;
- h.scalars.count = count;
- return h.i;
-}
-
-static int cmdscl2( int offset, int stride, int count )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.scalars.cmd_type = RADEON_CMD_SCALARS2;
- h.scalars.offset = offset - 0x100;
- h.scalars.stride = stride;
- h.scalars.count = count;
- return h.i;
-}
-
-#define CHECK( NM, FLAG ) \
-static GLboolean check_##NM( GLcontext *ctx, int idx ) \
-{ \
- (void) idx; \
- return FLAG; \
-}
-
-#define TCL_CHECK( NM, FLAG ) \
-static GLboolean check_##NM( GLcontext *ctx, int idx ) \
-{ \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- (void) idx; \
- return !rmesa->TclFallback && (FLAG); \
-}
-
-
-
-CHECK( always, GL_TRUE )
-CHECK( never, GL_FALSE )
-CHECK( tex_any, ctx->Texture._EnabledUnits )
-CHECK( tex_pair, (ctx->Texture.Unit[idx]._ReallyEnabled | ctx->Texture.Unit[idx & ~1]._ReallyEnabled))
-CHECK( tex, ctx->Texture.Unit[idx]._ReallyEnabled )
-CHECK( tex_cube, ctx->Texture.Unit[idx]._ReallyEnabled & TEXTURE_CUBE_BIT)
-CHECK( fog, ctx->Fog.Enabled )
-TCL_CHECK( tcl, GL_TRUE )
-TCL_CHECK( tcl_tex, ctx->Texture.Unit[idx]._ReallyEnabled )
-TCL_CHECK( tcl_lighting, ctx->Light.Enabled )
-TCL_CHECK( tcl_light, ctx->Light.Enabled && ctx->Light.Light[idx].Enabled )
-TCL_CHECK( tcl_ucp, (ctx->Transform.ClipPlanesEnabled & (1 << idx)) )
-
-
-/* Initialize the context's hardware state.
- */
-void r200InitState( r200ContextPtr rmesa )
-{
- GLcontext *ctx = rmesa->glCtx;
- GLuint color_fmt, depth_fmt, i;
-
- switch ( rmesa->r200Screen->cpp ) {
- case 2:
- color_fmt = R200_COLOR_FORMAT_RGB565;
- break;
- case 4:
- color_fmt = R200_COLOR_FORMAT_ARGB8888;
- break;
- default:
- fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
- exit( -1 );
- }
-
- rmesa->state.color.clear = 0x00000000;
-
- switch ( ctx->Visual.depthBits ) {
- case 16:
- rmesa->state.depth.clear = 0x0000ffff;
- rmesa->state.depth.scale = 1.0 / (GLfloat)0xffff;
- depth_fmt = R200_DEPTH_FORMAT_16BIT_INT_Z;
- rmesa->state.stencil.clear = 0x00000000;
- break;
- case 24:
- rmesa->state.depth.clear = 0x00ffffff;
- rmesa->state.depth.scale = 1.0 / (GLfloat)0xffffff;
- depth_fmt = R200_DEPTH_FORMAT_24BIT_INT_Z;
- rmesa->state.stencil.clear = 0xffff0000;
- break;
- default:
- fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
- ctx->Visual.depthBits );
- exit( -1 );
- }
-
- /* Only have hw stencil when depth buffer is 24 bits deep */
- rmesa->state.stencil.hwBuffer = ( ctx->Visual.stencilBits > 0 &&
- ctx->Visual.depthBits == 24 );
-
- rmesa->Fallback = 0;
-
- if ( ctx->Visual.doubleBufferMode && rmesa->sarea->pfCurrentPage == 0 ) {
- rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
- }
-
- rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset;
- rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch;
-
- rmesa->hw.max_state_size = 0;
-
-#define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \
- do { \
- rmesa->hw.ATOM.cmd_size = SZ; \
- rmesa->hw.ATOM.cmd = (int *)CALLOC(SZ * sizeof(int)); \
- rmesa->hw.ATOM.lastcmd = (int *)CALLOC(SZ * sizeof(int)); \
- rmesa->hw.ATOM.name = NM; \
- rmesa->hw.ATOM.idx = IDX; \
- rmesa->hw.ATOM.check = check_##CHK; \
- rmesa->hw.ATOM.dirty = GL_FALSE; \
- rmesa->hw.max_state_size += SZ * sizeof(int); \
- } while (0)
-
-
- /* Allocate state buffers:
- */
- if (rmesa->r200Screen->drmSupportsBlendColor)
- ALLOC_STATE( ctx, always, CTX_STATE_SIZE_NEWDRM, "CTX/context", 0 );
- else
- ALLOC_STATE( ctx, always, CTX_STATE_SIZE_OLDDRM, "CTX/context", 0 );
- ALLOC_STATE( set, always, SET_STATE_SIZE, "SET/setup", 0 );
- ALLOC_STATE( lin, always, LIN_STATE_SIZE, "LIN/line", 0 );
- ALLOC_STATE( msk, always, MSK_STATE_SIZE, "MSK/mask", 0 );
- ALLOC_STATE( vpt, always, VPT_STATE_SIZE, "VPT/viewport", 0 );
- ALLOC_STATE( vtx, always, VTX_STATE_SIZE, "VTX/vertex", 0 );
- ALLOC_STATE( vap, always, VAP_STATE_SIZE, "VAP/vap", 0 );
- ALLOC_STATE( vte, always, VTE_STATE_SIZE, "VTE/vte", 0 );
- ALLOC_STATE( msc, always, MSC_STATE_SIZE, "MSC/misc", 0 );
- ALLOC_STATE( cst, always, CST_STATE_SIZE, "CST/constant", 0 );
- ALLOC_STATE( zbs, always, ZBS_STATE_SIZE, "ZBS/zbias", 0 );
- ALLOC_STATE( tf, tex_any, TF_STATE_SIZE, "TF/tfactor", 0 );
- if (rmesa->r200Screen->chipset & R200_CHIPSET_REAL_R200) {
- /* make sure texture units 0/1 are emitted pair-wise for r200 t0 hang workaround */
- ALLOC_STATE( tex[0], tex_pair, TEX_STATE_SIZE, "TEX/tex-0", 0 );
- ALLOC_STATE( tex[1], tex_pair, TEX_STATE_SIZE, "TEX/tex-1", 1 );
- ALLOC_STATE( tam, tex_any, TAM_STATE_SIZE, "TAM/tam", 0 );
- }
- else {
- ALLOC_STATE( tex[0], tex, TEX_STATE_SIZE, "TEX/tex-0", 0 );
- ALLOC_STATE( tex[1], tex, TEX_STATE_SIZE, "TEX/tex-1", 1 );
- ALLOC_STATE( tam, never, TAM_STATE_SIZE, "TAM/tam", 0 );
- }
- ALLOC_STATE( tex[2], tex, TEX_STATE_SIZE, "TEX/tex-2", 2 );
- ALLOC_STATE( tex[3], tex, TEX_STATE_SIZE, "TEX/tex-3", 3 );
- ALLOC_STATE( tex[4], tex, TEX_STATE_SIZE, "TEX/tex-4", 4 );
- ALLOC_STATE( tex[5], tex, TEX_STATE_SIZE, "TEX/tex-5", 5 );
- if (rmesa->r200Screen->drmSupportsCubeMaps) {
- ALLOC_STATE( cube[0], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-0", 0 );
- ALLOC_STATE( cube[1], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-1", 1 );
- ALLOC_STATE( cube[2], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-2", 2 );
- ALLOC_STATE( cube[3], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-3", 3 );
- ALLOC_STATE( cube[4], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-4", 4 );
- ALLOC_STATE( cube[5], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-5", 5 );
- }
- else {
- ALLOC_STATE( cube[0], never, CUBE_STATE_SIZE, "CUBE/tex-0", 0 );
- ALLOC_STATE( cube[1], never, CUBE_STATE_SIZE, "CUBE/tex-1", 1 );
- ALLOC_STATE( cube[2], never, CUBE_STATE_SIZE, "CUBE/tex-2", 2 );
- ALLOC_STATE( cube[3], never, CUBE_STATE_SIZE, "CUBE/tex-3", 3 );
- ALLOC_STATE( cube[4], never, CUBE_STATE_SIZE, "CUBE/tex-4", 4 );
- ALLOC_STATE( cube[5], never, CUBE_STATE_SIZE, "CUBE/tex-5", 5 );
- }
-
- ALLOC_STATE( tcl, tcl, TCL_STATE_SIZE, "TCL/tcl", 0 );
- ALLOC_STATE( msl, tcl, MSL_STATE_SIZE, "MSL/matrix-select", 0 );
- ALLOC_STATE( tcg, tcl, TCG_STATE_SIZE, "TCG/texcoordgen", 0 );
- ALLOC_STATE( mtl[0], tcl_lighting, MTL_STATE_SIZE, "MTL0/material0", 0 );
- ALLOC_STATE( mtl[1], tcl_lighting, MTL_STATE_SIZE, "MTL1/material1", 1 );
- ALLOC_STATE( grd, tcl, GRD_STATE_SIZE, "GRD/guard-band", 0 );
- ALLOC_STATE( fog, fog, FOG_STATE_SIZE, "FOG/fog", 0 );
- ALLOC_STATE( glt, tcl_lighting, GLT_STATE_SIZE, "GLT/light-global", 0 );
- ALLOC_STATE( eye, tcl_lighting, EYE_STATE_SIZE, "EYE/eye-vector", 0 );
- ALLOC_STATE( mat[R200_MTX_MV], tcl, MAT_STATE_SIZE, "MAT/modelview", 0 );
- ALLOC_STATE( mat[R200_MTX_IMV], tcl, MAT_STATE_SIZE, "MAT/it-modelview", 0 );
- ALLOC_STATE( mat[R200_MTX_MVP], tcl, MAT_STATE_SIZE, "MAT/modelproject", 0 );
- ALLOC_STATE( mat[R200_MTX_TEX0], tcl_tex, MAT_STATE_SIZE, "MAT/texmat0", 0 );
- ALLOC_STATE( mat[R200_MTX_TEX1], tcl_tex, MAT_STATE_SIZE, "MAT/texmat1", 1 );
- ALLOC_STATE( mat[R200_MTX_TEX2], tcl_tex, MAT_STATE_SIZE, "MAT/texmat2", 2 );
- ALLOC_STATE( mat[R200_MTX_TEX3], tcl_tex, MAT_STATE_SIZE, "MAT/texmat3", 3 );
- ALLOC_STATE( mat[R200_MTX_TEX4], tcl_tex, MAT_STATE_SIZE, "MAT/texmat4", 4 );
- ALLOC_STATE( mat[R200_MTX_TEX5], tcl_tex, MAT_STATE_SIZE, "MAT/texmat5", 5 );
- ALLOC_STATE( ucp[0], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-0", 0 );
- ALLOC_STATE( ucp[1], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-1", 1 );
- ALLOC_STATE( ucp[2], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-2", 2 );
- ALLOC_STATE( ucp[3], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-3", 3 );
- ALLOC_STATE( ucp[4], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-4", 4 );
- ALLOC_STATE( ucp[5], tcl_ucp, UCP_STATE_SIZE, "UCP/userclip-5", 5 );
- ALLOC_STATE( lit[0], tcl_light, LIT_STATE_SIZE, "LIT/light-0", 0 );
- ALLOC_STATE( lit[1], tcl_light, LIT_STATE_SIZE, "LIT/light-1", 1 );
- ALLOC_STATE( lit[2], tcl_light, LIT_STATE_SIZE, "LIT/light-2", 2 );
- ALLOC_STATE( lit[3], tcl_light, LIT_STATE_SIZE, "LIT/light-3", 3 );
- ALLOC_STATE( lit[4], tcl_light, LIT_STATE_SIZE, "LIT/light-4", 4 );
- ALLOC_STATE( lit[5], tcl_light, LIT_STATE_SIZE, "LIT/light-5", 5 );
- ALLOC_STATE( lit[6], tcl_light, LIT_STATE_SIZE, "LIT/light-6", 6 );
- ALLOC_STATE( lit[7], tcl_light, LIT_STATE_SIZE, "LIT/light-7", 7 );
- ALLOC_STATE( pix[0], always, PIX_STATE_SIZE, "PIX/pixstage-0", 0 );
- ALLOC_STATE( pix[1], tex, PIX_STATE_SIZE, "PIX/pixstage-1", 1 );
- ALLOC_STATE( pix[2], tex, PIX_STATE_SIZE, "PIX/pixstage-2", 2 );
- ALLOC_STATE( pix[3], tex, PIX_STATE_SIZE, "PIX/pixstage-3", 3 );
- ALLOC_STATE( pix[4], tex, PIX_STATE_SIZE, "PIX/pixstage-4", 4 );
- ALLOC_STATE( pix[5], tex, PIX_STATE_SIZE, "PIX/pixstage-5", 5 );
- if (rmesa->r200Screen->drmSupportsTriPerf) {
- ALLOC_STATE( prf, always, PRF_STATE_SIZE, "PRF/performance-tri", 0 );
- }
- else {
- ALLOC_STATE( prf, never, PRF_STATE_SIZE, "PRF/performance-tri", 0 );
- }
-
- r200SetUpAtomList( rmesa );
-
- /* Fill in the packet headers:
- */
- rmesa->hw.ctx.cmd[CTX_CMD_0] = cmdpkt(RADEON_EMIT_PP_MISC);
- rmesa->hw.ctx.cmd[CTX_CMD_1] = cmdpkt(RADEON_EMIT_PP_CNTL);
- rmesa->hw.ctx.cmd[CTX_CMD_2] = cmdpkt(RADEON_EMIT_RB3D_COLORPITCH);
- if (rmesa->r200Screen->drmSupportsBlendColor)
- rmesa->hw.ctx.cmd[CTX_CMD_3] = cmdpkt(R200_EMIT_RB3D_BLENDCOLOR);
- rmesa->hw.lin.cmd[LIN_CMD_0] = cmdpkt(RADEON_EMIT_RE_LINE_PATTERN);
- rmesa->hw.lin.cmd[LIN_CMD_1] = cmdpkt(RADEON_EMIT_SE_LINE_WIDTH);
- rmesa->hw.msk.cmd[MSK_CMD_0] = cmdpkt(RADEON_EMIT_RB3D_STENCILREFMASK);
- rmesa->hw.vpt.cmd[VPT_CMD_0] = cmdpkt(RADEON_EMIT_SE_VPORT_XSCALE);
- rmesa->hw.set.cmd[SET_CMD_0] = cmdpkt(RADEON_EMIT_SE_CNTL);
- rmesa->hw.msc.cmd[MSC_CMD_0] = cmdpkt(RADEON_EMIT_RE_MISC);
- rmesa->hw.cst.cmd[CST_CMD_0] = cmdpkt(R200_EMIT_PP_CNTL_X);
- rmesa->hw.cst.cmd[CST_CMD_1] = cmdpkt(R200_EMIT_RB3D_DEPTHXY_OFFSET);
- rmesa->hw.cst.cmd[CST_CMD_2] = cmdpkt(R200_EMIT_RE_AUX_SCISSOR_CNTL);
- rmesa->hw.cst.cmd[CST_CMD_3] = cmdpkt(R200_EMIT_RE_SCISSOR_TL_0);
- rmesa->hw.cst.cmd[CST_CMD_4] = cmdpkt(R200_EMIT_SE_VAP_CNTL_STATUS);
- rmesa->hw.cst.cmd[CST_CMD_5] = cmdpkt(R200_EMIT_RE_POINTSIZE);
- rmesa->hw.cst.cmd[CST_CMD_6] = cmdpkt(R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0);
- rmesa->hw.tam.cmd[TAM_CMD_0] = cmdpkt(R200_EMIT_PP_TAM_DEBUG3);
- rmesa->hw.tf.cmd[TF_CMD_0] = cmdpkt(R200_EMIT_TFACTOR_0);
- rmesa->hw.tex[0].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_0);
- rmesa->hw.tex[0].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_0);
- rmesa->hw.tex[1].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_1);
- rmesa->hw.tex[1].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_1);
- rmesa->hw.tex[2].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_2);
- rmesa->hw.tex[2].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_2);
- rmesa->hw.tex[3].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_3);
- rmesa->hw.tex[3].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_3);
- rmesa->hw.tex[4].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_4);
- rmesa->hw.tex[4].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_4);
- rmesa->hw.tex[5].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_5);
- rmesa->hw.tex[5].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_5);
- rmesa->hw.cube[0].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_0);
- rmesa->hw.cube[0].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_0);
- rmesa->hw.cube[1].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_1);
- rmesa->hw.cube[1].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_1);
- rmesa->hw.cube[2].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_2);
- rmesa->hw.cube[2].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_2);
- rmesa->hw.cube[3].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_3);
- rmesa->hw.cube[3].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_3);
- rmesa->hw.cube[4].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_4);
- rmesa->hw.cube[4].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_4);
- rmesa->hw.cube[5].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_5);
- rmesa->hw.cube[5].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_5);
- rmesa->hw.pix[0].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_0);
- rmesa->hw.pix[1].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_1);
- rmesa->hw.pix[2].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_2);
- rmesa->hw.pix[3].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_3);
- rmesa->hw.pix[4].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_4);
- rmesa->hw.pix[5].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_5);
- rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(RADEON_EMIT_SE_ZBIAS_FACTOR);
- rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(R200_EMIT_TCL_LIGHT_MODEL_CTL_0);
- rmesa->hw.tcl.cmd[TCL_CMD_1] = cmdpkt(R200_EMIT_TCL_UCP_VERT_BLEND_CTL);
- rmesa->hw.tcg.cmd[TCG_CMD_0] = cmdpkt(R200_EMIT_TEX_PROC_CTL_2);
- rmesa->hw.msl.cmd[MSL_CMD_0] = cmdpkt(R200_EMIT_MATRIX_SELECT_0);
- rmesa->hw.vap.cmd[VAP_CMD_0] = cmdpkt(R200_EMIT_VAP_CTL);
- rmesa->hw.vtx.cmd[VTX_CMD_0] = cmdpkt(R200_EMIT_VTX_FMT_0);
- rmesa->hw.vtx.cmd[VTX_CMD_1] = cmdpkt(R200_EMIT_OUTPUT_VTX_COMP_SEL);
- rmesa->hw.vtx.cmd[VTX_CMD_2] = cmdpkt(R200_EMIT_SE_VTX_STATE_CNTL);
- rmesa->hw.vte.cmd[VTE_CMD_0] = cmdpkt(R200_EMIT_VTE_CNTL);
- rmesa->hw.prf.cmd[PRF_CMD_0] = cmdpkt(R200_EMIT_PP_TRI_PERF_CNTL);
- rmesa->hw.mtl[0].cmd[MTL_CMD_0] =
- cmdvec( R200_VS_MAT_0_EMISS, 1, 16 );
- rmesa->hw.mtl[0].cmd[MTL_CMD_1] =
- cmdscl2( R200_SS_MAT_0_SHININESS, 1, 1 );
- rmesa->hw.mtl[1].cmd[MTL_CMD_0] =
- cmdvec( R200_VS_MAT_1_EMISS, 1, 16 );
- rmesa->hw.mtl[1].cmd[MTL_CMD_1] =
- cmdscl2( R200_SS_MAT_1_SHININESS, 1, 1 );
-
- rmesa->hw.grd.cmd[GRD_CMD_0] =
- cmdscl( R200_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
- rmesa->hw.fog.cmd[FOG_CMD_0] =
- cmdvec( R200_VS_FOG_PARAM_ADDR, 1, 4 );
- rmesa->hw.glt.cmd[GLT_CMD_0] =
- cmdvec( R200_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
- rmesa->hw.eye.cmd[EYE_CMD_0] =
- cmdvec( R200_VS_EYE_VECTOR_ADDR, 1, 4 );
-
- rmesa->hw.mat[R200_MTX_MV].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_0_MV, 1, 16);
- rmesa->hw.mat[R200_MTX_IMV].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_1_INV_MV, 1, 16);
- rmesa->hw.mat[R200_MTX_MVP].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_2_MVP, 1, 16);
- rmesa->hw.mat[R200_MTX_TEX0].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_3_TEX0, 1, 16);
- rmesa->hw.mat[R200_MTX_TEX1].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_4_TEX1, 1, 16);
- rmesa->hw.mat[R200_MTX_TEX2].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_5_TEX2, 1, 16);
- rmesa->hw.mat[R200_MTX_TEX3].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_6_TEX3, 1, 16);
- rmesa->hw.mat[R200_MTX_TEX4].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_7_TEX4, 1, 16);
- rmesa->hw.mat[R200_MTX_TEX5].cmd[MAT_CMD_0] =
- cmdvec( R200_VS_MATRIX_8_TEX5, 1, 16);
-
- for (i = 0 ; i < 8; i++) {
- rmesa->hw.lit[i].cmd[LIT_CMD_0] =
- cmdvec( R200_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
- rmesa->hw.lit[i].cmd[LIT_CMD_1] =
- cmdscl( R200_SS_LIGHT_DCD_ADDR + i, 8, 7 );
- }
-
- for (i = 0 ; i < 6; i++) {
- rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
- cmdvec( R200_VS_UCP_ADDR + i, 1, 4 );
- }
-
- /* Initial Harware state:
- */
- rmesa->hw.ctx.cmd[CTX_PP_MISC] = (R200_ALPHA_TEST_PASS
- /* | R200_RIGHT_HAND_CUBE_OGL*/);
-
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = (R200_FOG_VERTEX |
- R200_FOG_USE_SPEC_ALPHA);
-
- rmesa->hw.ctx.cmd[CTX_RE_SOLID_COLOR] = 0x00000000;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = (R200_COMB_FCN_ADD_CLAMP |
- (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT));
-
- if (rmesa->r200Screen->drmSupportsBlendColor) {
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCOLOR] = 0x00000000;
- rmesa->hw.ctx.cmd[CTX_RB3D_ABLENDCNTL] = (R200_COMB_FCN_ADD_CLAMP |
- (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT));
- rmesa->hw.ctx.cmd[CTX_RB3D_CBLENDCNTL] = (R200_COMB_FCN_ADD_CLAMP |
- (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT));
- }
-
- rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] =
- rmesa->r200Screen->depthOffset + rmesa->r200Screen->fbLocation;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
- ((rmesa->r200Screen->depthPitch &
- R200_DEPTHPITCH_MASK) |
- R200_DEPTH_ENDIAN_NO_SWAP);
-
- if (rmesa->using_hyperz)
- rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] |= R200_DEPTH_HYPERZ;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] = (depth_fmt |
- R200_Z_TEST_LESS |
- R200_STENCIL_TEST_ALWAYS |
- R200_STENCIL_FAIL_KEEP |
- R200_STENCIL_ZPASS_KEEP |
- R200_STENCIL_ZFAIL_KEEP |
- R200_Z_WRITE_ENABLE);
-
- if (rmesa->using_hyperz) {
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_Z_COMPRESSION_ENABLE |
- R200_Z_DECOMPRESSION_ENABLE;
-/* if (rmesa->r200Screen->chipset & R200_CHIPSET_REAL_R200)
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_HIERARCHY_ENABLE;*/
- }
-
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (R200_ANTI_ALIAS_NONE
- | R200_TEX_BLEND_0_ENABLE);
-
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = color_fmt;
- switch ( driQueryOptioni( &rmesa->optionCache, "dither_mode" ) ) {
- case DRI_CONF_DITHER_XERRORDIFFRESET:
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_DITHER_INIT;
- break;
- case DRI_CONF_DITHER_ORDERED:
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_SCALE_DITHER_ENABLE;
- break;
- }
- if ( driQueryOptioni( &rmesa->optionCache, "round_mode" ) ==
- DRI_CONF_ROUND_ROUND )
- rmesa->state.color.roundEnable = R200_ROUND_ENABLE;
- else
- rmesa->state.color.roundEnable = 0;
- if ( driQueryOptioni (&rmesa->optionCache, "color_reduction" ) ==
- DRI_CONF_COLOR_REDUCTION_DITHER )
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= R200_DITHER_ENABLE;
- else
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= rmesa->state.color.roundEnable;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset +
- rmesa->r200Screen->fbLocation)
- & R200_COLOROFFSET_MASK);
-
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = ((rmesa->state.color.drawPitch &
- R200_COLORPITCH_MASK) |
- R200_COLOR_ENDIAN_NO_SWAP);
- /* (fixed size) sarea is initialized to zero afaics so can omit version check. Phew! */
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= R200_COLOR_TILE_ENABLE;
- }
-
- rmesa->hw.prf.cmd[PRF_PP_TRI_PERF] = R200_TRI_CUTOFF_MASK - R200_TRI_CUTOFF_MASK *
- driQueryOptionf (&rmesa->optionCache,"texture_blend_quality");
- rmesa->hw.prf.cmd[PRF_PP_PERF_CNTL] = 0;
-
- rmesa->hw.set.cmd[SET_SE_CNTL] = (R200_FFACE_CULL_CCW |
- R200_BFACE_SOLID |
- R200_FFACE_SOLID |
- R200_FLAT_SHADE_VTX_LAST |
- R200_DIFFUSE_SHADE_GOURAUD |
- R200_ALPHA_SHADE_GOURAUD |
- R200_SPECULAR_SHADE_GOURAUD |
- R200_FOG_SHADE_GOURAUD |
- R200_VTX_PIX_CENTER_OGL |
- R200_ROUND_MODE_TRUNC |
- R200_ROUND_PREC_8TH_PIX);
-
- rmesa->hw.set.cmd[SET_RE_CNTL] = (R200_PERSPECTIVE_ENABLE |
- R200_SCISSOR_ENABLE);
-
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] = ((1 << 16) | 0xffff);
-
- rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
- ((0 << R200_LINE_CURRENT_PTR_SHIFT) |
- (1 << R200_LINE_CURRENT_COUNT_SHIFT));
-
- rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
-
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
- ((0x00 << R200_STENCIL_REF_SHIFT) |
- (0xff << R200_STENCIL_MASK_SHIFT) |
- (0xff << R200_STENCIL_WRITEMASK_SHIFT));
-
- rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = R200_ROP_COPY;
- rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = 0xffffffff;
-
- rmesa->hw.tam.cmd[TAM_DEBUG3] = 0;
-
- rmesa->hw.msc.cmd[MSC_RE_MISC] =
- ((0 << R200_STIPPLE_X_OFFSET_SHIFT) |
- (0 << R200_STIPPLE_Y_OFFSET_SHIFT) |
- R200_STIPPLE_BIG_BIT_ORDER);
-
-
- rmesa->hw.cst.cmd[CST_PP_CNTL_X] = 0;
- rmesa->hw.cst.cmd[CST_RB3D_DEPTHXY_OFFSET] = 0;
- rmesa->hw.cst.cmd[CST_RE_AUX_SCISSOR_CNTL] = 0x0;
- rmesa->hw.cst.cmd[CST_RE_SCISSOR_TL_0] = 0;
- rmesa->hw.cst.cmd[CST_RE_SCISSOR_BR_0] = 0;
- rmesa->hw.cst.cmd[CST_SE_VAP_CNTL_STATUS] =
-#ifdef MESA_BIG_ENDIAN
- R200_VC_32BIT_SWAP;
-#else
- R200_VC_NO_SWAP;
-#endif
-
- if (!(rmesa->r200Screen->chipset & R200_CHIPSET_TCL)) {
- /* Bypass TCL */
- rmesa->hw.cst.cmd[CST_SE_VAP_CNTL_STATUS] |= (1<<8);
- }
-
- rmesa->hw.cst.cmd[CST_RE_POINTSIZE] = 0x100010;
- rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_0] =
- (0x0 << R200_VERTEX_POSITION_ADDR__SHIFT);
- rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_1] =
- (0x02 << R200_VTX_COLOR_0_ADDR__SHIFT) |
- (0x03 << R200_VTX_COLOR_1_ADDR__SHIFT);
- rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_2] =
- (0x06 << R200_VTX_TEX_0_ADDR__SHIFT) |
- (0x07 << R200_VTX_TEX_1_ADDR__SHIFT) |
- (0x08 << R200_VTX_TEX_2_ADDR__SHIFT) |
- (0x09 << R200_VTX_TEX_3_ADDR__SHIFT);
- rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_3] =
- (0x0A << R200_VTX_TEX_4_ADDR__SHIFT) |
- (0x0B << R200_VTX_TEX_5_ADDR__SHIFT);
-
-
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = 0x00000000;
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL;
- rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
- ((i << R200_TXFORMAT_ST_ROUTE_SHIFT) | /* <-- note i */
- (2 << R200_TXFORMAT_WIDTH_SHIFT) |
- (2 << R200_TXFORMAT_HEIGHT_SHIFT));
- rmesa->hw.tex[i].cmd[TEX_PP_TXOFFSET] =
- rmesa->r200Screen->texOffset[RADEON_LOCAL_TEX_HEAP];
- rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0;
- rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT_X] =
- (/* R200_TEXCOORD_PROJ | */
- 0x100000); /* Small default bias */
-
- rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_FACES] = 0;
- rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F1] =
- rmesa->r200Screen->texOffset[RADEON_LOCAL_TEX_HEAP];
- rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F2] =
- rmesa->r200Screen->texOffset[RADEON_LOCAL_TEX_HEAP];
- rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F3] =
- rmesa->r200Screen->texOffset[RADEON_LOCAL_TEX_HEAP];
- rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F4] =
- rmesa->r200Screen->texOffset[RADEON_LOCAL_TEX_HEAP];
- rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F5] =
- rmesa->r200Screen->texOffset[RADEON_LOCAL_TEX_HEAP];
-
- rmesa->hw.pix[i].cmd[PIX_PP_TXCBLEND] =
- (R200_TXC_ARG_A_ZERO |
- R200_TXC_ARG_B_ZERO |
- R200_TXC_ARG_C_DIFFUSE_COLOR |
- R200_TXC_OP_MADD);
-
- rmesa->hw.pix[i].cmd[PIX_PP_TXCBLEND2] =
- ((i << R200_TXC_TFACTOR_SEL_SHIFT) |
- R200_TXC_SCALE_1X |
- R200_TXC_CLAMP_0_1 |
- R200_TXC_OUTPUT_REG_R0);
-
- rmesa->hw.pix[i].cmd[PIX_PP_TXABLEND] =
- (R200_TXA_ARG_A_ZERO |
- R200_TXA_ARG_B_ZERO |
- R200_TXA_ARG_C_DIFFUSE_ALPHA |
- R200_TXA_OP_MADD);
-
- rmesa->hw.pix[i].cmd[PIX_PP_TXABLEND2] =
- ((i << R200_TXA_TFACTOR_SEL_SHIFT) |
- R200_TXA_SCALE_1X |
- R200_TXA_CLAMP_0_1 |
- R200_TXA_OUTPUT_REG_R0);
- }
-
- rmesa->hw.tf.cmd[TF_TFACTOR_0] = 0;
- rmesa->hw.tf.cmd[TF_TFACTOR_1] = 0;
- rmesa->hw.tf.cmd[TF_TFACTOR_2] = 0;
- rmesa->hw.tf.cmd[TF_TFACTOR_3] = 0;
- rmesa->hw.tf.cmd[TF_TFACTOR_4] = 0;
- rmesa->hw.tf.cmd[TF_TFACTOR_5] = 0;
-
- rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] =
- (R200_VAP_TCL_ENABLE |
- (0x9 << R200_VAP_VF_MAX_VTX_NUM__SHIFT));
-
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] =
- (R200_VPORT_X_SCALE_ENA |
- R200_VPORT_Y_SCALE_ENA |
- R200_VPORT_Z_SCALE_ENA |
- R200_VPORT_X_OFFSET_ENA |
- R200_VPORT_Y_OFFSET_ENA |
- R200_VPORT_Z_OFFSET_ENA |
-/* FIXME: Turn on for tex rect only */
- R200_VTX_ST_DENORMALIZED |
- R200_VTX_W0_FMT);
-
-
- rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = 0;
- rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = 0;
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] =
- ((R200_VTX_Z0 | R200_VTX_W0 |
- (R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT)));
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] = 0;
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = (R200_OUTPUT_XYZW);
- rmesa->hw.vtx.cmd[VTX_STATE_CNTL] = R200_VSC_UPDATE_USER_COLOR_0_ENABLE;
-
-
- /* Matrix selection */
- rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_0] =
- (R200_MTX_MV << R200_MODELVIEW_0_SHIFT);
-
- rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_1] =
- (R200_MTX_IMV << R200_IT_MODELVIEW_0_SHIFT);
-
- rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_2] =
- (R200_MTX_MVP << R200_MODELPROJECT_0_SHIFT);
-
- rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_3] =
- ((R200_MTX_TEX0 << R200_TEXMAT_0_SHIFT) |
- (R200_MTX_TEX1 << R200_TEXMAT_1_SHIFT) |
- (R200_MTX_TEX2 << R200_TEXMAT_2_SHIFT) |
- (R200_MTX_TEX3 << R200_TEXMAT_3_SHIFT));
-
- rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_4] =
- ((R200_MTX_TEX4 << R200_TEXMAT_4_SHIFT) |
- (R200_MTX_TEX5 << R200_TEXMAT_5_SHIFT));
-
-
- /* General TCL state */
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] =
- (R200_SPECULAR_LIGHTS |
- R200_DIFFUSE_SPECULAR_COMBINE |
- R200_LOCAL_LIGHT_VEC_GL |
- R200_LM0_SOURCE_MATERIAL_0 << R200_FRONT_SHININESS_SOURCE_SHIFT |
- R200_LM0_SOURCE_MATERIAL_1 << R200_BACK_SHININESS_SOURCE_SHIFT);
-
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] =
- ((R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_SPECULAR_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_EMISSIVE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_AMBIENT_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_DIFFUSE_SOURCE_SHIFT) |
- (R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_SPECULAR_SOURCE_SHIFT));
-
- rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_0] = 0; /* filled in via callbacks */
- rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_1] = 0;
- rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_2] = 0;
- rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_3] = 0;
-
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
- (R200_UCP_IN_CLIP_SPACE |
- R200_CULL_FRONT_IS_CCW);
-
- /* Texgen/Texmat state */
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] = 0x00ffffff;
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_3] =
- ((0 << R200_TEXGEN_0_INPUT_TEX_SHIFT) |
- (1 << R200_TEXGEN_1_INPUT_TEX_SHIFT) |
- (2 << R200_TEXGEN_2_INPUT_TEX_SHIFT) |
- (3 << R200_TEXGEN_3_INPUT_TEX_SHIFT) |
- (4 << R200_TEXGEN_4_INPUT_TEX_SHIFT) |
- (5 << R200_TEXGEN_5_INPUT_TEX_SHIFT));
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = 0;
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] =
- ((0 << R200_TEXGEN_0_INPUT_SHIFT) |
- (1 << R200_TEXGEN_1_INPUT_SHIFT) |
- (2 << R200_TEXGEN_2_INPUT_SHIFT) |
- (3 << R200_TEXGEN_3_INPUT_SHIFT) |
- (4 << R200_TEXGEN_4_INPUT_SHIFT) |
- (5 << R200_TEXGEN_5_INPUT_SHIFT));
- rmesa->hw.tcg.cmd[TCG_TEX_CYL_WRAP_CTL] = 0;
-
-
- for (i = 0 ; i < 8; i++) {
- struct gl_light *l = &ctx->Light.Light[i];
- GLenum p = GL_LIGHT0 + i;
- *(float *)&(rmesa->hw.lit[i].cmd[LIT_RANGE_CUTOFF]) = FLT_MAX;
-
- ctx->Driver.Lightfv( ctx, p, GL_AMBIENT, l->Ambient );
- ctx->Driver.Lightfv( ctx, p, GL_DIFFUSE, l->Diffuse );
- ctx->Driver.Lightfv( ctx, p, GL_SPECULAR, l->Specular );
- ctx->Driver.Lightfv( ctx, p, GL_POSITION, NULL );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_DIRECTION, NULL );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_EXPONENT, &l->SpotExponent );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
- ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
- &l->ConstantAttenuation );
- ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
- &l->LinearAttenuation );
- ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
- &l->QuadraticAttenuation );
- *(float *)&(rmesa->hw.lit[i].cmd[LIT_ATTEN_XXX]) = 0.0;
- }
-
- ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
- ctx->Light.Model.Ambient );
-
- TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
-
- for (i = 0 ; i < 6; i++) {
- ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, NULL );
- }
-
- ctx->Driver.Fogfv( ctx, GL_FOG_MODE, NULL );
- ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
- ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start );
- ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
- ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
- ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL );
-
- rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
- rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
- rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
- rmesa->hw.grd.cmd[GRD_HORZ_GUARD_DISCARD_ADJ] = IEEE_ONE;
-
- rmesa->hw.eye.cmd[EYE_X] = 0;
- rmesa->hw.eye.cmd[EYE_Y] = 0;
- rmesa->hw.eye.cmd[EYE_Z] = IEEE_ONE;
- rmesa->hw.eye.cmd[EYE_RESCALE_FACTOR] = IEEE_ONE;
-
- r200LightingSpaceChange( ctx );
-
- rmesa->hw.all_dirty = GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.c
deleted file mode 100644
index 94b4978fa..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.c
+++ /dev/null
@@ -1,957 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c,v 1.5 2003/05/06 23:52:08 daenzer Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "enums.h"
-#include "image.h"
-#include "imports.h"
-#include "macros.h"
-
-#include "swrast/s_context.h"
-#include "swrast/s_fog.h"
-#include "swrast_setup/swrast_setup.h"
-#include "math/m_translate.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vtx_api.h"
-
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_state.h"
-#include "r200_swtcl.h"
-#include "r200_tcl.h"
-
-
-static void flush_last_swtcl_prim( r200ContextPtr rmesa );
-
-
-/***********************************************************************
- * Initialization
- ***********************************************************************/
-
-#define EMIT_ATTR( ATTR, STYLE, F0 ) \
-do { \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = (ATTR); \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = (STYLE); \
- rmesa->swtcl.vertex_attr_count++; \
- fmt_0 |= F0; \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = 0; \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = EMIT_PAD; \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].offset = (N); \
- rmesa->swtcl.vertex_attr_count++; \
-} while (0)
-
-static void r200SetVertexFormat( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- int fmt_0 = 0;
- int fmt_1 = 0;
- int offset = 0;
-
-
- /* Important:
- */
- if ( VB->NdcPtr != NULL ) {
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- }
- else {
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->ClipPtr;
- }
-
- assert( VB->AttribPtr[VERT_ATTRIB_POS] != NULL );
- rmesa->swtcl.vertex_attr_count = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if ( !rmesa->swtcl.needproj || (index & _TNL_BITS_TEX_ANY)) { /* need w coord for projected textures */
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F, R200_VTX_XY | R200_VTX_Z0 | R200_VTX_W0 );
- offset = 4;
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F, R200_VTX_XY | R200_VTX_Z0 );
- offset = 3;
- }
-
- rmesa->swtcl.coloroffset = offset;
-#if MESA_LITTLE_ENDIAN
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA, (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) );
-#else
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ABGR, (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) );
-#endif
- offset += 1;
-
- rmesa->swtcl.specoffset = 0;
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
-
-#if MESA_LITTLE_ENDIAN
- if (index & _TNL_BIT_COLOR1) {
- rmesa->swtcl.specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB, (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT) );
- }
- else {
- EMIT_PAD( 3 );
- }
-
- if (index & _TNL_BIT_FOG) {
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT) );
- }
- else {
- EMIT_PAD( 1 );
- }
-#else
- if (index & _TNL_BIT_FOG) {
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT) );
- }
- else {
- EMIT_PAD( 1 );
- }
-
- if (index & _TNL_BIT_COLOR1) {
- rmesa->swtcl.specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, (R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT) );
- }
- else {
- EMIT_PAD( 3 );
- }
-#endif
- }
-
- if (index & _TNL_BITS_TEX_ANY) {
- int i;
-
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (index & _TNL_BIT_TEX(i)) {
- GLuint sz = VB->TexCoordPtr[i]->size;
-
- fmt_1 |= sz << (3 * i);
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_1F + sz - 1, 0 );
- }
- }
- }
-
- if ( (rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] & R200_FOG_USE_MASK)
- != R200_FOG_USE_SPEC_ALPHA ) {
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_USE_MASK;
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= R200_FOG_USE_SPEC_ALPHA;
- }
-
- if ( rmesa->tnl_index != index ||
- (rmesa->hw.vtx.cmd[VTX_VTXFMT_0] != fmt_0) ||
- (rmesa->hw.vtx.cmd[VTX_VTXFMT_1] != fmt_1) ) {
- R200_NEWPRIM(rmesa);
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = fmt_0;
- rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = fmt_1;
-
- rmesa->swtcl.vertex_size =
- _tnl_install_attrs( ctx,
- rmesa->swtcl.vertex_attrs,
- rmesa->swtcl.vertex_attr_count,
- NULL, 0 );
- rmesa->swtcl.vertex_size /= 4;
- rmesa->tnl_index = index;
- }
-}
-
-
-static void r200RenderStart( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- r200SetVertexFormat( ctx );
-
- if (rmesa->dma.flush != 0 &&
- rmesa->dma.flush != flush_last_swtcl_prim)
- rmesa->dma.flush( rmesa );
-}
-
-
-/**
- * Set vertex state for SW TCL. The primary purpose of this function is to
- * determine in advance whether or not the hardware can / should do the
- * projection divide or Mesa should do it.
- */
-void r200ChooseVertexState( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint vte;
- GLuint vap;
-
- /* We must ensure that we don't do _tnl_need_projected_coords while in a
- * rasterization fallback. As this function will be called again when we
- * leave a rasterization fallback, we can just skip it for now.
- */
- if (rmesa->Fallback != 0)
- return;
-
- vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL];
- vap = rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL];
-
- /* HW perspective divide is a win, but tiny vertex formats are a
- * bigger one.
- */
- if ( ((tnl->render_inputs & _TNL_BITS_TEX_ANY) == 0)
- || (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- rmesa->swtcl.needproj = GL_TRUE;
- vte |= R200_VTX_XY_FMT | R200_VTX_Z_FMT;
- vte &= ~R200_VTX_W0_FMT;
- if (tnl->render_inputs & _TNL_BITS_TEX_ANY) {
- vap &= ~R200_VAP_FORCE_W_TO_ONE;
- }
- else {
- vap |= R200_VAP_FORCE_W_TO_ONE;
- }
- }
- else {
- rmesa->swtcl.needproj = GL_FALSE;
- vte &= ~(R200_VTX_XY_FMT | R200_VTX_Z_FMT);
- vte |= R200_VTX_W0_FMT;
- vap &= ~R200_VAP_FORCE_W_TO_ONE;
- }
-
- _tnl_need_projected_coords( ctx, rmesa->swtcl.needproj );
-
- if (vte != rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL]) {
- R200_STATECHANGE( rmesa, vte );
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] = vte;
- }
-
- if (vap != rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL]) {
- R200_STATECHANGE( rmesa, vap );
- rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] = vap;
- }
-}
-
-
-/* Flush vertices in the current dma region.
- */
-static void flush_last_swtcl_prim( r200ContextPtr rmesa )
-{
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- rmesa->dma.flush = NULL;
-
- if (rmesa->dma.current.buf) {
- struct r200_dma_region *current = &rmesa->dma.current;
- GLuint current_offset = (rmesa->r200Screen->gart_buffer_offset +
- current->buf->buf->idx * RADEON_BUFFER_SIZE +
- current->start);
-
- assert (!(rmesa->swtcl.hw_primitive & R200_VF_PRIM_WALK_IND));
-
- assert (current->start +
- rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
- current->ptr);
-
- if (rmesa->dma.current.start != rmesa->dma.current.ptr) {
- r200EnsureCmdBufSpace( rmesa, VERT_AOS_BUFSZ +
- rmesa->hw.max_state_size + VBUF_BUFSZ );
- r200EmitVertexAOS( rmesa,
- rmesa->swtcl.vertex_size,
- current_offset);
-
- r200EmitVbufPrim( rmesa,
- rmesa->swtcl.hw_primitive,
- rmesa->swtcl.numverts);
- }
-
- rmesa->swtcl.numverts = 0;
- current->start = current->ptr;
- }
-}
-
-
-/* Alloc space in the current dma region.
- */
-static __inline void *r200AllocDmaLowVerts( r200ContextPtr rmesa,
- int nverts, int vsize )
-{
- GLuint bytes = vsize * nverts;
-
- if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
- r200RefillCurrentDmaRegion( rmesa );
-
- if (!rmesa->dma.flush) {
- rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
- rmesa->dma.flush = flush_last_swtcl_prim;
- }
-
- ASSERT( vsize == rmesa->swtcl.vertex_size * 4 );
- ASSERT( rmesa->dma.flush == flush_last_swtcl_prim );
- ASSERT( rmesa->dma.current.start +
- rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
- rmesa->dma.current.ptr );
-
-
- {
- GLubyte *head = (GLubyte *) (rmesa->dma.current.address + rmesa->dma.current.ptr);
- rmesa->dma.current.ptr += bytes;
- rmesa->swtcl.numverts += nverts;
- return head;
- }
-
-}
-
-
-/**************************************************************************/
-
-
-static const GLuint reduced_hw_prim[GL_POLYGON+1] = {
- R200_VF_PRIM_POINTS,
- R200_VF_PRIM_LINES,
- R200_VF_PRIM_LINES,
- R200_VF_PRIM_LINES,
- R200_VF_PRIM_TRIANGLES,
- R200_VF_PRIM_TRIANGLES,
- R200_VF_PRIM_TRIANGLES,
- R200_VF_PRIM_TRIANGLES,
- R200_VF_PRIM_TRIANGLES,
- R200_VF_PRIM_TRIANGLES
-};
-
-static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void r200RenderPrimitive( GLcontext *ctx, GLenum prim );
-static void r200ResetLineStipple( GLcontext *ctx );
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#define HAVE_POINTS 1
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-#define HAVE_POLYGONS 1
-#define HAVE_ELTS 0
-
-#undef LOCAL_VARS
-#undef ALLOC_VERTS
-#define CTX_ARG r200ContextPtr rmesa
-#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size
-#define ALLOC_VERTS( n, size ) r200AllocDmaLowVerts( rmesa, n, size * 4 )
-#define LOCAL_VARS \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- const char *r200verts = (char *)rmesa->swtcl.verts;
-#define VERT(x) (r200Vertex *)(r200verts + ((x) * vertsize * sizeof(int)))
-#define VERTEX r200Vertex
-#define DO_DEBUG_VERTS (1 && (R200_DEBUG & DEBUG_VERTS))
-
-#undef TAG
-#define TAG(x) r200_##x
-#include "tnl_dd/t_dd_triemit.h"
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define QUAD( a, b, c, d ) r200_quad( rmesa, a, b, c, d )
-#define TRI( a, b, c ) r200_triangle( rmesa, a, b, c )
-#define LINE( a, b ) r200_line( rmesa, a, b )
-#define POINT( a ) r200_point( rmesa, a )
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define R200_TWOSIDE_BIT 0x01
-#define R200_UNFILLED_BIT 0x02
-#define R200_MAX_TRIFUNC 0x04
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[R200_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK 0
-#define DO_UNFILLED (IND & R200_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & R200_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_OFFSET 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a < 0)
-#define GET_VERTEX(e) (rmesa->swtcl.verts + (e*rmesa->swtcl.vertex_size*sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- r200_color_t *color = (r200_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v, c ) \
-do { \
- if (specoffset) { \
- r200_color_t *spec = (r200_color_t *)&((v)->ui[specoffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (specoffset) { \
- r200_color_t *spec0 = (r200_color_t *)&((v0)->ui[specoffset]); \
- r200_color_t *spec1 = (r200_color_t *)&((v1)->ui[specoffset]); \
- spec0->red = spec1->red; \
- spec0->green = spec1->green; \
- spec0->blue = spec1->blue; \
- } \
-} while (0)
-
-/* These don't need LE32_TO_CPU() as they used to save and restore
- * colors which are already in the correct format.
- */
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx]
-
-#undef LOCAL_VARS
-#undef TAG
-#undef INIT
-
-#define LOCAL_VARS(n) \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = rmesa->swtcl.coloroffset; \
- GLuint specoffset = rmesa->swtcl.specoffset; \
- (void) color; (void) spec; (void) coloroffset; (void) specoffset;
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) r200RasterPrimitive( ctx, reduced_hw_prim[x] )
-#define RENDER_PRIMITIVE rmesa->swtcl.render_primitive
-#undef TAG
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R200_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R200_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (R200_TWOSIDE_BIT|R200_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_twoside();
- init_unfilled();
- init_twoside_unfilled();
-}
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- r200_point( rmesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- r200_line( rmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- r200_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- r200_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) do { \
- r200RenderPrimitive( ctx, x ); \
-} while (0)
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- const GLuint vertsize = rmesa->swtcl.vertex_size; \
- const char *r200verts = (char *)rmesa->swtcl.verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) elt; (void) stipple;
-#define RESET_STIPPLE if ( stipple ) r200ResetLineStipple( ctx );
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) r200_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) r200_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-void r200ChooseRenderState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint index = 0;
- GLuint flags = ctx->_TriangleCaps;
-
- if (!rmesa->TclFallback || rmesa->Fallback)
- return;
-
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R200_TWOSIDE_BIT;
- if (flags & DD_TRI_UNFILLED) index |= R200_UNFILLED_BIT;
-
- if (index != rmesa->swtcl.RenderIndex) {
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = r200_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = r200_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = r200_fast_clipped_poly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- }
-
- rmesa->swtcl.RenderIndex = index;
- }
-}
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (rmesa->swtcl.hw_primitive != hwprim) {
- R200_NEWPRIM( rmesa );
- rmesa->swtcl.hw_primitive = hwprim;
- }
-}
-
-static void r200RenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- rmesa->swtcl.render_primitive = prim;
- if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED))
- r200RasterPrimitive( ctx, reduced_hw_prim[prim] );
-}
-
-static void r200RenderFinish( GLcontext *ctx )
-{
-}
-
-static void r200ResetLineStipple( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- R200_STATECHANGE( rmesa, lin );
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static const char * const fallbackStrings[] = {
- "Texture mode",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "glEnable(GL_STENCIL) without hw stencil buffer",
- "glRenderMode(selection or feedback)",
- "R200_NO_RAST",
- "Mixing GL_CLAMP_TO_BORDER and GL_CLAMP (or GL_MIRROR_CLAMP_ATI)"
-};
-
-
-static const char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-void r200Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = rmesa->Fallback;
-
- if (mode) {
- rmesa->Fallback |= bit;
- if (oldfallback == 0) {
- R200_FIREVERTICES( rmesa );
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_RASTER, GL_TRUE );
- _swsetup_Wakeup( ctx );
- rmesa->swtcl.RenderIndex = ~0;
- if (R200_DEBUG & DEBUG_FALLBACKS) {
- fprintf(stderr, "R200 begin rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
- else {
- rmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
-
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = r200RenderStart;
- tnl->Driver.Render.PrimitiveNotify = r200RenderPrimitive;
- tnl->Driver.Render.Finish = r200RenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- tnl->Driver.Render.ResetLineStipple = r200ResetLineStipple;
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_RASTER, GL_FALSE );
- if (rmesa->TclFallback) {
- /* These are already done if rmesa->TclFallback goes to
- * zero above. But not if it doesn't (R200_NO_TCL for
- * example?)
- */
- r200ChooseVertexState( ctx );
- r200ChooseRenderState( ctx );
- }
- if (R200_DEBUG & DEBUG_FALLBACKS) {
- fprintf(stderr, "R200 end rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
-}
-
-
-
-
-/**
- * Cope with depth operations by drawing individual pixels as points.
- *
- * \todo
- * The way the vertex state is set in this routine is hokey. It seems to
- * work, but it's very hackish. This whole routine is pretty hackish. If
- * the bitmap is small enough, it seems like it would be faster to copy it
- * to AGP memory and use it as a non-power-of-two texture (i.e.,
- * NV_texture_rectangle).
- */
-void
-r200PointsBitmap( GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- const GLfloat *rc = ctx->Current.RasterColor;
- GLint row, col;
- r200Vertex vert;
- GLuint orig_vte;
- GLuint h;
-
-
- /* Turn off tcl.
- */
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_BITMAP, 1 );
-
- /* Choose tiny vertex format
- */
- {
- const GLuint fmt_0 = R200_VTX_XY | R200_VTX_Z0 | R200_VTX_W0
- | (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT);
- const GLuint fmt_1 = 0;
- GLuint vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL];
- GLuint vap = rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL];
-
- vte &= ~(R200_VTX_XY_FMT | R200_VTX_Z_FMT);
- vte |= R200_VTX_W0_FMT;
- vap &= ~R200_VAP_FORCE_W_TO_ONE;
-
- rmesa->swtcl.vertex_size = 5;
-
- if ( (rmesa->hw.vtx.cmd[VTX_VTXFMT_0] != fmt_0)
- || (rmesa->hw.vtx.cmd[VTX_VTXFMT_1] != fmt_1) ) {
- R200_NEWPRIM(rmesa);
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = fmt_0;
- rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = fmt_1;
- }
-
- if (vte != rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL]) {
- R200_STATECHANGE( rmesa, vte );
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] = vte;
- }
-
- if (vap != rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL]) {
- R200_STATECHANGE( rmesa, vap );
- rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] = vap;
- }
- }
-
- /* Ready for point primitives:
- */
- r200RenderPrimitive( ctx, GL_POINTS );
-
- /* Turn off the hw viewport transformation:
- */
- R200_STATECHANGE( rmesa, vte );
- orig_vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL];
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] &= ~(R200_VPORT_X_SCALE_ENA |
- R200_VPORT_Y_SCALE_ENA |
- R200_VPORT_Z_SCALE_ENA |
- R200_VPORT_X_OFFSET_ENA |
- R200_VPORT_Y_OFFSET_ENA |
- R200_VPORT_Z_OFFSET_ENA);
-
- /* Turn off other stuff: Stipple?, texture?, blending?, etc.
- */
-
-
- /* Populate the vertex
- *
- * Incorporate FOG into RGBA
- */
- if (ctx->Fog.Enabled) {
- const GLfloat *fc = ctx->Fog.Color;
- GLfloat color[4];
- GLfloat f;
-
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
- f = _swrast_z_to_fogfactor(ctx, ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
- else
- f = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
-
- color[0] = f * rc[0] + (1.F - f) * fc[0];
- color[1] = f * rc[1] + (1.F - f) * fc[1];
- color[2] = f * rc[2] + (1.F - f) * fc[2];
- color[3] = rc[3];
-
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.red, color[0]);
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.green, color[1]);
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.blue, color[2]);
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.alpha, color[3]);
- }
- else {
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.red, rc[0]);
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.green, rc[1]);
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.blue, rc[2]);
- UNCLAMPED_FLOAT_TO_CHAN(vert.tv.color.alpha, rc[3]);
- }
-
-
- vert.tv.z = ctx->Current.RasterPos[2];
-
-
- /* Update window height
- */
- LOCK_HARDWARE( rmesa );
- UNLOCK_HARDWARE( rmesa );
- h = rmesa->dri.drawable->h + rmesa->dri.drawable->y;
- px += rmesa->dri.drawable->x;
-
- /* Clipping handled by existing mechansims in r200_ioctl.c?
- */
- for (row=0; row<height; row++) {
- const GLubyte *src = (const GLubyte *)
- _mesa_image_address2d(unpack, bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP, row, 0 );
-
- if (unpack->LsbFirst) {
- /* Lsb first */
- GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
- for (col=0; col<width; col++) {
- if (*src & mask) {
- vert.tv.x = px+col;
- vert.tv.y = h - (py+row) - 1;
- r200_point( rmesa, &vert );
- }
- src += (mask >> 7);
- mask = ((mask << 1) & 0xff) | (mask >> 7);
- }
-
- /* get ready for next row */
- if (mask != 1)
- src++;
- }
- else {
- /* Msb first */
- GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
- for (col=0; col<width; col++) {
- if (*src & mask) {
- vert.tv.x = px+col;
- vert.tv.y = h - (py+row) - 1;
- r200_point( rmesa, &vert );
- }
- src += mask & 1;
- mask = ((mask << 7) & 0xff) | (mask >> 1);
- }
- /* get ready for next row */
- if (mask != 128)
- src++;
- }
- }
-
- /* Fire outstanding vertices, restore state
- */
- R200_STATECHANGE( rmesa, vte );
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] = orig_vte;
-
- /* Unfallback
- */
- TCL_FALLBACK( ctx, R200_TCL_FALLBACK_BITMAP, 0 );
-
- /* Need to restore vertexformat?
- */
- if (rmesa->TclFallback)
- r200ChooseVertexState( ctx );
-}
-
-
-void r200FlushVertices( GLcontext *ctx, GLuint flags )
-{
- _tnl_FlushVertices( ctx, flags );
-
- if (flags & FLUSH_STORED_VERTICES)
- R200_NEWPRIM( R200_CONTEXT( ctx ) );
-}
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void r200InitSwtcl( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.Render.Start = r200RenderStart;
- tnl->Driver.Render.Finish = r200RenderFinish;
- tnl->Driver.Render.PrimitiveNotify = r200RenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = r200ResetLineStipple;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- /* FIXME: what are these numbers? */
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- 36 * sizeof(GLfloat) );
-
- rmesa->swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf;
- rmesa->swtcl.RenderIndex = ~0;
- rmesa->swtcl.render_primitive = GL_TRIANGLES;
- rmesa->swtcl.hw_primitive = 0;
-}
-
-
-void r200DestroySwtcl( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (rmesa->swtcl.indexed_verts.buf)
- r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.h
deleted file mode 100644
index ce2b6b5f0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_swtcl.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h,v 1.3 2003/05/06 23:52:08 daenzer Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_SWTCL_H__
-#define __R200_SWTCL_H__
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-#include "r200_context.h"
-
-extern void r200InitSwtcl( GLcontext *ctx );
-extern void r200DestroySwtcl( GLcontext *ctx );
-
-extern void r200FlushVertices( GLcontext *ctx, GLuint flags );
-extern void r200ChooseRenderState( GLcontext *ctx );
-extern void r200ChooseVertexState( GLcontext *ctx );
-
-extern void r200CheckTexSizes( GLcontext *ctx );
-
-extern void r200BuildVertices( GLcontext *ctx, GLuint start, GLuint count,
- GLuint newinputs );
-
-extern void r200PrintSetupFlags(char *msg, GLuint flags );
-
-
-extern void r200_emit_indexed_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
-
-extern void r200_translate_vertex( GLcontext *ctx,
- const r200Vertex *src,
- SWvertex *dst );
-
-extern void r200_print_vertex( GLcontext *ctx, const r200Vertex *v );
-
-extern void r200_import_float_colors( GLcontext *ctx );
-extern void r200_import_float_spec_colors( GLcontext *ctx );
-
-extern void r200PointsBitmap( GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap );
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.c
deleted file mode 100644
index 05c658fbe..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.c,v 1.2 2002/12/16 16:18:55 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "colormac.h"
-#include "light.h"
-
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "r200_context.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-#include "r200_tex.h"
-#include "r200_tcl.h"
-#include "r200_swtcl.h"
-#include "r200_maos.h"
-
-
-
-#define HAVE_POINTS 1
-#define HAVE_LINES 1
-#define HAVE_LINE_LOOP 0
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_QUADS 1
-#define HAVE_QUAD_STRIPS 1
-#define HAVE_POLYGONS 1
-#define HAVE_ELTS 1
-
-
-#define HW_POINTS R200_VF_PRIM_POINTS
-#define HW_LINES R200_VF_PRIM_LINES
-#define HW_LINE_LOOP 0
-#define HW_LINE_STRIP R200_VF_PRIM_LINE_STRIP
-#define HW_TRIANGLES R200_VF_PRIM_TRIANGLES
-#define HW_TRIANGLE_STRIP_0 R200_VF_PRIM_TRIANGLE_STRIP
-#define HW_TRIANGLE_STRIP_1 0
-#define HW_TRIANGLE_FAN R200_VF_PRIM_TRIANGLE_FAN
-#define HW_QUADS R200_VF_PRIM_QUADS
-#define HW_QUAD_STRIP R200_VF_PRIM_QUAD_STRIP
-#define HW_POLYGON R200_VF_PRIM_POLYGON
-
-
-static GLboolean discrete_prim[0x10] = {
- 0, /* 0 none */
- 1, /* 1 points */
- 1, /* 2 lines */
- 0, /* 3 line_strip */
- 1, /* 4 tri_list */
- 0, /* 5 tri_fan */
- 0, /* 6 tri_strip */
- 0, /* 7 tri_w_flags */
- 1, /* 8 rect list (unused) */
- 1, /* 9 3vert point */
- 1, /* a 3vert line */
- 0, /* b point sprite */
- 0, /* c line loop */
- 1, /* d quads */
- 0, /* e quad strip */
- 0, /* f polygon */
-};
-
-
-#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx)
-#define ELT_TYPE GLushort
-
-#define ELT_INIT(prim, hw_prim) \
- r200TclPrimitive( ctx, prim, hw_prim | R200_VF_PRIM_WALK_IND )
-
-#define GET_MESA_ELTS() rmesa->tcl.Elts
-
-
-/* Don't really know how many elts will fit in what's left of cmdbuf,
- * as there is state to emit, etc:
- */
-
-/* Testing on isosurf shows a maximum around here. Don't know if it's
- * the card or driver or kernel module that is causing the behaviour.
- */
-#define GET_MAX_HW_ELTS() 300
-
-#define RESET_STIPPLE() do { \
- R200_STATECHANGE( rmesa, lin ); \
- r200EmitState( rmesa ); \
-} while (0)
-
-#define AUTO_STIPPLE( mode ) do { \
- R200_STATECHANGE( rmesa, lin ); \
- if (mode) \
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] |= \
- R200_LINE_PATTERN_AUTO_RESET; \
- else \
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] &= \
- ~R200_LINE_PATTERN_AUTO_RESET; \
- r200EmitState( rmesa ); \
-} while (0)
-
-
-#define ALLOC_ELTS(nr) r200AllocElts( rmesa, nr )
-
-static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr )
-{
- if (rmesa->dma.flush == r200FlushElts &&
- rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) {
-
- GLushort *dest = (GLushort *)(rmesa->store.cmd_buf +
- rmesa->store.cmd_used);
-
- rmesa->store.cmd_used += nr*2;
-
- return dest;
- }
- else {
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) +
- rmesa->hw.max_state_size + ELTS_BUFSZ(nr) );
-
- r200EmitAOS( rmesa,
- rmesa->tcl.aos_components,
- rmesa->tcl.nr_aos_components, 0 );
-
- return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr );
- }
-}
-
-
-#define CLOSE_ELTS() \
-do { \
- if (0) R200_NEWPRIM( rmesa ); \
-} \
-while (0)
-
-
-/* TODO: Try to extend existing primitive if both are identical,
- * discrete and there are no intervening state changes. (Somewhat
- * duplicates changes to DrawArrays code)
- */
-static void r200EmitPrim( GLcontext *ctx,
- GLenum prim,
- GLuint hwprim,
- GLuint start,
- GLuint count)
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- r200TclPrimitive( ctx, prim, hwprim );
-
- r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) +
- rmesa->hw.max_state_size + VBUF_BUFSZ );
-
- r200EmitAOS( rmesa,
- rmesa->tcl.aos_components,
- rmesa->tcl.nr_aos_components,
- start );
-
- /* Why couldn't this packet have taken an offset param?
- */
- r200EmitVbufPrim( rmesa,
- rmesa->tcl.hw_primitive,
- count - start );
-}
-
-#define EMIT_PRIM(ctx, prim, hwprim, start, count) do { \
- r200EmitPrim( ctx, prim, hwprim, start, count ); \
- (void) rmesa; } while (0)
-
-/* Try & join small primitives
- */
-#if 0
-#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) 0
-#else
-#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) \
- ((NR) < 20 || \
- ((NR) < 40 && \
- rmesa->tcl.hw_primitive == (PRIM| \
- R200_VF_TCL_OUTPUT_VTX_ENABLE| \
- R200_VF_PRIM_WALK_IND)))
-#endif
-
-#ifdef MESA_BIG_ENDIAN
-/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
-#define EMIT_ELT(dest, offset, x) do { \
- int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \
- GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \
- (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \
- (void)rmesa; } while (0)
-#else
-#define EMIT_ELT(dest, offset, x) do { \
- (dest)[offset] = (GLushort) (x); \
- (void)rmesa; } while (0)
-#endif
-
-#define EMIT_TWO_ELTS(dest, offset, x, y) *(GLuint *)((dest)+offset) = ((y)<<16)|(x);
-
-
-
-#define TAG(x) tcl_##x
-#include "tnl_dd/t_dd_dmatmp2.h"
-
-/**********************************************************************/
-/* External entrypoints */
-/**********************************************************************/
-
-void r200EmitPrimitive( GLcontext *ctx,
- GLuint first,
- GLuint last,
- GLuint flags )
-{
- tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
-}
-
-void r200EmitEltPrimitive( GLcontext *ctx,
- GLuint first,
- GLuint last,
- GLuint flags )
-{
- tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
-}
-
-void r200TclPrimitive( GLcontext *ctx,
- GLenum prim,
- int hw_prim )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint newprim = hw_prim | R200_VF_TCL_OUTPUT_VTX_ENABLE;
-
- if (newprim != rmesa->tcl.hw_primitive ||
- !discrete_prim[hw_prim&0xf]) {
- R200_NEWPRIM( rmesa );
- rmesa->tcl.hw_primitive = newprim;
- }
-}
-
-
-/**********************************************************************/
-/* Fog blend factor computation for hw tcl */
-/* same calculation used as in t_vb_fog.c */
-/**********************************************************************/
-
-#define FOG_EXP_TABLE_SIZE 256
-#define FOG_MAX (10.0)
-#define EXP_FOG_MAX .0006595
-#define FOG_INCR (FOG_MAX/FOG_EXP_TABLE_SIZE)
-static GLfloat exp_table[FOG_EXP_TABLE_SIZE];
-
-#if 1
-#define NEG_EXP( result, narg ) \
-do { \
- GLfloat f = (GLfloat) (narg * (1.0/FOG_INCR)); \
- GLint k = (GLint) f; \
- if (k > FOG_EXP_TABLE_SIZE-2) \
- result = (GLfloat) EXP_FOG_MAX; \
- else \
- result = exp_table[k] + (f-k)*(exp_table[k+1]-exp_table[k]); \
-} while (0)
-#else
-#define NEG_EXP( result, narg ) \
-do { \
- result = exp(-narg); \
-} while (0)
-#endif
-
-
-/**
- * Initialize the exp_table[] lookup table for approximating exp().
- */
-void
-r200InitStaticFogData( void )
-{
- GLfloat f = 0.0F;
- GLint i = 0;
- for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) {
- exp_table[i] = (GLfloat) exp(-f);
- }
-}
-
-
-/**
- * Compute per-vertex fog blend factors from fog coordinates by
- * evaluating the GL_LINEAR, GL_EXP or GL_EXP2 fog function.
- * Fog coordinates are distances from the eye (typically between the
- * near and far clip plane distances).
- * Note the fog (eye Z) coords may be negative so we use ABS(z) below.
- * Fog blend factors are in the range [0,1].
- */
-float
-r200ComputeFogBlendFactor( GLcontext *ctx, GLfloat fogcoord )
-{
- GLfloat end = ctx->Fog.End;
- GLfloat d, temp;
- const GLfloat z = FABSF(fogcoord);
-
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- if (ctx->Fog.Start == ctx->Fog.End)
- d = 1.0F;
- else
- d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- temp = (end - z) * d;
- return CLAMP(temp, 0.0F, 1.0F);
- break;
- case GL_EXP:
- d = ctx->Fog.Density;
- NEG_EXP( temp, d * z );
- return temp;
- break;
- case GL_EXP2:
- d = ctx->Fog.Density*ctx->Fog.Density;
- NEG_EXP( temp, d * z * z );
- return temp;
- break;
- default:
- _mesa_problem(ctx, "Bad fog mode in make_fog_coord");
- return 0;
- }
-}
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-/* TCL render.
- */
-static GLboolean r200_run_tcl_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
- GLuint i;
-
- /* TODO: separate this from the swtnl pipeline
- */
- if (rmesa->TclFallback)
- return GL_TRUE; /* fallback to software t&l */
-
- if (R200_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (VB->Count == 0)
- return GL_FALSE;
-
- /* Validate state:
- */
- if (rmesa->NewGLState)
- r200ValidateState( ctx );
-
- /* NOTE: inputs != tnl->render_inputs - these are the untransformed
- * inputs.
- */
- if (ctx->Light.Enabled) {
- inputs |= VERT_BIT_NORMAL;
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- inputs |= VERT_BIT_COLOR1;
- }
- }
-
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
- inputs |= VERT_BIT_FOG;
- }
-
- for (i = 0 ; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->Texture.Unit[i]._ReallyEnabled) {
- if (rmesa->TexGenNeedNormals[i]) {
- inputs |= VERT_BIT_NORMAL;
- }
- inputs |= VERT_BIT_TEX(i);
- }
- }
-
- /* Do the actual work:
- */
- r200ReleaseArrays( ctx, ~0 /* stage->changed_inputs */ );
- r200EmitArrays( ctx, inputs );
-
- rmesa->tcl.Elts = VB->Elts;
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- if (rmesa->tcl.Elts)
- r200EmitEltPrimitive( ctx, start, start+length, prim );
- else
- r200EmitPrimitive( ctx, start, start+length, prim );
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-
-/* Initial state for tcl stage.
- */
-const struct tnl_pipeline_stage _r200_tcl_stage =
-{
- "r200 render",
- NULL, /* private */
- NULL,
- NULL,
- NULL,
- r200_run_tcl_render /* run */
-};
-
-
-
-/**********************************************************************/
-/* Validate state at pipeline start */
-/**********************************************************************/
-
-
-/*-----------------------------------------------------------------------
- * Manage TCL fallbacks
- */
-
-
-static void transition_to_swtnl( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- R200_NEWPRIM( rmesa );
-
- r200ChooseVertexState( ctx );
- r200ChooseRenderState( ctx );
-
- _mesa_validate_all_lighting_tables( ctx );
-
- tnl->Driver.NotifyMaterialChange =
- _mesa_validate_all_lighting_tables;
-
- r200ReleaseArrays( ctx, ~0 );
-
- /* Still using the D3D based hardware-rasterizer from the radeon;
- * need to put the card into D3D mode to make it work:
- */
- R200_STATECHANGE( rmesa, vap );
- rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] &= ~R200_VAP_TCL_ENABLE;
-}
-
-static void transition_to_hwtnl( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- _tnl_need_projected_coords( ctx, GL_FALSE );
-
- r200UpdateMaterial( ctx );
-
- tnl->Driver.NotifyMaterialChange = r200UpdateMaterial;
-
- if ( rmesa->dma.flush )
- rmesa->dma.flush( rmesa );
-
- rmesa->dma.flush = NULL;
-
- if (rmesa->swtcl.indexed_verts.buf)
- r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
- __FUNCTION__ );
-
- R200_STATECHANGE( rmesa, vap );
- rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] |= R200_VAP_TCL_ENABLE;
- rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] &= ~R200_VAP_FORCE_W_TO_ONE;
-
- if ( ((rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] & R200_FOG_USE_MASK)
- == R200_FOG_USE_SPEC_ALPHA) &&
- (ctx->Fog.FogCoordinateSource == GL_FOG_COORD )) {
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_USE_MASK;
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= R200_FOG_USE_VTX_FOG;
- }
-
- R200_STATECHANGE( rmesa, vte );
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] &= ~(R200_VTX_XY_FMT|R200_VTX_Z_FMT);
- rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] |= R200_VTX_W0_FMT;
-
- if (R200_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "R200 end tcl fallback\n");
-}
-
-
-static char *fallbackStrings[] = {
- "Rasterization fallback",
- "Unfilled triangles",
- "Twosided lighting, differing materials",
- "Materials in VB (maybe between begin/end)",
- "Texgen unit 0",
- "Texgen unit 1",
- "Texgen unit 2",
- "Texgen unit 3",
- "Texgen unit 4",
- "Texgen unit 5",
- "User disable",
- "Bitmap as points",
- "Vertex program"
-};
-
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-
-void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint oldfallback = rmesa->TclFallback;
-
- if (mode) {
- rmesa->TclFallback |= bit;
- if (oldfallback == 0) {
- if (R200_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "R200 begin tcl fallback %s\n",
- getFallbackString( bit ));
- transition_to_swtnl( ctx );
- }
- }
- else {
- rmesa->TclFallback &= ~bit;
- if (oldfallback == bit) {
- if (R200_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "R200 end tcl fallback %s\n",
- getFallbackString( bit ));
- transition_to_hwtnl( ctx );
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.h
deleted file mode 100644
index ac5bc1194..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tcl.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.h,v 1.2 2002/12/16 16:18:55 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_TCL_H__
-#define __R200_TCL_H__
-
-#include "r200_context.h"
-
-extern void r200TclPrimitive( GLcontext *ctx, GLenum prim, int hw_prim );
-extern void r200EmitEltPrimitive( GLcontext *ctx, GLuint first, GLuint last,
- GLuint flags );
-extern void r200EmitPrimitive( GLcontext *ctx, GLuint first, GLuint last,
- GLuint flags );
-
-extern void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-
-extern void r200InitStaticFogData( void );
-
-extern float r200ComputeFogBlendFactor( GLcontext *ctx, GLfloat fogcoord );
-
-#define R200_TCL_FALLBACK_RASTER 0x1 /* rasterization */
-#define R200_TCL_FALLBACK_UNFILLED 0x2 /* unfilled tris */
-#define R200_TCL_FALLBACK_LIGHT_TWOSIDE 0x4 /* twoside tris */
-#define R200_TCL_FALLBACK_MATERIAL 0x8 /* material in vb */
-#define R200_TCL_FALLBACK_TEXGEN_0 0x10 /* texgen, unit 0 */
-#define R200_TCL_FALLBACK_TEXGEN_1 0x20 /* texgen, unit 1 */
-#define R200_TCL_FALLBACK_TEXGEN_2 0x40 /* texgen, unit 2 */
-#define R200_TCL_FALLBACK_TEXGEN_3 0x80 /* texgen, unit 3 */
-#define R200_TCL_FALLBACK_TEXGEN_4 0x100 /* texgen, unit 4 */
-#define R200_TCL_FALLBACK_TEXGEN_5 0x200 /* texgen, unit 5 */
-#define R200_TCL_FALLBACK_TCL_DISABLE 0x400 /* user disable */
-#define R200_TCL_FALLBACK_BITMAP 0x800 /* draw bitmap with points */
-#define R200_TCL_FALLBACK_VERTEX_PROGRAM 0x1000/* vertex program active */
-
-#define TCL_FALLBACK( ctx, bit, mode ) r200TclFallback( ctx, bit, mode )
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.c
deleted file mode 100644
index 3d259c2ca..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.c
+++ /dev/null
@@ -1,1183 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.c,v 1.2 2002/11/05 17:46:08 tsi Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "image.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "texmem.h"
-#include "teximage.h"
-#include "texobj.h"
-
-#include "r200_context.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-#include "r200_swtcl.h"
-#include "r200_tex.h"
-
-#include "xmlpool.h"
-
-
-
-/**
- * Set the texture wrap modes.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-
-static void r200SetTexWrap( r200TexObjPtr t, GLenum swrap, GLenum twrap, GLenum rwrap )
-{
- GLboolean is_clamp = GL_FALSE;
- GLboolean is_clamp_to_border = GL_FALSE;
-
- t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK | R200_BORDER_MODE_D3D);
-
- switch ( swrap ) {
- case GL_REPEAT:
- t->pp_txfilter |= R200_CLAMP_S_WRAP;
- break;
- case GL_CLAMP:
- t->pp_txfilter |= R200_CLAMP_S_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->pp_txfilter |= R200_CLAMP_S_CLAMP_LAST;
- break;
- case GL_CLAMP_TO_BORDER:
- t->pp_txfilter |= R200_CLAMP_S_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- case GL_MIRRORED_REPEAT:
- t->pp_txfilter |= R200_CLAMP_S_MIRROR;
- break;
- case GL_MIRROR_CLAMP_EXT:
- t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_LAST;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
- }
-
- switch ( twrap ) {
- case GL_REPEAT:
- t->pp_txfilter |= R200_CLAMP_T_WRAP;
- break;
- case GL_CLAMP:
- t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->pp_txfilter |= R200_CLAMP_T_CLAMP_LAST;
- break;
- case GL_CLAMP_TO_BORDER:
- t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL | R200_BORDER_MODE_D3D;
- is_clamp_to_border = GL_TRUE;
- break;
- case GL_MIRRORED_REPEAT:
- t->pp_txfilter |= R200_CLAMP_T_MIRROR;
- break;
- case GL_MIRROR_CLAMP_EXT:
- t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_LAST;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
- }
-
- t->pp_txformat_x &= ~R200_CLAMP_Q_MASK;
-
- switch ( rwrap ) {
- case GL_REPEAT:
- t->pp_txformat_x |= R200_CLAMP_Q_WRAP;
- break;
- case GL_CLAMP:
- t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_LAST;
- break;
- case GL_CLAMP_TO_BORDER:
- t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- case GL_MIRRORED_REPEAT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR;
- break;
- case GL_MIRROR_CLAMP_EXT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_LAST;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad R wrap mode in %s", __FUNCTION__);
- }
-
- if ( is_clamp_to_border ) {
- t->pp_txfilter |= R200_BORDER_MODE_D3D;
- }
-
- t->border_fallback = (is_clamp && is_clamp_to_border);
-}
-
-static void r200SetTexMaxAnisotropy( r200TexObjPtr t, GLfloat max )
-{
- t->pp_txfilter &= ~R200_MAX_ANISO_MASK;
-
- if ( max == 1.0 ) {
- t->pp_txfilter |= R200_MAX_ANISO_1_TO_1;
- } else if ( max <= 2.0 ) {
- t->pp_txfilter |= R200_MAX_ANISO_2_TO_1;
- } else if ( max <= 4.0 ) {
- t->pp_txfilter |= R200_MAX_ANISO_4_TO_1;
- } else if ( max <= 8.0 ) {
- t->pp_txfilter |= R200_MAX_ANISO_8_TO_1;
- } else {
- t->pp_txfilter |= R200_MAX_ANISO_16_TO_1;
- }
-}
-
-/**
- * Set the texture magnification and minification modes.
- *
- * \param t Texture whose filter modes are to be set
- * \param minf Texture minification mode
- * \param magf Texture magnification mode
- */
-
-static void r200SetTexFilter( r200TexObjPtr t, GLenum minf, GLenum magf )
-{
- GLuint anisotropy = (t->pp_txfilter & R200_MAX_ANISO_MASK);
-
- t->pp_txfilter &= ~(R200_MIN_FILTER_MASK | R200_MAG_FILTER_MASK);
- t->pp_txformat_x &= ~R200_VOLUME_FILTER_MASK;
-
- if ( anisotropy == R200_MAX_ANISO_1_TO_1 ) {
- switch ( minf ) {
- case GL_NEAREST:
- t->pp_txfilter |= R200_MIN_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- t->pp_txfilter |= R200_MIN_FILTER_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- t->pp_txfilter |= R200_MIN_FILTER_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- t->pp_txfilter |= R200_MIN_FILTER_LINEAR_MIP_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- t->pp_txfilter |= R200_MIN_FILTER_NEAREST_MIP_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- t->pp_txfilter |= R200_MIN_FILTER_LINEAR_MIP_LINEAR;
- break;
- }
- } else {
- switch ( minf ) {
- case GL_NEAREST:
- t->pp_txfilter |= R200_MIN_FILTER_ANISO_NEAREST;
- break;
- case GL_LINEAR:
- t->pp_txfilter |= R200_MIN_FILTER_ANISO_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_NEAREST:
- t->pp_txfilter |= R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- t->pp_txfilter |= R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR;
- break;
- }
- }
-
- /* Note we don't have 3D mipmaps so only use the mag filter setting
- * to set the 3D texture filter mode.
- */
- switch ( magf ) {
- case GL_NEAREST:
- t->pp_txfilter |= R200_MAG_FILTER_NEAREST;
- t->pp_txformat_x |= R200_VOLUME_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- t->pp_txfilter |= R200_MAG_FILTER_LINEAR;
- t->pp_txformat_x |= R200_VOLUME_FILTER_LINEAR;
- break;
- }
-}
-
-static void r200SetTexBorderColor( r200TexObjPtr t, GLubyte c[4] )
-{
- t->pp_border_color = r200PackColor( 4, c[0], c[1], c[2], c[3] );
-}
-
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-static r200TexObjPtr r200AllocTexObj( struct gl_texture_object *texObj )
-{
- r200TexObjPtr t;
-
- t = CALLOC_STRUCT( r200_tex_obj );
- texObj->DriverData = t;
- if ( t != NULL ) {
- if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)texObj,
- (void *)t );
- }
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
- t->border_fallback = GL_FALSE;
-
- make_empty_list( & t->base );
-
- r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
- r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
- r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- r200SetTexBorderColor( t, texObj->_BorderChan );
- }
-
- return t;
-}
-
-
-static const struct gl_texture_format *
-r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- const GLboolean do32bpt =
- ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 );
- const GLboolean force16bpt =
- ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 );
- (void) format;
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- switch ( type ) {
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return do32bpt ? _dri_texformat_argb8888 : _dri_texformat_argb1555;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return _dri_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return _dri_texformat_argb1555;
- default:
- return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_argb4444;
- }
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- switch ( type ) {
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return _dri_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return _dri_texformat_argb1555;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- return _dri_texformat_rgb565;
- default:
- return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565;
- }
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return !force16bpt ?
- _dri_texformat_rgba8888 : _dri_texformat_argb4444;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return _dri_texformat_argb4444;
-
- case GL_RGB5_A1:
- return _dri_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return !force16bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return _dri_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return _dri_texformat_a8;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return _dri_texformat_l8;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return _dri_texformat_al88;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return _dri_texformat_i8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
-
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
-
- default:
- _mesa_problem(ctx,
- "unexpected internalFormat 0x%x in r200ChooseTextureFormat",
- (int) internalFormat);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-
-static GLboolean
-r200ValidateClientStorage( GLcontext *ctx, GLenum target,
- GLint internalFormat,
- GLint srcWidth, GLint srcHeight,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (0)
- fprintf(stderr, "intformat %s format %s type %s\n",
- _mesa_lookup_enum_by_nr( internalFormat ),
- _mesa_lookup_enum_by_nr( format ),
- _mesa_lookup_enum_by_nr( type ));
-
- if (!ctx->Unpack.ClientStorage)
- return 0;
-
- if (ctx->_ImageTransferState ||
- texImage->IsCompressed ||
- texObj->GenerateMipmap)
- return 0;
-
-
- /* This list is incomplete, may be different on ppc???
- */
- switch ( internalFormat ) {
- case GL_RGBA:
- if ( format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
- texImage->TexFormat = _dri_texformat_argb8888;
- }
- else
- return 0;
- break;
-
- case GL_RGB:
- if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
- texImage->TexFormat = _dri_texformat_rgb565;
- }
- else
- return 0;
- break;
-
- case GL_YCBCR_MESA:
- if ( format == GL_YCBCR_MESA &&
- type == GL_UNSIGNED_SHORT_8_8_REV_APPLE ) {
- texImage->TexFormat = &_mesa_texformat_ycbcr_rev;
- }
- else if ( format == GL_YCBCR_MESA &&
- (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)) {
- texImage->TexFormat = &_mesa_texformat_ycbcr;
- }
- else
- return 0;
- break;
-
- default:
- return 0;
- }
-
- /* Could deal with these packing issues, but currently don't:
- */
- if (packing->SkipPixels ||
- packing->SkipRows ||
- packing->SwapBytes ||
- packing->LsbFirst) {
- return 0;
- }
-
- {
- GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth,
- format, type);
-
-
- if (0)
- fprintf(stderr, "%s: srcRowStride %d/%x\n",
- __FUNCTION__, srcRowStride, srcRowStride);
-
- /* Could check this later in upload, pitch restrictions could be
- * relaxed, but would need to store the image pitch somewhere,
- * as packing details might change before image is uploaded:
- */
- if (!r200IsGartMemory( rmesa, pixels, srcHeight * srcRowStride ) ||
- (srcRowStride & 63))
- return 0;
-
-
- /* Have validated that _mesa_transfer_teximage would be a straight
- * memcpy at this point. NOTE: future calls to TexSubImage will
- * overwrite the client data. This is explicitly mentioned in the
- * extension spec.
- */
- texImage->Data = (void *)pixels;
- texImage->IsClientData = GL_TRUE;
- texImage->RowStride = srcRowStride / texImage->TexFormat->TexelBytes;
-
- return 1;
- }
-}
-
-
-static void r200TexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- }
-
- /* Note, this will call ChooseTextureFormat */
- _mesa_store_teximage1d(ctx, target, level, internalFormat,
- width, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void r200TexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
- return;
- }
- }
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void r200TexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
-
- texImage->IsClientData = GL_FALSE;
-
- if (r200ValidateClientStorage( ctx, target,
- internalFormat,
- width, height,
- format, type, pixels,
- packing, texObj, texImage)) {
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using client storage\n", __FUNCTION__);
- }
- else {
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
-
- /* Normal path: copy (to cached memory) and eventually upload
- * via another copy to GART memory and then a blit... Could
- * eliminate one copy by going straight to (permanent) GART.
- *
- * Note, this will call r200ChooseTextureFormat.
- */
- _mesa_store_teximage2d(ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
- }
-}
-
-
-static void r200TexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- }
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void r200CompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
-
- texImage->IsClientData = GL_FALSE;
-/* can't call this, different parameters. Would never evaluate to true anyway currently
- if (r200ValidateClientStorage( ctx, target,
- internalFormat,
- width, height,
- format, type, pixels,
- packing, texObj, texImage)) {
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using client storage\n", __FUNCTION__);
- }
- else */{
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
-
- /* Normal path: copy (to cached memory) and eventually upload
- * via another copy to GART memory and then a blit... Could
- * eliminate one copy by going straight to (permanent) GART.
- *
- * Note, this will call r200ChooseTextureFormat.
- */
- _mesa_store_compressed_teximage2d(ctx, target, level, internalFormat, width,
- height, border, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
- }
-}
-
-
-static void r200CompressedTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2D");
- return;
- }
- }
-
- _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-#if ENABLE_HW_3D_TEXTURE
-static void r200TexImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
- return;
- }
- }
-
- texImage->IsClientData = GL_FALSE;
-
-#if 0
- if (r200ValidateClientStorage( ctx, target,
- internalFormat,
- width, height,
- format, type, pixels,
- packing, texObj, texImage)) {
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using client storage\n", __FUNCTION__);
- }
- else
-#endif
- {
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__);
-
- /* Normal path: copy (to cached memory) and eventually upload
- * via another copy to GART memory and then a blit... Could
- * eliminate one copy by going straight to (permanent) GART.
- *
- * Note, this will call r200ChooseTextureFormat.
- */
- _mesa_store_teximage3d(ctx, target, level, internalFormat,
- width, height, depth, border,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
- }
-}
-#endif
-
-
-#if ENABLE_HW_3D_TEXTURE
-static void
-r200TexSubImage3D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) r200AllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D");
- return;
- }
- texObj->DriverData = t;
- }
-
- _mesa_store_texsubimage3d(ctx, target, level, xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels, packing, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-#endif
-
-
-
-static void r200TexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if ( R200_DEBUG & DEBUG_STATE ) {
- fprintf( stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
- }
-
- /* This is incorrect: Need to maintain this data for each of
- * GL_TEXTURE_{123}D, GL_TEXTURE_RECTANGLE_NV, etc, and switch
- * between them according to _ReallyEnabled.
- */
- switch ( pname ) {
- case GL_TEXTURE_ENV_COLOR: {
- GLubyte c[4];
- GLuint envColor;
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
- envColor = r200PackColor( 4, c[0], c[1], c[2], c[3] );
- if ( rmesa->hw.tf.cmd[TF_TFACTOR_0 + unit] != envColor ) {
- R200_STATECHANGE( rmesa, tf );
- rmesa->hw.tf.cmd[TF_TFACTOR_0 + unit] = envColor;
- }
- break;
- }
-
- case GL_TEXTURE_LOD_BIAS_EXT: {
- GLfloat bias, min;
- GLuint b;
- const int fixed_one = 0x8000000;
-
- /* The R200's LOD bias is a signed 2's complement value with a
- * range of -16.0 <= bias < 16.0.
- *
- * NOTE: Add a small bias to the bias for conform mipsel.c test.
- */
- bias = *param + .01;
- min = driQueryOptionb (&rmesa->optionCache, "no_neg_lod_bias") ?
- 0.0 : -16.0;
- bias = CLAMP( bias, min, 16.0 );
- b = (int)(bias * fixed_one) & R200_LOD_BIAS_MASK;
-
- if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] & R200_LOD_BIAS_MASK) != b ) {
- R200_STATECHANGE( rmesa, tex[unit] );
- rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] &= ~R200_LOD_BIAS_MASK;
- rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] |= b;
- }
- break;
- }
-
- default:
- return;
- }
-}
-
-
-/**
- * Changes variables and flags for a state update, which will happen at the
- * next UpdateTextureState
- */
-
-static void r200TexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj,
- GLenum pname, const GLfloat *params )
-{
- r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData;
-
- if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( pname ) );
- }
-
- switch ( pname ) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
- r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- r200SetTexBorderColor( t, texObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-
- /* Mark this texobj as dirty (one bit per tex unit)
- */
- t->dirty_state = TEX_ALL;
-}
-
-
-
-static void r200BindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj )
-{
- if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)texObj,
- ctx->Texture.CurrentUnit );
- }
-
- if ( (target == GL_TEXTURE_1D)
- || (target == GL_TEXTURE_2D)
-#if ENABLE_HW_3D_TEXTURE
- || (target == GL_TEXTURE_3D)
-#endif
- || (target == GL_TEXTURE_CUBE_MAP)
- || (target == GL_TEXTURE_RECTANGLE_NV) ) {
- assert( texObj->DriverData != NULL );
- }
-}
-
-
-static void r200DeleteTexture( GLcontext *ctx,
- struct gl_texture_object *texObj )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
- _mesa_lookup_enum_by_nr( texObj->Target ) );
- }
-
- if ( t != NULL ) {
- if ( rmesa ) {
- R200_FIREVERTICES( rmesa );
- }
-
- driDestroyTextureObject( t );
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, texObj);
-}
-
-/* Need:
- * - Same GEN_MODE for all active bits
- * - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
- * - STRQ presumably all supported (matrix means incoming R values
- * can end up in STQ, this has implications for vertex support,
- * presumably ok if maos is used, though?)
- *
- * Basically impossible to do this on the fly - just collect some
- * basic info & do the checks from ValidateState().
- */
-static void r200TexGen( GLcontext *ctx,
- GLenum coord,
- GLenum pname,
- const GLfloat *params )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
- rmesa->recheck_texgen[unit] = GL_TRUE;
-}
-
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- * Fixup MaxAnisotropy according to user preference.
- */
-static struct gl_texture_object *
-r200NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- if (!obj)
- return NULL;
- obj->MaxAnisotropy = rmesa->initialMaxAnisotropy;
- r200AllocTexObj( obj );
- return obj;
-}
-
-
-void r200InitTextureFuncs( struct dd_function_table *functions )
-{
- /* Note: we only plug in the functions we implement in the driver
- * since _mesa_init_driver_functions() was already called.
- */
- functions->ChooseTextureFormat = r200ChooseTextureFormat;
- functions->TexImage1D = r200TexImage1D;
- functions->TexImage2D = r200TexImage2D;
-#if ENABLE_HW_3D_TEXTURE
- functions->TexImage3D = r200TexImage3D;
-#else
- functions->TexImage3D = _mesa_store_teximage3d;
-#endif
- functions->TexSubImage1D = r200TexSubImage1D;
- functions->TexSubImage2D = r200TexSubImage2D;
-#if ENABLE_HW_3D_TEXTURE
- functions->TexSubImage3D = r200TexSubImage3D;
-#else
- functions->TexSubImage3D = _mesa_store_texsubimage3d;
-#endif
- functions->NewTextureObject = r200NewTextureObject;
- functions->BindTexture = r200BindTexture;
- functions->DeleteTexture = r200DeleteTexture;
- functions->IsTextureResident = driIsTextureResident;
-
- functions->TexEnv = r200TexEnv;
- functions->TexParameter = r200TexParameter;
- functions->TexGen = r200TexGen;
-
- functions->CompressedTexImage2D = r200CompressedTexImage2D;
- functions->CompressedTexSubImage2D = r200CompressedTexSubImage2D;
-
- driInitTextureFormats();
-
-#if 000
- /* moved or obsolete code */
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- driInitTextureObjects( ctx, & rmesa->swapped,
- DRI_TEXMGR_DO_TEXTURE_1D
- | DRI_TEXMGR_DO_TEXTURE_2D );
-
- /* Hack: r200NewTextureObject is not yet installed when the
- * default textures are created. Therefore set MaxAnisotropy of the
- * default 2D texture now. */
- ctx->Shared->Default2D->MaxAnisotropy = driQueryOptionf (&rmesa->optionCache,
- "def_max_anisotropy");
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.h
deleted file mode 100644
index acabbc11b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_tex.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_TEX_H__
-#define __R200_TEX_H__
-
-extern void r200UpdateTextureState( GLcontext *ctx );
-
-extern int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t, GLuint face );
-
-extern void r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t );
-
-extern void r200InitTextureFuncs( struct dd_function_table *functions );
-
-#endif /* __R200_TEX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texmem.c
deleted file mode 100644
index 7472afeed..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texmem.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texmem.c,v 1.5 2002/12/17 00:32:56 dawes Exp $ */
-/**************************************************************************
-
-Copyright (C) Tungsten Graphics 2002. All Rights Reserved.
-The Weather Channel, Inc. funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86
-license. This notice must be preserved.
-
-Permission is hereby granted, free of charge, to 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 ATI, VA LINUX SYSTEMS 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "colormac.h"
-#include "macros.h"
-#include "r200_context.h"
-#include "r200_ioctl.h"
-#include "r200_tex.h"
-#include "radeon_reg.h"
-
-#include <unistd.h> /* for usleep() */
-
-
-/**
- * Destroy any device-dependent state associated with the texture. This may
- * include NULLing out hardware state that points to the texture.
- */
-void
-r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t )
-{
- if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__,
- (void *)t, (void *)t->base.tObj );
- }
-
- if ( rmesa != NULL ) {
- unsigned i;
-
-
- for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if ( t == rmesa->state.texture.unit[i].texobj ) {
- rmesa->state.texture.unit[i].texobj = NULL;
- rmesa->hw.tex[i].dirty = GL_FALSE;
- rmesa->hw.cube[i].dirty = GL_FALSE;
- }
- }
- }
-}
-
-
-/* ------------------------------------------------------------
- * Texture image conversions
- */
-
-
-static void r200UploadGARTClientSubImage( r200ContextPtr rmesa,
- r200TexObjPtr t,
- struct gl_texture_image *texImage,
- GLint hwlevel,
- GLint x, GLint y,
- GLint width, GLint height )
-{
- const struct gl_texture_format *texFormat = texImage->TexFormat;
- GLuint srcPitch, dstPitch;
- int blit_format;
- int srcOffset;
-
- /*
- * XXX it appears that we always upload the full image, not a subimage.
- * I.e. x==0, y==0, width=texWidth, height=texWidth. If this is ever
- * changed, the src pitch will have to change.
- */
- switch ( texFormat->TexelBytes ) {
- case 1:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
- srcPitch = t->image[0][0].width * texFormat->TexelBytes;
- dstPitch = t->image[0][0].width * texFormat->TexelBytes;
- break;
- case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
- srcPitch = t->image[0][0].width * texFormat->TexelBytes;
- dstPitch = t->image[0][0].width * texFormat->TexelBytes;
- break;
- case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
- srcPitch = t->image[0][0].width * texFormat->TexelBytes;
- dstPitch = t->image[0][0].width * texFormat->TexelBytes;
- break;
- default:
- return;
- }
-
- t->image[0][hwlevel].data = texImage->Data;
- srcOffset = r200GartOffsetFromVirtual( rmesa, texImage->Data );
-
- assert( srcOffset != ~0 );
-
- /* Don't currently need to cope with small pitches?
- */
- width = texImage->Width;
- height = texImage->Height;
-
- r200EmitWait( rmesa, RADEON_WAIT_3D );
-
- r200EmitBlit( rmesa, blit_format,
- srcPitch,
- srcOffset,
- dstPitch,
- t->bufAddr,
- x,
- y,
- t->image[0][hwlevel].x + x,
- t->image[0][hwlevel].y + y,
- width,
- height );
-
- r200EmitWait( rmesa, RADEON_WAIT_2D );
-}
-
-static void r200UploadRectSubImage( r200ContextPtr rmesa,
- r200TexObjPtr t,
- struct gl_texture_image *texImage,
- GLint x, GLint y,
- GLint width, GLint height )
-{
- const struct gl_texture_format *texFormat = texImage->TexFormat;
- int blit_format, dstPitch, done;
-
- switch ( texFormat->TexelBytes ) {
- case 1:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
- break;
- case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
- break;
- case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
- break;
- default:
- return;
- }
-
- t->image[0][0].data = texImage->Data;
-
- /* Currently don't need to cope with small pitches.
- */
- width = texImage->Width;
- height = texImage->Height;
- dstPitch = t->pp_txpitch + 32;
-
- if (rmesa->prefer_gart_client_texturing && texImage->IsClientData) {
- /* In this case, could also use GART texturing. This is
- * currently disabled, but has been tested & works.
- */
- t->pp_txoffset = r200GartOffsetFromVirtual( rmesa, texImage->Data );
- t->pp_txpitch = texImage->RowStride * texFormat->TexelBytes - 32;
-
- if (R200_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr,
- "Using GART texturing for rectangular client texture\n");
-
- /* Release FB memory allocated for this image:
- */
- /* FIXME This may not be correct as driSwapOutTextureObject sets
- * FIXME dirty_images. It may be fine, though.
- */
- if ( t->base.memBlock ) {
- driSwapOutTextureObject( (driTextureObject *) t );
- }
- }
- else if (texImage->IsClientData) {
- /* Data already in GART memory, with usable pitch.
- */
- GLuint srcPitch;
- srcPitch = texImage->RowStride * texFormat->TexelBytes;
- r200EmitBlit( rmesa,
- blit_format,
- srcPitch,
- r200GartOffsetFromVirtual( rmesa, texImage->Data ),
- dstPitch, t->bufAddr,
- 0, 0,
- 0, 0,
- width, height );
- }
- else {
- /* Data not in GART memory, or bad pitch.
- */
- for (done = 0; done < height ; ) {
- struct r200_dma_region region;
- int lines = MIN2( height - done, RADEON_BUFFER_SIZE / dstPitch );
- int src_pitch;
- char *tex;
-
- src_pitch = texImage->RowStride * texFormat->TexelBytes;
-
- tex = (char *)texImage->Data + done * src_pitch;
-
- memset(&region, 0, sizeof(region));
- r200AllocDmaRegion( rmesa, &region, lines * dstPitch, 1024 );
-
- /* Copy texdata to dma:
- */
- if (0)
- fprintf(stderr, "%s: src_pitch %d dst_pitch %d\n",
- __FUNCTION__, src_pitch, dstPitch);
-
- if (src_pitch == dstPitch) {
- memcpy( region.address + region.start, tex, lines * src_pitch );
- }
- else {
- char *buf = region.address + region.start;
- int i;
- for (i = 0 ; i < lines ; i++) {
- memcpy( buf, tex, src_pitch );
- buf += dstPitch;
- tex += src_pitch;
- }
- }
-
- r200EmitWait( rmesa, RADEON_WAIT_3D );
-
- /* Blit to framebuffer
- */
- r200EmitBlit( rmesa,
- blit_format,
- dstPitch, GET_START( &region ),
- dstPitch | (t->tile_bits >> 16),
- t->bufAddr,
- 0, 0,
- 0, done,
- width, lines );
-
- r200EmitWait( rmesa, RADEON_WAIT_2D );
-
- r200ReleaseDmaRegion( rmesa, &region, __FUNCTION__ );
- done += lines;
- }
- }
-}
-
-
-/**
- * Upload the texture image associated with texture \a t at the specified
- * level at the address relative to \a start.
- */
-static void uploadSubImage( r200ContextPtr rmesa, r200TexObjPtr t,
- GLint hwlevel,
- GLint x, GLint y, GLint width, GLint height,
- GLuint face )
-{
- struct gl_texture_image *texImage = NULL;
- GLuint offset;
- GLint imageWidth, imageHeight;
- GLint ret;
- drm_radeon_texture_t tex;
- drm_radeon_tex_image_t tmp;
- const int level = hwlevel + t->base.firstLevel;
-
- if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n",
- __FUNCTION__, (void *)t, (void *)t->base.tObj,
- level, width, height, face );
- }
-
- ASSERT(face < 6);
-
- /* Ensure we have a valid texture to upload */
- if ( ( hwlevel < 0 ) || ( hwlevel >= RADEON_MAX_TEXTURE_LEVELS ) ) {
- _mesa_problem(NULL, "bad texture level in %s", __FUNCTION__);
- return;
- }
-
- texImage = t->base.tObj->Image[face][level];
-
- if ( !texImage ) {
- if ( R200_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level );
- return;
- }
- if ( !texImage->Data ) {
- if ( R200_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: image data is NULL!\n", __FUNCTION__ );
- return;
- }
-
-
- if (t->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- assert(level == 0);
- assert(hwlevel == 0);
- if ( R200_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: image data is rectangular\n", __FUNCTION__);
- r200UploadRectSubImage( rmesa, t, texImage, x, y, width, height );
- return;
- }
- else if (texImage->IsClientData) {
- if ( R200_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: image data is in GART client storage\n",
- __FUNCTION__);
- r200UploadGARTClientSubImage( rmesa, t, texImage, hwlevel,
- x, y, width, height );
- return;
- }
- else if ( R200_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: image data is in normal memory\n",
- __FUNCTION__);
-
-
- imageWidth = texImage->Width;
- imageHeight = texImage->Height;
-
- offset = t->bufAddr + t->base.totalSize / 6 * face;
-
- if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
- GLint imageX = 0;
- GLint imageY = 0;
- GLint blitX = t->image[face][hwlevel].x;
- GLint blitY = t->image[face][hwlevel].y;
- GLint blitWidth = t->image[face][hwlevel].width;
- GLint blitHeight = t->image[face][hwlevel].height;
- fprintf( stderr, " upload image: %d,%d at %d,%d\n",
- imageWidth, imageHeight, imageX, imageY );
- fprintf( stderr, " upload blit: %d,%d at %d,%d\n",
- blitWidth, blitHeight, blitX, blitY );
- fprintf( stderr, " blit ofs: 0x%07x level: %d/%d\n",
- (GLuint)offset, hwlevel, level );
- }
-
- t->image[face][hwlevel].data = texImage->Data;
-
- /* Init the DRM_RADEON_TEXTURE command / drm_radeon_texture_t struct.
- * NOTE: we're always use a 1KB-wide blit and I8 texture format.
- * We used to use 1, 2 and 4-byte texels and used to use the texture
- * width to dictate the blit width - but that won't work for compressed
- * textures. (Brian)
- * NOTE: can't do that with texture tiling. (sroland)
- */
- tex.offset = offset;
- tex.image = &tmp;
- /* copy (x,y,width,height,data) */
- memcpy( &tmp, &t->image[face][hwlevel], sizeof(tmp) );
-
- if (texImage->TexFormat->TexelBytes) {
- /* use multi-byte upload scheme */
- tex.height = imageHeight;
- tex.width = imageWidth;
- tex.format = t->pp_txformat & R200_TXFORMAT_FORMAT_MASK;
- tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1);
- tex.offset += tmp.x & ~1023;
- tmp.x = tmp.x % 1024;
- if (t->tile_bits & R200_TXO_MICRO_TILE) {
- /* need something like "tiled coordinates" ? */
- tmp.y = tmp.x / (tex.pitch * 128) * 2;
- tmp.x = tmp.x % (tex.pitch * 128) / 2 / texImage->TexFormat->TexelBytes;
- tex.pitch |= RADEON_DST_TILE_MICRO >> 22;
- }
- else {
- tmp.x = tmp.x >> (texImage->TexFormat->TexelBytes >> 1);
- }
- if ((t->tile_bits & R200_TXO_MACRO_TILE) &&
- (texImage->Width * texImage->TexFormat->TexelBytes >= 256) &&
- ((!(t->tile_bits & R200_TXO_MICRO_TILE) && (texImage->Height >= 8)) ||
- (texImage->Height >= 16))) {
- /* weird: R200 disables macro tiling if mip width is smaller than 256 bytes,
- OR if height is smaller than 8 automatically, but if micro tiling is active
- the limit is height 16 instead ? */
- tex.pitch |= RADEON_DST_TILE_MACRO >> 22;
- }
- }
- else {
- /* In case of for instance 8x8 texture (2x2 dxt blocks), padding after the first two blocks is
- needed (only with dxt1 since 2 dxt3/dxt5 blocks already use 32 Byte). */
- /* set tex.height to 1/4 since 1 "macropixel" (dxt-block) has 4 real pixels. Needed
- so the kernel module reads the right amount of data. */
- tex.format = R200_TXFORMAT_I8; /* any 1-byte texel format */
- tex.pitch = (BLIT_WIDTH_BYTES / 64);
- tex.height = (imageHeight + 3) / 4;
- tex.width = (imageWidth + 3) / 4;
- switch (t->pp_txformat & R200_TXFORMAT_FORMAT_MASK) {
- case R200_TXFORMAT_DXT1:
- tex.width *= 8;
- break;
- case R200_TXFORMAT_DXT23:
- case R200_TXFORMAT_DXT45:
- tex.width *= 16;
- break;
- default:
- fprintf(stderr, "unknown compressed tex format in uploadSubImage\n");
- }
- }
-
- LOCK_HARDWARE( rmesa );
- do {
- ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_TEXTURE,
- &tex, sizeof(drm_radeon_texture_t) );
- if (ret) {
- if (R200_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
- usleep(1);
- }
- } while ( ret && errno == EAGAIN );
-
- UNLOCK_HARDWARE( rmesa );
-
- if ( ret ) {
- fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret );
- fprintf( stderr, " offset=0x%08x\n",
- offset );
- fprintf( stderr, " image width=%d height=%d\n",
- imageWidth, imageHeight );
- fprintf( stderr, " blit width=%d height=%d data=%p\n",
- t->image[face][hwlevel].width, t->image[face][hwlevel].height,
- t->image[face][hwlevel].data );
- exit( 1 );
- }
-}
-
-
-/**
- * Upload the texture images associated with texture \a t. This might
- * require the allocation of texture memory.
- *
- * \param rmesa Context pointer
- * \param t Texture to be uploaded
- * \param face Cube map face to be uploaded. Zero for non-cube maps.
- */
-
-int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t, GLuint face )
-{
- const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
- fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
- (void *)rmesa->glCtx, (void *)t->base.tObj, t->base.totalSize,
- t->base.firstLevel, t->base.lastLevel );
- }
-
- if ( !t || t->base.totalSize == 0 )
- return 0;
-
- if (R200_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__ );
- r200Finish( rmesa->glCtx );
- }
-
- LOCK_HARDWARE( rmesa );
-
- if ( t->base.memBlock == NULL ) {
- int heap;
-
- heap = driAllocateTexture( rmesa->texture_heaps, rmesa->nr_heaps,
- (driTextureObject *) t );
- if ( heap == -1 ) {
- UNLOCK_HARDWARE( rmesa );
- return -1;
- }
-
- /* Set the base offset of the texture image */
- t->bufAddr = rmesa->r200Screen->texOffset[heap]
- + t->base.memBlock->ofs;
- t->pp_txoffset = t->bufAddr;
-
- if (!(t->base.tObj->Image[0][0]->IsClientData)) {
- /* hope it's safe to add that here... */
- t->pp_txoffset |= t->tile_bits;
- }
-
- /* Mark this texobj as dirty on all units:
- */
- t->dirty_state = TEX_ALL;
- }
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( (driTextureObject *) t );
- UNLOCK_HARDWARE( rmesa );
-
- /* Upload any images that are new */
- if (t->base.dirty_images[face]) {
- int i;
- for ( i = 0 ; i < numLevels ; i++ ) {
- if ( (t->base.dirty_images[face] & (1 << (i+t->base.firstLevel))) != 0 ) {
- uploadSubImage( rmesa, t, i, 0, 0, t->image[face][i].width,
- t->image[face][i].height, face );
- }
- }
- t->base.dirty_images[face] = 0;
- }
-
-
- if (R200_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__ );
- r200Finish( rmesa->glCtx );
- }
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texstate.c
deleted file mode 100644
index 4a6b285a5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_texstate.c
+++ /dev/null
@@ -1,1468 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texstate.c,v 1.3 2003/02/15 22:18:47 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-#include "enums.h"
-
-#include "r200_context.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-#include "r200_swtcl.h"
-#include "r200_tex.h"
-#include "r200_tcl.h"
-
-
-#define R200_TXFORMAT_A8 R200_TXFORMAT_I8
-#define R200_TXFORMAT_L8 R200_TXFORMAT_I8
-#define R200_TXFORMAT_AL88 R200_TXFORMAT_AI88
-#define R200_TXFORMAT_YCBCR R200_TXFORMAT_YVYU422
-#define R200_TXFORMAT_YCBCR_REV R200_TXFORMAT_VYUY422
-#define R200_TXFORMAT_RGB_DXT1 R200_TXFORMAT_DXT1
-#define R200_TXFORMAT_RGBA_DXT1 R200_TXFORMAT_DXT1
-#define R200_TXFORMAT_RGBA_DXT3 R200_TXFORMAT_DXT23
-#define R200_TXFORMAT_RGBA_DXT5 R200_TXFORMAT_DXT45
-
-#define _COLOR(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, 0 }
-#define _COLOR_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { R200_TXFORMAT_ ## f, 0 }
-#define _ALPHA(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _ALPHA_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _YUV(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, R200_YUV_TO_RGB }
-#define _INVALID(f) \
- [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
-#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \
- && (tx_table[f].format != 0xffffffff) )
-
-static const struct {
- GLuint format, filter;
-}
-tx_table[] =
-{
- _ALPHA(RGBA8888),
- _ALPHA_REV(RGBA8888),
- _ALPHA(ARGB8888),
- _ALPHA_REV(ARGB8888),
- _INVALID(RGB888),
- _COLOR(RGB565),
- _COLOR_REV(RGB565),
- _ALPHA(ARGB4444),
- _ALPHA_REV(ARGB4444),
- _ALPHA(ARGB1555),
- _ALPHA_REV(ARGB1555),
- _ALPHA(AL88),
- _ALPHA_REV(AL88),
- _ALPHA(A8),
- _COLOR(L8),
- _ALPHA(I8),
- _INVALID(CI8),
- _YUV(YCBCR),
- _YUV(YCBCR_REV),
- _INVALID(RGB_FXT1),
- _INVALID(RGBA_FXT1),
- _COLOR(RGB_DXT1),
- _ALPHA(RGBA_DXT1),
- _ALPHA(RGBA_DXT3),
- _ALPHA(RGBA_DXT5),
-};
-
-#undef _COLOR
-#undef _ALPHA
-#undef _INVALID
-
-/**
- * This function computes the number of bytes of storage needed for
- * the given texture object (all mipmap levels, all cube faces).
- * The \c image[face][level].x/y/width/height parameters for upload/blitting
- * are computed here. \c pp_txfilter, \c pp_txformat, etc. will be set here
- * too.
- *
- * \param rmesa Context pointer
- * \param tObj GL texture object whose images are to be posted to
- * hardware state.
- */
-static void r200SetTexImages( r200ContextPtr rmesa,
- struct gl_texture_object *tObj )
-{
- r200TexObjPtr t = (r200TexObjPtr)tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint curOffset, blitWidth;
- GLint i, texelBytes;
- GLint numLevels;
- GLint log2Width, log2Height, log2Depth;
-
- /* Set the hardware texture format
- */
-
- t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK |
- R200_TXFORMAT_ALPHA_IN_MAP);
- t->pp_txfilter &= ~R200_YUV_TO_RGB;
-
- if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) {
- t->pp_txformat |= tx_table[ baseImage->TexFormat->MesaFormat ].format;
- t->pp_txfilter |= tx_table[ baseImage->TexFormat->MesaFormat ].filter;
- }
- else {
- _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);
- return;
- }
-
- texelBytes = baseImage->TexFormat->TexelBytes;
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
-
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
- log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
- log2Depth = tObj->Image[0][t->base.firstLevel]->DepthLog2;
-
- numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS);
-
- /* Calculate mipmap offsets and dimensions for blitting (uploading)
- * The idea is that we lay out the mipmap levels within a block of
- * memory organized as a rectangle of width BLIT_WIDTH_BYTES.
- */
- curOffset = 0;
- blitWidth = BLIT_WIDTH_BYTES;
- t->tile_bits = 0;
-
- /* figure out if this texture is suitable for tiling. */
- if (texelBytes) {
- if (rmesa->texmicrotile && (tObj->Target != GL_TEXTURE_RECTANGLE_NV) &&
- /* texrect might be able to use micro tiling too in theory? */
- (baseImage->Height > 1)) {
- /* allow 32 (bytes) x 1 mip (which will use two times the space
- the non-tiled version would use) max if base texture is large enough */
- if ((numLevels == 1) ||
- (((baseImage->Width * texelBytes / baseImage->Height) <= 32) &&
- (baseImage->Width * texelBytes > 64)) ||
- ((baseImage->Width * texelBytes / baseImage->Height) <= 16)) {
- t->tile_bits |= R200_TXO_MICRO_TILE;
- }
- }
- if (tObj->Target != GL_TEXTURE_RECTANGLE_NV) {
- /* we can set macro tiling even for small textures, they will be untiled anyway */
- t->tile_bits |= R200_TXO_MACRO_TILE;
- }
- }
-
- for (i = 0; i < numLevels; i++) {
- const struct gl_texture_image *texImage;
- GLuint size;
-
- texImage = tObj->Image[0][i + t->base.firstLevel];
- if ( !texImage )
- break;
-
- /* find image size in bytes */
- if (texImage->IsCompressed) {
- /* need to calculate the size AFTER padding even though the texture is
- submitted without padding.
- Only handle pot textures currently - don't know if npot is even possible,
- size calculation would certainly need (trivial) adjustments.
- Align (and later pad) to 32byte, not sure what that 64byte blit width is
- good for? */
- if ((t->pp_txformat & R200_TXFORMAT_FORMAT_MASK) == R200_TXFORMAT_DXT1) {
- /* RGB_DXT1/RGBA_DXT1, 8 bytes per block */
- if ((texImage->Width + 3) < 8) /* width one block */
- size = texImage->CompressedSize * 4;
- else if ((texImage->Width + 3) < 16)
- size = texImage->CompressedSize * 2;
- else size = texImage->CompressedSize;
- }
- else /* DXT3/5, 16 bytes per block */
- if ((texImage->Width + 3) < 8)
- size = texImage->CompressedSize * 2;
- else size = texImage->CompressedSize;
- }
- else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- size = ((texImage->Width * texelBytes + 63) & ~63) * texImage->Height;
- }
- else if (t->tile_bits & R200_TXO_MICRO_TILE) {
- /* tile pattern is 16 bytes x2. mipmaps stay 32 byte aligned,
- though the actual offset may be different (if texture is less than
- 32 bytes width) to the untiled case */
- int w = (texImage->Width * texelBytes * 2 + 31) & ~31;
- size = (w * ((texImage->Height + 1) / 2)) * texImage->Depth;
- blitWidth = MAX2(texImage->Width, 64 / texelBytes);
- }
- else {
- int w = (texImage->Width * texelBytes + 31) & ~31;
- size = w * texImage->Height * texImage->Depth;
- blitWidth = MAX2(texImage->Width, 64 / texelBytes);
- }
- assert(size > 0);
-
- /* Align to 32-byte offset. It is faster to do this unconditionally
- * (no branch penalty).
- */
-
- curOffset = (curOffset + 0x1f) & ~0x1f;
-
- if (texelBytes) {
- t->image[0][i].x = curOffset; /* fix x and y coords up later together with offset */
- t->image[0][i].y = 0;
- t->image[0][i].width = MIN2(size / texelBytes, blitWidth);
- t->image[0][i].height = (size / texelBytes) / t->image[0][i].width;
- }
- else {
- t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES;
- t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES;
- t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES);
- t->image[0][i].height = size / t->image[0][i].width;
- }
-
-#if 0
- /* for debugging only and only applicable to non-rectangle targets */
- assert(size % t->image[0][i].width == 0);
- assert(t->image[0][i].x == 0
- || (size < BLIT_WIDTH_BYTES && t->image[0][i].height == 1));
-#endif
-
- if (0)
- fprintf(stderr,
- "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n",
- i, texImage->Width, texImage->Height,
- t->image[0][i].x, t->image[0][i].y,
- t->image[0][i].width, t->image[0][i].height, size, curOffset);
-
- curOffset += size;
-
- }
-
- /* Align the total size of texture memory block.
- */
- t->base.totalSize = (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK;
-
- /* Setup remaining cube face blits, if needed */
- if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
- const GLuint faceSize = t->base.totalSize;
- GLuint face;
- /* reuse face 0 x/y/width/height - just update the offset when uploading */
- for (face = 1; face < 6; face++) {
- for (i = 0; i < numLevels; i++) {
- t->image[face][i].x = t->image[0][i].x;
- t->image[face][i].y = t->image[0][i].y;
- t->image[face][i].width = t->image[0][i].width;
- t->image[face][i].height = t->image[0][i].height;
- }
- }
- t->base.totalSize = 6 * faceSize; /* total texmem needed */
- }
-
-
- /* Hardware state:
- */
- t->pp_txfilter &= ~R200_MAX_MIP_LEVEL_MASK;
- t->pp_txfilter |= (numLevels - 1) << R200_MAX_MIP_LEVEL_SHIFT;
-
- t->pp_txformat &= ~(R200_TXFORMAT_WIDTH_MASK |
- R200_TXFORMAT_HEIGHT_MASK |
- R200_TXFORMAT_CUBIC_MAP_ENABLE |
- R200_TXFORMAT_F5_WIDTH_MASK |
- R200_TXFORMAT_F5_HEIGHT_MASK);
- t->pp_txformat |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) |
- (log2Height << R200_TXFORMAT_HEIGHT_SHIFT));
-
- t->pp_txformat_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK);
- if (tObj->Target == GL_TEXTURE_3D) {
- t->pp_txformat_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT);
- t->pp_txformat_x |= R200_TEXCOORD_VOLUME;
- }
- else if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
- ASSERT(log2Width == log2Height);
- t->pp_txformat |= ((log2Width << R200_TXFORMAT_F5_WIDTH_SHIFT) |
- (log2Height << R200_TXFORMAT_F5_HEIGHT_SHIFT) |
- (R200_TXFORMAT_CUBIC_MAP_ENABLE));
- t->pp_txformat_x |= R200_TEXCOORD_CUBIC_ENV;
- t->pp_cubic_faces = ((log2Width << R200_FACE_WIDTH_1_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_1_SHIFT) |
- (log2Width << R200_FACE_WIDTH_2_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_2_SHIFT) |
- (log2Width << R200_FACE_WIDTH_3_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_3_SHIFT) |
- (log2Width << R200_FACE_WIDTH_4_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_4_SHIFT));
- }
- else {
- /* If we don't in fact send enough texture coordinates, q will be 1,
- * making TEXCOORD_PROJ act like TEXCOORD_NONPROJ (Right?)
- */
- t->pp_txformat_x |= R200_TEXCOORD_PROJ;
- }
-
- t->pp_txsize = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << 0) |
- ((tObj->Image[0][t->base.firstLevel]->Height - 1) << 16));
-
- /* Only need to round to nearest 32 for textures, but the blitter
- * requires 64-byte aligned pitches, and we may/may not need the
- * blitter. NPOT only!
- */
- if (baseImage->IsCompressed)
- t->pp_txpitch = (tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63);
- else
- t->pp_txpitch = ((tObj->Image[0][t->base.firstLevel]->Width * texelBytes) + 63) & ~(63);
- t->pp_txpitch -= 32;
-
- t->dirty_state = TEX_ALL;
-
- /* FYI: r200UploadTexImages( rmesa, t ) used to be called here */
-}
-
-
-
-/* ================================================================
- * Texture combine functions
- */
-
-/* GL_ARB_texture_env_combine support
- */
-
-/* The color tables have combine functions for GL_SRC_COLOR,
- * GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
- */
-static GLuint r200_register_color[][R200_MAX_TEXTURE_UNITS] =
-{
- {
- R200_TXC_ARG_A_R0_COLOR,
- R200_TXC_ARG_A_R1_COLOR,
- R200_TXC_ARG_A_R2_COLOR,
- R200_TXC_ARG_A_R3_COLOR,
- R200_TXC_ARG_A_R4_COLOR,
- R200_TXC_ARG_A_R5_COLOR
- },
- {
- R200_TXC_ARG_A_R0_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R1_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R2_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R3_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R4_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R5_COLOR | R200_TXC_COMP_ARG_A
- },
- {
- R200_TXC_ARG_A_R0_ALPHA,
- R200_TXC_ARG_A_R1_ALPHA,
- R200_TXC_ARG_A_R2_ALPHA,
- R200_TXC_ARG_A_R3_ALPHA,
- R200_TXC_ARG_A_R4_ALPHA,
- R200_TXC_ARG_A_R5_ALPHA
- },
- {
- R200_TXC_ARG_A_R0_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R1_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R2_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R3_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R4_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R5_ALPHA | R200_TXC_COMP_ARG_A
- },
-};
-
-static GLuint r200_tfactor_color[] =
-{
- R200_TXC_ARG_A_TFACTOR_COLOR,
- R200_TXC_ARG_A_TFACTOR_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_TFACTOR_ALPHA,
- R200_TXC_ARG_A_TFACTOR_ALPHA | R200_TXC_COMP_ARG_A
-};
-
-static GLuint r200_primary_color[] =
-{
- R200_TXC_ARG_A_DIFFUSE_COLOR,
- R200_TXC_ARG_A_DIFFUSE_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_DIFFUSE_ALPHA,
- R200_TXC_ARG_A_DIFFUSE_ALPHA | R200_TXC_COMP_ARG_A
-};
-
-/* GL_ZERO table - indices 0-3
- * GL_ONE table - indices 1-4
- */
-static GLuint r200_zero_color[] =
-{
- R200_TXC_ARG_A_ZERO,
- R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_ZERO,
- R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_ZERO
-};
-
-/* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
- */
-static GLuint r200_register_alpha[][R200_MAX_TEXTURE_UNITS] =
-{
- {
- R200_TXA_ARG_A_R0_ALPHA,
- R200_TXA_ARG_A_R1_ALPHA,
- R200_TXA_ARG_A_R2_ALPHA,
- R200_TXA_ARG_A_R3_ALPHA,
- R200_TXA_ARG_A_R4_ALPHA,
- R200_TXA_ARG_A_R5_ALPHA
- },
- {
- R200_TXA_ARG_A_R0_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R1_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R2_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R3_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R4_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R5_ALPHA | R200_TXA_COMP_ARG_A
- },
-};
-
-static GLuint r200_tfactor_alpha[] =
-{
- R200_TXA_ARG_A_TFACTOR_ALPHA,
- R200_TXA_ARG_A_TFACTOR_ALPHA | R200_TXA_COMP_ARG_A
-};
-
-static GLuint r200_primary_alpha[] =
-{
- R200_TXA_ARG_A_DIFFUSE_ALPHA,
- R200_TXA_ARG_A_DIFFUSE_ALPHA | R200_TXA_COMP_ARG_A
-};
-
-/* GL_ZERO table - indices 0-1
- * GL_ONE table - indices 1-2
- */
-static GLuint r200_zero_alpha[] =
-{
- R200_TXA_ARG_A_ZERO,
- R200_TXA_ARG_A_ZERO | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_ZERO,
-};
-
-
-/* Extract the arg from slot A, shift it into the correct argument slot
- * and set the corresponding complement bit.
- */
-#define R200_COLOR_ARG( n, arg ) \
-do { \
- color_combine |= \
- ((color_arg[n] & R200_TXC_ARG_A_MASK) \
- << R200_TXC_ARG_##arg##_SHIFT); \
- color_combine |= \
- ((color_arg[n] >> R200_TXC_COMP_ARG_A_SHIFT) \
- << R200_TXC_COMP_ARG_##arg##_SHIFT); \
-} while (0)
-
-#define R200_ALPHA_ARG( n, arg ) \
-do { \
- alpha_combine |= \
- ((alpha_arg[n] & R200_TXA_ARG_A_MASK) \
- << R200_TXA_ARG_##arg##_SHIFT); \
- alpha_combine |= \
- ((alpha_arg[n] >> R200_TXA_COMP_ARG_A_SHIFT) \
- << R200_TXA_COMP_ARG_##arg##_SHIFT); \
-} while (0)
-
-
-/* ================================================================
- * Texture unit state management
- */
-
-static GLboolean r200UpdateTextureEnv( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint color_combine, alpha_combine;
- GLuint color_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] &
- ~(R200_TXC_SCALE_MASK);
- GLuint alpha_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] &
- ~(R200_TXA_DOT_ALPHA | R200_TXA_SCALE_MASK);
-
- /* texUnit->_Current can be NULL if and only if the texture unit is
- * not actually enabled.
- */
- assert( (texUnit->_ReallyEnabled == 0)
- || (texUnit->_Current != NULL) );
-
- if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
- }
-
- /* Set the texture environment state. Isn't this nice and clean?
- * The chip will automagically set the texture alpha to 0xff when
- * the texture format does not include an alpha component. This
- * reduces the amount of special-casing we have to do, alpha-only
- * textures being a notable exception.
- */
- /* Don't cache these results.
- */
- rmesa->state.texture.unit[unit].format = 0;
- rmesa->state.texture.unit[unit].envMode = 0;
-
- if ( !texUnit->_ReallyEnabled ) {
- if ( unit == 0 ) {
- color_combine = R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO
- | R200_TXC_ARG_C_DIFFUSE_COLOR | R200_TXC_OP_MADD;
- alpha_combine = R200_TXA_ARG_A_ZERO | R200_TXA_ARG_B_ZERO
- | R200_TXA_ARG_C_DIFFUSE_ALPHA | R200_TXA_OP_MADD;
- }
- else {
- color_combine = R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO
- | R200_TXC_ARG_C_R0_COLOR | R200_TXC_OP_MADD;
- alpha_combine = R200_TXA_ARG_A_ZERO | R200_TXA_ARG_B_ZERO
- | R200_TXA_ARG_C_R0_ALPHA | R200_TXA_OP_MADD;
- }
- }
- else {
- GLuint color_arg[3], alpha_arg[3];
- GLuint i;
- const GLuint numColorArgs = texUnit->_CurrentCombine->_NumArgsRGB;
- const GLuint numAlphaArgs = texUnit->_CurrentCombine->_NumArgsA;
- GLuint RGBshift = texUnit->_CurrentCombine->ScaleShiftRGB;
- GLuint Ashift = texUnit->_CurrentCombine->ScaleShiftA;
-
-
- /* Step 1:
- * Extract the color and alpha combine function arguments.
- */
- for ( i = 0 ; i < numColorArgs ; i++ ) {
- const GLint op = texUnit->_CurrentCombine->OperandRGB[i] - GL_SRC_COLOR;
- assert(op >= 0);
- assert(op <= 3);
- switch ( texUnit->_CurrentCombine->SourceRGB[i] ) {
- case GL_TEXTURE:
- color_arg[i] = r200_register_color[op][unit];
- break;
- case GL_CONSTANT:
- color_arg[i] = r200_tfactor_color[op];
- break;
- case GL_PRIMARY_COLOR:
- color_arg[i] = r200_primary_color[op];
- break;
- case GL_PREVIOUS:
- if (unit == 0)
- color_arg[i] = r200_primary_color[op];
- else
- color_arg[i] = r200_register_color[op][0];
- break;
- case GL_ZERO:
- color_arg[i] = r200_zero_color[op];
- break;
- case GL_ONE:
- color_arg[i] = r200_zero_color[op+1];
- break;
- default:
- return GL_FALSE;
- }
- }
-
- for ( i = 0 ; i < numAlphaArgs ; i++ ) {
- const GLint op = texUnit->_CurrentCombine->OperandA[i] - GL_SRC_ALPHA;
- assert(op >= 0);
- assert(op <= 1);
- switch ( texUnit->_CurrentCombine->SourceA[i] ) {
- case GL_TEXTURE:
- alpha_arg[i] = r200_register_alpha[op][unit];
- break;
- case GL_CONSTANT:
- alpha_arg[i] = r200_tfactor_alpha[op];
- break;
- case GL_PRIMARY_COLOR:
- alpha_arg[i] = r200_primary_alpha[op];
- break;
- case GL_PREVIOUS:
- if (unit == 0)
- alpha_arg[i] = r200_primary_alpha[op];
- else
- alpha_arg[i] = r200_register_alpha[op][0];
- break;
- case GL_ZERO:
- alpha_arg[i] = r200_zero_alpha[op];
- break;
- case GL_ONE:
- alpha_arg[i] = r200_zero_alpha[op+1];
- break;
- default:
- return GL_FALSE;
- }
- }
-
- /* Step 2:
- * Build up the color and alpha combine functions.
- */
- switch ( texUnit->_CurrentCombine->ModeRGB ) {
- case GL_REPLACE:
- color_combine = (R200_TXC_ARG_A_ZERO |
- R200_TXC_ARG_B_ZERO |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG( 0, C );
- break;
- case GL_MODULATE:
- color_combine = (R200_TXC_ARG_C_ZERO |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, B );
- break;
- case GL_ADD:
- color_combine = (R200_TXC_ARG_B_ZERO |
- R200_TXC_COMP_ARG_B |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, C );
- break;
- case GL_ADD_SIGNED:
- color_combine = (R200_TXC_ARG_B_ZERO |
- R200_TXC_COMP_ARG_B |
- R200_TXC_BIAS_ARG_C | /* new */
- R200_TXC_OP_MADD); /* was ADDSIGNED */
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, C );
- break;
- case GL_SUBTRACT:
- color_combine = (R200_TXC_ARG_B_ZERO |
- R200_TXC_COMP_ARG_B |
- R200_TXC_NEG_ARG_C |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, C );
- break;
- case GL_INTERPOLATE:
- color_combine = (R200_TXC_OP_LERP);
- R200_COLOR_ARG( 0, B );
- R200_COLOR_ARG( 1, A );
- R200_COLOR_ARG( 2, C );
- break;
-
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- /* The EXT version of the DOT3 extension does not support the
- * scale factor, but the ARB version (and the version in OpenGL
- * 1.3) does.
- */
- RGBshift = 0;
- /* FALLTHROUGH */
-
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- /* DOT3 works differently on R200 than on R100. On R100, just
- * setting the DOT3 mode did everything for you. On R200, the
- * driver has to enable the biasing and scale in the inputs to
- * put them in the proper [-1,1] range. This is what the 4x and
- * the -0.5 in the DOT3 spec do. The post-scale is then set
- * normally.
- */
-
- color_combine = (R200_TXC_ARG_C_ZERO |
- R200_TXC_OP_DOT3 |
- R200_TXC_BIAS_ARG_A |
- R200_TXC_BIAS_ARG_B |
- R200_TXC_SCALE_ARG_A |
- R200_TXC_SCALE_ARG_B);
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, B );
- break;
-
- case GL_MODULATE_ADD_ATI:
- color_combine = (R200_TXC_OP_MADD);
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, C );
- R200_COLOR_ARG( 2, B );
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- color_combine = (R200_TXC_BIAS_ARG_C | /* new */
- R200_TXC_OP_MADD); /* was ADDSIGNED */
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, C );
- R200_COLOR_ARG( 2, B );
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- color_combine = (R200_TXC_NEG_ARG_C |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG( 0, A );
- R200_COLOR_ARG( 1, C );
- R200_COLOR_ARG( 2, B );
- break;
- default:
- return GL_FALSE;
- }
-
- switch ( texUnit->_CurrentCombine->ModeA ) {
- case GL_REPLACE:
- alpha_combine = (R200_TXA_ARG_A_ZERO |
- R200_TXA_ARG_B_ZERO |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG( 0, C );
- break;
- case GL_MODULATE:
- alpha_combine = (R200_TXA_ARG_C_ZERO |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, B );
- break;
- case GL_ADD:
- alpha_combine = (R200_TXA_ARG_B_ZERO |
- R200_TXA_COMP_ARG_B |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, C );
- break;
- case GL_ADD_SIGNED:
- alpha_combine = (R200_TXA_ARG_B_ZERO |
- R200_TXA_COMP_ARG_B |
- R200_TXA_BIAS_ARG_C | /* new */
- R200_TXA_OP_MADD); /* was ADDSIGNED */
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, C );
- break;
- case GL_SUBTRACT:
- alpha_combine = (R200_TXA_ARG_B_ZERO |
- R200_TXA_COMP_ARG_B |
- R200_TXA_NEG_ARG_C |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, C );
- break;
- case GL_INTERPOLATE:
- alpha_combine = (R200_TXA_OP_LERP);
- R200_ALPHA_ARG( 0, B );
- R200_ALPHA_ARG( 1, A );
- R200_ALPHA_ARG( 2, C );
- break;
-
- case GL_MODULATE_ADD_ATI:
- alpha_combine = (R200_TXA_OP_MADD);
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, C );
- R200_ALPHA_ARG( 2, B );
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- alpha_combine = (R200_TXA_BIAS_ARG_C | /* new */
- R200_TXA_OP_MADD); /* was ADDSIGNED */
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, C );
- R200_ALPHA_ARG( 2, B );
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- alpha_combine = (R200_TXA_NEG_ARG_C |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG( 0, A );
- R200_ALPHA_ARG( 1, C );
- R200_ALPHA_ARG( 2, B );
- break;
- default:
- return GL_FALSE;
- }
-
- if ( (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT)
- || (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) ) {
- alpha_scale |= R200_TXA_DOT_ALPHA;
- Ashift = RGBshift;
- }
-
- /* Step 3:
- * Apply the scale factor.
- */
- color_scale |= (RGBshift << R200_TXC_SCALE_SHIFT);
- alpha_scale |= (Ashift << R200_TXA_SCALE_SHIFT);
-
- /* All done!
- */
- }
-
- if ( rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND] != color_combine ||
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND] != alpha_combine ||
- rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] != color_scale ||
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] != alpha_scale) {
- R200_STATECHANGE( rmesa, pix[unit] );
- rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND] = color_combine;
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND] = alpha_combine;
- rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] = color_scale;
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] = alpha_scale;
- }
-
- return GL_TRUE;
-}
-
-#define TEXOBJ_TXFILTER_MASK (R200_MAX_MIP_LEVEL_MASK | \
- R200_MIN_FILTER_MASK | \
- R200_MAG_FILTER_MASK | \
- R200_MAX_ANISO_MASK | \
- R200_YUV_TO_RGB | \
- R200_YUV_TEMPERATURE_MASK | \
- R200_CLAMP_S_MASK | \
- R200_CLAMP_T_MASK | \
- R200_BORDER_MODE_D3D )
-
-#define TEXOBJ_TXFORMAT_MASK (R200_TXFORMAT_WIDTH_MASK | \
- R200_TXFORMAT_HEIGHT_MASK | \
- R200_TXFORMAT_FORMAT_MASK | \
- R200_TXFORMAT_F5_WIDTH_MASK | \
- R200_TXFORMAT_F5_HEIGHT_MASK | \
- R200_TXFORMAT_ALPHA_IN_MAP | \
- R200_TXFORMAT_CUBIC_MAP_ENABLE | \
- R200_TXFORMAT_NON_POWER2)
-
-#define TEXOBJ_TXFORMAT_X_MASK (R200_DEPTH_LOG2_MASK | \
- R200_TEXCOORD_MASK | \
- R200_CLAMP_Q_MASK | \
- R200_VOLUME_FILTER_MASK)
-
-
-static void import_tex_obj_state( r200ContextPtr rmesa,
- int unit,
- r200TexObjPtr texobj )
-{
- GLuint *cmd = R200_DB_STATE( tex[unit] );
-
- cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK;
- cmd[TEX_PP_TXFILTER] |= texobj->pp_txfilter & TEXOBJ_TXFILTER_MASK;
- cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
- cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK;
- cmd[TEX_PP_TXFORMAT_X] &= ~TEXOBJ_TXFORMAT_X_MASK;
- cmd[TEX_PP_TXFORMAT_X] |= texobj->pp_txformat_x & TEXOBJ_TXFORMAT_X_MASK;
- cmd[TEX_PP_TXSIZE] = texobj->pp_txsize; /* NPOT only! */
- cmd[TEX_PP_TXPITCH] = texobj->pp_txpitch; /* NPOT only! */
- cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset;
- cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color;
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.tex[unit] );
-
- if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) {
- GLuint *cube_cmd = R200_DB_STATE( cube[unit] );
- GLuint bytesPerFace = texobj->base.totalSize / 6;
- ASSERT(texobj->base.totalSize % 6 == 0);
- cube_cmd[CUBE_PP_CUBIC_FACES] = texobj->pp_cubic_faces;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F1] = texobj->pp_txoffset + 1 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F2] = texobj->pp_txoffset + 2 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F3] = texobj->pp_txoffset + 3 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F4] = texobj->pp_txoffset + 4 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F5] = texobj->pp_txoffset + 5 * bytesPerFace;
- R200_DB_STATECHANGE( rmesa, &rmesa->hw.cube[unit] );
- }
-
- texobj->dirty_state &= ~(1<<unit);
-}
-
-
-static void set_texgen_matrix( r200ContextPtr rmesa,
- GLuint unit,
- const GLfloat *s_plane,
- const GLfloat *t_plane,
- const GLfloat *r_plane,
- const GLfloat *q_plane )
-{
- GLfloat m[16];
-
- m[0] = s_plane[0];
- m[4] = s_plane[1];
- m[8] = s_plane[2];
- m[12] = s_plane[3];
-
- m[1] = t_plane[0];
- m[5] = t_plane[1];
- m[9] = t_plane[2];
- m[13] = t_plane[3];
-
- m[2] = r_plane[0];
- m[6] = r_plane[1];
- m[10] = r_plane[2];
- m[14] = r_plane[3];
-
- m[3] = q_plane[0];
- m[7] = q_plane[1];
- m[11] = q_plane[2];
- m[15] = q_plane[3];
-
- _math_matrix_loadf( &(rmesa->TexGenMatrix[unit]), m);
- _math_matrix_analyse( &(rmesa->TexGenMatrix[unit]) );
- rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE<<unit;
-}
-
-
-/*
- * Returns GL_FALSE if fallback required.
- */
-static GLboolean r200_validate_texgen( GLcontext *ctx, GLuint unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit*4;
- GLuint tgi, tgcm;
- GLuint mode = 0;
- GLboolean mixed_fallback = GL_FALSE;
- static const GLfloat I[16] = {
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1 };
- static const GLfloat reflect[16] = {
- -1, 0, 0, 0,
- 0, -1, 0, 0,
- 0, 0, -1, 0,
- 0, 0, 0, 1 };
-
- rmesa->TexGenCompSel &= ~(R200_OUTPUT_TEX_0 << unit);
- rmesa->TexGenEnabled &= ~(R200_TEXGEN_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenNeedNormals[unit] = GL_FALSE;
- tgi = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] & ~(R200_TEXGEN_INPUT_MASK <<
- inputshift);
- tgcm = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] & ~(R200_TEXGEN_COMP_MASK <<
- (unit * 4));
-
- if (0)
- fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit);
-
- if (texUnit->TexGenEnabled & S_BIT) {
- mode = texUnit->GenModeS;
- } else {
- tgcm |= R200_TEXGEN_COMP_S << (unit * 4);
- }
-
- if (texUnit->TexGenEnabled & T_BIT) {
- if (texUnit->GenModeT != mode)
- mixed_fallback = GL_TRUE;
- } else {
- tgcm |= R200_TEXGEN_COMP_T << (unit * 4);
- }
-
- if (texUnit->TexGenEnabled & R_BIT) {
- if (texUnit->GenModeR != mode)
- mixed_fallback = GL_TRUE;
- } else {
- tgcm |= R200_TEXGEN_COMP_R << (unit * 4);
- }
-
- if (texUnit->TexGenEnabled & Q_BIT) {
- if (texUnit->GenModeQ != mode)
- mixed_fallback = GL_TRUE;
- } else {
- tgcm |= R200_TEXGEN_COMP_Q << (unit * 4);
- }
-
- if (mixed_fallback) {
- if (R200_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "fallback mixed texgen, 0x%x (0x%x 0x%x 0x%x 0x%x)\n",
- texUnit->TexGenEnabled, texUnit->GenModeS, texUnit->GenModeT,
- texUnit->GenModeR, texUnit->GenModeQ);
- return GL_FALSE;
- }
-
- switch (mode) {
- case GL_OBJECT_LINEAR:
- tgi |= R200_TEXGEN_INPUT_OBJ << inputshift;
- set_texgen_matrix( rmesa, unit,
- (texUnit->TexGenEnabled & S_BIT) ? texUnit->ObjectPlaneS : I,
- (texUnit->TexGenEnabled & T_BIT) ? texUnit->ObjectPlaneT : I + 4,
- (texUnit->TexGenEnabled & R_BIT) ? texUnit->ObjectPlaneR : I + 8,
- (texUnit->TexGenEnabled & Q_BIT) ? texUnit->ObjectPlaneQ : I + 12);
- break;
-
- case GL_EYE_LINEAR:
- tgi |= R200_TEXGEN_INPUT_EYE << inputshift;
- set_texgen_matrix( rmesa, unit,
- (texUnit->TexGenEnabled & S_BIT) ? texUnit->EyePlaneS : I,
- (texUnit->TexGenEnabled & T_BIT) ? texUnit->EyePlaneT : I + 4,
- (texUnit->TexGenEnabled & R_BIT) ? texUnit->EyePlaneR : I + 8,
- (texUnit->TexGenEnabled & Q_BIT) ? texUnit->EyePlaneQ : I + 12);
- break;
-
- case GL_REFLECTION_MAP_NV:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- tgi |= R200_TEXGEN_INPUT_EYE_REFLECT<<inputshift;
- set_texgen_matrix( rmesa, unit,
- (texUnit->TexGenEnabled & S_BIT) ? reflect : I,
- (texUnit->TexGenEnabled & T_BIT) ? reflect + 4 : I + 4,
- (texUnit->TexGenEnabled & R_BIT) ? reflect + 8 : I + 8,
- I + 12);
- break;
-
- case GL_NORMAL_MAP_NV:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- tgi |= R200_TEXGEN_INPUT_EYE_NORMAL<<inputshift;
- break;
-
- case GL_SPHERE_MAP:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- tgi |= R200_TEXGEN_INPUT_SPHERE<<inputshift;
- break;
-
- case 0:
- /* All texgen units were disabled, so just pass coords through. */
- tgi |= unit << inputshift;
- break;
-
- default:
- /* Unsupported mode, fallback:
- */
- if (R200_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "fallback unsupported texgen, %d\n",
- texUnit->GenModeS);
- return GL_FALSE;
- }
-
- rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
- rmesa->TexGenCompSel |= R200_OUTPUT_TEX_0 << unit;
-
- if (tgi != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] ||
- tgcm != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2])
- {
- R200_STATECHANGE(rmesa, tcg);
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] = tgi;
- rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] = tgcm;
- }
-
- return GL_TRUE;
-}
-
-
-static void disable_tex( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE<<unit)) {
- /* Texture unit disabled */
- if ( rmesa->state.texture.unit[unit].texobj != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->state.texture.unit[unit].texobj->base.bound &= ~(1UL << unit);
- rmesa->state.texture.unit[unit].texobj = NULL;
- }
-
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~((R200_TEX_0_ENABLE |
- R200_TEX_BLEND_0_ENABLE) << unit);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_BLEND_0_ENABLE;
-
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
-
- if (rmesa->TclFallback & (R200_TCL_FALLBACK_TEXGEN_0<<unit)) {
- TCL_FALLBACK( ctx, (R200_TCL_FALLBACK_TEXGEN_0<<unit), GL_FALSE);
- }
-
- /* Actually want to keep all units less than max active texture
- * enabled, right? Fix this for >2 texunits.
- */
- /* FIXME: What should happen here if r200UpdateTextureEnv fails? */
- if (unit == 0)
- r200UpdateTextureEnv( ctx, unit );
-
-
- {
- GLuint tmp = rmesa->TexGenEnabled;
-
- rmesa->TexGenEnabled &= ~(R200_TEXGEN_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenNeedNormals[unit] = GL_FALSE;
- rmesa->TexGenCompSel &= ~(R200_OUTPUT_TEX_0 << unit);
-
- if (tmp != rmesa->TexGenEnabled) {
- rmesa->recheck_texgen[unit] = GL_TRUE;
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
- }
- }
-}
-
-static void set_re_cntl_d3d( GLcontext *ctx, int unit, GLboolean use_d3d )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- GLuint re_cntl;
-
- re_cntl = rmesa->hw.set.cmd[SET_RE_CNTL] & ~(R200_VTX_STQ0_D3D << (2 * unit));
- if (use_d3d)
- re_cntl |= R200_VTX_STQ0_D3D << (2 * unit);
-
- if ( re_cntl != rmesa->hw.set.cmd[SET_RE_CNTL] ) {
- R200_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_RE_CNTL] = re_cntl;
- }
-}
-
-static GLboolean enable_tex_2d( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
-
- /* Need to load the 2d images associated with this unit.
- */
- if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) {
- t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_1D);
-
- if ( t->base.dirty_images[0] ) {
- R200_FIREVERTICES( rmesa );
- r200SetTexImages( rmesa, tObj );
- r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 );
- if ( !t->base.memBlock )
- return GL_FALSE;
- }
-
- set_re_cntl_d3d( ctx, unit, GL_FALSE );
-
- return GL_TRUE;
-}
-
-#if ENABLE_HW_3D_TEXTURE
-static GLboolean enable_tex_3d( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
-
- /* Need to load the 3d images associated with this unit.
- */
- if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) {
- t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_3D);
-
- /* R100 & R200 do not support mipmaps for 3D textures.
- */
- if ( (tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR) ) {
- return GL_FALSE;
- }
-
- if ( t->base.dirty_images[0] ) {
- R200_FIREVERTICES( rmesa );
- r200SetTexImages( rmesa, tObj );
- r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 );
- if ( !t->base.memBlock )
- return GL_FALSE;
- }
-
- set_re_cntl_d3d( ctx, unit, GL_TRUE );
-
- return GL_TRUE;
-}
-#endif
-
-static GLboolean enable_tex_cube( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
- GLuint face;
-
- /* Need to load the 2d images associated with this unit.
- */
- if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) {
- t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2;
- for (face = 0; face < 6; face++)
- t->base.dirty_images[face] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_CUBE_MAP);
-
- if ( t->base.dirty_images[0] || t->base.dirty_images[1] ||
- t->base.dirty_images[2] || t->base.dirty_images[3] ||
- t->base.dirty_images[4] || t->base.dirty_images[5] ) {
- /* flush */
- R200_FIREVERTICES( rmesa );
- /* layout memory space, once for all faces */
- r200SetTexImages( rmesa, tObj );
- }
-
- /* upload (per face) */
- for (face = 0; face < 6; face++) {
- if (t->base.dirty_images[face]) {
- r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, face );
- }
- }
-
- if ( !t->base.memBlock ) {
- /* texmem alloc failed, use s/w fallback */
- return GL_FALSE;
- }
-
- set_re_cntl_d3d( ctx, unit, GL_TRUE );
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_rect( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
-
- if (!(t->pp_txformat & R200_TXFORMAT_NON_POWER2)) {
- t->pp_txformat |= R200_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_RECTANGLE_NV);
-
- if ( t->base.dirty_images[0] ) {
- R200_FIREVERTICES( rmesa );
- r200SetTexImages( rmesa, tObj );
- r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 );
- if ( !t->base.memBlock && !rmesa->prefer_gart_client_texturing )
- return GL_FALSE;
- }
-
- set_re_cntl_d3d( ctx, unit, GL_FALSE );
-
- return GL_TRUE;
-}
-
-
-static GLboolean update_tex_common( GLcontext *ctx, int unit )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData;
- GLenum format;
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 )
- return GL_FALSE;
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if ( rmesa->state.texture.unit[unit].texobj != t ) {
- if ( rmesa->state.texture.unit[unit].texobj != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->state.texture.unit[unit].texobj->base.bound &=
- ~(1UL << unit);
- }
-
- rmesa->state.texture.unit[unit].texobj = t;
- t->base.bound |= (1UL << unit);
- t->dirty_state |= 1<<unit;
- driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked! */
- }
-
-
- /* Newly enabled?
- */
- if ( 1|| !(rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE<<unit))) {
- R200_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= (R200_TEX_0_ENABLE |
- R200_TEX_BLEND_0_ENABLE) << unit;
-
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] |= 4 << (unit * 3);
-
- rmesa->recheck_texgen[unit] = GL_TRUE;
- }
-
- if (t->dirty_state & (1<<unit)) {
- import_tex_obj_state( rmesa, unit, t );
- }
-
- if (rmesa->recheck_texgen[unit]) {
- GLboolean fallback = !r200_validate_texgen( ctx, unit );
- TCL_FALLBACK( ctx, (R200_TCL_FALLBACK_TEXGEN_0<<unit), fallback);
- rmesa->recheck_texgen[unit] = 0;
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-
- format = tObj->Image[0][tObj->BaseLevel]->Format;
- if ( rmesa->state.texture.unit[unit].format != format ||
- rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
- rmesa->state.texture.unit[unit].format = format;
- rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode;
- if ( ! r200UpdateTextureEnv( ctx, unit ) ) {
- return GL_FALSE;
- }
- }
-
- FALLBACK( rmesa, R200_FALLBACK_BORDER_MODE, t->border_fallback );
- return !t->border_fallback;
-}
-
-
-
-static GLboolean r200UpdateTextureUnit( GLcontext *ctx, int unit )
-{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if ( texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT) ) {
- return (enable_tex_rect( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
- else if ( texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) {
- return (enable_tex_2d( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
-#if ENABLE_HW_3D_TEXTURE
- else if ( texUnit->_ReallyEnabled & (TEXTURE_3D_BIT) ) {
- return (enable_tex_3d( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
-#endif
- else if ( texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT) ) {
- return (enable_tex_cube( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
- else if ( texUnit->_ReallyEnabled ) {
- return GL_FALSE;
- }
- else {
- disable_tex( ctx, unit );
- return GL_TRUE;
- }
-}
-
-
-void r200UpdateTextureState( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLboolean ok;
- GLuint dbg;
-
- ok = (r200UpdateTextureUnit( ctx, 0 ) &&
- r200UpdateTextureUnit( ctx, 1 ) &&
- r200UpdateTextureUnit( ctx, 2 ) &&
- r200UpdateTextureUnit( ctx, 3 ) &&
- r200UpdateTextureUnit( ctx, 4 ) &&
- r200UpdateTextureUnit( ctx, 5 ));
-
- FALLBACK( rmesa, R200_FALLBACK_TEXTURE, !ok );
-
- if (rmesa->TclFallback)
- r200ChooseVertexState( ctx );
-
-
- if (rmesa->r200Screen->chipset & R200_CHIPSET_REAL_R200) {
-
- /*
- * T0 hang workaround -------------
- * not needed for r200 derivatives?
- */
- if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_ENABLE_MASK) == R200_TEX_0_ENABLE &&
- (rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK) > R200_MIN_FILTER_LINEAR) {
-
- R200_STATECHANGE(rmesa, ctx);
- R200_STATECHANGE(rmesa, tex[1]);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_1_ENABLE;
- rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
- rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] |= 0x08000000;
- }
- else {
- if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_1_ENABLE) &&
- (rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] & 0x08000000)) {
- R200_STATECHANGE(rmesa, tex[1]);
- rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] &= ~0x08000000;
- }
- }
-
- /* maybe needs to be done pairwise due to 2 parallel (physical) tex units ?
- looks like that's not the case, if 8500/9100 owners don't complain remove this...
- for ( i = 0; i < ctx->Const.MaxTextureUnits; i += 2) {
- if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & ((R200_TEX_0_ENABLE |
- R200_TEX_1_ENABLE ) << i)) == (R200_TEX_0_ENABLE << i)) &&
- ((rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK) >
- R200_MIN_FILTER_LINEAR)) {
- R200_STATECHANGE(rmesa, ctx);
- R200_STATECHANGE(rmesa, tex[i+1]);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= (R200_TEX_1_ENABLE << i);
- rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
- rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] |= 0x08000000;
- }
- else {
- if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_1_ENABLE << i)) &&
- (rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] & 0x08000000)) {
- R200_STATECHANGE(rmesa, tex[i+1]);
- rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] &= ~0x08000000;
- }
- }
- } */
-
- /*
- * Texture cache LRU hang workaround -------------
- * not needed for r200 derivatives?
- */
-
- /* While the cases below attempt to only enable the workaround in the
- * specific cases necessary, they were insufficient. See bugzilla #1519,
- * #729, #814. Tests with quake3 showed no impact on performance.
- */
- dbg = 0x6;
-
- /*
- if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE )) &&
- ((((rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0)) ||
- ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_2_ENABLE) &&
- ((((rmesa->hw.tex[2].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0)) ||
- ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_4_ENABLE) &&
- ((((rmesa->hw.tex[4].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0)))
- {
- dbg |= 0x02;
- }
-
- if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_1_ENABLE )) &&
- ((((rmesa->hw.tex[1].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0)) ||
- ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_3_ENABLE) &&
- ((((rmesa->hw.tex[3].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0)) ||
- ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_5_ENABLE) &&
- ((((rmesa->hw.tex[5].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0)))
- {
- dbg |= 0x04;
- }*/
-
- if (dbg != rmesa->hw.tam.cmd[TAM_DEBUG3]) {
- R200_STATECHANGE( rmesa, tam );
- rmesa->hw.tam.cmd[TAM_DEBUG3] = dbg;
- if (0) printf("TEXCACHE LRU HANG WORKAROUND %x\n", dbg);
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.c
deleted file mode 100644
index 08173fda2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.c
+++ /dev/null
@@ -1,1227 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c,v 1.4 2003/05/06 23:52:08 daenzer Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "r200_context.h"
-#include "r200_state.h"
-#include "r200_ioctl.h"
-#include "r200_tex.h"
-#include "r200_tcl.h"
-#include "r200_swtcl.h"
-#include "r200_vtxfmt.h"
-
-#include "api_noop.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "glapi.h"
-#include "colormac.h"
-#include "light.h"
-#include "state.h"
-#include "vtxfmt.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_array_api.h"
-
-#include "dispatch.h"
-
-static void r200VtxFmtFlushVertices( GLcontext *, GLuint );
-
-static void count_func( const char *name, struct dynfn *l )
-{
- int i = 0;
- struct dynfn *f;
- foreach (f, l) i++;
- if (i) fprintf(stderr, "%s: %d\n", name, i );
-}
-
-static void count_funcs( r200ContextPtr rmesa )
-{
- count_func( "Vertex2f", &rmesa->vb.dfn_cache.Vertex2f );
- count_func( "Vertex2fv", &rmesa->vb.dfn_cache.Vertex2fv );
- count_func( "Vertex3f", &rmesa->vb.dfn_cache.Vertex3f );
- count_func( "Vertex3fv", &rmesa->vb.dfn_cache.Vertex3fv );
- count_func( "Color4ub", &rmesa->vb.dfn_cache.Color4ub );
- count_func( "Color4ubv", &rmesa->vb.dfn_cache.Color4ubv );
- count_func( "Color3ub", &rmesa->vb.dfn_cache.Color3ub );
- count_func( "Color3ubv", &rmesa->vb.dfn_cache.Color3ubv );
- count_func( "Color4f", &rmesa->vb.dfn_cache.Color4f );
- count_func( "Color4fv", &rmesa->vb.dfn_cache.Color4fv );
- count_func( "Color3f", &rmesa->vb.dfn_cache.Color3f );
- count_func( "Color3fv", &rmesa->vb.dfn_cache.Color3fv );
- count_func( "SecondaryColor3f", &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
- count_func( "SecondaryColor3fv", &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
- count_func( "SecondaryColor3ub", &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
- count_func( "SecondaryColor3ubv", &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
- count_func( "Normal3f", &rmesa->vb.dfn_cache.Normal3f );
- count_func( "Normal3fv", &rmesa->vb.dfn_cache.Normal3fv );
- count_func( "TexCoord3f", &rmesa->vb.dfn_cache.TexCoord3f );
- count_func( "TexCoord3fv", &rmesa->vb.dfn_cache.TexCoord3fv );
- count_func( "TexCoord2f", &rmesa->vb.dfn_cache.TexCoord2f );
- count_func( "TexCoord2fv", &rmesa->vb.dfn_cache.TexCoord2fv );
- count_func( "TexCoord1f", &rmesa->vb.dfn_cache.TexCoord1f );
- count_func( "TexCoord1fv", &rmesa->vb.dfn_cache.TexCoord1fv );
- count_func( "MultiTexCoord3fARB", &rmesa->vb.dfn_cache.MultiTexCoord3fARB );
- count_func( "MultiTexCoord3fvARB", &rmesa->vb.dfn_cache.MultiTexCoord3fvARB );
- count_func( "MultiTexCoord2fARB", &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- count_func( "MultiTexCoord2fvARB", &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- count_func( "MultiTexCoord1fARB", &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
- count_func( "MultiTexCoord1fvARB", &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
-/* count_func( "FogCoordfEXT", &rmesa->vb.dfn_cache.FogCoordfEXT );
- count_func( "FogCoordfvEXT", &rmesa->vb.dfn_cache.FogCoordfvEXT );*/
-}
-
-
-void r200_copy_to_current( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- unsigned i;
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
-
- if (rmesa->vb.vtxfmt_0 & R200_VTX_N0) {
- ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0] = rmesa->vb.normalptr[0];
- ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1] = rmesa->vb.normalptr[1];
- ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2] = rmesa->vb.normalptr[2];
- }
-
- if (rmesa->vb.vtxfmt_0 & R200_VTX_DISCRETE_FOG) {
- ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = rmesa->vb.fogptr[0];
- }
-
- switch( VTX_COLOR(rmesa->vb.vtxfmt_0, 0) ) {
- case R200_VTX_PK_RGBA:
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->red );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->green );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->blue );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->alpha );
- break;
-
- case R200_VTX_FP_RGB:
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = rmesa->vb.floatcolorptr[0];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = rmesa->vb.floatcolorptr[1];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = rmesa->vb.floatcolorptr[2];
- break;
-
- case R200_VTX_FP_RGBA:
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = rmesa->vb.floatcolorptr[0];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = rmesa->vb.floatcolorptr[1];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = rmesa->vb.floatcolorptr[2];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = rmesa->vb.floatcolorptr[3];
- break;
-
- default:
- break;
- }
-
- if (VTX_COLOR(rmesa->vb.vtxfmt_0, 1) == R200_VTX_PK_RGBA) {
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] = UBYTE_TO_FLOAT( rmesa->vb.specptr->red );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] = UBYTE_TO_FLOAT( rmesa->vb.specptr->green );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] = UBYTE_TO_FLOAT( rmesa->vb.specptr->blue );
- }
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- const unsigned count = VTX_TEXn_COUNT( rmesa->vb.vtxfmt_1, i );
- GLfloat * const src = rmesa->vb.texcoordptr[i];
-
- if ( count != 0 ) {
- switch( count ) {
- case 3:
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][1] = src[1];
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][2] = src[2];
- break;
- case 2:
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][1] = src[1];
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][2] = 0.0F;
- break;
- case 1:
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][1] = 0.0F;
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][2] = 0.0F;
- break;
- }
-
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][0] = src[0];
- ctx->Current.Attrib[VERT_ATTRIB_TEX0+i][3] = 1.0F;
- }
- }
-
- ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
-}
-
-static GLboolean discreet_gl_prim[GL_POLYGON+1] = {
- 1, /* 0 points */
- 1, /* 1 lines */
- 0, /* 2 line_strip */
- 0, /* 3 line_loop */
- 1, /* 4 tris */
- 0, /* 5 tri_fan */
- 0, /* 6 tri_strip */
- 1, /* 7 quads */
- 0, /* 8 quadstrip */
- 0, /* 9 poly */
-};
-
-static void flush_prims( r200ContextPtr rmesa )
-{
- int i,j;
- struct r200_dma_region tmp = rmesa->dma.current;
-
- tmp.buf->refcount++;
- tmp.aos_size = rmesa->vb.vertex_size;
- tmp.aos_stride = rmesa->vb.vertex_size;
- tmp.aos_start = GET_START(&tmp);
-
- rmesa->dma.current.ptr = rmesa->dma.current.start +=
- (rmesa->vb.initial_counter - rmesa->vb.counter) *
- rmesa->vb.vertex_size * 4;
-
- rmesa->tcl.vertex_format = rmesa->vb.vtxfmt_0;
- rmesa->tcl.aos_components[0] = &tmp;
- rmesa->tcl.nr_aos_components = 1;
- rmesa->dma.flush = NULL;
-
- /* Optimize the primitive list:
- */
- if (rmesa->vb.nrprims > 1) {
- for (j = 0, i = 1 ; i < rmesa->vb.nrprims; i++) {
- int pj = rmesa->vb.primlist[j].prim & 0xf;
- int pi = rmesa->vb.primlist[i].prim & 0xf;
-
- if (pj == pi && discreet_gl_prim[pj] &&
- rmesa->vb.primlist[i].start == rmesa->vb.primlist[j].end) {
- rmesa->vb.primlist[j].end = rmesa->vb.primlist[i].end;
- }
- else {
- j++;
- if (j != i) rmesa->vb.primlist[j] = rmesa->vb.primlist[i];
- }
- }
- rmesa->vb.nrprims = j+1;
- }
-
- if (rmesa->vb.vtxfmt_0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||
- rmesa->vb.vtxfmt_1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) {
- R200_STATECHANGE( rmesa, vtx );
- rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = rmesa->vb.vtxfmt_0;
- rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = rmesa->vb.vtxfmt_1;
- }
-
-
- for (i = 0 ; i < rmesa->vb.nrprims; i++) {
- if (R200_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "vtxfmt prim %d: %s %d..%d\n", i,
- _mesa_lookup_enum_by_nr( rmesa->vb.primlist[i].prim &
- PRIM_MODE_MASK ),
- rmesa->vb.primlist[i].start,
- rmesa->vb.primlist[i].end);
-
- if (rmesa->vb.primlist[i].start < rmesa->vb.primlist[i].end)
- r200EmitPrimitive( rmesa->glCtx,
- rmesa->vb.primlist[i].start,
- rmesa->vb.primlist[i].end,
- rmesa->vb.primlist[i].prim );
- }
-
- rmesa->vb.nrprims = 0;
- r200ReleaseDmaRegion( rmesa, &tmp, __FUNCTION__ );
-}
-
-
-static void start_prim( r200ContextPtr rmesa, GLuint mode )
-{
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s %d\n", __FUNCTION__,
- rmesa->vb.initial_counter - rmesa->vb.counter);
-
- rmesa->vb.primlist[rmesa->vb.nrprims].start =
- rmesa->vb.initial_counter - rmesa->vb.counter;
- rmesa->vb.primlist[rmesa->vb.nrprims].prim = mode;
-}
-
-static void note_last_prim( r200ContextPtr rmesa, GLuint flags )
-{
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s %d\n", __FUNCTION__,
- rmesa->vb.initial_counter - rmesa->vb.counter);
-
- if (rmesa->vb.prim[0] != GL_POLYGON+1) {
- rmesa->vb.primlist[rmesa->vb.nrprims].prim |= flags;
- rmesa->vb.primlist[rmesa->vb.nrprims].end =
- rmesa->vb.initial_counter - rmesa->vb.counter;
-
- if (++(rmesa->vb.nrprims) == R200_MAX_PRIMS)
- flush_prims( rmesa );
- }
-}
-
-
-static void copy_vertex( r200ContextPtr rmesa, GLuint n, GLfloat *dst )
-{
- GLuint i;
- GLfloat *src = (GLfloat *)(rmesa->dma.current.address +
- rmesa->dma.current.ptr +
- (rmesa->vb.primlist[rmesa->vb.nrprims].start + n) *
- rmesa->vb.vertex_size * 4);
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "copy_vertex %d\n", rmesa->vb.primlist[rmesa->vb.nrprims].start + n);
-
- for (i = 0 ; i < rmesa->vb.vertex_size; i++) {
- dst[i] = src[i];
- }
-}
-
-/* NOTE: This actually reads the copied vertices back from uncached
- * memory. Could also use the counter/notify mechanism to populate
- * tmp on the fly as vertices are generated.
- */
-static GLuint copy_dma_verts( r200ContextPtr rmesa, GLfloat (*tmp)[R200_MAX_VERTEX_SIZE] )
-{
- GLuint ovf, i;
- GLuint nr = (rmesa->vb.initial_counter - rmesa->vb.counter) -
- rmesa->vb.primlist[rmesa->vb.nrprims].start;
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s %d verts\n", __FUNCTION__, nr);
-
- switch( rmesa->vb.prim[0] )
- {
- case GL_POINTS:
- return 0;
- case GL_LINES:
- ovf = nr&1;
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_TRIANGLES:
- ovf = nr%3;
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_QUADS:
- ovf = nr&3;
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_LINE_STRIP:
- if (nr == 0)
- return 0;
- copy_vertex( rmesa, nr-1, tmp[0] );
- return 1;
- case GL_LINE_LOOP:
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- if (nr == 0)
- return 0;
- else if (nr == 1) {
- copy_vertex( rmesa, 0, tmp[0] );
- return 1;
- } else {
- copy_vertex( rmesa, 0, tmp[0] );
- copy_vertex( rmesa, nr-1, tmp[1] );
- return 2;
- }
- case GL_TRIANGLE_STRIP:
- ovf = MIN2( nr, 2 );
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_QUAD_STRIP:
- switch (nr) {
- case 0: ovf = 0; break;
- case 1: ovf = 1; break;
- default: ovf = 2 + (nr&1); break;
- }
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- default:
- assert(0);
- return 0;
- }
-}
-
-static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (ctx->Driver.NeedFlush)
- r200VtxFmtFlushVertices( ctx, ctx->Driver.NeedFlush );
-
- if (ctx->NewState)
- _mesa_update_state( ctx ); /* clear state so fell_back sticks */
-
- _tnl_wakeup_exec( ctx );
- ctx->Driver.FlushVertices = r200FlushVertices;
-
- assert( rmesa->dma.flush == 0 );
- rmesa->vb.fell_back = GL_TRUE;
- rmesa->vb.installed = GL_FALSE;
-}
-
-
-/**
- * \todo
- * An interesting optimization of this function would be to have 3 element
- * table with the dispatch offsets of the TexCoord?fv functions, use count
- * to look-up the table, and a specialized version of GL_CALL that used the
- * offset number instead of the name.
- */
-static void dispatch_multitexcoord( GLuint count, GLuint unit, GLfloat * f )
-{
- switch( count ) {
- case 3:
- CALL_MultiTexCoord3fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f));
- break;
- case 2:
- CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f));
- break;
- case 1:
- CALL_MultiTexCoord1fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f));
- break;
- default:
- assert( count == 0 );
- break;
- }
-}
-
-void VFMT_FALLBACK( const char *caller )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat tmp[3][R200_MAX_VERTEX_SIZE];
- GLuint i, prim;
- GLuint ind0 = rmesa->vb.vtxfmt_0;
- GLuint ind1 = rmesa->vb.vtxfmt_1;
- GLuint nrverts;
- GLfloat alpha = 1.0;
- GLuint count;
- GLuint unit;
-
- if (R200_DEBUG & (DEBUG_FALLBACKS|DEBUG_VFMT))
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (rmesa->vb.prim[0] == GL_POLYGON+1) {
- VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
- return;
- }
-
- /* Copy vertices out of dma:
- */
- nrverts = copy_dma_verts( rmesa, tmp );
-
- /* Finish the prim at this point:
- */
- note_last_prim( rmesa, 0 );
- flush_prims( rmesa );
-
- /* Update ctx->Driver.CurrentExecPrimitive and swap in swtnl.
- */
- prim = rmesa->vb.prim[0];
- ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
- _tnl_wakeup_exec( ctx );
- ctx->Driver.FlushVertices = r200FlushVertices;
-
- assert(rmesa->dma.flush == 0);
- rmesa->vb.fell_back = GL_TRUE;
- rmesa->vb.installed = GL_FALSE;
- CALL_Begin(GET_DISPATCH(), (prim));
-
- if (rmesa->vb.installed_color_3f_sz == 4)
- alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
-
- /* Replay saved vertices
- */
- for (i = 0 ; i < nrverts; i++) {
- GLuint offset = 3;
-
- if (ind0 & R200_VTX_N0) {
- CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset += 3;
- }
-
- if (ind0 & R200_VTX_DISCRETE_FOG) {
- CALL_FogCoordfvEXT(GET_DISPATCH(), (&tmp[i][offset]));
- offset++;
- }
-
- if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
- CALL_Color4ubv(GET_DISPATCH(), ((GLubyte *)&tmp[i][offset]));
- offset++;
- }
- else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
- CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset+=4;
- }
- else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
- CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset+=3;
- }
-
- if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) {
- CALL_SecondaryColor3ubvEXT(GET_DISPATCH(), ((GLubyte *)&tmp[i][offset]));
- offset++;
- }
-
- for ( unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++ ) {
- count = VTX_TEXn_COUNT( ind1, unit );
- dispatch_multitexcoord( count, unit, &tmp[i][offset] );
- offset += count;
- }
-
- CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0]));
- }
-
- /* Replay current vertex
- */
- if (ind0 & R200_VTX_N0)
- CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr));
- if (ind0 & R200_VTX_DISCRETE_FOG) {
- CALL_FogCoordfvEXT(GET_DISPATCH(), (rmesa->vb.fogptr));
- }
-
- if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
- CALL_Color4ub(GET_DISPATCH(), (rmesa->vb.colorptr->red,
- rmesa->vb.colorptr->green,
- rmesa->vb.colorptr->blue,
- rmesa->vb.colorptr->alpha));
- }
- else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
- CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
- }
- else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
- if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) {
- CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0],
- rmesa->vb.floatcolorptr[1],
- rmesa->vb.floatcolorptr[2],
- alpha));
- }
- else {
- CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
- }
- }
-
- if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA)
- CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (rmesa->vb.specptr->red,
- rmesa->vb.specptr->green,
- rmesa->vb.specptr->blue));
-
- for ( unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++ ) {
- count = VTX_TEXn_COUNT( ind1, unit );
- dispatch_multitexcoord( count, unit, rmesa->vb.texcoordptr[unit] );
- }
-}
-
-
-
-static void wrap_buffer( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat tmp[3][R200_MAX_VERTEX_SIZE];
- GLuint i, nrverts;
-
- if (R200_DEBUG & (DEBUG_VFMT|DEBUG_PRIMS))
- fprintf(stderr, "%s %d\n", __FUNCTION__,
- rmesa->vb.initial_counter - rmesa->vb.counter);
-
- /* Don't deal with parity.
- */
- if ((((rmesa->vb.initial_counter - rmesa->vb.counter) -
- rmesa->vb.primlist[rmesa->vb.nrprims].start) & 1)) {
- rmesa->vb.counter++;
- rmesa->vb.initial_counter++;
- return;
- }
-
- /* Copy vertices out of dma:
- */
- if (rmesa->vb.prim[0] == GL_POLYGON+1)
- nrverts = 0;
- else {
- nrverts = copy_dma_verts( rmesa, tmp );
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%d vertices to copy\n", nrverts);
-
- /* Finish the prim at this point:
- */
- note_last_prim( rmesa, 0 );
- }
-
- /* Fire any buffered primitives
- */
- flush_prims( rmesa );
-
- /* Get new buffer
- */
- r200RefillCurrentDmaRegion( rmesa );
-
- /* Reset counter, dmaptr
- */
- rmesa->vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address);
- rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
- (rmesa->vb.vertex_size * 4);
- rmesa->vb.counter--;
- rmesa->vb.initial_counter = rmesa->vb.counter;
- rmesa->vb.notify = wrap_buffer;
-
- rmesa->dma.flush = flush_prims;
-
- /* Restart wrapped primitive:
- */
- if (rmesa->vb.prim[0] != GL_POLYGON+1)
- start_prim( rmesa, rmesa->vb.prim[0] );
-
-
- /* Reemit saved vertices
- */
- for (i = 0 ; i < nrverts; i++) {
- if (R200_DEBUG & DEBUG_VERTS) {
- int j;
- fprintf(stderr, "re-emit vertex %d to %p\n", i,
- (void *)rmesa->vb.dmaptr);
- if (R200_DEBUG & DEBUG_VERBOSE)
- for (j = 0 ; j < rmesa->vb.vertex_size; j++)
- fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]);
- }
-
- memcpy( rmesa->vb.dmaptr, tmp[i], rmesa->vb.vertex_size * 4 );
- rmesa->vb.dmaptr += rmesa->vb.vertex_size;
- rmesa->vb.counter--;
- }
-}
-
-
-/**
- * Determines the hardware vertex format based on the current state vector.
- *
- * \returns
- * If the hardware TCL unit is capable of handling the current state vector,
- * \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
- *
- * \todo
- * Make this color format selection data driven. If we receive only ubytes,
- * send color as ubytes. Also check if converting (with free checking for
- * overflow) is cheaper than sending floats directly.
- *
- * \todo
- * When intializing texture coordinates, it might be faster to just copy the
- * entire \c VERT_ATTRIB_TEX0 vector into the vertex buffer. It may mean that
- * some of the data (i.e., the last texture coordinate components) get copied
- * over, but that still may be faster than the conditional branching. If
- * nothing else, the code will be smaller and easier to follow.
- */
-static GLboolean check_vtx_fmt( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint ind0 = R200_VTX_Z0;
- GLuint ind1 = 0;
- GLuint i;
- GLuint count[R200_MAX_TEXTURE_UNITS];
-
- if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag)
- return GL_FALSE;
-
- if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
- ctx->Driver.FlushVertices( ctx, FLUSH_UPDATE_CURRENT );
-
- /* Make all this event-driven:
- */
- if (ctx->Light.Enabled) {
- ind0 |= R200_VTX_N0;
-
- if (ctx->Light.ColorMaterialEnabled)
- ind0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
- else
- ind0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT;
- }
- else {
- /* TODO: make this data driven?
- */
- ind0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- ind0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_1_SHIFT;
- }
- }
-
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
- ind0 |= R200_VTX_DISCRETE_FOG;
- }
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- count[i] = 0;
-
- if (ctx->Texture.Unit[i]._ReallyEnabled) {
- if (rmesa->TexGenNeedNormals[i]) {
- ind0 |= R200_VTX_N0;
- }
- else {
- switch( ctx->Texture.Unit[i]._ReallyEnabled ) {
- case TEXTURE_CUBE_BIT:
- case TEXTURE_3D_BIT:
- count[i] = 3;
- break;
- case TEXTURE_2D_BIT:
- case TEXTURE_RECT_BIT:
- count[i] = 2;
- break;
- case TEXTURE_1D_BIT:
- count[i] = 1;
- break;
- }
-
- ind1 |= count[i] << (3 * i);
- }
- }
- }
-
- if (R200_DEBUG & (DEBUG_VFMT|DEBUG_STATE))
- fprintf(stderr, "%s: format: 0x%x, 0x%x\n", __FUNCTION__, ind0, ind1 );
-
- R200_NEWPRIM(rmesa);
- rmesa->vb.vtxfmt_0 = ind0;
- rmesa->vb.vtxfmt_1 = ind1;
- rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
-
- rmesa->vb.vertex_size = 3;
- rmesa->vb.normalptr = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
- rmesa->vb.colorptr = NULL;
- rmesa->vb.floatcolorptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
- rmesa->vb.fogptr = ctx->Current.Attrib[VERT_ATTRIB_FOG];
- rmesa->vb.specptr = NULL;
- rmesa->vb.floatspecptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
- rmesa->vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
- rmesa->vb.texcoordptr[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1];
- rmesa->vb.texcoordptr[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX2];
- rmesa->vb.texcoordptr[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX3];
- rmesa->vb.texcoordptr[4] = ctx->Current.Attrib[VERT_ATTRIB_TEX4];
- rmesa->vb.texcoordptr[5] = ctx->Current.Attrib[VERT_ATTRIB_TEX5];
- rmesa->vb.texcoordptr[6] = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; /* dummy */
- rmesa->vb.texcoordptr[7] = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; /* dummy */
-
- /* Run through and initialize the vertex components in the order
- * the hardware understands:
- */
- if (ind0 & R200_VTX_N0) {
- rmesa->vb.normalptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 3;
- rmesa->vb.normalptr[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
- rmesa->vb.normalptr[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
- rmesa->vb.normalptr[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
- }
-
- if (ind0 & R200_VTX_DISCRETE_FOG) {
- rmesa->vb.fogptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 1;
- rmesa->vb.fogptr[0] = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
- }
-
- if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
- rmesa->vb.colorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color;
- rmesa->vb.vertex_size += 1;
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->alpha, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] );
- }
- else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
- rmesa->vb.floatcolorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 4;
- rmesa->vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
- rmesa->vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
- rmesa->vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
- rmesa->vb.floatcolorptr[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
- }
- else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
- rmesa->vb.floatcolorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 3;
- rmesa->vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
- rmesa->vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
- rmesa->vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
- }
-
- if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) {
- rmesa->vb.specptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color;
- rmesa->vb.vertex_size += 1;
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] );
- }
-
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- if ( count[i] != 0 ) {
- float * const attr = ctx->Current.Attrib[VERT_ATTRIB_TEX0+i];
- unsigned j;
-
- rmesa->vb.texcoordptr[i] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
-
- for ( j = 0 ; j < count[i] ; j++ ) {
- rmesa->vb.texcoordptr[i][j] = attr[j];
- }
-
- rmesa->vb.vertex_size += count[i];
- }
- }
-
- if (rmesa->vb.installed_vertex_format != rmesa->vb.vtxfmt_0) {
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "reinstall on vertex_format change\n");
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
- rmesa->vb.installed_vertex_format = rmesa->vb.vtxfmt_0;
- }
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s -- success\n", __FUNCTION__);
-
- return GL_TRUE;
-}
-
-
-void r200VtxfmtInvalidate( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- rmesa->vb.recheck = GL_TRUE;
- rmesa->vb.fell_back = GL_FALSE;
-}
-
-
-static void r200VtxfmtValidate( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (ctx->Driver.NeedFlush)
- ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
-
- rmesa->vb.recheck = GL_FALSE;
-
- if (check_vtx_fmt( ctx )) {
- if (!rmesa->vb.installed) {
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "reinstall (new install)\n");
-
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
- ctx->Driver.FlushVertices = r200VtxFmtFlushVertices;
- rmesa->vb.installed = GL_TRUE;
- }
- else if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s: already installed", __FUNCTION__);
- }
- else {
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s: failed\n", __FUNCTION__);
-
- if (rmesa->vb.installed) {
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
- _tnl_wakeup_exec( ctx );
- ctx->Driver.FlushVertices = r200FlushVertices;
- rmesa->vb.installed = GL_FALSE;
- }
- }
-}
-
-
-
-/* Materials:
- */
-static void r200_Materialfv( GLenum face, GLenum pname,
- const GLfloat *params )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->vb.prim[0] != GL_POLYGON+1) {
- VFMT_FALLBACK( __FUNCTION__ );
- CALL_Materialfv(GET_DISPATCH(), (face, pname, params));
- return;
- }
- _mesa_noop_Materialfv( face, pname, params );
- r200UpdateMaterial( ctx );
-}
-
-
-/* Begin/End
- */
-static void r200_Begin( GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s( %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( mode ));
-
- if (mode > GL_POLYGON) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
- }
-
- if (rmesa->vb.prim[0] != GL_POLYGON+1) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
- return;
- }
-
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- if (rmesa->NewGLState)
- r200ValidateState( ctx );
-
- if (rmesa->vb.recheck)
- r200VtxfmtValidate( ctx );
-
- if (!rmesa->vb.installed) {
- CALL_Begin(GET_DISPATCH(), (mode));
- return;
- }
-
-
- if (rmesa->dma.flush && rmesa->vb.counter < 12) {
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__);
- flush_prims( rmesa );
- }
-
- /* Need to arrange to save vertices here? Or always copy from dma (yuk)?
- */
- if (!rmesa->dma.flush) {
- if (rmesa->dma.current.ptr + 12*rmesa->vb.vertex_size*4 >
- rmesa->dma.current.end) {
- R200_NEWPRIM( rmesa );
- r200RefillCurrentDmaRegion( rmesa );
- }
-
- rmesa->vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr);
- rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
- (rmesa->vb.vertex_size * 4);
- rmesa->vb.counter--;
- rmesa->vb.initial_counter = rmesa->vb.counter;
- rmesa->vb.notify = wrap_buffer;
- rmesa->dma.flush = flush_prims;
- ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
- }
-
-
- rmesa->vb.prim[0] = mode;
- start_prim( rmesa, mode | PRIM_BEGIN );
-}
-
-
-
-static void r200_End( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->vb.prim[0] == GL_POLYGON+1) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
- return;
- }
-
- note_last_prim( rmesa, PRIM_END );
- rmesa->vb.prim[0] = GL_POLYGON+1;
-}
-
-
-/* Fallback on difficult entrypoints:
- */
-#define PRE_LOOPBACK( FUNC ) \
-do { \
- if (R200_DEBUG & DEBUG_VFMT) \
- fprintf(stderr, "%s\n", __FUNCTION__); \
- VFMT_FALLBACK( __FUNCTION__ ); \
-} while (0)
-#define TAG(x) r200_fallback_##x
-#include "vtxfmt_tmp.h"
-
-
-
-static GLboolean r200NotifyBegin( GLcontext *ctx, GLenum p )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(!rmesa->vb.installed);
-
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- if (rmesa->NewGLState)
- r200ValidateState( ctx );
-
- if (ctx->Driver.NeedFlush)
- ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
-
- if (rmesa->vb.recheck)
- r200VtxfmtValidate( ctx );
-
- if (!rmesa->vb.installed) {
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s -- failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- r200_Begin( p );
- return GL_TRUE;
-}
-
-static void r200VtxFmtFlushVertices( GLcontext *ctx, GLuint flags )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(rmesa->vb.installed);
-
- if (flags & FLUSH_UPDATE_CURRENT) {
- r200_copy_to_current( ctx );
- if (R200_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "reinstall on update_current\n");
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
- ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
- }
-
- if (flags & FLUSH_STORED_VERTICES) {
- assert (rmesa->dma.flush == 0 ||
- rmesa->dma.flush == flush_prims);
- if (rmesa->dma.flush == flush_prims)
- flush_prims( rmesa );
- ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
- }
-}
-
-
-
-/* At this point, don't expect very many versions of each function to
- * be generated, so not concerned about freeing them?
- */
-
-
-void r200VtxfmtInit( GLcontext *ctx, GLboolean useCodegen )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
- GLvertexformat *vfmt = &(rmesa->vb.vtxfmt);
-
- MEMSET( vfmt, 0, sizeof(GLvertexformat) );
-
- /* Hook in chooser functions for codegen, etc:
- */
- r200VtxfmtInitChoosers( vfmt );
-
- /* Handled fully in supported states, but no codegen:
- */
- vfmt->Materialfv = r200_Materialfv;
- vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
- vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
- vfmt->Begin = r200_Begin;
- vfmt->End = r200_End;
-
- /* Fallback for performance reasons: (Fix with cva/elt path here and
- * dmatmp2.h style primitive-merging)
- *
- * These should call NotifyBegin(), as should _tnl_EvalMesh, to allow
- * a driver-hook.
- */
- vfmt->DrawArrays = r200_fallback_DrawArrays;
- vfmt->DrawElements = r200_fallback_DrawElements;
- vfmt->DrawRangeElements = r200_fallback_DrawRangeElements;
-
-
- /* Not active in supported states; just keep ctx->Current uptodate:
- */
- vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
- vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
- vfmt->Indexf = _mesa_noop_Indexf;
- vfmt->Indexfv = _mesa_noop_Indexfv;
-
-
- /* Active but unsupported -- fallback if we receive these:
- */
- vfmt->CallList = r200_fallback_CallList;
- vfmt->CallLists = r200_fallback_CallLists;
- vfmt->EvalCoord1f = r200_fallback_EvalCoord1f;
- vfmt->EvalCoord1fv = r200_fallback_EvalCoord1fv;
- vfmt->EvalCoord2f = r200_fallback_EvalCoord2f;
- vfmt->EvalCoord2fv = r200_fallback_EvalCoord2fv;
- vfmt->EvalMesh1 = r200_fallback_EvalMesh1;
- vfmt->EvalMesh2 = r200_fallback_EvalMesh2;
- vfmt->EvalPoint1 = r200_fallback_EvalPoint1;
- vfmt->EvalPoint2 = r200_fallback_EvalPoint2;
- vfmt->TexCoord4f = r200_fallback_TexCoord4f;
- vfmt->TexCoord4fv = r200_fallback_TexCoord4fv;
- vfmt->MultiTexCoord4fARB = r200_fallback_MultiTexCoord4fARB;
- vfmt->MultiTexCoord4fvARB = r200_fallback_MultiTexCoord4fvARB;
- vfmt->Vertex4f = r200_fallback_Vertex4f;
- vfmt->Vertex4fv = r200_fallback_Vertex4fv;
- vfmt->VertexAttrib1fNV = r200_fallback_VertexAttrib1fNV;
- vfmt->VertexAttrib1fvNV = r200_fallback_VertexAttrib1fvNV;
- vfmt->VertexAttrib2fNV = r200_fallback_VertexAttrib2fNV;
- vfmt->VertexAttrib2fvNV = r200_fallback_VertexAttrib2fvNV;
- vfmt->VertexAttrib3fNV = r200_fallback_VertexAttrib3fNV;
- vfmt->VertexAttrib3fvNV = r200_fallback_VertexAttrib3fvNV;
- vfmt->VertexAttrib4fNV = r200_fallback_VertexAttrib4fNV;
- vfmt->VertexAttrib4fvNV = r200_fallback_VertexAttrib4fvNV;
- vfmt->FogCoordfEXT = r200_fallback_FogCoordfEXT;
- vfmt->FogCoordfvEXT = r200_fallback_FogCoordfvEXT;
-
- (void)r200_fallback_vtxfmt;
-
- TNL_CONTEXT(ctx)->Driver.NotifyBegin = r200NotifyBegin;
-
- rmesa->vb.enabled = 1;
- rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
- rmesa->vb.primflags = 0;
-
- make_empty_list( &rmesa->vb.dfn_cache.Vertex2f );
- make_empty_list( &rmesa->vb.dfn_cache.Vertex2fv );
- make_empty_list( &rmesa->vb.dfn_cache.Vertex3f );
- make_empty_list( &rmesa->vb.dfn_cache.Vertex3fv );
- make_empty_list( &rmesa->vb.dfn_cache.Color4ub );
- make_empty_list( &rmesa->vb.dfn_cache.Color4ubv );
- make_empty_list( &rmesa->vb.dfn_cache.Color3ub );
- make_empty_list( &rmesa->vb.dfn_cache.Color3ubv );
- make_empty_list( &rmesa->vb.dfn_cache.Color4f );
- make_empty_list( &rmesa->vb.dfn_cache.Color4fv );
- make_empty_list( &rmesa->vb.dfn_cache.Color3f );
- make_empty_list( &rmesa->vb.dfn_cache.Color3fv );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
- make_empty_list( &rmesa->vb.dfn_cache.Normal3f );
- make_empty_list( &rmesa->vb.dfn_cache.Normal3fv );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord3f );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord3fv );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord2f );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord2fv );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord1f );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord1fv );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord3fARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord3fvARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
-/* make_empty_list( &rmesa->vb.dfn_cache.FogCoordfEXT );
- make_empty_list( &rmesa->vb.dfn_cache.FogCoordfvEXT );*/
-
- r200InitCodegen( &rmesa->vb.codegen, useCodegen );
-}
-
-static void free_funcs( struct dynfn *l )
-{
- struct dynfn *f, *tmp;
- foreach_s (f, tmp, l) {
- remove_from_list( f );
- _mesa_exec_free( f->code );
- _mesa_free( f );
- }
-}
-
-void r200VtxfmtUnbindContext( GLcontext *ctx )
-{
-}
-
-
-void r200VtxfmtMakeCurrent( GLcontext *ctx )
-{
-}
-
-
-void r200VtxfmtDestroy( GLcontext *ctx )
-{
- r200ContextPtr rmesa = R200_CONTEXT( ctx );
-
- count_funcs( rmesa );
- free_funcs( &rmesa->vb.dfn_cache.Vertex2f );
- free_funcs( &rmesa->vb.dfn_cache.Vertex2fv );
- free_funcs( &rmesa->vb.dfn_cache.Vertex3f );
- free_funcs( &rmesa->vb.dfn_cache.Vertex3fv );
- free_funcs( &rmesa->vb.dfn_cache.Color4ub );
- free_funcs( &rmesa->vb.dfn_cache.Color4ubv );
- free_funcs( &rmesa->vb.dfn_cache.Color3ub );
- free_funcs( &rmesa->vb.dfn_cache.Color3ubv );
- free_funcs( &rmesa->vb.dfn_cache.Color4f );
- free_funcs( &rmesa->vb.dfn_cache.Color4fv );
- free_funcs( &rmesa->vb.dfn_cache.Color3f );
- free_funcs( &rmesa->vb.dfn_cache.Color3fv );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
- free_funcs( &rmesa->vb.dfn_cache.Normal3f );
- free_funcs( &rmesa->vb.dfn_cache.Normal3fv );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord3f );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord3fv );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord2f );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord2fv );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord1f );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord1fv );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord3fARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord3fvARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
-/* free_funcs( &rmesa->vb.dfn_cache.FogCoordfEXT );
- free_funcs( &rmesa->vb.dfn_cache.FogCoordfvEXT );*/
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.h
deleted file mode 100644
index c347dcfb2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_VTXFMT_H__
-#define __R200_VTXFMT_H__
-
-#include "r200_context.h"
-
-
-
-extern void r200VtxfmtUpdate( GLcontext *ctx );
-extern void r200VtxfmtInit( GLcontext *ctx, GLboolean useCodegen );
-extern void r200VtxfmtInvalidate( GLcontext *ctx );
-extern void r200VtxfmtDestroy( GLcontext *ctx );
-extern void r200VtxfmtInitChoosers( GLvertexformat *vfmt );
-
-extern void r200VtxfmtMakeCurrent( GLcontext *ctx );
-extern void r200VtxfmtUnbindContext( GLcontext *ctx );
-
-extern void r200_copy_to_current( GLcontext *ctx );
-extern void VFMT_FALLBACK( const char *caller );
-
-#define DFN( FUNC, CACHE) \
-do { \
- char *start = (char *)&FUNC; \
- char *end = (char *)&FUNC##_end; \
- insert_at_head( &CACHE, dfn ); \
- dfn->key[0] = key[0]; \
- dfn->key[1] = key[1]; \
- dfn->code = _mesa_exec_malloc(end - start); \
- _mesa_memcpy(dfn->code, start, end - start); \
-} \
-while ( 0 )
-
-#define FIXUP( CODE, OFFSET, CHECKVAL, NEWVAL ) \
-do { \
- int *icode = (int *)(CODE+OFFSET); \
- assert (*icode == CHECKVAL); \
- *icode = (int)NEWVAL; \
-} while (0)
-
-
-/* Useful for figuring out the offsets:
- */
-#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \
-do { \
- while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \
- /*fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__,*/ \
- /* __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL));*/ \
- *(int *)(CODE+OFFSET) = (int)(NEWVAL); \
- OFFSET += 4; \
-} while (0)
-
-/*
- */
-void r200InitCodegen( struct dfn_generators *gen, GLboolean useCodegen );
-void r200InitX86Codegen( struct dfn_generators *gen );
-void r200InitSSECodegen( struct dfn_generators *gen );
-
-
-
-/* Defined in r200_vtxfmt_x86.c
- */
-struct dynfn *r200_makeX86Vertex2f( GLcontext *, const int * );
-struct dynfn *r200_makeX86Vertex2fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86Vertex3f( GLcontext *, const int * );
-struct dynfn *r200_makeX86Vertex3fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color4ub( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color4ubv( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color3ub( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color3ubv( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color4f( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color4fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color3f( GLcontext *, const int * );
-struct dynfn *r200_makeX86Color3fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86SecondaryColor3ubEXT( GLcontext *, const int * );
-struct dynfn *r200_makeX86SecondaryColor3ubvEXT( GLcontext *, const int * );
-struct dynfn *r200_makeX86SecondaryColor3fEXT( GLcontext *, const int * );
-struct dynfn *r200_makeX86SecondaryColor3fvEXT( GLcontext *, const int * );
-struct dynfn *r200_makeX86Normal3f( GLcontext *, const int * );
-struct dynfn *r200_makeX86Normal3fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86TexCoord2f( GLcontext *, const int * );
-struct dynfn *r200_makeX86TexCoord2fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86TexCoord1f( GLcontext *, const int * );
-struct dynfn *r200_makeX86TexCoord1fv( GLcontext *, const int * );
-struct dynfn *r200_makeX86MultiTexCoord2fARB( GLcontext *, const int * );
-struct dynfn *r200_makeX86MultiTexCoord2fvARB( GLcontext *, const int * );
-struct dynfn *r200_makeX86MultiTexCoord1fARB( GLcontext *, const int * );
-struct dynfn *r200_makeX86MultiTexCoord1fvARB( GLcontext *, const int * );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_c.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_c.c
deleted file mode 100644
index 1db5950c8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_c.c
+++ /dev/null
@@ -1,1002 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c,v 1.2 2002/12/16 16:18:56 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "simple_list.h"
-#include "api_noop.h"
-#include "vtxfmt.h"
-
-#include "r200_vtxfmt.h"
-#include "r200_tcl.h"
-
-#include "dispatch.h"
-
-/* Fallback versions of all the entrypoints for situations where
- * codegen isn't available. This is still a lot faster than the
- * vb/pipeline implementation in Mesa.
- */
-static void r200_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&x;
- *rmesa->vb.dmaptr++ = *(int *)&y;
- *rmesa->vb.dmaptr++ = *(int *)&z;
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-static void r200_Vertex3fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&v[0];
- *rmesa->vb.dmaptr++ = *(int *)&v[1];
- *rmesa->vb.dmaptr++ = *(int *)&v[2];
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-static void r200_Vertex2f( GLfloat x, GLfloat y )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&x;
- *rmesa->vb.dmaptr++ = *(int *)&y;
- *rmesa->vb.dmaptr++ = 0;
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-static void r200_Vertex2fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&v[0];
- *rmesa->vb.dmaptr++ = *(int *)&v[1];
- *rmesa->vb.dmaptr++ = 0;
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-
-/* Color for ubyte (packed) color formats:
- */
-#if 0
-static void r200_Color3ub_ub( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- dest->red = r;
- dest->green = g;
- dest->blue = b;
- dest->alpha = 0xff;
-}
-
-static void r200_Color3ubv_ub( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- dest->red = v[0];
- dest->green = v[1];
- dest->blue = v[2];
- dest->alpha = 0xff;
-}
-
-static void r200_Color4ub_ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- dest->red = r;
- dest->green = g;
- dest->blue = b;
- dest->alpha = a;
-}
-
-static void r200_Color4ubv_ub( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- *(GLuint *)rmesa->vb.colorptr = LE32_TO_CPU(*(GLuint *)v);
-}
-#endif /* 0 */
-
-static void r200_Color3f_ub( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
- dest->alpha = 255;
-}
-
-static void r200_Color3fv_ub( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
- dest->alpha = 255;
-}
-
-static void r200_Color4f_ub( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, a );
-}
-
-static void r200_Color4fv_ub( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, v[3] );
-}
-
-
-/* Color for float color+alpha formats:
- */
-#if 0
-static void r200_Color3ub_4f( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- dest[3] = 1.0;
-}
-
-static void r200_Color3ubv_4f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- dest[3] = 1.0;
-}
-
-static void r200_Color4ub_4f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- dest[3] = UBYTE_TO_FLOAT(a);
-}
-
-static void r200_Color4ubv_4f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- dest[3] = UBYTE_TO_FLOAT(v[3]);
-}
-#endif /* 0 */
-
-
-static void r200_Color3f_4f( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- dest[3] = 1.0;
-}
-
-static void r200_Color3fv_4f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- dest[3] = 1.0;
-}
-
-static void r200_Color4f_4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- dest[3] = a;
-}
-
-static void r200_Color4fv_4f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- dest[3] = v[3];
-}
-
-
-/* Color for float color formats:
- */
-#if 0
-static void r200_Color3ub_3f( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
-}
-
-static void r200_Color3ubv_3f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
-}
-
-static void r200_Color4ub_3f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(a);
-}
-
-static void r200_Color4ubv_3f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(v[3]);
-}
-#endif /* 0 */
-
-
-static void r200_Color3f_3f( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
-}
-
-static void r200_Color3fv_3f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
-}
-
-static void r200_Color4f_3f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = a;
-}
-
-static void r200_Color4fv_3f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = v[3];
-}
-
-
-/* Secondary Color:
- */
-#if 0
-static void r200_SecondaryColor3ubEXT_ub( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.specptr;
- dest->red = r;
- dest->green = g;
- dest->blue = b;
- dest->alpha = 0xff;
-}
-
-static void r200_SecondaryColor3ubvEXT_ub( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.specptr;
- dest->red = v[0];
- dest->green = v[1];
- dest->blue = v[2];
- dest->alpha = 0xff;
-}
-#endif /* 0 */
-
-static void r200_SecondaryColor3fEXT_ub( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.specptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
- dest->alpha = 255;
-}
-
-static void r200_SecondaryColor3fvEXT_ub( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- r200_color_t *dest = rmesa->vb.specptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
- dest->alpha = 255;
-}
-
-#if 0
-static void r200_SecondaryColor3ubEXT_3f( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- dest[3] = 1.0;
-}
-
-static void r200_SecondaryColor3ubvEXT_3f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- dest[3] = 1.0;
-}
-#endif /* 0 */
-
-static void r200_SecondaryColor3fEXT_3f( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- dest[3] = 1.0;
-}
-
-static void r200_SecondaryColor3fvEXT_3f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- dest[3] = 1.0;
-}
-
-
-
-/* Normal
- */
-static void r200_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.normalptr;
- dest[0] = n0;
- dest[1] = n1;
- dest[2] = n2;
-}
-
-static void r200_Normal3fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.normalptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
-}
-
-
-/* FogCoord
- */
-static void r200_FogCoordfEXT( GLfloat f )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.fogptr;
- dest[0] = r200ComputeFogBlendFactor( ctx, f );
-/* ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = f;*/
-}
-
-static void r200_FogCoordfvEXT( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.fogptr;
- dest[0] = r200ComputeFogBlendFactor( ctx, v[0] );
-/* ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = v[0];*/
-}
-
-
-/* TexCoord
- */
-
-/* \todo maybe (target & 4 ? target & 5 : target & 3) is more save than (target & 7) */
-static void r200_MultiTexCoord1fARB(GLenum target, GLfloat s)
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint unit = (target & 7);
- GLfloat * const dest = rmesa->vb.texcoordptr[unit];
-
- switch( ctx->Texture.Unit[unit]._ReallyEnabled ) {
- case TEXTURE_CUBE_BIT:
- case TEXTURE_3D_BIT:
- dest[2] = 0.0;
- /* FALLTHROUGH */
- case TEXTURE_2D_BIT:
- case TEXTURE_RECT_BIT:
- dest[1] = 0.0;
- /* FALLTHROUGH */
- case TEXTURE_1D_BIT:
- dest[0] = s;
- }
-}
-
-static void r200_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint unit = (target & 7);
- GLfloat * const dest = rmesa->vb.texcoordptr[unit];
-
- switch( ctx->Texture.Unit[unit]._ReallyEnabled ) {
- case TEXTURE_CUBE_BIT:
- case TEXTURE_3D_BIT:
- dest[2] = 0.0;
- /* FALLTHROUGH */
- case TEXTURE_2D_BIT:
- case TEXTURE_RECT_BIT:
- dest[1] = t;
- dest[0] = s;
- break;
- default:
- VFMT_FALLBACK(__FUNCTION__);
- CALL_MultiTexCoord2fARB(GET_DISPATCH(), (target, s, t));
- return;
- }
-}
-
-static void r200_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLint unit = (target & 7);
- GLfloat * const dest = rmesa->vb.texcoordptr[unit];
-
- switch( ctx->Texture.Unit[unit]._ReallyEnabled ) {
- case TEXTURE_CUBE_BIT:
- case TEXTURE_3D_BIT:
- dest[2] = r;
- dest[1] = t;
- dest[0] = s;
- break;
- default:
- VFMT_FALLBACK(__FUNCTION__);
- CALL_MultiTexCoord3fARB(GET_DISPATCH(), (target, s, t, r));
- return;
- }
-}
-
-static void r200_TexCoord1f(GLfloat s)
-{
- r200_MultiTexCoord1fARB(GL_TEXTURE0, s);
-}
-
-static void r200_TexCoord2f(GLfloat s, GLfloat t)
-{
- r200_MultiTexCoord2fARB(GL_TEXTURE0, s, t);
-}
-
-static void r200_TexCoord3f(GLfloat s, GLfloat t, GLfloat r)
-{
- r200_MultiTexCoord3fARB(GL_TEXTURE0, s, t, r);
-}
-
-static void r200_TexCoord1fv(const GLfloat *v)
-{
- r200_MultiTexCoord1fARB(GL_TEXTURE0, v[0]);
-}
-
-static void r200_TexCoord2fv(const GLfloat *v)
-{
- r200_MultiTexCoord2fARB(GL_TEXTURE0, v[0], v[1]);
-}
-
-static void r200_TexCoord3fv(const GLfloat *v)
-{
- r200_MultiTexCoord3fARB(GL_TEXTURE0, v[0], v[1], v[2]);
-}
-
-static void r200_MultiTexCoord1fvARB(GLenum target, const GLfloat *v)
-{
- r200_MultiTexCoord1fARB(target, v[0]);
-}
-
-static void r200_MultiTexCoord2fvARB(GLenum target, const GLfloat *v)
-{
- r200_MultiTexCoord2fARB(target, v[0], v[1]);
-}
-
-static void r200_MultiTexCoord3fvARB(GLenum target, const GLfloat *v)
-{
- r200_MultiTexCoord3fARB(target, v[0], v[1], v[2]);
-}
-
-
-static struct dynfn *lookup( struct dynfn *l, const int *key )
-{
- struct dynfn *f;
-
- foreach( f, l ) {
- if (f->key[0] == key[0] && f->key[1] == key[1])
- return f;
- }
-
- return NULL;
-}
-
-/* Can't use the loopback template for this:
- */
-
-#define CHOOSE(FN, FNTYPE, MASK0, MASK1, ARGS1, ARGS2 ) \
-static void choose_##FN ARGS1 \
-{ \
- GET_CURRENT_CONTEXT(ctx); \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- int key[2]; \
- struct dynfn *dfn; \
- \
- key[0] = rmesa->vb.vtxfmt_0 & MASK0; \
- key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
- \
- dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
- if (dfn == 0) \
- dfn = rmesa->vb.codegen.FN( ctx, key ); \
- else if (R200_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
- \
- if (dfn) \
- SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
- else { \
- if (R200_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- SET_ ## FN (ctx->Exec, r200_##FN); \
- } \
- \
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- CALL_ ## FN (ctx->Exec, ARGS2); \
-}
-
-
-
-/* For the _3f case, only allow one color function to be hooked in at
- * a time. Eventually, use a similar mechanism to allow selecting the
- * color component of the vertex format based on client behaviour.
- *
- * Note: Perform these actions even if there is a codegen or cached
- * codegen version of the chosen function.
- */
-#define CHOOSE_COLOR(FN, FNTYPE, NR, MASK0, MASK1, ARGS1, ARGS2 ) \
-static void choose_##FN ARGS1 \
-{ \
- GET_CURRENT_CONTEXT(ctx); \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- int key[2]; \
- struct dynfn *dfn; \
- \
- key[0] = rmesa->vb.vtxfmt_0 & MASK0; \
- key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
- \
- if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \
- SET_ ## FN (ctx->Exec, r200_##FN##_ub); \
- } \
- else if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_FP_RGB) { \
- \
- if (rmesa->vb.installed_color_3f_sz != NR) { \
- rmesa->vb.installed_color_3f_sz = NR; \
- if (NR == 3) ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = 1.0; \
- if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
- r200_copy_to_current( ctx ); \
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
- CALL_ ## FN (ctx->Exec, ARGS2); \
- return; \
- } \
- } \
- \
- SET_ ## FN (ctx->Exec, r200_##FN##_3f); \
- } \
- else { \
- SET_ ## FN (ctx->Exec, r200_##FN##_4f); \
- } \
- \
- \
- dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
- if (!dfn) dfn = rmesa->vb.codegen.FN( ctx, key ); \
- \
- if (dfn) { \
- if (R200_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
- SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \
- } \
- else if (R200_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
- \
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- CALL_ ## FN (ctx->Exec, ARGS2); \
-}
-
-
-
-/* Right now there are both _ub and _3f versions of the secondary color
- * functions. Currently, we only set-up the hardware to use the _ub versions.
- * The _3f versions are needed for the cases where secondary color isn't used
- * in the vertex format, but it still needs to be stored in the context
- * state vector.
- */
-#define CHOOSE_SECONDARY_COLOR(FN, FNTYPE, MASK0, MASK1, ARGS1, ARGS2 ) \
-static void choose_##FN ARGS1 \
-{ \
- GET_CURRENT_CONTEXT(ctx); \
- r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- int key[2]; \
- struct dynfn *dfn; \
- \
- key[0] = rmesa->vb.vtxfmt_0 & MASK0; \
- key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
- \
- dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
- if (dfn == 0) \
- dfn = rmesa->vb.codegen.FN( ctx, key ); \
- else if (R200_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
- \
- if (dfn) \
- SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
- else { \
- if (R200_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- SET_ ## FN (ctx->Exec, (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \
- ? r200_##FN##_ub : r200_##FN##_3f); \
- } \
- \
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- CALL_ ## FN (ctx->Exec, ARGS2); \
-}
-
-
-
-
-
-
-
-/* VTXFMT_0
- */
-#define MASK_XYZW (R200_VTX_W0|R200_VTX_Z0)
-#define MASK_NORM (MASK_XYZW|R200_VTX_N0)
-#define MASK_FOG (MASK_NORM |R200_VTX_DISCRETE_FOG)
-#define MASK_COLOR (MASK_FOG |(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_0_SHIFT))
-#define MASK_SPEC (MASK_COLOR|(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_1_SHIFT))
-
-/* VTXFMT_1
- */
-#define MASK_ST0 (0x7 << R200_VTX_TEX0_COMP_CNT_SHIFT)
-/* FIXME: maybe something like in the radeon driver is needed here? */
-
-
-typedef void (*p4f)( GLfloat, GLfloat, GLfloat, GLfloat );
-typedef void (*p3f)( GLfloat, GLfloat, GLfloat );
-typedef void (*p2f)( GLfloat, GLfloat );
-typedef void (*p1f)( GLfloat );
-typedef void (*pe3f)( GLenum, GLfloat, GLfloat, GLfloat );
-typedef void (*pe2f)( GLenum, GLfloat, GLfloat );
-typedef void (*pe1f)( GLenum, GLfloat );
-typedef void (*p4ub)( GLubyte, GLubyte, GLubyte, GLubyte );
-typedef void (*p3ub)( GLubyte, GLubyte, GLubyte );
-typedef void (*pfv)( const GLfloat * );
-typedef void (*pefv)( GLenum, const GLfloat * );
-typedef void (*pubv)( const GLubyte * );
-
-
-CHOOSE(Normal3f, p3f, MASK_NORM, 0,
- (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
-CHOOSE(Normal3fv, pfv, MASK_NORM, 0,
- (const GLfloat *v), (v))
-
-#if 0
-CHOOSE_COLOR(Color4ub, p4ub, 4, MASK_COLOR, 0,
- (GLubyte a,GLubyte b, GLubyte c, GLubyte d), (a,b,c,d))
-CHOOSE_COLOR(Color4ubv, pubv, 4, MASK_COLOR, 0,
- (const GLubyte *v), (v))
-CHOOSE_COLOR(Color3ub, p3ub, 3, MASK_COLOR, 0,
- (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
-CHOOSE_COLOR(Color3ubv, pubv, 3, MASK_COLOR, 0,
- (const GLubyte *v), (v))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3ubEXT, p3ub, MASK_SPEC, 0,
- (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3ubvEXT, pubv, MASK_SPEC, 0,
- (const GLubyte *v), (v))
-#endif
-
-CHOOSE_COLOR(Color4f, p4f, 4, MASK_COLOR, 0,
- (GLfloat a,GLfloat b, GLfloat c, GLfloat d), (a,b,c,d))
-CHOOSE_COLOR(Color4fv, pfv, 4, MASK_COLOR, 0,
- (const GLfloat *v), (v))
-CHOOSE_COLOR(Color3f, p3f, 3, MASK_COLOR, 0,
- (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
-CHOOSE_COLOR(Color3fv, pfv, 3, MASK_COLOR, 0,
- (const GLfloat *v), (v))
-
-
-CHOOSE_SECONDARY_COLOR(SecondaryColor3fEXT, p3f, MASK_SPEC, 0,
- (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3fvEXT, pfv, MASK_SPEC, 0,
- (const GLfloat *v), (v))
-
-CHOOSE(TexCoord3f, p3f, ~0, MASK_ST0,
- (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
-CHOOSE(TexCoord3fv, pfv, ~0, MASK_ST0,
- (const GLfloat *v), (v))
-CHOOSE(TexCoord2f, p2f, ~0, MASK_ST0,
- (GLfloat a,GLfloat b), (a,b))
-CHOOSE(TexCoord2fv, pfv, ~0, MASK_ST0,
- (const GLfloat *v), (v))
-CHOOSE(TexCoord1f, p1f, ~0, MASK_ST0,
- (GLfloat a), (a))
-CHOOSE(TexCoord1fv, pfv, ~0, MASK_ST0,
- (const GLfloat *v), (v))
-
-CHOOSE(MultiTexCoord3fARB, pe3f, ~0, ~0,
- (GLenum u,GLfloat a,GLfloat b,GLfloat c), (u,a,b,c))
-CHOOSE(MultiTexCoord3fvARB, pefv, ~0, ~0,
- (GLenum u,const GLfloat *v), (u,v))
-CHOOSE(MultiTexCoord2fARB, pe2f, ~0, ~0,
- (GLenum u,GLfloat a,GLfloat b), (u,a,b))
-CHOOSE(MultiTexCoord2fvARB, pefv, ~0, ~0,
- (GLenum u,const GLfloat *v), (u,v))
-CHOOSE(MultiTexCoord1fARB, pe1f, ~0, ~0,
- (GLenum u,GLfloat a), (u,a))
-CHOOSE(MultiTexCoord1fvARB, pefv, ~0, ~0,
- (GLenum u,const GLfloat *v), (u,v))
-
-CHOOSE(Vertex3f, p3f, ~0, ~0,
- (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
-CHOOSE(Vertex3fv, pfv, ~0, ~0,
- (const GLfloat *v), (v))
-CHOOSE(Vertex2f, p2f, ~0, ~0,
- (GLfloat a,GLfloat b), (a,b))
-CHOOSE(Vertex2fv, pfv, ~0, ~0,
- (const GLfloat *v), (v))
-
-CHOOSE(FogCoordfEXT, p1f, MASK_FOG, ~0,
- (GLfloat f), (f))
-CHOOSE(FogCoordfvEXT, pfv, MASK_FOG, ~0,
- (const GLfloat *f), (f))
-
-
-
-
-void r200VtxfmtInitChoosers( GLvertexformat *vfmt )
-{
- vfmt->Color3f = choose_Color3f;
- vfmt->Color3fv = choose_Color3fv;
- vfmt->Color4f = choose_Color4f;
- vfmt->Color4fv = choose_Color4fv;
- vfmt->SecondaryColor3fEXT = choose_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = choose_SecondaryColor3fvEXT;
- vfmt->MultiTexCoord1fARB = choose_MultiTexCoord1fARB;
- vfmt->MultiTexCoord1fvARB = choose_MultiTexCoord1fvARB;
- vfmt->MultiTexCoord2fARB = choose_MultiTexCoord2fARB;
- vfmt->MultiTexCoord2fvARB = choose_MultiTexCoord2fvARB;
- vfmt->MultiTexCoord3fARB = choose_MultiTexCoord3fARB;
- vfmt->MultiTexCoord3fvARB = choose_MultiTexCoord3fvARB;
- vfmt->Normal3f = choose_Normal3f;
- vfmt->Normal3fv = choose_Normal3fv;
- vfmt->TexCoord1f = choose_TexCoord1f;
- vfmt->TexCoord1fv = choose_TexCoord1fv;
- vfmt->TexCoord2f = choose_TexCoord2f;
- vfmt->TexCoord2fv = choose_TexCoord2fv;
- vfmt->TexCoord3f = choose_TexCoord3f;
- vfmt->TexCoord3fv = choose_TexCoord3fv;
- vfmt->Vertex2f = choose_Vertex2f;
- vfmt->Vertex2fv = choose_Vertex2fv;
- vfmt->Vertex3f = choose_Vertex3f;
- vfmt->Vertex3fv = choose_Vertex3fv;
-/* vfmt->FogCoordfEXT = choose_FogCoordfEXT;
- vfmt->FogCoordfvEXT = choose_FogCoordfvEXT;*/
-
- /* TODO: restore ubyte colors to vtxfmt.
- */
-#if 0
- vfmt->Color3ub = choose_Color3ub;
- vfmt->Color3ubv = choose_Color3ubv;
- vfmt->Color4ub = choose_Color4ub;
- vfmt->Color4ubv = choose_Color4ubv;
- vfmt->SecondaryColor3ubEXT = choose_SecondaryColor3ubEXT;
- vfmt->SecondaryColor3ubvEXT = choose_SecondaryColor3ubvEXT;
-#endif
-}
-
-
-static struct dynfn *codegen_noop( GLcontext *ctx, const int *key )
-{
- (void) ctx; (void) key;
- return NULL;
-}
-
-void r200InitCodegen( struct dfn_generators *gen, GLboolean useCodegen )
-{
- gen->Vertex3f = codegen_noop;
- gen->Vertex3fv = codegen_noop;
- gen->Color4ub = codegen_noop;
- gen->Color4ubv = codegen_noop;
- gen->Normal3f = codegen_noop;
- gen->Normal3fv = codegen_noop;
-
- gen->TexCoord3f = codegen_noop;
- gen->TexCoord3fv = codegen_noop;
- gen->TexCoord2f = codegen_noop;
- gen->TexCoord2fv = codegen_noop;
- gen->TexCoord1f = codegen_noop;
- gen->TexCoord1fv = codegen_noop;
-
- gen->MultiTexCoord3fARB = codegen_noop;
- gen->MultiTexCoord3fvARB = codegen_noop;
- gen->MultiTexCoord2fARB = codegen_noop;
- gen->MultiTexCoord2fvARB = codegen_noop;
- gen->MultiTexCoord1fARB = codegen_noop;
- gen->MultiTexCoord1fvARB = codegen_noop;
-/* gen->FogCoordfEXT = codegen_noop;
- gen->FogCoordfvEXT = codegen_noop;*/
-
- gen->Vertex2f = codegen_noop;
- gen->Vertex2fv = codegen_noop;
- gen->Color3ub = codegen_noop;
- gen->Color3ubv = codegen_noop;
- gen->Color4f = codegen_noop;
- gen->Color4fv = codegen_noop;
- gen->Color3f = codegen_noop;
- gen->Color3fv = codegen_noop;
- gen->SecondaryColor3fEXT = codegen_noop;
- gen->SecondaryColor3fvEXT = codegen_noop;
- gen->SecondaryColor3ubEXT = codegen_noop;
- gen->SecondaryColor3ubvEXT = codegen_noop;
-
- if (useCodegen) {
-#if defined(USE_X86_ASM)
- r200InitX86Codegen( gen );
-#endif
-
-#if defined(USE_SSE_ASM)
- r200InitSSECodegen( gen );
-#endif
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_sse.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_sse.c
deleted file mode 100644
index 590173049..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_sse.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c,v 1.1 2002/10/30 12:51:53 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "r200_vtxfmt.h"
-
-#if defined(USE_SSE_ASM)
-#include "x86/common_x86_asm.h"
-
-#define EXTERN( FUNC ) \
-extern const char *FUNC; \
-extern const char *FUNC##_end
-
-EXTERN( _sse_Attribute2fv );
-EXTERN( _sse_Attribute2f );
-EXTERN( _sse_Attribute3fv );
-EXTERN( _sse_Attribute3f );
-EXTERN( _sse_MultiTexCoord2fv );
-EXTERN( _sse_MultiTexCoord2f );
-EXTERN( _sse_MultiTexCoord2fv_2 );
-EXTERN( _sse_MultiTexCoord2f_2 );
-
-/* Build specialized versions of the immediate calls on the fly for
- * the current state.
- */
-
-static struct dynfn *r200_makeSSEAttribute2fv( struct dynfn * cache, const int * key,
- const char * name, void * dest)
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _sse_Attribute2fv, (*cache) );
- FIXUP(dfn->code, 10, 0x0, (int)dest);
- return dfn;
-}
-
-static struct dynfn *r200_makeSSEAttribute2f( struct dynfn * cache, const int * key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _sse_Attribute2f, (*cache) );
- FIXUP(dfn->code, 8, 0x0, (int)dest);
- return dfn;
-}
-
-static struct dynfn *r200_makeSSEAttribute3fv( struct dynfn * cache, const int * key,
- const char * name, void * dest)
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _sse_Attribute3fv, (*cache) );
- FIXUP(dfn->code, 13, 0x0, (int)dest);
- FIXUP(dfn->code, 18, 0x8, 8+(int)dest);
- return dfn;
-}
-
-static struct dynfn *r200_makeSSEAttribute3f( struct dynfn * cache, const int * key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _sse_Attribute3f, (*cache) );
- FIXUP(dfn->code, 12, 0x0, (int)dest);
- FIXUP(dfn->code, 17, 0x8, 8+(int)dest);
- return dfn;
-}
-
-static struct dynfn *r200_makeSSENormal3fv( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-static struct dynfn *r200_makeSSENormal3f( GLcontext *ctx, const int * key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Normal3f, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-static struct dynfn *r200_makeSSEColor3fv( GLcontext *ctx, const int * key )
-{
- if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB)
- return NULL;
- else
- {
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Color3fv, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-static struct dynfn *r200_makeSSEColor3f( GLcontext *ctx, const int * key )
-{
- if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB)
- return NULL;
- else
- {
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Color3f, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-#if 0 /* Temporarily disabled as it is broken w/the new cubemap code. - idr */
-static struct dynfn *r200_makeSSETexCoord2fv( GLcontext *ctx, const int * key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeSSEAttribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-static struct dynfn *r200_makeSSETexCoord2f( GLcontext *ctx, const int * key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeSSEAttribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-static struct dynfn *r200_makeSSEMultiTexCoord2fv( GLcontext *ctx, const int * key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
-
- if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) {
- DFN ( _sse_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 18, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- } else {
- DFN ( _sse_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-
-static struct dynfn *r200_makeSSEMultiTexCoord2f( GLcontext *ctx, const int * key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
-
- if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) {
- DFN ( _sse_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 16, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- } else {
- DFN ( _sse_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 15, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-#endif
-
-void r200InitSSECodegen( struct dfn_generators *gen )
-{
- if ( cpu_has_xmm ) {
- gen->Normal3fv = (void *) r200_makeSSENormal3fv;
- gen->Normal3f = (void *) r200_makeSSENormal3f;
- gen->Color3fv = (void *) r200_makeSSEColor3fv;
- gen->Color3f = (void *) r200_makeSSEColor3f;
-#if 0 /* Temporarily disabled as it is broken w/the new cubemap code. - idr */
- gen->TexCoord2fv = (void *) r200_makeSSETexCoord2fv;
- gen->TexCoord2f = (void *) r200_makeSSETexCoord2f;
- gen->MultiTexCoord2fvARB = (void *) r200_makeSSEMultiTexCoord2fv;
- gen->MultiTexCoord2fARB = (void *) r200_makeSSEMultiTexCoord2f;
-#endif
- }
-}
-
-#else
-
-void r200InitSSECodegen( struct dfn_generators *gen )
-{
- (void) gen;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_x86.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_x86.c
deleted file mode 100644
index b78a55c31..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxfmt_x86.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c,v 1.2 2002/12/16 16:18:56 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "r200_vtxfmt.h"
-
-#if defined(USE_X86_ASM)
-
-#define EXTERN( FUNC ) \
-extern const char *FUNC; \
-extern const char *FUNC##_end
-
-EXTERN ( _x86_Attribute2fv );
-EXTERN ( _x86_Attribute2f );
-EXTERN ( _x86_Attribute3fv );
-EXTERN ( _x86_Attribute3f );
-EXTERN ( _x86_Vertex3fv_6 );
-EXTERN ( _x86_Vertex3fv_8 );
-EXTERN ( _x86_Vertex3fv );
-EXTERN ( _x86_Vertex3f_4 );
-EXTERN ( _x86_Vertex3f_6 );
-EXTERN ( _x86_Vertex3f );
-EXTERN ( _x86_Color4ubv_ub );
-EXTERN ( _x86_Color4ubv_4f );
-EXTERN ( _x86_Color4ub_ub );
-EXTERN ( _x86_MultiTexCoord2fv );
-EXTERN ( _x86_MultiTexCoord2fv_2 );
-EXTERN ( _x86_MultiTexCoord2f );
-EXTERN ( _x86_MultiTexCoord2f_2 );
-
-
-/* Build specialized versions of the immediate calls on the fly for
- * the current state. Generic x86 versions.
- */
-
-struct dynfn *r200_makeX86Vertex3f( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x 0x%08x %d\n", __FUNCTION__,
- key[0], key[1], rmesa->vb.vertex_size );
-
- switch (rmesa->vb.vertex_size) {
- case 4: {
-
- DFN ( _x86_Vertex3f_4, rmesa->vb.dfn_cache.Vertex3f );
- FIXUP(dfn->code, 2, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 25, 0x0, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 36, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 46, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 51, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 60, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- case 6: {
-
- DFN ( _x86_Vertex3f_6, rmesa->vb.dfn_cache.Vertex3f );
- FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 28, 0x0, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 34, 0x0, (int)&rmesa->vb.vertex[4]);
- FIXUP(dfn->code, 40, 0x0, (int)&rmesa->vb.vertex[5]);
- FIXUP(dfn->code, 57, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 63, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 70, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 79, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- default: {
-
- DFN ( _x86_Vertex3f, rmesa->vb.dfn_cache.Vertex3f );
- FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 9, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 37, 0x0, rmesa->vb.vertex_size-3);
- FIXUP(dfn->code, 44, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 50, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 56, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- }
-
- return dfn;
-}
-
-
-
-struct dynfn *r200_makeX86Vertex3fv( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x 0x%08x %d\n", __FUNCTION__,
- key[0], key[1], rmesa->vb.vertex_size );
-
- switch (rmesa->vb.vertex_size) {
- case 6: {
-
- DFN ( _x86_Vertex3fv_6, rmesa->vb.dfn_cache.Vertex3fv );
- FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]);
- FIXUP(dfn->code, 45, 0x00000024, (int)&rmesa->vb.vertex[5]);
- FIXUP(dfn->code, 56, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 61, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 67, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 76, 0x00000008, (int)&rmesa->vb.notify);
- break;
- }
-
-
- case 8: {
-
- DFN ( _x86_Vertex3fv_8, rmesa->vb.dfn_cache.Vertex3fv );
- FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]);
- FIXUP(dfn->code, 45, 0x0000001c, (int)&rmesa->vb.vertex[5]);
- FIXUP(dfn->code, 51, 0x00000020, (int)&rmesa->vb.vertex[6]);
- FIXUP(dfn->code, 63, 0x00000024, (int)&rmesa->vb.vertex[7]);
- FIXUP(dfn->code, 74, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 79, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 85, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 94, 0x00000008, (int)&rmesa->vb.notify);
- break;
- }
-
-
-
- default: {
-
- DFN ( _x86_Vertex3fv, rmesa->vb.dfn_cache.Vertex3fv );
- FIXUP(dfn->code, 8, 0x01010101, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 32, 0x00000006, rmesa->vb.vertex_size-3);
- FIXUP(dfn->code, 37, 0x00000058, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 45, 0x01010101, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 50, 0x02020202, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 58, 0x02020202, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- }
-
- return dfn;
-}
-
-static struct dynfn *
-r200_makeX86Attribute2fv( struct dynfn * cache, const int *key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _x86_Attribute2fv, (*cache) );
- FIXUP(dfn->code, 11, 0x0, (int)dest);
- FIXUP(dfn->code, 16, 0x4, 4+(int)dest);
-
- return dfn;
-}
-
-static struct dynfn *
-r200_makeX86Attribute2f( struct dynfn * cache, const int *key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _x86_Attribute2f, (*cache) );
- FIXUP(dfn->code, 1, 0x0, (int)dest);
-
- return dfn;
-}
-
-
-static struct dynfn *
-r200_makeX86Attribute3fv( struct dynfn * cache, const int *key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _x86_Attribute3fv, (*cache) );
- FIXUP(dfn->code, 14, 0x0, (int)dest);
- FIXUP(dfn->code, 20, 0x4, 4+(int)dest);
- FIXUP(dfn->code, 25, 0x8, 8+(int)dest);
-
- return dfn;
-}
-
-static struct dynfn *
-r200_makeX86Attribute3f( struct dynfn * cache, const int *key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key[0] );
-
- DFN ( _x86_Attribute3f, (*cache) );
- FIXUP(dfn->code, 14, 0x0, (int)dest);
- FIXUP(dfn->code, 20, 0x4, 4+(int)dest);
- FIXUP(dfn->code, 25, 0x8, 8+(int)dest);
-
- return dfn;
-}
-
-struct dynfn *r200_makeX86Normal3fv( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-struct dynfn *r200_makeX86Normal3f( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeX86Attribute3f( & rmesa->vb.dfn_cache.Normal3f, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-struct dynfn *r200_makeX86Color4ubv( GLcontext *ctx, const int *key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
-
- if (VTX_COLOR(key[0],0) == R200_VTX_PK_RGBA) {
- DFN ( _x86_Color4ubv_ub, rmesa->vb.dfn_cache.Color4ubv);
- FIXUP(dfn->code, 5, 0x12345678, (int)rmesa->vb.colorptr);
- return dfn;
- }
- else {
-
- DFN ( _x86_Color4ubv_4f, rmesa->vb.dfn_cache.Color4ubv);
- FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab);
- FIXUP(dfn->code, 27, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr);
- FIXUP(dfn->code, 33, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+4);
- FIXUP(dfn->code, 55, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+8);
- FIXUP(dfn->code, 61, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+12);
- return dfn;
- }
-}
-
-struct dynfn *r200_makeX86Color4ub( GLcontext *ctx, const int *key )
-{
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] );
-
- if (VTX_COLOR(key[0],0) == R200_VTX_PK_RGBA) {
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- DFN ( _x86_Color4ub_ub, rmesa->vb.dfn_cache.Color4ub );
- FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.colorptr);
- FIXUP(dfn->code, 24, 0x0, (int)rmesa->vb.colorptr+1);
- FIXUP(dfn->code, 30, 0x0, (int)rmesa->vb.colorptr+2);
- FIXUP(dfn->code, 36, 0x0, (int)rmesa->vb.colorptr+3);
- return dfn;
- }
- else
- return NULL;
-}
-
-
-struct dynfn *r200_makeX86Color3fv( GLcontext *ctx, const int *key )
-{
- if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB)
- return NULL;
- else
- {
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Color3fv, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-struct dynfn *r200_makeX86Color3f( GLcontext *ctx, const int *key )
-{
- if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB)
- return NULL;
- else
- {
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeX86Attribute3f( & rmesa->vb.dfn_cache.Color3f, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-
-
-#if 0 /* Temporarily disabled as it is broken w/the new cubemap code. - idr */
-struct dynfn *r200_makeX86TexCoord2fv( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeX86Attribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-struct dynfn *r200_makeX86TexCoord2f( GLcontext *ctx, const int *key )
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- return r200_makeX86Attribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-struct dynfn *r200_makeX86MultiTexCoord2fvARB( GLcontext *ctx, const int *key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] );
-
- if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) {
- DFN ( _x86_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 21, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- FIXUP(dfn->code, 27, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4);
- } else {
- DFN ( _x86_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-
-struct dynfn *r200_makeX86MultiTexCoord2fARB( GLcontext *ctx,
- const int *key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- if (R200_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] );
-
- if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) {
- DFN ( _x86_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 20, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- FIXUP(dfn->code, 26, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4);
- }
- else {
- /* Note: this might get generated multiple times, even though the
- * actual emitted code is the same.
- */
- DFN ( _x86_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-#endif
-
-void r200InitX86Codegen( struct dfn_generators *gen )
-{
- gen->Vertex3f = r200_makeX86Vertex3f;
- gen->Vertex3fv = r200_makeX86Vertex3fv;
- gen->Color4ub = r200_makeX86Color4ub; /* PKCOLOR only */
- gen->Color4ubv = r200_makeX86Color4ubv; /* PKCOLOR only */
- gen->Normal3f = r200_makeX86Normal3f;
- gen->Normal3fv = r200_makeX86Normal3fv;
-#if 0 /* Temporarily disabled as it is broken w/the new cubemap code. - idr */
- gen->TexCoord2f = r200_makeX86TexCoord2f;
- gen->TexCoord2fv = r200_makeX86TexCoord2fv;
- gen->MultiTexCoord2fARB = r200_makeX86MultiTexCoord2fARB;
- gen->MultiTexCoord2fvARB = r200_makeX86MultiTexCoord2fvARB;
-#endif
- gen->Color3f = r200_makeX86Color3f;
- gen->Color3fv = r200_makeX86Color3fv;
-
- /* Not done:
- */
-/* gen->Vertex2f = r200_makeX86Vertex2f; */
-/* gen->Vertex2fv = r200_makeX86Vertex2fv; */
-/* gen->Color3ub = r200_makeX86Color3ub; */
-/* gen->Color3ubv = r200_makeX86Color3ubv; */
-/* gen->Color4f = r200_makeX86Color4f; */
-/* gen->Color4fv = r200_makeX86Color4fv; */
-/* gen->TexCoord1f = r200_makeX86TexCoord1f; */
-/* gen->TexCoord1fv = r200_makeX86TexCoord1fv; */
-/* gen->MultiTexCoord1fARB = r200_makeX86MultiTexCoord1fARB; */
-/* gen->MultiTexCoord1fvARB = r200_makeX86MultiTexCoord1fvARB; */
-}
-
-
-#else
-
-void r200InitX86Codegen( struct dfn_generators *gen )
-{
- (void) gen;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S
deleted file mode 100644
index 57a35c657..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S
+++ /dev/null
@@ -1,495 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S,v 1.2 2002/11/07 18:31:59 tsi Exp $ */
-/**************************************************************************
-
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#define GLOBL( x ) \
-.globl x; \
-x:
-
-.data
-.align 4
-
-/*
- vertex 3f vertex size 4
-*/
-
-GLOBL ( _x86_Vertex3f_4 )
- movl (0), %ecx
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl %eax, (%ecx)
- movl %edx, 4(%ecx)
- movl 12(%esp), %eax
- movl (0), %edx
- movl %eax, 8(%ecx)
- movl %edx, 12(%ecx)
- movl (0), %eax
- addl $16, %ecx
- dec %eax
- movl %ecx, (0)
- movl %eax, (0)
- je .1
- ret
-.1: jmp *0
-
-GLOBL ( _x86_Vertex3f_4_end )
-
-/*
- vertex 3f vertex size 6
-*/
-GLOBL ( _x86_Vertex3f_6 )
- push %edi
- movl (0), %edi
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- movl 16(%esp), %ecx
- movl %eax, (%edi)
- movl %edx, 4(%edi)
- movl %ecx, 8(%edi)
- movl (0), %eax
- movl (0), %edx
- movl (0), %ecx
- movl %eax, 12(%edi)
- movl %edx, 16(%edi)
- movl %ecx, 20(%edi)
- addl $24, %edi
- movl (0), %eax
- movl %edi, (0)
- dec %eax
- pop %edi
- movl %eax, (0)
- je .2
- ret
-.2: jmp *0
-GLOBL ( _x86_Vertex3f_6_end )
-/*
- vertex 3f generic size
-*/
-GLOBL ( _x86_Vertex3f )
- push %edi
- push %esi
- movl $0, %esi
- movl (0), %edi
- movl 12(%esp), %eax
- movl 16(%esp), %edx
- movl 20(%esp), %ecx
- movl %eax, (%edi)
- movl %edx, 4(%edi)
- movl %ecx, 8(%edi)
- addl $12, %edi
- movl $0, %ecx
- repz
- movsl %ds:(%esi), %es:(%edi)
- movl (0), %eax
- movl %edi, (0)
- dec %eax
- movl %eax, (0)
- pop %esi
- pop %edi
- je .3
- ret
-.3: jmp *0
-
-GLOBL ( _x86_Vertex3f_end )
-
-/*
- Vertex 3fv vertex size 6
-*/
-GLOBL ( _x86_Vertex3fv_6 )
- movl (0), %eax
- movl 4(%esp), %ecx
- movl (%ecx), %edx
- movl %edx, (%eax)
- movl 4(%ecx), %edx
- movl 8(%ecx), %ecx
- movl %edx, 4(%eax)
- movl %ecx, 8(%eax)
- movl (28), %edx
- movl (32), %ecx
- movl %edx, 12(%eax)
- movl %ecx, 16(%eax)
- movl (36), %edx
- movl %edx, 20(%eax)
- addl $24, %eax
- movl %eax, 0
- movl 4, %eax
- dec %eax
- movl %eax, 4
- je .4
- ret
-.4: jmp *8
-
-GLOBL ( _x86_Vertex3fv_6_end )
-
-/*
- Vertex 3fv vertex size 8
-*/
-GLOBL ( _x86_Vertex3fv_8 )
- movl (0), %eax
- movl 4(%esp), %ecx
- movl (%ecx), %edx
- movl %edx ,(%eax)
- movl 4(%ecx) ,%edx
- movl 8(%ecx) ,%ecx
- movl %edx, 4(%eax)
- movl %ecx, 8(%eax)
- movl (28), %edx
- movl (32), %ecx
- movl %edx, 12(%eax)
- movl %ecx, 16(%eax)
- movl (28), %edx
- movl (32), %ecx
- movl %edx, 20(%eax)
- movl %ecx, 24(%eax)
- movl (36), %edx
- movl %edx, 28(%eax)
- addl $32, %eax
- movl %eax, (0)
- movl 4, %eax
- dec %eax
- movl %eax, (4)
- je .5
- ret
-.5: jmp *8
-
-GLOBL ( _x86_Vertex3fv_8_end )
-
-/*
- Vertex 3fv generic vertex size
-*/
-GLOBL ( _x86_Vertex3fv )
- movl 4(%esp), %edx
- push %edi
- push %esi
- movl (0x1010101), %edi
- movl (%edx), %eax
- movl 4(%edx), %ecx
- movl 8(%edx), %esi
- movl %eax, (%edi)
- movl %ecx, 4(%edi)
- movl %esi, 8(%edi)
- addl $12, %edi
- movl $6, %ecx
- movl $0x58, %esi
- repz
- movsl %ds:(%esi), %es:(%edi)
- movl %edi, (0x1010101)
- movl (0x2020202), %eax
- pop %esi
- pop %edi
- dec %eax
- movl %eax, (0x2020202)
- je .6
- ret
-.6: jmp *0
-GLOBL ( _x86_Vertex3fv_end )
-
-
-/**
- * Generic handler for 2 float format data. This can be used for
- * TexCoord2f and possibly other functions.
- */
-
-GLOBL ( _x86_Attribute2f )
- movl $0x0, %edx
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- movl %eax, (%edx)
- movl %ecx, 4(%edx)
- ret
-GLOBL ( _x86_Attribute2f_end )
-
-
-/**
- * Generic handler for 2 float vector format data. This can be used for
- * TexCoord2fv and possibly other functions.
- */
-
-GLOBL( _x86_Attribute2fv)
- movl 4(%esp), %eax /* load 'v' off stack */
- movl (%eax), %ecx /* load v[0] */
- movl 4(%eax), %eax /* load v[1] */
- movl %ecx, 0 /* store v[0] to current vertex */
- movl %eax, 4 /* store v[1] to current vertex */
- ret
-GLOBL ( _x86_Attribute2fv_end )
-
-
-/**
- * Generic handler for 3 float format data. This can be used for
- * Normal3f, Color3f (when the color target is also float), or
- * TexCoord3f.
- */
-
-GLOBL ( _x86_Attribute3f )
- movl 4(%esp), %ecx
- movl 8(%esp), %edx
- movl 12(%esp), %eax
- movl %ecx, 0
- movl %edx, 4
- movl %eax, 8
- ret
-GLOBL ( _x86_Attribute3f_end )
-
-/**
- * Generic handler for 3 float vector format data. This can be used for
- * Normal3f, Color3f (when the color target is also float), or
- * TexCoord3f.
- */
-
-GLOBL( _x86_Attribute3fv)
- movl 4(%esp), %eax /* load 'v' off stack */
- movl (%eax), %ecx /* load v[0] */
- movl 4(%eax), %edx /* load v[1] */
- movl 8(%eax), %eax /* load v[2] */
- movl %ecx, 0 /* store v[0] to current vertex */
- movl %edx, 4 /* store v[1] to current vertex */
- movl %eax, 8 /* store v[2] to current vertex */
- ret
-GLOBL ( _x86_Attribute3fv_end )
-
-
-/*
- Color 4ubv_ub
-*/
-GLOBL ( _x86_Color4ubv_ub )
- movl 4(%esp), %eax
- movl $0x12345678, %edx
- movl (%eax), %eax
- movl %eax, (%edx)
- ret
-GLOBL ( _x86_Color4ubv_ub_end )
-
-/*
- Color 4ubv 4f
-*/
-GLOBL ( _x86_Color4ubv_4f )
- push %ebx
- movl $0, %edx
- xor %eax, %eax
- xor %ecx, %ecx
- movl 8(%esp), %ebx
- movl (%ebx), %ebx
- mov %bl, %al
- mov %bh, %cl
- movl (%edx,%eax,4),%eax
- movl (%edx,%ecx,4),%ecx
- movl %eax, (0xdeadbeaf)
- movl %ecx, (0xdeadbeaf)
- xor %eax, %eax
- xor %ecx, %ecx
- shr $16, %ebx
- mov %bl, %al
- mov %bh, %cl
- movl (%edx,%eax,4), %eax
- movl (%edx,%ecx,4), %ecx
- movl %eax, (0xdeadbeaf)
- movl %ecx, (0xdeadbeaf)
- pop %ebx
- ret
-GLOBL ( _x86_Color4ubv_4f_end )
-
-/*
-
- Color4ub_ub
-*/
-GLOBL( _x86_Color4ub_ub )
- push %ebx
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- movl 16(%esp), %ecx
- movl 20(%esp), %ebx
- mov %al, (0)
- mov %dl, (0)
- mov %cl, (0)
- mov %bl, (0)
- pop %ebx
- ret
-GLOBL( _x86_Color4ub_ub_end )
-
-
-/* \todo: change the "and $7, %eax" to something like "target & 4 ? target & 5 : target & 3)" */
-/*
- MultiTexCoord2fv st0/st1
-*/
-GLOBL( _x86_MultiTexCoord2fv )
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- and $7, %eax
- movl (%ecx), %edx
- shl $3, %eax
- movl 4(%ecx), %ecx
- movl %edx, 0xdeadbeef(%eax)
- movl %ecx, 0xdeadbeef(%eax)
- ret
-GLOBL( _x86_MultiTexCoord2fv_end )
-
-/*
- MultiTexCoord2fv
-*/
-
-GLOBL( _x86_MultiTexCoord2fv_2 )
- movl 4(%esp,1), %eax
- movl 8(%esp,1), %ecx
- and $0x7, %eax
- movl 0(,%eax,4), %edx
- movl (%ecx), %eax
- movl %eax, (%edx)
- movl 4(%ecx), %eax
- movl %eax, 4(%edx)
- ret
-GLOBL( _x86_MultiTexCoord2fv_2_end )
-
-/*
- MultiTexCoord2f st0/st1
-*/
-GLOBL( _x86_MultiTexCoord2f )
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl 12(%esp), %ecx
- and $7, %eax
- shl $3, %eax
- movl %edx, 0xdeadbeef(%eax)
- movl %ecx, 0xdeadbeef(%eax)
- ret
-GLOBL( _x86_MultiTexCoord2f_end )
-
-/*
- MultiTexCoord2f
-*/
-GLOBL( _x86_MultiTexCoord2f_2 )
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl 12(%esp,1), %ecx
- and $7,%eax
- movl 0(,%eax,4), %eax
- movl %edx, (%eax)
- movl %ecx, 4(%eax)
- ret
-GLOBL( _x86_MultiTexCoord2f_2_end )
-
-#if defined(USE_SSE_ASM)
-/**
- * This can be used as a template for either Color3fv (when the color
- * target is also a 3f) or Normal3fv.
- */
-
-GLOBL( _sse_Attribute3fv )
- movl 4(%esp), %eax
- movlps (%eax), %xmm0
- movl 8(%eax), %eax
- movlps %xmm0, 0
- movl %eax, 8
- ret
-GLOBL( _sse_Attribute3fv_end )
-
-/**
- * This can be used as a template for either Color3f (when the color
- * target is also a 3f) or Normal3f.
- */
-
-GLOBL( _sse_Attribute3f )
- movlps 4(%esp), %xmm0
- movl 12(%esp), %eax
- movlps %xmm0, 0
- movl %eax, 8
- ret
-GLOBL( _sse_Attribute3f_end )
-
-
-/**
- * Generic handler for 2 float vector format data. This can be used for
- * TexCoord2fv and possibly other functions.
- */
-
-GLOBL( _sse_Attribute2fv )
- movl 4(%esp), %eax
- movlps (%eax), %xmm0
- movlps %xmm0, 0
- ret
-GLOBL( _sse_Attribute2fv_end )
-
-
-/**
- * Generic handler for 2 float format data. This can be used for
- * TexCoord2f and possibly other functions.
- */
-
-GLOBL( _sse_Attribute2f )
- movlps 4(%esp), %xmm0
- movlps %xmm0, 0
- ret
-GLOBL( _sse_Attribute2f_end )
-
-/*
- MultiTexCoord2fv st0/st1
-*/
-GLOBL( _sse_MultiTexCoord2fv )
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- and $7, %eax
- movlps (%ecx), %xmm0
- movlps %xmm0, 0xdeadbeef(,%eax,8)
- ret
-GLOBL( _sse_MultiTexCoord2fv_end )
-
-/*
- MultiTexCoord2fv
-*/
-GLOBL( _sse_MultiTexCoord2fv_2 )
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- and $0x7, %eax
- movl 0(,%eax,4), %edx
- movlps (%ecx), %xmm0
- movlps %xmm0, (%edx)
- ret
-GLOBL( _sse_MultiTexCoord2fv_2_end )
-
-/*
- MultiTexCoord2f st0/st1
-*/
-GLOBL( _sse_MultiTexCoord2f )
- movl 4(%esp), %eax
- and $7, %eax
- movlps 8(%esp), %xmm0
- movlps %xmm0, 0xdeadbeef(,%eax,8)
- ret
-GLOBL( _sse_MultiTexCoord2f_end )
-
-/*
- MultiTexCoord2f
-*/
-GLOBL( _sse_MultiTexCoord2f_2 )
- movl 4(%esp), %eax
- movlps 8(%esp), %xmm0
- and $7,%eax
- movl 0(,%eax,4), %eax
- movlps %xmm0, (%eax)
- ret
-GLOBL( _sse_MultiTexCoord2f_2_end )
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/Makefile
deleted file mode 100644
index 57c7fc7aa..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/Makefile
+++ /dev/null
@@ -1,83 +0,0 @@
-# src/mesa/drivers/dri/r300/Makefile
-
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r300_dri.so
-DEFINES += -DCOMPILE_R300 -DGLX_DIRECT_RENDERING -DR200_MERGED=0
-
-MINIGLX_SOURCES = server/radeon_dri.c
-
-COMMON_SOURCES = \
- ../../common/driverfuncs.c \
- ../common/mm.c \
- ../common/utils.c \
- ../common/texmem.c \
- ../common/vblank.c \
- ../common/xmlconfig.c \
- ../common/dri_util.c
-
-DRIVER_SOURCES = \
- radeon_screen.c \
- radeon_context.c \
- radeon_ioctl.c \
- radeon_lock.c \
- radeon_span.c \
- radeon_state.c \
- \
- r300_context.c \
- r300_ioctl.c \
- r300_cmdbuf.c \
- r300_state.c \
- r300_render.c \
- r300_texmem.c \
- r300_tex.c \
- r300_texstate.c \
- r300_texprog.c \
- r300_vertexprog.c \
- r300_fragprog.c \
- r300_shader.c \
- r300_maos.c
-# \
-# r200_context.c \
-# r200_ioctl.c \
-# r200_state.c \
-# r200_state_init.c \
-# r200_cmdbuf.c \
-# r200_pixel.c \
-# r200_tex.c \
-# r200_texmem.c \
-# r200_texstate.c \
-# r200_swtcl.c \
-# r200_maos.c \
-# r200_sanity.c \
-# r200_vtxfmt.c \
-# r200_vtxfmt_c.c \
-# r200_vtxfmt_sse.c \
-# r200_vtxfmt_x86.c
-
-
-C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES)
-
-X86_SOURCES =
-#r200_vtxtmp_x86.S
-
-SYMLINKS = \
- server/radeon_dri.c \
- server/radeon_dri.h \
- server/radeon.h \
- server/radeon_macros.h \
- server/radeon_reg.h
-
-##### TARGETS #####
-
-
-include ../Makefile.template
-
-$(SYMLINKS):
- mkdir -p server
- for i in $(SYMLINKS) ; do rm -f $$i && test -f ../radeon/$$i && ln -s ../../radeon/$$i $$i ; done
-
-symlinks: $(SYMLINKS)
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/pixel_shader.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/pixel_shader.h
deleted file mode 100644
index 0d04859f9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/pixel_shader.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef __PIXEL_SHADER_H__
-#define __PIXEL_SHADER_H__
-
-#include "r300_reg.h"
-
-
-/* INSTR 0 */
-
-#define PFS_OP_MAD 0
-#define PFS_OP_DP3 1
-#define PFS_OP_DP4 2
-#define PFS_OP_MIN 4
-#define PFS_OP_MAX 5
-#define PFS_OP_CMP 8
-#define PFS_OP_FRC 9
-#define PFS_OP_OUTC_REPL_ALPHA 10
-
-/* "or" these with arg0 value to negate or take absolute value of an argument */
-#define PFS_ARG_NEG (1<<5)
-#define PFS_ARG_ABS (1<<6)
-
-#define MAKE_PFS_INSTR0(op, arg0, arg1, arg2, flags) \
- ( ((op)<<23) \
- | ((arg0)<<R300_FPI0_ARG0C_SHIFT) \
- | ((arg1)<<R300_FPI0_ARG1C_SHIFT) \
- | ((arg2)<<R300_FPI0_ARG2C_SHIFT) \
- | (flags) \
- )
-
-#define PFS_FLAG_X 1
-#define PFS_FLAG_Y 2
-#define PFS_FLAG_XY 3
-#define PFS_FLAG_Z 4
-#define PFS_FLAG_XZ 5
-#define PFS_FLAG_YZ 6
-#define PFS_FLAG_ALL 7
-#define PFS_FLAG_NONE 0
-
-#define EASY_PFS_INSTR0(op, arg0, arg1, arg2) \
- MAKE_PFS_INSTR0(PFS_OP_##op, \
- R300_FPI0_ARGC_##arg0, \
- R300_FPI0_ARGC_##arg1, \
- R300_FPI0_ARGC_##arg2, \
- 0)
-
-/* INSTR 1 */
-
-#define PFS_FLAG_CONST (1<<5)
-
-#define MAKE_PFS_INSTR1(dstc, src0, src1, src2, reg, output) \
- ((src0) | ((src1) << R300_FPI1_SRC1C_SHIFT) \
- | ((src2)<<R300_FPI1_SRC2C_SHIFT) \
- | ((dstc) << R300_FPI1_DSTC_SHIFT) \
- | ((reg) << 23) | ((output)<<26))
-
-#define EASY_PFS_INSTR1(dstc, src0, src1, src2, reg, output) \
- MAKE_PFS_INSTR1(dstc, src0, src1, src2, PFS_FLAG_##reg, PFS_FLAG_##output)
-
-/* INSTR 2 */
-
-/* you can "or" PFS_ARG_NEG with these values to negate them */
-
-#define MAKE_PFS_INSTR2(op, arg0, arg1, arg2, flags) \
- (((op) << 23) | \
- ((arg0)<<R300_FPI2_ARG0A_SHIFT) | \
- ((arg1)<<R300_FPI2_ARG1A_SHIFT) | \
- ((arg2)<<R300_FPI2_ARG2A_SHIFT) | \
- (flags))
-
-#define EASY_PFS_INSTR2(op, arg0, arg1, arg2) \
- MAKE_PFS_INSTR2(R300_FPI2_OUTA_##op, \
- R300_FPI2_ARGA_##arg0, \
- R300_FPI2_ARGA_##arg1, \
- R300_FPI2_ARGA_##arg2, \
- 0)
-
-
-/* INSTR 3 */
-
-#define PFS_FLAG_NONE 0
-#define PFS_FLAG_REG 1
-#define PFS_FLAG_OUTPUT 2
-#define PFS_FLAG_BOTH 3
-
-#define MAKE_PFS_INSTR3(dstc, src0, src1, src2, flags) \
- ((src0) | ((src1) << R300_FPI1_SRC1C_SHIFT) \
- | ((src2)<<R300_FPI1_SRC2C_SHIFT) \
- | ((dstc) << R300_FPI1_DSTC_SHIFT) \
- | ((flags) << 23))
-
-#define EASY_PFS_INSTR3(dstc, src0, src1, src2, flag) \
- MAKE_PFS_INSTR3(dstc, src0, src1, src2, PFS_FLAG_##flag)
-
- /* What are 0's ORed with flags ? They are register numbers that
- just happen to be 0 */
-#define PFS_NOP { \
- EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO), \
- EASY_PFS_INSTR1(0, 0, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, NONE, ALL), \
- EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO), \
- EASY_PFS_INSTR3(0, 0, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, OUTPUT) \
- }
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_context.h
deleted file mode 100644
index 2c1eda33f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_context.h
+++ /dev/null
@@ -1,822 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_CONTEXT_H__
-#define __R200_CONTEXT_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include "tnl/t_vertex.h"
-#include "drm.h"
-#include "radeon_drm.h"
-#include "dri_util.h"
-#include "texmem.h"
-
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "r200_reg.h"
-#include "radeon_context.h"
-
-#define ENABLE_HW_3D_TEXTURE 1 /* XXX this is temporary! */
-
-struct r200_context;
-typedef struct r200_context r200ContextRec;
-typedef struct r200_context *r200ContextPtr;
-
-#include "mm.h"
-
-/* The blit width for texture uploads
- */
-#define BLIT_WIDTH_BYTES 1024
-
-/* Use the templated vertex format:
- */
-#define COLOR_IS_RGBA
-#define TAG(x) r200##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*r200_tri_func) (r200ContextPtr,
- r200Vertex *, r200Vertex *, r200Vertex *);
-
-typedef void (*r200_line_func) (r200ContextPtr, r200Vertex *, r200Vertex *);
-
-typedef void (*r200_point_func) (r200ContextPtr, r200Vertex *);
-
-struct r200_depthbuffer_state {
- GLfloat scale;
-};
-
-struct r200_stencilbuffer_state {
- GLboolean hwBuffer;
- GLuint clear; /* rb3d_stencilrefmask value */
-};
-
-struct r200_stipple_state {
- GLuint mask[32];
-};
-
-typedef struct r200_tex_obj r200TexObj, *r200TexObjPtr;
-
-/* Texture object in locally shared texture space.
- */
-struct r200_tex_obj {
- driTextureObject base;
-
- GLuint bufAddr; /* Offset to start of locally
- shared texture block */
-
- GLuint dirty_state; /* Flags (1 per texunit) for
- whether or not this texobj
- has dirty hardware state
- (pp_*) that needs to be
- brought into the
- texunit. */
-
- drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
- /* Six, for the cube faces */
-
- GLuint pp_txfilter; /* hardware register values */
- GLuint pp_txformat;
- GLuint pp_txformat_x;
- GLuint pp_txoffset; /* Image location in texmem.
- All cube faces follow. */
- GLuint pp_txsize; /* npot only */
- GLuint pp_txpitch; /* npot only */
- GLuint pp_border_color;
- GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
-
- GLboolean border_fallback;
-};
-
-struct r200_texture_env_state {
- r200TexObjPtr texobj;
- GLenum format;
- GLenum envMode;
-};
-
-#define R200_MAX_TEXTURE_UNITS 6
-
-struct r200_texture_state {
- struct r200_texture_env_state unit[R200_MAX_TEXTURE_UNITS];
-};
-
-struct r200_state_atom {
- struct r200_state_atom *next, *prev;
- const char *name; /* for debug */
- int cmd_size; /* size in bytes */
- GLuint idx;
- int *cmd; /* one or more cmd's */
- int *lastcmd; /* one or more cmd's */
- int *savedcmd; /* one or more cmd's */
- GLboolean dirty;
- GLboolean(*check) (GLcontext *, int); /* is this state active? */
-};
-
-/* Trying to keep these relatively short as the variables are becoming
- * extravagently long. Drop the driver name prefix off the front of
- * everything - I think we know which driver we're in by now, and keep the
- * prefix to 3 letters unless absolutely impossible.
- */
-
-#define CTX_CMD_0 0
-#define CTX_PP_MISC 1
-#define CTX_PP_FOG_COLOR 2
-#define CTX_RE_SOLID_COLOR 3
-#define CTX_RB3D_BLENDCNTL 4
-#define CTX_RB3D_DEPTHOFFSET 5
-#define CTX_RB3D_DEPTHPITCH 6
-#define CTX_RB3D_ZSTENCILCNTL 7
-#define CTX_CMD_1 8
-#define CTX_PP_CNTL 9
-#define CTX_RB3D_CNTL 10
-#define CTX_RB3D_COLOROFFSET 11
-#define CTX_CMD_2 12 /* why */
-#define CTX_RB3D_COLORPITCH 13 /* why */
-#define CTX_STATE_SIZE_OLDDRM 14
-#define CTX_CMD_3 14
-#define CTX_RB3D_BLENDCOLOR 15
-#define CTX_RB3D_ABLENDCNTL 16
-#define CTX_RB3D_CBLENDCNTL 17
-#define CTX_STATE_SIZE_NEWDRM 18
-
-#define SET_CMD_0 0
-#define SET_SE_CNTL 1
-#define SET_RE_CNTL 2 /* replace se_coord_fmt */
-#define SET_STATE_SIZE 3
-
-#define VTE_CMD_0 0
-#define VTE_SE_VTE_CNTL 1
-#define VTE_STATE_SIZE 2
-
-#define LIN_CMD_0 0
-#define LIN_RE_LINE_PATTERN 1
-#define LIN_RE_LINE_STATE 2
-#define LIN_CMD_1 3
-#define LIN_SE_LINE_WIDTH 4
-#define LIN_STATE_SIZE 5
-
-#define MSK_CMD_0 0
-#define MSK_RB3D_STENCILREFMASK 1
-#define MSK_RB3D_ROPCNTL 2
-#define MSK_RB3D_PLANEMASK 3
-#define MSK_STATE_SIZE 4
-
-#define VPT_CMD_0 0
-#define VPT_SE_VPORT_XSCALE 1
-#define VPT_SE_VPORT_XOFFSET 2
-#define VPT_SE_VPORT_YSCALE 3
-#define VPT_SE_VPORT_YOFFSET 4
-#define VPT_SE_VPORT_ZSCALE 5
-#define VPT_SE_VPORT_ZOFFSET 6
-#define VPT_STATE_SIZE 7
-
-#define ZBS_CMD_0 0
-#define ZBS_SE_ZBIAS_FACTOR 1
-#define ZBS_SE_ZBIAS_CONSTANT 2
-#define ZBS_STATE_SIZE 3
-
-#define MSC_CMD_0 0
-#define MSC_RE_MISC 1
-#define MSC_STATE_SIZE 2
-
-#define TAM_CMD_0 0
-#define TAM_DEBUG3 1
-#define TAM_STATE_SIZE 2
-
-#define TEX_CMD_0 0
-#define TEX_PP_TXFILTER 1 /*2c00 */
-#define TEX_PP_TXFORMAT 2 /*2c04 */
-#define TEX_PP_TXFORMAT_X 3 /*2c08 */
-#define TEX_PP_TXSIZE 4 /*2c0c */
-#define TEX_PP_TXPITCH 5 /*2c10 */
-#define TEX_PP_BORDER_COLOR 6 /*2c14 */
-#define TEX_CMD_1 7
-#define TEX_PP_TXOFFSET 8 /*2d00 */
-#define TEX_STATE_SIZE 9
-
-#define CUBE_CMD_0 0 /* 1 register follows */
-#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */
-#define CUBE_CMD_1 2 /* 5 registers follow */
-#define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */
-#define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */
-#define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */
-#define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */
-#define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */
-#define CUBE_STATE_SIZE 8
-
-#define PIX_CMD_0 0
-#define PIX_PP_TXCBLEND 1
-#define PIX_PP_TXCBLEND2 2
-#define PIX_PP_TXABLEND 3
-#define PIX_PP_TXABLEND2 4
-#define PIX_STATE_SIZE 5
-
-#define TF_CMD_0 0
-#define TF_TFACTOR_0 1
-#define TF_TFACTOR_1 2
-#define TF_TFACTOR_2 3
-#define TF_TFACTOR_3 4
-#define TF_TFACTOR_4 5
-#define TF_TFACTOR_5 6
-#define TF_STATE_SIZE 7
-
-#define TCL_CMD_0 0
-#define TCL_LIGHT_MODEL_CTL_0 1
-#define TCL_LIGHT_MODEL_CTL_1 2
-#define TCL_PER_LIGHT_CTL_0 3
-#define TCL_PER_LIGHT_CTL_1 4
-#define TCL_PER_LIGHT_CTL_2 5
-#define TCL_PER_LIGHT_CTL_3 6
-#define TCL_CMD_1 7
-#define TCL_UCP_VERT_BLEND_CTL 8
-#define TCL_STATE_SIZE 9
-
-#define MSL_CMD_0 0
-#define MSL_MATRIX_SELECT_0 1
-#define MSL_MATRIX_SELECT_1 2
-#define MSL_MATRIX_SELECT_2 3
-#define MSL_MATRIX_SELECT_3 4
-#define MSL_MATRIX_SELECT_4 5
-#define MSL_STATE_SIZE 6
-
-#define TCG_CMD_0 0
-#define TCG_TEX_PROC_CTL_2 1
-#define TCG_TEX_PROC_CTL_3 2
-#define TCG_TEX_PROC_CTL_0 3
-#define TCG_TEX_PROC_CTL_1 4
-#define TCG_TEX_CYL_WRAP_CTL 5
-#define TCG_STATE_SIZE 6
-
-#define MTL_CMD_0 0
-#define MTL_EMMISSIVE_RED 1
-#define MTL_EMMISSIVE_GREEN 2
-#define MTL_EMMISSIVE_BLUE 3
-#define MTL_EMMISSIVE_ALPHA 4
-#define MTL_AMBIENT_RED 5
-#define MTL_AMBIENT_GREEN 6
-#define MTL_AMBIENT_BLUE 7
-#define MTL_AMBIENT_ALPHA 8
-#define MTL_DIFFUSE_RED 9
-#define MTL_DIFFUSE_GREEN 10
-#define MTL_DIFFUSE_BLUE 11
-#define MTL_DIFFUSE_ALPHA 12
-#define MTL_SPECULAR_RED 13
-#define MTL_SPECULAR_GREEN 14
-#define MTL_SPECULAR_BLUE 15
-#define MTL_SPECULAR_ALPHA 16
-#define MTL_CMD_1 17
-#define MTL_SHININESS 18
-#define MTL_STATE_SIZE 19
-
-#define VAP_CMD_0 0
-#define VAP_SE_VAP_CNTL 1
-#define VAP_STATE_SIZE 2
-
-/* Replaces a lot of packet info from radeon
- */
-#define VTX_CMD_0 0
-#define VTX_VTXFMT_0 1
-#define VTX_VTXFMT_1 2
-#define VTX_TCL_OUTPUT_VTXFMT_0 3
-#define VTX_TCL_OUTPUT_VTXFMT_1 4
-#define VTX_CMD_1 5
-#define VTX_TCL_OUTPUT_COMPSEL 6
-#define VTX_CMD_2 7
-#define VTX_STATE_CNTL 8
-#define VTX_STATE_SIZE 9
-
-#define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
- R200_VTX_COLOR_MASK)
-
-/**
- * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine
- * how many components are in texture coordinate \c n.
- */
-#define VTX_TEXn_COUNT(v,n) (((v) >> (3 * n)) & 0x07)
-
-#define MAT_CMD_0 0
-#define MAT_ELT_0 1
-#define MAT_STATE_SIZE 17
-
-#define GRD_CMD_0 0
-#define GRD_VERT_GUARD_CLIP_ADJ 1
-#define GRD_VERT_GUARD_DISCARD_ADJ 2
-#define GRD_HORZ_GUARD_CLIP_ADJ 3
-#define GRD_HORZ_GUARD_DISCARD_ADJ 4
-#define GRD_STATE_SIZE 5
-
-/* position changes frequently when lighting in modelpos - separate
- * out to new state item?
- */
-#define LIT_CMD_0 0
-#define LIT_AMBIENT_RED 1
-#define LIT_AMBIENT_GREEN 2
-#define LIT_AMBIENT_BLUE 3
-#define LIT_AMBIENT_ALPHA 4
-#define LIT_DIFFUSE_RED 5
-#define LIT_DIFFUSE_GREEN 6
-#define LIT_DIFFUSE_BLUE 7
-#define LIT_DIFFUSE_ALPHA 8
-#define LIT_SPECULAR_RED 9
-#define LIT_SPECULAR_GREEN 10
-#define LIT_SPECULAR_BLUE 11
-#define LIT_SPECULAR_ALPHA 12
-#define LIT_POSITION_X 13
-#define LIT_POSITION_Y 14
-#define LIT_POSITION_Z 15
-#define LIT_POSITION_W 16
-#define LIT_DIRECTION_X 17
-#define LIT_DIRECTION_Y 18
-#define LIT_DIRECTION_Z 19
-#define LIT_DIRECTION_W 20
-#define LIT_ATTEN_QUADRATIC 21
-#define LIT_ATTEN_LINEAR 22
-#define LIT_ATTEN_CONST 23
-#define LIT_ATTEN_XXX 24
-#define LIT_CMD_1 25
-#define LIT_SPOT_DCD 26
-#define LIT_SPOT_DCM 27
-#define LIT_SPOT_EXPONENT 28
-#define LIT_SPOT_CUTOFF 29
-#define LIT_SPECULAR_THRESH 30
-#define LIT_RANGE_CUTOFF 31 /* ? */
-#define LIT_ATTEN_CONST_INV 32
-#define LIT_STATE_SIZE 33
-
-/* Fog
- */
-#define FOG_CMD_0 0
-#define FOG_R 1
-#define FOG_C 2
-#define FOG_D 3
-#define FOG_PAD 4
-#define FOG_STATE_SIZE 5
-
-/* UCP
- */
-#define UCP_CMD_0 0
-#define UCP_X 1
-#define UCP_Y 2
-#define UCP_Z 3
-#define UCP_W 4
-#define UCP_STATE_SIZE 5
-
-/* GLT - Global ambient
- */
-#define GLT_CMD_0 0
-#define GLT_RED 1
-#define GLT_GREEN 2
-#define GLT_BLUE 3
-#define GLT_ALPHA 4
-#define GLT_STATE_SIZE 5
-
-/* EYE
- */
-#define EYE_CMD_0 0
-#define EYE_X 1
-#define EYE_Y 2
-#define EYE_Z 3
-#define EYE_RESCALE_FACTOR 4
-#define EYE_STATE_SIZE 5
-
-/* CST - constant state
- */
-#define CST_CMD_0 0
-#define CST_PP_CNTL_X 1
-#define CST_CMD_1 2
-#define CST_RB3D_DEPTHXY_OFFSET 3
-#define CST_CMD_2 4
-#define CST_RE_AUX_SCISSOR_CNTL 5
-#define CST_CMD_3 6
-#define CST_RE_SCISSOR_TL_0 7
-#define CST_RE_SCISSOR_BR_0 8
-#define CST_CMD_4 9
-#define CST_SE_VAP_CNTL_STATUS 10
-#define CST_CMD_5 11
-#define CST_RE_POINTSIZE 12
-#define CST_CMD_6 13
-#define CST_SE_TCL_INPUT_VTX_0 14
-#define CST_SE_TCL_INPUT_VTX_1 15
-#define CST_SE_TCL_INPUT_VTX_2 16
-#define CST_SE_TCL_INPUT_VTX_3 17
-#define CST_STATE_SIZE 18
-
-struct r200_hw_state {
- /* Head of the linked list of state atoms. */
- struct r200_state_atom atomlist;
-
- /* Hardware state, stored as cmdbuf commands:
- * -- Need to doublebuffer for
- * - reviving state after loss of context
- * - eliding noop statechange loops? (except line stipple count)
- */
- struct r200_state_atom ctx;
- struct r200_state_atom set;
- struct r200_state_atom vte;
- struct r200_state_atom lin;
- struct r200_state_atom msk;
- struct r200_state_atom vpt;
- struct r200_state_atom vap;
- struct r200_state_atom vtx;
- struct r200_state_atom tcl;
- struct r200_state_atom msl;
- struct r200_state_atom tcg;
- struct r200_state_atom msc;
- struct r200_state_atom cst;
- struct r200_state_atom tam;
- struct r200_state_atom tf;
- struct r200_state_atom tex[6];
- struct r200_state_atom cube[6];
- struct r200_state_atom zbs;
- struct r200_state_atom mtl[2];
- struct r200_state_atom mat[9];
- struct r200_state_atom lit[8]; /* includes vec, scl commands */
- struct r200_state_atom ucp[6];
- struct r200_state_atom pix[6]; /* pixshader stages */
- struct r200_state_atom eye; /* eye pos */
- struct r200_state_atom grd; /* guard band clipping */
- struct r200_state_atom fog;
- struct r200_state_atom glt;
-
- int max_state_size; /* Number of bytes necessary for a full state emit. */
- GLboolean is_dirty, all_dirty;
-};
-
-struct r200_colorbuffer_state {
- int roundEnable;
-};
-
-struct r200_state {
- /* Derived state for internal purposes:
- */
- struct r200_colorbuffer_state color;
- struct r200_depthbuffer_state depth;
- struct r200_stencilbuffer_state stencil;
- struct r200_stipple_state stipple;
- struct r200_texture_state texture;
-};
-
-/* Need refcounting on dma buffers:
- */
-struct r200_dma_buffer {
- int refcount; /* the number of retained regions in buf */
- drmBufPtr buf;
-};
-
-#define GET_START(rvb) (rmesa->radeon.radeonScreen->gart_buffer_offset + \
- (rvb)->address - rmesa->dma.buf0_address + \
- (rvb)->start)
-
-/* A retained region, eg vertices for indexed vertices.
- */
-struct r200_dma_region {
- struct r200_dma_buffer *buf;
- char *address; /* == buf->address */
- int start, end, ptr; /* offsets from start of buf */
- int aos_start;
- int aos_stride;
- int aos_size;
-};
-
-struct r200_dma {
- /* Active dma region. Allocations for vertices and retained
- * regions come from here. Also used for emitting random vertices,
- * these may be flushed by calling flush_current();
- */
- struct r200_dma_region current;
-
- void (*flush) (r200ContextPtr);
-
- char *buf0_address; /* start of buf[0], for index calcs */
- GLuint nr_released_bufs; /* flush after so many buffers released */
-};
-
-#define R200_CMD_BUF_SZ (8*1024)
-
-struct r200_store {
- GLuint statenr;
- GLuint primnr;
- char cmd_buf[R200_CMD_BUF_SZ];
- int cmd_used;
- int elts_start;
-};
-
-/* r200_tcl.c
- */
-struct r200_tcl_info {
- GLuint vertex_format;
- GLint last_offset;
- GLuint hw_primitive;
-
- struct r200_dma_region *aos_components[8];
- GLuint nr_aos_components;
-
- GLuint *Elts;
-
- struct r200_dma_region indexed_verts;
- struct r200_dma_region obj;
- struct r200_dma_region rgba;
- struct r200_dma_region spec;
- struct r200_dma_region fog;
- struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
- struct r200_dma_region norm;
-};
-
-/* r200_swtcl.c
- */
-struct r200_swtcl_info {
- GLuint RenderIndex;
-
- /**
- * Size of a hardware vertex. This is calculated when \c ::vertex_attrs is
- * installed in the Mesa state vector.
- */
- GLuint vertex_size;
-
- /**
- * Attributes instructing the Mesa TCL pipeline where / how to put vertex
- * data in the hardware buffer.
- */
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
-
- /**
- * Number of elements of \c ::vertex_attrs that are actually used.
- */
- GLuint vertex_attr_count;
-
- /**
- * Cached pointer to the buffer where Mesa will store vertex data.
- */
- GLubyte *verts;
-
- /* Fallback rasterization functions
- */
- r200_point_func draw_point;
- r200_line_func draw_line;
- r200_tri_func draw_tri;
-
- GLuint hw_primitive;
- GLenum render_primitive;
- GLuint numverts;
-
- /**
- * Offset of the 4UB color data within a hardware (swtcl) vertex.
- */
- GLuint coloroffset;
-
- /**
- * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
- */
- GLuint specoffset;
-
- /**
- * Should Mesa project vertex data or will the hardware do it?
- */
- GLboolean needproj;
-
- struct r200_dma_region indexed_verts;
-};
-
-struct r200_ioctl {
- GLuint vertex_offset;
- GLuint vertex_size;
-};
-
-#define R200_MAX_PRIMS 64
-
-/* Want to keep a cache of these around. Each is parameterized by
- * only a single value which has only a small range. Only expect a
- * few, so just rescan the list each time?
- */
-struct dynfn {
- struct dynfn *next, *prev;
- int key[2];
- char *code;
-};
-
-struct dfn_lists {
- struct dynfn Vertex2f;
- struct dynfn Vertex2fv;
- struct dynfn Vertex3f;
- struct dynfn Vertex3fv;
- struct dynfn Color4ub;
- struct dynfn Color4ubv;
- struct dynfn Color3ub;
- struct dynfn Color3ubv;
- struct dynfn Color4f;
- struct dynfn Color4fv;
- struct dynfn Color3f;
- struct dynfn Color3fv;
- struct dynfn SecondaryColor3ubEXT;
- struct dynfn SecondaryColor3ubvEXT;
- struct dynfn SecondaryColor3fEXT;
- struct dynfn SecondaryColor3fvEXT;
- struct dynfn Normal3f;
- struct dynfn Normal3fv;
- struct dynfn TexCoord3f;
- struct dynfn TexCoord3fv;
- struct dynfn TexCoord2f;
- struct dynfn TexCoord2fv;
- struct dynfn TexCoord1f;
- struct dynfn TexCoord1fv;
- struct dynfn MultiTexCoord3fARB;
- struct dynfn MultiTexCoord3fvARB;
- struct dynfn MultiTexCoord2fARB;
- struct dynfn MultiTexCoord2fvARB;
- struct dynfn MultiTexCoord1fARB;
- struct dynfn MultiTexCoord1fvARB;
-};
-
-struct dfn_generators {
- struct dynfn *(*Vertex2f) (GLcontext *, const int *);
- struct dynfn *(*Vertex2fv) (GLcontext *, const int *);
- struct dynfn *(*Vertex3f) (GLcontext *, const int *);
- struct dynfn *(*Vertex3fv) (GLcontext *, const int *);
- struct dynfn *(*Color4ub) (GLcontext *, const int *);
- struct dynfn *(*Color4ubv) (GLcontext *, const int *);
- struct dynfn *(*Color3ub) (GLcontext *, const int *);
- struct dynfn *(*Color3ubv) (GLcontext *, const int *);
- struct dynfn *(*Color4f) (GLcontext *, const int *);
- struct dynfn *(*Color4fv) (GLcontext *, const int *);
- struct dynfn *(*Color3f) (GLcontext *, const int *);
- struct dynfn *(*Color3fv) (GLcontext *, const int *);
- struct dynfn *(*SecondaryColor3ubEXT) (GLcontext *, const int *);
- struct dynfn *(*SecondaryColor3ubvEXT) (GLcontext *, const int *);
- struct dynfn *(*SecondaryColor3fEXT) (GLcontext *, const int *);
- struct dynfn *(*SecondaryColor3fvEXT) (GLcontext *, const int *);
- struct dynfn *(*Normal3f) (GLcontext *, const int *);
- struct dynfn *(*Normal3fv) (GLcontext *, const int *);
- struct dynfn *(*TexCoord3f) (GLcontext *, const int *);
- struct dynfn *(*TexCoord3fv) (GLcontext *, const int *);
- struct dynfn *(*TexCoord2f) (GLcontext *, const int *);
- struct dynfn *(*TexCoord2fv) (GLcontext *, const int *);
- struct dynfn *(*TexCoord1f) (GLcontext *, const int *);
- struct dynfn *(*TexCoord1fv) (GLcontext *, const int *);
- struct dynfn *(*MultiTexCoord3fARB) (GLcontext *, const int *);
- struct dynfn *(*MultiTexCoord3fvARB) (GLcontext *, const int *);
- struct dynfn *(*MultiTexCoord2fARB) (GLcontext *, const int *);
- struct dynfn *(*MultiTexCoord2fvARB) (GLcontext *, const int *);
- struct dynfn *(*MultiTexCoord1fARB) (GLcontext *, const int *);
- struct dynfn *(*MultiTexCoord1fvARB) (GLcontext *, const int *);
-};
-
-struct r200_prim {
- GLuint start;
- GLuint end;
- GLuint prim;
-};
-
- /* A maximum total of 29 elements per vertex: 3 floats for position, 3
- * floats for normal, 4 floats for color, 4 bytes for secondary color,
- * 3 floats for each texture unit (18 floats total).
- *
- * we maybe need add. 4 to prevent segfault if someone specifies
- * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: )
- *
- * The position data is never actually stored here, so 3 elements could be
- * trimmed out of the buffer.
- */
-
-#define R200_MAX_VERTEX_SIZE ((3*6)+11)
-
-struct r200_vbinfo {
- GLint counter, initial_counter;
- GLint *dmaptr;
- void (*notify) (void);
- GLint vertex_size;
-
- union {
- float f;
- int i;
- r200_color_t color;
- } vertex[R200_MAX_VERTEX_SIZE];
-
- GLfloat *normalptr;
- GLfloat *floatcolorptr;
- r200_color_t *colorptr;
- GLfloat *floatspecptr;
- r200_color_t *specptr;
- GLfloat *texcoordptr[8]; /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */
-
- GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */
- GLuint primflags;
- GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */
- GLboolean installed;
- GLboolean fell_back;
- GLboolean recheck;
- GLint nrverts;
- GLuint vtxfmt_0, vtxfmt_1;
-
- GLuint installed_vertex_format;
- GLuint installed_color_3f_sz;
-
- struct r200_prim primlist[R200_MAX_PRIMS];
- int nrprims;
-
- struct dfn_lists dfn_cache;
- struct dfn_generators codegen;
- GLvertexformat vtxfmt;
-};
-
-/**
- * R200 context structure.
- */
-struct r200_context {
- struct radeon_context radeon; /* parent class, must be first */
-
- /* Driver and hardware state management
- */
- struct r200_hw_state hw;
- struct r200_state state;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap *texture_heaps[R200_NR_TEX_HEAPS];
- driTextureObject swapped;
- int texture_depth;
- float initialMaxAnisotropy;
-
- /* Rasterization and vertex state:
- */
- GLuint NewGLState;
-
- /* Vertex buffers
- */
- struct r200_ioctl ioctl;
- struct r200_dma dma;
- struct r200_store store;
- GLboolean save_on_next_unlock;
-
- /* Clientdata textures;
- */
- GLuint prefer_gart_client_texturing;
-
- /* TCL stuff
- */
- GLmatrix TexGenMatrix[R200_MAX_TEXTURE_UNITS];
- GLboolean recheck_texgen[R200_MAX_TEXTURE_UNITS];
- GLboolean TexGenNeedNormals[R200_MAX_TEXTURE_UNITS];
- GLuint TexMatEnabled;
- GLuint TexMatCompSel;
- GLuint TexGenEnabled;
- GLuint TexGenInputs;
- GLuint TexGenCompSel;
- GLmatrix tmpmat;
-
- /* r200_tcl.c
- */
- struct r200_tcl_info tcl;
-
- /* r200_swtcl.c
- */
- struct r200_swtcl_info swtcl;
-
- /* r200_vtxfmt.c
- */
- struct r200_vbinfo vb;
-};
-
-#define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx))
-
-extern void r200DestroyContext(__DRIcontextPrivate * driContextPriv);
-extern GLboolean r200CreateContext(const __GLcontextModes * glVisual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate);
-
-#endif
-#endif /* __R200_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_ioctl.h
deleted file mode 100644
index db7bd7697..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_ioctl.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_IOCTL_H__
-#define __R200_IOCTL_H__
-
-#include "simple_list.h"
-#include "radeon_dri.h"
-#include "radeon_lock.h"
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "r200_context.h"
-#include "radeon_drm.h"
-
-extern void r200EmitState(r200ContextPtr rmesa);
-extern void r200EmitVertexAOS(r200ContextPtr rmesa,
- GLuint vertex_size, GLuint offset);
-
-extern void r200EmitVbufPrim(r200ContextPtr rmesa,
- GLuint primitive, GLuint vertex_nr);
-
-extern void r200FlushElts(r200ContextPtr rmesa);
-
-extern GLushort *r200AllocEltsOpenEnded(r200ContextPtr rmesa,
- GLuint primitive, GLuint min_nr);
-
-extern void r200EmitAOS(r200ContextPtr rmesa,
- struct r200_dma_region **regions,
- GLuint n, GLuint offset);
-
-extern void r200EmitBlit(r200ContextPtr rmesa,
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty, GLuint w, GLuint h);
-
-extern void r200EmitWait(r200ContextPtr rmesa, GLuint flags);
-
-extern void r200FlushCmdBuf(r200ContextPtr rmesa, const char *);
-extern int r200FlushCmdBufLocked(r200ContextPtr rmesa, const char *caller);
-extern void r200Flush(GLcontext * ctx);
-
-extern void r200RefillCurrentDmaRegion(r200ContextPtr rmesa);
-
-extern void r200AllocDmaRegion(r200ContextPtr rmesa,
- struct r200_dma_region *region,
- int bytes, int alignment);
-
-extern void r200AllocDmaRegionVerts(r200ContextPtr rmesa,
- struct r200_dma_region *region,
- int numverts, int vertsize, int alignment);
-
-extern void r200ReleaseDmaRegion(r200ContextPtr rmesa,
- struct r200_dma_region *region,
- const char *caller);
-
-extern void r200WaitForVBlank(r200ContextPtr rmesa);
-extern void r200InitIoctlFuncs(struct dd_function_table *functions);
-
-extern void *r200AllocateMemoryMESA(__DRInativeDisplay * dpy, int scrn,
- GLsizei size, GLfloat readfreq,
- GLfloat writefreq, GLfloat priority);
-extern void r200FreeMemoryMESA(__DRInativeDisplay * dpy, int scrn,
- GLvoid * pointer);
-extern GLuint r200GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn,
- const GLvoid * pointer);
-
-extern GLboolean r200IsGartMemory(r200ContextPtr rmesa, const GLvoid * pointer,
- GLint size);
-
-extern GLuint r200GartOffsetFromVirtual(r200ContextPtr rmesa,
- const GLvoid * pointer);
-
-void r200SaveHwState(r200ContextPtr radeon);
-void r200SetUpAtomList(r200ContextPtr rmesa);
-
-/* ================================================================
- * Helper macros:
- */
-
-/* Close off the last primitive, if it exists.
- */
-#define R200_NEWPRIM( rmesa ) \
-do { \
- if ( rmesa->dma.flush ) \
- rmesa->dma.flush( rmesa ); \
-} while (0)
-
-/* Can accomodate several state changes and primitive changes without
- * actually firing the buffer.
- */
-#define R200_STATECHANGE( rmesa, ATOM ) \
-do { \
- R200_NEWPRIM( rmesa ); \
- rmesa->hw.ATOM.dirty = GL_TRUE; \
- rmesa->hw.is_dirty = GL_TRUE; \
-} while (0)
-
-#define R200_DB_STATE( ATOM ) \
- memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \
- rmesa->hw.ATOM.cmd_size * 4)
-
-static __inline int R200_DB_STATECHANGE(r200ContextPtr rmesa,
- struct r200_state_atom *atom)
-{
- if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size * 4)) {
- int *tmp;
- R200_NEWPRIM(rmesa);
- atom->dirty = GL_TRUE;
- rmesa->hw.is_dirty = GL_TRUE;
- tmp = atom->cmd;
- atom->cmd = atom->lastcmd;
- atom->lastcmd = tmp;
- return 1;
- } else
- return 0;
-}
-
-/* Fire the buffered vertices no matter what.
- */
-#define R200_FIREVERTICES( r200 ) \
-do { \
- if ( (r200)->store.cmd_used || (r200)->dma.flush ) { \
- radeonFlush( (r200)->radeon.glCtx ); \
- } \
-} while (0)
-
-/* Command lengths. Note that any time you ensure ELTS_BUFSZ or VBUF_BUFSZ
- * are available, you will also be adding an rmesa->state.max_state_size because
- * r200EmitState is called from within r200EmitVbufPrim and r200FlushElts.
- */
-#define AOS_BUFSZ(nr) ((3 + ((nr / 2) * 3) + ((nr & 1) * 2)) * sizeof(int))
-#define VERT_AOS_BUFSZ (5 * sizeof(int))
-#define ELTS_BUFSZ(nr) (12 + nr * 2)
-#define VBUF_BUFSZ (3 * sizeof(int))
-
-/* Ensure that a minimum amount of space is available in the command buffer.
- * This is used to ensure atomicity of state updates with the rendering requests
- * that rely on them.
- *
- * An alternative would be to implement a "soft lock" such that when the buffer
- * wraps at an inopportune time, we grab the lock, flush the current buffer,
- * and hang on to the lock until the critical section is finished and we flush
- * the buffer again and unlock.
- */
-static __inline void r200EnsureCmdBufSpace(r200ContextPtr rmesa, int bytes)
-{
- if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ)
- r200FlushCmdBuf(rmesa, __FUNCTION__);
- assert(bytes <= R200_CMD_BUF_SZ);
-}
-
-/* Alloc space in the command buffer
- */
-static __inline char *r200AllocCmdBuf(r200ContextPtr rmesa,
- int bytes, const char *where)
-{
- char *head;
-
- if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ)
- r200FlushCmdBuf(rmesa, where);
-
- head = rmesa->store.cmd_buf + rmesa->store.cmd_used;
- rmesa->store.cmd_used += bytes;
- assert(rmesa->store.cmd_used <= R200_CMD_BUF_SZ);
- return head;
-}
-
-#endif /* __R200_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_reg.h
deleted file mode 100644
index 1336e961a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_reg.h
+++ /dev/null
@@ -1,1423 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_reg.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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 _R200_REG_H_
-#define _R200_REG_H_
-
-#define R200_PP_MISC 0x1c14
-#define R200_REF_ALPHA_MASK 0x000000ff
-#define R200_ALPHA_TEST_FAIL (0 << 8)
-#define R200_ALPHA_TEST_LESS (1 << 8)
-#define R200_ALPHA_TEST_LEQUAL (2 << 8)
-#define R200_ALPHA_TEST_EQUAL (3 << 8)
-#define R200_ALPHA_TEST_GEQUAL (4 << 8)
-#define R200_ALPHA_TEST_GREATER (5 << 8)
-#define R200_ALPHA_TEST_NEQUAL (6 << 8)
-#define R200_ALPHA_TEST_PASS (7 << 8)
-#define R200_ALPHA_TEST_OP_MASK (7 << 8)
-#define R200_CHROMA_FUNC_FAIL (0 << 16)
-#define R200_CHROMA_FUNC_PASS (1 << 16)
-#define R200_CHROMA_FUNC_NEQUAL (2 << 16)
-#define R200_CHROMA_FUNC_EQUAL (3 << 16)
-#define R200_CHROMA_KEY_NEAREST (0 << 18)
-#define R200_CHROMA_KEY_ZERO (1 << 18)
-#define R200_RIGHT_HAND_CUBE_D3D (0 << 24)
-#define R200_RIGHT_HAND_CUBE_OGL (1 << 24)
-#define R200_PP_FOG_COLOR 0x1c18
-#define R200_FOG_COLOR_MASK 0x00ffffff
-#define R200_FOG_VERTEX (0 << 24)
-#define R200_FOG_TABLE (1 << 24)
-#define R200_FOG_USE_DEPTH (0 << 25)
-#define R200_FOG_USE_W (1 << 25)
-#define R200_FOG_USE_DIFFUSE_ALPHA (2 << 25)
-#define R200_FOG_USE_SPEC_ALPHA (3 << 25)
-#define R200_FOG_USE_VTX_FOG (4 << 25)
-#define R200_FOG_USE_MASK (7 << 25)
-#define R200_RE_SOLID_COLOR 0x1c1c
-#define R200_RB3D_BLENDCNTL 0x1c20
-#define R200_COMB_FCN_MASK (7 << 12)
-#define R200_COMB_FCN_ADD_CLAMP (0 << 12)
-#define R200_COMB_FCN_ADD_NOCLAMP (1 << 12)
-#define R200_COMB_FCN_SUB_CLAMP (2 << 12)
-#define R200_COMB_FCN_SUB_NOCLAMP (3 << 12)
-#define R200_COMB_FCN_MIN (4 << 12)
-#define R200_COMB_FCN_MAX (5 << 12)
-#define R200_COMB_FCN_RSUB_CLAMP (6 << 12)
-#define R200_COMB_FCN_RSUB_NOCLAMP (7 << 12)
-#define R200_BLEND_GL_ZERO (32)
-#define R200_BLEND_GL_ONE (33)
-#define R200_BLEND_GL_SRC_COLOR (34)
-#define R200_BLEND_GL_ONE_MINUS_SRC_COLOR (35)
-#define R200_BLEND_GL_DST_COLOR (36)
-#define R200_BLEND_GL_ONE_MINUS_DST_COLOR (37)
-#define R200_BLEND_GL_SRC_ALPHA (38)
-#define R200_BLEND_GL_ONE_MINUS_SRC_ALPHA (39)
-#define R200_BLEND_GL_DST_ALPHA (40)
-#define R200_BLEND_GL_ONE_MINUS_DST_ALPHA (41)
-#define R200_BLEND_GL_SRC_ALPHA_SATURATE (42) /* src factor only */
-#define R200_BLEND_GL_CONST_COLOR (43)
-#define R200_BLEND_GL_ONE_MINUS_CONST_COLOR (44)
-#define R200_BLEND_GL_CONST_ALPHA (45)
-#define R200_BLEND_GL_ONE_MINUS_CONST_ALPHA (46)
-#define R200_BLEND_MASK (63)
-#define R200_SRC_BLEND_SHIFT (16)
-#define R200_DST_BLEND_SHIFT (24)
-#define R200_RB3D_DEPTHOFFSET 0x1c24
-#define R200_RB3D_DEPTHPITCH 0x1c28
-#define R200_DEPTHPITCH_MASK 0x00001ff8
-#define R200_DEPTH_ENDIAN_NO_SWAP (0 << 18)
-#define R200_DEPTH_ENDIAN_WORD_SWAP (1 << 18)
-#define R200_DEPTH_ENDIAN_DWORD_SWAP (2 << 18)
-#define R200_RB3D_ZSTENCILCNTL 0x1c2c
-#define R200_DEPTH_FORMAT_MASK (0xf << 0)
-#define R200_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
-#define R200_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
-#define R200_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0)
-#define R200_DEPTH_FORMAT_32BIT_INT_Z (4 << 0)
-#define R200_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0)
-#define R200_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0)
-#define R200_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0)
-#define R200_Z_TEST_NEVER (0 << 4)
-#define R200_Z_TEST_LESS (1 << 4)
-#define R200_Z_TEST_LEQUAL (2 << 4)
-#define R200_Z_TEST_EQUAL (3 << 4)
-#define R200_Z_TEST_GEQUAL (4 << 4)
-#define R200_Z_TEST_GREATER (5 << 4)
-#define R200_Z_TEST_NEQUAL (6 << 4)
-#define R200_Z_TEST_ALWAYS (7 << 4)
-#define R200_Z_TEST_MASK (7 << 4)
-#define R200_STENCIL_TEST_NEVER (0 << 12)
-#define R200_STENCIL_TEST_LESS (1 << 12)
-#define R200_STENCIL_TEST_LEQUAL (2 << 12)
-#define R200_STENCIL_TEST_EQUAL (3 << 12)
-#define R200_STENCIL_TEST_GEQUAL (4 << 12)
-#define R200_STENCIL_TEST_GREATER (5 << 12)
-#define R200_STENCIL_TEST_NEQUAL (6 << 12)
-#define R200_STENCIL_TEST_ALWAYS (7 << 12)
-#define R200_STENCIL_TEST_MASK (0x7 << 12)
-#define R200_STENCIL_FAIL_KEEP (0 << 16)
-#define R200_STENCIL_FAIL_ZERO (1 << 16)
-#define R200_STENCIL_FAIL_REPLACE (2 << 16)
-#define R200_STENCIL_FAIL_INC (3 << 16)
-#define R200_STENCIL_FAIL_DEC (4 << 16)
-#define R200_STENCIL_FAIL_INVERT (5 << 16)
-#define R200_STENCIL_FAIL_INC_WRAP (6 << 16)
-#define R200_STENCIL_FAIL_DEC_WRAP (7 << 16)
-#define R200_STENCIL_FAIL_MASK (0x7 << 16)
-#define R200_STENCIL_ZPASS_KEEP (0 << 20)
-#define R200_STENCIL_ZPASS_ZERO (1 << 20)
-#define R200_STENCIL_ZPASS_REPLACE (2 << 20)
-#define R200_STENCIL_ZPASS_INC (3 << 20)
-#define R200_STENCIL_ZPASS_DEC (4 << 20)
-#define R200_STENCIL_ZPASS_INVERT (5 << 20)
-#define R200_STENCIL_ZPASS_INC_WRAP (6 << 20)
-#define R200_STENCIL_ZPASS_DEC_WRAP (7 << 20)
-#define R200_STENCIL_ZPASS_MASK (0x7 << 20)
-#define R200_STENCIL_ZFAIL_KEEP (0 << 24)
-#define R200_STENCIL_ZFAIL_ZERO (1 << 24)
-#define R200_STENCIL_ZFAIL_REPLACE (2 << 24)
-#define R200_STENCIL_ZFAIL_INC (3 << 24)
-#define R200_STENCIL_ZFAIL_DEC (4 << 24)
-#define R200_STENCIL_ZFAIL_INVERT (5 << 24)
-#define R200_STENCIL_ZFAIL_INC_WRAP (6 << 24)
-#define R200_STENCIL_ZFAIL_DEC_WRAP (7 << 24)
-#define R200_STENCIL_ZFAIL_MASK (0x7 << 24)
-#define R200_Z_WRITE_ENABLE (1 << 30)
-/*gap*/
-#define R200_PP_CNTL 0x1c38
-#define R200_TEX_0_ENABLE 0x00000010
-#define R200_TEX_1_ENABLE 0x00000020
-#define R200_TEX_2_ENABLE 0x00000040
-#define R200_TEX_3_ENABLE 0x00000080
-#define R200_TEX_4_ENABLE 0x00000100
-#define R200_TEX_5_ENABLE 0x00000200
-#define R200_TEX_ENABLE_MASK 0x000003f0
-#define R200_FILTER_ROUND_MODE_MASK 0x00000400
-#define R200_TEX_BLEND_7_ENABLE 0x00000800
-#define R200_TEX_BLEND_0_ENABLE 0x00001000
-#define R200_TEX_BLEND_1_ENABLE 0x00002000
-#define R200_TEX_BLEND_2_ENABLE 0x00004000
-#define R200_TEX_BLEND_3_ENABLE 0x00008000
-#define R200_TEX_BLEND_4_ENABLE 0x00010000
-#define R200_TEX_BLEND_5_ENABLE 0x00020000
-#define R200_TEX_BLEND_6_ENABLE 0x00040000
-#define R200_MULTI_PASS_ENABLE 0x00080000
-#define R200_SPECULAR_ENABLE 0x00200000
-#define R200_FOG_ENABLE 0x00400000
-#define R200_ALPHA_TEST_ENABLE 0x00800000
-#define R200_ANTI_ALIAS_NONE 0x00000000
-#define R200_ANTI_ALIAS_LINE 0x01000000
-#define R200_ANTI_ALIAS_POLY 0x02000000
-#define R200_ANTI_ALIAS_MASK 0x03000000
-#define R200_RB3D_CNTL 0x1c3c
-#define R200_ALPHA_BLEND_ENABLE (1 << 0)
-#define R200_PLANE_MASK_ENABLE (1 << 1)
-#define R200_DITHER_ENABLE (1 << 2)
-#define R200_ROUND_ENABLE (1 << 3)
-#define R200_SCALE_DITHER_ENABLE (1 << 4)
-#define R200_DITHER_INIT (1 << 5)
-#define R200_ROP_ENABLE (1 << 6)
-#define R200_STENCIL_ENABLE (1 << 7)
-#define R200_Z_ENABLE (1 << 8)
-#define R200_DEPTH_XZ_OFFEST_ENABLE (1 << 9)
-#define R200_COLOR_FORMAT_ARGB1555 (3 << 10)
-#define R200_COLOR_FORMAT_RGB565 (4 << 10)
-#define R200_COLOR_FORMAT_ARGB8888 (6 << 10)
-#define R200_COLOR_FORMAT_RGB332 (7 << 10)
-#define R200_COLOR_FORMAT_Y8 (8 << 10)
-#define R200_COLOR_FORMAT_RGB8 (9 << 10)
-#define R200_COLOR_FORMAT_YUV422_VYUY (11 << 10)
-#define R200_COLOR_FORMAT_YUV422_YVYU (12 << 10)
-#define R200_COLOR_FORMAT_aYUV444 (14 << 10)
-#define R200_COLOR_FORMAT_ARGB4444 (15 << 10)
-#define R200_CLRCMP_FLIP_ENABLE (1 << 14)
-#define R200_SEPARATE_ALPHA_ENABLE (1 << 16)
-#define R200_RB3D_COLOROFFSET 0x1c40
-#define R200_COLOROFFSET_MASK 0xfffffff0
-#define R200_RE_WIDTH_HEIGHT 0x1c44
-#define R200_RE_WIDTH_SHIFT 0
-#define R200_RE_HEIGHT_SHIFT 16
-#define R200_RB3D_COLORPITCH 0x1c48
-#define R200_COLORPITCH_MASK 0x000001ff8
-#define R200_COLOR_ENDIAN_NO_SWAP (0 << 18)
-#define R200_COLOR_ENDIAN_WORD_SWAP (1 << 18)
-#define R200_COLOR_ENDIAN_DWORD_SWAP (2 << 18)
-#define R200_SE_CNTL 0x1c4c
-#define R200_FFACE_CULL_CW (0 << 0)
-#define R200_FFACE_CULL_CCW (1 << 0)
-#define R200_FFACE_CULL_DIR_MASK (1 << 0)
-#define R200_BFACE_CULL (0 << 1)
-#define R200_BFACE_SOLID (3 << 1)
-#define R200_FFACE_CULL (0 << 3)
-#define R200_FFACE_SOLID (3 << 3)
-#define R200_FFACE_CULL_MASK (3 << 3)
-#define R200_FLAT_SHADE_VTX_0 (0 << 6)
-#define R200_FLAT_SHADE_VTX_1 (1 << 6)
-#define R200_FLAT_SHADE_VTX_2 (2 << 6)
-#define R200_FLAT_SHADE_VTX_LAST (3 << 6)
-#define R200_DIFFUSE_SHADE_SOLID (0 << 8)
-#define R200_DIFFUSE_SHADE_FLAT (1 << 8)
-#define R200_DIFFUSE_SHADE_GOURAUD (2 << 8)
-#define R200_DIFFUSE_SHADE_MASK (3 << 8)
-#define R200_ALPHA_SHADE_SOLID (0 << 10)
-#define R200_ALPHA_SHADE_FLAT (1 << 10)
-#define R200_ALPHA_SHADE_GOURAUD (2 << 10)
-#define R200_ALPHA_SHADE_MASK (3 << 10)
-#define R200_SPECULAR_SHADE_SOLID (0 << 12)
-#define R200_SPECULAR_SHADE_FLAT (1 << 12)
-#define R200_SPECULAR_SHADE_GOURAUD (2 << 12)
-#define R200_SPECULAR_SHADE_MASK (3 << 12)
-#define R200_FOG_SHADE_SOLID (0 << 14)
-#define R200_FOG_SHADE_FLAT (1 << 14)
-#define R200_FOG_SHADE_GOURAUD (2 << 14)
-#define R200_FOG_SHADE_MASK (3 << 14)
-#define R200_ZBIAS_ENABLE_POINT (1 << 16)
-#define R200_ZBIAS_ENABLE_LINE (1 << 17)
-#define R200_ZBIAS_ENABLE_TRI (1 << 18)
-#define R200_WIDELINE_ENABLE (1 << 20)
-#define R200_VTX_PIX_CENTER_D3D (0 << 27)
-#define R200_VTX_PIX_CENTER_OGL (1 << 27)
-#define R200_ROUND_MODE_TRUNC (0 << 28)
-#define R200_ROUND_MODE_ROUND (1 << 28)
-#define R200_ROUND_MODE_ROUND_EVEN (2 << 28)
-#define R200_ROUND_MODE_ROUND_ODD (3 << 28)
-#define R200_ROUND_PREC_16TH_PIX (0 << 30)
-#define R200_ROUND_PREC_8TH_PIX (1 << 30)
-#define R200_ROUND_PREC_4TH_PIX (2 << 30)
-#define R200_ROUND_PREC_HALF_PIX (3 << 30)
-#define R200_RE_CNTL 0x1c50
-#define R200_STIPPLE_ENABLE 0x1
-#define R200_SCISSOR_ENABLE 0x2
-#define R200_PATTERN_ENABLE 0x4
-#define R200_PERSPECTIVE_ENABLE 0x8
-#define R200_POINT_SMOOTH 0x20
-#define R200_VTX_STQ0_D3D 0x00010000
-#define R200_VTX_STQ1_D3D 0x00040000
-#define R200_VTX_STQ2_D3D 0x00100000
-#define R200_VTX_STQ3_D3D 0x00400000
-#define R200_VTX_STQ4_D3D 0x01000000
-#define R200_VTX_STQ5_D3D 0x04000000
-/* gap */
-#define R200_RE_STIPPLE_ADDR 0x1cc8
-#define R200_RE_STIPPLE_DATA 0x1ccc
-#define R200_RE_LINE_PATTERN 0x1cd0
-#define R200_LINE_PATTERN_MASK 0x0000ffff
-#define R200_LINE_REPEAT_COUNT_SHIFT 16
-#define R200_LINE_PATTERN_START_SHIFT 24
-#define R200_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28)
-#define R200_LINE_PATTERN_BIG_BIT_ORDER (1 << 28)
-#define R200_LINE_PATTERN_AUTO_RESET (1 << 29)
-#define R200_RE_LINE_STATE 0x1cd4
-#define R200_LINE_CURRENT_PTR_SHIFT 0
-#define R200_LINE_CURRENT_COUNT_SHIFT 8
-#define R200_RE_SCISSOR_TL_0 0x1cd8
-#define R200_RE_SCISSOR_BR_0 0x1cdc
-#define R200_RE_SCISSOR_TL_1 0x1ce0
-#define R200_RE_SCISSOR_BR_1 0x1ce4
-#define R200_RE_SCISSOR_TL_2 0x1ce8
-#define R200_RE_SCISSOR_BR_2 0x1cec
-/* gap */
-#define R200_RB3D_DEPTHXY_OFFSET 0x1d60
-#define R200_DEPTHX_SHIFT 0
-#define R200_DEPTHY_SHIFT 16
-/* gap */
-#define R200_RB3D_STENCILREFMASK 0x1d7c
-#define R200_STENCIL_REF_SHIFT 0
-#define R200_STENCIL_REF_MASK (0xff << 0)
-#define R200_STENCIL_MASK_SHIFT 16
-#define R200_STENCIL_VALUE_MASK (0xff << 16)
-#define R200_STENCIL_WRITEMASK_SHIFT 24
-#define R200_STENCIL_WRITE_MASK (0xff << 24)
-#define R200_RB3D_ROPCNTL 0x1d80
-#define R200_ROP_MASK (15 << 8)
-#define R200_ROP_CLEAR (0 << 8)
-#define R200_ROP_NOR (1 << 8)
-#define R200_ROP_AND_INVERTED (2 << 8)
-#define R200_ROP_COPY_INVERTED (3 << 8)
-#define R200_ROP_AND_REVERSE (4 << 8)
-#define R200_ROP_INVERT (5 << 8)
-#define R200_ROP_XOR (6 << 8)
-#define R200_ROP_NAND (7 << 8)
-#define R200_ROP_AND (8 << 8)
-#define R200_ROP_EQUIV (9 << 8)
-#define R200_ROP_NOOP (10 << 8)
-#define R200_ROP_OR_INVERTED (11 << 8)
-#define R200_ROP_COPY (12 << 8)
-#define R200_ROP_OR_REVERSE (13 << 8)
-#define R200_ROP_OR (14 << 8)
-#define R200_ROP_SET (15 << 8)
-#define R200_RB3D_PLANEMASK 0x1d84
-/* gap */
-#define R200_SE_VPORT_XSCALE 0x1d98
-#define R200_SE_VPORT_XOFFSET 0x1d9c
-#define R200_SE_VPORT_YSCALE 0x1da0
-#define R200_SE_VPORT_YOFFSET 0x1da4
-#define R200_SE_VPORT_ZSCALE 0x1da8
-#define R200_SE_VPORT_ZOFFSET 0x1dac
-#define R200_SE_ZBIAS_FACTOR 0x1db0
-#define R200_SE_ZBIAS_CONSTANT 0x1db4
-#define R200_SE_LINE_WIDTH 0x1db8
-#define R200_LINE_WIDTH_SHIFT 0x00000000
-#define R200_MINPOINTSIZE_SHIFT 0x00000010
-/* gap */
-#define R200_SE_VAP_CNTL 0x2080
-#define R200_VAP_TCL_ENABLE 0x00000001
-#define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010
-#define R200_VAP_FORCE_W_TO_ONE 0x00010000
-#define R200_VAP_D3D_TEX_DEFAULT 0x00020000
-#define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18
-#define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000
-#define R200_SE_VF_CNTL 0x2084
-#define R200_VF_PRIM_NONE 0x00000000
-#define R200_VF_PRIM_POINTS 0x00000001
-#define R200_VF_PRIM_LINES 0x00000002
-#define R200_VF_PRIM_LINE_STRIP 0x00000003
-#define R200_VF_PRIM_TRIANGLES 0x00000004
-#define R200_VF_PRIM_TRIANGLE_FAN 0x00000005
-#define R200_VF_PRIM_TRIANGLE_STRIP 0x00000006
-#define R200_VF_PRIM_RECT_LIST 0x00000008
-#define R200_VF_PRIM_3VRT_POINTS 0x00000009
-#define R200_VF_PRIM_3VRT_LINES 0x0000000a
-#define R200_VF_PRIM_POINT_SPRITES 0x0000000b
-#define R200_VF_PRIM_LINE_LOOP 0x0000000c
-#define R200_VF_PRIM_QUADS 0x0000000d
-#define R200_VF_PRIM_QUAD_STRIP 0x0000000e
-#define R200_VF_PRIM_POLYGON 0x0000000f
-#define R200_VF_PRIM_MASK 0x0000000f
-#define R200_VF_PRIM_WALK_IND 0x00000010
-#define R200_VF_PRIM_WALK_LIST 0x00000020
-#define R200_VF_PRIM_WALK_RING 0x00000030
-#define R200_VF_PRIM_WALK_MASK 0x00000030
-#define R200_VF_COLOR_ORDER_RGBA 0x00000040
-#define R200_VF_TCL_OUTPUT_VTX_ENABLE 0x00000200
-#define R200_VF_INDEX_SZ_4 0x00000800
-#define R200_VF_VERTEX_NUMBER_MASK 0xffff0000
-#define R200_VF_VERTEX_NUMBER_SHIFT 16
-#define R200_SE_VTX_FMT_0 0x2088
-#define R200_VTX_XY 0 /* always have xy */
-#define R200_VTX_Z0 (1<<0)
-#define R200_VTX_W0 (1<<1)
-#define R200_VTX_WEIGHT_COUNT_SHIFT (2)
-#define R200_VTX_PV_MATRIX_SEL (1<<5)
-#define R200_VTX_N0 (1<<6)
-#define R200_VTX_POINT_SIZE (1<<7)
-#define R200_VTX_DISCRETE_FOG (1<<8)
-#define R200_VTX_SHININESS_0 (1<<9)
-#define R200_VTX_SHININESS_1 (1<<10)
-#define R200_VTX_COLOR_NOT_PRESENT 0
-#define R200_VTX_PK_RGBA 1
-#define R200_VTX_FP_RGB 2
-#define R200_VTX_FP_RGBA 3
-#define R200_VTX_COLOR_MASK 3
-#define R200_VTX_COLOR_0_SHIFT 11
-#define R200_VTX_COLOR_1_SHIFT 13
-#define R200_VTX_COLOR_2_SHIFT 15
-#define R200_VTX_COLOR_3_SHIFT 17
-#define R200_VTX_COLOR_4_SHIFT 19
-#define R200_VTX_COLOR_5_SHIFT 21
-#define R200_VTX_COLOR_6_SHIFT 23
-#define R200_VTX_COLOR_7_SHIFT 25
-#define R200_VTX_XY1 (1<<28)
-#define R200_VTX_Z1 (1<<29)
-#define R200_VTX_W1 (1<<30)
-#define R200_VTX_N1 (1<<31)
-#define R200_SE_VTX_FMT_1 0x208c
-#define R200_VTX_TEX0_COMP_CNT_SHIFT 0
-#define R200_VTX_TEX1_COMP_CNT_SHIFT 3
-#define R200_VTX_TEX2_COMP_CNT_SHIFT 6
-#define R200_VTX_TEX3_COMP_CNT_SHIFT 9
-#define R200_VTX_TEX4_COMP_CNT_SHIFT 12
-#define R200_VTX_TEX5_COMP_CNT_SHIFT 15
-#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090
-#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094
-/* gap */
-#define R200_SE_VTE_CNTL 0x20b0
-#define R200_VPORT_X_SCALE_ENA 0x00000001
-#define R200_VPORT_X_OFFSET_ENA 0x00000002
-#define R200_VPORT_Y_SCALE_ENA 0x00000004
-#define R200_VPORT_Y_OFFSET_ENA 0x00000008
-#define R200_VPORT_Z_SCALE_ENA 0x00000010
-#define R200_VPORT_Z_OFFSET_ENA 0x00000020
-#define R200_VTX_XY_FMT 0x00000100
-#define R200_VTX_Z_FMT 0x00000200
-#define R200_VTX_W0_FMT 0x00000400
-#define R200_VTX_W0_NORMALIZE 0x00000800
-#define R200_VTX_ST_DENORMALIZED 0x00001000
-/* gap */
-#define R200_SE_VTX_NUM_ARRAYS 0x20c0
-#define R200_SE_VTX_AOS_ATTR01 0x20c4
-#define R200_SE_VTX_AOS_ADDR0 0x20c8
-#define R200_SE_VTX_AOS_ADDR1 0x20cc
-#define R200_SE_VTX_AOS_ATTR23 0x20d0
-#define R200_SE_VTX_AOS_ADDR2 0x20d4
-#define R200_SE_VTX_AOS_ADDR3 0x20d8
-#define R200_SE_VTX_AOS_ATTR45 0x20dc
-#define R200_SE_VTX_AOS_ADDR4 0x20e0
-#define R200_SE_VTX_AOS_ADDR5 0x20e4
-#define R200_SE_VTX_AOS_ATTR67 0x20e8
-#define R200_SE_VTX_AOS_ADDR6 0x20ec
-#define R200_SE_VTX_AOS_ADDR7 0x20f0
-#define R200_SE_VTX_AOS_ATTR89 0x20f4
-#define R200_SE_VTX_AOS_ADDR8 0x20f8
-#define R200_SE_VTX_AOS_ADDR9 0x20fc
-#define R200_SE_VTX_AOS_ATTR1011 0x2100
-#define R200_SE_VTX_AOS_ADDR10 0x2104
-#define R200_SE_VTX_AOS_ADDR11 0x2108
-#define R200_SE_VF_MAX_VTX_INDX 0x210c
-#define R200_SE_VF_MIN_VTX_INDX 0x2110
-/* gap */
-#define R200_SE_VAP_CNTL_STATUS 0x2140
-#define R200_VC_NO_SWAP (0 << 0)
-#define R200_VC_16BIT_SWAP (1 << 0)
-#define R200_VC_32BIT_SWAP (2 << 0)
-/* gap */
-#define R200_SE_VTX_STATE_CNTL 0x2180
-#define R200_VSC_COLOR_0_ASSEMBLY_CNTL_SHIFT 0x00000000
-#define R200_VSC_COLOR_1_ASSEMBLY_CNTL_SHIFT 0x00000002
-#define R200_VSC_COLOR_2_ASSEMBLY_CNTL_SHIFT 0x00000004
-#define R200_VSC_COLOR_3_ASSEMBLY_CNTL_SHIFT 0x00000006
-#define R200_VSC_COLOR_4_ASSEMBLY_CNTL_SHIFT 0x00000008
-#define R200_VSC_COLOR_5_ASSEMBLY_CNTL_SHIFT 0x0000000a
-#define R200_VSC_COLOR_6_ASSEMBLY_CNTL_SHIFT 0x0000000c
-#define R200_VSC_COLOR_7_ASSEMBLY_CNTL_SHIFT 0x0000000e
-#define R200_VSC_UPDATE_USER_COLOR_0_ENABLE 0x00010000
-#define R200_VSC_UPDATE_USER_COLOR_1_ENABLE 0x00020000
-/* gap */
-#define R200_SE_TCL_VECTOR_INDX_REG 0x2200
-#define R200_SE_TCL_VECTOR_DATA_REG 0x2204
-#define R200_SE_TCL_SCALAR_INDX_REG 0x2208
-#define R200_SE_TCL_SCALAR_DATA_REG 0x220c
-/* gap */
-#define R200_SE_TCL_MATRIX_SEL_0 0x2230
-#define R200_MODELVIEW_0_SHIFT (0)
-#define R200_MODELVIEW_1_SHIFT (8)
-#define R200_MODELVIEW_2_SHIFT (16)
-#define R200_MODELVIEW_3_SHIFT (24)
-#define R200_SE_TCL_MATRIX_SEL_1 0x2234
-#define R200_IT_MODELVIEW_0_SHIFT (0)
-#define R200_IT_MODELVIEW_1_SHIFT (8)
-#define R200_IT_MODELVIEW_2_SHIFT (16)
-#define R200_IT_MODELVIEW_3_SHIFT (24)
-#define R200_SE_TCL_MATRIX_SEL_2 0x2238
-#define R200_MODELPROJECT_0_SHIFT (0)
-#define R200_MODELPROJECT_1_SHIFT (8)
-#define R200_MODELPROJECT_2_SHIFT (16)
-#define R200_MODELPROJECT_3_SHIFT (24)
-#define R200_SE_TCL_MATRIX_SEL_3 0x223c
-#define R200_TEXMAT_0_SHIFT 0
-#define R200_TEXMAT_1_SHIFT 8
-#define R200_TEXMAT_2_SHIFT 16
-#define R200_TEXMAT_3_SHIFT 24
-#define R200_SE_TCL_MATRIX_SEL_4 0x2240
-#define R200_TEXMAT_4_SHIFT 0
-#define R200_TEXMAT_5_SHIFT 8
-/* gap */
-#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250
-#define R200_OUTPUT_XYZW (1<<0)
-#define R200_OUTPUT_COLOR_0 (1<<8)
-#define R200_OUTPUT_COLOR_1 (1<<9)
-#define R200_OUTPUT_TEX_0 (1<<16)
-#define R200_OUTPUT_TEX_1 (1<<17)
-#define R200_OUTPUT_TEX_2 (1<<18)
-#define R200_OUTPUT_TEX_3 (1<<19)
-#define R200_OUTPUT_TEX_4 (1<<20)
-#define R200_OUTPUT_TEX_5 (1<<21)
-#define R200_OUTPUT_TEX_MASK (0x3f<<16)
-#define R200_OUTPUT_DISCRETE_FOG (1<<24)
-#define R200_OUTPUT_PT_SIZE (1<<25)
-#define R200_FORCE_INORDER_PROC (1<<31)
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0 0x2254
-#define R200_VERTEX_POSITION_ADDR__SHIFT 0x00000000
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1 0x2258
-#define R200_VTX_COLOR_0_ADDR__SHIFT 0x00000000
-#define R200_VTX_COLOR_1_ADDR__SHIFT 0x00000008
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2 0x225c
-#define R200_VTX_TEX_0_ADDR__SHIFT 0x00000000
-#define R200_VTX_TEX_1_ADDR__SHIFT 0x00000008
-#define R200_VTX_TEX_2_ADDR__SHIFT 0x00000010
-#define R200_VTX_TEX_3_ADDR__SHIFT 0x00000018
-#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3 0x2260
-#define R200_VTX_TEX_4_ADDR__SHIFT 0x00000000
-#define R200_VTX_TEX_5_ADDR__SHIFT 0x00000008
-
-/* gap */
-#define R200_SE_TCL_LIGHT_MODEL_CTL_0 0x2268
-#define R200_LIGHTING_ENABLE (1<<0)
-#define R200_LIGHT_IN_MODELSPACE (1<<1)
-#define R200_LOCAL_VIEWER (1<<2)
-#define R200_NORMALIZE_NORMALS (1<<3)
-#define R200_RESCALE_NORMALS (1<<4)
-#define R200_SPECULAR_LIGHTS (1<<5)
-#define R200_DIFFUSE_SPECULAR_COMBINE (1<<6)
-#define R200_LIGHT_ALPHA (1<<7)
-#define R200_LOCAL_LIGHT_VEC_GL (1<<8)
-#define R200_LIGHT_NO_NORMAL_AMBIENT_ONLY (1<<9)
-#define R200_LIGHT_TWOSIDE (1<<10)
-#define R200_FRONT_SHININESS_SOURCE_SHIFT (0xb)
-#define R200_BACK_SHININESS_SOURCE_SHIFT (0xd)
-#define R200_LM0_SOURCE_MATERIAL_0 (0)
-#define R200_LM0_SOURCE_MATERIAL_1 (1)
-#define R200_LM0_SOURCE_VERTEX_SHININESS_0 (2)
-#define R200_LM0_SOURCE_VERTEX_SHININESS_1 (3)
-#define R200_SE_TCL_LIGHT_MODEL_CTL_1 0x226c
-#define R200_LM1_SOURCE_LIGHT_PREMULT (0)
-#define R200_LM1_SOURCE_MATERIAL_0 (1)
-#define R200_LM1_SOURCE_VERTEX_COLOR_0 (2)
-#define R200_LM1_SOURCE_VERTEX_COLOR_1 (3)
-#define R200_LM1_SOURCE_VERTEX_COLOR_2 (4)
-#define R200_LM1_SOURCE_VERTEX_COLOR_3 (5)
-#define R200_LM1_SOURCE_VERTEX_COLOR_4 (6)
-#define R200_LM1_SOURCE_VERTEX_COLOR_5 (7)
-#define R200_LM1_SOURCE_VERTEX_COLOR_6 (8)
-#define R200_LM1_SOURCE_VERTEX_COLOR_7 (9)
-#define R200_LM1_SOURCE_MATERIAL_1 (0xf)
-#define R200_FRONT_EMISSIVE_SOURCE_SHIFT (0)
-#define R200_FRONT_AMBIENT_SOURCE_SHIFT (4)
-#define R200_FRONT_DIFFUSE_SOURCE_SHIFT (8)
-#define R200_FRONT_SPECULAR_SOURCE_SHIFT (12)
-#define R200_BACK_EMISSIVE_SOURCE_SHIFT (16)
-#define R200_BACK_AMBIENT_SOURCE_SHIFT (20)
-#define R200_BACK_DIFFUSE_SOURCE_SHIFT (24)
-#define R200_BACK_SPECULAR_SOURCE_SHIFT (28)
-#define R200_SE_TCL_PER_LIGHT_CTL_0 0x2270
-#define R200_LIGHT_0_ENABLE (1<<0)
-#define R200_LIGHT_0_ENABLE_AMBIENT (1<<1)
-#define R200_LIGHT_0_ENABLE_SPECULAR (1<<2)
-#define R200_LIGHT_0_IS_LOCAL (1<<3)
-#define R200_LIGHT_0_IS_SPOT (1<<4)
-#define R200_LIGHT_0_DUAL_CONE (1<<5)
-#define R200_LIGHT_0_ENABLE_RANGE_ATTEN (1<<6)
-#define R200_LIGHT_0_CONSTANT_RANGE_ATTEN (1<<7)
-#define R200_LIGHT_1_ENABLE (1<<16)
-#define R200_LIGHT_1_ENABLE_AMBIENT (1<<17)
-#define R200_LIGHT_1_ENABLE_SPECULAR (1<<18)
-#define R200_LIGHT_1_IS_LOCAL (1<<19)
-#define R200_LIGHT_1_IS_SPOT (1<<20)
-#define R200_LIGHT_1_DUAL_CONE (1<<21)
-#define R200_LIGHT_1_ENABLE_RANGE_ATTEN (1<<22)
-#define R200_LIGHT_1_CONSTANT_RANGE_ATTEN (1<<23)
-#define R200_LIGHT_0_SHIFT (0)
-#define R200_LIGHT_1_SHIFT (16)
-#define R200_SE_TCL_PER_LIGHT_CTL_1 0x2274
-#define R200_LIGHT_2_SHIFT (0)
-#define R200_LIGHT_3_SHIFT (16)
-#define R200_SE_TCL_PER_LIGHT_CTL_2 0x2278
-#define R200_LIGHT_4_SHIFT (0)
-#define R200_LIGHT_5_SHIFT (16)
-#define R200_SE_TCL_PER_LIGHT_CTL_3 0x227c
-#define R200_LIGHT_6_SHIFT (0)
-#define R200_LIGHT_7_SHIFT (16)
-/* gap */
-#define R200_SE_TCL_TEX_PROC_CTL_2 0x22a8
-#define R200_TEXGEN_0_COMP_MASK_SHIFT (0)
-#define R200_TEXGEN_1_COMP_MASK_SHIFT (4)
-#define R200_TEXGEN_2_COMP_MASK_SHIFT (8)
-#define R200_TEXGEN_3_COMP_MASK_SHIFT (12)
-#define R200_TEXGEN_4_COMP_MASK_SHIFT (16)
-#define R200_TEXGEN_5_COMP_MASK_SHIFT (20)
-#define R200_SE_TCL_TEX_PROC_CTL_3 0x22ac
-#define R200_TEXGEN_0_INPUT_TEX_SHIFT (0)
-#define R200_TEXGEN_1_INPUT_TEX_SHIFT (4)
-#define R200_TEXGEN_2_INPUT_TEX_SHIFT (8)
-#define R200_TEXGEN_3_INPUT_TEX_SHIFT (12)
-#define R200_TEXGEN_4_INPUT_TEX_SHIFT (16)
-#define R200_TEXGEN_5_INPUT_TEX_SHIFT (20)
-#define R200_SE_TCL_TEX_PROC_CTL_0 0x22b0
-#define R200_TEXGEN_TEXMAT_0_ENABLE (1<<0)
-#define R200_TEXGEN_TEXMAT_1_ENABLE (1<<1)
-#define R200_TEXGEN_TEXMAT_2_ENABLE (1<<2)
-#define R200_TEXGEN_TEXMAT_3_ENABLE (1<<3)
-#define R200_TEXGEN_TEXMAT_4_ENABLE (1<<4)
-#define R200_TEXGEN_TEXMAT_5_ENABLE (1<<5)
-#define R200_TEXMAT_0_ENABLE (1<<8)
-#define R200_TEXMAT_1_ENABLE (1<<9)
-#define R200_TEXMAT_2_ENABLE (1<<10)
-#define R200_TEXMAT_3_ENABLE (1<<11)
-#define R200_TEXMAT_4_ENABLE (1<<12)
-#define R200_TEXMAT_5_ENABLE (1<<13)
-#define R200_TEXGEN_FORCE_W_TO_ONE (1<<16)
-#define R200_SE_TCL_TEX_PROC_CTL_1 0x22b4
-#define R200_TEXGEN_INPUT_MASK (0xf)
-#define R200_TEXGEN_INPUT_TEXCOORD_0 (0)
-#define R200_TEXGEN_INPUT_TEXCOORD_1 (1)
-#define R200_TEXGEN_INPUT_TEXCOORD_2 (2)
-#define R200_TEXGEN_INPUT_TEXCOORD_3 (3)
-#define R200_TEXGEN_INPUT_TEXCOORD_4 (4)
-#define R200_TEXGEN_INPUT_TEXCOORD_5 (5)
-#define R200_TEXGEN_INPUT_OBJ (8)
-#define R200_TEXGEN_INPUT_EYE (9)
-#define R200_TEXGEN_INPUT_EYE_NORMAL (0xa)
-#define R200_TEXGEN_INPUT_EYE_REFLECT (0xb)
-#define R200_TEXGEN_INPUT_SPHERE (0xd)
-#define R200_TEXGEN_0_INPUT_SHIFT (0)
-#define R200_TEXGEN_1_INPUT_SHIFT (4)
-#define R200_TEXGEN_2_INPUT_SHIFT (8)
-#define R200_TEXGEN_3_INPUT_SHIFT (12)
-#define R200_TEXGEN_4_INPUT_SHIFT (16)
-#define R200_TEXGEN_5_INPUT_SHIFT (20)
-#define R200_SE_TC_TEX_CYL_WRAP_CTL 0x22b8
-/* gap */
-#define R200_SE_TCL_UCP_VERT_BLEND_CTL 0x22c0
-#define R200_UCP_IN_CLIP_SPACE (1<<0)
-#define R200_UCP_IN_MODEL_SPACE (1<<1)
-#define R200_UCP_ENABLE_0 (1<<2)
-#define R200_UCP_ENABLE_1 (1<<3)
-#define R200_UCP_ENABLE_2 (1<<4)
-#define R200_UCP_ENABLE_3 (1<<5)
-#define R200_UCP_ENABLE_4 (1<<6)
-#define R200_UCP_ENABLE_5 (1<<7)
-#define R200_TCL_FOG_MASK (3<<8)
-#define R200_TCL_FOG_DISABLE (0<<8)
-#define R200_TCL_FOG_EXP (1<<8)
-#define R200_TCL_FOG_EXP2 (2<<8)
-#define R200_TCL_FOG_LINEAR (3<<8)
-#define R200_RNG_BASED_FOG (1<<10)
-#define R200_CLIP_DISABLE (1<<11)
-#define R200_CULL_FRONT_IS_CW (0<<28)
-#define R200_CULL_FRONT_IS_CCW (1<<28)
-#define R200_CULL_FRONT (1<<29)
-#define R200_CULL_BACK (1<<30)
-#define R200_SE_TCL_POINT_SPRITE_CNTL 0x22c4
-/* gap */
-#define R200_SE_VTX_ST_POS_0_X_4 0x2300
-#define R200_SE_VTX_ST_POS_0_Y_4 0x2304
-#define R200_SE_VTX_ST_POS_0_Z_4 0x2308
-#define R200_SE_VTX_ST_POS_0_W_4 0x230c
-#define R200_SE_VTX_ST_NORM_0_X 0x2310
-#define R200_SE_VTX_ST_NORM_0_Y 0x2314
-#define R200_SE_VTX_ST_NORM_0_Z 0x2318
-#define R200_SE_VTX_ST_PVMS 0x231c
-#define R200_SE_VTX_ST_CLR_0_R 0x2320
-#define R200_SE_VTX_ST_CLR_0_G 0x2324
-#define R200_SE_VTX_ST_CLR_0_B 0x2328
-#define R200_SE_VTX_ST_CLR_0_A 0x232c
-#define R200_SE_VTX_ST_CLR_1_R 0x2330
-#define R200_SE_VTX_ST_CLR_1_G 0x2334
-#define R200_SE_VTX_ST_CLR_1_B 0x2338
-#define R200_SE_VTX_ST_CLR_1_A 0x233c
-#define R200_SE_VTX_ST_CLR_2_R 0x2340
-#define R200_SE_VTX_ST_CLR_2_G 0x2344
-#define R200_SE_VTX_ST_CLR_2_B 0x2348
-#define R200_SE_VTX_ST_CLR_2_A 0x234c
-#define R200_SE_VTX_ST_CLR_3_R 0x2350
-#define R200_SE_VTX_ST_CLR_3_G 0x2354
-#define R200_SE_VTX_ST_CLR_3_B 0x2358
-#define R200_SE_VTX_ST_CLR_3_A 0x235c
-#define R200_SE_VTX_ST_CLR_4_R 0x2360
-#define R200_SE_VTX_ST_CLR_4_G 0x2364
-#define R200_SE_VTX_ST_CLR_4_B 0x2368
-#define R200_SE_VTX_ST_CLR_4_A 0x236c
-#define R200_SE_VTX_ST_CLR_5_R 0x2370
-#define R200_SE_VTX_ST_CLR_5_G 0x2374
-#define R200_SE_VTX_ST_CLR_5_B 0x2378
-#define R200_SE_VTX_ST_CLR_5_A 0x237c
-#define R200_SE_VTX_ST_CLR_6_R 0x2380
-#define R200_SE_VTX_ST_CLR_6_G 0x2384
-#define R200_SE_VTX_ST_CLR_6_B 0x2388
-#define R200_SE_VTX_ST_CLR_6_A 0x238c
-#define R200_SE_VTX_ST_CLR_7_R 0x2390
-#define R200_SE_VTX_ST_CLR_7_G 0x2394
-#define R200_SE_VTX_ST_CLR_7_B 0x2398
-#define R200_SE_VTX_ST_CLR_7_A 0x239c
-#define R200_SE_VTX_ST_TEX_0_S 0x23a0
-#define R200_SE_VTX_ST_TEX_0_T 0x23a4
-#define R200_SE_VTX_ST_TEX_0_R 0x23a8
-#define R200_SE_VTX_ST_TEX_0_Q 0x23ac
-#define R200_SE_VTX_ST_TEX_1_S 0x23b0
-#define R200_SE_VTX_ST_TEX_1_T 0x23b4
-#define R200_SE_VTX_ST_TEX_1_R 0x23b8
-#define R200_SE_VTX_ST_TEX_1_Q 0x23bc
-#define R200_SE_VTX_ST_TEX_2_S 0x23c0
-#define R200_SE_VTX_ST_TEX_2_T 0x23c4
-#define R200_SE_VTX_ST_TEX_2_R 0x23c8
-#define R200_SE_VTX_ST_TEX_2_Q 0x23cc
-#define R200_SE_VTX_ST_TEX_3_S 0x23d0
-#define R200_SE_VTX_ST_TEX_3_T 0x23d4
-#define R200_SE_VTX_ST_TEX_3_R 0x23d8
-#define R200_SE_VTX_ST_TEX_3_Q 0x23dc
-#define R200_SE_VTX_ST_TEX_4_S 0x23e0
-#define R200_SE_VTX_ST_TEX_4_T 0x23e4
-#define R200_SE_VTX_ST_TEX_4_R 0x23e8
-#define R200_SE_VTX_ST_TEX_4_Q 0x23ec
-#define R200_SE_VTX_ST_TEX_5_S 0x23f0
-#define R200_SE_VTX_ST_TEX_5_T 0x23f4
-#define R200_SE_VTX_ST_TEX_5_R 0x23f8
-#define R200_SE_VTX_ST_TEX_5_Q 0x23fc
-#define R200_SE_VTX_ST_PNT_SPRT_SZ 0x2400
-#define R200_SE_VTX_ST_DISC_FOG 0x2404
-#define R200_SE_VTX_ST_SHININESS_0 0x2408
-#define R200_SE_VTX_ST_SHININESS_1 0x240c
-#define R200_SE_VTX_ST_BLND_WT_0 0x2410
-#define R200_SE_VTX_ST_BLND_WT_1 0x2414
-#define R200_SE_VTX_ST_BLND_WT_2 0x2418
-#define R200_SE_VTX_ST_BLND_WT_3 0x241c
-#define R200_SE_VTX_ST_POS_1_X 0x2420
-#define R200_SE_VTX_ST_POS_1_Y 0x2424
-#define R200_SE_VTX_ST_POS_1_Z 0x2428
-#define R200_SE_VTX_ST_POS_1_W 0x242c
-#define R200_SE_VTX_ST_NORM_1_X 0x2430
-#define R200_SE_VTX_ST_NORM_1_Y 0x2434
-#define R200_SE_VTX_ST_NORM_1_Z 0x2438
-#define R200_SE_VTX_ST_USR_CLR_0_R 0x2440
-#define R200_SE_VTX_ST_USR_CLR_0_G 0x2444
-#define R200_SE_VTX_ST_USR_CLR_0_B 0x2448
-#define R200_SE_VTX_ST_USR_CLR_0_A 0x244c
-#define R200_SE_VTX_ST_USR_CLR_1_R 0x2450
-#define R200_SE_VTX_ST_USR_CLR_1_G 0x2454
-#define R200_SE_VTX_ST_USR_CLR_1_B 0x2458
-#define R200_SE_VTX_ST_USR_CLR_1_A 0x245c
-#define R200_SE_VTX_ST_CLR_0_PKD 0x2460
-#define R200_SE_VTX_ST_CLR_1_PKD 0x2464
-#define R200_SE_VTX_ST_CLR_2_PKD 0x2468
-#define R200_SE_VTX_ST_CLR_3_PKD 0x246c
-#define R200_SE_VTX_ST_CLR_4_PKD 0x2470
-#define R200_SE_VTX_ST_CLR_5_PKD 0x2474
-#define R200_SE_VTX_ST_CLR_6_PKD 0x2478
-#define R200_SE_VTX_ST_CLR_7_PKD 0x247c
-#define R200_SE_VTX_ST_POS_0_X_2 0x2480
-#define R200_SE_VTX_ST_POS_0_Y_2 0x2484
-#define R200_SE_VTX_ST_PAR_CLR_LD 0x2488
-#define R200_SE_VTX_ST_USR_CLR_PKD 0x248c
-#define R200_SE_VTX_ST_POS_0_X_3 0x2490
-#define R200_SE_VTX_ST_POS_0_Y_3 0x2494
-#define R200_SE_VTX_ST_POS_0_Z_3 0x2498
-#define R200_SE_VTX_ST_END_OF_PKT 0x249c
-/* gap */
-#define R200_RE_POINTSIZE 0x2648
-#define R200_POINTSIZE_SHIFT 0
-#define R200_MAXPOINTSIZE_SHIFT 16
-/* gap */
-#define R200_RE_TOP_LEFT 0x26c0
-#define R200_RE_LEFT_SHIFT 0
-#define R200_RE_TOP_SHIFT 16
-#define R200_RE_MISC 0x26c4
-#define R200_STIPPLE_COORD_MASK 0x1f
-#define R200_STIPPLE_X_OFFSET_SHIFT 0
-#define R200_STIPPLE_X_OFFSET_MASK (0x1f << 0)
-#define R200_STIPPLE_Y_OFFSET_SHIFT 8
-#define R200_STIPPLE_Y_OFFSET_MASK (0x1f << 8)
-#define R200_STIPPLE_LITTLE_BIT_ORDER (0 << 16)
-#define R200_STIPPLE_BIG_BIT_ORDER (1 << 16)
-/* gap */
-#define R200_RE_AUX_SCISSOR_CNTL 0x26f0
-#define R200_EXCLUSIVE_SCISSOR_0 0x01000000
-#define R200_EXCLUSIVE_SCISSOR_1 0x02000000
-#define R200_EXCLUSIVE_SCISSOR_2 0x04000000
-#define R200_SCISSOR_ENABLE_0 0x10000000
-#define R200_SCISSOR_ENABLE_1 0x20000000
-#define R200_SCISSOR_ENABLE_2 0x40000000
-/* gap */
-#define R200_PP_TXFILTER_0 0x2c00
-#define R200_MAG_FILTER_NEAREST (0 << 0)
-#define R200_MAG_FILTER_LINEAR (1 << 0)
-#define R200_MAG_FILTER_MASK (1 << 0)
-#define R200_MIN_FILTER_NEAREST (0 << 1)
-#define R200_MIN_FILTER_LINEAR (1 << 1)
-#define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1)
-#define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1)
-#define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1)
-#define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1)
-#define R200_MIN_FILTER_ANISO_NEAREST (8 << 1)
-#define R200_MIN_FILTER_ANISO_LINEAR (9 << 1)
-#define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1)
-#define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1)
-#define R200_MIN_FILTER_MASK (15 << 1)
-#define R200_MAX_ANISO_1_TO_1 (0 << 5)
-#define R200_MAX_ANISO_2_TO_1 (1 << 5)
-#define R200_MAX_ANISO_4_TO_1 (2 << 5)
-#define R200_MAX_ANISO_8_TO_1 (3 << 5)
-#define R200_MAX_ANISO_16_TO_1 (4 << 5)
-#define R200_MAX_ANISO_MASK (7 << 5)
-#define R200_MAX_MIP_LEVEL_MASK (0x0f << 16)
-#define R200_MAX_MIP_LEVEL_SHIFT 16
-#define R200_YUV_TO_RGB (1 << 20)
-#define R200_YUV_TEMPERATURE_COOL (0 << 21)
-#define R200_YUV_TEMPERATURE_HOT (1 << 21)
-#define R200_YUV_TEMPERATURE_MASK (1 << 21)
-#define R200_WRAPEN_S (1 << 22)
-#define R200_CLAMP_S_WRAP (0 << 23)
-#define R200_CLAMP_S_MIRROR (1 << 23)
-#define R200_CLAMP_S_CLAMP_LAST (2 << 23)
-#define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23)
-#define R200_CLAMP_S_CLAMP_BORDER (4 << 23)
-#define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23)
-#define R200_CLAMP_S_CLAMP_GL (6 << 23)
-#define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23)
-#define R200_CLAMP_S_MASK (7 << 23)
-#define R200_WRAPEN_T (1 << 26)
-#define R200_CLAMP_T_WRAP (0 << 27)
-#define R200_CLAMP_T_MIRROR (1 << 27)
-#define R200_CLAMP_T_CLAMP_LAST (2 << 27)
-#define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27)
-#define R200_CLAMP_T_CLAMP_BORDER (4 << 27)
-#define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27)
-#define R200_CLAMP_T_CLAMP_GL (6 << 27)
-#define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27)
-#define R200_CLAMP_T_MASK (7 << 27)
-#define R200_KILL_LT_ZERO (1 << 30)
-#define R200_BORDER_MODE_OGL (0 << 31)
-#define R200_BORDER_MODE_D3D (1 << 31)
-#define R200_PP_TXFORMAT_0 0x2c04
-#define R200_TXFORMAT_I8 (0 << 0)
-#define R200_TXFORMAT_AI88 (1 << 0)
-#define R200_TXFORMAT_RGB332 (2 << 0)
-#define R200_TXFORMAT_ARGB1555 (3 << 0)
-#define R200_TXFORMAT_RGB565 (4 << 0)
-#define R200_TXFORMAT_ARGB4444 (5 << 0)
-#define R200_TXFORMAT_ARGB8888 (6 << 0)
-#define R200_TXFORMAT_RGBA8888 (7 << 0)
-#define R200_TXFORMAT_Y8 (8 << 0)
-#define R200_TXFORMAT_AVYU4444 (9 << 0)
-#define R200_TXFORMAT_VYUY422 (10 << 0)
-#define R200_TXFORMAT_YVYU422 (11 << 0)
-#define R200_TXFORMAT_DXT1 (12 << 0)
-#define R200_TXFORMAT_DXT23 (14 << 0)
-#define R200_TXFORMAT_DXT45 (15 << 0)
-#define R200_TXFORMAT_FORMAT_MASK (31 << 0)
-#define R200_TXFORMAT_FORMAT_SHIFT 0
-#define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6)
-#define R200_TXFORMAT_NON_POWER2 (1 << 7)
-#define R200_TXFORMAT_WIDTH_MASK (15 << 8)
-#define R200_TXFORMAT_WIDTH_SHIFT 8
-#define R200_TXFORMAT_HEIGHT_MASK (15 << 12)
-#define R200_TXFORMAT_HEIGHT_SHIFT 12
-#define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */
-#define R200_TXFORMAT_F5_WIDTH_SHIFT 16
-#define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20)
-#define R200_TXFORMAT_F5_HEIGHT_SHIFT 20
-#define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24)
-#define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)
-#define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)
-#define R200_TXFORMAT_ST_ROUTE_SHIFT 24
-#define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
-#define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
-#define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
-#define R200_PP_TXFORMAT_X_0 0x2c08
-#define R200_DEPTH_LOG2_MASK (0xf << 0)
-#define R200_DEPTH_LOG2_SHIFT 0
-#define R200_VOLUME_FILTER_SHIFT 4
-#define R200_VOLUME_FILTER_MASK (1 << 4)
-#define R200_VOLUME_FILTER_NEAREST (0 << 4)
-#define R200_VOLUME_FILTER_LINEAR (1 << 4)
-#define R200_WRAPEN_Q (1 << 8)
-#define R200_CLAMP_Q_WRAP (0 << 9)
-#define R200_CLAMP_Q_MIRROR (1 << 9)
-#define R200_CLAMP_Q_CLAMP_LAST (2 << 9)
-#define R200_CLAMP_Q_MIRROR_CLAMP_LAST (3 << 9)
-#define R200_CLAMP_Q_CLAMP_BORDER (4 << 9)
-#define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (5 << 9)
-#define R200_CLAMP_Q_CLAMP_GL (6 << 9)
-#define R200_CLAMP_Q_MIRROR_CLAMP_GL (7 << 9)
-#define R200_CLAMP_Q_MASK (7 << 9)
-#define R200_MIN_MIP_LEVEL_MASK (0xff << 12)
-#define R200_MIN_MIP_LEVEL_SHIFT 12
-#define R200_TEXCOORD_NONPROJ (0 << 16)
-#define R200_TEXCOORD_CUBIC_ENV (1 << 16)
-#define R200_TEXCOORD_VOLUME (2 << 16)
-#define R200_TEXCOORD_PROJ (3 << 16)
-#define R200_TEXCOORD_DEPTH (4 << 16)
-#define R200_TEXCOORD_1D_PROJ (5 << 16)
-#define R200_TEXCOORD_1D (6 << 16)
-#define R200_TEXCOORD_ZERO (7 << 16)
-#define R200_TEXCOORD_MASK (7 << 16)
-#define R200_LOD_BIAS_MASK (0xfff80000)
-#define R200_LOD_BIAS_SHIFT 19
-#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */
-#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */
-#define R200_PP_BORDER_COLOR_0 0x2c14
-#define R200_PP_CUBIC_FACES_0 0x2c18
-#define R200_FACE_WIDTH_1_SHIFT 0
-#define R200_FACE_HEIGHT_1_SHIFT 4
-#define R200_FACE_WIDTH_1_MASK (0xf << 0)
-#define R200_FACE_HEIGHT_1_MASK (0xf << 4)
-#define R200_FACE_WIDTH_2_SHIFT 8
-#define R200_FACE_HEIGHT_2_SHIFT 12
-#define R200_FACE_WIDTH_2_MASK (0xf << 8)
-#define R200_FACE_HEIGHT_2_MASK (0xf << 12)
-#define R200_FACE_WIDTH_3_SHIFT 16
-#define R200_FACE_HEIGHT_3_SHIFT 20
-#define R200_FACE_WIDTH_3_MASK (0xf << 16)
-#define R200_FACE_HEIGHT_3_MASK (0xf << 20)
-#define R200_FACE_WIDTH_4_SHIFT 24
-#define R200_FACE_HEIGHT_4_SHIFT 28
-#define R200_FACE_WIDTH_4_MASK (0xf << 24)
-#define R200_FACE_HEIGHT_4_MASK (0xf << 28)
-#define R200_PP_TXFILTER_1 0x2c20
-#define R200_PP_TXFORMAT_1 0x2c24
-#define R200_PP_TXFORMAT_X_1 0x2c28
-#define R200_PP_TXSIZE_1 0x2c2c
-#define R200_PP_TXPITCH_1 0x2c30
-#define R200_PP_BORDER_COLOR_1 0x2c34
-#define R200_PP_CUBIC_FACES_1 0x2c38
-#define R200_PP_TXFILTER_2 0x2c40
-#define R200_PP_TXFORMAT_2 0x2c44
-#define R200_PP_TXSIZE_2 0x2c4c
-#define R200_PP_TXFORMAT_X_2 0x2c48
-#define R200_PP_TXPITCH_2 0x2c50
-#define R200_PP_BORDER_COLOR_2 0x2c54
-#define R200_PP_CUBIC_FACES_2 0x2c58
-#define R200_PP_TXFILTER_3 0x2c60
-#define R200_PP_TXFORMAT_3 0x2c64
-#define R200_PP_TXSIZE_3 0x2c6c
-#define R200_PP_TXFORMAT_X_3 0x2c68
-#define R200_PP_TXPITCH_3 0x2c70
-#define R200_PP_BORDER_COLOR_3 0x2c74
-#define R200_PP_CUBIC_FACES_3 0x2c78
-#define R200_PP_TXFILTER_4 0x2c80
-#define R200_PP_TXFORMAT_4 0x2c84
-#define R200_PP_TXSIZE_4 0x2c8c
-#define R200_PP_TXFORMAT_X_4 0x2c88
-#define R200_PP_TXPITCH_4 0x2c90
-#define R200_PP_BORDER_COLOR_4 0x2c94
-#define R200_PP_CUBIC_FACES_4 0x2c98
-#define R200_PP_TXFILTER_5 0x2ca0
-#define R200_PP_TXFORMAT_5 0x2ca4
-#define R200_PP_TXSIZE_5 0x2cac
-#define R200_PP_TXFORMAT_X_5 0x2ca8
-#define R200_PP_TXPITCH_5 0x2cb0
-#define R200_PP_BORDER_COLOR_5 0x2cb4
-#define R200_PP_CUBIC_FACES_5 0x2cb8
-/* gap */
-#define R200_PP_CNTL_X 0x2cc4
-/* gap */
-#define R200_PP_TXOFFSET_0 0x2d00
-#define R200_TXO_ENDIAN_NO_SWAP (0 << 0)
-#define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0)
-#define R200_TXO_ENDIAN_WORD_SWAP (2 << 0)
-#define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
-#define R200_TXO_OFFSET_MASK 0xffffffe0
-#define R200_TXO_OFFSET_SHIFT 5
-#define R200_PP_CUBIC_OFFSET_F1_0 0x2d04
-#define R200_PP_CUBIC_OFFSET_F2_0 0x2d08
-#define R200_PP_CUBIC_OFFSET_F3_0 0x2d0c
-#define R200_PP_CUBIC_OFFSET_F4_0 0x2d10
-#define R200_PP_CUBIC_OFFSET_F5_0 0x2d14
-#define R200_PP_TXOFFSET_1 0x2d18
-#define R200_PP_CUBIC_OFFSET_F1_1 0x2d1c
-#define R200_PP_CUBIC_OFFSET_F2_1 0x2d20
-#define R200_PP_CUBIC_OFFSET_F3_1 0x2d24
-#define R200_PP_CUBIC_OFFSET_F4_1 0x2d28
-#define R200_PP_CUBIC_OFFSET_F5_1 0x2d2c
-#define R200_PP_TXOFFSET_2 0x2d30
-#define R200_PP_CUBIC_OFFSET_F1_2 0x2d34
-#define R200_PP_CUBIC_OFFSET_F2_2 0x2d38
-#define R200_PP_CUBIC_OFFSET_F3_2 0x2d3c
-#define R200_PP_CUBIC_OFFSET_F4_2 0x2d40
-#define R200_PP_CUBIC_OFFSET_F5_2 0x2d44
-#define R200_PP_TXOFFSET_3 0x2d48
-#define R200_PP_CUBIC_OFFSET_F1_3 0x2d4c
-#define R200_PP_CUBIC_OFFSET_F2_3 0x2d50
-#define R200_PP_CUBIC_OFFSET_F3_3 0x2d54
-#define R200_PP_CUBIC_OFFSET_F4_3 0x2d58
-#define R200_PP_CUBIC_OFFSET_F5_3 0x2d5c
-#define R200_PP_TXOFFSET_4 0x2d60
-#define R200_PP_CUBIC_OFFSET_F1_4 0x2d64
-#define R200_PP_CUBIC_OFFSET_F2_4 0x2d68
-#define R200_PP_CUBIC_OFFSET_F3_4 0x2d6c
-#define R200_PP_CUBIC_OFFSET_F4_4 0x2d70
-#define R200_PP_CUBIC_OFFSET_F5_4 0x2d74
-#define R200_PP_TXOFFSET_5 0x2d78
-#define R200_PP_CUBIC_OFFSET_F1_5 0x2d7c
-#define R200_PP_CUBIC_OFFSET_F2_5 0x2d80
-#define R200_PP_CUBIC_OFFSET_F3_5 0x2d84
-#define R200_PP_CUBIC_OFFSET_F4_5 0x2d88
-#define R200_PP_CUBIC_OFFSET_F5_5 0x2d8c
-/* gap */
-#define R200_PP_TAM_DEBUG3 0x2d9c
-/* gap */
-#define R200_PP_TFACTOR_0 0x2ee0
-#define R200_PP_TFACTOR_1 0x2ee4
-#define R200_PP_TFACTOR_2 0x2ee8
-#define R200_PP_TFACTOR_3 0x2eec
-#define R200_PP_TFACTOR_4 0x2ef0
-#define R200_PP_TFACTOR_5 0x2ef4
-/* gap */
-#define R200_PP_TXCBLEND_0 0x2f00
-#define R200_TXC_ARG_A_ZERO (0)
-#define R200_TXC_ARG_A_CURRENT_COLOR (2)
-#define R200_TXC_ARG_A_CURRENT_ALPHA (3)
-#define R200_TXC_ARG_A_DIFFUSE_COLOR (4)
-#define R200_TXC_ARG_A_DIFFUSE_ALPHA (5)
-#define R200_TXC_ARG_A_SPECULAR_COLOR (6)
-#define R200_TXC_ARG_A_SPECULAR_ALPHA (7)
-#define R200_TXC_ARG_A_TFACTOR_COLOR (8)
-#define R200_TXC_ARG_A_TFACTOR_ALPHA (9)
-#define R200_TXC_ARG_A_R0_COLOR (10)
-#define R200_TXC_ARG_A_R0_ALPHA (11)
-#define R200_TXC_ARG_A_R1_COLOR (12)
-#define R200_TXC_ARG_A_R1_ALPHA (13)
-#define R200_TXC_ARG_A_R2_COLOR (14)
-#define R200_TXC_ARG_A_R2_ALPHA (15)
-#define R200_TXC_ARG_A_R3_COLOR (16)
-#define R200_TXC_ARG_A_R3_ALPHA (17)
-#define R200_TXC_ARG_A_R4_COLOR (18)
-#define R200_TXC_ARG_A_R4_ALPHA (19)
-#define R200_TXC_ARG_A_R5_COLOR (20)
-#define R200_TXC_ARG_A_R5_ALPHA (21)
-#define R200_TXC_ARG_A_TFACTOR1_COLOR (26)
-#define R200_TXC_ARG_A_TFACTOR1_ALPHA (27)
-#define R200_TXC_ARG_A_MASK (31 << 0)
-#define R200_TXC_ARG_A_SHIFT 0
-#define R200_TXC_ARG_B_ZERO (0<<5)
-#define R200_TXC_ARG_B_CURRENT_COLOR (2<<5)
-#define R200_TXC_ARG_B_CURRENT_ALPHA (3<<5)
-#define R200_TXC_ARG_B_DIFFUSE_COLOR (4<<5)
-#define R200_TXC_ARG_B_DIFFUSE_ALPHA (5<<5)
-#define R200_TXC_ARG_B_SPECULAR_COLOR (6<<5)
-#define R200_TXC_ARG_B_SPECULAR_ALPHA (7<<5)
-#define R200_TXC_ARG_B_TFACTOR_COLOR (8<<5)
-#define R200_TXC_ARG_B_TFACTOR_ALPHA (9<<5)
-#define R200_TXC_ARG_B_R0_COLOR (10<<5)
-#define R200_TXC_ARG_B_R0_ALPHA (11<<5)
-#define R200_TXC_ARG_B_R1_COLOR (12<<5)
-#define R200_TXC_ARG_B_R1_ALPHA (13<<5)
-#define R200_TXC_ARG_B_R2_COLOR (14<<5)
-#define R200_TXC_ARG_B_R2_ALPHA (15<<5)
-#define R200_TXC_ARG_B_R3_COLOR (16<<5)
-#define R200_TXC_ARG_B_R3_ALPHA (17<<5)
-#define R200_TXC_ARG_B_R4_COLOR (18<<5)
-#define R200_TXC_ARG_B_R4_ALPHA (19<<5)
-#define R200_TXC_ARG_B_R5_COLOR (20<<5)
-#define R200_TXC_ARG_B_R5_ALPHA (21<<5)
-#define R200_TXC_ARG_B_TFACTOR1_COLOR (26<<5)
-#define R200_TXC_ARG_B_TFACTOR1_ALPHA (27<<5)
-#define R200_TXC_ARG_B_MASK (31 << 5)
-#define R200_TXC_ARG_B_SHIFT 5
-#define R200_TXC_ARG_C_ZERO (0<<10)
-#define R200_TXC_ARG_C_CURRENT_COLOR (2<<10)
-#define R200_TXC_ARG_C_CURRENT_ALPHA (3<<10)
-#define R200_TXC_ARG_C_DIFFUSE_COLOR (4<<10)
-#define R200_TXC_ARG_C_DIFFUSE_ALPHA (5<<10)
-#define R200_TXC_ARG_C_SPECULAR_COLOR (6<<10)
-#define R200_TXC_ARG_C_SPECULAR_ALPHA (7<<10)
-#define R200_TXC_ARG_C_TFACTOR_COLOR (8<<10)
-#define R200_TXC_ARG_C_TFACTOR_ALPHA (9<<10)
-#define R200_TXC_ARG_C_R0_COLOR (10<<10)
-#define R200_TXC_ARG_C_R0_ALPHA (11<<10)
-#define R200_TXC_ARG_C_R1_COLOR (12<<10)
-#define R200_TXC_ARG_C_R1_ALPHA (13<<10)
-#define R200_TXC_ARG_C_R2_COLOR (14<<10)
-#define R200_TXC_ARG_C_R2_ALPHA (15<<10)
-#define R200_TXC_ARG_C_R3_COLOR (16<<10)
-#define R200_TXC_ARG_C_R3_ALPHA (17<<10)
-#define R200_TXC_ARG_C_R4_COLOR (18<<10)
-#define R200_TXC_ARG_C_R4_ALPHA (19<<10)
-#define R200_TXC_ARG_C_R5_COLOR (20<<10)
-#define R200_TXC_ARG_C_R5_ALPHA (21<<10)
-#define R200_TXC_ARG_C_TFACTOR1_COLOR (26<<10)
-#define R200_TXC_ARG_C_TFACTOR1_ALPHA (27<<10)
-#define R200_TXC_ARG_C_MASK (31 << 10)
-#define R200_TXC_ARG_C_SHIFT 10
-#define R200_TXC_COMP_ARG_A (1 << 16)
-#define R200_TXC_COMP_ARG_A_SHIFT (16)
-#define R200_TXC_BIAS_ARG_A (1 << 17)
-#define R200_TXC_SCALE_ARG_A (1 << 18)
-#define R200_TXC_NEG_ARG_A (1 << 19)
-#define R200_TXC_COMP_ARG_B (1 << 20)
-#define R200_TXC_COMP_ARG_B_SHIFT (20)
-#define R200_TXC_BIAS_ARG_B (1 << 21)
-#define R200_TXC_SCALE_ARG_B (1 << 22)
-#define R200_TXC_NEG_ARG_B (1 << 23)
-#define R200_TXC_COMP_ARG_C (1 << 24)
-#define R200_TXC_COMP_ARG_C_SHIFT (24)
-#define R200_TXC_BIAS_ARG_C (1 << 25)
-#define R200_TXC_SCALE_ARG_C (1 << 26)
-#define R200_TXC_NEG_ARG_C (1 << 27)
-#define R200_TXC_OP_MADD (0 << 28)
-#define R200_TXC_OP_CND0 (2 << 28)
-#define R200_TXC_OP_LERP (3 << 28)
-#define R200_TXC_OP_DOT3 (4 << 28)
-#define R200_TXC_OP_DOT4 (5 << 28)
-#define R200_TXC_OP_CONDITIONAL (6 << 28)
-#define R200_TXC_OP_DOT2_ADD (7 << 28)
-#define R200_TXC_OP_MASK (7 << 28)
-#define R200_PP_TXCBLEND2_0 0x2f04
-#define R200_TXC_TFACTOR_SEL_SHIFT 0
-#define R200_TXC_TFACTOR_SEL_MASK 0x7
-#define R200_TXC_TFACTOR1_SEL_SHIFT 4
-#define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4)
-#define R200_TXC_SCALE_SHIFT 8
-#define R200_TXC_SCALE_MASK (7 << 8)
-#define R200_TXC_SCALE_1X (0 << 8)
-#define R200_TXC_SCALE_2X (1 << 8)
-#define R200_TXC_SCALE_4X (2 << 8)
-#define R200_TXC_SCALE_8X (3 << 8)
-#define R200_TXC_SCALE_INV2 (5 << 8)
-#define R200_TXC_SCALE_INV4 (6 << 8)
-#define R200_TXC_SCALE_INV8 (7 << 8)
-#define R200_TXC_CLAMP_SHIFT 12
-#define R200_TXC_CLAMP_MASK (3 << 12)
-#define R200_TXC_CLAMP_WRAP (0 << 12)
-#define R200_TXC_CLAMP_0_1 (1 << 12)
-#define R200_TXC_CLAMP_8_8 (2 << 12)
-#define R200_TXC_OUTPUT_REG_MASK (7 << 16)
-#define R200_TXC_OUTPUT_REG_NONE (0 << 16)
-#define R200_TXC_OUTPUT_REG_R0 (1 << 16)
-#define R200_TXC_OUTPUT_REG_R1 (2 << 16)
-#define R200_TXC_OUTPUT_REG_R2 (3 << 16)
-#define R200_TXC_OUTPUT_REG_R3 (4 << 16)
-#define R200_TXC_OUTPUT_REG_R4 (5 << 16)
-#define R200_TXC_OUTPUT_REG_R5 (6 << 16)
-#define R200_TXC_OUTPUT_MASK_MASK (7 << 20)
-#define R200_TXC_OUTPUT_MASK_RGB (0 << 20)
-#define R200_TXC_OUTPUT_MASK_RG (1 << 20)
-#define R200_TXC_OUTPUT_MASK_RB (2 << 20)
-#define R200_TXC_OUTPUT_MASK_R (3 << 20)
-#define R200_TXC_OUTPUT_MASK_GB (4 << 20)
-#define R200_TXC_OUTPUT_MASK_G (5 << 20)
-#define R200_TXC_OUTPUT_MASK_B (6 << 20)
-#define R200_TXC_OUTPUT_MASK_NONE (7 << 20)
-#define R200_TXC_REPL_NORMAL 0
-#define R200_TXC_REPL_RED 1
-#define R200_TXC_REPL_GREEN 2
-#define R200_TXC_REPL_BLUE 3
-#define R200_TXC_REPL_ARG_A_SHIFT 26
-#define R200_TXC_REPL_ARG_A_MASK (3 << 26)
-#define R200_TXC_REPL_ARG_B_SHIFT 28
-#define R200_TXC_REPL_ARG_B_MASK (3 << 28)
-#define R200_TXC_REPL_ARG_C_SHIFT 30
-#define R200_TXC_REPL_ARG_C_MASK (3 << 30)
-#define R200_PP_TXABLEND_0 0x2f08
-#define R200_TXA_ARG_A_ZERO (0)
-#define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */
-#define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */
-#define R200_TXA_ARG_A_DIFFUSE_ALPHA (4)
-#define R200_TXA_ARG_A_DIFFUSE_BLUE (5)
-#define R200_TXA_ARG_A_SPECULAR_ALPHA (6)
-#define R200_TXA_ARG_A_SPECULAR_BLUE (7)
-#define R200_TXA_ARG_A_TFACTOR_ALPHA (8)
-#define R200_TXA_ARG_A_TFACTOR_BLUE (9)
-#define R200_TXA_ARG_A_R0_ALPHA (10)
-#define R200_TXA_ARG_A_R0_BLUE (11)
-#define R200_TXA_ARG_A_R1_ALPHA (12)
-#define R200_TXA_ARG_A_R1_BLUE (13)
-#define R200_TXA_ARG_A_R2_ALPHA (14)
-#define R200_TXA_ARG_A_R2_BLUE (15)
-#define R200_TXA_ARG_A_R3_ALPHA (16)
-#define R200_TXA_ARG_A_R3_BLUE (17)
-#define R200_TXA_ARG_A_R4_ALPHA (18)
-#define R200_TXA_ARG_A_R4_BLUE (19)
-#define R200_TXA_ARG_A_R5_ALPHA (20)
-#define R200_TXA_ARG_A_R5_BLUE (21)
-#define R200_TXA_ARG_A_TFACTOR1_ALPHA (26)
-#define R200_TXA_ARG_A_TFACTOR1_BLUE (27)
-#define R200_TXA_ARG_A_MASK (31 << 0)
-#define R200_TXA_ARG_A_SHIFT 0
-#define R200_TXA_ARG_B_ZERO (0<<5)
-#define R200_TXA_ARG_B_CURRENT_ALPHA (2<<5) /* guess */
-#define R200_TXA_ARG_B_CURRENT_BLUE (3<<5) /* guess */
-#define R200_TXA_ARG_B_DIFFUSE_ALPHA (4<<5)
-#define R200_TXA_ARG_B_DIFFUSE_BLUE (5<<5)
-#define R200_TXA_ARG_B_SPECULAR_ALPHA (6<<5)
-#define R200_TXA_ARG_B_SPECULAR_BLUE (7<<5)
-#define R200_TXA_ARG_B_TFACTOR_ALPHA (8<<5)
-#define R200_TXA_ARG_B_TFACTOR_BLUE (9<<5)
-#define R200_TXA_ARG_B_R0_ALPHA (10<<5)
-#define R200_TXA_ARG_B_R0_BLUE (11<<5)
-#define R200_TXA_ARG_B_R1_ALPHA (12<<5)
-#define R200_TXA_ARG_B_R1_BLUE (13<<5)
-#define R200_TXA_ARG_B_R2_ALPHA (14<<5)
-#define R200_TXA_ARG_B_R2_BLUE (15<<5)
-#define R200_TXA_ARG_B_R3_ALPHA (16<<5)
-#define R200_TXA_ARG_B_R3_BLUE (17<<5)
-#define R200_TXA_ARG_B_R4_ALPHA (18<<5)
-#define R200_TXA_ARG_B_R4_BLUE (19<<5)
-#define R200_TXA_ARG_B_R5_ALPHA (20<<5)
-#define R200_TXA_ARG_B_R5_BLUE (21<<5)
-#define R200_TXA_ARG_B_TFACTOR1_ALPHA (26<<5)
-#define R200_TXA_ARG_B_TFACTOR1_BLUE (27<<5)
-#define R200_TXA_ARG_B_MASK (31 << 5)
-#define R200_TXA_ARG_B_SHIFT 5
-#define R200_TXA_ARG_C_ZERO (0<<10)
-#define R200_TXA_ARG_C_CURRENT_ALPHA (2<<10) /* guess */
-#define R200_TXA_ARG_C_CURRENT_BLUE (3<<10) /* guess */
-#define R200_TXA_ARG_C_DIFFUSE_ALPHA (4<<10)
-#define R200_TXA_ARG_C_DIFFUSE_BLUE (5<<10)
-#define R200_TXA_ARG_C_SPECULAR_ALPHA (6<<10)
-#define R200_TXA_ARG_C_SPECULAR_BLUE (7<<10)
-#define R200_TXA_ARG_C_TFACTOR_ALPHA (8<<10)
-#define R200_TXA_ARG_C_TFACTOR_BLUE (9<<10)
-#define R200_TXA_ARG_C_R0_ALPHA (10<<10)
-#define R200_TXA_ARG_C_R0_BLUE (11<<10)
-#define R200_TXA_ARG_C_R1_ALPHA (12<<10)
-#define R200_TXA_ARG_C_R1_BLUE (13<<10)
-#define R200_TXA_ARG_C_R2_ALPHA (14<<10)
-#define R200_TXA_ARG_C_R2_BLUE (15<<10)
-#define R200_TXA_ARG_C_R3_ALPHA (16<<10)
-#define R200_TXA_ARG_C_R3_BLUE (17<<10)
-#define R200_TXA_ARG_C_R4_ALPHA (18<<10)
-#define R200_TXA_ARG_C_R4_BLUE (19<<10)
-#define R200_TXA_ARG_C_R5_ALPHA (20<<10)
-#define R200_TXA_ARG_C_R5_BLUE (21<<10)
-#define R200_TXA_ARG_C_TFACTOR1_ALPHA (26<<10)
-#define R200_TXA_ARG_C_TFACTOR1_BLUE (27<<10)
-#define R200_TXA_ARG_C_MASK (31 << 10)
-#define R200_TXA_ARG_C_SHIFT 10
-#define R200_TXA_COMP_ARG_A (1 << 16)
-#define R200_TXA_COMP_ARG_A_SHIFT (16)
-#define R200_TXA_BIAS_ARG_A (1 << 17)
-#define R200_TXA_SCALE_ARG_A (1 << 18)
-#define R200_TXA_NEG_ARG_A (1 << 19)
-#define R200_TXA_COMP_ARG_B (1 << 20)
-#define R200_TXA_COMP_ARG_B_SHIFT (20)
-#define R200_TXA_BIAS_ARG_B (1 << 21)
-#define R200_TXA_SCALE_ARG_B (1 << 22)
-#define R200_TXA_NEG_ARG_B (1 << 23)
-#define R200_TXA_COMP_ARG_C (1 << 24)
-#define R200_TXA_COMP_ARG_C_SHIFT (24)
-#define R200_TXA_BIAS_ARG_C (1 << 25)
-#define R200_TXA_SCALE_ARG_C (1 << 26)
-#define R200_TXA_NEG_ARG_C (1 << 27)
-#define R200_TXA_OP_MADD (0 << 28)
-#define R200_TXA_OP_CND0 (2 << 28)
-#define R200_TXA_OP_LERP (3 << 28)
-#define R200_TXA_OP_CONDITIONAL (6 << 28)
-#define R200_TXA_OP_MASK (7 << 28)
-#define R200_PP_TXABLEND2_0 0x2f0c
-#define R200_TXA_TFACTOR_SEL_SHIFT 0
-#define R200_TXA_TFACTOR_SEL_MASK 0x7
-#define R200_TXA_TFACTOR1_SEL_SHIFT 4
-#define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4)
-#define R200_TXA_SCALE_SHIFT 8
-#define R200_TXA_SCALE_MASK (7 << 8)
-#define R200_TXA_SCALE_1X (0 << 8)
-#define R200_TXA_SCALE_2X (1 << 8)
-#define R200_TXA_SCALE_4X (2 << 8)
-#define R200_TXA_SCALE_8X (3 << 8)
-#define R200_TXA_SCALE_INV2 (5 << 8)
-#define R200_TXA_SCALE_INV4 (6 << 8)
-#define R200_TXA_SCALE_INV8 (7 << 8)
-#define R200_TXA_CLAMP_SHIFT 12
-#define R200_TXA_CLAMP_MASK (3 << 12)
-#define R200_TXA_CLAMP_WRAP (0 << 12)
-#define R200_TXA_CLAMP_0_1 (1 << 12)
-#define R200_TXA_CLAMP_8_8 (2 << 12)
-#define R200_TXA_OUTPUT_REG_MASK (7 << 16)
-#define R200_TXA_OUTPUT_REG_NONE (0 << 16)
-#define R200_TXA_OUTPUT_REG_R0 (1 << 16)
-#define R200_TXA_OUTPUT_REG_R1 (2 << 16)
-#define R200_TXA_OUTPUT_REG_R2 (3 << 16)
-#define R200_TXA_OUTPUT_REG_R3 (4 << 16)
-#define R200_TXA_OUTPUT_REG_R4 (5 << 16)
-#define R200_TXA_OUTPUT_REG_R5 (6 << 16)
-#define R200_TXA_DOT_ALPHA (1 << 20)
-#define R200_TXA_REPL_NORMAL 0
-#define R200_TXA_REPL_RED 1
-#define R200_TXA_REPL_GREEN 2
-#define R200_TXA_REPL_ARG_A_SHIFT 26
-#define R200_TXA_REPL_ARG_A_MASK (3 << 26)
-#define R200_TXA_REPL_ARG_B_SHIFT 28
-#define R200_TXA_REPL_ARG_B_MASK (3 << 28)
-#define R200_TXA_REPL_ARG_C_SHIFT 30
-#define R200_TXA_REPL_ARG_C_MASK (3 << 30)
-#define R200_PP_TXCBLEND_1 0x2f10
-#define R200_PP_TXCBLEND2_1 0x2f14
-#define R200_PP_TXABLEND_1 0x2f18
-#define R200_PP_TXABLEND2_1 0x2f1c
-#define R200_PP_TXCBLEND_2 0x2f20
-#define R200_PP_TXCBLEND2_2 0x2f24
-#define R200_PP_TXABLEND_2 0x2f28
-#define R200_PP_TXABLEND2_2 0x2f2c
-#define R200_PP_TXCBLEND_3 0x2f30
-#define R200_PP_TXCBLEND2_3 0x2f34
-#define R200_PP_TXABLEND_3 0x2f38
-#define R200_PP_TXABLEND2_3 0x2f3c
-#define R200_PP_TXCBLEND_4 0x2f40
-#define R200_PP_TXCBLEND2_4 0x2f44
-#define R200_PP_TXABLEND_4 0x2f48
-#define R200_PP_TXABLEND2_4 0x2f4c
-#define R200_PP_TXCBLEND_5 0x2f50
-#define R200_PP_TXCBLEND2_5 0x2f54
-#define R200_PP_TXABLEND_5 0x2f58
-#define R200_PP_TXABLEND2_5 0x2f5c
-#define R200_PP_TXCBLEND_6 0x2f60
-#define R200_PP_TXCBLEND2_6 0x2f64
-#define R200_PP_TXABLEND_6 0x2f68
-#define R200_PP_TXABLEND2_6 0x2f6c
-#define R200_PP_TXCBLEND_7 0x2f70
-#define R200_PP_TXCBLEND2_7 0x2f74
-#define R200_PP_TXABLEND_7 0x2f78
-#define R200_PP_TXABLEND2_7 0x2f7c
-/* gap */
-#define R200_RB3D_BLENDCOLOR 0x3218 /* ARGB 8888 */
-#define R200_RB3D_ABLENDCNTL 0x321C /* see BLENDCTL */
-#define R200_RB3D_CBLENDCNTL 0x3220 /* see BLENDCTL */
-
-/*
- * Offsets in TCL vector state. NOTE: Hardwiring matrix positions.
- * Multiple contexts could collaberate to eliminate state bouncing.
- */
-#define R200_VS_LIGHT_AMBIENT_ADDR 0x00000028
-#define R200_VS_LIGHT_DIFFUSE_ADDR 0x00000030
-#define R200_VS_LIGHT_SPECULAR_ADDR 0x00000038
-#define R200_VS_LIGHT_DIRPOS_ADDR 0x00000040
-#define R200_VS_LIGHT_HWVSPOT_ADDR 0x00000048
-#define R200_VS_LIGHT_ATTENUATION_ADDR 0x00000050
-#define R200_VS_SPOT_DUAL_CONE 0x00000058
-#define R200_VS_GLOBAL_AMBIENT_ADDR 0x0000005C
-#define R200_VS_FOG_PARAM_ADDR 0x0000005D
-#define R200_VS_EYE_VECTOR_ADDR 0x0000005E
-#define R200_VS_UCP_ADDR 0x00000060
-#define R200_VS_PNT_SPRITE_VPORT_SCALE 0x00000068
-#define R200_VS_MATRIX_0_MV 0x00000080
-#define R200_VS_MATRIX_1_INV_MV 0x00000084
-#define R200_VS_MATRIX_2_MVP 0x00000088
-#define R200_VS_MATRIX_3_TEX0 0x0000008C
-#define R200_VS_MATRIX_4_TEX1 0x00000090
-#define R200_VS_MATRIX_5_TEX2 0x00000094
-#define R200_VS_MATRIX_6_TEX3 0x00000098
-#define R200_VS_MATRIX_7_TEX4 0x0000009C
-#define R200_VS_MATRIX_8_TEX5 0x000000A0
-#define R200_VS_MAT_0_EMISS 0x000000B0
-#define R200_VS_MAT_0_AMB 0x000000B1
-#define R200_VS_MAT_0_DIF 0x000000B2
-#define R200_VS_MAT_0_SPEC 0x000000B3
-#define R200_VS_MAT_1_EMISS 0x000000B4
-#define R200_VS_MAT_1_AMB 0x000000B5
-#define R200_VS_MAT_1_DIF 0x000000B6
-#define R200_VS_MAT_1_SPEC 0x000000B7
-#define R200_VS_EYE2CLIP_MTX 0x000000B8
-#define R200_VS_PNT_SPRITE_ATT_CONST 0x000000BC
-#define R200_VS_PNT_SPRITE_EYE_IN_MODEL 0x000000BD
-#define R200_VS_PNT_SPRITE_CLAMP 0x000000BE
-#define R200_VS_MAX 0x000001C0
-
-/*
- * Offsets in TCL scalar state
- */
-#define R200_SS_LIGHT_DCD_ADDR 0x00000000
-#define R200_SS_LIGHT_DCM_ADDR 0x00000008
-#define R200_SS_LIGHT_SPOT_EXPONENT_ADDR 0x00000010
-#define R200_SS_LIGHT_SPOT_CUTOFF_ADDR 0x00000018
-#define R200_SS_LIGHT_SPECULAR_THRESH_ADDR 0x00000020
-#define R200_SS_LIGHT_RANGE_CUTOFF_SQRD 0x00000028
-#define R200_SS_LIGHT_RANGE_ATT_CONST 0x00000030
-#define R200_SS_VERT_GUARD_CLIP_ADJ_ADDR 0x00000080
-#define R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR 0x00000081
-#define R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR 0x00000082
-#define R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 0x00000083
-#define R200_SS_MAT_0_SHININESS 0x00000100
-#define R200_SS_MAT_1_SHININESS 0x00000101
-
-/*
- * Matrix indices
- */
-#define R200_MTX_MV 0
-#define R200_MTX_IMV 1
-#define R200_MTX_MVP 2
-#define R200_MTX_TEX0 3
-#define R200_MTX_TEX1 4
-#define R200_MTX_TEX2 5
-#define R200_MTX_TEX3 6
-#define R200_MTX_TEX4 7
-#define R200_MTX_TEX5 8
-
-/* Color formats for 2d packets
- */
-#define R200_CP_COLOR_FORMAT_CI8 2
-#define R200_CP_COLOR_FORMAT_ARGB1555 3
-#define R200_CP_COLOR_FORMAT_RGB565 4
-#define R200_CP_COLOR_FORMAT_ARGB8888 6
-#define R200_CP_COLOR_FORMAT_RGB332 7
-#define R200_CP_COLOR_FORMAT_RGB8 9
-#define R200_CP_COLOR_FORMAT_ARGB4444 15
-
-/*
- * CP type-3 packets
- */
-#define R200_CP_CMD_NOP 0xC0001000
-#define R200_CP_CMD_NEXT_CHAR 0xC0001900
-#define R200_CP_CMD_PLY_NEXTSCAN 0xC0001D00
-#define R200_CP_CMD_SET_SCISSORS 0xC0001E00
-#define R200_CP_CMD_LOAD_MICROCODE 0xC0002400
-#define R200_CP_CMD_WAIT_FOR_IDLE 0xC0002600
-#define R200_CP_CMD_3D_DRAW_VBUF 0xC0002800
-#define R200_CP_CMD_3D_DRAW_IMMD 0xC0002900
-#define R200_CP_CMD_3D_DRAW_INDX 0xC0002A00
-#define R200_CP_CMD_LOAD_PALETTE 0xC0002C00
-#define R200_CP_CMD_3D_LOAD_VBPNTR 0xC0002F00
-#define R200_CP_CMD_INDX_BUFFER 0xC0003300
-#define R200_CP_CMD_3D_DRAW_VBUF_2 0xC0003400
-#define R200_CP_CMD_3D_DRAW_IMMD_2 0xC0003500
-#define R200_CP_CMD_3D_DRAW_INDX_2 0xC0003600
-#define R200_CP_CMD_PAINT 0xC0009100
-#define R200_CP_CMD_BITBLT 0xC0009200
-#define R200_CP_CMD_SMALLTEXT 0xC0009300
-#define R200_CP_CMD_HOSTDATA_BLT 0xC0009400
-#define R200_CP_CMD_POLYLINE 0xC0009500
-#define R200_CP_CMD_POLYSCANLINES 0xC0009800
-#define R200_CP_CMD_PAINT_MULTI 0xC0009A00
-#define R200_CP_CMD_BITBLT_MULTI 0xC0009B00
-#define R200_CP_CMD_TRANS_BITBLT 0xC0009C00
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_sanity.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_sanity.h
deleted file mode 100644
index 30852b490..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_sanity.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef R200_SANITY_H
-#define R200_SANITY_H
-
-extern int r200SanityCmdBuffer(r200ContextPtr rmesa,
- int nbox, drm_clip_rect_t * boxes);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_state.h
deleted file mode 100644
index 3e1a9c8ba..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_state.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_STATE_H__
-#define __R200_STATE_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include "r200_context.h"
-
-extern void r200InitState(r200ContextPtr rmesa);
-extern void r200InitStateFuncs(struct dd_function_table *functions);
-extern void r200InitTnlFuncs(GLcontext * ctx);
-
-extern void r200UpdateMaterial(GLcontext * ctx);
-
-extern void r200UpdateViewportOffset(GLcontext * ctx);
-extern void r200UpdateWindow(GLcontext * ctx);
-
-extern void r200ValidateState(GLcontext * ctx);
-
-extern void r200PrintDirty(r200ContextPtr rmesa, const char *msg);
-
-extern void r200LightingSpaceChange(GLcontext * ctx);
-
-#endif
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tcl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tcl.h
deleted file mode 100644
index 4528cf152..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tcl.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.h,v 1.2 2002/12/16 16:18:55 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_TCL_H__
-#define __R200_TCL_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include "r200_context.h"
-
-extern void r200TclPrimitive(GLcontext * ctx, GLenum prim, int hw_prim);
-extern void r200EmitEltPrimitive(GLcontext * ctx, GLuint first, GLuint last,
- GLuint flags);
-extern void r200EmitPrimitive(GLcontext * ctx, GLuint first, GLuint last,
- GLuint flags);
-
-#endif
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tex.h
deleted file mode 100644
index bc0dbc3fb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r200_tex.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R200_TEX_H__
-#define __R200_TEX_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-extern void r200UpdateTextureState(GLcontext * ctx);
-
-extern int r200UploadTexImages(r200ContextPtr rmesa, r200TexObjPtr t,
- GLuint face);
-
-extern void r200DestroyTexObj(r200ContextPtr rmesa, r200TexObjPtr t);
-
-extern void r200InitTextureFuncs(struct dd_function_table *functions);
-
-#endif
-#endif /* __R200_TEX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.c
deleted file mode 100644
index d3c22fda1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#include "glheader.h"
-#include "state.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
-#include "swrast/swrast.h"
-#include "simple_list.h"
-
-#include "drm.h"
-#include "radeon_drm.h"
-
-#include "radeon_ioctl.h"
-#include "r300_context.h"
-#include "r300_ioctl.h"
-#include "radeon_reg.h"
-#include "r300_reg.h"
-#include "r300_cmdbuf.h"
-#include "r300_emit.h"
-
-
-// Set this to 1 for extremely verbose debugging of command buffers
-#define DEBUG_CMDBUF 0
-
-
-/**
- * Send the current command buffer via ioctl to the hardware.
- */
-int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller)
-{
- int ret;
- int i;
- drm_radeon_cmd_buffer_t cmd;
- int start;
-
- if (r300->radeon.lost_context) {
- start = 0;
- r300->radeon.lost_context = GL_FALSE;
- } else
- start = r300->cmdbuf.count_reemit;
-
- if (RADEON_DEBUG & DEBUG_IOCTL) {
- fprintf(stderr, "%s from %s - %i cliprects\n",
- __FUNCTION__, caller, r300->radeon.numClipRects);
-
- if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_VERBOSE)
- for (i = start; i < r300->cmdbuf.count_used; ++i)
- fprintf(stderr, "%d: %08x\n", i,
- r300->cmdbuf.cmd_buf[i]);
- }
-
- cmd.buf = (char*)(r300->cmdbuf.cmd_buf + start);
- cmd.bufsz = (r300->cmdbuf.count_used - start) * 4;
-
- if (r300->radeon.state.scissor.enabled) {
- cmd.nbox = r300->radeon.state.scissor.numClipRects;
- cmd.boxes = (drm_clip_rect_t *)r300->radeon.state.scissor.pClipRects;
- } else {
- cmd.nbox = r300->radeon.numClipRects;
- cmd.boxes = (drm_clip_rect_t *)r300->radeon.pClipRects;
- }
-
- ret = drmCommandWrite(r300->radeon.dri.fd,
- DRM_RADEON_CMDBUF, &cmd, sizeof(cmd));
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "Syncing in %s (from %s)\n\n", __FUNCTION__, caller);
- radeonWaitForIdleLocked(&r300->radeon);
- }
-
- r300->dma.nr_released_bufs = 0;
- r300->cmdbuf.count_used = 0;
- r300->cmdbuf.count_reemit = 0;
-
- return ret;
-}
-
-
-int r300FlushCmdBuf(r300ContextPtr r300, const char* caller)
-{
- int ret;
- int i;
- drm_radeon_cmd_buffer_t cmd;
- int start;
-
- LOCK_HARDWARE(&r300->radeon);
-
- ret=r300FlushCmdBufLocked(r300, caller);
-
- UNLOCK_HARDWARE(&r300->radeon);
-
- if (ret) {
- fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret);
- exit(ret);
- }
-
- return ret;
-}
-
-
-static void print_state_atom(struct r300_state_atom *state, int dwords)
-{
- int i;
-
- fprintf(stderr, " emit %s/%d/%d\n", state->name, dwords, state->cmd_size);
-
- if (RADEON_DEBUG & DEBUG_VERBOSE)
- for (i = 0; i < dwords; i++)
- fprintf(stderr, " %s[%d]: %08X\n", state->name, i,
- state->cmd[i]);
-}
-
-/**
- * Emit all atoms with a dirty field equal to dirty.
- *
- * The caller must have ensured that there is enough space in the command
- * buffer.
- */
-static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty)
-{
- struct r300_state_atom* atom;
- uint32_t* dest;
-
- dest = r300->cmdbuf.cmd_buf + r300->cmdbuf.count_used;
-
- if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_STATE) {
- foreach(atom, &r300->hw.atomlist) {
- if ((atom->dirty || r300->hw.all_dirty) == dirty) {
- int dwords = (*atom->check)(r300, atom);
-
- if (dwords)
- print_state_atom(atom, dwords);
- else
- fprintf(stderr, " skip state %s\n",
- atom->name);
- }
- }
- }
-
-
- /* Emit WAIT */
- *dest = cmdwait(R300_WAIT_3D | R300_WAIT_3D_CLEAN);
- dest ++;
- r300->cmdbuf.count_used ++;
-
- /* Emit END3D */
- *dest = cmdpacify();
- dest ++;
- r300->cmdbuf.count_used ++;
-
- /* Emit actual atoms */
-
- foreach(atom, &r300->hw.atomlist) {
- if ((atom->dirty || r300->hw.all_dirty) == dirty) {
- int dwords = (*atom->check)(r300, atom);
-
- if (dwords) {
- memcpy(dest, atom->cmd, dwords*4);
- dest += dwords;
- r300->cmdbuf.count_used += dwords;
- atom->dirty = GL_FALSE;
- }
- }
- }
-}
-
-/**
- * Copy dirty hardware state atoms into the command buffer.
- *
- * We also copy out clean state if we're at the start of a buffer. That makes
- * it easy to recover from lost contexts.
- */
-void r300EmitState(r300ContextPtr r300)
-{
- if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_PRIMS))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (r300->cmdbuf.count_used && !r300->hw.is_dirty && !r300->hw.all_dirty)
- return;
-
- /* To avoid going across the entire set of states multiple times, just check
- * for enough space for the case of emitting all state, and inline the
- * r300AllocCmdBuf code here without all the checks.
- */
- r300EnsureCmdBufSpace(r300, r300->hw.max_state_size, __FUNCTION__);
-
- if (!r300->cmdbuf.count_used) {
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Begin reemit state\n");
-
- r300DoEmitState(r300, GL_FALSE);
- r300->cmdbuf.count_reemit = r300->cmdbuf.count_used;
- }
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Begin dirty state\n");
-
- r300DoEmitState(r300, GL_TRUE);
-
- assert(r300->cmdbuf.count_used < r300->cmdbuf.size);
-
- r300->hw.is_dirty = GL_FALSE;
- r300->hw.all_dirty = GL_FALSE;
-}
-
-#define CHECK( NM, COUNT ) \
-static int check_##NM( r300ContextPtr r300, \
- struct r300_state_atom* atom ) \
-{ \
- (void) atom; (void) r300; \
- return (COUNT); \
-}
-
-#define packet0_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->packet0.count)
-#define vpu_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count)
-
-CHECK( always, atom->cmd_size )
-CHECK( never, 0 )
-CHECK( variable, packet0_count(atom->cmd) ? (1 + packet0_count(atom->cmd)) : 0 )
-CHECK( vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd)*4) : 0 )
-
-#undef packet0_count
-#undef vpu_count
-
-#define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \
- do { \
- r300->hw.ATOM.cmd_size = (SZ); \
- r300->hw.ATOM.cmd = (uint32_t*)CALLOC((SZ) * sizeof(uint32_t)); \
- r300->hw.ATOM.name = (NM); \
- r300->hw.ATOM.idx = (IDX); \
- r300->hw.ATOM.check = check_##CHK; \
- r300->hw.ATOM.dirty = GL_FALSE; \
- r300->hw.max_state_size += (SZ); \
- } while (0)
-
-
-/**
- * Allocate memory for the command buffer and initialize the state atom
- * list. Note that the initial hardware state is set by r300InitState().
- */
-void r300InitCmdBuf(r300ContextPtr r300)
-{
- int size, i, mtu;
-
- r300->hw.max_state_size = 2; /* reserve extra space for WAIT_IDLE */
-
- mtu = r300->radeon.glCtx->Const.MaxTextureUnits;
- if (RADEON_DEBUG & DEBUG_TEXTURE) {
- fprintf(stderr, "Using %d maximum texture units..\n", mtu);
- }
-
- /* Initialize state atoms */
- ALLOC_STATE( vpt, always, R300_VPT_CMDSIZE, "vpt", 0 );
- r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6);
- ALLOC_STATE( unk2080, always, 2, "unk2080", 0 );
- r300->hw.unk2080.cmd[0] = cmdpacket0(0x2080, 1);
- ALLOC_STATE( vte, always, 3, "vte", 0 );
- r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2);
- ALLOC_STATE( unk2134, always, 3, "unk2134", 0 );
- r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2);
- ALLOC_STATE( unk2140, always, 2, "unk2140", 0 );
- r300->hw.unk2140.cmd[0] = cmdpacket0(0x2140, 1);
- ALLOC_STATE( vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0 );
- r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1);
- ALLOC_STATE( vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1 );
- r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1);
- ALLOC_STATE( vic, always, R300_VIC_CMDSIZE, "vic", 0 );
- r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2);
- ALLOC_STATE( unk21DC, always, 2, "unk21DC", 0 );
- r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1);
- ALLOC_STATE( unk221C, always, 2, "unk221C", 0 );
- r300->hw.unk221C.cmd[0] = cmdpacket0(0x221C, 1);
- ALLOC_STATE( unk2220, always, 5, "unk2220", 0 );
- r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4);
- ALLOC_STATE( unk2288, always, 2, "unk2288", 0 );
- r300->hw.unk2288.cmd[0] = cmdpacket0(0x2288, 1);
- ALLOC_STATE( vof, always, R300_VOF_CMDSIZE, "vof", 0 );
- r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2);
- ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 );
- r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3);
- ALLOC_STATE( gb_enable, always, 2, "gb_enable", 0 );
- r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1);
- ALLOC_STATE( gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0 );
- r300->hw.gb_misc.cmd[0] = cmdpacket0(R300_GB_MSPOS0, 5);
- ALLOC_STATE( txe, always, R300_TXE_CMDSIZE, "txe", 0 );
- r300->hw.txe.cmd[R300_TXE_CMD_0] = cmdpacket0(R300_TX_ENABLE, 1);
- ALLOC_STATE( unk4200, always, 5, "unk4200", 0 );
- r300->hw.unk4200.cmd[0] = cmdpacket0(0x4200, 4);
- ALLOC_STATE( unk4214, always, 2, "unk4214", 0 );
- r300->hw.unk4214.cmd[0] = cmdpacket0(0x4214, 1);
- ALLOC_STATE( ps, always, R300_PS_CMDSIZE, "ps", 0 );
- r300->hw.ps.cmd[0] = cmdpacket0(R300_RE_POINTSIZE, 1);
- ALLOC_STATE( unk4230, always, 4, "unk4230", 0 );
- r300->hw.unk4230.cmd[0] = cmdpacket0(0x4230, 3);
- ALLOC_STATE( lcntl, always, 2, "lcntl", 0 );
- r300->hw.lcntl.cmd[0] = cmdpacket0(R300_RE_LINE_CNT, 1);
- ALLOC_STATE( unk4260, always, 4, "unk4260", 0 );
- r300->hw.unk4260.cmd[0] = cmdpacket0(0x4260, 3);
- ALLOC_STATE( unk4274, always, 5, "unk4274", 0 );
- r300->hw.unk4274.cmd[0] = cmdpacket0(0x4274, 4);
- ALLOC_STATE( unk4288, always, 6, "unk4288", 0 );
- r300->hw.unk4288.cmd[0] = cmdpacket0(0x4288, 5);
- ALLOC_STATE( unk42A0, always, 2, "unk42A0", 0 );
- r300->hw.unk42A0.cmd[0] = cmdpacket0(0x42A0, 1);
- ALLOC_STATE( zbs, always, R300_ZBS_CMDSIZE, "zbs", 0 );
- r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmdpacket0(R300_RE_ZBIAS_T_FACTOR, 4);
- ALLOC_STATE( unk42B4, always, 2, "unk42B4", 0 );
- r300->hw.unk42B4.cmd[0] = cmdpacket0(0x42B4, 1);
- ALLOC_STATE( cul, always, R300_CUL_CMDSIZE, "cul", 0 );
- r300->hw.cul.cmd[R300_CUL_CMD_0] = cmdpacket0(R300_RE_CULL_CNTL, 1);
- ALLOC_STATE( unk42C0, always, 3, "unk42C0", 0 );
- r300->hw.unk42C0.cmd[0] = cmdpacket0(0x42C0, 2);
- ALLOC_STATE( rc, always, R300_RC_CMDSIZE, "rc", 0 );
- r300->hw.rc.cmd[R300_RC_CMD_0] = cmdpacket0(R300_RS_CNTL_0, 2);
- ALLOC_STATE( ri, always, R300_RI_CMDSIZE, "ri", 0 );
- r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R300_RS_INTERP_0, 8);
- ALLOC_STATE( rr, variable, R300_RR_CMDSIZE, "rr", 0 );
- r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1);
- ALLOC_STATE( unk43A4, always, 3, "unk43A4", 0 );
- r300->hw.unk43A4.cmd[0] = cmdpacket0(0x43A4, 2);
- ALLOC_STATE( unk43E8, always, 2, "unk43E8", 0 );
- r300->hw.unk43E8.cmd[0] = cmdpacket0(0x43E8, 1);
- ALLOC_STATE( fp, always, R300_FP_CMDSIZE, "fp", 0 );
- r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3);
- r300->hw.fp.cmd[R300_FP_CMD_1] = cmdpacket0(R300_PFS_NODE_0, 4);
- ALLOC_STATE( fpt, variable, R300_FPT_CMDSIZE, "fpt", 0 );
- r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, 0);
- ALLOC_STATE( unk46A4, always, 6, "unk46A4", 0 );
- r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5);
- ALLOC_STATE( fpi[0], variable, R300_FPI_CMDSIZE, "fpi/0", 0 );
- r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, 1);
- ALLOC_STATE( fpi[1], variable, R300_FPI_CMDSIZE, "fpi/1", 1 );
- r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, 1);
- ALLOC_STATE( fpi[2], variable, R300_FPI_CMDSIZE, "fpi/2", 2 );
- r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, 1);
- ALLOC_STATE( fpi[3], variable, R300_FPI_CMDSIZE, "fpi/3", 3 );
- r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1);
- ALLOC_STATE( unk4BC0, always, 2, "unk4BC0", 0 );
- r300->hw.unk4BC0.cmd[0] = cmdpacket0(0x4BC0, 1);
- ALLOC_STATE( unk4BC8, always, 4, "unk4BC8", 0 );
- r300->hw.unk4BC8.cmd[0] = cmdpacket0(0x4BC8, 3);
- ALLOC_STATE( at, always, R300_AT_CMDSIZE, "at", 0 );
- r300->hw.at.cmd[R300_AT_CMD_0] = cmdpacket0(R300_PP_ALPHA_TEST, 2);
- ALLOC_STATE( unk4BD8, always, 2, "unk4BD8", 0 );
- r300->hw.unk4BD8.cmd[0] = cmdpacket0(0x4BD8, 1);
- ALLOC_STATE( fpp, variable, R300_FPP_CMDSIZE, "fpp", 0 );
- r300->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, 0);
- ALLOC_STATE( unk4E00, always, 2, "unk4E00", 0 );
- r300->hw.unk4E00.cmd[0] = cmdpacket0(0x4E00, 1);
- ALLOC_STATE( bld, always, R300_BLD_CMDSIZE, "bld", 0 );
- r300->hw.bld.cmd[R300_BLD_CMD_0] = cmdpacket0(R300_RB3D_CBLEND, 2);
- ALLOC_STATE( cmk, always, R300_CMK_CMDSIZE, "cmk", 0 );
- r300->hw.cmk.cmd[R300_CMK_CMD_0] = cmdpacket0(R300_RB3D_COLORMASK, 1);
- ALLOC_STATE( unk4E10, always, 4, "unk4E10", 0 );
- r300->hw.unk4E10.cmd[0] = cmdpacket0(0x4E10, 3);
- ALLOC_STATE( cb, always, R300_CB_CMDSIZE, "cb", 0 );
- r300->hw.cb.cmd[R300_CB_CMD_0] = cmdpacket0(R300_RB3D_COLOROFFSET0, 1);
- r300->hw.cb.cmd[R300_CB_CMD_1] = cmdpacket0(R300_RB3D_COLORPITCH0, 1);
- ALLOC_STATE( unk4E50, always, 10, "unk4E50", 0 );
- r300->hw.unk4E50.cmd[0] = cmdpacket0(0x4E50, 9);
- ALLOC_STATE( unk4E88, always, 2, "unk4E88", 0 );
- r300->hw.unk4E88.cmd[0] = cmdpacket0(0x4E88, 1);
- ALLOC_STATE( unk4EA0, always, 3, "unk4EA0 R350 only", 0 );
- r300->hw.unk4EA0.cmd[0] = cmdpacket0(0x4EA0, 2);
- ALLOC_STATE( zs, always, R300_ZS_CMDSIZE, "zstencil", 0 );
- r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3);
- ALLOC_STATE( unk4F10, always, 5, "unk4F10", 0 );
- r300->hw.unk4F10.cmd[0] = cmdpacket0(0x4F10, 4);
- ALLOC_STATE( zb, always, R300_ZB_CMDSIZE, "zb", 0 );
- r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2);
- ALLOC_STATE( unk4F28, always, 2, "unk4F28", 0 );
- r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1);
- ALLOC_STATE( unk4F30, always, 3, "unk4F30", 0 );
- r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2);
- ALLOC_STATE( unk4F44, always, 2, "unk4F44", 0 );
- r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1);
- ALLOC_STATE( unk4F54, always, 2, "unk4F54", 0 );
- r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1);
-
- ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 );
- r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0);
- ALLOC_STATE( vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0 );
- r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0);
- ALLOC_STATE( vps, vpu, R300_VPS_CMDSIZE, "vps", 0 );
- r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1);
-
- /* Textures */
- ALLOC_STATE( tex.filter, variable, mtu+1, "tex_filter", 0 );
- r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0);
-
- ALLOC_STATE( tex.unknown1, variable, mtu+1, "tex_unknown1", 0 );
- r300->hw.tex.unknown1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_UNK1_0, 0);
-
- ALLOC_STATE( tex.size, variable, mtu+1, "tex_size", 0 );
- r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0);
-
- ALLOC_STATE( tex.format, variable, mtu+1, "tex_format", 0 );
- r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0);
-
- ALLOC_STATE( tex.offset, variable, mtu+1, "tex_offset", 0 );
- r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0);
-
- ALLOC_STATE( tex.unknown4, variable, mtu+1, "tex_unknown4", 0 );
- r300->hw.tex.unknown4.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_UNK4_0, 0);
-
- ALLOC_STATE( tex.border_color, variable, mtu+1, "tex_border_color", 0 );
- r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0);
-
-
- /* Setup the atom linked list */
- make_empty_list(&r300->hw.atomlist);
- r300->hw.atomlist.name = "atom-list";
-
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vpt);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2080);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vte);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2134);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2140);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vir[0]);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vir[1]);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vic);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk21DC);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk221C);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2220);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2288);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vof);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_enable);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_misc);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.txe);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4200);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4214);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.ps);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4230);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.lcntl);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4260);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4274);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4288);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42A0);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.zbs);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42B4);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.cul);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42C0);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.rc);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.ri);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.rr);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk43A4);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk43E8);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fp);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fpt);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk46A4);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[0]);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[1]);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[2]);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[3]);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4BC0);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4BC8);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.at);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4BD8);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.fpp);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E00);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.bld);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.cmk);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E10);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.cb);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E50);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E88);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4EA0);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.zs);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F10);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.zb);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F28);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F30);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F44);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F54);
-
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.vps);
-
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.unknown1);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.size);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.format);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.offset);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.unknown4);
- insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.border_color);
-
- r300->hw.is_dirty = GL_TRUE;
- r300->hw.all_dirty = GL_TRUE;
-
- /* Initialize command buffer */
- size = 256 * driQueryOptioni(&r300->radeon.optionCache, "command_buffer_size");
- if (size < 2*r300->hw.max_state_size) {
- size = 2*r300->hw.max_state_size+65535;
- }
- if (size > 64*256)
- size = 64*256;
-
- if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA)) {
- fprintf(stderr, "sizeof(drm_r300_cmd_header_t)=%d\n",
- sizeof(drm_r300_cmd_header_t));
- fprintf(stderr, "sizeof(drm_radeon_cmd_buffer_t)=%d\n",
- sizeof(drm_radeon_cmd_buffer_t));
- fprintf(stderr,
- "Allocating %d bytes command buffer (max state is %d bytes)\n",
- size*4, r300->hw.max_state_size*4);
- }
-
- r300->cmdbuf.size = size;
- r300->cmdbuf.cmd_buf = (uint32_t*)CALLOC(size*4);
- r300->cmdbuf.count_used = 0;
- r300->cmdbuf.count_reemit = 0;
-}
-
-
-/**
- * Destroy the command buffer and state atoms.
- */
-void r300DestroyCmdBuf(r300ContextPtr r300)
-{
- struct r300_state_atom* atom;
-
- FREE(r300->cmdbuf.cmd_buf);
-
- foreach(atom, &r300->hw.atomlist) {
- FREE(atom->cmd);
- }
-}
-
-void r300EmitBlit(r300ContextPtr rmesa,
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty, GLuint w, GLuint h)
-{
- drm_radeon_cmd_header_t *cmd;
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr,
- "%s src %x/%x %d,%d dst: %x/%x %d,%d sz: %dx%d\n",
- __FUNCTION__, src_pitch, src_offset, srcx, srcy,
- dst_pitch, dst_offset, dstx, dsty, w, h);
-
- assert((src_pitch & 63) == 0);
- assert((dst_pitch & 63) == 0);
- assert((src_offset & 1023) == 0);
- assert((dst_offset & 1023) == 0);
- assert(w < (1 << 16));
- assert(h < (1 << 16));
-
- cmd =
- (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 8,
- __FUNCTION__);
-
- cmd[0].header.cmd_type = R300_CMD_PACKET3;
- cmd[1].i = R200_CP_CMD_BITBLT_MULTI | (5 << 16);
- cmd[2].i = (RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
- RADEON_GMC_DST_PITCH_OFFSET_CNTL |
- RADEON_GMC_BRUSH_NONE |
- (color_fmt << 8) |
- RADEON_GMC_SRC_DATATYPE_COLOR |
- RADEON_ROP3_S |
- RADEON_DP_SRC_SOURCE_MEMORY |
- RADEON_GMC_CLR_CMP_CNTL_DIS | RADEON_GMC_WR_MSK_DIS);
-
- cmd[3].i = ((src_pitch / 64) << 22) | (src_offset >> 10);
- cmd[4].i = ((dst_pitch / 64) << 22) | (dst_offset >> 10);
- cmd[5].i = (srcx << 16) | srcy;
- cmd[6].i = (dstx << 16) | dsty; /* dst */
- cmd[7].i = (w << 16) | h;
-}
-
-void r300EmitWait(r300ContextPtr rmesa, GLuint flags)
-{
- if (rmesa->radeon.dri.drmMinor >= 6) {
- drm_radeon_cmd_header_t *cmd;
-
- assert(!(flags & ~(R300_WAIT_2D | R300_WAIT_3D)));
-
- cmd =
- (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa,
- 1,
- __FUNCTION__);
- cmd[0].i = 0;
- cmd[0].wait.cmd_type = R300_CMD_WAIT;
- cmd[0].wait.flags = flags;
- }
-}
-
-void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset)
-{
- int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
- int i;
- LOCAL_VARS
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr, offset);
-
- start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz-1);
- e32(nr);
- for(i=0;i+1<nr;i+=2){
- e32( (rmesa->state.aos[i].aos_size << 0)
- |(rmesa->state.aos[i].aos_stride << 8)
- |(rmesa->state.aos[i+1].aos_size << 16)
- |(rmesa->state.aos[i+1].aos_stride << 24)
- );
- e32(rmesa->state.aos[i].aos_offset+offset*4*rmesa->state.aos[i].aos_stride);
- e32(rmesa->state.aos[i+1].aos_offset+offset*4*rmesa->state.aos[i+1].aos_stride);
- }
- if(nr & 1){
- e32( (rmesa->state.aos[nr-1].aos_size << 0)
- |(rmesa->state.aos[nr-1].aos_stride << 8)
- );
- e32(rmesa->state.aos[nr-1].aos_offset+offset*4*rmesa->state.aos[nr-1].aos_stride);
- }
-
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.h
deleted file mode 100644
index b471f2ac4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_cmdbuf.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __R300_CMDBUF_H__
-#define __R300_CMDBUF_H__
-
-#include "r300_context.h"
-
-
-extern int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller);
-extern int r300FlushCmdBuf(r300ContextPtr r300, const char* caller);
-
-extern void r300EmitState(r300ContextPtr r300);
-
-extern void r300InitCmdBuf(r300ContextPtr r300);
-extern void r300DestroyCmdBuf(r300ContextPtr r300);
-
-extern void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset);
-
-
-/**
- * Make sure that enough space is available in the command buffer
- * by flushing if necessary.
- */
-static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300,
- int dwords, const char* caller)
-{
- assert(dwords < r300->cmdbuf.size);
-
- if (r300->cmdbuf.count_used + dwords > r300->cmdbuf.size)
- r300FlushCmdBuf(r300, caller);
-}
-
-
-/**
- * Allocate the given number of dwords in the command buffer and return
- * a pointer to the allocated area.
- * When necessary, these functions cause a flush. r300AllocCmdBuf() also
- * causes state reemission after a flush. This is necessary to ensure
- * correct hardware state after an unlock.
- */
-static __inline__ uint32_t* r300RawAllocCmdBuf(r300ContextPtr r300,
- int dwords, const char* caller)
-{
- uint32_t* ptr;
-
- r300EnsureCmdBufSpace(r300, dwords, caller);
-
- ptr = &r300->cmdbuf.cmd_buf[r300->cmdbuf.count_used];
- r300->cmdbuf.count_used += dwords;
- return ptr;
-}
-
-static __inline__ uint32_t* r300AllocCmdBuf(r300ContextPtr r300,
- int dwords, const char* caller)
-{
- uint32_t* ptr;
-
- r300EnsureCmdBufSpace(r300, dwords, caller);
-
- if (!r300->cmdbuf.count_used) {
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "Reemit state after flush (from %s)\n",
- caller);
- r300EmitState(r300);
- }
-
- ptr = &r300->cmdbuf.cmd_buf[r300->cmdbuf.count_used];
- r300->cmdbuf.count_used += dwords;
- return ptr;
-}
-
-extern void r300EmitBlit(r300ContextPtr rmesa,
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty, GLuint w, GLuint h);
-
-extern void r300EmitWait(r300ContextPtr rmesa, GLuint flags);
-extern void r300EmitLOAD_VBPNTR(r300ContextPtr rmesa, int start);
-extern void r300EmitVertexShader(r300ContextPtr rmesa);
-extern void r300EmitPixelShader(r300ContextPtr rmesa);
-
-#endif /* __R300_CMDBUF_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.c
deleted file mode 100644
index ba0c55069..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.c
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-#include "glheader.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "state.h"
-#include "bufferobj.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "radeon_ioctl.h"
-#include "radeon_span.h"
-#include "r300_context.h"
-#include "r300_cmdbuf.h"
-#include "r300_state.h"
-#include "r300_ioctl.h"
-#include "r300_tex.h"
-
-#include "vblank.h"
-#include "utils.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
-
-/* hw_tcl_on derives from future_hw_tcl_on when its safe to change it. */
-int future_hw_tcl_on=0;
-int hw_tcl_on=0;
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-#define need_GL_ARB_vertex_program
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_secondary_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_NV_vertex_program
-#include "extension_helper.h"
-
-const struct dri_extension card_extensions[] = {
- {"GL_ARB_multisample", GL_ARB_multisample_functions},
- {"GL_ARB_multitexture", NULL},
- {"GL_ARB_texture_border_clamp", NULL},
- {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
-/* disable until we support it, fixes a few things in ut2004 */
-/* {"GL_ARB_texture_cube_map", NULL}, */
- {"GL_ARB_texture_env_add", NULL},
- {"GL_ARB_texture_env_combine", NULL},
- {"GL_ARB_texture_env_crossbar", NULL},
- {"GL_ARB_texture_env_dot3", NULL},
- {"GL_ARB_texture_mirrored_repeat", NULL},
- {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
- {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
-#if USE_ARB_F_P == 1
- {"GL_ARB_fragment_program", NULL},
-#endif
- {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions},
- {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
- {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
- {"GL_EXT_blend_subtract", NULL},
- {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
- {"GL_EXT_stencil_wrap", NULL},
- {"GL_EXT_texture_edge_clamp", NULL},
- {"GL_EXT_texture_env_combine", NULL},
- {"GL_EXT_texture_env_dot3", NULL},
- {"GL_EXT_texture_filter_anisotropic", NULL},
- {"GL_EXT_texture_lod_bias", NULL},
- {"GL_EXT_texture_mirror_clamp", NULL},
- {"GL_EXT_texture_rectangle", NULL},
- {"GL_ATI_texture_env_combine3", NULL},
- {"GL_ATI_texture_mirror_once", NULL},
- {"GL_MESA_pack_invert", NULL},
- {"GL_MESA_ycbcr_texture", NULL},
- {"GL_NV_blend_square", NULL},
- {"GL_NV_vertex_program", GL_NV_vertex_program_functions},
- {"GL_SGIS_generate_mipmap", NULL},
- {NULL, NULL}
-};
-
-extern struct tnl_pipeline_stage _r300_render_stage;
-extern struct tnl_pipeline_stage _r300_tcl_stage;
-
-static const struct tnl_pipeline_stage *r300_pipeline[] = {
-
- /* Try and go straight to t&l
- */
- &_r300_tcl_stage,
-
- /* Catch any t&l fallbacks
- */
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_arb_vertex_program_stage,
- &_tnl_vertex_program_stage,
-
- /* Try again to go to tcl?
- * - no good for asymmetric-twoside (do with multipass)
- * - no good for asymmetric-unfilled (do with multipass)
- * - good for material
- * - good for texgen
- * - need to manipulate a bit of state
- *
- * - worth it/not worth it?
- */
-
- /* Else do them here.
- */
- &_r300_render_stage,
- &_tnl_render_stage, /* FALLBACK */
- 0,
-};
-
-static void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
- const GLvoid *data, GLenum usage, struct gl_buffer_object *obj)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- drm_radeon_mem_alloc_t alloc;
- int offset, ret;
-
- /* Free previous buffer */
- if (obj->OnCard) {
- drm_radeon_mem_free_t memfree;
-
- memfree.region = RADEON_MEM_REGION_GART;
- memfree.region_offset = (char *)obj->Data - (char *)rmesa->radeon.radeonScreen->gartTextures.map;
-
- ret = drmCommandWrite(rmesa->radeon.radeonScreen->driScreen->fd,
- DRM_RADEON_FREE, &memfree, sizeof(memfree));
-
- if (ret) {
- WARN_ONCE("Failed to free GART memroy!\n");
- }
- obj->OnCard = GL_FALSE;
- }
-
- alloc.region = RADEON_MEM_REGION_GART;
- alloc.alignment = 4;
- alloc.size = size;
- alloc.region_offset = &offset;
-
- ret = drmCommandWriteRead( rmesa->radeon.dri.fd, DRM_RADEON_ALLOC, &alloc, sizeof(alloc));
- if (ret) {
- WARN_ONCE("Ran out of GART memory!\n");
- obj->Data = NULL;
- _mesa_buffer_data(ctx, target, size, data, usage, obj);
- return ;
- }
- obj->Data = ((char *)rmesa->radeon.radeonScreen->gartTextures.map) + offset;
-
- if (data)
- memcpy(obj->Data, data, size);
-
- obj->Size = size;
- obj->Usage = usage;
- obj->OnCard = GL_TRUE;
-#if 0
- fprintf(stderr, "allocated %d bytes at %p, offset=%d\n", size, obj->Data, offset);
-#endif
-}
-
-static void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- if(r300IsGartMemory(rmesa, obj->Data, obj->Size)){
- drm_radeon_mem_free_t memfree;
- int ret;
-
- memfree.region = RADEON_MEM_REGION_GART;
- memfree.region_offset = (char *)obj->Data - (char *)rmesa->radeon.radeonScreen->gartTextures.map;
-
- ret = drmCommandWrite(rmesa->radeon.radeonScreen->driScreen->fd,
- DRM_RADEON_FREE, &memfree, sizeof(memfree));
-
- if(ret){
- WARN_ONCE("Failed to free GART memroy!\n");
- }
- obj->Data = NULL;
- }
- _mesa_delete_buffer_object(ctx, obj);
-}
-
-/* Create the device specific rendering context.
- */
-GLboolean r300CreateContext(const __GLcontextModes * glVisual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate)
-{
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
- struct dd_function_table functions;
- r300ContextPtr r300;
- GLcontext *ctx;
- int tcl_mode, i;
-
- assert(glVisual);
- assert(driContextPriv);
- assert(screen);
-
- /* Allocate the R300 context */
- r300 = (r300ContextPtr)CALLOC(sizeof(*r300));
- if (!r300)
- return GL_FALSE;
-
- /* Parse configuration files.
- * Do this here so that initialMaxAnisotropy is set before we create
- * the default textures.
- */
- driParseConfigFiles(&r300->radeon.optionCache, &screen->optionCache,
- screen->driScreen->myNum, "r300");
-
- /* Init default driver functions then plug in our R300-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions(&functions);
- r300InitIoctlFuncs(&functions);
- r300InitStateFuncs(&functions);
- r300InitTextureFuncs(&functions);
- r300InitShaderFuncs(&functions);
-
-#if 0 /* Needs various Mesa changes... */
- if (hw_tcl_on) {
- functions.BufferData = r300BufferData;
- functions.DeleteBuffer = r300DeleteBuffer;
- }
-#endif
-
- if (!radeonInitContext(&r300->radeon, &functions,
- glVisual, driContextPriv, sharedContextPrivate)) {
- FREE(r300);
- return GL_FALSE;
- }
-
- /* Init r300 context data */
- r300->dma.buf0_address = r300->radeon.radeonScreen->buffers->list[0].address;
-
- (void)memset(r300->texture_heaps, 0, sizeof(r300->texture_heaps));
- make_empty_list(&r300->swapped);
-
- r300->nr_heaps = 1 /* screen->numTexHeaps */ ;
- assert(r300->nr_heaps < R200_NR_TEX_HEAPS);
- for (i = 0; i < r300->nr_heaps; i++) {
- r300->texture_heaps[i] = driCreateTextureHeap(i, r300,
- screen->
- texSize[i], 12,
- RADEON_NR_TEX_REGIONS,
- (drmTextureRegionPtr)
- r300->radeon.sarea->
- tex_list[i],
- &r300->radeon.sarea->
- tex_age[i],
- &r300->swapped,
- sizeof
- (r300TexObj),
- (destroy_texture_object_t
- *)
- r300DestroyTexObj);
- }
- r300->texture_depth = driQueryOptioni(&r300->radeon.optionCache,
- "texture_depth");
- if (r300->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
- r300->texture_depth = (screen->cpp == 4) ?
- DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
- /* Set the maximum texture size small enough that we can guarentee that
- * all texture units can bind a maximal texture and have them both in
- * texturable memory at once.
- */
-
- ctx = r300->radeon.glCtx;
-
- ctx->Const.MaxTextureImageUnits = driQueryOptioni(&r300->radeon.optionCache,
- "texture_image_units");
- ctx->Const.MaxTextureCoordUnits = driQueryOptioni(&r300->radeon.optionCache,
- "texture_coord_units");
- ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureImageUnits,
- ctx->Const.MaxTextureCoordUnits);
- ctx->Const.MaxTextureMaxAnisotropy = 16.0;
-
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = R300_POINTSIZE_MAX;
- ctx->Const.MaxPointSizeAA = R300_POINTSIZE_MAX;
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = R300_LINESIZE_MAX;
- ctx->Const.MaxLineWidthAA = R300_LINESIZE_MAX;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
- _tnl_CreateContext(ctx);
- _swsetup_CreateContext(ctx);
- _swsetup_Wakeup(ctx);
- _ae_create_context(ctx);
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, r300_pipeline);
-
- /* Try and keep materials and vertices separate:
- */
- _tnl_isolate_materials(ctx, GL_TRUE);
-
- /* Configure swrast and TNL to match hardware characteristics:
- */
- _swrast_allow_pixel_fog(ctx, GL_FALSE);
- _swrast_allow_vertex_fog(ctx, GL_TRUE);
- _tnl_allow_pixel_fog(ctx, GL_FALSE);
- _tnl_allow_vertex_fog(ctx, GL_TRUE);
-
- /* currently bogus data */
- ctx->Const.MaxVertexProgramInstructions=VSF_MAX_FRAGMENT_LENGTH;
- ctx->Const.MaxVertexProgramAttribs=16; // r420
- ctx->Const.MaxVertexProgramTemps=VSF_MAX_FRAGMENT_TEMPS;
- ctx->Const.MaxVertexProgramLocalParams=256; // r420
- ctx->Const.MaxVertexProgramEnvParams=256; // r420
- ctx->Const.MaxVertexProgramAddressRegs=1;
-
-#if USE_ARB_F_P
- ctx->Const.MaxFragmentProgramTemps = PFS_NUM_TEMP_REGS;
- ctx->Const.MaxFragmentProgramAttribs = 11; /* copy i915... */
- ctx->Const.MaxFragmentProgramLocalParams = PFS_NUM_CONST_REGS;
- ctx->Const.MaxFragmentProgramEnvParams = PFS_NUM_CONST_REGS;
- ctx->Const.MaxFragmentProgramAluInstructions = PFS_MAX_ALU_INST;
- ctx->Const.MaxFragmentProgramTexInstructions = PFS_MAX_TEX_INST;
- ctx->Const.MaxFragmentProgramInstructions = PFS_MAX_ALU_INST+PFS_MAX_TEX_INST;
- ctx->Const.MaxFragmentProgramTexIndirections = PFS_MAX_TEX_INDIRECT;
- ctx->Const.MaxFragmentProgramAddressRegs = 0; /* and these are?? */
- ctx->_MaintainTexEnvProgram = GL_TRUE;
-#endif
-
- driInitExtensions(ctx, card_extensions, GL_TRUE);
-
- radeonInitSpanFuncs(ctx);
- r300InitCmdBuf(r300);
- r300InitState(r300);
-
-#if 0
- /* plug in a few more device driver functions */
- /* XXX these should really go right after _mesa_init_driver_functions() */
- r300InitPixelFuncs(ctx);
- r300InitSwtcl(ctx);
-#endif
- TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
-
- tcl_mode = driQueryOptioni(&r300->radeon.optionCache, "tcl_mode");
- if (driQueryOptionb(&r300->radeon.optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
-#if R200_MERGED
- FALLBACK(&r300->radeon, RADEON_FALLBACK_DISABLE, 1);
-#endif
- }
- if (tcl_mode == DRI_CONF_TCL_SW ||
- !(r300->radeon.radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
- if (r300->radeon.radeonScreen->chipset & RADEON_CHIPSET_TCL) {
- r300->radeon.radeonScreen->chipset &= ~RADEON_CHIPSET_TCL;
- fprintf(stderr, "Disabling HW TCL support\n");
- }
- TCL_FALLBACK(r300->radeon.glCtx, RADEON_TCL_FALLBACK_TCL_DISABLE, 1);
- }
-
- return GL_TRUE;
-}
-
-/* Destroy the device specific context.
- */
-void r300DestroyContext(__DRIcontextPrivate * driContextPriv)
-{
- GET_CURRENT_CONTEXT(ctx);
- r300ContextPtr r300 = (r300ContextPtr) driContextPriv->driverPrivate;
- radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL;
-
- if (RADEON_DEBUG & DEBUG_DRI) {
- fprintf(stderr, "Destroying context !\n");
- }
-
- /* check if we're deleting the currently bound context */
- if (&r300->radeon == current) {
- radeonFlush(r300->radeon.glCtx);
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- /* Free r300 context resources */
- assert(r300); /* should never be null */
-
- if (r300) {
- GLboolean release_texture_heaps;
-
- release_texture_heaps = (r300->radeon.glCtx->Shared->RefCount == 1);
- _swsetup_DestroyContext(r300->radeon.glCtx);
- _tnl_DestroyContext(r300->radeon.glCtx);
- _ac_DestroyContext(r300->radeon.glCtx);
- _swrast_DestroyContext(r300->radeon.glCtx);
-
- r300DestroyCmdBuf(r300);
-
- radeonCleanupContext(&r300->radeon);
-
- /* free the option cache */
- driDestroyOptionCache(&r300->radeon.optionCache);
-
- FREE(r300);
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.h
deleted file mode 100644
index b59f184e3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_context.h
+++ /dev/null
@@ -1,844 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __R300_CONTEXT_H__
-#define __R300_CONTEXT_H__
-
-#include "tnl/t_vertex.h"
-#include "drm.h"
-#include "radeon_drm.h"
-#include "dri_util.h"
-#include "texmem.h"
-
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "radeon_context.h"
-
-#define USE_ARB_F_P 1
-
-struct r300_context;
-typedef struct r300_context r300ContextRec;
-typedef struct r300_context *r300ContextPtr;
-
-#include "radeon_lock.h"
-#include "mm.h"
-
-/* Checkpoint.. for convenience */
-#define CPT { fprintf(stderr, "%s:%s line %d\n", __FILE__, __FUNCTION__, __LINE__); }
-/* From http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html .
- I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble
- with other compilers ... GLUE!
-*/
-#if 1
-#define WARN_ONCE(a, ...) { \
- static int warn##__LINE__=1; \
- if(warn##__LINE__){ \
- fprintf(stderr, "*********************************WARN_ONCE*********************************\n"); \
- fprintf(stderr, "File %s function %s line %d\n", \
- __FILE__, __FUNCTION__, __LINE__); \
- fprintf(stderr, a, ## __VA_ARGS__);\
- fprintf(stderr, "***************************************************************************\n"); \
- warn##__LINE__=0;\
- } \
- }
-#else
-#define WARN_ONCE(a, ...) {}
-#endif
-
-typedef GLuint uint32_t;
-typedef GLubyte uint8_t;
-struct r300_fragment_program;
-
- /* We should probably change types within vertex_shader
- and pixel_shader structure later on */
-#define CARD32 GLuint
-#include "vertex_shader.h"
-#if USE_ARB_F_P == 1
-#include "r300_fragprog.h"
-#else
-#include "pixel_shader.h"
-#endif
-#undef CARD32
-
-static __inline__ uint32_t r300PackFloat32(float fl)
-{
- union { float fl; uint32_t u; } u;
-
- u.fl = fl;
- return u.u;
-}
-
-
-/************ DMA BUFFERS **************/
-
-/* Need refcounting on dma buffers:
- */
-struct r300_dma_buffer {
- int refcount; /* the number of retained regions in buf */
- drmBufPtr buf;
-};
-
-#define GET_START(rvb) (rmesa->radeon.radeonScreen->gart_buffer_offset + \
- (rvb)->address - rmesa->dma.buf0_address + \
- (rvb)->start)
-
-/* A retained region, eg vertices for indexed vertices.
- */
-struct r300_dma_region {
- struct r300_dma_buffer *buf;
- char *address; /* == buf->address */
- int start, end, ptr; /* offsets from start of buf */
-
- int aos_offset; /* address in GART memory */
- int aos_stride; /* distance between elements, in dwords */
- int aos_size; /* number of components (1-4) */
- int aos_format; /* format of components */
- int aos_reg; /* VAP register assignment */
-};
-
-struct r300_dma {
- /* Active dma region. Allocations for vertices and retained
- * regions come from here. Also used for emitting random vertices,
- * these may be flushed by calling flush_current();
- */
- struct r300_dma_region current;
-
- void (*flush) (r300ContextPtr);
-
- char *buf0_address; /* start of buf[0], for index calcs */
-
- /* Number of "in-flight" DMA buffers, i.e. the number of buffers
- * for which a DISCARD command is currently queued in the command buffer.
- */
- GLuint nr_released_bufs;
-};
-
- /* Texture related */
-
-typedef struct r300_tex_obj r300TexObj, *r300TexObjPtr;
-
-/* Texture object in locally shared texture space.
- */
-struct r300_tex_obj {
- driTextureObject base;
-
- GLuint bufAddr; /* Offset to start of locally
- shared texture block */
-
- GLuint dirty_state; /* Flags (1 per texunit) for
- whether or not this texobj
- has dirty hardware state
- (pp_*) that needs to be
- brought into the
- texunit. */
-
- drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
- /* Six, for the cube faces */
-
-
- /* hardware register values */
- /* Note that R200 has 8 registers per texture and R300 only 7 */
- GLuint filter;
- GLuint pitch; /* one of the unknown registers.. unknown 1 ?*/
- GLuint size; /* npot only */
- GLuint format;
- GLuint offset; /* Image location in the card's address space.
- All cube faces follow. */
- GLuint unknown4;
- GLuint unknown5;
- /* end hardware registers */
-
- /* registers computed by r200 code - keep them here to
- compare against what is actually written.
-
- to be removed later.. */
- GLuint pp_border_color;
- GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
- GLuint format_x;
-
-
- GLboolean border_fallback;
-};
-
-struct r300_texture_env_state {
- r300TexObjPtr texobj;
- GLenum format;
- GLenum envMode;
-};
-
-#define R300_MAX_TEXTURE_UNITS 8
-
-struct r300_texture_state {
- struct r300_texture_env_state unit[R300_MAX_TEXTURE_UNITS];
- int tc_count; /* number of incoming texture coordinates from VAP */
-};
-
-/**
- * A block of hardware state.
- *
- * When check returns non-zero, the returned number of dwords must be
- * copied verbatim into the command buffer in order to update a state atom
- * when it is dirty.
- */
-struct r300_state_atom {
- struct r300_state_atom *next, *prev;
- const char* name; /* for debug */
- int cmd_size; /* maximum size in dwords */
- GLuint idx; /* index in an array (e.g. textures) */
- uint32_t* cmd;
- GLboolean dirty;
-
- int (*check)(r300ContextPtr, struct r300_state_atom* atom);
-};
-
-
-#define R300_VPT_CMD_0 0
-#define R300_VPT_XSCALE 1
-#define R300_VPT_XOFFSET 2
-#define R300_VPT_YSCALE 3
-#define R300_VPT_YOFFSET 4
-#define R300_VPT_ZSCALE 5
-#define R300_VPT_ZOFFSET 6
-#define R300_VPT_CMDSIZE 7
-
-#define R300_VIR_CMD_0 0 /* vir is variable size (at least 1) */
-#define R300_VIR_CNTL_0 1
-#define R300_VIR_CNTL_1 2
-#define R300_VIR_CNTL_2 3
-#define R300_VIR_CNTL_3 4
-#define R300_VIR_CNTL_4 5
-#define R300_VIR_CNTL_5 6
-#define R300_VIR_CNTL_6 7
-#define R300_VIR_CNTL_7 8
-#define R300_VIR_CMDSIZE 9
-
-#define R300_VIC_CMD_0 0
-#define R300_VIC_CNTL_0 1
-#define R300_VIC_CNTL_1 2
-#define R300_VIC_CMDSIZE 3
-
-#define R300_VOF_CMD_0 0
-#define R300_VOF_CNTL_0 1
-#define R300_VOF_CNTL_1 2
-#define R300_VOF_CMDSIZE 3
-
-
-#define R300_PVS_CMD_0 0
-#define R300_PVS_CNTL_1 1
-#define R300_PVS_CNTL_2 2
-#define R300_PVS_CNTL_3 3
-#define R300_PVS_CMDSIZE 4
-
-#define R300_GB_MISC_CMD_0 0
-#define R300_GB_MISC_MSPOS_0 1
-#define R300_GB_MISC_MSPOS_1 2
-#define R300_GB_MISC_TILE_CONFIG 3
-#define R300_GB_MISC_SELECT 4
-#define R300_GB_MISC_AA_CONFIG 5
-#define R300_GB_MISC_CMDSIZE 6
-
-#define R300_TXE_CMD_0 0
-#define R300_TXE_ENABLE 1
-#define R300_TXE_CMDSIZE 2
-
-#define R300_PS_CMD_0 0
-#define R300_PS_POINTSIZE 1
-#define R300_PS_CMDSIZE 2
-
-#define R300_ZBS_CMD_0 0
-#define R300_ZBS_T_FACTOR 1
-#define R300_ZBS_T_CONSTANT 2
-#define R300_ZBS_W_FACTOR 3
-#define R300_ZBS_W_CONSTANT 4
-#define R300_ZBS_CMDSIZE 5
-
-#define R300_CUL_CMD_0 0
-#define R300_CUL_CULL 1
-#define R300_CUL_CMDSIZE 2
-
-#define R300_RC_CMD_0 0
-#define R300_RC_CNTL_0 1
-#define R300_RC_CNTL_1 2
-#define R300_RC_CMDSIZE 3
-
-#define R300_RI_CMD_0 0
-#define R300_RI_INTERP_0 1
-#define R300_RI_INTERP_1 2
-#define R300_RI_INTERP_2 3
-#define R300_RI_INTERP_3 4
-#define R300_RI_INTERP_4 5
-#define R300_RI_INTERP_5 6
-#define R300_RI_INTERP_6 7
-#define R300_RI_INTERP_7 8
-#define R300_RI_CMDSIZE 9
-
-#define R300_RR_CMD_0 0 /* rr is variable size (at least 1) */
-#define R300_RR_ROUTE_0 1
-#define R300_RR_ROUTE_1 2
-#define R300_RR_ROUTE_2 3
-#define R300_RR_ROUTE_3 4
-#define R300_RR_ROUTE_4 5
-#define R300_RR_ROUTE_5 6
-#define R300_RR_ROUTE_6 7
-#define R300_RR_ROUTE_7 8
-#define R300_RR_CMDSIZE 9
-
-#define R300_FP_CMD_0 0
-#define R300_FP_CNTL0 1
-#define R300_FP_CNTL1 2
-#define R300_FP_CNTL2 3
-#define R300_FP_CMD_1 4
-#define R300_FP_NODE0 5
-#define R300_FP_NODE1 6
-#define R300_FP_NODE2 7
-#define R300_FP_NODE3 8
-#define R300_FP_CMDSIZE 9
-
-#define R300_FPT_CMD_0 0
-#define R300_FPT_INSTR_0 1
-#define R300_FPT_CMDSIZE 65
-
-#define R300_FPI_CMD_0 0
-#define R300_FPI_INSTR_0 1
-#define R300_FPI_CMDSIZE 65
-
-#define R300_FPP_CMD_0 0
-#define R300_FPP_PARAM_0 1
-#define R300_FPP_CMDSIZE (32*4+1)
-
-#define R300_AT_CMD_0 0
-#define R300_AT_ALPHA_TEST 1
-#define R300_AT_UNKNOWN 2
-#define R300_AT_CMDSIZE 3
-
-#define R300_BLD_CMD_0 0
-#define R300_BLD_CBLEND 1
-#define R300_BLD_ABLEND 2
-#define R300_BLD_CMDSIZE 3
-
-#define R300_CMK_CMD_0 0
-#define R300_CMK_COLORMASK 1
-#define R300_CMK_CMDSIZE 2
-
-#define R300_CB_CMD_0 0
-#define R300_CB_OFFSET 1
-#define R300_CB_CMD_1 2
-#define R300_CB_PITCH 3
-#define R300_CB_CMDSIZE 4
-
-#define R300_ZS_CMD_0 0
-#define R300_ZS_CNTL_0 1
-#define R300_ZS_CNTL_1 2
-#define R300_ZS_CNTL_2 3
-#define R300_ZS_CMDSIZE 4
-
-#define R300_ZB_CMD_0 0
-#define R300_ZB_OFFSET 1
-#define R300_ZB_PITCH 2
-#define R300_ZB_CMDSIZE 3
-
-#define R300_VPI_CMD_0 0
-#define R300_VPI_INSTR_0 1
-#define R300_VPI_CMDSIZE 1025 /* 256 16 byte instructions */
-
-#define R300_VPP_CMD_0 0
-#define R300_VPP_PARAM_0 1
-#define R300_VPP_CMDSIZE 1025 /* 256 4-component parameters */
-
-#define R300_VPS_CMD_0 0
-#define R300_VPS_ZERO_0 1
-#define R300_VPS_ZERO_1 2
-#define R300_VPS_POINTSIZE 3
-#define R300_VPS_ZERO_3 4
-#define R300_VPS_CMDSIZE 5
-
- /* the layout is common for all fields inside tex */
-#define R300_TEX_CMD_0 0
-#define R300_TEX_VALUE_0 1
-/* We don't really use this, instead specify mtu+1 dynamically
-#define R300_TEX_CMDSIZE (MAX_TEXTURE_UNITS+1)
-*/
-
-/**
- * Cache for hardware register state.
- */
-struct r300_hw_state {
- struct r300_state_atom atomlist;
-
- GLboolean is_dirty;
- GLboolean all_dirty;
- int max_state_size; /* in dwords */
-
- struct r300_state_atom vpt; /* viewport (1D98) */
- struct r300_state_atom unk2080; /* (2080) */
- struct r300_state_atom vof; /* VAP output format register 0x2090 */
- struct r300_state_atom vte; /* (20B0) */
- struct r300_state_atom unk2134; /* (2134) */
- struct r300_state_atom unk2140; /* (2140) */
- struct r300_state_atom vir[2]; /* vap input route (2150/21E0) */
- struct r300_state_atom vic; /* vap input control (2180) */
- struct r300_state_atom unk21DC; /* (21DC) */
- struct r300_state_atom unk221C; /* (221C) */
- struct r300_state_atom unk2220; /* (2220) */
- struct r300_state_atom unk2288; /* (2288) */
- struct r300_state_atom pvs; /* pvs_cntl (22D0) */
- struct r300_state_atom gb_enable; /* (4008) */
- struct r300_state_atom gb_misc; /* Multisampling position shifts ? (4010) */
- struct r300_state_atom unk4200; /* (4200) */
- struct r300_state_atom unk4214; /* (4214) */
- struct r300_state_atom ps; /* pointsize (421C) */
- struct r300_state_atom unk4230; /* (4230) */
- struct r300_state_atom lcntl; /* line control */
- struct r300_state_atom unk4260; /* (4260) */
- struct r300_state_atom unk4274; /* (4274) */
- struct r300_state_atom unk4288; /* (4288) */
- struct r300_state_atom unk42A0; /* (42A0) */
- struct r300_state_atom zbs; /* zbias (42A4) */
- struct r300_state_atom unk42B4; /* (42B4) */
- struct r300_state_atom cul; /* cull cntl (42B8) */
- struct r300_state_atom unk42C0; /* (42C0) */
- struct r300_state_atom rc; /* rs control (4300) */
- struct r300_state_atom ri; /* rs interpolators (4310) */
- struct r300_state_atom rr; /* rs route (4330) */
- struct r300_state_atom unk43A4; /* (43A4) */
- struct r300_state_atom unk43E8; /* (43E8) */
- struct r300_state_atom fp; /* fragment program cntl + nodes (4600) */
- struct r300_state_atom fpt; /* texi - (4620) */
- struct r300_state_atom unk46A4; /* (46A4) */
- struct r300_state_atom fpi[4]; /* fp instructions (46C0/47C0/48C0/49C0) */
- struct r300_state_atom unk4BC0; /* (4BC0) */
- struct r300_state_atom unk4BC8; /* (4BC8) */
- struct r300_state_atom at; /* alpha test (4BD4) */
- struct r300_state_atom unk4BD8; /* (4BD8) */
- struct r300_state_atom fpp; /* 0x4C00 and following */
- struct r300_state_atom unk4E00; /* (4E00) */
- struct r300_state_atom bld; /* blending (4E04) */
- struct r300_state_atom cmk; /* colormask (4E0C) */
- struct r300_state_atom unk4E10; /* (4E10) */
- struct r300_state_atom cb; /* colorbuffer (4E28) */
- struct r300_state_atom unk4E50; /* (4E50) */
- struct r300_state_atom unk4E88; /* (4E88) */
- struct r300_state_atom unk4EA0; /* (4E88) I saw it only written on RV350 hardware.. */
- struct r300_state_atom zs; /* zstencil control (4F00) */
- struct r300_state_atom unk4F10; /* (4F10) */
- struct r300_state_atom zb; /* z buffer (4F20) */
- struct r300_state_atom unk4F28; /* (4F28) */
- struct r300_state_atom unk4F30; /* (4F30) */
- struct r300_state_atom unk4F44; /* (4F44) */
- struct r300_state_atom unk4F54; /* (4F54) */
-
- struct r300_state_atom vpi; /* vp instructions */
- struct r300_state_atom vpp; /* vp parameters */
- struct r300_state_atom vps; /* vertex point size (?) */
- /* 8 texture units */
- /* the state is grouped by function and not by
- texture unit. This makes single unit updates
- really awkward - we are much better off
- updating the whole thing at once */
- struct {
- struct r300_state_atom filter;
- struct r300_state_atom unknown1;
- struct r300_state_atom size;
- struct r300_state_atom format;
- struct r300_state_atom offset;
- struct r300_state_atom unknown4;
- struct r300_state_atom border_color;
- } tex;
- struct r300_state_atom txe; /* tex enable (4104) */
-};
-
-
-/**
- * This structure holds the command buffer while it is being constructed.
- *
- * The first batch of commands in the buffer is always the state that needs
- * to be re-emitted when the context is lost. This batch can be skipped
- * otherwise.
- */
-struct r300_cmdbuf {
- int size; /* DWORDs allocated for buffer */
- uint32_t* cmd_buf;
- int count_used; /* DWORDs filled so far */
- int count_reemit; /* size of re-emission batch */
-};
-
-
-/**
- * State cache
- */
-
-struct r300_depthbuffer_state {
- GLfloat scale;
-};
-
-struct r300_stencilbuffer_state {
- GLuint clear;
- GLboolean hw_stencil;
-
-};
-
-struct r300_vap_reg_state {
- /* input register assigments */
- int i_coords;
- int i_normal;
- int i_color[2];
- int i_fog;
- int i_tex[R300_MAX_TEXTURE_UNITS];
- int i_index;
- int i_pointsize;
- };
-
-/* Vertex shader state */
-
-/* Tested with rv350 and verified from misc web pages. */
-#define VSF_MAX_FRAGMENT_LENGTH (256*4)
-
-/* Tested with rv350 and verified from misc web pages. */
-#define VSF_MAX_FRAGMENT_TEMPS (32)
-
-
-struct r300_vertex_shader_fragment {
- int length;
- union {
- GLuint d[VSF_MAX_FRAGMENT_LENGTH];
- float f[VSF_MAX_FRAGMENT_LENGTH];
- VERTEX_SHADER_INSTRUCTION i[VSF_MAX_FRAGMENT_LENGTH/4];
- } body;
- };
-
-#define VSF_DEST_PROGRAM 0x0
-#define VSF_DEST_MATRIX0 0x200
-#define VSF_DEST_MATRIX1 0x204
-#define VSF_DEST_MATRIX2 0x208
-#define VSF_DEST_VECTOR0 0x20c
-#define VSF_DEST_VECTOR1 0x20d
-#define VSF_DEST_UNKNOWN1 0x400
-#define VSF_DEST_UNKNOWN2 0x406
-
-struct r300_vertex_shader_state {
- struct r300_vertex_shader_fragment program;
-
- /* a bit of a waste - each uses only a subset of allocated space..
- but easier to program */
- struct r300_vertex_shader_fragment matrix[3];
- struct r300_vertex_shader_fragment vector[2];
-
- struct r300_vertex_shader_fragment unknown1;
- struct r300_vertex_shader_fragment unknown2;
-
- int program_start;
- int unknown_ptr1; /* pointer within program space */
- int program_end;
-
- int param_offset;
- int param_count;
-
- int unknown_ptr2; /* pointer within program space */
- int unknown_ptr3; /* pointer within program space */
- };
-
-extern int hw_tcl_on;
-
-#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : ctx->_TnlProgram)
-
-//#define TMU_ENABLED(ctx, unit) (hw_tcl_on ? ctx->Texture.Unit[unit]._ReallyEnabled && (OutputsWritten & (1<<(VERT_RESULT_TEX0+(unit)))) :
-// (r300->state.render_inputs & (_TNL_BIT_TEX0<<(unit))))
-#define TMU_ENABLED(ctx, unit) (hw_tcl_on ? ctx->Texture.Unit[unit]._ReallyEnabled && OutputsWritten & (1<<(VERT_RESULT_TEX0+(unit))) : \
- ctx->Texture.Unit[unit]._ReallyEnabled && r300->state.render_inputs & (_TNL_BIT_TEX0<<(unit)))
-
-/* r300_vertex_shader_state and r300_vertex_program should probably be merged together someday.
- * Keeping them them seperate for now should ensure fixed pipeline keeps functioning properly.
- */
-struct r300_vertex_program {
- struct vertex_program mesa_program; /* Must be first */
- int translated;
-
- struct r300_vertex_shader_fragment program;
- struct r300_vertex_shader_fragment params;
-
- int pos_end;
- unsigned long num_temporaries; /* Number of temp vars used by program */
- int inputs[VERT_ATTRIB_MAX];
- int outputs[VERT_RESULT_MAX];
-};
-
-#if USE_ARB_F_P == 1
-#define PFS_MAX_ALU_INST 64
-#define PFS_MAX_TEX_INST 64
-#define PFS_MAX_TEX_INDIRECT 4
-#define PFS_NUM_TEMP_REGS 32
-#define PFS_NUM_CONST_REGS 32
-struct r300_fragment_program {
- struct fragment_program mesa_program;
-
- GLcontext *ctx;
- GLboolean translated;
- GLboolean error;
-
- struct {
- int length;
- GLuint inst[PFS_MAX_TEX_INST];
- } tex;
-
- struct {
- struct {
- GLuint inst0;
- GLuint inst1;
- GLuint inst2;
- GLuint inst3;
- } inst[PFS_MAX_ALU_INST];
- } alu;
- int v_pos;
- int s_pos;
-
- struct {
- int tex_offset;
- int tex_end;
- int alu_offset;
- int alu_end;
- } node[4];
- int cur_node;
- int first_node_has_tex;
-
- int alu_offset;
- int alu_end;
- int tex_offset;
- int tex_end;
-
- /* Hardware constants */
- GLfloat constant[PFS_NUM_CONST_REGS][4];
- int const_nr;
-
- /* Tracked parameters */
- struct {
- int idx; /* hardware index */
- GLfloat *values; /* pointer to values */
- } param[PFS_NUM_CONST_REGS];
- int param_nr;
- GLboolean params_uptodate;
-
- GLuint temps[PFS_NUM_TEMP_REGS];
- int temp_in_use;
- GLuint used_in_node;
- GLuint dest_in_node;
- GLuint inputs[32]; /* don't actually need 32... */
-
- int hwreg_in_use;
- int max_temp_idx;
-};
-
-#else
-/* 64 appears to be the maximum */
-#define PSF_MAX_PROGRAM_LENGTH 64
-
-struct r300_pixel_shader_program {
- struct {
- int length;
- GLuint inst[PSF_MAX_PROGRAM_LENGTH];
- } tex;
-
- /* ALU intructions (logic and integer) */
- struct {
- int length;
- struct {
- GLuint inst0;
- GLuint inst1;
- GLuint inst2;
- GLuint inst3;
- } inst[PSF_MAX_PROGRAM_LENGTH];
- } alu;
-
- /* node information */
- /* nodes are used to synchronize ALU and TEX streams */
- /* There could be up to 4 nodes each consisting of
- a number of TEX instructions followed by some ALU
- instructions */
- /* the last node of a program should always be node3 */
- struct {
- int tex_offset;
- int tex_end;
- int alu_offset;
- int alu_end;
- } node[4];
-
- int active_nodes; /* must be between 1 and 4, inclusive */
- int first_node_has_tex; /* other nodes always have it */
-
- int temp_register_count; /* magic value goes into PFS_CNTL_1 */
-
- /* entire program */
- int tex_offset;
- int tex_end;
- int alu_offset;
- int alu_end;
-
- };
-
-#define MAX_PIXEL_SHADER_PARAMS 32
-struct r300_pixel_shader_state {
- struct r300_pixel_shader_program program;
-
- int translated;
- int have_sample;
- GLuint color_reg;
- GLuint src_previous;
-
- /* parameters */
- int param_length; /* to limit the number of unnecessary writes */
- struct {
- float x;
- float y;
- float z;
- float w;
- } param[MAX_PIXEL_SHADER_PARAMS];
- };
-#endif // USE_ARB_F_P
-
-/* 8 is somewhat bogus... it is probably something like 24 */
-#define R300_MAX_AOS_ARRAYS 16
-
-#define AOS_FORMAT_FLOAT 1
-#define AOS_FORMAT_UBYTE 2
-#define AOS_FORMAT_FLOAT_COLOR 3
-
-#define REG_COORDS 0
-#define REG_COLOR0 1
-#define REG_TEX0 2
-
-struct r300_aos_rec {
- GLuint offset;
- int element_size; /* in dwords */
- int stride; /* distance between elements, in dwords */
-
- int format;
-
- int ncomponents; /* number of components - between 1 and 4, inclusive */
-
- int reg; /* which register they are assigned to. */
-
- };
-
-struct r300_state {
- struct r300_depthbuffer_state depth;
- struct r300_texture_state texture;
- struct r300_vap_reg_state vap_reg;
- struct r300_vertex_shader_state vertex_shader;
-#if USE_ARB_F_P == 0
- struct r300_pixel_shader_state pixel_shader;
-#endif
- struct r300_dma_region aos[R300_MAX_AOS_ARRAYS];
- int aos_count;
-
- GLuint *Elts;
- struct r300_dma_region elt_dma;
-
- GLuint render_inputs; /* actual render inputs that R300 was configured for.
- They are the same as tnl->render_inputs for fixed pipeline */
-
- struct {
- int transform_offset; /* Transform matrix offset, -1 if none */
- } vap_param; /* vertex processor parameter allocation - tells where to write parameters */
-
- struct r300_stencilbuffer_state stencil;
-
-};
-
-
-/**
- * R300 context structure.
- */
-struct r300_context {
- struct radeon_context radeon; /* parent class, must be first */
-
- struct r300_hw_state hw;
- struct r300_cmdbuf cmdbuf;
- struct r300_state state;
-
- /* Vertex buffers
- */
- struct r300_dma dma;
- GLboolean save_on_next_unlock;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap *texture_heaps[R200_NR_TEX_HEAPS];
- driTextureObject swapped;
- int texture_depth;
- float initialMaxAnisotropy;
-
- /* Clientdata textures;
- */
- GLuint prefer_gart_client_texturing;
-
- /* TCL stuff
- */
- GLmatrix TexGenMatrix[R300_MAX_TEXTURE_UNITS];
- GLboolean recheck_texgen[R300_MAX_TEXTURE_UNITS];
- GLboolean TexGenNeedNormals[R300_MAX_TEXTURE_UNITS];
- GLuint TexMatEnabled;
- GLuint TexMatCompSel;
- GLuint TexGenEnabled;
- GLuint TexGenInputs;
- GLuint TexGenCompSel;
- GLmatrix tmpmat;
-};
-
-#define R300_CONTEXT(ctx) ((r300ContextPtr)(ctx->DriverCtx))
-
-static __inline GLuint r300PackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return PACK_COLOR_565( r, g, b );
- case 4:
- return PACK_COLOR_8888( r, g, b, a );
- default:
- return 0;
- }
-}
-extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv);
-extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate);
-
-void translate_vertex_shader(struct r300_vertex_program *vp);
-extern void r300InitShaderFuncs(struct dd_function_table *functions);
-extern void r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp);
-
-#endif /* __R300_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_emit.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_emit.h
deleted file mode 100644
index c7cb93d0a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_emit.h
+++ /dev/null
@@ -1,282 +0,0 @@
-#ifndef __EMIT_H__
-#define __EMIT_H__
-#include "glheader.h"
-#include "r300_context.h"
-#include "r300_cmdbuf.h"
-
-/* convenience macros */
-#define RADEON_CP_PACKET0 0x00000000
-#define RADEON_CP_PACKET1 0x40000000
-#define RADEON_CP_PACKET2 0x80000000
-#define RADEON_CP_PACKET3 0xC0000000
-
-#define RADEON_CP_PACKET3_NOP 0xC0001000
-#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900
-#define RADEON_CP_PACKET3_UNK1B 0xC0001B00
-#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00
-#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00
-#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300
-#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400
-#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600
-#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800
-#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900
-#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00
-#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00
-#define RADEON_CP_PACKET3_INDX_BUFFER 0xC0003300
-#define RADEON_CP_PACKET3_3D_DRAW_VBUF_2 0xC0003400
-#define RADEON_CP_PACKET3_3D_DRAW_IMMD_2 0xC0003500
-#define RADEON_CP_PACKET3_3D_DRAW_INDX_2 0xC0003600
-#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00
-#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100
-#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200
-#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300
-#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400
-#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500
-#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800
-#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00
-#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00
-#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00
-#define RADEON_CP_PACKET3_3D_CLEAR_ZMASK 0xC0003202
-#define RADEON_CP_PACKET3_3D_CLEAR_CMASK 0xC0003802
-#define RADEON_CP_PACKET3_3D_CLEAR_HIZ 0xC0003702
-
-#define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2))
-
-/* Glue to R300 Mesa driver */
-#define LOCAL_VARS int cmd_reserved=0;\
- int cmd_written=0; \
- drm_radeon_cmd_header_t *cmd=NULL;
-
-#define PREFIX_VOID r300ContextPtr rmesa
-
-#define PREFIX PREFIX_VOID ,
-
-#define PASS_PREFIX_VOID rmesa
-#define PASS_PREFIX rmesa ,
-
-typedef GLuint CARD32;
-
-/* This files defines functions for accessing R300 hardware.
- It needs to be customized to whatever code r300_lib.c is used
- in */
-
-void static inline check_space(int dwords)
-{
-}
-
-static __inline__ uint32_t cmdpacket0(int reg, int count)
-{
- drm_r300_cmd_header_t cmd;
-
- cmd.packet0.cmd_type = R300_CMD_PACKET0;
- cmd.packet0.count = count;
- cmd.packet0.reghi = ((unsigned int)reg & 0xFF00) >> 8;
- cmd.packet0.reglo = ((unsigned int)reg & 0x00FF);
-
- return cmd.u;
-}
-
-static __inline__ uint32_t cmdvpu(int addr, int count)
-{
- drm_r300_cmd_header_t cmd;
-
- cmd.vpu.cmd_type = R300_CMD_VPU;
- cmd.vpu.count = count;
- cmd.vpu.adrhi = ((unsigned int)addr & 0xFF00) >> 8;
- cmd.vpu.adrlo = ((unsigned int)addr & 0x00FF);
-
- return cmd.u;
-}
-
-static __inline__ uint32_t cmdpacket3(int packet)
-{
- drm_r300_cmd_header_t cmd;
-
- cmd.packet3.cmd_type = R300_CMD_PACKET3;
- cmd.packet3.packet = packet;
-
- return cmd.u;
-}
-
-static __inline__ uint32_t cmdcpdelay(unsigned short count)
-{
- drm_r300_cmd_header_t cmd;
-
- cmd.delay.cmd_type = R300_CMD_CP_DELAY;
- cmd.delay.count = count;
-
- return cmd.u;
-}
-
-static __inline__ uint32_t cmdwait(unsigned char flags)
-{
- drm_r300_cmd_header_t cmd;
-
- cmd.wait.cmd_type = R300_CMD_WAIT;
- cmd.wait.flags = flags;
-
- return cmd.u;
-}
-
-static __inline__ uint32_t cmdpacify(void)
-{
- drm_r300_cmd_header_t cmd;
-
- cmd.header.cmd_type = R300_CMD_END3D;
-
- return cmd.u;
-}
-
-/* Prepare to write a register value to register at address reg.
- If num_extra > 0 then the following extra values are written
- to registers with address +4, +8 and so on.. */
-#define reg_start(reg, num_extra) \
- { \
- int _n; \
- _n=(num_extra); \
- cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
- (_n+2), \
- __FUNCTION__); \
- cmd_reserved=_n+2; \
- cmd_written=1; \
- cmd[0].i=cmdpacket0((reg), _n+1); \
- }
-
-/* Prepare to write a register value to register at address reg.
- If num_extra > 0 then the following extra values are written
- into the same register. */
-/* It is here to permit r300_lib to compile and link anyway, but
- complain if actually called */
-#define reg_start_pump(reg, num_extra) \
- { \
- fprintf(stderr, "I am not defined.. Error ! in %s::%s at line %d\n", \
- __FILE__, __FUNCTION__, __LINE__); \
- exit(-1); \
- }
-
-/* Emit CARD32 freestyle*/
-#define e32(dword) { \
- if(cmd_written<cmd_reserved){\
- cmd[cmd_written].i=(dword); \
- cmd_written++; \
- } else { \
- fprintf(stderr, "e32 but no previous packet declaration.. Aborting! in %s::%s at line %d, cmd_written=%d cmd_reserved=%d\n", \
- __FILE__, __FUNCTION__, __LINE__, cmd_written, cmd_reserved); \
- exit(-1); \
- } \
- }
-
-#define efloat(f) e32(r300PackFloat32(f))
-
-#define vsf_start_fragment(dest, length) \
- { \
- int _n; \
- _n=(length); \
- cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
- (_n+1), \
- __FUNCTION__); \
- cmd_reserved=_n+2; \
- cmd_written=1; \
- cmd[0].i=cmdvpu((dest), _n/4); \
- }
-
-#define start_packet3(packet, count) \
- { \
- int _n; \
- CARD32 _p; \
- _n=(count); \
- _p=(packet); \
- cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
- (_n+3), \
- __FUNCTION__); \
- cmd_reserved=_n+3; \
- cmd_written=2; \
- if(_n>0x3fff) {\
- fprintf(stderr,"Too big packet3 %08x: cannot store %d dwords\n", \
- _p, _n); \
- exit(-1); \
- } \
- cmd[0].i=cmdpacket3(R300_CMD_PACKET3_RAW); \
- cmd[1].i=_p | ((_n & 0x3fff)<<16); \
- }
-
- /* must be sent to switch to 2d commands */
-
-void static inline end_3d(PREFIX_VOID)
-{
-LOCAL_VARS
-(void)cmd_reserved; (void)cmd_written;
-
-cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
- 1, \
- __FUNCTION__); \
-
-cmd[0].header.cmd_type=R300_CMD_END3D;
-}
-
-void static inline cp_delay(PREFIX unsigned short count)
-{
-LOCAL_VARS
-(void)cmd_reserved; (void)cmd_written;
-
-cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
- 1, \
- __FUNCTION__); \
-
-cmd[0].i=cmdcpdelay(count);
-}
-
-void static inline cp_wait(PREFIX unsigned char flags)
-{
-LOCAL_VARS
-(void)cmd_reserved; (void)cmd_written;
-
-cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
- 1, \
- __FUNCTION__); \
-
-cmd[0].i=cmdwait(flags);
-}
-
-/* fire vertex buffer */
-static void inline fire_AOS(PREFIX int vertex_count, int type)
-{
-LOCAL_VARS
-check_space(9);
-
-start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0);
-/* e32(0x840c0024); */
- e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count<<16) | type);
-}
-
-/* these are followed by the corresponding data */
-#define start_index32_packet(vertex_count, type) \
- {\
- int _vc;\
- _vc=(vertex_count); \
- start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _vc); \
- e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | type \
- | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); \
- }
-
-#define start_index16_packet(vertex_count, type) \
- {\
- int _vc, _n;\
- _vc=(vertex_count); \
- _n=(vertex_count+1)>>1; \
- start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _n); \
- e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | type); \
- }
-
-/* Interestingly enough this ones needs the call to setup_AOS, even thought
- some of the data so setup is not needed and some is not as arbitrary
- as when used by DRAW_VBUF_2 or DRAW_INDX_2 */
-#define start_immediate_packet(vertex_count, type, vertex_size) \
- {\
- int _vc; \
- _vc=(vertex_count); \
- start_packet3(RADEON_CP_PACKET3_3D_DRAW_IMMD_2, _vc*(vertex_size)); \
- e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED | (_vc<<16) | type); \
- }
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fixed_pipelines.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fixed_pipelines.h
deleted file mode 100644
index 65e1836af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fixed_pipelines.h
+++ /dev/null
@@ -1,294 +0,0 @@
-#ifndef __R300_FIXED_PIPELINES_H__
-#define __R300_FIXED_PIPELINES_H__
-
-/******** Flat color pipeline **********/
-static struct r300_vertex_shader_state FLAT_COLOR_VERTEX_SHADER={
- program: {
- length: 20,
-
- body:{ d: {
- EASY_VSF_OP(MUL, 0, ALL, TMP),
- VSF_PARAM(3),
- VSF_ATTR_W(0),
- EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE),
-
- EASY_VSF_OP(MUL, 1, ALL, RESULT),
- VSF_REG(1),
- VSF_ATTR_UNITY(1),
- VSF_UNITY(1),
-
- EASY_VSF_OP(MAD, 0, ALL, TMP),
- VSF_PARAM(2),
- VSF_ATTR_Z(0),
- VSF_TMP(0),
-
- EASY_VSF_OP(MAD, 0, ALL, TMP),
- VSF_PARAM(1),
- VSF_ATTR_Y(0),
- VSF_TMP(0),
-
- EASY_VSF_OP(MAD, 0, ALL, RESULT),
- VSF_PARAM(0),
- VSF_ATTR_X(0),
- VSF_TMP(0),
- } }
- },
-
- matrix:{
- {
- length: 16,
- body: { f: {
- 2.0,
- 0,
- 0.0,
- 0.0,
- 0,
- 2.5,
- 0,
- 0,
- 0.0,
- 0,
- -1.00,
- -1.0,
- -3.0,
- 0,
- 6.0,
- 6.0
- } }
- },
- {
- length: 0,
- },
- {
- length: 0,
- }
- },
-
- vector: {
- {
- length: 0,
- },
- {
- length: 0,
- }
- },
-
- unknown1: {
- length: 0
- },
-
- unknown2: {
- length: 0
- },
-
- program_start: 0,
- unknown_ptr1: 4,
- program_end: 4,
-
- param_offset: 0,
- param_count: 4,
-
- unknown_ptr2: 0,
- unknown_ptr3: 4
- };
-
-static struct r300_pixel_shader_state FLAT_COLOR_PIXEL_SHADER={
- program: {
- tex: {
- length: 0
- },
- alu: {
- length: 1,
- /* My understanding is that we need at least 1 instructions for pixel shader,
- in particular because alu_end==0 means there is one instruction */
- inst: {
- PFS_NOP
- }
- },
- node: {
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0}
- },
- active_nodes: 1,
- first_node_has_tex: 0,
- temp_register_count: 0,
-
- tex_offset: 0,
- tex_end: 0,
- alu_offset: 0,
- alu_end: 0
- },
-
- param_length: 0
- };
-
-
-/******** Single texture pipeline ***********/
-static struct r300_vertex_shader_state SINGLE_TEXTURE_VERTEX_SHADER={
- program: {
- length: 24,
-
- body: { d: {
- EASY_VSF_OP(MUL, 0, ALL, TMP),
- VSF_PARAM(3),
- VSF_ATTR_W(0),
- EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE),
-
- EASY_VSF_OP(MUL, 2, ALL, RESULT),
- VSF_REG(2),
- VSF_ATTR_UNITY(2),
- VSF_UNITY(2),
-
- EASY_VSF_OP(MAD, 0, ALL, TMP),
- VSF_PARAM(2),
- VSF_ATTR_Z(0),
- VSF_TMP(0),
-
- EASY_VSF_OP(MUL, 1, ALL, RESULT),
- VSF_REG(1),
- VSF_ATTR_UNITY(1),
- VSF_UNITY(1),
-
- EASY_VSF_OP(MAD, 0, ALL, TMP),
- VSF_PARAM(1),
- VSF_ATTR_Y(0),
- VSF_TMP(0),
-
- EASY_VSF_OP(MAD, 0, ALL, RESULT),
- VSF_PARAM(0),
- VSF_ATTR_X(0),
- VSF_TMP(0),
- } }
- },
-
- matrix:{
- {
- length: 16,
- body: { f: {
- 2.0,
- 0,
- 0.0,
- 0.0,
- 0,
- 2.5,
- 0,
- 0,
- 0.0,
- 0,
- -1.00,
- -1.0,
- -3.0,
- 0,
- 6.0,
- 6.0
- } }
- },
- {
- length: 0,
- },
- {
- length: 0,
- }
- },
-
- vector: {
- {
- length: 0,
- },
- {
- length: 0,
- }
- },
-
- unknown1: {
- length: 0
- },
-
- unknown2: {
- length: 4,
- body: { f: {
- 0.0,
- 0.0,
- 1.0,
- 0.0
- } }
- },
-
- program_start: 0,
- unknown_ptr1: 5,
- program_end: 5,
-
- param_offset: 0,
- param_count: 4,
-
- unknown_ptr2: 0,
- unknown_ptr3: 5
- };
-
-static struct r300_pixel_shader_state SINGLE_TEXTURE_PIXEL_SHADER={
- program: {
- tex: {
- length: 1,
- inst: { 0x00018000 }
- },
- alu: {
- length: 2,
- inst:
- {
-/* I get misc problems without this after doing cold-reboot.
- This would imply that alu programming is buggy. --aet */
-#if 1
- PFS_NOP,
-#endif
-
- /* What are 0's ORed with flags ? They are register numbers that
- just happen to be 0 */
- {
- EASY_PFS_INSTR0(MAD, SRC0C_XYZ, SRC1C_XYZ, ZERO),
- EASY_PFS_INSTR1(0, 0, 1, 0 | PFS_FLAG_CONST, NONE, ALL),
-
-#if 0
- /* no alpha in textures */
- EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO),
- EASY_PFS_INSTR3(0, 1, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, OUTPUT)
-#endif
-
- /* alpha in textures */
- EASY_PFS_INSTR2(MAD, SRC0A, SRC1A, ZERO),
- EASY_PFS_INSTR3(0, 0, 1, 0 | PFS_FLAG_CONST, OUTPUT)
- }
- }
- },
- node: {
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0},
- { 0, 0, 0, 0}
- },
-
- active_nodes: 1,
- first_node_has_tex: 1,
- temp_register_count: 1,
-
- tex_offset: 0,
- tex_end: 0,
- alu_offset: 0,
- alu_end: 0
- },
-
- param_length: 8,
- param: {
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0},
- { 0.0, 0.0, 0.0, 0.0}
- }
- };
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.c
deleted file mode 100644
index 8750ff60c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ /dev/null
@@ -1,1090 +0,0 @@
-/*
- * Copyright (C) 2005 Ben Skeggs.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-/*
- * Authors:
- * Ben Skeggs <darktama@iinet.net.au>
- */
-
-/*TODO'S
- *
- * - Implement remaining arb_f_p opcodes
- * - Depth write
- * - Negate on individual components (implement in swizzle code?)
- * - Reuse input/temp regs, if they're no longer needed.
- * - Find out whether there's any benifit in ordering registers the way
- * fglrx does (see r300_reg.h).
- * - Verify results of opcodes for accuracy, I've only checked them
- * in specific cases.
- * - and more...
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-#include "arbfragparse.h"
-
-#include "program.h"
-#include "nvfragprog.h"
-#include "r300_context.h"
-#if USE_ARB_F_P == 1
-#include "r300_fragprog.h"
-#include "r300_reg.h"
-
-#define PFS_INVAL 0xFFFFFFFF
-
-static void dump_program(struct r300_fragment_program *rp);
-static void emit_arith(struct r300_fragment_program *rp, int op,
- pfs_reg_t dest, int mask,
- pfs_reg_t src0, pfs_reg_t src1, pfs_reg_t src2,
- int flags);
-
-/***************************************
- * begin: useful data structions for fragment program generation
- ***************************************/
-
-/* description of r300 native hw instructions */
-const struct {
- const char *name;
- int argc;
- int v_op;
- int s_op;
-} r300_fpop[] = {
- { "MAD", 3, R300_FPI0_OUTC_MAD, R300_FPI2_OUTA_MAD },
- { "DP3", 2, R300_FPI0_OUTC_DP3, PFS_INVAL },
- { "DP4", 2, R300_FPI0_OUTC_DP4, R300_FPI2_OUTA_DP4 },
- { "MIN", 2, R300_FPI0_OUTC_MIN, R300_FPI2_OUTA_MIN },
- { "MAX", 2, R300_FPI0_OUTC_MAX, R300_FPI2_OUTA_MAX },
- { "CMP", 3, R300_FPI0_OUTC_CMP, R300_FPI2_OUTA_CMP },
- { "FRC", 1, R300_FPI0_OUTC_FRC, R300_FPI2_OUTA_FRC },
- { "EX2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_EX2 },
- { "LG2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_LG2 },
- { "RCP", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RCP },
- { "RSQ", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RSQ },
- { "REPL_ALPHA", 1, R300_FPI0_OUTC_REPL_ALPHA, PFS_INVAL }
-};
-
-#define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, \
- SWIZZLE_##y, \
- SWIZZLE_##z, \
- SWIZZLE_ZERO))
-
-/* vector swizzles r300 can support natively, with a couple of
- * cases we handle specially
- *
- * pfs_reg_t.v_swz/pfs_reg_t.s_swz is an index into this table
- **/
-static const struct r300_pfv_swizzle {
- const char *name;
- GLuint hash; /* swizzle value this matches */
- GLboolean native;
- GLuint base; /* base value for hw swizzle */
- GLuint stride; /* difference in base between arg0/1/2 */
- GLboolean dep_sca;
-} v_swiz[] = {
-/* native swizzles */
- { "xyz", MAKE_SWZ3(X, Y, Z), GL_TRUE, R300_FPI0_ARGC_SRC0C_XYZ, 4, GL_FALSE },
- { "xxx", MAKE_SWZ3(X, X, X), GL_TRUE, R300_FPI0_ARGC_SRC0C_XXX, 4, GL_FALSE },
- { "yyy", MAKE_SWZ3(Y, Y, Y), GL_TRUE, R300_FPI0_ARGC_SRC0C_YYY, 4, GL_FALSE },
- { "zzz", MAKE_SWZ3(Z, Z, Z), GL_TRUE, R300_FPI0_ARGC_SRC0C_ZZZ, 4, GL_FALSE },
- { "www", MAKE_SWZ3(W, W, W), GL_TRUE, R300_FPI0_ARGC_SRC0A, 1, GL_TRUE },
- { "yzx", MAKE_SWZ3(Y, Z, X), GL_TRUE, R300_FPI0_ARGC_SRC0C_YZX, 1, GL_FALSE },
- { "zxy", MAKE_SWZ3(Z, X, Y), GL_TRUE, R300_FPI0_ARGC_SRC0C_ZXY, 1, GL_FALSE },
-/* disable this for now, until I find a clean way of making sure xyz/w streams
- * have a source in the same register slot.. */
-// { "wzy", MAKE_SWZ3(W, Z, Y), GL_TRUE, R300_FPI0_ARGC_SRC0CA_WZY, 1, GL_TRUE },
-/* special cases */
- { NULL, MAKE_SWZ3(ONE, ONE, ONE), GL_FALSE, R300_FPI0_ARGC_ONE, 0, GL_FALSE},
- { NULL, MAKE_SWZ3(ZERO, ZERO, ZERO), GL_FALSE, R300_FPI0_ARGC_ZERO, 0, GL_FALSE},
- { NULL, PFS_INVAL, GL_FALSE, R300_FPI0_ARGC_HALF, 0, GL_FALSE},
- { NULL, PFS_INVAL, GL_FALSE, 0, 0, 0 },
-};
-#define SWIZZLE_XYZ 0
-#define SWIZZLE_XXX 1
-#define SWIZZLE_WWW 4
-#define SWIZZLE_111 7
-#define SWIZZLE_000 8
-#define SWIZZLE_HHH 9
-
-#define SWZ_X_MASK (7 << 0)
-#define SWZ_Y_MASK (7 << 3)
-#define SWZ_Z_MASK (7 << 6)
-#define SWZ_W_MASK (7 << 9)
-/* used during matching of non-native swizzles */
-static const struct {
- GLuint hash; /* used to mask matching swizzle components */
- int mask; /* actual outmask */
- int count; /* count of components matched */
-} s_mask[] = {
- { SWZ_X_MASK|SWZ_Y_MASK|SWZ_Z_MASK, 1|2|4, 3},
- { SWZ_X_MASK|SWZ_Y_MASK, 1|2, 2},
- { SWZ_X_MASK|SWZ_Z_MASK, 1|4, 2},
- { SWZ_Y_MASK|SWZ_Z_MASK, 2|4, 2},
- { SWZ_X_MASK, 1, 1},
- { SWZ_Y_MASK, 2, 1},
- { SWZ_Z_MASK, 4, 1},
- { PFS_INVAL, PFS_INVAL, PFS_INVAL}
-};
-
-/* mapping from SWIZZLE_* to r300 native values for scalar insns */
-static const struct {
- const char *name;
- int base; /* hw value of swizzle */
- int stride; /* difference between SRC0/1/2 */
- GLboolean dep_vec;
-} s_swiz[] = {
- { "x", R300_FPI2_ARGA_SRC0C_X, 3, GL_TRUE },
- { "y", R300_FPI2_ARGA_SRC0C_Y, 3, GL_TRUE },
- { "z", R300_FPI2_ARGA_SRC0C_Z, 3, GL_TRUE },
- { "w", R300_FPI2_ARGA_SRC0A , 1, GL_FALSE },
- { "0", R300_FPI2_ARGA_ZERO , 0, GL_FALSE },
- { "1", R300_FPI2_ARGA_ONE , 0, GL_FALSE },
- { ".5", R300_FPI2_ARGA_HALF, 0, GL_FALSE }
-};
-#define SWIZZLE_HALF 6
-
-/* boiler-plate reg, for convenience */
-const pfs_reg_t pfs_default_reg = {
- type: REG_TYPE_TEMP,
- index: 0,
- v_swz: 0 /* matches XYZ in table */,
- s_swz: SWIZZLE_W,
- negate: 0,
- valid: GL_FALSE
-};
-
-/* constant zero source */
-const pfs_reg_t pfs_one = {
- type: REG_TYPE_CONST,
- index: 0,
- v_swz: SWIZZLE_111,
- s_swz: SWIZZLE_ONE,
- valid: GL_TRUE
-};
-
-/* constant one source */
-const pfs_reg_t pfs_zero = {
- type: REG_TYPE_CONST,
- index: 0,
- v_swz: SWIZZLE_000,
- s_swz: SWIZZLE_ZERO,
- valid: GL_TRUE
-};
-
-/***************************************
- * end: data structures
- ***************************************/
-
-#define ERROR(fmt, args...) do { \
- fprintf(stderr, "%s::%s(): " fmt "\n", __FILE__, __func__, ##args); \
- rp->error = GL_TRUE; \
-} while(0)
-
-static int get_hw_temp(struct r300_fragment_program *rp)
-{
- int r = ffs(~rp->hwreg_in_use);
- if (!r) {
- ERROR("Out of hardware temps\n");
- return 0;
- }
-
- rp->hwreg_in_use |= (1 << --r);
- if (r > rp->max_temp_idx)
- rp->max_temp_idx = r;
-
- return r;
-}
-
-static void free_hw_temp(struct r300_fragment_program *rp, int idx)
-{
- rp->hwreg_in_use &= ~(1<<idx);
-}
-
-static pfs_reg_t get_temp_reg(struct r300_fragment_program *rp)
-{
- pfs_reg_t r = pfs_default_reg;
-
- r.index = ffs(~rp->temp_in_use);
- if (!r.index) {
- ERROR("Out of program temps\n");
- return r;
- }
- rp->temp_in_use |= (1 << --r.index);
-
- rp->temps[r.index] = get_hw_temp(rp);
- r.valid = GL_TRUE;
- return r;
-}
-
-static pfs_reg_t get_temp_reg_tex(struct r300_fragment_program *rp)
-{
- pfs_reg_t r = pfs_default_reg;
- int hwreg;
-
- hwreg = ffs(~(rp->hwreg_in_use | rp->used_in_node));
- if (!hwreg) {
- /* Try and grab an already used temp, will
- * cause an indirection, but better than failing */
- return get_temp_reg(rp);
- }
- if (hwreg > rp->max_temp_idx)
- rp->max_temp_idx = hwreg;
-
- r.index = ffs(~rp->temp_in_use);
- if (!r.index) {
- ERROR("Out of program temps\n");
- return r;
- }
- rp->temp_in_use |= (1 << --r.index);
- rp->temps[r.index] = --hwreg;
-
- r.valid = GL_TRUE;
- return r;
-}
-
-static void free_temp(struct r300_fragment_program *rp, pfs_reg_t r)
-{
- if (!rp || !(rp->temp_in_use & (1<<r.index))) return;
-
- free_hw_temp(rp, rp->temps[r.index]);
- rp->temp_in_use &= ~(1<<r.index);
-}
-
-static pfs_reg_t emit_param4fv(struct r300_fragment_program *rp, GLfloat *values)
-{
- pfs_reg_t r = pfs_default_reg;
- int pidx;
-
- r.type = REG_TYPE_CONST;
- pidx = rp->param_nr++;
- r.index = rp->const_nr++;
- if (pidx >= PFS_NUM_CONST_REGS || r.index >= PFS_NUM_CONST_REGS) {
- ERROR("Out of const/param slots!\n");
- return r;
- }
-
- rp->param[pidx].idx = r.index;
- rp->param[pidx].values = values;
- rp->params_uptodate = GL_FALSE;
-
- r.valid = GL_TRUE;
- return r;
-}
-
-static pfs_reg_t emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp)
-{
- pfs_reg_t r = pfs_default_reg;
- r.type = REG_TYPE_CONST;
-
- r.index = rp->const_nr++;
- if (r.index >= PFS_NUM_CONST_REGS) {
- ERROR("Out of hw constants!\n");
- return r;
- }
-
- COPY_4V(rp->constant[r.index], cp);
-
- r.valid = GL_TRUE;
- return r;
-}
-
-static pfs_reg_t negate(pfs_reg_t r)
-{
- r.negate = 1;
- return r;
-}
-
-static int swz_native(struct r300_fragment_program *rp,
- pfs_reg_t src, pfs_reg_t *r)
-{
- /* Native swizzle, nothing to see here */
- *r = src;
- return 3;
-}
-
-static int swz_emit_partial(struct r300_fragment_program *rp,
- pfs_reg_t src, pfs_reg_t *r, int mask, int mc)
-{
- if (!r->valid)
- *r = get_temp_reg(rp);
-
- /* A partial match, src.v_swz/mask define what parts of the
- * desired swizzle we match */
- if (mc + s_mask[mask].count == 3)
- emit_arith(rp, PFS_OP_MAD, *r, s_mask[mask].mask|WRITEMASK_W, src, pfs_one, pfs_zero, 0);
- else
- emit_arith(rp, PFS_OP_MAD, *r, s_mask[mask].mask, src, pfs_one, pfs_zero, 0);
- return s_mask[mask].count;
-}
-
-static int swz_special_case(struct r300_fragment_program *rp,
- pfs_reg_t src, pfs_reg_t *r, int mask, int mc)
-{
- switch(GET_SWZ(v_swiz[src.v_swz].hash, 0)) {
- case SWIZZLE_ONE:
- case SWIZZLE_ZERO:
- if (!r->valid)
- *r = get_temp_reg(rp);
- if (mc + s_mask[mask].count == 3)
- emit_arith(rp, PFS_OP_MAD, *r, s_mask[mask].mask|WRITEMASK_W, src, pfs_one, pfs_zero, 0);
- else
- emit_arith(rp, PFS_OP_MAD, *r, s_mask[mask].mask, src, pfs_one, pfs_zero, 0);
- break;
- default:
- ERROR("Unknown special-case swizzle! %d\n", src.v_swz);
- return 0;
- }
-
- return s_mask[mask].count;
-}
-
-static pfs_reg_t swizzle(struct r300_fragment_program *rp,
- pfs_reg_t src,
- GLuint arbswz)
-{
- pfs_reg_t r = pfs_default_reg;
-
- int c_mask = 0;
- int v_matched = 0;
- src.v_swz = SWIZZLE_XYZ;
- src.s_swz = GET_SWZ(arbswz, 3);
-
- do {
- do {
-#define CUR_HASH (v_swiz[src.v_swz].hash & s_mask[c_mask].hash)
- if (CUR_HASH == (arbswz & s_mask[c_mask].hash)) {
- if (v_swiz[src.v_swz].native == GL_FALSE)
- v_matched += swz_special_case(rp, src, &r, c_mask, v_matched);
- else if (s_mask[c_mask].count == 3)
- v_matched += swz_native(rp, src, &r);
- else
- v_matched += swz_emit_partial(rp, src, &r, c_mask, v_matched);
-
- if (v_matched == 3)
- return r;
-
- /* Fill with something invalid.. all 0's was wrong before, matched
- * SWIZZLE_X. So all 1's will be okay for now */
- arbswz |= (PFS_INVAL & s_mask[c_mask].hash);
- }
- } while(v_swiz[++src.v_swz].hash != PFS_INVAL);
- src.v_swz = SWIZZLE_XYZ;
- } while (s_mask[++c_mask].hash != PFS_INVAL);
-
- ERROR("should NEVER get here\n");
- return r;
-}
-
-static pfs_reg_t t_src(struct r300_fragment_program *rp,
- struct fp_src_register fpsrc) {
- pfs_reg_t r = pfs_default_reg;
-
- switch (fpsrc.File) {
- case PROGRAM_TEMPORARY:
- r.index = fpsrc.Index;
- r.valid = GL_TRUE;
- break;
- case PROGRAM_INPUT:
- r.index = fpsrc.Index;
- r.type = REG_TYPE_INPUT;
- r.valid = GL_TRUE;
- break;
- case PROGRAM_LOCAL_PARAM:
- r = emit_param4fv(rp, rp->mesa_program.Base.LocalParams[fpsrc.Index]);
- break;
- case PROGRAM_ENV_PARAM:
- r = emit_param4fv(rp, rp->ctx->FragmentProgram.Parameters[fpsrc.Index]);
- break;
- case PROGRAM_STATE_VAR:
- case PROGRAM_NAMED_PARAM:
- r = emit_param4fv(rp, rp->mesa_program.Parameters->ParameterValues[fpsrc.Index]);
- break;
- default:
- ERROR("unknown SrcReg->File %x\n", fpsrc.File);
- return r;
- }
-
- /* no point swizzling ONE/ZERO/HALF constants... */
- if (r.v_swz < SWIZZLE_111 && r.s_swz < SWIZZLE_ZERO)
- r = swizzle(rp, r, fpsrc.Swizzle);
-
- /* WRONG! Need to be able to do individual component negation,
- * should probably handle this in the swizzling code unless
- * all components are negated, then we can do this natively */
- if (fpsrc.NegateBase)
- r.negate = GL_TRUE;
-
- return r;
-}
-
-static pfs_reg_t t_dst(struct r300_fragment_program *rp,
- struct fp_dst_register dest) {
- pfs_reg_t r = pfs_default_reg;
-
- switch (dest.File) {
- case PROGRAM_TEMPORARY:
- r.index = dest.Index;
- r.valid = GL_TRUE;
- return r;
- case PROGRAM_OUTPUT:
- r.type = REG_TYPE_OUTPUT;
- switch (dest.Index) {
- case 0:
- r.valid = GL_TRUE;
- return r;
- case 1:
- ERROR("I don't know how to write depth!\n");
- return r;
- default:
- ERROR("Bad DstReg->Index 0x%x\n", dest.Index);
- return r;
- }
- default:
- ERROR("Bad DstReg->File 0x%x\n", dest.File);
- return r;
- }
-}
-
-static void sync_streams(struct r300_fragment_program *rp) {
- /* Bring vector/scalar streams into sync, inserting nops into
- * whatever stream is lagging behind
- *
- * Using NOP == MAD out.none, 0, 0, 0
- */
- while (rp->v_pos != rp->s_pos) {
- if (rp->s_pos > rp->v_pos) {
- rp->alu.inst[rp->v_pos].inst0 = 0x00050A14;
- rp->alu.inst[rp->v_pos].inst1 = 0x00020820;
- rp->v_pos++;
- } else {
- rp->alu.inst[rp->s_pos].inst2 = 0x00040810;
- rp->alu.inst[rp->s_pos].inst3 = 0x00020820;
- rp->s_pos++;
- }
- }
-}
-
-static void emit_tex(struct r300_fragment_program *rp,
- struct fp_instruction *fpi,
- int opcode)
-{
- pfs_reg_t coord = t_src(rp, fpi->SrcReg[0]);
- pfs_reg_t dest = t_dst(rp, fpi->DstReg), rdest = pfs_default_reg;
- int unit = fpi->TexSrcUnit;
- int hwsrc, hwdest, flags = 0;
-
- if (dest.type == REG_TYPE_OUTPUT) {
- rdest = dest;
- dest = get_temp_reg_tex(rp);
- }
-
- switch (coord.type) {
- case REG_TYPE_TEMP:
- hwsrc = rp->temps[coord.index];
- break;
- case REG_TYPE_INPUT:
- hwsrc = rp->inputs[coord.index];
- break;
- case REG_TYPE_CONST:
- hwsrc = coord.index;
- flags = R300_FPITX_SRC_CONST;
- break;
- default:
- ERROR("Unknown coord.type = %d\n", coord.type);
- return;
- }
- hwdest = rp->temps[dest.index];
-
- /* Indirection if source has been written in this node, or if the dest has
- * been read/written in this node
- */
- if ((coord.type != REG_TYPE_CONST && (rp->dest_in_node & (1<<hwsrc))) ||
- (rp->used_in_node & (1<<hwdest))) {
-
- if (rp->cur_node == 3) { /* We only support 4 natively */
- ERROR("too many levels of texture indirection\n");
- return;
- }
-
- /* Finish off current node */
- sync_streams(rp);
- rp->node[rp->cur_node].alu_end = rp->v_pos - 1;
-
- /* Start new node */
- rp->cur_node++;
- rp->used_in_node = 0;
- rp->dest_in_node = 0;
- rp->node[rp->cur_node].tex_offset = rp->tex.length;
- rp->node[rp->cur_node].alu_offset = rp->v_pos;
- rp->node[rp->cur_node].tex_end = -1;
- rp->node[rp->cur_node].alu_end = -1;
- }
-
- if (rp->cur_node == 0) rp->first_node_has_tex = 1;
-
- rp->tex.inst[rp->tex.length++] = 0
- | (hwsrc << R300_FPITX_SRC_SHIFT)
- | (hwdest << R300_FPITX_DST_SHIFT)
- | (unit << R300_FPITX_IMAGE_SHIFT)
- | (opcode << R300_FPITX_OPCODE_SHIFT) /* not entirely sure about this */
- | flags;
- rp->dest_in_node |= (1 << hwdest);
- if (coord.type != REG_TYPE_CONST)
- rp->used_in_node |= (1 << hwsrc);
-
- rp->node[rp->cur_node].tex_end++;
-
- /* Copy from temp to output if needed */
- if (rdest.valid) {
- emit_arith(rp, PFS_OP_MAD, rdest, WRITEMASK_XYZW, dest, pfs_one, pfs_zero, 0);
- free_temp(rp, dest);
- }
-}
-
-#define ARG_NEG (1<<5)
-#define ARG_ABS (1<<6)
-#define SRC_CONST (1<<5)
-#define SRC_STRIDE 6
-
-static int t_hw_src(struct r300_fragment_program *rp, pfs_reg_t src)
-{
- int idx;
-
- switch (src.type) {
- case REG_TYPE_TEMP:
- idx = rp->temps[src.index];
- break;
- case REG_TYPE_INPUT:
- idx = rp->inputs[src.index];
- break;
- case REG_TYPE_CONST:
- return (src.index | SRC_CONST);
- default:
- ERROR("Invalid type for source reg\n");
- return (0 | SRC_CONST);
- }
-
- rp->used_in_node |= (1 << idx);
- return idx;
-}
-
-/* Add sources to FPI1/FPI3 lists. If source is already on list,
- * reuse the index instead of wasting a source.
- */
-static inline int add_src(int src[3], int *cnt, int reg) {
- int i;
-
- for (i=0;i<*cnt;i++)
- if (src[i] == reg) return i;
-
- if (*cnt == 3) assert(0); /* I don't *think* this can happen */
-
- src[*cnt] = reg;
- return (*cnt)++;
-}
-
-static void emit_arith(struct r300_fragment_program *rp, int op,
- pfs_reg_t dest, int mask,
- pfs_reg_t src0, pfs_reg_t src1, pfs_reg_t src2,
- int flags)
-{
- pfs_reg_t src[3] = { src0, src1, src2 };
- /* XYZ/W emit control */
- int v_idx = rp->v_pos, s_idx = rp->s_pos;
- GLboolean emit_v = GL_FALSE, emit_s = GL_FALSE;
- /* INST1/INST3 sources */
- int vsrc[3], ssrc[3];
- int nvs = 0, nss = 0;
- /* INST0/INST2 sources */
- int vswz[3], sswz[3];
- /* temp stuff */
- int hwdest, hwsrc;
- int argc;
- int vop, sop;
- int i;
- int str;
-
- if (!dest.valid || !src0.valid || !src1.valid || !src2.valid) {
- ERROR("invalid register. dest/src0/src1/src2 valid = %d/%d/%d/%d\n",
- dest.valid, src0.valid, src1.valid, src2.valid);
- return;
- }
-
- /* check opcode */
- if (op > MAX_PFS_OP) {
- ERROR("unknown opcode!\n");
- return;
- }
- argc = r300_fpop[op].argc;
- vop = r300_fpop[op].v_op;
- sop = r300_fpop[op].s_op;
-
- /* grab hwregs of dest */
- switch (dest.type) {
- case REG_TYPE_TEMP:
- hwdest = rp->temps[dest.index];
- rp->dest_in_node |= (1 << hwdest);
- rp->used_in_node |= (1 << hwdest);
- break;
- case REG_TYPE_OUTPUT:
- hwdest = 0;
- break;
- default:
- ERROR("invalid dest reg type %d\n", dest.type);
- return;
- }
-
- for (i=0;i<3;i++) {
- if (i<argc) {
- hwsrc = t_hw_src(rp, src[i]);
- if (mask & WRITEMASK_XYZ && vop != R300_FPI0_OUTC_REPL_ALPHA) {
- if (v_swiz[src[i].v_swz].dep_sca) {
- sync_streams(rp);
- v_idx = s_idx = rp->v_pos;
- emit_s = GL_TRUE;
- str = add_src(ssrc, &nss, hwsrc);
- } else
- str = add_src(vsrc, &nvs, hwsrc);
- vswz[i] = v_swiz[src[i].v_swz].base + (str * v_swiz[src[i].v_swz].stride);
- } else
- vswz[i] = R300_FPI0_ARGC_ZERO;
-
- if (mask & WRITEMASK_W || vop == R300_FPI0_OUTC_REPL_ALPHA) {
- if (s_swiz[src[i].s_swz].dep_vec) {
- sync_streams(rp);
- v_idx = s_idx = rp->v_pos;
- emit_v = GL_TRUE;
- str = add_src(vsrc, &nvs, hwsrc);
- } else
- str = add_src(ssrc, &nss, hwsrc);
- sswz[i] = s_swiz[src[i].s_swz].base + (str * s_swiz[src[i].s_swz].stride);
- } else
- sswz[i] = R300_FPI2_ARGA_ZERO;
-
- if (src[i].negate) {
- vswz[i] |= ARG_NEG;
- sswz[i] |= ARG_NEG;
- }
-
- if (flags & PFS_FLAG_ABS) {
- vswz[i] |= ARG_ABS;
- sswz[i] |= ARG_ABS;
- }
- } else {
- vswz[i] = R300_FPI0_ARGC_ZERO;
- sswz[i] = R300_FPI2_ARGA_ZERO;
- }
- }
- /* Unused sources, read constant reg 0 */
- for (i=nvs;i<3;i++)
- vsrc[i] = 0 | SRC_CONST;
- for (i=nss;i<3;i++)
- ssrc[i] = 0 | SRC_CONST;
-
- if (flags & PFS_FLAG_SAT) {
- vop |= R300_FPI0_OUTC_SAT;
- sop |= R300_FPI2_OUTA_SAT;
- }
-
- if (mask & WRITEMASK_XYZ || emit_v) {
- if (r300_fpop[op].v_op == R300_FPI0_OUTC_REPL_ALPHA) {
- sync_streams(rp);
- s_idx = v_idx = rp->v_pos;
- }
- rp->alu.inst[v_idx].inst0 = vop |
- vswz[0] << R300_FPI0_ARG0C_SHIFT |
- vswz[1] << R300_FPI0_ARG1C_SHIFT |
- vswz[2] << R300_FPI0_ARG2C_SHIFT;
- rp->alu.inst[v_idx].inst1 = hwdest << R300_FPI1_DSTC_SHIFT |
- vsrc[0] << R300_FPI1_SRC0C_SHIFT |
- vsrc[1] << R300_FPI1_SRC1C_SHIFT |
- vsrc[2] << R300_FPI1_SRC2C_SHIFT |
- ((mask & WRITEMASK_XYZ) << (dest.type == REG_TYPE_OUTPUT ? 26 : 23));
- rp->v_pos = v_idx + 1;
- }
-
- if (mask & WRITEMASK_W || emit_s || vop == R300_FPI0_OUTC_REPL_ALPHA) {
- rp->alu.inst[s_idx].inst2 = sop |
- sswz[0] << R300_FPI2_ARG0A_SHIFT |
- sswz[1] << R300_FPI2_ARG1A_SHIFT |
- sswz[2] << R300_FPI2_ARG2A_SHIFT;
- rp->alu.inst[s_idx].inst3 = hwdest << R300_FPI3_DSTA_SHIFT |
- ssrc[0] << R300_FPI3_SRC0A_SHIFT |
- ssrc[1] << R300_FPI3_SRC1A_SHIFT |
- ssrc[2] << R300_FPI3_SRC2A_SHIFT |
- (((mask & WRITEMASK_W)?1:0) << (dest.type == REG_TYPE_OUTPUT ? 24 : 23));
- rp->s_pos = s_idx + 1;
- }
-
-/* sync_streams(rp); */
- return;
-};
-
-static GLboolean parse_program(struct r300_fragment_program *rp)
-{
- struct fragment_program *mp = &rp->mesa_program;
- const struct fp_instruction *inst = mp->Instructions;
- struct fp_instruction *fpi;
- pfs_reg_t src0, src1, src2, dest, temp;
- int flags = 0;
-
- if (!inst || inst[0].Opcode == FP_OPCODE_END) {
- ERROR("empty program?\n");
- return GL_FALSE;
- }
-
- for (fpi=mp->Instructions; fpi->Opcode != FP_OPCODE_END; fpi++) {
- if (fpi->Saturate) {
- flags = PFS_FLAG_SAT;
- }
-
- switch (fpi->Opcode) {
- case FP_OPCODE_ABS:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- case FP_OPCODE_ADD:
- emit_arith(rp, PFS_OP_MAD, t_dst(rp, fpi->DstReg), fpi->DstReg.WriteMask,
- t_src(rp, fpi->SrcReg[0]),
- pfs_one,
- t_src(rp, fpi->SrcReg[1]),
- flags);
- break;
- case FP_OPCODE_CMP:
- case FP_OPCODE_COS:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- case FP_OPCODE_DP3:
- dest = t_dst(rp, fpi->DstReg);
- if (fpi->DstReg.WriteMask & WRITEMASK_W) {
- /* I assume these need to share the same alu slot */
- sync_streams(rp);
- emit_arith(rp, PFS_OP_DP4, dest, WRITEMASK_W,
- pfs_zero, pfs_zero, pfs_zero,
- flags);
- }
- emit_arith(rp, PFS_OP_DP3, t_dst(rp, fpi->DstReg),
- fpi->DstReg.WriteMask & WRITEMASK_XYZ,
- t_src(rp, fpi->SrcReg[0]),
- t_src(rp, fpi->SrcReg[1]),
- pfs_zero, flags);
- break;
- case FP_OPCODE_DP4:
- case FP_OPCODE_DPH:
- case FP_OPCODE_DST:
- case FP_OPCODE_EX2:
- case FP_OPCODE_FLR:
- case FP_OPCODE_FRC:
- case FP_OPCODE_KIL:
- case FP_OPCODE_LG2:
- case FP_OPCODE_LIT:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- case FP_OPCODE_LRP:
- /* TODO: use the special LRP form if possible */
- src0 = t_src(rp, fpi->SrcReg[0]);
- src1 = t_src(rp, fpi->SrcReg[1]);
- src2 = t_src(rp, fpi->SrcReg[2]);
- // result = tmp0tmp1 + (1 - tmp0)tmp2
- // = tmp0tmp1 + tmp2 + (-tmp0)tmp2
- // MAD temp, -tmp0, tmp2, tmp2
- // MAD result, tmp0, tmp1, temp
- temp = get_temp_reg(rp);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_XYZW,
- negate(src0), src2, src2, 0);
- emit_arith(rp, PFS_OP_MAD, t_dst(rp, fpi->DstReg), fpi->DstReg.WriteMask,
- src0, src1, temp, flags);
- free_temp(rp, temp);
- break;
- case FP_OPCODE_MAD:
- emit_arith(rp, PFS_OP_MAD, t_dst(rp, fpi->DstReg), fpi->DstReg.WriteMask,
- t_src(rp, fpi->SrcReg[0]),
- t_src(rp, fpi->SrcReg[1]),
- t_src(rp, fpi->SrcReg[2]),
- flags);
- break;
- case FP_OPCODE_MAX:
- case FP_OPCODE_MIN:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- case FP_OPCODE_MOV:
- case FP_OPCODE_SWZ:
- emit_arith(rp, PFS_OP_MAD, t_dst(rp, fpi->DstReg), fpi->DstReg.WriteMask,
- t_src(rp, fpi->SrcReg[0]), pfs_one, pfs_zero,
- flags);
- break;
- case FP_OPCODE_MUL:
- emit_arith(rp, PFS_OP_MAD, t_dst(rp, fpi->DstReg), fpi->DstReg.WriteMask,
- t_src(rp, fpi->SrcReg[0]),
- t_src(rp, fpi->SrcReg[1]),
- pfs_zero,
- flags);
- break;
- case FP_OPCODE_POW:
- src0 = t_src(rp, fpi->SrcReg[0]);
- src1 = t_src(rp, fpi->SrcReg[1]);
- dest = t_dst(rp, fpi->DstReg);
- temp = get_temp_reg(rp);
-
- emit_arith(rp, PFS_OP_LG2, temp, WRITEMASK_W,
- src0, pfs_zero, pfs_zero, 0);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W,
- temp, src1, pfs_zero, 0);
- emit_arith(rp, PFS_OP_EX2, dest, fpi->DstReg.WriteMask,
- temp, pfs_zero, pfs_zero, 0);
- free_temp(rp, temp);
- break;
- case FP_OPCODE_RCP:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- case FP_OPCODE_RSQ:
- emit_arith(rp, PFS_OP_RSQ, t_dst(rp, fpi->DstReg),
- fpi->DstReg.WriteMask,
- t_src(rp, fpi->SrcReg[0]), pfs_zero, pfs_zero,
- flags | PFS_FLAG_ABS);
- break;
- case FP_OPCODE_SCS:
- case FP_OPCODE_SGE:
- case FP_OPCODE_SIN:
- case FP_OPCODE_SLT:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- case FP_OPCODE_SUB:
- emit_arith(rp, PFS_OP_MAD, t_dst(rp, fpi->DstReg), fpi->DstReg.WriteMask,
- t_src(rp, fpi->SrcReg[0]),
- pfs_one,
- negate(t_src(rp, fpi->SrcReg[1])),
- flags);
- break;
- case FP_OPCODE_TEX:
- emit_tex(rp, fpi, R300_FPITX_OP_TEX);
- break;
- case FP_OPCODE_TXB:
- emit_tex(rp, fpi, R300_FPITX_OP_TXB);
- break;
- case FP_OPCODE_TXP:
- emit_tex(rp, fpi, R300_FPITX_OP_TXP);
- break;
- case FP_OPCODE_XPD:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- default:
- ERROR("unknown fpi->Opcode %d\n", fpi->Opcode);
- break;
- }
-
- if (rp->error)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-/* - Init structures
- * - Determine what hwregs each input corresponds to
- */
-static void init_program(struct r300_fragment_program *rp)
-{
- struct fragment_program *mp = &rp->mesa_program;
- struct fp_instruction *fpi;
- GLuint InputsRead = mp->InputsRead;
- GLuint fp_reg = 0;
- GLuint temps_used = 0; /* for rp->temps[] */
- int i;
-
- rp->translated = GL_FALSE;
- rp->error = GL_FALSE;
-
- rp->v_pos = 0;
- rp->s_pos = 0;
-
- rp->tex.length = 0;
- rp->node[0].alu_offset = 0;
- rp->node[0].alu_end = -1;
- rp->node[0].tex_offset = 0;
- rp->node[0].tex_end = -1;
- rp->cur_node = 0;
- rp->first_node_has_tex = 0;
- rp->used_in_node = 0;
- rp->dest_in_node = 0;
-
- rp->const_nr = 0;
- rp->param_nr = 0;
- rp->params_uptodate = GL_FALSE;
-
- rp->temp_in_use = 0;
- rp->hwreg_in_use = 0;
- rp->max_temp_idx = 0;
-
- /* Work out what temps the Mesa inputs correspond to, this must match
- * what setup_rs_unit does, which shouldn't be a problem as rs_unit
- * configures itself based on the fragprog's InputsRead
- *
- * I'm using get_hw_temp() here now rather than doing this manually.
- * This depends on get_hw_temp() allocating registers in order, starting
- * at 0 (which it currently does).
- */
-
- /* Texcoords come first */
- for (i=0;i<rp->ctx->Const.MaxTextureUnits;i++) {
- if (InputsRead & (FRAG_BIT_TEX0 << i))
- rp->inputs[FRAG_ATTRIB_TEX0+i] = get_hw_temp(rp);
- }
- InputsRead &= ~FRAG_BITS_TEX_ANY;
-
- /* Then primary colour */
- if (InputsRead & FRAG_BIT_COL0)
- rp->inputs[FRAG_ATTRIB_COL0] = get_hw_temp(rp);
- InputsRead &= ~FRAG_BIT_COL0;
-
- /* Secondary color */
- if (InputsRead & FRAG_BIT_COL1)
- rp->inputs[FRAG_ATTRIB_COL1] = get_hw_temp(rp);
- InputsRead &= ~FRAG_BIT_COL1;
-
- /* Anything else */
- if (InputsRead) {
- WARN_ONCE("Don't know how to handle inputs 0x%x\n", InputsRead);
- /* force read from hwreg 0 for now */
- for (i=0;i<32;i++)
- if (InputsRead & (1<<i)) rp->inputs[i] = 0;
- }
-
- /* Possibly the worst part of how I went about this... Find out what
- * temps are used by the mesa program so we don't clobber something
- * when we need a temp for other reasons.
- *
- * Possibly not too bad actually, as we could add to this later and
- * find out when inputs are last used so we can reuse them as temps.
- */
- if (!mp->Instructions) {
- ERROR("No instructions found in program\n");
- return;
- }
- for (fpi=mp->Instructions;fpi->Opcode != FP_OPCODE_END; fpi++) {
- for (i=0;i<3;i++) {
- if (fpi->SrcReg[i].File == PROGRAM_TEMPORARY) {
- if (!(temps_used & (1 << fpi->SrcReg[i].Index))) {
- temps_used |= (1 << fpi->SrcReg[i].Index);
- rp->temps[fpi->SrcReg[i].Index] = get_hw_temp(rp);
- }
- }
- }
- /* needed? surely if a program writes a temp it'll read it again */
- if (fpi->DstReg.File == PROGRAM_TEMPORARY) {
- if (!(temps_used & (1 << fpi->DstReg.Index))) {
- temps_used |= (1 << fpi->DstReg.Index);
- rp->temps[fpi->DstReg.Index] = get_hw_temp(rp);
- }
- }
- }
- rp->temp_in_use = temps_used;
-}
-
-static void update_params(struct r300_fragment_program *rp) {
- struct fragment_program *mp = &rp->mesa_program;
- int i;
-
- /* Ask Mesa nicely to fill in ParameterValues for us */
- if (rp->param_nr)
- _mesa_load_state_parameters(rp->ctx, mp->Parameters);
-
- for (i=0;i<rp->param_nr;i++)
- COPY_4V(rp->constant[rp->param[i].idx], rp->param[i].values);
-
- rp->params_uptodate = GL_TRUE;
-}
-
-void translate_fragment_shader(struct r300_fragment_program *rp)
-{
- int i;
-
- if (!rp->translated) {
- init_program(rp);
-
- if (parse_program(rp) == GL_FALSE) {
- dump_program(rp);
- return;
- }
-
- /* Finish off */
- sync_streams(rp);
- rp->node[rp->cur_node].alu_end = rp->v_pos - 1;
- rp->alu_offset = 0;
- rp->alu_end = rp->v_pos - 1;
- rp->tex_offset = 0;
- rp->tex_end = rp->tex.length - 1;
-
- rp->translated = GL_TRUE;
- if (0) dump_program(rp);
- }
-
-
- update_params(rp);
-}
-
-/* just some random things... */
-static void dump_program(struct r300_fragment_program *rp)
-{
- int i;
- static int pc = 0;
-
- fprintf(stderr, "pc=%d*************************************\n", pc++);
-
- fprintf(stderr, "Mesa program:\n");
- fprintf(stderr, "-------------\n");
- _mesa_debug_fp_inst(rp->mesa_program.NumTexInstructions +
- rp->mesa_program.NumAluInstructions,
- rp->mesa_program.Instructions);
- fflush(stdout);
-
- fprintf(stderr, "Hardware program\n");
- fprintf(stderr, "----------------\n");
- for (i=0;i<(rp->cur_node+1);i++) {
- fprintf(stderr, "NODE %d: alu_offset: %d, tex_offset: %d, alu_end: %d, tex_end: %d\n", i,
- rp->node[i].alu_offset,
- rp->node[i].tex_offset,
- rp->node[i].alu_end,
- rp->node[i].tex_end);
- }
-
-/* dump program in pretty_print_command_stream.tcl-readable format */
- fprintf(stderr, "%08x\n", ((rp->alu_end << 16) | (R300_PFS_INSTR0_0 >> 2)));
- for (i=0;i<=rp->alu_end;i++)
- fprintf(stderr, "%08x\n", rp->alu.inst[i].inst0);
- fprintf(stderr, "%08x\n", ((rp->alu_end << 16) | (R300_PFS_INSTR1_0 >> 2)));
- for (i=0;i<=rp->alu_end;i++)
- fprintf(stderr, "%08x\n", rp->alu.inst[i].inst1);
- fprintf(stderr, "%08x\n", ((rp->alu_end << 16) | (R300_PFS_INSTR2_0 >> 2)));
- for (i=0;i<=rp->alu_end;i++)
- fprintf(stderr, "%08x\n", rp->alu.inst[i].inst2);
- fprintf(stderr, "%08x\n", ((rp->alu_end << 16) | (R300_PFS_INSTR3_0 >> 2)));
- for (i=0;i<=rp->alu_end;i++)
- fprintf(stderr, "%08x\n", rp->alu.inst[i].inst3);
- fprintf(stderr, "00000000\n");
-
-}
-#endif // USE_ARB_F_P == 1
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.h
deleted file mode 100644
index ed318eb6a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef __R300_FRAGPROG_H_
-#define __R300_FRAGPROG_H_
-
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
-#include "program.h"
-#include "r300_context.h"
-#include "nvfragprog.h"
-
-/* representation of a register for emit_arith/swizzle */
-typedef struct _pfs_reg_t {
- enum {
- REG_TYPE_INPUT,
- REG_TYPE_OUTPUT,
- REG_TYPE_TEMP,
- REG_TYPE_CONST
- } type:2;
- GLuint index:6;
- GLuint v_swz:5;
- GLuint s_swz:5;
- GLuint negate:1; //XXX: we need to handle negate individually
- GLboolean valid:1;
-} pfs_reg_t;
-
-/* supported hw opcodes */
-#define PFS_OP_MAD 0
-#define PFS_OP_DP3 1
-#define PFS_OP_DP4 2
-#define PFS_OP_MIN 3
-#define PFS_OP_MAX 4
-#define PFS_OP_CMP 5
-#define PFS_OP_FRC 6
-#define PFS_OP_EX2 7
-#define PFS_OP_LG2 8
-#define PFS_OP_RCP 9
-#define PFS_OP_RSQ 10
-#define PFS_OP_REPL_ALPHA 11
-#define MAX_PFS_OP 11
-#define OP(n) PFS_OP_##n
-
-#define PFS_FLAG_SAT (1 << 0)
-#define PFS_FLAG_ABS (1 << 1)
-
-extern void translate_fragment_shader(struct r300_fragment_program *rp);
-
-#endif /* __R300_FRAGPROG_H_ */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog_swz.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog_swz.c
deleted file mode 100644
index 00977ce68..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_fragprog_swz.c
+++ /dev/null
@@ -1,1343 +0,0 @@
-/*
- * Copyright (C) 2005 Jerome Glisse. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-#include "r300_fragprog.h"
-#include "r300_reg.h"
-
-
-#define I0_000 ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_ZERO) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_111 ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_ZERO) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG2C_SHIFT) )
-#define I0_XXX ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_XXX) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_YYY ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_YYY) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_ZZZ ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_ZZZ) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_XYZ ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_XYZ) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_YZX ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_YZX) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_ZXY ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_ZXY) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_WZY ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0CA_WZY) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-
-#define IEMPTY 0
-#define I1_CST R300_FPI1_SRC0C_CONST
-
-#define I1_XYZ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X | \
- R300_FPI1_DSTC_REG_Y | \
- R300_FPI1_DSTC_REG_Z )
-#define I1_XY_ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X | \
- R300_FPI1_DSTC_REG_Y )
-#define I1_X_Z ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X | \
- R300_FPI1_DSTC_REG_Z )
-#define I1__YZ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_Y | \
- R300_FPI1_DSTC_REG_Z )
-#define I1_X__ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X )
-#define I1__Y_ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_Y )
-#define I1___Z ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_Z )
-
-#define SEMPTY {0,{0,0,0,0},{0,0,0,0,0,0,0,0}}
-
-struct r300_fragment_program_swizzle r300_swizzle [512] = {
- /* XXX */
- {1,{0,0,0,0},{ I0_XXX, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* YXX */
- {2,{0,0,0,0},{ I0_YYY, I1_X__,
- I0_XXX, I1__YZ,
- 0,0,
- 0,0 } },
- /* ZXX */
- {2,{0,0,0,0},{ I0_ZZZ, I1_X__,
- I0_XXX, I1__YZ,
- 0,0,
- 0,0 } },
- /* WXX */
- {2,{0,0,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- 0,0,
- 0,0} },
- /* 0XX */
- {2,{0,2,0,0},{ I0_XXX, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,
- 0,0 } },
- /* 1XX */
- {2,{0,2,0,0},{ I0_XXX, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XYX */
- {2,{0,0,0,0},{ I0_YYY, I1__Y_,
- I0_XXX, I1_X_Z,
- 0,0,0,0}},
- /* YYX */
- {2,{0,0,0,0},{ I0_YYY, I1_XY_,
- I0_XXX, I1___Z,
- 0,0,0,0}},
- /* ZYX */
- {3,{0,0,0,0},{ I0_ZZZ, I1_X__,
- I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- 0,0}},
- /* WYX */
- {3,{0,0,0,0},{ I0_WZY, I1_X__,
- I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- 0,0}},
- /* 0YX */
- {3,{0,0,2,0},{ I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 1YX */
- {3,{0,0,2,0},{ I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XZX */
- {2,{0,0,0,0},{ I0_YZX, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YZX */
- {1,{0,0,0,0},{ I0_YZX, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* ZZX */
- {2,{0,0,0,0},{ I0_YZX, I1__YZ,
- I0_ZZZ, I1_X__,0,0,0,0}},
- /* WZX */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_XXX, I1_X__,0,0,0,0}},
- /* 0ZX */
- {2,{0,2,0,0},{ I0_YZX, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 1ZX */
- {2,{0,2,0,0},{ I0_YZX, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XWX */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_XXX, I1_X_Z,
- 0,0}},
- /* YWX */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_YZX, I1_X_Z,
- 0,0}},
- /* ZWX */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_ZZZ, I1_X__,
- I0_XXX, I1___Z } },
- /* WWX */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_XY_,
- I0_YZX, I1___Z,
- 0,0}},
- /* 0WX */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_YZX, I1___Z,
- I0_000, I1_X__ | I1_CST } },
- /* 1WX */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_YZX, I1___Z,
- I0_111, I1_X__ | I1_CST } },
- SEMPTY,SEMPTY,
- /* X0X */
- {2,{0,2,0,0},{ I0_XXX, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Y0X */
- {2,{0,2,0,0},{ I0_YZX, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Z0X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* W0X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_WZY, I1_X__,
- 0,0}},
- /* 00X */
- {2,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1_XY_ | I1_CST,
- 0,0,0,0}},
- /* 10X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1X */
- {2,{0,2,0,0},{ I0_XXX, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Y1X */
- {2,{0,2,0,0},{ I0_YZX, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Z1X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* W1X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_WZY, I1_X__,
- 0,0}},
- /* 01X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 11X */
- {2,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1_XY_ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XXY */
- {2,{0,0,0,0},{ I0_YYY, I1___Z,
- I0_XXX, I1_XY_,
- 0,0,0,0}},
- /* YXY */
- {2,{0,0,0,0},{ I0_YYY, I1_X_Z,
- I0_XXX, I1__Y_,
- 0,0,0,0}},
- /* ZXY */
- {1,{0,0,0,0},{ I0_ZXY, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* WXY */
- {2,{0,0,0,0},{ I0_WZY, I1_X__,
- I0_ZXY, I1__YZ,
- 0,0,0,0}},
- /* 0XY */
- {2,{0,0,0,0},{ I0_ZXY, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 1XY */
- {2,{0,0,0,0},{ I0_ZXY, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XYY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YYY */
- {1,{0,0,0,0},{ I0_YYY, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* ZYY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* WYY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_WZY, I1_X__,
- 0,0,0,0}},
- /* 0YY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 1YY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* ZZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* WZY */
- {1,{0,0,0,0},{ I0_WZY, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* 0ZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 1ZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XWY */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_XXX, I1_X__,
- I0_YYY, I1___Z } },
- /* YWY */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_YYY, I1_X_Z,
- 0,0}},
- /* ZWY */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_ZXY, I1_X_Z,
- 0,0}},
- /* WWY */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_XY_,
- I0_ZXY, I1___Z,
- 0,0}},
- /* 0WY */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_ZXY, I1___Z,
- I0_000, I1_X__ | I1_CST } },
- /* 1WY */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_ZXY, I1___Z,
- I0_111, I1_X__ | I1_CST } },
- SEMPTY,SEMPTY,
- /* X0Y */
- {3,{0,2,0,0},{ I0_XXX, I1_X__,
- I0_000, I1__Y_ | I1_CST,
- I0_YYY, I1___Z,
- 0,0}},
- /* Y0Y */
- {2,{0,2,0,0},{ I0_YYY, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Z0Y */
- {2,{0,2,0,0},{ I0_ZXY, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* W0Y */
- {2,{0,2,0,0},{ I0_WZY, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* 00Y */
- {2,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_000, I1_XY_ | I1_CST,
- 0,0,0,0}},
- /* 10Y */
- {3,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1Y */
- {3,{0,2,0,0},{ I0_XXX, I1_X__,
- I0_111, I1__Y_ | I1_CST,
- I0_YYY, I1___Z,
- 0,0}},
- /* Y1Y */
- {2,{0,2,0,0},{ I0_YYY, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Z1Y */
- {2,{0,2,0,0},{ I0_ZXY, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* W1Y */
- {3,{0,2,0,0},{ I0_WZY, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* 01Y */
- {3,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 11Y */
- {2,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_111, I1_XY_ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XXZ */
- {2,{0,0,0,0},{ I0_XXX, I1_XY_,
- I0_ZZZ, I1___Z,
- 0,0,0,0}},
- /* YXZ */
- {3,{0,0,0,0},{ I0_XXX, I1__Y_,
- I0_YYY, I1_X__,
- I0_ZZZ, I1___Z,
- 0,0}},
- /* ZXZ */
- {2,{0,0,0,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1_X_Z,
- 0,0,0,0}},
- /* WXZ */
- {3,{0,0,0,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1___Z,
- I0_WZY, I1_X__,
- 0,0}},
- /* 0XZ */
- {3,{0,0,2,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1___Z,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 1XZ */
- {3,{0,0,2,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1___Z,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XYZ */
- {1,{0,0,0,0},{ I0_XYZ, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* YYZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1___Z,
- I0_YYY, I1_XY_,
- 0,0,0,0}},
- /* ZYZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1_X_Z,
- I0_YYY, I1__Y_,
- 0,0,0,0}},
- /* WYZ */
- {2,{0,0,0,0},{ I0_XYZ, I1__YZ,
- I0_WZY, I1_X__,
- 0,0,0,0}},
- /* 0YZ */
- {2,{0,2,0,0},{ I0_XYZ, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 1YZ */
- {2,{0,2,0,0},{ I0_XYZ, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XZZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YZZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1__YZ,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* ZZZ */
- {1,{0,0,0,0},{ I0_ZZZ, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* WZZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1__YZ,
- I0_WZY, I1_X__,
- 0,0,0,0}},
- /* 0ZZ */
- {2,{0,2,0,0},{ I0_ZZZ, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 1ZZ */
- {2,{0,2,0,0},{ I0_ZZZ, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XWZ */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_XYZ, I1_X_Z,
- 0,0}},
- /* YWZ */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_YYY, I1_X__,
- I0_XYZ, I1___Z } },
- /* ZWZ */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_ZZZ, I1_X_Z,
- 0,0}},
- /* WWZ */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_XY_,
- I0_XYZ, I1___Z,
- 0,0}},
- /* 0WZ */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_XYZ, I1___Z,
- I0_000, I1_X__ | I1_CST } },
- /* 1WZ */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_XYZ, I1___Z,
- I0_111, I1_X__ | I1_CST } },
- SEMPTY,SEMPTY,
- /* X0Z */
- {2,{0,2,0,0},{ I0_XYZ, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Y0Z */
- {3,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_YYY, I1_X__,
- 0,0}},
- /* Z0Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1_X_Z,
- I0_000, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* W0Z */
- {3,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_WZY, I1_X__,
- 0,0}},
- /* 00Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_000, I1_XY_ | I1_CST,
- 0,0,0,0}},
- /* 10Z */
- {3,{0,2,2,0},{ I0_ZZZ, I1___Z,
- I0_000, I1__Y_ | I1_CST,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1Z */
- {2,{0,2,0,0},{ I0_XYZ, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* Y1Z */
- {3,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_YYY, I1_X__,
- 0,0}},
- /* Z1Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1_X_Z,
- I0_111, I1__Y_ | I1_CST,
- 0,0,0,0}},
- /* W1Z */
- {3,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_WZY, I1_X__,
- 0,0}},
- /* 01Z */
- {3,{0,2,2,0},{ I0_ZZZ, I1___Z,
- I0_111, I1__Y_ | I1_CST,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 11Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_111, I1_XY_ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XXW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XXX, I1_XY_,
- 0,0}},
- /* YXW */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XXX, I1__Y_,
- I0_YYY, I1_X__ } },
- /* ZXW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_ZXY, I1_XY_,
- 0,0}},
- /* WXW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_X_Z,
- I0_XXX, I1__Y_,
- 0,0}},
- /* 0XW */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XXX, I1__Y_,
- I0_000, I1_X__ | I1_CST } },
- /* 1XW */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XXX, I1__Y_,
- I0_111, I1_X__ | I1_CST } },
- SEMPTY,SEMPTY,
- /* XYW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XYZ, I1_XY_,
- 0,0}},
- /* YYW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_YYY, I1_XY_,
- 0,0}},
- /* ZYW */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XYZ, I1__Y_,
- I0_ZZZ, I1_X__ } },
- /* WYW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_X_Z,
- I0_YYY, I1__Y_,
- 0,0}},
- /* 0YW */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_YYY, I1__Y_,
- I0_000, I1_X__ | I1_CST } },
- /* 1YW */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_YYY, I1__Y_,
- I0_111, I1_X__ | I1_CST } },
-
- SEMPTY,SEMPTY,
- /* XZW */
- {4,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XYZ, I1_X__,
- I0_ZZZ, I1__Y_ } },
- /* YZW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_YZX, I1_XY_,
- 0,0}},
- /* ZZW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_ZZZ, I1_XY_,
- 0,0}},
- /* WZW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_X_Z,
- I0_ZZZ, I1__Y_,
- 0,0}},
- /* 0ZW */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_ZZZ, I1__Y_,
- I0_000, I1_X__ | I1_CST } },
- /* 1ZW */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_ZZZ, I1__Y_,
- I0_111, I1_X__ | I1_CST } },
-
- SEMPTY,SEMPTY,
- /* XWW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- I0_XYZ, I1_X__,
- 0,0}},
- /* YWW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- I0_YYY, I1_X__,
- 0,0}},
- /* ZWW */
- {3,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* WWW */
- {2,{0,1,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1_XYZ,
- 0,0,0,0}},
- /* 0WW */
- {3,{0,1,2,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 1WW */
- {3,{0,1,2,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X0W */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XYZ, I1_X__,
- I0_000, I1__Y_ | I1_CST } },
- /* Y0W */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_YYY, I1_X__,
- I0_000, I1__Y_ | I1_CST } },
- /* Z0W */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_ZZZ, I1_X__,
- I0_000, I1__Y_ | I1_CST } },
- /* 00W */
- {3,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_000, I1_XY_ | I1_CST,
- 0,0}},
- /* 10W */
- {4,{0,1,2,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_111, I1_X__ | I1_CST,
- I0_000, I1__Y_ | I1_CST } },
- SEMPTY,SEMPTY,
- /* X1W */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_XYZ, I1_X__,
- I0_111, I1__Y_ | I1_CST } },
- /* Y1W */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_YYY, I1_X__,
- I0_111, I1__Y_ | I1_CST } },
- /* Z1W */
- {4,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_ZZZ, I1_X__,
- I0_111, I1__Y_ | I1_CST } },
- /* 01W */
- {4,{0,1,2,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_000, I1_X__ | I1_CST,
- I0_111, I1__Y_ | I1_CST } },
- /* 11W */
- {3,{0,1,0,2},{ I0_WZY, I1_X__,
- I0_XXX, I1___Z,
- I0_111, I1_XY_ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XX0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_XXX, I1_XY_,
- 0,0,0,0}},
- /* YX0 */
- {3,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_XXX, I1__Y_,
- I0_YYY, I1_X__,
- 0,0}},
- /* ZX0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_ZXY, I1_XY_,
- 0,0,0,0}},
- /* WX0 */
- {3,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_XXX, I1__Y_,
- I0_WZY, I1_X__,
- 0,0}},
- /* 0X0 */
- {2,{2,0,0,0},{ I0_000, I1_X_Z | I1_CST,
- I0_XXX, I1__Y_,
- 0,0,0,0}},
- /* 1X0 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_XXX, I1__Y_,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XY0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_XYZ, I1_XY_,
- 0,0,0,0}},
- /* YY0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_YYY, I1_XY_,
- 0,0,0,0}},
- /* ZY0 */
- {3,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_ZZZ, I1_X__,
- I0_YYY, I1__Y_,
- 0,0}},
- /* WY0 */
- {3,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_XYZ, I1__Y_,
- I0_WZY, I1_X__,
- 0,0}},
- /* 0Y0 */
- {2,{2,0,0,0},{ I0_000, I1_X_Z | I1_CST,
- I0_XYZ, I1__Y_,
- 0,0,0,0}},
- /* 1Y0 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_XYZ, I1__Y_,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XZ0 */
- {3,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_XYZ, I1_X__,
- I0_ZZZ, I1__Y_,
- 0,0}},
- /* YZ0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_YZX, I1_XY_,
- 0,0,0,0}},
- /* ZZ0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_ZZZ, I1_XY_,
- 0,0,0,0}},
- /* WZ0 */
- {2,{2,0,0,0},{ I0_000, I1___Z | I1_CST,
- I0_WZY, I1_XY_,
- 0,0,0,0}},
- /* 0Z0 */
- {2,{2,0,0,0},{ I0_000, I1_X_Z | I1_CST,
- I0_ZZZ, I1__Y_,
- 0,0,0,0}},
- /* 1Z0 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_ZZZ, I1__Y_,
- I0_111, I1_X__ | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XW0 */
- {4,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_000, I1___Z | I1_CST,
- I0_XYZ, I1_X__ } },
- /* YW0 */
- {4,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_000, I1___Z | I1_CST,
- I0_YYY, I1_X__ } },
- /* ZW0 */
- {4,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_000, I1___Z | I1_CST,
- I0_ZZZ, I1_X__ } },
- /* WW0 */
- {3,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1_XY_,
- I0_000, I1___Z | I1_CST,
- 0,0}},
- /* 0W0 */
- {3,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_000, I1_X_Z | I1_CST,
- 0,0}},
- /* 1W0 */
- {4,{0,1,2,2},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_000, I1___Z | I1_CST,
- I0_111, I1_X__ | I1_CST } },
- SEMPTY,SEMPTY,
- /* X00 */
- {2,{2,0,0,0},{ I0_000, I1__YZ | I1_CST,
- I0_XYZ, I1_X__,
- 0,0,0,0}},
- /* Y00 */
- {2,{2,0,0,0},{ I0_000, I1__YZ | I1_CST,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* Z00 */
- {2,{2,0,0,0},{ I0_000, I1__YZ | I1_CST,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* W00 */
- {2,{2,0,0,0},{ I0_000, I1__YZ | I1_CST,
- I0_WZY, I1_X__,
- 0,0,0,0}},
- /* 000 */
- {1,{2,0,0,0},{ I0_000, I1_XYZ | I1_CST,
- 0, 0, 0, 0, 0, 0 } },
- /* 100 */
- {2,{2,2,0,0},{ I0_000, I1__YZ | I1_CST,
- I0_111, I1_X__ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* X10 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_XYZ, I1_X__,
- I0_111, I1__Y_ | I1_CST,
- 0,0}},
- /* Y10 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_YYY, I1_X__,
- I0_111, I1__Y_ | I1_CST,
- 0,0}},
- /* Z10 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_ZZZ, I1_X__,
- I0_111, I1__Y_ | I1_CST,
- 0,0}},
- /* W10 */
- {3,{2,0,2,0},{ I0_000, I1___Z | I1_CST,
- I0_WZY, I1_X__,
- I0_111, I1__Y_ | I1_CST,
- 0,0}},
- /* 010 */
- {2,{2,2,0,0},{ I0_000, I1_X_Z | I1_CST,
- I0_111, I1__Y_ | I1_CST,
- 0, 0, 0, 0 } },
- /* 110 */
- {2,{2,2,0,0},{ I0_000, I1___Z | I1_CST,
- I0_111, I1_XY_ | I1_CST,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
-
-
-
- /* XX1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_XXX, I1_XY_,
- 0,0,0,0}},
- /* YX1 */
- {3,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_XXX, I1__Y_,
- I0_YYY, I1_X__,
- 0,0}},
- /* ZX1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_ZXY, I1_XY_,
- 0,0,0,0}},
- /* WX1 */
- {3,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_XXX, I1__Y_,
- I0_WZY, I1_X__,
- 0,0}},
- /* 0X1 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_XXX, I1__Y_,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 1X1 */
- {2,{2,0,0,0},{ I0_111, I1_X_Z | I1_CST,
- I0_XXX, I1__Y_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XY1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_XYZ, I1_XY_,
- 0,0,0,0}},
- /* YY1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_YYY, I1_XY_,
- 0,0,0,0}},
- /* ZY1 */
- {3,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_ZZZ, I1_X__,
- I0_YYY, I1__Y_,
- 0,0}},
- /* WY1 */
- {3,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_XYZ, I1__Y_,
- I0_WZY, I1_X__,
- 0,0}},
- /* 0Y1 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_XYZ, I1__Y_,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 1Y1 */
- {2,{2,0,0,0},{ I0_111, I1_X_Z | I1_CST,
- I0_XYZ, I1__Y_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XZ1 */
- {3,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_XYZ, I1_X__,
- I0_ZZZ, I1__Y_,
- 0,0}},
- /* YZ1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_YZX, I1_XY_,
- 0,0,0,0}},
- /* ZZ1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_ZZZ, I1_XY_,
- 0,0,0,0}},
- /* WZ1 */
- {2,{2,0,0,0},{ I0_111, I1___Z | I1_CST,
- I0_WZY, I1_XY_,
- 0,0,0,0}},
- /* 0Z1 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_ZZZ, I1__Y_,
- I0_000, I1_X__ | I1_CST,
- 0,0}},
- /* 1Z1 */
- {2,{2,0,0,0},{ I0_111, I1_X_Z | I1_CST,
- I0_ZZZ, I1__Y_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XW1 */
- {4,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_000, I1___Z | I1_CST,
- I0_XYZ, I1_X__ } },
- /* YW1 */
- {4,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_111, I1___Z | I1_CST,
- I0_YYY, I1_X__ } },
- /* ZW1 */
- {4,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_111, I1___Z | I1_CST,
- I0_ZZZ, I1_X__ } },
- /* WW1 */
- {3,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1_XY_,
- I0_111, I1___Z | I1_CST,
- 0,0}},
- /* 0W1 */
- {4,{0,1,2,2},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_111, I1___Z | I1_CST,
- I0_000, I1_X__ | I1_CST } },
- /* 1W1 */
- {3,{0,1,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_111, I1_X_Z | I1_CST,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X01 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_XYZ, I1_X__,
- I0_000, I1__Y_ | I1_CST,
- 0,0}},
- /* Y01 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_YYY, I1_X__,
- I0_000, I1__Y_ | I1_CST,
- 0,0}},
- /* Z01 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_ZZZ, I1_X__,
- I0_000, I1__Y_ | I1_CST,
- 0,0}},
- /* W01 */
- {3,{2,0,2,0},{ I0_111, I1___Z | I1_CST,
- I0_WZY, I1_X__,
- I0_000, I1__Y_ | I1_CST,
- 0,0}},
- /* 001 */
- {2,{2,2,0,0},{ I0_111, I1___Z | I1_CST,
- I0_000, I1_XY_ | I1_CST,
- 0,0,0,0}},
- /* 101 */
- {2,{2,2,0,0},{ I0_111, I1_X_Z | I1_CST,
- I0_000, I1__Y_ | I1_CST,
- 0, 0, 0, 0 } },
- SEMPTY,SEMPTY,
- /* X11 */
- {2,{2,0,0,0},{ I0_111, I1__YZ | I1_CST,
- I0_XYZ, I1_X__,
- 0,0,0,0}},
- /* Y11 */
- {2,{2,0,0,0},{ I0_111, I1__YZ | I1_CST,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* Z11 */
- {2,{2,0,0,0},{ I0_111, I1__YZ | I1_CST,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* W11 */
- {2,{2,0,0,0},{ I0_111, I1__YZ | I1_CST,
- I0_WZY, I1_X__,
- 0,0,0,0}},
- /* 011 */
- {2,{2,2,0,0},{ I0_111, I1__YZ | I1_CST,
- I0_000, I1_X__ | I1_CST,
- 0,0,0,0}},
- /* 111 */
- {1,{2,0,0,0},{ I0_111, I1_XYZ | I1_CST,
- 0, 0, 0, 0, 0, 0 } },
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY
-};
-
-/******************************************************************************
-* Color source mask table
-******************************************************************************/
-
-#define S_111 R300_FPI0_ARGC_ONE
-#define S_000 R300_FPI0_ARGC_ZERO
-
-#define S0XXX R300_FPI0_ARGC_SRC0C_XXX
-#define S0YYY R300_FPI0_ARGC_SRC0C_YYY
-#define S0ZZZ R300_FPI0_ARGC_SRC0C_ZZZ
-#define S0XYZ R300_FPI0_ARGC_SRC0C_XYZ
-#define S0ZXY R300_FPI0_ARGC_SRC0C_ZXY
-#define S0YZX R300_FPI0_ARGC_SRC0C_YZX
-#define S0WZY R300_FPI0_ARGC_SRC0CA_WZY
-#define S0WZY R300_FPI0_ARGC_SRC0CA_WZY
-
-#define S1XXX R300_FPI0_ARGC_SRC1C_XXX
-#define S1YYY R300_FPI0_ARGC_SRC1C_YYY
-#define S1ZZZ R300_FPI0_ARGC_SRC1C_ZZZ
-#define S1XYZ R300_FPI0_ARGC_SRC1C_XYZ
-#define S1ZXY R300_FPI0_ARGC_SRC1C_ZXY
-#define S1YZX R300_FPI0_ARGC_SRC1C_YZX
-#define S1WZY R300_FPI0_ARGC_SRC1CA_WZY
-
-#define S2XXX R300_FPI0_ARGC_SRC2C_XXX
-#define S2YYY R300_FPI0_ARGC_SRC2C_YYY
-#define S2ZZZ R300_FPI0_ARGC_SRC2C_ZZZ
-#define S2XYZ R300_FPI0_ARGC_SRC2C_XYZ
-#define S2ZXY R300_FPI0_ARGC_SRC2C_ZXY
-#define S2YZX R300_FPI0_ARGC_SRC2C_YZX
-#define S2WZY R300_FPI0_ARGC_SRC2CA_WZY
-
-#define ntnat 32
-
-const GLuint r300_swz_srcc_mask[3][512] = {
- {
- S0XXX,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0YZX,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0ZXY,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S0YYY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S0WZY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0XYZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0ZZZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,S_000,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,S_111,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat
- },
- {
- S1XXX,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1YZX,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1ZXY,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S1YYY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S1WZY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1XYZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1ZZZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,S_000,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,S_111,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat
- },
- {
- S2XXX,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2YZX,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2ZXY,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S2YYY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S2WZY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2XYZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2ZZZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,S_000,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,S_111,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat
- }
-};
-
-/******************************************************************************
-* Alpha source mask table
-******************************************************************************/
-
-GLuint r300_swz_srca_mask[3][6] = {
- { R300_FPI2_ARGA_SRC0C_X,
- R300_FPI2_ARGA_SRC0C_Y,
- R300_FPI2_ARGA_SRC0C_Z,
- R300_FPI2_ARGA_SRC0A,
- R300_FPI2_ARGA_ZERO,
- R300_FPI2_ARGA_ONE },
- { R300_FPI2_ARGA_SRC1C_X,
- R300_FPI2_ARGA_SRC1C_Y,
- R300_FPI2_ARGA_SRC1C_Z,
- R300_FPI2_ARGA_SRC1A,
- R300_FPI2_ARGA_ZERO,
- R300_FPI2_ARGA_ONE },
- { R300_FPI2_ARGA_SRC2C_X,
- R300_FPI2_ARGA_SRC2C_Y,
- R300_FPI2_ARGA_SRC2C_Z,
- R300_FPI2_ARGA_SRC2A,
- R300_FPI2_ARGA_ZERO,
- R300_FPI2_ARGA_ONE },
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.c
deleted file mode 100644
index 82379ebb3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ /dev/null
@@ -1,774 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002.
-Copyright (C) 2004 Nicolai Haehnle.
-All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#include <sched.h>
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
-#include "swrast/swrast.h"
-
-#include "r300_context.h"
-#include "radeon_ioctl.h"
-#include "r300_ioctl.h"
-#include "r300_cmdbuf.h"
-#include "r300_state.h"
-#include "r300_program.h"
-#include "radeon_reg.h"
-#include "r300_emit.h"
-
-#include "vblank.h"
-
-//#define CB_DPATH
-
-#define CLEARBUFFER_COLOR 0x1
-#define CLEARBUFFER_DEPTH 0x2
-#define CLEARBUFFER_STENCIL 0x4
-
-static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
-{
- GLcontext* ctx = r300->radeon.glCtx;
- __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
- GLuint cboffset, cbpitch;
- drm_r300_cmd_header_t* cmd2;
-#ifdef CB_DPATH
- r300ContextPtr rmesa=r300;
- LOCAL_VARS;
-#else
- int i;
-#endif
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s: %s buffer (%i,%i %ix%i)\n",
- __FUNCTION__, buffer ? "back" : "front",
- dPriv->x, dPriv->y, dPriv->w, dPriv->h);
-
- if (buffer) {
- cboffset = r300->radeon.radeonScreen->backOffset;
- cbpitch = r300->radeon.radeonScreen->backPitch;
- } else {
- cboffset = r300->radeon.radeonScreen->frontOffset;
- cbpitch = r300->radeon.radeonScreen->frontPitch;
- }
-
- cboffset += r300->radeon.radeonScreen->fbLocation;
-
-#ifndef CB_DPATH
- R300_STATECHANGE(r300, vir[0]);
- ((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
- r300->hw.vir[0].cmd[1] = 0x21030003;
-
- R300_STATECHANGE(r300, vir[1]);
- ((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = 1;
- r300->hw.vir[1].cmd[1] = 0xF688F688;
-
- R300_STATECHANGE(r300, vic);
- r300->hw.vic.cmd[R300_VIC_CNTL_0] = 0x00000001;
- r300->hw.vic.cmd[R300_VIC_CNTL_1] = 0x00000405;
-
- R300_STATECHANGE(r300, vof);
- r300->hw.vof.cmd[R300_VOF_CNTL_0] = R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT
- | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT;
- r300->hw.vof.cmd[R300_VOF_CNTL_1] = 0; /* no textures */
-
- R300_STATECHANGE(r300, txe);
- r300->hw.txe.cmd[R300_TXE_ENABLE] = 0;
-
- R300_STATECHANGE(r300, vpt);
- r300->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(1.0);
- r300->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(dPriv->x);
- r300->hw.vpt.cmd[R300_VPT_YSCALE] = r300PackFloat32(1.0);
- r300->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(dPriv->y);
- r300->hw.vpt.cmd[R300_VPT_ZSCALE] = r300PackFloat32(1.0);
- r300->hw.vpt.cmd[R300_VPT_ZOFFSET] = r300PackFloat32(0.0);
-
- R300_STATECHANGE(r300, at);
- r300->hw.at.cmd[R300_AT_ALPHA_TEST] = 0;
-
- R300_STATECHANGE(r300, bld);
- r300->hw.bld.cmd[R300_BLD_CBLEND] = 0;
- r300->hw.bld.cmd[R300_BLD_ABLEND] = 0;
-
- if (r300->radeon.radeonScreen->cpp == 4)
- cbpitch |= R300_COLOR_FORMAT_ARGB8888;
- else
- cbpitch |= R300_COLOR_FORMAT_RGB565;
-
- if (r300->radeon.sarea->tiling_enabled)
- cbpitch |= R300_COLOR_TILE_ENABLE;
-
- R300_STATECHANGE(r300, cb);
- r300->hw.cb.cmd[R300_CB_OFFSET] = cboffset;
- r300->hw.cb.cmd[R300_CB_PITCH] = cbpitch;
-
- R300_STATECHANGE(r300, unk221C);
- r300->hw.unk221C.cmd[1] = R300_221C_CLEAR;
-
- R300_STATECHANGE(r300, ps);
- r300->hw.ps.cmd[R300_PS_POINTSIZE] =
- ((dPriv->w * 6) << R300_POINTSIZE_X_SHIFT) |
- ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT);
-
- R300_STATECHANGE(r300, ri);
- for(i = 1; i <= 8; ++i)
- r300->hw.ri.cmd[i] = R300_RS_INTERP_USED;
-
- R300_STATECHANGE(r300, rc);
- /* The second constant is needed to get glxgears display anything .. */
- r300->hw.rc.cmd[1] = (1 << R300_RS_CNTL_CI_CNT_SHIFT) | R300_RS_CNTL_0_UNKNOWN_18;
- r300->hw.rc.cmd[2] = 0;
-
- R300_STATECHANGE(r300, rr);
- ((drm_r300_cmd_header_t*)r300->hw.rr.cmd)->packet0.count = 1;
- r300->hw.rr.cmd[1] = 0x00004000;
-
- R300_STATECHANGE(r300, cmk);
- if (flags & CLEARBUFFER_COLOR) {
- r300->hw.cmk.cmd[R300_CMK_COLORMASK] =
- (ctx->Color.ColorMask[BCOMP] ? R300_COLORMASK0_B : 0) |
- (ctx->Color.ColorMask[GCOMP] ? R300_COLORMASK0_G : 0) |
- (ctx->Color.ColorMask[RCOMP] ? R300_COLORMASK0_R : 0) |
- (ctx->Color.ColorMask[ACOMP] ? R300_COLORMASK0_A : 0);
- } else {
- r300->hw.cmk.cmd[R300_CMK_COLORMASK] = 0;
- }
-
- R300_STATECHANGE(r300, fp);
- r300->hw.fp.cmd[R300_FP_CNTL0] = 0; /* 1 pass, no textures */
- r300->hw.fp.cmd[R300_FP_CNTL1] = 0; /* no temporaries */
- r300->hw.fp.cmd[R300_FP_CNTL2] = 0; /* no offset, one ALU instr */
- r300->hw.fp.cmd[R300_FP_NODE0] = 0;
- r300->hw.fp.cmd[R300_FP_NODE1] = 0;
- r300->hw.fp.cmd[R300_FP_NODE2] = 0;
- r300->hw.fp.cmd[R300_FP_NODE3] = R300_PFS_NODE_LAST_NODE;
-
- R300_STATECHANGE(r300, fpi[0]);
- R300_STATECHANGE(r300, fpi[1]);
- R300_STATECHANGE(r300, fpi[2]);
- R300_STATECHANGE(r300, fpi[3]);
- ((drm_r300_cmd_header_t*)r300->hw.fpi[0].cmd)->packet0.count = 1;
- ((drm_r300_cmd_header_t*)r300->hw.fpi[1].cmd)->packet0.count = 1;
- ((drm_r300_cmd_header_t*)r300->hw.fpi[2].cmd)->packet0.count = 1;
- ((drm_r300_cmd_header_t*)r300->hw.fpi[3].cmd)->packet0.count = 1;
-
- /* MOV o0, t0 */
- r300->hw.fpi[0].cmd[1] = FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO));
- r300->hw.fpi[1].cmd[1] = FP_SELC(0,NO,XYZ,FP_TMP(0),0,0);
- r300->hw.fpi[2].cmd[1] = FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO));
- r300->hw.fpi[3].cmd[1] = FP_SELA(0,NO,W,FP_TMP(0),0,0);
-
- R300_STATECHANGE(r300, pvs);
- r300->hw.pvs.cmd[R300_PVS_CNTL_1] =
- (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
- (0 << R300_PVS_CNTL_1_POS_END_SHIFT) |
- (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
- r300->hw.pvs.cmd[R300_PVS_CNTL_2] = 0; /* no parameters */
- r300->hw.pvs.cmd[R300_PVS_CNTL_3] =
- (1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT);
-
- R300_STATECHANGE(r300, vpi);
- ((drm_r300_cmd_header_t*)r300->hw.vpi.cmd)->packet0.count = 8;
-
- /* MOV o0, i0; */
- r300->hw.vpi.cmd[1] = VP_OUT(ADD,OUT,0,XYZW);
- r300->hw.vpi.cmd[2] = VP_IN(IN,0);
- r300->hw.vpi.cmd[3] = VP_ZERO();
- r300->hw.vpi.cmd[4] = 0;
-
- /* MOV o1, i1; */
- r300->hw.vpi.cmd[5] = VP_OUT(ADD,OUT,1,XYZW);
- r300->hw.vpi.cmd[6] = VP_IN(IN,1);
- r300->hw.vpi.cmd[7] = VP_ZERO();
- r300->hw.vpi.cmd[8] = 0;
-
- R300_STATECHANGE(r300, zs);
- if (flags & CLEARBUFFER_DEPTH) {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |= 0x6; // test and write
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= (R300_ZS_ALWAYS<<R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
-/*
- R300_STATECHANGE(r300, zb);
- r300->hw.zb.cmd[R300_ZB_OFFSET] =
- 1024*4*300 +
- r300->radeon.radeonScreen->frontOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.zb.cmd[R300_ZB_PITCH] =
- r300->radeon.radeonScreen->depthPitch;
-*/
- } else {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_DISABLED_1; // disable
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
- }
-
- R300_STATECHANGE(r300, zs);
- if (flags & CLEARBUFFER_STENCIL) {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= ~R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &=
- ~((R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT));
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |=
- (R300_ZS_ALWAYS<<R300_RB3D_ZS1_FRONT_FUNC_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) |
- (R300_ZS_ALWAYS<<R300_RB3D_ZS1_BACK_FUNC_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT) ;
- r300->hw.zs.cmd[R300_ZS_CNTL_2] = r300->state.stencil.clear;
- }
-
- /* Make sure we have enough space */
- r300EnsureCmdBufSpace(r300, r300->hw.max_state_size + 9+8, __FUNCTION__);
-
- r300EmitState(r300);
-#else
- R300_STATECHANGE(r300, cb);
- reg_start(R300_RB3D_COLOROFFSET0, 0);
- e32(cboffset);
-
- if (r300->radeon.radeonScreen->cpp == 4)
- cbpitch |= R300_COLOR_FORMAT_ARGB8888;
- else
- cbpitch |= R300_COLOR_FORMAT_RGB565;
-
- reg_start(R300_RB3D_COLORPITCH0, 0);
- e32(cbpitch);
-
- R300_STATECHANGE(r300, cmk);
- reg_start(R300_RB3D_COLORMASK, 0);
-
- if (flags & CLEARBUFFER_COLOR) {
- e32((ctx->Color.ColorMask[BCOMP] ? R300_COLORMASK0_B : 0) |
- (ctx->Color.ColorMask[GCOMP] ? R300_COLORMASK0_G : 0) |
- (ctx->Color.ColorMask[RCOMP] ? R300_COLORMASK0_R : 0) |
- (ctx->Color.ColorMask[ACOMP] ? R300_COLORMASK0_A : 0));
- } else {
- e32(0);
- }
-
- R300_STATECHANGE(r300, zs);
- reg_start(R300_RB3D_ZSTENCIL_CNTL_0, 2);
-
- {
- uint32_t t1, t2;
-
- t1 = r300->hw.zs.cmd[R300_ZS_CNTL_0];
- t2 = r300->hw.zs.cmd[R300_ZS_CNTL_1];
-
- if (flags & CLEARBUFFER_DEPTH) {
- t1 &= R300_RB3D_STENCIL_ENABLE;
- t1 |= 0x6; // test and write
-
- t2 &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
- t2 |= (R300_ZS_ALWAYS<<R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
-/*
- R300_STATECHANGE(r300, zb);
- r300->hw.zb.cmd[R300_ZB_OFFSET] =
- 1024*4*300 +
- r300->radeon.radeonScreen->frontOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.zb.cmd[R300_ZB_PITCH] =
- r300->radeon.radeonScreen->depthPitch;
-*/
- } else {
- t1 &= R300_RB3D_STENCIL_ENABLE;
- t1 |= R300_RB3D_Z_DISABLED_1; // disable
-
- t2 &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
- }
-
- if (flags & CLEARBUFFER_STENCIL) {
- t1 &= ~R300_RB3D_STENCIL_ENABLE;
- t1 |= R300_RB3D_STENCIL_ENABLE;
-
- t2 &=
- ~((R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT));
- t2 |=
- (R300_ZS_ALWAYS<<R300_RB3D_ZS1_FRONT_FUNC_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) |
- (R300_ZS_ALWAYS<<R300_RB3D_ZS1_BACK_FUNC_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT) |
- (R300_ZS_REPLACE<<R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT) ;
- }
-
- e32(t1);
- e32(t2);
- e32(r300->state.stencil.clear);
- }
-
-#endif
-
- cmd2 = (drm_r300_cmd_header_t*)r300AllocCmdBuf(r300, 9, __FUNCTION__);
- cmd2[0].packet3.cmd_type = R300_CMD_PACKET3;
- cmd2[0].packet3.packet = R300_CMD_PACKET3_CLEAR;
- cmd2[1].u = r300PackFloat32(dPriv->w / 2.0);
- cmd2[2].u = r300PackFloat32(dPriv->h / 2.0);
- cmd2[3].u = r300PackFloat32(ctx->Depth.Clear);
- cmd2[4].u = r300PackFloat32(1.0);
- cmd2[5].u = r300PackFloat32(ctx->Color.ClearColor[0]);
- cmd2[6].u = r300PackFloat32(ctx->Color.ClearColor[1]);
- cmd2[7].u = r300PackFloat32(ctx->Color.ClearColor[2]);
- cmd2[8].u = r300PackFloat32(ctx->Color.ClearColor[3]);
-
-}
-
-#ifdef CB_DPATH
-static void r300EmitClearState(GLcontext * ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- r300ContextPtr rmesa=r300;
- __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
- int i;
- LOCAL_VARS;
-
- R300_STATECHANGE(r300, vir[0]);
- reg_start(R300_VAP_INPUT_ROUTE_0_0, 0);
- e32(0x21030003);
-
- R300_STATECHANGE(r300, vir[1]);
- reg_start(R300_VAP_INPUT_ROUTE_1_0, 0);
- e32(0xF688F688);
-
- R300_STATECHANGE(r300, vic);
- reg_start(R300_VAP_INPUT_CNTL_0, 1);
- e32(0x00000001);
- e32(0x00000405);
-
- R300_STATECHANGE(r300, vof);
- reg_start(R300_VAP_OUTPUT_VTX_FMT_0, 1);
- e32(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT);
- e32(0); /* no textures */
-
-
- R300_STATECHANGE(r300, txe);
- reg_start(R300_TX_ENABLE, 0);
- e32(0);
-
- R300_STATECHANGE(r300, vpt);
- reg_start(R300_SE_VPORT_XSCALE, 5);
- efloat(1.0);
- efloat(dPriv->x);
- efloat(1.0);
- efloat(dPriv->y);
- efloat(1.0);
- efloat(0.0);
-
- R300_STATECHANGE(r300, at);
- reg_start(R300_PP_ALPHA_TEST, 0);
- e32(0);
-
- R300_STATECHANGE(r300, bld);
- reg_start(R300_RB3D_CBLEND, 1);
- e32(0);
- e32(0);
-
- R300_STATECHANGE(r300, unk221C);
- reg_start(0x221C, 0);
- e32(R300_221C_CLEAR);
-
- R300_STATECHANGE(r300, ps);
- reg_start(R300_RE_POINTSIZE, 0);
- e32(((dPriv->w * 6) << R300_POINTSIZE_X_SHIFT) |
- ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT));
-
- R300_STATECHANGE(r300, ri);
- reg_start(R300_RS_INTERP_0, 8);
- for(i = 0; i < 8; ++i){
- e32(R300_RS_INTERP_USED);
- }
-
- R300_STATECHANGE(r300, rc);
- /* The second constant is needed to get glxgears display anything .. */
- reg_start(R300_RS_CNTL_0, 1);
- e32(R300_RS_CNTL_0_UNKNOWN_7 | R300_RS_CNTL_0_UNKNOWN_18);
- e32(0);
-
- R300_STATECHANGE(r300, rr);
- reg_start(R300_RS_ROUTE_0, 0);
- e32(0x00004000);
-
- R300_STATECHANGE(r300, fp);
- reg_start(R300_PFS_CNTL_0, 2);
- e32(0);
- e32(0);
- e32(0);
- reg_start(R300_PFS_NODE_0, 3);
- e32(0);
- e32(0);
- e32(0);
- e32(R300_PFS_NODE_LAST_NODE);
-
- R300_STATECHANGE(r300, fpi[0]);
- R300_STATECHANGE(r300, fpi[1]);
- R300_STATECHANGE(r300, fpi[2]);
- R300_STATECHANGE(r300, fpi[3]);
-
- reg_start(R300_PFS_INSTR0_0, 0);
- e32(FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO)));
-
- reg_start(R300_PFS_INSTR1_0, 0);
- e32(FP_SELC(0,NO,XYZ,FP_TMP(0),0,0));
-
- reg_start(R300_PFS_INSTR2_0, 0);
- e32(FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO)));
-
- reg_start(R300_PFS_INSTR3_0, 0);
- e32(FP_SELA(0,NO,W,FP_TMP(0),0,0));
-
- R300_STATECHANGE(r300, pvs);
- reg_start(R300_VAP_PVS_CNTL_1, 2);
- e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
- (0 << R300_PVS_CNTL_1_POS_END_SHIFT) |
- (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT));
- e32(0);
- e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT);
-
- R300_STATECHANGE(r300, vpi);
- vsf_start_fragment(0x0, 8);
- e32(VP_OUT(ADD,OUT,0,XYZW));
- e32(VP_IN(IN,0));
- e32(VP_ZERO());
- e32(0);
-
- e32(VP_OUT(ADD,OUT,1,XYZW));
- e32(VP_IN(IN,1));
- e32(VP_ZERO());
- e32(0);
-
-}
-#endif
-
-/**
- * Buffer clear
- */
-static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable;
- int flags = 0;
- int bits = 0;
- int swapped;
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
- __FUNCTION__, all, cx, cy, cw, ch);
-
- {
- LOCK_HARDWARE(&r300->radeon);
- UNLOCK_HARDWARE(&r300->radeon);
- if (dPriv->numClipRects == 0)
- return;
- }
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- flags |= BUFFER_BIT_FRONT_LEFT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if (mask & BUFFER_BIT_BACK_LEFT) {
- flags |= BUFFER_BIT_BACK_LEFT;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if (mask & BUFFER_BIT_DEPTH) {
- bits |= CLEARBUFFER_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if ( (mask & BUFFER_BIT_STENCIL) && r300->state.stencil.hw_stencil) {
- bits |= CLEARBUFFER_STENCIL;
- mask &= ~BUFFER_BIT_STENCIL;
- }
-
- if (mask) {
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "%s: swrast clear, mask: %x\n",
- __FUNCTION__, mask);
- _swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
- }
-
- swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1);
-
-#ifdef CB_DPATH
- if(flags || bits)
- r300EmitClearState(ctx);
-#endif
-
- if (flags & BUFFER_BIT_FRONT_LEFT) {
- r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, swapped);
- bits = 0;
- }
-
- if (flags & BUFFER_BIT_BACK_LEFT) {
- r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, swapped ^ 1);
- bits = 0;
- }
-
- if (bits)
- r300ClearBuffer(r300, bits, 0);
-
-#ifndef CB_DPATH
- /* Recalculate the hardware state. This could be done more efficiently,
- * but do keep it like this for now.
- */
- r300ResetHwState(r300);
-
- /* r300ClearBuffer has trampled all over the hardware state.. */
- r300->hw.all_dirty=GL_TRUE;
-#endif
-}
-
-void r300Flush(GLcontext * ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (r300->cmdbuf.count_used > r300->cmdbuf.count_reemit)
- r300FlushCmdBuf(r300, __FUNCTION__);
-}
-
-void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
-{
- struct r300_dma_buffer *dmabuf;
- int fd = rmesa->radeon.dri.fd;
- int index = 0;
- int size = 0;
- drmDMAReq dma;
- int ret;
-
- if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->dma.flush) {
- rmesa->dma.flush(rmesa);
- }
-
- if (rmesa->dma.current.buf)
- r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__);
-
- if (rmesa->dma.nr_released_bufs > 4)
- r300FlushCmdBuf(rmesa, __FUNCTION__);
-
- dma.context = rmesa->radeon.dri.hwContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = RADEON_BUFFER_SIZE;
- dma.request_list = &index;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
- LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */
-
- ret = drmDMA(fd, &dma);
-
- if (ret != 0) {
- /* Try to release some buffers and wait until we can't get any more */
- if (rmesa->dma.nr_released_bufs) {
- r300FlushCmdBufLocked(rmesa, __FUNCTION__);
- }
-
- if (RADEON_DEBUG & DEBUG_DMA)
- fprintf(stderr, "Waiting for buffers\n");
-
- radeonWaitForIdleLocked(&rmesa->radeon);
- ret = drmDMA(fd, &dma);
-
- if (ret != 0) {
- UNLOCK_HARDWARE(&rmesa->radeon);
- fprintf(stderr, "Error: Could not get dma buffer... exiting\n");
- exit(-1);
- }
- }
-
- UNLOCK_HARDWARE(&rmesa->radeon);
-
- if (RADEON_DEBUG & DEBUG_DMA)
- fprintf(stderr, "Allocated buffer %d\n", index);
-
- dmabuf = CALLOC_STRUCT(r300_dma_buffer);
- dmabuf->buf = &rmesa->radeon.radeonScreen->buffers->list[index];
- dmabuf->refcount = 1;
-
- rmesa->dma.current.buf = dmabuf;
- rmesa->dma.current.address = dmabuf->buf->address;
- rmesa->dma.current.end = dmabuf->buf->total;
- rmesa->dma.current.start = 0;
- rmesa->dma.current.ptr = 0;
-}
-
-void r300ReleaseDmaRegion(r300ContextPtr rmesa,
- struct r300_dma_region *region, const char *caller)
-{
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (!region->buf)
- return;
-
- if (rmesa->dma.flush)
- rmesa->dma.flush(rmesa);
-
- if (--region->buf->refcount == 0) {
- drm_radeon_cmd_header_t *cmd;
-
- if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
- fprintf(stderr, "%s -- DISCARD BUF %d\n", __FUNCTION__,
- region->buf->buf->idx);
- cmd =
- (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa,
- sizeof(*cmd) / 4,
- __FUNCTION__);
- cmd->dma.cmd_type = R300_CMD_DMA_DISCARD;
- cmd->dma.buf_idx = region->buf->buf->idx;
-
- FREE(region->buf);
- rmesa->dma.nr_released_bufs++;
- }
-
- region->buf = 0;
- region->start = 0;
-}
-
-/* Allocates a region from rmesa->dma.current. If there isn't enough
- * space in current, grab a new buffer (and discard what was left of current)
- */
-void r300AllocDmaRegion(r300ContextPtr rmesa,
- struct r300_dma_region *region,
- int bytes, int alignment)
-{
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
-
- if (rmesa->dma.flush)
- rmesa->dma.flush(rmesa);
-
- if (region->buf)
- r300ReleaseDmaRegion(rmesa, region, __FUNCTION__);
-
- alignment--;
- rmesa->dma.current.start = rmesa->dma.current.ptr =
- (rmesa->dma.current.ptr + alignment) & ~alignment;
-
- if (rmesa->dma.current.ptr + bytes > rmesa->dma.current.end)
- r300RefillCurrentDmaRegion(rmesa);
-
- region->start = rmesa->dma.current.start;
- region->ptr = rmesa->dma.current.start;
- region->end = rmesa->dma.current.start + bytes;
- region->address = rmesa->dma.current.address;
- region->buf = rmesa->dma.current.buf;
- region->buf->refcount++;
-
- rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */
- rmesa->dma.current.start =
- rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7;
-
- assert(rmesa->dma.current.ptr <= rmesa->dma.current.end);
-}
-
-/* Called via glXGetMemoryOffsetMESA() */
-GLuint r300GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn,
- const GLvoid * pointer)
-{
- GET_CURRENT_CONTEXT(ctx);
- r300ContextPtr rmesa;
- GLuint card_offset;
-
- if (!ctx || !(rmesa = R300_CONTEXT(ctx))) {
- fprintf(stderr, "%s: no context\n", __FUNCTION__);
- return ~0;
- }
-
- if (!r300IsGartMemory(rmesa, pointer, 0))
- return ~0;
-
- if (rmesa->radeon.dri.drmMinor < 6)
- return ~0;
-
- card_offset = r300GartOffsetFromVirtual(rmesa, pointer);
-
- return card_offset - rmesa->radeon.radeonScreen->gart_base;
-}
-
-GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer,
- GLint size)
-{
- int offset =
- (char *)pointer - (char *)rmesa->radeon.radeonScreen->gartTextures.map;
- int valid = (size >= 0 && offset >= 0
- && offset + size < rmesa->radeon.radeonScreen->gartTextures.size);
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "r300IsGartMemory( %p ) : %d\n", pointer,
- valid);
-
- return valid;
-}
-
-GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, const GLvoid * pointer)
-{
- int offset =
- (char *)pointer - (char *)rmesa->radeon.radeonScreen->gartTextures.map;
-
- //fprintf(stderr, "offset=%08x\n", offset);
-
- if (offset < 0 || offset > rmesa->radeon.radeonScreen->gartTextures.size)
- return ~0;
- else
- return rmesa->radeon.radeonScreen->gart_texture_offset + offset;
-}
-
-void r300InitIoctlFuncs(struct dd_function_table *functions)
-{
- functions->Clear = r300Clear;
- functions->Finish = radeonFinish;
- functions->Flush = r300Flush;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.h
deleted file mode 100644
index 5514214cc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_ioctl.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __R300_IOCTL_H__
-#define __R300_IOCTL_H__
-
-#include "r300_context.h"
-#include "radeon_drm.h"
-
-extern GLuint r300GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn,
- const GLvoid * pointer);
-
-extern GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer,
- GLint size);
-
-extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa,
- const GLvoid * pointer);
-
-extern void r300Flush(GLcontext * ctx);
-
-extern void r300RefillCurrentDmaRegion(r300ContextPtr rmesa);
-extern void r300ReleaseDmaRegion(r300ContextPtr rmesa,
- struct r300_dma_region *region, const char *caller);
-extern void r300AllocDmaRegion(r300ContextPtr rmesa,
- struct r300_dma_region *region,
- int bytes, int alignment);
-
-extern void r300InitIoctlFuncs(struct dd_function_table *functions);
-
-#endif /* __R300_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.c
deleted file mode 100644
index 1908ac07a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.c
+++ /dev/null
@@ -1,561 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r300/r300_maos_arrays.c,v 1.3 2003/02/23 23:59:01 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "imports.h"
-#include "macros.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "math/m_translate.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-#include "r300_context.h"
-#include "radeon_ioctl.h"
-#include "r300_state.h"
-#include "r300_maos.h"
-#include "r300_ioctl.h"
-
-#define DEBUG_ALL DEBUG_VERTS
-
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
- : "0" (nr), \
- "D" ((long)dst), \
- "S" ((long)src) ); \
-} while (0)
-#else
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int j; \
- for ( j = 0 ; j < nr ; j++ ) \
- dst[j] = ((int *)src)[j]; \
- dst += nr; \
-} while (0)
-#endif
-
-static void emit_vec4(GLcontext * ctx,
- struct r300_dma_region *rvb,
- GLvoid *data, int stride, int count)
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 4)
- COPY_DWORDS(out, data, count);
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out++;
- data += stride;
- }
-}
-
-static void emit_vec8(GLcontext * ctx,
- struct r300_dma_region *rvb,
- GLvoid *data, int stride, int count)
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 8)
- COPY_DWORDS(out, data, count * 2);
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data + 4);
- out += 2;
- data += stride;
- }
-}
-
-static void emit_vec12(GLcontext * ctx,
- struct r300_dma_region *rvb,
- GLvoid *data, int stride, int count)
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d out %p data %p\n",
- __FUNCTION__, count, stride, (void *)out, (void *)data);
-
- if (stride == 12)
- COPY_DWORDS(out, data, count * 3);
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data + 4);
- out[2] = *(int *)(data + 8);
- out += 3;
- data += stride;
- }
-}
-
-static void emit_vec16(GLcontext * ctx,
- struct r300_dma_region *rvb,
- GLvoid *data, int stride, int count)
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 16)
- COPY_DWORDS(out, data, count * 4);
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data + 4);
- out[2] = *(int *)(data + 8);
- out[3] = *(int *)(data + 12);
- out += 4;
- data += stride;
- }
-}
-
-static void emit_vector(GLcontext * ctx,
- struct r300_dma_region *rvb,
- GLvoid *data, int size, int stride, int count)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d size %d stride %d\n",
- __FUNCTION__, count, size, stride);
-
- if(r300IsGartMemory(rmesa, data, size*stride)){
- rvb->address = rmesa->radeon.radeonScreen->gartTextures.map;
- rvb->start = (char *)data - rvb->address;
- rvb->aos_offset = r300GartOffsetFromVirtual(rmesa, data);
-
- if(stride == 0)
- rvb->aos_stride = 0;
- else
- rvb->aos_stride = stride / 4;
-
- rvb->aos_size = size;
- return;
- }
-
- /* Gets triggered when playing with future_hw_tcl_on ...*/
- //assert(!rvb->buf);
-
- if (stride == 0) {
- r300AllocDmaRegion(rmesa, rvb, size * 4, 4);
- count = 1;
- rvb->aos_offset = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = size;
- } else {
- r300AllocDmaRegion(rmesa, rvb, size * count * 4, 4); /* alignment? */
- rvb->aos_offset = GET_START(rvb);
- rvb->aos_stride = size;
- rvb->aos_size = size;
- }
-
- /* Emit the data
- */
- switch (size) {
- case 1:
- emit_vec4(ctx, rvb, data, stride, count);
- break;
- case 2:
- emit_vec8(ctx, rvb, data, stride, count);
- break;
- case 3:
- emit_vec12(ctx, rvb, data, stride, count);
- break;
- case 4:
- emit_vec16(ctx, rvb, data, stride, count);
- break;
- default:
- assert(0);
- exit(1);
- break;
- }
-
-}
-
-void r300EmitElts(GLcontext * ctx, GLuint *elts, unsigned long n_elts)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct r300_dma_region *rvb=&rmesa->state.elt_dma;
- unsigned short int *out;
- int i;
-
- if(r300IsGartMemory(rmesa, elts, n_elts*sizeof(unsigned short int))){
- rvb->address = rmesa->radeon.radeonScreen->gartTextures.map;
- rvb->start = (char *)elts - rvb->address;
- rvb->aos_offset = rmesa->radeon.radeonScreen->gart_texture_offset + rvb->start;
- return ;
- }
-
- r300AllocDmaRegion(rmesa, rvb, n_elts*sizeof(unsigned short int), 2);
-
- out = (unsigned short int *)(rvb->address + rvb->start);
-
- for(i=0; i < n_elts; i++)
- out[i]=(unsigned short int)elts[i];
-}
-
-/* Emit vertex data to GART memory (unless immediate mode)
- * Route inputs to the vertex processor
- */
-void r300EmitArrays(GLcontext * ctx, GLboolean immd)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- r300ContextPtr r300 = rmesa;
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint nr = 0;
- GLuint count = VB->Count;
- GLuint dw,mask;
- GLuint vic_1 = 0; /* R300_VAP_INPUT_CNTL_1 */
- GLuint aa_vap_reg = 0; /* VAP register assignment */
- GLuint i;
- GLuint inputs = 0;
-
-
-#define CONFIGURE_AOS(r, f, v, sz, cn) { \
- if (RADEON_DEBUG & DEBUG_STATE) \
- fprintf(stderr, "Enabling "#v "\n"); \
- if (++nr >= R300_MAX_AOS_ARRAYS) { \
- fprintf(stderr, "Aieee! AOS array count exceeded!\n"); \
- exit(-1); \
- } \
- \
- if (hw_tcl_on == GL_FALSE) \
- rmesa->state.aos[nr-1].aos_reg = aa_vap_reg++; \
- rmesa->state.aos[nr-1].aos_format = f; \
- if (immd) { \
- rmesa->state.aos[nr-1].aos_size = 4; \
- rmesa->state.aos[nr-1].aos_stride = 4; \
- rmesa->state.aos[nr-1].aos_offset = 0; \
- } else { \
- emit_vector(ctx, \
- &rmesa->state.aos[nr-1], \
- v->data, \
- sz, \
- v->stride, \
- cn); \
- rmesa->state.vap_reg.r=rmesa->state.aos[nr-1].aos_reg; \
- } \
-}
-
- if (hw_tcl_on) {
- GLuint InputsRead = CURRENT_VERTEX_SHADER(ctx)->InputsRead;
- struct r300_vertex_program *prog=(struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
- if (InputsRead & (1<<VERT_ATTRIB_POS)) {
- inputs |= _TNL_BIT_POS;
- rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_POS];
- }
- if (InputsRead & (1<<VERT_ATTRIB_NORMAL)) {
- inputs |= _TNL_BIT_NORMAL;
- rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_NORMAL];
- }
- if (InputsRead & (1<<VERT_ATTRIB_COLOR0)) {
- inputs |= _TNL_BIT_COLOR0;
- rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_COLOR0];
- }
- if (InputsRead & (1<<VERT_ATTRIB_COLOR1)) {
- inputs |= _TNL_BIT_COLOR1;
- rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_COLOR1];
- }
- if (InputsRead & (1<<VERT_ATTRIB_FOG)) {
- inputs |= _TNL_BIT_FOG;
- rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_FOG];
- }
- if(ctx->Const.MaxTextureUnits > 8) { /* Not sure if this can even happen... */
- fprintf(stderr, "%s: Cant handle that many inputs\n", __FUNCTION__);
- exit(-1);
- }
- for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
- if (InputsRead & (1<<(VERT_ATTRIB_TEX0+i))) {
- inputs |= _TNL_BIT_TEX0<<i;
- rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_TEX0+i];
- }
- }
- nr = 0;
- } else {
- inputs = TNL_CONTEXT(ctx)->render_inputs;
- }
- rmesa->state.render_inputs = inputs;
-
- if (inputs & _TNL_BIT_POS) {
- CONFIGURE_AOS(i_coords, AOS_FORMAT_FLOAT,
- VB->ObjPtr,
- immd ? 4 : VB->ObjPtr->size,
- count);
-
- vic_1 |= R300_INPUT_CNTL_POS;
- }
-
- if (inputs & _TNL_BIT_NORMAL) {
- CONFIGURE_AOS(i_normal, AOS_FORMAT_FLOAT,
- VB->NormalPtr,
- immd ? 4 : VB->NormalPtr->size,
- count);
-
- vic_1 |= R300_INPUT_CNTL_NORMAL;
- }
-
- if (inputs & _TNL_BIT_COLOR0) {
- int emitsize=4;
-
- if (!immd) {
- if (VB->ColorPtr[0]->size == 4 &&
- (VB->ColorPtr[0]->stride != 0 ||
- VB->ColorPtr[0]->data[0][3] != 1.0)) {
- emitsize = 4;
- } else {
- emitsize = 3;
- }
- }
-
- CONFIGURE_AOS(i_color[0], AOS_FORMAT_FLOAT_COLOR,
- VB->ColorPtr[0],
- immd ? 4 : emitsize,
- count);
-
- vic_1 |= R300_INPUT_CNTL_COLOR;
- }
-
- if (inputs & _TNL_BIT_COLOR1) {
- CONFIGURE_AOS(i_color[1], AOS_FORMAT_FLOAT_COLOR,
- VB->SecondaryColorPtr[0],
- immd ? 4 : VB->SecondaryColorPtr[0]->size,
- count);
- }
-
-#if 0
- if (inputs & _TNL_BIT_FOG) {
- CONFIGURE_AOS( AOS_FORMAT_FLOAT,
- VB->FogCoordPtr,
- immd ? 4 : VB->FogCoordPtr->size,
- count);
- }
-#endif
-
- r300->state.texture.tc_count = 0;
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (inputs & (_TNL_BIT_TEX0 << i)) {
- CONFIGURE_AOS(i_tex[i], AOS_FORMAT_FLOAT,
- VB->TexCoordPtr[i],
- immd ? 4 : VB->TexCoordPtr[i]->size,
- count);
-
- vic_1 |= R300_INPUT_CNTL_TC0 << i;
- r300->state.texture.tc_count++;
- }
- }
-
-#define SHOW_INFO(n) do { \
- if (RADEON_DEBUG & DEBUG_ALL) { \
- fprintf(stderr, "RR[%d] - sz=%d, reg=%d, fmt=%d -- st=%d, of=0x%08x\n", \
- n, \
- r300->state.aos[n].aos_size, \
- r300->state.aos[n].aos_reg, \
- r300->state.aos[n].aos_format, \
- r300->state.aos[n].aos_stride, \
- r300->state.aos[n].aos_offset); \
- } \
-} while(0);
-
- /* setup INPUT_ROUTE */
- R300_STATECHANGE(r300, vir[0]);
- for(i=0;i+1<nr;i+=2){
- SHOW_INFO(i)
- SHOW_INFO(i+1)
- dw=(r300->state.aos[i].aos_size-1)
- | ((r300->state.aos[i].aos_reg)<<8)
- | (r300->state.aos[i].aos_format<<14)
- | (((r300->state.aos[i+1].aos_size-1)
- | ((r300->state.aos[i+1].aos_reg)<<8)
- | (r300->state.aos[i+1].aos_format<<14))<<16);
-
- if(i+2==nr){
- dw|=(1<<(13+16));
- }
- r300->hw.vir[0].cmd[R300_VIR_CNTL_0+(i>>1)]=dw;
- }
- if(nr & 1){
- SHOW_INFO(nr-1)
- dw=(r300->state.aos[nr-1].aos_size-1)
- | (r300->state.aos[nr-1].aos_format<<14)
- | ((r300->state.aos[nr-1].aos_reg)<<8)
- | (1<<13);
- r300->hw.vir[0].cmd[R300_VIR_CNTL_0+(nr>>1)]=dw;
- //fprintf(stderr, "vir0 dw=%08x\n", dw);
- }
- /* Set the rest of INPUT_ROUTE_0 to 0 */
- //for(i=((count+1)>>1); i<8; i++)r300->hw.vir[0].cmd[R300_VIR_CNTL_0+i]=(0x0);
- ((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = (nr+1)>>1;
-
-
- /* Mesa assumes that all missing components are from (0, 0, 0, 1) */
-#define ALL_COMPONENTS ((R300_INPUT_ROUTE_SELECT_X<<R300_INPUT_ROUTE_X_SHIFT) \
- | (R300_INPUT_ROUTE_SELECT_Y<<R300_INPUT_ROUTE_Y_SHIFT) \
- | (R300_INPUT_ROUTE_SELECT_Z<<R300_INPUT_ROUTE_Z_SHIFT) \
- | (R300_INPUT_ROUTE_SELECT_W<<R300_INPUT_ROUTE_W_SHIFT))
-
-#define ALL_DEFAULT ((R300_INPUT_ROUTE_SELECT_ZERO<<R300_INPUT_ROUTE_X_SHIFT) \
- | (R300_INPUT_ROUTE_SELECT_ZERO<<R300_INPUT_ROUTE_Y_SHIFT) \
- | (R300_INPUT_ROUTE_SELECT_ZERO<<R300_INPUT_ROUTE_Z_SHIFT) \
- | (R300_INPUT_ROUTE_SELECT_ONE<<R300_INPUT_ROUTE_W_SHIFT))
-
- R300_STATECHANGE(r300, vir[1]);
-
- for(i=0;i+1<nr;i+=2){
- /* do i first.. */
- mask=(1<<(r300->state.aos[i].aos_size*3))-1;
- dw=(ALL_COMPONENTS & mask)
- | (ALL_DEFAULT & ~mask)
- | R300_INPUT_ROUTE_ENABLE;
-
- /* i+1 */
- mask=(1<<(r300->state.aos[i+1].aos_size*3))-1;
- dw|=(
- (ALL_COMPONENTS & mask)
- | (ALL_DEFAULT & ~mask)
- | R300_INPUT_ROUTE_ENABLE
- )<<16;
-
- r300->hw.vir[1].cmd[R300_VIR_CNTL_0+(i>>1)]=dw;
- }
- if(nr & 1){
- mask=(1<<(r300->state.aos[nr-1].aos_size*3))-1;
- dw=(ALL_COMPONENTS & mask)
- | (ALL_DEFAULT & ~mask)
- | R300_INPUT_ROUTE_ENABLE;
- r300->hw.vir[1].cmd[R300_VIR_CNTL_0+(nr>>1)]=dw;
- //fprintf(stderr, "vir1 dw=%08x\n", dw);
- }
- /* Set the rest of INPUT_ROUTE_1 to 0 */
- //for(i=((count+1)>>1); i<8; i++)r300->hw.vir[1].cmd[R300_VIR_CNTL_0+i]=0x0;
- ((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = (nr+1)>>1;
-
- /* Set up input_cntl */
- /* I don't think this is needed for vertex buffers, but it doesn't hurt anything */
- R300_STATECHANGE(r300, vic);
- r300->hw.vic.cmd[R300_VIC_CNTL_0]=0x5555; /* Hard coded value, no idea what it means */
- r300->hw.vic.cmd[R300_VIC_CNTL_1]=vic_1;
-
-#if 0
- r300->hw.vic.cmd[R300_VIC_CNTL_1]=0;
-
- if(r300->state.render_inputs & _TNL_BIT_POS)
- r300->hw.vic.cmd[R300_VIC_CNTL_1]|=R300_INPUT_CNTL_POS;
-
- if(r300->state.render_inputs & _TNL_BIT_NORMAL)
- r300->hw.vic.cmd[R300_VIC_CNTL_1]|=R300_INPUT_CNTL_NORMAL;
-
- if(r300->state.render_inputs & _TNL_BIT_COLOR0)
- r300->hw.vic.cmd[R300_VIC_CNTL_1]|=R300_INPUT_CNTL_COLOR;
-
- for(i=0;i < ctx->Const.MaxTextureUnits;i++)
- if(r300->state.render_inputs & (_TNL_BIT_TEX0<<i))
- r300->hw.vic.cmd[R300_VIC_CNTL_1]|=(R300_INPUT_CNTL_TC0<<i);
-#endif
-
- /* Stage 3: VAP output */
-
- R300_STATECHANGE(r300, vof);
-
- r300->hw.vof.cmd[R300_VOF_CNTL_0]=0;
- r300->hw.vof.cmd[R300_VOF_CNTL_1]=0;
- if (hw_tcl_on){
- GLuint OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->OutputsWritten;
-
- if(OutputsWritten & (1<<VERT_RESULT_HPOS))
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT;
- if(OutputsWritten & (1<<VERT_RESULT_COL0))
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT;
- /*if(OutputsWritten & (1<<VERT_RESULT_COL1))
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT;
- if(OutputsWritten & (1<<VERT_RESULT_BFC0))
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT;
- if(OutputsWritten & (1<<VERT_RESULT_BFC1))
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT;*/
- //if(OutputsWritten & (1<<VERT_RESULT_FOGC))
-
- if(OutputsWritten & (1<<VERT_RESULT_PSIZ))
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT;
-
- for(i=0;i < ctx->Const.MaxTextureUnits;i++)
- if(OutputsWritten & (1<<(VERT_RESULT_TEX0+i)))
- r300->hw.vof.cmd[R300_VOF_CNTL_1] |= (4<<(3*i));
- } else {
- if(inputs & _TNL_BIT_POS)
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT;
- if(inputs & _TNL_BIT_COLOR0)
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT;
- if(inputs & _TNL_BIT_COLOR1)
- r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT;
-
- for(i=0;i < ctx->Const.MaxTextureUnits;i++)
- if(inputs & (_TNL_BIT_TEX0<<i))
- r300->hw.vof.cmd[R300_VOF_CNTL_1]|=(4<<(3*i));
- }
-
- rmesa->state.aos_count = nr;
-}
-
-void r300ReleaseArrays(GLcontext * ctx)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- int i;
-
- r300ReleaseDmaRegion(rmesa, &rmesa->state.elt_dma, __FUNCTION__);
- for (i=0;i<rmesa->state.aos_count;i++) {
- r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__);
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.h
deleted file mode 100644
index f76c94a21..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_maos.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __R300_MAOS_H__
-#define __R300_MAOS_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include "r300_context.h"
-
-extern void r300EmitElts(GLcontext * ctx, GLuint *elts, unsigned long n_elts);
-extern void r300EmitArrays(GLcontext * ctx, GLboolean immd);
-extern void r300ReleaseArrays(GLcontext * ctx);
-
-#endif
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_program.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_program.h
deleted file mode 100644
index d1754c066..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_program.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Copyright (C) 2004 Nicolai Haehnle. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __R300_PROGRAM_H__
-#define __R300_PROGRAM_H__
-
-#include "r300_reg.h"
-
-/**
- * Vertex program helper macros
- */
-
-/* Produce out dword */
-#define VP_OUTCLASS_TMP R300_VPI_OUT_REG_CLASS_TEMPORARY
-#define VP_OUTCLASS_OUT R300_VPI_OUT_REG_CLASS_RESULT
-
-#define VP_OUTMASK_X R300_VPI_OUT_WRITE_X
-#define VP_OUTMASK_Y R300_VPI_OUT_WRITE_Y
-#define VP_OUTMASK_Z R300_VPI_OUT_WRITE_Z
-#define VP_OUTMASK_W R300_VPI_OUT_WRITE_W
-#define VP_OUTMASK_XY (VP_OUTMASK_X|VP_OUTMASK_Y)
-#define VP_OUTMASK_XZ (VP_OUTMASK_X|VP_OUTMASK_Z)
-#define VP_OUTMASK_XW (VP_OUTMASK_X|VP_OUTMASK_W)
-#define VP_OUTMASK_XYZ (VP_OUTMASK_XY|VP_OUTMASK_Z)
-#define VP_OUTMASK_XYW (VP_OUTMASK_XY|VP_OUTMASK_W)
-#define VP_OUTMASK_XZW (VP_OUTMASK_XZ|VP_OUTMASK_W)
-#define VP_OUTMASK_XYZW (VP_OUTMASK_XYZ|VP_OUTMASK_W)
-#define VP_OUTMASK_YZ (VP_OUTMASK_Y|VP_OUTMASK_Z)
-#define VP_OUTMASK_YW (VP_OUTMASK_Y|VP_OUTMASK_W)
-#define VP_OUTMASK_YZW (VP_OUTMASK_YZ|VP_OUTMASK_W)
-#define VP_OUTMASK_ZW (VP_OUTMASK_Z|VP_OUTMASK_W)
-
-#define VP_OUT(instr,outclass,outidx,outmask) \
- (R300_VPI_OUT_OP_##instr | \
- ((outidx) << R300_VPI_OUT_REG_INDEX_SHIFT) | \
- VP_OUTCLASS_##outclass | \
- VP_OUTMASK_##outmask)
-
-/* Produce in dword */
-#define VP_INCLASS_TMP R300_VPI_IN_REG_CLASS_TEMPORARY
-#define VP_INCLASS_IN R300_VPI_IN_REG_CLASS_ATTRIBUTE
-#define VP_INCLASS_CONST R300_VPI_IN_REG_CLASS_PARAMETER
-
-#define VP_IN(class,idx) \
- (((idx) << R300_VPI_IN_REG_INDEX_SHIFT) | \
- VP_INCLASS_##class | \
- (R300_VPI_IN_SELECT_X << R300_VPI_IN_X_SHIFT) | \
- (R300_VPI_IN_SELECT_Y << R300_VPI_IN_Y_SHIFT) | \
- (R300_VPI_IN_SELECT_Z << R300_VPI_IN_Z_SHIFT) | \
- (R300_VPI_IN_SELECT_W << R300_VPI_IN_W_SHIFT))
-#define VP_ZERO() \
- ((R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_X_SHIFT) | \
- (R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_Y_SHIFT) | \
- (R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_Z_SHIFT) | \
- (R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_W_SHIFT))
-#define VP_ONE() \
- ((R300_VPI_IN_SELECT_ONE << R300_VPI_IN_X_SHIFT) | \
- (R300_VPI_IN_SELECT_ONE << R300_VPI_IN_Y_SHIFT) | \
- (R300_VPI_IN_SELECT_ONE << R300_VPI_IN_Z_SHIFT) | \
- (R300_VPI_IN_SELECT_ONE << R300_VPI_IN_W_SHIFT))
-
-#define VP_NEG(in,comp) ((in) ^ (R300_VPI_IN_NEG_##comp))
-#define VP_NEGALL(in,comp) VP_NEG(VP_NEG(VP_NEG(VP_NEG((in),X),Y),Z),W)
-
-/**
- * Fragment program helper macros
- */
-
-/* Produce unshifted source selectors */
-#define FP_TMP(idx) (idx)
-#define FP_CONST(idx) ((idx) | (1 << 5))
-
-/* Produce source/dest selector dword */
-#define FP_SELC_MASK_NO 0
-#define FP_SELC_MASK_X 1
-#define FP_SELC_MASK_Y 2
-#define FP_SELC_MASK_XY 3
-#define FP_SELC_MASK_Z 4
-#define FP_SELC_MASK_XZ 5
-#define FP_SELC_MASK_YZ 6
-#define FP_SELC_MASK_XYZ 7
-
-#define FP_SELC(destidx,regmask,outmask,src0,src1,src2) \
- (((destidx) << R300_FPI1_DSTC_SHIFT) | \
- (FP_SELC_MASK_##regmask << 23) | \
- (FP_SELC_MASK_##outmask << 26) | \
- ((src0) << R300_FPI1_SRC0C_SHIFT) | \
- ((src1) << R300_FPI1_SRC1C_SHIFT) | \
- ((src2) << R300_FPI1_SRC2C_SHIFT))
-
-#define FP_SELA_MASK_NO 0
-#define FP_SELA_MASK_W 1
-
-#define FP_SELA(destidx,regmask,outmask,src0,src1,src2) \
- (((destidx) << R300_FPI3_DSTA_SHIFT) | \
- (FP_SELA_MASK_##regmask << 23) | \
- (FP_SELA_MASK_##outmask << 24) | \
- ((src0) << R300_FPI3_SRC0A_SHIFT) | \
- ((src1) << R300_FPI3_SRC1A_SHIFT) | \
- ((src2) << R300_FPI3_SRC2A_SHIFT))
-
-/* Produce unshifted argument selectors */
-#define FP_ARGC(source) R300_FPI0_ARGC_##source
-#define FP_ARGA(source) R300_FPI2_ARGA_##source
-#define FP_ABS(arg) ((arg) | (1 << 6))
-#define FP_NEG(arg) ((arg) ^ (1 << 5))
-
-/* Produce instruction dword */
-#define FP_INSTRC(opcode,arg0,arg1,arg2) \
- (R300_FPI0_OUTC_##opcode | \
- ((arg0) << R300_FPI0_ARG0C_SHIFT) | \
- ((arg1) << R300_FPI0_ARG1C_SHIFT) | \
- ((arg2) << R300_FPI0_ARG2C_SHIFT))
-
-#define FP_INSTRA(opcode,arg0,arg1,arg2) \
- (R300_FPI2_OUTA_##opcode | \
- ((arg0) << R300_FPI2_ARG0A_SHIFT) | \
- ((arg1) << R300_FPI2_ARG1A_SHIFT) | \
- ((arg2) << R300_FPI2_ARG2A_SHIFT))
-
-extern void debug_vp(GLcontext *ctx, struct vertex_program *vp);
-extern void dump_program_params(GLcontext *ctx, struct vertex_program *vp);
-
-#endif /* __R300_PROGRAM_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_reg.h
deleted file mode 100644
index 3ea4f4fe8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_reg.h
+++ /dev/null
@@ -1,1387 +0,0 @@
-#ifndef _R300_REG_H
-#define _R300_REG_H
-
-#define R300_MC_INIT_MISC_LAT_TIMER 0x180
-# define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0
-# define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4
-# define R300_MC_MISC__MC_DISP0R_INIT_LAT_SHIFT 8
-# define R300_MC_MISC__MC_DISP1R_INIT_LAT_SHIFT 12
-# define R300_MC_MISC__MC_FIXED_INIT_LAT_SHIFT 16
-# define R300_MC_MISC__MC_E2R_INIT_LAT_SHIFT 20
-# define R300_MC_MISC__MC_SAME_PAGE_PRIO_SHIFT 24
-# define R300_MC_MISC__MC_GLOBW_INIT_LAT_SHIFT 28
-
-
-#define R300_MC_INIT_GFX_LAT_TIMER 0x154
-# define R300_MC_MISC__MC_G3D0R_INIT_LAT_SHIFT 0
-# define R300_MC_MISC__MC_G3D1R_INIT_LAT_SHIFT 4
-# define R300_MC_MISC__MC_G3D2R_INIT_LAT_SHIFT 8
-# define R300_MC_MISC__MC_G3D3R_INIT_LAT_SHIFT 12
-# define R300_MC_MISC__MC_TX0R_INIT_LAT_SHIFT 16
-# define R300_MC_MISC__MC_TX1R_INIT_LAT_SHIFT 20
-# define R300_MC_MISC__MC_GLOBR_INIT_LAT_SHIFT 24
-# define R300_MC_MISC__MC_GLOBW_FULL_LAT_SHIFT 28
-
-/*
-This file contains registers and constants for the R300. They have been
-found mostly by examining command buffers captured using glxtest, as well
-as by extrapolating some known registers and constants from the R200.
-
-I am fairly certain that they are correct unless stated otherwise in comments.
-*/
-
-#define R300_SE_VPORT_XSCALE 0x1D98
-#define R300_SE_VPORT_XOFFSET 0x1D9C
-#define R300_SE_VPORT_YSCALE 0x1DA0
-#define R300_SE_VPORT_YOFFSET 0x1DA4
-#define R300_SE_VPORT_ZSCALE 0x1DA8
-#define R300_SE_VPORT_ZOFFSET 0x1DAC
-
-
-/* This register is written directly and also starts data section in many 3d CP_PACKET3's */
-#define R300_VAP_VF_CNTL 0x2084
-
-# define R300_VAP_VF_CNTL__PRIM_TYPE__SHIFT 0
-# define R300_VAP_VF_CNTL__PRIM_NONE (0<<0)
-# define R300_VAP_VF_CNTL__PRIM_POINTS (1<<0)
-# define R300_VAP_VF_CNTL__PRIM_LINES (2<<0)
-# define R300_VAP_VF_CNTL__PRIM_LINE_STRIP (3<<0)
-# define R300_VAP_VF_CNTL__PRIM_TRIANGLES (4<<0)
-# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN (5<<0)
-# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP (6<<0)
-# define R300_VAP_VF_CNTL__PRIM_LINE_LOOP (12<<0)
-# define R300_VAP_VF_CNTL__PRIM_QUADS (13<<0)
-# define R300_VAP_VF_CNTL__PRIM_QUAD_STRIP (14<<0)
-# define R300_VAP_VF_CNTL__PRIM_POLYGON (15<<0)
-
-# define R300_VAP_VF_CNTL__PRIM_WALK__SHIFT 4
- /* State based - direct writes to registers trigger vertex generation */
-# define R300_VAP_VF_CNTL__PRIM_WALK_STATE_BASED (0<<4)
-# define R300_VAP_VF_CNTL__PRIM_WALK_INDICES (1<<4)
-# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST (2<<4)
-# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED (3<<4)
-
- /* I don't think I saw these three used.. */
-# define R300_VAP_VF_CNTL__COLOR_ORDER__SHIFT 6
-# define R300_VAP_VF_CNTL__TCL_OUTPUT_CTL_ENA__SHIFT 9
-# define R300_VAP_VF_CNTL__PROG_STREAM_ENA__SHIFT 10
-
- /* index size - when not set the indices are assumed to be 16 bit */
-# define R300_VAP_VF_CNTL__INDEX_SIZE_32bit (1<<11)
- /* number of vertices */
-# define R300_VAP_VF_CNTL__NUM_VERTICES__SHIFT 16
-
-/* BEGIN: Wild guesses */
-#define R300_VAP_OUTPUT_VTX_FMT_0 0x2090
-# define R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT (1<<0)
-# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT (1<<1)
-# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT (1<<2) /* GUESS */
-# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT (1<<3) /* GUESS */
-# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT (1<<4) /* GUESS */
-# define R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT (1<<16) /* GUESS */
-
-#define R300_VAP_OUTPUT_VTX_FMT_1 0x2094
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18
-# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21
-/* END */
-
-#define R300_SE_VTE_CNTL 0x20b0
-# define R300_VPORT_X_SCALE_ENA 0x00000001
-# define R300_VPORT_X_OFFSET_ENA 0x00000002
-# define R300_VPORT_Y_SCALE_ENA 0x00000004
-# define R300_VPORT_Y_OFFSET_ENA 0x00000008
-# define R300_VPORT_Z_SCALE_ENA 0x00000010
-# define R300_VPORT_Z_OFFSET_ENA 0x00000020
-# define R300_VTX_XY_FMT 0x00000100
-# define R300_VTX_Z_FMT 0x00000200
-# define R300_VTX_W0_FMT 0x00000400
-# define R300_VTX_W0_NORMALIZE 0x00000800
-# define R300_VTX_ST_DENORMALIZED 0x00001000
-
-/* BEGIN: Vertex data assembly - lots of uncertainties */
-/* gap */
-/* Where do we get our vertex data?
-//
-// Vertex data either comes either from immediate mode registers or from
-// vertex arrays.
-// There appears to be no mixed mode (though we can force the pitch of
-// vertex arrays to 0, effectively reusing the same element over and over
-// again).
-//
-// Immediate mode is controlled by the INPUT_CNTL registers. I am not sure
-// if these registers influence vertex array processing.
-//
-// Vertex arrays are controlled via the 3D_LOAD_VBPNTR packet3.
-//
-// In both cases, vertex attributes are then passed through INPUT_ROUTE.
-
-// Beginning with INPUT_ROUTE_0_0 is a list of WORDs that route vertex data
-// into the vertex processor's input registers.
-// The first word routes the first input, the second word the second, etc.
-// The corresponding input is routed into the register with the given index.
-// The list is ended by a word with INPUT_ROUTE_END set.
-//
-// Always set COMPONENTS_4 in immediate mode. */
-
-#define R300_VAP_INPUT_ROUTE_0_0 0x2150
-# define R300_INPUT_ROUTE_COMPONENTS_1 (0 << 0)
-# define R300_INPUT_ROUTE_COMPONENTS_2 (1 << 0)
-# define R300_INPUT_ROUTE_COMPONENTS_3 (2 << 0)
-# define R300_INPUT_ROUTE_COMPONENTS_4 (3 << 0)
-# define R300_INPUT_ROUTE_COMPONENTS_RGBA (4 << 0) /* GUESS */
-# define R300_VAP_INPUT_ROUTE_IDX_SHIFT 8
-# define R300_VAP_INPUT_ROUTE_IDX_MASK (31 << 8) /* GUESS */
-# define R300_VAP_INPUT_ROUTE_END (1 << 13)
-# define R300_INPUT_ROUTE_IMMEDIATE_MODE (0 << 14) /* GUESS */
-# define R300_INPUT_ROUTE_FLOAT (1 << 14) /* GUESS */
-# define R300_INPUT_ROUTE_UNSIGNED_BYTE (2 << 14) /* GUESS */
-# define R300_INPUT_ROUTE_FLOAT_COLOR (3 << 14) /* GUESS */
-#define R300_VAP_INPUT_ROUTE_0_1 0x2154
-#define R300_VAP_INPUT_ROUTE_0_2 0x2158
-#define R300_VAP_INPUT_ROUTE_0_3 0x215C
-#define R300_VAP_INPUT_ROUTE_0_4 0x2160
-#define R300_VAP_INPUT_ROUTE_0_5 0x2164
-#define R300_VAP_INPUT_ROUTE_0_6 0x2168
-#define R300_VAP_INPUT_ROUTE_0_7 0x216C
-
-/* gap */
-/* Notes:
-// - always set up to produce at least two attributes:
-// if vertex program uses only position, fglrx will set normal, too
-// - INPUT_CNTL_0_COLOR and INPUT_CNTL_COLOR bits are always equal */
-#define R300_VAP_INPUT_CNTL_0 0x2180
-# define R300_INPUT_CNTL_0_COLOR 0x00000001
-#define R300_VAP_INPUT_CNTL_1 0x2184
-# define R300_INPUT_CNTL_POS 0x00000001
-# define R300_INPUT_CNTL_NORMAL 0x00000002
-# define R300_INPUT_CNTL_COLOR 0x00000004
-# define R300_INPUT_CNTL_TC0 0x00000400
-# define R300_INPUT_CNTL_TC1 0x00000800
-# define R300_INPUT_CNTL_TC2 0x00001000 /* GUESS */
-# define R300_INPUT_CNTL_TC3 0x00002000 /* GUESS */
-# define R300_INPUT_CNTL_TC4 0x00004000 /* GUESS */
-# define R300_INPUT_CNTL_TC5 0x00008000 /* GUESS */
-# define R300_INPUT_CNTL_TC6 0x00010000 /* GUESS */
-# define R300_INPUT_CNTL_TC7 0x00020000 /* GUESS */
-
-/* gap */
-/* Words parallel to INPUT_ROUTE_0; All words that are active in INPUT_ROUTE_0
-// are set to a swizzling bit pattern, other words are 0.
-//
-// In immediate mode, the pattern is always set to xyzw. In vertex array
-// mode, the swizzling pattern is e.g. used to set zw components in texture
-// coordinates with only tweo components. */
-#define R300_VAP_INPUT_ROUTE_1_0 0x21E0
-# define R300_INPUT_ROUTE_SELECT_X 0
-# define R300_INPUT_ROUTE_SELECT_Y 1
-# define R300_INPUT_ROUTE_SELECT_Z 2
-# define R300_INPUT_ROUTE_SELECT_W 3
-# define R300_INPUT_ROUTE_SELECT_ZERO 4
-# define R300_INPUT_ROUTE_SELECT_ONE 5
-# define R300_INPUT_ROUTE_SELECT_MASK 7
-# define R300_INPUT_ROUTE_X_SHIFT 0
-# define R300_INPUT_ROUTE_Y_SHIFT 3
-# define R300_INPUT_ROUTE_Z_SHIFT 6
-# define R300_INPUT_ROUTE_W_SHIFT 9
-# define R300_INPUT_ROUTE_ENABLE (15 << 12)
-#define R300_VAP_INPUT_ROUTE_1_1 0x21E4
-#define R300_VAP_INPUT_ROUTE_1_2 0x21E8
-#define R300_VAP_INPUT_ROUTE_1_3 0x21EC
-#define R300_VAP_INPUT_ROUTE_1_4 0x21F0
-#define R300_VAP_INPUT_ROUTE_1_5 0x21F4
-#define R300_VAP_INPUT_ROUTE_1_6 0x21F8
-#define R300_VAP_INPUT_ROUTE_1_7 0x21FC
-
-/* END */
-
-/* gap */
-/* BEGIN: Upload vertex program and data
-// The programmable vertex shader unit has a memory bank of unknown size
-// that can be written to in 16 byte units by writing the address into
-// UPLOAD_ADDRESS, followed by data in UPLOAD_DATA (multiples of 4 DWORDs).
-//
-// Pointers into the memory bank are always in multiples of 16 bytes.
-//
-// The memory bank is divided into areas with fixed meaning.
-//
-// Starting at address UPLOAD_PROGRAM: Vertex program instructions.
-// Native limits reported by drivers from ATI suggest size 256 (i.e. 4KB),
-// whereas the difference between known addresses suggests size 512.
-//
-// Starting at address UPLOAD_PARAMETERS: Vertex program parameters.
-// Native reported limits and the VPI layout suggest size 256, whereas
-// difference between known addresses suggests size 512.
-//
-// At address UPLOAD_POINTSIZE is a vector (0, 0, ps, 0), where ps is the
-// floating point pointsize. The exact purpose of this state is uncertain,
-// as there is also the R300_RE_POINTSIZE register.
-//
-// Multiple vertex programs and parameter sets can be loaded at once,
-// which could explain the size discrepancy. */
-#define R300_VAP_PVS_UPLOAD_ADDRESS 0x2200
-# define R300_PVS_UPLOAD_PROGRAM 0x00000000
-# define R300_PVS_UPLOAD_PARAMETERS 0x00000200
-# define R300_PVS_UPLOAD_POINTSIZE 0x00000406
-/* gap */
-#define R300_VAP_PVS_UPLOAD_DATA 0x2208
-/* END */
-
-/* gap */
-/* I do not know the purpose of this register. However, I do know that
-// it is set to 221C_CLEAR for clear operations and to 221C_NORMAL
-// for normal rendering. */
-#define R300_VAP_UNKNOWN_221C 0x221C
-# define R300_221C_NORMAL 0x00000000
-# define R300_221C_CLEAR 0x0001C000
-
-/* gap */
-/* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between
-// rendering commands and overwriting vertex program parameters.
-// Therefore, I suspect writing zero to 0x2284 synchronizes the engine and
-// avoids bugs caused by still running shaders reading bad data from memory. */
-#define R300_VAP_PVS_WAITIDLE 0x2284 /* GUESS */
-
-/* Absolutely no clue what this register is about. */
-#define R300_VAP_UNKNOWN_2288 0x2288
-# define R300_2288_R300 0x00750000 /* -- nh */
-# define R300_2288_RV350 0x0000FFFF /* -- Vladimir */
-
-/* gap */
-/* Addresses are relative to the vertex program instruction area of the
-// memory bank. PROGRAM_END points to the last instruction of the active
-// program
-//
-// The meaning of the two UNKNOWN fields is obviously not known. However,
-// experiments so far have shown that both *must* point to an instruction
-// inside the vertex program, otherwise the GPU locks up.
-// fglrx usually sets CNTL_3_UNKNOWN to the end of the program and
-// CNTL_1_UNKNOWN points to instruction where last write to position takes place.
-// Most likely this is used to ignore rest of the program in cases where group of verts arent visible.
-// For some reason this "section" is sometimes accepted other instruction that have
-// no relationship with position calculations.
-*/
-#define R300_VAP_PVS_CNTL_1 0x22D0
-# define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0
-# define R300_PVS_CNTL_1_POS_END_SHIFT 10
-# define R300_PVS_CNTL_1_PROGRAM_END_SHIFT 20
-/* Addresses are relative the the vertex program parameters area. */
-#define R300_VAP_PVS_CNTL_2 0x22D4
-# define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0
-# define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT 16
-#define R300_VAP_PVS_CNTL_3 0x22D8
-# define R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT 10
-# define R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT 0
-
-/* The entire range from 0x2300 to 0x2AC inclusive seems to be used for
-// immediate vertices */
-#define R300_VAP_VTX_COLOR_R 0x2464
-#define R300_VAP_VTX_COLOR_G 0x2468
-#define R300_VAP_VTX_COLOR_B 0x246C
-#define R300_VAP_VTX_POS_0_X_1 0x2490 /* used for glVertex2*() */
-#define R300_VAP_VTX_POS_0_Y_1 0x2494
-#define R300_VAP_VTX_COLOR_PKD 0x249C /* RGBA */
-#define R300_VAP_VTX_POS_0_X_2 0x24A0 /* used for glVertex3*() */
-#define R300_VAP_VTX_POS_0_Y_2 0x24A4
-#define R300_VAP_VTX_POS_0_Z_2 0x24A8
-#define R300_VAP_VTX_END_OF_PKT 0x24AC /* write 0 to indicate end of packet? */
-
-/* gap */
-
-/* These are values from r300_reg/r300_reg.h - they are known to be correct
- and are here so we can use one register file instead of several
- - Vladimir */
-#define R300_GB_VAP_RASTER_VTX_FMT_0 0x4000
-# define R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT (1<<0)
-# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_0_PRESENT (1<<1)
-# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_1_PRESENT (1<<2)
-# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_2_PRESENT (1<<3)
-# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_3_PRESENT (1<<4)
-# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_SPACE (0xf<<5)
-# define R300_GB_VAP_RASTER_VTX_FMT_0__PT_SIZE_PRESENT (0x1<<16)
-
-#define R300_GB_VAP_RASTER_VTX_FMT_1 0x4004
- /* each of the following is 3 bits wide, specifies number
- of components */
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18
-# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21
-
-/* UNK30 seems to enables point to quad transformation on textures
- (or something closely related to that).
- This bit is rather fatal at the time being due to lackings at pixel shader side */
-#define R300_GB_ENABLE 0x4008
-# define R300_GB_POINT_STUFF_ENABLE (1<<0)
-# define R300_GB_LINE_STUFF_ENABLE (1<<1)
-# define R300_GB_TRIANGLE_STUFF_ENABLE (1<<2)
-# define R300_GB_STENCIL_AUTO_ENABLE (1<<4)
-# define R300_GB_UNK30 (1<<30)
- /* each of the following is 2 bits wide */
-#define R300_GB_TEX_REPLICATE 0
-#define R300_GB_TEX_ST 1
-#define R300_GB_TEX_STR 2
-# define R300_GB_TEX0_SOURCE_SHIFT 16
-# define R300_GB_TEX1_SOURCE_SHIFT 18
-# define R300_GB_TEX2_SOURCE_SHIFT 20
-# define R300_GB_TEX3_SOURCE_SHIFT 22
-# define R300_GB_TEX4_SOURCE_SHIFT 24
-# define R300_GB_TEX5_SOURCE_SHIFT 26
-# define R300_GB_TEX6_SOURCE_SHIFT 28
-# define R300_GB_TEX7_SOURCE_SHIFT 30
-
-/* MSPOS - positions for multisample antialiasing (?) */
-#define R300_GB_MSPOS0 0x4010
- /* shifts - each of the fields is 4 bits */
-# define R300_GB_MSPOS0__MS_X0_SHIFT 0
-# define R300_GB_MSPOS0__MS_Y0_SHIFT 4
-# define R300_GB_MSPOS0__MS_X1_SHIFT 8
-# define R300_GB_MSPOS0__MS_Y1_SHIFT 12
-# define R300_GB_MSPOS0__MS_X2_SHIFT 16
-# define R300_GB_MSPOS0__MS_Y2_SHIFT 20
-# define R300_GB_MSPOS0__MSBD0_Y 24
-# define R300_GB_MSPOS0__MSBD0_X 28
-
-#define R300_GB_MSPOS1 0x4014
-# define R300_GB_MSPOS1__MS_X3_SHIFT 0
-# define R300_GB_MSPOS1__MS_Y3_SHIFT 4
-# define R300_GB_MSPOS1__MS_X4_SHIFT 8
-# define R300_GB_MSPOS1__MS_Y4_SHIFT 12
-# define R300_GB_MSPOS1__MS_X5_SHIFT 16
-# define R300_GB_MSPOS1__MS_Y5_SHIFT 20
-# define R300_GB_MSPOS1__MSBD1 24
-
-
-#define R300_GB_TILE_CONFIG 0x4018
-# define R300_GB_TILE_ENABLE (1<<0)
-# define R300_GB_TILE_PIPE_COUNT_RV300 0
-# define R300_GB_TILE_PIPE_COUNT_R300 (3<<1)
-# define R300_GB_TILE_PIPE_COUNT_R420 (7<<1)
-# define R300_GB_TILE_SIZE_8 0
-# define R300_GB_TILE_SIZE_16 (1<<4)
-# define R300_GB_TILE_SIZE_32 (2<<4)
-# define R300_GB_SUPER_SIZE_1 (0<<6)
-# define R300_GB_SUPER_SIZE_2 (1<<6)
-# define R300_GB_SUPER_SIZE_4 (2<<6)
-# define R300_GB_SUPER_SIZE_8 (3<<6)
-# define R300_GB_SUPER_SIZE_16 (4<<6)
-# define R300_GB_SUPER_SIZE_32 (5<<6)
-# define R300_GB_SUPER_SIZE_64 (6<<6)
-# define R300_GB_SUPER_SIZE_128 (7<<6)
-# define R300_GB_SUPER_X_SHIFT 9 /* 3 bits wide */
-# define R300_GB_SUPER_Y_SHIFT 12 /* 3 bits wide */
-# define R300_GB_SUPER_TILE_A 0
-# define R300_GB_SUPER_TILE_B (1<<15)
-# define R300_GB_SUBPIXEL_1_12 0
-# define R300_GB_SUBPIXEL_1_16 (1<<16)
-
-#define R300_GB_FIFO_SIZE 0x4024
- /* each of the following is 2 bits wide */
-#define R300_GB_FIFO_SIZE_32 0
-#define R300_GB_FIFO_SIZE_64 1
-#define R300_GB_FIFO_SIZE_128 2
-#define R300_GB_FIFO_SIZE_256 3
-# define R300_SC_IFIFO_SIZE_SHIFT 0
-# define R300_SC_TZFIFO_SIZE_SHIFT 2
-# define R300_SC_BFIFO_SIZE_SHIFT 4
-
-# define R300_US_OFIFO_SIZE_SHIFT 12
-# define R300_US_WFIFO_SIZE_SHIFT 14
- /* the following use the same constants as above, but meaning is
- is times 2 (i.e. instead of 32 words it means 64 */
-# define R300_RS_TFIFO_SIZE_SHIFT 6
-# define R300_RS_CFIFO_SIZE_SHIFT 8
-# define R300_US_RAM_SIZE_SHIFT 10
- /* watermarks, 3 bits wide */
-# define R300_RS_HIGHWATER_COL_SHIFT 16
-# define R300_RS_HIGHWATER_TEX_SHIFT 19
-# define R300_OFIFO_HIGHWATER_SHIFT 22 /* two bits only */
-# define R300_CUBE_FIFO_HIGHWATER_COL_SHIFT 24
-
-#define R300_GB_SELECT 0x401C
-# define R300_GB_FOG_SELECT_C0A 0
-# define R300_GB_FOG_SELECT_C1A 1
-# define R300_GB_FOG_SELECT_C2A 2
-# define R300_GB_FOG_SELECT_C3A 3
-# define R300_GB_FOG_SELECT_1_1_W 4
-# define R300_GB_FOG_SELECT_Z 5
-# define R300_GB_DEPTH_SELECT_Z 0
-# define R300_GB_DEPTH_SELECT_1_1_W (1<<3)
-# define R300_GB_W_SELECT_1_W 0
-# define R300_GB_W_SELECT_1 (1<<4)
-
-#define R300_GB_AA_CONFIG 0x4020
-# define R300_AA_ENABLE 0x01
-# define R300_AA_SUBSAMPLES_2 0
-# define R300_AA_SUBSAMPLES_3 (1<<1)
-# define R300_AA_SUBSAMPLES_4 (2<<1)
-# define R300_AA_SUBSAMPLES_6 (3<<1)
-
-/* END */
-
-/* gap */
-/* The upper enable bits are guessed, based on fglrx reported limits. */
-#define R300_TX_ENABLE 0x4104
-# define R300_TX_ENABLE_0 (1 << 0)
-# define R300_TX_ENABLE_1 (1 << 1)
-# define R300_TX_ENABLE_2 (1 << 2)
-# define R300_TX_ENABLE_3 (1 << 3)
-# define R300_TX_ENABLE_4 (1 << 4)
-# define R300_TX_ENABLE_5 (1 << 5)
-# define R300_TX_ENABLE_6 (1 << 6)
-# define R300_TX_ENABLE_7 (1 << 7)
-# define R300_TX_ENABLE_8 (1 << 8)
-# define R300_TX_ENABLE_9 (1 << 9)
-# define R300_TX_ENABLE_10 (1 << 10)
-# define R300_TX_ENABLE_11 (1 << 11)
-# define R300_TX_ENABLE_12 (1 << 12)
-# define R300_TX_ENABLE_13 (1 << 13)
-# define R300_TX_ENABLE_14 (1 << 14)
-# define R300_TX_ENABLE_15 (1 << 15)
-
-/* The pointsize is given in multiples of 6. The pointsize can be
-// enormous: Clear() renders a single point that fills the entire
-// framebuffer. */
-#define R300_RE_POINTSIZE 0x421C
-# define R300_POINTSIZE_Y_SHIFT 0
-# define R300_POINTSIZE_Y_MASK (0xFFFF << 0) /* GUESS */
-# define R300_POINTSIZE_X_SHIFT 16
-# define R300_POINTSIZE_X_MASK (0xFFFF << 16) /* GUESS */
-# define R300_POINTSIZE_MAX (R300_POINTSIZE_Y_MASK / 6)
-
-/* The line width is given in multiples of 6.
- In default mode lines are classified as vertical lines.
- HO: horizontal
- VE: vertical or horizontal
- HO & VE: no classification
-*/
-#define R300_RE_LINE_CNT 0x4234
-# define R300_LINESIZE_SHIFT 0
-# define R300_LINESIZE_MASK (0xFFFF << 0) /* GUESS */
-# define R300_LINESIZE_MAX (R300_LINESIZE_MASK / 6)
-# define R300_LINE_CNT_HO (1 << 16)
-# define R300_LINE_CNT_VE (1 << 17)
-
-/* Some sort of scale or clamp value for texcoordless textures. */
-#define R300_RE_UNK4238 0x4238
-
-#define R300_RE_SHADE_MODEL 0x4278
-# define R300_RE_SHADE_MODEL_SMOOTH 0x3aaaa
-# define R300_RE_SHADE_MODEL_FLAT 0x39595
-
-/* Dangerous */
-#define R300_RE_POLYGON_MODE 0x4288
-# define R300_PM_ENABLED (1 << 0)
-# define R300_PM_FRONT_POINT (0 << 0)
-# define R300_PM_BACK_POINT (0 << 0)
-# define R300_PM_FRONT_LINE (1 << 4)
-# define R300_PM_FRONT_FILL (1 << 5)
-# define R300_PM_BACK_LINE (1 << 7)
-# define R300_PM_BACK_FILL (1 << 8)
-
-/* Not sure why there are duplicate of factor and constant values.
- My best guess so far is that there are seperate zbiases for test and write.
- Ordering might be wrong.
- Some of the tests indicate that fgl has a fallback implementation of zbias
- via pixel shaders. */
-#define R300_RE_ZBIAS_T_FACTOR 0x42A4
-#define R300_RE_ZBIAS_T_CONSTANT 0x42A8
-#define R300_RE_ZBIAS_W_FACTOR 0x42AC
-#define R300_RE_ZBIAS_W_CONSTANT 0x42B0
-
-/* This register needs to be set to (1<<1) for RV350 to correctly
- perform depth test (see --vb-triangles in r300_demo)
- Don't know about other chips. - Vladimir
- This is set to 3 when GL_POLYGON_OFFSET_FILL is on.
- My guess is that there are two bits for each zbias primitive (FILL, LINE, POINT).
- One to enable depth test and one for depth write.
- Yet this doesnt explain why depth writes work ...
- */
-#define R300_RE_OCCLUSION_CNTL 0x42B4
-# define R300_OCCLUSION_ON (1<<1)
-
-#define R300_RE_CULL_CNTL 0x42B8
-# define R300_CULL_FRONT (1 << 0)
-# define R300_CULL_BACK (1 << 1)
-# define R300_FRONT_FACE_CCW (0 << 2)
-# define R300_FRONT_FACE_CW (1 << 2)
-
-
-/* BEGIN: Rasterization / Interpolators - many guesses
-// 0_UNKNOWN_18 has always been set except for clear operations.
-// TC_CNT is the number of incoming texture coordinate sets (i.e. it depends
-// on the vertex program, *not* the fragment program) */
-#define R300_RS_CNTL_0 0x4300
-# define R300_RS_CNTL_TC_CNT_SHIFT 2
-# define R300_RS_CNTL_TC_CNT_MASK (7 << 2)
-# define R300_RS_CNTL_CI_CNT_SHIFT 7 /* number of color interpolators used */
-# define R300_RS_CNTL_0_UNKNOWN_18 (1 << 18)
-/* Guess: RS_CNTL_1 holds the index of the highest used RS_ROUTE_n register. */
-#define R300_RS_CNTL_1 0x4304
-
-/* gap */
-/* Only used for texture coordinates.
-// Use the source field to route texture coordinate input from the vertex program
-// to the desired interpolator. Note that the source field is relative to the
-// outputs the vertex program *actually* writes. If a vertex program only writes
-// texcoord[1], this will be source index 0.
-// Set INTERP_USED on all interpolators that produce data used by the
-// fragment program. INTERP_USED looks like a swizzling mask, but
-// I haven't seen it used that way.
-//
-// Note: The _UNKNOWN constants are always set in their respective register.
-// I don't know if this is necessary. */
-#define R300_RS_INTERP_0 0x4310
-#define R300_RS_INTERP_1 0x4314
-# define R300_RS_INTERP_1_UNKNOWN 0x40
-#define R300_RS_INTERP_2 0x4318
-# define R300_RS_INTERP_2_UNKNOWN 0x80
-#define R300_RS_INTERP_3 0x431C
-# define R300_RS_INTERP_3_UNKNOWN 0xC0
-#define R300_RS_INTERP_4 0x4320
-#define R300_RS_INTERP_5 0x4324
-#define R300_RS_INTERP_6 0x4328
-#define R300_RS_INTERP_7 0x432C
-# define R300_RS_INTERP_SRC_SHIFT 2
-# define R300_RS_INTERP_SRC_MASK (7 << 2)
-# define R300_RS_INTERP_USED 0x00D10000
-
-/* These DWORDs control how vertex data is routed into fragment program
-// registers, after interpolators. */
-#define R300_RS_ROUTE_0 0x4330
-#define R300_RS_ROUTE_1 0x4334
-#define R300_RS_ROUTE_2 0x4338
-#define R300_RS_ROUTE_3 0x433C /* GUESS */
-#define R300_RS_ROUTE_4 0x4340 /* GUESS */
-#define R300_RS_ROUTE_5 0x4344 /* GUESS */
-#define R300_RS_ROUTE_6 0x4348 /* GUESS */
-#define R300_RS_ROUTE_7 0x434C /* GUESS */
-# define R300_RS_ROUTE_SOURCE_INTERP_0 0
-# define R300_RS_ROUTE_SOURCE_INTERP_1 1
-# define R300_RS_ROUTE_SOURCE_INTERP_2 2
-# define R300_RS_ROUTE_SOURCE_INTERP_3 3
-# define R300_RS_ROUTE_SOURCE_INTERP_4 4
-# define R300_RS_ROUTE_SOURCE_INTERP_5 5 /* GUESS */
-# define R300_RS_ROUTE_SOURCE_INTERP_6 6 /* GUESS */
-# define R300_RS_ROUTE_SOURCE_INTERP_7 7 /* GUESS */
-# define R300_RS_ROUTE_ENABLE (1 << 3) /* GUESS */
-# define R300_RS_ROUTE_DEST_SHIFT 6
-# define R300_RS_ROUTE_DEST_MASK (31 << 6) /* GUESS */
-
-/* Special handling for color: When the fragment program uses color,
-// the ROUTE_0_COLOR bit is set and ROUTE_0_COLOR_DEST contains the
-// color register index. */
-# define R300_RS_ROUTE_0_COLOR (1 << 14)
-# define R300_RS_ROUTE_0_COLOR_DEST_SHIFT 17
-# define R300_RS_ROUTE_0_COLOR_DEST_MASK (31 << 17) /* GUESS */
-/* As above, but for secondary color */
-# define R300_RS_ROUTE_1_COLOR1 (1 << 14)
-# define R300_RS_ROUTE_1_COLOR1_DEST_SHIFT 17
-# define R300_RS_ROUTE_1_COLOR1_DEST_MASK (31 << 17)
-# define R300_RS_ROUTE_1_UNKNOWN11 (1 << 11)
-/* END */
-
-/* BEGIN: Scissors and cliprects
-// There are four clipping rectangles. Their corner coordinates are inclusive.
-// Every pixel is assigned a number from 0 and 15 by setting bits 0-3 depending
-// on whether the pixel is inside cliprects 0-3, respectively. For example,
-// if a pixel is inside cliprects 0 and 1, but outside 2 and 3, it is assigned
-// the number 3 (binary 0011).
-// Iff the bit corresponding to the pixel's number in RE_CLIPRECT_CNTL is set,
-// the pixel is rasterized.
-//
-// In addition to this, there is a scissors rectangle. Only pixels inside the
-// scissors rectangle are drawn. (coordinates are inclusive)
-//
-// For some reason, the top-left corner of the framebuffer is at (1440, 1440)
-// for the purpose of clipping and scissors. */
-#define R300_RE_CLIPRECT_TL_0 0x43B0
-#define R300_RE_CLIPRECT_BR_0 0x43B4
-#define R300_RE_CLIPRECT_TL_1 0x43B8
-#define R300_RE_CLIPRECT_BR_1 0x43BC
-#define R300_RE_CLIPRECT_TL_2 0x43C0
-#define R300_RE_CLIPRECT_BR_2 0x43C4
-#define R300_RE_CLIPRECT_TL_3 0x43C8
-#define R300_RE_CLIPRECT_BR_3 0x43CC
-# define R300_CLIPRECT_OFFSET 1440
-# define R300_CLIPRECT_MASK 0x1FFF
-# define R300_CLIPRECT_X_SHIFT 0
-# define R300_CLIPRECT_X_MASK (0x1FFF << 0)
-# define R300_CLIPRECT_Y_SHIFT 13
-# define R300_CLIPRECT_Y_MASK (0x1FFF << 13)
-#define R300_RE_CLIPRECT_CNTL 0x43D0
-# define R300_CLIP_OUT (1 << 0)
-# define R300_CLIP_0 (1 << 1)
-# define R300_CLIP_1 (1 << 2)
-# define R300_CLIP_10 (1 << 3)
-# define R300_CLIP_2 (1 << 4)
-# define R300_CLIP_20 (1 << 5)
-# define R300_CLIP_21 (1 << 6)
-# define R300_CLIP_210 (1 << 7)
-# define R300_CLIP_3 (1 << 8)
-# define R300_CLIP_30 (1 << 9)
-# define R300_CLIP_31 (1 << 10)
-# define R300_CLIP_310 (1 << 11)
-# define R300_CLIP_32 (1 << 12)
-# define R300_CLIP_320 (1 << 13)
-# define R300_CLIP_321 (1 << 14)
-# define R300_CLIP_3210 (1 << 15)
-
-/* gap */
-#define R300_RE_SCISSORS_TL 0x43E0
-#define R300_RE_SCISSORS_BR 0x43E4
-# define R300_SCISSORS_OFFSET 1440
-# define R300_SCISSORS_X_SHIFT 0
-# define R300_SCISSORS_X_MASK (0x1FFF << 0)
-# define R300_SCISSORS_Y_SHIFT 13
-# define R300_SCISSORS_Y_MASK (0x1FFF << 13)
-/* END */
-
-/* BEGIN: Texture specification
-// The texture specification dwords are grouped by meaning and not by texture unit.
-// This means that e.g. the offset for texture image unit N is found in register
-// TX_OFFSET_0 + (4*N) */
-#define R300_TX_FILTER_0 0x4400
-# define R300_TX_REPEAT 0
-# define R300_TX_MIRRORED 1
-# define R300_TX_CLAMP 4
-# define R300_TX_CLAMP_TO_EDGE 2
-# define R300_TX_CLAMP_TO_BORDER 6
-# define R300_TX_WRAP_S_SHIFT 0
-# define R300_TX_WRAP_S_MASK (7 << 0)
-# define R300_TX_WRAP_T_SHIFT 3
-# define R300_TX_WRAP_T_MASK (7 << 3)
-# define R300_TX_WRAP_Q_SHIFT 6
-# define R300_TX_WRAP_Q_MASK (7 << 6)
-# define R300_TX_MAG_FILTER_NEAREST (1 << 9)
-# define R300_TX_MAG_FILTER_LINEAR (2 << 9)
-# define R300_TX_MAG_FILTER_MASK (3 << 9)
-# define R300_TX_MIN_FILTER_NEAREST (1 << 11)
-# define R300_TX_MIN_FILTER_LINEAR (2 << 11)
-# define R300_TX_MIN_FILTER_NEAREST_MIP_NEAREST (5 << 11)
-# define R300_TX_MIN_FILTER_NEAREST_MIP_LINEAR (9 << 11)
-# define R300_TX_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 11)
-# define R300_TX_MIN_FILTER_LINEAR_MIP_LINEAR (10 << 11)
-
-/* NOTE: NEAREST doesnt seem to exist.
- Im not seting MAG_FILTER_MASK and (3 << 11) on for all
- anisotropy modes because that would void selected mag filter */
-# define R300_TX_MIN_FILTER_ANISO_NEAREST ((0 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/)
-# define R300_TX_MIN_FILTER_ANISO_LINEAR ((0 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/)
-# define R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST ((1 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/)
-# define R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR ((2 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/)
-# define R300_TX_MIN_FILTER_MASK ( (15 << 11) | (3 << 13) )
-# define R300_TX_MAX_ANISO_1_TO_1 (0 << 21)
-# define R300_TX_MAX_ANISO_2_TO_1 (2 << 21)
-# define R300_TX_MAX_ANISO_4_TO_1 (4 << 21)
-# define R300_TX_MAX_ANISO_8_TO_1 (6 << 21)
-# define R300_TX_MAX_ANISO_16_TO_1 (8 << 21)
-# define R300_TX_MAX_ANISO_MASK (14 << 21)
-
-#define R300_TX_UNK1_0 0x4440
-# define R300_LOD_BIAS_MASK 0x1fff
-
-#define R300_TX_SIZE_0 0x4480
-# define R300_TX_WIDTHMASK_SHIFT 0
-# define R300_TX_WIDTHMASK_MASK (2047 << 0)
-# define R300_TX_HEIGHTMASK_SHIFT 11
-# define R300_TX_HEIGHTMASK_MASK (2047 << 11)
-# define R300_TX_UNK23 (1 << 23)
-# define R300_TX_SIZE_SHIFT 26 /* largest of width, height */
-# define R300_TX_SIZE_MASK (15 << 26)
-#define R300_TX_FORMAT_0 0x44C0
- /* The interpretation of the format word by Wladimir van der Laan */
- /* The X, Y, Z and W refer to the layout of the components.
- They are given meanings as R, G, B and Alpha by the swizzle
- specification */
-# define R300_TX_FORMAT_X8 0x0
-# define R300_TX_FORMAT_X16 0x1
-# define R300_TX_FORMAT_Y4X4 0x2
-# define R300_TX_FORMAT_Y8X8 0x3
-# define R300_TX_FORMAT_Y16X16 0x4
-# define R300_TX_FORMAT_Z3Y3X2 0x5
-# define R300_TX_FORMAT_Z5Y6X5 0x6
-# define R300_TX_FORMAT_Z6Y5X5 0x7
-# define R300_TX_FORMAT_Z11Y11X10 0x8
-# define R300_TX_FORMAT_Z10Y11X11 0x9
-# define R300_TX_FORMAT_W4Z4Y4X4 0xA
-# define R300_TX_FORMAT_W1Z5Y5X5 0xB
-# define R300_TX_FORMAT_W8Z8Y8X8 0xC
-# define R300_TX_FORMAT_W2Z10Y10X10 0xD
-# define R300_TX_FORMAT_W16Z16Y16X16 0xE
-# define R300_TX_FORMAT_DXT1 0xF
-# define R300_TX_FORMAT_DXT3 0x10
-# define R300_TX_FORMAT_DXT5 0x11
-# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */
-# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */
-# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */
-# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */
- /* 0x16 - some 16 bit green format.. ?? */
-# define R300_TX_FORMAT_UNK25 (1 << 25) /* no swizzle */
-
- /* gap */
- /* Floating point formats */
- /* Note - hardware supports both 16 and 32 bit floating point */
-# define R300_TX_FORMAT_FL_I16 0x18
-# define R300_TX_FORMAT_FL_I16A16 0x19
-# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A
-# define R300_TX_FORMAT_FL_I32 0x1B
-# define R300_TX_FORMAT_FL_I32A32 0x1C
-# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D
- /* alpha modes, convenience mostly */
- /* if you have alpha, pick constant appropriate to the
- number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */
-# define R300_TX_FORMAT_ALPHA_1CH 0x000
-# define R300_TX_FORMAT_ALPHA_2CH 0x200
-# define R300_TX_FORMAT_ALPHA_4CH 0x600
-# define R300_TX_FORMAT_ALPHA_NONE 0xA00
- /* Swizzling */
- /* constants */
-# define R300_TX_FORMAT_X 0
-# define R300_TX_FORMAT_Y 1
-# define R300_TX_FORMAT_Z 2
-# define R300_TX_FORMAT_W 3
-# define R300_TX_FORMAT_ZERO 4
-# define R300_TX_FORMAT_ONE 5
-# define R300_TX_FORMAT_CUT_Z 6 /* 2.0*Z, everything above 1.0 is set to 0.0 */
-# define R300_TX_FORMAT_CUT_W 7 /* 2.0*W, everything above 1.0 is set to 0.0 */
-
-# define R300_TX_FORMAT_B_SHIFT 18
-# define R300_TX_FORMAT_G_SHIFT 15
-# define R300_TX_FORMAT_R_SHIFT 12
-# define R300_TX_FORMAT_A_SHIFT 9
- /* Convenience macro to take care of layout and swizzling */
-# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) (\
- ((R300_TX_FORMAT_##B)<<R300_TX_FORMAT_B_SHIFT) \
- | ((R300_TX_FORMAT_##G)<<R300_TX_FORMAT_G_SHIFT) \
- | ((R300_TX_FORMAT_##R)<<R300_TX_FORMAT_R_SHIFT) \
- | ((R300_TX_FORMAT_##A)<<R300_TX_FORMAT_A_SHIFT) \
- | (R300_TX_FORMAT_##FMT) \
- )
- /* These can be ORed with result of R300_EASY_TX_FORMAT() */
- /* We don't really know what they do. Take values from a constant color ? */
-# define R300_TX_FORMAT_CONST_X (1<<5)
-# define R300_TX_FORMAT_CONST_Y (2<<5)
-# define R300_TX_FORMAT_CONST_Z (4<<5)
-# define R300_TX_FORMAT_CONST_W (8<<5)
-
-# define R300_TX_FORMAT_YUV_MODE 0x00800000
-
-#define R300_TX_OFFSET_0 0x4540
-/* BEGIN: Guess from R200 */
-# define R300_TXO_ENDIAN_NO_SWAP (0 << 0)
-# define R300_TXO_ENDIAN_BYTE_SWAP (1 << 0)
-# define R300_TXO_ENDIAN_WORD_SWAP (2 << 0)
-# define R300_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
-# define R300_TXO_OFFSET_MASK 0xffffffe0
-# define R300_TXO_OFFSET_SHIFT 5
-/* END */
-#define R300_TX_UNK4_0 0x4580
-#define R300_TX_BORDER_COLOR_0 0x45C0 //ff00ff00 == { 0, 1.0, 0, 1.0 }
-
-/* END */
-
-/* BEGIN: Fragment program instruction set
-// Fragment programs are written directly into register space.
-// There are separate instruction streams for texture instructions and ALU
-// instructions.
-// In order to synchronize these streams, the program is divided into up
-// to 4 nodes. Each node begins with a number of TEX operations, followed
-// by a number of ALU operations.
-// The first node can have zero TEX ops, all subsequent nodes must have at least
-// one TEX ops.
-// All nodes must have at least one ALU op.
-//
-// The index of the last node is stored in PFS_CNTL_0: A value of 0 means
-// 1 node, a value of 3 means 4 nodes.
-// The total amount of instructions is defined in PFS_CNTL_2. The offsets are
-// offsets into the respective instruction streams, while *_END points to the
-// last instruction relative to this offset. */
-#define R300_PFS_CNTL_0 0x4600
-# define R300_PFS_CNTL_LAST_NODES_SHIFT 0
-# define R300_PFS_CNTL_LAST_NODES_MASK (3 << 0)
-# define R300_PFS_CNTL_FIRST_NODE_HAS_TEX (1 << 3)
-#define R300_PFS_CNTL_1 0x4604
-/* There is an unshifted value here which has so far always been equal to the
-// index of the highest used temporary register. */
-#define R300_PFS_CNTL_2 0x4608
-# define R300_PFS_CNTL_ALU_OFFSET_SHIFT 0
-# define R300_PFS_CNTL_ALU_OFFSET_MASK (63 << 0)
-# define R300_PFS_CNTL_ALU_END_SHIFT 6
-# define R300_PFS_CNTL_ALU_END_MASK (63 << 0)
-# define R300_PFS_CNTL_TEX_OFFSET_SHIFT 12
-# define R300_PFS_CNTL_TEX_OFFSET_MASK (31 << 12) /* GUESS */
-# define R300_PFS_CNTL_TEX_END_SHIFT 18
-# define R300_PFS_CNTL_TEX_END_MASK (31 << 18) /* GUESS */
-
-/* gap */
-/* Nodes are stored backwards. The last active node is always stored in
-// PFS_NODE_3.
-// Example: In a 2-node program, NODE_0 and NODE_1 are set to 0. The
-// first node is stored in NODE_2, the second node is stored in NODE_3.
-//
-// Offsets are relative to the master offset from PFS_CNTL_2.
-// LAST_NODE is set for the last node, and only for the last node. */
-#define R300_PFS_NODE_0 0x4610
-#define R300_PFS_NODE_1 0x4614
-#define R300_PFS_NODE_2 0x4618
-#define R300_PFS_NODE_3 0x461C
-# define R300_PFS_NODE_ALU_OFFSET_SHIFT 0
-# define R300_PFS_NODE_ALU_OFFSET_MASK (63 << 0)
-# define R300_PFS_NODE_ALU_END_SHIFT 6
-# define R300_PFS_NODE_ALU_END_MASK (63 << 6)
-# define R300_PFS_NODE_TEX_OFFSET_SHIFT 12
-# define R300_PFS_NODE_TEX_OFFSET_MASK (31 << 12)
-# define R300_PFS_NODE_TEX_END_SHIFT 17
-# define R300_PFS_NODE_TEX_END_MASK (31 << 17)
-# define R300_PFS_NODE_LAST_NODE (1 << 22)
-
-/* TEX
-// As far as I can tell, texture instructions cannot write into output
-// registers directly. A subsequent ALU instruction is always necessary,
-// even if it's just MAD o0, r0, 1, 0 */
-#define R300_PFS_TEXI_0 0x4620
-# define R300_FPITX_SRC_SHIFT 0
-# define R300_FPITX_SRC_MASK (31 << 0)
-# define R300_FPITX_SRC_CONST (1 << 5) /* GUESS */
-# define R300_FPITX_DST_SHIFT 6
-# define R300_FPITX_DST_MASK (31 << 6)
-# define R300_FPITX_IMAGE_SHIFT 11
-# define R300_FPITX_IMAGE_MASK (15 << 11) /* GUESS based on layout and native limits */
-/* Unsure if these are opcodes, or some kind of bitfield, but this is how
- * they were set when I checked
- */
-# define R300_FPITX_OPCODE_SHIFT 15
-# define R300_FPITX_OP_TEX 1
-# define R300_FPITX_OP_TXP 3
-# define R300_FPITX_OP_TXB 4
-
-/* ALU
-// The ALU instructions register blocks are enumerated according to the order
-// in which fglrx. I assume there is space for 64 instructions, since
-// each block has space for a maximum of 64 DWORDs, and this matches reported
-// native limits.
-//
-// The basic functional block seems to be one MAD for each color and alpha,
-// and an adder that adds all components after the MUL.
-// - ADD, MUL, MAD etc.: use MAD with appropriate neutral operands
-// - DP4: Use OUTC_DP4, OUTA_DP4
-// - DP3: Use OUTC_DP3, OUTA_DP4, appropriate alpha operands
-// - DPH: Use OUTC_DP4, OUTA_DP4, appropriate alpha operands
-// - CMP: If ARG2 < 0, return ARG1, else return ARG0
-// - FLR: use FRC+MAD
-// - XPD: use MAD+MAD
-// - SGE, SLT: use MAD+CMP
-// - RSQ: use ABS modifier for argument
-// - Use OUTC_REPL_ALPHA to write results of an alpha-only operation (e.g. RCP)
-// into color register
-// - apparently, there's no quick DST operation
-// - fglrx set FPI2_UNKNOWN_31 on a "MAD fragment.color, tmp0, tmp1, tmp2"
-// - fglrx set FPI2_UNKNOWN_31 on a "MAX r2, r1, c0"
-// - fglrx once set FPI0_UNKNOWN_31 on a "FRC r1, r1"
-//
-// Operand selection
-// First stage selects three sources from the available registers and
-// constant parameters. This is defined in INSTR1 (color) and INSTR3 (alpha).
-// fglrx sorts the three source fields: Registers before constants,
-// lower indices before higher indices; I do not know whether this is necessary.
-// fglrx fills unused sources with "read constant 0"
-// According to specs, you cannot select more than two different constants.
-//
-// Second stage selects the operands from the sources. This is defined in
-// INSTR0 (color) and INSTR2 (alpha). You can also select the special constants
-// zero and one.
-// Swizzling and negation happens in this stage, as well.
-//
-// Important: Color and alpha seem to be mostly separate, i.e. their sources
-// selection appears to be fully independent (the register storage is probably
-// physically split into a color and an alpha section).
-// However (because of the apparent physical split), there is some interaction
-// WRT swizzling. If, for example, you want to load an R component into an
-// Alpha operand, this R component is taken from a *color* source, not from
-// an alpha source. The corresponding register doesn't even have to appear in
-// the alpha sources list. (I hope this alll makes sense to you)
-//
-// Destination selection
-// The destination register index is in FPI1 (color) and FPI3 (alpha) together
-// with enable bits.
-// There are separate enable bits for writing into temporary registers
-// (DSTC_REG_* /DSTA_REG) and and program output registers (DSTC_OUTPUT_* /DSTA_OUTPUT).
-// You can write to both at once, or not write at all (the same index
-// must be used for both).
-//
-// Note: There is a special form for LRP
-// - Argument order is the same as in ARB_fragment_program.
-// - Operation is MAD
-// - ARG1 is set to ARGC_SRC1C_LRP/ARGC_SRC1A_LRP
-// - Set FPI0/FPI2_SPECIAL_LRP
-// Arbitrary LRP (including support for swizzling) requires vanilla MAD+MAD */
-#define R300_PFS_INSTR1_0 0x46C0
-# define R300_FPI1_SRC0C_SHIFT 0
-# define R300_FPI1_SRC0C_MASK (31 << 0)
-# define R300_FPI1_SRC0C_CONST (1 << 5)
-# define R300_FPI1_SRC1C_SHIFT 6
-# define R300_FPI1_SRC1C_MASK (31 << 6)
-# define R300_FPI1_SRC1C_CONST (1 << 11)
-# define R300_FPI1_SRC2C_SHIFT 12
-# define R300_FPI1_SRC2C_MASK (31 << 12)
-# define R300_FPI1_SRC2C_CONST (1 << 17)
-# define R300_FPI1_DSTC_SHIFT 18
-# define R300_FPI1_DSTC_MASK (31 << 18)
-# define R300_FPI1_DSTC_REG_X (1 << 23)
-# define R300_FPI1_DSTC_REG_Y (1 << 24)
-# define R300_FPI1_DSTC_REG_Z (1 << 25)
-# define R300_FPI1_DSTC_OUTPUT_X (1 << 26)
-# define R300_FPI1_DSTC_OUTPUT_Y (1 << 27)
-# define R300_FPI1_DSTC_OUTPUT_Z (1 << 28)
-
-#define R300_PFS_INSTR3_0 0x47C0
-# define R300_FPI3_SRC0A_SHIFT 0
-# define R300_FPI3_SRC0A_MASK (31 << 0)
-# define R300_FPI3_SRC0A_CONST (1 << 5)
-# define R300_FPI3_SRC1A_SHIFT 6
-# define R300_FPI3_SRC1A_MASK (31 << 6)
-# define R300_FPI3_SRC1A_CONST (1 << 11)
-# define R300_FPI3_SRC2A_SHIFT 12
-# define R300_FPI3_SRC2A_MASK (31 << 12)
-# define R300_FPI3_SRC2A_CONST (1 << 17)
-# define R300_FPI3_DSTA_SHIFT 18
-# define R300_FPI3_DSTA_MASK (31 << 18)
-# define R300_FPI3_DSTA_REG (1 << 23)
-# define R300_FPI3_DSTA_OUTPUT (1 << 24)
-
-#define R300_PFS_INSTR0_0 0x48C0
-# define R300_FPI0_ARGC_SRC0C_XYZ 0
-# define R300_FPI0_ARGC_SRC0C_XXX 1
-# define R300_FPI0_ARGC_SRC0C_YYY 2
-# define R300_FPI0_ARGC_SRC0C_ZZZ 3
-# define R300_FPI0_ARGC_SRC1C_XYZ 4
-# define R300_FPI0_ARGC_SRC1C_XXX 5
-# define R300_FPI0_ARGC_SRC1C_YYY 6
-# define R300_FPI0_ARGC_SRC1C_ZZZ 7
-# define R300_FPI0_ARGC_SRC2C_XYZ 8
-# define R300_FPI0_ARGC_SRC2C_XXX 9
-# define R300_FPI0_ARGC_SRC2C_YYY 10
-# define R300_FPI0_ARGC_SRC2C_ZZZ 11
-# define R300_FPI0_ARGC_SRC0A 12
-# define R300_FPI0_ARGC_SRC1A 13
-# define R300_FPI0_ARGC_SRC2A 14
-# define R300_FPI0_ARGC_SRC1C_LRP 15
-# define R300_FPI0_ARGC_ZERO 20
-# define R300_FPI0_ARGC_ONE 21
-# define R300_FPI0_ARGC_HALF 22 /* GUESS */
-# define R300_FPI0_ARGC_SRC0C_YZX 23
-# define R300_FPI0_ARGC_SRC1C_YZX 24
-# define R300_FPI0_ARGC_SRC2C_YZX 25
-# define R300_FPI0_ARGC_SRC0C_ZXY 26
-# define R300_FPI0_ARGC_SRC1C_ZXY 27
-# define R300_FPI0_ARGC_SRC2C_ZXY 28
-# define R300_FPI0_ARGC_SRC0CA_WZY 29
-# define R300_FPI0_ARGC_SRC1CA_WZY 30
-# define R300_FPI0_ARGC_SRC2CA_WZY 31
-
-# define R300_FPI0_ARG0C_SHIFT 0
-# define R300_FPI0_ARG0C_MASK (31 << 0)
-# define R300_FPI0_ARG0C_NEG (1 << 5)
-# define R300_FPI0_ARG0C_ABS (1 << 6)
-# define R300_FPI0_ARG1C_SHIFT 7
-# define R300_FPI0_ARG1C_MASK (31 << 7)
-# define R300_FPI0_ARG1C_NEG (1 << 12)
-# define R300_FPI0_ARG1C_ABS (1 << 13)
-# define R300_FPI0_ARG2C_SHIFT 14
-# define R300_FPI0_ARG2C_MASK (31 << 14)
-# define R300_FPI0_ARG2C_NEG (1 << 19)
-# define R300_FPI0_ARG2C_ABS (1 << 20)
-# define R300_FPI0_SPECIAL_LRP (1 << 21)
-# define R300_FPI0_OUTC_MAD (0 << 23)
-# define R300_FPI0_OUTC_DP3 (1 << 23)
-# define R300_FPI0_OUTC_DP4 (2 << 23)
-# define R300_FPI0_OUTC_MIN (4 << 23)
-# define R300_FPI0_OUTC_MAX (5 << 23)
-# define R300_FPI0_OUTC_CMP (8 << 23)
-# define R300_FPI0_OUTC_FRC (9 << 23)
-# define R300_FPI0_OUTC_REPL_ALPHA (10 << 23)
-# define R300_FPI0_OUTC_SAT (1 << 30)
-# define R300_FPI0_UNKNOWN_31 (1 << 31)
-
-#define R300_PFS_INSTR2_0 0x49C0
-# define R300_FPI2_ARGA_SRC0C_X 0
-# define R300_FPI2_ARGA_SRC0C_Y 1
-# define R300_FPI2_ARGA_SRC0C_Z 2
-# define R300_FPI2_ARGA_SRC1C_X 3
-# define R300_FPI2_ARGA_SRC1C_Y 4
-# define R300_FPI2_ARGA_SRC1C_Z 5
-# define R300_FPI2_ARGA_SRC2C_X 6
-# define R300_FPI2_ARGA_SRC2C_Y 7
-# define R300_FPI2_ARGA_SRC2C_Z 8
-# define R300_FPI2_ARGA_SRC0A 9
-# define R300_FPI2_ARGA_SRC1A 10
-# define R300_FPI2_ARGA_SRC2A 11
-# define R300_FPI2_ARGA_SRC1A_LRP 15
-# define R300_FPI2_ARGA_ZERO 16
-# define R300_FPI2_ARGA_ONE 17
-# define R300_FPI2_ARGA_HALF 18 /* GUESS */
-
-# define R300_FPI2_ARG0A_SHIFT 0
-# define R300_FPI2_ARG0A_MASK (31 << 0)
-# define R300_FPI2_ARG0A_NEG (1 << 5)
-# define R300_FPI2_ARG0A_ABS (1 << 6) /* GUESS */
-# define R300_FPI2_ARG1A_SHIFT 7
-# define R300_FPI2_ARG1A_MASK (31 << 7)
-# define R300_FPI2_ARG1A_NEG (1 << 12)
-# define R300_FPI2_ARG1A_ABS (1 << 13) /* GUESS */
-# define R300_FPI2_ARG2A_SHIFT 14
-# define R300_FPI2_ARG2A_MASK (31 << 14)
-# define R300_FPI2_ARG2A_NEG (1 << 19)
-# define R300_FPI2_ARG2A_ABS (1 << 20) /* GUESS */
-# define R300_FPI2_SPECIAL_LRP (1 << 21)
-# define R300_FPI2_OUTA_MAD (0 << 23)
-# define R300_FPI2_OUTA_DP4 (1 << 23)
-# define R300_FPI2_OUTA_MIN (2 << 23)
-# define R300_FPI2_OUTA_MAX (3 << 23)
-# define R300_FPI2_OUTA_CMP (6 << 23)
-# define R300_FPI2_OUTA_FRC (7 << 23)
-# define R300_FPI2_OUTA_EX2 (8 << 23)
-# define R300_FPI2_OUTA_LG2 (9 << 23)
-# define R300_FPI2_OUTA_RCP (10 << 23)
-# define R300_FPI2_OUTA_RSQ (11 << 23)
-# define R300_FPI2_OUTA_SAT (1 << 30)
-# define R300_FPI2_UNKNOWN_31 (1 << 31)
-/* END */
-
-/* gap */
-#define R300_PP_ALPHA_TEST 0x4BD4
-# define R300_REF_ALPHA_MASK 0x000000ff
-# define R300_ALPHA_TEST_FAIL (0 << 8)
-# define R300_ALPHA_TEST_LESS (1 << 8)
-# define R300_ALPHA_TEST_LEQUAL (3 << 8)
-# define R300_ALPHA_TEST_EQUAL (2 << 8)
-# define R300_ALPHA_TEST_GEQUAL (6 << 8)
-# define R300_ALPHA_TEST_GREATER (4 << 8)
-# define R300_ALPHA_TEST_NEQUAL (5 << 8)
-# define R300_ALPHA_TEST_PASS (7 << 8)
-# define R300_ALPHA_TEST_OP_MASK (7 << 8)
-# define R300_ALPHA_TEST_ENABLE (1 << 11)
-
-/* gap */
-/* Fragment program parameters in 7.16 floating point */
-#define R300_PFS_PARAM_0_X 0x4C00
-#define R300_PFS_PARAM_0_Y 0x4C04
-#define R300_PFS_PARAM_0_Z 0x4C08
-#define R300_PFS_PARAM_0_W 0x4C0C
-/* GUESS: PARAM_31 is last, based on native limits reported by fglrx */
-#define R300_PFS_PARAM_31_X 0x4DF0
-#define R300_PFS_PARAM_31_Y 0x4DF4
-#define R300_PFS_PARAM_31_Z 0x4DF8
-#define R300_PFS_PARAM_31_W 0x4DFC
-
-/* Notes:
-// - AFAIK fglrx always sets BLEND_UNKNOWN when blending is used in the application
-// - AFAIK fglrx always sets BLEND_NO_SEPARATE when CBLEND and ABLEND are set to the same
-// function (both registers are always set up completely in any case)
-// - Most blend flags are simply copied from R200 and not tested yet */
-#define R300_RB3D_CBLEND 0x4E04
-#define R300_RB3D_ABLEND 0x4E08
- /* the following only appear in CBLEND */
-# define R300_BLEND_ENABLE (1 << 0)
-# define R300_BLEND_UNKNOWN (3 << 1)
-# define R300_BLEND_NO_SEPARATE (1 << 3)
- /* the following are shared between CBLEND and ABLEND */
-# define R300_FCN_MASK (3 << 12)
-# define R300_COMB_FCN_ADD_CLAMP (0 << 12)
-# define R300_COMB_FCN_ADD_NOCLAMP (1 << 12)
-# define R300_COMB_FCN_SUB_CLAMP (2 << 12)
-# define R300_COMB_FCN_SUB_NOCLAMP (3 << 12)
-# define R300_SRC_BLEND_GL_ZERO (32 << 16)
-# define R300_SRC_BLEND_GL_ONE (33 << 16)
-# define R300_SRC_BLEND_GL_SRC_COLOR (34 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)
-# define R300_SRC_BLEND_GL_DST_COLOR (36 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)
-# define R300_SRC_BLEND_GL_SRC_ALPHA (38 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)
-# define R300_SRC_BLEND_GL_DST_ALPHA (40 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)
-# define R300_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16)
-# define R300_SRC_BLEND_MASK (63 << 16)
-# define R300_DST_BLEND_GL_ZERO (32 << 24)
-# define R300_DST_BLEND_GL_ONE (33 << 24)
-# define R300_DST_BLEND_GL_SRC_COLOR (34 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)
-# define R300_DST_BLEND_GL_DST_COLOR (36 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)
-# define R300_DST_BLEND_GL_SRC_ALPHA (38 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)
-# define R300_DST_BLEND_GL_DST_ALPHA (40 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)
-# define R300_DST_BLEND_MASK (63 << 24)
-#define R300_RB3D_COLORMASK 0x4E0C
-# define R300_COLORMASK0_B (1<<0)
-# define R300_COLORMASK0_G (1<<1)
-# define R300_COLORMASK0_R (1<<2)
-# define R300_COLORMASK0_A (1<<3)
-
-/* gap */
-#define R300_RB3D_COLOROFFSET0 0x4E28
-# define R300_COLOROFFSET_MASK 0xFFFFFFF0 /* GUESS */
-#define R300_RB3D_COLOROFFSET1 0x4E2C /* GUESS */
-#define R300_RB3D_COLOROFFSET2 0x4E30 /* GUESS */
-#define R300_RB3D_COLOROFFSET3 0x4E34 /* GUESS */
-/* gap */
-/* Bit 16: Larger tiles
-// Bit 17: 4x2 tiles
-// Bit 18: Extremely weird tile like, but some pixels duplicated? */
-#define R300_RB3D_COLORPITCH0 0x4E38
-# define R300_COLORPITCH_MASK 0x00001FF8 /* GUESS */
-# define R300_COLOR_TILE_ENABLE (1 << 16) /* GUESS */
-# define R300_COLOR_MICROTILE_ENABLE (1 << 17) /* GUESS */
-# define R300_COLOR_ENDIAN_NO_SWAP (0 << 18) /* GUESS */
-# define R300_COLOR_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */
-# define R300_COLOR_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS */
-# define R300_COLOR_FORMAT_RGB565 (2 << 22)
-# define R300_COLOR_FORMAT_ARGB8888 (3 << 22)
-#define R300_RB3D_COLORPITCH1 0x4E3C /* GUESS */
-#define R300_RB3D_COLORPITCH2 0x4E40 /* GUESS */
-#define R300_RB3D_COLORPITCH3 0x4E44 /* GUESS */
-
-/* gap */
-/* Guess by Vladimir.
-// Set to 0A before 3D operations, set to 02 afterwards. */
-#define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C
-# define R300_RB3D_DSTCACHE_02 0x00000002
-# define R300_RB3D_DSTCACHE_0A 0x0000000A
-
-/* gap */
-/* There seems to be no "write only" setting, so use Z-test = ALWAYS for this. */
-/* Bit (1<<8) is the "test" bit. so plain write is 6 - vd */
-#define R300_RB3D_ZSTENCIL_CNTL_0 0x4F00
-# define R300_RB3D_Z_DISABLED_1 0x00000010 /* GUESS */
-# define R300_RB3D_Z_DISABLED_2 0x00000014 /* GUESS */
-# define R300_RB3D_Z_TEST 0x00000012
-# define R300_RB3D_Z_TEST_AND_WRITE 0x00000016
-# define R300_RB3D_Z_WRITE_ONLY 0x00000006
-
-# define R300_RB3D_Z_TEST 0x00000012
-# define R300_RB3D_Z_TEST_AND_WRITE 0x00000016
-# define R300_RB3D_Z_WRITE_ONLY 0x00000006
-# define R300_RB3D_STENCIL_ENABLE 0x00000001
-
-#define R300_RB3D_ZSTENCIL_CNTL_1 0x4F04
- /* functions */
-# define R300_ZS_NEVER 0
-# define R300_ZS_LESS 1
-# define R300_ZS_LEQUAL 2
-# define R300_ZS_EQUAL 3
-# define R300_ZS_GEQUAL 4
-# define R300_ZS_GREATER 5
-# define R300_ZS_NOTEQUAL 6
-# define R300_ZS_ALWAYS 7
-# define R300_ZS_MASK 7
- /* operations */
-# define R300_ZS_KEEP 0
-# define R300_ZS_ZERO 1
-# define R300_ZS_REPLACE 2
-# define R300_ZS_INCR 3
-# define R300_ZS_DECR 4
-# define R300_ZS_INVERT 5
-# define R300_ZS_INCR_WRAP 6
-# define R300_ZS_DECR_WRAP 7
-
- /* front and back refer to operations done for front
- and back faces, i.e. separate stencil function support */
-# define R300_RB3D_ZS1_DEPTH_FUNC_SHIFT 0
-# define R300_RB3D_ZS1_FRONT_FUNC_SHIFT 3
-# define R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT 6
-# define R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT 9
-# define R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT 12
-# define R300_RB3D_ZS1_BACK_FUNC_SHIFT 15
-# define R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT 18
-# define R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT 21
-# define R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT 24
-
-
-
-#define R300_RB3D_ZSTENCIL_CNTL_2 0x4F08
-# define R300_RB3D_ZS2_STENCIL_REF_SHIFT 0
-# define R300_RB3D_ZS2_STENCIL_MASK 0xFF
-# define R300_RB3D_ZS2_STENCIL_MASK_SHIFT 8
-# define R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT 16
-
-/* gap */
-
-#define R300_RB3D_ZSTENCIL_FORMAT 0x4F10
-# define R300_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
-# define R300_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
-
-/* gap */
-#define R300_RB3D_DEPTHOFFSET 0x4F20
-#define R300_RB3D_DEPTHPITCH 0x4F24
-# define R300_DEPTHPITCH_MASK 0x00001FF8 /* GUESS */
-# define R300_DEPTH_TILE_ENABLE (1 << 16) /* GUESS */
-# define R300_DEPTH_MICROTILE_ENABLE (1 << 17) /* GUESS */
-# define R300_DEPTH_ENDIAN_NO_SWAP (0 << 18) /* GUESS */
-# define R300_DEPTH_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */
-# define R300_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS */
-
-/* BEGIN: Vertex program instruction set
-// Every instruction is four dwords long:
-// DWORD 0: output and opcode
-// DWORD 1: first argument
-// DWORD 2: second argument
-// DWORD 3: third argument
-//
-// Notes:
-// - ABS r, a is implemented as MAX r, a, -a
-// - MOV is implemented as ADD to zero
-// - XPD is implemented as MUL + MAD
-// - FLR is implemented as FRC + ADD
-// - apparently, fglrx tries to schedule instructions so that there is at least
-// one instruction between the write to a temporary and the first read
-// from said temporary; however, violations of this scheduling are allowed
-// - register indices seem to be unrelated with OpenGL aliasing to conventional state
-// - only one attribute and one parameter can be loaded at a time; however, the
-// same attribute/parameter can be used for more than one argument
-// - the second software argument for POW is the third hardware argument (no idea why)
-// - MAD with only temporaries as input seems to use VPI_OUT_SELECT_MAD_2
-//
-// There is some magic surrounding LIT:
-// The single argument is replicated across all three inputs, but swizzled:
-// First argument: xyzy
-// Second argument: xyzx
-// Third argument: xyzw
-// Whenever the result is used later in the fragment program, fglrx forces x and w
-// to be 1.0 in the input selection; I don't know whether this is strictly necessary */
-#define R300_VPI_OUT_OP_DOT (1 << 0)
-#define R300_VPI_OUT_OP_MUL (2 << 0)
-#define R300_VPI_OUT_OP_ADD (3 << 0)
-#define R300_VPI_OUT_OP_MAD (4 << 0)
-#define R300_VPI_OUT_OP_DST (5 << 0)
-#define R300_VPI_OUT_OP_FRC (6 << 0)
-#define R300_VPI_OUT_OP_MAX (7 << 0)
-#define R300_VPI_OUT_OP_MIN (8 << 0)
-#define R300_VPI_OUT_OP_SGE (9 << 0)
-#define R300_VPI_OUT_OP_SLT (10 << 0)
-#define R300_VPI_OUT_OP_UNK12 (12 << 0) /* Used in GL_POINT_DISTANCE_ATTENUATION_ARB, vector(scalar, vector) */
-#define R300_VPI_OUT_OP_EXP (65 << 0)
-#define R300_VPI_OUT_OP_LOG (66 << 0)
-#define R300_VPI_OUT_OP_UNK67 (67 << 0) /* Used in fog computations, scalar(scalar) */
-#define R300_VPI_OUT_OP_LIT (68 << 0)
-#define R300_VPI_OUT_OP_POW (69 << 0)
-#define R300_VPI_OUT_OP_RCP (70 << 0)
-#define R300_VPI_OUT_OP_RSQ (72 << 0)
-#define R300_VPI_OUT_OP_UNK73 (73 << 0) /* Used in GL_POINT_DISTANCE_ATTENUATION_ARB, scalar(scalar) */
-#define R300_VPI_OUT_OP_EX2 (75 << 0)
-#define R300_VPI_OUT_OP_LG2 (76 << 0)
-#define R300_VPI_OUT_OP_MAD_2 (128 << 0)
-#define R300_VPI_OUT_OP_UNK129 (129 << 0) /* all temps, vector(scalar, vector, vector) */
-
-#define R300_VPI_OUT_REG_CLASS_TEMPORARY (0 << 8)
-#define R300_VPI_OUT_REG_CLASS_RESULT (2 << 8)
-#define R300_VPI_OUT_REG_CLASS_MASK (31 << 8)
-
-#define R300_VPI_OUT_REG_INDEX_SHIFT 13
-#define R300_VPI_OUT_REG_INDEX_MASK (31 << 13) /* GUESS based on fglrx native limits */
-
-#define R300_VPI_OUT_WRITE_X (1 << 20)
-#define R300_VPI_OUT_WRITE_Y (1 << 21)
-#define R300_VPI_OUT_WRITE_Z (1 << 22)
-#define R300_VPI_OUT_WRITE_W (1 << 23)
-
-#define R300_VPI_IN_REG_CLASS_TEMPORARY (0 << 0)
-#define R300_VPI_IN_REG_CLASS_ATTRIBUTE (1 << 0)
-#define R300_VPI_IN_REG_CLASS_PARAMETER (2 << 0)
-#define R300_VPI_IN_REG_CLASS_NONE (9 << 0)
-#define R300_VPI_IN_REG_CLASS_MASK (31 << 0) /* GUESS */
-
-#define R300_VPI_IN_REG_INDEX_SHIFT 5
-#define R300_VPI_IN_REG_INDEX_MASK (255 << 5) /* GUESS based on fglrx native limits */
-
-/* The R300 can select components from the input register arbitrarily.
-// Use the following constants, shifted by the component shift you
-// want to select */
-#define R300_VPI_IN_SELECT_X 0
-#define R300_VPI_IN_SELECT_Y 1
-#define R300_VPI_IN_SELECT_Z 2
-#define R300_VPI_IN_SELECT_W 3
-#define R300_VPI_IN_SELECT_ZERO 4
-#define R300_VPI_IN_SELECT_ONE 5
-#define R300_VPI_IN_SELECT_MASK 7
-
-#define R300_VPI_IN_X_SHIFT 13
-#define R300_VPI_IN_Y_SHIFT 16
-#define R300_VPI_IN_Z_SHIFT 19
-#define R300_VPI_IN_W_SHIFT 22
-
-#define R300_VPI_IN_NEG_X (1 << 25)
-#define R300_VPI_IN_NEG_Y (1 << 26)
-#define R300_VPI_IN_NEG_Z (1 << 27)
-#define R300_VPI_IN_NEG_W (1 << 28)
-/* END */
-
-//BEGIN: Packet 3 commands
-
-// A primitive emission dword.
-#define R300_PRIM_TYPE_NONE (0 << 0)
-#define R300_PRIM_TYPE_POINT (1 << 0)
-#define R300_PRIM_TYPE_LINE (2 << 0)
-#define R300_PRIM_TYPE_LINE_STRIP (3 << 0)
-#define R300_PRIM_TYPE_TRI_LIST (4 << 0)
-#define R300_PRIM_TYPE_TRI_FAN (5 << 0)
-#define R300_PRIM_TYPE_TRI_STRIP (6 << 0)
-#define R300_PRIM_TYPE_TRI_TYPE2 (7 << 0)
-#define R300_PRIM_TYPE_RECT_LIST (8 << 0)
-#define R300_PRIM_TYPE_3VRT_POINT_LIST (9 << 0)
-#define R300_PRIM_TYPE_3VRT_LINE_LIST (10 << 0)
-#define R300_PRIM_TYPE_POINT_SPRITES (11 << 0) // GUESS (based on r200)
-#define R300_PRIM_TYPE_LINE_LOOP (12 << 0)
-#define R300_PRIM_TYPE_QUADS (13 << 0)
-#define R300_PRIM_TYPE_QUAD_STRIP (14 << 0)
-#define R300_PRIM_TYPE_POLYGON (15 << 0)
-#define R300_PRIM_TYPE_MASK 0xF
-#define R300_PRIM_WALK_IND (1 << 4)
-#define R300_PRIM_WALK_LIST (2 << 4)
-#define R300_PRIM_WALK_RING (3 << 4)
-#define R300_PRIM_WALK_MASK (3 << 4)
-#define R300_PRIM_COLOR_ORDER_BGRA (0 << 6) // GUESS (based on r200)
-#define R300_PRIM_COLOR_ORDER_RGBA (1 << 6) // GUESS
-#define R300_PRIM_NUM_VERTICES_SHIFT 16
-
-// Draw a primitive from vertex data in arrays loaded via 3D_LOAD_VBPNTR.
-// Two parameter dwords:
-// 0. The first parameter appears to be always 0
-// 1. The second parameter is a standard primitive emission dword.
-#define R300_PACKET3_3D_DRAW_VBUF 0x00002800
-
-// Specify the full set of vertex arrays as (address, stride).
-// The first parameter is the number of vertex arrays specified.
-// The rest of the command is a variable length list of blocks, where
-// each block is three dwords long and specifies two arrays.
-// The first dword of a block is split into two words, the lower significant
-// word refers to the first array, the more significant word to the second
-// array in the block.
-// The low byte of each word contains the size of an array entry in dwords,
-// the high byte contains the stride of the array.
-// The second dword of a block contains the pointer to the first array,
-// the third dword of a block contains the pointer to the second array.
-// Note that if the total number of arrays is odd, the third dword of
-// the last block is omitted.
-#define R300_PACKET3_3D_LOAD_VBPNTR 0x00002F00
-
-#define R300_PACKET3_INDX_BUFFER 0x00003300
-# define R300_EB_UNK1_SHIFT 24
-# define R300_EB_UNK1 (0x80<<24)
-# define R300_EB_UNK2 0x0810
-#define R300_PACKET3_3D_DRAW_INDX_2 0x00003600
-
-//END
-
-#endif /* _R300_REG_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_render.c
deleted file mode 100644
index a0769e27f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_render.c
+++ /dev/null
@@ -1,726 +0,0 @@
-/**************************************************************************
-
-Copyright (C) 2004 Nicolai Haehnle.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#include "glheader.h"
-#include "state.h"
-#include "imports.h"
-#include "enums.h"
-#include "macros.h"
-#include "context.h"
-#include "dd.h"
-#include "simple_list.h"
-
-#include "api_arrayelt.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_vp_build.h"
-
-#include "radeon_reg.h"
-#include "radeon_macros.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "r300_context.h"
-#include "r300_ioctl.h"
-#include "r300_state.h"
-#include "r300_reg.h"
-#include "r300_program.h"
-#include "r300_tex.h"
-#include "r300_maos.h"
-#include "r300_emit.h"
-
-extern int future_hw_tcl_on;
-
-/**********************************************************************
-* Hardware rasterization
-*
-* When we fell back to software TCL, we still try to use the
-* rasterization hardware for rendering.
-**********************************************************************/
-
-static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int prim)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- int type=-1;
-
- switch (prim & PRIM_MODE_MASK) {
- case GL_POINTS:
- type=R300_VAP_VF_CNTL__PRIM_POINTS;
- break;
- case GL_LINES:
- type=R300_VAP_VF_CNTL__PRIM_LINES;
- break;
- case GL_LINE_STRIP:
- type=R300_VAP_VF_CNTL__PRIM_LINE_STRIP;
- break;
- case GL_LINE_LOOP:
- type=R300_VAP_VF_CNTL__PRIM_LINE_LOOP;
- break;
- case GL_TRIANGLES:
- type=R300_VAP_VF_CNTL__PRIM_TRIANGLES;
- break;
- case GL_TRIANGLE_STRIP:
- type=R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP;
- break;
- case GL_TRIANGLE_FAN:
- type=R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN;
- break;
- case GL_QUADS:
- type=R300_VAP_VF_CNTL__PRIM_QUADS;
- break;
- case GL_QUAD_STRIP:
- type=R300_VAP_VF_CNTL__PRIM_QUAD_STRIP;
- break;
- case GL_POLYGON:
- type=R300_VAP_VF_CNTL__PRIM_POLYGON;
- break;
- default:
- fprintf(stderr, "%s:%s Do not know how to handle primitive %02x - help me !\n",
- __FILE__, __FUNCTION__,
- prim & PRIM_MODE_MASK);
- return -1;
- break;
- }
- return type;
-}
-
-static int r300_get_num_verts(r300ContextPtr rmesa,
- GLcontext *ctx,
- int num_verts,
- int prim)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- int type=-1, verts_off=0;
- char *name="UNKNOWN";
-
- switch (prim & PRIM_MODE_MASK) {
- case GL_POINTS:
- name="P";
- verts_off = 0;
- break;
- case GL_LINES:
- name="L";
- verts_off = num_verts % 2;
- break;
- case GL_LINE_STRIP:
- name="LS";
- if(num_verts < 2)
- verts_off = num_verts;
- break;
- case GL_LINE_LOOP:
- name="LL";
- if(num_verts < 2)
- verts_off = num_verts;
- break;
- case GL_TRIANGLES:
- name="T";
- verts_off = num_verts % 3;
- break;
- case GL_TRIANGLE_STRIP:
- name="TS";
- if(num_verts < 3)
- verts_off = num_verts;
- break;
- case GL_TRIANGLE_FAN:
- name="TF";
- if(num_verts < 3)
- verts_off = num_verts;
- break;
- case GL_QUADS:
- name="Q";
- verts_off = num_verts % 4;
- break;
- case GL_QUAD_STRIP:
- name="QS";
- if(num_verts < 4)
- verts_off = num_verts;
- else
- verts_off = num_verts % 2;
- break;
- case GL_POLYGON:
- name="P";
- if(num_verts < 3)
- verts_off = num_verts;
- break;
- default:
- fprintf(stderr, "%s:%s Do not know how to handle primitive %02x - help me !\n",
- __FILE__, __FUNCTION__,
- prim & PRIM_MODE_MASK);
- return -1;
- break;
- }
-
- if(num_verts - verts_off == 0){
- WARN_ONCE("user error: Need more than %d vertices to draw primitive %s !\n", num_verts, name);
- return 0;
- }
-
- if(verts_off > 0){
- WARN_ONCE("user error: %d is not a valid number of vertices for primitive %s !\n", num_verts, name);
- }
-
- return num_verts - verts_off;
-}
-
-/* This function compiles GL context into state registers that
- describe data routing inside of R300 pipeline.
-
- In particular, it programs input_route, output_vtx_fmt, texture
- unit configuration and gb_output_vtx_fmt
-
- This function encompasses setup_AOS() from r300_lib.c
-*/
-
-
-
-
-/* Immediate implementation - vertex data is sent via command stream */
-
-static GLfloat default_vector[4]={0.0, 0.0, 0.0, 1.0};
-
-#define output_vector(v, i) { \
- int _i; \
- for(_i=0;_i<v->size;_i++){ \
- if(VB->Elts){ \
- efloat(VEC_ELT(v, GLfloat, VB->Elts[i])[_i]); \
- }else{ \
- efloat(VEC_ELT(v, GLfloat, i)[_i]); \
- } \
- } \
- for(_i=v->size;_i<4;_i++){ \
- efloat(default_vector[_i]); \
- } \
-}
-
-/* Immediate implementation - vertex data is sent via command stream */
-
-static void r300_render_immediate_primitive(r300ContextPtr rmesa,
- GLcontext *ctx,
- int start,
- int end,
- int prim)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i, render_inputs;
- int k, type, num_verts;
- LOCAL_VARS
-
- type=r300_get_primitive_type(rmesa, ctx, prim);
- num_verts=r300_get_num_verts(rmesa, ctx, end-start, prim);
-
-#if 0
- fprintf(stderr,"ObjPtr: size=%d stride=%d\n",
- VB->ObjPtr->size, VB->ObjPtr->stride);
- fprintf(stderr,"ColorPtr[0]: size=%d stride=%d\n",
- VB->ColorPtr[0]->size, VB->ColorPtr[0]->stride);
- fprintf(stderr,"TexCoordPtr[0]: size=%d stride=%d\n",
- VB->TexCoordPtr[0]->size, VB->TexCoordPtr[0]->stride);
-#endif
-
- if(type<0 || num_verts <= 0)return;
-
- if(!VB->ObjPtr){
- WARN_ONCE("FIXME: Don't know how to handle GL_ARB_vertex_buffer_object correctly\n");
- return;
- }
- /* A packet cannot have more than 16383 data words.. */
- if((num_verts*4*rmesa->state.aos_count)>16380){
- WARN_ONCE("Too many vertices to paint. Fix me !\n");
- return;
- }
-
- //fprintf(stderr, "aos_count=%d start=%d end=%d\n", rmesa->state.aos_count, start, end);
-
- if(rmesa->state.aos_count==0){
- WARN_ONCE("Aeiee ! aos_count==0, while it shouldn't. Skipping rendering\n");
- return;
- }
-
- render_inputs = rmesa->state.render_inputs;
-
- if(!render_inputs){
- WARN_ONCE("Aeiee ! render_inputs==0. Skipping rendering.\n");
- return;
- }
-
-
- start_immediate_packet(num_verts, type, 4*rmesa->state.aos_count);
-
- for(i=start;i<start+num_verts;i++){
-#if 0
- fprintf(stderr, "* (%f %f %f %f) (%f %f %f %f)\n",
- VEC_ELT(VB->ObjPtr, GLfloat, i)[0],
- VEC_ELT(VB->ObjPtr, GLfloat, i)[1],
- VEC_ELT(VB->ObjPtr, GLfloat, i)[2],
- VEC_ELT(VB->ObjPtr, GLfloat, i)[3],
-
- VEC_ELT(VB->ColorPtr[0], GLfloat, i)[0],
- VEC_ELT(VB->ColorPtr[0], GLfloat, i)[1],
- VEC_ELT(VB->ColorPtr[0], GLfloat, i)[2],
- VEC_ELT(VB->ColorPtr[0], GLfloat, i)[3]
- );
-#endif
-
-
- /* coordinates */
- if(render_inputs & _TNL_BIT_POS)
- output_vector(VB->ObjPtr, i);
- if(render_inputs & _TNL_BIT_NORMAL)
- output_vector(VB->NormalPtr, i);
-
- /* color components */
- if(render_inputs & _TNL_BIT_COLOR0)
- output_vector(VB->ColorPtr[0], i);
- if(render_inputs & _TNL_BIT_COLOR1)
- output_vector(VB->SecondaryColorPtr[0], i);
-
-/* if(render_inputs & _TNL_BIT_FOG) // Causes lock ups when immediate mode is on
- output_vector(VB->FogCoordPtr, i);*/
-
- /* texture coordinates */
- for(k=0;k < ctx->Const.MaxTextureUnits;k++)
- if(render_inputs & (_TNL_BIT_TEX0<<k))
- output_vector(VB->TexCoordPtr[k], i);
-
- if(render_inputs & _TNL_BIT_INDEX)
- output_vector(VB->IndexPtr[0], i);
- if(render_inputs & _TNL_BIT_POINTSIZE)
- output_vector(VB->PointSizePtr, i);
- }
-
-}
-
-
-static GLboolean r300_run_immediate_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- /* Only do 2d textures */
- struct gl_texture_object *to=ctx->Texture.Unit[0].Current2D;
- r300TexObjPtr t=to->DriverData;
- LOCAL_VARS
-
-
- /* Update texture state - needs to be done only when actually changed..
- All the time for now.. */
-
-
- if (RADEON_DEBUG == DEBUG_PRIMS)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-#if 1 /* we need this, somehow */
- /* Flush state - make sure command buffer is nice and large */
- r300Flush(ctx);
- /* Make sure we have enough space */
-#else
- /* Count is very imprecize, but should be good upper bound */
- r300EnsureCmdBufSpace(rmesa, rmesa->hw.max_state_size + 4+2+30
- +VB->PrimitiveCount*(1+8)+VB->Count*4*rmesa->state.texture.tc_count+4, __FUNCTION__);
-#endif
-
- /* needed before starting 3d operation .. */
- reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(0x0000000a);
-
- reg_start(0x4f18,0);
- e32(0x00000003);
-
-
-#if 0 /* looks like the Z offset issue got fixed */
- rmesa->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA
- | R300_VPORT_X_OFFSET_ENA
- | R300_VPORT_Y_SCALE_ENA
- | R300_VPORT_Y_OFFSET_ENA
- | R300_VTX_W0_FMT;
- R300_STATECHANGE(rmesa, vte);
-#endif
-
-
-
- /* Magic register - note it is right after 20b0 */
-
-
- if(rmesa->state.texture.tc_count>0){
- reg_start(0x20b4,0);
- e32(0x0000000c);
-
- }
-
- r300EmitState(rmesa);
-
-/* Setup INPUT_ROUTE and INPUT_CNTL */
- r300EmitArrays(ctx, GL_TRUE);
-
-/* Why do we need this for immediate mode?? Vertex processor needs it to know proper regs */
-// r300EmitLOAD_VBPNTR(rmesa, 0);
-/* Okay, it seems I misunderstood something, EmitAOS does the same thing */
- r300EmitAOS(rmesa, rmesa->state.aos_count, 0);
-
- for(i=0; i < VB->PrimitiveCount; i++){
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- r300_render_immediate_primitive(rmesa, ctx, start, start + length, prim);
- }
-
- /* This sequence is required after any 3d drawing packet
- I suspect it work arounds a bug (or deficiency) in hardware */
-
- reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(0x0000000a);
-
- reg_start(0x4f18,0);
- e32(0x00000003);
-
- return GL_FALSE;
-}
-
-
-/* vertex buffer implementation */
-
-static void inline fire_EB(PREFIX unsigned long addr, int vertex_count, int type)
-{
- LOCAL_VARS
- unsigned long addr_a;
-
- if(addr & 1){
- WARN_ONCE("Badly aligned buffer\n");
- return ;
- }
- addr_a = 0; /*addr & 0x1c;*/
-
- check_space(6);
-
- start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0);
- /* TODO: R300_VAP_VF_CNTL__INDEX_SIZE_32bit . */
- e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count<<16) | type);
-
- start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2);
- e32(R300_EB_UNK1 | (addr_a << 16) | R300_EB_UNK2);
- e32(addr /*& 0xffffffe3*/);
- e32((vertex_count+1)/2 /*+ addr_a/4*/); /* Total number of dwords needed? */
-}
-
-static void r300_render_vb_primitive(r300ContextPtr rmesa,
- GLcontext *ctx,
- int start,
- int end,
- int prim)
-{
- int type, num_verts;
- radeonScreenPtr rsp=rmesa->radeon.radeonScreen;
- LOCAL_VARS
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- int i;
-
- type=r300_get_primitive_type(rmesa, ctx, prim);
- num_verts=r300_get_num_verts(rmesa, ctx, end-start, prim);
-
- if(type<0 || num_verts <= 0)return;
-
- if(rmesa->state.Elts){
- r300EmitAOS(rmesa, rmesa->state.aos_count, 0);
-#if 0
- start_index32_packet(num_verts, type);
- for(i=0; i < num_verts; i++)
- e32(rmesa->state.Elts[start+i]); /* start ? */
-#else
- WARN_ONCE("Rendering with elt buffers\n");
- if(num_verts == 1){
- start_index32_packet(num_verts, type);
- e32(rmesa->state.Elts[start]);
- return;
- }
-
- if(num_verts > 65535){ /* not implemented yet */
- WARN_ONCE("Too many elts\n");
- return;
- }
- r300EmitElts(ctx, rmesa->state.Elts+start, num_verts);
- fire_EB(PASS_PREFIX GET_START(&(rmesa->state.elt_dma)), num_verts, type);
-#endif
- }else{
- r300EmitAOS(rmesa, rmesa->state.aos_count, start);
- fire_AOS(PASS_PREFIX num_verts, type);
- }
-}
-
-static GLboolean r300_run_vb_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- int i, j;
- LOCAL_VARS
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
- r300ReleaseArrays(ctx);
- r300EmitArrays(ctx, GL_FALSE);
-
-// LOCK_HARDWARE(&(rmesa->radeon));
-
- reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(0x0000000a);
-
- reg_start(0x4f18,0);
- e32(0x00000003);
- r300EmitState(rmesa);
-
- rmesa->state.Elts = VB->Elts;
-
- for(i=0; i < VB->PrimitiveCount; i++){
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- r300_render_vb_primitive(rmesa, ctx, start, start + length, prim);
- }
-
- reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(0x0000000a);
-
- reg_start(0x4f18,0);
- e32(0x00000003);
-
-// end_3d(PASS_PREFIX_VOID);
-
- /* Flush state - we are done drawing.. */
-// r300FlushCmdBufLocked(rmesa, __FUNCTION__);
-// radeonWaitForIdleLocked(&(rmesa->radeon));
-
-// UNLOCK_HARDWARE(&(rmesa->radeon));
- return GL_FALSE;
-}
-
-/**
- * Called by the pipeline manager to render a batch of primitives.
- * We can return true to pass on to the next stage (i.e. software
- * rasterization) or false to indicate that the pipeline has finished
- * after we render something.
- */
-static GLboolean r300_run_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
-#if 1
-
-#if 0
- return r300_run_immediate_render(ctx, stage);
-#else
- return r300_run_vb_render(ctx, stage);
-#endif
-#else
- return GL_TRUE;
-#endif
-}
-
-
-/**
- * Called by the pipeline manager once before rendering.
- * We check the GL state here to
- * a) decide whether we can do the current state in hardware and
- * b) update hardware registers
- */
-#define FALLBACK_IF(expr) \
-do { \
- if (expr) { \
- if (1 || RADEON_DEBUG & DEBUG_FALLBACKS) \
- fprintf(stderr, "%s: fallback:%s\n", \
- __FUNCTION__, #expr); \
- /*stage->active = GL_FALSE*/; \
- return; \
- } \
-} while(0)
-
-static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- int i;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* We only support rendering in hardware for now */
- if (ctx->RenderMode != GL_RENDER) {
- //stage->active = GL_FALSE;
- return;
- }
-
-
- /* I'm almost certain I forgot something here */
-#if 0 /* These should work now.. */
- FALLBACK_IF(ctx->Color.DitherFlag);
- FALLBACK_IF(ctx->Color.AlphaEnabled); // GL_ALPHA_TEST
- FALLBACK_IF(ctx->Color.BlendEnabled); // GL_BLEND
- FALLBACK_IF(ctx->Polygon.OffsetFill); // GL_POLYGON_OFFSET_FILL
-#endif
- //FALLBACK_IF(ctx->Polygon.OffsetPoint); // GL_POLYGON_OFFSET_POINT
- //FALLBACK_IF(ctx->Polygon.OffsetLine); // GL_POLYGON_OFFSET_LINE
- //FALLBACK_IF(ctx->Stencil.Enabled); // GL_STENCIL_TEST
-
- //FALLBACK_IF(ctx->Fog.Enabled); // GL_FOG disable as swtcl doesnt seem to support this
- //FALLBACK_IF(ctx->Polygon.SmoothFlag); // GL_POLYGON_SMOOTH disabling to get blender going
- FALLBACK_IF(ctx->Polygon.StippleFlag); // GL_POLYGON_STIPPLE
- FALLBACK_IF(ctx->Multisample.Enabled); // GL_MULTISAMPLE_ARB
-
- FALLBACK_IF(ctx->RenderMode != GL_RENDER); // We do not do SELECT or FEEDBACK (yet ?)
-
-#if 0 /* ut2k3 fails to start if this is on */
- /* One step at a time - let one texture pass.. */
- for (i = 1; i < ctx->Const.MaxTextureUnits; i++)
- FALLBACK_IF(ctx->Texture.Unit[i].Enabled);
-#endif
-
- /* Assumed factor reg is found but pattern is still missing */
- //FALLBACK_IF(ctx->Line.StippleFlag); // GL_LINE_STIPPLE disabling to get blender going
-
- /* HW doesnt appear to directly support these */
- //FALLBACK_IF(ctx->Line.SmoothFlag); // GL_LINE_SMOOTH disabling to get blender going
- FALLBACK_IF(ctx->Point.SmoothFlag); // GL_POINT_SMOOTH
- /* Rest could be done with vertex fragments */
- if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite)
- FALLBACK_IF(ctx->Point.PointSprite); // GL_POINT_SPRITE_NV
- //GL_POINT_DISTANCE_ATTENUATION_ARB
- //GL_POINT_FADE_THRESHOLD_SIZE_ARB
-
- /* let r300_run_render do its job */
-#if 0
- stage->active = GL_FALSE;
-#endif
-}
-
-
-static void dtr(struct tnl_pipeline_stage *stage)
-{
- (void)stage;
-}
-
-static GLboolean r300_create_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- return GL_TRUE;
-}
-
-
-const struct tnl_pipeline_stage _r300_render_stage = {
- "r300 hw rasterize",
- NULL,
- r300_create_render,
- dtr, /* destructor */
- r300_check_render, /* check */
- r300_run_render /* run */
-};
-
-static GLboolean r300_run_tcl_render(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- struct r300_vertex_program *vp;
-
- hw_tcl_on=future_hw_tcl_on;
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s\n", __FUNCTION__);
- if(hw_tcl_on == GL_FALSE)
- return GL_TRUE;
- if(ctx->VertexProgram._Enabled == GL_FALSE){
- _tnl_UpdateFixedFunctionProgram(ctx);
- }
- vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
- if(vp->translated == GL_FALSE)
- translate_vertex_shader(vp);
- if(vp->translated == GL_FALSE){
- fprintf(stderr, "Failing back to sw-tcl\n");
- debug_vp(ctx, &vp->mesa_program);
- hw_tcl_on=future_hw_tcl_on=0;
- r300ResetHwState(rmesa);
- return GL_TRUE;
- }
-
- r300_setup_textures(ctx);
- r300_setup_rs_unit(ctx);
-
- r300SetupVertexShader(rmesa);
- r300SetupPixelShader(rmesa);
-
- return r300_run_vb_render(ctx, stage);
-}
-
-static void r300_check_tcl_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- int i;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* We only support rendering in hardware for now */
- if (ctx->RenderMode != GL_RENDER) {
- //stage->active = GL_FALSE;
- return;
- }
-}
-
-const struct tnl_pipeline_stage _r300_tcl_stage = {
- "r300 tcl",
- NULL,
- r300_create_render,
- dtr, /* destructor */
- r300_check_tcl_render, /* check */
- r300_run_tcl_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_shader.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_shader.c
deleted file mode 100644
index 9c6788ec3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_shader.c
+++ /dev/null
@@ -1,112 +0,0 @@
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
-#include "program.h"
-#include "r300_context.h"
-#include "nvvertprog.h"
-#if USE_ARB_F_P == 1
-#include "r300_fragprog.h"
-#endif
-
-static void r300BindProgram(GLcontext *ctx, GLenum target, struct program *prog)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct r300_vertex_program *vp=(void *)prog;
-
- switch(target){
- case GL_VERTEX_PROGRAM_ARB:
-#if USE_ARB_F_P == 1
- case GL_FRAGMENT_PROGRAM_ARB:
-#endif
- //rmesa->current_vp = vp;
- break;
- default:
- WARN_ONCE("Target not supported yet!\n");
- break;
- }
-}
-
-static struct program *r300NewProgram(GLcontext *ctx, GLenum target, GLuint id)
-{
- struct r300_vertex_program *vp;
-#if USE_ARB_F_P == 1
- struct r300_fragment_program *fp;
-#else
- struct fragment_program *fp;
-#endif
- struct ati_fragment_shader *afs;
-
- switch(target){
- case GL_VERTEX_PROGRAM_ARB:
- vp=CALLOC_STRUCT(r300_vertex_program);
- return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id);
-
- case GL_FRAGMENT_PROGRAM_ARB:
-#if USE_ARB_F_P == 1
- fp=CALLOC_STRUCT(r300_fragment_program);
- fp->ctx = ctx;
- return _mesa_init_fragment_program(ctx, &fp->mesa_program, target, id);
-#else
- fp=CALLOC_STRUCT(fragment_program);
- return _mesa_init_fragment_program(ctx, fp, target, id);
-#endif
- case GL_FRAGMENT_PROGRAM_NV:
- fp=CALLOC_STRUCT(fragment_program);
- return _mesa_init_fragment_program(ctx, fp, target, id);
-
- case GL_FRAGMENT_SHADER_ATI:
- afs=CALLOC_STRUCT(ati_fragment_shader);
- return _mesa_init_ati_fragment_shader(ctx, afs, target, id);
- }
-
- return NULL;
-}
-
-
-static void r300DeleteProgram(GLcontext *ctx, struct program *prog)
-{
- //r300ContextPtr rmesa = R300_CONTEXT(ctx);
- //struct r300_vertex_program *vp=(void *)prog;
-
- _mesa_delete_program(ctx, prog);
-}
-
-static void r300ProgramStringNotify(GLcontext *ctx, GLenum target,
- struct program *prog)
-{
- struct r300_vertex_program *vp=(void *)prog;
-#if USE_ARB_F_P == 1
- struct r300_fragment_program *fp=(void *)prog;
-#endif
-
- switch(target) {
- case GL_VERTEX_PROGRAM_ARB:
- /*vp->translated=GL_FALSE;
- translate_vertex_shader(vp);*/
- //debug_vp(ctx, vp);
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
-#if USE_ARB_F_P == 1
- fp->translated = GL_FALSE;
-#endif
- break;
- }
-}
-
-static GLboolean r300IsProgramNative(GLcontext *ctx, GLenum target, struct program *prog)
-{
- //struct r300_vertex_program *vp=(void *)prog;
- //r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- return 1;
-}
-
-void r300InitShaderFuncs(struct dd_function_table *functions)
-{
- functions->NewProgram=r300NewProgram;
- functions->BindProgram=r300BindProgram;
- functions->DeleteProgram=r300DeleteProgram;
- functions->ProgramStringNotify=r300ProgramStringNotify;
- functions->IsProgramNative=r300IsProgramNative;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.c
deleted file mode 100644
index b6a03a227..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.c
+++ /dev/null
@@ -1,2321 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002.
-Copyright (C) 2004 Nicolai Haehnle.
-All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#include "glheader.h"
-#include "state.h"
-#include "imports.h"
-#include "enums.h"
-#include "macros.h"
-#include "context.h"
-#include "dd.h"
-#include "simple_list.h"
-
-#include "api_arrayelt.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "texformat.h"
-
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "r300_context.h"
-#include "r300_ioctl.h"
-#include "r300_state.h"
-#include "r300_reg.h"
-#include "r300_program.h"
-#include "r300_emit.h"
-#if USE_ARB_F_P == 1
-#include "r300_fragprog.h"
-#else
-#include "r300_fixed_pipelines.h"
-#include "r300_texprog.h"
-#endif
-#include "r300_tex.h"
-#include "r300_maos.h"
-
-static void r300AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- int pp_misc = rmesa->hw.at.cmd[R300_AT_ALPHA_TEST];
- GLubyte refByte;
-
- CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
- R300_STATECHANGE(rmesa, at);
-
- pp_misc &= ~(R300_ALPHA_TEST_OP_MASK | R300_REF_ALPHA_MASK);
- pp_misc |= (refByte & R300_REF_ALPHA_MASK);
-
- switch (func) {
- case GL_NEVER:
- pp_misc |= R300_ALPHA_TEST_FAIL;
- break;
- case GL_LESS:
- pp_misc |= R300_ALPHA_TEST_LESS;
- break;
- case GL_EQUAL:
- pp_misc |= R300_ALPHA_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- pp_misc |= R300_ALPHA_TEST_LEQUAL;
- break;
- case GL_GREATER:
- pp_misc |= R300_ALPHA_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- pp_misc |= R300_ALPHA_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- pp_misc |= R300_ALPHA_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- pp_misc |= R300_ALPHA_TEST_PASS;
- //pp_misc &= ~R300_ALPHA_TEST_ENABLE;
- break;
- }
-
- rmesa->hw.at.cmd[R300_AT_ALPHA_TEST] = pp_misc;
-}
-
-static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4])
-{
- GLubyte color[4];
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- R300_STATECHANGE(rmesa, unk4E10);
-
- /* Ordering might be wrong */
- CLAMPED_FLOAT_TO_UBYTE(color[0], cf[0]);
- CLAMPED_FLOAT_TO_UBYTE(color[1], cf[1]);
- CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]);
- CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]);
-
- rmesa->hw.unk4E10.cmd[1]=r300PackColor(4, color[0], color[1], color[2], color[3]);
-}
-
-/**
- * Calculate the hardware blend factor setting. This same function is used
- * for source and destination of both alpha and RGB.
- *
- * \returns
- * The hardware register value for the specified blend factor. This value
- * will need to be shifted into the correct position for either source or
- * destination factor.
- *
- * \todo
- * Since the two cases where source and destination are handled differently
- * are essentially error cases, they should never happen. Determine if these
- * cases can be removed.
- */
-static int blend_factor(GLenum factor, GLboolean is_src)
-{
- int func;
-
- switch (factor) {
- case GL_ZERO:
- func = R200_BLEND_GL_ZERO;
- break;
- case GL_ONE:
- func = R200_BLEND_GL_ONE;
- break;
- case GL_DST_COLOR:
- func = R200_BLEND_GL_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_DST_COLOR;
- break;
- case GL_SRC_COLOR:
- func = R200_BLEND_GL_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- func = R200_BLEND_GL_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- func = R200_BLEND_GL_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_DST_ALPHA;
- break;
- case GL_SRC_ALPHA_SATURATE:
- func =
- (is_src) ? R200_BLEND_GL_SRC_ALPHA_SATURATE :
- R200_BLEND_GL_ZERO;
- break;
- case GL_CONSTANT_COLOR:
- func = R200_BLEND_GL_CONST_COLOR;
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_CONST_COLOR;
- break;
- case GL_CONSTANT_ALPHA:
- func = R200_BLEND_GL_CONST_ALPHA;
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_CONST_ALPHA;
- break;
- default:
- func = (is_src) ? R200_BLEND_GL_ONE : R200_BLEND_GL_ZERO;
- }
- return func;
-}
-
-/**
- * Sets both the blend equation and the blend function.
- * This is done in a single
- * function because some blend equations (i.e., \c GL_MIN and \c GL_MAX)
- * change the interpretation of the blend function.
- * Also, make sure that blend function and blend equation are set to their default
- * value if color blending is not enabled, since at least blend equations GL_MIN
- * and GL_FUNC_REVERSE_SUBTRACT will cause wrong results otherwise for
- * unknown reasons.
- */
-
-/* helper function */
-static void r300_set_blend_cntl(r300ContextPtr r300, int func, int eqn, int cbits, int funcA, int eqnA)
-{
- GLuint new_ablend, new_cblend;
-
-#if 0
- fprintf(stderr, "eqnA=%08x funcA=%08x eqn=%08x func=%08x cbits=%08x\n", eqnA, funcA, eqn, func, cbits);
-#endif
- new_ablend = eqnA | funcA;
- new_cblend = eqn | func;
-
- /* Some blend factor combinations don't seem to work when the
- * BLEND_NO_SEPARATE bit is set.
- *
- * Especially problematic candidates are the ONE_MINUS_* flags,
- * but I can't see a real pattern.
- */
-#if 0
- if (new_ablend == new_cblend) {
- new_cblend |= R300_BLEND_NO_SEPARATE;
- }
-#endif
- new_cblend |= cbits;
-
- if((new_ablend != r300->hw.bld.cmd[R300_BLD_ABLEND]) ||
- (new_cblend != r300->hw.bld.cmd[R300_BLD_CBLEND])) {
- R300_STATECHANGE(r300, bld);
- r300->hw.bld.cmd[R300_BLD_ABLEND]=new_ablend;
- r300->hw.bld.cmd[R300_BLD_CBLEND]=new_cblend;
- }
-}
-
-
-static void r300_set_blend_state(GLcontext * ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- int func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT);
- int eqn = R200_COMB_FCN_ADD_CLAMP;
- int funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT);
- int eqnA = R200_COMB_FCN_ADD_CLAMP;
-
- if (ctx->Color._LogicOpEnabled || !ctx->Color.BlendEnabled) {
- r300_set_blend_cntl(r300,
- func, eqn, 0,
- func, eqn);
- return;
- }
-
- func = (blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE) << R200_SRC_BLEND_SHIFT) |
- (blend_factor(ctx->Color.BlendDstRGB, GL_FALSE) << R200_DST_BLEND_SHIFT);
-
- switch (ctx->Color.BlendEquationRGB) {
- case GL_FUNC_ADD:
- eqn = R300_COMB_FCN_ADD_CLAMP;
- break;
-
- case GL_FUNC_SUBTRACT:
- eqn = R300_COMB_FCN_SUB_CLAMP;
- break;
-
- case GL_FUNC_REVERSE_SUBTRACT:
- eqn = R200_COMB_FCN_RSUB_CLAMP;
- break;
-
- case GL_MIN:
- eqn = R200_COMB_FCN_MIN;
- func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- case GL_MAX:
- eqn = R200_COMB_FCN_MAX;
- func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- default:
- fprintf(stderr,
- "[%s:%u] Invalid RGB blend equation (0x%04x).\n",
- __func__, __LINE__, ctx->Color.BlendEquationRGB);
- return;
- }
-
-
- funcA = (blend_factor(ctx->Color.BlendSrcA, GL_TRUE) << R200_SRC_BLEND_SHIFT) |
- (blend_factor(ctx->Color.BlendDstA, GL_FALSE) << R200_DST_BLEND_SHIFT);
-
- switch (ctx->Color.BlendEquationA) {
- case GL_FUNC_ADD:
- eqnA = R300_COMB_FCN_ADD_CLAMP;
- break;
-
- case GL_FUNC_SUBTRACT:
- eqnA = R300_COMB_FCN_SUB_CLAMP;
- break;
-
- case GL_FUNC_REVERSE_SUBTRACT:
- eqnA = R200_COMB_FCN_RSUB_CLAMP;
- break;
-
- case GL_MIN:
- eqnA = R200_COMB_FCN_MIN;
- funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- case GL_MAX:
- eqnA = R200_COMB_FCN_MAX;
- funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
- break;
-
- default:
- fprintf(stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n",
- __func__, __LINE__, ctx->Color.BlendEquationA);
- return;
- }
-
- r300_set_blend_cntl(r300,
- func, eqn, R300_BLEND_UNKNOWN | R300_BLEND_ENABLE,
- funcA, eqnA);
-}
-
-static void r300BlendEquationSeparate(GLcontext * ctx,
- GLenum modeRGB, GLenum modeA)
-{
- r300_set_blend_state(ctx);
-}
-
-static void r300BlendFuncSeparate(GLcontext * ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA)
-{
- r300_set_blend_state(ctx);
-}
-
-/**
- * Update our tracked culling state based on Mesa's state.
- */
-static void r300UpdateCulling(GLcontext* ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- uint32_t val = 0;
-
- R300_STATECHANGE(r300, cul);
- if (ctx->Polygon.CullFlag) {
- if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- val = R300_CULL_FRONT|R300_CULL_BACK;
- else if (ctx->Polygon.CullFaceMode == GL_FRONT)
- val = R300_CULL_FRONT;
- else
- val = R300_CULL_BACK;
-
- if (ctx->Polygon.FrontFace == GL_CW)
- val |= R300_FRONT_FACE_CW;
- else
- val |= R300_FRONT_FACE_CCW;
- }
- r300->hw.cul.cmd[R300_CUL_CULL] = val;
-}
-
-static void update_early_z(GLcontext* ctx)
-{
- /* updates register 0x4f14
- if depth test is not enabled it should be 0x00000000
- if depth is enabled and alpha not it should be 0x00000001
- if depth and alpha is enabled it should be 0x00000000
- */
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- R300_STATECHANGE(r300, unk4F10);
- if (ctx->Color.AlphaEnabled)
- /* disable early Z */
- r300->hw.unk4F10.cmd[2] = 0x00000000;
- else {
- if (ctx->Depth.Test)
- /* enable early Z */
- r300->hw.unk4F10.cmd[2] = 0x00000001;
- else
- /* disable early Z */
- r300->hw.unk4F10.cmd[2] = 0x00000000;
- }
-}
-
-/**
- * Handle glEnable()/glDisable().
- *
- * \note Mesa already filters redundant calls to glEnable/glDisable.
- */
-static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- uint32_t newval;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s( %s = %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(cap),
- state ? "GL_TRUE" : "GL_FALSE");
-
- switch (cap) {
- /* Fast track this one...
- */
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- break;
-
- case GL_ALPHA_TEST:
- R300_STATECHANGE(r300, at);
- if (state) {
- r300->hw.at.cmd[R300_AT_ALPHA_TEST] |=
- R300_ALPHA_TEST_ENABLE;
- } else {
- r300->hw.at.cmd[R300_AT_ALPHA_TEST] &=
- ~R300_ALPHA_TEST_ENABLE;
- }
- update_early_z(ctx);
- break;
-
- case GL_BLEND:
- case GL_COLOR_LOGIC_OP:
- r300_set_blend_state(ctx);
- break;
-
- case GL_DEPTH_TEST:
- R300_STATECHANGE(r300, zs);
-
- if (state) {
- if (ctx->Depth.Mask)
- newval = R300_RB3D_Z_TEST_AND_WRITE;
- else
- newval = R300_RB3D_Z_TEST;
- } else
- newval = R300_RB3D_Z_DISABLED_1;
-
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |= newval;
- update_early_z(ctx);
- break;
-
- case GL_STENCIL_TEST:
- WARN_ONCE("TODO - double side stencil !\n");
- if (r300->state.stencil.hw_stencil) {
- R300_STATECHANGE(r300, zs);
- if (state) {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |=
- R300_RB3D_STENCIL_ENABLE;
- } else {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &=
- ~R300_RB3D_STENCIL_ENABLE;
- }
- } else {
-#if R200_MERGED
- FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, state);
-#endif
- }
- break;
-
- case GL_CULL_FACE:
- r300UpdateCulling(ctx);
- break;
-
- case GL_POLYGON_OFFSET_POINT:
- case GL_POLYGON_OFFSET_LINE:
- break;
-
- case GL_POLYGON_OFFSET_FILL:
- R300_STATECHANGE(r300, unk42B4);
- if(state){
- r300->hw.unk42B4.cmd[1] |= (3<<0);
- } else {
- r300->hw.unk42B4.cmd[1] &= ~(3<<0);
- }
- break;
- default:
- radeonEnable(ctx, cap, state);
- return;
- }
-}
-
-
-static void r300UpdatePolygonMode(GLcontext *ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- uint32_t hw_mode=0;
-
- if (ctx->Polygon.FrontMode != GL_FILL ||
- ctx->Polygon.BackMode != GL_FILL) {
- GLenum f, b;
-
- if (ctx->Polygon.FrontFace == GL_CCW) {
- f = ctx->Polygon.FrontMode;
- b = ctx->Polygon.BackMode;
- } else {
- f = ctx->Polygon.BackMode;
- b = ctx->Polygon.FrontMode;
- }
-
- hw_mode |= R300_PM_ENABLED;
-
- switch (f) {
- case GL_LINE:
- hw_mode |= R300_PM_FRONT_LINE;
- break;
- case GL_POINT: /* noop */
- hw_mode |= R300_PM_FRONT_POINT;
- break;
- case GL_FILL:
- hw_mode |= R300_PM_FRONT_FILL;
- break;
- }
-
- switch (b) {
- case GL_LINE:
- hw_mode |= R300_PM_BACK_LINE;
- break;
- case GL_POINT: /* noop */
- hw_mode |= R300_PM_BACK_POINT;
- break;
- case GL_FILL:
- hw_mode |= R300_PM_BACK_FILL;
- break;
- }
- }
-
- if (r300->hw.unk4288.cmd[1] != hw_mode) {
- R300_STATECHANGE(r300, unk4288);
- r300->hw.unk4288.cmd[1] = hw_mode;
- }
-}
-
-/**
- * Change the culling mode.
- *
- * \note Mesa already filters redundant calls to this function.
- */
-static void r300CullFace(GLcontext* ctx, GLenum mode)
-{
- (void)mode;
-
- r300UpdateCulling(ctx);
-}
-
-
-/**
- * Change the polygon orientation.
- *
- * \note Mesa already filters redundant calls to this function.
- */
-static void r300FrontFace(GLcontext* ctx, GLenum mode)
-{
- (void)mode;
-
- r300UpdateCulling(ctx);
- r300UpdatePolygonMode(ctx);
-}
-
-
-/**
- * Change the depth testing function.
- *
- * \note Mesa already filters redundant calls to this function.
- */
-static void r300DepthFunc(GLcontext* ctx, GLenum func)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- R300_STATECHANGE(r300, zs);
-
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
-
- switch(func) {
- case GL_NEVER:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_NEVER << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_LESS:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_LESS << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_EQUAL:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_EQUAL << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_LEQUAL:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_LEQUAL << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_GREATER:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_GREATER << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_NOTEQUAL:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_NOTEQUAL << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_GEQUAL:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_GEQUAL << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- case GL_ALWAYS:
- r300->hw.zs.cmd[R300_ZS_CNTL_1] |= R300_ZS_ALWAYS << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
- break;
- }
-}
-
-
-/**
- * Enable/Disable depth writing.
- *
- * \note Mesa already filters redundant calls to this function.
- */
-static void r300DepthMask(GLcontext* ctx, GLboolean mask)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- if (!ctx->Depth.Test)
- return;
-
- R300_STATECHANGE(r300, zs);
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |= mask
- ? R300_RB3D_Z_TEST_AND_WRITE : R300_RB3D_Z_TEST;
-}
-
-
-/**
- * Handle glColorMask()
- */
-static void r300ColorMask(GLcontext* ctx,
- GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- int mask = (r ? R300_COLORMASK0_R : 0) |
- (g ? R300_COLORMASK0_G : 0) |
- (b ? R300_COLORMASK0_B : 0) |
- (a ? R300_COLORMASK0_A : 0);
-
- if (mask != r300->hw.cmk.cmd[R300_CMK_COLORMASK]) {
- R300_STATECHANGE(r300, cmk);
- r300->hw.cmk.cmd[R300_CMK_COLORMASK] = mask;
- }
-}
-
-/* =============================================================
- * Point state
- */
-static void r300PointSize(GLcontext * ctx, GLfloat size)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- size = ctx->Point._Size;
-
- R300_STATECHANGE(r300, ps);
- r300->hw.ps.cmd[R300_PS_POINTSIZE] =
- ((int)(size * 6) << R300_POINTSIZE_X_SHIFT) |
- ((int)(size * 6) << R300_POINTSIZE_Y_SHIFT);
-}
-
-/* =============================================================
- * Line state
- */
-static void r300LineWidth(GLcontext *ctx, GLfloat widthf)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- widthf = ctx->Line._Width;
-
- R300_STATECHANGE(r300, lcntl);
- r300->hw.lcntl.cmd[1] = (int)(widthf * 6.0);
- r300->hw.lcntl.cmd[1] |= R300_LINE_CNT_VE;
-}
-
-static void r300PolygonMode(GLcontext *ctx, GLenum face, GLenum mode)
-{
- (void)face;
- (void)mode;
-
- r300UpdatePolygonMode(ctx);
-}
-
-/* =============================================================
- * Stencil
- */
-
-static int translate_stencil_func(int func)
-{
- switch (func) {
- case GL_NEVER:
- return R300_ZS_NEVER;
- case GL_LESS:
- return R300_ZS_LESS;
- case GL_EQUAL:
- return R300_ZS_EQUAL;
- case GL_LEQUAL:
- return R300_ZS_LEQUAL;
- case GL_GREATER:
- return R300_ZS_GREATER;
- case GL_NOTEQUAL:
- return R300_ZS_NOTEQUAL;
- case GL_GEQUAL:
- return R300_ZS_GEQUAL;
- case GL_ALWAYS:
- return R300_ZS_ALWAYS;
- }
- return 0;
-}
-
-static int translate_stencil_op(int op)
-{
- switch (op) {
- case GL_KEEP:
- return R300_ZS_KEEP;
- case GL_ZERO:
- return R300_ZS_ZERO;
- case GL_REPLACE:
- return R300_ZS_REPLACE;
- case GL_INCR:
- return R300_ZS_INCR;
- case GL_DECR:
- return R300_ZS_DECR;
- case GL_INCR_WRAP_EXT:
- return R300_ZS_INCR_WRAP;
- case GL_DECR_WRAP_EXT:
- return R300_ZS_DECR_WRAP;
- case GL_INVERT:
- return R300_ZS_INVERT;
- default:
- WARN_ONCE("Do not know how to translate stencil op");
- return R300_ZS_KEEP;
- }
- return 0;
-}
-
-static void r300ShadeModel(GLcontext * ctx, GLenum mode)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- R300_STATECHANGE(rmesa, unk4274);
- switch (mode) {
- case GL_FLAT:
- rmesa->hw.unk4274.cmd[2] = R300_RE_SHADE_MODEL_FLAT;
- break;
- case GL_SMOOTH:
- rmesa->hw.unk4274.cmd[2] = R300_RE_SHADE_MODEL_SMOOTH;
- break;
- default:
- return;
- }
-}
-
-static void r300StencilFunc(GLcontext * ctx, GLenum func,
- GLint ref, GLuint mask)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- GLuint refmask = ((ctx->Stencil.Ref[0] << R300_RB3D_ZS2_STENCIL_REF_SHIFT) |
- (ctx->Stencil.ValueMask[0] << R300_RB3D_ZS2_STENCIL_MASK_SHIFT));
-
- GLuint flag;
-
- R300_STATECHANGE(rmesa, zs);
-
- rmesa->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(
- (R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT)
- | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT));
-
- rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= ~((R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_REF_SHIFT) |
- (R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_MASK_SHIFT));
-
- flag = translate_stencil_func(ctx->Stencil.Function[0]);
-
- rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_RB3D_ZS1_FRONT_FUNC_SHIFT)
- | (flag << R300_RB3D_ZS1_BACK_FUNC_SHIFT);
- rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= refmask;
-}
-
-static void r300StencilMask(GLcontext * ctx, GLuint mask)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- R300_STATECHANGE(rmesa, zs);
- rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= ~(R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT);
- rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= ctx->Stencil.WriteMask[0] << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT;
-}
-
-
-static void r300StencilOp(GLcontext * ctx, GLenum fail,
- GLenum zfail, GLenum zpass)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- R300_STATECHANGE(rmesa, zs);
- /* It is easier to mask what's left.. */
- rmesa->hw.zs.cmd[R300_ZS_CNTL_1] &=
- (R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT) |
- (R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) |
- (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT);
-
- rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
- (translate_stencil_op(ctx->Stencil.FailFunc[0]) << R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT)
- |(translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT)
- |(translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT)
- |(translate_stencil_op(ctx->Stencil.FailFunc[0]) << R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT)
- |(translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT)
- |(translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT);
-}
-
-static void r300ClearStencil(GLcontext * ctx, GLint s)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- rmesa->state.stencil.clear =
- ((GLuint) ctx->Stencil.Clear |
- (R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_MASK_SHIFT) |
- (ctx->Stencil.WriteMask[0] << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT));
-}
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-/*
- * To correctly position primitives:
- */
-#define SUBPIXEL_X 0.125
-#define SUBPIXEL_Y 0.125
-
-static void r300UpdateWindow(GLcontext * ctx)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->radeon.dri.drawable;
- GLfloat xoffset = dPriv ? (GLfloat) dPriv->x : 0;
- GLfloat yoffset = dPriv ? (GLfloat) dPriv->y + dPriv->h : 0;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat sx = v[MAT_SX];
- GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
- GLfloat sy = -v[MAT_SY];
- GLfloat ty = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
- GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
- GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
-
- R300_FIREVERTICES(rmesa);
- R300_STATECHANGE(rmesa, vpt);
-
- rmesa->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(sx);
- rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx);
- rmesa->hw.vpt.cmd[R300_VPT_YSCALE] = r300PackFloat32(sy);
- rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty);
- rmesa->hw.vpt.cmd[R300_VPT_ZSCALE] = r300PackFloat32(sz);
- rmesa->hw.vpt.cmd[R300_VPT_ZOFFSET] = r300PackFloat32(tz);
-}
-
-static void r300Viewport(GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height)
-{
- /* Don't pipeline viewport changes, conflict with window offset
- * setting below. Could apply deltas to rescue pipelined viewport
- * values, or keep the originals hanging around.
- */
- R300_FIREVERTICES(R300_CONTEXT(ctx));
- r300UpdateWindow(ctx);
-}
-
-static void r300DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval)
-{
- r300UpdateWindow(ctx);
-}
-
-/* =============================================================
- * Polygon state
- */
-static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- GLfloat constant = units;
-
- switch (ctx->Visual.depthBits) {
- case 16:
- constant *= 4.0;
- break;
- case 24:
- constant *= 2.0;
- break;
- }
-
- factor *= 12.0;
-
-/* fprintf(stderr, "%s f:%f u:%f\n", __FUNCTION__, factor, constant); */
-
- R300_STATECHANGE(rmesa, zbs);
- rmesa->hw.zbs.cmd[R300_ZBS_T_FACTOR] = r300PackFloat32(factor);
- rmesa->hw.zbs.cmd[R300_ZBS_T_CONSTANT] = r300PackFloat32(constant);
- rmesa->hw.zbs.cmd[R300_ZBS_W_FACTOR] = r300PackFloat32(factor);
- rmesa->hw.zbs.cmd[R300_ZBS_W_CONSTANT] = r300PackFloat32(constant);
-}
-
-/* Routing and texture-related */
-
-static r300TexObj default_tex_obj={
- filter:R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR,
- pitch: 0x8000,
- size: (0xff << R300_TX_WIDTHMASK_SHIFT)
- | (0xff << R300_TX_HEIGHTMASK_SHIFT)
- | (0x8 << R300_TX_SIZE_SHIFT),
- format: 0x88a0c,
- offset: 0x0,
- unknown4: 0x0,
- unknown5: 0x0
- };
-
- /* there is probably a system to these value, but, for now,
- we just try by hand */
-
-static int inline translate_src(int src)
-{
- switch (src) {
- case GL_TEXTURE:
- return 1;
- break;
- case GL_CONSTANT:
- return 2;
- break;
- case GL_PRIMARY_COLOR:
- return 3;
- break;
- case GL_PREVIOUS:
- return 4;
- break;
- case GL_ZERO:
- return 5;
- break;
- case GL_ONE:
- return 6;
- break;
- default:
- return 0;
- }
-}
-
-/* r300 doesnt handle GL_CLAMP and GL_MIRROR_CLAMP_EXT correctly when filter is NEAREST.
- * Since texwrap produces same results for GL_CLAMP and GL_CLAMP_TO_EDGE we use them instead.
- * We need to recalculate wrap modes whenever filter mode is changed because someone might do:
- * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- * Since r300 completely ignores R300_TX_CLAMP when either min or mag is nearest it cant handle
- * combinations where only one of them is nearest.
- */
-static unsigned long gen_fixed_filter(unsigned long f)
-{
- unsigned long mag, min, needs_fixing=0;
- //return f;
-
- /* We ignore MIRROR bit so we dont have to do everything twice */
- if((f & ((7-1) << R300_TX_WRAP_S_SHIFT)) == (R300_TX_CLAMP << R300_TX_WRAP_S_SHIFT)){
- needs_fixing |= 1;
- }
- if((f & ((7-1) << R300_TX_WRAP_T_SHIFT)) == (R300_TX_CLAMP << R300_TX_WRAP_T_SHIFT)){
- needs_fixing |= 2;
- }
- if((f & ((7-1) << R300_TX_WRAP_Q_SHIFT)) == (R300_TX_CLAMP << R300_TX_WRAP_Q_SHIFT)){
- needs_fixing |= 4;
- }
-
- if(!needs_fixing)
- return f;
-
- mag=f & R300_TX_MAG_FILTER_MASK;
- min=f & R300_TX_MIN_FILTER_MASK;
-
- /* TODO: Check for anisto filters too */
- if((mag != R300_TX_MAG_FILTER_NEAREST) && (min != R300_TX_MIN_FILTER_NEAREST))
- return f;
-
- /* r300 cant handle these modes hence we force nearest to linear */
- if((mag == R300_TX_MAG_FILTER_NEAREST) && (min != R300_TX_MIN_FILTER_NEAREST)){
- f &= ~R300_TX_MAG_FILTER_NEAREST;
- f |= R300_TX_MAG_FILTER_LINEAR;
- return f;
- }
-
- if((min == R300_TX_MIN_FILTER_NEAREST) && (mag != R300_TX_MAG_FILTER_NEAREST)){
- f &= ~R300_TX_MIN_FILTER_NEAREST;
- f |= R300_TX_MIN_FILTER_LINEAR;
- return f;
- }
-
- /* Both are nearest */
- if(needs_fixing & 1){
- f &= ~((7-1) << R300_TX_WRAP_S_SHIFT);
- f |= R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_S_SHIFT;
- }
- if(needs_fixing & 2){
- f &= ~((7-1) << R300_TX_WRAP_T_SHIFT);
- f |= R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_T_SHIFT;
- }
- if(needs_fixing & 4){
- f &= ~((7-1) << R300_TX_WRAP_Q_SHIFT);
- f |= R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_Q_SHIFT;
- }
- return f;
-}
-
-void r300_setup_textures(GLcontext *ctx)
-{
- int i, mtu;
- struct r300_tex_obj *t;
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- int max_texture_unit=-1; /* -1 translates into no setup costs for fields */
- struct gl_texture_unit *texUnit;
- GLuint OutputsWritten;
-
- if(hw_tcl_on)
- OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->OutputsWritten;
-
- R300_STATECHANGE(r300, txe);
- R300_STATECHANGE(r300, tex.filter);
- R300_STATECHANGE(r300, tex.unknown1);
- R300_STATECHANGE(r300, tex.size);
- R300_STATECHANGE(r300, tex.format);
- R300_STATECHANGE(r300, tex.offset);
- R300_STATECHANGE(r300, tex.unknown4);
- R300_STATECHANGE(r300, tex.border_color);
-
- r300->hw.txe.cmd[R300_TXE_ENABLE]=0x0;
-
- mtu = r300->radeon.glCtx->Const.MaxTextureUnits;
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "mtu=%d\n", mtu);
-
- if(mtu > R300_MAX_TEXTURE_UNITS) {
- fprintf(stderr, "Aiiee ! mtu=%d is greater than R300_MAX_TEXTURE_UNITS=%d\n",
- mtu, R300_MAX_TEXTURE_UNITS);
- exit(-1);
- }
-
- for(i=0; i < mtu; i++) {
- /*if( ((r300->state.render_inputs & (_TNL_BIT_TEX0<<i))!=0) != ((ctx->Texture.Unit[i].Enabled)!=0) ) {
- WARN_ONCE("Mismatch between render_inputs and ctx->Texture.Unit[i].Enabled value(%d vs %d).\n",
- ((r300->state.render_inputs & (_TNL_BIT_TEX0<<i))!=0), ((ctx->Texture.Unit[i].Enabled)!=0));
- }*/
-
- if(TMU_ENABLED(ctx, i)) {
- t=r300->state.texture.unit[i].texobj;
- //fprintf(stderr, "format=%08x\n", r300->state.texture.unit[i].format);
-
- if(t == NULL){
- fprintf(stderr, "Texture unit %d enabled, but corresponding texobj is NULL, using default object.\n", i);
- //exit(-1);
- t=&default_tex_obj;
- }
-
- //fprintf(stderr, "t->format=%08x\n", t->format);
- if((t->format & 0xffffff00)==0xffffff00) {
- WARN_ONCE("unknown texture format (entry %x) encountered. Help me !\n", t->format & 0xff);
- //fprintf(stderr, "t->format=%08x\n", t->format);
- }
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Activating texture unit %d\n", i);
- max_texture_unit=i;
- r300->hw.txe.cmd[R300_TXE_ENABLE]|=(1<<i);
-
- r300->hw.tex.filter.cmd[R300_TEX_VALUE_0+i]=gen_fixed_filter(t->filter) | (i << 28);
- //r300->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+i]=0x0; /* move lod bias here? */
-
- /* No idea why linear filtered textures shake when puting random data */
- /*r300->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+i]=(rand()%0xffffffff) & (~0x1fff);*/
- r300->hw.tex.size.cmd[R300_TEX_VALUE_0+i]=t->size;
- r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=t->format;
- //fprintf(stderr, "t->format=%08x\n", t->format);
- r300->hw.tex.offset.cmd[R300_TEX_VALUE_0+i]=t->offset;
- r300->hw.tex.unknown4.cmd[R300_TEX_VALUE_0+i]=0x0;
- r300->hw.tex.border_color.cmd[R300_TEX_VALUE_0+i]=t->pp_border_color;
- }
- }
-
- ((drm_r300_cmd_header_t*)r300->hw.tex.filter.cmd)->packet0.count = max_texture_unit+1;
- ((drm_r300_cmd_header_t*)r300->hw.tex.unknown1.cmd)->packet0.count = max_texture_unit+1;
- ((drm_r300_cmd_header_t*)r300->hw.tex.size.cmd)->packet0.count = max_texture_unit+1;
- ((drm_r300_cmd_header_t*)r300->hw.tex.format.cmd)->packet0.count = max_texture_unit+1;
- ((drm_r300_cmd_header_t*)r300->hw.tex.offset.cmd)->packet0.count = max_texture_unit+1;
- ((drm_r300_cmd_header_t*)r300->hw.tex.unknown4.cmd)->packet0.count = max_texture_unit+1;
- ((drm_r300_cmd_header_t*)r300->hw.tex.border_color.cmd)->packet0.count = max_texture_unit+1;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "TX_ENABLE: %08x max_texture_unit=%d\n", r300->hw.txe.cmd[R300_TXE_ENABLE], max_texture_unit);
-}
-
-#if USE_ARB_F_P == 1
-void r300_setup_rs_unit(GLcontext *ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- /* I'm still unsure if these are needed */
- GLuint interp_magic[8] = {
- 0x00,
- 0x40,
- 0x80,
- 0xC0,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- };
- GLuint OutputsWritten;
- GLuint InputsRead;
- int vp_reg, fp_reg, high_rr;
- int in_texcoords, col_interp_nr;
- int i;
-
- if(hw_tcl_on)
- OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->OutputsWritten;
- else
- OutputsWritten = r300->state.render_inputs;
-
- if (ctx->FragmentProgram._Current)
- InputsRead = ctx->FragmentProgram._Current->InputsRead;
- else {
- fprintf(stderr, "No ctx->FragmentProgram._Current!!\n");
- return; /* This should only ever happen once.. */
- }
-
- R300_STATECHANGE(r300, ri);
- R300_STATECHANGE(r300, rc);
- R300_STATECHANGE(r300, rr);
-
- vp_reg = fp_reg = in_texcoords = col_interp_nr = high_rr = 0;
- r300->hw.rr.cmd[R300_RR_ROUTE_0] = 0;
- r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0;
-
- for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
- if (OutputsWritten & (hw_tcl_on ? (1 << (VERT_RESULT_TEX0+i)) : (_TNL_BIT_TEX0<<i)))
- in_texcoords++;
-
- r300->hw.ri.cmd[R300_RI_INTERP_0+i] = 0
- | R300_RS_INTERP_USED
- | (vp_reg << R300_RS_INTERP_SRC_SHIFT)
- | interp_magic[i];
-
- if (InputsRead & (FRAG_BIT_TEX0<<i)) {
- //assert(r300->state.texture.tc_count != 0);
- r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0
- | R300_RS_ROUTE_ENABLE
- | i /* source INTERP */
- | (fp_reg << R300_RS_ROUTE_DEST_SHIFT);
- high_rr = fp_reg;
-
- if (OutputsWritten & (hw_tcl_on ? (1 << (VERT_RESULT_TEX0+i)) : (_TNL_BIT_TEX0<<i))) {
- vp_reg++;
- } else {
- /* Unsure of how to handle this situation, for now print errors and
- * the program will just recieve bogus data
- */
- fprintf(stderr, "fragprog wants coords for tex%d, vp doesn't provide them!\n", i);
- }
- InputsRead &= ~(FRAG_BIT_TEX0<<i);
- fp_reg++;
- }
- }
-
- if (InputsRead & FRAG_BIT_COL0) {
- if (!(OutputsWritten & (hw_tcl_on ? (1<<VERT_RESULT_COL0) : _TNL_BIT_COLOR0)))
- fprintf(stderr, "fragprog wants col0, vp doesn't provide it\n");
-
- r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0
- | R300_RS_ROUTE_0_COLOR
- | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
- InputsRead &= ~FRAG_BIT_COL0;
- col_interp_nr++;
- }
-
- if (InputsRead & FRAG_BIT_COL1) {
- if (!(OutputsWritten & (hw_tcl_on ? (1<<VERT_RESULT_COL1) : _TNL_BIT_COLOR1)))
- fprintf(stderr, "fragprog wants col1, vp doesn't provide it\n");
-
- r300->hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11
- | R300_RS_ROUTE_1_COLOR1
- | (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT);
- InputsRead &= ~FRAG_BIT_COL1;
- if (high_rr < 1) high_rr = 1;
- col_interp_nr++;
- }
-
- r300->hw.rc.cmd[1] = 0
- | (in_texcoords << R300_RS_CNTL_TC_CNT_SHIFT)
- | (col_interp_nr << R300_RS_CNTL_CI_CNT_SHIFT)
- | R300_RS_CNTL_0_UNKNOWN_18;
-
- assert(high_rr >= 0);
- r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, high_rr+1);
- r300->hw.rc.cmd[2] = 0xC0 | high_rr;
-
- if (InputsRead)
- WARN_ONCE("Don't know how to satisfy InputsRead=0x%08x\n", InputsRead);
-}
-#else
-void r300_setup_rs_unit(GLcontext *ctx)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
- int i, cur_reg;
- /* I'm still unsure if these are needed */
- GLuint interp_magic[8] = {
- 0x00,
- 0x40,
- 0x80,
- 0xC0,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- };
- GLuint OutputsWritten;
-
- if(hw_tcl_on)
- OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->OutputsWritten;
-
- /* This needs to be rewritten - it is a hack at best */
-
- R300_STATECHANGE(r300, ri);
- R300_STATECHANGE(r300, rc);
- R300_STATECHANGE(r300, rr);
-
- cur_reg = 0;
- r300->hw.rr.cmd[R300_RR_ROUTE_0] = 0;
-
- for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
- r300->hw.ri.cmd[R300_RI_INTERP_0+i] = 0
- | R300_RS_INTERP_USED
- | (cur_reg << R300_RS_INTERP_SRC_SHIFT)
- | interp_magic[i];
-// fprintf(stderr, "RS_INTERP[%d] = 0x%x\n", i, r300->hw.ri.cmd[R300_RI_INTERP_0+i]);
-
- if (TMU_ENABLED(ctx, i)) {
- assert(r300->state.texture.tc_count != 0);
- r300->hw.rr.cmd[R300_RR_ROUTE_0 + cur_reg] = 0
- | R300_RS_ROUTE_ENABLE
- | i /* source INTERP */
- | (cur_reg << R300_RS_ROUTE_DEST_SHIFT);
-// fprintf(stderr, "RS_ROUTE[%d] = 0x%x\n", cur_reg, r300->hw.rr.cmd[R300_RR_ROUTE_0 + cur_reg]);
- cur_reg++;
- }
- }
- if (hw_tcl_on ? OutputsWritten & (1<<VERT_RESULT_COL0) : r300->state.render_inputs & _TNL_BIT_COLOR0)
- r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0
- | R300_RS_ROUTE_0_COLOR
- | (cur_reg << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
-
-// fprintf(stderr, "ADJ_RR0 = 0x%x\n", r300->hw.rr.cmd[R300_RR_ROUTE_0]);
-
- r300->hw.rc.cmd[1] = 0
- | (cur_reg /* count */ << R300_RS_CNTL_TC_CNT_SHIFT)
- | R300_RS_CNTL_0_UNKNOWN_7
- | R300_RS_CNTL_0_UNKNOWN_18;
-
- if (r300->state.texture.tc_count > 0) {
- r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, cur_reg);
- r300->hw.rc.cmd[2] = 0xC0 | (cur_reg-1); /* index of highest */
- } else {
- r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1);
- r300->hw.rc.cmd[2] = 0x0;
- }
-
-
-// fprintf(stderr, "rendering with %d texture co-ordinate sets\n", cur_reg);
-}
-#endif // USE_ARB_F_P
-
-#define vpucount(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count)
-
-#define bump_vpu_count(ptr, new_count) do{\
- drm_r300_cmd_header_t* _p=((drm_r300_cmd_header_t*)(ptr));\
- int _nc=(new_count)/4; \
- if(_nc>_p->vpu.count)_p->vpu.count=_nc;\
- }while(0)
-
-void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf)
-{
- int i;
-
- if(vsf->length==0)return;
-
- if(vsf->length & 0x3){
- fprintf(stderr,"VERTEX_SHADER_FRAGMENT must have length divisible by 4\n");
- exit(-1);
- }
-
- switch((dest>>8) & 0xf){
- case 0:
- R300_STATECHANGE(r300, vpi);
- for(i=0;i<vsf->length;i++)
- r300->hw.vpi.cmd[R300_VPI_INSTR_0+i+4*(dest & 0xff)]=(vsf->body.d[i]);
- bump_vpu_count(r300->hw.vpi.cmd, vsf->length+4*(dest & 0xff));
- break;
-
- case 2:
- R300_STATECHANGE(r300, vpp);
- for(i=0;i<vsf->length;i++)
- r300->hw.vpp.cmd[R300_VPP_PARAM_0+i+4*(dest & 0xff)]=(vsf->body.d[i]);
- bump_vpu_count(r300->hw.vpp.cmd, vsf->length+4*(dest & 0xff));
- break;
- case 4:
- R300_STATECHANGE(r300, vps);
- for(i=0;i<vsf->length;i++)
- r300->hw.vps.cmd[1+i+4*(dest & 0xff)]=(vsf->body.d[i]);
- bump_vpu_count(r300->hw.vps.cmd, vsf->length+4*(dest & 0xff));
- break;
- default:
- fprintf(stderr, "%s:%s don't know how to handle dest %04x\n", __FILE__, __FUNCTION__, dest);
- exit(-1);
- }
-}
-
-void r300SetupVertexProgram(r300ContextPtr rmesa);
-
-/* just a skeleton for now.. */
-
-/* Generate a vertex shader that simply transforms vertex and texture coordinates,
- while leaving colors intact. Nothing fancy (like lights)
-
- If implementing lights make a copy first, so it is easy to switch between the two versions */
-static void r300GenerateSimpleVertexShader(r300ContextPtr r300)
-{
- int i;
- GLuint o_reg = 0;
-
- /* Allocate parameters */
- r300->state.vap_param.transform_offset=0x0; /* transform matrix */
- r300->state.vertex_shader.param_offset=0x0;
- r300->state.vertex_shader.param_count=0x4; /* 4 vector values - 4x4 matrix */
-
- r300->state.vertex_shader.program_start=0x0;
- r300->state.vertex_shader.unknown_ptr1=0x4; /* magic value ? */
- r300->state.vertex_shader.program_end=0x0;
-
- r300->state.vertex_shader.unknown_ptr2=0x0; /* magic value */
- r300->state.vertex_shader.unknown_ptr3=0x4; /* magic value */
-
- /* Initialize matrix and vector parameters.. these should really be restructured */
- /* TODO: fix vertex_shader structure */
- r300->state.vertex_shader.matrix[0].length=16;
- r300->state.vertex_shader.matrix[1].length=0;
- r300->state.vertex_shader.matrix[2].length=0;
- r300->state.vertex_shader.vector[0].length=0;
- r300->state.vertex_shader.vector[1].length=0;
- r300->state.vertex_shader.unknown1.length=0;
- r300->state.vertex_shader.unknown2.length=0;
-
-#define WRITE_OP(oper,source1,source2,source3) {\
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].op=(oper); \
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src1=(source1); \
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src2=(source2); \
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src3=(source3); \
- r300->state.vertex_shader.program_end++; \
- }
-
- /* Multiply vertex coordinates with transform matrix */
-
- WRITE_OP(
- EASY_VSF_OP(MUL, 0, ALL, TMP),
- VSF_PARAM(3),
- VSF_ATTR_W(0),
- EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE)
- )
-
- WRITE_OP(
- EASY_VSF_OP(MUL, 1, ALL, RESULT),
- VSF_REG(1),
- VSF_ATTR_UNITY(1),
- VSF_UNITY(1)
- )
-
- WRITE_OP(
- EASY_VSF_OP(MAD, 0, ALL, TMP),
- VSF_PARAM(2),
- VSF_ATTR_Z(0),
- VSF_TMP(0)
- )
-
- WRITE_OP(
- EASY_VSF_OP(MAD, 0, ALL, TMP),
- VSF_PARAM(1),
- VSF_ATTR_Y(0),
- VSF_TMP(0)
- )
-
- WRITE_OP(
- EASY_VSF_OP(MAD, 0, ALL, RESULT),
- VSF_PARAM(0),
- VSF_ATTR_X(0),
- VSF_TMP(0)
- )
- o_reg += 2;
-
- if (r300->state.render_inputs & _TNL_BIT_COLOR1) {
- WRITE_OP(
- EASY_VSF_OP(MUL, o_reg++, ALL, RESULT),
- VSF_REG(r300->state.vap_reg.i_color[1]),
- VSF_ATTR_UNITY(r300->state.vap_reg.i_color[1]),
- VSF_UNITY(r300->state.vap_reg.i_color[1])
- )
- }
-
- /* Pass through texture coordinates, if any */
- for(i=0;i < r300->radeon.glCtx->Const.MaxTextureUnits;i++)
- if(r300->state.render_inputs & (_TNL_BIT_TEX0<<i)){
- // fprintf(stderr, "i_tex[%d]=%d\n", i, r300->state.vap_reg.i_tex[i]);
- WRITE_OP(
- EASY_VSF_OP(MUL, o_reg++ /* 2+i */, ALL, RESULT),
- VSF_REG(r300->state.vap_reg.i_tex[i]),
- VSF_ATTR_UNITY(r300->state.vap_reg.i_tex[i]),
- VSF_UNITY(r300->state.vap_reg.i_tex[i])
- )
- }
-
- r300->state.vertex_shader.program_end--; /* r300 wants program length to be one more - no idea why */
- r300->state.vertex_shader.program.length=(r300->state.vertex_shader.program_end+1)*4;
-
- r300->state.vertex_shader.unknown_ptr1=r300->state.vertex_shader.program_end; /* magic value ? */
- r300->state.vertex_shader.unknown_ptr2=r300->state.vertex_shader.program_end; /* magic value ? */
- r300->state.vertex_shader.unknown_ptr3=r300->state.vertex_shader.program_end; /* magic value ? */
-
-}
-
-
-void r300SetupVertexShader(r300ContextPtr rmesa)
-{
- GLcontext* ctx = rmesa->radeon.glCtx;
- struct r300_vertex_shader_fragment unk4={
- length: 4,
- body: { f: {
- /*0.0*/(rand()%100)/10.0,
- /*0.0*/(rand()%100)/10.0,
- /*1.0*/(rand()%100)/10.0,
- /*0.0*/(rand()%100)/10.0
- } }
- };
- LOCAL_VARS
-
- /* Reset state, in case we don't use something */
- ((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0;
- ((drm_r300_cmd_header_t*)rmesa->hw.vpi.cmd)->vpu.count = 0;
- ((drm_r300_cmd_header_t*)rmesa->hw.vps.cmd)->vpu.count = 0;
-
- /* Not sure why this doesnt work...
- 0x400 area might have something to do with pixel shaders as it appears right after pfs programming.
- 0x406 is set to { 0.0, 0.0, 1.0, 0.0 } most of the time but should change with smooth points and in other rare cases. */
- //setup_vertex_shader_fragment(rmesa, 0x406, &unk4);
- if(hw_tcl_on && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))->translated){
- r300SetupVertexProgram(rmesa);
- return ;
- }
-
-/* This needs to be replaced by vertex shader generation code */
-
-
-#if 0
- /* textures enabled ? */
- if(rmesa->state.texture.tc_count>0){
- rmesa->state.vertex_shader=SINGLE_TEXTURE_VERTEX_SHADER;
- } else {
- rmesa->state.vertex_shader=FLAT_COLOR_VERTEX_SHADER;
- }
-#endif
-
- r300GenerateSimpleVertexShader(rmesa);
-
- rmesa->state.vertex_shader.matrix[0].length=16;
- memcpy(rmesa->state.vertex_shader.matrix[0].body.f, ctx->_ModelProjectMatrix.m, 16*4);
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program));
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX0, &(rmesa->state.vertex_shader.matrix[0]));
-#if 0
- setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX1, &(rmesa->state.vertex_shader.matrix[0]));
- setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX2, &(rmesa->state.vertex_shader.matrix[0]));
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_VECTOR0, &(rmesa->state.vertex_shader.vector[0]));
- setup_vertex_shader_fragment(rmesa, VSF_DEST_VECTOR1, &(rmesa->state.vertex_shader.vector[1]));
-#endif
-
-#if 0
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1));
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2));
-#endif
-
- R300_STATECHANGE(rmesa, pvs);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_1]=(rmesa->state.vertex_shader.program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT)
- | (rmesa->state.vertex_shader.unknown_ptr1 << R300_PVS_CNTL_1_POS_END_SHIFT)
- | (rmesa->state.vertex_shader.program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_2]=(rmesa->state.vertex_shader.param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT)
- | (rmesa->state.vertex_shader.param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_3]=(rmesa->state.vertex_shader.unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT)
- | (rmesa->state.vertex_shader.unknown_ptr3 << 0);
-
- /* This is done for vertex shader fragments, but also needs to be done for vap_pvs,
- so I leave it as a reminder */
-#if 0
- reg_start(R300_VAP_PVS_WAITIDLE,0);
- e32(0x00000000);
-#endif
-}
-
-void r300SetupVertexProgram(r300ContextPtr rmesa)
-{
- GLcontext* ctx = rmesa->radeon.glCtx;
- int inst_count;
- int param_count;
- LOCAL_VARS
- struct r300_vertex_program *prog=(struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
-
-
- /* Reset state, in case we don't use something */
- ((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0;
- ((drm_r300_cmd_header_t*)rmesa->hw.vpi.cmd)->vpu.count = 0;
- ((drm_r300_cmd_header_t*)rmesa->hw.vps.cmd)->vpu.count = 0;
-
- r300VertexProgUpdateParams(ctx, prog);
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(prog->program));
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX0, &(prog->params));
-
-#if 0
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, &(rmesa->state.vertex_shader.unknown1));
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, &(rmesa->state.vertex_shader.unknown2));
-#endif
-
- inst_count=prog->program.length/4 - 1;
- param_count=prog->params.length/4;
-
- R300_STATECHANGE(rmesa, pvs);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_1]=(0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT)
- | (inst_count/*pos_end*/ << R300_PVS_CNTL_1_POS_END_SHIFT)
- | (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_2]=(0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT)
- | (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_3]=(0/*rmesa->state.vertex_shader.unknown_ptr2*/ << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT)
- | (inst_count /*rmesa->state.vertex_shader.unknown_ptr3*/ << 0);
-
- /* This is done for vertex shader fragments, but also needs to be done for vap_pvs,
- so I leave it as a reminder */
-#if 0
- reg_start(R300_VAP_PVS_WAITIDLE,0);
- e32(0x00000000);
-#endif
-}
-
-/* This is probably wrong for some values, I need to test this
- * some more. Range checking would be a good idea also..
- *
- * But it works for most things. I'll fix it later if someone
- * else with a better clue doesn't
- */
-static unsigned int r300PackFloat24(float f)
-{
- float mantissa;
- int exponent;
- unsigned int float24 = 0;
-
- if (f == 0.0) return 0;
-
- mantissa = frexpf(f, &exponent);
-
- /* Handle -ve */
- if (mantissa < 0) {
- float24 |= (1<<23);
- mantissa = mantissa * -1.0;
- }
- /* Handle exponent, bias of 63 */
- exponent += 62;
- float24 |= (exponent << 16);
- /* Kill 7 LSB of mantissa */
- float24 |= (r300PackFloat32(mantissa) & 0x7FFFFF) >> 7;
-
- return float24;
-}
-
-#if USE_ARB_F_P == 1
-void r300SetupPixelShader(r300ContextPtr rmesa)
-{
- GLcontext *ctx = rmesa->radeon.glCtx;
- struct r300_fragment_program *rp =
- (struct r300_fragment_program *)ctx->FragmentProgram._Current;
- int i,k;
-
- if (!rp) /* should only happenen once, just after context is created */
- return;
-
- translate_fragment_shader(rp);
- if (!rp->translated) {
- fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__);
- exit(-1);
- }
-
- R300_STATECHANGE(rmesa, fpt);
- for(i=0;i<rp->tex.length;i++)
- rmesa->hw.fpt.cmd[R300_FPT_INSTR_0+i]=rp->tex.inst[i];
- rmesa->hw.fpt.cmd[R300_FPT_CMD_0]=cmdpacket0(R300_PFS_TEXI_0, rp->tex.length);
-
-#define OUTPUT_FIELD(st, reg, field) \
- R300_STATECHANGE(rmesa, st); \
- for(i=0;i<=rp->alu_end;i++) \
- rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=rp->alu.inst[i].field;\
- rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, rp->alu_end+1);
-
- OUTPUT_FIELD(fpi[0], R300_PFS_INSTR0_0, inst0);
- OUTPUT_FIELD(fpi[1], R300_PFS_INSTR1_0, inst1);
- OUTPUT_FIELD(fpi[2], R300_PFS_INSTR2_0, inst2);
- OUTPUT_FIELD(fpi[3], R300_PFS_INSTR3_0, inst3);
-#undef OUTPUT_FIELD
-
- R300_STATECHANGE(rmesa, fp);
- /* I just want to say, the way these nodes are stored.. weird.. */
- for (i=0,k=(4-(rp->cur_node+1));i<4;i++,k++) {
- if (i<(rp->cur_node+1)) {
- rmesa->hw.fp.cmd[R300_FP_NODE0+k]=
- (rp->node[i].alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT)
- | (rp->node[i].alu_end << R300_PFS_NODE_ALU_END_SHIFT)
- | (rp->node[i].tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT)
- | (rp->node[i].tex_end << R300_PFS_NODE_TEX_END_SHIFT)
- | ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0);
- } else {
- rmesa->hw.fp.cmd[R300_FP_NODE0+(3-i)] = 0;
- }
- }
-
- /* PFS_CNTL_0 */
- rmesa->hw.fp.cmd[R300_FP_CNTL0]=
- rp->cur_node
- | (rp->first_node_has_tex<<3);
- /* PFS_CNTL_1 */
- rmesa->hw.fp.cmd[R300_FP_CNTL1]=rp->max_temp_idx;
- /* PFS_CNTL_2 */
- rmesa->hw.fp.cmd[R300_FP_CNTL2]=
- (rp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT)
- | (rp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT)
- | (rp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT)
- | (rp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT);
-
- R300_STATECHANGE(rmesa, fpp);
- for(i=0;i<rp->const_nr;i++){
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+0]=r300PackFloat24(rp->constant[i][0]);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+1]=r300PackFloat24(rp->constant[i][1]);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+2]=r300PackFloat24(rp->constant[i][2]);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+3]=r300PackFloat24(rp->constant[i][3]);
- }
- rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmdpacket0(R300_PFS_PARAM_0_X, rp->const_nr*4);
-}
-#else
-/* just a skeleton for now.. */
-void r300GenerateTexturePixelShader(r300ContextPtr r300)
-{
- int i, mtu;
- mtu = r300->radeon.glCtx->Const.MaxTextureUnits;
- GLenum envMode;
- GLuint OutputsWritten = CURRENT_VERTEX_SHADER(r300->radeon.glCtx)->OutputsWritten;
-
- int tex_inst=0, alu_inst=0;
-
- for(i=0;i<mtu;i++){
- /* No need to proliferate {} */
- if(!TMU_ENABLED(r300->radeon.glCtx, i))continue;
-
- envMode = r300->radeon.glCtx->Texture.Unit[i].EnvMode;
- //fprintf(stderr, "envMode=%s\n", _mesa_lookup_enum_by_nr(envMode));
-
- /* Fetch textured pixel */
-
- r300->state.pixel_shader.program.tex.inst[tex_inst]=0x00018000;
- tex_inst++;
-
- switch(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->ModeRGB){
- case GL_REPLACE:
- WARN_ONCE("ModeA==GL_REPLACE is possibly broken.\n");
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst0=
- EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO);
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst1=
- EASY_PFS_INSTR1(0, 0, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, NONE, ALL);
- break;
- case GL_MODULATE:
- WARN_ONCE("ModeRGB==GL_MODULATE is possibly broken.\n");
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst0=
- EASY_PFS_INSTR0(MAD, SRC0C_XYZ, SRC1C_XYZ, ZERO);
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst1=
- EASY_PFS_INSTR1(0, 0, 1, 0 | PFS_FLAG_CONST, NONE, ALL);
-
- break;
- default:
- WARN_ONCE("ModeRGB=%s is not implemented yet !\n",
- _mesa_lookup_enum_by_nr(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->ModeRGB));
- /* PFS_NOP */
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst0=
- EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO);
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst1=
- EASY_PFS_INSTR1(0, 0, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, NONE, ALL);
- }
- switch(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->ModeA){
- case GL_REPLACE:
- WARN_ONCE("ModeA==GL_REPLACE is possibly broken.\n");
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst2=
- EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO);
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst3=
- EASY_PFS_INSTR3(0, 0, 0| PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, OUTPUT);
-
-#if 0
- fprintf(stderr, "numArgsA=%d sourceA[0]=%s op=%d\n",
- r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->_NumArgsA,
- _mesa_lookup_enum_by_nr(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->SourceA[0]),
- r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->OperandA[0]-GL_SRC_ALPHA);
-#endif
- break;
- case GL_MODULATE:
- WARN_ONCE("ModeA==GL_MODULATE is possibly broken.\n");
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst2=
- EASY_PFS_INSTR2(MAD, SRC0A, SRC1A, ZERO);
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst3=
- EASY_PFS_INSTR3(0, 0, 1, 0 | PFS_FLAG_CONST, OUTPUT);
-
- break;
- default:
- WARN_ONCE("ModeA=%s is not implemented yet !\n",
- _mesa_lookup_enum_by_nr(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->ModeA));
- /* PFS_NOP */
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst2=
- EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO);
-
- r300->state.pixel_shader.program.alu.inst[alu_inst].inst3=
- EASY_PFS_INSTR3(0, 0, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, OUTPUT);
-
- }
-
- alu_inst++;
- }
-
- r300->state.pixel_shader.program.tex.length=tex_inst;
- r300->state.pixel_shader.program.tex_offset=0;
- r300->state.pixel_shader.program.tex_end=tex_inst-1;
-
-#if 0
- /* saturate last instruction, like i915 driver does */
- r300->state.pixel_shader.program.alu.inst[alu_inst-1].inst0|=R300_FPI0_OUTC_SAT;
- r300->state.pixel_shader.program.alu.inst[alu_inst-1].inst2|=R300_FPI2_OUTA_SAT;
-#endif
-
- r300->state.pixel_shader.program.alu.length=alu_inst;
- r300->state.pixel_shader.program.alu_offset=0;
- r300->state.pixel_shader.program.alu_end=alu_inst-1;
-}
-
-void r300SetupPixelShader(r300ContextPtr rmesa)
-{
-int i,k;
-
- /* This needs to be replaced by pixel shader generation code */
-
- /* textures enabled ? */
- if(rmesa->state.texture.tc_count>0){
-#if 1
- r300GenerateTextureFragmentShader(rmesa);
-#else
- rmesa->state.pixel_shader=SINGLE_TEXTURE_PIXEL_SHADER;
- r300GenerateTexturePixelShader(rmesa);
-#endif
- } else {
- rmesa->state.pixel_shader=FLAT_COLOR_PIXEL_SHADER;
- }
-
- R300_STATECHANGE(rmesa, fpt);
- for(i=0;i<rmesa->state.pixel_shader.program.tex.length;i++)
- rmesa->hw.fpt.cmd[R300_FPT_INSTR_0+i]=rmesa->state.pixel_shader.program.tex.inst[i];
- rmesa->hw.fpt.cmd[R300_FPT_CMD_0]=cmdpacket0(R300_PFS_TEXI_0, rmesa->state.pixel_shader.program.tex.length);
-
-#define OUTPUT_FIELD(st, reg, field) \
- R300_STATECHANGE(rmesa, st); \
- for(i=0;i<rmesa->state.pixel_shader.program.alu.length;i++) \
- rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=rmesa->state.pixel_shader.program.alu.inst[i].field;\
- rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, rmesa->state.pixel_shader.program.alu.length);
-
- OUTPUT_FIELD(fpi[0], R300_PFS_INSTR0_0, inst0);
- OUTPUT_FIELD(fpi[1], R300_PFS_INSTR1_0, inst1);
- OUTPUT_FIELD(fpi[2], R300_PFS_INSTR2_0, inst2);
- OUTPUT_FIELD(fpi[3], R300_PFS_INSTR3_0, inst3);
-#undef OUTPUT_FIELD
-
- R300_STATECHANGE(rmesa, fp);
- for(i=0;i<4;i++){
- rmesa->hw.fp.cmd[R300_FP_NODE0+i]=
- (rmesa->state.pixel_shader.program.node[i].alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT)
- | (rmesa->state.pixel_shader.program.node[i].alu_end << R300_PFS_NODE_ALU_END_SHIFT)
- | (rmesa->state.pixel_shader.program.node[i].tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT)
- | (rmesa->state.pixel_shader.program.node[i].tex_end << R300_PFS_NODE_TEX_END_SHIFT)
- | ( (i==3) ? R300_PFS_NODE_LAST_NODE : 0);
- }
-
- /* PFS_CNTL_0 */
- rmesa->hw.fp.cmd[R300_FP_CNTL0]=
- (rmesa->state.pixel_shader.program.active_nodes-1)
- | (rmesa->state.pixel_shader.program.first_node_has_tex<<3);
- /* PFS_CNTL_1 */
- rmesa->hw.fp.cmd[R300_FP_CNTL1]=rmesa->state.pixel_shader.program.temp_register_count;
- /* PFS_CNTL_2 */
- rmesa->hw.fp.cmd[R300_FP_CNTL2]=
- (rmesa->state.pixel_shader.program.alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT)
- | (rmesa->state.pixel_shader.program.alu_end << R300_PFS_CNTL_ALU_END_SHIFT)
- | (rmesa->state.pixel_shader.program.tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT)
- | (rmesa->state.pixel_shader.program.tex_end << R300_PFS_CNTL_TEX_END_SHIFT);
-
- R300_STATECHANGE(rmesa, fpp);
- for(i=0;i<rmesa->state.pixel_shader.param_length;i++){
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+0]=r300PackFloat32(rmesa->state.pixel_shader.param[i].x);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+1]=r300PackFloat32(rmesa->state.pixel_shader.param[i].y);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+2]=r300PackFloat32(rmesa->state.pixel_shader.param[i].z);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+3]=r300PackFloat32(rmesa->state.pixel_shader.param[i].w);
- }
- rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmdpacket0(R300_PFS_PARAM_0_X, rmesa->state.pixel_shader.param_length);
-
-}
-#endif
-
-/**
- * Called by Mesa after an internal state update.
- */
-static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
-{
- r300ContextPtr r300 = R300_CONTEXT(ctx);
-
- _swrast_InvalidateState(ctx, new_state);
- _swsetup_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
- _tnl_InvalidateState(ctx, new_state);
- _ae_invalidate_state(ctx, new_state);
-
- /* Go inefficiency! */
- r300ResetHwState(r300);
-}
-
-/* Checks that r300ResetHwState actually modifies all states.
- Should probably be burried in somewhere else as this file is getting longish. */
-static void verify_r300ResetHwState(r300ContextPtr r300, int stage)
-{
- struct r300_state_atom* atom;
- int i;
- drm_r300_cmd_header_t cmd;
-
- if(stage){ /* mess around with states */
- unsigned long fp1, cb1;
-
- fp1=r300->hw.fp.cmd[R300_FP_CMD_1]; /* some special cases... */
- cb1=r300->hw.cb.cmd[R300_CB_CMD_1];
-
- fprintf(stderr, "verify begin:\n");
-
- foreach(atom, &r300->hw.atomlist) {
- for(i=1; i < (*atom->check)(r300, atom); i++)
- atom->cmd[i]=0xdeadbeef;
- }
- r300->hw.fp.cmd[R300_FP_CMD_1]=fp1;
- r300->hw.cb.cmd[R300_CB_CMD_1]=cb1;
-
- foreach(atom, &r300->hw.atomlist) {
- cmd.u=atom->cmd[0];
- switch(cmd.header.cmd_type){
- case R300_CMD_PACKET0:
- case R300_CMD_VPU:
- case R300_CMD_PACKET3:
- case R300_CMD_END3D:
- case R300_CMD_CP_DELAY:
- case R300_CMD_DMA_DISCARD:
- break;
- default: fprintf(stderr, "unknown cmd_type %d in atom %s\n",
- cmd.header.cmd_type, atom->name);
- }
-
- }
- } else { /* check that they were set */
- foreach(atom, &r300->hw.atomlist) {
- for(i=1; i < (*atom->check)(r300, atom); i++)
- if(atom->cmd[i]==0xdeadbeef)
- fprintf(stderr, "atom %s is untouched\n", atom->name);
- }
- }
-}
-
-/**
- * Completely recalculates hardware state based on the Mesa state.
- */
-void r300ResetHwState(r300ContextPtr r300)
-{
- GLcontext* ctx = r300->radeon.glCtx;
- int i;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- //verify_r300ResetHwState(r300, 1);
-
- /* This is a place to initialize registers which
- have bitfields accessed by different functions
- and not all bits are used */
-#if 0
- /* initialize similiar to r200 */
- r300->hw.zs.cmd[R300_ZS_CNTL_0] = 0;
- r300->hw.zs.cmd[R300_ZS_CNTL_1] =
- (R300_ZS_ALWAYS << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) |
- (R300_ZS_KEEP << R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) |
- (R300_ZS_KEEP << R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT) |
- (R300_ZS_KEEP << R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) |
- (R300_ZS_ALWAYS << R300_RB3D_ZS1_BACK_FUNC_SHIFT) |
- (R300_ZS_KEEP << R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) |
- (R300_ZS_KEEP << R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT) |
- (R300_ZS_KEEP << R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT);
- r300->hw.zs.cmd[R300_ZS_CNTL_2] = 0x00ffff00;
-#endif
-
- /* go and compute register values from GL state */
-
- r300UpdateWindow(ctx);
-
- r300ColorMask(ctx,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP]);
-
- r300Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test);
- r300DepthMask(ctx, ctx->Depth.Mask);
- r300DepthFunc(ctx, ctx->Depth.Func);
-
- /* stencil */
- r300Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled);
- r300StencilMask(ctx, ctx->Stencil.WriteMask[0]);
- r300StencilFunc(ctx, ctx->Stencil.Function[0], ctx->Stencil.Ref[0], ctx->Stencil.ValueMask[0]);
- r300StencilOp(ctx, ctx->Stencil.FailFunc[0], ctx->Stencil.ZFailFunc[0], ctx->Stencil.ZPassFunc[0]);
-
- r300UpdateCulling(ctx);
-
- r300UpdateTextureState(ctx);
-
-// r300_setup_routing(ctx, GL_TRUE);
- if(hw_tcl_on == GL_FALSE){
- r300EmitArrays(ctx, GL_TRUE); /* Just do the routing */
- r300_setup_textures(ctx);
- r300_setup_rs_unit(ctx);
-
- r300SetupVertexShader(r300);
- r300SetupPixelShader(r300);
- }
-
- r300_set_blend_state(ctx);
-
- r300AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef);
- r300Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled);
-
- /* Initialize magic registers
- TODO : learn what they really do, or get rid of
- those we don't have to touch */
- r300->hw.unk2080.cmd[1] = 0x0030045A; /* Dangerous */
-
- r300->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA
- | R300_VPORT_X_OFFSET_ENA
- | R300_VPORT_Y_SCALE_ENA
- | R300_VPORT_Y_OFFSET_ENA
- | R300_VPORT_Z_SCALE_ENA
- | R300_VPORT_Z_OFFSET_ENA
- | R300_VTX_W0_FMT;
- r300->hw.vte.cmd[2] = 0x00000008;
-
- r300->hw.unk2134.cmd[1] = 0x00FFFFFF;
- r300->hw.unk2134.cmd[2] = 0x00000000;
-#ifdef MESA_BIG_ENDIAN
- r300->hw.unk2140.cmd[1] = 0x00000002;
-#else
- r300->hw.unk2140.cmd[1] = 0x00000000;
-#endif
-
-#if 0 /* Done in setup routing */
- ((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
- r300->hw.vir[0].cmd[1] = 0x21030003;
-
- ((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = 1;
- r300->hw.vir[1].cmd[1] = 0xF688F688;
-
- r300->hw.vic.cmd[R300_VIR_CNTL_0] = 0x00000001;
- r300->hw.vic.cmd[R300_VIR_CNTL_1] = 0x00000405;
-#endif
-
- r300->hw.unk21DC.cmd[1] = 0xAAAAAAAA;
-
- r300->hw.unk221C.cmd[1] = R300_221C_NORMAL;
-
- r300->hw.unk2220.cmd[1] = r300PackFloat32(1.0);
- r300->hw.unk2220.cmd[2] = r300PackFloat32(1.0);
- r300->hw.unk2220.cmd[3] = r300PackFloat32(1.0);
- r300->hw.unk2220.cmd[4] = r300PackFloat32(1.0);
-
- if (GET_CHIP(r300->radeon.radeonScreen) == RADEON_CHIP_R300)
- r300->hw.unk2288.cmd[1] = R300_2288_R300;
- else
- r300->hw.unk2288.cmd[1] = R300_2288_RV350;
-
-#if 0
- r300->hw.vof.cmd[R300_VOF_CNTL_0] = R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT
- | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT;
- r300->hw.vof.cmd[R300_VOF_CNTL_1] = 0; /* no textures */
-
-
- r300->hw.pvs.cmd[R300_PVS_CNTL_1] = 0;
- r300->hw.pvs.cmd[R300_PVS_CNTL_2] = 0;
- r300->hw.pvs.cmd[R300_PVS_CNTL_3] = 0;
-#endif
-
- r300->hw.gb_enable.cmd[1] = R300_GB_POINT_STUFF_ENABLE
- | R300_GB_LINE_STUFF_ENABLE
- | R300_GB_TRIANGLE_STUFF_ENABLE /*| R300_GB_UNK30*/;
-
- r300->hw.gb_misc.cmd[R300_GB_MISC_MSPOS_0] = 0x66666666;
- r300->hw.gb_misc.cmd[R300_GB_MISC_MSPOS_1] = 0x06666666;
- if (GET_CHIP(r300->radeon.radeonScreen) == RADEON_CHIP_R300)
- r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = R300_GB_TILE_ENABLE
- | R300_GB_TILE_PIPE_COUNT_R300
- | R300_GB_TILE_SIZE_16;
- else if (GET_CHIP(r300->radeon.radeonScreen) == RADEON_CHIP_R420)
- r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = R300_GB_TILE_ENABLE
- | R300_GB_TILE_PIPE_COUNT_R420
- | R300_GB_TILE_SIZE_16;
- else
- r300->hw.gb_misc.cmd[R300_GB_MISC_TILE_CONFIG] = R300_GB_TILE_ENABLE
- | R300_GB_TILE_PIPE_COUNT_RV300
- | R300_GB_TILE_SIZE_16;
- r300->hw.gb_misc.cmd[R300_GB_MISC_SELECT] = 0x00000000;
- r300->hw.gb_misc.cmd[R300_GB_MISC_AA_CONFIG] = 0x00000000; /* No antialiasing */
-
- //r300->hw.txe.cmd[R300_TXE_ENABLE] = 0;
-
- r300->hw.unk4200.cmd[1] = r300PackFloat32(0.0);
- r300->hw.unk4200.cmd[2] = r300PackFloat32(0.0);
- r300->hw.unk4200.cmd[3] = r300PackFloat32(1.0);
- r300->hw.unk4200.cmd[4] = r300PackFloat32(1.0);
-
- r300->hw.unk4214.cmd[1] = 0x00050005;
-
- r300PointSize(ctx, 0.0);
-#if 0
- r300->hw.ps.cmd[R300_PS_POINTSIZE] = (6 << R300_POINTSIZE_X_SHIFT) |
- (6 << R300_POINTSIZE_Y_SHIFT);
-#endif
-
- r300->hw.unk4230.cmd[1] = 0x01800000;//18000006;
- r300->hw.unk4230.cmd[2] = 0x00020006;
- r300->hw.unk4230.cmd[3] = r300PackFloat32(1.0 / 192.0);
-
- r300LineWidth(ctx, 0.0);
-
- r300->hw.unk4260.cmd[1] = 0;
- r300->hw.unk4260.cmd[2] = r300PackFloat32(0.0);
- r300->hw.unk4260.cmd[3] = r300PackFloat32(1.0);
-
- r300->hw.unk4274.cmd[1] = 0x00000002;
- r300ShadeModel(ctx, ctx->Light.ShadeModel);
- r300->hw.unk4274.cmd[3] = 0x00000000;
- r300->hw.unk4274.cmd[4] = 0x00000000;
-
- r300PolygonMode(ctx, GL_FRONT, ctx->Polygon.FrontMode);
- r300PolygonMode(ctx, GL_BACK, ctx->Polygon.BackMode);
- r300->hw.unk4288.cmd[2] = 0x00000001;
- r300->hw.unk4288.cmd[3] = 0x00000000;
- r300->hw.unk4288.cmd[4] = 0x00000000;
- r300->hw.unk4288.cmd[5] = 0x00000000;
-
- r300->hw.unk42A0.cmd[1] = 0x00000000;
-
- r300PolygonOffset(ctx, ctx->Polygon.OffsetFactor, ctx->Polygon.OffsetUnits);
- r300Enable(ctx, GL_POLYGON_OFFSET_FILL, ctx->Polygon.OffsetFill);
-
- r300->hw.unk42C0.cmd[1] = 0x4B7FFFFF;
- r300->hw.unk42C0.cmd[2] = 0x00000000;
-
-
- r300->hw.unk43A4.cmd[1] = 0x0000001C;
- r300->hw.unk43A4.cmd[2] = 0x2DA49525;
-
- r300->hw.unk43E8.cmd[1] = 0x00FFFFFF;
-
-#if 0
- r300->hw.fp.cmd[R300_FP_CNTL0] = 0;
- r300->hw.fp.cmd[R300_FP_CNTL1] = 0;
- r300->hw.fp.cmd[R300_FP_CNTL2] = 0;
- r300->hw.fp.cmd[R300_FP_NODE0] = 0;
- r300->hw.fp.cmd[R300_FP_NODE1] = 0;
- r300->hw.fp.cmd[R300_FP_NODE2] = 0;
- r300->hw.fp.cmd[R300_FP_NODE3] = 0;
-#endif
-
- r300->hw.unk46A4.cmd[1] = 0x00001B01;
- r300->hw.unk46A4.cmd[2] = 0x00001B0F;
- r300->hw.unk46A4.cmd[3] = 0x00001B0F;
- r300->hw.unk46A4.cmd[4] = 0x00001B0F;
- r300->hw.unk46A4.cmd[5] = 0x00000001;
-
-#if 0
- for(i = 1; i <= 64; ++i) {
- /* create NOP instructions */
- r300->hw.fpi[0].cmd[i] = FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO));
- r300->hw.fpi[1].cmd[i] = FP_SELC(0,XYZ,NO,FP_TMP(0),0,0);
- r300->hw.fpi[2].cmd[i] = FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO));
- r300->hw.fpi[3].cmd[i] = FP_SELA(0,W,NO,FP_TMP(0),0,0);
- }
-#endif
-
- r300->hw.unk4BC0.cmd[1] = 0;
-
- r300->hw.unk4BC8.cmd[1] = 0;
- r300->hw.unk4BC8.cmd[2] = 0;
- r300->hw.unk4BC8.cmd[3] = 0;
-
-
- r300->hw.at.cmd[R300_AT_UNKNOWN] = 0;
- r300->hw.unk4BD8.cmd[1] = 0;
-
- r300->hw.unk4E00.cmd[1] = 0;
-
-#if 0
- r300->hw.bld.cmd[R300_BLD_CBLEND] = 0;
- r300->hw.bld.cmd[R300_BLD_ABLEND] = 0;
-#endif
-
- r300BlendColor(ctx, ctx->Color.BlendColor);
- r300->hw.unk4E10.cmd[2] = 0;
- r300->hw.unk4E10.cmd[3] = 0;
-
- /* Again, r300ClearBuffer uses this */
- r300->hw.cb.cmd[R300_CB_OFFSET] = r300->radeon.state.color.drawOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.state.color.drawPitch;
-
- if (r300->radeon.radeonScreen->cpp == 4)
- r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888;
- else
- r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565;
-
- if (r300->radeon.sarea->tiling_enabled)
- r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_TILE_ENABLE;
-
- r300->hw.unk4E50.cmd[1] = 0;
- r300->hw.unk4E50.cmd[2] = 0;
- r300->hw.unk4E50.cmd[3] = 0;
- r300->hw.unk4E50.cmd[4] = 0;
- r300->hw.unk4E50.cmd[5] = 0;
- r300->hw.unk4E50.cmd[6] = 0;
- r300->hw.unk4E50.cmd[7] = 0;
- r300->hw.unk4E50.cmd[8] = 0;
- r300->hw.unk4E50.cmd[9] = 0;
-
- r300->hw.unk4E88.cmd[1] = 0;
-
- r300->hw.unk4EA0.cmd[1] = 0x00000000;
- r300->hw.unk4EA0.cmd[2] = 0xffffffff;
-
- switch (ctx->Visual.depthBits) {
- case 16:
- r300->hw.unk4F10.cmd[1] = R300_DEPTH_FORMAT_16BIT_INT_Z;
- break;
- case 24:
- r300->hw.unk4F10.cmd[1] = R300_DEPTH_FORMAT_24BIT_INT_Z;
- break;
- default:
- fprintf(stderr, "Error: Unsupported depth %d... exiting\n",
- ctx->Visual.depthBits);
- exit(-1);
-
- }
- r300->hw.unk4F10.cmd[3] = 0x00000003;
- r300->hw.unk4F10.cmd[4] = 0x00000000;
-
- r300->hw.zb.cmd[R300_ZB_OFFSET] =
- r300->radeon.radeonScreen->depthOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.zb.cmd[R300_ZB_PITCH] = r300->radeon.radeonScreen->depthPitch;
-
- if (r300->radeon.sarea->tiling_enabled) {
- /* Turn off when clearing buffers ? */
- r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_TILE_ENABLE;
-
- if (ctx->Visual.depthBits == 24)
- r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_MICROTILE_ENABLE;
- }
-
- r300->hw.unk4F28.cmd[1] = 0;
-
- r300->hw.unk4F30.cmd[1] = 0;
- r300->hw.unk4F30.cmd[2] = 0;
-
- r300->hw.unk4F44.cmd[1] = 0;
-
- r300->hw.unk4F54.cmd[1] = 0;
-
-#if 0
- ((drm_r300_cmd_header_t*)r300->hw.vpi.cmd)->vpu.count = 0;
- for(i = 1; i < R300_VPI_CMDSIZE; i += 4) {
- /* MOV t0, t0 */
- r300->hw.vpi.cmd[i+0] = VP_OUT(ADD,TMP,0,XYZW);
- r300->hw.vpi.cmd[i+1] = VP_IN(TMP,0);
- r300->hw.vpi.cmd[i+2] = VP_ZERO();
- r300->hw.vpi.cmd[i+3] = VP_ZERO();
- }
-
- ((drm_r300_cmd_header_t*)r300->hw.vpp.cmd)->vpu.count = 0;
- for(i = 1; i < R300_VPP_CMDSIZE; ++i)
- r300->hw.vpp.cmd[i] = 0;
-#endif
-
- r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0;
- r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0;
- r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0);
- r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0;
-
-//END: TODO
- //verify_r300ResetHwState(r300, 0);
- r300->hw.all_dirty = GL_TRUE;
-}
-
-
-
-/**
- * Calculate initial hardware state and register state functions.
- * Assumes that the command buffer and state atoms have been
- * initialized already.
- */
-void r300InitState(r300ContextPtr r300)
-{
- GLcontext *ctx = r300->radeon.glCtx;
- GLuint depth_fmt;
-
- radeonInitState(&r300->radeon);
-
- switch (ctx->Visual.depthBits) {
- case 16:
- r300->state.depth.scale = 1.0 / (GLfloat) 0xffff;
- depth_fmt = R200_DEPTH_FORMAT_16BIT_INT_Z;
- r300->state.stencil.clear = 0x00000000;
- break;
- case 24:
- r300->state.depth.scale = 1.0 / (GLfloat) 0xffffff;
- depth_fmt = R200_DEPTH_FORMAT_24BIT_INT_Z;
- r300->state.stencil.clear = 0x00ff0000;
- break;
- default:
- fprintf(stderr, "Error: Unsupported depth %d... exiting\n",
- ctx->Visual.depthBits);
- exit(-1);
- }
-
- /* Only have hw stencil when depth buffer is 24 bits deep */
- r300->state.stencil.hw_stencil = (ctx->Visual.stencilBits > 0 &&
- ctx->Visual.depthBits == 24);
-
- memset(&(r300->state.texture), 0, sizeof(r300->state.texture));
-
- r300ResetHwState(r300);
-}
-
-static void r300RenderMode( GLcontext *ctx, GLenum mode )
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- WARN_ONCE("TODO: fallback properly when rendering mode is not GL_RENDER\n"
- "\tThe way things are now neither selection nor feedback modes work\n")
-// FALLBACK( rmesa, R300_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
-}
-
-/**
- * Initialize driver's state callback functions
- */
-void r300InitStateFuncs(struct dd_function_table* functions)
-{
- radeonInitStateFuncs(functions);
-
- functions->UpdateState = r300InvalidateState;
- functions->AlphaFunc = r300AlphaFunc;
- functions->BlendColor = r300BlendColor;
- functions->BlendEquationSeparate = r300BlendEquationSeparate;
- functions->BlendFuncSeparate = r300BlendFuncSeparate;
- functions->Enable = r300Enable;
- functions->ColorMask = r300ColorMask;
- functions->DepthFunc = r300DepthFunc;
- functions->DepthMask = r300DepthMask;
- functions->CullFace = r300CullFace;
- functions->FrontFace = r300FrontFace;
- functions->ShadeModel = r300ShadeModel;
-
- /* Stencil related */
- functions->ClearStencil = r300ClearStencil;
- functions->StencilFunc = r300StencilFunc;
- functions->StencilMask = r300StencilMask;
- functions->StencilOp = r300StencilOp;
-
- /* Viewport related */
- functions->Viewport = r300Viewport;
- functions->DepthRange = r300DepthRange;
- functions->PointSize = r300PointSize;
- functions->LineWidth = r300LineWidth;
-
- functions->PolygonOffset = r300PolygonOffset;
- functions->PolygonMode = r300PolygonMode;
-
- functions->RenderMode = r300RenderMode;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.h
deleted file mode 100644
index 131834fa7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_state.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __R300_STATE_H__
-#define __R300_STATE_H__
-
-#include "r300_context.h"
-
-#define R300_STATECHANGE(r300, atom) \
- do { \
- r300->hw.atom.dirty = GL_TRUE; \
- r300->hw.is_dirty = GL_TRUE; \
- } while(0)
-
-/* Fire the buffered vertices no matter what.
- TODO: This has not been implemented yet
- */
-#define R300_FIREVERTICES( r300 ) \
-do { \
- \
- if ( (r300)->cmdbuf.count_used || (r300)->dma.flush ) { \
- r300Flush( (r300)->radeon.glCtx ); \
- } \
- \
-} while (0)
-
-
-extern void r300ResetHwState(r300ContextPtr r300);
-
-extern void r300InitState(r300ContextPtr r300);
-extern void r300InitStateFuncs(struct dd_function_table* functions);
-extern void r300SetupVertexShader(r300ContextPtr rmesa);
-extern void r300SetupPixelShader(r300ContextPtr rmesa);
-
-extern void r300_setup_textures(GLcontext *ctx);
-extern void r300_setup_rs_unit(GLcontext *ctx);
-
-#endif /* __R300_STATE_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.c
deleted file mode 100644
index e6c8c1801..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.c
+++ /dev/null
@@ -1,1051 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r300/r300_tex.c,v 1.2 2002/11/05 17:46:08 tsi Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "image.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "texmem.h"
-#include "teximage.h"
-#include "texobj.h"
-
-#include "r300_context.h"
-#include "r300_state.h"
-#include "r300_ioctl.h"
-//#include "r300_swtcl.h"
-#include "r300_tex.h"
-
-#include "xmlpool.h"
-
-/**
- * Set the texture wrap modes.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-
-static void r300SetTexWrap(r300TexObjPtr t, GLenum swrap, GLenum twrap,
- GLenum rwrap)
-{
- GLboolean is_clamp = GL_FALSE;
- unsigned long hw_swrap=0, hw_twrap=0, hw_qwrap=0;
-
- t->filter &=
- ~(R300_TX_WRAP_S_MASK | R300_TX_WRAP_T_MASK | R300_TX_WRAP_Q_MASK);
-
- switch (swrap) {
- case GL_REPEAT:
- hw_swrap |= R300_TX_REPEAT;
- break;
- case GL_CLAMP:
- hw_swrap |= R300_TX_CLAMP;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- hw_swrap |= R300_TX_CLAMP_TO_EDGE;
- break;
- case GL_CLAMP_TO_BORDER:
- hw_swrap |= R300_TX_CLAMP_TO_BORDER;
- break;
- case GL_MIRRORED_REPEAT:
- hw_swrap |= R300_TX_REPEAT | R300_TX_MIRRORED;
- break;
- case GL_MIRROR_CLAMP_EXT:
- hw_swrap |= R300_TX_CLAMP | R300_TX_MIRRORED;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- hw_swrap |= R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- hw_swrap |= R300_TX_CLAMP_TO_BORDER | R300_TX_MIRRORED;
- break;
- default:
- _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
- }
-
- switch (twrap) {
- case GL_REPEAT:
- hw_twrap |= R300_TX_REPEAT;
- break;
- case GL_CLAMP:
- hw_twrap |= R300_TX_CLAMP;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- hw_twrap |= R300_TX_CLAMP_TO_EDGE;
- break;
- case GL_CLAMP_TO_BORDER:
- hw_twrap |= R300_TX_CLAMP_TO_BORDER;
- break;
- case GL_MIRRORED_REPEAT:
- hw_twrap |= R300_TX_REPEAT | R300_TX_MIRRORED;
- break;
- case GL_MIRROR_CLAMP_EXT:
- hw_twrap |= R300_TX_CLAMP | R300_TX_MIRRORED;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- hw_twrap |= R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- hw_twrap |= R300_TX_CLAMP_TO_BORDER | R300_TX_MIRRORED;
- break;
- default:
- _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
- }
-
- switch (rwrap) {
- case GL_REPEAT:
- hw_qwrap |= R300_TX_REPEAT;
- break;
- case GL_CLAMP:
- hw_qwrap |= R300_TX_CLAMP;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- hw_qwrap |= R300_TX_CLAMP_TO_EDGE;
- break;
- case GL_CLAMP_TO_BORDER:
- hw_qwrap |= R300_TX_CLAMP_TO_BORDER;
- break;
- case GL_MIRRORED_REPEAT:
- hw_qwrap |= R300_TX_REPEAT | R300_TX_MIRRORED;
- break;
- case GL_MIRROR_CLAMP_EXT:
- hw_qwrap |= R300_TX_CLAMP | R300_TX_MIRRORED;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- hw_qwrap |= R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- hw_qwrap |= R300_TX_CLAMP_TO_BORDER | R300_TX_MIRRORED;
- break;
- default:
- _mesa_problem(NULL, "bad R wrap mode in %s", __FUNCTION__);
- }
-
- t->filter |= hw_swrap << R300_TX_WRAP_S_SHIFT;
- t->filter |= hw_twrap << R300_TX_WRAP_T_SHIFT;
- t->filter |= hw_qwrap << R300_TX_WRAP_Q_SHIFT;
-
-#if 0
- t->format_x &= ~R200_CLAMP_Q_MASK;
- t->border_fallback = (is_clamp && is_clamp_to_border);
-#endif
-}
-
-static void r300SetTexMaxAnisotropy(r300TexObjPtr t, GLfloat max)
-{
-
- t->filter &= ~R300_TX_MAX_ANISO_MASK;
-
- if (max <= 1.0) {
- t->filter |= R300_TX_MAX_ANISO_1_TO_1;
- } else if (max <= 2.0) {
- t->filter |= R300_TX_MAX_ANISO_2_TO_1;
- } else if (max <= 4.0) {
- t->filter |= R300_TX_MAX_ANISO_4_TO_1;
- } else if (max <= 8.0) {
- t->filter |= R300_TX_MAX_ANISO_8_TO_1;
- } else {
- t->filter |= R300_TX_MAX_ANISO_16_TO_1;
- }
-}
-
-/**
- * Set the texture magnification and minification modes.
- *
- * \param t Texture whose filter modes are to be set
- * \param minf Texture minification mode
- * \param magf Texture magnification mode
- */
-
-static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf)
-{
- GLuint anisotropy = (t->filter & R300_TX_MAX_ANISO_MASK);
-
- t->filter &= ~(R300_TX_MIN_FILTER_MASK | R300_TX_MAG_FILTER_MASK);
-#if 0
- //t->format_x &= ~R200_VOLUME_FILTER_MASK;
-#endif
-
- if (anisotropy == R300_TX_MAX_ANISO_1_TO_1) {
- switch (minf) {
- case GL_NEAREST:
- t->filter |= R300_TX_MIN_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- t->filter |= R300_TX_MIN_FILTER_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- t->filter |= R300_TX_MIN_FILTER_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- t->filter |= R300_TX_MIN_FILTER_LINEAR_MIP_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- t->filter |= R300_TX_MIN_FILTER_NEAREST_MIP_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- t->filter |= R300_TX_MIN_FILTER_LINEAR_MIP_LINEAR;
- break;
- }
- } else {
- switch (minf) {
- case GL_NEAREST:
- t->filter |= R300_TX_MIN_FILTER_ANISO_NEAREST;
- break;
- case GL_LINEAR:
- t->filter |= R300_TX_MIN_FILTER_ANISO_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_NEAREST:
- t->filter |=
- R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- t->filter |=
- R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR;
- break;
- }
- }
-
- /* Note we don't have 3D mipmaps so only use the mag filter setting
- * to set the 3D texture filter mode.
- */
- switch (magf) {
- case GL_NEAREST:
- t->filter |= R300_TX_MAG_FILTER_NEAREST;
- /*t->format_x |= R200_VOLUME_FILTER_NEAREST;*/
- break;
- case GL_LINEAR:
- t->filter |= R300_TX_MAG_FILTER_LINEAR;
- /*t->format_x |= R200_VOLUME_FILTER_LINEAR;*/
- break;
- }
-}
-
-static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4])
-{
- t->pp_border_color = r300PackColor(4, c[0], c[1], c[2], c[3]);
-}
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-static r300TexObjPtr r300AllocTexObj(struct gl_texture_object *texObj)
-{
- r300TexObjPtr t;
-
- t = CALLOC_STRUCT(r300_tex_obj);
- texObj->DriverData = t;
- if (t != NULL) {
- if (RADEON_DEBUG & DEBUG_TEXTURE) {
- fprintf(stderr, "%s( %p, %p )\n", __FUNCTION__,
- (void *)texObj, (void *)t);
- }
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
- t->border_fallback = GL_FALSE;
-
- make_empty_list(&t->base);
-
- r300SetTexWrap(t, texObj->WrapS, texObj->WrapT, texObj->WrapR);
- r300SetTexMaxAnisotropy(t, texObj->MaxAnisotropy);
- r300SetTexFilter(t, texObj->MinFilter, texObj->MagFilter);
- r300SetTexBorderColor(t, texObj->_BorderChan);
- }
-
- return t;
-}
-
-static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
- GLint
- internalFormat,
- GLenum format,
- GLenum type)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- const GLboolean do32bpt =
- (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32);
- const GLboolean force16bpt =
- (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16);
- (void)format;
-
-#if 0
- fprintf(stderr, "InternalFormat=%s(%d) type=%s format=%s\n",
- _mesa_lookup_enum_by_nr(internalFormat), internalFormat,
- _mesa_lookup_enum_by_nr(type),
- _mesa_lookup_enum_by_nr(format));
- fprintf(stderr, "do32bpt=%d force16bpt=%d\n",
- do32bpt, force16bpt);
-#endif
-
- switch (internalFormat) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- switch (type) {
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return do32bpt ? _dri_texformat_argb8888 :
- _dri_texformat_argb1555;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return _dri_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return _dri_texformat_argb1555;
- default:
- return do32bpt ? _dri_texformat_rgba8888 :
- _dri_texformat_argb4444;
- }
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- switch (type) {
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return _dri_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return _dri_texformat_argb1555;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- return _dri_texformat_rgb565;
- default:
- return do32bpt ? _dri_texformat_rgba8888 :
- _dri_texformat_rgb565;
- }
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return !force16bpt ?
- _dri_texformat_rgba8888 : _dri_texformat_argb4444;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return _dri_texformat_argb4444;
-
- case GL_RGB5_A1:
- return _dri_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return !force16bpt ? _dri_texformat_rgba8888 :
- _dri_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return _dri_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return _dri_texformat_a8;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return _dri_texformat_l8;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return _dri_texformat_al88;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return _dri_texformat_i8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- default:
- _mesa_problem(ctx,
- "unexpected internalFormat 0x%x in r300ChooseTextureFormat",
- (int)internalFormat);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-static GLboolean
-r300ValidateClientStorage(GLcontext * ctx, GLenum target,
- GLint internalFormat,
- GLint srcWidth, GLint srcHeight,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
- if (0)
- fprintf(stderr, "intformat %s format %s type %s\n",
- _mesa_lookup_enum_by_nr(internalFormat),
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
-
- if (!ctx->Unpack.ClientStorage)
- return 0;
-
- if (ctx->_ImageTransferState ||
- texImage->IsCompressed || texObj->GenerateMipmap)
- return 0;
-
- /* This list is incomplete, may be different on ppc???
- */
- switch (internalFormat) {
- case GL_RGBA:
- if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV) {
- texImage->TexFormat = _dri_texformat_argb8888;
- } else
- return 0;
- break;
-
- case GL_RGB:
- if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) {
- texImage->TexFormat = _dri_texformat_rgb565;
- } else
- return 0;
- break;
-
- case GL_YCBCR_MESA:
- if (format == GL_YCBCR_MESA &&
- type == GL_UNSIGNED_SHORT_8_8_REV_APPLE) {
- texImage->TexFormat = &_mesa_texformat_ycbcr_rev;
- } else if (format == GL_YCBCR_MESA &&
- (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)) {
- texImage->TexFormat = &_mesa_texformat_ycbcr;
- } else
- return 0;
- break;
-
- default:
- return 0;
- }
-
- /* Could deal with these packing issues, but currently don't:
- */
- if (packing->SkipPixels ||
- packing->SkipRows || packing->SwapBytes || packing->LsbFirst) {
- return 0;
- }
-
- {
- GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth,
- format, type);
-
- if (0)
- fprintf(stderr, "%s: srcRowStride %d/%x\n",
- __FUNCTION__, srcRowStride, srcRowStride);
-
- /* Could check this later in upload, pitch restrictions could be
- * relaxed, but would need to store the image pitch somewhere,
- * as packing details might change before image is uploaded:
- */
- if (!r300IsGartMemory(rmesa, pixels, srcHeight * srcRowStride)
- || (srcRowStride & 63))
- return 0;
-
- /* Have validated that _mesa_transfer_teximage would be a straight
- * memcpy at this point. NOTE: future calls to TexSubImage will
- * overwrite the client data. This is explicitly mentioned in the
- * extension spec.
- */
- texImage->Data = (void *)pixels;
- texImage->IsClientData = GL_TRUE;
- texImage->RowStride =
- srcRowStride / texImage->TexFormat->TexelBytes;
-
- return 1;
- }
-}
-
-static void r300TexImage1D(GLcontext * ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
-
- if (t) {
- driSwapOutTextureObject(t);
- } else {
- t = (driTextureObject *) r300AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- }
-
- /* Note, this will call ChooseTextureFormat */
- _mesa_store_teximage1d(ctx, target, level, internalFormat,
- width, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-static void r300TexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
-
- assert(t); /* this _should_ be true */
- if (t) {
- driSwapOutTextureObject(t);
- } else {
- t = (driTextureObject *) r300AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
- return;
- }
- }
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-static void r300TexImage2D(GLcontext * ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face =
- (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if (t != NULL) {
- driSwapOutTextureObject(t);
- } else {
- t = (driTextureObject *) r300AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
-
- texImage->IsClientData = GL_FALSE;
-
- if (r300ValidateClientStorage(ctx, target,
- internalFormat,
- width, height,
- format, type, pixels,
- packing, texObj, texImage)) {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using client storage\n",
- __FUNCTION__);
- } else {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n",
- __FUNCTION__);
-
- /* Normal path: copy (to cached memory) and eventually upload
- * via another copy to GART memory and then a blit... Could
- * eliminate one copy by going straight to (permanent) GART.
- *
- * Note, this will call r300ChooseTextureFormat.
- */
- _mesa_store_teximage2d(ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
- }
-}
-
-static void r300TexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face =
- (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert(t); /* this _should_ be true */
- if (t) {
- driSwapOutTextureObject(t);
- } else {
- t = (driTextureObject *) r300AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- }
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-#if ENABLE_HW_3D_TEXTURE
-static void r300TexImage3D(GLcontext * ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
-
- if (t) {
- driSwapOutTextureObject(t);
- } else {
- t = (driTextureObject *) r300AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
- return;
- }
- }
-
- texImage->IsClientData = GL_FALSE;
-
-#if 0
- if (r300ValidateClientStorage(ctx, target,
- internalFormat,
- width, height,
- format, type, pixels,
- packing, texObj, texImage)) {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using client storage\n",
- __FUNCTION__);
- } else
-#endif
- {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: Using normal storage\n",
- __FUNCTION__);
-
- /* Normal path: copy (to cached memory) and eventually upload
- * via another copy to GART memory and then a blit... Could
- * eliminate one copy by going straight to (permanent) GART.
- *
- * Note, this will call r300ChooseTextureFormat.
- */
- _mesa_store_teximage3d(ctx, target, level, internalFormat,
- width, height, depth, border,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
- }
-}
-#endif
-
-#if ENABLE_HW_3D_TEXTURE
-static void
-r300TexSubImage3D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- assert(t); /* this _should_ be true */
- if (t) {
- driSwapOutTextureObject(t);
- } else {
- t = (driTextureObject *) r300AllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D");
- return;
- }
- texObj->DriverData = t;
- }
-
- _mesa_store_texsubimage3d(ctx, target, level, xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-#endif
-
-static void r300TexEnv(GLcontext * ctx, GLenum target,
- GLenum pname, const GLfloat * param)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (RADEON_DEBUG & DEBUG_STATE) {
- fprintf(stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr(pname));
- }
-
- /* This is incorrect: Need to maintain this data for each of
- * GL_TEXTURE_{123}D, GL_TEXTURE_RECTANGLE_NV, etc, and switch
- * between them according to _ReallyEnabled.
- */
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR:{
- WARN_ONCE("I am broken - Fixme !\n");
- /*
- GLubyte c[4];
- GLuint envColor;
- UNCLAMPED_FLOAT_TO_RGBA_CHAN(c, texUnit->EnvColor);
- envColor = radeonPackColor(4, c[0], c[1], c[2], c[3]);
- if (rmesa->hw.tf.cmd[TF_TFACTOR_0 + unit] != envColor) {
- R200_STATECHANGE(rmesa, tf);
- rmesa->hw.tf.cmd[TF_TFACTOR_0 + unit] =
- envColor;
- }
- break;
- */}
-
- case GL_TEXTURE_LOD_BIAS_EXT:{
- GLfloat bias, min;
- GLuint b;
-
- /* The R300's LOD bias is a signed 2's complement value with a
- * range of -16.0 <= bias < 16.0.
- *
- * NOTE: Add a small bias to the bias for conform mipsel.c test.
- */
- bias = *param + .01;
- min =
- driQueryOptionb(&rmesa->radeon.optionCache,
- "no_neg_lod_bias") ? 0.0 : -16.0;
- bias = CLAMP(bias, min, 16.0);
-
- /* 0.0 - 16.0 == 0x0 - 0x1000 */
- /* 0.0 - -16.0 == 0x1001 - 0x1fff */
- b = 0x1000 / 16.0 * bias;
- b &= R300_LOD_BIAS_MASK;
-
- if(b != (rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+unit] & R300_LOD_BIAS_MASK)){
- R300_STATECHANGE(rmesa, tex.unknown1);
- rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+unit] &= ~R300_LOD_BIAS_MASK;
- rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+unit] |= b;
- }
- break;
- }
-
- default:
- return;
- }
-}
-
-/**
- * Changes variables and flags for a state update, which will happen at the
- * next UpdateTextureState
- */
-
-static void r300TexParameter(GLcontext * ctx, GLenum target,
- struct gl_texture_object *texObj,
- GLenum pname, const GLfloat * params)
-{
- r300TexObjPtr t = (r300TexObjPtr) texObj->DriverData;
-
- if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_TEXTURE)) {
- fprintf(stderr, "%s( %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(pname));
- }
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- r300SetTexMaxAnisotropy(t, texObj->MaxAnisotropy);
- r300SetTexFilter(t, texObj->MinFilter, texObj->MagFilter);
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- r300SetTexWrap(t, texObj->WrapS, texObj->WrapT, texObj->WrapR);
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- r300SetTexBorderColor(t, texObj->_BorderChan);
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- driSwapOutTextureObject((driTextureObject *) t);
- break;
-
- default:
- return;
- }
-
- /* Mark this texobj as dirty (one bit per tex unit)
- */
- t->dirty_state = TEX_ALL;
-}
-
-static void r300BindTexture(GLcontext * ctx, GLenum target,
- struct gl_texture_object *texObj)
-{
- if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_TEXTURE)) {
- fprintf(stderr, "%s( %p ) unit=%d\n", __FUNCTION__,
- (void *)texObj, ctx->Texture.CurrentUnit);
- }
-
- if ((target == GL_TEXTURE_1D)
- || (target == GL_TEXTURE_2D)
-#if ENABLE_HW_3D_TEXTURE
- || (target == GL_TEXTURE_3D)
-#endif
- || (target == GL_TEXTURE_CUBE_MAP)
- || (target == GL_TEXTURE_RECTANGLE_NV)) {
- assert(texObj->DriverData != NULL);
- }
-}
-
-static void r300DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- driTextureObject *t = (driTextureObject *) texObj->DriverData;
-
- if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_TEXTURE)) {
- fprintf(stderr, "%s( %p (target = %s) )\n", __FUNCTION__,
- (void *)texObj,
- _mesa_lookup_enum_by_nr(texObj->Target));
- }
-
- if (t != NULL) {
- if (rmesa) {
- R300_FIREVERTICES(rmesa);
- }
-
- driDestroyTextureObject(t);
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, texObj);
-}
-
-/* Need:
- * - Same GEN_MODE for all active bits
- * - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
- * - STRQ presumably all supported (matrix means incoming R values
- * can end up in STQ, this has implications for vertex support,
- * presumably ok if maos is used, though?)
- *
- * Basically impossible to do this on the fly - just collect some
- * basic info & do the checks from ValidateState().
- */
-static void r300TexGen(GLcontext * ctx,
- GLenum coord, GLenum pname, const GLfloat * params)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
-#if 0 /* Disable this for now - looks like we will be recalculating everything
- anyway */
- rmesa->recheck_texgen[unit] = GL_TRUE;
-#endif
-}
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- * Fixup MaxAnisotropy according to user preference.
- */
-static struct gl_texture_object *r300NewTextureObject(GLcontext * ctx,
- GLuint name,
- GLenum target)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- if (!obj)
- return NULL;
- obj->MaxAnisotropy = rmesa->initialMaxAnisotropy;
-
- r300AllocTexObj(obj);
- return obj;
-}
-
-void r300InitTextureFuncs(struct dd_function_table *functions)
-{
- /* Note: we only plug in the functions we implement in the driver
- * since _mesa_init_driver_functions() was already called.
- */
- functions->ChooseTextureFormat = r300ChooseTextureFormat;
- functions->TexImage1D = r300TexImage1D;
- functions->TexImage2D = r300TexImage2D;
-#if ENABLE_HW_3D_TEXTURE
- functions->TexImage3D = r300TexImage3D;
-#else
- functions->TexImage3D = _mesa_store_teximage3d;
-#endif
- functions->TexSubImage1D = r300TexSubImage1D;
- functions->TexSubImage2D = r300TexSubImage2D;
-#if ENABLE_HW_3D_TEXTURE
- functions->TexSubImage3D = r300TexSubImage3D;
-#else
- functions->TexSubImage3D = _mesa_store_texsubimage3d;
-#endif
- functions->NewTextureObject = r300NewTextureObject;
- functions->BindTexture = r300BindTexture;
- functions->DeleteTexture = r300DeleteTexture;
- functions->IsTextureResident = driIsTextureResident;
-
- functions->TexEnv = r300TexEnv;
- functions->TexParameter = r300TexParameter;
- functions->TexGen = r300TexGen;
-
- driInitTextureFormats();
-
-#if 0
- /* moved or obsolete code */
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- driInitTextureObjects(ctx, &rmesa->swapped,
- DRI_TEXMGR_DO_TEXTURE_1D
- | DRI_TEXMGR_DO_TEXTURE_2D);
-
- /* Hack: r300NewTextureObject is not yet installed when the
- * default textures are created. Therefore set MaxAnisotropy of the
- * default 2D texture now. */
- ctx->Shared->Default2D->MaxAnisotropy =
- driQueryOptionf(&rmesa->optionCache, "def_max_anisotropy");
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.h
deleted file mode 100644
index a18ff0e2c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_tex.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r300/r300_tex.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __r300_TEX_H__
-#define __r300_TEX_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-extern void r300UpdateTextureState(GLcontext * ctx);
-
-extern int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t,
- GLuint face);
-
-extern void r300DestroyTexObj(r300ContextPtr rmesa, r300TexObjPtr t);
-
-extern void r300InitTextureFuncs(struct dd_function_table *functions);
-
-#endif
-#endif /* __r300_TEX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texmem.c
deleted file mode 100644
index 5c70e2e3c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texmem.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r300/r300_texmem.c,v 1.5 2002/12/17 00:32:56 dawes Exp $ */
-/**************************************************************************
-
-Copyright (C) Tungsten Graphics 2002. All Rights Reserved.
-The Weather Channel, Inc. funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86
-license. This notice must be preserved.
-
-Permission is hereby granted, free of charge, to 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 ATI, VA LINUX SYSTEMS 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "colormac.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "radeon_reg.h" /* gets definition for usleep */
-#include "r300_context.h"
-#include "r300_state.h"
-#include "r300_cmdbuf.h"
-#include "radeon_ioctl.h"
-/*
-#include "r300_swtcl.h"
-*/
-#include "r300_tex.h"
-#include "r300_ioctl.h"
-#include <unistd.h> /* for usleep() */
-
-/**
- * Destroy any device-dependent state associated with the texture. This may
- * include NULLing out hardware state that points to the texture.
- */
-void r300DestroyTexObj(r300ContextPtr rmesa, r300TexObjPtr t)
-{
- if (RADEON_DEBUG & DEBUG_TEXTURE) {
- fprintf(stderr, "%s( %p, %p )\n", __FUNCTION__,
- (void *)t, (void *)t->base.tObj);
- }
-
- if (rmesa != NULL) {
- unsigned i;
-
- for (i = 0; i < rmesa->radeon.glCtx->Const.MaxTextureUnits; i++) {
- if (t == rmesa->state.texture.unit[i].texobj) {
- rmesa->state.texture.unit[i].texobj = NULL;
- /* This code below is meant to shorten state
- pushed to the hardware by not programming
- unneeded units.
-
- This does not appear to be worthwhile on R300 */
-#if 0
- remove_from_list(&rmesa->hw.tex[i]);
- make_empty_list(&rmesa->hw.tex[i]);
- remove_from_list(&rmesa->hw.cube[i]);
- make_empty_list(&rmesa->hw.cube[i]);
-#endif
- }
- }
- }
-}
-
-/* ------------------------------------------------------------
- * Texture image conversions
- */
-
-static void r300UploadGARTClientSubImage(r300ContextPtr rmesa,
- r300TexObjPtr t,
- struct gl_texture_image *texImage,
- GLint hwlevel,
- GLint x, GLint y,
- GLint width, GLint height)
-{
- const struct gl_texture_format *texFormat = texImage->TexFormat;
- GLuint srcPitch, dstPitch;
- int blit_format;
- int srcOffset;
-
- /*
- * XXX it appears that we always upload the full image, not a subimage.
- * I.e. x==0, y==0, width=texWidth, height=texWidth. If this is ever
- * changed, the src pitch will have to change.
- */
- switch (texFormat->TexelBytes) {
- case 1:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
- srcPitch = t->image[0][0].width * texFormat->TexelBytes;
- dstPitch = t->image[0][0].width * texFormat->TexelBytes;
- break;
- case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
- srcPitch = t->image[0][0].width * texFormat->TexelBytes;
- dstPitch = t->image[0][0].width * texFormat->TexelBytes;
- break;
- case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
- srcPitch = t->image[0][0].width * texFormat->TexelBytes;
- dstPitch = t->image[0][0].width * texFormat->TexelBytes;
- break;
- default:
- return;
- }
-
- t->image[0][hwlevel].data = texImage->Data;
- srcOffset = r300GartOffsetFromVirtual(rmesa, texImage->Data);
-
- assert(srcOffset != ~0);
-
- /* Don't currently need to cope with small pitches?
- */
- width = texImage->Width;
- height = texImage->Height;
-
- r300EmitWait(rmesa, R300_WAIT_3D);
-
- r300EmitBlit(rmesa, blit_format,
- srcPitch,
- srcOffset,
- dstPitch,
- t->bufAddr,
- x,
- y,
- t->image[0][hwlevel].x + x,
- t->image[0][hwlevel].y + y, width, height);
-
- r300EmitWait(rmesa, R300_WAIT_2D);
-}
-
-static void r300UploadRectSubImage(r300ContextPtr rmesa,
- r300TexObjPtr t,
- struct gl_texture_image *texImage,
- GLint x, GLint y, GLint width, GLint height)
-{
- const struct gl_texture_format *texFormat = texImage->TexFormat;
- int blit_format, dstPitch, done;
-
- switch (texFormat->TexelBytes) {
- case 1:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
- break;
- case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
- break;
- case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
- break;
- default:
- return;
- }
-
- t->image[0][0].data = texImage->Data;
-
- /* Currently don't need to cope with small pitches.
- */
- width = texImage->Width;
- height = texImage->Height;
- dstPitch = t->pitch + 32;
-
- if (rmesa->prefer_gart_client_texturing && texImage->IsClientData) {
- /* In this case, could also use GART texturing. This is
- * currently disabled, but has been tested & works.
- */
- t->offset =
- r300GartOffsetFromVirtual(rmesa, texImage->Data);
- t->pitch =
- texImage->RowStride * texFormat->TexelBytes - 32;
-
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr,
- "Using GART texturing for rectangular client texture\n");
-
- /* Release FB memory allocated for this image:
- */
- /* FIXME This may not be correct as driSwapOutTextureObject sets
- * FIXME dirty_images. It may be fine, though.
- */
- if (t->base.memBlock) {
- driSwapOutTextureObject((driTextureObject *) t);
- }
- } else if (texImage->IsClientData) {
- /* Data already in GART memory, with usable pitch.
- */
- GLuint srcPitch;
- srcPitch = texImage->RowStride * texFormat->TexelBytes;
- r300EmitBlit(rmesa,
- blit_format,
- srcPitch,
- r300GartOffsetFromVirtual(rmesa, texImage->Data),
- dstPitch, t->bufAddr, 0, 0, 0, 0, width, height);
- } else {
- /* Data not in GART memory, or bad pitch.
- */
- for (done = 0; done < height;) {
- struct r300_dma_region region;
- int lines =
- MIN2(height - done, RADEON_BUFFER_SIZE / dstPitch);
- int src_pitch;
- char *tex;
-
- src_pitch = texImage->RowStride * texFormat->TexelBytes;
-
- tex = (char *)texImage->Data + done * src_pitch;
-
- memset(&region, 0, sizeof(region));
- r300AllocDmaRegion(rmesa, &region, lines * dstPitch,
- 1024);
-
- /* Copy texdata to dma:
- */
- if (0)
- fprintf(stderr,
- "%s: src_pitch %d dst_pitch %d\n",
- __FUNCTION__, src_pitch, dstPitch);
-
- if (src_pitch == dstPitch) {
- memcpy(region.address + region.start, tex,
- lines * src_pitch);
- } else {
- char *buf = region.address + region.start;
- int i;
- for (i = 0; i < lines; i++) {
- memcpy(buf, tex, src_pitch);
- buf += dstPitch;
- tex += src_pitch;
- }
- }
-
- r300EmitWait(rmesa, R300_WAIT_3D);
-
- /* Blit to framebuffer
- */
- r300EmitBlit(rmesa,
- blit_format,
- dstPitch, GET_START(&region),
- dstPitch, t->bufAddr,
- 0, 0, 0, done, width, lines);
-
- r300EmitWait(rmesa, R300_WAIT_2D);
-
- r300ReleaseDmaRegion(rmesa, &region, __FUNCTION__);
- done += lines;
- }
- }
-}
-
-/**
- * Upload the texture image associated with texture \a t at the specified
- * level at the address relative to \a start.
- */
-static void uploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t,
- GLint hwlevel,
- GLint x, GLint y, GLint width, GLint height,
- GLuint face)
-{
- struct gl_texture_image *texImage = NULL;
- GLuint offset;
- GLint imageWidth, imageHeight;
- GLint ret;
- drm_radeon_texture_t tex;
- drm_radeon_tex_image_t tmp;
- const int level = hwlevel + t->base.firstLevel;
-
- if (RADEON_DEBUG & DEBUG_TEXTURE) {
- fprintf(stderr,
- "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n",
- __FUNCTION__, (void *)t, (void *)t->base.tObj, level,
- width, height, face);
- }
-
- ASSERT(face < 6);
-
- /* Ensure we have a valid texture to upload */
- if ((hwlevel < 0) || (hwlevel >= RADEON_MAX_TEXTURE_LEVELS)) {
- _mesa_problem(NULL, "bad texture level in %s", __FUNCTION__);
- return;
- }
-
- texImage = t->base.tObj->Image[face][level];
-
- if (!texImage) {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: texImage %d is NULL!\n",
- __FUNCTION__, level);
- return;
- }
- if (!texImage->Data) {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: image data is NULL!\n",
- __FUNCTION__);
- return;
- }
-
- if (t->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- assert(level == 0);
- assert(hwlevel == 0);
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: image data is rectangular\n",
- __FUNCTION__);
- r300UploadRectSubImage(rmesa, t, texImage, x, y, width, height);
- return;
- } else if (texImage->IsClientData) {
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr,
- "%s: image data is in GART client storage\n",
- __FUNCTION__);
- r300UploadGARTClientSubImage(rmesa, t, texImage, hwlevel, x, y,
- width, height);
- return;
- } else if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: image data is in normal memory\n",
- __FUNCTION__);
-
- imageWidth = texImage->Width;
- imageHeight = texImage->Height;
-
- offset = t->bufAddr;
-
- if (RADEON_DEBUG & (DEBUG_TEXTURE | DEBUG_IOCTL)) {
- GLint imageX = 0;
- GLint imageY = 0;
- GLint blitX = t->image[face][hwlevel].x;
- GLint blitY = t->image[face][hwlevel].y;
- GLint blitWidth = t->image[face][hwlevel].width;
- GLint blitHeight = t->image[face][hwlevel].height;
- fprintf(stderr, " upload image: %d,%d at %d,%d\n",
- imageWidth, imageHeight, imageX, imageY);
- fprintf(stderr, " upload blit: %d,%d at %d,%d\n",
- blitWidth, blitHeight, blitX, blitY);
- fprintf(stderr, " blit ofs: 0x%07x level: %d/%d\n",
- (GLuint) offset, hwlevel, level);
- }
-
- t->image[face][hwlevel].data = texImage->Data;
-
- /* Init the DRM_RADEON_TEXTURE command / drm_radeon_texture_t struct.
- * NOTE: we're always use a 1KB-wide blit and I8 texture format.
- * We used to use 1, 2 and 4-byte texels and used to use the texture
- * width to dictate the blit width - but that won't work for compressed
- * textures. (Brian)
- */
-
- tex.offset = offset;
- tex.pitch = BLIT_WIDTH_BYTES / 64;
- tex.format = R200_TXFORMAT_I8; /* any 1-byte texel format */
-#if 0 /* I am not sure HOSTDATA_BLT actually works.. Experiment here - V.D */
- tex.format = R200_TXFORMAT_RGBA8888; /* any 4-byte texel format */
-#endif
- if (texImage->TexFormat->TexelBytes) {
- tex.width = imageWidth * texImage->TexFormat->TexelBytes; /* in bytes */
- tex.height = imageHeight;
- } else {
- tex.width = imageWidth; /* compressed */
- tex.height = imageHeight;
- if (tex.height < 4)
- tex.height = 4;
- }
- tex.image = &tmp;
-#if 0
- tex.width /= 4;
-#endif
-
- /* copy (x,y,width,height,data) */
- memcpy(&tmp, &t->image[face][hwlevel], sizeof(tmp));
-#if 0
- tex.image->width /=4;
-#endif
-
-#if 0
- sleep(1);
-
- fprintf(stderr, "*** Uploading texture\n");
- fprintf(stderr, " offset=0x%08x\n", offset);
- fprintf(stderr, " image width=%d height=%d\n",
- imageWidth, imageHeight);
- fprintf(stderr, " blit width=%d height=%d data=%p\n",
- t->image[face][hwlevel].width,
- t->image[face][hwlevel].height,
- t->image[face][hwlevel].data);
-#endif
-
- LOCK_HARDWARE(&rmesa->radeon);
- do {
- ret = drmCommandWriteRead(rmesa->radeon.dri.fd, DRM_RADEON_TEXTURE,
- &tex, sizeof(drm_radeon_texture_t));
- if (ret) {
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr,
- "DRM_RADEON_TEXTURE: again!\n");
- usleep(1);
- }
- } while (ret && errno == EAGAIN);
-
- UNLOCK_HARDWARE(&rmesa->radeon);
-
- if (ret) {
- fprintf(stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret);
- fprintf(stderr, " offset=0x%08x\n", offset);
- fprintf(stderr, " image width=%d height=%d\n",
- imageWidth, imageHeight);
- fprintf(stderr, " blit width=%d height=%d data=%p\n",
- t->image[face][hwlevel].width,
- t->image[face][hwlevel].height,
- t->image[face][hwlevel].data);
- exit(1);
- }
-}
-
-/**
- * Upload the texture images associated with texture \a t. This might
- * require the allocation of texture memory.
- *
- * \param rmesa Context pointer
- * \param t Texture to be uploaded
- * \param face Cube map face to be uploaded. Zero for non-cube maps.
- */
-
-int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, GLuint face)
-{
- const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- if (RADEON_DEBUG & (DEBUG_TEXTURE | DEBUG_IOCTL)) {
- fprintf(stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
- (void *)rmesa->radeon.glCtx, (void *)t->base.tObj,
- t->base.totalSize, t->base.firstLevel,
- t->base.lastLevel);
- }
-
- if (!t || t->base.totalSize == 0)
- return 0;
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
- radeonFinish(rmesa->radeon.glCtx);
- }
-
- LOCK_HARDWARE(&rmesa->radeon);
-
- if (t->base.memBlock == NULL) {
- int heap;
-
- heap = driAllocateTexture(rmesa->texture_heaps, rmesa->nr_heaps,
- (driTextureObject *) t);
- if (heap == -1) {
- UNLOCK_HARDWARE(&rmesa->radeon);
- return -1;
- }
-
- /* Set the base offset of the texture image */
- t->bufAddr = rmesa->radeon.radeonScreen->texOffset[heap]
- + t->base.memBlock->ofs;
- t->offset = t->bufAddr;
-
- /* Mark this texobj as dirty on all units:
- */
- t->dirty_state = TEX_ALL;
- }
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU((driTextureObject *) t);
- UNLOCK_HARDWARE(&rmesa->radeon);
-
- /* Upload any images that are new */
- if (t->base.dirty_images[face]) {
- int i;
- for (i = 0; i < numLevels; i++) {
- if ((t->base.
- dirty_images[face] & (1 <<
- (i + t->base.firstLevel))) !=
- 0) {
- uploadSubImage(rmesa, t, i, 0, 0,
- t->image[face][i].width,
- t->image[face][i].height, face);
- }
- }
- t->base.dirty_images[face] = 0;
- }
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
- radeonFinish(rmesa->radeon.glCtx);
- }
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.c
deleted file mode 100644
index 71d28db05..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.c
+++ /dev/null
@@ -1,270 +0,0 @@
-#include "glheader.h"
-#include "state.h"
-#include "imports.h"
-#include "enums.h"
-#include "macros.h"
-#include "context.h"
-#include "dd.h"
-#include "simple_list.h"
-
-#include "api_arrayelt.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "texformat.h"
-
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "r300_context.h"
-#if USE_ARB_F_P == 0
-#include "r300_ioctl.h"
-#include "r300_state.h"
-#include "r300_reg.h"
-#include "r300_program.h"
-#include "r300_emit.h"
-#include "r300_fixed_pipelines.h"
-#include "r300_tex.h"
-#include "pixel_shader.h"
-#include "r300_texprog.h"
-
-/* TODO: we probably should have a better way to emit alu instructions */
-#define INST0 p->alu.inst[p->alu.length].inst0 =
-#define INST1 p->alu.inst[p->alu.length].inst1 =
-#define INST2 p->alu.inst[p->alu.length].inst2 =
-#define INST3 p->alu.inst[p->alu.length].inst3 =
-#define EMIT_INST p->alu.length++
-
-void emit_tex(struct r300_pixel_shader_program *p, GLuint dest, GLuint unit, GLuint src)
-{
- p->tex.inst[p->tex.length++] = 0
- | (src << R300_FPITX_SRC_SHIFT)
- | (dest << R300_FPITX_DST_SHIFT)
- | (unit << R300_FPITX_IMAGE_SHIFT)
- /* I don't know if this is needed, but the hardcoded 0x18000 set it, so I will too */
- | (3 << 15);
-// fprintf(stderr, "emit texinst: 0x%x\n", p->tex.inst[p->tex.length-1]);
-}
-
-GLuint get_source(struct r300_pixel_shader_state *ps, GLenum src, GLuint unit, GLuint tc_reg) {
- switch (src) {
- case GL_TEXTURE:
- if (!ps->have_sample) {
- emit_tex(&ps->program, tc_reg, unit, tc_reg);
- ps->have_sample = 1;
- }
- return tc_reg;
- case GL_CONSTANT:
- WARN_ONCE("TODO: Implement envcolor\n");
- return ps->color_reg;
- case GL_PRIMARY_COLOR:
- return ps->color_reg;
- case GL_PREVIOUS:
- return ps->src_previous;
- default:
- WARN_ONCE("Unknown source enum\n");
- return ps->src_previous;
- }
-}
-
-GLuint get_temp(struct r300_pixel_shader_program *p)
-{
- return p->temp_register_count++;
-}
-
-inline void emit_texenv_color(r300ContextPtr r300, struct r300_pixel_shader_state *ps,
- GLuint out, GLenum envmode, GLenum format, GLuint unit, GLuint tc_reg) {
- struct r300_pixel_shader_program *p = &ps->program;
-
- const GLuint Cp = get_source(ps, GL_PREVIOUS, unit, tc_reg);
- const GLuint Cs = get_source(ps, GL_TEXTURE, unit, tc_reg);
-
- switch(envmode) {
- case GL_DECAL: /* TODO */
- case GL_BLEND: /* TODO */
- case GL_REPLACE:
- INST0 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO);
- switch (format) {
- case GL_ALPHA:
- // Cv = Cp
- INST1 EASY_PFS_INSTR1(out, Cp, PFS_FLAG_CONST, PFS_FLAG_CONST, ALL, NONE);
- break;
- default:
- // Cv = Cs
- INST1 EASY_PFS_INSTR1(out, Cs, PFS_FLAG_CONST, PFS_FLAG_CONST, ALL, NONE);
- break;
- }
- break;
- case GL_MODULATE:
- switch (format) {
- case GL_ALPHA:
- // Cv = Cp
- INST0 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO);
- INST1 EASY_PFS_INSTR1(out, Cp, PFS_FLAG_CONST, PFS_FLAG_CONST, ALL, NONE);
- break;
- default:
- // Cv = CpCs
- INST0 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, SRC1C_XYZ, ZERO);
- INST1 EASY_PFS_INSTR1(out, Cp, Cs, PFS_FLAG_CONST, ALL, NONE);
- break;
- }
- break;
- case GL_ADD:
- switch (format) {
- case GL_ALPHA:
- // Cv = Cp
- INST0 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO);
- INST1 EASY_PFS_INSTR1(out, Cp, PFS_FLAG_CONST, PFS_FLAG_CONST, ALL, NONE);
- break;
- default:
- // Cv = Cp + Cs
- INST0 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, SRC1C_XYZ);
- INST1 EASY_PFS_INSTR1(out, Cp, Cs, PFS_FLAG_CONST, ALL, NONE);
- break;
- }
- break;
- default:
- fprintf(stderr, "%s: should never get here!\n", __func__);
- break;
- }
-
- return;
-}
-
-inline void emit_texenv_alpha(r300ContextPtr r300, struct r300_pixel_shader_state *ps,
- GLuint out, GLenum envmode, GLenum format, GLuint unit, GLuint tc_reg) {
- struct r300_pixel_shader_program *p = &ps->program;
-
- const GLuint Ap = get_source(ps, GL_PREVIOUS, unit, tc_reg);
- const GLuint As = get_source(ps, GL_TEXTURE, unit, tc_reg);
-
- switch(envmode) {
- case GL_DECAL: /* TODO */
- case GL_BLEND: /* TODO */
- case GL_REPLACE:
- INST2 EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO);
- switch (format) {
- case GL_LUMINANCE:
- case GL_RGB:
- // Av = Ap
- INST3 EASY_PFS_INSTR3(out, Ap, PFS_FLAG_CONST, PFS_FLAG_CONST, REG);
- break;
- default:
- INST3 EASY_PFS_INSTR3(out, As, PFS_FLAG_CONST, PFS_FLAG_CONST, REG);
- break;
- }
- break;
- case GL_MODULATE:
- case GL_ADD:
- switch (format) {
- case GL_LUMINANCE:
- case GL_RGB:
- // Av = Ap
- INST2 EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO);
- INST3 EASY_PFS_INSTR3(out, Ap, PFS_FLAG_CONST, PFS_FLAG_CONST, REG);
- break;
- default:
- // Av = ApAs
- INST2 EASY_PFS_INSTR2(MAD, SRC0A, SRC1A, ZERO);
- INST3 EASY_PFS_INSTR3(out, Ap, As, PFS_FLAG_CONST, REG);
- break;
- }
- break;
- default:
- fprintf(stderr, "%s: should never get here!\n", __func__);
- break;
- }
-
- return;
-}
-
-GLuint emit_texenv(r300ContextPtr r300, GLuint tc_reg, GLuint unit)
-{
- struct r300_pixel_shader_state *ps = &r300->state.pixel_shader;
- struct r300_pixel_shader_program *p = &ps->program;
- GLcontext *ctx = r300->radeon.glCtx;
- struct gl_texture_object *texobj = ctx->Texture.Unit[unit]._Current;
- GLenum envmode = ctx->Texture.Unit[unit].EnvMode;
- GLenum format = texobj->Image[0][texobj->BaseLevel]->Format;
-
- const GLuint out = tc_reg;
- const GLuint Cf = get_source(ps, GL_PRIMARY_COLOR, unit, tc_reg);
-
- WARN_ONCE("Texture environments are currently incomplete / wrong! Help me!\n");
-// fprintf(stderr, "EnvMode = %s\n", _mesa_lookup_enum_by_nr(ctx->Texture.Unit[unit].EnvMode));
-
- switch (envmode) {
- case GL_REPLACE:
- case GL_MODULATE:
- case GL_DECAL:
- case GL_BLEND:
- case GL_ADD:
- /* Maybe these should be combined? I thought it'd be messy */
- emit_texenv_color(r300, ps, out, envmode, format, unit, tc_reg);
- emit_texenv_alpha(r300, ps, out, envmode, format, unit, tc_reg);
- EMIT_INST;
- return out;
- break;
- case GL_COMBINE:
- WARN_ONCE("EnvMode == GL_COMBINE unsupported! Help Me!!\n");
- return get_source(ps, GL_TEXTURE, unit, tc_reg);
- break;
- default:
- WARN_ONCE("Unknown EnvMode == %d, name=%s\n", envmode,
- _mesa_lookup_enum_by_nr(envmode));
- return get_source(ps, GL_TEXTURE, unit, tc_reg);
- break;
- }
-
-}
-
-void r300GenerateTextureFragmentShader(r300ContextPtr r300)
-{
- struct r300_pixel_shader_state *ps = &r300->state.pixel_shader;
- struct r300_pixel_shader_program *p = &ps->program;
- GLcontext *ctx = r300->radeon.glCtx;
- int i, tc_reg;
- GLuint OutputsWritten;
-
- if(hw_tcl_on)
- OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->OutputsWritten;
-
- p->tex.length = 0;
- p->alu.length = 0;
- p->active_nodes = 1;
- p->first_node_has_tex = 1;
- p->temp_register_count = r300->state.texture.tc_count + 1; /* texcoords and colour reg */
-
- ps->color_reg = r300->state.texture.tc_count;
- ps->src_previous = ps->color_reg;
-
- tc_reg = 0;
- for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
- if (TMU_ENABLED(ctx, i)) {
- ps->have_sample = 0;
- ps->src_previous = emit_texenv(r300, tc_reg, i);
- tc_reg++;
- }
- }
-
-/* Do a MOV from last output, to destination reg.. This won't be needed when we
- * have a better way of emitting alu instructions
- */
- INST0 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, ONE, ZERO);
- INST1 EASY_PFS_INSTR1(0, ps->src_previous, PFS_FLAG_CONST, PFS_FLAG_CONST, NONE, ALL);
- INST2 EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO);
- INST3 EASY_PFS_INSTR3(0, ps->src_previous, PFS_FLAG_CONST, PFS_FLAG_CONST, OUTPUT);
- EMIT_INST;
-
- p->node[3].tex_end = ps->program.tex.length - 1;
- p->node[3].tex_offset = 0;
- p->node[3].alu_end = ps->program.alu.length - 1;
- p->node[3].alu_offset = 0;
-
- p->tex_end = ps->program.tex.length - 1;
- p->tex_offset = 0;
- p->alu_end = ps->program.alu.length - 1;
- p->alu_offset = 0;
-}
-#endif // USE_ARB_F_P == 0
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.h
deleted file mode 100644
index 4e91a1169..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texprog.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __R300_TEXPROG_H_
-#define __R300_TEXPROG_H_
-
-#include "r300_context.h"
-
-void r300GenerateTextureFragmentShader(r300ContextPtr r300);
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texstate.c
deleted file mode 100644
index b06629ca1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_texstate.c
+++ /dev/null
@@ -1,1465 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r300/r300_texstate.c,v 1.3 2003/02/15 22:18:47 dawes Exp $ */
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-#include "enums.h"
-
-#include "r300_context.h"
-#include "r300_state.h"
-#include "r300_ioctl.h"
-#include "radeon_ioctl.h"
-//#include "r300_swtcl.h"
-#include "r300_tex.h"
-//#include "r300_tcl.h"
-#include "r300_reg.h"
-
-#define R200_TXFORMAT_A8 R200_TXFORMAT_I8
-#define R200_TXFORMAT_L8 R200_TXFORMAT_I8
-#define R200_TXFORMAT_AL88 R200_TXFORMAT_AI88
-#define R200_TXFORMAT_YCBCR R200_TXFORMAT_YVYU422
-#define R200_TXFORMAT_YCBCR_REV R200_TXFORMAT_VYUY422
-
-#define _COLOR(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, 0 }
-#define _COLOR_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { R200_TXFORMAT_ ## f, 0 }
-#define _ALPHA(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _ALPHA_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _YUV(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, R200_YUV_TO_RGB }
-#define _INVALID(f) \
- [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
-#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_YCBCR_REV) \
- && tx_table[f].flag )
-
-#define _ASSIGN(entry, format) \
- [ MESA_FORMAT_ ## entry ] = { format, 0, 1}
-
-static const struct {
- GLuint format, filter;
-} tx_table0[] = {
- _ALPHA(RGBA8888),
- _ALPHA_REV(RGBA8888),
- _ALPHA(ARGB8888),
- _ALPHA_REV(ARGB8888),
- _INVALID(RGB888),
- _COLOR(RGB565),
- _COLOR_REV(RGB565),
- _ALPHA(ARGB4444),
- _ALPHA_REV(ARGB4444),
- _ALPHA(ARGB1555),
- _ALPHA_REV(ARGB1555),
- _ALPHA(AL88),
- _ALPHA_REV(AL88),
- _ALPHA(A8),
- _COLOR(L8),
- _ALPHA(I8),
- _INVALID(CI8),
- _YUV(YCBCR),
- _YUV(YCBCR_REV),
- };
-
-static const struct {
- GLuint format, filter, flag;
-} tx_table[] = {
- /*
- * Note that the _REV formats are the same as the non-REV formats.
- * This is because the REV and non-REV formats are identical as a
- * byte string, but differ when accessed as 16-bit or 32-bit words
- * depending on the endianness of the host. Since the textures are
- * transferred to the R300 as a byte string (i.e. without any
- * byte-swapping), the R300 sees the REV and non-REV formats
- * identically. -- paulus
- */
- _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)),
- _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)),
- _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)),
- _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)),
- _ASSIGN(RGB888, 0xffffffff),
- _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)),
- _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)),
- _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)),
- _ASSIGN(ARGB4444_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)),
- _ASSIGN(ARGB1555, R300_EASY_TX_FORMAT(Z, Y, X, W, W1Z5Y5X5)),
- _ASSIGN(ARGB1555_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W1Z5Y5X5)),
- _ASSIGN(AL88, R300_EASY_TX_FORMAT(Y, Y, Y, X, Y8X8)),
- _ASSIGN(AL88_REV, R300_EASY_TX_FORMAT(Y, Y, Y, X, Y8X8)),
- _ASSIGN(RGB332, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2)),
- _ASSIGN(A8, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8)),
- _ASSIGN(L8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8)),
- _ASSIGN(I8, R300_EASY_TX_FORMAT(X, X, X, X, X8)),
- _ASSIGN(CI8, R300_EASY_TX_FORMAT(X, X, X, X, X8)),
- _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE ),
- _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE),
- };
-
-#undef _COLOR
-#undef _ALPHA
-#undef _INVALID
-#undef _ASSIGN
-
-
-/**
- * This function computes the number of bytes of storage needed for
- * the given texture object (all mipmap levels, all cube faces).
- * The \c image[face][level].x/y/width/height parameters for upload/blitting
- * are computed here. \c filter, \c format, etc. will be set here
- * too.
- *
- * \param rmesa Context pointer
- * \param tObj GL texture object whose images are to be posted to
- * hardware state.
- */
-static void r300SetTexImages(r300ContextPtr rmesa,
- struct gl_texture_object *tObj)
-{
- r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage =
- tObj->Image[0][tObj->BaseLevel];
- GLint curOffset;
- GLint i;
- GLint numLevels;
- GLint log2Width, log2Height, log2Depth;
-
- /* Set the hardware texture format
- */
-
- t->format &= ~(R200_TXFORMAT_FORMAT_MASK |
- R200_TXFORMAT_ALPHA_IN_MAP);
-#if 0
- t->filter &= ~R200_YUV_TO_RGB;
-#endif
- if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) {
- t->format =
- tx_table[baseImage->TexFormat->MesaFormat].format;
-#if 1
- t->filter |=
- tx_table[baseImage->TexFormat->MesaFormat].filter;
-#endif
- } else {
- _mesa_problem(NULL, "unexpected texture format in %s",
- __FUNCTION__);
- return;
- }
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
-
- driCalculateTextureFirstLastLevel((driTextureObject *) t);
- log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
- log2Depth = tObj->Image[0][t->base.firstLevel]->DepthLog2;
-
- numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS);
-
- /* Calculate mipmap offsets and dimensions for blitting (uploading)
- * The idea is that we lay out the mipmap levels within a block of
- * memory organized as a rectangle of width BLIT_WIDTH_BYTES.
- */
- curOffset = 0;
-
- for (i = 0; i < numLevels; i++) {
- const struct gl_texture_image *texImage;
- GLuint size;
-
- texImage = tObj->Image[0][i + t->base.firstLevel];
- if (!texImage)
- break;
-
- /* find image size in bytes */
- if (texImage->IsCompressed) {
- size = texImage->CompressedSize;
- } else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- size =
- ((texImage->Width *
- texImage->TexFormat->TexelBytes + 63)
- & ~63) * texImage->Height;
- } else {
- int w =
- texImage->Width * texImage->TexFormat->TexelBytes;
- if (w < 32)
- w = 32;
- size = w * texImage->Height * texImage->Depth;
- }
- assert(size > 0);
-
- if(0)
- fprintf(stderr, "w=%d h=%d d=%d tb=%d intFormat=%d\n", texImage->Width, texImage->Height,
- texImage->Depth, texImage->TexFormat->TexelBytes,
- texImage->IntFormat);
-
- /* Align to 32-byte offset. It is faster to do this unconditionally
- * (no branch penalty).
- */
-
- curOffset = (curOffset + 0x1f) & ~0x1f;
-
- t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES;
- t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES;
- t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES);
- t->image[0][i].height = size / t->image[0][i].width;
-
-#if 0
- /* for debugging only and only applicable to non-rectangle targets */
- assert(size % t->image[0][i].width == 0);
- assert(t->image[0][i].x == 0
- || (size < BLIT_WIDTH_BYTES
- && t->image[0][i].height == 1));
-#endif
-
- if (0)
- fprintf(stderr,
- "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n",
- i, texImage->Width, texImage->Height,
- t->image[0][i].x, t->image[0][i].y,
- t->image[0][i].width, t->image[0][i].height,
- size, curOffset);
-
- curOffset += size;
-
- }
-
- /* Align the total size of texture memory block.
- */
- t->base.totalSize =
- (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK;
-
- /* Setup remaining cube face blits, if needed */
- if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
- /* Round totalSize up to multiple of BLIT_WIDTH_BYTES */
- const GLuint faceSize =
- (t->base.totalSize + BLIT_WIDTH_BYTES - 1)
- & ~(BLIT_WIDTH_BYTES - 1);
- const GLuint lines = faceSize / BLIT_WIDTH_BYTES;
- GLuint face;
- /* reuse face 0 x/y/width/height - just adjust y */
- for (face = 1; face < 6; face++) {
- for (i = 0; i < numLevels; i++) {
- t->image[face][i].x = t->image[0][i].x;
- t->image[face][i].y =
- t->image[0][i].y + face * lines;
- t->image[face][i].width = t->image[0][i].width;
- t->image[face][i].height =
- t->image[0][i].height;
- }
- }
- t->base.totalSize = 6 * faceSize; /* total texmem needed */
- }
-
- /* Hardware state:
- */
-#if 0
- t->filter &= ~R200_MAX_MIP_LEVEL_MASK;
- t->filter |= (numLevels - 1) << R200_MAX_MIP_LEVEL_SHIFT;
-#endif
-#if 0
- t->format &= ~(R200_TXFORMAT_WIDTH_MASK |
- R200_TXFORMAT_HEIGHT_MASK |
- R200_TXFORMAT_CUBIC_MAP_ENABLE |
- R200_TXFORMAT_F5_WIDTH_MASK |
- R200_TXFORMAT_F5_HEIGHT_MASK);
- t->format |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) |
- (log2Height << R200_TXFORMAT_HEIGHT_SHIFT));
-#endif
-
- t->format_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK);
- if (tObj->Target == GL_TEXTURE_3D) {
- t->format_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT);
- t->format_x |= R200_TEXCOORD_VOLUME;
- } else if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
- ASSERT(log2Width == log2Height);
- t->format |= ((log2Width << R200_TXFORMAT_F5_WIDTH_SHIFT) |
- (log2Height << R200_TXFORMAT_F5_HEIGHT_SHIFT)
- | (R200_TXFORMAT_CUBIC_MAP_ENABLE));
- t->format_x |= R200_TEXCOORD_CUBIC_ENV;
- t->pp_cubic_faces = ((log2Width << R200_FACE_WIDTH_1_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_1_SHIFT) |
- (log2Width << R200_FACE_WIDTH_2_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_2_SHIFT) |
- (log2Width << R200_FACE_WIDTH_3_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_3_SHIFT) |
- (log2Width << R200_FACE_WIDTH_4_SHIFT) |
- (log2Height << R200_FACE_HEIGHT_4_SHIFT));
- }
-
- t->size = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << R300_TX_WIDTHMASK_SHIFT)
- |((tObj->Image[0][t->base.firstLevel]->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)
- |((log2Width>log2Height)?log2Width:log2Height)<<R300_TX_SIZE_SHIFT);
-
- /* Only need to round to nearest 32 for textures, but the blitter
- * requires 64-byte aligned pitches, and we may/may not need the
- * blitter. NPOT only!
- */
- if (baseImage->IsCompressed)
- t->pitch =
- (tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63);
- else
- t->pitch =
- ((tObj->Image[0][t->base.firstLevel]->Width *
- baseImage->TexFormat->TexelBytes) + 63) & ~(63);
- t->pitch -= 32;
-
- t->dirty_state = TEX_ALL;
-
- /* FYI: r300UploadTexImages( rmesa, t ) used to be called here */
-}
-
-/* ================================================================
- * Texture combine functions
- */
-
-/* GL_ARB_texture_env_combine support
- */
-
-/* The color tables have combine functions for GL_SRC_COLOR,
- * GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
- */
-static GLuint r300_register_color[][R200_MAX_TEXTURE_UNITS] = {
- {
- R200_TXC_ARG_A_R0_COLOR,
- R200_TXC_ARG_A_R1_COLOR,
- R200_TXC_ARG_A_R2_COLOR,
- R200_TXC_ARG_A_R3_COLOR,
- R200_TXC_ARG_A_R4_COLOR,
- R200_TXC_ARG_A_R5_COLOR},
- {
- R200_TXC_ARG_A_R0_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R1_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R2_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R3_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R4_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R5_COLOR | R200_TXC_COMP_ARG_A},
- {
- R200_TXC_ARG_A_R0_ALPHA,
- R200_TXC_ARG_A_R1_ALPHA,
- R200_TXC_ARG_A_R2_ALPHA,
- R200_TXC_ARG_A_R3_ALPHA,
- R200_TXC_ARG_A_R4_ALPHA,
- R200_TXC_ARG_A_R5_ALPHA},
- {
- R200_TXC_ARG_A_R0_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R1_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R2_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R3_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R4_ALPHA | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_R5_ALPHA | R200_TXC_COMP_ARG_A},
-};
-
-static GLuint r300_tfactor_color[] = {
- R200_TXC_ARG_A_TFACTOR_COLOR,
- R200_TXC_ARG_A_TFACTOR_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_TFACTOR_ALPHA,
- R200_TXC_ARG_A_TFACTOR_ALPHA | R200_TXC_COMP_ARG_A
-};
-
-static GLuint r300_primary_color[] = {
- R200_TXC_ARG_A_DIFFUSE_COLOR,
- R200_TXC_ARG_A_DIFFUSE_COLOR | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_DIFFUSE_ALPHA,
- R200_TXC_ARG_A_DIFFUSE_ALPHA | R200_TXC_COMP_ARG_A
-};
-
-/* GL_ZERO table - indices 0-3
- * GL_ONE table - indices 1-4
- */
-static GLuint r300_zero_color[] = {
- R200_TXC_ARG_A_ZERO,
- R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_ZERO,
- R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A,
- R200_TXC_ARG_A_ZERO
-};
-
-/* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
- */
-static GLuint r300_register_alpha[][R200_MAX_TEXTURE_UNITS] = {
- {
- R200_TXA_ARG_A_R0_ALPHA,
- R200_TXA_ARG_A_R1_ALPHA,
- R200_TXA_ARG_A_R2_ALPHA,
- R200_TXA_ARG_A_R3_ALPHA,
- R200_TXA_ARG_A_R4_ALPHA,
- R200_TXA_ARG_A_R5_ALPHA},
- {
- R200_TXA_ARG_A_R0_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R1_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R2_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R3_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R4_ALPHA | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_R5_ALPHA | R200_TXA_COMP_ARG_A},
-};
-
-static GLuint r300_tfactor_alpha[] = {
- R200_TXA_ARG_A_TFACTOR_ALPHA,
- R200_TXA_ARG_A_TFACTOR_ALPHA | R200_TXA_COMP_ARG_A
-};
-
-static GLuint r300_primary_alpha[] = {
- R200_TXA_ARG_A_DIFFUSE_ALPHA,
- R200_TXA_ARG_A_DIFFUSE_ALPHA | R200_TXA_COMP_ARG_A
-};
-
-/* GL_ZERO table - indices 0-1
- * GL_ONE table - indices 1-2
- */
-static GLuint r300_zero_alpha[] = {
- R200_TXA_ARG_A_ZERO,
- R200_TXA_ARG_A_ZERO | R200_TXA_COMP_ARG_A,
- R200_TXA_ARG_A_ZERO,
-};
-
-/* Extract the arg from slot A, shift it into the correct argument slot
- * and set the corresponding complement bit.
- */
-#define R200_COLOR_ARG( n, arg ) \
-do { \
- color_combine |= \
- ((color_arg[n] & R200_TXC_ARG_A_MASK) \
- << R200_TXC_ARG_##arg##_SHIFT); \
- color_combine |= \
- ((color_arg[n] >> R200_TXC_COMP_ARG_A_SHIFT) \
- << R200_TXC_COMP_ARG_##arg##_SHIFT); \
-} while (0)
-
-#define R200_ALPHA_ARG( n, arg ) \
-do { \
- alpha_combine |= \
- ((alpha_arg[n] & R200_TXA_ARG_A_MASK) \
- << R200_TXA_ARG_##arg##_SHIFT); \
- alpha_combine |= \
- ((alpha_arg[n] >> R200_TXA_COMP_ARG_A_SHIFT) \
- << R200_TXA_COMP_ARG_##arg##_SHIFT); \
-} while (0)
-
-/* ================================================================
- * Texture unit state management
- */
-
-static GLboolean r300UpdateTextureEnv(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint color_combine, alpha_combine;
-
-#if 0 /* disable for now.. */
- GLuint color_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] &
- ~(R200_TXC_SCALE_MASK);
- GLuint alpha_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] &
- ~(R200_TXA_DOT_ALPHA | R200_TXA_SCALE_MASK);
-#endif
-
- GLuint color_scale=0, alpha_scale=0;
-
- /* texUnit->_Current can be NULL if and only if the texture unit is
- * not actually enabled.
- */
- assert((texUnit->_ReallyEnabled == 0)
- || (texUnit->_Current != NULL));
-
- if (RADEON_DEBUG & DEBUG_TEXTURE) {
- fprintf(stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx,
- unit);
- }
-
- /* Set the texture environment state. Isn't this nice and clean?
- * The chip will automagically set the texture alpha to 0xff when
- * the texture format does not include an alpha component. This
- * reduces the amount of special-casing we have to do, alpha-only
- * textures being a notable exception.
- */
- /* Don't cache these results.
- */
-#if 0
- rmesa->state.texture.unit[unit].format = 0;
-#endif
- rmesa->state.texture.unit[unit].envMode = 0;
-
-
- if (!texUnit->_ReallyEnabled) {
- if (unit == 0) {
- color_combine =
- R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO |
- R200_TXC_ARG_C_DIFFUSE_COLOR | R200_TXC_OP_MADD;
- alpha_combine =
- R200_TXA_ARG_A_ZERO | R200_TXA_ARG_B_ZERO |
- R200_TXA_ARG_C_DIFFUSE_ALPHA | R200_TXA_OP_MADD;
- } else {
- color_combine =
- R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO |
- R200_TXC_ARG_C_R0_COLOR | R200_TXC_OP_MADD;
- alpha_combine =
- R200_TXA_ARG_A_ZERO | R200_TXA_ARG_B_ZERO |
- R200_TXA_ARG_C_R0_ALPHA | R200_TXA_OP_MADD;
- }
- } else {
- GLuint color_arg[3], alpha_arg[3];
- GLuint i;
- const GLuint numColorArgs =
- texUnit->_CurrentCombine->_NumArgsRGB;
- const GLuint numAlphaArgs = texUnit->_CurrentCombine->_NumArgsA;
- GLuint RGBshift = texUnit->_CurrentCombine->ScaleShiftRGB;
- GLuint Ashift = texUnit->_CurrentCombine->ScaleShiftA;
-
- /* Step 1:
- * Extract the color and alpha combine function arguments.
- */
- for (i = 0; i < numColorArgs; i++) {
- const GLint op =
- texUnit->_CurrentCombine->OperandRGB[i] -
- GL_SRC_COLOR;
- assert(op >= 0);
- assert(op <= 3);
- switch (texUnit->_CurrentCombine->SourceRGB[i]) {
- case GL_TEXTURE:
- color_arg[i] = r300_register_color[op][unit];
- break;
- case GL_CONSTANT:
- color_arg[i] = r300_tfactor_color[op];
- break;
- case GL_PRIMARY_COLOR:
- color_arg[i] = r300_primary_color[op];
- break;
- case GL_PREVIOUS:
- if (unit == 0)
- color_arg[i] = r300_primary_color[op];
- else
- color_arg[i] =
- r300_register_color[op][0];
- break;
- case GL_ZERO:
- color_arg[i] = r300_zero_color[op];
- break;
- case GL_ONE:
- color_arg[i] = r300_zero_color[op + 1];
- break;
- default:
- return GL_FALSE;
- }
- }
-
- for (i = 0; i < numAlphaArgs; i++) {
- const GLint op =
- texUnit->_CurrentCombine->OperandA[i] -
- GL_SRC_ALPHA;
- assert(op >= 0);
- assert(op <= 1);
- switch (texUnit->_CurrentCombine->SourceA[i]) {
- case GL_TEXTURE:
- alpha_arg[i] = r300_register_alpha[op][unit];
- break;
- case GL_CONSTANT:
- alpha_arg[i] = r300_tfactor_alpha[op];
- break;
- case GL_PRIMARY_COLOR:
- alpha_arg[i] = r300_primary_alpha[op];
- break;
- case GL_PREVIOUS:
- if (unit == 0)
- alpha_arg[i] = r300_primary_alpha[op];
- else
- alpha_arg[i] =
- r300_register_alpha[op][0];
- break;
- case GL_ZERO:
- alpha_arg[i] = r300_zero_alpha[op];
- break;
- case GL_ONE:
- alpha_arg[i] = r300_zero_alpha[op + 1];
- break;
- default:
- return GL_FALSE;
- }
- }
-
- /* Step 2:
- * Build up the color and alpha combine functions.
- */
- switch (texUnit->_CurrentCombine->ModeRGB) {
- case GL_REPLACE:
- color_combine = (R200_TXC_ARG_A_ZERO |
- R200_TXC_ARG_B_ZERO |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG(0, C);
- break;
- case GL_MODULATE:
- color_combine = (R200_TXC_ARG_C_ZERO |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, B);
- break;
- case GL_ADD:
- color_combine = (R200_TXC_ARG_B_ZERO |
- R200_TXC_COMP_ARG_B |
- R200_TXC_OP_MADD);
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, C);
- break;
- case GL_ADD_SIGNED:
- color_combine = (R200_TXC_ARG_B_ZERO | R200_TXC_COMP_ARG_B | R200_TXC_BIAS_ARG_C | /* new */
- R200_TXC_OP_MADD); /* was ADDSIGNED */
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, C);
- break;
- case GL_SUBTRACT:
- color_combine = (R200_TXC_ARG_B_ZERO |
- R200_TXC_COMP_ARG_B |
- R200_TXC_NEG_ARG_C | R200_TXC_OP_MADD);
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, C);
- break;
- case GL_INTERPOLATE:
- color_combine = (R200_TXC_OP_LERP);
- R200_COLOR_ARG(0, B);
- R200_COLOR_ARG(1, A);
- R200_COLOR_ARG(2, C);
- break;
-
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- /* The EXT version of the DOT3 extension does not support the
- * scale factor, but the ARB version (and the version in OpenGL
- * 1.3) does.
- */
- RGBshift = 0;
- /* FALLTHROUGH */
-
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- /* DOT3 works differently on R200 than on R100. On R100, just
- * setting the DOT3 mode did everything for you. On R200, the
- * driver has to enable the biasing and scale in the inputs to
- * put them in the proper [-1,1] range. This is what the 4x and
- * the -0.5 in the DOT3 spec do. The post-scale is then set
- * normally.
- */
-
- color_combine = (R200_TXC_ARG_C_ZERO |
- R200_TXC_OP_DOT3 |
- R200_TXC_BIAS_ARG_A |
- R200_TXC_BIAS_ARG_B |
- R200_TXC_SCALE_ARG_A |
- R200_TXC_SCALE_ARG_B);
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, B);
- break;
-
- case GL_MODULATE_ADD_ATI:
- color_combine = (R200_TXC_OP_MADD);
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, C);
- R200_COLOR_ARG(2, B);
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- color_combine = (R200_TXC_BIAS_ARG_C | /* new */
- R200_TXC_OP_MADD); /* was ADDSIGNED */
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, C);
- R200_COLOR_ARG(2, B);
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- color_combine = (R200_TXC_NEG_ARG_C | R200_TXC_OP_MADD);
- R200_COLOR_ARG(0, A);
- R200_COLOR_ARG(1, C);
- R200_COLOR_ARG(2, B);
- break;
- default:
- return GL_FALSE;
- }
-
- switch (texUnit->_CurrentCombine->ModeA) {
- case GL_REPLACE:
- alpha_combine = (R200_TXA_ARG_A_ZERO |
- R200_TXA_ARG_B_ZERO |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG(0, C);
- break;
- case GL_MODULATE:
- alpha_combine = (R200_TXA_ARG_C_ZERO |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, B);
- break;
- case GL_ADD:
- alpha_combine = (R200_TXA_ARG_B_ZERO |
- R200_TXA_COMP_ARG_B |
- R200_TXA_OP_MADD);
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, C);
- break;
- case GL_ADD_SIGNED:
- alpha_combine = (R200_TXA_ARG_B_ZERO | R200_TXA_COMP_ARG_B | R200_TXA_BIAS_ARG_C | /* new */
- R200_TXA_OP_MADD); /* was ADDSIGNED */
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, C);
- break;
- case GL_SUBTRACT:
- alpha_combine = (R200_TXA_ARG_B_ZERO |
- R200_TXA_COMP_ARG_B |
- R200_TXA_NEG_ARG_C | R200_TXA_OP_MADD);
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, C);
- break;
- case GL_INTERPOLATE:
- alpha_combine = (R200_TXA_OP_LERP);
- R200_ALPHA_ARG(0, B);
- R200_ALPHA_ARG(1, A);
- R200_ALPHA_ARG(2, C);
- break;
-
- case GL_MODULATE_ADD_ATI:
- alpha_combine = (R200_TXA_OP_MADD);
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, C);
- R200_ALPHA_ARG(2, B);
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- alpha_combine = (R200_TXA_BIAS_ARG_C | /* new */
- R200_TXA_OP_MADD); /* was ADDSIGNED */
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, C);
- R200_ALPHA_ARG(2, B);
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- alpha_combine = (R200_TXA_NEG_ARG_C | R200_TXA_OP_MADD);
- R200_ALPHA_ARG(0, A);
- R200_ALPHA_ARG(1, C);
- R200_ALPHA_ARG(2, B);
- break;
- default:
- return GL_FALSE;
- }
-
- if ((texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT)
- || (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA)) {
- alpha_scale |= R200_TXA_DOT_ALPHA;
- Ashift = RGBshift;
- }
-
- /* Step 3:
- * Apply the scale factor.
- */
- color_scale |= (RGBshift << R200_TXC_SCALE_SHIFT);
- alpha_scale |= (Ashift << R200_TXA_SCALE_SHIFT);
-
- /* All done!
- */
- }
-
-#if 0
- fprintf(stderr, "color_combine=%08x alpha_combine=%08x color_scale=%08x alpha_scale=%08x\n",
- color_combine, alpha_combine, color_scale, alpha_scale);
-#endif
-
-#if 0
- if (rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND] != color_combine ||
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND] != alpha_combine ||
- rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] != color_scale ||
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] != alpha_scale) {
- R300_STATECHANGE(rmesa, pix[unit]);
- rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND] = color_combine;
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND] = alpha_combine;
- rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] = color_scale;
- rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] = alpha_scale;
- }
-
-#endif
-
- return GL_TRUE;
-}
-
-#define TEXOBJ_TXFILTER_MASK (R200_MAX_MIP_LEVEL_MASK | \
- R200_MIN_FILTER_MASK | \
- R200_MAG_FILTER_MASK | \
- R200_MAX_ANISO_MASK | \
- R200_YUV_TO_RGB | \
- R200_YUV_TEMPERATURE_MASK | \
- R200_CLAMP_S_MASK | \
- R200_CLAMP_T_MASK | \
- R200_BORDER_MODE_D3D )
-
-#define TEXOBJ_TXFORMAT_MASK (R200_TXFORMAT_WIDTH_MASK | \
- R200_TXFORMAT_HEIGHT_MASK | \
- R200_TXFORMAT_FORMAT_MASK | \
- R200_TXFORMAT_F5_WIDTH_MASK | \
- R200_TXFORMAT_F5_HEIGHT_MASK | \
- R200_TXFORMAT_ALPHA_IN_MAP | \
- R200_TXFORMAT_CUBIC_MAP_ENABLE | \
- R200_TXFORMAT_NON_POWER2)
-
-#define TEXOBJ_TXFORMAT_X_MASK (R200_DEPTH_LOG2_MASK | \
- R200_TEXCOORD_MASK | \
- R200_CLAMP_Q_MASK | \
- R200_VOLUME_FILTER_MASK)
-
-static void import_tex_obj_state(r300ContextPtr rmesa,
- int unit, r300TexObjPtr texobj)
-{
-#if 0 /* needs fixing.. or should be done elsewhere */
- GLuint *cmd = R300_DB_STATE(tex[unit]);
-
- cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK;
- cmd[TEX_PP_TXFILTER] |= texobj->filter & TEXOBJ_TXFILTER_MASK;
- cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
- cmd[TEX_PP_TXFORMAT] |= texobj->format & TEXOBJ_TXFORMAT_MASK;
- cmd[TEX_PP_TXFORMAT_X] &= ~TEXOBJ_TXFORMAT_X_MASK;
- cmd[TEX_PP_TXFORMAT_X] |=
- texobj->format_x & TEXOBJ_TXFORMAT_X_MASK;
- cmd[TEX_PP_TXSIZE] = texobj->size; /* NPOT only! */
- cmd[TEX_PP_TXPITCH] = texobj->pitch; /* NPOT only! */
- cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset;
- cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color;
- R200_DB_STATECHANGE(rmesa, &rmesa->hw.tex[unit]);
-
- if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) {
- GLuint *cube_cmd = R200_DB_STATE(cube[unit]);
- GLuint bytesPerFace = texobj->base.totalSize / 6;
- ASSERT(texobj->totalSize % 6 == 0);
- cube_cmd[CUBE_PP_CUBIC_FACES] = texobj->pp_cubic_faces;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F1] =
- texobj->pp_txoffset + 1 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F2] =
- texobj->pp_txoffset + 2 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F3] =
- texobj->pp_txoffset + 3 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F4] =
- texobj->pp_txoffset + 4 * bytesPerFace;
- cube_cmd[CUBE_PP_CUBIC_OFFSET_F5] =
- texobj->pp_txoffset + 5 * bytesPerFace;
- R200_DB_STATECHANGE(rmesa, &rmesa->hw.cube[unit]);
- }
-
- texobj->dirty_state &= ~(1 << unit);
-#endif
-}
-
-static void set_texgen_matrix(r300ContextPtr rmesa,
- GLuint unit,
- const GLfloat * s_plane,
- const GLfloat * t_plane, const GLfloat * r_plane)
-{
- static const GLfloat scale_identity[4] = { 1, 1, 1, 1 };
-
- if (!TEST_EQ_4V(s_plane, scale_identity) ||
- !TEST_EQ_4V(t_plane, scale_identity) ||
- !TEST_EQ_4V(r_plane, scale_identity)) {
- rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE << unit;
- rmesa->TexGenMatrix[unit].m[0] = s_plane[0];
- rmesa->TexGenMatrix[unit].m[4] = s_plane[1];
- rmesa->TexGenMatrix[unit].m[8] = s_plane[2];
- rmesa->TexGenMatrix[unit].m[12] = s_plane[3];
-
- rmesa->TexGenMatrix[unit].m[1] = t_plane[0];
- rmesa->TexGenMatrix[unit].m[5] = t_plane[1];
- rmesa->TexGenMatrix[unit].m[9] = t_plane[2];
- rmesa->TexGenMatrix[unit].m[13] = t_plane[3];
-
- /* NOTE: r_plane goes in the 4th row, not 3rd! */
- rmesa->TexGenMatrix[unit].m[3] = r_plane[0];
- rmesa->TexGenMatrix[unit].m[7] = r_plane[1];
- rmesa->TexGenMatrix[unit].m[11] = r_plane[2];
- rmesa->TexGenMatrix[unit].m[15] = r_plane[3];
-
- //rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-}
-
-/* Need this special matrix to get correct reflection map coords */
-static void set_texgen_reflection_matrix(r300ContextPtr rmesa, GLuint unit)
-{
- static const GLfloat m[16] = {
- -1, 0, 0, 0,
- 0, -1, 0, 0,
- 0, 0, 0, -1,
- 0, 0, -1, 0
- };
- _math_matrix_loadf(&(rmesa->TexGenMatrix[unit]), m);
- _math_matrix_analyse(&(rmesa->TexGenMatrix[unit]));
- rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE << unit;
-}
-
-/* Need this special matrix to get correct normal map coords */
-static void set_texgen_normal_map_matrix(r300ContextPtr rmesa, GLuint unit)
-{
- static const GLfloat m[16] = {
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 0, 1,
- 0, 0, 1, 0
- };
- _math_matrix_loadf(&(rmesa->TexGenMatrix[unit]), m);
- _math_matrix_analyse(&(rmesa->TexGenMatrix[unit]));
- rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE << unit;
-}
-
-/* Ignoring the Q texcoord for now.
- *
- * Returns GL_FALSE if fallback required.
- */
-static GLboolean r300_validate_texgen(GLcontext * ctx, GLuint unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit * 4;
- GLuint tmp = rmesa->TexGenEnabled;
-
- rmesa->TexGenCompSel &= ~(R200_OUTPUT_TEX_0 << unit);
- rmesa->TexGenEnabled &= ~(R200_TEXGEN_TEXMAT_0_ENABLE << unit);
- rmesa->TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE << unit);
- rmesa->TexGenInputs &= ~(R200_TEXGEN_INPUT_MASK << inputshift);
- rmesa->TexGenNeedNormals[unit] = 0;
-
- if (0)
- fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit);
-
- if ((texUnit->TexGenEnabled & (S_BIT | T_BIT | R_BIT)) == 0) {
- /* Disabled, no fallback:
- */
- rmesa->TexGenInputs |=
- (R200_TEXGEN_INPUT_TEXCOORD_0 + unit) << inputshift;
- return GL_TRUE;
- } else if (texUnit->TexGenEnabled & Q_BIT) {
- /* Very easy to do this, in fact would remove a fallback case
- * elsewhere, but I haven't done it yet... Fallback:
- */
- /*fprintf(stderr, "fallback Q_BIT\n"); */
- return GL_FALSE;
- } else if (texUnit->TexGenEnabled == (S_BIT | T_BIT) &&
- texUnit->GenModeS == texUnit->GenModeT) {
- /* OK */
- rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
- /* continue */
- } else if (texUnit->TexGenEnabled == (S_BIT | T_BIT | R_BIT) &&
- texUnit->GenModeS == texUnit->GenModeT &&
- texUnit->GenModeT == texUnit->GenModeR) {
- /* OK */
- rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
- /* continue */
- } else {
- /* Mixed modes, fallback:
- */
- /* fprintf(stderr, "fallback mixed texgen\n"); */
- return GL_FALSE;
- }
-
- rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
-
- switch (texUnit->GenModeS) {
- case GL_OBJECT_LINEAR:
- rmesa->TexGenInputs |= R200_TEXGEN_INPUT_OBJ << inputshift;
- set_texgen_matrix(rmesa, unit,
- texUnit->ObjectPlaneS,
- texUnit->ObjectPlaneT, texUnit->ObjectPlaneR);
- break;
-
- case GL_EYE_LINEAR:
- rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE << inputshift;
- set_texgen_matrix(rmesa, unit,
- texUnit->EyePlaneS,
- texUnit->EyePlaneT, texUnit->EyePlaneR);
- break;
-
- case GL_REFLECTION_MAP_NV:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- rmesa->TexGenInputs |=
- R200_TEXGEN_INPUT_EYE_REFLECT << inputshift;
- set_texgen_reflection_matrix(rmesa, unit);
- break;
-
- case GL_NORMAL_MAP_NV:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- rmesa->TexGenInputs |=
- R200_TEXGEN_INPUT_EYE_NORMAL << inputshift;
- set_texgen_normal_map_matrix(rmesa, unit);
- break;
-
- case GL_SPHERE_MAP:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- rmesa->TexGenInputs |= R200_TEXGEN_INPUT_SPHERE << inputshift;
- break;
-
- default:
- /* Unsupported mode, fallback:
- */
- /* fprintf(stderr, "fallback unsupported texgen\n"); */
- return GL_FALSE;
- }
-
- rmesa->TexGenCompSel |= R200_OUTPUT_TEX_0 << unit;
-
- if (tmp != rmesa->TexGenEnabled) {
- //rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-
- return GL_TRUE;
-}
-
-static void disable_tex(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
-
-#if 0 /* This needs to be redone.. or done elsewhere */
- if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE << unit)) {
- /* Texture unit disabled */
- if (rmesa->state.texture.unit[unit].texobj != NULL) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->state.texture.unit[unit].texobj->base.bound &=
- ~(1UL << unit);
- rmesa->state.texture.unit[unit].texobj = NULL;
- }
-
- R300_STATECHANGE(rmesa, ctx);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~((R200_TEX_0_ENABLE |
- R200_TEX_BLEND_0_ENABLE) <<
- unit);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_BLEND_0_ENABLE;
-
- R300_STATECHANGE(rmesa, tcl);
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &=
- ~(7 << (unit * 3));
-
- if (rmesa->radeon.TclFallback & (RADEON_TCL_FALLBACK_TEXGEN_0 << unit)) {
- TCL_FALLBACK(ctx, (RADEON_TCL_FALLBACK_TEXGEN_0 << unit),
- GL_FALSE);
- }
-
- /* Actually want to keep all units less than max active texture
- * enabled, right? Fix this for >2 texunits.
- */
- /* FIXME: What should happen here if r300UpdateTextureEnv fails? */
- if (unit == 0)
- r300UpdateTextureEnv(ctx, unit);
-
- {
- GLuint inputshift =
- R200_TEXGEN_0_INPUT_SHIFT + unit * 4;
- GLuint tmp = rmesa->TexGenEnabled;
-
- rmesa->TexGenEnabled &=
- ~(R200_TEXGEN_TEXMAT_0_ENABLE << unit);
- rmesa->TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE << unit);
- rmesa->TexGenEnabled &=
- ~(R200_TEXGEN_INPUT_MASK << inputshift);
- rmesa->TexGenNeedNormals[unit] = 0;
- rmesa->TexGenCompSel &= ~(R200_OUTPUT_TEX_0 << unit);
- rmesa->TexGenInputs &=
- ~(R200_TEXGEN_INPUT_MASK << inputshift);
-
- if (tmp != rmesa->TexGenEnabled) {
- rmesa->recheck_texgen[unit] = GL_TRUE;
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
- }
- }
-#endif
-}
-
-static GLboolean enable_tex_2d(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData;
-
- /* Need to load the 2d images associated with this unit.
- */
-#if 0
- if (t->format & R200_TXFORMAT_NON_POWER2) {
- t->format &= ~R200_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-#endif
-
- ASSERT(tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_1D);
-
- if (t->base.dirty_images[0]) {
- R300_FIREVERTICES(rmesa);
- r300SetTexImages(rmesa, tObj);
- r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0);
- if (!t->base.memBlock)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-#if ENABLE_HW_3D_TEXTURE
-static GLboolean enable_tex_3d(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData;
-
- /* Need to load the 3d images associated with this unit.
- */
- if (t->format & R200_TXFORMAT_NON_POWER2) {
- t->format &= ~R200_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_3D);
-
- /* R100 & R200 do not support mipmaps for 3D textures.
- */
- if ((tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) {
- return GL_FALSE;
- }
-
- if (t->base.dirty_images[0]) {
- R300_FIREVERTICES(rmesa);
- r300SetTexImages(rmesa, tObj);
- r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0);
- if (!t->base.memBlock)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-#endif
-
-static GLboolean enable_tex_cube(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData;
- GLuint face;
-
- /* Need to load the 2d images associated with this unit.
- */
- if (t->format & R200_TXFORMAT_NON_POWER2) {
- t->format &= ~R200_TXFORMAT_NON_POWER2;
- for (face = 0; face < 6; face++)
- t->base.dirty_images[face] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_CUBE_MAP);
-
- if (t->base.dirty_images[0] || t->base.dirty_images[1] ||
- t->base.dirty_images[2] || t->base.dirty_images[3] ||
- t->base.dirty_images[4] || t->base.dirty_images[5]) {
- /* flush */
- R300_FIREVERTICES(rmesa);
- /* layout memory space, once for all faces */
- r300SetTexImages(rmesa, tObj);
- }
-
- /* upload (per face) */
- for (face = 0; face < 6; face++) {
- if (t->base.dirty_images[face]) {
- r300UploadTexImages(rmesa,
- (r300TexObjPtr) tObj->DriverData,
- face);
- }
- }
-
- if (!t->base.memBlock) {
- /* texmem alloc failed, use s/w fallback */
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_rect(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData;
-
-#if 0
- if (!(t->format & R200_TXFORMAT_NON_POWER2)) {
- t->format |= R200_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-#endif
-
- ASSERT(tObj->Target == GL_TEXTURE_RECTANGLE_NV);
-
- if (t->base.dirty_images[0]) {
- R300_FIREVERTICES(rmesa);
- r300SetTexImages(rmesa, tObj);
- r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0);
- if (!t->base.memBlock && !rmesa->prefer_gart_client_texturing)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean update_tex_common(GLcontext * ctx, int unit)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData;
- GLenum format;
-
- /* Fallback if there's a texture border */
- if (tObj->Image[0][tObj->BaseLevel]->Border > 0)
- return GL_FALSE;
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if (rmesa->state.texture.unit[unit].texobj != t) {
- if (rmesa->state.texture.unit[unit].texobj != NULL) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->state.texture.unit[unit].texobj->base.bound &=
- ~(1UL << unit);
- }
-
- rmesa->state.texture.unit[unit].texobj = t;
- t->base.bound |= (1UL << unit);
- t->dirty_state |= 1 << unit;
- driUpdateTextureLRU((driTextureObject *) t); /* XXX: should be locked! */
- }
-
-#if 0 /* do elsewhere ? */
- /* Newly enabled?
- */
- if (1
- || !(rmesa->hw.ctx.
- cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE << unit))) {
- R300_STATECHANGE(rmesa, ctx);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= (R200_TEX_0_ENABLE |
- R200_TEX_BLEND_0_ENABLE) <<
- unit;
-
- R300_STATECHANGE(rmesa, vtx);
- rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] |= 4 << (unit * 3);
-
- rmesa->recheck_texgen[unit] = GL_TRUE;
- }
-
- if (t->dirty_state & (1 << unit)) {
- import_tex_obj_state(rmesa, unit, t);
- }
-
- if (rmesa->recheck_texgen[unit]) {
- GLboolean fallback = !r300_validate_texgen(ctx, unit);
- TCL_FALLBACK(ctx, (RADEON_TCL_FALLBACK_TEXGEN_0 << unit),
- fallback);
- rmesa->recheck_texgen[unit] = 0;
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-#endif
-
- format = tObj->Image[0][tObj->BaseLevel]->Format;
- if (rmesa->state.texture.unit[unit].format != format ||
- rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode) {
- //rmesa->state.texture.unit[unit].format = format;
- rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode;
- if (!r300UpdateTextureEnv(ctx, unit)) {
- return GL_FALSE;
- }
- }
-
-#if R200_MERGED
- FALLBACK(&rmesa->radeon, RADEON_FALLBACK_BORDER_MODE, t->border_fallback);
-#endif
-
- return !t->border_fallback;
-}
-
-static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit)
-{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT)) {
- return (enable_tex_rect(ctx, unit) &&
- update_tex_common(ctx, unit));
- } else if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) {
- return (enable_tex_2d(ctx, unit) &&
- update_tex_common(ctx, unit));
- }
-#if ENABLE_HW_3D_TEXTURE
- else if (texUnit->_ReallyEnabled & (TEXTURE_3D_BIT)) {
- return (enable_tex_3d(ctx, unit) &&
- update_tex_common(ctx, unit));
- }
-#endif
- else if (texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT)) {
- return (enable_tex_cube(ctx, unit) &&
- update_tex_common(ctx, unit));
- } else if (texUnit->_ReallyEnabled) {
- return GL_FALSE;
- } else {
- disable_tex(ctx, unit);
- return GL_TRUE;
- }
-}
-
-void r300UpdateTextureState(GLcontext * ctx)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- GLboolean ok;
- GLuint dbg;
- int i;
-
- ok = (r300UpdateTextureUnit(ctx, 0) &&
- r300UpdateTextureUnit(ctx, 1) &&
- r300UpdateTextureUnit(ctx, 2) &&
- r300UpdateTextureUnit(ctx, 3) &&
- r300UpdateTextureUnit(ctx, 4) &&
- r300UpdateTextureUnit(ctx, 5) &&
- r300UpdateTextureUnit(ctx, 6) &&
- r300UpdateTextureUnit(ctx, 7)
- );
-
-#if R200_MERGED
- FALLBACK(&rmesa->radeon, RADEON_FALLBACK_TEXTURE, !ok);
-#endif
-
- /* This needs correction, or just be done elsewhere
- if (rmesa->radeon.TclFallback)
- r300ChooseVertexState(ctx);
- */
-
-#if 0 /* Workaround - disable.. */
- if (GET_CHIP(rmesa->radeon.radeonScreen) == RADEON_CHIP_REAL_R200) {
- /*
- * T0 hang workaround -------------
- * not needed for r200 derivatives?
- */
- if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_ENABLE_MASK) ==
- R200_TEX_0_ENABLE
- && (rmesa->hw.tex[0].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK) >
- R200_MIN_FILTER_LINEAR) {
-
- R300_STATECHANGE(rmesa, ctx);
- R300_STATECHANGE(rmesa, tex[1]);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_1_ENABLE;
- rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] &=
- ~TEXOBJ_TXFORMAT_MASK;
- rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] |= 0x08000000;
- } else {
- if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_1_ENABLE)
- && (rmesa->hw.tex[1].
- cmd[TEX_PP_TXFORMAT] & 0x08000000)) {
- R300_STATECHANGE(rmesa, tex[1]);
- rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] &=
- ~0x08000000;
- }
- }
-
- /* maybe needs to be done pairwise due to 2 parallel (physical) tex units ?
- looks like that's not the case, if 8500/9100 owners don't complain remove this...
- for ( i = 0; i < ctx->Const.MaxTextureUnits; i += 2) {
- if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & ((R200_TEX_0_ENABLE |
- R200_TEX_1_ENABLE ) << i)) == (R200_TEX_0_ENABLE << i)) &&
- ((rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK) >
- R200_MIN_FILTER_LINEAR)) {
- R300_STATECHANGE(rmesa, ctx);
- R300_STATECHANGE(rmesa, tex[i+1]);
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= (R200_TEX_1_ENABLE << i);
- rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
- rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] |= 0x08000000;
- }
- else {
- if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_1_ENABLE << i)) &&
- (rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] & 0x08000000)) {
- R300_STATECHANGE(rmesa, tex[i+1]);
- rmesa->hw.tex[i+1].cmd[TEX_PP_TXFORMAT] &= ~0x08000000;
- }
- }
- } */
-
- /*
- * Texture cache LRU hang workaround -------------
- * not needed for r200 derivatives?
- */
- dbg = 0x0;
-
- if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE)) &&
- ((((rmesa->hw.tex[0].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) & 0x04)
- == 0))
- || ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_2_ENABLE)
- &&
- ((((rmesa->hw.tex[2].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0))
- || ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_4_ENABLE)
- &&
- ((((rmesa->hw.tex[4].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0))) {
- dbg |= 0x02;
- }
-
- if (((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_1_ENABLE)) &&
- ((((rmesa->hw.tex[1].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) & 0x04)
- == 0))
- || ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_3_ENABLE)
- &&
- ((((rmesa->hw.tex[3].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0))
- || ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_5_ENABLE)
- &&
- ((((rmesa->hw.tex[5].
- cmd[TEX_PP_TXFILTER] & R200_MIN_FILTER_MASK)) &
- 0x04) == 0))) {
- dbg |= 0x04;
- }
-
- if (dbg != rmesa->hw.tam.cmd[TAM_DEBUG3]) {
- R300_STATECHANGE(rmesa, tam);
- rmesa->hw.tam.cmd[TAM_DEBUG3] = dbg;
- if (0)
- printf("TEXCACHE LRU HANG WORKAROUND %x\n",
- dbg);
- }
- }
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_vertexprog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_vertexprog.c
deleted file mode 100644
index 717832048..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/r300_vertexprog.c
+++ /dev/null
@@ -1,952 +0,0 @@
-/**************************************************************************
-
-Copyright (C) 2005 Aapo Tahkola.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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:
- * Aapo Tahkola <aet@rasterburn.org>
- */
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
-#include "program.h"
-#include "r300_context.h"
-#include "r300_program.h"
-#include "nvvertprog.h"
-
-#define SCALAR_FLAG (1<<31)
-#define FLAG_MASK (1<<31)
-#define OP_MASK (0xf) /* we are unlikely to have more than 15 */
-#define OPN(operator, ip, op) {#operator, VP_OPCODE_##operator, ip, op}
-
-static struct{
- char *name;
- int opcode;
- unsigned long ip; /* number of input operands and flags */
- unsigned long op;
-}op_names[]={
- OPN(ABS, 1, 1),
- OPN(ADD, 2, 1),
- OPN(ARL, 1, 1|SCALAR_FLAG),
- OPN(DP3, 2, 3|SCALAR_FLAG),
- OPN(DP4, 2, 3|SCALAR_FLAG),
- OPN(DPH, 2, 3|SCALAR_FLAG),
- OPN(DST, 2, 1),
- OPN(EX2, 1|SCALAR_FLAG, 4|SCALAR_FLAG),
- OPN(EXP, 1|SCALAR_FLAG, 1),
- OPN(FLR, 1, 1),
- OPN(FRC, 1, 1),
- OPN(LG2, 1|SCALAR_FLAG, 4|SCALAR_FLAG),
- OPN(LIT, 1, 1),
- OPN(LOG, 1|SCALAR_FLAG, 1),
- OPN(MAD, 3, 1),
- OPN(MAX, 2, 1),
- OPN(MIN, 2, 1),
- OPN(MOV, 1, 1),
- OPN(MUL, 2, 1),
- OPN(POW, 2|SCALAR_FLAG, 4|SCALAR_FLAG),
- OPN(RCP, 1|SCALAR_FLAG, 4|SCALAR_FLAG),
- OPN(RSQ, 1|SCALAR_FLAG, 4|SCALAR_FLAG),
- OPN(SGE, 2, 1),
- OPN(SLT, 2, 1),
- OPN(SUB, 2, 1),
- OPN(SWZ, 1, 1),
- OPN(XPD, 2, 1),
- OPN(RCC, 0, 0), //extra
- OPN(PRINT, 0, 0),
- OPN(END, 0, 0),
-};
-#undef OPN
-#define OPN(rf) {#rf, PROGRAM_##rf}
-
-static struct{
- char *name;
- int id;
-}register_file_names[]={
- OPN(TEMPORARY),
- OPN(INPUT),
- OPN(OUTPUT),
- OPN(LOCAL_PARAM),
- OPN(ENV_PARAM),
- OPN(NAMED_PARAM),
- OPN(STATE_VAR),
- OPN(WRITE_ONLY),
- OPN(ADDRESS),
-};
-
-static char *dst_mask_names[4]={ "X", "Y", "Z", "W" };
-
-/* from vertex program spec:
- Instruction Inputs Output Description
- ----------- ------ ------ --------------------------------
- ABS v v absolute value
- ADD v,v v add
- ARL v a address register load
- DP3 v,v ssss 3-component dot product
- DP4 v,v ssss 4-component dot product
- DPH v,v ssss homogeneous dot product
- DST v,v v distance vector
- EX2 s ssss exponential base 2
- EXP s v exponential base 2 (approximate)
- FLR v v floor
- FRC v v fraction
- LG2 s ssss logarithm base 2
- LIT v v compute light coefficients
- LOG s v logarithm base 2 (approximate)
- MAD v,v,v v multiply and add
- MAX v,v v maximum
- MIN v,v v minimum
- MOV v v move
- MUL v,v v multiply
- POW s,s ssss exponentiate
- RCP s ssss reciprocal
- RSQ s ssss reciprocal square root
- SGE v,v v set on greater than or equal
- SLT v,v v set on less than
- SUB v,v v subtract
- SWZ v v extended swizzle
- XPD v,v v cross product
-*/
-
-void dump_program_params(GLcontext *ctx, struct vertex_program *vp)
-{
- int i;
- int pi;
-
- fprintf(stderr, "NumInstructions=%d\n", vp->Base.NumInstructions);
- fprintf(stderr, "NumTemporaries=%d\n", vp->Base.NumTemporaries);
- fprintf(stderr, "NumParameters=%d\n", vp->Base.NumParameters);
- fprintf(stderr, "NumAttributes=%d\n", vp->Base.NumAttributes);
- fprintf(stderr, "NumAddressRegs=%d\n", vp->Base.NumAddressRegs);
-
- _mesa_load_state_parameters(ctx, vp->Parameters);
-
-#if 0
- for(pi=0; pi < vp->Base.NumParameters; pi++){
- fprintf(stderr, "{ ");
- for(i=0; i < 4; i++)
- fprintf(stderr, "%f ", vp->Base.LocalParams[pi][i]);
- fprintf(stderr, "}\n");
- }
-#endif
- for(pi=0; pi < vp->Parameters->NumParameters; pi++){
- fprintf(stderr, "param %02d:", pi);
-
- switch(vp->Parameters->Parameters[pi].Type){
-
- case NAMED_PARAMETER:
- fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
- fprintf(stderr, "(NAMED_PARAMETER)");
- break;
-
- case CONSTANT:
- fprintf(stderr, "(CONSTANT)");
- break;
-
- case STATE:
- fprintf(stderr, "(STATE)\n");
- break;
-
- }
-
- fprintf(stderr, "{ ");
- for(i=0; i < 4; i++)
- fprintf(stderr, "%f ", vp->Parameters->ParameterValues[pi][i]);
- fprintf(stderr, "}\n");
-
- }
-}
-
-void debug_vp(GLcontext *ctx, struct vertex_program *vp)
-{
- struct vp_instruction *vpi;
- int i, operand_index;
- int operator_index;
-
- dump_program_params(ctx, vp);
-
- vpi=vp->Instructions;
-
- for(;; vpi++){
- if(vpi->Opcode == VP_OPCODE_END)
- break;
-
- for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++){
- if(vpi->Opcode == op_names[i].opcode){
- fprintf(stderr, "%s ", op_names[i].name);
- break;
- }
- }
- operator_index=i;
-
- for(i=0; i < sizeof(register_file_names) / sizeof(*register_file_names); i++){
- if(vpi->DstReg.File == register_file_names[i].id){
- fprintf(stderr, "%s ", register_file_names[i].name);
- break;
- }
- }
-
- fprintf(stderr, "%d.", vpi->DstReg.Index);
-
- for(i=0; i < 4; i++)
- if(vpi->DstReg.WriteMask & (1<<i))
- fprintf(stderr, "%s", dst_mask_names[i]);
- fprintf(stderr, " ");
-
- for(operand_index=0; operand_index < (op_names[operator_index].ip & (~FLAG_MASK));
- operand_index++){
-
- if(vpi->SrcReg[operand_index].Negate)
- fprintf(stderr, "-");
-
- for(i=0; i < sizeof(register_file_names) / sizeof(*register_file_names); i++){
- if(vpi->SrcReg[operand_index].File == register_file_names[i].id){
- fprintf(stderr, "%s ", register_file_names[i].name);
- break;
- }
- }
- fprintf(stderr, "%d.", vpi->SrcReg[operand_index].Index);
-
- for(i=0; i < 4; i++)
- fprintf(stderr, "%s", dst_mask_names[GET_SWZ(vpi->SrcReg[operand_index].Swizzle, i)]);
-
- if(operand_index+1 < (op_names[operator_index].ip & (~FLAG_MASK)) )
- fprintf(stderr, ",");
- }
- fprintf(stderr, "\n");
- }
-
-}
-
-void r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp)
-{
- int pi;
- struct vertex_program *mesa_vp=(void *)vp;
- int dst_index;
-
- _mesa_load_state_parameters(ctx, mesa_vp->Parameters);
-
- //debug_vp(ctx, mesa_vp);
- if(mesa_vp->Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){
- fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
- exit(-1);
- }
- dst_index=0;
- for(pi=0; pi < mesa_vp->Parameters->NumParameters; pi++){
- switch(mesa_vp->Parameters->Parameters[pi].Type){
-
- case STATE:
- case NAMED_PARAMETER:
- //fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
- case CONSTANT:
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][0];
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][1];
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][2];
- vp->params.body.f[dst_index++]=mesa_vp->Parameters->ParameterValues[pi][3];
- break;
-
- default: _mesa_problem(NULL, "Bad param type in %s", __FUNCTION__);
- }
-
- }
-
- vp->params.length=dst_index;
-}
-
-static unsigned long t_dst_mask(GLuint mask)
-{
- unsigned long flags=0;
-
- if(mask & WRITEMASK_X) flags |= VSF_FLAG_X;
- if(mask & WRITEMASK_Y) flags |= VSF_FLAG_Y;
- if(mask & WRITEMASK_Z) flags |= VSF_FLAG_Z;
- if(mask & WRITEMASK_W) flags |= VSF_FLAG_W;
-
- return flags;
-}
-
-static unsigned long t_dst_class(enum register_file file)
-{
-
- switch(file){
- case PROGRAM_TEMPORARY:
- return VSF_OUT_CLASS_TMP;
- case PROGRAM_OUTPUT:
- return VSF_OUT_CLASS_RESULT;
- /*
- case PROGRAM_INPUT:
- case PROGRAM_LOCAL_PARAM:
- case PROGRAM_ENV_PARAM:
- case PROGRAM_NAMED_PARAM:
- case PROGRAM_STATE_VAR:
- case PROGRAM_WRITE_ONLY:
- case PROGRAM_ADDRESS:
- */
- default:
- fprintf(stderr, "problem in %s", __FUNCTION__);
- exit(0);
- }
-}
-
-static unsigned long t_dst_index(struct r300_vertex_program *vp, struct vp_dst_register *dst)
-{
- if(dst->File == PROGRAM_OUTPUT) {
- if (vp->outputs[dst->Index] != -1)
- return vp->outputs[dst->Index];
- else {
- WARN_ONCE("Unknown output %d\n", dst->Index);
- return 10;
- }
- }
- return dst->Index;
-}
-
-static unsigned long t_src_class(enum register_file file)
-{
-
- switch(file){
- case PROGRAM_TEMPORARY:
- return VSF_IN_CLASS_TMP;
-
- case PROGRAM_INPUT:
- return VSF_IN_CLASS_ATTR;
-
- case PROGRAM_LOCAL_PARAM:
- case PROGRAM_ENV_PARAM:
- case PROGRAM_NAMED_PARAM:
- case PROGRAM_STATE_VAR:
- return VSF_IN_CLASS_PARAM;
- /*
- case PROGRAM_OUTPUT:
- case PROGRAM_WRITE_ONLY:
- case PROGRAM_ADDRESS:
- */
- default:
- fprintf(stderr, "problem in %s", __FUNCTION__);
- exit(0);
- }
-}
-
-static unsigned long t_swizzle(GLubyte swizzle)
-{
- switch(swizzle){
- case SWIZZLE_X: return VSF_IN_COMPONENT_X;
- case SWIZZLE_Y: return VSF_IN_COMPONENT_Y;
- case SWIZZLE_Z: return VSF_IN_COMPONENT_Z;
- case SWIZZLE_W: return VSF_IN_COMPONENT_W;
- case SWIZZLE_ZERO: return VSF_IN_COMPONENT_ZERO;
- case SWIZZLE_ONE: return VSF_IN_COMPONENT_ONE;
- default:
- fprintf(stderr, "problem in %s", __FUNCTION__);
- exit(0);
- }
-}
-
-static void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
-{
- int i;
-
- if(vp == NULL){
- fprintf(stderr, "vp null in call to %s from %s\n", __FUNCTION__, caller);
- return ;
- }
-
- fprintf(stderr, "%s:<", caller);
- for(i=0; i < VERT_ATTRIB_MAX; i++)
- fprintf(stderr, "%d ", vp->inputs[i]);
- fprintf(stderr, ">\n");
-
-}
-
-static unsigned long t_src_index(struct r300_vertex_program *vp, struct vp_src_register *src)
-{
- int i;
- int max_reg=-1;
-
- if(src->File == PROGRAM_INPUT){
- if(vp->inputs[src->Index] != -1)
- return vp->inputs[src->Index];
-
- for(i=0; i < VERT_ATTRIB_MAX; i++)
- if(vp->inputs[i] > max_reg)
- max_reg=vp->inputs[i];
-
- vp->inputs[src->Index]=max_reg+1;
-
- //vp_dump_inputs(vp, __FUNCTION__);
-
- return vp->inputs[src->Index];
- }else{
- return src->Index;
- }
-}
-
-static unsigned long t_src(struct r300_vertex_program *vp, struct vp_src_register *src)
-{
-
- return MAKE_VSF_SOURCE(t_src_index(vp, src),
- t_swizzle(GET_SWZ(src->Swizzle, 0)),
- t_swizzle(GET_SWZ(src->Swizzle, 1)),
- t_swizzle(GET_SWZ(src->Swizzle, 2)),
- t_swizzle(GET_SWZ(src->Swizzle, 3)),
- t_src_class(src->File),
- src->Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-}
-
-static unsigned long t_src_scalar(struct r300_vertex_program *vp, struct vp_src_register *src)
-{
-
- return MAKE_VSF_SOURCE(t_src_index(vp, src),
- t_swizzle(GET_SWZ(src->Swizzle, 0)),
- t_swizzle(GET_SWZ(src->Swizzle, 0)),
- t_swizzle(GET_SWZ(src->Swizzle, 0)),
- t_swizzle(GET_SWZ(src->Swizzle, 0)),
- t_src_class(src->File),
- src->Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-}
-
-static unsigned long t_opcode(enum vp_opcode opcode)
-{
-
- switch(opcode){
- case VP_OPCODE_DST: return R300_VPI_OUT_OP_DST;
- case VP_OPCODE_EX2: return R300_VPI_OUT_OP_EX2;
- case VP_OPCODE_EXP: return R300_VPI_OUT_OP_EXP;
- case VP_OPCODE_FRC: return R300_VPI_OUT_OP_FRC;
- case VP_OPCODE_LG2: return R300_VPI_OUT_OP_LG2;
- case VP_OPCODE_LOG: return R300_VPI_OUT_OP_LOG;
- case VP_OPCODE_MAX: return R300_VPI_OUT_OP_MAX;
- case VP_OPCODE_MIN: return R300_VPI_OUT_OP_MIN;
- case VP_OPCODE_MUL: return R300_VPI_OUT_OP_MUL;
- case VP_OPCODE_POW: return R300_VPI_OUT_OP_POW;
- case VP_OPCODE_RCP: return R300_VPI_OUT_OP_RCP;
- case VP_OPCODE_RSQ: return R300_VPI_OUT_OP_RSQ;
- case VP_OPCODE_SGE: return R300_VPI_OUT_OP_SGE;
- case VP_OPCODE_SLT: return R300_VPI_OUT_OP_SLT;
- case VP_OPCODE_DP4: return R300_VPI_OUT_OP_DOT;
-
- default:
- fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode);
- }
- exit(-1);
- return 0;
-}
-
-static unsigned long op_operands(enum vp_opcode opcode)
-{
- int i;
-
- /* Can we trust mesas opcodes to be in order ? */
- for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++)
- if(op_names[i].opcode == opcode)
- return op_names[i].ip;
-
- fprintf(stderr, "op %d not found in op_names\n", opcode);
- exit(-1);
- return 0;
-}
-
-/* TODO: Get rid of t_src_class call */
-#define CMP_SRCS(a, b) (a.Index != b.Index && \
- ((t_src_class(a.File) == VSF_IN_CLASS_PARAM && \
- t_src_class(b.File) == VSF_IN_CLASS_PARAM) || \
- (t_src_class(a.File) == VSF_IN_CLASS_ATTR && \
- t_src_class(b.File) == VSF_IN_CLASS_ATTR))) \
-
-#define SRCS_WRITABLE 1
-void translate_vertex_shader(struct r300_vertex_program *vp)
-{
- struct vertex_program *mesa_vp=(void *)vp;
- struct vp_instruction *vpi;
- int i, cur_reg=0;
- VERTEX_SHADER_INSTRUCTION *o_inst;
- unsigned long operands;
- int are_srcs_scalar;
- unsigned long hw_op;
- /* Initial value should be last tmp reg that hw supports.
- Strangely enough r300 doesnt mind even though these would be out of range.
- Smart enough to realize that it doesnt need it? */
- int u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1;
-#ifdef SRCS_WRITABLE
- struct vp_src_register src[3];
-#else
-#define src vpi->SrcReg
-#endif
- vp->pos_end=0; /* Not supported yet */
- vp->program.length=0;
- vp->num_temporaries=mesa_vp->Base.NumTemporaries;
-
- for(i=0; i < VERT_ATTRIB_MAX; i++)
- vp->inputs[i] = -1;
-
- for(i=0; i < VERT_RESULT_MAX; i++)
- vp->outputs[i] = -1;
-
- assert(mesa_vp->OutputsWritten & (1 << VERT_RESULT_HPOS));
- assert(mesa_vp->OutputsWritten & (1 << VERT_RESULT_COL0));
-
- /* Assign outputs */
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_HPOS))
- vp->outputs[VERT_RESULT_HPOS] = cur_reg++;
-
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_PSIZ))
- vp->outputs[VERT_RESULT_PSIZ] = cur_reg++;
-
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_COL0))
- vp->outputs[VERT_RESULT_COL0] = cur_reg++;
-
-#if 0 /* Not supported yet */
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_BFC0))
- vp->outputs[VERT_RESULT_BFC0] = cur_reg++;
-
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_COL1))
- vp->outputs[VERT_RESULT_COL1] = cur_reg++;
-
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_BFC1))
- vp->outputs[VERT_RESULT_BFC1] = cur_reg++;
-
- if(mesa_vp->OutputsWritten & (1 << VERT_RESULT_FOGC))
- vp->outputs[VERT_RESULT_FOGC] = cur_reg++;
-#endif
-
- for(i=VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++)
- if(mesa_vp->OutputsWritten & (1 << i))
- vp->outputs[i] = cur_reg++;
-
- o_inst=vp->program.body.i;
- for(vpi=mesa_vp->Instructions; vpi->Opcode != VP_OPCODE_END; vpi++, o_inst++){
-
- operands=op_operands(vpi->Opcode);
- are_srcs_scalar=operands & SCALAR_FLAG;
- operands &= OP_MASK;
-
- for(i=0; i < operands; i++)
- src[i]=vpi->SrcReg[i];
-#if 1
- if(operands == 3){ /* TODO: scalars */
- if( CMP_SRCS(src[1], src[2]) || CMP_SRCS(src[0], src[2]) ){
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i,
- VSF_FLAG_ALL, VSF_OUT_CLASS_TMP);
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]),
- SWIZZLE_X, SWIZZLE_Y,
- SWIZZLE_Z, SWIZZLE_W,
- t_src_class(src[2].File), VSF_FLAG_NONE);
-
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]),
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- t_src_class(src[2].File), VSF_FLAG_NONE);
- o_inst->src3=0;
- o_inst++;
-
- src[2].File=PROGRAM_TEMPORARY;
- src[2].Index=u_temp_i;
- u_temp_i--;
- }
-
- }
- if(operands >= 2){
- if( CMP_SRCS(src[1], src[0]) ){
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i,
- VSF_FLAG_ALL, VSF_OUT_CLASS_TMP);
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- SWIZZLE_X, SWIZZLE_Y,
- SWIZZLE_Z, SWIZZLE_W,
- t_src_class(src[0].File), VSF_FLAG_NONE);
-
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- t_src_class(src[0].File), VSF_FLAG_NONE);
- o_inst->src3=0;
- o_inst++;
-
- src[0].File=PROGRAM_TEMPORARY;
- src[0].Index=u_temp_i;
- u_temp_i--;
- }
- }
-#endif
- /* these ops need special handling.
- Ops that need temp vars should probably be given reg indexes starting at the end of tmp area. */
- switch(vpi->Opcode){
- case VP_OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO}
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- t_src_class(src[0].File), VSF_FLAG_NONE);
-
- o_inst->src3=0;
-
- goto next;
-
- case VP_OPCODE_ADD:
- hw_op=(src[0].File == PROGRAM_TEMPORARY &&
- src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
-
- o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- SWIZZLE_ONE, SWIZZLE_ONE,
- SWIZZLE_ONE, SWIZZLE_ONE,
- t_src_class(src[0].File), VSF_FLAG_NONE);
- o_inst->src3=t_src(vp, &src[1]);
- goto next;
-
- case VP_OPCODE_MAD:
- hw_op=(src[0].File == PROGRAM_TEMPORARY &&
- src[1].File == PROGRAM_TEMPORARY &&
- src[2].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
-
- o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=t_src(vp, &src[1]);
- o_inst->src3=t_src(vp, &src[2]);
- goto next;
-
- case VP_OPCODE_MUL: /* HW mul can take third arg but appears to have some other limitations. */
- hw_op=(src[0].File == PROGRAM_TEMPORARY &&
- src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
-
- o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=t_src(vp, &src[1]);
-
- o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- t_src_class(src[1].File), VSF_FLAG_NONE);
- goto next;
-
- case VP_OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO}
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)),
- SWIZZLE_ZERO,
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_XYZ : VSF_FLAG_NONE);
-
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 2)),
- SWIZZLE_ZERO,
- t_src_class(src[1].File),
- src[1].Negate ? VSF_FLAG_XYZ : VSF_FLAG_NONE);
-
- o_inst->src3=0;
- goto next;
-
- case VP_OPCODE_SUB://ADD RESULT 1.X Y Z W TMP 0{} {X Y Z W} PARAM 1{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W
-#if 1
- hw_op=(src[0].File == PROGRAM_TEMPORARY &&
- src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD;
-
- o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- SWIZZLE_ONE, SWIZZLE_ONE,
- SWIZZLE_ONE, SWIZZLE_ONE,
- t_src_class(src[0].File), VSF_FLAG_NONE);
- o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 2)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 3)),
- t_src_class(src[1].File),
- (!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-#else
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(GET_SWZ(src[1].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 1)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 2)),
- t_swizzle(GET_SWZ(src[1].Swizzle, 3)),
- t_src_class(src[1].File),
- (!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
- o_inst->src3=0;
-#endif
- goto next;
-
- case VP_OPCODE_ABS://MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 3)),
- t_src_class(src[0].File),
- (!src[0].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
- o_inst->src3=0;
- goto next;
-
- case VP_OPCODE_FLR:
- /* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W}
- ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */
-
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, u_temp_i,
- t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
-
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=0;
- o_inst->src3=0;
- o_inst++;
-
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=MAKE_VSF_SOURCE(u_temp_i,
- VSF_IN_COMPONENT_X,
- VSF_IN_COMPONENT_Y,
- VSF_IN_COMPONENT_Z,
- VSF_IN_COMPONENT_W,
- VSF_IN_CLASS_TMP,
- /* Not 100% sure about this */
- (!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE/*VSF_FLAG_ALL*/);
-
- o_inst->src3=0;
- u_temp_i--;
- goto next;
-
- case VP_OPCODE_LG2:// LG2 RESULT 1.X Y Z W PARAM 0{} {X X X X}
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LG2, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
- o_inst->src2=0;
- o_inst->src3=0;
- goto next;
-
- case VP_OPCODE_LIT://LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W}
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LIT, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
- /* NOTE: Users swizzling might not work. */
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
- t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
- t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
- o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
- goto next;
-
- case VP_OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W}
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)),
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)),
- VSF_IN_COMPONENT_ONE,
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_XYZ : VSF_FLAG_NONE);
- o_inst->src2=t_src(vp, &src[1]);
- o_inst->src3=0;
- goto next;
-
- case VP_OPCODE_XPD:
- /* mul r0, r1.yzxw, r2.zxyw
- mad r0, -r2.yzxw, r1.zxyw, r0
- NOTE: might need MAD_2
- */
-
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, u_temp_i,
- t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP);
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
- t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x
- t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
- t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
- t_src_class(src[1].File),
- src[1].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-
- o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- SWIZZLE_ZERO, SWIZZLE_ZERO,
- t_src_class(src[1].File),
- VSF_FLAG_NONE);
- o_inst++;
- u_temp_i--;
-
- o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]),
- t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y
- t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x
- t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w
- t_src_class(src[1].File),
- (!src[1].Negate) ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-
- o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]),
- t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z
- t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x
- t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y
- t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w
- t_src_class(src[0].File),
- src[0].Negate ? VSF_FLAG_ALL : VSF_FLAG_NONE);
-
- o_inst->src3=MAKE_VSF_SOURCE(u_temp_i+1,
- VSF_IN_COMPONENT_X,
- VSF_IN_COMPONENT_Y,
- VSF_IN_COMPONENT_Z,
- VSF_IN_COMPONENT_W,
- VSF_IN_CLASS_TMP,
- VSF_FLAG_NONE);
-
- goto next;
-
- case VP_OPCODE_ARL:
- case VP_OPCODE_SWZ:
- case VP_OPCODE_RCC:
- case VP_OPCODE_PRINT:
- //vp->num_temporaries++;
- fprintf(stderr, "Dont know how to handle op %d yet\n", vpi->Opcode);
- exit(-1);
- break;
- case VP_OPCODE_END:
- break;
- default:
- break;
- }
-
- o_inst->op=MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst_index(vp, &vpi->DstReg),
- t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
-
- if(are_srcs_scalar){
- switch(operands){
- case 1:
- o_inst->src1=t_src_scalar(vp, &src[0]);
- o_inst->src2=0;
- o_inst->src3=0;
- break;
-
- case 2:
- o_inst->src1=t_src_scalar(vp, &src[0]);
- o_inst->src2=t_src_scalar(vp, &src[1]);
- o_inst->src3=0;
- break;
-
- case 3:
- o_inst->src1=t_src_scalar(vp, &src[0]);
- o_inst->src2=t_src_scalar(vp, &src[1]);
- o_inst->src3=t_src_scalar(vp, &src[2]);
- break;
-
- default:
- fprintf(stderr, "scalars and op RCC not handled yet");
- exit(-1);
- break;
- }
- }else{
- switch(operands){
- case 1:
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=0;
- o_inst->src3=0;
- break;
-
- case 2:
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=t_src(vp, &src[1]);
- o_inst->src3=0;
- break;
-
- case 3:
- o_inst->src1=t_src(vp, &src[0]);
- o_inst->src2=t_src(vp, &src[1]);
- o_inst->src3=t_src(vp, &src[2]);
- break;
-
- default:
- fprintf(stderr, "scalars and op RCC not handled yet");
- exit(-1);
- break;
- }
- }
- next: ;
- }
-
- vp->program.length=(o_inst - vp->program.body.i) * 4;
-
- if(u_temp_i < vp->num_temporaries)
- vp->translated=GL_FALSE; /* temps exhausted - program cannot be run */
- else
- vp->translated=GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.c
deleted file mode 100644
index 97507617c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/**
- * \file radeon_context.c
- * Common context initialization.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <dlfcn.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "state.h"
-#include "matrix.h"
-#include "framebuffer.h"
-
-#include "drivers/common/driverfuncs.h"
-#include "swrast/swrast.h"
-
-#include "radeon_screen.h"
-#include "r200_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_macros.h"
-#include "radeon_reg.h"
-#include "r200_state.h"
-
-#include "utils.h"
-#include "vblank.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
-
-#define DRIVER_DATE "20040924"
-
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
- static char buffer[128];
-
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *) "Tungsten Graphics, Inc.";
-
- case GL_RENDERER:
- {
- unsigned offset;
- GLuint agp_mode = radeon->radeonScreen->IsPCI ? 0 :
- radeon->radeonScreen->AGPMode;
- const char* chipname;
-
- if (IS_FAMILY_R300(radeon))
- chipname = "R300";
- else
- chipname = "R200";
-
- offset = driGetRendererString(buffer, chipname, DRIVER_DATE,
- agp_mode);
-
- sprintf(&buffer[offset], " %sTCL",
- !(radeon->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE)
- ? "" : "NO-");
-
- return (GLubyte *) buffer;
- }
-
- default:
- return NULL;
- }
-}
-
-
-/* Return the width and height of the given buffer.
- */
-static void radeonGetBufferSize(GLframebuffer * buffer,
- GLuint * width, GLuint * height)
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- LOCK_HARDWARE(radeon);
- *width = radeon->dri.drawable->w;
- *height = radeon->dri.drawable->h;
- UNLOCK_HARDWARE(radeon);
-}
-
-
-/* Initialize the driver's misc functions.
- */
-static void radeonInitDriverFuncs(struct dd_function_table *functions)
-{
- functions->GetBufferSize = radeonGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = radeonGetString;
-}
-
-
-/**
- * Create and initialize all common fields of the context,
- * including the Mesa context itself.
- */
-GLboolean radeonInitContext(radeonContextPtr radeon,
- struct dd_function_table* functions,
- const __GLcontextModes * glVisual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate)
-{
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
- GLcontext* ctx;
- GLcontext* shareCtx;
- int fthrottle_mode;
-
- /* Fill in additional standard functions. */
- radeonInitDriverFuncs(functions);
-
- /* Allocate and initialize the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((radeonContextPtr)sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- radeon->glCtx = _mesa_create_context(glVisual, shareCtx,
- functions, (void *)radeon);
- if (!radeon->glCtx)
- return GL_FALSE;
-
- ctx = radeon->glCtx;
- driContextPriv->driverPrivate = radeon;
-
- /* DRI fields */
- radeon->dri.context = driContextPriv;
- radeon->dri.screen = sPriv;
- radeon->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
- radeon->dri.hwContext = driContextPriv->hHWContext;
- radeon->dri.hwLock = &sPriv->pSAREA->lock;
- radeon->dri.fd = sPriv->fd;
- radeon->dri.drmMinor = sPriv->drmMinor;
-
- radeon->radeonScreen = screen;
- radeon->sarea = (drm_radeon_sarea_t *) ((GLubyte *) sPriv->pSAREA +
- screen->sarea_priv_offset);
-
- /* Setup IRQs */
- fthrottle_mode = driQueryOptioni(&radeon->optionCache, "fthrottle_mode");
- radeon->iw.irq_seq = -1;
- radeon->irqsEmitted = 0;
- radeon->do_irqs = (radeon->dri.drmMinor >= 6 &&
- fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
- radeon->radeonScreen->irq);
-
- radeon->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
-
- if (!radeon->do_irqs)
- fprintf(stderr,
- "IRQ's not enabled, falling back to %s: %d %d %d\n",
- radeon->do_usleeps ? "usleeps" : "busy waits",
- radeon->dri.drmMinor,
- fthrottle_mode, radeon->radeonScreen->irq);
-
- radeon->vblank_flags = (radeon->radeonScreen->irq != 0)
- ? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ;
-
- (*dri_interface->getUST) (&radeon->swap_ust);
-
- return GL_TRUE;
-}
-
-
-/**
- * Cleanup common context fields.
- * Called by r200DestroyContext/r300DestroyContext
- */
-void radeonCleanupContext(radeonContextPtr radeon)
-{
- /* free the Mesa context */
- radeon->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(radeon->glCtx);
-
- if (radeon->state.scissor.pClipRects) {
- FREE(radeon->state.scissor.pClipRects);
- radeon->state.scissor.pClipRects = 0;
- }
-}
-
-
-/**
- * Swap front and back buffer.
- */
-void radeonSwapBuffers(__DRIdrawablePrivate * dPriv)
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- radeonContextPtr radeon;
- GLcontext *ctx;
-
- radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = radeon->glCtx;
-
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
- if (radeon->doPageFlip) {
- radeonPageFlip(dPriv);
- } else {
- radeonCopyBuffer(dPriv);
- }
- }
- } else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!",
- __FUNCTION__);
- }
-}
-
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
- __DRIdrawablePrivate * driDrawPriv,
- __DRIdrawablePrivate * driReadPriv)
-{
- if (driContextPriv) {
- radeonContextPtr radeon =
- (radeonContextPtr) driContextPriv->driverPrivate;
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__,
- radeon->glCtx);
-
- if (radeon->dri.drawable != driDrawPriv) {
- driDrawableInitVBlank(driDrawPriv,
- radeon->vblank_flags);
- radeon->dri.drawable = driDrawPriv;
-
-#if R200_MERGED
- if (IS_FAMILY_R200(radeon)) {
- r200UpdateWindow(radeon->glCtx);
- r200UpdateViewportOffset(radeon->glCtx);
- }
-#endif
- }
-
- _mesa_make_current(radeon->glCtx,
- (GLframebuffer *) driDrawPriv->
- driverPrivate,
- (GLframebuffer *) driReadPriv->
- driverPrivate);
-
- if (!radeon->glCtx->Viewport.Width) {
- _mesa_set_viewport(radeon->glCtx, 0, 0,
- driDrawPriv->w, driDrawPriv->h);
- }
-
- _mesa_update_state(radeon->glCtx);
-
-#if R200_MERGED
- if (IS_FAMILY_R200(radeon))
- r200ValidateState(radeon->glCtx);
-#endif
-
- } else {
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
- _mesa_make_current(0, 0, 0);
- }
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "End %s\n", __FUNCTION__);
- return GL_TRUE;
-}
-
-/* Force the context `c' to be unbound from its buffer.
- */
-GLboolean radeonUnbindContext(__DRIcontextPrivate * driContextPriv)
-{
- radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__,
- radeon->glCtx);
-
- return GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.h
deleted file mode 100644
index 189bc6ad0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_context.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __RADEON_CONTEXT_H__
-#define __RADEON_CONTEXT_H__
-
-#include "mtypes.h"
-#include "radeon_screen.h"
-#include "drm.h"
-#include "dri_util.h"
-
-struct radeon_context;
-typedef struct radeon_context radeonContextRec;
-typedef struct radeon_context* radeonContextPtr;
-
-static __inline GLuint radeonPackColor(GLuint cpp,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a)
-{
- switch (cpp) {
- case 2:
- return PACK_COLOR_565(r, g, b);
- case 4:
- return PACK_COLOR_8888(a, r, g, b);
- default:
- return 0;
- }
-}
-
-#define TEX_0 0x1
-#define TEX_1 0x2
-#define TEX_2 0x4
-#define TEX_3 0x8
-#define TEX_4 0x10
-#define TEX_5 0x20
-#define TEX_6 0x40
-#define TEX_7 0x80
-#define TEX_ALL 0xff
-
-
-/* Rasterizing fallbacks */
-/* See correponding strings in r200_swtcl.c */
-#define RADEON_FALLBACK_TEXTURE 0x01
-#define RADEON_FALLBACK_DRAW_BUFFER 0x02
-#define RADEON_FALLBACK_STENCIL 0x04
-#define RADEON_FALLBACK_RENDER_MODE 0x08
-#define RADEON_FALLBACK_BLEND_EQ 0x10
-#define RADEON_FALLBACK_BLEND_FUNC 0x20
-#define RADEON_FALLBACK_DISABLE 0x40
-#define RADEON_FALLBACK_BORDER_MODE 0x80
-
-#if R200_MERGED
-extern void radeonFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
-
-#define FALLBACK( radeon, bit, mode ) do { \
- if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n", \
- __FUNCTION__, bit, mode ); \
- radeonFallback( (radeon)->glCtx, bit, mode ); \
-} while (0)
-#else
-#define FALLBACK( radeon, bit, mode ) fprintf(stderr, "%s:%s\n", __LINE__, __FILE__);
-#endif
-
-/* TCL fallbacks */
-extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode);
-
-#define RADEON_TCL_FALLBACK_RASTER 0x0001 /* rasterization */
-#define RADEON_TCL_FALLBACK_UNFILLED 0x0002 /* unfilled tris */
-#define RADEON_TCL_FALLBACK_LIGHT_TWOSIDE 0x0004 /* twoside tris */
-#define RADEON_TCL_FALLBACK_MATERIAL 0x0008 /* material in vb */
-#define RADEON_TCL_FALLBACK_TEXGEN_0 0x0010 /* texgen, unit 0 */
-#define RADEON_TCL_FALLBACK_TEXGEN_1 0x0020 /* texgen, unit 1 */
-#define RADEON_TCL_FALLBACK_TEXGEN_2 0x0040 /* texgen, unit 2 */
-#define RADEON_TCL_FALLBACK_TEXGEN_3 0x0080 /* texgen, unit 3 */
-#define RADEON_TCL_FALLBACK_TEXGEN_4 0x0100 /* texgen, unit 4 */
-#define RADEON_TCL_FALLBACK_TEXGEN_5 0x0200 /* texgen, unit 5 */
-#define RADEON_TCL_FALLBACK_TCL_DISABLE 0x0400 /* user disable */
-#define RADEON_TCL_FALLBACK_BITMAP 0x0800 /* draw bitmap with points */
-#define RADEON_TCL_FALLBACK_VERTEX_PROGRAM 0x1000 /* vertex program active */
-
-#if R200_MERGED
-#define TCL_FALLBACK( ctx, bit, mode ) radeonTclFallback( ctx, bit, mode )
-#else
-#define TCL_FALLBACK( ctx, bit, mode ) ;
-#endif
-
-
-struct radeon_dri_mirror {
- __DRIcontextPrivate *context; /* DRI context */
- __DRIscreenPrivate *screen; /* DRI screen */
- __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
-
- drm_context_t hwContext;
- drm_hw_lock_t *hwLock;
- int fd;
- int drmMinor;
-};
-
-/**
- * Derived state for internal purposes.
- */
-struct radeon_scissor_state {
- drm_clip_rect_t rect;
- GLboolean enabled;
-
- GLuint numClipRects; /* Cliprects active */
- GLuint numAllocedClipRects; /* Cliprects available */
- drm_clip_rect_t *pClipRects;
-};
-
-struct radeon_colorbuffer_state {
- GLuint clear;
- GLint drawOffset, drawPitch;
-};
-
-struct radeon_pixel_state {
- GLint readOffset, readPitch;
-};
-
-struct radeon_state {
- struct radeon_colorbuffer_state color;
- struct radeon_pixel_state pixel;
- struct radeon_scissor_state scissor;
-};
-
-/**
- * Common per-context variables shared by R200 and R300.
- * R200- and R300-specific code "derive" their own context from this
- * structure.
- */
-struct radeon_context {
- GLcontext *glCtx; /* Mesa context */
- radeonScreenPtr radeonScreen; /* Screen private DRI data */
-
- /* Fallback state */
- GLuint Fallback;
- GLuint TclFallback;
-
- /* Page flipping */
- GLuint doPageFlip;
-
- /* Drawable, cliprect and scissor information */
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
- unsigned int lastStamp;
- GLboolean lost_context;
- drm_radeon_sarea_t *sarea; /* Private SAREA data */
-
- /* Mirrors of some DRI state */
- struct radeon_dri_mirror dri;
-
- /* Busy waiting */
- GLuint do_usleeps;
- GLuint do_irqs;
- GLuint irqsEmitted;
- drm_radeon_irq_wait_t iw;
-
- /* VBI / buffer swap */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
- int64_t swap_ust;
- int64_t swap_missed_ust;
-
- GLuint swap_count;
- GLuint swap_missed_count;
-
-
- /* Derived state */
- struct radeon_state state;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-};
-
-#define RADEON_CONTEXT(glctx) ((radeonContextPtr)(ctx->DriverCtx))
-
-extern void radeonSwapBuffers(__DRIdrawablePrivate * dPriv);
-extern GLboolean radeonInitContext(radeonContextPtr radeon,
- struct dd_function_table* functions,
- const __GLcontextModes * glVisual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate);
-extern void radeonCleanupContext(radeonContextPtr radeon);
-extern GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
- __DRIdrawablePrivate * driDrawPriv,
- __DRIdrawablePrivate * driReadPriv);
-extern GLboolean radeonUnbindContext(__DRIcontextPrivate * driContextPriv);
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-
-#if DO_DEBUG
-extern int RADEON_DEBUG;
-#else
-#define RADEON_DEBUG 0
-#endif
-
-#define DEBUG_TEXTURE 0x0001
-#define DEBUG_STATE 0x0002
-#define DEBUG_IOCTL 0x0004
-#define DEBUG_PRIMS 0x0008
-#define DEBUG_VERTS 0x0010
-#define DEBUG_FALLBACKS 0x0020
-#define DEBUG_VFMT 0x0040
-#define DEBUG_CODEGEN 0x0080
-#define DEBUG_VERBOSE 0x0100
-#define DEBUG_DRI 0x0200
-#define DEBUG_DMA 0x0400
-#define DEBUG_SANITY 0x0800
-#define DEBUG_SYNC 0x1000
-#define DEBUG_PIXEL 0x2000
-#define DEBUG_MEMORY 0x4000
-
-#endif /* __RADEON_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c
deleted file mode 100644
index af489e2a8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <sched.h>
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
-#include "swrast/swrast.h"
-#include "r200_context.h"
-#include "r300_context.h"
-#include "r200_state.h"
-#include "radeon_ioctl.h"
-#include "r200_ioctl.h"
-#include "r300_ioctl.h"
-#include "r200_tcl.h"
-#include "r200_sanity.h"
-#include "r300_state.h"
-#include "radeon_reg.h"
-
-#include "vblank.h"
-
-static void radeonWaitForIdle(radeonContextPtr radeon);
-
-/* ================================================================
- * SwapBuffers with client-side throttling
- */
-
-static uint32_t radeonGetLastFrame(radeonContextPtr radeon)
-{
- drm_radeon_getparam_t gp;
- int ret;
- uint32_t frame;
-
- gp.param = RADEON_PARAM_LAST_FRAME;
- gp.value = (int *)&frame;
- ret = drmCommandWriteRead(radeon->dri.fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__,
- ret);
- exit(1);
- }
-
- return frame;
-}
-
-static void radeonEmitIrqLocked(radeonContextPtr radeon)
-{
- drm_radeon_irq_emit_t ie;
- int ret;
-
- ie.irq_seq = &radeon->iw.irq_seq;
- ret = drmCommandWriteRead(radeon->dri.fd, DRM_RADEON_IRQ_EMIT,
- &ie, sizeof(ie));
- if (ret) {
- fprintf(stderr, "%s: drmRadeonIrqEmit: %d\n", __FUNCTION__,
- ret);
- exit(1);
- }
-}
-
-static void radeonWaitIrq(radeonContextPtr radeon)
-{
- int ret;
-
- do {
- ret = drmCommandWrite(radeon->dri.fd, DRM_RADEON_IRQ_WAIT,
- &radeon->iw, sizeof(radeon->iw));
- } while (ret && (errno == EINTR || errno == EAGAIN));
-
- if (ret) {
- fprintf(stderr, "%s: drmRadeonIrqWait: %d\n", __FUNCTION__,
- ret);
- exit(1);
- }
-}
-
-static void radeonWaitForFrameCompletion(radeonContextPtr radeon)
-{
- drm_radeon_sarea_t *sarea = radeon->sarea;
-
- if (radeon->do_irqs) {
- if (radeonGetLastFrame(radeon) < sarea->last_frame) {
- if (!radeon->irqsEmitted) {
- while (radeonGetLastFrame(radeon) <
- sarea->last_frame) ;
- } else {
- UNLOCK_HARDWARE(radeon);
- radeonWaitIrq(radeon);
- LOCK_HARDWARE(radeon);
- }
- radeon->irqsEmitted = 10;
- }
-
- if (radeon->irqsEmitted) {
- radeonEmitIrqLocked(radeon);
- radeon->irqsEmitted--;
- }
- } else {
- while (radeonGetLastFrame(radeon) < sarea->last_frame) {
- UNLOCK_HARDWARE(radeon);
- if (radeon->do_usleeps)
- DO_USLEEP(1);
- LOCK_HARDWARE(radeon);
- }
- }
-}
-
-/* Copy the back color buffer to the front color buffer.
- */
-void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv)
-{
- radeonContextPtr radeon;
- GLint nbox, i, ret;
- GLboolean missed_target;
- int64_t ust;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if (RADEON_DEBUG & DEBUG_IOCTL) {
- fprintf(stderr, "\n%s( %p )\n\n", __FUNCTION__,
- (void *)radeon->glCtx);
- }
-
- if (IS_FAMILY_R200(radeon))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(radeon->glCtx);
-
- LOCK_HARDWARE(radeon);
-
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- */
- radeonWaitForFrameCompletion(radeon);
- UNLOCK_HARDWARE(radeon);
- driWaitForVBlank(dPriv, &radeon->vbl_seq, radeon->vblank_flags,
- &missed_target);
- LOCK_HARDWARE(radeon);
-
- nbox = dPriv->numClipRects; /* must be in locked region */
-
- for (i = 0; i < nbox;) {
- GLint nr = MIN2(i + RADEON_NR_SAREA_CLIPRECTS, nbox);
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = radeon->sarea->boxes;
- GLint n = 0;
-
- for (; i < nr; i++) {
- *b++ = box[i];
- n++;
- }
- radeon->sarea->nbox = n;
-
- ret = drmCommandNone(radeon->dri.fd, DRM_RADEON_SWAP);
-
- if (ret) {
- fprintf(stderr, "DRM_RADEON_SWAP: return = %d\n",
- ret);
- UNLOCK_HARDWARE(radeon);
- exit(1);
- }
- }
-
- UNLOCK_HARDWARE(radeon);
-
- if (IS_FAMILY_R200(radeon))
- ((r200ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
- else
- ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
-
- radeon->swap_count++;
- (*dri_interface->getUST) (&ust);
- if (missed_target) {
- radeon->swap_missed_count++;
- radeon->swap_missed_ust = ust - radeon->swap_ust;
- }
-
- radeon->swap_ust = ust;
-
- sched_yield();
-}
-
-void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
-{
- radeonContextPtr radeon;
- GLint ret;
- GLboolean missed_target;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if (RADEON_DEBUG & DEBUG_IOCTL) {
- fprintf(stderr, "%s: pfCurrentPage: %d\n", __FUNCTION__,
- radeon->sarea->pfCurrentPage);
- }
-
- if (IS_FAMILY_R200(radeon))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(radeon->glCtx);
- LOCK_HARDWARE(radeon);
-
- if (!dPriv->numClipRects) {
- UNLOCK_HARDWARE(radeon);
- usleep(10000); /* throttle invisible client 10ms */
- return;
- }
-
- /* Need to do this for the perf box placement:
- */
- {
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = radeon->sarea->boxes;
- b[0] = box[0];
- radeon->sarea->nbox = 1;
- }
-
- /* Throttle the frame rate -- only allow a few pending swap buffers
- * request at a time.
- */
- radeonWaitForFrameCompletion(radeon);
- UNLOCK_HARDWARE(radeon);
- driWaitForVBlank(dPriv, &radeon->vbl_seq, radeon->vblank_flags,
- &missed_target);
- if (missed_target) {
- radeon->swap_missed_count++;
- (void)(*dri_interface->getUST) (&radeon->swap_missed_ust);
- }
- LOCK_HARDWARE(radeon);
-
- ret = drmCommandNone(radeon->dri.fd, DRM_RADEON_FLIP);
-
- UNLOCK_HARDWARE(radeon);
-
- if (ret) {
- fprintf(stderr, "DRM_RADEON_FLIP: return = %d\n", ret);
- exit(1);
- }
-
- radeon->swap_count++;
- (void)(*dri_interface->getUST) (&radeon->swap_ust);
-
- if (radeon->sarea->pfCurrentPage == 1) {
- radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset;
- radeon->state.color.drawPitch = radeon->radeonScreen->frontPitch;
- } else {
- radeon->state.color.drawOffset = radeon->radeonScreen->backOffset;
- radeon->state.color.drawPitch = radeon->radeonScreen->backPitch;
- }
-
- if (IS_FAMILY_R200(radeon)) {
- r200ContextPtr r200 = (r200ContextPtr)radeon;
-
- R200_STATECHANGE(r200, ctx);
- r200->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = radeon->state.color.drawOffset
- + radeon->radeonScreen->fbLocation;
- r200->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = radeon->state.color.drawPitch;
- }
- if (IS_FAMILY_R300(radeon)) {
- r300ContextPtr r300 = (r300ContextPtr)radeon;
- R300_STATECHANGE(r300, cb);
- r300->hw.cb.cmd[R300_CB_OFFSET] = r300->radeon.state.color.drawOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.state.color.drawPitch;
-
- if (r300->radeon.radeonScreen->cpp == 4)
- r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888;
- else
- r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565;
-
- if (r300->radeon.sarea->tiling_enabled)
- r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_TILE_ENABLE;
- }
-}
-
-void radeonWaitForIdleLocked(radeonContextPtr radeon)
-{
- int ret;
- int i = 0;
-
- do {
- ret = drmCommandNone(radeon->dri.fd, DRM_RADEON_CP_IDLE);
- if (ret)
- DO_USLEEP(1);
- } while (ret && ++i < 100);
-
- if (ret < 0) {
- UNLOCK_HARDWARE(radeon);
- fprintf(stderr, "Error: R200 timed out... exiting\n");
- exit(-1);
- }
-}
-
-static void radeonWaitForIdle(radeonContextPtr radeon)
-{
- LOCK_HARDWARE(radeon);
- radeonWaitForIdleLocked(radeon);
- UNLOCK_HARDWARE(radeon);
-}
-
-void radeonFlush(GLcontext * ctx)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- if (IS_FAMILY_R300(radeon))
- r300Flush(ctx);
-#if R200_MERGED
- else
- r200Flush(ctx);
-#endif
-}
-
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
- */
-void radeonFinish(GLcontext * ctx)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- radeonFlush(ctx);
-
- if (radeon->do_irqs) {
- LOCK_HARDWARE(radeon);
- radeonEmitIrqLocked(radeon);
- UNLOCK_HARDWARE(radeon);
- radeonWaitIrq(radeon);
- } else
- radeonWaitForIdle(radeon);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.h
deleted file mode 100644
index 7c19325dd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_IOCTL_H__
-#define __RADEON_IOCTL_H__
-
-#include "simple_list.h"
-#include "radeon_dri.h"
-#include "radeon_lock.h"
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "r200_context.h"
-#include "radeon_drm.h"
-
-extern void radeonCopyBuffer(const __DRIdrawablePrivate * drawable);
-extern void radeonPageFlip(const __DRIdrawablePrivate * drawable);
-extern void radeonFlush(GLcontext * ctx);
-extern void radeonFinish(GLcontext * ctx);
-extern void radeonWaitForIdleLocked(radeonContextPtr radeon);
-
-#endif /* __RADEON_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.c
deleted file mode 100644
index 3c7fc72a4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-#include <string.h>
-
-#include "r200_context.h"
-#include "radeon_lock.h"
-#include "r200_tex.h"
-#include "r200_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-
-#include "framebuffer.h"
-
-#if DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-/* Turn on/off page flipping according to the flags in the sarea:
- */
-static void radeonUpdatePageFlipping(radeonContextPtr radeon)
-{
- int use_back;
-
- radeon->doPageFlip = radeon->sarea->pfState;
-
- use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
- use_back ^= (radeon->sarea->pfCurrentPage == 1);
-
- if (use_back) {
- radeon->state.color.drawOffset = radeon->radeonScreen->backOffset;
- radeon->state.color.drawPitch = radeon->radeonScreen->backPitch;
- } else {
- radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset;
- radeon->state.color.drawPitch = radeon->radeonScreen->frontPitch;
- }
-}
-
-/**
- * Called by radeonGetLock() after the lock has been obtained.
- */
-#if R200_MERGED
-static void r200RegainedLock(r200ContextPtr r200)
-{
- __DRIdrawablePrivate *dPriv = r200->radeon.dri.drawable;
- int i;
-
- if (r200->radeon.lastStamp != dPriv->lastStamp) {
- radeonUpdatePageFlipping(&r200->radeon);
- R200_STATECHANGE(r200, ctx);
- r200->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] =
- r200->radeon.state.color.drawOffset
- + r200->radeon.radeonScreen->fbLocation;
- r200->hw.ctx.cmd[CTX_RB3D_COLORPITCH] =
- r200->radeon.state.color.drawPitch;
-
- if (r200->radeon.glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
- radeonSetCliprects(&r200->radeon, GL_BACK_LEFT);
- else
- radeonSetCliprects(&r200->radeon, GL_FRONT_LEFT);
- r200UpdateViewportOffset(r200->radeon.glCtx);
- r200->radeon.lastStamp = dPriv->lastStamp;
- }
-
- for (i = 0; i < r200->nr_heaps; i++) {
- DRI_AGE_TEXTURES(r200->texture_heaps[i]);
- }
-}
-#endif
-
-static void r300RegainedLock(radeonContextPtr radeon)
-{
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable;
-
- if (radeon->lastStamp != dPriv->lastStamp) {
- _mesa_resize_framebuffer(radeon->glCtx,
- (GLframebuffer*)dPriv->driverPrivate,
- dPriv->w, dPriv->h);
-
- radeonUpdatePageFlipping(radeon);
-
- if (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
- radeonSetCliprects(radeon, GL_BACK_LEFT);
- else
- radeonSetCliprects(radeon, GL_FRONT_LEFT);
-
- radeonUpdateScissor(radeon->glCtx);
- radeon->lastStamp = dPriv->lastStamp;
- }
-
-#if R200_MERGED
- for (i = 0; i < r200->nr_heaps; i++) {
- DRI_AGE_TEXTURES(r200->texture_heaps[i]);
- }
-#endif
-}
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void radeonGetLock(radeonContextPtr radeon, GLuint flags)
-{
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable;
- __DRIscreenPrivate *sPriv = radeon->dri.screen;
- drm_radeon_sarea_t *sarea = radeon->sarea;
-
- drmGetLock(radeon->dri.fd, radeon->dri.hwContext, flags);
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
- if (sarea->ctx_owner != radeon->dri.hwContext)
- sarea->ctx_owner = radeon->dri.hwContext;
-
- if (IS_FAMILY_R300(radeon))
- r300RegainedLock(radeon);
-#if R200_MERGED
- else
- r200RegainedLock((r200ContextPtr)radeon);
-#endif
-
- radeon->lost_context = GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.h
deleted file mode 100644
index c9acbce0c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_lock.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_LOCK_H__
-#define __RADEON_LOCK_H__
-
-#include "r200_ioctl.h"
-
-extern void radeonGetLock(radeonContextPtr radeon, GLuint flags);
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( radeon ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( (radeon)->dri.hwLock, (radeon)->dri.hwContext, \
- (DRM_LOCK_HELD | (radeon)->dri.hwContext), __ret ); \
- if ( __ret ) \
- radeonGetLock( (radeon), 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-#if R200_MERGED
-#define UNLOCK_HARDWARE( radeon ) \
- do { \
- DRM_UNLOCK( (radeon)->dri.fd, \
- (radeon)->dri.hwLock, \
- (radeon)->dri.hwContext ); \
- DEBUG_RESET(); \
- if (IS_FAMILY_R200((radeon))) { \
- r200ContextPtr __r200 = (r200ContextPtr)(radeon); \
- if (__r200->save_on_next_unlock) \
- r200SaveHwState( __r200 ); \
- __r200->save_on_next_unlock = GL_FALSE; \
- } \
- } while (0)
-#else
-#define UNLOCK_HARDWARE( radeon ) \
- do { \
- DRM_UNLOCK( (radeon)->dri.fd, \
- (radeon)->dri.hwLock, \
- (radeon)->dri.hwContext ); \
- DEBUG_RESET(); \
- } while (0)
-#endif
-#endif /* __RADEON_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.c
deleted file mode 100644
index 663bc973b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.c
+++ /dev/null
@@ -1,879 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/**
- * \file radeon_screen.c
- * Screen initialization functions for the R200 driver.
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <dlfcn.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "mtypes.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#define STANDALONE_MMIO
-#include "radeon_screen.h"
-#include "r200_context.h"
-#include "r300_context.h"
-#include "radeon_ioctl.h"
-#include "r200_ioctl.h"
-#include "radeon_macros.h"
-#include "radeon_reg.h"
-#include "radeon_span.h"
-
-#include "utils.h"
-#include "vblank.h"
-#include "GL/internal/dri_interface.h"
-#include "drirenderbuffer.h"
-
-/* R200 configuration
- */
-#include "xmlpool.h"
-
-const char __driR200ConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_MAX_TEXTURE_UNITS(4, 2, 6)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_DEF_MAX_ANISOTROPY(1.0, "1.0,2.0,4.0,8.0,16.0")
- DRI_CONF_NO_NEG_LOD_BIAS(false)
- DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
- DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
- DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_SOFTWARE
- DRI_CONF_ARB_VERTEX_PROGRAM(true)
- DRI_CONF_NV_VERTEX_PROGRAM(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driR200NConfigOptions = 13;
-
-/* TODO: integrate these into xmlpool.h! */
-#define DRI_CONF_MAX_TEXTURE_IMAGE_UNITS(def,min,max) \
-DRI_CONF_OPT_BEGIN_V(texture_image_units,int,def, # min ":" # max ) \
- DRI_CONF_DESC(en,"Number of texture image units") \
- DRI_CONF_DESC(de,"Anzahl der Textureinheiten") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_MAX_TEXTURE_COORD_UNITS(def,min,max) \
-DRI_CONF_OPT_BEGIN_V(texture_coord_units,int,def, # min ":" # max ) \
- DRI_CONF_DESC(en,"Number of texture coordinate units") \
- DRI_CONF_DESC(de,"Anzahl der Texturkoordinateneinheiten") \
-DRI_CONF_OPT_END
-
-#define DRI_CONF_COMMAND_BUFFER_SIZE(def,min,max) \
-DRI_CONF_OPT_BEGIN_V(command_buffer_size,int,def, # min ":" # max ) \
- DRI_CONF_DESC(en,"Size of command buffer (in KB)") \
- DRI_CONF_DESC(de,"Grösse des Befehlspuffers (in KB)") \
-DRI_CONF_OPT_END
-
-
-const char __driR300ConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_MAX_TEXTURE_IMAGE_UNITS(16, 2, 16)
- DRI_CONF_MAX_TEXTURE_COORD_UNITS(8, 2, 8)
- DRI_CONF_COMMAND_BUFFER_SIZE(8, 8, 32)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_DEF_MAX_ANISOTROPY(1.0, "1.0,2.0,4.0,8.0,16.0")
- DRI_CONF_NO_NEG_LOD_BIAS(false)
- DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
- DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
- DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driR300NConfigOptions = 13;
-
-extern const struct dri_extension card_extensions[];
-
-#ifndef RADEON_DEBUG
-int RADEON_DEBUG = 0;
-#endif
-
-static const struct dri_debug_control debug_control[] = {
- {"fall", DEBUG_FALLBACKS},
- {"tex", DEBUG_TEXTURE},
- {"ioctl", DEBUG_IOCTL},
- {"prim", DEBUG_PRIMS},
- {"vert", DEBUG_VERTS},
- {"state", DEBUG_STATE},
- {"code", DEBUG_CODEGEN},
- {"vfmt", DEBUG_VFMT},
- {"vtxf", DEBUG_VFMT},
- {"verb", DEBUG_VERBOSE},
- {"dri", DEBUG_DRI},
- {"dma", DEBUG_DMA},
- {"san", DEBUG_SANITY},
- {"sync", DEBUG_SYNC},
- {"pix", DEBUG_PIXEL},
- {"mem", DEBUG_MEMORY},
- {"allmsg", ~DEBUG_SYNC}, /* avoid the term "sync" because the parser uses strstr */
- {NULL, 0}
-};
-
-#if 1
-/* Including xf86PciInfo.h introduces a bunch of errors...
- */
-#define PCI_CHIP_R200_QD 0x5144 /* why do they have r200 names? */
-#define PCI_CHIP_R200_QE 0x5145 /* Those are all standard radeons */
-#define PCI_CHIP_R200_QF 0x5146
-#define PCI_CHIP_R200_QG 0x5147
-#define PCI_CHIP_R200_QY 0x5159
-#define PCI_CHIP_R200_QZ 0x515A
-#define PCI_CHIP_R200_LW 0x4C57
-#define PCI_CHIP_R200_LY 0x4C59
-#define PCI_CHIP_R200_LZ 0x4C5A
-#define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */
-#define PCI_CHIP_RV200_QX 0x5158
-#define PCI_CHIP_RS100_4136 0x4136 /* IGP RS100, RS200, RS250 are not R200 */
-#define PCI_CHIP_RS200_4137 0x4137
-#define PCI_CHIP_RS250_4237 0x4237
-#define PCI_CHIP_RS100_4336 0x4336
-#define PCI_CHIP_RS200_4337 0x4337
-#define PCI_CHIP_RS250_4437 0x4437
-#define PCI_CHIP_RS300_5834 0x5834 /* All RS300's are R200 */
-#define PCI_CHIP_RS300_5835 0x5835
-#define PCI_CHIP_RS300_5836 0x5836
-#define PCI_CHIP_RS300_5837 0x5837
-#define PCI_CHIP_R200_BB 0x4242 /* r200 (non-derived) start */
-#define PCI_CHIP_R200_BC 0x4243
-#define PCI_CHIP_R200_QH 0x5148
-#define PCI_CHIP_R200_QI 0x5149
-#define PCI_CHIP_R200_QJ 0x514A
-#define PCI_CHIP_R200_QK 0x514B
-#define PCI_CHIP_R200_QL 0x514C
-#define PCI_CHIP_R200_QM 0x514D
-#define PCI_CHIP_R200_QN 0x514E
-#define PCI_CHIP_R200_QO 0x514F /* r200 (non-derived) end */
-/* are the R200 Qh (0x5168) and following needed too? They are not in xf86PciInfo.h
- but in the pci database. Maybe just secondary ports or something ? */
-
-#define PCI_CHIP_R300_AD 0x4144
-#define PCI_CHIP_R300_AE 0x4145
-#define PCI_CHIP_R300_AF 0x4146
-#define PCI_CHIP_R300_AG 0x4147
-#define PCI_CHIP_RV350_AP 0x4150
-#define PCI_CHIP_RV350_AR 0x4152
-#define PCI_CHIP_RV350_AS 0x4153
-#define PCI_CHIP_RV350_NJ 0x4E4A
-#define PCI_CHIP_RV350_NP 0x4E50
-#define PCI_CHIP_RV350_NQ 0x4E51 /* Saphire 9600 256MB card */
-#define PCI_CHIP_RV350_NT 0x4E54
-#define PCI_CHIP_RV350_NQ_2 0x4E71 /* Saphire 9600 256MB card - Second Head */
-#define PCI_CHIP_R300_ND 0x4E44
-#define PCI_CHIP_R300_NE 0x4E45
-#define PCI_CHIP_R300_NF 0x4E46
-#define PCI_CHIP_R300_NG 0x4E47
-#define PCI_CHIP_R350_NH 0x4E48
-#define PCI_CHIP_R420_JI 0x4A49
-#define PCI_CHIP_R420_JK 0x4a4b
-#endif
-
-
-static radeonScreenPtr __radeonScreen;
-
-static int getSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo);
-
-static __GLcontextModes *radeonFillInModes(unsigned pixel_bits,
- unsigned depth_bits,
- unsigned stencil_bits,
- GLboolean have_back_buffer)
-{
- __GLcontextModes *modes;
- __GLcontextModes *m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- uint8_t depth_bits_array[2];
- uint8_t stencil_bits_array[2];
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0)
- || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if (pixel_bits == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- } else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes) (num_modes, sizeof(__GLcontextModes));
- m = modes;
- if (!driFillInModes(&m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor, GLX_TRUE_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
- __LINE__);
- return NULL;
- }
-
- if (!driFillInModes(&m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor, GLX_DIRECT_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
- __LINE__);
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for (m = modes; m != NULL; m = m->next) {
- if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/* Create the device specific screen private data struct.
- */
-static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
-{
- radeonScreenPtr screen;
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) sPriv->pDevPriv;
- unsigned char *RADEONMMIO;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC)
- (*dri_interface->getProcAddress("glxEnableExtension"));
- void *const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- screen = (radeonScreenPtr) CALLOC(sizeof(*screen));
- if (!screen) {
- __driUtilMessage
- ("%s: Could not allocate memory for screen structure",
- __FUNCTION__);
- return NULL;
- }
-
-#if DO_DEBUG
- RADEON_DEBUG = driParseDebugString(getenv("RADEON_DEBUG"), debug_control);
-#endif
-
- /* Get family and potential quirks from the PCI device ID.
- */
- switch (dri_priv->deviceID) {
- case PCI_CHIP_R200_QD:
- case PCI_CHIP_R200_QE:
- case PCI_CHIP_R200_QF:
- case PCI_CHIP_R200_QG:
- case PCI_CHIP_R200_QY:
- case PCI_CHIP_R200_QZ:
- case PCI_CHIP_RV200_QW:
- case PCI_CHIP_RV200_QX:
- case PCI_CHIP_R200_LW:
- case PCI_CHIP_R200_LY:
- case PCI_CHIP_R200_LZ:
- case PCI_CHIP_RS100_4136:
- case PCI_CHIP_RS200_4137:
- case PCI_CHIP_RS250_4237:
- case PCI_CHIP_RS100_4336:
- case PCI_CHIP_RS200_4337:
- case PCI_CHIP_RS250_4437:
- __driUtilMessage("radeonCreateScreen(): Device isn't an r200!\n");
- FREE(screen);
- return NULL;
-
- case PCI_CHIP_RS300_5834:
- case PCI_CHIP_RS300_5835:
- case PCI_CHIP_RS300_5836:
- case PCI_CHIP_RS300_5837:
- screen->chipset = RADEON_CHIP_UNREAL_R200;
- break;
-
- case PCI_CHIP_R200_BB:
- case PCI_CHIP_R200_BC:
- case PCI_CHIP_R200_QH:
- case PCI_CHIP_R200_QI:
- case PCI_CHIP_R200_QJ:
- case PCI_CHIP_R200_QK:
- case PCI_CHIP_R200_QL:
- case PCI_CHIP_R200_QM:
- case PCI_CHIP_R200_QN:
- case PCI_CHIP_R200_QO:
- screen->chipset = RADEON_CHIP_REAL_R200 | RADEON_CHIPSET_TCL;
- break;
-
- /* TODO: Check all those chips for the exact flags required.
- */
- case PCI_CHIP_R300_AD:
- case PCI_CHIP_R300_AE:
- case PCI_CHIP_R300_AF:
- case PCI_CHIP_R300_AG:
- case PCI_CHIP_RV350_AP:
- case PCI_CHIP_RV350_AR:
- case PCI_CHIP_RV350_AS:
- case PCI_CHIP_RV350_NJ:
- case PCI_CHIP_RV350_NP:
- case PCI_CHIP_RV350_NT:
- case PCI_CHIP_RV350_NQ:
-/* case PCI_CHIP_RV350_NQ: -- Should we have the second head in here too? */
- screen->chipset = RADEON_CHIP_RV350;
- break;
-
- case PCI_CHIP_R300_ND: /* confirmed -- nh */
- case PCI_CHIP_R300_NE:
- case PCI_CHIP_R300_NF:
- case PCI_CHIP_R300_NG:
- case PCI_CHIP_R350_NH:
- screen->chipset = RADEON_CHIP_R300;
- break;
-
- case PCI_CHIP_R420_JI:
- case PCI_CHIP_R420_JK:
- screen->chipset = RADEON_CHIP_R420;
- break;
-
- default:
- fprintf(stderr,
- "Unknown device ID %04X, please report. Assuming plain R300.\n",
- dri_priv->deviceID);
- screen->chipset = RADEON_CHIP_R300;
- }
-
- /* Parse configuration */
- if (GET_CHIP(screen) >= RADEON_CHIP_R300) {
- driParseOptionInfo(&screen->optionCache,
- __driR300ConfigOptions, __driR300NConfigOptions);
- } else {
- driParseOptionInfo(&screen->optionCache,
- __driR200ConfigOptions, __driR200NConfigOptions);
- }
-
- /* This is first since which regions we map depends on whether or
- * not we are using a PCI card.
- */
- screen->IsPCI = dri_priv->IsPCI;
-
- {
- int ret;
- drm_radeon_getparam_t gp;
-
- gp.param = RADEON_PARAM_GART_BUFFER_OFFSET;
- gp.value = &screen->gart_buffer_offset;
-
- ret = drmCommandWriteRead(sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE(screen);
- fprintf(stderr,
- "drmRadeonGetParam (RADEON_PARAM_GART_BUFFER_OFFSET): %d\n",
- ret);
- return NULL;
- }
-
- if (sPriv->drmMinor >= 6) {
- gp.param = RADEON_PARAM_GART_BASE;
- gp.value = &screen->gart_base;
-
- ret =
- drmCommandWriteRead(sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE(screen);
- fprintf(stderr,
- "drmR200GetParam (RADEON_PARAM_GART_BASE): %d\n",
- ret);
- return NULL;
- }
-
- gp.param = RADEON_PARAM_IRQ_NR;
- gp.value = &screen->irq;
-
- ret =
- drmCommandWriteRead(sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE(screen);
- fprintf(stderr,
- "drmRadeonGetParam (RADEON_PARAM_IRQ_NR): %d\n",
- ret);
- return NULL;
- }
-
- /* Check if kernel module is new enough to support cube maps */
- screen->drmSupportsCubeMaps = (sPriv->drmMinor >= 7);
- /* Check if kernel module is new enough to support blend color and
- separate blend functions/equations */
- screen->drmSupportsBlendColor = (sPriv->drmMinor >= 11);
-
- }
- }
-
- screen->mmio.handle = dri_priv->registerHandle;
- screen->mmio.size = dri_priv->registerSize;
- if (drmMap(sPriv->fd,
- screen->mmio.handle, screen->mmio.size, &screen->mmio.map)) {
- FREE(screen);
- __driUtilMessage("%s: drmMap failed\n", __FUNCTION__);
- return NULL;
- }
-
- RADEONMMIO = screen->mmio.map;
-
- screen->status.handle = dri_priv->statusHandle;
- screen->status.size = dri_priv->statusSize;
- if (drmMap(sPriv->fd,
- screen->status.handle,
- screen->status.size, &screen->status.map)) {
- drmUnmap(screen->mmio.map, screen->mmio.size);
- FREE(screen);
- __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__);
- return NULL;
- }
- screen->scratch = (__volatile__ uint32_t *)
- ((GLubyte *) screen->status.map + RADEON_SCRATCH_REG_OFFSET);
-
- screen->buffers = drmMapBufs(sPriv->fd);
- if (!screen->buffers) {
- drmUnmap(screen->status.map, screen->status.size);
- drmUnmap(screen->mmio.map, screen->mmio.size);
- FREE(screen);
- __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__);
- return NULL;
- }
-
- if (dri_priv->gartTexHandle && dri_priv->gartTexMapSize) {
-
- screen->gartTextures.handle = dri_priv->gartTexHandle;
- screen->gartTextures.size = dri_priv->gartTexMapSize;
- if (drmMap(sPriv->fd,
- screen->gartTextures.handle,
- screen->gartTextures.size,
- (drmAddressPtr) & screen->gartTextures.map)) {
- drmUnmapBufs(screen->buffers);
- drmUnmap(screen->status.map, screen->status.size);
- drmUnmap(screen->mmio.map, screen->mmio.size);
- FREE(screen);
- __driUtilMessage
- ("%s: drmMAP failed for GART texture area\n",
- __FUNCTION__);
- return NULL;
- }
-
- screen->gart_texture_offset =
- dri_priv->gartTexOffset +
- (screen->IsPCI ? INREG(RADEON_AIC_LO_ADDR)
- : ((INREG(RADEON_MC_AGP_LOCATION) & 0x0ffffU) << 16));
- }
-
- screen->cpp = dri_priv->bpp / 8;
- screen->AGPMode = dri_priv->AGPMode;
-
- screen->fbLocation = (INREG(RADEON_MC_FB_LOCATION) & 0xffff) << 16;
-
- if (sPriv->drmMinor >= 10) {
- drm_radeon_setparam_t sp;
-
- sp.param = RADEON_SETPARAM_FB_LOCATION;
- sp.value = screen->fbLocation;
-
- drmCommandWrite(sPriv->fd, DRM_RADEON_SETPARAM,
- &sp, sizeof(sp));
- }
-
- screen->frontOffset = dri_priv->frontOffset;
- screen->frontPitch = dri_priv->frontPitch;
- screen->backOffset = dri_priv->backOffset;
- screen->backPitch = dri_priv->backPitch;
- screen->depthOffset = dri_priv->depthOffset;
- screen->depthPitch = dri_priv->depthPitch;
-
- if ( dri_priv->textureSize == 0 ) {
- screen->texOffset[RADEON_LOCAL_TEX_HEAP] = screen->gart_texture_offset;
- screen->texSize[RADEON_GART_TEX_HEAP] = dri_priv->gartTexMapSize;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] =
- dri_priv->log2GARTTexGran;
- } else {
- screen->texOffset[RADEON_LOCAL_TEX_HEAP] = dri_priv->textureOffset
- + screen->fbLocation;
- screen->texSize[RADEON_LOCAL_TEX_HEAP] = dri_priv->textureSize;
- screen->logTexGranularity[RADEON_LOCAL_TEX_HEAP] =
- dri_priv->log2TexGran;
- }
-
- if (!screen->gartTextures.map || dri_priv->textureSize == 0) {
- screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1;
- screen->texOffset[RADEON_GART_TEX_HEAP] = 0;
- screen->texSize[RADEON_GART_TEX_HEAP] = 0;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] = 0;
- } else {
- screen->numTexHeaps = RADEON_NR_TEX_HEAPS;
- screen->texOffset[RADEON_GART_TEX_HEAP] =
- screen->gart_texture_offset;
- screen->texSize[RADEON_GART_TEX_HEAP] =
- dri_priv->gartTexMapSize;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] =
- dri_priv->log2GARTTexGran;
- }
-
- screen->driScreen = sPriv;
- screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
-
- if (glx_enable_extension != NULL) {
- if (screen->irq != 0) {
- (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
- (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
- (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
- }
-
- (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
- }
-
-#if R200_MERGED
- sPriv->psc->allocateMemory = (void *)r200AllocateMemoryMESA;
- sPriv->psc->freeMemory = (void *)r200FreeMemoryMESA;
- sPriv->psc->memoryOffset = (void *)r200GetMemoryOffsetMESA;
-
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension) (psc, "GLX_MESA_allocate_memory");
- }
-#endif
-
- return screen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-static void radeonDestroyScreen(__DRIscreenPrivate * sPriv)
-{
- radeonScreenPtr screen = (radeonScreenPtr) sPriv->private;
-
- if (!screen)
- return;
-
- if (screen->gartTextures.map) {
- drmUnmap(screen->gartTextures.map, screen->gartTextures.size);
- }
- drmUnmapBufs(screen->buffers);
- drmUnmap(screen->status.map, screen->status.size);
- drmUnmap(screen->mmio.map, screen->mmio.size);
-
- /* free all option information */
- driDestroyOptionInfo(&screen->optionCache);
-
- FREE(screen);
- sPriv->private = NULL;
-}
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean radeonInitDriver(__DRIscreenPrivate * sPriv)
-{
- __radeonScreen = radeonCreateScreen(sPriv);
-
- sPriv->private = (void *)__radeonScreen;
-
- return sPriv->private ? GL_TRUE : GL_FALSE;
-}
-
-/**
- * Create and initialize the Mesa and driver specific pixmap buffer
- * data.
- *
- * \todo This function (and its interface) will need to be updated to support
- * pbuffers.
- */
-static GLboolean
-radeonCreateBuffer(__DRIscreenPrivate * driScrnPriv,
- __DRIdrawablePrivate * driDrawPriv,
- const __GLcontextModes * mesaVis, GLboolean isPixmap)
-{
- radeonScreenPtr screen = (radeonScreenPtr)driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- } else {
- const GLboolean swDepth = GL_FALSE;
- const GLboolean swAlpha = GL_FALSE;
- const GLboolean swAccum = mesaVis->accumRedBits > 0;
- const GLboolean swStencil = mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24;
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- swDepth,
- swStencil, swAccum, swAlpha);
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- radeonSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- radeonSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- radeonSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- radeonSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- radeonSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- swDepth,
- swStencil,
- swAccum,
- swAlpha,
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-static void radeonDestroyBuffer(__DRIdrawablePrivate * driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->
- driverPrivate));
-}
-
-
-/**
- * Choose the appropriate CreateContext function based on the chipset.
- */
-static GLboolean radeonCreateContext(const __GLcontextModes * glVisual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPriv)
-{
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
- int chip = GET_CHIP(screen);
-
- if (chip >= RADEON_CHIP_R300)
- return r300CreateContext(glVisual, driContextPriv, sharedContextPriv);
-#if R200_MERGED
- else
- return r200CreateContext(glVisual, driContextPriv, sharedContextPriv);
-#endif
-}
-
-
-/**
- * Choose the appropriate DestroyContext function based on the chipset.
- */
-static void radeonDestroyContext(__DRIcontextPrivate * driContextPriv)
-{
- radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
- int chip = GET_CHIP(radeon->radeonScreen);
-
- if (chip >= RADEON_CHIP_R300)
- return r300DestroyContext(driContextPriv);
-#if R200_MERGED
- else
- return r200DestroyContext(driContextPriv);
-#endif
-}
-
-
-static const struct __DriverAPIRec radeonAPI = {
- .InitDriver = radeonInitDriver,
- .DestroyScreen = radeonDestroyScreen,
- .CreateContext = radeonCreateContext,
- .DestroyContext = radeonDestroyContext,
- .CreateBuffer = radeonCreateBuffer,
- .DestroyBuffer = radeonDestroyBuffer,
- .SwapBuffers = radeonSwapBuffers,
- .MakeCurrent = radeonMakeCurrent,
- .UnbindContext = radeonUnbindContext,
- .GetSwapInfo = getSwapInfo,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-void *__driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
- __DRIscreen * psc, const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd, int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes)
-{
- __DRIscreenPrivate *psp;
- static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 17, 0 };
-
- dri_interface = interface;
-
- if (!driCheckDriDdxDrmVersions3("R300",
- dri_version, &dri_expected,
- ddx_version, &ddx_expected,
- drm_version, &drm_expected)) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &radeonAPI);
- if (psp != NULL) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = radeonFillInModes(dri_priv->bpp,
- (dri_priv->bpp ==
- 16) ? 16 : 24,
- (dri_priv->bpp ==
- 16) ? 0 : 8,
- (dri_priv->backOffset !=
- dri_priv->depthOffset));
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *)psp;
-}
-
-
-/**
- * Get information about previous buffer swaps.
- */
-static int getSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
-{
- radeonContextPtr radeon;
-
- if ((dPriv == NULL) || (dPriv->driContextPriv == NULL)
- || (dPriv->driContextPriv->driverPrivate == NULL)
- || (sInfo == NULL)) {
- return -1;
- }
-
- radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
- sInfo->swap_count = radeon->swap_count;
- sInfo->swap_ust = radeon->swap_ust;
- sInfo->swap_missed_count = radeon->swap_missed_count;
-
- sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
- ? driCalculateSwapUsage(dPriv, 0, radeon->swap_missed_ust)
- : 0.0;
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.h
deleted file mode 100644
index ac8471fea..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_screen.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_SCREEN_H__
-#define __RADEON_SCREEN_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "radeon_drm.h"
-#include "dri_util.h"
-#include "xmlconfig.h"
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- drmAddress map; /* Mapping of the DRM region */
-} radeonRegionRec, *radeonRegionPtr;
-
-/* chipset features */
-#define RADEON_CHIP_UNREAL_R200 0
-#define RADEON_CHIP_REAL_R200 1
-#define RADEON_CHIP_R300 2
-#define RADEON_CHIP_RV350 3
-#define RADEON_CHIP_R420 4
-#define RADEON_CHIP_MASK 0x0f
-
-#define RADEON_CHIPSET_TCL (1 << 8)
-
-#define GET_CHIP(screen) ((screen)->chipset & RADEON_CHIP_MASK)
-#define IS_FAMILY_R200(radeon) (GET_CHIP((radeon)->radeonScreen) < RADEON_CHIP_R300)
-#define IS_FAMILY_R300(radeon) (GET_CHIP((radeon)->radeonScreen) >= RADEON_CHIP_R300)
-
-#define R200_NR_TEX_HEAPS 2
-
-typedef struct {
- int chipset;
- int cpp;
- int IsPCI; /* Current card is a PCI card */
- int AGPMode;
- unsigned int irq; /* IRQ number (0 means none) */
-
- unsigned int fbLocation;
- unsigned int frontOffset;
- unsigned int frontPitch;
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- /* Shared texture data */
- int numTexHeaps;
- int texOffset[R200_NR_TEX_HEAPS];
- int texSize[R200_NR_TEX_HEAPS];
- int logTexGranularity[R200_NR_TEX_HEAPS];
-
- radeonRegionRec mmio;
- radeonRegionRec status;
- radeonRegionRec gartTextures;
-
- drmBufMapPtr buffers;
-
- __volatile__ int32_t *scratch;
-
- __DRIscreenPrivate *driScreen;
- unsigned int sarea_priv_offset;
- unsigned int gart_buffer_offset; /* offset in card memory space */
- unsigned int gart_texture_offset; /* offset in card memory space */
- unsigned int gart_base;
-
- GLboolean drmSupportsCubeMaps; /* need radeon kernel module >=1.7 */
- GLboolean drmSupportsBlendColor; /* need radeon kernel module >= 1.11 */
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} radeonScreenRec, *radeonScreenPtr;
-
-#endif
-#endif /* __RADEON_SCREEN_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.c
deleted file mode 100644
index 8902c93e5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "swrast/swrast.h"
-#include "colormac.h"
-
-#include "r200_context.h"
-#include "radeon_ioctl.h"
-#include "r300_ioctl.h"
-#include "radeon_span.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- radeonContextPtr radeon = RADEON_CONTEXT(ctx); \
- driRenderbuffer* drb = (driRenderbuffer*)rb; \
- __DRIscreenPrivate *sPriv = radeon->dri.screen; \
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable; \
- GLuint pitch = drb->pitch * drb->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- drb->offset + \
- (dPriv->x * drb->cpp) + \
- (dPriv->y * pitch)); \
- GLuint p; \
- (void) p
-
-#define LOCAL_DEPTH_VARS \
- radeonContextPtr radeon = RADEON_CONTEXT(ctx); \
- driRenderbuffer* drb = (driRenderbuffer*)rb; \
- __DRIscreenPrivate *sPriv = radeon->dri.screen; \
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable; \
- GLuint pitch = drb->pitch; \
- GLuint height = dPriv->h; \
- GLuint xo = dPriv->x; \
- GLuint yo = dPriv->y; \
- char *buf = (char *)(sPriv->pFB + drb->offset); \
- (void) buf; (void) pitch
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define CLIPPIXEL( _x, _y ) \
- ((_x >= minx) && (_x < maxx) && (_y >= miny) && (_y < maxy))
-
-#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
- if ( _y < miny || _y >= maxy ) { \
- _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); \
- }
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#define HW_LOCK()
-
-#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;
-
-#define HW_ENDCLIPLOOP() \
- } \
- } while (0)
-
-#define HW_UNLOCK()
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#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 ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \
- 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)
-
-#define TAG(x) radeon##x##_RGB565
-#include "spantmp.h"
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-#undef INIT_MONO_PIXEL
-#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 *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
- (g << 8) | \
- (r << 16) | \
- (a << 24) ); \
-} while (0)
-
-#define WRITE_PIXEL( _x, _y, p ) \
-do { \
- *(GLuint *)(buf + _x*4 + _y*pitch) = p; \
-} while (0)
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- volatile GLuint *ptr = (volatile GLuint *)(buf + _x*4 + _y*pitch); \
- GLuint p = *ptr; \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
-} while (0)
-
-#define TAG(x) radeon##x##_ARGB8888
-#include "spantmp.h"
-
-/* ================================================================
- * Depth buffer
- */
-
-/* 16-bit depth buffer functions
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x + xo + (_y + yo)*pitch)*2 ) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x + xo + (_y + yo)*pitch)*2 );
-
-#define TAG(x) radeon##x##_16_LINEAR
-#include "depthtmp.h"
-
-/* 24 bit depth, 8 bit stencil depthbuffer functions
- *
- * Careful: It looks like the R300 uses ZZZS byte order while the R200
- * uses SZZZ for 24 bit depth, 8 bit stencil mode.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
-do { \
- GLuint offset = ((_x) + xo + ((_y) + yo)*pitch)*4; \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0x000000ff; \
- tmp |= ((d << 8) & 0xffffff00); \
- *(GLuint *)(buf + offset) = tmp; \
-} while (0)
-
-#define READ_DEPTH( d, _x, _y ) \
-do { \
- d = (*(GLuint *)(buf + ((_x) + xo + ((_y) + yo)*pitch)*4) & 0xffffff00) >> 8; \
-} while(0)
-
-#define TAG(x) radeon##x##_24_8_LINEAR
-#include "depthtmp.h"
-
-/* ================================================================
- * Stencil buffer
- */
-
-/* 24 bit depth, 8 bit stencil depthbuffer functions
- */
-#define WRITE_STENCIL( _x, _y, d ) \
-do { \
- GLuint offset = (_x + xo + (_y + yo)*pitch)*4; \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xffffff00; \
- tmp |= (d) & 0xff; \
- *(GLuint *)(buf + offset) = tmp; \
-} while (0)
-
-#define READ_STENCIL( d, _x, _y ) \
-do { \
- GLuint offset = (_x + xo + (_y + yo)*pitch)*4; \
- GLuint tmp = *(GLuint *)(buf + offset); \
- d = tmp & 0x000000ff; \
-} while (0)
-
-#define TAG(x) radeon##x##_24_8_LINEAR
-#include "stenciltmp.h"
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void radeonSetBuffer(GLcontext * ctx,
- GLframebuffer * colorBuffer, GLuint bufferBit)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
- int buffer;
-
- switch (bufferBit) {
- case BUFFER_BIT_FRONT_LEFT:
- buffer = 0;
- break;
-
- case BUFFER_BIT_BACK_LEFT:
- buffer = 1;
- break;
-
- default:
- _mesa_problem(ctx, "Bad bufferBit in %s", __FUNCTION__);
- return;
- }
-
- if (radeon->doPageFlip && radeon->sarea->pfCurrentPage == 1)
- buffer ^= 1;
-
-#if 0
- fprintf(stderr, "%s: using %s buffer\n", __FUNCTION__,
- buffer ? "back" : "front");
-#endif
-
- if (buffer) {
- radeon->state.pixel.readOffset =
- radeon->radeonScreen->backOffset;
- radeon->state.pixel.readPitch =
- radeon->radeonScreen->backPitch;
- radeon->state.color.drawOffset =
- radeon->radeonScreen->backOffset;
- radeon->state.color.drawPitch =
- radeon->radeonScreen->backPitch;
- } else {
- radeon->state.pixel.readOffset =
- radeon->radeonScreen->frontOffset;
- radeon->state.pixel.readPitch =
- radeon->radeonScreen->frontPitch;
- radeon->state.color.drawOffset =
- radeon->radeonScreen->frontOffset;
- radeon->state.color.drawPitch =
- radeon->radeonScreen->frontPitch;
- }
-}
-
-/* Move locking out to get reasonable span performance (10x better
- * than doing this in HW_LOCK above). WaitForIdle() is the main
- * culprit.
- */
-
-static void radeonSpanRenderStart(GLcontext * ctx)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- if (IS_FAMILY_R200(radeon))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(ctx);
-
- LOCK_HARDWARE(radeon);
- radeonWaitForIdleLocked(radeon);
-
- /* Read & rewrite the first pixel in the frame buffer. This should
- * be a noop, right? In fact without this conform fails as reading
- * from the framebuffer sometimes produces old results -- the
- * on-card read cache gets mixed up and doesn't notice that the
- * framebuffer has been updated.
- *
- * In the worst case this is buggy too as p might get the wrong
- * value first time, so really need a hidden pixel somewhere for this.
- */
- {
- int p;
- volatile int *read_buf =
- (volatile int *)(radeon->dri.screen->pFB +
- radeon->state.pixel.readOffset);
- p = *read_buf;
- *read_buf = p;
- }
-}
-
-static void radeonSpanRenderFinish(GLcontext * ctx)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- _swrast_flush(ctx);
- UNLOCK_HARDWARE(radeon);
-}
-
-void radeonInitSpanFuncs(GLcontext * ctx)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
- struct swrast_device_driver *swdd =
- _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = radeonSetBuffer;
-
- swdd->SpanRenderStart = radeonSpanRenderStart;
- swdd->SpanRenderFinish = radeonSpanRenderFinish;
-}
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = radeonReadRGBASpan_RGB565;
- drb->Base.GetValues = radeonReadRGBAPixels_RGB565;
- drb->Base.PutRow = radeonWriteRGBASpan_RGB565;
- drb->Base.PutRowRGB = radeonWriteRGBSpan_RGB565;
- drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_RGB565;
- drb->Base.PutValues = radeonWriteRGBAPixels_RGB565;
- drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_RGB565;
- }
- else {
- drb->Base.GetRow = radeonReadRGBASpan_ARGB8888;
- drb->Base.GetValues = radeonReadRGBAPixels_ARGB8888;
- drb->Base.PutRow = radeonWriteRGBASpan_ARGB8888;
- drb->Base.PutRowRGB = radeonWriteRGBSpan_ARGB8888;
- drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_ARGB8888;
- drb->Base.PutValues = radeonWriteRGBAPixels_ARGB8888;
- drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_ARGB8888;
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = radeonReadDepthSpan_16_LINEAR;
- drb->Base.GetValues = radeonReadDepthPixels_16_LINEAR;
- drb->Base.PutRow = radeonWriteDepthSpan_16_LINEAR;
- drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_16_LINEAR;
- drb->Base.PutValues = radeonWriteDepthPixels_16_LINEAR;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = radeonReadDepthSpan_24_8_LINEAR;
- drb->Base.GetValues = radeonReadDepthPixels_24_8_LINEAR;
- drb->Base.PutRow = radeonWriteDepthSpan_24_8_LINEAR;
- drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_24_8_LINEAR;
- drb->Base.PutValues = radeonWriteDepthPixels_24_8_LINEAR;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = radeonReadStencilSpan_24_8_LINEAR;
- drb->Base.GetValues = radeonReadStencilPixels_24_8_LINEAR;
- drb->Base.PutRow = radeonWriteStencilSpan_24_8_LINEAR;
- drb->Base.PutMonoRow = radeonWriteMonoStencilSpan_24_8_LINEAR;
- drb->Base.PutValues = radeonWriteStencilPixels_24_8_LINEAR;
- drb->Base.PutMonoValues = NULL;
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.h
deleted file mode 100644
index c4280b1b6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_span.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_SPAN_H__
-#define __RADEON_SPAN_H__
-
-#ifdef GLX_DIRECT_RENDERING
-
-#include "drirenderbuffer.h"
-
-extern void radeonInitSpanFuncs(GLcontext * ctx);
-extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.c
deleted file mode 100644
index 0cacbb5eb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/**************************************************************************
-
-Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
-
-The Weather Channel (TM) funded Tungsten Graphics to develop the
-initial release of the Radeon 8500 driver under the XFree86 license.
-This notice must be preserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-#include "enums.h"
-#include "colormac.h"
-#include "light.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "r200_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "r200_state.h"
-#include "r300_ioctl.h"
-
-
-/* =============================================================
- * Scissoring
- */
-
-static GLboolean intersect_rect(drm_clip_rect_t * out,
- drm_clip_rect_t * a, drm_clip_rect_t * b)
-{
- *out = *a;
- if (b->x1 > out->x1)
- out->x1 = b->x1;
- if (b->y1 > out->y1)
- out->y1 = b->y1;
- if (b->x2 < out->x2)
- out->x2 = b->x2;
- if (b->y2 < out->y2)
- out->y2 = b->y2;
- if (out->x1 >= out->x2)
- return GL_FALSE;
- if (out->y1 >= out->y2)
- return GL_FALSE;
- return GL_TRUE;
-}
-
-void radeonRecalcScissorRects(radeonContextPtr radeon)
-{
- drm_clip_rect_t *out;
- int i;
-
- /* Grow cliprect store?
- */
- if (radeon->state.scissor.numAllocedClipRects < radeon->numClipRects) {
- while (radeon->state.scissor.numAllocedClipRects <
- radeon->numClipRects) {
- radeon->state.scissor.numAllocedClipRects += 1; /* zero case */
- radeon->state.scissor.numAllocedClipRects *= 2;
- }
-
- if (radeon->state.scissor.pClipRects)
- FREE(radeon->state.scissor.pClipRects);
-
- radeon->state.scissor.pClipRects =
- MALLOC(radeon->state.scissor.numAllocedClipRects *
- sizeof(drm_clip_rect_t));
-
- if (radeon->state.scissor.pClipRects == NULL) {
- radeon->state.scissor.numAllocedClipRects = 0;
- return;
- }
- }
-
- out = radeon->state.scissor.pClipRects;
- radeon->state.scissor.numClipRects = 0;
-
- for (i = 0; i < radeon->numClipRects; i++) {
- if (intersect_rect(out,
- &radeon->pClipRects[i],
- &radeon->state.scissor.rect)) {
- radeon->state.scissor.numClipRects++;
- out++;
- }
- }
-}
-
-void radeonUpdateScissor(GLcontext* ctx)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- assert(radeon->state.scissor.enabled == ctx->Scissor.Enabled);
-
- if (radeon->dri.drawable) {
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable;
- int x1 = dPriv->x + ctx->Scissor.X;
- int y1 = dPriv->y + dPriv->h - (ctx->Scissor.Y + ctx->Scissor.Height);
-
- radeon->state.scissor.rect.x1 = x1;
- radeon->state.scissor.rect.y1 = y1;
- radeon->state.scissor.rect.x2 = x1 + ctx->Scissor.Width - 1;
- radeon->state.scissor.rect.y2 = y1 + ctx->Scissor.Height - 1;
-
- radeonRecalcScissorRects(radeon);
- }
-}
-
-static void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- if (ctx->Scissor.Enabled) {
- /* We don't pipeline cliprect changes */
- if (IS_FAMILY_R200(radeon))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(ctx);
-
- radeonUpdateScissor(ctx);
- }
-}
-
-
-/**
- * Update cliprects and scissors.
- */
-void radeonSetCliprects(radeonContextPtr radeon, GLenum mode)
-{
- __DRIdrawablePrivate *dPriv = radeon->dri.drawable;
-
- switch (mode) {
- case GL_FRONT_LEFT:
- radeon->numClipRects = dPriv->numClipRects;
- radeon->pClipRects = dPriv->pClipRects;
- break;
- case GL_BACK_LEFT:
- /* Can't ignore 2d windows if we are page flipping.
- */
- if (dPriv->numBackClipRects == 0 || radeon->doPageFlip) {
- radeon->numClipRects = dPriv->numClipRects;
- radeon->pClipRects = dPriv->pClipRects;
- } else {
- radeon->numClipRects = dPriv->numBackClipRects;
- radeon->pClipRects = dPriv->pBackClipRects;
- }
- break;
- default:
- fprintf(stderr, "bad mode in radeonSetCliprects\n");
- radeon->numClipRects = 0;
- radeon->pClipRects = 0;
- return;
- }
-
- if (radeon->state.scissor.enabled)
- radeonRecalcScissorRects(radeon);
-}
-
-
-/**
- * Handle common enable bits.
- * Called as a fallback by r200Enable/r300Enable.
- */
-void radeonEnable(GLcontext* ctx, GLenum cap, GLboolean state)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
- switch(cap) {
- case GL_SCISSOR_TEST:
- /* We don't pipeline cliprect & scissor changes */
- if (IS_FAMILY_R200(radeon))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(ctx);
-
- radeon->state.scissor.enabled = state;
- radeonUpdateScissor(ctx);
- break;
-
- default:
- return;
- }
-}
-
-
-/**
- * Initialize default state.
- * This function is called once at context init time from
- * r200InitState/r300InitState
- */
-void radeonInitState(radeonContextPtr radeon)
-{
- radeon->Fallback = 0;
-
- if (radeon->glCtx->Visual.doubleBufferMode && radeon->sarea->pfCurrentPage == 0) {
- radeon->state.color.drawOffset = radeon->radeonScreen->backOffset;
- radeon->state.color.drawPitch = radeon->radeonScreen->backPitch;
- } else {
- radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset;
- radeon->state.color.drawPitch = radeon->radeonScreen->frontPitch;
- }
-
- radeon->state.pixel.readOffset = radeon->state.color.drawOffset;
- radeon->state.pixel.readPitch = radeon->state.color.drawPitch;
-}
-
-
-/**
- * Initialize common state functions.
- * Called by r200InitStateFuncs/r300InitStateFuncs
- */
-void radeonInitStateFuncs(struct dd_function_table *functions)
-{
- functions->Scissor = radeonScissor;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.h
deleted file mode 100644
index 636bf5d00..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/radeon_state.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-Copyright (C) 2004 Nicolai Haehnle. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Nicolai Haehnle <prefect_@gmx.net>
- */
-
-#ifndef __RADEON_STATE_H__
-#define __RADEON_STATE_H__
-
-#include "radeon_context.h"
-
-extern void radeonRecalcScissorRects(radeonContextPtr radeon);
-extern void radeonSetCliprects(radeonContextPtr radeon, GLenum mode);
-extern void radeonUpdateScissor(GLcontext* ctx);
-
-extern void radeonEnable(GLcontext* ctx, GLenum cap, GLboolean state);
-
-extern void radeonInitState(radeonContextPtr radeon);
-extern void radeonInitStateFuncs(struct dd_function_table* functions);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/vertex_shader.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/vertex_shader.h
deleted file mode 100644
index 6293915bf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/r300/vertex_shader.h
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef __VERTEX_SHADER_H__
-#define __VERTEX_SHADER_H__
-
-#include "r300_reg.h"
-
-typedef struct {
- CARD32 op;
- CARD32 src1;
- CARD32 src2;
- CARD32 src3;
- } VERTEX_SHADER_INSTRUCTION;
-
-#define VSF_FLAG_X 1
-#define VSF_FLAG_Y 2
-#define VSF_FLAG_Z 4
-#define VSF_FLAG_W 8
-#define VSF_FLAG_XYZ (VSF_FLAG_X | VSF_FLAG_Y | VSF_FLAG_Z)
-#define VSF_FLAG_ALL 0xf
-#define VSF_FLAG_NONE 0
-
-#define VSF_OUT_CLASS_TMP 0
-#define VSF_OUT_CLASS_RESULT 2
-
-
-/* first CARD32 of an instruction */
-
-/* possible operations:
- DOT, MUL, ADD, MAD, FRC, MAX, MIN, SGE, SLT, EXP, LOG, LIT, POW, RCP, RSQ, EX2,
- LG2, MAD_2 */
-
-#define MAKE_VSF_OP(op, out_reg_index, out_reg_fields, class) \
- ((op) \
- | ((out_reg_index) << R300_VPI_OUT_REG_INDEX_SHIFT) \
- | ((out_reg_fields) << 20) \
- | ( (class) << 8 ) )
-
-#define EASY_VSF_OP(op, out_reg_index, out_reg_fields, class) \
- MAKE_VSF_OP(R300_VPI_OUT_OP_##op, out_reg_index, VSF_FLAG_##out_reg_fields, VSF_OUT_CLASS_##class) \
-
-/* according to Nikolai, the subsequent 3 CARD32 are sources, use same define for each */
-
-#define VSF_IN_CLASS_TMP 0
-#define VSF_IN_CLASS_ATTR 1
-#define VSF_IN_CLASS_PARAM 2
-#define VSF_IN_CLASS_NONE 9
-
-#define VSF_IN_COMPONENT_X 0
-#define VSF_IN_COMPONENT_Y 1
-#define VSF_IN_COMPONENT_Z 2
-#define VSF_IN_COMPONENT_W 3
-#define VSF_IN_COMPONENT_ZERO 4
-#define VSF_IN_COMPONENT_ONE 5
-
-#define MAKE_VSF_SOURCE(in_reg_index, comp_x, comp_y, comp_z, comp_w, class, negate) \
- ( ((in_reg_index)<<R300_VPI_IN_REG_INDEX_SHIFT) \
- | ((comp_x)<<R300_VPI_IN_X_SHIFT) \
- | ((comp_y)<<R300_VPI_IN_Y_SHIFT) \
- | ((comp_z)<<R300_VPI_IN_Z_SHIFT) \
- | ((comp_w)<<R300_VPI_IN_W_SHIFT) \
- | ((negate)<<25) | ((class)))
-
-#define EASY_VSF_SOURCE(in_reg_index, comp_x, comp_y, comp_z, comp_w, class, negate) \
- MAKE_VSF_SOURCE(in_reg_index, \
- VSF_IN_COMPONENT_##comp_x, \
- VSF_IN_COMPONENT_##comp_y, \
- VSF_IN_COMPONENT_##comp_z, \
- VSF_IN_COMPONENT_##comp_w, \
- VSF_IN_CLASS_##class, VSF_FLAG_##negate)
-
-/* special sources: */
-
-/* (1.0,1.0,1.0,1.0) vector (ATTR, plain ) */
-#define VSF_ATTR_UNITY(reg) EASY_VSF_SOURCE(reg, ONE, ONE, ONE, ONE, ATTR, NONE)
-#define VSF_UNITY(reg) EASY_VSF_SOURCE(reg, ONE, ONE, ONE, ONE, NONE, NONE)
-
-/* contents of unmodified register */
-#define VSF_REG(reg) EASY_VSF_SOURCE(reg, X, Y, Z, W, ATTR, NONE)
-
-/* contents of unmodified parameter */
-#define VSF_PARAM(reg) EASY_VSF_SOURCE(reg, X, Y, Z, W, PARAM, NONE)
-
-/* contents of unmodified temporary register */
-#define VSF_TMP(reg) EASY_VSF_SOURCE(reg, X, Y, Z, W, TMP, NONE)
-
-/* components of ATTR register */
-#define VSF_ATTR_X(reg) EASY_VSF_SOURCE(reg, X, X, X, X, ATTR, NONE)
-#define VSF_ATTR_Y(reg) EASY_VSF_SOURCE(reg, Y, Y, Y, Y, ATTR, NONE)
-#define VSF_ATTR_Z(reg) EASY_VSF_SOURCE(reg, Z, Z, Z, Z, ATTR, NONE)
-#define VSF_ATTR_W(reg) EASY_VSF_SOURCE(reg, W, W, W, W, ATTR, NONE)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/Makefile
deleted file mode 100644
index b0ef17299..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# src/mesa/drivers/dri/radeon/Makefile
-# Note, this Makefile requires GNU make
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = radeon_dri.so
-
-MINIGLX_SOURCES = server/radeon_dri.c
-
-DRIVER_SOURCES = \
- radeon_context.c \
- radeon_ioctl.c \
- radeon_lock.c \
- radeon_screen.c \
- radeon_state.c \
- radeon_state_init.c \
- radeon_tex.c \
- radeon_texmem.c \
- radeon_texstate.c \
- radeon_tcl.c \
- radeon_swtcl.c \
- radeon_span.c \
- radeon_maos.c \
- radeon_sanity.c \
- radeon_compat.c \
- radeon_vtxfmt.c \
- radeon_vtxfmt_c.c \
- radeon_vtxfmt_sse.c \
- radeon_vtxfmt_x86.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-
-X86_SOURCES = \
- radeon_vtxtmp_x86.S
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_compat.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_compat.c
deleted file mode 100644
index 1cbe3407b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_compat.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* $XFree86$ */
-/**************************************************************************
-
-Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Austin, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#include "glheader.h"
-#include "imports.h"
-
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-
-
-static struct {
- int start;
- int len;
- const char *name;
-} packet[RADEON_MAX_STATE_PACKETS] = {
- { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
- { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
- { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
- { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
- { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
- { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
- { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
- { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
- { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
- { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
- { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
- { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
- { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
- { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
- { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
- { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
- { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
- { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
- { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
- { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
-};
-
-
-static void radeonCompatEmitPacket( radeonContextPtr rmesa,
- struct radeon_state_atom *state )
-{
- drm_radeon_sarea_t *sarea = rmesa->sarea;
- drm_radeon_context_regs_t *ctx = &sarea->context_state;
- drm_radeon_texture_regs_t *tex0 = &sarea->tex_state[0];
- drm_radeon_texture_regs_t *tex1 = &sarea->tex_state[1];
- int i;
- int *buf = state->cmd;
-
- for ( i = 0 ; i < state->cmd_size ; ) {
- drm_radeon_cmd_header_t *header = (drm_radeon_cmd_header_t *)&buf[i++];
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d: %s\n", __FUNCTION__, header->packet.packet_id,
- packet[(int)header->packet.packet_id].name);
-
- switch (header->packet.packet_id) {
- case RADEON_EMIT_PP_MISC:
- ctx->pp_misc = buf[i++];
- ctx->pp_fog_color = buf[i++];
- ctx->re_solid_color = buf[i++];
- ctx->rb3d_blendcntl = buf[i++];
- ctx->rb3d_depthoffset = buf[i++];
- ctx->rb3d_depthpitch = buf[i++];
- ctx->rb3d_zstencilcntl = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_CONTEXT;
- break;
- case RADEON_EMIT_PP_CNTL:
- ctx->pp_cntl = buf[i++];
- ctx->rb3d_cntl = buf[i++];
- ctx->rb3d_coloroffset = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_CONTEXT;
- break;
- case RADEON_EMIT_RB3D_COLORPITCH:
- ctx->rb3d_colorpitch = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_CONTEXT;
- break;
- case RADEON_EMIT_RE_LINE_PATTERN:
- ctx->re_line_pattern = buf[i++];
- ctx->re_line_state = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_LINE;
- break;
- case RADEON_EMIT_SE_LINE_WIDTH:
- ctx->se_line_width = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_LINE;
- break;
- case RADEON_EMIT_PP_LUM_MATRIX:
- ctx->pp_lum_matrix = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_BUMPMAP;
- break;
- case RADEON_EMIT_PP_ROT_MATRIX_0:
- ctx->pp_rot_matrix_0 = buf[i++];
- ctx->pp_rot_matrix_1 = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_BUMPMAP;
- break;
- case RADEON_EMIT_RB3D_STENCILREFMASK:
- ctx->rb3d_stencilrefmask = buf[i++];
- ctx->rb3d_ropcntl = buf[i++];
- ctx->rb3d_planemask = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_MASKS;
- break;
- case RADEON_EMIT_SE_VPORT_XSCALE:
- ctx->se_vport_xscale = buf[i++];
- ctx->se_vport_xoffset = buf[i++];
- ctx->se_vport_yscale = buf[i++];
- ctx->se_vport_yoffset = buf[i++];
- ctx->se_vport_zscale = buf[i++];
- ctx->se_vport_zoffset = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_VIEWPORT;
- break;
- case RADEON_EMIT_SE_CNTL:
- ctx->se_cntl = buf[i++];
- ctx->se_coord_fmt = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_CONTEXT | RADEON_UPLOAD_VERTFMT;
- break;
- case RADEON_EMIT_SE_CNTL_STATUS:
- ctx->se_cntl_status = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_SETUP;
- break;
- case RADEON_EMIT_RE_MISC:
- ctx->re_misc = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_MISC;
- break;
- case RADEON_EMIT_PP_TXFILTER_0:
- tex0->pp_txfilter = buf[i++];
- tex0->pp_txformat = buf[i++];
- tex0->pp_txoffset = buf[i++];
- tex0->pp_txcblend = buf[i++];
- tex0->pp_txablend = buf[i++];
- tex0->pp_tfactor = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_TEX0;
- break;
- case RADEON_EMIT_PP_BORDER_COLOR_0:
- tex0->pp_border_color = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_TEX0;
- break;
- case RADEON_EMIT_PP_TXFILTER_1:
- tex1->pp_txfilter = buf[i++];
- tex1->pp_txformat = buf[i++];
- tex1->pp_txoffset = buf[i++];
- tex1->pp_txcblend = buf[i++];
- tex1->pp_txablend = buf[i++];
- tex1->pp_tfactor = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_TEX1;
- break;
- case RADEON_EMIT_PP_BORDER_COLOR_1:
- tex1->pp_border_color = buf[i++];
- sarea->dirty |= RADEON_UPLOAD_TEX1;
- break;
-
- case RADEON_EMIT_SE_ZBIAS_FACTOR:
- i++;
- i++;
- break;
-
- case RADEON_EMIT_PP_TXFILTER_2:
- case RADEON_EMIT_PP_BORDER_COLOR_2:
- case RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT:
- case RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED:
- default:
- /* These states aren't understood by radeon drm 1.1 */
- fprintf(stderr, "Tried to emit unsupported state\n");
- return;
- }
- }
-}
-
-
-
-static void radeonCompatEmitStateLocked( radeonContextPtr rmesa )
-{
- struct radeon_state_atom *atom;
-
- if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!rmesa->hw.is_dirty && !rmesa->hw.all_dirty)
- return;
-
- foreach(atom, &rmesa->hw.atomlist) {
- if (rmesa->hw.all_dirty)
- atom->dirty = GL_TRUE;
- if (atom->is_tcl)
- atom->dirty = GL_FALSE;
- if (atom->dirty)
- radeonCompatEmitPacket(rmesa, atom);
- }
-
- rmesa->hw.is_dirty = GL_FALSE;
- rmesa->hw.all_dirty = GL_FALSE;
-}
-
-
-static void radeonCompatEmitPrimitiveLocked( radeonContextPtr rmesa,
- GLuint hw_primitive,
- GLuint nverts,
- drm_clip_rect_t *pbox,
- GLuint nbox )
-{
- int i;
-
- for ( i = 0 ; i < nbox ; ) {
- int nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, nbox );
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- drm_radeon_vertex_t vtx;
-
- rmesa->sarea->dirty |= RADEON_UPLOAD_CLIPRECTS;
- rmesa->sarea->nbox = nr - i;
-
- for ( ; i < nr ; i++)
- *b++ = pbox[i];
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr,
- "RadeonFlushVertexBuffer: prim %x buf %d verts %d "
- "disc %d nbox %d\n",
- hw_primitive,
- rmesa->dma.current.buf->buf->idx,
- nverts,
- nr == nbox,
- rmesa->sarea->nbox );
-
- vtx.prim = hw_primitive;
- vtx.idx = rmesa->dma.current.buf->buf->idx;
- vtx.count = nverts;
- vtx.discard = (nr == nbox);
-
- drmCommandWrite( rmesa->dri.fd,
- DRM_RADEON_VERTEX,
- &vtx, sizeof(vtx));
- }
-}
-
-
-
-/* No 'start' for 1.1 vertices ioctl: only one vertex prim/buffer!
- */
-void radeonCompatEmitPrimitive( radeonContextPtr rmesa,
- GLuint vertex_format,
- GLuint hw_primitive,
- GLuint nrverts )
-{
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- LOCK_HARDWARE( rmesa );
-
- radeonCompatEmitStateLocked( rmesa );
- rmesa->sarea->vc_format = vertex_format;
-
- if (rmesa->state.scissor.enabled) {
- radeonCompatEmitPrimitiveLocked( rmesa,
- hw_primitive,
- nrverts,
- rmesa->state.scissor.pClipRects,
- rmesa->state.scissor.numClipRects );
- }
- else {
- radeonCompatEmitPrimitiveLocked( rmesa,
- hw_primitive,
- nrverts,
- rmesa->pClipRects,
- rmesa->numClipRects );
- }
-
-
- UNLOCK_HARDWARE( rmesa );
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.c
deleted file mode 100644
index c96f38e0a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.c
+++ /dev/null
@@ -1,630 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v 1.9 2003/09/24 02:43:12 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "framebuffer.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_span.h"
-#include "radeon_tex.h"
-#include "radeon_swtcl.h"
-#include "radeon_tcl.h"
-#include "radeon_vtxfmt.h"
-#include "radeon_maos.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_secondary_color
-#include "extension_helper.h"
-
-#define DRIVER_DATE "20050528"
-
-#include "vblank.h"
-#include "utils.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
-#ifndef RADEON_DEBUG
-int RADEON_DEBUG = (0);
-#endif
-
-
-/* Return the width and height of the given buffer.
- */
-static void radeonGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- LOCK_HARDWARE( rmesa );
- *width = rmesa->dri.drawable->w;
- *height = rmesa->dri.drawable->h;
- UNLOCK_HARDWARE( rmesa );
-}
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- static char buffer[128];
- unsigned offset;
- GLuint agp_mode = rmesa->radeonScreen->IsPCI ? 0 :
- rmesa->radeonScreen->AGPMode;
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *)"Tungsten Graphics, Inc.";
-
- case GL_RENDERER:
- offset = driGetRendererString( buffer, "Radeon", DRIVER_DATE,
- agp_mode );
-
- sprintf( & buffer[ offset ], " %sTCL",
- !(rmesa->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE)
- ? "" : "NO-" );
-
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-
-/* Extension strings exported by the R100 driver.
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_ARB_texture_env_crossbar", NULL },
- { "GL_ARB_texture_env_dot3", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_EXT_blend_logic_op", NULL },
- { "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_EXT_texture_env_combine", NULL },
- { "GL_EXT_texture_env_dot3", NULL },
- { "GL_EXT_texture_filter_anisotropic", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_EXT_texture_mirror_clamp", NULL },
- { "GL_ATI_texture_env_combine3", NULL },
- { "GL_ATI_texture_mirror_once", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-extern const struct tnl_pipeline_stage _radeon_texrect_stage;
-extern const struct tnl_pipeline_stage _radeon_render_stage;
-extern const struct tnl_pipeline_stage _radeon_tcl_stage;
-
-static const struct tnl_pipeline_stage *radeon_pipeline[] = {
-
- /* Try and go straight to t&l
- */
- &_radeon_tcl_stage,
-
- /* Catch any t&l fallbacks
- */
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
-
- /* Scale texture rectangle to 0..1.
- */
- &_radeon_texrect_stage,
-
- &_radeon_render_stage,
- &_tnl_render_stage, /* FALLBACK: */
- NULL,
-};
-
-
-
-/* Initialize the driver's misc functions.
- */
-static void radeonInitDriverFuncs( struct dd_function_table *functions )
-{
- functions->GetBufferSize = radeonGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = radeonGetString;
-}
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "tex", DEBUG_TEXTURE },
- { "ioctl", DEBUG_IOCTL },
- { "prim", DEBUG_PRIMS },
- { "vert", DEBUG_VERTS },
- { "state", DEBUG_STATE },
- { "code", DEBUG_CODEGEN },
- { "vfmt", DEBUG_VFMT },
- { "vtxf", DEBUG_VFMT },
- { "verb", DEBUG_VERBOSE },
- { "dri", DEBUG_DRI },
- { "dma", DEBUG_DMA },
- { "san", DEBUG_SANITY },
- { "sync", DEBUG_SYNC },
- { NULL, 0 }
-};
-
-
-/* Create the device specific context.
- */
-GLboolean
-radeonCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- radeonScreenPtr screen = (radeonScreenPtr)(sPriv->private);
- struct dd_function_table functions;
- radeonContextPtr rmesa;
- GLcontext *ctx, *shareCtx;
- int i;
- int tcl_mode, fthrottle_mode;
-
- assert(glVisual);
- assert(driContextPriv);
- assert(screen);
-
- /* Allocate the Radeon context */
- rmesa = (radeonContextPtr) CALLOC( sizeof(*rmesa) );
- if ( !rmesa )
- return GL_FALSE;
-
- /* Parse configuration files.
- * Do this here so that initialMaxAnisotropy is set before we create
- * the default textures.
- */
- driParseConfigFiles (&rmesa->optionCache, &screen->optionCache,
- screen->driScreen->myNum, "radeon");
- rmesa->initialMaxAnisotropy = driQueryOptionf(&rmesa->optionCache,
- "def_max_anisotropy");
-
- if ( driQueryOptionb( &rmesa->optionCache, "hyperz" ) ) {
- if ( sPriv->drmMinor < 13 )
- fprintf( stderr, "DRM version 1.%d too old to support HyperZ, "
- "disabling.\n",sPriv->drmMinor );
- else
- rmesa->using_hyperz = GL_TRUE;
- }
-
- if ( sPriv->drmMinor >= 15 )
- rmesa->texmicrotile = GL_TRUE;
-
- /* Init default driver functions then plug in our Radeon-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions( &functions );
- radeonInitDriverFuncs( &functions );
- radeonInitTextureFuncs( &functions );
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((radeonContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- rmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *) rmesa);
- if (!rmesa->glCtx) {
- FREE(rmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = rmesa;
-
- /* Init radeon context data */
- rmesa->dri.context = driContextPriv;
- rmesa->dri.screen = sPriv;
- rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
- rmesa->dri.hwContext = driContextPriv->hHWContext;
- rmesa->dri.hwLock = &sPriv->pSAREA->lock;
- rmesa->dri.fd = sPriv->fd;
- rmesa->dri.drmMinor = sPriv->drmMinor;
-
- rmesa->radeonScreen = screen;
- rmesa->sarea = (drm_radeon_sarea_t *)((GLubyte *)sPriv->pSAREA +
- screen->sarea_priv_offset);
-
-
- rmesa->dma.buf0_address = rmesa->radeonScreen->buffers->list[0].address;
-
- (void) memset( rmesa->texture_heaps, 0, sizeof( rmesa->texture_heaps ) );
- make_empty_list( & rmesa->swapped );
-
- rmesa->nr_heaps = screen->numTexHeaps;
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- rmesa->texture_heaps[i] = driCreateTextureHeap( i, rmesa,
- screen->texSize[i],
- 12,
- RADEON_NR_TEX_REGIONS,
- (drmTextureRegionPtr)rmesa->sarea->tex_list[i],
- & rmesa->sarea->tex_age[i],
- & rmesa->swapped,
- sizeof( radeonTexObj ),
- (destroy_texture_object_t *) radeonDestroyTexObj );
-
- driSetTextureSwapCounterLocation( rmesa->texture_heaps[i],
- & rmesa->c_textureSwaps );
- }
- rmesa->texture_depth = driQueryOptioni (&rmesa->optionCache,
- "texture_depth");
- if (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
- rmesa->texture_depth = ( screen->cpp == 4 ) ?
- DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
- rmesa->swtcl.RenderIndex = ~0;
- rmesa->hw.all_dirty = GL_TRUE;
-
- /* Set the maximum texture size small enough that we can guarentee that
- * all texture units can bind a maximal texture and have them both in
- * texturable memory at once.
- */
-
- ctx = rmesa->glCtx;
- ctx->Const.MaxTextureUnits = 2;
- ctx->Const.MaxTextureImageUnits = 2;
- ctx->Const.MaxTextureCoordUnits = 2;
-
- driCalculateMaxTextureLevels( rmesa->texture_heaps,
- rmesa->nr_heaps,
- & ctx->Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 0, /* 3D textures unsupported. */
- 0, /* cube textures unsupported. */
- 11, /* max rect texture size is 2048x2048. */
- 12,
- GL_FALSE );
-
- /* adjust max texture size a bit. Hack, but I really want to use larger textures
- which will work just fine in 99.999999% of all cases, especially with texture compression... */
- if (driQueryOptionb( &rmesa->optionCache, "texture_level_hack" ))
- {
- if (ctx->Const.MaxTextureLevels < 12) ctx->Const.MaxTextureLevels += 1;
- }
-
- ctx->Const.MaxTextureMaxAnisotropy = 16.0;
-
- /* No wide points.
- */
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 10.0;
- ctx->Const.MaxLineWidthAA = 10.0;
- ctx->Const.LineWidthGranularity = 0.0625;
-
- /* Set maxlocksize (and hence vb size) small enough to avoid
- * fallbacks in radeon_tcl.c. ie. guarentee that all vertices can
- * fit in a single dma buffer for indexed rendering of quad strips,
- * etc.
- */
- ctx->Const.MaxArrayLockSize =
- MIN2( ctx->Const.MaxArrayLockSize,
- RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE );
-
- rmesa->boxes = 0;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
- _ae_create_context( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, radeon_pipeline );
- ctx->Driver.FlushVertices = radeonFlushVertices;
-
- /* Try and keep materials and vertices separate:
- */
- _tnl_isolate_materials( ctx, GL_TRUE );
-
-/* _mesa_allow_light_in_model( ctx, GL_FALSE ); */
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
-
-
- _math_matrix_ctr( &rmesa->TexGenMatrix[0] );
- _math_matrix_ctr( &rmesa->TexGenMatrix[1] );
- _math_matrix_ctr( &rmesa->tmpmat );
- _math_matrix_set_identity( &rmesa->TexGenMatrix[0] );
- _math_matrix_set_identity( &rmesa->TexGenMatrix[1] );
- _math_matrix_set_identity( &rmesa->tmpmat );
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
- if (rmesa->glCtx->Mesa_DXTn) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- _mesa_enable_extension( ctx, "GL_S3_s3tc" );
- }
- else if (driQueryOptionb (&rmesa->optionCache, "force_s3tc_enable")) {
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- }
-
- if (rmesa->dri.drmMinor >= 9)
- _mesa_enable_extension( ctx, "GL_NV_texture_rectangle");
-
- /* XXX these should really go right after _mesa_init_driver_functions() */
- radeonInitIoctlFuncs( ctx );
- radeonInitStateFuncs( ctx );
- radeonInitSpanFuncs( ctx );
- radeonInitState( rmesa );
- radeonInitSwtcl( ctx );
-
- _mesa_vector4f_alloc( &rmesa->tcl.ObjClean, 0,
- ctx->Const.MaxArrayLockSize, 32 );
-
- fthrottle_mode = driQueryOptioni(&rmesa->optionCache, "fthrottle_mode");
- rmesa->iw.irq_seq = -1;
- rmesa->irqsEmitted = 0;
- rmesa->do_irqs = (rmesa->radeonScreen->irq != 0 &&
- fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS);
-
- rmesa->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
-
- rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0)
- ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
- (*dri_interface->getUST)( & rmesa->swap_ust );
-
-
-#if DO_DEBUG
- RADEON_DEBUG = driParseDebugString( getenv( "RADEON_DEBUG" ),
- debug_control );
-#endif
-
- tcl_mode = driQueryOptioni(&rmesa->optionCache, "tcl_mode");
- if (driQueryOptionb(&rmesa->optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
- FALLBACK(rmesa, RADEON_FALLBACK_DISABLE, 1);
- } else if (tcl_mode == DRI_CONF_TCL_SW ||
- !(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
- if (rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL) {
- rmesa->radeonScreen->chipset &= ~RADEON_CHIPSET_TCL;
- fprintf(stderr, "Disabling HW TCL support\n");
- }
- TCL_FALLBACK(rmesa->glCtx, RADEON_TCL_FALLBACK_TCL_DISABLE, 1);
- }
-
- if (rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL) {
- if (tcl_mode >= DRI_CONF_TCL_VTXFMT)
- radeonVtxfmtInit( ctx, tcl_mode >= DRI_CONF_TCL_CODEGEN );
-
- _tnl_need_dlist_norm_lengths( ctx, GL_FALSE );
- }
- return GL_TRUE;
-}
-
-
-/* Destroy the device specific context.
- */
-/* Destroy the Mesa and driver specific context data.
- */
-void radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = (radeonContextPtr) driContextPriv->driverPrivate;
- radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL;
-
- /* check if we're deleting the currently bound context */
- if (rmesa == current) {
- RADEON_FIREVERTICES( rmesa );
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- /* Free radeon context resources */
- assert(rmesa); /* should never be null */
- if ( rmesa ) {
- GLboolean release_texture_heaps;
-
-
- release_texture_heaps = (rmesa->glCtx->Shared->RefCount == 1);
- _swsetup_DestroyContext( rmesa->glCtx );
- _tnl_DestroyContext( rmesa->glCtx );
- _ac_DestroyContext( rmesa->glCtx );
- _swrast_DestroyContext( rmesa->glCtx );
-
- radeonDestroySwtcl( rmesa->glCtx );
- radeonReleaseArrays( rmesa->glCtx, ~0 );
- if (rmesa->dma.current.buf) {
- radeonReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
- radeonFlushCmdBuf( rmesa, __FUNCTION__ );
- }
-
- if (!(rmesa->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE)) {
- int tcl_mode = driQueryOptioni(&rmesa->optionCache, "tcl_mode");
- if (tcl_mode >= DRI_CONF_TCL_VTXFMT)
- radeonVtxfmtDestroy( rmesa->glCtx );
- }
-
- /* free the Mesa context */
- rmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context( rmesa->glCtx );
-
- _mesa_vector4f_free( &rmesa->tcl.ObjClean );
-
- if (rmesa->state.scissor.pClipRects) {
- FREE(rmesa->state.scissor.pClipRects);
- rmesa->state.scissor.pClipRects = NULL;
- }
-
- if ( release_texture_heaps ) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- int i;
-
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- driDestroyTextureHeap( rmesa->texture_heaps[ i ] );
- rmesa->texture_heaps[ i ] = NULL;
- }
-
- assert( is_empty_list( & rmesa->swapped ) );
- }
-
- /* free the option cache */
- driDestroyOptionCache (&rmesa->optionCache);
-
- FREE( rmesa );
- }
-}
-
-
-
-
-void
-radeonSwapBuffers( __DRIdrawablePrivate *dPriv )
-{
-
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- radeonContextPtr rmesa;
- GLcontext *ctx;
- rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = rmesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
-
- if ( rmesa->doPageFlip ) {
- radeonPageFlip( dPriv );
- }
- else {
- radeonCopyBuffer( dPriv );
- }
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__);
- }
-}
-
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-GLboolean
-radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( driContextPriv ) {
- radeonContextPtr newCtx =
- (radeonContextPtr) driContextPriv->driverPrivate;
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *) newCtx->glCtx);
-
- if ( newCtx->dri.drawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags );
- newCtx->dri.drawable = driDrawPriv;
- radeonUpdateWindow( newCtx->glCtx );
- radeonUpdateViewportOffset( newCtx->glCtx );
- }
-
- _mesa_make_current( newCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- if (newCtx->vb.enabled)
- radeonVtxfmtMakeCurrent( newCtx->glCtx );
-
- } else {
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "End %s\n", __FUNCTION__);
- return GL_TRUE;
-}
-
-/* Force the context `c' to be unbound from its buffer.
- */
-GLboolean
-radeonUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- radeonContextPtr rmesa = (radeonContextPtr) driContextPriv->driverPrivate;
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *) rmesa->glCtx);
-
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.h
deleted file mode 100644
index 621a4c655..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_context.h
+++ /dev/null
@@ -1,868 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.h,v 1.6 2002/12/16 16:18:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_CONTEXT_H__
-#define __RADEON_CONTEXT_H__
-
-#include "tnl/t_vertex.h"
-#include "dri_util.h"
-#include "drm.h"
-#include "radeon_drm.h"
-#include "texmem.h"
-
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-
-struct radeon_context;
-typedef struct radeon_context radeonContextRec;
-typedef struct radeon_context *radeonContextPtr;
-
-#include "radeon_lock.h"
-#include "radeon_screen.h"
-#include "mm.h"
-
-#include "math/m_vector.h"
-
-/* Flags for software fallback cases */
-/* See correponding strings in radeon_swtcl.c */
-#define RADEON_FALLBACK_TEXTURE 0x0001
-#define RADEON_FALLBACK_DRAW_BUFFER 0x0002
-#define RADEON_FALLBACK_STENCIL 0x0004
-#define RADEON_FALLBACK_RENDER_MODE 0x0008
-#define RADEON_FALLBACK_BLEND_EQ 0x0010
-#define RADEON_FALLBACK_BLEND_FUNC 0x0020
-#define RADEON_FALLBACK_DISABLE 0x0040
-#define RADEON_FALLBACK_BORDER_MODE 0x0080
-
-/* The blit width for texture uploads
- */
-#define BLIT_WIDTH_BYTES 1024
-
-/* Use the templated vertex format:
- */
-#define COLOR_IS_RGBA
-#define TAG(x) radeon##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*radeon_tri_func)( radeonContextPtr,
- radeonVertex *,
- radeonVertex *,
- radeonVertex * );
-
-typedef void (*radeon_line_func)( radeonContextPtr,
- radeonVertex *,
- radeonVertex * );
-
-typedef void (*radeon_point_func)( radeonContextPtr,
- radeonVertex * );
-
-
-struct radeon_colorbuffer_state {
- GLuint clear;
- GLint drawOffset, drawPitch;
- int roundEnable;
-};
-
-
-struct radeon_depthbuffer_state {
- GLuint clear;
- GLfloat scale;
-};
-
-struct radeon_pixel_state {
- GLint readOffset, readPitch;
-};
-
-struct radeon_scissor_state {
- drm_clip_rect_t rect;
- GLboolean enabled;
-
- GLuint numClipRects; /* Cliprects active */
- GLuint numAllocedClipRects; /* Cliprects available */
- drm_clip_rect_t *pClipRects;
-};
-
-struct radeon_stencilbuffer_state {
- GLboolean hwBuffer;
- GLuint clear; /* rb3d_stencilrefmask value */
-};
-
-struct radeon_stipple_state {
- GLuint mask[32];
-};
-
-
-
-#define TEX_0 0x1
-#define TEX_1 0x2
-#define TEX_ALL 0x3
-
-typedef struct radeon_tex_obj radeonTexObj, *radeonTexObjPtr;
-
-/* Texture object in locally shared texture space.
- */
-struct radeon_tex_obj {
- driTextureObject base;
-
- GLuint bufAddr; /* Offset to start of locally
- shared texture block */
-
- GLuint dirty_state; /* Flags (1 per texunit) for
- whether or not this texobj
- has dirty hardware state
- (pp_*) that needs to be
- brought into the
- texunit. */
-
- drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
- /* Six, for the cube faces */
-
- GLuint pp_txfilter; /* hardware register values */
- GLuint pp_txformat;
- GLuint pp_txoffset; /* Image location in texmem.
- All cube faces follow. */
- GLuint pp_txsize; /* npot only */
- GLuint pp_txpitch; /* npot only */
- GLuint pp_border_color;
- GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
-
- GLboolean border_fallback;
-
- GLuint tile_bits; /* hw texture tile bits used on this texture */
-};
-
-
-struct radeon_texture_env_state {
- radeonTexObjPtr texobj;
- GLenum format;
- GLenum envMode;
-};
-
-struct radeon_texture_state {
- struct radeon_texture_env_state unit[RADEON_MAX_TEXTURE_UNITS];
-};
-
-
-struct radeon_state_atom {
- struct radeon_state_atom *next, *prev;
- const char *name; /* for debug */
- int cmd_size; /* size in bytes */
- GLuint is_tcl;
- int *cmd; /* one or more cmd's */
- int *lastcmd; /* one or more cmd's */
- GLboolean dirty; /* dirty-mark in emit_state_list */
- GLboolean (*check)( GLcontext * ); /* is this state active? */
-};
-
-
-
-/* Trying to keep these relatively short as the variables are becoming
- * extravagently long. Drop the driver name prefix off the front of
- * everything - I think we know which driver we're in by now, and keep the
- * prefix to 3 letters unless absolutely impossible.
- */
-
-#define CTX_CMD_0 0
-#define CTX_PP_MISC 1
-#define CTX_PP_FOG_COLOR 2
-#define CTX_RE_SOLID_COLOR 3
-#define CTX_RB3D_BLENDCNTL 4
-#define CTX_RB3D_DEPTHOFFSET 5
-#define CTX_RB3D_DEPTHPITCH 6
-#define CTX_RB3D_ZSTENCILCNTL 7
-#define CTX_CMD_1 8
-#define CTX_PP_CNTL 9
-#define CTX_RB3D_CNTL 10
-#define CTX_RB3D_COLOROFFSET 11
-#define CTX_CMD_2 12
-#define CTX_RB3D_COLORPITCH 13
-#define CTX_STATE_SIZE 14
-
-#define SET_CMD_0 0
-#define SET_SE_CNTL 1
-#define SET_SE_COORDFMT 2
-#define SET_CMD_1 3
-#define SET_SE_CNTL_STATUS 4
-#define SET_STATE_SIZE 5
-
-#define LIN_CMD_0 0
-#define LIN_RE_LINE_PATTERN 1
-#define LIN_RE_LINE_STATE 2
-#define LIN_CMD_1 3
-#define LIN_SE_LINE_WIDTH 4
-#define LIN_STATE_SIZE 5
-
-#define MSK_CMD_0 0
-#define MSK_RB3D_STENCILREFMASK 1
-#define MSK_RB3D_ROPCNTL 2
-#define MSK_RB3D_PLANEMASK 3
-#define MSK_STATE_SIZE 4
-
-#define VPT_CMD_0 0
-#define VPT_SE_VPORT_XSCALE 1
-#define VPT_SE_VPORT_XOFFSET 2
-#define VPT_SE_VPORT_YSCALE 3
-#define VPT_SE_VPORT_YOFFSET 4
-#define VPT_SE_VPORT_ZSCALE 5
-#define VPT_SE_VPORT_ZOFFSET 6
-#define VPT_STATE_SIZE 7
-
-#define MSC_CMD_0 0
-#define MSC_RE_MISC 1
-#define MSC_STATE_SIZE 2
-
-#define TEX_CMD_0 0
-#define TEX_PP_TXFILTER 1
-#define TEX_PP_TXFORMAT 2
-#define TEX_PP_TXOFFSET 3
-#define TEX_PP_TXCBLEND 4
-#define TEX_PP_TXABLEND 5
-#define TEX_PP_TFACTOR 6
-#define TEX_CMD_1 7
-#define TEX_PP_BORDER_COLOR 8
-#define TEX_STATE_SIZE 9
-
-#define TXR_CMD_0 0 /* rectangle textures */
-#define TXR_PP_TEX_SIZE 1 /* 0x1d04, 0x1d0c for NPOT! */
-#define TXR_PP_TEX_PITCH 2 /* 0x1d08, 0x1d10 for NPOT! */
-#define TXR_STATE_SIZE 3
-
-#define ZBS_CMD_0 0
-#define ZBS_SE_ZBIAS_FACTOR 1
-#define ZBS_SE_ZBIAS_CONSTANT 2
-#define ZBS_STATE_SIZE 3
-
-#define TCL_CMD_0 0
-#define TCL_OUTPUT_VTXFMT 1
-#define TCL_OUTPUT_VTXSEL 2
-#define TCL_MATRIX_SELECT_0 3
-#define TCL_MATRIX_SELECT_1 4
-#define TCL_UCP_VERT_BLEND_CTL 5
-#define TCL_TEXTURE_PROC_CTL 6
-#define TCL_LIGHT_MODEL_CTL 7
-#define TCL_PER_LIGHT_CTL_0 8
-#define TCL_PER_LIGHT_CTL_1 9
-#define TCL_PER_LIGHT_CTL_2 10
-#define TCL_PER_LIGHT_CTL_3 11
-#define TCL_STATE_SIZE 12
-
-#define MTL_CMD_0 0
-#define MTL_EMMISSIVE_RED 1
-#define MTL_EMMISSIVE_GREEN 2
-#define MTL_EMMISSIVE_BLUE 3
-#define MTL_EMMISSIVE_ALPHA 4
-#define MTL_AMBIENT_RED 5
-#define MTL_AMBIENT_GREEN 6
-#define MTL_AMBIENT_BLUE 7
-#define MTL_AMBIENT_ALPHA 8
-#define MTL_DIFFUSE_RED 9
-#define MTL_DIFFUSE_GREEN 10
-#define MTL_DIFFUSE_BLUE 11
-#define MTL_DIFFUSE_ALPHA 12
-#define MTL_SPECULAR_RED 13
-#define MTL_SPECULAR_GREEN 14
-#define MTL_SPECULAR_BLUE 15
-#define MTL_SPECULAR_ALPHA 16
-#define MTL_SHININESS 17
-#define MTL_STATE_SIZE 18
-
-#define VTX_CMD_0 0
-#define VTX_SE_COORD_FMT 1
-#define VTX_STATE_SIZE 2
-
-#define MAT_CMD_0 0
-#define MAT_ELT_0 1
-#define MAT_STATE_SIZE 17
-
-#define GRD_CMD_0 0
-#define GRD_VERT_GUARD_CLIP_ADJ 1
-#define GRD_VERT_GUARD_DISCARD_ADJ 2
-#define GRD_HORZ_GUARD_CLIP_ADJ 3
-#define GRD_HORZ_GUARD_DISCARD_ADJ 4
-#define GRD_STATE_SIZE 5
-
-/* position changes frequently when lighting in modelpos - separate
- * out to new state item?
- */
-#define LIT_CMD_0 0
-#define LIT_AMBIENT_RED 1
-#define LIT_AMBIENT_GREEN 2
-#define LIT_AMBIENT_BLUE 3
-#define LIT_AMBIENT_ALPHA 4
-#define LIT_DIFFUSE_RED 5
-#define LIT_DIFFUSE_GREEN 6
-#define LIT_DIFFUSE_BLUE 7
-#define LIT_DIFFUSE_ALPHA 8
-#define LIT_SPECULAR_RED 9
-#define LIT_SPECULAR_GREEN 10
-#define LIT_SPECULAR_BLUE 11
-#define LIT_SPECULAR_ALPHA 12
-#define LIT_POSITION_X 13
-#define LIT_POSITION_Y 14
-#define LIT_POSITION_Z 15
-#define LIT_POSITION_W 16
-#define LIT_DIRECTION_X 17
-#define LIT_DIRECTION_Y 18
-#define LIT_DIRECTION_Z 19
-#define LIT_DIRECTION_W 20
-#define LIT_ATTEN_QUADRATIC 21
-#define LIT_ATTEN_LINEAR 22
-#define LIT_ATTEN_CONST 23
-#define LIT_ATTEN_XXX 24
-#define LIT_CMD_1 25
-#define LIT_SPOT_DCD 26
-#define LIT_SPOT_EXPONENT 27
-#define LIT_SPOT_CUTOFF 28
-#define LIT_SPECULAR_THRESH 29
-#define LIT_RANGE_CUTOFF 30 /* ? */
-#define LIT_ATTEN_CONST_INV 31
-#define LIT_STATE_SIZE 32
-
-/* Fog
- */
-#define FOG_CMD_0 0
-#define FOG_R 1
-#define FOG_C 2
-#define FOG_D 3
-#define FOG_PAD 4
-#define FOG_STATE_SIZE 5
-
-/* UCP
- */
-#define UCP_CMD_0 0
-#define UCP_X 1
-#define UCP_Y 2
-#define UCP_Z 3
-#define UCP_W 4
-#define UCP_STATE_SIZE 5
-
-/* GLT - Global ambient
- */
-#define GLT_CMD_0 0
-#define GLT_RED 1
-#define GLT_GREEN 2
-#define GLT_BLUE 3
-#define GLT_ALPHA 4
-#define GLT_STATE_SIZE 5
-
-/* EYE
- */
-#define EYE_CMD_0 0
-#define EYE_X 1
-#define EYE_Y 2
-#define EYE_Z 3
-#define EYE_RESCALE_FACTOR 4
-#define EYE_STATE_SIZE 5
-
-#define SHN_CMD_0 0
-#define SHN_SHININESS 1
-#define SHN_STATE_SIZE 2
-
-
-
-
-
-struct radeon_hw_state {
- /* Head of the linked list of state atoms. */
- struct radeon_state_atom atomlist;
-
- /* Hardware state, stored as cmdbuf commands:
- * -- Need to doublebuffer for
- * - eliding noop statechange loops? (except line stipple count)
- */
- struct radeon_state_atom ctx;
- struct radeon_state_atom set;
- struct radeon_state_atom lin;
- struct radeon_state_atom msk;
- struct radeon_state_atom vpt;
- struct radeon_state_atom tcl;
- struct radeon_state_atom msc;
- struct radeon_state_atom tex[2];
- struct radeon_state_atom zbs;
- struct radeon_state_atom mtl;
- struct radeon_state_atom mat[5];
- struct radeon_state_atom lit[8]; /* includes vec, scl commands */
- struct radeon_state_atom ucp[6];
- struct radeon_state_atom eye; /* eye pos */
- struct radeon_state_atom grd; /* guard band clipping */
- struct radeon_state_atom fog;
- struct radeon_state_atom glt;
- struct radeon_state_atom txr[2]; /* for NPOT */
-
- int max_state_size; /* Number of bytes necessary for a full state emit. */
- GLboolean is_dirty, all_dirty;
-};
-
-struct radeon_state {
- /* Derived state for internal purposes:
- */
- struct radeon_colorbuffer_state color;
- struct radeon_depthbuffer_state depth;
- struct radeon_pixel_state pixel;
- struct radeon_scissor_state scissor;
- struct radeon_stencilbuffer_state stencil;
- struct radeon_stipple_state stipple;
- struct radeon_texture_state texture;
-};
-
-
-/* Need refcounting on dma buffers:
- */
-struct radeon_dma_buffer {
- int refcount; /* the number of retained regions in buf */
- drmBufPtr buf;
-};
-
-#define GET_START(rvb) (rmesa->radeonScreen->gart_buffer_offset + \
- (rvb)->address - rmesa->dma.buf0_address + \
- (rvb)->start)
-
-/* A retained region, eg vertices for indexed vertices.
- */
-struct radeon_dma_region {
- struct radeon_dma_buffer *buf;
- char *address; /* == buf->address */
- int start, end, ptr; /* offsets from start of buf */
- int aos_start;
- int aos_stride;
- int aos_size;
-};
-
-
-struct radeon_dma {
- /* Active dma region. Allocations for vertices and retained
- * regions come from here. Also used for emitting random vertices,
- * these may be flushed by calling flush_current();
- */
- struct radeon_dma_region current;
-
- void (*flush)( radeonContextPtr );
-
- char *buf0_address; /* start of buf[0], for index calcs */
- GLuint nr_released_bufs; /* flush after so many buffers released */
-};
-
-struct radeon_dri_mirror {
- __DRIcontextPrivate *context; /* DRI context */
- __DRIscreenPrivate *screen; /* DRI screen */
- __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
-
- drm_context_t hwContext;
- drm_hw_lock_t *hwLock;
- int fd;
- int drmMinor;
-};
-
-
-#define RADEON_CMD_BUF_SZ (8*1024)
-
-struct radeon_store {
- GLuint statenr;
- GLuint primnr;
- char cmd_buf[RADEON_CMD_BUF_SZ];
- int cmd_used;
- int elts_start;
-};
-
-
-/* radeon_tcl.c
- */
-struct radeon_tcl_info {
- GLuint vertex_format;
- GLint last_offset;
- GLuint hw_primitive;
-
- /* Temporary for cases where incoming vertex data is incompatible
- * with maos code.
- */
- GLvector4f ObjClean;
-
- struct radeon_dma_region *aos_components[8];
- GLuint nr_aos_components;
-
- GLuint *Elts;
-
- struct radeon_dma_region indexed_verts;
- struct radeon_dma_region obj;
- struct radeon_dma_region rgba;
- struct radeon_dma_region spec;
- struct radeon_dma_region fog;
- struct radeon_dma_region tex[RADEON_MAX_TEXTURE_UNITS];
- struct radeon_dma_region norm;
-};
-
-
-/* radeon_swtcl.c
- */
-struct radeon_swtcl_info {
- GLuint RenderIndex;
- GLuint vertex_size;
- GLuint vertex_format;
-
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
-
- GLubyte *verts;
-
- /* Fallback rasterization functions
- */
- radeon_point_func draw_point;
- radeon_line_func draw_line;
- radeon_tri_func draw_tri;
-
- GLuint hw_primitive;
- GLenum render_primitive;
- GLuint numverts;
-
- /**
- * Offset of the 4UB color data within a hardware (swtcl) vertex.
- */
- GLuint coloroffset;
-
- /**
- * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
- */
- GLuint specoffset;
-
- GLboolean needproj;
-
- struct radeon_dma_region indexed_verts;
-};
-
-
-struct radeon_ioctl {
- GLuint vertex_offset;
- GLuint vertex_size;
-};
-
-
-
-#define RADEON_MAX_PRIMS 64
-
-
-/* Want to keep a cache of these around. Each is parameterized by
- * only a single value which has only a small range. Only expect a
- * few, so just rescan the list each time?
- */
-struct dynfn {
- struct dynfn *next, *prev;
- int key;
- char *code;
-};
-
-struct dfn_lists {
- struct dynfn Vertex2f;
- struct dynfn Vertex2fv;
- struct dynfn Vertex3f;
- struct dynfn Vertex3fv;
- struct dynfn Color4ub;
- struct dynfn Color4ubv;
- struct dynfn Color3ub;
- struct dynfn Color3ubv;
- struct dynfn Color4f;
- struct dynfn Color4fv;
- struct dynfn Color3f;
- struct dynfn Color3fv;
- struct dynfn SecondaryColor3ubEXT;
- struct dynfn SecondaryColor3ubvEXT;
- struct dynfn SecondaryColor3fEXT;
- struct dynfn SecondaryColor3fvEXT;
- struct dynfn Normal3f;
- struct dynfn Normal3fv;
- struct dynfn TexCoord2f;
- struct dynfn TexCoord2fv;
- struct dynfn TexCoord1f;
- struct dynfn TexCoord1fv;
- struct dynfn MultiTexCoord2fARB;
- struct dynfn MultiTexCoord2fvARB;
- struct dynfn MultiTexCoord1fARB;
- struct dynfn MultiTexCoord1fvARB;
-};
-
-struct dfn_generators {
- struct dynfn *(*Vertex2f)( GLcontext *, int );
- struct dynfn *(*Vertex2fv)( GLcontext *, int );
- struct dynfn *(*Vertex3f)( GLcontext *, int );
- struct dynfn *(*Vertex3fv)( GLcontext *, int );
- struct dynfn *(*Color4ub)( GLcontext *, int );
- struct dynfn *(*Color4ubv)( GLcontext *, int );
- struct dynfn *(*Color3ub)( GLcontext *, int );
- struct dynfn *(*Color3ubv)( GLcontext *, int );
- struct dynfn *(*Color4f)( GLcontext *, int );
- struct dynfn *(*Color4fv)( GLcontext *, int );
- struct dynfn *(*Color3f)( GLcontext *, int );
- struct dynfn *(*Color3fv)( GLcontext *, int );
- struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, int );
- struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, int );
- struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, int );
- struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, int );
- struct dynfn *(*Normal3f)( GLcontext *, int );
- struct dynfn *(*Normal3fv)( GLcontext *, int );
- struct dynfn *(*TexCoord2f)( GLcontext *, int );
- struct dynfn *(*TexCoord2fv)( GLcontext *, int );
- struct dynfn *(*TexCoord1f)( GLcontext *, int );
- struct dynfn *(*TexCoord1fv)( GLcontext *, int );
- struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, int );
- struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, int );
- struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, int );
- struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, int );
-};
-
-
-
-struct radeon_prim {
- GLuint start;
- GLuint end;
- GLuint prim;
-};
-
-struct radeon_vbinfo {
- GLint counter, initial_counter;
- GLint *dmaptr;
- void (*notify)( void );
- GLint vertex_size;
-
- /* A maximum total of 15 elements per vertex: 3 floats for position, 3
- * floats for normal, 4 floats for color, 4 bytes for secondary color,
- * 2 floats for each texture unit (4 floats total).
- *
- * As soon as the 3rd TMU is supported or cube maps (or 3D textures) are
- * supported, this value will grow.
- *
- * The position data is never actually stored here, so 3 elements could be
- * trimmed out of the buffer.
- */
- union { float f; int i; radeon_color_t color; } vertex[15];
-
- GLfloat *normalptr;
- GLfloat *floatcolorptr;
- radeon_color_t *colorptr;
- GLfloat *floatspecptr;
- radeon_color_t *specptr;
- GLfloat *texcoordptr[2];
-
- GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */
- GLuint primflags;
- GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */
- GLboolean installed;
- GLboolean fell_back;
- GLboolean recheck;
- GLint nrverts;
- GLuint vertex_format;
-
- GLuint installed_vertex_format;
- GLuint installed_color_3f_sz;
-
- struct radeon_prim primlist[RADEON_MAX_PRIMS];
- int nrprims;
-
- struct dfn_lists dfn_cache;
- struct dfn_generators codegen;
- GLvertexformat vtxfmt;
-};
-
-
-
-
-struct radeon_context {
- GLcontext *glCtx; /* Mesa context */
-
- /* Driver and hardware state management
- */
- struct radeon_hw_state hw;
- struct radeon_state state;
-
- /* Texture object bookkeeping
- */
- unsigned nr_heaps;
- driTexHeap * texture_heaps[ RADEON_NR_TEX_HEAPS ];
- driTextureObject swapped;
- int texture_depth;
- float initialMaxAnisotropy;
-
- /* Rasterization and vertex state:
- */
- GLuint TclFallback;
- GLuint Fallback;
- GLuint NewGLState;
- GLuint tnl_index; /* index of bits for last tnl_install_attrs */
-
- /* Vertex buffers
- */
- struct radeon_ioctl ioctl;
- struct radeon_dma dma;
- struct radeon_store store;
- /* A full state emit as of the first state emit in the main store, in case
- * the context is lost.
- */
- struct radeon_store backup_store;
-
- /* Page flipping
- */
- GLuint doPageFlip;
-
- /* Busy waiting
- */
- GLuint do_usleeps;
- GLuint do_irqs;
- GLuint irqsEmitted;
- drm_radeon_irq_wait_t iw;
-
- /* Drawable, cliprect and scissor information
- */
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
- unsigned int lastStamp;
- GLboolean lost_context;
- GLboolean save_on_next_emit;
- radeonScreenPtr radeonScreen; /* Screen private DRI data */
- drm_radeon_sarea_t *sarea; /* Private SAREA data */
-
- /* TCL stuff
- */
- GLmatrix TexGenMatrix[RADEON_MAX_TEXTURE_UNITS];
- GLboolean recheck_texgen[RADEON_MAX_TEXTURE_UNITS];
- GLboolean TexGenNeedNormals[RADEON_MAX_TEXTURE_UNITS];
- GLuint TexMatEnabled;
- GLuint TexGenEnabled;
- GLmatrix tmpmat;
- GLuint last_ReallyEnabled;
-
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
- int64_t swap_ust;
- int64_t swap_missed_ust;
-
- GLuint swap_count;
- GLuint swap_missed_count;
-
-
- /* radeon_tcl.c
- */
- struct radeon_tcl_info tcl;
-
- /* radeon_swtcl.c
- */
- struct radeon_swtcl_info swtcl;
-
- /* radeon_vtxfmt.c
- */
- struct radeon_vbinfo vb;
-
- /* Mirrors of some DRI state
- */
- struct radeon_dri_mirror dri;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-
- GLboolean using_hyperz;
- GLboolean texmicrotile;
-
- /* Performance counters
- */
- GLuint boxes; /* Draw performance boxes */
- GLuint hardwareWentIdle;
- GLuint c_clears;
- GLuint c_drawWaits;
- GLuint c_textureSwaps;
- GLuint c_textureBytes;
- GLuint c_vertexBuffers;
-};
-
-#define RADEON_CONTEXT(ctx) ((radeonContextPtr)(ctx->DriverCtx))
-
-
-static __inline GLuint radeonPackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return PACK_COLOR_565( r, g, b );
- case 4:
- return PACK_COLOR_8888( a, r, g, b );
- default:
- return 0;
- }
-}
-
-#define RADEON_OLD_PACKETS 1
-
-
-extern void radeonDestroyContext( __DRIcontextPrivate *driContextPriv );
-extern GLboolean radeonCreateContext(const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-extern void radeonSwapBuffers( __DRIdrawablePrivate *dPriv );
-extern GLboolean radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv );
-extern GLboolean radeonUnbindContext( __DRIcontextPrivate *driContextPriv );
-
-/* ================================================================
- * Debugging:
- */
-#define DO_DEBUG 1
-
-#if DO_DEBUG
-extern int RADEON_DEBUG;
-#else
-#define RADEON_DEBUG 0
-#endif
-
-#define DEBUG_TEXTURE 0x001
-#define DEBUG_STATE 0x002
-#define DEBUG_IOCTL 0x004
-#define DEBUG_PRIMS 0x008
-#define DEBUG_VERTS 0x010
-#define DEBUG_FALLBACKS 0x020
-#define DEBUG_VFMT 0x040
-#define DEBUG_CODEGEN 0x080
-#define DEBUG_VERBOSE 0x100
-#define DEBUG_DRI 0x200
-#define DEBUG_DMA 0x400
-#define DEBUG_SANITY 0x800
-#define DEBUG_SYNC 0x1000
-
-#endif /* __RADEON_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.c
deleted file mode 100644
index 53c5d5ca5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.c
+++ /dev/null
@@ -1,1283 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v 1.11 2003/01/29 22:04:59 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <sched.h>
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "swrast/swrast.h"
-
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_tcl.h"
-#include "radeon_sanity.h"
-
-#define STANDALONE_MMIO
-#include "radeon_macros.h" /* for INREG() */
-
-#include "vblank.h"
-
-#define RADEON_TIMEOUT 512
-#define RADEON_IDLE_RETRY 16
-
-
-static void radeonWaitForIdle( radeonContextPtr rmesa );
-static int radeonFlushCmdBufLocked( radeonContextPtr rmesa,
- const char * caller );
-
-static void print_state_atom( struct radeon_state_atom *state )
-{
- int i;
-
- fprintf(stderr, "emit %s/%d\n", state->name, state->cmd_size);
-
- if (RADEON_DEBUG & DEBUG_VERBOSE)
- for (i = 0 ; i < state->cmd_size ; i++)
- fprintf(stderr, "\t%s[%d]: %x\n", state->name, i, state->cmd[i]);
-
-}
-
-static void radeonSaveHwState( radeonContextPtr rmesa )
-{
- struct radeon_state_atom *atom;
- char * dest = rmesa->backup_store.cmd_buf;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- rmesa->backup_store.cmd_used = 0;
-
- foreach( atom, &rmesa->hw.atomlist ) {
- if ( atom->check( rmesa->glCtx ) ) {
- int size = atom->cmd_size * 4;
- memcpy( dest, atom->cmd, size);
- dest += size;
- rmesa->backup_store.cmd_used += size;
- if (RADEON_DEBUG & DEBUG_STATE)
- print_state_atom( atom );
- }
- }
-
- assert( rmesa->backup_store.cmd_used <= RADEON_CMD_BUF_SZ );
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Returning to radeonEmitState\n");
-}
-
-/* At this point we were in FlushCmdBufLocked but we had lost our context, so
- * we need to unwire our current cmdbuf, hook the one with the saved state in
- * it, flush it, and then put the current one back. This is so commands at the
- * start of a cmdbuf can rely on the state being kept from the previous one.
- */
-static void radeonBackUpAndEmitLostStateLocked( radeonContextPtr rmesa )
-{
- GLuint nr_released_bufs;
- struct radeon_store saved_store;
-
- if (rmesa->backup_store.cmd_used == 0)
- return;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "Emitting backup state on lost context\n");
-
- rmesa->lost_context = GL_FALSE;
-
- nr_released_bufs = rmesa->dma.nr_released_bufs;
- saved_store = rmesa->store;
- rmesa->dma.nr_released_bufs = 0;
- rmesa->store = rmesa->backup_store;
- radeonFlushCmdBufLocked( rmesa, __FUNCTION__ );
- rmesa->dma.nr_released_bufs = nr_released_bufs;
- rmesa->store = saved_store;
-}
-
-/* =============================================================
- * Kernel command buffer handling
- */
-
-/* The state atoms will be emitted in the order they appear in the atom list,
- * so this step is important.
- */
-void radeonSetUpAtomList( radeonContextPtr rmesa )
-{
- int i, mtu = rmesa->glCtx->Const.MaxTextureUnits;
-
- make_empty_list(&rmesa->hw.atomlist);
- rmesa->hw.atomlist.name = "atom-list";
-
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.ctx);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.set);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.lin);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.msk);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.vpt);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.tcl);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.msc);
- for (i = 0; i < mtu; ++i) {
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.tex[i]);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.txr[i]);
- }
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.zbs);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.mtl);
- for (i = 0; i < 3 + mtu; ++i)
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.mat[i]);
- for (i = 0; i < 8; ++i)
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.lit[i]);
- for (i = 0; i < 6; ++i)
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.ucp[i]);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.eye);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.grd);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.fog);
- insert_at_tail(&rmesa->hw.atomlist, &rmesa->hw.glt);
-}
-
-void radeonEmitState( radeonContextPtr rmesa )
-{
- struct radeon_state_atom *atom;
- char *dest;
-
- if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->save_on_next_emit) {
- radeonSaveHwState(rmesa);
- rmesa->save_on_next_emit = GL_FALSE;
- }
-
- /* this code used to return here but now it emits zbs */
-
- /* To avoid going across the entire set of states multiple times, just check
- * for enough space for the case of emitting all state, and inline the
- * radeonAllocCmdBuf code here without all the checks.
- */
- radeonEnsureCmdBufSpace(rmesa, rmesa->hw.max_state_size);
- dest = rmesa->store.cmd_buf + rmesa->store.cmd_used;
-
- /* We always always emit zbs, this is due to a bug found by keithw in
- the hardware and rediscovered after Erics changes by me.
- if you ever touch this code make sure you emit zbs otherwise
- you get tcl lockups on at least M7/7500 class of chips - airlied */
- rmesa->hw.zbs.dirty=1;
-
- if (RADEON_DEBUG & DEBUG_STATE) {
- foreach(atom, &rmesa->hw.atomlist) {
- if (atom->dirty || rmesa->hw.all_dirty) {
- if (atom->check(rmesa->glCtx))
- print_state_atom(atom);
- else
- fprintf(stderr, "skip state %s\n", atom->name);
- }
- }
- }
-
- foreach(atom, &rmesa->hw.atomlist) {
- if (rmesa->hw.all_dirty)
- atom->dirty = GL_TRUE;
- if (!(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL) &&
- atom->is_tcl)
- atom->dirty = GL_FALSE;
- if (atom->dirty) {
- if (atom->check(rmesa->glCtx)) {
- int size = atom->cmd_size * 4;
- memcpy(dest, atom->cmd, size);
- dest += size;
- rmesa->store.cmd_used += size;
- atom->dirty = GL_FALSE;
- }
- }
- }
-
- assert(rmesa->store.cmd_used <= RADEON_CMD_BUF_SZ);
-
- rmesa->hw.is_dirty = GL_FALSE;
- rmesa->hw.all_dirty = GL_FALSE;
-}
-
-/* Fire a section of the retained (indexed_verts) buffer as a regular
- * primtive.
- */
-extern void radeonEmitVbufPrim( radeonContextPtr rmesa,
- GLuint vertex_format,
- GLuint primitive,
- GLuint vertex_nr )
-{
- drm_radeon_cmd_header_t *cmd;
-
-
- assert(!(primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
-
- radeonEmitState( rmesa );
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s cmd_used/4: %d\n", __FUNCTION__,
- rmesa->store.cmd_used/4);
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, VBUF_BUFSZ,
- __FUNCTION__ );
-#if RADEON_OLD_PACKETS
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
- cmd[1].i = RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM | (3 << 16);
- cmd[2].i = rmesa->ioctl.vertex_offset;
- cmd[3].i = vertex_nr;
- cmd[4].i = vertex_format;
- cmd[5].i = (primitive |
- RADEON_CP_VC_CNTL_PRIM_WALK_LIST |
- RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
- RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE |
- (vertex_nr << RADEON_CP_VC_CNTL_NUM_SHIFT));
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s: header 0x%x offt 0x%x vfmt 0x%x vfcntl %x \n",
- __FUNCTION__,
- cmd[1].i, cmd[2].i, cmd[4].i, cmd[5].i);
-#else
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
- cmd[1].i = RADEON_CP_PACKET3_3D_DRAW_VBUF | (1 << 16);
- cmd[2].i = vertex_format;
- cmd[3].i = (primitive |
- RADEON_CP_VC_CNTL_PRIM_WALK_LIST |
- RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
- RADEON_CP_VC_CNTL_MAOS_ENABLE |
- RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE |
- (vertex_nr << RADEON_CP_VC_CNTL_NUM_SHIFT));
-
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s: header 0x%x vfmt 0x%x vfcntl %x \n",
- __FUNCTION__,
- cmd[1].i, cmd[2].i, cmd[3].i);
-#endif
-}
-
-
-void radeonFlushElts( radeonContextPtr rmesa )
-{
- int *cmd = (int *)(rmesa->store.cmd_buf + rmesa->store.elts_start);
- int dwords;
-#if RADEON_OLD_PACKETS
- int nr = (rmesa->store.cmd_used - (rmesa->store.elts_start + 24)) / 2;
-#else
- int nr = (rmesa->store.cmd_used - (rmesa->store.elts_start + 16)) / 2;
-#endif
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert( rmesa->dma.flush == radeonFlushElts );
- rmesa->dma.flush = NULL;
-
- /* Cope with odd number of elts:
- */
- rmesa->store.cmd_used = (rmesa->store.cmd_used + 2) & ~2;
- dwords = (rmesa->store.cmd_used - rmesa->store.elts_start) / 4;
-
-#if RADEON_OLD_PACKETS
- cmd[1] |= (dwords - 3) << 16;
- cmd[5] |= nr << RADEON_CP_VC_CNTL_NUM_SHIFT;
-#else
- cmd[1] |= (dwords - 3) << 16;
- cmd[3] |= nr << RADEON_CP_VC_CNTL_NUM_SHIFT;
-#endif
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
- radeonFinish( rmesa->glCtx );
- }
-}
-
-
-GLushort *radeonAllocEltsOpenEnded( radeonContextPtr rmesa,
- GLuint vertex_format,
- GLuint primitive,
- GLuint min_nr )
-{
- drm_radeon_cmd_header_t *cmd;
- GLushort *retval;
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, min_nr);
-
- assert((primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
-
- radeonEmitState( rmesa );
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa,
- ELTS_BUFSZ(min_nr),
- __FUNCTION__ );
-#if RADEON_OLD_PACKETS
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
- cmd[1].i = RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM;
- cmd[2].i = rmesa->ioctl.vertex_offset;
- cmd[3].i = 0xffff;
- cmd[4].i = vertex_format;
- cmd[5].i = (primitive |
- RADEON_CP_VC_CNTL_PRIM_WALK_IND |
- RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
- RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE);
-
- retval = (GLushort *)(cmd+6);
-#else
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3_CLIP;
- cmd[1].i = RADEON_CP_PACKET3_3D_DRAW_INDX;
- cmd[2].i = vertex_format;
- cmd[3].i = (primitive |
- RADEON_CP_VC_CNTL_PRIM_WALK_IND |
- RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA |
- RADEON_CP_VC_CNTL_MAOS_ENABLE |
- RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE);
-
- retval = (GLushort *)(cmd+4);
-#endif
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s: header 0x%x vfmt 0x%x prim %x \n",
- __FUNCTION__,
- cmd[1].i, vertex_format, primitive);
-
- assert(!rmesa->dma.flush);
- rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
- rmesa->dma.flush = radeonFlushElts;
-
- rmesa->store.elts_start = ((char *)cmd) - rmesa->store.cmd_buf;
-
- return retval;
-}
-
-
-
-void radeonEmitVertexAOS( radeonContextPtr rmesa,
- GLuint vertex_size,
- GLuint offset )
-{
-#if RADEON_OLD_PACKETS
- rmesa->ioctl.vertex_size = vertex_size;
- rmesa->ioctl.vertex_offset = offset;
-#else
- drm_radeon_cmd_header_t *cmd;
-
- if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_IOCTL))
- fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n",
- __FUNCTION__, vertex_size, offset);
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, VERT_AOS_BUFSZ,
- __FUNCTION__ );
-
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
- cmd[1].i = RADEON_CP_PACKET3_3D_LOAD_VBPNTR | (2 << 16);
- cmd[2].i = 1;
- cmd[3].i = vertex_size | (vertex_size << 8);
- cmd[4].i = offset;
-#endif
-}
-
-
-void radeonEmitAOS( radeonContextPtr rmesa,
- struct radeon_dma_region **component,
- GLuint nr,
- GLuint offset )
-{
-#if RADEON_OLD_PACKETS
- assert( nr == 1 );
- assert( component[0]->aos_size == component[0]->aos_stride );
- rmesa->ioctl.vertex_size = component[0]->aos_size;
- rmesa->ioctl.vertex_offset =
- (component[0]->aos_start + offset * component[0]->aos_stride * 4);
-#else
- drm_radeon_cmd_header_t *cmd;
- int sz = AOS_BUFSZ(nr);
- int i;
- int *tmp;
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, sz,
- __FUNCTION__ );
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
- cmd[1].i = RADEON_CP_PACKET3_3D_LOAD_VBPNTR | (((sz / sizeof(int))-3) << 16);
- cmd[2].i = nr;
- tmp = &cmd[0].i;
- cmd += 3;
-
- for (i = 0 ; i < nr ; i++) {
- if (i & 1) {
- cmd[0].i |= ((component[i]->aos_stride << 24) |
- (component[i]->aos_size << 16));
- cmd[2].i = (component[i]->aos_start +
- offset * component[i]->aos_stride * 4);
- cmd += 3;
- }
- else {
- cmd[0].i = ((component[i]->aos_stride << 8) |
- (component[i]->aos_size << 0));
- cmd[1].i = (component[i]->aos_start +
- offset * component[i]->aos_stride * 4);
- }
- }
-
- if (RADEON_DEBUG & DEBUG_VERTS) {
- fprintf(stderr, "%s:\n", __FUNCTION__);
- for (i = 0 ; i < sz ; i++)
- fprintf(stderr, " %d: %x\n", i, tmp[i]);
- }
-#endif
-}
-
-/* using already shifted color_fmt! */
-void radeonEmitBlit( radeonContextPtr rmesa, /* FIXME: which drmMinor is required? */
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty,
- GLuint w, GLuint h )
-{
- drm_radeon_cmd_header_t *cmd;
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s src %x/%x %d,%d dst: %x/%x %d,%d sz: %dx%d\n",
- __FUNCTION__,
- src_pitch, src_offset, srcx, srcy,
- dst_pitch, dst_offset, dstx, dsty,
- w, h);
-
- assert( (src_pitch & 63) == 0 );
- assert( (dst_pitch & 63) == 0 );
- assert( (src_offset & 1023) == 0 );
- assert( (dst_offset & 1023) == 0 );
- assert( w < (1<<16) );
- assert( h < (1<<16) );
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, 8 * sizeof(int),
- __FUNCTION__ );
-
-
- cmd[0].i = 0;
- cmd[0].header.cmd_type = RADEON_CMD_PACKET3;
- cmd[1].i = RADEON_CP_PACKET3_CNTL_BITBLT_MULTI | (5 << 16);
- cmd[2].i = (RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
- RADEON_GMC_DST_PITCH_OFFSET_CNTL |
- RADEON_GMC_BRUSH_NONE |
- color_fmt |
- RADEON_GMC_SRC_DATATYPE_COLOR |
- RADEON_ROP3_S |
- RADEON_DP_SRC_SOURCE_MEMORY |
- RADEON_GMC_CLR_CMP_CNTL_DIS |
- RADEON_GMC_WR_MSK_DIS );
-
- cmd[3].i = ((src_pitch/64)<<22) | (src_offset >> 10);
- cmd[4].i = ((dst_pitch/64)<<22) | (dst_offset >> 10);
- cmd[5].i = (srcx << 16) | srcy;
- cmd[6].i = (dstx << 16) | dsty; /* dst */
- cmd[7].i = (w << 16) | h;
-}
-
-
-void radeonEmitWait( radeonContextPtr rmesa, GLuint flags )
-{
- if (rmesa->dri.drmMinor >= 6) {
- drm_radeon_cmd_header_t *cmd;
-
- assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, 1 * sizeof(int),
- __FUNCTION__ );
- cmd[0].i = 0;
- cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
- cmd[0].wait.flags = flags;
- }
-}
-
-
-static int radeonFlushCmdBufLocked( radeonContextPtr rmesa,
- const char * caller )
-{
- int ret, i;
- drm_radeon_cmd_buffer_t cmd;
-
- if (rmesa->lost_context)
- radeonBackUpAndEmitLostStateLocked(rmesa);
-
- if (RADEON_DEBUG & DEBUG_IOCTL) {
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (RADEON_DEBUG & DEBUG_VERBOSE)
- for (i = 0 ; i < rmesa->store.cmd_used ; i += 4 )
- fprintf(stderr, "%d: %x\n", i/4,
- *(int *)(&rmesa->store.cmd_buf[i]));
- }
-
- if (RADEON_DEBUG & DEBUG_DMA)
- fprintf(stderr, "%s: Releasing %d buffers\n", __FUNCTION__,
- rmesa->dma.nr_released_bufs);
-
-
- if (RADEON_DEBUG & DEBUG_SANITY) {
- if (rmesa->state.scissor.enabled)
- ret = radeonSanityCmdBuffer( rmesa,
- rmesa->state.scissor.numClipRects,
- rmesa->state.scissor.pClipRects);
- else
- ret = radeonSanityCmdBuffer( rmesa,
- rmesa->numClipRects,
- rmesa->pClipRects);
- if (ret) {
- fprintf(stderr, "drmSanityCommandWrite: %d\n", ret);
- goto out;
- }
- }
-
-
- cmd.bufsz = rmesa->store.cmd_used;
- cmd.buf = rmesa->store.cmd_buf;
-
- if (rmesa->state.scissor.enabled) {
- cmd.nbox = rmesa->state.scissor.numClipRects;
- cmd.boxes = rmesa->state.scissor.pClipRects;
- } else {
- cmd.nbox = rmesa->numClipRects;
- cmd.boxes = rmesa->pClipRects;
- }
-
- ret = drmCommandWrite( rmesa->dri.fd,
- DRM_RADEON_CMDBUF,
- &cmd, sizeof(cmd) );
-
- if (ret)
- fprintf(stderr, "drmCommandWrite: %d\n", ret);
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "\nSyncing in %s\n\n", __FUNCTION__);
- radeonWaitForIdleLocked( rmesa );
- }
-
- out:
- rmesa->store.primnr = 0;
- rmesa->store.statenr = 0;
- rmesa->store.cmd_used = 0;
- rmesa->dma.nr_released_bufs = 0;
- rmesa->save_on_next_emit = 1;
-
- return ret;
-}
-
-
-/* Note: does not emit any commands to avoid recursion on
- * radeonAllocCmdBuf.
- */
-void radeonFlushCmdBuf( radeonContextPtr rmesa, const char *caller )
-{
- int ret;
-
-
- LOCK_HARDWARE( rmesa );
-
- ret = radeonFlushCmdBufLocked( rmesa, caller );
-
- UNLOCK_HARDWARE( rmesa );
-
- if (ret) {
- fprintf(stderr, "drm_radeon_cmd_buffer_t: %d (exiting)\n", ret);
- exit(ret);
- }
-}
-
-/* =============================================================
- * Hardware vertex buffer handling
- */
-
-
-void radeonRefillCurrentDmaRegion( radeonContextPtr rmesa )
-{
- struct radeon_dma_buffer *dmabuf;
- int fd = rmesa->dri.fd;
- int index = 0;
- int size = 0;
- drmDMAReq dma;
- int ret;
-
- if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->dma.flush) {
- rmesa->dma.flush( rmesa );
- }
-
- if (rmesa->dma.current.buf)
- radeonReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
-
- if (rmesa->dma.nr_released_bufs > 4)
- radeonFlushCmdBuf( rmesa, __FUNCTION__ );
-
- dma.context = rmesa->dri.hwContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = RADEON_BUFFER_SIZE;
- dma.request_list = &index;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
- LOCK_HARDWARE(rmesa); /* no need to validate */
-
- ret = drmDMA( fd, &dma );
-
- if (ret != 0) {
- /* Free some up this way?
- */
- if (rmesa->dma.nr_released_bufs) {
- radeonFlushCmdBufLocked( rmesa, __FUNCTION__ );
- }
-
- if (RADEON_DEBUG & DEBUG_DMA)
- fprintf(stderr, "Waiting for buffers\n");
-
- radeonWaitForIdleLocked( rmesa );
- ret = drmDMA( fd, &dma );
-
- if ( ret != 0 ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "Error: Could not get dma buffer... exiting\n" );
- exit( -1 );
- }
- }
-
- UNLOCK_HARDWARE(rmesa);
-
- if (RADEON_DEBUG & DEBUG_DMA)
- fprintf(stderr, "Allocated buffer %d\n", index);
-
- dmabuf = CALLOC_STRUCT( radeon_dma_buffer );
- dmabuf->buf = &rmesa->radeonScreen->buffers->list[index];
- dmabuf->refcount = 1;
-
- rmesa->dma.current.buf = dmabuf;
- rmesa->dma.current.address = dmabuf->buf->address;
- rmesa->dma.current.end = dmabuf->buf->total;
- rmesa->dma.current.start = 0;
- rmesa->dma.current.ptr = 0;
-
- rmesa->c_vertexBuffers++;
-}
-
-void radeonReleaseDmaRegion( radeonContextPtr rmesa,
- struct radeon_dma_region *region,
- const char *caller )
-{
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (!region->buf)
- return;
-
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- if (--region->buf->refcount == 0) {
- drm_radeon_cmd_header_t *cmd;
-
- if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
- fprintf(stderr, "%s -- DISCARD BUF %d\n", __FUNCTION__,
- region->buf->buf->idx);
-
- cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, sizeof(*cmd),
- __FUNCTION__ );
- cmd->dma.cmd_type = RADEON_CMD_DMA_DISCARD;
- cmd->dma.buf_idx = region->buf->buf->idx;
- FREE(region->buf);
- rmesa->dma.nr_released_bufs++;
- }
-
- region->buf = NULL;
- region->start = 0;
-}
-
-/* Allocates a region from rmesa->dma.current. If there isn't enough
- * space in current, grab a new buffer (and discard what was left of current)
- */
-void radeonAllocDmaRegion( radeonContextPtr rmesa,
- struct radeon_dma_region *region,
- int bytes,
- int alignment )
-{
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
-
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- if (region->buf)
- radeonReleaseDmaRegion( rmesa, region, __FUNCTION__ );
-
- alignment--;
- rmesa->dma.current.start = rmesa->dma.current.ptr =
- (rmesa->dma.current.ptr + alignment) & ~alignment;
-
- if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
- radeonRefillCurrentDmaRegion( rmesa );
-
- region->start = rmesa->dma.current.start;
- region->ptr = rmesa->dma.current.start;
- region->end = rmesa->dma.current.start + bytes;
- region->address = rmesa->dma.current.address;
- region->buf = rmesa->dma.current.buf;
- region->buf->refcount++;
-
- rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */
- rmesa->dma.current.start =
- rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7;
-}
-
-void radeonAllocDmaRegionVerts( radeonContextPtr rmesa,
- struct radeon_dma_region *region,
- int numverts,
- int vertsize,
- int alignment )
-{
- radeonAllocDmaRegion( rmesa, region, vertsize * numverts, alignment );
-}
-
-/* ================================================================
- * SwapBuffers with client-side throttling
- */
-
-static u_int32_t radeonGetLastFrame (radeonContextPtr rmesa)
-{
- unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map;
- int ret;
- u_int32_t frame;
-
- if (rmesa->dri.screen->drmMinor >= 4) {
- drm_radeon_getparam_t gp;
-
- gp.param = RADEON_PARAM_LAST_FRAME;
- gp.value = (int *)&frame;
- ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp) );
- }
- else
- ret = -EINVAL;
-
- if ( ret == -EINVAL ) {
- frame = INREG( RADEON_LAST_FRAME_REG );
- ret = 0;
- }
- if ( ret ) {
- fprintf( stderr, "%s: drm_radeon_getparam_t: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-
- return frame;
-}
-
-static void radeonEmitIrqLocked( radeonContextPtr rmesa )
-{
- drm_radeon_irq_emit_t ie;
- int ret;
-
- ie.irq_seq = &rmesa->iw.irq_seq;
- ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_IRQ_EMIT,
- &ie, sizeof(ie) );
- if ( ret ) {
- fprintf( stderr, "%s: drm_radeon_irq_emit_t: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-}
-
-
-static void radeonWaitIrq( radeonContextPtr rmesa )
-{
- int ret;
-
- do {
- ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_IRQ_WAIT,
- &rmesa->iw, sizeof(rmesa->iw) );
- } while (ret && (errno == EINTR || errno == EAGAIN));
-
- if ( ret ) {
- fprintf( stderr, "%s: drmRadeonIrqWait: %d\n", __FUNCTION__, ret );
- exit(1);
- }
-}
-
-
-static void radeonWaitForFrameCompletion( radeonContextPtr rmesa )
-{
- drm_radeon_sarea_t *sarea = rmesa->sarea;
-
- if (rmesa->do_irqs) {
- if (radeonGetLastFrame(rmesa) < sarea->last_frame) {
- if (!rmesa->irqsEmitted) {
- while (radeonGetLastFrame (rmesa) < sarea->last_frame)
- ;
- }
- else {
- UNLOCK_HARDWARE( rmesa );
- radeonWaitIrq( rmesa );
- LOCK_HARDWARE( rmesa );
- }
- rmesa->irqsEmitted = 10;
- }
-
- if (rmesa->irqsEmitted) {
- radeonEmitIrqLocked( rmesa );
- rmesa->irqsEmitted--;
- }
- }
- else {
- while (radeonGetLastFrame (rmesa) < sarea->last_frame) {
- UNLOCK_HARDWARE( rmesa );
- if (rmesa->do_usleeps)
- DO_USLEEP( 1 );
- LOCK_HARDWARE( rmesa );
- }
- }
-}
-
-/* Copy the back color buffer to the front color buffer.
- */
-void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- radeonContextPtr rmesa;
- GLint nbox, i, ret;
- GLboolean missed_target;
- int64_t ust;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( RADEON_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *) rmesa->glCtx );
- }
-
- RADEON_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
-
- /* Throttle the frame rate -- only allow one pending swap buffers
- * request at a time.
- */
- radeonWaitForFrameCompletion( rmesa );
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
- LOCK_HARDWARE( rmesa );
-
- nbox = dPriv->numClipRects; /* must be in locked region */
-
- for ( i = 0 ; i < nbox ; ) {
- GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS , nbox );
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- GLint n = 0;
-
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- rmesa->sarea->nbox = n;
-
- ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
-
- if ( ret ) {
- fprintf( stderr, "DRM_RADEON_SWAP_BUFFERS: return = %d\n", ret );
- UNLOCK_HARDWARE( rmesa );
- exit( 1 );
- }
- }
-
- UNLOCK_HARDWARE( rmesa );
- rmesa->swap_count++;
- (*dri_interface->getUST)( & ust );
- if ( missed_target ) {
- rmesa->swap_missed_count++;
- rmesa->swap_missed_ust = ust - rmesa->swap_ust;
- }
-
- rmesa->swap_ust = ust;
- rmesa->hw.all_dirty = GL_TRUE;
-}
-
-void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
-{
- radeonContextPtr rmesa;
- GLint ret;
- GLboolean missed_target;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
-
- if ( RADEON_DEBUG & DEBUG_IOCTL ) {
- fprintf(stderr, "%s: pfCurrentPage: %d\n", __FUNCTION__,
- rmesa->sarea->pfCurrentPage);
- }
-
- RADEON_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
-
- /* Need to do this for the perf box placement:
- */
- if (dPriv->numClipRects)
- {
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- b[0] = box[0];
- rmesa->sarea->nbox = 1;
- }
-
- /* Throttle the frame rate -- only allow a few pending swap buffers
- * request at a time.
- */
- radeonWaitForFrameCompletion( rmesa );
- UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
- if ( missed_target ) {
- rmesa->swap_missed_count++;
- (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
- }
- LOCK_HARDWARE( rmesa );
-
- ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_FLIP );
-
- UNLOCK_HARDWARE( rmesa );
-
- if ( ret ) {
- fprintf( stderr, "DRM_RADEON_FLIP: return = %d\n", ret );
- exit( 1 );
- }
-
- rmesa->swap_count++;
- (void) (*dri_interface->getUST)( & rmesa->swap_ust );
-
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- }
-
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
- + rmesa->radeonScreen->fbLocation;
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= RADEON_COLOR_TILE_ENABLE;
- }
-}
-
-
-/* ================================================================
- * Buffer clear
- */
-#define RADEON_MAX_CLEARS 256
-
-static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- drm_radeon_sarea_t *sarea = rmesa->sarea;
- unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map;
- u_int32_t clear;
- GLuint flags = 0;
- GLuint color_mask = 0;
- GLint ret, i;
-
- if ( RADEON_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n",
- __FUNCTION__, all, cx, cy, cw, ch );
- }
-
- {
- LOCK_HARDWARE( rmesa );
- UNLOCK_HARDWARE( rmesa );
- if ( dPriv->numClipRects == 0 )
- return;
- }
-
- radeonFlush( ctx );
-
- if ( mask & BUFFER_BIT_FRONT_LEFT ) {
- flags |= RADEON_FRONT;
- color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ( mask & BUFFER_BIT_BACK_LEFT ) {
- flags |= RADEON_BACK;
- color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ( mask & BUFFER_BIT_DEPTH ) {
- flags |= RADEON_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if ( (mask & BUFFER_BIT_STENCIL) && rmesa->state.stencil.hwBuffer ) {
- flags |= RADEON_STENCIL;
- mask &= ~BUFFER_BIT_STENCIL;
- }
-
- if ( mask ) {
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
- }
-
- if ( !flags )
- return;
-
- if (rmesa->using_hyperz) {
- flags |= RADEON_USE_COMP_ZBUF;
-/* if (rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)
- flags |= RADEON_USE_HIERZ; */
- if (!(rmesa->state.stencil.hwBuffer) ||
- ((flags & RADEON_DEPTH) && (flags & RADEON_STENCIL) &&
- ((rmesa->state.stencil.clear & RADEON_STENCIL_WRITE_MASK) == RADEON_STENCIL_WRITE_MASK))) {
- flags |= RADEON_CLEAR_FASTZ;
- }
- }
-
- /* Flip top to bottom */
- cx += dPriv->x;
- cy = dPriv->y + dPriv->h - cy - ch;
-
- LOCK_HARDWARE( rmesa );
-
- /* Throttle the number of clear ioctls we do.
- */
- while ( 1 ) {
- int ret;
-
- if (rmesa->dri.screen->drmMinor >= 4) {
- drm_radeon_getparam_t gp;
-
- gp.param = RADEON_PARAM_LAST_CLEAR;
- gp.value = (int *)&clear;
- ret = drmCommandWriteRead( rmesa->dri.fd,
- DRM_RADEON_GETPARAM, &gp, sizeof(gp) );
- } else
- ret = -EINVAL;
-
- if ( ret == -EINVAL ) {
- clear = INREG( RADEON_LAST_CLEAR_REG );
- ret = 0;
- }
- if ( ret ) {
- fprintf( stderr, "%s: drm_radeon_getparam_t: %d\n", __FUNCTION__, ret );
- exit(1);
- }
- if ( RADEON_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "%s( %d )\n", __FUNCTION__, (int)clear );
- if ( ret ) fprintf( stderr, " ( RADEON_LAST_CLEAR register read directly )\n" );
- }
-
- if ( sarea->last_clear - clear <= RADEON_MAX_CLEARS ) {
- break;
- }
-
- if ( rmesa->do_usleeps ) {
- UNLOCK_HARDWARE( rmesa );
- DO_USLEEP( 1 );
- LOCK_HARDWARE( rmesa );
- }
- }
-
- /* Send current state to the hardware */
- radeonFlushCmdBufLocked( rmesa, __FUNCTION__ );
-
- for ( i = 0 ; i < dPriv->numClipRects ; ) {
- GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, dPriv->numClipRects );
- drm_clip_rect_t *box = dPriv->pClipRects;
- drm_clip_rect_t *b = rmesa->sarea->boxes;
- drm_radeon_clear_t clear;
- drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
- GLint n = 0;
-
- if ( !all ) {
- for ( ; i < nr ; i++ ) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if ( x < cx ) w -= cx - x, x = cx;
- if ( y < cy ) h -= cy - y, y = cy;
- if ( x + w > cx + cw ) w = cx + cw - x;
- if ( y + h > cy + ch ) h = cy + ch - y;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- }
-
- rmesa->sarea->nbox = n;
-
- clear.flags = flags;
- clear.clear_color = rmesa->state.color.clear;
- clear.clear_depth = rmesa->state.depth.clear;
- clear.color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK];
- clear.depth_mask = rmesa->state.stencil.clear;
- clear.depth_boxes = depth_boxes;
-
- n--;
- b = rmesa->sarea->boxes;
- for ( ; n >= 0 ; n-- ) {
- depth_boxes[n].f[CLEAR_X1] = (float)b[n].x1;
- depth_boxes[n].f[CLEAR_Y1] = (float)b[n].y1;
- depth_boxes[n].f[CLEAR_X2] = (float)b[n].x2;
- depth_boxes[n].f[CLEAR_Y2] = (float)b[n].y2;
- depth_boxes[n].f[CLEAR_DEPTH] =
- (float)rmesa->state.depth.clear;
- }
-
- ret = drmCommandWrite( rmesa->dri.fd, DRM_RADEON_CLEAR,
- &clear, sizeof(drm_radeon_clear_t));
-
- if ( ret ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "DRM_RADEON_CLEAR: return = %d\n", ret );
- exit( 1 );
- }
- }
-
- UNLOCK_HARDWARE( rmesa );
- rmesa->hw.all_dirty = GL_TRUE;
-}
-
-
-void radeonWaitForIdleLocked( radeonContextPtr rmesa )
-{
- int fd = rmesa->dri.fd;
- int to = 0;
- int ret, i = 0;
-
- rmesa->c_drawWaits++;
-
- do {
- do {
- ret = drmCommandNone( fd, DRM_RADEON_CP_IDLE);
- } while ( ret && errno == EBUSY && i++ < RADEON_IDLE_RETRY );
- } while ( ( ret == -EBUSY ) && ( to++ < RADEON_TIMEOUT ) );
-
- if ( ret < 0 ) {
- UNLOCK_HARDWARE( rmesa );
- fprintf( stderr, "Error: Radeon timed out... exiting\n" );
- exit( -1 );
- }
-}
-
-
-static void radeonWaitForIdle( radeonContextPtr rmesa )
-{
- LOCK_HARDWARE(rmesa);
- radeonWaitForIdleLocked( rmesa );
- UNLOCK_HARDWARE(rmesa);
-}
-
-
-void radeonFlush( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- radeonEmitState( rmesa );
-
- if (rmesa->store.cmd_used)
- radeonFlushCmdBuf( rmesa, __FUNCTION__ );
-}
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
- */
-void radeonFinish( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeonFlush( ctx );
-
- if (rmesa->do_irqs) {
- LOCK_HARDWARE( rmesa );
- radeonEmitIrqLocked( rmesa );
- UNLOCK_HARDWARE( rmesa );
- radeonWaitIrq( rmesa );
- }
- else
- radeonWaitForIdle( rmesa );
-}
-
-
-void radeonInitIoctlFuncs( GLcontext *ctx )
-{
- ctx->Driver.Clear = radeonClear;
- ctx->Driver.Finish = radeonFinish;
- ctx->Driver.Flush = radeonFlush;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.h
deleted file mode 100644
index 8b21920c5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_ioctl.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h,v 1.6 2002/12/16 16:18:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifndef __RADEON_IOCTL_H__
-#define __RADEON_IOCTL_H__
-
-#include "simple_list.h"
-#include "radeon_lock.h"
-
-
-extern void radeonEmitState( radeonContextPtr rmesa );
-extern void radeonEmitVertexAOS( radeonContextPtr rmesa,
- GLuint vertex_size,
- GLuint offset );
-
-extern void radeonEmitVbufPrim( radeonContextPtr rmesa,
- GLuint vertex_format,
- GLuint primitive,
- GLuint vertex_nr );
-
-extern void radeonFlushElts( radeonContextPtr rmesa );
-
-extern GLushort *radeonAllocEltsOpenEnded( radeonContextPtr rmesa,
- GLuint vertex_format,
- GLuint primitive,
- GLuint min_nr );
-
-extern void radeonEmitAOS( radeonContextPtr rmesa,
- struct radeon_dma_region **regions,
- GLuint n,
- GLuint offset );
-
-extern void radeonEmitBlit( radeonContextPtr rmesa,
- GLuint color_fmt,
- GLuint src_pitch,
- GLuint src_offset,
- GLuint dst_pitch,
- GLuint dst_offset,
- GLint srcx, GLint srcy,
- GLint dstx, GLint dsty,
- GLuint w, GLuint h );
-
-extern void radeonEmitWait( radeonContextPtr rmesa, GLuint flags );
-
-extern void radeonFlushCmdBuf( radeonContextPtr rmesa, const char * );
-extern void radeonRefillCurrentDmaRegion( radeonContextPtr rmesa );
-
-extern void radeonAllocDmaRegion( radeonContextPtr rmesa,
- struct radeon_dma_region *region,
- int bytes,
- int alignment );
-
-extern void radeonAllocDmaRegionVerts( radeonContextPtr rmesa,
- struct radeon_dma_region *region,
- int numverts,
- int vertsize,
- int alignment );
-
-extern void radeonReleaseDmaRegion( radeonContextPtr rmesa,
- struct radeon_dma_region *region,
- const char *caller );
-
-extern void radeonCopyBuffer( const __DRIdrawablePrivate *drawable );
-extern void radeonPageFlip( const __DRIdrawablePrivate *drawable );
-extern void radeonFlush( GLcontext *ctx );
-extern void radeonFinish( GLcontext *ctx );
-extern void radeonWaitForIdleLocked( radeonContextPtr rmesa );
-extern void radeonWaitForVBlank( radeonContextPtr rmesa );
-extern void radeonInitIoctlFuncs( GLcontext *ctx );
-extern void radeonGetAllParams( radeonContextPtr rmesa );
-extern void radeonSetUpAtomList( radeonContextPtr rmesa );
-
-/* radeon_compat.c:
- */
-extern void radeonCompatEmitPrimitive( radeonContextPtr rmesa,
- GLuint vertex_format,
- GLuint hw_primitive,
- GLuint nrverts );
-
-/* ================================================================
- * Helper macros:
- */
-
-/* Close off the last primitive, if it exists.
- */
-#define RADEON_NEWPRIM( rmesa ) \
-do { \
- if ( rmesa->dma.flush ) \
- rmesa->dma.flush( rmesa ); \
-} while (0)
-
-/* Can accomodate several state changes and primitive changes without
- * actually firing the buffer.
- */
-#define RADEON_STATECHANGE( rmesa, ATOM ) \
-do { \
- RADEON_NEWPRIM( rmesa ); \
- rmesa->hw.ATOM.dirty = GL_TRUE; \
- rmesa->hw.is_dirty = GL_TRUE; \
-} while (0)
-
-#define RADEON_DB_STATE( ATOM ) \
- memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \
- rmesa->hw.ATOM.cmd_size * 4)
-
-static __inline int RADEON_DB_STATECHANGE(
- radeonContextPtr rmesa,
- struct radeon_state_atom *atom )
-{
- if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size*4)) {
- int *tmp;
- RADEON_NEWPRIM( rmesa );
- atom->dirty = GL_TRUE;
- rmesa->hw.is_dirty = GL_TRUE;
- tmp = atom->cmd;
- atom->cmd = atom->lastcmd;
- atom->lastcmd = tmp;
- return 1;
- }
- else
- return 0;
-}
-
-
-/* Fire the buffered vertices no matter what.
- */
-#define RADEON_FIREVERTICES( rmesa ) \
-do { \
- if ( rmesa->store.cmd_used || rmesa->dma.flush ) { \
- radeonFlush( rmesa->glCtx ); \
- } \
-} while (0)
-
-/* Command lengths. Note that any time you ensure ELTS_BUFSZ or VBUF_BUFSZ
- * are available, you will also be adding an rmesa->state.max_state_size because
- * r200EmitState is called from within r200EmitVbufPrim and r200FlushElts.
- */
-#if RADEON_OLD_PACKETS
-#define AOS_BUFSZ(nr) ((3 + ((nr / 2) * 3) + ((nr & 1) * 2)) * sizeof(int))
-#define VERT_AOS_BUFSZ (0)
-#define ELTS_BUFSZ(nr) (24 + nr * 2)
-#define VBUF_BUFSZ (6 * sizeof(int))
-#else
-#define AOS_BUFSZ(nr) ((3 + ((nr / 2) * 3) + ((nr & 1) * 2)) * sizeof(int))
-#define VERT_AOS_BUFSZ (5 * sizeof(int))
-#define ELTS_BUFSZ(nr) (16 + nr * 2)
-#define VBUF_BUFSZ (4 * sizeof(int))
-#endif
-
-/* Ensure that a minimum amount of space is available in the command buffer.
- * This is used to ensure atomicity of state updates with the rendering requests
- * that rely on them.
- *
- * An alternative would be to implement a "soft lock" such that when the buffer
- * wraps at an inopportune time, we grab the lock, flush the current buffer,
- * and hang on to the lock until the critical section is finished and we flush
- * the buffer again and unlock.
- */
-static __inline void radeonEnsureCmdBufSpace( radeonContextPtr rmesa,
- int bytes )
-{
- if (rmesa->store.cmd_used + bytes > RADEON_CMD_BUF_SZ)
- radeonFlushCmdBuf( rmesa, __FUNCTION__ );
- assert( bytes <= RADEON_CMD_BUF_SZ );
-}
-
-/* Alloc space in the command buffer
- */
-static __inline char *radeonAllocCmdBuf( radeonContextPtr rmesa,
- int bytes, const char *where )
-{
- if (rmesa->store.cmd_used + bytes > RADEON_CMD_BUF_SZ)
- radeonFlushCmdBuf( rmesa, __FUNCTION__ );
-
- assert(rmesa->dri.drmMinor >= 3);
-
- {
- char *head = rmesa->store.cmd_buf + rmesa->store.cmd_used;
- rmesa->store.cmd_used += bytes;
- return head;
- }
-}
-
-#endif /* __RADEON_IOCTL_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lighting.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lighting.c
deleted file mode 100644
index 44e00af0e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lighting.c
+++ /dev/null
@@ -1,682 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.5 2002/09/16 18:05:20 eich Exp $ */
-/*
- * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-/* #include "mmath.h" */
-#include "enums.h"
-#include "colormac.h"
-
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_tcl.h"
-#include "radeon_tex.h"
-#include "radeon_vtxfmt.h"
-
-
-
-/* =============================================================
- * Materials
- */
-
-
-/* Update on colormaterial, material emmissive/ambient,
- * lightmodel.globalambient
- */
-void update_global_ambient( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- float *fcmd = (float *)RADEON_DB_STATE( glt );
-
- /* Need to do more if both emmissive & ambient are PREMULT:
- */
- if ((rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &
- ((3 << RADEON_EMISSIVE_SOURCE_SHIFT) |
- (3 << RADEON_AMBIENT_SOURCE_SHIFT))) == 0)
- {
- COPY_3V( &fcmd[GLT_RED],
- ctx->Light.Material[0].Emission);
- ACC_SCALE_3V( &fcmd[GLT_RED],
- ctx->Light.Model.Ambient,
- ctx->Light.Material[0].Ambient);
- }
- else
- {
- COPY_3V( &fcmd[GLT_RED], ctx->Light.Model.Ambient );
- }
-
- RADEON_DB_STATECHANGE(rmesa, &rmesa->hw.glt);
-}
-
-/* Update on change to
- * - light[p].colors
- * - light[p].enabled
- * - material,
- * - colormaterial enabled
- * - colormaterial bitmask
- */
-void update_light_colors( GLcontext *ctx, GLuint p )
-{
- struct gl_light *l = &ctx->Light.Light[p];
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (l->Enabled) {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- float *fcmd = (float *)RADEON_DB_STATE( lit[p] );
- GLuint bitmask = ctx->Light.ColorMaterialBitmask;
- struct gl_material *mat = &ctx->Light.Material[0];
-
- COPY_4V( &fcmd[LIT_AMBIENT_RED], l->Ambient );
- COPY_4V( &fcmd[LIT_DIFFUSE_RED], l->Diffuse );
- COPY_4V( &fcmd[LIT_SPECULAR_RED], l->Specular );
-
- if (!ctx->Light.ColorMaterialEnabled)
- bitmask = 0;
-
- if ((bitmask & FRONT_AMBIENT_BIT) == 0)
- SELF_SCALE_3V( &fcmd[LIT_AMBIENT_RED], mat->Ambient );
-
- if ((bitmask & FRONT_DIFFUSE_BIT) == 0)
- SELF_SCALE_3V( &fcmd[LIT_DIFFUSE_RED], mat->Diffuse );
-
- if ((bitmask & FRONT_SPECULAR_BIT) == 0)
- SELF_SCALE_3V( &fcmd[LIT_SPECULAR_RED], mat->Specular );
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
- }
-}
-
-/* Also fallback for asym colormaterial mode in twoside lighting...
- */
-void check_twoside_fallback( GLcontext *ctx )
-{
- GLboolean fallback = GL_FALSE;
-
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
- if (memcmp( &ctx->Light.Material[0],
- &ctx->Light.Material[1],
- sizeof(struct gl_material)) != 0)
- fallback = GL_TRUE;
- else if (ctx->Light.ColorMaterialEnabled &&
- (ctx->Light.ColorMaterialBitmask & BACK_MATERIAL_BITS) !=
- ((ctx->Light.ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1))
- fallback = GL_TRUE;
- }
-
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_LIGHT_TWOSIDE, fallback );
-}
-
-void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
-{
- if (ctx->Light.ColorMaterialEnabled) {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint light_model_ctl = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL];
- GLuint mask = ctx->Light.ColorMaterialBitmask;
-
- /* Default to PREMULT:
- */
- light_model_ctl &= ~((3 << RADEON_EMISSIVE_SOURCE_SHIFT) |
- (3 << RADEON_AMBIENT_SOURCE_SHIFT) |
- (3 << RADEON_DIFFUSE_SOURCE_SHIFT) |
- (3 << RADEON_SPECULAR_SOURCE_SHIFT));
-
- if (mask & FRONT_EMISSION_BIT) {
- light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_EMISSIVE_SOURCE_SHIFT);
- }
-
- if (mask & FRONT_AMBIENT_BIT) {
- light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_AMBIENT_SOURCE_SHIFT);
- }
-
- if (mask & FRONT_DIFFUSE_BIT) {
- light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_DIFFUSE_SOURCE_SHIFT);
- }
-
- if (mask & FRONT_SPECULAR_BIT) {
- light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_SPECULAR_SOURCE_SHIFT);
- }
-
- if (light_model_ctl != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]) {
- GLuint p;
-
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = light_model_ctl;
-
- for (p = 0 ; p < MAX_LIGHTS; p++)
- update_light_colors( ctx, p );
- update_global_ambient( ctx );
- }
- }
-
- check_twoside_fallback( ctx );
-}
-
-void radeonUpdateMaterial( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( mtl );
- GLuint p;
- GLuint mask = ~0;
-
- if (ctx->Light.ColorMaterialEnabled)
- mask &= ~ctx->Light.ColorMaterialBitmask;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
- if (mask & FRONT_EMISSION_BIT) {
- fcmd[MTL_EMMISSIVE_RED] = ctx->Light.Material[0].Emission[0];
- fcmd[MTL_EMMISSIVE_GREEN] = ctx->Light.Material[0].Emission[1];
- fcmd[MTL_EMMISSIVE_BLUE] = ctx->Light.Material[0].Emission[2];
- fcmd[MTL_EMMISSIVE_ALPHA] = ctx->Light.Material[0].Emission[3];
- }
- if (mask & FRONT_AMBIENT_BIT) {
- fcmd[MTL_AMBIENT_RED] = ctx->Light.Material[0].Ambient[0];
- fcmd[MTL_AMBIENT_GREEN] = ctx->Light.Material[0].Ambient[1];
- fcmd[MTL_AMBIENT_BLUE] = ctx->Light.Material[0].Ambient[2];
- fcmd[MTL_AMBIENT_ALPHA] = ctx->Light.Material[0].Ambient[3];
- }
- if (mask & FRONT_DIFFUSE_BIT) {
- fcmd[MTL_DIFFUSE_RED] = ctx->Light.Material[0].Diffuse[0];
- fcmd[MTL_DIFFUSE_GREEN] = ctx->Light.Material[0].Diffuse[1];
- fcmd[MTL_DIFFUSE_BLUE] = ctx->Light.Material[0].Diffuse[2];
- fcmd[MTL_DIFFUSE_ALPHA] = ctx->Light.Material[0].Diffuse[3];
- }
- if (mask & FRONT_SPECULAR_BIT) {
- fcmd[MTL_SPECULAR_RED] = ctx->Light.Material[0].Specular[0];
- fcmd[MTL_SPECULAR_GREEN] = ctx->Light.Material[0].Specular[1];
- fcmd[MTL_SPECULAR_BLUE] = ctx->Light.Material[0].Specular[2];
- fcmd[MTL_SPECULAR_ALPHA] = ctx->Light.Material[0].Specular[3];
- }
- if (mask & FRONT_SHININESS_BIT) {
- fcmd[MTL_SHININESS] = ctx->Light.Material[0].Shininess;
- }
-
- if (RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mtl )) {
- for (p = 0 ; p < MAX_LIGHTS; p++)
- update_light_colors( ctx, p );
-
- check_twoside_fallback( ctx );
- update_global_ambient( ctx );
- }
- else if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_STATE))
- fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
-}
-
-/* _NEW_LIGHT
- * _NEW_MODELVIEW
- * _MESA_NEW_NEED_EYE_COORDS
- *
- * Uses derived state from mesa:
- * _VP_inf_norm
- * _h_inf_norm
- * _Position
- * _NormDirection
- * _ModelViewInvScale
- * _NeedEyeCoords
- * _EyeZDir
- *
- * which are calculated in light.c and are correct for the current
- * lighting space (model or eye), hence dependencies on _NEW_MODELVIEW
- * and _MESA_NEW_NEED_EYE_COORDS.
- */
-void radeonUpdateLighting( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- /* Have to check these, or have an automatic shortcircuit mechanism
- * to remove noop statechanges. (Or just do a better job on the
- * front end).
- */
- {
- GLuint tmp = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL];
-
- if (ctx->_NeedEyeCoords)
- tmp &= ~RADEON_LIGHT_IN_MODELSPACE;
- else
- tmp |= RADEON_LIGHT_IN_MODELSPACE;
-
-
- /* Leave this test disabled: (unexplained q3 lockup) (even with
- new packets)
- */
- if (tmp != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL])
- {
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = tmp;
- }
- }
-
- {
- GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( eye );
- fcmd[EYE_X] = ctx->_EyeZDir[0];
- fcmd[EYE_Y] = ctx->_EyeZDir[1];
- fcmd[EYE_Z] = - ctx->_EyeZDir[2];
- fcmd[EYE_RESCALE_FACTOR] = ctx->_ModelViewInvScale;
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.eye );
- }
-
-
-/* RADEON_STATECHANGE( rmesa, glt ); */
-
- if (ctx->Light.Enabled) {
- GLint p;
- for (p = 0 ; p < MAX_LIGHTS; p++) {
- if (ctx->Light.Light[p].Enabled) {
- struct gl_light *l = &ctx->Light.Light[p];
- GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( lit[p] );
-
- if (l->EyePosition[3] == 0.0) {
- COPY_3FV( &fcmd[LIT_POSITION_X], l->_VP_inf_norm );
- COPY_3FV( &fcmd[LIT_DIRECTION_X], l->_h_inf_norm );
- fcmd[LIT_POSITION_W] = 0;
- fcmd[LIT_DIRECTION_W] = 0;
- } else {
- COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
- fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
- fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
- fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
- fcmd[LIT_DIRECTION_W] = 0;
- }
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
- }
- }
- }
-}
-
-
-void radeonLightfv( GLcontext *ctx, GLenum light,
- GLenum pname, const GLfloat *params )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLint p = light - GL_LIGHT0;
- struct gl_light *l = &ctx->Light.Light[p];
- GLfloat *fcmd = (GLfloat *)rmesa->hw.lit[p].cmd;
-
-
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- update_light_colors( ctx, p );
- break;
-
- case GL_SPOT_DIRECTION:
- /* picked up in update_light */
- break;
-
- case GL_POSITION: {
- /* positions picked up in update_light, but can do flag here */
- GLuint flag = (p&1)? RADEON_LIGHT_1_IS_LOCAL : RADEON_LIGHT_0_IS_LOCAL;
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
-
- RADEON_STATECHANGE(rmesa, tcl);
- if (l->EyePosition[3] != 0.0F)
- rmesa->hw.tcl.cmd[idx] |= flag;
- else
- rmesa->hw.tcl.cmd[idx] &= ~flag;
- break;
- }
-
- case GL_SPOT_EXPONENT:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_SPOT_EXPONENT] = params[0];
- break;
-
- case GL_SPOT_CUTOFF: {
- GLuint flag = (p&1) ? RADEON_LIGHT_1_IS_SPOT : RADEON_LIGHT_0_IS_SPOT;
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
-
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_SPOT_CUTOFF] = l->_CosCutoff;
-
- RADEON_STATECHANGE(rmesa, tcl);
- if (l->SpotCutoff != 180.0F)
- rmesa->hw.tcl.cmd[idx] |= flag;
- else
- rmesa->hw.tcl.cmd[idx] &= ~flag;
- break;
- }
-
- case GL_CONSTANT_ATTENUATION:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_CONST] = params[0];
- break;
- case GL_LINEAR_ATTENUATION:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_LINEAR] = params[0];
- break;
- case GL_QUADRATIC_ATTENUATION:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_QUADRATIC] = params[0];
- break;
- default:
- return;
- }
-
-}
-
-
-
-
-void radeonLightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *param )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- update_global_ambient( ctx );
- break;
-
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- RADEON_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.LocalViewer)
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LOCAL_VIEWER;
- else
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LOCAL_VIEWER;
- break;
-
- case GL_LIGHT_MODEL_TWO_SIDE:
- RADEON_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.TwoSide)
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_LIGHT_TWOSIDE;
- else
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_LIGHT_TWOSIDE;
-
- check_twoside_fallback( ctx );
-
-#if _HAVE_SWTNL
- if (rmesa->TclFallback) {
- radeonChooseRenderState( ctx );
- radeonChooseVertexState( ctx );
- }
-#endif
- break;
-
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- radeonUpdateSpecular(ctx);
-
- RADEON_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &=
- ~RADEON_DIFFUSE_SPECULAR_COMBINE;
- else
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |=
- RADEON_DIFFUSE_SPECULAR_COMBINE;
- break;
-
- default:
- break;
- }
-}
-
-
-/* =============================================================
- * Fog
- */
-
-
-static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- union { int i; float f; } c, d;
- GLchan col[4];
-
- c.i = rmesa->hw.fog.cmd[FOG_C];
- d.i = rmesa->hw.fog.cmd[FOG_D];
-
- switch (pname) {
- case GL_FOG_MODE:
- if (!ctx->Fog.Enabled)
- return;
- RADEON_STATECHANGE(rmesa, tcl);
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_TCL_FOG_MASK;
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_LINEAR;
- if (ctx->Fog.Start == ctx->Fog.End) {
- c.f = 1.0F;
- d.f = 1.0F;
- }
- else {
- c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start);
- }
- break;
- case GL_EXP:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP;
- c.f = 0.0;
- d.f = ctx->Fog.Density;
- break;
- case GL_EXP2:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP2;
- c.f = 0.0;
- d.f = -(ctx->Fog.Density * ctx->Fog.Density);
- break;
- default:
- return;
- }
- break;
- case GL_FOG_DENSITY:
- switch (ctx->Fog.Mode) {
- case GL_EXP:
- c.f = 0.0;
- d.f = ctx->Fog.Density;
- break;
- case GL_EXP2:
- c.f = 0.0;
- d.f = -(ctx->Fog.Density * ctx->Fog.Density);
- break;
- default:
- break;
- }
- break;
- case GL_FOG_START:
- case GL_FOG_END:
- if (ctx->Fog.Mode == GL_LINEAR) {
- if (ctx->Fog.Start == ctx->Fog.End) {
- c.f = 1.0F;
- d.f = 1.0F;
- } else {
- c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start);
- }
- }
- break;
- case GL_FOG_COLOR:
- RADEON_STATECHANGE( rmesa, ctx );
- UNCLAMPED_FLOAT_TO_RGB_CHAN( col, ctx->Fog.Color );
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] =
- radeonPackColor( 4, col[0], col[1], col[2], 0 );
- break;
- case GL_FOG_COORDINATE_SOURCE_EXT:
- /* What to do?
- */
- break;
- default:
- return;
- }
-
- if (c.i != rmesa->hw.fog.cmd[FOG_C] || d.i != rmesa->hw.fog.cmd[FOG_D]) {
- RADEON_STATECHANGE( rmesa, fog );
- rmesa->hw.fog.cmd[FOG_C] = c.i;
- rmesa->hw.fog.cmd[FOG_D] = d.i;
- }
-}
-
-/* Examine lighting and texture state to determine if separate specular
- * should be enabled.
- */
-void radeonUpdateSpecular( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
-
- if (NEED_SECONDARY_COLOR(ctx)) {
- p |= RADEON_SPECULAR_ENABLE;
- } else {
- p &= ~RADEON_SPECULAR_ENABLE;
- }
-
- if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) {
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p;
- }
-
- /* Bizzare: have to leave lighting enabled to get fog.
- */
- RADEON_STATECHANGE( rmesa, tcl );
- if ((ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- }
- else if (ctx->Fog.Enabled) {
- if (ctx->Light.Enabled) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- } else {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- }
- }
- else if (ctx->Light.Enabled) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- } else if (ctx->Fog.ColorSumEnabled ) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE;
- } else {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE;
- }
-
-#if _HAVE_SWTNL
- /* Update vertex/render formats
- */
- if (rmesa->TclFallback) {
- radeonChooseRenderState( ctx );
- radeonChooseVertexState( ctx );
- }
-#endif
-}
-
-
-
-static void radeonLightingSpaceChange( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLboolean tmp;
- RADEON_STATECHANGE( rmesa, tcl );
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d\n", __FUNCTION__, ctx->_NeedEyeCoords);
-
- if (ctx->_NeedEyeCoords)
- tmp = ctx->Transform.RescaleNormals;
- else
- tmp = !ctx->Transform.RescaleNormals;
-
- if ( tmp ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_RESCALE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
- }
-}
-
-void radeonInitLightStateFuncs( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int i;
-
- ctx->Driver.LightModelfv = radeonLightModelfv;
- ctx->Driver.Lightfv = radeonLightfv;
- ctx->Driver.Fogfv = radeonFogfv;
- ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange;
-
- for (i = 0 ; i < 8; i++) {
- struct gl_light *l = &ctx->Light.Light[i];
- GLenum p = GL_LIGHT0 + i;
- *(float *)&(rmesa->hw.lit[i].cmd[LIT_RANGE_CUTOFF]) = FLT_MAX;
-
- ctx->Driver.Lightfv( ctx, p, GL_AMBIENT, l->Ambient );
- ctx->Driver.Lightfv( ctx, p, GL_DIFFUSE, l->Diffuse );
- ctx->Driver.Lightfv( ctx, p, GL_SPECULAR, l->Specular );
- ctx->Driver.Lightfv( ctx, p, GL_POSITION, 0 );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_DIRECTION, 0 );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_EXPONENT, &l->SpotExponent );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
- ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
- &l->ConstantAttenuation );
- ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
- &l->LinearAttenuation );
- ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
- &l->QuadraticAttenuation );
- }
-
- ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
- ctx->Light.Model.Ambient );
-
- ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 );
- ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
- ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start );
- ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
- ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
- ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, 0 );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.c
deleted file mode 100644
index bb121fc58..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v 1.5 2002/10/30 12:51:55 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#include "glheader.h"
-#include "radeon_context.h"
-#include "radeon_lock.h"
-#include "radeon_tex.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-
-#if DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-/* Turn on/off page flipping according to the flags in the sarea:
- */
-static void
-radeonUpdatePageFlipping( radeonContextPtr rmesa )
-{
- int use_back;
-
-
- rmesa->doPageFlip = rmesa->sarea->pfState;
-
- use_back = (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
- use_back ^= (rmesa->sarea->pfCurrentPage == 1);
-
- if ( RADEON_DEBUG & DEBUG_VERBOSE )
- fprintf(stderr, "%s allow %d current %d\n", __FUNCTION__,
- rmesa->doPageFlip,
- rmesa->sarea->pfCurrentPage );
-
- if ( use_back ) {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
- }
-
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
- + rmesa->radeonScreen->fbLocation;
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
-}
-
-
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- __DRIscreenPrivate *sPriv = rmesa->dri.screen;
- drm_radeon_sarea_t *sarea = rmesa->sarea;
-
- drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( rmesa->lastStamp != dPriv->lastStamp ) {
- radeonUpdatePageFlipping( rmesa );
- if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
- radeonSetCliprects( rmesa, GL_BACK_LEFT );
- else
- radeonSetCliprects( rmesa, GL_FRONT_LEFT );
- radeonUpdateViewportOffset( rmesa->glCtx );
- rmesa->lastStamp = dPriv->lastStamp;
- }
-
- RADEON_STATECHANGE( rmesa, ctx );
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= RADEON_COLOR_TILE_ENABLE;
- }
- else rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] &= ~RADEON_COLOR_TILE_ENABLE;
-
- if ( sarea->ctx_owner != rmesa->dri.hwContext ) {
- int i;
- sarea->ctx_owner = rmesa->dri.hwContext;
-
- for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) {
- DRI_AGE_TEXTURES( rmesa->texture_heaps[ i ] );
- }
- }
-
- rmesa->lost_context = GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.h
deleted file mode 100644
index 4e8617eb8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_lock.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h,v 1.3 2002/10/30 12:51:55 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifndef __RADEON_LOCK_H__
-#define __RADEON_LOCK_H__
-
-extern void radeonGetLock( radeonContextPtr rmesa, GLuint flags );
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( rmesa ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( rmesa->dri.hwLock, rmesa->dri.hwContext, \
- (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret ); \
- if ( __ret ) \
- radeonGetLock( rmesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-#define UNLOCK_HARDWARE( rmesa ) \
- do { \
- DRM_UNLOCK( rmesa->dri.fd, \
- rmesa->dri.hwLock, \
- rmesa->dri.hwContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-#endif /* __RADEON_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.c
deleted file mode 100644
index c62edd715..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.c
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-/* If using new packets, can choose either verts or arrays.
- * Otherwise, must use verts.
- */
-#include "radeon_context.h"
-#define RADEON_MAOS_VERTS 1
-#if (RADEON_MAOS_VERTS) || (RADEON_OLD_PACKETS)
-#include "radeon_maos_verts.c"
-#else
-#include "radeon_maos_arrays.c"
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.h
deleted file mode 100644
index 09039d684..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h,v 1.1 2002/10/30 12:51:55 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Grahpics Inc., Austin, 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, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_MAOS_H__
-#define __RADEON_MAOS_H__
-
-#include "radeon_context.h"
-
-extern void radeonEmitArrays( GLcontext *ctx, GLuint inputs );
-extern void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
deleted file mode 100644
index 98f66898c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "macros.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "math/m_translate.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_swtcl.h"
-#include "radeon_maos.h"
-
-#if 0
-/* Usage:
- * - from radeon_tcl_render
- * - call radeonEmitArrays to ensure uptodate arrays in dma
- * - emit primitives (new type?) which reference the data
- * -- need to use elts for lineloop, quads, quadstrip/flat
- * -- other primitives are all well-formed (need tristrip-1,fake-poly)
- *
- */
-static void emit_ubyte_rgba3( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- radeon_color_t *out = (radeon_color_t *)(rvb->start + rvb->address);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d out %p\n",
- __FUNCTION__, count, stride, (void *)out);
-
- for (i = 0; i < count; i++) {
- out->red = *data;
- out->green = *(data+1);
- out->blue = *(data+2);
- out->alpha = 0xFF;
- out++;
- data += stride;
- }
-}
-
-static void emit_ubyte_rgba4( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 4)
- COPY_DWORDS( out, data, count );
- else
- for (i = 0; i < count; i++) {
- *out++ = LE32_TO_CPU(*(int *)data);
- data += stride;
- }
-}
-
-
-static void emit_ubyte_rgba( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int size,
- int stride,
- int count )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
-
- assert (!rvb->buf);
-
- if (stride == 0) {
- radeonAllocDmaRegion( rmesa, rvb, 4, 4 );
- count = 1;
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = 1;
- }
- else {
- radeonAllocDmaRegion( rmesa, rvb, 4 * count, 4 ); /* alignment? */
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 1;
- rvb->aos_size = 1;
- }
-
- /* Emit the data
- */
- switch (size) {
- case 3:
- emit_ubyte_rgba3( ctx, rvb, data, stride, count );
- break;
- case 4:
- emit_ubyte_rgba4( ctx, rvb, data, stride, count );
- break;
- default:
- assert(0);
- exit(1);
- break;
- }
-}
-#endif
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
- : "0" (nr), \
- "D" ((long)dst), \
- "S" ((long)src) ); \
-} while (0)
-#else
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int j; \
- for ( j = 0 ; j < nr ; j++ ) \
- dst[j] = ((int *)src)[j]; \
- dst += nr; \
-} while (0)
-#endif
-
-
-static void emit_vec4( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 4)
- COPY_DWORDS( out, data, count );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out++;
- data += stride;
- }
-}
-
-
-static void emit_vec8( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 8)
- COPY_DWORDS( out, data, count*2 );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out += 2;
- data += stride;
- }
-}
-
-static void emit_vec12( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d out %p data %p\n",
- __FUNCTION__, count, stride, (void *)out, (void *)data);
-
- if (stride == 12)
- COPY_DWORDS( out, data, count*3 );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out[2] = *(int *)(data+8);
- out += 3;
- data += stride;
- }
-}
-
-static void emit_vec16( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- if (stride == 16)
- COPY_DWORDS( out, data, count*4 );
- else
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out[2] = *(int *)(data+8);
- out[3] = *(int *)(data+12);
- out += 4;
- data += stride;
- }
-}
-
-
-static void emit_vector( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int size,
- int stride,
- int count )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d size %d stride %d\n",
- __FUNCTION__, count, size, stride);
-
- assert (!rvb->buf);
-
- if (stride == 0) {
- radeonAllocDmaRegion( rmesa, rvb, size * 4, 4 );
- count = 1;
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = size;
- }
- else {
- radeonAllocDmaRegion( rmesa, rvb, size * count * 4, 4 ); /* alignment? */
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = size;
- rvb->aos_size = size;
- }
-
- /* Emit the data
- */
- switch (size) {
- case 1:
- emit_vec4( ctx, rvb, data, stride, count );
- break;
- case 2:
- emit_vec8( ctx, rvb, data, stride, count );
- break;
- case 3:
- emit_vec12( ctx, rvb, data, stride, count );
- break;
- case 4:
- emit_vec16( ctx, rvb, data, stride, count );
- break;
- default:
- assert(0);
- exit(1);
- break;
- }
-
-}
-
-
-
-static void emit_s0_vec( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = 0;
- out += 2;
- data += stride;
- }
-}
-
-static void emit_stq_vec( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int stride,
- int count )
-{
- int i;
- int *out = (int *)(rvb->address + rvb->start);
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s count %d stride %d\n",
- __FUNCTION__, count, stride);
-
- for (i = 0; i < count; i++) {
- out[0] = *(int *)data;
- out[1] = *(int *)(data+4);
- out[2] = *(int *)(data+12);
- out += 3;
- data += stride;
- }
-}
-
-
-
-
-static void emit_tex_vector( GLcontext *ctx,
- struct radeon_dma_region *rvb,
- char *data,
- int size,
- int stride,
- int count )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int emitsize;
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
-
- assert (!rvb->buf);
-
- switch (size) {
- case 4: emitsize = 3; break;
- default: emitsize = 2; break;
- }
-
-
- if (stride == 0) {
- radeonAllocDmaRegion( rmesa, rvb, 4 * emitsize, 4 );
- count = 1;
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = 0;
- rvb->aos_size = emitsize;
- }
- else {
- radeonAllocDmaRegion( rmesa, rvb, 4 * emitsize * count, 4 );
- rvb->aos_start = GET_START(rvb);
- rvb->aos_stride = emitsize;
- rvb->aos_size = emitsize;
- }
-
-
- /* Emit the data
- */
- switch (size) {
- case 1:
- emit_s0_vec( ctx, rvb, data, stride, count );
- break;
- case 2:
- emit_vec8( ctx, rvb, data, stride, count );
- break;
- case 3:
- emit_vec8( ctx, rvb, data, stride, count );
- break;
- case 4:
- emit_stq_vec( ctx, rvb, data, stride, count );
- break;
- default:
- assert(0);
- exit(1);
- break;
- }
-}
-
-
-
-
-/* Emit any changed arrays to new GART memory, re-emit a packet to
- * update the arrays.
- */
-void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
- struct radeon_dma_region **component = rmesa->tcl.aos_components;
- GLuint nr = 0;
- GLuint vfmt = 0;
- GLuint count = VB->Count;
- GLuint vtx;
-
-#if 0
- if (RADEON_DEBUG & DEBUG_VERTS)
- _tnl_print_vert_flags( __FUNCTION__, inputs );
-#endif
-
- if (1) {
- if (!rmesa->tcl.obj.buf)
- emit_vector( ctx,
- &rmesa->tcl.obj,
- (char *)VB->ObjPtr->data,
- VB->ObjPtr->size,
- VB->ObjPtr->stride,
- count);
-
- switch( VB->ObjPtr->size ) {
- case 4: vfmt |= RADEON_CP_VC_FRMT_W0;
- case 3: vfmt |= RADEON_CP_VC_FRMT_Z;
- case 2: vfmt |= RADEON_CP_VC_FRMT_XY;
- default:
- break;
- }
- component[nr++] = &rmesa->tcl.obj;
- }
-
-
- if (inputs & VERT_BIT_NORMAL) {
- if (!rmesa->tcl.norm.buf)
- emit_vector( ctx,
- &(rmesa->tcl.norm),
- (char *)VB->NormalPtr->data,
- 3,
- VB->NormalPtr->stride,
- count);
-
- vfmt |= RADEON_CP_VC_FRMT_N0;
- component[nr++] = &rmesa->tcl.norm;
- }
-
- if (inputs & VERT_BIT_COLOR0) {
- int emitsize;
- if (VB->ColorPtr[0]->size == 4 &&
- (VB->ColorPtr[0]->stride != 0 ||
- VB->ColorPtr[0]->data[0][3] != 1.0)) {
- vfmt |= RADEON_CP_VC_FRMT_FPCOLOR | RADEON_CP_VC_FRMT_FPALPHA;
- emitsize = 4;
- }
-
- else {
- vfmt |= RADEON_CP_VC_FRMT_FPCOLOR;
- emitsize = 3;
- }
-
- if (!rmesa->tcl.rgba.buf)
- emit_vector( ctx,
- &(rmesa->tcl.rgba),
- (char *)VB->ColorPtr[0]->data,
- emitsize,
- VB->ColorPtr[0]->stride,
- count);
-
-
- component[nr++] = &rmesa->tcl.rgba;
- }
-
-
- if (inputs & VERT_BIT_COLOR1) {
- if (!rmesa->tcl.spec.buf) {
-
- emit_vector( ctx,
- &rmesa->tcl.spec,
- (char *)VB->SecondaryColorPtr[0]->data,
- 3,
- VB->SecondaryColorPtr[0]->stride,
- count);
- }
-
- vfmt |= RADEON_CP_VC_FRMT_FPSPEC;
- component[nr++] = &rmesa->tcl.spec;
- }
-
- vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
- ~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1));
-
- if (inputs & VERT_BIT_TEX0) {
- if (!rmesa->tcl.tex[0].buf)
- emit_tex_vector( ctx,
- &(rmesa->tcl.tex[0]),
- (char *)VB->TexCoordPtr[0]->data,
- VB->TexCoordPtr[0]->size,
- VB->TexCoordPtr[0]->stride,
- count );
-
- switch( VB->TexCoordPtr[0]->size ) {
- case 4:
- vtx |= RADEON_TCL_VTX_Q0;
- vfmt |= RADEON_CP_VC_FRMT_Q0;
- default:
- vfmt |= RADEON_CP_VC_FRMT_ST0;
- }
- component[nr++] = &rmesa->tcl.tex[0];
- }
-
- if (inputs & VERT_BIT_TEX1) {
- if (!rmesa->tcl.tex[1].buf)
- emit_tex_vector( ctx,
- &(rmesa->tcl.tex[1]),
- (char *)VB->TexCoordPtr[1]->data,
- VB->TexCoordPtr[1]->size,
- VB->TexCoordPtr[1]->stride,
- count );
-
- switch( VB->TexCoordPtr[1]->size ) {
- case 4:
- vtx |= RADEON_TCL_VTX_Q1;
- vfmt |= RADEON_CP_VC_FRMT_Q1;
- default:
- vfmt |= RADEON_CP_VC_FRMT_ST1;
- }
- component[nr++] = &rmesa->tcl.tex[1];
- }
-
- if (vtx != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT]) {
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
- }
-
- rmesa->tcl.nr_aos_components = nr;
- rmesa->tcl.vertex_format = vfmt;
-}
-
-
-void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
-#if 0
- if (RADEON_DEBUG & DEBUG_VERTS)
- _tnl_print_vert_flags( __FUNCTION__, newinputs );
-#endif
-
- if (newinputs & VERT_BIT_POS)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_NORMAL)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_COLOR0)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.rgba, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_COLOR1)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.spec, __FUNCTION__ );
-
- if (newinputs & VERT_BIT_TEX0)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.tex[0], __FUNCTION__ );
-
- if (newinputs & VERT_BIT_TEX1)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.tex[1], __FUNCTION__ );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
deleted file mode 100644
index c16234a94..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.1
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-#undef TCL_DEBUG
-#ifndef TCL_DEBUG
-#define TCL_DEBUG 0
-#endif
-
-static void TAG(emit)( GLcontext *ctx,
- GLuint start, GLuint end,
- void *dest )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint (*tc0)[4], (*tc1)[4], (*tc2)[4];
- GLfloat (*col)[4], (*spec)[4];
- GLfloat (*fog)[4];
- GLuint (*norm)[4];
- GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride;
- GLuint tc2_stride, norm_stride;
- GLuint fill_tex = 0;
- GLuint (*coord)[4];
- GLuint coord_stride; /* object coordinates */
- GLubyte dummy[4];
- int i;
-
- union emit_union *v = (union emit_union *)dest;
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- coord = (GLuint (*)[4])VB->ObjPtr->data;
- coord_stride = VB->ObjPtr->stride;
-
- if (DO_TEX2) {
- if (VB->TexCoordPtr[2]) {
- const GLuint t2 = GET_TEXSOURCE(2);
- tc2 = (GLuint (*)[4])VB->TexCoordPtr[t2]->data;
- tc2_stride = VB->TexCoordPtr[t2]->stride;
- if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) {
- fill_tex |= (1<<2);
- }
- } else {
- tc2 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX2];
- tc2_stride = 0;
- }
- }
-
- if (DO_TEX1) {
- if (VB->TexCoordPtr[1]) {
- const GLuint t1 = GET_TEXSOURCE(1);
- tc1 = (GLuint (*)[4])VB->TexCoordPtr[t1]->data;
- tc1_stride = VB->TexCoordPtr[t1]->stride;
- if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) {
- fill_tex |= (1<<1);
- }
- } else {
- tc1 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX1];
- tc1_stride = 0;
- }
- }
-
- if (DO_TEX0) {
- if (VB->TexCoordPtr[0]) {
- const GLuint t0 = GET_TEXSOURCE(0);
- tc0_stride = VB->TexCoordPtr[t0]->stride;
- tc0 = (GLuint (*)[4])VB->TexCoordPtr[t0]->data;
- if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) {
- fill_tex |= (1<<0);
- }
- } else {
- tc0 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX0];
- tc0_stride = 0;
- }
-
- }
-
- if (DO_NORM) {
- if (VB->NormalPtr) {
- norm_stride = VB->NormalPtr->stride;
- norm = (GLuint (*)[4])VB->NormalPtr->data;
- } else {
- norm_stride = 0;
- norm = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
- }
- }
-
- if (DO_RGBA) {
- if (VB->ColorPtr[0]) {
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
- } else {
- col = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
- col_stride = 0;
- }
- }
-
- if (DO_SPEC) {
- if (VB->SecondaryColorPtr[0]) {
- spec = VB->SecondaryColorPtr[0]->data;
- spec_stride = VB->SecondaryColorPtr[0]->stride;
- } else {
- spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
- spec_stride = 0;
- }
- }
-
- if (DO_FOG) {
- if (VB->FogCoordPtr) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
- } else {
- fog = (GLfloat (*)[4])&dummy; fog[0][0] = 0.0F;
- fog_stride = 0;
- }
- }
-
-
- if (start) {
- coord = (GLuint (*)[4])((GLubyte *)coord + start * coord_stride);
- if (DO_TEX0)
- tc0 = (GLuint (*)[4])((GLubyte *)tc0 + start * tc0_stride);
- if (DO_TEX1)
- tc1 = (GLuint (*)[4])((GLubyte *)tc1 + start * tc1_stride);
- if (DO_TEX2)
- tc2 = (GLuint (*)[4])((GLubyte *)tc2 + start * tc2_stride);
- if (DO_NORM)
- norm = (GLuint (*)[4])((GLubyte *)norm + start * norm_stride);
- if (DO_RGBA)
- STRIDE_4F(col, start * col_stride);
- if (DO_SPEC)
- STRIDE_4F(spec, start * spec_stride);
- if (DO_FOG)
- STRIDE_4F(fog, start * fog_stride);
- }
-
-
- {
- for (i=start; i < end; i++) {
-
- v[0].ui = coord[0][0];
- v[1].ui = coord[0][1];
- v[2].ui = coord[0][2];
- if (DO_W) {
- v[3].ui = coord[0][3];
- v += 4;
- }
- else
- v += 3;
- coord = (GLuint (*)[4])((GLubyte *)coord + coord_stride);
-
- if (DO_NORM) {
- v[0].ui = norm[0][0];
- v[1].ui = norm[0][1];
- v[2].ui = norm[0][2];
- v += 3;
- norm = (GLuint (*)[4])((GLubyte *)norm + norm_stride);
- }
- if (DO_RGBA) {
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.red, col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.green, col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.blue, col[0][2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.alpha, col[0][3]);
- STRIDE_4F(col, col_stride);
- v++;
- }
- if (DO_SPEC || DO_FOG) {
- if (DO_SPEC) {
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.red, spec[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.green, spec[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.blue, spec[0][2]);
- STRIDE_4F(spec, spec_stride);
- }
- if (DO_FOG) {
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.alpha, fog[0][0]);
- fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
- }
- if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui);
- v++;
- }
- if (DO_TEX0) {
- v[0].ui = tc0[0][0];
- v[1].ui = tc0[0][1];
- if (TCL_DEBUG) fprintf(stderr, "t0: %.2f %.2f ", v[0].f, v[1].f);
- if (DO_PTEX) {
- if (fill_tex & (1<<0))
- v[2].f = 1.0;
- else
- v[2].ui = tc0[0][3];
- if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
- v += 3;
- }
- else
- v += 2;
- tc0 = (GLuint (*)[4])((GLubyte *)tc0 + tc0_stride);
- }
- if (DO_TEX1) {
- v[0].ui = tc1[0][0];
- v[1].ui = tc1[0][1];
- if (TCL_DEBUG) fprintf(stderr, "t1: %.2f %.2f ", v[0].f, v[1].f);
- if (DO_PTEX) {
- if (fill_tex & (1<<1))
- v[2].f = 1.0;
- else
- v[2].ui = tc1[0][3];
- if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
- v += 3;
- }
- else
- v += 2;
- tc1 = (GLuint (*)[4])((GLubyte *)tc1 + tc1_stride);
- }
- if (DO_TEX2) {
- v[0].ui = tc2[0][0];
- v[1].ui = tc2[0][1];
- if (DO_PTEX) {
- if (fill_tex & (1<<2))
- v[2].f = 1.0;
- else
- v[2].ui = tc2[0][3];
- v += 3;
- }
- else
- v += 2;
- tc2 = (GLuint (*)[4])((GLubyte *)tc2 + tc2_stride);
- }
- if (TCL_DEBUG) fprintf(stderr, "\n");
- }
- }
-}
-
-
-
-static void TAG(init)( void )
-{
- int sz = 3;
- if (DO_W) sz++;
- if (DO_NORM) sz += 3;
- if (DO_RGBA) sz++;
- if (DO_SPEC || DO_FOG) sz++;
- if (DO_TEX0) sz += 2;
- if (DO_TEX0 && DO_PTEX) sz++;
- if (DO_TEX1) sz += 2;
- if (DO_TEX1 && DO_PTEX) sz++;
- if (DO_TEX2) sz += 2;
- if (DO_TEX2 && DO_PTEX) sz++;
-
- setup_tab[IDX].emit = TAG(emit);
- setup_tab[IDX].vertex_format = IND;
- setup_tab[IDX].vertex_size = sz;
-}
-
-
-#undef IND
-#undef TAG
-#undef IDX
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_verts.c
deleted file mode 100644
index 8cb08a812..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_maos_verts.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Austin, 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, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-
-#include "array_cache/acache.h"
-#include "math/m_translate.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "math/m_translate.h"
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_tex.h"
-#include "radeon_tcl.h"
-#include "radeon_swtcl.h"
-#include "radeon_maos.h"
-
-
-#define RADEON_TCL_MAX_SETUP 13
-
-union emit_union { float f; GLuint ui; radeon_color_t rgba; };
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void * );
- GLuint vertex_size;
- GLuint vertex_format;
-} setup_tab[RADEON_TCL_MAX_SETUP];
-
-#define DO_W (IND & RADEON_CP_VC_FRMT_W0)
-#define DO_RGBA (IND & RADEON_CP_VC_FRMT_PKCOLOR)
-#define DO_SPEC (IND & RADEON_CP_VC_FRMT_PKSPEC)
-#define DO_FOG (IND & RADEON_CP_VC_FRMT_PKSPEC)
-#define DO_TEX0 (IND & RADEON_CP_VC_FRMT_ST0)
-#define DO_TEX1 (IND & RADEON_CP_VC_FRMT_ST1)
-#define DO_PTEX (IND & RADEON_CP_VC_FRMT_Q0)
-#define DO_NORM (IND & RADEON_CP_VC_FRMT_N0)
-
-#define DO_TEX2 0
-#define DO_TEX3 0
-
-#define GET_TEXSOURCE(n) n
-
-/***********************************************************************
- * Generate vertex emit functions *
- ***********************************************************************/
-
-
-/* Defined in order of increasing vertex size:
- */
-#define IDX 0
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR)
-#define TAG(x) x##_rgba
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 1
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_n
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 2
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_ST0)
-#define TAG(x) x##_rgba_st
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 3
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_rgba_n
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 4
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_st_n
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 5
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_ST1)
-#define TAG(x) x##_rgba_st_st
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 6
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_rgba_st_n
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 7
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_PKSPEC| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_ST1)
-#define TAG(x) x##_rgba_spec_st_st
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 8
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_ST1| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_st_st_n
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 9
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_PKSPEC| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_ST1| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_rgba_spec_st_st_n
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 10
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_Q0)
-#define TAG(x) x##_rgba_stq
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 11
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_ST1| \
- RADEON_CP_VC_FRMT_Q1| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_Q0)
-#define TAG(x) x##_rgba_stq_stq
-#include "radeon_maos_vbtmp.h"
-
-#define IDX 12
-#define IND (RADEON_CP_VC_FRMT_XY| \
- RADEON_CP_VC_FRMT_Z| \
- RADEON_CP_VC_FRMT_W0| \
- RADEON_CP_VC_FRMT_PKCOLOR| \
- RADEON_CP_VC_FRMT_PKSPEC| \
- RADEON_CP_VC_FRMT_ST0| \
- RADEON_CP_VC_FRMT_Q0| \
- RADEON_CP_VC_FRMT_ST1| \
- RADEON_CP_VC_FRMT_Q1| \
- RADEON_CP_VC_FRMT_N0)
-#define TAG(x) x##_w_rgba_spec_stq_stq_n
-#include "radeon_maos_vbtmp.h"
-
-
-
-
-
-/***********************************************************************
- * Initialization
- ***********************************************************************/
-
-
-static void init_tcl_verts( void )
-{
- init_rgba();
- init_n();
- init_rgba_n();
- init_rgba_st();
- init_st_n();
- init_rgba_st_st();
- init_rgba_st_n();
- init_rgba_spec_st_st();
- init_st_st_n();
- init_rgba_spec_st_st_n();
- init_rgba_stq();
- init_rgba_stq_stq();
- init_w_rgba_spec_stq_stq_n();
-}
-
-
-void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint req = 0;
- GLuint vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
- ~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1));
- int i;
- static int firsttime = 1;
-
- if (firsttime) {
- init_tcl_verts();
- firsttime = 0;
- }
-
- if (1) {
- req |= RADEON_CP_VC_FRMT_Z;
- if (VB->ObjPtr->size == 4) {
- req |= RADEON_CP_VC_FRMT_W0;
- }
- }
-
- if (inputs & VERT_BIT_NORMAL) {
- req |= RADEON_CP_VC_FRMT_N0;
- }
-
- if (inputs & VERT_BIT_COLOR0) {
- req |= RADEON_CP_VC_FRMT_PKCOLOR;
- }
-
- if (inputs & VERT_BIT_COLOR1) {
- req |= RADEON_CP_VC_FRMT_PKSPEC;
- }
-
- if (inputs & VERT_BIT_TEX0) {
- req |= RADEON_CP_VC_FRMT_ST0;
-
- if (VB->TexCoordPtr[0]->size == 4) {
- req |= RADEON_CP_VC_FRMT_Q0;
- vtx |= RADEON_TCL_VTX_Q0;
- }
- }
-
- if (inputs & VERT_BIT_TEX1) {
- req |= RADEON_CP_VC_FRMT_ST1;
-
- if (VB->TexCoordPtr[1]->size == 4) {
- req |= RADEON_CP_VC_FRMT_Q1;
- vtx |= RADEON_TCL_VTX_Q1;
- }
- }
-
- if (vtx != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT]) {
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
- }
-
- for (i = 0 ; i < RADEON_TCL_MAX_SETUP ; i++)
- if ((setup_tab[i].vertex_format & req) == req)
- break;
-
- if (rmesa->tcl.vertex_format == setup_tab[i].vertex_format &&
- rmesa->tcl.indexed_verts.buf)
- return;
-
- if (rmesa->tcl.indexed_verts.buf)
- radeonReleaseArrays( ctx, ~0 );
-
- radeonAllocDmaRegionVerts( rmesa,
- &rmesa->tcl.indexed_verts,
- VB->Count,
- setup_tab[i].vertex_size * 4,
- 4);
-
- /* The vertex code expects Obj to be clean to element 3. To fix
- * this, add more vertex code (for obj-2, obj-3) or preferably move
- * to maos.
- */
- if (VB->ObjPtr->size < 3 ||
- (VB->ObjPtr->size == 3 &&
- (setup_tab[i].vertex_format & RADEON_CP_VC_FRMT_W0))) {
-
- _math_trans_4f( rmesa->tcl.ObjClean.data,
- VB->ObjPtr->data,
- VB->ObjPtr->stride,
- GL_FLOAT,
- VB->ObjPtr->size,
- 0,
- VB->Count );
-
- switch (VB->ObjPtr->size) {
- case 1:
- _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 1);
- case 2:
- _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 2);
- case 3:
- if (setup_tab[i].vertex_format & RADEON_CP_VC_FRMT_W0) {
- _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 3);
- }
- case 4:
- default:
- break;
- }
-
- VB->ObjPtr = &rmesa->tcl.ObjClean;
- }
-
-
-
- setup_tab[i].emit( ctx, 0, VB->Count,
- rmesa->tcl.indexed_verts.address +
- rmesa->tcl.indexed_verts.start );
-
- rmesa->tcl.vertex_format = setup_tab[i].vertex_format;
- rmesa->tcl.indexed_verts.aos_start = GET_START( &rmesa->tcl.indexed_verts );
- rmesa->tcl.indexed_verts.aos_size = setup_tab[i].vertex_size;
- rmesa->tcl.indexed_verts.aos_stride = setup_tab[i].vertex_size;
-
- rmesa->tcl.aos_components[0] = &rmesa->tcl.indexed_verts;
- rmesa->tcl.nr_aos_components = 1;
-}
-
-
-
-void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
-#if 0
- if (RADEON_DEBUG & DEBUG_VERTS)
- _tnl_print_vert_flags( __FUNCTION__, newinputs );
-#endif
-
- if (newinputs)
- radeonReleaseDmaRegion( rmesa, &rmesa->tcl.indexed_verts, __FUNCTION__ );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.c
deleted file mode 100644
index 84112464e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.c
+++ /dev/null
@@ -1,1070 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc, Cedar Park, TX.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-#include <errno.h>
-
-#include "glheader.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_sanity.h"
-
-/* Set this '1' to get more verbiage.
- */
-#define MORE_VERBOSE 1
-
-#if MORE_VERBOSE
-#define VERBOSE (RADEON_DEBUG & DEBUG_VERBOSE)
-#define NORMAL (1)
-#else
-#define VERBOSE 0
-#define NORMAL (RADEON_DEBUG & DEBUG_VERBOSE)
-#endif
-
-
-/* New (1.3) state mechanism. 3 commands (packet, scalar, vector) in
- * 1.3 cmdbuffers allow all previous state to be updated as well as
- * the tcl scalar and vector areas.
- */
-static struct {
- int start;
- int len;
- const char *name;
-} packet[RADEON_MAX_STATE_PACKETS] = {
- { RADEON_PP_MISC,7,"RADEON_PP_MISC" },
- { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" },
- { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" },
- { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" },
- { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" },
- { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" },
- { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" },
- { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" },
- { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" },
- { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" },
- { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" },
- { RADEON_RE_MISC,1,"RADEON_RE_MISC" },
- { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" },
- { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" },
- { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" },
- { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" },
- { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" },
- { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" },
- { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" },
- { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" },
- { 0, 4, "R200_PP_TXCBLEND_0" },
- { 0, 4, "R200_PP_TXCBLEND_1" },
- { 0, 4, "R200_PP_TXCBLEND_2" },
- { 0, 4, "R200_PP_TXCBLEND_3" },
- { 0, 4, "R200_PP_TXCBLEND_4" },
- { 0, 4, "R200_PP_TXCBLEND_5" },
- { 0, 4, "R200_PP_TXCBLEND_6" },
- { 0, 4, "R200_PP_TXCBLEND_7" },
- { 0, 6, "R200_SE_TCL_LIGHT_MODEL_CTL_0" },
- { 0, 6, "R200_PP_TFACTOR_0" },
- { 0, 4, "R200_SE_VTX_FMT_0" },
- { 0, 1, "R200_SE_VAP_CNTL" },
- { 0, 5, "R200_SE_TCL_MATRIX_SEL_0" },
- { 0, 5, "R200_SE_TCL_TEX_PROC_CTL_2" },
- { 0, 1, "R200_SE_TCL_UCP_VERT_BLEND_CTL" },
- { 0, 6, "R200_PP_TXFILTER_0" },
- { 0, 6, "R200_PP_TXFILTER_1" },
- { 0, 6, "R200_PP_TXFILTER_2" },
- { 0, 6, "R200_PP_TXFILTER_3" },
- { 0, 6, "R200_PP_TXFILTER_4" },
- { 0, 6, "R200_PP_TXFILTER_5" },
- { 0, 1, "R200_PP_TXOFFSET_0" },
- { 0, 1, "R200_PP_TXOFFSET_1" },
- { 0, 1, "R200_PP_TXOFFSET_2" },
- { 0, 1, "R200_PP_TXOFFSET_3" },
- { 0, 1, "R200_PP_TXOFFSET_4" },
- { 0, 1, "R200_PP_TXOFFSET_5" },
- { 0, 1, "R200_SE_VTE_CNTL" },
- { 0, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
- { 0, 1, "R200_PP_TAM_DEBUG3" },
- { 0, 1, "R200_PP_CNTL_X" },
- { 0, 1, "R200_RB3D_DEPTHXY_OFFSET" },
- { 0, 1, "R200_RE_AUX_SCISSOR_CNTL" },
- { 0, 2, "R200_RE_SCISSOR_TL_0" },
- { 0, 2, "R200_RE_SCISSOR_TL_1" },
- { 0, 2, "R200_RE_SCISSOR_TL_2" },
- { 0, 1, "R200_SE_VAP_CNTL_STATUS" },
- { 0, 1, "R200_SE_VTX_STATE_CNTL" },
- { 0, 1, "R200_RE_POINTSIZE" },
- { 0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
- { 0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */
- { 0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */
- { 0, 1, "R200_PP_CUBIC_FACES_1" },
- { 0, 5, "R200_PP_CUBIC_OFFSET_F1_1" },
- { 0, 1, "R200_PP_CUBIC_FACES_2" },
- { 0, 5, "R200_PP_CUBIC_OFFSET_F1_2" },
- { 0, 1, "R200_PP_CUBIC_FACES_3" },
- { 0, 5, "R200_PP_CUBIC_OFFSET_F1_3" },
- { 0, 1, "R200_PP_CUBIC_FACES_4" },
- { 0, 5, "R200_PP_CUBIC_OFFSET_F1_4" },
- { 0, 1, "R200_PP_CUBIC_FACES_5" },
- { 0, 5, "R200_PP_CUBIC_OFFSET_F1_5" },
- { RADEON_PP_TEX_SIZE_0, 2, "RADEON_PP_TEX_SIZE_0" },
- { RADEON_PP_TEX_SIZE_1, 2, "RADEON_PP_TEX_SIZE_1" },
- { RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_2" },
- { 0, 3, "R200_RB3D_BLENDCOLOR" },
- { 0, 1, "R200_SE_TCL_POINT_SPRITE_CNTL" },
- { RADEON_PP_CUBIC_FACES_0, 1, "RADEON_PP_CUBIC_FACES_0" },
- { RADEON_PP_CUBIC_OFFSET_T0_0, 5, "RADEON_PP_CUBIC_OFFSET_T0_0" },
- { RADEON_PP_CUBIC_FACES_1, 1, "RADEON_PP_CUBIC_FACES_1" },
- { RADEON_PP_CUBIC_OFFSET_T1_0, 5, "RADEON_PP_CUBIC_OFFSET_T1_0" },
- { RADEON_PP_CUBIC_FACES_2, 1, "RADEON_PP_CUBIC_FACES_2" },
- { RADEON_PP_CUBIC_OFFSET_T2_0, 5, "RADEON_PP_CUBIC_OFFSET_T2_0" },
- { 0, 2, "R200_PP_TRI_PERF" },
-};
-
-struct reg_names {
- int idx;
- const char *name;
-};
-
-static struct reg_names reg_names[] = {
- { RADEON_PP_MISC, "RADEON_PP_MISC" },
- { RADEON_PP_FOG_COLOR, "RADEON_PP_FOG_COLOR" },
- { RADEON_RE_SOLID_COLOR, "RADEON_RE_SOLID_COLOR" },
- { RADEON_RB3D_BLENDCNTL, "RADEON_RB3D_BLENDCNTL" },
- { RADEON_RB3D_DEPTHOFFSET, "RADEON_RB3D_DEPTHOFFSET" },
- { RADEON_RB3D_DEPTHPITCH, "RADEON_RB3D_DEPTHPITCH" },
- { RADEON_RB3D_ZSTENCILCNTL, "RADEON_RB3D_ZSTENCILCNTL" },
- { RADEON_PP_CNTL, "RADEON_PP_CNTL" },
- { RADEON_RB3D_CNTL, "RADEON_RB3D_CNTL" },
- { RADEON_RB3D_COLOROFFSET, "RADEON_RB3D_COLOROFFSET" },
- { RADEON_RB3D_COLORPITCH, "RADEON_RB3D_COLORPITCH" },
- { RADEON_SE_CNTL, "RADEON_SE_CNTL" },
- { RADEON_SE_COORD_FMT, "RADEON_SE_COORDFMT" },
- { RADEON_SE_CNTL_STATUS, "RADEON_SE_CNTL_STATUS" },
- { RADEON_RE_LINE_PATTERN, "RADEON_RE_LINE_PATTERN" },
- { RADEON_RE_LINE_STATE, "RADEON_RE_LINE_STATE" },
- { RADEON_SE_LINE_WIDTH, "RADEON_SE_LINE_WIDTH" },
- { RADEON_RB3D_STENCILREFMASK, "RADEON_RB3D_STENCILREFMASK" },
- { RADEON_RB3D_ROPCNTL, "RADEON_RB3D_ROPCNTL" },
- { RADEON_RB3D_PLANEMASK, "RADEON_RB3D_PLANEMASK" },
- { RADEON_SE_VPORT_XSCALE, "RADEON_SE_VPORT_XSCALE" },
- { RADEON_SE_VPORT_XOFFSET, "RADEON_SE_VPORT_XOFFSET" },
- { RADEON_SE_VPORT_YSCALE, "RADEON_SE_VPORT_YSCALE" },
- { RADEON_SE_VPORT_YOFFSET, "RADEON_SE_VPORT_YOFFSET" },
- { RADEON_SE_VPORT_ZSCALE, "RADEON_SE_VPORT_ZSCALE" },
- { RADEON_SE_VPORT_ZOFFSET, "RADEON_SE_VPORT_ZOFFSET" },
- { RADEON_RE_MISC, "RADEON_RE_MISC" },
- { RADEON_PP_TXFILTER_0, "RADEON_PP_TXFILTER_0" },
- { RADEON_PP_TXFILTER_1, "RADEON_PP_TXFILTER_1" },
- { RADEON_PP_TXFILTER_2, "RADEON_PP_TXFILTER_2" },
- { RADEON_PP_TXFORMAT_0, "RADEON_PP_TXFORMAT_0" },
- { RADEON_PP_TXFORMAT_1, "RADEON_PP_TXFORMAT_1" },
- { RADEON_PP_TXFORMAT_2, "RADEON_PP_TXFORMAT_2" },
- { RADEON_PP_TXOFFSET_0, "RADEON_PP_TXOFFSET_0" },
- { RADEON_PP_TXOFFSET_1, "RADEON_PP_TXOFFSET_1" },
- { RADEON_PP_TXOFFSET_2, "RADEON_PP_TXOFFSET_2" },
- { RADEON_PP_TXCBLEND_0, "RADEON_PP_TXCBLEND_0" },
- { RADEON_PP_TXCBLEND_1, "RADEON_PP_TXCBLEND_1" },
- { RADEON_PP_TXCBLEND_2, "RADEON_PP_TXCBLEND_2" },
- { RADEON_PP_TXABLEND_0, "RADEON_PP_TXABLEND_0" },
- { RADEON_PP_TXABLEND_1, "RADEON_PP_TXABLEND_1" },
- { RADEON_PP_TXABLEND_2, "RADEON_PP_TXABLEND_2" },
- { RADEON_PP_TFACTOR_0, "RADEON_PP_TFACTOR_0" },
- { RADEON_PP_TFACTOR_1, "RADEON_PP_TFACTOR_1" },
- { RADEON_PP_TFACTOR_2, "RADEON_PP_TFACTOR_2" },
- { RADEON_PP_BORDER_COLOR_0, "RADEON_PP_BORDER_COLOR_0" },
- { RADEON_PP_BORDER_COLOR_1, "RADEON_PP_BORDER_COLOR_1" },
- { RADEON_PP_BORDER_COLOR_2, "RADEON_PP_BORDER_COLOR_2" },
- { RADEON_SE_ZBIAS_FACTOR, "RADEON_SE_ZBIAS_FACTOR" },
- { RADEON_SE_ZBIAS_CONSTANT, "RADEON_SE_ZBIAS_CONSTANT" },
- { RADEON_SE_TCL_OUTPUT_VTX_FMT, "RADEON_SE_TCL_OUTPUT_VTXFMT" },
- { RADEON_SE_TCL_OUTPUT_VTX_SEL, "RADEON_SE_TCL_OUTPUT_VTXSEL" },
- { RADEON_SE_TCL_MATRIX_SELECT_0, "RADEON_SE_TCL_MATRIX_SELECT_0" },
- { RADEON_SE_TCL_MATRIX_SELECT_1, "RADEON_SE_TCL_MATRIX_SELECT_1" },
- { RADEON_SE_TCL_UCP_VERT_BLEND_CTL, "RADEON_SE_TCL_UCP_VERT_BLEND_CTL" },
- { RADEON_SE_TCL_TEXTURE_PROC_CTL, "RADEON_SE_TCL_TEXTURE_PROC_CTL" },
- { RADEON_SE_TCL_LIGHT_MODEL_CTL, "RADEON_SE_TCL_LIGHT_MODEL_CTL" },
- { RADEON_SE_TCL_PER_LIGHT_CTL_0, "RADEON_SE_TCL_PER_LIGHT_CTL_0" },
- { RADEON_SE_TCL_PER_LIGHT_CTL_1, "RADEON_SE_TCL_PER_LIGHT_CTL_1" },
- { RADEON_SE_TCL_PER_LIGHT_CTL_2, "RADEON_SE_TCL_PER_LIGHT_CTL_2" },
- { RADEON_SE_TCL_PER_LIGHT_CTL_3, "RADEON_SE_TCL_PER_LIGHT_CTL_3" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED, "RADEON_SE_TCL_EMMISSIVE_RED" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN, "RADEON_SE_TCL_EMMISSIVE_GREEN" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE, "RADEON_SE_TCL_EMMISSIVE_BLUE" },
- { RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA, "RADEON_SE_TCL_EMMISSIVE_ALPHA" },
- { RADEON_SE_TCL_MATERIAL_AMBIENT_RED, "RADEON_SE_TCL_AMBIENT_RED" },
- { RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN, "RADEON_SE_TCL_AMBIENT_GREEN" },
- { RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE, "RADEON_SE_TCL_AMBIENT_BLUE" },
- { RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA, "RADEON_SE_TCL_AMBIENT_ALPHA" },
- { RADEON_SE_TCL_MATERIAL_DIFFUSE_RED, "RADEON_SE_TCL_DIFFUSE_RED" },
- { RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN, "RADEON_SE_TCL_DIFFUSE_GREEN" },
- { RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE, "RADEON_SE_TCL_DIFFUSE_BLUE" },
- { RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA, "RADEON_SE_TCL_DIFFUSE_ALPHA" },
- { RADEON_SE_TCL_MATERIAL_SPECULAR_RED, "RADEON_SE_TCL_SPECULAR_RED" },
- { RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN, "RADEON_SE_TCL_SPECULAR_GREEN" },
- { RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE, "RADEON_SE_TCL_SPECULAR_BLUE" },
- { RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA, "RADEON_SE_TCL_SPECULAR_ALPHA" },
- { RADEON_SE_TCL_SHININESS, "RADEON_SE_TCL_SHININESS" },
- { RADEON_SE_COORD_FMT, "RADEON_SE_COORD_FMT" },
- { RADEON_PP_TEX_SIZE_0, "RADEON_PP_TEX_SIZE_0" },
- { RADEON_PP_TEX_SIZE_1, "RADEON_PP_TEX_SIZE_1" },
- { RADEON_PP_TEX_SIZE_2, "RADEON_PP_TEX_SIZE_2" },
- { RADEON_PP_TEX_SIZE_0+4, "RADEON_PP_TEX_PITCH_0" },
- { RADEON_PP_TEX_SIZE_1+4, "RADEON_PP_TEX_PITCH_1" },
- { RADEON_PP_TEX_SIZE_2+4, "RADEON_PP_TEX_PITCH_2" },
- { RADEON_PP_CUBIC_FACES_0, "RADEON_PP_CUBIC_FACES_0" },
- { RADEON_PP_CUBIC_FACES_1, "RADEON_PP_CUBIC_FACES_1" },
- { RADEON_PP_CUBIC_FACES_2, "RADEON_PP_CUBIC_FACES_2" },
- { RADEON_PP_CUBIC_OFFSET_T0_0, "RADEON_PP_CUBIC_OFFSET_T0_0" },
- { RADEON_PP_CUBIC_OFFSET_T0_1, "RADEON_PP_CUBIC_OFFSET_T0_1" },
- { RADEON_PP_CUBIC_OFFSET_T0_2, "RADEON_PP_CUBIC_OFFSET_T0_2" },
- { RADEON_PP_CUBIC_OFFSET_T0_3, "RADEON_PP_CUBIC_OFFSET_T0_3" },
- { RADEON_PP_CUBIC_OFFSET_T0_4, "RADEON_PP_CUBIC_OFFSET_T0_4" },
- { RADEON_PP_CUBIC_OFFSET_T1_0, "RADEON_PP_CUBIC_OFFSET_T1_0" },
- { RADEON_PP_CUBIC_OFFSET_T1_1, "RADEON_PP_CUBIC_OFFSET_T1_1" },
- { RADEON_PP_CUBIC_OFFSET_T1_2, "RADEON_PP_CUBIC_OFFSET_T1_2" },
- { RADEON_PP_CUBIC_OFFSET_T1_3, "RADEON_PP_CUBIC_OFFSET_T1_3" },
- { RADEON_PP_CUBIC_OFFSET_T1_4, "RADEON_PP_CUBIC_OFFSET_T1_4" },
- { RADEON_PP_CUBIC_OFFSET_T2_0, "RADEON_PP_CUBIC_OFFSET_T2_0" },
- { RADEON_PP_CUBIC_OFFSET_T2_1, "RADEON_PP_CUBIC_OFFSET_T2_1" },
- { RADEON_PP_CUBIC_OFFSET_T2_2, "RADEON_PP_CUBIC_OFFSET_T2_2" },
- { RADEON_PP_CUBIC_OFFSET_T2_3, "RADEON_PP_CUBIC_OFFSET_T2_3" },
- { RADEON_PP_CUBIC_OFFSET_T2_4, "RADEON_PP_CUBIC_OFFSET_T2_4" },
-};
-
-static struct reg_names scalar_names[] = {
- { RADEON_SS_LIGHT_DCD_ADDR, "LIGHT_DCD" },
- { RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR, "LIGHT_SPOT_EXPONENT" },
- { RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR, "LIGHT_SPOT_CUTOFF" },
- { RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR, "LIGHT_SPECULAR_THRESH" },
- { RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR, "LIGHT_RANGE_CUTOFF" },
- { RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, "VERT_GUARD_CLIP" },
- { RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR, "VERT_GUARD_DISCARD" },
- { RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR, "HORZ_GUARD_CLIP" },
- { RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR, "HORZ_GUARD_DISCARD" },
- { RADEON_SS_SHININESS, "SHININESS" },
- { 1000, "" },
-};
-
-/* Puff these out to make them look like normal (dword) registers.
- */
-static struct reg_names vector_names[] = {
- { RADEON_VS_MATRIX_0_ADDR * 4, "MATRIX_0" },
- { RADEON_VS_MATRIX_1_ADDR * 4, "MATRIX_1" },
- { RADEON_VS_MATRIX_2_ADDR * 4, "MATRIX_2" },
- { RADEON_VS_MATRIX_3_ADDR * 4, "MATRIX_3" },
- { RADEON_VS_MATRIX_4_ADDR * 4, "MATRIX_4" },
- { RADEON_VS_MATRIX_5_ADDR * 4, "MATRIX_5" },
- { RADEON_VS_MATRIX_6_ADDR * 4, "MATRIX_6" },
- { RADEON_VS_MATRIX_7_ADDR * 4, "MATRIX_7" },
- { RADEON_VS_MATRIX_8_ADDR * 4, "MATRIX_8" },
- { RADEON_VS_MATRIX_9_ADDR * 4, "MATRIX_9" },
- { RADEON_VS_MATRIX_10_ADDR * 4, "MATRIX_10" },
- { RADEON_VS_MATRIX_11_ADDR * 4, "MATRIX_11" },
- { RADEON_VS_MATRIX_12_ADDR * 4, "MATRIX_12" },
- { RADEON_VS_MATRIX_13_ADDR * 4, "MATRIX_13" },
- { RADEON_VS_MATRIX_14_ADDR * 4, "MATRIX_14" },
- { RADEON_VS_MATRIX_15_ADDR * 4, "MATRIX_15" },
- { RADEON_VS_LIGHT_AMBIENT_ADDR * 4, "LIGHT_AMBIENT" },
- { RADEON_VS_LIGHT_DIFFUSE_ADDR * 4, "LIGHT_DIFFUSE" },
- { RADEON_VS_LIGHT_SPECULAR_ADDR * 4, "LIGHT_SPECULAR" },
- { RADEON_VS_LIGHT_DIRPOS_ADDR * 4, "LIGHT_DIRPOS" },
- { RADEON_VS_LIGHT_HWVSPOT_ADDR * 4, "LIGHT_HWVSPOT" },
- { RADEON_VS_LIGHT_ATTENUATION_ADDR * 4, "LIGHT_ATTENUATION" },
- { RADEON_VS_MATRIX_EYE2CLIP_ADDR * 4, "MATRIX_EYE2CLIP" },
- { RADEON_VS_UCP_ADDR * 4, "UCP" },
- { RADEON_VS_GLOBAL_AMBIENT_ADDR * 4, "GLOBAL_AMBIENT" },
- { RADEON_VS_FOG_PARAM_ADDR * 4, "FOG_PARAM" },
- { RADEON_VS_EYE_VECTOR_ADDR * 4, "EYE_VECTOR" },
- { 1000, "" },
-};
-
-union fi { float f; int i; };
-
-#define ISVEC 1
-#define ISFLOAT 2
-#define TOUCHED 4
-
-struct reg {
- int idx;
- struct reg_names *closest;
- int flags;
- union fi current;
- union fi *values;
- int nvalues;
- int nalloc;
- float vmin, vmax;
-};
-
-
-static struct reg regs[Elements(reg_names)+1];
-static struct reg scalars[512+1];
-static struct reg vectors[512*4+1];
-
-static int total, total_changed, bufs;
-
-static void init_regs( void )
-{
- struct reg_names *tmp;
- int i;
-
- for (i = 0 ; i < Elements(regs) ; i++) {
- regs[i].idx = reg_names[i].idx;
- regs[i].closest = &reg_names[i];
- regs[i].flags = 0;
- }
-
- for (i = 0, tmp = scalar_names ; i < Elements(scalars) ; i++) {
- if (tmp[1].idx == i) tmp++;
- scalars[i].idx = i;
- scalars[i].closest = tmp;
- scalars[i].flags = ISFLOAT;
- }
-
- for (i = 0, tmp = vector_names ; i < Elements(vectors) ; i++) {
- if (tmp[1].idx*4 == i) tmp++;
- vectors[i].idx = i;
- vectors[i].closest = tmp;
- vectors[i].flags = ISFLOAT|ISVEC;
- }
-
- regs[Elements(regs)-1].idx = -1;
- scalars[Elements(scalars)-1].idx = -1;
- vectors[Elements(vectors)-1].idx = -1;
-}
-
-static int find_or_add_value( struct reg *reg, int val )
-{
- int j;
-
- for ( j = 0 ; j < reg->nvalues ; j++)
- if ( val == reg->values[j].i )
- return 1;
-
- if (j == reg->nalloc) {
- reg->nalloc += 5;
- reg->nalloc *= 2;
- reg->values = (union fi *) realloc( reg->values,
- reg->nalloc * sizeof(union fi) );
- }
-
- reg->values[reg->nvalues++].i = val;
- return 0;
-}
-
-static struct reg *lookup_reg( struct reg *tab, int reg )
-{
- int i;
-
- for (i = 0 ; tab[i].idx != -1 ; i++) {
- if (tab[i].idx == reg)
- return &tab[i];
- }
-
- fprintf(stderr, "*** unknown reg 0x%x\n", reg);
- return NULL;
-}
-
-
-static const char *get_reg_name( struct reg *reg )
-{
- static char tmp[80];
-
- if (reg->idx == reg->closest->idx)
- return reg->closest->name;
-
-
- if (reg->flags & ISVEC) {
- if (reg->idx/4 != reg->closest->idx)
- sprintf(tmp, "%s+%d[%d]",
- reg->closest->name,
- (reg->idx/4) - reg->closest->idx,
- reg->idx%4);
- else
- sprintf(tmp, "%s[%d]", reg->closest->name, reg->idx%4);
- }
- else {
- if (reg->idx != reg->closest->idx)
- sprintf(tmp, "%s+%d", reg->closest->name, reg->idx - reg->closest->idx);
- else
- sprintf(tmp, "%s", reg->closest->name);
- }
-
- return tmp;
-}
-
-static int print_int_reg_assignment( struct reg *reg, int data )
-{
- int changed = (reg->current.i != data);
- int ever_seen = find_or_add_value( reg, data );
-
- if (VERBOSE || (NORMAL && (changed || !ever_seen)))
- fprintf(stderr, " %s <-- 0x%x", get_reg_name(reg), data);
-
- if (NORMAL) {
- if (!ever_seen)
- fprintf(stderr, " *** BRAND NEW VALUE");
- else if (changed)
- fprintf(stderr, " *** CHANGED");
- }
-
- reg->current.i = data;
-
- if (VERBOSE || (NORMAL && (changed || !ever_seen)))
- fprintf(stderr, "\n");
-
- return changed;
-}
-
-
-static int print_float_reg_assignment( struct reg *reg, float data )
-{
- int changed = (reg->current.f != data);
- int newmin = (data < reg->vmin);
- int newmax = (data > reg->vmax);
-
- if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
- fprintf(stderr, " %s <-- %.3f", get_reg_name(reg), data);
-
- if (NORMAL) {
- if (newmin) {
- fprintf(stderr, " *** NEW MIN (prev %.3f)", reg->vmin);
- reg->vmin = data;
- }
- else if (newmax) {
- fprintf(stderr, " *** NEW MAX (prev %.3f)", reg->vmax);
- reg->vmax = data;
- }
- else if (changed) {
- fprintf(stderr, " *** CHANGED");
- }
- }
-
- reg->current.f = data;
-
- if (VERBOSE || (NORMAL && (newmin || newmax || changed)))
- fprintf(stderr, "\n");
-
- return changed;
-}
-
-static int print_reg_assignment( struct reg *reg, int data )
-{
- reg->flags |= TOUCHED;
- if (reg->flags & ISFLOAT)
- return print_float_reg_assignment( reg, *(float *)&data );
- else
- return print_int_reg_assignment( reg, data );
-}
-
-static void print_reg( struct reg *reg )
-{
- if (reg->flags & TOUCHED) {
- if (reg->flags & ISFLOAT) {
- fprintf(stderr, " %s == %f\n", get_reg_name(reg), reg->current.f);
- } else {
- fprintf(stderr, " %s == 0x%x\n", get_reg_name(reg), reg->current.i);
- }
- }
-}
-
-
-static void dump_state( void )
-{
- int i;
-
- for (i = 0 ; i < Elements(regs) ; i++)
- print_reg( &regs[i] );
-
- for (i = 0 ; i < Elements(scalars) ; i++)
- print_reg( &scalars[i] );
-
- for (i = 0 ; i < Elements(vectors) ; i++)
- print_reg( &vectors[i] );
-}
-
-
-
-static int radeon_emit_packets(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int id = (int)header.packet.packet_id;
- int sz = packet[id].len;
- int *data = (int *)cmdbuf->buf;
- int i;
-
- if (sz * sizeof(int) > cmdbuf->bufsz) {
- fprintf(stderr, "Packet overflows cmdbuf\n");
- return -EINVAL;
- }
-
- if (!packet[id].name) {
- fprintf(stderr, "*** Unknown packet 0 nr %d\n", id );
- return -EINVAL;
- }
-
-
- if (VERBOSE)
- fprintf(stderr, "Packet 0 reg %s nr %d\n", packet[id].name, sz );
-
- for ( i = 0 ; i < sz ; i++) {
- struct reg *reg = lookup_reg( regs, packet[id].start + i*4 );
- if (print_reg_assignment( reg, data[i] ))
- total_changed++;
- total++;
- }
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-
-static int radeon_emit_scalars(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int sz = header.scalars.count;
- int *data = (int *)cmdbuf->buf;
- int start = header.scalars.offset;
- int stride = header.scalars.stride;
- int i;
-
- if (VERBOSE)
- fprintf(stderr, "emit scalars, start %d stride %d nr %d (end %d)\n",
- start, stride, sz, start + stride * sz);
-
-
- for (i = 0 ; i < sz ; i++, start += stride) {
- struct reg *reg = lookup_reg( scalars, start );
- if (print_reg_assignment( reg, data[i] ))
- total_changed++;
- total++;
- }
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-
-static int radeon_emit_scalars2(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int sz = header.scalars.count;
- int *data = (int *)cmdbuf->buf;
- int start = header.scalars.offset + 0x100;
- int stride = header.scalars.stride;
- int i;
-
- if (VERBOSE)
- fprintf(stderr, "emit scalars2, start %d stride %d nr %d (end %d)\n",
- start, stride, sz, start + stride * sz);
-
- if (start + stride * sz > 257) {
- fprintf(stderr, "emit scalars OVERFLOW %d/%d/%d\n", start, stride, sz);
- return -1;
- }
-
- for (i = 0 ; i < sz ; i++, start += stride) {
- struct reg *reg = lookup_reg( scalars, start );
- if (print_reg_assignment( reg, data[i] ))
- total_changed++;
- total++;
- }
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-/* Check: inf/nan/extreme-size?
- * Check: table start, end, nr, etc.
- */
-static int radeon_emit_vectors(
- drm_radeon_cmd_header_t header,
- drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int sz = header.vectors.count;
- int *data = (int *)cmdbuf->buf;
- int start = header.vectors.offset;
- int stride = header.vectors.stride;
- int i,j;
-
- if (VERBOSE)
- fprintf(stderr, "emit vectors, start %d stride %d nr %d (end %d) (0x%x)\n",
- start, stride, sz, start + stride * sz, header.i);
-
-/* if (start + stride * (sz/4) > 128) { */
-/* fprintf(stderr, "emit vectors OVERFLOW %d/%d/%d\n", start, stride, sz); */
-/* return -1; */
-/* } */
-
- for (i = 0 ; i < sz ; start += stride) {
- int changed = 0;
- for (j = 0 ; j < 4 ; i++,j++) {
- struct reg *reg = lookup_reg( vectors, start*4+j );
- if (print_reg_assignment( reg, data[i] ))
- changed = 1;
- }
- if (changed)
- total_changed += 4;
- total += 4;
- }
-
-
- cmdbuf->buf += sz * sizeof(int);
- cmdbuf->bufsz -= sz * sizeof(int);
- return 0;
-}
-
-
-static int print_vertex_format( int vfmt )
-{
- if (NORMAL) {
- fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- "vertex format",
- vfmt,
- "xy,",
- (vfmt & RADEON_CP_VC_FRMT_Z) ? "z," : "",
- (vfmt & RADEON_CP_VC_FRMT_W0) ? "w0," : "",
- (vfmt & RADEON_CP_VC_FRMT_FPCOLOR) ? "fpcolor," : "",
- (vfmt & RADEON_CP_VC_FRMT_FPALPHA) ? "fpalpha," : "",
- (vfmt & RADEON_CP_VC_FRMT_PKCOLOR) ? "pkcolor," : "",
- (vfmt & RADEON_CP_VC_FRMT_FPSPEC) ? "fpspec," : "",
- (vfmt & RADEON_CP_VC_FRMT_FPFOG) ? "fpfog," : "",
- (vfmt & RADEON_CP_VC_FRMT_PKSPEC) ? "pkspec," : "",
- (vfmt & RADEON_CP_VC_FRMT_ST0) ? "st0," : "",
- (vfmt & RADEON_CP_VC_FRMT_ST1) ? "st1," : "",
- (vfmt & RADEON_CP_VC_FRMT_Q1) ? "q1," : "",
- (vfmt & RADEON_CP_VC_FRMT_ST2) ? "st2," : "",
- (vfmt & RADEON_CP_VC_FRMT_Q2) ? "q2," : "",
- (vfmt & RADEON_CP_VC_FRMT_ST3) ? "st3," : "",
- (vfmt & RADEON_CP_VC_FRMT_Q3) ? "q3," : "",
- (vfmt & RADEON_CP_VC_FRMT_Q0) ? "q0," : "",
- (vfmt & RADEON_CP_VC_FRMT_N0) ? "n0," : "",
- (vfmt & RADEON_CP_VC_FRMT_XY1) ? "xy1," : "",
- (vfmt & RADEON_CP_VC_FRMT_Z1) ? "z1," : "",
- (vfmt & RADEON_CP_VC_FRMT_W1) ? "w1," : "",
- (vfmt & RADEON_CP_VC_FRMT_N1) ? "n1," : "");
-
-
-/* if (!find_or_add_value( &others[V_VTXFMT], vfmt )) */
-/* fprintf(stderr, " *** NEW VALUE"); */
-
- fprintf(stderr, "\n");
- }
-
- return 0;
-}
-
-static char *primname[0xf] = {
- "NONE",
- "POINTS",
- "LINES",
- "LINE_STRIP",
- "TRIANGLES",
- "TRIANGLE_FAN",
- "TRIANGLE_STRIP",
- "TRI_TYPE_2",
- "RECT_LIST",
- "3VRT_POINTS",
- "3VRT_LINES",
-};
-
-static int print_prim_and_flags( int prim )
-{
- int numverts;
-
- if (NORMAL)
- fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s\n",
- "prim flags",
- prim,
- ((prim & 0x30) == RADEON_CP_VC_CNTL_PRIM_WALK_IND) ? "IND," : "",
- ((prim & 0x30) == RADEON_CP_VC_CNTL_PRIM_WALK_LIST) ? "LIST," : "",
- ((prim & 0x30) == RADEON_CP_VC_CNTL_PRIM_WALK_RING) ? "RING," : "",
- (prim & RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA) ? "RGBA," : "BGRA, ",
- (prim & RADEON_CP_VC_CNTL_MAOS_ENABLE) ? "MAOS," : "",
- (prim & RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE) ? "RADEON," : "",
- (prim & RADEON_CP_VC_CNTL_TCL_ENABLE) ? "TCL," : "");
-
- if ((prim & 0xf) > RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST) {
- fprintf(stderr, " *** Bad primitive: %x\n", prim & 0xf);
- return -1;
- }
-
- numverts = prim>>16;
-
- if (NORMAL)
- fprintf(stderr, " prim: %s numverts %d\n", primname[prim&0xf], numverts);
-
- switch (prim & 0xf) {
- case RADEON_CP_VC_CNTL_PRIM_TYPE_NONE:
- case RADEON_CP_VC_CNTL_PRIM_TYPE_POINT:
- if (numverts < 1) {
- fprintf(stderr, "Bad nr verts for line %d\n", numverts);
- return -1;
- }
- break;
- case RADEON_CP_VC_CNTL_PRIM_TYPE_LINE:
- if ((numverts & 1) || numverts == 0) {
- fprintf(stderr, "Bad nr verts for line %d\n", numverts);
- return -1;
- }
- break;
- case RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP:
- if (numverts < 2) {
- fprintf(stderr, "Bad nr verts for line_strip %d\n", numverts);
- return -1;
- }
- break;
- case RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST:
- case RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST:
- case RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST:
- case RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST:
- if (numverts % 3 || numverts == 0) {
- fprintf(stderr, "Bad nr verts for tri %d\n", numverts);
- return -1;
- }
- break;
- case RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN:
- case RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP:
- if (numverts < 3) {
- fprintf(stderr, "Bad nr verts for strip/fan %d\n", numverts);
- return -1;
- }
- break;
- default:
- fprintf(stderr, "Bad primitive\n");
- return -1;
- }
- return 0;
-}
-
-/* build in knowledge about each packet type
- */
-static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf )
-{
- int cmdsz;
- int *cmd = (int *)cmdbuf->buf;
- int *tmp;
- int i, stride, size, start;
-
- cmdsz = 2 + ((cmd[0] & RADEON_CP_PACKET_COUNT_MASK) >> 16);
-
- if ((cmd[0] & RADEON_CP_PACKET_MASK) != RADEON_CP_PACKET3 ||
- cmdsz * 4 > cmdbuf->bufsz ||
- cmdsz > RADEON_CP_PACKET_MAX_DWORDS) {
- fprintf(stderr, "Bad packet\n");
- return -EINVAL;
- }
-
- switch( cmd[0] & ~RADEON_CP_PACKET_COUNT_MASK ) {
- case RADEON_CP_PACKET3_NOP:
- if (NORMAL)
- fprintf(stderr, "PACKET3_NOP, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_NEXT_CHAR:
- if (NORMAL)
- fprintf(stderr, "PACKET3_NEXT_CHAR, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_PLY_NEXTSCAN:
- if (NORMAL)
- fprintf(stderr, "PACKET3_PLY_NEXTSCAN, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_SET_SCISSORS:
- if (NORMAL)
- fprintf(stderr, "PACKET3_SET_SCISSORS, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM:
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_RNDR_GEN_INDX_PRIM, %d dwords\n",
- cmdsz);
- break;
- case RADEON_CP_PACKET3_LOAD_MICROCODE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_LOAD_MICROCODE, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_WAIT_FOR_IDLE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_WAIT_FOR_IDLE, %d dwords\n", cmdsz);
- break;
-
- case RADEON_CP_PACKET3_3D_DRAW_VBUF:
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_DRAW_VBUF, %d dwords\n", cmdsz);
- print_vertex_format(cmd[1]);
- print_prim_and_flags(cmd[2]);
- break;
-
- case RADEON_CP_PACKET3_3D_DRAW_IMMD:
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_DRAW_IMMD, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_3D_DRAW_INDX: {
- int neltdwords;
- if (NORMAL)
- fprintf(stderr, "PACKET3_3D_DRAW_INDX, %d dwords\n", cmdsz);
- print_vertex_format(cmd[1]);
- print_prim_and_flags(cmd[2]);
- neltdwords = cmd[2]>>16;
- neltdwords += neltdwords & 1;
- neltdwords /= 2;
- if (neltdwords + 3 != cmdsz)
- fprintf(stderr, "Mismatch in DRAW_INDX, %d vs cmdsz %d\n",
- neltdwords, cmdsz);
- break;
- }
- case RADEON_CP_PACKET3_LOAD_PALETTE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_LOAD_PALETTE, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_3D_LOAD_VBPNTR:
- if (NORMAL) {
- fprintf(stderr, "PACKET3_3D_LOAD_VBPNTR, %d dwords\n", cmdsz);
- fprintf(stderr, " nr arrays: %d\n", cmd[1]);
- }
-
- if (cmd[1]/2 + cmd[1]%2 != cmdsz - 3) {
- fprintf(stderr, " ****** MISMATCH %d/%d *******\n",
- cmd[1]/2 + cmd[1]%2 + 3, cmdsz);
- return -EINVAL;
- }
-
- if (NORMAL) {
- tmp = cmd+2;
- for (i = 0 ; i < cmd[1] ; i++) {
- if (i & 1) {
- stride = (tmp[0]>>24) & 0xff;
- size = (tmp[0]>>16) & 0xff;
- start = tmp[2];
- tmp += 3;
- }
- else {
- stride = (tmp[0]>>8) & 0xff;
- size = (tmp[0]) & 0xff;
- start = tmp[1];
- }
- fprintf(stderr, " array %d: start 0x%x vsize %d vstride %d\n",
- i, start, size, stride );
- }
- }
- break;
- case RADEON_CP_PACKET3_CNTL_PAINT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_PAINT, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_BITBLT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_BITBLT, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_SMALLTEXT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_SMALLTEXT, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
- cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_POLYLINE:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_POLYLINE, %d dwords\n", cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_POLYSCANLINES:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
- cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_PAINT_MULTI:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
- cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_BITBLT_MULTI:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
- cmdsz);
- break;
- case RADEON_CP_PACKET3_CNTL_TRANS_BITBLT:
- if (NORMAL)
- fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
- cmdsz);
- break;
- default:
- fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz);
- break;
- }
-
- cmdbuf->buf += cmdsz * 4;
- cmdbuf->bufsz -= cmdsz * 4;
- return 0;
-}
-
-
-/* Check cliprects for bounds, then pass on to above:
- */
-static int radeon_emit_packet3_cliprect( drm_radeon_cmd_buffer_t *cmdbuf )
-{
- drm_clip_rect_t *boxes = cmdbuf->boxes;
- int i = 0;
-
- if (VERBOSE && total_changed) {
- dump_state();
- total_changed = 0;
- }
- else fprintf(stderr, "total_changed zero\n");
-
- if (NORMAL) {
- do {
- if ( i < cmdbuf->nbox ) {
- fprintf(stderr, "Emit box %d/%d %d,%d %d,%d\n",
- i, cmdbuf->nbox,
- boxes[i].x1, boxes[i].y1, boxes[i].x2, boxes[i].y2);
- }
- } while ( ++i < cmdbuf->nbox );
- }
-
- if (cmdbuf->nbox == 1)
- cmdbuf->nbox = 0;
-
- return radeon_emit_packet3( cmdbuf );
-}
-
-
-int radeonSanityCmdBuffer( radeonContextPtr rmesa,
- int nbox,
- drm_clip_rect_t *boxes )
-{
- int idx;
- drm_radeon_cmd_buffer_t cmdbuf;
- drm_radeon_cmd_header_t header;
- static int inited = 0;
-
- if (!inited) {
- init_regs();
- inited = 1;
- }
-
- cmdbuf.buf = rmesa->store.cmd_buf;
- cmdbuf.bufsz = rmesa->store.cmd_used;
- cmdbuf.boxes = boxes;
- cmdbuf.nbox = nbox;
-
- while ( cmdbuf.bufsz >= sizeof(header) ) {
-
- header.i = *(int *)cmdbuf.buf;
- cmdbuf.buf += sizeof(header);
- cmdbuf.bufsz -= sizeof(header);
-
- switch (header.header.cmd_type) {
- case RADEON_CMD_PACKET:
- if (radeon_emit_packets( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_packets failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_SCALARS:
- if (radeon_emit_scalars( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_scalars failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_SCALARS2:
- if (radeon_emit_scalars2( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_scalars failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_VECTORS:
- if (radeon_emit_vectors( header, &cmdbuf )) {
- fprintf(stderr,"radeon_emit_vectors failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_DMA_DISCARD:
- idx = header.dma.buf_idx;
- if (NORMAL)
- fprintf(stderr, "RADEON_CMD_DMA_DISCARD buf %d\n", idx);
- bufs++;
- break;
-
- case RADEON_CMD_PACKET3:
- if (radeon_emit_packet3( &cmdbuf )) {
- fprintf(stderr,"radeon_emit_packet3 failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_PACKET3_CLIP:
- if (radeon_emit_packet3_cliprect( &cmdbuf )) {
- fprintf(stderr,"radeon_emit_packet3_clip failed\n");
- return -EINVAL;
- }
- break;
-
- case RADEON_CMD_WAIT:
- break;
-
- default:
- fprintf(stderr,"bad cmd_type %d at %p\n",
- header.header.cmd_type,
- cmdbuf.buf - sizeof(header));
- return -EINVAL;
- }
- }
-
- if (0)
- {
- static int n = 0;
- n++;
- if (n == 10) {
- fprintf(stderr, "Bufs %d Total emitted %d real changes %d (%.2f%%)\n",
- bufs,
- total, total_changed,
- ((float)total_changed/(float)total*100.0));
- fprintf(stderr, "Total emitted per buf: %.2f\n",
- (float)total/(float)bufs);
- fprintf(stderr, "Real changes per buf: %.2f\n",
- (float)total_changed/(float)bufs);
-
- bufs = n = total = total_changed = 0;
- }
- }
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.h
deleted file mode 100644
index 1ec06bc58..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_sanity.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef RADEON_SANITY_H
-#define RADEON_SANITY_H
-
-extern int radeonSanityCmdBuffer( radeonContextPtr rmesa,
- int nbox,
- drm_clip_rect_t *boxes );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c
deleted file mode 100644
index 80710294c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ /dev/null
@@ -1,656 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v 1.7 2003/03/26 20:43:51 tsi Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/**
- * \file radeon_screen.c
- * Screen initialization functions for the Radeon driver.
- *
- * \author Kevin E. Martin <martin@valinux.com>
- * \author Gareth Hughes <gareth@valinux.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#define STANDALONE_MMIO
-#include "radeon_context.h"
-#include "radeon_screen.h"
-#include "radeon_macros.h"
-#include "radeon_span.h"
-
-#include "utils.h"
-#include "context.h"
-#include "vblank.h"
-#include "drirenderbuffer.h"
-
-#include "GL/internal/dri_interface.h"
-
-/* Radeon configuration
- */
-#include "xmlpool.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_HYPERZ(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_DEF_MAX_ANISOTROPY(1.0,"1.0,2.0,4.0,8.0,16.0")
- DRI_CONF_NO_NEG_LOD_BIAS(false)
- DRI_CONF_FORCE_S3TC_ENABLE(false)
- DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
- DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
- DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
- DRI_CONF_TEXTURE_LEVEL_HACK(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driNConfigOptions = 13;
-
-extern const struct dri_extension card_extensions[];
-
-#if 1
-/* Including xf86PciInfo.h introduces a bunch of errors...
- */
-#define PCI_CHIP_RADEON_QD 0x5144
-#define PCI_CHIP_RADEON_QE 0x5145
-#define PCI_CHIP_RADEON_QF 0x5146
-#define PCI_CHIP_RADEON_QG 0x5147
-
-#define PCI_CHIP_RADEON_QY 0x5159
-#define PCI_CHIP_RADEON_QZ 0x515A
-
-#define PCI_CHIP_RN50_515E 0x515E
-#define PCI_CHIP_RN50_5969 0x5969
-
-#define PCI_CHIP_RADEON_LW 0x4C57 /* mobility 7 - has tcl */
-#define PCI_CHIP_RADEON_LX 0x4C58 /* mobility FireGL 7800 m7 */
-
-#define PCI_CHIP_RADEON_LY 0x4C59
-#define PCI_CHIP_RADEON_LZ 0x4C5A
-
-#define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */
-#define PCI_CHIP_RV200_QX 0x5158
-
-/* IGP Chipsets */
-#define PCI_CHIP_RS100_4136 0x4136
-#define PCI_CHIP_RS200_4137 0x4137
-#define PCI_CHIP_RS250_4237 0x4237
-#define PCI_CHIP_RS100_4336 0x4336
-#define PCI_CHIP_RS200_4337 0x4337
-#define PCI_CHIP_RS250_4437 0x4437
-#endif
-
-
-static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
-
-static __GLcontextModes *
-radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/* Create the device specific screen private data struct.
- */
-radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
-{
- radeonScreenPtr screen;
- RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
- unsigned char *RADEONMMIO;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- screen = (radeonScreenPtr) CALLOC( sizeof(*screen) );
- if ( !screen ) {
- __driUtilMessage("%s: Could not allocate memory for screen structure",
- __FUNCTION__);
- return NULL;
- }
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&screen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- /* This is first since which regions we map depends on whether or
- * not we are using a PCI card.
- */
- screen->IsPCI = dri_priv->IsPCI;
-
- {
- int ret;
- drm_radeon_getparam_t gp;
-
- gp.param = RADEON_PARAM_GART_BUFFER_OFFSET;
- gp.value = &screen->gart_buffer_offset;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE( screen );
- fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_GART_BUFFER_OFFSET): %d\n", ret);
- return NULL;
- }
-
- if (sPriv->drmMinor >= 6) {
- gp.param = RADEON_PARAM_IRQ_NR;
- gp.value = &screen->irq;
-
- ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM,
- &gp, sizeof(gp));
- if (ret) {
- FREE( screen );
- fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_IRQ_NR): %d\n", ret);
- return NULL;
- }
- }
- }
-
- screen->mmio.handle = dri_priv->registerHandle;
- screen->mmio.size = dri_priv->registerSize;
- if ( drmMap( sPriv->fd,
- screen->mmio.handle,
- screen->mmio.size,
- &screen->mmio.map ) ) {
- FREE( screen );
- __driUtilMessage("%s: drmMap failed\n", __FUNCTION__ );
- return NULL;
- }
-
- RADEONMMIO = screen->mmio.map;
-
- screen->status.handle = dri_priv->statusHandle;
- screen->status.size = dri_priv->statusSize;
- if ( drmMap( sPriv->fd,
- screen->status.handle,
- screen->status.size,
- &screen->status.map ) ) {
- drmUnmap( screen->mmio.map, screen->mmio.size );
- FREE( screen );
- __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ );
- return NULL;
- }
- screen->scratch = (__volatile__ u_int32_t *)
- ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET);
-
- screen->buffers = drmMapBufs( sPriv->fd );
- if ( !screen->buffers ) {
- drmUnmap( screen->status.map, screen->status.size );
- drmUnmap( screen->mmio.map, screen->mmio.size );
- FREE( screen );
- __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ );
- return NULL;
- }
-
- if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) {
- screen->gartTextures.handle = dri_priv->gartTexHandle;
- screen->gartTextures.size = dri_priv->gartTexMapSize;
- if ( drmMap( sPriv->fd,
- screen->gartTextures.handle,
- screen->gartTextures.size,
- (drmAddressPtr)&screen->gartTextures.map ) ) {
- drmUnmapBufs( screen->buffers );
- drmUnmap( screen->status.map, screen->status.size );
- drmUnmap( screen->mmio.map, screen->mmio.size );
- FREE( screen );
- __driUtilMessage("%s: drmMap failed for GART texture area\n", __FUNCTION__);
- return NULL;
- }
-
- screen->gart_texture_offset = dri_priv->gartTexOffset + ( screen->IsPCI
- ? INREG( RADEON_AIC_LO_ADDR )
- : ( ( INREG( RADEON_MC_AGP_LOCATION ) & 0x0ffffU ) << 16 ) );
- }
-
- screen->chipset = 0;
- switch ( dri_priv->deviceID ) {
- default:
- fprintf(stderr, "unknown chip id, assuming full radeon support\n");
- case PCI_CHIP_RADEON_QD:
- case PCI_CHIP_RADEON_QE:
- case PCI_CHIP_RADEON_QF:
- case PCI_CHIP_RADEON_QG:
- /* all original radeons (7200) presumably have a stencil op bug */
- screen->chipset |= RADEON_CHIPSET_BROKEN_STENCIL;
- case PCI_CHIP_RV200_QW:
- case PCI_CHIP_RV200_QX:
- case PCI_CHIP_RADEON_LW:
- case PCI_CHIP_RADEON_LX:
- screen->chipset |= RADEON_CHIPSET_TCL;
- case PCI_CHIP_RADEON_QY:
- case PCI_CHIP_RADEON_QZ:
- case PCI_CHIP_RN50_515E:
- case PCI_CHIP_RN50_5969:
- case PCI_CHIP_RADEON_LY:
- case PCI_CHIP_RADEON_LZ:
- case PCI_CHIP_RS100_4136: /* IGPs don't have TCL */
- case PCI_CHIP_RS200_4137:
- case PCI_CHIP_RS250_4237:
- case PCI_CHIP_RS100_4336:
- case PCI_CHIP_RS200_4337:
- case PCI_CHIP_RS250_4437:
- break;
- }
-
- screen->cpp = dri_priv->bpp / 8;
- screen->AGPMode = dri_priv->AGPMode;
-
- screen->fbLocation = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff ) << 16;
-
- if ( sPriv->drmMinor >= 10 ) {
- drm_radeon_setparam_t sp;
-
- sp.param = RADEON_SETPARAM_FB_LOCATION;
- sp.value = screen->fbLocation;
-
- drmCommandWrite( sPriv->fd, DRM_RADEON_SETPARAM,
- &sp, sizeof( sp ) );
- }
-
- screen->frontOffset = dri_priv->frontOffset;
- screen->frontPitch = dri_priv->frontPitch;
- screen->backOffset = dri_priv->backOffset;
- screen->backPitch = dri_priv->backPitch;
- screen->depthOffset = dri_priv->depthOffset;
- screen->depthPitch = dri_priv->depthPitch;
-
- /* Check if ddx has set up a surface reg to cover depth buffer */
- screen->depthHasSurface = ((sPriv->ddxMajor > 4) &&
- (screen->chipset & RADEON_CHIPSET_TCL));
-
- if ( dri_priv->textureSize == 0 ) {
- screen->texOffset[RADEON_LOCAL_TEX_HEAP] = screen->gart_texture_offset;
- screen->texSize[RADEON_LOCAL_TEX_HEAP] = dri_priv->gartTexMapSize;
- screen->logTexGranularity[RADEON_LOCAL_TEX_HEAP] =
- dri_priv->log2GARTTexGran;
- } else {
- screen->texOffset[RADEON_LOCAL_TEX_HEAP] = dri_priv->textureOffset
- + screen->fbLocation;
- screen->texSize[RADEON_LOCAL_TEX_HEAP] = dri_priv->textureSize;
- screen->logTexGranularity[RADEON_LOCAL_TEX_HEAP] =
- dri_priv->log2TexGran;
- }
-
- if ( !screen->gartTextures.map || dri_priv->textureSize == 0
- || getenv( "RADEON_GARTTEXTURING_FORCE_DISABLE" ) ) {
- screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1;
- screen->texOffset[RADEON_GART_TEX_HEAP] = 0;
- screen->texSize[RADEON_GART_TEX_HEAP] = 0;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] = 0;
- } else {
- screen->numTexHeaps = RADEON_NR_TEX_HEAPS;
- screen->texOffset[RADEON_GART_TEX_HEAP] = screen->gart_texture_offset;
- screen->texSize[RADEON_GART_TEX_HEAP] = dri_priv->gartTexMapSize;
- screen->logTexGranularity[RADEON_GART_TEX_HEAP] =
- dri_priv->log2GARTTexGran;
- }
-
- if ( glx_enable_extension != NULL ) {
- if ( screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
-
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- }
-
- screen->driScreen = sPriv;
- screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
- return screen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-void radeonDestroyScreen( __DRIscreenPrivate *sPriv )
-{
- radeonScreenPtr screen = (radeonScreenPtr)sPriv->private;
-
- if (!screen)
- return;
-
- if ( screen->gartTextures.map ) {
- drmUnmap( screen->gartTextures.map, screen->gartTextures.size );
- }
- drmUnmapBufs( screen->buffers );
- drmUnmap( screen->status.map, screen->status.size );
- drmUnmap( screen->mmio.map, screen->mmio.size );
-
- /* free all option information */
- driDestroyOptionInfo (&screen->optionCache);
-
- FREE( screen );
- sPriv->private = NULL;
-}
-
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-radeonInitDriver( __DRIscreenPrivate *sPriv )
-{
- sPriv->private = (void *) radeonCreateScreen( sPriv );
- if ( !sPriv->private ) {
- radeonDestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Create the Mesa framebuffer and renderbuffers for a given window/drawable.
- *
- * \todo This function (and its interface) will need to be updated to support
- * pbuffers.
- */
-static GLboolean
-radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- radeonScreenPtr screen = (radeonScreenPtr) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- const GLboolean swDepth = GL_FALSE;
- const GLboolean swAlpha = GL_FALSE;
- const GLboolean swAccum = mesaVis->accumRedBits > 0;
- const GLboolean swStencil = mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24;
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- swDepth,
- swStencil,
- swAccum,
- swAlpha );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- radeonSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- radeonSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- radeonSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- radeonSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- radeonSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- swDepth,
- swStencil,
- swAccum,
- swAlpha,
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-radeonDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-static struct __DriverAPIRec radeonAPI = {
- .InitDriver = radeonInitDriver,
- .DestroyScreen = radeonDestroyScreen,
- .CreateContext = radeonCreateContext,
- .DestroyContext = radeonDestroyContext,
- .CreateBuffer = radeonCreateBuffer,
- .DestroyBuffer = radeonDestroyBuffer,
- .SwapBuffers = radeonSwapBuffers,
- .MakeCurrent = radeonMakeCurrent,
- .UnbindContext = radeonUnbindContext,
- .GetSwapInfo = getSwapInfo,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 3, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions3( "Radeon",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &radeonAPI);
- if ( psp != NULL ) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = radeonFillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *) psp;
-}
-
-
-/**
- * Get information about previous buffer swaps.
- */
-static int
-getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo )
-{
- radeonContextPtr rmesa;
-
- if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL)
- || (dPriv->driContextPriv->driverPrivate == NULL)
- || (sInfo == NULL) ) {
- return -1;
- }
-
- rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
- sInfo->swap_count = rmesa->swap_count;
- sInfo->swap_ust = rmesa->swap_ust;
- sInfo->swap_missed_count = rmesa->swap_missed_count;
-
- sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
- ? driCalculateSwapUsage( dPriv, 0, rmesa->swap_missed_ust )
- : 0.0;
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h
deleted file mode 100644
index b9cbeaac3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h,v 1.5 2002/12/16 16:18:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifndef __RADEON_SCREEN_H__
-#define __RADEON_SCREEN_H__
-
-/*
- * IMPORTS: these headers contain all the DRI, X and kernel-related
- * definitions that we need.
- */
-/* #include "dri_util.h" */
-#include "radeon_dri.h"
-#include "radeon_reg.h"
-#include "drm_sarea.h"
-#include "xmlconfig.h"
-
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- drmAddress map; /* Mapping of the DRM region */
-} radeonRegionRec, *radeonRegionPtr;
-
-/* chipset features */
-#define RADEON_CHIPSET_TCL (1 << 0)
-#define RADEON_CHIPSET_BROKEN_STENCIL (1 << 1)
-
-typedef struct {
-
- int chipset;
- int cpp;
- int IsPCI; /* Current card is a PCI card */
- int AGPMode;
- unsigned int irq; /* IRQ number (0 means none) */
-
- unsigned int fbLocation;
- unsigned int frontOffset;
- unsigned int frontPitch;
- unsigned int backOffset;
- unsigned int backPitch;
-
- unsigned int depthOffset;
- unsigned int depthPitch;
-
- /* Shared texture data */
- int numTexHeaps;
- int texOffset[RADEON_NR_TEX_HEAPS];
- int texSize[RADEON_NR_TEX_HEAPS];
- int logTexGranularity[RADEON_NR_TEX_HEAPS];
-
- radeonRegionRec mmio;
- radeonRegionRec status;
- radeonRegionRec gartTextures;
-
- drmBufMapPtr buffers;
-
- __volatile__ u_int32_t *scratch;
-
- __DRIscreenPrivate *driScreen;
- unsigned int sarea_priv_offset;
- unsigned int gart_buffer_offset; /* offset in card memory space */
- unsigned int gart_texture_offset; /* offset in card memory space */
-
- GLboolean depthHasSurface;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} radeonScreenRec, *radeonScreenPtr;
-
-#endif /* __RADEON_SCREEN_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.c
deleted file mode 100644
index 2d15078d6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c,v 1.6 2002/10/30 12:51:56 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#include "glheader.h"
-#include "swrast/swrast.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_span.h"
-#include "radeon_tex.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- radeonScreenPtr radeonScreen = rmesa->radeonScreen; \
- __DRIscreenPrivate *sPriv = rmesa->dri.screen; \
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
- GLuint pitch = radeonScreen->frontPitch * radeonScreen->cpp; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- rmesa->state.color.drawOffset + \
- (dPriv->x * radeonScreen->cpp) + \
- (dPriv->y * pitch)); \
- char *read_buf = (char *)(sPriv->pFB + \
- rmesa->state.pixel.readOffset + \
- (dPriv->x * radeonScreen->cpp) + \
- (dPriv->y * pitch)); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- radeonScreenPtr radeonScreen = rmesa->radeonScreen; \
- __DRIscreenPrivate *sPriv = rmesa->dri.screen; \
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \
- GLuint height = dPriv->h; \
- GLuint xo = dPriv->x; \
- GLuint yo = dPriv->y; \
- char *buf = (char *)(sPriv->pFB + radeonScreen->depthOffset); \
- (void) buf
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) radeon##x##_RGB565
-#define TAG2(x,y) radeon##x##_RGB565##y
-#include "spantmp2.h"
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) radeon##x##_ARGB8888
-#define TAG2(x,y) radeon##x##_ARGB8888##y
-#include "spantmp2.h"
-
-
-/* ================================================================
- * Depth buffer
- */
-
-/* The Radeon family has depth tiling on all the time, so we have to convert
- * the x,y coordinates into the memory bus address (mba) in the same
- * manner as the engine. In each case, the linear block address (ba)
- * is calculated, and then wired with x and y to produce the final
- * memory address.
- * The chip will do address translation on its own if the surface registers
- * are set up correctly. It is not quite enough to get it working with hyperz too...
- */
-
-static GLuint radeon_mba_z32( radeonContextPtr rmesa,
- GLint x, GLint y )
-{
- GLuint pitch = rmesa->radeonScreen->frontPitch;
- if (rmesa->radeonScreen->depthHasSurface) {
- return 4*(x + y*pitch);
- }
- else {
- GLuint ba, address = 0; /* a[0..1] = 0 */
-
- ba = (y / 16) * (pitch / 16) + (x / 16);
-
- address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */
- address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */
- address |=
- (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */
- address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */
-
- address |= (y & 0x8) << 7; /* a[10] = y[3] */
- address |=
- (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */
- address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */
-
- return address;
- }
-}
-
-static __inline GLuint radeon_mba_z16( radeonContextPtr rmesa, GLint x, GLint y )
-{
- GLuint pitch = rmesa->radeonScreen->frontPitch;
- if (rmesa->radeonScreen->depthHasSurface) {
- return 2*(x + y*pitch);
- }
- else {
- GLuint ba, address = 0; /* a[0] = 0 */
-
- ba = (y / 16) * (pitch / 32) + (x / 32);
-
- address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */
- address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */
- address |= (x & 0x8) << 4; /* a[7] = x[3] */
- address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */
- address |= (y & 0x8) << 7; /* a[10] = y[3] */
- address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */
- address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */
-
- return address;
- }
-}
-
-
-/* 16-bit depth buffer functions
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + radeon_mba_z16( rmesa, _x + xo, _y + yo )) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + radeon_mba_z16( rmesa, _x + xo, _y + yo ));
-
-#define TAG(x) radeon##x##_16
-#include "depthtmp.h"
-
-/* 24 bit depth, 8 bit stencil depthbuffer functions
- */
-#define WRITE_DEPTH( _x, _y, d ) \
-do { \
- GLuint offset = radeon_mba_z32( rmesa, _x + xo, _y + yo ); \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- tmp |= ((d) & 0x00ffffff); \
- *(GLuint *)(buf + offset) = tmp; \
-} while (0)
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + radeon_mba_z32( rmesa, _x + xo, \
- _y + yo )) & 0x00ffffff;
-
-#define TAG(x) radeon##x##_24_8
-#include "depthtmp.h"
-
-
-/* ================================================================
- * Stencil buffer
- */
-
-/* 24 bit depth, 8 bit stencil depthbuffer functions
- */
-#define WRITE_STENCIL( _x, _y, d ) \
-do { \
- GLuint offset = radeon_mba_z32( rmesa, _x + xo, _y + yo ); \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0x00ffffff; \
- tmp |= (((d) & 0xff) << 24); \
- *(GLuint *)(buf + offset) = tmp; \
-} while (0)
-
-#define READ_STENCIL( d, _x, _y ) \
-do { \
- GLuint offset = radeon_mba_z32( rmesa, _x + xo, _y + yo ); \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- d = tmp >> 24; \
-} while (0)
-
-#define TAG(x) radeon##x##_24_8
-#include "stenciltmp.h"
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void radeonSetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch;
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- } else {
- rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch;
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
- }
- break;
- case BUFFER_BIT_BACK_LEFT:
- if ( rmesa->sarea->pfCurrentPage == 1 ) {
- rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch;
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
- } else {
- rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch;
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- }
- break;
- default:
- assert(0);
- break;
- }
-}
-
-/* Move locking out to get reasonable span performance (10x better
- * than doing this in HW_LOCK above). WaitForIdle() is the main
- * culprit.
- */
-
-static void radeonSpanRenderStart( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- RADEON_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
- radeonWaitForIdleLocked( rmesa );
-}
-
-static void radeonSpanRenderFinish( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( rmesa );
-}
-
-void radeonInitSpanFuncs( GLcontext *ctx )
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = radeonSetBuffer;
- swdd->SpanRenderStart = radeonSpanRenderStart;
- swdd->SpanRenderFinish = radeonSpanRenderFinish;
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- radeonInitPointers_RGB565(&drb->Base);
- }
- else {
- radeonInitPointers_ARGB8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = radeonReadDepthSpan_16;
- drb->Base.GetValues = radeonReadDepthPixels_16;
- drb->Base.PutRow = radeonWriteDepthSpan_16;
- drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_16;
- drb->Base.PutValues = radeonWriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = radeonReadDepthSpan_24_8;
- drb->Base.GetValues = radeonReadDepthPixels_24_8;
- drb->Base.PutRow = radeonWriteDepthSpan_24_8;
- drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_24_8;
- drb->Base.PutValues = radeonWriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = radeonReadStencilSpan_24_8;
- drb->Base.GetValues = radeonReadStencilPixels_24_8;
- drb->Base.PutRow = radeonWriteStencilSpan_24_8;
- drb->Base.PutMonoRow = radeonWriteMonoStencilSpan_24_8;
- drb->Base.PutValues = radeonWriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.h
deleted file mode 100644
index 13b308e1c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_span.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.h,v 1.2 2002/02/22 21:45:01 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#ifndef __RADEON_SPAN_H__
-#define __RADEON_SPAN_H__
-
-#include "drirenderbuffer.h"
-
-extern void radeonInitSpanFuncs( GLcontext *ctx );
-
-extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.c
deleted file mode 100644
index 3a491f5de..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.c
+++ /dev/null
@@ -1,2295 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.8 2002/12/16 16:18:58 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-#include "enums.h"
-#include "colormac.h"
-#include "state.h"
-#include "buffers.h"
-#include "context.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "main/light.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_tcl.h"
-#include "radeon_tex.h"
-#include "radeon_swtcl.h"
-#include "radeon_vtxfmt.h"
-
-/* =============================================================
- * Alpha blending
- */
-
-static void radeonAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int pp_misc = rmesa->hw.ctx.cmd[CTX_PP_MISC];
- GLubyte refByte;
-
- CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
- RADEON_STATECHANGE( rmesa, ctx );
-
- pp_misc &= ~(RADEON_ALPHA_TEST_OP_MASK | RADEON_REF_ALPHA_MASK);
- pp_misc |= (refByte & RADEON_REF_ALPHA_MASK);
-
- switch ( func ) {
- case GL_NEVER:
- pp_misc |= RADEON_ALPHA_TEST_FAIL;
- break;
- case GL_LESS:
- pp_misc |= RADEON_ALPHA_TEST_LESS;
- break;
- case GL_EQUAL:
- pp_misc |= RADEON_ALPHA_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- pp_misc |= RADEON_ALPHA_TEST_LEQUAL;
- break;
- case GL_GREATER:
- pp_misc |= RADEON_ALPHA_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- pp_misc |= RADEON_ALPHA_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- pp_misc |= RADEON_ALPHA_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- pp_misc |= RADEON_ALPHA_TEST_PASS;
- break;
- }
-
- rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc;
-}
-
-static void radeonBlendEquationSeparate( GLcontext *ctx,
- GLenum modeRGB, GLenum modeA )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] & ~RADEON_COMB_FCN_MASK;
- GLboolean fallback = GL_FALSE;
-
- assert( modeRGB == modeA );
-
- switch ( modeRGB ) {
- case GL_FUNC_ADD:
- case GL_LOGIC_OP:
- b |= RADEON_COMB_FCN_ADD_CLAMP;
- break;
-
- case GL_FUNC_SUBTRACT:
- b |= RADEON_COMB_FCN_SUB_CLAMP;
- break;
-
- default:
- if (ctx->Color.BlendEnabled)
- fallback = GL_TRUE;
- else
- b |= RADEON_COMB_FCN_ADD_CLAMP;
- break;
- }
-
- FALLBACK( rmesa, RADEON_FALLBACK_BLEND_EQ, fallback );
- if ( !fallback ) {
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
- if ( ctx->Color._LogicOpEnabled ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE;
- }
- }
-}
-
-static void radeonBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] &
- ~(RADEON_SRC_BLEND_MASK | RADEON_DST_BLEND_MASK);
- GLboolean fallback = GL_FALSE;
-
- switch ( ctx->Color.BlendSrcRGB ) {
- case GL_ZERO:
- b |= RADEON_SRC_BLEND_GL_ZERO;
- break;
- case GL_ONE:
- b |= RADEON_SRC_BLEND_GL_ONE;
- break;
- case GL_DST_COLOR:
- b |= RADEON_SRC_BLEND_GL_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- b |= RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR;
- break;
- case GL_SRC_COLOR:
- b |= RADEON_SRC_BLEND_GL_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- b |= RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- b |= RADEON_SRC_BLEND_GL_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- b |= RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- b |= RADEON_SRC_BLEND_GL_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- b |= RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA;
- break;
- case GL_SRC_ALPHA_SATURATE:
- b |= RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE;
- break;
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- if (ctx->Color.BlendEnabled)
- fallback = GL_TRUE;
- else
- b |= RADEON_SRC_BLEND_GL_ONE;
- break;
- default:
- break;
- }
-
- switch ( ctx->Color.BlendDstRGB ) {
- case GL_ZERO:
- b |= RADEON_DST_BLEND_GL_ZERO;
- break;
- case GL_ONE:
- b |= RADEON_DST_BLEND_GL_ONE;
- break;
- case GL_SRC_COLOR:
- b |= RADEON_DST_BLEND_GL_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- b |= RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- b |= RADEON_DST_BLEND_GL_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- b |= RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_COLOR:
- b |= RADEON_DST_BLEND_GL_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- b |= RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR;
- break;
- case GL_DST_ALPHA:
- b |= RADEON_DST_BLEND_GL_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- b |= RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA;
- break;
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- if (ctx->Color.BlendEnabled)
- fallback = GL_TRUE;
- else
- b |= RADEON_DST_BLEND_GL_ZERO;
- break;
- default:
- break;
- }
-
- FALLBACK( rmesa, RADEON_FALLBACK_BLEND_FUNC, fallback );
- if ( !fallback ) {
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
- }
-}
-
-
-/* =============================================================
- * Depth testing
- */
-
-static void radeonDepthFunc( GLcontext *ctx, GLenum func )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_Z_TEST_MASK;
-
- switch ( ctx->Depth.Func ) {
- case GL_NEVER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_NEVER;
- break;
- case GL_LESS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_LESS;
- break;
- case GL_EQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_LEQUAL;
- break;
- case GL_GREATER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_TEST_ALWAYS;
- break;
- }
-}
-
-
-static void radeonDepthMask( GLcontext *ctx, GLboolean flag )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, ctx );
-
- if ( ctx->Depth.Mask ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_WRITE_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_Z_WRITE_ENABLE;
- }
-}
-
-static void radeonClearDepth( GLcontext *ctx, GLclampd d )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint format = (rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &
- RADEON_DEPTH_FORMAT_MASK);
-
- switch ( format ) {
- case RADEON_DEPTH_FORMAT_16BIT_INT_Z:
- rmesa->state.depth.clear = d * 0x0000ffff;
- break;
- case RADEON_DEPTH_FORMAT_24BIT_INT_Z:
- rmesa->state.depth.clear = d * 0x00ffffff;
- break;
- }
-}
-
-
-/* =============================================================
- * Fog
- */
-
-
-static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- union { int i; float f; } c, d;
- GLchan col[4];
-
- c.i = rmesa->hw.fog.cmd[FOG_C];
- d.i = rmesa->hw.fog.cmd[FOG_D];
-
- switch (pname) {
- case GL_FOG_MODE:
- if (!ctx->Fog.Enabled)
- return;
- RADEON_STATECHANGE(rmesa, tcl);
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_TCL_FOG_MASK;
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_LINEAR;
- if (ctx->Fog.Start == ctx->Fog.End) {
- c.f = 1.0F;
- d.f = 1.0F;
- }
- else {
- c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start);
- }
- break;
- case GL_EXP:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP;
- c.f = 0.0;
- d.f = ctx->Fog.Density;
- break;
- case GL_EXP2:
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP2;
- c.f = 0.0;
- d.f = -(ctx->Fog.Density * ctx->Fog.Density);
- break;
- default:
- return;
- }
- break;
- case GL_FOG_DENSITY:
- switch (ctx->Fog.Mode) {
- case GL_EXP:
- c.f = 0.0;
- d.f = ctx->Fog.Density;
- break;
- case GL_EXP2:
- c.f = 0.0;
- d.f = -(ctx->Fog.Density * ctx->Fog.Density);
- break;
- default:
- break;
- }
- break;
- case GL_FOG_START:
- case GL_FOG_END:
- if (ctx->Fog.Mode == GL_LINEAR) {
- if (ctx->Fog.Start == ctx->Fog.End) {
- c.f = 1.0F;
- d.f = 1.0F;
- } else {
- c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
- d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start);
- }
- }
- break;
- case GL_FOG_COLOR:
- RADEON_STATECHANGE( rmesa, ctx );
- UNCLAMPED_FLOAT_TO_RGB_CHAN( col, ctx->Fog.Color );
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] =
- radeonPackColor( 4, col[0], col[1], col[2], 0 );
- break;
- case GL_FOG_COORDINATE_SOURCE_EXT:
- /* What to do?
- */
- break;
- default:
- return;
- }
-
- if (c.i != rmesa->hw.fog.cmd[FOG_C] || d.i != rmesa->hw.fog.cmd[FOG_D]) {
- RADEON_STATECHANGE( rmesa, fog );
- rmesa->hw.fog.cmd[FOG_C] = c.i;
- rmesa->hw.fog.cmd[FOG_D] = d.i;
- }
-}
-
-
-/* =============================================================
- * Scissoring
- */
-
-
-static GLboolean intersect_rect( drm_clip_rect_t *out,
- drm_clip_rect_t *a,
- drm_clip_rect_t *b )
-{
- *out = *a;
- if ( b->x1 > out->x1 ) out->x1 = b->x1;
- if ( b->y1 > out->y1 ) out->y1 = b->y1;
- if ( b->x2 < out->x2 ) out->x2 = b->x2;
- if ( b->y2 < out->y2 ) out->y2 = b->y2;
- if ( out->x1 >= out->x2 ) return GL_FALSE;
- if ( out->y1 >= out->y2 ) return GL_FALSE;
- return GL_TRUE;
-}
-
-
-void radeonRecalcScissorRects( radeonContextPtr rmesa )
-{
- drm_clip_rect_t *out;
- int i;
-
- /* Grow cliprect store?
- */
- if (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
- while (rmesa->state.scissor.numAllocedClipRects < rmesa->numClipRects) {
- rmesa->state.scissor.numAllocedClipRects += 1; /* zero case */
- rmesa->state.scissor.numAllocedClipRects *= 2;
- }
-
- if (rmesa->state.scissor.pClipRects)
- FREE(rmesa->state.scissor.pClipRects);
-
- rmesa->state.scissor.pClipRects =
- MALLOC( rmesa->state.scissor.numAllocedClipRects *
- sizeof(drm_clip_rect_t) );
-
- if ( rmesa->state.scissor.pClipRects == NULL ) {
- rmesa->state.scissor.numAllocedClipRects = 0;
- return;
- }
- }
-
- out = rmesa->state.scissor.pClipRects;
- rmesa->state.scissor.numClipRects = 0;
-
- for ( i = 0 ; i < rmesa->numClipRects ; i++ ) {
- if ( intersect_rect( out,
- &rmesa->pClipRects[i],
- &rmesa->state.scissor.rect ) ) {
- rmesa->state.scissor.numClipRects++;
- out++;
- }
- }
-}
-
-
-static void radeonUpdateScissor( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if ( rmesa->dri.drawable ) {
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
-
- int x = ctx->Scissor.X;
- int y = dPriv->h - ctx->Scissor.Y - ctx->Scissor.Height;
- int w = ctx->Scissor.X + ctx->Scissor.Width - 1;
- int h = dPriv->h - ctx->Scissor.Y - 1;
-
- rmesa->state.scissor.rect.x1 = x + dPriv->x;
- rmesa->state.scissor.rect.y1 = y + dPriv->y;
- rmesa->state.scissor.rect.x2 = w + dPriv->x + 1;
- rmesa->state.scissor.rect.y2 = h + dPriv->y + 1;
-
- radeonRecalcScissorRects( rmesa );
- }
-}
-
-
-static void radeonScissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei w, GLsizei h )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if ( ctx->Scissor.Enabled ) {
- RADEON_FIREVERTICES( rmesa ); /* don't pipeline cliprect changes */
- radeonUpdateScissor( ctx );
- }
-
-}
-
-
-/* =============================================================
- * Culling
- */
-
-static void radeonCullFace( GLcontext *ctx, GLenum unused )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
- GLuint t = rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL];
-
- s |= RADEON_FFACE_SOLID | RADEON_BFACE_SOLID;
- t &= ~(RADEON_CULL_FRONT | RADEON_CULL_BACK);
-
- if ( ctx->Polygon.CullFlag ) {
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_FRONT:
- s &= ~RADEON_FFACE_SOLID;
- t |= RADEON_CULL_FRONT;
- break;
- case GL_BACK:
- s &= ~RADEON_BFACE_SOLID;
- t |= RADEON_CULL_BACK;
- break;
- case GL_FRONT_AND_BACK:
- s &= ~(RADEON_FFACE_SOLID | RADEON_BFACE_SOLID);
- t |= (RADEON_CULL_FRONT | RADEON_CULL_BACK);
- break;
- }
- }
-
- if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
- RADEON_STATECHANGE(rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] = s;
- }
-
- if ( rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] != t ) {
- RADEON_STATECHANGE(rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] = t;
- }
-}
-
-static void radeonFrontFace( GLcontext *ctx, GLenum mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- RADEON_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_FFACE_CULL_DIR_MASK;
-
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_CULL_FRONT_IS_CCW;
-
- switch ( mode ) {
- case GL_CW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CW;
- break;
- case GL_CCW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CCW;
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_CULL_FRONT_IS_CCW;
- break;
- }
-}
-
-
-/* =============================================================
- * Line state
- */
-static void radeonLineWidth( GLcontext *ctx, GLfloat widthf )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- RADEON_STATECHANGE( rmesa, lin );
- RADEON_STATECHANGE( rmesa, set );
-
- /* Line width is stored in U6.4 format.
- */
- rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (GLuint)(widthf * 16.0);
- if ( widthf > 1.0 ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_WIDELINE_ENABLE;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_WIDELINE_ENABLE;
- }
-}
-
-static void radeonLineStipple( GLcontext *ctx, GLint factor, GLushort pattern )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- RADEON_STATECHANGE( rmesa, lin );
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] =
- ((((GLuint)factor & 0xff) << 16) | ((GLuint)pattern));
-}
-
-
-/* =============================================================
- * Masks
- */
-static void radeonColorMask( GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint mask = radeonPackColor( rmesa->radeonScreen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] );
-
- if ( rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] != mask ) {
- RADEON_STATECHANGE( rmesa, msk );
- rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = mask;
- }
-}
-
-
-/* =============================================================
- * Polygon state
- */
-
-static void radeonPolygonOffset( GLcontext *ctx,
- GLfloat factor, GLfloat units )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat constant = units * rmesa->state.depth.scale;
-
- RADEON_STATECHANGE( rmesa, zbs );
- rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_FACTOR] = *(GLuint *)&factor;
- rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = *(GLuint *)&constant;
-}
-
-static void radeonPolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint i;
- drm_radeon_stipple_t stipple;
-
- /* Must flip pattern upside down.
- */
- for ( i = 0 ; i < 32 ; i++ ) {
- rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
- }
-
- /* TODO: push this into cmd mechanism
- */
- RADEON_FIREVERTICES( rmesa );
- LOCK_HARDWARE( rmesa );
-
- /* FIXME: Use window x,y offsets into stipple RAM.
- */
- stipple.mask = rmesa->state.stipple.mask;
- drmCommandWrite( rmesa->dri.fd, DRM_RADEON_STIPPLE,
- &stipple, sizeof(drm_radeon_stipple_t) );
- UNLOCK_HARDWARE( rmesa );
-}
-
-static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLboolean flag = (ctx->_TriangleCaps & DD_TRI_UNFILLED) != 0;
-
- /* Can't generally do unfilled via tcl, but some good special
- * cases work.
- */
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_UNFILLED, flag);
- if (rmesa->TclFallback) {
- radeonChooseRenderState( ctx );
- radeonChooseVertexState( ctx );
- }
-}
-
-
-/* =============================================================
- * Rendering attributes
- *
- * We really don't want to recalculate all this every time we bind a
- * texture. These things shouldn't change all that often, so it makes
- * sense to break them out of the core texture state update routines.
- */
-
-/* Examine lighting and texture state to determine if separate specular
- * should be enabled.
- */
-static void radeonUpdateSpecular( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- u_int32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
-
- RADEON_STATECHANGE( rmesa, tcl );
-
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE;
-
- p &= ~RADEON_SPECULAR_ENABLE;
-
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_DIFFUSE_SPECULAR_COMBINE;
-
-
- if (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- p |= RADEON_SPECULAR_ENABLE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &=
- ~RADEON_DIFFUSE_SPECULAR_COMBINE;
- }
- else if (ctx->Light.Enabled) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- } else if (ctx->Fog.ColorSumEnabled ) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- p |= RADEON_SPECULAR_ENABLE;
- } else {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE;
- }
-
- if (ctx->Fog.Enabled) {
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC;
-
- /* Bizzare: have to leave lighting enabled to get fog.
- */
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
- }
-
- if (NEED_SECONDARY_COLOR(ctx)) {
- assert( (p & RADEON_SPECULAR_ENABLE) != 0 );
- } else {
- assert( (p & RADEON_SPECULAR_ENABLE) == 0 );
- }
-
- if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) {
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p;
- }
-
- /* Update vertex/render formats
- */
- if (rmesa->TclFallback) {
- radeonChooseRenderState( ctx );
- radeonChooseVertexState( ctx );
- }
-}
-
-
-/* =============================================================
- * Materials
- */
-
-
-/* Update on colormaterial, material emmissive/ambient,
- * lightmodel.globalambient
- */
-static void update_global_ambient( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- float *fcmd = (float *)RADEON_DB_STATE( glt );
-
- /* Need to do more if both emmissive & ambient are PREMULT:
- * Hope this is not needed for MULT
- */
- if ((rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &
- ((3 << RADEON_EMISSIVE_SOURCE_SHIFT) |
- (3 << RADEON_AMBIENT_SOURCE_SHIFT))) == 0)
- {
- COPY_3V( &fcmd[GLT_RED],
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION]);
- ACC_SCALE_3V( &fcmd[GLT_RED],
- ctx->Light.Model.Ambient,
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT]);
- }
- else
- {
- COPY_3V( &fcmd[GLT_RED], ctx->Light.Model.Ambient );
- }
-
- RADEON_DB_STATECHANGE(rmesa, &rmesa->hw.glt);
-}
-
-/* Update on change to
- * - light[p].colors
- * - light[p].enabled
- */
-static void update_light_colors( GLcontext *ctx, GLuint p )
-{
- struct gl_light *l = &ctx->Light.Light[p];
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (l->Enabled) {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- float *fcmd = (float *)RADEON_DB_STATE( lit[p] );
-
- COPY_4V( &fcmd[LIT_AMBIENT_RED], l->Ambient );
- COPY_4V( &fcmd[LIT_DIFFUSE_RED], l->Diffuse );
- COPY_4V( &fcmd[LIT_SPECULAR_RED], l->Specular );
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
- }
-}
-
-/* Also fallback for asym colormaterial mode in twoside lighting...
- */
-static void check_twoside_fallback( GLcontext *ctx )
-{
- GLboolean fallback = GL_FALSE;
- GLint i;
-
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
- if (ctx->Light.ColorMaterialEnabled &&
- (ctx->Light.ColorMaterialBitmask & BACK_MATERIAL_BITS) !=
- ((ctx->Light.ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1))
- fallback = GL_TRUE;
- else {
- for (i = MAT_ATTRIB_FRONT_AMBIENT; i < MAT_ATTRIB_FRONT_INDEXES; i+=2)
- if (memcmp( ctx->Light.Material.Attrib[i],
- ctx->Light.Material.Attrib[i+1],
- sizeof(GLfloat)*4) != 0) {
- fallback = GL_TRUE;
- break;
- }
- }
- }
-
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_LIGHT_TWOSIDE, fallback );
-}
-
-
-static void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint light_model_ctl1 = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL];
-
- light_model_ctl1 &= ~((3 << RADEON_EMISSIVE_SOURCE_SHIFT) |
- (3 << RADEON_AMBIENT_SOURCE_SHIFT) |
- (3 << RADEON_DIFFUSE_SOURCE_SHIFT) |
- (3 << RADEON_SPECULAR_SOURCE_SHIFT));
-
- if (ctx->Light.ColorMaterialEnabled) {
- GLuint mask = ctx->Light.ColorMaterialBitmask;
-
- if (mask & MAT_BIT_FRONT_EMISSION) {
- light_model_ctl1 |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_EMISSIVE_SOURCE_SHIFT);
- }
- else {
- light_model_ctl1 |= (RADEON_LM_SOURCE_STATE_MULT <<
- RADEON_EMISSIVE_SOURCE_SHIFT);
- }
-
- if (mask & MAT_BIT_FRONT_AMBIENT) {
- light_model_ctl1 |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_AMBIENT_SOURCE_SHIFT);
- }
- else {
- light_model_ctl1 |= (RADEON_LM_SOURCE_STATE_MULT <<
- RADEON_AMBIENT_SOURCE_SHIFT);
- }
-
- if (mask & MAT_BIT_FRONT_DIFFUSE) {
- light_model_ctl1 |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_DIFFUSE_SOURCE_SHIFT);
- }
- else {
- light_model_ctl1 |= (RADEON_LM_SOURCE_STATE_MULT <<
- RADEON_DIFFUSE_SOURCE_SHIFT);
- }
-
- if (mask & MAT_BIT_FRONT_SPECULAR) {
- light_model_ctl1 |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
- RADEON_SPECULAR_SOURCE_SHIFT);
- }
- else {
- light_model_ctl1 |= (RADEON_LM_SOURCE_STATE_MULT <<
- RADEON_SPECULAR_SOURCE_SHIFT);
- }
- }
- else {
- /* Default to MULT:
- */
- light_model_ctl1 |= (RADEON_LM_SOURCE_STATE_MULT << RADEON_EMISSIVE_SOURCE_SHIFT) |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_AMBIENT_SOURCE_SHIFT) |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_DIFFUSE_SOURCE_SHIFT) |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_SPECULAR_SOURCE_SHIFT);
- }
-
- if (light_model_ctl1 != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]) {
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = light_model_ctl1;
- }
-}
-
-void radeonUpdateMaterial( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
- GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( mtl );
- GLuint mask = ~0;
-
- if (ctx->Light.ColorMaterialEnabled)
- mask &= ~ctx->Light.ColorMaterialBitmask;
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
-
- if (mask & MAT_BIT_FRONT_EMISSION) {
- fcmd[MTL_EMMISSIVE_RED] = mat[MAT_ATTRIB_FRONT_EMISSION][0];
- fcmd[MTL_EMMISSIVE_GREEN] = mat[MAT_ATTRIB_FRONT_EMISSION][1];
- fcmd[MTL_EMMISSIVE_BLUE] = mat[MAT_ATTRIB_FRONT_EMISSION][2];
- fcmd[MTL_EMMISSIVE_ALPHA] = mat[MAT_ATTRIB_FRONT_EMISSION][3];
- }
- if (mask & MAT_BIT_FRONT_AMBIENT) {
- fcmd[MTL_AMBIENT_RED] = mat[MAT_ATTRIB_FRONT_AMBIENT][0];
- fcmd[MTL_AMBIENT_GREEN] = mat[MAT_ATTRIB_FRONT_AMBIENT][1];
- fcmd[MTL_AMBIENT_BLUE] = mat[MAT_ATTRIB_FRONT_AMBIENT][2];
- fcmd[MTL_AMBIENT_ALPHA] = mat[MAT_ATTRIB_FRONT_AMBIENT][3];
- }
- if (mask & MAT_BIT_FRONT_DIFFUSE) {
- fcmd[MTL_DIFFUSE_RED] = mat[MAT_ATTRIB_FRONT_DIFFUSE][0];
- fcmd[MTL_DIFFUSE_GREEN] = mat[MAT_ATTRIB_FRONT_DIFFUSE][1];
- fcmd[MTL_DIFFUSE_BLUE] = mat[MAT_ATTRIB_FRONT_DIFFUSE][2];
- fcmd[MTL_DIFFUSE_ALPHA] = mat[MAT_ATTRIB_FRONT_DIFFUSE][3];
- }
- if (mask & MAT_BIT_FRONT_SPECULAR) {
- fcmd[MTL_SPECULAR_RED] = mat[MAT_ATTRIB_FRONT_SPECULAR][0];
- fcmd[MTL_SPECULAR_GREEN] = mat[MAT_ATTRIB_FRONT_SPECULAR][1];
- fcmd[MTL_SPECULAR_BLUE] = mat[MAT_ATTRIB_FRONT_SPECULAR][2];
- fcmd[MTL_SPECULAR_ALPHA] = mat[MAT_ATTRIB_FRONT_SPECULAR][3];
- }
- if (mask & MAT_BIT_FRONT_SHININESS) {
- fcmd[MTL_SHININESS] = mat[MAT_ATTRIB_FRONT_SHININESS][0];
- }
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mtl );
-
- check_twoside_fallback( ctx );
-/* update_global_ambient( ctx );*/
-}
-
-/* _NEW_LIGHT
- * _NEW_MODELVIEW
- * _MESA_NEW_NEED_EYE_COORDS
- *
- * Uses derived state from mesa:
- * _VP_inf_norm
- * _h_inf_norm
- * _Position
- * _NormDirection
- * _ModelViewInvScale
- * _NeedEyeCoords
- * _EyeZDir
- *
- * which are calculated in light.c and are correct for the current
- * lighting space (model or eye), hence dependencies on _NEW_MODELVIEW
- * and _MESA_NEW_NEED_EYE_COORDS.
- */
-static void update_light( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- /* Have to check these, or have an automatic shortcircuit mechanism
- * to remove noop statechanges. (Or just do a better job on the
- * front end).
- */
- {
- GLuint tmp = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL];
-
- if (ctx->_NeedEyeCoords)
- tmp &= ~RADEON_LIGHT_IN_MODELSPACE;
- else
- tmp |= RADEON_LIGHT_IN_MODELSPACE;
-
-
- /* Leave this test disabled: (unexplained q3 lockup) (even with
- new packets)
- */
- if (tmp != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL])
- {
- RADEON_STATECHANGE( rmesa, tcl );
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = tmp;
- }
- }
-
- {
- GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( eye );
- fcmd[EYE_X] = ctx->_EyeZDir[0];
- fcmd[EYE_Y] = ctx->_EyeZDir[1];
- fcmd[EYE_Z] = - ctx->_EyeZDir[2];
- fcmd[EYE_RESCALE_FACTOR] = ctx->_ModelViewInvScale;
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.eye );
- }
-
-
-
- if (ctx->Light.Enabled) {
- GLint p;
- for (p = 0 ; p < MAX_LIGHTS; p++) {
- if (ctx->Light.Light[p].Enabled) {
- struct gl_light *l = &ctx->Light.Light[p];
- GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( lit[p] );
-
- if (l->EyePosition[3] == 0.0) {
- COPY_3FV( &fcmd[LIT_POSITION_X], l->_VP_inf_norm );
- COPY_3FV( &fcmd[LIT_DIRECTION_X], l->_h_inf_norm );
- fcmd[LIT_POSITION_W] = 0;
- fcmd[LIT_DIRECTION_W] = 0;
- } else {
- COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
- fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
- fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
- fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
- fcmd[LIT_DIRECTION_W] = 0;
- }
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] );
- }
- }
- }
-}
-
-static void radeonLightfv( GLcontext *ctx, GLenum light,
- GLenum pname, const GLfloat *params )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLint p = light - GL_LIGHT0;
- struct gl_light *l = &ctx->Light.Light[p];
- GLfloat *fcmd = (GLfloat *)rmesa->hw.lit[p].cmd;
-
-
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- update_light_colors( ctx, p );
- break;
-
- case GL_SPOT_DIRECTION:
- /* picked up in update_light */
- break;
-
- case GL_POSITION: {
- /* positions picked up in update_light, but can do flag here */
- GLuint flag;
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
-
- /* FIXME: Set RANGE_ATTEN only when needed */
- if (p&1)
- flag = RADEON_LIGHT_1_IS_LOCAL;
- else
- flag = RADEON_LIGHT_0_IS_LOCAL;
-
- RADEON_STATECHANGE(rmesa, tcl);
- if (l->EyePosition[3] != 0.0F)
- rmesa->hw.tcl.cmd[idx] |= flag;
- else
- rmesa->hw.tcl.cmd[idx] &= ~flag;
- break;
- }
-
- case GL_SPOT_EXPONENT:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_SPOT_EXPONENT] = params[0];
- break;
-
- case GL_SPOT_CUTOFF: {
- GLuint flag = (p&1) ? RADEON_LIGHT_1_IS_SPOT : RADEON_LIGHT_0_IS_SPOT;
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
-
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_SPOT_CUTOFF] = l->_CosCutoff;
-
- RADEON_STATECHANGE(rmesa, tcl);
- if (l->SpotCutoff != 180.0F)
- rmesa->hw.tcl.cmd[idx] |= flag;
- else
- rmesa->hw.tcl.cmd[idx] &= ~flag;
-
- break;
- }
-
- case GL_CONSTANT_ATTENUATION:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_CONST] = params[0];
- if ( params[0] == 0.0 )
- fcmd[LIT_ATTEN_CONST_INV] = FLT_MAX;
- else
- fcmd[LIT_ATTEN_CONST_INV] = 1.0 / params[0];
- break;
- case GL_LINEAR_ATTENUATION:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_LINEAR] = params[0];
- break;
- case GL_QUADRATIC_ATTENUATION:
- RADEON_STATECHANGE(rmesa, lit[p]);
- fcmd[LIT_ATTEN_QUADRATIC] = params[0];
- break;
- default:
- return;
- }
-
- /* Set RANGE_ATTEN only when needed */
- switch (pname) {
- case GL_POSITION:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- {
- GLuint *icmd = (GLuint *)RADEON_DB_STATE( tcl );
- GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2;
- GLuint atten_flag = ( p&1 ) ? RADEON_LIGHT_1_ENABLE_RANGE_ATTEN
- : RADEON_LIGHT_0_ENABLE_RANGE_ATTEN;
- GLuint atten_const_flag = ( p&1 ) ? RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN
- : RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN;
-
- if ( l->EyePosition[3] == 0.0F ||
- ( ( fcmd[LIT_ATTEN_CONST] == 0.0 || fcmd[LIT_ATTEN_CONST] == 1.0 ) &&
- fcmd[LIT_ATTEN_QUADRATIC] == 0.0 && fcmd[LIT_ATTEN_LINEAR] == 0.0 ) ) {
- /* Disable attenuation */
- icmd[idx] &= ~atten_flag;
- } else {
- if ( fcmd[LIT_ATTEN_QUADRATIC] == 0.0 && fcmd[LIT_ATTEN_LINEAR] == 0.0 ) {
- /* Enable only constant portion of attenuation calculation */
- icmd[idx] |= ( atten_flag | atten_const_flag );
- } else {
- /* Enable full attenuation calculation */
- icmd[idx] &= ~atten_const_flag;
- icmd[idx] |= atten_flag;
- }
- }
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.tcl );
- break;
- }
- default:
- break;
- }
-}
-
-
-
-
-static void radeonLightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *param )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- update_global_ambient( ctx );
- break;
-
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- RADEON_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.LocalViewer)
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LOCAL_VIEWER;
- else
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LOCAL_VIEWER;
- break;
-
- case GL_LIGHT_MODEL_TWO_SIDE:
- RADEON_STATECHANGE( rmesa, tcl );
- if (ctx->Light.Model.TwoSide)
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_LIGHT_TWOSIDE;
- else
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_LIGHT_TWOSIDE;
-
- check_twoside_fallback( ctx );
-
- if (rmesa->TclFallback) {
- radeonChooseRenderState( ctx );
- radeonChooseVertexState( ctx );
- }
- break;
-
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- radeonUpdateSpecular(ctx);
- break;
-
- default:
- break;
- }
-}
-
-static void radeonShadeModel( GLcontext *ctx, GLenum mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint s = rmesa->hw.set.cmd[SET_SE_CNTL];
-
- s &= ~(RADEON_DIFFUSE_SHADE_MASK |
- RADEON_ALPHA_SHADE_MASK |
- RADEON_SPECULAR_SHADE_MASK |
- RADEON_FOG_SHADE_MASK);
-
- switch ( mode ) {
- case GL_FLAT:
- s |= (RADEON_DIFFUSE_SHADE_FLAT |
- RADEON_ALPHA_SHADE_FLAT |
- RADEON_SPECULAR_SHADE_FLAT |
- RADEON_FOG_SHADE_FLAT);
- break;
- case GL_SMOOTH:
- s |= (RADEON_DIFFUSE_SHADE_GOURAUD |
- RADEON_ALPHA_SHADE_GOURAUD |
- RADEON_SPECULAR_SHADE_GOURAUD |
- RADEON_FOG_SHADE_GOURAUD);
- break;
- default:
- return;
- }
-
- if ( rmesa->hw.set.cmd[SET_SE_CNTL] != s ) {
- RADEON_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] = s;
- }
-}
-
-
-/* =============================================================
- * User clip planes
- */
-
-static void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq )
-{
- GLint p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
-
- RADEON_STATECHANGE( rmesa, ucp[p] );
- rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
- rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
- rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
- rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
-}
-
-static void radeonUpdateClipPlanes( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint p;
-
- for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
- if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
- GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p];
-
- RADEON_STATECHANGE( rmesa, ucp[p] );
- rmesa->hw.ucp[p].cmd[UCP_X] = ip[0];
- rmesa->hw.ucp[p].cmd[UCP_Y] = ip[1];
- rmesa->hw.ucp[p].cmd[UCP_Z] = ip[2];
- rmesa->hw.ucp[p].cmd[UCP_W] = ip[3];
- }
- }
-}
-
-
-/* =============================================================
- * Stencil
- */
-
-static void radeonStencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint refmask = ((ctx->Stencil.Ref[0] << RADEON_STENCIL_REF_SHIFT) |
- (ctx->Stencil.ValueMask[0] << RADEON_STENCIL_MASK_SHIFT));
-
- RADEON_STATECHANGE( rmesa, ctx );
- RADEON_STATECHANGE( rmesa, msk );
-
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_STENCIL_TEST_MASK;
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~(RADEON_STENCIL_REF_MASK|
- RADEON_STENCIL_VALUE_MASK);
-
- switch ( ctx->Stencil.Function[0] ) {
- case GL_NEVER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_NEVER;
- break;
- case GL_LESS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_LESS;
- break;
- case GL_EQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_EQUAL;
- break;
- case GL_LEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_LEQUAL;
- break;
- case GL_GREATER:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_GREATER;
- break;
- case GL_NOTEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_NEQUAL;
- break;
- case GL_GEQUAL:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_GEQUAL;
- break;
- case GL_ALWAYS:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_ALWAYS;
- break;
- }
-
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= refmask;
-}
-
-static void radeonStencilMask( GLcontext *ctx, GLuint mask )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- RADEON_STATECHANGE( rmesa, msk );
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~RADEON_STENCIL_WRITE_MASK;
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |=
- (ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT);
-}
-
-static void radeonStencilOp( GLcontext *ctx, GLenum fail,
- GLenum zfail, GLenum zpass )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- /* radeon 7200 have stencil bug, DEC and INC_WRAP will actually both do DEC_WRAP,
- and DEC_WRAP (and INVERT) will do INVERT. No way to get correct INC_WRAP and DEC,
- but DEC_WRAP can be fixed by using DEC and INC_WRAP at least use INC. */
-
- GLuint tempRADEON_STENCIL_FAIL_DEC_WRAP;
- GLuint tempRADEON_STENCIL_FAIL_INC_WRAP;
- GLuint tempRADEON_STENCIL_ZFAIL_DEC_WRAP;
- GLuint tempRADEON_STENCIL_ZFAIL_INC_WRAP;
- GLuint tempRADEON_STENCIL_ZPASS_DEC_WRAP;
- GLuint tempRADEON_STENCIL_ZPASS_INC_WRAP;
-
- if (rmesa->radeonScreen->chipset & RADEON_CHIPSET_BROKEN_STENCIL) {
- tempRADEON_STENCIL_FAIL_DEC_WRAP = RADEON_STENCIL_FAIL_DEC;
- tempRADEON_STENCIL_FAIL_INC_WRAP = RADEON_STENCIL_FAIL_INC;
- tempRADEON_STENCIL_ZFAIL_DEC_WRAP = RADEON_STENCIL_ZFAIL_DEC;
- tempRADEON_STENCIL_ZFAIL_INC_WRAP = RADEON_STENCIL_ZFAIL_INC;
- tempRADEON_STENCIL_ZPASS_DEC_WRAP = RADEON_STENCIL_ZPASS_DEC;
- tempRADEON_STENCIL_ZPASS_INC_WRAP = RADEON_STENCIL_ZPASS_INC;
- }
- else {
- tempRADEON_STENCIL_FAIL_DEC_WRAP = RADEON_STENCIL_FAIL_DEC_WRAP;
- tempRADEON_STENCIL_FAIL_INC_WRAP = RADEON_STENCIL_FAIL_INC_WRAP;
- tempRADEON_STENCIL_ZFAIL_DEC_WRAP = RADEON_STENCIL_ZFAIL_DEC_WRAP;
- tempRADEON_STENCIL_ZFAIL_INC_WRAP = RADEON_STENCIL_ZFAIL_INC_WRAP;
- tempRADEON_STENCIL_ZPASS_DEC_WRAP = RADEON_STENCIL_ZPASS_DEC_WRAP;
- tempRADEON_STENCIL_ZPASS_INC_WRAP = RADEON_STENCIL_ZPASS_INC_WRAP;
- }
-
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~(RADEON_STENCIL_FAIL_MASK |
- RADEON_STENCIL_ZFAIL_MASK |
- RADEON_STENCIL_ZPASS_MASK);
-
- switch ( ctx->Stencil.FailFunc[0] ) {
- case GL_KEEP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_KEEP;
- break;
- case GL_ZERO:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_ZERO;
- break;
- case GL_REPLACE:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_REPLACE;
- break;
- case GL_INCR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_INC;
- break;
- case GL_DECR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_DEC;
- break;
- case GL_INCR_WRAP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= tempRADEON_STENCIL_FAIL_INC_WRAP;
- break;
- case GL_DECR_WRAP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= tempRADEON_STENCIL_FAIL_DEC_WRAP;
- break;
- case GL_INVERT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_INVERT;
- break;
- }
-
- switch ( ctx->Stencil.ZFailFunc[0] ) {
- case GL_KEEP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_KEEP;
- break;
- case GL_ZERO:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_ZERO;
- break;
- case GL_REPLACE:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_REPLACE;
- break;
- case GL_INCR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_INC;
- break;
- case GL_DECR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_DEC;
- break;
- case GL_INCR_WRAP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= tempRADEON_STENCIL_ZFAIL_INC_WRAP;
- break;
- case GL_DECR_WRAP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= tempRADEON_STENCIL_ZFAIL_DEC_WRAP;
- break;
- case GL_INVERT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_INVERT;
- break;
- }
-
- switch ( ctx->Stencil.ZPassFunc[0] ) {
- case GL_KEEP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_KEEP;
- break;
- case GL_ZERO:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_ZERO;
- break;
- case GL_REPLACE:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_REPLACE;
- break;
- case GL_INCR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_INC;
- break;
- case GL_DECR:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_DEC;
- break;
- case GL_INCR_WRAP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= tempRADEON_STENCIL_ZPASS_INC_WRAP;
- break;
- case GL_DECR_WRAP:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= tempRADEON_STENCIL_ZPASS_DEC_WRAP;
- break;
- case GL_INVERT:
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_INVERT;
- break;
- }
-}
-
-static void radeonClearStencil( GLcontext *ctx, GLint s )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- rmesa->state.stencil.clear =
- ((GLuint) ctx->Stencil.Clear |
- (0xff << RADEON_STENCIL_MASK_SHIFT) |
- (ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT));
-}
-
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-/*
- * To correctly position primitives:
- */
-#define SUBPIXEL_X 0.125
-#define SUBPIXEL_Y 0.125
-
-void radeonUpdateWindow( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat sx = v[MAT_SX];
- GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
- GLfloat sy = - v[MAT_SY];
- GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
- GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
- GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
- RADEON_FIREVERTICES( rmesa );
- RADEON_STATECHANGE( rmesa, vpt );
-
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = *(GLuint *)&sx;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = *(GLuint *)&sy;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = *(GLuint *)&sz;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = *(GLuint *)&tz;
-}
-
-
-
-static void radeonViewport( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- /* Don't pipeline viewport changes, conflict with window offset
- * setting below. Could apply deltas to rescue pipelined viewport
- * values, or keep the originals hanging around.
- */
- RADEON_FIREVERTICES( RADEON_CONTEXT(ctx) );
- radeonUpdateWindow( ctx );
-}
-
-static void radeonDepthRange( GLcontext *ctx, GLclampd nearval,
- GLclampd farval )
-{
- radeonUpdateWindow( ctx );
-}
-
-void radeonUpdateViewportOffset( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
- GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
-
- if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != *(GLuint *)&tx ||
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != *(GLuint *)&ty )
- {
- /* Note: this should also modify whatever data the context reset
- * code uses...
- */
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = *(GLuint *)&tx;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = *(GLuint *)&ty;
-
- /* update polygon stipple x/y screen offset */
- {
- GLuint stx, sty;
- GLuint m = rmesa->hw.msc.cmd[MSC_RE_MISC];
-
- m &= ~(RADEON_STIPPLE_X_OFFSET_MASK |
- RADEON_STIPPLE_Y_OFFSET_MASK);
-
- /* add magic offsets, then invert */
- stx = 31 - ((rmesa->dri.drawable->x - 1) & RADEON_STIPPLE_COORD_MASK);
- sty = 31 - ((rmesa->dri.drawable->y + rmesa->dri.drawable->h - 1)
- & RADEON_STIPPLE_COORD_MASK);
-
- m |= ((stx << RADEON_STIPPLE_X_OFFSET_SHIFT) |
- (sty << RADEON_STIPPLE_Y_OFFSET_SHIFT));
-
- if ( rmesa->hw.msc.cmd[MSC_RE_MISC] != m ) {
- RADEON_STATECHANGE( rmesa, msc );
- rmesa->hw.msc.cmd[MSC_RE_MISC] = m;
- }
- }
- }
-
- radeonUpdateScissor( ctx );
-}
-
-
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void radeonClearColor( GLcontext *ctx, const GLfloat color[4] )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLubyte c[4];
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
- rmesa->state.color.clear = radeonPackColor( rmesa->radeonScreen->cpp,
- c[0], c[1], c[2], c[3] );
-}
-
-
-static void radeonRenderMode( GLcontext *ctx, GLenum mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- FALLBACK( rmesa, RADEON_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
-}
-
-
-static GLuint radeon_rop_tab[] = {
- RADEON_ROP_CLEAR,
- RADEON_ROP_AND,
- RADEON_ROP_AND_REVERSE,
- RADEON_ROP_COPY,
- RADEON_ROP_AND_INVERTED,
- RADEON_ROP_NOOP,
- RADEON_ROP_XOR,
- RADEON_ROP_OR,
- RADEON_ROP_NOR,
- RADEON_ROP_EQUIV,
- RADEON_ROP_INVERT,
- RADEON_ROP_OR_REVERSE,
- RADEON_ROP_COPY_INVERTED,
- RADEON_ROP_OR_INVERTED,
- RADEON_ROP_NAND,
- RADEON_ROP_SET,
-};
-
-static void radeonLogicOpCode( GLcontext *ctx, GLenum opcode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint rop = (GLuint)opcode - GL_CLEAR;
-
- ASSERT( rop < 16 );
-
- RADEON_STATECHANGE( rmesa, msk );
- rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = radeon_rop_tab[rop];
-}
-
-
-void radeonSetCliprects( radeonContextPtr rmesa, GLenum mode )
-{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
- break;
- case GL_BACK_LEFT:
- /* Can't ignore 2d windows if we are page flipping.
- */
- if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) {
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
- }
- else {
- rmesa->numClipRects = dPriv->numBackClipRects;
- rmesa->pClipRects = dPriv->pBackClipRects;
- }
- break;
- default:
- fprintf(stderr, "bad mode in radeonSetCliprects\n");
- return;
- }
-
- if (rmesa->state.scissor.enabled)
- radeonRecalcScissorRects( rmesa );
-}
-
-
-static void radeonDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( mode ));
-
- RADEON_FIREVERTICES(rmesa); /* don't pipeline cliprect changes */
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
- radeonSetCliprects( rmesa, GL_FRONT_LEFT );
- break;
- case BUFFER_BIT_BACK_LEFT:
- FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
- radeonSetCliprects( rmesa, GL_BACK_LEFT );
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that r200SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset +
- rmesa->radeonScreen->fbLocation)
- & RADEON_COLOROFFSET_MASK);
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= RADEON_COLOR_TILE_ENABLE;
- }
-}
-
-static void radeonReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-
-/* =============================================================
- * State enable/disable
- */
-
-static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint p, flag;
-
- if ( RADEON_DEBUG & DEBUG_STATE )
- fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( cap ),
- state ? "GL_TRUE" : "GL_FALSE" );
-
- switch ( cap ) {
- /* Fast track this one...
- */
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- break;
-
- case GL_ALPHA_TEST:
- RADEON_STATECHANGE( rmesa, ctx );
- if (state) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_ALPHA_TEST_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_ALPHA_TEST_ENABLE;
- }
- break;
-
- case GL_BLEND:
- RADEON_STATECHANGE( rmesa, ctx );
- if (state) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ALPHA_BLEND_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ALPHA_BLEND_ENABLE;
- }
- if ( ctx->Color._LogicOpEnabled ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE;
- }
-
- /* Catch a possible fallback:
- */
- if (state) {
- ctx->Driver.BlendEquationSeparate( ctx,
- ctx->Color.BlendEquationRGB,
- ctx->Color.BlendEquationA );
- ctx->Driver.BlendFuncSeparate( ctx, ctx->Color.BlendSrcRGB,
- ctx->Color.BlendDstRGB,
- ctx->Color.BlendSrcA,
- ctx->Color.BlendDstA );
- }
- else {
- FALLBACK( rmesa, RADEON_FALLBACK_BLEND_FUNC, GL_FALSE );
- FALLBACK( rmesa, RADEON_FALLBACK_BLEND_EQ, GL_FALSE );
- }
- break;
-
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5:
- p = cap-GL_CLIP_PLANE0;
- RADEON_STATECHANGE( rmesa, tcl );
- if (state) {
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= (RADEON_UCP_ENABLE_0<<p);
- radeonClipPlane( ctx, cap, NULL );
- }
- else {
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(RADEON_UCP_ENABLE_0<<p);
- }
- break;
-
- case GL_COLOR_MATERIAL:
- radeonColorMaterial( ctx, 0, 0 );
- radeonUpdateMaterial( ctx );
- break;
-
- case GL_CULL_FACE:
- radeonCullFace( ctx, 0 );
- break;
-
- case GL_DEPTH_TEST:
- RADEON_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_Z_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_Z_ENABLE;
- }
- break;
-
- case GL_DITHER:
- RADEON_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_DITHER_ENABLE;
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~rmesa->state.color.roundEnable;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_DITHER_ENABLE;
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= rmesa->state.color.roundEnable;
- }
- break;
-
- case GL_FOG:
- RADEON_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_FOG_ENABLE;
- radeonFogfv( ctx, GL_FOG_MODE, NULL );
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_FOG_ENABLE;
- RADEON_STATECHANGE(rmesa, tcl);
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_TCL_FOG_MASK;
- }
- radeonUpdateSpecular( ctx ); /* for PK_SPEC */
- if (rmesa->TclFallback)
- radeonChooseVertexState( ctx );
- _mesa_allow_light_in_model( ctx, !state );
- break;
-
- case GL_LIGHT0:
- case GL_LIGHT1:
- case GL_LIGHT2:
- case GL_LIGHT3:
- case GL_LIGHT4:
- case GL_LIGHT5:
- case GL_LIGHT6:
- case GL_LIGHT7:
- RADEON_STATECHANGE(rmesa, tcl);
- p = cap - GL_LIGHT0;
- if (p&1)
- flag = (RADEON_LIGHT_1_ENABLE |
- RADEON_LIGHT_1_ENABLE_AMBIENT |
- RADEON_LIGHT_1_ENABLE_SPECULAR);
- else
- flag = (RADEON_LIGHT_0_ENABLE |
- RADEON_LIGHT_0_ENABLE_AMBIENT |
- RADEON_LIGHT_0_ENABLE_SPECULAR);
-
- if (state)
- rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] |= flag;
- else
- rmesa->hw.tcl.cmd[p/2 + TCL_PER_LIGHT_CTL_0] &= ~flag;
-
- /*
- */
- update_light_colors( ctx, p );
- break;
-
- case GL_LIGHTING:
- RADEON_STATECHANGE(rmesa, tcl);
- radeonUpdateSpecular(ctx);
- check_twoside_fallback( ctx );
- break;
-
- case GL_LINE_SMOOTH:
- RADEON_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_ANTI_ALIAS_LINE;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_ANTI_ALIAS_LINE;
- }
- break;
-
- case GL_LINE_STIPPLE:
- RADEON_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_PATTERN_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_PATTERN_ENABLE;
- }
- break;
-
- case GL_COLOR_LOGIC_OP:
- RADEON_STATECHANGE( rmesa, ctx );
- if ( ctx->Color._LogicOpEnabled ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE;
- }
- break;
-
- case GL_NORMALIZE:
- RADEON_STATECHANGE( rmesa, tcl );
- if ( state ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_NORMALIZE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_NORMALIZE_NORMALS;
- }
- break;
-
- case GL_POLYGON_OFFSET_POINT:
- if (rmesa->dri.drmMinor == 1) {
- radeonChooseRenderState( ctx );
- }
- else {
- RADEON_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_POINT;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_POINT;
- }
- }
- break;
-
- case GL_POLYGON_OFFSET_LINE:
- if (rmesa->dri.drmMinor == 1) {
- radeonChooseRenderState( ctx );
- }
- else {
- RADEON_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_LINE;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_LINE;
- }
- }
- break;
-
- case GL_POLYGON_OFFSET_FILL:
- if (rmesa->dri.drmMinor == 1) {
- radeonChooseRenderState( ctx );
- }
- else {
- RADEON_STATECHANGE( rmesa, set );
- if ( state ) {
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_TRI;
- } else {
- rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_TRI;
- }
- }
- break;
-
- case GL_POLYGON_SMOOTH:
- RADEON_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_ANTI_ALIAS_POLY;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_ANTI_ALIAS_POLY;
- }
- break;
-
- case GL_POLYGON_STIPPLE:
- RADEON_STATECHANGE(rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= RADEON_STIPPLE_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~RADEON_STIPPLE_ENABLE;
- }
- break;
-
- case GL_RESCALE_NORMAL_EXT: {
- GLboolean tmp = ctx->_NeedEyeCoords ? state : !state;
- RADEON_STATECHANGE( rmesa, tcl );
- if ( tmp ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_RESCALE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
- }
- break;
- }
-
- case GL_SCISSOR_TEST:
- RADEON_FIREVERTICES( rmesa );
- rmesa->state.scissor.enabled = state;
- radeonUpdateScissor( ctx );
- break;
-
- case GL_STENCIL_TEST:
- if ( rmesa->state.stencil.hwBuffer ) {
- RADEON_STATECHANGE( rmesa, ctx );
- if ( state ) {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_STENCIL_ENABLE;
- } else {
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_STENCIL_ENABLE;
- }
- } else {
- FALLBACK( rmesa, RADEON_FALLBACK_STENCIL, state );
- }
- break;
-
- case GL_TEXTURE_GEN_Q:
- case GL_TEXTURE_GEN_R:
- case GL_TEXTURE_GEN_S:
- case GL_TEXTURE_GEN_T:
- /* Picked up in radeonUpdateTextureState.
- */
- rmesa->recheck_texgen[ctx->Texture.CurrentUnit] = GL_TRUE;
- break;
-
- case GL_COLOR_SUM_EXT:
- radeonUpdateSpecular ( ctx );
- break;
-
- default:
- return;
- }
-}
-
-
-static void radeonLightingSpaceChange( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLboolean tmp;
- RADEON_STATECHANGE( rmesa, tcl );
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d BEFORE %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]);
-
- if (ctx->_NeedEyeCoords)
- tmp = ctx->Transform.RescaleNormals;
- else
- tmp = !ctx->Transform.RescaleNormals;
-
- if ( tmp ) {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_RESCALE_NORMALS;
- } else {
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
- }
-
- if (RADEON_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d AFTER %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]);
-}
-
-/* =============================================================
- * Deferred state management - matrices, textures, other?
- */
-
-
-
-
-static void upload_matrix( radeonContextPtr rmesa, GLfloat *src, int idx )
-{
- float *dest = ((float *)RADEON_DB_STATE( mat[idx] ))+MAT_ELT_0;
- int i;
-
-
- for (i = 0 ; i < 4 ; i++) {
- *dest++ = src[i];
- *dest++ = src[i+4];
- *dest++ = src[i+8];
- *dest++ = src[i+12];
- }
-
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
-}
-
-static void upload_matrix_t( radeonContextPtr rmesa, GLfloat *src, int idx )
-{
- float *dest = ((float *)RADEON_DB_STATE( mat[idx] ))+MAT_ELT_0;
- memcpy(dest, src, 16*sizeof(float));
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] );
-}
-
-
-static void update_texturematrix( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- GLuint tpc = rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL];
- GLuint vs = rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL];
- int unit;
-
- rmesa->TexMatEnabled = 0;
-
- for (unit = 0 ; unit < 2; unit++) {
- if (!ctx->Texture.Unit[unit]._ReallyEnabled) {
- }
- else if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
- GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4;
-
- rmesa->TexMatEnabled |= (RADEON_TEXGEN_TEXMAT_0_ENABLE|
- RADEON_TEXMAT_0_ENABLE) << unit;
-
- if (rmesa->TexGenEnabled & (RADEON_TEXMAT_0_ENABLE << unit)) {
- /* Need to preconcatenate any active texgen
- * obj/eyeplane matrices:
- */
- _math_matrix_mul_matrix( &rmesa->tmpmat,
- &rmesa->TexGenMatrix[unit],
- ctx->TextureMatrixStack[unit].Top );
- upload_matrix( rmesa, rmesa->tmpmat.m, TEXMAT_0+unit );
- }
- else {
- rmesa->TexMatEnabled |=
- (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
- upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m,
- TEXMAT_0+unit );
- }
- }
- else if (rmesa->TexGenEnabled & (RADEON_TEXMAT_0_ENABLE << unit)) {
- upload_matrix( rmesa, rmesa->TexGenMatrix[unit].m,
- TEXMAT_0+unit );
- }
- }
-
-
- tpc = (rmesa->TexMatEnabled | rmesa->TexGenEnabled);
-
- vs &= ~((0xf << RADEON_TCL_TEX_0_OUTPUT_SHIFT) |
- (0xf << RADEON_TCL_TEX_1_OUTPUT_SHIFT));
-
- if (tpc & RADEON_TEXGEN_TEXMAT_0_ENABLE)
- vs |= RADEON_TCL_TEX_COMPUTED_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT;
- else
- vs |= RADEON_TCL_TEX_INPUT_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT;
-
- if (tpc & RADEON_TEXGEN_TEXMAT_1_ENABLE)
- vs |= RADEON_TCL_TEX_COMPUTED_TEX_1 << RADEON_TCL_TEX_1_OUTPUT_SHIFT;
- else
- vs |= RADEON_TCL_TEX_INPUT_TEX_1 << RADEON_TCL_TEX_1_OUTPUT_SHIFT;
-
- if (tpc != rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] ||
- vs != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL]) {
-
- RADEON_STATECHANGE(rmesa, tcl);
- rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = tpc;
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] = vs;
- }
-}
-
-
-
-void radeonValidateState( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint new_state = rmesa->NewGLState;
-
- if (new_state & _NEW_TEXTURE) {
- radeonUpdateTextureState( ctx );
- new_state |= rmesa->NewGLState; /* may add TEXTURE_MATRIX */
- }
-
- /* Need an event driven matrix update?
- */
- if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
- upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, MODEL_PROJ );
-
- /* Need these for lighting (shouldn't upload otherwise)
- */
- if (new_state & (_NEW_MODELVIEW)) {
- upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, MODEL );
- upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, MODEL_IT );
- }
-
- /* Does this need to be triggered on eg. modelview for
- * texgen-derived objplane/eyeplane matrices?
- */
- if (new_state & _NEW_TEXTURE_MATRIX) {
- update_texturematrix( ctx );
- }
-
- if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW|_MESA_NEW_NEED_EYE_COORDS)) {
- update_light( ctx );
- }
-
- /* emit all active clip planes if projection matrix changes.
- */
- if (new_state & (_NEW_PROJECTION)) {
- if (ctx->Transform.ClipPlanesEnabled)
- radeonUpdateClipPlanes( ctx );
- }
-
-
- rmesa->NewGLState = 0;
-}
-
-
-static void radeonInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- _ae_invalidate_state( ctx, new_state );
- RADEON_CONTEXT(ctx)->NewGLState |= new_state;
- radeonVtxfmtInvalidate( ctx );
-}
-
-
-/* A hack. Need a faster way to find this out.
- */
-static GLboolean check_material( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLint i;
-
- for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT;
- i < _TNL_ATTRIB_MAT_BACK_INDEXES;
- i++)
- if (tnl->vb.AttribPtr[i] &&
- tnl->vb.AttribPtr[i]->stride)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-static void radeonWrapRunPipeline( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLboolean has_material;
-
- if (0)
- fprintf(stderr, "%s, newstate: %x\n", __FUNCTION__, rmesa->NewGLState);
-
- /* Validate state:
- */
- if (rmesa->NewGLState)
- radeonValidateState( ctx );
-
- has_material = (ctx->Light.Enabled && check_material( ctx ));
-
- if (has_material) {
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_MATERIAL, GL_TRUE );
- }
-
- /* Run the pipeline.
- */
- _tnl_run_pipeline( ctx );
-
- if (has_material) {
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_MATERIAL, GL_FALSE );
- }
-}
-
-
-/* Initialize the driver's state functions.
- */
-void radeonInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = radeonInvalidateState;
- ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange;
-
- ctx->Driver.DrawBuffer = radeonDrawBuffer;
- ctx->Driver.ReadBuffer = radeonReadBuffer;
-
- ctx->Driver.AlphaFunc = radeonAlphaFunc;
- ctx->Driver.BlendEquationSeparate = radeonBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate;
- ctx->Driver.ClearColor = radeonClearColor;
- ctx->Driver.ClearDepth = radeonClearDepth;
- ctx->Driver.ClearIndex = NULL;
- ctx->Driver.ClearStencil = radeonClearStencil;
- ctx->Driver.ClipPlane = radeonClipPlane;
- ctx->Driver.ColorMask = radeonColorMask;
- ctx->Driver.CullFace = radeonCullFace;
- ctx->Driver.DepthFunc = radeonDepthFunc;
- ctx->Driver.DepthMask = radeonDepthMask;
- ctx->Driver.DepthRange = radeonDepthRange;
- ctx->Driver.Enable = radeonEnable;
- ctx->Driver.Fogfv = radeonFogfv;
- ctx->Driver.FrontFace = radeonFrontFace;
- ctx->Driver.Hint = NULL;
- ctx->Driver.IndexMask = NULL;
- ctx->Driver.LightModelfv = radeonLightModelfv;
- ctx->Driver.Lightfv = radeonLightfv;
- ctx->Driver.LineStipple = radeonLineStipple;
- ctx->Driver.LineWidth = radeonLineWidth;
- ctx->Driver.LogicOpcode = radeonLogicOpCode;
- ctx->Driver.PolygonMode = radeonPolygonMode;
-
- if (RADEON_CONTEXT(ctx)->dri.drmMinor > 1)
- ctx->Driver.PolygonOffset = radeonPolygonOffset;
-
- ctx->Driver.PolygonStipple = radeonPolygonStipple;
- ctx->Driver.RenderMode = radeonRenderMode;
- ctx->Driver.Scissor = radeonScissor;
- ctx->Driver.ShadeModel = radeonShadeModel;
- ctx->Driver.StencilFunc = radeonStencilFunc;
- ctx->Driver.StencilMask = radeonStencilMask;
- ctx->Driver.StencilOp = radeonStencilOp;
- ctx->Driver.Viewport = radeonViewport;
-
- /* Pixel path fallbacks
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-
- TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange = radeonUpdateMaterial;
- TNL_CONTEXT(ctx)->Driver.RunPipeline = radeonWrapRunPipeline;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.h
deleted file mode 100644
index 07739be94..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.h,v 1.5 2002/11/05 17:46:09 tsi Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __RADEON_STATE_H__
-#define __RADEON_STATE_H__
-
-#include "radeon_context.h"
-
-extern void radeonInitState( radeonContextPtr rmesa );
-extern void radeonInitStateFuncs( GLcontext *ctx );
-
-extern void radeonUpdateMaterial( GLcontext *ctx );
-
-extern void radeonSetCliprects( radeonContextPtr rmesa, GLenum mode );
-extern void radeonRecalcScissorRects( radeonContextPtr rmesa );
-extern void radeonUpdateViewportOffset( GLcontext *ctx );
-extern void radeonUpdateWindow( GLcontext *ctx );
-
-extern void radeonValidateState( GLcontext *ctx );
-
-extern void radeonPrintDirty( radeonContextPtr rmesa,
- const char *msg );
-
-
-extern void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( rmesa, bit, mode ) do { \
- if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n", \
- __FUNCTION__, bit, mode ); \
- radeonFallback( rmesa->glCtx, bit, mode ); \
-} while (0)
-
-
-#define MODEL_PROJ 0
-#define MODEL 1
-#define MODEL_IT 2
-#define TEXMAT_0 3
-#define TEXMAT_1 4
-#define TEXMAT_2 5
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state_init.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state_init.c
deleted file mode 100644
index 1caffe132..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_state_init.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c,v 1.3 2003/02/22 06:21:11 dawes Exp $ */
-/*
- * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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 SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_tcl.h"
-#include "radeon_tex.h"
-#include "radeon_swtcl.h"
-#include "radeon_vtxfmt.h"
-
-#include "xmlpool.h"
-
-/* =============================================================
- * State initialization
- */
-
-void radeonPrintDirty( radeonContextPtr rmesa, const char *msg )
-{
- struct radeon_state_atom *l;
-
- fprintf(stderr, msg);
- fprintf(stderr, ": ");
-
- foreach(l, &rmesa->hw.atomlist) {
- if (l->dirty || rmesa->hw.all_dirty)
- fprintf(stderr, "%s, ", l->name);
- }
-
- fprintf(stderr, "\n");
-}
-
-static int cmdpkt( int id )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.packet.cmd_type = RADEON_CMD_PACKET;
- h.packet.packet_id = id;
- return h.i;
-}
-
-static int cmdvec( int offset, int stride, int count )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.vectors.cmd_type = RADEON_CMD_VECTORS;
- h.vectors.offset = offset;
- h.vectors.stride = stride;
- h.vectors.count = count;
- return h.i;
-}
-
-static int cmdscl( int offset, int stride, int count )
-{
- drm_radeon_cmd_header_t h;
- h.i = 0;
- h.scalars.cmd_type = RADEON_CMD_SCALARS;
- h.scalars.offset = offset;
- h.scalars.stride = stride;
- h.scalars.count = count;
- return h.i;
-}
-
-#define CHECK( NM, FLAG ) \
-static GLboolean check_##NM( GLcontext *ctx ) \
-{ \
- return FLAG; \
-}
-
-#define TCL_CHECK( NM, FLAG ) \
-static GLboolean check_##NM( GLcontext *ctx ) \
-{ \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- return !rmesa->TclFallback && (FLAG); \
-}
-
-
-CHECK( always, GL_TRUE )
-CHECK( tex0, ctx->Texture.Unit[0]._ReallyEnabled )
-CHECK( tex1, ctx->Texture.Unit[1]._ReallyEnabled )
-CHECK( fog, ctx->Fog.Enabled )
-TCL_CHECK( tcl, GL_TRUE )
-TCL_CHECK( tcl_tex0, ctx->Texture.Unit[0]._ReallyEnabled )
-TCL_CHECK( tcl_tex1, ctx->Texture.Unit[1]._ReallyEnabled )
-TCL_CHECK( tcl_lighting, ctx->Light.Enabled )
-TCL_CHECK( tcl_eyespace_or_lighting, ctx->_NeedEyeCoords || ctx->Light.Enabled )
-TCL_CHECK( tcl_lit0, ctx->Light.Enabled && ctx->Light.Light[0].Enabled )
-TCL_CHECK( tcl_lit1, ctx->Light.Enabled && ctx->Light.Light[1].Enabled )
-TCL_CHECK( tcl_lit2, ctx->Light.Enabled && ctx->Light.Light[2].Enabled )
-TCL_CHECK( tcl_lit3, ctx->Light.Enabled && ctx->Light.Light[3].Enabled )
-TCL_CHECK( tcl_lit4, ctx->Light.Enabled && ctx->Light.Light[4].Enabled )
-TCL_CHECK( tcl_lit5, ctx->Light.Enabled && ctx->Light.Light[5].Enabled )
-TCL_CHECK( tcl_lit6, ctx->Light.Enabled && ctx->Light.Light[6].Enabled )
-TCL_CHECK( tcl_lit7, ctx->Light.Enabled && ctx->Light.Light[7].Enabled )
-TCL_CHECK( tcl_ucp0, (ctx->Transform.ClipPlanesEnabled & 0x1) )
-TCL_CHECK( tcl_ucp1, (ctx->Transform.ClipPlanesEnabled & 0x2) )
-TCL_CHECK( tcl_ucp2, (ctx->Transform.ClipPlanesEnabled & 0x4) )
-TCL_CHECK( tcl_ucp3, (ctx->Transform.ClipPlanesEnabled & 0x8) )
-TCL_CHECK( tcl_ucp4, (ctx->Transform.ClipPlanesEnabled & 0x10) )
-TCL_CHECK( tcl_ucp5, (ctx->Transform.ClipPlanesEnabled & 0x20) )
-TCL_CHECK( tcl_eyespace_or_fog, ctx->_NeedEyeCoords || ctx->Fog.Enabled )
-
-CHECK( txr0, (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_RECT_BIT))
-CHECK( txr1, (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_RECT_BIT))
-
-
-
-/* Initialize the context's hardware state.
- */
-void radeonInitState( radeonContextPtr rmesa )
-{
- GLcontext *ctx = rmesa->glCtx;
- GLuint color_fmt, depth_fmt, i;
-
- switch ( rmesa->radeonScreen->cpp ) {
- case 2:
- color_fmt = RADEON_COLOR_FORMAT_RGB565;
- break;
- case 4:
- color_fmt = RADEON_COLOR_FORMAT_ARGB8888;
- break;
- default:
- fprintf( stderr, "Error: Unsupported pixel depth... exiting\n" );
- exit( -1 );
- }
-
- rmesa->state.color.clear = 0x00000000;
-
- switch ( ctx->Visual.depthBits ) {
- case 16:
- rmesa->state.depth.clear = 0x0000ffff;
- rmesa->state.depth.scale = 1.0 / (GLfloat)0xffff;
- depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z;
- rmesa->state.stencil.clear = 0x00000000;
- break;
- case 24:
- rmesa->state.depth.clear = 0x00ffffff;
- rmesa->state.depth.scale = 1.0 / (GLfloat)0xffffff;
- depth_fmt = RADEON_DEPTH_FORMAT_24BIT_INT_Z;
- rmesa->state.stencil.clear = 0xffff0000;
- break;
- default:
- fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
- ctx->Visual.depthBits );
- exit( -1 );
- }
-
- /* Only have hw stencil when depth buffer is 24 bits deep */
- rmesa->state.stencil.hwBuffer = ( ctx->Visual.stencilBits > 0 &&
- ctx->Visual.depthBits == 24 );
-
- rmesa->Fallback = 0;
-
- if ( ctx->Visual.doubleBufferMode && rmesa->sarea->pfCurrentPage == 0 ) {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch;
- } else {
- rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
- rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
- }
- rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset;
- rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch;
-
- rmesa->hw.max_state_size = 0;
-
-#define ALLOC_STATE( ATOM, CHK, SZ, NM, FLAG ) \
- do { \
- rmesa->hw.ATOM.cmd_size = SZ; \
- rmesa->hw.ATOM.cmd = (int *)CALLOC(SZ * sizeof(int)); \
- rmesa->hw.ATOM.lastcmd = (int *)CALLOC(SZ * sizeof(int)); \
- rmesa->hw.ATOM.name = NM; \
- rmesa->hw.ATOM.is_tcl = FLAG; \
- rmesa->hw.ATOM.check = check_##CHK; \
- rmesa->hw.ATOM.dirty = GL_TRUE; \
- rmesa->hw.max_state_size += SZ * sizeof(int); \
- } while (0)
-
-
- /* Allocate state buffers:
- */
- ALLOC_STATE( ctx, always, CTX_STATE_SIZE, "CTX/context", 0 );
- ALLOC_STATE( lin, always, LIN_STATE_SIZE, "LIN/line", 0 );
- ALLOC_STATE( msk, always, MSK_STATE_SIZE, "MSK/mask", 0 );
- ALLOC_STATE( vpt, always, VPT_STATE_SIZE, "VPT/viewport", 0 );
- ALLOC_STATE( set, always, SET_STATE_SIZE, "SET/setup", 0 );
- ALLOC_STATE( msc, always, MSC_STATE_SIZE, "MSC/misc", 0 );
- ALLOC_STATE( zbs, always, ZBS_STATE_SIZE, "ZBS/zbias", 0 );
- ALLOC_STATE( tcl, always, TCL_STATE_SIZE, "TCL/tcl", 1 );
- ALLOC_STATE( mtl, tcl_lighting, MTL_STATE_SIZE, "MTL/material", 1 );
- ALLOC_STATE( grd, always, GRD_STATE_SIZE, "GRD/guard-band", 1 );
- ALLOC_STATE( fog, fog, FOG_STATE_SIZE, "FOG/fog", 1 );
- ALLOC_STATE( glt, tcl_lighting, GLT_STATE_SIZE, "GLT/light-global", 1 );
- ALLOC_STATE( eye, tcl_lighting, EYE_STATE_SIZE, "EYE/eye-vector", 1 );
- ALLOC_STATE( tex[0], tex0, TEX_STATE_SIZE, "TEX/tex-0", 0 );
- ALLOC_STATE( tex[1], tex1, TEX_STATE_SIZE, "TEX/tex-1", 0 );
- ALLOC_STATE( mat[0], tcl, MAT_STATE_SIZE, "MAT/modelproject", 1 );
- ALLOC_STATE( mat[1], tcl_eyespace_or_fog, MAT_STATE_SIZE, "MAT/modelview", 1 );
- ALLOC_STATE( mat[2], tcl_eyespace_or_lighting, MAT_STATE_SIZE, "MAT/it-modelview", 1 );
- ALLOC_STATE( mat[3], tcl_tex0, MAT_STATE_SIZE, "MAT/texmat0", 1 );
- ALLOC_STATE( mat[4], tcl_tex1, MAT_STATE_SIZE, "MAT/texmat1", 1 );
- ALLOC_STATE( ucp[0], tcl_ucp0, UCP_STATE_SIZE, "UCP/userclip-0", 1 );
- ALLOC_STATE( ucp[1], tcl_ucp1, UCP_STATE_SIZE, "UCP/userclip-1", 1 );
- ALLOC_STATE( ucp[2], tcl_ucp2, UCP_STATE_SIZE, "UCP/userclip-2", 1 );
- ALLOC_STATE( ucp[3], tcl_ucp3, UCP_STATE_SIZE, "UCP/userclip-3", 1 );
- ALLOC_STATE( ucp[4], tcl_ucp4, UCP_STATE_SIZE, "UCP/userclip-4", 1 );
- ALLOC_STATE( ucp[5], tcl_ucp5, UCP_STATE_SIZE, "UCP/userclip-5", 1 );
- ALLOC_STATE( lit[0], tcl_lit0, LIT_STATE_SIZE, "LIT/light-0", 1 );
- ALLOC_STATE( lit[1], tcl_lit1, LIT_STATE_SIZE, "LIT/light-1", 1 );
- ALLOC_STATE( lit[2], tcl_lit2, LIT_STATE_SIZE, "LIT/light-2", 1 );
- ALLOC_STATE( lit[3], tcl_lit3, LIT_STATE_SIZE, "LIT/light-3", 1 );
- ALLOC_STATE( lit[4], tcl_lit4, LIT_STATE_SIZE, "LIT/light-4", 1 );
- ALLOC_STATE( lit[5], tcl_lit5, LIT_STATE_SIZE, "LIT/light-5", 1 );
- ALLOC_STATE( lit[6], tcl_lit6, LIT_STATE_SIZE, "LIT/light-6", 1 );
- ALLOC_STATE( lit[7], tcl_lit7, LIT_STATE_SIZE, "LIT/light-7", 1 );
- ALLOC_STATE( txr[0], txr0, TXR_STATE_SIZE, "TXR/txr-0", 0 );
- ALLOC_STATE( txr[1], txr1, TXR_STATE_SIZE, "TXR/txr-1", 0 );
-
- radeonSetUpAtomList( rmesa );
-
- /* Fill in the packet headers:
- */
- rmesa->hw.ctx.cmd[CTX_CMD_0] = cmdpkt(RADEON_EMIT_PP_MISC);
- rmesa->hw.ctx.cmd[CTX_CMD_1] = cmdpkt(RADEON_EMIT_PP_CNTL);
- rmesa->hw.ctx.cmd[CTX_CMD_2] = cmdpkt(RADEON_EMIT_RB3D_COLORPITCH);
- rmesa->hw.lin.cmd[LIN_CMD_0] = cmdpkt(RADEON_EMIT_RE_LINE_PATTERN);
- rmesa->hw.lin.cmd[LIN_CMD_1] = cmdpkt(RADEON_EMIT_SE_LINE_WIDTH);
- rmesa->hw.msk.cmd[MSK_CMD_0] = cmdpkt(RADEON_EMIT_RB3D_STENCILREFMASK);
- rmesa->hw.vpt.cmd[VPT_CMD_0] = cmdpkt(RADEON_EMIT_SE_VPORT_XSCALE);
- rmesa->hw.set.cmd[SET_CMD_0] = cmdpkt(RADEON_EMIT_SE_CNTL);
- rmesa->hw.set.cmd[SET_CMD_1] = cmdpkt(RADEON_EMIT_SE_CNTL_STATUS);
- rmesa->hw.msc.cmd[MSC_CMD_0] = cmdpkt(RADEON_EMIT_RE_MISC);
- rmesa->hw.tex[0].cmd[TEX_CMD_0] = cmdpkt(RADEON_EMIT_PP_TXFILTER_0);
- rmesa->hw.tex[0].cmd[TEX_CMD_1] = cmdpkt(RADEON_EMIT_PP_BORDER_COLOR_0);
- rmesa->hw.tex[1].cmd[TEX_CMD_0] = cmdpkt(RADEON_EMIT_PP_TXFILTER_1);
- rmesa->hw.tex[1].cmd[TEX_CMD_1] = cmdpkt(RADEON_EMIT_PP_BORDER_COLOR_1);
- rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(RADEON_EMIT_SE_ZBIAS_FACTOR);
- rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT);
- rmesa->hw.mtl.cmd[MTL_CMD_0] =
- cmdpkt(RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED);
- rmesa->hw.txr[0].cmd[TXR_CMD_0] = cmdpkt(RADEON_EMIT_PP_TEX_SIZE_0);
- rmesa->hw.txr[1].cmd[TXR_CMD_0] = cmdpkt(RADEON_EMIT_PP_TEX_SIZE_1);
- rmesa->hw.grd.cmd[GRD_CMD_0] =
- cmdscl( RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
- rmesa->hw.fog.cmd[FOG_CMD_0] =
- cmdvec( RADEON_VS_FOG_PARAM_ADDR, 1, 4 );
- rmesa->hw.glt.cmd[GLT_CMD_0] =
- cmdvec( RADEON_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
- rmesa->hw.eye.cmd[EYE_CMD_0] =
- cmdvec( RADEON_VS_EYE_VECTOR_ADDR, 1, 4 );
-
- for (i = 0 ; i < 5; i++) {
- rmesa->hw.mat[i].cmd[MAT_CMD_0] =
- cmdvec( RADEON_VS_MATRIX_0_ADDR + i*4, 1, 16);
- }
-
- for (i = 0 ; i < 8; i++) {
- rmesa->hw.lit[i].cmd[LIT_CMD_0] =
- cmdvec( RADEON_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
- rmesa->hw.lit[i].cmd[LIT_CMD_1] =
- cmdscl( RADEON_SS_LIGHT_DCD_ADDR + i, 8, 6 );
- }
-
- for (i = 0 ; i < 6; i++) {
- rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
- cmdvec( RADEON_VS_UCP_ADDR + i, 1, 4 );
- }
-
- rmesa->last_ReallyEnabled = -1;
-
- /* Initial Harware state:
- */
- rmesa->hw.ctx.cmd[CTX_PP_MISC] = (RADEON_ALPHA_TEST_PASS |
- RADEON_CHROMA_FUNC_FAIL |
- RADEON_CHROMA_KEY_NEAREST |
- RADEON_SHADOW_FUNC_EQUAL |
- RADEON_SHADOW_PASS_1 |
- RADEON_RIGHT_HAND_CUBE_OGL);
-
- rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = (RADEON_FOG_VERTEX |
- RADEON_FOG_USE_DEPTH);
-
- rmesa->hw.ctx.cmd[CTX_RE_SOLID_COLOR] = 0x00000000;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = (RADEON_COMB_FCN_ADD_CLAMP |
- RADEON_SRC_BLEND_GL_ONE |
- RADEON_DST_BLEND_GL_ZERO );
-
- rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] =
- rmesa->radeonScreen->depthOffset + rmesa->radeonScreen->fbLocation;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
- ((rmesa->radeonScreen->depthPitch &
- RADEON_DEPTHPITCH_MASK) |
- RADEON_DEPTH_ENDIAN_NO_SWAP);
-
- if (rmesa->using_hyperz)
- rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] |= RADEON_DEPTH_HYPERZ;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] = (depth_fmt |
- RADEON_Z_TEST_LESS |
- RADEON_STENCIL_TEST_ALWAYS |
- RADEON_STENCIL_FAIL_KEEP |
- RADEON_STENCIL_ZPASS_KEEP |
- RADEON_STENCIL_ZFAIL_KEEP |
- RADEON_Z_WRITE_ENABLE);
-
- if (rmesa->using_hyperz) {
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_COMPRESSION_ENABLE |
- RADEON_Z_DECOMPRESSION_ENABLE;
- if (rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL) {
- /* works for q3, but slight rendering errors with glxgears ? */
-/* rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_HIERARCHY_ENABLE;*/
- /* need this otherwise get lots of lockups with q3 ??? */
- rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_FORCE_Z_DIRTY;
- }
- }
-
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (RADEON_SCISSOR_ENABLE |
- RADEON_ANTI_ALIAS_NONE);
-
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] = (RADEON_PLANE_MASK_ENABLE |
- color_fmt |
- RADEON_ZBLOCK16);
-
- switch ( driQueryOptioni( &rmesa->optionCache, "dither_mode" ) ) {
- case DRI_CONF_DITHER_XERRORDIFFRESET:
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_DITHER_INIT;
- break;
- case DRI_CONF_DITHER_ORDERED:
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_SCALE_DITHER_ENABLE;
- break;
- }
- if ( driQueryOptioni( &rmesa->optionCache, "round_mode" ) ==
- DRI_CONF_ROUND_ROUND )
- rmesa->state.color.roundEnable = RADEON_ROUND_ENABLE;
- else
- rmesa->state.color.roundEnable = 0;
- if ( driQueryOptioni (&rmesa->optionCache, "color_reduction" ) ==
- DRI_CONF_COLOR_REDUCTION_DITHER )
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_DITHER_ENABLE;
- else
- rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= rmesa->state.color.roundEnable;
-
- rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset +
- rmesa->radeonScreen->fbLocation)
- & RADEON_COLOROFFSET_MASK);
-
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = ((rmesa->state.color.drawPitch &
- RADEON_COLORPITCH_MASK) |
- RADEON_COLOR_ENDIAN_NO_SWAP);
- /* (fixed size) sarea is initialized to zero afaics so can omit version check. Phew! */
- if (rmesa->sarea->tiling_enabled) {
- rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= RADEON_COLOR_TILE_ENABLE;
- }
-
- rmesa->hw.set.cmd[SET_SE_CNTL] = (RADEON_FFACE_CULL_CCW |
- RADEON_BFACE_SOLID |
- RADEON_FFACE_SOLID |
-/* RADEON_BADVTX_CULL_DISABLE | */
- RADEON_FLAT_SHADE_VTX_LAST |
- RADEON_DIFFUSE_SHADE_GOURAUD |
- RADEON_ALPHA_SHADE_GOURAUD |
- RADEON_SPECULAR_SHADE_GOURAUD |
- RADEON_FOG_SHADE_GOURAUD |
- RADEON_VPORT_XY_XFORM_ENABLE |
- RADEON_VPORT_Z_XFORM_ENABLE |
- RADEON_VTX_PIX_CENTER_OGL |
- RADEON_ROUND_MODE_TRUNC |
- RADEON_ROUND_PREC_8TH_PIX);
-
- rmesa->hw.set.cmd[SET_SE_CNTL_STATUS] =
-#ifdef MESA_BIG_ENDIAN
- RADEON_VC_32BIT_SWAP;
-#else
- RADEON_VC_NO_SWAP;
-#endif
-
- if (!(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)) {
- rmesa->hw.set.cmd[SET_SE_CNTL_STATUS] |= RADEON_TCL_BYPASS;
- }
-
- rmesa->hw.set.cmd[SET_SE_COORDFMT] = (
- RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
- RADEON_TEX1_W_ROUTING_USE_Q1);
-
-
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] = ((1 << 16) | 0xffff);
-
- rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
- ((0 << RADEON_LINE_CURRENT_PTR_SHIFT) |
- (1 << RADEON_LINE_CURRENT_COUNT_SHIFT));
-
- rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
-
- rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
- ((0x00 << RADEON_STENCIL_REF_SHIFT) |
- (0xff << RADEON_STENCIL_MASK_SHIFT) |
- (0xff << RADEON_STENCIL_WRITEMASK_SHIFT));
-
- rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = RADEON_ROP_COPY;
- rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = 0xffffffff;
-
- rmesa->hw.msc.cmd[MSC_RE_MISC] =
- ((0 << RADEON_STIPPLE_X_OFFSET_SHIFT) |
- (0 << RADEON_STIPPLE_Y_OFFSET_SHIFT) |
- RADEON_STIPPLE_BIG_BIT_ORDER);
-
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YSCALE] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = 0x00000000;
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = 0x00000000;
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL;
- rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
- (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
- RADEON_TXFORMAT_PERSPECTIVE_ENABLE |
- (i << 24) | /* This is one of RADEON_TXFORMAT_ST_ROUTE_STQ[012] */
- (2 << RADEON_TXFORMAT_WIDTH_SHIFT) |
- (2 << RADEON_TXFORMAT_HEIGHT_SHIFT));
-
- /* Initialize the texture offset to the start of the card texture heap */
- rmesa->hw.tex[i].cmd[TEX_PP_TXOFFSET] =
- rmesa->radeonScreen->texOffset[RADEON_LOCAL_TEX_HEAP];
-
- rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0;
- rmesa->hw.tex[i].cmd[TEX_PP_TXCBLEND] =
- (RADEON_COLOR_ARG_A_ZERO |
- RADEON_COLOR_ARG_B_ZERO |
- RADEON_COLOR_ARG_C_CURRENT_COLOR |
- RADEON_BLEND_CTL_ADD |
- RADEON_SCALE_1X |
- RADEON_CLAMP_TX);
- rmesa->hw.tex[i].cmd[TEX_PP_TXABLEND] =
- (RADEON_ALPHA_ARG_A_ZERO |
- RADEON_ALPHA_ARG_B_ZERO |
- RADEON_ALPHA_ARG_C_CURRENT_ALPHA |
- RADEON_BLEND_CTL_ADD |
- RADEON_SCALE_1X |
- RADEON_CLAMP_TX);
- rmesa->hw.tex[i].cmd[TEX_PP_TFACTOR] = 0;
- }
-
- /* Can only add ST1 at the time of doing some multitex but can keep
- * it after that. Errors if DIFFUSE is missing.
- */
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] =
- (RADEON_TCL_VTX_Z0 |
- RADEON_TCL_VTX_W0 |
- RADEON_TCL_VTX_PK_DIFFUSE
- ); /* need to keep this uptodate */
-
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] =
- ( RADEON_TCL_COMPUTE_XYZW |
- (RADEON_TCL_TEX_INPUT_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT) |
- (RADEON_TCL_TEX_INPUT_TEX_1 << RADEON_TCL_TEX_1_OUTPUT_SHIFT) |
- (RADEON_TCL_TEX_INPUT_TEX_2 << RADEON_TCL_TEX_2_OUTPUT_SHIFT));
-
-
- /* XXX */
- rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_0] =
- ((MODEL << RADEON_MODELVIEW_0_SHIFT) |
- (MODEL_IT << RADEON_IT_MODELVIEW_0_SHIFT));
-
- rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_1] =
- ((MODEL_PROJ << RADEON_MODELPROJECT_0_SHIFT) |
- (TEXMAT_0 << RADEON_TEXMAT_0_SHIFT) |
- (TEXMAT_1 << RADEON_TEXMAT_1_SHIFT));
-
- rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
- (RADEON_UCP_IN_CLIP_SPACE |
- RADEON_CULL_FRONT_IS_CCW);
-
- rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = 0;
-
- rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] =
- (RADEON_SPECULAR_LIGHTS |
- RADEON_DIFFUSE_SPECULAR_COMBINE |
- RADEON_LOCAL_LIGHT_VEC_GL |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_EMISSIVE_SOURCE_SHIFT) |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_AMBIENT_SOURCE_SHIFT) |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_DIFFUSE_SOURCE_SHIFT) |
- (RADEON_LM_SOURCE_STATE_MULT << RADEON_SPECULAR_SOURCE_SHIFT));
-
- for (i = 0 ; i < 8; i++) {
- struct gl_light *l = &ctx->Light.Light[i];
- GLenum p = GL_LIGHT0 + i;
- *(float *)&(rmesa->hw.lit[i].cmd[LIT_RANGE_CUTOFF]) = FLT_MAX;
-
- ctx->Driver.Lightfv( ctx, p, GL_AMBIENT, l->Ambient );
- ctx->Driver.Lightfv( ctx, p, GL_DIFFUSE, l->Diffuse );
- ctx->Driver.Lightfv( ctx, p, GL_SPECULAR, l->Specular );
- ctx->Driver.Lightfv( ctx, p, GL_POSITION, NULL );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_DIRECTION, NULL );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_EXPONENT, &l->SpotExponent );
- ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
- ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
- &l->ConstantAttenuation );
- ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
- &l->LinearAttenuation );
- ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
- &l->QuadraticAttenuation );
- *(float *)&(rmesa->hw.lit[i].cmd[LIT_ATTEN_XXX]) = 0.0;
- }
-
- ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
- ctx->Light.Model.Ambient );
-
- TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
-
- for (i = 0 ; i < 6; i++) {
- ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, NULL );
- }
-
- ctx->Driver.Fogfv( ctx, GL_FOG_MODE, NULL );
- ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
- ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start );
- ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
- ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
- ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL );
-
- rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
- rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
- rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
- rmesa->hw.grd.cmd[GRD_HORZ_GUARD_DISCARD_ADJ] = IEEE_ONE;
-
- rmesa->hw.eye.cmd[EYE_X] = 0;
- rmesa->hw.eye.cmd[EYE_Y] = 0;
- rmesa->hw.eye.cmd[EYE_Z] = IEEE_ONE;
- rmesa->hw.eye.cmd[EYE_RESCALE_FACTOR] = IEEE_ONE;
-
- rmesa->hw.all_dirty = GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c
deleted file mode 100644
index 924d4028d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.c
+++ /dev/null
@@ -1,983 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c,v 1.6 2003/05/06 23:52:08 daenzer Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "enums.h"
-#include "imports.h"
-#include "macros.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "math/m_translate.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vtx_api.h" /* for _tnl_FlushVertices */
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_state.h"
-#include "radeon_swtcl.h"
-#include "radeon_tcl.h"
-
-
-static void flush_last_swtcl_prim( radeonContextPtr rmesa );
-
-/* R100: xyzw, c0, c1/fog, stq[0..2] = 4+1+1+3*3 = 15 right? */
-/* R200: xyzw, c0, c1/fog, strq[0..5] = 4+1+1+4*6 = 30 */
-#define RADEON_MAX_TNL_VERTEX_SIZE (15 * sizeof(GLfloat)) /* for mesa _tnl stage */
-
-/***********************************************************************
- * Initialization
- ***********************************************************************/
-
-#define EMIT_ATTR( ATTR, STYLE, F0 ) \
-do { \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = (ATTR); \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = (STYLE); \
- rmesa->swtcl.vertex_attr_count++; \
- fmt_0 |= F0; \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].attrib = 0; \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].format = EMIT_PAD; \
- rmesa->swtcl.vertex_attrs[rmesa->swtcl.vertex_attr_count].offset = (N); \
- rmesa->swtcl.vertex_attr_count++; \
-} while (0)
-
-static GLuint radeon_cp_vc_frmts[3][2] =
-{
- { RADEON_CP_VC_FRMT_ST0, RADEON_CP_VC_FRMT_ST0 | RADEON_CP_VC_FRMT_Q0 },
- { RADEON_CP_VC_FRMT_ST1, RADEON_CP_VC_FRMT_ST1 | RADEON_CP_VC_FRMT_Q1 },
- { RADEON_CP_VC_FRMT_ST2, RADEON_CP_VC_FRMT_ST2 | RADEON_CP_VC_FRMT_Q2 },
-};
-
-static void radeonSetVertexFormat( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- int fmt_0 = 0;
- int offset = 0;
-
-
- /* Important:
- */
- if ( VB->NdcPtr != NULL ) {
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- }
- else {
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->ClipPtr;
- }
-
- assert( VB->AttribPtr[VERT_ATTRIB_POS] != NULL );
- rmesa->swtcl.vertex_attr_count = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if ( !rmesa->swtcl.needproj ||
- (index & _TNL_BITS_TEX_ANY)) { /* for projtex */
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F,
- RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_Z | RADEON_CP_VC_FRMT_W0 );
- offset = 4;
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F,
- RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_Z );
- offset = 3;
- }
-
- rmesa->swtcl.coloroffset = offset;
-#if MESA_LITTLE_ENDIAN
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA,
- RADEON_CP_VC_FRMT_PKCOLOR );
-#else
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ABGR,
- RADEON_CP_VC_FRMT_PKCOLOR );
-#endif
- offset += 1;
-
- rmesa->swtcl.specoffset = 0;
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
-
-#if MESA_LITTLE_ENDIAN
- if (index & _TNL_BIT_COLOR1) {
- rmesa->swtcl.specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB,
- RADEON_CP_VC_FRMT_PKSPEC );
- }
- else {
- EMIT_PAD( 3 );
- }
-
- if (index & _TNL_BIT_FOG) {
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F,
- RADEON_CP_VC_FRMT_PKSPEC );
- }
- else {
- EMIT_PAD( 1 );
- }
-#else
- if (index & _TNL_BIT_FOG) {
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F,
- RADEON_CP_VC_FRMT_PKSPEC );
- }
- else {
- EMIT_PAD( 1 );
- }
-
- if (index & _TNL_BIT_COLOR1) {
- rmesa->swtcl.specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR,
- RADEON_CP_VC_FRMT_PKSPEC );
- }
- else {
- EMIT_PAD( 3 );
- }
-#endif
- }
-
- if (index & _TNL_BITS_TEX_ANY) {
- int i;
-
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (index & _TNL_BIT_TEX(i)) {
- GLuint sz = VB->TexCoordPtr[i]->size;
-
- switch (sz) {
- case 1:
- case 2:
- case 3:
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_2F,
- radeon_cp_vc_frmts[i][0] );
- break;
- case 4:
- EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_3F_XYW,
- radeon_cp_vc_frmts[i][1] );
- break;
- default:
- continue;
- };
- }
- }
- }
-
- if ( rmesa->tnl_index != index ||
- fmt_0 != rmesa->swtcl.vertex_format) {
- RADEON_NEWPRIM(rmesa);
- rmesa->swtcl.vertex_format = fmt_0;
- rmesa->swtcl.vertex_size =
- _tnl_install_attrs( ctx,
- rmesa->swtcl.vertex_attrs,
- rmesa->swtcl.vertex_attr_count,
- NULL, 0 );
- rmesa->swtcl.vertex_size /= 4;
- rmesa->tnl_index = index;
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf( stderr, "%s: vertex_size= %d floats\n",
- __FUNCTION__, rmesa->swtcl.vertex_size);
- }
-}
-
-
-static void radeonRenderStart( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- radeonSetVertexFormat( ctx );
-
- if (rmesa->dma.flush != 0 &&
- rmesa->dma.flush != flush_last_swtcl_prim)
- rmesa->dma.flush( rmesa );
-}
-
-
-/**
- * Set vertex state for SW TCL. The primary purpose of this function is to
- * determine in advance whether or not the hardware can / should do the
- * projection divide or Mesa should do it.
- */
-void radeonChooseVertexState( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- GLuint se_coord_fmt;
-
- /* We must ensure that we don't do _tnl_need_projected_coords while in a
- * rasterization fallback. As this function will be called again when we
- * leave a rasterization fallback, we can just skip it for now.
- */
- if (rmesa->Fallback != 0)
- return;
-
- /* HW perspective divide is a win, but tiny vertex formats are a
- * bigger one.
- */
-
- if ( ((tnl->render_inputs & (_TNL_BITS_TEX_ANY|_TNL_BIT_COLOR1) ) == 0)
- || (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- rmesa->swtcl.needproj = GL_TRUE;
- se_coord_fmt = (RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
- RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
- RADEON_TEX1_W_ROUTING_USE_Q1);
- }
- else {
- rmesa->swtcl.needproj = GL_FALSE;
- se_coord_fmt = (RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
- RADEON_TEX1_W_ROUTING_USE_Q1);
- }
-
- _tnl_need_projected_coords( ctx, rmesa->swtcl.needproj );
-
- if ( se_coord_fmt != rmesa->hw.set.cmd[SET_SE_COORDFMT] ) {
- RADEON_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_COORDFMT] = se_coord_fmt;
- }
-}
-
-
-/* Flush vertices in the current dma region.
- */
-static void flush_last_swtcl_prim( radeonContextPtr rmesa )
-{
- if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- rmesa->dma.flush = NULL;
-
- if (rmesa->dma.current.buf) {
- struct radeon_dma_region *current = &rmesa->dma.current;
- GLuint current_offset = (rmesa->radeonScreen->gart_buffer_offset +
- current->buf->buf->idx * RADEON_BUFFER_SIZE +
- current->start);
-
- assert (!(rmesa->swtcl.hw_primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
-
- assert (current->start +
- rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
- current->ptr);
-
- if (rmesa->dma.current.start != rmesa->dma.current.ptr) {
- radeonEnsureCmdBufSpace( rmesa, VERT_AOS_BUFSZ +
- rmesa->hw.max_state_size + VBUF_BUFSZ );
-
- radeonEmitVertexAOS( rmesa,
- rmesa->swtcl.vertex_size,
- current_offset);
-
- radeonEmitVbufPrim( rmesa,
- rmesa->swtcl.vertex_format,
- rmesa->swtcl.hw_primitive,
- rmesa->swtcl.numverts);
- }
-
- rmesa->swtcl.numverts = 0;
- current->start = current->ptr;
- }
-}
-
-
-/* Alloc space in the current dma region.
- */
-static __inline void *radeonAllocDmaLowVerts( radeonContextPtr rmesa,
- int nverts, int vsize )
-{
- GLuint bytes = vsize * nverts;
-
- if ( rmesa->dma.current.ptr + bytes > rmesa->dma.current.end )
- radeonRefillCurrentDmaRegion( rmesa );
-
- if (!rmesa->dma.flush) {
- rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
- rmesa->dma.flush = flush_last_swtcl_prim;
- }
-
- assert( vsize == rmesa->swtcl.vertex_size * 4 );
- assert( rmesa->dma.flush == flush_last_swtcl_prim );
- assert (rmesa->dma.current.start +
- rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
- rmesa->dma.current.ptr);
-
-
- {
- GLubyte *head = (GLubyte *)(rmesa->dma.current.address + rmesa->dma.current.ptr);
- rmesa->dma.current.ptr += bytes;
- rmesa->swtcl.numverts += nverts;
- return head;
- }
-
-}
-
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Try to simulate missing primitives with indexed vertices.
- */
-#define HAVE_POINTS 1
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-#define HAVE_POLYGONS 0
-/* \todo: is it possible to make "ELTS" work with t_vertex code ? */
-#define HAVE_ELTS 0
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- RADEON_CP_VC_CNTL_PRIM_TYPE_POINT,
- RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
- 0,
- RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN,
- 0,
- 0,
- 0
-};
-
-static __inline void radeonDmaPrimitive( radeonContextPtr rmesa, GLenum prim )
-{
- RADEON_NEWPRIM( rmesa );
- rmesa->swtcl.hw_primitive = hw_prim[prim];
- assert(rmesa->dma.current.ptr == rmesa->dma.current.start);
-}
-
-#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
-#define INIT( prim ) radeonDmaPrimitive( rmesa, prim )
-#define FLUSH() RADEON_NEWPRIM( rmesa )
-#define GET_CURRENT_VB_MAX_VERTS() \
- (((int)rmesa->dma.current.end - (int)rmesa->dma.current.ptr) / (rmesa->swtcl.vertex_size*4))
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- ((RADEON_BUFFER_SIZE) / (rmesa->swtcl.vertex_size*4))
-#define ALLOC_VERTS( nr ) \
- radeonAllocDmaLowVerts( rmesa, nr, rmesa->swtcl.vertex_size * 4 )
-#define EMIT_VERTS( ctx, j, nr, buf ) \
- _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf)
-
-#define TAG(x) radeon_dma_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-static GLboolean radeon_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- tnl_render_func *tab = TAG(render_tab_verts);
- GLuint i;
-
- if (rmesa->swtcl.indexed_verts.buf)
- RELEASE_ELT_VERTS();
-
- if (rmesa->swtcl.RenderIndex != 0 ||
- !radeon_dma_validate_render( ctx, VB ))
- return GL_TRUE;
-
- tnl->Driver.Render.Start( ctx );
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "radeon_render.c: prim %s %d..%d\n",
- _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
- start, start+length);
-
- if (length)
- tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim );
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-
-
-const struct tnl_pipeline_stage _radeon_render_stage =
-{
- "radeon render",
- NULL,
- NULL,
- NULL,
- NULL,
- radeon_run_render /* run */
-};
-
-
-/**************************************************************************/
-
-/* Radeon texture rectangle expects coords in 0..1 range, not 0..dimension
- * as in the extension spec. Need to translate here.
- *
- * Note that swrast expects 0..dimension, so if a fallback is active,
- * don't do anything. (Maybe need to configure swrast to match hw)
- */
-struct texrect_stage_data {
- GLvector4f texcoord[MAX_TEXTURE_UNITS];
-};
-
-#define TEXRECT_STAGE_DATA(stage) ((struct texrect_stage_data *)stage->privatePtr)
-
-
-static GLboolean run_texrect_stage( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- if (rmesa->Fallback)
- return GL_TRUE;
-
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_RECT_BIT) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect;
- struct gl_texture_image *texImage = texObj->Image[0][texObj->BaseLevel];
- const GLfloat iw = 1.0/texImage->Width;
- const GLfloat ih = 1.0/texImage->Height;
- GLfloat *in = (GLfloat *)VB->TexCoordPtr[i]->data;
- GLint instride = VB->TexCoordPtr[i]->stride;
- GLfloat (*out)[4] = store->texcoord[i].data;
- GLint j;
-
- for (j = 0 ; j < VB->Count ; j++) {
- out[j][0] = in[0] * iw;
- out[j][1] = in[1] * ih;
- in = (GLfloat *)((GLubyte *)in + instride);
- }
-
- VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = &store->texcoord[i];
- }
- }
-
- return GL_TRUE;
-}
-
-
-/* Called the first time stage->run() is invoked.
- */
-static GLboolean alloc_texrect_data( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct texrect_stage_data *store;
- GLuint i;
-
- stage->privatePtr = CALLOC(sizeof(*store));
- store = TEXRECT_STAGE_DATA(stage);
- if (!store)
- return GL_FALSE;
-
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- _mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
-
- return GL_TRUE;
-}
-
-static void free_texrect_data( struct tnl_pipeline_stage *stage )
-{
- struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage);
- GLuint i;
-
- if (store) {
- for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++)
- if (store->texcoord[i].data)
- _mesa_vector4f_free( &store->texcoord[i] );
- FREE( store );
- stage->privatePtr = NULL;
- }
-}
-
-const struct tnl_pipeline_stage _radeon_texrect_stage =
-{
- "radeon texrect stage", /* name */
- NULL,
- alloc_texrect_data,
- free_texrect_data,
- NULL,
- run_texrect_stage
-};
-
-
-/**************************************************************************/
-
-
-static const GLuint reduced_hw_prim[GL_POLYGON+1] = {
- RADEON_CP_VC_CNTL_PRIM_TYPE_POINT,
- RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
- RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
- RADEON_CP_VC_CNTL_PRIM_TYPE_LINE,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST,
- RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST
-};
-
-static void radeonRasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void radeonRenderPrimitive( GLcontext *ctx, GLenum prim );
-static void radeonResetLineStipple( GLcontext *ctx );
-
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#undef LOCAL_VARS
-#undef ALLOC_VERTS
-#define CTX_ARG radeonContextPtr rmesa
-#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size
-#define ALLOC_VERTS( n, size ) radeonAllocDmaLowVerts( rmesa, n, (size) * 4 )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- const char *radeonverts = (char *)rmesa->swtcl.verts;
-#define VERT(x) (radeonVertex *)(radeonverts + ((x) * (vertsize) * sizeof(int)))
-#define VERTEX radeonVertex
-#undef TAG
-#define TAG(x) radeon_##x
-#include "tnl_dd/t_dd_triemit.h"
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define QUAD( a, b, c, d ) radeon_quad( rmesa, a, b, c, d )
-#define TRI( a, b, c ) radeon_triangle( rmesa, a, b, c )
-#define LINE( a, b ) radeon_line( rmesa, a, b )
-#define POINT( a ) radeon_point( rmesa, a )
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define RADEON_TWOSIDE_BIT 0x01
-#define RADEON_UNFILLED_BIT 0x02
-#define RADEON_MAX_TRIFUNC 0x08
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[RADEON_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK 0
-#define DO_OFFSET 0
-#define DO_UNFILLED (IND & RADEON_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & RADEON_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a < 0)
-#define GET_VERTEX(e) (rmesa->swtcl.verts + ((e) * rmesa->swtcl.vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- radeon_color_t *color = (radeon_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v, c ) \
-do { \
- if (specoffset) { \
- radeon_color_t *spec = (radeon_color_t *)&((v)->ui[specoffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (specoffset) { \
- radeon_color_t *spec0 = (radeon_color_t *)&((v0)->ui[specoffset]); \
- radeon_color_t *spec1 = (radeon_color_t *)&((v1)->ui[specoffset]); \
- spec0->red = spec1->red; \
- spec0->green = spec1->green; \
- spec0->blue = spec1->blue; \
- } \
-} while (0)
-
-/* These don't need LE32_TO_CPU() as they used to save and restore
- * colors which are already in the correct format.
- */
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx]
-
-#undef LOCAL_VARS
-#undef TAG
-#undef INIT
-
-#define LOCAL_VARS(n) \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = rmesa->swtcl.coloroffset; \
- GLuint specoffset = rmesa->swtcl.specoffset; \
- (void) color; (void) spec; (void) coloroffset; (void) specoffset;
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) radeonRasterPrimitive( ctx, reduced_hw_prim[x] )
-#define RENDER_PRIMITIVE rmesa->swtcl.render_primitive
-#undef TAG
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (RADEON_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (RADEON_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (RADEON_TWOSIDE_BIT|RADEON_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_twoside();
- init_unfilled();
- init_twoside_unfilled();
-}
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- radeon_point( rmesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- radeon_line( rmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- radeon_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- radeon_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#undef INIT
-#define INIT(x) do { \
- radeonRenderPrimitive( ctx, x ); \
-} while (0)
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- const GLuint vertsize = rmesa->swtcl.vertex_size; \
- const char *radeonverts = (char *)rmesa->swtcl.verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) elt; (void) stipple;
-#define RESET_STIPPLE if ( stipple ) radeonResetLineStipple( ctx );
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) radeon_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) radeon_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-void radeonChooseRenderState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint index = 0;
- GLuint flags = ctx->_TriangleCaps;
-
- if (!rmesa->TclFallback || rmesa->Fallback)
- return;
-
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= RADEON_TWOSIDE_BIT;
- if (flags & DD_TRI_UNFILLED) index |= RADEON_UNFILLED_BIT;
-
- if (index != rmesa->swtcl.RenderIndex) {
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = radeon_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = radeon_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = radeon_fast_clipped_poly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- }
-
- rmesa->swtcl.RenderIndex = index;
- }
-}
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-static void radeonRasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (rmesa->swtcl.hw_primitive != hwprim) {
- RADEON_NEWPRIM( rmesa );
- rmesa->swtcl.hw_primitive = hwprim;
- }
-}
-
-static void radeonRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- rmesa->swtcl.render_primitive = prim;
- if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED))
- radeonRasterPrimitive( ctx, reduced_hw_prim[prim] );
-}
-
-static void radeonRenderFinish( GLcontext *ctx )
-{
-}
-
-static void radeonResetLineStipple( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- RADEON_STATECHANGE( rmesa, lin );
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static const char * const fallbackStrings[] = {
- "Texture mode",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "glEnable(GL_STENCIL) without hw stencil buffer",
- "glRenderMode(selection or feedback)",
- "glBlendEquation",
- "glBlendFunc",
- "RADEON_NO_RAST",
- "Mixing GL_CLAMP_TO_BORDER and GL_CLAMP (or GL_MIRROR_CLAMP_ATI)"
-};
-
-
-static const char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = rmesa->Fallback;
-
- if (mode) {
- rmesa->Fallback |= bit;
- if (oldfallback == 0) {
- RADEON_FIREVERTICES( rmesa );
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE );
- _swsetup_Wakeup( ctx );
- rmesa->swtcl.RenderIndex = ~0;
- if (RADEON_DEBUG & DEBUG_FALLBACKS) {
- fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
- else {
- rmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = radeonRenderStart;
- tnl->Driver.Render.PrimitiveNotify = radeonRenderPrimitive;
- tnl->Driver.Render.Finish = radeonRenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- tnl->Driver.Render.ResetLineStipple = radeonResetLineStipple;
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_FALSE );
- if (rmesa->TclFallback) {
- /* These are already done if rmesa->TclFallback goes to
- * zero above. But not if it doesn't (RADEON_NO_TCL for
- * example?)
- */
- radeonChooseVertexState( ctx );
- radeonChooseRenderState( ctx );
- }
- if (RADEON_DEBUG & DEBUG_FALLBACKS) {
- fprintf(stderr, "Radeon end rasterization fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
-}
-
-
-void radeonFlushVertices( GLcontext *ctx, GLuint flags )
-{
- _tnl_FlushVertices( ctx, flags );
-
- if (flags & FLUSH_STORED_VERTICES)
- RADEON_NEWPRIM( RADEON_CONTEXT( ctx ) );
-}
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void radeonInitSwtcl( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.Render.Start = radeonRenderStart;
- tnl->Driver.Render.Finish = radeonRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = radeonRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = radeonResetLineStipple;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- RADEON_MAX_TNL_VERTEX_SIZE);
-
- rmesa->swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf;
- rmesa->swtcl.RenderIndex = ~0;
- rmesa->swtcl.render_primitive = GL_TRIANGLES;
- rmesa->swtcl.hw_primitive = 0;
-}
-
-
-void radeonDestroySwtcl( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (rmesa->swtcl.indexed_verts.buf)
- radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
- __FUNCTION__ );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.h
deleted file mode 100644
index f95a52c0b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_swtcl.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $XFree86$ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#ifndef __RADEON_TRIS_H__
-#define __RADEON_TRIS_H__
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-#include "radeon_context.h"
-
-extern void radeonInitSwtcl( GLcontext *ctx );
-extern void radeonDestroySwtcl( GLcontext *ctx );
-
-extern void radeonFlushVertices( GLcontext *ctx, GLuint flags );
-extern void radeonChooseRenderState( GLcontext *ctx );
-extern void radeonChooseVertexState( GLcontext *ctx );
-
-extern void radeonCheckTexSizes( GLcontext *ctx );
-
-extern void radeonBuildVertices( GLcontext *ctx, GLuint start, GLuint count,
- GLuint newinputs );
-
-extern void radeonPrintSetupFlags(char *msg, GLuint flags );
-
-
-extern void radeon_emit_indexed_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
-
-extern void radeon_translate_vertex( GLcontext *ctx,
- const radeonVertex *src,
- SWvertex *dst );
-
-extern void radeon_print_vertex( GLcontext *ctx, const radeonVertex *v );
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c
deleted file mode 100644
index b13042d96..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* $XFree86$ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Austin, 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, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "light.h"
-#include "mtypes.h"
-#include "enums.h"
-
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_tex.h"
-#include "radeon_tcl.h"
-#include "radeon_swtcl.h"
-#include "radeon_maos.h"
-
-
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Try to simulate missing primitives with indexed vertices.
- */
-#define HAVE_POINTS 1
-#define HAVE_LINES 1
-#define HAVE_LINE_LOOP 0
-#define HAVE_LINE_STRIPS 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-#define HAVE_POLYGONS 1
-#define HAVE_ELTS 1
-
-
-#define HW_POINTS RADEON_CP_VC_CNTL_PRIM_TYPE_POINT
-#define HW_LINES RADEON_CP_VC_CNTL_PRIM_TYPE_LINE
-#define HW_LINE_LOOP 0
-#define HW_LINE_STRIP RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP
-#define HW_TRIANGLES RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST
-#define HW_TRIANGLE_STRIP_0 RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP
-#define HW_TRIANGLE_STRIP_1 0
-#define HW_TRIANGLE_FAN RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN
-#define HW_QUADS 0
-#define HW_QUAD_STRIP 0
-#define HW_POLYGON RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN
-
-
-static GLboolean discrete_prim[0x10] = {
- 0, /* 0 none */
- 1, /* 1 points */
- 1, /* 2 lines */
- 0, /* 3 line_strip */
- 1, /* 4 tri_list */
- 0, /* 5 tri_fan */
- 0, /* 6 tri_type2 */
- 1, /* 7 rect list (unused) */
- 1, /* 8 3vert point */
- 1, /* 9 3vert line */
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-};
-
-
-#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
-#define ELT_TYPE GLushort
-
-#define ELT_INIT(prim, hw_prim) \
- radeonTclPrimitive( ctx, prim, hw_prim | RADEON_CP_VC_CNTL_PRIM_WALK_IND )
-
-#define GET_MESA_ELTS() rmesa->tcl.Elts
-
-
-/* Don't really know how many elts will fit in what's left of cmdbuf,
- * as there is state to emit, etc:
- */
-
-/* Testing on isosurf shows a maximum around here. Don't know if it's
- * the card or driver or kernel module that is causing the behaviour.
- */
-#define GET_MAX_HW_ELTS() 300
-
-
-#define RESET_STIPPLE() do { \
- RADEON_STATECHANGE( rmesa, lin ); \
- radeonEmitState( rmesa ); \
-} while (0)
-
-#define AUTO_STIPPLE( mode ) do { \
- RADEON_STATECHANGE( rmesa, lin ); \
- if (mode) \
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] |= \
- RADEON_LINE_PATTERN_AUTO_RESET; \
- else \
- rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] &= \
- ~RADEON_LINE_PATTERN_AUTO_RESET; \
- radeonEmitState( rmesa ); \
-} while (0)
-
-
-
-#define ALLOC_ELTS(nr) radeonAllocElts( rmesa, nr )
-
-static GLushort *radeonAllocElts( radeonContextPtr rmesa, GLuint nr )
-{
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
-
- radeonEnsureCmdBufSpace(rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) +
- rmesa->hw.max_state_size + ELTS_BUFSZ(nr));
-
- radeonEmitAOS( rmesa,
- rmesa->tcl.aos_components,
- rmesa->tcl.nr_aos_components, 0 );
-
- return radeonAllocEltsOpenEnded( rmesa,
- rmesa->tcl.vertex_format,
- rmesa->tcl.hw_primitive, nr );
-}
-
-#define CLOSE_ELTS() RADEON_NEWPRIM( rmesa )
-
-
-
-/* TODO: Try to extend existing primitive if both are identical,
- * discrete and there are no intervening state changes. (Somewhat
- * duplicates changes to DrawArrays code)
- */
-static void radeonEmitPrim( GLcontext *ctx,
- GLenum prim,
- GLuint hwprim,
- GLuint start,
- GLuint count)
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- radeonTclPrimitive( ctx, prim, hwprim );
-
- radeonEnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) +
- rmesa->hw.max_state_size + VBUF_BUFSZ );
-
- radeonEmitAOS( rmesa,
- rmesa->tcl.aos_components,
- rmesa->tcl.nr_aos_components,
- start );
-
- /* Why couldn't this packet have taken an offset param?
- */
- radeonEmitVbufPrim( rmesa,
- rmesa->tcl.vertex_format,
- rmesa->tcl.hw_primitive,
- count - start );
-}
-
-#define EMIT_PRIM( ctx, prim, hwprim, start, count ) do { \
- radeonEmitPrim( ctx, prim, hwprim, start, count ); \
- (void) rmesa; } while (0)
-
-/* Try & join small primitives
- */
-#if 0
-#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) 0
-#else
-#define PREFER_DISCRETE_ELT_PRIM( NR, PRIM ) \
- ((NR) < 20 || \
- ((NR) < 40 && \
- rmesa->tcl.hw_primitive == (PRIM| \
- RADEON_CP_VC_CNTL_PRIM_WALK_IND| \
- RADEON_CP_VC_CNTL_TCL_ENABLE)))
-#endif
-
-#ifdef MESA_BIG_ENDIAN
-/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
-#define EMIT_ELT(dest, offset, x) do { \
- int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \
- GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \
- (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \
- (void)rmesa; } while (0)
-#else
-#define EMIT_ELT(dest, offset, x) do { \
- (dest)[offset] = (GLushort) (x); \
- (void)rmesa; } while (0)
-#endif
-
-#define EMIT_TWO_ELTS(dest, offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
-
-
-
-#define TAG(x) tcl_##x
-#include "tnl_dd/t_dd_dmatmp2.h"
-
-/**********************************************************************/
-/* External entrypoints */
-/**********************************************************************/
-
-void radeonEmitPrimitive( GLcontext *ctx,
- GLuint first,
- GLuint last,
- GLuint flags )
-{
- tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
-}
-
-void radeonEmitEltPrimitive( GLcontext *ctx,
- GLuint first,
- GLuint last,
- GLuint flags )
-{
- tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
-}
-
-void radeonTclPrimitive( GLcontext *ctx,
- GLenum prim,
- int hw_prim )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint se_cntl;
- GLuint newprim = hw_prim | RADEON_CP_VC_CNTL_TCL_ENABLE;
-
- if (newprim != rmesa->tcl.hw_primitive ||
- !discrete_prim[hw_prim&0xf]) {
- RADEON_NEWPRIM( rmesa );
- rmesa->tcl.hw_primitive = newprim;
- }
-
- se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
- se_cntl &= ~RADEON_FLAT_SHADE_VTX_LAST;
-
- if (prim == GL_POLYGON && (ctx->_TriangleCaps & DD_FLATSHADE))
- se_cntl |= RADEON_FLAT_SHADE_VTX_0;
- else
- se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
-
- if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
- RADEON_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
- }
-}
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-/* TCL render.
- */
-static GLboolean radeon_run_tcl_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
- GLuint i;
-
- /* TODO: separate this from the swtnl pipeline
- */
- if (rmesa->TclFallback)
- return GL_TRUE; /* fallback to software t&l */
-
- if (VB->Count == 0)
- return GL_FALSE;
-
- /* NOTE: inputs != tnl->render_inputs - these are the untransformed
- * inputs.
- */
- if (ctx->Light.Enabled) {
- inputs |= VERT_BIT_NORMAL;
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- inputs |= VERT_BIT_COLOR1;
- }
- }
-
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
- inputs |= VERT_BIT_FOG;
- }
-
- for (i = 0 ; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->Texture.Unit[i]._ReallyEnabled) {
- if (rmesa->TexGenNeedNormals[i]) {
- inputs |= VERT_BIT_NORMAL;
- }
- inputs |= VERT_BIT_TEX(i);
- }
- }
-
- radeonReleaseArrays( ctx, ~0 );
- radeonEmitArrays( ctx, inputs );
-
- rmesa->tcl.Elts = VB->Elts;
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (!length)
- continue;
-
- if (rmesa->tcl.Elts)
- radeonEmitEltPrimitive( ctx, start, start+length, prim );
- else
- radeonEmitPrimitive( ctx, start, start+length, prim );
- }
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-
-/* Initial state for tcl stage.
- */
-const struct tnl_pipeline_stage _radeon_tcl_stage =
-{
- "radeon render",
- NULL,
- NULL,
- NULL,
- NULL,
- radeon_run_tcl_render /* run */
-};
-
-
-
-/**********************************************************************/
-/* Validate state at pipeline start */
-/**********************************************************************/
-
-
-/*-----------------------------------------------------------------------
- * Manage TCL fallbacks
- */
-
-
-static void transition_to_swtnl( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint se_cntl;
-
- RADEON_NEWPRIM( rmesa );
- rmesa->swtcl.vertex_format = 0;
-
- radeonChooseVertexState( ctx );
- radeonChooseRenderState( ctx );
-
- _mesa_validate_all_lighting_tables( ctx );
-
- tnl->Driver.NotifyMaterialChange =
- _mesa_validate_all_lighting_tables;
-
- radeonReleaseArrays( ctx, ~0 );
-
- se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
- se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
-
- if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
- RADEON_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
- }
-}
-
-
-static void transition_to_hwtnl( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint se_coord_fmt = (RADEON_VTX_W0_IS_NOT_1_OVER_W0 |
- RADEON_TEX1_W_ROUTING_USE_Q1);
-
- if ( se_coord_fmt != rmesa->hw.set.cmd[SET_SE_COORDFMT] ) {
- RADEON_STATECHANGE( rmesa, set );
- rmesa->hw.set.cmd[SET_SE_COORDFMT] = se_coord_fmt;
- _tnl_need_projected_coords( ctx, GL_FALSE );
- }
-
- radeonUpdateMaterial( ctx );
-
- tnl->Driver.NotifyMaterialChange = radeonUpdateMaterial;
-
- if ( rmesa->dma.flush )
- rmesa->dma.flush( rmesa );
-
- rmesa->dma.flush = NULL;
- rmesa->swtcl.vertex_format = 0;
-
- if (rmesa->swtcl.indexed_verts.buf)
- radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
- __FUNCTION__ );
-
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "Radeon end tcl fallback\n");
-}
-
-static char *fallbackStrings[] = {
- "Rasterization fallback",
- "Unfilled triangles",
- "Twosided lighting, differing materials",
- "Materials in VB (maybe between begin/end)",
- "Texgen unit 0",
- "Texgen unit 1",
- "Texgen unit 2",
- "User disable",
- "texture rectangle unit 0",
- "texture rectangle unit 1",
- "texture rectangle unit 2"
-};
-
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-
-void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint oldfallback = rmesa->TclFallback;
-
- if (mode) {
- rmesa->TclFallback |= bit;
- if (oldfallback == 0) {
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "Radeon begin tcl fallback %s\n",
- getFallbackString( bit ));
- transition_to_swtnl( ctx );
- }
- }
- else {
- rmesa->TclFallback &= ~bit;
- if (oldfallback == bit) {
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "Radeon end tcl fallback %s\n",
- getFallbackString( bit ));
- transition_to_hwtnl( ctx );
- }
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.h
deleted file mode 100644
index e292d2303..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tcl.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h,v 1.2 2003/02/08 21:26:45 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Grahpics Inc., Austin, 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, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#ifndef __RADEON_TCL_H__
-#define __RADEON_TCL_H__
-
-#include "radeon_context.h"
-
-extern void radeonTclPrimitive( GLcontext *ctx, GLenum prim, int hw_prim );
-extern void radeonEmitEltPrimitive( GLcontext *ctx, GLuint first, GLuint last,
- GLuint flags );
-extern void radeonEmitPrimitive( GLcontext *ctx, GLuint first, GLuint last,
- GLuint flags );
-
-extern void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-
-#define RADEON_TCL_FALLBACK_RASTER 0x1 /* rasterization */
-#define RADEON_TCL_FALLBACK_UNFILLED 0x2 /* unfilled tris */
-#define RADEON_TCL_FALLBACK_LIGHT_TWOSIDE 0x4 /* twoside tris */
-#define RADEON_TCL_FALLBACK_MATERIAL 0x8 /* material in vb */
-#define RADEON_TCL_FALLBACK_TEXGEN_0 0x10 /* texgen, unit 0 */
-#define RADEON_TCL_FALLBACK_TEXGEN_1 0x20 /* texgen, unit 1 */
-#define RADEON_TCL_FALLBACK_TEXGEN_2 0x40 /* texgen, unit 2 */
-#define RADEON_TCL_FALLBACK_TCL_DISABLE 0x80 /* user disable */
-#define RADEON_TCL_FALLBACK_TEXRECT_0 0x100 /* texture rectangle */
-#define RADEON_TCL_FALLBACK_TEXRECT_1 0x200 /* texture rectangle */
-#define RADEON_TCL_FALLBACK_TEXRECT_2 0x400 /* texture rectangle */
-
-#define RADEON_MAX_TCL_VERTSIZE (15*4)
-
-#define TCL_FALLBACK( ctx, bit, mode ) radeonTclFallback( ctx, bit, mode )
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c
deleted file mode 100644
index c466af868..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.c
+++ /dev/null
@@ -1,866 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c,v 1.6 2002/09/16 18:05:20 eich Exp $ */
-/*
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-/*
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "image.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "texobj.h"
-
-
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_swtcl.h"
-#include "radeon_tex.h"
-
-#include "xmlpool.h"
-
-
-
-/**
- * Set the texture wrap modes.
- *
- * \param t Texture object whose wrap modes are to be set
- * \param swrap Wrap mode for the \a s texture coordinate
- * \param twrap Wrap mode for the \a t texture coordinate
- */
-
-static void radeonSetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap )
-{
- GLboolean is_clamp = GL_FALSE;
- GLboolean is_clamp_to_border = GL_FALSE;
-
- t->pp_txfilter &= ~(RADEON_CLAMP_S_MASK | RADEON_CLAMP_T_MASK | RADEON_BORDER_MODE_D3D);
-
- switch ( swrap ) {
- case GL_REPEAT:
- t->pp_txfilter |= RADEON_CLAMP_S_WRAP;
- break;
- case GL_CLAMP:
- t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_LAST;
- break;
- case GL_CLAMP_TO_BORDER:
- t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- case GL_MIRRORED_REPEAT:
- t->pp_txfilter |= RADEON_CLAMP_S_MIRROR;
- break;
- case GL_MIRROR_CLAMP_EXT:
- t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_LAST;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
- }
-
- switch ( twrap ) {
- case GL_REPEAT:
- t->pp_txfilter |= RADEON_CLAMP_T_WRAP;
- break;
- case GL_CLAMP:
- t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_CLAMP_TO_EDGE:
- t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_LAST;
- break;
- case GL_CLAMP_TO_BORDER:
- t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- case GL_MIRRORED_REPEAT:
- t->pp_txfilter |= RADEON_CLAMP_T_MIRROR;
- break;
- case GL_MIRROR_CLAMP_EXT:
- t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_GL;
- is_clamp = GL_TRUE;
- break;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_LAST;
- break;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_GL;
- is_clamp_to_border = GL_TRUE;
- break;
- default:
- _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
- }
-
- if ( is_clamp_to_border ) {
- t->pp_txfilter |= RADEON_BORDER_MODE_D3D;
- }
-
- t->border_fallback = (is_clamp && is_clamp_to_border);
-}
-
-static void radeonSetTexMaxAnisotropy( radeonTexObjPtr t, GLfloat max )
-{
- t->pp_txfilter &= ~RADEON_MAX_ANISO_MASK;
-
- if ( max == 1.0 ) {
- t->pp_txfilter |= RADEON_MAX_ANISO_1_TO_1;
- } else if ( max <= 2.0 ) {
- t->pp_txfilter |= RADEON_MAX_ANISO_2_TO_1;
- } else if ( max <= 4.0 ) {
- t->pp_txfilter |= RADEON_MAX_ANISO_4_TO_1;
- } else if ( max <= 8.0 ) {
- t->pp_txfilter |= RADEON_MAX_ANISO_8_TO_1;
- } else {
- t->pp_txfilter |= RADEON_MAX_ANISO_16_TO_1;
- }
-}
-
-/**
- * Set the texture magnification and minification modes.
- *
- * \param t Texture whose filter modes are to be set
- * \param minf Texture minification mode
- * \param magf Texture magnification mode
- */
-
-static void radeonSetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf )
-{
- GLuint anisotropy = (t->pp_txfilter & RADEON_MAX_ANISO_MASK);
-
- t->pp_txfilter &= ~(RADEON_MIN_FILTER_MASK | RADEON_MAG_FILTER_MASK);
-
- if ( anisotropy == RADEON_MAX_ANISO_1_TO_1 ) {
- switch ( minf ) {
- case GL_NEAREST:
- t->pp_txfilter |= RADEON_MIN_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- t->pp_txfilter |= RADEON_MIN_FILTER_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- t->pp_txfilter |= RADEON_MIN_FILTER_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- t->pp_txfilter |= RADEON_MIN_FILTER_LINEAR_MIP_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- t->pp_txfilter |= RADEON_MIN_FILTER_NEAREST_MIP_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- t->pp_txfilter |= RADEON_MIN_FILTER_LINEAR_MIP_LINEAR;
- break;
- }
- } else {
- switch ( minf ) {
- case GL_NEAREST:
- t->pp_txfilter |= RADEON_MIN_FILTER_ANISO_NEAREST;
- break;
- case GL_LINEAR:
- t->pp_txfilter |= RADEON_MIN_FILTER_ANISO_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_NEAREST:
- t->pp_txfilter |= RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- t->pp_txfilter |= RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR;
- break;
- }
- }
-
- switch ( magf ) {
- case GL_NEAREST:
- t->pp_txfilter |= RADEON_MAG_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- t->pp_txfilter |= RADEON_MAG_FILTER_LINEAR;
- break;
- }
-}
-
-static void radeonSetTexBorderColor( radeonTexObjPtr t, GLubyte c[4] )
-{
- t->pp_border_color = radeonPackColor( 4, c[0], c[1], c[2], c[3] );
-}
-
-
-/**
- * Allocate space for and load the mesa images into the texture memory block.
- * This will happen before drawing with a new texture, or drawing with a
- * texture after it was swapped out or teximaged again.
- */
-
-static radeonTexObjPtr radeonAllocTexObj( struct gl_texture_object *texObj )
-{
- radeonTexObjPtr t;
-
- t = CALLOC_STRUCT( radeon_tex_obj );
- texObj->DriverData = t;
- if ( t != NULL ) {
- if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)texObj, (void *)t );
- }
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
- t->border_fallback = GL_FALSE;
-
- t->pp_txfilter = RADEON_BORDER_MODE_OGL;
- t->pp_txformat = (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
- RADEON_TXFORMAT_PERSPECTIVE_ENABLE);
-
- make_empty_list( & t->base );
-
- radeonSetTexWrap( t, texObj->WrapS, texObj->WrapT );
- radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
- radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- radeonSetTexBorderColor( t, texObj->_BorderChan );
- }
-
- return t;
-}
-
-
-static const struct gl_texture_format *
-radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- const GLboolean do32bpt =
- ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 );
- const GLboolean force16bpt =
- ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 );
- (void) format;
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- switch ( type ) {
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return do32bpt ? _dri_texformat_argb8888 : _dri_texformat_argb1555;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return _dri_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return _dri_texformat_argb1555;
- default:
- return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_argb4444;
- }
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- switch ( type ) {
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return _dri_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return _dri_texformat_argb1555;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- return _dri_texformat_rgb565;
- default:
- return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565;
- }
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return !force16bpt ?
- _dri_texformat_rgba8888 : _dri_texformat_argb4444;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return _dri_texformat_argb4444;
-
- case GL_RGB5_A1:
- return _dri_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return !force16bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return _dri_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return _dri_texformat_a8;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return _dri_texformat_l8;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return _dri_texformat_al88;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return _dri_texformat_i8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
-
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
-
- default:
- _mesa_problem(ctx, "unexpected texture format in %s", __FUNCTION__);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-
-static void radeonTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- }
-
- /* Note, this will call ChooseTextureFormat */
- _mesa_store_teximage1d(ctx, target, level, internalFormat,
- width, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void radeonTexSubImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
- return;
- }
- }
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[0] |= (1 << level);
-}
-
-
-static void radeonTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
-
- /* Note, this will call ChooseTextureFormat */
- _mesa_store_teximage2d(ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void radeonTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- }
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-static void radeonCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- if ( t != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
-
- /* Note, this will call ChooseTextureFormat */
- _mesa_store_compressed_teximage2d(ctx, target, level, internalFormat, width,
- height, border, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-
-static void radeonCompressedTexSubImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
- GLuint face;
-
-
- /* which cube face or ordinary 2D image */
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- ASSERT(face < 6);
- break;
- default:
- face = 0;
- }
-
- assert( t ); /* this _should_ be true */
- if ( t ) {
- driSwapOutTextureObject( t );
- }
- else {
- t = (driTextureObject *) radeonAllocTexObj( texObj );
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2D");
- return;
- }
- }
-
- _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, imageSize, data, texObj, texImage);
-
- t->dirty_images[face] |= (1 << level);
-}
-
-#define SCALED_FLOAT_TO_BYTE( x, scale ) \
- (((GLuint)((255.0F / scale) * (x))) / 2)
-
-static void radeonTexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if ( RADEON_DEBUG & DEBUG_STATE ) {
- fprintf( stderr, "%s( %s )\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
- }
-
- switch ( pname ) {
- case GL_TEXTURE_ENV_COLOR: {
- GLubyte c[4];
- GLuint envColor;
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
- envColor = radeonPackColor( 4, c[0], c[1], c[2], c[3] );
- if ( rmesa->hw.tex[unit].cmd[TEX_PP_TFACTOR] != envColor ) {
- RADEON_STATECHANGE( rmesa, tex[unit] );
- rmesa->hw.tex[unit].cmd[TEX_PP_TFACTOR] = envColor;
- }
- break;
- }
-
- case GL_TEXTURE_LOD_BIAS_EXT: {
- GLfloat bias, min;
- GLuint b;
-
- /* The Radeon's LOD bias is a signed 2's complement value with a
- * range of -1.0 <= bias < 4.0. We break this into two linear
- * functions, one mapping [-1.0,0.0] to [-128,0] and one mapping
- * [0.0,4.0] to [0,127].
- */
- min = driQueryOptionb (&rmesa->optionCache, "no_neg_lod_bias") ?
- 0.0 : -1.0;
- bias = CLAMP( *param, min, 4.0 );
- if ( bias == 0 ) {
- b = 0;
- } else if ( bias > 0 ) {
- b = ((GLuint)SCALED_FLOAT_TO_BYTE( bias, 4.0 )) << RADEON_LOD_BIAS_SHIFT;
- } else {
- b = ((GLuint)SCALED_FLOAT_TO_BYTE( bias, 1.0 )) << RADEON_LOD_BIAS_SHIFT;
- }
- if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFILTER] & RADEON_LOD_BIAS_MASK) != b ) {
- RADEON_STATECHANGE( rmesa, tex[unit] );
- rmesa->hw.tex[unit].cmd[TEX_PP_TXFILTER] &= ~RADEON_LOD_BIAS_MASK;
- rmesa->hw.tex[unit].cmd[TEX_PP_TXFILTER] |= (b & RADEON_LOD_BIAS_MASK);
- }
- break;
- }
-
- default:
- return;
- }
-}
-
-
-/**
- * Changes variables and flags for a state update, which will happen at the
- * next UpdateTextureState
- */
-
-static void radeonTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj,
- GLenum pname, const GLfloat *params )
-{
- radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData;
-
- if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( pname ) );
- }
-
- switch ( pname ) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy );
- radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- radeonSetTexWrap( t, texObj->WrapS, texObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- radeonSetTexBorderColor( t, texObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- driSwapOutTextureObject( (driTextureObject *) t );
- break;
-
- default:
- return;
- }
-
- /* Mark this texobj as dirty (one bit per tex unit)
- */
- t->dirty_state = TEX_ALL;
-}
-
-
-static void radeonBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj )
-{
- if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)texObj,
- ctx->Texture.CurrentUnit );
- }
-
- assert( (target != GL_TEXTURE_1D && target != GL_TEXTURE_2D &&
- target != GL_TEXTURE_RECTANGLE_NV) ||
- (texObj->DriverData != NULL) );
-}
-
-
-static void radeonDeleteTexture( GLcontext *ctx,
- struct gl_texture_object *texObj )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- driTextureObject * t = (driTextureObject *) texObj->DriverData;
-
- if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
- _mesa_lookup_enum_by_nr( texObj->Target ) );
- }
-
- if ( t != NULL ) {
- if ( rmesa ) {
- RADEON_FIREVERTICES( rmesa );
- }
-
- driDestroyTextureObject( t );
- }
-
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, texObj);
-}
-
-/* Need:
- * - Same GEN_MODE for all active bits
- * - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
- * - STRQ presumably all supported (matrix means incoming R values
- * can end up in STQ, this has implications for vertex support,
- * presumably ok if maos is used, though?)
- *
- * Basically impossible to do this on the fly - just collect some
- * basic info & do the checks from ValidateState().
- */
-static void radeonTexGen( GLcontext *ctx,
- GLenum coord,
- GLenum pname,
- const GLfloat *params )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
- rmesa->recheck_texgen[unit] = GL_TRUE;
-}
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-radeonNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- if (!obj)
- return NULL;
- obj->MaxAnisotropy = rmesa->initialMaxAnisotropy;
- radeonAllocTexObj( obj );
- return obj;
-}
-
-
-void radeonInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->ChooseTextureFormat = radeonChooseTextureFormat;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
- functions->TexSubImage1D = radeonTexSubImage1D;
- functions->TexSubImage2D = radeonTexSubImage2D;
-
- functions->NewTextureObject = radeonNewTextureObject;
- functions->BindTexture = radeonBindTexture;
- functions->DeleteTexture = radeonDeleteTexture;
- functions->IsTextureResident = driIsTextureResident;
-
- functions->TexEnv = radeonTexEnv;
- functions->TexParameter = radeonTexParameter;
- functions->TexGen = radeonTexGen;
-
- functions->CompressedTexImage2D = radeonCompressedTexImage2D;
- functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
-
- driInitTextureFormats();
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.h
deleted file mode 100644
index a806981ae..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_tex.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h,v 1.3 2002/02/22 21:45:01 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __RADEON_TEX_H__
-#define __RADEON_TEX_H__
-
-extern void radeonUpdateTextureState( GLcontext *ctx );
-
-extern int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t,
- GLuint face );
-
-extern void radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t );
-
-extern void radeonInitTextureFuncs( struct dd_function_table *functions );
-
-#endif /* __RADEON_TEX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texmem.c
deleted file mode 100644
index d492e190c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texmem.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c,v 1.7 2002/12/16 16:18:59 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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 ATI, VA LINUX SYSTEMS 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:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-#include <errno.h>
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-
-#include "radeon_context.h"
-#include "radeon_ioctl.h"
-#include "radeon_tex.h"
-
-#include <unistd.h> /* for usleep() */
-
-
-/**
- * Destroy any device-dependent state associated with the texture. This may
- * include NULLing out hardware state that points to the texture.
- */
-void
-radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t )
-{
- if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)t, (void *)t->base.tObj );
- }
-
- if ( rmesa != NULL ) {
- unsigned i;
-
-
- for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ ) {
- if ( t == rmesa->state.texture.unit[i].texobj ) {
- rmesa->state.texture.unit[i].texobj = NULL;
- rmesa->hw.tex[i].dirty = GL_FALSE;
- }
- }
- }
-}
-
-
-/* ------------------------------------------------------------
- * Texture image conversions
- */
-
-
-static void radeonUploadRectSubImage( radeonContextPtr rmesa,
- radeonTexObjPtr t,
- struct gl_texture_image *texImage,
- GLint x, GLint y,
- GLint width, GLint height )
-{
- const struct gl_texture_format *texFormat = texImage->TexFormat;
- int blit_format, dstPitch, done;
-
- switch ( texFormat->TexelBytes ) {
- case 1:
- blit_format = RADEON_GMC_DST_8BPP_CI;
- break;
- case 2:
- blit_format = RADEON_GMC_DST_16BPP;
- break;
- case 4:
- blit_format = RADEON_GMC_DST_32BPP;
- break;
- default:
- fprintf( stderr, "radeonUploadRectSubImage: unknown blit_format (texelbytes=%d)\n",
- texFormat->TexelBytes);
- return;
- }
-
- t->image[0][0].data = texImage->Data;
-
- /* Currently don't need to cope with small pitches.
- */
- width = texImage->Width;
- height = texImage->Height;
- dstPitch = t->pp_txpitch + 32;
-
- { /* FIXME: prefer GART-texturing if possible */
- /* Data not in GART memory, or bad pitch.
- */
- for (done = 0; done < height ; ) {
- struct radeon_dma_region region;
- int lines = MIN2( height - done, RADEON_BUFFER_SIZE / dstPitch );
- int src_pitch;
- char *tex;
-
- src_pitch = texImage->RowStride * texFormat->TexelBytes;
-
- tex = (char *)texImage->Data + done * src_pitch;
-
- memset(&region, 0, sizeof(region));
- radeonAllocDmaRegion( rmesa, &region, lines * dstPitch, 1024 );
-
- /* Copy texdata to dma:
- */
- if (0)
- fprintf(stderr, "%s: src_pitch %d dst_pitch %d\n",
- __FUNCTION__, src_pitch, dstPitch);
-
- if (src_pitch == dstPitch) {
- memcpy( region.address + region.start, tex, lines * src_pitch );
- }
- else {
- char *buf = region.address + region.start;
- int i;
- for (i = 0 ; i < lines ; i++) {
- memcpy( buf, tex, src_pitch );
- buf += dstPitch;
- tex += src_pitch;
- }
- }
-
- radeonEmitWait( rmesa, RADEON_WAIT_3D );
-
-
-
- /* Blit to framebuffer
- */
- radeonEmitBlit( rmesa,
- blit_format,
- dstPitch, GET_START( &region ),
- dstPitch, t->bufAddr,
- 0, 0,
- 0, done,
- width, lines );
-
- radeonEmitWait( rmesa, RADEON_WAIT_2D );
-
- radeonReleaseDmaRegion( rmesa, &region, __FUNCTION__ );
- done += lines;
- }
- }
-}
-
-
-/**
- * Upload the texture image associated with texture \a t at the specified
- * level at the address relative to \a start.
- */
-static void uploadSubImage( radeonContextPtr rmesa, radeonTexObjPtr t,
- GLint hwlevel,
- GLint x, GLint y, GLint width, GLint height,
- GLuint face )
-{
- struct gl_texture_image *texImage = NULL;
- GLuint offset;
- GLint imageWidth, imageHeight;
- GLint ret;
- drm_radeon_texture_t tex;
- drm_radeon_tex_image_t tmp;
- const int level = hwlevel + t->base.firstLevel;
-
- if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n",
- __FUNCTION__, (void *)t, (void *)t->base.tObj, level, width, height, face );
- }
-
- ASSERT(face < 6);
-
- /* Ensure we have a valid texture to upload */
- if ( ( hwlevel < 0 ) || ( hwlevel >= RADEON_MAX_TEXTURE_LEVELS ) ) {
- _mesa_problem(NULL, "bad texture level in %s", __FUNCTION__);
- return;
- }
-
- texImage = t->base.tObj->Image[face][level];
-
- if ( !texImage ) {
- if ( RADEON_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level );
- return;
- }
- if ( !texImage->Data ) {
- if ( RADEON_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: image data is NULL!\n", __FUNCTION__ );
- return;
- }
-
-
- if (t->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- assert(level == 0);
- assert(hwlevel == 0);
- if ( RADEON_DEBUG & DEBUG_TEXTURE )
- fprintf( stderr, "%s: image data is rectangular\n", __FUNCTION__);
- radeonUploadRectSubImage( rmesa, t, texImage, x, y, width, height );
- return;
- }
-
- imageWidth = texImage->Width;
- imageHeight = texImage->Height;
-
- offset = t->bufAddr;
-
- if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
- GLint imageX = 0;
- GLint imageY = 0;
- GLint blitX = t->image[face][hwlevel].x;
- GLint blitY = t->image[face][hwlevel].y;
- GLint blitWidth = t->image[face][hwlevel].width;
- GLint blitHeight = t->image[face][hwlevel].height;
- fprintf( stderr, " upload image: %d,%d at %d,%d\n",
- imageWidth, imageHeight, imageX, imageY );
- fprintf( stderr, " upload blit: %d,%d at %d,%d\n",
- blitWidth, blitHeight, blitX, blitY );
- fprintf( stderr, " blit ofs: 0x%07x level: %d/%d\n",
- (GLuint)offset, hwlevel, level );
- }
-
- t->image[face][hwlevel].data = texImage->Data;
-
- /* Init the DRM_RADEON_TEXTURE command / drm_radeon_texture_t struct.
- * NOTE: we're always use a 1KB-wide blit and I8 texture format.
- * We used to use 1, 2 and 4-byte texels and used to use the texture
- * width to dictate the blit width - but that won't work for compressed
- * textures. (Brian)
- * NOTE: can't do that with texture tiling. (sroland)
- */
- tex.offset = offset;
- tex.image = &tmp;
- /* copy (x,y,width,height,data) */
- memcpy( &tmp, &t->image[face][hwlevel], sizeof(drm_radeon_tex_image_t) );
-
- if (texImage->TexFormat->TexelBytes) {
- /* use multi-byte upload scheme */
- tex.height = imageHeight;
- tex.width = imageWidth;
- tex.format = t->pp_txformat & RADEON_TXFORMAT_FORMAT_MASK;
- tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1);
- tex.offset += tmp.x & ~1023;
- tmp.x = tmp.x % 1024;
- if (t->tile_bits & RADEON_TXO_MICRO_TILE_X2) {
- /* need something like "tiled coordinates" ? */
- tmp.y = tmp.x / (tex.pitch * 128) * 2;
- tmp.x = tmp.x % (tex.pitch * 128) / 2 / texImage->TexFormat->TexelBytes;
- tex.pitch |= RADEON_DST_TILE_MICRO >> 22;
- }
- else {
- tmp.x = tmp.x >> (texImage->TexFormat->TexelBytes >> 1);
- }
- if ((t->tile_bits & RADEON_TXO_MACRO_TILE) &&
- (texImage->Width * texImage->TexFormat->TexelBytes >= 256)) {
- /* radeon switches off macro tiling for small textures/mipmaps it seems */
- tex.pitch |= RADEON_DST_TILE_MACRO >> 22;
- }
- }
- else {
- /* In case of for instance 8x8 texture (2x2 dxt blocks), padding after the first two blocks is
- needed (only with dxt1 since 2 dxt3/dxt5 blocks already use 32 Byte). */
- /* set tex.height to 1/4 since 1 "macropixel" (dxt-block) has 4 real pixels. Needed
- so the kernel module reads the right amount of data. */
- tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */
- tex.pitch = (BLIT_WIDTH_BYTES / 64);
- tex.height = (imageHeight + 3) / 4;
- tex.width = (imageWidth + 3) / 4;
- switch (t->pp_txformat & RADEON_TXFORMAT_FORMAT_MASK) {
- case RADEON_TXFORMAT_DXT1:
- tex.width *= 8;
- break;
- case RADEON_TXFORMAT_DXT23:
- case RADEON_TXFORMAT_DXT45:
- tex.width *= 16;
- break;
- }
- }
-
- LOCK_HARDWARE( rmesa );
- do {
- ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_TEXTURE,
- &tex, sizeof(drm_radeon_texture_t) );
- } while ( ret && errno == EAGAIN );
-
- UNLOCK_HARDWARE( rmesa );
-
- if ( ret ) {
- fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret );
- fprintf( stderr, " offset=0x%08x\n",
- offset );
- fprintf( stderr, " image width=%d height=%d\n",
- imageWidth, imageHeight );
- fprintf( stderr, " blit width=%d height=%d data=%p\n",
- t->image[face][hwlevel].width, t->image[face][hwlevel].height,
- t->image[face][hwlevel].data );
- exit( 1 );
- }
-}
-
-
-/**
- * Upload the texture images associated with texture \a t. This might
- * require the allocation of texture memory.
- *
- * \param rmesa Context pointer
- * \param t Texture to be uploaded
- * \param face Cube map face to be uploaded. Zero for non-cube maps.
- */
-
-int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint face )
-{
- const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
- fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
- (void *)rmesa->glCtx, (void *)t->base.tObj, t->base.totalSize,
- t->base.firstLevel, t->base.lastLevel );
- }
-
- if ( !t || t->base.totalSize == 0 )
- return 0;
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__ );
- radeonFinish( rmesa->glCtx );
- }
-
- LOCK_HARDWARE( rmesa );
-
- if ( t->base.memBlock == NULL ) {
- int heap;
-
- heap = driAllocateTexture( rmesa->texture_heaps, rmesa->nr_heaps,
- (driTextureObject *) t );
- if ( heap == -1 ) {
- UNLOCK_HARDWARE( rmesa );
- return -1;
- }
-
- /* Set the base offset of the texture image */
- t->bufAddr = rmesa->radeonScreen->texOffset[heap]
- + t->base.memBlock->ofs;
- t->pp_txoffset = t->bufAddr;
-
- if (!(t->base.tObj->Image[0][0]->IsClientData)) {
- /* hope it's safe to add that here... */
- t->pp_txoffset |= t->tile_bits;
- }
-
- /* Mark this texobj as dirty on all units:
- */
- t->dirty_state = TEX_ALL;
- }
-
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( (driTextureObject *) t );
- UNLOCK_HARDWARE( rmesa );
-
-
- /* Upload any images that are new */
- if (t->base.dirty_images[face]) {
- int i;
- for ( i = 0 ; i < numLevels ; i++ ) {
- if ( (t->base.dirty_images[face] & (1 << (i+t->base.firstLevel))) != 0 ) {
- uploadSubImage( rmesa, t, i, 0, 0, t->image[face][i].width,
- t->image[face][i].height, face );
- }
- }
- t->base.dirty_images[face] = 0;
- }
-
- if (RADEON_DEBUG & DEBUG_SYNC) {
- fprintf(stderr, "%s: Syncing\n", __FUNCTION__ );
- radeonFinish( rmesa->glCtx );
- }
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texstate.c
deleted file mode 100644
index 43fe509fb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ /dev/null
@@ -1,1171 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c,v 1.6 2002/12/16 16:18:59 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-#include "enums.h"
-
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_swtcl.h"
-#include "radeon_tex.h"
-#include "radeon_tcl.h"
-
-
-#define RADEON_TXFORMAT_A8 RADEON_TXFORMAT_I8
-#define RADEON_TXFORMAT_L8 RADEON_TXFORMAT_I8
-#define RADEON_TXFORMAT_AL88 RADEON_TXFORMAT_AI88
-#define RADEON_TXFORMAT_YCBCR RADEON_TXFORMAT_YVYU422
-#define RADEON_TXFORMAT_YCBCR_REV RADEON_TXFORMAT_VYUY422
-#define RADEON_TXFORMAT_RGB_DXT1 RADEON_TXFORMAT_DXT1
-#define RADEON_TXFORMAT_RGBA_DXT1 RADEON_TXFORMAT_DXT1
-#define RADEON_TXFORMAT_RGBA_DXT3 RADEON_TXFORMAT_DXT23
-#define RADEON_TXFORMAT_RGBA_DXT5 RADEON_TXFORMAT_DXT45
-
-#define _COLOR(f) \
- [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f, 0 }
-#define _COLOR_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { RADEON_TXFORMAT_ ## f, 0 }
-#define _ALPHA(f) \
- [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _ALPHA_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { RADEON_TXFORMAT_ ## f | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _YUV(f) \
- [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f, RADEON_YUV_TO_RGB }
-#define _INVALID(f) \
- [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
-#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \
- && (tx_table[f].format != 0xffffffff) )
-
-static const struct {
- GLuint format, filter;
-}
-tx_table[] =
-{
- _ALPHA(RGBA8888),
- _ALPHA_REV(RGBA8888),
- _ALPHA(ARGB8888),
- _ALPHA_REV(ARGB8888),
- _INVALID(RGB888),
- _COLOR(RGB565),
- _COLOR_REV(RGB565),
- _ALPHA(ARGB4444),
- _ALPHA_REV(ARGB4444),
- _ALPHA(ARGB1555),
- _ALPHA_REV(ARGB1555),
- _ALPHA(AL88),
- _ALPHA_REV(AL88),
- _ALPHA(A8),
- _COLOR(L8),
- _ALPHA(I8),
- _INVALID(CI8),
- _YUV(YCBCR),
- _YUV(YCBCR_REV),
- _INVALID(RGB_FXT1),
- _INVALID(RGBA_FXT1),
- _COLOR(RGB_DXT1),
- _ALPHA(RGBA_DXT1),
- _ALPHA(RGBA_DXT3),
- _ALPHA(RGBA_DXT5),
-};
-
-#undef _COLOR
-#undef _ALPHA
-#undef _INVALID
-
-/**
- * This function computes the number of bytes of storage needed for
- * the given texture object (all mipmap levels, all cube faces).
- * The \c image[face][level].x/y/width/height parameters for upload/blitting
- * are computed here. \c pp_txfilter, \c pp_txformat, etc. will be set here
- * too.
- *
- * \param rmesa Context pointer
- * \param tObj GL texture object whose images are to be posted to
- * hardware state.
- */
-static void radeonSetTexImages( radeonContextPtr rmesa,
- struct gl_texture_object *tObj )
-{
- radeonTexObjPtr t = (radeonTexObjPtr)tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint curOffset, blitWidth;
- GLint i, texelBytes;
- GLint numLevels;
- GLint log2Width, log2Height, log2Depth;
-
- /* Set the hardware texture format
- */
-
- t->pp_txformat &= ~(RADEON_TXFORMAT_FORMAT_MASK |
- RADEON_TXFORMAT_ALPHA_IN_MAP);
- t->pp_txfilter &= ~RADEON_YUV_TO_RGB;
-
- if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) {
- t->pp_txformat |= tx_table[ baseImage->TexFormat->MesaFormat ].format;
- t->pp_txfilter |= tx_table[ baseImage->TexFormat->MesaFormat ].filter;
- }
- else {
- _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);
- return;
- }
-
- texelBytes = baseImage->TexFormat->TexelBytes;
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
-
- driCalculateTextureFirstLastLevel( (driTextureObject *) t );
- log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
- log2Depth = tObj->Image[0][t->base.firstLevel]->DepthLog2;
-
- numLevels = t->base.lastLevel - t->base.firstLevel + 1;
-
- assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS);
-
- /* Calculate mipmap offsets and dimensions for blitting (uploading)
- * The idea is that we lay out the mipmap levels within a block of
- * memory organized as a rectangle of width BLIT_WIDTH_BYTES.
- */
- curOffset = 0;
- blitWidth = BLIT_WIDTH_BYTES;
- t->tile_bits = 0;
-
- /* figure out if this texture is suitable for tiling. */
- if (texelBytes && (tObj->Target != GL_TEXTURE_RECTANGLE_NV)) {
- if (rmesa->texmicrotile && (baseImage->Height > 1)) {
- /* allow 32 (bytes) x 1 mip (which will use two times the space
- the non-tiled version would use) max if base texture is large enough */
- if ((numLevels == 1) ||
- (((baseImage->Width * texelBytes / baseImage->Height) <= 32) &&
- (baseImage->Width * texelBytes > 64)) ||
- ((baseImage->Width * texelBytes / baseImage->Height) <= 16)) {
- /* R100 has two microtile bits (only the txoffset reg, not the blitter)
- weird: X2 + OPT: 32bit correct, 16bit completely hosed
- X2: 32bit correct, 16bit correct
- OPT: 32bit large mips correct, small mips hosed, 16bit completely hosed */
- t->tile_bits |= RADEON_TXO_MICRO_TILE_X2 /*| RADEON_TXO_MICRO_TILE_OPT*/;
- }
- }
- if ((baseImage->Width * texelBytes >= 256) && (baseImage->Height >= 16)) {
- /* R100 disables macro tiling only if mip width is smaller than 256 bytes, and not
- in the case if height is smaller than 16 (not 100% sure), as does the r200,
- so need to disable macro tiling in that case */
- if ((numLevels == 1) || ((baseImage->Width * texelBytes / baseImage->Height) <= 4)) {
- t->tile_bits |= RADEON_TXO_MACRO_TILE;
- }
- }
- }
-
- for (i = 0; i < numLevels; i++) {
- const struct gl_texture_image *texImage;
- GLuint size;
-
- texImage = tObj->Image[0][i + t->base.firstLevel];
- if ( !texImage )
- break;
-
- /* find image size in bytes */
- if (texImage->IsCompressed) {
- /* need to calculate the size AFTER padding even though the texture is
- submitted without padding.
- Only handle pot textures currently - don't know if npot is even possible,
- size calculation would certainly need (trivial) adjustments.
- Align (and later pad) to 32byte, not sure what that 64byte blit width is
- good for? */
- if ((t->pp_txformat & RADEON_TXFORMAT_FORMAT_MASK) == RADEON_TXFORMAT_DXT1) {
- /* RGB_DXT1/RGBA_DXT1, 8 bytes per block */
- if ((texImage->Width + 3) < 8) /* width one block */
- size = texImage->CompressedSize * 4;
- else if ((texImage->Width + 3) < 16)
- size = texImage->CompressedSize * 2;
- else size = texImage->CompressedSize;
- }
- else /* DXT3/5, 16 bytes per block */
- if ((texImage->Width + 3) < 8)
- size = texImage->CompressedSize * 2;
- else size = texImage->CompressedSize;
- }
- else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- size = ((texImage->Width * texelBytes + 63) & ~63) * texImage->Height;
- }
- else if (t->tile_bits & RADEON_TXO_MICRO_TILE_X2) {
- /* tile pattern is 16 bytes x2. mipmaps stay 32 byte aligned,
- though the actual offset may be different (if texture is less than
- 32 bytes width) to the untiled case */
- int w = (texImage->Width * texelBytes * 2 + 31) & ~31;
- size = (w * ((texImage->Height + 1) / 2)) * texImage->Depth;
- blitWidth = MAX2(texImage->Width, 64 / texelBytes);
- }
- else {
- int w = (texImage->Width * texelBytes + 31) & ~31;
- size = w * texImage->Height * texImage->Depth;
- blitWidth = MAX2(texImage->Width, 64 / texelBytes);
- }
- assert(size > 0);
-
- /* Align to 32-byte offset. It is faster to do this unconditionally
- * (no branch penalty).
- */
-
- curOffset = (curOffset + 0x1f) & ~0x1f;
-
- if (texelBytes) {
- t->image[0][i].x = curOffset; /* fix x and y coords up later together with offset */
- t->image[0][i].y = 0;
- t->image[0][i].width = MIN2(size / texelBytes, blitWidth);
- t->image[0][i].height = (size / texelBytes) / t->image[0][i].width;
- }
- else {
- t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES;
- t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES;
- t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES);
- t->image[0][i].height = size / t->image[0][i].width;
- }
-
-#if 0
- /* for debugging only and only applicable to non-rectangle targets */
- assert(size % t->image[0][i].width == 0);
- assert(t->image[0][i].x == 0
- || (size < BLIT_WIDTH_BYTES && t->image[0][i].height == 1));
-#endif
-
- if (0)
- fprintf(stderr,
- "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n",
- i, texImage->Width, texImage->Height,
- t->image[0][i].x, t->image[0][i].y,
- t->image[0][i].width, t->image[0][i].height, size, curOffset);
-
- curOffset += size;
-
- }
-
- /* Align the total size of texture memory block.
- */
- t->base.totalSize = (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK;
-
- /* Hardware state:
- */
- t->pp_txfilter &= ~RADEON_MAX_MIP_LEVEL_MASK;
- t->pp_txfilter |= (numLevels - 1) << RADEON_MAX_MIP_LEVEL_SHIFT;
-
- t->pp_txformat &= ~(RADEON_TXFORMAT_WIDTH_MASK |
- RADEON_TXFORMAT_HEIGHT_MASK |
- RADEON_TXFORMAT_CUBIC_MAP_ENABLE);
- t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_WIDTH_SHIFT) |
- (log2Height << RADEON_TXFORMAT_HEIGHT_SHIFT));
-
- t->pp_txsize = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << 0) |
- ((tObj->Image[0][t->base.firstLevel]->Height - 1) << 16));
-
- /* Only need to round to nearest 32 for textures, but the blitter
- * requires 64-byte aligned pitches, and we may/may not need the
- * blitter. NPOT only!
- */
- if (baseImage->IsCompressed)
- t->pp_txpitch = (tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63);
- else
- t->pp_txpitch = ((tObj->Image[0][t->base.firstLevel]->Width * texelBytes) + 63) & ~(63);
- t->pp_txpitch -= 32;
-
- t->dirty_state = TEX_ALL;
-
- /* FYI: radeonUploadTexImages( rmesa, t ); used to be called here */
-}
-
-
-
-/* ================================================================
- * Texture combine functions
- */
-
-/* GL_ARB_texture_env_combine support
- */
-
-/* The color tables have combine functions for GL_SRC_COLOR,
- * GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
- */
-static GLuint radeon_texture_color[][RADEON_MAX_TEXTURE_UNITS] =
-{
- {
- RADEON_COLOR_ARG_A_T0_COLOR,
- RADEON_COLOR_ARG_A_T1_COLOR,
- RADEON_COLOR_ARG_A_T2_COLOR
- },
- {
- RADEON_COLOR_ARG_A_T0_COLOR | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_T1_COLOR | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_T2_COLOR | RADEON_COMP_ARG_A
- },
- {
- RADEON_COLOR_ARG_A_T0_ALPHA,
- RADEON_COLOR_ARG_A_T1_ALPHA,
- RADEON_COLOR_ARG_A_T2_ALPHA
- },
- {
- RADEON_COLOR_ARG_A_T0_ALPHA | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_T1_ALPHA | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_T2_ALPHA | RADEON_COMP_ARG_A
- },
-};
-
-static GLuint radeon_tfactor_color[] =
-{
- RADEON_COLOR_ARG_A_TFACTOR_COLOR,
- RADEON_COLOR_ARG_A_TFACTOR_COLOR | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_TFACTOR_ALPHA,
- RADEON_COLOR_ARG_A_TFACTOR_ALPHA | RADEON_COMP_ARG_A
-};
-
-static GLuint radeon_primary_color[] =
-{
- RADEON_COLOR_ARG_A_DIFFUSE_COLOR,
- RADEON_COLOR_ARG_A_DIFFUSE_COLOR | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_DIFFUSE_ALPHA,
- RADEON_COLOR_ARG_A_DIFFUSE_ALPHA | RADEON_COMP_ARG_A
-};
-
-static GLuint radeon_previous_color[] =
-{
- RADEON_COLOR_ARG_A_CURRENT_COLOR,
- RADEON_COLOR_ARG_A_CURRENT_COLOR | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_CURRENT_ALPHA,
- RADEON_COLOR_ARG_A_CURRENT_ALPHA | RADEON_COMP_ARG_A
-};
-
-/* GL_ZERO table - indices 0-3
- * GL_ONE table - indices 1-4
- */
-static GLuint radeon_zero_color[] =
-{
- RADEON_COLOR_ARG_A_ZERO,
- RADEON_COLOR_ARG_A_ZERO | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_ZERO,
- RADEON_COLOR_ARG_A_ZERO | RADEON_COMP_ARG_A,
- RADEON_COLOR_ARG_A_ZERO
-};
-
-
-/* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA.
- */
-static GLuint radeon_texture_alpha[][RADEON_MAX_TEXTURE_UNITS] =
-{
- {
- RADEON_ALPHA_ARG_A_T0_ALPHA,
- RADEON_ALPHA_ARG_A_T1_ALPHA,
- RADEON_ALPHA_ARG_A_T2_ALPHA
- },
- {
- RADEON_ALPHA_ARG_A_T0_ALPHA | RADEON_COMP_ARG_A,
- RADEON_ALPHA_ARG_A_T1_ALPHA | RADEON_COMP_ARG_A,
- RADEON_ALPHA_ARG_A_T2_ALPHA | RADEON_COMP_ARG_A
- },
-};
-
-static GLuint radeon_tfactor_alpha[] =
-{
- RADEON_ALPHA_ARG_A_TFACTOR_ALPHA,
- RADEON_ALPHA_ARG_A_TFACTOR_ALPHA | RADEON_COMP_ARG_A
-};
-
-static GLuint radeon_primary_alpha[] =
-{
- RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA,
- RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA | RADEON_COMP_ARG_A
-};
-
-static GLuint radeon_previous_alpha[] =
-{
- RADEON_ALPHA_ARG_A_CURRENT_ALPHA,
- RADEON_ALPHA_ARG_A_CURRENT_ALPHA | RADEON_COMP_ARG_A
-};
-
-/* GL_ZERO table - indices 0-1
- * GL_ONE table - indices 1-2
- */
-static GLuint radeon_zero_alpha[] =
-{
- RADEON_ALPHA_ARG_A_ZERO,
- RADEON_ALPHA_ARG_A_ZERO | RADEON_COMP_ARG_A,
- RADEON_ALPHA_ARG_A_ZERO
-};
-
-
-/* Extract the arg from slot A, shift it into the correct argument slot
- * and set the corresponding complement bit.
- */
-#define RADEON_COLOR_ARG( n, arg ) \
-do { \
- color_combine |= \
- ((color_arg[n] & RADEON_COLOR_ARG_MASK) \
- << RADEON_COLOR_ARG_##arg##_SHIFT); \
- color_combine |= \
- ((color_arg[n] >> RADEON_COMP_ARG_SHIFT) \
- << RADEON_COMP_ARG_##arg##_SHIFT); \
-} while (0)
-
-#define RADEON_ALPHA_ARG( n, arg ) \
-do { \
- alpha_combine |= \
- ((alpha_arg[n] & RADEON_ALPHA_ARG_MASK) \
- << RADEON_ALPHA_ARG_##arg##_SHIFT); \
- alpha_combine |= \
- ((alpha_arg[n] >> RADEON_COMP_ARG_SHIFT) \
- << RADEON_COMP_ARG_##arg##_SHIFT); \
-} while (0)
-
-
-/* ================================================================
- * Texture unit state management
- */
-
-static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint color_combine, alpha_combine;
- const GLuint color_combine0 = RADEON_COLOR_ARG_A_ZERO | RADEON_COLOR_ARG_B_ZERO
- | RADEON_COLOR_ARG_C_CURRENT_COLOR | RADEON_BLEND_CTL_ADD
- | RADEON_SCALE_1X | RADEON_CLAMP_TX;
- const GLuint alpha_combine0 = RADEON_ALPHA_ARG_A_ZERO | RADEON_ALPHA_ARG_B_ZERO
- | RADEON_ALPHA_ARG_C_CURRENT_ALPHA | RADEON_BLEND_CTL_ADD
- | RADEON_SCALE_1X | RADEON_CLAMP_TX;
-
-
- /* texUnit->_Current can be NULL if and only if the texture unit is
- * not actually enabled.
- */
- assert( (texUnit->_ReallyEnabled == 0)
- || (texUnit->_Current != NULL) );
-
- if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
- }
-
- /* Set the texture environment state. Isn't this nice and clean?
- * The chip will automagically set the texture alpha to 0xff when
- * the texture format does not include an alpha component. This
- * reduces the amount of special-casing we have to do, alpha-only
- * textures being a notable exception.
- */
- /* Don't cache these results.
- */
- rmesa->state.texture.unit[unit].format = 0;
- rmesa->state.texture.unit[unit].envMode = 0;
-
- if ( !texUnit->_ReallyEnabled ) {
- color_combine = color_combine0;
- alpha_combine = alpha_combine0;
- }
- else {
- GLuint color_arg[3], alpha_arg[3];
- GLuint i;
- const GLuint numColorArgs = texUnit->_CurrentCombine->_NumArgsRGB;
- const GLuint numAlphaArgs = texUnit->_CurrentCombine->_NumArgsA;
- GLuint RGBshift = texUnit->_CurrentCombine->ScaleShiftRGB;
- GLuint Ashift = texUnit->_CurrentCombine->ScaleShiftA;
-
-
- /* Step 1:
- * Extract the color and alpha combine function arguments.
- */
- for ( i = 0 ; i < numColorArgs ; i++ ) {
- const GLint op = texUnit->_CurrentCombine->OperandRGB[i] - GL_SRC_COLOR;
- const GLuint srcRGBi = texUnit->_CurrentCombine->SourceRGB[i];
- assert(op >= 0);
- assert(op <= 3);
- switch ( srcRGBi ) {
- case GL_TEXTURE:
- color_arg[i] = radeon_texture_color[op][unit];
- break;
- case GL_CONSTANT:
- color_arg[i] = radeon_tfactor_color[op];
- break;
- case GL_PRIMARY_COLOR:
- color_arg[i] = radeon_primary_color[op];
- break;
- case GL_PREVIOUS:
- color_arg[i] = radeon_previous_color[op];
- break;
- case GL_ZERO:
- color_arg[i] = radeon_zero_color[op];
- break;
- case GL_ONE:
- color_arg[i] = radeon_zero_color[op+1];
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- /* implement ogl 1.4/1.5 core spec here, not specification of
- * GL_ARB_texture_env_crossbar (which would require disabling blending
- * instead of undefined results when referencing not enabled texunit) */
- color_arg[i] = radeon_texture_color[op][srcRGBi - GL_TEXTURE0];
- break;
- default:
- return GL_FALSE;
- }
- }
-
- for ( i = 0 ; i < numAlphaArgs ; i++ ) {
- const GLint op = texUnit->_CurrentCombine->OperandA[i] - GL_SRC_ALPHA;
- const GLuint srcAi = texUnit->_CurrentCombine->SourceA[i];
- assert(op >= 0);
- assert(op <= 1);
- switch ( srcAi ) {
- case GL_TEXTURE:
- alpha_arg[i] = radeon_texture_alpha[op][unit];
- break;
- case GL_CONSTANT:
- alpha_arg[i] = radeon_tfactor_alpha[op];
- break;
- case GL_PRIMARY_COLOR:
- alpha_arg[i] = radeon_primary_alpha[op];
- break;
- case GL_PREVIOUS:
- alpha_arg[i] = radeon_previous_alpha[op];
- break;
- case GL_ZERO:
- alpha_arg[i] = radeon_zero_alpha[op];
- break;
- case GL_ONE:
- alpha_arg[i] = radeon_zero_alpha[op+1];
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- alpha_arg[i] = radeon_texture_alpha[op][srcAi - GL_TEXTURE0];
- break;
- default:
- return GL_FALSE;
- }
- }
-
- /* Step 2:
- * Build up the color and alpha combine functions.
- */
- switch ( texUnit->_CurrentCombine->ModeRGB ) {
- case GL_REPLACE:
- color_combine = (RADEON_COLOR_ARG_A_ZERO |
- RADEON_COLOR_ARG_B_ZERO |
- RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, C );
- break;
- case GL_MODULATE:
- color_combine = (RADEON_COLOR_ARG_C_ZERO |
- RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, B );
- break;
- case GL_ADD:
- color_combine = (RADEON_COLOR_ARG_B_ZERO |
- RADEON_COMP_ARG_B |
- RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, C );
- break;
- case GL_ADD_SIGNED:
- color_combine = (RADEON_COLOR_ARG_B_ZERO |
- RADEON_COMP_ARG_B |
- RADEON_BLEND_CTL_ADDSIGNED |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, C );
- break;
- case GL_SUBTRACT:
- color_combine = (RADEON_COLOR_ARG_B_ZERO |
- RADEON_COMP_ARG_B |
- RADEON_BLEND_CTL_SUBTRACT |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, C );
- break;
- case GL_INTERPOLATE:
- color_combine = (RADEON_BLEND_CTL_BLEND |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, B );
- RADEON_COLOR_ARG( 1, A );
- RADEON_COLOR_ARG( 2, C );
- break;
-
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- /* The EXT version of the DOT3 extension does not support the
- * scale factor, but the ARB version (and the version in OpenGL
- * 1.3) does.
- */
- RGBshift = 0;
- /* FALLTHROUGH */
-
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- /* The R100 / RV200 only support a 1X multiplier in hardware
- * w/the ARB version.
- */
- if ( RGBshift != (RADEON_SCALE_1X >> RADEON_SCALE_SHIFT) ) {
- return GL_FALSE;
- }
-
- RGBshift += 2;
- if ( (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT)
- || (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) ) {
- /* is it necessary to set this or will it be ignored anyway? */
- Ashift = RGBshift;
- }
-
- color_combine = (RADEON_COLOR_ARG_C_ZERO |
- RADEON_BLEND_CTL_DOT3 |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, B );
- break;
-
- case GL_MODULATE_ADD_ATI:
- color_combine = (RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, C );
- RADEON_COLOR_ARG( 2, B );
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- color_combine = (RADEON_BLEND_CTL_ADDSIGNED |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, C );
- RADEON_COLOR_ARG( 2, B );
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- color_combine = (RADEON_BLEND_CTL_SUBTRACT |
- RADEON_CLAMP_TX);
- RADEON_COLOR_ARG( 0, A );
- RADEON_COLOR_ARG( 1, C );
- RADEON_COLOR_ARG( 2, B );
- break;
- default:
- return GL_FALSE;
- }
-
- switch ( texUnit->_CurrentCombine->ModeA ) {
- case GL_REPLACE:
- alpha_combine = (RADEON_ALPHA_ARG_A_ZERO |
- RADEON_ALPHA_ARG_B_ZERO |
- RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, C );
- break;
- case GL_MODULATE:
- alpha_combine = (RADEON_ALPHA_ARG_C_ZERO |
- RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, B );
- break;
- case GL_ADD:
- alpha_combine = (RADEON_ALPHA_ARG_B_ZERO |
- RADEON_COMP_ARG_B |
- RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, C );
- break;
- case GL_ADD_SIGNED:
- alpha_combine = (RADEON_ALPHA_ARG_B_ZERO |
- RADEON_COMP_ARG_B |
- RADEON_BLEND_CTL_ADDSIGNED |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, C );
- break;
- case GL_SUBTRACT:
- alpha_combine = (RADEON_COLOR_ARG_B_ZERO |
- RADEON_COMP_ARG_B |
- RADEON_BLEND_CTL_SUBTRACT |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, C );
- break;
- case GL_INTERPOLATE:
- alpha_combine = (RADEON_BLEND_CTL_BLEND |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, B );
- RADEON_ALPHA_ARG( 1, A );
- RADEON_ALPHA_ARG( 2, C );
- break;
-
- case GL_MODULATE_ADD_ATI:
- alpha_combine = (RADEON_BLEND_CTL_ADD |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, C );
- RADEON_ALPHA_ARG( 2, B );
- break;
- case GL_MODULATE_SIGNED_ADD_ATI:
- alpha_combine = (RADEON_BLEND_CTL_ADDSIGNED |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, C );
- RADEON_ALPHA_ARG( 2, B );
- break;
- case GL_MODULATE_SUBTRACT_ATI:
- alpha_combine = (RADEON_BLEND_CTL_SUBTRACT |
- RADEON_CLAMP_TX);
- RADEON_ALPHA_ARG( 0, A );
- RADEON_ALPHA_ARG( 1, C );
- RADEON_ALPHA_ARG( 2, B );
- break;
- default:
- return GL_FALSE;
- }
-
- if ( (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGB_EXT)
- || (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGB) ) {
- alpha_combine |= RADEON_DOT_ALPHA_DONT_REPLICATE;
- }
-
- /* Step 3:
- * Apply the scale factor.
- */
- color_combine |= (RGBshift << RADEON_SCALE_SHIFT);
- alpha_combine |= (Ashift << RADEON_SCALE_SHIFT);
-
- /* All done!
- */
- }
-
- if ( rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] != color_combine ||
- rmesa->hw.tex[unit].cmd[TEX_PP_TXABLEND] != alpha_combine ) {
- RADEON_STATECHANGE( rmesa, tex[unit] );
- rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] = color_combine;
- rmesa->hw.tex[unit].cmd[TEX_PP_TXABLEND] = alpha_combine;
- }
-
- return GL_TRUE;
-}
-
-#define TEXOBJ_TXFILTER_MASK (RADEON_MAX_MIP_LEVEL_MASK | \
- RADEON_MIN_FILTER_MASK | \
- RADEON_MAG_FILTER_MASK | \
- RADEON_MAX_ANISO_MASK | \
- RADEON_YUV_TO_RGB | \
- RADEON_YUV_TEMPERATURE_MASK | \
- RADEON_CLAMP_S_MASK | \
- RADEON_CLAMP_T_MASK | \
- RADEON_BORDER_MODE_D3D )
-
-#define TEXOBJ_TXFORMAT_MASK (RADEON_TXFORMAT_WIDTH_MASK | \
- RADEON_TXFORMAT_HEIGHT_MASK | \
- RADEON_TXFORMAT_FORMAT_MASK | \
- RADEON_TXFORMAT_F5_WIDTH_MASK | \
- RADEON_TXFORMAT_F5_HEIGHT_MASK | \
- RADEON_TXFORMAT_ALPHA_IN_MAP | \
- RADEON_TXFORMAT_CUBIC_MAP_ENABLE | \
- RADEON_TXFORMAT_NON_POWER2)
-
-
-static void import_tex_obj_state( radeonContextPtr rmesa,
- int unit,
- radeonTexObjPtr texobj )
-{
- GLuint *cmd = RADEON_DB_STATE( tex[unit] );
-
- cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK;
- cmd[TEX_PP_TXFILTER] |= texobj->pp_txfilter & TEXOBJ_TXFILTER_MASK;
- cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK;
- cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK;
- cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset;
- cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color;
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.tex[unit] );
-
- if (texobj->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
- GLuint *txr_cmd = RADEON_DB_STATE( txr[unit] );
- txr_cmd[TXR_PP_TEX_SIZE] = texobj->pp_txsize; /* NPOT only! */
- txr_cmd[TXR_PP_TEX_PITCH] = texobj->pp_txpitch; /* NPOT only! */
- RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.txr[unit] );
- }
-
- texobj->dirty_state &= ~(1<<unit);
-}
-
-
-
-
-static void set_texgen_matrix( radeonContextPtr rmesa,
- GLuint unit,
- const GLfloat *s_plane,
- const GLfloat *t_plane )
-{
- static const GLfloat scale_identity[4] = { 1,1,1,1 };
-
- if (!TEST_EQ_4V( s_plane, scale_identity) ||
- !TEST_EQ_4V( t_plane, scale_identity)) {
- rmesa->TexGenEnabled |= RADEON_TEXMAT_0_ENABLE<<unit;
- rmesa->TexGenMatrix[unit].m[0] = s_plane[0];
- rmesa->TexGenMatrix[unit].m[4] = s_plane[1];
- rmesa->TexGenMatrix[unit].m[8] = s_plane[2];
- rmesa->TexGenMatrix[unit].m[12] = s_plane[3];
-
- rmesa->TexGenMatrix[unit].m[1] = t_plane[0];
- rmesa->TexGenMatrix[unit].m[5] = t_plane[1];
- rmesa->TexGenMatrix[unit].m[9] = t_plane[2];
- rmesa->TexGenMatrix[unit].m[13] = t_plane[3];
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-}
-
-/* Ignoring the Q texcoord for now.
- *
- * Returns GL_FALSE if fallback required.
- */
-static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4;
- GLuint tmp = rmesa->TexGenEnabled;
-
- rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<<inputshift);
- rmesa->TexGenNeedNormals[unit] = 0;
-
- if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) == 0) {
- /* Disabled, no fallback:
- */
- rmesa->TexGenEnabled |=
- (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
- return GL_TRUE;
- }
- else if (texUnit->TexGenEnabled & Q_BIT) {
- /* Very easy to do this, in fact would remove a fallback case
- * elsewhere, but I haven't done it yet... Fallback:
- */
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "fallback Q_BIT\n");
- return GL_FALSE;
- }
- else if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) != (S_BIT|T_BIT) ||
- texUnit->GenModeS != texUnit->GenModeT) {
- /* Mixed modes, fallback:
- */
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "fallback mixed texgen\n");
- return GL_FALSE;
- }
- else
- rmesa->TexGenEnabled |= RADEON_TEXGEN_TEXMAT_0_ENABLE << unit;
-
- switch (texUnit->GenModeS) {
- case GL_OBJECT_LINEAR:
- rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_OBJ << inputshift;
- set_texgen_matrix( rmesa, unit,
- texUnit->ObjectPlaneS,
- texUnit->ObjectPlaneT);
- break;
-
- case GL_EYE_LINEAR:
- rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_EYE << inputshift;
- set_texgen_matrix( rmesa, unit,
- texUnit->EyePlaneS,
- texUnit->EyePlaneT);
- break;
-
- case GL_REFLECTION_MAP_NV:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_EYE_REFLECT<<inputshift;
- break;
-
- case GL_NORMAL_MAP_NV:
- rmesa->TexGenNeedNormals[unit] = GL_TRUE;
- rmesa->TexGenEnabled |= RADEON_TEXGEN_INPUT_EYE_NORMAL<<inputshift;
- break;
-
- case GL_SPHERE_MAP:
- default:
- /* Unsupported mode, fallback:
- */
- if (RADEON_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "fallback GL_SPHERE_MAP\n");
- return GL_FALSE;
- }
-
- if (tmp != rmesa->TexGenEnabled) {
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-
- return GL_TRUE;
-}
-
-
-static void disable_tex( GLcontext *ctx, int unit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<<unit)) {
- /* Texture unit disabled */
- if ( rmesa->state.texture.unit[unit].texobj != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->state.texture.unit[unit].texobj->base.bound &= ~(1UL << unit);
- rmesa->state.texture.unit[unit].texobj = NULL;
- }
-
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] &=
- ~((RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit);
-
- RADEON_STATECHANGE( rmesa, tcl );
- switch (unit) {
- case 0:
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~(RADEON_TCL_VTX_ST0 |
- RADEON_TCL_VTX_Q0);
- break;
- case 1:
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~(RADEON_TCL_VTX_ST1 |
- RADEON_TCL_VTX_Q1);
- break;
- default:
- break;
- }
-
-
- if (rmesa->TclFallback & (RADEON_TCL_FALLBACK_TEXGEN_0<<unit)) {
- TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), GL_FALSE);
- rmesa->recheck_texgen[unit] = GL_TRUE;
- }
-
-
-
- {
- GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4;
- GLuint tmp = rmesa->TexGenEnabled;
-
- rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<<unit);
- rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<<inputshift);
- rmesa->TexGenNeedNormals[unit] = 0;
- rmesa->TexGenEnabled |=
- (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
-
- if (tmp != rmesa->TexGenEnabled) {
- rmesa->recheck_texgen[unit] = GL_TRUE;
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
- }
- }
-}
-
-static GLboolean enable_tex_2d( GLcontext *ctx, int unit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData;
-
- /* Need to load the 2d images associated with this unit.
- */
- if (t->pp_txformat & RADEON_TXFORMAT_NON_POWER2) {
- t->pp_txformat &= ~RADEON_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_1D);
-
- if ( t->base.dirty_images[0] ) {
- RADEON_FIREVERTICES( rmesa );
- radeonSetTexImages( rmesa, tObj );
- radeonUploadTexImages( rmesa, (radeonTexObjPtr) tObj->DriverData, 0 );
- if ( !t->base.memBlock )
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean enable_tex_rect( GLcontext *ctx, int unit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData;
-
- if (!(t->pp_txformat & RADEON_TXFORMAT_NON_POWER2)) {
- t->pp_txformat |= RADEON_TXFORMAT_NON_POWER2;
- t->base.dirty_images[0] = ~0;
- }
-
- ASSERT(tObj->Target == GL_TEXTURE_RECTANGLE_NV);
-
- if ( t->base.dirty_images[0] ) {
- RADEON_FIREVERTICES( rmesa );
- radeonSetTexImages( rmesa, tObj );
- radeonUploadTexImages( rmesa, (radeonTexObjPtr) tObj->DriverData, 0 );
- if ( !t->base.memBlock /* && !rmesa->prefer_gart_client_texturing FIXME */ ) {
- fprintf(stderr, "%s: upload failed\n", __FUNCTION__);
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean update_tex_common( GLcontext *ctx, int unit )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *tObj = texUnit->_Current;
- radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData;
- GLenum format;
-
- /* Fallback if there's a texture border */
- if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
- fprintf(stderr, "%s: border\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- /* Update state if this is a different texture object to last
- * time.
- */
- if ( rmesa->state.texture.unit[unit].texobj != t ) {
- if ( rmesa->state.texture.unit[unit].texobj != NULL ) {
- /* The old texture is no longer bound to this texture unit.
- * Mark it as such.
- */
-
- rmesa->state.texture.unit[unit].texobj->base.bound &=
- ~(1UL << unit);
- }
-
- rmesa->state.texture.unit[unit].texobj = t;
- t->base.bound |= (1UL << unit);
- t->dirty_state |= 1<<unit;
- driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked! */
- }
-
-
- /* Newly enabled?
- */
- if ( !(rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<<unit))) {
- RADEON_STATECHANGE( rmesa, ctx );
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |=
- (RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit;
-
- RADEON_STATECHANGE( rmesa, tcl );
-
- if (unit == 0)
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST0;
- else
- rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST1;
-
- rmesa->recheck_texgen[unit] = GL_TRUE;
- }
-
- if (t->dirty_state & (1<<unit)) {
- import_tex_obj_state( rmesa, unit, t );
- }
-
- if (rmesa->recheck_texgen[unit]) {
- GLboolean fallback = !radeon_validate_texgen( ctx, unit );
- TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), fallback);
- rmesa->recheck_texgen[unit] = 0;
- rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
- }
-
- format = tObj->Image[0][tObj->BaseLevel]->Format;
- if ( rmesa->state.texture.unit[unit].format != format ||
- rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
- rmesa->state.texture.unit[unit].format = format;
- rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode;
- if ( ! radeonUpdateTextureEnv( ctx, unit ) ) {
- return GL_FALSE;
- }
- }
-
- FALLBACK( rmesa, RADEON_FALLBACK_BORDER_MODE, t->border_fallback );
- return !t->border_fallback;
-}
-
-
-
-static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit )
-{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_TEXRECT_0 << unit, 0 );
-
- if ( texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT) ) {
- TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_TEXRECT_0 << unit, 1 );
-
- return (enable_tex_rect( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
- else if ( texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) {
- return (enable_tex_2d( ctx, unit ) &&
- update_tex_common( ctx, unit ));
- }
- else if ( texUnit->_ReallyEnabled ) {
- return GL_FALSE;
- }
- else {
- disable_tex( ctx, unit );
- return GL_TRUE;
- }
-}
-
-void radeonUpdateTextureState( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLboolean ok;
-
- ok = (radeonUpdateTextureUnit( ctx, 0 ) &&
- radeonUpdateTextureUnit( ctx, 1 ));
-
- FALLBACK( rmesa, RADEON_FALLBACK_TEXTURE, !ok );
-
- if (rmesa->TclFallback)
- radeonChooseVertexState( ctx );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
deleted file mode 100644
index 5a4cad8ba..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
+++ /dev/null
@@ -1,1093 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c,v 1.6 2003/05/06 23:52:08 daenzer Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-#include "glheader.h"
-#include "imports.h"
-#include "api_noop.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "glapi.h"
-#include "colormac.h"
-#include "light.h"
-#include "state.h"
-#include "vtxfmt.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_array_api.h"
-
-#include "radeon_context.h"
-#include "radeon_state.h"
-#include "radeon_ioctl.h"
-#include "radeon_tex.h"
-#include "radeon_tcl.h"
-#include "radeon_swtcl.h"
-#include "radeon_vtxfmt.h"
-
-#include "dispatch.h"
-
-static void radeonVtxfmtFlushVertices( GLcontext *, GLuint );
-
-static void count_func( const char *name, struct dynfn *l )
-{
- int i = 0;
- struct dynfn *f;
- foreach (f, l) i++;
- if (i) fprintf(stderr, "%s: %d\n", name, i );
-}
-
-static void count_funcs( radeonContextPtr rmesa )
-{
- count_func( "Vertex2f", &rmesa->vb.dfn_cache.Vertex2f );
- count_func( "Vertex2fv", &rmesa->vb.dfn_cache.Vertex2fv );
- count_func( "Vertex3f", &rmesa->vb.dfn_cache.Vertex3f );
- count_func( "Vertex3fv", &rmesa->vb.dfn_cache.Vertex3fv );
- count_func( "Color4ub", &rmesa->vb.dfn_cache.Color4ub );
- count_func( "Color4ubv", &rmesa->vb.dfn_cache.Color4ubv );
- count_func( "Color3ub", &rmesa->vb.dfn_cache.Color3ub );
- count_func( "Color3ubv", &rmesa->vb.dfn_cache.Color3ubv );
- count_func( "Color4f", &rmesa->vb.dfn_cache.Color4f );
- count_func( "Color4fv", &rmesa->vb.dfn_cache.Color4fv );
- count_func( "Color3f", &rmesa->vb.dfn_cache.Color3f );
- count_func( "Color3fv", &rmesa->vb.dfn_cache.Color3fv );
- count_func( "SecondaryColor3f", &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
- count_func( "SecondaryColor3fv", &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
- count_func( "SecondaryColor3ub", &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
- count_func( "SecondaryColor3ubv", &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
- count_func( "Normal3f", &rmesa->vb.dfn_cache.Normal3f );
- count_func( "Normal3fv", &rmesa->vb.dfn_cache.Normal3fv );
- count_func( "TexCoord2f", &rmesa->vb.dfn_cache.TexCoord2f );
- count_func( "TexCoord2fv", &rmesa->vb.dfn_cache.TexCoord2fv );
- count_func( "TexCoord1f", &rmesa->vb.dfn_cache.TexCoord1f );
- count_func( "TexCoord1fv", &rmesa->vb.dfn_cache.TexCoord1fv );
- count_func( "MultiTexCoord2fARB", &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- count_func( "MultiTexCoord2fvARB", &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- count_func( "MultiTexCoord1fARB", &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
- count_func( "MultiTexCoord1fvARB", &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
-}
-
-
-void radeon_copy_to_current( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT);
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_N0) {
- ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0] = rmesa->vb.normalptr[0];
- ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1] = rmesa->vb.normalptr[1];
- ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2] = rmesa->vb.normalptr[2];
- }
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_PKCOLOR) {
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->red );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->green );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->blue );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->alpha );
- }
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_FPCOLOR) {
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = rmesa->vb.floatcolorptr[0];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = rmesa->vb.floatcolorptr[1];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = rmesa->vb.floatcolorptr[2];
- }
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_FPALPHA)
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = rmesa->vb.floatcolorptr[3];
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_PKSPEC) {
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] = UBYTE_TO_FLOAT( rmesa->vb.specptr->red );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] = UBYTE_TO_FLOAT( rmesa->vb.specptr->green );
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] = UBYTE_TO_FLOAT( rmesa->vb.specptr->blue );
- }
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_ST0) {
- ctx->Current.Attrib[VERT_ATTRIB_TEX0][0] = rmesa->vb.texcoordptr[0][0];
- ctx->Current.Attrib[VERT_ATTRIB_TEX0][1] = rmesa->vb.texcoordptr[0][1];
- ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] = 0.0F;
- ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] = 1.0F;
- }
-
- if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_ST1) {
- ctx->Current.Attrib[VERT_ATTRIB_TEX1][0] = rmesa->vb.texcoordptr[1][0];
- ctx->Current.Attrib[VERT_ATTRIB_TEX1][1] = rmesa->vb.texcoordptr[1][1];
- ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] = 0.0F;
- ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] = 1.0F;
- }
-
- ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
-}
-
-static GLboolean discreet_gl_prim[GL_POLYGON+1] = {
- 1, /* 0 points */
- 1, /* 1 lines */
- 0, /* 2 line_strip */
- 0, /* 3 line_loop */
- 1, /* 4 tris */
- 0, /* 5 tri_fan */
- 0, /* 6 tri_strip */
- 1, /* 7 quads */
- 0, /* 8 quadstrip */
- 0, /* 9 poly */
-};
-
-static void flush_prims( radeonContextPtr rmesa )
-{
- int i,j;
- struct radeon_dma_region tmp = rmesa->dma.current;
-
- tmp.buf->refcount++;
- tmp.aos_size = rmesa->vb.vertex_size;
- tmp.aos_stride = rmesa->vb.vertex_size;
- tmp.aos_start = GET_START(&tmp);
-
- rmesa->dma.current.ptr = rmesa->dma.current.start +=
- (rmesa->vb.initial_counter - rmesa->vb.counter) * rmesa->vb.vertex_size * 4;
-
- rmesa->tcl.vertex_format = rmesa->vb.vertex_format;
- rmesa->tcl.aos_components[0] = &tmp;
- rmesa->tcl.nr_aos_components = 1;
- rmesa->dma.flush = NULL;
-
- /* Optimize the primitive list:
- */
- if (rmesa->vb.nrprims > 1) {
- for (j = 0, i = 1 ; i < rmesa->vb.nrprims; i++) {
- int pj = rmesa->vb.primlist[j].prim & 0xf;
- int pi = rmesa->vb.primlist[i].prim & 0xf;
-
- if (pj == pi && discreet_gl_prim[pj] &&
- rmesa->vb.primlist[i].start == rmesa->vb.primlist[j].end) {
- rmesa->vb.primlist[j].end = rmesa->vb.primlist[i].end;
- }
- else {
- j++;
- if (j != i) rmesa->vb.primlist[j] = rmesa->vb.primlist[i];
- }
- }
- rmesa->vb.nrprims = j+1;
- }
-
- for (i = 0 ; i < rmesa->vb.nrprims; i++) {
- if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "vtxfmt prim %d: %s %d..%d\n", i,
- _mesa_lookup_enum_by_nr( rmesa->vb.primlist[i].prim &
- PRIM_MODE_MASK ),
- rmesa->vb.primlist[i].start,
- rmesa->vb.primlist[i].end);
-
- radeonEmitPrimitive( rmesa->glCtx,
- rmesa->vb.primlist[i].start,
- rmesa->vb.primlist[i].end,
- rmesa->vb.primlist[i].prim );
- }
-
- rmesa->vb.nrprims = 0;
- radeonReleaseDmaRegion( rmesa, &tmp, __FUNCTION__ );
-}
-
-
-static void start_prim( radeonContextPtr rmesa, GLuint mode )
-{
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->vb.initial_counter - rmesa->vb.counter);
-
- rmesa->vb.primlist[rmesa->vb.nrprims].start = rmesa->vb.initial_counter - rmesa->vb.counter;
- rmesa->vb.primlist[rmesa->vb.nrprims].prim = mode;
-}
-
-static void note_last_prim( radeonContextPtr rmesa, GLuint flags )
-{
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->vb.initial_counter - rmesa->vb.counter);
-
- if (rmesa->vb.prim[0] != GL_POLYGON+1) {
- rmesa->vb.primlist[rmesa->vb.nrprims].prim |= flags;
- rmesa->vb.primlist[rmesa->vb.nrprims].end = rmesa->vb.initial_counter - rmesa->vb.counter;
-
- if (++(rmesa->vb.nrprims) == RADEON_MAX_PRIMS)
- flush_prims( rmesa );
- }
-}
-
-
-static void copy_vertex( radeonContextPtr rmesa, GLuint n, GLfloat *dst )
-{
- GLuint i;
- GLfloat *src = (GLfloat *)(rmesa->dma.current.address +
- rmesa->dma.current.ptr +
- (rmesa->vb.primlist[rmesa->vb.nrprims].start + n) *
- rmesa->vb.vertex_size * 4);
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "copy_vertex %d\n", rmesa->vb.primlist[rmesa->vb.nrprims].start + n);
-
- for (i = 0 ; i < rmesa->vb.vertex_size; i++) {
- dst[i] = src[i];
- }
-}
-
-/* NOTE: This actually reads the copied vertices back from uncached
- * memory. Could also use the counter/notify mechanism to populate
- * tmp on the fly as vertices are generated.
- */
-static GLuint copy_dma_verts( radeonContextPtr rmesa, GLfloat (*tmp)[15] )
-{
- GLuint ovf, i;
- GLuint nr = (rmesa->vb.initial_counter - rmesa->vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start;
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s %d verts\n", __FUNCTION__, nr);
-
- switch( rmesa->vb.prim[0] )
- {
- case GL_POINTS:
- return 0;
- case GL_LINES:
- ovf = nr&1;
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_TRIANGLES:
- ovf = nr%3;
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_QUADS:
- ovf = nr&3;
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_LINE_STRIP:
- if (nr == 0)
- return 0;
- copy_vertex( rmesa, nr-1, tmp[0] );
- return 1;
- case GL_LINE_LOOP:
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- if (nr == 0)
- return 0;
- else if (nr == 1) {
- copy_vertex( rmesa, 0, tmp[0] );
- return 1;
- } else {
- copy_vertex( rmesa, 0, tmp[0] );
- copy_vertex( rmesa, nr-1, tmp[1] );
- return 2;
- }
- case GL_TRIANGLE_STRIP:
- ovf = MIN2(nr, 2);
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- case GL_QUAD_STRIP:
- switch (nr) {
- case 0: ovf = 0; break;
- case 1: ovf = 1; break;
- default: ovf = 2 + (nr&1); break;
- }
- for (i = 0 ; i < ovf ; i++)
- copy_vertex( rmesa, nr-ovf+i, tmp[i] );
- return i;
- default:
- assert(0);
- return 0;
- }
-}
-
-static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (ctx->Driver.NeedFlush)
- radeonVtxfmtFlushVertices( ctx, ctx->Driver.NeedFlush );
-
- if (ctx->NewState)
- _mesa_update_state( ctx ); /* clear state so fell_back sticks */
-
- _tnl_wakeup_exec( ctx );
- ctx->Driver.FlushVertices = radeonFlushVertices;
-
- assert( rmesa->dma.flush == 0 );
- rmesa->vb.fell_back = GL_TRUE;
- rmesa->vb.installed = GL_FALSE;
-}
-
-
-static void VFMT_FALLBACK( const char *caller )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat tmp[3][15];
- GLuint i, prim;
- GLuint ind = rmesa->vb.vertex_format;
- GLuint nrverts;
- GLfloat alpha = 1.0;
-
- if (RADEON_DEBUG & (DEBUG_FALLBACKS|DEBUG_VFMT))
- fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
-
- if (rmesa->vb.prim[0] == GL_POLYGON+1) {
- VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
- return;
- }
-
- /* Copy vertices out of dma:
- */
- nrverts = copy_dma_verts( rmesa, tmp );
-
- /* Finish the prim at this point:
- */
- note_last_prim( rmesa, 0 );
- flush_prims( rmesa );
-
- /* Update ctx->Driver.CurrentExecPrimitive and swap in swtnl.
- */
- prim = rmesa->vb.prim[0];
- ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
- _tnl_wakeup_exec( ctx );
- ctx->Driver.FlushVertices = radeonFlushVertices;
-
- assert(rmesa->dma.flush == 0);
- rmesa->vb.fell_back = GL_TRUE;
- rmesa->vb.installed = GL_FALSE;
- CALL_Begin(GET_DISPATCH(), (prim));
-
- if (rmesa->vb.installed_color_3f_sz == 4)
- alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
-
- /* Replay saved vertices
- */
- for (i = 0 ; i < nrverts; i++) {
- GLuint offset = 3;
- if (ind & RADEON_CP_VC_FRMT_N0) {
- CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset += 3;
- }
-
- if (ind & RADEON_CP_VC_FRMT_PKCOLOR) {
- radeon_color_t *col = (radeon_color_t *)&tmp[i][offset];
- CALL_Color4ub(GET_DISPATCH(), (col->red, col->green, col->blue, col->alpha));
- offset++;
- }
- else if (ind & RADEON_CP_VC_FRMT_FPALPHA) {
- CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset+=4;
- }
- else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
- CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset+=3;
- }
-
- if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
- radeon_color_t *spec = (radeon_color_t *)&tmp[i][offset];
- CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (spec->red, spec->green, spec->blue));
- offset++;
- }
-
- if (ind & RADEON_CP_VC_FRMT_ST0) {
- CALL_TexCoord2fv(GET_DISPATCH(), (&tmp[i][offset]));
- offset += 2;
- }
-
- if (ind & RADEON_CP_VC_FRMT_ST1) {
- CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE1_ARB, &tmp[i][offset]));
- offset += 2;
- }
- CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0]));
- }
-
- /* Replay current vertex
- */
- if (ind & RADEON_CP_VC_FRMT_N0)
- CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr));
-
- if (ind & RADEON_CP_VC_FRMT_PKCOLOR)
- CALL_Color4ub(GET_DISPATCH(), (rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha));
- else if (ind & RADEON_CP_VC_FRMT_FPALPHA)
- CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
- else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
- if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0)
- CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0],
- rmesa->vb.floatcolorptr[1],
- rmesa->vb.floatcolorptr[2],
- alpha));
- else
- CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
- }
-
- if (ind & RADEON_CP_VC_FRMT_PKSPEC)
- CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue));
-
- if (ind & RADEON_CP_VC_FRMT_ST0)
- CALL_TexCoord2fv(GET_DISPATCH(), (rmesa->vb.texcoordptr[0]));
-
- if (ind & RADEON_CP_VC_FRMT_ST1)
- CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1]));
-}
-
-
-
-static void wrap_buffer( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat tmp[3][15];
- GLuint i, nrverts;
-
- if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_PRIMS))
- fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->vb.initial_counter - rmesa->vb.counter);
-
- /* Don't deal with parity.
- */
- if ((((rmesa->vb.initial_counter - rmesa->vb.counter) -
- rmesa->vb.primlist[rmesa->vb.nrprims].start) & 1)) {
- rmesa->vb.counter++;
- rmesa->vb.initial_counter++;
- return;
- }
-
- /* Copy vertices out of dma:
- */
- if (rmesa->vb.prim[0] == GL_POLYGON+1)
- nrverts = 0;
- else {
- nrverts = copy_dma_verts( rmesa, tmp );
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%d vertices to copy\n", nrverts);
-
- /* Finish the prim at this point:
- */
- note_last_prim( rmesa, 0 );
- }
-
- /* Fire any buffered primitives
- */
- flush_prims( rmesa );
-
- /* Get new buffer
- */
- radeonRefillCurrentDmaRegion( rmesa );
-
- /* Reset counter, dmaptr
- */
- rmesa->vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address);
- rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
- (rmesa->vb.vertex_size * 4);
- rmesa->vb.counter--;
- rmesa->vb.initial_counter = rmesa->vb.counter;
- rmesa->vb.notify = wrap_buffer;
-
- rmesa->dma.flush = flush_prims;
-
- /* Restart wrapped primitive:
- */
- if (rmesa->vb.prim[0] != GL_POLYGON+1)
- start_prim( rmesa, rmesa->vb.prim[0] );
-
- /* Reemit saved vertices
- */
- for (i = 0 ; i < nrverts; i++) {
- if (RADEON_DEBUG & DEBUG_VERTS) {
- int j;
- fprintf(stderr, "re-emit vertex %d to %p\n", i, (void *)rmesa->vb.dmaptr);
- if (RADEON_DEBUG & DEBUG_VERBOSE)
- for (j = 0 ; j < rmesa->vb.vertex_size; j++)
- fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]);
- }
-
- memcpy( rmesa->vb.dmaptr, tmp[i], rmesa->vb.vertex_size * 4 );
- rmesa->vb.dmaptr += rmesa->vb.vertex_size;
- rmesa->vb.counter--;
- }
-}
-
-
-
-static GLboolean check_vtx_fmt( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint ind = RADEON_CP_VC_FRMT_Z;
-
- if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag)
- return GL_FALSE;
-
- if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
- ctx->Driver.FlushVertices( ctx, FLUSH_UPDATE_CURRENT );
-
- /* Make all this event-driven:
- */
- if (ctx->Light.Enabled) {
- ind |= RADEON_CP_VC_FRMT_N0;
-
- /* TODO: make this data driven: If we receive only ubytes, send
- * color as ubytes. Also check if converting (with free
- * checking for overflow) is cheaper than sending floats
- * directly.
- */
- if (ctx->Light.ColorMaterialEnabled) {
- ind |= (RADEON_CP_VC_FRMT_FPCOLOR |
- RADEON_CP_VC_FRMT_FPALPHA);
- }
- else
- ind |= RADEON_CP_VC_FRMT_PKCOLOR; /* for alpha? */
- }
- else {
- /* TODO: make this data driven?
- */
- ind |= RADEON_CP_VC_FRMT_PKCOLOR;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- ind |= RADEON_CP_VC_FRMT_PKSPEC;
- }
- }
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- if (ctx->Texture.Unit[0].TexGenEnabled) {
- if (rmesa->TexGenNeedNormals[0]) {
- ind |= RADEON_CP_VC_FRMT_N0;
- }
- } else {
- if (ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] != 0.0F ||
- ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] != 1.0) {
- if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
- fprintf(stderr, "%s: rq0\n", __FUNCTION__);
- return GL_FALSE;
- }
- ind |= RADEON_CP_VC_FRMT_ST0;
- }
- }
-
- if (ctx->Texture.Unit[1]._ReallyEnabled) {
- if (ctx->Texture.Unit[1].TexGenEnabled) {
- if (rmesa->TexGenNeedNormals[1]) {
- ind |= RADEON_CP_VC_FRMT_N0;
- }
- } else {
- if (ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] != 0.0F ||
- ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] != 1.0) {
- if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS))
- fprintf(stderr, "%s: rq1\n", __FUNCTION__);
- return GL_FALSE;
- }
- ind |= RADEON_CP_VC_FRMT_ST1;
- }
- }
-
- if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_STATE))
- fprintf(stderr, "%s: format: 0x%x\n", __FUNCTION__, ind );
-
- RADEON_NEWPRIM(rmesa);
- rmesa->vb.vertex_format = ind;
- rmesa->vb.vertex_size = 3;
- rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
-
- rmesa->vb.normalptr = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
- rmesa->vb.colorptr = NULL;
- rmesa->vb.floatcolorptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
- rmesa->vb.specptr = NULL;
- rmesa->vb.floatspecptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
- rmesa->vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
- rmesa->vb.texcoordptr[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1];
-
- /* Run through and initialize the vertex components in the order
- * the hardware understands:
- */
- if (ind & RADEON_CP_VC_FRMT_N0) {
- rmesa->vb.normalptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 3;
- rmesa->vb.normalptr[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
- rmesa->vb.normalptr[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
- rmesa->vb.normalptr[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
- }
-
- if (ind & RADEON_CP_VC_FRMT_PKCOLOR) {
- rmesa->vb.colorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color;
- rmesa->vb.vertex_size += 1;
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->alpha, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] );
- }
-
- if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
- assert(!(ind & RADEON_CP_VC_FRMT_PKCOLOR));
- rmesa->vb.floatcolorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 3;
- rmesa->vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
- rmesa->vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
- rmesa->vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
-
- if (ind & RADEON_CP_VC_FRMT_FPALPHA) {
- rmesa->vb.vertex_size += 1;
- rmesa->vb.floatcolorptr[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
- }
- }
-
- if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
- rmesa->vb.specptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color;
- rmesa->vb.vertex_size += 1;
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] );
- UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] );
- }
-
- if (ind & RADEON_CP_VC_FRMT_ST0) {
- rmesa->vb.texcoordptr[0] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 2;
- rmesa->vb.texcoordptr[0][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][0];
- rmesa->vb.texcoordptr[0][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][1];
- }
-
- if (ind & RADEON_CP_VC_FRMT_ST1) {
- rmesa->vb.texcoordptr[1] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f;
- rmesa->vb.vertex_size += 2;
- rmesa->vb.texcoordptr[1][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][0];
- rmesa->vb.texcoordptr[1][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][1];
- }
-
- if (rmesa->vb.installed_vertex_format != rmesa->vb.vertex_format) {
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "reinstall on vertex_format change\n");
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
- rmesa->vb.installed_vertex_format = rmesa->vb.vertex_format;
- }
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s -- success\n", __FUNCTION__);
-
- return GL_TRUE;
-}
-
-void radeonVtxfmtInvalidate( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- rmesa->vb.recheck = GL_TRUE;
- rmesa->vb.fell_back = GL_FALSE;
-}
-
-
-static void radeonVtxfmtValidate( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (ctx->Driver.NeedFlush)
- ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
-
- rmesa->vb.recheck = GL_FALSE;
-
- if (check_vtx_fmt( ctx )) {
- if (!rmesa->vb.installed) {
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "reinstall (new install)\n");
-
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
- ctx->Driver.FlushVertices = radeonVtxfmtFlushVertices;
- rmesa->vb.installed = GL_TRUE;
- }
- else if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s: already installed", __FUNCTION__);
- }
- else {
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s: failed\n", __FUNCTION__);
-
- if (rmesa->vb.installed) {
- if (rmesa->dma.flush)
- rmesa->dma.flush( rmesa );
- _tnl_wakeup_exec( ctx );
- ctx->Driver.FlushVertices = radeonFlushVertices;
- rmesa->vb.installed = GL_FALSE;
- }
- }
-}
-
-
-
-/* Materials:
- */
-static void radeon_Materialfv( GLenum face, GLenum pname,
- const GLfloat *params )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->vb.prim[0] != GL_POLYGON+1) {
- VFMT_FALLBACK( __FUNCTION__ );
- CALL_Materialfv(GET_DISPATCH(), (face, pname, params));
- return;
- }
- _mesa_noop_Materialfv( face, pname, params );
- radeonUpdateMaterial( ctx );
-}
-
-
-/* Begin/End
- */
-static void radeon_Begin( GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s( %s )\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr( mode ));
-
- if (mode > GL_POLYGON) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
- }
-
- if (rmesa->vb.prim[0] != GL_POLYGON+1) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
- return;
- }
-
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- if (rmesa->NewGLState)
- radeonValidateState( ctx );
-
- if (rmesa->vb.recheck)
- radeonVtxfmtValidate( ctx );
-
- if (!rmesa->vb.installed) {
- CALL_Begin(GET_DISPATCH(), (mode));
- return;
- }
-
-
- if (rmesa->dma.flush && rmesa->vb.counter < 12) {
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__);
- flush_prims( rmesa );
- }
-
- /* Need to arrange to save vertices here? Or always copy from dma (yuk)?
- */
- if (!rmesa->dma.flush) {
- if (rmesa->dma.current.ptr + 12*rmesa->vb.vertex_size*4 >
- rmesa->dma.current.end) {
- RADEON_NEWPRIM( rmesa );
- radeonRefillCurrentDmaRegion( rmesa );
- }
-
- rmesa->vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr);
- rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
- (rmesa->vb.vertex_size * 4);
- rmesa->vb.counter--;
- rmesa->vb.initial_counter = rmesa->vb.counter;
- rmesa->vb.notify = wrap_buffer;
- rmesa->dma.flush = flush_prims;
- ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
- }
-
-
- rmesa->vb.prim[0] = mode;
- start_prim( rmesa, mode | PRIM_BEGIN );
-}
-
-
-
-static void radeon_End( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (rmesa->vb.prim[0] == GL_POLYGON+1) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
- return;
- }
-
- note_last_prim( rmesa, PRIM_END );
- rmesa->vb.prim[0] = GL_POLYGON+1;
-}
-
-
-/* Fallback on difficult entrypoints:
- */
-#define PRE_LOOPBACK( FUNC ) \
-do { \
- if (RADEON_DEBUG & DEBUG_VFMT) \
- fprintf(stderr, "%s\n", __FUNCTION__); \
- VFMT_FALLBACK( __FUNCTION__ ); \
-} while (0)
-#define TAG(x) radeon_fallback_##x
-#include "vtxfmt_tmp.h"
-
-
-
-static GLboolean radeonNotifyBegin( GLcontext *ctx, GLenum p )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(!rmesa->vb.installed);
-
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- if (rmesa->NewGLState)
- radeonValidateState( ctx );
-
- if (ctx->Driver.NeedFlush)
- ctx->Driver.FlushVertices( ctx, ctx->Driver.NeedFlush );
-
- if (rmesa->vb.recheck)
- radeonVtxfmtValidate( ctx );
-
- if (!rmesa->vb.installed) {
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s -- failed\n", __FUNCTION__);
- return GL_FALSE;
- }
-
- radeon_Begin( p );
- return GL_TRUE;
-}
-
-static void radeonVtxfmtFlushVertices( GLcontext *ctx, GLuint flags )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- assert(rmesa->vb.installed);
-
- if (flags & FLUSH_UPDATE_CURRENT) {
- radeon_copy_to_current( ctx );
- if (RADEON_DEBUG & DEBUG_VFMT)
- fprintf(stderr, "reinstall on update_current\n");
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt );
- ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
- }
-
- if (flags & FLUSH_STORED_VERTICES) {
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- assert (rmesa->dma.flush == 0 ||
- rmesa->dma.flush == flush_prims);
- if (rmesa->dma.flush == flush_prims)
- flush_prims( RADEON_CONTEXT( ctx ) );
- ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
- }
-}
-
-
-
-/* At this point, don't expect very many versions of each function to
- * be generated, so not concerned about freeing them?
- */
-
-
-void radeonVtxfmtInit( GLcontext *ctx, GLboolean useCodegen )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- GLvertexformat *vfmt = &(rmesa->vb.vtxfmt);
-
- MEMSET( vfmt, 0, sizeof(GLvertexformat) );
-
- /* Hook in chooser functions for codegen, etc:
- */
- radeonVtxfmtInitChoosers( vfmt );
-
- /* Handled fully in supported states, but no codegen:
- */
- vfmt->Materialfv = radeon_Materialfv;
- vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
- vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */
- vfmt->Begin = radeon_Begin;
- vfmt->End = radeon_End;
-
- /* Fallback for performance reasons: (Fix with cva/elt path here and
- * dmatmp2.h style primitive-merging)
- *
- * These should call NotifyBegin(), as should _tnl_EvalMesh, to allow
- * a driver-hook.
- */
- vfmt->DrawArrays = radeon_fallback_DrawArrays;
- vfmt->DrawElements = radeon_fallback_DrawElements;
- vfmt->DrawRangeElements = radeon_fallback_DrawRangeElements;
-
-
- /* Not active in supported states; just keep ctx->Current uptodate:
- */
- vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
- vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
- vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
- vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
- vfmt->Indexf = _mesa_noop_Indexf;
- vfmt->Indexfv = _mesa_noop_Indexfv;
-
-
- /* Active but unsupported -- fallback if we receive these:
- */
- vfmt->CallList = radeon_fallback_CallList;
- vfmt->CallLists = radeon_fallback_CallLists;
- vfmt->EvalCoord1f = radeon_fallback_EvalCoord1f;
- vfmt->EvalCoord1fv = radeon_fallback_EvalCoord1fv;
- vfmt->EvalCoord2f = radeon_fallback_EvalCoord2f;
- vfmt->EvalCoord2fv = radeon_fallback_EvalCoord2fv;
- vfmt->EvalMesh1 = radeon_fallback_EvalMesh1;
- vfmt->EvalMesh2 = radeon_fallback_EvalMesh2;
- vfmt->EvalPoint1 = radeon_fallback_EvalPoint1;
- vfmt->EvalPoint2 = radeon_fallback_EvalPoint2;
- vfmt->TexCoord3f = radeon_fallback_TexCoord3f;
- vfmt->TexCoord3fv = radeon_fallback_TexCoord3fv;
- vfmt->TexCoord4f = radeon_fallback_TexCoord4f;
- vfmt->TexCoord4fv = radeon_fallback_TexCoord4fv;
- vfmt->MultiTexCoord3fARB = radeon_fallback_MultiTexCoord3fARB;
- vfmt->MultiTexCoord3fvARB = radeon_fallback_MultiTexCoord3fvARB;
- vfmt->MultiTexCoord4fARB = radeon_fallback_MultiTexCoord4fARB;
- vfmt->MultiTexCoord4fvARB = radeon_fallback_MultiTexCoord4fvARB;
- vfmt->Vertex4f = radeon_fallback_Vertex4f;
- vfmt->Vertex4fv = radeon_fallback_Vertex4fv;
- vfmt->VertexAttrib1fNV = radeon_fallback_VertexAttrib1fNV;
- vfmt->VertexAttrib1fvNV = radeon_fallback_VertexAttrib1fvNV;
- vfmt->VertexAttrib2fNV = radeon_fallback_VertexAttrib2fNV;
- vfmt->VertexAttrib2fvNV = radeon_fallback_VertexAttrib2fvNV;
- vfmt->VertexAttrib3fNV = radeon_fallback_VertexAttrib3fNV;
- vfmt->VertexAttrib3fvNV = radeon_fallback_VertexAttrib3fvNV;
- vfmt->VertexAttrib4fNV = radeon_fallback_VertexAttrib4fNV;
- vfmt->VertexAttrib4fvNV = radeon_fallback_VertexAttrib4fvNV;
-
- (void)radeon_fallback_vtxfmt;
-
- TNL_CONTEXT(ctx)->Driver.NotifyBegin = radeonNotifyBegin;
-
- rmesa->vb.enabled = 1;
- rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive;
- rmesa->vb.primflags = 0;
-
- make_empty_list( &rmesa->vb.dfn_cache.Vertex2f );
- make_empty_list( &rmesa->vb.dfn_cache.Vertex2fv );
- make_empty_list( &rmesa->vb.dfn_cache.Vertex3f );
- make_empty_list( &rmesa->vb.dfn_cache.Vertex3fv );
- make_empty_list( &rmesa->vb.dfn_cache.Color4ub );
- make_empty_list( &rmesa->vb.dfn_cache.Color4ubv );
- make_empty_list( &rmesa->vb.dfn_cache.Color3ub );
- make_empty_list( &rmesa->vb.dfn_cache.Color3ubv );
- make_empty_list( &rmesa->vb.dfn_cache.Color4f );
- make_empty_list( &rmesa->vb.dfn_cache.Color4fv );
- make_empty_list( &rmesa->vb.dfn_cache.Color3f );
- make_empty_list( &rmesa->vb.dfn_cache.Color3fv );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
- make_empty_list( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
- make_empty_list( &rmesa->vb.dfn_cache.Normal3f );
- make_empty_list( &rmesa->vb.dfn_cache.Normal3fv );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord2f );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord2fv );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord1f );
- make_empty_list( &rmesa->vb.dfn_cache.TexCoord1fv );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
- make_empty_list( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
-
- radeonInitCodegen( &rmesa->vb.codegen, useCodegen );
-}
-
-static void free_funcs( struct dynfn *l )
-{
- struct dynfn *f, *tmp;
- foreach_s (f, tmp, l) {
- remove_from_list( f );
- _mesa_exec_free( f->code );
- _mesa_free( f );
- }
-}
-
-
-
-void radeonVtxfmtMakeCurrent( GLcontext *ctx )
-{
-}
-
-
-void radeonVtxfmtDestroy( GLcontext *ctx )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
-
- count_funcs( rmesa );
- free_funcs( &rmesa->vb.dfn_cache.Vertex2f );
- free_funcs( &rmesa->vb.dfn_cache.Vertex2fv );
- free_funcs( &rmesa->vb.dfn_cache.Vertex3f );
- free_funcs( &rmesa->vb.dfn_cache.Vertex3fv );
- free_funcs( &rmesa->vb.dfn_cache.Color4ub );
- free_funcs( &rmesa->vb.dfn_cache.Color4ubv );
- free_funcs( &rmesa->vb.dfn_cache.Color3ub );
- free_funcs( &rmesa->vb.dfn_cache.Color3ubv );
- free_funcs( &rmesa->vb.dfn_cache.Color4f );
- free_funcs( &rmesa->vb.dfn_cache.Color4fv );
- free_funcs( &rmesa->vb.dfn_cache.Color3f );
- free_funcs( &rmesa->vb.dfn_cache.Color3fv );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubEXT );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3ubvEXT );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fEXT );
- free_funcs( &rmesa->vb.dfn_cache.SecondaryColor3fvEXT );
- free_funcs( &rmesa->vb.dfn_cache.Normal3f );
- free_funcs( &rmesa->vb.dfn_cache.Normal3fv );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord2f );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord2fv );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord1f );
- free_funcs( &rmesa->vb.dfn_cache.TexCoord1fv );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fARB );
- free_funcs( &rmesa->vb.dfn_cache.MultiTexCoord1fvARB );
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.h
deleted file mode 100644
index a656e49e4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h,v 1.3 2002/12/21 17:02:16 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef __RADEON_VTXFMT_H__
-#define __RADEON_VTXFMT_H__
-
-#include "radeon_context.h"
-
-
-extern void radeonVtxfmtUpdate( GLcontext *ctx );
-extern void radeonVtxfmtInit( GLcontext *ctx, GLboolean useCodegen );
-extern void radeonVtxfmtInvalidate( GLcontext *ctx );
-extern void radeonVtxfmtDestroy( GLcontext *ctx );
-extern void radeonVtxfmtInitChoosers( GLvertexformat *vfmt );
-
-extern void radeonVtxfmtMakeCurrent( GLcontext *ctx );
-extern void radeonVtxfmtUnbindContext( GLcontext *ctx );
-
-extern void radeon_copy_to_current( GLcontext *ctx );
-
-#define DFN( FUNC, CACHE) \
-do { \
- char *start = (char *)&FUNC; \
- char *end = (char *)&FUNC##_end; \
- insert_at_head( &CACHE, dfn ); \
- dfn->key = key; \
- dfn->code = _mesa_exec_malloc( end - start ); \
- _mesa_memcpy(dfn->code, start, end - start); \
-} \
-while ( 0 )
-
-#define FIXUP( CODE, OFFSET, CHECKVAL, NEWVAL ) \
-do { \
- int *icode = (int *)(CODE+OFFSET); \
- assert (*icode == CHECKVAL); \
- *icode = (int)NEWVAL; \
-} while (0)
-
-
-/* Useful for figuring out the offsets:
- */
-#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \
-do { \
- while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \
- fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__, \
- __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL)); \
- *(int *)(CODE+OFFSET) = (int)(NEWVAL); \
- OFFSET += 4; \
-} while (0)
-
-/*
- */
-void radeonInitCodegen( struct dfn_generators *gen, GLboolean useCodegen );
-void radeonInitX86Codegen( struct dfn_generators *gen );
-void radeonInitSSECodegen( struct dfn_generators *gen );
-
-
-
-/* Defined in radeon_vtxfmt_x86.c
- */
-struct dynfn *radeon_makeX86Vertex2f( GLcontext *, int );
-struct dynfn *radeon_makeX86Vertex2fv( GLcontext *, int );
-struct dynfn *radeon_makeX86Vertex3f( GLcontext *, int );
-struct dynfn *radeon_makeX86Vertex3fv( GLcontext *, int );
-struct dynfn *radeon_makeX86Color4ub( GLcontext *, int );
-struct dynfn *radeon_makeX86Color4ubv( GLcontext *, int );
-struct dynfn *radeon_makeX86Color3ub( GLcontext *, int );
-struct dynfn *radeon_makeX86Color3ubv( GLcontext *, int );
-struct dynfn *radeon_makeX86Color4f( GLcontext *, int );
-struct dynfn *radeon_makeX86Color4fv( GLcontext *, int );
-struct dynfn *radeon_makeX86Color3f( GLcontext *, int );
-struct dynfn *radeon_makeX86Color3fv( GLcontext *, int );
-struct dynfn *radeon_makeX86SecondaryColor3ubEXT( GLcontext *, int );
-struct dynfn *radeon_makeX86SecondaryColor3ubvEXT( GLcontext *, int );
-struct dynfn *radeon_makeX86SecondaryColor3fEXT( GLcontext *, int );
-struct dynfn *radeon_makeX86SecondaryColor3fvEXT( GLcontext *, int );
-struct dynfn *radeon_makeX86Normal3f( GLcontext *, int );
-struct dynfn *radeon_makeX86Normal3fv( GLcontext *, int );
-struct dynfn *radeon_makeX86TexCoord2f( GLcontext *, int );
-struct dynfn *radeon_makeX86TexCoord2fv( GLcontext *, int );
-struct dynfn *radeon_makeX86TexCoord1f( GLcontext *, int );
-struct dynfn *radeon_makeX86TexCoord1fv( GLcontext *, int );
-struct dynfn *radeon_makeX86MultiTexCoord2fARB( GLcontext *, int );
-struct dynfn *radeon_makeX86MultiTexCoord2fvARB( GLcontext *, int );
-struct dynfn *radeon_makeX86MultiTexCoord1fARB( GLcontext *, int );
-struct dynfn *radeon_makeX86MultiTexCoord1fvARB( GLcontext *, int );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c
deleted file mode 100644
index 342b0b39c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c
+++ /dev/null
@@ -1,922 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c,v 1.2 2002/12/16 16:18:59 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2002 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "simple_list.h"
-#include "api_noop.h"
-#include "vtxfmt.h"
-
-#include "radeon_vtxfmt.h"
-
-#include "dispatch.h"
-
-/* Fallback versions of all the entrypoints for situations where
- * codegen isn't available. This is still a lot faster than the
- * vb/pipeline implementation in Mesa.
- */
-static void radeon_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&x;
- *rmesa->vb.dmaptr++ = *(int *)&y;
- *rmesa->vb.dmaptr++ = *(int *)&z;
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-static void radeon_Vertex3fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&v[0];
- *rmesa->vb.dmaptr++ = *(int *)&v[1];
- *rmesa->vb.dmaptr++ = *(int *)&v[2];
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-static void radeon_Vertex2f( GLfloat x, GLfloat y )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&x;
- *rmesa->vb.dmaptr++ = *(int *)&y;
- *rmesa->vb.dmaptr++ = 0;
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = *(int *)&rmesa->vb.vertex[i];
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-static void radeon_Vertex2fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- int i;
-
- *rmesa->vb.dmaptr++ = *(int *)&v[0];
- *rmesa->vb.dmaptr++ = *(int *)&v[1];
- *rmesa->vb.dmaptr++ = 0;
-
- for (i = 3; i < rmesa->vb.vertex_size; i++)
- *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i;
-
- if (--rmesa->vb.counter == 0)
- rmesa->vb.notify();
-}
-
-
-#if 0
-/* Color for ubyte (packed) color formats:
- */
-static void radeon_Color3ub_ub( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- dest->red = r;
- dest->green = g;
- dest->blue = b;
- dest->alpha = 0xff;
-}
-
-static void radeon_Color3ubv_ub( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- dest->red = v[0];
- dest->green = v[1];
- dest->blue = v[2];
- dest->alpha = 0xff;
-}
-
-static void radeon_Color4ub_ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- dest->red = r;
- dest->green = g;
- dest->blue = b;
- dest->alpha = a;
-}
-
-static void radeon_Color4ubv_ub( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- *(GLuint *)rmesa->vb.colorptr = LE32_TO_CPU(*(GLuint *)v);
-}
-#endif /* 0 */
-
-static void radeon_Color3f_ub( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
- dest->alpha = 255;
-}
-
-static void radeon_Color3fv_ub( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
- dest->alpha = 255;
-}
-
-static void radeon_Color4f_ub( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, a );
-}
-
-static void radeon_Color4fv_ub( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.colorptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->alpha, v[3] );
-}
-
-
-/* Color for float color+alpha formats:
- */
-#if 0
-static void radeon_Color3ub_4f( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- dest[3] = 1.0;
-}
-
-static void radeon_Color3ubv_4f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- dest[3] = 1.0;
-}
-
-static void radeon_Color4ub_4f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- dest[3] = UBYTE_TO_FLOAT(a);
-}
-
-static void radeon_Color4ubv_4f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- dest[3] = UBYTE_TO_FLOAT(v[3]);
-}
-#endif /* 0 */
-
-
-static void radeon_Color3f_4f( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- dest[3] = 1.0;
-}
-
-static void radeon_Color3fv_4f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- dest[3] = 1.0;
-}
-
-static void radeon_Color4f_4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- dest[3] = a;
-}
-
-static void radeon_Color4fv_4f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- dest[3] = v[3];
-}
-
-
-/* Color for float color formats:
- */
-#if 0
-static void radeon_Color3ub_3f( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
-}
-
-static void radeon_Color3ubv_3f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
-}
-
-static void radeon_Color4ub_3f( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(a);
-}
-
-static void radeon_Color4ubv_3f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(v[3]);
-}
-#endif /* 0 */
-
-
-static void radeon_Color3f_3f( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
-}
-
-static void radeon_Color3fv_3f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
-}
-
-static void radeon_Color4f_3f( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = a;
-}
-
-static void radeon_Color4fv_3f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatcolorptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = v[3];
-}
-
-
-/* Secondary Color:
- */
-#if 0
-static void radeon_SecondaryColor3ubEXT_ub( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.specptr;
- dest->red = r;
- dest->green = g;
- dest->blue = b;
- dest->alpha = 0xff;
-}
-
-static void radeon_SecondaryColor3ubvEXT_ub( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.specptr;
- dest->red = v[0];
- dest->green = v[1];
- dest->blue = v[2];
- dest->alpha = 0xff;
-}
-#endif /* 0 */
-
-static void radeon_SecondaryColor3fEXT_ub( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.specptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b );
- dest->alpha = 255;
-}
-
-static void radeon_SecondaryColor3fvEXT_ub( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- radeon_color_t *dest = rmesa->vb.specptr;
- UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] );
- dest->alpha = 255;
-}
-
-#if 0
-static void radeon_SecondaryColor3ubEXT_3f( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = UBYTE_TO_FLOAT(r);
- dest[1] = UBYTE_TO_FLOAT(g);
- dest[2] = UBYTE_TO_FLOAT(b);
- dest[3] = 1.0;
-}
-
-static void radeon_SecondaryColor3ubvEXT_3f( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = UBYTE_TO_FLOAT(v[0]);
- dest[1] = UBYTE_TO_FLOAT(v[1]);
- dest[2] = UBYTE_TO_FLOAT(v[2]);
- dest[3] = 1.0;
-}
-#endif /* 0 */
-
-static void radeon_SecondaryColor3fEXT_3f( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = r;
- dest[1] = g;
- dest[2] = b;
- dest[3] = 1.0;
-}
-
-static void radeon_SecondaryColor3fvEXT_3f( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.floatspecptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
- dest[3] = 1.0;
-}
-
-
-/* Normal
- */
-static void radeon_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.normalptr;
- dest[0] = n0;
- dest[1] = n1;
- dest[2] = n2;
-}
-
-static void radeon_Normal3fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.normalptr;
- dest[0] = v[0];
- dest[1] = v[1];
- dest[2] = v[2];
-}
-
-
-/* TexCoord
- */
-static void radeon_TexCoord1f( GLfloat s )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[0];
- dest[0] = s;
- dest[1] = 0;
-}
-
-static void radeon_TexCoord1fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[0];
- dest[0] = v[0];
- dest[1] = 0;
-}
-
-static void radeon_TexCoord2f( GLfloat s, GLfloat t )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[0];
- dest[0] = s;
- dest[1] = t;
-}
-
-static void radeon_TexCoord2fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[0];
- dest[0] = v[0];
- dest[1] = v[1];
-}
-
-
-/* MultiTexcoord
- *
- * Technically speaking, these functions should subtract GL_TEXTURE0 from
- * \c target before masking and using it. The value of GL_TEXTURE0 is 0x84C0,
- * which has the low-order 5 bits 0. For all possible valid values of
- * \c target. Subtracting GL_TEXTURE0 has the net effect of masking \c target
- * with 0x1F. Masking with 0x1F and then masking with 0x01 is redundant, so
- * the subtraction has been omitted.
- */
-
-static void radeon_MultiTexCoord1fARB( GLenum target, GLfloat s )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
- dest[0] = s;
- dest[1] = 0;
-}
-
-static void radeon_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
- dest[0] = v[0];
- dest[1] = 0;
-}
-
-static void radeon_MultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
- dest[0] = s;
- dest[1] = t;
-}
-
-static void radeon_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
- dest[0] = v[0];
- dest[1] = v[1];
-}
-
-static struct dynfn *lookup( struct dynfn *l, int key )
-{
- struct dynfn *f;
-
- foreach( f, l ) {
- if (f->key == key)
- return f;
- }
-
- return NULL;
-}
-
-/* Can't use the loopback template for this:
- */
-
-#define CHOOSE(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \
-static void choose_##FN ARGS1 \
-{ \
- GET_CURRENT_CONTEXT(ctx); \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \
- struct dynfn *dfn; \
- \
- dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
- if (dfn == 0) \
- dfn = rmesa->vb.codegen.FN( ctx, key ); \
- else if (RADEON_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
- \
- if (dfn) \
- SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
- else { \
- if (RADEON_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- SET_ ## FN (ctx->Exec, radeon_##FN); \
- } \
- \
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- CALL_ ## FN (ctx->Exec, ARGS2); \
-}
-
-
-
-/* For the _3f case, only allow one color function to be hooked in at
- * a time. Eventually, use a similar mechanism to allow selecting the
- * color component of the vertex format based on client behaviour.
- *
- * Note: Perform these actions even if there is a codegen or cached
- * codegen version of the chosen function.
- */
-#define CHOOSE_COLOR(FN, FNTYPE, NR, MASK, ACTIVE, ARGS1, ARGS2 ) \
-static void choose_##FN ARGS1 \
-{ \
- GET_CURRENT_CONTEXT(ctx); \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \
- struct dynfn *dfn; \
- \
- if (rmesa->vb.vertex_format & ACTIVE_PKCOLOR) { \
- SET_ ## FN (ctx->Exec, radeon_##FN##_ub); \
- } \
- else if ((rmesa->vb.vertex_format & \
- (ACTIVE_FPCOLOR|ACTIVE_FPALPHA)) == ACTIVE_FPCOLOR) { \
- \
- if (rmesa->vb.installed_color_3f_sz != NR) { \
- rmesa->vb.installed_color_3f_sz = NR; \
- if (NR == 3) ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = 1.0; \
- if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
- radeon_copy_to_current( ctx ); \
- _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
- CALL_ ## FN (ctx->Exec, ARGS2); \
- return; \
- } \
- } \
- \
- SET_ ## FN (ctx->Exec, radeon_##FN##_3f); \
- } \
- else { \
- SET_ ## FN (ctx->Exec, radeon_##FN##_4f); \
- } \
- \
- \
- dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
- if (!dfn) dfn = rmesa->vb.codegen.FN( ctx, key ); \
- \
- if (dfn) { \
- if (RADEON_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
- SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \
- } \
- else if (RADEON_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
- \
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- CALL_ ## FN (ctx->Exec, ARGS2); \
-}
-
-
-
-/* Right now there are both _ub and _3f versions of the secondary color
- * functions. Currently, we only set-up the hardware to use the _ub versions.
- * The _3f versions are needed for the cases where secondary color isn't used
- * in the vertex format, but it still needs to be stored in the context
- * state vector.
- */
-#define CHOOSE_SECONDARY_COLOR(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \
-static void choose_##FN ARGS1 \
-{ \
- GET_CURRENT_CONTEXT(ctx); \
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \
- struct dynfn *dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \
- \
- if (dfn == 0) \
- dfn = rmesa->vb.codegen.FN( ctx, key ); \
- else if (RADEON_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
- \
- if (dfn) \
- SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
- else { \
- if (RADEON_DEBUG & DEBUG_CODEGEN) \
- fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- SET_ ## FN (ctx->Exec, ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \
- ? radeon_##FN##_ub : radeon_##FN##_3f); \
- } \
- \
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- CALL_ ## FN (ctx->Exec, ARGS2); \
-}
-
-
-
-
-
-/* Shorthands
- */
-#define ACTIVE_XYZW (RADEON_CP_VC_FRMT_W0|RADEON_CP_VC_FRMT_Z)
-#define ACTIVE_NORM RADEON_CP_VC_FRMT_N0
-
-#define ACTIVE_PKCOLOR RADEON_CP_VC_FRMT_PKCOLOR
-#define ACTIVE_FPCOLOR RADEON_CP_VC_FRMT_FPCOLOR
-#define ACTIVE_FPALPHA RADEON_CP_VC_FRMT_FPALPHA
-#define ACTIVE_COLOR (ACTIVE_FPCOLOR|ACTIVE_PKCOLOR)
-
-#define ACTIVE_PKSPEC RADEON_CP_VC_FRMT_PKSPEC
-#define ACTIVE_FPSPEC RADEON_CP_VC_FRMT_FPSPEC
-#define ACTIVE_SPEC (ACTIVE_FPSPEC|ACTIVE_PKSPEC)
-
-#define ACTIVE_ST0 RADEON_CP_VC_FRMT_ST0
-#define ACTIVE_ST1 RADEON_CP_VC_FRMT_ST1
-#define ACTIVE_ST_ALL (RADEON_CP_VC_FRMT_ST1|RADEON_CP_VC_FRMT_ST0)
-
-/* Each codegen function should be able to be fully specified by a
- * subsetted version of rmesa->vb.vertex_format.
- */
-#define MASK_NORM (ACTIVE_XYZW)
-#define MASK_COLOR (MASK_NORM|ACTIVE_NORM)
-#define MASK_SPEC (MASK_COLOR|ACTIVE_COLOR)
-#define MASK_ST0 (MASK_SPEC|ACTIVE_SPEC)
-#define MASK_ST1 (MASK_ST0|ACTIVE_ST0)
-#define MASK_ST_ALL (MASK_ST1|ACTIVE_ST1)
-#define MASK_VERTEX (MASK_ST_ALL|ACTIVE_FPALPHA)
-
-
-typedef void (*p4f)( GLfloat, GLfloat, GLfloat, GLfloat );
-typedef void (*p3f)( GLfloat, GLfloat, GLfloat );
-typedef void (*p2f)( GLfloat, GLfloat );
-typedef void (*p1f)( GLfloat );
-typedef void (*pe2f)( GLenum, GLfloat, GLfloat );
-typedef void (*pe1f)( GLenum, GLfloat );
-typedef void (*p4ub)( GLubyte, GLubyte, GLubyte, GLubyte );
-typedef void (*p3ub)( GLubyte, GLubyte, GLubyte );
-typedef void (*pfv)( const GLfloat * );
-typedef void (*pefv)( GLenum, const GLfloat * );
-typedef void (*pubv)( const GLubyte * );
-
-
-CHOOSE(Normal3f, p3f, MASK_NORM, ACTIVE_NORM,
- (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
-CHOOSE(Normal3fv, pfv, MASK_NORM, ACTIVE_NORM,
- (const GLfloat *v), (v))
-
-#if 0
-CHOOSE_COLOR(Color4ub, p4ub, 4, MASK_COLOR, ACTIVE_COLOR,
- (GLubyte a,GLubyte b, GLubyte c, GLubyte d), (a,b,c,d))
-CHOOSE_COLOR(Color4ubv, pubv, 4, MASK_COLOR, ACTIVE_COLOR,
- (const GLubyte *v), (v))
-CHOOSE_COLOR(Color3ub, p3ub, 3, MASK_COLOR, ACTIVE_COLOR,
- (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
-CHOOSE_COLOR(Color3ubv, pubv, 3, MASK_COLOR, ACTIVE_COLOR,
- (const GLubyte *v), (v))
-#endif
-
-CHOOSE_COLOR(Color4f, p4f, 4, MASK_COLOR, ACTIVE_COLOR,
- (GLfloat a,GLfloat b, GLfloat c, GLfloat d), (a,b,c,d))
-CHOOSE_COLOR(Color4fv, pfv, 4, MASK_COLOR, ACTIVE_COLOR,
- (const GLfloat *v), (v))
-CHOOSE_COLOR(Color3f, p3f, 3, MASK_COLOR, ACTIVE_COLOR,
- (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
-CHOOSE_COLOR(Color3fv, pfv, 3, MASK_COLOR, ACTIVE_COLOR,
- (const GLfloat *v), (v))
-
-
-#if 0
-CHOOSE_SECONDARY_COLOR(SecondaryColor3ubEXT, p3ub, MASK_SPEC, ACTIVE_SPEC,
- (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3ubvEXT, pubv, MASK_SPEC, ACTIVE_SPEC,
- (const GLubyte *v), (v))
-#endif
-CHOOSE_SECONDARY_COLOR(SecondaryColor3fEXT, p3f, MASK_SPEC, ACTIVE_SPEC,
- (GLfloat a,GLfloat b, GLfloat c), (a,b,c))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3fvEXT, pfv, MASK_SPEC, ACTIVE_SPEC,
- (const GLfloat *v), (v))
-
-CHOOSE(TexCoord2f, p2f, MASK_ST0, ACTIVE_ST0,
- (GLfloat a,GLfloat b), (a,b))
-CHOOSE(TexCoord2fv, pfv, MASK_ST0, ACTIVE_ST0,
- (const GLfloat *v), (v))
-CHOOSE(TexCoord1f, p1f, MASK_ST0, ACTIVE_ST0,
- (GLfloat a), (a))
-CHOOSE(TexCoord1fv, pfv, MASK_ST0, ACTIVE_ST0,
- (const GLfloat *v), (v))
-
-CHOOSE(MultiTexCoord2fARB, pe2f, MASK_ST_ALL, ACTIVE_ST_ALL,
- (GLenum u,GLfloat a,GLfloat b), (u,a,b))
-CHOOSE(MultiTexCoord2fvARB, pefv, MASK_ST_ALL, ACTIVE_ST_ALL,
- (GLenum u,const GLfloat *v), (u,v))
-CHOOSE(MultiTexCoord1fARB, pe1f, MASK_ST_ALL, ACTIVE_ST_ALL,
- (GLenum u,GLfloat a), (u,a))
-CHOOSE(MultiTexCoord1fvARB, pefv, MASK_ST_ALL, ACTIVE_ST_ALL,
- (GLenum u,const GLfloat *v), (u,v))
-
-CHOOSE(Vertex3f, p3f, MASK_VERTEX, MASK_VERTEX,
- (GLfloat a,GLfloat b,GLfloat c), (a,b,c))
-CHOOSE(Vertex3fv, pfv, MASK_VERTEX, MASK_VERTEX,
- (const GLfloat *v), (v))
-CHOOSE(Vertex2f, p2f, MASK_VERTEX, MASK_VERTEX,
- (GLfloat a,GLfloat b), (a,b))
-CHOOSE(Vertex2fv, pfv, MASK_VERTEX, MASK_VERTEX,
- (const GLfloat *v), (v))
-
-
-
-
-
-void radeonVtxfmtInitChoosers( GLvertexformat *vfmt )
-{
- vfmt->Color3f = choose_Color3f;
- vfmt->Color3fv = choose_Color3fv;
- vfmt->Color4f = choose_Color4f;
- vfmt->Color4fv = choose_Color4fv;
- vfmt->SecondaryColor3fEXT = choose_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = choose_SecondaryColor3fvEXT;
- vfmt->MultiTexCoord1fARB = choose_MultiTexCoord1fARB;
- vfmt->MultiTexCoord1fvARB = choose_MultiTexCoord1fvARB;
- vfmt->MultiTexCoord2fARB = choose_MultiTexCoord2fARB;
- vfmt->MultiTexCoord2fvARB = choose_MultiTexCoord2fvARB;
- vfmt->Normal3f = choose_Normal3f;
- vfmt->Normal3fv = choose_Normal3fv;
- vfmt->TexCoord1f = choose_TexCoord1f;
- vfmt->TexCoord1fv = choose_TexCoord1fv;
- vfmt->TexCoord2f = choose_TexCoord2f;
- vfmt->TexCoord2fv = choose_TexCoord2fv;
- vfmt->Vertex2f = choose_Vertex2f;
- vfmt->Vertex2fv = choose_Vertex2fv;
- vfmt->Vertex3f = choose_Vertex3f;
- vfmt->Vertex3fv = choose_Vertex3fv;
-
-#if 0
- vfmt->Color3ub = choose_Color3ub;
- vfmt->Color3ubv = choose_Color3ubv;
- vfmt->Color4ub = choose_Color4ub;
- vfmt->Color4ubv = choose_Color4ubv;
- vfmt->SecondaryColor3ubEXT = choose_SecondaryColor3ubEXT;
- vfmt->SecondaryColor3ubvEXT = choose_SecondaryColor3ubvEXT;
-#endif
-}
-
-
-static struct dynfn *codegen_noop( GLcontext *ctx, int key )
-{
- (void) ctx; (void) key;
- return NULL;
-}
-
-void radeonInitCodegen( struct dfn_generators *gen, GLboolean useCodegen )
-{
- gen->Vertex3f = codegen_noop;
- gen->Vertex3fv = codegen_noop;
- gen->Color4ub = codegen_noop;
- gen->Color4ubv = codegen_noop;
- gen->Normal3f = codegen_noop;
- gen->Normal3fv = codegen_noop;
- gen->TexCoord2f = codegen_noop;
- gen->TexCoord2fv = codegen_noop;
- gen->MultiTexCoord2fARB = codegen_noop;
- gen->MultiTexCoord2fvARB = codegen_noop;
- gen->Vertex2f = codegen_noop;
- gen->Vertex2fv = codegen_noop;
- gen->Color3ub = codegen_noop;
- gen->Color3ubv = codegen_noop;
- gen->Color4f = codegen_noop;
- gen->Color4fv = codegen_noop;
- gen->Color3f = codegen_noop;
- gen->Color3fv = codegen_noop;
- gen->SecondaryColor3fEXT = codegen_noop;
- gen->SecondaryColor3fvEXT = codegen_noop;
- gen->SecondaryColor3ubEXT = codegen_noop;
- gen->SecondaryColor3ubvEXT = codegen_noop;
- gen->TexCoord1f = codegen_noop;
- gen->TexCoord1fv = codegen_noop;
- gen->MultiTexCoord1fARB = codegen_noop;
- gen->MultiTexCoord1fvARB = codegen_noop;
-
- if (useCodegen) {
-#if defined(USE_X86_ASM)
- radeonInitX86Codegen( gen );
-#endif
-
-#if defined(USE_SSE_ASM)
- radeonInitSSECodegen( gen );
-#endif
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c
deleted file mode 100644
index cb5d84011..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c,v 1.1 2002/10/30 12:51:58 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "radeon_vtxfmt.h"
-
-#if defined(USE_SSE_ASM)
-#include "x86/common_x86_asm.h"
-
-#define EXTERN( FUNC ) \
-extern const char *FUNC; \
-extern const char *FUNC##_end
-
-EXTERN( _sse_Attribute2fv );
-EXTERN( _sse_Attribute2f );
-EXTERN( _sse_Attribute3fv );
-EXTERN( _sse_Attribute3f );
-EXTERN( _sse_MultiTexCoord2fv );
-EXTERN( _sse_MultiTexCoord2f );
-EXTERN( _sse_MultiTexCoord2fv_2 );
-EXTERN( _sse_MultiTexCoord2f_2 );
-
-/* Build specialized versions of the immediate calls on the fly for
- * the current state.
- */
-
-static struct dynfn *radeon_makeSSEAttribute2fv( struct dynfn * cache, int key,
- const char * name, void * dest)
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _sse_Attribute2fv, (*cache) );
- FIXUP(dfn->code, 10, 0x0, (int)dest);
- return dfn;
-}
-
-static struct dynfn *radeon_makeSSEAttribute2f( struct dynfn * cache, int key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _sse_Attribute2f, (*cache) );
- FIXUP(dfn->code, 8, 0x0, (int)dest);
- return dfn;
-}
-
-static struct dynfn *radeon_makeSSEAttribute3fv( struct dynfn * cache, int key,
- const char * name, void * dest)
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _sse_Attribute3fv, (*cache) );
- FIXUP(dfn->code, 13, 0x0, (int)dest);
- FIXUP(dfn->code, 18, 0x8, 8+(int)dest);
- return dfn;
-}
-
-static struct dynfn *radeon_makeSSEAttribute3f( struct dynfn * cache, int key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _sse_Attribute3f, (*cache) );
- FIXUP(dfn->code, 12, 0x0, (int)dest);
- FIXUP(dfn->code, 17, 0x8, 8+(int)dest);
- return dfn;
-}
-
-static struct dynfn * radeon_makeSSENormal3fv( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-static struct dynfn *radeon_makeSSENormal3f( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Normal3f, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-static struct dynfn *radeon_makeSSEColor3fv( GLcontext *ctx, int key )
-{
- if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA))
- return NULL;
- else
- {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Color3fv, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-static struct dynfn *radeon_makeSSEColor3f( GLcontext *ctx, int key )
-{
- if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA))
- return NULL;
- else
- {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Color3f, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-static struct dynfn *radeon_makeSSETexCoord2fv( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeSSEAttribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-static struct dynfn *radeon_makeSSETexCoord2f( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeSSEAttribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-static struct dynfn *radeon_makeSSEMultiTexCoord2fv( GLcontext *ctx, int key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
-
- if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) ==
- (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) {
- DFN ( _sse_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 18, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- } else {
- DFN ( _sse_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-
-static struct dynfn *radeon_makeSSEMultiTexCoord2f( GLcontext *ctx, int key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
-
- if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) ==
- (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) {
- DFN ( _sse_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 16, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- } else {
- DFN ( _sse_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 15, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-
-void radeonInitSSECodegen( struct dfn_generators *gen )
-{
- if ( cpu_has_xmm ) {
- gen->Normal3fv = (void *) radeon_makeSSENormal3fv;
- gen->Normal3f = (void *) radeon_makeSSENormal3f;
- gen->Color3fv = (void *) radeon_makeSSEColor3fv;
- gen->Color3f = (void *) radeon_makeSSEColor3f;
- gen->TexCoord2fv = (void *) radeon_makeSSETexCoord2fv;
- gen->TexCoord2f = (void *) radeon_makeSSETexCoord2f;
- gen->MultiTexCoord2fvARB = (void *) radeon_makeSSEMultiTexCoord2fv;
- gen->MultiTexCoord2fARB = (void *) radeon_makeSSEMultiTexCoord2f;
- }
-}
-
-#else
-
-void radeonInitSSECodegen( struct dfn_generators *gen )
-{
- (void) gen;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c
deleted file mode 100644
index d1cf1979f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c,v 1.2 2002/12/21 17:02:16 dawes Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "radeon_vtxfmt.h"
-
-#if defined(USE_X86_ASM)
-
-#define EXTERN( FUNC ) \
-extern const char *FUNC; \
-extern const char *FUNC##_end
-
-EXTERN ( _x86_Attribute2fv );
-EXTERN ( _x86_Attribute2f );
-EXTERN ( _x86_Attribute3fv );
-EXTERN ( _x86_Attribute3f );
-EXTERN ( _x86_Vertex3fv_6 );
-EXTERN ( _x86_Vertex3fv_8 );
-EXTERN ( _x86_Vertex3fv );
-EXTERN ( _x86_Vertex3f_4 );
-EXTERN ( _x86_Vertex3f_6 );
-EXTERN ( _x86_Vertex3f );
-EXTERN ( _x86_Color4ubv_ub );
-EXTERN ( _x86_Color4ubv_4f );
-EXTERN ( _x86_Color4ub_ub );
-EXTERN ( _x86_MultiTexCoord2fv );
-EXTERN ( _x86_MultiTexCoord2fv_2 );
-EXTERN ( _x86_MultiTexCoord2f );
-EXTERN ( _x86_MultiTexCoord2f_2 );
-
-
-/* Build specialized versions of the immediate calls on the fly for
- * the current state. Generic x86 versions.
- */
-
-struct dynfn *radeon_makeX86Vertex3f( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, rmesa->vb.vertex_size );
-
- switch (rmesa->vb.vertex_size) {
- case 4: {
-
- DFN ( _x86_Vertex3f_4, rmesa->vb.dfn_cache.Vertex3f );
- FIXUP(dfn->code, 2, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 25, 0x0, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 36, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 46, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 51, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 60, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- case 6: {
-
- DFN ( _x86_Vertex3f_6, rmesa->vb.dfn_cache.Vertex3f );
- FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 28, 0x0, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 34, 0x0, (int)&rmesa->vb.vertex[4]);
- FIXUP(dfn->code, 40, 0x0, (int)&rmesa->vb.vertex[5]);
- FIXUP(dfn->code, 57, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 63, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 70, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 79, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- default: {
-
- DFN ( _x86_Vertex3f, rmesa->vb.dfn_cache.Vertex3f );
- FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 9, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 37, 0x0, rmesa->vb.vertex_size-3);
- FIXUP(dfn->code, 44, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 50, 0x0, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 56, 0x0, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- }
-
- return dfn;
-}
-
-
-
-struct dynfn *radeon_makeX86Vertex3fv( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, rmesa->vb.vertex_size );
-
- switch (rmesa->vb.vertex_size) {
- case 6: {
-
- DFN ( _x86_Vertex3fv_6, rmesa->vb.dfn_cache.Vertex3fv );
- FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]);
- FIXUP(dfn->code, 45, 0x00000024, (int)&rmesa->vb.vertex[5]);
- FIXUP(dfn->code, 56, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 61, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 67, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 76, 0x00000008, (int)&rmesa->vb.notify);
- break;
- }
-
-
- case 8: {
-
- DFN ( _x86_Vertex3fv_8, rmesa->vb.dfn_cache.Vertex3fv );
- FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]);
- FIXUP(dfn->code, 45, 0x0000001c, (int)&rmesa->vb.vertex[5]);
- FIXUP(dfn->code, 51, 0x00000020, (int)&rmesa->vb.vertex[6]);
- FIXUP(dfn->code, 63, 0x00000024, (int)&rmesa->vb.vertex[7]);
- FIXUP(dfn->code, 74, 0x00000000, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 79, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 85, 0x00000004, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 94, 0x00000008, (int)&rmesa->vb.notify);
- break;
- }
-
-
-
- default: {
-
- DFN ( _x86_Vertex3fv, rmesa->vb.dfn_cache.Vertex3fv );
- FIXUP(dfn->code, 8, 0x01010101, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 32, 0x00000006, rmesa->vb.vertex_size-3);
- FIXUP(dfn->code, 37, 0x00000058, (int)&rmesa->vb.vertex[3]);
- FIXUP(dfn->code, 45, 0x01010101, (int)&rmesa->vb.dmaptr);
- FIXUP(dfn->code, 50, 0x02020202, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 58, 0x02020202, (int)&rmesa->vb.counter);
- FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify);
- break;
- }
- }
-
- return dfn;
-}
-
-static struct dynfn *
-radeon_makeX86Attribute2fv( struct dynfn * cache, int key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _x86_Attribute2fv, (*cache) );
- FIXUP(dfn->code, 11, 0x0, (int)dest);
- FIXUP(dfn->code, 16, 0x4, 4+(int)dest);
-
- return dfn;
-}
-
-static struct dynfn *
-radeon_makeX86Attribute2f( struct dynfn * cache, int key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _x86_Attribute2f, (*cache) );
- FIXUP(dfn->code, 1, 0x0, (int)dest);
-
- return dfn;
-}
-
-
-static struct dynfn *
-radeon_makeX86Attribute3fv( struct dynfn * cache, int key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _x86_Attribute3fv, (*cache) );
- FIXUP(dfn->code, 14, 0x0, (int)dest);
- FIXUP(dfn->code, 20, 0x4, 4+(int)dest);
- FIXUP(dfn->code, 25, 0x8, 8+(int)dest);
-
- return dfn;
-}
-
-static struct dynfn *
-radeon_makeX86Attribute3f( struct dynfn * cache, int key,
- const char * name, void * dest )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", name, key );
-
- DFN ( _x86_Attribute3f, (*cache) );
- FIXUP(dfn->code, 14, 0x0, (int)dest);
- FIXUP(dfn->code, 20, 0x4, 4+(int)dest);
- FIXUP(dfn->code, 25, 0x8, 8+(int)dest);
-
- return dfn;
-}
-
-struct dynfn *radeon_makeX86Normal3fv( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-struct dynfn *radeon_makeX86Normal3f( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeX86Attribute3f( & rmesa->vb.dfn_cache.Normal3f, key,
- __FUNCTION__, rmesa->vb.normalptr );
-}
-
-struct dynfn *radeon_makeX86Color4ubv( GLcontext *ctx, int key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
-
- if (key & RADEON_CP_VC_FRMT_PKCOLOR) {
- DFN ( _x86_Color4ubv_ub, rmesa->vb.dfn_cache.Color4ubv);
- FIXUP(dfn->code, 5, 0x12345678, (int)rmesa->vb.colorptr);
- return dfn;
- }
- else {
-
- DFN ( _x86_Color4ubv_4f, rmesa->vb.dfn_cache.Color4ubv);
- FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab);
- FIXUP(dfn->code, 27, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr);
- FIXUP(dfn->code, 33, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+4);
- FIXUP(dfn->code, 55, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+8);
- FIXUP(dfn->code, 61, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+12);
- return dfn;
- }
-}
-
-struct dynfn *radeon_makeX86Color4ub( GLcontext *ctx, int key )
-{
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
-
- if (key & RADEON_CP_VC_FRMT_PKCOLOR) {
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- DFN ( _x86_Color4ub_ub, rmesa->vb.dfn_cache.Color4ub );
- FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.colorptr);
- FIXUP(dfn->code, 24, 0x0, (int)rmesa->vb.colorptr+1);
- FIXUP(dfn->code, 30, 0x0, (int)rmesa->vb.colorptr+2);
- FIXUP(dfn->code, 36, 0x0, (int)rmesa->vb.colorptr+3);
- return dfn;
- }
- else
- return NULL;
-}
-
-
-struct dynfn *radeon_makeX86Color3fv( GLcontext *ctx, int key )
-{
- if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA))
- return NULL;
- else
- {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Color3fv, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-struct dynfn *radeon_makeX86Color3f( GLcontext *ctx, int key )
-{
- if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA))
- return NULL;
- else
- {
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeX86Attribute3f( & rmesa->vb.dfn_cache.Color3f, key,
- __FUNCTION__, rmesa->vb.floatcolorptr );
- }
-}
-
-
-
-struct dynfn *radeon_makeX86TexCoord2fv( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeX86Attribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-struct dynfn *radeon_makeX86TexCoord2f( GLcontext *ctx, int key )
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- return radeon_makeX86Attribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key,
- __FUNCTION__, rmesa->vb.texcoordptr[0] );
-}
-
-struct dynfn *radeon_makeX86MultiTexCoord2fvARB( GLcontext *ctx, int key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
-
- if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) ==
- (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) {
- DFN ( _x86_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 21, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- FIXUP(dfn->code, 27, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4);
- } else {
- DFN ( _x86_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB );
- FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-
-struct dynfn *radeon_makeX86MultiTexCoord2fARB( GLcontext *ctx,
- int key )
-{
- struct dynfn *dfn = MALLOC_STRUCT( dynfn );
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- if (RADEON_DEBUG & DEBUG_CODEGEN)
- fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key );
-
- if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) ==
- (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) {
- DFN ( _x86_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 20, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]);
- FIXUP(dfn->code, 26, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4);
- }
- else {
- /* Note: this might get generated multiple times, even though the
- * actual emitted code is the same.
- */
- DFN ( _x86_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB );
- FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.texcoordptr);
- }
- return dfn;
-}
-
-
-void radeonInitX86Codegen( struct dfn_generators *gen )
-{
- gen->Vertex3f = radeon_makeX86Vertex3f;
- gen->Vertex3fv = radeon_makeX86Vertex3fv;
- gen->Color4ub = radeon_makeX86Color4ub; /* PKCOLOR only */
- gen->Color4ubv = radeon_makeX86Color4ubv; /* PKCOLOR only */
- gen->Normal3f = radeon_makeX86Normal3f;
- gen->Normal3fv = radeon_makeX86Normal3fv;
- gen->TexCoord2f = radeon_makeX86TexCoord2f;
- gen->TexCoord2fv = radeon_makeX86TexCoord2fv;
- gen->MultiTexCoord2fARB = radeon_makeX86MultiTexCoord2fARB;
- gen->MultiTexCoord2fvARB = radeon_makeX86MultiTexCoord2fvARB;
- gen->Color3f = radeon_makeX86Color3f;
- gen->Color3fv = radeon_makeX86Color3fv;
-
- /* Not done:
- */
-/* gen->Vertex2f = radeon_makeX86Vertex2f; */
-/* gen->Vertex2fv = radeon_makeX86Vertex2fv; */
-/* gen->Color3ub = radeon_makeX86Color3ub; */
-/* gen->Color3ubv = radeon_makeX86Color3ubv; */
-/* gen->Color4f = radeon_makeX86Color4f; */
-/* gen->Color4fv = radeon_makeX86Color4fv; */
-/* gen->TexCoord1f = radeon_makeX86TexCoord1f; */
-/* gen->TexCoord1fv = radeon_makeX86TexCoord1fv; */
-/* gen->MultiTexCoord1fARB = radeon_makeX86MultiTexCoord1fARB; */
-/* gen->MultiTexCoord1fvARB = radeon_makeX86MultiTexCoord1fvARB; */
-}
-
-
-#else
-
-void radeonInitX86Codegen( struct dfn_generators *gen )
-{
- (void) gen;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S
deleted file mode 100644
index 569d3b9b4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S
+++ /dev/null
@@ -1,494 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S,v 1.1 2002/10/30 12:51:58 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#define GLOBL( x ) \
-.globl x; \
-x:
-
-.data
-.align 4
-
-/*
- vertex 3f vertex size 4
-*/
-
-GLOBL ( _x86_Vertex3f_4 )
- movl (0), %ecx
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl %eax, (%ecx)
- movl %edx, 4(%ecx)
- movl 12(%esp), %eax
- movl (0), %edx
- movl %eax, 8(%ecx)
- movl %edx, 12(%ecx)
- movl (0), %eax
- addl $16, %ecx
- dec %eax
- movl %ecx, (0)
- movl %eax, (0)
- je .1
- ret
-.1: jmp *0
-
-GLOBL ( _x86_Vertex3f_4_end )
-
-/*
- vertex 3f vertex size 6
-*/
-GLOBL ( _x86_Vertex3f_6 )
- push %edi
- movl (0), %edi
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- movl 16(%esp), %ecx
- movl %eax, (%edi)
- movl %edx, 4(%edi)
- movl %ecx, 8(%edi)
- movl (0), %eax
- movl (0), %edx
- movl (0), %ecx
- movl %eax, 12(%edi)
- movl %edx, 16(%edi)
- movl %ecx, 20(%edi)
- addl $24, %edi
- movl (0), %eax
- movl %edi, (0)
- dec %eax
- pop %edi
- movl %eax, (0)
- je .2
- ret
-.2: jmp *0
-GLOBL ( _x86_Vertex3f_6_end )
-/*
- vertex 3f generic size
-*/
-GLOBL ( _x86_Vertex3f )
- push %edi
- push %esi
- movl $0, %esi
- movl (0), %edi
- movl 12(%esp), %eax
- movl 16(%esp), %edx
- movl 20(%esp), %ecx
- movl %eax, (%edi)
- movl %edx, 4(%edi)
- movl %ecx, 8(%edi)
- addl $12, %edi
- movl $0, %ecx
- repz
- movsl %ds:(%esi), %es:(%edi)
- movl (0), %eax
- movl %edi, (0)
- dec %eax
- movl %eax, (0)
- pop %esi
- pop %edi
- je .3
- ret
-.3: jmp *0
-
-GLOBL ( _x86_Vertex3f_end )
-
-/*
- Vertex 3fv vertex size 6
-*/
-GLOBL ( _x86_Vertex3fv_6 )
- movl (0), %eax
- movl 4(%esp), %ecx
- movl (%ecx), %edx
- movl %edx, (%eax)
- movl 4(%ecx), %edx
- movl 8(%ecx), %ecx
- movl %edx, 4(%eax)
- movl %ecx, 8(%eax)
- movl (28), %edx
- movl (32), %ecx
- movl %edx, 12(%eax)
- movl %ecx, 16(%eax)
- movl (36), %edx
- movl %edx, 20(%eax)
- addl $24, %eax
- movl %eax, 0
- movl 4, %eax
- dec %eax
- movl %eax, 4
- je .4
- ret
-.4: jmp *8
-
-GLOBL ( _x86_Vertex3fv_6_end )
-
-/*
- Vertex 3fv vertex size 8
-*/
-GLOBL ( _x86_Vertex3fv_8 )
- movl (0), %eax
- movl 4(%esp), %ecx
- movl (%ecx), %edx
- movl %edx ,(%eax)
- movl 4(%ecx) ,%edx
- movl 8(%ecx) ,%ecx
- movl %edx, 4(%eax)
- movl %ecx, 8(%eax)
- movl (28), %edx
- movl (32), %ecx
- movl %edx, 12(%eax)
- movl %ecx, 16(%eax)
- movl (28), %edx
- movl (32), %ecx
- movl %edx, 20(%eax)
- movl %ecx, 24(%eax)
- movl (36), %edx
- movl %edx, 28(%eax)
- addl $32, %eax
- movl %eax, (0)
- movl 4, %eax
- dec %eax
- movl %eax, (4)
- je .5
- ret
-.5: jmp *8
-
-GLOBL ( _x86_Vertex3fv_8_end )
-
-/*
- Vertex 3fv generic vertex size
-*/
-GLOBL ( _x86_Vertex3fv )
- movl 4(%esp), %edx
- push %edi
- push %esi
- movl (0x1010101), %edi
- movl (%edx), %eax
- movl 4(%edx), %ecx
- movl 8(%edx), %esi
- movl %eax, (%edi)
- movl %ecx, 4(%edi)
- movl %esi, 8(%edi)
- addl $12, %edi
- movl $6, %ecx
- movl $0x58, %esi
- repz
- movsl %ds:(%esi), %es:(%edi)
- movl %edi, (0x1010101)
- movl (0x2020202), %eax
- pop %esi
- pop %edi
- dec %eax
- movl %eax, (0x2020202)
- je .6
- ret
-.6: jmp *0
-GLOBL ( _x86_Vertex3fv_end )
-
-
-/**
- * Generic handler for 2 float format data. This can be used for
- * TexCoord2f and possibly other functions.
- */
-
-GLOBL ( _x86_Attribute2f )
- movl $0x0, %edx
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- movl %eax, (%edx)
- movl %ecx, 4(%edx)
- ret
-GLOBL ( _x86_Attribute2f_end )
-
-
-/**
- * Generic handler for 2 float vector format data. This can be used for
- * TexCoord2fv and possibly other functions.
- */
-
-GLOBL( _x86_Attribute2fv)
- movl 4(%esp), %eax /* load 'v' off stack */
- movl (%eax), %ecx /* load v[0] */
- movl 4(%eax), %eax /* load v[1] */
- movl %ecx, 0 /* store v[0] to current vertex */
- movl %eax, 4 /* store v[1] to current vertex */
- ret
-GLOBL ( _x86_Attribute2fv_end )
-
-
-/**
- * Generic handler for 3 float format data. This can be used for
- * Normal3f, Color3f (when the color target is also float), or
- * TexCoord3f.
- */
-
-GLOBL ( _x86_Attribute3f )
- movl 4(%esp), %ecx
- movl 8(%esp), %edx
- movl 12(%esp), %eax
- movl %ecx, 0
- movl %edx, 4
- movl %eax, 8
- ret
-GLOBL ( _x86_Attribute3f_end )
-
-/**
- * Generic handler for 3 float vector format data. This can be used for
- * Normal3f, Color3f (when the color target is also float), or
- * TexCoord3f.
- */
-
-GLOBL( _x86_Attribute3fv)
- movl 4(%esp), %eax /* load 'v' off stack */
- movl (%eax), %ecx /* load v[0] */
- movl 4(%eax), %edx /* load v[1] */
- movl 8(%eax), %eax /* load v[2] */
- movl %ecx, 0 /* store v[0] to current vertex */
- movl %edx, 4 /* store v[1] to current vertex */
- movl %eax, 8 /* store v[2] to current vertex */
- ret
-GLOBL ( _x86_Attribute3fv_end )
-
-
-/*
- Color 4ubv_ub
-*/
-GLOBL ( _x86_Color4ubv_ub )
- movl 4(%esp), %eax
- movl $0x12345678, %edx
- movl (%eax), %eax
- movl %eax, (%edx)
- ret
-GLOBL ( _x86_Color4ubv_ub_end )
-
-/*
- Color 4ubv 4f
-*/
-GLOBL ( _x86_Color4ubv_4f )
- push %ebx
- movl $0, %edx
- xor %eax, %eax
- xor %ecx, %ecx
- movl 8(%esp), %ebx
- movl (%ebx), %ebx
- mov %bl, %al
- mov %bh, %cl
- movl (%edx,%eax,4),%eax
- movl (%edx,%ecx,4),%ecx
- movl %eax, (0xdeadbeaf)
- movl %ecx, (0xdeadbeaf)
- xor %eax, %eax
- xor %ecx, %ecx
- shr $16, %ebx
- mov %bl, %al
- mov %bh, %cl
- movl (%edx,%eax,4), %eax
- movl (%edx,%ecx,4), %ecx
- movl %eax, (0xdeadbeaf)
- movl %ecx, (0xdeadbeaf)
- pop %ebx
- ret
-GLOBL ( _x86_Color4ubv_4f_end )
-
-/*
-
- Color4ub_ub
-*/
-GLOBL( _x86_Color4ub_ub )
- push %ebx
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- movl 16(%esp), %ecx
- movl 20(%esp), %ebx
- mov %al, (0)
- mov %dl, (0)
- mov %cl, (0)
- mov %bl, (0)
- pop %ebx
- ret
-GLOBL( _x86_Color4ub_ub_end )
-
-
-/*
- MultiTexCoord2fv st0/st1
-*/
-GLOBL( _x86_MultiTexCoord2fv )
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- and $1, %eax
- movl (%ecx), %edx
- shl $3, %eax
- movl 4(%ecx), %ecx
- movl %edx, 0xdeadbeef(%eax)
- movl %ecx, 0xdeadbeef(%eax)
- ret
-GLOBL( _x86_MultiTexCoord2fv_end )
-
-/*
- MultiTexCoord2fv
-*/
-
-GLOBL( _x86_MultiTexCoord2fv_2 )
- movl 4(%esp,1), %eax
- movl 8(%esp,1), %ecx
- and $0x1, %eax
- movl 0(,%eax,4), %edx
- movl (%ecx), %eax
- movl %eax, (%edx)
- movl 4(%ecx), %eax
- movl %eax, 4(%edx)
- ret
-GLOBL( _x86_MultiTexCoord2fv_2_end )
-
-/*
- MultiTexCoord2f st0/st1
-*/
-GLOBL( _x86_MultiTexCoord2f )
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl 12(%esp), %ecx
- and $1, %eax
- shl $3, %eax
- movl %edx, 0xdeadbeef(%eax)
- movl %ecx, 0xdeadbeef(%eax)
- ret
-GLOBL( _x86_MultiTexCoord2f_end )
-
-/*
- MultiTexCoord2f
-*/
-GLOBL( _x86_MultiTexCoord2f_2 )
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- movl 12(%esp,1), %ecx
- and $1,%eax
- movl 0(,%eax,4), %eax
- movl %edx, (%eax)
- movl %ecx, 4(%eax)
- ret
-GLOBL( _x86_MultiTexCoord2f_2_end )
-
-#if defined(USE_SSE_ASM)
-/**
- * This can be used as a template for either Color3fv (when the color
- * target is also a 3f) or Normal3fv.
- */
-
-GLOBL( _sse_Attribute3fv )
- movl 4(%esp), %eax
- movlps (%eax), %xmm0
- movl 8(%eax), %eax
- movlps %xmm0, 0
- movl %eax, 8
- ret
-GLOBL( _sse_Attribute3fv_end )
-
-/**
- * This can be used as a template for either Color3f (when the color
- * target is also a 3f) or Normal3f.
- */
-
-GLOBL( _sse_Attribute3f )
- movlps 4(%esp), %xmm0
- movl 12(%esp), %eax
- movlps %xmm0, 0
- movl %eax, 8
- ret
-GLOBL( _sse_Attribute3f_end )
-
-
-/**
- * Generic handler for 2 float vector format data. This can be used for
- * TexCoord2fv and possibly other functions.
- */
-
-GLOBL( _sse_Attribute2fv )
- movl 4(%esp), %eax
- movlps (%eax), %xmm0
- movlps %xmm0, 0
- ret
-GLOBL( _sse_Attribute2fv_end )
-
-
-/**
- * Generic handler for 2 float format data. This can be used for
- * TexCoord2f and possibly other functions.
- */
-
-GLOBL( _sse_Attribute2f )
- movlps 4(%esp), %xmm0
- movlps %xmm0, 0
- ret
-GLOBL( _sse_Attribute2f_end )
-
-/*
- MultiTexCoord2fv st0/st1
-*/
-GLOBL( _sse_MultiTexCoord2fv )
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- and $1, %eax
- movlps (%ecx), %xmm0
- movlps %xmm0, 0xdeadbeef(,%eax,8)
- ret
-GLOBL( _sse_MultiTexCoord2fv_end )
-
-/*
- MultiTexCoord2fv
-*/
-GLOBL( _sse_MultiTexCoord2fv_2 )
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- and $0x1, %eax
- movl 0(,%eax,4), %edx
- movlps (%ecx), %xmm0
- movlps %xmm0, (%edx)
- ret
-GLOBL( _sse_MultiTexCoord2fv_2_end )
-
-/*
- MultiTexCoord2f st0/st1
-*/
-GLOBL( _sse_MultiTexCoord2f )
- movl 4(%esp), %eax
- and $1, %eax
- movlps 8(%esp), %xmm0
- movlps %xmm0, 0xdeadbeef(,%eax,8)
- ret
-GLOBL( _sse_MultiTexCoord2f_end )
-
-/*
- MultiTexCoord2f
-*/
-GLOBL( _sse_MultiTexCoord2f_2 )
- movl 4(%esp), %eax
- movlps 8(%esp), %xmm0
- and $1,%eax
- movl 0(,%eax,4), %eax
- movlps %xmm0, (%eax)
- ret
-GLOBL( _sse_MultiTexCoord2f_2_end )
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon.h
deleted file mode 100644
index 21db825c9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * \file server/radeon.h
- * \brief Radeon 2D driver data structures.
- */
-
-/*
- * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, VA LINUX SYSTEMS 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.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.29 2002/10/12 01:38:07 martin Exp $ */
-
-#ifndef _RADEON_H_
-#define _RADEON_H_
-
-#include "xf86drm.h" /* drm_handle_t, etc */
-
-# define RADEON_AGP_1X_MODE 0x01
-# define RADEON_AGP_2X_MODE 0x02
-# define RADEON_AGP_4X_MODE 0x04
-# define RADEON_AGP_FW_MODE 0x10
-# define RADEON_AGP_MODE_MASK 0x17
-#define RADEON_CP_CSQ_CNTL 0x0740
-# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0)
-# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28)
-# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28)
-# define RADEON_CSQ_PRIBM_INDDIS (2 << 28)
-# define RADEON_CSQ_PRIPIO_INDBM (3 << 28)
-# define RADEON_CSQ_PRIBM_INDBM (4 << 28)
-# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28)
-
-
-#define PCI_CHIP_R200_BB 0x4242
-#define PCI_CHIP_RV250_Id 0x4964
-#define PCI_CHIP_RV250_Ie 0x4965
-#define PCI_CHIP_RV250_If 0x4966
-#define PCI_CHIP_RV250_Ig 0x4967
-#define PCI_CHIP_RADEON_LW 0x4C57
-#define PCI_CHIP_RADEON_LX 0x4C58
-#define PCI_CHIP_RADEON_LY 0x4C59
-#define PCI_CHIP_RADEON_LZ 0x4C5A
-#define PCI_CHIP_RV250_Ld 0x4C64
-#define PCI_CHIP_RV250_Le 0x4C65
-#define PCI_CHIP_RV250_Lf 0x4C66
-#define PCI_CHIP_RV250_Lg 0x4C67
-#define PCI_CHIP_R300_ND 0x4E44
-#define PCI_CHIP_R300_NE 0x4E45
-#define PCI_CHIP_R300_NF 0x4E46
-#define PCI_CHIP_R300_NG 0x4E47
-#define PCI_CHIP_RADEON_QD 0x5144
-#define PCI_CHIP_RADEON_QE 0x5145
-#define PCI_CHIP_RADEON_QF 0x5146
-#define PCI_CHIP_RADEON_QG 0x5147
-#define PCI_CHIP_R200_QL 0x514C
-#define PCI_CHIP_R200_QN 0x514E
-#define PCI_CHIP_R200_QO 0x514F
-#define PCI_CHIP_RV200_QW 0x5157
-#define PCI_CHIP_RV200_QX 0x5158
-#define PCI_CHIP_RADEON_QY 0x5159
-#define PCI_CHIP_RADEON_QZ 0x515A
-#define PCI_CHIP_R200_Ql 0x516C
-#define PCI_CHIP_RV280_Y_ 0x5960
-#define PCI_CHIP_RV280_Ya 0x5961
-#define PCI_CHIP_RV280_Yb 0x5962
-#define PCI_CHIP_RV280_Yc 0x5963
-
-/**
- * \brief Chip families.
- */
-typedef enum {
- CHIP_FAMILY_UNKNOW,
- CHIP_FAMILY_LEGACY,
- CHIP_FAMILY_R128,
- CHIP_FAMILY_M3,
- CHIP_FAMILY_RADEON,
- CHIP_FAMILY_VE,
- CHIP_FAMILY_M6,
- CHIP_FAMILY_RV200,
- CHIP_FAMILY_M7,
- CHIP_FAMILY_R200,
- CHIP_FAMILY_RV250,
- CHIP_FAMILY_M9,
- CHIP_FAMILY_RV280,
- CHIP_FAMILY_R300
-} RADEONChipFamily;
-
-
-typedef unsigned long memType;
-
-
-/**
- * \brief Radeon DDX driver private data.
- */
-typedef struct {
- int Chipset; /**< \brief Chipset number */
- RADEONChipFamily ChipFamily; /**< \brief Chip family */
-
- unsigned long LinearAddr; /**< \brief Frame buffer physical address */
-
-
- drmSize registerSize; /**< \brief MMIO register map size */
- drm_handle_t registerHandle; /**< \brief MMIO register map handle */
-
- int IsPCI; /* Current card is a PCI card */
-
- /**
- * \name AGP
- */
- /*@{*/
- drmSize gartSize; /**< \brief AGP map size */
- drm_handle_t gartMemHandle; /**< \brief AGP map handle */
- unsigned long gartOffset; /**< \brief AGP offset */
- int gartMode; /**< \brief AGP mode */
- int gartFastWrite;
- /*@}*/
-
- /**
- * \name CP ring buffer data
- */
- /*@{*/
- unsigned long ringStart; /**< \brief Offset into AGP space */
- drm_handle_t ringHandle; /**< \brief Handle from drmAddMap() */
- drmSize ringMapSize; /**< \brief Size of map */
- int ringSize; /**< \brief Size of ring (in MB) */
-
- unsigned long ringReadOffset; /**< \brief Read offset into AGP space */
- drm_handle_t ringReadPtrHandle;/**< \brief Handle from drmAddMap() */
- drmSize ringReadMapSize; /**< \brief Size of map */
- /*@}*/
-
- /**
- * \name CP vertex/indirect buffer data
- */
- /*@{*/
- unsigned long bufStart; /**< \brief Offset into AGP space */
- drm_handle_t bufHandle; /**< \brief Handle from drmAddMap() */
- drmSize bufMapSize; /**< \brief Size of map */
- int bufSize; /**< \brief Size of buffers (in MB) */
- int bufNumBufs; /**< \brief Number of buffers */
- /*@}*/
-
- /**
- * \name CP AGP Texture data
- */
- /*@{*/
- unsigned long gartTexStart; /**< \brief Offset into AGP space */
- drm_handle_t gartTexHandle; /**< \brief Handle from drmAddMap() */
- drmSize gartTexMapSize; /**< \brief Size of map */
- int gartTexSize; /**< \brief Size of AGP tex space (in MB) */
- int log2GARTTexGran;
- /*@}*/
-
- int drmMinor; /**< \brief DRM device minor number */
-
- int frontOffset; /**< \brief Front color buffer offset */
- int frontPitch; /**< \brief Front color buffer pitch */
- int backOffset; /**< \brief Back color buffer offset */
- int backPitch; /**< \brief Back color buffer pitch */
- int depthOffset; /**< \brief Depth buffer offset */
- int depthPitch; /**< \brief Depth buffer pitch */
- int textureOffset; /**< \brief Texture area offset */
- int textureSize; /**< \brief Texture area size */
- int log2TexGran; /**< \brief Texture granularity in base 2 log */
-
- unsigned int frontPitchOffset;
- unsigned int backPitchOffset;
- unsigned int depthPitchOffset;
-
- int colorTiling; /**< \brief Enable color tiling */
-
- int irq; /**< \brief IRQ number */
- int page_flip_enable; /**< \brief Page Flip enable */
- unsigned int gen_int_cntl;
- unsigned int crtc_offset_cntl;
-
-} RADEONInfoRec, *RADEONInfoPtr;
-
-
-#endif /* _RADEON_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.c
deleted file mode 100644
index 7f83d868c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.c
+++ /dev/null
@@ -1,1336 +0,0 @@
-/**
- * \file server/radeon_dri.c
- * \brief File to perform the device-specific initialization tasks typically
- * done in the X server.
- *
- * Here they are converted to run in the client (or perhaps a standalone
- * process), and to work with the frame buffer device rather than the X
- * server infrastructure.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include "driver.h"
-#include "drm.h"
-#include "memops.h"
-
-#include "radeon.h"
-#include "radeon_dri.h"
-#include "radeon_macros.h"
-#include "radeon_reg.h"
-#include "drm_sarea.h"
-
-static size_t radeon_drm_page_size;
-
-static int RadeonSetParam(const DRIDriverContext *ctx, int param, int value)
-{
- drm_radeon_setparam_t sp;
-
- memset(&sp, 0, sizeof(sp));
- sp.param = param;
- sp.value = value;
-
- if (drmCommandWrite(ctx->drmFD, DRM_RADEON_SETPARAM, &sp, sizeof(sp))) {
- return -1;
- }
-
- return 0;
-}
-
-/**
- * \brief Wait for free FIFO entries.
- *
- * \param ctx display handle.
- * \param entries number of free entries to wait.
- *
- * It polls the free entries from the chip until it reaches the requested value
- * or a timeout (3000 tries) occurs. Aborts the program if the FIFO times out.
- */
-static void RADEONWaitForFifo( const DRIDriverContext *ctx,
- int entries )
-{
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- int i;
-
- for (i = 0; i < 3000; i++) {
- int fifo_slots =
- INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK;
- if (fifo_slots >= entries) return;
- }
-
- /* There are recoveries possible, but I haven't seen them work
- * in practice:
- */
- fprintf(stderr, "FIFO timed out: %d entries, stat=0x%08x\n",
- INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK,
- INREG(RADEON_RBBM_STATUS));
- exit(1);
-}
-
-/**
- * \brief Read a PLL register.
- *
- * \param ctx display handle.
- * \param addr PLL register index.
- *
- * \return value of the PLL register.
- */
-static unsigned int RADEONINPLL( const DRIDriverContext *ctx, int addr)
-{
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- unsigned int data;
-
- OUTREG8(RADEON_CLOCK_CNTL_INDEX, addr & 0x3f);
- data = INREG(RADEON_CLOCK_CNTL_DATA);
-
- return data;
-}
-
-/**
- * \brief Reset graphics card to known state.
- *
- * \param ctx display handle.
- *
- * Resets the values of several Radeon registers.
- */
-static void RADEONEngineReset( const DRIDriverContext *ctx )
-{
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- unsigned int clock_cntl_index;
- unsigned int mclk_cntl;
- unsigned int rbbm_soft_reset;
- unsigned int host_path_cntl;
- int i;
-
- OUTREGP(RADEON_RB2D_DSTCACHE_CTLSTAT,
- RADEON_RB2D_DC_FLUSH_ALL,
- ~RADEON_RB2D_DC_FLUSH_ALL);
- for (i = 0; i < 512; i++) {
- if (!(INREG(RADEON_RB2D_DSTCACHE_CTLSTAT) & RADEON_RB2D_DC_BUSY))
- break;
- }
-
- clock_cntl_index = INREG(RADEON_CLOCK_CNTL_INDEX);
-
- mclk_cntl = INPLL(ctx, RADEON_MCLK_CNTL);
- OUTPLL(RADEON_MCLK_CNTL, (mclk_cntl |
- RADEON_FORCEON_MCLKA |
- RADEON_FORCEON_MCLKB |
- RADEON_FORCEON_YCLKA |
- RADEON_FORCEON_YCLKB |
- RADEON_FORCEON_MC |
- RADEON_FORCEON_AIC));
-
- /* Soft resetting HDP thru RBBM_SOFT_RESET register can cause some
- * unexpected behaviour on some machines. Here we use
- * RADEON_HOST_PATH_CNTL to reset it.
- */
- host_path_cntl = INREG(RADEON_HOST_PATH_CNTL);
- rbbm_soft_reset = INREG(RADEON_RBBM_SOFT_RESET);
-
- OUTREG(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset |
- RADEON_SOFT_RESET_CP |
- RADEON_SOFT_RESET_HI |
- RADEON_SOFT_RESET_SE |
- RADEON_SOFT_RESET_RE |
- RADEON_SOFT_RESET_PP |
- RADEON_SOFT_RESET_E2 |
- RADEON_SOFT_RESET_RB));
- INREG(RADEON_RBBM_SOFT_RESET);
- OUTREG(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset &
- (unsigned int) ~(RADEON_SOFT_RESET_CP |
- RADEON_SOFT_RESET_HI |
- RADEON_SOFT_RESET_SE |
- RADEON_SOFT_RESET_RE |
- RADEON_SOFT_RESET_PP |
- RADEON_SOFT_RESET_E2 |
- RADEON_SOFT_RESET_RB)));
- INREG(RADEON_RBBM_SOFT_RESET);
-
- OUTREG(RADEON_HOST_PATH_CNTL, host_path_cntl | RADEON_HDP_SOFT_RESET);
- INREG(RADEON_HOST_PATH_CNTL);
- OUTREG(RADEON_HOST_PATH_CNTL, host_path_cntl);
-
- OUTREG(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset);
-
- OUTREG(RADEON_CLOCK_CNTL_INDEX, clock_cntl_index);
- OUTPLL(RADEON_MCLK_CNTL, mclk_cntl);
-}
-
-/**
- * \brief Restore the drawing engine.
- *
- * \param ctx display handle
- *
- * Resets the graphics card and sets initial values for several registers of
- * the card's drawing engine.
- *
- * Turns on the radeon command processor engine (i.e., the ringbuffer).
- */
-static int RADEONEngineRestore( const DRIDriverContext *ctx )
-{
- RADEONInfoPtr info = ctx->driverPrivate;
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- int pitch64, datatype, dp_gui_master_cntl, err;
-
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- OUTREG(RADEON_RB3D_CNTL, 0);
- RADEONEngineReset( ctx );
-
- switch (ctx->bpp) {
- case 16: datatype = 4; break;
- case 32: datatype = 6; break;
- default: return 0;
- }
-
- dp_gui_master_cntl =
- ((datatype << RADEON_GMC_DST_DATATYPE_SHIFT)
- | RADEON_GMC_CLR_CMP_CNTL_DIS);
-
- pitch64 = ((ctx->shared.virtualWidth * (ctx->bpp / 8) + 0x3f)) >> 6;
-
- RADEONWaitForFifo(ctx, 1);
- OUTREG(RADEON_DEFAULT_OFFSET, ((INREG(RADEON_DEFAULT_OFFSET) & 0xC0000000)
- | (pitch64 << 22)));
-
- RADEONWaitForFifo(ctx, 1);
- OUTREG(RADEON_SURFACE_CNTL, RADEON_SURF_TRANSLATION_DIS);
-
- RADEONWaitForFifo(ctx, 1);
- OUTREG(RADEON_DEFAULT_SC_BOTTOM_RIGHT, (RADEON_DEFAULT_SC_RIGHT_MAX
- | RADEON_DEFAULT_SC_BOTTOM_MAX));
-
- RADEONWaitForFifo(ctx, 1);
- OUTREG(RADEON_DP_GUI_MASTER_CNTL, (dp_gui_master_cntl
- | RADEON_GMC_BRUSH_SOLID_COLOR
- | RADEON_GMC_SRC_DATATYPE_COLOR));
-
- RADEONWaitForFifo(ctx, 7);
- OUTREG(RADEON_DST_LINE_START, 0);
- OUTREG(RADEON_DST_LINE_END, 0);
- OUTREG(RADEON_DP_BRUSH_FRGD_CLR, 0xffffffff);
- OUTREG(RADEON_DP_BRUSH_BKGD_CLR, 0);
- OUTREG(RADEON_DP_SRC_FRGD_CLR, 0xffffffff);
- OUTREG(RADEON_DP_SRC_BKGD_CLR, 0);
- OUTREG(RADEON_DP_WRITE_MASK, 0xffffffff);
- OUTREG(RADEON_AUX_SC_CNTL, 0);
-
-/* RADEONWaitForIdleMMIO(ctx); */
- usleep(100);
-
-
- OUTREG(RADEON_GEN_INT_CNTL, info->gen_int_cntl);
- if (info->colorTiling)
- info->crtc_offset_cntl |= RADEON_CRTC_TILE_EN;
- OUTREG(RADEON_CRTC_OFFSET_CNTL, info->crtc_offset_cntl);
-
- /* Initialize and start the CP if required */
- if ((err = drmCommandNone(ctx->drmFD, DRM_RADEON_CP_START)) != 0) {
- fprintf(stderr, "%s: CP start %d\n", __FUNCTION__, err);
- return 0;
- }
-
- return 1;
-}
-
-
-/**
- * \brief Shutdown the drawing engine.
- *
- * \param ctx display handle
- *
- * Turns off the command processor engine & restores the graphics card
- * to a state that fbdev understands.
- */
-static int RADEONEngineShutdown( const DRIDriverContext *ctx )
-{
- drm_radeon_cp_stop_t stop;
- int ret, i;
-
- stop.flush = 1;
- stop.idle = 1;
-
- ret = drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_STOP, &stop,
- sizeof(drm_radeon_cp_stop_t));
-
- if (ret == 0) {
- return 0;
- } else if (errno != EBUSY) {
- return -errno;
- }
-
- stop.flush = 0;
-
- i = 0;
- do {
- ret = drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_STOP, &stop,
- sizeof(drm_radeon_cp_stop_t));
- } while (ret && errno == EBUSY && i++ < 10);
-
- if (ret == 0) {
- return 0;
- } else if (errno != EBUSY) {
- return -errno;
- }
-
- stop.idle = 0;
-
- if (drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_STOP,
- &stop, sizeof(drm_radeon_cp_stop_t))) {
- return -errno;
- } else {
- return 0;
- }
-}
-
-/**
- * \brief Compute base 2 logarithm.
- *
- * \param val value.
- *
- * \return base 2 logarithm of \p val.
- */
-static int RADEONMinBits(int val)
-{
- int bits;
-
- if (!val) return 1;
- for (bits = 0; val; val >>= 1, ++bits);
- return bits;
-}
-
-/**
- * \brief Initialize the AGP state
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return one on success, or zero on failure.
- *
- * Acquires and enables the AGP device. Reserves memory in the AGP space for
- * the ring buffer, vertex buffers and textures. Initialize the Radeon
- * registers to point to that memory and add client mappings.
- */
-static int RADEONDRIAgpInit( const DRIDriverContext *ctx, RADEONInfoPtr info)
-{
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- unsigned long mode;
- int ret;
- int s, l;
-
- if (drmAgpAcquire(ctx->drmFD) < 0) {
- fprintf(stderr, "[gart] AGP not available\n");
- return 0;
- }
-
- /* Modify the mode if the default mode is not appropriate for this
- * particular combination of graphics card and AGP chipset.
- */
- mode = drmAgpGetMode(ctx->drmFD); /* Default mode */
-
- /* Disable fast write entirely - too many lockups.
- */
- mode &= ~RADEON_AGP_MODE_MASK;
- switch (ctx->agpmode) {
- case 4: mode |= RADEON_AGP_4X_MODE;
- case 2: mode |= RADEON_AGP_2X_MODE;
- case 1: default: mode |= RADEON_AGP_1X_MODE;
- }
-
- if (drmAgpEnable(ctx->drmFD, mode) < 0) {
- fprintf(stderr, "[gart] AGP not enabled\n");
- drmAgpRelease(ctx->drmFD);
- return 0;
- }
- else
- fprintf(stderr, "[gart] AGP enabled at %dx\n", ctx->agpmode);
-
- /* Workaround for some hardware bugs */
- if (info->ChipFamily < CHIP_FAMILY_R200)
- OUTREG(RADEON_AGP_CNTL, INREG(RADEON_AGP_CNTL) | 0x000e0000);
-
- info->gartOffset = 0;
-
- if ((ret = drmAgpAlloc(ctx->drmFD, info->gartSize*1024*1024, 0, NULL,
- &info->gartMemHandle)) < 0) {
- fprintf(stderr, "[gart] Out of memory (%d)\n", ret);
- drmAgpRelease(ctx->drmFD);
- return 0;
- }
- fprintf(stderr,
- "[gart] %d kB allocated with handle 0x%08x\n",
- info->gartSize*1024, (unsigned)info->gartMemHandle);
-
- if (drmAgpBind(ctx->drmFD,
- info->gartMemHandle, info->gartOffset) < 0) {
- fprintf(stderr, "[gart] Could not bind\n");
- drmAgpFree(ctx->drmFD, info->gartMemHandle);
- drmAgpRelease(ctx->drmFD);
- return 0;
- }
-
- /* Initialize the CP ring buffer data */
- info->ringStart = info->gartOffset;
- info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size;
-
- info->ringReadOffset = info->ringStart + info->ringMapSize;
- info->ringReadMapSize = radeon_drm_page_size;
-
- /* Reserve space for vertex/indirect buffers */
- info->bufStart = info->ringReadOffset + info->ringReadMapSize;
- info->bufMapSize = info->bufSize*1024*1024;
-
- /* Reserve the rest for AGP textures */
- info->gartTexStart = info->bufStart + info->bufMapSize;
- s = (info->gartSize*1024*1024 - info->gartTexStart);
- l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS);
- if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY;
- info->gartTexMapSize = (s >> l) << l;
- info->log2GARTTexGran = l;
-
- if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize,
- DRM_AGP, DRM_READ_ONLY, &info->ringHandle) < 0) {
- fprintf(stderr, "[gart] Could not add ring mapping\n");
- return 0;
- }
- fprintf(stderr, "[gart] ring handle = 0x%08x\n", info->ringHandle);
-
-
- if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize,
- DRM_AGP, DRM_READ_ONLY, &info->ringReadPtrHandle) < 0) {
- fprintf(stderr,
- "[gart] Could not add ring read ptr mapping\n");
- return 0;
- }
-
- fprintf(stderr,
- "[gart] ring read ptr handle = 0x%08lx\n",
- info->ringReadPtrHandle);
-
- if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize,
- DRM_AGP, 0, &info->bufHandle) < 0) {
- fprintf(stderr,
- "[gart] Could not add vertex/indirect buffers mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[gart] vertex/indirect buffers handle = 0x%08x\n",
- info->bufHandle);
-
- if (drmAddMap(ctx->drmFD, info->gartTexStart, info->gartTexMapSize,
- DRM_AGP, 0, &info->gartTexHandle) < 0) {
- fprintf(stderr,
- "[gart] Could not add AGP texture map mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[gart] AGP texture map handle = 0x%08lx\n",
- info->gartTexHandle);
-
- /* Initialize Radeon's AGP registers */
- /* Ring buffer is at AGP offset 0 */
- OUTREG(RADEON_AGP_BASE, info->ringHandle);
-
- return 1;
-}
-
-/* Initialize the PCI GART state. Request memory for use in PCI space,
- * and initialize the Radeon registers to point to that memory.
- */
-static int RADEONDRIPciInit(const DRIDriverContext *ctx, RADEONInfoPtr info)
-{
- int ret;
- int flags = DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL;
- int s, l;
-
- ret = drmScatterGatherAlloc(ctx->drmFD, info->gartSize*1024*1024,
- &info->gartMemHandle);
- if (ret < 0) {
- fprintf(stderr, "[pci] Out of memory (%d)\n", ret);
- return 0;
- }
- fprintf(stderr,
- "[pci] %d kB allocated with handle 0x%08lx\n",
- info->gartSize*1024, info->gartMemHandle);
-
- info->gartOffset = 0;
-
- /* Initialize the CP ring buffer data */
- info->ringStart = info->gartOffset;
- info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size;
-
- info->ringReadOffset = info->ringStart + info->ringMapSize;
- info->ringReadMapSize = radeon_drm_page_size;
-
- /* Reserve space for vertex/indirect buffers */
- info->bufStart = info->ringReadOffset + info->ringReadMapSize;
- info->bufMapSize = info->bufSize*1024*1024;
-
- /* Reserve the rest for AGP textures */
- info->gartTexStart = info->bufStart + info->bufMapSize;
- s = (info->gartSize*1024*1024 - info->gartTexStart);
- l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS);
- if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY;
- info->gartTexMapSize = (s >> l) << l;
- info->log2GARTTexGran = l;
-
- if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize,
- DRM_SCATTER_GATHER, flags, &info->ringHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add ring mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] ring handle = 0x%08x\n", info->ringHandle);
-
- if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize,
- DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add ring read ptr mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] ring read ptr handle = 0x%08lx\n",
- info->ringReadPtrHandle);
-
- if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize,
- DRM_SCATTER_GATHER, 0, &info->bufHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add vertex/indirect buffers mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] vertex/indirect buffers handle = 0x%08lx\n",
- info->bufHandle);
-
- if (drmAddMap(ctx->drmFD, info->gartTexStart, info->gartTexMapSize,
- DRM_SCATTER_GATHER, 0, &info->gartTexHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add GART texture map mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] GART texture map handle = 0x%08x\n",
- info->gartTexHandle);
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the kernel data structures and enable the CP engine.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * This function is a wrapper around the DRM_RADEON_CP_INIT command, passing
- * all the parameters in a drm_radeon_init_t structure.
- */
-static int RADEONDRIKernelInit( const DRIDriverContext *ctx,
- RADEONInfoPtr info)
-{
- int cpp = ctx->bpp / 8;
- drm_radeon_init_t drmInfo;
- int ret;
-
- memset(&drmInfo, 0, sizeof(drm_radeon_init_t));
-
- if ( (info->ChipFamily == CHIP_FAMILY_R200) ||
- (info->ChipFamily == CHIP_FAMILY_RV250) ||
- (info->ChipFamily == CHIP_FAMILY_M9) ||
- (info->ChipFamily == CHIP_FAMILY_RV280) )
- drmInfo.func = RADEON_INIT_R200_CP;
- else
- drmInfo.func = RADEON_INIT_CP;
-
- /* This is the struct passed to the kernel module for its initialization */
- drmInfo.sarea_priv_offset = sizeof(drm_sarea_t);
- drmInfo.is_pci = ctx->isPCI;
- drmInfo.cp_mode = RADEON_DEFAULT_CP_BM_MODE;
- drmInfo.gart_size = info->gartSize*1024*1024;
- drmInfo.ring_size = info->ringSize*1024*1024;
- drmInfo.usec_timeout = 1000;
- drmInfo.fb_bpp = ctx->bpp;
- drmInfo.depth_bpp = ctx->bpp;
- drmInfo.front_offset = info->frontOffset;
- drmInfo.front_pitch = info->frontPitch * cpp;
- drmInfo.back_offset = info->backOffset;
- drmInfo.back_pitch = info->backPitch * cpp;
- drmInfo.depth_offset = info->depthOffset;
- drmInfo.depth_pitch = info->depthPitch * cpp;
- drmInfo.fb_offset = info->LinearAddr;
- drmInfo.mmio_offset = info->registerHandle;
- drmInfo.ring_offset = info->ringHandle;
- drmInfo.ring_rptr_offset = info->ringReadPtrHandle;
- drmInfo.buffers_offset = info->bufHandle;
- drmInfo.gart_textures_offset = info->gartTexHandle;
-
- ret = drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_INIT, &drmInfo,
- sizeof(drm_radeon_init_t));
-
- return ret >= 0;
-}
-
-
-/**
- * \brief Initialize the AGP heap.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * This function is a wrapper around the DRM_RADEON_INIT_HEAP command, passing
- * all the parameters in a drm_radeon_mem_init_heap structure.
- */
-static void RADEONDRIAgpHeapInit(const DRIDriverContext *ctx,
- RADEONInfoPtr info)
-{
- drm_radeon_mem_init_heap_t drmHeap;
-
- /* Start up the simple memory manager for gart space */
- drmHeap.region = RADEON_MEM_REGION_GART;
- drmHeap.start = 0;
- drmHeap.size = info->gartTexMapSize;
-
- if (drmCommandWrite(ctx->drmFD, DRM_RADEON_INIT_HEAP,
- &drmHeap, sizeof(drmHeap))) {
- fprintf(stderr,
- "[drm] Failed to initialized gart heap manager\n");
- } else {
- fprintf(stderr,
- "[drm] Initialized kernel gart heap manager, %d\n",
- info->gartTexMapSize);
- }
-}
-
-/**
- * \brief Add a map for the vertex buffers that will be accessed by any
- * DRI-based clients.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return one on success, or zero on failure.
- *
- * Calls drmAddBufs() with the previously allocated vertex buffers.
- */
-static int RADEONDRIBufInit( const DRIDriverContext *ctx, RADEONInfoPtr info )
-{
- /* Initialize vertex buffers */
- info->bufNumBufs = drmAddBufs(ctx->drmFD,
- info->bufMapSize / RADEON_BUFFER_SIZE,
- RADEON_BUFFER_SIZE,
- ctx->isPCI ? DRM_SG_BUFFER : DRM_AGP_BUFFER,
- info->bufStart);
-
- if (info->bufNumBufs <= 0) {
- fprintf(stderr,
- "[drm] Could not create vertex/indirect buffers list\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] Added %d %d byte vertex/indirect buffers\n",
- info->bufNumBufs, RADEON_BUFFER_SIZE);
-
- return 1;
-}
-
-/**
- * \brief Install an IRQ handler.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * Attempts to install an IRQ handler via drmCtlInstHandler(), falling back to
- * IRQ-free operation on failure.
- */
-static void RADEONDRIIrqInit(const DRIDriverContext *ctx,
- RADEONInfoPtr info)
-{
- if (!info->irq) {
- info->irq = drmGetInterruptFromBusID(ctx->drmFD,
- ctx->pciBus,
- ctx->pciDevice,
- ctx->pciFunc);
-
- if ((drmCtlInstHandler(ctx->drmFD, info->irq)) != 0) {
- fprintf(stderr,
- "[drm] failure adding irq handler, "
- "there is a device already using that irq\n"
- "[drm] falling back to irq-free operation\n");
- info->irq = 0;
- }
- }
-
- if (info->irq)
- fprintf(stderr,
- "[drm] dma control initialized, using IRQ %d\n",
- info->irq);
-}
-
-static int RADEONCheckDRMVersion( const DRIDriverContext *ctx,
- RADEONInfoPtr info )
-{
- drmVersionPtr version;
-
- version = drmGetVersion(ctx->drmFD);
- if (version) {
- int req_minor, req_patch;
-
- /* Need 1.8.x for proper cleanup-on-client-exit behaviour.
- */
- req_minor = 8;
- req_patch = 0;
-
- if (version->version_major != 1 ||
- version->version_minor < req_minor ||
- (version->version_minor == req_minor &&
- version->version_patchlevel < req_patch)) {
- /* Incompatible drm version */
- fprintf(stderr,
- "[dri] RADEONDRIScreenInit failed because of a version "
- "mismatch.\n"
- "[dri] radeon.o kernel module version is %d.%d.%d "
- "but version 1.%d.%d or newer is needed.\n"
- "[dri] Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel,
- req_minor,
- req_patch);
- drmFreeVersion(version);
- return 0;
- }
-
- info->drmMinor = version->version_minor;
- drmFreeVersion(version);
- }
-
- return 1;
-}
-
-static int RADEONMemoryInit( const DRIDriverContext *ctx, RADEONInfoPtr info )
-{
- int width_bytes = ctx->shared.virtualWidth * ctx->cpp;
- int cpp = ctx->cpp;
- int bufferSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN);
- int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes
- + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN);
- int l;
-
- info->frontOffset = 0;
- info->frontPitch = ctx->shared.virtualWidth;
-
- fprintf(stderr,
- "Using %d MB AGP aperture\n", info->gartSize);
- fprintf(stderr,
- "Using %d MB for the ring buffer\n", info->ringSize);
- fprintf(stderr,
- "Using %d MB for vertex/indirect buffers\n", info->bufSize);
- fprintf(stderr,
- "Using %d MB for AGP textures\n", info->gartTexSize);
-
- /* Front, back and depth buffers - everything else texture??
- */
- info->textureSize = ctx->shared.fbSize - 2 * bufferSize - depthSize;
-
- if (ctx->colorTiling==1)
- {
- info->textureSize = ctx->shared.fbSize - ((ctx->shared.fbSize - info->textureSize + width_bytes * 16 - 1) / (width_bytes * 16)) * (width_bytes*16);
- }
-
- if (info->textureSize < 0)
- return 0;
-
- l = RADEONMinBits((info->textureSize-1) / RADEON_NR_TEX_REGIONS);
- if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY;
-
- /* Round the texture size up to the nearest whole number of
- * texture regions. Again, be greedy about this, don't
- * round down.
- */
- info->log2TexGran = l;
- info->textureSize = (info->textureSize >> l) << l;
-
- /* Set a minimum usable local texture heap size. This will fit
- * two 256x256x32bpp textures.
- */
- if (info->textureSize < 512 * 1024) {
- info->textureOffset = 0;
- info->textureSize = 0;
- }
-
- /* Reserve space for textures */
- if (ctx->colorTiling==1)
- {
- info->textureOffset = ((ctx->shared.fbSize - info->textureSize) /
- (width_bytes * 16)) * (width_bytes*16);
- }
- else
- {
- info->textureOffset = ((ctx->shared.fbSize - info->textureSize +
- RADEON_BUFFER_ALIGN) &
- ~RADEON_BUFFER_ALIGN);
- }
- /* Reserve space for the shared depth
- * buffer.
- */
- info->depthOffset = ((info->textureOffset - depthSize +
- RADEON_BUFFER_ALIGN) &
- ~RADEON_BUFFER_ALIGN);
- info->depthPitch = ctx->shared.virtualWidth;
-
- info->backOffset = ((info->depthOffset - bufferSize +
- RADEON_BUFFER_ALIGN) &
- ~RADEON_BUFFER_ALIGN);
- info->backPitch = ctx->shared.virtualWidth;
-
-
- fprintf(stderr,
- "Will use back buffer at offset 0x%x\n",
- info->backOffset);
- fprintf(stderr,
- "Will use depth buffer at offset 0x%x\n",
- info->depthOffset);
- fprintf(stderr,
- "Will use %d kb for textures at offset 0x%x\n",
- info->textureSize/1024, info->textureOffset);
-
- info->frontPitchOffset = (((info->frontPitch * cpp / 64) << 22) |
- (info->frontOffset >> 10));
-
- info->backPitchOffset = (((info->backPitch * cpp / 64) << 22) |
- (info->backOffset >> 10));
-
- info->depthPitchOffset = (((info->depthPitch * cpp / 64) << 22) |
- (info->depthOffset >> 10));
-
- return 1;
-}
-
-static int RADEONColorTilingInit( const DRIDriverContext *ctx, RADEONInfoPtr info )
-{
- int width_bytes = ctx->shared.virtualWidth * ctx->cpp;
- int bufferSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes + RADEON_BUFFER_ALIGN)
- & ~RADEON_BUFFER_ALIGN);
- /* Setup color tiling */
- if (info->drmMinor<14)
- info->colorTiling=0;
-
- if (info->colorTiling)
- {
-
- int colorTilingFlag;
- drm_radeon_surface_alloc_t front,back;
-
- RadeonSetParam(ctx, RADEON_SETPARAM_SWITCH_TILING, info->colorTiling ? 1 : 0);
-
- /* Setup the surfaces */
- if (info->ChipFamily < CHIP_FAMILY_R200)
- colorTilingFlag=RADEON_SURF_TILE_COLOR_MACRO;
- else
- colorTilingFlag=R200_SURF_TILE_COLOR_MACRO;
-
- front.address = info->frontOffset;
- front.size = bufferSize;
- front.flags = (width_bytes) | colorTilingFlag;
- drmCommandWrite(ctx->drmFD, DRM_RADEON_SURF_ALLOC, &front,sizeof(front));
-
- back.address = info->backOffset;
- back.size = bufferSize;
- back.flags = (width_bytes) | colorTilingFlag;
- drmCommandWrite(ctx->drmFD, DRM_RADEON_SURF_ALLOC, &back,sizeof(back));
-
- }
- return 1;
-}
-
-
-
-/**
- * Called at the start of each server generation.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * Performs static frame buffer allocation. Opens the DRM device and add maps
- * to the SAREA, framebuffer and MMIO regions. Fills in \p info with more
- * information. Creates a \e server context to grab the lock for the
- * initialization ioctls and calls the other initilization functions in this
- * file. Starts the CP engine via the DRM_RADEON_CP_START command.
- *
- * Setups a RADEONDRIRec structure to be passed to radeon_dri.so for its
- * initialization.
- */
-static int RADEONScreenInit( DRIDriverContext *ctx, RADEONInfoPtr info )
-{
- RADEONDRIPtr pRADEONDRI;
- int err;
-
- usleep(100);
- /*assert(!ctx->IsClient);*/
-
- {
- int width_bytes = (ctx->shared.virtualWidth * ctx->cpp);
- int maxy = ctx->shared.fbSize / width_bytes;
-
-
- if (maxy <= ctx->shared.virtualHeight * 3) {
- fprintf(stderr,
- "Static buffer allocation failed -- "
- "need at least %d kB video memory (have %d kB)\n",
- (ctx->shared.virtualWidth * ctx->shared.virtualHeight *
- ctx->cpp * 3 + 1023) / 1024,
- ctx->shared.fbSize / 1024);
- return 0;
- }
- }
-
-
- if (info->ChipFamily >= CHIP_FAMILY_R300) {
- fprintf(stderr,
- "Direct rendering not yet supported on "
- "Radeon 9700 and newer cards\n");
- return 0;
- }
-
- radeon_drm_page_size = getpagesize();
-
- info->registerSize = ctx->MMIOSize;
- ctx->shared.SAREASize = SAREA_MAX;
-
- /* Note that drmOpen will try to load the kernel module, if needed. */
- ctx->drmFD = drmOpen("radeon", NULL );
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
-
- if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) {
- fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
- return 0;
- }
-
- if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap( ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
-#ifndef _EMBEDDED
- 0,
-#else
- DRM_READ_ONLY,
-#endif
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
-
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
-
-
- if (drmAddMap(ctx->drmFD,
- ctx->MMIOStart,
- ctx->MMIOSize,
- DRM_REGISTERS,
- DRM_READ_ONLY,
- &info->registerHandle) < 0) {
- fprintf(stderr, "[drm] drmAddMap mmio failed\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] register handle = 0x%08lx\n", info->registerHandle);
-
- /* Check the radeon DRM version */
- if (!RADEONCheckDRMVersion(ctx, info)) {
- return 0;
- }
-
- if (ctx->isPCI) {
- /* Initialize PCI */
- if (!RADEONDRIPciInit(ctx, info))
- return 0;
- }
- else {
- /* Initialize AGP */
- if (!RADEONDRIAgpInit(ctx, info))
- return 0;
- }
-
- /* Memory manager setup */
- if (!RADEONMemoryInit(ctx, info)) {
- return 0;
- }
-
- /* Create a 'server' context so we can grab the lock for
- * initialization ioctls.
- */
- if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return 0;
- }
-
- DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0);
-
- /* Initialize the kernel data structures */
- if (!RADEONDRIKernelInit(ctx, info)) {
- fprintf(stderr, "RADEONDRIKernelInit failed\n");
- DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);
- return 0;
- }
-
- /* Initialize the vertex buffers list */
- if (!RADEONDRIBufInit(ctx, info)) {
- fprintf(stderr, "RADEONDRIBufInit failed\n");
- DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);
- return 0;
- }
-
- RADEONColorTilingInit(ctx, info);
-
- /* Initialize IRQ */
- RADEONDRIIrqInit(ctx, info);
-
- /* Initialize kernel gart memory manager */
- RADEONDRIAgpHeapInit(ctx, info);
-
- fprintf(stderr,"color tiling %sabled\n", info->colorTiling?"en":"dis");
- fprintf(stderr,"page flipping %sabled\n", info->page_flip_enable?"en":"dis");
- /* Initialize the SAREA private data structure */
- {
- drm_radeon_sarea_t *pSAREAPriv;
- pSAREAPriv = (drm_radeon_sarea_t *)(((char*)ctx->pSAREA) +
- sizeof(drm_sarea_t));
- memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
- pSAREAPriv->pfState = info->page_flip_enable;
- }
-
-
- /* Quick hack to clear the front & back buffers. Could also use
- * the clear ioctl to do this, but would need to setup hw state
- * first.
- */
- drimemsetio((char *)ctx->FBAddress + info->frontOffset,
- 0,
- info->frontPitch * ctx->cpp * ctx->shared.virtualHeight );
-
- drimemsetio((char *)ctx->FBAddress + info->backOffset,
- 0,
- info->backPitch * ctx->cpp * ctx->shared.virtualHeight );
-
- /* This is the struct passed to radeon_dri.so for its initialization */
- ctx->driverClientMsg = malloc(sizeof(RADEONDRIRec));
- ctx->driverClientMsgSize = sizeof(RADEONDRIRec);
- pRADEONDRI = (RADEONDRIPtr)ctx->driverClientMsg;
- pRADEONDRI->deviceID = info->Chipset;
- pRADEONDRI->width = ctx->shared.virtualWidth;
- pRADEONDRI->height = ctx->shared.virtualHeight;
- pRADEONDRI->depth = ctx->bpp; /* XXX: depth */
- pRADEONDRI->bpp = ctx->bpp;
- pRADEONDRI->IsPCI = ctx->isPCI;
- pRADEONDRI->AGPMode = ctx->agpmode;
- pRADEONDRI->frontOffset = info->frontOffset;
- pRADEONDRI->frontPitch = info->frontPitch;
- pRADEONDRI->backOffset = info->backOffset;
- pRADEONDRI->backPitch = info->backPitch;
- pRADEONDRI->depthOffset = info->depthOffset;
- pRADEONDRI->depthPitch = info->depthPitch;
- pRADEONDRI->textureOffset = info->textureOffset;
- pRADEONDRI->textureSize = info->textureSize;
- pRADEONDRI->log2TexGran = info->log2TexGran;
- pRADEONDRI->registerHandle = info->registerHandle;
- pRADEONDRI->registerSize = info->registerSize;
- pRADEONDRI->statusHandle = info->ringReadPtrHandle;
- pRADEONDRI->statusSize = info->ringReadMapSize;
- pRADEONDRI->gartTexHandle = info->gartTexHandle;
- pRADEONDRI->gartTexMapSize = info->gartTexMapSize;
- pRADEONDRI->log2GARTTexGran = info->log2GARTTexGran;
- pRADEONDRI->gartTexOffset = info->gartTexStart;
- pRADEONDRI->sarea_priv_offset = sizeof(drm_sarea_t);
-
- /* Don't release the lock now - let the VT switch handler do it. */
-
- return 1;
-}
-
-
-/**
- * \brief Get Radeon chip family from chipset number.
- *
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * Called by radeonInitFBDev() to set RADEONInfoRec::ChipFamily
- * according to the value of RADEONInfoRec::Chipset. Fails if the
- * chipset is unrecognized or not appropriate for this driver (i.e., not
- * an r100 style radeon)
- */
-static int get_chipfamily_from_chipset( RADEONInfoPtr info )
-{
- switch (info->Chipset) {
- case PCI_CHIP_RADEON_LY:
- case PCI_CHIP_RADEON_LZ:
- info->ChipFamily = CHIP_FAMILY_M6;
- break;
-
- case PCI_CHIP_RADEON_QY:
- case PCI_CHIP_RADEON_QZ:
- info->ChipFamily = CHIP_FAMILY_VE;
- break;
-
- case PCI_CHIP_R200_QL:
- case PCI_CHIP_R200_QN:
- case PCI_CHIP_R200_QO:
- case PCI_CHIP_R200_Ql:
- case PCI_CHIP_R200_BB:
- info->ChipFamily = CHIP_FAMILY_R200;
- break;
-
- case PCI_CHIP_RV200_QW: /* RV200 desktop */
- case PCI_CHIP_RV200_QX:
- info->ChipFamily = CHIP_FAMILY_RV200;
- break;
-
- case PCI_CHIP_RADEON_LW:
- case PCI_CHIP_RADEON_LX:
- info->ChipFamily = CHIP_FAMILY_M7;
- break;
-
- case PCI_CHIP_RV250_Id:
- case PCI_CHIP_RV250_Ie:
- case PCI_CHIP_RV250_If:
- case PCI_CHIP_RV250_Ig:
- info->ChipFamily = CHIP_FAMILY_RV250;
- break;
-
- case PCI_CHIP_RV250_Ld:
- case PCI_CHIP_RV250_Le:
- case PCI_CHIP_RV250_Lf:
- case PCI_CHIP_RV250_Lg:
- info->ChipFamily = CHIP_FAMILY_M9;
- break;
-
- case PCI_CHIP_RV280_Y_:
- case PCI_CHIP_RV280_Ya:
- case PCI_CHIP_RV280_Yb:
- case PCI_CHIP_RV280_Yc:
- info->ChipFamily = CHIP_FAMILY_RV280;
- break;
-
- case PCI_CHIP_R300_ND:
- case PCI_CHIP_R300_NE:
- case PCI_CHIP_R300_NF:
- case PCI_CHIP_R300_NG:
- info->ChipFamily = CHIP_FAMILY_R300;
- break;
-
- default:
- /* Original Radeon/7200 */
- info->ChipFamily = CHIP_FAMILY_RADEON;
- }
-
- return 1;
-}
-
-
-/**
- * \brief Validate the fbdev mode.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Saves some registers and returns 1.
- *
- * \sa radeonValidateMode().
- */
-static int radeonValidateMode( const DRIDriverContext *ctx )
-{
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- RADEONInfoPtr info = ctx->driverPrivate;
-
- info->gen_int_cntl = INREG(RADEON_GEN_INT_CNTL);
- info->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL);
-
- if (info->colorTiling)
- info->crtc_offset_cntl |= RADEON_CRTC_TILE_EN;
- return 1;
-}
-
-
-/**
- * \brief Examine mode returned by fbdev.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Restores registers that fbdev has clobbered and returns 1.
- *
- * \sa radeonValidateMode().
- */
-static int radeonPostValidateMode( const DRIDriverContext *ctx )
-{
- unsigned char *RADEONMMIO = ctx->MMIOAddress;
- RADEONInfoPtr info = ctx->driverPrivate;
-
- RADEONColorTilingInit( ctx, info);
- OUTREG(RADEON_GEN_INT_CNTL, info->gen_int_cntl);
- if (info->colorTiling)
- info->crtc_offset_cntl |= RADEON_CRTC_TILE_EN;
- OUTREG(RADEON_CRTC_OFFSET_CNTL, info->crtc_offset_cntl);
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the framebuffer device mode
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Fills in \p info with some default values and some information from \p ctx
- * and then calls RADEONScreenInit() for the screen initialization.
- *
- * Before exiting clears the framebuffer memory accessing it directly.
- */
-static int radeonInitFBDev( DRIDriverContext *ctx )
-{
- RADEONInfoPtr info = calloc(1, sizeof(*info));
-
- {
- int dummy = ctx->shared.virtualWidth;
-
- if (ctx->colorTiling==1)
- {
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 255) & ~255; break;
- case 2: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 63) & ~63; break;
- }
- } else {
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break;
- }
- }
-
- ctx->shared.virtualWidth = dummy;
- }
-
- fprintf(stderr,"shared virtual width is %d\n", ctx->shared.virtualWidth);
- ctx->driverPrivate = (void *)info;
-
- info->gartFastWrite = RADEON_DEFAULT_AGP_FAST_WRITE;
- info->gartSize = RADEON_DEFAULT_AGP_SIZE;
- info->gartTexSize = RADEON_DEFAULT_AGP_TEX_SIZE;
- info->bufSize = RADEON_DEFAULT_BUFFER_SIZE;
- info->ringSize = RADEON_DEFAULT_RING_SIZE;
- info->page_flip_enable = RADEON_DEFAULT_PAGE_FLIP;
- info->colorTiling = ctx->colorTiling;
-
- info->Chipset = ctx->chipset;
-
- if (!get_chipfamily_from_chipset( info )) {
- fprintf(stderr, "Unknown or non-radeon chipset -- cannot continue\n");
- fprintf(stderr, "==> Verify PCI BusID is correct in miniglx.conf\n");
- return 0;
- }
-
- info->frontPitch = ctx->shared.virtualWidth;
- info->LinearAddr = ctx->FBStart & 0xfc000000;
-
-
- if (!RADEONScreenInit( ctx, info ))
- return 0;
-
-
- return 1;
-}
-
-
-/**
- * \brief The screen is being closed, so clean up any state and free any
- * resources used by the DRI.
- *
- * \param ctx display handle.
- *
- * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver
- * private data.
- */
-static void radeonHaltFBDev( DRIDriverContext *ctx )
-{
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = 0;
- }
-}
-
-
-extern void radeonNotifyFocus( int );
-
-/**
- * \brief Exported driver interface for Mini GLX.
- *
- * \sa DRIDriverRec.
- */
-const struct DRIDriverRec __driDriver = {
- radeonValidateMode,
- radeonPostValidateMode,
- radeonInitFBDev,
- radeonHaltFBDev,
- RADEONEngineShutdown,
- RADEONEngineRestore,
-#ifndef _EMBEDDED
- 0,
-#else
- radeonNotifyFocus,
-#endif
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.h
deleted file mode 100644
index ecd532333..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * \file server/radeon_dri.h
- * \brief Radeon server-side structures.
- *
- * \author Kevin E. Martin <martin@xfree86.org>
- * \author Rickard E. Faith <faith@valinux.com>
- */
-
-/*
- * Copyright 2000 ATI Technologies Inc., Markham, Ontario,
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, VA LINUX SYSTEMS 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.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h,v 1.3 2002/04/24 16:20:40 martin Exp $ */
-
-#ifndef _RADEON_DRI_
-#define _RADEON_DRI_
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "radeon_drm.h"
-
-/* DRI Driver defaults */
-#define RADEON_DEFAULT_CP_PIO_MODE RADEON_CSQ_PRIPIO_INDPIO
-#define RADEON_DEFAULT_CP_BM_MODE RADEON_CSQ_PRIBM_INDBM
-#define RADEON_DEFAULT_AGP_MODE 1
-#define RADEON_DEFAULT_AGP_FAST_WRITE 0
-#define RADEON_DEFAULT_AGP_SIZE 8 /* MB (must be 2^n and > 4MB) */
-#define RADEON_DEFAULT_RING_SIZE 1 /* MB (must be page aligned) */
-#define RADEON_DEFAULT_BUFFER_SIZE 2 /* MB (must be page aligned) */
-#define RADEON_DEFAULT_AGP_TEX_SIZE 1 /* MB (must be page aligned) */
-#define RADEON_DEFAULT_CP_TIMEOUT 10000 /* usecs */
-#define RADEON_DEFAULT_PAGE_FLIP 0 /* page flipping diabled */
-#define RADEON_BUFFER_ALIGN 0x00000fff
-
-/**
- * \brief Radeon DRI driver private data.
- */
-typedef struct {
- /**
- * \name DRI screen private data
- */
- /*@{*/
- int deviceID; /**< \brief PCI device ID */
- int width; /**< \brief width in pixels of display */
- int height; /**< \brief height in scanlines of display */
- int depth; /**< \brief depth of display (8, 15, 16, 24) */
- int bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
-
- int IsPCI; /**< \brief is current card a PCI card? */
- int AGPMode; /**< \brief AGP mode */
-
- int frontOffset; /**< \brief front buffer offset */
- int frontPitch; /**< \brief front buffer pitch */
- int backOffset; /**< \brief shared back buffer offset */
- int backPitch; /**< \brief shared back buffer pitch */
- int depthOffset; /**< \brief shared depth buffer offset */
- int depthPitch; /**< \brief shared depth buffer pitch */
- int textureOffset; /**< \brief start of texture data in frame buffer */
- int textureSize; /**< \brief size of texture date */
- int log2TexGran; /**< \brief log2 texture granularity */
- /*@}*/
-
- /**
- * \name MMIO register data
- */
- /*@{*/
- drm_handle_t registerHandle; /**< \brief MMIO register map size */
- drmSize registerSize; /**< \brief MMIO register map handle */
- /*@}*/
-
- /**
- * \name CP in-memory status information
- */
- /*@{*/
- drm_handle_t statusHandle; /**< \brief status map handle */
- drmSize statusSize; /**< \brief status map size */
- /*@}*/
-
- /**
- * \name CP AGP Texture data
- */
- /*@{*/
- drm_handle_t gartTexHandle; /**< \brief AGP texture area map handle */
- drmSize gartTexMapSize; /**< \brief AGP texture area map size */
- int log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
- int gartTexOffset; /**< \brief AGP texture area offset in AGP space */
- /*@}*/
-
- unsigned int sarea_priv_offset; /**< \brief offset of the private SAREA data*/
-} RADEONDRIRec, *RADEONDRIPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_egl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_egl.c
deleted file mode 100644
index 736fed5b5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_egl.c
+++ /dev/null
@@ -1,978 +0,0 @@
-/*
- * EGL driver for radeon_dri.so
- */
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-#include "eglconfig.h"
-#include "eglcontext.h"
-#include "egldisplay.h"
-#include "egldriver.h"
-#include "eglglobals.h"
-#include "eglmode.h"
-#include "eglscreen.h"
-#include "eglsurface.h"
-#include "egldri.h"
-
-#include "mtypes.h"
-#include "memops.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "radeon_drm.h"
-#include "radeon_dri.h"
-#include "radeon.h"
-
-static size_t radeon_drm_page_size;
-
-/**
- * radeon driver-specific driver class derived from _EGLDriver
- */
-typedef struct radeon_driver
-{
- _EGLDriver Base; /* base class/object */
- GLuint radeonStuff;
-} radeonDriver;
-
-static int RADEONCheckDRMVersion( driDisplay *disp,
- RADEONInfoPtr info )
-{
- drmVersionPtr version;
-
- version = drmGetVersion(disp->drmFD);
- if (version) {
- int req_minor, req_patch;
-
- /* Need 1.8.x for proper cleanup-on-client-exit behaviour.
- */
- req_minor = 8;
- req_patch = 0;
-
- if (version->version_major != 1 ||
- version->version_minor < req_minor ||
- (version->version_minor == req_minor &&
- version->version_patchlevel < req_patch)) {
- /* Incompatible drm version */
- fprintf(stderr,
- "[dri] RADEONDRIScreenInit failed because of a version "
- "mismatch.\n"
- "[dri] radeon.o kernel module version is %d.%d.%d "
- "but version 1.%d.%d or newer is needed.\n"
- "[dri] Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel,
- req_minor,
- req_patch);
- drmFreeVersion(version);
- return 0;
- }
-
- info->drmMinor = version->version_minor;
- drmFreeVersion(version);
- }
-
- return 1;
-}
-
-
-/**
- * \brief Compute base 2 logarithm.
- *
- * \param val value.
- *
- * \return base 2 logarithm of \p val.
- */
-static int RADEONMinBits(int val)
-{
- int bits;
-
- if (!val) return 1;
- for (bits = 0; val; val >>= 1, ++bits);
- return bits;
-}
-
-
-/* Initialize the PCI GART state. Request memory for use in PCI space,
- * and initialize the Radeon registers to point to that memory.
- */
-static int RADEONDRIPciInit(driDisplay *disp, RADEONInfoPtr info)
-{
- int ret;
- int flags = DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL;
- int s, l;
-
- ret = drmScatterGatherAlloc(disp->drmFD, info->gartSize*1024*1024,
- &info->gartMemHandle);
- if (ret < 0) {
- fprintf(stderr, "[pci] Out of memory (%d)\n", ret);
- return 0;
- }
- fprintf(stderr,
- "[pci] %d kB allocated with handle 0x%04lx\n",
- info->gartSize*1024, info->gartMemHandle);
-
- info->gartOffset = 0;
-
- /* Initialize the CP ring buffer data */
- info->ringStart = info->gartOffset;
- info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size;
-
- info->ringReadOffset = info->ringStart + info->ringMapSize;
- info->ringReadMapSize = radeon_drm_page_size;
-
- /* Reserve space for vertex/indirect buffers */
- info->bufStart = info->ringReadOffset + info->ringReadMapSize;
- info->bufMapSize = info->bufSize*1024*1024;
-
- /* Reserve the rest for AGP textures */
- info->gartTexStart = info->bufStart + info->bufMapSize;
- s = (info->gartSize*1024*1024 - info->gartTexStart);
- l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS);
- if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY;
- info->gartTexMapSize = (s >> l) << l;
- info->log2GARTTexGran = l;
-
- if (drmAddMap(disp->drmFD, info->ringStart, info->ringMapSize,
- DRM_SCATTER_GATHER, flags, &info->ringHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add ring mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] ring handle = 0x%08lx\n", info->ringHandle);
-
- if (drmAddMap(disp->drmFD, info->ringReadOffset, info->ringReadMapSize,
- DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add ring read ptr mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] ring read ptr handle = 0x%08lx\n",
- info->ringReadPtrHandle);
-
- if (drmAddMap(disp->drmFD, info->bufStart, info->bufMapSize,
- DRM_SCATTER_GATHER, 0, &info->bufHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add vertex/indirect buffers mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] vertex/indirect buffers handle = 0x%08lx\n",
- info->bufHandle);
-
- if (drmAddMap(disp->drmFD, info->gartTexStart, info->gartTexMapSize,
- DRM_SCATTER_GATHER, 0, &info->gartTexHandle) < 0) {
- fprintf(stderr,
- "[pci] Could not add GART texture map mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[pci] GART texture map handle = 0x%08lx\n",
- info->gartTexHandle);
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the AGP state
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return one on success, or zero on failure.
- *
- * Acquires and enables the AGP device. Reserves memory in the AGP space for
- * the ring buffer, vertex buffers and textures. Initialize the Radeon
- * registers to point to that memory and add client mappings.
- */
-static int RADEONDRIAgpInit( driDisplay *disp, RADEONInfoPtr info)
-{
- int mode, ret;
- int s, l;
- int agpmode = 1;
-
- if (drmAgpAcquire(disp->drmFD) < 0) {
- fprintf(stderr, "[gart] AGP not available\n");
- return 0;
- }
-
- mode = drmAgpGetMode(disp->drmFD); /* Default mode */
- /* Disable fast write entirely - too many lockups.
- */
- mode &= ~RADEON_AGP_MODE_MASK;
- switch (agpmode) {
- case 4: mode |= RADEON_AGP_4X_MODE;
- case 2: mode |= RADEON_AGP_2X_MODE;
- case 1: default: mode |= RADEON_AGP_1X_MODE;
- }
-
- if (drmAgpEnable(disp->drmFD, mode) < 0) {
- fprintf(stderr, "[gart] AGP not enabled\n");
- drmAgpRelease(disp->drmFD);
- return 0;
- }
-
-#if 0
- /* Workaround for some hardware bugs */
- if (info->ChipFamily < CHIP_FAMILY_R200)
- OUTREG(RADEON_AGP_CNTL, INREG(RADEON_AGP_CNTL) | 0x000e0000);
-#endif
- info->gartOffset = 0;
-
- if ((ret = drmAgpAlloc(disp->drmFD, info->gartSize*1024*1024, 0, NULL,
- &info->gartMemHandle)) < 0) {
- fprintf(stderr, "[gart] Out of memory (%d)\n", ret);
- drmAgpRelease(disp->drmFD);
- return 0;
- }
- fprintf(stderr,
- "[gart] %d kB allocated with handle 0x%08x\n",
- info->gartSize*1024, (unsigned)info->gartMemHandle);
-
- if (drmAgpBind(disp->drmFD,
- info->gartMemHandle, info->gartOffset) < 0) {
- fprintf(stderr, "[gart] Could not bind\n");
- drmAgpFree(disp->drmFD, info->gartMemHandle);
- drmAgpRelease(disp->drmFD);
- return 0;
- }
-
- /* Initialize the CP ring buffer data */
- info->ringStart = info->gartOffset;
- info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size;
-
- info->ringReadOffset = info->ringStart + info->ringMapSize;
- info->ringReadMapSize = radeon_drm_page_size;
-
- /* Reserve space for vertex/indirect buffers */
- info->bufStart = info->ringReadOffset + info->ringReadMapSize;
- info->bufMapSize = info->bufSize*1024*1024;
-
- /* Reserve the rest for AGP textures */
- info->gartTexStart = info->bufStart + info->bufMapSize;
- s = (info->gartSize*1024*1024 - info->gartTexStart);
- l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS);
- if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY;
- info->gartTexMapSize = (s >> l) << l;
- info->log2GARTTexGran = l;
-
- if (drmAddMap(disp->drmFD, info->ringStart, info->ringMapSize,
- DRM_AGP, DRM_READ_ONLY, &info->ringHandle) < 0) {
- fprintf(stderr, "[gart] Could not add ring mapping\n");
- return 0;
- }
- fprintf(stderr, "[gart] ring handle = 0x%08lx\n", info->ringHandle);
-
-
- if (drmAddMap(disp->drmFD, info->ringReadOffset, info->ringReadMapSize,
- DRM_AGP, DRM_READ_ONLY, &info->ringReadPtrHandle) < 0) {
- fprintf(stderr,
- "[gart] Could not add ring read ptr mapping\n");
- return 0;
- }
-
- fprintf(stderr,
- "[gart] ring read ptr handle = 0x%08lx\n",
- info->ringReadPtrHandle);
-
- if (drmAddMap(disp->drmFD, info->bufStart, info->bufMapSize,
- DRM_AGP, 0, &info->bufHandle) < 0) {
- fprintf(stderr,
- "[gart] Could not add vertex/indirect buffers mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[gart] vertex/indirect buffers handle = 0x%08lx\n",
- info->bufHandle);
-
- if (drmAddMap(disp->drmFD, info->gartTexStart, info->gartTexMapSize,
- DRM_AGP, 0, &info->gartTexHandle) < 0) {
- fprintf(stderr,
- "[gart] Could not add AGP texture map mapping\n");
- return 0;
- }
- fprintf(stderr,
- "[gart] AGP texture map handle = 0x%08lx\n",
- info->gartTexHandle);
-
- return 1;
-}
-
-
-static int RADEONMemoryInit( driDisplay *disp, RADEONInfoPtr info )
-{
- int width_bytes = disp->virtualWidth * disp->cpp;
- int cpp = disp->cpp;
- int bufferSize = ((disp->virtualHeight * width_bytes
- + RADEON_BUFFER_ALIGN)
- & ~RADEON_BUFFER_ALIGN);
- int depthSize = ((((disp->virtualHeight+15) & ~15) * width_bytes
- + RADEON_BUFFER_ALIGN)
- & ~RADEON_BUFFER_ALIGN);
- int l;
-
- info->frontOffset = 0;
- info->frontPitch = disp->virtualWidth;
-
- fprintf(stderr,
- "Using %d MB AGP aperture\n", info->gartSize);
- fprintf(stderr,
- "Using %d MB for the ring buffer\n", info->ringSize);
- fprintf(stderr,
- "Using %d MB for vertex/indirect buffers\n", info->bufSize);
- fprintf(stderr,
- "Using %d MB for AGP textures\n", info->gartTexSize);
-
- /* Front, back and depth buffers - everything else texture??
- */
- info->textureSize = disp->fbSize - 2 * bufferSize - depthSize;
-
- if (info->textureSize < 0)
- return 0;
-
- l = RADEONMinBits((info->textureSize-1) / RADEON_NR_TEX_REGIONS);
- if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY;
-
- /* Round the texture size up to the nearest whole number of
- * texture regions. Again, be greedy about this, don't
- * round down.
- */
- info->log2TexGran = l;
- info->textureSize = (info->textureSize >> l) << l;
-
- /* Set a minimum usable local texture heap size. This will fit
- * two 256x256x32bpp textures.
- */
- if (info->textureSize < 512 * 1024) {
- info->textureOffset = 0;
- info->textureSize = 0;
- }
-
- /* Reserve space for textures */
- info->textureOffset = ((disp->fbSize - info->textureSize +
- RADEON_BUFFER_ALIGN) &
- ~RADEON_BUFFER_ALIGN);
-
- /* Reserve space for the shared depth
- * buffer.
- */
- info->depthOffset = ((info->textureOffset - depthSize +
- RADEON_BUFFER_ALIGN) &
- ~RADEON_BUFFER_ALIGN);
- info->depthPitch = disp->virtualWidth;
-
- info->backOffset = ((info->depthOffset - bufferSize +
- RADEON_BUFFER_ALIGN) &
- ~RADEON_BUFFER_ALIGN);
- info->backPitch = disp->virtualWidth;
-
-
- fprintf(stderr,
- "Will use back buffer at offset 0x%x\n",
- info->backOffset);
- fprintf(stderr,
- "Will use depth buffer at offset 0x%x\n",
- info->depthOffset);
- fprintf(stderr,
- "Will use %d kb for textures at offset 0x%x\n",
- info->textureSize/1024, info->textureOffset);
-
- info->frontPitchOffset = (((info->frontPitch * cpp / 64) << 22) |
- (info->frontOffset >> 10));
-
- info->backPitchOffset = (((info->backPitch * cpp / 64) << 22) |
- (info->backOffset >> 10));
-
- info->depthPitchOffset = (((info->depthPitch * cpp / 64) << 22) |
- (info->depthOffset >> 10));
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the kernel data structures and enable the CP engine.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * This function is a wrapper around the DRM_RADEON_CP_INIT command, passing
- * all the parameters in a drm_radeon_init_t structure.
- */
-static int RADEONDRIKernelInit( driDisplay *disp,
- RADEONInfoPtr info)
-{
- int cpp = disp->bpp / 8;
- drm_radeon_init_t drmInfo;
- int ret;
-
- memset(&drmInfo, 0, sizeof(drmInfo));
-
- if ( (info->ChipFamily == CHIP_FAMILY_R200) ||
- (info->ChipFamily == CHIP_FAMILY_RV250) ||
- (info->ChipFamily == CHIP_FAMILY_M9) ||
- (info->ChipFamily == CHIP_FAMILY_RV280) )
- drmInfo.func = RADEON_INIT_R200_CP;
- else
- drmInfo.func = RADEON_INIT_CP;
-
- /* This is the struct passed to the kernel module for its initialization */
- drmInfo.sarea_priv_offset = sizeof(drm_sarea_t);
- drmInfo.cp_mode = RADEON_DEFAULT_CP_BM_MODE;
- drmInfo.gart_size = info->gartSize*1024*1024;
- drmInfo.ring_size = info->ringSize*1024*1024;
- drmInfo.usec_timeout = 1000;
- drmInfo.fb_bpp = disp->bpp;
- drmInfo.depth_bpp = disp->bpp;
- drmInfo.front_offset = info->frontOffset;
- drmInfo.front_pitch = info->frontPitch * cpp;
- drmInfo.back_offset = info->backOffset;
- drmInfo.back_pitch = info->backPitch * cpp;
- drmInfo.depth_offset = info->depthOffset;
- drmInfo.depth_pitch = info->depthPitch * cpp;
- drmInfo.ring_offset = info->ringHandle;
- drmInfo.ring_rptr_offset = info->ringReadPtrHandle;
- drmInfo.buffers_offset = info->bufHandle;
- drmInfo.gart_textures_offset = info->gartTexHandle;
-
- ret = drmCommandWrite(disp->drmFD, DRM_RADEON_CP_INIT, &drmInfo,
- sizeof(drm_radeon_init_t));
-
- return ret >= 0;
-}
-
-
-/**
- * \brief Add a map for the vertex buffers that will be accessed by any
- * DRI-based clients.
- *
- * \param ctx display handle.
- * \param info driver private data.
- *
- * \return one on success, or zero on failure.
- *
- * Calls drmAddBufs() with the previously allocated vertex buffers.
- */
-static int RADEONDRIBufInit( driDisplay *disp, RADEONInfoPtr info )
-{
- /* Initialize vertex buffers */
- info->bufNumBufs = drmAddBufs(disp->drmFD,
- info->bufMapSize / RADEON_BUFFER_SIZE,
- RADEON_BUFFER_SIZE,
- disp->isPCI ? DRM_SG_BUFFER : DRM_AGP_BUFFER,
- info->bufStart);
-
- if (info->bufNumBufs <= 0) {
- fprintf(stderr,
- "[drm] Could not create vertex/indirect buffers list\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] Added %d %d byte vertex/indirect buffers\n",
- info->bufNumBufs, RADEON_BUFFER_SIZE);
-
- return 1;
-}
-
-
-/**
- * \brief Install an IRQ handler.
- *
- * \param disp display handle.
- * \param info driver private data.
- *
- * Attempts to install an IRQ handler via drmCtlInstHandler(), falling back to
- * IRQ-free operation on failure.
- */
-static void RADEONDRIIrqInit(driDisplay *disp, RADEONInfoPtr info)
-{
- if ((drmCtlInstHandler(disp->drmFD, 0)) != 0)
- fprintf(stderr, "[drm] failure adding irq handler, "
- "there is a device already using that irq\n"
- "[drm] falling back to irq-free operation\n");
-}
-
-
-/**
- * \brief Initialize the AGP heap.
- *
- * \param disp display handle.
- * \param info driver private data.
- *
- * This function is a wrapper around the DRM_RADEON_INIT_HEAP command, passing
- * all the parameters in a drm_radeon_mem_init_heap structure.
- */
-static void RADEONDRIAgpHeapInit(driDisplay *disp,
- RADEONInfoPtr info)
-{
- drm_radeon_mem_init_heap_t drmHeap;
-
- /* Start up the simple memory manager for gart space */
- drmHeap.region = RADEON_MEM_REGION_GART;
- drmHeap.start = 0;
- drmHeap.size = info->gartTexMapSize;
-
- if (drmCommandWrite(disp->drmFD, DRM_RADEON_INIT_HEAP,
- &drmHeap, sizeof(drmHeap))) {
- fprintf(stderr,
- "[drm] Failed to initialized gart heap manager\n");
- } else {
- fprintf(stderr,
- "[drm] Initialized kernel gart heap manager, %d\n",
- info->gartTexMapSize);
- }
-}
-
-
-/**
- * Called at the start of each server generation.
- *
- * \param disp display handle.
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * Performs static frame buffer allocation. Opens the DRM device and add maps
- * to the SAREA, framebuffer and MMIO regions. Fills in \p info with more
- * information. Creates a \e server context to grab the lock for the
- * initialization ioctls and calls the other initilization functions in this
- * file. Starts the CP engine via the DRM_RADEON_CP_START command.
- *
- * Setups a RADEONDRIRec structure to be passed to radeon_dri.so for its
- * initialization.
- */
-static int RADEONScreenInit( driDisplay *disp, RADEONInfoPtr info, RADEONDRIPtr pRADEONDRI)
-{
- int i, err;
-
- {
- int width_bytes = (disp->virtualWidth * disp->cpp);
- int maxy = disp->fbSize / width_bytes;
-
-
- if (maxy <= disp->virtualHeight * 3) {
- fprintf(stderr,
- "Static buffer allocation failed -- "
- "need at least %d kB video memory (have %d kB)\n",
- (disp->virtualWidth * disp->virtualHeight *
- disp->cpp * 3 + 1023) / 1024,
- disp->fbSize / 1024);
- return 0;
- }
- }
- if (info->ChipFamily >= CHIP_FAMILY_R300) {
- fprintf(stderr,
- "Direct rendering not yet supported on "
- "Radeon 9700 and newer cards\n");
- return 0;
- }
-
- radeon_drm_page_size = getpagesize();
-
- /* Check the radeon DRM version */
- if (!RADEONCheckDRMVersion(disp, info)) {
- return 0;
- }
-
- if (disp->isPCI) {
- /* Initialize PCI */
- if (!RADEONDRIPciInit(disp, info))
- return 0;
- }
- else {
- /* Initialize AGP */
- if (!RADEONDRIAgpInit(disp, info))
- return 0;
- }
-
- /* Memory manager setup */
- if (!RADEONMemoryInit(disp, info)) {
- return 0;
- }
-
- /* Create a 'server' context so we can grab the lock for
- * initialization ioctls.
- */
- if ((err = drmCreateContext(disp->drmFD, &disp->serverContext)) != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return 0;
- }
-
- DRM_LOCK(disp->drmFD, disp->pSAREA, disp->serverContext, 0);
-
- /* Initialize the kernel data structures */
- if (!RADEONDRIKernelInit(disp, info)) {
- fprintf(stderr, "RADEONDRIKernelInit failed\n");
- DRM_UNLOCK(disp->drmFD, disp->pSAREA, disp->serverContext);
- return 0;
- }
-
- /* Initialize the vertex buffers list */
- if (!RADEONDRIBufInit(disp, info)) {
- fprintf(stderr, "RADEONDRIBufInit failed\n");
- DRM_UNLOCK(disp->drmFD, disp->pSAREA, disp->serverContext);
- return 0;
- }
-
- /* Initialize IRQ */
- RADEONDRIIrqInit(disp, info);
-
- /* Initialize kernel gart memory manager */
- RADEONDRIAgpHeapInit(disp, info);
-
- fprintf(stderr,"page flipping %sabled\n", info->page_flip_enable?"en":"dis");
- /* Initialize the SAREA private data structure */
- {
- drm_radeon_sarea_t *pSAREAPriv;
- pSAREAPriv = (drm_radeon_sarea_t *)(((char*)disp->pSAREA) +
- sizeof(drm_sarea_t));
- memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
- pSAREAPriv->pfState = info->page_flip_enable;
- }
-
- for ( i = 0;; i++ ) {
- drmMapType type;
- drmMapFlags flags;
- drm_handle_t handle, offset;
- drmSize size;
- int rc, mtrr;
-
- if ( ( rc = drmGetMap( disp->drmFD, i, &offset, &size, &type, &flags, &handle, &mtrr ) ) != 0 )
- break;
- if ( type == DRM_REGISTERS ) {
- pRADEONDRI->registerHandle = offset;
- pRADEONDRI->registerSize = size;
- break;
- }
- }
- /* Quick hack to clear the front & back buffers. Could also use
- * the clear ioctl to do this, but would need to setup hw state
- * first.
- */
- drimemsetio((char *)disp->pFB + info->frontOffset,
- 0xEE,
- info->frontPitch * disp->cpp * disp->virtualHeight );
-
- drimemsetio((char *)disp->pFB + info->backOffset,
- 0x30,
- info->backPitch * disp->cpp * disp->virtualHeight );
-
-
- /* This is the struct passed to radeon_dri.so for its initialization */
- pRADEONDRI->deviceID = info->Chipset;
- pRADEONDRI->width = disp->virtualWidth;
- pRADEONDRI->height = disp->virtualHeight;
- pRADEONDRI->depth = disp->bpp; /* XXX: depth */
- pRADEONDRI->bpp = disp->bpp;
- pRADEONDRI->IsPCI = disp->isPCI;
- pRADEONDRI->frontOffset = info->frontOffset;
- pRADEONDRI->frontPitch = info->frontPitch;
- pRADEONDRI->backOffset = info->backOffset;
- pRADEONDRI->backPitch = info->backPitch;
- pRADEONDRI->depthOffset = info->depthOffset;
- pRADEONDRI->depthPitch = info->depthPitch;
- pRADEONDRI->textureOffset = info->textureOffset;
- pRADEONDRI->textureSize = info->textureSize;
- pRADEONDRI->log2TexGran = info->log2TexGran;
- pRADEONDRI->statusHandle = info->ringReadPtrHandle;
- pRADEONDRI->statusSize = info->ringReadMapSize;
- pRADEONDRI->gartTexHandle = info->gartTexHandle;
- pRADEONDRI->gartTexMapSize = info->gartTexMapSize;
- pRADEONDRI->log2GARTTexGran = info->log2GARTTexGran;
- pRADEONDRI->gartTexOffset = info->gartTexStart;
- pRADEONDRI->sarea_priv_offset = sizeof(drm_sarea_t);
-
- /* Don't release the lock now - let the VT switch handler do it. */
-
- return 1;
-}
-
-
-/**
- * \brief Get Radeon chip family from chipset number.
- *
- * \param info driver private data.
- *
- * \return non-zero on success, or zero on failure.
- *
- * Called by radeonInitFBDev() to set RADEONInfoRec::ChipFamily
- * according to the value of RADEONInfoRec::Chipset. Fails if the
- * chipset is unrecognized or not appropriate for this driver (i.e., not
- * an r100 style radeon)
- */
-static int get_chipfamily_from_chipset( RADEONInfoPtr info )
-{
- switch (info->Chipset) {
- case PCI_CHIP_RADEON_LY:
- case PCI_CHIP_RADEON_LZ:
- info->ChipFamily = CHIP_FAMILY_M6;
- break;
-
- case PCI_CHIP_RADEON_QY:
- case PCI_CHIP_RADEON_QZ:
- info->ChipFamily = CHIP_FAMILY_VE;
- break;
-
- case PCI_CHIP_R200_QL:
- case PCI_CHIP_R200_QN:
- case PCI_CHIP_R200_QO:
- case PCI_CHIP_R200_Ql:
- case PCI_CHIP_R200_BB:
- info->ChipFamily = CHIP_FAMILY_R200;
- break;
-
- case PCI_CHIP_RV200_QW: /* RV200 desktop */
- case PCI_CHIP_RV200_QX:
- info->ChipFamily = CHIP_FAMILY_RV200;
- break;
-
- case PCI_CHIP_RADEON_LW:
- case PCI_CHIP_RADEON_LX:
- info->ChipFamily = CHIP_FAMILY_M7;
- break;
-
- case PCI_CHIP_RV250_Id:
- case PCI_CHIP_RV250_Ie:
- case PCI_CHIP_RV250_If:
- case PCI_CHIP_RV250_Ig:
- info->ChipFamily = CHIP_FAMILY_RV250;
- break;
-
- case PCI_CHIP_RV250_Ld:
- case PCI_CHIP_RV250_Le:
- case PCI_CHIP_RV250_Lf:
- case PCI_CHIP_RV250_Lg:
- info->ChipFamily = CHIP_FAMILY_M9;
- break;
-
- case PCI_CHIP_RV280_Y_:
- case PCI_CHIP_RV280_Ya:
- case PCI_CHIP_RV280_Yb:
- case PCI_CHIP_RV280_Yc:
- info->ChipFamily = CHIP_FAMILY_RV280;
- break;
-
- case PCI_CHIP_R300_ND:
- case PCI_CHIP_R300_NE:
- case PCI_CHIP_R300_NF:
- case PCI_CHIP_R300_NG:
- info->ChipFamily = CHIP_FAMILY_R300;
- break;
-
- default:
- /* Original Radeon/7200 */
- info->ChipFamily = CHIP_FAMILY_RADEON;
- }
-
- return 1;
-}
-
-
-/**
- * \brief Initialize the framebuffer device mode
- *
- * \param disp display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Fills in \p info with some default values and some information from \p disp
- * and then calls RADEONScreenInit() for the screen initialization.
- *
- * Before exiting clears the framebuffer memory accessing it directly.
- */
-static int radeonInitFBDev( driDisplay *disp, RADEONDRIPtr pRADEONDRI )
-{
- int err;
- RADEONInfoPtr info = calloc(1, sizeof(*info));
-
- disp->driverPrivate = (void *)info;
-
- info->gartFastWrite = RADEON_DEFAULT_AGP_FAST_WRITE;
- info->gartSize = RADEON_DEFAULT_AGP_SIZE;
- info->gartTexSize = RADEON_DEFAULT_AGP_TEX_SIZE;
- info->bufSize = RADEON_DEFAULT_BUFFER_SIZE;
- info->ringSize = RADEON_DEFAULT_RING_SIZE;
- info->page_flip_enable = RADEON_DEFAULT_PAGE_FLIP;
-
- info->Chipset = disp->chipset;
-
- if (!get_chipfamily_from_chipset( info )) {
- fprintf(stderr, "Unknown or non-radeon chipset -- cannot continue\n");
- fprintf(stderr, "==> Verify PCI BusID is correct in miniglx.conf\n");
- return 0;
- }
-
- info->frontPitch = disp->virtualWidth;
-
- if (!RADEONScreenInit( disp, info, pRADEONDRI))
- return 0;
-
- /* Initialize and start the CP if required */
- if ((err = drmCommandNone(disp->drmFD, DRM_RADEON_CP_START)) != 0) {
- fprintf(stderr, "%s: CP start %d\n", __FUNCTION__, err);
- return 0;
- }
-
- return 1;
-}
-
-static EGLBoolean
-radeonFillInConfigs(_EGLDisplay *disp, unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer) {
- _EGLConfig *configs;
- _EGLConfig *c;
- unsigned int i, num_configs;
- unsigned int depth_buffer_factor;
- unsigned int back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_configs = depth_buffer_factor * back_buffer_factor * 2;
-
- if (pixel_bits == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- } else {
- fb_format = GL_RGBA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- configs = calloc(sizeof(*configs), num_configs);
- c = configs;
- if (!_eglFillInConfigs(c, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__);
- return EGL_FALSE;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for (i = 0, c = configs; i < num_configs; i++, c++) {
- int stencil = GET_CONFIG_ATTRIB(c, EGL_STENCIL_SIZE);
- if ((stencil != 0) && (stencil != stencil_bits)) {
- SET_CONFIG_ATTRIB(c, EGL_CONFIG_CAVEAT, EGL_SLOW_CONFIG);
- }
- }
-
- for (i = 0, c = configs; i < num_configs; i++, c++)
- _eglAddConfig(disp, c);
-
- free(configs);
-
- return EGL_TRUE;
-}
-
-/**
- * Show the given surface on the named screen.
- * If surface is EGL_NO_SURFACE, disable the screen's output.
- */
-static EGLBoolean
-radeonShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
- EGLSurface surface, EGLModeMESA m)
-{
- _eglDRIShowSurfaceMESA(drv, dpy, screen, surface, m);
- return EGL_FALSE;
-}
-
-static EGLBoolean
-radeonInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- __DRIframebuffer framebuffer;
- driDisplay *display;
-
- if (!_eglDRIInitialize(drv, dpy, major, minor))
- return EGL_FALSE;
-
- display = Lookup_driDisplay(dpy);
-
- framebuffer.dev_priv_size = sizeof(RADEONDRIRec);
- framebuffer.dev_priv = malloc(sizeof(RADEONDRIRec));
-
- display->virtualWidth = 1024;
- display->virtualHeight = 768;
- display->bpp = 32;
- display->cpp = 4;
-
- if (!_eglDRIGetDisplayInfo(display))
- return EGL_FALSE;
-
- framebuffer.base = display->pFB;
- radeonInitFBDev( display, framebuffer.dev_priv );
-
- if (!_eglDRICreateDisplay(display, &framebuffer))
- return EGL_FALSE;
-
- if (!_eglDRICreateScreen(display))
- return EGL_FALSE;
-
- radeonFillInConfigs(&display->Base, 32, 24, 8, 1);
- radeonFillInConfigs(&display->Base, 16, 16, 0, 1);
-
- drv->Initialized = EGL_TRUE;
- return EGL_TRUE;
-}
-
-
-/**
- * The bootstrap function. Return a new radeonDriver object and
- * plug in API functions.
- */
-_EGLDriver *
-_eglMain(_EGLDisplay *dpy)
-{
- radeonDriver *radeon;
-
- radeon = (radeonDriver *) calloc(1, sizeof(*radeon));
- if (!radeon) {
- return NULL;
- }
-
- /* First fill in the dispatch table with defaults */
- _eglDRIInitDriverFallbacks(&radeon->Base);
-
- /* then plug in our radeon-specific functions */
- radeon->Base.Initialize = radeonInitialize;
- radeon->Base.ShowSurfaceMESA = radeonShowSurfaceMESA;
-
- return &radeon->Base;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_macros.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_macros.h
deleted file mode 100644
index 60f0fa2d3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_macros.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * \file server/radeon_macros.h
- * \brief Macros for Radeon MMIO operation.
- *
- * \authors Kevin E. Martin <martin@xfree86.org>
- * \authors Rickard E. Faith <faith@valinux.com>
- * \authors Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-
-/*
- * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, VA LINUX SYSTEMS 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.
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.20 2002/10/12 01:38:07 martin Exp $ */
-
-#ifndef _RADEON_MACROS_H_
-#define _RADEON_MACROS_H_
-
-#include <mmio.h>
-
-# define MMIO_IN8(base, offset) \
- *(volatile unsigned char *)(((unsigned char*)(base)) + (offset))
-# define MMIO_IN32(base, offset) \
- read_MMIO_LE32(base, offset)
-# define MMIO_OUT8(base, offset, val) \
- *(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val)
-# define MMIO_OUT32(base, offset, val) \
- *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = CPU_TO_LE32(val)
-
-
- /* Memory mapped register access macros */
-#define INREG8(addr) MMIO_IN8(RADEONMMIO, addr)
-#define INREG(addr) MMIO_IN32(RADEONMMIO, addr)
-#define OUTREG8(addr, val) MMIO_OUT8(RADEONMMIO, addr, val)
-#define OUTREG(addr, val) MMIO_OUT32(RADEONMMIO, addr, val)
-
-#define ADDRREG(addr) ((volatile GLuint *)(pointer)(RADEONMMIO + (addr)))
-
-
-#define OUTREGP(addr, val, mask) \
-do { \
- GLuint tmp = INREG(addr); \
- tmp &= (mask); \
- tmp |= (val); \
- OUTREG(addr, tmp); \
-} while (0)
-
-#define INPLL(dpy, addr) RADEONINPLL(dpy, addr)
-
-#define OUTPLL(addr, val) \
-do { \
- OUTREG8(RADEON_CLOCK_CNTL_INDEX, (((addr) & 0x3f) | \
- RADEON_PLL_WR_EN)); \
- OUTREG(RADEON_CLOCK_CNTL_DATA, val); \
-} while (0)
-
-#define OUTPLLP(dpy, addr, val, mask) \
-do { \
- GLuint tmp = INPLL(dpy, addr); \
- tmp &= (mask); \
- tmp |= (val); \
- OUTPLL(addr, tmp); \
-} while (0)
-
-#define OUTPAL_START(idx) \
-do { \
- OUTREG8(RADEON_PALETTE_INDEX, (idx)); \
-} while (0)
-
-#define OUTPAL_NEXT(r, g, b) \
-do { \
- OUTREG(RADEON_PALETTE_DATA, ((r) << 16) | ((g) << 8) | (b)); \
-} while (0)
-
-#define OUTPAL_NEXT_CARD32(v) \
-do { \
- OUTREG(RADEON_PALETTE_DATA, (v & 0x00ffffff)); \
-} while (0)
-
-#define OUTPAL(idx, r, g, b) \
-do { \
- OUTPAL_START((idx)); \
- OUTPAL_NEXT((r), (g), (b)); \
-} while (0)
-
-#define INPAL_START(idx) \
-do { \
- OUTREG(RADEON_PALETTE_INDEX, (idx) << 16); \
-} while (0)
-
-#define INPAL_NEXT() INREG(RADEON_PALETTE_DATA)
-
-#define PAL_SELECT(idx) \
-do { \
- if (!idx) { \
- OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) & \
- (GLuint)~RADEON_DAC2_PALETTE_ACC_CTL); \
- } else { \
- OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) | \
- RADEON_DAC2_PALETTE_ACC_CTL); \
- } \
-} while (0)
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_reg.h
deleted file mode 100644
index d290d43cf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/radeon/server/radeon_reg.h
+++ /dev/null
@@ -1,2142 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.30 2003/10/07 22:47:12 martin Exp $ */
-/*
- * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to 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, sublicense, and/or sell copies of the Software,
- * and to 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 ATI, VA LINUX SYSTEMS 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:
- * Kevin E. Martin <martin@xfree86.org>
- * Rickard E. Faith <faith@valinux.com>
- * Alan Hourihane <alanh@fairlite.demon.co.uk>
- *
- * References:
- *
- * !!!! FIXME !!!!
- * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical
- * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April
- * 1999.
- *
- * !!!! FIXME !!!!
- * RAGE 128 Software Development Manual (Technical Reference Manual P/N
- * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999.
- *
- */
-
-/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h
- * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT
- * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */
-
-#ifndef _RADEON_REG_H_
-#define _RADEON_REG_H_
-
- /* Registers for 2D/Video/Overlay */
-#define RADEON_ADAPTER_ID 0x0f2c /* PCI */
-#define RADEON_AGP_BASE 0x0170
-#define RADEON_AGP_CNTL 0x0174
-# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0)
-# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0)
-# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0)
-# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0)
-# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0)
-# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0)
-# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0)
-# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0)
-#define RADEON_AGP_COMMAND 0x0f60 /* PCI */
-#define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/
-# define RADEON_AGP_ENABLE (1<<8)
-#define RADEON_AGP_PLL_CNTL 0x000b /* PLL */
-#define RADEON_AGP_STATUS 0x0f5c /* PCI */
-# define RADEON_AGP_1X_MODE 0x01
-# define RADEON_AGP_2X_MODE 0x02
-# define RADEON_AGP_4X_MODE 0x04
-# define RADEON_AGP_FW_MODE 0x10
-# define RADEON_AGP_MODE_MASK 0x17
-#define RADEON_ATTRDR 0x03c1 /* VGA */
-#define RADEON_ATTRDW 0x03c0 /* VGA */
-#define RADEON_ATTRX 0x03c0 /* VGA */
-#define RADEON_AUX_SC_CNTL 0x1660
-# define RADEON_AUX1_SC_EN (1 << 0)
-# define RADEON_AUX1_SC_MODE_OR (0 << 1)
-# define RADEON_AUX1_SC_MODE_NAND (1 << 1)
-# define RADEON_AUX2_SC_EN (1 << 2)
-# define RADEON_AUX2_SC_MODE_OR (0 << 3)
-# define RADEON_AUX2_SC_MODE_NAND (1 << 3)
-# define RADEON_AUX3_SC_EN (1 << 4)
-# define RADEON_AUX3_SC_MODE_OR (0 << 5)
-# define RADEON_AUX3_SC_MODE_NAND (1 << 5)
-#define RADEON_AUX1_SC_BOTTOM 0x1670
-#define RADEON_AUX1_SC_LEFT 0x1664
-#define RADEON_AUX1_SC_RIGHT 0x1668
-#define RADEON_AUX1_SC_TOP 0x166c
-#define RADEON_AUX2_SC_BOTTOM 0x1680
-#define RADEON_AUX2_SC_LEFT 0x1674
-#define RADEON_AUX2_SC_RIGHT 0x1678
-#define RADEON_AUX2_SC_TOP 0x167c
-#define RADEON_AUX3_SC_BOTTOM 0x1690
-#define RADEON_AUX3_SC_LEFT 0x1684
-#define RADEON_AUX3_SC_RIGHT 0x1688
-#define RADEON_AUX3_SC_TOP 0x168c
-#define RADEON_AUX_WINDOW_HORZ_CNTL 0x02d8
-#define RADEON_AUX_WINDOW_VERT_CNTL 0x02dc
-
-#define RADEON_BASE_CODE 0x0f0b
-#define RADEON_BIOS_0_SCRATCH 0x0010
-#define RADEON_BIOS_1_SCRATCH 0x0014
-#define RADEON_BIOS_2_SCRATCH 0x0018
-#define RADEON_BIOS_3_SCRATCH 0x001c
-#define RADEON_BIOS_4_SCRATCH 0x0020
-#define RADEON_BIOS_5_SCRATCH 0x0024
-#define RADEON_BIOS_6_SCRATCH 0x0028
-#define RADEON_BIOS_7_SCRATCH 0x002c
-#define RADEON_BIOS_ROM 0x0f30 /* PCI */
-#define RADEON_BIST 0x0f0f /* PCI */
-#define RADEON_BRUSH_DATA0 0x1480
-#define RADEON_BRUSH_DATA1 0x1484
-#define RADEON_BRUSH_DATA10 0x14a8
-#define RADEON_BRUSH_DATA11 0x14ac
-#define RADEON_BRUSH_DATA12 0x14b0
-#define RADEON_BRUSH_DATA13 0x14b4
-#define RADEON_BRUSH_DATA14 0x14b8
-#define RADEON_BRUSH_DATA15 0x14bc
-#define RADEON_BRUSH_DATA16 0x14c0
-#define RADEON_BRUSH_DATA17 0x14c4
-#define RADEON_BRUSH_DATA18 0x14c8
-#define RADEON_BRUSH_DATA19 0x14cc
-#define RADEON_BRUSH_DATA2 0x1488
-#define RADEON_BRUSH_DATA20 0x14d0
-#define RADEON_BRUSH_DATA21 0x14d4
-#define RADEON_BRUSH_DATA22 0x14d8
-#define RADEON_BRUSH_DATA23 0x14dc
-#define RADEON_BRUSH_DATA24 0x14e0
-#define RADEON_BRUSH_DATA25 0x14e4
-#define RADEON_BRUSH_DATA26 0x14e8
-#define RADEON_BRUSH_DATA27 0x14ec
-#define RADEON_BRUSH_DATA28 0x14f0
-#define RADEON_BRUSH_DATA29 0x14f4
-#define RADEON_BRUSH_DATA3 0x148c
-#define RADEON_BRUSH_DATA30 0x14f8
-#define RADEON_BRUSH_DATA31 0x14fc
-#define RADEON_BRUSH_DATA32 0x1500
-#define RADEON_BRUSH_DATA33 0x1504
-#define RADEON_BRUSH_DATA34 0x1508
-#define RADEON_BRUSH_DATA35 0x150c
-#define RADEON_BRUSH_DATA36 0x1510
-#define RADEON_BRUSH_DATA37 0x1514
-#define RADEON_BRUSH_DATA38 0x1518
-#define RADEON_BRUSH_DATA39 0x151c
-#define RADEON_BRUSH_DATA4 0x1490
-#define RADEON_BRUSH_DATA40 0x1520
-#define RADEON_BRUSH_DATA41 0x1524
-#define RADEON_BRUSH_DATA42 0x1528
-#define RADEON_BRUSH_DATA43 0x152c
-#define RADEON_BRUSH_DATA44 0x1530
-#define RADEON_BRUSH_DATA45 0x1534
-#define RADEON_BRUSH_DATA46 0x1538
-#define RADEON_BRUSH_DATA47 0x153c
-#define RADEON_BRUSH_DATA48 0x1540
-#define RADEON_BRUSH_DATA49 0x1544
-#define RADEON_BRUSH_DATA5 0x1494
-#define RADEON_BRUSH_DATA50 0x1548
-#define RADEON_BRUSH_DATA51 0x154c
-#define RADEON_BRUSH_DATA52 0x1550
-#define RADEON_BRUSH_DATA53 0x1554
-#define RADEON_BRUSH_DATA54 0x1558
-#define RADEON_BRUSH_DATA55 0x155c
-#define RADEON_BRUSH_DATA56 0x1560
-#define RADEON_BRUSH_DATA57 0x1564
-#define RADEON_BRUSH_DATA58 0x1568
-#define RADEON_BRUSH_DATA59 0x156c
-#define RADEON_BRUSH_DATA6 0x1498
-#define RADEON_BRUSH_DATA60 0x1570
-#define RADEON_BRUSH_DATA61 0x1574
-#define RADEON_BRUSH_DATA62 0x1578
-#define RADEON_BRUSH_DATA63 0x157c
-#define RADEON_BRUSH_DATA7 0x149c
-#define RADEON_BRUSH_DATA8 0x14a0
-#define RADEON_BRUSH_DATA9 0x14a4
-#define RADEON_BRUSH_SCALE 0x1470
-#define RADEON_BRUSH_Y_X 0x1474
-#define RADEON_BUS_CNTL 0x0030
-# define RADEON_BUS_MASTER_DIS (1 << 6)
-# define RADEON_BUS_RD_DISCARD_EN (1 << 24)
-# define RADEON_BUS_RD_ABORT_EN (1 << 25)
-# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28)
-# define RADEON_BUS_WRT_BURST (1 << 29)
-# define RADEON_BUS_READ_BURST (1 << 30)
-#define RADEON_BUS_CNTL1 0x0034
-# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4)
-
-#define RADEON_CACHE_CNTL 0x1724
-#define RADEON_CACHE_LINE 0x0f0c /* PCI */
-#define RADEON_CAP0_TRIG_CNTL 0x0950 /* ? */
-#define RADEON_CAP1_TRIG_CNTL 0x09c0 /* ? */
-#define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */
-#define RADEON_CAPABILITIES_PTR 0x0f34 /* PCI */
-#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */
-#define RADEON_CLOCK_CNTL_DATA 0x000c
-#define RADEON_CLOCK_CNTL_INDEX 0x0008
-# define RADEON_PLL_WR_EN (1 << 7)
-# define RADEON_PLL_DIV_SEL (3 << 8)
-# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8)
-#define RADEON_CLR_CMP_CLR_3D 0x1a24
-#define RADEON_CLR_CMP_CLR_DST 0x15c8
-#define RADEON_CLR_CMP_CLR_SRC 0x15c4
-#define RADEON_CLR_CMP_CNTL 0x15c0
-# define RADEON_SRC_CMP_EQ_COLOR (4 << 0)
-# define RADEON_SRC_CMP_NEQ_COLOR (5 << 0)
-# define RADEON_CLR_CMP_SRC_SOURCE (1 << 24)
-#define RADEON_CLR_CMP_MASK 0x15cc
-# define RADEON_CLR_CMP_MSK 0xffffffff
-#define RADEON_CLR_CMP_MASK_3D 0x1A28
-#define RADEON_COMMAND 0x0f04 /* PCI */
-#define RADEON_COMPOSITE_SHADOW_ID 0x1a0c
-#define RADEON_CONFIG_APER_0_BASE 0x0100
-#define RADEON_CONFIG_APER_1_BASE 0x0104
-#define RADEON_CONFIG_APER_SIZE 0x0108
-#define RADEON_CONFIG_BONDS 0x00e8
-#define RADEON_CONFIG_CNTL 0x00e0
-# define RADEON_CFG_ATI_REV_A11 (0 << 16)
-# define RADEON_CFG_ATI_REV_A12 (1 << 16)
-# define RADEON_CFG_ATI_REV_A13 (2 << 16)
-# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16)
-#define RADEON_CONFIG_MEMSIZE 0x00f8
-#define RADEON_CONFIG_MEMSIZE_EMBEDDED 0x0114
-#define RADEON_CONFIG_REG_1_BASE 0x010c
-#define RADEON_CONFIG_REG_APER_SIZE 0x0110
-#define RADEON_CONFIG_XSTRAP 0x00e4
-#define RADEON_CONSTANT_COLOR_C 0x1d34
-# define RADEON_CONSTANT_COLOR_MASK 0x00ffffff
-# define RADEON_CONSTANT_COLOR_ONE 0x00ffffff
-# define RADEON_CONSTANT_COLOR_ZERO 0x00000000
-#define RADEON_CRC_CMDFIFO_ADDR 0x0740
-#define RADEON_CRC_CMDFIFO_DOUT 0x0744
-#define RADEON_GRPH_BUFFER_CNTL 0x02f0
-# define RADEON_GRPH_START_REQ_MASK (0x7f)
-# define RADEON_GRPH_START_REQ_SHIFT 0
-# define RADEON_GRPH_STOP_REQ_MASK (0x7f<<8)
-# define RADEON_GRPH_STOP_REQ_SHIFT 8
-# define RADEON_GRPH_CRITICAL_POINT_MASK (0x7f<<16)
-# define RADEON_GRPH_CRITICAL_POINT_SHIFT 16
-# define RADEON_GRPH_CRITICAL_CNTL (1<<28)
-# define RADEON_GRPH_BUFFER_SIZE (1<<29)
-# define RADEON_GRPH_CRITICAL_AT_SOF (1<<30)
-# define RADEON_GRPH_STOP_CNTL (1<<31)
-#define RADEON_GRPH2_BUFFER_CNTL 0x03f0
-# define RADEON_GRPH2_START_REQ_MASK (0x7f)
-# define RADEON_GRPH2_START_REQ_SHIFT 0
-# define RADEON_GRPH2_STOP_REQ_MASK (0x7f<<8)
-# define RADEON_GRPH2_STOP_REQ_SHIFT 8
-# define RADEON_GRPH2_CRITICAL_POINT_MASK (0x7f<<16)
-# define RADEON_GRPH2_CRITICAL_POINT_SHIFT 16
-# define RADEON_GRPH2_CRITICAL_CNTL (1<<28)
-# define RADEON_GRPH2_BUFFER_SIZE (1<<29)
-# define RADEON_GRPH2_CRITICAL_AT_SOF (1<<30)
-# define RADEON_GRPH2_STOP_CNTL (1<<31)
-#define RADEON_CRTC_CRNT_FRAME 0x0214
-#define RADEON_CRTC_EXT_CNTL 0x0054
-# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0)
-# define RADEON_VGA_ATI_LINEAR (1 << 3)
-# define RADEON_XCRT_CNT_EN (1 << 6)
-# define RADEON_CRTC_HSYNC_DIS (1 << 8)
-# define RADEON_CRTC_VSYNC_DIS (1 << 9)
-# define RADEON_CRTC_DISPLAY_DIS (1 << 10)
-# define RADEON_CRTC_SYNC_TRISTAT (1 << 11)
-# define RADEON_CRTC_CRT_ON (1 << 15)
-#define RADEON_CRTC_EXT_CNTL_DPMS_BYTE 0x0055
-# define RADEON_CRTC_HSYNC_DIS_BYTE (1 << 0)
-# define RADEON_CRTC_VSYNC_DIS_BYTE (1 << 1)
-# define RADEON_CRTC_DISPLAY_DIS_BYTE (1 << 2)
-#define RADEON_CRTC_GEN_CNTL 0x0050
-# define RADEON_CRTC_DBL_SCAN_EN (1 << 0)
-# define RADEON_CRTC_INTERLACE_EN (1 << 1)
-# define RADEON_CRTC_CSYNC_EN (1 << 4)
-# define RADEON_CRTC_CUR_EN (1 << 16)
-# define RADEON_CRTC_CUR_MODE_MASK (7 << 17)
-# define RADEON_CRTC_ICON_EN (1 << 20)
-# define RADEON_CRTC_EXT_DISP_EN (1 << 24)
-# define RADEON_CRTC_EN (1 << 25)
-# define RADEON_CRTC_DISP_REQ_EN_B (1 << 26)
-#define RADEON_CRTC2_GEN_CNTL 0x03f8
-# define RADEON_CRTC2_DBL_SCAN_EN (1 << 0)
-# define RADEON_CRTC2_INTERLACE_EN (1 << 1)
-# define RADEON_CRTC2_SYNC_TRISTAT (1 << 4)
-# define RADEON_CRTC2_HSYNC_TRISTAT (1 << 5)
-# define RADEON_CRTC2_VSYNC_TRISTAT (1 << 6)
-# define RADEON_CRTC2_CRT2_ON (1 << 7)
-# define RADEON_CRTC2_ICON_EN (1 << 15)
-# define RADEON_CRTC2_CUR_EN (1 << 16)
-# define RADEON_CRTC2_CUR_MODE_MASK (7 << 20)
-# define RADEON_CRTC2_DISP_DIS (1 << 23)
-# define RADEON_CRTC2_EN (1 << 25)
-# define RADEON_CRTC2_DISP_REQ_EN_B (1 << 26)
-# define RADEON_CRTC2_CSYNC_EN (1 << 27)
-# define RADEON_CRTC2_HSYNC_DIS (1 << 28)
-# define RADEON_CRTC2_VSYNC_DIS (1 << 29)
-#define RADEON_CRTC_MORE_CNTL 0x27c
-# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4)
-# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5)
-#define RADEON_CRTC_GUI_TRIG_VLINE 0x0218
-#define RADEON_CRTC_H_SYNC_STRT_WID 0x0204
-# define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0)
-# define RADEON_CRTC_H_SYNC_STRT_CHAR (0x3ff << 3)
-# define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3
-# define RADEON_CRTC_H_SYNC_WID (0x3f << 16)
-# define RADEON_CRTC_H_SYNC_WID_SHIFT 16
-# define RADEON_CRTC_H_SYNC_POL (1 << 23)
-#define RADEON_CRTC2_H_SYNC_STRT_WID 0x0304
-# define RADEON_CRTC2_H_SYNC_STRT_PIX (0x07 << 0)
-# define RADEON_CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3)
-# define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3
-# define RADEON_CRTC2_H_SYNC_WID (0x3f << 16)
-# define RADEON_CRTC2_H_SYNC_WID_SHIFT 16
-# define RADEON_CRTC2_H_SYNC_POL (1 << 23)
-#define RADEON_CRTC_H_TOTAL_DISP 0x0200
-# define RADEON_CRTC_H_TOTAL (0x03ff << 0)
-# define RADEON_CRTC_H_TOTAL_SHIFT 0
-# define RADEON_CRTC_H_DISP (0x01ff << 16)
-# define RADEON_CRTC_H_DISP_SHIFT 16
-#define RADEON_CRTC2_H_TOTAL_DISP 0x0300
-# define RADEON_CRTC2_H_TOTAL (0x03ff << 0)
-# define RADEON_CRTC2_H_TOTAL_SHIFT 0
-# define RADEON_CRTC2_H_DISP (0x01ff << 16)
-# define RADEON_CRTC2_H_DISP_SHIFT 16
-#define RADEON_CRTC_OFFSET 0x0224
-#define RADEON_CRTC2_OFFSET 0x0324
-#define RADEON_CRTC_OFFSET_CNTL 0x0228
-# define RADEON_CRTC_TILE_EN (1 << 15)
-#define RADEON_CRTC2_OFFSET_CNTL 0x0328
-# define RADEON_CRTC2_TILE_EN (1 << 15)
-#define RADEON_CRTC_PITCH 0x022c
-#define RADEON_CRTC2_PITCH 0x032c
-#define RADEON_CRTC_STATUS 0x005c
-# define RADEON_CRTC_VBLANK_SAVE (1 << 1)
-# define RADEON_CRTC_VBLANK_SAVE_CLEAR (1 << 1)
-#define RADEON_CRTC2_STATUS 0x03fc
-# define RADEON_CRTC2_VBLANK_SAVE (1 << 1)
-# define RADEON_CRTC2_VBLANK_SAVE_CLEAR (1 << 1)
-#define RADEON_CRTC_V_SYNC_STRT_WID 0x020c
-# define RADEON_CRTC_V_SYNC_STRT (0x7ff << 0)
-# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0
-# define RADEON_CRTC_V_SYNC_WID (0x1f << 16)
-# define RADEON_CRTC_V_SYNC_WID_SHIFT 16
-# define RADEON_CRTC_V_SYNC_POL (1 << 23)
-#define RADEON_CRTC2_V_SYNC_STRT_WID 0x030c
-# define RADEON_CRTC2_V_SYNC_STRT (0x7ff << 0)
-# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0
-# define RADEON_CRTC2_V_SYNC_WID (0x1f << 16)
-# define RADEON_CRTC2_V_SYNC_WID_SHIFT 16
-# define RADEON_CRTC2_V_SYNC_POL (1 << 23)
-#define RADEON_CRTC_V_TOTAL_DISP 0x0208
-# define RADEON_CRTC_V_TOTAL (0x07ff << 0)
-# define RADEON_CRTC_V_TOTAL_SHIFT 0
-# define RADEON_CRTC_V_DISP (0x07ff << 16)
-# define RADEON_CRTC_V_DISP_SHIFT 16
-#define RADEON_CRTC2_V_TOTAL_DISP 0x0308
-# define RADEON_CRTC2_V_TOTAL (0x07ff << 0)
-# define RADEON_CRTC2_V_TOTAL_SHIFT 0
-# define RADEON_CRTC2_V_DISP (0x07ff << 16)
-# define RADEON_CRTC2_V_DISP_SHIFT 16
-#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210
-# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16)
-#define RADEON_CRTC2_CRNT_FRAME 0x0314
-#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318
-#define RADEON_CRTC2_STATUS 0x03fc
-#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310
-#define RADEON_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */
-#define RADEON_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */
-#define RADEON_CUR_CLR0 0x026c
-#define RADEON_CUR_CLR1 0x0270
-#define RADEON_CUR_HORZ_VERT_OFF 0x0268
-#define RADEON_CUR_HORZ_VERT_POSN 0x0264
-#define RADEON_CUR_OFFSET 0x0260
-# define RADEON_CUR_LOCK (1 << 31)
-#define RADEON_CUR2_CLR0 0x036c
-#define RADEON_CUR2_CLR1 0x0370
-#define RADEON_CUR2_HORZ_VERT_OFF 0x0368
-#define RADEON_CUR2_HORZ_VERT_POSN 0x0364
-#define RADEON_CUR2_OFFSET 0x0360
-# define RADEON_CUR2_LOCK (1 << 31)
-
-#define RADEON_DAC_CNTL 0x0058
-# define RADEON_DAC_RANGE_CNTL (3 << 0)
-# define RADEON_DAC_RANGE_CNTL_MASK 0x03
-# define RADEON_DAC_BLANKING (1 << 2)
-# define RADEON_DAC_CMP_EN (1 << 3)
-# define RADEON_DAC_CMP_OUTPUT (1 << 7)
-# define RADEON_DAC_8BIT_EN (1 << 8)
-# define RADEON_DAC_VGA_ADR_EN (1 << 13)
-# define RADEON_DAC_PDWN (1 << 15)
-# define RADEON_DAC_MASK_ALL (0xff << 24)
-#define RADEON_DAC_CNTL2 0x007c
-# define RADEON_DAC2_DAC_CLK_SEL (1 << 0)
-# define RADEON_DAC2_DAC2_CLK_SEL (1 << 1)
-# define RADEON_DAC2_PALETTE_ACC_CTL (1 << 5)
-#define RADEON_DAC_EXT_CNTL 0x0280
-# define RADEON_DAC_FORCE_BLANK_OFF_EN (1 << 4)
-# define RADEON_DAC_FORCE_DATA_EN (1 << 5)
-# define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6)
-# define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00
-# define RADEON_DAC_FORCE_DATA_SHIFT 8
-#define RADEON_TV_DAC_CNTL 0x088c
-# define RADEON_TV_DAC_STD_MASK 0x0300
-# define RADEON_TV_DAC_RDACPD (1 << 24)
-# define RADEON_TV_DAC_GDACPD (1 << 25)
-# define RADEON_TV_DAC_BDACPD (1 << 26)
-#define RADEON_DISP_HW_DEBUG 0x0d14
-# define RADEON_CRT2_DISP1_SEL (1 << 5)
-#define RADEON_DISP_OUTPUT_CNTL 0x0d64
-# define RADEON_DISP_DAC_SOURCE_MASK 0x03
-# define RADEON_DISP_DAC2_SOURCE_MASK 0x0c
-# define RADEON_DISP_DAC_SOURCE_CRTC2 0x01
-# define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04
-#define RADEON_DAC_CRC_SIG 0x02cc
-#define RADEON_DAC_DATA 0x03c9 /* VGA */
-#define RADEON_DAC_MASK 0x03c6 /* VGA */
-#define RADEON_DAC_R_INDEX 0x03c7 /* VGA */
-#define RADEON_DAC_W_INDEX 0x03c8 /* VGA */
-#define RADEON_DDA_CONFIG 0x02e0
-#define RADEON_DDA_ON_OFF 0x02e4
-#define RADEON_DEFAULT_OFFSET 0x16e0
-#define RADEON_DEFAULT_PITCH 0x16e4
-#define RADEON_DEFAULT_SC_BOTTOM_RIGHT 0x16e8
-# define RADEON_DEFAULT_SC_RIGHT_MAX (0x1fff << 0)
-# define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16)
-#define RADEON_DESTINATION_3D_CLR_CMP_VAL 0x1820
-#define RADEON_DESTINATION_3D_CLR_CMP_MSK 0x1824
-#define RADEON_DEVICE_ID 0x0f02 /* PCI */
-#define RADEON_DISP_MISC_CNTL 0x0d00
-# define RADEON_SOFT_RESET_GRPH_PP (1 << 0)
-#define RADEON_DISP_MERGE_CNTL 0x0d60
-# define RADEON_DISP_ALPHA_MODE_MASK 0x03
-# define RADEON_DISP_ALPHA_MODE_KEY 0
-# define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1
-# define RADEON_DISP_ALPHA_MODE_GLOBAL 2
-# define RADEON_DISP_RGB_OFFSET_EN (1<<8)
-# define RADEON_DISP_GRPH_ALPHA_MASK (0xff << 16)
-# define RADEON_DISP_OV0_ALPHA_MASK (0xff << 24)
-# define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9)
-#define RADEON_DISP2_MERGE_CNTL 0x0d68
-# define RADEON_DISP2_RGB_OFFSET_EN (1<<8)
-#define RADEON_DISP_LIN_TRANS_GRPH_A 0x0d80
-#define RADEON_DISP_LIN_TRANS_GRPH_B 0x0d84
-#define RADEON_DISP_LIN_TRANS_GRPH_C 0x0d88
-#define RADEON_DISP_LIN_TRANS_GRPH_D 0x0d8c
-#define RADEON_DISP_LIN_TRANS_GRPH_E 0x0d90
-#define RADEON_DISP_LIN_TRANS_GRPH_F 0x0d98
-#define RADEON_DP_BRUSH_BKGD_CLR 0x1478
-#define RADEON_DP_BRUSH_FRGD_CLR 0x147c
-#define RADEON_DP_CNTL 0x16c0
-# define RADEON_DST_X_LEFT_TO_RIGHT (1 << 0)
-# define RADEON_DST_Y_TOP_TO_BOTTOM (1 << 1)
-#define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0
-# define RADEON_DST_Y_MAJOR (1 << 2)
-# define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15)
-# define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31)
-#define RADEON_DP_DATATYPE 0x16c4
-# define RADEON_HOST_BIG_ENDIAN_EN (1 << 29)
-#define RADEON_DP_GUI_MASTER_CNTL 0x146c
-# define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0)
-# define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1)
-# define RADEON_GMC_SRC_CLIPPING (1 << 2)
-# define RADEON_GMC_DST_CLIPPING (1 << 3)
-# define RADEON_GMC_BRUSH_DATATYPE_MASK (0x0f << 4)
-# define RADEON_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4)
-# define RADEON_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4)
-# define RADEON_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4)
-# define RADEON_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4)
-# define RADEON_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4)
-# define RADEON_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4)
-# define RADEON_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4)
-# define RADEON_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4)
-# define RADEON_GMC_BRUSH_8x8_COLOR (10 << 4)
-# define RADEON_GMC_BRUSH_1X8_COLOR (12 << 4)
-# define RADEON_GMC_BRUSH_SOLID_COLOR (13 << 4)
-# define RADEON_GMC_BRUSH_NONE (15 << 4)
-# define RADEON_GMC_DST_8BPP_CI (2 << 8)
-# define RADEON_GMC_DST_15BPP (3 << 8)
-# define RADEON_GMC_DST_16BPP (4 << 8)
-# define RADEON_GMC_DST_24BPP (5 << 8)
-# define RADEON_GMC_DST_32BPP (6 << 8)
-# define RADEON_GMC_DST_8BPP_RGB (7 << 8)
-# define RADEON_GMC_DST_Y8 (8 << 8)
-# define RADEON_GMC_DST_RGB8 (9 << 8)
-# define RADEON_GMC_DST_VYUY (11 << 8)
-# define RADEON_GMC_DST_YVYU (12 << 8)
-# define RADEON_GMC_DST_AYUV444 (14 << 8)
-# define RADEON_GMC_DST_ARGB4444 (15 << 8)
-# define RADEON_GMC_DST_DATATYPE_MASK (0x0f << 8)
-# define RADEON_GMC_DST_DATATYPE_SHIFT 8
-# define RADEON_GMC_SRC_DATATYPE_MASK (3 << 12)
-# define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12)
-# define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12)
-# define RADEON_GMC_SRC_DATATYPE_COLOR (3 << 12)
-# define RADEON_GMC_BYTE_PIX_ORDER (1 << 14)
-# define RADEON_GMC_BYTE_MSB_TO_LSB (0 << 14)
-# define RADEON_GMC_BYTE_LSB_TO_MSB (1 << 14)
-# define RADEON_GMC_CONVERSION_TEMP (1 << 15)
-# define RADEON_GMC_CONVERSION_TEMP_6500 (0 << 15)
-# define RADEON_GMC_CONVERSION_TEMP_9300 (1 << 15)
-# define RADEON_GMC_ROP3_MASK (0xff << 16)
-# define RADEON_DP_SRC_SOURCE_MASK (7 << 24)
-# define RADEON_DP_SRC_SOURCE_MEMORY (2 << 24)
-# define RADEON_DP_SRC_SOURCE_HOST_DATA (3 << 24)
-# define RADEON_GMC_3D_FCN_EN (1 << 27)
-# define RADEON_GMC_CLR_CMP_CNTL_DIS (1 << 28)
-# define RADEON_GMC_AUX_CLIP_DIS (1 << 29)
-# define RADEON_GMC_WR_MSK_DIS (1 << 30)
-# define RADEON_GMC_LD_BRUSH_Y_X (1 << 31)
-# define RADEON_ROP3_ZERO 0x00000000
-# define RADEON_ROP3_DSa 0x00880000
-# define RADEON_ROP3_SDna 0x00440000
-# define RADEON_ROP3_S 0x00cc0000
-# define RADEON_ROP3_DSna 0x00220000
-# define RADEON_ROP3_D 0x00aa0000
-# define RADEON_ROP3_DSx 0x00660000
-# define RADEON_ROP3_DSo 0x00ee0000
-# define RADEON_ROP3_DSon 0x00110000
-# define RADEON_ROP3_DSxn 0x00990000
-# define RADEON_ROP3_Dn 0x00550000
-# define RADEON_ROP3_SDno 0x00dd0000
-# define RADEON_ROP3_Sn 0x00330000
-# define RADEON_ROP3_DSno 0x00bb0000
-# define RADEON_ROP3_DSan 0x00770000
-# define RADEON_ROP3_ONE 0x00ff0000
-# define RADEON_ROP3_DPa 0x00a00000
-# define RADEON_ROP3_PDna 0x00500000
-# define RADEON_ROP3_P 0x00f00000
-# define RADEON_ROP3_DPna 0x000a0000
-# define RADEON_ROP3_D 0x00aa0000
-# define RADEON_ROP3_DPx 0x005a0000
-# define RADEON_ROP3_DPo 0x00fa0000
-# define RADEON_ROP3_DPon 0x00050000
-# define RADEON_ROP3_PDxn 0x00a50000
-# define RADEON_ROP3_PDno 0x00f50000
-# define RADEON_ROP3_Pn 0x000f0000
-# define RADEON_ROP3_DPno 0x00af0000
-# define RADEON_ROP3_DPan 0x005f0000
-#define RADEON_DP_GUI_MASTER_CNTL_C 0x1c84
-#define RADEON_DP_MIX 0x16c8
-#define RADEON_DP_SRC_BKGD_CLR 0x15dc
-#define RADEON_DP_SRC_FRGD_CLR 0x15d8
-#define RADEON_DP_WRITE_MASK 0x16cc
-#define RADEON_DST_BRES_DEC 0x1630
-#define RADEON_DST_BRES_ERR 0x1628
-#define RADEON_DST_BRES_INC 0x162c
-#define RADEON_DST_BRES_LNTH 0x1634
-#define RADEON_DST_BRES_LNTH_SUB 0x1638
-#define RADEON_DST_HEIGHT 0x1410
-#define RADEON_DST_HEIGHT_WIDTH 0x143c
-#define RADEON_DST_HEIGHT_WIDTH_8 0x158c
-#define RADEON_DST_HEIGHT_WIDTH_BW 0x15b4
-#define RADEON_DST_HEIGHT_Y 0x15a0
-#define RADEON_DST_LINE_START 0x1600
-#define RADEON_DST_LINE_END 0x1604
-#define RADEON_DST_LINE_PATCOUNT 0x1608
-# define RADEON_BRES_CNTL_SHIFT 8
-#define RADEON_DST_OFFSET 0x1404
-#define RADEON_DST_PITCH 0x1408
-#define RADEON_DST_PITCH_OFFSET 0x142c
-#define RADEON_DST_PITCH_OFFSET_C 0x1c80
-# define RADEON_PITCH_SHIFT 21
-# define RADEON_DST_TILE_LINEAR (0 << 30)
-# define RADEON_DST_TILE_MACRO (1 << 30)
-# define RADEON_DST_TILE_MICRO (2 << 30)
-# define RADEON_DST_TILE_BOTH (3 << 30)
-#define RADEON_DST_WIDTH 0x140c
-#define RADEON_DST_WIDTH_HEIGHT 0x1598
-#define RADEON_DST_WIDTH_X 0x1588
-#define RADEON_DST_WIDTH_X_INCY 0x159c
-#define RADEON_DST_X 0x141c
-#define RADEON_DST_X_SUB 0x15a4
-#define RADEON_DST_X_Y 0x1594
-#define RADEON_DST_Y 0x1420
-#define RADEON_DST_Y_SUB 0x15a8
-#define RADEON_DST_Y_X 0x1438
-
-#define RADEON_FCP_CNTL 0x0910
-# define RADEON_FCP0_SRC_PCICLK 0
-# define RADEON_FCP0_SRC_PCLK 1
-# define RADEON_FCP0_SRC_PCLKb 2
-# define RADEON_FCP0_SRC_HREF 3
-# define RADEON_FCP0_SRC_GND 4
-# define RADEON_FCP0_SRC_HREFb 5
-#define RADEON_FLUSH_1 0x1704
-#define RADEON_FLUSH_2 0x1708
-#define RADEON_FLUSH_3 0x170c
-#define RADEON_FLUSH_4 0x1710
-#define RADEON_FLUSH_5 0x1714
-#define RADEON_FLUSH_6 0x1718
-#define RADEON_FLUSH_7 0x171c
-#define RADEON_FOG_3D_TABLE_START 0x1810
-#define RADEON_FOG_3D_TABLE_END 0x1814
-#define RADEON_FOG_3D_TABLE_DENSITY 0x181c
-#define RADEON_FOG_TABLE_INDEX 0x1a14
-#define RADEON_FOG_TABLE_DATA 0x1a18
-#define RADEON_FP_CRTC_H_TOTAL_DISP 0x0250
-#define RADEON_FP_CRTC_V_TOTAL_DISP 0x0254
-#define RADEON_FP_CRTC2_H_TOTAL_DISP 0x0350
-#define RADEON_FP_CRTC2_V_TOTAL_DISP 0x0354
-# define RADEON_FP_CRTC_H_TOTAL_MASK 0x000003ff
-# define RADEON_FP_CRTC_H_DISP_MASK 0x01ff0000
-# define RADEON_FP_CRTC_V_TOTAL_MASK 0x00000fff
-# define RADEON_FP_CRTC_V_DISP_MASK 0x0fff0000
-# define RADEON_FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8
-# define RADEON_FP_H_SYNC_WID_MASK 0x003f0000
-# define RADEON_FP_V_SYNC_STRT_MASK 0x00000fff
-# define RADEON_FP_V_SYNC_WID_MASK 0x001f0000
-# define RADEON_FP_CRTC_H_TOTAL_SHIFT 0x00000000
-# define RADEON_FP_CRTC_H_DISP_SHIFT 0x00000010
-# define RADEON_FP_CRTC_V_TOTAL_SHIFT 0x00000000
-# define RADEON_FP_CRTC_V_DISP_SHIFT 0x00000010
-# define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003
-# define RADEON_FP_H_SYNC_WID_SHIFT 0x00000010
-# define RADEON_FP_V_SYNC_STRT_SHIFT 0x00000000
-# define RADEON_FP_V_SYNC_WID_SHIFT 0x00000010
-#define RADEON_FP_GEN_CNTL 0x0284
-# define RADEON_FP_FPON (1 << 0)
-# define RADEON_FP_TMDS_EN (1 << 2)
-# define RADEON_FP_PANEL_FORMAT (1 << 3)
-# define RADEON_FP_EN_TMDS (1 << 7)
-# define RADEON_FP_DETECT_SENSE (1 << 8)
-# define RADEON_FP_SEL_CRTC2 (1 << 13)
-# define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15)
-# define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
-# define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17)
-# define RADEON_FP_CRTC_USE_SHADOW_VEND (1 << 18)
-# define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20)
-# define RADEON_FP_DFP_SYNC_SEL (1 << 21)
-# define RADEON_FP_CRTC_LOCK_8DOT (1 << 22)
-# define RADEON_FP_CRT_SYNC_SEL (1 << 23)
-# define RADEON_FP_USE_SHADOW_EN (1 << 24)
-# define RADEON_FP_CRT_SYNC_ALT (1 << 26)
-#define RADEON_FP2_GEN_CNTL 0x0288
-# define RADEON_FP2_BLANK_EN (1 << 1)
-# define RADEON_FP2_ON (1 << 2)
-# define RADEON_FP2_PANEL_FORMAT (1 << 3)
-# define RADEON_FP2_SOURCE_SEL_MASK (3 << 10)
-# define RADEON_FP2_SOURCE_SEL_CRTC2 (1 << 10)
-# define RADEON_FP2_SRC_SEL_MASK (3 << 13)
-# define RADEON_FP2_SRC_SEL_CRTC2 (1 << 13)
-# define RADEON_FP2_FP_POL (1 << 16)
-# define RADEON_FP2_LP_POL (1 << 17)
-# define RADEON_FP2_SCK_POL (1 << 18)
-# define RADEON_FP2_LCD_CNTL_MASK (7 << 19)
-# define RADEON_FP2_PAD_FLOP_EN (1 << 22)
-# define RADEON_FP2_CRC_EN (1 << 23)
-# define RADEON_FP2_CRC_READ_EN (1 << 24)
-# define RADEON_FP2_DV0_EN (1 << 25)
-# define RADEON_FP2_DV0_RATE_SEL_SDR (1 << 26)
-#define RADEON_FP_H_SYNC_STRT_WID 0x02c4
-#define RADEON_FP_H2_SYNC_STRT_WID 0x03c4
-#define RADEON_FP_HORZ_STRETCH 0x028c
-#define RADEON_FP_HORZ2_STRETCH 0x038c
-# define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff
-# define RADEON_HORZ_STRETCH_RATIO_MAX 4096
-# define RADEON_HORZ_PANEL_SIZE (0x1ff << 16)
-# define RADEON_HORZ_PANEL_SHIFT 16
-# define RADEON_HORZ_STRETCH_PIXREP (0 << 25)
-# define RADEON_HORZ_STRETCH_BLEND (1 << 26)
-# define RADEON_HORZ_STRETCH_ENABLE (1 << 25)
-# define RADEON_HORZ_AUTO_RATIO (1 << 27)
-# define RADEON_HORZ_FP_LOOP_STRETCH (0x7 << 28)
-# define RADEON_HORZ_AUTO_RATIO_INC (1 << 31)
-#define RADEON_FP_V_SYNC_STRT_WID 0x02c8
-#define RADEON_FP_VERT_STRETCH 0x0290
-#define RADEON_FP_V2_SYNC_STRT_WID 0x03c8
-#define RADEON_FP_VERT2_STRETCH 0x0390
-# define RADEON_VERT_PANEL_SIZE (0xfff << 12)
-# define RADEON_VERT_PANEL_SHIFT 12
-# define RADEON_VERT_STRETCH_RATIO_MASK 0xfff
-# define RADEON_VERT_STRETCH_RATIO_SHIFT 0
-# define RADEON_VERT_STRETCH_RATIO_MAX 4096
-# define RADEON_VERT_STRETCH_ENABLE (1 << 25)
-# define RADEON_VERT_STRETCH_LINEREP (0 << 26)
-# define RADEON_VERT_STRETCH_BLEND (1 << 26)
-# define RADEON_VERT_AUTO_RATIO_EN (1 << 27)
-# define RADEON_VERT_STRETCH_RESERVED 0xf1000000
-
-#define RADEON_GEN_INT_CNTL 0x0040
-#define RADEON_GEN_INT_STATUS 0x0044
-# define RADEON_VSYNC_INT_AK (1 << 2)
-# define RADEON_VSYNC_INT (1 << 2)
-# define RADEON_VSYNC2_INT_AK (1 << 6)
-# define RADEON_VSYNC2_INT (1 << 6)
-#define RADEON_GENENB 0x03c3 /* VGA */
-#define RADEON_GENFC_RD 0x03ca /* VGA */
-#define RADEON_GENFC_WT 0x03da /* VGA, 0x03ba */
-#define RADEON_GENMO_RD 0x03cc /* VGA */
-#define RADEON_GENMO_WT 0x03c2 /* VGA */
-#define RADEON_GENS0 0x03c2 /* VGA */
-#define RADEON_GENS1 0x03da /* VGA, 0x03ba */
-#define RADEON_GPIO_MONID 0x0068 /* DDC interface via I2C */
-#define RADEON_GPIO_MONIDB 0x006c
-#define RADEON_GPIO_CRT2_DDC 0x006c
-#define RADEON_GPIO_DVI_DDC 0x0064
-#define RADEON_GPIO_VGA_DDC 0x0060
-# define RADEON_GPIO_A_0 (1 << 0)
-# define RADEON_GPIO_A_1 (1 << 1)
-# define RADEON_GPIO_Y_0 (1 << 8)
-# define RADEON_GPIO_Y_1 (1 << 9)
-# define RADEON_GPIO_Y_SHIFT_0 8
-# define RADEON_GPIO_Y_SHIFT_1 9
-# define RADEON_GPIO_EN_0 (1 << 16)
-# define RADEON_GPIO_EN_1 (1 << 17)
-# define RADEON_GPIO_MASK_0 (1 << 24) /*??*/
-# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/
-#define RADEON_GRPH8_DATA 0x03cf /* VGA */
-#define RADEON_GRPH8_IDX 0x03ce /* VGA */
-#define RADEON_GUI_SCRATCH_REG0 0x15e0
-#define RADEON_GUI_SCRATCH_REG1 0x15e4
-#define RADEON_GUI_SCRATCH_REG2 0x15e8
-#define RADEON_GUI_SCRATCH_REG3 0x15ec
-#define RADEON_GUI_SCRATCH_REG4 0x15f0
-#define RADEON_GUI_SCRATCH_REG5 0x15f4
-
-#define RADEON_HEADER 0x0f0e /* PCI */
-#define RADEON_HOST_DATA0 0x17c0
-#define RADEON_HOST_DATA1 0x17c4
-#define RADEON_HOST_DATA2 0x17c8
-#define RADEON_HOST_DATA3 0x17cc
-#define RADEON_HOST_DATA4 0x17d0
-#define RADEON_HOST_DATA5 0x17d4
-#define RADEON_HOST_DATA6 0x17d8
-#define RADEON_HOST_DATA7 0x17dc
-#define RADEON_HOST_DATA_LAST 0x17e0
-#define RADEON_HOST_PATH_CNTL 0x0130
-# define RADEON_HDP_SOFT_RESET (1 << 26)
-#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */
-#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */
-
-#define RADEON_I2C_CNTL_1 0x0094 /* ? */
-#define RADEON_DVI_I2C_CNTL_1 0x02e4 /* ? */
-#define RADEON_INTERRUPT_LINE 0x0f3c /* PCI */
-#define RADEON_INTERRUPT_PIN 0x0f3d /* PCI */
-#define RADEON_IO_BASE 0x0f14 /* PCI */
-
-#define RADEON_LATENCY 0x0f0d /* PCI */
-#define RADEON_LEAD_BRES_DEC 0x1608
-#define RADEON_LEAD_BRES_LNTH 0x161c
-#define RADEON_LEAD_BRES_LNTH_SUB 0x1624
-#define RADEON_LVDS_GEN_CNTL 0x02d0
-# define RADEON_LVDS_ON (1 << 0)
-# define RADEON_LVDS_DISPLAY_DIS (1 << 1)
-# define RADEON_LVDS_PANEL_TYPE (1 << 2)
-# define RADEON_LVDS_PANEL_FORMAT (1 << 3)
-# define RADEON_LVDS_EN (1 << 7)
-# define RADEON_LVDS_DIGON (1 << 18)
-# define RADEON_LVDS_BLON (1 << 19)
-# define RADEON_LVDS_SEL_CRTC2 (1 << 23)
-#define RADEON_LVDS_PLL_CNTL 0x02d4
-# define RADEON_HSYNC_DELAY_SHIFT 28
-# define RADEON_HSYNC_DELAY_MASK (0xf << 28)
-
-#define RADEON_MAX_LATENCY 0x0f3f /* PCI */
-#define RADEON_MC_AGP_LOCATION 0x014c
-#define RADEON_MC_FB_LOCATION 0x0148
-#define RADEON_DISPLAY_BASE_ADDR 0x23c
-#define RADEON_DISPLAY2_BASE_ADDR 0x33c
-#define RADEON_OV0_BASE_ADDR 0x43c
-#define RADEON_NB_TOM 0x15c
-#define RADEON_MCLK_CNTL 0x0012 /* PLL */
-# define RADEON_FORCEON_MCLKA (1 << 16)
-# define RADEON_FORCEON_MCLKB (1 << 17)
-# define RADEON_FORCEON_YCLKA (1 << 18)
-# define RADEON_FORCEON_YCLKB (1 << 19)
-# define RADEON_FORCEON_MC (1 << 20)
-# define RADEON_FORCEON_AIC (1 << 21)
-#define RADEON_MDGPIO_A_REG 0x01ac
-#define RADEON_MDGPIO_EN_REG 0x01b0
-#define RADEON_MDGPIO_MASK 0x0198
-#define RADEON_MDGPIO_Y_REG 0x01b4
-#define RADEON_MEM_ADDR_CONFIG 0x0148
-#define RADEON_MEM_BASE 0x0f10 /* PCI */
-#define RADEON_MEM_CNTL 0x0140
-# define RADEON_MEM_NUM_CHANNELS_MASK 0x01
-# define RADEON_MEM_USE_B_CH_ONLY (1<<1)
-# define RV100_HALF_MODE (1<<3)
-# define R300_MEM_NUM_CHANNELS_MASK 0x03
-# define R300_MEM_USE_CD_CH_ONLY (1<<2)
-#define RADEON_MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */
-#define RADEON_MEM_INIT_LAT_TIMER 0x0154
-#define RADEON_MEM_INTF_CNTL 0x014c
-#define RADEON_MEM_SDRAM_MODE_REG 0x0158
-#define RADEON_MEM_STR_CNTL 0x0150
-#define RADEON_MEM_VGA_RP_SEL 0x003c
-#define RADEON_MEM_VGA_WP_SEL 0x0038
-#define RADEON_MIN_GRANT 0x0f3e /* PCI */
-#define RADEON_MM_DATA 0x0004
-#define RADEON_MM_INDEX 0x0000
-#define RADEON_MPLL_CNTL 0x000e /* PLL */
-#define RADEON_MPP_TB_CONFIG 0x01c0 /* ? */
-#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */
-#define R300_MC_IND_INDEX 0x01f8
-# define R300_MC_IND_ADDR_MASK 0x3f
-#define R300_MC_IND_DATA 0x01fc
-#define R300_MC_READ_CNTL_AB 0x017c
-# define R300_MEM_RBS_POSITION_A_MASK 0x03
-#define R300_MC_READ_CNTL_CD_mcind 0x24
-# define R300_MEM_RBS_POSITION_C_MASK 0x03
-
-#define RADEON_N_VIF_COUNT 0x0248
-
-#define RADEON_OV0_AUTO_FLIP_CNTL 0x0470
-#define RADEON_OV0_COLOUR_CNTL 0x04E0
-#define RADEON_OV0_DEINTERLACE_PATTERN 0x0474
-#define RADEON_OV0_EXCLUSIVE_HORZ 0x0408
-# define RADEON_EXCL_HORZ_START_MASK 0x000000ff
-# define RADEON_EXCL_HORZ_END_MASK 0x0000ff00
-# define RADEON_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000
-# define RADEON_EXCL_HORZ_EXCLUSIVE_EN 0x80000000
-#define RADEON_OV0_EXCLUSIVE_VERT 0x040C
-# define RADEON_EXCL_VERT_START_MASK 0x000003ff
-# define RADEON_EXCL_VERT_END_MASK 0x03ff0000
-#define RADEON_OV0_FILTER_CNTL 0x04A0
-#define RADEON_OV0_FOUR_TAP_COEF_0 0x04B0
-#define RADEON_OV0_FOUR_TAP_COEF_1 0x04B4
-#define RADEON_OV0_FOUR_TAP_COEF_2 0x04B8
-#define RADEON_OV0_FOUR_TAP_COEF_3 0x04BC
-#define RADEON_OV0_FOUR_TAP_COEF_4 0x04C0
-#define RADEON_OV0_GAMMA_000_00F 0x0d40
-#define RADEON_OV0_GAMMA_010_01F 0x0d44
-#define RADEON_OV0_GAMMA_020_03F 0x0d48
-#define RADEON_OV0_GAMMA_040_07F 0x0d4c
-#define RADEON_OV0_GAMMA_080_0BF 0x0e00
-#define RADEON_OV0_GAMMA_0C0_0FF 0x0e04
-#define RADEON_OV0_GAMMA_100_13F 0x0e08
-#define RADEON_OV0_GAMMA_140_17F 0x0e0c
-#define RADEON_OV0_GAMMA_180_1BF 0x0e10
-#define RADEON_OV0_GAMMA_1C0_1FF 0x0e14
-#define RADEON_OV0_GAMMA_200_23F 0x0e18
-#define RADEON_OV0_GAMMA_240_27F 0x0e1c
-#define RADEON_OV0_GAMMA_280_2BF 0x0e20
-#define RADEON_OV0_GAMMA_2C0_2FF 0x0e24
-#define RADEON_OV0_GAMMA_300_33F 0x0e28
-#define RADEON_OV0_GAMMA_340_37F 0x0e2c
-#define RADEON_OV0_GAMMA_380_3BF 0x0d50
-#define RADEON_OV0_GAMMA_3C0_3FF 0x0d54
-#define RADEON_OV0_GRAPHICS_KEY_CLR_LOW 0x04EC
-#define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH 0x04F0
-#define RADEON_OV0_H_INC 0x0480
-#define RADEON_OV0_KEY_CNTL 0x04F4
-# define RADEON_VIDEO_KEY_FN_MASK 0x00000003L
-# define RADEON_VIDEO_KEY_FN_FALSE 0x00000000L
-# define RADEON_VIDEO_KEY_FN_TRUE 0x00000001L
-# define RADEON_VIDEO_KEY_FN_EQ 0x00000002L
-# define RADEON_VIDEO_KEY_FN_NE 0x00000003L
-# define RADEON_GRAPHIC_KEY_FN_MASK 0x00000030L
-# define RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L
-# define RADEON_GRAPHIC_KEY_FN_TRUE 0x00000010L
-# define RADEON_GRAPHIC_KEY_FN_EQ 0x00000020L
-# define RADEON_GRAPHIC_KEY_FN_NE 0x00000030L
-# define RADEON_CMP_MIX_MASK 0x00000100L
-# define RADEON_CMP_MIX_OR 0x00000000L
-# define RADEON_CMP_MIX_AND 0x00000100L
-#define RADEON_OV0_LIN_TRANS_A 0x0d20
-#define RADEON_OV0_LIN_TRANS_B 0x0d24
-#define RADEON_OV0_LIN_TRANS_C 0x0d28
-#define RADEON_OV0_LIN_TRANS_D 0x0d2c
-#define RADEON_OV0_LIN_TRANS_E 0x0d30
-#define RADEON_OV0_LIN_TRANS_F 0x0d34
-#define RADEON_OV0_P1_BLANK_LINES_AT_TOP 0x0430
-# define RADEON_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL
-# define RADEON_P1_ACTIVE_LINES_M1 0x0fff0000L
-#define RADEON_OV0_P1_H_ACCUM_INIT 0x0488
-#define RADEON_OV0_P1_V_ACCUM_INIT 0x0428
-# define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L
-# define RADEON_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L
-#define RADEON_OV0_P1_X_START_END 0x0494
-#define RADEON_OV0_P2_X_START_END 0x0498
-#define RADEON_OV0_P23_BLANK_LINES_AT_TOP 0x0434
-# define RADEON_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL
-# define RADEON_P23_ACTIVE_LINES_M1 0x07ff0000L
-#define RADEON_OV0_P23_H_ACCUM_INIT 0x048C
-#define RADEON_OV0_P23_V_ACCUM_INIT 0x042C
-#define RADEON_OV0_P3_X_START_END 0x049C
-#define RADEON_OV0_REG_LOAD_CNTL 0x0410
-# define RADEON_REG_LD_CTL_LOCK 0x00000001L
-# define RADEON_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L
-# define RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L
-# define RADEON_REG_LD_CTL_LOCK_READBACK 0x00000008L
-#define RADEON_OV0_SCALE_CNTL 0x0420
-# define RADEON_SCALER_HORZ_PICK_NEAREST 0x00000004L
-# define RADEON_SCALER_VERT_PICK_NEAREST 0x00000008L
-# define RADEON_SCALER_SIGNED_UV 0x00000010L
-# define RADEON_SCALER_GAMMA_SEL_MASK 0x00000060L
-# define RADEON_SCALER_GAMMA_SEL_BRIGHT 0x00000000L
-# define RADEON_SCALER_GAMMA_SEL_G22 0x00000020L
-# define RADEON_SCALER_GAMMA_SEL_G18 0x00000040L
-# define RADEON_SCALER_GAMMA_SEL_G14 0x00000060L
-# define RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L
-# define RADEON_SCALER_SURFAC_FORMAT 0x00000f00L
-# define RADEON_SCALER_SOURCE_15BPP 0x00000300L
-# define RADEON_SCALER_SOURCE_16BPP 0x00000400L
-# define RADEON_SCALER_SOURCE_32BPP 0x00000600L
-# define RADEON_SCALER_SOURCE_YUV9 0x00000900L
-# define RADEON_SCALER_SOURCE_YUV12 0x00000A00L
-# define RADEON_SCALER_SOURCE_VYUY422 0x00000B00L
-# define RADEON_SCALER_SOURCE_YVYU422 0x00000C00L
-# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L
-# define RADEON_SCALER_TEMPORAL_DEINT 0x00002000L
-# define RADEON_SCALER_SMART_SWITCH 0x00008000L
-# define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L
-# define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L
-# define RADEON_SCALER_DIS_LIMIT 0x08000000L
-# define RADEON_SCALER_INT_EMU 0x20000000L
-# define RADEON_SCALER_ENABLE 0x40000000L
-# define RADEON_SCALER_SOFT_RESET 0x80000000L
-# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L
-#define RADEON_OV0_STEP_BY 0x0484
-#define RADEON_OV0_TEST 0x04F8
-#define RADEON_OV0_V_INC 0x0424
-#define RADEON_OV0_VID_BUF_PITCH0_VALUE 0x0460
-#define RADEON_OV0_VID_BUF_PITCH1_VALUE 0x0464
-#define RADEON_OV0_VID_BUF0_BASE_ADRS 0x0440
-# define RADEON_VIF_BUF0_PITCH_SEL 0x00000001L
-# define RADEON_VIF_BUF0_TILE_ADRS 0x00000002L
-# define RADEON_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L
-# define RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L
-#define RADEON_OV0_VID_BUF1_BASE_ADRS 0x0444
-# define RADEON_VIF_BUF1_PITCH_SEL 0x00000001L
-# define RADEON_VIF_BUF1_TILE_ADRS 0x00000002L
-# define RADEON_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L
-# define RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L
-#define RADEON_OV0_VID_BUF2_BASE_ADRS 0x0448
-# define RADEON_VIF_BUF2_PITCH_SEL 0x00000001L
-# define RADEON_VIF_BUF2_TILE_ADRS 0x00000002L
-# define RADEON_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L
-# define RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L
-#define RADEON_OV0_VID_BUF3_BASE_ADRS 0x044C
-#define RADEON_OV0_VID_BUF4_BASE_ADRS 0x0450
-#define RADEON_OV0_VID_BUF5_BASE_ADRS 0x0454
-#define RADEON_OV0_VIDEO_KEY_CLR_HIGH 0x04E8
-#define RADEON_OV0_VIDEO_KEY_CLR_LOW 0x04E4
-#define RADEON_OV0_Y_X_START 0x0400
-#define RADEON_OV0_Y_X_END 0x0404
-#define RADEON_OV1_Y_X_START 0x0600
-#define RADEON_OV1_Y_X_END 0x0604
-#define RADEON_OVR_CLR 0x0230
-#define RADEON_OVR_WID_LEFT_RIGHT 0x0234
-#define RADEON_OVR_WID_TOP_BOTTOM 0x0238
-
-#define RADEON_P2PLL_CNTL 0x002a /* P2PLL */
-# define RADEON_P2PLL_RESET (1 << 0)
-# define RADEON_P2PLL_SLEEP (1 << 1)
-# define RADEON_P2PLL_ATOMIC_UPDATE_EN (1 << 16)
-# define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
-# define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18)
-#define RADEON_P2PLL_DIV_0 0x002c
-# define RADEON_P2PLL_FB0_DIV_MASK 0x07ff
-# define RADEON_P2PLL_POST0_DIV_MASK 0x00070000
-#define RADEON_P2PLL_REF_DIV 0x002B /* PLL */
-# define RADEON_P2PLL_REF_DIV_MASK 0x03ff
-# define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
-# define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
-# define R300_PPLL_REF_DIV_ACC_MASK (0x3ff << 18)
-# define R300_PPLL_REF_DIV_ACC_SHIFT 18
-#define RADEON_PALETTE_DATA 0x00b4
-#define RADEON_PALETTE_30_DATA 0x00b8
-#define RADEON_PALETTE_INDEX 0x00b0
-#define RADEON_PCI_GART_PAGE 0x017c
-#define RADEON_PIXCLKS_CNTL 0x002d
-# define RADEON_PIX2CLK_SRC_SEL_MASK 0x03
-# define RADEON_PIX2CLK_SRC_SEL_CPUCLK 0x00
-# define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01
-# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02
-# define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03
-# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6)
-# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7)
-# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8)
-# define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14)
-# define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15)
-#define RADEON_PLANE_3D_MASK_C 0x1d44
-#define RADEON_PLL_TEST_CNTL 0x0013 /* PLL */
-#define RADEON_PMI_CAP_ID 0x0f5c /* PCI */
-#define RADEON_PMI_DATA 0x0f63 /* PCI */
-#define RADEON_PMI_NXT_CAP_PTR 0x0f5d /* PCI */
-#define RADEON_PMI_PMC_REG 0x0f5e /* PCI */
-#define RADEON_PMI_PMCSR_REG 0x0f60 /* PCI */
-#define RADEON_PMI_REGISTER 0x0f5c /* PCI */
-#define RADEON_PPLL_CNTL 0x0002 /* PLL */
-# define RADEON_PPLL_RESET (1 << 0)
-# define RADEON_PPLL_SLEEP (1 << 1)
-# define RADEON_PPLL_ATOMIC_UPDATE_EN (1 << 16)
-# define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
-# define RADEON_PPLL_ATOMIC_UPDATE_VSYNC (1 << 18)
-#define RADEON_PPLL_DIV_0 0x0004 /* PLL */
-#define RADEON_PPLL_DIV_1 0x0005 /* PLL */
-#define RADEON_PPLL_DIV_2 0x0006 /* PLL */
-#define RADEON_PPLL_DIV_3 0x0007 /* PLL */
-# define RADEON_PPLL_FB3_DIV_MASK 0x07ff
-# define RADEON_PPLL_POST3_DIV_MASK 0x00070000
-#define RADEON_PPLL_REF_DIV 0x0003 /* PLL */
-# define RADEON_PPLL_REF_DIV_MASK 0x03ff
-# define RADEON_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
-# define RADEON_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
-#define RADEON_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */
-
-#define RADEON_RBBM_GUICNTL 0x172c
-# define RADEON_HOST_DATA_SWAP_NONE (0 << 0)
-# define RADEON_HOST_DATA_SWAP_16BIT (1 << 0)
-# define RADEON_HOST_DATA_SWAP_32BIT (2 << 0)
-# define RADEON_HOST_DATA_SWAP_HDW (3 << 0)
-#define RADEON_RBBM_SOFT_RESET 0x00f0
-# define RADEON_SOFT_RESET_CP (1 << 0)
-# define RADEON_SOFT_RESET_HI (1 << 1)
-# define RADEON_SOFT_RESET_SE (1 << 2)
-# define RADEON_SOFT_RESET_RE (1 << 3)
-# define RADEON_SOFT_RESET_PP (1 << 4)
-# define RADEON_SOFT_RESET_E2 (1 << 5)
-# define RADEON_SOFT_RESET_RB (1 << 6)
-# define RADEON_SOFT_RESET_HDP (1 << 7)
-#define RADEON_RBBM_STATUS 0x0e40
-# define RADEON_RBBM_FIFOCNT_MASK 0x007f
-# define RADEON_RBBM_ACTIVE (1 << 31)
-#define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c
-# define RADEON_RB2D_DC_FLUSH (3 << 0)
-# define RADEON_RB2D_DC_FREE (3 << 2)
-# define RADEON_RB2D_DC_FLUSH_ALL 0xf
-# define RADEON_RB2D_DC_BUSY (1 << 31)
-#define RADEON_RB2D_DSTCACHE_MODE 0x3428
-#define RADEON_REG_BASE 0x0f18 /* PCI */
-#define RADEON_REGPROG_INF 0x0f09 /* PCI */
-#define RADEON_REVISION_ID 0x0f08 /* PCI */
-
-#define RADEON_SC_BOTTOM 0x164c
-#define RADEON_SC_BOTTOM_RIGHT 0x16f0
-#define RADEON_SC_BOTTOM_RIGHT_C 0x1c8c
-#define RADEON_SC_LEFT 0x1640
-#define RADEON_SC_RIGHT 0x1644
-#define RADEON_SC_TOP 0x1648
-#define RADEON_SC_TOP_LEFT 0x16ec
-#define RADEON_SC_TOP_LEFT_C 0x1c88
-# define RADEON_SC_SIGN_MASK_LO 0x8000
-# define RADEON_SC_SIGN_MASK_HI 0x80000000
-#define RADEON_SCLK_CNTL 0x000d /* PLL */
-# define RADEON_DYN_STOP_LAT_MASK 0x00007ff8
-# define RADEON_CP_MAX_DYN_STOP_LAT 0x0008
-# define RADEON_SCLK_FORCEON_MASK 0xffff8000
-#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */
-# define RADEON_SCLK_MORE_FORCEON 0x0700
-#define RADEON_SDRAM_MODE_REG 0x0158
-#define RADEON_SEQ8_DATA 0x03c5 /* VGA */
-#define RADEON_SEQ8_IDX 0x03c4 /* VGA */
-#define RADEON_SNAPSHOT_F_COUNT 0x0244
-#define RADEON_SNAPSHOT_VH_COUNTS 0x0240
-#define RADEON_SNAPSHOT_VIF_COUNT 0x024c
-#define RADEON_SRC_OFFSET 0x15ac
-#define RADEON_SRC_PITCH 0x15b0
-#define RADEON_SRC_PITCH_OFFSET 0x1428
-#define RADEON_SRC_SC_BOTTOM 0x165c
-#define RADEON_SRC_SC_BOTTOM_RIGHT 0x16f4
-#define RADEON_SRC_SC_RIGHT 0x1654
-#define RADEON_SRC_X 0x1414
-#define RADEON_SRC_X_Y 0x1590
-#define RADEON_SRC_Y 0x1418
-#define RADEON_SRC_Y_X 0x1434
-#define RADEON_STATUS 0x0f06 /* PCI */
-#define RADEON_SUBPIC_CNTL 0x0540 /* ? */
-#define RADEON_SUB_CLASS 0x0f0a /* PCI */
-#define RADEON_SURFACE_CNTL 0x0b00
-# define RADEON_SURF_TRANSLATION_DIS (1 << 8)
-# define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20)
-# define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21)
-#define RADEON_SURFACE0_INFO 0x0b0c
-# define RADEON_SURF_TILE_COLOR_MACRO (0 << 16)
-# define RADEON_SURF_TILE_COLOR_BOTH (1 << 16)
-# define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16)
-# define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16)
-# define R200_SURF_TILE_NONE (0 << 16)
-# define R200_SURF_TILE_COLOR_MACRO (1 << 16)
-# define R200_SURF_TILE_COLOR_MICRO (2 << 16)
-# define R200_SURF_TILE_COLOR_BOTH (3 << 16)
-# define R200_SURF_TILE_DEPTH_32BPP (4 << 16)
-# define R200_SURF_TILE_DEPTH_16BPP (5 << 16)
-# define RADEON_SURF_AP0_SWP_16BPP (1 << 20)
-# define RADEON_SURF_AP0_SWP_32BPP (1 << 21)
-# define RADEON_SURF_AP1_SWP_16BPP (1 << 22)
-# define RADEON_SURF_AP1_SWP_32BPP (1 << 23)
-#define RADEON_SURFACE0_LOWER_BOUND 0x0b04
-#define RADEON_SURFACE0_UPPER_BOUND 0x0b08
-#define RADEON_SURFACE1_INFO 0x0b1c
-#define RADEON_SURFACE1_LOWER_BOUND 0x0b14
-#define RADEON_SURFACE1_UPPER_BOUND 0x0b18
-#define RADEON_SURFACE2_INFO 0x0b2c
-#define RADEON_SURFACE2_LOWER_BOUND 0x0b24
-#define RADEON_SURFACE2_UPPER_BOUND 0x0b28
-#define RADEON_SURFACE3_INFO 0x0b3c
-#define RADEON_SURFACE3_LOWER_BOUND 0x0b34
-#define RADEON_SURFACE3_UPPER_BOUND 0x0b38
-#define RADEON_SURFACE4_INFO 0x0b4c
-#define RADEON_SURFACE4_LOWER_BOUND 0x0b44
-#define RADEON_SURFACE4_UPPER_BOUND 0x0b48
-#define RADEON_SURFACE5_INFO 0x0b5c
-#define RADEON_SURFACE5_LOWER_BOUND 0x0b54
-#define RADEON_SURFACE5_UPPER_BOUND 0x0b58
-#define RADEON_SURFACE6_INFO 0x0b6c
-#define RADEON_SURFACE6_LOWER_BOUND 0x0b64
-#define RADEON_SURFACE6_UPPER_BOUND 0x0b68
-#define RADEON_SURFACE7_INFO 0x0b7c
-#define RADEON_SURFACE7_LOWER_BOUND 0x0b74
-#define RADEON_SURFACE7_UPPER_BOUND 0x0b78
-#define RADEON_SW_SEMAPHORE 0x013c
-
-#define RADEON_TEST_DEBUG_CNTL 0x0120
-#define RADEON_TEST_DEBUG_MUX 0x0124
-#define RADEON_TEST_DEBUG_OUT 0x012c
-#define RADEON_TMDS_PLL_CNTL 0x02a8
-#define RADEON_TMDS_TRANSMITTER_CNTL 0x02a4
-# define RADEON_TMDS_TRANSMITTER_PLLEN 1
-# define RADEON_TMDS_TRANSMITTER_PLLRST 2
-#define RADEON_TRAIL_BRES_DEC 0x1614
-#define RADEON_TRAIL_BRES_ERR 0x160c
-#define RADEON_TRAIL_BRES_INC 0x1610
-#define RADEON_TRAIL_X 0x1618
-#define RADEON_TRAIL_X_SUB 0x1620
-
-#define RADEON_VCLK_ECP_CNTL 0x0008 /* PLL */
-# define RADEON_VCLK_SRC_SEL_MASK 0x03
-# define RADEON_VCLK_SRC_SEL_CPUCLK 0x00
-# define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01
-# define RADEON_VCLK_SRC_SEL_BYTECLK 0x02
-# define RADEON_VCLK_SRC_SEL_PPLLCLK 0x03
-# define RADEON_PIXCLK_ALWAYS_ONb (1<<6)
-# define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7)
-
-#define RADEON_VENDOR_ID 0x0f00 /* PCI */
-#define RADEON_VGA_DDA_CONFIG 0x02e8
-#define RADEON_VGA_DDA_ON_OFF 0x02ec
-#define RADEON_VID_BUFFER_CONTROL 0x0900
-#define RADEON_VIDEOMUX_CNTL 0x0190
-#define RADEON_VIPH_CONTROL 0x0c40 /* ? */
-
-#define RADEON_WAIT_UNTIL 0x1720
-# define RADEON_WAIT_CRTC_PFLIP (1 << 0)
-# define RADEON_WAIT_2D_IDLECLEAN (1 << 16)
-# define RADEON_WAIT_3D_IDLECLEAN (1 << 17)
-# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18)
-
-#define RADEON_X_MPLL_REF_FB_DIV 0x000a /* PLL */
-#define RADEON_XCLK_CNTL 0x000d /* PLL */
-#define RADEON_XDLL_CNTL 0x000c /* PLL */
-#define RADEON_XPLL_CNTL 0x000b /* PLL */
-
-
-
- /* Registers for 3D/TCL */
-#define RADEON_PP_BORDER_COLOR_0 0x1d40
-#define RADEON_PP_BORDER_COLOR_1 0x1d44
-#define RADEON_PP_BORDER_COLOR_2 0x1d48
-#define RADEON_PP_CNTL 0x1c38
-# define RADEON_STIPPLE_ENABLE (1 << 0)
-# define RADEON_SCISSOR_ENABLE (1 << 1)
-# define RADEON_PATTERN_ENABLE (1 << 2)
-# define RADEON_SHADOW_ENABLE (1 << 3)
-# define RADEON_TEX_ENABLE_MASK (0xf << 4)
-# define RADEON_TEX_0_ENABLE (1 << 4)
-# define RADEON_TEX_1_ENABLE (1 << 5)
-# define RADEON_TEX_2_ENABLE (1 << 6)
-# define RADEON_TEX_3_ENABLE (1 << 7)
-# define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12)
-# define RADEON_TEX_BLEND_0_ENABLE (1 << 12)
-# define RADEON_TEX_BLEND_1_ENABLE (1 << 13)
-# define RADEON_TEX_BLEND_2_ENABLE (1 << 14)
-# define RADEON_TEX_BLEND_3_ENABLE (1 << 15)
-# define RADEON_PLANAR_YUV_ENABLE (1 << 20)
-# define RADEON_SPECULAR_ENABLE (1 << 21)
-# define RADEON_FOG_ENABLE (1 << 22)
-# define RADEON_ALPHA_TEST_ENABLE (1 << 23)
-# define RADEON_ANTI_ALIAS_NONE (0 << 24)
-# define RADEON_ANTI_ALIAS_LINE (1 << 24)
-# define RADEON_ANTI_ALIAS_POLY (2 << 24)
-# define RADEON_ANTI_ALIAS_LINE_POLY (3 << 24)
-# define RADEON_BUMP_MAP_ENABLE (1 << 26)
-# define RADEON_BUMPED_MAP_T0 (0 << 27)
-# define RADEON_BUMPED_MAP_T1 (1 << 27)
-# define RADEON_BUMPED_MAP_T2 (2 << 27)
-# define RADEON_TEX_3D_ENABLE_0 (1 << 29)
-# define RADEON_TEX_3D_ENABLE_1 (1 << 30)
-# define RADEON_MC_ENABLE (1 << 31)
-#define RADEON_PP_FOG_COLOR 0x1c18
-# define RADEON_FOG_COLOR_MASK 0x00ffffff
-# define RADEON_FOG_VERTEX (0 << 24)
-# define RADEON_FOG_TABLE (1 << 24)
-# define RADEON_FOG_USE_DEPTH (0 << 25)
-# define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25)
-# define RADEON_FOG_USE_SPEC_ALPHA (3 << 25)
-#define RADEON_PP_LUM_MATRIX 0x1d00
-#define RADEON_PP_MISC 0x1c14
-# define RADEON_REF_ALPHA_MASK 0x000000ff
-# define RADEON_ALPHA_TEST_FAIL (0 << 8)
-# define RADEON_ALPHA_TEST_LESS (1 << 8)
-# define RADEON_ALPHA_TEST_LEQUAL (2 << 8)
-# define RADEON_ALPHA_TEST_EQUAL (3 << 8)
-# define RADEON_ALPHA_TEST_GEQUAL (4 << 8)
-# define RADEON_ALPHA_TEST_GREATER (5 << 8)
-# define RADEON_ALPHA_TEST_NEQUAL (6 << 8)
-# define RADEON_ALPHA_TEST_PASS (7 << 8)
-# define RADEON_ALPHA_TEST_OP_MASK (7 << 8)
-# define RADEON_CHROMA_FUNC_FAIL (0 << 16)
-# define RADEON_CHROMA_FUNC_PASS (1 << 16)
-# define RADEON_CHROMA_FUNC_NEQUAL (2 << 16)
-# define RADEON_CHROMA_FUNC_EQUAL (3 << 16)
-# define RADEON_CHROMA_KEY_NEAREST (0 << 18)
-# define RADEON_CHROMA_KEY_ZERO (1 << 18)
-# define RADEON_SHADOW_ID_AUTO_INC (1 << 20)
-# define RADEON_SHADOW_FUNC_EQUAL (0 << 21)
-# define RADEON_SHADOW_FUNC_NEQUAL (1 << 21)
-# define RADEON_SHADOW_PASS_1 (0 << 22)
-# define RADEON_SHADOW_PASS_2 (1 << 22)
-# define RADEON_RIGHT_HAND_CUBE_D3D (0 << 24)
-# define RADEON_RIGHT_HAND_CUBE_OGL (1 << 24)
-#define RADEON_PP_ROT_MATRIX_0 0x1d58
-#define RADEON_PP_ROT_MATRIX_1 0x1d5c
-#define RADEON_PP_TXFILTER_0 0x1c54
-#define RADEON_PP_TXFILTER_1 0x1c6c
-#define RADEON_PP_TXFILTER_2 0x1c84
-# define RADEON_MAG_FILTER_NEAREST (0 << 0)
-# define RADEON_MAG_FILTER_LINEAR (1 << 0)
-# define RADEON_MAG_FILTER_MASK (1 << 0)
-# define RADEON_MIN_FILTER_NEAREST (0 << 1)
-# define RADEON_MIN_FILTER_LINEAR (1 << 1)
-# define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1)
-# define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1)
-# define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1)
-# define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1)
-# define RADEON_MIN_FILTER_ANISO_NEAREST (8 << 1)
-# define RADEON_MIN_FILTER_ANISO_LINEAR (9 << 1)
-# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1)
-# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1)
-# define RADEON_MIN_FILTER_MASK (15 << 1)
-# define RADEON_MAX_ANISO_1_TO_1 (0 << 5)
-# define RADEON_MAX_ANISO_2_TO_1 (1 << 5)
-# define RADEON_MAX_ANISO_4_TO_1 (2 << 5)
-# define RADEON_MAX_ANISO_8_TO_1 (3 << 5)
-# define RADEON_MAX_ANISO_16_TO_1 (4 << 5)
-# define RADEON_MAX_ANISO_MASK (7 << 5)
-# define RADEON_LOD_BIAS_MASK (0xff << 8)
-# define RADEON_LOD_BIAS_SHIFT 8
-# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16)
-# define RADEON_MAX_MIP_LEVEL_SHIFT 16
-# define RADEON_YUV_TO_RGB (1 << 20)
-# define RADEON_YUV_TEMPERATURE_COOL (0 << 21)
-# define RADEON_YUV_TEMPERATURE_HOT (1 << 21)
-# define RADEON_YUV_TEMPERATURE_MASK (1 << 21)
-# define RADEON_WRAPEN_S (1 << 22)
-# define RADEON_CLAMP_S_WRAP (0 << 23)
-# define RADEON_CLAMP_S_MIRROR (1 << 23)
-# define RADEON_CLAMP_S_CLAMP_LAST (2 << 23)
-# define RADEON_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23)
-# define RADEON_CLAMP_S_CLAMP_BORDER (4 << 23)
-# define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23)
-# define RADEON_CLAMP_S_CLAMP_GL (6 << 23)
-# define RADEON_CLAMP_S_MIRROR_CLAMP_GL (7 << 23)
-# define RADEON_CLAMP_S_MASK (7 << 23)
-# define RADEON_WRAPEN_T (1 << 26)
-# define RADEON_CLAMP_T_WRAP (0 << 27)
-# define RADEON_CLAMP_T_MIRROR (1 << 27)
-# define RADEON_CLAMP_T_CLAMP_LAST (2 << 27)
-# define RADEON_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27)
-# define RADEON_CLAMP_T_CLAMP_BORDER (4 << 27)
-# define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27)
-# define RADEON_CLAMP_T_CLAMP_GL (6 << 27)
-# define RADEON_CLAMP_T_MIRROR_CLAMP_GL (7 << 27)
-# define RADEON_CLAMP_T_MASK (7 << 27)
-# define RADEON_BORDER_MODE_OGL (0 << 31)
-# define RADEON_BORDER_MODE_D3D (1 << 31)
-#define RADEON_PP_TXFORMAT_0 0x1c58
-#define RADEON_PP_TXFORMAT_1 0x1c70
-#define RADEON_PP_TXFORMAT_2 0x1c88
-# define RADEON_TXFORMAT_I8 (0 << 0)
-# define RADEON_TXFORMAT_AI88 (1 << 0)
-# define RADEON_TXFORMAT_RGB332 (2 << 0)
-# define RADEON_TXFORMAT_ARGB1555 (3 << 0)
-# define RADEON_TXFORMAT_RGB565 (4 << 0)
-# define RADEON_TXFORMAT_ARGB4444 (5 << 0)
-# define RADEON_TXFORMAT_ARGB8888 (6 << 0)
-# define RADEON_TXFORMAT_RGBA8888 (7 << 0)
-# define RADEON_TXFORMAT_Y8 (8 << 0)
-# define RADEON_TXFORMAT_VYUY422 (10 << 0)
-# define RADEON_TXFORMAT_YVYU422 (11 << 0)
-# define RADEON_TXFORMAT_DXT1 (12 << 0)
-# define RADEON_TXFORMAT_DXT23 (14 << 0)
-# define RADEON_TXFORMAT_DXT45 (15 << 0)
-# define RADEON_TXFORMAT_SHADOW16 (16 << 0)
-# define RADEON_TXFORMAT_SHADOW32 (17 << 0)
-# define RADEON_TXFORMAT_DUDV88 (18 << 0)
-# define RADEON_TXFORMAT_LDUDV655 (19 << 0)
-# define RADEON_TXFORMAT_LDUDUV8888 (20 << 0)
-# define RADEON_TXFORMAT_FORMAT_MASK (31 << 0)
-# define RADEON_TXFORMAT_FORMAT_SHIFT 0
-# define RADEON_TXFORMAT_APPLE_YUV_MODE (1 << 5)
-# define RADEON_TXFORMAT_ALPHA_IN_MAP (1 << 6)
-# define RADEON_TXFORMAT_NON_POWER2 (1 << 7)
-# define RADEON_TXFORMAT_WIDTH_MASK (15 << 8)
-# define RADEON_TXFORMAT_WIDTH_SHIFT 8
-# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12)
-# define RADEON_TXFORMAT_HEIGHT_SHIFT 12
-# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16)
-# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16
-# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20)
-# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20
-# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24)
-# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24)
-# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24)
-# define RADEON_TXFORMAT_ST_ROUTE_STQ2 (2 << 24)
-# define RADEON_TXFORMAT_ENDIAN_NO_SWAP (0 << 26)
-# define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26)
-# define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26)
-# define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26)
-# define RADEON_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
-# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
-# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
-# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31)
-#define RADEON_PP_CUBIC_FACES_0 0x1d24
-#define RADEON_PP_CUBIC_FACES_1 0x1d28
-#define RADEON_PP_CUBIC_FACES_2 0x1d2c
-# define RADEON_FACE_WIDTH_1_SHIFT 0
-# define RADEON_FACE_HEIGHT_1_SHIFT 4
-# define RADEON_FACE_WIDTH_1_MASK (0xf << 0)
-# define RADEON_FACE_HEIGHT_1_MASK (0xf << 4)
-# define RADEON_FACE_WIDTH_2_SHIFT 8
-# define RADEON_FACE_HEIGHT_2_SHIFT 12
-# define RADEON_FACE_WIDTH_2_MASK (0xf << 8)
-# define RADEON_FACE_HEIGHT_2_MASK (0xf << 12)
-# define RADEON_FACE_WIDTH_3_SHIFT 16
-# define RADEON_FACE_HEIGHT_3_SHIFT 20
-# define RADEON_FACE_WIDTH_3_MASK (0xf << 16)
-# define RADEON_FACE_HEIGHT_3_MASK (0xf << 20)
-# define RADEON_FACE_WIDTH_4_SHIFT 24
-# define RADEON_FACE_HEIGHT_4_SHIFT 28
-# define RADEON_FACE_WIDTH_4_MASK (0xf << 24)
-# define RADEON_FACE_HEIGHT_4_MASK (0xf << 28)
-
-#define RADEON_PP_TXOFFSET_0 0x1c5c
-#define RADEON_PP_TXOFFSET_1 0x1c74
-#define RADEON_PP_TXOFFSET_2 0x1c8c
-# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0)
-# define RADEON_TXO_ENDIAN_BYTE_SWAP (1 << 0)
-# define RADEON_TXO_ENDIAN_WORD_SWAP (2 << 0)
-# define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
-# define RADEON_TXO_MACRO_LINEAR (0 << 2)
-# define RADEON_TXO_MACRO_TILE (1 << 2)
-# define RADEON_TXO_MICRO_LINEAR (0 << 3)
-# define RADEON_TXO_MICRO_TILE_X2 (1 << 3)
-# define RADEON_TXO_MICRO_TILE_OPT (2 << 3)
-# define RADEON_TXO_OFFSET_MASK 0xffffffe0
-# define RADEON_TXO_OFFSET_SHIFT 5
-
-#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */
-#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4
-#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8
-#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc
-#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0
-#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00
-#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04
-#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08
-#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c
-#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10
-#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14
-#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18
-#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c
-#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20
-#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24
-
-#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */
-#define RADEON_PP_TEX_SIZE_1 0x1d0c
-#define RADEON_PP_TEX_SIZE_2 0x1d14
-# define RADEON_TEX_USIZE_MASK (0x7ff << 0)
-# define RADEON_TEX_USIZE_SHIFT 0
-# define RADEON_TEX_VSIZE_MASK (0x7ff << 16)
-# define RADEON_TEX_VSIZE_SHIFT 16
-# define RADEON_SIGNED_RGB_MASK (1 << 30)
-# define RADEON_SIGNED_RGB_SHIFT 30
-# define RADEON_SIGNED_ALPHA_MASK (1 << 31)
-# define RADEON_SIGNED_ALPHA_SHIFT 31
-#define RADEON_PP_TEX_PITCH_0 0x1d08 /* NPOT */
-#define RADEON_PP_TEX_PITCH_1 0x1d10 /* NPOT */
-#define RADEON_PP_TEX_PITCH_2 0x1d18 /* NPOT */
-/* note: bits 13-5: 32 byte aligned stride of texture map */
-
-#define RADEON_PP_TXCBLEND_0 0x1c60
-#define RADEON_PP_TXCBLEND_1 0x1c78
-#define RADEON_PP_TXCBLEND_2 0x1c90
-# define RADEON_COLOR_ARG_A_SHIFT 0
-# define RADEON_COLOR_ARG_A_MASK (0x1f << 0)
-# define RADEON_COLOR_ARG_A_ZERO (0 << 0)
-# define RADEON_COLOR_ARG_A_CURRENT_COLOR (2 << 0)
-# define RADEON_COLOR_ARG_A_CURRENT_ALPHA (3 << 0)
-# define RADEON_COLOR_ARG_A_DIFFUSE_COLOR (4 << 0)
-# define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0)
-# define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6 << 0)
-# define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7 << 0)
-# define RADEON_COLOR_ARG_A_TFACTOR_COLOR (8 << 0)
-# define RADEON_COLOR_ARG_A_TFACTOR_ALPHA (9 << 0)
-# define RADEON_COLOR_ARG_A_T0_COLOR (10 << 0)
-# define RADEON_COLOR_ARG_A_T0_ALPHA (11 << 0)
-# define RADEON_COLOR_ARG_A_T1_COLOR (12 << 0)
-# define RADEON_COLOR_ARG_A_T1_ALPHA (13 << 0)
-# define RADEON_COLOR_ARG_A_T2_COLOR (14 << 0)
-# define RADEON_COLOR_ARG_A_T2_ALPHA (15 << 0)
-# define RADEON_COLOR_ARG_A_T3_COLOR (16 << 0)
-# define RADEON_COLOR_ARG_A_T3_ALPHA (17 << 0)
-# define RADEON_COLOR_ARG_B_SHIFT 5
-# define RADEON_COLOR_ARG_B_MASK (0x1f << 5)
-# define RADEON_COLOR_ARG_B_ZERO (0 << 5)
-# define RADEON_COLOR_ARG_B_CURRENT_COLOR (2 << 5)
-# define RADEON_COLOR_ARG_B_CURRENT_ALPHA (3 << 5)
-# define RADEON_COLOR_ARG_B_DIFFUSE_COLOR (4 << 5)
-# define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5)
-# define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6 << 5)
-# define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7 << 5)
-# define RADEON_COLOR_ARG_B_TFACTOR_COLOR (8 << 5)
-# define RADEON_COLOR_ARG_B_TFACTOR_ALPHA (9 << 5)
-# define RADEON_COLOR_ARG_B_T0_COLOR (10 << 5)
-# define RADEON_COLOR_ARG_B_T0_ALPHA (11 << 5)
-# define RADEON_COLOR_ARG_B_T1_COLOR (12 << 5)
-# define RADEON_COLOR_ARG_B_T1_ALPHA (13 << 5)
-# define RADEON_COLOR_ARG_B_T2_COLOR (14 << 5)
-# define RADEON_COLOR_ARG_B_T2_ALPHA (15 << 5)
-# define RADEON_COLOR_ARG_B_T3_COLOR (16 << 5)
-# define RADEON_COLOR_ARG_B_T3_ALPHA (17 << 5)
-# define RADEON_COLOR_ARG_C_SHIFT 10
-# define RADEON_COLOR_ARG_C_MASK (0x1f << 10)
-# define RADEON_COLOR_ARG_C_ZERO (0 << 10)
-# define RADEON_COLOR_ARG_C_CURRENT_COLOR (2 << 10)
-# define RADEON_COLOR_ARG_C_CURRENT_ALPHA (3 << 10)
-# define RADEON_COLOR_ARG_C_DIFFUSE_COLOR (4 << 10)
-# define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10)
-# define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6 << 10)
-# define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7 << 10)
-# define RADEON_COLOR_ARG_C_TFACTOR_COLOR (8 << 10)
-# define RADEON_COLOR_ARG_C_TFACTOR_ALPHA (9 << 10)
-# define RADEON_COLOR_ARG_C_T0_COLOR (10 << 10)
-# define RADEON_COLOR_ARG_C_T0_ALPHA (11 << 10)
-# define RADEON_COLOR_ARG_C_T1_COLOR (12 << 10)
-# define RADEON_COLOR_ARG_C_T1_ALPHA (13 << 10)
-# define RADEON_COLOR_ARG_C_T2_COLOR (14 << 10)
-# define RADEON_COLOR_ARG_C_T2_ALPHA (15 << 10)
-# define RADEON_COLOR_ARG_C_T3_COLOR (16 << 10)
-# define RADEON_COLOR_ARG_C_T3_ALPHA (17 << 10)
-# define RADEON_COMP_ARG_A (1 << 15)
-# define RADEON_COMP_ARG_A_SHIFT 15
-# define RADEON_COMP_ARG_B (1 << 16)
-# define RADEON_COMP_ARG_B_SHIFT 16
-# define RADEON_COMP_ARG_C (1 << 17)
-# define RADEON_COMP_ARG_C_SHIFT 17
-# define RADEON_BLEND_CTL_MASK (7 << 18)
-# define RADEON_BLEND_CTL_ADD (0 << 18)
-# define RADEON_BLEND_CTL_SUBTRACT (1 << 18)
-# define RADEON_BLEND_CTL_ADDSIGNED (2 << 18)
-# define RADEON_BLEND_CTL_BLEND (3 << 18)
-# define RADEON_BLEND_CTL_DOT3 (4 << 18)
-# define RADEON_SCALE_SHIFT 21
-# define RADEON_SCALE_MASK (3 << 21)
-# define RADEON_SCALE_1X (0 << 21)
-# define RADEON_SCALE_2X (1 << 21)
-# define RADEON_SCALE_4X (2 << 21)
-# define RADEON_CLAMP_TX (1 << 23)
-# define RADEON_T0_EQ_TCUR (1 << 24)
-# define RADEON_T1_EQ_TCUR (1 << 25)
-# define RADEON_T2_EQ_TCUR (1 << 26)
-# define RADEON_T3_EQ_TCUR (1 << 27)
-# define RADEON_COLOR_ARG_MASK 0x1f
-# define RADEON_COMP_ARG_SHIFT 15
-#define RADEON_PP_TXABLEND_0 0x1c64
-#define RADEON_PP_TXABLEND_1 0x1c7c
-#define RADEON_PP_TXABLEND_2 0x1c94
-# define RADEON_ALPHA_ARG_A_SHIFT 0
-# define RADEON_ALPHA_ARG_A_MASK (0xf << 0)
-# define RADEON_ALPHA_ARG_A_ZERO (0 << 0)
-# define RADEON_ALPHA_ARG_A_CURRENT_ALPHA (1 << 0)
-# define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0)
-# define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0)
-# define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0)
-# define RADEON_ALPHA_ARG_A_T0_ALPHA (5 << 0)
-# define RADEON_ALPHA_ARG_A_T1_ALPHA (6 << 0)
-# define RADEON_ALPHA_ARG_A_T2_ALPHA (7 << 0)
-# define RADEON_ALPHA_ARG_A_T3_ALPHA (8 << 0)
-# define RADEON_ALPHA_ARG_B_SHIFT 4
-# define RADEON_ALPHA_ARG_B_MASK (0xf << 4)
-# define RADEON_ALPHA_ARG_B_ZERO (0 << 4)
-# define RADEON_ALPHA_ARG_B_CURRENT_ALPHA (1 << 4)
-# define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4)
-# define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4)
-# define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4)
-# define RADEON_ALPHA_ARG_B_T0_ALPHA (5 << 4)
-# define RADEON_ALPHA_ARG_B_T1_ALPHA (6 << 4)
-# define RADEON_ALPHA_ARG_B_T2_ALPHA (7 << 4)
-# define RADEON_ALPHA_ARG_B_T3_ALPHA (8 << 4)
-# define RADEON_ALPHA_ARG_C_SHIFT 8
-# define RADEON_ALPHA_ARG_C_MASK (0xf << 8)
-# define RADEON_ALPHA_ARG_C_ZERO (0 << 8)
-# define RADEON_ALPHA_ARG_C_CURRENT_ALPHA (1 << 8)
-# define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8)
-# define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8)
-# define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8)
-# define RADEON_ALPHA_ARG_C_T0_ALPHA (5 << 8)
-# define RADEON_ALPHA_ARG_C_T1_ALPHA (6 << 8)
-# define RADEON_ALPHA_ARG_C_T2_ALPHA (7 << 8)
-# define RADEON_ALPHA_ARG_C_T3_ALPHA (8 << 8)
-# define RADEON_DOT_ALPHA_DONT_REPLICATE (1 << 9)
-# define RADEON_ALPHA_ARG_MASK 0xf
-
-#define RADEON_PP_TFACTOR_0 0x1c68
-#define RADEON_PP_TFACTOR_1 0x1c80
-#define RADEON_PP_TFACTOR_2 0x1c98
-
-#define RADEON_RB3D_BLENDCNTL 0x1c20
-# define RADEON_COMB_FCN_MASK (3 << 12)
-# define RADEON_COMB_FCN_ADD_CLAMP (0 << 12)
-# define RADEON_COMB_FCN_ADD_NOCLAMP (1 << 12)
-# define RADEON_COMB_FCN_SUB_CLAMP (2 << 12)
-# define RADEON_COMB_FCN_SUB_NOCLAMP (3 << 12)
-# define RADEON_SRC_BLEND_GL_ZERO (32 << 16)
-# define RADEON_SRC_BLEND_GL_ONE (33 << 16)
-# define RADEON_SRC_BLEND_GL_SRC_COLOR (34 << 16)
-# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)
-# define RADEON_SRC_BLEND_GL_DST_COLOR (36 << 16)
-# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)
-# define RADEON_SRC_BLEND_GL_SRC_ALPHA (38 << 16)
-# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)
-# define RADEON_SRC_BLEND_GL_DST_ALPHA (40 << 16)
-# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)
-# define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16)
-# define RADEON_SRC_BLEND_MASK (63 << 16)
-# define RADEON_DST_BLEND_GL_ZERO (32 << 24)
-# define RADEON_DST_BLEND_GL_ONE (33 << 24)
-# define RADEON_DST_BLEND_GL_SRC_COLOR (34 << 24)
-# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)
-# define RADEON_DST_BLEND_GL_DST_COLOR (36 << 24)
-# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)
-# define RADEON_DST_BLEND_GL_SRC_ALPHA (38 << 24)
-# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)
-# define RADEON_DST_BLEND_GL_DST_ALPHA (40 << 24)
-# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)
-# define RADEON_DST_BLEND_MASK (63 << 24)
-#define RADEON_RB3D_CNTL 0x1c3c
-# define RADEON_ALPHA_BLEND_ENABLE (1 << 0)
-# define RADEON_PLANE_MASK_ENABLE (1 << 1)
-# define RADEON_DITHER_ENABLE (1 << 2)
-# define RADEON_ROUND_ENABLE (1 << 3)
-# define RADEON_SCALE_DITHER_ENABLE (1 << 4)
-# define RADEON_DITHER_INIT (1 << 5)
-# define RADEON_ROP_ENABLE (1 << 6)
-# define RADEON_STENCIL_ENABLE (1 << 7)
-# define RADEON_Z_ENABLE (1 << 8)
-# define RADEON_DEPTH_XZ_OFFEST_ENABLE (1 << 9)
-# define RADEON_COLOR_FORMAT_ARGB1555 (3 << 10)
-# define RADEON_COLOR_FORMAT_RGB565 (4 << 10)
-# define RADEON_COLOR_FORMAT_ARGB8888 (6 << 10)
-# define RADEON_COLOR_FORMAT_RGB332 (7 << 10)
-# define RADEON_COLOR_FORMAT_Y8 (8 << 10)
-# define RADEON_COLOR_FORMAT_RGB8 (9 << 10)
-# define RADEON_COLOR_FORMAT_YUV422_VYUY (11 << 10)
-# define RADEON_COLOR_FORMAT_YUV422_YVYU (12 << 10)
-# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10)
-# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10)
-# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14)
-# define RADEON_ZBLOCK16 (1 << 15)
-#define RADEON_RB3D_COLOROFFSET 0x1c40
-# define RADEON_COLOROFFSET_MASK 0xfffffff0
-#define RADEON_RB3D_COLORPITCH 0x1c48
-# define RADEON_COLORPITCH_MASK 0x000001ff8
-# define RADEON_COLOR_TILE_ENABLE (1 << 16)
-# define RADEON_COLOR_MICROTILE_ENABLE (1 << 17)
-# define RADEON_COLOR_ENDIAN_NO_SWAP (0 << 18)
-# define RADEON_COLOR_ENDIAN_WORD_SWAP (1 << 18)
-# define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18)
-#define RADEON_RB3D_DEPTHOFFSET 0x1c24
-#define RADEON_RB3D_DEPTHPITCH 0x1c28
-# define RADEON_DEPTHPITCH_MASK 0x00001ff8
-# define RADEON_DEPTH_HYPERZ (3 << 16)
-# define RADEON_DEPTH_ENDIAN_NO_SWAP (0 << 18)
-# define RADEON_DEPTH_ENDIAN_WORD_SWAP (1 << 18)
-# define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18)
-#define RADEON_RB3D_PLANEMASK 0x1d84
-#define RADEON_RB3D_ROPCNTL 0x1d80
-# define RADEON_ROP_MASK (15 << 8)
-# define RADEON_ROP_CLEAR (0 << 8)
-# define RADEON_ROP_NOR (1 << 8)
-# define RADEON_ROP_AND_INVERTED (2 << 8)
-# define RADEON_ROP_COPY_INVERTED (3 << 8)
-# define RADEON_ROP_AND_REVERSE (4 << 8)
-# define RADEON_ROP_INVERT (5 << 8)
-# define RADEON_ROP_XOR (6 << 8)
-# define RADEON_ROP_NAND (7 << 8)
-# define RADEON_ROP_AND (8 << 8)
-# define RADEON_ROP_EQUIV (9 << 8)
-# define RADEON_ROP_NOOP (10 << 8)
-# define RADEON_ROP_OR_INVERTED (11 << 8)
-# define RADEON_ROP_COPY (12 << 8)
-# define RADEON_ROP_OR_REVERSE (13 << 8)
-# define RADEON_ROP_OR (14 << 8)
-# define RADEON_ROP_SET (15 << 8)
-#define RADEON_RB3D_STENCILREFMASK 0x1d7c
-# define RADEON_STENCIL_REF_SHIFT 0
-# define RADEON_STENCIL_REF_MASK (0xff << 0)
-# define RADEON_STENCIL_MASK_SHIFT 16
-# define RADEON_STENCIL_VALUE_MASK (0xff << 16)
-# define RADEON_STENCIL_WRITEMASK_SHIFT 24
-# define RADEON_STENCIL_WRITE_MASK (0xff << 24)
-#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c
-# define RADEON_DEPTH_FORMAT_MASK (0xf << 0)
-# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
-# define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
-# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0)
-# define RADEON_DEPTH_FORMAT_32BIT_INT_Z (4 << 0)
-# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0)
-# define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0)
-# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0)
-# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0)
-# define RADEON_Z_TEST_NEVER (0 << 4)
-# define RADEON_Z_TEST_LESS (1 << 4)
-# define RADEON_Z_TEST_LEQUAL (2 << 4)
-# define RADEON_Z_TEST_EQUAL (3 << 4)
-# define RADEON_Z_TEST_GEQUAL (4 << 4)
-# define RADEON_Z_TEST_GREATER (5 << 4)
-# define RADEON_Z_TEST_NEQUAL (6 << 4)
-# define RADEON_Z_TEST_ALWAYS (7 << 4)
-# define RADEON_Z_TEST_MASK (7 << 4)
-# define RADEON_Z_HIERARCHY_ENABLE (1 << 8)
-# define RADEON_STENCIL_TEST_NEVER (0 << 12)
-# define RADEON_STENCIL_TEST_LESS (1 << 12)
-# define RADEON_STENCIL_TEST_LEQUAL (2 << 12)
-# define RADEON_STENCIL_TEST_EQUAL (3 << 12)
-# define RADEON_STENCIL_TEST_GEQUAL (4 << 12)
-# define RADEON_STENCIL_TEST_GREATER (5 << 12)
-# define RADEON_STENCIL_TEST_NEQUAL (6 << 12)
-# define RADEON_STENCIL_TEST_ALWAYS (7 << 12)
-# define RADEON_STENCIL_TEST_MASK (0x7 << 12)
-# define RADEON_STENCIL_FAIL_KEEP (0 << 16)
-# define RADEON_STENCIL_FAIL_ZERO (1 << 16)
-# define RADEON_STENCIL_FAIL_REPLACE (2 << 16)
-# define RADEON_STENCIL_FAIL_INC (3 << 16)
-# define RADEON_STENCIL_FAIL_DEC (4 << 16)
-# define RADEON_STENCIL_FAIL_INVERT (5 << 16)
-# define RADEON_STENCIL_FAIL_INC_WRAP (6 << 16)
-# define RADEON_STENCIL_FAIL_DEC_WRAP (7 << 16)
-# define RADEON_STENCIL_FAIL_MASK (0x7 << 16)
-# define RADEON_STENCIL_ZPASS_KEEP (0 << 20)
-# define RADEON_STENCIL_ZPASS_ZERO (1 << 20)
-# define RADEON_STENCIL_ZPASS_REPLACE (2 << 20)
-# define RADEON_STENCIL_ZPASS_INC (3 << 20)
-# define RADEON_STENCIL_ZPASS_DEC (4 << 20)
-# define RADEON_STENCIL_ZPASS_INVERT (5 << 20)
-# define RADEON_STENCIL_ZPASS_INC_WRAP (6 << 20)
-# define RADEON_STENCIL_ZPASS_DEC_WRAP (7 << 20)
-# define RADEON_STENCIL_ZPASS_MASK (0x7 << 20)
-# define RADEON_STENCIL_ZFAIL_KEEP (0 << 24)
-# define RADEON_STENCIL_ZFAIL_ZERO (1 << 24)
-# define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24)
-# define RADEON_STENCIL_ZFAIL_INC (3 << 24)
-# define RADEON_STENCIL_ZFAIL_DEC (4 << 24)
-# define RADEON_STENCIL_ZFAIL_INVERT (5 << 24)
-# define RADEON_STENCIL_ZFAIL_INC_WRAP (6 << 24)
-# define RADEON_STENCIL_ZFAIL_DEC_WRAP (7 << 24)
-# define RADEON_STENCIL_ZFAIL_MASK (0x7 << 24)
-# define RADEON_Z_COMPRESSION_ENABLE (1 << 28)
-# define RADEON_FORCE_Z_DIRTY (1 << 29)
-# define RADEON_Z_WRITE_ENABLE (1 << 30)
-# define RADEON_Z_DECOMPRESSION_ENABLE (1 << 31)
-#define RADEON_RE_LINE_PATTERN 0x1cd0
-# define RADEON_LINE_PATTERN_MASK 0x0000ffff
-# define RADEON_LINE_REPEAT_COUNT_SHIFT 16
-# define RADEON_LINE_PATTERN_START_SHIFT 24
-# define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28)
-# define RADEON_LINE_PATTERN_BIG_BIT_ORDER (1 << 28)
-# define RADEON_LINE_PATTERN_AUTO_RESET (1 << 29)
-#define RADEON_RE_LINE_STATE 0x1cd4
-# define RADEON_LINE_CURRENT_PTR_SHIFT 0
-# define RADEON_LINE_CURRENT_COUNT_SHIFT 8
-#define RADEON_RE_MISC 0x26c4
-# define RADEON_STIPPLE_COORD_MASK 0x1f
-# define RADEON_STIPPLE_X_OFFSET_SHIFT 0
-# define RADEON_STIPPLE_X_OFFSET_MASK (0x1f << 0)
-# define RADEON_STIPPLE_Y_OFFSET_SHIFT 8
-# define RADEON_STIPPLE_Y_OFFSET_MASK (0x1f << 8)
-# define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16)
-# define RADEON_STIPPLE_BIG_BIT_ORDER (1 << 16)
-#define RADEON_RE_SOLID_COLOR 0x1c1c
-#define RADEON_RE_TOP_LEFT 0x26c0
-# define RADEON_RE_LEFT_SHIFT 0
-# define RADEON_RE_TOP_SHIFT 16
-#define RADEON_RE_WIDTH_HEIGHT 0x1c44
-# define RADEON_RE_WIDTH_SHIFT 0
-# define RADEON_RE_HEIGHT_SHIFT 16
-
-#define RADEON_SE_CNTL 0x1c4c
-# define RADEON_FFACE_CULL_CW (0 << 0)
-# define RADEON_FFACE_CULL_CCW (1 << 0)
-# define RADEON_FFACE_CULL_DIR_MASK (1 << 0)
-# define RADEON_BFACE_CULL (0 << 1)
-# define RADEON_BFACE_SOLID (3 << 1)
-# define RADEON_FFACE_CULL (0 << 3)
-# define RADEON_FFACE_SOLID (3 << 3)
-# define RADEON_FFACE_CULL_MASK (3 << 3)
-# define RADEON_BADVTX_CULL_DISABLE (1 << 5)
-# define RADEON_FLAT_SHADE_VTX_0 (0 << 6)
-# define RADEON_FLAT_SHADE_VTX_1 (1 << 6)
-# define RADEON_FLAT_SHADE_VTX_2 (2 << 6)
-# define RADEON_FLAT_SHADE_VTX_LAST (3 << 6)
-# define RADEON_DIFFUSE_SHADE_SOLID (0 << 8)
-# define RADEON_DIFFUSE_SHADE_FLAT (1 << 8)
-# define RADEON_DIFFUSE_SHADE_GOURAUD (2 << 8)
-# define RADEON_DIFFUSE_SHADE_MASK (3 << 8)
-# define RADEON_ALPHA_SHADE_SOLID (0 << 10)
-# define RADEON_ALPHA_SHADE_FLAT (1 << 10)
-# define RADEON_ALPHA_SHADE_GOURAUD (2 << 10)
-# define RADEON_ALPHA_SHADE_MASK (3 << 10)
-# define RADEON_SPECULAR_SHADE_SOLID (0 << 12)
-# define RADEON_SPECULAR_SHADE_FLAT (1 << 12)
-# define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12)
-# define RADEON_SPECULAR_SHADE_MASK (3 << 12)
-# define RADEON_FOG_SHADE_SOLID (0 << 14)
-# define RADEON_FOG_SHADE_FLAT (1 << 14)
-# define RADEON_FOG_SHADE_GOURAUD (2 << 14)
-# define RADEON_FOG_SHADE_MASK (3 << 14)
-# define RADEON_ZBIAS_ENABLE_POINT (1 << 16)
-# define RADEON_ZBIAS_ENABLE_LINE (1 << 17)
-# define RADEON_ZBIAS_ENABLE_TRI (1 << 18)
-# define RADEON_WIDELINE_ENABLE (1 << 20)
-# define RADEON_VPORT_XY_XFORM_ENABLE (1 << 24)
-# define RADEON_VPORT_Z_XFORM_ENABLE (1 << 25)
-# define RADEON_VTX_PIX_CENTER_D3D (0 << 27)
-# define RADEON_VTX_PIX_CENTER_OGL (1 << 27)
-# define RADEON_ROUND_MODE_TRUNC (0 << 28)
-# define RADEON_ROUND_MODE_ROUND (1 << 28)
-# define RADEON_ROUND_MODE_ROUND_EVEN (2 << 28)
-# define RADEON_ROUND_MODE_ROUND_ODD (3 << 28)
-# define RADEON_ROUND_PREC_16TH_PIX (0 << 30)
-# define RADEON_ROUND_PREC_8TH_PIX (1 << 30)
-# define RADEON_ROUND_PREC_4TH_PIX (2 << 30)
-# define RADEON_ROUND_PREC_HALF_PIX (3 << 30)
-#define RADEON_SE_CNTL_STATUS 0x2140
-# define RADEON_VC_NO_SWAP (0 << 0)
-# define RADEON_VC_16BIT_SWAP (1 << 0)
-# define RADEON_VC_32BIT_SWAP (2 << 0)
-# define RADEON_VC_HALF_DWORD_SWAP (3 << 0)
-# define RADEON_TCL_BYPASS (1 << 8)
-#define RADEON_SE_COORD_FMT 0x1c50
-# define RADEON_VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0)
-# define RADEON_VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1)
-# define RADEON_VTX_ST0_NONPARAMETRIC (1 << 8)
-# define RADEON_VTX_ST1_NONPARAMETRIC (1 << 9)
-# define RADEON_VTX_ST2_NONPARAMETRIC (1 << 10)
-# define RADEON_VTX_ST3_NONPARAMETRIC (1 << 11)
-# define RADEON_VTX_W0_NORMALIZE (1 << 12)
-# define RADEON_VTX_W0_IS_NOT_1_OVER_W0 (1 << 16)
-# define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17)
-# define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19)
-# define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21)
-# define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23)
-# define RADEON_TEX1_W_ROUTING_USE_W0 (0 << 26)
-# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26)
-#define RADEON_SE_LINE_WIDTH 0x1db8
-#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c
-# define RADEON_LIGHTING_ENABLE (1 << 0)
-# define RADEON_LIGHT_IN_MODELSPACE (1 << 1)
-# define RADEON_LOCAL_VIEWER (1 << 2)
-# define RADEON_NORMALIZE_NORMALS (1 << 3)
-# define RADEON_RESCALE_NORMALS (1 << 4)
-# define RADEON_SPECULAR_LIGHTS (1 << 5)
-# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6)
-# define RADEON_LIGHT_ALPHA (1 << 7)
-# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8)
-# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9)
-# define RADEON_LM_SOURCE_STATE_PREMULT 0
-# define RADEON_LM_SOURCE_STATE_MULT 1
-# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2
-# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3
-# define RADEON_EMISSIVE_SOURCE_SHIFT 16
-# define RADEON_AMBIENT_SOURCE_SHIFT 18
-# define RADEON_DIFFUSE_SOURCE_SHIFT 20
-# define RADEON_SPECULAR_SOURCE_SHIFT 22
-#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220
-#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224
-#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228
-#define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c
-#define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED 0x2230
-#define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234
-#define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238
-#define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c
-#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210
-#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214
-#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218
-#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c
-#define RADEON_SE_TCL_MATERIAL_SPECULAR_RED 0x2240
-#define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244
-#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248
-#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c
-#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c
-# define RADEON_MODELVIEW_0_SHIFT 0
-# define RADEON_MODELVIEW_1_SHIFT 4
-# define RADEON_MODELVIEW_2_SHIFT 8
-# define RADEON_MODELVIEW_3_SHIFT 12
-# define RADEON_IT_MODELVIEW_0_SHIFT 16
-# define RADEON_IT_MODELVIEW_1_SHIFT 20
-# define RADEON_IT_MODELVIEW_2_SHIFT 24
-# define RADEON_IT_MODELVIEW_3_SHIFT 28
-#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260
-# define RADEON_MODELPROJECT_0_SHIFT 0
-# define RADEON_MODELPROJECT_1_SHIFT 4
-# define RADEON_MODELPROJECT_2_SHIFT 8
-# define RADEON_MODELPROJECT_3_SHIFT 12
-# define RADEON_TEXMAT_0_SHIFT 16
-# define RADEON_TEXMAT_1_SHIFT 20
-# define RADEON_TEXMAT_2_SHIFT 24
-# define RADEON_TEXMAT_3_SHIFT 28
-
-
-#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254
-# define RADEON_TCL_VTX_W0 (1 << 0)
-# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1)
-# define RADEON_TCL_VTX_FP_ALPHA (1 << 2)
-# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3)
-# define RADEON_TCL_VTX_FP_SPEC (1 << 4)
-# define RADEON_TCL_VTX_FP_FOG (1 << 5)
-# define RADEON_TCL_VTX_PK_SPEC (1 << 6)
-# define RADEON_TCL_VTX_ST0 (1 << 7)
-# define RADEON_TCL_VTX_ST1 (1 << 8)
-# define RADEON_TCL_VTX_Q1 (1 << 9)
-# define RADEON_TCL_VTX_ST2 (1 << 10)
-# define RADEON_TCL_VTX_Q2 (1 << 11)
-# define RADEON_TCL_VTX_ST3 (1 << 12)
-# define RADEON_TCL_VTX_Q3 (1 << 13)
-# define RADEON_TCL_VTX_Q0 (1 << 14)
-# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15
-# define RADEON_TCL_VTX_NORM0 (1 << 18)
-# define RADEON_TCL_VTX_XY1 (1 << 27)
-# define RADEON_TCL_VTX_Z1 (1 << 28)
-# define RADEON_TCL_VTX_W1 (1 << 29)
-# define RADEON_TCL_VTX_NORM1 (1 << 30)
-# define RADEON_TCL_VTX_Z0 (1 << 31)
-
-#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258
-# define RADEON_TCL_COMPUTE_XYZW (1 << 0)
-# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1)
-# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2)
-# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3)
-# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4)
-# define RADEON_TCL_TEX_INPUT_TEX_0 0
-# define RADEON_TCL_TEX_INPUT_TEX_1 1
-# define RADEON_TCL_TEX_INPUT_TEX_2 2
-# define RADEON_TCL_TEX_INPUT_TEX_3 3
-# define RADEON_TCL_TEX_COMPUTED_TEX_0 8
-# define RADEON_TCL_TEX_COMPUTED_TEX_1 9
-# define RADEON_TCL_TEX_COMPUTED_TEX_2 10
-# define RADEON_TCL_TEX_COMPUTED_TEX_3 11
-# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16
-# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20
-# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24
-# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28
-
-#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270
-# define RADEON_LIGHT_0_ENABLE (1 << 0)
-# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1)
-# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2)
-# define RADEON_LIGHT_0_IS_LOCAL (1 << 3)
-# define RADEON_LIGHT_0_IS_SPOT (1 << 4)
-# define RADEON_LIGHT_0_DUAL_CONE (1 << 5)
-# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6)
-# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7)
-# define RADEON_LIGHT_0_SHIFT 0
-# define RADEON_LIGHT_1_ENABLE (1 << 16)
-# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17)
-# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18)
-# define RADEON_LIGHT_1_IS_LOCAL (1 << 19)
-# define RADEON_LIGHT_1_IS_SPOT (1 << 20)
-# define RADEON_LIGHT_1_DUAL_CONE (1 << 21)
-# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22)
-# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23)
-# define RADEON_LIGHT_1_SHIFT 16
-#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274
-# define RADEON_LIGHT_2_SHIFT 0
-# define RADEON_LIGHT_3_SHIFT 16
-#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278
-# define RADEON_LIGHT_4_SHIFT 0
-# define RADEON_LIGHT_5_SHIFT 16
-#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c
-# define RADEON_LIGHT_6_SHIFT 0
-# define RADEON_LIGHT_7_SHIFT 16
-
-#define RADEON_SE_TCL_SHININESS 0x2250
-
-#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268
-# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0)
-# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1)
-# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2)
-# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3)
-# define RADEON_TEXMAT_0_ENABLE (1 << 4)
-# define RADEON_TEXMAT_1_ENABLE (1 << 5)
-# define RADEON_TEXMAT_2_ENABLE (1 << 6)
-# define RADEON_TEXMAT_3_ENABLE (1 << 7)
-# define RADEON_TEXGEN_INPUT_MASK 0xf
-# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0
-# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1
-# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2
-# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3
-# define RADEON_TEXGEN_INPUT_OBJ 4
-# define RADEON_TEXGEN_INPUT_EYE 5
-# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6
-# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7
-# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8
-# define RADEON_TEXGEN_0_INPUT_SHIFT 16
-# define RADEON_TEXGEN_1_INPUT_SHIFT 20
-# define RADEON_TEXGEN_2_INPUT_SHIFT 24
-# define RADEON_TEXGEN_3_INPUT_SHIFT 28
-
-#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264
-# define RADEON_UCP_IN_CLIP_SPACE (1 << 0)
-# define RADEON_UCP_IN_MODEL_SPACE (1 << 1)
-# define RADEON_UCP_ENABLE_0 (1 << 2)
-# define RADEON_UCP_ENABLE_1 (1 << 3)
-# define RADEON_UCP_ENABLE_2 (1 << 4)
-# define RADEON_UCP_ENABLE_3 (1 << 5)
-# define RADEON_UCP_ENABLE_4 (1 << 6)
-# define RADEON_UCP_ENABLE_5 (1 << 7)
-# define RADEON_TCL_FOG_MASK (3 << 8)
-# define RADEON_TCL_FOG_DISABLE (0 << 8)
-# define RADEON_TCL_FOG_EXP (1 << 8)
-# define RADEON_TCL_FOG_EXP2 (2 << 8)
-# define RADEON_TCL_FOG_LINEAR (3 << 8)
-# define RADEON_RNG_BASED_FOG (1 << 10)
-# define RADEON_LIGHT_TWOSIDE (1 << 11)
-# define RADEON_BLEND_OP_COUNT_MASK (7 << 12)
-# define RADEON_BLEND_OP_COUNT_SHIFT 12
-# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16)
-# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17)
-# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (1 << 18)
-# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18)
-# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (1 << 19)
-# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19)
-# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (1 << 20)
-# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20)
-# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (1 << 21)
-# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21)
-# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22)
-# define RADEON_CULL_FRONT_IS_CW (0 << 28)
-# define RADEON_CULL_FRONT_IS_CCW (1 << 28)
-# define RADEON_CULL_FRONT (1 << 29)
-# define RADEON_CULL_BACK (1 << 30)
-# define RADEON_FORCE_W_TO_ONE (1 << 31)
-
-#define RADEON_SE_VPORT_XSCALE 0x1d98
-#define RADEON_SE_VPORT_XOFFSET 0x1d9c
-#define RADEON_SE_VPORT_YSCALE 0x1da0
-#define RADEON_SE_VPORT_YOFFSET 0x1da4
-#define RADEON_SE_VPORT_ZSCALE 0x1da8
-#define RADEON_SE_VPORT_ZOFFSET 0x1dac
-#define RADEON_SE_ZBIAS_FACTOR 0x1db0
-#define RADEON_SE_ZBIAS_CONSTANT 0x1db4
-
-
-
- /* Registers for CP and Microcode Engine */
-#define RADEON_CP_ME_RAM_ADDR 0x07d4
-#define RADEON_CP_ME_RAM_RADDR 0x07d8
-#define RADEON_CP_ME_RAM_DATAH 0x07dc
-#define RADEON_CP_ME_RAM_DATAL 0x07e0
-
-#define RADEON_CP_RB_BASE 0x0700
-#define RADEON_CP_RB_CNTL 0x0704
-#define RADEON_CP_RB_RPTR_ADDR 0x070c
-#define RADEON_CP_RB_RPTR 0x0710
-#define RADEON_CP_RB_WPTR 0x0714
-
-#define RADEON_CP_IB_BASE 0x0738
-#define RADEON_CP_IB_BUFSZ 0x073c
-
-#define RADEON_CP_CSQ_CNTL 0x0740
-# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0)
-# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28)
-# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28)
-# define RADEON_CSQ_PRIBM_INDDIS (2 << 28)
-# define RADEON_CSQ_PRIPIO_INDBM (3 << 28)
-# define RADEON_CSQ_PRIBM_INDBM (4 << 28)
-# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28)
-#define RADEON_CP_CSQ_STAT 0x07f8
-# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0)
-# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8)
-# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16)
-# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24)
-#define RADEON_CP_CSQ_ADDR 0x07f0
-#define RADEON_CP_CSQ_DATA 0x07f4
-#define RADEON_CP_CSQ_APER_PRIMARY 0x1000
-#define RADEON_CP_CSQ_APER_INDIRECT 0x1300
-
-#define RADEON_CP_RB_WPTR_DELAY 0x0718
-# define RADEON_PRE_WRITE_TIMER_SHIFT 0
-# define RADEON_PRE_WRITE_LIMIT_SHIFT 23
-
-#define RADEON_AIC_CNTL 0x01d0
-# define RADEON_PCIGART_TRANSLATE_EN (1 << 0)
-#define RADEON_AIC_LO_ADDR 0x01dc
-
-
-
- /* Constants */
-#define RADEON_LAST_FRAME_REG RADEON_GUI_SCRATCH_REG0
-#define RADEON_LAST_CLEAR_REG RADEON_GUI_SCRATCH_REG2
-
-
-
- /* CP packet types */
-#define RADEON_CP_PACKET0 0x00000000
-#define RADEON_CP_PACKET1 0x40000000
-#define RADEON_CP_PACKET2 0x80000000
-#define RADEON_CP_PACKET3 0xC0000000
-# define RADEON_CP_PACKET_MASK 0xC0000000
-# define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000
-# define RADEON_CP_PACKET_MAX_DWORDS (1 << 12)
-# define RADEON_CP_PACKET0_REG_MASK 0x000007ff
-# define RADEON_CP_PACKET1_REG0_MASK 0x000007ff
-# define RADEON_CP_PACKET1_REG1_MASK 0x003ff800
-
-#define RADEON_CP_PACKET0_ONE_REG_WR 0x00008000
-
-#define RADEON_CP_PACKET3_NOP 0xC0001000
-#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900
-#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00
-#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00
-#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300
-#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400
-#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600
-#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800
-#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900
-#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00
-#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00
-#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00
-#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100
-#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200
-#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300
-#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400
-#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500
-#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800
-#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00
-#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00
-#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00
-
-
-#define RADEON_CP_VC_FRMT_XY 0x00000000
-#define RADEON_CP_VC_FRMT_W0 0x00000001
-#define RADEON_CP_VC_FRMT_FPCOLOR 0x00000002
-#define RADEON_CP_VC_FRMT_FPALPHA 0x00000004
-#define RADEON_CP_VC_FRMT_PKCOLOR 0x00000008
-#define RADEON_CP_VC_FRMT_FPSPEC 0x00000010
-#define RADEON_CP_VC_FRMT_FPFOG 0x00000020
-#define RADEON_CP_VC_FRMT_PKSPEC 0x00000040
-#define RADEON_CP_VC_FRMT_ST0 0x00000080
-#define RADEON_CP_VC_FRMT_ST1 0x00000100
-#define RADEON_CP_VC_FRMT_Q1 0x00000200
-#define RADEON_CP_VC_FRMT_ST2 0x00000400
-#define RADEON_CP_VC_FRMT_Q2 0x00000800
-#define RADEON_CP_VC_FRMT_ST3 0x00001000
-#define RADEON_CP_VC_FRMT_Q3 0x00002000
-#define RADEON_CP_VC_FRMT_Q0 0x00004000
-#define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK 0x00038000
-#define RADEON_CP_VC_FRMT_N0 0x00040000
-#define RADEON_CP_VC_FRMT_XY1 0x08000000
-#define RADEON_CP_VC_FRMT_Z1 0x10000000
-#define RADEON_CP_VC_FRMT_W1 0x20000000
-#define RADEON_CP_VC_FRMT_N1 0x40000000
-#define RADEON_CP_VC_FRMT_Z 0x80000000
-
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE 0x00000000
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT 0x00000001
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE 0x00000002
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP 0x00000003
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2 0x00000007
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST 0x00000008
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009
-#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST 0x0000000a
-#define RADEON_CP_VC_CNTL_PRIM_WALK_IND 0x00000010
-#define RADEON_CP_VC_CNTL_PRIM_WALK_LIST 0x00000020
-#define RADEON_CP_VC_CNTL_PRIM_WALK_RING 0x00000030
-#define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA 0x00000000
-#define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA 0x00000040
-#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080
-#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000
-#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100
-#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000
-#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200
-#define RADEON_CP_VC_CNTL_NUM_SHIFT 16
-
-#define RADEON_VS_MATRIX_0_ADDR 0
-#define RADEON_VS_MATRIX_1_ADDR 4
-#define RADEON_VS_MATRIX_2_ADDR 8
-#define RADEON_VS_MATRIX_3_ADDR 12
-#define RADEON_VS_MATRIX_4_ADDR 16
-#define RADEON_VS_MATRIX_5_ADDR 20
-#define RADEON_VS_MATRIX_6_ADDR 24
-#define RADEON_VS_MATRIX_7_ADDR 28
-#define RADEON_VS_MATRIX_8_ADDR 32
-#define RADEON_VS_MATRIX_9_ADDR 36
-#define RADEON_VS_MATRIX_10_ADDR 40
-#define RADEON_VS_MATRIX_11_ADDR 44
-#define RADEON_VS_MATRIX_12_ADDR 48
-#define RADEON_VS_MATRIX_13_ADDR 52
-#define RADEON_VS_MATRIX_14_ADDR 56
-#define RADEON_VS_MATRIX_15_ADDR 60
-#define RADEON_VS_LIGHT_AMBIENT_ADDR 64
-#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72
-#define RADEON_VS_LIGHT_SPECULAR_ADDR 80
-#define RADEON_VS_LIGHT_DIRPOS_ADDR 88
-#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96
-#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104
-#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112
-#define RADEON_VS_UCP_ADDR 116
-#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122
-#define RADEON_VS_FOG_PARAM_ADDR 123
-#define RADEON_VS_EYE_VECTOR_ADDR 124
-
-#define RADEON_SS_LIGHT_DCD_ADDR 0
-#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8
-#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16
-#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24
-#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32
-#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48
-#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49
-#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50
-#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51
-#define RADEON_SS_SHININESS 60
-
-#define RADEON_TV_MASTER_CNTL 0x0800
-# define RADEON_TVCLK_ALWAYS_ONb (1 << 30)
-#define RADEON_TV_DAC_CNTL 0x088c
-# define RADEON_TV_DAC_CMPOUT (1 << 5)
-#define RADEON_TV_PRE_DAC_MUX_CNTL 0x0888
-# define RADEON_Y_RED_EN (1 << 0)
-# define RADEON_C_GRN_EN (1 << 1)
-# define RADEON_CMP_BLU_EN (1 << 2)
-# define RADEON_RED_MX_FORCE_DAC_DATA (6 << 4)
-# define RADEON_GRN_MX_FORCE_DAC_DATA (6 << 8)
-# define RADEON_BLU_MX_FORCE_DAC_DATA (6 << 12)
-# define RADEON_TV_FORCE_DAC_DATA_SHIFT 16
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/Makefile
deleted file mode 100644
index 9bd797315..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# src/mesa/drivers/dri/s3v/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = s3v_dri.so
-
-# Doesn't exist yet.
-#MINIGLX_SOURCES = server/savage_dri.c
-
-DRIVER_SOURCES = \
- s3v_context.c \
- s3v_dd.c \
- s3v_inithw.c \
- s3v_lock.c \
- s3v_render.c \
- s3v_screen.c \
- s3v_span.c \
- s3v_state.c \
- s3v_tex.c \
- s3v_texmem.c \
- s3v_texstate.c \
- s3v_tris.c \
- s3v_vb.c \
- s3v_xmesa.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_common.h
deleted file mode 100644
index b66cdf1df..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_common.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-/* WARNING: If you change any of these defines, make sure to change
- * the kernel include file as well (s3v_drm.h)
- */
-
-#ifndef _XF86DRI_S3V_H_
-#define _XF86DRI_S3V_H_
-
-#ifndef _S3V_DEFINES_
-#define _S3V_DEFINES_
-#define S3V_USE_BATCH 1
-
-/* #define S3V_BUF_4K 1 */
-
-#ifdef S3V_BUF_4K
-#define S3V_DMA_BUF_ORDER 12
-#define S3V_DMA_BUF_NR 256
-#else
-#define S3V_DMA_BUF_ORDER 16 /* -much- better */
-#define S3V_DMA_BUF_NR 16
-#endif
-/* on s3virge you can only choose between *
- * 4k (2^12) and 64k (2^16) dma bufs */
-#define S3V_DMA_BUF_SZ (1<<S3V_DMA_BUF_ORDER)
-
-#define S3V_NR_SAREA_CLIPRECTS 8
-
-/* Each region is a minimum of 16k (64*64@4bpp)
- * and there are at most 40 of them.
- */
-#define S3V_NR_TEX_REGIONS 64 /* was 40 */
-#define S3V_LOG_TEX_GRANULARITY 16 /* was 4 */
-/* 40 * (2 ^ 4) = 640k, that's all we have for tex on 4mb gfx card */
-/* FIXME: will it work with card with less than 4mb? */
-/* FIXME: we should set this at run time */
-
-#endif /* _S3V_DEFINES */
-
-/*
- * WARNING: If you change any of these defines, make sure to change
- * the kernel include file as well (gamma_drm.h)
- */
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_S3V_INIT_DMA 0x00
-#define DRM_S3V_CLEANUP_DMA 0x01
-
-typedef struct _drmS3VInit {
- enum {
- S3V_INIT_DMA = 0x01,
- S3V_CLEANUP_DMA = 0x02
- } func;
-
- unsigned int pcimode; /* bool: 1=pci 0=agp */
-
- unsigned int mmio_offset;
- unsigned int buffers_offset;
- unsigned int sarea_priv_offset;
-
- unsigned int front_offset;
- unsigned int front_width;
- unsigned int front_height;
- unsigned int front_pitch;
-
- unsigned int back_offset;
- unsigned int back_width;
- unsigned int back_height;
- unsigned int back_pitch;
-
- unsigned int depth_offset;
- unsigned int depth_width;
- unsigned int depth_height;
- unsigned int depth_pitch;
-
- unsigned int texture_offset;
-} drmS3VInit;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.c
deleted file mode 100644
index 7b0aa0dae..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "s3v_context.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "context.h"
-#include "simple_list.h"
-#include "matrix.h"
-#include "extensions.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-#include "simple_list.h"
-#include "mm.h"
-
-#include "drivers/common/driverfuncs.h"
-#include "s3v_vb.h"
-#include "s3v_tris.h"
-
-#if 0
-extern const struct tnl_pipeline_stage _s3v_render_stage;
-
-static const struct tnl_pipeline_stage *s3v_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
-#if 1
- &_s3v_render_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
- 0,
-};
-#endif
-
-GLboolean s3vCreateContext(const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- s3vContextPtr vmesa;
- s3vScreenPtr s3vScrn;
- S3VSAREAPtr saPriv=(S3VSAREAPtr)(((char*)sPriv->pSAREA) +
- sizeof(drm_sarea_t));
- struct dd_function_table functions;
-
- DEBUG_WHERE(("*** s3vCreateContext ***\n"));
-
- vmesa = (s3vContextPtr) CALLOC( sizeof(*vmesa) );
- if ( !vmesa ) return GL_FALSE;
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((s3vContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- _mesa_init_driver_functions(&functions);
-
- vmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions,
- (void *)vmesa);
- if (!vmesa->glCtx) {
- FREE(vmesa);
- return GL_FALSE;
- }
-
- vmesa->driContext = driContextPriv;
- vmesa->driScreen = sPriv;
- vmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */
-
- vmesa->hHWContext = driContextPriv->hHWContext;
- vmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock;
- vmesa->driFd = sPriv->fd;
- vmesa->sarea = saPriv;
-
- s3vScrn = vmesa->s3vScreen = (s3vScreenPtr)(sPriv->private);
-
- ctx = vmesa->glCtx;
-
- ctx->Const.MaxTextureLevels = 11; /* it is (11-1) -> 1024 * 1024 FIXME */
-
- ctx->Const.MaxTextureUnits = 1; /* FIXME: or 2 ? */
-
- /* No wide points.
- */
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
-
- /* No wide lines.
- */
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 1.0;
- ctx->Const.MaxLineWidthAA = 1.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- vmesa->texHeap = mmInit( 0, vmesa->s3vScreen->textureSize );
- DEBUG(("vmesa->s3vScreen->textureSize = 0x%x\n",
- vmesa->s3vScreen->textureSize));
-
- /* NOTE */
- /* mmInit(offset, size); */
-
- /* allocates a structure like this:
-
- struct mem_block_t {
- struct mem_block_t *next;
- struct mem_block_t *heap;
- int ofs,size;
- int align;
- int free:1;
- int reserved:1;
- };
-
- */
-
- make_empty_list(&vmesa->TexObjList);
- make_empty_list(&vmesa->SwappedOut);
-
- vmesa->CurrentTexObj[0] = 0;
- vmesa->CurrentTexObj[1] = 0; /* FIXME */
-
- vmesa->RenderIndex = ~0;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
-#if 0
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, s3v_pipeline );
-#endif
- /* Configure swrast to match hardware characteristics:
- */
-#if 0
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
-#endif
- vmesa->_3d_mode = 0;
-
- /* 3D lines / gouraud tris */
- vmesa->CMD = ( AUTO_EXEC_ON | HW_CLIP_ON | DEST_COL_1555
- | FOG_OFF | ALPHA_OFF | Z_OFF | Z_UPDATE_OFF
- | Z_LESS | TEX_WRAP_ON | TEX_MODULATE | LINEAR
- | TEX_COL_ARGB1555 | CMD_3D );
-
- vmesa->_alpha[0] = vmesa->_alpha[1] = ALPHA_OFF;
- vmesa->alpha_cmd = vmesa->_alpha[0];
- vmesa->_tri[0] = DO_GOURAUD_TRI;
- vmesa->_tri[1] = DO_TEX_LIT_TRI;
- vmesa->prim_cmd = vmesa->_tri[0];
-
- /* printf("first vmesa->CMD = 0x%x\n", vmesa->CMD); */
-
- vmesa->TexOffset = vmesa->s3vScreen->texOffset;
-
- s3vInitVB( ctx );
- s3vInitExtensions( ctx );
- s3vInitDriverFuncs( ctx );
- s3vInitStateFuncs( ctx );
- s3vInitSpanFuncs( ctx );
- s3vInitTextureFuncs( ctx );
- s3vInitTriFuncs( ctx );
- s3vInitState( vmesa );
-
- driContextPriv->driverPrivate = (void *)vmesa;
-
- /* HACK */
- vmesa->bufSize = S3V_DMA_BUF_SZ;
-
- DEBUG(("vmesa->bufSize = %i\n", vmesa->bufSize));
- DEBUG(("vmesa->bufCount = %i\n", vmesa->bufCount));
-
-
- /* dma init */
- DEBUG_BUFS(("GET_FIRST_DMA\n"));
-
- vmesa->_bufNum = 0;
-
- GET_FIRST_DMA(vmesa->driFd, vmesa->hHWContext,
- 1, &(vmesa->bufIndex[0]), &(vmesa->bufSize),
- &vmesa->_buf[0], &vmesa->bufCount, s3vScrn);
-
- GET_FIRST_DMA(vmesa->driFd, vmesa->hHWContext,
- 1, &(vmesa->bufIndex[1]), &(vmesa->bufSize),
- &vmesa->_buf[1], &vmesa->bufCount, s3vScrn);
-
- vmesa->buf = vmesa->_buf[vmesa->_bufNum];
-
-/*
- vmesa->CMD = (AUTO_EXEC_ON | HW_CLIP_ON | DEST_COL_1555
- | FOG_OFF | ALPHA_OFF | Z_OFF | Z_UPDATE_OFF
- | DO_GOURAUD_TRI | CMD_3D);
-
- vmesa->TexOffset = vmesa->s3vScreen->texOffset;
-*/
-
-/* ... but we should support only 15 bit in virge (out of 8/15/24)... */
-
- DEBUG(("glVisual->depthBits = %i\n", glVisual->depthBits));
-
- switch (glVisual->depthBits) {
- case 8:
- break;
-
- case 15:
- case 16:
- vmesa->depth_scale = 1.0f / 0xffff;
- break;
- case 24:
- vmesa->depth_scale = 1.0f / 0xffffff;
- break;
- default:
- break;
- }
-
- vmesa->cull_zero = 0.0f;
-
- vmesa->DepthSize = glVisual->depthBits;
- vmesa->Flags = S3V_FRONT_BUFFER;
- vmesa->Flags |= (glVisual->doubleBufferMode ? S3V_BACK_BUFFER : 0);
- vmesa->Flags |= (vmesa->DepthSize > 0 ? S3V_DEPTH_BUFFER : 0);
-
- vmesa->EnabledFlags = S3V_FRONT_BUFFER;
- vmesa->EnabledFlags |= (glVisual->doubleBufferMode ? S3V_BACK_BUFFER : 0);
-
-
- if (vmesa->Flags & S3V_BACK_BUFFER) {
- vmesa->readOffset = vmesa->drawOffset = vmesa->s3vScreen->backOffset;
- } else {
- vmesa->readOffset = vmesa->drawOffset = 0;
- }
-
- s3vInitHW( vmesa );
-
- driContextPriv->driverPrivate = (void *)vmesa;
-
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.h
deleted file mode 100644
index b94fee6a8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_context.h
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef _S3V_CONTEXT_H_
-#define _S3V_CONTEXT_H_
-
-#include "dri_util.h"
-
-#include "s3v_dri.h"
-#include "s3v_regs.h"
-#include "s3v_macros.h"
-#include "s3v_screen.h"
-#include "colormac.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "drm.h"
-#include "mm.h"
-#include "drirenderbuffer.h"
-
-/* Flags for context */
-#define S3V_FRONT_BUFFER 0x00000001
-#define S3V_BACK_BUFFER 0x00000002
-#define S3V_DEPTH_BUFFER 0x00000004
-
- /* FIXME: check */
-#define S3V_MAX_TEXTURE_SIZE 2048
-
-/* These are the minimum requirements and should probably be increased */
-#define MAX_MODELVIEW_STACK 16
-#define MAX_PROJECTION_STACK 2
-#define MAX_TEXTURE_STACK 2
-
-extern void s3vDDUpdateHWState(GLcontext *ctx);
-extern s3vScreenPtr s3vCreateScreen(__DRIscreenPrivate *sPriv);
-extern void s3vDestroyScreen(__DRIscreenPrivate *sPriv);
-extern GLboolean s3vCreateContext(const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-#define S3V_UPLOAD_ALL 0xffffffff
-/* #define S3V_UPLOAD_CLIPRECTS 0x00000002 */
-#define S3V_UPLOAD_ALPHA 0x00000004
-#define S3V_UPLOAD_BLEND 0x00000008
-#define S3V_UPLOAD_DEPTH 0x00000010
-#define S3V_UPLOAD_VIEWPORT 0x00000020
-#define S3V_UPLOAD_SHADE 0x00000040
-#define S3V_UPLOAD_CLIP 0x00000080
-#define S3V_UPLOAD_MASKS 0x00000100
-#define S3V_UPLOAD_WINDOW 0x00000200 /* defunct */
-#define S3V_UPLOAD_GEOMETRY 0x00000400
-#define S3V_UPLOAD_POLYGON 0x00000800
-#define S3V_UPLOAD_DITHER 0x00001000
-#define S3V_UPLOAD_LOGICOP 0x00002000
-#define S3V_UPLOAD_FOG 0x00004000
-#define S3V_UPLOAD_LIGHT 0x00008000
-#define S3V_UPLOAD_CONTEXT 0x00010000
-#define S3V_UPLOAD_TEX0 0x00020000
-#define S3V_UPLOAD_STIPPLE 0x00040000
-#define S3V_UPLOAD_TRANSFORM 0x00080000
-#define S3V_UPLOAD_LINEMODE 0x00100000
-#define S3V_UPLOAD_POINTMODE 0x00200000
-#define S3V_UPLOAD_TRIMODE 0x00400000
-
-#define S3V_NEW_CLIP 0x00000001
-#define S3V_NEW_WINDOW 0x00000002
-#define S3V_NEW_CONTEXT 0x00000004
-#define S3V_NEW_TEXTURE 0x00000008 /* defunct */
-#define S3V_NEW_ALPHA 0x00000010
-#define S3V_NEW_DEPTH 0x00000020
-#define S3V_NEW_MASKS 0x00000040
-#define S3V_NEW_POLYGON 0x00000080
-#define S3V_NEW_CULL 0x00000100
-#define S3V_NEW_LOGICOP 0x00000200
-#define S3V_NEW_FOG 0x00000400
-#define S3V_NEW_LIGHT 0x00000800
-#define S3V_NEW_STIPPLE 0x00001000
-#define S3V_NEW_ALL 0xffffffff
-
-#define S3V_FALLBACK_TRI 0x00000001
-#define S3V_FALLBACK_TEXTURE 0x00000002
-
-struct s3v_context;
-typedef struct s3v_context s3vContextRec;
-typedef struct s3v_context *s3vContextPtr;
-typedef struct s3v_texture_object_t *s3vTextureObjectPtr;
-
-#define VALID_S3V_TEXTURE_OBJECT(tobj) (tobj)
-
-#define S3V_TEX_MAXLEVELS 12
-
-/* For shared texture space managment, these texture objects may also
- * be used as proxies for regions of texture memory containing other
- * client's textures. Such proxy textures (not to be confused with GL
- * proxy textures) are subject to the same LRU aging we use for our
- * own private textures, and thus we have a mechanism where we can
- * fairly decide between kicking out our own textures and those of
- * other clients.
- *
- * Non-local texture objects have a valid MemBlock to describe the
- * region managed by the other client, and can be identified by
- * 't->globj == 0'
- */
-struct s3v_texture_object_t {
- struct s3v_texture_object_t *next, *prev;
-
- GLuint age;
- struct gl_texture_object *globj;
-
- int Pitch;
- int Height;
- int WidthLog2;
- int texelBytes;
- int totalSize;
- int bound;
-
- PMemBlock MemBlock;
- GLuint BufAddr;
-
- GLuint min_level;
- GLuint max_level;
- GLuint dirty_images;
-
- GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */
-
- struct {
- const struct gl_texture_image *image;
- int offset; /* into BufAddr */
- int height;
- int internalFormat;
- } image[S3V_TEX_MAXLEVELS];
-
- GLuint TextureCMD;
-
- GLuint TextureColorMode;
- GLuint TextureFilterMode;
- GLuint TextureBorderColor;
- GLuint TextureWrap;
- GLuint TextureMipSize;
-
- GLuint TextureBaseAddr[S3V_TEX_MAXLEVELS];
- GLuint TextureFormat;
- GLuint TextureReadMode;
-};
-
-#define S3V_NO_PALETTE 0x0
-#define S3V_USE_PALETTE 0x1
-#define S3V_UPDATE_PALETTE 0x2
-#define S3V_FALLBACK_PALETTE 0x4
-
-void s3vUpdateTextureState( GLcontext *ctx );
-
-void s3vDestroyTexObj( s3vContextPtr vmesa, s3vTextureObjectPtr t);
-void s3vUploadTexImages( s3vContextPtr vmesa, s3vTextureObjectPtr t );
-
-void s3vResetGlobalLRU( s3vContextPtr vmesa );
-void s3vTexturesGone( s3vContextPtr vmesa,
- GLuint start, GLuint end,
- GLuint in_use );
-
-void s3vEmitHwState( s3vContextPtr vmesa );
-void s3vGetLock( s3vContextPtr vmesa, GLuint flags );
-void s3vInitExtensions( GLcontext *ctx );
-void s3vInitDriverFuncs( GLcontext *ctx );
-void s3vInitSpanFuncs( GLcontext *ctx );
-void s3vSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-void s3vInitState( s3vContextPtr vmesa );
-void s3vInitHW( s3vContextPtr vmesa );
-void s3vInitStateFuncs( GLcontext *ctx );
-void s3vInitTextureFuncs( GLcontext *ctx );
-void s3vInitTriFuncs( GLcontext *ctx );
-
-void s3vUpdateWindow( GLcontext *ctx );
-void s3vUpdateViewportOffset( GLcontext *ctx );
-
-void s3vPrintLocalLRU( s3vContextPtr vmesa );
-void s3vPrintGlobalLRU( s3vContextPtr vmesa );
-
-extern void s3vFallback( s3vContextPtr vmesa, GLuint bit, GLboolean mode );
-#define FALLBACK( imesa, bit, mode ) s3vFallback( imesa, bit, mode )
-
-/* Use the templated vertex formats. Only one of these is used in s3v.
- */
-#define TAG(x) s3v##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*s3v_quad_func)( s3vContextPtr,
- const s3vVertex *,
- const s3vVertex *,
- const s3vVertex *,
- const s3vVertex * );
-typedef void (*s3v_tri_func)( s3vContextPtr,
- const s3vVertex *,
- const s3vVertex *,
- const s3vVertex * );
-typedef void (*s3v_line_func)( s3vContextPtr,
- const s3vVertex *,
- const s3vVertex * );
-typedef void (*s3v_point_func)( s3vContextPtr,
- const s3vVertex * );
-
-
-/* static void s3v_lines_emit(GLcontext *ctx, GLuint start, GLuint end); */
-typedef void (*emit_func)( GLcontext *, GLuint, GLuint);
-
-struct s3v_context {
- GLcontext *glCtx; /* Mesa context */
-
- __DRIcontextPrivate *driContext;
- __DRIscreenPrivate *driScreen;
- __DRIdrawablePrivate *driDrawable;
-
- GLuint new_gl_state;
- GLuint new_state;
- GLuint dirty;
-
- S3VSAREAPtr sarea;
-
- /* Temporaries for translating away float colors
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
- /* Mirrors of some DRI state
- */
-
- drm_context_t hHWContext;
- drmLock *driHwLock;
- int driFd;
-
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
-
- GLuint* buf; /* FIXME */
- GLuint* _buf[2];
- int _bufNum;
- int bufIndex[2];
- int bufSize;
- int bufCount;
-
- s3vScreenPtr s3vScreen; /* Screen private DRI data */
-
- int drawOffset;
- int readOffset;
-
- s3v_point_func draw_point;
- s3v_line_func draw_line;
- s3v_tri_func draw_tri;
- s3v_quad_func draw_quad;
-
- GLuint Fallback;
- GLuint RenderIndex;
- GLuint SetupNewInputs;
- GLuint SetupIndex;
-
- GLuint vertex_format;
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- char *verts;
-
- GLfloat hw_viewport[16];
- GLuint hw_primitive;
- GLenum render_primitive;
-
- GLfloat depth_scale;
-
- s3vTextureObjectPtr CurrentTexObj[2];
- struct s3v_texture_object_t TexObjList;
- struct s3v_texture_object_t SwappedOut;
- GLenum TexEnvImageFmt[2];
-
- memHeap_t *texHeap;
-
- int lastSwap;
- int texAge;
- int ctxAge;
- int dirtyAge;
- int lastStamp;
-
- /* max was here: don't touch */
-
- unsigned int S3V_REG[S3V_REGS_NUM];
-
- GLuint texMode;
- GLuint alphaMode;
- GLuint lightMode;
-
- GLuint SrcBase;
- GLuint DestBase;
- GLuint DestBlit;
- GLuint ScissorLR;
- GLuint ScissorTB;
- GLuint ScissorWH; /* SubScissorWH */ /* RectWH */
- GLuint FrontStride;
- GLuint BackStride;
- GLuint SrcStride;
- GLuint DestStride;
- GLuint SrcXY;
- GLuint DestXY;
-
- GLuint ClearColor;
- GLuint Color;
- GLuint DitherMode;
- GLuint ClearDepth;
-
- GLuint TextureBorderColor;
- GLuint TexOffset;
- GLuint TexStride;
-
- GLuint CMD;
- GLuint prim_cmd;
- GLuint _tri[2]; /* 0 = gouraud; 1 = tex (lit or unlit) */
- GLuint alpha_cmd; /* actual alpha cmd */
- GLuint _alpha[2];
- GLuint _alpha_tex; /* tex alpha type */
- /* (3d_mode) 0 = 3d line/gourad tri; 1 = 3d tex tri */
- GLuint _3d_mode;
-
- GLfloat backface_sign;
- GLfloat cull_zero;
-
- int restore_primitive;
-
-/* *** 2check *** */
-
- GLuint FogMode;
- GLuint AreaStippleMode;
- GLuint LBReadFormat;
- GLuint LBWriteFormat;
- GLuint LineMode;
- GLuint PointMode;
- GLuint TriangleMode;
- GLuint AntialiasMode;
- GLfloat ViewportScaleX;
- GLfloat ViewportScaleY;
- GLfloat ViewportScaleZ;
- GLfloat ViewportOffsetX;
- GLfloat ViewportOffsetY;
- GLfloat ViewportOffsetZ;
- int MatrixMode;
- int DepthMode;
- int TransformMode;
- int LBReadMode;
- int FBReadMode;
- int FBWindowBase;
- int LBWindowBase;
- int ColorDDAMode;
- int GeometryMode;
- int AlphaTestMode;
- int AlphaBlendMode;
- int AB_FBReadMode;
- int AB_FBReadMode_Save;
- int DeltaMode;
- int ColorMaterialMode;
- int FBHardwareWriteMask;
- int MaterialMode;
- int NormalizeMode;
- int LightingMode;
- int Light0Mode;
- int Light1Mode;
- int Light2Mode;
- int Light3Mode;
- int Light4Mode;
- int Light5Mode;
- int Light6Mode;
- int Light7Mode;
- int Light8Mode;
- int Light9Mode;
- int Light10Mode;
- int Light11Mode;
- int Light12Mode;
- int Light13Mode;
- int Light14Mode;
- int Light15Mode;
- int LogicalOpMode;
- int ScissorMode;
- int ScissorMaxXY;
- int ScissorMinXY;
- int Window; /* GID part probably should be in draw priv */
- int WindowOrigin;
- int x, y, w, h; /* Probably should be in drawable priv */
- int FrameCount; /* Probably should be in drawable priv */
- int NotClipped; /* Probably should be in drawable priv */
- int WindowChanged; /* Probably should be in drawabl... */
- int Flags;
- int EnabledFlags;
- int DepthSize;
- int Begin;
- GLenum ErrorValue;
- int Texture1DEnabled;
- int Texture2DEnabled;
-
- float ModelView[16];
- float Proj[16];
- float ModelViewProj[16];
- float Texture[16];
-
- float ModelViewStack[(MAX_MODELVIEW_STACK-1)*16];
- int ModelViewCount;
- float ProjStack[(MAX_PROJECTION_STACK-1)*16];
- int ProjCount;
- float TextureStack[(MAX_TEXTURE_STACK-1)*16];
- int TextureCount;
-};
-
-#define S3VIRGEPACKCOLOR555( r, g, b, a ) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define S3VIRGEPACKCOLOR565( r, g, b ) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define S3VIRGEPACKCOLOR888( r, g, b ) \
- (((r) << 16) | ((g) << 8) | (b))
-
-#define S3VIRGEPACKCOLOR8888( r, g, b, a ) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define S3VIRGEPACKCOLOR4444( r, g, b, a ) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-static __inline GLuint s3vPackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- unsigned int ret;
- DEBUG(("cpp = %i, r=0x%x, g=0x%x, b=0x%x, a=0x%x\n", cpp, r, g, b, a));
-
- switch ( cpp ) {
- case 2:
- ret = S3VIRGEPACKCOLOR555( r, g, b, a );
- DEBUG(("ret = 0x%x\n", ret));
- return ret;
- case 4:
- return PACK_COLOR_8888( a, r, g, b );
- default:
- return 0;
- }
-}
-
-#define S3V_CONTEXT(ctx) ((s3vContextPtr)(ctx->DriverCtx))
-
-#endif /* _S3V_CONTEXT_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dd.c
deleted file mode 100644
index 2c8e230f3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dd.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "s3v_context.h"
-#include "s3v_vb.h"
-#include "s3v_lock.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-
-#include "context.h"
-#include "framebuffer.h"
-#include "swrast/swrast.h"
-
-#define S3V_DATE "20020207"
-
-
-/* Return the width and height of the current color buffer.
- */
-static void s3vDDGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
-/* S3VHW_LOCK( vmesa ); */
- *width = vmesa->driDrawable->w;
- *height = vmesa->driDrawable->h;
-/* S3VHW_UNLOCK( vmesa ); */
-}
-
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *s3vDDGetString( GLcontext *ctx, GLenum name )
-{
- static char buffer[128];
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *)"Max Lingua (ladybug)";
-
- case GL_RENDERER:
- sprintf( buffer, "Mesa DRI S3 Virge " S3V_DATE );
-
- /* Append any CPU-specific information.
- */
-#ifdef USE_X86_ASM
- if ( _mesa_x86_cpu_features ) {
- strncat( buffer, " x86", 4 );
-
-}
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- strncat( buffer, "/MMX", 4 );
- }
-#endif
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- strncat( buffer, "/3DNow!", 7 );
- }
-#endif
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- strncat( buffer, "/SSE", 4 );
- }
-#endif
-#endif
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-/* Enable the extensions supported by this driver.
- */
-void s3vInitExtensions( GLcontext *ctx )
-{
- /* None... */
-}
-
-/* Initialize the driver's misc functions.
- */
-void s3vInitDriverFuncs( GLcontext *ctx )
-{
- ctx->Driver.GetBufferSize = s3vDDGetBufferSize;
- ctx->Driver.GetString = s3vDDGetString;
-
- ctx->Driver.Error = NULL;
-
- /* Pixel path fallbacks
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dri.h
deleted file mode 100644
index 339c579f7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_dri.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef _S3V_DRI
-#define _S3V_DRI
-
-#include "s3v_common.h"
-
-#define S3V_MAX_DRAWABLES (S3V_DMA_BUF_NR/2) /* 32 */ /* 256 */ /* FIXME */
-
-typedef struct
-{
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int bitsPerPixel;
-
- int fbOffset;
- int fbStride;
-
- int logTextureGranularity;
- int textureOffset;
-
- drm_handle_t regs;
- drmSize regsSize;
-
- unsigned int sarea_priv_offset;
-/*
- drmAddress regsMap;
-
- drmSize textureSize;
- drm_handle_t textures;
-*/
-
-#if 0
- drm_handle_t agp_buffers;
- drmSize agp_buf_size;
-#endif
-
-/*
- drmBufMapPtr drmBufs;
- int irq;
- unsigned int sarea_priv_offset;
-*/
-
-/* FIXME: cleanup ! */
-
- drmSize registerSize; /* == S3V_MMIO_REGSIZE */
- drm_handle_t registerHandle;
-
- drmSize pciSize;
- drm_handle_t pciMemHandle;
-
- drmSize frontSize; /* == videoRambytes */
-/* drm_handle_t frontHandle; */
- unsigned long frontOffset; /* == fbOffset */
- int frontPitch;
-/* unsigned char *front; */
-
- unsigned int bufferSize; /* size of depth/back buffer */
-
- drmSize backSize;
-/* drm_handle_t backHandle; */
- unsigned long backOffset;
- int backPitch;
-/* unsigned char *back; */
-
- drmSize depthSize;
-/* drm_handle_t depthHandle; */
- unsigned long depthOffset;
- int depthPitch;
-/* unsigned char *depth; */
-
- drmSize texSize;
-/* drm_handle_t texHandle; */
- unsigned long texOffset;
- int texPitch;
-/* unsigned char *tex; */
-
- drmSize dmaBufSize; /* Size of buffers (in bytes) */
- drm_handle_t dmaBufHandle; /* Handle from drmAddMap */
- unsigned long dmaBufOffset; /* Offset/Start */
- int dmaBufPitch; /* Pitch */
- unsigned char *dmaBuf; /* Map */
- int bufNumBufs; /* Number of buffers */
- drmBufMapPtr buffers; /* Buffer map */
-
-} S3VDRIRec, *S3VDRIPtr;
-
-/* WARNING: Do not change the SAREA structure without changing the kernel
- * as well */
-
-typedef struct {
- unsigned char next, prev; /* indices to form a circular LRU */
- unsigned char in_use; /* owned by a client, or free? */
- int age; /* tracked by clients to update local LRU's */
-} S3VTexRegionRec, *S3VTexRegionPtr;
-
-typedef struct {
- unsigned int nbox;
- drm_clip_rect_t boxes[S3V_NR_SAREA_CLIPRECTS];
-
- /* Maintain an LRU of contiguous regions of texture space. If
- * you think you own a region of texture memory, and it has an
- * age different to the one you set, then you are mistaken and
- * it has been stolen by another client. If global texAge
- * hasn't changed, there is no need to walk the list.
- *
- * These regions can be used as a proxy for the fine-grained
- * texture information of other clients - by maintaining them
- * in the same lru which is used to age their own textures,
- * clients have an approximate lru for the whole of global
- * texture space, and can make informed decisions as to which
- * areas to kick out. There is no need to choose whether to
- * kick out your own texture or someone else's - simply eject
- * them all in LRU order.
- */
- S3VTexRegionRec texList[S3V_NR_TEX_REGIONS+1]; /* Last elt is sentinal */
-
- int texAge; /* last time texture was uploaded */
-
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int last_quiescent; /* */
-
- int ctxOwner; /* last context to upload state */
-} S3VSAREARec, *S3VSAREAPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} S3VConfigPrivRec, *S3VConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} S3VDRIContextRec, *S3VDRIContextPtr;
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_inithw.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_inithw.c
deleted file mode 100644
index bdc9effb7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_inithw.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include <sys/ioctl.h>
-
-#include "s3v_context.h"
-
-void s3vInitHW( s3vContextPtr vmesa )
-{
- int i;
- static short _reset = 1;
-
- DEBUG(("vmesa->driDrawable = %p\n", vmesa->driDrawable));
- DEBUG(("stride = %i\n",
- vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp));
- DEBUG(("frontOffset = 0x%x\n", vmesa->s3vScreen->frontOffset));
- DEBUG(("backOffset = 0x%x\n", vmesa->s3vScreen->backOffset));
- DEBUG(("depthOffset = 0x%x\n", vmesa->s3vScreen->depthOffset));
- DEBUG(("textureOffset = 0x%x\n", vmesa->s3vScreen->texOffset));
-
-/* if (_reset) { */
-/* ioctl(vmesa->driFd, 0x4a); */
- ioctl(vmesa->driFd, 0x41); /* reset */
- _reset = 0;
-/* ioctl(vmesa->driFd, 0x4c); */
-/* } */
-
- /* FIXME */
- switch (vmesa->s3vScreen->cpp) {
- case 2:
- break;
- case 4:
- break;
- }
-
- /* FIXME for stencil, gid, etc */
- switch (vmesa->DepthSize) {
- case 15:
- case 16:
- break;
- case 24:
- break;
- case 32:
- break;
- }
-
- vmesa->FogMode = 1;
- vmesa->ClearDepth = 0xffff;
- vmesa->x = 0;
- vmesa->y = 0;
- vmesa->w = 0;
- vmesa->h = 0;
- vmesa->FrameCount = 0;
- vmesa->MatrixMode = GL_MODELVIEW;
- vmesa->ModelViewCount = 0;
- vmesa->ProjCount = 0;
- vmesa->TextureCount = 0;
-
-
- /* FIXME: do we need the following? */
-
- for (i = 0; i < 16; i++)
- if (i % 5 == 0)
- vmesa->ModelView[i] =
- vmesa->Proj[i] =
- vmesa->ModelViewProj[i] =
- vmesa->Texture[i] = 1.0;
- else
- vmesa->ModelView[i] =
- vmesa->Proj[i] =
- vmesa->ModelViewProj[i] =
- vmesa->Texture[i] = 0.0;
-
- vmesa->LBWindowBase = vmesa->driScreen->fbWidth *
- (vmesa->driScreen->fbHeight - 1);
- vmesa->FBWindowBase = vmesa->driScreen->fbWidth *
- (vmesa->driScreen->fbHeight - 1);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.c
deleted file mode 100644
index 52bb87ece..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "s3v_context.h"
-
-#if DEBUG_LOCKING
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-#endif
-
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void s3vGetLock( s3vContextPtr vmesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
-/* __DRIscreenPrivate *sPriv = vmesa->driScreen; */
-
- printf("s3vGetLock <- ***\n");
-
- drmGetLock( vmesa->driFd, vmesa->hHWContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- /* DRI_VALIDATE_DRAWABLE_INFO( vmesa->display, sPriv, dPriv ); */
-
- if ( vmesa->lastStamp != dPriv->lastStamp ) {
- vmesa->lastStamp = dPriv->lastStamp;
- vmesa->new_state |= S3V_NEW_WINDOW | S3V_NEW_CLIP;
- }
-
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
-
-#if 0
- vmesa->dirty = ~0;
-
- if ( sarea->ctxOwner != vmesa->hHWContext ) {
- sarea->ctxOwner = vmesa->hHWContext;
- vmesa->dirty = S3V_UPLOAD_ALL;
- }
-
- for ( i = 0 ; i < vmesa->lastTexHeap ; i++ ) {
- if ( sarea->texAge[i] != vmesa->lastTexAge[i] ) {
- s3vAgeTextures( vmesa, i );
- }
- }
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.h
deleted file mode 100644
index c39d24a38..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_lock.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef __S3V_LOCK_H__
-#define __S3V_LOCK_H__
-
-#include <sys/ioctl.h>
-
-extern void s3vGetLock( s3vContextPtr vmesa, GLuint flags );
-
-/* Turn DEBUG_LOCKING on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit(1); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif
-
-/*
- * !!! We may want to separate locks from locks with validation. This
- * could be used to improve performance for those things commands that
- * do not do any drawing !!!
- */
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( vmesa ) \
- do { \
- char __ret = 0; \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( vmesa->driHwLock, vmesa->hHWContext, \
- (DRM_LOCK_HELD | vmesa->hHWContext), __ret ); \
- if ( __ret ) \
- s3vGetLock( vmesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-/* Unlock the hardware.
- */
-#define UNLOCK_HARDWARE( vmesa ) \
- do { \
- DRM_UNLOCK( vmesa->driFd, \
- vmesa->driHwLock, \
- vmesa->hHWContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-#define S3VHW_LOCK( vmesa ) \
- DRM_UNLOCK(vmesa->driFd, vmesa->driHwLock, vmesa->hHWContext); \
- DRM_SPINLOCK(&vmesa->driScreen->pSAREA->drawable_lock, \
- vmesa->driScreen->drawLockID); \
- /* VALIDATE_DRAWABLE_INFO_NO_LOCK(vmesa); */
-
-#define S3VHW_UNLOCK( vmesa ) \
- DRM_SPINUNLOCK(&vmesa->driScreen->pSAREA->drawable_lock, \
- vmesa->driScreen->drawLockID); \
- /* VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(vmesa); */
-
-#define S3V_SIMPLE_LOCK( vmesa ) \
- ioctl(vmesa->driFd, 0x4a)
-
-#define S3V_SIMPLE_FLUSH_LOCK( vmesa ) \
- ioctl(vmesa->driFd, 0x4b)
-
-#define S3V_SIMPLE_UNLOCK( vmesa ) \
- ioctl(vmesa->driFd, 0x4c)
-
-#endif /* __S3V_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_macros.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_macros.h
deleted file mode 100644
index 3bc871b7e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_macros.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef _S3V_MACROS_H_
-#define _S3V_MACROS_H_
-
-/**************/
-/* DRI macros */
-/**************/
-
-#define GENERIC_DEBUG 0
-#define FLOW_DEBUG 0
-#define DMABUFS_DEBUG 0
-
-/* Note: The argument to DEBUG*() _must_ be enclosed in parenthesis */
-
-#if (GENERIC_DEBUG || FLOW_DEBUG || DMABUFS_DEBUG)
-#include <stdio.h>
-#endif
-
-#if GENERIC_DEBUG
-#define DEBUG(str) printf str
-#else
-#define DEBUG(str)
-#endif
-
-#if FLOW_DEBUG
-#define DEBUG_WHERE(str) printf str
-#else
-#define DEBUG_WHERE(str)
-#endif
-
-#if DMABUFS_DEBUG
-#define DEBUG_BUFS(str) printf str
-#else
-#define DEBUG_BUFS(str)
-#endif
-
-
-#if 0
-#define S3V_DMA_SEND_FLAGS DRM_DMA_PRIORITY
-#define S3V_DMA_SEND_FLAGS DRM_DMA_BLOCK
-#else
-#define S3V_DMA_SEND_FLAGS 0
-#endif
-
-#if 0
-#define S3V_DMA_GET_FLAGS \
- (DRM_DMA_SMALLER_OK | DRM_DMA_LARGER_OK | DRM_DMA_WAIT)
-#else
-#define S3V_DMA_GET_FLAGS DRM_DMA_WAIT
-#endif
-
-
-#define DMAOUT_CHECK(reg,len) \
-do { \
- DEBUG(("DMAOUT_CHECK: reg = 0x%x\n", S3V_##reg##_REG)); \
- DEBUG_BUFS(("DMAOUT_CHECK (was): ")); \
- DEBUG_BUFS(("vmesa->bufCount=%i of vmesa->bufSize=%i\n", \
- vmesa->bufCount, vmesa->bufSize)); \
- /* FIXME: > or >= */ \
- if (vmesa->bufCount+(len+1) >= vmesa->bufSize) \
- DMAFLUSH(); \
-\
- vmesa->bufCount += (len+1); \
- DEBUG_BUFS(("DMAOUT_CHECK (is): vmesa->bufCount=%i len=%i, reg=%x\n", \
- vmesa->bufCount, len, S3V_##reg##_REG)); \
- DMAOUT( ((len & 0xffff) | ((S3V_##reg##_REG & 0xfffc) << 14)) ); \
-} while (0)
-
-#define DMAOUT(val) \
-do { \
- *(vmesa->buf++)=val; \
- DEBUG_BUFS(("DMAOUT: val=0x%x\n", (unsigned int)val)); \
-} while(0)
-
-#define DMAFINISH() \
-do { \
- /* NOTE: it does nothing - it just prints some summary infos */ \
- DEBUG(("DMAFINISH: vmesa->bufCount=%i\n", vmesa->bufCount)); \
- DEBUG(("buf: index=%i; addr=%p\n", vmesa->bufIndex[vmesa->_bufNum], \
- vmesa->s3vScreen->bufs->list[vmesa->bufIndex[vmesa->_bufNum]].address)); \
-} while(0)
-
-#define DMAFLUSH() \
-do { \
- if (vmesa->bufCount) { \
- SEND_DMA(vmesa->driFd, vmesa->hHWContext, 1, \
- &vmesa->bufIndex[vmesa->_bufNum], &vmesa->bufCount); \
-/*
- GET_DMA(vmesa->driFd, vmesa->hHWContext, 1, \
- &vmesa->bufIndex, &vmesa->bufSize); \
-*/ \
- vmesa->_bufNum = !(vmesa->_bufNum); \
- vmesa->buf = vmesa->_buf[vmesa->_bufNum]; \
-/*
- vmesa->buf = \
- vmesa->s3vScreen->bufs->list[vmesa->bufIndex].address; \
-*/ \
- vmesa->bufCount = 0; \
- } \
-} while (0)
-
-#define CMDCHANGE() \
-do { \
- DMAOUT_CHECK(3DTRI_CMDSET, 1); /* FIXME: TRI/LINE */ \
- DMAOUT(vmesa->CMD); \
- DMAFINISH(); \
-} while (0)
-
-#ifdef DONT_SEND_DMA
-#define GET_DMA(fd, hHWCtx, n, idx, size)
-#define SEND_DMA(fd, hHWCtx,n, idx, cnt)
-#else
-#define GET_DMA(fd, hHWCtx, n, idx, size) \
-do { \
- drmDMAReq dma; \
- int retcode, i; \
-\
- DEBUG(("GET_DMA: ")); \
- DEBUG(("req_count=%i; req_list[#0]=%i; req_size[#0]=%i\n", \
- n, (idx)[n-1], (size)[n-1])); \
-\
- dma.context = (hHWCtx); \
- dma.send_count = 0; \
- dma.send_list = NULL; \
- dma.send_sizes = NULL; \
- dma.flags = S3V_DMA_GET_FLAGS; \
- dma.request_count = (n); \
- dma.request_size = S3V_DMA_BUF_SZ; \
- dma.request_list = (idx); \
- dma.request_sizes = (size); \
-\
- do { \
- if ((retcode = drmDMA((fd), &dma))) { \
- DEBUG_BUFS(("drmDMA (get) returned %d\n", retcode)); \
- } \
-} while (!(dma).granted_count); \
-\
- for (i = 0; i < (n); i++) { \
- DEBUG(("Got buffer %i (index #%i)\n", (idx)[i], i)); \
- DEBUG(("of %i bytes (%i words) size\n", \
- (size)[i], (size)[i] >>2)); \
- /* Convert from bytes to words */ \
- (size)[i] >>= 2; \
- } \
-} while (0)
-
-#define SEND_DMA(fd, hHWCtx, n, idx, cnt) \
-do { \
- drmDMAReq dma; \
- int retcode, i; \
-\
- DEBUG(("SEND_DMA: ")); \
- DEBUG(("send_count=%i; send_list[#0]=%i; send_sizes[#0]=%i\n", \
- n, (idx)[n-1], (cnt)[n-1])); \
-\
- for (i = 0; i < (n); i++) { \
- /* Convert from words to bytes */ \
- (cnt)[i] <<= 2; \
- } \
-\
- dma.context = (hHWCtx); \
- dma.send_count = (n); \
- dma.send_list = (idx); \
- dma.send_sizes = (cnt); \
- dma.flags = S3V_DMA_SEND_FLAGS; \
- dma.request_count = 0; \
- dma.request_size = 0; \
- dma.request_list = NULL; \
- dma.request_sizes = NULL; \
-\
- if ((retcode = drmDMA((fd), &dma))) { \
- DEBUG_BUFS(("drmDMA (send) returned %d\n", retcode)); \
- } \
-\
- for (i = 0; i < (n); i++) { \
- DEBUG(("Sent buffer %i (index #%i)\n", (idx)[i], i)); \
- DEBUG(("of %i bytes (%i words) size\n", \
- (cnt)[i], (cnt)[i] >>2)); \
- (cnt)[i] = 0; \
- } \
-} while (0)
-#endif /* DONT_SEND_DMA */
-
-#define GET_FIRST_DMA(fd, hHWCtx, n, idx, size, buf, cnt, vPriv) \
-do { \
- int i; \
- DEBUG_BUFS(("GET_FIRST_DMA\n")); \
- DEBUG_BUFS(("n=%i idx=%i size=%i\n", n, *idx, *size)); \
- DEBUG_BUFS(("going to GET_DMA\n")); \
- GET_DMA(fd, hHWCtx, n, idx, size); \
- DEBUG_BUFS(("coming from GET_DMA\n")); \
- DEBUG_BUFS(("n=%i idx=%i size=%i\n", n, (idx)[0], (size)[0])); \
- for (i = 0; i < (n); i++) { \
- DEBUG_BUFS(("buf #%i @%p\n", \
- i, (vPriv)->bufs->list[(idx)[i]].address)); \
- (buf)[i] = (vPriv)->bufs->list[(idx)[i]].address; \
- (cnt)[i] = 0; \
- } \
- DEBUG(("GOING HOME\n")); \
-} while (0)
-
-/**************************/
-/* generic, global macros */
-/**************************/
-
-#define CALC_LOG2(l2,s) \
-do { \
- int __s = s; \
- l2 = 0; \
- while (__s > 1) { ++l2; __s >>= 1; } \
-} while (0)
-
-#define PrimType_Null 0x00000000
-#define PrimType_Points 0x10000000
-#define PrimType_Lines 0x20000000
-#define PrimType_LineLoop 0x30000000
-#define PrimType_LineStrip 0x40000000
-#define PrimType_Triangles 0x50000000
-#define PrimType_TriangleStrip 0x60000000
-#define PrimType_TriangleFan 0x70000000
-#define PrimType_Quads 0x80000000
-#define PrimType_QuadStrip 0x90000000
-#define PrimType_Polygon 0xa0000000
-#define PrimType_Mask 0xf0000000
-
-#endif /* _S3V_MACROS_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_regs.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_regs.h
deleted file mode 100644
index 26a7c54af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_regs.h
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef _S3V_REG_H
-#define _S3V_REG_H
-
-#define S3V_REGS_NUM 256
-
-/************
- * DMA REGS *
- ************/
-
-#define S3V_DMA_ID 0
-#define S3V_DMA_REG 0x8590
-#define S3V_DMA_WRITEP_ID 1
-#define S3V_DMA_WRITEP_REG 0x8594
-#define S3V_DMA_READP_ID 2
-#define S3V_DMA_READP_REG 0x8598
-#define S3V_DMA_ENABLE_ID 3
-#define S3V_DMA_ENABLE_REG 0x859C
-#define S3V_DMA_UPDATE_ID 4
-#define S3V_DMA_UPDATE_REG 0x10000
-
-/***************
- * STATUS REGS *
- ***************/
-
-#define S3V_STAT_ID 10
-#define S3V_STAT_REG 0x8504
-#define S3V_STAT_VSYNC_ID 11
-#define S3V_STAT_VSYNC_REG 0x8505
-#define S3V_STAT_3D_DONE_ID 12
-#define S3V_STAT_3D_DONE_REG 0x8506
-#define S3V_STAT_FIFO_OVER_ID 13
-#define S3V_STAT_FIFO_OVER_REG 0x8508
-#define S3V_STAT_FIFO_EMPTY_ID 14
-#define S3V_STAT_FIFO_EMPTY_REG 0x850C
-#define S3V_STAT_HDMA_DONE_ID 15
-#define S3V_STAT_HDMA_DONE_REG 0x8514
-#define S3V_STAT_CDMA_DONE_ID 16
-#define S3V_STAT_CDMA_DONE_REG 0x8524
-#define S3V_STAT_3D_FIFO_EMPTY_ID 17
-#define S3V_STAT_3D_FIFO_EMPTY_REG 0x8544
-#define S3V_STAT_LPB_ID 18
-#define S3V_STAT_LPB_REG 0x8584
-#define S3V_STAT_3D_BUSY_ID 19
-#define S3V_STAT_3D_BUSY_REG 0x8704
-
-/***********
- * 2D REGS *
- ***********/
-
-#define S3V_BITBLT_ID 30
-#define S3V_BITBLT_REG 0xA400
-#define S3V_BITBLT_SRC_BASE_ID 31
-#define S3V_BITBLT_SRC_BASE_REG 0xA4D4
-#define S3V_BITBLT_DEST_BASE_ID 32
-#define S3V_BITBLT_DEST_BASE_REG 0xA4D8
-#define S3V_BITBLT_CLIP_L_R_ID 33
-#define S3V_BITBLT_CLIP_L_R_REG 0xA4DC
-#define S3V_BITBLT_CLIP_T_B_ID 34
-#define S3V_BITBLT_CLIP_T_B_REG 0xA4E0
-#define S3V_BITBLT_DEST_SRC_STRIDE_ID 35
-#define S3V_BITBLT_DEST_SRC_STRIDE_REG 0xA4E4
-#define S3V_BITBLT_MONO_PAT0_ID 36
-#define S3V_BITBLT_MONO_PAT0_REG 0xA4E8
-#define S3V_BITBLT_MONO_PAT1_ID 37
-#define S3V_BITBLT_MONO_PAT1_REG 0xA4EC
-#define S3V_BITBLT_PAT_BG_COLOR_ID 38
-#define S3V_BITBLT_PAT_BG_COLOR_REG 0xA4F0
-#define S3V_BITBLT_PAT_FG_COLOR_ID 39
-#define S3V_BITBLT_PAT_FG_COLOR_REG 0xA4F4
-#define S3V_BITBLT_CMDSET_ID 40
-#define S3V_BITBLT_CMDSET_REG 0xA500
-#define S3V_BITBLT_WIDTH_HEIGHT_ID 41
-#define S3V_BITBLT_WIDTH_HEIGHT_REG 0xA504
-#define S3V_BITBLT_SRC_X_Y_ID 42
-#define S3V_BITBLT_SRC_X_Y_REG 0xA508
-#define S3V_BITBLT_DEST_X_Y_ID 43
-#define S3V_BITBLT_DEST_X_Y_REG 0xA50C
-#define S3V_2DLINE_ID 44
-#define S3V_2DLINE_REG 0xA800
-#define S3V_2DPOLY_ID 45
-#define S3V_2DPOLY_REG 0xAC00
-
-/***************
- * 3DLINE REGS *
- ***************/
-/* base regs */
-#define S3V_3DLINE_ID 50
-#define S3V_3DLINE_REG 0xB000
-#define S3V_3DLINE_Z_BASE_ID 51
-#define S3V_3DLINE_Z_BASE_REG 0xB0D4
-#define S3V_3DLINE_SRC_BASE_ID 52 /* it is the same reg */
-#define S3V_3DLINE_SRC_BASE_REG 0xB0D4
-#define S3V_3DLINE_DEST_BASE_ID 53
-#define S3V_3DLINE_DEST_BASE_REG 0xB0D8
-#define S3V_3DLINE_CLIP_L_R_ID 54
-#define S3V_3DLINE_CLIP_L_R_REG 0xB0DC
-#define S3V_3DLINE_CLIP_T_B_ID 55
-#define S3V_3DLINE_CLIP_T_B_REG 0xB0E0
-#define S3V_3DLINE_DEST_SRC_STRIDE_ID 56
-#define S3V_3DLINE_DEST_SRC_STRIDE_REG 0xB0E4
-#define S3V_3DLINE_Z_STRIDE_ID 57
-#define S3V_3DLINE_Z_STRIDE_REG 0xB0E8
-#define S3V_3DLINE_TEX_BASE_ID 58
-#define S3V_3DLINE_TEX_BASE_REG 0xB0EC
-#define S3V_3DLINE_TEX_B_COLOR_ID 59
-#define S3V_3DLINE_TEX_B_COLOR_REG 0xB0F0
-#define S3V_3DLINE_FOG_COLOR_ID 60
-#define S3V_3DLINE_FOG_COLOR_REG 0xB0F4
-#define S3V_3DLINE_COLOR0_ID 61
-#define S3V_3DLINE_COLOR0_REG 0xB0F8
-#define S3V_3DLINE_COLOR1_ID 62
-#define S3V_3DLINE_COLOR1_REG 0xB0FC
-#define S3V_3DLINE_CMDSET_ID 63
-#define S3V_3DLINE_CMDSET_REG 0xB100 /* special */
-/* tex regs */
-/* FIXME: shouldn't it be a 1D tex for lines? */
-#define S3V_3DLINE_BASEV_ID 64
-#define S3V_3DLINE_BASEV_REG 0xB104
-#define S3V_3DLINE_BASEU_ID 65
-#define S3V_3DLINE_BASEU_REG 0xB108
-#define S3V_3DLINE_WXD_ID 66
-#define S3V_3DLINE_WXD_REG 0xB10C
-#define S3V_3DLINE_WYD_ID 67
-#define S3V_3DLINE_WYD_REG 0xB110
-#define S3V_3DLINE_WSTART_ID 68
-#define S3V_3DLINE_WSTART_REG 0xB114
-#define S3V_3DLINE_DXD_ID 69
-#define S3V_3DLINE_DXD_REG 0xB118
-#define S3V_3DLINE_VXD_ID 70
-#define S3V_3DLINE_VXD_REG 0xB11C
-#define S3V_3DLINE_UXD_ID 71
-#define S3V_3DLINE_UXD_REG 0xB120
-#define S3V_3DLINE_DYD_ID 72
-#define S3V_3DLINE_DYD_REG 0xB124
-#define S3V_3DLINE_VYD_ID 73
-#define S3V_3DLINE_VYD_REG 0xB128
-#define S3V_3DLINE_UYD_ID 74
-#define S3V_3DLINE_UYD_REG 0xB12C
-#define S3V_3DLINE_DSTART_ID 75
-#define S3V_3DLINE_DSTART_REG 0xB130
-#define S3V_3DLINE_VSTART_ID 76
-#define S3V_3DLINE_VSTART_REG 0xB134
-#define S3V_3DLINE_USTART_ID 77
-#define S3V_3DLINE_USTART_REG 0xB138
-/* gourad regs */
-#define S3V_3DLINE_GBD_ID 78
-#define S3V_3DLINE_GBD_REG 0xB144
-#define S3V_3DLINE_ARD_ID 79
-#define S3V_3DLINE_ARD_REG 0xB148
-#define S3V_3DLINE_GS_BS_ID 80
-#define S3V_3DLINE_GS_BS_REG 0xB14C
-#define S3V_3DLINE_AS_RS_ID 81
-#define S3V_3DLINE_AS_RS_REG 0xB150
-/* vertex regs */
-#define S3V_3DLINE_DZ_ID 82
-#define S3V_3DLINE_DZ_REG 0xB158
-#define S3V_3DLINE_ZSTART_ID 83
-#define S3V_3DLINE_ZSTART_REG 0xB15C
-#define S3V_3DLINE_XEND0_END1_ID 84
-#define S3V_3DLINE_XEND0_END1_REG 0xB16C
-#define S3V_3DLINE_DX_ID 85
-#define S3V_3DLINE_DX_REG 0xB170
-#define S3V_3DLINE_XSTART_ID 86
-#define S3V_3DLINE_XSTART_REG 0xB174
-#define S3V_3DLINE_YSTART_ID 87
-#define S3V_3DLINE_YSTART_REG 0xB178
-#define S3V_3DLINE_YCNT_ID 88
-#define S3V_3DLINE_YCNT_REG 0xB17C
-
-/**************
- * 3DTRI REGS *
- **************/
-/* base regs */
-#define S3V_3DTRI_ID 100
-#define S3V_3DTRI_REG 0xB400
-#define S3V_3DTRI_Z_BASE_ID 101
-#define S3V_3DTRI_Z_BASE_REG 0xB4D4
-#define S3V_3DTRI_SRC_BASE_ID 102 /* it is the same reg */
-#define S3V_3DTRI_SRC_BASE_REG 0xB4D4
-#define S3V_3DTRI_DEST_BASE_ID 103
-#define S3V_3DTRI_DEST_BASE_REG 0xB4D8
-#define S3V_3DTRI_CLIP_L_R_ID 104
-#define S3V_3DTRI_CLIP_L_R_REG 0xB4DC
-#define S3V_3DTRI_CLIP_T_B_ID 105
-#define S3V_3DTRI_CLIP_T_B_REG 0xB4E0
-#define S3V_3DTRI_DEST_SRC_STRIDE_ID 106
-#define S3V_3DTRI_DEST_SRC_STRIDE_REG 0xB4E4
-#define S3V_3DTRI_Z_STRIDE_ID 107
-#define S3V_3DTRI_Z_STRIDE_REG 0xB4E8
-#define S3V_3DTRI_TEX_BASE_ID 108
-#define S3V_3DTRI_TEX_BASE_REG 0xB4EC
-#define S3V_3DTRI_TEX_B_COLOR_ID 109
-#define S3V_3DTRI_TEX_B_COLOR_REG 0xB4F0
-#define S3V_3DTRI_FOG_COLOR_ID 110
-#define S3V_3DTRI_FOG_COLOR_REG 0xB4F4
-#define S3V_3DTRI_COLOR0_ID 111
-#define S3V_3DTRI_COLOR0_REG 0xB4F8
-#define S3V_3DTRI_COLOR1_ID 112
-#define S3V_3DTRI_COLOR1_REG 0xB4FC
-#define S3V_3DTRI_CMDSET_ID 113 /* special */
-#define S3V_3DTRI_CMDSET_REG 0xB500
-/* tex regs */
-#define S3V_3DTRI_BASEV_ID 114
-#define S3V_3DTRI_BASEV_REG 0xB504
-#define S3V_3DTRI_BASEU_ID 115
-#define S3V_3DTRI_BASEU_REG 0xB508
-#define S3V_3DTRI_WXD_ID 116
-#define S3V_3DTRI_WXD_REG 0xB50C
-#define S3V_3DTRI_WYD_ID 117
-#define S3V_3DTRI_WYD_REG 0xB510
-#define S3V_3DTRI_WSTART_ID 118
-#define S3V_3DTRI_WSTART_REG 0xB514
-#define S3V_3DTRI_DXD_ID 119
-#define S3V_3DTRI_DXD_REG 0xB518
-#define S3V_3DTRI_VXD_ID 120
-#define S3V_3DTRI_VXD_REG 0xB51C
-#define S3V_3DTRI_UXD_ID 121
-#define S3V_3DTRI_UXD_REG 0xB520
-#define S3V_3DTRI_DYD_ID 122
-#define S3V_3DTRI_DYD_REG 0xB524
-#define S3V_3DTRI_VYD_ID 123
-#define S3V_3DTRI_VYD_REG 0xB528
-#define S3V_3DTRI_UYD_ID 124
-#define S3V_3DTRI_UYD_REG 0xB52C
-#define S3V_3DTRI_DSTART_ID 125
-#define S3V_3DTRI_DSTART_REG 0xB530
-#define S3V_3DTRI_VSTART_ID 126
-#define S3V_3DTRI_VSTART_REG 0xB534
-#define S3V_3DTRI_USTART_ID 127
-#define S3V_3DTRI_USTART_REG 0xB538
-/* gourad regs */
-#define S3V_3DTRI_GBX_ID 128
-#define S3V_3DTRI_GBX_REG 0xB53C
-#define S3V_3DTRI_ARX_ID 129
-#define S3V_3DTRI_ARX_REG 0xB540
-#define S3V_3DTRI_GBY_ID 130
-#define S3V_3DTRI_GBY_REG 0xB544
-#define S3V_3DTRI_ARY_ID 131
-#define S3V_3DTRI_ARY_REG 0xB548
-#define S3V_3DTRI_GS_BS_ID 132
-#define S3V_3DTRI_GS_BS_REG 0xB54C
-#define S3V_3DTRI_AS_RS_ID 133
-#define S3V_3DTRI_AS_RS_REG 0xB550
-/* vertex regs */
-#define S3V_3DTRI_ZXD_ID 134
-#define S3V_3DTRI_ZXD_REG 0xB554
-#define S3V_3DTRI_ZYD_ID 135
-#define S3V_3DTRI_ZYD_REG 0xB558
-#define S3V_3DTRI_ZSTART_ID 136
-#define S3V_3DTRI_ZSTART_REG 0xB55C
-#define S3V_3DTRI_TXDELTA12_ID 137
-#define S3V_3DTRI_TXDELTA12_REG 0xB560
-#define S3V_3DTRI_TXEND12_ID 138
-#define S3V_3DTRI_TXEND12_REG 0xB564
-#define S3V_3DTRI_TXDELTA01_ID 139
-#define S3V_3DTRI_TXDELTA01_REG 0xB568
-#define S3V_3DTRI_TXEND01_ID 140
-#define S3V_3DTRI_TXEND01_REG 0xB56C
-#define S3V_3DTRI_TXDELTA02_ID 141
-#define S3V_3DTRI_TXDELTA02_REG 0xB570
-#define S3V_3DTRI_TXSTART02_ID 142
-#define S3V_3DTRI_TXSTART02_REG 0xB574
-#define S3V_3DTRI_TYS_ID 143
-#define S3V_3DTRI_TYS_REG 0xB578
-#define S3V_3DTRI_TY01_Y12_ID 144
-#define S3V_3DTRI_TY01_Y12_REG 0xB57C
-
-/* COMMANDS (to 0xB100 [lines] or 0xB500 [tris]) */
-
-/* Auto execute */
-#define AUTO_EXEC_MASK 0x00000001
-#define AUTO_EXEC_OFF (0x0)
-#define AUTO_EXEC_ON (0x1)
-/* HW clipping */
-#define HW_CLIP_MASK 0x00000002
-#define HW_CLIP_OFF (0x0 << 1)
-#define HW_CLIP_ON (0x1 << 1)
-/* Destination color */
-#define DEST_COL_MASK 0x0000001c
-#define DEST_COL_PAL (0x0 << 2) /* 8 bpp - palettized */
-#define DEST_COL_1555 (0x1 << 2) /* 16 bpp - ZRGB */
-#define DEST_COL_888 (0x2 << 2) /* 24 bpp - RGB */
-/* Texture color */
-#define TEX_COL_MASK 0x000000e0
-#define TEX_COL_ARGB8888 (0x0 << 5) /* 32 bpp - ARGB */
-#define TEX_COL_ARGB4444 (0x1 << 5) /* 16 bpp - ARGB */
-#define TEX_COL_ARGB1555 (0x2 << 5) /* 16 bpp - ARGB */
-#define TEX_COL_ALPHA4 (0x3 << 5) /* 8 bpp - ALPHA4 */
-#define TEX_COL_BLEND4_LOW (0x4 << 5) /* 4 bpp - BLEND4 low nibble */
-#define TEX_COL_BLEND4_HIGH (0x5 << 5) /* 4 bpp - BLEND4 high nibble */
-#define TEX_COL_PAL (0x6 << 5) /* 8 bpp - palettized */
-#define TEX_COL_YUV (0x7 << 5) /* 16 bpp - YUV */
-/* Mipmap level */
-#define MIP_MASK 0x00000f00
-#define MIPMAP_LEVEL(s) (s << 8) /* 8 -> 11 bits */
-/* Texture filtering */
-#define TEX_FILTER_MASK 0x00007000
-#define MIP_NEAREST (0x0 << 12)
-#define LINEAR_MIP_NEAREST (0x1 << 12)
-#define MIP_LINEAR (0x2 << 12)
-#define LINEAR_MIP_LINEAR (0x3 << 12)
-#define NEAREST (0x4 << 12)
-#define FAST_BILINEAR (0x5 << 12)
-#define LINEAR (0x6 << 12)
-/* Texture blending */
-#define TEX_BLEND_MAKS 0x00018000
-#define TEX_REFLECT (0x0 << 15)
-#define TEX_MODULATE (0x1 << 15)
-#define TEX_DECAL (0x2 << 15)
-/* Fog */
-#define FOG_MASK 0x00020000
-#define FOG_OFF (0x0 << 17)
-#define FOG_ON (0x1 << 17)
-/* Alpha blending */
-#define ALPHA_BLEND_MASK 0x000c0000
-#define ALPHA_OFF (0x0 << 18) | (0x0 << 19)
-#define ALPHA_TEX (0x2 << 18)
-#define ALPHA_SRC (0x3 << 18)
-/* Depth compare mode */
-#define Z_MODE_MASK 0x00700000
-#define Z_NEVER (0x0 << 20)
-#define Z_GREATER (0x1 << 20)
-#define Z_EQUAL (0x2 << 20)
-#define Z_GEQUAL (0x3 << 20)
-#define Z_LESS (0x4 << 20)
-#define Z_NOTEQUAL (0x5 << 20)
-#define Z_LEQUAL (0x6 << 20)
-#define Z_ALWAYS (0x7 << 20)
-/* Depth update */
-#define Z_UPDATE_MASK 0x00800000
-#define Z_UPDATE_OFF (0x0 << 23) /* disable z update */
-#define Z_UPDATE_ON (0x1 << 23)
-/* Depth buffering mode */
-#define Z_BUFFER_MASK 0x03000000
-#define Z_BUFFER (0x0 << 24) | (0x0 << 25)
-#define Z_MUX_BUF (0x1 << 24) | (0x0 << 25)
-#define Z_MUX_DRAW (0x2 << 24)
-#define Z_OFF (0x3 << 24) /* no z buffering */
-/* Texture wrapping */
-#define TEX_WRAP_MASK 0x04000000
-#define TEX_WRAP_OFF (0x0 << 26)
-#define TEX_WRAP_ON (0x1 << 26)
-/* 3d command */
-#define DO_MASK 0x78000000
-#define DO_GOURAUD_TRI (0x0 << 27)
-#define DO_TEX_LIT_TRI_OLD (0x1 << 27)
-#define DO_TEX_UNLIT_TRI_OLD (0x2 << 27)
-#define DO_TEX_LIT_TRI (0x5 << 27)
-#define DO_TEX_UNLIT_TRI (0x6 << 27)
-#define DO_3D_LINE (0x8 << 27)
-#define DO_NOP (0xf << 27) /* turn on autoexec */
-/* status */
-#define CMD_MASK 0x80000000
-#define CMD_2D (0x0 << 31) /* execute a 2d cmd */
-#define CMD_3D (0x1 << 31) /* execute a 3d cmd */
-
-/* global masks */
-#define TEX_MASK ( TEX_COL_MASK | TEX_WRAP_MASK | MIP_MASK \
- | TEX_FILTER_MASK | TEX_BLEND_MAKS \
- | TEX_WRAP_MASK )
-#define Z_MASK ( Z_MODE_MASK | Z_UPDATE_MASK | Z_BUFFER_MASK )
-
-#endif /* _S3V_REG_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_render.c
deleted file mode 100644
index 6aaa94976..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_render.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "mtypes.h"
-
-#include "tnl/t_context.h"
-
-#include "s3v_context.h"
-#include "s3v_tris.h"
-#include "s3v_vb.h"
-
-
-#define HAVE_POINTS 0
-#define HAVE_LINES 0
-#define HAVE_LINE_STRIPS 0
-#define HAVE_TRIANGLES 0
-#define HAVE_TRI_STRIPS 0
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 0
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-#define HAVE_POLYGONS 0
-
-#define HAVE_ELTS 0
-
-#if 0
-static void VERT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */
- int _flags;
-
- DEBUG(("VERT_FALLBACK: flags & PRIM_MODE_MASK = %i\n",
- flags & PRIM_MODE_MASK));
- DEBUG(("VERT_FALLBACK: flags=%i PRIM_MODE_MASK=%i\n",
- flags, PRIM_MODE_MASK));
-#if 0
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
-#endif
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
-
- _flags = flags & PRIM_MODE_MASK;
-
- tnl->Driver.Render.PrimTabVerts[_flags]( ctx, start, count, flags );
- S3V_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS;
-}
-#endif
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- PrimType_Points,
- PrimType_Lines,
- PrimType_LineLoop,
- PrimType_LineStrip,
- PrimType_Triangles,
- PrimType_TriangleStrip,
- PrimType_TriangleFan,
- PrimType_Quads,
- PrimType_QuadStrip,
- PrimType_Polygon
-};
-
-static __inline void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim )
-{
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
-
- int _hw_prim = hw_prim[prim];
-
- DEBUG(("s3vStartPrimitive (new #%i) ", prim));
-
- if (_hw_prim != vmesa->restore_primitive) {
-
- if (prim == 4) { /* TRI */
- DEBUG(("switching to tri\n"));
- vmesa->prim_cmd = vmesa->_tri[vmesa->_3d_mode];
- vmesa->alpha_cmd = vmesa->_alpha[vmesa->_3d_mode];
- DMAOUT_CHECK(3DTRI_Z_BASE, 12);
- } else if (prim == 1) { /* LINE */
- DEBUG(("switching to line\n"));
- vmesa->prim_cmd = DO_3D_LINE;
- vmesa->alpha_cmd = vmesa->_alpha[0];
- DMAOUT_CHECK(3DLINE_Z_BASE, 12);
- } else {
- DEBUG(("Never mind the bollocks!\n"));
- }
-
- DMAOUT(vmesa->s3vScreen->depthOffset & 0x003FFFF8);
- DMAOUT(vmesa->DestBase);
- /* DMAOUT(vmesa->ScissorLR); */
- /* DMAOUT(vmesa->ScissorTB); */
- DMAOUT( (0 << 16) | (dPriv->w-1) );
- DMAOUT( (0 << 16) | (dPriv->h-1) );
- DMAOUT( (vmesa->SrcStride << 16) | vmesa->TexStride );
- DMAOUT(vmesa->SrcStride);
- DMAOUT(vmesa->TexOffset);
- DMAOUT(vmesa->TextureBorderColor);
- DMAOUT(0); /* FOG */
- DMAOUT(0);
- DMAOUT(0);
- DMAOUT(vmesa->CMD | vmesa->prim_cmd | vmesa->alpha_cmd);
- DMAFINISH();
- }
-
- vmesa->restore_primitive = _hw_prim;
-}
-
-static __inline void s3vEndPrimitive( s3vContextPtr vmesa )
-{
-/* GLcontext *ctx = vmesa->glCtx; */
- DEBUG(("s3vEndPrimitive\n"));
-}
-
-#define LOCAL_VARS s3vContextPtr vmesa = S3V_CONTEXT(ctx)
-#define INIT( prim ) s3vStartPrimitive( vmesa, prim )
-#define FINISH s3vEndPrimitive( vmesa )
-#define NEW_PRIMITIVE() (void) vmesa
-#define NEW_BUFFER() (void) vmesa
-#define FIRE_VERTICES() (void) vmesa
-#define GET_CURRENT_VB_MAX_VERTS() \
- (vmesa->bufSize - vmesa->bufCount) / 2
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- S3V_DMA_BUF_SZ / 2
-/* XXX */
-#define ALLOC_VERTS(nr) NULL
-#define EMIT_VERTS(ctx, start, count, buf) NULL
-#define FLUSH() s3vEndPrimitive( vmesa )
-
-#define TAG(x) s3v_##x
-
-#include "tnl_dd/t_dd_dmatmp.h"
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-
-static GLboolean s3v_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- tnl_render_func *tab;
-
- DEBUG(("s3v_run_render\n"));
-
- /* FIXME: hw clip */
- if (VB->ClipOrMask || vmesa->RenderIndex != 0) {
- DEBUG(("*** CLIPPED in render ***\n"));
-#if 1
- return GL_TRUE; /* don't handle clipping here */
-#endif
- }
-
-
- /* We don't do elts */
- if (VB->Elts)
- return GL_TRUE;
-
- tab = TAG(render_tab_verts);
-
- tnl->Driver.Render.Start( ctx );
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++ )
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- DEBUG(("s3v_run_render (loop=%i) (lenght=%i)\n", i, length));
-
- if (length) {
- tnl->Driver.Render.BuildVertices( ctx, start,
- start+length, ~0 /*stage->inputs*/); /* XXX */
- tnl->Driver.Render.PrimTabVerts[prim & PRIM_MODE_MASK]
- ( ctx, start, start + length, prim );
- vmesa->SetupNewInputs = VERT_BIT_POS;
- }
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-
-
-const struct tnl_pipeline_stage _s3v_render_stage =
-{
- "s3v render",
- NULL,
- NULL,
- NULL,
- NULL,
- s3v_run_render /* run */
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.c
deleted file mode 100644
index f1810597e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "s3v_context.h"
-#include "s3v_vb.h"
-#include "s3v_dri.h"
-
-s3vScreenPtr s3vCreateScreen( __DRIscreenPrivate *sPriv )
-{
- s3vScreenPtr s3vScreen;
- S3VDRIPtr vDRIPriv = (S3VDRIPtr)sPriv->pDevPriv;
-
-/* int i; */
-
- DEBUG(("s3vCreateScreen\n"));
- DEBUG(("sPriv->pDevPriv at %p\n", sPriv->pDevPriv));
- DEBUG(("size = %i\n", sizeof(*vDRIPriv)));
-
- if (sPriv->devPrivSize != sizeof(S3VDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(S3VDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- s3vScreen = (s3vScreenPtr) CALLOC( sizeof(*s3vScreen) );
- if ( !s3vScreen ) return NULL;
-
- s3vScreen->regionCount = 4; /* Magic number. Can we fix this? */
-
- s3vScreen->regions = _mesa_malloc(s3vScreen->regionCount *
- sizeof(s3vRegion));
- DEBUG(("sPriv->fd = %i\nvDRIPriv->dmaBufHandle = %x\n",
- sPriv->fd, vDRIPriv->dmaBufHandle));
-
- DEBUG(("vDRIPriv->dmaBufSize=%i\nvDRIPriv->dmaBuf=%p\n",
- vDRIPriv->dmaBufSize, vDRIPriv->dmaBuf));
-
-
- /* Get the list of dma buffers */
- s3vScreen->bufs = drmMapBufs(sPriv->fd);
-
- if (!s3vScreen->bufs) {
- DEBUG(("Helter/skelter with drmMapBufs\n"));
- return GL_FALSE;
- }
-
- s3vScreen->textureSize = vDRIPriv->texSize;
- s3vScreen->logTextureGranularity = vDRIPriv->logTextureGranularity;
- s3vScreen->cpp = vDRIPriv->cpp;
- s3vScreen->frontOffset = vDRIPriv->frontOffset;
- s3vScreen->frontPitch = vDRIPriv->frontPitch;
- s3vScreen->backOffset = vDRIPriv->backOffset;
- s3vScreen->backPitch = vDRIPriv->frontPitch; /* FIXME: check */
- s3vScreen->depthOffset = vDRIPriv->depthOffset;
- s3vScreen->depthPitch = vDRIPriv->frontPitch;
- s3vScreen->texOffset = vDRIPriv->texOffset;
-
- s3vScreen->driScreen = sPriv;
-
- DEBUG(("vDRIPriv->width =%i; vDRIPriv->deviceID =%x\n", vDRIPriv->width,
- vDRIPriv->deviceID));
- DEBUG(("vDRIPriv->mem =%i\n", vDRIPriv->mem));
- DEBUG(("vDRIPriv->fbOffset =%i\n", vDRIPriv->fbOffset));
- DEBUG((" ps3vDRI->fbStride =%i\n", vDRIPriv->fbStride));
- DEBUG(("s3vScreen->cpp = %i\n", s3vScreen->cpp));
- DEBUG(("s3vScreen->backOffset = %x\n", s3vScreen->backOffset));
- DEBUG(("s3vScreen->depthOffset = %x\n", s3vScreen->depthOffset));
- DEBUG(("s3vScreen->texOffset = %x\n", s3vScreen->texOffset));
- DEBUG(("I will return from s3vCreateScreen now\n"));
-
- DEBUG(("s3vScreen->bufs = 0x%x\n", s3vScreen->bufs));
- return s3vScreen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-void s3vDestroyScreen( __DRIscreenPrivate *sPriv )
-{
- s3vScreenPtr s3vScreen = (s3vScreenPtr)sPriv->private;
-
- DEBUG(("s3vDestroyScreen\n"));
-
- /* First, unmap the dma buffers */
-/*
- drmUnmapBufs( s3vScreen->bufs );
-*/
- /* Next, unmap all the regions */
-/* while (s3vScreen->regionCount > 0) {
-
- (void)drmUnmap(s3vScreen->regions[s3vScreen->regionCount].map,
- s3vScreen->regions[s3vScreen->regionCount].size);
- s3vScreen->regionCount--;
-
- }
- FREE(s3vScreen->regions); */
- if (s3vScreen)
- FREE(s3vScreen);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.h
deleted file mode 100644
index 0c4f69efa..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_screen.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "mtypes.h"
-
-typedef struct _s3vRegion {
- drm_handle_t handle;
- drmSize size;
- drmAddress map;
-} s3vRegion, *s3vRegionPtr;
-
-typedef struct {
-
- int regionCount; /* Count of register regions */
- s3vRegion *regions; /* Vector of mapped region info */
-
- drmBufMapPtr bufs; /* Map of DMA buffers */
-
- __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */
-
- int cpp;
- int frontPitch;
- int frontOffset;
-
- int backPitch;
- int backOffset;
- int backX;
- int backY;
-
- int depthOffset;
- int depthPitch;
-
- int texOffset;
- int textureOffset;
- int textureSize;
- int logTextureGranularity;
-} s3vScreenRec, *s3vScreenPtr;
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_span.c
deleted file mode 100644
index 49135a9c3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_span.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "s3v_context.h"
-#include "s3v_lock.h"
-
-#include "swrast/swrast.h"
-
-#define _SPANLOCK 1
-#define DBG 0
-
-#define LOCAL_VARS \
- s3vContextPtr vmesa = S3V_CONTEXT(ctx); \
- s3vScreenPtr s3vscrn = vmesa->s3vScreen; \
- __DRIscreenPrivate *sPriv = vmesa->driScreen; \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
- GLuint pitch = ( (vmesa->Flags & S3V_BACK_BUFFER) ? \
- ((dPriv->w+31)&~31) * s3vscrn->cpp \
- : sPriv->fbWidth * s3vscrn->cpp); \
- GLuint height = dPriv->h; \
- char *buf = ( (vmesa->Flags & S3V_BACK_BUFFER) ? \
- (char *)(sPriv->pFB + vmesa->drawOffset) \
- : (char *)(sPriv->pFB + vmesa->drawOffset \
- + dPriv->x * s3vscrn->cpp + dPriv->y * pitch) ); \
- char *read_buf = ( (vmesa->Flags & S3V_BACK_BUFFER) ? \
- (char *)(sPriv->pFB + vmesa->drawOffset) \
- : (char *)(sPriv->pFB + vmesa->drawOffset \
- + dPriv->x * s3vscrn->cpp + dPriv->y * pitch) ); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p; (void) pitch
-
-/* FIXME! Depth/Stencil read/writes don't work ! */
-#define LOCAL_DEPTH_VARS \
- s3vScreenPtr s3vscrn = vmesa->s3vScreen; \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
- __DRIscreenPrivate *sPriv = vmesa->driScreen; \
- GLuint pitch = s3vscrn->depthPitch; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(sPriv->pFB + \
- s3vscrn->depthOffset); /* + \
- dPriv->x * s3vscrn->cpp + \
- dPriv->y * pitch)*/ \
- (void) pitch
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP( _y ) (height - _y - 1)
-
-#if _SPANLOCK /* OK, we lock */
-
-#define HW_LOCK() \
- s3vContextPtr vmesa = S3V_CONTEXT(ctx); \
- (void) vmesa; \
- DMAFLUSH(); \
- S3V_SIMPLE_FLUSH_LOCK(vmesa);
-#define HW_UNLOCK() S3V_SIMPLE_UNLOCK(vmesa);
-
-#else /* plz, don't lock */
-
-#define HW_LOCK() \
- s3vContextPtr vmesa = S3V_CONTEXT(ctx); \
- (void) vmesa; \
- DMAFLUSH();
-#define HW_UNLOCK()
-
-#endif
-
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define INIT_MONO_PIXEL(p, color) \
- p = S3VIRGEPACKCOLOR555( color[0], color[1], color[2], color[3] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
-do { \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 7) | \
- (((int)g & 0xf8) << 2) | \
- (((int)b & 0xf8) >> 3)); \
- DEBUG(("buf=0x%x drawOffset=0x%x dPriv->x=%i s3vscrn->cpp=%i dPriv->y=%i pitch=%i\n", \
- sPriv->pFB, vmesa->drawOffset, dPriv->x, s3vscrn->cpp, dPriv->y, pitch)); \
- DEBUG(("dPriv->w = %i\n", dPriv->w)); \
-} while(0)
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (p >> 7) & 0xf8; \
- rgba[1] = (p >> 2) & 0xf8; \
- rgba[2] = (p << 3) & 0xf8; \
- rgba[3] = 0xff; /*
- if ( rgba[0] & 0x08 ) rgba[0] |= 0x07; \
- if ( rgba[1] & 0x04 ) rgba[1] |= 0x03; \
- if ( rgba[2] & 0x08 ) rgba[2] |= 0x07; */ \
- } while (0)
-
-#define TAG(x) s3v##x##_RGB555
-#include "spantmp.h"
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-
-#undef INIT_MONO_PIXEL
-#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 ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
- (g << 8) | \
- (r << 16) | \
- (a << 24) )
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
-} while (0)
-
-#define TAG(x) s3v##x##_ARGB8888
-#include "spantmp.h"
-
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + _x*2 + _y*dPriv->w*2) = d
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + _x*2 + _y*dPriv->w*2);
-
-#define TAG(x) s3v##x##_16
-#include "depthtmp.h"
-
-
-
-
-/* 32 bit depthbuffer functions.
- */
-#if 0
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch);
-
-#define TAG(x) s3v##x##_32
-#include "depthtmp.h"
-#endif
-
-
-/* 24/8 bit interleaved depth/stencil functions
- */
-#if 0
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
- tmp &= 0xff; \
- tmp |= (d) & 0xffffff00; \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & ~0xff
-
-
-#define TAG(x) s3v##x##_24_8
-#include "depthtmp.h"
-
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
- tmp &= 0xffffff00; \
- tmp |= d & 0xff; \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xff
-
-#define TAG(x) s3v##x##_24_8
-#include "stenciltmp.h"
-
-#endif
-
-static void s3vSetBuffer( GLcontext *ctx, GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- vmesa->drawOffset = vmesa->readOffset = 0;
- break;
- case BUFFER_BIT_BACK_LEFT:
- vmesa->drawOffset = vmesa->readOffset = vmesa->driScreen->fbHeight *
- vmesa->driScreen->fbWidth *
- vmesa->s3vScreen->cpp;
- break;
- }
-}
-
-
-void s3vInitSpanFuncs( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = s3vSetBuffer;
-
-#if 0
- switch ( vmesa->s3vScreen->cpp ) {
- case 2:
- swdd->WriteRGBASpan = s3vWriteRGBASpan_RGB555;
- swdd->WriteRGBSpan = s3vWriteRGBSpan_RGB555;
- swdd->WriteMonoRGBASpan = s3vWriteMonoRGBASpan_RGB555;
- swdd->WriteRGBAPixels = s3vWriteRGBAPixels_RGB555;
- swdd->WriteMonoRGBAPixels = s3vWriteMonoRGBAPixels_RGB555;
- swdd->ReadRGBASpan = s3vReadRGBASpan_RGB555;
- swdd->ReadRGBAPixels = s3vReadRGBAPixels_RGB555;
- break;
-
- case 4:
- swdd->WriteRGBASpan = s3vWriteRGBASpan_ARGB8888;
- swdd->WriteRGBSpan = s3vWriteRGBSpan_ARGB8888;
- swdd->WriteMonoRGBASpan = s3vWriteMonoRGBASpan_ARGB8888;
- swdd->WriteRGBAPixels = s3vWriteRGBAPixels_ARGB8888;
- swdd->WriteMonoRGBAPixels = s3vWriteMonoRGBAPixels_ARGB8888;
-#if 1
- swdd->ReadRGBASpan = s3vReadRGBASpan_ARGB8888;
-#else
- swdd->ReadRGBASpan = s3vReadRGBASpan8888;
-#endif
- swdd->ReadRGBAPixels = s3vReadRGBAPixels_ARGB8888;
- break;
-
- default:
- break;
- }
-#endif
-
- switch ( vmesa->glCtx->Visual.depthBits ) {
- case 15:
- case 16:
-#if 0
- swdd->ReadDepthSpan = s3vReadDepthSpan_16;
- swdd->WriteDepthSpan = s3vWriteDepthSpan_16;
- swdd->ReadDepthPixels = s3vReadDepthPixels_16;
- swdd->WriteDepthPixels = s3vWriteDepthPixels_16;
-#endif
- break;
-
-#if 0
- case 24:
- swdd->ReadDepthSpan = s3vReadDepthSpan_24_8;
- swdd->WriteDepthSpan = s3vWriteDepthSpan_24_8;
- swdd->ReadDepthPixels = s3vReadDepthPixels_24_8;
- swdd->WriteDepthPixels = s3vWriteDepthPixels_24_8;
-
- swdd->ReadStencilSpan = s3vReadStencilSpan_24_8;
- swdd->WriteStencilSpan = s3vWriteStencilSpan_24_8;
- swdd->ReadStencilPixels = s3vReadStencilPixels_24_8;
- swdd->WriteStencilPixels = s3vWriteStencilPixels_24_8;
- break;
-#endif
-
- default:
- break;
- }
-}
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-s3vSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = s3vReadRGBASpan_RGB555;
- drb->Base.GetValues = s3vReadRGBAPixels_RGB555;
- drb->Base.PutRow = s3vWriteRGBASpan_RGB555;
- drb->Base.PutRowRGB = s3vWriteRGBSpan_RGB555;
- drb->Base.PutMonoRow = s3vWriteMonoRGBASpan_RGB555;
- drb->Base.PutValues = s3vWriteRGBAPixels_RGB555;
- drb->Base.PutMonoValues = s3vWriteMonoRGBAPixels_RGB555;
- }
- else {
- drb->Base.GetRow = s3vReadRGBASpan_ARGB8888;
- drb->Base.GetValues = s3vReadRGBAPixels_ARGB8888;
- drb->Base.PutRow = s3vWriteRGBASpan_ARGB8888;
- drb->Base.PutRowRGB = s3vWriteRGBSpan_ARGB8888;
- drb->Base.PutMonoRow = s3vWriteMonoRGBASpan_ARGB8888;
- drb->Base.PutValues = s3vWriteRGBAPixels_ARGB8888;
- drb->Base.PutMonoValues = s3vWriteMonoRGBAPixels_ARGB8888;
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = s3vReadDepthSpan_16;
- drb->Base.GetValues = s3vReadDepthPixels_16;
- drb->Base.PutRow = s3vWriteDepthSpan_16;
- drb->Base.PutMonoRow = s3vWriteMonoDepthSpan_16;
- drb->Base.PutValues = s3vWriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = NULL;
- drb->Base.GetValues = NULL;
- drb->Base.PutRow = NULL;
- drb->Base.PutMonoRow = NULL;
- drb->Base.PutValues = NULL;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_state.c
deleted file mode 100644
index 84aaf4c5b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_state.c
+++ /dev/null
@@ -1,888 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include <X11/Xlibint.h>
-#include "s3v_context.h"
-#include "s3v_macros.h"
-#include "macros.h"
-#include "s3v_dri.h"
-#include "colormac.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-
-/* #define DEBUG(str) printf str */
-#define ENABLELIGHTING 0
-
-
-/* =============================================================
- * Alpha blending
- */
-
-static void s3vUpdateAlphaMode( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- CARD32 cmd = vmesa->CMD;
- cmd &= ~ALPHA_BLEND_MASK;
-
- if ( ctx->Color.BlendEnabled ) {
- DEBUG(("ctx->Color.AlphaEnabled = 1"));
- vmesa->_alpha[0] = ALPHA_SRC;
- vmesa->_alpha[1] = vmesa->_alpha_tex; /* FIXME: not all tex modes
- support alpha */
- } else {
- DEBUG(("ctx->Color.AlphaEnabled = 0"));
- vmesa->_alpha[0] = vmesa->_alpha[1] = ALPHA_OFF;
- }
-#if 1
- if ((cmd & DO_MASK) & DO_3D_LINE) { /* we are drawing 3d lines */
- /* which don't support tex */
- cmd |= vmesa->_alpha[0];
- } else {
- cmd |= vmesa->_alpha[vmesa->_3d_mode];
- }
-
- vmesa->CMD = cmd; /* FIXME: enough? */
-#else
- vmesa->restore_primitive = -1;
-#endif
-
-}
-
-static void s3vDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- DEBUG(("s3vDDAlphaFunc\n"));
-
- vmesa->new_state |= S3V_NEW_ALPHA;
-}
-
-static void s3vDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- DEBUG(("s3vDDBlendFunc\n"));
-
- vmesa->new_state |= S3V_NEW_ALPHA;
-}
-
-/* ================================================================
- * Buffer clear
- */
-
-static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- unsigned int _stride;
-
- vmesa->restore_primitive = -1;
-
- /* Update and emit any new state. We need to do this here to catch
- * changes to the masks.
- * FIXME: Just update the masks?
- */
-
- if ( vmesa->new_state )
- s3vDDUpdateHWState( ctx );
-
-/* s3vUpdateMasks( ctx ); */
-/* s3vUpdateClipping( ctx ); */
-/* s3vEmitHwState( vmesa ); */
-
-
-#if 1 /* soft (0)/hw (1)*/
-
- DEBUG(("*** s3vDDClear ***\n"));
-
- DMAOUT_CHECK(BITBLT_SRC_BASE, 15);
- DMAOUT(vmesa->SrcBase);
- DMAOUT(vmesa->DestBlit);
- DMAOUT( vmesa->ScissorLR );
- DMAOUT( vmesa->ScissorTB );
- DMAOUT( (vmesa->SrcStride << 16) | vmesa->SrcStride ); /* FIXME: unify */
- DMAOUT( (~(0)) ); /* masks */
- DMAOUT( (~(0)) );
- DMAOUT(0);
- DMAOUT(vmesa->ClearColor);
- DMAOUT(0);
- DMAOUT(0);
- /* FIXME */
- DMAOUT(0x16000122 | 0x5 | (0xF0 << 17)); /* black magic to me */
- DMAOUT(vmesa->ScissorWH);
- DMAOUT(vmesa->SrcXY);
- DMAOUT(vmesa->DestXY);
- DMAFINISH();
-
- if (mask & BUFFER_BIT_DEPTH) { /* depth */
- DEBUG(("BUFFER_BIT_DEPTH\n"));
-
- _stride = ((cw+31)&~31) * 2;
-
- DMAOUT_CHECK(BITBLT_SRC_BASE, 15);
- DMAOUT(0);
- DMAOUT(vmesa->s3vScreen->depthOffset);
- DMAOUT( (0 << 16) | cw );
- DMAOUT( (0 << 16) | ch );
- DMAOUT( (vmesa->SrcStride << 16) | vmesa->DestStride );
- DMAOUT( (~(0)) ); /* masks */
- DMAOUT( (~(0)) );
- DMAOUT(0);
- DMAOUT(vmesa->ClearDepth); /* 0x7FFF */
- /* FIXME */
- DMAOUT(0);
- DMAOUT(0);
- DMAOUT(0x16000122 | 0x5 | (0xF0 << 17));
- DMAOUT( ((cw-1) << 16) | (ch-1) );
- DMAOUT(0);
- DMAOUT( (0 << 16) | 0 );
- DMAFINISH();
-
- DEBUG(("vmesa->ClearDepth = 0x%x\n", vmesa->ClearDepth));
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if (!vmesa->NotClipped) {
- DEBUG(("vmesa->NotClipped\n")); /* yes */
- }
-
- if (!(vmesa->EnabledFlags & S3V_BACK_BUFFER)) {
- DEBUG(("!S3V_BACK_BUFFER -> flush\n"));
- DMAFLUSH();
- }
-/*
- if ( mask )
- DEBUG(("still masked ;3(\n")); */ /* yes */
-#else
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-#endif
-}
-
-/* =============================================================
- * Depth testing
- */
-
-static void s3vUpdateZMode( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- CARD32 cmd = vmesa->CMD;
-
- DEBUG(("Depth.Test = %i\n", ctx->Depth.Test));
- DEBUG(("CMD was = 0x%x ", cmd));
-
-/* printf("depth --- CMD was = 0x%x \n", cmd); */
-
- cmd &= ~Z_MASK; /* 0xfc0fffff; */
- /* Z_BUFFER */ /* 000 mode */ /* Z_UPDATE_OFF */
-
- if (!ctx->Depth.Test)
- cmd |= Z_OFF;
-
- if ( ctx->Depth.Mask )
- cmd |= Z_UPDATE_ON;
-
- switch ( ctx->Depth.Func ) {
- case GL_NEVER:
- cmd |= Z_NEVER;
- break;
- case GL_ALWAYS:
- cmd |= Z_ALWAYS;
- break;
- case GL_LESS:
- cmd |= Z_LESS;
- break;
- case GL_LEQUAL:
- cmd |= Z_LEQUAL;
- break;
- case GL_EQUAL:
- cmd |= Z_EQUAL;
- break;
- case GL_GEQUAL:
- cmd |= Z_GEQUAL;
- break;
- case GL_GREATER:
- cmd |= Z_GREATER;
- break;
- case GL_NOTEQUAL:
- cmd |= Z_NOTEQUAL;
- break;
- }
-
- DEBUG(("CMD is 0x%x\n", cmd));
-
- vmesa->dirty |= S3V_UPLOAD_DEPTH;
- vmesa->CMD = cmd;
-}
-
-static void s3vDDDepthFunc( GLcontext *ctx, GLenum func )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
-/* FLUSH_BATCH( vmesa ); */
- DEBUG(("s3vDDDepthFunc\n"));
- vmesa->new_state |= S3V_NEW_DEPTH;
-}
-
-static void s3vDDDepthMask( GLcontext *ctx, GLboolean flag )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- /* FLUSH_BATCH( vmesa ); */
- DEBUG(("s3vDDDepthMask\n"));
- vmesa->new_state |= S3V_NEW_DEPTH;
-}
-
-static void s3vDDClearDepth( GLcontext *ctx, GLclampd d )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- switch ( vmesa->DepthSize ) {
- case 15:
- case 16:
- vmesa->ClearDepth = d * 0x0000ffff; /* 65536 */
- DEBUG(("GLclampd d = %f\n", d));
- DEBUG(("ctx->Depth.Clear = %f\n", ctx->Depth.Clear));
- DEBUG(("(They should be the same)\n"));
- break;
- case 24:
- vmesa->ClearDepth = d * 0x00ffffff;
- break;
- case 32:
- vmesa->ClearDepth = d * 0xffffffff;
- break;
- }
-}
-
-static void s3vDDFinish( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- DMAFLUSH();
-}
-
-static void s3vDDFlush( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- DMAFLUSH();
-}
-
-/* =============================================================
- * Fog
- */
-
-static void s3vUpdateFogAttrib( GLcontext *ctx )
-{
-/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */
-
- if (ctx->Fog.Enabled) {
- } else {
- }
-
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- break;
- case GL_EXP:
- break;
- case GL_EXP2:
- break;
- }
-}
-
-static void s3vDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- vmesa->new_state |= S3V_NEW_FOG;
-}
-
-/* =============================================================
- * Lines
- */
-static void s3vDDLineWidth( GLcontext *ctx, GLfloat width )
-{
- /* FIXME: on virge you only have one size of 3d lines *
- * if we wanted more, we should start using tris instead *
- * but virge has problem with some tris when all of the *
- * vertices stay on a line */
-}
-
-/* =============================================================
- * Points
- */
-static void s3vDDPointSize( GLcontext *ctx, GLfloat size )
-{
- /* FIXME: we use 3d line to fake points. So same limitations
- * as above apply */
-}
-
-/* =============================================================
- * Polygon
- */
-
-static void s3vUpdatePolygon( GLcontext *ctx )
-{
- /* FIXME: I don't think we could do much here */
-
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- vmesa->dirty |= S3V_UPLOAD_POLYGON;
-}
-
-/* =============================================================
- * Clipping
- */
-
-static void s3vUpdateClipping( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
-
- int x0,y0,x1,y1;
-
- DEBUG((">>> s3vUpdateClipping <<<\n"));
-/*
- if ( vmesa->driDrawable ) {
- DEBUG(("s3vUpdateClipping\n"));
-*/
- if (vmesa->EnabledFlags & S3V_BACK_BUFFER) {
- DEBUG(("S3V_BACK_BUFFER\n"));
-
- x0 = 0;
- y0 = 0;
- x1 = dPriv->w - 1;
- y1 = dPriv->h - 1;
-
- vmesa->SrcBase = 0;
- vmesa->DestBase = vmesa->s3vScreen->backOffset;
- vmesa->DestBlit = vmesa->DestBase;
- vmesa->ScissorLR = ( (0 << 16) | (dPriv->w-1) );
- vmesa->ScissorTB = ( (0 << 16) | (dPriv->h-1) );
-/*
- vmesa->ScissorLR = ( (x0 << 16) | x1 );
- vmesa->ScissorTB = ( (y0 << 16) | y1 );
-*/
- vmesa->SrcStride = ( ((dPriv->w+31)&~31) * vmesa->s3vScreen->cpp );
- vmesa->DestStride = vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp;
- vmesa->ScissorWH = ( (dPriv->w << 16) | dPriv->h );
- vmesa->SrcXY = 0;
-/* vmesa->DestXY = ( (dPriv->x << 16) | dPriv->y ); */
- vmesa->DestXY = ( (0 << 16) | 0 );
- } else {
- DEBUG(("S3V_FRONT_BUFFER\n"));
-
- x0 = dPriv->x;
- y0 = dPriv->y;
- x1 = x0 + dPriv->w - 1;
- y1 = y0 + dPriv->h - 1;
-
- vmesa->SrcBase = 0;
- vmesa->DestBase = 0;
- vmesa->ScissorLR = ( (x0 << 16) | x1 );
- vmesa->ScissorTB = ( (y0 << 16) | y1 );
- vmesa->DestStride = vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp;
- vmesa->SrcStride = vmesa->DestStride;
- vmesa->DestBase = (y0 * vmesa->DestStride)
- + x0*vmesa->s3vScreen->cpp;
- vmesa->DestBlit = 0;
- vmesa->ScissorWH = ( (x1 << 16) | y1 );
- vmesa->SrcXY = 0;
- vmesa->DestXY = ( (0 << 16) | 0 );
-/* vmesa->DestXY = ( (dPriv->x << 16) | dPriv->y ); */
- }
-
- DEBUG(("x0=%i y0=%i x1=%i y1=%i\n", x0, y0, x1, y1));
- DEBUG(("stride=%i rectWH=0x%x\n\n", vmesa->DestStride, vmesa->ScissorWH));
-
- /* FIXME: how could we use the following info? */
- /* if (ctx->Scissor.Enabled) {} */
-
- vmesa->dirty |= S3V_UPLOAD_CLIP;
-/* } */
-}
-
-static void s3vDDScissor( GLcontext *ctx,
- GLint x, GLint y, GLsizei w, GLsizei h )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- DEBUG((">>> s3vDDScissor <<<"));
- /* FLUSH_BATCH( vmesa ); */
- vmesa->new_state |= S3V_NEW_CLIP;
-}
-
-/* =============================================================
- * Culling
- */
-
-static void s3vUpdateCull( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- GLfloat backface_sign = 1;
-
- DEBUG(("s3vUpdateCull\n"));
- /* FIXME: GL_FRONT_AND_BACK */
-
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CCW)
- backface_sign = -1;
- break;
-
- case GL_FRONT:
- if (ctx->Polygon.FrontFace != GL_CCW)
- backface_sign = -1;
- break;
-
- default:
- break;
- }
-
- vmesa->backface_sign = backface_sign;
- vmesa->dirty |= S3V_UPLOAD_GEOMETRY;
-}
-
-
-static void s3vDDCullFace( GLcontext *ctx, GLenum mode )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- /* FLUSH_BATCH( vmesa ); */
- vmesa->new_state |= S3V_NEW_CULL;
-}
-
-static void s3vDDFrontFace( GLcontext *ctx, GLenum mode )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- /* FLUSH_BATCH( vmesa ); */
- vmesa->new_state |= S3V_NEW_CULL;
-}
-
-/* =============================================================
- * Masks
- */
-
-static void s3vUpdateMasks( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- GLuint mask = s3vPackColor( vmesa->s3vScreen->cpp,
- ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] );
-
- if (vmesa->s3vScreen->cpp == 2) mask |= mask << 16;
-
- /* FIXME: can we do something in virge? */
-}
-/*
-static void s3vDDColorMask( GLcontext *ctx, GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- FLUSH_BATCH( vmesa );
- vmesa->new_state |= S3V_NEW_MASKS;
-}
-*/
-/* =============================================================
- * Rendering attributes
- */
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void s3vDDClearColor( GLcontext *ctx, const GLfloat color[4])
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- DEBUG(("*** s3vDDClearColor\n"));
-
- vmesa->ClearColor = s3vPackColor( 2, /* vmesa->s3vScreen->cpp, */
- color[0], color[1], color[2], color[3] );
-
-#if 0
- if (vmesa->s3vScreen->cpp == 2) vmesa->ClearColor |= vmesa->ClearColor<<16;
-#endif
-}
-
-static void s3vDDSetDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- int found = GL_TRUE;
-
- DEBUG(("*** s3vDDSetDrawBuffer ***\n"));
-
- /* FLUSH_BATCH( vmesa ); */
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- vmesa->drawOffset = vmesa->s3vScreen->frontOffset;
- break;
- case GL_BACK_LEFT:
- vmesa->drawOffset = vmesa->s3vScreen->backOffset;
- /* vmesa->driScreen->fbHeight *
- * vmesa->driScreen->fbWidth *
- * vmesa->s3vScreen->cpp; */
- break;
- default:
- found = GL_FALSE;
- break;
- }
-
- DEBUG(("vmesa->drawOffset = 0x%x\n", vmesa->drawOffset));
-/* return GL_TRUE; */
-}
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-void s3vUpdateWindow( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset =
- vmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat sx = v[MAT_SX];
- GLfloat tx = v[MAT_TX] + xoffset;
- GLfloat sy = v[MAT_SY];
- GLfloat ty = v[MAT_TY] + yoffset;
- GLfloat sz = v[MAT_SZ] * vmesa->depth_scale;
- GLfloat tz = v[MAT_TZ] * vmesa->depth_scale;
-
- vmesa->dirty |= S3V_UPLOAD_VIEWPORT;
-
- vmesa->ViewportScaleX = sx;
- vmesa->ViewportScaleY = sy;
- vmesa->ViewportScaleZ = sz;
- vmesa->ViewportOffsetX = tx;
- vmesa->ViewportOffsetY = ty;
- vmesa->ViewportOffsetZ = tz;
-}
-
-
-/*
-static void s3vDDViewport( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- s3vUpdateWindow( ctx );
-}
-
-static void s3vDDDepthRange( GLcontext *ctx, GLclampd nearval,
- GLclampd farval )
-{
- s3vUpdateWindow( ctx );
-}
-*/
-void s3vUpdateViewportOffset( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
- GLfloat xoffset = (GLfloat)dPriv->x;
- GLfloat yoffset =
- vmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h;
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- GLfloat tx = v[MAT_TX] + xoffset;
- GLfloat ty = v[MAT_TY] + yoffset;
-
- DEBUG(("*** s3vUpdateViewportOffset ***\n"));
-
- if ( vmesa->ViewportOffsetX != tx ||
- vmesa->ViewportOffsetY != ty )
- {
- vmesa->ViewportOffsetX = tx;
- vmesa->ViewportOffsetY = ty;
-
- vmesa->new_state |= S3V_NEW_WINDOW;
- }
-
-/* vmesa->new_state |= S3V_NEW_CLIP; */
-}
-
-/* =============================================================
- * State enable/disable
- */
-
-static void s3vDDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- switch ( cap ) {
- case GL_ALPHA_TEST:
- case GL_BLEND:
- vmesa->new_state |= S3V_NEW_ALPHA;
- DEBUG(("s3vDDEnable: GL_BLEND\n"));
- break;
-
- case GL_CULL_FACE:
- vmesa->new_state |= S3V_NEW_CULL;
- DEBUG(("s3vDDEnable: GL_CULL_FACE\n"));
- break;
-
- case GL_DEPTH_TEST:
- vmesa->new_state |= S3V_NEW_DEPTH;
- DEBUG(("s3vDDEnable: GL_DEPTH\n"));
- break;
-#if 0
- case GL_FOG:
- vmesa->new_state |= S3V_NEW_FOG;
- break;
-#endif
-
- case GL_SCISSOR_TEST:
- vmesa->new_state |= S3V_NEW_CLIP;
- break;
-
- case GL_TEXTURE_2D:
- DEBUG(("*** GL_TEXTURE_2D: %i\n", state));
- vmesa->_3d_mode = state;
- vmesa->restore_primitive = -1;
- break;
-
- default:
- return;
- }
-}
-
-/* =============================================================
- * State initialization, management
- */
-
-
-/*
- * Load the current context's state into the hardware.
- *
- * NOTE: Be VERY careful about ensuring the context state is marked for
- * upload, the only place it shouldn't be uploaded is when the setup
- * state has changed in ReducedPrimitiveChange as this comes right after
- * a state update.
- *
- * Blits of any type should always upload the context and masks after
- * they are done.
- */
-void s3vEmitHwState( s3vContextPtr vmesa )
-{
- if (!vmesa->driDrawable) return;
- if (!vmesa->dirty) return;
-
- DEBUG(("**********************\n"));
- DEBUG(("*** s3vEmitHwState ***\n"));
- DEBUG(("**********************\n"));
-
- if (vmesa->dirty & S3V_UPLOAD_VIEWPORT) {
- vmesa->dirty &= ~S3V_UPLOAD_VIEWPORT;
- DEBUG(("S3V_UPLOAD_VIEWPORT\n"));
- }
-
- if ( (vmesa->dirty & S3V_UPLOAD_POINTMODE) ||
- (vmesa->dirty & S3V_UPLOAD_LINEMODE) ||
- (vmesa->dirty & S3V_UPLOAD_TRIMODE) ) {
-
- }
-
- if (vmesa->dirty & S3V_UPLOAD_POINTMODE) {
- vmesa->dirty &= ~S3V_UPLOAD_POINTMODE;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_LINEMODE) {
- vmesa->dirty &= ~S3V_UPLOAD_LINEMODE;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_TRIMODE) {
- vmesa->dirty &= ~S3V_UPLOAD_TRIMODE;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_FOG) {
- GLchan c[3], col;
- UNCLAMPED_FLOAT_TO_RGB_CHAN( c, vmesa->glCtx->Fog.Color );
- DEBUG(("uploading ** FOG **\n"));
- col = s3vPackColor(2, c[0], c[1], c[2], 0);
- vmesa->dirty &= ~S3V_UPLOAD_FOG;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_DITHER) {
- vmesa->dirty &= ~S3V_UPLOAD_DITHER;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_LOGICOP) {
- vmesa->dirty &= ~S3V_UPLOAD_LOGICOP;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_CLIP) {
- vmesa->dirty &= ~S3V_UPLOAD_CLIP;
- DEBUG(("S3V_UPLOAD_CLIP\n"));
- DEBUG(("vmesa->ScissorLR: %i\n", vmesa->ScissorLR));
- DEBUG(("vmesa->ScissorTB: %i\n", vmesa->ScissorTB));
- }
-
- if (vmesa->dirty & S3V_UPLOAD_MASKS) {
- vmesa->dirty &= ~S3V_UPLOAD_MASKS;
- DEBUG(("S3V_UPLOAD_BLEND\n"));
- }
-
- if (vmesa->dirty & S3V_UPLOAD_ALPHA) {
- vmesa->dirty &= ~S3V_UPLOAD_ALPHA;
- DEBUG(("S3V_UPLOAD_ALPHA\n"));
- }
-
- if (vmesa->dirty & S3V_UPLOAD_SHADE) {
- vmesa->dirty &= ~S3V_UPLOAD_SHADE;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_POLYGON) {
- vmesa->dirty &= ~S3V_UPLOAD_POLYGON;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_DEPTH) {
- vmesa->dirty &= ~S3V_UPLOAD_DEPTH;
- DEBUG(("S3V_UPLOAD_DEPTH: DepthMode = 0x%x08\n", vmesa->DepthMode));
- }
-
- if (vmesa->dirty & S3V_UPLOAD_GEOMETRY) {
- vmesa->dirty &= ~S3V_UPLOAD_GEOMETRY;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_TRANSFORM) {
- vmesa->dirty &= ~S3V_UPLOAD_TRANSFORM;
- }
-
- if (vmesa->dirty & S3V_UPLOAD_TEX0) {
- s3vTextureObjectPtr curTex = vmesa->CurrentTexObj[0];
- vmesa->dirty &= ~S3V_UPLOAD_TEX0;
- DEBUG(("S3V_UPLOAD_TEX0\n"));
- if (curTex) {
- DEBUG(("S3V_UPLOAD_TEX0: curTex\n"));
- } else {
- DEBUG(("S3V_UPLOAD_TEX0: !curTex\n"));
- }
- }
-}
-
-void s3vDDUpdateHWState( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- int new_state = vmesa->new_state;
-
- /* s3vUpdateClipping( ctx ); */
-
- if ( new_state )
- {
-
- vmesa->new_state = 0;
-
- /* Update the various parts of the context's state.
- */
- if ( new_state & S3V_NEW_ALPHA )
- s3vUpdateAlphaMode( ctx );
-
- if ( new_state & S3V_NEW_DEPTH )
- s3vUpdateZMode( ctx );
-
- if ( new_state & S3V_NEW_FOG )
- s3vUpdateFogAttrib( ctx );
-
- if ( new_state & S3V_NEW_CLIP )
- {
- DEBUG(("---> going to s3vUpdateClipping\n"));
- s3vUpdateClipping( ctx );
- }
-
- if ( new_state & S3V_NEW_POLYGON )
- s3vUpdatePolygon( ctx );
-
- if ( new_state & S3V_NEW_CULL )
- s3vUpdateCull( ctx );
-
- if ( new_state & S3V_NEW_MASKS )
- s3vUpdateMasks( ctx );
-
- if ( new_state & S3V_NEW_WINDOW )
- s3vUpdateWindow( ctx );
-/*
- if ( new_state & S3_NEW_TEXTURE )
- s3vUpdateTextureState( ctx );
-*/
- CMDCHANGE();
- }
-
- /* HACK ! */
- s3vEmitHwState( vmesa );
-}
-
-
-static void s3vDDUpdateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- S3V_CONTEXT(ctx)->new_gl_state |= new_state;
-}
-
-
-/* Initialize the context's hardware state.
- */
-void s3vInitState( s3vContextPtr vmesa )
-{
- vmesa->new_state = 0;
-}
-
-/* Initialize the driver's state functions.
- */
-void s3vInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = s3vDDUpdateState;
-
- ctx->Driver.Clear = s3vDDClear;
- ctx->Driver.ClearIndex = NULL;
- ctx->Driver.ClearColor = s3vDDClearColor;
- ctx->Driver.DrawBuffer = s3vDDSetDrawBuffer;
- ctx->Driver.ReadBuffer = NULL; /* XXX */
-
- ctx->Driver.IndexMask = NULL;
- ctx->Driver.ColorMask = NULL; /* s3vDDColorMask; */ /* FIXME */
-
- ctx->Driver.AlphaFunc = s3vDDAlphaFunc; /* FIXME */
-#if 0
- ctx->Driver.BlendEquation = NULL; /* s3vDDBlendEquation; */
- ctx->Driver.BlendFunc = s3vDDBlendFunc; /* FIXME */
-#endif
- ctx->Driver.BlendFuncSeparate = NULL; /* s3vDDBlendFuncSeparate; */
- ctx->Driver.ClearDepth = s3vDDClearDepth;
- ctx->Driver.CullFace = s3vDDCullFace;
- ctx->Driver.FrontFace = s3vDDFrontFace;
- ctx->Driver.DepthFunc = s3vDDDepthFunc; /* FIXME */
- ctx->Driver.DepthMask = s3vDDDepthMask; /* FIXME */
- ctx->Driver.DepthRange = NULL; /* s3vDDDepthRange; */
- ctx->Driver.Enable = s3vDDEnable; /* FIXME */
- ctx->Driver.Finish = s3vDDFinish;
- ctx->Driver.Flush = s3vDDFlush;
-#if 1
- ctx->Driver.Fogfv = NULL; /* s3vDDFogfv; */
-#endif
- ctx->Driver.Hint = NULL;
- ctx->Driver.LineWidth = NULL; /* s3vDDLineWidth; */
- ctx->Driver.LineStipple = NULL; /* s3vDDLineStipple; */
-#if ENABLELIGHTING
- ctx->Driver.Lightfv = NULL; /* s3vDDLightfv; */
-
- ctx->Driver.LightModelfv = NULL; /* s3vDDLightModelfv; */
-#endif
- ctx->Driver.LogicOpcode = NULL; /* s3vDDLogicalOpcode; */
- ctx->Driver.PointSize = NULL; /* s3vDDPointSize; */
- ctx->Driver.PolygonMode = NULL; /* s3vDDPolygonMode; */
- ctx->Driver.PolygonStipple = NULL; /* s3vDDPolygonStipple; */
- ctx->Driver.Scissor = s3vDDScissor; /* ScissorLR / ScissorTB */
- ctx->Driver.ShadeModel = NULL; /* s3vDDShadeModel; */
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
- ctx->Driver.Viewport = NULL; /* s3vDDViewport; */
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.c
deleted file mode 100644
index 5bee051b0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.c
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-#include "s3v_context.h"
-#include "s3v_tex.h"
-
-
-extern void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t);
-extern void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t);
-
-/*
-static GLuint s3vComputeLodBias(GLfloat bias)
-{
-#if TEX_DEBUG_ON
- DEBUG_TEX(("*** s3vComputeLodBias ***\n"));
-#endif
- return bias;
-}
-*/
-
-static void s3vSetTexWrapping(s3vContextPtr vmesa,
- s3vTextureObjectPtr t,
- GLenum wraps, GLenum wrapt)
-{
- GLuint t0 = t->TextureCMD;
- GLuint cmd = vmesa->CMD;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vSetTexWrapping: #%i ***\n", ++times));
-#endif
-
-
- t0 &= ~TEX_WRAP_MASK;
- cmd &= ~TEX_WRAP_MASK;
-
- if ((wraps != GL_CLAMP) || (wrapt != GL_CLAMP)) {
- DEBUG(("TEX_WRAP_ON\n"));
- t0 |= TEX_WRAP_ON;
- cmd |= TEX_WRAP_ON;
- }
-
- cmd |= TEX_WRAP_ON; /* FIXME: broken if off */
- t->TextureCMD = t0;
- vmesa->CMD = cmd;
-}
-
-
-static void s3vSetTexFilter(s3vContextPtr vmesa,
- s3vTextureObjectPtr t,
- GLenum minf, GLenum magf)
-{
- GLuint t0 = t->TextureCMD;
- GLuint cmd = vmesa->CMD;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vSetTexFilter: #%i ***\n", ++times));
-#endif
-
- t0 &= ~TEX_FILTER_MASK;
- cmd &= ~TEX_FILTER_MASK;
-
- switch (minf) {
- case GL_NEAREST:
- DEBUG(("GL_NEAREST\n"));
- t0 |= NEAREST;
- cmd |= NEAREST;
- break;
- case GL_LINEAR:
- DEBUG(("GL_LINEAR\n"));
- t0 |= LINEAR;
- cmd |= LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- DEBUG(("GL_MIPMAP_NEAREST\n"));
- t0 |= MIP_NEAREST;
- cmd |= MIP_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- DEBUG(("GL_LINEAR_MIPMAP_NEAREST\n"));
- t0 |= LINEAR_MIP_NEAREST;
- cmd |= LINEAR_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- DEBUG(("GL_NEAREST_MIPMAP_LINEAR\n"));
- t0 |= MIP_LINEAR;
- cmd |= MIP_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- DEBUG(("GL_LINEAR_MIPMAP_LINEAR\n"));
- t0 |= LINEAR_MIP_LINEAR;
- cmd |= LINEAR_MIP_LINEAR;
- break;
- default:
- break;
- }
- /* FIXME: bilinear? */
-
-#if 0
- switch (magf) {
- case GL_NEAREST:
- break;
- case GL_LINEAR:
- break;
- default:
- break;
- }
-#endif
-
- t->TextureCMD = t0;
-
- DEBUG(("CMD was = 0x%x\n", vmesa->CMD));
- DEBUG(("CMD is = 0x%x\n", cmd));
-
- vmesa->CMD = cmd;
- /* CMDCHANGE(); */
-}
-
-
-static void s3vSetTexBorderColor(s3vContextPtr vmesa,
- s3vTextureObjectPtr t,
- GLubyte color[4])
-{
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vSetTexBorderColor: #%i ***\n", ++times));
-#endif
-
- /*FIXME: it should depend on tex col format */
- /* switch(t0 ... t->TextureColorMode) */
-
- /* case TEX_COL_ARGB1555: */
- t->TextureBorderColor =
- S3VIRGEPACKCOLOR555(color[0], color[1], color[2], color[3]);
-
- DEBUG(("TextureBorderColor = 0x%x\n", t->TextureBorderColor));
-
- vmesa->TextureBorderColor = t->TextureBorderColor;
-}
-
-static void s3vTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexParameter: #%i ***\n", ++times));
-#endif
-
- if (!t) return;
-
- /* Can't do the update now as we don't know whether to flush
- * vertices or not. Setting vmesa->new_state means that
- * s3vUpdateTextureState() will be called before any triangles are
- * rendered. If a statechange has occurred, it will be detected at
- * that point, and buffered vertices flushed.
- */
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- s3vSetTexBorderColor( vmesa, t, tObj->_BorderChan );
- break;
-
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- /* This isn't the most efficient solution but there doesn't appear to
- * be a nice alternative for Virge. Since there's no LOD clamping,
- * we just have to rely on loading the right subset of mipmap levels
- * to simulate a clamped LOD.
- */
- s3vSwapOutTexObj( vmesa, t );
- break;
-
- default:
- return;
- }
-
- if (t == vmesa->CurrentTexObj[0])
- vmesa->dirty |= S3V_UPLOAD_TEX0;
-
-#if 0
- if (t == vmesa->CurrentTexObj[1]) {
- vmesa->dirty |= S3V_UPLOAD_TEX1;
- }
-#endif
-}
-
-
-static void s3vTexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- GLuint unit = ctx->Texture.CurrentUnit;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexEnv: #%i ***\n", ++times));
-#endif
-
- /* Only one env color. Need a fallback if env colors are different
- * and texture setup references env color in both units.
- */
- switch (pname) {
- case GL_TEXTURE_ENV_COLOR: {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLfloat *fc = texUnit->EnvColor;
- GLuint r, g, b, a, col;
- CLAMPED_FLOAT_TO_UBYTE(r, fc[0]);
- CLAMPED_FLOAT_TO_UBYTE(g, fc[1]);
- CLAMPED_FLOAT_TO_UBYTE(b, fc[2]);
- CLAMPED_FLOAT_TO_UBYTE(a, fc[3]);
-
- col = ((a << 24) |
- (r << 16) |
- (g << 8) |
- (b << 0));
-
- break;
- }
- case GL_TEXTURE_ENV_MODE:
- vmesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */
- break;
- case GL_TEXTURE_LOD_BIAS_EXT: {
-/*
- struct gl_texture_object *tObj =
- ctx->Texture.Unit[unit]._Current;
-
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData;
-*/
- break;
- }
- default:
- break;
- }
-}
-
-static void s3vTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *pack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexImage1D: #%i ***\n", ++times));
-#endif
-
-#if 1
- if (t) {
-#if _TEXFLUSH
- DMAFLUSH();
-#endif
- s3vSwapOutTexObj( vmesa, t );
-/*
- s3vDestroyTexObj( vmesa, t );
- texObj->DriverData = 0;
-*/
- }
-#endif
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, pack, texObj, texImage );
-}
-
-static void s3vTexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *pack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexSubImage1D: #%i ***\n", ++times));
-#endif
-
-#if 1
- if (t) {
-#if _TEXFLUSH
- DMAFLUSH();
-#endif
- s3vSwapOutTexObj( vmesa, t );
-/*
- s3vDestroyTexObj( vmesa, t );
- texObj->DriverData = 0;
-*/
- }
-#endif
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, pack, texObj,
- texImage);
-}
-
-static void s3vTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData;
-
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexImage2D: #%i ***\n", ++times));
-#endif
-
-#if 1
- if (t) {
-#if _TEXFLUSH
- DMAFLUSH();
-#endif
- s3vSwapOutTexObj( vmesa, t );
-/*
- s3vDestroyTexObj( vmesa, t );
- texObj->DriverData = 0;
-*/
- }
-#endif
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
-}
-
-static void s3vTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexSubImage2D: #%i ***\n", ++times));
-#endif
-
-#if 1
- if (t) {
-#if _TEXFLUSH
- DMAFLUSH();
-#endif
- s3vSwapOutTexObj( vmesa, t );
-/*
- s3vDestroyTexObj( vmesa, t );
- texObj->DriverData = 0;
-*/
- }
-#endif
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-}
-
-
-static void s3vBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData;
- GLuint cmd = vmesa->CMD;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vBindTexture: #%i ***\n", ++times));
-#endif
-
- if (!t) {
-/*
- GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias;
-*/
- t = CALLOC_STRUCT(s3v_texture_object_t);
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->globj = tObj;
-#if 0
- if (target == GL_TEXTURE_2D) {
- } else
- if (target == GL_TEXTURE_1D) {
- }
-
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- t->TextureFormat = (TF_LittleEndian |
-#else
- t->TextureFormat = (TF_BigEndian |
-#endif
-#endif
- t->dirty_images = ~0;
-
- tObj->DriverData = t;
- make_empty_list( t );
-#if 0
- s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT );
- s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter );
- s3vSetTexBorderColor( vmesa, t, tObj->BorderColor );
-#endif
- }
-
- cmd = vmesa->CMD & ~MIP_MASK;
- vmesa->dirty |= S3V_UPLOAD_TEX0;
- vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel];
- vmesa->TexStride = t->Pitch;
- cmd |= MIPMAP_LEVEL(t->WidthLog2);
- vmesa->CMD = cmd;
- vmesa->restore_primitive = -1;
-#if 0
- printf("t->TextureBaseAddr[0] = 0x%x\n", t->TextureBaseAddr[0]);
- printf("t->TextureBaseAddr[1] = 0x%x\n", t->TextureBaseAddr[1]);
- printf("t->TextureBaseAddr[2] = 0x%x\n", t->TextureBaseAddr[2]);
-#endif
-}
-
-
-static void s3vDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vDeleteTexture: #%i ***\n", ++times));
-#endif
-
- if (t) {
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
-
-#if _TEXFLUSH
- if (vmesa) {
- DMAFLUSH();
- }
-#endif
-
- s3vDestroyTexObj( vmesa, t );
- tObj->DriverData = 0;
-
- }
-}
-
-static GLboolean s3vIsTextureResident( GLcontext *ctx,
- struct gl_texture_object *tObj )
-{
- s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vIsTextureResident: #%i ***\n", ++times));
-#endif
-
- return (t && t->MemBlock);
-}
-
-static void s3vInitTextureObjects( GLcontext *ctx )
-{
- /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */
- struct gl_texture_object *texObj;
- GLuint tmp = ctx->Texture.CurrentUnit;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vInitTextureObjects: #%i ***\n", ++times));
-#endif
-
-#if 1
- ctx->Texture.CurrentUnit = 0;
-
- texObj = ctx->Texture.Unit[0].Current1D;
- s3vBindTexture( ctx, GL_TEXTURE_1D, texObj );
-
- texObj = ctx->Texture.Unit[0].Current2D;
- s3vBindTexture( ctx, GL_TEXTURE_2D, texObj );
-#endif
-
-#if 0
- ctx->Texture.CurrentUnit = 1;
-
- texObj = ctx->Texture.Unit[1].Current1D;
- s3vBindTexture( ctx, GL_TEXTURE_1D, texObj );
-
- texObj = ctx->Texture.Unit[1].Current2D;
- s3vBindTexture( ctx, GL_TEXTURE_2D, texObj );
-#endif
-
- ctx->Texture.CurrentUnit = tmp;
-}
-
-
-void s3vInitTextureFuncs( GLcontext *ctx )
-{
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vInitTextureFuncs: #%i ***\n", ++times));
-#endif
-
- ctx->Driver.TexEnv = s3vTexEnv;
- ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format;
- ctx->Driver.TexImage1D = _mesa_store_teximage1d;
- ctx->Driver.TexImage2D = s3vTexImage2D;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d;
- ctx->Driver.TexSubImage2D = s3vTexSubImage2D;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
- ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
- ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
- ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- ctx->Driver.BindTexture = s3vBindTexture;
- ctx->Driver.DeleteTexture = s3vDeleteTexture;
- ctx->Driver.TexParameter = s3vTexParameter;
- ctx->Driver.UpdateTexturePalette = 0;
- ctx->Driver.IsTextureResident = s3vIsTextureResident;
- ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
-
- s3vInitTextureObjects( ctx );
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.h
deleted file mode 100644
index a823fe245..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tex.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef _S3V_TEX_H
-#define _S3V_TEX_H
-
-#define TEX_DEBUG_ON 0
-
-extern void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t );
-
-#if TEX_DEBUG_ON
-#define DEBUG_TEX(str) printf str
-#else
-#define DEBUG_TEX(str) /* str */
-#endif
-
-#define _TEXFLUSH 1 /* flush before uploading */
-#define _TEXLOCK 1 /* lock before writing new texures to card mem */
- /* if you turn it on you will gain stability and image
- quality, but you will loose performance (~10%) */
-#define _TEXFALLBACK 0 /* fallback to software for -big- textures (slow) */
- /* turning this off, you will lose some tex (e.g. mountains
- on tuxracer) but you will increase average playability */
-
-#define _TEXALIGN 0x00000007
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texmem.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texmem.c
deleted file mode 100644
index 0ce3ff5fc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texmem.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
-#include "s3v_context.h"
-#include "s3v_lock.h"
-#include "s3v_tex.h"
-
-void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t);
-void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t );
-
-
-void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t)
-{
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vDestroyTexObj: #%i ***\n", ++times));
-#endif
-
- if (!t) return;
-
-/* FIXME: useful? */
-#if _TEXFLUSH
- if (vmesa)
- DMAFLUSH();
-#endif
-
- /* This is sad - need to sync *in case* we upload a texture
- * to this newly free memory...
- */
- if (t->MemBlock) {
- mmFreeMem(t->MemBlock);
- t->MemBlock = 0;
-
- if (vmesa && t->age > vmesa->dirtyAge)
- vmesa->dirtyAge = t->age;
- }
-
- if (t->globj)
- t->globj->DriverData = NULL;
-
- if (vmesa) {
- if (vmesa->CurrentTexObj[0] == t) {
- vmesa->CurrentTexObj[0] = 0;
- vmesa->dirty &= ~S3V_UPLOAD_TEX0;
- }
-
-#if 0
- if (vmesa->CurrentTexObj[1] == t) {
- vmesa->CurrentTexObj[1] = 0;
- vmesa->dirty &= ~S3V_UPLOAD_TEX1;
- }
-#endif
- }
-
- remove_from_list(t);
- FREE(t);
-}
-
-
-void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t)
-{
-/* int i; */
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vSwapOutTexObj: #%i ***\n", ++times));
-#endif
-
- if (t->MemBlock) {
-
- mmFreeMem(t->MemBlock);
- t->MemBlock = 0;
-
- if (t->age > vmesa->dirtyAge)
- vmesa->dirtyAge = t->age;
-
- t->dirty_images = ~0;
- move_to_tail(&(vmesa->SwappedOut), t);
- }
-}
-
-
-/* Upload an image from mesa's internal copy.
- */
-
-static void s3vUploadTexLevel( s3vContextPtr vmesa, s3vTextureObjectPtr t,
- int level )
-{
- __DRIscreenPrivate *sPriv = vmesa->driScreen;
- const struct gl_texture_image *image = t->image[level].image;
- int i,j;
- int l2d;
- /* int offset = 0; */
- int words;
- GLuint* dest;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
-#endif
- if ( !image ) return;
- if (image->Data == 0) return;
-
- DEBUG_TEX(("*** s3vUploadTexLevel: #%i ***\n", ++times));
- DEBUG_TEX(("level = %i\n", level));
-
- l2d = 5; /* 32bits per texel == 1<<5 */
-/*
- if (level == 0)
- ;
-*/
- DEBUG_TEX(("t->image[%i].offset = 0x%x\n",
- level, t->image[level].offset));
-
- t->TextureBaseAddr[level] = (GLuint)(t->BufAddr + t->image[level].offset
- + _TEXALIGN) & (GLuint)(~_TEXALIGN);
- dest = (GLuint*)(sPriv->pFB + t->TextureBaseAddr[level]);
-
- DEBUG_TEX(("sPriv->pFB = 0x%x\n", sPriv->pFB));
- DEBUG_TEX(("dest = 0x%x\n", dest));
- DEBUG_TEX(("dest - sPriv->pFB = 0x%x\n", ((int)dest - (int)sPriv->pFB)));
-
- /* NOTE: we implicitly suppose t->texelBytes == 2 */
-
- words = (image->Width * image->Height) >> 1;
-
- DEBUG_TEX(("\n\n"));
-
- switch (t->image[level].internalFormat) {
- case GL_RGB:
- case 3:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_RGB:\n"));
-/*
- if (level == 0)
- ;
-*/
- /* The UGLY way, and SLOW : use DMA FIXME ! */
-
- for (i = 0; i < words; i++) {
- unsigned int data;
- /* data = PACK_COLOR_565(src[0],src[1],src[2]); */
- data = S3VIRGEPACKCOLOR555(src[0],src[1],src[2],255)
- |(S3VIRGEPACKCOLOR555(src[3],src[4],src[5],255)<<16);
-
- *dest++ = data;
- /* src += 3; */
- src +=6;
- }
- }
- break;
-
- case GL_RGBA:
- case 4:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_RGBA:\n"));
-/*
- if (level == 0)
- ;
-*/
- for (i = 0; i < words; i++) {
- unsigned int data;
-
- /* data = PACK_COLOR_8888(src[0],src[1],src[2],src[3]); */
- data = S3VIRGEPACKCOLOR4444(src[0], src[1],src[2], src[3])
- | (S3VIRGEPACKCOLOR4444(src[4], src[5], src[6], src[7]) << 16);
-
- *dest++ = data;
- /* src += 4; */
- src += 8;
- }
- }
- break;
-
- case GL_LUMINANCE:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_LUMINANCE:\n"));
-/*
- if (level == 0)
- ;
-*/
- for (i = 0; i < words; i++) {
- unsigned int data;
-
- /* data = PACK_COLOR_888(src[0],src[0],src[0]); */
- data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[0])
- | (S3VIRGEPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16);
-
- *dest++ = data;
- /* src ++; */
- src +=2;
- }
- }
- break;
-
- case GL_INTENSITY:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_INTENSITY:\n"));
-/*
- if (level == 0)
- ;
-*/
- for (i = 0; i < words; i++) {
- unsigned int data;
-
- /* data = PACK_COLOR_8888(src[0],src[0],src[0],src[0]); */
- data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[0])
- | (S3VIRGEPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16);
-
- *dest++ = data;
- /* src ++; */
- src += 2;
- }
- }
- break;
-
- case GL_LUMINANCE_ALPHA:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_LUMINANCE_ALPHA:\n"));
-/*
- if (level == 0)
- ;
-*/
- for (i = 0; i < words; i++) {
- unsigned int data;
-
- /* data = PACK_COLOR_8888(src[0],src[0],src[0],src[1]); */
- data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[1])
- | (S3VIRGEPACKCOLOR4444(src[2],src[2],src[2],src[3]) << 16);
-
- *dest++ = data;
- /* src += 2; */
- src += 4;
- }
- }
- break;
-
- case GL_ALPHA:
- {
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_ALPHA:\n"));
-/*
- if (level == 0)
- ;
-*/
- for (i = 0; i < words; i++) {
- unsigned int data;
-
- /* data = PACK_COLOR_8888(255,255,255,src[0]); */
- data = S3VIRGEPACKCOLOR4444(255,255,255,src[0])
- | (S3VIRGEPACKCOLOR4444(255,255,255,src[1]) << 16);
-
- *dest++ = data;
- /* src += 1; */
- src += 2;
- }
- }
- break;
-
- /* TODO: Translate color indices *now*:
- */
- case GL_COLOR_INDEX:
- {
-
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[level].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- DEBUG_TEX(("GL_COLOR_INDEX:\n"));
-
- for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
- for (i = 0 ; i < image->Width ; i++) {
- dst[i] = src[0];
- src += 1;
- }
- }
- }
- break;
-
- default:
- fprintf(stderr, "Not supported texture format %s\n",
- _mesa_lookup_enum_by_nr(image->Format));
- }
-
- DEBUG_TEX(("words = %i\n\n", words));
-}
-
-void s3vPrintLocalLRU( s3vContextPtr vmesa )
-{
- s3vTextureObjectPtr t;
- int sz = 1 << (vmesa->s3vScreen->logTextureGranularity);
-
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vPrintLocalLRU: #%i ***\n", ++times));
-#endif
-
- foreach( t, &vmesa->TexObjList ) {
- if (!t->globj)
- fprintf(stderr, "Placeholder %d at %x sz %x\n",
- t->MemBlock->ofs / sz,
- t->MemBlock->ofs,
- t->MemBlock->size);
- else
- fprintf(stderr, "Texture at %x sz %x\n",
- t->MemBlock->ofs,
- t->MemBlock->size);
-
- }
-}
-
-void s3vPrintGlobalLRU( s3vContextPtr vmesa )
-{
- int i, j;
- S3VTexRegionPtr list = vmesa->sarea->texList;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vPrintGlobalLRU: #%i ***\n", ++times));
-#endif
-
- for (i = 0, j = S3V_NR_TEX_REGIONS ; i < S3V_NR_TEX_REGIONS ; i++) {
- fprintf(stderr, "list[%d] age %d next %d prev %d\n",
- j, list[j].age, list[j].next, list[j].prev);
- j = list[j].next;
- if (j == S3V_NR_TEX_REGIONS) break;
- }
-
- if (j != S3V_NR_TEX_REGIONS)
- fprintf(stderr, "Loop detected in global LRU\n");
-}
-
-
-void s3vResetGlobalLRU( s3vContextPtr vmesa )
-{
- S3VTexRegionPtr list = vmesa->sarea->texList;
- int sz = 1 << vmesa->s3vScreen->logTextureGranularity;
- int i;
-
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vResetGlobalLRU: #%i ***\n", ++times));
-#endif
-
- /* (Re)initialize the global circular LRU list. The last element
- * in the array (S3V_NR_TEX_REGIONS) is the sentinal. Keeping it
- * at the end of the array allows it to be addressed rationally
- * when looking up objects at a particular location in texture
- * memory.
- */
- for (i = 0 ; (i+1) * sz <= vmesa->s3vScreen->textureSize ; i++) {
- list[i].prev = i-1;
- list[i].next = i+1;
- list[i].age = 0;
- }
-
- i--;
- list[0].prev = S3V_NR_TEX_REGIONS;
- list[i].prev = i-1;
- list[i].next = S3V_NR_TEX_REGIONS;
- list[S3V_NR_TEX_REGIONS].prev = i;
- list[S3V_NR_TEX_REGIONS].next = 0;
- vmesa->sarea->texAge = 0;
-}
-
-
-void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t )
-{
-/*
- int i;
- int logsz = vmesa->s3vScreen->logTextureGranularity;
- int start = t->MemBlock->ofs >> logsz;
- int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz;
- S3VTexRegionPtr list = vmesa->sarea->texList;
-*/
-
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vUpdateTexLRU: #%i ***\n", ++times));
-#endif
-
- vmesa->texAge = ++vmesa->sarea->texAge;
-
- /* Update our local LRU
- */
- move_to_head( &(vmesa->TexObjList), t );
-
- /* Update the global LRU
- */
-#if 0
- for (i = start ; i <= end ; i++) {
-
- list[i].in_use = 1;
- list[i].age = vmesa->texAge;
-
- /* 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 = S3V_NR_TEX_REGIONS;
- list[i].next = list[S3V_NR_TEX_REGIONS].next;
- list[(unsigned)list[S3V_NR_TEX_REGIONS].next].prev = i;
- list[S3V_NR_TEX_REGIONS].next = i;
- }
-#endif
-}
-
-
-/* Called for every shared texture region which has increased in age
- * since we last held the lock.
- *
- * Figures out which of our textures have been ejected by other clients,
- * and pushes a placeholder texture onto the LRU list to represent
- * the other client's textures.
- */
-void s3vTexturesGone( s3vContextPtr vmesa,
- GLuint offset,
- GLuint size,
- GLuint in_use )
-{
- s3vTextureObjectPtr t, tmp;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vTexturesGone: #%i ***\n", ++times));
-#endif
-
- foreach_s ( t, tmp, &vmesa->TexObjList ) {
-
- if (t->MemBlock->ofs >= offset + size ||
- t->MemBlock->ofs + t->MemBlock->size <= offset)
- continue;
-
- /* It overlaps - kick it off. Need to hold onto the currently bound
- * objects, however.
- */
- s3vSwapOutTexObj( vmesa, t );
- }
-
- if (in_use) {
- t = (s3vTextureObjectPtr) calloc(1,sizeof(*t));
- if (!t) return;
-
- t->MemBlock = mmAllocMem( vmesa->texHeap, size, 0, offset);
- insert_at_head( &vmesa->TexObjList, t );
- }
-
- /* Reload any lost textures referenced by current vertex buffer.
- */
-#if 0
- if (vmesa->vertex_buffer) {
- int i, j;
-
- fprintf(stderr, "\n\nreload tex\n");
-
- for (i = 0 ; i < vmesa->statenr ; i++) {
- for (j = 0 ; j < 2 ; j++) {
- s3vTextureObjectPtr t = vmesa->state_tex[j][i];
- if (t) {
- if (t->MemBlock == 0)
- s3vUploadTexImages( vmesa, t );
- }
- }
- }
-
- /* Hard to do this with the lock held:
- */
- /* S3V_FIREVERTICES( vmesa ); */
- }
-#endif
-}
-
-
-/* This is called with the lock held. May have to eject our own and/or
- * other client's texture objects to make room for the upload.
- */
-void s3vUploadTexImages( s3vContextPtr vmesa, s3vTextureObjectPtr t )
-{
- int i;
- int ofs;
- int numLevels;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- static unsigned int try=0;
-
- DEBUG_TEX(("*** s3vUploadTexImages: #%i ***\n", ++times));
- DEBUG_TEX(("vmesa->texHeap = 0x%x; t->totalSize = %i\n",
- (unsigned int)vmesa->texHeap, t->totalSize));
-#endif
-
- /* Do we need to eject LRU texture objects?
- */
- if (!t->MemBlock) {
-
- while (1)
- {
- /* int try = 0; */
- DEBUG_TEX(("trying to alloc mem for tex (try %i)\n", ++try));
-
- t->MemBlock = mmAllocMem( vmesa->texHeap, t->totalSize, 12, 0 );
-
- if (t->MemBlock)
- break;
-
- if (vmesa->TexObjList.prev == vmesa->CurrentTexObj[0]) {
-/* || vmesa->TexObjList.prev == vmesa->CurrentTexObj[1]) {
- fprintf(stderr, "Hit bound texture in upload\n");
- s3vPrintLocalLRU( vmesa ); */
- return;
- }
-
- if (vmesa->TexObjList.prev == &(vmesa->TexObjList)) {
-/* fprintf(stderr, "Failed to upload texture, sz %d\n",
- t->totalSize);
- mmDumpMemInfo( vmesa->texHeap ); */
- return;
- }
-
- DEBUG_TEX(("swapping out: %p\n", vmesa->TexObjList.prev));
- s3vSwapOutTexObj( vmesa, vmesa->TexObjList.prev );
- }
-
- ofs = t->MemBlock->ofs;
-
- t->BufAddr = vmesa->s3vScreen->texOffset + ofs;
-
- DEBUG_TEX(("ofs = 0x%x\n", ofs));
- DEBUG_TEX(("t->BufAddr = 0x%x\n", t->BufAddr));
-
-/* FIXME: check if we need it */
-#if 0
- if (t == vmesa->CurrentTexObj[0]) {
- vmesa->dirty |= S3V_UPLOAD_TEX0;
- vmesa->restore_primitive = -1;
- }
-#endif
-
-#if 0
- if (t == vmesa->CurrentTexObj[1])
- vmesa->dirty |= S3V_UPLOAD_TEX1;
-#endif
-
- s3vUpdateTexLRU( vmesa, t );
- }
-
-#if 0
- if (vmesa->dirtyAge >= GET_DISPATCH_AGE(vmesa))
- s3vWaitAgeLocked( vmesa, vmesa->dirtyAge );
-#endif
-
-#if _TEXLOCK
- S3V_SIMPLE_FLUSH_LOCK(vmesa);
-#endif
- numLevels = t->lastLevel - t->firstLevel + 1;
- for (i = 0 ; i < numLevels ; i++)
- if (t->dirty_images & (1<<i))
- s3vUploadTexLevel( vmesa, t, i );
-
- t->dirty_images = 0;
-#if _TEXLOCK
- S3V_SIMPLE_UNLOCK(vmesa);
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texstate.c
deleted file mode 100644
index b136c9d37..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_texstate.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
-#include "s3v_context.h"
-#include "s3v_tex.h"
-
-
-static void s3vSetTexImages( s3vContextPtr vmesa,
- struct gl_texture_object *tObj )
-{
- GLuint height, width, pitch, i, /*textureFormat,*/ log_pitch;
- s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
- GLint firstLevel, lastLevel, numLevels;
- GLint log2Width, log2Height;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vSetTexImages: #%i ***\n", ++times));
-#endif
-
- t->texelBytes = 2; /* FIXME: always 2 ? */
-
- /* Compute which mipmap levels we really want to send 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.
- * Yes, this looks overly complicated, but it's all needed.
- */
- if (tObj->MinFilter == GL_LINEAR || tObj->MinFilter == GL_NEAREST) {
- 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, tObj->BaseLevel);
- lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2);
- lastLevel = MIN2(lastLevel, tObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
- }
-
- /* save these values */
- t->firstLevel = firstLevel;
- t->lastLevel = lastLevel;
-
- numLevels = lastLevel - firstLevel + 1;
-
- log2Width = tObj->Image[0][firstLevel]->WidthLog2;
- log2Height = tObj->Image[0][firstLevel]->HeightLog2;
-
-
- /* Figure out the amount of memory required to hold all the mipmap
- * levels. Choose the smallest pitch to accomodate the largest
- * mipmap:
- */
- width = tObj->Image[0][firstLevel]->Width * t->texelBytes;
- for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 )
- log_pitch++;
-
- /* All images must be loaded at this pitch. Count the number of
- * lines required:
- */
- for ( height = i = 0 ; i < numLevels ; i++ ) {
- t->image[i].image = tObj->Image[0][firstLevel + i];
- t->image[i].offset = height * pitch;
- t->image[i].internalFormat = baseImage->Format;
- height += t->image[i].image->Height;
- t->TextureBaseAddr[i] = (t->BufAddr + t->image[i].offset +
- _TEXALIGN) & (GLuint)(~_TEXALIGN);
- }
-
- t->Pitch = pitch;
- t->WidthLog2 = log2Width;
- t->totalSize = height*pitch;
- t->max_level = i-1;
- vmesa->dirty |= S3V_UPLOAD_TEX0 /* | S3V_UPLOAD_TEX1*/;
- vmesa->restore_primitive = -1;
- DEBUG(("<><>pitch = TexStride = %i\n", pitch));
- DEBUG(("log2Width = %i\n", log2Width));
-
- s3vUploadTexImages( vmesa, t );
-}
-
-static void s3vUpdateTexEnv( GLcontext *ctx, GLuint unit )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *tObj = texUnit->_Current;
- const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
-/*
- s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData;
- GLuint tc;
-*/
- GLuint alpha = 0;
- GLuint cmd = vmesa->CMD;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vUpdateTexEnv: %i ***\n", ++times));
-#endif
-
- cmd &= ~TEX_COL_MASK;
- cmd &= ~TEX_BLEND_MAKS;
-/* cmd &= ~ALPHA_BLEND_MASK; */
-
- DEBUG(("format = "));
-
- switch (format) {
- case GL_RGB:
- DEBUG_TEX(("GL_RGB\n"));
- cmd |= TEX_COL_ARGB1555;
- break;
- case GL_LUMINANCE:
- DEBUG_TEX(("GL_LUMINANCE\n"));
- cmd |= TEX_COL_ARGB4444;
- alpha = 1; /* FIXME: check */
- break;
- case GL_ALPHA:
- DEBUG_TEX(("GL_ALPHA\n"));
- cmd |= TEX_COL_ARGB4444;
- alpha = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- DEBUG_TEX(("GL_LUMINANCE_ALPHA\n"));
- cmd |= TEX_COL_ARGB4444;
- alpha = 1;
- break;
- case GL_INTENSITY:
- DEBUG_TEX(("GL_INTENSITY\n"));
- cmd |= TEX_COL_ARGB4444;
- alpha = 1;
- break;
- case GL_RGBA:
- DEBUG_TEX(("GL_RGBA\n"));
- cmd |= TEX_COL_ARGB4444;
- alpha = 1;
- break;
- case GL_COLOR_INDEX:
- DEBUG_TEX(("GL_COLOR_INDEX\n"));
- cmd |= TEX_COL_PAL;
- break;
- }
-
- DEBUG_TEX(("EnvMode = "));
-
- switch (texUnit->EnvMode) {
- case GL_REPLACE:
- DEBUG_TEX(("GL_REPLACE\n"));
- cmd |= TEX_REFLECT; /* FIXME */
- vmesa->_tri[1] = DO_TEX_UNLIT_TRI; /* FIXME: white tri hack */
- vmesa->_alpha_tex = ALPHA_TEX /* * alpha */;
- break;
- case GL_MODULATE:
- DEBUG_TEX(("GL_MODULATE\n"));
- cmd |= TEX_MODULATE;
- vmesa->_tri[1] = DO_TEX_LIT_TRI;
-#if 0
- if (alpha)
- vmesa->_alpha_tex = ALPHA_TEX /* * alpha */;
- else
- vmesa->_alpha_tex = ALPHA_SRC /* * alpha */;
-#else
- vmesa->_alpha_tex = ALPHA_TEX ;
-#endif
- break;
- case GL_ADD:
- DEBUG_TEX(("DEBUG_TEX\n"));
- /* do nothing ???*/
- break;
- case GL_DECAL:
- DEBUG_TEX(("GL_DECAL\n"));
- cmd |= TEX_DECAL;
- vmesa->_tri[1] = DO_TEX_LIT_TRI;
- vmesa->_alpha_tex = ALPHA_OFF;
- break;
- case GL_BLEND:
- DEBUG_TEX(("GL_BLEND\n"));
- cmd |= TEX_DECAL;
- vmesa->_tri[1] = DO_TEX_LIT_TRI;
- vmesa->_alpha_tex = ALPHA_OFF; /* FIXME: sure? */
- break;
- default:
- fprintf(stderr, "unknown tex env mode");
- return;
- }
-
- DEBUG_TEX(("\n\n vmesa->CMD was 0x%x\n", vmesa->CMD));
- DEBUG_TEX(( " vmesa->CMD is 0x%x\n\n", cmd ));
-
- vmesa->_alpha[1] = vmesa->_alpha_tex;
- vmesa->CMD = cmd; /* | MIPMAP_LEVEL(8); */
- vmesa->restore_primitive = -1;
-}
-
-static void s3vUpdateTexUnit( GLcontext *ctx, GLuint unit )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint cmd = vmesa->CMD;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vUpdateTexUnit: %i ***\n", ++times));
- DEBUG_TEX(("and vmesa->CMD was 0x%x\n", vmesa->CMD));
-#endif
-
- if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT)
- {
- struct gl_texture_object *tObj = texUnit->_Current;
- s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData;
-
- /* Upload teximages (not pipelined)
- */
- if (t->dirty_images) {
-#if _TEXFLUSH
- DMAFLUSH();
-#endif
- s3vSetTexImages( vmesa, tObj );
- if (!t->MemBlock) {
-#if _TEXFALLBACK
- FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_TRUE );
-#endif
- return;
- }
- }
-
- /* Update state if this is a different texture object to last
- * time.
- */
-#if 1
- if (vmesa->CurrentTexObj[unit] != t) {
- vmesa->dirty |= S3V_UPLOAD_TEX0 /* << unit */;
- vmesa->CurrentTexObj[unit] = t;
- s3vUpdateTexLRU( vmesa, t ); /* done too often */
- }
-#endif
-
- /* Update texture environment if texture object image format or
- * texture environment state has changed.
- */
- if (tObj->Image[0][tObj->BaseLevel]->Format !=
- vmesa->TexEnvImageFmt[unit]) {
- vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
- s3vUpdateTexEnv( ctx, unit );
- }
-#if 1
- cmd = vmesa->CMD & ~MIP_MASK;
- vmesa->dirty |= S3V_UPLOAD_TEX0 /* << unit */;
- vmesa->CurrentTexObj[unit] = t;
- vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel];
- vmesa->TexStride = t->Pitch;
- cmd |= MIPMAP_LEVEL(t->WidthLog2);
-
- DEBUG_TEX(("\n\n>> vmesa->CMD was 0x%x\n", vmesa->CMD));
- DEBUG_TEX(( ">> vmesa->CMD is 0x%x\n\n", cmd ));
- DEBUG_TEX(("t->WidthLog2 = %i\n", t->WidthLog2));
- DEBUG_TEX(("MIPMAP_LEVEL(t->WidthLog2) = 0x%x\n", MIPMAP_LEVEL(t->WidthLog2)));
-
- vmesa->CMD = cmd;
- vmesa->restore_primitive = -1;
-#endif
- }
- else if (texUnit->_ReallyEnabled) { /* _ReallyEnabled but != TEXTURE0_2D */
-#if _TEXFALLBACK
- FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_TRUE );
-#endif
- }
- else /*if (vmesa->CurrentTexObj[unit])*/ { /* !_ReallyEnabled */
- vmesa->CurrentTexObj[unit] = 0;
- vmesa->TexEnvImageFmt[unit] = 0;
- vmesa->dirty &= ~(S3V_UPLOAD_TEX0<<unit);
- }
-}
-
-
-void s3vUpdateTextureState( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- (void) vmesa;
-#if TEX_DEBUG_ON
- static unsigned int times=0;
- DEBUG_TEX(("*** s3vUpdateTextureState: #%i ***\n", ++times));
-#endif
-
-#if _TEXFALLBACK
- FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_FALSE );
-#endif
- s3vUpdateTexUnit( ctx, 0 );
-#if 0
- s3vUpdateTexUnit( ctx, 1 );
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.c
deleted file mode 100644
index d6cceddd4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.c
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <sys/ioctl.h>
-
-#include "s3v_context.h"
-#include "s3v_vb.h"
-#include "s3v_tris.h"
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-
-/***********************************************************************
- * Build hardware rasterization functions *
- ***********************************************************************/
-
-#define DO_TRI 1
-#define HAVE_RGBA 1
-#define HAVE_SPEC 0
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX s3vVertex
-#define TAB rast_tab
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( v->ub4[4], c); \
-/* *(v->ub4[4]) = c; \ */ \
-} while (0)
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4]
-/*
-#define VERT_COPY_RGBA1( v0, v1 ) v0->ui[4] = v1->ui[4]
-*/
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx]
-
-#define S3V_OFFSET_BIT 0x01
-#define S3V_TWOSIDE_BIT 0x02
-#define S3V_UNFILLED_BIT 0x04
-#define S3V_FALLBACK_BIT 0x08
-#define S3V_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[S3V_MAX_TRIFUNC];
-
-#define S3V_RAST_CULL_BIT 0x01
-#define S3V_RAST_FLAT_BIT 0x02
-#define S3V_RAST_TEX_BIT 0x04
-
-static s3v_point_func s3v_point_tab[0x8];
-static s3v_line_func s3v_line_tab[0x8];
-static s3v_tri_func s3v_tri_tab[0x8];
-static s3v_quad_func s3v_quad_tab[0x8];
-
-#define IND (0)
-#define TAG(x) x
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_CULL_BIT)
-#define TAG(x) x##_cull
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_CULL_BIT|S3V_RAST_FLAT_BIT)
-#define TAG(x) x##_cull_flat
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_TEX_BIT)
-#define TAG(x) x##_tex
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_CULL_BIT|S3V_RAST_TEX_BIT)
-#define TAG(x) x##_cull_tex
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_FLAT_BIT|S3V_RAST_TEX_BIT)
-#define TAG(x) x##_flat_tex
-#include "s3v_tritmp.h"
-
-#define IND (S3V_RAST_CULL_BIT|S3V_RAST_FLAT_BIT|S3V_RAST_TEX_BIT)
-#define TAG(x) x##_cull_flat_tex
-#include "s3v_tritmp.h"
-
-static void init_rast_tab( void )
-{
- DEBUG(("*** init_rast_tab ***\n"));
-
- s3v_init();
- s3v_init_cull();
- s3v_init_flat();
- s3v_init_cull_flat();
- s3v_init_tex();
- s3v_init_cull_tex();
- s3v_init_flat_tex();
- s3v_init_cull_flat_tex();
-}
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-
-#if 0
-static void
-s3v_fallback_quad( s3vContextPtr vmesa,
- const s3vVertex *v0,
- const s3vVertex *v1,
- const s3vVertex *v2,
- const s3vVertex *v3 )
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[4];
- s3v_translate_vertex( ctx, v0, &v[0] );
- s3v_translate_vertex( ctx, v1, &v[1] );
- s3v_translate_vertex( ctx, v2, &v[2] );
- s3v_translate_vertex( ctx, v3, &v[3] );
- DEBUG(("s3v_fallback_quad\n"));
-/* _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] ); */
-}
-
-static void
-s3v_fallback_tri( s3vContextPtr vmesa,
- const s3vVertex *v0,
- const s3vVertex *v1,
- const s3vVertex *v2 )
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[3];
- s3v_translate_vertex( ctx, v0, &v[0] );
- s3v_translate_vertex( ctx, v1, &v[1] );
- s3v_translate_vertex( ctx, v2, &v[2] );
- DEBUG(("s3v_fallback_tri\n"));
-/* _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); */
-}
-
-static void
-s3v_fallback_line( s3vContextPtr vmesa,
- const s3vVertex *v0,
- const s3vVertex *v1 )
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[2];
- s3v_translate_vertex( ctx, v0, &v[0] );
- s3v_translate_vertex( ctx, v1, &v[1] );
- DEBUG(("s3v_fallback_line\n"));
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-/*
-static void
-s3v_fallback_point( s3vContextPtr vmesa,
- const s3vVertex *v0 )
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[1];
- s3v_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-*/
-#endif
-
-/***********************************************************************
- * Choose rasterization functions *
- ***********************************************************************/
-
-#define _S3V_NEW_RASTER_STATE (_NEW_FOG | \
- _NEW_TEXTURE | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_POINT_SMOOTH | \
- _DD_NEW_TRI_STIPPLE | \
- _DD_NEW_LINE_STIPPLE)
-
-#define LINE_FALLBACK (0)
-#define TRI_FALLBACK (0)
-
-static void s3v_nodraw_triangle(GLcontext *ctx, s3vVertex *v0,
- s3vVertex *v1, s3vVertex *v2)
-{
- (void) (ctx && v0 && v1 && v2);
-}
-
-static void s3v_nodraw_quad(GLcontext *ctx,
- s3vVertex *v0, s3vVertex *v1,
- s3vVertex *v2, s3vVertex *v3)
-{
- (void) (ctx && v0 && v1 && v2 && v3);
-}
-
-void s3vChooseRasterState(GLcontext *ctx);
-
-void s3vChooseRasterState(GLcontext *ctx)
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint ind = 0;
-
- DEBUG(("*** s3vChooseRasterState ***\n"));
-
- if (ctx->Polygon.CullFlag) {
- if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) {
- vmesa->draw_tri = (s3v_tri_func)s3v_nodraw_triangle;
- vmesa->draw_quad = (s3v_quad_func)s3v_nodraw_quad;
- return;
- }
- ind |= S3V_RAST_CULL_BIT;
- /* s3v_update_cullsign(ctx); */
- } /* else vmesa->backface_sign = 0; */
-
- if ( flags & DD_FLATSHADE )
- ind |= S3V_RAST_FLAT_BIT;
-
- if ( ctx->Texture.Unit[0]._ReallyEnabled ) {
- ind |= S3V_RAST_TEX_BIT;
- }
-
- DEBUG(("ind = %i\n", ind));
-
- vmesa->draw_line = s3v_line_tab[ind];
- vmesa->draw_tri = s3v_tri_tab[ind];
- vmesa->draw_quad = s3v_quad_tab[ind];
- vmesa->draw_point = s3v_point_tab[ind];
-
-#if 0
- /* Hook in fallbacks for specific primitives. CURRENTLY DISABLED
- */
-
- if (flags & LINE_FALLBACK)
- vmesa->draw_line = s3v_fallback_line;
-
- if (flags & TRI_FALLBACK) {
- DEBUG(("TRI_FALLBACK\n"));
- vmesa->draw_tri = s3v_fallback_tri;
- vmesa->draw_quad = s3v_fallback_quad;
- }
-#endif
-}
-
-
-
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( v0, v1, v2 ) \
-do { \
- /*
- if (DO_FALLBACK) \
- vmesa->draw_tri( vmesa, v0, v1, v2 ); \
- else */ \
- DEBUG(("TRI: max was here\n")); /* \
- s3v_draw_tex_triangle( vmesa, v0, v1, v2 ); */ \
- vmesa->draw_tri( vmesa, v0, v1, v2 ); \
-} while (0)
-
-#define QUAD( v0, v1, v2, v3 ) \
-do { \
- DEBUG(("QUAD: max was here\n")); \
- vmesa->draw_quad( vmesa, v0, v1, v2, v3 ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- DEBUG(("LINE: max was here\n")); \
- vmesa->draw_line( vmesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- vmesa->draw_point( vmesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-/*
-#define S3V_OFFSET_BIT 0x01
-#define S3V_TWOSIDE_BIT 0x02
-#define S3V_UNFILLED_BIT 0x04
-#define S3V_FALLBACK_BIT 0x08
-#define S3V_MAX_TRIFUNC 0x10
-
-
-static struct {
- points_func points;
- line_func line;
- triangle_func triangle;
- quad_func quad;
-} rast_tab[S3V_MAX_TRIFUNC];
-*/
-
-#define DO_FALLBACK (IND & S3V_FALLBACK_BIT)
-#define DO_OFFSET (IND & S3V_OFFSET_BIT)
-#define DO_UNFILLED (IND & S3V_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & S3V_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 0
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX s3vVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (vmesa->verts + (e<<vmesa->vertex_stride_shift))
-
-#if 0
-#define VERT_SET_RGBA( v, c ) \
-do { \
-/* UNCLAMPED_FLOAT_TO_RGBA_CHAN( v->ub4[4], c) */ \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4]
-/*
-#define VERT_COPY_RGBA1( v0, v1 ) v0->ui[4] = v1->ui[4]
-*/
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx]
-#endif
-
-#define LOCAL_VARS(n) \
- s3vContextPtr vmesa = S3V_CONTEXT(ctx); \
- GLuint color[n]; \
- (void) color;
-
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- PrimType_Points,
- PrimType_Lines,
- PrimType_Lines,
- PrimType_Lines,
- PrimType_Triangles,
- PrimType_Triangles,
- PrimType_Triangles,
- PrimType_Triangles,
- PrimType_Triangles,
- PrimType_Triangles
-};
-
-static void s3vResetLineStipple( GLcontext *ctx );
-static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim );
-/*
-extern static void s3v_lines_emit(GLcontext *ctx, GLuint start, GLuint end);
-extern static void s3v_tris_emit(GLcontext *ctx, GLuint start, GLuint end);
-*/
-#define RASTERIZE(x) if (vmesa->hw_primitive != hw_prim[x]) \
- s3vRasterPrimitive( ctx, hw_prim[x] )
-#define RENDER_PRIMITIVE vmesa->render_primitive
-#define TAG(x) x
-#define IND S3V_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_TWOSIDE_BIT|S3V_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_OFFSET_BIT|S3V_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_TWOSIDE_BIT|S3V_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (S3V_TWOSIDE_BIT|S3V_OFFSET_BIT|S3V_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_render_tab( void )
-{
- DEBUG(("*** init_render_tab ***\n"));
-
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
-}
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define VERT(x) (s3vVertex *)(s3vverts + (x << shift))
-
-#define RENDER_POINTS( start, count ) \
- DEBUG(("RENDER_POINTS...(ok)\n")); \
- for ( ; start < count ; start++) \
- vmesa->draw_line( vmesa, VERT(start), VERT(start) )
- /* vmesa->draw_point( vmesa, VERT(start) ) */
-
-#define RENDER_LINE( v0, v1 ) \
- /* DEBUG(("RENDER_LINE...(ok)\n")); \ */ \
- vmesa->draw_line( vmesa, VERT(v0), VERT(v1) ); \
- DEBUG(("RENDER_LINE...(ok)\n"))
-
-#define RENDER_TRI( v0, v1, v2 ) \
- DEBUG(("RENDER_TRI...(ok)\n")); \
- vmesa->draw_tri( vmesa, VERT(v0), VERT(v1), VERT(v2) )
-
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- DEBUG(("RENDER_QUAD...(ok)\n")); \
- /* s3v_draw_quad( vmesa, VERT(v0), VERT(v1), VERT(v2),VERT(v3) ) */\
- /* s3v_draw_triangle( vmesa, VERT(v0), VERT(v1), VERT(v2) ); \
- s3v_draw_triangle( vmesa, VERT(v0), VERT(v2), VERT(v3) ) */ \
- vmesa->draw_quad( vmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-
-#define INIT(x) s3vRenderPrimitive( ctx, x );
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- s3vContextPtr vmesa = S3V_CONTEXT(ctx); \
- const GLuint shift = vmesa->vertex_stride_shift; \
- const char *s3vverts = (char *)vmesa->verts; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) stipple;
-#define RESET_STIPPLE if ( stipple ) s3vResetLineStipple( ctx );
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) s3v_##x##_verts
-#include "tnl_dd/t_dd_rendertmp.h"
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-static void s3vRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint prim = vmesa->render_primitive;
-
- DEBUG(("I AM in: s3vRenderClippedPoly\n"));
-
- /* Render the new vertices as an unclipped polygon.
- */
- if (1)
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]
- ( ctx, 0, n, PRIM_BEGIN|PRIM_END );
-
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
-#if 1
- if (prim != GL_POLYGON) {
- DEBUG(("and prim != GL_POLYGON\n"));
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
- }
-
-#endif
-}
-
-static void s3vRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- /*tnl->Driver.LineFunc = s3v_line_tab[2];*/ /* _swsetup_Line; */
-
- DEBUG(("I AM in: s3vRenderClippedLine\n"));
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-
-#define _S3V_NEW_RENDERSTATE (_DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET)
-
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-static void s3vChooseRenderState(GLcontext *ctx)
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- DEBUG(("s3vChooseRenderState\n"));
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= S3V_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= S3V_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= S3V_UNFILLED_BIT;
- }
-
- DEBUG(("vmesa->RenderIndex = %i\n", vmesa->RenderIndex));
- DEBUG(("index = %i\n", index));
-
- if (vmesa->RenderIndex != index) {
- vmesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (vmesa->RenderIndex == 0)
- tnl->Driver.Render.PrimTabVerts = s3v_render_tab_verts;
- else
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = s3vRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = s3vRenderClippedPoly;
- }
-}
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in s3v_render.c.
- */
-
-static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-/* __DRIdrawablePrivate *dPriv = vmesa->driDrawable; */
- GLuint cmd = vmesa->CMD;
-
- unsigned int _hw_prim = hwprim;
-
- DEBUG(("s3vRasterPrimitive: hwprim = 0x%x ", _hw_prim));
-
-/* printf("* vmesa->CMD = 0x%x\n", vmesa->CMD); */
-
- if (vmesa->hw_primitive != _hw_prim)
- {
- DEBUG(("(new one) ***\n"));
- cmd &= ~DO_MASK;
- cmd &= ~ALPHA_BLEND_MASK;
- vmesa->hw_primitive = _hw_prim;
-
- if (_hw_prim == PrimType_Triangles) {
- /* TRI */
- DEBUG(("->switching to tri\n"));
- cmd |= (vmesa->_tri[vmesa->_3d_mode] | vmesa->_alpha[vmesa->_3d_mode]);
- } else if (_hw_prim == PrimType_Lines
- || _hw_prim == PrimType_Points) {
- /* LINE */
- DEBUG(("->switching to line\n"));
- cmd |= (DO_3D_LINE | vmesa->_alpha[0]);
- } else {
- /* ugh? */
- DEBUG(("->switching to your sis'ass\n"));
- }
-
- DEBUG(("\n"));
-
- vmesa->restore_primitive = _hw_prim;
- /* 0xacc16827: good value -> lightened newave!!! */
- vmesa->CMD = cmd;
- CMDCHANGE();
- }
-}
-
-static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
- GLuint cmd = vmesa->CMD;
-
- unsigned int _hw_prim = hw_prim[prim];
-
- vmesa->render_primitive = prim;
- vmesa->hw_primitive = _hw_prim;
-
- DEBUG(("s3vRenderPrimitive #%i ", prim));
- DEBUG(("_hw_prim = 0x%x\n", _hw_prim));
-
-/* printf(" vmesa->CMD = 0x%x\n", vmesa->CMD); */
-
- if (_hw_prim != vmesa->restore_primitive) {
- DEBUG(("_hw_prim != vmesa->restore_primitive (was 0x%x)\n",
- vmesa->restore_primitive));
-#if 1
- cmd &= ~DO_MASK;
- cmd &= ~ALPHA_BLEND_MASK;
-/*
- printf(" cmd = 0x%x\n", cmd);
- printf(" vmesa->_3d_mode=%i; vmesa->_tri[vmesa->_3d_mode]=0x%x\n",
- vmesa->_3d_mode, vmesa->_tri[vmesa->_3d_mode]);
- printf("vmesa->alpha[0] = 0x%x; vmesa->alpha[1] = 0x%x\n",
- vmesa->_alpha[0], vmesa->_alpha[1]);
-*/
- if (_hw_prim == PrimType_Triangles) { /* TRI */
- DEBUG(("->switching to tri\n"));
- cmd |= (vmesa->_tri[vmesa->_3d_mode] | vmesa->_alpha[vmesa->_3d_mode]);
- DEBUG(("vmesa->TexStride = %i\n", vmesa->TexStride));
- DEBUG(("vmesa->TexOffset = %i\n", vmesa->TexOffset));
- DMAOUT_CHECK(3DTRI_Z_BASE, 12);
- } else { /* LINE */
- DEBUG(("->switching to line\n"));
- cmd |= (DO_3D_LINE | vmesa->_alpha[0]);
- DMAOUT_CHECK(3DLINE_Z_BASE, 12);
- }
-
- DMAOUT(vmesa->s3vScreen->depthOffset & 0x003FFFF8);
- DMAOUT(vmesa->DestBase);
- /* DMAOUT(vmesa->ScissorLR); */
- /* DMAOUT(vmesa->ScissorTB); */
-
- /* NOTE: we need to restore all these values since we
- * are coming back from a vmesa->restore_primitive */
- DMAOUT( (0 << 16) | (dPriv->w-1) );
- DMAOUT( (0 << 16) | (dPriv->h-1) );
- DMAOUT( (vmesa->SrcStride << 16) | vmesa->TexStride );
- DMAOUT(vmesa->SrcStride);
- DMAOUT(vmesa->TexOffset);
- DMAOUT(vmesa->TextureBorderColor);
- DMAOUT(0); /* FOG */
- DMAOUT(0);
- DMAOUT(0);
- DMAOUT(cmd);
- /* 0xacc16827: good value -> lightened newave!!! */
- DMAFINISH();
-
- vmesa->CMD = cmd;
-#endif
- }
-
- DEBUG(("\n"));
-
- vmesa->restore_primitive = _hw_prim;
-}
-
-static void s3vRunPipeline( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-
- DEBUG(("*** s3vRunPipeline ***\n"));
-
- if ( vmesa->new_state )
- s3vDDUpdateHWState( ctx );
-
- if (vmesa->new_gl_state) {
-
- if (vmesa->new_gl_state & _NEW_TEXTURE) {
- s3vUpdateTextureState( ctx );
- }
-
- if (!vmesa->Fallback) {
- if (vmesa->new_gl_state & _S3V_NEW_VERTEX)
- s3vChooseVertexState( ctx );
-
- if (vmesa->new_gl_state & _S3V_NEW_RASTER_STATE)
- s3vChooseRasterState( ctx );
-
- if (vmesa->new_gl_state & _S3V_NEW_RENDERSTATE)
- s3vChooseRenderState( ctx );
- }
-
- vmesa->new_gl_state = 0;
-
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-static void s3vRenderStart( GLcontext *ctx )
-{
- /* Check for projective texturing. Make sure all texcoord
- * pointers point to something. (fix in mesa?)
- */
-
- DEBUG(("s3vRenderStart\n"));
- /* s3vCheckTexSizes( ctx ); */
-}
-
-static void s3vRenderFinish( GLcontext *ctx )
-{
- if (0)
- _swrast_flush( ctx ); /* never needed */
-}
-
-static void s3vResetLineStipple( GLcontext *ctx )
-{
-/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */
-
- /* Reset the hardware stipple counter.
- */
-/*
- CHECK_DMA_BUFFER(vmesa, 1);
- WRITE(vmesa->buf, UpdateLineStippleCounters, 0);
-*/
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-
-void s3vFallback( s3vContextPtr vmesa, GLuint bit, GLboolean mode )
-{
- GLcontext *ctx = vmesa->glCtx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = vmesa->Fallback;
-
- DEBUG(("*** s3vFallback: "));
-
- if (mode) {
- vmesa->Fallback |= bit;
- if (oldfallback == 0) {
- DEBUG(("oldfallback == 0 ***\n"));
- _swsetup_Wakeup( ctx );
- _tnl_need_projected_coords( ctx, GL_TRUE );
- vmesa->RenderIndex = ~0;
- }
- }
- else {
- DEBUG(("***\n"));
- vmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = s3vRenderStart;
- tnl->Driver.Render.PrimitiveNotify = s3vRenderPrimitive;
- tnl->Driver.Render.Finish = s3vRenderFinish;
- tnl->Driver.Render.BuildVertices = s3vBuildVertices;
- tnl->Driver.Render.ResetLineStipple = s3vResetLineStipple;
- vmesa->new_gl_state |= (_S3V_NEW_RENDERSTATE|
- _S3V_NEW_RASTER_STATE|
- _S3V_NEW_VERTEX);
- }
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-
-void s3vInitTriFuncs( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- init_render_tab();
- firsttime = 0;
- }
-
- vmesa->RenderIndex = ~0;
-
- tnl->Driver.RunPipeline = s3vRunPipeline;
- tnl->Driver.Render.Start = s3vRenderStart;
- tnl->Driver.Render.Finish = s3vRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = s3vRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = s3vResetLineStipple;
-/*
- tnl->Driver.RenderInterp = _swsetup_RenderInterp;
- tnl->Driver.RenderCopyPV = _swsetup_RenderCopyPV;
-*/
- tnl->Driver.Render.BuildVertices = s3vBuildVertices;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.h
deleted file mode 100644
index 0010a7fe0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tris.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef _S3V_TRIS_H
-#define _S3V_TRIS_H
-
-extern void s3vDDTrifuncInit(void);
-extern void s3vDDChooseTriRenderState(GLcontext *);
-
-#endif /* !(_S3V_TRIS_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tritmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tritmp.h
deleted file mode 100644
index 16318f4c4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_tritmp.h
+++ /dev/null
@@ -1,958 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-/**** MACROS start ****/
-
-/* point/line macros */
-
-#define LINE_VERT_VARS \
- SWvertex v[3]; \
- s3vVertex* vvv[2]; \
- int x[3], y[3], z[3]; \
- int idx[3]; \
- int dx01, dy01; \
- int delt02; \
- int deltzy, zstart; \
- int start02, end01; \
- int ystart, y01y12; \
- int i, tmp, tmp2, tmp3; \
- GLfloat ydiff, fy[3]
-#define LINE_VERT_VARS_VOIDS \
- (void) v; (void) vvv; (void) x; (void) y; (void) z; (void) idx; \
- (void) dx01; (void) dy01; (void) delt02; (void) deltzy; \
- (void) zstart; (void) start02; (void) ystart; (void) y01y12; \
- (void) i; (void) tmp; (void) tmp2; (void) tmp3; (void) ydiff; (void) fy
-
-#define LINE_FLAT_VARS \
- int arstart, gbstart; \
- int deltarx, deltgbx, deltary, deltgby; \
- GLubyte *(col)[3]
-#define LINE_FLAT_VARS_VOIDS \
- (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \
- (void) deltary; (void) deltgby; (void) col
-
-#define LINE_GOURAUD_VARS \
- int arstart, gbstart; \
- int deltary, deltgby; \
- int ctmp, ctmp2, ctmp3, ctmp4; \
- GLubyte *(col)[3]
-#define LINE_GOURAUD_VARS_VOIDS \
- (void) arstart; (void) gbstart; (void) deltary; (void) deltgby; \
- (void) ctmp; (void) ctmp2; (void) ctmp3; (void) ctmp4; (void) col
-
-#define SORT_LINE_VERT() \
-do { \
- if(v[0].win[1] <= v[1].win[1]) { \
-\
- idx[0] = 0; \
- idx[1] = 1; \
-\
- } else if (v[0].win[1] > v[1].win[1]) { \
-\
- idx[0] = 1; \
- idx[1] = 0; \
-\
- } \
-} while(0)
-
-#define SET_LINE_VERT() \
-do { \
- x[0] = (v[idx[0]].win[0] * 1024.0f * 1024.0f); /* 0x100000 */ \
- y[0] = fy[0] = dPriv->h - v[idx[0]].win[1]; \
- z[0] = (v[idx[0]].win[2]) * 1024.0f * 32.0f; /* 0x8000; */ \
-\
- x[1] = (v[idx[1]].win[0] * 1024.0f * 1024.0f); /* 0x100000 */ \
- y[1] = dPriv->h - v[idx[1]].win[1]; \
- z[1] = (v[idx[1]].win[2]) * 1024.0f * 32.0f; /* 0x8000 */ \
-} while(0)
-
-#define SET_LINE_XY() \
-do { \
- tmp = v[idx[0]].win[0]; \
- tmp2 = v[idx[1]].win[0]; \
-\
- dx01 = x[0] - x[1]; \
- dy01 = y[0] - y[1]; \
-\
- ydiff = fy[0] - (float)y[0]; \
- ystart = y[0]; \
- y01y12 = dy01 + 1; \
-} while (0)
-
-#define SET_LINE_DIR() \
-do { \
- if (tmp2 > tmp) { \
- y01y12 |= 0x80000000; \
- tmp3 = tmp2-tmp; \
- } else { \
- tmp3 = tmp-tmp2; \
- } \
-\
- end01 = ((tmp << 16) | tmp2); \
-\
- if (dy01) \
- delt02 = -(dx01/dy01); \
- else \
- delt02 = 0; \
-\
- if (dy01 > tmp3) { /* Y MAJ */ \
- /* NOTE: tmp3 always >=0 */ \
- start02 = x[0]; \
- } else if (delt02 >= 0){ /* X MAJ - positive delta */ \
- start02 = x[0] + delt02/2; \
- dy01 = tmp3; /* could be 0 */ \
- } else { /* X MAJ - negative delta */ \
- start02 = x[0] + delt02/2 + ((1 << 20) - 1); \
- dy01 = tmp3; /* could be 0 */ \
- } \
-} while(0)
-
-#define SET_LINE_Z() \
-do { \
- zstart = z[0]; \
-\
- if (dy01) { \
- deltzy = (z[1] - z[0])/dy01; \
- } else { \
- deltzy = 0; /* dy01 = tmp3 = 0 (it's a point)*/ \
- } \
-} while (0)
-
-#define SET_LINE_FLAT_COL() \
-do { \
- col[0] = &(v[idx[0]].color[0]); \
- deltarx = deltary = deltgbx = deltgby = 0; \
- gbstart = (((col[0][1]) << 23) | ((col[0][2]) << 7)); \
- arstart = (((col[0][3]) << 23) | ((col[0][0]) << 7)); \
-} while(0)
-
-#define SET_LINE_GOURAUD_COL() \
-do { \
- col[0] = &(v[idx[0]].color[0]); \
- col[1] = &(v[idx[1]].color[0]); \
-\
- vvv[0] = _v0; \
- vvv[1] = _v1; \
-\
- for (i=0; i<2; i++) { \
- /* FIXME: swapped ! */ \
- col[i][0] = vvv[!idx[i]]->v.color.red; \
- col[i][1] = vvv[!idx[i]]->v.color.green; \
- col[i][2] = vvv[!idx[i]]->v.color.blue; \
- col[i][3] = vvv[!idx[i]]->v.color.alpha; \
- } \
-\
- if (dy01) { \
-\
- ctmp = ((col[0][1] - col[1][1]) << 7) / dy01; \
- ctmp2 = ((col[0][2] - col[1][2]) << 7) / dy01; \
- deltgby = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \
-\
- ctmp3 = ((col[0][3] - col[1][3]) << 7) / dy01; \
- ctmp4 = ((col[0][0] - col[1][0]) << 7) / dy01; \
- deltary = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \
- } else { \
- ctmp = ((col[1][1] - col[0][1]) << 7); \
- ctmp2 = ((col[1][2] - col[0][2]) << 7); \
- deltgby = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \
-\
- ctmp3 = ((col[1][3] - col[0][3]) << 7); \
- ctmp4 = ((col[1][0] - col[0][0]) << 7); \
- deltary = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \
- deltgby = deltary = 0; \
- } \
-\
- idx[0] = 1; /* FIXME: swapped */ \
-\
- gbstart = \
- (((int)((ydiff * ctmp) + (col[idx[0]][1] << 7)) << 16) & 0x7FFF0000) \
- | ((int)((ydiff * ctmp2) + (col[idx[0]][2] << 7)) & 0x7FFF); \
- arstart = \
- (((int)((ydiff * ctmp3) + (col[idx[0]][3] << 7)) << 16) & 0x7FFF0000) \
- | ((int)((ydiff * ctmp4) + (col[idx[0]][0] << 7)) & 0x7FFF); \
-} while(0)
-
-#define SEND_LINE_COL() \
-do { \
- DMAOUT(deltgby); \
- DMAOUT(deltary); \
- DMAOUT(gbstart); \
- DMAOUT(arstart); \
-} while (0)
-
-#define SEND_LINE_VERT() \
-do { \
- DMAOUT(deltzy); \
- DMAOUT(zstart); \
- DMAOUT(0); \
- DMAOUT(0); \
- DMAOUT(0); \
- DMAOUT(end01); \
- DMAOUT(delt02); \
- DMAOUT(start02); \
- DMAOUT(ystart); \
- DMAOUT(y01y12); \
-} while (0)
-
-
-/* tri macros (mostly stolen from utah-glx...) */
-
-#define VERT_VARS \
- SWvertex v[3]; \
- int x[3], y[3], z[3]; \
- int idx[3]; \
- int dx01, dy01; \
- int dx02, dy02; \
- int dx12, dy12; \
- int delt01, delt02, delt12; \
- int deltzx, deltzy, zstart; \
- int start02, end01, end12; \
- int ystart, y01y12; \
- int i, tmp, lr; \
- GLfloat ydiff, fy[3]
-#define VERT_VARS_VOIDS \
- (void) v; (void) x; (void) y; (void) z; (void) idx; (void) dx01; \
- (void) dy01; (void) dx02; (void) dy02; (void) dx12; (void) dy12; \
- (void) delt01; (void) delt02; (void) delt12; (void) deltzx; \
- (void) deltzy; (void) zstart; (void) start02; (void) end01; \
- (void) end12; (void) ystart; (void) y01y12; (void) i; (void) tmp; \
- (void) lr; (void) ydiff; (void) fy
-
-#define GOURAUD_VARS \
- int arstart, gbstart; \
- int deltarx, deltgbx, deltary, deltgby; \
- int ctmp, ctmp2, ctmp3, ctmp4; \
- GLubyte *(col)[3]
-#define GOURAUD_VARS_VOIDS \
- (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \
- (void) deltary; (void) deltgby; (void) ctmp; (void) ctmp2; \
- (void) ctmp3; (void) ctmp4; (void) col
-
-#define FLAT_VARS \
- int arstart, gbstart; \
- int deltarx, deltgbx, deltary, deltgby; \
- GLubyte *(col)[3]
-#define FLAT_VARS_VOIDS \
- (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \
- (void) deltary; (void) deltgby; (void) col
-
-#define TEX_VARS \
- int u0, u1, u2; \
- GLfloat ru0, ru1, ru2; \
- int v0, v1, v2; \
- GLfloat rv0, rv1, rv2; \
- GLfloat w0, w1, w2; \
- GLfloat rw0, rw1, rw2; \
- int baseu, basev; \
- int d0, d1, d2; \
- int deltdx, deltvx, deltux, deltdy, deltvy, deltuy; \
- int deltwx, deltwy; \
- int rbaseu, rbasev; \
- int dstart, ustart, wstart, vstart; \
- static int stmp = 0; \
- s3vTextureObjectPtr t
-#define TEX_VARS_VOIDS \
- (void) u0; (void) u1; (void) u2; (void) ru0; (void) ru1; (void) ru2; \
- (void) v0; (void) v1; (void) v2; (void) rv0; (void) rv1; (void) rv2; \
- (void) w0; (void) w1; (void) w2; (void) rw0; (void) rw1; (void) rw2; \
- (void) baseu; (void) basev; (void) d0; (void) d1; (void) d2; \
- (void) deltdx; (void) deltvx; (void) deltux; (void) deltdy; \
- (void) deltuy; (void) deltwx; (void) deltwy; (void) rbaseu; \
- (void) rbasev; (void) dstart; (void) ustart; (void) wstart; \
- (void) vstart; (void) stmp; (void) t
-
-#define SORT_VERT() \
-do { \
- for (i=0; i<3; i++) \
- fy[i] = v[i].win[1]; \
-\
- if (fy[1] > fy[0]) { /* (fy[1] > fy[0]) */ \
-\
- if (fy[2] > fy[0]) { \
- idx[0] = 0; \
- if (fy[1] > fy[2]) { \
- idx[1] = 2; \
- idx[2] = 1; \
- } else { \
- idx[1] = 1; \
- idx[2] = 2; \
- } \
- } else { \
- idx[0] = 2; \
- idx[1] = 0; \
- idx[2] = 1; \
- } \
- } else { /* (fy[1] < y[0]) */ \
- if (fy[2] > fy[0]) { \
- idx[0] = 1; \
- idx[1] = 0; \
- idx[2] = 2; \
- } else { \
- idx[2] = 0; \
- if (fy[2] > fy[1]) { \
- idx[0] = 1; \
- idx[1] = 2; \
- } else { \
- idx[0] = 2; \
- idx[1] = 1; \
- } \
- } \
- } \
-} while(0)
-
-#define SET_VERT() \
-do { \
- for (i=0; i<3; i++) \
- { \
- x[i] = ((v[idx[i]].win[0]) * /* 0x100000*/ 1024.0 * 1024.0); \
- y[i] = fy[i] = (dPriv->h - v[idx[i]].win[1]); \
- z[i] = ((v[idx[i]].win[2]) * /* 0x8000 */ 1024.0 * 32.0); \
- } \
-\
- ydiff = fy[0] - (float)y[0]; \
-\
- ystart = y[0]; \
-\
- dx12 = x[2] - x[1]; \
- dy12 = y[1] - y[2]; \
- dx01 = x[1] - x[0]; \
- dy01 = y[0] - y[1]; \
- dx02 = x[2] - x[0]; \
- dy02 = y[0] - y[2]; \
-\
- delt01 = delt02 = delt12 = 0; \
-} while (0)
-
-
-#define SET_XY() \
-do { \
- if (dy01) delt01 = dx01 / dy01; \
- if (dy12) delt12 = dx12 / dy12; \
- delt02 = dx02 / dy02; \
-\
- start02 = x[0] + (ydiff * delt02); \
- end01 = x[0] + (ydiff * delt01); \
- end12 = x[1] + ((fy[1] - (GLfloat)y[1]) * delt12); \
-} while (0)
-
-#define SET_DIR() \
-do { \
- tmp = x[1] - (dy01 * delt02 + x[0]); \
- if (tmp > 0) { \
- lr = 0x80000000; \
- } else { \
- tmp *= -1; \
- lr = 0; \
- } \
- tmp >>= 20; \
-\
- y01y12 = ((((y[0] - y[1]) & 0x7FF) << 16) \
- | ((y[1] - y[2]) & 0x7FF) | lr); \
-} while (0)
-
-#define SET_Z() \
-do { \
- deltzy = (z[2] - z[0]) / dy02; \
- if (tmp) { \
- deltzx = (z[1] - (dy01 * deltzy + z[0])) / tmp; \
- } else { \
- deltzx = 0; \
- } \
- zstart = (deltzy * ydiff) + z[0]; \
-} while (0)
-
-#define SET_FLAT_COL() \
-do { \
- col[0] = &(v[0].color[0]); \
- deltarx = deltary = deltgbx = deltgby = 0; \
- gbstart = (((col[0][1]) << 23) | ((col[0][2]) << 7)); \
- arstart = (((col[0][3]) << 23) | ((col[0][0]) << 7)); \
-} while(0)
-
-#define SET_GOURAUD_COL() \
-do { \
- col[0] = &(v[idx[0]].color[0]); \
- col[1] = &(v[idx[1]].color[0]); \
- col[2] = &(v[idx[2]].color[0]); \
-\
- ctmp = ((col[2][3] - col[0][3]) << 7) / dy02; \
- ctmp2 = ((col[2][0] - col[0][0]) << 7) / dy02; \
- deltary = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \
- ctmp3 = ((col[2][1] - col[0][1]) << 7) / dy02; \
- ctmp4 = ((col[2][2] - col[0][2]) << 7) / dy02; \
- deltgby = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \
- gbstart = \
- (((int)((ydiff * ctmp3) + (col[0][1] << 7)) << 16) & 0x7FFF0000) \
- | ((int)((ydiff * ctmp4) + (col[0][2] << 7)) & 0x7FFF); \
- arstart = \
- (((int)((ydiff * ctmp) + (col[0][3] << 7)) << 16) & 0x7FFF0000) \
- | ((int)((ydiff * ctmp2) + (col[0][0] << 7)) & 0x7FFF); \
- if (tmp) { \
- int ax, rx, gx, bx; \
- ax = ((col[1][3] << 7) - (dy01 * ctmp + (col[0][3] << 7))) / tmp; \
- rx = ((col[1][0] << 7) - (dy01 * ctmp2 + (col[0][0] << 7))) / tmp; \
- gx = ((col[1][1] << 7) - (dy01 * ctmp3 + (col[0][1] << 7))) / tmp; \
- bx = ((col[1][2] << 7) - (dy01 * ctmp4 + (col[0][2] << 7))) / tmp; \
- deltarx = ((ax << 16) & 0xFFFF0000) | (rx & 0xFFFF); \
- deltgbx = ((gx << 16) & 0xFFFF0000) | (bx & 0xFFFF); \
- } else { \
- deltgbx = deltarx = 0; \
- } \
-} while (0)
-
-#define SET_TEX_VERT() \
-do { \
- t = ((s3vTextureObjectPtr) \
- ctx->Texture.Unit[0]._Current->DriverData); \
- deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \
-\
- u0 = (v[idx[0]].texcoord[0][0] \
- * (GLfloat)(t->image[0].image->Width) * 256.0); \
- u1 = (v[idx[1]].texcoord[0][0] \
- * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \
- u2 = (v[idx[2]].texcoord[0][0] \
- * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \
- v0 = (v[idx[0]].texcoord[0][1] \
- * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
- v1 = (v[idx[1]].texcoord[0][1] \
- * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
- v2 = (v[idx[2]].texcoord[0][1] \
- * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
-\
- w0 = (v[idx[0]].win[3]); \
- w1 = (v[idx[1]].win[3]); \
- w2 = (v[idx[2]].win[3]); \
-} while (0)
-
-#define SET_BASEUV() \
-do { \
- if (u0 < u1) { \
- if (u0 < u2) { \
- baseu = u0; \
- } else { \
- baseu = u2; \
- } \
- } else { \
- if (u1 < u2) { \
- baseu = u1; \
- } else { \
- baseu = u2; \
- } \
- } \
-\
- if (v0 < v1) { \
- if (v0 < v2) { \
- basev = v0; \
- } else { \
- basev = v2; \
- } \
- } else { \
- if (v1 < v2) { \
- basev = v1; \
- } else { \
- basev = v2; \
- } \
- } \
-} while (0)
-
-
-#define SET_RW() \
-do { \
- /* GLfloat minW; \
-\
- if (w0 < w1) { \
- if (w0 < w2) { \
- minW = w0; \
- } else { \
- minW = w2; \
- } \
- } else { \
- if (w1 < w2) { \
- minW = w1; \
- } else { \
- minW = w2; \
- } \
- } */ \
-\
- rw0 = (512.0 * w0); \
- rw1 = (512.0 * w1); \
- rw2 = (512.0 * w2); \
-} while (0)
-
-#define SET_D() \
-do { \
- GLfloat sxy, suv; \
- int lev; \
-\
- suv = (v[idx[0]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[1]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][1]) - \
- (v[idx[1]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[0]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][2]); \
-\
- sxy = (v[idx[0]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[1]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][1]) - \
- (v[idx[1]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[0]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][2]); \
-\
- if (sxy < 0) sxy *= -1.0; \
- if (suv < 0) suv *= -1.0; \
-\
- lev = *(int*)&suv - *(int *)&sxy; \
- if (lev < 0) \
- lev = 0; \
- else \
- lev >>=23; \
- dstart = (lev << 27); \
-} while (0)
-
-#define SET_UVWD() \
-do { \
- SET_BASEUV(); \
- SET_RW(); \
- SET_D(); \
- ru0 = (((u0 - baseu) * rw0)); \
- ru1 = (((u1 - baseu) * rw1)); \
- ru2 = (((u2 - baseu) * rw2)); \
- rv0 = (((v0 - basev) * rw0)); \
- rv1 = (((v1 - basev) * rw1)); \
- rv2 = (((v2 - basev) * rw2)); \
-\
- while (baseu < 0) { baseu += (t->globj->Image[0][0]->Width << 8); } \
- while (basev < 0) { basev += (t->globj->Image[0][0]->Height << 8); } \
-\
- if (!(baseu & 0xFF)) \
- { baseu = (baseu >> 8); } \
- else \
- { baseu = (baseu >> 8) + 1; } \
-\
- if ((basev & 0x80) || !(basev & 0xFF)) \
- { basev = (basev >> 8); } \
- else \
- { basev = (basev >> 8) - 1; } \
-\
- rbaseu = (baseu) << (16 - t->globj->Image[0][0]->WidthLog2); \
- rbasev = (basev) << (16 - t->globj->Image[0][0]->WidthLog2); \
- deltuy = (((ru2 - ru0) / dy02)); \
- deltvy = (((rv2 - rv0) / dy02)); \
- rw0 *= (1024.0 * 512.0); \
- rw1 *= (1024.0 * 512.0); \
- rw2 *= (1024.0 * 512.0); \
- deltwy = ((rw2 - rw0) / dy02); \
- if (tmp) { \
- deltux = ((ru1 - (dy01 * deltuy + ru0)) / tmp); \
- deltvx = ((rv1 - (dy01 * deltvy + rv0)) / tmp); \
- deltwx = ((rw1 - (dy01 * deltwy + rw0)) / tmp); \
- } else { deltux = deltvx = deltwx = 0; } \
- ustart = (deltuy * ydiff) + (ru0); \
- vstart = (deltvy * ydiff) + (rv0); \
- wstart = (deltwy * ydiff) + (rw0); \
-} while (0)
-
-#define SEND_UVWD() \
-do { \
- DMAOUT((rbasev & 0xFFFF)); \
- DMAOUT((0xa0000000 | (rbaseu & 0xFFFF))); \
- DMAOUT(deltwx); \
- DMAOUT(deltwy); \
- DMAOUT(wstart); \
- DMAOUT(deltdx); \
- DMAOUT(deltvx); \
- DMAOUT(deltux); \
- DMAOUT(deltdy); \
- DMAOUT(deltvy); \
- DMAOUT(deltuy); \
- DMAOUT(dstart); \
- DMAOUT(vstart); \
- DMAOUT(ustart); \
-} while (0)
-
-#define SEND_VERT() \
-do { \
- DMAOUT(deltzx); \
- DMAOUT(deltzy); \
- DMAOUT(zstart); \
- DMAOUT(delt12); \
- DMAOUT(end12); \
- DMAOUT(delt01); \
- DMAOUT(end01); \
- DMAOUT(delt02); \
- DMAOUT(start02); \
- DMAOUT(ystart); \
- DMAOUT(y01y12); \
-} while (0)
-
-#define SEND_COL() \
-do { \
- DMAOUT(deltgbx); \
- DMAOUT(deltarx); \
- DMAOUT(deltgby); \
- DMAOUT(deltary); \
- DMAOUT(gbstart); \
- DMAOUT(arstart); \
-} while (0)
-
-/**** MACROS end ****/
-
-
-
-
-static void TAG(s3v_point)( s3vContextPtr vmesa,
- const s3vVertex *_v0 )
-{
-}
-
-static void TAG(s3v_line)( s3vContextPtr vmesa,
- const s3vVertex *_v0,
- const s3vVertex *_v1 )
-{
- GLcontext *ctx = vmesa->glCtx;
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
-
- LINE_VERT_VARS;
-#if (IND & S3V_RAST_FLAT_BIT)
- LINE_FLAT_VARS;
-#else
- LINE_GOURAUD_VARS;
-#endif
-#if (IND & S3V_RAST_CULL_BIT)
- GLfloat cull;
- (void) cull;
-#endif
- LINE_VERT_VARS_VOIDS;
-#if (IND & S3V_RAST_FLAT_BIT)
- LINE_FLAT_VARS_VOIDS;
-#else
- LINE_GOURAUD_VARS_VOIDS;
-#endif
-
- DEBUG(("*** s3v_line: "));
-#if (IND & S3V_RAST_CULL_BIT)
- DEBUG(("cull "));
-#endif
-#if (IND & S3V_RAST_FLAT_BIT)
- DEBUG(("flat "));
-#endif
-
- DEBUG(("***\n"));
-
-#if 0
- s3v_print_vertex(ctx, _v0);
- s3v_print_vertex(ctx, _v1);
-#endif
-
- s3v_translate_vertex( ctx, _v0, &v[0] );
- s3v_translate_vertex( ctx, _v1, &v[1] );
-
-#if (IND & S3V_RAST_CULL_BIT)
- /* FIXME: should we cull lines too? */
-#endif
- (void)v; /* v[0]; v[1]; */
-
- SORT_LINE_VERT();
- SET_LINE_VERT();
-
- SET_LINE_XY();
- SET_LINE_DIR();
- SET_LINE_Z();
-
-#if (IND & S3V_RAST_FLAT_BIT)
- SET_LINE_FLAT_COL();
-#else
- SET_LINE_GOURAUD_COL();
-#endif
-
- DMAOUT_CHECK(3DLINE_GBD, 15);
- SEND_LINE_COL();
- DMAOUT(0);
- SEND_LINE_VERT();
- DMAFINISH();
-}
-
-static void TAG(s3v_triangle)( s3vContextPtr vmesa,
- const s3vVertex *_v0,
- const s3vVertex *_v1,
- const s3vVertex *_v2 )
-{
- GLcontext *ctx = vmesa->glCtx;
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
-
- VERT_VARS;
-#if (IND & S3v_RAST_FLAT_BIT)
- FLAT_VARS;
-#else
- GOURAUD_VARS;
-#endif
-#if (IND & S3V_RAST_TEX_BIT)
- TEX_VARS;
-#endif
-#if (IND & S3V_RAST_CULL_BIT)
- GLfloat cull;
-#endif
- VERT_VARS_VOIDS;
-#if (IND & S3v_RAST_FLAT_BIT)
- FLAT_VARS_VOIDS;
-#else
- GOURAUD_VARS_VOIDS;
-#endif
-#if (IND & S3V_RAST_TEX_BIT)
- TEX_VARS_VOIDS;
-#endif
-
- DEBUG(("*** s3v_triangle: "));
-#if (IND & S3V_RAST_CULL_BIT)
- DEBUG(("cull "));
-#endif
-#if (IND & S3V_RAST_FLAT_BIT)
- DEBUG(("flat "));
-#endif
-#if (IND & S3V_RAST_TEX_BIT)
- DEBUG(("tex "));
-#endif
-
-DEBUG(("***\n"));
-
-#if 0
- s3v_print_vertex(ctx, _v0);
- s3v_print_vertex(ctx, _v1);
- s3v_print_vertex(ctx, _v2);
-#endif
-
- s3v_translate_vertex( ctx, _v0, &v[0] );
- s3v_translate_vertex( ctx, _v1, &v[1] );
- s3v_translate_vertex( ctx, _v2, &v[2] );
-
-#if (IND & S3V_RAST_CULL_BIT)
- cull = vmesa->backface_sign *
- ((v[1].win[0] - v[0].win[0]) * (v[0].win[1] - v[2].win[1]) +
- (v[1].win[1] - v[0].win[1]) * (v[2].win[0] - v[0].win[0]));
-
- if (cull < vmesa->cull_zero /* -0.02f */) return;
-#endif
-
- (void)v; /* v[0]; v[1]; v[2]; */
-
- SORT_VERT();
- SET_VERT();
-
- if (dy02 == 0) return;
-
- SET_XY();
- SET_DIR();
- SET_Z();
-
-#if (IND & S3V_RAST_TEX_BIT)
- SET_TEX_VERT();
- SET_UVWD();
-#endif
-
-#if (IND & S3V_RAST_FLAT_BIT)
- SET_FLAT_COL();
-#else
- SET_GOURAUD_COL();
-#endif
-
-#if (IND & S3V_RAST_TEX_BIT)
- DMAOUT_CHECK(3DTRI_BASEV, 31);
- SEND_UVWD();
- SEND_COL();
- SEND_VERT();
- DMAFINISH();
-#else
- DMAOUT_CHECK(3DTRI_GBX, 17);
- SEND_COL();
- SEND_VERT();
- DMAFINISH();
-#endif
-}
-
-static void TAG(s3v_quad)( s3vContextPtr vmesa,
- const s3vVertex *_v0,
- const s3vVertex *_v1,
- const s3vVertex *_v2,
- const s3vVertex *_v3 )
-{
- GLcontext *ctx = vmesa->glCtx;
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
-
- SWvertex temp_v[4];
- VERT_VARS;
-#if (IND & S3v_RAST_FLAT_BIT)
- FLAT_VARS;
-#else
- GOURAUD_VARS;
-#endif
-#if (IND & S3V_RAST_TEX_BIT)
- TEX_VARS;
-#endif
-#if (IND & S3V_RAST_CULL_BIT)
- GLfloat cull;
-#endif
- VERT_VARS_VOIDS;
-#if (IND & S3v_RAST_FLAT_BIT)
- FLAT_VARS_VOIDS;
-#else
- GOURAUD_VARS_VOIDS;
-#endif
-#if (IND & S3V_RAST_TEX_BIT)
- TEX_VARS_VOIDS;
-#endif
-
- DEBUG(("*** s3v_quad: "));
-#if (IND & S3V_RAST_CULL_BIT)
- DEBUG(("cull "));
- /* printf(""); */ /* speed trick */
-#endif
-#if (IND & S3V_RAST_FLAT_BIT)
- DEBUG(("flat "));
-#endif
-#if (IND & S3V_RAST_TEX_BIT)
- DEBUG(("tex "));
-#endif
-
- DEBUG(("***\n"));
-
-#if 0
- s3v_print_vertex(ctx, _v0);
- s3v_print_vertex(ctx, _v1);
- s3v_print_vertex(ctx, _v2);
- s3v_print_vertex(ctx, _v3);
-#endif
- s3v_translate_vertex( ctx, _v0, &temp_v[0] );
- s3v_translate_vertex( ctx, _v1, &temp_v[1] );
- s3v_translate_vertex( ctx, _v2, &temp_v[2] );
- s3v_translate_vertex( ctx, _v3, &temp_v[3] );
-
- /* FIRST TRI (0,1,2) */
-
- /* ROMEO */
- /* printf(""); */ /* speed trick (a) [turn on if (a) is return]*/
-
- v[0] = temp_v[0];
- v[1] = temp_v[1];
- v[2] = temp_v[2];
-
-#if (IND & S3V_RAST_CULL_BIT)
- cull = vmesa->backface_sign *
- ((v[1].win[0] - v[0].win[0]) * (v[0].win[1] - v[2].win[1]) +
- (v[1].win[1] - v[0].win[1]) * (v[2].win[0] - v[0].win[0]));
-
- if (cull < vmesa->cull_zero /* -0.02f */) goto second; /* return; */ /* (a) */
-#endif
-
-#if 0
- v[0] = temp_v[0];
- v[1] = temp_v[1];
- v[2] = temp_v[2];
-#else
- (void) v;
-#endif
- SORT_VERT();
- SET_VERT();
-
- if (dy02 == 0) goto second;
-
- SET_XY();
- SET_DIR();
- SET_Z();
-
-#if (IND & S3V_RAST_TEX_BIT)
- SET_TEX_VERT();
- SET_UVWD();
-#endif
-
-#if (IND & S3V_RAST_FLAT_BIT)
- SET_FLAT_COL();
-#else
- SET_GOURAUD_COL();
-#endif
-
-#if (IND & S3V_RAST_TEX_BIT)
- DMAOUT_CHECK(3DTRI_BASEV, 31);
- SEND_UVWD();
- SEND_COL();
- SEND_VERT();
- DMAFINISH();
-#else
- DMAOUT_CHECK(3DTRI_GBX, 17);
- SEND_COL();
- SEND_VERT();
- DMAFINISH();
-#endif
-
- /* SECOND TRI (0,2,3) */
-
-second:
- v[0] = temp_v[0];
- v[1] = temp_v[2];
- v[2] = temp_v[3];
-
-#if (IND & S3V_RAST_CULL_BIT)
- cull = vmesa->backface_sign *
- ((v[1].win[0] - v[0].win[0]) * (v[0].win[1] - v[2].win[1]) +
- (v[1].win[1] - v[0].win[1]) * (v[2].win[0] - v[0].win[0]));
-
- if (cull < /* -0.02f */ vmesa->cull_zero) return;
-#endif
-
-/* second: */
-
- /* ROMEO */
- /* printf(""); */ /* speed trick */
-
- v[0] = temp_v[0];
- v[1] = temp_v[2];
- v[2] = temp_v[3];
-
- SORT_VERT();
- SET_VERT();
-
- if (dy02 == 0) return;
-
- SET_XY();
- SET_DIR();
- SET_Z();
-
-#if (IND & S3V_RAST_TEX_BIT)
- SET_TEX_VERT();
- SET_UVWD();
-#endif
-
-#if (IND & S3V_RAST_FLAT_BIT)
- SET_FLAT_COL();
-#else
- SET_GOURAUD_COL();
-#endif
-
-#if (IND & S3V_RAST_TEX_BIT)
- DMAOUT_CHECK(3DTRI_BASEV, 31);
- SEND_UVWD();
- SEND_COL();
- SEND_VERT();
- DMAFINISH();
-#else
- DMAOUT_CHECK(3DTRI_GBX, 17);
- SEND_COL();
- SEND_VERT();
- DMAFINISH();
-#endif
-}
-
-static void TAG(s3v_init)(void)
-{
- s3v_point_tab[IND] = TAG(s3v_point);
- s3v_line_tab[IND] = TAG(s3v_line);
- s3v_tri_tab[IND] = TAG(s3v_triangle);
- s3v_quad_tab[IND] = TAG(s3v_quad);
-}
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.c
deleted file mode 100644
index dadf2b489..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/tnl.h"
-
-#include "s3v_context.h"
-#include "s3v_vb.h"
-#include "s3v_tris.h"
-
-#define S3V_XYZW_BIT 0x1
-#define S3V_RGBA_BIT 0x2
-#define S3V_TEX0_BIT 0x4
-#define S3V_PTEX_BIT 0x8
-#define S3V_FOG_BIT 0x10
-#define S3V_MAX_SETUP 0x20
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- GLuint vertex_format;
-} setup_tab[S3V_MAX_SETUP];
-
-
-/* Only one vertex format, atm, so no need to give them names:
- */
-#define TINY_VERTEX_FORMAT 1
-#define NOTEX_VERTEX_FORMAT 0
-#define TEX0_VERTEX_FORMAT 0
-#define TEX1_VERTEX_FORMAT 0
-#define PROJ_TEX1_VERTEX_FORMAT 0
-#define TEX2_VERTEX_FORMAT 0
-#define TEX3_VERTEX_FORMAT 0
-#define PROJ_TEX3_VERTEX_FORMAT 0
-
-#define DO_XYZW (IND & S3V_XYZW_BIT)
-#define DO_RGBA (IND & S3V_RGBA_BIT)
-#define DO_SPEC 0
-#define DO_FOG (IND & S3V_FOG_BIT)
-#define DO_TEX0 (IND & S3V_TEX0_BIT)
-#define DO_TEX1 0
-#define DO_TEX2 0
-#define DO_TEX3 0
-#define DO_PTEX (IND & S3V_PTEX_BIT)
-
-#define VERTEX s3vVertex
-#define LOCALVARS /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */
-#define GET_VIEWPORT_MAT() 0 /* vmesa->hw_viewport */
-#define GET_TEXSOURCE(n) n
-#define GET_VERTEX_FORMAT() 0
-#define GET_VERTEX_SIZE() S3V_CONTEXT(ctx)->vertex_size * sizeof(GLuint)
-#define GET_VERTEX_STORE() S3V_CONTEXT(ctx)->verts
-#define GET_VERTEX_STRIDE_SHIFT() S3V_CONTEXT(ctx)->vertex_stride_shift
-#define INVALIDATE_STORED_VERTICES()
-#define GET_UBYTE_COLOR_STORE() &S3V_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &S3V_CONTEXT(ctx)->UbyteSecondaryColor
-
-#define HAVE_HW_VIEWPORT 1 /* FIXME */
-#define HAVE_HW_DIVIDE 1
-#define HAVE_RGBA_COLOR 0 /* we're BGRA */
-#define HAVE_TINY_VERTICES 1
-#define HAVE_NOTEX_VERTICES 0
-#define HAVE_TEX0_VERTICES 0
-#define HAVE_TEX1_VERTICES 0
-#define HAVE_TEX2_VERTICES 0
-#define HAVE_TEX3_VERTICES 0
-#define HAVE_PTEX_VERTICES 1
-
-/*
-#define SUBPIXEL_X -.5
-#define SUBPIXEL_Y -.5
-#define UNVIEWPORT_VARS GLfloat h = S3V_CONTEXT(ctx)->driDrawable->h
-#define UNVIEWPORT_X(x) x - SUBPIXEL_X
-#define UNVIEWPORT_Y(y) - y + h + SUBPIXEL_Y
-#define UNVIEWPORT_Z(z) z / vmesa->depth_scale
-*/
-
-#define PTEX_FALLBACK() /* never needed */
-
-#define IMPORT_QUALIFIER
-#define IMPORT_FLOAT_COLORS s3v_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS s3v_import_float_spec_colors
-
-#define INTERP_VERTEX setup_tab[S3V_CONTEXT(ctx)->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[S3V_CONTEXT(ctx)->SetupIndex].copy_pv
-
-
-
-/***********************************************************************
- * Generate pv-copying and translation functions *
- ***********************************************************************/
-
-#define TAG(x) s3v_##x
-#include "tnl_dd/t_dd_vb.c"
-
-/***********************************************************************
- * Generate vertex emit and interp functions *
- ***********************************************************************/
-
-
-#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_TEX0_BIT|S3V_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_RGBA_BIT)
-#define TAG(x) x##_g
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_RGBA_BIT|S3V_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT|S3V_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT|S3V_TEX0_BIT|S3V_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_FOG_BIT)
-#define TAG(x) x##_f
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_RGBA_BIT | S3V_FOG_BIT)
-#define TAG(x) x##_gf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (S3V_RGBA_BIT | S3V_FOG_BIT | S3V_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-static void init_setup_tab( void )
-{
- init_wg(); /* pos + col */
- init_wgt0(); /* pos + col + tex0 */
- init_wgpt0(); /* pos + col + p-tex0 (?) */
- init_t0(); /* tex0 */
- init_g(); /* col */
- init_gt0(); /* col + tex */
- init_wgf();
- init_wgft0();
- init_wgfpt0();
- init_f();
- init_gf();
- init_gft0();
-}
-
-
-#if 0
-void s3vPrintSetupFlags(char *msg, GLuint flags )
-{
- fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & S3V_XYZW_BIT) ? " xyzw," : "",
- (flags & S3V_RGBA_BIT) ? " rgba," : "",
- (flags & S3V_SPEC_BIT) ? " spec," : "",
- (flags & S3V_FOG_BIT) ? " fog," : "",
- (flags & S3V_TEX0_BIT) ? " tex-0," : "",
- (flags & S3V_TEX1_BIT) ? " tex-1," : "");
-}
-#endif
-
-
-void s3vCheckTexSizes( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
-
- if (!setup_tab[vmesa->SetupIndex].check_tex_sizes(ctx)) {
-
- vmesa->SetupIndex |= (S3V_PTEX_BIT|S3V_RGBA_BIT);
-
- if (1 || !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[vmesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[vmesa->SetupIndex].copy_pv;
- }
- }
-}
-
-void s3vBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)vmesa->verts +
- (start<<vmesa->vertex_stride_shift));
- GLuint stride = 1<<vmesa->vertex_stride_shift;
-
- DEBUG(("*** s3vBuildVertices ***\n"));
- DEBUG(("vmesa->SetupNewInputs = 0x%x\n", vmesa->SetupNewInputs));
- DEBUG(("vmesa->SetupIndex = 0x%x\n", vmesa->SetupIndex));
-
-#if 1
- setup_tab[vmesa->SetupIndex].emit( ctx, start, count, v, stride );
-#else
- newinputs |= vmesa->SetupNewInputs;
- vmesa->SetupNewInputs = 0;
-
- DEBUG(("newinputs is 0x%x\n", newinputs));
-
- if (!newinputs) {
- DEBUG(("!newinputs\n"));
- return;
- }
-
- if (newinputs & VERT_CLIP) {
- setup_tab[vmesa->SetupIndex].emit( ctx, start, count, v, stride );
- DEBUG(("newinputs & VERT_CLIP\n"));
- return;
- } /* else { */
-/* GLuint ind = 0; */
-
- if (newinputs & VERT_RGBA) {
- DEBUG(("newinputs & VERT_RGBA\n"));
- ind |= S3V_RGBA_BIT;
- }
-
- if (newinputs & VERT_TEX0) {
- DEBUG(("newinputs & VERT_TEX0\n"));
- ind |= S3V_TEX0_BIT;
- }
-
- if (newinputs & VERT_FOG_COORD)
- ind |= S3V_FOG_BIT;
-
- if (vmesa->SetupIndex & S3V_PTEX_BIT)
- ind = ~0;
-
- ind &= vmesa->SetupIndex;
-
- DEBUG(("vmesa->SetupIndex = 0x%x\n", vmesa->SetupIndex));
- DEBUG(("ind = 0x%x\n", ind));
- DEBUG(("ind & vmesa->SetupIndex = 0x%x\n", (ind & vmesa->SetupIndex)));
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
- }
-#endif
-}
-
-void s3vChooseVertexState( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- GLuint ind = S3V_XYZW_BIT | S3V_RGBA_BIT;
-
- /* FIXME: will segv in tnl_dd/t_dd_vbtmp.h (line 196) on some demos */
-/*
- if (ctx->Fog.Enabled)
- ind |= S3V_FOG_BIT;
-*/
-
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- _tnl_need_projected_coords( ctx, GL_FALSE );
- ind |= S3V_TEX0_BIT;
- } else {
- _tnl_need_projected_coords( ctx, GL_TRUE );
- }
-
- vmesa->SetupIndex = ind;
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = s3v_interp_extras;
- tnl->Driver.Render.CopyPV = s3v_copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-}
-
-
-void s3vInitVB( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- vmesa->verts = (char *)ALIGN_MALLOC(size * 4 * 16, 32);
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- vmesa->vertex_stride_shift = 6 /* 4 */; /* FIXME - only one vertex setup */
- }
- }
-}
-
-
-void s3vFreeVB( GLcontext *ctx )
-{
- s3vContextPtr vmesa = S3V_CONTEXT(ctx);
- if (vmesa->verts) {
- ALIGN_FREE(vmesa->verts);
- vmesa->verts = 0;
- }
-
- if (vmesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE((void *)vmesa->UbyteSecondaryColor.Ptr);
- vmesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (vmesa->UbyteColor.Ptr) {
- ALIGN_FREE((void *)vmesa->UbyteColor.Ptr);
- vmesa->UbyteColor.Ptr = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.h
deleted file mode 100644
index b35d804e6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_vb.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#ifndef S3VVB_INC
-#define S3VVB_INC
-
-#include "mtypes.h"
-#include "swrast/swrast.h"
-
-#define _S3V_NEW_VERTEX (_NEW_TEXTURE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE)
-
-
-extern void s3vChooseVertexState( GLcontext *ctx );
-extern void s3vCheckTexSizes( GLcontext *ctx );
-extern void s3vBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs );
-
-
-extern void s3v_import_float_colors( GLcontext *ctx );
-extern void s3v_import_float_spec_colors( GLcontext *ctx );
-
-extern void s3v_translate_vertex( GLcontext *ctx,
- const s3vVertex *src,
- SWvertex *dst );
-
-extern void s3vInitVB( GLcontext *ctx );
-extern void s3vFreeVB( GLcontext *ctx );
-
-extern void s3v_print_vertex( GLcontext *ctx, const s3vVertex *v );
-#if 0
-extern void s3vPrintSetupFlags(char *msg, GLuint flags );
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_xmesa.c
deleted file mode 100644
index 4cdda1b58..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3v_xmesa.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#include "s3v_context.h"
-#include "s3v_vb.h"
-#include "context.h"
-#include "matrix.h"
-#include "s3v_dri.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-/* #define DEBUG(str) printf str */
-
-static GLboolean
-s3vInitDriver(__DRIscreenPrivate *sPriv)
-{
- sPriv->private = (void *) s3vCreateScreen( sPriv );
-
- if (!sPriv->private) {
- s3vDestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static void
-s3vDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- s3vContextPtr vmesa = (s3vContextPtr)driContextPriv->driverPrivate;
-
- if (vmesa) {
- _swsetup_DestroyContext( vmesa->glCtx );
- _tnl_DestroyContext( vmesa->glCtx );
- _ac_DestroyContext( vmesa->glCtx );
- _swrast_DestroyContext( vmesa->glCtx );
-
- s3vFreeVB( vmesa->glCtx );
-
- /* free the Mesa context */
- vmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(vmesa->glCtx);
-
- _mesa_free(vmesa);
- driContextPriv->driverPrivate = NULL;
- }
-}
-
-
-static GLboolean
-s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- s3vScreenPtr screen = (s3vScreenPtr) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0
- );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- s3vSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- s3vSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- s3vSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- s3vSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- /* no h/w stencil yet?
- if (mesaVis->stencilBits > 0) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT);
- s3vSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
- */
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-s3vDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-static void
-s3vSwapBuffers(__DRIdrawablePrivate *drawablePrivate)
-{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
- __DRIscreenPrivate *sPriv;
- GLcontext *ctx;
- s3vContextPtr vmesa;
- s3vScreenPtr s3vscrn;
-
- vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate;
- sPriv = vmesa->driScreen;
- s3vscrn = vmesa->s3vScreen;
- ctx = vmesa->glCtx;
-
- DEBUG(("*** s3vSwapBuffers ***\n"));
-
-/* DMAFLUSH(); */
-
- _mesa_notifySwapBuffers( ctx );
-
- vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate;
-/* driScrnPriv = vmesa->driScreen; */
-
-/* if (vmesa->EnabledFlags & S3V_BACK_BUFFER) */
-
-/* _mesa_notifySwapBuffers( ctx ); */
-#if 1
-{
- int x0, y0, x1, y1;
-/*
- int nRect = dPriv->numClipRects;
- XF86DRIClipRectPtr pRect = dPriv->pClipRects;
-
- __DRIscreenPrivate *driScrnPriv = vmesa->driScreen;
-*/
-
-/*
- DEBUG(("s3vSwapBuffers: S3V_BACK_BUFFER = 1 - nClip = %i\n", nRect));
-*/
-/* vmesa->drawOffset=vmesa->s3vScreen->backOffset; */
-
- x0 = dPriv->x;
- y0 = dPriv->y;
-
- x1 = x0 + dPriv->w - 1;
- y1 = y0 + dPriv->h - 1;
-
- DMAOUT_CHECK(BITBLT_SRC_BASE, 15);
- DMAOUT(vmesa->s3vScreen->backOffset);
- DMAOUT(0); /* 0xc0000000 */
- DMAOUT( ((x0 << 16) | x1) );
- DMAOUT( ((y0 << 16) | y1) );
- DMAOUT( (vmesa->DestStride << 16) | vmesa->SrcStride );
- DMAOUT( (~(0)) );
- DMAOUT( (~(0)) );
- DMAOUT(0);
- DMAOUT(0);
- /* FIXME */
- DMAOUT(0);
- DMAOUT(0);
- DMAOUT( (0x01 | /* Autoexecute */
- 0x02 | /* clip */
- 0x04 | /* 16 bit */
- 0x20 | /* draw */
- 0x400 | /* word alignment (bit 10=1) */
- (0x2 << 11) | /* offset = 1 byte */
- (0xCC << 17) | /* rop #204 */
- (0x3 << 25)) ); /* l-r, t-b */
- DMAOUT(vmesa->ScissorWH);
- DMAOUT( /* 0 */ vmesa->SrcXY );
- DMAOUT( (dPriv->x << 16) | dPriv->y );
- DMAFINISH();
-
- DMAFLUSH();
-
- vmesa->restore_primitive = -1;
-
-}
-#endif
-}
-
-static GLboolean
-s3vMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- int x1,x2,y1,y2;
- int cx, cy, cw, ch;
- unsigned int src_stride, dest_stride;
- int cl;
-
- s3vContextPtr vmesa;
- __DRIdrawablePrivate *dPriv = driDrawPriv;
- vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate;
-
- DEBUG(("s3vMakeCurrent\n"));
-
- DEBUG(("dPriv->x=%i y=%i w=%i h=%i\n", dPriv->x, dPriv->y,
- dPriv->w, dPriv->h));
-
- if (driContextPriv) {
- GET_CURRENT_CONTEXT(ctx);
- s3vContextPtr oldVirgeCtx = ctx ? S3V_CONTEXT(ctx) : NULL;
- s3vContextPtr newVirgeCtx = (s3vContextPtr) driContextPriv->driverPrivate;
-
- if ( newVirgeCtx != oldVirgeCtx ) {
-
- newVirgeCtx->dirty = ~0;
- cl = 1;
- DEBUG(("newVirgeCtx != oldVirgeCtx\n"));
-/* s3vUpdateClipping(newVirgeCtx->glCtx ); */
- }
-
- if (newVirgeCtx->driDrawable != driDrawPriv) {
- newVirgeCtx->driDrawable = driDrawPriv;
- DEBUG(("driDrawable != driDrawPriv\n"));
- s3vUpdateWindow ( newVirgeCtx->glCtx );
- s3vUpdateViewportOffset( newVirgeCtx->glCtx );
-/* s3vUpdateClipping(newVirgeCtx->glCtx ); */
- }
-/*
- s3vUpdateWindow ( newVirgeCtx->glCtx );
- s3vUpdateViewportOffset( newVirgeCtx->glCtx );
-*/
-
-/*
- _mesa_make_current( newVirgeCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0,
- newVirgeCtx->driDrawable->w,
- newVirgeCtx->driDrawable->h);
-*/
-
-#if 0
- newVirgeCtx->Window &= ~W_GIDMask;
- newVirgeCtx->Window |= (driDrawPriv->index << 5);
- CHECK_DMA_BUFFER(newVirgeCtx,1);
- WRITE(newVirgeCtx->buf, S3VWindow, newVirgeCtx->Window);
-#endif
-
- newVirgeCtx->new_state |= S3V_NEW_WINDOW; /* FIXME */
-
- _mesa_make_current( newVirgeCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- if (!newVirgeCtx->glCtx->Viewport.Width) {
- _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0,
- driDrawPriv->w, driDrawPriv->h);
-
-/* s3vUpdateClipping(newVirgeCtx->glCtx ); */
- }
-
-/*
- if (cl) {
- s3vUpdateClipping(newVirgeCtx->glCtx );
- cl =0;
- }
-*/
-
- newVirgeCtx->new_state |= S3V_NEW_CLIP;
-
- if (1) {
- cx = dPriv->x;
- cw = dPriv->w;
- cy = dPriv->y;
- ch = dPriv->h;
- }
-
- x1 = y1 = 0;
- x2 = cw-1;
- y2 = ch-1;
-
- /* src_stride = vmesa->s3vScreen->w * vmesa->s3vScreen->cpp;
- dest_stride = ((x2+31)&~31) * vmesa->s3vScreen->cpp; */
- src_stride = vmesa->driScreen->fbWidth * 2;
- dest_stride = ((x2+31)&~31) * 2;
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean
-s3vUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
-
-
-static struct __DriverAPIRec s3vAPI = {
- s3vInitDriver,
- s3vDestroyScreen,
- s3vCreateContext,
- s3vDestroyContext,
- s3vCreateBuffer,
- s3vDestroyBuffer,
- s3vSwapBuffers,
- s3vMakeCurrent,
- s3vUnbindContext,
-};
-
-
-#if 0
-/*
- * This is the bootstrap function for the driver.
- * The __driCreateScreen name is the symbol that libGL.so fetches.
- * Return: pointer to a __DRIscreenPrivate.
- */
-void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config)
-{
- __DRIscreenPrivate *psp=NULL;
-
- DEBUG(("__driCreateScreen: psp = %p\n", psp));
- psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &s3vAPI);
- DEBUG(("__driCreateScreen: psp = %p\n", psp));
- return (void *) psp;
-}
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3virgetri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3virgetri.h
deleted file mode 100644
index 5519cfd74..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/s3v/s3virgetri.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Author: Max Lingua <sunmax@libero.it>
- */
-
-#define LOCAL_VARS \
- int vert0, vert1, vert2; \
- GLfloat y0, y1, y2, ydiff; \
- int iy0, iy1, iy2; \
- int x0, x1, x2, z0, z1, z2; \
- int dy01, dy02, dy12, dx01, dx02, dx12; \
- int delt02, delt01, delt12, end01, end12, start02; \
- int zstart, arstart, gbstart; \
- int deltzy, deltzx, deltarx, deltgbx, deltary, deltgby; \
- GLubyte (*colours)[4]; \
- GLubyte (*scolours)[4]; \
- static int tp = 0; \
- int tmp, lr
-
-#define LOCAL_TEX_VARS \
- int u0, u1, u2; \
- GLfloat ru0, ru1, ru2; \
- int v0, v1, v2; \
- GLfloat rv0, rv1, rv2; \
- GLfloat w0, w1, w2; \
- GLfloat rw0, rw1, rw2; \
- int baseu, basev; \
- int d0, d1, d2; \
- int deltdx, deltvx, deltux, deltdy, deltvy, deltuy; \
- int deltwx, deltwy; \
- int rbaseu, rbasev; \
- int dstart, ustart, wstart, vstart; \
- static int stmp = 0; \
- s3virgeTextureObject_t *t
-
-#define CULL_BACKFACE() \
- do { \
- GLfloat *w0 = VB->Win.data[e0]; \
- GLfloat *w1 = VB->Win.data[e1]; \
- GLfloat *w2 = VB->Win.data[e2]; \
- float cull; \
- cull = ctx->backface_sign * ((w1[0] - w0[0]) * (w0[1] - w2[1]) + \
- (w1[1] - w0[1]) * (w2[0] - w0[0])); \
- if (cull < 0) \
- return; \
- } while (0)
-
-#define SORT_VERTICES() \
- do { \
- y0 = VB->Win.data[e0][1]; \
- y1 = VB->Win.data[e1][1]; \
- y2 = VB->Win.data[e2][1]; \
- if (y1 > y0) { \
- if (y2 > y0) { \
- vert0 = e0; \
- if (y1 > y2) { vert2 = e1; vert1 = e2; } else { vert2 = e2; vert1 = e1; } \
- } else { vert0 = e2; vert1 = e0; vert2 = e1; } \
- } else { \
- if (y2 > y0) { vert0 = e1; vert1 = e0; vert2 = e2; } else { \
- vert2 = e0; \
- if (y2 > y1) { vert0 = e1; vert1 = e2; } else { vert0 = e2; vert1 = e1; } \
- } \
- } \
- } while (0)
-
-#define SET_VARIABLES() \
- do { \
- iy0 = y0 = ((s3virgeDB->height - (VB->Win.data[vert0][1]))); \
- iy1 = y1 = ((s3virgeDB->height - (VB->Win.data[vert1][1]))); \
- iy2 = y2 = ((s3virgeDB->height - (VB->Win.data[vert2][1]))); \
- if (iy0 == iy2) { return; } \
- ydiff = y0 - (float)iy0; \
- x0 = ((VB->Win.data[vert0][0]) * 1024.0 * 1024.0); \
- x1 = ((VB->Win.data[vert1][0]) * 1024.0 * 1024.0); \
- x2 = ((VB->Win.data[vert2][0]) * 1024.0 * 1024.0); \
- z0 = (VB->Win.data[vert0][2] * 1024.0 * 32.0); \
- z1 = (VB->Win.data[vert1][2] * 1024.0 * 32.0); \
- z2 = (VB->Win.data[vert2][2] * 1024.0 * 32.0); \
- dx12 = x2 - x1; \
- dy12 = iy1 - iy2; \
- dx01 = x1 - x0; \
- dy01 = iy0 - iy1; \
- dx02 = x2 - x0; \
- dy02 = iy0 - iy2; \
- delt12 = delt02 = delt01 = 0; \
- } while (0)
-
-#define SET_TEX_VARIABLES() \
- do { \
- t = ((s3virgeTextureObject_t *)ctx->Texture.Unit[0].Current->DriverData); \
- deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \
- u0 = (VB->TexCoordPtr[0]->data[vert0][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \
- u1 = (VB->TexCoordPtr[0]->data[vert1][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \
- u2 = (VB->TexCoordPtr[0]->data[vert2][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \
- v0 = (VB->TexCoordPtr[0]->data[vert0][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \
- v1 = (VB->TexCoordPtr[0]->data[vert1][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \
- v2 = (VB->TexCoordPtr[0]->data[vert2][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \
- w0 = (VB->Win.data[vert0][3]); \
- w1 = (VB->Win.data[vert1][3]); \
- w2 = (VB->Win.data[vert2][3]); \
- } while (0)
-
-#define FLATSHADE_COLORS() \
- do { \
- GLubyte *col = &(colours[pv][0]); \
- deltarx = deltary = deltgbx = deltgby = 0; \
- gbstart = (((col[1]) << 23) | ((col[2]) << 7)); \
- arstart = (((col[3]) << 23) | ((col[0]) << 7)); \
- } while (0)
-
-#define GOURAUD_COLORS() \
- do { \
- int ctmp, ctmp2, ctmp3, ctmp4; \
- GLubyte *col0, *col1, *col2; \
- col0 = &(colours[vert0][0]); \
- col1 = &(colours[vert1][0]); \
- col2 = &(colours[vert2][0]); \
- ctmp = ((col2[3] - col0[3]) << 7) / dy02; \
- ctmp2 = ((col2[0] - col0[0]) << 7) / dy02; \
- deltary = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \
- ctmp3 = ((col2[1] - col0[1]) << 7) / dy02; \
- ctmp4 = ((col2[2] - col0[2]) << 7) / dy02; \
- deltgby = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \
- gbstart = (((int)((ydiff * ctmp3) + (col0[1] << 7)) << 16) & 0x7FFF0000) | \
- ((int)((ydiff * ctmp4) + (col0[2] << 7)) & 0x7FFF); \
- arstart = (((int)((ydiff * ctmp) + (col0[3] << 7)) << 16) & 0x7FFF0000) | \
- ((int)((ydiff * ctmp2) + (col0[0] << 7)) & 0x7FFF); \
- if (tmp) { \
- int ax, rx, gx, bx; \
- ax = ((col1[3] << 7) - (dy01 * ctmp + (col0[3] << 7))) / tmp; \
- rx = ((col1[0] << 7) - (dy01 * ctmp2 + (col0[0] << 7))) / tmp; \
- gx = ((col1[1] << 7) - (dy01 * ctmp3 + (col0[1] << 7))) / tmp; \
- bx = ((col1[2] << 7) - (dy01 * ctmp4 + (col0[2] << 7))) / tmp; \
- deltarx = ((ax << 16) & 0xFFFF0000) | (rx & 0xFFFF); \
- deltgbx = ((gx << 16) & 0xFFFF0000) | (bx & 0xFFFF); \
- } else { \
- deltgbx = deltarx = 0; \
- } \
- } while (0)
-
-#define SET_XY() \
- do { \
- delt02 = dx02 / dy02; \
- if (dy12) delt12 = dx12 / dy12; \
- if (dy01) delt01 = dx01 / dy01; \
- start02 = (ydiff * delt02) + x0; \
- end01 = (ydiff * delt01) + x0; \
- end12 = ((y1 - (GLfloat)iy1) * delt12) + x1; \
- } while (0)
-
-#define SET_DIR() \
- do { \
- tmp = x1 - (dy01 * delt02 + x0); \
- if (tmp > 0) { \
- lr = 0x80000000; \
- } else { \
- tmp *= -1; \
- lr = 0; \
- } \
- tmp >>= 20; \
- } while (0)
-
-#define SET_Z() \
- do { \
- deltzy = (z2 - z0) / dy02; \
- if (tmp) { \
- deltzx = (z1 - (dy01 * deltzy + z0)) / tmp; \
- } else { deltzx = 0; } \
- zstart = (deltzy * ydiff) + z0; \
- } while (0)
-
-#define SET_BASEUV() \
- do { \
- if (u0 < u1) { \
- if (u0 < u2) { \
- baseu = u0; \
- } else { \
- baseu = u2; \
- } \
- } else { \
- if (u1 < u2) { \
- baseu = u1; \
- } else { \
- baseu = u2; \
- } \
- } \
- if (v0 < v1) { \
- if (v0 < v2) { \
- basev = v0; \
- } else { \
- basev = v2; \
- } \
- } else { \
- if (v1 < v2) { \
- basev = v1; \
- } else { \
- basev = v2; \
- } \
- } \
- } while (0)
-
-#define SET_RW() \
- do { \
- /* GLfloat minW; \
- if (w0 < w1) { \
- if (w0 < w2) { \
- minW = w0; \
- } else { \
- minW = w2; \
- } \
- } else { \
- if (w1 < w2) { \
- minW = w1; \
- } else { \
- minW = w2; \
- } \
- } */ \
- rw0 = (512.0 * w0); \
- rw1 = (512.0 * w1); \
- rw2 = (512.0 * w2); \
- } while (0)
-
-
-#define SET_D() \
- do { \
- GLfloat sxy, suv; \
- int lev; \
- suv = (VB->TexCoordPtr[0]->data[vert0][0] - \
- VB->TexCoordPtr[0]->data[vert2][0]) * \
- (VB->TexCoordPtr[0]->data[vert1][1] - \
- VB->TexCoordPtr[0]->data[vert2][1]) - \
- (VB->TexCoordPtr[0]->data[vert1][0] - \
- VB->TexCoordPtr[0]->data[vert2][0]) * \
- (VB->TexCoordPtr[0]->data[vert0][1] - \
- VB->TexCoordPtr[0]->data[vert2][2]); \
- sxy = (VB->Win.data[vert0][0] - \
- VB->Win.data[vert2][0]) * \
- (VB->Win.data[vert1][1] - \
- VB->Win.data[vert2][1]) - \
- (VB->Win.data[vert1][0] - \
- VB->Win.data[vert2][0]) * \
- (VB->Win.data[vert0][1] - \
- VB->Win.data[vert2][2]); \
- if (sxy < 0) sxy *= -1.0; \
- if (suv < 0) suv *= -1.0; \
- lev = *(int*)&suv - *(int *)&sxy; \
- if (lev < 0) \
- lev = 0; \
- else \
- lev >>=23; \
- dstart = (lev << 27); \
- } while (0)
-
-
-
-#define SET_UVWD() \
- do { \
- SET_BASEUV(); \
- SET_RW(); \
- SET_D(); \
- ru0 = (((u0 - baseu) * rw0)); \
- ru1 = (((u1 - baseu) * rw1)); \
- ru2 = (((u2 - baseu) * rw2)); \
- rv0 = (((v0 - basev) * rw0)); \
- rv1 = (((v1 - basev) * rw1)); \
- rv2 = (((v2 - basev) * rw2)); \
- while (baseu < 0) { baseu += (t->tObj->Image[0]->Width << 8); } \
- while (basev < 0) { basev += (t->tObj->Image[0]->Height << 8); } \
- if (!(baseu & 0xFF)) { baseu = (baseu >> 8); } else { baseu = (baseu >> 8) + 1; } \
- if ((basev & 0x80) || !(basev & 0xFF)) { basev = (basev >> 8); } else { basev = (basev >> 8) - 1; } \
- rbaseu = (baseu) << (16 - t->widthLog2); \
- rbasev = (basev) << (16 - t->widthLog2); \
- deltuy = (((ru2 - ru0) / dy02)); \
- deltvy = (((rv2 - rv0) / dy02)); \
- rw0 *= (1024.0 * 512.0); \
- rw1 *= (1024.0 * 512.0); \
- rw2 *= (1024.0 * 512.0); \
- deltwy = ((rw2 - rw0) / dy02); \
- if (tmp) { \
- deltux = ((ru1 - (dy01 * deltuy + ru0)) / tmp); \
- deltvx = ((rv1 - (dy01 * deltvy + rv0)) / tmp); \
- deltwx = ((rw1 - (dy01 * deltwy + rw0)) / tmp); \
- } else { deltux = deltvx = deltwx = 0; } \
- ustart = (deltuy * ydiff) + (ru0); \
- vstart = (deltvy * ydiff) + (rv0); \
- wstart = (deltwy * ydiff) + (rw0); \
- } while (0)
-
-
-#define SEND_COLORS() \
- do { \
- WAITFIFOEMPTY(6); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GBX), deltgbx); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ARX), deltarx); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GBY), deltgby); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ARY), deltary); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GS_BS), gbstart); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_AS_RS), arstart); \
- } while (0)
-
-#define SEND_VERTICES() \
- do { \
- WAITFIFOEMPTY(6); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZSTART), zstart); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZXD), deltzx); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZYD), deltzy); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA12), delt12); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXEND12), end12); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA01), delt01); \
- WAITFIFOEMPTY(5); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXEND01), end01); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA02), delt02); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXSTART02), start02); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TYS), iy0); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TY01_Y12), \
- ((((iy0 - iy1) & 0x7FF) << 16) | \
- ((iy1 - iy2) & 0x7FF) | lr)); \
- } while (0)
-
-#define SEND_UVWD() \
- do { \
- WAITFIFOEMPTY(7); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_BASEV), (rbasev & 0xFFFF)); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_BASEU), (0xa0000000 | (rbaseu & 0xFFFF))); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WXD), deltwx); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WYD), deltwy); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WSTART), wstart); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DXD), deltdx); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VXD), deltvx); \
- WAITFIFOEMPTY(7); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_UXD), deltux); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DYD), deltdy); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VYD), deltvy); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_UYD), deltuy); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DSTART), dstart); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VSTART), vstart); \
- OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_USTART), ustart); \
- } while (0)
-
-#define DMA_SEND_UVWD() \
- do { \
- DMAOUT((rbasev & 0xFFFF)); \
- DMAOUT((0xa0000000 | (rbaseu & 0xFFFF))); \
- DMAOUT(deltwx); \
- DMAOUT(deltwy); \
- DMAOUT(wstart); \
- DMAOUT(deltdx); \
- DMAOUT(deltvx); \
- DMAOUT(deltux); \
- DMAOUT(deltdy); \
- DMAOUT(deltvy); \
- DMAOUT(deltuy); \
- DMAOUT(dstart); \
- DMAOUT(vstart); \
- DMAOUT(ustart); \
- } while (0)
-
-
-#define DMA_SEND_COLORS() \
- do { \
- DMAOUT(deltgbx); \
- DMAOUT(deltarx); \
- DMAOUT(deltgby); \
- DMAOUT(deltary); \
- DMAOUT(gbstart); \
- DMAOUT(arstart); \
- } while (0)
-
-#define DMA_SEND_VERTICES() \
- do { \
- DMAOUT(deltzx); \
- DMAOUT(deltzy); \
- DMAOUT(zstart); \
- DMAOUT(delt12); \
- DMAOUT(end12); \
- DMAOUT(delt01); \
- DMAOUT(end01); \
- DMAOUT(delt02); \
- DMAOUT(start02); \
- DMAOUT(iy0); \
- DMAOUT(((((iy0 - iy1) & 0x7FF) << 16) | \
- ((iy1 - iy2) & 0x7FF) | lr)); \
- } while (0)
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/Makefile
deleted file mode 100644
index 018482f66..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# src/mesa/drivers/dri/r128/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = savage_dri.so
-
-# Doesn't exist yet.
-#MINIGLX_SOURCES = server/savage_dri.c
-
-DRIVER_SOURCES = \
- savage_xmesa.c \
- savagedd.c \
- savagestate.c \
- savagetex.c \
- savagetris.c \
- savagerender.c \
- savageioctl.c \
- savagespan.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_3d_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_3d_reg.h
deleted file mode 100644
index b7d1c3960..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_3d_reg.h
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef SAVAGE_3D_REG_H
-#define SAVAGE_3D_REG_H
-
-#define VIDEO_MEM_ADR 0x02
-#define SYSTEM_MEM_ADR 0x01
-#define AGP_MEM_ADR 0x03
-
-/***********************************************************
-
- ----------- 3D ENGINE UNIT Registers -------------
-
- *********************************************************/
-
-typedef union
-{
- struct
- {
- unsigned reserved : 4;
- unsigned ofs : 28;
- }ni;
- u_int32_t ui;
-} savageRegZPixelOffset;
-
-/* This reg exists only on Savage4. */
-typedef union
-{
- struct
- {
- unsigned cmpFunc : 3;
- unsigned stencilEn : 1;
- unsigned readMask : 8;
- unsigned writeMask : 8;
- unsigned failOp : 3;
- unsigned passZfailOp : 3;
- unsigned passZpassOp : 3;
- unsigned reserved : 3;
- }ni;
- u_int32_t ui;
-} savageRegStencilCtrl;
-
-/**************************
- Texture Registers
-**************************/
-/* The layout of this reg differs between Savage4 and Savage3D. */
-typedef union
-{
- struct
- {
- unsigned tex0Width : 4;
- unsigned tex0Height : 4;
- unsigned tex0Fmt : 4;
- unsigned tex1Width : 4;
- unsigned tex1Height : 4;
- unsigned tex1Fmt : 4;
- unsigned texBLoopEn : 1;
- unsigned tex0En : 1;
- unsigned tex1En : 1;
- unsigned orthProjEn : 1;
- unsigned reserved : 1;
- unsigned palSize : 2;
- unsigned newPal : 1;
- }ni;
- u_int32_t ui;
-} savageRegTexDescr_s4;
-typedef union
-{
- struct
- {
- unsigned texWidth : 4;
- unsigned reserved1 : 4;
- unsigned texHeight : 4;
- unsigned reserved2 : 4;
- /* Savage3D supports only the first 8 texture formats defined in
- enum TexFmt in savge_bci.h. */
- unsigned texFmt : 3;
- unsigned palSize : 2;
- unsigned reserved3 : 10;
- unsigned newPal : 1;
- }ni;
- u_int32_t ui;
-} savageRegTexDescr_s3d;
-
-/* The layout of this reg is the same on Savage4 and Savage3D,
- but the Savage4 has two of them, Savage3D has only one. */
-typedef union
-{
- struct
- {
- unsigned inSysTex : 1;
- unsigned inAGPTex : 1;
- unsigned reserved : 1;
- unsigned addr : 29;
- }ni;
- u_int32_t ui;
-} savageRegTexAddr;
-
-/* The layout of this reg is the same on Savage4 and Savage3D. */
-typedef union
-{
- struct
- {
- unsigned reserved : 3;
- unsigned addr : 29;
- }ni;
- u_int32_t ui;
-} savageRegTexPalAddr;
-
-/* The layout of this reg on Savage4 and Savage3D are very similar. */
-typedef union
-{
- struct
- {
- unsigned xprClr0 : 16;
- unsigned xprClr1 : 16; /* this is reserved on Savage3D */
- }ni;
- u_int32_t ui;
-} savageRegTexXprClr; /* transparency color in RGB565 format*/
-
-/* The layout of this reg differs between Savage4 and Savage3D.
- * Savage4 has two of them, Savage3D has only one. */
-typedef union
-{
- struct
- {
- unsigned filterMode : 2;
- unsigned mipmapEnable : 1;
- unsigned dBias : 9;
- unsigned dMax : 4;
- unsigned uMode : 2;
- unsigned vMode : 2;
- unsigned useDFraction : 1;
- unsigned texXprEn : 1;
- unsigned clrBlendAlphaSel : 2;
- unsigned clrArg1CopyAlpha : 1;
- unsigned clrArg2CopyAlpha : 1;
- unsigned clrArg1Invert : 1;
- unsigned clrArg2Invert : 1;
- unsigned alphaBlendAlphaSel : 2;
- unsigned alphaArg1Invert : 1;
- unsigned alphaArg2Invert : 1;
- }ni;
- u_int32_t ui;
-} savageRegTexCtrl_s4;
-typedef union
-{
- struct
- {
- unsigned filterMode : 2;
- unsigned mipmapDisable : 1;
- unsigned dBias : 9;
- unsigned uWrapEn : 1;
- unsigned vWrapEn : 1;
- unsigned wrapMode : 2;
- unsigned texEn : 1;
- unsigned useDFraction : 1;
- unsigned reserved1 : 1;
- /* Color Compare Alpha Blend Control
- 0 - reduce dest alpha to 0 or 1
- 1 - blend with destination
- The Utah-Driver doesn't know how to use it and sets it to 0. */
- unsigned CCA : 1;
- unsigned texXprEn : 1;
- unsigned reserved2 : 11;
- }ni;
- u_int32_t ui;
-} savageRegTexCtrl_s3d;
-
-/* This reg exists only on Savage4. */
-typedef union
-{
- struct
- {
- unsigned colorArg1Sel : 2;
- unsigned colorArg2Sel : 3;
- unsigned colorInvAlphaEn : 1;
- unsigned colorInvArg2En : 1;
- unsigned colorPremodSel : 1;
- unsigned colorMod1Sel : 1;
- unsigned colorMod2Sel : 2;
- unsigned colorAddSel : 2;
- unsigned colorDoBlend : 1;
- unsigned colorDo2sCompl : 1;
- unsigned colorAddBiasEn : 1;
- unsigned alphaArg1Sel : 2;
- unsigned alphaArg2Sel : 3;
- unsigned alphaMod1Sel : 1;
- unsigned alphaMod2Sel : 2;
- unsigned alphaAdd0Sel : 1;
- unsigned alphaDoBlend : 1;
- unsigned alphaDo2sCompl : 1;
- unsigned colorStageClamp : 1;
- unsigned alphaStageClamp : 1;
- unsigned colorDoDiffMul : 1;
- unsigned LeftShiftVal : 2;
- }ni;
- u_int32_t ui;
-} savageRegTexBlendCtrl;
-
-/* This reg exists only on Savage4. */
-typedef union
-{
- struct
- {
- unsigned blue : 8;
- unsigned green : 8;
- unsigned red : 8;
- unsigned alpha : 8;
- }ni;
- u_int32_t ui;
-} savageRegTexBlendColor;
-
-/********************************
- Tiled Surface Registers
-**********************************/
-
-typedef union
-{
- struct
- {
- unsigned frmBufOffset : 13;
- unsigned reserved : 12;
- unsigned widthInTile : 6;
- unsigned bitPerPixel : 1;
- }ni;
- u_int32_t ui;
-} savageRegTiledSurface;
-
-/********************************
- Draw/Shading Control Registers
-**********************************/
-
-/* This reg exists only on Savage4. */
-typedef union
-{
- struct
- {
- unsigned scissorXStart : 11;
- unsigned dPerfAccelEn : 1;
- unsigned scissorYStart : 12;
- unsigned alphaRefVal : 8;
- }ni;
- u_int32_t ui;
-} savageRegDrawCtrl0;
-
-/* This reg exists only on Savage4. */
-typedef union
-{
- struct
- {
- unsigned scissorXEnd : 11;
- unsigned xyOffsetEn : 1;
- unsigned scissorYEnd : 12;
- unsigned ditherEn : 1;
- unsigned nonNormTexCoord : 1;
- unsigned cullMode : 2;
- unsigned alphaTestCmpFunc : 3;
- unsigned alphaTestEn : 1;
- }ni;
- u_int32_t ui;
-} savageRegDrawCtrl1;
-
-/* This reg exists only on Savage4. */
-typedef union
-{
- struct
- {
- unsigned dstAlphaMode : 3;
- unsigned dstMinusSrc : 1;
- unsigned srcAlphaMode : 3;
- unsigned binaryFinalAlpha : 1;
- unsigned dstAlphaModeHighBit : 1;
- unsigned srcAlphaModeHighBit : 1;
- unsigned reserved1 : 15;
- unsigned wrZafterAlphaTst : 1;
- unsigned drawUpdateEn : 1;
- unsigned zUpdateEn : 1;
- unsigned flatShadeEn : 1;
- unsigned specShadeEn : 1;
- unsigned flushPdDestWrites : 1;
- unsigned flushPdZbufWrites : 1;
- }ni;
- u_int32_t ui;
-} savageRegDrawLocalCtrl;
-
-/* This reg exists only on Savage3D. */
-typedef union
-{
- struct
- {
- unsigned ditherEn : 1;
- unsigned xyOffsetEn : 1;
- unsigned cullMode : 2;
- unsigned vertexCountReset : 1;
- unsigned flatShadeEn : 1;
- unsigned specShadeEn : 1;
- unsigned dstAlphaMode : 3;
- unsigned srcAlphaMode : 3;
- unsigned reserved1 : 1;
- unsigned alphaTestCmpFunc : 3;
- unsigned alphaTestEn : 1;
- unsigned alphaRefVal : 8;
- unsigned texBlendCtrl : 3;
- unsigned flushPdDestWrites : 1;
- unsigned flushPdZbufWrites : 1;
- /* havn't found an equivalent for Savage4. Utah-driver sets it to 0. */
- unsigned interpMode : 1;
- }ni;
- u_int32_t ui;
-} savageRegDrawCtrl;
-
-#define SAVAGETBC_DECAL_S3D 0
-#define SAVAGETBC_MODULATE_S3D 1
-#define SAVAGETBC_DECALALPHA_S3D 2
-#define SAVAGETBC_MODULATEALPHA_S3D 3
-#define SAVAGETBC_4_S3D 4
-#define SAVAGETBC_5_S3D 5
-#define SAVAGETBC_COPY_S3D 6
-#define SAVAGETBC_7_S3D 7
-
-/* This reg exists only on Savage3D. */
-typedef union
-{
- struct
- {
- unsigned scissorXStart : 11;
- unsigned reserved1 : 5;
- unsigned scissorYStart : 11;
- unsigned reserved2 : 5;
- } ni;
- u_int32_t ui;
-} savageRegScissorsStart;
-
-/* This reg exists only on Savage3D. */
-typedef union
-{
- struct
- {
- unsigned scissorXEnd : 11;
- unsigned reserved1 : 5;
- unsigned scissorYEnd : 11;
- unsigned reserved2 : 5;
- } ni;
- u_int32_t ui;
-} savageRegScissorsEnd;
-
-/********************************
- Address Registers
-**********************************/
-
-/* I havn't found a Savage3D equivalent of this reg in the Utah-driver.
- * But Tim Roberts claims that the Savage3D supports DMA vertex and
- * command buffers. */
-typedef union
-{
- struct
- {
- unsigned isSys : 1;
- unsigned isAGP : 1;
- unsigned reserved : 1;
- unsigned addr : 29; /*quad word aligned*/
- }ni;
- u_int32_t ui;
-} savageRegVertBufAddr;
-
-/* I havn't found a Savage3D equivalent of this reg in the Utah-driver.
- * But Tim Roberts claims that the Savage3D supports DMA vertex and
- * command buffers. */
-typedef union
-{
- struct
- {
- unsigned isSys : 1;
- unsigned isAGP : 1;
- unsigned reserved : 1;
- unsigned addr : 29; /*4-quad word aligned*/
- }ni;
- u_int32_t ui;
-} savageRegDMABufAddr;
-
-/********************************
- H/W Debug Registers
-**********************************/
-/* The layout of this reg is the same on Savage4 and Savage3D. */
-typedef union
-{
- struct
- {
- unsigned y01 : 1;
- unsigned y12 : 1;
- unsigned y20 : 1;
- unsigned u01 : 1;
- unsigned u12 : 1;
- unsigned u20 : 1;
- unsigned v01 : 1;
- unsigned v12 : 1;
- unsigned v20 : 1;
- unsigned cullEn : 1;
- unsigned cullOrient : 1;
- unsigned loadNewTex : 1;
- unsigned loadNewPal : 1;
- unsigned doDSetup : 1;
- unsigned reserved : 17;
- unsigned kickOff : 1;
- }ni;
- u_int32_t ui;
-} savageRegFlag;
-
-/********************************
- Z Buffer Registers -- Global
-**********************************/
-
-/* The layout of this reg differs between Savage4 and Savage3D. */
-typedef union
-{
- struct
- {
- unsigned zCmpFunc : 3;
- unsigned reserved1 : 2;
- unsigned zBufEn : 1;
- unsigned reserved2 : 1;
- unsigned zExpOffset : 8;
- unsigned reserved3 : 1;
- unsigned stencilRefVal : 8;
- unsigned autoZEnable : 1;
- unsigned frameID : 1;
- unsigned reserved4 : 4;
- unsigned floatZEn : 1;
- unsigned wToZEn : 1;
- }ni;
- u_int32_t ui;
-} savageRegZBufCtrl_s4;
-typedef union
-{
- struct {
- unsigned zCmpFunc : 3;
- unsigned drawUpdateEn : 1;
- unsigned zUpdateEn : 1;
- unsigned zBufEn : 1;
-
- /**
- * We suspect that, in conjunction with
- * \c savageRegZBufOffset::zDepthSelect, these 2 bits are actually
- * \c stencilUpdateEn and \c stencilBufEn. If not, then some of
- * the bits in \c reserved2 may fulfill that purpose.
- */
- unsigned reserved1 : 2;
-
- unsigned zExpOffset : 8;
- unsigned wrZafterAlphaTst : 1;
- unsigned reserved2 : 15;
- }ni;
- u_int32_t ui;
-} savageRegZBufCtrl_s3d;
-
-/* The layout of this reg on Savage4 and Savage3D is very similar. */
-typedef union
-{
- struct
- {
- /* In the Utah-Driver the offset is defined as 13-bit, 2k-aligned. */
- unsigned offset : 14;
- unsigned reserved : 11; /* 12-bits in Utah-driver */
- unsigned zBufWidthInTiles : 6;
-
- /**
- * 0 selects 16-bit depth buffer. On Savage4 hardware, 1 selects
- * 24-bit depth buffer (with 8-bits for stencil). Though it has never
- * been tried, we suspect that on Savage3D hardware, 1 selects 15-bit
- * depth buffer (with 1-bit for stencil).
- */
- unsigned zDepthSelect : 1;
- }ni;
- u_int32_t ui;
-} savageRegZBufOffset;
-
-/* The layout of this reg is the same on Savage4 and Savage3D. */
-typedef union
-{
- struct
- {
- unsigned rLow : 6;
- unsigned reserved1 : 2;
- unsigned rHigh : 6;
- unsigned reserved2 : 2;
- unsigned wLow : 6;
- unsigned reserved3 : 2;
- unsigned wHigh : 6;
- unsigned reserved4 : 2;
- }ni;
- u_int32_t ui;
-} savageRegZWatermarks;
-
-/********************************
- Fog Registers -- Global
-**********************************/
-/* The layout of this reg is the same on Savage4 and Savage3D. */
-typedef union
-{
- struct
- {
- unsigned fogClr : 24;
- unsigned expShift : 3;
- unsigned reserved : 1;
- unsigned fogEn : 1;
- unsigned fogMode : 1;
- unsigned fogEndShift : 2;
- }ni;
- u_int32_t ui;
-} savageRegFogCtrl;
-
-/*not in spec, but tempo for pp and driver*/
-typedef union
-{
- struct
- {
- unsigned fogDensity : 16;
- unsigned fogStart : 16;
- }ni;
- u_int32_t ui;
-} savageRegFogParam;
-
-/**************************************
- Destination Buffer Registers -- Global
-***************************************/
-
-/* The layout of this reg on Savage4 and Savage3D are very similar. */
-typedef union
-{
- struct
- {
- unsigned dstWidthInTile : 7;
- unsigned reserved : 1;
- /* In the Utah-Driver the offset is defined as 13-bit, 2k-aligned. */
- unsigned offset : 14;
- unsigned reserved1 : 7;
- /* antiAliasMode does not exist in the Utah-driver. But it includes the
- * high bit of this in the destPixFmt. However, only values 0 and 2
- * are used as dstPixFmt, so antiAliasMode is effectively always 0
- * in the Utah-driver. In other words, treat as reserved on Savage3D.*/
- unsigned antiAliasMode : 2;
- unsigned dstPixFmt : 1;
- }ni;
- u_int32_t ui;
-} savageRegDestCtrl;
-
-/* The layout of this reg on Savage4 and Savage3D are very similar. */
-typedef union
-{
- struct
- {
- unsigned destReadLow : 6;
- unsigned destReadHigh : 6;
- unsigned destWriteLow : 6;
- unsigned destWriteHigh : 6;
- unsigned texRead : 4;
- unsigned reserved4 : 2;
- /* The Utah-driver calls this pixel FIFO length:
- * 00 - 240, 01 - 180, 10 - 120, 11 - 60
- * However, it is not used in either driver. */
- unsigned destFlush : 2;
- }ni;
- u_int32_t ui;
-} savageRegDestTexWatermarks;
-
-/* Savage4/Twister/ProSavage register BCI addresses */
-#define SAVAGE_DRAWLOCALCTRL_S4 0x1e
-#define SAVAGE_TEXPALADDR_S4 0x1f
-#define SAVAGE_TEXCTRL0_S4 0x20
-#define SAVAGE_TEXCTRL1_S4 0x21
-#define SAVAGE_TEXADDR0_S4 0x22
-#define SAVAGE_TEXADDR1_S4 0x23
-#define SAVAGE_TEXBLEND0_S4 0x24
-#define SAVAGE_TEXBLEND1_S4 0x25
-#define SAVAGE_TEXXPRCLR_S4 0x26 /* never used */
-#define SAVAGE_TEXDESCR_S4 0x27
-#define SAVAGE_FOGTABLE_S4 0x28
-#define SAVAGE_FOGCTRL_S4 0x30
-#define SAVAGE_STENCILCTRL_S4 0x31
-#define SAVAGE_ZBUFCTRL_S4 0x32
-#define SAVAGE_ZBUFOFF_S4 0x33
-#define SAVAGE_DESTCTRL_S4 0x34
-#define SAVAGE_DRAWCTRLGLOBAL0_S4 0x35
-#define SAVAGE_DRAWCTRLGLOBAL1_S4 0x36
-#define SAVAGE_ZWATERMARK_S4 0x37
-#define SAVAGE_DESTTEXRWWATERMARK_S4 0x38
-#define SAVAGE_TEXBLENDCOLOR_S4 0x39
-/* Savage3D/MX/IC register BCI addresses */
-#define SAVAGE_TEXPALADDR_S3D 0x18
-#define SAVAGE_TEXXPRCLR_S3D 0x19 /* never used */
-#define SAVAGE_TEXADDR_S3D 0x1A
-#define SAVAGE_TEXDESCR_S3D 0x1B
-#define SAVAGE_TEXCTRL_S3D 0x1C
-#define SAVAGE_FOGTABLE_S3D 0x20
-#define SAVAGE_FOGCTRL_S3D 0x30
-#define SAVAGE_DRAWCTRL_S3D 0x31
-#define SAVAGE_ZBUFCTRL_S3D 0x32
-#define SAVAGE_ZBUFOFF_S3D 0x33
-#define SAVAGE_DESTCTRL_S3D 0x34
-#define SAVAGE_SCSTART_S3D 0x35
-#define SAVAGE_SCEND_S3D 0x36
-#define SAVAGE_ZWATERMARK_S3D 0x37
-#define SAVAGE_DESTTEXRWWATERMARK_S3D 0x38
-
-#define SAVAGE_FIRST_REG 0x18
-#define SAVAGE_NR_REGS 34
-typedef struct savage_registers_s4_t {
- u_int32_t unused1[6]; /* 0x18-0x1d */
- savageRegDrawLocalCtrl drawLocalCtrl; /* 0x1e */
- savageRegTexPalAddr texPalAddr; /* 0x1f */
- savageRegTexCtrl_s4 texCtrl[2]; /* 0x20, 0x21 */
- savageRegTexAddr texAddr[2]; /* 0x22, 0x23 */
- savageRegTexBlendCtrl texBlendCtrl[2]; /* 0x24, 0x25 */
- savageRegTexXprClr texXprClr; /* 0x26 */
- savageRegTexDescr_s4 texDescr; /* 0x27 */
- u_int8_t fogTable[32]; /* 0x28-0x2f (8dwords) */
- savageRegFogCtrl fogCtrl; /* 0x30 */
- savageRegStencilCtrl stencilCtrl; /* 0x31 */
- savageRegZBufCtrl_s4 zBufCtrl; /* 0x32 */
- savageRegZBufOffset zBufOffset; /* 0x33 */
- savageRegDestCtrl destCtrl; /* 0x34 */
- savageRegDrawCtrl0 drawCtrl0; /* 0x35 */
- savageRegDrawCtrl1 drawCtrl1; /* 0x36 */
- savageRegZWatermarks zWatermarks; /* 0x37 */
- savageRegDestTexWatermarks destTexWatermarks; /* 0x38 */
- savageRegTexBlendColor texBlendColor; /* 0x39 */
-} savageRegistersS4;
-typedef struct savage_registers_s3d_t {
- savageRegTexPalAddr texPalAddr; /* 0x18 */
- savageRegTexXprClr texXprClr; /* 0x19 */
- savageRegTexAddr texAddr; /* 0x1a */
- savageRegTexDescr_s3d texDescr; /* 0x1b */
- savageRegTexCtrl_s3d texCtrl; /* 0x1c */
- u_int32_t unused1[3]; /* 0x1d-0x1f */
- u_int8_t fogTable[64]; /* 0x20-0x2f (16dwords) */
- savageRegFogCtrl fogCtrl; /* 0x30 */
- savageRegDrawCtrl drawCtrl; /* 0x31 */
- savageRegZBufCtrl_s3d zBufCtrl; /* 0x32 */
- savageRegZBufOffset zBufOffset; /* 0x33 */
- savageRegDestCtrl destCtrl; /* 0x34 */
- savageRegScissorsStart scissorsStart; /* 0x35 */
- savageRegScissorsEnd scissorsEnd; /* 0x36 */
- savageRegZWatermarks zWatermarks; /* 0x37 */
- savageRegDestTexWatermarks destTexWatermarks; /* 0x38 */
- u_int32_t unused2; /* 0x39 */
-} savageRegistersS3D;
-typedef union savage_registers_t {
- savageRegistersS4 s4;
- savageRegistersS3D s3d;
- u_int32_t ui[SAVAGE_NR_REGS];
-} savageRegisters;
-
-
-#define DV_PF_555 (0x1<<8)
-#define DV_PF_565 (0x2<<8)
-#define DV_PF_8888 (0x4<<8)
-
-#define SAVAGEPACKCOLORA4L4(l,a) \
- ((l >> 4) | (a & 0xf0))
-
-#define SAVAGEPACKCOLOR4444(r,g,b,a) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-#define SAVAGEPACKCOLOR1555(r,g,b,a) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define SAVAGEPACKCOLOR8888(r,g,b,a) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define SAVAGEPACKCOLOR565(r,g,b) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_bci.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_bci.h
deleted file mode 100644
index 33cfac32c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_bci.h
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef SAVAGE_BCI_H
-#define SAVAGE_BCI_H
-/***********************
- 3D and 2D command
-************************/
-
-typedef enum {
- AMO_BurstCmdData= 0x01010000,
- AMO_3DReg= 0x01048500,
- AMO_MotionCompReg= 0x01048900,
- AMO_VideoEngUnit= 0x01048A00,
- AMO_CmdBufAddr= 0x01048c14,
- AMO_TiledSurfReg0= 0x01048C40,
- AMO_TiledSurfReg1= 0x01048C44,
- AMO_TiledSurfReg2= 0x01048C48,
- AMO_TiledSurfReg3= 0x01048C4C,
- AMO_TiledSurfReg4= 0x01048C50,
- AMO_TiledSurfReg5= 0x01048C54,
- AMO_TiledSurfReg6= 0x01048C58,
- AMO_TiledSurfReg7= 0x01048C5C,
- AMO_LPBModeReg= 0x0100FF00,
- AMO_LPBFifoSat= 0x0100FF04,
- AMO_LPBIntFlag= 0x0100FF08,
- AMO_LPBFmBufA0= 0x0100FF0C,
- AMO_LPBFmBufA1= 0x0100FF10,
- AMO_LPBRdWtAdr= 0x0100FF14,
- AMO_LPBRdWtDat= 0x0100FF18,
- AMO_LPBIOPort = 0x0100FF1C,
- AMO_LPBSerPort= 0x0100FF20,
- AMO_LPBVidInWinSz= 0x0100FF24,
- AMO_LPBVidDatOffs= 0x0100FF28,
- AMO_LPBHorScalCtrl= 0x0100FF2C,
- AMO_LPBVerDeciCtrl= 0x0100FF30,
- AMO_LPBLnStride= 0x0100FF34,
- AMO_LPBFmBufAddr2= 0x0100FF38,
- AMO_LPBVidCapVDCtrl=0x0100FF3C,
-
- AMO_LPBVidCapFdStAd=0x0100FF60,
- AMO_LPBVidCapFdMdAd=0x0100FF64,
- AMO_LPBVidCapFdBtAd=0x0100FF68,
- AMO_LPBVidCapFdSize=0x0100FF6C,
- AMO_LPBBilinDecim1= 0x0100FF70,
- AMO_LPBBilinDecim2= 0x0100FF74,
- AMO_LPBBilinDecim3= 0x0100FF78,
- AMO_LPBDspVEUHorSRR=0x0100FF7C,
- AMO_LPBDspVEUVerSRR=0x0100FF80,
- AMO_LPBDspVeuDnScDR=0x0100FF84,
- AMO_LPB_VEUERPReg= 0x0100FF88,
- AMO_LPB_VBISelReg= 0x0100FF8C,
- AMO_LPB_VBIBasAdReg=0x0100FF90,
- AMO_LPB_DatOffsReg= 0x0100FF94,
- AMO_LPB_VBIVerDcReg=0x0100FF98,
- AMO_LPB_VBICtrlReg= 0x0100FF9C,
- AMO_LPB_VIPXferCtrl=0x0100FFA0,
- AMO_LPB_FIFOWtMark= 0x0100FFA4,
- AMO_LPB_FIFOCount= 0x0100FFA8,
- AMO_LPBFdSkipPat= 0x0100FFAC,
- AMO_LPBCapVEUHorSRR=0x0100FFB0,
- AMO_LPBCapVEUVerSRR=0x0100FFB4,
- AMO_LPBCapVeuDnScDR=0x0100FFB8
-
-}AddressMapOffset;
-/*more to add*/
-
-
-typedef enum {
- CMD_DrawPrim=0x10, /*10000*/
- CMD_DrawIdxPrim=0x11, /*10001*/
- CMD_SetRegister=0x12, /*10010*/
- CMD_UpdateShadowStat=0x13 , /*10011*/
- CMD_PageFlip=0x14, /* 10100*/
- CMD_BusMasterImgXfer=0x15, /* 10101*/
- CMD_ScaledImgXfer=0x16, /* 10110*/
- CMD_Macroblock=0x17, /*10111*/
- CMD_Wait= 0x18, /*11000*/
- CMD_2D_NOP=0x08, /* 01000*/
- CMD_2D_RCT=0x09, /*01001 rectangular fill*/
- CMD_2D_SCNL=0x0a, /* 01010 scan line*/
- CMD_2D_LIN=0x0b, /*01011 line*/
- CMD_2D_SMTXT=0x0c, /*01100*/
- CMD_2D_BPTXT=0x0d, /*01101*/
- CMD_InitFlag=0x1f /*11111, for S/W initialization control*/
-}Command;
-
-
-typedef enum {
- VRR_List,
- VRR_Strip,
- VRR_Fan,
- VRR_QuadList
-}VertexReplaceRule;
-
-/***********************
- Destination
-************************/
-
-typedef enum {
- DFT_RGB565 = 0,
- DFT_XRGB8888
-}DestinationFmt;
-
-
-/*************************
- Z Buffer / Alpha test
-*************************/
-
-typedef enum {
- CF_Never,
- CF_Less,
- CF_Equal,
- CF_LessEqual,
- CF_Greater,
- CF_NotEqual,
- CF_GreaterEqual,
- CF_Always
-}ZCmpFunc; /* same for Alpha test and Stencil test compare function */
-
-typedef ZCmpFunc ACmpFunc;
-
-typedef enum {
- ZDS_16i, /* .16 fixed*/
- ZDS_32f /* 1.8.15 float*/
-}ZDepthSelect;
-
-
-/**********************************
- BCI Register Addressing Index
-***********************************/
-typedef enum {
-
- CRI_VTX0_X = 0x00,
- CRI_VTX0_Y = 0x01,
- CRI_VTX0_W = 0x02,
- CRI_VTX0_DIFFU= 0x03,
- CRI_VTX0_SPECU= 0x04,
- CRI_VTX0_U = 0x05,
- CRI_VTX0_V = 0x06,
- CRI_VTX0_U2 = 0x07,
- CRI_VTX0_V2 = 0x08,
- CRI_VTX1_X = 0x09,
- CRI_VTX1_Y = 0x0a,
- CRI_VTX1_W = 0x0b,
- CRI_VTX1_DIFFU= 0x0c,
- CRI_VTX1_SPECU= 0x0d,
- CRI_VTX1_U = 0x0e,
- CRI_VTX1_V = 0x0f,
- CRI_VTX1_U2 = 0x10,
- CRI_VTX1_V2 = 0x11,
- CRI_VTX2_X = 0x12,
- CRI_VTX2_Y = 0x13,
- CRI_VTX2_W = 0x14,
- CRI_VTX2_DIFFU= 0x15,
- CRI_VTX2_SPECU= 0x16,
- CRI_VTX2_U = 0x17,
- CRI_VTX2_V = 0x18,
- CRI_VTX2_U2 = 0x19,
- CRI_VTX2_V2 = 0x1a,
-
- CRI_ZPixelOffset = 0x1d,
- CRI_DrawCtrlLocal = 0x1e,
- CRI_TexPalAddr = 0x1f,
- CRI_TexCtrl0 = 0x20,
- CRI_TexCtrl1 = 0x21,
- CRI_TexAddr0 = 0x22,
- CRI_TexAddr1 = 0x23,
- CRI_TexBlendCtrl0 = 0x24,
- CRI_TexBlendCtrl1 = 0x25,
- CRI_TexXprClr = 0x26,
- CRI_TexDescr = 0x27,
-
- CRI_FogTable00= 0x28,
- CRI_FogTable04= 0x29,
- CRI_FogTable08= 0x2a,
- CRI_FogTable12= 0x2b,
- CRI_FogTable16= 0x2c,
- CRI_FogTable20= 0x2d,
- CRI_FogTable24= 0x2e,
- CRI_FogTable28= 0x2f,
- CRI_FogCtrl= 0x30,
- CRI_StencilCtrl= 0x31,
- CRI_ZBufCtrl= 0x32,
- CRI_ZBufOffset= 0x33,
- CRI_DstCtrl= 0x34,
- CRI_DrawCtrlGlobal0= 0x35,
- CRI_DrawCtrlGlobal1= 0x36,
- CRI_ZRW_WTMK = 0x37,
- CRI_DST_WTMK = 0x38,
- CRI_TexBlendColor= 0x39,
-
- CRI_VertBufAddr= 0x3e,
- /* new in ms1*/
- CRI_MauFrameAddr0 = 0x40,
- CRI_MauFrameAddr1 = 0x41,
- CRI_MauFrameAddr2 = 0x42,
- CRI_MauFrameAddr3 = 0x43,
- CRI_FrameDesc = 0x44,
- CRI_IDCT9bitEn = 0x45,
- CRI_MV0 = 0x46,
- CRI_MV1 = 0x47,
- CRI_MV2 = 0x48,
- CRI_MV3 = 0x49,
- CRI_MacroDescr = 0x4a, /*kickoff?*/
-
- CRI_MeuCtrl = 0x50,
- CRI_SrcYAddr = 0x51,
- CRI_DestAddr = 0x52,
- CRI_FmtrSrcDimen = 0x53,
- CRI_FmtrDestDimen = 0x54,
- CRI_SrcCbAddr = 0x55,
- CRI_SrcCrAddr = 0x56,
- CRI_SrcCrCbStride = 0x57,
-
- CRI_BCI_Power= 0x5f,
-
- CRI_PSCtrl=0xA0,
- CRI_SSClrKeyCtrl=0xA1,
- CRI_SSCtrl=0xA4,
- CRI_SSChromUpBound=0xA5,
- CRI_SSHoriScaleCtrl=0xA6,
- CRI_SSClrAdj=0xA7,
- CRI_SSBlendCtrl=0xA8,
- CRI_PSFBAddr0=0xB0,
- CRI_PSFBAddr1=0xB1,
- CRI_PSStride=0xB2,
- CRI_DB_LPB_Support=0xB3,
- CRI_SSFBAddr0=0xB4,
- CRI_SSFBAddr1=0xB5,
- CRI_SSStride=0xB6,
- CRI_SSOpaqueCtrl=0xB7,
- CRI_SSVertScaleCtrl=0xB8,
- CRI_SSVertInitValue=0xB9,
- CRI_SSSrcLineCnt=0xBA,
- CRI_FIFO_RAS_Ctrl=0xBB,
- CRI_PSWinStartCoord=0xBC,
- CRI_PSWinSize=0xBD,
- CRI_SSWinStartCoord=0xBE,
- CRI_SSWinSize=0xBF,
- CRI_PSFIFOMon0=0xC0,
- CRI_SSFIFOMon0=0xC1,
- CRI_PSFIFOMon1=0xC2,
- CRI_SSFIFOMon1=0xC3,
- CRI_PSFBSize=0xC4,
- CRI_SSFBSize=0xC5,
- CRI_SSFBAddr2=0xC6,
- /* 2D register starts at D0*/
- CRI_CurrXY=0xD0,
- CRI_DstXYorStep=0xD1 ,
- CRI_LineErr=0xD2 ,
- CRI_DrawCmd=0xD3, /*kick off for image xfer*/
- CRI_ShortStrkVecXfer=0xD4,
- CRI_BackClr=0xD5,
- CRI_ForeClr=0xD6,
- CRI_BitPlaneWtMask=0xD7,
- CRI_BitPlaneRdMask=0xD8,
- CRI_ClrCmp=0xD9 ,
- CRI_BackAndForeMix=0xDA ,
- CRI_TopLeftSciss=0xDB ,
- CRI_BotRightSciss=0xDC ,
- CRI_PixOrMultiCtrl=0xDD ,
- CRI_MultiCtrlOrRdSelct=0xDE ,
- CRI_MinorOrMajorAxisCnt=0xDF ,
- CRI_GlobalBmpDesc1=0xE0 ,
- CRI_GlobalBmpDesc2=0xE1 ,
- CRI_BurstPriBmpDesc1=0xE2 ,
- CRI_BurstPriBmpDesc2=0xE3 ,
- CRI_BurstSecBmpDesc1=0xE4 ,
- CRI_BurstSecBmpDesc2=0xE5,
- CRI_ImageDataPort=0xF8
-
-}CtrlRegIdx;
-
-/***********************
- Fog Mode
-************************/
-typedef enum
-{
- FGM_Z_FOG, /*Table*/
- FGM_V_FOG /*Vertex*/
-} FogMode;
-
-/***********************
- Texture
-************************/
-typedef enum
-{
- TAM_Wrap,
- TAM_Clamp,
- TAM_Mirror
-} TexAddressModel;
-
-typedef enum
-{
- TFT_S3TC4Bit,
- TFT_Pal8Bit565,
- TFT_Pal8Bit1555,
- TFT_ARGB8888,
- TFT_ARGB1555,
- TFT_ARGB4444,
- TFT_RGB565,
- TFT_Pal8Bit4444,
- TFT_S3TC4A4Bit, /*like S3TC4Bit but with 4 bit alpha*/
- TFT_S3TC4CA4Bit, /*like S3TC4Bit, but with 4 bit compressed alpha*/
- TFT_S3TCL4,
- TFT_S3TCA4L4,
- TFT_L8,
- TFT_A4L4,
- TFT_I8,
- TFT_A8
-} TexFmt;
-
-typedef enum
-{
- TPS_64,
- TPS_128,
- TPS_192,
- TPS_256
-} TexPaletteSize;
-
-#define MAX_MIPMAP_LOD_BIAS 255
-#define MIN_MIPMAP_LOD_BIAS -255
-
-typedef enum
-{
- TFM_Point, /*1 TPP*/
- TFM_Bilin, /*2 TPP*/
- TFM_Reserved,
- TFM_Trilin /*16 TPP*/
-} TexFilterMode;
-
-
-#define TBC_Decal 0x00850410
-#define TBC_Modul 0x00850011
-#define TBC_DecalAlpha 0x00852A04
-#define TBC_ModulAlpha 0x00110011
-#define TBC_Copy 0x00840410
-#define TBC_CopyAlpha 0x00900405
-#define TBC_NoTexMap 0x00850405
-#define TBC_Blend0 0x00810004
-#define TBC_Blend1 0x00870e02
-#define TBC_BlendAlpha0 0x00040004
-#define TBC_BlendAlpha1 TBC_Blend1
-#define TBC_BlendInt0 0x00040004
-#define TBC_BlendInt1 0x01c20e02
-#define TBC_AddAlpha 0x19910c11
-#define TBC_Add 0x18110c11
-
-#define TBC_Decal1 0x00870410
-#define TBC_Modul1 0x00870013
-#define TBC_DecalAlpha1 0x00832A00
-#define TBC_ModulAlpha1 0x00130013
-#define TBC_NoTexMap1 0x00870407
-#define TBC_Copy1 0x00870400
-#define TBC_CopyAlpha1 0x00900400
-#define TBC_AddAlpha1 0x19930c13
-#define TBC_Add1 0x18130c13
-
-/*
- * derived from TexBlendCtrl
- */
-
-typedef enum
-{
- TBC_UseSrc,
- TBC_UseTex,
- TBC_TexTimesSrc,
- TBC_BlendTexWithSrc
-} TexBlendCtrlMode;
-
-/***********************
- Draw Control
-************************/
-typedef enum
-{
- BCM_Reserved,
- BCM_None,
- BCM_CW,
- BCM_CCW
-} BackfaceCullingMode;
-
-typedef enum
-{
- SAM_Zero,
- SAM_One,
- SAM_DstClr,
- SAM_1DstClr,
- SAM_SrcAlpha,
- SAM_1SrcAlpha,
- SAM_DstAlpha,
- SAM_1DstAlpha
-} SrcAlphaBlendMode;
-
-/* -1 from state*/
-typedef enum
-{
- DAM_Zero,
- DAM_One,
- DAM_SrcClr,
- DAM_1SrcClr,
- DAM_SrcAlpha,
- DAM_1SrcAlpha,
- DAM_DstAlpha,
- DAM_1DstAlpha
-} DstAlphaBlendMode;
-
-/*
- * stencil control
- */
-
-typedef enum
-{
- STENCIL_Keep,
- STENCIL_Zero,
- STENCIL_Equal,
- STENCIL_IncClamp,
- STENCIL_DecClamp,
- STENCIL_Invert,
- STENCIL_Inc,
- STENCIL_Dec
-} StencilOp;
-
-/***************************************************************
-*** Bitfield Structures for Programming Interface **************
-***************************************************************/
-
-/**************************
- Command Header Entry
-**************************/
-
-typedef struct { /*for DrawIndexPrimitive command, vert0Idx is meaningful.*/
- unsigned int vert0Idx:16;
- unsigned int vertCnt:8;
- unsigned int cont:1;
- unsigned int type:2; /*00=list, 01=strip, 10=fan, 11=reserved*/
- unsigned int cmd:5;
-}Reg_DrawIndexPrimitive;
-
-typedef struct { /*for DrawIndexPrimitive command, vert0Idx is meaningful.*/
- unsigned int noW:1;
- unsigned int noCd:1;
- unsigned int noCs:1;
- unsigned int noU:1;
- unsigned int noV:1;
- unsigned int noU2:1;
- unsigned int noV2:1;
-
- unsigned int reserved:9;
- unsigned int vertCnt:8;
- unsigned int cont:1;
- unsigned int type:2; /* 00=list, 01=strip, 10=fan, 11=reserved*/
- unsigned int cmd:5;
-}Reg_DrawPrimitive;
-
-
-typedef struct {
- unsigned int startRegIdx:8;
- unsigned int reserved:8;
- unsigned int regCnt:8;
- unsigned int resvered1:1;
- unsigned int lowEn:1;
- unsigned int highEn:1;
- unsigned int cmd:5;
-}Reg_SetRegister;
-
-typedef struct {
- unsigned int reserved1:22;
- unsigned int isPrimary:1;
- unsigned int MIU_SYNC:1;
- unsigned int reserved2:3;
- unsigned int cmd:5;
-}Reg_QueuedPageFlip;
-
-typedef struct {
- unsigned int reserved1:22;
- unsigned int DIR:1;
- unsigned int CTG:1; /*set to 0*/
- unsigned int BPP:1;
- unsigned int reserved2:1;
- unsigned int cmd:5;
-}Reg_MasterImgXfer;
-
-typedef struct {
- unsigned int PD:4; /*PM=mono, PS=descriptor specified*/
- unsigned int PT:1;
- unsigned int SD:4;
- unsigned int ST:1;
- unsigned int DD:3;
- unsigned int DC:2; /*DC=destination clip*/
- unsigned int CS:1; /*cs=color specified*/
- unsigned int MIX3:8;
- unsigned int XP:1;
- unsigned int YP:1;
- unsigned int LP:1;
- unsigned int cmd:5;
-}Reg_2D;
-
-typedef struct {
- unsigned int CodedBlkPattern:6;
- unsigned int DCT_Type:1;
- unsigned int MB_Type:2;
- unsigned int MotionType:2;
- unsigned int MB_Row:6;
- unsigned int MB_Column:6;
- unsigned int mv3:1;
- unsigned int mv2:1;
- unsigned int mv1:1;
- unsigned int mv0:1;
- unsigned int cmd:5;
-}Reg_MacroBlock;
-
-typedef struct {
- unsigned int scanLnCnt:11;
- unsigned int clkCnt:5;
- unsigned int e3d:1;
- unsigned int e2d:1;
- unsigned int mau:1;
- unsigned int veu:1;
- unsigned int meuMit:1;
- unsigned int meuSit:1;
- unsigned int meuVx:1;
- unsigned int meuMau:1;
- unsigned int pageFlip:1;
- unsigned int scanLn:1;
- unsigned int clk:1;
- unsigned int cmd:5;
-}Reg_Wait;
-
-typedef struct{
- unsigned int reserved:27;
- unsigned int cmd:5;
-}Reg_ScaledImgXfer ;
-
-typedef struct{
- unsigned int eventTag:16;
- unsigned int reserved2:6;
- unsigned int ET:1;
- unsigned int INT:1;
- unsigned int reserved1:3;
- unsigned int cmd:5;
-}Reg_UpdtShadowStat;
-
-typedef union {
- Reg_DrawPrimitive vert;
- Reg_DrawIndexPrimitive vertIdx;
- Reg_SetRegister set;
- Reg_QueuedPageFlip pageFlip;
- Reg_MasterImgXfer masterImgXfer;
- Reg_ScaledImgXfer scaledImgXfer;
- Reg_UpdtShadowStat updtShadow;
- Reg_MacroBlock macroBlk;
- Reg_2D cmd2D;
- Reg_Wait wait;
-}CmdHeaderUnion;
-
-
-/*frank 2001/11/14 add BCI write macros*/
-/* Registers not used in the X server
- */
-
-#define SAVAGE_NOP_ID 0x2094
-#define SAVAGE_NOP_ID_MASK ((1<<22)-1)
-
-
-/* 3D instructions
- */
-
-/* Draw Primitive Control */
-
-
-#define SAVAGE_HW_NO_Z (1<<0)
-#define SAVAGE_HW_NO_W (1<<1)
-#define SAVAGE_HW_NO_CD (1<<2)
-#define SAVAGE_HW_NO_CS (1<<3)
-#define SAVAGE_HW_NO_U0 (1<<4)
-#define SAVAGE_HW_NO_V0 (1<<5)
-#define SAVAGE_HW_NO_UV0 ((1<<4) | (1<<5))
-#define SAVAGE_HW_NO_U1 (1<<6)
-#define SAVAGE_HW_NO_V1 (1<<7)
-#define SAVAGE_HW_NO_UV1 ((1<<6) | (1<<7))
-#define SAVAGE_HW_SKIPFLAGS 0x000000ff
-
-#endif
-
-
-
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_init.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_init.h
deleted file mode 100644
index 0dec397b7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_init.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef _SAVAGE_INIT_H_
-#define _SAVAGE_INIT_H_
-
-#include <sys/time.h>
-#include "dri_util.h"
-#include "mtypes.h"
-
-#include "xmlconfig.h"
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
- char *map;
-} savageRegion, *savageRegionPtr;
-
-typedef struct {
- int chipset;
- int width;
- int height;
- int mem;
-
- int cpp; /* for front and back buffers */
- int zpp;
-
- int agpMode;
-
- unsigned int bufferSize;
-
-#if 0
- int bitsPerPixel;
-#endif
- unsigned int frontFormat;
- unsigned int frontOffset;
- unsigned int backOffset;
- unsigned int depthOffset;
-
- unsigned int aperturePitch;
-
- unsigned int textureOffset[SAVAGE_NR_TEX_HEAPS];
- unsigned int textureSize[SAVAGE_NR_TEX_HEAPS];
- unsigned int logTextureGranularity[SAVAGE_NR_TEX_HEAPS];
- drmAddress texVirtual[SAVAGE_NR_TEX_HEAPS];
-
- __DRIscreenPrivate *driScrnPriv;
-
- savageRegion aperture;
- savageRegion agpTextures;
-
- drmBufMapPtr bufs;
-
- unsigned int sarea_priv_offset;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} savageScreenPrivate;
-
-
-/**
- * savageRenderbuffer, derived from Mesa's gl_renderbuffer
- */
-typedef struct {
- struct gl_renderbuffer Base;
- /* XXX per-window info should go here */
- int foo, bar;
-} savageRenderbuffer;
-
-
-#include "savagecontext.h"
-
-extern void savageGetLock( savageContextPtr imesa, GLuint flags );
-extern void savageXMesaSetBackClipRects( savageContextPtr imesa );
-extern void savageXMesaSetFrontClipRects( savageContextPtr imesa );
-
-
-#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
-#define GET_ENQUEUE_AGE( imesa ) imesa->sarea->last_enqueue
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE( imesa ) \
- do { \
- char __ret=0; \
- DRM_CAS(imesa->driHwLock, imesa->hHWContext, \
- (DRM_LOCK_HELD|imesa->hHWContext), __ret); \
- if (__ret) \
- savageGetLock( imesa, 0 ); \
- } while (0)
-
-
-
-/* Unlock the hardware using the global current context
- */
-#define UNLOCK_HARDWARE(imesa) \
- DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext);
-
-
-/* This is the wrong way to do it, I'm sure. Otherwise the drm
- * bitches that I've already got the heavyweight lock. At worst,
- * this is 3 ioctls. The best solution probably only gets me down
- * to 2 ioctls in the worst case.
- */
-#define LOCK_HARDWARE_QUIESCENT( imesa ) do { \
- LOCK_HARDWARE( imesa ); \
- savageRegetLockQuiescent( imesa ); \
-} while(0)
-
-/* The following definitions are copied from savage_regs.h in the XFree86
- * driver. They are unlikely to change. If they do we need to keep them in
- * sync. */
-
-#define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
-
-#define S3_SAVAGE4_SERIES(chip) ((chip==S3_SAVAGE4) \
- || (chip==S3_PROSAVAGE) \
- || (chip==S3_TWISTER) \
- || (chip==S3_PROSAVAGEDDR))
-
-#define S3_SAVAGE_MOBILE_SERIES(chip) ((chip==S3_SAVAGE_MX) || (chip==S3_SUPERSAVAGE))
-
-#define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000))
-
-#define S3_MOBILE_TWISTER_SERIES(chip) ((chip==S3_TWISTER) \
- ||(chip==S3_PROSAVAGEDDR))
-
-/* Chip tags. These are used to group the adapters into
- * related families.
- */
-
-enum S3CHIPTAGS {
- S3_UNKNOWN = 0,
- S3_SAVAGE3D,
- S3_SAVAGE_MX,
- S3_SAVAGE4,
- S3_PROSAVAGE,
- S3_TWISTER,
- S3_PROSAVAGEDDR,
- S3_SUPERSAVAGE,
- S3_SAVAGE2000,
- S3_LAST
-};
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_xmesa.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_xmesa.c
deleted file mode 100644
index 0c2fc4767..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
-#include "savagecontext.h"
-#include "context.h"
-#include "matrix.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
-
-#include "utils.h"
-
-#include "extensions.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "savagedd.h"
-#include "savagestate.h"
-#include "savagetex.h"
-#include "savagespan.h"
-#include "savagetris.h"
-#include "savageioctl.h"
-#include "savage_bci.h"
-
-#include "savage_dri.h"
-
-#include "texmem.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#include "extension_helper.h"
-
-#include "xmlpool.h"
-
-/* Driver-specific options
- */
-#define SAVAGE_ENABLE_VDMA(def) \
-DRI_CONF_OPT_BEGIN(enable_vdma,bool,def) \
- DRI_CONF_DESC(en,"Use DMA for vertex transfers") \
- DRI_CONF_DESC(de,"Benutze DMA für Vertextransfers") \
-DRI_CONF_OPT_END
-#define SAVAGE_ENABLE_FASTPATH(def) \
-DRI_CONF_OPT_BEGIN(enable_fastpath,bool,def) \
- DRI_CONF_DESC(en,"Use fast path for unclipped primitives") \
- DRI_CONF_DESC(de,"Schneller Codepfad für ungeschnittene Polygone") \
-DRI_CONF_OPT_END
-#define SAVAGE_SYNC_FRAMES(def) \
-DRI_CONF_OPT_BEGIN(sync_frames,bool,def) \
- DRI_CONF_DESC(en,"Synchronize with graphics hardware after each frame") \
- DRI_CONF_DESC(de,"Synchronisiere nach jedem Frame mit Grafikhardware") \
-DRI_CONF_OPT_END
-
-/* Configuration
- */
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_QUALITY
- DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
- DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
- DRI_CONF_FLOAT_DEPTH(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_PERFORMANCE
- SAVAGE_ENABLE_VDMA(true)
- SAVAGE_ENABLE_FASTPATH(true)
- SAVAGE_SYNC_FRAMES(false)
- DRI_CONF_MAX_TEXTURE_UNITS(2,1,2)
- DRI_CONF_TEXTURE_HEAPS(DRI_CONF_TEXTURE_HEAPS_ALL)
- DRI_CONF_FORCE_S3TC_ENABLE(false)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driNConfigOptions = 10;
-
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "api", DEBUG_VERBOSE_API },
- { "tex", DEBUG_VERBOSE_TEX },
- { "verb", DEBUG_VERBOSE_MSG },
- { "dma", DEBUG_DMA },
- { "state", DEBUG_STATE },
- { NULL, 0 }
-};
-#ifndef SAVAGE_DEBUG
-int SAVAGE_DEBUG = 0;
-#endif
-
-
-/*For time caculating test*/
-#if defined(DEBUG_TIME) && DEBUG_TIME
-struct timeval tv_s,tv_f;
-unsigned long time_sum=0;
-struct timeval tv_s1,tv_f1;
-#endif
-
-static const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_extension s4_extensions[] =
-{
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { NULL, NULL }
-};
-
-extern struct tnl_pipeline_stage _savage_texnorm_stage;
-extern struct tnl_pipeline_stage _savage_render_stage;
-
-static const struct tnl_pipeline_stage *savage_pipeline[] = {
-
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_savage_texnorm_stage,
- &_savage_render_stage,
- &_tnl_render_stage,
- 0,
-};
-
-
-/* this is first function called in dirver*/
-
-static GLboolean
-savageInitDriver(__DRIscreenPrivate *sPriv)
-{
- savageScreenPrivate *savageScreen;
- SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
-
- if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- savageScreen = (savageScreenPrivate *)Xmalloc(sizeof(savageScreenPrivate));
- if (!savageScreen)
- return GL_FALSE;
-
- savageScreen->driScrnPriv = sPriv;
- sPriv->private = (void *)savageScreen;
-
- savageScreen->chipset=gDRIPriv->chipset;
- savageScreen->width=gDRIPriv->width;
- savageScreen->height=gDRIPriv->height;
- savageScreen->mem=gDRIPriv->mem;
- savageScreen->cpp=gDRIPriv->cpp;
- savageScreen->zpp=gDRIPriv->zpp;
-
- savageScreen->agpMode=gDRIPriv->agpMode;
-
- savageScreen->bufferSize=gDRIPriv->bufferSize;
-
- if (gDRIPriv->cpp == 4)
- savageScreen->frontFormat = DV_PF_8888;
- else
- savageScreen->frontFormat = DV_PF_565;
- savageScreen->frontOffset=gDRIPriv->frontOffset;
- savageScreen->backOffset = gDRIPriv->backOffset;
- savageScreen->depthOffset=gDRIPriv->depthOffset;
-
- savageScreen->textureOffset[SAVAGE_CARD_HEAP] =
- gDRIPriv->textureOffset;
- savageScreen->textureSize[SAVAGE_CARD_HEAP] =
- gDRIPriv->textureSize;
- savageScreen->logTextureGranularity[SAVAGE_CARD_HEAP] =
- gDRIPriv->logTextureGranularity;
-
- savageScreen->textureOffset[SAVAGE_AGP_HEAP] =
- gDRIPriv->agpTextureHandle;
- savageScreen->textureSize[SAVAGE_AGP_HEAP] =
- gDRIPriv->agpTextureSize;
- savageScreen->logTextureGranularity[SAVAGE_AGP_HEAP] =
- gDRIPriv->logAgpTextureGranularity;
-
- savageScreen->agpTextures.handle = gDRIPriv->agpTextureHandle;
- savageScreen->agpTextures.size = gDRIPriv->agpTextureSize;
- if (gDRIPriv->agpTextureSize) {
- if (drmMap(sPriv->fd,
- savageScreen->agpTextures.handle,
- savageScreen->agpTextures.size,
- (drmAddress *)&(savageScreen->agpTextures.map)) != 0) {
- Xfree(savageScreen);
- sPriv->private = NULL;
- return GL_FALSE;
- }
- } else
- savageScreen->agpTextures.map = NULL;
-
- savageScreen->texVirtual[SAVAGE_CARD_HEAP] =
- (drmAddress)(((GLubyte *)sPriv->pFB)+gDRIPriv->textureOffset);
- savageScreen->texVirtual[SAVAGE_AGP_HEAP] =
- (drmAddress)(savageScreen->agpTextures.map);
-
- savageScreen->aperture.handle = gDRIPriv->apertureHandle;
- savageScreen->aperture.size = gDRIPriv->apertureSize;
- savageScreen->aperturePitch = gDRIPriv->aperturePitch;
- if (drmMap(sPriv->fd,
- savageScreen->aperture.handle,
- savageScreen->aperture.size,
- (drmAddress *)&savageScreen->aperture.map) != 0)
- {
- Xfree(savageScreen);
- sPriv->private = NULL;
- return GL_FALSE;
- }
-
- savageScreen->bufs = drmMapBufs(sPriv->fd);
-
- savageScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&savageScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
-#if 0
- savageDDFastPathInit();
- savageDDTrifuncInit();
- savageDDSetupInit();
-#endif
- return GL_TRUE;
-}
-
-/* Accessed by dlsym from dri_mesa_init.c
- */
-static void
-savageDestroyScreen(__DRIscreenPrivate *sPriv)
-{
- savageScreenPrivate *savageScreen = (savageScreenPrivate *)sPriv->private;
-
- if (savageScreen->bufs)
- drmUnmapBufs(savageScreen->bufs);
-
- /* free all option information */
- driDestroyOptionInfo (&savageScreen->optionCache);
-
- Xfree(savageScreen);
- sPriv->private = NULL;
-}
-
-#if 0
-GLvisual *XMesaCreateVisual(Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
- const XVisualInfo *visinfo,
- const __GLXvisualConfig *config)
-{
- /* Drivers may change the args to _mesa_create_visual() in order to
- * setup special visuals.
- */
- return _mesa_create_visual( config->rgba,
- config->doubleBuffer,
- config->stereo,
- _mesa_bitcount(visinfo->red_mask),
- _mesa_bitcount(visinfo->green_mask),
- _mesa_bitcount(visinfo->blue_mask),
- config->alphaSize,
- 0, /* index bits */
- config->depthSize,
- config->stencilSize,
- config->accumRedSize,
- config->accumGreenSize,
- config->accumBlueSize,
- config->accumAlphaSize,
- 0 /* num samples */ );
-}
-#endif
-
-
-static GLboolean
-savageCreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- GLcontext *ctx, *shareCtx;
- savageContextPtr imesa;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- struct dd_function_table functions;
- savageScreenPrivate *savageScreen = (savageScreenPrivate *)sPriv->private;
- drm_savage_sarea_t *saPriv=(drm_savage_sarea_t *)(((char*)sPriv->pSAREA)+
- savageScreen->sarea_priv_offset);
- int textureSize[SAVAGE_NR_TEX_HEAPS];
- int i;
- imesa = (savageContextPtr)Xcalloc(sizeof(savageContext), 1);
- if (!imesa) {
- return GL_FALSE;
- }
-
- /* Init default driver functions then plug in savage-specific texture
- * functions that are needed as early as during context creation. */
- _mesa_init_driver_functions( &functions );
- savageDDInitTextureFuncs( &functions );
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((savageContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- ctx = _mesa_create_context(mesaVis, shareCtx, &functions, imesa);
- if (!ctx) {
- Xfree(imesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = imesa;
-
- imesa->cmdBuf.size = SAVAGE_CMDBUF_SIZE;
- imesa->cmdBuf.base = imesa->cmdBuf.write =
- malloc(SAVAGE_CMDBUF_SIZE * sizeof(drm_savage_cmd_header_t));
- if (!imesa->cmdBuf.base)
- return GL_FALSE;
-
- /* Parse configuration files */
- driParseConfigFiles (&imesa->optionCache, &savageScreen->optionCache,
- sPriv->myNum, "savage");
-
- imesa->float_depth = driQueryOptionb(&imesa->optionCache, "float_depth") &&
- savageScreen->chipset >= S3_SAVAGE4;
- imesa->no_rast = driQueryOptionb(&imesa->optionCache, "no_rast");
-
-#if 0
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 3.0;
- ctx->Const.MaxLineWidthAA = 3.0;
- ctx->Const.LineWidthGranularity = 1.0;
-#endif
-
- /* Dri stuff
- */
- imesa->hHWContext = driContextPriv->hHWContext;
- imesa->driFd = sPriv->fd;
- imesa->driHwLock = &sPriv->pSAREA->lock;
-
- imesa->savageScreen = savageScreen;
- imesa->driScreen = sPriv;
- imesa->sarea = saPriv;
- imesa->glBuffer = NULL;
-
- /* DMA buffer */
-
- for(i=0;i<5;i++)
- {
- imesa->apertureBase[i] = (GLubyte *)savageScreen->aperture.map +
- 0x01000000 * i;
- }
-
- imesa->aperturePitch = savageScreen->aperturePitch;
-
- /* change texHeap initialize to support two kind of texture heap*/
- /* here is some parts of initialization, others in InitDriver() */
-
- (void) memset( imesa->textureHeaps, 0, sizeof( imesa->textureHeaps ) );
- make_empty_list( & imesa->swapped );
-
- textureSize[SAVAGE_CARD_HEAP] = savageScreen->textureSize[SAVAGE_CARD_HEAP];
- textureSize[SAVAGE_AGP_HEAP] = savageScreen->textureSize[SAVAGE_AGP_HEAP];
- imesa->lastTexHeap = savageScreen->texVirtual[SAVAGE_AGP_HEAP] ? 2 : 1;
- switch(driQueryOptioni (&imesa->optionCache, "texture_heaps")) {
- case DRI_CONF_TEXTURE_HEAPS_CARD: /* only use card memory, if available */
- if (textureSize[SAVAGE_CARD_HEAP])
- imesa->lastTexHeap = 1;
- break;
- case DRI_CONF_TEXTURE_HEAPS_GART: /* only use gart memory, if available */
- if (imesa->lastTexHeap == 2 && textureSize[SAVAGE_AGP_HEAP])
- textureSize[SAVAGE_CARD_HEAP] = 0;
- break;
- /*default: Nothing to do, use all available memory. */
- }
-
- for (i = 0; i < imesa->lastTexHeap; i++) {
- imesa->textureHeaps[i] = driCreateTextureHeap(
- i, imesa,
- textureSize[i],
- 11, /* 2^11 = 2k alignment */
- SAVAGE_NR_TEX_REGIONS,
- (drmTextureRegionPtr)imesa->sarea->texList[i],
- &imesa->sarea->texAge[i],
- &imesa->swapped,
- sizeof( savageTexObj ),
- (destroy_texture_object_t *) savageDestroyTexObj );
- /* If textureSize[i] == 0 textureHeaps[i] is NULL. This can happen
- * if there is not enough card memory for a card texture heap. */
- if (imesa->textureHeaps[i])
- driSetTextureSwapCounterLocation( imesa->textureHeaps[i],
- & imesa->c_textureSwaps );
- }
- imesa->texture_depth = driQueryOptioni (&imesa->optionCache,
- "texture_depth");
- if (imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
- imesa->texture_depth = ( savageScreen->cpp == 4 ) ?
- DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
- if (savageScreen->chipset >= S3_SAVAGE4)
- ctx->Const.MaxTextureUnits = 2;
- else
- ctx->Const.MaxTextureUnits = 1;
- if (driQueryOptioni(&imesa->optionCache, "texture_units") <
- ctx->Const.MaxTextureUnits)
- ctx->Const.MaxTextureUnits =
- driQueryOptioni(&imesa->optionCache, "texture_units");
- ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
- ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
-
- driCalculateMaxTextureLevels( imesa->textureHeaps,
- imesa->lastTexHeap,
- & ctx->Const,
- 4,
- 11, /* max 2D texture size is 2048x2048 */
- 0, /* 3D textures unsupported. */
- 0, /* cube textures unsupported. */
- 0, /* texture rectangles unsupported. */
- 12,
- GL_FALSE );
- if (ctx->Const.MaxTextureLevels <= 6) { /*spec requires at least 64x64*/
- __driUtilMessage("Not enough texture memory. "
- "Falling back to indirect rendering.");
- Xfree(imesa);
- return GL_FALSE;
- }
-
- imesa->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
- imesa->depth_scale = (imesa->savageScreen->zpp == 2) ?
- (1.0F/0xffff):(1.0F/0xffffff);
-
- imesa->bufferSize = savageScreen->bufferSize;
- imesa->dmaVtxBuf.total = 0;
- imesa->dmaVtxBuf.used = 0;
- imesa->dmaVtxBuf.flushed = 0;
-
- imesa->clientVtxBuf.total = imesa->bufferSize / 4;
- imesa->clientVtxBuf.used = 0;
- imesa->clientVtxBuf.flushed = 0;
- imesa->clientVtxBuf.buf = (u_int32_t *)malloc(imesa->bufferSize);
-
- imesa->vtxBuf = &imesa->clientVtxBuf;
-
- imesa->firstElt = -1;
-
- /* Uninitialized vertex format. Force setting the vertex state in
- * savageRenderStart.
- */
- imesa->vertex_size = 0;
-
- /* Utah stuff
- */
- imesa->new_state = ~0;
- imesa->new_gl_state = ~0;
- imesa->RenderIndex = ~0;
- imesa->dirty = ~0;
- imesa->lostContext = GL_TRUE;
- imesa->CurrentTexObj[0] = 0;
- imesa->CurrentTexObj[1] = 0;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
-
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, savage_pipeline );
-
- imesa->enable_fastpath = driQueryOptionb(&imesa->optionCache,
- "enable_fastpath");
- /* DRM versions before 2.1.3 would only render triangle lists. ELTS
- * support was added in 2.2.0. */
- if (imesa->enable_fastpath && sPriv->drmMinor < 2) {
- fprintf (stderr,
- "*** Disabling fast path because your DRM version is buggy "
- "or doesn't\n*** support ELTS. You need at least Savage DRM "
- "version 2.2.\n");
- imesa->enable_fastpath = GL_FALSE;
- }
-
- if (!savageScreen->bufs || savageScreen->chipset == S3_SUPERSAVAGE)
- imesa->enable_vdma = GL_FALSE;
- else
- imesa->enable_vdma = driQueryOptionb(&imesa->optionCache, "enable_vdma");
-
- imesa->sync_frames = driQueryOptionb(&imesa->optionCache, "sync_frames");
-
- /* Configure swrast to match hardware characteristics:
- */
- _tnl_allow_pixel_fog( ctx, GL_FALSE );
- _tnl_allow_vertex_fog( ctx, GL_TRUE );
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
-
- ctx->DriverCtx = (void *) imesa;
- imesa->glCtx = ctx;
-
-#ifndef SAVAGE_DEBUG
- SAVAGE_DEBUG = driParseDebugString( getenv( "SAVAGE_DEBUG" ),
- debug_control );
-#endif
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
- if (savageScreen->chipset >= S3_SAVAGE4)
- driInitExtensions( ctx, s4_extensions, GL_FALSE );
- if (ctx->Mesa_DXTn ||
- driQueryOptionb (&imesa->optionCache, "force_s3tc_enable")) {
- _mesa_enable_extension( ctx, "GL_S3_s3tc" );
- if (savageScreen->chipset >= S3_SAVAGE4)
- /* This extension needs DXT3 and DTX5 support in hardware.
- * Not available on Savage3D/MX/IX. */
- _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
- }
-
- savageDDInitStateFuncs( ctx );
- savageDDInitSpanFuncs( ctx );
- savageDDInitDriverFuncs( ctx );
- savageDDInitIoctlFuncs( ctx );
- savageInitTriFuncs( ctx );
-
- savageDDInitState( imesa );
-
- driContextPriv->driverPrivate = (void *) imesa;
-
- return GL_TRUE;
-}
-
-static void
-savageDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate;
- GLuint i;
-
- assert (imesa); /* should never be NULL */
- if (imesa) {
- savageFlushVertices(imesa);
- savageReleaseIndexedVerts(imesa);
- savageFlushCmdBuf(imesa, GL_TRUE); /* release DMA buffer */
- WAIT_IDLE_EMPTY(imesa);
-
- for (i = 0; i < imesa->lastTexHeap; i++)
- driDestroyTextureHeap(imesa->textureHeaps[i]);
-
- free(imesa->cmdBuf.base);
- free(imesa->clientVtxBuf.buf);
-
- _swsetup_DestroyContext(imesa->glCtx );
- _tnl_DestroyContext( imesa->glCtx );
- _ac_DestroyContext( imesa->glCtx );
- _swrast_DestroyContext( imesa->glCtx );
-
- /* free the Mesa context */
- imesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(imesa->glCtx);
-
- /* no longer use vertex_dma_buf*/
- Xfree(imesa);
- }
-}
-
-
-static GLboolean
-savageCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap)
-{
- savageScreenPrivate *screen = (savageScreenPrivate *) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24;
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0 );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
- /*
- * XXX: this value needs to be set according to the config file
- * setting. But we don't get that until we create a rendering
- * context!!!!
- */
- GLboolean float_depth = GL_FALSE;
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->aperturePitch);
- savageSetSpanFunctions(frontRb, mesaVis, float_depth);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->aperturePitch);
- savageSetSpanFunctions(backRb, mesaVis, float_depth);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->aperturePitch);
- savageSetSpanFunctions(depthRb, mesaVis, float_depth);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->aperturePitch);
- savageSetSpanFunctions(depthRb, mesaVis, float_depth);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->aperturePitch);
- savageSetSpanFunctions(stencilRb, mesaVis, float_depth);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-static void
-savageDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-#if 0
-void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv)
-{
- /* XXX should do swap according to the buffer, not the context! */
- savageContextPtr imesa = savageCtx;
-
- FLUSH_VB( imesa->glCtx, "swap buffers" );
- savageSwapBuffers(imesa);
-}
-#endif
-
-void savageXMesaSetFrontClipRects( savageContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
-
- savageCalcViewport( imesa->glCtx );
-}
-
-
-void savageXMesaSetBackClipRects( savageContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- if (dPriv->numBackClipRects == 0)
- {
-
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
- } else {
-
-
- imesa->numClipRects = dPriv->numBackClipRects;
- imesa->pClipRects = dPriv->pBackClipRects;
- imesa->drawX = dPriv->backX;
- imesa->drawY = dPriv->backY;
- }
-
- savageCalcViewport( imesa->glCtx );
-}
-
-
-static void savageXMesaWindowMoved( savageContextPtr imesa )
-{
- if (0)
- fprintf(stderr, "savageXMesaWindowMoved\n\n");
-
- switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- savageXMesaSetFrontClipRects( imesa );
- break;
- case BUFFER_BIT_BACK_LEFT:
- savageXMesaSetBackClipRects( imesa );
- break;
- default:
- break;
- }
-}
-
-
-static GLboolean
-savageUnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- savageContextPtr savage = (savageContextPtr) driContextPriv->driverPrivate;
- if (savage)
- savage->dirty = ~0;
-
- return GL_TRUE;
-}
-
-#if 0
-static GLboolean
-savageOpenFullScreen(__DRIcontextPrivate *driContextPriv)
-{
-
-
-
- if (driContextPriv) {
- savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate;
- imesa->IsFullScreen = GL_TRUE;
- imesa->backup_frontOffset = imesa->savageScreen->frontOffset;
- imesa->backup_backOffset = imesa->savageScreen->backOffset;
- imesa->backup_frontBitmapDesc = imesa->savageScreen->frontBitmapDesc;
- imesa->savageScreen->frontBitmapDesc = imesa->savageScreen->backBitmapDesc;
- imesa->toggle = TARGET_BACK;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean
-savageCloseFullScreen(__DRIcontextPrivate *driContextPriv)
-{
-
- if (driContextPriv) {
- savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate;
- WAIT_IDLE_EMPTY(imesa);
- imesa->IsFullScreen = GL_FALSE;
- imesa->savageScreen->frontOffset = imesa->backup_frontOffset;
- imesa->savageScreen->backOffset = imesa->backup_backOffset;
- imesa->savageScreen->frontBitmapDesc = imesa->backup_frontBitmapDesc;
- }
- return GL_TRUE;
-}
-#endif
-
-static GLboolean
-savageMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate;
-
- imesa->driReadable = driReadPriv;
- imesa->driDrawable = driDrawPriv;
- imesa->mesa_drawable = driDrawPriv;
- imesa->dirty = ~0;
-
- _mesa_make_current(imesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
-
- savageXMesaWindowMoved( imesa );
- }
- else
- {
- _mesa_make_current(NULL, NULL, NULL);
- }
- return GL_TRUE;
-}
-
-
-void savageGetLock( savageContextPtr imesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
- __DRIscreenPrivate *sPriv = imesa->driScreen;
- drm_savage_sarea_t *sarea = imesa->sarea;
- int me = imesa->hHWContext;
- int stamp = dPriv->lastStamp;
- int heap;
- unsigned int timestamp = 0;
-
-
-
- /* We know there has been contention.
- */
- drmGetLock(imesa->driFd, imesa->hHWContext, flags);
-
-
- /* Note contention for throttling hint
- */
- imesa->any_contend = 1;
-
- /* If the window moved, may need to set a new cliprect now.
- *
- * NOTE: This releases and regains the hw lock, so all state
- * checking must be done *after* this call:
- */
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
-
-
-
- /* If we lost context, need to dump all registers to hardware.
- * Note that we don't care about 2d contexts, even if they perform
- * accelerated commands, so the DRI locking in the X server is even
- * more broken than usual.
- */
- if (sarea->ctxOwner != me) {
- imesa->dirty |= (SAVAGE_UPLOAD_LOCAL |
- SAVAGE_UPLOAD_GLOBAL |
- SAVAGE_UPLOAD_FOGTBL |
- SAVAGE_UPLOAD_TEX0 |
- SAVAGE_UPLOAD_TEX1 |
- SAVAGE_UPLOAD_TEXGLOBAL);
- imesa->lostContext = GL_TRUE;
- sarea->ctxOwner = me;
- }
-
- for (heap = 0; heap < imesa->lastTexHeap; ++heap) {
- /* If a heap was changed, update its timestamp. Do this before
- * DRI_AGE_TEXTURES updates the local_age. */
- if (imesa->textureHeaps[heap] &&
- imesa->textureHeaps[heap]->global_age[0] >
- imesa->textureHeaps[heap]->local_age) {
- if (timestamp == 0)
- timestamp = savageEmitEventLocked(imesa, 0);
- imesa->textureHeaps[heap]->timestamp = timestamp;
- }
- DRI_AGE_TEXTURES( imesa->textureHeaps[heap] );
- }
-
- if (dPriv->lastStamp != stamp)
- savageXMesaWindowMoved( imesa );
-
-
-
-}
-
-
-
-static const struct __DriverAPIRec savageAPI = {
- savageInitDriver,
- savageDestroyScreen,
- savageCreateContext,
- savageDestroyContext,
- savageCreateBuffer,
- savageDestroyBuffer,
- savageSwapBuffers,
- savageMakeCurrent,
- savageUnbindContext
-};
-
-
-static __GLcontextModes *
-savageFillInModes( unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- *
- * FK: What about drivers that don't use page flipping? Could they
- * just expose GLX_SWAP_COPY_OML?
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- u_int8_t depth_bits_array[2];
- u_int8_t stencil_bits_array[2];
-
-
- depth_bits_array[0] = depth_bits;
- depth_bits_array[1] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
- back_buffer_factor = (have_back_buffer) ? 2 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGR;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for ( m = modes ; m != NULL ; m = m->next ) {
- if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 2, 0, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 2, 1, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "Savage",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &savageAPI);
- if ( psp != NULL ) {
- SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
- *driver_modes = savageFillInModes( dri_priv->cpp*8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagecontext.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagecontext.h
deleted file mode 100644
index 4c0959968..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagecontext.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#ifndef SAVAGECONTEXT_INC
-#define SAVAGECONTEXT_INC
-
-typedef struct savage_context_t savageContext;
-typedef struct savage_context_t *savageContextPtr;
-typedef struct savage_texture_object_t *savageTextureObjectPtr;
-
-#include <X11/Xlibint.h>
-#include "dri_util.h"
-#include "mtypes.h"
-#include "xf86drm.h"
-#include "drm.h"
-#include "savage_drm.h"
-#include "savage_init.h"
-#include "savage_3d_reg.h"
-#include "mm.h"
-#include "tnl/t_vertex.h"
-
-#include "texmem.h"
-
-#include "xmlconfig.h"
-
-/* Reasons to fallback on all primitives.
- */
-#define SAVAGE_FALLBACK_TEXTURE 0x1
-#define SAVAGE_FALLBACK_DRAW_BUFFER 0x2
-#define SAVAGE_FALLBACK_READ_BUFFER 0x4
-#define SAVAGE_FALLBACK_COLORMASK 0x8
-#define SAVAGE_FALLBACK_SPECULAR 0x10
-#define SAVAGE_FALLBACK_LOGICOP 0x20
-/*frank 2001/11/12 add the stencil fallbak*/
-#define SAVAGE_FALLBACK_STENCIL 0x40
-#define SAVAGE_FALLBACK_RENDERMODE 0x80
-#define SAVAGE_FALLBACK_BLEND_EQ 0x100
-#define SAVAGE_FALLBACK_NORAST 0x200
-#define SAVAGE_FALLBACK_PROJ_TEXTURE 0x400
-
-
-#define HW_CULL 1
-
-/* for savagectx.new_state - manage GL->driver state changes
- */
-#define SAVAGE_NEW_TEXTURE 0x1
-#define SAVAGE_NEW_CULL 0x2
-
-/* What needs to be changed for the current vertex dma buffer?
- * This will go away!
- */
-#define SAVAGE_UPLOAD_LOCAL 0x1 /* DrawLocalCtrl (S4) or
- DrawCtrl and ZBufCtrl (S3D) */
-#define SAVAGE_UPLOAD_TEX0 0x2 /* texture unit 0 */
-#define SAVAGE_UPLOAD_TEX1 0x4 /* texture unit 1 (S4 only) */
-#define SAVAGE_UPLOAD_FOGTBL 0x8 /* fog table */
-#define SAVAGE_UPLOAD_GLOBAL 0x10 /* most global regs */
-#define SAVAGE_UPLOAD_TEXGLOBAL 0x20 /* TexBlendColor (S4 only) */
-
-/*define the max numer of vertex in vertex buf*/
-#define SAVAGE_MAX_VERTEXS 0x10000
-
-/* Don't make it too big. We don't want to buffer up a whole frame
- * that would force the application to wait later. */
-#define SAVAGE_CMDBUF_SIZE 1024
-
-/* Use the templated vertex formats:
- */
-#define TAG(x) savage##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*savage_tri_func)( savageContextPtr, savageVertex *,
- savageVertex *, savageVertex * );
-typedef void (*savage_line_func)( savageContextPtr,
- savageVertex *, savageVertex * );
-typedef void (*savage_point_func)( savageContextPtr, savageVertex * );
-
-
-/**************************************************************
- **************** enums for chip IDs ************************
- **************************************************************/
-
-#define CHIP_S3GX3MS1NB 0x8A25
-#define CHIP_S3GX3MS1NBK 0x8A26
-#define CHIP_S3TWISTER 0x8D01
-#define CHIP_S3TWISTERK 0x8D02
-#define CHIP_S3TWISTER_P4M 0x8D04
-#define CHIP_S3PARAMOUNT128 0x8C22 /*SuperSavage 128/MX*/
-#define CHIP_S3TRISTAR128SDR 0x8C2A /*SuperSavage 128/IX*/
-#define CHIP_S3TRISTAR64SDRM7 0x8C2C /*SuperSavage/IX M7 Package*/
-#define CHIP_S3TRISTAR64SDR 0x8C2E /*SuperSavage/IX*/
-#define CHIP_S3TRISTAR64CDDR 0x8C2F /*SuperSavage/IXC DDR*/
-
-#define IS_SAVAGE(imesa) (imesa->savageScreen->deviceID == CHIP_S3GX3MS1NB || \
- imesa->savageScreen->deviceID == CHIP_S3GX3MS1NBK || \
- imesa->savageScreen->deviceID == CHIP_S3TWISTER || \
- imesa->savageScreen->deviceID == CHIP_S3TWISTERK || \
- imesa->savageScreen->deviceID == CHIP_S3TWISTER_P4M || \
- imesa->savageScreen->deviceID == CHIP_S3PARAMOUNT128 || \
- imesa->savageScreen->deviceID == CHIP_S3TRISTAR128SDR || \
- imesa->savageScreen->deviceID == CHIP_S3TRISTAR64SDRM7 || \
- imesa->savageScreen->deviceID == CHIP_S3TRISTAR64SDR || \
- imesa->savageScreen->deviceID == CHIP_S3TRISTAR64CDDR )
-
-
-struct savage_vtxbuf_t {
- GLuint total, used, flushed; /* in 32 bit units */
- GLuint idx; /* for DMA buffers */
- u_int32_t *buf;
-};
-
-struct savage_cmdbuf_t {
- GLuint size; /* size in qwords */
- drm_savage_cmd_header_t *base; /* initial state starts here */
- drm_savage_cmd_header_t *start; /* drawing/state commands start here */
- drm_savage_cmd_header_t *write; /* append stuff here */
-};
-
-struct savage_elt_t {
- GLuint n; /* number of elts currently allocated */
- drm_savage_cmd_header_t *cmd; /* the indexed drawing command */
-};
-
-
-struct savage_context_t {
- GLint refcount;
-
- GLcontext *glCtx;
-
- int lastTexHeap;
- driTexHeap *textureHeaps[SAVAGE_NR_TEX_HEAPS];
- driTextureObject swapped;
-
- driTextureObject *CurrentTexObj[2];
-
- /* Hardware state
- */
-
- savageRegisters regs, oldRegs, globalRegMask;
-
- /* Manage our own state */
- GLuint new_state;
- GLuint new_gl_state;
- GLboolean ptexHack;
-
- /* Command buffer */
- struct savage_cmdbuf_t cmdBuf;
-
- /* Elt book-keeping */
- struct savage_elt_t elts;
- GLint firstElt;
-
- /* Vertex buffers */
- struct savage_vtxbuf_t dmaVtxBuf, clientVtxBuf;
- struct savage_vtxbuf_t *vtxBuf;
-
- /* aperture base */
- GLubyte *apertureBase[5];
- GLuint aperturePitch;
- /* Manage hardware state */
- GLuint dirty;
- GLboolean lostContext;
- GLuint bTexEn1;
- /* One of the few bits of hardware state that can't be calculated
- * completely on the fly:
- */
- GLuint LcsCullMode;
- GLuint texEnvColor;
-
- /* Vertex state
- */
- GLuint vertex_size;
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
- char *verts; /* points to tnl->clipspace.vertex_buf */
-
- /* Rasterization state
- */
- GLuint SetupNewInputs;
- GLuint SetupIndex;
- GLuint RenderIndex;
-
- GLuint hw_primitive;
- GLenum raster_primitive;
- GLenum render_primitive;
-
- GLuint skip;
- GLubyte HwPrim;
- GLuint HwVertexSize;
-
- /* Fallback rasterization functions
- */
- savage_point_func draw_point;
- savage_line_func draw_line;
- savage_tri_func draw_tri;
-
- /* Funny mesa mirrors
- */
- GLuint MonoColor;
- GLuint ClearColor;
- GLfloat depth_scale;
- GLfloat hw_viewport[16];
- /* DRI stuff */
- GLuint bufferSize;
-
- GLframebuffer *glBuffer;
-
- /* Two flags to keep track of fallbacks. */
- GLuint Fallback;
-
- GLuint needClip;
-
- /* These refer to the current draw (front vs. back) buffer:
- */
- GLubyte *drawMap; /* draw buffer address in virtual mem */
- GLubyte *readMap;
- int drawX; /* origin of drawable in draw buffer */
- int drawY;
- GLuint numClipRects; /* cliprects for that buffer */
- GLint currentClip;
- drm_clip_rect_t *pClipRects;
-
- /* use this bit to support single/double buffer */
- GLuint IsDouble;
- /* use this to indicate Fullscreen mode */
- GLuint IsFullScreen; /* FIXME - open/close fullscreen is gone, is this needed? */
- GLuint backup_frontOffset;
- GLuint backup_backOffset;
- GLuint backup_frontBitmapDesc;
- GLuint toggle;
- GLuint backup_streamFIFO;
- GLuint NotFirstFrame;
-
- GLboolean inSwap;
- GLuint lastSwap;
- GLuint ctxAge;
- GLuint dirtyAge;
- GLuint any_contend; /* throttle me harder */
-
- /* Scissor state needs to be mirrored so buffered commands can be
- * emitted with the old scissor state when scissor state changes.
- */
- struct {
- GLboolean enabled;
- GLint x, y;
- GLsizei w, h;
- } scissor;
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- GLuint driFd;
-
- __DRIdrawablePrivate *driDrawable;
- __DRIdrawablePrivate *driReadable;
-
- /**
- * Drawable used by Mesa for software fallbacks for reading and
- * writing. It is set by Mesa's \c SetBuffer callback, and will always be
- * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable.
- */
- __DRIdrawablePrivate *mesa_drawable;
-
- __DRIscreenPrivate *driScreen;
- savageScreenPrivate *savageScreen;
- drm_savage_sarea_t *sarea;
-
- GLboolean hw_stencil;
-
- /* Performance counters
- */
- GLuint c_textureSwaps;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
- GLint texture_depth;
- GLboolean no_rast;
- GLboolean float_depth;
- GLboolean enable_fastpath;
- GLboolean enable_vdma;
- GLboolean sync_frames;
-};
-
-#define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx))
-
-/* To remove all debugging, make sure SAVAGE_DEBUG is defined as a
- * preprocessor symbol, and equal to zero.
- */
-#ifndef SAVAGE_DEBUG
-extern int SAVAGE_DEBUG;
-#endif
-
-#define DEBUG_FALLBACKS 0x001
-#define DEBUG_VERBOSE_API 0x002
-#define DEBUG_VERBOSE_TEX 0x004
-#define DEBUG_VERBOSE_MSG 0x008
-#define DEBUG_DMA 0x010
-#define DEBUG_STATE 0x020
-
-#define TARGET_FRONT 0x0
-#define TARGET_BACK 0x1
-#define TARGET_DEPTH 0x2
-
-#define SUBPIXEL_X -0.5
-#define SUBPIXEL_Y -0.375
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.c
deleted file mode 100644
index ced44e562..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "mtypes.h"
-#include "framebuffer.h"
-
-#include <stdio.h>
-
-#include "mm.h"
-#include "swrast/swrast.h"
-
-#include "savagedd.h"
-#include "savagestate.h"
-#include "savagespan.h"
-#include "savagetex.h"
-#include "savagetris.h"
-#include "savagecontext.h"
-#include "extensions.h"
-
-#include "utils.h"
-
-
-#define DRIVER_DATE "20050829"
-
-/***************************************
- * Mesa's Driver Functions
- ***************************************/
-
-
-static const GLubyte *savageDDGetString( GLcontext *ctx, GLenum name )
-{
- static char *cardNames[S3_LAST] = {
- "Unknown",
- "Savage3D",
- "Savage/MX/IX",
- "Savage4",
- "ProSavage",
- "Twister",
- "ProSavageDDR",
- "SuperSavage",
- "Savage2000"
- };
- static char buffer[128];
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- savageScreenPrivate *screen = imesa->savageScreen;
- enum S3CHIPTAGS chipset = screen->chipset;
- unsigned offset;
-
- if (chipset < S3_SAVAGE3D || chipset >= S3_LAST)
- chipset = S3_UNKNOWN; /* should not happen */
-
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *)"S3 Graphics Inc.";
- case GL_RENDERER:
- offset = driGetRendererString( buffer, cardNames[chipset], DRIVER_DATE,
- screen->agpMode );
- return (GLubyte *)buffer;
- default:
- return 0;
- }
-}
-#if 0
-static GLint savageGetParameteri(const GLcontext *ctx, GLint param)
-{
- switch (param) {
- case DD_HAVE_HARDWARE_FOG:
- return 1;
- default:
- return 0;
- }
-}
-#endif
-
-
-static void savageBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE(imesa);
- *width = imesa->driDrawable->w;
- *height = imesa->driDrawable->h;
- UNLOCK_HARDWARE(imesa);
-}
-
-
-void savageDDInitDriverFuncs( GLcontext *ctx )
-{
- ctx->Driver.GetBufferSize = savageBufferSize;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
- ctx->Driver.GetString = savageDDGetString;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.h
deleted file mode 100644
index ae167be70..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagedd.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef SAVAGEDD_INC
-#define SAVAGEDD_INC
-
-#include "context.h"
-
-void savageDDInitDriverFuncs( GLcontext *ctx );
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.c
deleted file mode 100644
index f759034e4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.c
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
-#include "context.h"
-#include "swrast/swrast.h"
-#include "colormac.h"
-
-#include "mm.h"
-#include "savagecontext.h"
-#include "savageioctl.h"
-#include "savage_bci.h"
-#include "savagestate.h"
-#include "savagespan.h"
-
-#include "drm.h"
-#include <sys/ioctl.h>
-#include <sys/timeb.h>
-
-#define DEPTH_SCALE_16 ((1<<16)-1)
-#define DEPTH_SCALE_24 ((1<<24)-1)
-
-
-void savageGetDMABuffer( savageContextPtr imesa )
-{
- int idx = 0;
- int size = 0;
- drmDMAReq dma;
- int retcode;
- drmBufPtr buf;
-
- assert (imesa->savageScreen->bufs);
-
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf(stderr, "Getting dma buffer\n");
-
- dma.context = imesa->hHWContext;
- dma.send_count = 0;
- dma.send_list = NULL;
- dma.send_sizes = NULL;
- dma.flags = 0;
- dma.request_count = 1;
- dma.request_size = imesa->bufferSize;
- dma.request_list = &idx;
- dma.request_sizes = &size;
- dma.granted_count = 0;
-
-
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf(stderr, "drmDMA (get) ctx %d count %d size 0x%x\n",
- dma.context, dma.request_count,
- dma.request_size);
-
- while (1) {
- retcode = drmDMA(imesa->driFd, &dma);
-
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf(stderr, "retcode %d sz %d idx %d count %d\n",
- retcode,
- dma.request_sizes[0],
- dma.request_list[0],
- dma.granted_count);
-
- if (retcode == 0 &&
- dma.request_sizes[0] &&
- dma.granted_count)
- break;
-
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf(stderr, "\n\nflush");
- }
-
- buf = &(imesa->savageScreen->bufs->list[idx]);
-
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf(stderr,
- "drmDMA (get) returns size[0] 0x%x idx[0] %d\n"
- "dma_buffer now: buf idx: %d size: %d used: %d addr %p\n",
- dma.request_sizes[0], dma.request_list[0],
- buf->idx, buf->total,
- buf->used, buf->address);
-
- imesa->dmaVtxBuf.total = buf->total / 4;
- imesa->dmaVtxBuf.used = 0;
- imesa->dmaVtxBuf.flushed = 0;
- imesa->dmaVtxBuf.idx = buf->idx;
- imesa->dmaVtxBuf.buf = (u_int32_t *)buf->address;
-
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf(stderr, "finished getbuffer\n");
-}
-
-#if 0
-/* Still keeping this around because it demonstrates page flipping and
- * automatic z-clear. */
-static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- int nbox = imesa->sarea->nbox;
- drm_clip_rect_t *pbox = imesa->sarea->boxes;
- int i;
-
-
- if (nbox > SAVAGE_NR_SAREA_CLIPRECTS)
- nbox = SAVAGE_NR_SAREA_CLIPRECTS;
-
- for (i = 0 ; i < nbox ; i++, pbox++) {
- unsigned int x = pbox->x1;
- unsigned int y = pbox->y1;
- unsigned int width = pbox->x2 - x;
- unsigned int height = pbox->y2 - y;
- u_int32_t *bciptr;
-
- if (pbox->x1 > pbox->x2 ||
- pbox->y1 > pbox->y2 ||
- pbox->x2 > imesa->savageScreen->width ||
- pbox->y2 > imesa->savageScreen->height)
- continue;
-
- if ( pclear->flags & SAVAGE_FRONT ) {
- bciptr = savageDMAAlloc (imesa, 8);
- WRITE_CMD((bciptr) , 0x4BCC8C00,u_int32_t);
- WRITE_CMD((bciptr) , imesa->savageScreen->frontOffset,u_int32_t);
- WRITE_CMD((bciptr) , imesa->savageScreen->frontBitmapDesc,u_int32_t);
- WRITE_CMD((bciptr) , pclear->clear_color,u_int32_t);
- WRITE_CMD((bciptr) , (y <<16) | x,u_int32_t);
- WRITE_CMD((bciptr) , (height << 16) | width,u_int32_t);
- savageDMACommit (imesa, bciptr);
- }
- if ( pclear->flags & SAVAGE_BACK ) {
- bciptr = savageDMAAlloc (imesa, 8);
- WRITE_CMD((bciptr) , 0x4BCC8C00,u_int32_t);
- WRITE_CMD((bciptr) , imesa->savageScreen->backOffset,u_int32_t);
- WRITE_CMD((bciptr) , imesa->savageScreen->backBitmapDesc,u_int32_t);
- WRITE_CMD((bciptr) , pclear->clear_color,u_int32_t);
- WRITE_CMD((bciptr) , (y <<16) | x,u_int32_t);
- WRITE_CMD((bciptr) , (height << 16) | width,u_int32_t);
- savageDMACommit (imesa, bciptr);
- }
-
- if ( pclear->flags & (SAVAGE_DEPTH |SAVAGE_STENCIL) ) {
- u_int32_t writeMask = 0x0;
- if(imesa->hw_stencil)
- {
- if(pclear->flags & SAVAGE_STENCIL)
- {
-
- writeMask |= 0xFF000000;
- }
- if(pclear->flags & SAVAGE_DEPTH)
- {
- writeMask |= 0x00FFFFFF;
- }
- }
- if(imesa->IsFullScreen && imesa->NotFirstFrame &&
- imesa->savageScreen->chipset >= S3_SAVAGE4)
- {
- imesa->regs.s4.zBufCtrl.ni.autoZEnable = GL_TRUE;
- imesa->regs.s4.zBufCtrl.ni.frameID =
- ~imesa->regs.s4.zBufCtrl.ni.frameID;
-
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
- }
- else
- {
- if(imesa->IsFullScreen)
- imesa->NotFirstFrame = GL_TRUE;
-
- if(imesa->hw_stencil)
- {
- bciptr = savageDMAAlloc (imesa, 10);
- if(writeMask != 0xFFFFFFFF)
- {
- WRITE_CMD((bciptr) , 0x960100D7,u_int32_t);
- WRITE_CMD((bciptr) , writeMask,u_int32_t);
- }
- }
- else
- {
- bciptr = savageDMAAlloc (imesa, 6);
- }
-
- WRITE_CMD((bciptr) , 0x4BCC8C00,u_int32_t);
- WRITE_CMD((bciptr) , imesa->savageScreen->depthOffset,u_int32_t);
- WRITE_CMD((bciptr) , imesa->savageScreen->depthBitmapDesc,u_int32_t);
- WRITE_CMD((bciptr) , pclear->clear_depth,u_int32_t);
- WRITE_CMD((bciptr) , (y <<16) | x,u_int32_t);
- WRITE_CMD((bciptr) , (height << 16) | width,u_int32_t);
- if(imesa->hw_stencil)
- {
- if(writeMask != 0xFFFFFFFF)
- {
- WRITE_CMD((bciptr) , 0x960100D7,u_int32_t);
- WRITE_CMD((bciptr) , 0xFFFFFFFF,u_int32_t);
- }
- }
- savageDMACommit (imesa, bciptr);
- }
- }
- }
- /* FK: Make sure that the clear stuff is emitted. Otherwise a
- software fallback may get overwritten by a delayed clear. */
- savageDMAFlush (imesa);
-}
-
-static void savage_BCI_swap(savageContextPtr imesa)
-{
- int nbox = imesa->sarea->nbox;
- drm_clip_rect_t *pbox = imesa->sarea->boxes;
- int i;
- volatile u_int32_t *bciptr;
-
- if (nbox > SAVAGE_NR_SAREA_CLIPRECTS)
- nbox = SAVAGE_NR_SAREA_CLIPRECTS;
- savageDMAFlush (imesa);
-
- if(imesa->IsFullScreen)
- { /* full screen*/
- unsigned int tmp0;
- tmp0 = imesa->savageScreen->frontOffset;
- imesa->savageScreen->frontOffset = imesa->savageScreen->backOffset;
- imesa->savageScreen->backOffset = tmp0;
-
- if(imesa->toggle == TARGET_BACK)
- imesa->toggle = TARGET_FRONT;
- else
- imesa->toggle = TARGET_BACK;
-
- imesa->drawMap = (char *)imesa->apertureBase[imesa->toggle];
- imesa->readMap = (char *)imesa->apertureBase[imesa->toggle];
-
- imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11;
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
- bciptr = SAVAGE_GET_BCI_POINTER(imesa,3);
- *(bciptr) = 0x960100B0;
- *(bciptr) = (imesa->savageScreen->frontOffset);
- *(bciptr) = 0xA0000000;
- }
-
- else
- { /* Use bitblt copy from back to front buffer*/
-
- for (i = 0 ; i < nbox; i++, pbox++)
- {
- unsigned int w = pbox->x2 - pbox->x1;
- unsigned int h = pbox->y2 - pbox->y1;
-
- if (pbox->x1 > pbox->x2 ||
- pbox->y1 > pbox->y2 ||
- pbox->x2 > imesa->savageScreen->width ||
- pbox->y2 > imesa->savageScreen->height)
- continue;
-
- bciptr = SAVAGE_GET_BCI_POINTER(imesa,6);
-
- *(bciptr) = 0x4BCC00C0;
-
- *(bciptr) = imesa->savageScreen->backOffset;
- *(bciptr) = imesa->savageScreen->backBitmapDesc;
- *(bciptr) = (pbox->y1 <<16) | pbox->x1; /*x0, y0*/
- *(bciptr) = (pbox->y1 <<16) | pbox->x1;
- *(bciptr) = (h << 16) | w;
- }
-
- }
-}
-#endif
-
-
-static GLboolean intersect_rect( drm_clip_rect_t *out,
- const drm_clip_rect_t *a,
- const drm_clip_rect_t *b )
-{
- *out = *a;
- if (b->x1 > out->x1) out->x1 = b->x1;
- if (b->y1 > out->y1) out->y1 = b->y1;
- if (b->x2 < out->x2) out->x2 = b->x2;
- if (b->y2 < out->y2) out->y2 = b->y2;
-
- return ((out->x1 < out->x2) && (out->y1 < out->y2));
-}
-
-
-static GLuint savageIntersectClipRects(drm_clip_rect_t *dest,
- const drm_clip_rect_t *src,
- GLuint nsrc,
- const drm_clip_rect_t *clip)
-{
- GLuint i, ndest;
-
- for (i = 0, ndest = 0; i < nsrc; ++i, ++src) {
- if (intersect_rect(dest, src, clip)) {
- dest++;
- ndest++;
- }
- }
-
- return ndest;
-}
-
-
-static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- GLuint colorMask, depthMask, clearColor, clearDepth, flags;
-
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "%s\n", __FUNCTION__);
-
- clearColor = imesa->ClearColor;
- if (imesa->float_depth) {
- if (imesa->savageScreen->zpp == 2)
- clearDepth = savageEncodeFloat16(1.0 - ctx->Depth.Clear);
- else
- clearDepth = savageEncodeFloat24(1.0 - ctx->Depth.Clear);
- } else {
- if (imesa->savageScreen->zpp == 2)
- clearDepth = (GLuint) ((1.0 - ctx->Depth.Clear) * DEPTH_SCALE_16);
- else
- clearDepth = (GLuint) ((1.0 - ctx->Depth.Clear) * DEPTH_SCALE_24);
- }
-
- colorMask = 0;
- depthMask = 0;
- switch (imesa->savageScreen->cpp) {
- case 2:
- colorMask = PACK_COLOR_565(ctx->Color.ColorMask[0],
- ctx->Color.ColorMask[1],
- ctx->Color.ColorMask[2]);
- break;
- case 4:
- colorMask = PACK_COLOR_8888(ctx->Color.ColorMask[3],
- ctx->Color.ColorMask[2],
- ctx->Color.ColorMask[1],
- ctx->Color.ColorMask[0]);
- break;
- }
-
- flags = 0;
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- flags |= SAVAGE_FRONT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if (mask & BUFFER_BIT_BACK_LEFT) {
- flags |= SAVAGE_BACK;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ((mask & BUFFER_BIT_DEPTH) && ctx->Depth.Mask) {
- flags |= SAVAGE_DEPTH;
- depthMask |=
- (imesa->savageScreen->zpp == 2) ? 0xffffffff : 0x00ffffff;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if((mask & BUFFER_BIT_STENCIL) && imesa->hw_stencil)
- {
- flags |= SAVAGE_DEPTH;
- depthMask |= 0xff000000;
- mask &= ~BUFFER_BIT_STENCIL;
- }
-
- savageFlushVertices(imesa);
-
- if (flags) {
- GLboolean depthCleared = GL_FALSE;
- if (flags & (SAVAGE_FRONT|SAVAGE_BACK)) {
- drm_savage_cmd_header_t *cmd;
- cmd = savageAllocCmdBuf(imesa, sizeof(drm_savage_cmd_header_t));
- cmd[0].clear0.cmd = SAVAGE_CMD_CLEAR;
- if ((flags & SAVAGE_DEPTH) &&
- clearDepth == clearColor && depthMask == colorMask) {
- cmd[0].clear0.flags = flags;
- depthCleared = GL_TRUE;
- } else
- cmd[0].clear0.flags = flags & (SAVAGE_FRONT|SAVAGE_BACK);
- cmd[1].clear1.mask = colorMask;
- cmd[1].clear1.value = clearColor;
- }
-
- if ((flags & SAVAGE_DEPTH) && !depthCleared) {
- drm_savage_cmd_header_t *cmd;
- cmd = savageAllocCmdBuf(imesa, sizeof(drm_savage_cmd_header_t));
- cmd[0].clear0.cmd = SAVAGE_CMD_CLEAR;
- cmd[0].clear0.flags = SAVAGE_DEPTH;
- cmd[1].clear1.mask = depthMask;
- cmd[1].clear1.value = clearDepth;
- }
- }
-
- if (mask)
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-}
-
-/*
- * Copy the back buffer to the front buffer.
- */
-void savageSwapBuffers( __DRIdrawablePrivate *dPriv )
-{
- savageContextPtr imesa;
-
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "%s\n================================\n", __FUNCTION__);
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- imesa = (savageContextPtr) dPriv->driContextPriv->driverPrivate;
- if (imesa->IsDouble)
- _mesa_notifySwapBuffers( imesa->glCtx );
-
- FLUSH_BATCH(imesa);
-
- if (imesa->sync_frames)
- imesa->lastSwap = savageEmitEvent( imesa, 0 );
-
- if (imesa->lastSwap != 0)
- savageWaitEvent( imesa, imesa->lastSwap );
-
- {
- drm_savage_cmd_header_t *cmd = savageAllocCmdBuf(imesa, 0);
- cmd->cmd.cmd = SAVAGE_CMD_SWAP;
- imesa->inSwap = GL_TRUE; /* ignore scissors in savageFlushCmdBuf */
- savageFlushCmdBuf(imesa, GL_FALSE);
- imesa->inSwap = GL_FALSE;
- }
-
- if (!imesa->sync_frames)
- /* don't sync, but limit the lag to one frame. */
- imesa->lastSwap = savageEmitEvent( imesa, 0 );
-}
-
-unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags )
-{
- drm_savage_event_emit_t event;
- int ret;
- event.count = 0;
- event.flags = flags;
- ret = drmCommandWriteRead( imesa->driFd, DRM_SAVAGE_BCI_EVENT_EMIT,
- &event, sizeof(event) );
- if (ret) {
- fprintf (stderr, "emit event returned %d\n", ret);
- exit (1);
- }
- return event.count;
-}
-unsigned int savageEmitEvent( savageContextPtr imesa, unsigned int flags )
-{
- unsigned int ret;
- LOCK_HARDWARE( imesa );
- ret = savageEmitEventLocked( imesa, flags );
- UNLOCK_HARDWARE( imesa );
- return ret;
-}
-
-
-void savageWaitEvent( savageContextPtr imesa, unsigned int count )
-{
- drm_savage_event_wait_t event;
- int ret;
- event.count = count;
- event.flags = 0;
- ret = drmCommandWriteRead( imesa->driFd, DRM_SAVAGE_BCI_EVENT_WAIT,
- &event, sizeof(event) );
- if (ret) {
- fprintf (stderr, "wait event returned %d\n", ret);
- exit (1);
- }
-}
-
-
-void savageFlushVertices( savageContextPtr imesa )
-{
- struct savage_vtxbuf_t *buffer = imesa->vtxBuf;
-
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "%s\n", __FUNCTION__);
-
- if (!buffer->total)
- return;
-
- if (buffer->used > buffer->flushed) {
- drm_savage_cmd_header_t *cmd;
- /* State must be updated "per primitive" because hardware
- * culling must be disabled for unfilled primitives, points
- * and lines. */
- savageEmitChangedState (imesa);
- cmd = savageAllocCmdBuf(imesa, 0);
- cmd->prim.cmd = buffer == &imesa->dmaVtxBuf ?
- SAVAGE_CMD_DMA_PRIM : SAVAGE_CMD_VB_PRIM;
- cmd->prim.prim = imesa->HwPrim;
- cmd->prim.skip = imesa->skip;
- cmd->prim.start = buffer->flushed / imesa->HwVertexSize;
- cmd->prim.count = buffer->used / imesa->HwVertexSize - cmd->prim.start;
- buffer->flushed = buffer->used;
- }
-}
-
-void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- if (!imesa->dmaVtxBuf.total)
- discard = GL_FALSE;
-
- /* complete indexed drawing commands */
- savageFlushElts(imesa);
-
- if (imesa->cmdBuf.write != imesa->cmdBuf.start || discard) {
- drm_savage_cmdbuf_t cmdbuf;
- drm_savage_cmd_header_t *start;
- int ret;
-
- /* If we lost the context we must restore the initial state (at
- * the start of the command buffer). */
- if (imesa->lostContext) {
- start = imesa->cmdBuf.base;
- imesa->lostContext = GL_FALSE;
- } else
- start = imesa->cmdBuf.start;
-
- if ((SAVAGE_DEBUG & DEBUG_DMA) && discard)
- fprintf (stderr, "Discarding DMA buffer, used=%u\n",
- imesa->dmaVtxBuf.used);
-
- cmdbuf.dma_idx = imesa->dmaVtxBuf.idx;
- cmdbuf.discard = discard;
- cmdbuf.vb_addr = imesa->clientVtxBuf.buf;
- cmdbuf.vb_size = imesa->clientVtxBuf.total*4;
- cmdbuf.vb_stride = imesa->HwVertexSize;
- cmdbuf.cmd_addr = start;
- cmdbuf.size = (imesa->cmdBuf.write - start);
- if (!imesa->inSwap && imesa->scissor.enabled) {
- drm_clip_rect_t *box = dPriv->pClipRects, *ibox;
- drm_clip_rect_t scissor;
- GLuint nbox = dPriv->numClipRects, nibox;
- /* transform and clip scissor to viewport */
- scissor.x1 = MAX2(imesa->scissor.x, 0) + dPriv->x;
- scissor.y1 = MAX2(dPriv->h - imesa->scissor.y - imesa->scissor.h,
- 0) + dPriv->y;
- scissor.x2 = MIN2(imesa->scissor.x + imesa->scissor.w,
- dPriv->w) + dPriv->x;
- scissor.y2 = MIN2(dPriv->h - imesa->scissor.y,
- dPriv->h) + dPriv->y;
- /* intersect cliprects with scissor */
- ibox = malloc(dPriv->numClipRects*sizeof(drm_clip_rect_t));
- if (!ibox) {
- fprintf(stderr, "Out of memory.\n");
- exit(1);
- }
- nibox = savageIntersectClipRects(ibox, box, nbox, &scissor);
- cmdbuf.nbox = nibox;
- cmdbuf.box_addr = ibox;
- } else {
- cmdbuf.nbox = dPriv->numClipRects;
- cmdbuf.box_addr = dPriv->pClipRects;
- }
-
- ret = drmCommandWrite( imesa->driFd, DRM_SAVAGE_BCI_CMDBUF,
- &cmdbuf, sizeof(cmdbuf) );
- if (ret) {
- fprintf (stderr, "cmdbuf ioctl returned %d\n", ret);
- exit(1);
- }
-
- if (cmdbuf.box_addr != dPriv->pClipRects) {
- free(cmdbuf.box_addr);
- }
-
- /* Save the current state at the start of the command buffer. That
- * state will only be emitted, if the context was lost since the
- * last command buffer. */
- imesa->cmdBuf.write = imesa->cmdBuf.base;
- savageEmitOldState(imesa);
- imesa->cmdBuf.start = imesa->cmdBuf.write;
- }
-
- if (discard) {
- assert (!savageHaveIndexedVerts(imesa));
- imesa->dmaVtxBuf.total = 0;
- imesa->dmaVtxBuf.used = 0;
- imesa->dmaVtxBuf.flushed = 0;
- }
- if (!savageHaveIndexedVerts(imesa)) {
- imesa->clientVtxBuf.used = 0;
- imesa->clientVtxBuf.flushed = 0;
- }
-}
-
-
-void savageFlushCmdBuf( savageContextPtr imesa, GLboolean discard )
-{
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "%s\n", __FUNCTION__);
- LOCK_HARDWARE(imesa);
- savageFlushCmdBufLocked (imesa, discard);
- UNLOCK_HARDWARE(imesa);
-}
-
-
-static void savageDDFlush( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "%s\n", __FUNCTION__);
- savageFlushVertices (imesa);
- savageFlushCmdBuf(imesa, GL_FALSE);
-}
-
-static void savageDDFinish( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "%s\n", __FUNCTION__);
- savageFlushVertices (imesa);
- savageFlushCmdBuf(imesa, GL_FALSE);
- WAIT_IDLE_EMPTY(imesa);
-}
-
-void savageDDInitIoctlFuncs( GLcontext *ctx )
-{
- ctx->Driver.Clear = savageDDClear;
- ctx->Driver.Flush = savageDDFlush;
- ctx->Driver.Finish = savageDDFinish;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.h
deleted file mode 100644
index c7ff0017f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savageioctl.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef SAVAGE_IOCTL_H
-#define SAVAGE_IOCTL_H
-
-#include "savagecontext.h"
-
-void savageFlushVertices( savageContextPtr mmesa );
-
-unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags );
-unsigned int savageEmitEvent( savageContextPtr imesa, unsigned int flags );
-void savageWaitEvent( savageContextPtr imesa, unsigned int event);
-
-void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard );
-void savageFlushCmdBuf( savageContextPtr imesa, GLboolean discard );
-
-void savageDDInitIoctlFuncs( GLcontext *ctx );
-
-void savageSwapBuffers( __DRIdrawablePrivate *dPriv );
-
-#define WAIT_IDLE_EMPTY(imesa) do { \
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) \
- fprintf (stderr, "WAIT_IDLE_EMPTY in %s\n", __FUNCTION__); \
- savageWaitEvent(imesa, \
- savageEmitEvent(imesa, SAVAGE_WAIT_2D|SAVAGE_WAIT_3D)); \
-} while (0)
-
-#define WAIT_IDLE_EMPTY_LOCKED(imesa) do { \
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) \
- fprintf (stderr, "WAIT_IDLE_EMPTY_LOCKED in %s\n", __FUNCTION__); \
- savageWaitEvent(imesa, savageEmitEventLocked( \
- imesa, SAVAGE_WAIT_2D|SAVAGE_WAIT_3D)); \
-} while (0)
-
-#define FLUSH_BATCH(imesa) do { \
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) \
- fprintf (stderr, "FLUSH_BATCH in %s\n", __FUNCTION__); \
- savageFlushVertices(imesa); \
- savageFlushCmdBuf(imesa, GL_FALSE); \
-} while (0)
-
-extern void savageGetDMABuffer( savageContextPtr imesa );
-
-static __inline
-void savageReleaseIndexedVerts( savageContextPtr imesa )
-{
- imesa->firstElt = -1;
-}
-
-static __inline
-GLboolean savageHaveIndexedVerts( savageContextPtr imesa )
-{
- return (imesa->firstElt != -1);
-}
-
-static __inline
-u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words )
-{
- struct savage_vtxbuf_t *buffer = imesa->vtxBuf;
- u_int32_t *head;
-
- if (buffer == &imesa->dmaVtxBuf) {
- if (!buffer->total) {
- LOCK_HARDWARE(imesa);
- savageGetDMABuffer(imesa);
- UNLOCK_HARDWARE(imesa);
- } else if (buffer->used + words > buffer->total) {
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "... flushing DMA buffer in %s\n",
- __FUNCTION__);
- savageReleaseIndexedVerts(imesa);
- savageFlushVertices(imesa);
- LOCK_HARDWARE(imesa);
- savageFlushCmdBufLocked(imesa, GL_TRUE); /* discard DMA buffer */
- savageGetDMABuffer(imesa);
- UNLOCK_HARDWARE(imesa);
- }
- } else if (buffer->used + words > buffer->total) {
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "... flushing client vertex buffer in %s\n",
- __FUNCTION__);
- savageReleaseIndexedVerts(imesa);
- savageFlushVertices(imesa);
- LOCK_HARDWARE(imesa);
- savageFlushCmdBufLocked(imesa, GL_FALSE); /* free clientVtxBuf */
- UNLOCK_HARDWARE(imesa);
- }
-
- head = &buffer->buf[buffer->used];
-
- buffer->used += words;
- return head;
-}
-
-static __inline
-u_int32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n )
-{
- u_int32_t *ret;
- savageFlushVertices(imesa);
- ret = savageAllocVtxBuf(imesa, n*imesa->HwVertexSize);
- imesa->firstElt = imesa->vtxBuf->flushed / imesa->HwVertexSize;
- imesa->vtxBuf->flushed = imesa->vtxBuf->used;
- return ret;
-}
-
-/* Flush Elts:
- * - Complete the drawing command with the correct number of indices.
- * - Actually allocate entries for the indices in the command buffer.
- * (This allocation must succeed without wrapping the cmd buffer!)
- */
-static __inline
-void savageFlushElts( savageContextPtr imesa )
-{
- if (imesa->elts.cmd) {
- GLuint qwords = (imesa->elts.n + 3) >> 2;
- assert(imesa->cmdBuf.write - imesa->cmdBuf.base + qwords
- <= imesa->cmdBuf.size);
- imesa->cmdBuf.write += qwords;
-
- imesa->elts.cmd->idx.count = imesa->elts.n;
- imesa->elts.cmd = NULL;
- }
-}
-
-/* Allocate a command buffer entry with <bytes> bytes of arguments:
- * - implies savageFlushElts
- */
-static __inline
-drm_savage_cmd_header_t *savageAllocCmdBuf( savageContextPtr imesa, GLuint bytes )
-{
- drm_savage_cmd_header_t *ret;
- GLuint qwords = ((bytes + 7) >> 3) + 1; /* round up */
- assert (qwords < imesa->cmdBuf.size);
-
- savageFlushElts(imesa);
-
- if (imesa->cmdBuf.write - imesa->cmdBuf.base + qwords > imesa->cmdBuf.size)
- savageFlushCmdBuf(imesa, GL_FALSE);
-
- ret = (drm_savage_cmd_header_t *)imesa->cmdBuf.write;
- imesa->cmdBuf.write += qwords;
- return ret;
-}
-
-/* Allocate Elts:
- * - if it doesn't fit, flush the cmd buffer first
- * - allocates the drawing command on the cmd buffer if there is no
- * incomplete indexed drawing command yet
- * - increments the number of elts. Final allocation is done in savageFlushElts
- */
-static __inline
-u_int16_t *savageAllocElts( savageContextPtr imesa, GLuint n )
-{
- u_int16_t *ret;
- GLuint qwords;
- assert (savageHaveIndexedVerts(imesa));
-
- if (imesa->elts.cmd)
- qwords = (imesa->elts.n + n + 3) >> 2;
- else
- qwords = ((n + 3) >> 2) + 1;
- if (imesa->cmdBuf.write - imesa->cmdBuf.base + qwords > imesa->cmdBuf.size)
- savageFlushCmdBuf(imesa, GL_FALSE); /* implies savageFlushElts */
-
- if (!imesa->elts.cmd) {
- savageFlushVertices(imesa);
- imesa->elts.cmd = savageAllocCmdBuf(imesa, 0);
- imesa->elts.cmd->idx.cmd = (imesa->vtxBuf == &imesa->dmaVtxBuf) ?
- SAVAGE_CMD_DMA_IDX : SAVAGE_CMD_VB_IDX;
- imesa->elts.cmd->idx.prim = imesa->HwPrim;
- imesa->elts.cmd->idx.skip = imesa->skip;
- imesa->elts.n = 0;
- }
-
- ret = (u_int16_t *)(imesa->elts.cmd+1) + imesa->elts.n;
- imesa->elts.n += n;
- return ret;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagerender.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagerender.c
deleted file mode 100644
index 514434c42..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagerender.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * Copyright 2005 Felix Kuehling
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and 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 FELIX KUEHLING BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Simulate missing primitives with indexed vertices.
- */
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-
-#include "tnl/t_context.h"
-
-#include "savagecontext.h"
-#include "savagetris.h"
-#include "savagestate.h"
-#include "savageioctl.h"
-
-/*
- * Standard render tab for Savage4 and smooth shading on Savage3D
- */
-#define HAVE_POINTS 0
-#define HAVE_LINES 0
-#define HAVE_LINE_STRIPS 0
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_POLYGONS 0
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-
-#define HAVE_ELTS 1
-
-#define LOCAL_VARS savageContextPtr imesa = SAVAGE_CONTEXT(ctx)
-#define INIT( prim ) do { \
- if (0) fprintf(stderr, "%s\n", __FUNCTION__); \
- savageFlushVertices(imesa); \
- switch (prim) { \
- case GL_TRIANGLES: imesa->HwPrim = SAVAGE_PRIM_TRILIST; break; \
- case GL_TRIANGLE_STRIP: imesa->HwPrim = SAVAGE_PRIM_TRISTRIP; break; \
- case GL_TRIANGLE_FAN: imesa->HwPrim = SAVAGE_PRIM_TRIFAN; break; \
- } \
-} while (0)
-#define FLUSH() savageFlushElts(imesa), savageFlushVertices(imesa)
-
-#define GET_CURRENT_VB_MAX_VERTS() \
- ((imesa->bufferSize/4 - imesa->vtxBuf->used) / imesa->HwVertexSize)
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- (imesa->bufferSize/4 / imesa->HwVertexSize)
-
-#define ALLOC_VERTS( nr ) \
- savageAllocVtxBuf( imesa, (nr) * imesa->HwVertexSize )
-#define EMIT_VERTS( ctx, j, nr, buf ) \
- _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf )
-
-#define ELTS_VARS( buf ) GLushort *dest = buf, firstElt = imesa->firstElt
-#define ELT_INIT( prim ) INIT(prim)
-
-/* (size - used - 1 qword for drawing command) * 4 elts per qword */
-#define GET_CURRENT_VB_MAX_ELTS() \
- ((imesa->cmdBuf.size - (imesa->cmdBuf.write - imesa->cmdBuf.base) - 1)*4)
-/* (size - space for initial state - 1 qword for drawing command) * 4 elts
- * imesa is not defined in validate_render :( */
-#define GET_SUBSEQUENT_VB_MAX_ELTS() \
- ((SAVAGE_CONTEXT(ctx)->cmdBuf.size - \
- (SAVAGE_CONTEXT(ctx)->cmdBuf.start - \
- SAVAGE_CONTEXT(ctx)->cmdBuf.base) - 1)*4)
-
-#define ALLOC_ELTS(nr) savageAllocElts(imesa, nr)
-#define EMIT_ELT(offset, x) do { \
- (dest)[offset] = (GLushort) ((x)+firstElt); \
-} while (0)
-#define EMIT_TWO_ELTS(offset, x, y) do { \
- *(GLuint *)(dest + offset) = (((y)+firstElt) << 16) | \
- ((x)+firstElt); \
-} while (0)
-
-#define INCR_ELTS( nr ) dest += nr
-#define ELTPTR dest
-#define RELEASE_ELT_VERTS() \
- savageReleaseIndexedVerts(imesa)
-
-#define EMIT_INDEXED_VERTS( ctx, start, count ) do { \
- GLuint *buf = savageAllocIndexedVerts(imesa, count-start); \
- EMIT_VERTS(ctx, start, count-start, buf); \
-} while (0)
-
-#define TAG(x) savage_##x
-#include "tnl_dd/t_dd_dmatmp.h"
-
-/*
- * On Savage3D triangle fans and strips are broken with flat
- * shading. With triangles it wants the color for flat shading in the
- * first vertex! So we make another template instance which uses
- * triangles only (with reordered vertices: SAVAGE_PRIM_TRILIST_201).
- * The reordering is done by the DRM.
- */
-#undef HAVE_TRI_STRIPS
-#undef HAVE_TRI_FANS
-#define HAVE_TRI_STRIPS 0
-#define HAVE_TRI_FANS 0
-
-#undef INIT
-#define INIT( prim ) do { \
- if (0) fprintf(stderr, "%s\n", __FUNCTION__); \
- savageFlushVertices(imesa); \
- imesa->HwPrim = SAVAGE_PRIM_TRILIST_201; \
-} while(0)
-
-#undef TAG
-#define TAG(x) savage_flat_##x##_s3d
-#include "tnl_dd/t_dd_dmatmp.h"
-
-
-/**********************************************************************/
-/* Render pipeline stage */
-/**********************************************************************/
-
-static GLboolean savage_run_render( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- tnl_render_func *tab, *tab_elts;
- GLboolean valid;
- GLuint i;
-
- if (savageHaveIndexedVerts(imesa))
- savageReleaseIndexedVerts(imesa);
-
- if (imesa->savageScreen->chipset < S3_SAVAGE4 &&
- (ctx->_TriangleCaps & DD_FLATSHADE)) {
- tab = savage_flat_render_tab_verts_s3d;
- tab_elts = savage_flat_render_tab_elts_s3d;
- valid = savage_flat_validate_render_s3d( ctx, VB );
- } else {
- tab = savage_render_tab_verts;
- tab_elts = savage_render_tab_elts;
- valid = savage_validate_render( ctx, VB );
- }
-
- /* Don't handle clipping or vertex manipulations.
- */
- if (imesa->RenderIndex != 0 || !valid) {
- return GL_TRUE;
- }
-
- tnl->Driver.Render.Start( ctx );
- /* Check RenderIndex again. The ptexHack is detected late in RenderStart.
- * Also check for ptex fallbacks detected late.
- */
- if (imesa->RenderIndex != 0 || imesa->Fallback != 0) {
- return GL_TRUE;
- }
-
- /* setup for hardware culling */
- imesa->raster_primitive = GL_TRIANGLES;
- imesa->new_state |= SAVAGE_NEW_CULL;
-
- /* update and emit state */
- savageDDUpdateHwState(ctx);
- savageEmitChangedState(imesa);
-
- if (VB->Elts) {
- tab = tab_elts;
- if (!savageHaveIndexedVerts(imesa)) {
- if (VB->Count > GET_SUBSEQUENT_VB_MAX_VERTS())
- return GL_TRUE;
- EMIT_INDEXED_VERTS(ctx, 0, VB->Count);
- }
- }
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++)
- {
- GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
-
- if (length)
- tab[prim & PRIM_MODE_MASK]( ctx, start, start+length, prim);
- }
-
- tnl->Driver.Render.Finish( ctx );
-
- return GL_FALSE; /* finished the pipe */
-}
-
-struct tnl_pipeline_stage _savage_render_stage =
-{
- "savage render",
- NULL,
- NULL,
- NULL,
- NULL,
- savage_run_render /* run */
-};
-
-
-/**********************************************************************/
-/* Pipeline stage for texture coordinate normalization */
-/**********************************************************************/
-struct texnorm_stage_data {
- GLboolean active;
- GLvector4f texcoord[MAX_TEXTURE_UNITS];
-};
-
-#define TEXNORM_STAGE_DATA(stage) ((struct texnorm_stage_data *)stage->privatePtr)
-
-
-static GLboolean run_texnorm_stage( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- struct texnorm_stage_data *store = TEXNORM_STAGE_DATA(stage);
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- if (imesa->Fallback || !store->active)
- return GL_TRUE;
-
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
- const GLbitfield reallyEnabled = ctx->Texture.Unit[i]._ReallyEnabled;
- if (reallyEnabled) {
- const struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
- const GLboolean normalizeS = (texObj->WrapS == GL_REPEAT);
- const GLboolean normalizeT = (reallyEnabled & TEXTURE_2D_BIT) &&
- (texObj->WrapT == GL_REPEAT);
- const GLfloat *in = (GLfloat *)VB->TexCoordPtr[i]->data;
- const GLint instride = VB->TexCoordPtr[i]->stride;
- GLfloat (*out)[4] = store->texcoord[i].data;
- GLint j;
-
- if (!ctx->Texture.Unit[i]._ReallyEnabled ||
- VB->TexCoordPtr[i]->size == 4)
- /* Never try to normalize homogenous tex coords! */
- continue;
-
- if (normalizeS && normalizeT) {
- /* take first texcoords as rough estimate of mean value */
- GLfloat correctionS = -floor(in[0]+0.5);
- GLfloat correctionT = -floor(in[1]+0.5);
- for (j = 0; j < VB->Count; ++j) {
- out[j][0] = in[0] + correctionS;
- out[j][1] = in[1] + correctionT;
- in = (GLfloat *)((GLubyte *)in + instride);
- }
- } else if (normalizeS) {
- /* take first texcoords as rough estimate of mean value */
- GLfloat correctionS = -floor(in[0]+0.5);
- if (reallyEnabled & TEXTURE_2D_BIT) {
- for (j = 0; j < VB->Count; ++j) {
- out[j][0] = in[0] + correctionS;
- out[j][1] = in[1];
- in = (GLfloat *)((GLubyte *)in + instride);
- }
- } else {
- for (j = 0; j < VB->Count; ++j) {
- out[j][0] = in[0] + correctionS;
- in = (GLfloat *)((GLubyte *)in + instride);
- }
- }
- } else if (normalizeT) {
- /* take first texcoords as rough estimate of mean value */
- GLfloat correctionT = -floor(in[1]+0.5);
- for (j = 0; j < VB->Count; ++j) {
- out[j][0] = in[0];
- out[j][1] = in[1] + correctionT;
- in = (GLfloat *)((GLubyte *)in + instride);
- }
- }
-
- if (normalizeS || normalizeT)
- VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = &store->texcoord[i];
- }
- }
-
- return GL_TRUE;
-}
-
-/* Called the first time stage->run() is invoked.
- */
-static GLboolean alloc_texnorm_data( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct texnorm_stage_data *store;
- GLuint i;
-
- stage->privatePtr = CALLOC(sizeof(*store));
- store = TEXNORM_STAGE_DATA(stage);
- if (!store)
- return GL_FALSE;
-
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- _mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
-
- return GL_TRUE;
-}
-
-static void validate_texnorm( GLcontext *ctx,
- struct tnl_pipeline_stage *stage )
-{
- struct texnorm_stage_data *store = TEXNORM_STAGE_DATA(stage);
- GLuint flags = 0;
-
- if (((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
- (ctx->Texture.Unit[0]._Current->WrapS == GL_REPEAT)) ||
- ((ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) &&
- (ctx->Texture.Unit[0]._Current->WrapT == GL_REPEAT)))
- flags |= VERT_BIT_TEX0;
-
- if (((ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
- (ctx->Texture.Unit[1]._Current->WrapS == GL_REPEAT)) ||
- ((ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT) &&
- (ctx->Texture.Unit[1]._Current->WrapT == GL_REPEAT)))
- flags |= VERT_BIT_TEX1;
-
- store->active = (flags != 0);
-}
-
-static void free_texnorm_data( struct tnl_pipeline_stage *stage )
-{
- struct texnorm_stage_data *store = TEXNORM_STAGE_DATA(stage);
- GLuint i;
-
- if (store) {
- for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++)
- if (store->texcoord[i].data)
- _mesa_vector4f_free( &store->texcoord[i] );
- FREE( store );
- stage->privatePtr = 0;
- }
-}
-
-struct tnl_pipeline_stage _savage_texnorm_stage =
-{
- "savage texture coordinate normalization stage", /* name */
- NULL, /* private data */
- alloc_texnorm_data, /* run -- initially set to init */
- free_texnorm_data, /* destructor */
- validate_texnorm,
- run_texnorm_stage
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.c
deleted file mode 100644
index a261299cc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "mtypes.h"
-#include "savagedd.h"
-#include "savagespan.h"
-#include "savageioctl.h"
-#include "savage_bci.h"
-#include "savage_3d_reg.h"
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
- savageScreenPrivate *savageScreen = imesa->savageScreen; \
- GLuint cpp = savageScreen->cpp; \
- GLuint pitch = imesa->aperturePitch; \
- GLuint height = dPriv->h; \
- GLubyte *buf = map + \
- dPriv->x * cpp + \
- dPriv->y * pitch; \
- char *read_buf = buf; \
- GLuint p; \
- (void) p
-
-#define LOCAL_DEPTH_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
- savageScreenPrivate *savageScreen = imesa->savageScreen; \
- GLuint zpp = savageScreen->zpp; \
- GLuint pitch = imesa->aperturePitch; \
- GLuint height = dPriv->h; \
- GLubyte *buf = imesa->apertureBase[TARGET_DEPTH] + \
- dPriv->x * zpp + \
- dPriv->y * pitch
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-#define HW_WRITE_LOCK() \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- GLubyte *map = imesa->drawMap;
-
-#define HW_READ_LOCK() \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- GLubyte *map = imesa->readMap;
-
-
-/* 16 bit, 565 rgb color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) savage##x##_565
-#define TAG2(x,y) savage##x##_565##y
-#include "spantmp2.h"
-
-
-/* 32 bit, 8888 ARGB color spanline and pixel functions
- */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) savage##x##_8888
-#define TAG2(x,y) savage##x##_8888##y
-#include "spantmp2.h"
-
-
-#undef HW_WRITE_LOCK
-#define HW_WRITE_LOCK()
-#undef HW_READ_LOCK
-#define HW_READ_LOCK()
-
-
-
-/* 16 bit integer depthbuffer functions
- * Depth range is reversed. See also savageCalcViewport.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = 0xFFFF - d
-
-#define READ_DEPTH( d, _x, _y ) \
- d = 0xFFFF - *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch)
-
-#define TAG(x) savage##x##_16
-#include "depthtmp.h"
-
-
-
-
-/* 16 bit float depthbuffer functions
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = \
- savageEncodeFloat16( 1.0 - (GLfloat)d/65535.0 )
-
-#define READ_DEPTH( d, _x, _y ) \
- d = 65535 - \
- savageDecodeFloat16( *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) ) * \
- 65535.0
-
-#define TAG(x) savage##x##_16f
-#include "depthtmp.h"
-
-
-
-
-/* 8-bit stencil /24-bit integer depth depthbuffer functions.
- * Depth range is reversed. See also savageCalcViewport.
- */
-#define WRITE_DEPTH( _x, _y, d ) do { \
- GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \
- tmp &= 0xFF000000; \
- tmp |= 0x00FFFFFF - d; \
- *(GLuint *)(buf + (_x<<2) + _y*pitch) = tmp; \
-} while(0)
-
-#define READ_DEPTH( d, _x, _y ) \
- d = 0x00FFFFFF - (*(GLuint *)(buf + ((_x)<<2) + (_y)*pitch) & 0x00FFFFFF)
-
-#define TAG(x) savage##x##_8_24
-#include "depthtmp.h"
-
-
-
-
-/* 24 bit float depthbuffer functions
- */
-#define WRITE_DEPTH( _x, _y, d ) do { \
- GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \
- tmp &= 0xFF000000; \
- tmp |= savageEncodeFloat24( 1.0 - (GLfloat)d/16777215.0 ); \
- *(GLuint *)(buf + (_x<<2) + _y*pitch) = tmp; \
-} while(0)
-
-#define READ_DEPTH( d, _x, _y ) \
- d = 16777215 - savageDecodeFloat24( \
- *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch) & 0x00FFFFFF) \
- * 16777215.0
-
-#define TAG(x) savage##x##_8_24f
-#include "depthtmp.h"
-
-
-#define WRITE_STENCIL( _x, _y, d ) do { \
- GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \
- tmp &= 0x00FFFFFF; \
- tmp |= (((GLuint)d)<<24) & 0xFF000000; \
- *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch) = tmp; \
-} while(0)
-
-#define READ_STENCIL( d, _x, _y ) \
- d = (GLstencil)((*(GLuint *)(buf + ((_x)<<2) + (_y)*pitch) & 0xFF000000) >> 24)
-
-#define TAG(x) savage##x##_8_24
-#include "stenciltmp.h"
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void savageDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer,
- GLuint bufferBit)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- char *map;
-
- assert((bufferBit == BUFFER_BIT_FRONT_LEFT) || (bufferBit == BUFFER_BIT_BACK_LEFT));
-
- map = (bufferBit == BUFFER_BIT_FRONT_LEFT)
- ? imesa->apertureBase[TARGET_FRONT]
- : imesa->apertureBase[TARGET_BACK];
-
- imesa->drawMap = map;
- imesa->readMap = map;
-
- assert( (buffer == imesa->driDrawable->driverPrivate)
- || (buffer == imesa->driReadable->driverPrivate) );
-
- imesa->mesa_drawable = (buffer == imesa->driDrawable->driverPrivate)
- ? imesa->driDrawable : imesa->driReadable;
-}
-
-/*
- * Wrappers around _swrast_Copy/Draw/ReadPixels that make sure all
- * primitives are flushed and the hardware is idle before accessing
- * the frame buffer.
- */
-static void
-savageCopyPixels( GLcontext *ctx,
- GLint srcx, GLint srcy, GLsizei width, GLsizei height,
- GLint destx, GLint desty,
- GLenum type )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
- _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type);
-}
-static void
-savageDrawPixels( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- const GLvoid *pixels )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, packing, pixels);
-}
-static void
-savageReadPixels( GLcontext *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *pixels )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
- _swrast_ReadPixels(ctx, x, y, width, height, format, type, packing, pixels);
-}
-
-/*
- * Make sure the hardware is idle when span-rendering.
- */
-static void savageSpanRenderStart( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
-}
-
-
-void savageDDInitSpanFuncs( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = savageDDSetBuffer;
- swdd->SpanRenderStart = savageSpanRenderStart;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = savageCopyPixels;
- ctx->Driver.DrawPixels = savageDrawPixels;
- ctx->Driver.ReadPixels = savageReadPixels;
-}
-
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-savageSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis,
- GLboolean float_depth)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- savageInitPointers_565(&drb->Base);
- }
- else {
- savageInitPointers_8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- if (float_depth) {
- drb->Base.GetRow = savageReadDepthSpan_16f;
- drb->Base.GetValues = savageReadDepthPixels_16f;
- drb->Base.PutRow = savageWriteDepthSpan_16f;
- drb->Base.PutMonoRow = savageWriteMonoDepthSpan_16f;
- drb->Base.PutValues = savageWriteDepthPixels_16f;
- }
- else {
- drb->Base.GetRow = savageReadDepthSpan_16;
- drb->Base.GetValues = savageReadDepthPixels_16;
- drb->Base.PutRow = savageWriteDepthSpan_16;
- drb->Base.PutMonoRow = savageWriteMonoDepthSpan_16;
- drb->Base.PutValues = savageWriteDepthPixels_16;
- }
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- if (float_depth) {
- drb->Base.GetRow = savageReadDepthSpan_8_24f;
- drb->Base.GetValues = savageReadDepthPixels_8_24f;
- drb->Base.PutRow = savageWriteDepthSpan_8_24f;
- drb->Base.PutMonoRow = savageWriteMonoDepthSpan_8_24f;
- drb->Base.PutValues = savageWriteDepthPixels_8_24f;
- }
- else {
- drb->Base.GetRow = savageReadDepthSpan_8_24;
- drb->Base.GetValues = savageReadDepthPixels_8_24;
- drb->Base.PutRow = savageWriteDepthSpan_8_24;
- drb->Base.PutMonoRow = savageWriteMonoDepthSpan_8_24;
- drb->Base.PutValues = savageWriteDepthPixels_8_24;
- }
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = savageReadStencilSpan_8_24;
- drb->Base.GetValues = savageReadStencilPixels_8_24;
- drb->Base.PutRow = savageWriteStencilSpan_8_24;
- drb->Base.PutMonoRow = savageWriteMonoStencilSpan_8_24;
- drb->Base.PutValues = savageWriteStencilPixels_8_24;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.h
deleted file mode 100644
index f6a312e82..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagespan.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _SAVAGE_SPAN_H
-#define _SAVAGE_SPAN_H
-
-#include "drirenderbuffer.h"
-
-
-extern void savageDDInitSpanFuncs( GLcontext *ctx );
-
-extern void
-savageSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis,
- GLboolean float_depth);
-
-
-/*
- * Savage 16-bit float depth format with zExpOffset=16:
- * 4 bit unsigned exponent, 12 bit mantissa
- *
- * The meaning of the mantissa is different from IEEE floatint point
- * formats. The same number can't be encoded with different exponents.
- * So no bits are wasted.
- *
- * exponent | range encoded by mantissa | accuracy or mantissa
- * ---------+---------------------------+---------------------
- * 15 | 2^-1 .. 1 | 2^-13
- * 14 | 2^-2 .. 2^-1 | 2^-14
- * 13 | 2^-3 .. 2^-2 | 2^-15
- * ... | ... |
- * 2 | 2^-14 .. 2^-13 | 2^-27
- * 1 | 2^-15 .. 2^-14 | 2^-27
- * 0 | 2^-16 .. 2^-15 | 2^-28
- *
- * Note that there is no encoding for numbers < 2^-16.
- */
-static __inline GLuint savageEncodeFloat16( GLdouble x )
-{
- GLint r = (GLint)(x * 0x10000000);
- GLint exp = 0;
- if (r < 0x1000)
- return 0;
- while (r - 0x1000 > 0x0fff) {
- r >>= 1;
- exp++;
- }
- return exp > 0xf ? 0xffff : (r - 0x1000) | (exp << 12);
-}
-static __inline GLdouble savageDecodeFloat16( GLuint x )
-{
- static const GLdouble pow2[16] = {
- 1.0/(1<<28), 1.0/(1<<27), 1.0/(1<<26), 1.0/(1<<25),
- 1.0/(1<<24), 1.0/(1<<23), 1.0/(1<<22), 1.0/(1<<21),
- 1.0/(1<<20), 1.0/(1<<19), 1.0/(1<<18), 1.0/(1<<17),
- 1.0/(1<<16), 1.0/(1<<15), 1.0/(1<<14), 1.0/(1<<13)
- };
- static const GLdouble bias[16] = {
- 1.0/(1<<16), 1.0/(1<<15), 1.0/(1<<14), 1.0/(1<<13),
- 1.0/(1<<12), 1.0/(1<<11), 1.0/(1<<10), 1.0/(1<< 9),
- 1.0/(1<< 8), 1.0/(1<< 7), 1.0/(1<< 6), 1.0/(1<< 5),
- 1.0/(1<< 4), 1.0/(1<< 3), 1.0/(1<< 2), 1.0/(1<< 1)
- };
- GLuint mant = x & 0x0fff;
- GLuint exp = (x >> 12) & 0xf;
- return bias[exp] + pow2[exp]*mant;
-}
-
-/*
- * Savage 24-bit float depth format with zExpOffset=32:
- * 5 bit unsigned exponent, 19 bit mantissa
- *
- * Details analogous to the 16-bit format.
- */
-static __inline GLuint savageEncodeFloat24( GLdouble x )
-{
- int64_t r = (int64_t)(x * ((int64_t)1 << (19+32)));
- GLint exp = 0;
- if (r < 0x80000)
- return 0;
- while (r - 0x80000 > 0x7ffff) {
- r >>= 1;
- exp++;
- }
- return exp > 0x1f ? 0xffffff : (r - 0x80000) | (exp << 19);
-}
-#define _1 (int64_t)1
-static __inline GLdouble savageDecodeFloat24( GLuint x )
-{
- static const GLdouble pow2[32] = {
- 1.0/(_1<<51), 1.0/(_1<<50), 1.0/(_1<<49), 1.0/(_1<<48),
- 1.0/(_1<<47), 1.0/(_1<<46), 1.0/(_1<<45), 1.0/(_1<<44),
- 1.0/(_1<<43), 1.0/(_1<<42), 1.0/(_1<<41), 1.0/(_1<<40),
- 1.0/(_1<<39), 1.0/(_1<<38), 1.0/(_1<<37), 1.0/(_1<<36),
- 1.0/(_1<<35), 1.0/(_1<<34), 1.0/(_1<<33), 1.0/(_1<<32),
- 1.0/(_1<<31), 1.0/(_1<<30), 1.0/(_1<<29), 1.0/(_1<<28),
- 1.0/(_1<<27), 1.0/(_1<<26), 1.0/(_1<<25), 1.0/(_1<<24),
- 1.0/(_1<<23), 1.0/(_1<<22), 1.0/(_1<<21), 1.0/(_1<<20)
- };
- static const GLdouble bias[32] = {
- 1.0/(_1<<32), 1.0/(_1<<31), 1.0/(_1<<30), 1.0/(_1<<29),
- 1.0/(_1<<28), 1.0/(_1<<27), 1.0/(_1<<26), 1.0/(_1<<25),
- 1.0/(_1<<24), 1.0/(_1<<23), 1.0/(_1<<22), 1.0/(_1<<21),
- 1.0/(_1<<20), 1.0/(_1<<19), 1.0/(_1<<18), 1.0/(_1<<17),
- 1.0/(_1<<16), 1.0/(_1<<15), 1.0/(_1<<14), 1.0/(_1<<13),
- 1.0/(_1<<12), 1.0/(_1<<11), 1.0/(_1<<10), 1.0/(_1<< 9),
- 1.0/(_1<< 8), 1.0/(_1<< 7), 1.0/(_1<< 6), 1.0/(_1<< 5),
- 1.0/(_1<< 4), 1.0/(_1<< 3), 1.0/(_1<< 2), 1.0/(_1<< 1)
- };
- GLuint mant = x & 0x7ffff;
- GLuint exp = (x >> 19) & 0x1f;
- return bias[exp] + pow2[exp]*mant;
-}
-#undef _1
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.c
deleted file mode 100644
index 996d5b917..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.c
+++ /dev/null
@@ -1,1765 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <stdio.h>
-
-#include "mtypes.h"
-#include "buffers.h"
-#include "enums.h"
-#include "macros.h"
-#include "dd.h"
-
-#include "mm.h"
-#include "savagedd.h"
-#include "savagecontext.h"
-
-#include "savagestate.h"
-#include "savagetex.h"
-#include "savagetris.h"
-#include "savageioctl.h"
-#include "savage_bci.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "xmlpool.h"
-
-/* Savage4, ProSavage[DDR], SuperSavage watermarks */
-#define S4_ZRLO 24
-#define S4_ZRHI 24
-#define S4_ZWLO 0
-#define S4_ZWHI 0
-
-#define S4_DRLO 0
-#define S4_DRHI 0
-#define S4_DWLO 0
-#define S4_DWHI 0
-
-#define S4_TR 15
-
-/* Savage3D/MX/IX watermarks */
-#define S3D_ZRLO 8
-#define S3D_ZRHI 24
-#define S3D_ZWLO 0
-#define S3D_ZWHI 24
-
-#define S3D_DRLO 0
-#define S3D_DRHI 0
-#define S3D_DWLO 0
-#define S3D_DWHI 0
-
-#define S3D_TR 15
-
-static void savageBlendFunc_s4(GLcontext *);
-static void savageBlendFunc_s3d(GLcontext *);
-
-static __inline__ GLuint savagePackColor(GLuint format,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a)
-{
- switch (format) {
- case DV_PF_8888:
- return SAVAGEPACKCOLOR8888(r,g,b,a);
- case DV_PF_565:
- return SAVAGEPACKCOLOR565(r,g,b);
- default:
-
- return 0;
- }
-}
-
-
-static void savageDDAlphaFunc_s4(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- savageBlendFunc_s4(ctx);
-}
-static void savageDDAlphaFunc_s3d(GLcontext *ctx, GLenum func, GLfloat ref)
-{
- savageBlendFunc_s3d(ctx);
-}
-
-static void savageDDBlendEquationSeparate(GLcontext *ctx,
- GLenum modeRGB, GLenum modeA)
-{
- assert( modeRGB == modeA );
-
- /* BlendEquation sets ColorLogicOpEnabled in an unexpected
- * manner.
- */
- FALLBACK( ctx, SAVAGE_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
-
- /* Can only do blend addition, not min, max, subtract, etc. */
- FALLBACK( ctx, SAVAGE_FALLBACK_BLEND_EQ,
- modeRGB != GL_FUNC_ADD);
-}
-
-
-static void savageBlendFunc_s4(GLcontext *ctx)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui;
- u_int32_t drawCtrl0 = imesa->regs.s4.drawCtrl0.ui;
- u_int32_t drawCtrl1 = imesa->regs.s4.drawCtrl1.ui;
-
- /* set up draw control register (including blending, alpha
- * test, and shading model)
- */
-
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_FALSE;
-
- /*
- * blend modes
- */
- if(ctx->Color.BlendEnabled){
- switch (ctx->Color.BlendDstRGB)
- {
- case GL_ZERO:
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_Zero;
- break;
-
- case GL_ONE:
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_One;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_SRC_COLOR:
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_SrcClr;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_SRC_COLOR:
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_1SrcClr;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_SRC_ALPHA:
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_SrcAlpha;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_SRC_ALPHA:
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_1SrcAlpha;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_One;
- }
- else
- {
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode= DAM_DstAlpha;
- }
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_Zero;
- }
- else
- {
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode=DAM_1DstAlpha;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites= GL_TRUE;
- }
- break;
- }
-
- switch (ctx->Color.BlendSrcRGB)
- {
- case GL_ZERO:
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_Zero;
- break;
-
- case GL_ONE:
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_One;
- break;
-
- case GL_DST_COLOR:
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_DstClr;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_DST_COLOR:
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_1DstClr;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_SRC_ALPHA:
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_SrcAlpha;
- break;
-
- case GL_ONE_MINUS_SRC_ALPHA:
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_1SrcAlpha;
- break;
-
- case GL_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_One;
- }
- else
- {
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode= SAM_DstAlpha;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites= GL_TRUE;
- }
- break;
-
- case GL_ONE_MINUS_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_Zero;
- }
- else
- {
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode=SAM_1DstAlpha;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites= GL_TRUE;
- }
- break;
- }
- }
- else
- {
- imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_Zero;
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_One;
- }
-
- /* alpha test*/
-
- if(ctx->Color.AlphaEnabled)
- {
- ACmpFunc a;
- GLubyte alphaRef;
-
- CLAMPED_FLOAT_TO_UBYTE(alphaRef,ctx->Color.AlphaRef);
-
- switch(ctx->Color.AlphaFunc) {
- case GL_NEVER: a = CF_Never; break;
- case GL_ALWAYS: a = CF_Always; break;
- case GL_LESS: a = CF_Less; break;
- case GL_LEQUAL: a = CF_LessEqual; break;
- case GL_EQUAL: a = CF_Equal; break;
- case GL_GREATER: a = CF_Greater; break;
- case GL_GEQUAL: a = CF_GreaterEqual; break;
- case GL_NOTEQUAL: a = CF_NotEqual; break;
- default:return;
- }
-
- imesa->regs.s4.drawCtrl1.ni.alphaTestEn = GL_TRUE;
- imesa->regs.s4.drawCtrl1.ni.alphaTestCmpFunc = a;
- imesa->regs.s4.drawCtrl0.ni.alphaRefVal = alphaRef;
- }
- else
- {
- imesa->regs.s4.drawCtrl1.ni.alphaTestEn = GL_FALSE;
- }
-
- /* Set/Reset Z-after-alpha*/
-
- imesa->regs.s4.drawLocalCtrl.ni.wrZafterAlphaTst =
- imesa->regs.s4.drawCtrl1.ni.alphaTestEn;
- /*imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn =
- ~drawLocalCtrl.ni.wrZafterAlphaTst;*/
-
- if (drawLocalCtrl != imesa->regs.s4.drawLocalCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- if (drawCtrl0 != imesa->regs.s4.drawCtrl0.ui ||
- drawCtrl1 != imesa->regs.s4.drawCtrl1.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-static void savageBlendFunc_s3d(GLcontext *ctx)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui;
- u_int32_t zBufCtrl = imesa->regs.s3d.zBufCtrl.ui;
-
- /* set up draw control register (including blending, alpha
- * test, dithering, and shading model)
- */
-
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = 0;
-
- /*
- * blend modes
- */
- if(ctx->Color.BlendEnabled){
- switch (ctx->Color.BlendDstRGB)
- {
- case GL_ZERO:
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_Zero;
- break;
-
- case GL_ONE:
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_One;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_SRC_COLOR:
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_SrcClr;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_SRC_COLOR:
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_1SrcClr;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_SRC_ALPHA:
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_SrcAlpha;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_SRC_ALPHA:
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_1SrcAlpha;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_One;
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_DstAlpha;
- }
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_Zero;
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_1DstAlpha;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- }
- break;
- }
-
- switch (ctx->Color.BlendSrcRGB)
- {
- case GL_ZERO:
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_Zero;
- break;
-
- case GL_ONE:
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_One;
- break;
-
- case GL_DST_COLOR:
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_DstClr;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_ONE_MINUS_DST_COLOR:
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_1DstClr;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- break;
-
- case GL_SRC_ALPHA:
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_SrcAlpha;
- break;
-
- case GL_ONE_MINUS_SRC_ALPHA:
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_1SrcAlpha;
- break;
-
- case GL_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_One;
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_DstAlpha;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- }
- break;
-
- case GL_ONE_MINUS_DST_ALPHA:
- if (imesa->glCtx->Visual.alphaBits == 0)
- {
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_Zero;
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_1DstAlpha;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- }
- break;
- }
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_Zero;
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_One;
- }
-
- /* alpha test*/
-
- if(ctx->Color.AlphaEnabled)
- {
- ACmpFunc a;
- GLubyte alphaRef;
-
- CLAMPED_FLOAT_TO_UBYTE(alphaRef,ctx->Color.AlphaRef);
-
- switch(ctx->Color.AlphaFunc) {
- case GL_NEVER: a = CF_Never; break;
- case GL_ALWAYS: a = CF_Always; break;
- case GL_LESS: a = CF_Less; break;
- case GL_LEQUAL: a = CF_LessEqual; break;
- case GL_EQUAL: a = CF_Equal; break;
- case GL_GREATER: a = CF_Greater; break;
- case GL_GEQUAL: a = CF_GreaterEqual; break;
- case GL_NOTEQUAL: a = CF_NotEqual; break;
- default:return;
- }
-
- imesa->regs.s3d.drawCtrl.ni.alphaTestEn = GL_TRUE;
- imesa->regs.s3d.drawCtrl.ni.alphaTestCmpFunc = a;
- imesa->regs.s3d.drawCtrl.ni.alphaRefVal = alphaRef;
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.alphaTestEn = GL_FALSE;
- }
-
- /* Set/Reset Z-after-alpha*/
-
- imesa->regs.s3d.zBufCtrl.ni.wrZafterAlphaTst =
- imesa->regs.s3d.drawCtrl.ni.alphaTestEn;
-
- if (drawCtrl != imesa->regs.s3d.drawCtrl.ui ||
- zBufCtrl != imesa->regs.s3d.zBufCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
-}
-
-static void savageDDBlendFuncSeparate_s4( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- assert (dfactorRGB == dfactorA && sfactorRGB == sfactorA);
- savageBlendFunc_s4( ctx );
-}
-static void savageDDBlendFuncSeparate_s3d( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- assert (dfactorRGB == dfactorA && sfactorRGB == sfactorA);
- savageBlendFunc_s3d( ctx );
-}
-
-
-
-static void savageDDDepthFunc_s4(GLcontext *ctx, GLenum func)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- ZCmpFunc zmode;
- u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui;
- u_int32_t zBufCtrl = imesa->regs.s4.zBufCtrl.ui;
- u_int32_t zWatermarks = imesa->regs.s4.zWatermarks.ui; /* FIXME: in DRM */
-
- /* set up z-buffer control register (global)
- * set up z-buffer offset register (global)
- * set up z read/write watermarks register (global)
- */
-
- switch(func) { /* reversed (see savageCalcViewport) */
- case GL_NEVER: zmode = CF_Never; break;
- case GL_ALWAYS: zmode = CF_Always; break;
- case GL_LESS: zmode = CF_Greater; break;
- case GL_LEQUAL: zmode = CF_GreaterEqual; break;
- case GL_EQUAL: zmode = CF_Equal; break;
- case GL_GREATER: zmode = CF_Less; break;
- case GL_GEQUAL: zmode = CF_LessEqual; break;
- case GL_NOTEQUAL: zmode = CF_NotEqual; break;
- default:return;
- }
- if (ctx->Depth.Test)
- {
-
- imesa->regs.s4.zBufCtrl.ni.zCmpFunc = zmode;
- imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn = ctx->Depth.Mask;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdZbufWrites = GL_TRUE;
- imesa->regs.s4.zBufCtrl.ni.zBufEn = GL_TRUE;
- }
- else if (imesa->glCtx->Stencil.Enabled && imesa->hw_stencil)
- {
- /* Need to keep Z on for Stencil. */
- imesa->regs.s4.zBufCtrl.ni.zCmpFunc = CF_Always;
- imesa->regs.s4.zBufCtrl.ni.zBufEn = GL_TRUE;
- imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn = GL_FALSE;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdZbufWrites = GL_FALSE;
- }
- else
- {
-
- if (imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn == GL_FALSE)
- {
- imesa->regs.s4.zBufCtrl.ni.zCmpFunc = CF_Always;
- imesa->regs.s4.zBufCtrl.ni.zBufEn = GL_TRUE;
- }
- else
-
- /* DRAWUPDATE_REQUIRES_Z_ENABLED*/
- {
- imesa->regs.s4.zBufCtrl.ni.zBufEn = GL_FALSE;
- }
- imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn = GL_FALSE;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdZbufWrites = GL_FALSE;
- }
-
- if (drawLocalCtrl != imesa->regs.s4.drawLocalCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- if (zBufCtrl != imesa->regs.s4.zBufCtrl.ui ||
- zWatermarks != imesa->regs.s4.zWatermarks.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-static void savageDDDepthFunc_s3d(GLcontext *ctx, GLenum func)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- ZCmpFunc zmode;
- u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui;
- u_int32_t zBufCtrl = imesa->regs.s3d.zBufCtrl.ui;
- u_int32_t zWatermarks = imesa->regs.s3d.zWatermarks.ui; /* FIXME: in DRM */
-
- /* set up z-buffer control register (global)
- * set up z-buffer offset register (global)
- * set up z read/write watermarks register (global)
- */
- switch(func) { /* reversed (see savageCalcViewport) */
- case GL_NEVER: zmode = CF_Never; break;
- case GL_ALWAYS: zmode = CF_Always; break;
- case GL_LESS: zmode = CF_Greater; break;
- case GL_LEQUAL: zmode = CF_GreaterEqual; break;
- case GL_EQUAL: zmode = CF_Equal; break;
- case GL_GREATER: zmode = CF_Less; break;
- case GL_GEQUAL: zmode = CF_LessEqual; break;
- case GL_NOTEQUAL: zmode = CF_NotEqual; break;
- default:return;
- }
- if (ctx->Depth.Test)
- {
- imesa->regs.s3d.zBufCtrl.ni.zBufEn = GL_TRUE;
- imesa->regs.s3d.zBufCtrl.ni.zCmpFunc = zmode;
- imesa->regs.s3d.zBufCtrl.ni.zUpdateEn = ctx->Depth.Mask;
-
- imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites = GL_TRUE;
- }
- else
- {
- if (imesa->regs.s3d.zBufCtrl.ni.drawUpdateEn == GL_FALSE) {
- imesa->regs.s3d.zBufCtrl.ni.zCmpFunc = CF_Always;
- imesa->regs.s3d.zBufCtrl.ni.zBufEn = GL_TRUE;
- }
- else
-
- /* DRAWUPDATE_REQUIRES_Z_ENABLED*/
- {
- imesa->regs.s3d.zBufCtrl.ni.zBufEn = GL_FALSE;
- }
- imesa->regs.s3d.zBufCtrl.ni.zUpdateEn = GL_FALSE;
- imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites = GL_FALSE;
- }
-
- if (drawCtrl != imesa->regs.s3d.drawCtrl.ui ||
- zBufCtrl != imesa->regs.s3d.zBufCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- if (zWatermarks != imesa->regs.s3d.zWatermarks.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-
-static void savageDDDepthMask_s4(GLcontext *ctx, GLboolean flag)
-{
- savageDDDepthFunc_s4(ctx,ctx->Depth.Func);
-}
-static void savageDDDepthMask_s3d(GLcontext *ctx, GLboolean flag)
-{
- savageDDDepthFunc_s3d(ctx,ctx->Depth.Func);
-}
-
-
-
-
-/* =============================================================
- * Hardware clipping
- */
-
-
-static void savageDDScissor( GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /* Emit buffered commands with old scissor state. */
- FLUSH_BATCH(imesa);
-
- /* Mirror scissors in private context. */
- imesa->scissor.enabled = ctx->Scissor.Enabled;
- imesa->scissor.x = x;
- imesa->scissor.y = y;
- imesa->scissor.w = w;
- imesa->scissor.h = h;
-}
-
-
-
-static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- u_int32_t destCtrl = imesa->regs.s4.destCtrl.ui;
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- imesa->IsDouble = GL_FALSE;
- imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11;
-
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetFrontClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case BUFFER_BIT_BACK_LEFT:
- imesa->IsDouble = GL_TRUE;
- imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11;
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetBackClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that r200SetBuffer() (?)
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- if (destCtrl != imesa->regs.s4.destCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-
-static void savageDDReadBuffer(GLcontext *ctx, GLenum mode )
-{
- /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
-}
-
-#if 0
-static void savageDDSetColor(GLcontext *ctx,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- imesa->MonoColor = savagePackColor( imesa->savageScreen->frontFormat, r, g, b, a );
-}
-#endif
-
-/* =============================================================
- * Window position and viewport transformation
- */
-
-void savageCalcViewport( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = imesa->hw_viewport;
-
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + imesa->drawX + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + imesa->driDrawable->h + imesa->drawY + SUBPIXEL_Y;
- /* Depth range is reversed (far: 0, near: 1) so that float depth
- * compensates for loss of accuracy of far coordinates. */
- if (imesa->float_depth && imesa->savageScreen->zpp == 2) {
- /* The Savage 16-bit floating point depth format can't encode
- * numbers < 2^-16. Make sure all depth values stay greater
- * than that. */
- m[MAT_SZ] = - v[MAT_SZ] * imesa->depth_scale * (65535.0/65536.0);
- m[MAT_TZ] = 1.0 - v[MAT_TZ] * imesa->depth_scale * (65535.0/65536.0);
- } else {
- m[MAT_SZ] = - v[MAT_SZ] * imesa->depth_scale;
- m[MAT_TZ] = 1.0 - v[MAT_TZ] * imesa->depth_scale;
- }
-
- imesa->SetupNewInputs = ~0;
-}
-
-static void savageViewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- savageCalcViewport( ctx );
-}
-
-static void savageDepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- savageCalcViewport( ctx );
-}
-
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void savageDDClearColor(GLcontext *ctx,
- const GLfloat color[4] )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLubyte c[4];
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
-
- imesa->ClearColor = savagePackColor( imesa->savageScreen->frontFormat,
- c[0], c[1], c[2], c[3] );
-}
-
-/* Fallback to swrast for select and feedback.
- */
-static void savageRenderMode( GLcontext *ctx, GLenum mode )
-{
- FALLBACK( ctx, SAVAGE_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
-}
-
-
-#if HW_CULL
-
-/* =============================================================
- * Culling - the savage isn't quite as clean here as the rest of
- * its interfaces, but it's not bad.
- */
-static void savageDDCullFaceFrontFace(GLcontext *ctx, GLenum unused)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLuint cullMode=imesa->LcsCullMode;
- switch (ctx->Polygon.CullFaceMode)
- {
- case GL_FRONT:
- switch (ctx->Polygon.FrontFace)
- {
- case GL_CW:
- cullMode = BCM_CW;
- break;
- case GL_CCW:
- cullMode = BCM_CCW;
- break;
- }
- break;
-
- case GL_BACK:
- switch (ctx->Polygon.FrontFace)
- {
- case GL_CW:
- cullMode = BCM_CCW;
- break;
- case GL_CCW:
- cullMode = BCM_CW;
- break;
- }
- break;
- }
- imesa->LcsCullMode = cullMode;
- imesa->new_state |= SAVAGE_NEW_CULL;
-}
-#endif /* end #if HW_CULL */
-
-static void savageUpdateCull( GLcontext *ctx )
-{
-#if HW_CULL
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLuint cullMode;
- if (ctx->Polygon.CullFlag &&
- imesa->raster_primitive >= GL_TRIANGLES &&
- ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK)
- cullMode = imesa->LcsCullMode;
- else
- cullMode = BCM_None;
- if (imesa->savageScreen->chipset >= S3_SAVAGE4) {
- if (imesa->regs.s4.drawCtrl1.ni.cullMode != cullMode) {
- imesa->regs.s4.drawCtrl1.ni.cullMode = cullMode;
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
- }
- } else {
- if (imesa->regs.s3d.drawCtrl.ni.cullMode != cullMode) {
- imesa->regs.s3d.drawCtrl.ni.cullMode = cullMode;
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- }
- }
-#endif /* end #if HW_CULL */
-}
-
-
-
-/* =============================================================
- * Color masks
- */
-
-/* Savage4 can disable draw updates when all channels are
- * masked. Savage3D has a bit called drawUpdateEn, but it doesn't seem
- * to have any effect. If only some channels are masked we need a
- * software fallback on all chips.
- */
-static void savageDDColorMask_s4(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- GLboolean passAny, passAll;
-
- if (ctx->Visual.alphaBits) {
- passAny = b || g || r || a;
- passAll = r && g && b && a;
- } else {
- passAny = b || g || r;
- passAll = r && g && b;
- }
-
- if (passAny) {
- if (!imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn) {
- imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn = GL_TRUE;
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- }
- FALLBACK (ctx, SAVAGE_FALLBACK_COLORMASK, !passAll);
- } else if (imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn) {
- imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn = GL_FALSE;
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- }
-}
-static void savageDDColorMask_s3d(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- if (ctx->Visual.alphaBits)
- FALLBACK (ctx, SAVAGE_FALLBACK_COLORMASK, !(r && g && b && a));
- else
- FALLBACK (ctx, SAVAGE_FALLBACK_COLORMASK, !(r && g && b));
-}
-
-/* Seperate specular not fully implemented in hardware... Needs
- * some interaction with material state? Just punt to software
- * in all cases?
- * FK: Don't fall back for now. Let's see the failure cases and
- * fix them the right way. I don't see how this could be a
- * hardware limitation.
- */
-static void savageUpdateSpecular_s4(GLcontext *ctx) {
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui;
-
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Light.Enabled) {
- imesa->regs.s4.drawLocalCtrl.ni.specShadeEn = GL_TRUE;
- /*FALLBACK (ctx, SAVAGE_FALLBACK_SPECULAR, GL_TRUE);*/
- } else {
- imesa->regs.s4.drawLocalCtrl.ni.specShadeEn = GL_FALSE;
- /*FALLBACK (ctx, SAVAGE_FALLBACK_SPECULAR, GL_FALSE);*/
- }
-
- if (drawLocalCtrl != imesa->regs.s4.drawLocalCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
-}
-static void savageUpdateSpecular_s3d(GLcontext *ctx) {
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui;
-
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Light.Enabled) {
- imesa->regs.s3d.drawCtrl.ni.specShadeEn = GL_TRUE;
- /*FALLBACK (ctx, SAVAGE_FALLBACK_SPECULAR, GL_TRUE);*/
- } else {
- imesa->regs.s3d.drawCtrl.ni.specShadeEn = GL_FALSE;
- /*FALLBACK (ctx, SAVAGE_FALLBACK_SPECULAR, GL_FALSE);*/
- }
-
- if (drawCtrl != imesa->regs.s3d.drawCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
-}
-
-static void savageDDLightModelfv_s4(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- savageUpdateSpecular_s4 (ctx);
-}
-static void savageDDLightModelfv_s3d(GLcontext *ctx, GLenum pname,
- const GLfloat *param)
-{
- savageUpdateSpecular_s3d (ctx);
-}
-
-static void savageDDShadeModel_s4(GLcontext *ctx, GLuint mod)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui;
-
- if (mod == GL_SMOOTH)
- {
- imesa->regs.s4.drawLocalCtrl.ni.flatShadeEn = GL_FALSE;
- }
- else
- {
- imesa->regs.s4.drawLocalCtrl.ni.flatShadeEn = GL_TRUE;
- }
-
- if (drawLocalCtrl != imesa->regs.s4.drawLocalCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
-}
-static void savageDDShadeModel_s3d(GLcontext *ctx, GLuint mod)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui;
-
- if (mod == GL_SMOOTH)
- {
- imesa->regs.s3d.drawCtrl.ni.flatShadeEn = GL_FALSE;
- }
- else
- {
- imesa->regs.s3d.drawCtrl.ni.flatShadeEn = GL_TRUE;
- }
-
- if (drawCtrl != imesa->regs.s3d.drawCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
-}
-
-
-/* =============================================================
- * Fog
- * The fogCtrl register has the same position and the same layout
- * on savage3d and savage4. No need for two separate functions.
- */
-
-static void savageDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLuint fogClr;
- u_int32_t fogCtrl = imesa->regs.s4.fogCtrl.ui;
-
- /*if ((ctx->Fog.Enabled) &&(pname == GL_FOG_COLOR))*/
- if (ctx->Fog.Enabled)
- {
- fogClr = (((GLubyte)(ctx->Fog.Color[0]*255.0F) << 16) |
- ((GLubyte)(ctx->Fog.Color[1]*255.0F) << 8) |
- ((GLubyte)(ctx->Fog.Color[2]*255.0F) << 0));
- imesa->regs.s4.fogCtrl.ni.fogEn = GL_TRUE;
- /*cheap fog*/
- imesa->regs.s4.fogCtrl.ni.fogMode = GL_TRUE;
- imesa->regs.s4.fogCtrl.ni.fogClr = fogClr;
- }
- else
- {
- /*No fog*/
-
- imesa->regs.s4.fogCtrl.ni.fogEn = 0;
- imesa->regs.s4.fogCtrl.ni.fogMode = 0;
- }
-
- if (fogCtrl != imesa->regs.s4.fogCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-
-
-static void savageDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- unsigned a=0;
- const u_int32_t zBufCtrl = imesa->regs.s4.zBufCtrl.ui;
- const u_int32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui;
-
- imesa->regs.s4.zBufCtrl.ni.stencilRefVal = ctx->Stencil.Ref[0];
- imesa->regs.s4.stencilCtrl.ni.readMask = ctx->Stencil.ValueMask[0];
-
- switch (ctx->Stencil.Function[0])
- {
- case GL_NEVER: a = CF_Never; break;
- case GL_ALWAYS: a = CF_Always; break;
- case GL_LESS: a = CF_Less; break;
- case GL_LEQUAL: a = CF_LessEqual; break;
- case GL_EQUAL: a = CF_Equal; break;
- case GL_GREATER: a = CF_Greater; break;
- case GL_GEQUAL: a = CF_GreaterEqual; break;
- case GL_NOTEQUAL: a = CF_NotEqual; break;
- default:
- break;
- }
-
- imesa->regs.s4.stencilCtrl.ni.cmpFunc = a;
-
- if (zBufCtrl != imesa->regs.s4.zBufCtrl.ui ||
- stencilCtrl != imesa->regs.s4.stencilCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-
-static void savageDDStencilMask(GLcontext *ctx, GLuint mask)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- if (imesa->regs.s4.stencilCtrl.ni.writeMask != ctx->Stencil.WriteMask[0]) {
- imesa->regs.s4.stencilCtrl.ni.writeMask = ctx->Stencil.WriteMask[0];
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
- }
-}
-
-static unsigned get_stencil_op_value( GLenum op )
-{
- switch (op)
- {
- case GL_KEEP: return STENCIL_Keep;
- case GL_ZERO: return STENCIL_Zero;
- case GL_REPLACE: return STENCIL_Equal;
- case GL_INCR: return STENCIL_IncClamp;
- case GL_DECR: return STENCIL_DecClamp;
- case GL_INVERT: return STENCIL_Invert;
- case GL_INCR_WRAP: return STENCIL_Inc;
- case GL_DECR_WRAP: return STENCIL_Dec;
- }
-
- /* Should *never* get here. */
- return STENCIL_Keep;
-}
-
-static void savageDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- const u_int32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui;
-
- imesa->regs.s4.stencilCtrl.ni.failOp = get_stencil_op_value( ctx->Stencil.FailFunc[0] );
- imesa->regs.s4.stencilCtrl.ni.passZfailOp = get_stencil_op_value( ctx->Stencil.ZFailFunc[0] );
- imesa->regs.s4.stencilCtrl.ni.passZpassOp = get_stencil_op_value( ctx->Stencil.ZPassFunc[0] );
-
- if (stencilCtrl != imesa->regs.s4.stencilCtrl.ui)
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
-}
-
-
-/* =============================================================
- */
-
-static void savageDDEnable_s4(GLcontext *ctx, GLenum cap, GLboolean state)
-{
-
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- switch(cap) {
- case GL_ALPHA_TEST:
- /* we should consider the disable case*/
- savageBlendFunc_s4(ctx);
- break;
- case GL_BLEND:
- /*add the savageBlendFunc 2001/11/25
- * if call no such function, then glDisable(GL_BLEND) will do noting,
- *our chip has no disable bit
- */
- savageBlendFunc_s4(ctx);
- case GL_COLOR_LOGIC_OP:
- /* Fall through:
- * For some reason enable(GL_BLEND) affects ColorLogicOpEnabled.
- */
- FALLBACK (ctx, SAVAGE_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
- break;
- case GL_DEPTH_TEST:
- savageDDDepthFunc_s4(ctx,ctx->Depth.Func);
- break;
- case GL_SCISSOR_TEST:
- savageDDScissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height);
- break;
- case GL_STENCIL_TEST:
- if (!imesa->hw_stencil)
- FALLBACK (ctx, SAVAGE_FALLBACK_STENCIL, state);
- else {
- imesa->regs.s4.stencilCtrl.ni.stencilEn = state;
- if (ctx->Stencil.Enabled &&
- imesa->regs.s4.zBufCtrl.ni.zBufEn != GL_TRUE)
- {
- /* Stencil buffer requires Z enabled. */
- imesa->regs.s4.zBufCtrl.ni.zCmpFunc = CF_Always;
- imesa->regs.s4.zBufCtrl.ni.zBufEn = GL_TRUE;
- imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn = GL_FALSE;
- }
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL | SAVAGE_UPLOAD_LOCAL;
- }
- break;
- case GL_FOG:
- savageDDFogfv(ctx,0,0);
- break;
- case GL_CULL_FACE:
-#if HW_CULL
- if (state)
- {
- savageDDCullFaceFrontFace(ctx,0);
- }
- else
- {
- imesa->LcsCullMode = BCM_None;
- imesa->new_state |= SAVAGE_NEW_CULL;
- }
-#endif
- break;
- case GL_DITHER:
- if (state)
- {
- if ( ctx->Color.DitherFlag )
- {
- imesa->regs.s4.drawCtrl1.ni.ditherEn=GL_TRUE;
- }
- }
- if (!ctx->Color.DitherFlag )
- {
- imesa->regs.s4.drawCtrl1.ni.ditherEn=GL_FALSE;
- }
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
- break;
-
- case GL_LIGHTING:
- savageUpdateSpecular_s4 (ctx);
- break;
- case GL_TEXTURE_1D:
- case GL_TEXTURE_3D:
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
- break;
- case GL_TEXTURE_2D:
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
- break;
- default:
- ;
- }
-}
-static void savageDDEnable_s3d(GLcontext *ctx, GLenum cap, GLboolean state)
-{
-
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- switch(cap) {
- case GL_ALPHA_TEST:
- /* we should consider the disable case*/
- savageBlendFunc_s3d(ctx);
- break;
- case GL_BLEND:
- /*add the savageBlendFunc 2001/11/25
- * if call no such function, then glDisable(GL_BLEND) will do noting,
- *our chip has no disable bit
- */
- savageBlendFunc_s3d(ctx);
- case GL_COLOR_LOGIC_OP:
- /* Fall through:
- * For some reason enable(GL_BLEND) affects ColorLogicOpEnabled.
- */
- FALLBACK (ctx, SAVAGE_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
- break;
- case GL_DEPTH_TEST:
- savageDDDepthFunc_s3d(ctx,ctx->Depth.Func);
- break;
- case GL_SCISSOR_TEST:
- savageDDScissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height);
- break;
- case GL_STENCIL_TEST:
- FALLBACK (ctx, SAVAGE_FALLBACK_STENCIL, state);
- break;
- case GL_FOG:
- savageDDFogfv(ctx,0,0);
- break;
- case GL_CULL_FACE:
-#if HW_CULL
- if (state)
- {
- savageDDCullFaceFrontFace(ctx,0);
- }
- else
- {
- imesa->LcsCullMode = BCM_None;
- imesa->new_state |= SAVAGE_NEW_CULL;
- }
-#endif
- break;
- case GL_DITHER:
- if (state)
- {
- if ( ctx->Color.DitherFlag )
- {
- imesa->regs.s3d.drawCtrl.ni.ditherEn=GL_TRUE;
- }
- }
- if (!ctx->Color.DitherFlag )
- {
- imesa->regs.s3d.drawCtrl.ni.ditherEn=GL_FALSE;
- }
- imesa->dirty |= SAVAGE_UPLOAD_LOCAL;
- break;
-
- case GL_LIGHTING:
- savageUpdateSpecular_s3d (ctx);
- break;
- case GL_TEXTURE_1D:
- case GL_TEXTURE_3D:
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
- break;
- case GL_TEXTURE_2D:
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
- break;
- default:
- ;
- }
-}
-
-void savageDDUpdateHwState( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- if (imesa->new_state) {
- savageFlushVertices(imesa);
- if (imesa->new_state & SAVAGE_NEW_TEXTURE) {
- savageUpdateTextureState( ctx );
- }
- if ((imesa->new_state & SAVAGE_NEW_CULL)) {
- savageUpdateCull(ctx);
- }
- imesa->new_state = 0;
- }
-}
-
-
-static void savageDDPrintDirty( const char *msg, GLuint state )
-{
- fprintf(stderr, "%s (0x%x): %s%s%s%s%s%s\n",
- msg,
- (unsigned int) state,
- (state & SAVAGE_UPLOAD_LOCAL) ? "upload-local, " : "",
- (state & SAVAGE_UPLOAD_TEX0) ? "upload-tex0, " : "",
- (state & SAVAGE_UPLOAD_TEX1) ? "upload-tex1, " : "",
- (state & SAVAGE_UPLOAD_FOGTBL) ? "upload-fogtbl, " : "",
- (state & SAVAGE_UPLOAD_GLOBAL) ? "upload-global, " : "",
- (state & SAVAGE_UPLOAD_TEXGLOBAL) ? "upload-texglobal, " : ""
- );
-}
-
-
-/**
- * Check if global registers were changed
- */
-static GLboolean savageGlobalRegChanged (savageContextPtr imesa,
- GLuint first, GLuint last) {
- GLuint i;
- for (i = first - SAVAGE_FIRST_REG; i <= last - SAVAGE_FIRST_REG; ++i) {
- if (((imesa->oldRegs.ui[i] ^ imesa->regs.ui[i]) &
- imesa->globalRegMask.ui[i]) != 0)
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-static void savageEmitOldRegs (savageContextPtr imesa,
- GLuint first, GLuint last, GLboolean global) {
- GLuint n = last-first+1;
- drm_savage_cmd_header_t *cmd = savageAllocCmdBuf(imesa, n*4);
- cmd->state.cmd = SAVAGE_CMD_STATE;
- cmd->state.global = global;
- cmd->state.count = n;
- cmd->state.start = first;
- memcpy(cmd+1, &imesa->oldRegs.ui[first-SAVAGE_FIRST_REG], n*4);
-}
-static void savageEmitContiguousRegs (savageContextPtr imesa,
- GLuint first, GLuint last) {
- GLuint i;
- GLuint n = last-first+1;
- drm_savage_cmd_header_t *cmd = savageAllocCmdBuf(imesa, n*4);
- cmd->state.cmd = SAVAGE_CMD_STATE;
- cmd->state.global = savageGlobalRegChanged(imesa, first, last);
- cmd->state.count = n;
- cmd->state.start = first;
- memcpy(cmd+1, &imesa->regs.ui[first-SAVAGE_FIRST_REG], n*4);
- /* savageAllocCmdBuf may need to flush the cmd buffer and backup
- * the current hardware state. It should see the "old" (current)
- * state that has actually been emitted to the hardware. Therefore
- * this update is done *after* savageAllocCmdBuf. */
- for (i = first - SAVAGE_FIRST_REG; i <= last - SAVAGE_FIRST_REG; ++i)
- imesa->oldRegs.ui[i] = imesa->regs.ui[i];
- if (SAVAGE_DEBUG & DEBUG_STATE)
- fprintf (stderr, "Emitting regs 0x%02x-0x%02x\n", first, last);
-}
-static void savageEmitChangedRegs (savageContextPtr imesa,
- GLuint first, GLuint last) {
- GLuint i, firstChanged;
- firstChanged = SAVAGE_NR_REGS;
- for (i = first - SAVAGE_FIRST_REG; i <= last - SAVAGE_FIRST_REG; ++i) {
- if (imesa->oldRegs.ui[i] != imesa->regs.ui[i]) {
- if (firstChanged == SAVAGE_NR_REGS)
- firstChanged = i;
- } else {
- if (firstChanged != SAVAGE_NR_REGS) {
- savageEmitContiguousRegs (imesa, firstChanged+SAVAGE_FIRST_REG,
- i-1+SAVAGE_FIRST_REG);
- firstChanged = SAVAGE_NR_REGS;
- }
- }
- }
- if (firstChanged != SAVAGE_NR_REGS)
- savageEmitContiguousRegs (imesa, firstChanged+SAVAGE_FIRST_REG,
- last);
-}
-static void savageEmitChangedRegChunk (savageContextPtr imesa,
- GLuint first, GLuint last) {
- GLuint i;
- for (i = first - SAVAGE_FIRST_REG; i <= last - SAVAGE_FIRST_REG; ++i) {
- if (imesa->oldRegs.ui[i] != imesa->regs.ui[i]) {
- savageEmitContiguousRegs (imesa, first, last);
- break;
- }
- }
-}
-static void savageUpdateRegister_s4(savageContextPtr imesa)
-{
- /* In case the texture image was changed without changing the
- * texture address as well, we need to force emitting the texture
- * address in order to flush texture cashes. */
- if ((imesa->dirty & SAVAGE_UPLOAD_TEX0) &&
- imesa->oldRegs.s4.texAddr[0].ui == imesa->regs.s4.texAddr[0].ui)
- imesa->oldRegs.s4.texAddr[0].ui = 0xffffffff;
- if ((imesa->dirty & SAVAGE_UPLOAD_TEX1) &&
- imesa->oldRegs.s4.texAddr[1].ui == imesa->regs.s4.texAddr[1].ui)
- imesa->oldRegs.s4.texAddr[1].ui = 0xffffffff;
-
- /* Fix up watermarks */
- if (imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites) {
- imesa->regs.s4.destTexWatermarks.ni.destWriteLow = 0;
- imesa->regs.s4.destTexWatermarks.ni.destFlush = 1;
- } else
- imesa->regs.s4.destTexWatermarks.ni.destWriteLow = S4_DWLO;
- if (imesa->regs.s4.drawLocalCtrl.ni.flushPdZbufWrites)
- imesa->regs.s4.zWatermarks.ni.wLow = 0;
- else
- imesa->regs.s4.zWatermarks.ni.wLow = S4_ZWLO;
-
- savageEmitChangedRegs (imesa, 0x1e, 0x39);
-
- imesa->dirty=0;
-}
-static void savageUpdateRegister_s3d(savageContextPtr imesa)
-{
- /* In case the texture image was changed without changing the
- * texture address as well, we need to force emitting the texture
- * address in order to flush texture cashes. */
- if ((imesa->dirty & SAVAGE_UPLOAD_TEX0) &&
- imesa->oldRegs.s3d.texAddr.ui == imesa->regs.s3d.texAddr.ui)
- imesa->oldRegs.s3d.texAddr.ui = 0xffffffff;
-
- /* Fix up watermarks */
- if (imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites) {
- imesa->regs.s3d.destTexWatermarks.ni.destWriteLow = 0;
- imesa->regs.s3d.destTexWatermarks.ni.destFlush = 1;
- } else
- imesa->regs.s3d.destTexWatermarks.ni.destWriteLow = S3D_DWLO;
- if (imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites)
- imesa->regs.s3d.zWatermarks.ni.wLow = 0;
- else
- imesa->regs.s3d.zWatermarks.ni.wLow = S3D_ZWLO;
-
-
- /* the savage3d uses two contiguous ranges of BCI registers:
- * 0x18-0x1c and 0x20-0x38. Some texture registers need to be
- * emitted in one chunk or we get some funky rendering errors. */
- savageEmitChangedRegs (imesa, 0x18, 0x19);
- savageEmitChangedRegChunk (imesa, 0x1a, 0x1c);
- savageEmitChangedRegs (imesa, 0x20, 0x38);
-
- imesa->dirty=0;
-}
-
-
-void savageEmitOldState( savageContextPtr imesa )
-{
- assert(imesa->cmdBuf.write == imesa->cmdBuf.base);
- if (imesa->savageScreen->chipset >= S3_SAVAGE4) {
- savageEmitOldRegs (imesa, 0x1e, 0x39, GL_TRUE);
- } else {
- savageEmitOldRegs (imesa, 0x18, 0x1c, GL_TRUE);
- savageEmitOldRegs (imesa, 0x20, 0x38, GL_FALSE);
- }
-}
-
-
-/* Push the state into the sarea and/or texture memory.
- */
-void savageEmitChangedState( savageContextPtr imesa )
-{
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_API)
- savageDDPrintDirty( "\n\n\nsavageEmitHwStateLocked", imesa->dirty );
-
- if (imesa->dirty)
- {
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf (stderr, "... emitting state\n");
- if (imesa->savageScreen->chipset >= S3_SAVAGE4)
- savageUpdateRegister_s4(imesa);
- else
- savageUpdateRegister_s3d(imesa);
- }
-
- imesa->dirty = 0;
-}
-
-
-static void savageDDInitState_s4( savageContextPtr imesa )
-{
-#if 1
- imesa->regs.s4.destCtrl.ui = 1<<7;
-#endif
-
- imesa->regs.s4.zBufCtrl.ni.zCmpFunc = CF_Less;
- imesa->regs.s4.zBufCtrl.ni.wToZEn = GL_TRUE;
- if (imesa->float_depth) {
- imesa->regs.s4.zBufCtrl.ni.zExpOffset =
- imesa->savageScreen->zpp == 2 ? 16 : 32;
- imesa->regs.s4.zBufCtrl.ni.floatZEn = GL_TRUE;
- } else {
- imesa->regs.s4.zBufCtrl.ni.zExpOffset = 0;
- imesa->regs.s4.zBufCtrl.ni.floatZEn = GL_FALSE;
- }
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_NoTexMap;
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_NoTexMap1;
- imesa->regs.s4.drawCtrl0.ui = 0;
-#if 0
- imesa->regs.s4.drawCtrl1.ni.xyOffsetEn = 1;
-#endif
-
- /* Set DestTexWatermarks_31,30 to 01 always.
- *Has no effect if dest. flush is disabled.
- */
-#if 0
- imesa->regs.s4.zWatermarks.ui = 0x12000C04;
- imesa->regs.s4.destTexWatermarks.ui = 0x40200400;
-#else
- /*imesa->regs.s4.zWatermarks.ui = 0x16001808;*/
- imesa->regs.s4.zWatermarks.ni.rLow = S4_ZRLO;
- imesa->regs.s4.zWatermarks.ni.rHigh = S4_ZRHI;
- imesa->regs.s4.zWatermarks.ni.wLow = S4_ZWLO;
- imesa->regs.s4.zWatermarks.ni.wHigh = S4_ZWHI;
- /*imesa->regs.s4.destTexWatermarks.ui = 0x4f000000;*/
- imesa->regs.s4.destTexWatermarks.ni.destReadLow = S4_DRLO;
- imesa->regs.s4.destTexWatermarks.ni.destReadHigh = S4_DRHI;
- imesa->regs.s4.destTexWatermarks.ni.destWriteLow = S4_DWLO;
- imesa->regs.s4.destTexWatermarks.ni.destWriteHigh = S4_DWHI;
- imesa->regs.s4.destTexWatermarks.ni.texRead = S4_TR;
- imesa->regs.s4.destTexWatermarks.ni.destFlush = 1;
-#endif
- imesa->regs.s4.drawCtrl0.ni.dPerfAccelEn = GL_TRUE;
-
- /* clrCmpAlphaBlendCtrl is needed to get alphatest and
- * alpha blending working properly
- */
-
- imesa->regs.s4.texCtrl[0].ni.dBias = 0x08;
- imesa->regs.s4.texCtrl[1].ni.dBias = 0x08;
- imesa->regs.s4.texCtrl[0].ni.texXprEn = GL_TRUE;
- imesa->regs.s4.texCtrl[1].ni.texXprEn = GL_TRUE;
- imesa->regs.s4.texCtrl[0].ni.dMax = 0x0f;
- imesa->regs.s4.texCtrl[1].ni.dMax = 0x0f;
- /* programm a valid tex address, in case texture state is emitted
- * in wrong order. */
- if (imesa->lastTexHeap == 2 && imesa->savageScreen->textureSize[1]) {
- /* AGP textures available */
- imesa->regs.s4.texAddr[0].ui = imesa->savageScreen->textureOffset[1]|3;
- imesa->regs.s4.texAddr[1].ui = imesa->savageScreen->textureOffset[1]|3;
- } else {
- /* no AGP textures available, use local */
- imesa->regs.s4.texAddr[0].ui = imesa->savageScreen->textureOffset[0]|2;
- imesa->regs.s4.texAddr[1].ui = imesa->savageScreen->textureOffset[0]|2;
- }
- imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn = GL_TRUE;
- imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_One;
- imesa->regs.s4.drawLocalCtrl.ni.wrZafterAlphaTst = GL_FALSE;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdZbufWrites= GL_TRUE;
- imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites= GL_TRUE;
-
- imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn= GL_TRUE;
- imesa->regs.s4.drawCtrl1.ni.ditherEn = (
- driQueryOptioni(&imesa->optionCache, "color_reduction") ==
- DRI_CONF_COLOR_REDUCTION_DITHER) ? GL_TRUE : GL_FALSE;
- imesa->regs.s4.drawCtrl1.ni.cullMode = BCM_None;
-
- imesa->regs.s4.zBufCtrl.ni.stencilRefVal = 0x00;
-
- imesa->regs.s4.stencilCtrl.ni.stencilEn = GL_FALSE;
- imesa->regs.s4.stencilCtrl.ni.cmpFunc = CF_Always;
- imesa->regs.s4.stencilCtrl.ni.failOp = STENCIL_Keep;
- imesa->regs.s4.stencilCtrl.ni.passZfailOp = STENCIL_Keep;
- imesa->regs.s4.stencilCtrl.ni.passZpassOp = STENCIL_Keep;
- imesa->regs.s4.stencilCtrl.ni.writeMask = 0xff;
- imesa->regs.s4.stencilCtrl.ni.readMask = 0xff;
-
- imesa->LcsCullMode=BCM_None;
- imesa->regs.s4.texDescr.ni.palSize = TPS_256;
-
- /* clear the local registers in the global reg mask */
- imesa->globalRegMask.s4.drawLocalCtrl.ui = 0;
- imesa->globalRegMask.s4.texPalAddr.ui = 0;
- imesa->globalRegMask.s4.texCtrl[0].ui = 0;
- imesa->globalRegMask.s4.texCtrl[1].ui = 0;
- imesa->globalRegMask.s4.texAddr[0].ui = 0;
- imesa->globalRegMask.s4.texAddr[1].ui = 0;
- imesa->globalRegMask.s4.texBlendCtrl[0].ui = 0;
- imesa->globalRegMask.s4.texBlendCtrl[1].ui = 0;
- imesa->globalRegMask.s4.texXprClr.ui = 0;
- imesa->globalRegMask.s4.texDescr.ui = 0;
-}
-static void savageDDInitState_s3d( savageContextPtr imesa )
-{
-#if 1
- imesa->regs.s3d.destCtrl.ui = 1<<7;
-#endif
-
- imesa->regs.s3d.zBufCtrl.ni.zCmpFunc = CF_Less;
-#if 0
- imesa->regs.s3d.drawCtrl.ni.xyOffsetEn = 1;
-#endif
-
- /* Set DestTexWatermarks_31,30 to 01 always.
- *Has no effect if dest. flush is disabled.
- */
-#if 0
- imesa->regs.s3d.zWatermarks.ui = 0x12000C04;
- imesa->regs.s3d.destTexWatermarks.ui = 0x40200400;
-#else
- /*imesa->regs.s3d.zWatermarks.ui = 0x16001808;*/
- imesa->regs.s3d.zWatermarks.ni.rLow = S3D_ZRLO;
- imesa->regs.s3d.zWatermarks.ni.rHigh = S3D_ZRHI;
- imesa->regs.s3d.zWatermarks.ni.wLow = S3D_ZWLO;
- imesa->regs.s3d.zWatermarks.ni.wHigh = S3D_ZWHI;
- /*imesa->regs.s3d.destTexWatermarks.ui = 0x4f000000;*/
- imesa->regs.s3d.destTexWatermarks.ni.destReadLow = S3D_DRLO;
- imesa->regs.s3d.destTexWatermarks.ni.destReadHigh = S3D_DRHI;
- imesa->regs.s3d.destTexWatermarks.ni.destWriteLow = S3D_DWLO;
- imesa->regs.s3d.destTexWatermarks.ni.destWriteHigh = S3D_DWHI;
- imesa->regs.s3d.destTexWatermarks.ni.texRead = S3D_TR;
- imesa->regs.s3d.destTexWatermarks.ni.destFlush = 1;
-#endif
-
- imesa->regs.s3d.texCtrl.ni.dBias = 0x08;
- imesa->regs.s3d.texCtrl.ni.texXprEn = GL_TRUE;
- /* texXprEn is needed to get alphatest and alpha blending working
- * properly. However, this makes texels with color texXprClr
- * completely transparent in some texture environment modes. I
- * couldn't find a way to disable this. So choose an arbitrary and
- * improbable color. (0 is a bad choice, makes all black texels
- * transparent.) */
- imesa->regs.s3d.texXprClr.ui = 0x26ae26ae;
- /* programm a valid tex address, in case texture state is emitted
- * in wrong order. */
- if (imesa->lastTexHeap == 2 && imesa->savageScreen->textureSize[1]) {
- /* AGP textures available */
- imesa->regs.s3d.texAddr.ui = imesa->savageScreen->textureOffset[1]|3;
- } else {
- /* no AGP textures available, use local */
- imesa->regs.s3d.texAddr.ui = imesa->savageScreen->textureOffset[0]|2;
- }
-
- imesa->regs.s3d.zBufCtrl.ni.drawUpdateEn = GL_TRUE;
- imesa->regs.s3d.zBufCtrl.ni.wrZafterAlphaTst = GL_FALSE;
- imesa->regs.s3d.zBufCtrl.ni.zUpdateEn = GL_TRUE;
-
- imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_One;
- imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites = GL_TRUE;
- imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
-
- imesa->regs.s3d.drawCtrl.ni.ditherEn = (
- driQueryOptioni(&imesa->optionCache, "color_reduction") ==
- DRI_CONF_COLOR_REDUCTION_DITHER) ? GL_TRUE : GL_FALSE;
- imesa->regs.s3d.drawCtrl.ni.cullMode = BCM_None;
-
- imesa->LcsCullMode = BCM_None;
- imesa->regs.s3d.texDescr.ni.palSize = TPS_256;
-
- /* clear the local registers in the global reg mask */
- imesa->globalRegMask.s3d.texPalAddr.ui = 0;
- imesa->globalRegMask.s3d.texXprClr.ui = 0;
- imesa->globalRegMask.s3d.texAddr.ui = 0;
- imesa->globalRegMask.s3d.texDescr.ui = 0;
- imesa->globalRegMask.s3d.texCtrl.ui = 0;
-
- imesa->globalRegMask.s3d.fogCtrl.ui = 0;
-
- /* drawCtrl is local with some exceptions */
- imesa->globalRegMask.s3d.drawCtrl.ui = 0;
- imesa->globalRegMask.s3d.drawCtrl.ni.cullMode = 0x3;
- imesa->globalRegMask.s3d.drawCtrl.ni.alphaTestCmpFunc = 0x7;
- imesa->globalRegMask.s3d.drawCtrl.ni.alphaTestEn = 0x1;
- imesa->globalRegMask.s3d.drawCtrl.ni.alphaRefVal = 0xff;
-
- /* zBufCtrl is local with some exceptions */
- imesa->globalRegMask.s3d.zBufCtrl.ui = 0;
- imesa->globalRegMask.s3d.zBufCtrl.ni.zCmpFunc = 0x7;
- imesa->globalRegMask.s3d.zBufCtrl.ni.zBufEn = 0x1;
-}
-void savageDDInitState( savageContextPtr imesa ) {
- memset (imesa->regs.ui, 0, SAVAGE_NR_REGS*sizeof(u_int32_t));
- memset (imesa->globalRegMask.ui, 0xff, SAVAGE_NR_REGS*sizeof(u_int32_t));
- if (imesa->savageScreen->chipset >= S3_SAVAGE4)
- savageDDInitState_s4 (imesa);
- else
- savageDDInitState_s3d (imesa);
-
- /*fprintf(stderr,"DBflag:%d\n",imesa->glCtx->Visual->DBflag);*/
- /* zbufoffset and destctrl have the same position and layout on
- * savage4 and savage3d. */
- if (imesa->glCtx->Visual.doubleBufferMode) {
- imesa->IsDouble = GL_TRUE;
- imesa->toggle = TARGET_BACK;
- imesa->regs.s4.destCtrl.ni.offset =
- imesa->savageScreen->backOffset>>11;
- } else {
- imesa->IsDouble = GL_FALSE;
- imesa->toggle = TARGET_FRONT;
- imesa->regs.s4.destCtrl.ni.offset =
- imesa->savageScreen->frontOffset>>11;
- }
- if(imesa->savageScreen->cpp == 2) {
- imesa->regs.s4.destCtrl.ni.dstPixFmt = 0;
- imesa->regs.s4.destCtrl.ni.dstWidthInTile =
- (imesa->savageScreen->width+63)>>6;
- } else {
- imesa->regs.s4.destCtrl.ni.dstPixFmt = 1;
- imesa->regs.s4.destCtrl.ni.dstWidthInTile =
- (imesa->savageScreen->width+31)>>5;
- }
- imesa->drawMap = imesa->apertureBase[imesa->toggle];
- imesa->readMap = imesa->apertureBase[imesa->toggle];
- imesa->NotFirstFrame = GL_FALSE;
-
- imesa->regs.s4.zBufOffset.ni.offset=imesa->savageScreen->depthOffset>>11;
- if(imesa->savageScreen->zpp == 2) {
- imesa->regs.s4.zBufOffset.ni.zBufWidthInTiles =
- (imesa->savageScreen->width+63)>>6;
- imesa->regs.s4.zBufOffset.ni.zDepthSelect = 0;
- } else {
- imesa->regs.s4.zBufOffset.ni.zBufWidthInTiles =
- (imesa->savageScreen->width+31)>>5;
- imesa->regs.s4.zBufOffset.ni.zDepthSelect = 1;
- }
-
- memcpy (imesa->oldRegs.ui, imesa->regs.ui, SAVAGE_NR_REGS*sizeof(u_int32_t));
-
- /* Emit the initial state to the (empty) command buffer. */
- assert (imesa->cmdBuf.write == imesa->cmdBuf.base);
- savageEmitOldState(imesa);
- imesa->cmdBuf.start = imesa->cmdBuf.write;
-}
-
-
-#define INTERESTED (~(NEW_MODELVIEW|NEW_PROJECTION|\
- NEW_TEXTURE_MATRIX|\
- NEW_USER_CLIP|NEW_CLIENT_STATE))
-
-static void savageDDInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- SAVAGE_CONTEXT(ctx)->new_gl_state |= new_state;
-}
-
-
-void savageDDInitStateFuncs(GLcontext *ctx)
-{
- ctx->Driver.UpdateState = savageDDInvalidateState;
- ctx->Driver.BlendEquationSeparate = savageDDBlendEquationSeparate;
- ctx->Driver.Fogfv = savageDDFogfv;
- ctx->Driver.Scissor = savageDDScissor;
-#if HW_CULL
- ctx->Driver.CullFace = savageDDCullFaceFrontFace;
- ctx->Driver.FrontFace = savageDDCullFaceFrontFace;
-#else
- ctx->Driver.CullFace = 0;
- ctx->Driver.FrontFace = 0;
-#endif /* end #if HW_CULL */
- ctx->Driver.PolygonMode=NULL;
- ctx->Driver.PolygonStipple = 0;
- ctx->Driver.LineStipple = 0;
- ctx->Driver.LineWidth = 0;
- ctx->Driver.LogicOpcode = 0;
- ctx->Driver.DrawBuffer = savageDDDrawBuffer;
- ctx->Driver.ReadBuffer = savageDDReadBuffer;
- ctx->Driver.ClearColor = savageDDClearColor;
-
- ctx->Driver.DepthRange = savageDepthRange;
- ctx->Driver.Viewport = savageViewport;
- ctx->Driver.RenderMode = savageRenderMode;
-
- ctx->Driver.ClearIndex = 0;
- ctx->Driver.IndexMask = 0;
-
- if (SAVAGE_CONTEXT( ctx )->savageScreen->chipset >= S3_SAVAGE4) {
- ctx->Driver.Enable = savageDDEnable_s4;
- ctx->Driver.AlphaFunc = savageDDAlphaFunc_s4;
- ctx->Driver.DepthFunc = savageDDDepthFunc_s4;
- ctx->Driver.DepthMask = savageDDDepthMask_s4;
- ctx->Driver.BlendFuncSeparate = savageDDBlendFuncSeparate_s4;
- ctx->Driver.ColorMask = savageDDColorMask_s4;
- ctx->Driver.ShadeModel = savageDDShadeModel_s4;
- ctx->Driver.LightModelfv = savageDDLightModelfv_s4;
- ctx->Driver.StencilFunc = savageDDStencilFunc;
- ctx->Driver.StencilMask = savageDDStencilMask;
- ctx->Driver.StencilOp = savageDDStencilOp;
- } else {
- ctx->Driver.Enable = savageDDEnable_s3d;
- ctx->Driver.AlphaFunc = savageDDAlphaFunc_s3d;
- ctx->Driver.DepthFunc = savageDDDepthFunc_s3d;
- ctx->Driver.DepthMask = savageDDDepthMask_s3d;
- ctx->Driver.BlendFuncSeparate = savageDDBlendFuncSeparate_s3d;
- ctx->Driver.ColorMask = savageDDColorMask_s3d;
- ctx->Driver.ShadeModel = savageDDShadeModel_s3d;
- ctx->Driver.LightModelfv = savageDDLightModelfv_s3d;
- ctx->Driver.StencilFunc = 0;
- ctx->Driver.StencilMask = 0;
- ctx->Driver.StencilOp = 0;
- }
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.h
deleted file mode 100644
index 5fe718d7a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagestate.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef _SAVAGE_STATE_H
-#define _SAVAGE_STATE_H
-
-#include "savagecontext.h"
-
-void savageCalcViewport( GLcontext *ctx );
-void savageEmitOldState( savageContextPtr imesa );
-void savageEmitChangedState( savageContextPtr imesa );
-
-extern void savageDDUpdateHwState( GLcontext *ctx );
-extern void savageDDInitState( savageContextPtr imesa );
-extern void savageDDInitStateFuncs( GLcontext *ctx );
-extern void savageDDRenderStart(GLcontext *ctx);
-extern void savageDDRenderEnd(GLcontext *ctx);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.c
deleted file mode 100644
index ce9d1def8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.c
+++ /dev/null
@@ -1,2133 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <GL/gl.h>
-
-#include "mm.h"
-#include "savagecontext.h"
-#include "savagetex.h"
-#include "savagetris.h"
-#include "savageioctl.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "savage_bci.h"
-
-#include "macros.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "texobj.h"
-
-#include "convolve.h"
-#include "colormac.h"
-
-#include "swrast/swrast.h"
-
-#include "xmlpool.h"
-
-#define TILE_INDEX_DXT1 0
-#define TILE_INDEX_8 1
-#define TILE_INDEX_16 2
-#define TILE_INDEX_DXTn 3
-#define TILE_INDEX_32 4
-
-/* On Savage4 the texure LOD-bias needs an offset of ~ 0.3 to get
- * somewhere close to software rendering.
- */
-#define SAVAGE4_LOD_OFFSET 10
-
-/* Tile info for S3TC formats counts in 4x4 blocks instead of texels.
- * In DXT1 each block is encoded in 64 bits. In DXT3 and 5 each block is
- * encoded in 128 bits. */
-
-/* Size 1, 2 and 4 images are packed into the last subtile. Each image
- * is repeated to fill a 4x4 pixel area. The figure below shows the
- * layout of those 4x4 pixel areas in the 8x8 subtile.
- *
- * 4 2
- * x 1
- *
- * Yuck! 8-bit texture formats use 4x8 subtiles. See below.
- */
-static const savageTileInfo tileInfo_pro[5] = {
- {16, 16, 16, 8, 1, 2, {0x18, 0x10}}, /* DXT1 */
- {64, 32, 16, 4, 4, 8, {0x30, 0x20}}, /* 8-bit */
- {64, 16, 8, 2, 8, 8, {0x48, 0x08}}, /* 16-bit */
- {16, 8, 16, 4, 1, 2, {0x30, 0x20}}, /* DXT3, DXT5 */
- {32, 16, 4, 2, 8, 8, {0x90, 0x10}}, /* 32-bit */
-};
-
-/* Size 1, 2 and 4 images are packed into the last two subtiles. Each
- * image is repeated to fill a 4x4 pixel area. The figures below show
- * the layout of those 4x4 pixel areas in the two 4x8 subtiles.
- *
- * second last subtile: 4 last subtile: 2
- * x 1
- */
-static const savageTileInfo tileInfo_s3d_s4[5] = {
- {16, 16, 16, 8, 1, 2, {0x18, 0x10}}, /* DXT1 */
- {64, 32, 16, 4, 4, 8, {0x30, 0x20}}, /* 8-bit */
- {64, 16, 16, 2, 4, 8, {0x60, 0x40}}, /* 16-bit */
- {16, 8, 16, 4, 1, 2, {0x30, 0x20}}, /* DXT3, DXT5 */
- {32, 16, 8, 2, 4, 8, {0xc0, 0x80}}, /* 32-bit */
-};
-
-/** \brief Template for subtile uploads.
- * \param h height in pixels
- * \param w width in bytes
- */
-#define SUBTILE_FUNC(w,h) \
-static __inline GLubyte *savageUploadSubtile_##w##x##h \
-(GLubyte *dest, GLubyte *src, GLuint srcStride) \
-{ \
- GLuint y; \
- for (y = 0; y < h; ++y) { \
- memcpy (dest, src, w); \
- src += srcStride; \
- dest += w; \
- } \
- return dest; \
-}
-
-SUBTILE_FUNC(2, 8) /* 4 bits per pixel, 4 pixels wide */
-SUBTILE_FUNC(4, 8)
-SUBTILE_FUNC(8, 8)
-SUBTILE_FUNC(16, 8)
-SUBTILE_FUNC(32, 8) /* 4 bytes per pixel, 8 pixels wide */
-
-SUBTILE_FUNC(8, 2) /* DXT1 */
-SUBTILE_FUNC(16, 2) /* DXT3 and DXT5 */
-
-/** \brief Upload a complete tile from src (srcStride) to dest
- *
- * \param tileInfo Pointer to tiling information
- * \param wInSub Width of source/dest image in subtiles
- * \param hInSub Height of source/dest image in subtiles
- * \param bpp Bytes per pixel
- * \param src Pointer to source data
- * \param srcStride Byte stride of rows in the source data
- * \param dest Pointer to destination
- *
- * Writes linearly to the destination memory in order to exploit write
- * combining.
- *
- * For a complete tile wInSub and hInSub are set to the same values as
- * in tileInfo. If the source image is smaller than a whole tile in
- * one or both dimensions then they are set to the values of the
- * source image. This only works as long as the source image is bigger
- * than 8x8 pixels.
- */
-static void savageUploadTile (const savageTileInfo *tileInfo,
- GLuint wInSub, GLuint hInSub, GLuint bpp,
- GLubyte *src, GLuint srcStride, GLubyte *dest) {
- GLuint subStride = tileInfo->subWidth * bpp;
- GLubyte *srcSRow = src, *srcSTile = src;
- GLubyte *(*subtileFunc) (GLubyte *, GLubyte *, GLuint);
- GLuint sx, sy;
- switch (subStride) {
- case 2: subtileFunc = savageUploadSubtile_2x8; break;
- case 4: subtileFunc = savageUploadSubtile_4x8; break;
- case 8: subtileFunc = tileInfo->subHeight == 8 ?
- savageUploadSubtile_8x8 : savageUploadSubtile_8x2; break;
- case 16: subtileFunc = tileInfo->subHeight == 8 ?
- savageUploadSubtile_16x8 : savageUploadSubtile_16x2; break;
- case 32: subtileFunc = savageUploadSubtile_32x8; break;
- default: assert(0);
- }
- for (sy = 0; sy < hInSub; ++sy) {
- srcSTile = srcSRow;
- for (sx = 0; sx < wInSub; ++sx) {
- src = srcSTile;
- dest = subtileFunc (dest, src, srcStride);
- srcSTile += subStride;
- }
- srcSRow += srcStride * tileInfo->subHeight;
- }
-}
-
-/** \brief Upload a image that is smaller than 8 pixels in either dimension.
- *
- * \param tileInfo Pointer to tiling information
- * \param width Width of the image
- * \param height Height of the image
- * \param bpp Bytes per pixel
- * \param src Pointer to source data
- * \param dest Pointer to destination
- *
- * This function handles all the special cases that need to be taken
- * care off. The caller may need to call this function multiple times
- * with the destination offset in different ways since small texture
- * images must be repeated in order to fill a whole tile (or 4x4 for
- * the last 3 levels).
- *
- * FIXME: Repeating inside this function would be more efficient.
- */
-static void savageUploadTiny (const savageTileInfo *tileInfo,
- GLuint pixWidth, GLuint pixHeight,
- GLuint width, GLuint height, GLuint bpp,
- GLubyte *src, GLubyte *dest) {
- GLuint size = MAX2(pixWidth, pixHeight);
-
- if (width > tileInfo->subWidth) { /* assert: height <= subtile height */
- GLuint wInSub = width / tileInfo->subWidth;
- GLuint srcStride = width * bpp;
- GLuint subStride = tileInfo->subWidth * bpp;
- GLuint subSkip = (tileInfo->subHeight - height) * subStride;
- GLubyte *srcSTile = src;
- GLuint sx, y;
- for (sx = 0; sx < wInSub; ++sx) {
- src = srcSTile;
- for (y = 0; y < height; ++y) {
- memcpy (dest, src, subStride);
- src += srcStride;
- dest += subStride;
- }
- dest += subSkip;
- srcSTile += subStride;
- }
- } else if (size > 4) { /* a tile or less wide, except the last 3 levels */
- GLuint srcStride = width * bpp;
- GLuint subStride = tileInfo->subWidth * bpp;
- /* if the subtile width is 4 we have to skip every other subtile */
- GLuint subSkip = tileInfo->subWidth <= 4 ?
- subStride * tileInfo->subHeight : 0;
- GLuint skipRemainder = tileInfo->subHeight - 1;
- GLuint y;
- for (y = 0; y < height; ++y) {
- memcpy (dest, src, srcStride);
- src += srcStride;
- dest += subStride;
- if ((y & skipRemainder) == skipRemainder)
- dest += subSkip;
- }
- } else { /* the last 3 mipmap levels */
- GLuint offset = (size <= 2 ? tileInfo->tinyOffset[size-1] : 0);
- GLuint subStride = tileInfo->subWidth * bpp;
- GLuint y;
- dest += offset;
- for (y = 0; y < height; ++y) {
- memcpy (dest, src, bpp*width);
- src += width * bpp;
- dest += subStride;
- }
- }
-}
-
-/** \brief Upload an image from mesa's internal copy.
- */
-static void savageUploadTexLevel( savageTexObjPtr t, int level )
-{
- const struct gl_texture_image *image = t->base.tObj->Image[0][level];
- const savageTileInfo *tileInfo = t->tileInfo;
- GLuint pixWidth = image->Width2, pixHeight = image->Height2;
- GLuint bpp = t->texelBytes;
- GLuint width, height;
-
- /* FIXME: Need triangle (rather than pixel) fallbacks to simulate
- * this using normal textured triangles.
- *
- * DO THIS IN DRIVER STATE MANAGMENT, not hardware state.
- */
- if(image->Border != 0)
- fprintf (stderr, "Not supported texture border %d.\n",
- (int) image->Border);
-
- if (t->hwFormat == TFT_S3TC4A4Bit || t->hwFormat == TFT_S3TC4CA4Bit ||
- t->hwFormat == TFT_S3TC4Bit) {
- width = (pixWidth+3) / 4;
- height = (pixHeight+3) / 4;
- } else {
- width = pixWidth;
- height = pixHeight;
- }
-
- if (pixWidth >= 8 && pixHeight >= 8) {
- GLuint *dirtyPtr = t->image[level].dirtyTiles;
- GLuint dirtyMask = 1;
-
- if (width >= tileInfo->width && height >= tileInfo->height) {
- GLuint wInTiles = width / tileInfo->width;
- GLuint hInTiles = height / tileInfo->height;
- GLubyte *srcTRow = image->Data, *src;
- GLubyte *dest = (GLubyte *)(t->bufAddr + t->image[level].offset);
- GLuint x, y;
- for (y = 0; y < hInTiles; ++y) {
- src = srcTRow;
- for (x = 0; x < wInTiles; ++x) {
- if (*dirtyPtr & dirtyMask) {
- savageUploadTile (tileInfo,
- tileInfo->wInSub, tileInfo->hInSub,
- bpp, src, width * bpp, dest);
- }
- src += tileInfo->width * bpp;
- dest += 2048; /* tile size is always 2k */
- if (dirtyMask == 1<<31) {
- dirtyMask = 1;
- dirtyPtr++;
- } else
- dirtyMask <<= 1;
- }
- srcTRow += width * tileInfo->height * bpp;
- }
- } else if (width >= tileInfo->width) {
- GLuint wInTiles = width / tileInfo->width;
- GLubyte *src = image->Data;
- GLubyte *dest = (GLubyte *)(t->bufAddr + t->image[level].offset);
- GLuint tileStride = tileInfo->width * bpp * height;
- savageContextPtr imesa = (savageContextPtr)t->base.heap->driverContext;
- GLuint x;
- /* Savage3D-based chips seem so use a constant tile stride
- * of 2048 for vertically incomplete tiles, but only if
- * the color depth is 32bpp. Nobody said this was supposed
- * to be logical!
- */
- if (bpp == 4 && imesa->savageScreen->chipset < S3_SAVAGE4)
- tileStride = 2048;
- for (x = 0; x < wInTiles; ++x) {
- if (*dirtyPtr & dirtyMask) {
- savageUploadTile (tileInfo,
- tileInfo->wInSub,
- height / tileInfo->subHeight,
- bpp, src, width * bpp, dest);
- }
- src += tileInfo->width * bpp;
- dest += tileStride;
- if (dirtyMask == 1<<31) {
- dirtyMask = 1;
- dirtyPtr++;
- } else
- dirtyMask <<= 1;
- }
- } else {
- savageUploadTile (tileInfo, width / tileInfo->subWidth,
- height / tileInfo->subHeight, bpp,
- image->Data, width * bpp,
- (GLubyte *)(t->bufAddr+t->image[level].offset));
- }
- } else {
- GLuint minHeight, minWidth, hRepeat, vRepeat, x, y;
- if (t->hwFormat == TFT_S3TC4A4Bit || t->hwFormat == TFT_S3TC4CA4Bit ||
- t->hwFormat == TFT_S3TC4Bit)
- minWidth = minHeight = 1;
- else
- minWidth = minHeight = 4;
- if (width > minWidth || height > minHeight) {
- minWidth = tileInfo->subWidth;
- minHeight = tileInfo->subHeight;
- }
- hRepeat = width >= minWidth ? 1 : minWidth / width;
- vRepeat = height >= minHeight ? 1 : minHeight / height;
- for (y = 0; y < vRepeat; ++y) {
- GLuint offset = y * tileInfo->subWidth*height * bpp;
- for (x = 0; x < hRepeat; ++x) {
- savageUploadTiny (tileInfo, pixWidth, pixHeight,
- width, height, bpp, image->Data,
- (GLubyte *)(t->bufAddr +
- t->image[level].offset+offset));
- offset += width * bpp;
- }
- }
- }
-}
-
-/** \brief Compute the destination size of a texture image
- */
-static GLuint savageTexImageSize (GLuint width, GLuint height, GLuint bpp) {
- /* full subtiles */
- if (width >= 8 && height >= 8)
- return width * height * bpp;
- /* special case for the last three mipmap levels: the hardware computes
- * the offset internally */
- else if (width <= 4 && height <= 4)
- return 0;
- /* partially filled sub tiles waste memory
- * on Savage3D and Savage4 with subtile width 4 every other subtile is
- * skipped if width < 8 so we can assume a uniform subtile width of 8 */
- else if (width >= 8)
- return width * 8 * bpp;
- else if (height >= 8)
- return 8 * height * bpp;
- else
- return 64 * bpp;
-}
-
-/** \brief Compute the destination size of a compressed texture image
- */
-static GLuint savageCompressedTexImageSize (GLuint width, GLuint height,
- GLuint bpp) {
- width = (width+3) / 4;
- height = (height+3) / 4;
- /* full subtiles */
- if (width >= 2 && height >= 2)
- return width * height * bpp;
- /* special case for the last three mipmap levels: the hardware computes
- * the offset internally */
- else if (width <= 1 && height <= 1)
- return 0;
- /* partially filled sub tiles waste memory
- * on Savage3D and Savage4 with subtile width 4 every other subtile is
- * skipped if width < 8 so we can assume a uniform subtile width of 8 */
- else if (width >= 2)
- return width * 2 * bpp;
- else if (height >= 2)
- return 2 * height * bpp;
- else
- return 4 * bpp;
-}
-
-/** \brief Compute the number of (partial) tiles of a texture image
- */
-static GLuint savageTexImageTiles (GLuint width, GLuint height,
- const savageTileInfo *tileInfo)
-{
- return (width + tileInfo->width - 1) / tileInfo->width *
- (height + tileInfo->height - 1) / tileInfo->height;
-}
-
-/** \brief Mark dirty tiles
- *
- * Some care must be taken because tileInfo may not be set or not
- * up-to-date. So we check if tileInfo is initialized and if the number
- * of tiles in the bit vector matches the number of tiles computed from
- * the current tileInfo.
- */
-static void savageMarkDirtyTiles (savageTexObjPtr t, GLuint level,
- GLuint totalWidth, GLuint totalHeight,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height)
-{
- GLuint wInTiles, hInTiles;
- GLuint x0, y0, x1, y1;
- GLuint x, y;
- if (!t->tileInfo)
- return;
- wInTiles = (totalWidth + t->tileInfo->width - 1) / t->tileInfo->width;
- hInTiles = (totalHeight + t->tileInfo->height - 1) / t->tileInfo->height;
- if (wInTiles * hInTiles != t->image[level].nTiles)
- return;
-
- x0 = xoffset / t->tileInfo->width;
- y0 = yoffset / t->tileInfo->height;
- x1 = (xoffset + width - 1) / t->tileInfo->width;
- y1 = (yoffset + height - 1) / t->tileInfo->height;
-
- for (y = y0; y <= y1; ++y) {
- GLuint *ptr = t->image[level].dirtyTiles + (y * wInTiles + x0) / 32;
- GLuint mask = 1 << (y * wInTiles + x0) % 32;
- for (x = x0; x <= x1; ++x) {
- *ptr |= mask;
- if (mask == (1<<31)) {
- ptr++;
- mask = 1;
- } else {
- mask <<= 1;
- }
- }
- }
-}
-
-/** \brief Mark all tiles as dirty
- */
-static void savageMarkAllTiles (savageTexObjPtr t, GLuint level)
-{
- GLuint words = (t->image[level].nTiles + 31) / 32;
- if (words)
- memset(t->image[level].dirtyTiles, ~0, words*sizeof(GLuint));
-}
-
-
-static void savageSetTexWrapping(savageTexObjPtr tex, GLenum s, GLenum t)
-{
- tex->setup.sWrapMode = s;
- tex->setup.tWrapMode = t;
-}
-
-static void savageSetTexFilter(savageTexObjPtr t, GLenum minf, GLenum magf)
-{
- t->setup.minFilter = minf;
- t->setup.magFilter = magf;
-}
-
-
-/* Need a fallback ?
- */
-static void savageSetTexBorderColor(savageTexObjPtr t, GLubyte color[4])
-{
-/* t->Setup[SAVAGE_TEXREG_TEXBORDERCOL] = */
- /*t->setup.borderColor = SAVAGEPACKCOLOR8888(color[0],color[1],color[2],color[3]); */
-}
-
-
-
-static savageTexObjPtr
-savageAllocTexObj( struct gl_texture_object *texObj )
-{
- savageTexObjPtr t;
-
- t = (savageTexObjPtr) calloc(1,sizeof(*t));
- texObj->DriverData = t;
- if ( t != NULL ) {
- GLuint i;
-
- /* Initialize non-image-dependent parts of the state:
- */
- t->base.tObj = texObj;
- t->base.dirty_images[0] = 0;
- t->dirtySubImages = 0;
- t->tileInfo = NULL;
-
- /* Initialize dirty tiles bit vectors
- */
- for (i = 0; i < SAVAGE_TEX_MAXLEVELS; ++i)
- t->image[i].nTiles = 0;
-
- /* FIXME Something here to set initial values for other parts of
- * FIXME t->setup?
- */
-
- make_empty_list( &t->base );
-
- savageSetTexWrapping(t,texObj->WrapS,texObj->WrapT);
- savageSetTexFilter(t,texObj->MinFilter,texObj->MagFilter);
- savageSetTexBorderColor(t,texObj->_BorderChan);
- }
-
- return t;
-}
-
-/* Mesa texture formats for alpha-images on Savage3D/IX/MX
- *
- * Promoting texture images to ARGB888 or ARGB4444 doesn't work
- * because we can't tell the hardware to ignore the color components
- * and only use the alpha component. So we define our own texture
- * formats that promote to ARGB8888 or ARGB4444 and set the color
- * components to white. This way we get the correct result. */
-static GLboolean
-_savage_texstore_a1114444 (GLcontext *ctx, GLuint dims,
- GLenum baseInternalFormat,
- const struct gl_texture_format *dstFormat,
- GLvoid *dstAddr,
- GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
- GLint dstRowStride, GLint dstImageStride,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking);
-static GLboolean
-_savage_texstore_a1118888 (GLcontext *ctx, GLuint dims,
- GLenum baseInternalFormat,
- const struct gl_texture_format *dstFormat,
- GLvoid *dstAddr,
- GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
- GLint dstRowStride, GLint dstImageStride,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking);
-
-static struct gl_texture_format _savage_texformat_a1114444 = {
- MESA_FORMAT_ARGB4444, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 4, /* RedBits */
- 4, /* GreenBits */
- 4, /* BlueBits */
- 4, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 2, /* TexelBytes */
- _savage_texstore_a1114444, /* StoreTexImageFunc */
- NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by
- * savageDDInitTextureFuncs */
-};
-static struct gl_texture_format _savage_texformat_a1118888 = {
- MESA_FORMAT_ARGB8888, /* MesaFormat */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED_ARB, /* DataType */
- 8, /* RedBits */
- 8, /* GreenBits */
- 8, /* BlueBits */
- 8, /* AlphaBits */
- 0, /* LuminanceBits */
- 0, /* IntensityBits */
- 0, /* IndexBits */
- 0, /* DepthBits */
- 4, /* TexelBytes */
- _savage_texstore_a1118888, /* StoreTexImageFunc */
- NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by
- * savageDDInitTextureFuncs */
-};
-
-static GLboolean
-_savage_texstore_a1114444 (GLcontext *ctx, GLuint dims,
- GLenum baseInternalFormat,
- const struct gl_texture_format *dstFormat,
- GLvoid *dstAddr,
- GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
- GLint dstRowStride, GLint dstImageStride,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking)
-{
- /* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- baseInternalFormat,
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- const GLchan *src = tempImage;
- GLubyte *dstImage = (GLubyte *) dstAddr
- + dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
- + dstXoffset * dstFormat->TexelBytes;
- GLint img, row, col;
-
- ASSERT(dstFormat == &_savage_texformat_a1114444);
- ASSERT(baseInternalFormat == GL_ALPHA);
-
- if (!tempImage)
- return GL_FALSE;
- _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
- for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = dstImage;
- for (row = 0; row < srcHeight; row++) {
- GLushort *dstUI = (GLushort *) dstRow;
- for (col = 0; col < srcWidth; col++) {
- dstUI[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[0]),
- 255, 255, 255 );
- src += 1;
- }
- dstRow += dstRowStride;
- }
- dstImage += dstImageStride;
- }
- _mesa_free((void *) tempImage);
-
- return GL_TRUE;
-}
-static GLboolean
-_savage_texstore_a1118888 (GLcontext *ctx, GLuint dims,
- GLenum baseInternalFormat,
- const struct gl_texture_format *dstFormat,
- GLvoid *dstAddr,
- GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
- GLint dstRowStride, GLint dstImageStride,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking)
-{
- /* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- baseInternalFormat,
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- const GLchan *src = tempImage;
- GLubyte *dstImage = (GLubyte *) dstAddr
- + dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
- + dstXoffset * dstFormat->TexelBytes;
- GLint img, row, col;
-
- ASSERT(dstFormat == &_savage_texformat_a1118888);
- ASSERT(baseInternalFormat == GL_ALPHA);
-
- if (!tempImage)
- return GL_FALSE;
- _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
- for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = dstImage;
- for (row = 0; row < srcHeight; row++) {
- GLuint *dstUI = (GLuint *) dstRow;
- for (col = 0; col < srcWidth; col++) {
- dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[0]),
- 255, 255, 255 );
- src += 1;
- }
- dstRow += dstRowStride;
- }
- dstImage += dstImageStride;
- }
- _mesa_free((void *) tempImage);
-
- return GL_TRUE;
-}
-
-/* Called by the _mesa_store_teximage[123]d() functions. */
-static const struct gl_texture_format *
-savageChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- const GLboolean do32bpt =
- ( imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 );
- const GLboolean force16bpt =
- ( imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 );
- const GLboolean isSavage4 = (imesa->savageScreen->chipset >= S3_SAVAGE4);
- (void) format;
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- switch ( type ) {
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return &_mesa_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return &_mesa_texformat_argb1555;
- default:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
- }
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- switch ( type ) {
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return &_mesa_texformat_argb4444;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return &_mesa_texformat_argb1555;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- return &_mesa_texformat_rgb565;
- default:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
- }
-
- case GL_RGBA8:
- case GL_RGBA12:
- case GL_RGBA16:
- return !force16bpt ?
- &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case GL_RGB10_A2:
- return !force16bpt ?
- &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_COMPRESSED_ALPHA:
- return isSavage4 ? &_mesa_texformat_a8 : (
- do32bpt ? &_savage_texformat_a1118888 : &_savage_texformat_a1114444);
- case GL_ALPHA4:
- return isSavage4 ? &_mesa_texformat_a8 : &_savage_texformat_a1114444;
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return isSavage4 ? &_mesa_texformat_a8 : (
- !force16bpt ? &_savage_texformat_a1118888 : &_savage_texformat_a1114444);
-
- case 1:
- case GL_LUMINANCE:
- case GL_COMPRESSED_LUMINANCE:
- /* no alpha, but use argb1555 in 16bit case to get pure grey values */
- return isSavage4 ? &_mesa_texformat_l8 : (
- do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555);
- case GL_LUMINANCE4:
- return isSavage4 ? &_mesa_texformat_l8 : &_mesa_texformat_argb1555;
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return isSavage4 ? &_mesa_texformat_l8 : (
- !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555);
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- /* Savage4 has a al44 texture format. But it's not supported by Mesa. */
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- return &_mesa_texformat_argb4444;
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-#if 0
- /* TFT_I8 produces garbage on ProSavageDDR and subsequent texture
- * disable keeps rendering garbage. Disabled for now. */
- case GL_INTENSITY:
- case GL_COMPRESSED_INTENSITY:
- return isSavage4 ? &_mesa_texformat_i8 : (
- do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444);
- case GL_INTENSITY4:
- return isSavage4 ? &_mesa_texformat_i8 : &_mesa_texformat_argb4444;
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return isSavage4 ? &_mesa_texformat_i8 : (
- !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444);
-#else
- case GL_INTENSITY:
- case GL_COMPRESSED_INTENSITY:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
- case GL_INTENSITY4:
- return &_mesa_texformat_argb4444;
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return !force16bpt ? &_mesa_texformat_argb8888 :
- &_mesa_texformat_argb4444;
-#endif
-
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
-
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- if (!isSavage4)
- /* Not the best choice but Savage3D/MX/IX don't support DXT3 or DXT5. */
- return &_mesa_texformat_rgba_dxt1;
- /* fall through */
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
-
-/*
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
-*/
- default:
- _mesa_problem(ctx, "unexpected texture format in %s", __FUNCTION__);
- return NULL;
- }
-}
-
-static void savageSetTexImages( savageContextPtr imesa,
- const struct gl_texture_object *tObj )
-{
- savageTexObjPtr t = (savageTexObjPtr) tObj->DriverData;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
- GLuint offset, i, textureFormat, tileIndex, size;
- GLint firstLevel, lastLevel;
-
- assert(t);
- assert(image);
-
- switch (image->TexFormat->MesaFormat) {
- case MESA_FORMAT_ARGB8888:
- textureFormat = TFT_ARGB8888;
- t->texelBytes = tileIndex = 4;
- break;
- case MESA_FORMAT_ARGB1555:
- textureFormat = TFT_ARGB1555;
- t->texelBytes = tileIndex = 2;
- break;
- case MESA_FORMAT_ARGB4444:
- textureFormat = TFT_ARGB4444;
- t->texelBytes = tileIndex = 2;
- break;
- case MESA_FORMAT_RGB565:
- textureFormat = TFT_RGB565;
- t->texelBytes = tileIndex = 2;
- break;
- case MESA_FORMAT_L8:
- textureFormat = TFT_L8;
- t->texelBytes = tileIndex = 1;
- break;
- case MESA_FORMAT_I8:
- textureFormat = TFT_I8;
- t->texelBytes = tileIndex = 1;
- break;
- case MESA_FORMAT_A8:
- textureFormat = TFT_A8;
- t->texelBytes = tileIndex = 1;
- break;
- case MESA_FORMAT_RGB_DXT1:
- textureFormat = TFT_S3TC4Bit;
- tileIndex = TILE_INDEX_DXT1;
- t->texelBytes = 8;
- break;
- case MESA_FORMAT_RGBA_DXT1:
- textureFormat = TFT_S3TC4Bit;
- tileIndex = TILE_INDEX_DXT1;
- t->texelBytes = 8;
- break;
- case MESA_FORMAT_RGBA_DXT3:
- textureFormat = TFT_S3TC4A4Bit;
- tileIndex = TILE_INDEX_DXTn;
- t->texelBytes = 16;
- break;
- case MESA_FORMAT_RGBA_DXT5:
- textureFormat = TFT_S3TC4CA4Bit;
- tileIndex = TILE_INDEX_DXTn;
- t->texelBytes = 16;
- break;
- default:
- _mesa_problem(imesa->glCtx, "Bad texture format in %s", __FUNCTION__);
- return;
- }
- t->hwFormat = textureFormat;
-
- /* Select tiling format depending on the chipset and texture format */
- if (imesa->savageScreen->chipset <= S3_SAVAGE4)
- t->tileInfo = &tileInfo_s3d_s4[tileIndex];
- else
- t->tileInfo = &tileInfo_pro[tileIndex];
-
- /* Compute which mipmap levels we really want to send to the hardware.
- */
- driCalculateTextureFirstLastLevel( &t->base );
- firstLevel = t->base.firstLevel;
- lastLevel = t->base.lastLevel;
-
- /* Figure out the size now (and count the levels). Upload won't be
- * done until later. If the number of tiles changes, it means that
- * this function is called for the first time on this tex object or
- * the image or the destination color format changed. So all tiles
- * are marked as dirty.
- */
- offset = 0;
- size = 1;
- for ( i = firstLevel ; i <= lastLevel && tObj->Image[0][i] ; i++ ) {
- GLuint nTiles;
- nTiles = savageTexImageTiles (image->Width2, image->Height2, t->tileInfo);
- if (t->image[i].nTiles != nTiles) {
- GLuint words = (nTiles + 31) / 32;
- if (t->image[i].nTiles != 0) {
- free(t->image[i].dirtyTiles);
- }
- t->image[i].dirtyTiles = malloc(words*sizeof(GLuint));
- memset(t->image[i].dirtyTiles, ~0, words*sizeof(GLuint));
- }
- t->image[i].nTiles = nTiles;
-
- t->image[i].offset = offset;
-
- image = tObj->Image[0][i];
- if (t->texelBytes >= 8)
- size = savageCompressedTexImageSize (image->Width2, image->Height2,
- t->texelBytes);
- else
- size = savageTexImageSize (image->Width2, image->Height2,
- t->texelBytes);
- offset += size;
- }
-
- t->base.lastLevel = i-1;
- t->base.totalSize = offset;
- /* the last three mipmap levels don't add to the offset. They are packed
- * into 64 pixels. */
- if (size == 0)
- t->base.totalSize += (t->texelBytes >= 8 ? 4 : 64) * t->texelBytes;
- /* 2k-aligned (really needed?) */
- t->base.totalSize = (t->base.totalSize + 2047UL) & ~2047UL;
-}
-
-void savageDestroyTexObj(savageContextPtr imesa, savageTexObjPtr t)
-{
- GLuint i;
-
- /* Free dirty tiles bit vectors */
- for (i = 0; i < SAVAGE_TEX_MAXLEVELS; ++i) {
- if (t->image[i].nTiles)
- free (t->image[i].dirtyTiles);
- }
-
- /* See if it was the driver's current object.
- */
- if ( imesa != NULL )
- {
- for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ )
- {
- if ( &t->base == imesa->CurrentTexObj[ i ] ) {
- assert( t->base.bound & (1 << i) );
- imesa->CurrentTexObj[ i ] = NULL;
- }
- }
- }
-}
-
-/* Upload a texture's images to one of the texture heaps. May have to
- * eject our own and/or other client's texture objects to make room
- * for the upload.
- */
-static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t )
-{
- const GLint numLevels = t->base.lastLevel - t->base.firstLevel + 1;
- GLuint i;
-
- assert(t);
-
- LOCK_HARDWARE(imesa);
-
- /* Do we need to eject LRU texture objects?
- */
- if (!t->base.memBlock) {
- GLint heap;
- GLuint ofs;
-
- heap = driAllocateTexture(imesa->textureHeaps, imesa->lastTexHeap,
- (driTextureObject *)t);
- if (heap == -1) {
- UNLOCK_HARDWARE(imesa);
- return;
- }
-
- ofs = t->base.memBlock->ofs;
- t->setup.physAddr = imesa->savageScreen->textureOffset[heap] + ofs;
- t->bufAddr = (GLubyte *)imesa->savageScreen->texVirtual[heap] + ofs;
- imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; /* FIXME: really needed? */
- }
-
- /* Let the world know we've used this memory recently.
- */
- driUpdateTextureLRU( &t->base );
- UNLOCK_HARDWARE(imesa);
-
- if (t->base.dirty_images[0] || t->dirtySubImages) {
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_TEX)
- fprintf(stderr, "Texture upload: |");
-
- /* Heap timestamps are only reliable with Savage DRM 2.3.x or
- * later. Earlier versions had only 16 bit time stamps which
- * would wrap too frequently. */
- if (imesa->savageScreen->driScrnPriv->drmMinor >= 3) {
- unsigned int heap = t->base.heap->heapId;
- LOCK_HARDWARE(imesa);
- savageWaitEvent (imesa, imesa->textureHeaps[heap]->timestamp);
- } else {
- savageFlushVertices (imesa);
- LOCK_HARDWARE(imesa);
- savageFlushCmdBufLocked (imesa, GL_FALSE);
- WAIT_IDLE_EMPTY_LOCKED(imesa);
- }
-
- for (i = 0 ; i < numLevels ; i++) {
- const GLint j = t->base.firstLevel + i; /* the texObj's level */
- if (t->base.dirty_images[0] & (1 << j)) {
- savageMarkAllTiles(t, j);
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_TEX)
- fprintf (stderr, "*");
- } else if (SAVAGE_DEBUG & DEBUG_VERBOSE_TEX) {
- if (t->dirtySubImages & (1 << j))
- fprintf (stderr, ".");
- else
- fprintf (stderr, " ");
- }
- if ((t->base.dirty_images[0] | t->dirtySubImages) & (1 << j))
- savageUploadTexLevel( t, j );
- }
-
- UNLOCK_HARDWARE(imesa);
- t->base.dirty_images[0] = 0;
- t->dirtySubImages = 0;
-
- if (SAVAGE_DEBUG & DEBUG_VERBOSE_TEX)
- fprintf(stderr, "|\n");
- }
-}
-
-
-static void
-savage4_set_wrap_mode( savageContextPtr imesa, unsigned unit,
- GLenum s_mode, GLenum t_mode )
-{
- switch( s_mode ) {
- case GL_REPEAT:
- imesa->regs.s4.texCtrl[ unit ].ni.uMode = TAM_Wrap;
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- imesa->regs.s4.texCtrl[ unit ].ni.uMode = TAM_Clamp;
- break;
- case GL_MIRRORED_REPEAT:
- imesa->regs.s4.texCtrl[ unit ].ni.uMode = TAM_Mirror;
- break;
- }
-
- switch( t_mode ) {
- case GL_REPEAT:
- imesa->regs.s4.texCtrl[ unit ].ni.vMode = TAM_Wrap;
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- imesa->regs.s4.texCtrl[ unit ].ni.vMode = TAM_Clamp;
- break;
- case GL_MIRRORED_REPEAT:
- imesa->regs.s4.texCtrl[ unit ].ni.vMode = TAM_Mirror;
- break;
- }
-}
-
-
-/**
- * Sets the hardware bits for the specified GL texture filter modes.
- *
- * \todo
- * Does the Savage4 have the ability to select the magnification filter?
- */
-static void
-savage4_set_filter_mode( savageContextPtr imesa, unsigned unit,
- GLenum minFilter, GLenum magFilter )
-{
- (void) magFilter;
-
- switch (minFilter) {
- case GL_NEAREST:
- imesa->regs.s4.texCtrl[ unit ].ni.filterMode = TFM_Point;
- imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_FALSE;
- break;
-
- case GL_LINEAR:
- imesa->regs.s4.texCtrl[ unit ].ni.filterMode = TFM_Bilin;
- imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_FALSE;
- break;
-
- case GL_NEAREST_MIPMAP_NEAREST:
- imesa->regs.s4.texCtrl[ unit ].ni.filterMode = TFM_Point;
- imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_TRUE;
- break;
-
- case GL_LINEAR_MIPMAP_NEAREST:
- imesa->regs.s4.texCtrl[ unit ].ni.filterMode = TFM_Bilin;
- imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_TRUE;
- break;
-
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- imesa->regs.s4.texCtrl[ unit ].ni.filterMode = TFM_Trilin;
- imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_TRUE;
- break;
- }
-}
-
-
-static void savageUpdateTex0State_s4( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- struct gl_texture_object *tObj;
- struct gl_texture_image *image;
- savageTexObjPtr t;
- GLuint format;
-
- /* disable */
- imesa->regs.s4.texDescr.ni.tex0En = GL_FALSE;
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_NoTexMap;
- imesa->regs.s4.texCtrl[0].ui = 0x20f040;
- if (ctx->Texture.Unit[0]._ReallyEnabled == 0)
- return;
-
- tObj = ctx->Texture.Unit[0]._Current;
- if ((ctx->Texture.Unit[0]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
- || tObj->Image[0][tObj->BaseLevel]->Border > 0) {
- /* 3D texturing enabled, or texture border - fallback */
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
- return;
- }
-
- /* Do 2D texture setup */
-
- t = tObj->DriverData;
- if (!t) {
- t = savageAllocTexObj( tObj );
- if (!t)
- return;
- }
-
- imesa->CurrentTexObj[0] = &t->base;
- t->base.bound |= 1;
-
- if (t->base.dirty_images[0] || t->dirtySubImages) {
- savageSetTexImages(imesa, tObj);
- savageUploadTexImages(imesa, t);
- }
-
- driUpdateTextureLRU( &t->base );
-
- format = tObj->Image[0][tObj->BaseLevel]->Format;
-
- switch (ctx->Texture.Unit[0].EnvMode) {
- case GL_REPLACE:
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_FALSE;
- switch(format)
- {
- case GL_LUMINANCE:
- case GL_RGB:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_Decal;
- break;
-
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- case GL_INTENSITY:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_Copy;
- break;
-
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_CopyAlpha;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 0,
- &imesa->regs.s4.texBlendCtrl[0]);
- break;
-
- case GL_DECAL:
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_FALSE;
- switch (format)
- {
- case GL_RGB:
- case GL_LUMINANCE:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_Decal;
- break;
-
- case GL_RGBA:
- case GL_INTENSITY:
- case GL_LUMINANCE_ALPHA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_DecalAlpha;
- break;
-
- /*
- GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_ALPHA, GL_INTENSITY
- are undefined with GL_DECAL
- */
-
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_CopyAlpha;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 0,
- &imesa->regs.s4.texBlendCtrl[0]);
- break;
-
- case GL_MODULATE:
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_FALSE;
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_ModulAlpha;
- __HWEnvCombineSingleUnitScale(imesa, 0, 0,
- &imesa->regs.s4.texBlendCtrl[0]);
- break;
-
- case GL_BLEND:
- imesa->regs.s4.texBlendColor.ui = imesa->texEnvColor;
-
- switch (format)
- {
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_ModulAlpha;
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_FALSE;
- break;
-
- case GL_LUMINANCE:
- case GL_RGB:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_Blend0;
- imesa->regs.s4.texDescr.ni.tex1En = GL_TRUE;
- imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE;
- imesa->regs.s4.texDescr.ni.tex1Width =
- imesa->regs.s4.texDescr.ni.tex0Width;
- imesa->regs.s4.texDescr.ni.tex1Height =
- imesa->regs.s4.texDescr.ni.tex0Height;
- imesa->regs.s4.texDescr.ni.tex1Fmt =
- imesa->regs.s4.texDescr.ni.tex0Fmt;
-
- imesa->regs.s4.texAddr[1].ui = imesa->regs.s4.texAddr[0].ui;
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_Blend1;
-
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_TRUE;
- imesa->bTexEn1 = GL_TRUE;
- break;
-
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_BlendAlpha0;
- imesa->regs.s4.texDescr.ni.tex1En = GL_TRUE;
- imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE;
- imesa->regs.s4.texDescr.ni.tex1Width =
- imesa->regs.s4.texDescr.ni.tex0Width;
- imesa->regs.s4.texDescr.ni.tex1Height =
- imesa->regs.s4.texDescr.ni.tex0Height;
- imesa->regs.s4.texDescr.ni.tex1Fmt =
- imesa->regs.s4.texDescr.ni.tex0Fmt;
-
- imesa->regs.s4.texAddr[1].ui = imesa->regs.s4.texAddr[0].ui;
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_BlendAlpha1;
-
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_TRUE;
- imesa->bTexEn1 = GL_TRUE;
- break;
-
- case GL_INTENSITY:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_BlendInt0;
- imesa->regs.s4.texDescr.ni.tex1En = GL_TRUE;
- imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE;
- imesa->regs.s4.texDescr.ni.tex1Width =
- imesa->regs.s4.texDescr.ni.tex0Width;
- imesa->regs.s4.texDescr.ni.tex1Height =
- imesa->regs.s4.texDescr.ni.tex0Height;
- imesa->regs.s4.texDescr.ni.tex1Fmt =
- imesa->regs.s4.texDescr.ni.tex0Fmt;
-
- imesa->regs.s4.texAddr[1].ui = imesa->regs.s4.texAddr[0].ui;
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_BlendInt1;
-
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_TRUE;
- imesa->regs.s4.texCtrl[0].ni.alphaArg1Invert = GL_TRUE;
- imesa->bTexEn1 = GL_TRUE;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 0,
- &imesa->regs.s4.texBlendCtrl[0]);
- break;
-
- case GL_ADD:
- imesa->regs.s4.texCtrl[0].ni.clrArg1Invert = GL_FALSE;
- switch (format)
- {
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_ModulAlpha;
- break;
-
- case GL_LUMINANCE:
- case GL_RGB:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_Add;
- break;
-
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_Add;
- break;
-
- case GL_INTENSITY:
- imesa->regs.s4.texBlendCtrl[0].ui = TBC_AddAlpha;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 0,
- &imesa->regs.s4.texBlendCtrl[0]);
- break;
-
-#if GL_ARB_texture_env_combine
- case GL_COMBINE_ARB:
- __HWParseTexEnvCombine(imesa, 0, &imesa->regs.s4.texCtrl[0],
- &imesa->regs.s4.texBlendCtrl[0]);
- break;
-#endif
-
- default:
- fprintf(stderr, "unknown tex env mode");
- exit(1);
- break;
- }
-
- savage4_set_wrap_mode( imesa, 0, t->setup.sWrapMode, t->setup.tWrapMode );
- savage4_set_filter_mode( imesa, 0, t->setup.minFilter, t->setup.magFilter );
-
- if((ctx->Texture.Unit[0].LodBias !=0.0F) ||
- (imesa->regs.s4.texCtrl[0].ni.dBias != 0))
- {
- int bias = (int)(ctx->Texture.Unit[0].LodBias * 32.0) +
- SAVAGE4_LOD_OFFSET;
- if (bias < -256)
- bias = -256;
- else if (bias > 255)
- bias = 255;
- imesa->regs.s4.texCtrl[0].ni.dBias = bias & 0x1ff;
- }
-
- image = tObj->Image[0][tObj->BaseLevel];
- imesa->regs.s4.texDescr.ni.tex0En = GL_TRUE;
- imesa->regs.s4.texDescr.ni.tex0Width = image->WidthLog2;
- imesa->regs.s4.texDescr.ni.tex0Height = image->HeightLog2;
- imesa->regs.s4.texDescr.ni.tex0Fmt = t->hwFormat;
- imesa->regs.s4.texCtrl[0].ni.dMax = t->base.lastLevel - t->base.firstLevel;
-
- if (imesa->regs.s4.texDescr.ni.tex1En)
- imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE;
-
- imesa->regs.s4.texAddr[0].ui = (u_int32_t) t->setup.physAddr | 0x2;
- if(t->base.heap->heapId == SAVAGE_AGP_HEAP)
- imesa->regs.s4.texAddr[0].ui |= 0x1;
-
- return;
-}
-static void savageUpdateTex1State_s4( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- struct gl_texture_object *tObj;
- struct gl_texture_image *image;
- savageTexObjPtr t;
- GLuint format;
-
- /* disable */
- if(imesa->bTexEn1)
- {
- imesa->bTexEn1 = GL_FALSE;
- return;
- }
-
- imesa->regs.s4.texDescr.ni.tex1En = GL_FALSE;
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_NoTexMap1;
- imesa->regs.s4.texCtrl[1].ui = 0x20f040;
- imesa->regs.s4.texDescr.ni.texBLoopEn = GL_FALSE;
- if (ctx->Texture.Unit[1]._ReallyEnabled == 0)
- return;
-
- tObj = ctx->Texture.Unit[1]._Current;
-
- if ((ctx->Texture.Unit[1]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
- || tObj->Image[0][tObj->BaseLevel]->Border > 0) {
- /* 3D texturing enabled, or texture border - fallback */
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
- return;
- }
-
- /* Do 2D texture setup */
-
- t = tObj->DriverData;
- if (!t) {
- t = savageAllocTexObj( tObj );
- if (!t)
- return;
- }
-
- imesa->CurrentTexObj[1] = &t->base;
-
- t->base.bound |= 2;
-
- if (t->base.dirty_images[0] || t->dirtySubImages) {
- savageSetTexImages(imesa, tObj);
- savageUploadTexImages(imesa, t);
- }
-
- driUpdateTextureLRU( &t->base );
-
- format = tObj->Image[0][tObj->BaseLevel]->Format;
-
- switch (ctx->Texture.Unit[1].EnvMode) {
- case GL_REPLACE:
- imesa->regs.s4.texCtrl[1].ni.clrArg1Invert = GL_FALSE;
- switch (format)
- {
- case GL_LUMINANCE:
- case GL_RGB:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_Decal;
- break;
-
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_RGBA:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_Copy;
- break;
-
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_CopyAlpha1;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 1, &imesa->regs.s4.texBlendCtrl);
- break;
- case GL_MODULATE:
- imesa->regs.s4.texCtrl[1].ni.clrArg1Invert = GL_FALSE;
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_ModulAlpha1;
- __HWEnvCombineSingleUnitScale(imesa, 0, 1, &imesa->regs.s4.texBlendCtrl);
- break;
-
- case GL_ADD:
- imesa->regs.s4.texCtrl[1].ni.clrArg1Invert = GL_FALSE;
- switch (format)
- {
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_ModulAlpha1;
- break;
-
- case GL_LUMINANCE:
- case GL_RGB:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_Add1;
- break;
-
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_Add1;
- break;
-
- case GL_INTENSITY:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_AddAlpha1;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 1, &imesa->regs.s4.texBlendCtrl);
- break;
-
-#if GL_ARB_texture_env_combine
- case GL_COMBINE_ARB:
- __HWParseTexEnvCombine(imesa, 1, &texCtrl, &imesa->regs.s4.texBlendCtrl);
- break;
-#endif
-
- case GL_DECAL:
- imesa->regs.s4.texCtrl[1].ni.clrArg1Invert = GL_FALSE;
-
- switch (format)
- {
- case GL_LUMINANCE:
- case GL_RGB:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_Decal1;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_RGBA:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_DecalAlpha1;
- break;
-
- /*
- // GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_ALPHA, GL_INTENSITY
- // are undefined with GL_DECAL
- */
- case GL_ALPHA:
- imesa->regs.s4.texBlendCtrl[1].ui = TBC_CopyAlpha1;
- break;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 1, &imesa->regs.s4.texBlendCtrl);
- break;
-
- case GL_BLEND:
- if (format == GL_LUMINANCE)
- {
- /*
- // This is a hack for GLQuake, invert.
- */
- imesa->regs.s4.texCtrl[1].ni.clrArg1Invert = GL_TRUE;
- imesa->regs.s4.texBlendCtrl[1].ui = 0;
- }
- __HWEnvCombineSingleUnitScale(imesa, 0, 1, &imesa->regs.s4.texBlendCtrl);
- break;
-
- default:
- fprintf(stderr, "unknown tex 1 env mode\n");
- exit(1);
- break;
- }
-
- savage4_set_wrap_mode( imesa, 1, t->setup.sWrapMode, t->setup.tWrapMode );
- savage4_set_filter_mode( imesa, 1, t->setup.minFilter, t->setup.magFilter );
-
- if((ctx->Texture.Unit[1].LodBias !=0.0F) ||
- (imesa->regs.s4.texCtrl[1].ni.dBias != 0))
- {
- int bias = (int)(ctx->Texture.Unit[1].LodBias * 32.0) +
- SAVAGE4_LOD_OFFSET;
- if (bias < -256)
- bias = -256;
- else if (bias > 255)
- bias = 255;
- imesa->regs.s4.texCtrl[1].ni.dBias = bias & 0x1ff;
- }
-
- image = tObj->Image[0][tObj->BaseLevel];
- imesa->regs.s4.texDescr.ni.tex1En = GL_TRUE;
- imesa->regs.s4.texDescr.ni.tex1Width = image->WidthLog2;
- imesa->regs.s4.texDescr.ni.tex1Height = image->HeightLog2;
- imesa->regs.s4.texDescr.ni.tex1Fmt = t->hwFormat;
- imesa->regs.s4.texCtrl[1].ni.dMax = t->base.lastLevel - t->base.firstLevel;
- imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE;
-
- imesa->regs.s4.texAddr[1].ui = (u_int32_t) t->setup.physAddr | 2;
- if(t->base.heap->heapId == SAVAGE_AGP_HEAP)
- imesa->regs.s4.texAddr[1].ui |= 0x1;
-}
-static void savageUpdateTexState_s3d( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- struct gl_texture_object *tObj;
- struct gl_texture_image *image;
- savageTexObjPtr t;
- GLuint format;
-
- /* disable */
- imesa->regs.s3d.texCtrl.ui = 0;
- imesa->regs.s3d.texCtrl.ni.texEn = GL_FALSE;
- imesa->regs.s3d.texCtrl.ni.dBias = 0x08;
- imesa->regs.s3d.texCtrl.ni.texXprEn = GL_TRUE;
- if (ctx->Texture.Unit[0]._ReallyEnabled == 0)
- return;
-
- tObj = ctx->Texture.Unit[0]._Current;
- if ((ctx->Texture.Unit[0]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
- || tObj->Image[0][tObj->BaseLevel]->Border > 0) {
- /* 3D texturing enabled, or texture border - fallback */
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
- return;
- }
-
- /* Do 2D texture setup */
- t = tObj->DriverData;
- if (!t) {
- t = savageAllocTexObj( tObj );
- if (!t)
- return;
- }
-
- imesa->CurrentTexObj[0] = &t->base;
- t->base.bound |= 1;
-
- if (t->base.dirty_images[0] || t->dirtySubImages) {
- savageSetTexImages(imesa, tObj);
- savageUploadTexImages(imesa, t);
- }
-
- driUpdateTextureLRU( &t->base );
-
- format = tObj->Image[0][tObj->BaseLevel]->Format;
-
- /* FIXME: copied from utah-glx, probably needs some tuning */
- switch (ctx->Texture.Unit[0].EnvMode) {
- case GL_DECAL:
- imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = SAVAGETBC_DECALALPHA_S3D;
- break;
- case GL_REPLACE:
- switch (format) {
- case GL_ALPHA: /* FIXME */
- imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = 4;
- break;
- case GL_RGB:
- case GL_LUMINANCE:
- imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = SAVAGETBC_DECAL_S3D;
- break;
- case GL_INTENSITY:
- imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = SAVAGETBC_COPY_S3D;
- }
- break;
- case GL_BLEND: /* hardware can't do GL_BLEND */
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
- return;
- case GL_MODULATE:
- imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = SAVAGETBC_MODULATEALPHA_S3D;
- break;
- default:
- fprintf(stderr, "unknown tex env mode\n");
- /*exit(1);*/
- break;
- }
-
- /* The Savage3D can't handle different wrapping modes in s and t.
- * If they are not the same, fall back to software. */
- if (t->setup.sWrapMode != t->setup.tWrapMode) {
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_TRUE);
- return;
- }
- imesa->regs.s3d.texCtrl.ni.uWrapEn = 0;
- imesa->regs.s3d.texCtrl.ni.vWrapEn = 0;
- imesa->regs.s3d.texCtrl.ni.wrapMode =
- (t->setup.sWrapMode == GL_REPEAT) ? TAM_Wrap : TAM_Clamp;
-
- switch (t->setup.minFilter) {
- case GL_NEAREST:
- imesa->regs.s3d.texCtrl.ni.filterMode = TFM_Point;
- imesa->regs.s3d.texCtrl.ni.mipmapDisable = GL_TRUE;
- break;
-
- case GL_LINEAR:
- imesa->regs.s3d.texCtrl.ni.filterMode = TFM_Bilin;
- imesa->regs.s3d.texCtrl.ni.mipmapDisable = GL_TRUE;
- break;
-
- case GL_NEAREST_MIPMAP_NEAREST:
- imesa->regs.s3d.texCtrl.ni.filterMode = TFM_Point;
- imesa->regs.s3d.texCtrl.ni.mipmapDisable = GL_FALSE;
- break;
-
- case GL_LINEAR_MIPMAP_NEAREST:
- imesa->regs.s3d.texCtrl.ni.filterMode = TFM_Bilin;
- imesa->regs.s3d.texCtrl.ni.mipmapDisable = GL_FALSE;
- break;
-
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- imesa->regs.s3d.texCtrl.ni.filterMode = TFM_Trilin;
- imesa->regs.s3d.texCtrl.ni.mipmapDisable = GL_FALSE;
- break;
- }
-
- /* There is no way to specify a maximum mipmap level. We may have to
- disable mipmapping completely. */
- /*
- if (t->max_level < t->image[0].image->WidthLog2 ||
- t->max_level < t->image[0].image->HeightLog2) {
- texCtrl.ni.mipmapEnable = GL_TRUE;
- if (texCtrl.ni.filterMode == TFM_Trilin)
- texCtrl.ni.filterMode = TFM_Bilin;
- texCtrl.ni.filterMode = TFM_Point;
- }
- */
-
- if((ctx->Texture.Unit[0].LodBias !=0.0F) ||
- (imesa->regs.s3d.texCtrl.ni.dBias != 0))
- {
- int bias = (int)(ctx->Texture.Unit[0].LodBias * 16.0);
- if (bias < -256)
- bias = -256;
- else if (bias > 255)
- bias = 255;
- imesa->regs.s3d.texCtrl.ni.dBias = bias & 0x1ff;
- }
-
- image = tObj->Image[0][tObj->BaseLevel];
- imesa->regs.s3d.texCtrl.ni.texEn = GL_TRUE;
- imesa->regs.s3d.texDescr.ni.texWidth = image->WidthLog2;
- imesa->regs.s3d.texDescr.ni.texHeight = image->HeightLog2;
- assert (t->hwFormat <= 7);
- imesa->regs.s3d.texDescr.ni.texFmt = t->hwFormat;
-
- imesa->regs.s3d.texAddr.ui = (u_int32_t) t->setup.physAddr | 2;
- if(t->base.heap->heapId == SAVAGE_AGP_HEAP)
- imesa->regs.s3d.texAddr.ui |= 0x1;
-}
-
-
-static void savageTimestampTextures( savageContextPtr imesa )
-{
- /* Timestamp current texture objects for texture heap aging.
- * Only useful with long-lived 32-bit event tags available
- * with Savage DRM 2.3.x or later. */
- if ((imesa->CurrentTexObj[0] || imesa->CurrentTexObj[1]) &&
- imesa->savageScreen->driScrnPriv->drmMinor >= 3) {
- unsigned int e;
- FLUSH_BATCH(imesa);
- e = savageEmitEvent(imesa, SAVAGE_WAIT_3D);
- if (imesa->CurrentTexObj[0])
- imesa->CurrentTexObj[0]->timestamp = e;
- if (imesa->CurrentTexObj[1])
- imesa->CurrentTexObj[1]->timestamp = e;
- }
-}
-
-
-static void savageUpdateTextureState_s4( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /* When a texture is about to change or be disabled, timestamp the
- * old texture(s). We'll have to wait for this time stamp before
- * uploading anything to the same texture heap.
- */
- if ((imesa->CurrentTexObj[0] && ctx->Texture.Unit[0]._ReallyEnabled &&
- ctx->Texture.Unit[0]._Current->DriverData != imesa->CurrentTexObj[0]) ||
- (imesa->CurrentTexObj[1] && ctx->Texture.Unit[1]._ReallyEnabled &&
- ctx->Texture.Unit[1]._Current->DriverData != imesa->CurrentTexObj[1]) ||
- (imesa->CurrentTexObj[0] && !ctx->Texture.Unit[0]._ReallyEnabled) ||
- (imesa->CurrentTexObj[1] && !ctx->Texture.Unit[1]._ReallyEnabled))
- savageTimestampTextures(imesa);
-
- if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->bound &= ~1;
- if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->bound &= ~2;
- imesa->CurrentTexObj[0] = 0;
- imesa->CurrentTexObj[1] = 0;
- savageUpdateTex0State_s4( ctx );
- savageUpdateTex1State_s4( ctx );
- imesa->dirty |= (SAVAGE_UPLOAD_TEX0 |
- SAVAGE_UPLOAD_TEX1);
-}
-static void savageUpdateTextureState_s3d( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /* When a texture is about to change or be disabled, timestamp the
- * old texture(s). We'll have to wait for this time stamp before
- * uploading anything to the same texture heap.
- */
- if ((imesa->CurrentTexObj[0] && ctx->Texture.Unit[0]._ReallyEnabled &&
- ctx->Texture.Unit[0]._Current->DriverData != imesa->CurrentTexObj[0]) ||
- (imesa->CurrentTexObj[0] && !ctx->Texture.Unit[0]._ReallyEnabled))
- savageTimestampTextures(imesa);
-
- if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->bound &= ~1;
- imesa->CurrentTexObj[0] = 0;
- savageUpdateTexState_s3d( ctx );
- imesa->dirty |= (SAVAGE_UPLOAD_TEX0);
-}
-void savageUpdateTextureState( GLcontext *ctx)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
- FALLBACK (ctx, SAVAGE_FALLBACK_TEXTURE, GL_FALSE);
- FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_FALSE);
- if (imesa->savageScreen->chipset >= S3_SAVAGE4)
- savageUpdateTextureState_s4 (ctx);
- else
- savageUpdateTextureState_s3d (ctx);
-}
-
-
-
-/*****************************************
- * DRIVER functions
- *****************************************/
-
-static void savageTexEnv( GLcontext *ctx, GLenum target,
- GLenum pname, const GLfloat *param )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
-
- if (pname == GL_TEXTURE_ENV_MODE) {
-
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
-
- } else if (pname == GL_TEXTURE_ENV_COLOR) {
-
- struct gl_texture_unit *texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- const GLfloat *fc = texUnit->EnvColor;
- GLuint r, g, b, a;
- CLAMPED_FLOAT_TO_UBYTE(r, fc[0]);
- CLAMPED_FLOAT_TO_UBYTE(g, fc[1]);
- CLAMPED_FLOAT_TO_UBYTE(b, fc[2]);
- CLAMPED_FLOAT_TO_UBYTE(a, fc[3]);
-
- imesa->texEnvColor = ((a << 24) | (r << 16) |
- (g << 8) | (b << 0));
-
-
- }
-}
-
-/* Update the heap's time stamp, so the new image is not uploaded
- * while the old one is still in use. If the texture that is going to
- * be changed is currently bound, we need to timestamp the texture
- * first. */
-static void savageTexImageChanged (savageTexObjPtr t) {
- if (t->base.heap) {
- if (t->base.bound)
- savageTimestampTextures(
- (savageContextPtr)t->base.heap->driverContext);
- if (t->base.timestamp > t->base.heap->timestamp)
- t->base.heap->timestamp = t->base.timestamp;
- }
-}
-
-static void savageTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData;
- if (t) {
- savageTexImageChanged (t);
- } else {
- t = savageAllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
- return;
- }
- }
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, packing, texObj, texImage );
- t->base.dirty_images[0] |= (1 << level);
- SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void savageTexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData;
- assert( t ); /* this _should_ be true */
- if (t) {
- savageTexImageChanged (t);
- savageMarkDirtyTiles(t, level, texImage->Width2, 1,
- xoffset, 0, width, 1);
- } else {
- t = savageAllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
- return;
- }
- t->base.dirty_images[0] |= (1 << level);
- }
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
- t->dirtySubImages |= (1 << level);
- SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void savageTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData;
- if (t) {
- savageTexImageChanged (t);
- } else {
- t = savageAllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
- _mesa_store_teximage2d( ctx, target, level, internalFormat,
- width, height, border, format, type,
- pixels, packing, texObj, texImage );
- t->base.dirty_images[0] |= (1 << level);
- SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void savageTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData;
- assert( t ); /* this _should_ be true */
- if (t) {
- savageTexImageChanged (t);
- savageMarkDirtyTiles(t, level, texImage->Width2, texImage->Height2,
- xoffset, yoffset, width, height);
- } else {
- t = savageAllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- t->base.dirty_images[0] |= (1 << level);
- }
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
- t->dirtySubImages |= (1 << level);
- SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void
-savageCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData;
- if (t) {
- savageTexImageChanged (t);
- } else {
- t = savageAllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
- _mesa_store_compressed_teximage2d( ctx, target, level, internalFormat,
- width, height, border, imageSize,
- data, texObj, texImage );
- t->base.dirty_images[0] |= (1 << level);
- SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void
-savageCompressedTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLsizei imageSize,
- const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData;
- assert( t ); /* this _should_ be true */
- if (t) {
- savageTexImageChanged (t);
- savageMarkDirtyTiles(t, level, texImage->Width2, texImage->Height2,
- xoffset, yoffset, width, height);
- } else {
- t = savageAllocTexObj(texObj);
- if (!t) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- t->base.dirty_images[0] |= (1 << level);
- }
- _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, yoffset,
- width, height, format, imageSize,
- data, texObj, texImage);
- t->dirtySubImages |= (1 << level);
- SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void savageTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat *params )
-{
- savageTexObjPtr t = (savageTexObjPtr) tObj->DriverData;
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
-
- if (!t || (target != GL_TEXTURE_1D && target != GL_TEXTURE_2D))
- return;
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- savageSetTexFilter(t,tObj->MinFilter,tObj->MagFilter);
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- savageSetTexWrapping(t,tObj->WrapS,tObj->WrapT);
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- savageSetTexBorderColor(t,tObj->_BorderChan);
- break;
-
- default:
- return;
- }
-
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void savageBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *tObj )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
-
- assert( (target != GL_TEXTURE_1D && target != GL_TEXTURE_2D) ||
- (tObj->DriverData != NULL) );
-
- imesa->new_state |= SAVAGE_NEW_TEXTURE;
-}
-
-static void savageDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
-{
- driTextureObject *t = (driTextureObject *)tObj->DriverData;
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
-
- if (t) {
- if (t->bound)
- savageTimestampTextures(imesa);
-
- driDestroyTextureObject(t);
- }
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-
-static struct gl_texture_object *
-savageNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- savageAllocTexObj( obj );
-
- return obj;
-}
-
-void savageDDInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->TexEnv = savageTexEnv;
- functions->ChooseTextureFormat = savageChooseTextureFormat;
- functions->TexImage1D = savageTexImage1D;
- functions->TexSubImage1D = savageTexSubImage1D;
- functions->TexImage2D = savageTexImage2D;
- functions->TexSubImage2D = savageTexSubImage2D;
- functions->CompressedTexImage2D = savageCompressedTexImage2D;
- functions->CompressedTexSubImage2D = savageCompressedTexSubImage2D;
- functions->BindTexture = savageBindTexture;
- functions->NewTextureObject = savageNewTextureObject;
- functions->DeleteTexture = savageDeleteTexture;
- functions->IsTextureResident = driIsTextureResident;
- functions->TexParameter = savageTexParameter;
-
- /* Texel fetching with our custom texture formats works just like
- * the standard argb formats. */
- _savage_texformat_a1114444.FetchTexel1D = _mesa_texformat_argb4444.FetchTexel1D;
- _savage_texformat_a1114444.FetchTexel2D = _mesa_texformat_argb4444.FetchTexel2D;
- _savage_texformat_a1114444.FetchTexel3D = _mesa_texformat_argb4444.FetchTexel3D;
- _savage_texformat_a1114444.FetchTexel1Df= _mesa_texformat_argb4444.FetchTexel1Df;
- _savage_texformat_a1114444.FetchTexel2Df= _mesa_texformat_argb4444.FetchTexel2Df;
- _savage_texformat_a1114444.FetchTexel3Df= _mesa_texformat_argb4444.FetchTexel3Df;
-
- _savage_texformat_a1118888.FetchTexel1D = _mesa_texformat_argb8888.FetchTexel1D;
- _savage_texformat_a1118888.FetchTexel2D = _mesa_texformat_argb8888.FetchTexel2D;
- _savage_texformat_a1118888.FetchTexel3D = _mesa_texformat_argb8888.FetchTexel3D;
- _savage_texformat_a1118888.FetchTexel1Df= _mesa_texformat_argb8888.FetchTexel1Df;
- _savage_texformat_a1118888.FetchTexel2Df= _mesa_texformat_argb8888.FetchTexel2Df;
- _savage_texformat_a1118888.FetchTexel3Df= _mesa_texformat_argb8888.FetchTexel3Df;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.h
deleted file mode 100644
index f1ee72241..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetex.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef SAVAGETEX_INC
-#define SAVAGETEX_INC
-
-#include "mtypes.h"
-
-#include "savagecontext.h"
-#include "texmem.h"
-
-#define SAVAGE_TEX_MAXLEVELS 12
-
-/** \brief Texture tiling information */
-typedef struct savage_tileinfo_t {
- GLuint width, height; /**< tile width and height */
- GLuint wInSub, hInSub; /**< tile width and height in subtiles */
- GLuint subWidth, subHeight; /**< subtile width and height */
- GLuint tinyOffset[2]; /**< internal offsets size 1 and 2 images */
-} savageTileInfo, *savageTileInfoPtr;
-
-typedef struct {
- GLuint offset;
- GLuint nTiles;
- GLuint *dirtyTiles; /* bit vector of dirty tiles (still unused) */
-} savageTexImage;
-
-typedef struct {
- driTextureObject base;
-
- GLubyte *bufAddr;
-
- GLuint age;
- savageTexImage image[SAVAGE_TEX_MAXLEVELS];
- GLuint dirtySubImages;
-
- struct {
- GLuint sWrapMode, tWrapMode;
- GLuint minFilter, magFilter;
- GLuint physAddr;
- } setup;
-
- GLuint hwFormat;
- GLuint texelBytes;
- const savageTileInfo *tileInfo;
-} savageTexObj, *savageTexObjPtr;
-
-#define SAVAGE_NO_PALETTE 0x0
-#define SAVAGE_USE_PALETTE 0x1
-#define SAVAGE_UPDATE_PALETTE 0x2
-#define SAVAGE_FALLBACK_PALETTE 0x4
-#define __HWEnvCombineSingleUnitScale(imesa, flag0, flag1, TexBlendCtrl)
-#define __HWParseTexEnvCombine(imesa, flag0, TexCtrl, TexBlendCtrl)
-
-
-void savageUpdateTextureState( GLcontext *ctx );
-void savageDDInitTextureFuncs( struct dd_function_table *functions );
-
-void savageDestroyTexObj( savageContextPtr imesa, savageTexObjPtr t );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.c
deleted file mode 100644
index 184704013..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.c
+++ /dev/null
@@ -1,1297 +0,0 @@
-/* $XFree86$ */ /* -*- c-basic-offset: 3 -*- */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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 <keithw@valinux.com>
- * Felix Kuehling <fxkuehl@gmx.de>
- *
- */
-
-#include <stdio.h>
-#include <math.h>
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "savagetris.h"
-#include "savagestate.h"
-#include "savagetex.h"
-#include "savageioctl.h"
-#include "savage_bci.h"
-
-static void savageRasterPrimitive( GLcontext *ctx, GLuint prim );
-static void savageRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-
-static GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-
-/***********************************************************************
- * Emit primitives *
- ***********************************************************************/
-
-#if defined (USE_X86_ASM)
-#define EMIT_VERT( j, vb, vertex_size, start, v ) \
-do { int __tmp; \
- vb += start; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertex_size-start), \
- "D" ((long)vb), \
- "S" ((long)&(v)->ui[start])); \
-} while (0)
-#else
-#define EMIT_VERT( j, vb, vertex_size, start, v ) \
-do { \
- for ( j = start ; j < vertex_size ; j++ ) \
- vb[j] = (v)->ui[j]; \
- vb += vertex_size; \
-} while (0)
-#endif
-
-static void __inline__ savage_draw_triangle (savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1,
- savageVertexPtr v2) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize);
- GLuint j;
-
- EMIT_VERT (j, vb, vertsize, 0, v0);
- EMIT_VERT (j, vb, vertsize, 0, v1);
- EMIT_VERT (j, vb, vertsize, 0, v2);
-}
-
-static void __inline__ savage_draw_quad (savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1,
- savageVertexPtr v2,
- savageVertexPtr v3) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
- GLuint j;
-
- EMIT_VERT (j, vb, vertsize, 0, v0);
- EMIT_VERT (j, vb, vertsize, 0, v1);
- EMIT_VERT (j, vb, vertsize, 0, v3);
- EMIT_VERT (j, vb, vertsize, 0, v1);
- EMIT_VERT (j, vb, vertsize, 0, v2);
- EMIT_VERT (j, vb, vertsize, 0, v3);
-}
-
-static __inline__ void savage_draw_point (savageContextPtr imesa,
- savageVertexPtr tmp) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
- const GLfloat x = tmp->v.x;
- const GLfloat y = tmp->v.y;
- const GLfloat sz = imesa->glCtx->Point._Size * .5;
- GLuint j;
-
- *(float *)&vb[0] = x - sz;
- *(float *)&vb[1] = y - sz;
- EMIT_VERT (j, vb, vertsize, 2, tmp);
-
- *(float *)&vb[0] = x + sz;
- *(float *)&vb[1] = y - sz;
- EMIT_VERT (j, vb, vertsize, 2, tmp);
-
- *(float *)&vb[0] = x + sz;
- *(float *)&vb[1] = y + sz;
- EMIT_VERT (j, vb, vertsize, 2, tmp);
-
- *(float *)&vb[0] = x + sz;
- *(float *)&vb[1] = y + sz;
- EMIT_VERT (j, vb, vertsize, 2, tmp);
-
- *(float *)&vb[0] = x - sz;
- *(float *)&vb[1] = y + sz;
- EMIT_VERT (j, vb, vertsize, 2, tmp);
-
- *(float *)&vb[0] = x - sz;
- *(float *)&vb[1] = y - sz;
- EMIT_VERT (j, vb, vertsize, 2, tmp);
-}
-
-static __inline__ void savage_draw_line (savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1 ) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
- GLfloat width = imesa->glCtx->Line._Width;
- GLfloat dx, dy, ix, iy;
- GLuint j;
-
- dx = v0->v.x - v1->v.x;
- dy = v0->v.y - v1->v.y;
-
- ix = width * .5; iy = 0;
- if (dx * dx > dy * dy) {
- iy = ix; ix = 0;
- }
-
- *(float *)&vb[0] = v0->v.x - ix;
- *(float *)&vb[1] = v0->v.y - iy;
- EMIT_VERT (j, vb, vertsize, 2, v0);
-
- *(float *)&vb[0] = v1->v.x + ix;
- *(float *)&vb[1] = v1->v.y + iy;
- EMIT_VERT (j, vb, vertsize, 2, v1);
-
- *(float *)&vb[0] = v0->v.x + ix;
- *(float *)&vb[1] = v0->v.y + iy;
- EMIT_VERT (j, vb, vertsize, 2, v0);
-
- *(float *)&vb[0] = v0->v.x - ix;
- *(float *)&vb[1] = v0->v.y - iy;
- EMIT_VERT (j, vb, vertsize, 2, v0);
-
- *(float *)&vb[0] = v1->v.x - ix;
- *(float *)&vb[1] = v1->v.y - iy;
- EMIT_VERT (j, vb, vertsize, 2, v1);
-
- *(float *)&vb[0] = v1->v.x + ix;
- *(float *)&vb[1] = v1->v.y + iy;
- EMIT_VERT (j, vb, vertsize, 2, v1);
-}
-
-/* Fallback drawing functions for the ptex hack. Code duplication
- * (especially lines and points) isn't beautiful, but I didn't feel
- * like inventing yet another template. :-/
- */
-#define PTEX_VERTEX( j, tmp, vertex_size, start, v) \
-do { \
- GLfloat rhw = 1.0 / v->f[vertex_size]; \
- for ( j = start ; j < vertex_size ; j++ ) \
- tmp.f[j] = v->f[j]; \
- tmp.f[3] *= v->f[vertex_size]; \
- tmp.f[vertex_size-2] *= rhw; \
- tmp.f[vertex_size-1] *= rhw; \
-} while (0)
-
-static void __inline__ savage_ptex_tri (savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1,
- savageVertexPtr v2) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize);
- savageVertex tmp;
- GLuint j;
-
- PTEX_VERTEX (j, tmp, vertsize, 0, v0); EMIT_VERT (j, vb, vertsize, 0, &tmp);
- PTEX_VERTEX (j, tmp, vertsize, 0, v1); EMIT_VERT (j, vb, vertsize, 0, &tmp);
- PTEX_VERTEX (j, tmp, vertsize, 0, v2); EMIT_VERT (j, vb, vertsize, 0, &tmp);
-}
-
-static __inline__ void savage_ptex_line (savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1 ) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
- GLfloat width = imesa->glCtx->Line._Width;
- GLfloat dx, dy, ix, iy;
- savageVertex tmp0, tmp1;
- GLuint j;
-
- PTEX_VERTEX (j, tmp0, vertsize, 2, v0);
- PTEX_VERTEX (j, tmp1, vertsize, 2, v1);
-
- dx = v0->v.x - v1->v.x;
- dy = v0->v.y - v1->v.y;
-
- ix = width * .5; iy = 0;
- if (dx * dx > dy * dy) {
- iy = ix; ix = 0;
- }
-
- *(float *)&vb[0] = v0->v.x - ix;
- *(float *)&vb[1] = v0->v.y - iy;
- EMIT_VERT (j, vb, vertsize, 2, &tmp0);
-
- *(float *)&vb[0] = v1->v.x + ix;
- *(float *)&vb[1] = v1->v.y + iy;
- EMIT_VERT (j, vb, vertsize, 2, &tmp1);
-
- *(float *)&vb[0] = v0->v.x + ix;
- *(float *)&vb[1] = v0->v.y + iy;
- EMIT_VERT (j, vb, vertsize, 2, &tmp0);
-
- *(float *)&vb[0] = v0->v.x - ix;
- *(float *)&vb[1] = v0->v.y - iy;
- EMIT_VERT (j, vb, vertsize, 2, &tmp0);
-
- *(float *)&vb[0] = v1->v.x - ix;
- *(float *)&vb[1] = v1->v.y - iy;
- EMIT_VERT (j, vb, vertsize, 2, &tmp1);
-
- *(float *)&vb[0] = v1->v.x + ix;
- *(float *)&vb[1] = v1->v.y + iy;
- EMIT_VERT (j, vb, vertsize, 2, &tmp1);
-}
-
-static __inline__ void savage_ptex_point (savageContextPtr imesa,
- savageVertexPtr v0) {
- GLuint vertsize = imesa->HwVertexSize;
- u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize);
- const GLfloat x = v0->v.x;
- const GLfloat y = v0->v.y;
- const GLfloat sz = imesa->glCtx->Point._Size * .5;
- savageVertex tmp;
- GLuint j;
-
- PTEX_VERTEX (j, tmp, vertsize, 2, v0);
-
- *(float *)&vb[0] = x - sz;
- *(float *)&vb[1] = y - sz;
- EMIT_VERT (j, vb, vertsize, 2, &tmp);
-
- *(float *)&vb[0] = x + sz;
- *(float *)&vb[1] = y - sz;
- EMIT_VERT (j, vb, vertsize, 2, &tmp);
-
- *(float *)&vb[0] = x + sz;
- *(float *)&vb[1] = y + sz;
- EMIT_VERT (j, vb, vertsize, 2, &tmp);
-
- *(float *)&vb[0] = x + sz;
- *(float *)&vb[1] = y + sz;
- EMIT_VERT (j, vb, vertsize, 2, &tmp);
-
- *(float *)&vb[0] = x - sz;
- *(float *)&vb[1] = y + sz;
- EMIT_VERT (j, vb, vertsize, 2, &tmp);
-
- *(float *)&vb[0] = x - sz;
- *(float *)&vb[1] = y - sz;
- EMIT_VERT (j, vb, vertsize, 2, &tmp);
-}
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- imesa->draw_tri( imesa, a, b, c ); \
- else \
- savage_draw_triangle( imesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- imesa->draw_tri( imesa, a, b, d ); \
- imesa->draw_tri( imesa, b, c, d ); \
- } else \
- savage_draw_quad( imesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- imesa->draw_line( imesa, v0, v1 ); \
- else \
- savage_draw_line( imesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- imesa->draw_point( imesa, v0 ); \
- else \
- savage_draw_point( imesa, v0 ); \
-} while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define SAVAGE_OFFSET_BIT 0x1
-#define SAVAGE_TWOSIDE_BIT 0x2
-#define SAVAGE_UNFILLED_BIT 0x4
-#define SAVAGE_FALLBACK_BIT 0x8
-#define SAVAGE_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[SAVAGE_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & SAVAGE_FALLBACK_BIT)
-#define DO_OFFSET (IND & SAVAGE_OFFSET_BIT)
-#define DO_UNFILLED (IND & SAVAGE_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & SAVAGE_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX savageVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE imesa->depth_scale
-#define REVERSE_DEPTH 1
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (imesa->verts + (e * imesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- savage_color_t *color = (savage_color_t *)&((v)->ub4[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-
-#define VERT_SET_SPEC( v, c ) \
-do { \
- if (specoffset) { \
- savage_color_t *spec = (savage_color_t *)&((v)->ub4[specoffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
- if (specoffset) COPY_3V(v0->ub4[specoffset], v1->ub4[specoffset])
-#define VERT_SAVE_SPEC( idx ) \
- if (specoffset) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) \
- if (specoffset) v[idx]->ui[specoffset] = spec[idx]
-
-#define LOCAL_VARS(n) \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = \
- ((imesa->skip & SAVAGE_SKIP_W) ? 3 : 4); \
- GLboolean specoffset = \
- ((imesa->skip & SAVAGE_SKIP_C1) ? 0 : coloroffset+1); \
- (void) color; (void) spec; (void) coloroffset; (void) specoffset;
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (imesa->raster_primitive != reduced_prim[x]) \
- savageRasterPrimitive( ctx, x )
-#define RENDER_PRIMITIVE imesa->render_primitive
-#define IND SAVAGE_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_OFFSET_BIT|SAVAGE_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_OFFSET_BIT|SAVAGE_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_OFFSET_BIT|SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_OFFSET_BIT|SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_UNFILLED_BIT|SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_OFFSET_BIT|SAVAGE_UNFILLED_BIT|SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_UNFILLED_BIT|SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SAVAGE_TWOSIDE_BIT|SAVAGE_OFFSET_BIT|SAVAGE_UNFILLED_BIT| \
- SAVAGE_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-savage_fallback_tri( savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1,
- savageVertexPtr v2 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[3];
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swsetup_Translate( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-savage_fallback_line( savageContextPtr imesa,
- savageVertexPtr v0,
- savageVertexPtr v1 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[2];
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-savage_fallback_point( savageContextPtr imesa,
- savageVertexPtr v0 )
-{
- GLcontext *ctx = imesa->glCtx;
- SWvertex v[1];
- FLUSH_BATCH(imesa);
- WAIT_IDLE_EMPTY(imesa);
- _swsetup_Translate( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define VERT(x) (savageVertexPtr)(savageVerts + (x * vertsize * sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- savage_draw_point( imesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- savage_draw_line( imesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- savage_draw_triangle( imesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- savage_draw_quad( imesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) do { \
- if (0) fprintf(stderr, "%s\n", __FUNCTION__); \
- savageRenderPrimitive( ctx, x ); \
- /*SAVAGE_CONTEXT(ctx)->render_primitive = x;*/ \
-} while (0)
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- const GLuint vertsize = imesa->vertex_size; \
- const char *savageVerts = (char *)imesa->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) savage_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) savage_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-static void savageRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-}
-
-static void savageRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-/*
-static void savageFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- r128ContextPtr rmesa = R128_CONTEXT( ctx );
- GLuint vertsize = rmesa->vertex_size;
- GLuint *vb = r128AllocDmaLow( rmesa, (n-2) * 3 * 4 * vertsize );
- GLubyte *r128verts = (GLubyte *)rmesa->verts;
- const GLuint shift = rmesa->vertex_stride_shift;
- const GLuint *start = (const GLuint *)VERT(elts[0]);
- int i,j;
-
- rmesa->num_verts += (n-2) * 3;
-
- for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) start );
- COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) VERT(elts[i-1]) );
- COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) VERT(elts[i]) );
- }
-}
-*/
-
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-#define _SAVAGE_NEW_RENDER_STATE (_DD_NEW_LINE_STIPPLE | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_POINT_SMOOTH | \
- _DD_NEW_TRI_STIPPLE | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET) \
-
-/* original driver didn't have DD_POINT_SMOOTH. really needed? */
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH)
-#define TRI_FALLBACK (DD_TRI_STIPPLE|DD_TRI_SMOOTH)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-
-static void savageChooseRenderState(GLcontext *ctx)
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- /* Hook in fallback functions for the ptex hack. Do this first, so
- * that a real fallback will overwrite them with the respective
- * savage_fallback_... function.
- */
- if (imesa->ptexHack) {
- /* Do textures make sense with points? */
- imesa->draw_point = savage_ptex_point;
- imesa->draw_line = savage_ptex_line;
- imesa->draw_tri = savage_ptex_tri;
- index |= SAVAGE_FALLBACK_BIT;
- } else {
- imesa->draw_point = savage_draw_point;
- imesa->draw_line = savage_draw_line;
- imesa->draw_tri = savage_draw_triangle;
- }
-
- if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) {
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= SAVAGE_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= SAVAGE_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= SAVAGE_UNFILLED_BIT;
- }
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & ANY_FALLBACK_FLAGS) {
- if (flags & POINT_FALLBACK) imesa->draw_point = savage_fallback_point;
- if (flags & LINE_FALLBACK) imesa->draw_line = savage_fallback_line;
- if (flags & TRI_FALLBACK) imesa->draw_tri = savage_fallback_tri;
- index |= SAVAGE_FALLBACK_BIT;
- if (SAVAGE_DEBUG & DEBUG_FALLBACKS) {
- fprintf (stderr, "Per-primitive fallback, TriangleCaps=0x%x\n",
- ctx->_TriangleCaps);
- }
- }
- }
-
- if (index != imesa->RenderIndex) {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = savage_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = savage_render_tab_elts;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.ClippedPolygon = savageRenderClippedPoly/*r128FastRenderClippedPoly*/;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = savageRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = savageRenderClippedPoly;
- }
-
- imesa->RenderIndex = index;
- }
-}
-
-/**********************************************************************/
-/* Validate state at pipeline start */
-/**********************************************************************/
-
-static void savageRunPipeline( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- if (imesa->no_rast)
- FALLBACK(ctx, SAVAGE_FALLBACK_NORAST, GL_TRUE);
-
- if (imesa->new_state)
- savageDDUpdateHwState( ctx );
-
- if (!imesa->Fallback) {
- if (imesa->new_gl_state & _SAVAGE_NEW_RENDER_STATE)
- savageChooseRenderState( ctx );
-
- /* choose the correct primitive type for tnl rendering */
- if (imesa->savageScreen->chipset < S3_SAVAGE4 &&
- (ctx->_TriangleCaps & DD_FLATSHADE)) {
- if (imesa->HwPrim != SAVAGE_PRIM_TRILIST_201)
- savageFlushVertices(imesa);
- imesa->HwPrim = SAVAGE_PRIM_TRILIST_201;
- } else {
- if (imesa->HwPrim != SAVAGE_PRIM_TRILIST)
- savageFlushVertices(imesa);
- imesa->HwPrim = SAVAGE_PRIM_TRILIST;
- }
-
- imesa->new_gl_state = 0;
- }
-
- _tnl_run_pipeline( ctx );
-
- if (imesa->no_rast)
- FALLBACK(ctx, SAVAGE_FALLBACK_NORAST, GL_FALSE);
-}
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-/* This is called when Mesa switches between rendering triangle
- * primitives (such as GL_POLYGON, GL_QUADS, GL_TRIANGLE_STRIP, etc),
- * and lines, points and bitmaps.
- *
- * As the r128 uses triangles to render lines and points, it is
- * necessary to turn off hardware culling when rendering these
- * primitives.
- */
-
-static void savageRasterPrimitive( GLcontext *ctx, GLuint prim )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT( ctx );
-
- /* Update culling */
- if (imesa->raster_primitive != prim) {
- imesa->raster_primitive = prim;
- imesa->new_state |= SAVAGE_NEW_CULL;
- savageDDUpdateHwState (ctx);
- }
-
-#if 0
- if (ctx->Polygon.StippleFlag && mmesa->haveHwStipple)
- {
- mmesa->dirty |= MGA_UPLOAD_CONTEXT;
- mmesa->setup.dwgctl &= ~(0xf<<20);
- if (mmesa->raster_primitive == GL_TRIANGLES)
- mmesa->setup.dwgctl |= mmesa->poly_stipple;
- }
-#endif
-}
-
-static void savageRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- imesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (imesa->raster_primitive != rprim) {
- savageRasterPrimitive( ctx, rprim );
- }
-}
-
-/* Check if projective texture coordinates are used and if we can fake
- * them. Fallback to swrast we can't. Returns GL_TRUE if projective
- * texture coordinates must be faked, GL_FALSE otherwise.
- */
-static GLboolean savageCheckPTexHack( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
-
- if (index & _TNL_BIT_TEX(0) && VB->TexCoordPtr[0]->size == 4) {
- if ((index & _TNL_BITS_TEX_ANY) == _TNL_BIT_TEX(0))
- return GL_TRUE; /* apply ptex hack */
- else
- FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE);
- }
- if ((index & _TNL_BIT_TEX(1)) && VB->TexCoordPtr[1]->size == 4)
- FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE);
-
- return GL_FALSE; /* don't apply ptex hack */
-}
-
-
-#define DO_EMIT_ATTR( ATTR, STYLE ) \
-do { \
- imesa->vertex_attrs[imesa->vertex_attr_count].attrib = (ATTR); \
- imesa->vertex_attrs[imesa->vertex_attr_count].format = (STYLE); \
- imesa->vertex_attr_count++; \
-} while (0)
-
-#define NEED_ATTR( INDEX, SKIP ) \
-do { \
- setupIndex |= (INDEX); \
- skip &= ~(SKIP); \
-} while (0)
-
-#define EMIT_ATTR( ATTR, STYLE, INDEX, SKIP ) \
-do { \
- NEED_ATTR( INDEX, SKIP ); \
- DO_EMIT_ATTR( ATTR, STYLE ); \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- imesa->vertex_attrs[imesa->vertex_attr_count].attrib = 0; \
- imesa->vertex_attrs[imesa->vertex_attr_count].format = EMIT_PAD; \
- imesa->vertex_attrs[imesa->vertex_attr_count].offset = (N); \
- imesa->vertex_attr_count++; \
-} while (0)
-
-#define SAVAGE_EMIT_XYZ 0x0001
-#define SAVAGE_EMIT_W 0x0002
-#define SAVAGE_EMIT_C0 0x0004
-#define SAVAGE_EMIT_C1 0x0008
-#define SAVAGE_EMIT_FOG 0x0010
-#define SAVAGE_EMIT_S0 0x0020
-#define SAVAGE_EMIT_T0 0x0040
-#define SAVAGE_EMIT_Q0 0x0080
-#define SAVAGE_EMIT_ST0 0x0060
-#define SAVAGE_EMIT_STQ0 0x00e0
-#define SAVAGE_EMIT_S1 0x0100
-#define SAVAGE_EMIT_T1 0x0200
-#define SAVAGE_EMIT_ST1 0x0300
-
-
-static __inline__ GLuint savageChooseVertexFormat_s3d( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLuint setupIndex = SAVAGE_EMIT_XYZ;
- GLubyte skip;
-
- imesa->vertex_attr_count = 0;
-
- skip = SAVAGE_SKIP_ALL_S3D;
- skip &= ~SAVAGE_SKIP_Z; /* all mesa vertices have a z coordinate */
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if ((index & _TNL_BITS_TEX_ANY) || !(ctx->_TriangleCaps & DD_FLATSHADE))
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, SAVAGE_EMIT_W, SAVAGE_SKIP_W );
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 0 );
- EMIT_PAD( 4 );
- skip &= ~SAVAGE_SKIP_W;
- }
-
- /* t_context.c always includes a diffuse color */
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, SAVAGE_EMIT_C0, SAVAGE_SKIP_C0 );
-
- if ((index & _TNL_BIT_COLOR1))
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, SAVAGE_EMIT_C1, SAVAGE_SKIP_C1 );
- else
- EMIT_PAD( 3 );
- if ((index & _TNL_BIT_FOG))
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, SAVAGE_EMIT_FOG, SAVAGE_SKIP_C1 );
- else
- EMIT_PAD( 1 );
- skip &= ~SAVAGE_SKIP_C1;
-
- if (index & _TNL_BIT_TEX(0)) {
- if (imesa->ptexHack)
- EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW, SAVAGE_EMIT_STQ0, SAVAGE_SKIP_ST0);
- else if (VB->TexCoordPtr[0]->size == 4)
- assert (0); /* should be caught by savageCheckPTexHack */
- else if (VB->TexCoordPtr[0]->size >= 2)
- /* The chromium menu emits some 3D tex coords even though no
- * 3D texture is enabled. Ignore the 3rd coordinate. */
- EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, SAVAGE_EMIT_ST0, SAVAGE_SKIP_ST0 );
- else if (VB->TexCoordPtr[0]->size == 1) {
- EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_1F, SAVAGE_EMIT_S0, SAVAGE_SKIP_S0 );
- EMIT_PAD( 4 );
- } else
- EMIT_PAD( 8 );
- } else
- EMIT_PAD( 8 );
- skip &= ~SAVAGE_SKIP_ST0;
-
- assert (skip == 0);
- imesa->skip = skip;
- return setupIndex;
-}
-
-
-static __inline__ GLuint savageChooseVertexFormat_s4( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLuint setupIndex = SAVAGE_EMIT_XYZ;
- GLubyte skip;
- GLuint size, mask;
-
- skip = SAVAGE_SKIP_ALL_S4;
- skip &= ~SAVAGE_SKIP_Z; /* all mesa vertices have a z coordinate */
-
- if ((index & _TNL_BITS_TEX_ANY) || !(ctx->_TriangleCaps & DD_FLATSHADE))
- NEED_ATTR( SAVAGE_EMIT_W, SAVAGE_SKIP_W );
-
- /* t_context.c always includes a diffuse color */
- NEED_ATTR( SAVAGE_EMIT_C0, SAVAGE_SKIP_C0 );
-
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
- if ((index & _TNL_BIT_COLOR1))
- NEED_ATTR( SAVAGE_EMIT_C1, SAVAGE_SKIP_C1 );
- if ((index & _TNL_BIT_FOG))
- NEED_ATTR( SAVAGE_EMIT_FOG, SAVAGE_SKIP_C1 );
- }
-
- if (index & _TNL_BIT_TEX(0)) {
- if (imesa->ptexHack)
- NEED_ATTR( SAVAGE_EMIT_STQ0, SAVAGE_SKIP_ST0);
- else if (VB->TexCoordPtr[0]->size == 4)
- assert (0); /* should be caught by savageCheckPTexHack */
- else if (VB->TexCoordPtr[0]->size >= 2)
- /* The chromium menu emits some 3D tex coords even though no
- * 3D texture is enabled. Ignore the 3rd coordinate. */
- NEED_ATTR( SAVAGE_EMIT_ST0, SAVAGE_SKIP_ST0 );
- else
- NEED_ATTR( SAVAGE_EMIT_S0, SAVAGE_SKIP_S0 );
- }
- if (index & _TNL_BIT_TEX(1)) {
- if (VB->TexCoordPtr[1]->size == 4)
- /* projective textures are not supported by the hardware */
- assert (0); /* should be caught by savageCheckPTexHack */
- else if (VB->TexCoordPtr[1]->size >= 2)
- NEED_ATTR( SAVAGE_EMIT_ST1, SAVAGE_SKIP_ST1 );
- else
- NEED_ATTR( SAVAGE_EMIT_S1, SAVAGE_SKIP_S1 );
- }
-
- /* if nothing changed we can skip the rest */
- if (setupIndex == imesa->SetupIndex && imesa->vertex_size != 0)
- return setupIndex;
-
- if (imesa->enable_vdma) {
- mask = SAVAGE_SKIP_W;
- size = 10 - (skip & 1) - (skip >> 1 & 1) -
- (skip >> 2 & 1) - (skip >> 3 & 1) - (skip >> 4 & 1) -
- (skip >> 5 & 1) - (skip >> 6 & 1) - (skip >> 7 & 1);
-
- while (size < 8) {
- if (skip & mask) {
- skip &= ~mask;
- size++;
- }
- mask <<= 1;
- }
- }
-
- imesa->vertex_attr_count = 0;
-
- if (skip & SAVAGE_SKIP_W)
- DO_EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT );
- else if (setupIndex & SAVAGE_EMIT_W)
- DO_EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT );
- else {
- DO_EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT );
- EMIT_PAD( 4 );
- }
-
- DO_EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA );
-
- if (!(skip & SAVAGE_SKIP_C1)) {
- if (!(setupIndex & (SAVAGE_EMIT_C1|SAVAGE_EMIT_FOG)))
- EMIT_PAD( 4 );
- else {
- if (setupIndex & SAVAGE_EMIT_C1)
- DO_EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR );
- else
- EMIT_PAD( 3 );
- if (setupIndex & SAVAGE_EMIT_FOG)
- DO_EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F );
- else
- EMIT_PAD( 1 );
- }
- }
-
- if ((skip & SAVAGE_SKIP_ST0) != SAVAGE_SKIP_ST0) {
- if ((setupIndex & SAVAGE_EMIT_STQ0) == SAVAGE_EMIT_STQ0)
- DO_EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW );
- else if ((setupIndex & SAVAGE_EMIT_ST0) == SAVAGE_EMIT_ST0)
- DO_EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F );
- else if ((setupIndex & SAVAGE_EMIT_ST0) == SAVAGE_EMIT_S0) {
- DO_EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_1F );
- if (!(skip & SAVAGE_SKIP_T0)) EMIT_PAD( 4 );
- } else {
- if (!(skip & SAVAGE_SKIP_S0)) EMIT_PAD( 4 );
- if (!(skip & SAVAGE_SKIP_T0)) EMIT_PAD( 4 );
- }
- }
-
- if ((skip & SAVAGE_SKIP_ST1) != SAVAGE_SKIP_ST1) {
- if ((setupIndex & SAVAGE_EMIT_ST1) == SAVAGE_EMIT_ST1)
- DO_EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F );
- else if ((setupIndex & SAVAGE_EMIT_ST1) == SAVAGE_EMIT_S1) {
- DO_EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_1F );
- if (!(skip & SAVAGE_SKIP_T1)) EMIT_PAD( 4 );
- } else {
- if (!(skip & SAVAGE_SKIP_S1)) EMIT_PAD( 4 );
- if (!(skip & SAVAGE_SKIP_T1)) EMIT_PAD( 4 );
- }
- }
-
- imesa->skip = skip;
- return setupIndex;
-}
-
-
-static void savageRenderStart( GLcontext *ctx )
-{
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint setupIndex = SAVAGE_EMIT_XYZ;
- GLboolean ptexHack;
-
- /* Check if we need to apply the ptex hack. Choose a new render
- * state if necessary. (Note: this can't be done in
- * savageRunPipeline, since the number of vertex coordinates can
- * change in the pipeline. texmat or texgen or both?) */
- ptexHack = savageCheckPTexHack( ctx );
- if (ptexHack != imesa->ptexHack) {
- imesa->ptexHack = ptexHack;
- savageChooseRenderState (ctx);
- }
- /* Handle fallback cases identified in savageCheckPTexHack. */
- if (SAVAGE_CONTEXT(ctx)->Fallback) {
- tnl->Driver.Render.Start(ctx);
- return;
- }
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
-
- if (imesa->savageScreen->chipset < S3_SAVAGE4) {
- setupIndex = savageChooseVertexFormat_s3d(ctx);
- } else {
- setupIndex = savageChooseVertexFormat_s4(ctx);
- }
-
- /* Need to change the vertex emit code if the SetupIndex changed or
- * is set for the first time (indicated by vertex_size == 0). */
- if (setupIndex != imesa->SetupIndex || imesa->vertex_size == 0) {
- GLuint hwVertexSize;
- imesa->vertex_size =
- _tnl_install_attrs( ctx,
- imesa->vertex_attrs,
- imesa->vertex_attr_count,
- imesa->hw_viewport, 0 );
- imesa->vertex_size >>= 2;
- imesa->SetupIndex = setupIndex;
-
- hwVertexSize = imesa->vertex_size;
- if (setupIndex & SAVAGE_EMIT_Q0) {
- /* The vertex setup code emits homogenous texture
- * coordinates. They are converted to normal 2D coords by
- * savage_ptex_tri/line/point. Now we have two different
- * vertex sizes. Functions that emit vertices to the hardware
- * need to use HwVertexSize, anything that manipulates the
- * vertices generated by t_vertex uses vertex_size. */
- hwVertexSize--;
- assert (imesa->ptexHack);
- } else
- assert (!imesa->ptexHack);
-
- if (hwVertexSize != imesa->HwVertexSize) {
- /* Changing the vertex size: flush vertex and command buffer and
- * discard the DMA buffer, if we were using one. */
- savageFlushVertices(imesa);
- savageFlushCmdBuf(imesa, GL_TRUE);
- if (hwVertexSize == 8 && imesa->enable_vdma) {
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf (stderr, "Using DMA, skip=0x%02x\n", imesa->skip);
- /* we can use vertex dma */
- imesa->vtxBuf = &imesa->dmaVtxBuf;
- } else {
- if (SAVAGE_DEBUG & DEBUG_DMA)
- fprintf (stderr, "Not using DMA, skip=0x%02x\n", imesa->skip);
- imesa->vtxBuf = &imesa->clientVtxBuf;
- }
- imesa->HwVertexSize = hwVertexSize;
- }
- }
-}
-
-static void savageRenderFinish( GLcontext *ctx )
-{
- /* Flush the last primitive now, before any state is changed. */
- savageFlushVertices(SAVAGE_CONTEXT(ctx));
-
- if (SAVAGE_CONTEXT(ctx)->RenderIndex & SAVAGE_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-static const char * const fallbackStrings[] = {
- "Texture mode",
- "Draw buffer",
- "Read buffer",
- "Color mask",
- "Specular",
- "LogicOp",
- "glEnable(GL_STENCIL) without hw stencil buffer",
- "glRenderMode(selection or feedback)",
- "glBlendEquation",
- "Hardware rasterization disabled",
- "Projective texture",
-};
-
-void savageFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- GLuint oldfallback = imesa->Fallback;
- GLuint index;
- for (index = 0; (1 << index) < bit; ++index);
-
- if (mode) {
- imesa->Fallback |= bit;
- if (oldfallback == 0) {
- /* the first fallback */
- _swsetup_Wakeup( ctx );
- imesa->RenderIndex = ~0;
- }
- if (!(oldfallback & bit) && (SAVAGE_DEBUG & DEBUG_FALLBACKS))
- fprintf (stderr, "Savage begin fallback: 0x%x %s\n",
- bit, fallbackStrings[index]);
- }
- else {
- imesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- /* the last fallback */
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = savageRenderStart;
- tnl->Driver.Render.PrimitiveNotify = savageRenderPrimitive;
- tnl->Driver.Render.Finish = savageRenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_invalidate_vertex_state( ctx, ~0 );
- _tnl_invalidate_vertices( ctx, ~0 );
- _tnl_install_attrs( ctx,
- imesa->vertex_attrs,
- imesa->vertex_attr_count,
- imesa->hw_viewport, 0 );
-
- imesa->new_gl_state |= _SAVAGE_NEW_RENDER_STATE;
- }
- if ((oldfallback & bit) && (SAVAGE_DEBUG & DEBUG_FALLBACKS))
- fprintf (stderr, "Savage end fallback: 0x%x %s\n",
- bit, fallbackStrings[index]);
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void savageInitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = savageRunPipeline;
- tnl->Driver.Render.Start = savageRenderStart;
- tnl->Driver.Render.Finish = savageRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = savageRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- (6 + 2*ctx->Const.MaxTextureUnits) * sizeof(GLfloat) );
-
- SAVAGE_CONTEXT(ctx)->verts = (char *)tnl->clipspace.vertex_buf;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.h
deleted file mode 100644
index 00803e7ff..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/savagetris.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.4 2001/01/08 01:07:24 martin Exp $ */
-/**************************************************************************
-
-Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
- VA Linux Systems Inc., Fremont, California.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ATI, VA LINUX SYSTEMS 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 <keithw@valinux.com>
- * Felix Kuehling <fxkuehl@gmx.de>
- *
- */
-
-#ifndef __R128_TRIS_H__
-#define __R128_TRIS_H__
-
-#include "mtypes.h"
-
-extern void savageInitTriFuncs( GLcontext *ctx );
-
-
-extern void savageFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( ctx, bit, mode ) savageFallback( ctx, bit, mode )
-
-
-#endif /* __R128_TRIS_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/server/savage_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/server/savage_dri.h
deleted file mode 100644
index 214d9851a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/savage/server/savage_dri.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef __SAVAGE_DRI_H__
-#define __SAVAGE_DRI_H__
-
-#include "drm.h"
-
-typedef struct {
- int chipset;
- int width;
- int height;
- int mem;
- int cpp;
- int zpp;
-
- int agpMode; /* 0 for PCI cards */
-
- unsigned int sarea_priv_offset;
-
- unsigned int bufferSize; /* size of DMA buffers */
-
- unsigned int frontbufferSize;
- unsigned int frontOffset;
-
- unsigned int backbufferSize;
- unsigned int backOffset;
-
- unsigned int depthbufferSize;
- unsigned int depthOffset;
-
- unsigned int textureOffset;
- unsigned int textureSize;
- int logTextureGranularity;
-
- /* Linear aperture */
- drm_handle_t apertureHandle;
- unsigned int apertureSize;
- unsigned int aperturePitch; /* in byte */
-
- /* Status page (probably not needed, but no harm, read-only) */
- drm_handle_t statusHandle;
- unsigned int statusSize;
-
- /* AGP textures */
- drm_handle_t agpTextureHandle;
- unsigned int agpTextureSize;
- int logAgpTextureGranularity;
-
- /* Not sure about this one */
- drm_handle_t xvmcSurfHandle; /* ? */
-} SAVAGEDRIRec, *SAVAGEDRIPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/Makefile
deleted file mode 100644
index 32c64bdbf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# src/mesa/drivers/dri/sis/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = sis_dri.so
-
-
-# Not yet
-# MINIGLX_SOURCES = server/sis_dri.c
-
-DRIVER_SOURCES = \
- sis_alloc.c \
- sis_clear.c \
- sis_context.c \
- sis_dd.c \
- sis_fog.c \
- sis_lock.c \
- sis_screen.c \
- sis_span.c \
- sis_state.c \
- sis_stencil.c \
- sis_tex.c \
- sis_texstate.c \
- sis_tris.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_common.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_common.h
deleted file mode 100644
index cbddf0c73..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_common.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h,v 1.1 2003/08/29 08:52:12 twini Exp $ */
-/*
- * Common header definitions for SiS 2D/3D/DRM suite
- *
- * Copyright (C) 2003 Eric Anholt
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holder not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. The copyright holder makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Author:
- * Eric Anholt <anholt@FreeBSD.org>
- *
- */
-
-#ifndef _SIS_COMMON_H_
-#define _SIS_COMMON_H_
-
-#define DRM_SIS_FB_ALLOC 0x04
-#define DRM_SIS_FB_FREE 0x05
-#define DRM_SIS_FLIP 0x08
-#define DRM_SIS_FLIP_INIT 0x09
-#define DRM_SIS_FLIP_FINAL 0x10
-#define DRM_SIS_AGP_INIT 0x13
-#define DRM_SIS_AGP_ALLOC 0x14
-#define DRM_SIS_AGP_FREE 0x15
-#define DRM_SIS_FB_INIT 0x16
-
-typedef struct {
- int context;
- unsigned long offset;
- unsigned long size;
- void *free;
-} drm_sis_mem_t;
-
-typedef struct {
- unsigned long offset, size;
-} drm_sis_agp_t;
-
-typedef struct {
- unsigned long offset, size;
-} drm_sis_fb_t;
-
-typedef struct {
- unsigned int left, right;
-} drm_sis_flip_t;
-
-#endif /* _SIS_COMMON_H_ */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_dri.h
deleted file mode 100644
index a05662430..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/server/sis_dri.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.9 2003/08/29 08:50:54 twini Exp $ */
-
-/* modified from tdfx_dri.h */
-
-#ifndef _SIS_DRI_
-#define _SIS_DRI_
-
-#include "xf86drm.h"
-#include "drm.h"
-
-#define SIS_MAX_DRAWABLES 256
-#define SISIOMAPSIZE (64*1024)
-
-typedef struct {
- int CtxOwner;
- int QueueLength;
- unsigned int AGPCmdBufNext;
- unsigned int FrameCount;
-#ifdef SIS315DRI
- /* For 315 series */
- unsigned long sharedWPoffset;
-#endif
-#if 0
- unsigned char *AGPCmdBufBase;
- unsigned long AGPCmdBufAddr;
- unsigned long AGPCmdBufOffset;
- unsigned int AGPCmdBufSize;
- unsigned long AGPCmdBufNext;
-#endif
-} SISSAREAPriv, *SISSAREAPrivPtr;
-
-#define AGPVtxBufNext AGPCmdBufNext
-
-#define SIS_FRONT 0
-#define SIS_BACK 1
-#define SIS_DEPTH 2
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
-} sisRegion, *sisRegionPtr;
-
-typedef struct {
- sisRegion regs, agp;
- int deviceID;
- int width;
- int height;
- int mem; /* unused in Mesa 3 DRI */
- int bytesPerPixel;
- int priv1; /* unused in Mesa 3 DRI */
- int priv2; /* unused in Mesa 3 DRI */
- int fbOffset; /* unused in Mesa 3 DRI */
- int backOffset; /* unused in Mesa 3 DRI */
- int depthOffset; /* unused in Mesa 3 DRI */
- int textureOffset; /* unused in Mesa 3 DRI */
- int textureSize; /* unused in Mesa 3 DRI */
- unsigned int AGPCmdBufOffset;
- unsigned int AGPCmdBufSize;
- int irqEnabled; /* unused in Mesa 3 DRI */
- unsigned int scrnX, scrnY; /* unused in Mesa 3 DRI */
-} SISDRIRec, *SISDRIPtr;
-
-#define AGPVtxBufOffset AGPCmdBufOffset
-#define AGPVtxBufSize AGPCmdBufSize
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} SISConfigPrivRec, *SISConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} SISDRIContextRec, *SISDRIContextPtr;
-
-#ifdef XFree86Server
-
-#include "screenint.h"
-
-Bool SISDRIScreenInit(ScreenPtr pScreen);
-void SISDRICloseScreen(ScreenPtr pScreen);
-Bool SISDRIFinishScreenInit(ScreenPtr pScreen);
-
-#endif
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.c
deleted file mode 100644
index b808daae3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c,v 1.7 2001/01/08 01:07:29 martin Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_alloc.h"
-
-#include "sis_common.h"
-
-#include <unistd.h>
-
-#define Z_BUFFER_HW_ALIGNMENT 16
-#define Z_BUFFER_HW_PLUS (16 + 4)
-
-/* 3D engine uses 2, and bitblt uses 4 */
-#define DRAW_BUFFER_HW_ALIGNMENT 16
-#define DRAW_BUFFER_HW_PLUS (16 + 4)
-
-#define ALIGNMENT(value, align) (((value) + (align) - 1) / (align) * (align))
-
-static int _total_video_memory_used = 0;
-static int _total_video_memory_count = 0;
-
-void *
-sisAllocFB( sisContextPtr smesa, GLuint size, void **handle )
-{
- drm_sis_mem_t fb;
-
- _total_video_memory_used += size;
-
- fb.context = smesa->hHWContext;
- fb.size = size;
- if (drmCommandWriteRead( smesa->driFd, DRM_SIS_FB_ALLOC, &fb,
- sizeof(drm_sis_mem_t) ) || fb.offset == 0)
- {
- return NULL;
- }
- *handle = (void *)fb.free;
-
- if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) {
- fprintf(stderr, "sisAllocFB: size=%d, offset=%lu, pid=%d, count=%d\n",
- size, fb.offset, (GLint)getpid(),
- ++_total_video_memory_count);
- }
-
- return (void *)(smesa->FbBase + fb.offset);
-}
-
-void
-sisFreeFB( sisContextPtr smesa, void *handle )
-{
- drm_sis_mem_t fb;
-
- if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) {
- fprintf(stderr, "sisFreeFB: free=%p, pid=%d, count=%d\n",
- handle, (GLint)getpid(), --_total_video_memory_count);
- }
-
- fb.context = smesa->hHWContext;
- fb.free = handle;
- drmCommandWrite( smesa->driFd, DRM_SIS_FB_FREE, &fb, sizeof(drm_sis_mem_t) );
-}
-
-void *
-sisAllocAGP( sisContextPtr smesa, GLuint size, void **handle )
-{
- drm_sis_mem_t agp;
-
- if (smesa->AGPSize == 0)
- return NULL;
-
- agp.context = smesa->hHWContext;
- agp.size = size;
- if (drmCommandWriteRead( smesa->driFd, DRM_SIS_AGP_ALLOC, &agp,
- sizeof(drm_sis_mem_t) ) || agp.offset == 0)
- {
- return NULL;
- }
- *handle = (void *)agp.free;
-
- if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) {
- fprintf(stderr, "sisAllocAGP: size=%u, offset=%lu, pid=%d, count=%d\n",
- size, agp.offset, (GLint)getpid(),
- ++_total_video_memory_count);
- }
-
- return (void *)(smesa->AGPBase + agp.offset);
-}
-
-void
-sisFreeAGP( sisContextPtr smesa, void *handle )
-{
- drm_sis_mem_t agp;
-
- if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) {
- fprintf(stderr, "sisFreeAGP: free=%p, pid=%d, count=%d\n",
- handle, (GLint)getpid(), --_total_video_memory_count);
- }
-
- agp.context = smesa->hHWContext;
- agp.free = handle;
- drmCommandWrite( smesa->driFd, DRM_SIS_AGP_FREE, &agp,
- sizeof(drm_sis_mem_t) );
-}
-
-void
-sisAllocZStencilBuffer( sisContextPtr smesa )
-{
- GLuint z_depth;
- GLuint totalBytes;
- int width2;
-
- GLubyte *addr;
-
- z_depth = ( smesa->glCtx->Visual.depthBits +
- smesa->glCtx->Visual.stencilBits ) / 8;
-
- width2 = ALIGNMENT( smesa->width * z_depth, 4 );
-
- totalBytes = smesa->height * width2 + Z_BUFFER_HW_PLUS;
-
- addr = sisAllocFB( smesa, totalBytes, &smesa->zbFree );
- if (addr == NULL)
- sis_fatal_error("Failure to allocate Z buffer.\n");
-
- if (SIS_VERBOSE & VERBOSE_SIS_BUFFER) {
- fprintf(stderr, "sis_alloc_z_stencil_buffer: addr=%p\n", addr);
- }
-
- addr = (GLubyte *)ALIGNMENT( (unsigned long)addr, Z_BUFFER_HW_ALIGNMENT );
-
- smesa->depthbuffer = (void *) addr;
- smesa->depthPitch = width2;
- smesa->depthOffset = (unsigned long)addr - (unsigned long)smesa->FbBase;
-
- /* set pZClearPacket */
- memset( &smesa->zClearPacket, 0, sizeof(ENGPACKET) );
-
- smesa->zClearPacket.dwSrcPitch = (z_depth == 2) ? 0x80000000 : 0xf0000000;
- smesa->zClearPacket.dwDestBaseAddr = (unsigned long)(addr -
- (unsigned long)smesa->FbBase);
- smesa->zClearPacket.wDestPitch = width2;
- smesa->zClearPacket.stdwDestPos.wY = 0;
- smesa->zClearPacket.stdwDestPos.wX = 0;
-
- smesa->zClearPacket.wDestHeight = smesa->virtualY;
- smesa->zClearPacket.stdwDim.wWidth = (GLshort)width2 / z_depth;
- smesa->zClearPacket.stdwDim.wHeight = (GLshort)smesa->height;
- smesa->zClearPacket.stdwCmd.cRop = 0xf0;
-
- if (smesa->blockWrite)
- smesa->zClearPacket.stdwCmd.cCmd0 = CMD0_PAT_FG_COLOR;
- else
- smesa->zClearPacket.stdwCmd.cCmd0 = 0;
- smesa->zClearPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC;
-}
-
-void
-sisFreeZStencilBuffer( sisContextPtr smesa )
-{
- sisFreeFB( smesa, smesa->zbFree );
- smesa->zbFree = NULL;
- smesa->depthbuffer = NULL;
-}
-
-void
-sisAllocBackbuffer( sisContextPtr smesa )
-{
- GLuint depth = smesa->bytesPerPixel;
- GLuint size, width2;
-
- char *addr;
-
- width2 = (depth == 2) ? ALIGNMENT (smesa->width, 2) : smesa->width;
- size = width2 * smesa->height * depth + DRAW_BUFFER_HW_PLUS;
-
- /* Fixme: unique context alloc/free back-buffer? */
- addr = sisAllocFB( smesa, size, &smesa->bbFree );
- if (addr == NULL)
- sis_fatal_error("Failure to allocate back buffer.\n");
-
- addr = (char *)ALIGNMENT( (unsigned long)addr, DRAW_BUFFER_HW_ALIGNMENT );
-
- smesa->backbuffer = addr;
- smesa->backOffset = (unsigned long)(addr - (unsigned long)smesa->FbBase);
- smesa->backPitch = width2 * depth;
-
- memset ( &smesa->cbClearPacket, 0, sizeof(ENGPACKET) );
-
- smesa->cbClearPacket.dwSrcPitch = (depth == 2) ? 0x80000000 : 0xf0000000;
- smesa->cbClearPacket.dwDestBaseAddr = smesa->backOffset;
- smesa->cbClearPacket.wDestPitch = smesa->backPitch;
- smesa->cbClearPacket.stdwDestPos.wY = 0;
- smesa->cbClearPacket.stdwDestPos.wX = 0;
-
- smesa->cbClearPacket.wDestHeight = smesa->virtualY;
- smesa->cbClearPacket.stdwDim.wWidth = (GLshort) width2;
- smesa->cbClearPacket.stdwDim.wHeight = (GLshort) smesa->height;
- smesa->cbClearPacket.stdwCmd.cRop = 0xf0;
-
- if (smesa->blockWrite)
- smesa->cbClearPacket.stdwCmd.cCmd0 = (GLbyte)(CMD0_PAT_FG_COLOR);
- else
- smesa->cbClearPacket.stdwCmd.cCmd0 = 0;
- smesa->cbClearPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC;
-}
-
-void
-sisFreeBackbuffer( sisContextPtr smesa )
-{
- sisFreeFB( smesa, smesa->bbFree );
- smesa->backbuffer = NULL;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.h
deleted file mode 100644
index e76fc53fe..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_alloc.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-enum {
- VIDEO_TYPE,
- AGP_TYPE
-};
-
-void sisAllocZStencilBuffer( sisContextPtr smesa );
-void sisFreeZStencilBuffer( sisContextPtr smesa );
-void sisAllocBackbuffer( sisContextPtr smesa );
-void sisFreeBackbuffer ( sisContextPtr smesa );
-void *sisAllocFB( sisContextPtr smesa, GLuint size, void **handle );
-void sisFreeFB( sisContextPtr smesa, void *handle );
-void *sisAllocAGP( sisContextPtr smesa, GLuint size, void **handle );
-void sisFreeAGP( sisContextPtr smesa, void *handle );
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_clear.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_clear.c
deleted file mode 100644
index 7b68aadc7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_clear.c
+++ /dev/null
@@ -1,451 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_clear.c,v 1.5 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_state.h"
-#include "sis_lock.h"
-
-#include "swrast/swrast.h"
-#include "macros.h"
-
-static GLbitfield sis_3D_Clear( GLcontext * ctx, GLbitfield mask,
- GLint x, GLint y, GLint width,
- GLint height );
-static void sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x,
- GLint y, GLint width, GLint height );
-static void sis_clear_z_stencil_buffer( GLcontext * ctx,
- GLbitfield mask, GLint x,
- GLint y, GLint width,
- GLint height );
-
-static void
-set_color_pattern( sisContextPtr smesa, GLubyte red, GLubyte green,
- GLubyte blue, GLubyte alpha )
-{
- /* XXX only RGB565 and ARGB8888 */
- switch (smesa->colorFormat)
- {
- case DST_FORMAT_ARGB_8888:
- smesa->clearColorPattern = (alpha << 24) +
- (red << 16) + (green << 8) + (blue);
- break;
- case DST_FORMAT_RGB_565:
- smesa->clearColorPattern = ((red >> 3) << 11) +
- ((green >> 2) << 5) + (blue >> 3);
- smesa->clearColorPattern |= smesa->clearColorPattern << 16;
- break;
- default:
- sis_fatal_error("Bad dst color format\n");
- }
-}
-
-void
-sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil )
-{
- GLuint zPattern;
-
- switch (smesa->zFormat)
- {
- case SiS_ZFORMAT_Z16:
- CLAMPED_FLOAT_TO_USHORT(zPattern, z);
- zPattern |= zPattern << 16;
- break;
- case SiS_ZFORMAT_S8Z24:
- zPattern = FLOAT_TO_UINT(z) >> 8;
- zPattern |= stencil << 24;
- break;
- case SiS_ZFORMAT_Z32:
- zPattern = FLOAT_TO_UINT(z);
- break;
- default:
- sis_fatal_error("Bad Z format\n");
- }
- smesa->clearZStencilPattern = zPattern;
-}
-
-void
-sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- GLint x1, y1, width1, height1;
-
- if (all) {
- GLframebuffer *buffer = ctx->DrawBuffer;
-
- x1 = 0;
- y1 = 0;
- width1 = buffer->Width;
- height1 = buffer->Height;
- } else {
- x1 = x;
- y1 = Y_FLIP(y+height-1);
- width1 = width;
- height1 = height;
- }
- /* XXX: Scissoring */
-
- /* Mask out any non-existent buffers */
- if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask)
- mask &= ~BUFFER_BIT_DEPTH;
- if (ctx->Visual.stencilBits == 0)
- mask &= ~BUFFER_BIT_STENCIL;
-
- LOCK_HARDWARE();
-
- /* The 3d clear code is use for masked clears because apparently the SiS
- * 300-series can't do write masks for 2d blits. 3d isn't used in general
- * because it's slower, even in the case of clearing multiple buffers.
- */
- /* XXX: Appears to be broken with stencil. */
- if ((smesa->current.hwCapEnable2 & (MASK_AlphaMaskWriteEnable |
- MASK_ColorMaskWriteEnable) &&
- (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0) ||
- (ctx->Stencil.WriteMask[0] < 0xff && (mask & BUFFER_BIT_STENCIL) != 0) )
- {
- mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 );
- }
-
- if ( mask & BUFFER_BIT_FRONT_LEFT || mask & BUFFER_BIT_BACK_LEFT) {
- sis_clear_color_buffer( ctx, mask, x1, y1, width1, height1 );
- mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
- }
-
- if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) {
- if (smesa->depthbuffer != NULL)
- sis_clear_z_stencil_buffer( ctx, mask, x1, y1, width1, height1 );
- mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
- }
-
- UNLOCK_HARDWARE();
-
- if (mask != 0)
- _swrast_Clear( ctx, mask, all, x1, y1, width, height );
-}
-
-
-void
-sisDDClearColor( GLcontext * ctx, const GLfloat color[4] )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- GLubyte c[4];
-
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
-
- set_color_pattern( smesa, c[0], c[1], c[2], c[3] );
-}
-
-void
-sisDDClearDepth( GLcontext * ctx, GLclampd d )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- sisUpdateZStencilPattern( smesa, d, ctx->Stencil.Clear );
-}
-
-void
-sisDDClearStencil( GLcontext * ctx, GLint s )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- sisUpdateZStencilPattern( smesa, ctx->Depth.Clear, s );
-}
-
-static GLbitfield
-sis_3D_Clear( GLcontext * ctx, GLbitfield mask,
- GLint x, GLint y, GLint width, GLint height )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *current = &smesa->current;
-
- float left, top, right, bottom, zClearVal;
- GLboolean bClrColor, bClrDepth, bClrStencil;
- GLint dwPrimitiveSet;
- GLint dwEnable1 = 0, dwEnable2 = MASK_ColorMaskWriteEnable;
- GLint dwDepthMask = 0, dwSten1 = 0, dwSten2 = 0;
- GLint dirtyflags = GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 |
- GFLAG_CLIPPING | GFLAG_DESTSETTING;
- int count;
- drm_clip_rect_t *pExtents;
-
- bClrColor = (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0;
- bClrDepth = (mask & BUFFER_BIT_DEPTH) != 0;
- bClrStencil = (mask & BUFFER_BIT_STENCIL) != 0;
-
- if (smesa->GlobalFlag & GFLAG_RENDER_STATES)
- sis_update_render_state( smesa );
-
- if (bClrStencil) {
- dwSten1 = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS |
- (ctx->Stencil.Clear << 8) | 0xff;
- dwSten2 = SiS_SFAIL_REPLACE | SiS_SPASS_ZFAIL_REPLACE |
- SiS_SPASS_ZPASS_REPLACE;
- dwEnable1 = MASK_ZWriteEnable | MASK_StencilWriteEnable |
- MASK_StencilTestEnable;
- dwEnable2 |= MASK_ZMaskWriteEnable;
- dwDepthMask |= ctx->Stencil.WriteMask[0] << 24;
- } else if (bClrDepth) {
- dwEnable1 = MASK_ZWriteEnable;
- dwEnable2 |= MASK_ZMaskWriteEnable;
- }
-
- if (bClrDepth) {
- zClearVal = ctx->Depth.Clear;
- if (ctx->Visual.depthBits != 32)
- dwDepthMask |= 0x00ffffff;
- else
- dwDepthMask = 0xffffffff;
- } else
- zClearVal = 0.0;
-
- mWait3DCmdQueue(9);
- MMIO(REG_3D_TEnable, dwEnable1);
- MMIO(REG_3D_TEnable2, dwEnable2);
- if (bClrDepth || bClrStencil) {
- MMIO(REG_3D_ZSet, (current->hwZ & ~MASK_ZTestMode) | SiS_Z_COMP_ALWAYS);
- dirtyflags |= GFLAG_ZSETTING;
- }
- if (bClrColor) {
- MMIO(REG_3D_DstSet, (current->hwDstSet & ~MASK_ROP2) | LOP_COPY);
- } else {
- MMIO(REG_3D_DstAlphaWriteMask, 0L);
- }
- if (bClrStencil) {
- MMIO(REG_3D_StencilSet, dwSten1);
- MMIO(REG_3D_StencilSet2, dwSten2);
- dirtyflags |= GFLAG_STENCILSETTING;
- }
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- pExtents = smesa->driDrawable->pClipRects;
- count = smesa->driDrawable->numClipRects;
- } else {
- pExtents = NULL;
- count = 1;
- }
-
- while(count--) {
- left = x;
- right = x + width;
- top = y;
- bottom = y + height;
-
- if (pExtents != NULL) {
- GLuint x1, y1, x2, y2;
-
- x1 = pExtents->x1 - smesa->driDrawable->x;
- y1 = pExtents->y1 - smesa->driDrawable->y;
- x2 = pExtents->x2 - smesa->driDrawable->x - 1;
- y2 = pExtents->y2 - smesa->driDrawable->y - 1;
-
- left = (left > x1) ? left : x1;
- right = (right > x2) ? x2 : right;
- top = (top > y1) ? top : y1;
- bottom = (bottom > y2) ? y2 : bottom;
- pExtents++;
- if (left > right || top > bottom)
- continue;
- }
-
- mWait3DCmdQueue(20);
-
- MMIO(REG_3D_ClipTopBottom, ((GLint)top << 13) | (GLint)bottom);
- MMIO(REG_3D_ClipLeftRight, ((GLint)left << 13) | (GLint)right);
-
- /* the first triangle */
- dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBc |
- SHADE_FLAT_VertexC;
- MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet);
-
- MMIO(REG_3D_TSZa, *(GLint *) &zClearVal);
- MMIO(REG_3D_TSXa, *(GLint *) &right);
- MMIO(REG_3D_TSYa, *(GLint *) &top);
- MMIO(REG_3D_TSARGBa, smesa->clearColorPattern);
-
- MMIO(REG_3D_TSZb, *(GLint *) &zClearVal);
- MMIO(REG_3D_TSXb, *(GLint *) &left);
- MMIO(REG_3D_TSYb, *(GLint *) &top);
- MMIO(REG_3D_TSARGBb, smesa->clearColorPattern);
-
- MMIO(REG_3D_TSZc, *(GLint *) &zClearVal);
- MMIO(REG_3D_TSXc, *(GLint *) &left);
- MMIO(REG_3D_TSYc, *(GLint *) &bottom);
- MMIO(REG_3D_TSARGBc, smesa->clearColorPattern);
-
- /* second triangle */
- dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBb |
- SHADE_FLAT_VertexB;
- MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet);
-
- MMIO(REG_3D_TSZb, *(GLint *) &zClearVal);
- MMIO(REG_3D_TSXb, *(GLint *) &right);
- MMIO(REG_3D_TSYb, *(GLint *) &bottom);
- MMIO(REG_3D_TSARGBb, smesa->clearColorPattern);
- }
-
- mEndPrimitive();
-
- /* If BUFFER_BIT_FRONT_LEFT is set, we've only cleared the front buffer so far */
- if ((mask & BUFFER_BIT_FRONT_LEFT) != 0 && (mask & BUFFER_BIT_BACK_LEFT) != 0)
- sis_3D_Clear( ctx, BUFFER_BIT_BACK_LEFT, x, y, width, height );
-
- smesa->GlobalFlag |= dirtyflags;
-
- return mask & ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL | BUFFER_BIT_BACK_LEFT |
- BUFFER_BIT_FRONT_LEFT);
-}
-
-static void
-sis_bitblt_clear_cmd( sisContextPtr smesa, ENGPACKET * pkt )
-{
- GLint *lpdwDest, *lpdwSrc;
- int i;
-
- lpdwSrc = (GLint *) pkt + 1;
- lpdwDest = (GLint *) (GET_IOBase (smesa) + REG_SRC_ADDR) + 1;
-
- mWait3DCmdQueue (10);
-
- *lpdwDest++ = *lpdwSrc++;
- lpdwSrc++;
- lpdwDest++;
- for (i = 3; i < 8; i++) {
- *lpdwDest++ = *lpdwSrc++;
- }
-
- MMIO(REG_CMD0, *(GLint *) & pkt->stdwCmd);
- MMIO(REG_CommandQueue, -1);
-}
-
-static void
-sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y,
- GLint width, GLint height )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- int count;
- GLuint depth = smesa->bytesPerPixel;
- drm_clip_rect_t *pExtents = NULL;
- GLint xx, yy;
- GLint x0, y0, width0, height0;
-
- ENGPACKET stEngPacket;
-
- /* Clear back buffer */
- if (mask & BUFFER_BIT_BACK_LEFT) {
- smesa->cbClearPacket.stdwDestPos.wY = y;
- smesa->cbClearPacket.stdwDestPos.wX = x;
- smesa->cbClearPacket.stdwDim.wWidth = (GLshort) width;
- smesa->cbClearPacket.stdwDim.wHeight = (GLshort) height;
- smesa->cbClearPacket.dwFgRopColor = smesa->clearColorPattern;
-
- sis_bitblt_clear_cmd( smesa, &smesa->cbClearPacket );
- }
-
- if ((mask & BUFFER_BIT_FRONT_LEFT) == 0)
- return;
-
- /* Clear front buffer */
- x0 = x;
- y0 = y;
- width0 = width;
- height0 = height;
-
- pExtents = smesa->driDrawable->pClipRects;
- count = smesa->driDrawable->numClipRects;
-
- memset( &stEngPacket, 0, sizeof (ENGPACKET) );
-
- stEngPacket.dwSrcPitch = (depth == 2) ? 0x80000000 : 0xc0000000;
- stEngPacket.dwDestBaseAddr = smesa->frontOffset;
- stEngPacket.wDestPitch = smesa->frontPitch;
- /* TODO: set maximum value? */
- stEngPacket.wDestHeight = smesa->virtualY;
- stEngPacket.stdwCmd.cRop = 0xf0;
- stEngPacket.dwFgRopColor = smesa->clearColorPattern;
-
- /* for SGRAM Block Write Enable */
- if (smesa->blockWrite)
- stEngPacket.stdwCmd.cCmd0 = CMD0_PAT_FG_COLOR;
- else
- stEngPacket.stdwCmd.cCmd0 = 0;
- stEngPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC;
-
- while (count--) {
- GLint x2 = pExtents->x1 - smesa->driDrawable->x;
- GLint y2 = pExtents->y1 - smesa->driDrawable->y;
- GLint xx2 = pExtents->x2 - smesa->driDrawable->x;
- GLint yy2 = pExtents->y2 - smesa->driDrawable->y;
-
- x = (x0 > x2) ? x0 : x2;
- y = (y0 > y2) ? y0 : y2;
- xx = ((x0 + width0) > (xx2)) ? xx2 : x0 + width0;
- yy = ((y0 + height0) > (yy2)) ? yy2 : y0 + height0;
- width = xx - x;
- height = yy - y;
- pExtents++;
-
- if (width <= 0 || height <= 0)
- continue;
-
- stEngPacket.stdwDestPos.wY = y;
- stEngPacket.stdwDestPos.wX = x;
- stEngPacket.stdwDim.wWidth = (GLshort)width;
- stEngPacket.stdwDim.wHeight = (GLshort)height;
-
- sis_bitblt_clear_cmd( smesa, &stEngPacket );
- }
-}
-
-static void
-sis_clear_z_stencil_buffer( GLcontext * ctx, GLbitfield mask,
- GLint x, GLint y, GLint width, GLint height )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- /* TODO: consider alignment of width, height? */
- smesa->zClearPacket.stdwDestPos.wY = y;
- smesa->zClearPacket.stdwDestPos.wX = x;
- smesa->zClearPacket.stdwDim.wWidth = (GLshort) width;
- smesa->zClearPacket.stdwDim.wHeight = (GLshort) height;
- smesa->zClearPacket.dwFgRopColor = smesa->clearZStencilPattern;
-
- sis_bitblt_clear_cmd( smesa, &smesa->zClearPacket );
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_common2.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_common2.h
deleted file mode 100644
index c52abd5e5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_common2.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and 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 SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_common.h,v 1.5 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- */
-
-#ifndef _sis_common_h_
-#define _sis_common_h_
-
-#if 0
-#define free(x)
-#define calloc(x,y) sis_debug_malloc((x)*(y))
-extern void *sis_debug_malloc(int x);
-#endif
-
-#if defined(SIS_DUMP)
-#include "sis_debug.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-typedef struct _Box
-{
- short x1, y1, x2, y2;
-}
-BoxRec;
-#define NullBox ((BoxPtr)0)
-typedef struct _Box *BoxPtr;
-
-/* BitBlt Commands */
-#define CMD0_DD_ENABLE 0x06
-#define CMD0_SRC_VIDEO 0x00
-#define CMD0_SRC_CPU 0x10
-#define CMD0_PAT_FG_COLOR 0x00
-#define CMD1_DIR_X_DEC 0x00
-#define CMD1_DIR_X_INC 0x01
-#define CMD1_DIR_Y_DEC 0x00
-#define CMD1_DIR_Y_INC 0x02
-#define REG_SRC_ADDR 0x8200
-#define REG_CMD0 0x823c
-
-typedef struct
-{
- GLshort wSrcPitch;
- GLshort wDestPitch;
-}
-_PITCH;
-typedef struct
-{
- GLshort wWidth;
- GLshort wHeight;
-}
-_DIM;
-typedef struct
-{
- GLshort wY;
- GLshort wX;
-}
-_POS;
-
-typedef struct
-{
- GLubyte cCmd0;
- GLubyte cRop;
- GLubyte cCmd1;
- GLubyte cReserved;
-}
-_CMD;
-
-typedef struct
-{
- GLshort wStatus0;
- GLbyte cStatus0_GLbyte3;
- GLbyte cStatus0_GLbyte4;
-}
-_CMDQUESTATUS;
-
-typedef struct
-{
- GLint dwSrcBaseAddr;
- GLint dwSrcPitch;
- _POS stdwSrcPos;
- _POS stdwDestPos;
- GLint dwDestBaseAddr;
- GLshort wDestPitch;
- GLshort wDestHeight;
- _DIM stdwDim;
- GLint dwFgRopColor;
- GLint dwBgRopColor;
- GLint dwSrcHiCKey;
- GLint dwSrcLoCKey;
- GLint dwMaskA;
- GLint dwMaskB;
- GLint dwClipA;
- GLint dwClipB;
- _CMD stdwCmd;
- _CMDQUESTATUS stdwCmdQueStatus;
-}
-ENGPACKET, *LPENGPACKET;
-
-/* Hardware Info */
-#include "sis_reg.h"
-
-/* HW capability */
-#define SIS_MAX_TEXTURE_SIZE 2048
-#define SIS_MAX_TEXTURES 2
-
-#define SIS_MAX_FRAME_LENGTH 3
-
-GLint doFPtoFixedNoRound( GLfloat dwInValue, int nFraction );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.c
deleted file mode 100644
index cfb7700af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_dri.h"
-
-#include "sis_context.h"
-#include "sis_state.h"
-#include "sis_dd.h"
-#include "sis_span.h"
-#include "sis_stencil.h"
-#include "sis_tex.h"
-#include "sis_tris.h"
-#include "sis_alloc.h"
-
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "utils.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#define need_GL_ARB_multisample
-#include "extension_helper.h"
-
-int GlobalCurrentHwcx = -1;
-int GlobalHwcxCountBase = 1;
-int GlobalCmdQueueLen = 0;
-
-struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_NV_blend_square", NULL },
- { NULL, NULL }
-};
-
-void
-WaitEngIdle (sisContextPtr smesa)
-{
- GLuint engineState;
-
- do {
- engineState = MMIO_READ(REG_CommandQueue);
- } while ((engineState & SiS_EngIdle) != SiS_EngIdle);
-}
-
-void
-Wait2DEngIdle (sisContextPtr smesa)
-{
- GLuint engineState;
-
- do {
- engineState = MMIO_READ(REG_CommandQueue);
- } while ((engineState & SiS_EngIdle2d) != SiS_EngIdle2d);
-}
-
-/* To be called from mWait3DCmdQueue. Separate function for profiling
- * purposes, and speed doesn't matter because we're spinning anyway.
- */
-void
-WaitingFor3dIdle(sisContextPtr smesa, int wLen)
-{
- while (*(smesa->CurrentQueueLenPtr) < wLen) {
- *(smesa->CurrentQueueLenPtr) =
- (MMIO_READ(REG_CommandQueue) & MASK_QueueLen) - 20;
- }
-}
-
-GLboolean
-sisCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- sisContextPtr smesa;
- sisScreenPtr sisScreen;
- int i;
- struct dd_function_table functions;
-
- smesa = (sisContextPtr)CALLOC( sizeof(*smesa) );
- if (smesa == NULL)
- return GL_FALSE;
-
- /* Init default driver functions then plug in our SIS-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions(&functions);
- sisInitDriverFuncs(&functions);
- sisInitTextureFuncs(&functions);
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((sisContextPtr)sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
- smesa->glCtx = _mesa_create_context( glVisual, shareCtx,
- &functions, (void *) smesa);
- if (!smesa->glCtx) {
- FREE(smesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = smesa;
- ctx = smesa->glCtx;
-
- sisScreen = smesa->sisScreen = (sisScreenPtr)(sPriv->private);
-
- smesa->driContext = driContextPriv;
- smesa->driScreen = sPriv;
- smesa->driDrawable = NULL;
- smesa->hHWContext = driContextPriv->hHWContext;
- smesa->driHwLock = &sPriv->pSAREA->lock;
- smesa->driFd = sPriv->fd;
-
- smesa->virtualX = sisScreen->screenX;
- smesa->virtualY = sisScreen->screenY;
- smesa->bytesPerPixel = sisScreen->cpp;
- smesa->IOBase = sisScreen->mmio.map;
- smesa->Chipset = sisScreen->deviceID;
- smesa->irqEnabled = sisScreen->irqEnabled;
-
- smesa->FbBase = sPriv->pFB;
- smesa->displayWidth = sPriv->fbWidth;
- smesa->frontPitch = sPriv->fbStride;
-
- smesa->sarea = (SISSAREAPriv *)((char *)sPriv->pSAREA +
- sisScreen->sarea_priv_offset);
-
-#if defined(SIS_DUMP)
- IOBase4Debug = GET_IOBase (smesa);
-#endif
-
- /* support ARGB8888 and RGB565 */
- switch (smesa->bytesPerPixel)
- {
- case 4:
- smesa->redMask = 0x00ff0000;
- smesa->greenMask = 0x0000ff00;
- smesa->blueMask = 0x000000ff;
- smesa->alphaMask = 0xff000000;
- smesa->colorFormat = DST_FORMAT_ARGB_8888;
- break;
- case 2:
- smesa->redMask = 0xf800;
- smesa->greenMask = 0x07e0;
- smesa->blueMask = 0x001f;
- smesa->alphaMask = 0;
- smesa->colorFormat = DST_FORMAT_RGB_565;
- break;
- default:
- sis_fatal_error("Bad bytesPerPixel.\n");
- }
-
- /* Parse configuration files */
- driParseConfigFiles (&smesa->optionCache, &sisScreen->optionCache,
- sisScreen->driScreen->myNum, "sis");
-
- /* TODO: index mode */
-
- smesa->CurrentQueueLenPtr = &(smesa->sarea->QueueLength);
- smesa->FrameCountPtr = &(smesa->sarea->FrameCount);
-
- /* set AGP */
- smesa->AGPSize = sisScreen->agp.size;
- smesa->AGPBase = sisScreen->agp.map;
- smesa->AGPAddr = sisScreen->agp.handle;
-
- /* Create AGP command buffer */
- if (smesa->AGPSize != 0 &&
- !driQueryOptionb(&smesa->optionCache, "agp_disable"))
- {
- smesa->vb = sisAllocAGP(smesa, 64 * 1024, &smesa->vb_agp_handle);
- if (smesa->vb != NULL) {
- smesa->using_agp = GL_TRUE;
- smesa->vb_cur = smesa->vb;
- smesa->vb_last = smesa->vb;
- smesa->vb_end = smesa->vb + 64 * 1024;
- smesa->vb_agp_offset = ((long)smesa->vb - (long)smesa->AGPBase +
- (long)smesa->AGPAddr);
- }
- }
- if (!smesa->using_agp) {
- smesa->vb = malloc(64 * 1024);
- if (smesa->vb == NULL) {
- FREE(smesa);
- return GL_FALSE;
- }
- smesa->vb_cur = smesa->vb;
- smesa->vb_last = smesa->vb;
- smesa->vb_end = smesa->vb + 64 * 1024;
- }
-
- smesa->GlobalFlag = 0L;
-
- smesa->Fallback = 0;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- _swrast_allow_pixel_fog( ctx, GL_TRUE );
- _swrast_allow_vertex_fog( ctx, GL_FALSE );
- _tnl_allow_pixel_fog( ctx, GL_TRUE );
- _tnl_allow_vertex_fog( ctx, GL_FALSE );
-
- /* XXX these should really go right after _mesa_init_driver_functions() */
- sisDDInitStateFuncs( ctx );
- sisDDInitState( smesa ); /* Initializes smesa->zFormat, important */
- sisInitTriFuncs( ctx );
- sisDDInitSpanFuncs( ctx );
- sisDDInitStencilFuncs( ctx );
-
- driInitExtensions( ctx, card_extensions, GL_FALSE );
-
- /* TODO */
- /* smesa->blockWrite = SGRAMbw = IsBlockWrite (); */
- smesa->blockWrite = GL_FALSE;
-
- for (i = 0; i < SIS_MAX_TEXTURES; i++) {
- smesa->TexStates[i] = 0;
- smesa->PrevTexFormat[i] = 0;
- }
-
- return GL_TRUE;
-}
-
-void
-sisDestroyContext ( __DRIcontextPrivate *driContextPriv )
-{
- sisContextPtr smesa = (sisContextPtr)driContextPriv->driverPrivate;
-
- assert( smesa != NULL );
-
- if ( smesa != NULL ) {
- _swsetup_DestroyContext( smesa->glCtx );
- _tnl_DestroyContext( smesa->glCtx );
- _ac_DestroyContext( smesa->glCtx );
- _swrast_DestroyContext( smesa->glCtx );
-
- if (smesa->using_agp)
- sisFreeAGP(smesa, smesa->vb_agp_handle);
-
- /* free the Mesa context */
- /* XXX: Is the next line needed? The DriverCtx (smesa) reference is
- * needed for sisDDDeleteTexture, since it needs to call the FB/AGP free
- * function.
- */
- /* smesa->glCtx->DriverCtx = NULL; */
- _mesa_destroy_context(smesa->glCtx);
- }
-
- FREE( smesa );
-}
-
-GLboolean
-sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( driContextPriv ) {
- GET_CURRENT_CONTEXT(ctx);
- sisContextPtr oldSisCtx = ctx ? SIS_CONTEXT(ctx) : NULL;
- sisContextPtr newSisCtx = (sisContextPtr) driContextPriv->driverPrivate;
-
- if ( newSisCtx != oldSisCtx) {
- newSisCtx->GlobalFlag = GFLAG_ALL;
- }
-
- newSisCtx->driDrawable = driDrawPriv;
-
- _mesa_make_current( newSisCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- sisUpdateBufferSize( newSisCtx );
- sisUpdateClipping( newSisCtx->glCtx );
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-GLboolean
-sisUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
-
-void
-sis_update_render_state( sisContextPtr smesa )
-{
- __GLSiSHardware *prev = &smesa->prev;
-
- mWait3DCmdQueue (45);
-
- if (smesa->GlobalFlag & GFLAG_ENABLESETTING) {
- if (!smesa->clearTexCache) {
- MMIO(REG_3D_TEnable, prev->hwCapEnable);
- } else {
- MMIO(REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear);
- MMIO(REG_3D_TEnable, prev->hwCapEnable);
- smesa->clearTexCache = GL_FALSE;
- }
- }
-
- if (smesa->GlobalFlag & GFLAG_ENABLESETTING2)
- MMIO(REG_3D_TEnable2, prev->hwCapEnable2);
-
- /* Z Setting */
- if (smesa->GlobalFlag & GFLAG_ZSETTING)
- {
- MMIO(REG_3D_ZSet, prev->hwZ);
- MMIO(REG_3D_ZStWriteMask, prev->hwZMask);
- MMIO(REG_3D_ZAddress, prev->hwOffsetZ);
- }
-
- /* Alpha Setting */
- if (smesa->GlobalFlag & GFLAG_ALPHASETTING)
- MMIO(REG_3D_AlphaSet, prev->hwAlpha);
-
- if (smesa->GlobalFlag & GFLAG_DESTSETTING) {
- MMIO(REG_3D_DstSet, prev->hwDstSet);
- MMIO(REG_3D_DstAlphaWriteMask, prev->hwDstMask);
- MMIO(REG_3D_DstAddress, prev->hwOffsetDest);
- }
-
- /* Line Setting */
-#if 0
- if (smesa->GlobalFlag & GFLAG_LINESETTING)
- MMIO(REG_3D_LinePattern, prev->hwLinePattern);
-#endif
-
- /* Fog Setting */
- if (smesa->GlobalFlag & GFLAG_FOGSETTING)
- {
- MMIO(REG_3D_FogSet, prev->hwFog);
- MMIO(REG_3D_FogInverseDistance, prev->hwFogInverse);
- MMIO(REG_3D_FogFarDistance, prev->hwFogFar);
- MMIO(REG_3D_FogFactorDensity, prev->hwFogDensity);
- }
-
- /* Stencil Setting */
- if (smesa->GlobalFlag & GFLAG_STENCILSETTING) {
- MMIO(REG_3D_StencilSet, prev->hwStSetting);
- MMIO(REG_3D_StencilSet2, prev->hwStSetting2);
- }
-
- /* Miscellaneous Setting */
- if (smesa->GlobalFlag & GFLAG_DSTBLEND)
- MMIO(REG_3D_DstBlendMode, prev->hwDstSrcBlend);
- if (smesa->GlobalFlag & GFLAG_CLIPPING) {
- MMIO(REG_3D_ClipTopBottom, prev->clipTopBottom);
- MMIO(REG_3D_ClipLeftRight, prev->clipLeftRight);
- }
-
- smesa->GlobalFlag &= ~GFLAG_RENDER_STATES;
-}
-
-void
-sis_update_texture_state (sisContextPtr smesa)
-{
- __GLSiSHardware *prev = &smesa->prev;
-
- mWait3DCmdQueue (55);
- if (smesa->clearTexCache || (smesa->GlobalFlag & GFLAG_TEXTUREADDRESS)) {
- MMIO(REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear);
- MMIO(REG_3D_TEnable, prev->hwCapEnable);
- smesa->clearTexCache = GL_FALSE;
- }
-
- /* Texture Setting */
- if (smesa->GlobalFlag & CFLAG_TEXTURERESET)
- MMIO(REG_3D_TextureSet, prev->texture[0].hwTextureSet);
-
- if (smesa->GlobalFlag & GFLAG_TEXTUREMIPMAP)
- MMIO(REG_3D_TextureMip, prev->texture[0].hwTextureMip);
-
- /*
- MMIO(REG_3D_TextureTransparencyColorHigh, prev->texture[0].hwTextureClrHigh);
- MMIO(REG_3D_TextureTransparencyColorLow, prev->texture[0].hwTextureClrLow);
- */
-
- if (smesa->GlobalFlag & GFLAG_TEXBORDERCOLOR)
- MMIO(REG_3D_TextureBorderColor, prev->texture[0].hwTextureBorderColor);
-
- if (smesa->GlobalFlag & GFLAG_TEXTUREADDRESS) {
- switch ((prev->texture[0].hwTextureSet & MASK_TextureLevel) >> 8)
- {
- case 11:
- MMIO(REG_3D_TextureAddress11, prev->texture[0].texOffset11);
- case 10:
- MMIO(REG_3D_TextureAddress10, prev->texture[0].texOffset10);
- MMIO(REG_3D_TexturePitch10, prev->texture[0].texPitch10);
- case 9:
- MMIO(REG_3D_TextureAddress9, prev->texture[0].texOffset9);
- case 8:
- MMIO(REG_3D_TextureAddress8, prev->texture[0].texOffset8);
- MMIO(REG_3D_TexturePitch8, prev->texture[0].texPitch89);
- case 7:
- MMIO(REG_3D_TextureAddress7, prev->texture[0].texOffset7);
- case 6:
- MMIO(REG_3D_TextureAddress6, prev->texture[0].texOffset6);
- MMIO(REG_3D_TexturePitch6, prev->texture[0].texPitch67);
- case 5:
- MMIO(REG_3D_TextureAddress5, prev->texture[0].texOffset5);
- case 4:
- MMIO(REG_3D_TextureAddress4, prev->texture[0].texOffset4);
- MMIO(REG_3D_TexturePitch4, prev->texture[0].texPitch45);
- case 3:
- MMIO(REG_3D_TextureAddress3, prev->texture[0].texOffset3);
- case 2:
- MMIO(REG_3D_TextureAddress2, prev->texture[0].texOffset2);
- MMIO(REG_3D_TexturePitch2, prev->texture[0].texPitch23);
- case 1:
- MMIO(REG_3D_TextureAddress1, prev->texture[0].texOffset1);
- case 0:
- MMIO(REG_3D_TextureAddress0, prev->texture[0].texOffset0);
- MMIO(REG_3D_TexturePitch0, prev->texture[0].texPitch01);
- }
- }
- if (smesa->GlobalFlag & CFLAG_TEXTURERESET_1)
- MMIO(REG_3D_Texture1Set, prev->texture[1].hwTextureSet);
- if (smesa->GlobalFlag & GFLAG_TEXTUREMIPMAP_1)
- MMIO(REG_3D_Texture1Mip, prev->texture[1].hwTextureMip);
-
- if (smesa->GlobalFlag & GFLAG_TEXBORDERCOLOR_1) {
- MMIO(REG_3D_Texture1BorderColor,
- prev->texture[1].hwTextureBorderColor);
- }
- if (smesa->GlobalFlag & GFLAG_TEXTUREADDRESS_1) {
- switch ((prev->texture[1].hwTextureSet & MASK_TextureLevel) >> 8)
- {
- case 11:
- MMIO(REG_3D_Texture1Address11, prev->texture[1].texOffset11);
- case 10:
- MMIO(REG_3D_Texture1Address10, prev->texture[1].texOffset10);
- MMIO(REG_3D_Texture1Pitch10, prev->texture[1].texPitch10);
- case 9:
- MMIO(REG_3D_Texture1Address9, prev->texture[1].texOffset9);
- case 8:
- MMIO(REG_3D_Texture1Address8, prev->texture[1].texOffset8);
- MMIO(REG_3D_Texture1Pitch8, prev->texture[1].texPitch89);
- case 7:
- MMIO(REG_3D_Texture1Address7, prev->texture[1].texOffset7);
- case 6:
- MMIO(REG_3D_Texture1Address6, prev->texture[1].texOffset6);
- MMIO(REG_3D_Texture1Pitch6, prev->texture[1].texPitch67);
- case 5:
- MMIO(REG_3D_Texture1Address5, prev->texture[1].texOffset5);
- case 4:
- MMIO(REG_3D_Texture1Address4, prev->texture[1].texOffset4);
- MMIO(REG_3D_Texture1Pitch4, prev->texture[1].texPitch45);
- case 3:
- MMIO(REG_3D_Texture1Address3, prev->texture[1].texOffset3);
- case 2:
- MMIO(REG_3D_Texture1Address2, prev->texture[1].texOffset2);
- MMIO(REG_3D_Texture1Pitch2, prev->texture[1].texPitch23);
- case 1:
- MMIO(REG_3D_Texture1Address1, prev->texture[1].texOffset1);
- case 0:
- MMIO(REG_3D_Texture1Address0, prev->texture[1].texOffset0);
- MMIO(REG_3D_Texture1Pitch0, prev->texture[1].texPitch01);
- }
- }
-
- /* texture environment */
- if (smesa->GlobalFlag & GFLAG_TEXTUREENV) {
- MMIO(REG_3D_TextureBlendFactor, prev->hwTexEnvColor);
- MMIO(REG_3D_TextureColorBlendSet0, prev->hwTexBlendColor0);
- MMIO(REG_3D_TextureAlphaBlendSet0, prev->hwTexBlendAlpha0);
- }
- if (smesa->GlobalFlag & GFLAG_TEXTUREENV_1) {
- MMIO(REG_3D_TextureBlendFactor, prev->hwTexEnvColor);
- MMIO(REG_3D_TextureColorBlendSet1, prev->hwTexBlendColor1);
- MMIO(REG_3D_TextureAlphaBlendSet1, prev->hwTexBlendAlpha1);
- }
-
- smesa->GlobalFlag &= ~GFLAG_TEXTURE_STATES;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.h
deleted file mode 100644
index 367540222..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_context.h
+++ /dev/null
@@ -1,440 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef _sis_ctx_h_
-#define _sis_ctx_h_
-
-#include "context.h"
-#include "dri_util.h"
-#include "drm.h"
-#include "drm_sarea.h"
-#include "xmlconfig.h"
-#include "tnl/t_vertex.h"
-
-#include "sis_screen.h"
-#include "sis_common2.h"
-#include "sis_dri.h"
-
-/* for GLboolean */
-#include <GL/gl.h>
-
-#define PCI_CHIP_SIS300 0x0300
-#define PCI_CHIP_SIS630 0x6300
-#define PCI_CHIP_SIS540 0x5300
-
-#define NEW_TEXTURING 0x1
-#define NEW_TEXTURE_ENV 0x2
-
-/* Flags for software fallback cases:
- */
-#define SIS_FALLBACK_TEXTURE 0x0001
-#define SIS_FALLBACK_TEXTURE0 0x0002
-#define SIS_FALLBACK_TEXTURE1 0x0004
-#define SIS_FALLBACK_TEXENV0 0x0008
-#define SIS_FALLBACK_TEXENV1 0x0010
-#define SIS_FALLBACK_DRAW_BUFFER 0x0020
-#define SIS_FALLBACK_STENCIL 0x0040
-#define SIS_FALLBACK_FORCE 0x8000
-
-/* Flags for hardware state that needs to be updated */
-#define GFLAG_ENABLESETTING 0x00000001
-#define GFLAG_ENABLESETTING2 0x00000002
-#define GFLAG_ZSETTING 0x00000004
-#define GFLAG_ALPHASETTING 0x00000008
-#define GFLAG_DESTSETTING 0x00000010
-#define GFLAG_LINESETTING 0x00000020
-#define GFLAG_STENCILSETTING 0x00000040
-#define GFLAG_FOGSETTING 0x00000080
-#define GFLAG_DSTBLEND 0x00000100
-#define GFLAG_CLIPPING 0x00000200
-#define CFLAG_TEXTURERESET 0x00000400
-#define GFLAG_TEXTUREMIPMAP 0x00000800
-#define GFLAG_TEXBORDERCOLOR 0x00001000
-#define GFLAG_TEXTUREADDRESS 0x00002000
-#define GFLAG_TEXTUREENV 0x00004000
-#define CFLAG_TEXTURERESET_1 0x00008000
-#define GFLAG_TEXTUREMIPMAP_1 0x00010000
-#define GFLAG_TEXBORDERCOLOR_1 0x00020000
-#define GFLAG_TEXTUREADDRESS_1 0x00040000
-#define GFLAG_TEXTUREENV_1 0x00080000
-#define GFLAG_ALL 0x000fffff
-
-#define GFLAG_TEXTURE_STATES (CFLAG_TEXTURERESET | GFLAG_TEXTUREMIPMAP | \
- GFLAG_TEXBORDERCOLOR | GFLAG_TEXTUREADDRESS | \
- CFLAG_TEXTURERESET_1 | GFLAG_TEXTUREMIPMAP_1 | \
- GFLAG_TEXBORDERCOLOR_1 | \
- GFLAG_TEXTUREADDRESS_1 | \
- GFLAG_TEXTUREENV | GFLAG_TEXTUREENV_1)
-
-
-#define GFLAG_RENDER_STATES (GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 | \
- GFLAG_ZSETTING | GFLAG_ALPHASETTING | \
- GFLAG_DESTSETTING | GFLAG_FOGSETTING | \
- GFLAG_STENCILSETTING | GFLAG_DSTBLEND | \
- GFLAG_CLIPPING)
-
-/* Use the templated vertex format:
- */
-#define TAG(x) sis##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-/* Subpixel offsets for window coordinates (triangles):
- */
-#define SUBPIXEL_X (-0.5F)
-#define SUBPIXEL_Y (-0.5F)
-
-#define SIS_MAX_TEXTURE_LEVELS 11
-
-typedef struct {
- GLubyte *Data; /* Pointer to texture in offscreen */
- GLuint memType; /* VIDEO_TYPE or AGP_TYPE */
- void *handle; /* Handle for sisFree*() */
- GLuint pitch;
- GLuint size;
-} sisTexImage;
-
-typedef struct sis_tex_obj {
- sisTexImage image[SIS_MAX_TEXTURE_LEVELS]; /* Image data for each mipmap
- * level */
- GLenum format; /* One of GL_ALPHA, GL_INTENSITY, GL_LUMINANCE,
- * GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA */
- GLint hwformat; /* One of the TEXEL_ defines */
- GLint numImages; /* Number of images loaded into .image */
-} sisTexObj, *sisTexObjPtr;
-
-/*
- ** Device dependent context state
- */
-typedef struct __GLSiSTextureRec
-{
- GLint hwTextureSet;
- GLint hwTextureMip;
- GLint hwTextureClrHigh;
- GLint hwTextureClrLow;
- GLint hwTextureBorderColor;
-
- GLint texOffset0;
- GLint texOffset1;
- GLint texOffset2;
- GLint texOffset3;
- GLint texOffset4;
- GLint texOffset5;
- GLint texOffset6;
- GLint texOffset7;
- GLint texOffset8;
- GLint texOffset9;
- GLint texOffset10;
- GLint texOffset11;
-
- GLint texPitch01;
- GLint texPitch23;
- GLint texPitch45;
- GLint texPitch67;
- GLint texPitch89;
- GLint texPitch10;
-} __GLSiSTexture;
-
-typedef struct __GLSiSHardwareRec
-{
- GLint hwCapEnable, hwCapEnable2; /* Enable Setting */
-
- GLint hwOffsetZ, hwZ; /* Z Setting */
-
- GLint hwZBias, hwZMask; /* Z Setting */
-
- GLint hwAlpha; /* Alpha Setting */
-
- GLint hwDstSet, hwDstMask; /* Destination Setting */
-
- GLint hwOffsetDest; /* Destination Setting */
-
- GLint hwLinePattern; /* Line Setting */
-
- GLint hwFog; /* Fog Setting */
-
- GLint hwFogFar, hwFogInverse; /* Fog Distance setting */
-
- GLint hwFogDensity; /* Fog factor & density */
-
- GLint hwStSetting, hwStSetting2; /* Stencil Setting */
-
- GLint hwStOffset; /* Stencil Setting */
-
- GLint hwDstSrcBlend; /* Blending mode Setting */
-
- GLint clipTopBottom; /* Clip for Top & Bottom */
-
- GLint clipLeftRight; /* Clip for Left & Right */
-
- struct __GLSiSTextureRec texture[2];
-
- GLint hwTexEnvColor; /* Texture Blending Setting */
-
- GLint hwTexBlendColor0;
- GLint hwTexBlendColor1;
- GLint hwTexBlendAlpha0;
- GLint hwTexBlendAlpha1;
-
-}
-__GLSiSHardware;
-
-typedef struct sis_context sisContextRec;
-typedef struct sis_context *sisContextPtr;
-
-typedef void (*sis_quad_func)( sisContextPtr,
- sisVertex *,
- sisVertex *,
- sisVertex *,
- sisVertex * );
-
-typedef void (*sis_tri_func)( sisContextPtr,
- sisVertex *,
- sisVertex *,
- sisVertex * );
-
-typedef void (*sis_line_func)( sisContextPtr,
- sisVertex *,
- sisVertex * );
-
-typedef void (*sis_point_func)( sisContextPtr,
- sisVertex * );
-
-/* Device dependent context state */
-
-struct sis_context
-{
- /* This must be first in this structure */
- GLcontext *glCtx;
-
- /* Vertex state */
- GLuint vertex_size;
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
- char *verts; /* points to tnl->clipspace.vertex_buf */
-
- /* Vertex buffer (in system memory or AGP) state. */
- unsigned char *vb; /* Beginning of vertex buffer */
- unsigned char *vb_cur; /* Current write location in vertex buffer */
- unsigned char *vb_last; /* Last written location in vertex buffer */
- unsigned char *vb_end; /* End of vertex buffer */
- void *vb_agp_handle;
- GLuint vb_agp_offset;
- GLboolean using_agp;
-
- GLuint NewGLState;
- GLuint Fallback;
- GLuint RenderIndex;
- GLfloat hw_viewport[16];
- GLfloat depth_scale;
-
- unsigned int virtualX, virtualY;
- unsigned int bytesPerPixel;
- unsigned char *IOBase;
- unsigned char *FbBase;
- unsigned int displayWidth;
- unsigned int frontOffset;
- unsigned int frontPitch;
-
- /* HW RGBA layout */
- unsigned int redMask, greenMask, blueMask, alphaMask;
- unsigned int colorFormat;
-
- /* Z format */
- unsigned int zFormat;
-
- /* Clear patterns, 4 bytes */
- unsigned int clearColorPattern;
- unsigned int clearZStencilPattern;
-
- /* Fallback rasterization functions
- */
- sis_point_func draw_point;
- sis_line_func draw_line;
- sis_tri_func draw_tri;
- sis_quad_func draw_quad;
-
- GLuint hw_primitive;
- GLenum raster_primitive;
- GLenum render_primitive;
-
- /* DRM fd */
- int driFd;
-
- /* AGP Memory */
- unsigned int AGPSize;
- unsigned char *AGPBase;
- unsigned int AGPAddr;
-
- /* register 0x89F4 */
- GLint AGPParseSet;
-
- /* register 0x89F8 */
- GLint dwPrimitiveSet;
-
- __GLSiSHardware prev, current;
-
- int Chipset;
-
- GLint drawableID;
-
- /* SGRAM block write */
- GLboolean blockWrite;
-
- GLint GlobalFlag;
- GLuint last_tcl_state;
-
- /* Stereo */
- GLboolean useStereo;
- GLboolean stereoEnabled;
- int stereo_drawIndex;
- int stereo_drawSide;
- GLboolean irqEnabled;
-
- GLboolean clearTexCache;
-
- GLuint TexStates[SIS_MAX_TEXTURES];
- GLuint PrevTexFormat[SIS_MAX_TEXTURES];
-
- int *CurrentQueueLenPtr;
- unsigned int *FrameCountPtr;
-
- /* Front/back/depth buffer info */
- GLuint width, height; /* size of buffers */
- GLint bottom; /* used for FLIP macro */
- GLvoid *backbuffer;
- unsigned int backOffset;
- unsigned int backPitch;
- GLvoid *depthbuffer;
- unsigned int depthOffset;
- unsigned int depthPitch;
- void *zbFree, *bbFree; /* Cookies for freeing buffers */
- ENGPACKET zClearPacket, cbClearPacket;
-
- /* Drawable, cliprect and scissor information
- */
- GLint drawOffset, drawPitch;
- GLint readOffset, readPitch;
-
- /* Mirrors of some DRI state
- */
- __DRIcontextPrivate *driContext; /* DRI context */
- __DRIscreenPrivate *driScreen; /* DRI screen */
- __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */
-
- unsigned int lastStamp; /* mirror driDrawable->lastStamp */
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
-
- sisScreenPtr sisScreen; /* Screen private DRI data */
- SISSAREAPrivPtr sarea; /* Private SAREA data */
-
- /* Configuration cache */
- driOptionCache optionCache;
-};
-
-#define SIS_CONTEXT(ctx) ((sisContextPtr)(ctx->DriverCtx))
-
-/* Macros */
-#define GET_IOBase(x) ((x)->IOBase)
-
-#define Y_FLIP(Y) (smesa->bottom - (Y))
-
-#define SISPACKCOLOR565( r, g, b ) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define SISPACKCOLOR8888( r, g, b, a ) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define SIS_VERBOSE 0
-
-
-#define MMIO(reg, value) \
-{\
- *(volatile GLint *)(smesa->IOBase + (reg)) = value; \
-}
-
-#define MMIO_READ(reg) *(volatile GLint *)(smesa->IOBase + (reg))
-#define MMIO_READf(reg) *(volatile GLfloat *)(smesa->IOBase + (reg))
-
-#define mEndPrimitive() \
-{ \
- *(volatile GLubyte *)(smesa->IOBase + REG_3D_EndPrimitiveList) = 0xff; \
- *(volatile GLuint *)(smesa->IOBase + 0x8b60) = 0xffffffff; \
-}
-
-#define sis_fatal_error(msg) \
-do { \
- fprintf(stderr, "[%s:%d]: %s", __FILE__, __LINE__, msg); \
- exit(-1); \
-} while (0)
-
-/* Lock required */
-#define mWait3DCmdQueue(wLen) \
-/* Update the mirrored queue pointer if it doesn't indicate enough space */ \
-if (*(smesa->CurrentQueueLenPtr) < (wLen)) { \
- *(smesa->CurrentQueueLenPtr) = \
- (*(GLint *)(GET_IOBase(smesa) + REG_CommandQueue) & MASK_QueueLen) - 20; \
- /* Spin and wait if the queue is actually too full */ \
- if (*(smesa->CurrentQueueLenPtr) < (wLen)) \
- WaitingFor3dIdle(smesa, wLen); \
- *(smesa->CurrentQueueLenPtr) -= wLen; \
-}
-
-enum _sis_verbose {
- VERBOSE_SIS_BUFFER = 0x1,
- VERBOSE_SIS_MEMORY = 0x2
-};
-
-extern GLboolean sisCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate );
-extern void sisDestroyContext( __DRIcontextPrivate * );
-
-extern GLboolean sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv );
-
-extern GLboolean sisUnbindContext( __DRIcontextPrivate *driContextPriv );
-
-void WaitEngIdle (sisContextPtr smesa);
-void Wait2DEngIdle (sisContextPtr smesa);
-void WaitingFor3dIdle(sisContextPtr smesa, int wLen);
-
-/* update to hw */
-extern void sis_update_texture_state( sisContextPtr smesa );
-extern void sis_update_render_state( sisContextPtr smesa );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.c
deleted file mode 100644
index 2617980cc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- *
- */
-
-#include "sis_context.h"
-#include "sis_dd.h"
-#include "sis_lock.h"
-#include "sis_alloc.h"
-#include "sis_state.h"
-#include "sis_tris.h"
-
-#include "swrast/swrast.h"
-#include "framebuffer.h"
-
-#include "utils.h"
-
-#define DRIVER_DATE "20051019"
-
-/* Return the width and height of the given buffer.
- */
-static void
-sisGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- LOCK_HARDWARE();
- *width = smesa->driDrawable->w;
- *height = smesa->driDrawable->h;
- UNLOCK_HARDWARE();
-}
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *
-sisGetString( GLcontext *ctx, GLenum name )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- static char buffer[128];
- unsigned offset;
- GLuint agp_mode = (smesa->AGPSize > 0);
-
- switch ( name )
- {
- case GL_VENDOR:
- return (GLubyte *)"Eric Anholt";
-
- case GL_RENDERER:
- offset = driGetRendererString( buffer, "SiS", DRIVER_DATE, agp_mode );
-
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-/* Send all commands to the hardware.
- */
-static void
-sisFlush( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- SIS_FIREVERTICES(smesa);
-}
-
-/* Make sure all commands have been sent to the hardware and have
- * completed processing.
- */
-static void
-sisFinish( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- SIS_FIREVERTICES(smesa);
- LOCK_HARDWARE();
- WaitEngIdle( smesa );
- UNLOCK_HARDWARE();
-}
-
-void
-sisUpdateBufferSize( sisContextPtr smesa )
-{
- __GLSiSHardware *current = &smesa->current;
- __GLSiSHardware *prev = &smesa->prev;
- GLuint z_depth;
-
- /* XXX Should get the base offset of the frontbuffer from the X Server */
- smesa->frontOffset = smesa->driDrawable->x * smesa->bytesPerPixel +
- smesa->driDrawable->y * smesa->frontPitch;
-
- if ( smesa->width == smesa->driDrawable->w &&
- smesa->height == smesa->driDrawable->h )
- {
- return;
- }
-
- smesa->width = smesa->driDrawable->w;
- smesa->height = smesa->driDrawable->h;
- smesa->bottom = smesa->height - 1;
-
- if ( smesa->backbuffer )
- sisFreeBackbuffer( smesa );
- if ( smesa->depthbuffer )
- sisFreeZStencilBuffer( smesa );
-
- if ( smesa->glCtx->Visual.depthBits > 0 )
- sisAllocZStencilBuffer( smesa );
- if ( smesa->glCtx->Visual.doubleBufferMode )
- sisAllocBackbuffer( smesa );
-
- switch (smesa->zFormat)
- {
- case SiS_ZFORMAT_Z16:
- z_depth = 2;
- break;
- case SiS_ZFORMAT_Z32:
- case SiS_ZFORMAT_S8Z24:
- z_depth = 4;
- break;
- default:
- sis_fatal_error("Bad Z format\n");
- }
-
- current->hwZ &= ~MASK_ZBufferPitch;
- current->hwZ |= smesa->width * z_depth >> 2;
- current->hwOffsetZ = smesa->depthOffset >> 2;
-
- if ((current->hwOffsetZ != prev->hwOffsetZ) || (current->hwZ != prev->hwZ)) {
- prev->hwOffsetZ = current->hwOffsetZ;
- prev->hwZ = current->hwZ;
- smesa->GlobalFlag |= GFLAG_ZSETTING;
- }
-
- sisUpdateClipping( smesa->glCtx );
-}
-
-/* Initialize the driver's misc functions.
- */
-void
-sisInitDriverFuncs( struct dd_function_table *functions )
-{
- functions->GetBufferSize = sisGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
- functions->GetString = sisGetString;
- functions->Finish = sisFinish;
- functions->Flush = sisFlush;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.h
deleted file mode 100644
index da76596e9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_dd.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_DD_H__
-#define __SIS_DD_H__
-
-extern void sisUpdateBufferSize( sisContextPtr smesa );
-
-extern void sisInitDriverFuncs( struct dd_function_table *functions );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.c
deleted file mode 100644
index 99cb09c25..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and 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 SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.c,v 1.5 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- *
- */
-
-/*
- * dump HW states, set environment variable SIS_DEBUG
- * to enable these functions
- */
-
-#include <fcntl.h>
-#include <assert.h>
-
-#include "sis_context.h"
-
-/* for SiS 300/630/540 */
-#define MMIOLength (0x8FFF-0x8800+1)
-#define MMIO3DOffset (0x8800)
-#define FILE_NAME "300.dump"
-
-char *IOBase4Debug = 0;
-
-char *prevLockFile = NULL;
-int prevLockLine = 0;
-
-GLint _empty[0x10000];
-
-void
-dump_agp (void *addr, int dword_count)
-{
- if (!getenv ("SIS_DEBUG"))
- return;
-
- {
- int i;
- FILE *file = fopen ("300agp.dump", "w");
-
- if (file)
- {
- for (i = 0; i < dword_count; i++)
- {
- fprintf (file, "%f\n", *(float *) addr);
- ((unsigned char *) addr) += 4;
- }
- fclose (file);
- }
- }
-}
-
-void
-d2f_once (GLcontext * ctx)
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- static int serialNumber = -1;
-
- if (serialNumber == smesa->serialNumber)
- return;
- else
- serialNumber = smesa->serialNumber;
-
- d2f();
-}
-
-void
-d2f (void)
-{
- if (!getenv ("SIS_DEBUG"))
- return;
-
- /* dump 0x8800 - 0x8AFF */
- {
- int fh;
- int rval;
- void *addr = IOBase4Debug + MMIO3DOffset;
-
- assert (IOBase4Debug);
-
- if ((fh = open (FILE_NAME, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE)) != -1)
- {
- rval = write (fh, addr, MMIOLength);
- assert (rval != -1);
- close (fh);
- }
- }
-}
-
-/* dump to HW */
-void
-d2h (char *file_name)
-{
- int fh;
- int rval;
- void *addr[MMIOLength];
-
- if (!getenv ("SIS_DEBUG"))
- return;
-
- if ((fh = open (file_name, O_CREAT, S_IREAD | S_IWRITE)) != -1)
- {
- rval = read (fh, addr, MMIOLength);
- assert (rval != -1);
- close (fh);
- }
- memcpy (IOBase4Debug + MMIO3DOffset, addr, MMIOLength);
-
-}
-
-/* dump video memory to file */
-void
-dvidmem (unsigned char *addr, int size)
-{
- int fh;
- int rval;
- static char *file_name = "vidmem.dump";
-
- if (!getenv ("SIS_DEBUG"))
- return;
-
- if ((fh = open (file_name, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE)) != -1)
- {
- rval = write (fh, addr, size);
- assert (rval != -1);
- close (fh);
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.h
deleted file mode 100644
index 5e2b30912..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_debug.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and 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 SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- *
- */
-
-#ifndef _sis_debug_h_
-#define _sis_debug_h_
-
-void dump_agp (void *addr, int dword_count);
-void d2f (void);
-void d2f_once (GLcontext * ctx);
-void d2h (char *file_name);
-void dvidmem (unsigned char *addr, int size);
-extern char *IOBase4Debug;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_fog.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_fog.c
deleted file mode 100644
index e1230f6b4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_fog.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_fog.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_state.h"
-#include "swrast/swrast.h"
-
-#include "macros.h"
-
-static GLint convertFtToFogFt( GLfloat dwInValue );
-
-void
-sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- float fArg;
- GLint fogColor;
-
- switch (pname)
- {
- case GL_FOG_MODE:
- current->hwFog &= ~MASK_FogMode;
- switch (ctx->Fog.Mode)
- {
- case GL_LINEAR:
- current->hwFog |= FOGMODE_LINEAR;
- break;
- case GL_EXP:
- current->hwFog |= FOGMODE_EXP;
- break;
- case GL_EXP2:
- current->hwFog |= FOGMODE_EXP2;
- break;
- }
- if (current->hwFog != prev->hwFog) {
- prev->hwFog = current->hwFog;
- smesa->GlobalFlag |= GFLAG_FOGSETTING;
- }
- break;
- case GL_FOG_DENSITY:
- current->hwFogDensity = convertFtToFogFt( ctx->Fog.Density );
- if (current->hwFogDensity != prev->hwFogDensity) {
- prev->hwFogDensity = current->hwFogDensity;
- smesa->GlobalFlag |= GFLAG_FOGSETTING;
- }
- break;
- case GL_FOG_START:
- case GL_FOG_END:
- fArg = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
- current->hwFogInverse = doFPtoFixedNoRound( fArg, 10 );
- if (pname == GL_FOG_END)
- {
- if (smesa->Chipset == PCI_CHIP_SIS300)
- current->hwFogFar = doFPtoFixedNoRound( ctx->Fog.End, 10 );
- else
- current->hwFogFar = doFPtoFixedNoRound( ctx->Fog.End, 6 );
- }
- if (current->hwFogFar != prev->hwFogFar ||
- current->hwFogInverse != prev->hwFogInverse)
- {
- prev->hwFogFar = current->hwFogFar;
- prev->hwFogInverse = current->hwFogInverse;
- smesa->GlobalFlag |= GFLAG_FOGSETTING;
- }
- break;
- case GL_FOG_INDEX:
- /* TODO */
- break;
- case GL_FOG_COLOR:
- fogColor = FLOAT_TO_UBYTE( ctx->Fog.Color[0] ) << 16;
- fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[1] ) << 8;
- fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[2] );
- current->hwFog &= 0xff000000;
- current->hwFog |= fogColor;
- if (current->hwFog != prev->hwFog) {
- prev->hwFog = current->hwFog;
- smesa->GlobalFlag |= GFLAG_FOGSETTING;
- }
- break;
- }
-}
-
-GLint
-doFPtoFixedNoRound( GLfloat dwInValue, int nFraction )
-{
- GLint dwMantissa;
- int nTemp;
- union { int i; float f; } u;
- GLint val;
-
- u.f = dwInValue;
- val = u.i;
-
- if (val == 0)
- return 0;
- nTemp = (int) (val & 0x7F800000) >> 23;
- nTemp = nTemp - 127 + nFraction - 23;
- dwMantissa = (val & 0x007FFFFF) | 0x00800000;
-
- if (nTemp < -25)
- return 0;
- if (nTemp > 0)
- dwMantissa <<= nTemp;
- else {
- nTemp = -nTemp;
- dwMantissa >>= nTemp;
- }
- if (val & 0x80000000)
- dwMantissa = ~dwMantissa + 1;
- return dwMantissa;
-}
-
-/* s[8].23->s[7].10 */
-static GLint
-convertFtToFogFt( GLfloat dwInValue )
-{
- GLint dwMantissa, dwExp;
- GLint dwRet;
- union { int i; float f; } u;
- GLint val;
-
- u.f = dwInValue;
- val = u.i;
-
- if (val == 0)
- return 0;
-
- /* ----- Standard float Format: s[8].23 -----
- * ----- = (-1)^S * 2^(E - 127) * (1 + M / 2^23) -----
- * ----- = (-1)^S * 2^((E-63) - 64) * (1 + (M/2^13) / 2^10) -----
- * ----- Density float Format: s[7].10 -----
- * ----- New Exponential = E - 63 -----
- * ----- New Mantissa = M / 2^13 -----
- * ----- -----
- */
-
- dwExp = (val & 0x7F800000) >> 23;
- dwExp -= 63;
-
- if (dwExp < 0)
- return 0;
-
- if (dwExp <= 0x7F)
- dwMantissa = (val & 0x007FFFFF) >> (23 - 10);
- else {
- /* ----- To Return +Max(or -Max) ----- */
- dwExp = 0x7F;
- dwMantissa = 0x3FF;
- }
-
- dwRet = (val & 0x80000000) >> (31 - 17); /* Shift Sign Bit */
-
- dwRet |= (dwExp << 10) | dwMantissa;
-
- return dwRet;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.c
deleted file mode 100644
index f598e52d9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $XFree86$ */
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "context.h"
-#include "sis_context.h"
-#include "sis_lock.h"
-#include "sis_dd.h"
-#include "sis_state.h"
-
-/* Update the hardware state. This is called if another context has
- * grabbed the hardware lock, which includes the X server. This
- * function also updates the driver's window state after the X server
- * moves, resizes or restacks a window -- the change will be reflected
- * in the drawable position and clip rects. Since the X server grabs
- * the hardware lock when it changes the window state, this routine will
- * automatically be called after such a change.
- */
-void
-sisGetLock( sisContextPtr smesa, GLuint flags )
-{
- __DRIdrawablePrivate *dPriv = smesa->driDrawable;
- __DRIscreenPrivate *sPriv = smesa->driScreen;
- SISSAREAPrivPtr sarea = smesa->sarea;
-
- drmGetLock( smesa->driFd, smesa->hHWContext, flags );
-
- /* The window might have moved, so we might need to get new clip
- * rects.
- *
- * NOTE: This releases and regrabs the hw lock to allow the X server
- * to respond to the DRI protocol request for new drawable info.
- * Since the hardware state depends on having the latest drawable
- * clip rects, all state checking must be done _after_ this call.
- */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( smesa->lastStamp != dPriv->lastStamp ) {
- sisUpdateBufferSize( smesa );
- sisUpdateClipping( smesa->glCtx );
- sisDDDrawBuffer( smesa->glCtx, smesa->glCtx->Color.DrawBuffer[0] );
- smesa->lastStamp = dPriv->lastStamp;
- }
-
- if ( sarea->CtxOwner != smesa->hHWContext ) {
- sarea->CtxOwner = smesa->hHWContext;
- smesa->GlobalFlag = GFLAG_ALL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.h
deleted file mode 100644
index fef993196..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_lock.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_LOCK_H
-#define __SIS_LOCK_H
-
-extern void sisGetLock( sisContextPtr smesa, GLuint flags );
-
-#ifdef DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-#define DEBUG_LOCK() \
- do { \
- prevLockFile=(__FILE__); \
- prevLockLine=(__LINE__); \
- } while (0)
-#define DEBUG_RESET() \
- do { \
- prevLockFile=NULL; \
- prevLockLine=0; \
- } while (0)
-#define DEBUG_CHECK_LOCK() \
- do { \
- if(prevLockFile){ \
- fprintf(stderr, "LOCK SET : %s:%d\n", __FILE__, __LINE__); \
- } \
- } while (0)
-#else
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-#endif
-
-/* Lock the hardware using the global current context */
-#define LOCK_HARDWARE() \
- do { \
- char __ret=0; \
- mEndPrimitive(); \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( smesa->driHwLock, smesa->hHWContext, \
- (DRM_LOCK_HELD | smesa->hHWContext), __ret ); \
- if ( __ret != 0 ) \
- sisGetLock( smesa, 0 ); \
- DEBUG_LOCK(); \
- } while (0)
-
-/* Unlock the hardware using the global current context */
-#define UNLOCK_HARDWARE() \
- do { \
- mEndPrimitive(); \
- DRM_UNLOCK(smesa->driFd, smesa->driHwLock, \
- smesa->hHWContext); \
- DEBUG_RESET(); \
- } while (0)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_reg.h
deleted file mode 100644
index 76014ff3e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_reg.h
+++ /dev/null
@@ -1,868 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_reg.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef _sis_reg_h_
-#define _sis_reg_h_
-
-/*
- * Define All the Register Address of 6327
- */
-
-#define REG_CommandQueue 0x8240
-
-#define REG_3D_TSFSa 0x8800
-#define REG_3D_TSZa 0x8804
-#define REG_3D_TSXa 0x8808
-#define REG_3D_TSYa 0x880C
-#define REG_3D_TSARGBa 0x8810
-#define REG_3D_TSWGa 0x8814
-#define REG_3D_TSUAa 0x8818
-#define REG_3D_TSVAa 0x881C
-#define REG_3D_TSUBa 0x8820
-#define REG_3D_TSVBa 0x8824
-#define REG_3D_TSUCa 0x8828
-#define REG_3D_TSVCa 0x882C
-
-#define REG_3D_TSFSb 0x8830
-#define REG_3D_TSZb 0x8834
-#define REG_3D_TSXb 0x8838
-#define REG_3D_TSYb 0x883C
-#define REG_3D_TSARGBb 0x8840
-#define REG_3D_TSWGb 0x8844
-#define REG_3D_TSUAb 0x8848
-#define REG_3D_TSVAb 0x884C
-#define REG_3D_TSUBb 0x8850
-#define REG_3D_TSVBb 0x8854
-#define REG_3D_TSUCb 0x8858
-#define REG_3D_TSVCb 0x885C
-
-#define REG_3D_TSFSc 0x8860
-#define REG_3D_TSZc 0x8864
-#define REG_3D_TSXc 0x8868
-#define REG_3D_TSYc 0x886C
-#define REG_3D_TSARGBc 0x8870
-#define REG_3D_TSWGc 0x8874
-#define REG_3D_TSUAc 0x8878
-#define REG_3D_TSVAc 0x887C
-#define REG_3D_TSUBc 0x8880
-#define REG_3D_TSVBc 0x8884
-#define REG_3D_TSUCc 0x8888
-#define REG_3D_TSVCc 0x888C
-
-/*
- * REG_3D_AGPCmdSetting (89e4h-89f7)
- */
-#define REG_3D_AGPCmBase 0x89E4
-#define REG_3D_AGPRmDwNum 0x89E8
-#define REG_3D_AGPTtDwNum 0x89EC
-#define REG_3D_AGPCmFire 0x89F0
-
-#define REG_3D_ParsingSet 0x89F4
-#define REG_3D_PrimitiveSet 0x89F8
-#define REG_3D_ShadeMode 0x89F8
-#define REG_3D_EngineFire 0x89FC
-#define REG_3D_EngineStatus 0x89FC
-#define REG_3D_TEnable 0x8A00
-#define REG_3D_TEnable2 0x8A04
-
-#define REG_3D_ZSet 0x8A08
-#define REG_3D_ZBias 0x8A0C
-#define REG_3D_ZStWriteMask 0x8A10
-
-#define REG_3D_ZAddress 0x8A14
-#define REG_3D_AlphaSet 0x8A18
-#define REG_3D_AlphaAddress 0x8A1C
-#define REG_3D_DstSet 0x8A20
-#define REG_3D_DstAlphaWriteMask 0x8A24
-
-#define REG_3D_DstAddress 0x8A28
-
-#define REG_3D_LinePattern 0x8A2C
-
-#define REG_3D_FogSet 0x8A30
-
-#define REG_3D_FogFarDistance 0x8A34
-#define REG_3D_FogInverseDistance 0x8A38
-#define REG_3D_FogFactorDensity 0x8A3C
-
-#define REG_3D_StencilSet 0x8A44
-#define REG_3D_StencilSet2 0x8A48
-#define REG_3D_StencilAddress 0x8A4C
-
-#define REG_3D_DstBlendMode 0x8A50
-#define REG_3D_SrcBlendMode 0x8A50
-#define REG_3D_ClipTopBottom 0x8A54
-#define REG_3D_ClipLeftRight 0x8A58
-
-#define REG_3D_Brightness 0x8A5C
-
-#define REG_3D_BumpMapSet 0x8A68
-#define REG_3D_BumpMapAddress 0x8A6C
-#define REG_3D_BumpMapPitch 0x8A70
-#define REG_3D_BumpMapMatrix0 0x8A74
-#define REG_3D_BumpMapMatrix1 0x8A78
-
-/*
- * Define the Texture Register Address of 6326
- */
-#define REG_3D_TextureSet 0x8A7C
-#define REG_3D_TextureWidthHeight 0x8A7C
-#define REG_3D_TextureMip 0x8A80
-
-#define REG_3D_TextureTransparencyColorHigh 0x8A84
-#define REG_3D_TextureTransparencyColorLow 0x8A88
-#define REG_3D_TextureBorderColor 0x8A8C
-#define REG_3D_TextureAddress0 0x8A90
-#define REG_3D_TextureAddress1 0x8A94
-#define REG_3D_TextureAddress2 0x8A98
-#define REG_3D_TextureAddress3 0x8A9C
-#define REG_3D_TextureAddress4 0x8AA0
-#define REG_3D_TextureAddress5 0x8AA4
-#define REG_3D_TextureAddress6 0x8AA8
-#define REG_3D_TextureAddress7 0x8AAC
-#define REG_3D_TextureAddress8 0x8AB0
-#define REG_3D_TextureAddress9 0x8AB4
-#define REG_3D_TextureAddress10 0x8AB8
-#define REG_3D_TextureAddress11 0x8ABC
-#define REG_3D_TexturePitch0 0x8AC0
-#define REG_3D_TexturePitch1 0x8AC0
-#define REG_3D_TexturePitch2 0x8AC4
-#define REG_3D_TexturePitch3 0x8AC4
-#define REG_3D_TexturePitch4 0x8AC8
-#define REG_3D_TexturePitch5 0x8AC8
-#define REG_3D_TexturePitch6 0x8ACC
-#define REG_3D_TexturePitch7 0x8ACC
-#define REG_3D_TexturePitch8 0x8AD0
-#define REG_3D_TexturePitch9 0x8AD0
-#define REG_3D_TexturePitch10 0x8AD4
-
-#define REG_3D_Texture1Set 0x8ADC
-#define REG_3D_Texture1WidthHeight 0x8ADC
-#define REG_3D_Texture1Mip 0x8AE0
-
-#define REG_3D_Texture1TransparencyColorHigh 0x8AE4
-#define REG_3D_Texture1TransparencyColorLow 0x8AE8
-#define REG_3D_Texture1BorderColor 0x8AEC
-#define REG_3D_Texture1Address0 0x8AF0
-#define REG_3D_Texture1Address1 0x8AF4
-#define REG_3D_Texture1Address2 0x8AF8
-#define REG_3D_Texture1Address3 0x8AFC
-#define REG_3D_Texture1Address4 0x8B00
-#define REG_3D_Texture1Address5 0x8B04
-#define REG_3D_Texture1Address6 0x8B08
-#define REG_3D_Texture1Address7 0x8B0C
-#define REG_3D_Texture1Address8 0x8B10
-#define REG_3D_Texture1Address9 0x8B14
-#define REG_3D_Texture1Address10 0x8B18
-#define REG_3D_Texture1Address11 0x8B1C
-#define REG_3D_Texture1Pitch0 0x8B20
-#define REG_3D_Texture1Pitch1 0x8B20
-#define REG_3D_Texture1Pitch2 0x8B24
-#define REG_3D_Texture1Pitch3 0x8B24
-#define REG_3D_Texture1Pitch4 0x8B28
-#define REG_3D_Texture1Pitch5 0x8B28
-#define REG_3D_Texture1Pitch6 0x8B2C
-#define REG_3D_Texture1Pitch7 0x8B2C
-#define REG_3D_Texture1Pitch8 0x8B30
-#define REG_3D_Texture1Pitch9 0x8B30
-#define REG_3D_Texture1Pitch10 0x8B34
-
-#define REG_3D_TextureBlendFactor 0x8B3C
-#define REG_3D_TextureColorBlendSet0 0x8B40
-#define REG_3D_TextureColorBlendSet1 0x8B44
-#define REG_3D_TextureAlphaBlendSet0 0x8B48
-#define REG_3D_TextureAlphaBlendSet1 0x8B4C
-/*
- * Define the End of Primitive List of 6326
- */
-#define REG_3D_EndPrimitiveList 0X8B50
-
-
-/*
- * Define the Stipple Register Address of 6326
- */
-#define REG_3D_Stipple0 0X8B60
-
-#define REG_3D_TexturePalette 0x8C00
-
-/*
- * REG_CommandQueue -- (8240h-8243h)
- */
-#define MASK_QueueLen 0x0000ffff
-#define SiS_EngIdle2d 0x80000000
-#define SiS_EngIdle 0xe0000000
-#define MASK_EngState 0xf0000000
-
-/*
- * REG_3D_ParsingSet -- Define Parsing Mask (89F4h-89F7h)
- */
-#define MASK_VertexDWSize 0xf0000000
-#define MASK_VertexDataFormat 0x0fff0000
-/* Because the original MASK_PsVertex_* names of these bits appared to be
- * wrong, new names SiS_PS_* based off of the 4.3.0 driver and research are
- * below.
- */
-#define SiS_PS_HAS_XYZ 0x08000000
-#define SiS_PS_HAS_W 0x04000000
-#define SiS_PS_HAS_SPECULAR 0x02000000 /* XXX ? */
-#define SiS_PS_HAS_DIFFUSE 0x01000000
-#define SiS_PS_HAS_UV0 0x00400000
-#define SiS_PS_HAS_UV1 0x00200000
-#define MASK_PsVertex_HAS_RHW 0x08000000
-#define MASK_PsVertex_HAS_NORMALXYZ 0x04000000
-#define MASK_PsVertex_HAS_DIFFUSE 0x02000000
-#define MASK_PsVertex_HAS_SPECULAR 0x01000000
-#define MASK_PsUVSet 0x00ff0000
-#define MASK_PsVertex_HAS_1SetUV 0x00800000
-#define MASK_PsVertex_HAS_2SetUV 0x00c00000
-#define MASK_PsVertex_HAS_3SetUV 0x00e00000
-#define MASK_PsVertex_HAS_UVSet1 0x00800000
-#define MASK_PsVertex_HAS_UVSet2 0x00400000
-#define MASK_PsVertex_HAS_UVSet3 0x00200000
-#define MASK_PsCullDirection_CCW 0x00008000
-#define MASK_PsShadingMode 0x00007000
-/* XXX Shading modes just a guess, but seem to work*/
-#define MASK_PsShadingFlatA 0x00001000
-#define MASK_PsShadingFlatB 0x00002000
-#define MASK_PsShadingFlatC 0x00003000
-#define MASK_PsShadingSmooth 0x00004000
-#define MASK_PsTextureFrom 0x000003f0
-#define MASK_PsTexture0FromA 0x00000000
-#define MASK_PsTexture1FromA 0x00000000
-#define MASK_PsTexture1FromB 0x00000040
-#define MASK_PsBumpTextureFromA 0x00000000
-#define MASK_PsBumpTextureFromB 0x00000010
-#define MASK_PsBumpTextureFromC 0x00000020
-#define MASK_PsDataType 0x0000000f
-#define MASK_PsPointList 0x00000000
-#define MASK_PsLineList 0x00000004
-#define MASK_PsLineStrip 0x00000005
-#define MASK_PsTriangleList 0x00000008
-#define MASK_PsTriangleStrip 0x00000009
-#define MASK_PsTriangleFan 0x0000000a
-
-/*
- * REG_3D_PrimitiveSet -- Define Fire Primitive Mask (89F8h-89FBh)
- */
-#define MASK_DrawPrimitiveCommand 0x00000007
-#define MASK_SetFirePosition 0x00001F00
-#define MASK_BumpTextureFrom 0x00030000
-#define MASK_Texture1From 0x000C0000
-#define MASK_Texture0From 0x00300000
-#define MASK_ShadingMode 0x07000000
-#define MASK_CullDirection 0x08000000
-
-#define OP_3D_POINT_DRAW 0x00000000
-#define OP_3D_LINE_DRAW 0x00000001
-#define OP_3D_TRIANGLE_DRAW 0x00000002
-
-#define OP_3D_DIRECTION_RIGHT 0x00000000
-#define OP_3D_DIRECTION_LEFT 0x00000100
-#define OP_3D_DIRECTION_HORIZONTAL 0x00000000
-#define OP_3D_DIRECTION_VERTICAL 0x00000100
-
-#define OP_3D_FIRE_TFIRE 0x00000000
-#define OP_3D_FIRE_TSARGBa 0x00000100
-#define OP_3D_FIRE_TSWa 0x00000200
-#define OP_3D_FIRE_TSVAa 0x00000300
-#define OP_3D_FIRE_TSVBa 0x00000400
-#define OP_3D_FIRE_TSVCa 0x00000500
-
-#define OP_3D_FIRE_TSARGBb 0x00000900
-#define OP_3D_FIRE_TSWb 0x00000a00
-#define OP_3D_FIRE_TSVAb 0x00000b00
-#define OP_3D_FIRE_TSVBb 0x00000c00
-#define OP_3D_FIRE_TSVCb 0x00000d00
-
-#define OP_3D_FIRE_TSARGBc 0x00001100
-#define OP_3D_FIRE_TSWc 0x00001200
-#define OP_3D_FIRE_TSVAc 0x00001300
-#define OP_3D_FIRE_TSVBc 0x00001400
-#define OP_3D_FIRE_TSVCc 0x00001500
-
-#define OP_3D_Texture0FromA 0x00000000
-#define OP_3D_Texture0FromB 0x00100000
-#define OP_3D_Texture0FromC 0x00200000
-#define OP_3D_Texture1FromA 0x00000000
-#define OP_3D_Texture1FromB 0x00040000
-#define OP_3D_Texture1FromC 0x00080000
-#define OP_3D_TextureBumpFromA 0x00000000
-#define OP_3D_TextureBumpFromB 0x00010000
-#define OP_3D_TextureBumpFromC 0x00020000
-
-#define OP_3D_CullDirection_CCW 0x08000000
-
-#define SHADE_FLAT_VertexA 0x01000000
-#define SHADE_FLAT_VertexB 0x02000000
-#define SHADE_FLAT_VertexC 0x03000000
-#define SHADE_GOURAUD 0x04000000
-
-/*
- * Define Command Queue Length Mask (89FCh-89FF)
- */
-#define MASK_CmdQueueLen 0x0FFF0000
-
-/*
- * REG_3D_TEnable -- Define Capility Enable Mask (8A00h-8A03h)
- */
-#define MASK_DitherEnable 0x00000001
-#define MASK_BlendEnable 0x00000002
-#define MASK_FogTestEnable 0x00000004
-#define MASK_FogEnable 0x00000008
-#define MASK_SpecularEnable 0x00000010
-#define MASK_FogPerspectiveEnable 0x00000020
-#define MASK_TextureCacheClear 0x00000040
-#define MASK_TextureCacheEnable 0x00000080
-#define MASK_BumpMapEnable 0x00000100
-#define MASK_TexturePerspectiveEnable 0x00000200
-#define MASK_TextureEnable 0x00000400
-#define MASK_CullEnable 0x00000800
-#define MASK_TextureNumUsed 0x0000F000
-#define MASK_AlphaBufferEnable 0x00010000
-#define MASK_AlphaTestEnable 0x00020000
-#define MASK_AlphaWriteEnable 0x00040000
-#define MASK_ZTestEnable 0x00080000
-#define MASK_ZWriteEnable 0x00100000
-#define MASK_StencilBufferEnable 0x00200000
-#define MASK_StencilTestEnable 0x00400000
-#define MASK_StencilWriteEnable 0x00800000
-#define MASK_Texture0TransparencyEnable 0x01000000
-#define MASK_Texture1TransparencyEnable 0x02000000
-#define MASK_TextureAWrapUCorrection 0x04000000
-#define MASK_TextureAWrapVCorrection 0x08000000
-#define MASK_TextureBWrapUCorrection 0x10000000
-#define MASK_TextureBWrapVCorrection 0x20000000
-#define MASK_TextureCWrapUCorrection 0x40000000
-#define MASK_TextureCWrapVCorrection 0x80000000
-
-/*
- * REG_3D_TEnable2 -- Define Capility Enable Mask2 (8A04h-8A07h)
- */
-#define MASK_Texture0BlockTextureEnable 0x00000001
-#define MASK_Texture1BlockTextureEnable 0x00000002
-#define MASK_Texture0AnisotropicEnable 0x00000010
-#define MASK_Texture1AnisotropicEnable 0x00000020
-#define MASK_TextureMipmapBiasEnable 0x00000040
-#define MASK_LinePatternEnable 0x00000100
-#define MASK_StippleAlphaEnable 0x00000200
-#define MASK_StippleEnable 0x00000400
-#define MASK_AntiAliasEnable 0x00000800
-#define MASK_ZMaskWriteEnable 0x00001000
-#define MASK_StencilMaskWriteEnable 0x00002000
-#define MASK_AlphaMaskWriteEnable 0x00004000
-#define MASK_ColorMaskWriteEnable 0x00008000
-#define MASK_ZCacheClear 0x00010000
-#define MASK_ZCacheEnable 0x00020000
-#define MASK_StencilCacheClear 0x00040000
-#define MASK_StencilCacheEnable 0x00080000
-#define MASK_AlphaCacheClear 0x00100000
-#define MASK_AlphaCacheEnable 0x00200000
-#define MASK_ColorCacheClear 0x00400000
-#define MASK_ColorCacheEnable 0x00800000
-
-/*
- * REG_3D_ZSet -- Define Z Buffer Setting Mask (8A08h-8A0Bh)
- */
-#define MASK_ZBufferPitch 0x00000FFF
-#define MASK_ZTestMode 0x00070000
-#define MASK_ZBufferInSystem 0x00080000
-#define MASK_ZBufferFormat 0x01F00000
-
-#define SiS_Z_COMP_NEVER 0x00000000
-#define SiS_Z_COMP_S_LT_B 0x00010000
-#define SiS_Z_COMP_S_EQ_B 0x00020000
-#define SiS_Z_COMP_S_LE_B 0x00030000
-#define SiS_Z_COMP_S_GT_B 0x00040000
-#define SiS_Z_COMP_S_NE_B 0x00050000
-#define SiS_Z_COMP_S_GE_B 0x00060000
-#define SiS_Z_COMP_ALWAYS 0x00070000
-
-#define SiS_ZFORMAT_Z16 0x00000000
-#define SiS_ZFORMAT_Z16_INT 0x00100000
-#define SiS_ZFORMAT_S1Z15 0x00400000
-#define SiS_ZFORMAT_S1Z15_INT 0x00500000
-#define SiS_ZFORMAT_Z32 0x00800000
-#define SiS_ZFORMAT_S1Z31 0x00C00000
-#define SiS_ZFORMAT_S2Z30 0x00D00000
-#define SiS_ZFORMAT_S4Z28 0x00E00000
-#define SiS_ZFORMAT_S8Z24 0x00F00000
-#define SiS_ZFORMAT_FZ30 0x01800000
-#define SiS_ZFORMAT_FS1Z30 0x01C00000
-#define SiS_ZFORMAT_FS2Z30 0x01D00000
-
-/*
- * REG_3D_ZBias -- Define Z Buffer Setting Mask (8A0Ch-8A0Fh)
- */
-#define MASK_ZBias 0xFFFFFFFF
-
-/*
- * REG_3D_ZStWriteMask -- Define Z and Stencil Buffer Mask (8A10h-8A13h)
- */
-#define MASK_ZWriteMask 0x00FFFFFF
-
-/*
- * REG_3D_ZAddress -- Define Z Buffer Base Address(8A14h-8A17h)
- */
-#define MASK_ZAddress 0xFFFFFFFF
-
-/*
- * REG_3D_AlphaSet -- Define Alpha Buffer Setting Mask (8A18h-8A1Bh)
- */
-#define MASK_AlphaBufferPitch 0x000003FF
-#define MASK_AlphaRefValue 0x00FF0000
-#define MASK_AlphaTestMode 0x07000000
-#define MASK_AlphaBufferInSystem 0x08000000
-#define MASK_AlphaBufferFormat 0x30000000
-
-#define SiS_ALPHA_NEVER 0x00000000
-#define SiS_ALPHA_LESS 0x01000000
-#define SiS_ALPHA_EQUAL 0x02000000
-#define SiS_ALPHA_LEQUAL 0x03000000
-#define SiS_ALPHA_GREATER 0x04000000
-#define SiS_ALPHA_NOTEQUAL 0x05000000
-#define SiS_ALPHA_GEQUAL 0x06000000
-#define SiS_ALPHA_ALWAYS 0x07000000
-
-/*
- * REG_3D_AlphaAddress -- Define Alpha Buffer Base Address(8A1Ch-8A1Fh)
- */
-#define MASK_AlphaAddress 0xFFFFFFFF
-
-/*
- * REG_3D_DstSet -- Define Destination Buffer Setting Mask (8A20h-8A23h)
- */
-#define MASK_DstBufferPitch 0x00000FFF
-#define MASK_DstBufferFormat 0x000F0000
-#define MASK_DstBufferBitDepth 0x00300000
-#define MASK_DstBufferRgbOrder 0x00400000
-#define MASK_DstBufferInSystem 0x00800000
-#define MASK_Dst7BitFormat 0x007F0000
-#define MASK_ROP2 0x0F000000
-
-#define DST_FORMAT_RGB_555 0x00100000
-#define DST_FORMAT_RGB_565 0x00110000
-#define DST_FORMAT_ARGB_1555 0x00120000
-#define DST_FORMAT_ARGB_4444 0x00130000
-#define DST_FORMAT_ARGB_1888 0x00300000
-#define DST_FORMAT_ARGB_2888 0x00310000
-#define DST_FORMAT_ARGB_4888 0x00320000
-#define DST_FORMAT_ARGB_8888 0x00330000
-#define DST_FORMAT_ARGB_0888 0x00340000
-
-#define DST_FORMAT_BGR_555 0x00500000
-#define DST_FORMAT_BGR_565 0x00510000
-#define DST_FORMAT_ABGR_1555 0x00520000
-#define DST_FORMAT_ABGR_4444 0x00530000
-#define DST_FORMAT_ABGR_1888 0x00700000
-#define DST_FORMAT_ABGR_2888 0x00710000
-#define DST_FORMAT_ABGR_4888 0x00720000
-#define DST_FORMAT_ABGR_8888 0x00730000
-#define DST_FORMAT_ABGR_0888 0x00740000
-
-#define LOP_CLEAR 0x00000000
-#define LOP_NOR 0x01000000
-#define LOP_AND_INVERTED 0x02000000
-#define LOP_COPY_INVERTED 0x03000000
-#define LOP_AND_REVERSE 0x04000000
-#define LOP_INVERT 0x05000000
-#define LOP_XOR 0x06000000
-#define LOP_NAND 0x07000000
-#define LOP_AND 0x08000000
-#define LOP_EQUIV 0x09000000
-#define LOP_NOOP 0x0a000000
-#define LOP_OR_INVERTED 0x0b000000
-#define LOP_COPY 0x0c000000
-#define LOP_OR_REVERSE 0x0d000000
-#define LOP_OR 0x0e000000
-#define LOP_SET 0x0f000000
-
-/*
- * REG_3D_DstAlphaWriteMask -- Define Destination/Alpha Buffer Write Mask (8A24h-8A27h)
- */
-#define MASK_ColorWriteMask 0x00FFFFFF
-#define MASK_AlphaWriteMask 0xFF000000
-
-/*
- * REG_3D_DstAddress -- Define Destination Buffer Base Address(8A1Ch-8A1Fh)
- */
-#define MASK_DstAddress 0xFFFFFFFF
-
-/*
- * REG_3D_LinePattern -- Define Line Pattern (8A2Ch-8A2Fh)
- */
-#define MASK_LinePatternRepeatFactor 0x00007FFF
-#define MASK_LinePatternLastPixelFlag 0x00008000
-#define MASK_LinePattern 0xFFFF0000
-
-/*
- * REG_3D_FogSet -- Define Fog Mask (8A30h-8A33h)
- */
-#define MASK_FogColor 0x00FFFFFF
-#define MASK_FogMode 0x07000000
-#define MASK_FogZLookup 0x08000000
-
-#define FOGMODE_CHEAP 0x04000000
-#define FOGMODE_LINEAR 0x05000000
-#define FOGMODE_EXP 0x06000000
-#define FOGMODE_EXP2 0x07000000
-
-/*
- * REG_3D_FogStartEnd -- Define Fog Start End Setting (0x8A34 - 0x8A37)
- */
-#define MASK_FogFarDistance 0x0007FFFF
-
-/*
- * REG_3D_FogStartEnd -- Define Fog End Setting (0x8A38 - 0x8A3B)
- */
-#define MASK_FogInvFarDistance 0x0007FFFF
-
-/*
- * REG_3D_FogFactorDensity (0x8A3C - 0x8A3F)
- */
-#define MASK_FogDensity 0x0003FFFF
-#define MASK_FogFactor 0xFF000000
-
-/*
- * REG_3D_StencilSet -- Define stencil test (8A44h-8A47h)
- */
-#define MASK_StencilValueMask 0x000000ff
-#define MASK_StencilRefMask 0x0000ff00
-#define MASK_StencilTestMode 0x07000000
-#define MASK_StencilBufferInSystem 0x08000000
-#define MASK_StencilFormat 0x30000000
-
-#define SiS_STENCIL_NEVER 0x00000000
-#define SiS_STENCIL_LESS 0x01000000
-#define SiS_STENCIL_EQUAL 0x02000000
-#define SiS_STENCIL_LEQUAL 0x03000000
-#define SiS_STENCIL_GREATER 0x04000000
-#define SiS_STENCIL_NOTEQUAL 0x05000000
-#define SiS_STENCIL_GEQUAL 0x06000000
-#define SiS_STENCIL_ALWAYS 0x07000000
-
-#define STENCIL_FORMAT_1 0x00000000
-#define STENCIL_FORMAT_2 0x10000000
-#define STENCIL_FORMAT_4 0x20000000
-#define STENCIL_FORMAT_8 0x30000000
-
-/*
- * REG_3D_StencilSet2 -- Define stencil test (8A4h-8A47h)
- */
-#define MASK_StencilBufferPitch 0x00000FFF
-#define MASK_StencilZPassOp 0x00007000
-#define MASK_StencilZFailOp 0x00070000
-#define MASK_StencilFailOp 0x00700000
-#define MASK_StencilWriteMask 0xFF000000
-
-#define SiS_SFAIL_KEEP 0x00000000
-#define SiS_SFAIL_ZERO 0x00100000
-#define SiS_SFAIL_REPLACE 0x00200000
-#define SiS_SFAIL_INVERT 0x00500000
-#define SiS_SFAIL_INCR 0x00600000
-#define SiS_SFAIL_DECR 0x00700000
-
-#define SiS_SPASS_ZFAIL_KEEP 0x00000000
-#define SiS_SPASS_ZFAIL_ZERO 0x00010000
-#define SiS_SPASS_ZFAIL_REPLACE 0x00020000
-#define SiS_SPASS_ZFAIL_INVERT 0x00050000
-#define SiS_SPASS_ZFAIL_INCR 0x00060000
-#define SiS_SPASS_ZFAIL_DECR 0x00070000
-
-#define SiS_SPASS_ZPASS_KEEP 0x00000000
-#define SiS_SPASS_ZPASS_ZERO 0x00001000
-#define SiS_SPASS_ZPASS_REPLACE 0x00002000
-#define SiS_SPASS_ZPASS_INVERT 0x00005000
-#define SiS_SPASS_ZPASS_INCR 0x00006000
-#define SiS_SPASS_ZPASS_DECR 0x00007000
-
-/*
- * REG_3D_DstBlendMode (0x8A50 - 0x8A53)
- */
-#define MASK_SrcBlendMode 0x0000000F
-#define MASK_DstBlendMode 0x000000F0
-
-#define SiS_D_ZERO 0x00000000
-#define SiS_D_ONE 0x00000010
-#define SiS_D_SRC_COLOR 0x00000020
-#define SiS_D_ONE_MINUS_SRC_COLOR 0x00000030
-#define SiS_D_SRC_ALPHA 0x00000040
-#define SiS_D_ONE_MINUS_SRC_ALPHA 0x00000050
-#define SiS_D_DST_ALPHA 0x00000060
-#define SiS_D_ONE_MINUS_DST_ALPHA 0x00000070
-#define SiS_D_DST_COLOR 0x00000080
-#define SiS_D_ONE_MINUS_DST_COLOR 0x00000090
-#define SiS_D_SRC_ALPHA_SAT 0x000000a0
-
-#define SiS_S_ZERO 0x00000000
-#define SiS_S_ONE 0x00000001
-#define SiS_S_SRC_COLOR 0x00000002
-#define SiS_S_ONE_MINUS_SRC_COLOR 0x00000003
-#define SiS_S_SRC_ALPHA 0x00000004
-#define SiS_S_ONE_MINUS_SRC_ALPHA 0x00000005
-#define SiS_S_DST_ALPHA 0x00000006
-#define SiS_S_ONE_MINUS_DST_ALPHA 0x00000007
-#define SiS_S_DST_COLOR 0x00000008
-#define SiS_S_ONE_MINUS_DST_COLOR 0x00000009
-#define SiS_S_SRC_ALPHA_SATURATE 0x0000000a
-#define SiS_S_BOTH_SRC_ALPHA 0x0000000b
-#define SiS_S_BOTH_ONE_MINUS_SRC_ALPHA 0x0000000c
-
-/*
- * REG_3D_ClipTopBottom (0x8A54 - 0x8A57)
- */
-#define MASK_BottomClip 0x00001FFF
-#define MASK_TopClip 0x03FFE000
-
-/*
- * REG_3D_ClipLeftRight (0x8A58 - 0x8A5B)
- */
-#define MASK_RightClip 0x00001FFF
-#define MASK_LeftClip 0x03FFE000
-
-/*
- * REG_3D_TextureSet (0x8A7C - 0x8A7F)
- * REG_3D_Texture1Set (0x8ADC - 0x8ADF)
- */
-#define MASK_TextureHeight 0x0000000F
-#define MASK_TextureWidth 0x000000F0
-#define MASK_TextureLevel 0x00000F00
-#define MASK_TextureSignYUVFormat 0x00001000
-#define MASK_TextureMappingMode 0x00FF0000
-#define MASK_TextureWrapU 0x00010000
-#define MASK_TextureWrapV 0x00020000
-#define MASK_TextureMirrorU 0x00040000
-#define MASK_TextureMirrorV 0x00080000
-#define MASK_TextureClampU 0x00100000
-#define MASK_TextureClampV 0x00200000
-#define MASK_TextureBorderU 0x00400000
-#define MASK_TextureBorderV 0x00800000
-#define MASK_TextureFormat 0xFF000000
-#define MASK_TextureBitDepth 0x70000000
-#define MASK_TextureRgbOrder 0x80000000
-
-#define TEXEL_INDEX1 0x00000000
-#define TEXEL_INDEX2 0x01000000
-#define TEXEL_INDEX4 0x02000000
-#define TEXEL_INDEX8 0x03000000
-
-#define TEXEL_INDEX1WithAlpha 0x04000000
-#define TEXEL_INDEX2WithAlpha 0x05000000
-#define TEXEL_INDEX4WithAlpha 0x06000000
-#define TEXEL_INDEX8WithAlpha 0x07000000
-
-#define TEXEL_I1 0x10000000
-#define TEXEL_I2 0x11000000
-#define TEXEL_I4 0x12000000
-#define TEXEL_I8 0x13000000
-
-#define TEXEL_DXT1 0x19000000
-#define TEXEL_DXT2 0x1A000000
-#define TEXEL_DXT3 0x1B000000
-
-#define TEXEL_YUV422 0x20000000
-#define TEXEL_YVU422 0x21000000
-#define TEXEL_UVY422 0x22000000
-#define TEXEL_VUY422 0x23000000
-#define TEXEL_YUV411 0x24000000
-
-#define TEXEL_L1 0x30000000
-#define TEXEL_L2 0x31000000
-#define TEXEL_L4 0x32000000
-#define TEXEL_L8 0x33000000
-
-#define TEXEL_AL11 0x34000000
-#define TEXEL_AL44 0x35000000
-#define TEXEL_AL26 0x37000000
-#define TEXEL_AL88 0x38000000
-
-#define TEXEL_A1 0x40000000
-#define TEXEL_A2 0x41000000
-#define TEXEL_A4 0x42000000
-#define TEXEL_A8 0x43000000
-
-#define TEXEL_RGB_332_8 0x50000000
-#define TEXEL_RGB_233_8 0x51000000
-#define TEXEL_RGB_232_8 0x52000000
-#define TEXEL_ARGB_1232_8 0x53000000
-#define TEXEL_ARGB_2222_8 0x54000000
-
-#define TEXEL_RGB_555_16 0x60000000
-#define TEXEL_RGB_565_16 0x61000000
-#define TEXEL_ARGB_1555_16 0x62000000
-#define TEXEL_ARGB_4444_16 0x63000000
-
-#define TEXEL_ARGB_1888_32 0x70000000
-#define TEXEL_ARGB_2888_32 0x71000000
-#define TEXEL_ARGB_4888_32 0x72000000
-#define TEXEL_ARGB_8888_32 0x73000000
-#define TEXEL_ARGB_0888_32 0x74000000
-
-#define TEXEL_BGR_332_8 0xD0000000
-#define TEXEL_BGR_233_8 0xD1000000
-#define TEXEL_BGR_232_8 0xD2000000
-#define TEXEL_ABGR_1232_8 0xD3000000
-#define TEXEL_ABGR_2222_8 0xD4000000
-
-#define TEXEL_BGR_555_16 0xE0000000
-#define TEXEL_BGR_565_16 0xE1000000
-#define TEXEL_ABGR_1555_16 0xE2000000
-#define TEXEL_ABGR_4444_16 0xE3000000
-
-#define TEXEL_ABGR_1888_32 0xF0000000
-#define TEXEL_ABGR_2888_32 0xF1000000
-#define TEXEL_ABGR_4888_32 0xF2000000
-#define TEXEL_ABGR_8888_32 0xF3000000
-#define TEXEL_ABGR_0888_32 0xF4000000
-
-#define TEXEL_VU88 0x00000000
-#define TEXEL_LVU655 0x00800000
-#define TEXEL_LVU888 0x01000000
-#define TEXEL_UV88 0x02000000
-#define TEXEL_LUV655 0x02800000
-#define TEXEL_LUV888 0x03000000
-
-/*
- * REG_3D_TextureMip (0x8A80 - 0x8A83)
- * REG_3D_Texture1Mip (0x8AE0 - 0x8AE3)
- */
-#define MASK_TextureAnisotropyRatio 0x0000000F
-#define MASK_TextureMipmapLodBias 0x00003FF0
-#define MASK_TextureFilterMin 0x0001C000
-#define MASK_TextureFilterMag 0x00020000
-#define MASK_TextureFilter 0x0003C000
-#define MASK_TextureLevelInSystem 0x3FFC0000
-#define MASK_TextureLevel0InSystem 0x00040000
-#define MASK_TextureBlockLength 0xF0000000
-
-#define TEXTURE_FILTER_NEAREST 0x00000000
-#define TEXTURE_FILTER_LINEAR 0x00004000
-#define TEXTURE_FILTER_NEAREST_MIP_NEAREST 0x00008000
-#define TEXTURE_FILTER_NEAREST_MIP_LINEAR 0x00010000
-#define TEXTURE_FILTER_LINEAR_MIP_NEAREST 0x0000c000
-#define TEXTURE_FILTER_LINEAR_MIP_LINEAR 0x00014000
-
-/*
- * REG_3D_TextureTransparencyColorHigh (0x8A84 - 0x8A87)
- * REG_3D_Texture1TransparencyColorHigh (0x8AE4 - 0x8AE7)
- */
-#define MASK_TextureTransparencyColorHighB 0x000000FF
-#define MASK_TextureTransparencyColorHighG 0x0000FF00
-#define MASK_TextureTransparencyColorHighR 0x00FF0000
-#define MASK_TextureAlphaTransparencyMode 0x08000000
-
-/*
- * REG_3D_TextureTransparencyColorLow (0x8A88 - 0x8A8B)
- * REG_3D_Texture1TransparencyColorLow (0x8AE8 - 0x8AEB)
- */
-#define MASK_TextureTransparencyColorLowB 0x000000FF
-#define MASK_TextureTransparencyColorLowG 0x0000FF00
-#define MASK_TextureTransparencyColorLowR 0x00FF0000
-#define MASK_TextureBlockHeight 0x07000000
-#define MASK_TextureBlockWidth 0x70000000
-
-/*
- * REG_3D_TextureTransparencyColorLow (0x8A8C - 0x8A8F)
- * REG_3D_Texture1TransparencyColorLow (0x8AEC - 0x8AEF)
- */
-#define MASK_TextureBorderColorB 0x000000FF
-#define MASK_TextureBorderColorG 0x0000FF00
-#define MASK_TextureBorderColorR 0x00FF0000
-#define MASK_TextureBorderColorA 0xFF000000
-
-/*
- * REG_3D_TexturePitch0-10 (0x8AC0 - 0x8AD7)
- * REG_3D_Texture1Pitch0-10 (0x8B20 - 0x8B37)
- */
-#define MASK_TexturePitchOdd 0x000003FF
-#define MASK_TexturePitchEven 0x03FF0000
-#define SHIFT_TexturePitchEven 16
-
-/*
- * REG_3D_TextureColorBlendSet0 (0x8B40 - 0x8B43)
- * REG_3D_TextureColorBlendSet1 (0x8B44 - 0x8B46)
- * REG_3D_TextureAlphaBlendSet0 (0x8B40 - 0x8B43)
- * REG_3D_TextureAlphaBlendSet1 (0x8B44 - 0x8B46)
- */
-#define STAGE0_C_CF 0xa1485000
-#define STAGE0_C_CS 0xc1485000
-#define STAGE0_C_CFCS 0xa1705000
-#define STAGE0_C_CFOMAS_CSAS 0xc534c001
-#define STAGE0_C_CFOMCS_CCCS 0x4530c001
-
-#define STAGE0_A_AF 0x63230000
-#define STAGE0_A_AS 0xc3230000
-#define STAGE0_A_AFAS 0x63c30000
-#define STAGE0_A_AFOMAS_ACAS 0x46c60001
-
-#define STAGE1_C_CF 0xa1485000
-#define STAGE1_C_CS 0xe1485000
-#define STAGE1_C_CFCS 0xa1785000
-#define STAGE1_C_CFOMAS_CSAS 0xe5394001
-#define STAGE1_C_CFOMCS_CCCS 0x45394001
-
-#define STAGE1_A_AF 0xa3230000
-#define STAGE1_A_AS 0xe3230000
-#define STAGE1_A_AFAS 0xa3e30000
-#define STAGE1_A_AFOMAS_ACAS 0x4aea0001
-
-/* What registers are these associated with? */
-#define MASK_BMMemoryInSystem 0x00000080
-#define MASK_BMHeight 0x00000F00
-#define MASK_BMWidth 0x0000F000
-#define MASK_BMFilter 0x00010000
-#define MASK_BMMappingMode 0x007E0000
-#define MASK_BMFormat 0x07800000
-#define MASK_BMTxBumpmap 0x08000000
-
-#define MASK_BMAddress 0xFFFFFFFC
-
-#define MASK_BMOffset 0xFF800000
-#define MASK_BMScale 0x007FE000
-#define MASK_BMPitch 0x00001FFF
-
-#define MASK_BMMatrix00 0x000007FF
-#define MASK_BMMatrix01 0x07FF0000
-#define MASK_BMMatrix10 0x000007FF
-#define MASK_BMMatrix11 0x07FF0000
-
-#define MASK_TextureRealInSystem 0x00000001
-#define MASK_TextureDowngrade 0x00000002
-
-#define ALPHA_BUFFER_FORMAT_1 0x00000000
-#define ALPHA_BUFFER_FORMAT_2 0x10000000
-#define ALPHA_BUFFER_FORMAT_4 0x20000000
-#define ALPHA_BUFFER_FORMAT_8 0x30000000
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.c
deleted file mode 100644
index cc6afda1f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.c
+++ /dev/null
@@ -1,468 +0,0 @@
-/* $XFree86$ */
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "dri_util.h"
-
-#include "context.h"
-#include "utils.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-
-#include "sis_context.h"
-#include "sis_dri.h"
-#include "sis_lock.h"
-#include "sis_span.h"
-
-#include "xmlpool.h"
-
-#include "GL/internal/dri_interface.h"
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_OPT_BEGIN(agp_disable,bool,false)
- DRI_CONF_DESC(en,"Disable AGP vertex dispatch")
- DRI_CONF_OPT_END
- DRI_CONF_OPT_BEGIN(fallback_force,bool,false)
- DRI_CONF_DESC(en,"Force software fallback")
- DRI_CONF_OPT_END
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driNConfigOptions = 2;
-
-extern const struct dri_extension card_extensions[];
-
-static __GLcontextModes *
-sisFillInModes(int bpp)
-{
- __GLcontextModes *modes;
- __GLcontextModes *m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML
- };
- u_int8_t depth_bits_array[4];
- u_int8_t stencil_bits_array[4];
-
- depth_bits_array[0] = 0;
- stencil_bits_array[0] = 0;
- depth_bits_array[1] = 16;
- stencil_bits_array[1] = 0;
- depth_bits_array[2] = 24;
- stencil_bits_array[2] = 8;
- depth_bits_array[3] = 32;
- stencil_bits_array[3] = 0;
-
- depth_buffer_factor = 4;
- back_buffer_factor = 2;
-
- /* Last 4 is for GLX_TRUE_COLOR & GLX_DIRECT_COLOR, with/without accum */
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if (bpp == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- } else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes));
- m = modes;
- if (!driFillInModes(&m, fb_format, fb_type, depth_bits_array,
- stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
- return NULL;
- }
-
- if (!driFillInModes(&m, fb_format, fb_type, depth_bits_array,
- stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
- return NULL;
- }
-
- return modes;
-}
-
-
-/* Create the device specific screen private data struct.
- */
-static sisScreenPtr
-sisCreateScreen( __DRIscreenPrivate *sPriv )
-{
- sisScreenPtr sisScreen;
- SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv;
-
- if (sPriv->devPrivSize != sizeof(SISDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(SISDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- sisScreen = (sisScreenPtr)CALLOC( sizeof(*sisScreen) );
- if ( sisScreen == NULL )
- return NULL;
-
- sisScreen->screenX = sisDRIPriv->width;
- sisScreen->screenY = sisDRIPriv->height;
- sisScreen->cpp = sisDRIPriv->bytesPerPixel;
- sisScreen->irqEnabled = sisDRIPriv->bytesPerPixel;
- sisScreen->deviceID = sisDRIPriv->deviceID;
- sisScreen->AGPCmdBufOffset = sisDRIPriv->AGPCmdBufOffset;
- sisScreen->AGPCmdBufSize = sisDRIPriv->AGPCmdBufSize;
- sisScreen->sarea_priv_offset = sizeof(drm_sarea_t);
-
- sisScreen->mmio.handle = sisDRIPriv->regs.handle;
- sisScreen->mmio.size = sisDRIPriv->regs.size;
- if ( drmMap( sPriv->fd, sisScreen->mmio.handle, sisScreen->mmio.size,
- &sisScreen->mmio.map ) )
- {
- FREE( sisScreen );
- return NULL;
- }
-
- if (sisDRIPriv->agp.size) {
- sisScreen->agp.handle = sisDRIPriv->agp.handle;
- sisScreen->agp.size = sisDRIPriv->agp.size;
- if ( drmMap( sPriv->fd, sisScreen->agp.handle, sisScreen->agp.size,
- &sisScreen->agp.map ) )
- {
- sisScreen->agp.size = 0;
- }
- }
-
- sisScreen->driScreen = sPriv;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo(&sisScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- return sisScreen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-static void
-sisDestroyScreen( __DRIscreenPrivate *sPriv )
-{
- sisScreenPtr sisScreen = (sisScreenPtr)sPriv->private;
-
- if ( sisScreen == NULL )
- return;
-
- if (sisScreen->agp.size != 0)
- drmUnmap( sisScreen->agp.map, sisScreen->agp.size );
- drmUnmap( sisScreen->mmio.map, sisScreen->mmio.size );
-
- FREE( sisScreen );
- sPriv->private = NULL;
-}
-
-
-/* Create and initialize the Mesa and driver specific pixmap buffer
- * data.
- */
-static GLboolean
-sisCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- sisScreenPtr screen = (sisScreenPtr) driScrnPriv->private;
- struct gl_framebuffer *fb;
-
- if (isPixmap)
- return GL_FALSE; /* not implemented */
-
-#if 0
- driDrawPriv->driverPrivate = (void *)_mesa_create_framebuffer(
- mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0 ); /* XXX */
-#else
- fb = _mesa_create_framebuffer(mesaVis);
-
- /* XXX double-check the Offset/Pitch parameters! */
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- 0, driScrnPriv->fbStride);
- sisSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- 0, driScrnPriv->fbStride);
- sisSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- 0, driScrnPriv->fbStride);
- sisSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- 0, driScrnPriv->fbStride);
- sisSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 32) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- 0, driScrnPriv->fbStride);
- sisSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- /* no h/w stencil?
- if (mesaVis->stencilBits > 0) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT);
- sisSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
- */
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
-
- return (driDrawPriv->driverPrivate != NULL);
-}
-
-
-static void
-sisDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-__inline__ static void
-sis_bitblt_copy_cmd (sisContextPtr smesa, ENGPACKET * pkt)
-{
- GLint *lpdwDest, *lpdwSrc;
- int i;
-
- lpdwSrc = (GLint *) pkt;
- lpdwDest = (GLint *) (GET_IOBase (smesa) + REG_SRC_ADDR);
-
- mWait3DCmdQueue (10);
-
- for (i = 0; i < 7; i++)
- *lpdwDest++ = *lpdwSrc++;
-
- MMIO(REG_CMD0, *(GLint *)&pkt->stdwCmd);
- MMIO(REG_CommandQueue, -1);
-}
-
-static void sisCopyBuffer( __DRIdrawablePrivate *dPriv )
-{
- sisContextPtr smesa = (sisContextPtr)dPriv->driContextPriv->driverPrivate;
- int i;
- ENGPACKET stEngPacket;
-
- memset(&stEngPacket, 0, sizeof(ENGPACKET));
-
- while ((*smesa->FrameCountPtr) - MMIO_READ(0x8a2c) > SIS_MAX_FRAME_LENGTH)
- ;
-
- LOCK_HARDWARE();
-
- stEngPacket.dwSrcBaseAddr = smesa->backOffset;
- stEngPacket.dwSrcPitch = smesa->backPitch |
- ((smesa->bytesPerPixel == 2) ? 0x80000000 : 0xc0000000);
- stEngPacket.dwDestBaseAddr = 0;
- stEngPacket.wDestPitch = smesa->frontPitch;
- /* TODO: set maximum value? */
- stEngPacket.wDestHeight = smesa->virtualY;
-
- stEngPacket.stdwCmd.cRop = 0xcc;
-
- if (smesa->blockWrite)
- stEngPacket.stdwCmd.cCmd0 = CMD0_PAT_FG_COLOR;
- else
- stEngPacket.stdwCmd.cCmd0 = 0;
- stEngPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC;
-
- for (i = 0; i < dPriv->numClipRects; i++) {
- drm_clip_rect_t *box = &dPriv->pClipRects[i];
- stEngPacket.stdwSrcPos.wY = box->y1 - dPriv->y;
- stEngPacket.stdwSrcPos.wX = box->x1 - dPriv->x;
- stEngPacket.stdwDestPos.wY = box->y1;
- stEngPacket.stdwDestPos.wX = box->x1;
-
- stEngPacket.stdwDim.wWidth = (GLshort) box->x2 - box->x1;
- stEngPacket.stdwDim.wHeight = (GLshort) box->y2 - box->y1;
- sis_bitblt_copy_cmd( smesa, &stEngPacket );
- }
-
- *(GLint *)(smesa->IOBase+0x8a2c) = *smesa->FrameCountPtr;
- (*smesa->FrameCountPtr)++;
-
- UNLOCK_HARDWARE ();
-}
-
-
-/* Copy the back color buffer to the front color buffer */
-static void
-sisSwapBuffers(__DRIdrawablePrivate *dPriv)
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- sisContextPtr smesa = (sisContextPtr) dPriv->driContextPriv->driverPrivate;
- GLcontext *ctx = smesa->glCtx;
-
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- sisCopyBuffer( dPriv );
- }
- } else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__);
- }
-}
-
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-sisInitDriver( __DRIscreenPrivate *sPriv )
-{
- sPriv->private = (void *) sisCreateScreen( sPriv );
-
- if ( !sPriv->private ) {
- sisDestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static struct __DriverAPIRec sisAPI = {
- .InitDriver = sisInitDriver,
- .DestroyScreen = sisDestroyScreen,
- .CreateContext = sisCreateContext,
- .DestroyContext = sisDestroyContext,
- .CreateBuffer = sisCreateBuffer,
- .DestroyBuffer = sisDestroyBuffer,
- .SwapBuffers = sisSwapBuffers,
- .MakeCurrent = sisMakeCurrent,
- .UnbindContext = sisUnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = NULL,
- .WaitForMSC = NULL,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-
-};
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
- __DRIscreen *psc,
- const __GLcontextModes *modes,
- const __DRIversion *ddx_version,
- const __DRIversion *dri_version,
- const __DRIversion *drm_version,
- const __DRIframebuffer *frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes **driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = {0, 8, 0};
- static const __DRIversion dri_expected = {4, 0, 0};
- static const __DRIversion drm_expected = {1, 0, 0};
-
- dri_interface = interface;
-
- if (!driCheckDriDdxDrmVersions2("SiS", dri_version, &dri_expected,
- ddx_version, &ddx_expected,
- drm_version, &drm_expected)) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &sisAPI);
- if (psp != NULL) {
- SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv;
- *driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8);
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- return (void *)psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.h
deleted file mode 100644
index 068c0410d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_screen.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_SCREEN_H
-#define __SIS_SCREEN_H
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- drmAddress map; /* Mapping of the DRM region */
-} sisRegionRec2, *sisRegionPtr2;
-
-typedef struct {
- sisRegionRec2 mmio;
- sisRegionRec2 agp;
-
- unsigned int AGPCmdBufOffset;
- unsigned int AGPCmdBufSize;
-
- int deviceID;
- int irqEnabled;
-
- int cpp;
- unsigned int screenX, screenY;
-
- __DRIscreenPrivate *driScreen;
- unsigned int sarea_priv_offset;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-
-} sisScreenRec, *sisScreenPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.c
deleted file mode 100644
index f0cf771d6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_span.c,v 1.5 2001/03/21 16:14:26 dawes Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_span.h"
-#include "sis_lock.h"
-#include "sis_tris.h"
-
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define LOCAL_VARS \
- sisContextPtr smesa = SIS_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = smesa->driDrawable; \
- GLuint pitch = smesa->drawPitch; \
- char *buf = (char *)(smesa->FbBase + smesa->drawOffset); \
- char *read_buf = (char *)(smesa->FbBase + smesa->readOffset); \
- GLuint p; \
- (void) read_buf; (void) buf; (void) p
-
-#define LOCAL_DEPTH_VARS \
- sisContextPtr smesa = SIS_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = smesa->driDrawable; \
- char *buf = smesa->depthbuffer; \
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-#define HW_LOCK() do {} while(0);
-
-#define HW_UNLOCK() do {} while(0);
-
-/* RGB565 */
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) sis##x##_RGB565
-#define TAG2(x,y) sis##x##_RGB565##y
-#include "spantmp2.h"
-
-
-/* ARGB8888 */
-/* FIXME the old code always read back alpha as 0xff, i.e. fully opaque.
- Was there a reason to do so ? If so that'll won't work with that template... */
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) sis##x##_ARGB8888
-#define TAG2(x,y) sis##x##_ARGB8888##y
-#include "spantmp2.h"
-
-
-/* 16 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + (_x)*2 + (_y)*smesa->depthPitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + (_x)*2 + (_y)*smesa->depthPitch);
-
-#define TAG(x) sis##x##_16
-#include "depthtmp.h"
-
-
-/* 32 bit depthbuffer functions.
- */
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) = d;
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch);
-
-#define TAG(x) sis##x##_32
-#include "depthtmp.h"
-
-
-/* 8/24 bit interleaved depth/stencil functions
- */
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch); \
- tmp &= 0xff000000; \
- tmp |= (d & 0x00ffffff); \
- *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) { \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) & 0x00ffffff; \
-}
-
-#define TAG(x) sis##x##_24_8
-#include "depthtmp.h"
-
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch); \
- tmp &= 0x00ffffff; \
- tmp |= (d << 24); \
- *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = (*(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) & 0xff000000) >> 24;
-
-#define TAG(x) sis##x##_24_8
-#include "stenciltmp.h"
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void sisDDSetBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLuint bufferBit )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- smesa->drawOffset = smesa->readOffset = smesa->frontOffset;
- smesa->drawPitch = smesa->readPitch = smesa->frontPitch;
- break;
- case BUFFER_BIT_BACK_LEFT:
- smesa->drawOffset = smesa->readOffset = smesa->backOffset;
- smesa->drawPitch = smesa->readPitch = smesa->backPitch;
- break;
- default:
- break;
- }
-}
-
-void sisSpanRenderStart( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- SIS_FIREVERTICES(smesa);
- LOCK_HARDWARE();
- WaitEngIdle( smesa );
-}
-
-void sisSpanRenderFinish( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- _swrast_flush( ctx );
- UNLOCK_HARDWARE();
-}
-
-void
-sisDDInitSpanFuncs( GLcontext *ctx )
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = sisDDSetBuffer;
- swdd->SpanRenderStart = sisSpanRenderStart;
- swdd->SpanRenderFinish = sisSpanRenderFinish;
-}
-
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-sisSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- sisInitPointers_RGB565( &drb->Base );
- }
- else {
- sisInitPointers_ARGB8888( &drb->Base );
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = sisReadDepthSpan_16;
- drb->Base.GetValues = sisReadDepthPixels_16;
- drb->Base.PutRow = sisWriteDepthSpan_16;
- drb->Base.PutMonoRow = sisWriteMonoDepthSpan_16;
- drb->Base.PutValues = sisWriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = sisReadDepthSpan_24_8;
- drb->Base.GetValues = sisReadDepthPixels_24_8;
- drb->Base.PutRow = sisWriteDepthSpan_24_8;
- drb->Base.PutMonoRow = sisWriteMonoDepthSpan_24_8;
- drb->Base.PutValues = sisWriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
- drb->Base.GetRow = sisReadDepthSpan_32;
- drb->Base.GetValues = sisReadDepthPixels_32;
- drb->Base.PutRow = sisWriteDepthSpan_32;
- drb->Base.PutMonoRow = sisWriteMonoDepthSpan_32;
- drb->Base.PutValues = sisWriteDepthPixels_32;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = sisReadStencilSpan_24_8;
- drb->Base.GetValues = sisReadStencilPixels_24_8;
- drb->Base.PutRow = sisWriteStencilSpan_24_8;
- drb->Base.PutMonoRow = sisWriteMonoStencilSpan_24_8;
- drb->Base.PutValues = sisWriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.h
deleted file mode 100644
index 7c73bc6d3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_span.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_SPAN_H__
-#define __SIS_SPAN_H__
-
-#include "drirenderbuffer.h"
-
-
-extern void sisSpanRenderStart( GLcontext *ctx );
-extern void sisSpanRenderFinish( GLcontext *ctx );
-
-extern void sisDDInitSpanFuncs( GLcontext *ctx );
-
-extern void
-sisSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.c
deleted file mode 100644
index db58e9090..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.c
+++ /dev/null
@@ -1,853 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_state.h"
-#include "sis_tris.h"
-#include "sis_lock.h"
-#include "sis_tex.h"
-
-#include "context.h"
-#include "buffers.h"
-#include "enums.h"
-#include "colormac.h"
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-/* =============================================================
- * Alpha blending
- */
-
-static void
-sisDDAlphaFunc( GLcontext * ctx, GLenum func, GLfloat ref )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- GLubyte refbyte;
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- CLAMPED_FLOAT_TO_UBYTE(refbyte, ref);
- current->hwAlpha = refbyte << 16;
-
- /* Alpha Test function */
- switch (func)
- {
- case GL_NEVER:
- current->hwAlpha |= SiS_ALPHA_NEVER;
- break;
- case GL_LESS:
- current->hwAlpha |= SiS_ALPHA_LESS;
- break;
- case GL_EQUAL:
- current->hwAlpha |= SiS_ALPHA_EQUAL;
- break;
- case GL_LEQUAL:
- current->hwAlpha |= SiS_ALPHA_LEQUAL;
- break;
- case GL_GREATER:
- current->hwAlpha |= SiS_ALPHA_GREATER;
- break;
- case GL_NOTEQUAL:
- current->hwAlpha |= SiS_ALPHA_NOTEQUAL;
- break;
- case GL_GEQUAL:
- current->hwAlpha |= SiS_ALPHA_GEQUAL;
- break;
- case GL_ALWAYS:
- current->hwAlpha |= SiS_ALPHA_ALWAYS;
- break;
- }
-
- prev->hwAlpha = current->hwAlpha;
- smesa->GlobalFlag |= GFLAG_ALPHASETTING;
-}
-
-static void
-sisDDBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- current->hwDstSrcBlend = 0;
-
- switch (dfactorRGB)
- {
- case GL_ZERO:
- current->hwDstSrcBlend |= SiS_D_ZERO;
- break;
- case GL_ONE:
- current->hwDstSrcBlend |= SiS_D_ONE;
- break;
- case GL_SRC_COLOR:
- current->hwDstSrcBlend |= SiS_D_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- current->hwDstSrcBlend |= SiS_D_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_COLOR:
- current->hwDstSrcBlend |= SiS_D_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- current->hwDstSrcBlend |= SiS_D_ONE_MINUS_DST_COLOR;
- break;
- case GL_DST_ALPHA:
- current->hwDstSrcBlend |= SiS_D_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- current->hwDstSrcBlend |= SiS_D_ONE_MINUS_DST_ALPHA;
- break;
- default:
- fprintf(stderr, "Unknown dst blend function 0x%x\n", dfactorRGB);
- break;
- }
-
- switch (sfactorRGB)
- {
- case GL_ZERO:
- current->hwDstSrcBlend |= SiS_S_ZERO;
- break;
- case GL_ONE:
- current->hwDstSrcBlend |= SiS_S_ONE;
- break;
- case GL_SRC_COLOR:
- current->hwDstSrcBlend |= SiS_S_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- current->hwDstSrcBlend |= SiS_S_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- current->hwDstSrcBlend |= SiS_S_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- current->hwDstSrcBlend |= SiS_S_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_COLOR:
- current->hwDstSrcBlend |= SiS_S_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_COLOR;
- break;
- case GL_DST_ALPHA:
- current->hwDstSrcBlend |= SiS_S_DST_ALPHA;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_ALPHA;
- break;
- case GL_SRC_ALPHA_SATURATE:
- current->hwDstSrcBlend |= SiS_S_SRC_ALPHA_SATURATE;
- break;
- default:
- fprintf(stderr, "Unknown src blend function 0x%x\n", sfactorRGB);
- break;
- }
-
- if (current->hwDstSrcBlend != prev->hwDstSrcBlend) {
- prev->hwDstSrcBlend = current->hwDstSrcBlend;
- smesa->GlobalFlag |= GFLAG_DSTBLEND;
- }
-}
-
-/* =============================================================
- * Depth testing
- */
-
-static void
-sisDDDepthFunc( GLcontext * ctx, GLenum func )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- current->hwZ &= ~MASK_ZTestMode;
- switch (func)
- {
- case GL_LESS:
- current->hwZ |= SiS_Z_COMP_S_LT_B;
- break;
- case GL_GEQUAL:
- current->hwZ |= SiS_Z_COMP_S_GE_B;
- break;
- case GL_LEQUAL:
- current->hwZ |= SiS_Z_COMP_S_LE_B;
- break;
- case GL_GREATER:
- current->hwZ |= SiS_Z_COMP_S_GT_B;
- break;
- case GL_NOTEQUAL:
- current->hwZ |= SiS_Z_COMP_S_NE_B;
- break;
- case GL_EQUAL:
- current->hwZ |= SiS_Z_COMP_S_EQ_B;
- break;
- case GL_ALWAYS:
- current->hwZ |= SiS_Z_COMP_ALWAYS;
- break;
- case GL_NEVER:
- current->hwZ |= SiS_Z_COMP_NEVER;
- break;
- }
-
- if (current->hwZ != prev->hwZ) {
- prev->hwZ = current->hwZ;
- smesa->GlobalFlag |= GFLAG_ZSETTING;
- }
-}
-
-void
-sisDDDepthMask( GLcontext * ctx, GLboolean flag )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- if (!ctx->Depth.Test)
- flag = GL_FALSE;
-
- if (ctx->Visual.stencilBits) {
- if (flag || (ctx->Stencil.WriteMask[0] != 0)) {
- current->hwCapEnable |= MASK_ZWriteEnable;
- if (flag && (ctx->Stencil.WriteMask[0] == 0xff)) {
- current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable;
- } else {
- current->hwCapEnable2 |= MASK_ZMaskWriteEnable;
- current->hwZMask = (ctx->Stencil.WriteMask[0] << 24) |
- ((flag) ? 0x00ffffff : 0);
-
- if (current->hwZMask ^ prev->hwZMask) {
- prev->hwZMask = current->hwZMask;
- smesa->GlobalFlag |= GFLAG_ZSETTING;
- }
- }
- } else {
- current->hwCapEnable &= ~MASK_ZWriteEnable;
- }
- } else {
- if (flag) {
- current->hwCapEnable |= MASK_ZWriteEnable;
- current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable;
- } else {
- current->hwCapEnable &= ~MASK_ZWriteEnable;
- }
- }
-}
-
-/* =============================================================
- * Clipping
- */
-
-void
-sisUpdateClipping( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- GLint x1, y1, x2, y2;
-
- x1 = 0;
- y1 = 0;
- x2 = smesa->width - 1;
- y2 = smesa->height - 1;
-
- if (ctx->Scissor.Enabled) {
- if (ctx->Scissor.X > x1)
- x1 = ctx->Scissor.X;
- if (ctx->Scissor.Y > y1)
- y1 = ctx->Scissor.Y;
- if (ctx->Scissor.X + ctx->Scissor.Width - 1 < x2)
- x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
- if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < y2)
- y2 = ctx->Scissor.Y + ctx->Scissor.Height - 1;
- }
-
- y1 = Y_FLIP(y1);
- y2 = Y_FLIP(y2);
-
- current->clipTopBottom = (y2 << 13) | y1;
- current->clipLeftRight = (x1 << 13) | x2;
-
- if ((current->clipTopBottom ^ prev->clipTopBottom) ||
- (current->clipLeftRight ^ prev->clipLeftRight))
- {
- prev->clipTopBottom = current->clipTopBottom;
- prev->clipLeftRight = current->clipLeftRight;
- smesa->GlobalFlag |= GFLAG_CLIPPING;
- }
-}
-
-static void
-sisDDScissor( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
-{
- if (ctx->Scissor.Enabled)
- sisUpdateClipping( ctx );
-}
-
-/* =============================================================
- * Culling
- */
-
-static void
-sisUpdateCull( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- GLint cullflag, frontface;
-
- cullflag = ctx->Polygon.CullFaceMode;
- frontface = ctx->Polygon.FrontFace;
-
- smesa->AGPParseSet &= ~(MASK_PsCullDirection_CCW);
- smesa->dwPrimitiveSet &= ~(MASK_CullDirection);
-
- if((cullflag == GL_FRONT && frontface == GL_CCW) ||
- (cullflag == GL_BACK && frontface == GL_CW))
- {
- smesa->AGPParseSet |= MASK_PsCullDirection_CCW;
- smesa->dwPrimitiveSet |= OP_3D_CullDirection_CCW;
- }
-}
-
-
-static void
-sisDDCullFace( GLcontext *ctx, GLenum mode )
-{
- sisUpdateCull( ctx );
-}
-
-static void
-sisDDFrontFace( GLcontext *ctx, GLenum mode )
-{
- sisUpdateCull( ctx );
-}
-
-/* =============================================================
- * Masks
- */
-
-static void sisDDColorMask( GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- if (r && g && b && ((ctx->Visual.alphaBits == 0) || a)) {
- current->hwCapEnable2 &= ~(MASK_AlphaMaskWriteEnable |
- MASK_ColorMaskWriteEnable);
- } else {
- current->hwCapEnable2 |= (MASK_AlphaMaskWriteEnable |
- MASK_ColorMaskWriteEnable);
-
- current->hwDstMask = (r) ? smesa->redMask : 0 |
- (g) ? smesa->greenMask : 0 |
- (b) ? smesa->blueMask : 0 |
- (a) ? smesa->alphaMask : 0;
- }
-
- if (current->hwDstMask != prev->hwDstMask) {
- prev->hwDstMask = current->hwDstMask;
- smesa->GlobalFlag |= GFLAG_DESTSETTING;
- }
-}
-
-/* =============================================================
- * Rendering attributes
- */
-
-static void sisDDShadeModel( GLcontext *ctx, GLenum mode )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- /* Signal to sisRasterPrimitive to recalculate dwPrimitiveSet */
- smesa->hw_primitive = -1;
-}
-
-/* =============================================================
- * Window position
- */
-
-/* =============================================================
- * Viewport
- */
-
-static void sisCalcViewport( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = smesa->hw_viewport;
-
- /* See also sis_translate_vertex.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + smesa->driDrawable->h + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * smesa->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * smesa->depth_scale;
-}
-
-static void sisDDViewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- sisCalcViewport( ctx );
-}
-
-static void sisDDDepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- sisCalcViewport( ctx );
-}
-
-/* =============================================================
- * Miscellaneous
- */
-
-static void
-sisDDLogicOpCode( GLcontext *ctx, GLenum opcode )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- current->hwDstSet &= ~MASK_ROP2;
- switch (opcode)
- {
- case GL_CLEAR:
- current->hwDstSet |= LOP_CLEAR;
- break;
- case GL_SET:
- current->hwDstSet |= LOP_SET;
- break;
- case GL_COPY:
- current->hwDstSet |= LOP_COPY;
- break;
- case GL_COPY_INVERTED:
- current->hwDstSet |= LOP_COPY_INVERTED;
- break;
- case GL_NOOP:
- current->hwDstSet |= LOP_NOOP;
- break;
- case GL_INVERT:
- current->hwDstSet |= LOP_INVERT;
- break;
- case GL_AND:
- current->hwDstSet |= LOP_AND;
- break;
- case GL_NAND:
- current->hwDstSet |= LOP_NAND;
- break;
- case GL_OR:
- current->hwDstSet |= LOP_OR;
- break;
- case GL_NOR:
- current->hwDstSet |= LOP_NOR;
- break;
- case GL_XOR:
- current->hwDstSet |= LOP_XOR;
- break;
- case GL_EQUIV:
- current->hwDstSet |= LOP_EQUIV;
- break;
- case GL_AND_REVERSE:
- current->hwDstSet |= LOP_AND_REVERSE;
- break;
- case GL_AND_INVERTED:
- current->hwDstSet |= LOP_AND_INVERTED;
- break;
- case GL_OR_REVERSE:
- current->hwDstSet |= LOP_OR_REVERSE;
- break;
- case GL_OR_INVERTED:
- current->hwDstSet |= LOP_OR_INVERTED;
- break;
- }
-
- if (current->hwDstSet ^ prev->hwDstSet) {
- prev->hwDstSet = current->hwDstSet;
- smesa->GlobalFlag |= GFLAG_DESTSETTING;
- }
-}
-
-void sisDDDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- /*
- * _DrawDestMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- case BUFFER_BIT_BACK_LEFT:
- FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
- FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE );
- return;
- }
-
- /* We want to update the s/w rast state too so that sisDDSetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-
- current->hwOffsetDest = (smesa->drawOffset) >> 1;
- current->hwDstSet &= ~MASK_DstBufferPitch;
- current->hwDstSet |= smesa->drawPitch >> 2;
-
- if (current->hwDstSet != prev->hwDstSet) {
- prev->hwDstSet = current->hwDstSet;
- smesa->GlobalFlag |= GFLAG_DESTSETTING;
- }
-
- if (current->hwOffsetDest != prev->hwOffsetDest) {
- prev->hwOffsetDest = current->hwOffsetDest;
- smesa->GlobalFlag |= GFLAG_DESTSETTING;
- }
-}
-
-/* =============================================================
- * Polygon stipple
- */
-
-/* =============================================================
- * Render mode
- */
-
-/* =============================================================
- * State enable/disable
- */
-
-static void
-sisDDEnable( GLcontext * ctx, GLenum cap, GLboolean state )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *current = &smesa->current;
-
- switch (cap)
- {
- case GL_ALPHA_TEST:
- if (state)
- current->hwCapEnable |= MASK_AlphaTestEnable;
- else
- current->hwCapEnable &= ~MASK_AlphaTestEnable;
- break;
- case GL_BLEND:
- /* TODO: */
- if (state)
- /* if (state & !ctx->Color.ColorLogicOpEnabled) */
- current->hwCapEnable |= MASK_BlendEnable;
- else
- current->hwCapEnable &= ~MASK_BlendEnable;
- break;
- case GL_CULL_FACE:
- if (state)
- current->hwCapEnable |= MASK_CullEnable;
- else
- current->hwCapEnable &= ~MASK_CullEnable;
- break;
- case GL_DEPTH_TEST:
- if (state && smesa->depthbuffer)
- current->hwCapEnable |= MASK_ZTestEnable;
- else
- current->hwCapEnable &= ~MASK_ZTestEnable;
- sisDDDepthMask( ctx, ctx->Depth.Mask );
- break;
- case GL_DITHER:
- if (state)
- current->hwCapEnable |= MASK_DitherEnable;
- else
- current->hwCapEnable &= ~MASK_DitherEnable;
- break;
- case GL_FOG:
- if (state)
- current->hwCapEnable |= MASK_FogEnable;
- else
- current->hwCapEnable &= ~MASK_FogEnable;
- break;
- case GL_COLOR_LOGIC_OP:
- if (state)
- sisDDLogicOpCode( ctx, ctx->Color.LogicOp );
- else
- sisDDLogicOpCode( ctx, GL_COPY );
- break;
- case GL_SCISSOR_TEST:
- sisUpdateClipping( ctx );
- break;
- case GL_STENCIL_TEST:
- if (state) {
- if (smesa->zFormat != SiS_ZFORMAT_S8Z24)
- FALLBACK(smesa, SIS_FALLBACK_STENCIL, 1);
- else
- current->hwCapEnable |= (MASK_StencilTestEnable |
- MASK_StencilWriteEnable);
- } else {
- FALLBACK(smesa, SIS_FALLBACK_STENCIL, 0);
- current->hwCapEnable &= ~(MASK_StencilTestEnable |
- MASK_StencilWriteEnable);
- }
- break;
- }
-}
-
-
-/* =============================================================
- * State initialization, management
- */
-
-/* Called before beginning of rendering. */
-void
-sisUpdateHWState( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- /* enable setting 1 */
- if (current->hwCapEnable ^ prev->hwCapEnable) {
- prev->hwCapEnable = current->hwCapEnable;
- smesa->GlobalFlag |= GFLAG_ENABLESETTING;
- }
-
- /* enable setting 2 */
- if (current->hwCapEnable2 ^ prev->hwCapEnable2) {
- prev->hwCapEnable2 = current->hwCapEnable2;
- smesa->GlobalFlag |= GFLAG_ENABLESETTING2;
- }
-
- if (smesa->GlobalFlag & GFLAG_RENDER_STATES)
- sis_update_render_state( smesa );
-
- if (smesa->GlobalFlag & GFLAG_TEXTURE_STATES)
- sis_update_texture_state( smesa );
-}
-
-static void
-sisDDInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- smesa->NewGLState |= new_state;
-}
-
-/* Initialize the context's hardware state.
- */
-void sisDDInitState( sisContextPtr smesa )
-{
- __GLSiSHardware *current = &smesa->current;
- __GLSiSHardware *prev = &(smesa->prev);
- GLcontext *ctx = smesa->glCtx;
-
- /* add Texture Perspective Enable */
- prev->hwCapEnable = MASK_FogPerspectiveEnable | MASK_TextureCacheEnable |
- MASK_TexturePerspectiveEnable | MASK_DitherEnable;
- /*| MASK_SpecularEnable*/
-
- /*
- prev->hwCapEnable2 = 0x00aa0080;
- */
- /* if multi-texture enabled, disable Z pre-test */
- prev->hwCapEnable2 = MASK_TextureMipmapBiasEnable;
-
- /* Z test mode is LESS */
- prev->hwZ = SiS_Z_COMP_S_LT_B;
-
- /* Depth mask */
- prev->hwZMask = 0xffffffff;
-
- /* Alpha test mode is ALWAYS, alpha ref value is 0 */
- prev->hwAlpha = SiS_ALPHA_ALWAYS;
-
- /* ROP2 is COPYPEN */
- prev->hwDstSet = LOP_COPY;
-
- /* color mask */
- prev->hwDstMask = 0xffffffff;
-
- /* LinePattern is 0, Repeat Factor is 0 */
- prev->hwLinePattern = 0x00008000;
-
- /* Src blend is BLEND_ONE, Dst blend is D3DBLEND_ZERO */
- prev->hwDstSrcBlend = SiS_S_ONE | SiS_D_ZERO;
-
- /* Stenciling disabled, function ALWAYS, ref value zero, mask all ones */
- prev->hwStSetting = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS | 0xff;
- /* Op is KEEP for all three operations */
- prev->hwStSetting2 = SiS_SFAIL_KEEP | SiS_SPASS_ZFAIL_KEEP |
- SiS_SPASS_ZPASS_KEEP;
-
- /* Texture mapping mode is Tile */
-#if 0
- prev->texture[0].hwTextureSet = 0x00030000;
-#endif
- /* Magnified & minified texture filter is NEAREST */
-#if 0
- prev->texture[0].hwTextureMip = 0;
-#endif
-
- /* Texture Blending setting -- use fragment color/alpha*/
- prev->hwTexBlendColor0 = STAGE0_C_CF;
- prev->hwTexBlendColor1 = STAGE1_C_CF;
- prev->hwTexBlendAlpha0 = STAGE0_A_AF;
- prev->hwTexBlendAlpha1 = STAGE1_A_AF;
-
- switch (smesa->bytesPerPixel)
- {
- case 2:
- prev->hwDstSet |= DST_FORMAT_RGB_565;
- break;
- case 4:
- prev->hwDstSet |= DST_FORMAT_ARGB_8888;
- break;
- }
-
- switch (ctx->Visual.depthBits)
- {
- case 0:
- prev->hwCapEnable &= ~MASK_ZWriteEnable;
- case 16:
- smesa->zFormat = SiS_ZFORMAT_Z16;
- prev->hwCapEnable |= MASK_ZWriteEnable;
- smesa->depth_scale = 1.0 / (GLfloat)0xffff;
- break;
- case 32:
- smesa->zFormat = SiS_ZFORMAT_Z32;
- prev->hwCapEnable |= MASK_ZWriteEnable;
- smesa->depth_scale = 1.0 / (GLfloat)0xffffffff;
- break;
- case 24:
- assert (ctx->Visual.stencilBits);
- smesa->zFormat = SiS_ZFORMAT_S8Z24;
- prev->hwCapEnable |= MASK_StencilBufferEnable;
- prev->hwCapEnable |= MASK_ZWriteEnable;
- smesa->depth_scale = 1.0 / (GLfloat)0xffffff;
- break;
- }
-
- prev->hwZ |= smesa->zFormat;
-
- /* TODO: need to clear cache? */
- smesa->clearTexCache = GL_TRUE;
-
- smesa->clearColorPattern = 0;
-
- smesa->AGPParseSet = MASK_PsTexture1FromB | MASK_PsBumpTextureFromC;
- smesa->dwPrimitiveSet = OP_3D_Texture1FromB | OP_3D_TextureBumpFromC;
-
- sisUpdateZStencilPattern( smesa, 1.0, 0 );
- sisUpdateCull( ctx );
-
- memcpy( current, prev, sizeof (__GLSiSHardware) );
-
- /* Set initial fog settings. Start and end are the same case. */
- sisDDFogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
- sisDDFogfv( ctx, GL_FOG_END, &ctx->Fog.End );
- sisDDFogfv( ctx, GL_FOG_MODE, NULL );
-}
-
-/* Initialize the driver's state functions.
- */
-void sisDDInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = sisDDInvalidateState;
-
- ctx->Driver.Clear = sisDDClear;
- ctx->Driver.ClearColor = sisDDClearColor;
- ctx->Driver.ClearDepth = sisDDClearDepth;
- ctx->Driver.ClearStencil = sisDDClearStencil;
-
- ctx->Driver.AlphaFunc = sisDDAlphaFunc;
- ctx->Driver.BlendFuncSeparate = sisDDBlendFuncSeparate;
- ctx->Driver.ColorMask = sisDDColorMask;
- ctx->Driver.CullFace = sisDDCullFace;
- ctx->Driver.DepthMask = sisDDDepthMask;
- ctx->Driver.DepthFunc = sisDDDepthFunc;
- ctx->Driver.DepthRange = sisDDDepthRange;
- ctx->Driver.DrawBuffer = sisDDDrawBuffer;
- ctx->Driver.Enable = sisDDEnable;
- ctx->Driver.FrontFace = sisDDFrontFace;
- ctx->Driver.Fogfv = sisDDFogfv;
- ctx->Driver.Hint = NULL;
- ctx->Driver.Lightfv = NULL;
- ctx->Driver.LogicOpcode = sisDDLogicOpCode;
- ctx->Driver.PolygonMode = NULL;
- ctx->Driver.PolygonStipple = NULL;
- ctx->Driver.ReadBuffer = NULL;
- ctx->Driver.RenderMode = NULL;
- ctx->Driver.Scissor = sisDDScissor;
- ctx->Driver.ShadeModel = sisDDShadeModel;
- ctx->Driver.Viewport = sisDDViewport;
-
- /* Pixel path fallbacks. */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.h
deleted file mode 100644
index 770ba478a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_state.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_STATE_H__
-#define __SIS_STATE_H__
-
-#include "sis_context.h"
-
-extern void sisDDInitState( sisContextPtr smesa );
-extern void sisDDInitStateFuncs( GLcontext *ctx );
-
-extern void sisDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height );
-extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] );
-extern void sisDDClearDepth( GLcontext * ctx, GLclampd d );
-extern void sisDDClearStencil( GLcontext * ctx, GLint s );
-extern void sisDDFogfv( GLcontext * ctx, GLenum pname, const GLfloat * params );
-extern void sisDDDepthMask( GLcontext * ctx, GLboolean flag );
-
-extern void sisUpdateClipping( GLcontext * gc );
-extern void sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z,
- int stencil );
-extern void sisDDDrawBuffer( GLcontext *ctx, GLenum mode );
-extern void sisUpdateHWState( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.c
deleted file mode 100644
index a31d49ca2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_stencil.c,v 1.3 2000/09/26 15:56:49 tsi Exp $ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_state.h"
-#include "sis_stencil.h"
-
-static void
-sisDDStencilFunc( GLcontext * ctx, GLenum func, GLint ref, GLuint mask )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- /* set reference */
- current->hwStSetting = STENCIL_FORMAT_8 | (ctx->Stencil.Ref[0] << 8) |
- ctx->Stencil.ValueMask[0];
-
- switch (func)
- {
- case GL_NEVER:
- current->hwStSetting |= SiS_STENCIL_NEVER;
- break;
- case GL_LESS:
- current->hwStSetting |= SiS_STENCIL_LESS;
- break;
- case GL_EQUAL:
- current->hwStSetting |= SiS_STENCIL_EQUAL;
- break;
- case GL_LEQUAL:
- current->hwStSetting |= SiS_STENCIL_LEQUAL;
- break;
- case GL_GREATER:
- current->hwStSetting |= SiS_STENCIL_GREATER;
- break;
- case GL_NOTEQUAL:
- current->hwStSetting |= SiS_STENCIL_NOTEQUAL;
- break;
- case GL_GEQUAL:
- current->hwStSetting |= SiS_STENCIL_GEQUAL;
- break;
- case GL_ALWAYS:
- current->hwStSetting |= SiS_STENCIL_ALWAYS;
- break;
- }
-
- if (current->hwStSetting != prev->hwStSetting)
- {
- prev->hwStSetting = current->hwStSetting;
-
- smesa->GlobalFlag |= GFLAG_STENCILSETTING;
- }
-}
-
-static void
-sisDDStencilMask( GLcontext * ctx, GLuint mask )
-{
- if (!ctx->Visual.stencilBits)
- return;
-
- /* set Z buffer Write Enable */
- sisDDDepthMask (ctx, ctx->Depth.Mask);
-}
-
-static void
-sisDDStencilOp( GLcontext * ctx, GLenum fail, GLenum zfail, GLenum zpass )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- current->hwStSetting2 &= ~(MASK_StencilZPassOp | MASK_StencilZFailOp |
- MASK_StencilFailOp);
-
- switch (fail)
- {
- case GL_KEEP:
- current->hwStSetting2 |= SiS_SFAIL_KEEP;
- break;
- case GL_ZERO:
- current->hwStSetting2 |= SiS_SFAIL_ZERO;
- break;
- case GL_REPLACE:
- current->hwStSetting2 |= SiS_SFAIL_REPLACE;
- break;
- case GL_INVERT:
- current->hwStSetting2 |= SiS_SFAIL_INVERT;
- break;
- case GL_INCR:
- current->hwStSetting2 |= SiS_SFAIL_INCR;
- break;
- case GL_DECR:
- current->hwStSetting2 |= SiS_SFAIL_DECR;
- break;
- }
-
- switch (zfail)
- {
- case GL_KEEP:
- current->hwStSetting2 |= SiS_SPASS_ZFAIL_KEEP;
- break;
- case GL_ZERO:
- current->hwStSetting2 |= SiS_SPASS_ZFAIL_ZERO;
- break;
- case GL_REPLACE:
- current->hwStSetting2 |= SiS_SPASS_ZFAIL_REPLACE;
- break;
- case GL_INVERT:
- current->hwStSetting2 |= SiS_SPASS_ZFAIL_INVERT;
- break;
- case GL_INCR:
- current->hwStSetting2 |= SiS_SPASS_ZFAIL_INCR;
- break;
- case GL_DECR:
- current->hwStSetting2 |= SiS_SPASS_ZFAIL_DECR;
- break;
- }
-
- switch (zpass)
- {
- case GL_KEEP:
- current->hwStSetting2 |= SiS_SPASS_ZPASS_KEEP;
- break;
- case GL_ZERO:
- current->hwStSetting2 |= SiS_SPASS_ZPASS_ZERO;
- break;
- case GL_REPLACE:
- current->hwStSetting2 |= SiS_SPASS_ZPASS_REPLACE;
- break;
- case GL_INVERT:
- current->hwStSetting2 |= SiS_SPASS_ZPASS_INVERT;
- break;
- case GL_INCR:
- current->hwStSetting2 |= SiS_SPASS_ZPASS_INCR;
- break;
- case GL_DECR:
- current->hwStSetting2 |= SiS_SPASS_ZPASS_DECR;
- break;
- }
-
- if (current->hwStSetting2 != prev->hwStSetting2)
- {
- prev->hwStSetting2 = current->hwStSetting2;
- smesa->GlobalFlag |= GFLAG_STENCILSETTING;
- }
-}
-
-void
-sisDDInitStencilFuncs( GLcontext *ctx )
-{
- ctx->Driver.StencilFunc = sisDDStencilFunc;
- ctx->Driver.StencilMask = sisDDStencilMask;
- ctx->Driver.StencilOp = sisDDStencilOp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.h
deleted file mode 100644
index 4a36c98f3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_stencil.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_STENCIL_H__
-#define __SIS_STENCIL_H__
-
-extern void sisDDInitStencilFuncs( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.c
deleted file mode 100644
index 5fa8256f1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "sis_context.h"
-#include "sis_alloc.h"
-#include "sis_tex.h"
-
-#include "swrast/swrast.h"
-#include "imports.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "texobj.h"
-
-#define ALIGN(value, align) (GLubyte *)((long)(value + align - 1) & ~(align - 1))
-
-#define TEXTURE_HW_ALIGNMENT 4
-#define TEXTURE_HW_PLUS (4 + 4)
-
-static sisTexObjPtr
-sisAllocTexObj( struct gl_texture_object *texObj )
-{
- sisTexObjPtr t;
-
- t = (sisTexObjPtr) CALLOC_STRUCT( sis_tex_obj );
- texObj->DriverData = t;
- return t;
-}
-
-static void
-sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level,
- const struct gl_texture_image *image )
-{
- char *addr;
- int size, texel_size;
-
- if (t->format == 0) {
- t->format = image->Format;
- switch (t->format)
- {
- case GL_RGBA:
- t->hwformat = TEXEL_ARGB_8888_32;
- break;
- case GL_INTENSITY:
- t->hwformat = TEXEL_I8;
- break;
- case GL_ALPHA:
- t->hwformat = TEXEL_A8;
- break;
- case GL_LUMINANCE:
- t->hwformat = TEXEL_L8;
- break;
- case GL_LUMINANCE_ALPHA:
- t->hwformat = TEXEL_AL88;
- break;
- case GL_RGB:
- t->hwformat = TEXEL_ARGB_0888_32;
- break;
- default:
- sis_fatal_error("Bad texture format.\n");
- }
- }
- assert(t->format == image->Format);
-
- texel_size = image->TexFormat->TexelBytes;
- size = image->Width * image->Height * texel_size + TEXTURE_HW_PLUS;
-
- addr = sisAllocFB( smesa, size, &t->image[level].handle );
- if (addr == NULL) {
- addr = sisAllocAGP( smesa, size, &t->image[level].handle );
- if (addr == NULL)
- sis_fatal_error("Failure to allocate texture memory.\n");
- t->image[level].memType = AGP_TYPE;
- }
- else
- t->image[level].memType = VIDEO_TYPE;
-
- t->image[level].Data = ALIGN(addr, TEXTURE_HW_ALIGNMENT);
- t->image[level].pitch = image->Width * texel_size;
- t->image[level].size = image->Width * image->Height * texel_size;
- t->numImages++;
-}
-
-static void
-sisFreeTexImage( sisContextPtr smesa, sisTexObjPtr t, int level )
-{
- if (t->image[level].Data == NULL)
- return;
-
- switch (t->image[level].memType)
- {
- case VIDEO_TYPE:
- sisFreeFB( smesa, t->image[level].handle );
- break;
- case AGP_TYPE:
- sisFreeAGP( smesa, t->image[level].handle );
- break;
- }
- t->image[level].Data = NULL;
- t->image[level].handle = NULL;
- /* If there are no textures loaded any more, reset the hw format so the
- * object can be reused for new formats
- */
- t->numImages--;
- if (t->numImages == 0) {
- t->format = 0;
- t->hwformat = 0;
- }
-}
-
-static void
-sisTexEnv( GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *param )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV;
-}
-
-static void
-sisTexParameter( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj, GLenum pname,
- const GLfloat *params )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING;
-}
-
-static void
-sisBindTexture( GLcontext *ctx, GLenum target,
- struct gl_texture_object *texObj )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- sisTexObjPtr t;
-
- if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
- if ( texObj->DriverData == NULL ) {
- sisAllocTexObj( texObj );
- }
- }
-
- t = texObj->DriverData;
- if (!t)
- return;
-
- if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) {
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV;
- smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format;
- }
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING;
-}
-
-static void
-sisDeleteTexture( GLcontext * ctx, struct gl_texture_object *texObj )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- sisTexObjPtr t;
- int i;
-
- smesa->clearTexCache = GL_TRUE;
-
- t = texObj->DriverData;
- if (t == NULL) {
- /*
- * this shows the texture is default object and never be a
- * argument of sisTexImage*
- */
- return;
- }
- for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
- sisFreeTexImage( smesa, t, i );
- }
-
- FREE(t);
- texObj->DriverData = NULL;
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, texObj);
-}
-
-static GLboolean sisIsTextureResident( GLcontext * ctx,
- struct gl_texture_object *texObj )
-{
- return (texObj->DriverData != NULL);
-}
-
-static const struct gl_texture_format *
-sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- /* XXX 16-bit internal texture formats? */
- switch ( internalFormat ) {
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return &_mesa_texformat_a8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return &_mesa_texformat_l8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return &_mesa_texformat_al88;
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return &_mesa_texformat_i8;
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case 3:
- case GL_RGB:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_argb8888 /*_mesa_texformat_rgb888*/; /* XXX */
- case GL_RGBA2:
- case GL_RGBA4:
- case GL_RGB5_A1:
- case 4:
- case GL_RGBA:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb8888;
- default:
- _mesa_problem(ctx, "unexpected format in tdfxDDChooseTextureFormat: %d",
- internalFormat);
- return NULL;
- }
-}
-
-static void sisTexImage1D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- sisTexObjPtr t;
-
- if ( texObj->DriverData == NULL )
- sisAllocTexObj( texObj );
- t = texObj->DriverData;
-
- /* Note, this will call sisChooseTextureFormat */
- _mesa_store_teximage1d( ctx, target, level, internalFormat,
- width, border, format, type,
- pixels, packing, texObj, texImage );
-
- /* Allocate offscreen space for the texture */
- sisFreeTexImage(smesa, t, level);
- sisAllocTexImage(smesa, t, level, texImage);
-
- /* Upload the texture */
- memcpy(t->image[level].Data, texImage->Data, t->image[level].size);
-
- if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format)
- {
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV;
- smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format;
- }
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING;
-}
-
-
-static void sisTexSubImage1D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- sisTexObjPtr t;
- GLuint copySize;
- GLint texelBytes;
- const char *src;
- GLubyte *dst;
-
- if ( texObj->DriverData == NULL )
- sisAllocTexObj( texObj );
- t = texObj->DriverData;
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-
- /* Allocate offscreen space for the texture */
- sisFreeTexImage(smesa, t, level);
- sisAllocTexImage(smesa, t, level, texImage);
-
- /* Upload the texture */
- texelBytes = texImage->TexFormat->TexelBytes;
-
- copySize = width * texelBytes;
- src = (char *)texImage->Data + xoffset * texelBytes;
- dst = t->image[level].Data + xoffset * texelBytes;
-
- memcpy( dst, src, copySize );
-
- smesa->clearTexCache = GL_TRUE;
-
- if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format)
- {
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV;
- smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format;
- }
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING;
-}
-
-static void sisTexImage2D( GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- sisTexObjPtr t;
-
- if ( texObj->DriverData == NULL )
- sisAllocTexObj( texObj );
- t = texObj->DriverData;
-
- /* Note, this will call sisChooseTextureFormat */
- _mesa_store_teximage2d(ctx, target, level, internalFormat,
- width, height, border, format, type, pixels,
- &ctx->Unpack, texObj, texImage);
-
- /* Allocate offscreen space for the texture */
- sisFreeTexImage(smesa, t, level);
- sisAllocTexImage(smesa, t, level, texImage);
-
- /* Upload the texture */
- memcpy(t->image[level].Data, texImage->Data, t->image[level].size);
-
- if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format)
- {
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV;
- smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format;
- }
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING;
-}
-
-static void sisTexSubImage2D( GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- sisTexObjPtr t;
- GLuint copySize;
- GLint texelBytes;
- const char *src;
- GLubyte *dst;
- int j;
- GLuint soffset;
-
- if ( texObj->DriverData == NULL )
- sisAllocTexObj( texObj );
- t = texObj->DriverData;
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-
- /* Allocate offscreen space for the texture */
- sisFreeTexImage(smesa, t, level);
- sisAllocTexImage(smesa, t, level, texImage);
-
- /* Upload the texture */
- texelBytes = texImage->TexFormat->TexelBytes;
-
- copySize = width * texelBytes;
- src = (char *)texImage->Data + (xoffset + yoffset * texImage->Width) *
- texelBytes;
- dst = t->image[level].Data + (xoffset + yoffset * texImage->Width) *
- texelBytes;
- soffset = texImage->Width * texelBytes;
-
- for (j = yoffset; j < yoffset + height; j++) {
- memcpy( dst, src, copySize );
- src += soffset;
- dst += soffset;
- }
-
- smesa->clearTexCache = GL_TRUE;
-
- if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format)
- {
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV;
- smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format;
- }
- smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING;
-}
-
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-sisNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- return obj;
-}
-
-
-void sisInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->TexEnv = sisTexEnv;
- functions->ChooseTextureFormat = sisChooseTextureFormat;
- functions->TexImage1D = sisTexImage1D;
- functions->TexSubImage1D = sisTexSubImage1D;
- functions->TexImage2D = sisTexImage2D;
- functions->TexSubImage2D = sisTexSubImage2D;
- functions->TexParameter = sisTexParameter;
- functions->BindTexture = sisBindTexture;
- functions->NewTextureObject = sisNewTextureObject;
- functions->DeleteTexture = sisDeleteTexture;
- functions->IsTextureResident = sisIsTextureResident;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.h
deleted file mode 100644
index 8ddc7c469..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tex.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_TEX_H__
-#define __SIS_TEX_H__
-
-extern void sisInitTextureFuncs( struct dd_function_table *table );
-extern void sisUpdateTextureState( GLcontext *ctx );
-
-#endif /* __SIS_TEX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_texstate.c
deleted file mode 100644
index a18ad06bd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_texstate.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-/* $XFree86$ */
-
-/*
- * Authors:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-
-#include "sis_context.h"
-#include "sis_state.h"
-#include "sis_tex.h"
-#include "sis_tris.h"
-#include "sis_alloc.h"
-
-static GLint TransferTexturePitch (GLint dwPitch);
-
-/* Handle texenv stuff, called from validate_texture (renderstart) */
-static void
-sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
- int unit )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- struct gl_texture_unit *texture_unit = &ctx->Texture.Unit[unit];
-
- sisTexObjPtr t = texObj->DriverData;
-
- switch (texture_unit->EnvMode)
- {
- case GL_REPLACE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
- switch (t->format)
- {
- case GL_ALPHA:
- current->hwTexBlendColor0 = STAGE0_C_CF;
- current->hwTexBlendAlpha0 = STAGE0_A_AS;
- break;
- case GL_LUMINANCE:
- case GL_RGB:
- current->hwTexBlendColor0 = STAGE0_C_CS;
- current->hwTexBlendAlpha0 = STAGE0_A_AF;
- break;
- case GL_INTENSITY:
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- current->hwTexBlendColor0 = STAGE0_C_CS;
- current->hwTexBlendAlpha0 = STAGE0_A_AS;
- break;
- }
- break;
-
- case GL_MODULATE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
- switch (t->format)
- {
- case GL_ALPHA:
- current->hwTexBlendColor0 = STAGE0_C_CF;
- current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
- break;
- case GL_LUMINANCE:
- case GL_RGB:
- current->hwTexBlendColor0 = STAGE0_C_CFCS;
- current->hwTexBlendAlpha0 = STAGE0_A_AF;
- break;
- case GL_INTENSITY:
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- current->hwTexBlendColor0 = STAGE0_C_CFCS;
- current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
- break;
- }
- break;
-
- case GL_DECAL:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
- switch (t->format)
- {
- case GL_RGB:
- current->hwTexBlendColor0 = STAGE0_C_CS;
- current->hwTexBlendAlpha0 = STAGE0_A_AF;
- break;
- case GL_RGBA:
- current->hwTexBlendColor0 = STAGE0_C_CFOMAS_CSAS;
- current->hwTexBlendAlpha0 = STAGE0_A_AF;
- break;
- }
- break;
-
- case GL_BLEND:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 1);
-#if 0 /* XXX Blending broken */
- current->hwTexEnvColor =
- ((GLint) (texture_unit->EnvColor[3])) << 24 |
- ((GLint) (texture_unit->EnvColor[0])) << 16 |
- ((GLint) (texture_unit->EnvColor[1])) << 8 |
- ((GLint) (texture_unit->EnvColor[2]));
- switch (t->format)
- {
- case GL_ALPHA:
- current->hwTexBlendColor0 = STAGE0_C_CF;
- current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
- break;
- case GL_LUMINANCE:
- case GL_RGB:
- current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS;
- current->hwTexBlendAlpha0 = STAGE0_A_AF;
- break;
- case GL_INTENSITY:
- current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS;
- current->hwTexBlendAlpha0 = STAGE0_A_AFOMAS_ACAS;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS;
- current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
- break;
- }
- break;
-#endif
- }
-
- if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) ||
- (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) ||
- (current->hwTexEnvColor != prev->hwTexEnvColor))
- {
- prev->hwTexEnvColor = current->hwTexEnvColor;
- prev->hwTexBlendColor0 = current->hwTexBlendColor0;
- prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0;
- smesa->GlobalFlag |= GFLAG_TEXTUREENV;
- }
-}
-
-/* Handle texenv stuff, called from validate_texture (renderstart) */
-static void
-sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
- int unit)
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- struct gl_texture_unit *texture_unit = &ctx->Texture.Unit[unit];
-
- sisTexObjPtr t = texObj->DriverData;
-
- switch (texture_unit->EnvMode)
- {
- case GL_REPLACE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0);
- switch (t->format)
- {
- case GL_ALPHA:
- current->hwTexBlendColor1 = STAGE1_C_CF;
- current->hwTexBlendAlpha1 = STAGE1_A_AS;
- break;
- case GL_LUMINANCE:
- case GL_RGB:
- current->hwTexBlendColor1 = STAGE1_C_CS;
- current->hwTexBlendAlpha1 = STAGE1_A_AF;
- break;
- case GL_INTENSITY:
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- current->hwTexBlendColor1 = STAGE1_C_CS;
- current->hwTexBlendAlpha1 = STAGE1_A_AS;
- break;
- }
- break;
-
- case GL_MODULATE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0);
- switch (t->format)
- {
- case GL_ALPHA:
- current->hwTexBlendColor1 = STAGE1_C_CF;
- current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
- break;
- case GL_LUMINANCE:
- case GL_RGB:
- current->hwTexBlendColor1 = STAGE1_C_CFCS;
- current->hwTexBlendAlpha1 = STAGE1_A_AF;
- break;
- case GL_INTENSITY:
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- current->hwTexBlendColor1 = STAGE1_C_CFCS;
- current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
- break;
- }
- break;
-
- case GL_DECAL:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0);
- switch (t->format)
- {
- case GL_RGB:
- current->hwTexBlendColor1 = STAGE1_C_CS;
- current->hwTexBlendAlpha1 = STAGE1_A_AF;
- break;
- case GL_RGBA:
- current->hwTexBlendColor1 = STAGE1_C_CFOMAS_CSAS;
- current->hwTexBlendAlpha1 = STAGE1_A_AF;
- break;
- }
- break;
-
- case GL_BLEND:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 1);
-#if 0 /* XXX Blending broken */
- current->hwTexEnvColor =
- ((GLint) (texture_unit->EnvColor[3])) << 24 |
- ((GLint) (texture_unit->EnvColor[0])) << 16 |
- ((GLint) (texture_unit->EnvColor[1])) << 8 |
- ((GLint) (texture_unit->EnvColor[2]));
- switch (t->format)
- {
- case GL_ALPHA:
- current->hwTexBlendColor1 = STAGE1_C_CF;
- current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
- break;
- case GL_LUMINANCE:
- case GL_RGB:
- current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS;
- current->hwTexBlendAlpha1 = STAGE1_A_AF;
- break;
- case GL_INTENSITY:
- current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS;
- current->hwTexBlendAlpha1 = STAGE1_A_AFOMAS_ACAS;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS;
- current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
- break;
- }
- break;
-#endif
- }
-
- if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) ||
- (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) ||
- (current->hwTexEnvColor != prev->hwTexEnvColor))
- {
- prev->hwTexBlendColor1 = current->hwTexBlendColor1;
- prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1;
- prev->hwTexEnvColor = current->hwTexEnvColor;
- smesa->GlobalFlag |= GFLAG_TEXTUREENV_1;
- }
-}
-
-/* Returns 0 if a software fallback is necessary */
-static GLboolean
-sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj,
- int hw_unit )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- int ok = 1;
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- sisTexObjPtr t = texObj->DriverData;
-
- GLint firstLevel, lastLevel;
- GLint i;
-
- current->texture[hw_unit].hwTextureMip = 0UL;
- current->texture[hw_unit].hwTextureSet = t->hwformat;
-
- if ((texObj->MinFilter == GL_NEAREST) || (texObj->MinFilter == GL_LINEAR)) {
- firstLevel = lastLevel = texObj->BaseLevel;
- } else {
- /* Compute which mipmap levels we really want to send 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.
- * Yes, this looks overly complicated, but it's all needed.
- */
-
- firstLevel = texObj->BaseLevel + (GLint)(texObj->MinLod + 0.5);
- firstLevel = MAX2(firstLevel, texObj->BaseLevel);
- lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5);
- lastLevel = MAX2(lastLevel, texObj->BaseLevel);
- lastLevel = MIN2(lastLevel, texObj->BaseLevel +
- texObj->Image[0][texObj->BaseLevel]->MaxLog2);
- lastLevel = MIN2(lastLevel, texObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
- }
-
- current->texture[hw_unit].hwTextureSet |= (lastLevel << 8);
-
- switch (texObj->MagFilter)
- {
- case GL_NEAREST:
- current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- current->texture[hw_unit].hwTextureMip |= (TEXTURE_FILTER_LINEAR << 3);
- break;
- }
-
- {
- GLint b;
-
- /* The mipmap lod biasing is based on experiment. It seems there's a
- * limit of around +4/-4 to the bias value; we're being conservative.
- */
- b = (GLint) (ctx->Texture.Unit[hw_unit].LodBias * 32.0);
- if (b > 127)
- b = 127;
- else if (b < -128)
- b = -128;
-
- current->texture[hw_unit].hwTextureMip |= ((b << 4) &
- MASK_TextureMipmapLodBias);
- }
-
- switch (texObj->MinFilter)
- {
- case GL_NEAREST:
- current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST;
- break;
- case GL_LINEAR:
- current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_LINEAR;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- current->texture[hw_unit].hwTextureMip |=
- TEXTURE_FILTER_NEAREST_MIP_NEAREST;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- current->texture[hw_unit].hwTextureMip |=
- TEXTURE_FILTER_NEAREST_MIP_LINEAR;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- current->texture[hw_unit].hwTextureMip |=
- TEXTURE_FILTER_LINEAR_MIP_NEAREST;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- current->texture[hw_unit].hwTextureMip |=
- TEXTURE_FILTER_LINEAR_MIP_LINEAR;
- break;
- }
-
- switch (texObj->WrapS)
- {
- case GL_REPEAT:
- current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapU;
- break;
- case GL_CLAMP:
- current->texture[hw_unit].hwTextureSet |= MASK_TextureClampU;
- break;
- case GL_CLAMP_TO_EDGE:
- /*
- * ?? not support yet
- */
- ok = 0;
- break;
- }
-
- switch (texObj->WrapT)
- {
- case GL_REPEAT:
- current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapV;
- break;
- case GL_CLAMP:
- current->texture[hw_unit].hwTextureSet |= MASK_TextureClampV;
- break;
- case GL_CLAMP_TO_EDGE:
- /*
- * ?? not support yet
- */
- ok = 0;
- break;
- }
-
-/*
- if (current->texture[hw_unit].hwTextureSet & MASK_TextureClampU) {
- current->texture[hw_unit].hwTextureSet &= ~MASK_TextureClampU;
- current->texture[hw_unit].hwTextureSet |= MASK_TextureBorderU;
- }
-
- if (current->texture[hw_unit].hwTextureSet & MASK_TextureClampV) {
- current->texture[hw_unit].hwTextureSet &= ~MASK_TextureClampV;
- current->texture[hw_unit].hwTextureSet |= MASK_TextureBorderV;
- }
-*/
- current->texture[hw_unit].hwTextureBorderColor =
- ((GLuint) texObj->BorderColor[3] << 24) +
- ((GLuint) texObj->BorderColor[0] << 16) +
- ((GLuint) texObj->BorderColor[1] << 8) +
- ((GLuint) texObj->BorderColor[2]);
-
- if (current->texture[hw_unit].hwTextureBorderColor !=
- prev->texture[hw_unit].hwTextureBorderColor)
- {
- prev->texture[hw_unit].hwTextureBorderColor =
- current->texture[hw_unit].hwTextureBorderColor;
- if (hw_unit == 1)
- smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR_1;
- else
- smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR;
- }
-
- current->texture[hw_unit].hwTextureSet |=
- texObj->Image[0][firstLevel]->WidthLog2 << 4;
- current->texture[hw_unit].hwTextureSet |=
- texObj->Image[0][firstLevel]->HeightLog2;
-
- if (hw_unit == 0)
- smesa->GlobalFlag |= GFLAG_TEXTUREADDRESS;
- else
- smesa->GlobalFlag |= GFLAG_TEXTUREADDRESS_1;
-
- for (i = firstLevel; i <= lastLevel; i++)
- {
- GLuint texOffset = 0;
- GLuint texPitch = TransferTexturePitch( t->image[i].pitch );
-
- switch (t->image[i].memType)
- {
- case VIDEO_TYPE:
- texOffset = ((unsigned long)t->image[i].Data - (unsigned long)smesa->FbBase);
- break;
- case AGP_TYPE:
- texOffset = ((unsigned long)t->image[i].Data - (unsigned long)smesa->AGPBase) +
- (unsigned long) smesa->AGPAddr;
- current->texture[hw_unit].hwTextureMip |=
- (MASK_TextureLevel0InSystem << i);
- break;
- }
-
- switch (i)
- {
- case 0:
- prev->texture[hw_unit].texOffset0 = texOffset;
- prev->texture[hw_unit].texPitch01 = texPitch << 16;
- break;
- case 1:
- prev->texture[hw_unit].texOffset1 = texOffset;
- prev->texture[hw_unit].texPitch01 |= texPitch;
- break;
- case 2:
- prev->texture[hw_unit].texOffset2 = texOffset;
- prev->texture[hw_unit].texPitch23 = texPitch << 16;
- break;
- case 3:
- prev->texture[hw_unit].texOffset3 = texOffset;
- prev->texture[hw_unit].texPitch23 |= texPitch;
- break;
- case 4:
- prev->texture[hw_unit].texOffset4 = texOffset;
- prev->texture[hw_unit].texPitch45 = texPitch << 16;
- break;
- case 5:
- prev->texture[hw_unit].texOffset5 = texOffset;
- prev->texture[hw_unit].texPitch45 |= texPitch;
- break;
- case 6:
- prev->texture[hw_unit].texOffset6 = texOffset;
- prev->texture[hw_unit].texPitch67 = texPitch << 16;
- break;
- case 7:
- prev->texture[hw_unit].texOffset7 = texOffset;
- prev->texture[hw_unit].texPitch67 |= texPitch;
- break;
- case 8:
- prev->texture[hw_unit].texOffset8 = texOffset;
- prev->texture[hw_unit].texPitch89 = texPitch << 16;
- break;
- case 9:
- prev->texture[hw_unit].texOffset9 = texOffset;
- prev->texture[hw_unit].texPitch89 |= texPitch;
- break;
- case 10:
- prev->texture[hw_unit].texOffset10 = texOffset;
- prev->texture[hw_unit].texPitch10 = texPitch << 16;
- break;
- case 11:
- prev->texture[hw_unit].texOffset11 = texOffset;
- prev->texture[hw_unit].texPitch10 |= texPitch;
- break;
- }
- }
-
- if (current->texture[hw_unit].hwTextureSet !=
- prev->texture[hw_unit].hwTextureSet)
- {
- prev->texture[hw_unit].hwTextureSet =
- current->texture[hw_unit].hwTextureSet;
- if (hw_unit == 1)
- smesa->GlobalFlag |= CFLAG_TEXTURERESET_1;
- else
- smesa->GlobalFlag |= CFLAG_TEXTURERESET;
- }
- if (current->texture[hw_unit].hwTextureMip !=
- prev->texture[hw_unit].hwTextureMip)
- {
- prev->texture[hw_unit].hwTextureMip =
- current->texture[hw_unit].hwTextureMip;
- if (hw_unit == 1)
- smesa->GlobalFlag |= GFLAG_TEXTUREMIPMAP_1;
- else
- smesa->GlobalFlag |= GFLAG_TEXTUREMIPMAP;
- }
-
- return ok;
-}
-
-/* Disable a texture unit, called from validate_texture */
-static void
-sis_reset_texture_env (GLcontext *ctx, int hw_unit)
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- __GLSiSHardware *prev = &smesa->prev;
- __GLSiSHardware *current = &smesa->current;
-
- if (hw_unit == 1)
- {
- current->hwTexBlendColor1 = STAGE1_C_CF;
- current->hwTexBlendAlpha1 = STAGE1_A_AF;
-
- if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) ||
- (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) ||
- (current->hwTexEnvColor != prev->hwTexEnvColor))
- {
- prev->hwTexBlendColor1 = current->hwTexBlendColor1;
- prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1;
- prev->hwTexEnvColor = current->hwTexEnvColor;
- smesa->GlobalFlag |= GFLAG_TEXTUREENV_1;
- }
- } else {
- current->hwTexBlendColor0 = STAGE0_C_CF;
- current->hwTexBlendAlpha0 = STAGE0_A_AF;
-
- if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) ||
- (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) ||
- (current->hwTexEnvColor != prev->hwTexEnvColor))
- {
- prev->hwTexBlendColor0 = current->hwTexBlendColor0;
- prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0;
- prev->hwTexEnvColor = current->hwTexEnvColor;
- smesa->GlobalFlag |= GFLAG_TEXTUREENV;
- }
- }
-}
-
-static void updateTextureUnit( GLcontext *ctx, int unit )
-{
- sisContextPtr smesa = SIS_CONTEXT( ctx );
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- struct gl_texture_object *texObj = texUnit->_Current;
- GLint fallbackbit;
-
- if (unit == 0)
- fallbackbit = SIS_FALLBACK_TEXTURE0;
- else
- fallbackbit = SIS_FALLBACK_TEXTURE1;
-
- if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) {
- if (smesa->TexStates[unit] & NEW_TEXTURING) {
- GLboolean ok;
-
- ok = sis_set_texobj_parm (ctx, texObj, unit);
- FALLBACK( smesa, fallbackbit, !ok );
- }
- if (smesa->TexStates[unit] & NEW_TEXTURE_ENV) {
- if (unit == 0)
- sis_set_texture_env0( ctx, texObj, unit );
- else
- sis_set_texture_env1( ctx, texObj, unit );
- }
- smesa->TexStates[unit] = 0;
- } else if ( texUnit->_ReallyEnabled ) {
- /* fallback */
- FALLBACK( smesa, fallbackbit, 1 );
- } else {
- sis_reset_texture_env( ctx, unit );
- FALLBACK( smesa, fallbackbit, 0 );
- }
-}
-
-
-void sisUpdateTextureState( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT( ctx );
- int i;
- __GLSiSHardware *current = &smesa->current;
-
-#if 1
- /* TODO : if unmark these, error in multitexture */ /* XXX */
- for (i = 0; i < SIS_MAX_TEXTURES; i++)
- smesa->TexStates[i] |= (NEW_TEXTURING | NEW_TEXTURE_ENV);
-#endif
-
- updateTextureUnit( ctx, 0 );
- updateTextureUnit( ctx, 1 );
-
- /* XXX Issues with the 2nd unit but not the first being enabled? */
- if ( ctx->Texture.Unit[0]._ReallyEnabled &
- (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ||
- ctx->Texture.Unit[1]._ReallyEnabled &
- (TEXTURE_1D_BIT | TEXTURE_2D_BIT) )
- {
- current->hwCapEnable |= MASK_TextureEnable;
- current->hwCapEnable &= ~MASK_TextureNumUsed;
- if (ctx->Texture.Unit[1]._ReallyEnabled)
- current->hwCapEnable |= 0x00002000;
- else
- current->hwCapEnable |= 0x00001000;
- } else {
- current->hwCapEnable &= ~MASK_TextureEnable;
- }
-}
-
-static GLint
-BitScanForward( GLshort w )
-{
- GLint i;
-
- for (i = 0; i < 16; i++) {
- if (w & (1 << i))
- break;
- }
- return i;
-}
-
-static GLint
-TransferTexturePitch( GLint dwPitch )
-{
- GLint dwRet, i;
-
- i = BitScanForward( (GLshort)dwPitch );
- dwRet = dwPitch >> i;
- dwRet |= i << 9;
- return dwRet;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.c
deleted file mode 100644
index fb0fd1ac0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.c
+++ /dev/null
@@ -1,1071 +0,0 @@
-/* $XFree86*/ /* -*- c-basic-offset: 3 -*- */
-/**************************************************************************
-
-Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 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:
- * Sung-Ching Lin <sclin@sis.com.tw>
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "sis_context.h"
-#include "sis_tris.h"
-#include "sis_state.h"
-#include "sis_lock.h"
-#include "sis_span.h"
-#include "sis_alloc.h"
-#include "sis_tex.h"
-
-static const GLuint hw_prim[GL_POLYGON+1] = {
- OP_3D_POINT_DRAW, /* GL_POINTS */
- OP_3D_LINE_DRAW, /* GL_LINES */
- OP_3D_LINE_DRAW, /* GL_LINE_LOOP */
- OP_3D_LINE_DRAW, /* GL_LINE_STRIP */
- OP_3D_TRIANGLE_DRAW, /* GL_TRIANGLES */
- OP_3D_TRIANGLE_DRAW, /* GL_TRIANGLE_STRIP */
- OP_3D_TRIANGLE_DRAW, /* GL_TRIANGLE_FAN */
- OP_3D_TRIANGLE_DRAW, /* GL_QUADS */
- OP_3D_TRIANGLE_DRAW, /* GL_QUAD_STRIP */
- OP_3D_TRIANGLE_DRAW /* GL_POLYGON */
-};
-
-static const GLuint hw_prim_mmio_fire[OP_3D_TRIANGLE_DRAW+1] = {
- OP_3D_FIRE_TSARGBa,
- OP_3D_FIRE_TSARGBb,
- OP_3D_FIRE_TSARGBc
-};
-
-static const GLuint hw_prim_mmio_shade[OP_3D_TRIANGLE_DRAW+1] = {
- SHADE_FLAT_VertexA,
- SHADE_FLAT_VertexB,
- SHADE_FLAT_VertexC
-};
-
-static const GLuint hw_prim_agp_type[OP_3D_TRIANGLE_DRAW+1] = {
- MASK_PsPointList,
- MASK_PsLineList,
- MASK_PsTriangleList
-};
-
-static const GLuint hw_prim_agp_shade[OP_3D_TRIANGLE_DRAW+1] = {
- MASK_PsShadingFlatA,
- MASK_PsShadingFlatB,
- MASK_PsShadingFlatC
-};
-
-static void sisRasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void sisRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-
-#define HAVE_QUADS 0
-#define HAVE_LINES 1
-#define HAVE_POINTS 1
-#define CTX_ARG sisContextPtr smesa
-#define GET_VERTEX_DWORDS() smesa->vertex_size
-#define ALLOC_VERTS( n, size ) sisAllocDmaLow( smesa, n * size * sizeof(int) )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- sisContextPtr smesa = SIS_CONTEXT(ctx); \
- const char *vertptr = smesa->verts;
-#define VERT(x) (sisVertex *)(vertptr + (x * vertsize * sizeof(int)))
-#define VERTEX sisVertex
-#undef TAG
-#define TAG(x) sis_##x
-#include "tnl_dd/t_dd_triemit.h"
-#undef TAG
-#undef LOCAL_VARS
-
-/***********************************************************************
- * Dispatch vertices to hardware through MMIO *
- ***********************************************************************/
-
-/* The ARGB write of the last vertex of the primitive fires the 3d engine, so
- * save it until the end.
- */
-#define SIS_MMIO_WRITE_VERTEX(_v, i, lastvert) \
-do { \
- GLuint __color, __i = 0; \
- MMIO(REG_3D_TSXa+(i)*0x30, _v->ui[__i++]); \
- MMIO(REG_3D_TSYa+(i)*0x30, _v->ui[__i++]); \
- MMIO(REG_3D_TSZa+(i)*0x30, _v->ui[__i++]); \
- if (SIS_STATES & VERT_W) \
- MMIO(REG_3D_TSWGa+(i)*0x30, _v->ui[__i++]); \
- __color = _v->ui[__i++]; \
- if (SIS_STATES & VERT_SPEC) \
- MMIO(REG_3D_TSFSa+(i)*0x30, _v->ui[__i++]); \
- if (SIS_STATES & VERT_UV0) { \
- MMIO(REG_3D_TSUAa+(i)*0x30, _v->ui[__i++]); \
- MMIO(REG_3D_TSVAa+(i)*0x30, _v->ui[__i++]); \
- } \
- if (SIS_STATES & VERT_UV1) { \
- MMIO(REG_3D_TSUBa+(i)*0x30, _v->ui[__i++]); \
- MMIO(REG_3D_TSVBa+(i)*0x30, _v->ui[__i++]); \
- } \
- if (lastvert || (SIS_STATES & VERT_SMOOTH)) \
- MMIO(REG_3D_TSARGBa+(i)*0x30, __color); \
-} while (0)
-
-#define MMIO_VERT_REG_COUNT 10
-
-#define VERT_SMOOTH 0x01
-#define VERT_W 0x02
-#define VERT_SPEC 0x04
-#define VERT_UV0 0x08
-#define VERT_UV1 0x10
-
-typedef void (*mmio_draw_func)(sisContextPtr smesa, char *verts);
-static mmio_draw_func sis_tri_func_mmio[32];
-static mmio_draw_func sis_line_func_mmio[32];
-static mmio_draw_func sis_point_func_mmio[32];
-
-#define SIS_STATES (0)
-#define TAG(x) x##_none
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH)
-#define TAG(x) x##_g
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W)
-#define TAG(x) x##_w
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W)
-#define TAG(x) x##_gw
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SPEC)
-#define TAG(x) x##_s
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_SPEC)
-#define TAG(x) x##_gs
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_SPEC)
-#define TAG(x) x##_ws
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_SPEC)
-#define TAG(x) x##_gws
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_UV0)
-#define TAG(x) x##_t0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_UV0)
-#define TAG(x) x##_gt0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_UV0)
-#define TAG(x) x##_wt0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_UV0)
-#define TAG(x) x##_gwt0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SPEC | VERT_UV0)
-#define TAG(x) x##_st0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_SPEC | VERT_UV0)
-#define TAG(x) x##_gst0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_SPEC | VERT_UV0)
-#define TAG(x) x##_wst0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_SPEC | VERT_UV0)
-#define TAG(x) x##_gwst0
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_UV1)
-#define TAG(x) x##_t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_UV1)
-#define TAG(x) x##_gt1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_UV1)
-#define TAG(x) x##_wt1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_UV1)
-#define TAG(x) x##_gwt1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SPEC | VERT_UV1)
-#define TAG(x) x##_st1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_SPEC | VERT_UV1)
-#define TAG(x) x##_gst1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_SPEC | VERT_UV1)
-#define TAG(x) x##_wst1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_SPEC | VERT_UV1)
-#define TAG(x) x##_gwst1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_t0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_gt0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_wt0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_gwt0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SPEC | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_st0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_SPEC | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_gst0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_W | VERT_SPEC | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_wst0t1
-#include "sis_tritmp.h"
-
-#define SIS_STATES (VERT_SMOOTH | VERT_W | VERT_SPEC | VERT_UV0 | VERT_UV1)
-#define TAG(x) x##_gwst0t1
-#include "sis_tritmp.h"
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- smesa->draw_tri( smesa, a, b, c ); \
- else \
- sis_triangle( smesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- smesa->draw_tri( smesa, a, b, d ); \
- smesa->draw_tri( smesa, b, c, d ); \
- } else \
- sis_quad( smesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- smesa->draw_line( smesa, v0, v1 ); \
- else \
- sis_line( smesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- smesa->draw_point( smesa, v0 ); \
- else \
- sis_point( smesa, v0 ); \
-} while (0)
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define SIS_OFFSET_BIT 0x01
-#define SIS_TWOSIDE_BIT 0x02
-#define SIS_UNFILLED_BIT 0x04
-#define SIS_FALLBACK_BIT 0x08
-#define SIS_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[SIS_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & SIS_FALLBACK_BIT)
-#define DO_OFFSET (IND & SIS_OFFSET_BIT)
-#define DO_UNFILLED (IND & SIS_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & SIS_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX sisVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE smesa->depth_scale
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (smesa->verts + (e * smesa->vertex_size * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- sis_color_t *color = (sis_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v0, c ) \
-do { \
- if (havespec) { \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (havespec) { \
- v0->v.specular.red = v1->v.specular.red; \
- v0->v.specular.green = v1->v.specular.green; \
- v0->v.specular.blue = v1->v.specular.blue; \
- } \
-} while (0)
-
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
-
-#define LOCAL_VARS(n) \
- sisContextPtr smesa = SIS_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = (smesa->vertex_size == 4 ? 3 : 4); \
- GLboolean havespec = (smesa->vertex_size == 4 ? 0 : 1); \
- (void) color; (void) spec; (void) coloroffset; (void) havespec;
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (smesa->hw_primitive != hw_prim[x]) \
- sisRasterPrimitive( ctx, hw_prim[x] )
-#define RENDER_PRIMITIVE smesa->render_primitive
-#define IND SIS_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_OFFSET_BIT|SIS_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_OFFSET_BIT|SIS_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_OFFSET_BIT|SIS_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_OFFSET_BIT|SIS_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_UNFILLED_BIT|SIS_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_OFFSET_BIT|SIS_UNFILLED_BIT|SIS_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_UNFILLED_BIT|SIS_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (SIS_TWOSIDE_BIT|SIS_OFFSET_BIT|SIS_UNFILLED_BIT| \
- SIS_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-
-static void
-sis_fallback_tri( sisContextPtr smesa,
- sisVertex *v0,
- sisVertex *v1,
- sisVertex *v2 )
-{
- GLcontext *ctx = smesa->glCtx;
- SWvertex v[3];
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- _swsetup_Translate( ctx, v2, &v[2] );
- sisSpanRenderStart( ctx );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
- sisSpanRenderFinish( ctx );
- _swrast_flush( ctx );
-}
-
-
-static void
-sis_fallback_line( sisContextPtr smesa,
- sisVertex *v0,
- sisVertex *v1 )
-{
- GLcontext *ctx = smesa->glCtx;
- SWvertex v[2];
- _swsetup_Translate( ctx, v0, &v[0] );
- _swsetup_Translate( ctx, v1, &v[1] );
- sisSpanRenderStart( ctx );
- _swrast_Line( ctx, &v[0], &v[1] );
- sisSpanRenderFinish( ctx );
- _swrast_flush( ctx );
-}
-
-
-static void
-sis_fallback_point( sisContextPtr smesa,
- sisVertex *v0 )
-{
- GLcontext *ctx = smesa->glCtx;
- SWvertex v[1];
- _swsetup_Translate( ctx, v0, &v[0] );
- sisSpanRenderStart( ctx );
- _swrast_Point( ctx, &v[0] );
- sisSpanRenderFinish( ctx );
- _swrast_flush( ctx );
-}
-
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define IND 0
-#define V(x) (sisVertex *)(vertptr + (x * vertsize * sizeof(int)))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- POINT( V(ELT(start)) )
-#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) )
-#define RENDER_TRI( v0, v1, v2 ) TRI( V(v0), V(v1), V(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) QUAD( V(v0), V(v1), V(v2), V(v3) )
-#define INIT(x) sisRenderPrimitive( ctx, x )
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- sisContextPtr smesa = SIS_CONTEXT(ctx); \
- const GLuint vertsize = smesa->vertex_size; \
- const char *vertptr = (char *)smesa->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) sis_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) sis_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH)
-#define TRI_FALLBACK (DD_TRI_STIPPLE|DD_TRI_SMOOTH)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-#define _SIS_NEW_RENDER_STATE (ANY_RASTER_FLAGS | ANY_FALLBACK_FLAGS)
-
-static void sisChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- sisContextPtr smesa = SIS_CONTEXT( ctx );
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) {
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= SIS_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= SIS_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= SIS_UNFILLED_BIT;
- }
-
- smesa->draw_point = sis_point;
- smesa->draw_line = sis_line;
- smesa->draw_tri = sis_triangle;
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & ANY_FALLBACK_FLAGS) {
- if (flags & POINT_FALLBACK)
- smesa->draw_point = sis_fallback_point;
- if (flags & LINE_FALLBACK)
- smesa->draw_line = sis_fallback_line;
- if (flags & TRI_FALLBACK)
- smesa->draw_tri = sis_fallback_tri;
- index |= SIS_FALLBACK_BIT;
- }
- }
-
- if (index != smesa->RenderIndex) {
- smesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = sis_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = sis_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = sis_fast_clipped_poly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- }
- }
-}
-
-/**********************************************************************/
-/* Multipass rendering for front buffering */
-/**********************************************************************/
-static GLboolean multipass_cliprect( GLcontext *ctx, GLuint pass )
-{
- sisContextPtr smesa = SIS_CONTEXT( ctx );
-
- if (pass >= smesa->driDrawable->numClipRects) {
- return GL_FALSE;
- } else {
- GLint x1, y1, x2, y2;
-
- x1 = smesa->driDrawable->pClipRects[pass].x1 - smesa->driDrawable->x;
- y1 = smesa->driDrawable->pClipRects[pass].y1 - smesa->driDrawable->y;
- x2 = smesa->driDrawable->pClipRects[pass].x2 - smesa->driDrawable->x;
- y2 = smesa->driDrawable->pClipRects[pass].y2 - smesa->driDrawable->y;
-
- if (ctx->Scissor.Enabled) {
- GLint scisy1 = Y_FLIP(ctx->Scissor.Y + ctx->Scissor.Height - 1);
- GLint scisy2 = Y_FLIP(ctx->Scissor.Y);
-
- if (ctx->Scissor.X > x1)
- x1 = ctx->Scissor.X;
- if (scisy1 > y1)
- y1 = scisy1;
- if (ctx->Scissor.X + ctx->Scissor.Width - 1 < x2)
- x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
- if (scisy2 < y2)
- y2 = scisy2;
- }
-
- MMIO(REG_3D_ClipTopBottom, y1 << 13 | y2);
- MMIO(REG_3D_ClipLeftRight, x1 << 13 | x2);
- /* Mark that we clobbered these registers */
- smesa->GlobalFlag |= GFLAG_CLIPPING;
- return GL_TRUE;
- }
-}
-
-
-
-/**********************************************************************/
-/* Validate state at pipeline start */
-/**********************************************************************/
-
-static void sisRunPipeline( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT( ctx );
-
- if (!smesa->Fallback && smesa->NewGLState) {
- if (smesa->NewGLState & _NEW_TEXTURE) {
- SIS_FIREVERTICES(smesa);
- sisUpdateTextureState(ctx);
- }
-
- if (smesa->NewGLState & _SIS_NEW_RENDER_STATE)
- sisChooseRenderState( ctx );
-
- smesa->NewGLState = 0;
- }
-
- _tnl_run_pipeline( ctx );
-
- /* XXX: If we put flushing in sis_state.c and friends, we can avoid this.
- * Is it worth it?
- */
- SIS_FIREVERTICES(smesa);
-}
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-/* This is called when Mesa switches between rendering triangle
- * primitives (such as GL_POLYGON, GL_QUADS, GL_TRIANGLE_STRIP, etc),
- * and lines, points and bitmaps.
- */
-
-static void sisRasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- if (smesa->hw_primitive != hwprim) {
- SIS_FIREVERTICES(smesa);
- smesa->hw_primitive = hwprim;
- smesa->AGPParseSet &= ~(MASK_PsDataType | MASK_PsShadingMode);
- smesa->dwPrimitiveSet &= ~(MASK_DrawPrimitiveCommand |
- MASK_SetFirePosition | MASK_ShadingMode);
- smesa->AGPParseSet |= hw_prim_agp_type[hwprim];
- smesa->dwPrimitiveSet |= hwprim | hw_prim_mmio_fire[hwprim];
- if (ctx->Light.ShadeModel == GL_FLAT) {
- smesa->AGPParseSet |= hw_prim_agp_shade[hwprim];
- smesa->dwPrimitiveSet |= hw_prim_mmio_shade[hwprim];
- } else {
- smesa->AGPParseSet |= MASK_PsShadingSmooth;
- smesa->dwPrimitiveSet |= SHADE_GOURAUD;
- }
- }
-}
-
-static void sisRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
-
- smesa->render_primitive = prim;
-
- if (prim >= GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
- sisRasterPrimitive( ctx, hw_prim[prim] );
-}
-
-#define EMIT_ATTR( ATTR, STYLE) \
-do { \
- smesa->vertex_attrs[smesa->vertex_attr_count].attrib = (ATTR); \
- smesa->vertex_attrs[smesa->vertex_attr_count].format = (STYLE); \
- smesa->vertex_attr_count++; \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- smesa->vertex_attrs[smesa->vertex_attr_count].attrib = 0; \
- smesa->vertex_attrs[smesa->vertex_attr_count].format = EMIT_PAD; \
- smesa->vertex_attrs[smesa->vertex_attr_count].offset = (N); \
- smesa->vertex_attr_count++; \
-} while (0)
-
-#define SIS_TCL_STATE_BITS \
- (_TNL_BITS_TEX_ANY | _TNL_BIT_COLOR1 | _TNL_BIT_FOG)
-
-static void sisRenderStart( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLuint AGPParseSet = smesa->AGPParseSet;
- GLboolean tex_fallback = GL_FALSE;
-
- if (ctx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT &&
- smesa->driDrawable->numClipRects != 0)
- {
- multipass_cliprect(ctx, 0);
- if (smesa->driDrawable->numClipRects > 1)
- tnl->Driver.Render.Multipass = multipass_cliprect;
- else
- tnl->Driver.Render.Multipass = NULL;
- } else {
- tnl->Driver.Render.Multipass = NULL;
- }
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
- smesa->vertex_attr_count = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to build up a
- * hardware vertex.
- */
-
- AGPParseSet &= ~(MASK_VertexDWSize | MASK_VertexDataFormat);
- AGPParseSet |= SiS_PS_HAS_XYZ | SiS_PS_HAS_DIFFUSE;
- if (index & _TNL_BITS_TEX_ANY) {
- EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT);
- AGPParseSet |= SiS_PS_HAS_W;
- } else {
- EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT);
- }
-
- EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA);
-
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
- AGPParseSet |= SiS_PS_HAS_SPECULAR;
-
- if (index & _TNL_BIT_COLOR1) {
- EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR);
- } else {
- EMIT_PAD(3);
- }
-
- if (index & _TNL_BIT_FOG)
- EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1UB_1F);
- else
- EMIT_PAD(1);
- }
-
- /* projective textures are not supported by the hardware */
- if (index & _TNL_BIT_TEX(0)) {
- if (VB->TexCoordPtr[0]->size > 2)
- tex_fallback = GL_TRUE;
- EMIT_ATTR(_TNL_ATTRIB_TEX0, EMIT_2F);
- AGPParseSet |= SiS_PS_HAS_UV0;
- }
- if (index & _TNL_BIT_TEX(1)) {
- if (VB->TexCoordPtr[1]->size > 2)
- tex_fallback = GL_TRUE;
- EMIT_ATTR(_TNL_ATTRIB_TEX1, EMIT_2F);
- AGPParseSet |= SiS_PS_HAS_UV1;
- }
- FALLBACK(smesa, SIS_FALLBACK_TEXTURE, tex_fallback);
-
- if (smesa->last_tcl_state != index) {
- smesa->AGPParseSet = AGPParseSet;
-
- smesa->vertex_size = _tnl_install_attrs( ctx, smesa->vertex_attrs,
- smesa->vertex_attr_count, smesa->hw_viewport, 0 );
-
- smesa->vertex_size >>= 2;
- smesa->AGPParseSet |= smesa->vertex_size << 28;
- }
-}
-
-static void sisRenderFinish( GLcontext *ctx )
-{
-}
-
-/**********************************************************************/
-/* AGP/PCI vertex submission */
-/**********************************************************************/
-
-void
-sisFlushPrimsLocked(sisContextPtr smesa)
-{
- if (smesa->vb_cur == smesa->vb_last)
- return;
-
- sisUpdateHWState(smesa->glCtx);
-
- if (smesa->using_agp) {
- mWait3DCmdQueue(8);
- mEndPrimitive();
- MMIO(REG_3D_AGPCmBase, (smesa->vb_last - smesa->vb) +
- smesa->vb_agp_offset);
- MMIO(REG_3D_AGPTtDwNum, ((smesa->vb_cur - smesa->vb_last) / 4) |
- 0x50000000);
- MMIO(REG_3D_ParsingSet, smesa->AGPParseSet);
- MMIO(REG_3D_AGPCmFire, (GLint)(-1));
- mEndPrimitive();
- } else {
- int mmio_index = 0, incr = 0;
- void (*sis_emit_func)(sisContextPtr smesa, char *verts) = NULL;
-
- if (smesa->AGPParseSet & MASK_PsShadingSmooth)
- mmio_index |= VERT_SMOOTH;
- if (smesa->AGPParseSet & SiS_PS_HAS_SPECULAR)
- mmio_index |= VERT_SPEC;
- if (smesa->AGPParseSet & SiS_PS_HAS_W)
- mmio_index |= VERT_W;
- if (smesa->AGPParseSet & SiS_PS_HAS_UV0)
- mmio_index |= VERT_UV0;
- if (smesa->AGPParseSet & SiS_PS_HAS_UV1)
- mmio_index |= VERT_UV1;
-
- switch (smesa->AGPParseSet & MASK_PsDataType) {
- case MASK_PsPointList:
- incr = smesa->vertex_size * 4;
- sis_emit_func = sis_point_func_mmio[mmio_index];
- break;
- case MASK_PsLineList:
- incr = smesa->vertex_size * 4 * 2;
- sis_emit_func = sis_line_func_mmio[mmio_index];
- break;
- case MASK_PsTriangleList:
- incr = smesa->vertex_size * 4 * 3;
- sis_emit_func = sis_tri_func_mmio[mmio_index];
- break;
- }
-
- mWait3DCmdQueue(1);
- MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet);
- while (smesa->vb_last < smesa->vb_cur) {
- sis_emit_func(smesa, smesa->vb_last);
- smesa->vb_last += incr;
- }
- mWait3DCmdQueue(1);
- mEndPrimitive();
-
- /* With PCI, we can just start writing to the start of the VB again. */
- smesa->vb_cur = smesa->vb;
- }
- smesa->vb_last = smesa->vb_cur;
-}
-
-void sisFlushPrims(sisContextPtr smesa)
-{
- LOCK_HARDWARE();
- sisFlushPrimsLocked(smesa);
- UNLOCK_HARDWARE();
-}
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- GLuint oldfallback = smesa->Fallback;
-
- if (mode) {
- smesa->Fallback |= bit;
- if (oldfallback == 0) {
- SIS_FIREVERTICES(smesa);
- _swsetup_Wakeup( ctx );
- smesa->RenderIndex = ~0;
- }
- }
- else {
- smesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = sisRenderStart;
- tnl->Driver.Render.PrimitiveNotify = sisRenderPrimitive;
- tnl->Driver.Render.Finish = sisRenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_invalidate_vertex_state( ctx, ~0 );
- _tnl_invalidate_vertices( ctx, ~0 );
- _tnl_install_attrs( ctx,
- smesa->vertex_attrs,
- smesa->vertex_attr_count,
- smesa->hw_viewport, 0 );
-
- smesa->NewGLState |= _SIS_NEW_RENDER_STATE;
- }
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-void sisInitTriFuncs( GLcontext *ctx )
-{
- sisContextPtr smesa = SIS_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
-
- sis_vert_init_none();
- sis_vert_init_g();
- sis_vert_init_w();
- sis_vert_init_gw();
- sis_vert_init_s();
- sis_vert_init_gs();
- sis_vert_init_ws();
- sis_vert_init_gws();
- sis_vert_init_t0();
- sis_vert_init_gt0();
- sis_vert_init_wt0();
- sis_vert_init_gwt0();
- sis_vert_init_st0();
- sis_vert_init_gst0();
- sis_vert_init_wst0();
- sis_vert_init_gwst0();
- sis_vert_init_t1();
- sis_vert_init_gt1();
- sis_vert_init_wt1();
- sis_vert_init_gwt1();
- sis_vert_init_st1();
- sis_vert_init_gst1();
- sis_vert_init_wst1();
- sis_vert_init_gwst1();
- sis_vert_init_t0t1();
- sis_vert_init_gt0t1();
- sis_vert_init_wt0t1();
- sis_vert_init_gwt0t1();
- sis_vert_init_st0t1();
- sis_vert_init_gst0t1();
- sis_vert_init_wst0t1();
- sis_vert_init_gwst0t1();
- }
-
- if (driQueryOptionb(&smesa->optionCache, "fallback_force"))
- sisFallback(ctx, SIS_FALLBACK_FORCE, 1);
- else
- sisFallback(ctx, SIS_FALLBACK_FORCE, 0);
-
- smesa->RenderIndex = ~0;
- smesa->NewGLState |= _SIS_NEW_RENDER_STATE;
-
- tnl->Driver.RunPipeline = sisRunPipeline;
- tnl->Driver.Render.Start = sisRenderStart;
- tnl->Driver.Render.Finish = sisRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = sisRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- (6 + 2*ctx->Const.MaxTextureUnits) * sizeof(GLfloat) );
-
- smesa->verts = (char *)tnl->clipspace.vertex_buf;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.h
deleted file mode 100644
index 5e07acc21..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tris.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.8 2002/10/30 12:51:43 alanh Exp $ */
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-#ifndef __SIS_TRIS_H__
-#define __SIS_TRIS_H__
-
-#include "sis_lock.h"
-#include "mtypes.h"
-
-extern void sisInitTriFuncs( GLcontext *ctx );
-extern void sisFlushPrims( sisContextPtr smesa );
-extern void sisFlushPrimsLocked( sisContextPtr smesa );
-extern void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-
-#define FALLBACK( smesa, bit, mode ) sisFallback( smesa->glCtx, bit, mode )
-
-#define SIS_FIREVERTICES(smesa) \
-do { \
- if (smesa->vb_cur != smesa->vb_last) \
- sisFlushPrims(smesa); \
-} while (0)
-
-static __inline GLuint *sisAllocDmaLow(sisContextPtr smesa, int bytes)
-{
- GLuint *start;
-
- if (smesa->vb_cur + bytes >= smesa->vb_end) {
- LOCK_HARDWARE();
- sisFlushPrimsLocked(smesa);
- if (smesa->using_agp) {
- WaitEngIdle(smesa);
- smesa->vb_cur = smesa->vb;
- smesa->vb_last = smesa->vb_cur;
- }
- UNLOCK_HARDWARE();
- }
-
- start = (GLuint *)smesa->vb_cur;
- smesa->vb_cur += bytes;
- return start;
-}
-
-#endif /* __SIS_TRIS_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tritmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tritmp.h
deleted file mode 100644
index bd2ecd1c4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/sis/sis_tritmp.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $XFree86*/ /* -*- c-basic-offset: 3 -*- */
-/**************************************************************************
-
-Copyright 2003 Eric Anholt
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to 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
-ERIC ANHOLT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Eric Anholt <anholt@FreeBSD.org>
- */
-
-static void TAG(sis_draw_tri_mmio)(sisContextPtr smesa, char *verts)
-{
- sisVertexPtr v0 = (sisVertexPtr)verts;
- sisVertexPtr v1 = (sisVertexPtr)(verts + smesa->vertex_size * 4);
- sisVertexPtr v2 = (sisVertexPtr)(verts + smesa->vertex_size * 4 * 2);
-
- mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 3);
- SIS_MMIO_WRITE_VERTEX(v0, 0, 0);
- SIS_MMIO_WRITE_VERTEX(v1, 1, 0);
- SIS_MMIO_WRITE_VERTEX(v2, 2, 1);
-}
-
-static void TAG(sis_draw_line_mmio)(sisContextPtr smesa, char *verts)
-{
- sisVertexPtr v0 = (sisVertexPtr)verts;
- sisVertexPtr v1 = (sisVertexPtr)(verts + smesa->vertex_size * 4);
-
- mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 2);
- SIS_MMIO_WRITE_VERTEX(v0, 0, 0);
- SIS_MMIO_WRITE_VERTEX(v1, 1, 1);
-}
-
-static void TAG(sis_draw_point_mmio)(sisContextPtr smesa, char *verts)
-{
- sisVertexPtr v0 = (sisVertexPtr)verts;
-
- mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 1);
- SIS_MMIO_WRITE_VERTEX(v0, 1, 1);
-}
-
-static __inline void TAG(sis_vert_init)( void )
-{
- sis_tri_func_mmio[SIS_STATES] = TAG(sis_draw_tri_mmio);
- sis_line_func_mmio[SIS_STATES] = TAG(sis_draw_line_mmio);
- sis_point_func_mmio[SIS_STATES] = TAG(sis_draw_point_mmio);
-}
-
-#undef TAG
-#undef SIS_STATES
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/BUGS b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/BUGS
deleted file mode 100644
index b15f6a91e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/BUGS
+++ /dev/null
@@ -1,64 +0,0 @@
-REMOVE THIS FILE BEFORE MERGING WITH TRUNK
-------------------------------------------
-
-OUTSTANDING BUGS
-
-demos/reflect - reading back Z on Voodoo3, image offset to right
- Fixed in latest Glide.
-
-Q3 - some polygons drawn as vertical strips, similar to bug that was
- seen in demos/fire. Voodoo3 only. May be related to glDepthMask
- or glColorMask.
-
-book/fog - not fogging
- Fog in orthograph mode still not implemented. Checking with
- 3dfx engineers for ideas.
-
-Q3 demo crashes after changing display settings
- but the full Q3 game version seems OK.
-
-
-
-MORE OUTSTANDING BUGS
-
-private context was NULL! causing immediate failure of any glx prog. cant
-reproduce after restarting the X server. putting it down as halluc.
-
-texture object image was NULL, causing segmentation failure. happens with
-prboom. ive put a check in tdfx_texstate.c but this isn't a fix.
-
-prboom, wall textures near first chainsaw aren't bound properly. sideways
-movements causes the wall textures to move with you. prboom busted?
-
-16bpp mode, quake3, windowed, q3dm1, floor under rocketlauncher bands. it
-looks like multitexturing gone wrong. i'll disable a tmu and test.
-
-sof, polygons appear at wrong x,y,z positions, intermittent, have not yet
-found reliable way of reproducing. culling? sometimes polys disappear.
-
-descent3 is all black in 16bpp mode - FIXED (palette problems)
-
-smeared pixels in quake3 - FIXED (texture memory overlapped FB)
-
-
-
-PERFORMANCE COMPARISON (Brian / Alan)
-
- V3/16 is Voodoo3 in 16bpp on a P3/500
- V5/16 is Voodoo5 in 16bpp on a P3/600
- V5/32 is Voodoo5 in 32bpp on a P3/600
- V5A/16 is Voodoo5 in 16bpp on an Alpha AXP/600
- V5A/32 is Voodoo5 in 32bpp on an Alpha AXP/600
-
- tdfx-2-1-branch tdfx-3-0-0-branch
-demo V3/16 V5/16 V5/32 V3/16 V5/16 V5/32 V5A/16 V5A/32
-------------------------------------------------------------------------
-gloss 257 183 174 320 308 177 313 167
-fire 42 39 52 41
-fire (no help) 98 80 50 106 113 73 124 80
-tunnel 61 50 70 58
-tunnel (no help) 167 142 57 138 152 113 171 122
-gears 663 554 540 881 1232 776 1484 830
-teapot 20 21 37 36
-teapot (no help) 22 14 14 24 30 30 43 42
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/Makefile
deleted file mode 100644
index 092c580fe..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-# src/mesa/drivers/dri/tdfx/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = tdfx_dri.so
-
-# not yet
-# MINIGLX_SOURCES = server/tdfx_dri.c
-
-DRIVER_SOURCES = \
- tdfx_context.c \
- tdfx_dd.c \
- tdfx_lock.c \
- tdfx_pixels.c \
- tdfx_render.c \
- tdfx_screen.c \
- tdfx_span.c \
- tdfx_state.c \
- tdfx_tex.c \
- tdfx_texman.c \
- tdfx_texstate.c \
- tdfx_tris.c \
- tdfx_vb.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S
deleted file mode 100644
index 0f4cc4508..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S
+++ /dev/null
@@ -1,84 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/X86/fx_3dnow_fastpath.S,v 1.2 2000/09/26 15:56:51 tsi Exp $ */
-
-#include "../../X86/assyntax.h"
-
-#define SETUP_RGBA 0x1
-#define SETUP_TMU0 0x2
-#define SETUP_TMU1 0x4
-
-
-/* Pack either rgba or texture into the remaining half of a 32 byte vertex.
- */
-#define CLIP_R 24
-#define CLIP_G 16
-#define CLIP_B 20
-#define CLIP_A 28 /* defined inf fxdrv.h */
-
-#define CLIP_S0 16
-#define CLIP_T0 20
-#define CLIP_S1 24
-#define CLIP_T1 28
-
-#define SIZE 4
-#define TYPE (0)
-#define TAG(x) x
-#include "fx_3dnow_fasttmp.h"
-
-#define SIZE 8
-#define TYPE (SETUP_RGBA)
-#define TAG(x) x##_RGBA
-#include "fx_3dnow_fasttmp.h"
-
-#define SIZE 6
-#define TYPE (SETUP_TMU0)
-#define TAG(x) x##_TMU0
-#include "fx_3dnow_fasttmp.h"
-
-#define SIZE 8
-#define TYPE (SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_TMU0_TMU1
-#include "fx_3dnow_fasttmp.h"
-
-#undef CLIP_S1
-#undef CLIP_T1
-#define CLIP_S1 16
-#define CLIP_T1 20
-
-#define SIZE 6
-#define TYPE (SETUP_TMU1)
-#define TAG(x) x##_TMU1
-#include "fx_3dnow_fasttmp.h"
-
-/* These three need to use a full 64 byte clip-space vertex.
- */
-#undef CLIP_S0
-#undef CLIP_T0
-#undef CLIP_S1
-#undef CLIP_T1
-
-#define CLIP_S0 32
-#define CLIP_T0 36
-#define CLIP_S1 40
-#define CLIP_T1 44
-
-#define SIZE 10
-#define TYPE (SETUP_RGBA|SETUP_TMU0)
-#define TAG(x) x##_RGBA_TMU0
-#include "fx_3dnow_fasttmp.h"
-
-#define SIZE 12
-#define TYPE (SETUP_RGBA|SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_RGBA_TMU0_TMU1
-#include "fx_3dnow_fasttmp.h"
-
-#undef CLIP_S1
-#undef CLIP_T1
-#define CLIP_S1 32
-#define CLIP_T1 36
-
-#define SIZE 10
-#define TYPE (SETUP_RGBA|SETUP_TMU1)
-#define TAG(x) x##_RGBA_TMU1
-#include "fx_3dnow_fasttmp.h"
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h
deleted file mode 100644
index 9ec4935d7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h
+++ /dev/null
@@ -1,314 +0,0 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/X86/fx_3dnow_fasttmp.h,v 1.2 2000/09/26 15:56:51 tsi Exp $ */
-
-#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER)
-#define TAGLLBL(a) TAG(.L##a)
-#else
-#define TAGLLBL(a) TAG(a)
-#endif
-
-#if !GLIDE3
-
-#define GR_VERTEX_X_OFFSET 0
-#define GR_VERTEX_Y_OFFSET 4
-#define GR_VERTEX_Z_OFFSET 8
-#define GR_VERTEX_R_OFFSET 12
-#define GR_VERTEX_G_OFFSET 16
-#define GR_VERTEX_B_OFFSET 20
-#define GR_VERTEX_OOZ_OFFSET 24
-#define GR_VERTEX_A_OFFSET 28
-#define GR_VERTEX_OOW_OFFSET 32
-
-#else /* GLIDE3 */
-
-#define GR_VERTEX_X_OFFSET 0
-#define GR_VERTEX_Y_OFFSET 4
-#define GR_VERTEX_OOZ_OFFSET 8
-#define GR_VERTEX_OOW_OFFSET 12
-#define GR_VERTEX_R_OFFSET 16
-#define GR_VERTEX_G_OFFSET 20
-#define GR_VERTEX_B_OFFSET 24
-#define GR_VERTEX_A_OFFSET 28
-#define GR_VERTEX_Z_OFFSET 32
-
-#endif /* GLIDE3 */
-
-#define GR_VERTEX_SOW_TMU0_OFFSET 36
-#define GR_VERTEX_TOW_TMU0_OFFSET 40
-#define GR_VERTEX_OOW_TMU0_OFFSET 44
-#define GR_VERTEX_SOW_TMU1_OFFSET 48
-#define GR_VERTEX_TOW_TMU1_OFFSET 52
-#define GR_VERTEX_OOW_TMU1_OFFSET 56
-
-
-
-
-/*#define MAT_SX 0 /* accessed by REGIND !! */
-#define MAT_SY 20
-#define MAT_SZ 40
-#define MAT_TX 48
-#define MAT_TY 52
-#define MAT_TZ 56
-
-
-
-
-/* Do viewport map, device scale and perspective projection.
- *
- * void project_verts( GLfloat *first,
- * GLfloat *last,
- * const GLfloat *m,
- * GLuint stride )
- *
- *
- * Rearrange fxVertices to look like grVertices.
- */
-
-GLOBL GLNAME( TAG(fx_3dnow_project_vertices) )
-GLNAME( TAG(fx_3dnow_project_vertices) ):
-
- PUSH_L ( EBP )
-
- MOV_L ( REGOFF(8, ESP), ECX ) /* first_vert */
- MOV_L ( REGOFF(12, ESP), EDX ) /* last_vert */
-
- CMP_L ( ECX, EDX )
- JE ( TAGLLBL(FXPV_end) )
-
- FEMMS
-
- PREFETCH ( REGIND(ECX) ) /* fetch the first vertex */
-
- MOV_L ( REGOFF(16, ESP), EBP ) /* matrix */
- MOV_L ( REGOFF(20, ESP), EAX ) /* stride */
-
- MOVD ( REGOFF(MAT_TX, EBP), MM6 ) /* | tx */
- PUNPCKLDQ ( REGOFF(MAT_TY, EBP), MM6 ) /* ty | tx */
-
-#if !defined(FX_V2)
- MOV_L ( CONST(0x49400000), REGOFF(-8, ESP) ) /* snapper */
- MOV_L ( CONST(0x49400000), REGOFF(-4, ESP) ) /* snapper */
-#endif
-
- MOVQ ( REGOFF(-8, ESP), MM4 ) /* snapper | snapper */
- PFADD ( MM4, MM6 ) /* ty+snapper | tx+snapper */
-
- MOVD ( REGIND(EBP), MM5 )
- PUNPCKLDQ ( REGOFF(MAT_SY, EBP), MM5 ) /* vsy | vsx */
-
- MOVD ( REGOFF(MAT_SZ, EBP), MM1 ) /* | vsz */
-
-
-ALIGNTEXT32
-TAGLLBL(FXPV_loop_start):
-
- PREFETCH ( REGOFF(64, ECX) ) /* fetch the next-ish vertex */
-
-
- MOVD ( REGOFF(12, ECX), MM0 ) /* | f[3] */
- PFRCP ( MM0, MM0 ) /* oow = 1/f[3] */
-
- MOVD ( REGOFF(12, ECX), MM7 ) /* | f[3] */
- PFRCPIT1 ( MM0, MM7 )
- PFRCPIT2 ( MM0, MM7 ) /* oow | oow */
-
- PUNPCKLDQ ( MM7, MM7 )
-
-
-#if (TYPE & SETUP_RGBA)
- MOVD ( REGOFF(CLIP_R, ECX ), MM0 ) /* f[RCOORD] = f[CLIP_R]; */
- MOVD ( MM0, REGOFF(GR_VERTEX_R_OFFSET, ECX) )
-#endif
-
-#if (TYPE & SETUP_TMU1)
- MOVQ ( REGOFF(CLIP_S1, ECX), MM0 ) /* f[S1COORD] = f[CLIP_S1] * oow */
- PFMUL ( MM7, MM0 ) /* f[T1COORD] = f[CLIP_T1] * oow */
- MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU1_OFFSET, ECX) )
-#endif
-
-
-#if (TYPE & SETUP_TMU0)
- MOVQ ( REGOFF(CLIP_S0, ECX), MM0 ) /* f[S0COORD] = f[CLIP_S0] * oow */
- PFMUL ( MM7, MM0 ) /* f[T0COORD] = f[CLIP_T0] * oow */
- MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU0_OFFSET, ECX) )
-#endif
-
-
-
-
-
-/* DO_SETUP_XYZ */
-
- MOVQ ( REGIND(ECX), MM2 ) /* f[1] | f[0] */
- PFMUL ( MM7, MM2 ) /* f[1] * oow | f[0] * oow */
-
- MOVD ( REGOFF(8, ECX), MM3 ) /* | f[2] */
- PFMUL ( MM7, MM3 ) /* | f[2] * oow */
-
- MOVD ( REGOFF(MAT_TZ, EBP), MM0 ) /* | vtz */
- PFMUL ( MM1, MM3 ) /* | f[2] *= vsz */
-
- PFADD ( MM0, MM3 ) /* | f[2] += vtz */
- PFMUL ( MM5, MM2 ) /* f[1] *= vsy | f[0] *= vsx */
-
- PFADD ( MM6, MM2 ) /* f[1] += vty | f[0] += vtx */
-
-#if !defined(FX_V2)
- PFSUB ( MM4, MM2 ) /* f[0,1] -= snapper */
-#endif
-
- MOVQ ( MM2, REGOFF(GR_VERTEX_X_OFFSET, ECX) )
- MOVD ( MM3, REGOFF(GR_VERTEX_OOZ_OFFSET, ECX) )
-
-
-/* end of DO_SETUP_XYZ */
-
- MOVD ( MM7, REGOFF(GR_VERTEX_OOW_OFFSET, ECX) ) /* f[OOWCOORD] = oow */
- ADD_L ( EAX, ECX ) /* f += stride */
-
- CMP_L ( ECX, EDX ) /* stall??? */
- JA ( TAGLLBL(FXPV_loop_start) )
-
-TAGLLBL(FXPV_end):
- FEMMS
- POP_L ( EBP )
- RET
-
-
-
-
-
-
-
-/* void project_verts( GLfloat *first,
- * GLfloat *last,
- * const GLfloat *m,
- * GLuint stride,
- * const GLubyte *mask )
- *
- */
-
-GLOBL GLNAME( TAG(fx_3dnow_project_clipped_vertices) )
-GLNAME( TAG(fx_3dnow_project_clipped_vertices) ):
-
- PUSH_L ( EBP )
-
- MOV_L ( REGOFF(8, ESP), ECX ) /* first FXDRIVER(VB)->verts*/
- MOV_L ( REGOFF(12, ESP), EDX ) /* last FXDRIVER(VB)->last_vert */
-
- FEMMS
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
-
- PREFETCH ( REGIND(ECX) ) /* fetch the first vertex */
-
- MOV_L ( REGOFF(24, ESP), EBP ) /* mat ctx->Viewport.WindowMap.M */
- MOV_L ( REGOFF(28, ESP), EAX ) /* stride */
- MOV_L ( REGOFF(32, ESP), ESI ) /* VB->ClipMask */
-
- MOVD ( REGOFF(MAT_TX, EBP), MM6 ) /* | tx */
- PUNPCKLDQ ( REGOFF(MAT_TY, EBP), MM6 ) /* ty | tx */
-
-#if !defined(FX_V2)
- MOV_L ( CONST(0x49400000), REGOFF(-8, ESP) ) /* snapper */
- MOV_L ( CONST(0x49400000), REGOFF(-4, ESP) ) /* snapper */
-#endif
-
- MOVQ ( REGOFF(-8, ESP), MM4 ) /* snapper | snapper */
- PFADD ( MM4, MM6 ) /* ty+snapper | tx+snapper */
-
- MOVD ( REGIND(EBP), MM5 )
- PUNPCKLDQ ( REGOFF(MAT_SY, EBP), MM5 ) /* vsy | vsx */
-
- MOVD ( REGOFF(MAT_SZ, EBP), MM1 ) /* | vsz */
-
-
-
-ALIGNTEXT32
-TAGLLBL(FXPCV_loop_start):
-
- PREFETCH ( REGOFF(64, ECX) ) /* fetch the next-ish vertex */
-
- CMP_B ( CONST(0), REGIND(ESI) )
- JNE ( TAGLLBL(FXPCV_skip) )
-
- MOVD ( REGOFF(12, ECX), MM0) /* | f[3] */
- PFRCP ( MM0, MM0 ) /* oow = 1/f[3] */
-
- MOVD ( REGOFF(12, ECX), MM7) /* | f[3] */
- PFRCPIT1 ( MM0, MM7 )
- PFRCPIT2 ( MM0, MM7 ) /* oow | oow */
-
- PUNPCKLDQ ( MM7, MM7 )
-
-
-#if (TYPE & SETUP_RGBA)
- MOVD ( REGOFF(CLIP_R, ECX ), MM0 ) /* f[RCOORD] = f[CLIP_R]; */
- MOVD ( MM0, REGOFF(GR_VERTEX_R_OFFSET, ECX) )
-#endif
-
-#if (TYPE & SETUP_TMU1)
- MOVQ ( REGOFF(CLIP_S1, ECX), MM0 ) /* f[S1COORD] = f[CLIP_S1] * oow */
- PFMUL ( MM7, MM0 ) /* f[T1COORD] = f[CLIP_T1] * oow */
- MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU1_OFFSET, ECX) )
-#endif
-
-
-#if (TYPE & SETUP_TMU0)
- MOVQ ( REGOFF(CLIP_S0, ECX), MM0 ) /* f[S0COORD] = f[CLIP_S0] * oow */
- PFMUL ( MM7, MM0 ) /* f[T0COORD] = f[CLIP_T0] * oow */
- MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU0_OFFSET, ECX) )
-#endif
-
-
-
-
-/* DO_SETUP_XYZ */
-
- MOVQ ( REGIND(ECX), MM2 ) /* f[1] | f[0] */
- PFMUL ( MM7, MM2 ) /* f[1] * oow | f[0] * oow */
-
- MOVD ( REGOFF(8, ECX), MM3 ) /* | f[2] */
- PFMUL ( MM7, MM3 ) /* | f[2] * oow */
-
- MOVD ( REGOFF(MAT_TZ, EBP), MM0 ) /* | vtz */
- PFMUL ( MM1, MM3 ) /* | f[2] *= vsz */
-
- PFADD ( MM0, MM3 ) /* | f[2] += vtz */
- PFMUL ( MM5, MM2 ) /* f[1] *= vsy | f[0] *= vsx */
-
- PFADD ( MM6, MM2 ) /* f[1] += vty | f[0] += vtx */
-
-#if !defined(FX_V2)
- PFSUB ( MM4, MM2 ) /* f[0,1] -= snapper */
-#endif
-
- MOVQ ( MM2, REGOFF(GR_VERTEX_X_OFFSET, ECX) )
- MOVD ( MM3, REGOFF(GR_VERTEX_OOZ_OFFSET, ECX) )
-
-
-/* end of DO_SETUP_XYZ */
-
- MOVD ( MM7, REGOFF(GR_VERTEX_OOW_OFFSET, ECX) ) /* f[OOWCOORD] = oow */
-
-TAGLLBL(FXPCV_skip):
- ADD_L ( EAX, ECX ) /* f += stride */
-
- INC_L ( ESI ) /* next ClipMask */
- CMP_L ( ECX, EDX )
- JA ( TAGLLBL(FXPCV_loop_start) )
-
- POP_L ( ESI )
- POP_L ( EDI )
-
-TAGLLBL(FXPCV_end):
- FEMMS
- POP_L ( EBP )
- RET
-
-
-
-#undef TYPE
-#undef TAG
-#undef SIZE
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/dri_glide.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/dri_glide.h
deleted file mode 100644
index 52a53f7dd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/dri_glide.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/dri_glide.h,v 1.1 2001/03/21 16:14:26 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __DRI_GLIDE_H__
-#define __DRI_GLIDE_H__
-
-#include <glide.h>
-#include "dri_mesaint.h"
-
-/*
- * This is the private interface between Glide and the DRI.
- */
-extern void grDRIOpen( char *pFB, char *pRegs, int deviceID,
- int width, int height,
- int mem, int cpp, int stride,
- int fifoOffset, int fifoSize,
- int fbOffset, int backOffset, int depthOffset,
- int textureOffset, int textureSize,
- volatile int *fifoPtr, volatile int *fifoRead );
-extern void grDRIPosition( int x, int y, int w, int h,
- int numClip, drm_clip_rect_t *pClip );
-extern void grDRILostContext( void );
-extern void grDRIImportFifo( int fifoPtr, int fifoRead );
-extern void grDRIInvalidateAll( void );
-extern void grDRIResetSAREA( void );
-extern void grDRIBufferSwap( FxU32 swapInterval );
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c
deleted file mode 100644
index 63fe875f5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * Keith Whitwell
- * Daniel Borca
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include "driver.h"
-#include "drm.h"
-#include "imports.h"
-
-#include "dri_util.h"
-
-#include "tdfx_context.h"
-#include "tdfx_dri.h"
-#include "xf86drm.h"
-
-
-#define TILE_WIDTH 128
-#define TILE_HEIGHT 32
-
-#define CMDFIFO_PAGES 64
-
-
-static int
-calcBufferStride (int xres, int tiled, int cpp)
-{
- int strideInTiles;
-
- if (tiled) {
- /* Calculate tile width stuff */
- strideInTiles = (xres+TILE_WIDTH-1)/TILE_WIDTH;
-
- return strideInTiles*cpp*TILE_WIDTH;
- } else {
- return xres*cpp;
- }
-} /* calcBufferStride */
-
-
-static int
-calcBufferHeightInTiles (int yres)
-{
- int heightInTiles; /* Height of buffer in tiles */
-
- /* Calculate tile height stuff */
- heightInTiles = yres >> 5;
-
- if (yres & (TILE_HEIGHT - 1))
- heightInTiles++;
-
- return heightInTiles;
-
-} /* calcBufferHeightInTiles */
-
-
-static int
-calcBufferSize (int xres, int yres, int tiled, int cpp)
-{
- int stride, height, bufSize;
-
- if (tiled) {
- stride = calcBufferStride(xres, tiled, cpp);
- height = TILE_HEIGHT * calcBufferHeightInTiles(yres);
- } else {
- stride = xres*cpp;
- height = yres;
- }
-
- bufSize = stride * height;
-
- return bufSize;
-} /* calcBufferSize */
-
-
-static void allocateMemory (const DRIDriverContext *ctx, TDFXDRIPtr pTDFX)
-{
- int memRemaining, fifoSize, screenSizeInTiles;
- int fbSize;
- char *str;
- int pixmapCacheLinesMin;
- int cursorOffset, cursorSize;
-
- pTDFX->stride = calcBufferStride(pTDFX->width, !0, pTDFX->cpp);
-
- /* enough to do DVD */
- pixmapCacheLinesMin = ((720*480*pTDFX->cpp) +
- pTDFX->stride - 1)/pTDFX->stride;
-
- if (pTDFX->deviceID > PCI_CHIP_VOODOO3) {
- if ((pixmapCacheLinesMin + pTDFX->height) > 4095)
- pixmapCacheLinesMin = 4095 - pTDFX->height;
- } else {
- if ((pixmapCacheLinesMin + pTDFX->height) > 2047)
- pixmapCacheLinesMin = 2047 - pTDFX->height;
- }
-
- if (pTDFX->cpp!=3) {
- screenSizeInTiles=calcBufferSize(pTDFX->width, pTDFX->height,
- !0, pTDFX->cpp);
- }
- else {
- /* cpp==3 needs to bump up to 4 */
- screenSizeInTiles=calcBufferSize(pTDFX->width, pTDFX->height,
- !0, 4);
- }
-
- /*
- * Layout is:
- * cursor, fifo, fb, tex, bb, db
- */
-
- fbSize = (pTDFX->height + pixmapCacheLinesMin) * pTDFX->stride;
-
- memRemaining=(pTDFX->mem - 1) &~ 0xFFF;
- /* Note that a page is 4096 bytes, and a */
- /* tile is 32 x 128 = 4096 bytes. So, */
- /* page and tile boundaries are the same */
- /* Place the depth offset first, forcing */
- /* it to be on an *odd* page boundary. */
- pTDFX->depthOffset = (memRemaining - screenSizeInTiles) &~ 0xFFF;
- if ((pTDFX->depthOffset & (0x1 << 12)) == 0) {
- pTDFX->depthOffset -= (0x1 << 12);
- }
- /* Now, place the back buffer, forcing it */
- /* to be on an *even* page boundary. */
- pTDFX->backOffset = (pTDFX->depthOffset - screenSizeInTiles) &~ 0xFFF;
- if (pTDFX->backOffset & (0x1 << 12)) {
- pTDFX->backOffset -= (0x1 << 12);
- }
- /* Give the cmd fifo at least */
- /* CMDFIFO_PAGES pages, but no more than */
- /* 64. NOTE: Don't go higher than 64, as */
- /* there is suspect code in Glide3 ! */
- fifoSize = ((64 <= CMDFIFO_PAGES) ? 64 : CMDFIFO_PAGES) << 12;
-
- /* We give 4096 bytes to the cursor */
- cursorSize = 0/*4096*/;
- cursorOffset = 0;
-
- pTDFX->fifoOffset = cursorOffset + cursorSize;
- pTDFX->fifoSize = fifoSize;
- /* Now, place the front buffer, forcing */
- /* it to be on a page boundary too, just */
- /* for giggles. */
- pTDFX->fbOffset = pTDFX->fifoOffset + pTDFX->fifoSize;
- pTDFX->textureOffset = pTDFX->fbOffset + fbSize;
- if (pTDFX->depthOffset <= pTDFX->textureOffset ||
- pTDFX->backOffset <= pTDFX->textureOffset) {
- /*
- * pTDFX->textureSize < 0 means that the DRI is disabled. pTDFX->backOffset
- * is used to calculate the maximum amount of memory available for
- * 2D offscreen use. With DRI disabled, set this to the top of memory.
- */
-
- pTDFX->textureSize = -1;
- pTDFX->backOffset = pTDFX->mem;
- pTDFX->depthOffset = -1;
- fprintf(stderr,
- "Not enough video memory available for textures and depth buffer\n"
- "\tand/or back buffer. Disabling DRI. To use DRI try lower\n"
- "\tresolution modes and/or a smaller virtual screen size\n");
- } else {
- pTDFX->textureSize = pTDFX->backOffset - pTDFX->textureOffset;
- }
-}
-
-
-static int createScreen (DRIDriverContext *ctx, TDFXDRIPtr pTDFX)
-{
- int err;
-
- {
- int width_bytes = (ctx->shared.virtualWidth * ctx->cpp);
- int maxy = ctx->shared.fbSize / width_bytes;
-
-
- if (maxy <= ctx->shared.virtualHeight * 3) {
- fprintf(stderr,
- "Static buffer allocation failed -- "
- "need at least %d kB video memory (have %d kB)\n",
- (ctx->shared.virtualWidth * ctx->shared.virtualHeight *
- ctx->cpp * 3 + 1023) / 1024,
- ctx->shared.fbSize / 1024);
- return 0;
- }
- }
-
- ctx->shared.SAREASize = SAREA_MAX;
- pTDFX->regsSize = ctx->MMIOSize;
-
- /* Note that drmOpen will try to load the kernel module, if needed. */
- ctx->drmFD = drmOpen("tdfx", NULL );
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
-
- if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) {
- fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
- return 0;
- }
-
- if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap( ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
-#ifndef _EMBEDDED
- 0,
-#else
- DRM_READ_ONLY,
-#endif
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
-
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
-
- if (drmAddMap(ctx->drmFD,
- ctx->MMIOStart,
- ctx->MMIOSize,
- DRM_REGISTERS,
- DRM_READ_ONLY,
- &pTDFX->regs) < 0) {
- fprintf(stderr, "[drm] drmAddMap mmio failed\n");
- return 0;
- }
- fprintf(stderr,
- "[drm] register handle = 0x%08lx\n", pTDFX->regs);
-
-
- /* Create a 'server' context so we can grab the lock for
- * initialization ioctls.
- */
- if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return 0;
- }
-
- DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0);
-
- /* Initialize the kernel data structures */
-
- /* Initialize kernel gart memory manager */
- allocateMemory(ctx, pTDFX);
-
- /* Initialize the SAREA private data structure */
-
-
- /* Quick hack to clear the front & back buffers. Could also use
- * the clear ioctl to do this, but would need to setup hw state
- * first.
- */
-
-
- /* This is the struct passed to tdfx_dri.so for its initialization */
- ctx->driverClientMsg = malloc(sizeof(TDFXDRIRec));
- ctx->driverClientMsgSize = sizeof(TDFXDRIRec);
- memcpy(ctx->driverClientMsg, pTDFX, ctx->driverClientMsgSize);
- pTDFX = (TDFXDRIPtr)ctx->driverClientMsg;
-
- /* Don't release the lock now - let the VT switch handler do it. */
-
- return 1;
-}
-
-
-/**
- * \brief Validate the fbdev mode.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Saves some registers and returns 1.
- *
- * \sa tdfxValidateMode().
- */
-static int tdfxValidateMode( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Examine mode returned by fbdev.
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Restores registers that fbdev has clobbered and returns 1.
- *
- * \sa tdfxValidateMode().
- */
-static int tdfxPostValidateMode( const DRIDriverContext *ctx )
-{
- return 1;
-}
-
-
-/**
- * \brief Initialize the framebuffer device mode
- *
- * \param ctx display handle.
- *
- * \return one on success, or zero on failure.
- *
- * Before exiting clears the framebuffer memory accessing it directly.
- */
-static int tdfxInitFBDev( DRIDriverContext *ctx )
-{
- TDFXDRIPtr pTDFX = calloc(1, sizeof(TDFXDRIRec));
-
- {
- int dummy = ctx->shared.virtualWidth;
-
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break;
- }
-
- ctx->shared.virtualWidth = dummy;
- }
-
- ctx->driverPrivate = (void *)pTDFX;
-
- pTDFX->deviceID = ctx->chipset;
- pTDFX->width = ctx->shared.virtualWidth;
- pTDFX->height = ctx->shared.virtualHeight;
- pTDFX->cpp = ctx->cpp;
- pTDFX->mem = ctx->FBSize; /* ->shared.fbSize? mem probe? */
- pTDFX->sarea_priv_offset = sizeof(drm_sarea_t);
-
- if (!createScreen(ctx, pTDFX))
- return 0;
-
- return 1;
-}
-
-
-/**
- * \brief The screen is being closed, so clean up any state and free any
- * resources used by the DRI.
- *
- * \param ctx display handle.
- *
- * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver
- * private data.
- */
-static void tdfxHaltFBDev( DRIDriverContext *ctx )
-{
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = 0;
- }
-}
-
-
-/**
- * \brief Shutdown the drawing engine.
- *
- * \param ctx display handle
- *
- * Turns off the 3D engine & restores the graphics card
- * to a state that fbdev understands.
- */
-static int tdfxEngineShutdown( const DRIDriverContext *ctx )
-{
- fprintf(stderr, "%s: not implemented\n", __FUNCTION__);
- return 1;
-}
-
-
-/**
- * \brief Restore the drawing engine.
- *
- * \param ctx display handle
- *
- * Resets the graphics card and sets initial values for several registers of
- * the card's drawing engine.
- *
- * Turns on 3dfx
- */
-static int tdfxEngineRestore( const DRIDriverContext *ctx )
-{
- fprintf(stderr, "%s: not implemented\n", __FUNCTION__);
- return 1;
-}
-
-
-/**
- * \brief Exported driver interface for Mini GLX.
- *
- * \sa DRIDriverRec.
- */
-struct DRIDriverRec __driDriver = {
- tdfxValidateMode,
- tdfxPostValidateMode,
- tdfxInitFBDev,
- tdfxHaltFBDev,
- tdfxEngineShutdown,
- tdfxEngineRestore,
- 0
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h
deleted file mode 100644
index acd0b9ae5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.h,v 1.5 2001/03/21 17:02:26 dawes Exp $ */
-
-#ifndef _TDFX_DRI_
-#define _TDFX_DRI_
-
-#include "xf86drm.h"
-#include "drm.h"
-
-typedef struct {
- drm_handle_t regs;
- drmSize regsSize;
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int stride;
- int fifoOffset;
- int fifoSize;
- int fbOffset;
- int backOffset;
- int depthOffset;
- int textureOffset;
- int textureSize;
- unsigned int sarea_priv_offset;
-} TDFXDRIRec, *TDFXDRIPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c
deleted file mode 100644
index 412a2791d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.12 2003/05/08 09:25:35 herrb Exp $ */
-
-/*
- * New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#include <dlfcn.h>
-#include "tdfx_context.h"
-#include "tdfx_dd.h"
-#include "tdfx_state.h"
-#include "tdfx_vb.h"
-#include "tdfx_tex.h"
-#include "tdfx_tris.h"
-#include "tdfx_render.h"
-#include "tdfx_span.h"
-#include "tdfx_texman.h"
-#include "extensions.h"
-#include "hash.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "utils.h"
-
-#define need_GL_ARB_multisample
-/* #define need_GL_ARB_point_parameters */
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-/* #define need_GL_ARB_vertex_program */
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_multi_draw_arrays
-#define need_GL_EXT_paletted_texture
-/* #define need_GL_EXT_secondary_color */
-#define need_GL_IBM_multimode_draw_arrays
-/* #define need_GL_MESA_program_debug */
-/* #define need_GL_NV_vertex_program */
-#include "extension_helper.h"
-
-
-/**
- * Common extension strings exported by all cards
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
-
- { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
- { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
- { "GL_EXT_shared_texture_palette", NULL },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_env_add", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_HP_occlusion_test", NULL },
- { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
-
-#ifdef need_GL_ARB_point_parameters
- { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
- { "GL_ARB_point_sprite", NULL },
-#endif
-#ifdef need_GL_EXT_secondary_color
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
-#endif
-#ifdef need_GL_ARB_vertex_program
- { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
-#endif
-#ifdef need_GL_NV_vertex_program
- { "GL_NV_vertex_program", GL_NV_vertex_program_functions }
- { "GL_NV_vertex_program1_1", NULL },
-#endif
-#ifdef need_GL_MESA_program_debug
- { "GL_MESA_program_debug", GL_MESA_program_debug_functions },
-#endif
- { NULL, NULL }
-};
-
-/**
- * Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards.
- */
-const struct dri_extension napalm_extensions[] =
-{
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
- { "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
- { "GL_EXT_texture_compression_s3tc", NULL },
- { "GL_EXT_texture_env_combine", NULL },
-
- { "GL_3DFX_texture_compression_FXT1", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_S3_s3tc", NULL },
- { NULL, NULL }
-};
-
-/*
- * Enable/Disable the extensions for this context.
- */
-static void tdfxDDInitExtensions( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- driInitExtensions( ctx, card_extensions, GL_FALSE );
-
- if ( fxMesa->haveTwoTMUs ) {
- _mesa_enable_extension( ctx, "GL_ARB_multitexture" );
- }
-
- if ( TDFX_IS_NAPALM( fxMesa ) ) {
- driInitExtensions( ctx, napalm_extensions, GL_FALSE );
- } else {
- _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" );
- }
-}
-
-
-
-static const struct tnl_pipeline_stage *tdfx_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
-#if 0
-#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program)
- &_tnl_arb_vertex_program_stage,
- &_tnl_vertex_program_stage,
-#endif
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-static const struct dri_debug_control debug_control[] =
-{
- { "dri", DEBUG_VERBOSE_DRI },
- { "sync", DEBUG_ALWAYS_SYNC },
- { "api", DEBUG_VERBOSE_API },
- { "fall", DEBUG_VERBOSE_FALL },
- { NULL, 0 }
-};
-
-GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate )
-{
- tdfxContextPtr fxMesa;
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- tdfxScreenPrivate *fxScreen = (tdfxScreenPrivate *) sPriv->private;
- TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) ((char *) sPriv->pSAREA +
- sizeof(drm_sarea_t));
- struct dd_function_table functions;
-
- /* Allocate tdfx context */
- fxMesa = (tdfxContextPtr) CALLOC( sizeof(tdfxContextRec) );
- if (!fxMesa)
- return GL_FALSE;
-
- /* Init default driver functions then plug in our tdfx-specific functions
- * (the texture functions are especially important)
- */
- _mesa_init_driver_functions(&functions);
- tdfxDDInitDriverFuncs(mesaVis, &functions);
- tdfxInitTextureFuncs(&functions);
- tdfxInitRenderFuncs(&functions);
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((tdfxContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
- &functions, (void *) fxMesa);
- if (!fxMesa->glCtx) {
- FREE(fxMesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = fxMesa;
-
- /* Mirror some important DRI state
- */
- fxMesa->hHWContext = driContextPriv->hHWContext;
- fxMesa->driHwLock = &sPriv->pSAREA->lock;
- fxMesa->driFd = sPriv->fd;
-
- fxMesa->driScreen = sPriv;
- fxMesa->driContext = driContextPriv;
- fxMesa->fxScreen = fxScreen;
- fxMesa->sarea = saPriv;
-
- /*JJJ - really?*/
- fxMesa->haveHwAlpha = ( mesaVis->alphaBits &&
- ((mesaVis->greenBits == 8) ||
- (mesaVis->depthBits == 0)) );
- fxMesa->haveHwStencil = ( TDFX_IS_NAPALM( fxMesa ) &&
- mesaVis->stencilBits &&
- mesaVis->depthBits == 24 );
-
- fxMesa->screen_width = fxScreen->width;
- fxMesa->screen_height = fxScreen->height;
-
- fxMesa->new_gl_state = ~0;
- fxMesa->new_state = ~0;
- fxMesa->dirty = ~0;
-
- /* Parse configuration files */
- driParseConfigFiles (&fxMesa->optionCache, &fxScreen->optionCache,
- fxMesa->driScreen->myNum, "tdfx");
-
- /* NOTE: This must be here before any Glide calls! */
- if (!tdfxInitGlide( fxMesa )) {
- FREE(fxMesa);
- return GL_FALSE;
- }
-
- fxMesa->Glide.grDRIOpen( (char*) sPriv->pFB, fxScreen->regs.map, fxScreen->deviceID,
- fxScreen->width, fxScreen->height, fxScreen->mem, fxScreen->cpp,
- fxScreen->stride, fxScreen->fifoOffset, fxScreen->fifoSize,
- fxScreen->fbOffset, fxScreen->backOffset, fxScreen->depthOffset,
- fxScreen->textureOffset, fxScreen->textureSize, &saPriv->fifoPtr,
- &saPriv->fifoRead );
-
- if ( getenv( "FX_GLIDE_SWAPINTERVAL" ) ) {
- fxMesa->Glide.SwapInterval = atoi( getenv( "FX_GLIDE_SWAPINTERVAL" ) );
- } else {
- fxMesa->Glide.SwapInterval = 0;
- }
- if ( getenv( "FX_MAX_PENDING_SWAPS" ) ) {
- fxMesa->Glide.MaxPendingSwaps = atoi( getenv( "FX_MAX_PENDING_SWAPS" ) );
- } else {
- fxMesa->Glide.MaxPendingSwaps = 2;
- }
-
- fxMesa->Glide.Initialized = GL_FALSE;
- fxMesa->Glide.Board = 0;
-
-
- if (getenv("FX_EMULATE_SINGLE_TMU")) {
- fxMesa->haveTwoTMUs = GL_FALSE;
- }
- else {
- if ( TDFX_IS_BANSHEE( fxMesa ) ) {
- fxMesa->haveTwoTMUs = GL_FALSE;
- } else {
- fxMesa->haveTwoTMUs = GL_TRUE;
- }
- }
-
- fxMesa->stats.swapBuffer = 0;
- fxMesa->stats.reqTexUpload = 0;
- fxMesa->stats.texUpload = 0;
- fxMesa->stats.memTexUpload = 0;
-
- fxMesa->tmuSrc = TDFX_TMU_NONE;
-
- ctx = fxMesa->glCtx;
- if ( TDFX_IS_NAPALM( fxMesa ) ) {
- ctx->Const.MaxTextureLevels = 12;
- } else {
- ctx->Const.MaxTextureLevels = 9;
- }
- ctx->Const.MaxTextureUnits = TDFX_IS_BANSHEE( fxMesa ) ? 1 : 2;
- ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
- ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
-
- /* No wide points.
- */
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
-
- /* Disable wide lines as we can't antialias them correctly in
- * hardware.
- */
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 1.0;
- ctx->Const.MaxLineWidthAA = 1.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, tdfx_pipeline );
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_TRUE );
- _swrast_allow_vertex_fog( ctx, GL_FALSE );
- _tnl_allow_pixel_fog( ctx, GL_TRUE );
- _tnl_allow_vertex_fog( ctx, GL_FALSE );
-
- tdfxDDInitExtensions( ctx );
- /* XXX these should really go right after _mesa_init_driver_functions() */
- tdfxDDInitSpanFuncs( ctx );
- tdfxDDInitStateFuncs( ctx );
- tdfxDDInitTriFuncs( ctx );
- tdfxInitVB( ctx );
- tdfxInitState( fxMesa );
-
-#if DO_DEBUG
- TDFX_DEBUG = driParseDebugString( getenv( "TDFX_DEBUG" ), debug_control );
-#endif
-
- if (driQueryOptionb(&fxMesa->optionCache, "no_rast")) {
- fprintf(stderr, "disabling 3D acceleration\n");
- FALLBACK(fxMesa, TDFX_FALLBACK_DISABLE, 1);
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean tdfxInitVertexFormats( tdfxContextPtr fxMesa )
-{
- FxI32 result;
- int i;
-
- LOCK_HARDWARE( fxMesa );
-
- fxMesa->Glide.grGet( GR_GLIDE_VERTEXLAYOUT_SIZE, sizeof(FxI32), &result );
- for ( i = 0 ; i < TDFX_NUM_LAYOUTS ; i++ ) {
- fxMesa->layout[i] = MALLOC( result );
- if ( !fxMesa->layout[i] ) {
- UNLOCK_HARDWARE( fxMesa );
- return GL_FALSE;
- }
- }
-
- /* Tiny vertex format - 16 bytes.
- */
- fxMesa->Glide.grReset( GR_VERTEX_PARAMETER );
- fxMesa->Glide.grCoordinateSpace( GR_WINDOW_COORDS );
- fxMesa->Glide.grVertexLayout( GR_PARAM_XY, TDFX_XY_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Z, TDFX_Z_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_PARGB, TDFX_ARGB_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grGlideGetVertexLayout( fxMesa->layout[TDFX_LAYOUT_TINY] );
-
- /* Non textured vertex format - 24 bytes (Need w for table fog)
- */
- fxMesa->Glide.grReset( GR_VERTEX_PARAMETER );
- fxMesa->Glide.grCoordinateSpace( GR_WINDOW_COORDS );
- fxMesa->Glide.grVertexLayout( GR_PARAM_XY, TDFX_XY_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Z, TDFX_Z_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q, TDFX_Q_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_PARGB, TDFX_ARGB_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grGlideGetVertexLayout( fxMesa->layout[TDFX_LAYOUT_NOTEX] );
-
- /* Single textured vertex format - 32 bytes.
- */
- fxMesa->Glide.grReset( GR_VERTEX_PARAMETER );
- fxMesa->Glide.grCoordinateSpace( GR_WINDOW_COORDS );
- fxMesa->Glide.grVertexLayout( GR_PARAM_XY, TDFX_XY_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Z, TDFX_Z_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q, TDFX_Q_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_PARGB, TDFX_ARGB_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_ST0, TDFX_ST0_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grGlideGetVertexLayout( fxMesa->layout[TDFX_LAYOUT_SINGLE] );
-
- /* Multitextured vertex format - 40 bytes.
- */
- fxMesa->Glide.grReset( GR_VERTEX_PARAMETER );
- fxMesa->Glide.grCoordinateSpace( GR_WINDOW_COORDS );
- fxMesa->Glide.grVertexLayout( GR_PARAM_XY, TDFX_XY_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Z, TDFX_Z_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q, TDFX_Q_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_PARGB, TDFX_ARGB_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_ST0, TDFX_ST0_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_ST1, TDFX_ST1_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grGlideGetVertexLayout( fxMesa->layout[TDFX_LAYOUT_MULTI] );
-
- /* Projected texture vertex format - 36 bytes.
- */
- fxMesa->Glide.grReset( GR_VERTEX_PARAMETER );
- fxMesa->Glide.grCoordinateSpace( GR_WINDOW_COORDS );
- fxMesa->Glide.grVertexLayout( GR_PARAM_XY, TDFX_XY_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Z, TDFX_Z_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q, TDFX_Q_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_PARGB, TDFX_ARGB_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_ST0, TDFX_ST0_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q0, TDFX_Q0_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grGlideGetVertexLayout( fxMesa->layout[TDFX_LAYOUT_PROJ1] );
-
- /* Projected multitexture vertex format - 48 bytes.
- */
- fxMesa->Glide.grReset( GR_VERTEX_PARAMETER );
- fxMesa->Glide.grCoordinateSpace( GR_WINDOW_COORDS );
- fxMesa->Glide.grVertexLayout( GR_PARAM_XY, TDFX_XY_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Z, TDFX_Z_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q, TDFX_Q_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_PARGB, TDFX_ARGB_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_ST0, TDFX_ST0_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q0, TDFX_Q0_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_ST1, TDFX_ST1_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grVertexLayout( GR_PARAM_Q1, TDFX_Q1_OFFSET, GR_PARAM_ENABLE );
- fxMesa->Glide.grGlideGetVertexLayout( fxMesa->layout[TDFX_LAYOUT_PROJ2] );
-
- UNLOCK_HARDWARE( fxMesa );
-
- return GL_TRUE;
-}
-
-
-/*
- * Initialize the state in an tdfxContextPtr struct.
- */
-static GLboolean
-tdfxInitContext( __DRIdrawablePrivate *driDrawPriv, tdfxContextPtr fxMesa )
-{
- /* KW: Would be nice to make one of these a member of the other.
- */
- FxI32 result[2];
- const char *gext;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)fxMesa );
- }
-
-#if DEBUG_LOCKING
- fprintf(stderr, "Debug locking enabled\n");
-#endif
-
- if ( fxMesa->Glide.Initialized )
- return GL_TRUE;
-
- fxMesa->width = driDrawPriv->w;
- fxMesa->height = driDrawPriv->h;
-
- /* We have to use a light lock here, because we can't do any glide
- * operations yet. No use of FX_* functions in this function.
- */
- DRM_LIGHT_LOCK( fxMesa->driFd, fxMesa->driHwLock, fxMesa->hHWContext );
-
- fxMesa->Glide.grGlideInit();
- fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
-
- fxMesa->Glide.Context = fxMesa->Glide.grSstWinOpen( (FxU32) -1,
- GR_RESOLUTION_NONE,
- GR_REFRESH_NONE,
- fxMesa->Glide.ColorFormat,
- fxMesa->Glide.Origin,
- 2, 1 );
-
- fxMesa->Glide.grDRIResetSAREA();
-
- DRM_UNLOCK( fxMesa->driFd, fxMesa->driHwLock, fxMesa->hHWContext );
-
- if ( !fxMesa->Glide.Context )
- return GL_FALSE;
-
-
- /* Perform the Glide-dependant part of the context initialization.
- */
- FX_grColorMaskv( fxMesa->glCtx, true4 );
-
- tdfxTMInit( fxMesa );
-
- LOCK_HARDWARE( fxMesa );
-
- /* JJJ - COMMAND_TRANSPORT, PALETTE6666 */
- gext = fxMesa->Glide.grGetString( GR_EXTENSION );
- fxMesa->Glide.HaveCombineExt = strstr(gext, "COMBINE") && !getenv("MESA_FX_IGNORE_CMBEXT");
- fxMesa->Glide.HaveCommandTransportExt = GL_FALSE;
- fxMesa->Glide.HaveFogCoordExt = GL_TRUE;
- fxMesa->Glide.HavePixelExt = strstr(gext, "PIXEXT") && !getenv("MESA_FX_IGNORE_PIXEXT");
- fxMesa->Glide.HaveTextureBufferExt = GL_TRUE;
- fxMesa->Glide.HaveTexFmtExt = strstr(gext, "TEXFMT") && !getenv("MESA_FX_IGNORE_TEXFMT");
- fxMesa->Glide.HaveTexUMAExt = strstr(gext, "TEXUMA") && !getenv("MESA_FX_IGNORE_TEXUMA");
- fxMesa->Glide.HaveMirrorExt = strstr(gext, "TEXMIRROR") && !getenv("MESA_FX_IGNORE_MIREXT");
- fxMesa->Glide.HaveTexus2 = GL_FALSE;
-
- if ( fxMesa->glCtx->Visual.depthBits > 0 ) {
- fxMesa->Glide.grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
- } else {
- fxMesa->Glide.grDepthBufferMode(GR_DEPTHBUFFER_DISABLE);
- }
-
- fxMesa->Glide.grLfbWriteColorFormat( GR_COLORFORMAT_ABGR );
-
- fxMesa->Glide.grGet( GR_TEXTURE_ALIGN, sizeof(FxI32), result );
- fxMesa->Glide.TextureAlign = result[0];
-
- fxMesa->Glide.State = NULL;
- fxMesa->Glide.grGet( GR_GLIDE_STATE_SIZE, sizeof(FxI32), result );
- fxMesa->Glide.State = MALLOC( result[0] );
-
- fxMesa->Fog.Table = NULL;
- fxMesa->Glide.grGet( GR_FOG_TABLE_ENTRIES, sizeof(FxI32), result );
- fxMesa->Fog.Table = MALLOC( result[0] * sizeof(GrFog_t) );
-
- UNLOCK_HARDWARE( fxMesa );
-
- if ( !fxMesa->Glide.State || !fxMesa->Fog.Table ) {
- if ( fxMesa->Glide.State )
- FREE( fxMesa->Glide.State );
- if ( fxMesa->Fog.Table )
- FREE( fxMesa->Fog.Table );
- return GL_FALSE;
- }
-
- if ( !tdfxInitVertexFormats( fxMesa ) ) {
- return GL_FALSE;
- }
-
- LOCK_HARDWARE( fxMesa );
-
- fxMesa->Glide.grGlideGetState( fxMesa->Glide.State );
-
- if ( getenv( "FX_GLIDE_INFO" ) ) {
- printf( "GR_RENDERER = %s\n", (char *) fxMesa->Glide.grGetString( GR_RENDERER ) );
- printf( "GR_VERSION = %s\n", (char *) fxMesa->Glide.grGetString( GR_VERSION ) );
- printf( "GR_VENDOR = %s\n", (char *) fxMesa->Glide.grGetString( GR_VENDOR ) );
- printf( "GR_HARDWARE = %s\n", (char *) fxMesa->Glide.grGetString( GR_HARDWARE ) );
- printf( "GR_EXTENSION = %s\n", (char *) gext );
- }
-
- UNLOCK_HARDWARE( fxMesa );
-
- fxMesa->numClipRects = 0;
- fxMesa->pClipRects = NULL;
- fxMesa->scissoredClipRects = GL_FALSE;
-
- fxMesa->Glide.Initialized = GL_TRUE;
-
- return GL_TRUE;
-}
-
-
-void
-tdfxDestroyContext( __DRIcontextPrivate *driContextPriv )
-{
- tdfxContextPtr fxMesa = (tdfxContextPtr) driContextPriv->driverPrivate;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)fxMesa );
- }
-
- if ( fxMesa ) {
- if (fxMesa->glCtx->Shared->RefCount == 1 && fxMesa->driDrawable) {
- /* This share group is about to go away, free our private
- * texture object data.
- */
- struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
- GLuint id;
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *tObj
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tdfxTMFreeTexture(fxMesa, tObj);
- }
- }
-
- tdfxTMClose(fxMesa); /* free texture memory */
-
- _swsetup_DestroyContext( fxMesa->glCtx );
- _tnl_DestroyContext( fxMesa->glCtx );
- _ac_DestroyContext( fxMesa->glCtx );
- _swrast_DestroyContext( fxMesa->glCtx );
-
- tdfxFreeVB( fxMesa->glCtx );
-
- /* Free Mesa context */
- fxMesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(fxMesa->glCtx);
-
- /* free the tdfx context */
- FREE( fxMesa );
- }
-}
-
-
-GLboolean
-tdfxUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- GET_CURRENT_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driContextPriv );
- }
-
- if ( driContextPriv && (tdfxContextPtr) driContextPriv == fxMesa ) {
- LOCK_HARDWARE(fxMesa);
- fxMesa->Glide.grGlideGetState(fxMesa->Glide.State);
- UNLOCK_HARDWARE(fxMesa);
- }
- return GL_TRUE;
-}
-
-
-GLboolean
-tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv )
-{
- if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driContextPriv );
- }
-
- if ( driContextPriv ) {
- tdfxContextPtr newFx = (tdfxContextPtr) driContextPriv->driverPrivate;
- GLcontext *newCtx = newFx->glCtx;
- GET_CURRENT_CONTEXT(curCtx);
-
- if ( newFx->driDrawable != driDrawPriv ) {
- newFx->driDrawable = driDrawPriv;
- newFx->dirty = ~0;
- }
- else {
- if (curCtx == newCtx) {
- /* same drawable, same context -> no-op */
- /* Need to call _mesa_make_current2() in order to make sure API
- * dispatch is set correctly.
- */
- _mesa_make_current( newCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
- return GL_TRUE;
- }
- /* [dBorca] tunnel2 requires this */
- newFx->dirty = ~0;
- }
-
- if ( !newFx->Glide.Initialized ) {
- if ( !tdfxInitContext( driDrawPriv, newFx ) )
- return GL_FALSE;
-
- LOCK_HARDWARE( newFx );
-
- /* FIXME: Force loading of window information */
- newFx->width = 0;
- tdfxUpdateClipping(newCtx);
- tdfxUploadClipping(newFx);
-
- UNLOCK_HARDWARE( newFx );
- } else {
- LOCK_HARDWARE( newFx );
-
- newFx->Glide.grSstSelect( newFx->Glide.Board );
- newFx->Glide.grGlideSetState( newFx->Glide.State );
-
- tdfxUpdateClipping(newCtx);
- tdfxUploadClipping(newFx);
-
- UNLOCK_HARDWARE( newFx );
- }
-
- _mesa_make_current( newCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-
-/*
- * Enable this to trace calls to various Glide functions.
- */
-/*#define DEBUG_TRAP*/
-#ifdef DEBUG_TRAP
-static void (*real_grDrawTriangle)( const void *a, const void *b, const void *c );
-static void (*real_grDrawPoint)( const void *a );
-static void (*real_grDrawVertexArray)(FxU32 mode, FxU32 Count, void *pointers);
-static void (*real_grDrawVertexArrayContiguous)(FxU32 mode, FxU32 Count,
- void *pointers, FxU32 stride);
-static void (*real_grClipWindow)( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy );
-
-static void (*real_grVertexLayout)(FxU32 param, FxI32 offset, FxU32 mode);
-static void (*real_grGlideGetVertexLayout)( void *layout );
-static void (*real_grGlideSetVertexLayout)( const void *layout );
-
-static void (*real_grTexDownloadMipMapLevel)( GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLod,
- GrLOD_t largeLod,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 evenOdd,
- void *data );
-
-
-static void debug_grDrawTriangle( const void *a, const void *b, const void *c )
-{
- printf("%s\n", __FUNCTION__);
- (*real_grDrawTriangle)(a, b, c);
-}
-
-static void debug_grDrawPoint( const void *a )
-{
- const float *f = (const float *) a;
- printf("%s %g %g\n", __FUNCTION__, f[0], f[1]);
- (*real_grDrawPoint)(a);
-}
-
-static void debug_grDrawVertexArray(FxU32 mode, FxU32 Count, void *pointers)
-{
- printf("%s count=%d\n", __FUNCTION__, (int) Count);
- (*real_grDrawVertexArray)(mode, Count, pointers);
-}
-
-static void debug_grDrawVertexArrayContiguous(FxU32 mode, FxU32 Count,
- void *pointers, FxU32 stride)
-{
- printf("%s mode=0x%x count=%d\n", __FUNCTION__, (int) mode, (int) Count);
- (*real_grDrawVertexArrayContiguous)(mode, Count, pointers, stride);
-}
-
-static void debug_grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy )
-{
- printf("%s %d,%d .. %d,%d\n", __FUNCTION__,
- (int) minx, (int) miny, (int) maxx, (int) maxy);
- (*real_grClipWindow)(minx, miny, maxx, maxy);
-}
-
-static void debug_grVertexLayout(FxU32 param, FxI32 offset, FxU32 mode)
-{
- (*real_grVertexLayout)(param, offset, mode);
-}
-
-static void debug_grGlideGetVertexLayout( void *layout )
-{
- (*real_grGlideGetVertexLayout)(layout);
-}
-
-static void debug_grGlideSetVertexLayout( const void *layout )
-{
- (*real_grGlideSetVertexLayout)(layout);
-}
-
-static void debug_grTexDownloadMipMapLevel( GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLod,
- GrLOD_t largeLod,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 evenOdd,
- void *data )
-{
- (*real_grTexDownloadMipMapLevel)(tmu, startAddress, thisLod, largeLod,
- aspectRatio, format, evenOdd, data);
-}
-
-#endif
-
-
-/*
- * Examine the context's deviceID to determine what kind of 3dfx hardware
- * is installed. dlopen() the appropriate Glide library and initialize
- * this context's Glide function pointers.
- * Return: true/false = success/failure
- */
-GLboolean tdfxInitGlide(tdfxContextPtr tmesa)
-{
- static const char *defaultGlide = "libglide3.so";
- const char *libName;
- void *libHandle;
-
- /*
- * XXX this code which selects a Glide library filename given the
- * deviceID may need to be cleaned up a bit.
- * Non-Linux systems may have different filenames, for example.
- */
- switch (tmesa->fxScreen->deviceID) {
- case PCI_CHIP_BANSHEE:
- case PCI_CHIP_VOODOO3:
- libName = "libglide3-v3.so";
- break;
- case PCI_CHIP_VOODOO5: /* same as PCI_CHIP_VOODOO4 */
- libName = "libglide3-v5.so";
- break;
- default:
- {
- __driUtilMessage("unrecognized 3dfx deviceID: 0x%x",
- tmesa->fxScreen->deviceID);
- }
- return GL_FALSE;
- }
-
- libHandle = dlopen(libName, RTLD_NOW);
- if (!libHandle) {
- /* The device-specific Glide library filename didn't work, try the
- * old, generic libglide3.so library.
- */
- libHandle = dlopen(defaultGlide, RTLD_NOW);
- if (!libHandle) {
- __driUtilMessage(
- "can't find Glide library, dlopen(%s) and dlopen(%s) both failed.",
- libName, defaultGlide);
- __driUtilMessage("dlerror() message: %s", dlerror());
- return GL_FALSE;
- }
- libName = defaultGlide;
- }
-
- {
- const char *env = getenv("LIBGL_DEBUG");
- if (env && strstr(env, "verbose")) {
- fprintf(stderr, "libGL: using Glide library %s\n", libName);
- }
- }
-
-#define GET_FUNCTION(PTR, NAME) \
- tmesa->Glide.PTR = dlsym(libHandle, NAME); \
- if (!tmesa->Glide.PTR) { \
- __driUtilMessage("couldn't find Glide function %s in %s.", \
- NAME, libName); \
- }
-
- GET_FUNCTION(grDrawPoint, "grDrawPoint");
- GET_FUNCTION(grDrawLine, "grDrawLine");
- GET_FUNCTION(grDrawTriangle, "grDrawTriangle");
- GET_FUNCTION(grVertexLayout, "grVertexLayout");
- GET_FUNCTION(grDrawVertexArray, "grDrawVertexArray");
- GET_FUNCTION(grDrawVertexArrayContiguous, "grDrawVertexArrayContiguous");
- GET_FUNCTION(grBufferClear, "grBufferClear");
- /*GET_FUNCTION(grBufferSwap, "grBufferSwap");*/
- GET_FUNCTION(grRenderBuffer, "grRenderBuffer");
- GET_FUNCTION(grErrorSetCallback, "grErrorSetCallback");
- GET_FUNCTION(grFinish, "grFinish");
- GET_FUNCTION(grFlush, "grFlush");
- GET_FUNCTION(grSstWinOpen, "grSstWinOpen");
- GET_FUNCTION(grSstWinClose, "grSstWinClose");
-#if 0
- /* Not in V3 lib, and not used anyway. */
- GET_FUNCTION(grSetNumPendingBuffers, "grSetNumPendingBuffers");
-#endif
- GET_FUNCTION(grSelectContext, "grSelectContext");
- GET_FUNCTION(grSstOrigin, "grSstOrigin");
- GET_FUNCTION(grSstSelect, "grSstSelect");
- GET_FUNCTION(grAlphaBlendFunction, "grAlphaBlendFunction");
- GET_FUNCTION(grAlphaCombine, "grAlphaCombine");
- GET_FUNCTION(grAlphaControlsITRGBLighting, "grAlphaControlsITRGBLighting");
- GET_FUNCTION(grAlphaTestFunction, "grAlphaTestFunction");
- GET_FUNCTION(grAlphaTestReferenceValue, "grAlphaTestReferenceValue");
- GET_FUNCTION(grChromakeyMode, "grChromakeyMode");
- GET_FUNCTION(grChromakeyValue, "grChromakeyValue");
- GET_FUNCTION(grClipWindow, "grClipWindow");
- GET_FUNCTION(grColorCombine, "grColorCombine");
- GET_FUNCTION(grColorMask, "grColorMask");
- GET_FUNCTION(grCullMode, "grCullMode");
- GET_FUNCTION(grConstantColorValue, "grConstantColorValue");
- GET_FUNCTION(grDepthBiasLevel, "grDepthBiasLevel");
- GET_FUNCTION(grDepthBufferFunction, "grDepthBufferFunction");
- GET_FUNCTION(grDepthBufferMode, "grDepthBufferMode");
- GET_FUNCTION(grDepthMask, "grDepthMask");
- GET_FUNCTION(grDisableAllEffects, "grDisableAllEffects");
- GET_FUNCTION(grDitherMode, "grDitherMode");
- GET_FUNCTION(grFogColorValue, "grFogColorValue");
- GET_FUNCTION(grFogMode, "grFogMode");
- GET_FUNCTION(grFogTable, "grFogTable");
- GET_FUNCTION(grLoadGammaTable, "grLoadGammaTable");
- GET_FUNCTION(grSplash, "grSplash");
- GET_FUNCTION(grGet, "grGet");
- GET_FUNCTION(grGetString, "grGetString");
- GET_FUNCTION(grQueryResolutions, "grQueryResolutions");
- GET_FUNCTION(grReset, "grReset");
- GET_FUNCTION(grGetProcAddress, "grGetProcAddress");
- GET_FUNCTION(grEnable, "grEnable");
- GET_FUNCTION(grDisable, "grDisable");
- GET_FUNCTION(grCoordinateSpace, "grCoordinateSpace");
- GET_FUNCTION(grDepthRange, "grDepthRange");
- GET_FUNCTION(grStippleMode, "grStippleMode");
- GET_FUNCTION(grStipplePattern, "grStipplePattern");
- GET_FUNCTION(grViewport, "grViewport");
- GET_FUNCTION(grTexCalcMemRequired, "grTexCalcMemRequired");
- GET_FUNCTION(grTexTextureMemRequired, "grTexTextureMemRequired");
- GET_FUNCTION(grTexMinAddress, "grTexMinAddress");
- GET_FUNCTION(grTexMaxAddress, "grTexMaxAddress");
- GET_FUNCTION(grTexNCCTable, "grTexNCCTable");
- GET_FUNCTION(grTexSource, "grTexSource");
- GET_FUNCTION(grTexClampMode, "grTexClampMode");
- GET_FUNCTION(grTexCombine, "grTexCombine");
- GET_FUNCTION(grTexDetailControl, "grTexDetailControl");
- GET_FUNCTION(grTexFilterMode, "grTexFilterMode");
- GET_FUNCTION(grTexLodBiasValue, "grTexLodBiasValue");
- GET_FUNCTION(grTexDownloadMipMap, "grTexDownloadMipMap");
- GET_FUNCTION(grTexDownloadMipMapLevel, "grTexDownloadMipMapLevel");
- GET_FUNCTION(grTexDownloadMipMapLevelPartial, "grTexDownloadMipMapLevelPartial");
- GET_FUNCTION(grTexDownloadTable, "grTexDownloadTable");
- GET_FUNCTION(grTexDownloadTablePartial, "grTexDownloadTablePartial");
- GET_FUNCTION(grTexMipMapMode, "grTexMipMapMode");
- GET_FUNCTION(grTexMultibase, "grTexMultibase");
- GET_FUNCTION(grTexMultibaseAddress, "grTexMultibaseAddress");
- GET_FUNCTION(grLfbLock, "grLfbLock");
- GET_FUNCTION(grLfbUnlock, "grLfbUnlock");
- GET_FUNCTION(grLfbConstantAlpha, "grLfbConstantAlpha");
- GET_FUNCTION(grLfbConstantDepth, "grLfbConstantDepth");
- GET_FUNCTION(grLfbWriteColorSwizzle, "grLfbWriteColorSwizzle");
- GET_FUNCTION(grLfbWriteColorFormat, "grLfbWriteColorFormat");
- GET_FUNCTION(grLfbWriteRegion, "grLfbWriteRegion");
- GET_FUNCTION(grLfbReadRegion, "grLfbReadRegion");
- GET_FUNCTION(grGlideInit, "grGlideInit");
- GET_FUNCTION(grGlideShutdown, "grGlideShutdown");
- GET_FUNCTION(grGlideGetState, "grGlideGetState");
- GET_FUNCTION(grGlideSetState, "grGlideSetState");
- GET_FUNCTION(grGlideGetVertexLayout, "grGlideGetVertexLayout");
- GET_FUNCTION(grGlideSetVertexLayout, "grGlideSetVertexLayout");
-
- /* Glide utility functions */
- GET_FUNCTION(guFogGenerateExp, "guFogGenerateExp");
- GET_FUNCTION(guFogGenerateExp2, "guFogGenerateExp2");
- GET_FUNCTION(guFogGenerateLinear, "guFogGenerateLinear");
-
- /* DRI functions */
- GET_FUNCTION(grDRIOpen, "grDRIOpen");
- GET_FUNCTION(grDRIPosition, "grDRIPosition");
- /*GET_FUNCTION(grDRILostContext, "grDRILostContext");*/
- GET_FUNCTION(grDRIImportFifo, "grDRIImportFifo");
- GET_FUNCTION(grDRIInvalidateAll, "grDRIInvalidateAll");
- GET_FUNCTION(grDRIResetSAREA, "grDRIResetSAREA");
- GET_FUNCTION(grDRIBufferSwap, "grDRIBufferSwap");
-
- /*
- * Extension functions:
- * Just use dlysm() because we want a NULL pointer if the function is
- * not found.
- */
- /* PIXEXT extension */
- tmesa->Glide.grStencilFunc = dlsym(libHandle, "grStencilFunc");
- tmesa->Glide.grStencilMask = dlsym(libHandle, "grStencilMask");
- tmesa->Glide.grStencilOp = dlsym(libHandle, "grStencilOp");
- tmesa->Glide.grBufferClearExt = dlsym(libHandle, "grBufferClearExt");
- tmesa->Glide.grColorMaskExt = dlsym(libHandle, "grColorMaskExt");
- /* COMBINE extension */
- tmesa->Glide.grColorCombineExt = dlsym(libHandle, "grColorCombineExt");
- tmesa->Glide.grTexColorCombineExt = dlsym(libHandle, "grTexColorCombineExt");
- tmesa->Glide.grAlphaCombineExt = dlsym(libHandle, "grAlphaCombineExt");
- tmesa->Glide.grTexAlphaCombineExt = dlsym(libHandle, "grTexAlphaCombineExt");
- tmesa->Glide.grAlphaBlendFunctionExt = dlsym(libHandle, "grAlphaBlendFunctionExt");
- tmesa->Glide.grConstantColorValueExt = dlsym(libHandle, "grConstantColorValueExt");
- /* Texus 2 */
- tmesa->Glide.txImgQuantize = dlsym(libHandle, "txImgQuantize");
- tmesa->Glide.txImgDequantizeFXT1 = dlsym(libHandle, "_txImgDequantizeFXT1");
- tmesa->Glide.txErrorSetCallback = dlsym(libHandle, "txErrorSetCallback");
-
-#ifdef DEBUG_TRAP
- /* wrap the drawing functions so we can trap them */
- real_grDrawTriangle = tmesa->Glide.grDrawTriangle;
- tmesa->Glide.grDrawTriangle = debug_grDrawTriangle;
-
- real_grDrawPoint = tmesa->Glide.grDrawPoint;
- tmesa->Glide.grDrawPoint = debug_grDrawPoint;
-
- real_grDrawVertexArray = tmesa->Glide.grDrawVertexArray;
- tmesa->Glide.grDrawVertexArray = debug_grDrawVertexArray;
-
- real_grDrawVertexArrayContiguous = tmesa->Glide.grDrawVertexArrayContiguous;
- tmesa->Glide.grDrawVertexArrayContiguous = debug_grDrawVertexArrayContiguous;
-
- real_grClipWindow = tmesa->Glide.grClipWindow;
- tmesa->Glide.grClipWindow = debug_grClipWindow;
-
- real_grVertexLayout = tmesa->Glide.grVertexLayout;
- tmesa->Glide.grVertexLayout = debug_grVertexLayout;
-
- real_grGlideGetVertexLayout = tmesa->Glide.grGlideGetVertexLayout;
- tmesa->Glide.grGlideGetVertexLayout = debug_grGlideGetVertexLayout;
-
- real_grGlideSetVertexLayout = tmesa->Glide.grGlideSetVertexLayout;
- tmesa->Glide.grGlideSetVertexLayout = debug_grGlideSetVertexLayout;
-
- real_grTexDownloadMipMapLevel = tmesa->Glide.grTexDownloadMipMapLevel;
- tmesa->Glide.grTexDownloadMipMapLevel = debug_grTexDownloadMipMapLevel;
-
-#endif
- return GL_TRUE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.h
deleted file mode 100644
index b8349fec7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.h
+++ /dev/null
@@ -1,1007 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h,v 1.5 2002/02/24 21:51:10 dawes Exp $ */
-
-/*
- * New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __TDFX_CONTEXT_H__
-#define __TDFX_CONTEXT_H__
-
-#include <sys/time.h>
-#include "dri_util.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#else
-#include "glheader.h"
-#endif
-#if defined(__linux__)
-#include <signal.h>
-#endif
-
-#include "drm.h"
-#include "drm_sarea.h"
-#include "tdfx_glide.h"
-#include "xmlconfig.h"
-
-#include "clip.h"
-#include "context.h"
-#include "macros.h"
-#include "matrix.h"
-#include "imports.h"
-#include "mtypes.h"
-
-#include "tdfx_screen.h"
-
-
-
-
-#define TDFX_TMU0 GR_TMU0
-#define TDFX_TMU1 GR_TMU1
-#define TDFX_TMU_SPLIT 98
-#define TDFX_TMU_BOTH 99
-#define TDFX_TMU_NONE 100
-
-
-
-/* Flags for fxMesa->new_state
- */
-#define TDFX_NEW_COLOR 0x0001
-#define TDFX_NEW_ALPHA 0x0002
-#define TDFX_NEW_DEPTH 0x0004
-#define TDFX_NEW_FOG 0x0008
-#define TDFX_NEW_STENCIL 0x0010
-#define TDFX_NEW_CLIP 0x0020
-#define TDFX_NEW_VIEWPORT 0x0040
-#define TDFX_NEW_CULL 0x0080
-#define TDFX_NEW_GLIDE 0x0100
-#define TDFX_NEW_TEXTURE 0x0200
-#define TDFX_NEW_CONTEXT 0x0400
-#define TDFX_NEW_LINE 0x0800
-#define TDFX_NEW_RENDER 0x1000
-#define TDFX_NEW_STIPPLE 0x2000
-#define TDFX_NEW_TEXTURE_BIND 0x4000 /* experimental */
-
-
-/* Flags for fxMesa->dirty
- */
-#define TDFX_UPLOAD_COLOR_COMBINE 0x00000001
-#define TDFX_UPLOAD_ALPHA_COMBINE 0x00000002
-#define TDFX_UPLOAD_RENDER_BUFFER 0x00000004
-#define TDFX_UPLOAD_ALPHA_TEST 0x00000008
-#define TDFX_UPLOAD_ALPHA_REF 0x00000010
-#define TDFX_UPLOAD_BLEND_FUNC 0x00000020
-#define TDFX_UPLOAD_DEPTH_MODE 0x00000040
-#define TDFX_UPLOAD_DEPTH_BIAS 0x00000080
-#define TDFX_UPLOAD_DEPTH_FUNC 0x00000100
-#define TDFX_UPLOAD_DEPTH_MASK 0x00000200
-#define TDFX_UPLOAD_FOG_MODE 0x00000400
-#define TDFX_UPLOAD_FOG_COLOR 0x00000800
-#define TDFX_UPLOAD_FOG_TABLE 0x00001000
-#define TDFX_UPLOAD_CONSTANT_COLOR 0x00002000
-
-#define TDFX_UPLOAD_CLIP 0x00002000
-#define TDFX_UPLOAD_CULL 0x00004000
-#define TDFX_UPLOAD_VERTEX_LAYOUT 0x00008000
-#define TDFX_UPLOAD_COLOR_MASK 0x00010000
-#define TDFX_UPLOAD_DITHER 0x00040000
-#define TDFX_UPLOAD_STENCIL 0x00080000
-
-#define TDFX_UPLOAD_TEXTURE_SOURCE 0x00100000
-#define TDFX_UPLOAD_TEXTURE_PARAMS 0x00200000
-#define TDFX_UPLOAD_TEXTURE_PALETTE 0x00400000
-#define TDFX_UPLOAD_TEXTURE_ENV 0x00800000
-#define TDFX_UPLOAD_TEXTURE_IMAGES 0x01000000
-
-#define TDFX_UPLOAD_LINE 0x02000000
-
-#define TDFX_UPLOAD_STIPPLE 0x04000000
-
-/* Flags for software fallback cases */
-/* See correponding strings in tdfx_tris.c */
-#define TDFX_FALLBACK_TEXTURE_MAP 0x0001
-#define TDFX_FALLBACK_DRAW_BUFFER 0x0002
-#define TDFX_FALLBACK_SPECULAR 0x0004
-#define TDFX_FALLBACK_STENCIL 0x0008
-#define TDFX_FALLBACK_RENDER_MODE 0x0010
-#define TDFX_FALLBACK_LOGICOP 0x0020
-#define TDFX_FALLBACK_TEXTURE_ENV 0x0040
-#define TDFX_FALLBACK_TEXTURE_BORDER 0x0080
-#define TDFX_FALLBACK_COLORMASK 0x0100
-#define TDFX_FALLBACK_BLEND 0x0200
-#define TDFX_FALLBACK_LINE_STIPPLE 0x0400
-#define TDFX_FALLBACK_DISABLE 0x0800
-
-/* Different Glide vertex layouts
- */
-#define TDFX_LAYOUT_TINY 0
-#define TDFX_LAYOUT_NOTEX 1
-#define TDFX_LAYOUT_SINGLE 2
-#define TDFX_LAYOUT_MULTI 3
-#define TDFX_LAYOUT_PROJ1 4
-#define TDFX_LAYOUT_PROJ2 5
-#define TDFX_NUM_LAYOUTS 6
-
-#define TDFX_XY_OFFSET 0
-#define TDFX_Z_OFFSET 8
-#define TDFX_Q_OFFSET 12
-#define TDFX_ARGB_OFFSET 16
-#define TDFX_FOG_OFFSET 20
-#define TDFX_ST0_OFFSET 24
-#define TDFX_ST1_OFFSET 32
-#define TDFX_Q0_OFFSET 40
-#define TDFX_Q1_OFFSET 44
-
-
-/* Flags for buffer clears
- */
-#define TDFX_FRONT 0x1
-#define TDFX_BACK 0x2
-#define TDFX_DEPTH 0x4
-#define TDFX_STENCIL 0x8
-
-/*
- * Subpixel offsets to adjust Mesa's (true) window coordinates to
- * Glide coordinates. We need these to ensure precise rasterization.
- * Otherwise, we'll fail a bunch of conformance tests.
- */
-#define TRI_X_OFFSET ( 0.0F)
-#define TRI_Y_OFFSET ( 0.0F)
-#define LINE_X_OFFSET ( 0.0F)
-#define LINE_Y_OFFSET ( 0.125F)
-#define PNT_X_OFFSET ( 0.375F)
-#define PNT_Y_OFFSET ( 0.375F)
-
-
-#define TDFX_DEPTH_BIAS_SCALE 128
-
-/* Including xf86PciInfo.h causes a bunch of errors
- */
-#ifndef PCI_CHIP_BANSHEE
-#define PCI_CHIP_BANSHEE 0x0003
-#define PCI_CHIP_VOODOO3 0x0005
-#define PCI_CHIP_VOODOO4 0x0009
-#define PCI_CHIP_VOODOO5 0x0009
-#endif
-
-#define TDFX_IS_BANSHEE( fxMesa ) \
- ( fxMesa->fxScreen->deviceID == PCI_CHIP_BANSHEE )
-#define TDFX_IS_VOODOO3( fxMesa ) \
- ( fxMesa->fxScreen->deviceID == PCI_CHIP_VOODOO3 )
-#define TDFX_IS_VOODOO4( fxMesa ) \
- ( fxMesa->fxScreen->deviceID == PCI_CHIP_VOODOO4 )
-#define TDFX_IS_VOODOO5( fxMesa ) \
- ( fxMesa->fxScreen->deviceID == PCI_CHIP_VOODOO5 )
-#define TDFX_IS_NAPALM( fxMesa ) \
- ( (fxMesa->fxScreen->deviceID == PCI_CHIP_VOODOO4) || \
- (fxMesa->fxScreen->deviceID == PCI_CHIP_VOODOO5) )
-
-
-#define PACK_BGRA32(R, G, B, A) \
- ( (((GLuint) (R)) << 16) | \
- (((GLuint) (G)) << 8) | \
- (((GLuint) (B)) ) | \
- (((GLuint) (A)) << 24) )
-
-#define PACK_RGBA32(R, G, B, A) \
- ( (((GLuint) (R)) ) | \
- (((GLuint) (G)) << 8) | \
- (((GLuint) (B)) << 16) | \
- (((GLuint) (A)) << 24) )
-
-/*
- * The first two macros are to pack 8 bit color
- * channel values into a 565 format.
- */
-#define PACK_RGB16(R, G, B) \
- ((((GLuint) (R) & 0xF8) << 8) | \
- (((GLuint) (G) & 0xFC) << 3) | \
- (((GLuint) (B) & 0xFF) >> 3))
-#define PACK_BGR16(R, G, B) \
- ((((GLuint) (B) & 0xF8) << 8) | \
- (((GLuint) (G) & 0xFC) << 3) | \
- (((GLuint) (R) & 0xFF) >> 3))
-/*
- * The second two macros pack 8 bit color channel values
- * into 1555 values.
- */
-#define PACK_RGBA16(R, G, B, A) \
- (((((GLuint) (A) & 0xFF) > 0) << 15)| \
- (((GLuint) (R) & 0xF8) << 7) | \
- (((GLuint) (G) & 0xF8) << 2) | \
- (((GLuint) (B) & 0xF8) >> 3))
-#define PACK_BGRA16(R, G, B, A) \
- (((((GLuint) (A) & 0xFF) > 0) << 15)| \
- (((GLuint) (B) & 0xF8) << 7) | \
- (((GLuint) (G) & 0xF8) << 2) | \
- (((GLuint) (R) & 0xF8) >> 3))
-
-/* Used in calls to grColorMaskv()...
- */
-extern const GLboolean false4[4];
-extern const GLboolean true4[4];
-
-
-typedef struct tdfx_context tdfxContextRec;
-typedef struct tdfx_context *tdfxContextPtr;
-
-
-typedef struct {
- volatile int fifoPtr;
- volatile int fifoRead;
- volatile int fifoOwner;
- volatile int ctxOwner;
- volatile int texOwner;
-}
-TDFXSAREAPriv;
-
-
-typedef struct {
- GLuint swapBuffer;
- GLuint reqTexUpload;
- GLuint texUpload;
- GLuint memTexUpload;
- GLuint texSwaps;
-} tdfxStats;
-
-
-
-/*
- * Memory range from startAddr to endAddr-1
- */
-typedef struct mem_range {
- struct mem_range *next;
- FxU32 startAddr, endAddr;
-}
-tdfxMemRange;
-
-
-typedef struct {
- GLsizei width, height; /* image size */
- GLint wScale, hScale; /* scale factors */
- GrTextureFormat_t glideFormat; /* Glide image format */
-}
-tdfxMipMapLevel;
-
-
-#define TDFX_NUM_TMU 2
-
-
-typedef struct tdfxTexInfo_t
-{
- GLboolean isInTM;
- GLboolean reloadImages; /* if true, resend images to Glide */
- GLuint lastTimeUsed;
- FxU32 whichTMU;
-
- GrTexInfo info;
- GrAspectRatio_t aspectRatio;
- tdfxMemRange *tm[TDFX_NUM_TMU];
-
- GLint minLevel, maxLevel;
- GrTextureFilterMode_t minFilt;
- GrTextureFilterMode_t magFilt;
- GrTextureClampMode_t sClamp;
- GrTextureClampMode_t tClamp;
- FxBool LODblend;
- GrMipMapMode_t mmMode;
-
- GLfloat sScale, tScale; /* texcoord scale factor */
-
- GrTexTable_t paltype;
- GuTexPalette palette;
-
- GLboolean padded;
-}
-tdfxTexInfo;
-
-
-#define TDFX_TEXTURE_DATA(mesaObj) ((tdfxTexInfo *)((mesaObj)->DriverData))
-
-#define TDFX_TEXIMAGE_DATA(mesaImg) ((tdfxMipMapLevel *)((mesaImg)->DriverData))
-
-
-
-/*
- * This is state which may be shared by several tdfx contexts.
- * It hangs off of Mesa's gl_shared_state object (ctx->Shared->DriverData).
- */
-struct tdfxSharedState {
- GLboolean umaTexMemory;
- GLuint totalTexMem[TDFX_NUM_TMU]; /* constant */
- GLuint freeTexMem[TDFX_NUM_TMU]; /* changes as we go */
- tdfxMemRange *tmPool;
- tdfxMemRange *tmFree[TDFX_NUM_TMU];
-};
-
-
-
-/* ================================================================
- * The vertex structures.
- */
-/* The size of this union is not of relevence:
- */
-typedef struct tdfx_vertex_t {
- GLfloat x, y, z; /* Coordinates in screen space */
- GLfloat rhw; /* Reciprocal homogeneous w */
- GLubyte color[4]; /* Diffuse color */
- GLfloat fog;
- GLfloat tu0, tv0; /* Texture 0 coordinates */
- GLfloat tu1, tv1; /* Texture 1 coordinates */
- GLfloat tq0, tq1; /* Texture 0/1 q coords */
- unsigned char pspec[4]; /* B, G, R, A [0..255] */
- float psize; /* point size */
- long pad[16 - 14]; /* ensure 64b structure */
-} tdfxVertex, *tdfxVertexPtr;
-
-
-/* ================================================================
- *
- * We want to keep a mirror of the Glide function call parameters so we
- * can avoid updating our state too often.
- *
- * Each of these broad groups will typically have a new state flag
- * associated with it, and will be updated together. The individual
- * Glide function calls each have a dirty flag and will only be called
- * when absolutely necessary.
- */
-
-/* for grTexSource() */
-struct tdfx_texsource {
- FxU32 StartAddress;
- FxU32 EvenOdd;
- GrTexInfo *Info;
-};
-
-/* Texture object params */
-struct tdfx_texparams {
- GrTextureClampMode_t sClamp;
- GrTextureClampMode_t tClamp;
- GrTextureFilterMode_t minFilt;
- GrTextureFilterMode_t magFilt;
- GrMipMapMode_t mmMode;
- FxBool LODblend;
- GLfloat LodBias;
-};
-
-/* for grTexDownloadTable() texture palettes */
-struct tdfx_texpalette {
- GrTexTable_t Type;
- void *Data;
-};
-
-/* for Voodoo3/Banshee's grColorCombine() and grAlphaCombine() */
-struct tdfx_combine {
- GrCombineFunction_t Function; /* Combine function */
- GrCombineFactor_t Factor; /* Combine scale factor */
- GrCombineLocal_t Local; /* Local combine source */
- GrCombineOther_t Other; /* Other combine source */
- FxBool Invert; /* Combine result inversion flag */
-};
-
-/* for Voodoo3's grTexCombine() */
-struct tdfx_texcombine {
- GrCombineFunction_t FunctionRGB;
- GrCombineFactor_t FactorRGB;
- GrCombineFunction_t FunctionAlpha;
- GrCombineFactor_t FactorAlpha;
- FxBool InvertRGB;
- FxBool InvertAlpha;
-};
-
-
-/* for Voodoo5's grColorCombineExt() */
-struct tdfx_combine_color_ext {
- GrCCUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrCCUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrCCUColor_t SourceC;
- FxBool InvertC;
- GrCCUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* for Voodoo5's grAlphaCombineExt() */
-struct tdfx_combine_alpha_ext {
- GrACUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrACUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrACUColor_t SourceC;
- FxBool InvertC;
- GrACUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* for Voodoo5's grTexColorCombineExt() */
-struct tdfx_color_texenv {
- GrTCCUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrTCCUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrTCCUColor_t SourceC;
- FxBool InvertC;
- GrTCCUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* for Voodoo5's grTexAlphaCombineExt() */
-struct tdfx_alpha_texenv {
- GrTACUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrTACUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrTACUColor_t SourceC;
- FxBool InvertC;
- GrTCCUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* Voodoo5's texture combine environment */
-struct tdfx_texcombine_ext {
- struct tdfx_alpha_texenv Alpha;
- struct tdfx_color_texenv Color;
- GrColor_t EnvColor;
-};
-
-/* Used to track changes between Glide's state and Mesa's */
-struct tdfx_texstate {
- GLuint Enabled[2]; /* values ala ctx->Texture.Unit[i]._ReallyEnabled */
- GLenum EnvMode[TDFX_NUM_TMU]; /* index is Glide index, not OpenGL */
- GLenum TexFormat[TDFX_NUM_TMU]; /* index is Glide index, not OpenGL */
-};
-
-struct tdfx_color {
- GrColor_t ClearColor; /* Buffer clear color value */
- GrAlpha_t ClearAlpha; /* Buffer clear alpha value */
- FxBool ColorMask[4]; /* Per-channel write enable flags */
-
- GrColor_t MonoColor; /* Constant color value */
-
- /* Alpha testing */
- GrCmpFnc_t AlphaFunc; /* Alpha test function */
- GrAlpha_t AlphaRef; /* Alpha ref value in range [0,255] */
-
- /* Blending */
- GrAlphaBlendFnc_t BlendSrcRGB; /* Blend source RGB factor */
- GrAlphaBlendFnc_t BlendDstRGB; /* Blend destination RGB factor */
- GrAlphaBlendOp_t BlendEqRGB; /* Blend source RGB op */
- GrAlphaBlendFnc_t BlendSrcA; /* Blend source alpha factor */
- GrAlphaBlendFnc_t BlendDstA; /* Blend destination alpha factor */
- GrAlphaBlendOp_t BlendEqA; /* Blend source alpha op */
-
- GrDitherMode_t Dither; /* Dither enable */
-};
-
-struct tdfx_depth {
- GrDepthBufferMode_t Mode; /* Fixed-point Z or floating-point W */
- FxI32 Bias; /* Polygon offset factor */
- GrCmpFnc_t Func; /* Depth test function */
- FxU32 Clear; /* Buffer clear value */
- FxBool Mask; /* Write enable flag */
-};
-
-struct tdfx_stipple {
- GrStippleMode_t Mode; /* Stipple enable/disable */
- FxU32 Pattern; /* 8x4 Stipple Pattern */
-};
-
-struct tdfx_fog {
- GrFogMode_t Mode; /* Glide fog mode */
- GrColor_t Color; /* Fog color value */
- GLenum TableMode; /* GL fog mode currently in table */
- GrFog_t *Table; /* Fog value table */
- FxFloat Density; /* Density >= 0 */
- FxFloat Near; /* Start distance in eye coords */
- FxFloat Far; /* End distance in eye coords */
-};
-
-struct tdfx_stencil {
- GrCmpFnc_t Function; /* Stencil function */
- GrStencil_t RefValue; /* Stencil reference value */
- GrStencil_t ValueMask; /* Value mask */
- GrStencil_t WriteMask; /* Write mask */
- GrStencil_t FailFunc; /* Stencil fail function */
- GrStencil_t ZFailFunc; /* Stencil pass, depth fail function */
- GrStencil_t ZPassFunc; /* Stencil pass, depth pass function */
- GrStencil_t Clear; /* Buffer clear value */
-};
-
-struct tdfx_scissor {
- FxU32 minX, minY; /* Lower left corner */
- FxU32 maxX, maxY; /* Upper right corner */
-};
-
-struct tdfx_viewport {
- GrCoordinateSpaceMode_t Mode; /* Coordinate space */
- FxI32 X, Y; /* Position */
- FxI32 Width, Height; /* Size */
- FxFloat Near, Far; /* Depth buffer range */
-};
-
-struct tdfx_glide {
- void *State; /* Mirror of internal Glide state */
- GrContext_t Context; /* Glide context identifier */
- FxI32 Board; /* Current graphics subsystem */
- GrColorFormat_t ColorFormat; /* Framebuffer format */
- GrOriginLocation_t Origin; /* Location of screen space origin */
-
- FxBool Initialized; /* Glide initialization done? */
-
- FxI32 SwapInterval; /* SwapBuffers interval */
- FxI32 MaxPendingSwaps; /* Maximum outstanding SwapBuffers */
- FxI32 TextureAlign;
-
- /* Extensions */
- FxBool HaveCombineExt; /* COMBINE */
- FxBool HaveCommandTransportExt; /* COMMAND_TRANSPORT */
- FxBool HaveFogCoordExt; /* FOGCOORD */
- FxBool HavePixelExt; /* PIXEXT */
- FxBool HaveTextureBufferExt; /* TEXTUREBUFFER */
- FxBool HaveTexFmtExt; /* TEXFMT */
- FxBool HaveTexUMAExt; /* TEXUMA */
- FxBool HaveMirrorExt; /* MIRROR */
- FxBool HaveTexus2; /* Texus 2 - FXT1 */
-
- /* Glide library function pointers */
- void (*grDrawPoint)( const void *pt );
- void (*grDrawLine)( const void *v1, const void *v2 );
- void (*grDrawTriangle)( const void *a, const void *b, const void *c );
- void (*grVertexLayout)(FxU32 param, FxI32 offset, FxU32 mode);
- void (*grDrawVertexArray)(FxU32 mode, FxU32 Count, void *pointers);
- void (*grDrawVertexArrayContiguous)(FxU32 mode, FxU32 Count,
- void *pointers, FxU32 stride);
- void (*grBufferClear)( GrColor_t color, GrAlpha_t alpha, FxU32 depth );
- void (*grBufferSwap)( FxU32 swap_interval );
- void (*grRenderBuffer)( GrBuffer_t buffer );
- void (*grErrorSetCallback)( GrErrorCallbackFnc_t fnc );
- void (*grFinish)(void);
- void (*grFlush)(void);
- GrContext_t (*grSstWinOpen)(FxU32 hWnd,
- GrScreenResolution_t screen_resolution,
- GrScreenRefresh_t refresh_rate,
- GrColorFormat_t color_format,
- GrOriginLocation_t origin_location,
- int nColBuffers,
- int nAuxBuffers);
- void (*grSstWinClose)( GrContext_t context );
-/* Not used */
-#if 0
- void (*grSetNumPendingBuffers)(FxI32 NumPendingBuffers);
-#endif
- void (*grSelectContext)( GrContext_t context );
- void (*grSstOrigin)(GrOriginLocation_t origin);
- void (*grSstSelect)( int which_sst );
- void (*grAlphaBlendFunction)(GrAlphaBlendFnc_t rgb_sf,
- GrAlphaBlendFnc_t rgb_df,
- GrAlphaBlendFnc_t alpha_sf,
- GrAlphaBlendFnc_t alpha_df);
- void (*grAlphaCombine)(GrCombineFunction_t function,
- GrCombineFactor_t factor,
- GrCombineLocal_t local, GrCombineOther_t other,
- FxBool invert);
- void (*grAlphaControlsITRGBLighting)( FxBool enable );
- void (*grAlphaTestFunction)( GrCmpFnc_t function );
- void (*grAlphaTestReferenceValue)( GrAlpha_t value );
- void (*grChromakeyMode)( GrChromakeyMode_t mode );
- void (*grChromakeyValue)( GrColor_t value );
- void (*grClipWindow)( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy );
- void (*grColorCombine)( GrCombineFunction_t function,
- GrCombineFactor_t factor,
- GrCombineLocal_t local,
- GrCombineOther_t other,
- FxBool invert );
- void (*grColorMask)( FxBool rgb, FxBool a );
- void (*grCullMode)( GrCullMode_t mode );
- void (*grConstantColorValue)( GrColor_t value );
- void (*grDepthBiasLevel)( FxI32 level );
- void (*grDepthBufferFunction)( GrCmpFnc_t function );
- void (*grDepthBufferMode)( GrDepthBufferMode_t mode );
- void (*grDepthMask)( FxBool mask );
- void (*grDisableAllEffects)( void );
- void (*grDitherMode)( GrDitherMode_t mode );
- void (*grFogColorValue)( GrColor_t fogcolor );
- void (*grFogMode)( GrFogMode_t mode );
- void (*grFogTable)( const GrFog_t ft[] );
- void (*grLoadGammaTable)( FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
- void (*grSplash)(float x, float y, float width, float height, FxU32 frame);
- FxU32 (*grGet)( FxU32 pname, FxU32 plength, FxI32 *params );
- const char * (*grGetString)( FxU32 pname );
- FxI32 (*grQueryResolutions)( const GrResolution *resTemplate,
- GrResolution *output );
- FxBool (*grReset)( FxU32 what );
- GrProc (*grGetProcAddress)( char *procName );
- void (*grEnable)( GrEnableMode_t mode );
- void (*grDisable)( GrEnableMode_t mode );
- void (*grCoordinateSpace)( GrCoordinateSpaceMode_t mode );
- void (*grDepthRange)( FxFloat n, FxFloat f );
- void (*grStippleMode)( GrStippleMode_t mode );
- void (*grStipplePattern)( GrStipplePattern_t mode );
- void (*grViewport)( FxI32 x, FxI32 y, FxI32 width, FxI32 height );
- FxU32 (*grTexCalcMemRequired)(GrLOD_t lodmin, GrLOD_t lodmax,
- GrAspectRatio_t aspect, GrTextureFormat_t fmt);
- FxU32 (*grTexTextureMemRequired)( FxU32 evenOdd, GrTexInfo *info );
- FxU32 (*grTexMinAddress)( GrChipID_t tmu );
- FxU32 (*grTexMaxAddress)( GrChipID_t tmu );
- void (*grTexNCCTable)( GrNCCTable_t table );
- void (*grTexSource)( GrChipID_t tmu, FxU32 startAddress,
- FxU32 evenOdd, GrTexInfo *info );
- void (*grTexClampMode)( GrChipID_t tmu,
- GrTextureClampMode_t s_clampmode,
- GrTextureClampMode_t t_clampmode );
- void (*grTexCombine)( GrChipID_t tmu,
- GrCombineFunction_t rgb_function,
- GrCombineFactor_t rgb_factor,
- GrCombineFunction_t alpha_function,
- GrCombineFactor_t alpha_factor,
- FxBool rgb_invert,
- FxBool alpha_invert);
- void (*grTexDetailControl)( GrChipID_t tmu, int lod_bias,
- FxU8 detail_scale, float detail_max );
- void (*grTexFilterMode)( GrChipID_t tmu,
- GrTextureFilterMode_t minfilter_mode,
- GrTextureFilterMode_t magfilter_mode );
- void (*grTexLodBiasValue)(GrChipID_t tmu, float bias );
- void (*grTexDownloadMipMap)( GrChipID_t tmu, FxU32 startAddress,
- FxU32 evenOdd, GrTexInfo *info );
- void (*grTexDownloadMipMapLevel)( GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLod,
- GrLOD_t largeLod,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 evenOdd,
- void *data );
- FxBool (*grTexDownloadMipMapLevelPartial)( GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLod,
- GrLOD_t largeLod,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 evenOdd,
- void *data,
- int start,
- int end );
- void (*grTexDownloadTable)( GrTexTable_t type, void *data );
- void (*grTexDownloadTablePartial)( GrTexTable_t type,
- void *data, int start, int end );
- void (*grTexMipMapMode)( GrChipID_t tmu, GrMipMapMode_t mode,
- FxBool lodBlend );
- void (*grTexMultibase)( GrChipID_t tmu, FxBool enable );
- void (*grTexMultibaseAddress)( GrChipID_t tmu,
- GrTexBaseRange_t range,
- FxU32 startAddress,
- FxU32 evenOdd,
- GrTexInfo *info );
- FxBool (*grLfbLock)( GrLock_t type, GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode,
- GrOriginLocation_t origin, FxBool pixelPipeline,
- GrLfbInfo_t *info );
- FxBool (*grLfbUnlock)( GrLock_t type, GrBuffer_t buffer );
- void (*grLfbConstantAlpha)( GrAlpha_t alpha );
- void (*grLfbConstantDepth)( FxU32 depth );
- void (*grLfbWriteColorSwizzle)(FxBool swizzleBytes, FxBool swapWords);
- void (*grLfbWriteColorFormat)(GrColorFormat_t colorFormat);
- FxBool (*grLfbWriteRegion)( GrBuffer_t dst_buffer,
- FxU32 dst_x, FxU32 dst_y,
- GrLfbSrcFmt_t src_format,
- FxU32 src_width, FxU32 src_height,
- FxBool pixelPipeline,
- FxI32 src_stride, void *src_data );
- FxBool (*grLfbReadRegion)( GrBuffer_t src_buffer,
- FxU32 src_x, FxU32 src_y,
- FxU32 src_width, FxU32 src_height,
- FxU32 dst_stride, void *dst_data );
- void (*grGlideInit)( void );
- void (*grGlideShutdown)( void );
- void (*grGlideGetState)( void *state );
- void (*grGlideSetState)( const void *state );
- void (*grGlideGetVertexLayout)( void *layout );
- void (*grGlideSetVertexLayout)( const void *layout );
- /* Glide utility functions */
- void (*guFogGenerateExp)( GrFog_t *fogtable, float density );
- void (*guFogGenerateExp2)( GrFog_t *fogtable, float density );
- void (*guFogGenerateLinear)(GrFog_t *fogtable, float nearZ, float farZ );
- /* DRI functions */
- void (*grDRIOpen)( char *pFB, char *pRegs, int deviceID,
- int width, int height,
- int mem, int cpp, int stride,
- int fifoOffset, int fifoSize,
- int fbOffset, int backOffset, int depthOffset,
- int textureOffset, int textureSize,
- volatile int *fifoPtr, volatile int *fifoRead );
- void (*grDRIPosition)( int x, int y, int w, int h,
- int numClip, drm_clip_rect_t *pClip );
- void (*grDRILostContext)( void );
- void (*grDRIImportFifo)( int fifoPtr, int fifoRead );
- void (*grDRIInvalidateAll)( void );
- void (*grDRIResetSAREA)( void );
- void (*grDRIBufferSwap)( FxU32 swapInterval );
- /* Glide extensions */
- /* PIXEXT extension */
- void (*grStencilFunc)( GrCmpFnc_t func, GrStencil_t ref, GrStencil_t mask );
- void (*grStencilMask)( GrStencil_t mask );
- void (*grStencilOp)( GrStencilOp_t fail, GrStencilOp_t zfail,
- GrStencilOp_t zpass );
- void (*grBufferClearExt)( GrColor_t color, GrAlpha_t alpha,
- FxU32 depth, GrStencil_t stencil );
- void (*grColorMaskExt)( FxBool r, FxBool g, FxBool b, FxBool a );
- /* COMBINE extension */
- void (*grColorCombineExt)( GrCCUColor_t a, GrCombineMode_t a_mode,
- GrCCUColor_t b, GrCombineMode_t b_mode,
- GrCCUColor_t c, FxBool c_invert,
- GrCCUColor_t d, FxBool d_invert,
- FxU32 shift, FxBool invert );
- void (*grTexColorCombineExt)( FxU32 tmu,
- GrTCCUColor_t a, GrCombineMode_t a_mode,
- GrTCCUColor_t b, GrCombineMode_t b_mode,
- GrTCCUColor_t c, FxBool c_invert,
- GrTCCUColor_t d, FxBool d_invert,
- FxU32 shift, FxBool invert );
- void (*grAlphaCombineExt)( GrACUColor_t a, GrCombineMode_t a_mode,
- GrACUColor_t b, GrCombineMode_t b_mode,
- GrACUColor_t c, FxBool c_invert,
- GrACUColor_t d, FxBool d_invert,
- FxU32 shift, FxBool invert );
- void (*grTexAlphaCombineExt)( FxU32 tmu,
- GrTACUColor_t a, GrCombineMode_t a_mode,
- GrTACUColor_t b, GrCombineMode_t b_mode,
- GrTACUColor_t c, FxBool c_invert,
- GrTACUColor_t d, FxBool d_invert,
- FxU32 shift, FxBool invert );
- void (*grAlphaBlendFunctionExt)( GrAlphaBlendFnc_t rgb_sf,
- GrAlphaBlendFnc_t rgb_df,
- GrAlphaBlendOp_t rgb_op,
- GrAlphaBlendFnc_t alpha_sf,
- GrAlphaBlendFnc_t alpha_df,
- GrAlphaBlendOp_t alpha_op );
- void (*grConstantColorValueExt)( FxU32 tmu, GrColor_t value );
- /* Texus 2 */
- void (*txImgQuantize)( void *xxx_unknown_arguments );
- void (*txImgDequantizeFXT1)( void *txMip, void *pxMip );
- void (*txErrorSetCallback)( void *fnc );
-};
-
-typedef void (*tdfx_tri_func)( tdfxContextPtr, tdfxVertex *, tdfxVertex *,
- tdfxVertex * );
-typedef void (*tdfx_line_func)( tdfxContextPtr, tdfxVertex *, tdfxVertex * );
-typedef void (*tdfx_point_func)( tdfxContextPtr, tdfxVertex * );
-
-struct tdfx_context {
- /* Set once and never changed:
- */
- GLcontext *glCtx; /* The core Mesa context */
-
- GLuint new_gl_state;
- GLuint new_state;
- GLuint dirty;
-
- /* Mirror of hardware state, Glide parameters
- */
- GLuint tmu_source[TDFX_NUM_TMU];
- struct tdfx_texsource TexSource[TDFX_NUM_TMU];
- struct tdfx_texparams TexParams[TDFX_NUM_TMU];
- struct tdfx_texpalette TexPalette;
-
- /* Voodoo3 texture/color combine state */
- struct tdfx_combine ColorCombine;
- struct tdfx_combine AlphaCombine;
- struct tdfx_texcombine TexCombine[TDFX_NUM_TMU];
-
- /* Voodoo5 texture/color combine state */
- struct tdfx_combine_color_ext ColorCombineExt;
- struct tdfx_combine_alpha_ext AlphaCombineExt;
- struct tdfx_texcombine_ext TexCombineExt[TDFX_NUM_TMU];
-
- /* Tracks tex state difference between Glide and Mesa */
- struct tdfx_texstate TexState;
-
- GrBuffer_t DrawBuffer; /* Current draw buffer */
- GrBuffer_t ReadBuffer; /* Current read buffer */
-
- struct tdfx_color Color;
- struct tdfx_depth Depth;
- struct tdfx_fog Fog;
- struct tdfx_stencil Stencil;
- struct tdfx_scissor Scissor;
- struct tdfx_viewport Viewport;
- struct tdfx_stipple Stipple;
-
- GrCullMode_t CullMode;
-
- struct tdfx_glide Glide;
-
- /* Fallback rasterization functions
- */
- tdfx_point_func draw_point;
- tdfx_line_func draw_line;
- tdfx_tri_func draw_triangle;
-
-
- /* Variable-size Glide vertex formats
- */
- GLuint vertexFormat; /* the current format */
- void *layout[TDFX_NUM_LAYOUTS];
- tdfxVertex *verts;
-
- GLfloat hw_viewport[16];
-
- GLuint SetupIndex;
- GLuint SetupNewInputs;
- GLuint RenderIndex;
- GLuint Fallback;
- GLenum render_primitive; /* what GL thinks */
- GLenum raster_primitive; /* what the hardware thinks */
-
- GLfloat sScale0, tScale0;
- GLfloat sScale1, tScale1;
-
- GLuint texBindNumber;
- GLint tmuSrc;
-
- int screen_width;
- int screen_height;
-
- GLboolean haveTwoTMUs; /* True if we have 2 tmu's */
- GLboolean haveHwAlpha;
- GLboolean haveHwStencil;
- GLboolean haveHwStipple;
-
- GLint maxPendingSwapBuffers;
-
- char rendererString[100];
-
- /* stuff added for DRI */
- __DRIscreenPrivate *driScreen;
- __DRIcontextPrivate *driContext;
- __DRIdrawablePrivate *driDrawable;
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
- tdfxScreenPrivate *fxScreen;
- TDFXSAREAPriv *sarea;
-
-
- /*
- * Changes during execution:
- */
- int width, height; /* size of window */
- int x_offset; /* distance from window left to screen left */
- int y_offset; /* distance from window top to screen top */
- int y_delta; /* distance from window bottom to screen bottom */
-
- int numClipRects;
- drm_clip_rect_t *pClipRects;
- GLboolean scissoredClipRects; /* if true, pClipRects is private storage */
-
- GuTexPalette glbPalette; /* global texture palette */
-
- tdfxStats stats;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-};
-
-#define TDFX_CONTEXT(ctx) ((tdfxContextPtr)((ctx)->DriverCtx))
-
-
-extern GLboolean
-tdfxCreateContext( const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate );
-
-extern void
-tdfxDestroyContext( __DRIcontextPrivate *driContextPriv );
-
-extern GLboolean
-tdfxUnbindContext( __DRIcontextPrivate *driContextPriv );
-
-extern GLboolean
-tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv );
-
-extern GLboolean
-tdfxInitGlide( tdfxContextPtr tmesa );
-
-extern void
-FX_grColorMaskv(GLcontext *ctx, const GLboolean rgba[4]);
-
-extern void
-FX_grColorMaskv_NoLock(GLcontext *ctx, const GLboolean rgba[4]);
-
-
-/* Color packing utilities
- */
-#define TDFXPACKCOLOR332( r, g, b ) \
- (((b) & 0xe0) | (((g) & 0xe0) >> 3) | (((r) & 0xc0) >> 6))
-
-#define TDFXPACKCOLOR1555( r, g, b, a ) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define TDFXPACKCOLOR565( r, g, b ) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define TDFXPACKCOLOR888( r, g, b ) \
- (((b) << 16) | ((g) << 8) | (r))
-
-#define TDFXPACKCOLOR8888( r, g, b, a ) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define TDFXPACKCOLOR4444( r, g, b, a ) \
- ((((a) & 0xf0) << 8) | (((b) & 0xf0) << 4) | ((g) & 0xf0) | ((r) >> 4))
-
-static __inline__ GrColor_t tdfxPackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return TDFXPACKCOLOR565( r, g, b );
- case 4:
- return TDFXPACKCOLOR8888( r, g, b, a );
- default:
- return 0;
- }
-}
-
-#define DO_DEBUG 1
-#if DO_DEBUG
-extern int TDFX_DEBUG;
-#else
-#define TDFX_DEBUG 0
-#endif
-
-#define DEBUG_ALWAYS_SYNC 0x01
-#define DEBUG_VERBOSE_API 0x02
-#define DEBUG_VERBOSE_DRI 0x04
-#define DEBUG_VERBOSE_FALL 0x08
-
-/* conf */
-#define FX_COMPRESS_S3TC_AS_FXT1_HACK 1
-#define FX_TC_NAPALM 0
-
-#endif /* __TDFX_CONTEXT_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.c
deleted file mode 100644
index 02fbace5b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.10 2002/10/30 12:52:00 alanh Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#include "tdfx_context.h"
-#include "tdfx_dd.h"
-#include "tdfx_lock.h"
-#include "tdfx_vb.h"
-#include "tdfx_pixels.h"
-
-#include "context.h"
-#include "enums.h"
-#include "framebuffer.h"
-#include "swrast/swrast.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-
-
-#define TDFX_DATE "20040719"
-
-
-/* These are used in calls to FX_grColorMaskv() */
-const GLboolean false4[4] = { GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE };
-const GLboolean true4[4] = { GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE };
-
-
-
-/* KW: Put the word Mesa in the render string because quakeworld
- * checks for this rather than doing a glGet(GL_MAX_TEXTURE_SIZE).
- * Why?
- */
-static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
-{
- tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
-
- switch ( name ) {
- case GL_RENDERER:
- {
- /* The renderer string must be per-context state to handle
- * multihead correctly.
- */
- char *buffer = fxMesa->rendererString;
- char hardware[100];
-
- LOCK_HARDWARE(fxMesa);
- strcpy( hardware, fxMesa->Glide.grGetString(GR_HARDWARE) );
- UNLOCK_HARDWARE(fxMesa);
-
- strcpy( buffer, "Mesa DRI " );
- strcat( buffer, TDFX_DATE );
- strcat( buffer, " " );
-
- if ( strcmp( hardware, "Voodoo3 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo3" );
- }
- else if ( strcmp( hardware, "Voodoo Banshee (tm)" ) == 0 ) {
- strcat( buffer, "VoodooBanshee" );
- }
- else if ( strcmp( hardware, "Voodoo4 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo4" );
- }
- else if ( strcmp( hardware, "Voodoo5 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo5" );
- }
- else {
- /* unexpected result: replace spaces with hyphens */
- int i;
- for ( i = 0 ; hardware[i] && i < 60 ; i++ ) {
- if ( hardware[i] == ' ' || hardware[i] == '\t' )
- hardware[i] = '-';
- }
- strcat( buffer, hardware );
- }
-
- /* Append any CPU-specific information.
- */
-#ifdef USE_X86_ASM
- if ( _mesa_x86_cpu_features ) {
- strncat( buffer, " x86", 4 );
- }
-#endif
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- strncat( buffer, "/MMX", 4 );
- }
-#endif
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- strncat( buffer, "/3DNow!", 7 );
- }
-#endif
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- strncat( buffer, "/SSE", 4 );
- }
-#endif
- return (const GLubyte *) buffer;
- }
- case GL_VENDOR:
- return (const GLubyte *)"VA Linux Systems, Inc.";
- default:
- return NULL;
- }
-}
-
-
-/* Return uptodate buffer size information.
- */
-static void tdfxDDGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- LOCK_HARDWARE( fxMesa );
- *width = fxMesa->width;
- *height = fxMesa->height;
- UNLOCK_HARDWARE( fxMesa );
-}
-
-
-
-/*
- * Return the current value of the occlusion test flag and
- * reset the flag (hardware counters) to false.
- */
-static GLboolean get_occlusion_result( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLboolean result;
-
- LOCK_HARDWARE( fxMesa );
- fxMesa->Glide.grFinish(); /* required to flush the FIFO - FB 21-01-2002 */
-
- if (ctx->Depth.OcclusionTest) {
- if (ctx->OcclusionResult) {
- result = GL_TRUE; /* result of software rendering */
- }
- else {
- FxI32 zfail, in;
- fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &zfail);
- fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, 4, &in);
- /* Geometry is occluded if there is no input (in == 0) */
- /* or if all pixels failed the depth test (zfail == in) */
- /* The < 1 is there because I have empirically seen cases where */
- /* zfail > in.... go figure. FB - 21-01-2002. */
- result = ((in - zfail) < 1 || in == 0) ? GL_FALSE : GL_TRUE;
- }
- }
- else {
- result = ctx->OcclusionResultSaved;
- }
-
- /* reset results now */
- fxMesa->Glide.grReset(GR_STATS_PIXELS);
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
-
- UNLOCK_HARDWARE( fxMesa );
-
- return result;
-}
-
-
-/*
- * We're only implementing this function to handle the
- * GL_OCCLUSTION_TEST_RESULT_HP case. It's special because it
- * has a side-effect: resetting the occlustion result flag.
- */
-static GLboolean tdfxDDGetBooleanv( GLcontext *ctx, GLenum pname,
- GLboolean *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static GLboolean tdfxDDGetDoublev( GLcontext *ctx, GLenum pname,
- GLdouble *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = (GLdouble) get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static GLboolean tdfxDDGetFloatv( GLcontext *ctx, GLenum pname,
- GLfloat *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = (GLfloat) get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static GLboolean tdfxDDGetIntegerv( GLcontext *ctx, GLenum pname,
- GLint *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = (GLint) get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-
-#define VISUAL_EQUALS_RGBA(vis, r, g, b, a) \
- ((vis->redBits == r) && \
- (vis->greenBits == g) && \
- (vis->blueBits == b) && \
- (vis->alphaBits == a))
-
-void tdfxDDInitDriverFuncs( const __GLcontextModes *visual,
- struct dd_function_table *functions )
-{
- if ( MESA_VERBOSE & VERBOSE_DRIVER ) {
- fprintf( stderr, "tdfx: %s()\n", __FUNCTION__ );
- }
-
- functions->GetString = tdfxDDGetString;
- functions->GetBufferSize = tdfxDDGetBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
-
- /* Accelerated paths
- */
- if ( VISUAL_EQUALS_RGBA(visual, 8, 8, 8, 8) )
- {
- functions->DrawPixels = tdfx_drawpixels_R8G8B8A8;
- functions->ReadPixels = tdfx_readpixels_R8G8B8A8;
- }
- else if ( VISUAL_EQUALS_RGBA(visual, 5, 6, 5, 0) )
- {
- functions->ReadPixels = tdfx_readpixels_R5G6B5;
- }
-
- functions->GetBooleanv = tdfxDDGetBooleanv;
- functions->GetDoublev = tdfxDDGetDoublev;
- functions->GetFloatv = tdfxDDGetFloatv;
- functions->GetIntegerv = tdfxDDGetIntegerv;
-}
-
-
-/*
- * These are here for lack of a better place.
- */
-
-void
-FX_grColorMaskv(GLcontext *ctx, const GLboolean rgba[4])
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- LOCK_HARDWARE(fxMesa);
- if (ctx->Visual.redBits == 8) {
- /* 32bpp mode */
- ASSERT( fxMesa->Glide.grColorMaskExt );
- fxMesa->Glide.grColorMaskExt(rgba[RCOMP], rgba[GCOMP],
- rgba[BCOMP], rgba[ACOMP]);
- }
- else {
- /* 16 bpp mode */
- /* we never have an alpha buffer */
- fxMesa->Glide.grColorMask(rgba[RCOMP] || rgba[GCOMP] || rgba[BCOMP],
- GL_FALSE);
- }
- UNLOCK_HARDWARE(fxMesa);
-}
-
-void
-FX_grColorMaskv_NoLock(GLcontext *ctx, const GLboolean rgba[4])
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- if (ctx->Visual.redBits == 8) {
- /* 32bpp mode */
- ASSERT( fxMesa->Glide.grColorMaskExt );
- fxMesa->Glide.grColorMaskExt(rgba[RCOMP], rgba[GCOMP],
- rgba[BCOMP], rgba[ACOMP]);
- }
- else {
- /* 16 bpp mode */
- /* we never have an alpha buffer */
- fxMesa->Glide.grColorMask(rgba[RCOMP] || rgba[GCOMP] || rgba[BCOMP],
- GL_FALSE);
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.h
deleted file mode 100644
index 5ceba9d5f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_dd.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.h,v 1.1 2001/03/21 16:14:27 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __TDFX_DD_H__
-#define __TDFX_DD_H__
-
-#include "context.h"
-
-extern void tdfxDDInitDriverFuncs( const __GLcontextModes *visual,
- struct dd_function_table *functions );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_glide.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_glide.h
deleted file mode 100644
index f077aa678..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_glide.h
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * This file defines macros and types necessary for accessing glide3.
- */
-
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_glide.h,v 1.1 2002/02/22 21:45:03 dawes Exp $ */
-
-#ifndef NEWGLIDE_H
-#define NEWGLIDE_H
-
-#define FX_CALL
-
-typedef unsigned char FxU8;
-typedef signed char FxI8;
-typedef unsigned short FxU16;
-typedef signed short FxI16;
-#if defined(__alpha__) || defined (__LP64__)
-typedef signed int FxI32;
-typedef unsigned int FxU32;
-#else
-typedef signed long FxI32;
-typedef unsigned long FxU32;
-#endif
-typedef unsigned long AnyPtr;
-typedef int FxBool;
-typedef float FxFloat;
-typedef double FxDouble;
-
-typedef unsigned long FxColor_t;
-typedef struct
-{
- float r, g, b, a;
-}
-FxColor4;
-
-typedef FxU32 GrColor_t;
-typedef FxU8 GrAlpha_t;
-typedef FxU32 GrMipMapId_t;
-typedef FxU32 GrStipplePattern_t;
-typedef FxU8 GrFog_t;
-typedef FxU32 GrContext_t;
-typedef int (FX_CALL * GrProc) (void);
-
-#define FXTRUE 1
-#define FXFALSE 0
-
-#define FXBIT(i) (1L << (i))
-
-#define GR_NULL_MIPMAP_HANDLE ((GrMipMapId_t) -1)
-
-#define GR_MIPMAPLEVELMASK_EVEN FXBIT(0)
-#define GR_MIPMAPLEVELMASK_ODD FXBIT(1)
-#define GR_MIPMAPLEVELMASK_BOTH (GR_MIPMAPLEVELMASK_EVEN | GR_MIPMAPLEVELMASK_ODD )
-
-typedef FxI32 GrChipID_t;
-#define GR_TMU0 0x0
-#define GR_TMU1 0x1
-#define GR_TMU2 0x2
-
-#define GR_FBI 0x0
-
-typedef FxI32 GrCombineFunction_t;
-#define GR_COMBINE_FUNCTION_ZERO 0x0
-#define GR_COMBINE_FUNCTION_NONE GR_COMBINE_FUNCTION_ZERO
-#define GR_COMBINE_FUNCTION_LOCAL 0x1
-#define GR_COMBINE_FUNCTION_LOCAL_ALPHA 0x2
-#define GR_COMBINE_FUNCTION_SCALE_OTHER 0x3
-#define GR_COMBINE_FUNCTION_BLEND_OTHER GR_COMBINE_FUNCTION_SCALE_OTHER
-#define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL 0x4
-#define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA 0x5
-#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL 0x6
-#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL 0x7
-#define GR_COMBINE_FUNCTION_BLEND GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL
-#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x8
-#define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL 0x9
-#define GR_COMBINE_FUNCTION_BLEND_LOCAL GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL
-#define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x10
-
-typedef FxI32 GrCombineFactor_t;
-#define GR_COMBINE_FACTOR_ZERO 0x0
-#define GR_COMBINE_FACTOR_NONE GR_COMBINE_FACTOR_ZERO
-#define GR_COMBINE_FACTOR_LOCAL 0x1
-#define GR_COMBINE_FACTOR_OTHER_ALPHA 0x2
-#define GR_COMBINE_FACTOR_LOCAL_ALPHA 0x3
-#define GR_COMBINE_FACTOR_TEXTURE_ALPHA 0x4
-#define GR_COMBINE_FACTOR_TEXTURE_RGB 0x5
-#define GR_COMBINE_FACTOR_DETAIL_FACTOR GR_COMBINE_FACTOR_TEXTURE_ALPHA
-#define GR_COMBINE_FACTOR_LOD_FRACTION 0x5
-#define GR_COMBINE_FACTOR_ONE 0x8
-#define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL 0x9
-#define GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA 0xa
-#define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA 0xb
-#define GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA 0xc
-#define GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA
-#define GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION 0xd
-
-typedef FxI32 GrCombineLocal_t;
-#define GR_COMBINE_LOCAL_ITERATED 0x0
-#define GR_COMBINE_LOCAL_CONSTANT 0x1
-#define GR_COMBINE_LOCAL_NONE GR_COMBINE_LOCAL_CONSTANT
-#define GR_COMBINE_LOCAL_DEPTH 0x2
-
-typedef FxI32 GrCombineOther_t;
-#define GR_COMBINE_OTHER_ITERATED 0x0
-#define GR_COMBINE_OTHER_TEXTURE 0x1
-#define GR_COMBINE_OTHER_CONSTANT 0x2
-#define GR_COMBINE_OTHER_NONE GR_COMBINE_OTHER_CONSTANT
-
-typedef FxI32 GrAlphaSource_t;
-#define GR_ALPHASOURCE_CC_ALPHA 0x0
-#define GR_ALPHASOURCE_ITERATED_ALPHA 0x1
-#define GR_ALPHASOURCE_TEXTURE_ALPHA 0x2
-#define GR_ALPHASOURCE_TEXTURE_ALPHA_TIMES_ITERATED_ALPHA 0x3
-
-typedef FxI32 GrColorCombineFnc_t;
-#define GR_COLORCOMBINE_ZERO 0x0
-#define GR_COLORCOMBINE_CCRGB 0x1
-#define GR_COLORCOMBINE_ITRGB 0x2
-#define GR_COLORCOMBINE_ITRGB_DELTA0 0x3
-#define GR_COLORCOMBINE_DECAL_TEXTURE 0x4
-#define GR_COLORCOMBINE_TEXTURE_TIMES_CCRGB 0x5
-#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB 0x6
-#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_DELTA0 0x7
-#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_ADD_ALPHA 0x8
-#define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA 0x9
-#define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA_ADD_ITRGB 0xa
-#define GR_COLORCOMBINE_TEXTURE_ADD_ITRGB 0xb
-#define GR_COLORCOMBINE_TEXTURE_SUB_ITRGB 0xc
-#define GR_COLORCOMBINE_CCRGB_BLEND_ITRGB_ON_TEXALPHA 0xd
-#define GR_COLORCOMBINE_DIFF_SPEC_A 0xe
-#define GR_COLORCOMBINE_DIFF_SPEC_B 0xf
-#define GR_COLORCOMBINE_ONE 0x10
-
-typedef FxI32 GrAlphaBlendFnc_t;
-#define GR_BLEND_ZERO 0x0
-#define GR_BLEND_SRC_ALPHA 0x1
-#define GR_BLEND_SRC_COLOR 0x2
-#define GR_BLEND_DST_COLOR GR_BLEND_SRC_COLOR
-#define GR_BLEND_DST_ALPHA 0x3
-#define GR_BLEND_ONE 0x4
-#define GR_BLEND_ONE_MINUS_SRC_ALPHA 0x5
-#define GR_BLEND_ONE_MINUS_SRC_COLOR 0x6
-#define GR_BLEND_ONE_MINUS_DST_COLOR GR_BLEND_ONE_MINUS_SRC_COLOR
-#define GR_BLEND_ONE_MINUS_DST_ALPHA 0x7
-#define GR_BLEND_RESERVED_8 0x8
-#define GR_BLEND_RESERVED_9 0x9
-#define GR_BLEND_RESERVED_A 0xa
-#define GR_BLEND_RESERVED_B 0xb
-#define GR_BLEND_RESERVED_C 0xc
-#define GR_BLEND_RESERVED_D 0xd
-#define GR_BLEND_RESERVED_E 0xe
-#define GR_BLEND_ALPHA_SATURATE 0xf
-#define GR_BLEND_PREFOG_COLOR GR_BLEND_ALPHA_SATURATE
-#define GR_BLEND_SAME_COLOR_EXT 0x08
-#define GR_BLEND_ONE_MINUS_SAME_COLOR_EXT 0x09
-
-typedef FxI32 GrAspectRatio_t;
-#define GR_ASPECT_LOG2_8x1 3
-#define GR_ASPECT_LOG2_4x1 2
-#define GR_ASPECT_LOG2_2x1 1
-#define GR_ASPECT_LOG2_1x1 0
-#define GR_ASPECT_LOG2_1x2 -1
-#define GR_ASPECT_LOG2_1x4 -2
-#define GR_ASPECT_LOG2_1x8 -3
-
-typedef FxI32 GrBuffer_t;
-#define GR_BUFFER_FRONTBUFFER 0x0
-#define GR_BUFFER_BACKBUFFER 0x1
-#define GR_BUFFER_AUXBUFFER 0x2
-#define GR_BUFFER_DEPTHBUFFER 0x3
-#define GR_BUFFER_ALPHABUFFER 0x4
-#define GR_BUFFER_TRIPLEBUFFER 0x5
-
-typedef FxI32 GrChromakeyMode_t;
-#define GR_CHROMAKEY_DISABLE 0x0
-#define GR_CHROMAKEY_ENABLE 0x1
-
-typedef FxI32 GrChromaRangeMode_t;
-#define GR_CHROMARANGE_RGB_ALL_EXT 0x0
-
-#define GR_CHROMARANGE_DISABLE_EXT 0x00
-#define GR_CHROMARANGE_ENABLE_EXT 0x01
-
-typedef FxI32 GrTexChromakeyMode_t;
-#define GR_TEXCHROMA_DISABLE_EXT 0x0
-#define GR_TEXCHROMA_ENABLE_EXT 0x1
-
-#define GR_TEXCHROMARANGE_RGB_ALL_EXT 0x0
-
-typedef FxI32 GrCmpFnc_t;
-#define GR_CMP_NEVER 0x0
-#define GR_CMP_LESS 0x1
-#define GR_CMP_EQUAL 0x2
-#define GR_CMP_LEQUAL 0x3
-#define GR_CMP_GREATER 0x4
-#define GR_CMP_NOTEQUAL 0x5
-#define GR_CMP_GEQUAL 0x6
-#define GR_CMP_ALWAYS 0x7
-
-typedef FxI32 GrColorFormat_t;
-#define GR_COLORFORMAT_ARGB 0x0
-#define GR_COLORFORMAT_ABGR 0x1
-
-#define GR_COLORFORMAT_RGBA 0x2
-#define GR_COLORFORMAT_BGRA 0x3
-
-typedef FxI32 GrCullMode_t;
-#define GR_CULL_DISABLE 0x0
-#define GR_CULL_NEGATIVE 0x1
-#define GR_CULL_POSITIVE 0x2
-
-typedef FxI32 GrDepthBufferMode_t;
-#define GR_DEPTHBUFFER_DISABLE 0x0
-#define GR_DEPTHBUFFER_ZBUFFER 0x1
-#define GR_DEPTHBUFFER_WBUFFER 0x2
-#define GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS 0x3
-#define GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS 0x4
-
-typedef FxI32 GrDitherMode_t;
-#define GR_DITHER_DISABLE 0x0
-#define GR_DITHER_2x2 0x1
-#define GR_DITHER_4x4 0x2
-
-typedef FxI32 GrStippleMode_t;
-#define GR_STIPPLE_DISABLE 0x0
-#define GR_STIPPLE_PATTERN 0x1
-#define GR_STIPPLE_ROTATE 0x2
-
-typedef FxI32 GrFogMode_t;
-#define GR_FOG_DISABLE 0x0
-#define GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT 0x1
-#define GR_FOG_WITH_TABLE_ON_Q 0x2
-#define GR_FOG_WITH_TABLE_ON_W GR_FOG_WITH_TABLE_ON_Q
-#define GR_FOG_WITH_ITERATED_Z 0x3
-#define GR_FOG_WITH_ITERATED_ALPHA_EXT 0x4
-#define GR_FOG_MULT2 0x100
-#define GR_FOG_ADD2 0x200
-
-typedef FxU32 GrLock_t;
-#define GR_LFB_READ_ONLY 0x00
-#define GR_LFB_WRITE_ONLY 0x01
-#define GR_LFB_IDLE 0x00
-#define GR_LFB_NOIDLE 0x10
-
-typedef FxI32 GrLfbBypassMode_t;
-#define GR_LFBBYPASS_DISABLE 0x0
-#define GR_LFBBYPASS_ENABLE 0x1
-
-typedef FxI32 GrLfbWriteMode_t;
-#define GR_LFBWRITEMODE_565 0x0
-#define GR_LFBWRITEMODE_555 0x1
-#define GR_LFBWRITEMODE_1555 0x2
-#define GR_LFBWRITEMODE_RESERVED1 0x3
-#define GR_LFBWRITEMODE_888 0x4
-#define GR_LFBWRITEMODE_8888 0x5
-#define GR_LFBWRITEMODE_RESERVED2 0x6
-#define GR_LFBWRITEMODE_RESERVED3 0x7
-#define GR_LFBWRITEMODE_RESERVED4 0x8
-#define GR_LFBWRITEMODE_RESERVED5 0x9
-#define GR_LFBWRITEMODE_RESERVED6 0xa
-#define GR_LFBWRITEMODE_RESERVED7 0xb
-#define GR_LFBWRITEMODE_565_DEPTH 0xc
-#define GR_LFBWRITEMODE_555_DEPTH 0xd
-#define GR_LFBWRITEMODE_1555_DEPTH 0xe
-#define GR_LFBWRITEMODE_ZA16 0xf
-#define GR_LFBWRITEMODE_ANY 0xFF
-
-typedef FxI32 GrOriginLocation_t;
-#define GR_ORIGIN_UPPER_LEFT 0x0
-#define GR_ORIGIN_LOWER_LEFT 0x1
-#define GR_ORIGIN_ANY 0xFF
-
-typedef struct
-{
- int size;
- void *lfbPtr;
- FxU32 strideInBytes;
- GrLfbWriteMode_t writeMode;
- GrOriginLocation_t origin;
-}
-GrLfbInfo_t;
-
-typedef FxI32 GrLOD_t;
-#define GR_LOD_LOG2_2048 0xb
-#define GR_LOD_LOG2_1024 0xa
-#define GR_LOD_LOG2_512 0x9
-#define GR_LOD_LOG2_256 0x8
-#define GR_LOD_LOG2_128 0x7
-#define GR_LOD_LOG2_64 0x6
-#define GR_LOD_LOG2_32 0x5
-#define GR_LOD_LOG2_16 0x4
-#define GR_LOD_LOG2_8 0x3
-#define GR_LOD_LOG2_4 0x2
-#define GR_LOD_LOG2_2 0x1
-#define GR_LOD_LOG2_1 0x0
-
-typedef FxI32 GrMipMapMode_t;
-#define GR_MIPMAP_DISABLE 0x0
-#define GR_MIPMAP_NEAREST 0x1
-#define GR_MIPMAP_NEAREST_DITHER 0x2
-
-typedef FxI32 GrSmoothingMode_t;
-#define GR_SMOOTHING_DISABLE 0x0
-#define GR_SMOOTHING_ENABLE 0x1
-
-typedef FxI32 GrTextureClampMode_t;
-#define GR_TEXTURECLAMP_WRAP 0x0
-#define GR_TEXTURECLAMP_CLAMP 0x1
-#define GR_TEXTURECLAMP_MIRROR_EXT 0x2
-
-typedef FxI32 GrTextureCombineFnc_t;
-#define GR_TEXTURECOMBINE_ZERO 0x0
-#define GR_TEXTURECOMBINE_DECAL 0x1
-#define GR_TEXTURECOMBINE_OTHER 0x2
-#define GR_TEXTURECOMBINE_ADD 0x3
-#define GR_TEXTURECOMBINE_MULTIPLY 0x4
-#define GR_TEXTURECOMBINE_SUBTRACT 0x5
-#define GR_TEXTURECOMBINE_DETAIL 0x6
-#define GR_TEXTURECOMBINE_DETAIL_OTHER 0x7
-#define GR_TEXTURECOMBINE_TRILINEAR_ODD 0x8
-#define GR_TEXTURECOMBINE_TRILINEAR_EVEN 0x9
-#define GR_TEXTURECOMBINE_ONE 0xa
-
-typedef FxI32 GrTextureFilterMode_t;
-#define GR_TEXTUREFILTER_POINT_SAMPLED 0x0
-#define GR_TEXTUREFILTER_BILINEAR 0x1
-
-typedef FxI32 GrTextureFormat_t;
-#define GR_TEXFMT_8BIT 0x0
-#define GR_TEXFMT_RGB_332 GR_TEXFMT_8BIT
-#define GR_TEXFMT_YIQ_422 0x1
-#define GR_TEXFMT_ALPHA_8 0x2
-#define GR_TEXFMT_INTENSITY_8 0x3
-#define GR_TEXFMT_ALPHA_INTENSITY_44 0x4
-#define GR_TEXFMT_P_8 0x5
-#define GR_TEXFMT_RSVD0 0x6
-#define GR_TEXFMT_RSVD1 0x7
-#define GR_TEXFMT_16BIT 0x8
-#define GR_TEXFMT_ARGB_8332 GR_TEXFMT_16BIT
-#define GR_TEXFMT_AYIQ_8422 0x9
-#define GR_TEXFMT_RGB_565 0xa
-#define GR_TEXFMT_ARGB_1555 0xb
-#define GR_TEXFMT_ARGB_4444 0xc
-#define GR_TEXFMT_ALPHA_INTENSITY_88 0xd
-#define GR_TEXFMT_AP_88 0xe
-#define GR_TEXFMT_RSVD2 0xf
-#define GR_TEXFMT_ARGB_CMP_FXT1 0x11
-#define GR_TEXFMT_ARGB_8888 0x12
-#define GR_TEXFMT_YUYV_422 0x13
-#define GR_TEXFMT_UYVY_422 0x14
-#define GR_TEXFMT_AYUV_444 0x15
-#define GR_TEXFMT_ARGB_CMP_DXT1 0x16
-#define GR_TEXFMT_ARGB_CMP_DXT2 0x17
-#define GR_TEXFMT_ARGB_CMP_DXT3 0x18
-#define GR_TEXFMT_ARGB_CMP_DXT4 0x19
-#define GR_TEXFMT_ARGB_CMP_DXT5 0x1A
-
-typedef FxU32 GrTexTable_t;
-#define GR_TEXTABLE_NCC0 0x0
-#define GR_TEXTABLE_NCC1 0x1
-#define GR_TEXTABLE_PALETTE 0x2
-#define GR_TEXTABLE_PALETTE_6666_EXT 0x3
-
-typedef FxU32 GrNCCTable_t;
-#define GR_NCCTABLE_NCC0 0x0
-#define GR_NCCTABLE_NCC1 0x1
-
-typedef FxU32 GrTexBaseRange_t;
-#define GR_TEXBASE_256 0x3
-#define GR_TEXBASE_128 0x2
-#define GR_TEXBASE_64 0x1
-#define GR_TEXBASE_32_TO_1 0x0
-#define GR_TEXBASE_2048 0x7
-#define GR_TEXBASE_1024 0x6
-#define GR_TEXBASE_512 0x5
-#define GR_TEXBASE_256_TO_1 0x4
-
-typedef FxU32 GrEnableMode_t;
-#define GR_MODE_DISABLE 0x0
-#define GR_MODE_ENABLE 0x1
-
-#define GR_AA_ORDERED 0x01
-#define GR_ALLOW_MIPMAP_DITHER 0x02
-#define GR_PASSTHRU 0x03
-#define GR_SHAMELESS_PLUG 0x04
-#define GR_VIDEO_SMOOTHING 0x05
-
-typedef FxU32 GrCoordinateSpaceMode_t;
-#define GR_WINDOW_COORDS 0x00
-#define GR_CLIP_COORDS 0x01
-
-/* Parameters for strips */
-#define GR_PARAM_XY 0x01
-#define GR_PARAM_Z 0x02
-#define GR_PARAM_W 0x03
-#define GR_PARAM_Q 0x04
-#define GR_PARAM_FOG_EXT 0x05
-
-#define GR_PARAM_A 0x10
-
-#define GR_PARAM_RGB 0x20
-
-#define GR_PARAM_PARGB 0x30
-
-#define GR_PARAM_ST0 0x40
-#define GR_PARAM_ST1 GR_PARAM_ST0+1
-#define GR_PARAM_ST2 GR_PARAM_ST0+2
-
-#define GR_PARAM_Q0 0x50
-#define GR_PARAM_Q1 GR_PARAM_Q0+1
-#define GR_PARAM_Q2 GR_PARAM_Q0+2
-
-#define GR_PARAM_DISABLE 0x00
-#define GR_PARAM_ENABLE 0x01
-
-/* grDrawVertexArray/grDrawVertexArrayContiguous */
-#define GR_POINTS 0
-#define GR_LINE_STRIP 1
-#define GR_LINES 2
-#define GR_POLYGON 3
-#define GR_TRIANGLE_STRIP 4
-#define GR_TRIANGLE_FAN 5
-#define GR_TRIANGLES 6
-#define GR_TRIANGLE_STRIP_CONTINUE 7
-#define GR_TRIANGLE_FAN_CONTINUE 8
-
-/* grGet/grReset */
-#define GR_BITS_DEPTH 0x01
-#define GR_BITS_RGBA 0x02
-#define GR_FIFO_FULLNESS 0x03
-#define GR_FOG_TABLE_ENTRIES 0x04
-#define GR_GAMMA_TABLE_ENTRIES 0x05
-#define GR_GLIDE_STATE_SIZE 0x06
-#define GR_GLIDE_VERTEXLAYOUT_SIZE 0x07
-#define GR_IS_BUSY 0x08
-#define GR_LFB_PIXEL_PIPE 0x09
-#define GR_MAX_TEXTURE_SIZE 0x0a
-#define GR_MAX_TEXTURE_ASPECT_RATIO 0x0b
-#define GR_MEMORY_FB 0x0c
-#define GR_MEMORY_TMU 0x0d
-#define GR_MEMORY_UMA 0x0e
-#define GR_NUM_BOARDS 0x0f
-#define GR_NON_POWER_OF_TWO_TEXTURES 0x10
-#define GR_NUM_FB 0x11
-#define GR_NUM_SWAP_HISTORY_BUFFER 0x12
-#define GR_NUM_TMU 0x13
-#define GR_PENDING_BUFFERSWAPS 0x14
-#define GR_REVISION_FB 0x15
-#define GR_REVISION_TMU 0x16
-#define GR_STATS_LINES 0x17
-#define GR_STATS_PIXELS_AFUNC_FAIL 0x18
-#define GR_STATS_PIXELS_CHROMA_FAIL 0x19
-#define GR_STATS_PIXELS_DEPTHFUNC_FAIL 0x1a
-#define GR_STATS_PIXELS_IN 0x1b
-#define GR_STATS_PIXELS_OUT 0x1c
-#define GR_STATS_PIXELS 0x1d
-#define GR_STATS_POINTS 0x1e
-#define GR_STATS_TRIANGLES_IN 0x1f
-#define GR_STATS_TRIANGLES_OUT 0x20
-#define GR_STATS_TRIANGLES 0x21
-#define GR_SWAP_HISTORY 0x22
-#define GR_SUPPORTS_PASSTHRU 0x23
-#define GR_TEXTURE_ALIGN 0x24
-#define GR_VIDEO_POSITION 0x25
-#define GR_VIEWPORT 0x26
-#define GR_WDEPTH_MIN_MAX 0x27
-#define GR_ZDEPTH_MIN_MAX 0x28
-#define GR_VERTEX_PARAMETER 0x29
-#define GR_BITS_GAMMA 0x2a
-#define GR_GET_RESERVED_1 0x1000
-
-/* grGetString types */
-#define GR_EXTENSION 0xa0
-#define GR_HARDWARE 0xa1
-#define GR_RENDERER 0xa2
-#define GR_VENDOR 0xa3
-#define GR_VERSION 0xa4
-
-typedef FxI32 GrScreenRefresh_t;
-#define GR_REFRESH_NONE 0xff
-
-typedef FxI32 GrScreenResolution_t;
-#define GR_RESOLUTION_NONE 0xff
-
-typedef struct
-{
- GrLOD_t smallLodLog2;
- GrLOD_t largeLodLog2;
- GrAspectRatio_t aspectRatioLog2;
- GrTextureFormat_t format;
- void *data;
-}
-GrTexInfo;
-
-typedef struct GrSstPerfStats_s
-{
- FxU32 pixelsIn;
- FxU32 chromaFail;
- FxU32 zFuncFail;
- FxU32 aFuncFail;
- FxU32 pixelsOut;
-}
-GrSstPerfStats_t;
-
-typedef struct
-{
- GrScreenResolution_t resolution;
- GrScreenRefresh_t refresh;
- int numColorBuffers;
- int numAuxBuffers;
-}
-GrResolution;
-
-typedef GrResolution GlideResolution;
-#define GR_QUERY_ANY ((FxU32)(~0))
-
-typedef FxU32 GrLfbSrcFmt_t;
-#define GR_LFB_SRC_FMT_565 0x00
-#define GR_LFB_SRC_FMT_555 0x01
-#define GR_LFB_SRC_FMT_1555 0x02
-#define GR_LFB_SRC_FMT_888 0x04
-#define GR_LFB_SRC_FMT_8888 0x05
-#define GR_LFB_SRC_FMT_565_DEPTH 0x0c
-#define GR_LFB_SRC_FMT_555_DEPTH 0x0d
-#define GR_LFB_SRC_FMT_1555_DEPTH 0x0e
-#define GR_LFB_SRC_FMT_ZA16 0x0f
-#define GR_LFB_SRC_FMT_RLE16 0x80
-
-typedef FxU32 GrPixelFormat_t;
-#define GR_PIXFMT_I_8 0x0001
-#define GR_PIXFMT_AI_88 0x0002
-#define GR_PIXFMT_RGB_565 0x0003
-#define GR_PIXFMT_ARGB_1555 0x0004
-#define GR_PIXFMT_ARGB_8888 0x0005
-#define GR_PIXFMT_AA_2_RGB_565 0x0006
-#define GR_PIXFMT_AA_2_ARGB_1555 0x0007
-#define GR_PIXFMT_AA_2_ARGB_8888 0x0008
-#define GR_PIXFMT_AA_4_RGB_565 0x0009
-#define GR_PIXFMT_AA_4_ARGB_1555 0x000a
-#define GR_PIXFMT_AA_4_ARGB_8888 0x000b
-
-#define GR_LFBWRITEMODE_Z32 0x0008
-
-typedef FxU32 GrAAMode_t;
-#define GR_AA_NONE 0x0000
-#define GR_AA_4SAMPLES 0x0001
-
-typedef FxU8 GrStencil_t;
-
-typedef FxU32 GrStencilOp_t;
-#define GR_STENCILOP_KEEP 0x00
-#define GR_STENCILOP_ZERO 0x01
-#define GR_STENCILOP_REPLACE 0x02
-#define GR_STENCILOP_INCR_CLAMP 0x03
-#define GR_STENCILOP_DECR_CLAMP 0x04
-#define GR_STENCILOP_INVERT 0x05
-#define GR_STENCILOP_INCR_WRAP 0x06
-#define GR_STENCILOP_DECR_WRAP 0x07
-
-#define GR_TEXTURE_UMA_EXT 0x06
-#define GR_STENCIL_MODE_EXT 0x07
-#define GR_OPENGL_MODE_EXT 0x08
-
-typedef FxU32 GrCCUColor_t;
-typedef FxU32 GrACUColor_t;
-typedef FxU32 GrTCCUColor_t;
-typedef FxU32 GrTACUColor_t;
-#define GR_CMBX_ZERO 0x00
-#define GR_CMBX_TEXTURE_ALPHA 0x01
-#define GR_CMBX_ALOCAL 0x02
-#define GR_CMBX_AOTHER 0x03
-#define GR_CMBX_B 0x04
-#define GR_CMBX_CONSTANT_ALPHA 0x05
-#define GR_CMBX_CONSTANT_COLOR 0x06
-#define GR_CMBX_DETAIL_FACTOR 0x07
-#define GR_CMBX_ITALPHA 0x08
-#define GR_CMBX_ITRGB 0x09
-#define GR_CMBX_LOCAL_TEXTURE_ALPHA 0x0a
-#define GR_CMBX_LOCAL_TEXTURE_RGB 0x0b
-#define GR_CMBX_LOD_FRAC 0x0c
-#define GR_CMBX_OTHER_TEXTURE_ALPHA 0x0d
-#define GR_CMBX_OTHER_TEXTURE_RGB 0x0e
-#define GR_CMBX_TEXTURE_RGB 0x0f
-#define GR_CMBX_TMU_CALPHA 0x10
-#define GR_CMBX_TMU_CCOLOR 0x11
-
-typedef FxU32 GrCombineMode_t;
-#define GR_FUNC_MODE_ZERO 0x00
-#define GR_FUNC_MODE_X 0x01
-#define GR_FUNC_MODE_ONE_MINUS_X 0x02
-#define GR_FUNC_MODE_NEGATIVE_X 0x03
-#define GR_FUNC_MODE_X_MINUS_HALF 0x04
-
-typedef FxU32 GrAlphaBlendOp_t;
-#define GR_BLEND_OP_ADD 0x00
-#define GR_BLEND_OP_SUB 0x01
-#define GR_BLEND_OP_REVSUB 0x02
-
-typedef struct
-{
- FxU32 data[256];
-}
-GuTexPalette;
-
-typedef void (*GrErrorCallbackFnc_t) (const char *string, FxBool fatal);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.c
deleted file mode 100644
index 6bbfb8d3a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c,v 1.5 2002/12/16 16:19:00 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include "tdfx_context.h"
-#include "tdfx_lock.h"
-#include "tdfx_state.h"
-#include "tdfx_render.h"
-#include "tdfx_texman.h"
-#include "tdfx_tris.h"
-
-
-void tdfxGetLock( tdfxContextPtr fxMesa )
-{
- __DRIcontextPrivate *cPriv = fxMesa->driContext;
- __DRIdrawablePrivate *dPriv = cPriv->driDrawablePriv;
- __DRIscreenPrivate *sPriv = dPriv->driScreenPriv;
- TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) (((char *) sPriv->pSAREA) +
- fxMesa->fxScreen->sarea_priv_offset);
- unsigned int stamp = dPriv->lastStamp;
-
- drmGetLock( fxMesa->driFd, fxMesa->hHWContext, 0 );
-
- /* This macro will update dPriv's cliprects if needed */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if ( saPriv->fifoOwner != fxMesa->hHWContext ) {
- fxMesa->Glide.grDRIImportFifo( saPriv->fifoPtr, saPriv->fifoRead );
- }
-
- if ( saPriv->ctxOwner != fxMesa->hHWContext ) {
- /* This sequence looks a little odd. Glide mirrors the state, and
- * when you get the state you are forcing the mirror to be up to
- * date, and then getting a copy from the mirror. You can then force
- * that state onto the hardware when you set the state.
- */
- void *state;
- FxI32 stateSize;
- fxMesa->Glide.grGet(GR_GLIDE_STATE_SIZE, 4, &stateSize);
- state = malloc(stateSize);
- fxMesa->Glide.grGlideGetState( state );
- fxMesa->Glide.grGlideSetState( state );
- free( state );
- }
-
-#if 0
- if ( saPriv->texOwner != fxMesa->hHWContext ) {
- tdfxTMRestoreTextures_NoLock( fxMesa );
- }
-#endif
-
- if ( *dPriv->pStamp != stamp || saPriv->ctxOwner != fxMesa->hHWContext ) {
- tdfxUpdateClipping(fxMesa->glCtx);
- tdfxUploadClipping(fxMesa);
- }
-
- DEBUG_LOCK();
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.h
deleted file mode 100644
index 616e65b2a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_lock.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.h,v 1.3 2002/02/22 21:45:03 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __TDFX_LOCK_H__
-#define __TDFX_LOCK_H__
-
-/* You can turn this on to find locking conflicts.
- */
-#define DEBUG_LOCKING 0
-
-#if DEBUG_LOCKING
-extern char *prevLockFile;
-extern int prevLockLine;
-
-#define DEBUG_LOCK() \
- do { \
- prevLockFile = (__FILE__); \
- prevLockLine = (__LINE__); \
- } while (0)
-
-#define DEBUG_RESET() \
- do { \
- prevLockFile = 0; \
- prevLockLine = 0; \
- } while (0)
-
-#define DEBUG_CHECK_LOCK() \
- do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
- "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
- } \
- } while (0)
-
-#else
-
-#define DEBUG_LOCK()
-#define DEBUG_RESET()
-#define DEBUG_CHECK_LOCK()
-
-#endif /* DEBUG_LOCKING */
-
-
-extern void tdfxGetLock( tdfxContextPtr fxMesa );
-
-
-/* !!! We may want to separate locks from locks with validation.
- This could be used to improve performance for those things
- commands that do not do any drawing !!! */
-
-#define DRM_LIGHT_LOCK_RETURN(fd,lock,context,__ret) \
- do { \
- DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \
- if (__ret) drmGetLock(fd,context,0); \
- } while(0)
-
-#define LOCK_HARDWARE( fxMesa ) \
- do { \
- char __ret = 0; \
- \
- DEBUG_CHECK_LOCK(); \
- DRM_CAS( fxMesa->driHwLock, fxMesa->hHWContext, \
- DRM_LOCK_HELD | fxMesa->hHWContext, __ret ); \
- if ( __ret ) { \
- tdfxGetLock( fxMesa ); \
- } \
- DEBUG_LOCK(); \
- } while (0)
-
-/* Unlock the hardware using the global current context */
-#define UNLOCK_HARDWARE( fxMesa ) \
- do { \
- DRM_UNLOCK( fxMesa->driFd, fxMesa->driHwLock, fxMesa->hHWContext ); \
- DEBUG_RESET(); \
- } while (0)
-
-/*
- * This pair of macros makes a loop over the drawing operations
- * so it is not self contained and doesn't have the nice single
- * statement semantics of most macros.
- */
-#define BEGIN_CLIP_LOOP(fxMesa) \
- do { \
- LOCK_HARDWARE( fxMesa ); \
- BEGIN_CLIP_LOOP_LOCKED( fxMesa )
-
-#define BEGIN_CLIP_LOOP_LOCKED(fxMesa) \
- do { \
- int _nc = fxMesa->numClipRects; \
- while (_nc--) { \
- if (fxMesa->numClipRects > 1) { \
- int _height = fxMesa->screen_height; \
- fxMesa->Glide.grClipWindow(fxMesa->pClipRects[_nc].x1, \
- _height - fxMesa->pClipRects[_nc].y2, \
- fxMesa->pClipRects[_nc].x2, \
- _height - fxMesa->pClipRects[_nc].y1); \
- }
-
-
-#define END_CLIP_LOOP_LOCKED( fxMesa ) \
- } \
- } while (0)
-
-#define END_CLIP_LOOP( fxMesa ) \
- END_CLIP_LOOP_LOCKED( fxMesa ); \
- UNLOCK_HARDWARE( fxMesa ); \
- } while (0)
-
-#endif /* __TDFX_LOCK_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
deleted file mode 100644
index 6592ecccf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c,v 1.4 2002/02/22 21:45:03 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- * Nathan Hand <nhand@valinux.com>
- *
- */
-
-#include "tdfx_context.h"
-#include "tdfx_dd.h"
-#include "tdfx_lock.h"
-#include "tdfx_vb.h"
-#include "tdfx_pixels.h"
-#include "tdfx_render.h"
-
-#include "swrast/swrast.h"
-
-#include "image.h"
-
-
-#define FX_grLfbWriteRegion(fxMesa,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
- do { \
- LOCK_HARDWARE(fxMesa); \
- fxMesa->Glide.grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \
- UNLOCK_HARDWARE(fxMesa); \
- } while(0)
-
-
-#define FX_grLfbReadRegion(fxMesa,src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \
- do { \
- LOCK_HARDWARE(fxMesa); \
- fxMesa->Glide.grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \
- UNLOCK_HARDWARE(fxMesa); \
- } while (0);
-
-
-#if 0
-static FxBool
-FX_grLfbLock(tdfxContextPtr fxMesa, GrLock_t type, GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode, GrOriginLocation_t origin,
- FxBool pixelPipeline, GrLfbInfo_t * info)
-{
- FxBool result;
-
- LOCK_HARDWARE(fxMesa);
- result = fxMesa->Glide.grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info);
- UNLOCK_HARDWARE(fxMesa);
- return result;
-}
-#endif
-
-
-#define FX_grLfbUnlock(fxMesa, t, b) \
- do { \
- LOCK_HARDWARE(fxMesa); \
- fxMesa->Glide.grLfbUnlock(t, b); \
- UNLOCK_HARDWARE(fxMesa); \
- } while (0)
-
-
-
-#if 0
-/* test if window coord (px,py) is visible */
-static GLboolean
-inClipRects(tdfxContextPtr fxMesa, int px, int py)
-{
- int i;
- for (i = 0; i < fxMesa->numClipRects; i++) {
- if ((px >= fxMesa->pClipRects[i].x1) &&
- (px < fxMesa->pClipRects[i].x2) &&
- (py >= fxMesa->pClipRects[i].y1) &&
- (py < fxMesa->pClipRects[i].y2)) return GL_TRUE;
- }
- return GL_FALSE;
-}
-#endif
-
-/* test if rectangle of pixels (px,py) (px+width,py+height) is visible */
-static GLboolean
-inClipRects_Region(tdfxContextPtr fxMesa, int x, int y, int width, int height)
-{
- int i;
- int x1, y1, x2, y2;
- int xmin, xmax, ymin, ymax, pixelsleft;
-
- y1 = y - height + 1; y2 = y;
- x1 = x; x2 = x + width - 1;
- pixelsleft = width * height;
-
- for (i = 0; i < fxMesa->numClipRects; i++)
- {
- /* algorithm requires x1 < x2 and y1 < y2 */
- if ((fxMesa->pClipRects[i].x1 < fxMesa->pClipRects[i].x2)) {
- xmin = fxMesa->pClipRects[i].x1;
- xmax = fxMesa->pClipRects[i].x2-1;
- } else {
- xmin = fxMesa->pClipRects[i].x2;
- xmax = fxMesa->pClipRects[i].x1-1;
- }
- if ((fxMesa->pClipRects[i].y1 < fxMesa->pClipRects[i].y2)) {
- ymin = fxMesa->pClipRects[i].y1;
- ymax = fxMesa->pClipRects[i].y2-1;
- } else {
- ymin = fxMesa->pClipRects[i].y2;
- ymax = fxMesa->pClipRects[i].y1-1;
- }
-
- /* reject trivial cases */
- if (xmax < x1) continue;
- if (ymax < y1) continue;
- if (xmin > x2) continue;
- if (ymin > y2) continue;
-
- /* find the intersection */
- if (xmin < x1) xmin = x1;
- if (ymin < y1) ymin = y1;
- if (xmax > x2) xmax = x2;
- if (ymax > y2) ymax = y2;
-
- pixelsleft -= (xmax-xmin+1) * (ymax-ymin+1);
- }
-
- return pixelsleft == 0;
-}
-
-#if 0
-GLboolean
-tdfx_bitmap_R5G6B5(GLcontext * ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte * bitmap)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- TdfxU16 color;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- /* check if there's any raster operations enabled which we can't handle */
- if (ctx->RasterMask & (ALPHATEST_BIT |
- BLEND_BIT |
- DEPTH_BIT |
- FOG_BIT |
- LOGIC_OP_BIT |
- SCISSOR_BIT |
- STENCIL_BIT |
- MASKING_BIT |
- MULTI_DRAW_BIT)) return GL_FALSE;
-
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (px < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - px);
- width -= (ctx->Scissor.X - px);
- px = ctx->Scissor.X;
- }
- /* clip right */
- if (px + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (px + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (py < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - py);
- height -= (ctx->Scissor.Y - py);
- py = ctx->Scissor.Y;
- }
- /* clip top */
- if (py + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (py + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return GL_TRUE; /* totally scissored away */
- }
- else {
- finalUnpack = unpack;
- }
-
- /* compute pixel value */
- {
- GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0f);
- GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0f);
- GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0f);
- /*GLint a = (GLint)(ctx->Current.RasterColor[3]*255.0f); */
- if (fxMesa->bgrOrder) {
- color = (TdfxU16)
- (((TdfxU16) 0xf8 & b) << (11 - 3)) |
- (((TdfxU16) 0xfc & g) << (5 - 3 + 1)) |
- (((TdfxU16) 0xf8 & r) >> 3);
- }
- else
- color = (TdfxU16)
- (((TdfxU16) 0xf8 & r) << (11 - 3)) |
- (((TdfxU16) 0xfc & g) << (5 - 3 + 1)) |
- (((TdfxU16) 0xf8 & b) >> 3);
- }
-
- info.size = sizeof(info);
- if (!TDFX_grLfbLock(fxMesa,
- GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_565,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
-#ifndef TDFX_SILENT
- fprintf(stderr, "tdfx Driver: error locking the linear frame buffer\n");
-#endif
- return GL_TRUE;
- }
-
- {
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- /* The dest stride depends on the hardware and whether we're drawing
- * to the front or back buffer. This compile-time test seems to do
- * the job for now.
- */
- const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 2);
- GLint row;
- /* compute dest address of bottom-left pixel in bitmap */
- GLushort *dst = (GLushort *) info.lfbPtr
- + (winY - py) * dstStride + (winX + px);
-
- for (row = 0; row < height; row++) {
- const GLubyte *src =
- (const GLubyte *) _mesa_image_address2d(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX,
- GL_BITMAP, row, 0);
- if (finalUnpack->LsbFirst) {
- /* least significan bit first */
- GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- if (inClipRects(fxMesa, winX + px + col, winY - py - row))
- dst[col] = color;
- }
- if (mask == 128U) {
- src++;
- mask = 1U;
- }
- else {
- mask = mask << 1;
- }
- }
- if (mask != 1)
- src++;
- }
- else {
- /* most significan bit first */
- GLubyte mask = 128U >> (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- if (inClipRects(fxMesa, winX + px + col, winY - py - row))
- dst[col] = color;
- }
- if (mask == 1U) {
- src++;
- mask = 128U;
- }
- else {
- mask = mask >> 1;
- }
- }
- if (mask != 128)
- src++;
- }
- dst -= dstStride;
- }
- }
-
- TDFX_grLfbUnlock(fxMesa, GR_LFB_WRITE_ONLY, fxMesa->currentFB);
- return GL_TRUE;
-}
-#endif
-
-#if 0
-GLboolean
-tdfx_bitmap_R8G8B8A8(GLcontext * ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte * bitmap)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- GLuint color;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- /* check if there's any raster operations enabled which we can't handle */
- if (ctx->RasterMask & (ALPHATEST_BIT |
- BLEND_BIT |
- DEPTH_BIT |
- FOG_BIT |
- LOGIC_OP_BIT |
- SCISSOR_BIT |
- STENCIL_BIT |
- MASKING_BIT |
- MULTI_DRAW_BIT)) return GL_FALSE;
-
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (px < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - px);
- width -= (ctx->Scissor.X - px);
- px = ctx->Scissor.X;
- }
- /* clip right */
- if (px + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (px + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (py < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - py);
- height -= (ctx->Scissor.Y - py);
- py = ctx->Scissor.Y;
- }
- /* clip top */
- if (py + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (py + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return GL_TRUE; /* totally scissored away */
- }
- else {
- finalUnpack = unpack;
- }
-
- /* compute pixel value */
- {
- GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0f);
- GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0f);
- GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0f);
- GLint a = (GLint) (ctx->Current.RasterColor[3] * 255.0f);
- color = PACK_BGRA32(r, g, b, a);
- }
-
- info.size = sizeof(info);
- if (!TDFX_grLfbLock(fxMesa, GR_LFB_WRITE_ONLY,
- fxMesa->currentFB, GR_LFBWRITEMODE_8888,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
-#ifndef TDFX_SILENT
- fprintf(stderr, "tdfx Driver: error locking the linear frame buffer\n");
-#endif
- return GL_TRUE;
- }
-
- {
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- GLint dstStride;
- GLuint *dst;
- GLint row;
-
- if (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) {
- dstStride = fxMesa->screen_width;
- dst =
- (GLuint *) info.lfbPtr + (winY - py) * dstStride + (winX +
- px);
- }
- else {
- dstStride = info.strideInBytes / 4;
- dst =
- (GLuint *) info.lfbPtr + (winY - py) * dstStride + (winX +
- px);
- }
-
- /* compute dest address of bottom-left pixel in bitmap */
- for (row = 0; row < height; row++) {
- const GLubyte *src =
- (const GLubyte *) _mesa_image_address2d(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX,
- GL_BITMAP, row, 0);
- if (finalUnpack->LsbFirst) {
- /* least significan bit first */
- GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- if (inClipRects(fxMesa, winX + px + col, winY - py - row))
- dst[col] = color;
- }
- if (mask == 128U) {
- src++;
- mask = 1U;
- }
- else {
- mask = mask << 1;
- }
- }
- if (mask != 1)
- src++;
- }
- else {
- /* most significan bit first */
- GLubyte mask = 128U >> (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- if (inClipRects(fxMesa, winX + px + col, winY - py - row))
- dst[col] = color;
- }
- if (mask == 1U) {
- src++;
- mask = 128U;
- }
- else {
- mask = mask >> 1;
- }
- }
- if (mask != 128)
- src++;
- }
- dst -= dstStride;
- }
- }
-
- TDFX_grLfbUnlock(fxMesa, GR_LFB_WRITE_ONLY, fxMesa->currentFB);
- return GL_TRUE;
-}
-#endif
-
-void
-tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid * dstImage)
-{
- if (format != GL_RGB ||
- type != GL_UNSIGNED_SHORT_5_6_5 ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)))
- {
- _swrast_ReadPixels( ctx, x, y, width, height, format, type, packing,
- dstImage );
- return;
- }
-
- {
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint scrX = winX + x;
- const GLint scrY = winY - y;
-
- LOCK_HARDWARE( fxMesa );
- info.size = sizeof(info);
- if (fxMesa->Glide.grLfbLock(GR_LFB_READ_ONLY,
- fxMesa->ReadBuffer,
- GR_LFBWRITEMODE_ANY,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
- const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer[0] ==
- GL_FRONT) ? (fxMesa->screen_width) : (info.strideInBytes / 2);
- const GLushort *src = (const GLushort *) info.lfbPtr
- + scrY * srcStride + scrX;
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing,
- dstImage, width, height, format, type, 0, 0);
- const GLint dstStride = _mesa_image_row_stride(packing,
- width, format, type);
-
- /* directly memcpy 5R6G5B pixels into client's buffer */
- const GLint widthInBytes = width * 2;
- GLint row;
- for (row = 0; row < height; row++) {
- MEMCPY(dst, src, widthInBytes);
- dst += dstStride;
- src -= srcStride;
- }
-
- fxMesa->Glide.grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->ReadBuffer);
- }
- UNLOCK_HARDWARE( fxMesa );
- return;
- }
-}
-
-void
-tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid * dstImage)
-{
- if ((!(format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) &&
- !(format == GL_BGRA && type == GL_UNSIGNED_BYTE)) ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)))
- {
- _swrast_ReadPixels( ctx, x, y, width, height, format, type, packing,
- dstImage );
- return;
- }
-
-
- {
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint scrX = winX + x;
- const GLint scrY = winY - y;
-
- LOCK_HARDWARE(fxMesa);
- info.size = sizeof(info);
- if (fxMesa->Glide.grLfbLock(GR_LFB_READ_ONLY,
- fxMesa->ReadBuffer,
- GR_LFBWRITEMODE_ANY,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info))
- {
- const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 4);
- const GLuint *src = (const GLuint *) info.lfbPtr
- + scrY * srcStride + scrX;
- const GLint dstStride =
- _mesa_image_row_stride(packing, width, format, type);
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing,
- dstImage, width, height, format, type, 0, 0);
- const GLint widthInBytes = width * 4;
-
- {
- GLint row;
- for (row = 0; row < height; row++) {
- MEMCPY(dst, src, widthInBytes);
- dst += dstStride;
- src -= srcStride;
- }
- }
-
- fxMesa->Glide.grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->ReadBuffer);
- }
- UNLOCK_HARDWARE(fxMesa);
- }
-}
-
-void
-tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid * pixels)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if ((!(format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) &&
- !(format == GL_BGRA && type == GL_UNSIGNED_BYTE)) ||
- ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != 1.0F ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)) ||
- ctx->Color.AlphaEnabled ||
- ctx->Depth.Test ||
- ctx->Fog.Enabled ||
- ctx->Scissor.Enabled ||
- ctx->Stencil.Enabled ||
- !ctx->Color.ColorMask[0] ||
- !ctx->Color.ColorMask[1] ||
- !ctx->Color.ColorMask[2] ||
- !ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits ||
- ctx->Depth.OcclusionTest ||
- fxMesa->Fallback)
- {
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
- return;
- }
-
- {
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- GLboolean result = GL_FALSE;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint scrX = winX + x;
- const GLint scrY = winY - y;
-
- /* lock early to make sure cliprects are right */
- LOCK_HARDWARE(fxMesa);
-
- /* make sure hardware has latest blend funcs */
- if (ctx->Color.BlendEnabled) {
- fxMesa->dirty |= TDFX_UPLOAD_BLEND_FUNC;
- tdfxEmitHwStateLocked( fxMesa );
- }
-
- /* look for clipmasks, giveup if region obscured */
- if (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) {
- if (!inClipRects_Region(fxMesa, scrX, scrY, width, height)) {
- UNLOCK_HARDWARE(fxMesa);
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
- return;
- }
- }
-
- info.size = sizeof(info);
- if (fxMesa->Glide.grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->DrawBuffer,
- GR_LFBWRITEMODE_8888,
- GR_ORIGIN_UPPER_LEFT, FXTRUE, &info))
- {
- const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT)
- ? (fxMesa->screen_width * 4) : (info.strideInBytes);
- GLubyte *dst = (GLubyte *) info.lfbPtr
- + scrY * dstStride + scrX * 4;
- const GLint srcStride =
- _mesa_image_row_stride(unpack, width, format, type);
- const GLubyte *src = (GLubyte *) _mesa_image_address2d(unpack,
- pixels, width, height, format, type, 0, 0);
- const GLint widthInBytes = width * 4;
-
- if ((format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) ||
- (format == GL_BGRA && type == GL_UNSIGNED_BYTE)) {
- GLint row;
- for (row = 0; row < height; row++) {
- MEMCPY(dst, src, widthInBytes);
- dst -= dstStride;
- src += srcStride;
- }
- result = GL_TRUE;
- }
-
- fxMesa->Glide.grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer);
- }
- UNLOCK_HARDWARE(fxMesa);
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.h
deleted file mode 100644
index c38ce070c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_pixels.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.h,v 1.2 2002/02/22 21:45:03 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- * Nathan Hand <nhand@valinux.com>
- *
- */
-
-#ifndef __TDFX_PIXELS_H__
-#define __TDFX_PIXELS_H__
-
-#include "context.h"
-
-extern void
-tdfx_bitmap_R5G6B5( GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap );
-
-extern void
-tdfx_bitmap_R8G8B8A8( GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap );
-
-extern void
-tdfx_readpixels_R5G6B5( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *dstImage );
-
-extern void
-tdfx_readpixels_R8G8B8A8( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *dstImage );
-
-extern void
-tdfx_drawpixels_R8G8B8A8( GLcontext *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c
deleted file mode 100644
index 56f5f147e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c,v 1.4 2002/02/22 21:45:03 dawes Exp $ */
-
-/*
- * New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#include "tdfx_context.h"
-#include "tdfx_render.h"
-#include "tdfx_state.h"
-#include "tdfx_texman.h"
-#include "swrast/swrast.h"
-
-/* Clear the color and/or depth buffers.
- */
-static void tdfxClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
-{
- tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
- const GLuint stencil_size =
- fxMesa->haveHwStencil ? fxMesa->glCtx->Visual.stencilBits : 0;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s( %d, %d, %d, %d )\n",
- __FUNCTION__, (int) x, (int) y, (int) width, (int) height );
- }
-
- /* Need this check to respond to glScissor and clipping updates */
- if ((fxMesa->new_state & (TDFX_NEW_CLIP | TDFX_NEW_DEPTH)) ||
- (fxMesa->dirty & TDFX_UPLOAD_COLOR_MASK)) {
- tdfxDDUpdateHwState(ctx);
- }
-
- /* we can't clear accum buffers */
- mask &= ~(BUFFER_BIT_ACCUM);
-
- if (mask & BUFFER_BIT_STENCIL) {
- if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask[0] != 0xff) {
- /* Napalm seems to have trouble with stencil write masks != 0xff */
- /* do stencil clear in software */
- mask &= ~(BUFFER_BIT_STENCIL);
- softwareMask |= BUFFER_BIT_STENCIL;
- }
- }
-
- if (fxMesa->glCtx->Visual.redBits != 8) {
- /* can only do color masking if running in 24/32bpp on Napalm */
- if (ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP] ||
- ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) {
- softwareMask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT));
- mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
- }
- }
-
- if (fxMesa->haveHwStencil) {
- /*
- * If we want to clear stencil, it must be enabled
- * in the HW, even if the stencil test is not enabled
- * in the OGL state.
- */
- LOCK_HARDWARE(fxMesa);
- if (mask & BUFFER_BIT_STENCIL) {
- fxMesa->Glide.grStencilMask(/*ctx->Stencil.WriteMask*/ 0xff);
- /* set stencil ref value = desired clear value */
- fxMesa->Glide.grStencilFunc(GR_CMP_ALWAYS,
- fxMesa->Stencil.Clear, 0xff);
- fxMesa->Glide.grStencilOp(GR_STENCILOP_REPLACE,
- GR_STENCILOP_REPLACE, GR_STENCILOP_REPLACE);
- fxMesa->Glide.grEnable(GR_STENCIL_MODE_EXT);
- }
- else {
- fxMesa->Glide.grDisable(GR_STENCIL_MODE_EXT);
- }
- UNLOCK_HARDWARE(fxMesa);
- }
-
- /*
- * This may be ugly, but it's needed in order to work around a number
- * of Glide bugs.
- */
- BEGIN_CLIP_LOOP(fxMesa);
- {
- /*
- * This could probably be done fancier but doing each possible case
- * explicitly is less error prone.
- */
- switch (mask & ~BUFFER_BIT_STENCIL) {
- case BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH:
- /* back buffer & depth */
- FX_grColorMaskv_NoLock(ctx, true4); /* work around Voodoo3 bug */
- fxMesa->Glide.grDepthMask(FXTRUE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0) {
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- }
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- if (!ctx->Depth.Mask || !ctx->Depth.Test) {
- fxMesa->Glide.grDepthMask(FXFALSE);
- }
- break;
- case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_DEPTH:
- /* XXX it appears that the depth buffer isn't cleared when
- * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set.
- * This is a work-around/
- */
- /* clear depth */
- fxMesa->Glide.grDepthMask(FXTRUE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grColorMaskv_NoLock(ctx, false4);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- /* clear front */
- FX_grColorMaskv_NoLock(ctx, true4);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- if (!ctx->Depth.Mask || !ctx->Depth.Test) {
- fxMesa->Glide.grDepthMask(FXFALSE);
- }
- break;
- case BUFFER_BIT_BACK_LEFT:
- /* back buffer only */
- fxMesa->Glide.grDepthMask(FXFALSE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- if (ctx->Depth.Mask && ctx->Depth.Test) {
- fxMesa->Glide.grDepthMask(FXTRUE);
- }
- break;
- case BUFFER_BIT_FRONT_LEFT:
- /* front buffer only */
- fxMesa->Glide.grDepthMask(FXFALSE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- if (ctx->Depth.Mask && ctx->Depth.Test) {
- fxMesa->Glide.grDepthMask(FXTRUE);
- }
- break;
- case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT:
- /* front and back */
- fxMesa->Glide.grDepthMask(FXFALSE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- if (ctx->Depth.Mask && ctx->Depth.Test) {
- fxMesa->Glide.grDepthMask(FXTRUE);
- }
- break;
- case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH:
- /* clear front */
- fxMesa->Glide.grDepthMask(FXFALSE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- /* clear back and depth */
- fxMesa->Glide.grDepthMask(FXTRUE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- if (!ctx->Depth.Mask || !ctx->Depth.Mask) {
- fxMesa->Glide.grDepthMask(FXFALSE);
- }
- break;
- case BUFFER_BIT_DEPTH:
- /* just the depth buffer */
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grColorMaskv_NoLock(ctx, false4);
- fxMesa->Glide.grDepthMask(FXTRUE);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- else
- fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear);
- FX_grColorMaskv_NoLock(ctx, true4);
- if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT)
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (!ctx->Depth.Test || !ctx->Depth.Mask)
- fxMesa->Glide.grDepthMask(FXFALSE);
- break;
- default:
- /* clear no color buffers or depth buffer but might clear stencil */
- if (stencil_size > 0 && (mask & BUFFER_BIT_STENCIL)) {
- /* XXX need this RenderBuffer call to work around Glide bug */
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
- fxMesa->Glide.grDepthMask(FXFALSE);
- FX_grColorMaskv_NoLock(ctx, false4);
- fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
- fxMesa->Color.ClearAlpha,
- fxMesa->Depth.Clear,
- (FxU32) ctx->Stencil.Clear);
- if (ctx->Depth.Mask && ctx->Depth.Test) {
- fxMesa->Glide.grDepthMask(FXTRUE);
- }
- FX_grColorMaskv_NoLock(ctx, true4);
- if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT)
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- }
- }
- }
- END_CLIP_LOOP(fxMesa);
-
- if (fxMesa->haveHwStencil && (mask & BUFFER_BIT_STENCIL)) {
- /* We changed the stencil state above. Signal that we need to
- * upload it again.
- */
- fxMesa->dirty |= TDFX_UPLOAD_STENCIL;
- }
-
- if (softwareMask)
- _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
-}
-
-
-
-static void tdfxFinish( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
-
- LOCK_HARDWARE( fxMesa );
- fxMesa->Glide.grFinish();
- UNLOCK_HARDWARE( fxMesa );
-}
-
-static void tdfxFlush( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
-
- LOCK_HARDWARE( fxMesa );
- fxMesa->Glide.grFlush();
- UNLOCK_HARDWARE( fxMesa );
-}
-
-
-#if 0
-static const char *texSource(int k)
-{
- switch (k) {
- case GR_CMBX_ZERO:
- return "GR_CMBX_ZERO";
- case GR_CMBX_TEXTURE_ALPHA:
- return "GR_CMBX_TEXTURE_ALPHA";
- case GR_CMBX_ALOCAL:
- return "GR_CMBX_ALOCAL";
- case GR_CMBX_AOTHER:
- return "GR_CMBX_AOTHER";
- case GR_CMBX_B:
- return "GR_CMBX_B";
- case GR_CMBX_CONSTANT_ALPHA:
- return "GR_CMBX_CONSTANT_ALPHA";
- case GR_CMBX_CONSTANT_COLOR:
- return "GR_CMBX_CONSTANT_COLOR";
- case GR_CMBX_DETAIL_FACTOR:
- return "GR_CMBX_DETAIL_FACTOR";
- case GR_CMBX_ITALPHA:
- return "GR_CMBX_ITALPHA";
- case GR_CMBX_ITRGB:
- return "GR_CMBX_ITRGB";
- case GR_CMBX_LOCAL_TEXTURE_ALPHA:
- return "GR_CMBX_LOCAL_TEXTURE_ALPHA";
- case GR_CMBX_LOCAL_TEXTURE_RGB:
- return "GR_CMBX_LOCAL_TEXTURE_RGB";
- case GR_CMBX_LOD_FRAC:
- return "GR_CMBX_LOD_FRAC";
- case GR_CMBX_OTHER_TEXTURE_ALPHA:
- return "GR_CMBX_OTHER_TEXTURE_ALPHA";
- case GR_CMBX_OTHER_TEXTURE_RGB:
- return "GR_CMBX_OTHER_TEXTURE_RGB";
- case GR_CMBX_TEXTURE_RGB:
- return "GR_CMBX_TEXTURE_RGB";
- case GR_CMBX_TMU_CALPHA:
- return "GR_CMBX_TMU_CALPHA";
- case GR_CMBX_TMU_CCOLOR:
- return "GR_CMBX_TMU_CCOLOR";
- default:
- return "";
- }
-}
-#endif
-
-#if 0
-static const char *texMode(int k)
-{
- switch (k) {
- case GR_FUNC_MODE_ZERO:
- return "GR_FUNC_MODE_ZERO";
- case GR_FUNC_MODE_X:
- return "GR_FUNC_MODE_X";
- case GR_FUNC_MODE_ONE_MINUS_X:
- return "GR_FUNC_MODE_ONE_MINUS_X";
- case GR_FUNC_MODE_NEGATIVE_X:
- return "GR_FUNC_MODE_NEGATIVE_X";
- case GR_FUNC_MODE_X_MINUS_HALF:
- return "GR_FUNC_MODE_X_MINUS_HALF";
- default:
- return "";
- }
-}
-#endif
-
-#if 0
-static const char *texInvert(int k)
-{
- return k ? "FXTRUE" : "FXFALSE";
-}
-#endif
-
-static void uploadTextureEnv( tdfxContextPtr fxMesa )
-{
- if (TDFX_IS_NAPALM(fxMesa)) {
- int unit;
- for (unit = 0; unit < TDFX_NUM_TMU; unit++) {
-#if 0
- printf("upload env %d\n", unit);
- printf(" cSourceA = %s\t", texSource(fxMesa->TexCombineExt[unit].Color.SourceA));
- printf(" cModeA = %s\n", texMode(fxMesa->TexCombineExt[unit].Color.ModeA));
- printf(" cSourceB = %s\t", texSource(fxMesa->TexCombineExt[unit].Color.SourceB));
- printf(" cModeB = %s\n", texMode(fxMesa->TexCombineExt[unit].Color.ModeB));
- printf(" cSourceC = %s\t", texSource(fxMesa->TexCombineExt[unit].Color.SourceC));
- printf(" cInvertC = %s\n", texInvert(fxMesa->TexCombineExt[unit].Color.InvertC));
- printf(" cSourceD = %s\t", texSource(fxMesa->TexCombineExt[unit].Color.SourceD));
- printf(" cInvertD = %s\n", texInvert(fxMesa->TexCombineExt[unit].Color.InvertD));
- printf(" cShift = %d\t", fxMesa->TexCombineExt[unit].Color.Shift);
- printf(" cInvert = %d\n", fxMesa->TexCombineExt[unit].Color.Invert);
- printf(" aSourceA = %s\t", texSource(fxMesa->TexCombineExt[unit].Alpha.SourceA));
- printf(" aModeA = %s\n", texMode(fxMesa->TexCombineExt[unit].Alpha.ModeA));
- printf(" aSourceB = %s\t", texSource(fxMesa->TexCombineExt[unit].Alpha.SourceB));
- printf(" aModeB = %s\n", texMode(fxMesa->TexCombineExt[unit].Alpha.ModeB));
- printf(" aSourceC = %s\t", texSource(fxMesa->TexCombineExt[unit].Alpha.SourceC));
- printf(" aInvertC = %s\n", texInvert(fxMesa->TexCombineExt[unit].Alpha.InvertC));
- printf(" aSourceD = %s\t", texSource(fxMesa->TexCombineExt[unit].Alpha.SourceD));
- printf(" aInvertD = %s\n", texInvert(fxMesa->TexCombineExt[unit].Alpha.InvertD));
- printf(" aShift = %d\t", fxMesa->TexCombineExt[unit].Alpha.Shift);
- printf(" aInvert = %d\n", fxMesa->TexCombineExt[unit].Alpha.Invert);
- printf(" Color = 0x%08x\n", fxMesa->TexCombineExt[unit].EnvColor);
-#endif
- fxMesa->Glide.grTexColorCombineExt(TDFX_TMU0 + unit,
- fxMesa->TexCombineExt[unit].Color.SourceA,
- fxMesa->TexCombineExt[unit].Color.ModeA,
- fxMesa->TexCombineExt[unit].Color.SourceB,
- fxMesa->TexCombineExt[unit].Color.ModeB,
- fxMesa->TexCombineExt[unit].Color.SourceC,
- fxMesa->TexCombineExt[unit].Color.InvertC,
- fxMesa->TexCombineExt[unit].Color.SourceD,
- fxMesa->TexCombineExt[unit].Color.InvertD,
- fxMesa->TexCombineExt[unit].Color.Shift,
- fxMesa->TexCombineExt[unit].Color.Invert);
- fxMesa->Glide.grTexAlphaCombineExt(TDFX_TMU0 + unit,
- fxMesa->TexCombineExt[unit].Alpha.SourceA,
- fxMesa->TexCombineExt[unit].Alpha.ModeA,
- fxMesa->TexCombineExt[unit].Alpha.SourceB,
- fxMesa->TexCombineExt[unit].Alpha.ModeB,
- fxMesa->TexCombineExt[unit].Alpha.SourceC,
- fxMesa->TexCombineExt[unit].Alpha.InvertC,
- fxMesa->TexCombineExt[unit].Alpha.SourceD,
- fxMesa->TexCombineExt[unit].Alpha.InvertD,
- fxMesa->TexCombineExt[unit].Alpha.Shift,
- fxMesa->TexCombineExt[unit].Alpha.Invert);
- fxMesa->Glide.grConstantColorValueExt(TDFX_TMU0 + unit,
- fxMesa->TexCombineExt[unit].EnvColor);
- }
- }
- else {
- /* Voodoo3 */
- int unit;
- for (unit = 0; unit < TDFX_NUM_TMU; unit++) {
- struct tdfx_texcombine *comb = &fxMesa->TexCombine[unit];
- fxMesa->Glide.grTexCombine(TDFX_TMU0 + unit,
- comb->FunctionRGB,
- comb->FactorRGB,
- comb->FunctionAlpha,
- comb->FactorAlpha,
- comb->InvertRGB,
- comb->InvertAlpha);
- }
- }
-}
-
-
-static void uploadTextureParams( tdfxContextPtr fxMesa )
-{
- int unit;
- for (unit = 0; unit < TDFX_NUM_TMU; unit++) {
- const struct tdfx_texparams *p = &fxMesa->TexParams[unit];
- /*
- printf("upload params %d\n", unit);
- printf(" clamp %x %x\n", env->sClamp, env->tClamp);
- printf(" filter %x %x\n", env->minFilt, env->magFilt);
- printf(" mipmap %x %x\n", env->mmMode, env->LODblend);
- printf(" lod bias %f\n", env->LodBias);
- */
- fxMesa->Glide.grTexClampMode(GR_TMU0 + unit, p->sClamp, p->tClamp);
- fxMesa->Glide.grTexFilterMode(GR_TMU0 + unit, p->minFilt, p->magFilt);
- fxMesa->Glide.grTexMipMapMode(GR_TMU0 + unit, p->mmMode, p->LODblend);
- fxMesa->Glide.grTexLodBiasValue(GR_TMU0 + unit, CLAMP(p->LodBias, -8, 7.75));
- }
-}
-
-
-static void uploadTextureSource( tdfxContextPtr fxMesa )
-{
- int unit;
- for (unit = 0; unit < TDFX_NUM_TMU; unit++) {
- const struct tdfx_texsource *src = &fxMesa->TexSource[unit];
- /*
- printf("upload source %d @ %d %p\n", unit, src->StartAddress, src->Info);
- */
- if (src->Info) {
- /*
- printf(" smallLodLog2=%d largeLodLog2=%d ar=%d format=%d data=%p\n",
- src->Info->smallLodLog2, src->Info->largeLodLog2,
- src->Info->aspectRatioLog2, src->Info->format,
- src->Info->data);
- */
- fxMesa->Glide.grTexSource(GR_TMU0 + unit,
- src->StartAddress,
- src->EvenOdd,
- src->Info);
- }
- }
-}
-
-
-static void uploadTextureImages( tdfxContextPtr fxMesa )
-{
- GLcontext *ctx = fxMesa->glCtx;
- int unit;
- for (unit = 0; unit < TDFX_NUM_TMU; unit++) {
- if (ctx->Texture.Unit[unit]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- if (ti && ti->reloadImages && ti->whichTMU != TDFX_TMU_NONE) {
- /*
- printf("download texture image on unit %d\n", unit);
- */
- tdfxTMDownloadTexture(fxMesa, tObj);
- ti->reloadImages = GL_FALSE;
- }
- }
- }
-}
-
-
-
-/*
- * If scissoring is enabled, compute intersection of scissor region
- * with all X clip rects, resulting in new cliprect list.
- * If number of cliprects is zero or one, call grClipWindow to setup
- * the clip region. Otherwise we'll call grClipWindow inside the
- * BEGIN_CLIP_LOOP macro.
- */
-void tdfxUploadClipping( tdfxContextPtr fxMesa )
-{
- __DRIdrawablePrivate *dPriv = fxMesa->driDrawable;
-
- assert(dPriv);
-
- if (fxMesa->numClipRects == 0) {
- /* all drawing clipped away */
- fxMesa->Glide.grClipWindow(0, 0, 0, 0);
- }
- else if (fxMesa->numClipRects == 1) {
- fxMesa->Glide.grClipWindow(fxMesa->pClipRects[0].x1,
- fxMesa->screen_height - fxMesa->pClipRects[0].y2,
- fxMesa->pClipRects[0].x2,
- fxMesa->screen_height - fxMesa->pClipRects[0].y1);
- }
- /* else, we'll do a cliprect loop around all drawing */
-
- fxMesa->Glide.grDRIPosition( dPriv->x, dPriv->y, dPriv->w, dPriv->h,
- fxMesa->numClipRects, fxMesa->pClipRects );
-}
-
-
-void tdfxEmitHwStateLocked( tdfxContextPtr fxMesa )
-{
- if ( !fxMesa->dirty )
- return;
-
- if ( fxMesa->dirty & TDFX_UPLOAD_COLOR_COMBINE ) {
- if (TDFX_IS_NAPALM(fxMesa)) {
- fxMesa->Glide.grColorCombineExt(fxMesa->ColorCombineExt.SourceA,
- fxMesa->ColorCombineExt.ModeA,
- fxMesa->ColorCombineExt.SourceB,
- fxMesa->ColorCombineExt.ModeB,
- fxMesa->ColorCombineExt.SourceC,
- fxMesa->ColorCombineExt.InvertC,
- fxMesa->ColorCombineExt.SourceD,
- fxMesa->ColorCombineExt.InvertD,
- fxMesa->ColorCombineExt.Shift,
- fxMesa->ColorCombineExt.Invert);
- }
- else {
- /* Voodoo 3 */
- fxMesa->Glide.grColorCombine( fxMesa->ColorCombine.Function,
- fxMesa->ColorCombine.Factor,
- fxMesa->ColorCombine.Local,
- fxMesa->ColorCombine.Other,
- fxMesa->ColorCombine.Invert );
- }
- fxMesa->dirty &= ~TDFX_UPLOAD_COLOR_COMBINE;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_ALPHA_COMBINE ) {
- if (TDFX_IS_NAPALM(fxMesa)) {
- fxMesa->Glide.grAlphaCombineExt(fxMesa->AlphaCombineExt.SourceA,
- fxMesa->AlphaCombineExt.ModeA,
- fxMesa->AlphaCombineExt.SourceB,
- fxMesa->AlphaCombineExt.ModeB,
- fxMesa->AlphaCombineExt.SourceC,
- fxMesa->AlphaCombineExt.InvertC,
- fxMesa->AlphaCombineExt.SourceD,
- fxMesa->AlphaCombineExt.InvertD,
- fxMesa->AlphaCombineExt.Shift,
- fxMesa->AlphaCombineExt.Invert);
- }
- else {
- /* Voodoo 3 */
- fxMesa->Glide.grAlphaCombine( fxMesa->AlphaCombine.Function,
- fxMesa->AlphaCombine.Factor,
- fxMesa->AlphaCombine.Local,
- fxMesa->AlphaCombine.Other,
- fxMesa->AlphaCombine.Invert );
- }
- fxMesa->dirty &= ~TDFX_UPLOAD_ALPHA_COMBINE;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_RENDER_BUFFER ) {
- fxMesa->Glide.grRenderBuffer( fxMesa->DrawBuffer );
- fxMesa->dirty &= ~TDFX_UPLOAD_RENDER_BUFFER;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_STIPPLE) {
- fxMesa->Glide.grStipplePattern( fxMesa->Stipple.Pattern );
- fxMesa->Glide.grStippleMode( fxMesa->Stipple.Mode );
- fxMesa->dirty &= ~TDFX_UPLOAD_STIPPLE;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_ALPHA_TEST ) {
- fxMesa->Glide.grAlphaTestFunction( fxMesa->Color.AlphaFunc );
- fxMesa->dirty &= ~TDFX_UPLOAD_ALPHA_TEST;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_ALPHA_REF ) {
- fxMesa->Glide.grAlphaTestReferenceValue( fxMesa->Color.AlphaRef );
- fxMesa->dirty &= ~TDFX_UPLOAD_ALPHA_REF;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_BLEND_FUNC ) {
- if (fxMesa->Glide.grAlphaBlendFunctionExt) {
- fxMesa->Glide.grAlphaBlendFunctionExt( fxMesa->Color.BlendSrcRGB,
- fxMesa->Color.BlendDstRGB,
- fxMesa->Color.BlendEqRGB,
- fxMesa->Color.BlendSrcA,
- fxMesa->Color.BlendDstA,
- fxMesa->Color.BlendEqA );
- }
- else {
- fxMesa->Glide.grAlphaBlendFunction( fxMesa->Color.BlendSrcRGB,
- fxMesa->Color.BlendDstRGB,
- fxMesa->Color.BlendSrcA,
- fxMesa->Color.BlendDstA );
- }
- fxMesa->dirty &= ~TDFX_UPLOAD_BLEND_FUNC;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_DEPTH_MODE ) {
- fxMesa->Glide.grDepthBufferMode( fxMesa->Depth.Mode );
- fxMesa->dirty &= ~TDFX_UPLOAD_DEPTH_MODE;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_DEPTH_BIAS ) {
- fxMesa->Glide.grDepthBiasLevel( fxMesa->Depth.Bias );
- fxMesa->dirty &= ~TDFX_UPLOAD_DEPTH_BIAS;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_DEPTH_FUNC ) {
- fxMesa->Glide.grDepthBufferFunction( fxMesa->Depth.Func );
- fxMesa->dirty &= ~TDFX_UPLOAD_DEPTH_FUNC;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_DEPTH_MASK ) {
- fxMesa->Glide.grDepthMask( fxMesa->Depth.Mask );
- fxMesa->dirty &= ~TDFX_UPLOAD_DEPTH_MASK;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_DITHER) {
- fxMesa->Glide.grDitherMode( fxMesa->Color.Dither );
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_FOG_MODE ) {
- fxMesa->Glide.grFogMode( fxMesa->Fog.Mode );
- fxMesa->dirty &= ~TDFX_UPLOAD_FOG_MODE;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_FOG_COLOR ) {
- fxMesa->Glide.grFogColorValue( fxMesa->Fog.Color );
- fxMesa->dirty &= ~TDFX_UPLOAD_FOG_COLOR;
- }
- if ( fxMesa->dirty & TDFX_UPLOAD_FOG_TABLE ) {
- fxMesa->Glide.grFogTable( fxMesa->Fog.Table );
- fxMesa->dirty &= ~TDFX_UPLOAD_FOG_TABLE;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_CULL ) {
- fxMesa->Glide.grCullMode( fxMesa->CullMode );
- fxMesa->dirty &= ~TDFX_UPLOAD_CULL;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_CLIP ) {
- tdfxUploadClipping( fxMesa );
- fxMesa->dirty &= ~TDFX_UPLOAD_CLIP;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_COLOR_MASK ) {
- if ( fxMesa->Glide.grColorMaskExt
- && fxMesa->glCtx->Visual.redBits == 8) {
- fxMesa->Glide.grColorMaskExt( fxMesa->Color.ColorMask[RCOMP],
- fxMesa->Color.ColorMask[GCOMP],
- fxMesa->Color.ColorMask[BCOMP],
- fxMesa->Color.ColorMask[ACOMP] );
- } else {
- fxMesa->Glide.grColorMask( fxMesa->Color.ColorMask[RCOMP] ||
- fxMesa->Color.ColorMask[GCOMP] ||
- fxMesa->Color.ColorMask[BCOMP],
- /*fxMesa->Color.ColorMask[ACOMP]*/GL_FALSE/*[dBorca] no-no*/ );
- }
- fxMesa->dirty &= ~TDFX_UPLOAD_COLOR_MASK;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_CONSTANT_COLOR ) {
- fxMesa->Glide.grConstantColorValue( fxMesa->Color.MonoColor );
- fxMesa->dirty &= ~TDFX_UPLOAD_CONSTANT_COLOR;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_LINE ) {
- if (fxMesa->glCtx->Line.SmoothFlag && fxMesa->glCtx->Line.Width == 1.0)
- fxMesa->Glide.grEnable(GR_AA_ORDERED);
- else
- fxMesa->Glide.grDisable(GR_AA_ORDERED);
- fxMesa->dirty &= ~TDFX_UPLOAD_LINE;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_STENCIL ) {
- if (fxMesa->glCtx->Stencil.Enabled) {
- fxMesa->Glide.grEnable(GR_STENCIL_MODE_EXT);
- fxMesa->Glide.grStencilOp(fxMesa->Stencil.FailFunc,
- fxMesa->Stencil.ZFailFunc,
- fxMesa->Stencil.ZPassFunc);
- fxMesa->Glide.grStencilFunc(fxMesa->Stencil.Function,
- fxMesa->Stencil.RefValue,
- fxMesa->Stencil.ValueMask);
- fxMesa->Glide.grStencilMask(fxMesa->Stencil.WriteMask);
- }
- else {
- fxMesa->Glide.grDisable(GR_STENCIL_MODE_EXT);
- }
- fxMesa->dirty &= ~TDFX_UPLOAD_STENCIL;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_VERTEX_LAYOUT ) {
- fxMesa->Glide.grGlideSetVertexLayout( fxMesa->layout[fxMesa->vertexFormat] );
- /* [dborca] enable fogcoord */
- fxMesa->Glide.grVertexLayout(GR_PARAM_FOG_EXT, TDFX_FOG_OFFSET,
- fxMesa->Fog.Mode == GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
- fxMesa->dirty &= ~TDFX_UPLOAD_VERTEX_LAYOUT;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_TEXTURE_ENV ) {
- uploadTextureEnv(fxMesa);
- fxMesa->dirty &= ~TDFX_UPLOAD_TEXTURE_ENV;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_TEXTURE_PARAMS ) {
- uploadTextureParams(fxMesa);
- fxMesa->dirty &= ~TDFX_UPLOAD_TEXTURE_PARAMS;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_TEXTURE_PALETTE ) {
- if (fxMesa->TexPalette.Data) {
- fxMesa->Glide.grTexDownloadTable(fxMesa->TexPalette.Type, fxMesa->TexPalette.Data);
- }
- fxMesa->dirty &= ~TDFX_UPLOAD_TEXTURE_PALETTE;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_TEXTURE_SOURCE ) {
- uploadTextureSource(fxMesa);
- fxMesa->dirty &= ~TDFX_UPLOAD_TEXTURE_SOURCE;
- }
-
- if ( fxMesa->dirty & TDFX_UPLOAD_TEXTURE_IMAGES ) {
- uploadTextureImages(fxMesa);
- fxMesa->dirty &= ~TDFX_UPLOAD_TEXTURE_IMAGES;
- }
-
- fxMesa->dirty = 0;
-}
-
-
-
-void tdfxInitRenderFuncs( struct dd_function_table *functions )
-{
- functions->Clear = tdfxClear;
- functions->Finish = tdfxFinish;
- functions->Flush = tdfxFlush;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.h
deleted file mode 100644
index 09d0d9019..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.h,v 1.1 2001/03/21 16:14:28 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __TDFX_RENDER_H__
-#define __TDFX_RENDER_H__
-
-#include "tdfx_context.h"
-
-extern void tdfxInitRenderFuncs( struct dd_function_table *functions );
-
-extern void tdfxEmitHwStateLocked( tdfxContextPtr fxMesa );
-
-extern void tdfxUploadClipping( tdfxContextPtr fxMesa );
-
-#define FLUSH_BATCH( fxMesa )
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.c
deleted file mode 100644
index ab64f7986..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c,v 1.3 2002/02/22 21:45:03 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#include "tdfx_dri.h"
-#include "tdfx_context.h"
-#include "tdfx_lock.h"
-#include "tdfx_vb.h"
-#include "tdfx_span.h"
-#include "tdfx_tris.h"
-
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "xmlpool.h"
-
-#include "utils.h"
-
-#ifdef DEBUG_LOCKING
-char *prevLockFile = 0;
-int prevLockLine = 0;
-#endif
-
-#ifndef TDFX_DEBUG
-int TDFX_DEBUG = 0;
-#endif
-
-PUBLIC const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-
-static const GLuint __driNConfigOptions = 1;
-
-extern const struct dri_extension card_extensions[];
-extern const struct dri_extension napalm_extensions[];
-
-static GLboolean
-tdfxCreateScreen( __DRIscreenPrivate *sPriv )
-{
- tdfxScreenPrivate *fxScreen;
- TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
-
- if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- fxScreen = (tdfxScreenPrivate *) CALLOC( sizeof(tdfxScreenPrivate) );
- if ( !fxScreen )
- return GL_FALSE;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&fxScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- fxScreen->driScrnPriv = sPriv;
- sPriv->private = (void *) fxScreen;
-
- fxScreen->regs.handle = fxDRIPriv->regs;
- fxScreen->regs.size = fxDRIPriv->regsSize;
- fxScreen->deviceID = fxDRIPriv->deviceID;
- fxScreen->width = fxDRIPriv->width;
- fxScreen->height = fxDRIPriv->height;
- fxScreen->mem = fxDRIPriv->mem;
- fxScreen->cpp = fxDRIPriv->cpp;
- fxScreen->stride = fxDRIPriv->stride;
- fxScreen->fifoOffset = fxDRIPriv->fifoOffset;
- fxScreen->fifoSize = fxDRIPriv->fifoSize;
- fxScreen->fbOffset = fxDRIPriv->fbOffset;
- fxScreen->backOffset = fxDRIPriv->backOffset;
- fxScreen->depthOffset = fxDRIPriv->depthOffset;
- fxScreen->textureOffset = fxDRIPriv->textureOffset;
- fxScreen->textureSize = fxDRIPriv->textureSize;
- fxScreen->sarea_priv_offset = fxDRIPriv->sarea_priv_offset;
-
- if ( drmMap( sPriv->fd, fxScreen->regs.handle,
- fxScreen->regs.size, &fxScreen->regs.map ) ) {
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-static void
-tdfxDestroyScreen( __DRIscreenPrivate *sPriv )
-{
- tdfxScreenPrivate *fxScreen = (tdfxScreenPrivate *) sPriv->private;
-
- if (!fxScreen)
- return;
-
- drmUnmap( fxScreen->regs.map, fxScreen->regs.size );
-
- /* free all option information */
- driDestroyOptionInfo (&fxScreen->optionCache);
-
- FREE( fxScreen );
- sPriv->private = NULL;
-}
-
-
-static GLboolean
-tdfxInitDriver( __DRIscreenPrivate *sPriv )
-{
- if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)sPriv );
- }
-
- if ( !tdfxCreateScreen( sPriv ) ) {
- tdfxDestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-static GLboolean
-tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- tdfxScreenPrivate *screen = (tdfxScreenPrivate *) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* software alpha channel? */ );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->fbOffset, screen->width);
- tdfxSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->width);
- tdfxSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->width);
- tdfxSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->width);
- tdfxSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->width);
- tdfxSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- GL_FALSE, /*swStencil,*/
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-tdfxDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-
-static void
-tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
-
-{
- GET_CURRENT_CONTEXT(ctx);
- tdfxContextPtr fxMesa = 0;
- GLframebuffer *mesaBuffer;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driDrawPriv );
- }
-
- mesaBuffer = (GLframebuffer *) driDrawPriv->driverPrivate;
- if ( !mesaBuffer->Visual.doubleBufferMode )
- return; /* can't swap a single-buffered window */
-
- /* If the current context's drawable matches the given drawable
- * we have to do a glFinish (per the GLX spec).
- */
- if ( ctx ) {
- __DRIdrawablePrivate *curDrawPriv;
- fxMesa = TDFX_CONTEXT(ctx);
- curDrawPriv = fxMesa->driContext->driDrawablePriv;
-
- if ( curDrawPriv == driDrawPriv ) {
- /* swapping window bound to current context, flush first */
- _mesa_notifySwapBuffers( ctx );
- LOCK_HARDWARE( fxMesa );
- }
- else {
- /* find the fxMesa context previously bound to the window */
- fxMesa = (tdfxContextPtr) driDrawPriv->driContextPriv->driverPrivate;
- if (!fxMesa)
- return;
- LOCK_HARDWARE( fxMesa );
- fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
- printf("SwapBuf SetState 1\n");
- fxMesa->Glide.grGlideSetState(fxMesa->Glide.State );
- }
- }
-
-#ifdef STATS
- {
- int stalls;
- static int prevStalls = 0;
-
- stalls = fxMesa->Glide.grFifoGetStalls();
-
- fprintf( stderr, "%s:\n", __FUNCTION__ );
- if ( stalls != prevStalls ) {
- fprintf( stderr, " %d stalls occurred\n",
- stalls - prevStalls );
- prevStalls = stalls;
- }
- if ( fxMesa && fxMesa->texSwaps ) {
- fprintf( stderr, " %d texture swaps occurred\n",
- fxMesa->texSwaps );
- fxMesa->texSwaps = 0;
- }
- }
-#endif
-
- if (fxMesa->scissoredClipRects) {
- /* restore clip rects without scissor box */
- fxMesa->Glide.grDRIPosition( driDrawPriv->x, driDrawPriv->y,
- driDrawPriv->w, driDrawPriv->h,
- driDrawPriv->numClipRects,
- driDrawPriv->pClipRects );
- }
-
- fxMesa->Glide.grDRIBufferSwap( fxMesa->Glide.SwapInterval );
-
- if (fxMesa->scissoredClipRects) {
- /* restore clip rects WITH scissor box */
- fxMesa->Glide.grDRIPosition( driDrawPriv->x, driDrawPriv->y,
- driDrawPriv->w, driDrawPriv->h,
- fxMesa->numClipRects, fxMesa->pClipRects );
- }
-
-
-#if 0
- {
- FxI32 result;
- do {
- FxI32 result;
- fxMesa->Glide.grGet(GR_PENDING_BUFFERSWAPS, 4, &result);
- } while ( result > fxMesa->maxPendingSwapBuffers );
- }
-#endif
-
- fxMesa->stats.swapBuffer++;
-
- if (ctx) {
- if (ctx->DriverCtx != fxMesa) {
- fxMesa = TDFX_CONTEXT(ctx);
- fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
- printf("SwapBuf SetState 2\n");
- fxMesa->Glide.grGlideSetState(fxMesa->Glide.State );
- }
- UNLOCK_HARDWARE( fxMesa );
- }
-}
-
-
-static const struct __DriverAPIRec tdfxAPI = {
- .InitDriver = tdfxInitDriver,
- .DestroyScreen = tdfxDestroyScreen,
- .CreateContext = tdfxCreateContext,
- .DestroyContext = tdfxDestroyContext,
- .CreateBuffer = tdfxCreateBuffer,
- .DestroyBuffer = tdfxDestroyBuffer,
- .SwapBuffers = tdfxSwapBuffers,
- .MakeCurrent = tdfxMakeCurrent,
- .UnbindContext = tdfxUnbindContext,
- .GetSwapInfo = NULL,
- .GetMSC = NULL,
- .WaitForMSC = NULL,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
- unsigned depth_bits,
- unsigned stencil_bits,
- GLboolean have_back_buffer)
-{
- __GLcontextModes *modes;
- __GLcontextModes *m;
- unsigned num_modes;
- unsigned vis[2] = { GLX_TRUE_COLOR, GLX_DIRECT_COLOR };
- unsigned deep = (depth_bits > 17);
- unsigned i, db, depth, accum, stencil;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
-
- num_modes = (depth_bits == 16) ? 32 : 16;
-
- modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes));
- m = modes;
-
- for (i = 0; i <= 1; i++) {
- for (db = 0; db <= 1; db++) {
- for (depth = 0; depth <= 1; depth++) {
- for (accum = 0; accum <= 1; accum++) {
- for (stencil = 0; stencil <= !deep; stencil++) {
- if (deep) stencil = depth;
- m->redBits = deep ? 8 : 5;
- m->greenBits = deep ? 8 : 6;
- m->blueBits = deep ? 8 : 5;
- m->alphaBits = deep ? 8 : 0;
- m->redMask = deep ?0xFF000000 :0x0000F800;
- m->greenMask = deep ?0x00FF0000 :0x000007E0;
- m->blueMask = deep ?0x0000FF00 :0x0000001F;
- m->alphaMask = deep ? 0x000000FF : 0;
- m->rgbBits = m->redBits + m->greenBits +
- m->blueBits + m->alphaBits;
- m->accumRedBits = accum ? 16 : 0;
- m->accumGreenBits = accum ? 16 : 0;
- m->accumBlueBits = accum ? 16 : 0;
- m->accumAlphaBits = accum ? 16 : 0;
- m->stencilBits = stencil ? 8 : 0;
- m->depthBits = deep
- ? (depth ? 24 : 0)
- : (depth ? 0 : depth_bits);
- m->visualType = vis[i];
- m->renderType = GLX_RGBA_BIT;
- m->drawableType = GLX_WINDOW_BIT;
- m->rgbMode = GL_TRUE;
- m->doubleBufferMode = db ? GL_TRUE : GL_FALSE;
- if (db)
- m->swapMethod = GLX_SWAP_UNDEFINED_OML;
- m->visualRating = ((stencil && !deep) || accum)
- ? GLX_SLOW_CONFIG
- : GLX_NONE;
- m = m->next;
- if (deep) stencil = 0;
- }
- }
- }
- }
- }
-
- return modes;
-}
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 1, 0 };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 0, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "tdfx",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &tdfxAPI);
-
- if (psp != NULL) {
- /* divined from tdfx_dri.c, sketchy */
- TDFXDRIPtr dri_priv = (TDFXDRIPtr) psp->pDevPriv;
- int bpp = (dri_priv->cpp > 2) ? 24 : 16;
-
- /* XXX i wish it was like this */
- /* bpp = dri_priv->bpp */
-
- *driver_modes = tdfxFillInModes(bpp, (bpp == 16) ? 16 : 24,
- (bpp == 16) ? 0 : 8,
- (dri_priv->backOffset!=dri_priv->depthOffset));
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- driInitExtensions( NULL, napalm_extensions, GL_FALSE );
- }
-
- return (void *)psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.h
deleted file mode 100644
index 90be89a35..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_screen.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.h,v 1.2 2002/02/22 21:45:03 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef __TDFX_SCREEN_H__
-#define __TDFX_SCREEN_H__
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
- drmAddress map;
-} tdfxRegion, *tdfxRegionPtr;
-
-typedef struct {
- tdfxRegion regs;
-
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int stride;
-
- int fifoOffset;
- int fifoSize;
-
- int fbOffset;
- int backOffset;
- int depthOffset;
- int textureOffset;
- int textureSize;
-
- __DRIscreenPrivate *driScrnPriv;
- unsigned int sarea_priv_offset;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} tdfxScreenPrivate;
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.c
deleted file mode 100644
index b00b7ad8d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.c
+++ /dev/null
@@ -1,1427 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#include "tdfx_context.h"
-#include "tdfx_lock.h"
-#include "tdfx_span.h"
-#include "tdfx_render.h"
-#include "swrast/swrast.h"
-
-
-#define DBG 0
-
-
-#define LOCAL_VARS \
- __DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \
- tdfxScreenPrivate *fxPriv = fxMesa->fxScreen; \
- GLuint pitch = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) \
- ? (fxMesa->screen_width * BYTESPERPIXEL) : \
- (info.strideInBytes); \
- GLuint height = fxMesa->height; \
- char *buf = (char *)((char *)info.lfbPtr + \
- dPriv->x * fxPriv->cpp + \
- dPriv->y * pitch); \
- GLuint p; \
- (void) buf; (void) p;
-
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-
-#define HW_WRITE_LOCK() \
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); \
- GrLfbInfo_t info; \
- FLUSH_BATCH( fxMesa ); \
- UNLOCK_HARDWARE( fxMesa ); \
- LOCK_HARDWARE( fxMesa ); \
- info.size = sizeof(GrLfbInfo_t); \
- if ( fxMesa->Glide.grLfbLock( GR_LFB_WRITE_ONLY, \
- fxMesa->DrawBuffer, LFB_MODE, \
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) \
- {
-
-#define HW_WRITE_UNLOCK() \
- fxMesa->Glide.grLfbUnlock( GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer );\
- }
-
-
-#define HW_READ_LOCK() \
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); \
- GrLfbInfo_t info; \
- FLUSH_BATCH( fxMesa ); \
- UNLOCK_HARDWARE( fxMesa ); \
- LOCK_HARDWARE( fxMesa ); \
- info.size = sizeof(GrLfbInfo_t); \
- if ( fxMesa->Glide.grLfbLock( GR_LFB_READ_ONLY, fxMesa->ReadBuffer, \
- LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) \
- {
-
-#define HW_READ_UNLOCK() \
- fxMesa->Glide.grLfbUnlock( GR_LFB_READ_ONLY, fxMesa->ReadBuffer );\
- }
-
-
-#define HW_WRITE_CLIPLOOP() \
- do { \
- int _nc = fxMesa->numClipRects; \
- while (_nc--) { \
- int minx = fxMesa->pClipRects[_nc].x1 - fxMesa->x_offset; \
- int miny = fxMesa->pClipRects[_nc].y1 - fxMesa->y_offset; \
- int maxx = fxMesa->pClipRects[_nc].x2 - fxMesa->x_offset; \
- int maxy = fxMesa->pClipRects[_nc].y2 - fxMesa->y_offset;
-
-#define HW_READ_CLIPLOOP() \
- do { \
- const __DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \
- drm_clip_rect_t *rect = dPriv->pClipRects; \
- int _nc = dPriv->numClipRects; \
- while (_nc--) { \
- const int minx = rect->x1 - fxMesa->x_offset; \
- const int miny = rect->y1 - fxMesa->y_offset; \
- const int maxx = rect->x2 - fxMesa->x_offset; \
- const int maxy = rect->y2 - fxMesa->y_offset; \
- rect++;
-
-#define HW_ENDCLIPLOOP() \
- } \
- } while (0)
-
-
-
-#define LFB_MODE GR_LFBWRITEMODE_565
-
-
-/* 16 bit, RGB565 color spanline and pixel functions */ \
-
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p, color) \
- p = TDFXPACKCOLOR565( color[0], color[1], color[2] )
-
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \
- rgba[0] = (((p >> 11) & 0x1f) * 255) / 31; \
- rgba[1] = (((p >> 5) & 0x3f) * 255) / 63; \
- rgba[2] = (((p >> 0) & 0x1f) * 255) / 31; \
- rgba[3] = 0xff; \
- } while (0)
-
-#define TAG(x) tdfx##x##_RGB565
-#define BYTESPERPIXEL 2
-#include "spantmp.h"
-#undef BYTESPERPIXEL
-
-
-/* 16 bit, BGR565 color spanline and pixel functions */ \
-#if 0
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)b & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)r & 0xf8) >> 3))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \
- rgba[0] = (p << 3) & 0xf8; \
- rgba[1] = (p >> 3) & 0xfc; \
- rgba[2] = (p >> 8) & 0xf8; \
- rgba[3] = 0xff; \
- } while (0)
-
-#define TAG(x) tdfx##x##_BGR565
-#define BYTESPERPIXEL 2
-#include "spantmp.h"
-#undef BYTESPERPIXEL
-#endif
-
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_888
-
-
-/* 24 bit, RGB888 color spanline and pixel functions */
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p, color) \
- p = TDFXPACKCOLOR888( color[0], color[1], color[2] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLuint *)(buf + _x*3 + _y*pitch) = ((b << 0) | \
- (g << 8) | \
- (r << 16))
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLuint *)(buf + _x*3 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLuint p = *(GLuint *)(buf + _x*3 + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = 0xff; \
-} while (0)
-
-#define TAG(x) tdfx##x##_RGB888
-#define BYTESPERPIXEL 4
-#include "spantmp.h"
-#undef BYTESPERPIXEL
-
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_8888
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions */
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p, color) \
- p = TDFXPACKCOLOR8888( color[0], color[1], color[2], color[3] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \
- (g << 8) | \
- (r << 16) | \
- (a << 24) )
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
-do { \
- GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
-} while (0)
-
-#define TAG(x) tdfx##x##_ARGB8888
-#define BYTESPERPIXEL 4
-#include "spantmp.h"
-#undef BYTESPERPIXEL
-
-
-
-/* ================================================================
- * Old span functions below...
- */
-
-
-/*
- * Examine the cliprects to generate an array of flags to indicate
- * which pixels in a span are visible. Note: (x,y) is a screen
- * coordinate.
- */
-static void
-generate_vismask(const tdfxContextPtr fxMesa, GLint x, GLint y, GLint n,
- GLubyte vismask[])
-{
- GLboolean initialized = GL_FALSE;
- GLint i, j;
-
- /* Ensure we clear the visual mask */
- MEMSET(vismask, 0, n);
-
- /* turn on flags for all visible pixels */
- for (i = 0; i < fxMesa->numClipRects; i++) {
- const drm_clip_rect_t *rect = &fxMesa->pClipRects[i];
-
- if (y >= rect->y1 && y < rect->y2) {
- if (x >= rect->x1 && x + n <= rect->x2) {
- /* common case, whole span inside cliprect */
- MEMSET(vismask, 1, n);
- return;
- }
- if (x < rect->x2 && x + n >= rect->x1) {
- /* some of the span is inside the rect */
- GLint start, end;
- if (!initialized) {
- MEMSET(vismask, 0, n);
- initialized = GL_TRUE;
- }
- if (x < rect->x1)
- start = rect->x1 - x;
- else
- start = 0;
- if (x + n > rect->x2)
- end = rect->x2 - x;
- else
- end = n;
- assert(start >= 0);
- assert(end <= n);
- for (j = start; j < end; j++)
- vismask[j] = 1;
- }
- }
- }
-}
-
-/*
- * Examine cliprects and determine if the given screen pixel is visible.
- */
-static GLboolean
-visible_pixel(const tdfxContextPtr fxMesa, int scrX, int scrY)
-{
- int i;
- for (i = 0; i < fxMesa->numClipRects; i++) {
- const drm_clip_rect_t *rect = &fxMesa->pClipRects[i];
- if (scrX >= rect->x1 &&
- scrX < rect->x2 &&
- scrY >= rect->y1 && scrY < rect->y2) return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-
-/*
- * Depth buffer read/write functions.
- */
-/*
- * To read the frame buffer, we need to lock and unlock it. The
- * four macros {READ,WRITE}_FB_SPAN_{LOCK,UNLOCK}
- * do this for us.
- *
- * Note that the lock must be matched with an unlock. These
- * macros include a spare curly brace, so they must
- * be syntactically matched.
- *
- * Note, also, that you can't lock a buffer twice with different
- * modes. That is to say, you can't lock a buffer in both read
- * and write modes. The strideInBytes and LFB pointer will be
- * the same with read and write locks, so you can use either.
- * o The HW has different state for reads and writes, so
- * locking it twice may give screwy results.
- * o The DRM won't let you lock twice. It hangs. This is probably
- * because of the LOCK_HARDWARE IN THE *_FB_SPAN_LOCK macros,
- * and could be eliminated with nonlocking lock routines. But
- * what's the point after all.
- */
-#define READ_FB_SPAN_LOCK(fxMesa, info, target_buffer) \
- UNLOCK_HARDWARE(fxMesa); \
- LOCK_HARDWARE(fxMesa); \
- (info).size=sizeof(info); \
- if (fxMesa->Glide.grLfbLock(GR_LFB_READ_ONLY, \
- target_buffer, \
- GR_LFBWRITEMODE_ANY, \
- GR_ORIGIN_UPPER_LEFT, \
- FXFALSE, \
- &(info))) {
-
-#define READ_FB_SPAN_UNLOCK(fxMesa, target_buffer) \
- fxMesa->Glide.grLfbUnlock(GR_LFB_READ_ONLY, target_buffer); \
- } else { \
- fprintf(stderr, "tdfxDriver: Can't get %s (%d) read lock\n", \
- (target_buffer == GR_BUFFER_BACKBUFFER) \
- ? "back buffer" \
- : ((target_buffer == GR_BUFFER_AUXBUFFER) \
- ? "depth buffer" \
- : "unknown buffer"), \
- target_buffer); \
- }
-
-#define WRITE_FB_SPAN_LOCK(fxMesa, info, target_buffer, write_mode) \
- UNLOCK_HARDWARE(fxMesa); \
- LOCK_HARDWARE(fxMesa); \
- info.size=sizeof(info); \
- if (fxMesa->Glide.grLfbLock(GR_LFB_WRITE_ONLY, \
- target_buffer, \
- write_mode, \
- GR_ORIGIN_UPPER_LEFT, \
- FXFALSE, \
- &info)) {
-
-#define WRITE_FB_SPAN_UNLOCK(fxMesa, target_buffer) \
- fxMesa->Glide.grLfbUnlock(GR_LFB_WRITE_ONLY, target_buffer); \
- } else { \
- fprintf(stderr, "tdfxDriver: Can't get %s (%d) write lock\n", \
- (target_buffer == GR_BUFFER_BACKBUFFER) \
- ? "back buffer" \
- : ((target_buffer == GR_BUFFER_AUXBUFFER) \
- ? "depth buffer" \
- : "unknown buffer"), \
- target_buffer); \
- }
-
-/*
- * Because the Linear Frame Buffer is not necessarily aligned
- * with the depth buffer, we have to do some fiddling
- * around to get the right addresses.
- *
- * Perhaps a picture is in order. The Linear Frame Buffer
- * looks like this:
- *
- * |<----------------------info.strideInBytes------------->|
- * |<-----physicalStrideInBytes------->|
- * +-----------------------------------+xxxxxxxxxxxxxxxxxxx+
- * | | |
- * | Legal Memory | Forbidden Zone |
- * | | |
- * +-----------------------------------+xxxxxxxxxxxxxxxxxxx+
- *
- * You can only reliably read and write legal locations. Reads
- * and writes from the Forbidden Zone will return undefined values,
- * and may cause segmentation faults.
- *
- * Now, the depth buffer may not end up in a location such each
- * scan line is an LFB line. For example, the depth buffer may
- * look like this:
- *
- * wrapped ordinary.
- * +-----------------------------------+xxxxxxxxxxxxxxxxxxx+
- * |0000000000000000000000 | | back
- * |1111111111111111111111 | | buffer
- * |2222222222222222222222 | |
- * |4096b align. padxx00000000000000000| Forbidden Zone | depth
- * |0000 11111111111111111| | buffer
- * |1111 22222222222222222| |
- * |2222 | |
- * +-----------------------------------+xxxxxxxxxxxxxxxxxxx+
- * where each number is the scan line number. We know it will
- * be aligned on 128 byte boundaries, at least. Aligning this
- * on a scanline boundary causes the back and depth buffers to
- * thrash in the SST1 cache. (Note that the back buffer is always
- * allocated at the beginning of LFB memory, and so it is always
- * properly aligned with the LFB stride.)
- *
- * We call the beginning of the line (which is the rightmost
- * part of the depth line in the picture above) the *ordinary* part
- * of the scanline, and the end of the line (which is the
- * leftmost part, one line below) the *wrapped* part of the scanline.
- * a.) We need to know what x value to subtract from the screen
- * x coordinate to index into the wrapped part.
- * b.) We also need to figure out if we need to read from the ordinary
- * part scan line, or from the wrapped part of the scan line.
- *
- * [ad a]
- * The first wrapped x coordinate is that coordinate such that
- * depthBufferOffset&(info.strideInBytes) + x*elmentSize {*}
- * > physicalStrideInBytes
- * where depthBufferOffset is the LFB distance in bytes
- * from the back buffer to the depth buffer. The expression
- * depthBufferOffset&(info.strideInBytes)
- * is then the offset (in bytes) from the beginining of (any)
- * depth buffer line to first element in the line.
- * Simplifying inequation {*} above we see that x is the smallest
- * value such that
- * x*elementSize > physicalStrideInBytes {**}
- * - depthBufferOffset&(info.strideInBytes)
- * Now, we know that both the summands on the right are multiples of
- * 128, and elementSize <= 4, so if equality holds in {**}, x would
- * be a multiple of 32. Thus we can set x to
- * xwrapped = (physicalStrideInBytes
- * - depthBufferOffset&(info.strideInBytes))/elementSize
- * + 1
- *
- * [ad b]
- * Question b is now simple. We read from the wrapped scan line if
- * x is greater than xwrapped.
- */
-#define TILE_WIDTH_IN_BYTES 128
-#define TILE_WIDTH_IN_ZOXELS(bpz) (TILE_WIDTH_IN_BYTES/(bpz))
-#define TILE_HEIGHT_IN_LINES 32
-typedef struct
-{
- void *lfbPtr;
- void *lfbWrapPtr;
- FxU32 LFBStrideInElts;
- GLint firstWrappedX;
-}
-LFBParameters;
-
-/*
- * We need information about the back buffer. Note that
- * this function *cannot be called* while the aux buffer
- * is locked, or the caller will hang.
- *
- * Only Glide knows the LFB address of the back and depth
- * offsets. The upper levels of Mesa know the depth offset,
- * but that is not in LFB space, it is tiled memory space,
- * and is not useable for us.
- */
-static void
-GetBackBufferInfo(tdfxContextPtr fxMesa, GrLfbInfo_t * backBufferInfo)
-{
- READ_FB_SPAN_LOCK(fxMesa, *backBufferInfo, GR_BUFFER_BACKBUFFER);
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_BACKBUFFER);
-}
-
-static void
-GetFbParams(tdfxContextPtr fxMesa,
- GrLfbInfo_t * info,
- GrLfbInfo_t * backBufferInfo,
- LFBParameters * ReadParamsp, FxU32 elementSize)
-{
- FxU32 physicalStrideInBytes, bufferOffset;
- FxU32 strideInBytes = info->strideInBytes;
- char *lfbPtr = (char *) (info->lfbPtr); /* For arithmetic, use char * */
-
- /*
- * These two come directly from the info structure.
- */
- ReadParamsp->lfbPtr = (void *) lfbPtr;
- ReadParamsp->LFBStrideInElts = strideInBytes / elementSize;
- /*
- * Now, calculate the value of firstWrappedX.
- *
- * The physical stride is the screen width in bytes rounded up to
- * the next highest multiple of 128 bytes. Note that this fails
- * when TILE_WIDTH_IN_BYTES is not a power of two.
- *
- * The buffer Offset is the distance between the beginning of
- * the LFB space, which is the beginning of the back buffer,
- * and the buffer we are gathering information about.
- * We want to make this routine usable for operations on the
- * back buffer, though we don't actually use it on the back
- * buffer. Note, then, that if bufferOffset == 0, the firstWrappedX
- * is in the forbidden zone, and is therefore never reached.
- *
- * Note that if
- * physicalStrideInBytes
- * < bufferOffset&(info->strideInBytes-1)
- * the buffer begins in the forbidden zone. We assert for this.
- */
- bufferOffset = (FxU32)(lfbPtr - (char *) backBufferInfo->lfbPtr);
- physicalStrideInBytes
- = (fxMesa->screen_width * elementSize + TILE_WIDTH_IN_BYTES - 1)
- & ~(TILE_WIDTH_IN_BYTES - 1);
- assert(physicalStrideInBytes > (bufferOffset & (strideInBytes - 1)));
- ReadParamsp->firstWrappedX
- = (physicalStrideInBytes
- - (bufferOffset & (strideInBytes - 1))) / elementSize;
- /*
- * This is the address of the next physical line.
- */
- ReadParamsp->lfbWrapPtr
- = (void *) ((char *) backBufferInfo->lfbPtr
- + (bufferOffset & ~(strideInBytes - 1))
- + (TILE_HEIGHT_IN_LINES) * strideInBytes);
-}
-
-/*
- * These macros fetch data from the frame buffer. The type is
- * the type of data we want to fetch. It should match the type
- * whose size was used with GetFbParams to fill in the structure
- * in *ReadParamsp. We have a macro to read the ordinary
- * part, a second macro to read the wrapped part, and one which
- * will do either. When we are reading a span, we will know
- * when the ordinary part ends, so there's no need to test for
- * it. However, when reading and writing pixels, we don't
- * necessarily know. I suppose it's a matter of taste whether
- * it's better in the macro or in the call.
- *
- * Recall that x and y are screen coordinates.
- */
-#define GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \
- (((type *)((ReadParamsp)->lfbPtr)) \
- [(y) * ((ReadParamsp)->LFBStrideInElts) \
- + (x)])
-#define GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) \
- (((type *)((ReadParamsp)->lfbWrapPtr)) \
- [((y)) * ((ReadParamsp)->LFBStrideInElts) \
- + ((x) - (ReadParamsp)->firstWrappedX)])
-#define GET_FB_DATA(ReadParamsp, type, x, y) \
- (((x) < (ReadParamsp)->firstWrappedX) \
- ? GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \
- : GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y))
-#define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \
- (GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
-#define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \
- (GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
-#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
- do { \
- if ((x) < (ReadParamsp)->firstWrappedX) \
- PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value); \
- else \
- PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value); \
- } while (0)
-
-
-static void
-tdfxDDWriteDepthSpan(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, const void *values,
- const GLubyte mask[])
-{
- const GLuint *depth = (const GLuint *) values;
- tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- GLint bottom = fxMesa->y_offset + fxMesa->height - 1;
- GLuint depth_size = fxMesa->glCtx->Visual.depthBits;
- GLuint stencil_size = fxMesa->glCtx->Visual.stencilBits;
- GrLfbInfo_t info;
- GLubyte visMask[MAX_WIDTH];
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "tdfxmesa: tdfxDDWriteDepthSpan(...)\n");
- }
-
- assert((depth_size == 16) || (depth_size == 24) || (depth_size == 32));
- /*
- * Convert x and y to screen coordinates.
- */
- x += fxMesa->x_offset;
- y = bottom - y;
- if (mask) {
- GLint i;
- GLushort d16;
- GrLfbInfo_t backBufferInfo;
-
- switch (depth_size) {
- case 16:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER,
- GR_LFBWRITEMODE_ANY);
- generate_vismask(fxMesa, x, y, n, visMask);
- {
- LFBParameters ReadParams;
- int wrappedPartStart;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLushort));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- for (i = 0; i < wrappedPartStart; i++) {
- if (mask[i] && visMask[i]) {
- d16 = depth[i];
- PUT_ORDINARY_FB_DATA(&ReadParams, GLushort, x + i, y, d16);
- }
- }
- for (; i < n; i++) {
- if (mask[i] && visMask[i]) {
- d16 = depth[i];
- PUT_WRAPPED_FB_DATA(&ReadParams, GLushort, x + i, y, d16);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- case 24:
- case 32:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER,
- GR_LFBWRITEMODE_ANY);
- generate_vismask(fxMesa, x, y, n, visMask);
- {
- LFBParameters ReadParams;
- int wrappedPartStart;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLuint));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- for (i = 0; i < wrappedPartStart; i++) {
- GLuint d32;
- if (mask[i] && visMask[i]) {
- if (stencil_size > 0) {
- d32 =
- GET_ORDINARY_FB_DATA(&ReadParams, GLuint,
- x + i, y);
- d32 =
- (d32 & 0xFF000000) | (depth[i] & 0x00FFFFFF);
- }
- else {
- d32 = depth[i];
- }
- PUT_ORDINARY_FB_DATA(&ReadParams, GLuint, x + i, y, d32);
- }
- }
- for (; i < n; i++) {
- GLuint d32;
- if (mask[i] && visMask[i]) {
- if (stencil_size > 0) {
- d32 =
- GET_WRAPPED_FB_DATA(&ReadParams, GLuint,
- x + i, y);
- d32 =
- (d32 & 0xFF000000) | (depth[i] & 0x00FFFFFF);
- }
- else {
- d32 = depth[i];
- }
- PUT_WRAPPED_FB_DATA(&ReadParams, GLuint, x + i, y, d32);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- }
- }
- else {
- GLint i;
- GLuint d32;
- GLushort d16;
- GrLfbInfo_t backBufferInfo;
-
- switch (depth_size) {
- case 16:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info,
- GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
- generate_vismask(fxMesa, x, y, n, visMask);
- {
- LFBParameters ReadParams;
- GLuint wrappedPartStart;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLushort));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- for (i = 0; i < wrappedPartStart; i++) {
- if (visMask[i]) {
- d16 = depth[i];
- PUT_ORDINARY_FB_DATA(&ReadParams,
- GLushort,
- x + i, y,
- d16);
- }
- }
- for (; i < n; i++) {
- if (visMask[i]) {
- d16 = depth[i];
- PUT_WRAPPED_FB_DATA(&ReadParams,
- GLushort,
- x + i, y,
- d16);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- case 24:
- case 32:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info,
- GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
- generate_vismask(fxMesa, x, y, n, visMask);
- {
- LFBParameters ReadParams;
- GLuint wrappedPartStart;
-
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLuint));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- for (i = 0; i < wrappedPartStart; i++) {
- if (visMask[i]) {
- if (stencil_size > 0) {
- d32 = GET_ORDINARY_FB_DATA(&ReadParams, GLuint, x + i, y);
- d32 =
- (d32 & 0xFF000000) | (depth[i] & 0x00FFFFFF);
- }
- else {
- d32 = depth[i];
- }
- PUT_ORDINARY_FB_DATA(&ReadParams, GLuint, x + i, y, d32);
- }
- }
- for (; i < n; i++) {
- if (visMask[i]) {
- if (stencil_size > 0) {
- d32 = GET_WRAPPED_FB_DATA(&ReadParams, GLuint, x + i, y);
- d32 =
- (d32 & 0xFF000000) | (depth[i] & 0x00FFFFFF);
- }
- else {
- d32 = depth[i];
- }
- PUT_WRAPPED_FB_DATA(&ReadParams, GLuint, x + i, y, d32);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- }
- }
-}
-
-static void
-tdfxDDWriteMonoDepthSpan(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, const void *value,
- const GLubyte mask[])
-{
- GLuint depthVal = *((GLuint *) value);
- GLuint depths[MAX_WIDTH];
- GLuint i;
- for (i = 0; i < n; i++)
- depths[i] = depthVal;
- tdfxDDWriteDepthSpan(ctx, rb, n, x, y, depths, mask);
-}
-
-
-static void
-tdfxDDReadDepthSpan(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, void *values)
-{
- GLuint *depth = (GLuint *) values;
- tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
- GLuint i;
- GLuint depth_size = fxMesa->glCtx->Visual.depthBits;
- GrLfbInfo_t info;
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "tdfxmesa: tdfxDDReadDepthSpan(...)\n");
- }
-
- /*
- * Convert to screen coordinates.
- */
- x += fxMesa->x_offset;
- y = bottom - y;
- switch (depth_size) {
- case 16:
- {
- LFBParameters ReadParams;
- GrLfbInfo_t backBufferInfo;
- int wrappedPartStart;
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- READ_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER);
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLushort));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- /*
- * Read the line.
- */
- for (i = 0; i < wrappedPartStart; i++) {
- depth[i] =
- GET_ORDINARY_FB_DATA(&ReadParams, GLushort, x + i, y);
- }
- for (; i < n; i++) {
- depth[i] = GET_WRAPPED_FB_DATA(&ReadParams, GLushort,
- x + i, y);
- }
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- }
- case 24:
- case 32:
- {
- LFBParameters ReadParams;
- GrLfbInfo_t backBufferInfo;
- int wrappedPartStart;
- GLuint stencil_size = fxMesa->glCtx->Visual.stencilBits;
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- READ_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER);
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLuint));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- /*
- * Read the line.
- */
- for (i = 0; i < wrappedPartStart; i++) {
- const GLuint mask =
- (stencil_size > 0) ? 0x00FFFFFF : 0xFFFFFFFF;
- depth[i] =
- GET_ORDINARY_FB_DATA(&ReadParams, GLuint, x + i, y);
- depth[i] &= mask;
- }
- for (; i < n; i++) {
- const GLuint mask =
- (stencil_size > 0) ? 0x00FFFFFF : 0xFFFFFFFF;
- depth[i] = GET_WRAPPED_FB_DATA(&ReadParams, GLuint, x + i, y);
- depth[i] &= mask;
- }
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- }
- }
-}
-
-
-static void
-tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values, const GLubyte mask[])
-{
- const GLuint *depth = (const GLuint *) values;
- tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
- GLuint i;
- GLushort d16;
- GLuint d32;
- GLuint depth_size = fxMesa->glCtx->Visual.depthBits;
- GLuint stencil_size = fxMesa->glCtx->Visual.stencilBits;
- GrLfbInfo_t info;
- int xpos;
- int ypos;
- GrLfbInfo_t backBufferInfo;
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "tdfxmesa: tdfxDDWriteDepthPixels(...)\n");
- }
-
- switch (depth_size) {
- case 16:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info,
- GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
- {
- LFBParameters ReadParams;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLushort));
- for (i = 0; i < n; i++) {
- if (mask[i] && visible_pixel(fxMesa, x[i], y[i])) {
- xpos = x[i] + fxMesa->x_offset;
- ypos = bottom - y[i];
- d16 = depth[i];
- PUT_FB_DATA(&ReadParams, GLushort, xpos, ypos, d16);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- case 24:
- case 32:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info,
- GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
- {
- LFBParameters ReadParams;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLuint));
- for (i = 0; i < n; i++) {
- if (mask[i]) {
- if (visible_pixel(fxMesa, x[i], y[i])) {
- xpos = x[i] + fxMesa->x_offset;
- ypos = bottom - y[i];
- if (stencil_size > 0) {
- d32 =
- GET_FB_DATA(&ReadParams, GLuint, xpos, ypos);
- d32 = (d32 & 0xFF000000) | (depth[i] & 0xFFFFFF);
- }
- else {
- d32 = depth[i];
- }
- PUT_FB_DATA(&ReadParams, GLuint, xpos, ypos, d32);
- }
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- }
-}
-
-
-static void
-tdfxDDReadDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GLuint n,
- const GLint x[], const GLint y[], void *values)
-{
- GLuint *depth = (GLuint *) values;
- tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
- GLuint i;
- GLuint depth_size = fxMesa->glCtx->Visual.depthBits;
- GLushort d16;
- int xpos;
- int ypos;
- GrLfbInfo_t info;
- GLuint stencil_size;
- GrLfbInfo_t backBufferInfo;
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "tdfxmesa: tdfxDDReadDepthPixels(...)\n");
- }
-
- assert((depth_size == 16) || (depth_size == 24) || (depth_size == 32));
- switch (depth_size) {
- case 16:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- READ_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER);
- {
- LFBParameters ReadParams;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLushort));
- for (i = 0; i < n; i++) {
- /*
- * Convert to screen coordinates.
- */
- xpos = x[i] + fxMesa->x_offset;
- ypos = bottom - y[i];
- d16 = GET_FB_DATA(&ReadParams, GLushort, xpos, ypos);
- depth[i] = d16;
- }
- }
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- case 24:
- case 32:
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- READ_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER);
- stencil_size = fxMesa->glCtx->Visual.stencilBits;
- {
- LFBParameters ReadParams;
- GetFbParams(fxMesa, &info, &backBufferInfo,
- &ReadParams, sizeof(GLuint));
- for (i = 0; i < n; i++) {
- GLuint d32;
-
- /*
- * Convert to screen coordinates.
- */
- xpos = x[i] + fxMesa->x_offset;
- ypos = bottom - y[i];
- d32 = GET_FB_DATA(&ReadParams, GLuint, xpos, ypos);
- if (stencil_size > 0) {
- d32 &= 0x00FFFFFF;
- }
- depth[i] = d32;
- }
- }
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
- break;
- default:
- assert(0);
- }
-}
-
-/*
- * Stencil buffer read/write functions.
- */
-#define EXTRACT_S_FROM_ZS(zs) (((zs) >> 24) & 0xFF)
-#define EXTRACT_Z_FROM_ZS(zs) ((zs) & 0xffffff)
-#define BUILD_ZS(z, s) (((s) << 24) | (z))
-
-static void
-write_stencil_span(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values, const GLubyte mask[])
-{
- const GLubyte *stencil = (const GLubyte *) values;
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- GrLfbInfo_t backBufferInfo;
-
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
- {
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint winX = fxMesa->x_offset;
- const GLint scrX = winX + x;
- const GLint scrY = winY - y;
- LFBParameters ReadParams;
- GLubyte visMask[MAX_WIDTH];
- GLuint i;
- int wrappedPartStart;
-
- GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams,
- sizeof(GLuint));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- generate_vismask(fxMesa, scrX, scrY, n, visMask);
- for (i = 0; i < wrappedPartStart; i++) {
- if (visMask[i] && (!mask || mask[i])) {
- GLuint z = GET_ORDINARY_FB_DATA(&ReadParams, GLuint,
- scrX + i, scrY) & 0x00FFFFFF;
- z |= (stencil[i] & 0xFF) << 24;
- PUT_ORDINARY_FB_DATA(&ReadParams, GLuint, scrX + i, scrY, z);
- }
- }
- for (; i < n; i++) {
- if (visMask[i] && (!mask || mask[i])) {
- GLuint z = GET_WRAPPED_FB_DATA(&ReadParams, GLuint,
- scrX + i, scrY) & 0x00FFFFFF;
- z |= (stencil[i] & 0xFF) << 24;
- PUT_WRAPPED_FB_DATA(&ReadParams, GLuint, scrX + i, scrY, z);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
-}
-
-
-static void
-write_mono_stencil_span(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value, const GLubyte mask[])
-{
- GLbyte stencilVal = *((GLbyte *) value);
- GLbyte stencils[MAX_WIDTH];
- GLuint i;
- for (i = 0; i < n; i++)
- stencils[i] = stencilVal;
- write_stencil_span(ctx, rb, n, x, y, stencils, mask);
-}
-
-
-static void
-read_stencil_span(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte *stencil = (GLubyte *) values;
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- GrLfbInfo_t backBufferInfo;
-
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- READ_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER);
- {
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint winX = fxMesa->x_offset;
- GLuint i;
- LFBParameters ReadParams;
- int wrappedPartStart;
-
- /*
- * Convert to screen coordinates.
- */
- x += winX;
- y = winY - y;
- GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams,
- sizeof(GLuint));
- if (ReadParams.firstWrappedX <= x) {
- wrappedPartStart = 0;
- }
- else if (n <= (ReadParams.firstWrappedX - x)) {
- wrappedPartStart = n;
- }
- else {
- wrappedPartStart = (ReadParams.firstWrappedX - x);
- }
- for (i = 0; i < wrappedPartStart; i++) {
- stencil[i] = (GET_ORDINARY_FB_DATA(&ReadParams, GLuint,
- x + i, y) >> 24) & 0xFF;
- }
- for (; i < n; i++) {
- stencil[i] = (GET_WRAPPED_FB_DATA(&ReadParams, GLuint,
- x + i, y) >> 24) & 0xFF;
- }
- }
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
-}
-
-
-static void
-write_stencil_pixels(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values, const GLubyte mask[])
-{
- const GLubyte *stencil = (const GLubyte *) values;
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- GrLfbInfo_t backBufferInfo;
-
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- WRITE_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
- {
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint winX = fxMesa->x_offset;
- LFBParameters ReadParams;
- GLuint i;
-
- GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams,
- sizeof(GLuint));
- for (i = 0; i < n; i++) {
- const GLint scrX = winX + x[i];
- const GLint scrY = winY - y[i];
- if ((!mask || mask[i]) && visible_pixel(fxMesa, scrX, scrY)) {
- GLuint z =
- GET_FB_DATA(&ReadParams, GLuint, scrX, scrY) & 0x00FFFFFF;
- z |= (stencil[i] & 0xFF) << 24;
- PUT_FB_DATA(&ReadParams, GLuint, scrX, scrY, z);
- }
- }
- }
- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
-}
-
-
-static void
-read_stencil_pixels(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte *stencil = (GLubyte *) values;
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrLfbInfo_t info;
- GrLfbInfo_t backBufferInfo;
-
- GetBackBufferInfo(fxMesa, &backBufferInfo);
- /*
- * Note that the _LOCK macro adds a curly brace,
- * and the UNLOCK macro removes it.
- */
- READ_FB_SPAN_LOCK(fxMesa, info, GR_BUFFER_AUXBUFFER);
- {
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
- const GLint winX = fxMesa->x_offset;
- GLuint i;
- LFBParameters ReadParams;
-
- GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams,
- sizeof(GLuint));
- for (i = 0; i < n; i++) {
- const GLint scrX = winX + x[i];
- const GLint scrY = winY - y[i];
- stencil[i] =
- (GET_FB_DATA(&ReadParams, GLuint, scrX, scrY) >> 24) & 0xFF;
- }
- }
- READ_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
-}
-
-#define VISUAL_EQUALS_RGBA(vis, r, g, b, a) \
- ((vis.redBits == r) && \
- (vis.greenBits == g) && \
- (vis.blueBits == b) && \
- (vis.alphaBits == a))
-
-
-
-
-/**********************************************************************/
-/* Locking for swrast */
-/**********************************************************************/
-
-
-static void tdfxSpanRenderStart( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- LOCK_HARDWARE(fxMesa);
-}
-
-static void tdfxSpanRenderFinish( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- _swrast_flush( ctx );
- UNLOCK_HARDWARE(fxMesa);
-}
-
-/* Set the buffer used for reading */
-static void tdfxDDSetBuffer( GLcontext *ctx,
- GLframebuffer *buffer, GLuint bufferBit )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- (void) buffer;
-
- switch ( bufferBit ) {
- case BUFFER_BIT_FRONT_LEFT:
- fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
- break;
- case BUFFER_BIT_BACK_LEFT:
- fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
- break;
- default:
- break;
- }
-}
-
-/**********************************************************************/
-/* Initialize swrast device driver */
-/**********************************************************************/
-
-void tdfxDDInitSpanFuncs( GLcontext *ctx )
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx );
- swdd->SetBuffer = tdfxDDSetBuffer;
- swdd->SpanRenderStart = tdfxSpanRenderStart;
- swdd->SpanRenderFinish = tdfxSpanRenderFinish;
-}
-
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-tdfxSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = tdfxReadRGBASpan_RGB565;
- drb->Base.GetValues = tdfxReadRGBAPixels_RGB565;
- drb->Base.PutRow = tdfxWriteRGBASpan_RGB565;
- drb->Base.PutRowRGB = tdfxWriteRGBSpan_RGB565;
- drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_RGB565;
- drb->Base.PutValues = tdfxWriteRGBAPixels_RGB565;
- drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_RGB565;
- }
- else if (vis->redBits == 8 && vis->greenBits == 8
- && vis->blueBits == 8 && vis->alphaBits == 0) {
- drb->Base.GetRow = tdfxReadRGBASpan_RGB888;
- drb->Base.GetValues = tdfxReadRGBAPixels_RGB888;
- drb->Base.PutRow = tdfxWriteRGBASpan_RGB888;
- drb->Base.PutRowRGB = tdfxWriteRGBSpan_RGB888;
- drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_RGB888;
- drb->Base.PutValues = tdfxWriteRGBAPixels_RGB888;
- drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_RGB888;
- }
- else if (vis->redBits == 8 && vis->greenBits == 8
- && vis->blueBits == 8 && vis->alphaBits == 8) {
- drb->Base.GetRow = tdfxReadRGBASpan_ARGB8888;
- drb->Base.GetValues = tdfxReadRGBAPixels_ARGB8888;
- drb->Base.PutRow = tdfxWriteRGBASpan_ARGB8888;
- drb->Base.PutRowRGB = tdfxWriteRGBSpan_ARGB8888;
- drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_ARGB8888;
- drb->Base.PutValues = tdfxWriteRGBAPixels_ARGB8888;
- drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_ARGB8888;
- }
- else {
- _mesa_problem(NULL, "problem in tdfxSetSpanFunctions");
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16 ||
- drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = tdfxDDReadDepthSpan;
- drb->Base.GetValues = tdfxDDReadDepthPixels;
- drb->Base.PutRow = tdfxDDWriteDepthSpan;
- drb->Base.PutMonoRow = tdfxDDWriteMonoDepthSpan;
- drb->Base.PutValues = tdfxDDWriteDepthPixels;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = read_stencil_span;
- drb->Base.GetValues = read_stencil_pixels;
- drb->Base.PutRow = write_stencil_span;
- drb->Base.PutMonoRow = write_mono_stencil_span;
- drb->Base.PutValues = write_stencil_pixels;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.h
deleted file mode 100644
index 62044144f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_span.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.h,v 1.1 2001/03/21 16:14:28 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#ifndef __TDFX_SPAN_H__
-#define __TDFX_SPAN_H__
-
-#include "context.h"
-#include "drirenderbuffer.h"
-
-extern void tdfxDDInitSpanFuncs( GLcontext *ctx );
-
-extern void
-tdfxSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.c
deleted file mode 100644
index 85d99bb05..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.c
+++ /dev/null
@@ -1,1449 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */
-
-/*
- * New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- * Keith Whitwell <keith@tungstengraphics.com> (port to 3.5)
- *
- */
-
-#include "mtypes.h"
-#include "buffers.h"
-#include "colormac.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tdfx_context.h"
-#include "tdfx_state.h"
-#include "tdfx_vb.h"
-#include "tdfx_tex.h"
-#include "tdfx_texman.h"
-#include "tdfx_texstate.h"
-#include "tdfx_tris.h"
-#include "tdfx_render.h"
-
-
-
-/* =============================================================
- * Alpha blending
- */
-
-static void tdfxUpdateAlphaMode( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrCmpFnc_t func;
- GrAlphaBlendFnc_t srcRGB, dstRGB, srcA, dstA;
- GrAlphaBlendOp_t eqRGB, eqA;
- GrAlpha_t ref = (GLint) (ctx->Color.AlphaRef * 255.0);
-
- GLboolean isNapalm = TDFX_IS_NAPALM(fxMesa);
- GLboolean have32bpp = (ctx->Visual.greenBits == 8);
- GLboolean haveAlpha = fxMesa->haveHwAlpha;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- if ( ctx->Color.AlphaEnabled ) {
- func = ctx->Color.AlphaFunc - GL_NEVER + GR_CMP_NEVER;
- } else {
- func = GR_CMP_ALWAYS;
- }
-
- if ( ctx->Color.BlendEnabled
- && (fxMesa->Fallback & TDFX_FALLBACK_BLEND) == 0 ) {
- switch ( ctx->Color.BlendSrcRGB ) {
- case GL_ZERO:
- srcRGB = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- srcRGB = GR_BLEND_ONE;
- break;
- case GL_DST_COLOR:
- srcRGB = GR_BLEND_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- srcRGB = GR_BLEND_ONE_MINUS_DST_COLOR;
- break;
- case GL_SRC_ALPHA:
- srcRGB = GR_BLEND_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- srcRGB = GR_BLEND_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- srcRGB = haveAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*JJJ*/;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- srcRGB = haveAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*JJJ*/;
- break;
- case GL_SRC_ALPHA_SATURATE:
- srcRGB = GR_BLEND_ALPHA_SATURATE;
- break;
- case GL_SRC_COLOR:
- if (isNapalm) {
- srcRGB = GR_BLEND_SAME_COLOR_EXT;
- break;
- }
- case GL_ONE_MINUS_SRC_COLOR:
- if (isNapalm) {
- srcRGB = GR_BLEND_ONE_MINUS_SAME_COLOR_EXT;
- break;
- }
- default:
- srcRGB = GR_BLEND_ONE;
- }
-
- switch ( ctx->Color.BlendSrcA ) {
- case GL_ZERO:
- srcA = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- srcA = GR_BLEND_ONE;
- break;
- case GL_SRC_COLOR:
- case GL_SRC_ALPHA:
- srcA = have32bpp ? GR_BLEND_SRC_ALPHA : GR_BLEND_ONE/*JJJ*/;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_ONE_MINUS_SRC_ALPHA:
- srcA = have32bpp ? GR_BLEND_ONE_MINUS_SRC_ALPHA : GR_BLEND_ONE/*JJJ*/;
- break;
- case GL_DST_COLOR:
- case GL_DST_ALPHA:
- srcA = (have32bpp && haveAlpha) ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*JJJ*/;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- case GL_ONE_MINUS_DST_ALPHA:
- srcA = (have32bpp && haveAlpha) ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*JJJ*/;
- break;
- case GL_SRC_ALPHA_SATURATE:
- srcA = GR_BLEND_ONE;
- break;
- default:
- srcA = GR_BLEND_ONE;
- }
-
- switch ( ctx->Color.BlendDstRGB ) {
- case GL_ZERO:
- dstRGB = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- dstRGB = GR_BLEND_ONE;
- break;
- case GL_SRC_COLOR:
- dstRGB = GR_BLEND_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- dstRGB = GR_BLEND_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- dstRGB = GR_BLEND_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- dstRGB = GR_BLEND_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- dstRGB = haveAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*JJJ*/;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- dstRGB = haveAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*JJJ*/;
- break;
- case GL_DST_COLOR:
- if (isNapalm) {
- dstRGB = GR_BLEND_SAME_COLOR_EXT;
- break;
- }
- case GL_ONE_MINUS_DST_COLOR:
- if (isNapalm) {
- dstRGB = GR_BLEND_ONE_MINUS_SAME_COLOR_EXT;
- break;
- }
- default:
- dstRGB = GR_BLEND_ZERO;
- }
-
- switch ( ctx->Color.BlendDstA ) {
- case GL_ZERO:
- dstA = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- dstA = GR_BLEND_ONE;
- break;
- case GL_SRC_COLOR:
- case GL_SRC_ALPHA:
- dstA = have32bpp ? GR_BLEND_SRC_ALPHA : GR_BLEND_ZERO/*JJJ*/;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_ONE_MINUS_SRC_ALPHA:
- dstA = have32bpp ? GR_BLEND_ONE_MINUS_SRC_ALPHA : GR_BLEND_ZERO/*JJJ*/;
- break;
- case GL_DST_COLOR:
- case GL_DST_ALPHA:
- dstA = have32bpp ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*JJJ*/;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- case GL_ONE_MINUS_DST_ALPHA:
- dstA = have32bpp ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*JJJ*/;
- break;
- default:
- dstA = GR_BLEND_ZERO;
- }
-
- switch ( ctx->Color.BlendEquationRGB ) {
- case GL_FUNC_SUBTRACT:
- eqRGB = GR_BLEND_OP_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- eqRGB = GR_BLEND_OP_REVSUB;
- break;
- case GL_FUNC_ADD:
- default:
- eqRGB = GR_BLEND_OP_ADD;
- break;
- }
-
- switch ( ctx->Color.BlendEquationA ) {
- case GL_FUNC_SUBTRACT:
- eqA = GR_BLEND_OP_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- eqA = GR_BLEND_OP_REVSUB;
- break;
- case GL_FUNC_ADD:
- default:
- eqA = GR_BLEND_OP_ADD;
- break;
- }
- } else {
- /* blend disabled */
- srcRGB = GR_BLEND_ONE;
- dstRGB = GR_BLEND_ZERO;
- eqRGB = GR_BLEND_OP_ADD;
- srcA = GR_BLEND_ONE;
- dstA = GR_BLEND_ZERO;
- eqA = GR_BLEND_OP_ADD;
- }
-
- if ( fxMesa->Color.AlphaFunc != func ) {
- fxMesa->Color.AlphaFunc = func;
- fxMesa->dirty |= TDFX_UPLOAD_ALPHA_TEST;
- }
- if ( fxMesa->Color.AlphaRef != ref ) {
- fxMesa->Color.AlphaRef = ref;
- fxMesa->dirty |= TDFX_UPLOAD_ALPHA_REF;
- }
-
- if ( fxMesa->Color.BlendSrcRGB != srcRGB ||
- fxMesa->Color.BlendDstRGB != dstRGB ||
- fxMesa->Color.BlendEqRGB != eqRGB ||
- fxMesa->Color.BlendSrcA != srcA ||
- fxMesa->Color.BlendDstA != dstA ||
- fxMesa->Color.BlendEqA != eqA )
- {
- fxMesa->Color.BlendSrcRGB = srcRGB;
- fxMesa->Color.BlendDstRGB = dstRGB;
- fxMesa->Color.BlendEqRGB = eqRGB;
- fxMesa->Color.BlendSrcA = srcA;
- fxMesa->Color.BlendDstA = dstA;
- fxMesa->Color.BlendEqA = eqA;
- fxMesa->dirty |= TDFX_UPLOAD_BLEND_FUNC;
- }
-}
-
-static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_ALPHA;
-}
-
-static void tdfxDDBlendEquationSeparate( GLcontext *ctx,
- GLenum modeRGB, GLenum modeA )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- assert( modeRGB == modeA );
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_ALPHA;
-}
-
-static void tdfxDDBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_ALPHA;
-
- /*
- * XXX - Voodoo5 seems to suffer from precision problems in some
- * blend modes. To pass all the conformance tests we'd have to
- * fall back to software for many modes. Revisit someday.
- */
-}
-
-/* =============================================================
- * Stipple
- */
-
-void tdfxUpdateStipple( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- GrStippleMode_t mode = GR_STIPPLE_DISABLE;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- FLUSH_BATCH( fxMesa );
-
- if (ctx->Polygon.StippleFlag) {
- mode = GR_STIPPLE_PATTERN;
- }
-
- if ( fxMesa->Stipple.Mode != mode ) {
- fxMesa->Stipple.Mode = mode;
- fxMesa->dirty |= TDFX_UPLOAD_STIPPLE;
- }
-}
-
-
-/* =============================================================
- * Depth testing
- */
-
-static void tdfxUpdateZMode( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- GrCmpFnc_t func;
- FxI32 bias;
- FxBool mask;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API )
- fprintf( stderr, "%s()\n", __FUNCTION__ );
-
-
- bias = (FxI32) (ctx->Polygon.OffsetUnits * TDFX_DEPTH_BIAS_SCALE);
-
- if ( ctx->Depth.Test ) {
- func = ctx->Depth.Func - GL_NEVER + GR_CMP_NEVER;
- mask = ctx->Depth.Mask;
- }
- else {
- /* depth testing disabled */
- func = GR_CMP_ALWAYS; /* fragments always pass */
- mask = FXFALSE; /* zbuffer is not touched */
- }
-
- fxMesa->Depth.Clear = (FxU32) (ctx->DrawBuffer->_DepthMaxF * ctx->Depth.Clear);
-
- if ( fxMesa->Depth.Bias != bias ) {
- fxMesa->Depth.Bias = bias;
- fxMesa->dirty |= TDFX_UPLOAD_DEPTH_BIAS;
- }
- if ( fxMesa->Depth.Func != func ) {
- fxMesa->Depth.Func = func;
- fxMesa->dirty |= TDFX_UPLOAD_DEPTH_FUNC | TDFX_UPLOAD_DEPTH_MASK;
- }
- if ( fxMesa->Depth.Mask != mask ) {
- fxMesa->Depth.Mask = mask;
- fxMesa->dirty |= TDFX_UPLOAD_DEPTH_MASK;
- }
-}
-
-static void tdfxDDDepthFunc( GLcontext *ctx, GLenum func )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_DEPTH;
-}
-
-static void tdfxDDDepthMask( GLcontext *ctx, GLboolean flag )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_DEPTH;
-}
-
-static void tdfxDDClearDepth( GLcontext *ctx, GLclampd d )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_DEPTH;
-}
-
-
-
-/* =============================================================
- * Stencil
- */
-
-
-/* Evaluate all stencil state and make the Glide calls.
- */
-static GrStencil_t convertGLStencilOp( GLenum op )
-{
- switch ( op ) {
- case GL_KEEP:
- return GR_STENCILOP_KEEP;
- case GL_ZERO:
- return GR_STENCILOP_ZERO;
- case GL_REPLACE:
- return GR_STENCILOP_REPLACE;
- case GL_INCR:
- return GR_STENCILOP_INCR_CLAMP;
- case GL_DECR:
- return GR_STENCILOP_DECR_CLAMP;
- case GL_INVERT:
- return GR_STENCILOP_INVERT;
- case GL_INCR_WRAP_EXT:
- return GR_STENCILOP_INCR_WRAP;
- case GL_DECR_WRAP_EXT:
- return GR_STENCILOP_DECR_WRAP;
- default:
- _mesa_problem( NULL, "bad stencil op in convertGLStencilOp" );
- }
- return GR_STENCILOP_KEEP; /* never get, silence compiler warning */
-}
-
-
-static void tdfxUpdateStencil( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- if (fxMesa->haveHwStencil) {
- if (ctx->Stencil.Enabled) {
- fxMesa->Stencil.Function = ctx->Stencil.Function[0] - GL_NEVER + GR_CMP_NEVER;
- fxMesa->Stencil.RefValue = ctx->Stencil.Ref[0];
- fxMesa->Stencil.ValueMask = ctx->Stencil.ValueMask[0];
- fxMesa->Stencil.WriteMask = ctx->Stencil.WriteMask[0];
- fxMesa->Stencil.FailFunc = convertGLStencilOp(ctx->Stencil.FailFunc[0]);
- fxMesa->Stencil.ZFailFunc = convertGLStencilOp(ctx->Stencil.ZFailFunc[0]);
- fxMesa->Stencil.ZPassFunc = convertGLStencilOp(ctx->Stencil.ZPassFunc[0]);
- fxMesa->Stencil.Clear = ctx->Stencil.Clear & 0xff;
- }
- fxMesa->dirty |= TDFX_UPLOAD_STENCIL;
- }
-}
-
-
-static void tdfxDDStencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_STENCIL;
-}
-
-static void tdfxDDStencilMask( GLcontext *ctx, GLuint mask )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_STENCIL;
-}
-
-static void tdfxDDStencilOp( GLcontext *ctx, GLenum sfail,
- GLenum zfail, GLenum zpass )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_STENCIL;
-}
-
-
-/* =============================================================
- * Fog - orthographic fog still not working
- */
-
-static void tdfxUpdateFogAttrib( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrFogMode_t mode;
- GrColor_t color;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- if ( ctx->Fog.Enabled ) {
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- mode = GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT;
- } else {
- mode = GR_FOG_WITH_TABLE_ON_Q;
- }
- } else {
- mode = GR_FOG_DISABLE;
- }
-
- color = TDFXPACKCOLOR888((GLubyte)(ctx->Fog.Color[0]*255.0F),
- (GLubyte)(ctx->Fog.Color[1]*255.0F),
- (GLubyte)(ctx->Fog.Color[2]*255.0F));
-
- if ( fxMesa->Fog.Mode != mode ) {
- fxMesa->Fog.Mode = mode;
- fxMesa->dirty |= TDFX_UPLOAD_FOG_MODE;
- fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT;/*JJJ*/
- }
- if ( fxMesa->Fog.Color != color ) {
- fxMesa->Fog.Color = color;
- fxMesa->dirty |= TDFX_UPLOAD_FOG_COLOR;
- }
- if ( fxMesa->Fog.TableMode != ctx->Fog.Mode ||
- fxMesa->Fog.Density != ctx->Fog.Density ||
- fxMesa->Fog.Near != ctx->Fog.Start ||
- fxMesa->Fog.Far != ctx->Fog.End )
- {
- switch( ctx->Fog.Mode ) {
- case GL_EXP:
- fxMesa->Glide.guFogGenerateExp( fxMesa->Fog.Table, ctx->Fog.Density );
- break;
- case GL_EXP2:
- fxMesa->Glide.guFogGenerateExp2( fxMesa->Fog.Table, ctx->Fog.Density);
- break;
- case GL_LINEAR:
- fxMesa->Glide.guFogGenerateLinear( fxMesa->Fog.Table,
- ctx->Fog.Start, ctx->Fog.End );
- break;
- }
-
- fxMesa->Fog.TableMode = ctx->Fog.Mode;
- fxMesa->Fog.Density = ctx->Fog.Density;
- fxMesa->Fog.Near = ctx->Fog.Start;
- fxMesa->Fog.Far = ctx->Fog.End;
- fxMesa->dirty |= TDFX_UPLOAD_FOG_TABLE;
- }
-}
-
-static void tdfxDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_FOG;
-
- switch (pname) {
- case GL_FOG_COORDINATE_SOURCE_EXT: {
- GLenum p = (GLenum)*param;
- if (p == GL_FOG_COORDINATE_EXT) {
- _swrast_allow_vertex_fog(ctx, GL_TRUE);
- _swrast_allow_pixel_fog(ctx, GL_FALSE);
- _tnl_allow_vertex_fog( ctx, GL_TRUE);
- _tnl_allow_pixel_fog( ctx, GL_FALSE);
- } else {
- _swrast_allow_vertex_fog(ctx, GL_FALSE);
- _swrast_allow_pixel_fog(ctx, GL_TRUE);
- _tnl_allow_vertex_fog( ctx, GL_FALSE);
- _tnl_allow_pixel_fog( ctx, GL_TRUE);
- }
- break;
- }
- default:
- ;
- }
-}
-
-
-/* =============================================================
- * Clipping
- */
-
-static int intersect_rect( drm_clip_rect_t *out,
- const drm_clip_rect_t *a,
- const drm_clip_rect_t *b)
-{
- *out = *a;
- if (b->x1 > out->x1) out->x1 = b->x1;
- if (b->y1 > out->y1) out->y1 = b->y1;
- if (b->x2 < out->x2) out->x2 = b->x2;
- if (b->y2 < out->y2) out->y2 = b->y2;
- if (out->x1 >= out->x2) return 0;
- if (out->y1 >= out->y2) return 0;
- return 1;
-}
-
-
-/*
- * Examine XF86 cliprect list and scissor state to recompute our
- * cliprect list.
- */
-void tdfxUpdateClipping( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = fxMesa->driDrawable;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- assert(ctx);
- assert(fxMesa);
- assert(dPriv);
-
- if ( dPriv->x != fxMesa->x_offset || dPriv->y != fxMesa->y_offset ||
- dPriv->w != fxMesa->width || dPriv->h != fxMesa->height ) {
- fxMesa->x_offset = dPriv->x;
- fxMesa->y_offset = dPriv->y;
- fxMesa->width = dPriv->w;
- fxMesa->height = dPriv->h;
- fxMesa->y_delta =
- fxMesa->screen_height - fxMesa->y_offset - fxMesa->height;
- tdfxUpdateViewport( ctx );
- }
-
- if (fxMesa->scissoredClipRects && fxMesa->pClipRects) {
- free(fxMesa->pClipRects);
- }
-
- if (ctx->Scissor.Enabled) {
- /* intersect OpenGL scissor box with all cliprects to make a new
- * list of cliprects.
- */
- drm_clip_rect_t scissor;
- int x1 = ctx->Scissor.X + fxMesa->x_offset;
- int y1 = fxMesa->screen_height - fxMesa->y_delta
- - ctx->Scissor.Y - ctx->Scissor.Height;
- int x2 = x1 + ctx->Scissor.Width;
- int y2 = y1 + ctx->Scissor.Height;
- scissor.x1 = MAX2(x1, 0);
- scissor.y1 = MAX2(y1, 0);
- scissor.x2 = MAX2(x2, 0);
- scissor.y2 = MAX2(y2, 0);
-
- assert(scissor.x2 >= scissor.x1);
- assert(scissor.y2 >= scissor.y1);
-
- fxMesa->pClipRects = malloc(dPriv->numClipRects
- * sizeof(drm_clip_rect_t));
- if (fxMesa->pClipRects) {
- int i;
- fxMesa->numClipRects = 0;
- for (i = 0; i < dPriv->numClipRects; i++) {
- if (intersect_rect(&fxMesa->pClipRects[fxMesa->numClipRects],
- &scissor, &dPriv->pClipRects[i])) {
- fxMesa->numClipRects++;
- }
- }
- fxMesa->scissoredClipRects = GL_TRUE;
- }
- else {
- /* out of memory, forgo scissor */
- fxMesa->numClipRects = dPriv->numClipRects;
- fxMesa->pClipRects = dPriv->pClipRects;
- fxMesa->scissoredClipRects = GL_FALSE;
- }
- }
- else {
- fxMesa->numClipRects = dPriv->numClipRects;
- fxMesa->pClipRects = dPriv->pClipRects;
- fxMesa->scissoredClipRects = GL_FALSE;
- }
-
- fxMesa->dirty |= TDFX_UPLOAD_CLIP;
-}
-
-
-
-/* =============================================================
- * Culling
- */
-
-void tdfxUpdateCull( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrCullMode_t mode = GR_CULL_DISABLE;
-
- /* KW: don't need to check raster_primitive here as we don't
- * attempt to draw lines or points with triangles.
- */
- if ( ctx->Polygon.CullFlag ) {
- switch ( ctx->Polygon.CullFaceMode ) {
- case GL_FRONT:
- if ( ctx->Polygon.FrontFace == GL_CCW ) {
- mode = GR_CULL_POSITIVE;
- } else {
- mode = GR_CULL_NEGATIVE;
- }
- break;
-
- case GL_BACK:
- if ( ctx->Polygon.FrontFace == GL_CCW ) {
- mode = GR_CULL_NEGATIVE;
- } else {
- mode = GR_CULL_POSITIVE;
- }
- break;
-
- case GL_FRONT_AND_BACK:
- /* Handled as a fallback on triangles in tdfx_tris.c */
- return;
-
- default:
- ASSERT(0);
- break;
- }
- }
-
- if ( fxMesa->CullMode != mode ) {
- fxMesa->CullMode = mode;
- fxMesa->dirty |= TDFX_UPLOAD_CULL;
- }
-}
-
-static void tdfxDDCullFace( GLcontext *ctx, GLenum mode )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_CULL;
-}
-
-static void tdfxDDFrontFace( GLcontext *ctx, GLenum mode )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_CULL;
-}
-
-
-/* =============================================================
- * Line drawing.
- */
-
-static void tdfxUpdateLine( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- FLUSH_BATCH( fxMesa );
- fxMesa->dirty |= TDFX_UPLOAD_LINE;
-}
-
-
-static void tdfxDDLineWidth( GLcontext *ctx, GLfloat width )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_LINE;
-}
-
-
-/* =============================================================
- * Color Attributes
- */
-
-static void tdfxDDColorMask( GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FLUSH_BATCH( fxMesa );
-
- if ( fxMesa->Color.ColorMask[RCOMP] != r ||
- fxMesa->Color.ColorMask[GCOMP] != g ||
- fxMesa->Color.ColorMask[BCOMP] != b ||
- fxMesa->Color.ColorMask[ACOMP] != a ) {
- fxMesa->Color.ColorMask[RCOMP] = r;
- fxMesa->Color.ColorMask[GCOMP] = g;
- fxMesa->Color.ColorMask[BCOMP] = b;
- fxMesa->Color.ColorMask[ACOMP] = a;
- fxMesa->dirty |= TDFX_UPLOAD_COLOR_MASK;
-
- if (ctx->Visual.redBits < 8) {
- /* Can't do RGB colormasking in 16bpp mode. */
- /* We can completely ignore the alpha mask. */
- FALLBACK( fxMesa, TDFX_FALLBACK_COLORMASK, (r != g || g != b) );
- }
- }
-}
-
-
-static void tdfxDDClearColor( GLcontext *ctx,
- const GLfloat color[4] )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLubyte c[4];
- FLUSH_BATCH( fxMesa );
- CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
- fxMesa->Color.ClearColor = TDFXPACKCOLOR888( c[0], c[1], c[2] );
- fxMesa->Color.ClearAlpha = c[3];
-}
-
-
-/* =============================================================
- * Light Model
- */
-
-static void tdfxDDLightModelfv( GLcontext *ctx, GLenum pname,
- const GLfloat *param )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if ( pname == GL_LIGHT_MODEL_COLOR_CONTROL ) {
- FALLBACK( fxMesa, TDFX_FALLBACK_SPECULAR,
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR ));
- }
-}
-
-static void tdfxDDShadeModel( GLcontext *ctx, GLenum mode )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- /* FIXME: Can we implement native flat shading? */
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
-}
-
-
-/* =============================================================
- * Scissor
- */
-
-static void
-tdfxDDScissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_CLIP;
-}
-
-/* =============================================================
- * Render
- */
-
-static void tdfxUpdateRenderAttrib( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- FLUSH_BATCH( fxMesa );
- fxMesa->dirty |= TDFX_UPLOAD_RENDER_BUFFER;
-}
-
-/* =============================================================
- * Viewport
- */
-
-void tdfxUpdateViewport( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = fxMesa->hw_viewport;
-
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + fxMesa->x_offset + TRI_X_OFFSET;
- m[MAT_SY] = v[MAT_SY];
- m[MAT_TY] = v[MAT_TY] + fxMesa->y_delta + TRI_Y_OFFSET;
- m[MAT_SZ] = v[MAT_SZ];
- m[MAT_TZ] = v[MAT_TZ];
-
- fxMesa->SetupNewInputs |= VERT_BIT_POS;
-}
-
-
-static void tdfxDDViewport( GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_VIEWPORT;
-}
-
-
-static void tdfxDDDepthRange( GLcontext *ctx, GLclampd nearVal, GLclampd farVal )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_VIEWPORT;
-}
-
-
-/* =============================================================
- * State enable/disable
- */
-
-static void tdfxDDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- switch ( cap ) {
- case GL_ALPHA_TEST:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_ALPHA;
- break;
-
- case GL_BLEND:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_ALPHA;
- FALLBACK( fxMesa, TDFX_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY)/*JJJ - more blending*/);
- break;
-
- case GL_CULL_FACE:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_CULL;
- break;
-
- case GL_DEPTH_TEST:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_DEPTH;
- break;
-
- case GL_DITHER:
- FLUSH_BATCH( fxMesa );
- if ( state ) {
- fxMesa->Color.Dither = GR_DITHER_2x2;
- } else {
- fxMesa->Color.Dither = GR_DITHER_DISABLE;
- }
- fxMesa->dirty |= TDFX_UPLOAD_DITHER;
- break;
-
- case GL_FOG:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_FOG;
- break;
-
- case GL_COLOR_LOGIC_OP:
- FALLBACK( fxMesa, TDFX_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
- break;
-
- case GL_LIGHTING:
- FALLBACK( fxMesa, TDFX_FALLBACK_SPECULAR,
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR ));
- break;
-
- case GL_LINE_SMOOTH:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_LINE;
- break;
-
- case GL_LINE_STIPPLE:
- FALLBACK(fxMesa, TDFX_FALLBACK_LINE_STIPPLE, state);
- break;
-
- case GL_POLYGON_STIPPLE:
- FLUSH_BATCH(fxMesa);
- fxMesa->new_state |= TDFX_NEW_STIPPLE;
- break;
-
- case GL_SCISSOR_TEST:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_CLIP;
- break;
-
- case GL_STENCIL_TEST:
- FLUSH_BATCH( fxMesa );
- FALLBACK( fxMesa, TDFX_FALLBACK_STENCIL, state && !fxMesa->haveHwStencil);
- fxMesa->new_state |= TDFX_NEW_STENCIL;
- break;
-
- case GL_TEXTURE_3D:
- FLUSH_BATCH( fxMesa );
- FALLBACK( fxMesa, TDFX_FALLBACK_TEXTURE_MAP, state); /* wrong */
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- break;
-
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- break;
-
- default:
- return;
- }
-}
-
-
-
-/* Set the buffer used for drawing */
-/* XXX support for separate read/draw buffers hasn't been tested */
-static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- FLUSH_BATCH( fxMesa );
-
- /*
- * _ColorDrawBufferMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
- fxMesa->new_state |= TDFX_NEW_RENDER;
- FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case BUFFER_BIT_BACK_LEFT:
- fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
- fxMesa->new_state |= TDFX_NEW_RENDER;
- FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- case 0:
- FX_grColorMaskv( ctx, false4 );
- FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
- FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE );
- break;
- }
-
- /* We want to update the s/w rast state too so that tdfxDDSetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-}
-
-
-static void tdfxDDReadBuffer( GLcontext *ctx, GLenum mode )
-{
- /* XXX ??? */
-}
-
-
-/* =============================================================
- * Polygon stipple
- */
-
-static void tdfxDDPolygonStipple( GLcontext *ctx, const GLubyte *mask )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- const GLubyte *m = mask;
- GLubyte q[4];
- int i,j,k;
- GLboolean allBitsSet;
-
-/* int active = (ctx->Polygon.StippleFlag && */
-/* fxMesa->reduced_prim == GL_TRIANGLES); */
-
- FLUSH_BATCH(fxMesa);
- fxMesa->Stipple.Pattern = 0xffffffff;
- fxMesa->dirty |= TDFX_UPLOAD_STIPPLE;
- fxMesa->new_state |= TDFX_NEW_STIPPLE;
-
- /* Check if the stipple pattern is fully opaque. If so, use software
- * rendering. This basically a trick to make sure the OpenGL conformance
- * test passes.
- */
- allBitsSet = GL_TRUE;
- for (i = 0; i < 32; i++) {
- if (((GLuint *) mask)[i] != 0xffffffff) {
- allBitsSet = GL_FALSE;
- break;
- }
- }
- if (allBitsSet) {
- fxMesa->haveHwStipple = GL_FALSE;
- return;
- }
-
- q[0] = mask[0];
- q[1] = mask[4];
- q[2] = mask[8];
- q[3] = mask[12];
-
- for (k = 0 ; k < 8 ; k++)
- for (j = 0 ; j < 4; j++)
- for (i = 0 ; i < 4 ; i++,m++) {
- if (*m != q[j]) {
- fxMesa->haveHwStipple = GL_FALSE;
- return;
- }
- }
-
- fxMesa->haveHwStipple = GL_TRUE;
- fxMesa->Stipple.Pattern = ( (q[0] << 0) |
- (q[1] << 8) |
- (q[2] << 16) |
- (q[3] << 24) );
-}
-
-
-
-static void tdfxDDRenderMode( GLcontext *ctx, GLenum mode )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- FALLBACK( fxMesa, TDFX_FALLBACK_RENDER_MODE, (mode != GL_RENDER) );
-}
-
-
-
-static void tdfxDDPrintState( const char *msg, GLuint flags )
-{
- fprintf( stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n",
- msg,
- flags,
- (flags & TDFX_NEW_COLOR) ? "color, " : "",
- (flags & TDFX_NEW_ALPHA) ? "alpha, " : "",
- (flags & TDFX_NEW_DEPTH) ? "depth, " : "",
- (flags & TDFX_NEW_RENDER) ? "render, " : "",
- (flags & TDFX_NEW_FOG) ? "fog, " : "",
- (flags & TDFX_NEW_STENCIL) ? "stencil, " : "",
- (flags & TDFX_NEW_STIPPLE) ? "stipple, " : "",
- (flags & TDFX_NEW_CLIP) ? "clip, " : "",
- (flags & TDFX_NEW_VIEWPORT) ? "viewport, " : "",
- (flags & TDFX_NEW_CULL) ? "cull, " : "",
- (flags & TDFX_NEW_GLIDE) ? "glide, " : "",
- (flags & TDFX_NEW_TEXTURE) ? "texture, " : "",
- (flags & TDFX_NEW_CONTEXT) ? "context, " : "");
-}
-
-
-
-void tdfxDDUpdateHwState( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- int new_state = fxMesa->new_state;
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- fprintf( stderr, "%s()\n", __FUNCTION__ );
- }
-
- if ( new_state )
- {
- FLUSH_BATCH( fxMesa );
-
- fxMesa->new_state = 0;
-
- if ( 0 )
- tdfxDDPrintState( "tdfxUpdateHwState", new_state );
-
- /* Update the various parts of the context's state.
- */
- if ( new_state & TDFX_NEW_ALPHA ) {
- tdfxUpdateAlphaMode( ctx );
- }
-
- if ( new_state & TDFX_NEW_DEPTH )
- tdfxUpdateZMode( ctx );
-
- if ( new_state & TDFX_NEW_FOG )
- tdfxUpdateFogAttrib( ctx );
-
- if ( new_state & TDFX_NEW_CLIP )
- tdfxUpdateClipping( ctx );
-
- if ( new_state & TDFX_NEW_STIPPLE )
- tdfxUpdateStipple( ctx );
-
- if ( new_state & TDFX_NEW_CULL )
- tdfxUpdateCull( ctx );
-
- if ( new_state & TDFX_NEW_LINE )
- tdfxUpdateLine( ctx );
-
- if ( new_state & TDFX_NEW_VIEWPORT )
- tdfxUpdateViewport( ctx );
-
- if ( new_state & TDFX_NEW_RENDER )
- tdfxUpdateRenderAttrib( ctx );
-
- if ( new_state & TDFX_NEW_STENCIL )
- tdfxUpdateStencil( ctx );
-
- if ( new_state & TDFX_NEW_TEXTURE ) {
- tdfxUpdateTextureState( ctx );
- }
- else if ( new_state & TDFX_NEW_TEXTURE_BIND ) {
- tdfxUpdateTextureBinding( ctx );
- }
- }
-
- if ( 0 ) {
- FxI32 bias = (FxI32) (ctx->Polygon.OffsetUnits * TDFX_DEPTH_BIAS_SCALE);
-
- if ( fxMesa->Depth.Bias != bias ) {
- fxMesa->Depth.Bias = bias;
- fxMesa->dirty |= TDFX_UPLOAD_DEPTH_BIAS;
- }
- }
-
- if ( fxMesa->dirty ) {
- LOCK_HARDWARE( fxMesa );
- tdfxEmitHwStateLocked( fxMesa );
- UNLOCK_HARDWARE( fxMesa );
- }
-}
-
-
-static void tdfxDDInvalidateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- TDFX_CONTEXT(ctx)->new_gl_state |= new_state;
-}
-
-
-
-/* Initialize the context's Glide state mirror. These values will be
- * used as Glide function call parameters when the time comes.
- */
-void tdfxInitState( tdfxContextPtr fxMesa )
-{
- GLcontext *ctx = fxMesa->glCtx;
- GLint i;
-
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->ColorCombine.Local = GR_COMBINE_LOCAL_ITERATED;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->AlphaCombine.Local = GR_COMBINE_LOCAL_ITERATED;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
-
- fxMesa->ColorCombineExt.SourceA = GR_CMBX_ITRGB;
- fxMesa->ColorCombineExt.ModeA = GR_FUNC_MODE_X;
- fxMesa->ColorCombineExt.SourceB = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.ModeB = GR_FUNC_MODE_ZERO;
- fxMesa->ColorCombineExt.SourceC = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.InvertC = FXTRUE;
- fxMesa->ColorCombineExt.SourceD = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.InvertD = FXFALSE;
- fxMesa->ColorCombineExt.Shift = 0;
- fxMesa->ColorCombineExt.Invert = FXFALSE;
- fxMesa->AlphaCombineExt.SourceA = GR_CMBX_ITALPHA;
- fxMesa->AlphaCombineExt.ModeA = GR_FUNC_MODE_X;
- fxMesa->AlphaCombineExt.SourceB = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.ModeB = GR_FUNC_MODE_ZERO;
- fxMesa->AlphaCombineExt.SourceC = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.InvertC = FXTRUE;
- fxMesa->AlphaCombineExt.SourceD = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.InvertD = FXFALSE;
- fxMesa->AlphaCombineExt.Shift = 0;
- fxMesa->AlphaCombineExt.Invert = FXFALSE;
-
- fxMesa->sScale0 = fxMesa->tScale0 = 1.0;
- fxMesa->sScale1 = fxMesa->tScale1 = 1.0;
-
- fxMesa->TexPalette.Type = 0;
- fxMesa->TexPalette.Data = NULL;
-
- for ( i = 0 ; i < TDFX_NUM_TMU ; i++ ) {
- fxMesa->TexSource[i].StartAddress = 0;
- fxMesa->TexSource[i].EvenOdd = GR_MIPMAPLEVELMASK_EVEN;
- fxMesa->TexSource[i].Info = NULL;
-
- fxMesa->TexCombine[i].FunctionRGB = 0;
- fxMesa->TexCombine[i].FactorRGB = 0;
- fxMesa->TexCombine[i].FunctionAlpha = 0;
- fxMesa->TexCombine[i].FactorAlpha = 0;
- fxMesa->TexCombine[i].InvertRGB = FXFALSE;
- fxMesa->TexCombine[i].InvertAlpha = FXFALSE;
-
- fxMesa->TexCombineExt[i].Alpha.SourceA = 0;
- /* XXX more state to init here */
- fxMesa->TexCombineExt[i].Color.SourceA = 0;
- fxMesa->TexCombineExt[i].EnvColor = 0x0;
-
- fxMesa->TexParams[i].sClamp = GR_TEXTURECLAMP_WRAP;
- fxMesa->TexParams[i].tClamp = GR_TEXTURECLAMP_WRAP;
- fxMesa->TexParams[i].minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- fxMesa->TexParams[i].magFilt = GR_TEXTUREFILTER_BILINEAR;
- fxMesa->TexParams[i].mmMode = GR_MIPMAP_DISABLE;
- fxMesa->TexParams[i].LODblend = FXFALSE;
- fxMesa->TexParams[i].LodBias = 0.0;
-
- fxMesa->TexState.EnvMode[i] = ~0;
- fxMesa->TexState.TexFormat[i] = ~0;
- fxMesa->TexState.Enabled[i] = 0;
- }
-
- if ( ctx->Visual.doubleBufferMode) {
- fxMesa->DrawBuffer = GR_BUFFER_BACKBUFFER;
- fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
- } else {
- fxMesa->DrawBuffer = GR_BUFFER_FRONTBUFFER;
- fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
- }
-
- fxMesa->Color.ClearColor = 0x00000000;
- fxMesa->Color.ClearAlpha = 0x00;
- fxMesa->Color.ColorMask[RCOMP] = FXTRUE;
- fxMesa->Color.ColorMask[BCOMP] = FXTRUE;
- fxMesa->Color.ColorMask[GCOMP] = FXTRUE;
- fxMesa->Color.ColorMask[ACOMP] = FXTRUE;
- fxMesa->Color.MonoColor = 0xffffffff;
-
- fxMesa->Color.AlphaFunc = GR_CMP_ALWAYS;
- fxMesa->Color.AlphaRef = 0x00;
- fxMesa->Color.BlendSrcRGB = GR_BLEND_ONE;
- fxMesa->Color.BlendDstRGB = GR_BLEND_ZERO;
- fxMesa->Color.BlendSrcA = GR_BLEND_ONE;
- fxMesa->Color.BlendSrcA = GR_BLEND_ZERO;
-
- fxMesa->Color.Dither = GR_DITHER_2x2;
-
- if ( fxMesa->glCtx->Visual.depthBits > 0 ) {
- fxMesa->Depth.Mode = GR_DEPTHBUFFER_ZBUFFER;
- } else {
- fxMesa->Depth.Mode = GR_DEPTHBUFFER_DISABLE;
- }
- fxMesa->Depth.Bias = 0;
- fxMesa->Depth.Func = GR_CMP_LESS;
- fxMesa->Depth.Clear = 0; /* computed later */
- fxMesa->Depth.Mask = FXTRUE;
-
-
- fxMesa->Fog.Mode = GR_FOG_DISABLE;
- fxMesa->Fog.Color = 0x00000000;
- fxMesa->Fog.Table = NULL;
- fxMesa->Fog.Density = 1.0;
- fxMesa->Fog.Near = 1.0;
- fxMesa->Fog.Far = 1.0;
-
- fxMesa->Stencil.Function = GR_CMP_ALWAYS;
- fxMesa->Stencil.RefValue = 0;
- fxMesa->Stencil.ValueMask = 0xff;
- fxMesa->Stencil.WriteMask = 0xff;
- fxMesa->Stencil.FailFunc = 0;
- fxMesa->Stencil.ZFailFunc = 0;
- fxMesa->Stencil.ZPassFunc = 0;
- fxMesa->Stencil.Clear = 0;
-
- fxMesa->Stipple.Mode = GR_STIPPLE_DISABLE;
- fxMesa->Stipple.Pattern = 0xffffffff;
-
- fxMesa->Scissor.minX = 0;
- fxMesa->Scissor.minY = 0;
- fxMesa->Scissor.maxX = 0;
- fxMesa->Scissor.maxY = 0;
-
- fxMesa->Viewport.Mode = GR_WINDOW_COORDS;
- fxMesa->Viewport.X = 0;
- fxMesa->Viewport.Y = 0;
- fxMesa->Viewport.Width = 0;
- fxMesa->Viewport.Height = 0;
- fxMesa->Viewport.Near = 0.0;
- fxMesa->Viewport.Far = 0.0;
-
- fxMesa->CullMode = GR_CULL_DISABLE;
-
- fxMesa->Glide.ColorFormat = GR_COLORFORMAT_ABGR;
- fxMesa->Glide.Origin = GR_ORIGIN_LOWER_LEFT;
- fxMesa->Glide.Initialized = FXFALSE;
-}
-
-
-
-void tdfxDDInitStateFuncs( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- ctx->Driver.UpdateState = tdfxDDInvalidateState;
-
-
- /* State notification callbacks:
- */
- ctx->Driver.ClearColor = tdfxDDClearColor;
- ctx->Driver.DrawBuffer = tdfxDDDrawBuffer;
- ctx->Driver.ReadBuffer = tdfxDDReadBuffer;
-
- ctx->Driver.ColorMask = tdfxDDColorMask;
-
- ctx->Driver.AlphaFunc = tdfxDDAlphaFunc;
- ctx->Driver.BlendEquationSeparate = tdfxDDBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = tdfxDDBlendFuncSeparate;
- ctx->Driver.ClearDepth = tdfxDDClearDepth;
- ctx->Driver.CullFace = tdfxDDCullFace;
- ctx->Driver.FrontFace = tdfxDDFrontFace;
- ctx->Driver.DepthFunc = tdfxDDDepthFunc;
- ctx->Driver.DepthMask = tdfxDDDepthMask;
- ctx->Driver.DepthRange = tdfxDDDepthRange;
- ctx->Driver.Enable = tdfxDDEnable;
- ctx->Driver.Fogfv = tdfxDDFogfv;
- ctx->Driver.LightModelfv = tdfxDDLightModelfv;
- ctx->Driver.LineWidth = tdfxDDLineWidth;
- ctx->Driver.PolygonStipple = tdfxDDPolygonStipple;
- ctx->Driver.RenderMode = tdfxDDRenderMode;
- ctx->Driver.Scissor = tdfxDDScissor;
- ctx->Driver.ShadeModel = tdfxDDShadeModel;
-
- if ( fxMesa->haveHwStencil ) {
- ctx->Driver.StencilFunc = tdfxDDStencilFunc;
- ctx->Driver.StencilMask = tdfxDDStencilMask;
- ctx->Driver.StencilOp = tdfxDDStencilOp;
- }
-
- ctx->Driver.Viewport = tdfxDDViewport;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.h
deleted file mode 100644
index b10c38f59..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_state.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#ifndef __TDFX_STATE_H__
-#define __TDFX_STATE_H__
-
-#include "context.h"
-#include "tdfx_context.h"
-
-extern void tdfxDDInitStateFuncs( GLcontext *ctx );
-
-extern void tdfxDDUpdateHwState( GLcontext *ctx );
-
-extern void tdfxInitState( tdfxContextPtr fxMesa );
-
-extern void tdfxUpdateClipping( GLcontext *ctx );
-
-
-extern void tdfxFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
-#define FALLBACK( rmesa, bit, mode ) tdfxFallback( rmesa->glCtx, bit, mode )
-
-extern void tdfxUpdateCull( GLcontext *ctx );
-extern void tdfxUpdateStipple( GLcontext *ctx );
-extern void tdfxUpdateViewport( GLcontext *ctx );
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.c
deleted file mode 100644
index cf4de23b3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.c
+++ /dev/null
@@ -1,1914 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c,v 1.7 2002/11/05 17:46:10 tsi Exp $ */
-
-/*
- * New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-
-#include "enums.h"
-#include "image.h"
-#include "texcompress.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "texobj.h"
-#include "tdfx_context.h"
-#include "tdfx_tex.h"
-#include "tdfx_texman.h"
-
-
-/* no borders! can't halve 1x1! (stride > width * comp) not allowed */
-void
-_mesa_halve2x2_teximage2d ( GLcontext *ctx,
- struct gl_texture_image *texImage,
- GLuint bytesPerPixel,
- GLint srcWidth, GLint srcHeight,
- const GLvoid *srcImage, GLvoid *dstImage )
-{
- GLint i, j, k;
- GLint dstWidth = srcWidth / 2;
- GLint dstHeight = srcHeight / 2;
- GLint srcRowStride = srcWidth * bytesPerPixel;
- GLubyte *src = (GLubyte *)srcImage;
- GLubyte *dst = dstImage;
-
- GLuint bpt = 0;
- GLubyte *_s = NULL;
- GLubyte *_d = NULL;
- GLenum _t = 0;
-
- if (texImage->TexFormat->MesaFormat == MESA_FORMAT_RGB565) {
- _t = GL_UNSIGNED_SHORT_5_6_5_REV;
- bpt = bytesPerPixel;
- } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB4444) {
- _t = GL_UNSIGNED_SHORT_4_4_4_4_REV;
- bpt = bytesPerPixel;
- } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB1555) {
- _t = GL_UNSIGNED_SHORT_1_5_5_5_REV;
- bpt = bytesPerPixel;
- }
- if (bpt) {
- bytesPerPixel = 4;
- srcRowStride = srcWidth * bytesPerPixel;
- if (dstWidth == 0) {
- dstWidth = 1;
- }
- if (dstHeight == 0) {
- dstHeight = 1;
- }
- _s = src = MALLOC(srcRowStride * srcHeight);
- _d = dst = MALLOC(dstWidth * bytesPerPixel * dstHeight);
- _mesa_texstore_rgba8888(ctx, 2, GL_RGBA,
- &_mesa_texformat_rgba8888_rev, src,
- 0, 0, 0, /* dstX/Y/Zoffset */
- srcRowStride, /* dstRowStride */
- 0, /* dstImageStride */
- srcWidth, srcHeight, 1,
- texImage->Format, _t, srcImage, &ctx->DefaultPacking);
- }
-
- if (srcHeight == 1) {
- for (i = 0; i < dstWidth; i++) {
- for (k = 0; k < bytesPerPixel; k++) {
- dst[0] = (src[0] + src[bytesPerPixel] + 1) / 2;
- src++;
- dst++;
- }
- src += bytesPerPixel;
- }
- } else if (srcWidth == 1) {
- for (j = 0; j < dstHeight; j++) {
- for (k = 0; k < bytesPerPixel; k++) {
- dst[0] = (src[0] + src[srcRowStride] + 1) / 2;
- src++;
- dst++;
- }
- src += srcRowStride;
- }
- } else {
- for (j = 0; j < dstHeight; j++) {
- for (i = 0; i < dstWidth; i++) {
- for (k = 0; k < bytesPerPixel; k++) {
- dst[0] = (src[0] +
- src[bytesPerPixel] +
- src[srcRowStride] +
- src[srcRowStride + bytesPerPixel] + 2) / 4;
- src++;
- dst++;
- }
- src += bytesPerPixel;
- }
- src += srcRowStride;
- }
- }
-
- if (bpt) {
- src = _s;
- dst = _d;
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, dstImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstWidth * bpt,
- 0, /* dstImageStride */
- dstWidth, dstHeight, 1,
- GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking);
- FREE(dst);
- FREE(src);
- }
-}
-
-
-static int
-logbase2(int n)
-{
- GLint i = 1;
- GLint log2 = 0;
-
- if (n < 0) {
- return -1;
- }
-
- while (n > i) {
- i *= 2;
- log2++;
- }
- if (i != n) {
- return -1;
- }
- else {
- return log2;
- }
-}
-
-
-/*
- * Compute various texture image parameters.
- * Input: w, h - source texture width and height
- * Output: lodlevel - Glide lod level token for the larger texture dimension
- * aspectratio - Glide aspect ratio token
- * sscale - S scale factor used during triangle setup
- * tscale - T scale factor used during triangle setup
- * wscale - OpenGL -> Glide image width scale factor
- * hscale - OpenGL -> Glide image height scale factor
- *
- * Sample results:
- * w h lodlevel aspectRatio
- * 128 128 GR_LOD_LOG2_128 (=7) GR_ASPECT_LOG2_1x1 (=0)
- * 64 64 GR_LOD_LOG2_64 (=6) GR_ASPECT_LOG2_1x1 (=0)
- * 64 32 GR_LOD_LOG2_64 (=6) GR_ASPECT_LOG2_2x1 (=1)
- * 32 64 GR_LOD_LOG2_64 (=6) GR_ASPECT_LOG2_1x2 (=-1)
- * 32 32 GR_LOD_LOG2_32 (=5) GR_ASPECT_LOG2_1x1 (=0)
- */
-static void
-tdfxTexGetInfo(const GLcontext *ctx, int w, int h,
- GrLOD_t *lodlevel, GrAspectRatio_t *aspectratio,
- float *sscale, float *tscale,
- int *wscale, int *hscale)
-{
- int logw, logh, ar, lod, ws, hs;
- float s, t;
-
- ASSERT(w >= 1);
- ASSERT(h >= 1);
-
- logw = logbase2(w);
- logh = logbase2(h);
- ar = logw - logh; /* aspect ratio = difference in log dimensions */
- s = t = 256.0;
- ws = hs = 1;
-
- /* Hardware only allows a maximum aspect ratio of 8x1, so handle
- |ar| > 3 by scaling the image and using an 8x1 aspect ratio */
- if (ar >= 0) {
- ASSERT(w >= h);
- lod = logw;
- if (ar <= GR_ASPECT_LOG2_8x1) {
- t = 256 >> ar;
- }
- else {
- /* have to stretch image height */
- t = 32.0;
- hs = 1 << (ar - 3);
- ar = GR_ASPECT_LOG2_8x1;
- }
- }
- else {
- ASSERT(w < h);
- lod = logh;
- if (ar >= GR_ASPECT_LOG2_1x8) {
- s = 256 >> -ar;
- }
- else {
- /* have to stretch image width */
- s = 32.0;
- ws = 1 << (-ar - 3);
- ar = GR_ASPECT_LOG2_1x8;
- }
- }
-
- if (lodlevel)
- *lodlevel = (GrLOD_t) lod;
- if (aspectratio)
- *aspectratio = (GrAspectRatio_t) ar;
- if (sscale)
- *sscale = s;
- if (tscale)
- *tscale = t;
- if (wscale)
- *wscale = ws;
- if (hscale)
- *hscale = hs;
-}
-
-
-/*
- * We need to call this when a texture object's minification filter
- * or texture image sizes change.
- */
-static void RevalidateTexture(GLcontext *ctx, struct gl_texture_object *tObj)
-{
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- GLint minl, maxl;
-
- if (!ti)
- return;
-
- minl = maxl = tObj->BaseLevel;
-
- if (tObj->Image[0][minl]) {
- maxl = MIN2(tObj->MaxLevel, tObj->Image[0][minl]->MaxLog2);
-
- /* compute largeLodLog2, aspect ratio and texcoord scale factors */
- tdfxTexGetInfo(ctx, tObj->Image[0][minl]->Width, tObj->Image[0][minl]->Height,
- &ti->info.largeLodLog2,
- &ti->info.aspectRatioLog2,
- &(ti->sScale), &(ti->tScale), NULL, NULL);
- }
-
- if (tObj->Image[0][maxl] && (tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) {
- /* mipmapping: need to compute smallLodLog2 */
- tdfxTexGetInfo(ctx, tObj->Image[0][maxl]->Width,
- tObj->Image[0][maxl]->Height,
- &ti->info.smallLodLog2, NULL,
- NULL, NULL, NULL, NULL);
- }
- else {
- /* not mipmapping: smallLodLog2 = largeLodLog2 */
- ti->info.smallLodLog2 = ti->info.largeLodLog2;
- maxl = minl;
- }
-
- ti->minLevel = minl;
- ti->maxLevel = maxl;
- ti->info.data = NULL;
-
- /* this is necessary because of fxDDCompressedTexImage2D */
- if (ti->padded) {
- struct gl_texture_image *texImage = tObj->Image[0][minl];
- tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- if (mml->wScale != 1 || mml->hScale != 1) {
- ti->sScale /= mml->wScale;
- ti->tScale /= mml->hScale;
- }
- }
-}
-
-
-static tdfxTexInfo *
-fxAllocTexObjData(tdfxContextPtr fxMesa)
-{
- tdfxTexInfo *ti;
-
- if (!(ti = CALLOC(sizeof(tdfxTexInfo)))) {
- _mesa_problem(NULL, "tdfx driver: out of memory");
- return NULL;
- }
-
- ti->isInTM = GL_FALSE;
-
- ti->whichTMU = TDFX_TMU_NONE;
-
- ti->tm[TDFX_TMU0] = NULL;
- ti->tm[TDFX_TMU1] = NULL;
-
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- ti->magFilt = GR_TEXTUREFILTER_BILINEAR;
-
- ti->sClamp = GR_TEXTURECLAMP_WRAP;
- ti->tClamp = GR_TEXTURECLAMP_WRAP;
-
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->LODblend = FXFALSE;
-
- return ti;
-}
-
-
-/*
- * Called via glBindTexture.
- */
-static void
-tdfxBindTexture(GLcontext * ctx, GLenum target,
- struct gl_texture_object *tObj)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti;
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxDDTexBind(%d,%p)\n", tObj->Name,
- tObj->DriverData);
- }
-
- if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
- return;
-
- if (!tObj->DriverData) {
- tObj->DriverData = fxAllocTexObjData(fxMesa);
- }
-
- ti = TDFX_TEXTURE_DATA(tObj);
- ti->lastTimeUsed = fxMesa->texBindNumber++;
-
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
-}
-
-
-/*
- * Called via glTexEnv.
- */
-static void
-tdfxTexEnv(GLcontext * ctx, GLenum target, GLenum pname,
- const GLfloat * param)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
- if (param)
- fprintf(stderr, "fxmesa: texenv(%x,%x)\n", pname,
- (GLint) (*param));
- else
- fprintf(stderr, "fxmesa: texenv(%x)\n", pname);
- }
-
- /* XXX this is a bit of a hack to force the Glide texture
- * state to be updated.
- */
- fxMesa->TexState.EnvMode[ctx->Texture.CurrentUnit] = 0;
-
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
-}
-
-
-/*
- * Called via glTexParameter.
- */
-static void
-tdfxTexParameter(GLcontext * ctx, GLenum target,
- struct gl_texture_object *tObj,
- GLenum pname, const GLfloat * params)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLenum param = (GLenum) (GLint) params[0];
- tdfxTexInfo *ti;
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxDDTexParam(%d,%p,%x,%x)\n", tObj->Name,
- tObj->DriverData, pname, param);
- }
-
- if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
- return;
-
- if (!tObj->DriverData)
- tObj->DriverData = fxAllocTexObjData(fxMesa);
-
- ti = TDFX_TEXTURE_DATA(tObj);
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- switch (param) {
- case GL_NEAREST:
- ti->mmMode = GR_MIPMAP_DISABLE;
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- ti->LODblend = FXFALSE;
- break;
- case GL_LINEAR:
- ti->mmMode = GR_MIPMAP_DISABLE;
- ti->minFilt = GR_TEXTUREFILTER_BILINEAR;
- ti->LODblend = FXFALSE;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- if (!fxMesa->Glide.HaveCombineExt) {
- if (fxMesa->haveTwoTMUs) {
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->LODblend = FXTRUE;
- }
- else {
- ti->mmMode = GR_MIPMAP_NEAREST_DITHER;
- ti->LODblend = FXFALSE;
- }
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- break;
- }
- /* XXX Voodoo3/Banshee mipmap blending seems to produce
- * incorrectly filtered colors for the smallest mipmap levels.
- * To work-around we fall-through here and use a different filter.
- */
- case GL_NEAREST_MIPMAP_NEAREST:
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- ti->LODblend = FXFALSE;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- if (!fxMesa->Glide.HaveCombineExt) {
- if (fxMesa->haveTwoTMUs) {
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->LODblend = FXTRUE;
- }
- else {
- ti->mmMode = GR_MIPMAP_NEAREST_DITHER;
- ti->LODblend = FXFALSE;
- }
- ti->minFilt = GR_TEXTUREFILTER_BILINEAR;
- break;
- }
- /* XXX Voodoo3/Banshee mipmap blending seems to produce
- * incorrectly filtered colors for the smallest mipmap levels.
- * To work-around we fall-through here and use a different filter.
- */
- case GL_LINEAR_MIPMAP_NEAREST:
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->minFilt = GR_TEXTUREFILTER_BILINEAR;
- ti->LODblend = FXFALSE;
- break;
- default:
- break;
- }
- ti->reloadImages = GL_TRUE;
- RevalidateTexture(ctx, tObj);
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- break;
-
- case GL_TEXTURE_MAG_FILTER:
- switch (param) {
- case GL_NEAREST:
- ti->magFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- break;
- case GL_LINEAR:
- ti->magFilt = GR_TEXTUREFILTER_BILINEAR;
- break;
- default:
- break;
- }
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- break;
-
- case GL_TEXTURE_WRAP_S:
- switch (param) {
- case GL_CLAMP_TO_BORDER:
- case GL_CLAMP_TO_EDGE:
- case GL_CLAMP:
- ti->sClamp = GR_TEXTURECLAMP_CLAMP;
- break;
- case GL_REPEAT:
- ti->sClamp = GR_TEXTURECLAMP_WRAP;
- break;
- case GL_MIRRORED_REPEAT:
- ti->sClamp = GR_TEXTURECLAMP_MIRROR_EXT;
- break;
- default:
- break;
- }
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- break;
-
- case GL_TEXTURE_WRAP_T:
- switch (param) {
- case GL_CLAMP_TO_BORDER:
- case GL_CLAMP_TO_EDGE:
- case GL_CLAMP:
- ti->tClamp = GR_TEXTURECLAMP_CLAMP;
- break;
- case GL_REPEAT:
- ti->tClamp = GR_TEXTURECLAMP_WRAP;
- break;
- case GL_MIRRORED_REPEAT:
- ti->tClamp = GR_TEXTURECLAMP_MIRROR_EXT;
- break;
- default:
- break;
- }
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- /* TO DO */
- break;
- case GL_TEXTURE_MIN_LOD:
- /* TO DO */
- break;
- case GL_TEXTURE_MAX_LOD:
- /* TO DO */
- break;
- case GL_TEXTURE_BASE_LEVEL:
- RevalidateTexture(ctx, tObj);
- break;
- case GL_TEXTURE_MAX_LEVEL:
- RevalidateTexture(ctx, tObj);
- break;
-
- default:
- break;
- }
-}
-
-
-/*
- * Called via glDeleteTextures to delete a texture object.
- * Here, we delete the Glide data associated with the texture.
- */
-static void
-tdfxDeleteTexture(GLcontext * ctx, struct gl_texture_object *tObj)
-{
- if (ctx && ctx->DriverCtx) {
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTMFreeTexture(fxMesa, tObj);
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
- }
-}
-
-
-/*
- * Return true if texture is resident, false otherwise.
- */
-static GLboolean
-tdfxIsTextureResident(GLcontext *ctx, struct gl_texture_object *tObj)
-{
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- return (GLboolean) (ti && ti->isInTM);
-}
-
-
-
-/*
- * Convert a gl_color_table texture palette to Glide's format.
- */
-static GrTexTable_t
-convertPalette(FxU32 data[256], const struct gl_color_table *table)
-{
- const GLubyte *tableUB = (const GLubyte *) table->Table;
- GLint width = table->Size;
- FxU32 r, g, b, a;
- GLint i;
-
- ASSERT(table->Type == GL_UNSIGNED_BYTE);
-
- switch (table->Format) {
- case GL_INTENSITY:
- for (i = 0; i < width; i++) {
- r = tableUB[i];
- g = tableUB[i];
- b = tableUB[i];
- a = tableUB[i];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE_6666_EXT;
- case GL_LUMINANCE:
- for (i = 0; i < width; i++) {
- r = tableUB[i];
- g = tableUB[i];
- b = tableUB[i];
- a = 255;
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE;
- case GL_ALPHA:
- for (i = 0; i < width; i++) {
- r = g = b = 255;
- a = tableUB[i];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE_6666_EXT;
- case GL_LUMINANCE_ALPHA:
- for (i = 0; i < width; i++) {
- r = g = b = tableUB[i * 2 + 0];
- a = tableUB[i * 2 + 1];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE_6666_EXT;
- case GL_RGB:
- for (i = 0; i < width; i++) {
- r = tableUB[i * 3 + 0];
- g = tableUB[i * 3 + 1];
- b = tableUB[i * 3 + 2];
- a = 255;
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE;
- case GL_RGBA:
- for (i = 0; i < width; i++) {
- r = tableUB[i * 4 + 0];
- g = tableUB[i * 4 + 1];
- b = tableUB[i * 4 + 2];
- a = tableUB[i * 4 + 3];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE_6666_EXT;
- default:
- /* XXX fixme: how can this happen? */
- _mesa_error(NULL, GL_INVALID_ENUM, "convertPalette: table->Format == %s",
- _mesa_lookup_enum_by_nr(table->Format));
- return GR_TEXTABLE_PALETTE;
- }
-}
-
-
-
-static void
-tdfxUpdateTexturePalette(GLcontext * ctx, struct gl_texture_object *tObj)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if (tObj) {
- /* per-texture palette */
- tdfxTexInfo *ti;
-
- /* This might be a proxy texture. */
- if (!tObj->Palette.Table)
- return;
-
- if (!tObj->DriverData)
- tObj->DriverData = fxAllocTexObjData(fxMesa);
- ti = TDFX_TEXTURE_DATA(tObj);
- assert(ti);
- ti->paltype = convertPalette(ti->palette.data, &tObj->Palette);
- /*tdfxTexInvalidate(ctx, tObj);*/
- }
- else {
- /* global texture palette */
- fxMesa->TexPalette.Type = convertPalette(fxMesa->glbPalette.data, &ctx->Texture.Palette);
- fxMesa->TexPalette.Data = &(fxMesa->glbPalette.data);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
- fxMesa->new_state |= TDFX_NEW_TEXTURE; /* XXX too heavy-handed */
-}
-
-
-/**********************************************************************/
-/**** NEW TEXTURE IMAGE FUNCTIONS ****/
-/**********************************************************************/
-
-#if 000
-static FxBool TexusFatalError = FXFALSE;
-static FxBool TexusError = FXFALSE;
-
-#define TX_DITHER_NONE 0x00000000
-
-static void
-fxTexusError(const char *string, FxBool fatal)
-{
- _mesa_problem(NULL, string);
- /*
- * Just propagate the fatal value up.
- */
- TexusError = FXTRUE;
- TexusFatalError = fatal;
-}
-#endif
-
-
-static const struct gl_texture_format *
-tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum srcFormat, GLenum srcType )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- const GLboolean allow32bpt = TDFX_IS_NAPALM(fxMesa);
-
- switch (internalFormat) {
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_a8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_l8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return &_mesa_texformat_al88;
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_i8;
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- return &_mesa_texformat_rgb565;
- case GL_COMPRESSED_RGB:
- /* intentional fall-through */
- case 3:
- case GL_RGB:
- if ( srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5 ) {
- return &_mesa_texformat_rgb565;
- }
- /* intentional fall through */
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return (allow32bpt) ? &_mesa_texformat_argb8888
- : &_mesa_texformat_rgb565;
- case GL_RGBA2:
- case GL_RGBA4:
- return &_mesa_texformat_argb4444;
- case GL_COMPRESSED_RGBA:
- /* intentional fall-through */
- case 4:
- case GL_RGBA:
- if ( srcFormat == GL_BGRA ) {
- if ( srcType == GL_UNSIGNED_INT_8_8_8_8_REV ) {
- return &_mesa_texformat_argb8888;
- }
- else if ( srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
- return &_mesa_texformat_argb4444;
- }
- else if ( srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
- }
- }
- /* intentional fall through */
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return allow32bpt ? &_mesa_texformat_argb8888
- : &_mesa_texformat_argb4444;
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
- /* GL_EXT_texture_compression_s3tc */
- /* GL_S3_s3tc */
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- return &_mesa_texformat_rgb_dxt1;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- return &_mesa_texformat_rgba_dxt3;
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
- /* GL_3DFX_texture_compression_FXT1 */
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return &_mesa_texformat_rgb_fxt1;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return &_mesa_texformat_rgba_fxt1;
- default:
- _mesa_problem(ctx, "unexpected format in tdfxChooseTextureFormat");
- return NULL;
- }
-}
-
-
-/*
- * Return the Glide format for the given mesa texture format.
- */
-static GrTextureFormat_t
-fxGlideFormat(GLint mesaFormat)
-{
- switch (mesaFormat) {
- case MESA_FORMAT_I8:
- return GR_TEXFMT_ALPHA_8;
- case MESA_FORMAT_A8:
- return GR_TEXFMT_ALPHA_8;
- case MESA_FORMAT_L8:
- return GR_TEXFMT_INTENSITY_8;
- case MESA_FORMAT_CI8:
- return GR_TEXFMT_P_8;
- case MESA_FORMAT_AL88:
- return GR_TEXFMT_ALPHA_INTENSITY_88;
- case MESA_FORMAT_RGB565:
- return GR_TEXFMT_RGB_565;
- case MESA_FORMAT_ARGB4444:
- return GR_TEXFMT_ARGB_4444;
- case MESA_FORMAT_ARGB1555:
- return GR_TEXFMT_ARGB_1555;
- case MESA_FORMAT_ARGB8888:
- return GR_TEXFMT_ARGB_8888;
- case MESA_FORMAT_RGB_FXT1:
- case MESA_FORMAT_RGBA_FXT1:
- return GR_TEXFMT_ARGB_CMP_FXT1;
- case MESA_FORMAT_RGB_DXT1:
- case MESA_FORMAT_RGBA_DXT1:
- return GR_TEXFMT_ARGB_CMP_DXT1;
- case MESA_FORMAT_RGBA_DXT3:
- return GR_TEXFMT_ARGB_CMP_DXT3;
- case MESA_FORMAT_RGBA_DXT5:
- return GR_TEXFMT_ARGB_CMP_DXT5;
- default:
- _mesa_problem(NULL, "Unexpected format in fxGlideFormat");
- return 0;
- }
-}
-
-
-/* Texel-fetch functions for software texturing and glGetTexImage().
- * We should have been able to use some "standard" fetch functions (which
- * may get defined in texutil.c) but we have to account for scaled texture
- * images on tdfx hardware (the 8:1 aspect ratio limit).
- * Hence, we need special functions here.
- */
-extern void
-fxt1_decode_1 (const void *texture, int width,
- int i, int j, unsigned char *rgba);
-
-static void
-fetch_intensity8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = *texel;
- rgba[GCOMP] = *texel;
- rgba[BCOMP] = *texel;
- rgba[ACOMP] = *texel;
-}
-
-
-static void
-fetch_luminance8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = *texel;
- rgba[GCOMP] = *texel;
- rgba[BCOMP] = *texel;
- rgba[ACOMP] = 255;
-}
-
-
-static void
-fetch_alpha8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = 255;
- rgba[GCOMP] = 255;
- rgba[BCOMP] = 255;
- rgba[ACOMP] = *texel;
-}
-
-
-static void
-fetch_index8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * indexOut)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- *indexOut = *texel;
-}
-
-
-static void
-fetch_luminance8_alpha8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + (j * mml->width + i) * 2;
- rgba[RCOMP] = texel[0];
- rgba[GCOMP] = texel[0];
- rgba[BCOMP] = texel[0];
- rgba[ACOMP] = texel[1];
-}
-
-
-static void
-fetch_r5g6b5(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLushort *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLushort *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = (((*texel) >> 11) & 0x1f) * 255 / 31;
- rgba[GCOMP] = (((*texel) >> 5) & 0x3f) * 255 / 63;
- rgba[BCOMP] = (((*texel) >> 0) & 0x1f) * 255 / 31;
- rgba[ACOMP] = 255;
-}
-
-
-static void
-fetch_r4g4b4a4(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLushort *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLushort *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = (((*texel) >> 12) & 0xf) * 255 / 15;
- rgba[GCOMP] = (((*texel) >> 8) & 0xf) * 255 / 15;
- rgba[BCOMP] = (((*texel) >> 4) & 0xf) * 255 / 15;
- rgba[ACOMP] = (((*texel) >> 0) & 0xf) * 255 / 15;
-}
-
-
-static void
-fetch_r5g5b5a1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLushort *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLushort *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = (((*texel) >> 11) & 0x1f) * 255 / 31;
- rgba[GCOMP] = (((*texel) >> 6) & 0x1f) * 255 / 31;
- rgba[BCOMP] = (((*texel) >> 1) & 0x1f) * 255 / 31;
- rgba[ACOMP] = (((*texel) >> 0) & 0x01) * 255;
-}
-
-
-static void
-fetch_a8r8g8b8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan * rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
- const GLuint *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLuint *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = (((*texel) >> 16) & 0xff);
- rgba[GCOMP] = (((*texel) >> 8) & 0xff);
- rgba[BCOMP] = (((*texel) ) & 0xff);
- rgba[ACOMP] = (((*texel) >> 24) & 0xff);
-}
-
-
-static void
-fetch_rgb_fxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- fxt1_decode_1(texImage->Data, mml->width, i, j, rgba);
- rgba[ACOMP] = 255;
-}
-
-
-static void
-fetch_rgba_fxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- fxt1_decode_1(texImage->Data, mml->width, i, j, rgba);
-}
-
-
-static void
-fetch_rgb_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgb_dxt1.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static void
-fetch_rgba_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgba_dxt1.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static void
-fetch_rgba_dxt3(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgba_dxt3.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static void
-fetch_rgba_dxt5(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tdfxMipMapLevel *mml = TDFX_TEXIMAGE_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgba_dxt5.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static FetchTexelFuncC
-fxFetchFunction(GLint mesaFormat)
-{
- switch (mesaFormat) {
- case MESA_FORMAT_I8:
- return &fetch_intensity8;
- case MESA_FORMAT_A8:
- return &fetch_alpha8;
- case MESA_FORMAT_L8:
- return &fetch_luminance8;
- case MESA_FORMAT_CI8:
- return &fetch_index8;
- case MESA_FORMAT_AL88:
- return &fetch_luminance8_alpha8;
- case MESA_FORMAT_RGB565:
- return &fetch_r5g6b5;
- case MESA_FORMAT_ARGB4444:
- return &fetch_r4g4b4a4;
- case MESA_FORMAT_ARGB1555:
- return &fetch_r5g5b5a1;
- case MESA_FORMAT_ARGB8888:
- return &fetch_a8r8g8b8;
- case MESA_FORMAT_RGB_FXT1:
- return &fetch_rgb_fxt1;
- case MESA_FORMAT_RGBA_FXT1:
- return &fetch_rgba_fxt1;
- case MESA_FORMAT_RGB_DXT1:
- return &fetch_rgb_dxt1;
- case MESA_FORMAT_RGBA_DXT1:
- return &fetch_rgba_dxt1;
- case MESA_FORMAT_RGBA_DXT3:
- return &fetch_rgba_dxt3;
- case MESA_FORMAT_RGBA_DXT5:
- return &fetch_rgba_dxt5;
- default:
- _mesa_problem(NULL, "Unexpected format in fxFetchFunction");
- return NULL;
- }
-}
-
-
-static GLboolean
-adjust2DRatio (GLcontext *ctx,
- GLint xoffset, GLint yoffset,
- GLint width, GLint height,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- tdfxMipMapLevel *mml,
- struct gl_texture_image *texImage,
- GLint texelBytes,
- GLint dstRowStride)
-{
- const GLint newWidth = width * mml->wScale;
- const GLint newHeight = height * mml->hScale;
- GLvoid *tempImage;
-
- if (!texImage->IsCompressed) {
- GLubyte *destAddr;
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- return GL_FALSE;
- }
-
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, tempImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- width * texelBytes, /* dstRowStride */
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
-
- /* now rescale */
- /* compute address of dest subimage within the overal tex image */
- destAddr = (GLubyte *) texImage->Data
- + (yoffset * mml->hScale * mml->width
- + xoffset * mml->wScale) * texelBytes;
-
- _mesa_rescale_teximage2d(texelBytes,
- width,
- dstRowStride, /* dst stride */
- width, height,
- newWidth, newHeight,
- tempImage, destAddr);
- } else {
- const GLint rawBytes = 4;
- GLvoid *rawImage = MALLOC(width * height * rawBytes);
- if (!rawImage) {
- return GL_FALSE;
- }
- tempImage = MALLOC(newWidth * newHeight * rawBytes);
- if (!tempImage) {
- return GL_FALSE;
- }
- /* unpack image, apply transfer ops and store in rawImage */
- _mesa_texstore_rgba8888(ctx, 2, GL_RGBA,
- &_mesa_texformat_rgba8888_rev, rawImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- width * rawBytes, /* dstRowStride */
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
- _mesa_rescale_teximage2d(rawBytes,
- width,
- newWidth * rawBytes, /* dst stride */
- width, height, /* src */
- newWidth, newHeight, /* dst */
- rawImage /*src*/, tempImage /*dst*/ );
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, texImage->Data,
- xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- newWidth, newHeight, 1,
- GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking);
- FREE(rawImage);
- }
-
- FREE(tempImage);
-
- return GL_TRUE;
-}
-
-
-static void
-tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat, GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti;
- tdfxMipMapLevel *mml;
- GLint texelBytes, dstRowStride;
-
- /*
- printf("TexImage id=%d int 0x%x format 0x%x type 0x%x %dx%d\n",
- texObj->Name, texImage->IntFormat, format, type,
- texImage->Width, texImage->Height);
- */
-
- ti = TDFX_TEXTURE_DATA(texObj);
- if (!ti) {
- texObj->DriverData = fxAllocTexObjData(fxMesa);
- if (!texObj->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- ti = TDFX_TEXTURE_DATA(texObj);
- }
- assert(ti);
-
- mml = TDFX_TEXIMAGE_DATA(texImage);
- if (!mml) {
- texImage->DriverData = CALLOC(sizeof(tdfxMipMapLevel));
- if (!texImage->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- mml = TDFX_TEXIMAGE_DATA(texImage);
- }
-
- /* Determine width and height scale factors for texture.
- * Remember, Glide is limited to 8:1 aspect ratios.
- */
- tdfxTexGetInfo(ctx,
- texImage->Width, texImage->Height,
- NULL, /* lod level */
- NULL, /* aspect ratio */
- NULL, NULL, /* sscale, tscale */
- &mml->wScale, &mml->hScale);
-
- /* rescaled size: */
- mml->width = width * mml->wScale;
- mml->height = height * mml->hScale;
-
-#if FX_COMPRESS_S3TC_AS_FXT1_HACK
- /* [koolsmoky] substitute FXT1 for DXTn and Legacy S3TC */
- /* [dBorca] we should update texture's attribute, then,
- * because if the application asks us to decompress, we
- * have to know the REAL format! Also, DXT3/5 might not
- * be correct, since it would mess with "compressedSize".
- * Ditto for GL_RGBA[4]_S3TC, which is always mapped to DXT3.
- */
- if (texImage->IsCompressed) {
- switch (internalFormat) {
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- internalFormat = GL_COMPRESSED_RGB_FXT1_3DFX;
- break;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- internalFormat = GL_COMPRESSED_RGBA_FXT1_3DFX;
- }
- texImage->IntFormat = internalFormat;
- }
-#endif
-#if FX_TC_NAPALM
- if (fxMesa->type >= GR_SSTTYPE_Voodoo4) {
- GLenum texNapalm = 0;
- if (internalFormat == GL_COMPRESSED_RGB) {
- texNapalm = GL_COMPRESSED_RGB_FXT1_3DFX;
- } else if (internalFormat == GL_COMPRESSED_RGBA) {
- texNapalm = GL_COMPRESSED_RGBA_FXT1_3DFX;
- }
- if (texNapalm) {
- texImage->IntFormat = internalFormat = texNapalm;
- texImage->IsCompressed = GL_TRUE;
- }
- }
-#endif
-
- /* choose the texture format */
- assert(ctx->Driver.ChooseTextureFormat);
- texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
- internalFormat, format, type);
- assert(texImage->TexFormat);
- mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat);
- ti->info.format = mml->glideFormat;
- texImage->FetchTexelc = fxFetchFunction(texImage->TexFormat->MesaFormat);
- texelBytes = texImage->TexFormat->TexelBytes;
-
- if (texImage->IsCompressed) {
- texImage->CompressedSize = _mesa_compressed_texture_size(ctx,
- mml->width,
- mml->height,
- 1,
- internalFormat);
- dstRowStride = _mesa_compressed_row_stride(internalFormat, mml->width);
- texImage->Data = _mesa_malloc(texImage->CompressedSize);
- } else {
- dstRowStride = mml->width * texelBytes;
- texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes);
- }
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
-
- if (pixels != NULL) {
- if (mml->wScale != 1 || mml->hScale != 1) {
- /* rescale image to overcome 1:8 aspect limitation */
- if (!adjust2DRatio(ctx,
- 0, 0,
- width, height,
- format, type, pixels,
- packing,
- mml,
- texImage,
- texelBytes,
- dstRowStride)
- ) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
- else {
- /* no rescaling needed */
- /* unpack image, apply transfer ops and store in texImage->Data */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- GLint mipWidth, mipHeight;
- tdfxMipMapLevel *mip;
- struct gl_texture_image *mipImage;
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
-
- assert(!texImage->IsCompressed);
-
- while (level < texObj->MaxLevel && level < maxLevels - 1) {
- mipWidth = width / 2;
- if (!mipWidth) {
- mipWidth = 1;
- }
- mipHeight = height / 2;
- if (!mipHeight) {
- mipHeight = 1;
- }
- if ((mipWidth == width) && (mipHeight == height)) {
- break;
- }
- _mesa_TexImage2D(target, ++level, internalFormat,
- mipWidth, mipHeight, border,
- format, type,
- NULL);
- mipImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- mip = TDFX_TEXIMAGE_DATA(mipImage);
- _mesa_halve2x2_teximage2d(ctx,
- texImage,
- texelBytes,
- mml->width, mml->height,
- texImage->Data, mipImage->Data);
- texImage = mipImage;
- mml = mip;
- width = mipWidth;
- height = mipHeight;
- }
- }
- }
-
- RevalidateTexture(ctx, texObj);
-
- ti->reloadImages = GL_TRUE;
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
-}
-
-
-static void
-tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti;
- tdfxMipMapLevel *mml;
- GLint texelBytes, dstRowStride;
-
- if (!texObj->DriverData) {
- _mesa_problem(ctx, "problem in fxDDTexSubImage2D");
- return;
- }
-
- ti = TDFX_TEXTURE_DATA(texObj);
- assert(ti);
- mml = TDFX_TEXIMAGE_DATA(texImage);
- assert(mml);
-
- assert(texImage->Data); /* must have an existing texture image! */
- assert(texImage->Format);
-
- texelBytes = texImage->TexFormat->TexelBytes;
- if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat, mml->width);
- } else {
- dstRowStride = mml->width * texelBytes;
- }
-
- if (mml->wScale != 1 || mml->hScale != 1) {
- /* need to rescale subimage to match mipmap level's rescale factors */
- if (!adjust2DRatio(ctx,
- xoffset, yoffset,
- width, height,
- format, type, pixels,
- packing,
- mml,
- texImage,
- texelBytes,
- dstRowStride)
- ) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- }
- else {
- /* no rescaling needed */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, texImage->Data,
- xoffset, yoffset, 0,
- dstRowStride,
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- GLint mipWidth, mipHeight;
- tdfxMipMapLevel *mip;
- struct gl_texture_image *mipImage;
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
-
- assert(!texImage->IsCompressed);
-
- width = texImage->Width;
- height = texImage->Height;
- while (level < texObj->MaxLevel && level < maxLevels - 1) {
- mipWidth = width / 2;
- if (!mipWidth) {
- mipWidth = 1;
- }
- mipHeight = height / 2;
- if (!mipHeight) {
- mipHeight = 1;
- }
- if ((mipWidth == width) && (mipHeight == height)) {
- break;
- }
- ++level;
- mipImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- mip = TDFX_TEXIMAGE_DATA(mipImage);
- _mesa_halve2x2_teximage2d(ctx,
- texImage,
- texelBytes,
- mml->width, mml->height,
- texImage->Data, mipImage->Data);
- texImage = mipImage;
- mml = mip;
- width = mipWidth;
- height = mipHeight;
- }
- }
-
- ti->reloadImages = GL_TRUE; /* signal the image needs to be reloaded */
- fxMesa->new_state |= TDFX_NEW_TEXTURE; /* XXX this might be a bit much */
-}
-
-
-static void
-tdfxTexImage1D(GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat, GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- tdfxTexImage2D(ctx, target, level,
- internalFormat, width, 1, border,
- format, type, pixels,
- packing,
- texObj,
- texImage);
-}
-
-static void
-tdfxTexSubImage1D(GLcontext *ctx, GLenum target, GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- tdfxTexSubImage2D(ctx, target, level,
- xoffset, 0,
- width, 1,
- format, type,
- pixels,
- packing,
- texObj,
- texImage);
-}
-
-/**********************************************************************/
-/**** COMPRESSED TEXTURE IMAGE FUNCTIONS ****/
-/**********************************************************************/
-
-static void
-tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti;
- tdfxMipMapLevel *mml;
-
- if (TDFX_DEBUG & DEBUG_VERBOSE_DRI) {
- fprintf(stderr, "tdfxCompressedTexImage2D: id=%d int 0x%x %dx%d\n",
- texObj->Name, internalFormat,
- width, height);
- }
-
- if ((target != GL_TEXTURE_1D && target != GL_TEXTURE_2D) || texImage->Border > 0) {
- _mesa_problem(NULL, "tdfx: unsupported texture in tdfxCompressedTexImg()\n");
- return;
- }
-
- assert(texImage->IsCompressed);
-
- ti = TDFX_TEXTURE_DATA(texObj);
- if (!ti) {
- texObj->DriverData = fxAllocTexObjData(fxMesa);
- if (!texObj->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- ti = TDFX_TEXTURE_DATA(texObj);
- }
- assert(ti);
-
- mml = TDFX_TEXIMAGE_DATA(texImage);
- if (!mml) {
- texImage->DriverData = CALLOC(sizeof(tdfxMipMapLevel));
- if (!texImage->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- mml = TDFX_TEXIMAGE_DATA(texImage);
- }
-
- tdfxTexGetInfo(ctx, width, height, NULL, NULL, NULL, NULL,
- &mml->wScale, &mml->hScale);
-
- mml->width = width * mml->wScale;
- mml->height = height * mml->hScale;
-
-
- /* choose the texture format */
- assert(ctx->Driver.ChooseTextureFormat);
- texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
- internalFormat, -1/*format*/, -1/*type*/);
- assert(texImage->TexFormat);
-
- /* Determine the appropriate Glide texel format,
- * given the user's internal texture format hint.
- */
- mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat);
- ti->info.format = mml->glideFormat;
- texImage->FetchTexelc = fxFetchFunction(texImage->TexFormat->MesaFormat);
-
- /* allocate new storage for texture image, if needed */
- if (!texImage->Data) {
- texImage->CompressedSize = _mesa_compressed_texture_size(ctx,
- mml->width,
- mml->height,
- 1,
- internalFormat);
- texImage->Data = _mesa_malloc(texImage->CompressedSize);
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
-
- /* save the texture data */
- if (mml->wScale != 1 || mml->hScale != 1) {
- /* [dBorca] Hack alert:
- * now we're screwed. We can't decompress,
- * unless we do it in HW (via textureBuffer).
- * We still have some chances:
- * 1) we got FXT1 textures - we CAN decompress, rescale for
- * aspectratio, then compress back.
- * 2) there is a chance that MIN("s", "t") won't be overflowed.
- * Thus, we don't care about textureclamp and we could lower
- * MIN("uscale", "vscale") below 32. We still have to have
- * our data aligned inside a 8:1 rectangle.
- * 3) just in case if MIN("s", "t") gets overflowed with GL_REPEAT,
- * we replicate the data over the padded area.
- * For now, we take 2) + 3) but texelfetchers will be wrong!
- */
- GLuint srcRowStride = _mesa_compressed_row_stride(internalFormat, width);
-
- GLuint destRowStride = _mesa_compressed_row_stride(internalFormat,
- mml->width);
-
- _mesa_upscale_teximage2d(srcRowStride, (height+3) / 4,
- destRowStride, (mml->height+3) / 4,
- 1, data, srcRowStride,
- texImage->Data);
- ti->padded = GL_TRUE;
- } else {
- MEMCPY(texImage->Data, data, texImage->CompressedSize);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- assert(!texImage->IsCompressed);
- }
-
- RevalidateTexture(ctx, texObj);
-
- ti->reloadImages = GL_TRUE;
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
-}
-
-
-static void
-tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target,
- GLint level, GLint xoffset,
- GLint yoffset, GLsizei width,
- GLint height, GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti;
- tdfxMipMapLevel *mml;
- GLint destRowStride, srcRowStride;
- GLint i, rows;
- GLubyte *dest;
-
- if (TDFX_DEBUG & DEBUG_VERBOSE_DRI) {
- fprintf(stderr, "tdfxCompressedTexSubImage2D: id=%d\n", texObj->Name);
- }
-
- ti = TDFX_TEXTURE_DATA(texObj);
- assert(ti);
- mml = TDFX_TEXIMAGE_DATA(texImage);
- assert(mml);
-
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, width);
-
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
- mml->width);
- dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
- texImage->IntFormat,
- mml->width,
- (GLubyte*) texImage->Data);
-
- rows = height / 4; /* [dBorca] hardcoded 4, but works for FXT1/DXTC */
-
- for (i = 0; i < rows; i++) {
- MEMCPY(dest, data, srcRowStride);
- dest += destRowStride;
- data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride);
- }
-
- /* [dBorca] Hack alert:
- * see fxDDCompressedTexImage2D for caveats
- */
- if (mml->wScale != 1 || mml->hScale != 1) {
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, texImage->Width);
-
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
- mml->width);
- _mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4,
- destRowStride, mml->height / 4,
- 1, texImage->Data, destRowStride,
- texImage->Data);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- assert(!texImage->IsCompressed);
- }
-
- RevalidateTexture(ctx, texObj);
-
- ti->reloadImages = GL_TRUE;
- fxMesa->new_state |= TDFX_NEW_TEXTURE;
-}
-
-
-#if 0
-static void
-PrintTexture(int w, int h, int c, const GLubyte * data)
-{
- int i, j;
- for (i = 0; i < h; i++) {
- for (j = 0; j < w; j++) {
- if (c == 2)
- printf("%02x %02x ", data[0], data[1]);
- else if (c == 3)
- printf("%02x %02x %02x ", data[0], data[1], data[2]);
- data += c;
- }
- printf("\n");
- }
-}
-#endif
-
-
-GLboolean
-tdfxTestProxyTexImage(GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLenum format, GLenum type,
- GLint width, GLint height,
- GLint depth, GLint border)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
-
- switch (target) {
- case GL_PROXY_TEXTURE_1D:
- /*JJJ wrong*/
- case GL_PROXY_TEXTURE_2D:
- {
- struct gl_texture_object *tObj;
- tdfxTexInfo *ti;
- int memNeeded;
-
- tObj = ctx->Texture.Proxy2D;
- if (!tObj->DriverData)
- tObj->DriverData = fxAllocTexObjData(fxMesa);
- ti = TDFX_TEXTURE_DATA(tObj);
- assert(ti);
-
- /* assign the parameters to test against */
- tObj->Image[0][level]->Width = width;
- tObj->Image[0][level]->Height = height;
- tObj->Image[0][level]->Border = border;
-#if 0
- tObj->Image[0][level]->IntFormat = internalFormat;
-#endif
- if (level == 0) {
- /* don't use mipmap levels > 0 */
- tObj->MinFilter = tObj->MagFilter = GL_NEAREST;
- }
- else {
- /* test with all mipmap levels */
- tObj->MinFilter = GL_LINEAR_MIPMAP_LINEAR;
- tObj->MagFilter = GL_NEAREST;
- }
- RevalidateTexture(ctx, tObj);
-
- /*
- printf("small lodlog2 0x%x\n", ti->info.smallLodLog2);
- printf("large lodlog2 0x%x\n", ti->info.largeLodLog2);
- printf("aspect ratio 0x%x\n", ti->info.aspectRatioLog2);
- printf("glide format 0x%x\n", ti->info.format);
- printf("data %p\n", ti->info.data);
- printf("lodblend %d\n", (int) ti->LODblend);
- */
-
- /* determine where texture will reside */
- if (ti->LODblend && !shared->umaTexMemory) {
- /* XXX GR_MIPMAPLEVELMASK_BOTH might not be right, but works */
- memNeeded = fxMesa->Glide.grTexTextureMemRequired(
- GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
- }
- else {
- /* XXX GR_MIPMAPLEVELMASK_BOTH might not be right, but works */
- memNeeded = fxMesa->Glide.grTexTextureMemRequired(
- GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
- }
- /*
- printf("Proxy test %d > %d\n", memNeeded, shared->totalTexMem[0]);
- */
- if (memNeeded > shared->totalTexMem[0])
- return GL_FALSE;
- else
- return GL_TRUE;
- }
- case GL_PROXY_TEXTURE_3D:
- return GL_TRUE; /* software rendering */
- default:
- return GL_TRUE; /* never happens, silence compiler */
- }
-}
-
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- * Note: we could use containment here to 'derive' the driver-specific
- * texture object from the core mesa gl_texture_object. Not done at this time.
- */
-static struct gl_texture_object *
-tdfxNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- return obj;
-}
-
-
-void tdfxInitTextureFuncs( struct dd_function_table *functions )
-{
- functions->BindTexture = tdfxBindTexture;
- functions->NewTextureObject = tdfxNewTextureObject;
- functions->DeleteTexture = tdfxDeleteTexture;
- functions->TexEnv = tdfxTexEnv;
- functions->TexParameter = tdfxTexParameter;
- functions->ChooseTextureFormat = tdfxChooseTextureFormat;
- functions->TexImage1D = tdfxTexImage1D;
- functions->TexSubImage1D = tdfxTexSubImage1D;
- functions->TexImage2D = tdfxTexImage2D;
- functions->TexSubImage2D = tdfxTexSubImage2D;
- functions->IsTextureResident = tdfxIsTextureResident;
- functions->CompressedTexImage2D = tdfxCompressedTexImage2D;
- functions->CompressedTexSubImage2D = tdfxCompressedTexSubImage2D;
- functions->UpdateTexturePalette = tdfxUpdateTexturePalette;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.h
deleted file mode 100644
index f536c25a2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tex.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#ifndef _TDFX_TEX_H_
-#define _TDFX_TEX_H_
-
-
-#define tdfxDDIsCompressedFormatMacro(internalFormat) \
- (((internalFormat) == GL_COMPRESSED_RGB_FXT1_3DFX) || \
- ((internalFormat) == GL_COMPRESSED_RGBA_FXT1_3DFX))
-#define tdfxDDIsCompressedGlideFormatMacro(internalFormat) \
- ((internalFormat) == GR_TEXFMT_ARGB_CMP_FXT1)
-
-
-
-extern void
-tdfxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj);
-
-
-#if 000 /* DEAD? */
-extern void
-fxDDTexUseGlobalPalette(GLcontext * ctx, GLboolean state);
-#endif
-
-extern GLboolean
-tdfxTestProxyTexImage(GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLenum format, GLenum type,
- GLint width, GLint height,
- GLint depth, GLint border);
-
-extern GLvoid *
-tdfxDDGetTexImage(GLcontext * ctx, GLenum target, GLint level,
- const struct gl_texture_object *texObj,
- GLenum * formatOut, GLenum * typeOut,
- GLboolean * freeImageOut);
-
-extern void
-tdfxDDGetCompressedTexImage( GLcontext *ctx, GLenum target,
- GLint lod, void *image,
- const struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
-extern GLint
-tdfxSpecificCompressedTexFormat(GLcontext *ctx,
- GLint internalFormat,
- GLint numDimensions);
-
-extern GLint
-tdfxBaseCompressedTexFormat(GLcontext *ctx,
- GLint internalFormat);
-
-extern GLboolean
-tdfxDDIsCompressedFormat(GLcontext *ctx, GLint internalFormat);
-
-extern GLsizei
-tdfxDDCompressedImageSize(GLcontext *ctx,
- GLenum intFormat,
- GLuint numDimensions,
- GLuint width,
- GLuint height,
- GLuint depth);
-
-
-extern void
-tdfxInitTextureFuncs( struct dd_function_table *functions );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.c
deleted file mode 100644
index 63cae17e4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.c
+++ /dev/null
@@ -1,994 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.5 2002/02/22 21:45:04 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#include "tdfx_context.h"
-#include "tdfx_tex.h"
-#include "tdfx_texman.h"
-#include "hash.h"
-
-
-#define BAD_ADDRESS ((FxU32) -1)
-
-
-#if 0 /* DEBUG use */
-/*
- * Verify the consistancy of the texture memory manager.
- * This involves:
- * Traversing all texture objects and computing total memory used.
- * Traverse the free block list and computing total memory free.
- * Compare the total free and total used amounts to the total memory size.
- * Make various assertions about the results.
- */
-static void
-VerifyFreeList(tdfxContextPtr fxMesa, FxU32 tmu)
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- tdfxMemRange *block;
- int prevStart = -1, prevEnd = -1;
- int totalFree = 0;
- int numObj = 0, numRes = 0;
- int totalUsed = 0;
-
- for (block = shared->tmFree[tmu]; block; block = block->next) {
- assert( block->endAddr > 0 );
- assert( block->startAddr <= shared->totalTexMem[tmu] );
- assert( block->endAddr <= shared->totalTexMem[tmu] );
- assert( (int) block->startAddr > prevStart );
- assert( (int) block->startAddr >= prevEnd );
- prevStart = (int) block->startAddr;
- prevEnd = (int) block->endAddr;
- totalFree += (block->endAddr - block->startAddr);
- }
- assert(totalFree == shared->freeTexMem[tmu]);
-
- {
- struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
- GLuint id;
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *tObj;
- tObj = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- if (ti) {
- if (ti->isInTM) {
- numRes++;
- assert(ti->tm[0]);
- if (ti->tm[tmu])
- totalUsed += (ti->tm[tmu]->endAddr - ti->tm[tmu]->startAddr);
- }
- else {
- assert(!ti->tm[0]);
- }
- }
- }
- }
-
- printf("totalFree: %d totalUsed: %d totalMem: %d #objs=%d #res=%d\n",
- shared->freeTexMem[tmu], totalUsed, shared->totalTexMem[tmu],
- numObj, numRes);
-
- assert(totalUsed + totalFree == shared->totalTexMem[tmu]);
-}
-
-
-static void
-dump_texmem(tdfxContextPtr fxMesa)
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct _mesa_HashTable *textures = mesaShared->TexObjects;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- tdfxMemRange *r;
- FxU32 prev;
- GLuint id;
-
- printf("DUMP Objects:\n");
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *obj
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tdfxTexInfo *info = TDFX_TEXTURE_DATA(obj);
-
- if (info && info->isInTM) {
- printf("Obj %8p: %4d info = %p\n", obj, obj->Name, info);
-
- printf(" isInTM=%d whichTMU=%d lastTimeUsed=%d\n",
- info->isInTM, info->whichTMU, info->lastTimeUsed);
- printf(" tm[0] = %p", info->tm[0]);
- assert(info->tm[0]);
- if (info->tm[0]) {
- printf(" tm startAddr = %d endAddr = %d",
- info->tm[0]->startAddr,
- info->tm[0]->endAddr);
- }
- printf("\n");
- printf(" tm[1] = %p", info->tm[1]);
- if (info->tm[1]) {
- printf(" tm startAddr = %d endAddr = %d",
- info->tm[1]->startAddr,
- info->tm[1]->endAddr);
- }
- printf("\n");
- }
- }
-
- VerifyFreeList(fxMesa, 0);
- VerifyFreeList(fxMesa, 1);
-
- printf("Free memory unit 0: %d bytes\n", shared->freeTexMem[0]);
- prev = 0;
- for (r = shared->tmFree[0]; r; r = r->next) {
- printf("%8p: start %8d end %8d size %8d gap %8d\n", r, r->startAddr, r->endAddr, r->endAddr - r->startAddr, r->startAddr - prev);
- prev = r->endAddr;
- }
-
- printf("Free memory unit 1: %d bytes\n", shared->freeTexMem[1]);
- prev = 0;
- for (r = shared->tmFree[1]; r; r = r->next) {
- printf("%8p: start %8d end %8d size %8d gap %8d\n", r, r->startAddr, r->endAddr, r->endAddr - r->startAddr, r->startAddr - prev);
- prev = r->endAddr;
- }
-
-}
-#endif
-
-
-
-#ifdef TEXSANITY
-static void
-fubar(void)
-{
-}
-
-/*
- * Sanity Check
- */
-static void
-sanity(tdfxContextPtr fxMesa)
-{
- tdfxMemRange *tmp, *prev, *pos;
-
- prev = 0;
- tmp = fxMesa->tmFree[0];
- while (tmp) {
- if (!tmp->startAddr && !tmp->endAddr) {
- fprintf(stderr, "Textures fubar\n");
- fubar();
- }
- if (tmp->startAddr >= tmp->endAddr) {
- fprintf(stderr, "Node fubar\n");
- fubar();
- }
- if (prev && (prev->startAddr >= tmp->startAddr ||
- prev->endAddr > tmp->startAddr)) {
- fprintf(stderr, "Sorting fubar\n");
- fubar();
- }
- prev = tmp;
- tmp = tmp->next;
- }
- prev = 0;
- tmp = fxMesa->tmFree[1];
- while (tmp) {
- if (!tmp->startAddr && !tmp->endAddr) {
- fprintf(stderr, "Textures fubar\n");
- fubar();
- }
- if (tmp->startAddr >= tmp->endAddr) {
- fprintf(stderr, "Node fubar\n");
- fubar();
- }
- if (prev && (prev->startAddr >= tmp->startAddr ||
- prev->endAddr > tmp->startAddr)) {
- fprintf(stderr, "Sorting fubar\n");
- fubar();
- }
- prev = tmp;
- tmp = tmp->next;
- }
-}
-#endif
-
-
-
-
-
-/*
- * Allocate and initialize a new MemRange struct.
- * Try to allocate it from the pool of free MemRange nodes rather than malloc.
- */
-static tdfxMemRange *
-NewRangeNode(tdfxContextPtr fxMesa, FxU32 start, FxU32 end)
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- tdfxMemRange *result;
-
- _glthread_LOCK_MUTEX(mesaShared->Mutex);
- if (shared && shared->tmPool) {
- result = shared->tmPool;
- shared->tmPool = shared->tmPool->next;
- }
- else {
- result = MALLOC(sizeof(tdfxMemRange));
-
- }
- _glthread_UNLOCK_MUTEX(mesaShared->Mutex);
-
- if (!result) {
- /*fprintf(stderr, "fxDriver: out of memory!\n");*/
- return NULL;
- }
-
- result->startAddr = start;
- result->endAddr = end;
- result->next = NULL;
-
- return result;
-}
-
-
-/*
- * Initialize texture memory.
- * We take care of one or both TMU's here.
- */
-void
-tdfxTMInit(tdfxContextPtr fxMesa)
-{
- if (!fxMesa->glCtx->Shared->DriverData) {
- const char *extensions;
- struct tdfxSharedState *shared = CALLOC_STRUCT(tdfxSharedState);
- if (!shared)
- return;
-
- LOCK_HARDWARE(fxMesa);
- extensions = fxMesa->Glide.grGetString(GR_EXTENSION);
- UNLOCK_HARDWARE(fxMesa);
- if (strstr(extensions, "TEXUMA")) {
- FxU32 start, end;
- shared->umaTexMemory = GL_TRUE;
- LOCK_HARDWARE(fxMesa);
- fxMesa->Glide.grEnable(GR_TEXTURE_UMA_EXT);
- start = fxMesa->Glide.grTexMinAddress(0);
- end = fxMesa->Glide.grTexMaxAddress(0);
- UNLOCK_HARDWARE(fxMesa);
- shared->totalTexMem[0] = end - start;
- shared->totalTexMem[1] = 0;
- shared->freeTexMem[0] = end - start;
- shared->freeTexMem[1] = 0;
- shared->tmFree[0] = NewRangeNode(fxMesa, start, end);
- shared->tmFree[1] = NULL;
- /*printf("UMA tex memory: %d\n", (int) (end - start));*/
- }
- else {
- const int numTMUs = fxMesa->haveTwoTMUs ? 2 : 1;
- int tmu;
- shared->umaTexMemory = GL_FALSE;
- LOCK_HARDWARE(fxMesa);
- for (tmu = 0; tmu < numTMUs; tmu++) {
- FxU32 start = fxMesa->Glide.grTexMinAddress(tmu);
- FxU32 end = fxMesa->Glide.grTexMaxAddress(tmu);
- shared->totalTexMem[tmu] = end - start;
- shared->freeTexMem[tmu] = end - start;
- shared->tmFree[tmu] = NewRangeNode(fxMesa, start, end);
- /*printf("Split tex memory: %d\n", (int) (end - start));*/
- }
- UNLOCK_HARDWARE(fxMesa);
- }
-
- shared->tmPool = NULL;
- fxMesa->glCtx->Shared->DriverData = shared;
- /*printf("Texture memory init UMA: %d\n", shared->umaTexMemory);*/
- }
-}
-
-
-/*
- * Clean-up texture memory before destroying context.
- */
-void
-tdfxTMClose(tdfxContextPtr fxMesa)
-{
- if (fxMesa->glCtx->Shared->RefCount == 1 && fxMesa->driDrawable) {
- /* refcount will soon go to zero, free our 3dfx stuff */
- struct tdfxSharedState *shared = (struct tdfxSharedState *) fxMesa->glCtx->Shared->DriverData;
-
- const int numTMUs = fxMesa->haveTwoTMUs ? 2 : 1;
- int tmu;
- tdfxMemRange *tmp, *next;
-
- /* Deallocate the pool of free tdfxMemRange nodes */
- tmp = shared->tmPool;
- while (tmp) {
- next = tmp->next;
- FREE(tmp);
- tmp = next;
- }
-
- /* Delete the texture memory block tdfxMemRange nodes */
- for (tmu = 0; tmu < numTMUs; tmu++) {
- tmp = shared->tmFree[tmu];
- while (tmp) {
- next = tmp->next;
- FREE(tmp);
- tmp = next;
- }
- }
-
- FREE(shared);
- fxMesa->glCtx->Shared->DriverData = NULL;
- }
-}
-
-
-
-/*
- * Delete a tdfxMemRange struct.
- * We keep a linked list of free/available tdfxMemRange structs to
- * avoid extra malloc/free calls.
- */
-#if 0
-static void
-DeleteRangeNode_NoLock(struct TdfxSharedState *shared, tdfxMemRange *range)
-{
- /* insert at head of list */
- range->next = shared->tmPool;
- shared->tmPool = range;
-}
-#endif
-
-#define DELETE_RANGE_NODE(shared, range) \
- (range)->next = (shared)->tmPool; \
- (shared)->tmPool = (range)
-
-
-
-/*
- * When we've run out of texture memory we have to throw out an
- * existing texture to make room for the new one. This function
- * determins the texture to throw out.
- */
-static struct gl_texture_object *
-FindOldestObject(tdfxContextPtr fxMesa, FxU32 tmu)
-{
- const GLuint bindnumber = fxMesa->texBindNumber;
- struct gl_texture_object *oldestObj, *lowestPriorityObj;
- GLfloat lowestPriority;
- GLuint oldestAge;
- GLuint id;
- struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
-
- oldestObj = NULL;
- oldestAge = 0;
-
- lowestPriority = 1.0F;
- lowestPriorityObj = NULL;
-
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *obj
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tdfxTexInfo *info = TDFX_TEXTURE_DATA(obj);
-
- if (info && info->isInTM &&
- ((info->whichTMU == tmu) || (info->whichTMU == TDFX_TMU_BOTH) ||
- (info->whichTMU == TDFX_TMU_SPLIT))) {
- GLuint age, lasttime;
-
- assert(info->tm[0]);
- lasttime = info->lastTimeUsed;
-
- if (lasttime > bindnumber)
- age = bindnumber + (UINT_MAX - lasttime + 1); /* TO DO: check wrap around */
- else
- age = bindnumber - lasttime;
-
- if (age >= oldestAge) {
- oldestAge = age;
- oldestObj = obj;
- }
-
- /* examine priority */
- if (obj->Priority < lowestPriority) {
- lowestPriority = obj->Priority;
- lowestPriorityObj = obj;
- }
- }
- }
-
- if (lowestPriority < 1.0) {
- ASSERT(lowestPriorityObj);
- /*
- printf("discard %d pri=%f\n", lowestPriorityObj->Name, lowestPriority);
- */
- return lowestPriorityObj;
- }
- else {
- /*
- printf("discard %d age=%d\n", oldestObj->Name, oldestAge);
- */
- return oldestObj;
- }
-}
-
-
-#if 0
-static void
-FlushTexMemory(tdfxContextPtr fxMesa)
-{
- struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
- GLuint id;
-
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *obj
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- if (obj->RefCount < 2) {
- /* don't flush currently bound textures */
- tdfxTMMoveOutTM_NoLock(fxMesa, obj);
- }
- }
-}
-#endif
-
-
-/*
- * Find the address (offset?) at which we can store a new texture.
- * <tmu> is the texture unit.
- * <size> is the texture size in bytes.
- */
-static FxU32
-FindStartAddr(tdfxContextPtr fxMesa, FxU32 tmu, FxU32 size)
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- tdfxMemRange *prev, *block;
- FxU32 result;
-#if 0
- int discardedCount = 0;
-#define MAX_DISCARDS 10
-#endif
-
- if (shared->umaTexMemory) {
- assert(tmu == TDFX_TMU0);
- }
-
- _glthread_LOCK_MUTEX(mesaShared->Mutex);
- while (1) {
- prev = NULL;
- block = shared->tmFree[tmu];
- while (block) {
- if (block->endAddr - block->startAddr >= size) {
- /* The texture will fit here */
- result = block->startAddr;
- block->startAddr += size;
- if (block->startAddr == block->endAddr) {
- /* Remove this node since it's empty */
- if (prev) {
- prev->next = block->next;
- }
- else {
- shared->tmFree[tmu] = block->next;
- }
- DELETE_RANGE_NODE(shared, block);
- }
- shared->freeTexMem[tmu] -= size;
- _glthread_UNLOCK_MUTEX(mesaShared->Mutex);
- return result;
- }
- prev = block;
- block = block->next;
- }
- /* We failed to find a block large enough to accomodate <size> bytes.
- * Find the oldest texObject and free it.
- */
-#if 0
- discardedCount++;
- if (discardedCount > MAX_DISCARDS + 1) {
- _mesa_problem(NULL, "%s: extreme texmem fragmentation", __FUNCTION__);
- _glthread_UNLOCK_MUTEX(mesaShared->Mutex);
- return BAD_ADDRESS;
- }
- else if (discardedCount > MAX_DISCARDS) {
- /* texture memory is probably really fragmented, flush it */
- FlushTexMemory(fxMesa);
- }
- else
-#endif
- {
- struct gl_texture_object *obj = FindOldestObject(fxMesa, tmu);
- if (obj) {
- tdfxTMMoveOutTM_NoLock(fxMesa, obj);
- fxMesa->stats.texSwaps++;
- }
- else {
- _mesa_problem(NULL, "%s: extreme texmem fragmentation", __FUNCTION__);
- _glthread_UNLOCK_MUTEX(mesaShared->Mutex);
- return BAD_ADDRESS;
- }
- }
- }
-
- /* never get here, but play it safe */
- _glthread_UNLOCK_MUTEX(mesaShared->Mutex);
- return BAD_ADDRESS;
-}
-
-
-/*
- * Remove the given tdfxMemRange node from hardware texture memory.
- */
-static void
-RemoveRange_NoLock(tdfxContextPtr fxMesa, FxU32 tmu, tdfxMemRange *range)
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- tdfxMemRange *block, *prev;
-
- if (shared->umaTexMemory) {
- assert(tmu == TDFX_TMU0);
- }
-
- if (!range)
- return;
-
- if (range->startAddr == range->endAddr) {
- DELETE_RANGE_NODE(shared, range);
- return;
- }
- shared->freeTexMem[tmu] += range->endAddr - range->startAddr;
-
- /* find position in linked list to insert this tdfxMemRange node */
- prev = NULL;
- block = shared->tmFree[tmu];
- while (block) {
- assert(range->startAddr != block->startAddr);
- if (range->startAddr > block->startAddr) {
- prev = block;
- block = block->next;
- }
- else {
- break;
- }
- }
-
- /* Insert the free block, combine with adjacent blocks when possible */
- range->next = block;
- if (block) {
- if (range->endAddr == block->startAddr) {
- /* Combine */
- block->startAddr = range->startAddr;
- DELETE_RANGE_NODE(shared, range);
- range = block;
- }
- }
- if (prev) {
- if (prev->endAddr == range->startAddr) {
- /* Combine */
- prev->endAddr = range->endAddr;
- prev->next = range->next;
- DELETE_RANGE_NODE(shared, range);
- }
- else {
- prev->next = range;
- }
- }
- else {
- shared->tmFree[tmu] = range;
- }
-}
-
-
-#if 0 /* NOT USED */
-static void
-RemoveRange(tdfxContextPtr fxMesa, FxU32 tmu, tdfxMemRange *range)
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- _glthread_LOCK_MUTEX(mesaShared->Mutex);
- RemoveRange_NoLock(fxMesa, tmu, range);
- _glthread_UNLOCK_MUTEX(mesaShared->Mutex);
-}
-#endif
-
-
-/*
- * Allocate space for a texture image.
- * <tmu> is the texture unit
- * <texmemsize> is the number of bytes to allocate
- */
-static tdfxMemRange *
-AllocTexMem(tdfxContextPtr fxMesa, FxU32 tmu, FxU32 texmemsize)
-{
- FxU32 startAddr;
- startAddr = FindStartAddr(fxMesa, tmu, texmemsize);
- if (startAddr == BAD_ADDRESS) {
- _mesa_problem(fxMesa->glCtx, "%s returned NULL! tmu=%d texmemsize=%d",
- __FUNCTION__, (int) tmu, (int) texmemsize);
- return NULL;
- }
- else {
- tdfxMemRange *range;
- range = NewRangeNode(fxMesa, startAddr, startAddr + texmemsize);
- return range;
- }
-}
-
-
-/*
- * Download (copy) the given texture data (all mipmap levels) into the
- * Voodoo's texture memory.
- * The texture memory must have already been allocated.
- */
-void
-tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
-{
- tdfxTexInfo *ti;
- GLint l;
- FxU32 targetTMU;
-
- assert(tObj);
- ti = TDFX_TEXTURE_DATA(tObj);
- assert(ti);
- targetTMU = ti->whichTMU;
-
- switch (targetTMU) {
- case TDFX_TMU0:
- case TDFX_TMU1:
- if (ti->tm[targetTMU]) {
- for (l = ti->minLevel; l <= ti->maxLevel
- && tObj->Image[0][l]->Data; l++) {
- GrLOD_t glideLod = ti->info.largeLodLog2 - l + tObj->BaseLevel;
- fxMesa->Glide.grTexDownloadMipMapLevel(targetTMU,
- ti->tm[targetTMU]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[0][l]->Data);
- }
- }
- break;
- case TDFX_TMU_SPLIT:
- if (ti->tm[TDFX_TMU0] && ti->tm[TDFX_TMU1]) {
- for (l = ti->minLevel; l <= ti->maxLevel
- && tObj->Image[0][l]->Data; l++) {
- GrLOD_t glideLod = ti->info.largeLodLog2 - l + tObj->BaseLevel;
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[TDFX_TMU0]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_ODD,
- tObj->Image[0][l]->Data);
-
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[TDFX_TMU1]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_EVEN,
- tObj->Image[0][l]->Data);
- }
- }
- break;
- case TDFX_TMU_BOTH:
- if (ti->tm[TDFX_TMU0] && ti->tm[TDFX_TMU1]) {
- for (l = ti->minLevel; l <= ti->maxLevel
- && tObj->Image[0][l]->Data; l++) {
- GrLOD_t glideLod = ti->info.largeLodLog2 - l + tObj->BaseLevel;
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[TDFX_TMU0]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[0][l]->Data);
-
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[TDFX_TMU1]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[0][l]->Data);
- }
- }
- break;
- default:
- _mesa_problem(NULL, "%s: bad tmu (%d)", __FUNCTION__, (int)targetTMU);
- return;
- }
-}
-
-
-void
-tdfxTMReloadMipMapLevel(GLcontext *ctx, struct gl_texture_object *tObj,
- GLint level)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- GrLOD_t glideLod;
- FxU32 tmu;
-
- tmu = ti->whichTMU;
- glideLod = ti->info.largeLodLog2 - level + tObj->BaseLevel;
- ASSERT(ti->isInTM);
-
- LOCK_HARDWARE(fxMesa);
-
- switch (tmu) {
- case TDFX_TMU0:
- case TDFX_TMU1:
- fxMesa->Glide.grTexDownloadMipMapLevel(tmu,
- ti->tm[tmu]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[0][level]->Data);
- break;
- case TDFX_TMU_SPLIT:
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[GR_TMU0]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_ODD,
- tObj->Image[0][level]->Data);
-
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[GR_TMU1]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_EVEN,
- tObj->Image[0][level]->Data);
- break;
- case TDFX_TMU_BOTH:
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[GR_TMU0]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[0][level]->Data);
-
- fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[GR_TMU1]->startAddr,
- glideLod,
- ti->info.largeLodLog2,
- ti->info.aspectRatioLog2,
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[0][level]->Data);
- break;
-
- default:
- _mesa_problem(ctx, "%s: bad tmu (%d)", __FUNCTION__, (int)tmu);
- break;
- }
- UNLOCK_HARDWARE(fxMesa);
-}
-
-
-/*
- * Allocate space for the given texture in texture memory then
- * download (copy) it into that space.
- */
-void
-tdfxTMMoveInTM_NoLock( tdfxContextPtr fxMesa, struct gl_texture_object *tObj,
- FxU32 targetTMU )
-{
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- FxU32 texmemsize;
-
- fxMesa->stats.reqTexUpload++;
-
- if (ti->isInTM) {
- if (ti->whichTMU == targetTMU)
- return;
- if (targetTMU == TDFX_TMU_SPLIT || ti->whichTMU == TDFX_TMU_SPLIT) {
- tdfxTMMoveOutTM_NoLock(fxMesa, tObj);
- }
- else {
- if (ti->whichTMU == TDFX_TMU_BOTH)
- return;
- targetTMU = TDFX_TMU_BOTH;
- }
- }
-
- ti->whichTMU = targetTMU;
-
- switch (targetTMU) {
- case TDFX_TMU0:
- case TDFX_TMU1:
- texmemsize = fxMesa->Glide.grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
- ti->tm[targetTMU] = AllocTexMem(fxMesa, targetTMU, texmemsize);
- break;
- case TDFX_TMU_SPLIT:
- texmemsize = fxMesa->Glide.grTexTextureMemRequired(GR_MIPMAPLEVELMASK_ODD,
- &(ti->info));
- ti->tm[TDFX_TMU0] = AllocTexMem(fxMesa, TDFX_TMU0, texmemsize);
- if (ti->tm[TDFX_TMU0])
- fxMesa->stats.memTexUpload += texmemsize;
-
- texmemsize = fxMesa->Glide.grTexTextureMemRequired(GR_MIPMAPLEVELMASK_EVEN,
- &(ti->info));
- ti->tm[TDFX_TMU1] = AllocTexMem(fxMesa, TDFX_TMU1, texmemsize);
- break;
- case TDFX_TMU_BOTH:
- texmemsize = fxMesa->Glide.grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
- ti->tm[TDFX_TMU0] = AllocTexMem(fxMesa, TDFX_TMU0, texmemsize);
- if (ti->tm[TDFX_TMU0])
- fxMesa->stats.memTexUpload += texmemsize;
-
- /*texmemsize = fxMesa->Glide.grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));*/
- ti->tm[TDFX_TMU1] = AllocTexMem(fxMesa, TDFX_TMU1, texmemsize);
- break;
- default:
- _mesa_problem(NULL, "%s: bad tmu (%d)", __FUNCTION__, (int)targetTMU);
- return;
- }
-
- ti->reloadImages = GL_TRUE;
- ti->isInTM = GL_TRUE;
-
- fxMesa->stats.texUpload++;
-}
-
-
-/*
- * Move the given texture out of hardware texture memory.
- * This deallocates the texture's memory space.
- */
-void
-tdfxTMMoveOutTM_NoLock( tdfxContextPtr fxMesa, struct gl_texture_object *tObj )
-{
- struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
-
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: %s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name);
- }
-
- /*
- VerifyFreeList(fxMesa, 0);
- VerifyFreeList(fxMesa, 1);
- */
-
- if (!ti || !ti->isInTM)
- return;
-
- switch (ti->whichTMU) {
- case TDFX_TMU0:
- case TDFX_TMU1:
- RemoveRange_NoLock(fxMesa, ti->whichTMU, ti->tm[ti->whichTMU]);
- break;
- case TDFX_TMU_SPLIT:
- case TDFX_TMU_BOTH:
- assert(!shared->umaTexMemory);
- RemoveRange_NoLock(fxMesa, TDFX_TMU0, ti->tm[TDFX_TMU0]);
- RemoveRange_NoLock(fxMesa, TDFX_TMU1, ti->tm[TDFX_TMU1]);
- break;
- default:
- _mesa_problem(NULL, "%s: bad tmu (%d)", __FUNCTION__, (int)ti->whichTMU);
- return;
- }
-
- ti->isInTM = GL_FALSE;
- ti->tm[0] = NULL;
- ti->tm[1] = NULL;
- ti->whichTMU = TDFX_TMU_NONE;
-
- /*
- VerifyFreeList(fxMesa, 0);
- VerifyFreeList(fxMesa, 1);
- */
-}
-
-
-/*
- * Called via glDeleteTexture to delete a texture object.
- */
-void
-tdfxTMFreeTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
-{
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- if (ti) {
- tdfxTMMoveOutTM(fxMesa, tObj);
- FREE(ti);
- tObj->DriverData = NULL;
- }
- /*
- VerifyFreeList(fxMesa, 0);
- VerifyFreeList(fxMesa, 1);
- */
-}
-
-
-
-/*
- * After a context switch this function will be called to restore
- * texture memory for the new context.
- */
-void tdfxTMRestoreTextures_NoLock( tdfxContextPtr fxMesa )
-{
- GLcontext *ctx = fxMesa->glCtx;
- struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
- GLuint id;
-
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *tObj
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA( tObj );
- if ( ti && ti->isInTM ) {
- int i;
- for ( i = 0 ; i < MAX_TEXTURE_UNITS ; i++ ) {
- if ( ctx->Texture.Unit[i]._Current == tObj ) {
- tdfxTMDownloadTexture( fxMesa, tObj );
- break;
- }
- }
- if ( i == MAX_TEXTURE_UNITS ) {
- tdfxTMMoveOutTM_NoLock( fxMesa, tObj );
- }
- }
- }
- /*
- VerifyFreeList(fxMesa, 0);
- VerifyFreeList(fxMesa, 1);
- */
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.h
deleted file mode 100644
index 739d4e142..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texman.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#ifndef __TDFX_TEXMAN_H__
-#define __TDFX_TEXMAN_H__
-
-
-#include "tdfx_lock.h"
-
-
-extern void tdfxTMInit( tdfxContextPtr fxMesa );
-
-extern void tdfxTMClose( tdfxContextPtr fxMesa );
-
-extern void tdfxTMDownloadTexture(tdfxContextPtr fxMesa,
- struct gl_texture_object *tObj);
-
-extern void tdfxTMReloadMipMapLevel( GLcontext *ctx,
- struct gl_texture_object *tObj,
- GLint level );
-
-extern void tdfxTMMoveInTM_NoLock( tdfxContextPtr fxMesa,
- struct gl_texture_object *tObj,
- FxU32 targetTMU );
-
-extern void tdfxTMMoveOutTM_NoLock( tdfxContextPtr fxMesa,
- struct gl_texture_object *tObj );
-
-extern void tdfxTMFreeTexture( tdfxContextPtr fxMesa,
- struct gl_texture_object *tObj );
-
-extern void tdfxTMRestoreTextures_NoLock( tdfxContextPtr fxMesa );
-
-
-#define tdfxTMMoveInTM( fxMesa, tObj, targetTMU ) \
- do { \
- LOCK_HARDWARE( fxMesa ); \
- tdfxTMMoveInTM_NoLock( fxMesa, tObj, targetTMU ); \
- UNLOCK_HARDWARE( fxMesa ); \
- } while (0)
-
-#define tdfxTMMoveOutTM( fxMesa, tObj ) \
- do { \
- LOCK_HARDWARE( fxMesa ); \
- tdfxTMMoveOutTM_NoLock( fxMesa, tObj ); \
- UNLOCK_HARDWARE( fxMesa ); \
- } while (0)
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
deleted file mode 100644
index 7059b56e3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
+++ /dev/null
@@ -1,2209 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c,v 1.2 2002/02/22 21:45:04 dawes Exp $ */
-
-/*
- * New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#include "tdfx_state.h"
-#include "tdfx_tex.h"
-#include "tdfx_texman.h"
-#include "tdfx_texstate.h"
-
-
-/* =============================================================
- * Texture
- */
-
-/*
- * These macros are used below when handling COMBINE_EXT.
- */
-#define TEXENV_OPERAND_INVERTED(operand) \
- (((operand) == GL_ONE_MINUS_SRC_ALPHA) \
- || ((operand) == GL_ONE_MINUS_SRC_COLOR))
-#define TEXENV_OPERAND_ALPHA(operand) \
- (((operand) == GL_SRC_ALPHA) || ((operand) == GL_ONE_MINUS_SRC_ALPHA))
-#define TEXENV_SETUP_ARG_A(param, source, operand, iteratedAlpha) \
- switch (source) { \
- case GL_TEXTURE: \
- param = GR_CMBX_LOCAL_TEXTURE_ALPHA; \
- break; \
- case GL_CONSTANT_EXT: \
- param = GR_CMBX_TMU_CALPHA; \
- break; \
- case GL_PRIMARY_COLOR_EXT: \
- param = GR_CMBX_ITALPHA; \
- break; \
- case GL_PREVIOUS_EXT: \
- param = iteratedAlpha; \
- break; \
- default: \
- /* \
- * This is here just to keep from getting \
- * compiler warnings. \
- */ \
- param = GR_CMBX_ZERO; \
- break; \
- }
-
-#define TEXENV_SETUP_ARG_RGB(param, source, operand, iteratedColor, iteratedAlpha) \
- if (!TEXENV_OPERAND_ALPHA(operand)) { \
- switch (source) { \
- case GL_TEXTURE: \
- param = GR_CMBX_LOCAL_TEXTURE_RGB; \
- break; \
- case GL_CONSTANT_EXT: \
- param = GR_CMBX_TMU_CCOLOR; \
- break; \
- case GL_PRIMARY_COLOR_EXT: \
- param = GR_CMBX_ITRGB; \
- break; \
- case GL_PREVIOUS_EXT: \
- param = iteratedColor; \
- break; \
- default: \
- /* \
- * This is here just to keep from getting \
- * compiler warnings. \
- */ \
- param = GR_CMBX_ZERO; \
- break; \
- } \
- } else { \
- switch (source) { \
- case GL_TEXTURE: \
- param = GR_CMBX_LOCAL_TEXTURE_ALPHA; \
- break; \
- case GL_CONSTANT_EXT: \
- param = GR_CMBX_TMU_CALPHA; \
- break; \
- case GL_PRIMARY_COLOR_EXT: \
- param = GR_CMBX_ITALPHA; \
- break; \
- case GL_PREVIOUS_EXT: \
- param = iteratedAlpha; \
- break; \
- default: \
- /* \
- * This is here just to keep from getting \
- * compiler warnings. \
- */ \
- param = GR_CMBX_ZERO; \
- break; \
- } \
- }
-
-#define TEXENV_SETUP_MODE_RGB(param, operand) \
- switch (operand) { \
- case GL_SRC_COLOR: \
- case GL_SRC_ALPHA: \
- param = GR_FUNC_MODE_X; \
- break; \
- case GL_ONE_MINUS_SRC_ALPHA: \
- case GL_ONE_MINUS_SRC_COLOR: \
- param = GR_FUNC_MODE_ONE_MINUS_X; \
- break; \
- default: \
- param = GR_FUNC_MODE_ZERO; \
- break; \
- }
-
-#define TEXENV_SETUP_MODE_A(param, operand) \
- switch (operand) { \
- case GL_SRC_ALPHA: \
- param = GR_FUNC_MODE_X; \
- break; \
- case GL_ONE_MINUS_SRC_ALPHA: \
- param = GR_FUNC_MODE_ONE_MINUS_X; \
- break; \
- default: \
- param = GR_FUNC_MODE_ZERO; \
- break; \
- }
-
-
-
-/*
- * Setup a texture environment on Voodoo5.
- * Return GL_TRUE for success, GL_FALSE for failure.
- * If we fail, we'll have to use software rendering.
- */
-static GLboolean
-SetupTexEnvNapalm(GLcontext *ctx, GLboolean useIteratedRGBA,
- const struct gl_texture_unit *texUnit, GLenum baseFormat,
- struct tdfx_texcombine_ext *env)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrTCCUColor_t incomingRGB, incomingAlpha;
- const GLenum envMode = texUnit->EnvMode;
-
- if (useIteratedRGBA) {
- incomingRGB = GR_CMBX_ITRGB;
- incomingAlpha = GR_CMBX_ITALPHA;
- }
- else {
- incomingRGB = GR_CMBX_OTHER_TEXTURE_RGB;
- incomingAlpha = GR_CMBX_OTHER_TEXTURE_ALPHA;
- }
-
- /* invariant: */
- env->Color.Shift = 0;
- env->Color.Invert = FXFALSE;
- env->Alpha.Shift = 0;
- env->Alpha.Invert = FXFALSE;
-
- switch (envMode) {
- case GL_REPLACE:
- /* -- Setup RGB combiner */
- if (baseFormat == GL_ALPHA) {
- /* Rv = Rf */
- env->Color.SourceA = incomingRGB;
- }
- else {
- /* Rv = Rt */
- env->Color.SourceA = GR_CMBX_LOCAL_TEXTURE_RGB;
- }
- env->Color.ModeA = GR_FUNC_MODE_X;
- env->Color.SourceB = GR_CMBX_ZERO;
- env->Color.ModeB = GR_FUNC_MODE_ZERO;
- env->Color.SourceC = GR_CMBX_ZERO;
- env->Color.InvertC = FXTRUE;
- env->Color.SourceD = GR_CMBX_ZERO;
- env->Color.InvertD = FXFALSE;
- /* -- Setup Alpha combiner */
- if (baseFormat == GL_LUMINANCE || baseFormat == GL_RGB) {
- /* Av = Af */
- env->Alpha.SourceD = incomingAlpha;
- }
- else {
- /* Av = At */
- env->Alpha.SourceD = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- }
- env->Alpha.SourceA = GR_CMBX_ITALPHA;
- env->Alpha.ModeA = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceB = GR_CMBX_ITALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceC = GR_CMBX_ZERO;
- env->Alpha.InvertC = FXFALSE;
- env->Alpha.InvertD = FXFALSE;
- break;
-
- case GL_MODULATE:
- /* -- Setup RGB combiner */
- if (baseFormat == GL_ALPHA) {
- /* Rv = Rf */
- env->Color.SourceC = GR_CMBX_ZERO;
- env->Color.InvertC = FXTRUE;
- }
- else {
- /* Result = Frag * Tex */
- env->Color.SourceC = GR_CMBX_LOCAL_TEXTURE_RGB;
- env->Color.InvertC = FXFALSE;
- }
- env->Color.SourceA = incomingRGB;
- env->Color.ModeA = GR_FUNC_MODE_X;
- env->Color.SourceB = GR_CMBX_ZERO;
- env->Color.ModeB = GR_FUNC_MODE_ZERO;
- env->Color.SourceD = GR_CMBX_ZERO;
- env->Color.InvertD = FXFALSE;
- /* -- Setup Alpha combiner */
- if (baseFormat == GL_LUMINANCE || baseFormat == GL_RGB) {
- /* Av = Af */
- env->Alpha.SourceA = incomingAlpha;
- env->Alpha.SourceC = GR_CMBX_ZERO;
- env->Alpha.InvertC = FXTRUE;
- }
- else {
- /* Av = Af * At */
- env->Alpha.SourceA = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- env->Alpha.SourceC = incomingAlpha;
- env->Alpha.InvertC = FXFALSE;
- }
- env->Alpha.ModeA = GR_FUNC_MODE_X;
- env->Alpha.SourceB = GR_CMBX_ITALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceD = GR_CMBX_ZERO;
- env->Alpha.InvertD = FXFALSE;
- break;
-
- case GL_DECAL:
- /* -- Setup RGB combiner */
- if (baseFormat == GL_RGB) {
- /* Rv = Rt */
- env->Color.SourceB = GR_CMBX_ZERO;
- env->Color.ModeB = GR_FUNC_MODE_X;
- env->Color.SourceC = GR_CMBX_ZERO;
- env->Color.InvertC = FXTRUE;
- env->Color.SourceD = GR_CMBX_ZERO;
- env->Color.InvertD = FXFALSE;
- }
- else {
- /* Rv = Rf * (1 - At) + Rt * At */
- env->Color.SourceB = incomingRGB;
- env->Color.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- env->Color.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- env->Color.InvertC = FXFALSE;
- env->Color.SourceD = GR_CMBX_B;
- env->Color.InvertD = FXFALSE;
- }
- env->Color.SourceA = GR_CMBX_LOCAL_TEXTURE_RGB;
- env->Color.ModeA = GR_FUNC_MODE_X;
- /* -- Setup Alpha combiner */
- /* Av = Af */
- env->Alpha.SourceA = incomingAlpha;
- env->Alpha.ModeA = GR_FUNC_MODE_X;
- env->Alpha.SourceB = GR_CMBX_ITALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceC = GR_CMBX_ZERO;
- env->Alpha.InvertC = FXTRUE;
- env->Alpha.SourceD = GR_CMBX_ZERO;
- env->Alpha.InvertD = FXFALSE;
- break;
-
- case GL_BLEND:
- /* -- Setup RGB combiner */
- if (baseFormat == GL_ALPHA) {
- /* Rv = Rf */
- env->Color.SourceA = incomingRGB;
- env->Color.ModeA = GR_FUNC_MODE_X;
- env->Color.SourceB = GR_CMBX_ZERO;
- env->Color.ModeB = GR_FUNC_MODE_ZERO;
- env->Color.SourceC = GR_CMBX_ZERO;
- env->Color.InvertC = FXTRUE;
- env->Color.SourceD = GR_CMBX_ZERO;
- env->Color.InvertD = FXFALSE;
- }
- else {
- /* Rv = Rf * (1 - Rt) + Rc * Rt */
- env->Color.SourceA = GR_CMBX_TMU_CCOLOR;
- env->Color.ModeA = GR_FUNC_MODE_X;
- env->Color.SourceB = incomingRGB;
- env->Color.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- env->Color.SourceC = GR_CMBX_LOCAL_TEXTURE_RGB;
- env->Color.InvertC = FXFALSE;
- env->Color.SourceD = GR_CMBX_B;
- env->Color.InvertD = FXFALSE;
- }
- /* -- Setup Alpha combiner */
- if (baseFormat == GL_LUMINANCE || baseFormat == GL_RGB) {
- /* Av = Af */
- env->Alpha.SourceA = incomingAlpha;
- env->Alpha.ModeA = GR_FUNC_MODE_X;
- env->Alpha.SourceB = GR_CMBX_ZERO;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceC = GR_CMBX_ZERO;
- env->Alpha.InvertC = FXTRUE;
- env->Alpha.SourceD = GR_CMBX_ZERO;
- env->Alpha.InvertD = FXFALSE;
- }
- else if (baseFormat == GL_INTENSITY) {
- /* Av = Af * (1 - It) + Ac * It */
- env->Alpha.SourceA = GR_CMBX_TMU_CALPHA;
- env->Alpha.ModeA = GR_FUNC_MODE_X;
- env->Alpha.SourceB = incomingAlpha;
- env->Alpha.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- env->Alpha.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- env->Alpha.InvertC = FXFALSE;
- env->Alpha.SourceD = GR_CMBX_B;
- env->Alpha.InvertD = FXFALSE;
- }
- else {
- /* Av = Af * At */
- env->Alpha.SourceA = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- env->Alpha.ModeA = GR_FUNC_MODE_X;
- env->Alpha.SourceB = GR_CMBX_ITALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceC = incomingAlpha;
- env->Alpha.InvertC = FXFALSE;
- env->Alpha.SourceD = GR_CMBX_ZERO;
- env->Alpha.InvertD = FXFALSE;
- }
- /* Also have to set up the tex env constant color */
- env->EnvColor = PACK_RGBA32(texUnit->EnvColor[0] * 255.0F,
- texUnit->EnvColor[1] * 255.0F,
- texUnit->EnvColor[2] * 255.0F,
- texUnit->EnvColor[3] * 255.0F);
- break;
- case GL_ADD:
- /* -- Setup RGB combiner */
- if (baseFormat == GL_ALPHA) {
- /* Rv = Rf */
- env->Color.SourceB = GR_CMBX_ZERO;
- env->Color.ModeB = GR_FUNC_MODE_ZERO;
- }
- else {
- /* Rv = Rf + Tt */
- env->Color.SourceB = GR_CMBX_LOCAL_TEXTURE_RGB;
- env->Color.ModeB = GR_FUNC_MODE_X;
- }
- env->Color.SourceA = incomingRGB;
- env->Color.ModeA = GR_FUNC_MODE_X;
- env->Color.SourceC = GR_CMBX_ZERO;
- env->Color.InvertC = FXTRUE;
- env->Color.SourceD = GR_CMBX_ZERO;
- env->Color.InvertD = FXFALSE;
- /* -- Setup Alpha combiner */
- if (baseFormat == GL_LUMINANCE || baseFormat == GL_RGB) {
- /* Av = Af */
- env->Alpha.SourceA = incomingAlpha;
- env->Alpha.SourceB = GR_CMBX_ITALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceC = GR_CMBX_ZERO;
- env->Alpha.InvertC = FXTRUE;
-
- }
- else if (baseFormat == GL_INTENSITY) {
- /* Av = Af + It */
- env->Alpha.SourceA = incomingAlpha;
- env->Alpha.SourceB = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_X;
- env->Alpha.SourceC = GR_CMBX_ZERO;
- env->Alpha.InvertC = FXTRUE;
- }
- else {
- /* Av = Af * At */
- env->Alpha.SourceA = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- env->Alpha.SourceB = GR_CMBX_ITALPHA;
- env->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- env->Alpha.SourceC = incomingAlpha;
- env->Alpha.InvertC = FXFALSE;
- }
- env->Alpha.ModeA = GR_FUNC_MODE_X;
- env->Alpha.SourceD = GR_CMBX_ZERO;
- env->Alpha.InvertD = FXFALSE;
- break;
-
- case GL_COMBINE_EXT:
- {
- FxU32 A_RGB, B_RGB, C_RGB, D_RGB;
- FxU32 Amode_RGB, Bmode_RGB;
- FxBool Cinv_RGB, Dinv_RGB, Ginv_RGB;
- FxU32 Shift_RGB;
- FxU32 A_A, B_A, C_A, D_A;
- FxU32 Amode_A, Bmode_A;
- FxBool Cinv_A, Dinv_A, Ginv_A;
- FxU32 Shift_A;
-
- /*
- *
- * In the formulas below, we write:
- * o "1(x)" for the identity function applied to x,
- * so 1(x) = x.
- * o "0(x)" for the constant function 0, so
- * 0(x) = 0 for all values of x.
- *
- * Calculate the color combination.
- */
- Shift_RGB = texUnit->Combine.ScaleShiftRGB;
- Shift_A = texUnit->Combine.ScaleShiftA;
- switch (texUnit->Combine.ModeRGB) {
- case GL_REPLACE:
- /*
- * The formula is: Arg0
- * We implement this by the formula:
- * (Arg0 + 0(0))*(1-0) + 0
- */
- TEXENV_SETUP_ARG_RGB(A_RGB,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- incomingRGB, incomingAlpha);
- TEXENV_SETUP_MODE_RGB(Amode_RGB,
- texUnit->Combine.OperandRGB[0]);
- B_RGB = C_RGB = D_RGB = GR_CMBX_ZERO;
- Bmode_RGB = GR_FUNC_MODE_ZERO;
- Cinv_RGB = FXTRUE;
- Dinv_RGB = Ginv_RGB = FXFALSE;
- break;
- case GL_MODULATE:
- /*
- * The formula is: Arg0 * Arg1
- *
- * We implement this by the formula
- * (Arg0 + 0(0)) * Arg1 + 0(0)
- */
- TEXENV_SETUP_ARG_RGB(A_RGB,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- incomingRGB, incomingAlpha);
- TEXENV_SETUP_MODE_RGB(Amode_RGB,
- texUnit->Combine.OperandRGB[0]);
- B_RGB = GR_CMBX_ZERO;
- Bmode_RGB = GR_CMBX_ZERO;
- TEXENV_SETUP_ARG_RGB(C_RGB,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- incomingRGB, incomingAlpha);
- Cinv_RGB = TEXENV_OPERAND_INVERTED
- (texUnit->Combine.OperandRGB[1]);
- D_RGB = GR_CMBX_ZERO;
- Dinv_RGB = Ginv_RGB = FXFALSE;
- break;
- case GL_ADD:
- /*
- * The formula is Arg0 + Arg1
- */
- TEXENV_SETUP_ARG_RGB(A_RGB,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- incomingRGB, incomingAlpha);
- TEXENV_SETUP_MODE_RGB(Amode_RGB,
- texUnit->Combine.OperandRGB[0]);
- TEXENV_SETUP_ARG_RGB(B_RGB,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- incomingRGB, incomingAlpha);
- TEXENV_SETUP_MODE_RGB(Bmode_RGB,
- texUnit->Combine.OperandRGB[1]);
- C_RGB = D_RGB = GR_CMBX_ZERO;
- Cinv_RGB = FXTRUE;
- Dinv_RGB = Ginv_RGB = FXFALSE;
- break;
- case GL_ADD_SIGNED_EXT:
- /*
- * The formula is: Arg0 + Arg1 - 0.5.
- * We compute this by calculating:
- * (Arg0 - 1/2) + Arg1 if op0 is SRC_{COLOR,ALPHA}
- * Arg0 + (Arg1 - 1/2) if op1 is SRC_{COLOR,ALPHA}
- * If both op0 and op1 are ONE_MINUS_SRC_{COLOR,ALPHA}
- * we cannot implement the formula properly.
- */
- TEXENV_SETUP_ARG_RGB(A_RGB,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- incomingRGB, incomingAlpha);
- TEXENV_SETUP_ARG_RGB(B_RGB,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- incomingRGB, incomingAlpha);
- if (!TEXENV_OPERAND_INVERTED(texUnit->Combine.OperandRGB[0])) {
- /*
- * A is not inverted. So, choose it.
- */
- Amode_RGB = GR_FUNC_MODE_X_MINUS_HALF;
- if (!TEXENV_OPERAND_INVERTED
- (texUnit->Combine.OperandRGB[1])) {
- Bmode_RGB = GR_FUNC_MODE_X;
- }
- else {
- Bmode_RGB = GR_FUNC_MODE_ONE_MINUS_X;
- }
- }
- else {
- /*
- * A is inverted, so try to subtract 1/2
- * from B.
- */
- Amode_RGB = GR_FUNC_MODE_ONE_MINUS_X;
- if (!TEXENV_OPERAND_INVERTED
- (texUnit->Combine.OperandRGB[1])) {
- Bmode_RGB = GR_FUNC_MODE_X_MINUS_HALF;
- }
- else {
- /*
- * Both are inverted. This is the case
- * we cannot handle properly. We just
- * choose to not add the - 1/2.
- */
- Bmode_RGB = GR_FUNC_MODE_ONE_MINUS_X;
- return GL_FALSE;
- }
- }
- C_RGB = D_RGB = GR_CMBX_ZERO;
- Cinv_RGB = FXTRUE;
- Dinv_RGB = Ginv_RGB = FXFALSE;
- break;
- case GL_INTERPOLATE_EXT:
- /*
- * The formula is: Arg0 * Arg2 + Arg1 * (1 - Arg2).
- * We compute this by the formula:
- * (Arg0 - Arg1) * Arg2 + Arg1
- * == Arg0 * Arg2 - Arg1 * Arg2 + Arg1
- * == Arg0 * Arg2 + Arg1 * (1 - Arg2)
- * However, if both Arg1 is ONE_MINUS_X, the HW does
- * not support it properly.
- */
- TEXENV_SETUP_ARG_RGB(A_RGB,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- incomingRGB, incomingAlpha);
- TEXENV_SETUP_MODE_RGB(Amode_RGB,
- texUnit->Combine.OperandRGB[0]);
- TEXENV_SETUP_ARG_RGB(B_RGB,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- incomingRGB, incomingAlpha);
- if (TEXENV_OPERAND_INVERTED(texUnit->Combine.OperandRGB[1])) {
- /*
- * This case is wrong.
- */
- Bmode_RGB = GR_FUNC_MODE_NEGATIVE_X;
- return GL_FALSE;
- }
- else {
- Bmode_RGB = GR_FUNC_MODE_NEGATIVE_X;
- }
- /*
- * The Source/Operand for the C value must
- * specify some kind of alpha value.
- */
- TEXENV_SETUP_ARG_A(C_RGB,
- texUnit->Combine.SourceRGB[2],
- texUnit->Combine.OperandRGB[2],
- incomingAlpha);
- Cinv_RGB = FXFALSE;
- D_RGB = GR_CMBX_B;
- Dinv_RGB = Ginv_RGB = FXFALSE;
- break;
- default:
- /*
- * This is here mostly to keep from getting
- * a compiler warning about these not being set.
- * However, this should set all the texture values
- * to zero.
- */
- A_RGB = B_RGB = C_RGB = D_RGB = GR_CMBX_ZERO;
- Amode_RGB = Bmode_RGB = GR_FUNC_MODE_X;
- Cinv_RGB = Dinv_RGB = Ginv_RGB = FXFALSE;
- break;
- }
- /*
- * Calculate the alpha combination.
- */
- switch (texUnit->Combine.ModeA) {
- case GL_REPLACE:
- /*
- * The formula is: Arg0
- * We implement this by the formula:
- * (Arg0 + 0(0))*(1-0) + 0
- */
- TEXENV_SETUP_ARG_A(A_A,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- incomingAlpha);
- TEXENV_SETUP_MODE_A(Amode_A,
- texUnit->Combine.OperandA[0]);
- B_A = GR_CMBX_ITALPHA;
- Bmode_A = GR_FUNC_MODE_ZERO;
- C_A = D_A = GR_CMBX_ZERO;
- Cinv_A = FXTRUE;
- Dinv_A = Ginv_A = FXFALSE;
- break;
- case GL_MODULATE:
- /*
- * The formula is: Arg0 * Arg1
- *
- * We implement this by the formula
- * (Arg0 + 0(0)) * Arg1 + 0(0)
- */
- TEXENV_SETUP_ARG_A(A_A,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- incomingAlpha);
- TEXENV_SETUP_MODE_A(Amode_A,
- texUnit->Combine.OperandA[0]);
- B_A = GR_CMBX_ZERO;
- Bmode_A = GR_CMBX_ZERO;
- TEXENV_SETUP_ARG_A(C_A,
- texUnit->Combine.SourceA[1],
- texUnit->Combine.OperandA[1],
- incomingAlpha);
- Cinv_A = TEXENV_OPERAND_INVERTED
- (texUnit->Combine.OperandA[1]);
- D_A = GR_CMBX_ZERO;
- Dinv_A = Ginv_A = FXFALSE;
- break;
- case GL_ADD:
- /*
- * The formula is Arg0 + Arg1
- */
- TEXENV_SETUP_ARG_A(A_A,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- incomingAlpha);
- TEXENV_SETUP_MODE_A(Amode_A,
- texUnit->Combine.OperandA[0]);
- TEXENV_SETUP_ARG_A(B_A,
- texUnit->Combine.SourceA[1],
- texUnit->Combine.OperandA[1],
- incomingAlpha);
- TEXENV_SETUP_MODE_A(Bmode_A,
- texUnit->Combine.OperandA[1]);
- C_A = D_A = GR_CMBX_ZERO;
- Cinv_A = FXTRUE;
- Dinv_A = Ginv_A = FXFALSE;
- break;
- case GL_ADD_SIGNED_EXT:
- /*
- * The formula is: Arg0 + Arg1 - 0.5.
- * We compute this by calculating:
- * (Arg0 - 1/2) + Arg1 if op0 is SRC_{COLOR,ALPHA}
- * Arg0 + (Arg1 - 1/2) if op1 is SRC_{COLOR,ALPHA}
- * If both op0 and op1 are ONE_MINUS_SRC_{COLOR,ALPHA}
- * we cannot implement the formula properly.
- */
- TEXENV_SETUP_ARG_A(A_A,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- incomingAlpha);
- TEXENV_SETUP_ARG_A(B_A,
- texUnit->Combine.SourceA[1],
- texUnit->Combine.OperandA[1],
- incomingAlpha);
- if (!TEXENV_OPERAND_INVERTED(texUnit->Combine.OperandA[0])) {
- /*
- * A is not inverted. So, choose it.
- */
- Amode_A = GR_FUNC_MODE_X_MINUS_HALF;
- if (!TEXENV_OPERAND_INVERTED
- (texUnit->Combine.OperandA[1])) {
- Bmode_A = GR_FUNC_MODE_X;
- } else {
- Bmode_A = GR_FUNC_MODE_ONE_MINUS_X;
- }
- } else {
- /*
- * A is inverted, so try to subtract 1/2
- * from B.
- */
- Amode_A = GR_FUNC_MODE_ONE_MINUS_X;
- if (!TEXENV_OPERAND_INVERTED
- (texUnit->Combine.OperandA[1])) {
- Bmode_A = GR_FUNC_MODE_X_MINUS_HALF;
- } else {
- /*
- * Both are inverted. This is the case
- * we cannot handle properly. We just
- * choose to not add the - 1/2.
- */
- Bmode_A = GR_FUNC_MODE_ONE_MINUS_X;
- return GL_FALSE;
- }
- }
- C_A = D_A = GR_CMBX_ZERO;
- Cinv_A = FXTRUE;
- Dinv_A = Ginv_A = FXFALSE;
- break;
- case GL_INTERPOLATE_EXT:
- /*
- * The formula is: Arg0 * Arg2 + Arg1 * (1 - Arg2).
- * We compute this by the formula:
- * (Arg0 - Arg1) * Arg2 + Arg1
- * == Arg0 * Arg2 - Arg1 * Arg2 + Arg1
- * == Arg0 * Arg2 + Arg1 * (1 - Arg2)
- * However, if both Arg1 is ONE_MINUS_X, the HW does
- * not support it properly.
- */
- TEXENV_SETUP_ARG_A(A_A,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- incomingAlpha);
- TEXENV_SETUP_MODE_A(Amode_A,
- texUnit->Combine.OperandA[0]);
- TEXENV_SETUP_ARG_A(B_A,
- texUnit->Combine.SourceA[1],
- texUnit->Combine.OperandA[1],
- incomingAlpha);
- if (!TEXENV_OPERAND_INVERTED(texUnit->Combine.OperandA[1])) {
- Bmode_A = GR_FUNC_MODE_NEGATIVE_X;
- }
- else {
- /*
- * This case is wrong.
- */
- Bmode_A = GR_FUNC_MODE_NEGATIVE_X;
- return GL_FALSE;
- }
- /*
- * The Source/Operand for the C value must
- * specify some kind of alpha value.
- */
- TEXENV_SETUP_ARG_A(C_A,
- texUnit->Combine.SourceA[2],
- texUnit->Combine.OperandA[2],
- incomingAlpha);
- Cinv_A = FXFALSE;
- D_A = GR_CMBX_B;
- Dinv_A = Ginv_A = FXFALSE;
- break;
- default:
- /*
- * This is here mostly to keep from getting
- * a compiler warning about these not being set.
- * However, this should set all the alpha values
- * to one.
- */
- A_A = B_A = C_A = D_A = GR_CMBX_ZERO;
- Amode_A = Bmode_A = GR_FUNC_MODE_X;
- Cinv_A = Dinv_A = FXFALSE;
- Ginv_A = FXTRUE;
- break;
- }
- /*
- * Save the parameters.
- */
- env->Color.SourceA = A_RGB;
- env->Color.ModeA = Amode_RGB;
- env->Color.SourceB = B_RGB;
- env->Color.ModeB = Bmode_RGB;
- env->Color.SourceC = C_RGB;
- env->Color.InvertC = Cinv_RGB;
- env->Color.SourceD = D_RGB;
- env->Color.InvertD = Dinv_RGB;
- env->Color.Shift = Shift_RGB;
- env->Color.Invert = Ginv_RGB;
- env->Alpha.SourceA = A_A;
- env->Alpha.ModeA = Amode_A;
- env->Alpha.SourceB = B_A;
- env->Alpha.ModeB = Bmode_A;
- env->Alpha.SourceC = C_A;
- env->Alpha.InvertC = Cinv_A;
- env->Alpha.SourceD = D_A;
- env->Alpha.InvertD = Dinv_A;
- env->Alpha.Shift = Shift_A;
- env->Alpha.Invert = Ginv_A;
- env->EnvColor = PACK_RGBA32(texUnit->EnvColor[0] * 255.0F,
- texUnit->EnvColor[1] * 255.0F,
- texUnit->EnvColor[2] * 255.0F,
- texUnit->EnvColor[3] * 255.0F);
- }
- break;
-
- default:
- _mesa_problem(ctx, "%s: Bad envMode", __FUNCTION__);
- }
-
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_ENV;
-
- fxMesa->ColorCombineExt.SourceA = GR_CMBX_TEXTURE_RGB;
- fxMesa->ColorCombineExt.ModeA = GR_FUNC_MODE_X,
- fxMesa->ColorCombineExt.SourceB = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.ModeB = GR_FUNC_MODE_X;
- fxMesa->ColorCombineExt.SourceC = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.InvertC = FXTRUE;
- fxMesa->ColorCombineExt.SourceD = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.InvertD = FXFALSE;
- fxMesa->ColorCombineExt.Shift = 0;
- fxMesa->ColorCombineExt.Invert = FXFALSE;
- fxMesa->dirty |= TDFX_UPLOAD_COLOR_COMBINE;
- fxMesa->AlphaCombineExt.SourceA = GR_CMBX_TEXTURE_ALPHA;
- fxMesa->AlphaCombineExt.ModeA = GR_FUNC_MODE_X;
- fxMesa->AlphaCombineExt.SourceB = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.ModeB = GR_FUNC_MODE_X;
- fxMesa->AlphaCombineExt.SourceC = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.InvertC = FXTRUE;
- fxMesa->AlphaCombineExt.SourceD = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.InvertD = FXFALSE;
- fxMesa->AlphaCombineExt.Shift = 0;
- fxMesa->AlphaCombineExt.Invert = FXFALSE;
- fxMesa->dirty |= TDFX_UPLOAD_ALPHA_COMBINE;
- return GL_TRUE; /* success */
-}
-
-
-
-/*
- * Setup the Voodoo3 texture environment for a single texture unit.
- * Return GL_TRUE for success, GL_FALSE for failure.
- * If failure, we'll use software rendering.
- */
-static GLboolean
-SetupSingleTexEnvVoodoo3(GLcontext *ctx, int unit,
- GLenum envMode, GLenum baseFormat)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GrCombineLocal_t localc, locala;
- struct tdfx_combine alphaComb, colorComb;
-
- if (1 /*iteratedRGBA*/)
- localc = locala = GR_COMBINE_LOCAL_ITERATED;
- else
- localc = locala = GR_COMBINE_LOCAL_CONSTANT;
-
- switch (envMode) {
- case GL_DECAL:
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- alphaComb.Invert = FXFALSE;
- colorComb.Function = GR_COMBINE_FUNCTION_BLEND;
- colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- colorComb.Invert = FXFALSE;
- break;
- case GL_MODULATE:
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- alphaComb.Invert = FXFALSE;
- if (baseFormat == GL_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- colorComb.Invert = FXFALSE;
- }
- else {
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- colorComb.Invert = FXFALSE;
- }
- break;
-
- case GL_BLEND:
- /*
- * XXX we can't do real GL_BLEND mode. These settings assume that
- * the TexEnv color is black and incoming fragment color is white.
- */
- if (baseFormat == GL_LUMINANCE || baseFormat == GL_RGB) {
- /* Av = Af */
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- alphaComb.Invert = FXFALSE;
- }
- else if (baseFormat == GL_INTENSITY) {
- /* Av = Af * (1 - It) + Ac * It */
- alphaComb.Function = GR_COMBINE_FUNCTION_BLEND;
- alphaComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_CONSTANT;
- alphaComb.Invert = FXFALSE;
- }
- else {
- /* Av = Af * At */
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- alphaComb.Invert = FXFALSE;
- }
- if (baseFormat == GL_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- colorComb.Invert = FXFALSE;
- }
- else {
- colorComb.Function = GR_COMBINE_FUNCTION_BLEND;
- colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_RGB;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_CONSTANT;
- colorComb.Invert = FXTRUE;
- }
- fxMesa->Color.MonoColor = PACK_RGBA32(
- ctx->Texture.Unit[unit].EnvColor[0] * 255.0f,
- ctx->Texture.Unit[unit].EnvColor[1] * 255.0f,
- ctx->Texture.Unit[unit].EnvColor[2] * 255.0f,
- ctx->Texture.Unit[unit].EnvColor[3] * 255.0f);
- fxMesa->dirty |= TDFX_UPLOAD_CONSTANT_COLOR;
- break;
-
- case GL_REPLACE:
- if ((baseFormat == GL_RGB) || (baseFormat == GL_LUMINANCE)) {
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- alphaComb.Invert = FXFALSE;
- }
- else {
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- alphaComb.Invert = FXFALSE;
- }
- if (baseFormat == GL_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- colorComb.Invert = FXFALSE;
- }
- else {
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- colorComb.Invert = FXFALSE;
- }
- break;
-
- case GL_ADD:
- if (baseFormat == GL_ALPHA ||
- baseFormat == GL_LUMINANCE_ALPHA ||
- baseFormat == GL_RGBA) {
- /* product of texel and fragment alpha */
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- alphaComb.Invert = FXFALSE;
- }
- else if (baseFormat == GL_LUMINANCE || baseFormat == GL_RGB) {
- /* fragment alpha is unchanged */
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- alphaComb.Invert = FXFALSE;
- }
- else {
- ASSERT(baseFormat == GL_INTENSITY);
- /* sum of texel and fragment alpha */
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Local = locala;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- alphaComb.Invert = FXFALSE;
- }
- if (baseFormat == GL_ALPHA) {
- /* rgb unchanged */
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- colorComb.Invert = FXFALSE;
- }
- else {
- /* sum of texel and fragment rgb */
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Local = localc;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- colorComb.Invert = FXFALSE;
- }
- break;
-
- default:
- _mesa_problem(ctx, "bad texture env mode in %s", __FUNCTION__);
- }
-
- if (colorComb.Function != fxMesa->ColorCombine.Function ||
- colorComb.Factor != fxMesa->ColorCombine.Factor ||
- colorComb.Local != fxMesa->ColorCombine.Local ||
- colorComb.Other != fxMesa->ColorCombine.Other ||
- colorComb.Invert != fxMesa->ColorCombine.Invert) {
- fxMesa->ColorCombine = colorComb;
- fxMesa->dirty |= TDFX_UPLOAD_COLOR_COMBINE;
- }
-
- if (alphaComb.Function != fxMesa->AlphaCombine.Function ||
- alphaComb.Factor != fxMesa->AlphaCombine.Factor ||
- alphaComb.Local != fxMesa->AlphaCombine.Local ||
- alphaComb.Other != fxMesa->AlphaCombine.Other ||
- alphaComb.Invert != fxMesa->AlphaCombine.Invert) {
- fxMesa->AlphaCombine = alphaComb;
- fxMesa->dirty |= TDFX_UPLOAD_ALPHA_COMBINE;
- }
- return GL_TRUE;
-}
-
-
-/*
- * Setup the Voodoo3 texture environment for dual texture units.
- * Return GL_TRUE for success, GL_FALSE for failure.
- * If failure, we'll use software rendering.
- */
-static GLboolean
-SetupDoubleTexEnvVoodoo3(GLcontext *ctx, int tmu0,
- GLenum envMode0, GLenum baseFormat0,
- GLenum envMode1, GLenum baseFormat1)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- const GrCombineLocal_t locala = GR_COMBINE_LOCAL_ITERATED;
- const GrCombineLocal_t localc = GR_COMBINE_LOCAL_ITERATED;
- const int tmu1 = 1 - tmu0;
-
- if (envMode0 == GL_MODULATE && envMode1 == GL_MODULATE) {
- GLboolean isalpha[TDFX_NUM_TMU];
-
- isalpha[tmu0] = (baseFormat0 == GL_ALPHA);
- isalpha[tmu1] = (baseFormat1 == GL_ALPHA);
-
- if (isalpha[TDFX_TMU1]) {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXTRUE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- }
- else {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- }
- if (isalpha[TDFX_TMU0]) {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- else {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- else if (envMode0 == GL_REPLACE && envMode1 == GL_BLEND) { /* Quake */
- if (tmu0 == TDFX_TMU1) {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXTRUE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- else {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE_MINUS_LOCAL;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE_MINUS_LOCAL;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- else if (envMode0 == GL_REPLACE && envMode1 == GL_MODULATE) {
- /* Quake 2/3 */
- if (tmu1 == TDFX_TMU1) {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXTRUE;
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- else {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
-
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- if (baseFormat0 == GL_RGB) {
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- else {
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- }
- else if (envMode0 == GL_MODULATE && envMode1 == GL_ADD) {
- /* Quake 3 sky */
- GLboolean isalpha[TDFX_NUM_TMU];
-
- isalpha[tmu0] = (baseFormat0 == GL_ALPHA);
- isalpha[tmu1] = (baseFormat1 == GL_ALPHA);
-
- if (isalpha[TDFX_TMU1]) {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXTRUE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- }
- else {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- }
- if (isalpha[TDFX_TMU0]) {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- else {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_LOCAL;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- else if (envMode0 == GL_REPLACE && envMode1 == GL_ADD) {
- /* Vulpine sky */
- GLboolean isalpha[TDFX_NUM_TMU];
-
- isalpha[tmu0] = (baseFormat0 == GL_ALPHA);
- isalpha[tmu1] = (baseFormat1 == GL_ALPHA);
-
- if (isalpha[TDFX_TMU1]) {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXTRUE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- } else {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- }
-
- if (isalpha[TDFX_TMU0]) {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- } else {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- }
-
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- else if (envMode1 == GL_REPLACE) {
- /* Homeworld2 */
-
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
-
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
-
- if ((baseFormat0 == GL_RGB) && (baseFormat0 == GL_LUMINANCE)) {
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- } else {
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->AlphaCombine.Local = locala;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
- if (baseFormat0 == GL_ALPHA) {
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- } else {
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_ONE;
- fxMesa->ColorCombine.Local = localc;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_TEXTURE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- }
- }
- else {
- _mesa_problem(ctx, "%s: Unexpected dual texture mode encountered", __FUNCTION__);
- return GL_FALSE;
- }
-
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_ENV;
- fxMesa->dirty |= TDFX_UPLOAD_COLOR_COMBINE;
- fxMesa->dirty |= TDFX_UPLOAD_ALPHA_COMBINE;
- return GL_TRUE;
-}
-
-
-/*
- * This function makes sure that the correct mipmap levels are loaded
- * in the right places in memory and then makes the Glide calls to
- * setup the texture source pointers.
- */
-static void
-setupSingleTMU(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
-{
- struct tdfxSharedState *shared = (struct tdfxSharedState *) fxMesa->glCtx->Shared->DriverData;
- tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
- const GLcontext *ctx = fxMesa->glCtx;
-
- /* Make sure we're not loaded incorrectly */
- if (ti->isInTM && !shared->umaTexMemory) {
- /* if doing filtering between mipmap levels, alternate mipmap levels
- * must be in alternate TMUs.
- */
- if (ti->LODblend) {
- if (ti->whichTMU != TDFX_TMU_SPLIT)
- tdfxTMMoveOutTM_NoLock(fxMesa, tObj);
- }
- else {
- if (ti->whichTMU == TDFX_TMU_SPLIT)
- tdfxTMMoveOutTM_NoLock(fxMesa, tObj);
- }
- }
-
- /* Make sure we're loaded correctly */
- if (!ti->isInTM) {
- /* Have to download the texture */
- if (shared->umaTexMemory) {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj, TDFX_TMU0);
- }
- else {
- /* Voodoo3 (split texture memory) */
- if (ti->LODblend) {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj, TDFX_TMU_SPLIT);
- }
- else {
-#if 0
- /* XXX putting textures into the second memory bank when the
- * first bank is full is not working at this time.
- */
- if (fxMesa->haveTwoTMUs) {
- GLint memReq = fxMesa->Glide.grTexTextureMemRequired(
- GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
- if (shared->freeTexMem[TDFX_TMU0] > memReq) {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj, TDFX_TMU0);
- }
- else {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj, TDFX_TMU1);
- }
- }
- else
-#endif
- {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj, TDFX_TMU0);
- }
- }
- }
- }
-
- if (ti->LODblend && ti->whichTMU == TDFX_TMU_SPLIT) {
- /* mipmap levels split between texture banks */
- GLint u;
-
- if (ti->info.format == GR_TEXFMT_P_8 && !ctx->Texture.SharedPalette) {
- fxMesa->TexPalette.Type = ti->paltype;
- fxMesa->TexPalette.Data = &(ti->palette);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
-
- for (u = 0; u < 2; u++) {
- fxMesa->TexParams[u].sClamp = ti->sClamp;
- fxMesa->TexParams[u].tClamp = ti->tClamp;
- fxMesa->TexParams[u].minFilt = ti->minFilt;
- fxMesa->TexParams[u].magFilt = ti->magFilt;
- fxMesa->TexParams[u].mmMode = ti->mmMode;
- fxMesa->TexParams[u].LODblend = ti->LODblend;
- fxMesa->TexParams[u].LodBias = ctx->Texture.Unit[u].LodBias;
- }
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PARAMS;
-
- fxMesa->TexSource[0].StartAddress = ti->tm[TDFX_TMU0]->startAddr;
- fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_ODD;
- fxMesa->TexSource[0].Info = &(ti->info);
- fxMesa->TexSource[1].StartAddress = ti->tm[TDFX_TMU1]->startAddr;
- fxMesa->TexSource[1].EvenOdd = GR_MIPMAPLEVELMASK_EVEN;
- fxMesa->TexSource[1].Info = &(ti->info);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_SOURCE;
- }
- else {
- FxU32 tmu;
-
- if (ti->whichTMU == TDFX_TMU_BOTH)
- tmu = TDFX_TMU0;
- else
- tmu = ti->whichTMU;
-
- if (shared->umaTexMemory) {
- assert(ti->whichTMU == TDFX_TMU0);
- assert(tmu == TDFX_TMU0);
- }
-
- if (ti->info.format == GR_TEXFMT_P_8 && !ctx->Texture.SharedPalette) {
- fxMesa->TexPalette.Type = ti->paltype;
- fxMesa->TexPalette.Data = &(ti->palette);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
-
- /* KW: The alternative is to do the download to the other tmu. If
- * we get to this point, I think it means we are thrashing the
- * texture memory, so perhaps it's not a good idea.
- */
-
- if (fxMesa->TexParams[tmu].sClamp != ti->sClamp ||
- fxMesa->TexParams[tmu].tClamp != ti->tClamp ||
- fxMesa->TexParams[tmu].minFilt != ti->minFilt ||
- fxMesa->TexParams[tmu].magFilt != ti->magFilt ||
- fxMesa->TexParams[tmu].mmMode != ti->mmMode ||
- fxMesa->TexParams[tmu].LODblend != FXFALSE ||
- fxMesa->TexParams[tmu].LodBias != ctx->Texture.Unit[tmu].LodBias) {
- fxMesa->TexParams[tmu].sClamp = ti->sClamp;
- fxMesa->TexParams[tmu].tClamp = ti->tClamp;
- fxMesa->TexParams[tmu].minFilt = ti->minFilt;
- fxMesa->TexParams[tmu].magFilt = ti->magFilt;
- fxMesa->TexParams[tmu].mmMode = ti->mmMode;
- fxMesa->TexParams[tmu].LODblend = FXFALSE;
- fxMesa->TexParams[tmu].LodBias = ctx->Texture.Unit[tmu].LodBias;
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PARAMS;
- }
-
- /* Glide texture source info */
- fxMesa->TexSource[0].Info = NULL;
- fxMesa->TexSource[1].Info = NULL;
- if (ti->tm[tmu]) {
- fxMesa->TexSource[tmu].StartAddress = ti->tm[tmu]->startAddr;
- fxMesa->TexSource[tmu].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu].Info = &(ti->info);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_SOURCE;
- }
- }
-
- fxMesa->sScale0 = ti->sScale;
- fxMesa->tScale0 = ti->tScale;
-}
-
-static void
-selectSingleTMUSrc(tdfxContextPtr fxMesa, GLint tmu, FxBool LODblend)
-{
- if (LODblend) {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
-
- if (fxMesa->haveTwoTMUs) {
- const struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- const struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- int tmu;
-
- if (shared->umaTexMemory)
- tmu = GR_TMU0;
- else
- tmu = GR_TMU1;
-
- fxMesa->TexCombine[tmu].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[tmu].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[tmu].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[tmu].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[tmu].InvertRGB = FXFALSE;
- fxMesa->TexCombine[tmu].InvertAlpha = FXFALSE;
- }
- fxMesa->tmuSrc = TDFX_TMU_SPLIT;
- }
- else {
- if (tmu != TDFX_TMU1) {
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- if (fxMesa->haveTwoTMUs) {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_ZERO;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- }
- fxMesa->tmuSrc = TDFX_TMU0;
- }
- else {
- fxMesa->TexCombine[1].FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorRGB = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->TexCombine[1].FactorAlpha = GR_COMBINE_FACTOR_NONE;
- fxMesa->TexCombine[1].InvertRGB = FXFALSE;
- fxMesa->TexCombine[1].InvertAlpha = FXFALSE;
- /* GR_COMBINE_FUNCTION_SCALE_OTHER doesn't work ?!? */
- fxMesa->TexCombine[0].FunctionRGB = GR_COMBINE_FUNCTION_BLEND;
- fxMesa->TexCombine[0].FactorRGB = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].FunctionAlpha = GR_COMBINE_FUNCTION_BLEND;
- fxMesa->TexCombine[0].FactorAlpha = GR_COMBINE_FACTOR_ONE;
- fxMesa->TexCombine[0].InvertRGB = FXFALSE;
- fxMesa->TexCombine[0].InvertAlpha = FXFALSE;
- fxMesa->tmuSrc = TDFX_TMU1;
- }
- }
-
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_ENV;
-}
-
-#if 0
-static void print_state(tdfxContextPtr fxMesa)
-{
- GLcontext *ctx = fxMesa->glCtx;
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[0]._Current;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[1]._Current;
- GLenum base0 = tObj0->Image[0][tObj0->BaseLevel] ? tObj0->Image[0][tObj0->BaseLevel]->Format : 99;
- GLenum base1 = tObj1->Image[0][tObj1->BaseLevel] ? tObj1->Image[0][tObj1->BaseLevel]->Format : 99;
-
- printf("Unit 0: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[0]._ReallyEnabled,
- fxMesa->TexState.Enabled[0]);
- printf(" EnvMode: GL=0x%x Gr=0x%x\n", ctx->Texture.Unit[0].EnvMode,
- fxMesa->TexState.EnvMode[0]);
- printf(" BaseFmt: GL=0x%x Gr=0x%x\n", base0, fxMesa->TexState.TexFormat[0]);
-
-
- printf("Unit 1: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[1]._ReallyEnabled,
- fxMesa->TexState.Enabled[1]);
- printf(" EnvMode: GL=0x%x Gr:0x%x\n", ctx->Texture.Unit[1].EnvMode,
- fxMesa->TexState.EnvMode[1]);
- printf(" BaseFmt: GL=0x%x Gr:0x%x\n", base1, fxMesa->TexState.TexFormat[1]);
-}
-#endif
-
-/*
- * When we're only using a single texture unit, we always use the 0th
- * Glide/hardware unit, regardless if it's GL_TEXTURE0_ARB or GL_TEXTURE1_ARB
- * that's enalbed.
- * Input: ctx - the context
- * unit - the OpenGL texture unit to use.
- */
-static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxTexInfo *ti;
- struct gl_texture_object *tObj;
- int tmu;
- GLenum envMode, baseFormat;
-
- tObj = ctx->Texture.Unit[unit]._Current;
- if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_TRUE);
- return;
- }
-
- setupSingleTMU(fxMesa, tObj);
-
- ti = TDFX_TEXTURE_DATA(tObj);
- if (ti->whichTMU == TDFX_TMU_BOTH)
- tmu = TDFX_TMU0;
- else
- tmu = ti->whichTMU;
-
- if (fxMesa->tmuSrc != tmu) {
- selectSingleTMUSrc(fxMesa, tmu, ti->LODblend);
- }
-
- if (ti->reloadImages)
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_IMAGES;
-
- /* Check if we really need to update the texenv state */
- envMode = ctx->Texture.Unit[unit].EnvMode;
- baseFormat = tObj->Image[0][tObj->BaseLevel]->Format;
-
- if (TDFX_IS_NAPALM(fxMesa)) {
- /* see if we really need to update the unit */
- if (1/*fxMesa->TexState.Enabled[unit] != ctx->Texture.Unit[unit]._ReallyEnabled ||
- envMode != fxMesa->TexState.EnvMode[0] ||
- envMode == GL_COMBINE_EXT ||
- baseFormat != fxMesa->TexState.TexFormat[0]*/) {
- struct tdfx_texcombine_ext *otherEnv;
- if (!SetupTexEnvNapalm(ctx, GL_TRUE,
- &ctx->Texture.Unit[unit], baseFormat,
- &fxMesa->TexCombineExt[0])) {
- /* software fallback */
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
- }
- /* disable other unit */
- otherEnv = &fxMesa->TexCombineExt[1];
- otherEnv->Color.SourceA = GR_CMBX_ZERO;
- otherEnv->Color.ModeA = GR_FUNC_MODE_ZERO;
- otherEnv->Color.SourceB = GR_CMBX_ZERO;
- otherEnv->Color.ModeB = GR_FUNC_MODE_ZERO;
- otherEnv->Color.SourceC = GR_CMBX_ZERO;
- otherEnv->Color.InvertC = FXFALSE;
- otherEnv->Color.SourceD = GR_CMBX_ZERO;
- otherEnv->Color.InvertD = FXFALSE;
- otherEnv->Color.Shift = 0;
- otherEnv->Color.Invert = FXFALSE;
- otherEnv->Alpha.SourceA = GR_CMBX_ITALPHA;
- otherEnv->Alpha.ModeA = GR_FUNC_MODE_ZERO;
- otherEnv->Alpha.SourceB = GR_CMBX_ITALPHA;
- otherEnv->Alpha.ModeB = GR_FUNC_MODE_ZERO;
- otherEnv->Alpha.SourceC = GR_CMBX_ZERO;
- otherEnv->Alpha.InvertC = FXFALSE;
- otherEnv->Alpha.SourceD = GR_CMBX_ZERO;
- otherEnv->Alpha.InvertD = FXFALSE;
- otherEnv->Alpha.Shift = 0;
- otherEnv->Alpha.Invert = FXFALSE;
-
-#if 0/*JJJ*/
- fxMesa->TexState.Enabled[unit] = ctx->Texture.Unit[unit]._ReallyEnabled;
- fxMesa->TexState.EnvMode[0] = envMode;
- fxMesa->TexState.TexFormat[0] = baseFormat;
- fxMesa->TexState.EnvMode[1] = 0;
- fxMesa->TexState.TexFormat[1] = 0;
-#endif
- }
- }
- else {
- /* Voodoo3 */
-
- /* see if we really need to update the unit */
- if (1/*fxMesa->TexState.Enabled[unit] != ctx->Texture.Unit[unit]._ReallyEnabled ||
- envMode != fxMesa->TexState.EnvMode[0] ||
- envMode == GL_COMBINE_EXT ||
- baseFormat != fxMesa->TexState.TexFormat[0]*/) {
- if (!SetupSingleTexEnvVoodoo3(ctx, unit, envMode, baseFormat)) {
- /* software fallback */
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
- }
-#if 0/*JJJ*/
- fxMesa->TexState.Enabled[unit] = ctx->Texture.Unit[unit]._ReallyEnabled;
- fxMesa->TexState.EnvMode[0] = envMode;
- fxMesa->TexState.TexFormat[0] = baseFormat;
- fxMesa->TexState.EnvMode[1] = 0;
- fxMesa->TexState.TexFormat[1] = 0;
-#endif
- }
- }
-}
-
-
-static void
-setupDoubleTMU(tdfxContextPtr fxMesa,
- struct gl_texture_object *tObj0,
- struct gl_texture_object *tObj1)
-{
-#define T0_NOT_IN_TMU 0x01
-#define T1_NOT_IN_TMU 0x02
-#define T0_IN_TMU0 0x04
-#define T1_IN_TMU0 0x08
-#define T0_IN_TMU1 0x10
-#define T1_IN_TMU1 0x20
-
- const struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- const struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
- const GLcontext *ctx = fxMesa->glCtx;
- tdfxTexInfo *ti0 = TDFX_TEXTURE_DATA(tObj0);
- tdfxTexInfo *ti1 = TDFX_TEXTURE_DATA(tObj1);
- GLuint tstate = 0;
- int tmu0 = 0, tmu1 = 1;
-
- if (shared->umaTexMemory) {
- if (!ti0->isInTM) {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj0, TDFX_TMU0);
- assert(ti0->isInTM);
- }
- if (!ti1->isInTM) {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj1, TDFX_TMU0);
- assert(ti1->isInTM);
- }
- }
- else {
- /* We shouldn't need to do this. There is something wrong with
- multitexturing when the TMUs are swapped. So, we're forcing
- them to always be loaded correctly. !!! */
- if (ti0->whichTMU == TDFX_TMU1)
- tdfxTMMoveOutTM_NoLock(fxMesa, tObj0);
- if (ti1->whichTMU == TDFX_TMU0)
- tdfxTMMoveOutTM_NoLock(fxMesa, tObj1);
-
- if (ti0->isInTM) {
- switch (ti0->whichTMU) {
- case TDFX_TMU0:
- tstate |= T0_IN_TMU0;
- break;
- case TDFX_TMU1:
- tstate |= T0_IN_TMU1;
- break;
- case TDFX_TMU_BOTH:
- tstate |= T0_IN_TMU0 | T0_IN_TMU1;
- break;
- case TDFX_TMU_SPLIT:
- tstate |= T0_NOT_IN_TMU;
- break;
- }
- }
- else
- tstate |= T0_NOT_IN_TMU;
-
- if (ti1->isInTM) {
- switch (ti1->whichTMU) {
- case TDFX_TMU0:
- tstate |= T1_IN_TMU0;
- break;
- case TDFX_TMU1:
- tstate |= T1_IN_TMU1;
- break;
- case TDFX_TMU_BOTH:
- tstate |= T1_IN_TMU0 | T1_IN_TMU1;
- break;
- case TDFX_TMU_SPLIT:
- tstate |= T1_NOT_IN_TMU;
- break;
- }
- }
- else
- tstate |= T1_NOT_IN_TMU;
-
- /* Move texture maps into TMUs */
-
- if (!(((tstate & T0_IN_TMU0) && (tstate & T1_IN_TMU1)) ||
- ((tstate & T0_IN_TMU1) && (tstate & T1_IN_TMU0)))) {
- if (tObj0 == tObj1) {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj1, TDFX_TMU_BOTH);
- }
- else {
- /* Find the minimal way to correct the situation */
- if ((tstate & T0_IN_TMU0) || (tstate & T1_IN_TMU1)) {
- /* We have one in the standard order, setup the other */
- if (tstate & T0_IN_TMU0) {
- /* T0 is in TMU0, put T1 in TMU1 */
- tdfxTMMoveInTM_NoLock(fxMesa, tObj1, TDFX_TMU1);
- }
- else {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj0, TDFX_TMU0);
- }
- /* tmu0 and tmu1 are setup */
- }
- else if ((tstate & T0_IN_TMU1) || (tstate & T1_IN_TMU0)) {
- /* we have one in the reverse order, setup the other */
- if (tstate & T1_IN_TMU0) {
- /* T1 is in TMU0, put T0 in TMU1 */
- tdfxTMMoveInTM_NoLock(fxMesa, tObj0, TDFX_TMU1);
- }
- else {
- tdfxTMMoveInTM_NoLock(fxMesa, tObj1, TDFX_TMU0);
- }
- tmu0 = 1;
- tmu1 = 0;
- }
- else { /* Nothing is loaded */
- tdfxTMMoveInTM_NoLock(fxMesa, tObj0, TDFX_TMU0);
- tdfxTMMoveInTM_NoLock(fxMesa, tObj1, TDFX_TMU1);
- /* tmu0 and tmu1 are setup */
- }
- }
- }
- }
-
- ti0->lastTimeUsed = fxMesa->texBindNumber;
- ti1->lastTimeUsed = fxMesa->texBindNumber;
-
-
- if (!ctx->Texture.SharedPalette) {
- if (ti0->info.format == GR_TEXFMT_P_8) {
- fxMesa->TexPalette.Type = ti0->paltype;
- fxMesa->TexPalette.Data = &(ti0->palette);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
- else if (ti1->info.format == GR_TEXFMT_P_8) {
- fxMesa->TexPalette.Type = ti1->paltype;
- fxMesa->TexPalette.Data = &(ti1->palette);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
- else {
- fxMesa->TexPalette.Data = NULL;
- }
- }
-
- /*
- * Setup Unit 0
- */
- assert(ti0->isInTM);
- assert(ti0->tm[tmu0]);
- fxMesa->TexSource[tmu0].StartAddress = ti0->tm[tmu0]->startAddr;
- fxMesa->TexSource[tmu0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu0].Info = &(ti0->info);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_SOURCE;
-
- if (fxMesa->TexParams[tmu0].sClamp != ti0->sClamp ||
- fxMesa->TexParams[tmu0].tClamp != ti0->tClamp ||
- fxMesa->TexParams[tmu0].minFilt != ti0->minFilt ||
- fxMesa->TexParams[tmu0].magFilt != ti0->magFilt ||
- fxMesa->TexParams[tmu0].mmMode != ti0->mmMode ||
- fxMesa->TexParams[tmu0].LODblend != FXFALSE ||
- fxMesa->TexParams[tmu0].LodBias != ctx->Texture.Unit[tmu0].LodBias) {
- fxMesa->TexParams[tmu0].sClamp = ti0->sClamp;
- fxMesa->TexParams[tmu0].tClamp = ti0->tClamp;
- fxMesa->TexParams[tmu0].minFilt = ti0->minFilt;
- fxMesa->TexParams[tmu0].magFilt = ti0->magFilt;
- fxMesa->TexParams[tmu0].mmMode = ti0->mmMode;
- fxMesa->TexParams[tmu0].LODblend = FXFALSE;
- fxMesa->TexParams[tmu0].LodBias = ctx->Texture.Unit[tmu0].LodBias;
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PARAMS;
- }
-
- /*
- * Setup Unit 1
- */
- if (shared->umaTexMemory) {
- ASSERT(ti1->isInTM);
- ASSERT(ti1->tm[0]);
- fxMesa->TexSource[tmu1].StartAddress = ti1->tm[0]->startAddr;
- fxMesa->TexSource[tmu1].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu1].Info = &(ti1->info);
- }
- else {
- ASSERT(ti1->isInTM);
- ASSERT(ti1->tm[tmu1]);
- fxMesa->TexSource[tmu1].StartAddress = ti1->tm[tmu1]->startAddr;
- fxMesa->TexSource[tmu1].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu1].Info = &(ti1->info);
- }
-
- if (fxMesa->TexParams[tmu1].sClamp != ti1->sClamp ||
- fxMesa->TexParams[tmu1].tClamp != ti1->tClamp ||
- fxMesa->TexParams[tmu1].minFilt != ti1->minFilt ||
- fxMesa->TexParams[tmu1].magFilt != ti1->magFilt ||
- fxMesa->TexParams[tmu1].mmMode != ti1->mmMode ||
- fxMesa->TexParams[tmu1].LODblend != FXFALSE ||
- fxMesa->TexParams[tmu1].LodBias != ctx->Texture.Unit[tmu1].LodBias) {
- fxMesa->TexParams[tmu1].sClamp = ti1->sClamp;
- fxMesa->TexParams[tmu1].tClamp = ti1->tClamp;
- fxMesa->TexParams[tmu1].minFilt = ti1->minFilt;
- fxMesa->TexParams[tmu1].magFilt = ti1->magFilt;
- fxMesa->TexParams[tmu1].mmMode = ti1->mmMode;
- fxMesa->TexParams[tmu1].LODblend = FXFALSE;
- fxMesa->TexParams[tmu1].LodBias = ctx->Texture.Unit[tmu1].LodBias;
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PARAMS;
- }
-
- fxMesa->sScale0 = ti0->sScale;
- fxMesa->tScale0 = ti0->tScale;
- fxMesa->sScale1 = ti1->sScale;
- fxMesa->tScale1 = ti1->tScale;
-
-#undef T0_NOT_IN_TMU
-#undef T1_NOT_IN_TMU
-#undef T0_IN_TMU0
-#undef T1_IN_TMU0
-#undef T0_IN_TMU1
-#undef T1_IN_TMU1
-}
-
-static void setupTextureDoubleTMU(GLcontext * ctx)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current;
- tdfxTexInfo *ti0 = TDFX_TEXTURE_DATA(tObj0);
- tdfxTexInfo *ti1 = TDFX_TEXTURE_DATA(tObj1);
- struct gl_texture_image *baseImage0 = tObj0->Image[0][tObj0->BaseLevel];
- struct gl_texture_image *baseImage1 = tObj1->Image[0][tObj1->BaseLevel];
-#if 0/*JJJ*/
- const GLenum envMode0 = ctx->Texture.Unit[0].EnvMode;
- const GLenum envMode1 = ctx->Texture.Unit[1].EnvMode;
-#endif
-
- if (baseImage0->Border > 0 || baseImage1->Border > 0) {
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_TRUE);
- return;
- }
-
- setupDoubleTMU(fxMesa, tObj0, tObj1);
-
- if (ti0->reloadImages || ti1->reloadImages)
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_IMAGES;
-
- fxMesa->tmuSrc = TDFX_TMU_BOTH;
-
- if (TDFX_IS_NAPALM(fxMesa)) {
- /* Remember, Glide has its texture units numbered in backward
- * order compared to OpenGL.
- */
- GLboolean hw1 = GL_TRUE, hw2 = GL_TRUE;
-
- /* check if we really need to update glide unit 1 */
- if (1/*fxMesa->TexState.Enabled[0] != ctx->Texture.Unit[0]._ReallyEnabled ||
- envMode0 != fxMesa->TexState.EnvMode[1] ||
- envMode0 == GL_COMBINE_EXT ||
- baseImage0->Format != fxMesa->TexState.TexFormat[1] ||
- (fxMesa->Fallback & TDFX_FALLBACK_TEXTURE_ENV)*/) {
- hw1 = SetupTexEnvNapalm(ctx, GL_TRUE, &ctx->Texture.Unit[0],
- baseImage0->Format, &fxMesa->TexCombineExt[1]);
-#if 0/*JJJ*/
- fxMesa->TexState.EnvMode[1] = envMode0;
- fxMesa->TexState.TexFormat[1] = baseImage0->Format;
- fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled;
-#endif
- }
-
- /* check if we really need to update glide unit 0 */
- if (1/*fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled ||
- envMode1 != fxMesa->TexState.EnvMode[0] ||
- envMode1 == GL_COMBINE_EXT ||
- baseImage1->Format != fxMesa->TexState.TexFormat[0] ||
- (fxMesa->Fallback & TDFX_FALLBACK_TEXTURE_ENV)*/) {
- hw2 = SetupTexEnvNapalm(ctx, GL_FALSE, &ctx->Texture.Unit[1],
- baseImage1->Format, &fxMesa->TexCombineExt[0]);
-#if 0/*JJJ*/
- fxMesa->TexState.EnvMode[0] = envMode1;
- fxMesa->TexState.TexFormat[0] = baseImage1->Format;
- fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled;
-#endif
- }
-
-
- if (!hw1 || !hw2) {
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
- }
- }
- else {
- int unit0, unit1;
- if ((ti0->whichTMU == TDFX_TMU1) || (ti1->whichTMU == TDFX_TMU0))
- unit0 = 1;
- else
- unit0 = 0;
- unit1 = 1 - unit0;
-
- if (1/*fxMesa->TexState.Enabled[0] != ctx->Texture.Unit[0]._ReallyEnabled ||
- fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled ||
- envMode0 != fxMesa->TexState.EnvMode[unit0] ||
- envMode0 == GL_COMBINE_EXT ||
- envMode1 != fxMesa->TexState.EnvMode[unit1] ||
- envMode1 == GL_COMBINE_EXT ||
- baseImage0->Format != fxMesa->TexState.TexFormat[unit0] ||
- baseImage1->Format != fxMesa->TexState.TexFormat[unit1] ||
- (fxMesa->Fallback & TDFX_FALLBACK_TEXTURE_ENV)*/) {
-
- if (!SetupDoubleTexEnvVoodoo3(ctx, unit0,
- ctx->Texture.Unit[0].EnvMode, baseImage0->Format,
- ctx->Texture.Unit[1].EnvMode, baseImage1->Format)) {
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
- }
-
-#if 0/*JJJ*/
- fxMesa->TexState.EnvMode[unit0] = envMode0;
- fxMesa->TexState.TexFormat[unit0] = baseImage0->Format;
- fxMesa->TexState.EnvMode[unit1] = envMode1;
- fxMesa->TexState.TexFormat[unit1] = baseImage1->Format;
- fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled;
- fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled;
-#endif
- }
- }
-}
-
-
-void
-tdfxUpdateTextureState( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_FALSE);
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_FALSE);
-
- if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT) &&
- ctx->Texture.Unit[1]._ReallyEnabled == 0) {
- LOCK_HARDWARE( fxMesa ); /* XXX remove locking eventually */
- setupTextureSingleTMU(ctx, 0);
- UNLOCK_HARDWARE( fxMesa );
- }
- else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 &&
- ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- LOCK_HARDWARE( fxMesa );
- setupTextureSingleTMU(ctx, 1);
- UNLOCK_HARDWARE( fxMesa );
- }
- else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT) &&
- ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- LOCK_HARDWARE( fxMesa );
- setupTextureDoubleTMU(ctx);
- UNLOCK_HARDWARE( fxMesa );
- }
- else {
- /* disable hardware texturing */
- if (TDFX_IS_NAPALM(fxMesa)) {
- fxMesa->ColorCombineExt.SourceA = GR_CMBX_ITRGB;
- fxMesa->ColorCombineExt.ModeA = GR_FUNC_MODE_X;
- fxMesa->ColorCombineExt.SourceB = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.ModeB = GR_FUNC_MODE_ZERO;
- fxMesa->ColorCombineExt.SourceC = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.InvertC = FXTRUE;
- fxMesa->ColorCombineExt.SourceD = GR_CMBX_ZERO;
- fxMesa->ColorCombineExt.InvertD = FXFALSE;
- fxMesa->ColorCombineExt.Shift = 0;
- fxMesa->ColorCombineExt.Invert = FXFALSE;
- fxMesa->AlphaCombineExt.SourceA = GR_CMBX_ITALPHA;
- fxMesa->AlphaCombineExt.ModeA = GR_FUNC_MODE_X;
- fxMesa->AlphaCombineExt.SourceB = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.ModeB = GR_FUNC_MODE_ZERO;
- fxMesa->AlphaCombineExt.SourceC = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.InvertC = FXTRUE;
- fxMesa->AlphaCombineExt.SourceD = GR_CMBX_ZERO;
- fxMesa->AlphaCombineExt.InvertD = FXFALSE;
- fxMesa->AlphaCombineExt.Shift = 0;
- fxMesa->AlphaCombineExt.Invert = FXFALSE;
- }
- else {
- /* Voodoo 3*/
- fxMesa->ColorCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->ColorCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->ColorCombine.Local = GR_COMBINE_LOCAL_ITERATED;
- fxMesa->ColorCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->ColorCombine.Invert = FXFALSE;
- fxMesa->AlphaCombine.Function = GR_COMBINE_FUNCTION_LOCAL;
- fxMesa->AlphaCombine.Factor = GR_COMBINE_FACTOR_NONE;
- fxMesa->AlphaCombine.Local = GR_COMBINE_LOCAL_ITERATED;
- fxMesa->AlphaCombine.Other = GR_COMBINE_OTHER_NONE;
- fxMesa->AlphaCombine.Invert = FXFALSE;
- }
-
- fxMesa->TexState.Enabled[0] = 0;
- fxMesa->TexState.Enabled[1] = 0;
- fxMesa->TexState.EnvMode[0] = 0;
- fxMesa->TexState.EnvMode[1] = 0;
-
- fxMesa->dirty |= TDFX_UPLOAD_COLOR_COMBINE;
- fxMesa->dirty |= TDFX_UPLOAD_ALPHA_COMBINE;
-
- if (ctx->Texture.Unit[0]._ReallyEnabled != 0 ||
- ctx->Texture.Unit[1]._ReallyEnabled != 0) {
- /* software texture (cube map, rect tex, etc */
- FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
- }
- }
-}
-
-
-
-/*
- * This is a special case of texture state update.
- * It's used when we've simply bound a new texture to a texture
- * unit and the new texture has the exact same attributes as the
- * previously bound texture.
- * This is very common in Quake3.
- */
-void
-tdfxUpdateTextureBinding( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[0]._Current;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[1]._Current;
- tdfxTexInfo *ti0 = TDFX_TEXTURE_DATA(tObj0);
- tdfxTexInfo *ti1 = TDFX_TEXTURE_DATA(tObj1);
-
- const struct gl_shared_state *mesaShared = fxMesa->glCtx->Shared;
- const struct tdfxSharedState *shared = (struct tdfxSharedState *) mesaShared->DriverData;
-
- if (ti0) {
- fxMesa->sScale0 = ti0->sScale;
- fxMesa->tScale0 = ti0->tScale;
- if (ti0->info.format == GR_TEXFMT_P_8) {
- fxMesa->TexPalette.Type = ti0->paltype;
- fxMesa->TexPalette.Data = &(ti0->palette);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
- else if (ti1 && ti1->info.format == GR_TEXFMT_P_8) {
- fxMesa->TexPalette.Type = ti1->paltype;
- fxMesa->TexPalette.Data = &(ti1->palette);
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_PALETTE;
- }
- }
- if (ti1) {
- fxMesa->sScale1 = ti1->sScale;
- fxMesa->tScale1 = ti1->tScale;
- }
-
- if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT) &&
- ctx->Texture.Unit[0]._ReallyEnabled == 0) {
- /* Only unit 0 2D enabled */
- if (shared->umaTexMemory) {
- fxMesa->TexSource[0].StartAddress = ti0->tm[0]->startAddr;
- fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[0].Info = &(ti0->info);
- }
- else {
- if (ti0->LODblend && ti0->whichTMU == TDFX_TMU_SPLIT) {
- fxMesa->TexSource[0].StartAddress = ti0->tm[TDFX_TMU0]->startAddr;
- fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_ODD;
- fxMesa->TexSource[0].Info = &(ti0->info);
- fxMesa->TexSource[1].StartAddress = ti0->tm[TDFX_TMU1]->startAddr;
- fxMesa->TexSource[1].EvenOdd = GR_MIPMAPLEVELMASK_EVEN;
- fxMesa->TexSource[1].Info = &(ti0->info);
- }
- else {
- FxU32 tmu;
- if (ti0->whichTMU == TDFX_TMU_BOTH)
- tmu = TDFX_TMU0;
- else
- tmu = ti0->whichTMU;
- fxMesa->TexSource[0].Info = NULL;
- fxMesa->TexSource[1].Info = NULL;
- if (ti0->tm[tmu]) {
- fxMesa->TexSource[tmu].StartAddress = ti0->tm[tmu]->startAddr;
- fxMesa->TexSource[tmu].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu].Info = &(ti0->info);
- }
- }
- }
- }
- else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 &&
- ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- /* Only unit 1 2D enabled */
- if (shared->umaTexMemory) {
- fxMesa->TexSource[0].StartAddress = ti1->tm[0]->startAddr;
- fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[0].Info = &(ti1->info);
- }
- }
- else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT) &&
- ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- /* Both 2D enabled */
- if (shared->umaTexMemory) {
- const FxU32 tmu0 = 0, tmu1 = 1;
- fxMesa->TexSource[tmu0].StartAddress = ti0->tm[0]->startAddr;
- fxMesa->TexSource[tmu0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu0].Info = &(ti0->info);
-
- fxMesa->TexSource[tmu1].StartAddress = ti1->tm[0]->startAddr;
- fxMesa->TexSource[tmu1].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu1].Info = &(ti1->info);
- }
- else {
- const FxU32 tmu0 = 0, tmu1 = 1;
- fxMesa->TexSource[tmu0].StartAddress = ti0->tm[tmu0]->startAddr;
- fxMesa->TexSource[tmu0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu0].Info = &(ti0->info);
-
- fxMesa->TexSource[tmu1].StartAddress = ti1->tm[tmu1]->startAddr;
- fxMesa->TexSource[tmu1].EvenOdd = GR_MIPMAPLEVELMASK_BOTH;
- fxMesa->TexSource[tmu1].Info = &(ti1->info);
- }
- }
-
-
- fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_SOURCE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.h
deleted file mode 100644
index 234ed4439..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_texstate.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.h,v 1.1 2002/02/22 21:45:04 dawes Exp $ */
-
-/*
- * Original rewrite:
- * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Brian Paul <brianp@valinux.com>
- *
- */
-
-#ifndef __TDFX_TEXSTATE_H__
-#define __TDFX_TEXSTATE_H__
-
-extern void tdfxUpdateTextureState( GLcontext *ctx );
-extern void tdfxUpdateTextureBinding( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.c
deleted file mode 100644
index ac8daf474..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.c
+++ /dev/null
@@ -1,1293 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c,v 1.4 2002/10/30 12:52:01 alanh Exp $ */
-
-/* New fixes:
- * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "tdfx_tris.h"
-#include "tdfx_state.h"
-#include "tdfx_vb.h"
-#include "tdfx_lock.h"
-#include "tdfx_render.h"
-
-
-static void tdfxRasterPrimitive( GLcontext *ctx, GLenum prim );
-static void tdfxRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-static GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- fxMesa->draw_triangle( fxMesa, a, b, c ); \
- else \
- fxMesa->Glide.grDrawTriangle( a, b, c ); \
-} while (0) \
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- fxMesa->draw_triangle( fxMesa, a, b, d ); \
- fxMesa->draw_triangle( fxMesa, b, c, d ); \
- } else { \
- tdfxVertex *_v_[4]; \
- _v_[0] = d; \
- _v_[1] = a; \
- _v_[2] = b; \
- _v_[3] = c; \
- fxMesa->Glide.grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);\
- /*fxMesa->Glide.grDrawTriangle( a, b, d );*/\
- /*fxMesa->Glide.grDrawTriangle( b, c, d );*/\
- } \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- fxMesa->draw_line( fxMesa, v0, v1 ); \
- else { \
- v0->x += LINE_X_OFFSET - TRI_X_OFFSET; \
- v0->y += LINE_Y_OFFSET - TRI_Y_OFFSET; \
- v1->x += LINE_X_OFFSET - TRI_X_OFFSET; \
- v1->y += LINE_Y_OFFSET - TRI_Y_OFFSET; \
- fxMesa->Glide.grDrawLine( v0, v1 ); \
- v0->x -= LINE_X_OFFSET - TRI_X_OFFSET; \
- v0->y -= LINE_Y_OFFSET - TRI_Y_OFFSET; \
- v1->x -= LINE_X_OFFSET - TRI_X_OFFSET; \
- v1->y -= LINE_Y_OFFSET - TRI_Y_OFFSET; \
- } \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- fxMesa->draw_point( fxMesa, v0 ); \
- else { \
- v0->x += PNT_X_OFFSET - TRI_X_OFFSET; \
- v0->y += PNT_Y_OFFSET - TRI_Y_OFFSET; \
- fxMesa->Glide.grDrawPoint( v0 ); \
- v0->x -= PNT_X_OFFSET - TRI_X_OFFSET; \
- v0->y -= PNT_Y_OFFSET - TRI_Y_OFFSET; \
- } \
-} while (0)
-
-
-/***********************************************************************
- * Fallback to swrast for basic primitives *
- ***********************************************************************/
-
-/* Build an SWvertex from a hardware vertex.
- *
- * This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-tdfx_translate_vertex( GLcontext *ctx, const tdfxVertex *src, SWvertex *dst)
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if (fxMesa->vertexFormat == TDFX_LAYOUT_TINY) {
- dst->win[0] = src->x - fxMesa->x_offset;
- dst->win[1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset);
- dst->win[2] = src->z;
- dst->win[3] = 1.0;
-
- dst->color[0] = src->color[2];
- dst->color[1] = src->color[1];
- dst->color[2] = src->color[0];
- dst->color[3] = src->color[3];
- }
- else {
- GLfloat w = 1.0 / src->rhw;
-
- dst->win[0] = src->x - fxMesa->x_offset;
- dst->win[1] = src->y - (fxMesa->screen_height - fxMesa->height - fxMesa->y_offset);
- dst->win[2] = src->z;
- dst->win[3] = src->rhw;
-
- dst->color[0] = src->color[2];
- dst->color[1] = src->color[1];
- dst->color[2] = src->color[0];
- dst->color[3] = src->color[3];
-
- dst->texcoord[0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
- dst->texcoord[0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
- if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ1 || fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
- dst->texcoord[0][3] = w * src->tq0;
- } else {
- dst->texcoord[0][3] = 1.0;
- }
-
- if (fxMesa->SetupIndex & TDFX_TEX1_BIT) {
- dst->texcoord[1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
- dst->texcoord[1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
- if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
- dst->texcoord[1][3] = w * src->tq1;
- } else {
- dst->texcoord[1][3] = 1.0;
- }
- }
- }
-
- dst->pointSize = ctx->Point._Size;
-}
-
-
-static void
-tdfx_fallback_tri( tdfxContextPtr fxMesa,
- tdfxVertex *v0,
- tdfxVertex *v1,
- tdfxVertex *v2 )
-{
- GLcontext *ctx = fxMesa->glCtx;
- SWvertex v[3];
- tdfx_translate_vertex( ctx, v0, &v[0] );
- tdfx_translate_vertex( ctx, v1, &v[1] );
- tdfx_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-tdfx_fallback_line( tdfxContextPtr fxMesa,
- tdfxVertex *v0,
- tdfxVertex *v1 )
-{
- GLcontext *ctx = fxMesa->glCtx;
- SWvertex v[2];
- tdfx_translate_vertex( ctx, v0, &v[0] );
- tdfx_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-tdfx_fallback_point( tdfxContextPtr fxMesa,
- tdfxVertex *v0 )
-{
- GLcontext *ctx = fxMesa->glCtx;
- SWvertex v[1];
- tdfx_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-/***********************************************************************
- * Functions to draw basic primitives *
- ***********************************************************************/
-
-static void tdfx_print_vertex( GLcontext *ctx, const tdfxVertex *v )
-{
- tdfxContextPtr tmesa = TDFX_CONTEXT( ctx );
-
- fprintf(stderr, "vertex at %p\n", (void *)v);
-
- if (tmesa->vertexFormat == TDFX_LAYOUT_TINY) {
- fprintf(stderr, "x %f y %f z %f\n", v->x, v->y, v->z);
- }
- else {
- fprintf(stderr, "x %f y %f z %f oow %f\n",
- v->x, v->y, v->z, v->rhw);
- }
- fprintf(stderr, "r %d g %d b %d a %d\n",
- v->color[0],
- v->color[1],
- v->color[2],
- v->color[3]);
-
- fprintf(stderr, "\n");
-}
-
-#define DO_FALLBACK 0
-
-/* Need to do clip loop at each triangle when mixing swrast and hw
- * rendering. These functions are only used when mixed-mode rendering
- * is occurring.
- */
-static void tdfx_draw_triangle( tdfxContextPtr fxMesa,
- tdfxVertexPtr v0,
- tdfxVertexPtr v1,
- tdfxVertexPtr v2 )
-{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-/* tdfx_print_vertex( fxMesa->glCtx, v0 ); */
-/* tdfx_print_vertex( fxMesa->glCtx, v1 ); */
-/* tdfx_print_vertex( fxMesa->glCtx, v2 ); */
- BEGIN_CLIP_LOOP_LOCKED(fxMesa) {
- TRI( v0, v1, v2 );
- } END_CLIP_LOOP_LOCKED(fxMesa);
-}
-
-static void tdfx_draw_line( tdfxContextPtr fxMesa,
- tdfxVertexPtr v0,
- tdfxVertexPtr v1 )
-{
- /* No support for wide lines (avoid wide/aa line fallback).
- */
- BEGIN_CLIP_LOOP_LOCKED(fxMesa) {
- LINE(v0, v1);
- } END_CLIP_LOOP_LOCKED(fxMesa);
-}
-
-static void tdfx_draw_point( tdfxContextPtr fxMesa,
- tdfxVertexPtr v0 )
-{
- /* No support for wide points.
- */
- BEGIN_CLIP_LOOP_LOCKED(fxMesa) {
- POINT( v0 );
- } END_CLIP_LOOP_LOCKED(fxMesa);
-}
-
-#undef DO_FALLBACK
-
-
-#define TDFX_UNFILLED_BIT 0x1
-#define TDFX_OFFSET_BIT 0x2
-#define TDFX_TWOSIDE_BIT 0x4
-#define TDFX_FLAT_BIT 0x8
-#define TDFX_FALLBACK_BIT 0x10
-#define TDFX_MAX_TRIFUNC 0x20
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[TDFX_MAX_TRIFUNC];
-
-#define DO_FALLBACK (IND & TDFX_FALLBACK_BIT)
-#define DO_OFFSET (IND & TDFX_OFFSET_BIT)
-#define DO_UNFILLED (IND & TDFX_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & TDFX_TWOSIDE_BIT)
-#define DO_FLAT (IND & TDFX_FLAT_BIT)
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 0
-#define HAVE_HW_FLATSHADE 0
-#define HAVE_BACK_COLORS 0
-#define VERTEX tdfxVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->x
-#define VERT_Y(_v) _v->y
-#define VERT_Z(_v) _v->z
-#define AREA_IS_CCW( a ) (a < 0)
-#define GET_VERTEX(e) (fxMesa->verts + (e))
-
-#define VERT_SET_RGBA( dst, f ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst->color[2], f[0]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->color[1], f[1]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->color[0], f[2]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->color[3], f[3]);\
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) \
- *(GLuint *)&v0->color = *(GLuint *)&v1->color
-
-#define VERT_SAVE_RGBA( idx ) \
- *(GLuint *)&color[idx] = *(GLuint *)&v[idx]->color
-
-#define VERT_RESTORE_RGBA( idx ) \
- *(GLuint *)&v[idx]->color = *(GLuint *)&color[idx]
-
-#define LOCAL_VARS(n) \
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); \
- GLubyte color[n][4]; \
- (void) color;
-
-
-
-/***********************************************************************
- * Functions to draw basic unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (fxMesa->raster_primitive != reduced_prim[x]) \
- tdfxRasterPrimitive( ctx, reduced_prim[x] )
-#define RENDER_PRIMITIVE fxMesa->render_primitive
-#define IND TDFX_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Functions to draw GL primitives *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_UNFILLED_BIT|TDFX_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT|TDFX_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_UNFILLED_BIT|TDFX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT| \
- TDFX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-/* Tdfx doesn't support provoking-vertex flat-shading?
- */
-#define IND (TDFX_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_offset_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_UNFILLED_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_offset_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_UNFILLED_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_offset_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_UNFILLED_BIT|TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT|TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_offset_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_UNFILLED_BIT|TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TDFX_TWOSIDE_BIT|TDFX_OFFSET_BIT|TDFX_UNFILLED_BIT| \
- TDFX_FALLBACK_BIT|TDFX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-
- init_flat();
- init_offset_flat();
- init_twoside_flat();
- init_twoside_offset_flat();
- init_unfilled_flat();
- init_offset_unfilled_flat();
- init_twoside_unfilled_flat();
- init_twoside_offset_unfilled_flat();
- init_fallback_flat();
- init_offset_fallback_flat();
- init_twoside_fallback_flat();
- init_twoside_offset_fallback_flat();
- init_unfilled_fallback_flat();
- init_offset_unfilled_fallback_flat();
- init_twoside_unfilled_fallback_flat();
- init_twoside_offset_unfilled_fallback_flat();
-}
-
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-
-/* Accelerate vertex buffer rendering when renderindex == 0 and
- * there is no clipping.
- */
-#define INIT(x) tdfxRenderPrimitive( ctx, x )
-
-static void tdfx_render_vb_points( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- GLint i;
- (void) flags;
-
- INIT(GL_POINTS);
-
- /* Adjust point coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += PNT_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += PNT_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_POINTS, count-start,
- fxVB + start, sizeof(tdfxVertex));
- /* restore point coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= PNT_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= PNT_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void tdfx_render_vb_line_strip( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- GLint i;
- (void) flags;
-
- INIT(GL_LINE_STRIP);
-
- /* adjust line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_LINE_STRIP, count-start,
- fxVB + start, sizeof(tdfxVertex) );
-
- /* restore line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void tdfx_render_vb_line_loop( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- GLint i;
- GLint j = start;
- (void) flags;
-
- INIT(GL_LINE_LOOP);
-
- if (!(flags & PRIM_BEGIN)) {
- j++;
- }
-
- /* adjust line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_LINE_STRIP, count-j,
- fxVB + j, sizeof(tdfxVertex));
-
- if (flags & PRIM_END)
- fxMesa->Glide.grDrawLine( fxVB + (count - 1),
- fxVB + start );
-
- /* restore line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void tdfx_render_vb_lines( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- GLint i;
- (void) flags;
-
- INIT(GL_LINES);
-
- /* adjust line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_LINES, count-start,
- fxVB + start, sizeof(tdfxVertex));
-
- /* restore line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void tdfx_render_vb_triangles( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- INIT(GL_TRIANGLES);
-
-#if 0
- /* [dBorca]
- * apparently, this causes troubles with some programs (GLExcess);
- * might be a bug in Glide... However, "grDrawVertexArrayContiguous"
- * eventually calls "grDrawTriangle" for GR_TRIANGLES, so we're better
- * off doing it by hand...
- */
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_TRIANGLES, count-start,
- fxVB + start, sizeof(tdfxVertex));
-#else
- {
- GLuint j;
- for (j=start+2; j<count; j+=3) {
- fxMesa->Glide.grDrawTriangle(fxVB + (j-2), fxVB + (j-1), fxVB + j);
- }
- }
-#endif
-}
-
-
-static void tdfx_render_vb_tri_strip( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- int mode;
- (void) flags;
-
- INIT(GL_TRIANGLE_STRIP);
-
-/* fprintf(stderr, "%s/%d\n", __FUNCTION__, 1<<shift); */
-/* if(!prevLockLine) abort(); */
-
- mode = GR_TRIANGLE_STRIP;
-
- fxMesa->Glide.grDrawVertexArrayContiguous( mode, count-start,
- fxVB + start, sizeof(tdfxVertex));
-}
-
-
-static void tdfx_render_vb_tri_fan( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- INIT(GL_TRIANGLE_FAN);
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_TRIANGLE_FAN, count-start,
- fxVB + start, sizeof(tdfxVertex) );
-}
-
-static void tdfx_render_vb_quads( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- GLuint i;
- (void) flags;
-
- INIT(GL_QUADS);
-
- for (i = start + 3 ; i < count ; i += 4 ) {
-#define VERT(x) (fxVB + (x))
- tdfxVertex *_v_[4];
- _v_[0] = VERT(i);
- _v_[1] = VERT(i-3);
- _v_[2] = VERT(i-2);
- _v_[3] = VERT(i-1);
- fxMesa->Glide.grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);
- /*fxMesa->Glide.grDrawTriangle( VERT(i-3), VERT(i-2), VERT(i) );*/
- /*fxMesa->Glide.grDrawTriangle( VERT(i-2), VERT(i-1), VERT(i) );*/
-#undef VERT
- }
-}
-
-static void tdfx_render_vb_quad_strip( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- INIT(GL_QUAD_STRIP);
-
- count -= (count-start)&1;
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_TRIANGLE_STRIP,
- count-start, fxVB + start, sizeof(tdfxVertex));
-}
-
-static void tdfx_render_vb_poly( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- tdfxVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- INIT(GL_POLYGON);
-
- fxMesa->Glide.grDrawVertexArrayContiguous( GR_POLYGON, count-start,
- fxVB + start, sizeof(tdfxVertex));
-}
-
-static void tdfx_render_vb_noop( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- (void) (ctx && start && count && flags);
-}
-
-static void (*tdfx_render_tab_verts[GL_POLYGON+2])(GLcontext *,
- GLuint,
- GLuint,
- GLuint) =
-{
- tdfx_render_vb_points,
- tdfx_render_vb_lines,
- tdfx_render_vb_line_loop,
- tdfx_render_vb_line_strip,
- tdfx_render_vb_triangles,
- tdfx_render_vb_tri_strip,
- tdfx_render_vb_tri_fan,
- tdfx_render_vb_quads,
- tdfx_render_vb_quad_strip,
- tdfx_render_vb_poly,
- tdfx_render_vb_noop,
-};
-#undef INIT
-
-
-/**********************************************************************/
-/* Render whole (indexed) begin/end objects */
-/**********************************************************************/
-
-
-#define VERT(x) (tdfxVertex *)(vertptr + (x))
-
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- fxMesa->Glide.grDrawPoint( VERT(ELT(start)) );
-
-#define RENDER_LINE( v0, v1 ) \
- fxMesa->Glide.grDrawLine( VERT(v0), VERT(v1) )
-
-#define RENDER_TRI( v0, v1, v2 ) \
- fxMesa->Glide.grDrawTriangle( VERT(v0), VERT(v1), VERT(v2) )
-
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- do { \
- tdfxVertex *_v_[4]; \
- _v_[0] = VERT(v3); \
- _v_[1] = VERT(v0); \
- _v_[2] = VERT(v1); \
- _v_[3] = VERT(v2); \
- fxMesa->Glide.grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);\
- /*fxMesa->Glide.grDrawTriangle( VERT(v0), VERT(v1), VERT(v3) );*/\
- /*fxMesa->Glide.grDrawTriangle( VERT(v1), VERT(v2), VERT(v3) );*/\
- } while (0)
-
-#define INIT(x) tdfxRenderPrimitive( ctx, x )
-
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); \
- tdfxVertex *vertptr = fxMesa->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-
-/* Elts, no clipping.
- */
-#undef ELT
-#undef TAG
-#define TAG(x) tdfx_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl_dd/t_dd_rendertmp.h"
-
-/* Verts, no clipping.
- */
-#undef ELT
-#undef TAG
-#define TAG(x) tdfx_##x##_verts
-#define ELT(x) x
-/*#include "tnl_dd/t_dd_rendertmp.h"*/
-
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void tdfxRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint prim = fxMesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void tdfxRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-static void tdfxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- int i;
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- tdfxVertex *vertptr = fxMesa->verts;
- if (n == 3) {
- fxMesa->Glide.grDrawTriangle( VERT(elts[0]), VERT(elts[1]), VERT(elts[2]) );
- } else if (n <= 32) {
- tdfxVertex *newvptr[32];
- for (i = 0 ; i < n ; i++) {
- newvptr[i] = VERT(elts[i]);
- }
- fxMesa->Glide.grDrawVertexArray(GR_TRIANGLE_FAN, n, newvptr);
- } else {
- const tdfxVertex *start = VERT(elts[0]);
- for (i = 2 ; i < n ; i++) {
- fxMesa->Glide.grDrawTriangle( start, VERT(elts[i-1]), VERT(elts[i]) );
- }
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE)
-#define TRI_FALLBACK (DD_TRI_SMOOTH)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK|DD_TRI_STIPPLE)
-#define ANY_RASTER_FLAGS (DD_FLATSHADE|DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET| \
- DD_TRI_UNFILLED)
-
-
-/* All state referenced below:
- */
-#define _TDFX_NEW_RENDERSTATE (_DD_NEW_POINT_SMOOTH | \
- _DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_FLATSHADE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_POLYGONSTIPPLE)
-
-
-static void tdfxChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (0) {
- fxMesa->draw_point = tdfx_draw_point;
- fxMesa->draw_line = tdfx_draw_line;
- fxMesa->draw_triangle = tdfx_draw_triangle;
- index |= TDFX_FALLBACK_BIT;
- }
-
- if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) {
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= TDFX_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= TDFX_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= TDFX_UNFILLED_BIT;
- if (flags & DD_FLATSHADE) index |= TDFX_FLAT_BIT;
- }
-
- fxMesa->draw_point = tdfx_draw_point;
- fxMesa->draw_line = tdfx_draw_line;
- fxMesa->draw_triangle = tdfx_draw_triangle;
-
- /* Hook in fallbacks for specific primitives.
- *
- * DD_TRI_UNFILLED is here because the unfilled_tri functions use
- * fxMesa->draw_tri *always*, and thus can't use the multipass
- * approach to cliprects.
- *
- */
- if (flags & (POINT_FALLBACK|
- LINE_FALLBACK|
- TRI_FALLBACK|
- DD_TRI_STIPPLE|
- DD_TRI_UNFILLED))
- {
- if (flags & POINT_FALLBACK)
- fxMesa->draw_point = tdfx_fallback_point;
-
- if (flags & LINE_FALLBACK)
- fxMesa->draw_line = tdfx_fallback_line;
-
- if (flags & TRI_FALLBACK)
- fxMesa->draw_triangle = tdfx_fallback_tri;
-
- if ((flags & DD_TRI_STIPPLE) && !fxMesa->haveHwStipple)
- fxMesa->draw_triangle = tdfx_fallback_tri;
-
- index |= TDFX_FALLBACK_BIT;
- }
- }
-
- if (fxMesa->RenderIndex != index) {
- fxMesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = tdfx_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = tdfx_render_tab_elts;
- tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */
- tnl->Driver.Render.ClippedPolygon = tdfxFastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = tdfxRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = tdfxRenderClippedPoly;
- }
- }
-}
-
-/**********************************************************************/
-/* Use multipass rendering for cliprects */
-/**********************************************************************/
-
-
-
-/* TODO: Benchmark this.
- * TODO: Use single back-buffer cliprect where possible.
- * NOTE: <pass> starts at 1, not zero!
- */
-static GLboolean multipass_cliprect( GLcontext *ctx, GLuint pass )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- if (pass >= fxMesa->numClipRects)
- return GL_FALSE;
- else {
- fxMesa->Glide.grClipWindow(fxMesa->pClipRects[pass].x1,
- fxMesa->screen_height - fxMesa->pClipRects[pass].y2,
- fxMesa->pClipRects[pass].x2,
- fxMesa->screen_height - fxMesa->pClipRects[pass].y1);
-
- return GL_TRUE;
- }
-}
-
-
-/**********************************************************************/
-/* Runtime render state and callbacks */
-/**********************************************************************/
-
-static void tdfxRunPipeline( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if (fxMesa->new_state) {
- tdfxDDUpdateHwState( ctx );
- }
-
- if (!fxMesa->Fallback && fxMesa->new_gl_state) {
- if (fxMesa->new_gl_state & _TDFX_NEW_RASTERSETUP)
- tdfxChooseVertexState( ctx );
-
- if (fxMesa->new_gl_state & _TDFX_NEW_RENDERSTATE)
- tdfxChooseRenderState( ctx );
-
- fxMesa->new_gl_state = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-
-static void tdfxRenderStart( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- tdfxCheckTexSizes( ctx );
-
- LOCK_HARDWARE(fxMesa);
-
- /* Make sure vertex format changes get uploaded before we start
- * sending triangles.
- */
- if (fxMesa->dirty) {
- tdfxEmitHwStateLocked( fxMesa );
- }
-
- if (fxMesa->numClipRects && !(fxMesa->RenderIndex & TDFX_FALLBACK_BIT)) {
- fxMesa->Glide.grClipWindow(fxMesa->pClipRects[0].x1,
- fxMesa->screen_height - fxMesa->pClipRects[0].y2,
- fxMesa->pClipRects[0].x2,
- fxMesa->screen_height - fxMesa->pClipRects[0].y1);
- if (fxMesa->numClipRects > 1)
- tnl->Driver.Render.Multipass = multipass_cliprect;
- else
- tnl->Driver.Render.Multipass = NULL;
- }
- else
- tnl->Driver.Render.Multipass = NULL;
-}
-
-
-
-/* Always called between RenderStart and RenderFinish --> We already
- * hold the lock.
- */
-static void tdfxRasterPrimitive( GLcontext *ctx, GLenum prim )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
-
- fxMesa->raster_primitive = prim;
-
- tdfxUpdateCull(ctx);
- if ( fxMesa->dirty & TDFX_UPLOAD_CULL ) {
- fxMesa->Glide.grCullMode( fxMesa->CullMode );
- fxMesa->dirty &= ~TDFX_UPLOAD_CULL;
- }
-
- tdfxUpdateStipple(ctx);
- if ( fxMesa->dirty & TDFX_UPLOAD_STIPPLE ) {
- fxMesa->Glide.grStipplePattern ( fxMesa->Stipple.Pattern );
- fxMesa->Glide.grStippleMode ( fxMesa->Stipple.Mode );
- fxMesa->dirty &= ~TDFX_UPLOAD_STIPPLE;
- }
-}
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in tdfx_render.c.
- */
-static void tdfxRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- fxMesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (fxMesa->raster_primitive != rprim) {
- tdfxRasterPrimitive( ctx, rprim );
- }
-}
-
-static void tdfxRenderFinish( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
-
- if (fxMesa->RenderIndex & TDFX_FALLBACK_BIT)
- _swrast_flush( ctx );
-
- UNLOCK_HARDWARE(fxMesa);
-}
-
-
-/**********************************************************************/
-/* Manage total rasterization fallbacks */
-/**********************************************************************/
-
-static char *fallbackStrings[] = {
- "3D/Rect/Cube Texture map",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "Separate specular color",
- "glEnable/Disable(GL_STENCIL_TEST)",
- "glRenderMode(selection or feedback)",
- "glLogicOp()",
- "Texture env mode",
- "Texture border",
- "glColorMask",
- "blend mode",
- "line stipple",
- "Rasterization disable"
-};
-
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-void tdfxFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLuint oldfallback = fxMesa->Fallback;
-
- if (mode) {
- fxMesa->Fallback |= bit;
- if (oldfallback == 0) {
- /*printf("Go to software rendering, bit = 0x%x\n", bit);*/
- FLUSH_BATCH(fxMesa);
- _swsetup_Wakeup( ctx );
- fxMesa->RenderIndex = ~0;
- if (TDFX_DEBUG & DEBUG_VERBOSE_FALL) {
- fprintf(stderr, "Tdfx begin software fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
- else {
- fxMesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- /*printf("Go to hardware rendering, bit = 0x%x\n", bit);*/
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = tdfxRenderStart;
- tnl->Driver.Render.PrimitiveNotify = tdfxRenderPrimitive;
- tnl->Driver.Render.Finish = tdfxRenderFinish;
- tnl->Driver.Render.BuildVertices = tdfxBuildVertices;
- fxMesa->new_gl_state |= (_TDFX_NEW_RENDERSTATE|
- _TDFX_NEW_RASTERSETUP);
- if (TDFX_DEBUG & DEBUG_VERBOSE_FALL) {
- fprintf(stderr, "Tdfx end software fallback: 0x%x %s\n",
- bit, getFallbackString(bit));
- }
- }
- }
-}
-
-
-void tdfxDDInitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- fxMesa->RenderIndex = ~0;
-
- tnl->Driver.RunPipeline = tdfxRunPipeline;
- tnl->Driver.Render.Start = tdfxRenderStart;
- tnl->Driver.Render.Finish = tdfxRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = tdfxRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = tdfxBuildVertices;
- tnl->Driver.Render.Multipass = NULL;
-
- (void) tdfx_print_vertex;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.h
deleted file mode 100644
index 57e5d9b0a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_tris.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- mode: c; c-basic-offset: 3 -*-
- *
- * Copyright 2000 VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.h,v 1.5 2002/10/30 12:52:01 alanh Exp $ */
-
-#ifndef TDFX_TRIS_INC
-#define TDFX_TRIS_INC
-
-#include "mtypes.h"
-
-extern void tdfxDDInitTriFuncs( GLcontext *ctx );
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.c
deleted file mode 100644
index 0580135d1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel i810
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c,v 1.3 2002/10/30 12:52:01 alanh Exp $ */
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "math/m_translate.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tdfx_context.h"
-#include "tdfx_vb.h"
-#include "tdfx_tris.h"
-#include "tdfx_state.h"
-#include "tdfx_render.h"
-
-static void copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- tdfxVertex *dst = fxMesa->verts + edst;
- tdfxVertex *src = fxMesa->verts + esrc;
- *(GLuint *)&dst->color = *(GLuint *)&src->color;
-}
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void * );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_format;
-} setup_tab[TDFX_MAX_SETUP];
-
-
-
-
-#define GET_COLOR(ptr, idx) ((ptr)->data[idx])
-
-
-static void interp_extras( GLcontext *ctx,
- GLfloat t,
- GLuint dst, GLuint out, GLuint in,
- GLboolean force_boundary )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /*fprintf(stderr, "%s\n", __FUNCTION__);*/
-
- if (VB->ColorPtr[1]) {
- INTERP_4F( t,
- GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], out),
- GET_COLOR(VB->ColorPtr[1], in) );
- }
-
- if (VB->EdgeFlag) {
- VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
- }
-
- setup_tab[TDFX_CONTEXT(ctx)->SetupIndex].interp(ctx, t, dst, out, in,
- force_boundary);
-}
-
-static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], src) );
- }
-
- setup_tab[TDFX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src);
-}
-
-
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "tdfx_vbtmp.h"
-
-/* Special for tdfx: fog requires w
- */
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT)
-#define TAG(x) x##_wg_fog
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_TEX1_BIT)
-#define TAG(x) x##_wgt0t1
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_TEX1_BIT|\
- TDFX_PTEX_BIT)
-#define TAG(x) x##_wgpt0t1
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_RGBA_BIT)
-#define TAG(x) x##_g
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_TEX0_BIT|TDFX_TEX1_BIT)
-#define TAG(x) x##_t0t1
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_RGBA_BIT|TDFX_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_RGBA_BIT|TDFX_TEX0_BIT|TDFX_TEX1_BIT)
-#define TAG(x) x##_gt0t1
-#include "tdfx_vbtmp.h"
-
-
-/* fogc { */
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_FOGC_BIT)
-#define TAG(x) x##_wgf
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_FOGC_BIT)
-#define TAG(x) x##_wgt0f
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_TEX1_BIT|TDFX_FOGC_BIT)
-#define TAG(x) x##_wgt0t1f
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_PTEX_BIT|TDFX_FOGC_BIT)
-#define TAG(x) x##_wgpt0f
-#include "tdfx_vbtmp.h"
-
-#define IND (TDFX_XYZ_BIT|TDFX_RGBA_BIT|TDFX_W_BIT|TDFX_TEX0_BIT|TDFX_TEX1_BIT|\
- TDFX_PTEX_BIT|TDFX_FOGC_BIT)
-#define TAG(x) x##_wgpt0t1f
-#include "tdfx_vbtmp.h"
-/* fogc } */
-
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wg_fog();
- init_wgt0();
- init_wgt0t1();
- init_wgpt0();
- init_wgpt0t1();
-
- init_g();
- init_t0();
- init_t0t1();
- init_gt0();
- init_gt0t1();
-
- /* fogcoord */
- init_wgf();
- init_wgt0f();
- init_wgt0t1f();
- init_wgpt0f();
- init_wgpt0t1f();
-}
-
-
-void tdfxPrintSetupFlags(char *msg, GLuint flags )
-{
- fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & TDFX_XYZ_BIT) ? " xyz," : "",
- (flags & TDFX_W_BIT) ? " w," : "",
- (flags & TDFX_RGBA_BIT) ? " rgba," : "",
- (flags & TDFX_TEX0_BIT) ? " tex-0," : "",
- (flags & TDFX_TEX1_BIT) ? " tex-1," : "",
- (flags & TDFX_FOGC_BIT) ? " fogc," : "");
-}
-
-
-
-void tdfxCheckTexSizes( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- if (!setup_tab[fxMesa->SetupIndex].check_tex_sizes(ctx)) {
- GLuint ind = fxMesa->SetupIndex |= (TDFX_PTEX_BIT|TDFX_RGBA_BIT);
-
- /* Tdfx handles projective textures nicely; just have to change
- * up to the new vertex format.
- */
- if (setup_tab[ind].vertex_format != fxMesa->vertexFormat) {
- FLUSH_BATCH(fxMesa);
- fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT;
- fxMesa->vertexFormat = setup_tab[ind].vertex_format;
-
- /* This is required as we have just changed the vertex
- * format, so the interp and copy routines must also change.
- * In the unfilled and twosided cases we are using the
- * swrast_setup ones anyway, so leave them in place.
- */
- if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[fxMesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[fxMesa->SetupIndex].copy_pv;
- }
- }
- }
-}
-
-
-void tdfxBuildVertices( GLcontext *ctx, GLuint start, GLuint end,
- GLuint newinputs )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- tdfxVertex *v = fxMesa->verts + start;
-
- newinputs |= fxMesa->SetupNewInputs;
- fxMesa->SetupNewInputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[fxMesa->SetupIndex].emit( ctx, start, end, v );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= TDFX_RGBA_BIT;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= TDFX_FOGC_BIT;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= TDFX_TEX0_BIT;
-
- if (newinputs & VERT_BIT_TEX1)
- ind |= TDFX_TEX0_BIT|TDFX_TEX1_BIT;
-
- if (fxMesa->SetupIndex & TDFX_PTEX_BIT)
- ind = ~0;
-
- ind &= fxMesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, end, v );
- }
- }
-}
-
-
-void tdfxChooseVertexState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- GLuint ind = TDFX_XYZ_BIT|TDFX_RGBA_BIT;
-
- fxMesa->tmu_source[0] = 0;
- fxMesa->tmu_source[1] = 1;
-
- if (ctx->Texture._EnabledUnits & 0x2) {
- if (ctx->Texture._EnabledUnits & 0x1) {
- ind |= TDFX_TEX1_BIT;
- }
- ind |= TDFX_W_BIT|TDFX_TEX0_BIT;
- fxMesa->tmu_source[0] = 1;
- fxMesa->tmu_source[1] = 0;
- } else if (ctx->Texture._EnabledUnits & 0x1) {
- /* unit 0 enabled */
- ind |= TDFX_W_BIT|TDFX_TEX0_BIT;
- } else if (fxMesa->Fog.Mode != GR_FOG_DISABLE) {
- ind |= TDFX_W_BIT;
- }
-
- if (fxMesa->Fog.Mode == GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT) {
- ind |= TDFX_FOGC_BIT;
- }
-
- fxMesa->SetupIndex = ind;
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = interp_extras;
- tnl->Driver.Render.CopyPV = copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-
- if (setup_tab[ind].vertex_format != fxMesa->vertexFormat) {
- FLUSH_BATCH(fxMesa);
- fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT;
- fxMesa->vertexFormat = setup_tab[ind].vertex_format;
- }
-}
-
-
-
-void tdfxInitVB( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
-
- fxMesa->verts = ALIGN_MALLOC(size * sizeof(tdfxVertex), 32);
- fxMesa->vertexFormat = TDFX_LAYOUT_TINY;
- fxMesa->SetupIndex = TDFX_XYZ_BIT|TDFX_RGBA_BIT;
-}
-
-
-void tdfxFreeVB( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- if (fxMesa->verts) {
- ALIGN_FREE(fxMesa->verts);
- fxMesa->verts = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.h
deleted file mode 100644
index 7b7cd9065..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vb.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * GLX Hardware Device Driver for Intel tdfx
- * Copyright (C) 1999 Keith Whitwell
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to 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
- * KEITH WHITWELL, 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.
- *
- *
- */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */
-
-#ifndef TDFXVB_INC
-#define TDFXVB_INC
-
-#include "mtypes.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "math/m_xform.h"
-
-#define TDFX_XYZ_BIT 0x1
-#define TDFX_W_BIT 0x2
-#define TDFX_RGBA_BIT 0x4
-#define TDFX_TEX1_BIT 0x8
-#define TDFX_TEX0_BIT 0x10
-#define TDFX_PTEX_BIT 0x20
-#define TDFX_FOGC_BIT 0x40
-#define TDFX_MAX_SETUP 0x80
-
-#define _TDFX_NEW_RASTERSETUP (_NEW_TEXTURE | \
- _DD_NEW_SEPARATE_SPECULAR | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _NEW_FOG)
-
-
-extern void tdfxValidateBuildProjVerts(GLcontext *ctx,
- GLuint start, GLuint count,
- GLuint newinputs );
-
-extern void tdfxPrintSetupFlags(char *msg, GLuint flags );
-
-extern void tdfxInitVB( GLcontext *ctx );
-
-extern void tdfxFreeVB( GLcontext *ctx );
-
-extern void tdfxCheckTexSizes( GLcontext *ctx );
-
-extern void tdfxChooseVertexState( GLcontext *ctx );
-
-extern void tdfxBuildVertices( GLcontext *ctx, GLuint start, GLuint end,
- GLuint newinputs );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h
deleted file mode 100644
index 9b780761f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.1
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Daniel Borca <dborca@users.sourceforge.net>
- */
-
-
-#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12]
-#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13]
-#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14]
-
-
-static void TAG(emit)( GLcontext *ctx,
- GLuint start, GLuint end,
- void *dest )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint tmu0_source = fxMesa->tmu_source[0];
- GLuint tmu1_source = fxMesa->tmu_source[1];
- GLfloat (*tc0)[4], (*tc1)[4];
- GLfloat (*col)[4];
- GLuint tc0_stride, tc1_stride, col_stride;
- GLuint tc0_size, tc1_size, col_size;
- GLfloat (*proj)[4] = VB->NdcPtr->data;
- GLuint proj_stride = VB->NdcPtr->stride;
- GLfloat (*fog)[4];
- GLuint fog_stride;
- tdfxVertex *v = (tdfxVertex *)dest;
- GLfloat u0scale,v0scale,u1scale,v1scale;
- const GLubyte *mask = VB->ClipMask;
- const GLfloat *s = fxMesa->hw_viewport;
- int i;
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (IND & TDFX_TEX0_BIT) {
- tc0_stride = VB->TexCoordPtr[tmu0_source]->stride;
- tc0 = VB->TexCoordPtr[tmu0_source]->data;
- u0scale = fxMesa->sScale0;
- v0scale = fxMesa->tScale0;
- if (IND & TDFX_PTEX_BIT)
- tc0_size = VB->TexCoordPtr[tmu0_source]->size;
- }
-
- if (IND & TDFX_TEX1_BIT) {
- tc1 = VB->TexCoordPtr[tmu1_source]->data;
- tc1_stride = VB->TexCoordPtr[tmu1_source]->stride;
- u1scale = fxMesa->sScale1;
- v1scale = fxMesa->tScale1;
- if (IND & TDFX_PTEX_BIT)
- tc1_size = VB->TexCoordPtr[tmu1_source]->size;
- }
-
- if (IND & TDFX_RGBA_BIT) {
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
- col_size = VB->ColorPtr[0]->size;
- }
-
- if (IND & TDFX_FOGC_BIT) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
- }
-
- {
- /* May have nonstandard strides:
- */
- if (start) {
- proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride);
- if (IND & TDFX_TEX0_BIT)
- tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride);
- if (IND & TDFX_TEX1_BIT)
- tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride);
- if (IND & TDFX_RGBA_BIT)
- STRIDE_4F(col, start * col_stride);
- if (IND & TDFX_FOGC_BIT)
- STRIDE_4F(fog, start * fog_stride);
- }
-
- for (i=start; i < end; i++, v++) {
- if (IND & TDFX_XYZ_BIT) {
- if (mask[i] == 0) {
- /* unclipped */
- VIEWPORT_X(v->x, proj[0][0]);
- VIEWPORT_Y(v->y, proj[0][1]);
- VIEWPORT_Z(v->z, proj[0][2]);
- v->rhw = proj[0][3];
- } else {
- /* clipped */
- v->rhw = 1.0;
- }
- proj = (GLfloat (*)[4])((GLubyte *)proj + proj_stride);
- }
- if (IND & TDFX_RGBA_BIT) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->color[0], col[0][2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->color[1], col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->color[2], col[0][0]);
- if (col_size == 4) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->color[3], col[0][3]);
- } else {
- v->color[3] = 255;
- }
- STRIDE_4F(col, col_stride);
- }
- if (IND & TDFX_FOGC_BIT) {
- v->fog = CLAMP(fog[0][0], 0.0f, 1.0f);
- STRIDE_4F(fog, fog_stride);
- }
- if (IND & TDFX_TEX0_BIT) {
- GLfloat w = v->rhw;
- v->tu0 = tc0[0][0] * u0scale * w;
- v->tv0 = tc0[0][1] * v0scale * w;
- if (IND & TDFX_PTEX_BIT) {
- v->tq0 = w;
- if (tc0_size == 4)
- v->tq0 = tc0[0][3] * w;
- }
- tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride);
- }
- if (IND & TDFX_TEX1_BIT) {
- GLfloat w = v->rhw;
- v->tu1 = tc1[0][0] * u1scale * w;
- v->tv1 = tc1[0][1] * v1scale * w;
- if (IND & TDFX_PTEX_BIT) {
- v->tq1 = w;
- if (tc1_size == 4)
- v->tq1 = tc1[0][3] * w;
- }
- tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride);
- }
- }
- }
-}
-
-
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (IND & TDFX_PTEX_BIT)
- return GL_TRUE;
-
- if (IND & TDFX_TEX0_BIT) {
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (IND & TDFX_TEX1_BIT) {
- if (VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (VB->TexCoordPtr[1]->size == 4)
- return GL_FALSE;
- }
-
- if (VB->TexCoordPtr[0]->size == 4)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- const GLfloat oow = (dstclip[3] == 0.0F) ? 1.0F : (1.0F / dstclip[3]);
- const GLfloat *s = fxMesa->hw_viewport;
- tdfxVertex *dst = fxMesa->verts + edst;
- const tdfxVertex *out = fxMesa->verts + eout;
- const tdfxVertex *in = fxMesa->verts + ein;
- const GLfloat wout = oow / out->rhw;
- const GLfloat win = oow / in->rhw;
-
- VIEWPORT_X(dst->x, dstclip[0] * oow);
- VIEWPORT_Y(dst->y, dstclip[1] * oow);
- VIEWPORT_Z(dst->z, dstclip[2] * oow);
- dst->rhw = oow;
-
- INTERP_UB( t, dst->color[0], out->color[0], in->color[0] );
- INTERP_UB( t, dst->color[1], out->color[1], in->color[1] );
- INTERP_UB( t, dst->color[2], out->color[2], in->color[2] );
- INTERP_UB( t, dst->color[3], out->color[3], in->color[3] );
-
- if (IND & TDFX_FOGC_BIT) {
- INTERP_F( t, dst->fog, out->fog, in->fog );
- }
-
- if (IND & TDFX_TEX0_BIT) {
- INTERP_F( t, dst->tu0, out->tu0 * wout, in->tu0 * win );
- INTERP_F( t, dst->tv0, out->tv0 * wout, in->tv0 * win );
- if (IND & TDFX_PTEX_BIT) {
- INTERP_F( t, dst->tq0, out->tq0 * wout, in->tq0 * win );
- }
- }
- if (IND & TDFX_TEX1_BIT) {
- INTERP_F( t, dst->tu1, out->tu1 * wout, in->tu1 * win );
- INTERP_F( t, dst->tv1, out->tv1 * wout, in->tv1 * win );
- if (IND & TDFX_PTEX_BIT) {
- INTERP_F( t, dst->tq1, out->tq1 * wout, in->tq1 * win );
- }
- }
-}
-
-
-static void TAG(init)( void )
-{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- setup_tab[IND].emit = TAG(emit);
- setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes);
- setup_tab[IND].interp = TAG(interp);
- setup_tab[IND].copy_pv = copy_pv;
-
- if (IND & TDFX_TEX1_BIT) {
- if (IND & TDFX_PTEX_BIT) {
- setup_tab[IND].vertex_format = TDFX_LAYOUT_PROJ2;
- }
- else {
- setup_tab[IND].vertex_format = TDFX_LAYOUT_MULTI;
- }
- }
- else if (IND & TDFX_TEX0_BIT) {
- if (IND & TDFX_PTEX_BIT) {
- setup_tab[IND].vertex_format = TDFX_LAYOUT_PROJ1;
- } else {
- setup_tab[IND].vertex_format = TDFX_LAYOUT_SINGLE;
- }
- }
- else if (IND & TDFX_W_BIT) {
- setup_tab[IND].vertex_format = TDFX_LAYOUT_NOTEX;
- } else {
- setup_tab[IND].vertex_format = TDFX_LAYOUT_TINY;
- }
-}
-
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/Makefile
deleted file mode 100644
index 9ee24c504..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# src/mesa/drivers/dri/trident/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = trident_dri.so
-
-# Not yet
-# MINIGLX_SOURCES = server/trident_dri.c
-
-DRIVER_SOURCES = \
- trident_context.c \
- trident_state.c \
- trident_vb.c \
- trident_dd.c \
- trident_tris.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.c
deleted file mode 100644
index b44c6205c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Trident CyberBladeXP driver.
- *
- */
-#include "trident_dri.h"
-#include "trident_context.h"
-#include "trident_lock.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "array_cache/acache.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
-
-#include "context.h"
-#include "simple_list.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-#include "simple_list.h"
-#include "mm.h"
-#include "drirenderbuffer.h"
-
-#include "drivers/common/driverfuncs.h"
-#include "dri_util.h"
-
-static const struct tnl_pipeline_stage *trident_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_render_stage,
- 0,
-};
-
-
-GLboolean tridentCreateContext( const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- GLcontext *ctx, *shareCtx;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- tridentContextPtr tmesa;
- tridentScreenPtr tridentscrn;
- struct dd_function_table functions;
-#if 0
- drm_trident_sarea_t *saPriv=(drm_trident_sarea_t *)(((char*)sPriv->pSAREA)+
- sizeof(XF86DRISAREARec));
-#endif
-
- tmesa = (tridentContextPtr) CALLOC( sizeof(*tmesa) );
- if ( !tmesa ) return GL_FALSE;
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((tridentContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- _mesa_init_driver_functions(&functions);
-
- tmesa->glCtx =
- _mesa_create_context(glVisual, shareCtx, &functions, (void *)tmesa);
-
- if (!tmesa->glCtx) {
- FREE(tmesa);
- return GL_FALSE;
- }
-
- tmesa->driContext = driContextPriv;
- tmesa->driScreen = sPriv;
- tmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */
-
- tmesa->hHWContext = driContextPriv->hHWContext;
- tmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock;
- tmesa->driFd = sPriv->fd;
-#if 0
- tmesa->sarea = saPriv;
-#endif
-
- tridentscrn = tmesa->tridentScreen = (tridentScreenPtr)(sPriv->private);
-
- ctx = tmesa->glCtx;
-
- ctx->Const.MaxTextureLevels = 13; /* 4K by 4K? Is that right? */
- ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */
-
- ctx->Const.MinLineWidth = 0.0;
- ctx->Const.MaxLineWidth = 255.0;
-
- ctx->Const.MinLineWidthAA = 0.0;
- ctx->Const.MaxLineWidthAA = 65536.0;
-
- ctx->Const.MinPointSize = 0.0;
- ctx->Const.MaxPointSize = 255.0;
-
- ctx->Const.MinPointSizeAA = 0.5; /* 4x4 quality mode */
- ctx->Const.MaxPointSizeAA = 16.0;
- ctx->Const.PointSizeGranularity = 0.25;
-
-#if 0
- tmesa->texHeap = mmInit( 0, tmesa->tridentScreen->textureSize );
-
- make_empty_list(&tmesa->TexObjList);
- make_empty_list(&tmesa->SwappedOut);
-
- tmesa->CurrentTexObj[0] = 0;
- tmesa->CurrentTexObj[1] = 0; /* Permedia 3, second texture */
-
- tmesa->RenderIndex = ~0;
-#endif
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext( ctx );
- _ac_CreateContext( ctx );
- _tnl_CreateContext( ctx );
- _swsetup_CreateContext( ctx );
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline( ctx );
- _tnl_install_pipeline( ctx, trident_pipeline );
-
- /* Configure swrast to match hardware characteristics:
- */
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
-
- tridentInitVB( ctx );
- tridentDDInitExtensions( ctx );
- tridentDDInitDriverFuncs( ctx );
- tridentDDInitStateFuncs( ctx );
-#if 0
- tridentDDInitSpanFuncs( ctx );
- tridentDDInitTextureFuncs( ctx );
-#endif
- tridentDDInitTriFuncs( ctx );
- tridentDDInitState( tmesa );
-
- driContextPriv->driverPrivate = (void *)tmesa;
-
- UNLOCK_HARDWARE(tmesa);
-
- return GL_TRUE;
-}
-
-static void
-tridentDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- tridentContextPtr tmesa = (tridentContextPtr)driContextPriv->driverPrivate;
-
- if (tmesa) {
- _swsetup_DestroyContext( tmesa->glCtx );
- _tnl_DestroyContext( tmesa->glCtx );
- _ac_DestroyContext( tmesa->glCtx );
- _swrast_DestroyContext( tmesa->glCtx );
-
- /* free the Mesa context */
- tmesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(tmesa->glCtx);
-
- _mesa_free(tmesa);
- driContextPriv->driverPrivate = NULL;
- }
-}
-
-
-static GLboolean
-tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap )
-{
- tridentScreenPtr screen = (tridentScreenPtr) driScrnPriv->private;
-
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0
- );
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
- /*
- tridentSetSpanFunctions(frontRb, mesaVis);
- */
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
- /*
- tridentSetSpanFunctions(backRb, mesaVis);
- */
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- /*
- tridentSetSpanFunctions(depthRb, mesaVis);
- */
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
- /*
- tridentSetSpanFunctions(depthRb, mesaVis);
- */
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- /* no h/w stencil?
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT);
- tridentSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
- */
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-tridentDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-}
-
-static void
-tridentSwapBuffers(__DRIdrawablePrivate *drawablePrivate)
-{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
-
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- tridentContextPtr tmesa;
- GLcontext *ctx;
- tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = tmesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
- tridentCopyBuffer( dPriv );
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "tridentSwapBuffers: drawable has no context!\n");
- }
-}
-
-static GLboolean
-tridentMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- GET_CURRENT_CONTEXT(ctx);
- tridentContextPtr oldCtx = ctx ? TRIDENT_CONTEXT(ctx) : NULL;
- tridentContextPtr newCtx = (tridentContextPtr) driContextPriv->driverPrivate;
-
- if ( newCtx != oldCtx ) {
- newCtx->dirty = ~0;
- }
-
- if (newCtx->driDrawable != driDrawPriv) {
- newCtx->driDrawable = driDrawPriv;
-#if 0
- tridentUpdateWindow ( newCtx->glCtx );
- tridentUpdateViewportOffset( newCtx->glCtx );
-#endif
- }
-
- newCtx->drawOffset = newCtx->tridentScreen->backOffset;
- newCtx->drawPitch = newCtx->tridentScreen->backPitch;
-
- _mesa_make_current( newCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
-
- if (!newCtx->glCtx->Viewport.Width) {
- _mesa_set_viewport(newCtx->glCtx, 0, 0,
- driDrawPriv->w, driDrawPriv->h);
- }
- } else {
- _mesa_make_current( NULL, NULL, NULL );
- }
- return GL_TRUE;
-}
-
-
-static GLboolean
-tridentUnbindContext( __DRIcontextPrivate *driContextPriv )
-{
- return GL_TRUE;
-}
-
-
-tridentScreenPtr tridentCreateScreen( __DRIscreenPrivate *sPriv )
-{
- TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv;
- tridentScreenPtr tridentScreen;
-
- if (sPriv->devPrivSize != sizeof(TRIDENTDRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(TRIDENTDRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) );
- if ( !tridentScreen ) return NULL;
-
- tridentScreen->driScreen = sPriv;
-
- tridentScreen->frontOffset = tDRIPriv->frontOffset;
- tridentScreen->backOffset = tDRIPriv->backOffset;
- tridentScreen->depthOffset = tDRIPriv->depthOffset;
- tridentScreen->frontPitch = tDRIPriv->frontPitch;
- tridentScreen->backPitch = tDRIPriv->backPitch;
- tridentScreen->depthPitch = tDRIPriv->depthPitch;
- tridentScreen->width = tDRIPriv->width;
- tridentScreen->height = tDRIPriv->height;
-
-printf("%d %d\n",tridentScreen->width,tridentScreen->height);
-printf("%d %d\n",tridentScreen->frontPitch,tridentScreen->backPitch);
-printf("offset 0x%x 0x%x\n",tridentScreen->backOffset,tridentScreen->depthOffset);
-
- tridentScreen->mmio.handle = tDRIPriv->regs;
- tridentScreen->mmio.size = 0x20000;
-
- if (drmMap(sPriv->fd,
- tridentScreen->mmio.handle, tridentScreen->mmio.size,
- (drmAddressPtr)&tridentScreen->mmio.map)) {
- FREE(tridentScreen);
- return GL_FALSE;
- }
-printf("MAPPED at %p\n", tridentScreen->mmio.map);
-
- return tridentScreen;
-}
-
-/* Destroy the device specific screen private data struct.
- */
-void tridentDestroyScreen( __DRIscreenPrivate *sPriv )
-{
- tridentScreenPtr tridentScreen = (tridentScreenPtr)sPriv->private;
-
- FREE(tridentScreen);
-}
-static GLboolean
-tridentInitDriver(__DRIscreenPrivate *sPriv)
-{
- sPriv->private = (void *) tridentCreateScreen( sPriv );
-
- if (!sPriv->private) {
- tridentDestroyScreen( sPriv );
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static struct __DriverAPIRec tridentAPI = {
- tridentInitDriver,
- tridentDestroyScreen,
- tridentCreateContext,
- tridentDestroyContext,
- tridentCreateBuffer,
- tridentDestroyBuffer,
- tridentSwapBuffers,
- tridentMakeCurrent,
- tridentUnbindContext,
-};
-
-
-PUBLIC void *__driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
- __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 4, 0, 0 };
- static const __DRIversion dri_expected = { 3, 1, 0 };
- static const __DRIversion drm_expected = { 1, 0, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "Trident",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &tridentAPI);
-
- if ( psp != NULL ) {
-#if 0
- TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
- *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
- GL_TRUE );
-#endif
- }
- return (void *) psp;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.h
deleted file mode 100644
index 7ebb5f204..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_context.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Trident CyberBladeXP driver.
- *
- */
-#ifndef _TRIDENT_CONTEXT_H_
-#define _TRIDENT_CONTEXT_H_
-
-#include "dri_util.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "drm.h"
-#include "mm.h"
-
-#define SUBPIXEL_X (0.0F)
-#define SUBPIXEL_Y (0.125F)
-
-#define _TRIDENT_NEW_VERTEX (_NEW_TEXTURE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE)
-
-#define TRIDENT_FALLBACK_TEXTURE 0x01
-#define TRIDENT_FALLBACK_DRAW_BUFFER 0x02
-
-#define TRIDENT_NEW_CLIP 0x01
-
-#define TRIDENT_UPLOAD_COMMAND_D 0x00000001
-#define TRIDENT_UPLOAD_CONTEXT 0x04000000
-#define TRIDENT_UPLOAD_CLIPRECTS 0x80000000
-
-#define TAG(x) trident##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-/* these require that base be dword-aligned */
-static inline void MMIO_OUT32(unsigned char *base, unsigned int offset,
- unsigned int val)
-{
- unsigned int *addr = (unsigned int *)(base + offset);
- *addr = val;
-}
-
-static inline unsigned int MMIO_IN32(unsigned char *base, unsigned int offset)
-{
- unsigned int *addr = (unsigned int *)(base + offset);
- return *addr;
-}
-
-#define MMIO_OUT8(base, offset, val) *((base) + (offset)) = (val)
-#define MMIO_IN8(base, offset) *((base) + (offset))
-
-struct trident_context;
-typedef struct trident_context tridentContextRec;
-typedef struct trident_context *tridentContextPtr;
-
-typedef void (*trident_quad_func)( tridentContextPtr,
- const tridentVertex *,
- const tridentVertex *,
- const tridentVertex *,
- const tridentVertex * );
-typedef void (*trident_tri_func)( tridentContextPtr,
- const tridentVertex *,
- const tridentVertex *,
- const tridentVertex * );
-typedef void (*trident_line_func)( tridentContextPtr,
- const tridentVertex *,
- const tridentVertex * );
-typedef void (*trident_point_func)( tridentContextPtr,
- const tridentVertex * );
-
-typedef struct {
- drm_handle_t handle; /* Handle to the DRM region */
- drmSize size; /* Size of the DRM region */
- unsigned char *map; /* Mapping of the DRM region */
-} tridentRegionRec, *tridentRegionPtr;
-
-typedef struct {
- __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */
-
- drmBufMapPtr buffers;
-
- unsigned int frontOffset;
- unsigned int frontPitch;
- unsigned int backOffset;
- unsigned int backPitch;
- unsigned int depthOffset;
- unsigned int depthPitch;
- unsigned int width;
- unsigned int height;
- unsigned int cpp;
-
-#if 0
- unsigned int sarea_priv_offset;
-#endif
-
- tridentRegionRec mmio;
-} tridentScreenRec, *tridentScreenPtr;
-
-/**
- * tridentRenderbuffer, derived from Mesa's gl_renderbuffer
- */
-typedef struct {
- struct gl_renderbuffer Base;
- /* XXX per-window info should go here */
- int foo, bar;
-} tridentRenderbuffer;
-
-
-struct trident_context {
- GLcontext *glCtx; /* Mesa context */
-
- __DRIcontextPrivate *driContext;
- __DRIscreenPrivate *driScreen;
- __DRIdrawablePrivate *driDrawable;
-
- GLuint new_gl_state;
- GLuint new_state;
- GLuint dirty;
-
-#if 0
- drm_trident_sarea_t *sarea;
-#endif
-
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
- /* Mirrors of some DRI state
- */
- int lastStamp; /* mirror driDrawable->lastStamp */
-
- drm_context_t hHWContext;
- drmLock *driHwLock;
- int driFd;
-
- tridentScreenPtr tridentScreen; /* Screen private DRI data */
-
- /* Visual, drawable, cliprect and scissor information
- */
- GLenum DrawBuffer;
- GLint drawOffset, drawPitch;
- GLint drawX, drawY; /* origin of drawable in draw buffer */
- GLint readOffset, readPitch;
-
- GLuint numClipRects; /* Cliprects for the draw buffer */
- drm_clip_rect_t *pClipRects;
-
- GLint scissor;
- drm_clip_rect_t ScissorRect; /* Current software scissor */
-
- GLuint Fallback;
- GLuint RenderIndex;
- GLuint SetupNewInputs;
- GLuint SetupIndex;
- GLfloat hw_viewport[16];
- GLfloat depth_scale;
- GLuint vertex_format;
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- char *verts;
-
- GLint tmu_source[2];
-
- GLuint hw_primitive;
- GLenum render_primitive;
-
- trident_point_func draw_point;
- trident_line_func draw_line;
- trident_tri_func draw_tri;
- trident_quad_func draw_quad;
-
-#if 0
- gammaTextureObjectPtr CurrentTexObj[2];
- struct gamma_texture_object_t TexObjList;
- struct gamma_texture_object_t SwappedOut;
- GLenum TexEnvImageFmt[2];
-
- memHeap_t *texHeap;
-
- int lastSwap;
- int texAge;
- int ctxAge;
- int dirtyAge;
- int lastStamp;
-#endif
-
- /* Chip state */
-
- int commandD;
-
- /* Context State */
-
- int ClearColor;
-};
-
-void tridentDDInitExtensions( GLcontext *ctx );
-void tridentDDInitDriverFuncs( GLcontext *ctx );
-void tridentDDInitSpanFuncs( GLcontext *ctx );
-void tridentDDInitState( tridentContextPtr tmesa );
-void tridentInitHW( tridentContextPtr tmesa );
-void tridentDDInitStateFuncs( GLcontext *ctx );
-void tridentDDInitTextureFuncs( GLcontext *ctx );
-void tridentDDInitTriFuncs( GLcontext *ctx );
-
-extern void tridentBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs );
-extern void tridentInitVB( GLcontext *ctx );
-extern void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv );
-extern void tridentFallback( tridentContextPtr tmesa, GLuint bit,
- GLboolean mode );
-extern void tridentCheckTexSizes( GLcontext *ctx );
-extern void tridentChooseVertexState( GLcontext *ctx );
-extern void tridentDDUpdateHWState( GLcontext *ctx );
-extern void tridentUploadHwStateLocked( tridentContextPtr tmesa );
-
-#define TRIDENT_CONTEXT(ctx) ((tridentContextPtr)(ctx->DriverCtx))
-
-#endif /* _TRIDENT_CONTEXT_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dd.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dd.c
deleted file mode 100644
index 8c3af2001..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dd.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Trident CyberBladeXP driver.
- *
- */
-#include "trident_context.h"
-#include "trident_lock.h"
-#if defined(USE_X86_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-
-#include "swrast/swrast.h"
-#include "context.h"
-#include "framebuffer.h"
-
-#define TRIDENT_DATE "20041223"
-
-/* Return the width and height of the current color buffer.
- */
-static void tridentDDGetBufferSize( GLframebuffer *framebuffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
-
- LOCK_HARDWARE(tmesa);
- *width = tmesa->driDrawable->w;
- *height = tmesa->driDrawable->h;
- UNLOCK_HARDWARE(tmesa);
-}
-
-
-/* Return various strings for glGetString().
- */
-static const GLubyte *tridentDDGetString( GLcontext *ctx, GLenum name )
-{
- static char buffer[128];
-
- switch ( name ) {
- case GL_VENDOR:
- return (GLubyte *)"Alan Hourihane";
-
- case GL_RENDERER:
- sprintf( buffer, "Mesa DRI Trident " TRIDENT_DATE );
-
- /* Append any CPU-specific information.
- */
-#ifdef USE_X86_ASM
- if ( _mesa_x86_cpu_features ) {
- strncat( buffer, " x86", 4 );
- }
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- strncat( buffer, "/MMX", 4 );
- }
-#endif
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- strncat( buffer, "/3DNow!", 7 );
- }
-#endif
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- strncat( buffer, "/SSE", 4 );
- }
-#endif
-#endif
- return (GLubyte *)buffer;
-
- default:
- return NULL;
- }
-}
-
-/* Enable the extensions supported by this driver.
- */
-void tridentDDInitExtensions( GLcontext *ctx )
-{
- /* None... */
-}
-
-/* Initialize the driver's misc functions.
- */
-void tridentDDInitDriverFuncs( GLcontext *ctx )
-{
- ctx->Driver.GetBufferSize = tridentDDGetBufferSize;
- ctx->Driver.GetString = tridentDDGetString;
-
- ctx->Driver.Error = NULL;
-
- /* Pixel path fallbacks
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dri.h
deleted file mode 100644
index c1ce3c468..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_dri.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _TRIDENT_DRI_
-#define _TRIDENT_DRI_
-
-#include "xf86drm.h"
-
-typedef struct {
- drm_handle_t regs;
- drmSize regsSize;
- drmAddress regsMap;
- int deviceID;
- int width;
- int height;
- int mem;
- int frontOffset;
- int frontPitch;
- int backOffset;
- int backPitch;
- int depthOffset;
- int depthPitch;
- int cpp;
-#if 0
- int textureOffset;
- int textureSize;
-#endif
- unsigned int sarea_priv_offset;
-} TRIDENTDRIRec, *TRIDENTDRIPtr;
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_lock.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_lock.h
deleted file mode 100644
index ee0819f5c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_lock.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* XXX tridentGetLock doesn't exist... */
-
-#define LOCK_HARDWARE(tmesa) \
- do { \
- char __ret = 0; \
- DRM_CAS(tmesa->driHwLock, tmesa->hHWContext, \
- DRM_LOCK_HELD | tmesa->hHWContext, __ret); \
- } while (0)
-
-#define UNLOCK_HARDWARE(tmesa) \
- DRM_UNLOCK(tmesa->driFd, tmesa->driHwLock, tmesa->hHWContext)
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_state.c
deleted file mode 100644
index 76b2a8ef3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_state.c
+++ /dev/null
@@ -1,555 +0,0 @@
-/*
- * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Trident CyberBladeXP driver.
- *
- */
-#include "trident_context.h"
-#include "trident_lock.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "framebuffer.h"
-
-#define TRIDENTPACKCOLOR332(r, g, b) \
- (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6))
-
-#define TRIDENTPACKCOLOR1555(r, g, b, a) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-
-#define TRIDENTPACKCOLOR565(r, g, b) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-
-#define TRIDENTPACKCOLOR888(r, g, b) \
- (((r) << 16) | ((g) << 8) | (b))
-
-#define TRIDENTPACKCOLOR8888(r, g, b, a) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-#define TRIDENTPACKCOLOR4444(r, g, b, a) \
- ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-
-static __inline__ GLuint tridentPackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
-{
- switch ( cpp ) {
- case 2:
- return TRIDENTPACKCOLOR565( r, g, b );
- case 4:
- return TRIDENTPACKCOLOR8888( r, g, b, a );
- default:
- return 0;
- }
-}
-
-void tridentUploadHwStateLocked( tridentContextPtr tmesa )
-{
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
-#if 0
- ATISAREAPrivPtr sarea = tmesa->sarea;
- trident_context_regs_t *regs = &(sarea->ContextState);
-#endif
-
- if ( tmesa->dirty & TRIDENT_UPLOAD_COMMAND_D ) {
- MMIO_OUT32(MMIO, 0x00281C, tmesa->commandD );
- tmesa->dirty &= ~TRIDENT_UPLOAD_COMMAND_D;
- }
-
- if ( tmesa->dirty & TRIDENT_UPLOAD_CLIPRECTS ) {
- /* XXX FIX ME ! */
- MMIO_OUT32(MMIO, 0x002C80 , 0x20008000 | tmesa->tridentScreen->height );
- MMIO_OUT32(MMIO, 0x002C84 , 0x20000000 | tmesa->tridentScreen->width );
- tmesa->dirty &= ~TRIDENT_UPLOAD_CLIPRECTS;
- }
-
- tmesa->dirty = 0;
-}
-
-/* Copy the back color buffer to the front color buffer.
- */
-void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv )
-{
- unsigned char *MMIO;
- tridentContextPtr tmesa;
- GLint nbox, i;
- int busy;
- drm_clip_rect_t *pbox;
-
- assert(dPriv);
- assert(dPriv->driContextPriv);
- assert(dPriv->driContextPriv->driverPrivate);
-
- tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate;
- MMIO = tmesa->tridentScreen->mmio.map;
-
- LOCK_HARDWARE( tmesa );
-
- /* use front buffer cliprects */
- nbox = dPriv->numClipRects;
- pbox = dPriv->pClipRects;
-
- for ( i = 0 ; i < nbox ; i++ ) {
-#if 0
- GLint nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS , nbox );
- drm_clip_rect_t *b = tmesa->sarea->boxes;
- GLint n = 0;
-
- for ( ; i < nr ; i++ ) {
- *b++ = pbox[i];
- n++;
- }
- tmesa->sarea->nbox = n;
-#endif
-
- MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->frontPitch << 20 | tmesa->tridentScreen->frontOffset>>4);
- MMIO_OUT32(MMIO, 0x2154, tmesa->tridentScreen->backPitch << 20 | tmesa->tridentScreen->backOffset>>4);
- MMIO_OUT8(MMIO, 0x2127, 0xCC); /* Copy Rop */
- MMIO_OUT32(MMIO, 0x2128, 0x4); /* scr2scr */
- MMIO_OUT32(MMIO, 0x2138, (pbox->x1 << 16) | pbox->y1);
- MMIO_OUT32(MMIO, 0x213C, (pbox->x1 << 16) | pbox->y1);
- MMIO_OUT32(MMIO, 0x2140, (pbox->x2 - pbox->x1) << 16 | (pbox->y2 - pbox->y1) );
- MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */
-#define GE_BUSY 0x80
- for (;;) {
- busy = MMIO_IN8(MMIO, 0x2120);
- if ( !(busy & GE_BUSY) )
- break;
- }
- }
-
- UNLOCK_HARDWARE( tmesa );
-
-#if 0
- tmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
- MACH64_UPLOAD_MISC |
- MACH64_UPLOAD_CLIPRECTS);
-#endif
-}
-
-
-static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
- int busy;
- GLuint flags = 0;
- GLint i;
-
-#define DRM_TRIDENT_FRONT 0x01
-#define DRM_TRIDENT_BACK 0x02
-#define DRM_TRIDENT_DEPTH 0x04
-
- if ( tmesa->new_state )
- tridentDDUpdateHWState( ctx );
-
- if ( mask & BUFFER_BIT_FRONT_LEFT ) {
- flags |= DRM_TRIDENT_FRONT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if ( mask & BUFFER_BIT_BACK_LEFT ) {
- flags |= DRM_TRIDENT_BACK;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) {
- flags |= DRM_TRIDENT_DEPTH;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- LOCK_HARDWARE(tmesa);
-
- if ( flags ) {
-
- cx += tmesa->drawX;
- cy += tmesa->drawY;
-
- /* HACK!!!
- */
- if ( tmesa->dirty & ~TRIDENT_UPLOAD_CLIPRECTS ) {
- tridentUploadHwStateLocked( tmesa );
- }
-
- for ( i = 0 ; i < tmesa->numClipRects ; i++ ) {
-#if 0
- int nr = MIN2( i + TRIDENT_NR_SAREA_CLIPRECTS, tmesa->numClipRects );
- drm_clip_rect_t *box = tmesa->pClipRects;
- drm_clip_rect_t *b = tmesa->sarea->boxes;
- GLint n = 0;
-
- if ( !all ) {
- for ( ; i < nr ; i++ ) {
- GLint x = box[i].x1;
- GLint y = box[i].y1;
- GLint w = box[i].x2 - x;
- GLint h = box[i].y2 - y;
-
- if ( x < cx ) w -= cx - x, x = cx;
- if ( y < cy ) h -= cy - y, y = cy;
- if ( x + w > cx + cw ) w = cx + cw - x;
- if ( y + h > cy + ch ) h = cy + ch - y;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- b->x1 = x;
- b->y1 = y;
- b->x2 = x + w;
- b->y2 = y + h;
- b++;
- n++;
- }
- } else {
- for ( ; i < nr ; i++ ) {
- *b++ = box[i];
- n++;
- }
- }
-
- tmesa->sarea->nbox = n;
-#endif
-
-if (flags & DRM_TRIDENT_BACK) {
- MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->backPitch << 20 | tmesa->tridentScreen->backOffset>>4);
- MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */
- MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor);
- MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */
- MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy);
- MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch);
- MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */
-#define GE_BUSY 0x80
- for (;;) {
- busy = MMIO_IN8(MMIO, 0x2120);
- if ( !(busy & GE_BUSY) )
- break;
- }
-}
-if (flags & DRM_TRIDENT_DEPTH) {
- MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->depthPitch << 20 | tmesa->tridentScreen->depthOffset>>4);
- MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */
- MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor);
- MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */
- MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy);
- MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch);
- MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */
-#define GE_BUSY 0x80
- for (;;) {
- busy = MMIO_IN8(MMIO, 0x2120);
- if ( !(busy & GE_BUSY) )
- break;
- }
-}
- MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->frontPitch << 20 | tmesa->tridentScreen->frontOffset>>4);
-if (flags & DRM_TRIDENT_FRONT) {
- MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */
- MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor);
- MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */
- MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy);
- MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch);
- MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */
-#define GE_BUSY 0x80
- for (;;) {
- busy = MMIO_IN8(MMIO, 0x2120);
- if ( !(busy & GE_BUSY) )
- break;
- }
-}
-
- }
-
-#if 0
- tmesa->dirty |= (TRIDENT_UPLOAD_CONTEXT |
- TRIDENT_UPLOAD_MISC |
- TRIDENT_UPLOAD_CLIPRECTS);
-#endif
- }
-
- UNLOCK_HARDWARE(tmesa);
-
- if ( mask )
- _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
-}
-
-static void tridentDDShadeModel( GLcontext *ctx, GLenum mode )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- GLuint s = tmesa->commandD;
-
-#define TRIDENT_FLAT_SHADE 0x000000E0
-#define TRIDENT_FLAT_SHADE_VERTEX_C 0x00000060
-#define TRIDENT_FLAT_SHADE_GOURAUD 0x00000080
-
- s &= ~TRIDENT_FLAT_SHADE;
-
- switch ( mode ) {
- case GL_FLAT:
- s |= TRIDENT_FLAT_SHADE_VERTEX_C;
- break;
- case GL_SMOOTH:
- s |= TRIDENT_FLAT_SHADE_GOURAUD;
- break;
- default:
- return;
- }
-
- if ( tmesa->commandD != s ) {
- tmesa->commandD = s;
-
- tmesa->dirty |= TRIDENT_UPLOAD_COMMAND_D;
- }
-}
-
-void tridentCalcViewport( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = tmesa->hw_viewport;
-
- /* See also trident_translate_vertex.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + tmesa->drawX + SUBPIXEL_X;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + tmesa->driDrawable->h + tmesa->drawY + SUBPIXEL_Y;
-#if 0
- m[MAT_SZ] = v[MAT_SZ] * tmesa->depth_scale;
- m[MAT_TZ] = v[MAT_TZ] * tmesa->depth_scale;
-#else
- m[MAT_SZ] = v[MAT_SZ];
- m[MAT_TZ] = v[MAT_TZ];
-#endif
-
- tmesa->SetupNewInputs = ~0;
-}
-
-static void tridentDDViewport( GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height )
-{
- tridentCalcViewport( ctx );
-}
-
-static void tridentDDDepthRange( GLcontext *ctx,
- GLclampd nearval, GLclampd farval )
-{
- tridentCalcViewport( ctx );
-}
-
-void tridentSetCliprects( tridentContextPtr tmesa, GLenum mode )
-{
- __DRIdrawablePrivate *dPriv = tmesa->driDrawable;
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- if (dPriv->numClipRects == 0) {
- static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
- tmesa->numClipRects = 1;
- tmesa->pClipRects = &zeroareacliprect;
- } else {
- tmesa->numClipRects = dPriv->numClipRects;
- tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pClipRects;
- }
- tmesa->drawX = dPriv->x;
- tmesa->drawY = dPriv->y;
- break;
- case GL_BACK_LEFT:
- if ( dPriv->numBackClipRects == 0 ) {
- if (dPriv->numClipRects == 0) {
- static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
- tmesa->numClipRects = 1;
- tmesa->pClipRects = &zeroareacliprect;
- } else {
- tmesa->numClipRects = dPriv->numClipRects;
- tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pClipRects;
- tmesa->drawX = dPriv->x;
- tmesa->drawY = dPriv->y;
- }
- }
- else {
- tmesa->numClipRects = dPriv->numBackClipRects;
- tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pBackClipRects;
- tmesa->drawX = dPriv->backX;
- tmesa->drawY = dPriv->backY;
- }
- break;
- default:
- return;
- }
-
-#if 0
- tmesa->dirty |= TRIDENT_UPLOAD_CLIPRECTS;
-#endif
-}
-
-#if 0
-static GLboolean tridentDDSetDrawBuffer( GLcontext *ctx, GLenum mode )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- int found = GL_TRUE;
-
- if ( tmesa->DrawBuffer != mode ) {
- tmesa->DrawBuffer = mode;
-
- switch ( mode ) {
- case GL_FRONT_LEFT:
- tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_FALSE );
- tmesa->drawOffset = tmesa->tridentScreen->frontOffset;
- tmesa->drawPitch = tmesa->tridentScreen->frontPitch;
- tridentSetCliprects( tmesa, GL_FRONT_LEFT );
- break;
- case GL_BACK_LEFT:
- tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_FALSE );
- tmesa->drawOffset = tmesa->tridentScreen->backOffset;
- tmesa->drawPitch = tmesa->tridentScreen->backPitch;
- tridentSetCliprects( tmesa, GL_BACK_LEFT );
- break;
- default:
- tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_TRUE );
- found = GL_FALSE;
- break;
- }
-
-#if 0
- tmesa->setup.dst_off_pitch = (((tmesa->drawPitch/8) << 22) |
- (tmesa->drawOffset >> 3));
-
- tmesa->dirty |= MACH64_UPLOAD_DST_OFF_PITCH | MACH64_UPLOAD_CONTEXT;
-#endif
-
- }
-
- return found;
-}
-
-static void tridentDDClearColor( GLcontext *ctx,
- const GLchan color[4] )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
-
- tmesa->ClearColor = tridentPackColor( tmesa->tridentScreen->cpp,
- color[0], color[1],
- color[2], color[3] );
-}
-#endif
-
-void tridentDDUpdateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
- TRIDENT_CONTEXT(ctx)->new_gl_state |= new_state;
-}
-
-
-/* Initialize the context's hardware state.
- */
-void tridentDDInitState( tridentContextPtr tmesa )
-{
- tmesa->new_state = 0;
-
- switch ( tmesa->glCtx->Visual.depthBits ) {
- case 16:
- tmesa->depth_scale = 1.0 / (GLfloat)0xffff;
- break;
- case 24:
- tmesa->depth_scale = 1.0 / (GLfloat)0xffffff;
- break;
- }
-}
-
-void tridentDDUpdateHWState( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- int new_state = tmesa->new_state;
-
- if ( new_state )
- {
- tmesa->new_state = 0;
-
-#if 0
- /* Update the various parts of the context's state.
- */
- if ( new_state & GAMMA_NEW_ALPHA )
- tridentUpdateAlphaMode( ctx );
-
- if ( new_state & GAMMA_NEW_DEPTH )
- tridentUpdateZMode( ctx );
-
- if ( new_state & GAMMA_NEW_FOG )
- gammaUpdateFogAttrib( ctx );
-
- if ( new_state & GAMMA_NEW_CLIP )
- gammaUpdateClipping( ctx );
-
- if ( new_state & GAMMA_NEW_POLYGON )
- gammaUpdatePolygon( ctx );
-
- if ( new_state & GAMMA_NEW_CULL )
- gammaUpdateCull( ctx );
-
- if ( new_state & GAMMA_NEW_MASKS )
- gammaUpdateMasks( ctx );
-
- if ( new_state & GAMMA_NEW_STIPPLE )
- gammaUpdateStipple( ctx );
-#endif
- }
-
- /* HACK ! */
-
-#if 0
- gammaEmitHwState( tmesa );
-#endif
-}
-
-/* Initialize the driver's state functions.
- */
-void tridentDDInitStateFuncs( GLcontext *ctx )
-{
- ctx->Driver.UpdateState = tridentDDUpdateState;
-
- ctx->Driver.Clear = tridentDDClear;
- ctx->Driver.DepthRange = tridentDDDepthRange;
- ctx->Driver.ShadeModel = tridentDDShadeModel;
- ctx->Driver.Viewport = tridentDDViewport;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_tris.c
deleted file mode 100644
index ee85ab482..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_tris.c
+++ /dev/null
@@ -1,1125 +0,0 @@
-/*
- * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Trident CyberBladeXP driver.
- *
- */
-
-#include "trident_context.h"
-#include "trident_lock.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-
-static int first = 1;
-
-typedef struct reg {
- int addr;
- int data;
-} RegData;
-
-RegData initRegData[]={
- {0x2804, 0x19980824},
- {0x2F70, 0x46455858},
- {0x2F74, 0x41584998},
- {0x2F00, 0x00000000},
- {0x2F04, 0x80000800},
- {0x2F08, 0x00550200},
- {0x2F40, 0x00000001},
- {0x2F40, 0x00000001},
- {0x2F44, 0x00830097},
- {0x2F48, 0x0087009F},
- {0x2F4C, 0x00BF0003},
- {0x2F50, 0xF00B6C1B},
- {0x2C04, 0x00000000},
- {0x2D00, 0x00000080},
- {0x2D00, 0x00000000},
- {0x2DD4, 0x00100000},
- {0x2DD4, 0x00100010},
- {0x2DD8, 0x00100000},
- {0x2DD8, 0x00100010},
- {0x2C88, 0xFFFFFFFF},
- {0x2C94 , 0xFFFFFFFF},
- {0x281C, 0x00008000},
- {0x2C80, 0x00000000},
- {0x2C80, 0x00000000},
- {0x2C80 , 0x00008000},
- {0x2C00 , 0x00000000},
- {0x2C04 , 0x00000000},
- {0x2C08 , 0x00000000},
- {0x2C0C , 0x00000000},
- {0x2C10 , 0x00000000},
- {0x2C14 , 0x00000000},
- {0x2C18 , 0x00000000},
- {0x2C1C , 0x00000000},
- {0x2C20 , 0x00000000},
- {0x2C24 , 0x00000000},
- {0x2C2C , 0x00000000},
- {0x2C30 , 0x00000000},
- {0x2C34 , 0x00000000},
- {0x2C38 , 0x00000000},
- {0x2C3C , 0x00000000},
- {0x2C40 , 0x00000000},
- {0x2C44 , 0x00000000},
- {0x2C48 , 0x00000000},
- {0x2C4C , 0x00000000},
- {0x2C50 , 0x00000000},
- {0x2C54 , 0x00000000},
- {0x2C58 , 0x00000000},
- {0x2C5C , 0x00000000},
- {0x2C60 , 0x00000000},
- {0x2C64 , 0x00000000},
- {0x2C68 , 0x00000000},
- {0x2C6C , 0x00000000},
- {0x2C70 , 0x00000000},
- {0x2C74 , 0x00000000},
- {0x2C78 , 0x00000000},
- {0x2C7C , 0x00000000},
- {0x2C80 , 0x00008000},
- {0x2C84 , 0x00000000},
- {0x2C88 , 0xFFFFFFFF},
- {0x2C8C , 0x00000000},
- {0x2C90 , 0x00000000},
- {0x2C94 , 0xFFFFFFFF},
- {0x2C98 , 0x00000000},
- {0x2C9C , 0x00000000},
- {0x2CA0 , 0x00000000},
- {0x2CA4 , 0x00000000},
- {0x2CA8 , 0x00000000},
- {0x2CAC , 0x00000000},
- {0x2CB0 , 0x00000000},
- {0x2CB4 , 0x00000000},
- {0x2CB8 , 0x00000000},
- {0x2CBC , 0x00000000},
- {0x2CC0 , 0x00000000},
- {0x2CC4 , 0x00000000},
- {0x2CC8 , 0x00000000},
- {0x2CCC , 0x00000000},
- {0x2CD0 , 0x00000000},
- {0x2CD4 , 0x00000000},
- {0x2CD8 , 0x00000000},
- {0x2CDC , 0x00000000},
- {0x2CE0 , 0x00000000},
- {0x2CE4 , 0x00000000},
- {0x2CE8 , 0x00000000},
- {0x2CEC , 0x00000000},
- {0x2CF0 , 0x00000000},
- {0x2CF4 , 0x00000000},
- {0x2CF8 , 0x00000000},
- {0x2CFC , 0x00000000},
- {0x2D00 , 0x00000000},
- {0x2D04 , 0x00000000},
- {0x2D08 , 0x00000000},
- {0x2D0C , 0x00000000},
- {0x2D10 , 0x00000000},
- {0x2D14 , 0x00000000},
- {0x2D18 , 0x00000000},
- {0x2D1C , 0x00000000},
- {0x2D20 , 0x00000000},
- {0x2D24 , 0x00000000},
- {0x2D28 , 0x00000000},
- {0x2D2C , 0x00000000},
- {0x2D30 , 0x00000000},
- {0x2D34 , 0x00000000},
- {0x2D38 , 0x00000000},
- {0x2D3C , 0x00000000},
- {0x2D40 , 0x00000000},
- {0x2D44 , 0x00000000},
- {0x2D48 , 0x00000000},
- {0x2D4C , 0x00000000},
- {0x2D50 , 0x00000000},
- {0x2D54 , 0x00000000},
- {0x2D58 , 0x00000000},
- {0x2D5C , 0x00000000},
- {0x2D60 , 0x00000000},
- {0x2D64 , 0x00000000},
- {0x2D68 , 0x00000000},
- {0x2D6C , 0x00000000},
- {0x2D70 , 0x00000000},
- {0x2D74 , 0x00000000},
- {0x2D78 , 0x00000000},
- {0x2D7C , 0x00000000},
- {0x2D80 , 0x00000000},
- {0x2D84 , 0x00000000},
- {0x2D88 , 0x00000000},
- {0x2D8C , 0x00000000},
- {0x2D90 , 0x00000000},
- {0x2D94 , 0x00000000},
- {0x2D98 , 0x00000000},
- {0x2D9C , 0x00000000},
- {0x2DA0 , 0x00000000},
- {0x2DA4 , 0x00000000},
- {0x2DA8 , 0x00000000},
- {0x2DAC , 0x00000000},
- {0x2DB0 , 0x00000000},
- {0x2DB4 , 0x00000000},
- {0x2DB8 , 0x00000000},
- {0x2DBC , 0x00000000},
- {0x2DC0 , 0x00000000},
- {0x2DC4 , 0x00000000},
- {0x2DC8 , 0x00000000},
- {0x2DCC , 0x00000000},
- {0x2DD0 , 0x00000000},
- {0x2DD4 , 0x00100010},
- {0x2DD8 , 0x00100010},
- {0x2DDC , 0x00000000},
- {0x2DE0 , 0x00000000},
- {0x2DE4 , 0x00000000},
- {0x2DE8 , 0x00000000},
- {0x2DEC , 0x00000000},
- {0x2DF0 , 0x00000000},
- {0x2DF4 , 0x00000000},
- {0x2DF8 , 0x00000000},
- {0x2DFC , 0x00000000},
- {0x2E00 , 0x00000000},
- {0x2E04 , 0x00000000},
- {0x2E08 , 0x00000000},
- {0x2E0C , 0x00000000},
- {0x2E10 , 0x00000000},
- {0x2E14 , 0x00000000},
- {0x2E18 , 0x00000000},
- {0x2E1C , 0x00000000},
- {0x2E20 , 0x00000000},
- {0x2E24 , 0x00000000},
- {0x2E28 , 0x00000000},
- {0x2E2C , 0x00000000},
- {0x2E30 , 0x00000000},
- {0x2E34 , 0x00000000},
- {0x2E38 , 0x00000000},
- {0x2E3C , 0x00000000},
- {0x2E40 , 0x00000000},
- {0x2E44 , 0x00000000},
- {0x2E48 , 0x00000000},
- {0x2E4C , 0x00000000},
- {0x2E50 , 0x00000000},
- {0x2E54 , 0x00000000},
- {0x2E58 , 0x00000000},
- {0x2E5C , 0x00000000},
- {0x2E60 , 0x00000000},
- {0x2E64 , 0x00000000},
- {0x2E68 , 0x00000000},
- {0x2E6C , 0x00000000},
- {0x2E70 , 0x00000000},
- {0x2E74 , 0x00000000},
- {0x2E78 , 0x00000000},
- {0x2E7C , 0x00000000},
- {0x2E80 , 0x00000000},
- {0x2E84 , 0x00000000},
- {0x2E88 , 0x00000000},
- {0x2E8C , 0x00000000},
- {0x2E90 , 0x00000000},
- {0x2E94 , 0x00000000},
- {0x2E98 , 0x00000000},
- {0x2E9C , 0x00000000},
- {0x2EA0 , 0x00000000},
- {0x2EA4 , 0x00000000},
- {0x2EA8 , 0x00000000},
- {0x2EAC , 0x00000000},
- {0x2EB0 , 0x00000000},
- {0x2EB4 , 0x00000000},
- {0x2EB8 , 0x00000000},
- {0x2EBC , 0x00000000},
- {0x2EC0 , 0x00000000},
- {0x2EC4 , 0x00000000},
- {0x2EC8 , 0x00000000},
- {0x2ECC , 0x00000000},
- {0x2ED0 , 0x00000000},
- {0x2ED4 , 0x00000000},
- {0x2ED8 , 0x00000000},
- {0x2EDC , 0x00000000},
- {0x2EE0 , 0x00000000},
- {0x2EE4 ,0x00000000},
- {0x2EE8 ,0x00000000},
- {0x2EEC , 0x00000000},
- {0x2EF0 , 0x00000000},
- {0x2EF4 , 0x00000000},
- {0x2EF8 , 0x00000000},
- {0x2EFC , 0x00000000},
- /*{0x2F60 , 0x00000000},*/
-};
-
-int initRegDataNum=sizeof(initRegData)/sizeof(RegData);
-
-typedef union {
- unsigned int i;
- float f;
-} dmaBufRec, *dmaBuf;
-
-void Init3D( tridentContextPtr tmesa )
-{
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
- int i;
-
- for(i=0;i<initRegDataNum;++i)
- MMIO_OUT32(MMIO, initRegData[i].addr, initRegData[i].data);
-}
-
-int DrawTriangle( tridentContextPtr tmesa)
-{
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
- dmaBufRec clr;
-
-printf("DRAW TRI\n");
- Init3D(tmesa);
-
-printf("ENGINE STATUS 0x%x\n",MMIO_IN32(MMIO, 0x2800));
- MMIO_OUT32(MMIO, 0x002800, 0x00000000 );
-#if 0
- MMIO_OUT32(MMIO, 0x002368 , MMIO_IN32(MMIO,0x002368)|1 );
-#endif
-
- MMIO_OUT32(MMIO, 0x002C00 , 0x00000014 );
-#if 0
- MMIO_OUT32(MMIO, 0x002C04 , 0x0A8004C0 );
-#else
- MMIO_OUT32(MMIO, 0x002C04 , 0x0A8000C0 );
-#endif
-
-#if 0
- MMIO_OUT32(MMIO, 0x002C08 , 0x00000000 );
- MMIO_OUT32(MMIO, 0x002C0C , 0xFFCCCCCC );
- MMIO_OUT32(MMIO, 0x002C10 , 0x3F800000 );
- MMIO_OUT32(MMIO, 0x002C14 , 0x3D0D3DCB );
- MMIO_OUT32(MMIO, 0x002C2C , 0x70000000 );
- MMIO_OUT32(MMIO, 0x002C24 , 0x00202C00 );
- MMIO_OUT32(MMIO, 0x002C28 , 0xE0002500 );
- MMIO_OUT32(MMIO, 0x002C30 , 0x00000000 );
- MMIO_OUT32(MMIO, 0x002C34 , 0xE0000000 );
- MMIO_OUT32(MMIO, 0x002C38 , 0x00000000 );
-#endif
-
- MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 );
- MMIO_OUT32(MMIO, 0x002C54 , 0x0C320C80 );
- MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 );
- MMIO_OUT32(MMIO, 0x002C54 , 0x0C320C80 );
- MMIO_OUT32(MMIO, 0x002C80 , 0x20008258 );
- MMIO_OUT32(MMIO, 0x002C84 , 0x20000320 );
- MMIO_OUT32(MMIO, 0x002C94 , 0xFFFFFFFF );
-
-#if 0
- MMIO_OUT32(MMIO, 0x002D00 , 0x00009009 );
- MMIO_OUT32(MMIO, 0x002D38 , 0x00000000 );
- MMIO_OUT32(MMIO, 0x002D94 , 0x20002000 );
- MMIO_OUT32(MMIO, 0x002D50 , 0xf0000000 );
- MMIO_OUT32(MMIO, 0x002D80 , 0x24002000 );
- MMIO_OUT32(MMIO, 0x002D98 , 0x81000000 );
- MMIO_OUT32(MMIO, 0x002DB0 , 0x81000000 );
- MMIO_OUT32(MMIO, 0x002DC8 , 0x808000FF );
- MMIO_OUT32(MMIO, 0x002DD4 , 0x02000200 );
- MMIO_OUT32(MMIO, 0x002DD8 , 0x02000200 );
- MMIO_OUT32(MMIO, 0x002D30 , 0x02092400 );
- MMIO_OUT32(MMIO, 0x002D04 , 0x00102120 );
- MMIO_OUT32(MMIO, 0x002D08 , 0xFFFFFFFF );
- MMIO_OUT32(MMIO, 0x002D0C , 0xF00010D0 );
- MMIO_OUT32(MMIO, 0x002D10 , 0xC0000400 );
-#endif
-
- MMIO_OUT32(MMIO, 0x002814, 0x00000000 );
-#if 0
- MMIO_OUT32(MMIO, 0x002818 , 0x00036C20 );
-#else
- MMIO_OUT32(MMIO, 0x002818 , 0x00036020 );
-#endif
- MMIO_OUT32(MMIO, 0x00281C , 0x00098081 );
-
-printf("first TRI\n");
- clr.f = 5.0;
- MMIO_OUT32(MMIO, 0x002820 , clr.i );
- clr.f = 595.0;
- MMIO_OUT32(MMIO, 0x002824 , clr.i );
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002828 , clr.i );
- MMIO_OUT32(MMIO, 0x00282C , 0x00FF00 );
-#if 0
- clr.f = 0.0;
- MMIO_OUT32(MMIO, 0x002830 , clr.i );
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002834 , clr.i );
-#endif
-
- clr.f = 5.0;
- MMIO_OUT32(MMIO, 0x002820 , clr.i );
- clr.f = 5.0;
- MMIO_OUT32(MMIO, 0x002824 , clr.i );
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002828 , clr.i );
- MMIO_OUT32(MMIO, 0x00282C , 0xFF0000 );
-#if 0
- clr.f = 0.0;
- MMIO_OUT32(MMIO, 0x002830 , clr.i );
- clr.f = 0.0;
- MMIO_OUT32(MMIO, 0x002834 , clr.i );
-#endif
-
- clr.f = 395.0;
-printf("0x%x\n",clr.i);
- MMIO_OUT32(MMIO, 0x002820 , clr.i );
- clr.f = 5.0;
- MMIO_OUT32(MMIO, 0x002824 , clr.i );
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002828 , clr.i );
- MMIO_OUT32(MMIO, 0x00282C , 0xFF );
-#if 0
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002830 , clr.i );
- clr.f = 0.0;
- MMIO_OUT32(MMIO, 0x002834 , clr.i );
-#endif
-
-printf("sec TRI\n");
- MMIO_OUT32(MMIO, 0x00281C , 0x00093980 );
- clr.f = 395.0;
- MMIO_OUT32(MMIO, 0x002820 , clr.i );
- clr.f = 595.0;
- MMIO_OUT32(MMIO, 0x002824 , clr.i );
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002828 , clr.i );
- MMIO_OUT32(MMIO, 0x00282C , 0x00FF00 );
-#if 0
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002830 , clr.i );
- clr.f = 1.0;
- MMIO_OUT32(MMIO, 0x002834 , clr.i );
-#endif
-
-#if 0
- MMIO_OUT32(MMIO, 0x002368 , MMIO_IN32(MMIO,0x002368)&0xfffffffe );
-#endif
-
-printf("fin TRI\n");
-
- return 0;
-}
-
-static INLINE void trident_draw_point(tridentContextPtr tmesa,
- const tridentVertex *v0 )
-{
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
- (void) MMIO;
-}
-
-static INLINE void trident_draw_line( tridentContextPtr tmesa,
- const tridentVertex *v0,
- const tridentVertex *v1 )
-{
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
- (void) MMIO;
-}
-
-static INLINE void trident_draw_triangle( tridentContextPtr tmesa,
- const tridentVertex *v0,
- const tridentVertex *v1,
- const tridentVertex *v2 )
-{
-}
-
-static INLINE void trident_draw_quad( tridentContextPtr tmesa,
- const tridentVertex *v0,
- const tridentVertex *v1,
- const tridentVertex *v2,
- const tridentVertex *v3 )
-{
- GLuint vertsize = tmesa->vertex_size;
- GLint coloridx = (vertsize > 4) ? 4 : 3;
- unsigned char *MMIO = tmesa->tridentScreen->mmio.map;
- int clr;
- float *ftmp = (float *)(&clr);
-
- if (tmesa->dirty)
- tridentUploadHwStateLocked( tmesa );
-#if 0
- DrawTriangle(tmesa);
- exit(0);
-#else
-#if 1
- if (first) {
- Init3D(tmesa);
-#if 0
- DrawTriangle(tmesa);
-#endif
- first = 0;
- }
-#endif
-
- LOCK_HARDWARE( tmesa );
-
- MMIO_OUT32(MMIO, 0x002C00 , 0x00000010 );
- MMIO_OUT32(MMIO, 0x002C04 , 0x029C00C0 );
-
- /* Z buffer */
- MMIO_OUT32(MMIO, 0x002C24 , 0x00100000 /*| (tmesa->tridentScreen->depthOffset)*/ );
- MMIO_OUT32(MMIO, 0x002C28 , 0xE0000000 | (tmesa->tridentScreen->depthPitch * 4) );
-
- /* front buffer */
- MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 | (tmesa->drawOffset) );
- MMIO_OUT32(MMIO, 0x002C54 , 0x0C320000 | (tmesa->drawPitch * 4) );
-
- /* clipper */
- MMIO_OUT32(MMIO, 0x002C80 , 0x20008000 | tmesa->tridentScreen->height );
- MMIO_OUT32(MMIO, 0x002C84 , 0x20000000 | tmesa->tridentScreen->width );
-
- /* writemask */
- MMIO_OUT32(MMIO, 0x002C94 , 0xFFFFFFFF );
-
-if (vertsize == 4) {
- MMIO_OUT32(MMIO, 0x002818 , 0x0003A020 );
- MMIO_OUT32(MMIO, 0x00281C , 0x00098021 );
-
- *ftmp = v0->v.x;
- MMIO_OUT32(MMIO, 0x002820 , clr );
- *ftmp = v0->v.y;
- MMIO_OUT32(MMIO, 0x002824 , clr );
- *ftmp = v0->v.z;
- MMIO_OUT32(MMIO, 0x002828 , clr );
-#if 0
- *ftmp = v0->v.w;
- MMIO_OUT32(MMIO, 0x00282C , clr );
-#endif
- MMIO_OUT32(MMIO, 0x00282C , v0->ui[coloridx] );
-
- *ftmp = v1->v.x;
- MMIO_OUT32(MMIO, 0x002820 , clr );
- *ftmp = v1->v.y;
- MMIO_OUT32(MMIO, 0x002824 , clr );
- *ftmp = v1->v.z;
- MMIO_OUT32(MMIO, 0x002828 , clr );
-#if 0
- *ftmp = v1->v.w;
- MMIO_OUT32(MMIO, 0x00282C , clr );
-#endif
- MMIO_OUT32(MMIO, 0x00282C , v1->ui[coloridx] );
-
- *ftmp = v2->v.x;
- MMIO_OUT32(MMIO, 0x002820 , clr );
- *ftmp = v2->v.y;
- MMIO_OUT32(MMIO, 0x002824 , clr );
- *ftmp = v2->v.z;
- MMIO_OUT32(MMIO, 0x002828 , clr );
-#if 0
- *ftmp = v2->v.w;
- MMIO_OUT32(MMIO, 0x00282C , clr );
-#endif
- MMIO_OUT32(MMIO, 0x00282C , v2->ui[coloridx] );
-
- MMIO_OUT32(MMIO, 0x00281C , 0x00093020 );
- *ftmp = v3->v.x;
- MMIO_OUT32(MMIO, 0x002820 , clr );
- *ftmp = v3->v.y;
- MMIO_OUT32(MMIO, 0x002824 , clr );
- *ftmp = v3->v.z;
- MMIO_OUT32(MMIO, 0x002828 , clr );
-#if 0
- *ftmp = v3->v.w;
- MMIO_OUT32(MMIO, 0x00282C , clr );
-#endif
- MMIO_OUT32(MMIO, 0x00282C , v3->ui[coloridx] );
-
-}
-#endif
-
- UNLOCK_HARDWARE( tmesa );
-}
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-#if 0
-static void
-trident_fallback_quad( tridentContextPtr tmesa,
- const tridentVertex *v0,
- const tridentVertex *v1,
- const tridentVertex *v2,
- const tridentVertex *v3 )
-{
- GLcontext *ctx = tmesa->glCtx;
- SWvertex v[4];
- trident_translate_vertex( ctx, v0, &v[0] );
- trident_translate_vertex( ctx, v1, &v[1] );
- trident_translate_vertex( ctx, v2, &v[2] );
- trident_translate_vertex( ctx, v3, &v[3] );
- _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] );
-}
-#endif
-
-/* XXX hack to get the prototype defined in time... */
-void trident_translate_vertex(GLcontext *ctx, const tridentVertex *src,
- SWvertex *dst);
-
-static void
-trident_fallback_tri( tridentContextPtr tmesa,
- const tridentVertex *v0,
- const tridentVertex *v1,
- const tridentVertex *v2 )
-{
- GLcontext *ctx = tmesa->glCtx;
- SWvertex v[3];
- trident_translate_vertex( ctx, v0, &v[0] );
- trident_translate_vertex( ctx, v1, &v[1] );
- trident_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-static void
-trident_fallback_line( tridentContextPtr tmesa,
- const tridentVertex *v0,
- const tridentVertex *v1 )
-{
- GLcontext *ctx = tmesa->glCtx;
- SWvertex v[2];
- trident_translate_vertex( ctx, v0, &v[0] );
- trident_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-trident_fallback_point( tridentContextPtr tmesa,
- const tridentVertex *v0 )
-{
- GLcontext *ctx = tmesa->glCtx;
- SWvertex v[1];
- trident_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- tmesa->draw_tri( tmesa, a, b, c ); \
- else \
- trident_draw_triangle( tmesa, a, b, c ); \
-} while (0)
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- tmesa->draw_tri( tmesa, a, b, d ); \
- tmesa->draw_tri( tmesa, b, c, d ); \
- } else \
- trident_draw_quad( tmesa, a, b, c, d ); \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- tmesa->draw_line( tmesa, v0, v1 ); \
- else \
- trident_draw_line( tmesa, v0, v1 ); \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- tmesa->draw_point( tmesa, v0 ); \
- else \
- trident_draw_point( tmesa, v0 ); \
-} while (0)
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define TRIDENT_OFFSET_BIT 0x01
-#define TRIDENT_TWOSIDE_BIT 0x02
-#define TRIDENT_UNFILLED_BIT 0x04
-#define TRIDENT_FALLBACK_BIT 0x08
-#define TRIDENT_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[TRIDENT_MAX_TRIFUNC];
-
-
-#define DO_FALLBACK (IND & TRIDENT_FALLBACK_BIT)
-#define DO_OFFSET (IND & TRIDENT_OFFSET_BIT)
-#define DO_UNFILLED (IND & TRIDENT_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & TRIDENT_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX tridentVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (tmesa->verts + (e<<tmesa->vertex_stride_shift))
-
-#define TRIDENT_COLOR( dst, src ) \
-do { \
- dst[0] = src[2]; \
- dst[1] = src[1]; \
- dst[2] = src[0]; \
- dst[3] = src[3]; \
-} while (0)
-
-#define TRIDENT_SPEC( dst, src ) \
-do { \
- dst[0] = src[2]; \
- dst[1] = src[1]; \
- dst[2] = src[0]; \
-} while (0)
-
-#define VERT_SET_RGBA( v, c ) TRIDENT_COLOR( v->ub4[coloroffset], c )
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-
-#define VERT_SET_SPEC( v, c ) if (havespec) TRIDENT_SPEC( v->ub4[5], c )
-#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V(v0->ub4[5], v1->ub4[5])
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
-
-#define LOCAL_VARS(n) \
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = (tmesa->vertex_size == 4 ? 3 : 4); \
- GLboolean havespec = (tmesa->vertex_size == 4 ? 0 : 1); \
- (void) color; (void) spec; (void) coloroffset; (void) havespec;
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-#if 0
-static const GLuint hw_prim[GL_POLYGON+1] = {
- B_PrimType_Points,
- B_PrimType_Lines,
- B_PrimType_Lines,
- B_PrimType_Lines,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles,
- B_PrimType_Triangles
-};
-#endif
-
-static void tridentResetLineStipple( GLcontext *ctx );
-#if 0
-static void tridentRasterPrimitive( GLcontext *ctx, GLuint hwprim );
-#endif
-static void tridentRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-#define RASTERIZE(x) /*if (tmesa->hw_primitive != hw_prim[x]) \
- tridentRasterPrimitive( ctx, hw_prim[x] ) */
-#define RENDER_PRIMITIVE tmesa->render_primitive
-#define TAG(x) x
-#define IND TRIDENT_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_OFFSET_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-}
-
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-
-#define VERT(x) (tridentVertex *)(tridentverts + (x << shift))
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- trident_draw_point( tmesa, VERT(start) )
-#define RENDER_LINE( v0, v1 ) \
- trident_draw_line( tmesa, VERT(v0), VERT(v1) )
-#define RENDER_TRI( v0, v1, v2 ) \
- trident_draw_triangle( tmesa, VERT(v0), VERT(v1), VERT(v2) )
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- trident_draw_quad( tmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
-#define INIT(x) tridentRenderPrimitive( ctx, x );
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); \
- const GLuint shift = tmesa->vertex_stride_shift; \
- const char *tridentverts = (char *)tmesa->verts; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-#define RESET_STIPPLE if ( stipple ) tridentResetLineStipple( ctx );
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) (x)
-#define TAG(x) trident_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) trident_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-static void tridentRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint prim = tmesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void tridentRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line( ctx, ii, jj );
-}
-
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-#define _TRIDENT_NEW_RENDER_STATE (_DD_NEW_LINE_STIPPLE | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_POINT_SMOOTH | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET) \
-
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH)
-#define TRI_FALLBACK (DD_TRI_SMOOTH)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-
-static void tridentChooseRenderState(GLcontext *ctx)
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) {
- tmesa->draw_point = trident_draw_point;
- tmesa->draw_line = trident_draw_line;
- tmesa->draw_tri = trident_draw_triangle;
-
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= TRIDENT_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= TRIDENT_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= TRIDENT_UNFILLED_BIT;
- }
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)) {
- if (flags & POINT_FALLBACK) tmesa->draw_point = trident_fallback_point;
- if (flags & LINE_FALLBACK) tmesa->draw_line = trident_fallback_line;
- if (flags & TRI_FALLBACK) tmesa->draw_tri = trident_fallback_tri;
- index |= TRIDENT_FALLBACK_BIT;
- }
- }
-
- if (tmesa->RenderIndex != index) {
- tmesa->RenderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (tmesa->RenderIndex == 0) {
- tnl->Driver.Render.PrimTabVerts = trident_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = trident_render_tab_elts;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- }
- tnl->Driver.Render.ClippedLine = tridentRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = tridentRenderClippedPoly;
- }
-}
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- *
- * Used only for the default render stage which always decomposes
- * primitives to trianges/lines/points. For the accelerated stage,
- * which renders strips as strips, the equivalent calculations are
- * performed in tridentrender.c.
- */
-#if 0
-static void tridentRasterPrimitive( GLcontext *ctx, GLuint hwprim )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- if (tmesa->hw_primitive != hwprim)
- tmesa->hw_primitive = hwprim;
-}
-#endif
-
-static void tridentRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- tmesa->render_primitive = prim;
-}
-
-static void tridentRunPipeline( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
-
- if ( tmesa->new_state )
- tridentDDUpdateHWState( ctx );
-
- if (tmesa->new_gl_state) {
-#if 0
- if (tmesa->new_gl_state & _NEW_TEXTURE)
- tridentUpdateTextureState( ctx );
-#endif
-
- if (!tmesa->Fallback) {
- if (tmesa->new_gl_state & _TRIDENT_NEW_VERTEX)
- tridentChooseVertexState( ctx );
-
- if (tmesa->new_gl_state & _TRIDENT_NEW_RENDER_STATE)
- tridentChooseRenderState( ctx );
- }
-
- tmesa->new_gl_state = 0;
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-static void tridentRenderStart( GLcontext *ctx )
-{
- /* Check for projective texturing. Make sure all texcoord
- * pointers point to something. (fix in mesa?)
- */
- tridentCheckTexSizes( ctx );
-}
-
-static void tridentRenderFinish( GLcontext *ctx )
-{
- if (0)
- _swrast_flush( ctx ); /* never needed */
-}
-
-static void tridentResetLineStipple( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- (void) tmesa;
-
- /* Reset the hardware stipple counter.
- */
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-
-void tridentFallback( tridentContextPtr tmesa, GLuint bit, GLboolean mode )
-{
- GLcontext *ctx = tmesa->glCtx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = tmesa->Fallback;
-
- _tnl_need_projected_coords( ctx, GL_FALSE );
-
- if (mode) {
- tmesa->Fallback |= bit;
- if (oldfallback == 0) {
- _swsetup_Wakeup( ctx );
- tmesa->RenderIndex = ~0;
- }
- }
- else {
- tmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = tridentRenderStart;
- tnl->Driver.Render.PrimitiveNotify = tridentRenderPrimitive;
- tnl->Driver.Render.Finish = tridentRenderFinish;
- tnl->Driver.Render.BuildVertices = tridentBuildVertices;
- tnl->Driver.Render.ResetLineStipple = tridentResetLineStipple;
- tmesa->new_gl_state |= (_TRIDENT_NEW_RENDER_STATE|
- _TRIDENT_NEW_VERTEX);
- }
- }
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-
-void tridentDDInitTriFuncs( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tmesa->RenderIndex = ~0;
-
- tnl->Driver.RunPipeline = tridentRunPipeline;
- tnl->Driver.Render.Start = tridentRenderStart;
- tnl->Driver.Render.Finish = tridentRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = tridentRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = tridentResetLineStipple;
- tnl->Driver.Render.BuildVertices = tridentBuildVertices;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_vb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_vb.c
deleted file mode 100644
index 77e4d9b76..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/trident/trident_vb.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- *
- * Trident CyberBladeXP driver.
- *
- */
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/swrast.h"
-#include "tnl/t_context.h"
-#include "tnl/tnl.h"
-
-#include "trident_context.h"
-
-#define TRIDENT_TEX1_BIT 0x1
-#define TRIDENT_TEX0_BIT 0x2
-#define TRIDENT_RGBA_BIT 0x4
-#define TRIDENT_SPEC_BIT 0x8
-#define TRIDENT_FOG_BIT 0x10
-#define TRIDENT_XYZW_BIT 0x20
-#define TRIDENT_PTEX_BIT 0x40
-#define TRIDENT_MAX_SETUP 0x80
-
-static struct {
- void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
- tnl_interp_func interp;
- tnl_copy_pv_func copy_pv;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
- GLuint vertex_size;
- GLuint vertex_stride_shift;
- GLuint vertex_format;
-} setup_tab[TRIDENT_MAX_SETUP];
-
-#define TINY_VERTEX_FORMAT 1
-#define NOTEX_VERTEX_FORMAT 2
-#define TEX0_VERTEX_FORMAT 3
-#define TEX1_VERTEX_FORMAT 4
-#define PROJ_TEX1_VERTEX_FORMAT 5
-#define TEX2_VERTEX_FORMAT 6
-#define TEX3_VERTEX_FORMAT 7
-#define PROJ_TEX3_VERTEX_FORMAT 8
-
-#define DO_XYZW (IND & TRIDENT_XYZW_BIT)
-#define DO_RGBA (IND & TRIDENT_RGBA_BIT)
-#define DO_SPEC (IND & TRIDENT_SPEC_BIT)
-#define DO_FOG (IND & TRIDENT_FOG_BIT)
-#define DO_TEX0 (IND & TRIDENT_TEX0_BIT)
-#define DO_TEX1 (IND & TRIDENT_TEX1_BIT)
-#define DO_TEX2 0
-#define DO_TEX3 0
-#define DO_PTEX (IND & TRIDENT_PTEX_BIT)
-
-#define VERTEX tridentVertex
-#define VERTEX_COLOR trident_color_t
-#define LOCALVARS tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
-#define GET_VIEWPORT_MAT() tmesa->hw_viewport
-#define GET_TEXSOURCE(n) tmesa->tmu_source[n]
-#define GET_VERTEX_FORMAT() tmesa->vertex_format
-#define GET_VERTEX_SIZE() tmesa->vertex_size
-#define GET_VERTEX_STORE() tmesa->verts
-#define GET_VERTEX_STRIDE_SHIFT() tmesa->vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &tmesa->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &tmesa->UbyteSecondaryColor
-
-#define HAVE_HW_VIEWPORT 0
-#define HAVE_HW_DIVIDE 0
-#define HAVE_RGBA_COLOR 0
-#define HAVE_TINY_VERTICES 1
-#define HAVE_NOTEX_VERTICES 1
-#define HAVE_TEX0_VERTICES 1
-#define HAVE_TEX1_VERTICES 1
-#define HAVE_TEX2_VERTICES 0
-#define HAVE_TEX3_VERTICES 0
-#define HAVE_PTEX_VERTICES 0
-
-#define UNVIEWPORT_VARS \
- const GLfloat dx = - tmesa->drawX - SUBPIXEL_X; \
- const GLfloat dy = (tmesa->driDrawable->h + \
- tmesa->drawY + SUBPIXEL_Y); \
- const GLfloat sz = 1.0 / tmesa->depth_scale
-
-#define UNVIEWPORT_X(x) x + dx;
-#define UNVIEWPORT_Y(y) - y + dy;
-#define UNVIEWPORT_Z(z) z * sz;
-
-#define PTEX_FALLBACK() tridentFallback(TRIDENT_CONTEXT(ctx), TRIDENT_FALLBACK_TEXTURE, 1)
-
-#define IMPORT_FLOAT_COLORS trident_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS trident_import_float_spec_colors
-
-#define INTERP_VERTEX setup_tab[tmesa->SetupIndex].interp
-#define COPY_PV_VERTEX setup_tab[tmesa->SetupIndex].copy_pv
-
-/***********************************************************************
- * Generate pv-copying and translation functions *
- ***********************************************************************/
-
-#define TAG(x) trident_##x
-#include "tnl_dd/t_dd_vb.c"
-
-/***********************************************************************
- * Generate vertex emit and interp functions *
- ***********************************************************************/
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT)
-#define TAG(x) x##_wg
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT)
-#define TAG(x) x##_wgs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_wgt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_wgt0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT)
-#define TAG(x) x##_wgpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_wgst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_wgst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT)
-#define TAG(x) x##_wgspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT)
-#define TAG(x) x##_wgf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT)
-#define TAG(x) x##_wgfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_wgft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_wgft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT)
-#define TAG(x) x##_wgfpt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_wgfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_wgfst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT)
-#define TAG(x) x##_wgfspt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_TEX0_BIT)
-#define TAG(x) x##_t0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_t0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_FOG_BIT)
-#define TAG(x) x##_f
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_ft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_ft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT)
-#define TAG(x) x##_g
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT)
-#define TAG(x) x##_gs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_gt0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_gt0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_gst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_gst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT)
-#define TAG(x) x##_gf
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT)
-#define TAG(x) x##_gfs
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_gft0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_gft0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT)
-#define TAG(x) x##_gfst0
-#include "tnl_dd/t_dd_vbtmp.h"
-
-#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT)
-#define TAG(x) x##_gfst0t1
-#include "tnl_dd/t_dd_vbtmp.h"
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wgs();
- init_wgt0();
- init_wgt0t1();
- init_wgpt0();
- init_wgst0();
- init_wgst0t1();
- init_wgspt0();
- init_wgf();
- init_wgfs();
- init_wgft0();
- init_wgft0t1();
- init_wgfpt0();
- init_wgfst0();
- init_wgfst0t1();
- init_wgfspt0();
- init_t0();
- init_t0t1();
- init_f();
- init_ft0();
- init_ft0t1();
- init_g();
- init_gs();
- init_gt0();
- init_gt0t1();
- init_gst0();
- init_gst0t1();
- init_gf();
- init_gfs();
- init_gft0();
- init_gft0t1();
- init_gfst0();
- init_gfst0t1();
-}
-
-void tridentBuildVertices( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint newinputs )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)tmesa->verts + (start<<tmesa->vertex_stride_shift));
- GLuint stride = 1<<tmesa->vertex_stride_shift;
-
- newinputs |= tmesa->SetupNewInputs;
- tmesa->SetupNewInputs = 0;
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[tmesa->SetupIndex].emit( ctx, start, count, v, stride );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= TRIDENT_RGBA_BIT;
-
- if (newinputs & VERT_BIT_COLOR1)
- ind |= TRIDENT_SPEC_BIT;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= TRIDENT_TEX0_BIT;
-
- if (newinputs & VERT_BIT_TEX1)
- ind |= TRIDENT_TEX1_BIT;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= TRIDENT_FOG_BIT;
-
- if (tmesa->SetupIndex & TRIDENT_PTEX_BIT)
- ind = ~0;
-
- ind &= tmesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, count, v, stride );
- }
- }
-}
-
-void tridentCheckTexSizes( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx );
-
- if (!setup_tab[tmesa->SetupIndex].check_tex_sizes(ctx)) {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- /* Invalidate stored verts
- */
- tmesa->SetupNewInputs = ~0;
- tmesa->SetupIndex |= TRIDENT_PTEX_BIT;
-
- if (!tmesa->Fallback &&
- !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[tmesa->SetupIndex].interp;
- tnl->Driver.Render.CopyPV = setup_tab[tmesa->SetupIndex].copy_pv;
- }
- }
-}
-
-void tridentChooseVertexState( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint ind = TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT;
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- ind |= TRIDENT_SPEC_BIT;
-
- if (ctx->Fog.Enabled)
- ind |= TRIDENT_FOG_BIT;
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- ind |= TRIDENT_TEX0_BIT;
- if (ctx->Texture.Unit[1]._ReallyEnabled) {
- ind |= TRIDENT_TEX1_BIT;
- }
- }
-
- tmesa->SetupIndex = ind;
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = trident_interp_extras;
- tnl->Driver.Render.CopyPV = trident_copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-
- if (setup_tab[ind].vertex_format != tmesa->vertex_format) {
- tmesa->vertex_format = setup_tab[ind].vertex_format;
- tmesa->vertex_size = setup_tab[ind].vertex_size;
- tmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
- }
-}
-
-void tridentInitVB( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
-
- tmesa->verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 );
-
- {
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
- }
-}
-
-void tridentFreeVB( GLcontext *ctx )
-{
- tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
-
- if (tmesa->verts) {
- ALIGN_FREE(tmesa->verts);
- tmesa->verts = 0;
- }
-
- if (tmesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE((void *)tmesa->UbyteSecondaryColor.Ptr);
- tmesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (tmesa->UbyteColor.Ptr) {
- ALIGN_FREE((void *)tmesa->UbyteColor.Ptr);
- tmesa->UbyteColor.Ptr = 0;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/Makefile
deleted file mode 100644
index 5fe00c1bd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# src/mesa/drivers/dri/unichrome/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = unichrome_dri.so
-
-MINIGLX_SOURCES = server/via_dri.c
-
-DRIVER_SOURCES = \
- via_context.c \
- via_fb.c \
- via_tex.c \
- via_ioctl.c \
- via_memcpy.c \
- via_render.c \
- via_screen.c \
- via_span.c \
- via_state.c \
- via_texcombine.c \
- via_tris.c
-
-C_SOURCES = \
- $(COMMON_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-
-include ../Makefile.template
-
-symlinks:
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via.h
deleted file mode 100644
index 2cfe6631e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __VIA_H__
-#define __VIA_H__
-
-typedef struct VIAInfo
-{
- size_t registerSize;
- void * registerHandle;
- void * data;
-} * VIAInfoPtr;
-
-#endif /* __VIA_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.c
deleted file mode 100644
index d7217d205..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.c
+++ /dev/null
@@ -1,1252 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v 1.4 2003/09/24 02:43:30 dawes Exp $ */
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include "driver.h"
-#include "drm.h"
-#include "imports.h"
-
-#include "dri_util.h"
-
-#include "via_context.h"
-#include "via_dri.h"
-#include "via_driver.h"
-#include "via_common.h"
-#include "xf86drm.h"
-
-static void VIAEnableMMIO(DRIDriverContext * ctx);
-static void VIADisableMMIO(DRIDriverContext * ctx);
-static void VIADisableExtendedFIFO(DRIDriverContext *ctx);
-static void VIAEnableExtendedFIFO(DRIDriverContext *ctx);
-static void VIAInitialize2DEngine(DRIDriverContext *ctx);
-static void VIAInitialize3DEngine(DRIDriverContext *ctx);
-
-static int VIADRIScreenInit(DRIDriverContext * ctx);
-static void VIADRICloseScreen(DRIDriverContext * ctx);
-static int VIADRIFinishScreenInit(DRIDriverContext * ctx);
-
-/* _SOLO : missing macros normally defined by X code */
-#define xf86DrvMsg(a, b, ...) fprintf(stderr, __VA_ARGS__)
-#define MMIO_IN8(base, addr) ((*(((volatile u_int8_t*)base)+(addr)))+0)
-#define MMIO_OUT8(base, addr, val) ((*(((volatile u_int8_t*)base)+(addr)))=((u_int8_t)val))
-#define MMIO_OUT16(base, addr, val) ((*(volatile u_int16_t*)(((u_int8_t*)base)+(addr)))=((u_int16_t)val))
-
-#define VIDEO 0
-#define AGP 1
-#define AGP_PAGE_SIZE 4096
-#define AGP_PAGES 8192
-#define AGP_SIZE (AGP_PAGE_SIZE * AGP_PAGES)
-#define AGP_CMDBUF_PAGES 512
-#define AGP_CMDBUF_SIZE (AGP_PAGE_SIZE * AGP_CMDBUF_PAGES)
-
-static char VIAKernelDriverName[] = "via";
-static char VIAClientDriverName[] = "unichrome";
-
-static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia);
-static int VIADRIPciInit(DRIDriverContext * ctx, VIAPtr pVia);
-static int VIADRIFBInit(DRIDriverContext * ctx, VIAPtr pVia);
-static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia);
-static int VIADRIMapInit(DRIDriverContext * ctx, VIAPtr pVia);
-
-static void VIADRIIrqInit( DRIDriverContext *ctx )
-{
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI = pVia->devPrivate;
-
- pVIADRI->irqEnabled = drmGetInterruptFromBusID(pVia->drmFD,
- ctx->pciBus,
- ctx->pciDevice,
- ctx->pciFunc);
-
- if ((drmCtlInstHandler(pVia->drmFD, pVIADRI->irqEnabled))) {
- xf86DrvMsg(pScreen->myNum, X_WARNING,
- "[drm] Failure adding irq handler. "
- "Falling back to irq-free operation.\n");
- pVIADRI->irqEnabled = 0;
- }
-
- if (pVIADRI->irqEnabled)
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] Irq handler installed, using IRQ %d.\n",
- pVIADRI->irqEnabled);
-}
-
-static void VIADRIIrqExit( DRIDriverContext *ctx ) {
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI = pVia->devPrivate;
-
- if (pVIADRI->irqEnabled) {
- if (drmCtlUninstHandler(pVia->drmFD)) {
- xf86DrvMsg(pScreen-myNum, X_INFO,"[drm] Irq handler uninstalled.\n");
- } else {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] Could not uninstall irq handler.\n");
- }
- }
-}
-
-static void VIADRIRingBufferCleanup(DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI = pVia->devPrivate;
- drm_via_dma_init_t ringBufInit;
-
- if (pVIADRI->ringBufActive) {
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] Cleaning up DMA ring-buffer.\n");
- ringBufInit.func = VIA_CLEANUP_DMA;
- if (drmCommandWrite(pVia->drmFD, DRM_VIA_DMA_INIT, &ringBufInit,
- sizeof(ringBufInit))) {
- xf86DrvMsg(pScreen->myNum, X_WARNING,
- "[drm] Failed to clean up DMA ring-buffer: %d\n", errno);
- }
- pVIADRI->ringBufActive = 0;
- }
-}
-
-static int VIADRIRingBufferInit(DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI = pVia->devPrivate;
- drm_via_dma_init_t ringBufInit;
- drmVersionPtr drmVer;
-
- pVIADRI->ringBufActive = 0;
-
- if (NULL == (drmVer = drmGetVersion(pVia->drmFD))) {
- return GL_FALSE;
- }
-
- if (((drmVer->version_major <= 1) && (drmVer->version_minor <= 3))) {
- return GL_FALSE;
- }
-
- /*
- * Info frome code-snippet on DRI-DEVEL list; Erdi Chen.
- */
-
- switch (pVia->ChipId) {
- case PCI_CHIP_VT3259:
- ringBufInit.reg_pause_addr = 0x40c;
- break;
- default:
- ringBufInit.reg_pause_addr = 0x418;
- break;
- }
-
- ringBufInit.offset = pVia->agpSize;
- ringBufInit.size = AGP_CMDBUF_SIZE;
- ringBufInit.func = VIA_INIT_DMA;
- if (drmCommandWrite(pVia->drmFD, DRM_VIA_DMA_INIT, &ringBufInit,
- sizeof(ringBufInit))) {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] Failed to initialize DMA ring-buffer: %d\n", errno);
- return GL_FALSE;
- }
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] Initialized AGP ring-buffer, size 0x%lx at AGP offset 0x%lx.\n",
- ringBufInit.size, ringBufInit.offset);
-
- pVIADRI->ringBufActive = 1;
- return GL_TRUE;
-}
-
-static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia)
-{
- unsigned long agp_phys;
- drmAddress agpaddr;
- VIADRIPtr pVIADRI;
- pVIADRI = pVia->devPrivate;
- pVia->agpSize = 0;
-
- if (drmAgpAcquire(pVia->drmFD) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAcquire failed %d\n", errno);
- return GL_FALSE;
- }
-
- if (drmAgpEnable(pVia->drmFD, drmAgpGetMode(pVia->drmFD)&~0x0) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpEnable failed\n");
- return GL_FALSE;
- }
-
- xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] drmAgpEnabled succeeded\n");
-
- if (drmAgpAlloc(pVia->drmFD, AGP_SIZE, 0, &agp_phys, &pVia->agpHandle) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] drmAgpAlloc failed\n");
- drmAgpRelease(pVia->drmFD);
- return GL_FALSE;
- }
-
- if (drmAgpBind(pVia->drmFD, pVia->agpHandle, 0) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] drmAgpBind failed\n");
- drmAgpFree(pVia->drmFD, pVia->agpHandle);
- drmAgpRelease(pVia->drmFD);
-
- return GL_FALSE;
- }
-
- /*
- * Place the ring-buffer last in the AGP region, and restrict the
- * public map not to include the buffer for security reasons.
- */
-
- pVia->agpSize = AGP_SIZE - AGP_CMDBUF_SIZE;
- pVia->agpAddr = drmAgpBase(pVia->drmFD);
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] agpAddr = 0x%08lx\n",pVia->agpAddr);
-
- pVIADRI->agp.size = pVia->agpSize;
- if (drmAddMap(pVia->drmFD, (drm_handle_t)0,
- pVIADRI->agp.size, DRM_AGP, 0,
- &pVIADRI->agp.handle) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] Failed to map public agp area\n");
- pVIADRI->agp.size = 0;
- return GL_FALSE;
- }
- /* Map AGP from kernel to Xserver - Not really needed */
- drmMap(pVia->drmFD, pVIADRI->agp.handle,pVIADRI->agp.size, &agpaddr);
-
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] agpAddr = 0x%08lx\n", pVia->agpAddr);
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] agpSize = 0x%08lx\n", pVia->agpSize);
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] agp physical addr = 0x%08lx\n", agp_phys);
-
- {
- drm_via_agp_t agp;
- agp.offset = 0;
- agp.size = AGP_SIZE-AGP_CMDBUF_SIZE;
- if (drmCommandWrite(pVia->drmFD, DRM_VIA_AGP_INIT, &agp,
- sizeof(drm_via_agp_t)) < 0) {
- drmUnmap(&agpaddr,pVia->agpSize);
- drmRmMap(pVia->drmFD,pVIADRI->agp.handle);
- drmAgpUnbind(pVia->drmFD, pVia->agpHandle);
- drmAgpFree(pVia->drmFD, pVia->agpHandle);
- drmAgpRelease(pVia->drmFD);
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-static int VIADRIFBInit(DRIDriverContext * ctx, VIAPtr pVia)
-{
- int FBSize = pVia->FBFreeEnd-pVia->FBFreeStart;
- int FBOffset = pVia->FBFreeStart;
- VIADRIPtr pVIADRI = pVia->devPrivate;
- pVIADRI->fbOffset = FBOffset;
- pVIADRI->fbSize = pVia->videoRambytes;
-
- {
- drm_via_fb_t fb;
- fb.offset = FBOffset;
- fb.size = FBSize;
-
- if (drmCommandWrite(pVia->drmFD, DRM_VIA_FB_INIT, &fb,
- sizeof(drm_via_fb_t)) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] failed to init frame buffer area\n");
- return GL_FALSE;
- } else {
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] FBFreeStart= 0x%08x FBFreeEnd= 0x%08x "
- "FBSize= 0x%08x\n",
- pVia->FBFreeStart, pVia->FBFreeEnd, FBSize);
- return GL_TRUE;
- }
- }
-}
-
-static int VIADRIPciInit(DRIDriverContext * ctx, VIAPtr pVia)
-{
- return GL_TRUE;
-}
-
-static int VIADRIScreenInit(DRIDriverContext * ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI;
- int err;
-
-#if 0
- ctx->shared.SAREASize = ((sizeof(drm_sarea_t) + 0xfff) & 0x1000);
-#else
- if (sizeof(drm_sarea_t)+sizeof(drm_via_sarea_t) > SAREA_MAX) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Data does not fit in SAREA\n");
- return GL_FALSE;
- }
- ctx->shared.SAREASize = SAREA_MAX;
-#endif
-
- ctx->drmFD = drmOpen(VIAKernelDriverName, NULL);
- if (ctx->drmFD < 0) {
- fprintf(stderr, "[drm] drmOpen failed\n");
- return 0;
- }
- pVia->drmFD = ctx->drmFD;
-
- err = drmSetBusid(ctx->drmFD, ctx->pciBusID);
- if (err < 0) {
- fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
- return 0;
- }
-
- err = drmAddMap(ctx->drmFD, 0, ctx->shared.SAREASize, DRM_SHM,
- DRM_CONTAINS_LOCK, &ctx->shared.hSAREA);
- if (err < 0) {
- fprintf(stderr, "[drm] drmAddMap failed\n");
- return 0;
- }
- fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
-
- if (drmMap(ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
- fprintf(stderr, "[drm] drmMap failed\n");
- return 0;
- }
- memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
- fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
- /* Need to AddMap the framebuffer and mmio regions here:
- */
- if (drmAddMap(ctx->drmFD,
- (drm_handle_t)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
-#ifndef _EMBEDDED
- 0,
-#else
- DRM_READ_ONLY,
-#endif
- &ctx->shared.hFrameBuffer) < 0)
- {
- fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
- return 0;
- }
-
- fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
-
- pVIADRI = (VIADRIPtr) CALLOC(sizeof(VIADRIRec));
- if (!pVIADRI) {
- drmClose(ctx->drmFD);
- return GL_FALSE;
- }
- pVia->devPrivate = pVIADRI;
- ctx->driverClientMsg = pVIADRI;
- ctx->driverClientMsgSize = sizeof(*pVIADRI);
-
- /* DRIScreenInit doesn't add all the common mappings. Add additional mappings here. */
- if (!VIADRIMapInit(ctx, pVia)) {
- VIADRICloseScreen(ctx);
- return GL_FALSE;
- }
-
- pVIADRI->regs.size = VIA_MMIO_REGSIZE;
- pVIADRI->regs.handle = pVia->registerHandle;
- xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] mmio Registers = 0x%08lx\n",
- pVIADRI->regs.handle);
-
- if (drmMap(pVia->drmFD,
- pVIADRI->regs.handle,
- pVIADRI->regs.size,
- (drmAddress *)&pVia->MapBase) != 0)
- {
- VIADRICloseScreen(ctx);
- return GL_FALSE;
- }
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] mmio mapped.\n" );
-
- VIAEnableMMIO(ctx);
-
- /* Get video memory clock. */
- VGAOUT8(0x3D4, 0x3D);
- pVia->MemClk = (VGAIN8(0x3D5) & 0xF0) >> 4;
- xf86DrvMsg(0, X_INFO, "[dri] MemClk (0x%x)\n", pVia->MemClk);
-
- /* 3D rendering has noise if not enabled. */
- VIAEnableExtendedFIFO(ctx);
-
- VIAInitialize2DEngine(ctx);
-
- /* Must disable MMIO or 3D won't work. */
- VIADisableMMIO(ctx);
-
- VIAInitialize3DEngine(ctx);
-
- pVia->IsPCI = !VIADRIAgpInit(ctx, pVia);
-
- if (pVia->IsPCI) {
- VIADRIPciInit(ctx, pVia);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] use pci.\n" );
- }
- else
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] use agp.\n" );
-
- if (!(VIADRIFBInit(ctx, pVia))) {
- VIADRICloseScreen(ctx);
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] frame buffer initialize fail .\n" );
- return GL_FALSE;
- }
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] frame buffer initialized.\n" );
-
- return VIADRIFinishScreenInit(ctx);
-}
-
-static void
-VIADRICloseScreen(DRIDriverContext * ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI=(VIADRIPtr)pVia->devPrivate;
-
- VIADRIRingBufferCleanup(ctx);
-
- if (pVia->MapBase) {
- xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Unmapping MMIO registers\n");
- drmUnmap(pVia->MapBase, pVIADRI->regs.size);
- }
-
- if (pVia->agpSize) {
- xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing agp memory\n");
- drmAgpFree(pVia->drmFD, pVia->agpHandle);
- xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing agp module\n");
- drmAgpRelease(pVia->drmFD);
- }
-
-#if 0
- if (pVia->DRIIrqEnable)
-#endif
- VIADRIIrqExit(ctx);
-}
-
-static int
-VIADRIFinishScreenInit(DRIDriverContext * ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- VIADRIPtr pVIADRI;
- int err;
-
- err = drmCreateContext(ctx->drmFD, &ctx->serverContext);
- if (err != 0) {
- fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err);
- return GL_FALSE;
- }
-
- DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0);
-
-
- if (!VIADRIKernelInit(ctx, pVia)) {
- VIADRICloseScreen(ctx);
- return GL_FALSE;
- }
- xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] kernel data initialized.\n");
-
- /* set SAREA value */
- {
- drm_via_sarea_t *saPriv;
-
- saPriv=(drm_via_sarea_t*)(((char*)ctx->pSAREA) +
- sizeof(drm_sarea_t));
- assert(saPriv);
- memset(saPriv, 0, sizeof(*saPriv));
- saPriv->ctxOwner = -1;
- }
- pVIADRI=(VIADRIPtr)pVia->devPrivate;
- pVIADRI->deviceID=pVia->Chipset;
- pVIADRI->width=ctx->shared.virtualWidth;
- pVIADRI->height=ctx->shared.virtualHeight;
- pVIADRI->mem=ctx->shared.fbSize;
- pVIADRI->bytesPerPixel= (ctx->bpp+7) / 8;
- pVIADRI->sarea_priv_offset = sizeof(drm_sarea_t);
- /* TODO */
- pVIADRI->scrnX=pVIADRI->width;
- pVIADRI->scrnY=pVIADRI->height;
-
- /* Initialize IRQ */
-#if 0
- if (pVia->DRIIrqEnable)
-#endif
- VIADRIIrqInit(ctx);
-
- pVIADRI->ringBufActive = 0;
- VIADRIRingBufferInit(ctx);
-
- return GL_TRUE;
-}
-
-/* Initialize the kernel data structures. */
-static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia)
-{
- drm_via_init_t drmInfo;
- memset(&drmInfo, 0, sizeof(drm_via_init_t));
- drmInfo.sarea_priv_offset = sizeof(drm_sarea_t);
- drmInfo.func = VIA_INIT_MAP;
- drmInfo.fb_offset = pVia->FrameBufferBase;
- drmInfo.mmio_offset = pVia->registerHandle;
- if (pVia->IsPCI)
- drmInfo.agpAddr = (u_int32_t)NULL;
- else
- drmInfo.agpAddr = (u_int32_t)pVia->agpAddr;
-
- if ((drmCommandWrite(pVia->drmFD, DRM_VIA_MAP_INIT,&drmInfo,
- sizeof(drm_via_init_t))) < 0)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-/* Add a map for the MMIO registers */
-static int VIADRIMapInit(DRIDriverContext * ctx, VIAPtr pVia)
-{
- int flags = 0;
-
- if (drmAddMap(pVia->drmFD, pVia->MmioBase, VIA_MMIO_REGSIZE,
- DRM_REGISTERS, flags, &pVia->registerHandle) < 0) {
- return GL_FALSE;
- }
-
- xf86DrvMsg(pScreen->myNum, X_INFO,
- "[drm] register handle = 0x%08lx\n", pVia->registerHandle);
-
- return GL_TRUE;
-}
-
-static int viaValidateMode(const DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
-
- return 1;
-}
-
-static int viaPostValidateMode(const DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
-
- return 1;
-}
-
-static void VIAEnableMMIO(DRIDriverContext * ctx)
-{
- /*vgaHWPtr hwp = VGAHWPTR(ctx);*/
- VIAPtr pVia = VIAPTR(ctx);
- unsigned char val;
-
-#if 0
- if (xf86IsPrimaryPci(pVia->PciInfo)) {
- /* If we are primary card, we still use std vga port. If we use
- * MMIO, system will hang in vgaHWSave when our card used in
- * PLE and KLE (integrated Trident MVP4)
- */
- vgaHWSetStdFuncs(hwp);
- }
- else {
- vgaHWSetMmioFuncs(hwp, pVia->MapBase, 0x8000);
- }
-#endif
-
- val = VGAIN8(0x3c3);
- VGAOUT8(0x3c3, val | 0x01);
- val = VGAIN8(0x3cc);
- VGAOUT8(0x3c2, val | 0x01);
-
- /* Unlock Extended IO Space */
- VGAOUT8(0x3c4, 0x10);
- VGAOUT8(0x3c5, 0x01);
-
- /* Enable MMIO */
- if(!pVia->IsSecondary) {
- VGAOUT8(0x3c4, 0x1a);
- val = VGAIN8(0x3c5);
-#ifdef DEBUG
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "primary val = %x\n", val);
-#endif
- VGAOUT8(0x3c5, val | 0x68);
- }
- else {
- VGAOUT8(0x3c4, 0x1a);
- val = VGAIN8(0x3c5);
-#ifdef DEBUG
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "secondary val = %x\n", val);
-#endif
- VGAOUT8(0x3c5, val | 0x38);
- }
-
- /* Unlock CRTC registers */
- VGAOUT8(0x3d4, 0x47);
- VGAOUT8(0x3d5, 0x00);
-
- return;
-}
-
-static void VIADisableMMIO(DRIDriverContext * ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- unsigned char val;
-
- VGAOUT8(0x3c4, 0x1a);
- val = VGAIN8(0x3c5);
- VGAOUT8(0x3c5, val & 0x97);
-
- return;
-}
-
-static void VIADisableExtendedFIFO(DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- u_int32_t dwGE230, dwGE298;
-
- /* Cause of exit XWindow will dump back register value, others chipset no
- * need to set extended fifo value */
- if (pVia->Chipset == VIA_CLE266 && pVia->ChipRev < 15 &&
- (ctx->shared.virtualWidth > 1024 || pVia->HasSecondary)) {
- /* Turn off Extend FIFO */
- /* 0x298[29] */
- dwGE298 = VIAGETREG(0x298);
- VIASETREG(0x298, dwGE298 | 0x20000000);
- /* 0x230[21] */
- dwGE230 = VIAGETREG(0x230);
- VIASETREG(0x230, dwGE230 & ~0x00200000);
- /* 0x298[29] */
- dwGE298 = VIAGETREG(0x298);
- VIASETREG(0x298, dwGE298 & ~0x20000000);
- }
-}
-
-static void VIAEnableExtendedFIFO(DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- u_int8_t bRegTemp;
- u_int32_t dwGE230, dwGE298;
-
- switch (pVia->Chipset) {
- case VIA_CLE266:
- if (pVia->ChipRev > 14) { /* For 3123Cx */
- if (pVia->HasSecondary) { /* SAMM or DuoView case */
- if (ctx->shared.virtualWidth >= 1024)
- {
- /* 3c5.16[0:5] */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x1C;
- VGAOUT8(0x3C5, bRegTemp);
- /* 3c5.17[0:6] */
- VGAOUT8(0x3C4, 0x17);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x7F;
- bRegTemp |= 0x3F;
- VGAOUT8(0x3C5, bRegTemp);
- pVia->EnableExtendedFIFO = GL_TRUE;
- }
- }
- else /* Single view or Simultaneoue case */
- {
- if (ctx->shared.virtualWidth > 1024)
- {
- /* 3c5.16[0:5] */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x17;
- VGAOUT8(0x3C5, bRegTemp);
- /* 3c5.17[0:6] */
- VGAOUT8(0x3C4, 0x17);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x7F;
- bRegTemp |= 0x2F;
- VGAOUT8(0x3C5, bRegTemp);
- pVia->EnableExtendedFIFO = GL_TRUE;
- }
- }
- /* 3c5.18[0:5] */
- VGAOUT8(0x3C4, 0x18);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x17;
- bRegTemp |= 0x40; /* force the preq always higher than treq */
- VGAOUT8(0x3C5, bRegTemp);
- }
- else { /* for 3123Ax */
- if (ctx->shared.virtualWidth > 1024 || pVia->HasSecondary) {
- /* Turn on Extend FIFO */
- /* 0x298[29] */
- dwGE298 = VIAGETREG(0x298);
- VIASETREG(0x298, dwGE298 | 0x20000000);
- /* 0x230[21] */
- dwGE230 = VIAGETREG(0x230);
- VIASETREG(0x230, dwGE230 | 0x00200000);
- /* 0x298[29] */
- dwGE298 = VIAGETREG(0x298);
- VIASETREG(0x298, dwGE298 & ~0x20000000);
-
- /* 3c5.16[0:5] */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x17;
- /* bRegTemp |= 0x10; */
- VGAOUT8(0x3C5, bRegTemp);
- /* 3c5.17[0:6] */
- VGAOUT8(0x3C4, 0x17);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x7F;
- bRegTemp |= 0x2F;
- /*bRegTemp |= 0x1F;*/
- VGAOUT8(0x3C5, bRegTemp);
- /* 3c5.18[0:5] */
- VGAOUT8(0x3C4, 0x18);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x17;
- bRegTemp |= 0x40; /* force the preq always higher than treq */
- VGAOUT8(0x3C5, bRegTemp);
- pVia->EnableExtendedFIFO = GL_TRUE;
- }
- }
- break;
- case VIA_KM400:
- if (pVia->HasSecondary) { /* SAMM or DuoView case */
- if ((ctx->shared.virtualWidth >= 1600) &&
- (pVia->MemClk <= VIA_MEM_DDR200)) {
- /* enable CRT extendded FIFO */
- VGAOUT8(0x3C4, 0x17);
- VGAOUT8(0x3C5, 0x1C);
- /* revise second display queue depth and read threshold */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp = (bRegTemp) | (0x09);
- VGAOUT8(0x3C5, bRegTemp);
- }
- else {
- /* enable CRT extendded FIFO */
- VGAOUT8(0x3C4, 0x17);
- VGAOUT8(0x3C5,0x3F);
- /* revise second display queue depth and read threshold */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp = (bRegTemp) | (0x1C);
- VGAOUT8(0x3C5, bRegTemp);
- }
- /* 3c5.18[0:5] */
- VGAOUT8(0x3C4, 0x18);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x17;
- bRegTemp |= 0x40; /* force the preq always higher than treq */
- VGAOUT8(0x3C5, bRegTemp);
- pVia->EnableExtendedFIFO = GL_TRUE;
- }
- else {
- if ( (ctx->shared.virtualWidth > 1024) && (ctx->shared.virtualWidth <= 1280) )
- {
- /* enable CRT extendded FIFO */
- VGAOUT8(0x3C4, 0x17);
- VGAOUT8(0x3C5, 0x3F);
- /* revise second display queue depth and read threshold */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp = (bRegTemp) | (0x17);
- VGAOUT8(0x3C5, bRegTemp);
- pVia->EnableExtendedFIFO = GL_TRUE;
- }
- else if ((ctx->shared.virtualWidth > 1280))
- {
- /* enable CRT extendded FIFO */
- VGAOUT8(0x3C4, 0x17);
- VGAOUT8(0x3C5, 0x3F);
- /* revise second display queue depth and read threshold */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp = (bRegTemp) | (0x1C);
- VGAOUT8(0x3C5, bRegTemp);
- pVia->EnableExtendedFIFO = GL_TRUE;
- }
- else
- {
- /* enable CRT extendded FIFO */
- VGAOUT8(0x3C4, 0x17);
- VGAOUT8(0x3C5, 0x3F);
- /* revise second display queue depth and read threshold */
- VGAOUT8(0x3C4, 0x16);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp = (bRegTemp) | (0x10);
- VGAOUT8(0x3C5, bRegTemp);
- }
- /* 3c5.18[0:5] */
- VGAOUT8(0x3C4, 0x18);
- bRegTemp = VGAIN8(0x3C5);
- bRegTemp &= ~0x3F;
- bRegTemp |= 0x17;
- bRegTemp |= 0x40; /* force the preq always higher than treq */
- VGAOUT8(0x3C5, bRegTemp);
- }
- break;
- case VIA_K8M800:
- /*=* R1 Display FIFO depth (384 /8 -1 -> 0xbf) SR17[7:0] (8bits) *=*/
- VGAOUT8(0x3c4, 0x17);
- VGAOUT8(0x3c5, 0xbf);
-
- /*=* R2 Display fetch datum threshold value (328/4 -> 0x52)
- SR16[5:0], SR16[7] (7bits) *=*/
- VGAOUT8(0x3c4, 0x16);
- bRegTemp = VGAIN8(0x3c5) & ~0xBF;
- bRegTemp |= (0x52 & 0x3F);
- bRegTemp |= ((0x52 & 0x40) << 1);
- VGAOUT8(0x3c5, bRegTemp);
-
- /*=* R3 Switch to the highest agent threshold value (74 -> 0x4a)
- SR18[5:0], SR18[7] (7bits) *=*/
- VGAOUT8(0x3c4, 0x18);
- bRegTemp = VGAIN8(0x3c5) & ~0xBF;
- bRegTemp |= (0x4a & 0x3F);
- bRegTemp |= ((0x4a & 0x40) << 1);
- VGAOUT8(0x3c5, bRegTemp);
-#if 0
- /*=* R4 Fetch Number for a scan line (unit: 8 bytes)
- SR1C[7:0], SR1D[1:0] (10bits) *=*/
- wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4;
- VGAOUT8(0x3c4, 0x1c);
- VGAOUT8(0x3c5, (u_int8_t)(wRegTemp & 0xFF));
- VGAOUT8(0x3c4, 0x1d);
- bRegTemp = VGAIN8(0x3c5) & ~0x03;
- VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8));
-#endif
- if (ctx->shared.virtualWidth >= 1400 && ctx->bpp == 32)
- {
- /*=* Max. length for a request SR22[4:0] (64/4 -> 0x10) *=*/
- VGAOUT8(0x3c4, 0x22);
- bRegTemp = VGAIN8(0x3c5) & ~0x1F;
- VGAOUT8(0x3c5, bRegTemp | 0x10);
- }
- else
- {
- /*=* Max. length for a request SR22[4:0]
- (128/4 -> over flow 0x0) *=*/
- VGAOUT8(0x3c4, 0x22);
- bRegTemp = VGAIN8(0x3c5) & ~0x1F;
- VGAOUT8(0x3c5, bRegTemp);
- }
- break;
- case VIA_PM800:
- /*=* R1 Display FIFO depth (96-1 -> 0x5f) SR17[7:0] (8bits) *=*/
- VGAOUT8(0x3c4, 0x17);
- VGAOUT8(0x3c5, 0x5f);
-
- /*=* R2 Display fetch datum threshold value (32 -> 0x20)
- SR16[5:0], SR16[7] (7bits) *=*/
- VGAOUT8(0x3c4, 0x16);
- bRegTemp = VGAIN8(0x3c5) & ~0xBF;
- bRegTemp |= (0x20 & 0x3F);
- bRegTemp |= ((0x20 & 0x40) << 1);
- VGAOUT8(0x3c5, bRegTemp);
-
- /*=* R3 Switch to the highest agent threshold value (16 -> 0x10)
- SR18[5:0], SR18[7] (7bits) *=*/
- VGAOUT8(0x3c4, 0x18);
- bRegTemp = VGAIN8(0x3c5) & ~0xBF;
- bRegTemp |= (0x10 & 0x3F);
- bRegTemp |= ((0x10 & 0x40) << 1);
- VGAOUT8(0x3c5, bRegTemp);
-#if 0
- /*=* R4 Fetch Number for a scan line (unit: 8 bytes)
- SR1C[7:0], SR1D[1:0] (10bits) *=*/
- wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4;
- VGAOUT8(0x3c4, 0x1c);
- VGAOUT8(0x3c5, (u_int8_t)(wRegTemp & 0xFF));
- VGAOUT8(0x3c4, 0x1d);
- bRegTemp = VGAIN8(0x3c5) & ~0x03;
- VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8));
-#endif
- if (ctx->shared.virtualWidth >= 1400 && ctx->bpp == 32)
- {
- /*=* Max. length for a request SR22[4:0] (64/4 -> 0x10) *=*/
- VGAOUT8(0x3c4, 0x22);
- bRegTemp = VGAIN8(0x3c5) & ~0x1F;
- VGAOUT8(0x3c5, bRegTemp | 0x10);
- }
- else
- {
- /*=* Max. length for a request SR22[4:0] (0x1F) *=*/
- VGAOUT8(0x3c4, 0x22);
- bRegTemp = VGAIN8(0x3c5) & ~0x1F;
- VGAOUT8(0x3c5, bRegTemp | 0x1F);
- }
- break;
- default:
- break;
- }
-}
-
-static void VIAInitialize2DEngine(DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- u_int32_t dwVQStartAddr, dwVQEndAddr;
- u_int32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH;
- u_int32_t dwGEMode;
-
- /* init 2D engine regs to reset 2D engine */
- VIASETREG(0x04, 0x0);
- VIASETREG(0x08, 0x0);
- VIASETREG(0x0c, 0x0);
- VIASETREG(0x10, 0x0);
- VIASETREG(0x14, 0x0);
- VIASETREG(0x18, 0x0);
- VIASETREG(0x1c, 0x0);
- VIASETREG(0x20, 0x0);
- VIASETREG(0x24, 0x0);
- VIASETREG(0x28, 0x0);
- VIASETREG(0x2c, 0x0);
- VIASETREG(0x30, 0x0);
- VIASETREG(0x34, 0x0);
- VIASETREG(0x38, 0x0);
- VIASETREG(0x3c, 0x0);
- VIASETREG(0x40, 0x0);
-
- VIADisableMMIO(ctx);
-
- /* Init AGP and VQ regs */
- VIASETREG(0x43c, 0x00100000);
- VIASETREG(0x440, 0x00000000);
- VIASETREG(0x440, 0x00333004);
- VIASETREG(0x440, 0x60000000);
- VIASETREG(0x440, 0x61000000);
- VIASETREG(0x440, 0x62000000);
- VIASETREG(0x440, 0x63000000);
- VIASETREG(0x440, 0x64000000);
- VIASETREG(0x440, 0x7D000000);
-
- VIASETREG(0x43c, 0xfe020000);
- VIASETREG(0x440, 0x00000000);
-
- if (pVia->VQStart != 0) {
- /* Enable VQ */
- dwVQStartAddr = pVia->VQStart;
- dwVQEndAddr = pVia->VQEnd;
- dwVQStartL = 0x50000000 | (dwVQStartAddr & 0xFFFFFF);
- dwVQEndL = 0x51000000 | (dwVQEndAddr & 0xFFFFFF);
- dwVQStartEndH = 0x52000000 | ((dwVQStartAddr & 0xFF000000) >> 24) |
- ((dwVQEndAddr & 0xFF000000) >> 16);
- dwVQLen = 0x53000000 | (VIA_VQ_SIZE >> 3);
-
- VIASETREG(0x43c, 0x00fe0000);
- VIASETREG(0x440, 0x080003fe);
- VIASETREG(0x440, 0x0a00027c);
- VIASETREG(0x440, 0x0b000260);
- VIASETREG(0x440, 0x0c000274);
- VIASETREG(0x440, 0x0d000264);
- VIASETREG(0x440, 0x0e000000);
- VIASETREG(0x440, 0x0f000020);
- VIASETREG(0x440, 0x1000027e);
- VIASETREG(0x440, 0x110002fe);
- VIASETREG(0x440, 0x200f0060);
-
- VIASETREG(0x440, 0x00000006);
- VIASETREG(0x440, 0x40008c0f);
- VIASETREG(0x440, 0x44000000);
- VIASETREG(0x440, 0x45080c04);
- VIASETREG(0x440, 0x46800408);
-
- VIASETREG(0x440, dwVQStartEndH);
- VIASETREG(0x440, dwVQStartL);
- VIASETREG(0x440, dwVQEndL);
- VIASETREG(0x440, dwVQLen);
- }
- else {
- /* Diable VQ */
- VIASETREG(0x43c, 0x00fe0000);
- VIASETREG(0x440, 0x00000004);
- VIASETREG(0x440, 0x40008c0f);
- VIASETREG(0x440, 0x44000000);
- VIASETREG(0x440, 0x45080c04);
- VIASETREG(0x440, 0x46800408);
- }
-
- dwGEMode = 0;
-
- switch (ctx->bpp) {
- case 16:
- dwGEMode |= VIA_GEM_16bpp;
- break;
- case 32:
- dwGEMode |= VIA_GEM_32bpp;
- break;
- default:
- dwGEMode |= VIA_GEM_8bpp;
- break;
- }
-
-#if 0
- switch (ctx->shared.virtualWidth) {
- case 800:
- dwGEMode |= VIA_GEM_800;
- break;
- case 1024:
- dwGEMode |= VIA_GEM_1024;
- break;
- case 1280:
- dwGEMode |= VIA_GEM_1280;
- break;
- case 1600:
- dwGEMode |= VIA_GEM_1600;
- break;
- case 2048:
- dwGEMode |= VIA_GEM_2048;
- break;
- default:
- dwGEMode |= VIA_GEM_640;
- break;
- }
-#endif
-
- VIAEnableMMIO(ctx);
-
- /* Set BPP and Pitch */
- VIASETREG(VIA_REG_GEMODE, dwGEMode);
-
- /* Set Src and Dst base address and pitch, pitch is qword */
- VIASETREG(VIA_REG_SRCBASE, 0x0);
- VIASETREG(VIA_REG_DSTBASE, 0x0);
- VIASETREG(VIA_REG_PITCH, VIA_PITCH_ENABLE |
- ((ctx->shared.virtualWidth * ctx->bpp >> 3) >> 3) |
- (((ctx->shared.virtualWidth * ctx->bpp >> 3) >> 3) << 16));
-}
-
-static int b3DRegsInitialized = 0;
-
-static void VIAInitialize3DEngine(DRIDriverContext *ctx)
-{
- VIAPtr pVia = VIAPTR(ctx);
- int i;
-
- if (!b3DRegsInitialized)
- {
-
- VIASETREG(0x43C, 0x00010000);
-
- for (i = 0; i <= 0x7D; i++)
- {
- VIASETREG(0x440, (u_int32_t) i << 24);
- }
-
- VIASETREG(0x43C, 0x00020000);
-
- for (i = 0; i <= 0x94; i++)
- {
- VIASETREG(0x440, (u_int32_t) i << 24);
- }
-
- VIASETREG(0x440, 0x82400000);
-
- VIASETREG(0x43C, 0x01020000);
-
-
- for (i = 0; i <= 0x94; i++)
- {
- VIASETREG(0x440, (u_int32_t) i << 24);
- }
-
- VIASETREG(0x440, 0x82400000);
- VIASETREG(0x43C, 0xfe020000);
-
- for (i = 0; i <= 0x03; i++)
- {
- VIASETREG(0x440, (u_int32_t) i << 24);
- }
-
- VIASETREG(0x43C, 0x00030000);
-
- for (i = 0; i <= 0xff; i++)
- {
- VIASETREG(0x440, 0);
- }
- VIASETREG(0x43C, 0x00100000);
- VIASETREG(0x440, 0x00333004);
- VIASETREG(0x440, 0x10000002);
- VIASETREG(0x440, 0x60000000);
- VIASETREG(0x440, 0x61000000);
- VIASETREG(0x440, 0x62000000);
- VIASETREG(0x440, 0x63000000);
- VIASETREG(0x440, 0x64000000);
-
- VIASETREG(0x43C, 0x00fe0000);
-
- if (pVia->ChipRev >= 3 )
- VIASETREG(0x440,0x40008c0f);
- else
- VIASETREG(0x440,0x4000800f);
-
- VIASETREG(0x440,0x44000000);
- VIASETREG(0x440,0x45080C04);
- VIASETREG(0x440,0x46800408);
- VIASETREG(0x440,0x50000000);
- VIASETREG(0x440,0x51000000);
- VIASETREG(0x440,0x52000000);
- VIASETREG(0x440,0x53000000);
-
- b3DRegsInitialized = 1;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "3D Engine has been initialized.\n");
- }
-
- VIASETREG(0x43C,0x00fe0000);
- VIASETREG(0x440,0x08000001);
- VIASETREG(0x440,0x0A000183);
- VIASETREG(0x440,0x0B00019F);
- VIASETREG(0x440,0x0C00018B);
- VIASETREG(0x440,0x0D00019B);
- VIASETREG(0x440,0x0E000000);
- VIASETREG(0x440,0x0F000000);
- VIASETREG(0x440,0x10000000);
- VIASETREG(0x440,0x11000000);
- VIASETREG(0x440,0x20000000);
-}
-
-static int
-WaitIdleCLE266(VIAPtr pVia)
-{
- int loop = 0;
-
- /*mem_barrier();*/
-
- while (!(VIAGETREG(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && (loop++ < MAXLOOP))
- ;
-
- while ((VIAGETREG(VIA_REG_STATUS) &
- (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) &&
- (loop++ < MAXLOOP))
- ;
-
- return loop >= MAXLOOP;
-}
-
-static int viaInitFBDev(DRIDriverContext *ctx)
-{
- VIAPtr pVia = CALLOC(sizeof(*pVia));
-
- ctx->driverPrivate = (void *)pVia;
-
- switch (ctx->chipset) {
- case PCI_CHIP_CLE3122:
- case PCI_CHIP_CLE3022:
- pVia->Chipset = VIA_CLE266;
- break;
- case PCI_CHIP_VT7205:
- case PCI_CHIP_VT3205:
- pVia->Chipset = VIA_KM400;
- break;
- case PCI_CHIP_VT3204:
- pVia->Chipset = VIA_K8M800;
- break;
- case PCI_CHIP_VT3259:
- pVia->Chipset = VIA_PM800;
- break;
- default:
- xf86DrvMsg(0, X_ERROR, "VIA: Unknown device ID (0x%x)\n", ctx->chipset);
- }
-
- /* _SOLO TODO XXX need to read ChipRev too */
- pVia->ChipRev = 0;
-
- pVia->videoRambytes = ctx->shared.fbSize;
- pVia->MmioBase = ctx->MMIOStart;
- pVia->FrameBufferBase = ctx->FBStart & 0xfc000000;
-
- pVia->FBFreeStart = ctx->shared.virtualWidth * ctx->cpp *
- ctx->shared.virtualHeight;
-
-#if 1
- /* Alloc a second framebuffer for the second head */
- pVia->FBFreeStart += ctx->shared.virtualWidth * ctx->cpp *
- ctx->shared.virtualHeight;
-#endif
-
- pVia->VQStart = pVia->FBFreeStart;
- pVia->VQEnd = pVia->FBFreeStart + VIA_VQ_SIZE - 1;
-
- pVia->FBFreeStart += VIA_VQ_SIZE;
-
- pVia->FBFreeEnd = pVia->videoRambytes;
-
- if (!VIADRIScreenInit(ctx))
- return 0;
-
- return 1;
-}
-
-static void viaHaltFBDev(DRIDriverContext *ctx)
-{
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = 0;
- }
-}
-
-static int viaEngineShutdown(const DRIDriverContext *ctx)
-{
- return 1;
-}
-
-static int viaEngineRestore(const DRIDriverContext *ctx)
-{
- return 1;
-}
-
-const struct DRIDriverRec __driDriver =
-{
- viaValidateMode,
- viaPostValidateMode,
- viaInitFBDev,
- viaHaltFBDev,
- viaEngineShutdown,
- viaEngineRestore,
- 0,
-};
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.h
deleted file mode 100644
index b47397d57..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_dri.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-/*
- * Keep this file in perfect sync between the ddx and dri drivers.
- * At least bump the VIA_DRIDDX_VERSION defines appropriately.
- *
- */
-#ifndef _VIA_DRI_H_
-#define _VIA_DRI_H_ 1
-
-#define VIA_MAX_DRAWABLES 256
-
-#define VIA_DRIDDX_VERSION_MAJOR 5
-#define VIA_DRIDDX_VERSION_MINOR 0
-#define VIA_DRIDDX_VERSION_PATCH 0
-
-#ifndef XFree86Server
-typedef int Bool;
-#endif
-
-typedef struct {
- drm_handle_t handle;
- drmSize size;
-} viaRegion, *viaRegionPtr;
-
-typedef struct {
- viaRegion regs, agp;
- int deviceID;
- int width;
- int height;
- int mem;
- int bytesPerPixel;
- int priv1;
- int priv2;
- int fbOffset;
- int fbSize;
- Bool drixinerama;
- int backOffset;
- int depthOffset;
- int textureOffset;
- int textureSize;
- int irqEnabled;
- unsigned int scrnX, scrnY;
- int sarea_priv_offset;
- int ringBufActive;
- unsigned int reg_pause_addr;
-} VIADRIRec, *VIADRIPtr;
-
-typedef struct {
- int dummy;
-} VIAConfigPrivRec, *VIAConfigPrivPtr;
-
-typedef struct {
- int dummy;
-} VIADRIContextRec, *VIADRIContextPtr;
-
-#endif /* _VIA_DRI_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_driver.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_driver.h
deleted file mode 100644
index 997b2e41a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_driver.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v 1.7 2003/11/06 18:38:11 tsi Exp $ */
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIA_DRIVER_H
-#define _VIA_DRIVER_H
-
-#if 0 /* DEBUG is use in VIA DRI code as a flag */
-/* #define DEBUG_PRINT */
-#ifdef DEBUG_PRINT
-#define DEBUG(x) x
-#else
-#define DEBUG(x)
-#endif
-#endif
-
-#if 0
-#include "vgaHW.h"
-#include "xf86.h"
-#include "xf86Resources.h"
-#include "xf86_ansic.h"
-#include "xf86Pci.h"
-#include "xf86PciInfo.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
-#include "xf86Cursor.h"
-#include "mipointer.h"
-#include "micmap.h"
-
-#define USE_FB
-#ifdef USE_FB
-#include "fb.h"
-#else
-#include "cfb.h"
-#include "cfb16.h"
-#include "cfb32.h"
-#endif
-
-#include "xf86cmap.h"
-#include "vbe.h"
-#include "xaa.h"
-
-#include "via_regs.h"
-#include "via_bios.h"
-#include "via_gpioi2c.h"
-#include "via_priv.h"
-#include "ginfo.h"
-
-#ifdef XF86DRI
-#define _XF86DRI_SERVER_
-#include "sarea.h"
-#include "dri.h"
-#include "GL/glxint.h"
-#include "via_dri.h"
-#endif
-#else
-#include "via_regs.h"
-
-#include "GL/internal/dri_interface.h"
-#include "via_dri.h"
-#endif
-
-/* _SOLO : copied from via_bios.h */
-/* System Memory CLK */
-#define VIA_MEM_SDR66 0x00
-#define VIA_MEM_SDR100 0x01
-#define VIA_MEM_SDR133 0x02
-#define VIA_MEM_DDR200 0x03
-#define VIA_MEM_DDR266 0x04
-#define VIA_MEM_DDR333 0x05
-#define VIA_MEM_DDR400 0x06
-
-#define DRIVER_NAME "via"
-#define DRIVER_VERSION "4.1.0"
-#define VERSION_MAJOR 4
-#define VERSION_MINOR 1
-#define PATCHLEVEL 41
-#define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL)
-
-#define VGAIN8(addr) MMIO_IN8(pVia->MapBase+0x8000, addr)
-#define VGAIN16(addr) MMIO_IN16(pVia->MapBase+0x8000, addr)
-#define VGAIN(addr) MMIO_IN32(pVia->MapBase+0x8000, addr)
-
-#define VGAOUT8(addr, val) MMIO_OUT8(pVia->MapBase+0x8000, addr, val)
-#define VGAOUT16(addr, val) MMIO_OUT16(pVia->MapBase+0x8000, addr, val)
-#define VGAOUT(addr, val) MMIO_OUT32(pVia->MapBase+0x8000, addr, val)
-
-#define INREG(addr) MMIO_IN32(pVia->MapBase, addr)
-#define OUTREG(addr, val) MMIO_OUT32(pVia->MapBase, addr, val)
-#define INREG16(addr) MMIO_IN16(pVia->MapBase, addr)
-#define OUTREG16(addr, val) MMIO_OUT16(pVia->MapBase, addr, val)
-
-#define VIA_PIXMAP_CACHE_SIZE (256 * 1024)
-#define VIA_CURSOR_SIZE (4 * 1024)
-#define VIA_VQ_SIZE (256 * 1024)
-
-typedef struct {
- unsigned int mode, refresh, resMode;
- int countWidthByQWord;
- int offsetWidthByQWord;
- unsigned char SR08, SR0A, SR0F;
-
- /* extended Sequencer registers */
- unsigned char SR10, SR11, SR12, SR13,SR14,SR15,SR16;
- unsigned char SR17, SR18, SR19, SR1A,SR1B,SR1C,SR1D,SR1E;
- unsigned char SR1F, SR20, SR21, SR22,SR23,SR24,SR25,SR26;
- unsigned char SR27, SR28, SR29, SR2A,SR2B,SR2C,SR2D,SR2E;
- unsigned char SR2F, SR30, SR31, SR32,SR33,SR34,SR40,SR41;
- unsigned char SR42, SR43, SR44, SR45,SR46,SR47;
-
- unsigned char Clock;
-
- /* extended CRTC registers */
- unsigned char CR13, CR30, CR31, CR32, CR33, CR34, CR35, CR36;
- unsigned char CR37, CR38, CR39, CR3A, CR40, CR41, CR42, CR43;
- unsigned char CR44, CR45, CR46, CR47, CR48, CR49, CR4A;
- unsigned char CRTCRegs[83];
- unsigned char TVRegs[0xCF];
- unsigned char TVRegs2[0xCF];
-/* unsigned char LCDRegs[0x40];*/
-
-} VIARegRec, *VIARegPtr;
-
-
-typedef struct _VIA {
- VIARegRec SavedReg;
- VIARegRec ModeReg;
-#if 0
- xf86CursorInfoPtr CursorInfoRec;
- int stateMode;
- VIAModeInfoPtr VIAModeList;
-#endif
- int ModeStructInit;
- int Bpp, Bpl, ScissB;
- unsigned PlaneMask;
-
- unsigned long videoRambytes;
- int videoRamKbytes;
- int FBFreeStart;
- int FBFreeEnd;
- int CursorStart;
- int VQStart;
- int VQEnd;
-
- /* These are physical addresses. */
- unsigned long FrameBufferBase;
- unsigned long MmioBase;
-
- /* These are linear addresses. */
- unsigned char* MapBase;
- unsigned char* VidMapBase;
- unsigned char* BltBase;
- unsigned char* MapBaseDense;
- unsigned char* FBBase;
- unsigned char* FBStart;
-
- int PrimaryVidMapped;
- int dacSpeedBpp;
- int minClock, maxClock;
- int MCLK, REFCLK, LCDclk;
- double refclk_fact;
-
- /* Here are all the Options */
- int VQEnable;
- int pci_burst;
- int NoPCIRetry;
- int hwcursor;
- int NoAccel;
- int shadowFB;
- int NoDDCValue;
- int rotate;
-
-#if 0
- CloseScreenProcPtr CloseScreen;
- pciVideoPtr PciInfo;
- PCITAG PciTag;
-#endif
- int Chipset;
- int ChipId;
- int ChipRev;
- /*vbeInfoPtr pVbe;*/
- int EntityIndex;
-
- /* Support for shadowFB and rotation */
- unsigned char* ShadowPtr;
- int ShadowPitch;
- void (*PointerMoved)(int index, int x, int y);
-
- /* Support for XAA acceleration */
-#if 0
- XAAInfoRecPtr AccelInfoRec;
- xRectangle Rect;
-#endif
- u_int32_t SavedCmd;
- u_int32_t SavedFgColor;
- u_int32_t SavedBgColor;
- u_int32_t SavedPattern0;
- u_int32_t SavedPattern1;
- u_int32_t SavedPatternAddr;
-
-#if 0
- /* Support for Int10 processing */
- xf86Int10InfoPtr pInt10;
-
- /* BIOS Info Ptr */
- VIABIOSInfoPtr pBIOSInfo;
- VGABIOSVERPtr pBIOSVer;
-#endif
-
- /* Support for DGA */
- int numDGAModes;
- /*DGAModePtr DGAModes;*/
- int DGAactive;
- int DGAViewportStatus;
-
- /* The various wait handlers. */
- int (*myWaitIdle)(struct _VIA*);
-
-#if 0
- /* I2C & DDC */
- I2CBusPtr I2C_Port1;
- I2CBusPtr I2C_Port2;
- xf86MonPtr DDC1;
- xf86MonPtr DDC2;
-#endif
-
- /* MHS */
- int IsSecondary;
- int HasSecondary;
-
-#if 0
- /* Capture information */
- VIACAPINFO CapInfo[2]; /* 2 capture information */
-#endif
-
-/*
- u_int32_t Cap0_Deinterlace;
- u_int32_t Cap1_Deinterlace;
-
- int Cap0_FieldSwap;
- int NoCap0_HFilter;
- int Capture_OverScanOff;
- int NoMPEGHQV_VFilter;
-*/
-#ifdef XF86DRI
- int directRenderingEnabled;
- DRIInfoPtr pDRIInfo;
- int drmFD;
- int numVisualConfigs;
- __GLXvisualConfig* pVisualConfigs;
- VIAConfigPrivPtr pVisualConfigsPriv;
- unsigned long agpHandle;
- unsigned long registerHandle;
- u_int32_t agpAddr;
- unsigned char *agpBase;
- unsigned int agpSize;
- int IsPCI;
- int drixinerama;
-#else
- int drmFD;
- unsigned long agpHandle;
- unsigned long registerHandle;
- unsigned long agpAddr;
- unsigned char *agpBase;
- unsigned int agpSize;
- int IsPCI;
-#endif
-
- int V4LEnabled;
- u_int16_t ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */
- unsigned char *CursorImage;
- u_int32_t CursorFG;
- u_int32_t CursorBG;
- u_int32_t CursorMC;
-
- unsigned char MemClk;
- int EnableExtendedFIFO;
- VIADRIPtr devPrivate;
-} VIARec, *VIAPtr;
-
-
-/* Shortcuts. These depend on a local symbol "pVia". */
-
-#define WaitIdle() pVia->myWaitIdle(pVia)
-#define VIAPTR(p) ((VIAPtr)((p)->driverPrivate))
-
-#endif /* _VIA_DRIVER_H */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_priv.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_priv.h
deleted file mode 100644
index 587531b37..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_priv.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_priv.h,v 1.3 2003/08/27 15:16:12 tsi Exp $ */
-
-#ifndef _VIA_PRIV_H_
-#define _VIA_PRIV_H_ 1
-
-//#include "ddmpeg.h"
-#include "via_common.h"
-
-#define MEM_BLOCKS 4
-
-typedef struct {
- unsigned long base; /* Offset into fb */
- int pool; /* Pool we drew from */
- int drm_fd; /* Fd in DRM mode */
- drm_via_mem_t drm; /* DRM management object */
- int slot; /* Pool 3 slot */
- void *pVia; /* VIA driver pointer */
- //FBLinearPtr linear; /* X linear pool info ptr */
-} VIAMem;
-
-typedef VIAMem *VIAMemPtr;
-
-
-
-#if 0
-typedef struct {
- unsigned long gdwVideoFlagTV1;
- unsigned long gdwVideoFlagSW;
- unsigned long gdwVideoFlagMPEG;
- unsigned long gdwAlphaEnabled; /* For Alpha blending use*/
-
- VIAMem SWOVMem;
- VIAMem HQVMem;
- VIAMem SWfbMem;
-
- DDPIXELFORMAT DPFsrc;
- DDUPDATEOVERLAY UpdateOverlayBackup; /* For HQVcontrol func use
- // To save MPEG updateoverlay info.*/
-
-/* device struct */
- SWDEVICE SWDevice;
- SUBDEVICE SUBDevice;
- MPGDEVICE MPGDevice;
- OVERLAYRECORD overlayRecordV1;
- OVERLAYRECORD overlayRecordV3;
-
- BoxRec AvailFBArea;
- FBLinearPtr SWOVlinear;
-
- int MPEG_ON;
- int SWVideo_ON;
-
-/*To solve the bandwidth issue */
- unsigned long gdwUseExtendedFIFO;
-
-/* For panning mode use */
- int panning_old_x;
- int panning_old_y;
- int panning_x;
- int panning_y;
-
-/*To solve the bandwidth issue */
- unsigned char Save_3C4_16;
- unsigned char Save_3C4_17;
- unsigned char Save_3C4_18;
-
-} swovRec, *swovPtr;
-#endif
-
-#endif /* _VIA_PRIV_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_regs.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_regs.h
deleted file mode 100644
index 5c5eecbe8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/server/via_regs.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/*************************************************************************
- *
- * File: via_regs.c
- * Content: The defines of Via registers
- *
- ************************************************************************/
-
-#ifndef _VIA_REGS_H
-#define _VIA_REGS_H
-
-#include "via_driver.h"
-
-/*#define VIA_SERIES(chip) (chip == VIA_CLE266)*/
-
-#define PCI_VIA_VENDOR_ID 0x1106
-
-#define PCI_CHIP_CLE3122 0x3122
-#define PCI_CHIP_CLE3022 0x3022
-#define PCI_CHIP_VT3205 0x3205
-#define PCI_CHIP_VT7205 0x7205
-#define PCI_CHIP_VT3204 0x3108
-#define PCI_CHIP_VT3259 0x3118
-
-
-#define BIOS_BSIZE 1024
-#define BIOS_BASE 0xc0000
-
-
-#define VIA_MMIO_REGSIZE 0x9000
-#define VIA_MMIO_REGBASE 0x0
-#define VIA_MMIO_VGABASE 0x8000
-#define VIA_MMIO_BLTBASE 0x200000
-#define VIA_MMIO_BLTSIZE 0x10000
-
-
-/* defines for VIA 2D registers */
-#define VIA_REG_GECMD 0x000
-#define VIA_REG_GEMODE 0x004
-#define VIA_REG_GESTATUS 0x004 /* as same as VIA_REG_GEMODE */
-#define VIA_REG_SRCPOS 0x008
-#define VIA_REG_DSTPOS 0x00C
-#define VIA_REG_LINE_K1K2 0x008
-#define VIA_REG_LINE_XY 0x00C
-#define VIA_REG_DIMENSION 0x010 /* width and height */
-#define VIA_REG_PATADDR 0x014
-#define VIA_REG_FGCOLOR 0x018
-#define VIA_REG_DSTCOLORKEY 0x018 /* as same as VIA_REG_FG */
-#define VIA_REG_BGCOLOR 0x01C
-#define VIA_REG_SRCCOLORKEY 0x01C /* as same as VIA_REG_BG */
-#define VIA_REG_CLIPTL 0x020 /* top and left of clipping */
-#define VIA_REG_CLIPBR 0x024 /* bottom and right of clipping */
-#define VIA_REG_OFFSET 0x028
-#define VIA_REG_LINE_ERROR 0x028
-#define VIA_REG_KEYCONTROL 0x02C /* color key control */
-#define VIA_REG_SRCBASE 0x030
-#define VIA_REG_DSTBASE 0x034
-#define VIA_REG_PITCH 0x038 /* pitch of src and dst */
-#define VIA_REG_MONOPAT0 0x03C
-#define VIA_REG_MONOPAT1 0x040
-#define VIA_REG_COLORPAT 0x100 /* from 0x100 to 0x1ff */
-
-
-
-/* defines for VIA video registers */
-#define VIA_REG_INTERRUPT 0x200
-#define VIA_REG_CRTCSTART 0x214
-
-
-/* defines for VIA HW cursor registers */
-#define VIA_REG_CURSOR_MODE 0x2D0
-#define VIA_REG_CURSOR_POS 0x2D4
-#define VIA_REG_CURSOR_ORG 0x2D8
-#define VIA_REG_CURSOR_BG 0x2DC
-#define VIA_REG_CURSOR_FG 0x2E0
-
-
-/* defines for VIA 3D registers */
-#define VIA_REG_STATUS 0x400
-#define VIA_REG_TRANSET 0x43C
-#define VIA_REG_TRANSPACE 0x440
-
-/* VIA_REG_STATUS(0x400): Engine Status */
-#define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */
-#define VIA_2D_ENG_BUSY 0x00000001 /* 2D Engine is busy */
-#define VIA_3D_ENG_BUSY 0x00000002 /* 3D Engine is busy */
-#define VIA_VR_QUEUE_BUSY 0x00020000 /* Virtual Queue is busy */
-
-
-/* VIA_REG_GECMD(0x00): 2D Engine Command */
-#define VIA_GEC_NOOP 0x00000000
-#define VIA_GEC_BLT 0x00000001
-#define VIA_GEC_LINE 0x00000005
-
-#define VIA_GEC_SRC_XY 0x00000000
-#define VIA_GEC_SRC_LINEAR 0x00000010
-#define VIA_GEC_DST_XY 0x00000000
-#define VIA_GEC_DST_LINRAT 0x00000020
-
-#define VIA_GEC_SRC_FB 0x00000000
-#define VIA_GEC_SRC_SYS 0x00000040
-#define VIA_GEC_DST_FB 0x00000000
-#define VIA_GEC_DST_SYS 0x00000080
-
-#define VIA_GEC_SRC_MONO 0x00000100 /* source is mono */
-#define VIA_GEC_PAT_MONO 0x00000200 /* pattern is mono */
-
-#define VIA_GEC_MSRC_OPAQUE 0x00000000 /* mono src is opaque */
-#define VIA_GEC_MSRC_TRANS 0x00000400 /* mono src is transparent */
-
-#define VIA_GEC_PAT_FB 0x00000000 /* pattern is in frame buffer */
-#define VIA_GEC_PAT_REG 0x00000800 /* pattern is from reg setting */
-
-#define VIA_GEC_CLIP_DISABLE 0x00000000
-#define VIA_GEC_CLIP_ENABLE 0x00001000
-
-#define VIA_GEC_FIXCOLOR_PAT 0x00002000
-
-#define VIA_GEC_INCX 0x00000000
-#define VIA_GEC_DECY 0x00004000
-#define VIA_GEC_INCY 0x00000000
-#define VIA_GEC_DECX 0x00008000
-
-#define VIA_GEC_MPAT_OPAQUE 0x00000000 /* mono pattern is opaque */
-#define VIA_GEC_MPAT_TRANS 0x00010000 /* mono pattern is transparent */
-
-#define VIA_GEC_MONO_UNPACK 0x00000000
-#define VIA_GEC_MONO_PACK 0x00020000
-#define VIA_GEC_MONO_DWORD 0x00000000
-#define VIA_GEC_MONO_WORD 0x00040000
-#define VIA_GEC_MONO_BYTE 0x00080000
-
-#define VIA_GEC_LASTPIXEL_ON 0x00000000
-#define VIA_GEC_LASTPIXEL_OFF 0x00100000
-#define VIA_GEC_X_MAJOR 0x00000000
-#define VIA_GEC_Y_MAJOR 0x00200000
-#define VIA_GEC_QUICK_START 0x00800000
-
-
-/* VIA_REG_GEMODE(0x04): GE mode */
-#define VIA_GEM_8bpp 0x00000000
-#define VIA_GEM_16bpp 0x00000100
-#define VIA_GEM_32bpp 0x00000300
-
-#define VIA_GEM_640 0x00000000 /* 640*480 */
-#define VIA_GEM_800 0x00000400 /* 800*600 */
-#define VIA_GEM_1024 0x00000800 /* 1024*768 */
-#define VIA_GEM_1280 0x00000C00 /* 1280*1024 */
-#define VIA_GEM_1600 0x00001000 /* 1600*1200 */
-#define VIA_GEM_2048 0x00001400 /* 2048*1536 */
-
-/* VIA_REG_PITCH(0x38): Pitch Setting */
-#define VIA_PITCH_ENABLE 0x80000000
-
-
-#define MAXLOOP 0xffffff
-
-
-#define VerticalRetraceWait() \
-{ \
- VGAOUT8(vgaCRIndex, 0x17); \
- if (VGAIN8(vgaCRReg) & 0x80) { \
- while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \
- while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \
- while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \
- } \
-}
-
-
-#define VIASETREG(addr, data) *(volatile unsigned int *)(pVia->MapBase + (addr)) = (data)
-#define VIAGETREG(addr) *(volatile unsigned int *)(pVia->MapBase + (addr))
-
-
-#endif /* _VIA_REGS_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_3d_reg.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_3d_reg.h
deleted file mode 100644
index 77b24dc61..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_3d_reg.h
+++ /dev/null
@@ -1,1652 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef VIA_3D_REG_H
-#define VIA_3D_REG_H
-#define HC_REG_BASE 0x0400
-
-#define HC_ParaN_MASK 0xffffffff
-#define HC_Para_MASK 0x00ffffff
-#define HC_SubA_MASK 0xff000000
-#define HC_SubA_SHIFT 24
-/* Transmission Setting
- */
-#define HC_REG_TRANS_SET 0x003c
-#define HC_ParaSubType_MASK 0xff000000
-#define HC_ParaType_MASK 0x00ff0000
-#define HC_ParaOS_MASK 0x0000ff00
-#define HC_ParaAdr_MASK 0x000000ff
-#define HC_ParaSubType_SHIFT 24
-#define HC_ParaType_SHIFT 16
-#define HC_ParaOS_SHIFT 8
-#define HC_ParaAdr_SHIFT 0
-
-#define HC_ParaType_CmdVdata 0x0000
-#define HC_ParaType_NotTex 0x0001
-#define HC_ParaType_Tex 0x0002
-#define HC_ParaType_Palette 0x0003
-#define HC_ParaType_PreCR 0x0010
-#define HC_ParaType_Auto 0x00fe
-
-/* Transmission Space
- */
-#define HC_REG_Hpara0 0x0040
-#define HC_REG_HpataAF 0x02fc
-
-/* Read
- */
-#define HC_REG_HREngSt 0x0000
-#define HC_REG_HRFIFOempty 0x0004
-#define HC_REG_HRFIFOfull 0x0008
-#define HC_REG_HRErr 0x000c
-#define HC_REG_FIFOstatus 0x0010
-/* HC_REG_HREngSt 0x0000
- */
-#define HC_HDASZC_MASK 0x00010000
-#define HC_HSGEMI_MASK 0x0000f000
-#define HC_HLGEMISt_MASK 0x00000f00
-#define HC_HCRSt_MASK 0x00000080
-#define HC_HSE0St_MASK 0x00000040
-#define HC_HSE1St_MASK 0x00000020
-#define HC_HPESt_MASK 0x00000010
-#define HC_HXESt_MASK 0x00000008
-#define HC_HBESt_MASK 0x00000004
-#define HC_HE2St_MASK 0x00000002
-#define HC_HE3St_MASK 0x00000001
-/* HC_REG_HRFIFOempty 0x0004
- */
-#define HC_HRZDempty_MASK 0x00000010
-#define HC_HRTXAempty_MASK 0x00000008
-#define HC_HRTXDempty_MASK 0x00000004
-#define HC_HWZDempty_MASK 0x00000002
-#define HC_HWCDempty_MASK 0x00000001
-/* HC_REG_HRFIFOfull 0x0008
- */
-#define HC_HRZDfull_MASK 0x00000010
-#define HC_HRTXAfull_MASK 0x00000008
-#define HC_HRTXDfull_MASK 0x00000004
-#define HC_HWZDfull_MASK 0x00000002
-#define HC_HWCDfull_MASK 0x00000001
-/* HC_REG_HRErr 0x000c
- */
-#define HC_HAGPCMErr_MASK 0x80000000
-#define HC_HAGPCMErrC_MASK 0x70000000
-/* HC_REG_FIFOstatus 0x0010
- */
-#define HC_HRFIFOATall_MASK 0x80000000
-#define HC_HRFIFOATbusy_MASK 0x40000000
-#define HC_HRATFGMDo_MASK 0x00000100
-#define HC_HRATFGMDi_MASK 0x00000080
-#define HC_HRATFRZD_MASK 0x00000040
-#define HC_HRATFRTXA_MASK 0x00000020
-#define HC_HRATFRTXD_MASK 0x00000010
-#define HC_HRATFWZD_MASK 0x00000008
-#define HC_HRATFWCD_MASK 0x00000004
-#define HC_HRATTXTAG_MASK 0x00000002
-#define HC_HRATTXCH_MASK 0x00000001
-
-/* AGP Command Setting
- */
-#define HC_SubA_HAGPBstL 0x0060
-#define HC_SubA_HAGPBendL 0x0061
-#define HC_SubA_HAGPCMNT 0x0062
-#define HC_SubA_HAGPBpL 0x0063
-#define HC_SubA_HAGPBpH 0x0064
-/* HC_SubA_HAGPCMNT 0x0062
- */
-#define HC_HAGPCMNT_MASK 0x00800000
-#define HC_HCmdErrClr_MASK 0x00400000
-#define HC_HAGPBendH_MASK 0x0000ff00
-#define HC_HAGPBstH_MASK 0x000000ff
-#define HC_HAGPBendH_SHIFT 8
-#define HC_HAGPBstH_SHIFT 0
-/* HC_SubA_HAGPBpL 0x0063
- */
-#define HC_HAGPBpL_MASK 0x00fffffc
-#define HC_HAGPBpID_MASK 0x00000003
-#define HC_HAGPBpID_PAUSE 0x00000000
-#define HC_HAGPBpID_JUMP 0x00000001
-#define HC_HAGPBpID_STOP 0x00000002
-/* HC_SubA_HAGPBpH 0x0064
- */
-#define HC_HAGPBpH_MASK 0x00ffffff
-
-/* Miscellaneous Settings
- */
-#define HC_SubA_HClipTB 0x0070
-#define HC_SubA_HClipLR 0x0071
-#define HC_SubA_HFPClipTL 0x0072
-#define HC_SubA_HFPClipBL 0x0073
-#define HC_SubA_HFPClipLL 0x0074
-#define HC_SubA_HFPClipRL 0x0075
-#define HC_SubA_HFPClipTBH 0x0076
-#define HC_SubA_HFPClipLRH 0x0077
-#define HC_SubA_HLP 0x0078
-#define HC_SubA_HLPRF 0x0079
-#define HC_SubA_HSolidCL 0x007a
-#define HC_SubA_HPixGC 0x007b
-#define HC_SubA_HSPXYOS 0x007c
-#define HC_SubA_HVertexCNT 0x007d
-
-#define HC_HClipT_MASK 0x00fff000
-#define HC_HClipT_SHIFT 12
-#define HC_HClipB_MASK 0x00000fff
-#define HC_HClipB_SHIFT 0
-#define HC_HClipL_MASK 0x00fff000
-#define HC_HClipL_SHIFT 12
-#define HC_HClipR_MASK 0x00000fff
-#define HC_HClipR_SHIFT 0
-#define HC_HFPClipBH_MASK 0x0000ff00
-#define HC_HFPClipBH_SHIFT 8
-#define HC_HFPClipTH_MASK 0x000000ff
-#define HC_HFPClipTH_SHIFT 0
-#define HC_HFPClipRH_MASK 0x0000ff00
-#define HC_HFPClipRH_SHIFT 8
-#define HC_HFPClipLH_MASK 0x000000ff
-#define HC_HFPClipLH_SHIFT 0
-#define HC_HSolidCH_MASK 0x000000ff
-#define HC_HPixGC_MASK 0x00800000
-#define HC_HSPXOS_MASK 0x00fff000
-#define HC_HSPXOS_SHIFT 12
-#define HC_HSPYOS_MASK 0x00000fff
-
-/* Command
- * Command A
- */
-#define HC_HCmdHeader_MASK 0xfe000000 /*0xffe00000*/
-#define HC_HE3Fire_MASK 0x00100000
-#define HC_HPMType_MASK 0x000f0000
-#define HC_HEFlag_MASK 0x0000e000
-#define HC_HShading_MASK 0x00001c00
-#define HC_HPMValidN_MASK 0x00000200
-#define HC_HPLEND_MASK 0x00000100
-#define HC_HVCycle_MASK 0x000000ff
-#define HC_HVCycle_Style_MASK 0x000000c0
-#define HC_HVCycle_ChgA_MASK 0x00000030
-#define HC_HVCycle_ChgB_MASK 0x0000000c
-#define HC_HVCycle_ChgC_MASK 0x00000003
-#define HC_HPMType_Point 0x00000000
-#define HC_HPMType_Line 0x00010000
-#define HC_HPMType_Tri 0x00020000
-#define HC_HPMType_TriWF 0x00040000
-#define HC_HEFlag_NoAA 0x00000000
-#define HC_HEFlag_ab 0x00008000
-#define HC_HEFlag_bc 0x00004000
-#define HC_HEFlag_ca 0x00002000
-#define HC_HShading_Solid 0x00000000
-#define HC_HShading_FlatA 0x00000400
-#define HC_HShading_FlatB 0x00000800
-#define HC_HShading_FlatC 0x00000c00
-#define HC_HShading_Gouraud 0x00001000
-#define HC_HVCycle_Full 0x00000000
-#define HC_HVCycle_AFP 0x00000040
-#define HC_HVCycle_One 0x000000c0
-#define HC_HVCycle_NewA 0x00000000
-#define HC_HVCycle_AA 0x00000010
-#define HC_HVCycle_AB 0x00000020
-#define HC_HVCycle_AC 0x00000030
-#define HC_HVCycle_NewB 0x00000000
-#define HC_HVCycle_BA 0x00000004
-#define HC_HVCycle_BB 0x00000008
-#define HC_HVCycle_BC 0x0000000c
-#define HC_HVCycle_NewC 0x00000000
-#define HC_HVCycle_CA 0x00000001
-#define HC_HVCycle_CB 0x00000002
-#define HC_HVCycle_CC 0x00000003
-
-/* Command B
- */
-#define HC_HLPrst_MASK 0x00010000
-#define HC_HLLastP_MASK 0x00008000
-#define HC_HVPMSK_MASK 0x00007f80
-#define HC_HBFace_MASK 0x00000040
-#define HC_H2nd1VT_MASK 0x0000003f
-#define HC_HVPMSK_X 0x00004000
-#define HC_HVPMSK_Y 0x00002000
-#define HC_HVPMSK_Z 0x00001000
-#define HC_HVPMSK_W 0x00000800
-#define HC_HVPMSK_Cd 0x00000400
-#define HC_HVPMSK_Cs 0x00000200
-#define HC_HVPMSK_S 0x00000100
-#define HC_HVPMSK_T 0x00000080
-
-/* Enable Setting
- */
-#define HC_SubA_HEnable 0x0000
-#define HC_HenTXEnvMap_MASK 0x00200000
-#define HC_HenVertexCNT_MASK 0x00100000
-#define HC_HenCPUDAZ_MASK 0x00080000
-#define HC_HenDASZWC_MASK 0x00040000
-#define HC_HenFBCull_MASK 0x00020000
-#define HC_HenCW_MASK 0x00010000
-#define HC_HenAA_MASK 0x00008000
-#define HC_HenST_MASK 0x00004000
-#define HC_HenZT_MASK 0x00002000
-#define HC_HenZW_MASK 0x00001000
-#define HC_HenAT_MASK 0x00000800
-#define HC_HenAW_MASK 0x00000400
-#define HC_HenSP_MASK 0x00000200
-#define HC_HenLP_MASK 0x00000100
-#define HC_HenTXCH_MASK 0x00000080
-#define HC_HenTXMP_MASK 0x00000040
-#define HC_HenTXPP_MASK 0x00000020
-#define HC_HenTXTR_MASK 0x00000010
-#define HC_HenCS_MASK 0x00000008
-#define HC_HenFOG_MASK 0x00000004
-#define HC_HenABL_MASK 0x00000002
-#define HC_HenDT_MASK 0x00000001
-
-/* Z Setting
- */
-#define HC_SubA_HZWBBasL 0x0010
-#define HC_SubA_HZWBBasH 0x0011
-#define HC_SubA_HZWBType 0x0012
-#define HC_SubA_HZBiasL 0x0013
-#define HC_SubA_HZWBend 0x0014
-#define HC_SubA_HZWTMD 0x0015
-#define HC_SubA_HZWCDL 0x0016
-#define HC_SubA_HZWCTAGnum 0x0017
-#define HC_SubA_HZCYNum 0x0018
-#define HC_SubA_HZWCFire 0x0019
-/* HC_SubA_HZWBType
- */
-#define HC_HZWBType_MASK 0x00800000
-#define HC_HZBiasedWB_MASK 0x00400000
-#define HC_HZONEasFF_MASK 0x00200000
-#define HC_HZOONEasFF_MASK 0x00100000
-#define HC_HZWBFM_MASK 0x00030000
-#define HC_HZWBLoc_MASK 0x0000c000
-#define HC_HZWBPit_MASK 0x00003fff
-#define HC_HZWBFM_16 0x00000000
-#define HC_HZWBFM_32 0x00020000
-#define HC_HZWBFM_24 0x00030000
-#define HC_HZWBLoc_Local 0x00000000
-#define HC_HZWBLoc_SyS 0x00004000
-/* HC_SubA_HZWBend
- */
-#define HC_HZWBend_MASK 0x00ffe000
-#define HC_HZBiasH_MASK 0x000000ff
-#define HC_HZWBend_SHIFT 10
-/* HC_SubA_HZWTMD
- */
-#define HC_HZWTMD_MASK 0x00070000
-#define HC_HEBEBias_MASK 0x00007f00
-#define HC_HZNF_MASK 0x000000ff
-#define HC_HZWTMD_NeverPass 0x00000000
-#define HC_HZWTMD_LT 0x00010000
-#define HC_HZWTMD_EQ 0x00020000
-#define HC_HZWTMD_LE 0x00030000
-#define HC_HZWTMD_GT 0x00040000
-#define HC_HZWTMD_NE 0x00050000
-#define HC_HZWTMD_GE 0x00060000
-#define HC_HZWTMD_AllPass 0x00070000
-#define HC_HEBEBias_SHIFT 8
-/* HC_SubA_HZWCDL 0x0016
- */
-#define HC_HZWCDL_MASK 0x00ffffff
-/* HC_SubA_HZWCTAGnum 0x0017
- */
-#define HC_HZWCTAGnum_MASK 0x00ff0000
-#define HC_HZWCTAGnum_SHIFT 16
-#define HC_HZWCDH_MASK 0x000000ff
-#define HC_HZWCDH_SHIFT 0
-/* HC_SubA_HZCYNum 0x0018
- */
-#define HC_HZCYNum_MASK 0x00030000
-#define HC_HZCYNum_SHIFT 16
-#define HC_HZWCQWnum_MASK 0x00003fff
-#define HC_HZWCQWnum_SHIFT 0
-/* HC_SubA_HZWCFire 0x0019
- */
-#define HC_ZWCFire_MASK 0x00010000
-#define HC_HZWCQWnumLast_MASK 0x00003fff
-#define HC_HZWCQWnumLast_SHIFT 0
-
-/* Stencil Setting
- */
-#define HC_SubA_HSTREF 0x0023
-#define HC_SubA_HSTMD 0x0024
-/* HC_SubA_HSBFM
- */
-#define HC_HSBFM_MASK 0x00030000
-#define HC_HSBLoc_MASK 0x0000c000
-#define HC_HSBPit_MASK 0x00003fff
-/* HC_SubA_HSTREF
- */
-#define HC_HSTREF_MASK 0x00ff0000
-#define HC_HSTOPMSK_MASK 0x0000ff00
-#define HC_HSTBMSK_MASK 0x000000ff
-#define HC_HSTREF_SHIFT 16
-#define HC_HSTOPMSK_SHIFT 8
-/* HC_SubA_HSTMD
- */
-#define HC_HSTMD_MASK 0x00070000
-#define HC_HSTOPSF_MASK 0x000001c0
-#define HC_HSTOPSPZF_MASK 0x00000038
-#define HC_HSTOPSPZP_MASK 0x00000007
-#define HC_HSTMD_NeverPass 0x00000000
-#define HC_HSTMD_LT 0x00010000
-#define HC_HSTMD_EQ 0x00020000
-#define HC_HSTMD_LE 0x00030000
-#define HC_HSTMD_GT 0x00040000
-#define HC_HSTMD_NE 0x00050000
-#define HC_HSTMD_GE 0x00060000
-#define HC_HSTMD_AllPass 0x00070000
-#define HC_HSTOPSF_KEEP 0x00000000
-#define HC_HSTOPSF_ZERO 0x00000040
-#define HC_HSTOPSF_REPLACE 0x00000080
-#define HC_HSTOPSF_INCRSAT 0x000000c0
-#define HC_HSTOPSF_DECRSAT 0x00000100
-#define HC_HSTOPSF_INVERT 0x00000140
-#define HC_HSTOPSF_INCR 0x00000180
-#define HC_HSTOPSF_DECR 0x000001c0
-#define HC_HSTOPSPZF_KEEP 0x00000000
-#define HC_HSTOPSPZF_ZERO 0x00000008
-#define HC_HSTOPSPZF_REPLACE 0x00000010
-#define HC_HSTOPSPZF_INCRSAT 0x00000018
-#define HC_HSTOPSPZF_DECRSAT 0x00000020
-#define HC_HSTOPSPZF_INVERT 0x00000028
-#define HC_HSTOPSPZF_INCR 0x00000030
-#define HC_HSTOPSPZF_DECR 0x00000038
-#define HC_HSTOPSPZP_KEEP 0x00000000
-#define HC_HSTOPSPZP_ZERO 0x00000001
-#define HC_HSTOPSPZP_REPLACE 0x00000002
-#define HC_HSTOPSPZP_INCRSAT 0x00000003
-#define HC_HSTOPSPZP_DECRSAT 0x00000004
-#define HC_HSTOPSPZP_INVERT 0x00000005
-#define HC_HSTOPSPZP_INCR 0x00000006
-#define HC_HSTOPSPZP_DECR 0x00000007
-
-/* Alpha Setting
- */
-#define HC_SubA_HABBasL 0x0030
-#define HC_SubA_HABBasH 0x0031
-#define HC_SubA_HABFM 0x0032
-#define HC_SubA_HATMD 0x0033
-#define HC_SubA_HABLCsat 0x0034
-#define HC_SubA_HABLCop 0x0035
-#define HC_SubA_HABLAsat 0x0036
-#define HC_SubA_HABLAop 0x0037
-#define HC_SubA_HABLRCa 0x0038
-#define HC_SubA_HABLRFCa 0x0039
-#define HC_SubA_HABLRCbias 0x003a
-#define HC_SubA_HABLRCb 0x003b
-#define HC_SubA_HABLRFCb 0x003c
-#define HC_SubA_HABLRAa 0x003d
-#define HC_SubA_HABLRAb 0x003e
-/* HC_SubA_HABFM
- */
-#define HC_HABFM_MASK 0x00030000
-#define HC_HABLoc_MASK 0x0000c000
-#define HC_HABPit_MASK 0x000007ff
-/* HC_SubA_HATMD
- */
-#define HC_HATMD_MASK 0x00000700
-#define HC_HATREF_MASK 0x000000ff
-#define HC_HATMD_NeverPass 0x00000000
-#define HC_HATMD_LT 0x00000100
-#define HC_HATMD_EQ 0x00000200
-#define HC_HATMD_LE 0x00000300
-#define HC_HATMD_GT 0x00000400
-#define HC_HATMD_NE 0x00000500
-#define HC_HATMD_GE 0x00000600
-#define HC_HATMD_AllPass 0x00000700
-/* HC_SubA_HABLCsat
- */
-#define HC_HABLCsat_MASK 0x00010000
-#define HC_HABLCa_MASK 0x0000fc00
-#define HC_HABLCa_C_MASK 0x0000c000
-#define HC_HABLCa_OPC_MASK 0x00003c00
-#define HC_HABLFCa_MASK 0x000003f0
-#define HC_HABLFCa_C_MASK 0x00000300
-#define HC_HABLFCa_OPC_MASK 0x000000f0
-#define HC_HABLCbias_MASK 0x0000000f
-#define HC_HABLCbias_C_MASK 0x00000008
-#define HC_HABLCbias_OPC_MASK 0x00000007
-/*-- Define the input color.
- */
-#define HC_XC_Csrc 0x00000000
-#define HC_XC_Cdst 0x00000001
-#define HC_XC_Asrc 0x00000002
-#define HC_XC_Adst 0x00000003
-#define HC_XC_Fog 0x00000004
-#define HC_XC_HABLRC 0x00000005
-#define HC_XC_minSrcDst 0x00000006
-#define HC_XC_maxSrcDst 0x00000007
-#define HC_XC_mimAsrcInvAdst 0x00000008
-#define HC_XC_OPC 0x00000000
-#define HC_XC_InvOPC 0x00000010
-#define HC_XC_OPCp5 0x00000020
-/*-- Define the input Alpha
- */
-#define HC_XA_OPA 0x00000000
-#define HC_XA_InvOPA 0x00000010
-#define HC_XA_OPAp5 0x00000020
-#define HC_XA_0 0x00000000
-#define HC_XA_Asrc 0x00000001
-#define HC_XA_Adst 0x00000002
-#define HC_XA_Fog 0x00000003
-#define HC_XA_minAsrcFog 0x00000004
-#define HC_XA_minAsrcAdst 0x00000005
-#define HC_XA_maxAsrcFog 0x00000006
-#define HC_XA_maxAsrcAdst 0x00000007
-#define HC_XA_HABLRA 0x00000008
-#define HC_XA_minAsrcInvAdst 0x00000008
-#define HC_XA_HABLFRA 0x00000009
-/*--
- */
-#define HC_HABLCa_OPC (HC_XC_OPC << 10)
-#define HC_HABLCa_InvOPC (HC_XC_InvOPC << 10)
-#define HC_HABLCa_OPCp5 (HC_XC_OPCp5 << 10)
-#define HC_HABLCa_Csrc (HC_XC_Csrc << 10)
-#define HC_HABLCa_Cdst (HC_XC_Cdst << 10)
-#define HC_HABLCa_Asrc (HC_XC_Asrc << 10)
-#define HC_HABLCa_Adst (HC_XC_Adst << 10)
-#define HC_HABLCa_Fog (HC_XC_Fog << 10)
-#define HC_HABLCa_HABLRCa (HC_XC_HABLRC << 10)
-#define HC_HABLCa_minSrcDst (HC_XC_minSrcDst << 10)
-#define HC_HABLCa_maxSrcDst (HC_XC_maxSrcDst << 10)
-#define HC_HABLFCa_OPC (HC_XC_OPC << 4)
-#define HC_HABLFCa_InvOPC (HC_XC_InvOPC << 4)
-#define HC_HABLFCa_OPCp5 (HC_XC_OPCp5 << 4)
-#define HC_HABLFCa_Csrc (HC_XC_Csrc << 4)
-#define HC_HABLFCa_Cdst (HC_XC_Cdst << 4)
-#define HC_HABLFCa_Asrc (HC_XC_Asrc << 4)
-#define HC_HABLFCa_Adst (HC_XC_Adst << 4)
-#define HC_HABLFCa_Fog (HC_XC_Fog << 4)
-#define HC_HABLFCa_HABLRCa (HC_XC_HABLRC << 4)
-#define HC_HABLFCa_minSrcDst (HC_XC_minSrcDst << 4)
-#define HC_HABLFCa_maxSrcDst (HC_XC_maxSrcDst << 4)
-#define HC_HABLFCa_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 4)
-#define HC_HABLCbias_HABLRCbias 0x00000000
-#define HC_HABLCbias_Asrc 0x00000001
-#define HC_HABLCbias_Adst 0x00000002
-#define HC_HABLCbias_Fog 0x00000003
-#define HC_HABLCbias_Cin 0x00000004
-/* HC_SubA_HABLCop 0x0035
- */
-#define HC_HABLdot_MASK 0x00010000
-#define HC_HABLCop_MASK 0x00004000
-#define HC_HABLCb_MASK 0x00003f00
-#define HC_HABLCb_C_MASK 0x00003000
-#define HC_HABLCb_OPC_MASK 0x00000f00
-#define HC_HABLFCb_MASK 0x000000fc
-#define HC_HABLFCb_C_MASK 0x000000c0
-#define HC_HABLFCb_OPC_MASK 0x0000003c
-#define HC_HABLCshift_MASK 0x00000003
-#define HC_HABLCb_OPC (HC_XC_OPC << 8)
-#define HC_HABLCb_InvOPC (HC_XC_InvOPC << 8)
-#define HC_HABLCb_OPCp5 (HC_XC_OPCp5 << 8)
-#define HC_HABLCb_Csrc (HC_XC_Csrc << 8)
-#define HC_HABLCb_Cdst (HC_XC_Cdst << 8)
-#define HC_HABLCb_Asrc (HC_XC_Asrc << 8)
-#define HC_HABLCb_Adst (HC_XC_Adst << 8)
-#define HC_HABLCb_Fog (HC_XC_Fog << 8)
-#define HC_HABLCb_HABLRCa (HC_XC_HABLRC << 8)
-#define HC_HABLCb_minSrcDst (HC_XC_minSrcDst << 8)
-#define HC_HABLCb_maxSrcDst (HC_XC_maxSrcDst << 8)
-#define HC_HABLFCb_OPC (HC_XC_OPC << 2)
-#define HC_HABLFCb_InvOPC (HC_XC_InvOPC << 2)
-#define HC_HABLFCb_OPCp5 (HC_XC_OPCp5 << 2)
-#define HC_HABLFCb_Csrc (HC_XC_Csrc << 2)
-#define HC_HABLFCb_Cdst (HC_XC_Cdst << 2)
-#define HC_HABLFCb_Asrc (HC_XC_Asrc << 2)
-#define HC_HABLFCb_Adst (HC_XC_Adst << 2)
-#define HC_HABLFCb_Fog (HC_XC_Fog << 2)
-#define HC_HABLFCb_HABLRCb (HC_XC_HABLRC << 2)
-#define HC_HABLFCb_minSrcDst (HC_XC_minSrcDst << 2)
-#define HC_HABLFCb_maxSrcDst (HC_XC_maxSrcDst << 2)
-#define HC_HABLFCb_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 2)
-/* HC_SubA_HABLAsat 0x0036
- */
-#define HC_HABLAsat_MASK 0x00010000
-#define HC_HABLAa_MASK 0x0000fc00
-#define HC_HABLAa_A_MASK 0x0000c000
-#define HC_HABLAa_OPA_MASK 0x00003c00
-#define HC_HABLFAa_MASK 0x000003f0
-#define HC_HABLFAa_A_MASK 0x00000300
-#define HC_HABLFAa_OPA_MASK 0x000000f0
-#define HC_HABLAbias_MASK 0x0000000f
-#define HC_HABLAbias_A_MASK 0x00000008
-#define HC_HABLAbias_OPA_MASK 0x00000007
-#define HC_HABLAa_OPA (HC_XA_OPA << 10)
-#define HC_HABLAa_InvOPA (HC_XA_InvOPA << 10)
-#define HC_HABLAa_OPAp5 (HC_XA_OPAp5 << 10)
-#define HC_HABLAa_0 (HC_XA_0 << 10)
-#define HC_HABLAa_Asrc (HC_XA_Asrc << 10)
-#define HC_HABLAa_Adst (HC_XA_Adst << 10)
-#define HC_HABLAa_Fog (HC_XA_Fog << 10)
-#define HC_HABLAa_minAsrcFog (HC_XA_minAsrcFog << 10)
-#define HC_HABLAa_minAsrcAdst (HC_XA_minAsrcAdst << 10)
-#define HC_HABLAa_maxAsrcFog (HC_XA_maxAsrcFog << 10)
-#define HC_HABLAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 10)
-#define HC_HABLAa_HABLRA (HC_XA_HABLRA << 10)
-#define HC_HABLFAa_OPA (HC_XA_OPA << 4)
-#define HC_HABLFAa_InvOPA (HC_XA_InvOPA << 4)
-#define HC_HABLFAa_OPAp5 (HC_XA_OPAp5 << 4)
-#define HC_HABLFAa_0 (HC_XA_0 << 4)
-#define HC_HABLFAa_Asrc (HC_XA_Asrc << 4)
-#define HC_HABLFAa_Adst (HC_XA_Adst << 4)
-#define HC_HABLFAa_Fog (HC_XA_Fog << 4)
-#define HC_HABLFAa_minAsrcFog (HC_XA_minAsrcFog << 4)
-#define HC_HABLFAa_minAsrcAdst (HC_XA_minAsrcAdst << 4)
-#define HC_HABLFAa_maxAsrcFog (HC_XA_maxAsrcFog << 4)
-#define HC_HABLFAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 4)
-#define HC_HABLFAa_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 4)
-#define HC_HABLFAa_HABLFRA (HC_XA_HABLFRA << 4)
-#define HC_HABLAbias_HABLRAbias 0x00000000
-#define HC_HABLAbias_Asrc 0x00000001
-#define HC_HABLAbias_Adst 0x00000002
-#define HC_HABLAbias_Fog 0x00000003
-#define HC_HABLAbias_Aaa 0x00000004
-/* HC_SubA_HABLAop 0x0037
- */
-#define HC_HABLAop_MASK 0x00004000
-#define HC_HABLAb_MASK 0x00003f00
-#define HC_HABLAb_OPA_MASK 0x00000f00
-#define HC_HABLFAb_MASK 0x000000fc
-#define HC_HABLFAb_OPA_MASK 0x0000003c
-#define HC_HABLAshift_MASK 0x00000003
-#define HC_HABLAb_OPA (HC_XA_OPA << 8)
-#define HC_HABLAb_InvOPA (HC_XA_InvOPA << 8)
-#define HC_HABLAb_OPAp5 (HC_XA_OPAp5 << 8)
-#define HC_HABLAb_0 (HC_XA_0 << 8)
-#define HC_HABLAb_Asrc (HC_XA_Asrc << 8)
-#define HC_HABLAb_Adst (HC_XA_Adst << 8)
-#define HC_HABLAb_Fog (HC_XA_Fog << 8)
-#define HC_HABLAb_minAsrcFog (HC_XA_minAsrcFog << 8)
-#define HC_HABLAb_minAsrcAdst (HC_XA_minAsrcAdst << 8)
-#define HC_HABLAb_maxAsrcFog (HC_XA_maxAsrcFog << 8)
-#define HC_HABLAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 8)
-#define HC_HABLAb_HABLRA (HC_XA_HABLRA << 8)
-#define HC_HABLFAb_OPA (HC_XA_OPA << 2)
-#define HC_HABLFAb_InvOPA (HC_XA_InvOPA << 2)
-#define HC_HABLFAb_OPAp5 (HC_XA_OPAp5 << 2)
-#define HC_HABLFAb_0 (HC_XA_0 << 2)
-#define HC_HABLFAb_Asrc (HC_XA_Asrc << 2)
-#define HC_HABLFAb_Adst (HC_XA_Adst << 2)
-#define HC_HABLFAb_Fog (HC_XA_Fog << 2)
-#define HC_HABLFAb_minAsrcFog (HC_XA_minAsrcFog << 2)
-#define HC_HABLFAb_minAsrcAdst (HC_XA_minAsrcAdst << 2)
-#define HC_HABLFAb_maxAsrcFog (HC_XA_maxAsrcFog << 2)
-#define HC_HABLFAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 2)
-#define HC_HABLFAb_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 2)
-#define HC_HABLFAb_HABLFRA (HC_XA_HABLFRA << 2)
-/* HC_SubA_HABLRAa 0x003d
- */
-#define HC_HABLRAa_MASK 0x00ff0000
-#define HC_HABLRFAa_MASK 0x0000ff00
-#define HC_HABLRAbias_MASK 0x000000ff
-#define HC_HABLRAa_SHIFT 16
-#define HC_HABLRFAa_SHIFT 8
-/* HC_SubA_HABLRAb 0x003e
- */
-#define HC_HABLRAb_MASK 0x0000ff00
-#define HC_HABLRFAb_MASK 0x000000ff
-#define HC_HABLRAb_SHIFT 8
-
-/* Destination Setting
- */
-#define HC_SubA_HDBBasL 0x0040
-#define HC_SubA_HDBBasH 0x0041
-#define HC_SubA_HDBFM 0x0042
-#define HC_SubA_HFBBMSKL 0x0043
-#define HC_SubA_HROP 0x0044
-/* HC_SubA_HDBFM 0x0042
- */
-#define HC_HDBFM_MASK 0x001f0000
-#define HC_HDBLoc_MASK 0x0000c000
-#define HC_HDBPit_MASK 0x00003fff
-#define HC_HDBFM_RGB555 0x00000000
-#define HC_HDBFM_RGB565 0x00010000
-#define HC_HDBFM_ARGB4444 0x00020000
-#define HC_HDBFM_ARGB1555 0x00030000
-#define HC_HDBFM_BGR555 0x00040000
-#define HC_HDBFM_BGR565 0x00050000
-#define HC_HDBFM_ABGR4444 0x00060000
-#define HC_HDBFM_ABGR1555 0x00070000
-#define HC_HDBFM_ARGB0888 0x00080000
-#define HC_HDBFM_ARGB8888 0x00090000
-#define HC_HDBFM_ABGR0888 0x000a0000
-#define HC_HDBFM_ABGR8888 0x000b0000
-#define HC_HDBLoc_Local 0x00000000
-#define HC_HDBLoc_Sys 0x00004000
-/* HC_SubA_HROP 0x0044
- */
-#define HC_HROP_MASK 0x00000f00
-#define HC_HFBBMSKH_MASK 0x000000ff
-#define HC_HROP_BLACK 0x00000000
-#define HC_HROP_DPon 0x00000100
-#define HC_HROP_DPna 0x00000200
-#define HC_HROP_Pn 0x00000300
-#define HC_HROP_PDna 0x00000400
-#define HC_HROP_Dn 0x00000500
-#define HC_HROP_DPx 0x00000600
-#define HC_HROP_DPan 0x00000700
-#define HC_HROP_DPa 0x00000800
-#define HC_HROP_DPxn 0x00000900
-#define HC_HROP_D 0x00000a00
-#define HC_HROP_DPno 0x00000b00
-#define HC_HROP_P 0x00000c00
-#define HC_HROP_PDno 0x00000d00
-#define HC_HROP_DPo 0x00000e00
-#define HC_HROP_WHITE 0x00000f00
-
-/* Fog Setting
- */
-#define HC_SubA_HFogLF 0x0050
-#define HC_SubA_HFogCL 0x0051
-#define HC_SubA_HFogCH 0x0052
-#define HC_SubA_HFogStL 0x0053
-#define HC_SubA_HFogStH 0x0054
-#define HC_SubA_HFogOOdMF 0x0055
-#define HC_SubA_HFogOOdEF 0x0056
-#define HC_SubA_HFogEndL 0x0057
-#define HC_SubA_HFogDenst 0x0058
-/* HC_SubA_FogLF 0x0050
- */
-#define HC_FogLF_MASK 0x00000010
-#define HC_FogEq_MASK 0x00000008
-#define HC_FogMD_MASK 0x00000007
-#define HC_FogMD_LocalFog 0x00000000
-#define HC_FogMD_LinearFog 0x00000002
-#define HC_FogMD_ExponentialFog 0x00000004
-#define HC_FogMD_Exponential2Fog 0x00000005
-/* #define HC_FogMD_FogTable 0x00000003 */
-
-/* HC_SubA_HFogDenst 0x0058
- */
-#define HC_FogDenst_MASK 0x001fff00
-#define HC_FogEndL_MASK 0x000000ff
-
-/* Texture subtype definitions
- */
-#define HC_SubType_Tex0 0x00000000
-#define HC_SubType_Tex1 0x00000001
-#define HC_SubType_TexGeneral 0x000000fe
-
-/* Attribute of texture n
- */
-#define HC_SubA_HTXnL0BasL 0x0000
-#define HC_SubA_HTXnL1BasL 0x0001
-#define HC_SubA_HTXnL2BasL 0x0002
-#define HC_SubA_HTXnL3BasL 0x0003
-#define HC_SubA_HTXnL4BasL 0x0004
-#define HC_SubA_HTXnL5BasL 0x0005
-#define HC_SubA_HTXnL6BasL 0x0006
-#define HC_SubA_HTXnL7BasL 0x0007
-#define HC_SubA_HTXnL8BasL 0x0008
-#define HC_SubA_HTXnL9BasL 0x0009
-#define HC_SubA_HTXnLaBasL 0x000a
-#define HC_SubA_HTXnLbBasL 0x000b
-#define HC_SubA_HTXnLcBasL 0x000c
-#define HC_SubA_HTXnLdBasL 0x000d
-#define HC_SubA_HTXnLeBasL 0x000e
-#define HC_SubA_HTXnLfBasL 0x000f
-#define HC_SubA_HTXnL10BasL 0x0010
-#define HC_SubA_HTXnL11BasL 0x0011
-#define HC_SubA_HTXnL012BasH 0x0020
-#define HC_SubA_HTXnL345BasH 0x0021
-#define HC_SubA_HTXnL678BasH 0x0022
-#define HC_SubA_HTXnL9abBasH 0x0023
-#define HC_SubA_HTXnLcdeBasH 0x0024
-#define HC_SubA_HTXnLf1011BasH 0x0025
-#define HC_SubA_HTXnL0Pit 0x002b
-#define HC_SubA_HTXnL1Pit 0x002c
-#define HC_SubA_HTXnL2Pit 0x002d
-#define HC_SubA_HTXnL3Pit 0x002e
-#define HC_SubA_HTXnL4Pit 0x002f
-#define HC_SubA_HTXnL5Pit 0x0030
-#define HC_SubA_HTXnL6Pit 0x0031
-#define HC_SubA_HTXnL7Pit 0x0032
-#define HC_SubA_HTXnL8Pit 0x0033
-#define HC_SubA_HTXnL9Pit 0x0034
-#define HC_SubA_HTXnLaPit 0x0035
-#define HC_SubA_HTXnLbPit 0x0036
-#define HC_SubA_HTXnLcPit 0x0037
-#define HC_SubA_HTXnLdPit 0x0038
-#define HC_SubA_HTXnLePit 0x0039
-#define HC_SubA_HTXnLfPit 0x003a
-#define HC_SubA_HTXnL10Pit 0x003b
-#define HC_SubA_HTXnL11Pit 0x003c
-#define HC_SubA_HTXnL0_5WE 0x004b
-#define HC_SubA_HTXnL6_bWE 0x004c
-#define HC_SubA_HTXnLc_11WE 0x004d
-#define HC_SubA_HTXnL0_5HE 0x0051
-#define HC_SubA_HTXnL6_bHE 0x0052
-#define HC_SubA_HTXnLc_11HE 0x0053
-#define HC_SubA_HTXnL0OS 0x0077
-#define HC_SubA_HTXnTB 0x0078
-#define HC_SubA_HTXnMPMD 0x0079
-#define HC_SubA_HTXnCLODu 0x007a
-#define HC_SubA_HTXnFM 0x007b
-#define HC_SubA_HTXnTRCH 0x007c
-#define HC_SubA_HTXnTRCL 0x007d
-#define HC_SubA_HTXnTBC 0x007e
-#define HC_SubA_HTXnTRAH 0x007f
-#define HC_SubA_HTXnTBLCsat 0x0080
-#define HC_SubA_HTXnTBLCop 0x0081
-#define HC_SubA_HTXnTBLMPfog 0x0082
-#define HC_SubA_HTXnTBLAsat 0x0083
-#define HC_SubA_HTXnTBLRCa 0x0085
-#define HC_SubA_HTXnTBLRCb 0x0086
-#define HC_SubA_HTXnTBLRCc 0x0087
-#define HC_SubA_HTXnTBLRCbias 0x0088
-#define HC_SubA_HTXnTBLRAa 0x0089
-#define HC_SubA_HTXnTBLRFog 0x008a
-#define HC_SubA_HTXnBumpM00 0x0090
-#define HC_SubA_HTXnBumpM01 0x0091
-#define HC_SubA_HTXnBumpM10 0x0092
-#define HC_SubA_HTXnBumpM11 0x0093
-#define HC_SubA_HTXnLScale 0x0094
-#define HC_SubA_HTXSMD 0x0000
-/* HC_SubA_HTXnL012BasH 0x0020
- */
-#define HC_HTXnL0BasH_MASK 0x000000ff
-#define HC_HTXnL1BasH_MASK 0x0000ff00
-#define HC_HTXnL2BasH_MASK 0x00ff0000
-#define HC_HTXnL1BasH_SHIFT 8
-#define HC_HTXnL2BasH_SHIFT 16
-/* HC_SubA_HTXnL345BasH 0x0021
- */
-#define HC_HTXnL3BasH_MASK 0x000000ff
-#define HC_HTXnL4BasH_MASK 0x0000ff00
-#define HC_HTXnL5BasH_MASK 0x00ff0000
-#define HC_HTXnL4BasH_SHIFT 8
-#define HC_HTXnL5BasH_SHIFT 16
-/* HC_SubA_HTXnL678BasH 0x0022
- */
-#define HC_HTXnL6BasH_MASK 0x000000ff
-#define HC_HTXnL7BasH_MASK 0x0000ff00
-#define HC_HTXnL8BasH_MASK 0x00ff0000
-#define HC_HTXnL7BasH_SHIFT 8
-#define HC_HTXnL8BasH_SHIFT 16
-/* HC_SubA_HTXnL9abBasH 0x0023
- */
-#define HC_HTXnL9BasH_MASK 0x000000ff
-#define HC_HTXnLaBasH_MASK 0x0000ff00
-#define HC_HTXnLbBasH_MASK 0x00ff0000
-#define HC_HTXnLaBasH_SHIFT 8
-#define HC_HTXnLbBasH_SHIFT 16
-/* HC_SubA_HTXnLcdeBasH 0x0024
- */
-#define HC_HTXnLcBasH_MASK 0x000000ff
-#define HC_HTXnLdBasH_MASK 0x0000ff00
-#define HC_HTXnLeBasH_MASK 0x00ff0000
-#define HC_HTXnLdBasH_SHIFT 8
-#define HC_HTXnLeBasH_SHIFT 16
-/* HC_SubA_HTXnLcdeBasH 0x0025
- */
-#define HC_HTXnLfBasH_MASK 0x000000ff
-#define HC_HTXnL10BasH_MASK 0x0000ff00
-#define HC_HTXnL11BasH_MASK 0x00ff0000
-#define HC_HTXnL10BasH_SHIFT 8
-#define HC_HTXnL11BasH_SHIFT 16
-/* HC_SubA_HTXnL0Pit 0x002b
- */
-#define HC_HTXnLnPit_MASK 0x00003fff
-#define HC_HTXnEnPit_MASK 0x00080000
-#define HC_HTXnLnPitE_MASK 0x00f00000
-#define HC_HTXnLnPitE_SHIFT 20
-/* HC_SubA_HTXnL0_5WE 0x004b
- */
-#define HC_HTXnL0WE_MASK 0x0000000f
-#define HC_HTXnL1WE_MASK 0x000000f0
-#define HC_HTXnL2WE_MASK 0x00000f00
-#define HC_HTXnL3WE_MASK 0x0000f000
-#define HC_HTXnL4WE_MASK 0x000f0000
-#define HC_HTXnL5WE_MASK 0x00f00000
-#define HC_HTXnL1WE_SHIFT 4
-#define HC_HTXnL2WE_SHIFT 8
-#define HC_HTXnL3WE_SHIFT 12
-#define HC_HTXnL4WE_SHIFT 16
-#define HC_HTXnL5WE_SHIFT 20
-/* HC_SubA_HTXnL6_bWE 0x004c
- */
-#define HC_HTXnL6WE_MASK 0x0000000f
-#define HC_HTXnL7WE_MASK 0x000000f0
-#define HC_HTXnL8WE_MASK 0x00000f00
-#define HC_HTXnL9WE_MASK 0x0000f000
-#define HC_HTXnLaWE_MASK 0x000f0000
-#define HC_HTXnLbWE_MASK 0x00f00000
-#define HC_HTXnL7WE_SHIFT 4
-#define HC_HTXnL8WE_SHIFT 8
-#define HC_HTXnL9WE_SHIFT 12
-#define HC_HTXnLaWE_SHIFT 16
-#define HC_HTXnLbWE_SHIFT 20
-/* HC_SubA_HTXnLc_11WE 0x004d
- */
-#define HC_HTXnLcWE_MASK 0x0000000f
-#define HC_HTXnLdWE_MASK 0x000000f0
-#define HC_HTXnLeWE_MASK 0x00000f00
-#define HC_HTXnLfWE_MASK 0x0000f000
-#define HC_HTXnL10WE_MASK 0x000f0000
-#define HC_HTXnL11WE_MASK 0x00f00000
-#define HC_HTXnLdWE_SHIFT 4
-#define HC_HTXnLeWE_SHIFT 8
-#define HC_HTXnLfWE_SHIFT 12
-#define HC_HTXnL10WE_SHIFT 16
-#define HC_HTXnL11WE_SHIFT 20
-/* HC_SubA_HTXnL0_5HE 0x0051
- */
-#define HC_HTXnL0HE_MASK 0x0000000f
-#define HC_HTXnL1HE_MASK 0x000000f0
-#define HC_HTXnL2HE_MASK 0x00000f00
-#define HC_HTXnL3HE_MASK 0x0000f000
-#define HC_HTXnL4HE_MASK 0x000f0000
-#define HC_HTXnL5HE_MASK 0x00f00000
-#define HC_HTXnL1HE_SHIFT 4
-#define HC_HTXnL2HE_SHIFT 8
-#define HC_HTXnL3HE_SHIFT 12
-#define HC_HTXnL4HE_SHIFT 16
-#define HC_HTXnL5HE_SHIFT 20
-/* HC_SubA_HTXnL6_bHE 0x0052
- */
-#define HC_HTXnL6HE_MASK 0x0000000f
-#define HC_HTXnL7HE_MASK 0x000000f0
-#define HC_HTXnL8HE_MASK 0x00000f00
-#define HC_HTXnL9HE_MASK 0x0000f000
-#define HC_HTXnLaHE_MASK 0x000f0000
-#define HC_HTXnLbHE_MASK 0x00f00000
-#define HC_HTXnL7HE_SHIFT 4
-#define HC_HTXnL8HE_SHIFT 8
-#define HC_HTXnL9HE_SHIFT 12
-#define HC_HTXnLaHE_SHIFT 16
-#define HC_HTXnLbHE_SHIFT 20
-/* HC_SubA_HTXnLc_11HE 0x0053
- */
-#define HC_HTXnLcHE_MASK 0x0000000f
-#define HC_HTXnLdHE_MASK 0x000000f0
-#define HC_HTXnLeHE_MASK 0x00000f00
-#define HC_HTXnLfHE_MASK 0x0000f000
-#define HC_HTXnL10HE_MASK 0x000f0000
-#define HC_HTXnL11HE_MASK 0x00f00000
-#define HC_HTXnLdHE_SHIFT 4
-#define HC_HTXnLeHE_SHIFT 8
-#define HC_HTXnLfHE_SHIFT 12
-#define HC_HTXnL10HE_SHIFT 16
-#define HC_HTXnL11HE_SHIFT 20
-/* HC_SubA_HTXnL0OS 0x0077
- */
-#define HC_HTXnL0OS_MASK 0x003ff000
-#define HC_HTXnLVmax_MASK 0x00000fc0
-#define HC_HTXnLVmin_MASK 0x0000003f
-#define HC_HTXnL0OS_SHIFT 12
-#define HC_HTXnLVmax_SHIFT 6
-/* HC_SubA_HTXnTB 0x0078
- */
-#define HC_HTXnTB_MASK 0x00f00000
-#define HC_HTXnFLSe_MASK 0x0000e000
-#define HC_HTXnFLSs_MASK 0x00001c00
-#define HC_HTXnFLTe_MASK 0x00000380
-#define HC_HTXnFLTs_MASK 0x00000070
-#define HC_HTXnFLDs_MASK 0x0000000f
-#define HC_HTXnTB_NoTB 0x00000000
-#define HC_HTXnTB_TBC_S 0x00100000
-#define HC_HTXnTB_TBC_T 0x00200000
-#define HC_HTXnTB_TB_S 0x00400000
-#define HC_HTXnTB_TB_T 0x00800000
-
-/* The "S" in FLS? means the S texture coordinate, and a "T" means the T
- * texture coordinage. The "e" in FL?e means the magnification ("enlarge")
- * mode, and the "s" in FL?s means the minification ("shrink") mode.
- *
- * The "D" in FLD? means the intermipmap level mode. That means that the
- * GL_*_MIPMAP_LINEAR modes get FLDs_Linear, and the GL_*_MIPMAP_NEAREST modes
- * get FLDs_Nearest.
- */
-#define HC_HTXnFLSe_Nearest 0x00000000
-#define HC_HTXnFLSe_Linear 0x00002000
-#define HC_HTXnFLSe_NonLinear 0x00004000
-#define HC_HTXnFLSe_Sharp 0x00008000
-#define HC_HTXnFLSe_Flat_Gaussian_Cubic 0x0000c000
-#define HC_HTXnFLSs_Nearest 0x00000000
-#define HC_HTXnFLSs_Linear 0x00000400
-#define HC_HTXnFLSs_NonLinear 0x00000800
-#define HC_HTXnFLSs_Flat_Gaussian_Cubic 0x00001800
-#define HC_HTXnFLTe_Nearest 0x00000000
-#define HC_HTXnFLTe_Linear 0x00000080
-#define HC_HTXnFLTe_NonLinear 0x00000100
-#define HC_HTXnFLTe_Sharp 0x00000180
-#define HC_HTXnFLTe_Flat_Gaussian_Cubic 0x00000300
-#define HC_HTXnFLTs_Nearest 0x00000000
-#define HC_HTXnFLTs_Linear 0x00000010
-#define HC_HTXnFLTs_NonLinear 0x00000020
-#define HC_HTXnFLTs_Flat_Gaussian_Cubic 0x00000060
-#define HC_HTXnFLDs_Tex0 0x00000000
-#define HC_HTXnFLDs_Nearest 0x00000001
-#define HC_HTXnFLDs_Linear 0x00000002
-#define HC_HTXnFLDs_NonLinear 0x00000003
-#define HC_HTXnFLDs_Dither 0x00000004
-#define HC_HTXnFLDs_ConstLOD 0x00000005
-#define HC_HTXnFLDs_Ani 0x00000006
-#define HC_HTXnFLDs_AniDither 0x00000007
-
-/* HC_SubA_HTXnMPMD 0x0079
- */
-#define HC_HTXnMPMD_SMASK 0x00070000
-#define HC_HTXnMPMD_TMASK 0x00380000
-#define HC_HTXnLODDTf_MASK 0x00000007
-#define HC_HTXnXY2ST_MASK 0x00000008
-#define HC_HTXnMPMD_Tsingle 0x00000000
-#define HC_HTXnMPMD_Tclamp 0x00080000
-#define HC_HTXnMPMD_Trepeat 0x00100000
-#define HC_HTXnMPMD_Tmirror 0x00180000
-#define HC_HTXnMPMD_Twrap 0x00200000
-#define HC_HTXnMPMD_Ssingle 0x00000000
-#define HC_HTXnMPMD_Sclamp 0x00010000
-#define HC_HTXnMPMD_Srepeat 0x00020000
-#define HC_HTXnMPMD_Smirror 0x00030000
-#define HC_HTXnMPMD_Swrap 0x00040000
-/* HC_SubA_HTXnCLODu 0x007a
- */
-#define HC_HTXnCLODu_MASK 0x000ffc00
-#define HC_HTXnCLODd_MASK 0x000003ff
-#define HC_HTXnCLODu_SHIFT 10
-/* HC_SubA_HTXnFM 0x007b
- */
-#define HC_HTXnFM_MASK 0x00ff0000
-#define HC_HTXnLoc_MASK 0x00000003
-#define HC_HTXnFM_INDEX 0x00000000 /* 0 << 19 */
-#define HC_HTXnFM_Intensity 0x00080000 /* 1 << 19 */
-#define HC_HTXnFM_Lum 0x00100000 /* 2 << 19 */
-#define HC_HTXnFM_Alpha 0x00180000 /* 3 << 19 */
-#define HC_HTXnFM_DX 0x00280000 /* 5 << 19 */
-#define HC_HTXnFM_BUMPMAP 0x00380000 /* 7 << 19 */
-#define HC_HTXnFM_ARGB16 0x00880000 /* 17 << 19 */
-#define HC_HTXnFM_ARGB32 0x00980000 /* 19 << 19 */
-#define HC_HTXnFM_ABGR16 0x00a80000 /* 21 << 19 */
-#define HC_HTXnFM_ABGR32 0x00b80000 /* 23 << 19 */
-#define HC_HTXnFM_RGBA16 0x00c80000 /* 25 << 19 */
-#define HC_HTXnFM_RGBA32 0x00d80000 /* 27 << 19 */
-#define HC_HTXnFM_BGRA16 0x00e80000 /* 29 << 19 */
-#define HC_HTXnFM_BGRA32 0x00f80000 /* 31 << 19 */
-#define HC_HTXnFM_Index1 (HC_HTXnFM_INDEX | 0x00000000)
-#define HC_HTXnFM_Index2 (HC_HTXnFM_INDEX | 0x00010000)
-#define HC_HTXnFM_Index4 (HC_HTXnFM_INDEX | 0x00020000)
-#define HC_HTXnFM_Index8 (HC_HTXnFM_INDEX | 0x00030000)
-#define HC_HTXnFM_T1 (HC_HTXnFM_Intensity | 0x00000000)
-#define HC_HTXnFM_T2 (HC_HTXnFM_Intensity | 0x00010000)
-#define HC_HTXnFM_T4 (HC_HTXnFM_Intensity | 0x00020000)
-#define HC_HTXnFM_T8 (HC_HTXnFM_Intensity | 0x00030000)
-#define HC_HTXnFM_L1 (HC_HTXnFM_Lum | 0x00000000)
-#define HC_HTXnFM_L2 (HC_HTXnFM_Lum | 0x00010000)
-#define HC_HTXnFM_L4 (HC_HTXnFM_Lum | 0x00020000)
-#define HC_HTXnFM_L8 (HC_HTXnFM_Lum | 0x00030000)
-#define HC_HTXnFM_AL44 (HC_HTXnFM_Lum | 0x00040000)
-#define HC_HTXnFM_AL88 (HC_HTXnFM_Lum | 0x00050000)
-#define HC_HTXnFM_A1 (HC_HTXnFM_Alpha | 0x00000000)
-#define HC_HTXnFM_A2 (HC_HTXnFM_Alpha | 0x00010000)
-#define HC_HTXnFM_A4 (HC_HTXnFM_Alpha | 0x00020000)
-#define HC_HTXnFM_A8 (HC_HTXnFM_Alpha | 0x00030000)
-#define HC_HTXnFM_DX1 (HC_HTXnFM_DX | 0x00010000)
-#define HC_HTXnFM_DX23 (HC_HTXnFM_DX | 0x00020000)
-#define HC_HTXnFM_DX45 (HC_HTXnFM_DX | 0x00030000)
-#define HC_HTXnFM_RGB555 (HC_HTXnFM_ARGB16 | 0x00000000)
-#define HC_HTXnFM_RGB565 (HC_HTXnFM_ARGB16 | 0x00010000)
-#define HC_HTXnFM_ARGB1555 (HC_HTXnFM_ARGB16 | 0x00020000)
-#define HC_HTXnFM_ARGB4444 (HC_HTXnFM_ARGB16 | 0x00030000)
-#define HC_HTXnFM_ARGB0888 (HC_HTXnFM_ARGB32 | 0x00000000)
-#define HC_HTXnFM_ARGB8888 (HC_HTXnFM_ARGB32 | 0x00010000)
-#define HC_HTXnFM_BGR555 (HC_HTXnFM_ABGR16 | 0x00000000)
-#define HC_HTXnFM_BGR565 (HC_HTXnFM_ABGR16 | 0x00010000)
-#define HC_HTXnFM_ABGR1555 (HC_HTXnFM_ABGR16 | 0x00020000)
-#define HC_HTXnFM_ABGR4444 (HC_HTXnFM_ABGR16 | 0x00030000)
-#define HC_HTXnFM_ABGR0888 (HC_HTXnFM_ABGR32 | 0x00000000)
-#define HC_HTXnFM_ABGR8888 (HC_HTXnFM_ABGR32 | 0x00010000)
-#define HC_HTXnFM_RGBA5550 (HC_HTXnFM_RGBA16 | 0x00000000)
-#define HC_HTXnFM_RGBA5551 (HC_HTXnFM_RGBA16 | 0x00020000)
-#define HC_HTXnFM_RGBA4444 (HC_HTXnFM_RGBA16 | 0x00030000)
-#define HC_HTXnFM_RGBA8880 (HC_HTXnFM_RGBA32 | 0x00000000)
-#define HC_HTXnFM_RGBA8888 (HC_HTXnFM_RGBA32 | 0x00010000)
-#define HC_HTXnFM_BGRA5550 (HC_HTXnFM_BGRA16 | 0x00000000)
-#define HC_HTXnFM_BGRA5551 (HC_HTXnFM_BGRA16 | 0x00020000)
-#define HC_HTXnFM_BGRA4444 (HC_HTXnFM_BGRA16 | 0x00030000)
-#define HC_HTXnFM_BGRA8880 (HC_HTXnFM_BGRA32 | 0x00000000)
-#define HC_HTXnFM_BGRA8888 (HC_HTXnFM_BGRA32 | 0x00010000)
-#define HC_HTXnFM_VU88 (HC_HTXnFM_BUMPMAP | 0x00000000)
-#define HC_HTXnFM_LVU655 (HC_HTXnFM_BUMPMAP | 0x00010000)
-#define HC_HTXnFM_LVU888 (HC_HTXnFM_BUMPMAP | 0x00020000)
-#define HC_HTXnLoc_Local 0x00000000
-#define HC_HTXnLoc_Sys 0x00000002
-#define HC_HTXnLoc_AGP 0x00000003
-/* HC_SubA_HTXnTRAH 0x007f
- */
-#define HC_HTXnTRAH_MASK 0x00ff0000
-#define HC_HTXnTRAL_MASK 0x0000ff00
-#define HC_HTXnTBA_MASK 0x000000ff
-#define HC_HTXnTRAH_SHIFT 16
-#define HC_HTXnTRAL_SHIFT 8
-
-/*-- Define the input texture, for below
- */
-#define HC_XTC_TOPC 0x00000000
-#define HC_XTC_InvTOPC 0x00000010
-#define HC_XTC_TOPCp5 0x00000020
-#define HC_XTC_Cbias 0x00000000
-#define HC_XTC_InvCbias 0x00000010
-#define HC_XTC_0 0x00000000
-#define HC_XTC_Dif 0x00000001
-#define HC_XTC_Spec 0x00000002
-#define HC_XTC_Tex 0x00000003
-#define HC_XTC_Cur 0x00000004
-#define HC_XTC_Adif 0x00000005
-#define HC_XTC_Fog 0x00000006
-#define HC_XTC_Atex 0x00000007
-#define HC_XTC_Acur 0x00000008
-#define HC_XTC_HTXnTBLRC 0x00000009
-#define HC_XTC_Ctexnext 0x0000000a
-/** HC_SubA_HTXnTBLCsat 0x0080
- */
-#define HC_HTXnTBLCsat_MASK 0x00800000
-#define HC_HTXnTBLCa_MASK 0x000fc000
-#define HC_HTXnTBLCb_MASK 0x00001f80
-#define HC_HTXnTBLCc_MASK 0x0000003f
-#define HC_HTXnTBLCa_TOPC (HC_XTC_TOPC << 14)
-#define HC_HTXnTBLCa_InvTOPC (HC_XTC_InvTOPC << 14)
-#define HC_HTXnTBLCa_TOPCp5 (HC_XTC_TOPCp5 << 14)
-#define HC_HTXnTBLCa_0 (HC_XTC_0 << 14)
-#define HC_HTXnTBLCa_Dif (HC_XTC_Dif << 14)
-#define HC_HTXnTBLCa_Spec (HC_XTC_Spec << 14)
-#define HC_HTXnTBLCa_Tex (HC_XTC_Tex << 14)
-#define HC_HTXnTBLCa_Cur (HC_XTC_Cur << 14)
-#define HC_HTXnTBLCa_Adif (HC_XTC_Adif << 14)
-#define HC_HTXnTBLCa_Fog (HC_XTC_Fog << 14)
-#define HC_HTXnTBLCa_Atex (HC_XTC_Atex << 14)
-#define HC_HTXnTBLCa_Acur (HC_XTC_Acur << 14)
-#define HC_HTXnTBLCa_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14)
-#define HC_HTXnTBLCa_Ctexnext (HC_XTC_Ctexnext << 14)
-#define HC_HTXnTBLCb_TOPC (HC_XTC_TOPC << 7)
-#define HC_HTXnTBLCb_InvTOPC (HC_XTC_InvTOPC << 7)
-#define HC_HTXnTBLCb_TOPCp5 (HC_XTC_TOPCp5 << 7)
-#define HC_HTXnTBLCb_0 (HC_XTC_0 << 7)
-#define HC_HTXnTBLCb_Dif (HC_XTC_Dif << 7)
-#define HC_HTXnTBLCb_Spec (HC_XTC_Spec << 7)
-#define HC_HTXnTBLCb_Tex (HC_XTC_Tex << 7)
-#define HC_HTXnTBLCb_Cur (HC_XTC_Cur << 7)
-#define HC_HTXnTBLCb_Adif (HC_XTC_Adif << 7)
-#define HC_HTXnTBLCb_Fog (HC_XTC_Fog << 7)
-#define HC_HTXnTBLCb_Atex (HC_XTC_Atex << 7)
-#define HC_HTXnTBLCb_Acur (HC_XTC_Acur << 7)
-#define HC_HTXnTBLCb_HTXnTBLRC (HC_XTC_HTXnTBLRC << 7)
-#define HC_HTXnTBLCb_Ctexnext (HC_XTC_Ctexnext << 7)
-#define HC_HTXnTBLCc_TOPC (HC_XTC_TOPC << 0)
-#define HC_HTXnTBLCc_InvTOPC (HC_XTC_InvTOPC << 0)
-#define HC_HTXnTBLCc_TOPCp5 (HC_XTC_TOPCp5 << 0)
-#define HC_HTXnTBLCc_0 (HC_XTC_0 << 0)
-#define HC_HTXnTBLCc_Dif (HC_XTC_Dif << 0)
-#define HC_HTXnTBLCc_Spec (HC_XTC_Spec << 0)
-#define HC_HTXnTBLCc_Tex (HC_XTC_Tex << 0)
-#define HC_HTXnTBLCc_Cur (HC_XTC_Cur << 0)
-#define HC_HTXnTBLCc_Adif (HC_XTC_Adif << 0)
-#define HC_HTXnTBLCc_Fog (HC_XTC_Fog << 0)
-#define HC_HTXnTBLCc_Atex (HC_XTC_Atex << 0)
-#define HC_HTXnTBLCc_Acur (HC_XTC_Acur << 0)
-#define HC_HTXnTBLCc_HTXnTBLRC (HC_XTC_HTXnTBLRC << 0)
-#define HC_HTXnTBLCc_Ctexnext (HC_XTC_Ctexnext << 0)
-/* HC_SubA_HTXnTBLCop 0x0081
- */
-#define HC_HTXnTBLdot_MASK 0x00c00000
-#define HC_HTXnTBLCop_MASK 0x00380000
-#define HC_HTXnTBLCbias_MASK 0x0007c000
-#define HC_HTXnTBLCshift_MASK 0x00001800
-#define HC_HTXnTBLAop_MASK 0x00000380
-#define HC_HTXnTBLAbias_MASK 0x00000078
-#define HC_HTXnTBLAshift_MASK 0x00000003
-#define HC_HTXnTBLDOT3 0x00800000
-#define HC_HTXnTBLDOT4 0x00c00000
-#define HC_HTXnTBLCop_Add 0x00000000
-#define HC_HTXnTBLCop_Sub 0x00080000
-#define HC_HTXnTBLCop_Min 0x00100000
-#define HC_HTXnTBLCop_Max 0x00180000
-#define HC_HTXnTBLCop_Mask 0x00200000
-#define HC_HTXnTBLCbias_Cbias (HC_XTC_Cbias << 14)
-#define HC_HTXnTBLCbias_InvCbias (HC_XTC_InvCbias << 14)
-#define HC_HTXnTBLCbias_0 (HC_XTC_0 << 14)
-#define HC_HTXnTBLCbias_Dif (HC_XTC_Dif << 14)
-#define HC_HTXnTBLCbias_Spec (HC_XTC_Spec << 14)
-#define HC_HTXnTBLCbias_Tex (HC_XTC_Tex << 14)
-#define HC_HTXnTBLCbias_Cur (HC_XTC_Cur << 14)
-#define HC_HTXnTBLCbias_Adif (HC_XTC_Adif << 14)
-#define HC_HTXnTBLCbias_Fog (HC_XTC_Fog << 14)
-#define HC_HTXnTBLCbias_Atex (HC_XTC_Atex << 14)
-#define HC_HTXnTBLCbias_Acur (HC_XTC_Acur << 14)
-#define HC_HTXnTBLCbias_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14)
-#define HC_HTXnTBLCshift_1 0x00000000
-#define HC_HTXnTBLCshift_2 0x00000800
-#define HC_HTXnTBLCshift_No 0x00001000
-#define HC_HTXnTBLCshift_DotP 0x00001800
-#define HC_HTXnTBLAop_Add 0x00000000
-#define HC_HTXnTBLAop_Sub 0x00000080
-#define HC_HTXnTBLAop_Min 0x00000100
-#define HC_HTXnTBLAop_Max 0x00000180
-#define HC_HTXnTBLAop_Mask 0x00000200
-#define HC_HTXnTBLAbias_Inv 0x00000040
-#define HC_HTXnTBLAbias_Adif 0x00000000
-#define HC_HTXnTBLAbias_Fog 0x00000008
-#define HC_HTXnTBLAbias_Acur 0x00000010
-#define HC_HTXnTBLAbias_HTXnTBLRAbias 0x00000018
-#define HC_HTXnTBLAbias_Atex 0x00000020
-#define HC_HTXnTBLAshift_1 0x00000000
-#define HC_HTXnTBLAshift_2 0x00000001
-#define HC_HTXnTBLAshift_No 0x00000002
-#define HC_HTXnTBLAshift_DotP 0x00000003
-/* HC_SubA_HTXnTBLMPFog 0x0082
- */
-#define HC_HTXnTBLMPfog_MASK 0x00e00000
-#define HC_HTXnTBLMPfog_0 0x00000000
-#define HC_HTXnTBLMPfog_Adif 0x00200000
-#define HC_HTXnTBLMPfog_Fog 0x00400000
-#define HC_HTXnTBLMPfog_Atex 0x00600000
-#define HC_HTXnTBLMPfog_Acur 0x00800000
-#define HC_HTXnTBLMPfog_GHTXnTBLRFog 0x00a00000
-/* HC_SubA_HTXnTBLAsat 0x0083
- *-- Define the texture alpha input.
- */
-#define HC_XTA_TOPA 0x00000000
-#define HC_XTA_InvTOPA 0x00000008
-#define HC_XTA_TOPAp5 0x00000010
-#define HC_XTA_Adif 0x00000000
-#define HC_XTA_Fog 0x00000001
-#define HC_XTA_Acur 0x00000002
-#define HC_XTA_HTXnTBLRA 0x00000003
-#define HC_XTA_Atex 0x00000004
-#define HC_XTA_Atexnext 0x00000005
-/*--
- */
-#define HC_HTXnTBLAsat_MASK 0x00800000
-#define HC_HTXnTBLAMB_MASK 0x00700000
-#define HC_HTXnTBLAa_MASK 0x0007c000
-#define HC_HTXnTBLAb_MASK 0x00000f80
-#define HC_HTXnTBLAc_MASK 0x0000001f
-#define HC_HTXnTBLAMB_SHIFT 20
-#define HC_HTXnTBLAa_TOPA (HC_XTA_TOPA << 14)
-#define HC_HTXnTBLAa_InvTOPA (HC_XTA_InvTOPA << 14)
-#define HC_HTXnTBLAa_TOPAp5 (HC_XTA_TOPAp5 << 14)
-#define HC_HTXnTBLAa_Adif (HC_XTA_Adif << 14)
-#define HC_HTXnTBLAa_Fog (HC_XTA_Fog << 14)
-#define HC_HTXnTBLAa_Acur (HC_XTA_Acur << 14)
-#define HC_HTXnTBLAa_HTXnTBLRA (HC_XTA_HTXnTBLRA << 14)
-#define HC_HTXnTBLAa_Atex (HC_XTA_Atex << 14)
-#define HC_HTXnTBLAa_Atexnext (HC_XTA_Atexnext << 14)
-#define HC_HTXnTBLAb_TOPA (HC_XTA_TOPA << 7)
-#define HC_HTXnTBLAb_InvTOPA (HC_XTA_InvTOPA << 7)
-#define HC_HTXnTBLAb_TOPAp5 (HC_XTA_TOPAp5 << 7)
-#define HC_HTXnTBLAb_Adif (HC_XTA_Adif << 7)
-#define HC_HTXnTBLAb_Fog (HC_XTA_Fog << 7)
-#define HC_HTXnTBLAb_Acur (HC_XTA_Acur << 7)
-#define HC_HTXnTBLAb_HTXnTBLRA (HC_XTA_HTXnTBLRA << 7)
-#define HC_HTXnTBLAb_Atex (HC_XTA_Atex << 7)
-#define HC_HTXnTBLAb_Atexnext (HC_XTA_Atexnext << 7)
-#define HC_HTXnTBLAc_TOPA (HC_XTA_TOPA << 0)
-#define HC_HTXnTBLAc_InvTOPA (HC_XTA_InvTOPA << 0)
-#define HC_HTXnTBLAc_TOPAp5 (HC_XTA_TOPAp5 << 0)
-#define HC_HTXnTBLAc_Adif (HC_XTA_Adif << 0)
-#define HC_HTXnTBLAc_Fog (HC_XTA_Fog << 0)
-#define HC_HTXnTBLAc_Acur (HC_XTA_Acur << 0)
-#define HC_HTXnTBLAc_HTXnTBLRA (HC_XTA_HTXnTBLRA << 0)
-#define HC_HTXnTBLAc_Atex (HC_XTA_Atex << 0)
-#define HC_HTXnTBLAc_Atexnext (HC_XTA_Atexnext << 0)
-/* HC_SubA_HTXnTBLRAa 0x0089
- */
-#define HC_HTXnTBLRAa_MASK 0x00ff0000
-#define HC_HTXnTBLRAb_MASK 0x0000ff00
-#define HC_HTXnTBLRAc_MASK 0x000000ff
-#define HC_HTXnTBLRAa_SHIFT 16
-#define HC_HTXnTBLRAb_SHIFT 8
-#define HC_HTXnTBLRAc_SHIFT 0
-/* HC_SubA_HTXnTBLRFog 0x008a
- */
-#define HC_HTXnTBLRFog_MASK 0x0000ff00
-#define HC_HTXnTBLRAbias_MASK 0x000000ff
-#define HC_HTXnTBLRFog_SHIFT 8
-#define HC_HTXnTBLRAbias_SHIFT 0
-/* HC_SubA_HTXnLScale 0x0094
- */
-#define HC_HTXnLScale_MASK 0x0007fc00
-#define HC_HTXnLOff_MASK 0x000001ff
-#define HC_HTXnLScale_SHIFT 10
-/* HC_SubA_HTXSMD 0x0000
- */
-#define HC_HTXSMD_MASK 0x00000080
-#define HC_HTXTMD_MASK 0x00000040
-#define HC_HTXNum_MASK 0x00000038
-#define HC_HTXTRMD_MASK 0x00000006
-#define HC_HTXCHCLR_MASK 0x00000001
-#define HC_HTXNum_SHIFT 3
-
-/* Texture Palette n
- */
-#define HC_SubType_TexPalette0 0x00000000
-#define HC_SubType_TexPalette1 0x00000001
-#define HC_SubType_FogTable 0x00000010
-#define HC_SubType_Stipple 0x00000014
-/* HC_SubA_TexPalette0 0x0000
- */
-#define HC_HTPnA_MASK 0xff000000
-#define HC_HTPnR_MASK 0x00ff0000
-#define HC_HTPnG_MASK 0x0000ff00
-#define HC_HTPnB_MASK 0x000000ff
-/* HC_SubA_FogTable 0x0010
- */
-#define HC_HFPn3_MASK 0xff000000
-#define HC_HFPn2_MASK 0x00ff0000
-#define HC_HFPn1_MASK 0x0000ff00
-#define HC_HFPn_MASK 0x000000ff
-#define HC_HFPn3_SHIFT 24
-#define HC_HFPn2_SHIFT 16
-#define HC_HFPn1_SHIFT 8
-
-/* Auto Testing & Security
- */
-#define HC_SubA_HenFIFOAT 0x0000
-#define HC_SubA_HFBDrawFirst 0x0004
-#define HC_SubA_HFBBasL 0x0005
-#define HC_SubA_HFBDst 0x0006
-/* HC_SubA_HenFIFOAT 0x0000
- */
-#define HC_HenFIFOAT_MASK 0x00000020
-#define HC_HenGEMILock_MASK 0x00000010
-#define HC_HenFBASwap_MASK 0x00000008
-#define HC_HenOT_MASK 0x00000004
-#define HC_HenCMDQ_MASK 0x00000002
-#define HC_HenTXCTSU_MASK 0x00000001
-/* HC_SubA_HFBDrawFirst 0x0004
- */
-#define HC_HFBDrawFirst_MASK 0x00000800
-#define HC_HFBQueue_MASK 0x00000400
-#define HC_HFBLock_MASK 0x00000200
-#define HC_HEOF_MASK 0x00000100
-#define HC_HFBBasH_MASK 0x000000ff
-
-/* GEMI Setting
- */
-#define HC_SubA_HTArbRCM 0x0008
-#define HC_SubA_HTArbRZ 0x000a
-#define HC_SubA_HTArbWZ 0x000b
-#define HC_SubA_HTArbRTX 0x000c
-#define HC_SubA_HTArbRCW 0x000d
-#define HC_SubA_HTArbE2 0x000e
-#define HC_SubA_HArbRQCM 0x0010
-#define HC_SubA_HArbWQCM 0x0011
-#define HC_SubA_HGEMITout 0x0020
-#define HC_SubA_HFthRTXD 0x0040
-#define HC_SubA_HFthRTXA 0x0044
-#define HC_SubA_HCMDQstL 0x0050
-#define HC_SubA_HCMDQendL 0x0051
-#define HC_SubA_HCMDQLen 0x0052
-/* HC_SubA_HTArbRCM 0x0008
- */
-#define HC_HTArbRCM_MASK 0x0000ffff
-/* HC_SubA_HTArbRZ 0x000a
- */
-#define HC_HTArbRZ_MASK 0x0000ffff
-/* HC_SubA_HTArbWZ 0x000b
- */
-#define HC_HTArbWZ_MASK 0x0000ffff
-/* HC_SubA_HTArbRTX 0x000c
- */
-#define HC_HTArbRTX_MASK 0x0000ffff
-/* HC_SubA_HTArbRCW 0x000d
- */
-#define HC_HTArbRCW_MASK 0x0000ffff
-/* HC_SubA_HTArbE2 0x000e
- */
-#define HC_HTArbE2_MASK 0x0000ffff
-/* HC_SubA_HArbRQCM 0x0010
- */
-#define HC_HTArbRQCM_MASK 0x0000ffff
-/* HC_SubA_HArbWQCM 0x0011
- */
-#define HC_HArbWQCM_MASK 0x0000ffff
-/* HC_SubA_HGEMITout 0x0020
- */
-#define HC_HGEMITout_MASK 0x000f0000
-#define HC_HNPArbZC_MASK 0x0000ffff
-#define HC_HGEMITout_SHIFT 16
-/* HC_SubA_HFthRTXD 0x0040
- */
-#define HC_HFthRTXD_MASK 0x00ff0000
-#define HC_HFthRZD_MASK 0x0000ff00
-#define HC_HFthWZD_MASK 0x000000ff
-#define HC_HFthRTXD_SHIFT 16
-#define HC_HFthRZD_SHIFT 8
-/* HC_SubA_HFthRTXA 0x0044
- */
-#define HC_HFthRTXA_MASK 0x000000ff
-
-/******************************************************************************
-** Define the Halcyon Internal register access constants. For simulator only.
-******************************************************************************/
-#define HC_SIMA_HAGPBstL 0x0000
-#define HC_SIMA_HAGPBendL 0x0001
-#define HC_SIMA_HAGPCMNT 0x0002
-#define HC_SIMA_HAGPBpL 0x0003
-#define HC_SIMA_HAGPBpH 0x0004
-#define HC_SIMA_HClipTB 0x0005
-#define HC_SIMA_HClipLR 0x0006
-#define HC_SIMA_HFPClipTL 0x0007
-#define HC_SIMA_HFPClipBL 0x0008
-#define HC_SIMA_HFPClipLL 0x0009
-#define HC_SIMA_HFPClipRL 0x000a
-#define HC_SIMA_HFPClipTBH 0x000b
-#define HC_SIMA_HFPClipLRH 0x000c
-#define HC_SIMA_HLP 0x000d
-#define HC_SIMA_HLPRF 0x000e
-#define HC_SIMA_HSolidCL 0x000f
-#define HC_SIMA_HPixGC 0x0010
-#define HC_SIMA_HSPXYOS 0x0011
-#define HC_SIMA_HCmdA 0x0012
-#define HC_SIMA_HCmdB 0x0013
-#define HC_SIMA_HEnable 0x0014
-#define HC_SIMA_HZWBBasL 0x0015
-#define HC_SIMA_HZWBBasH 0x0016
-#define HC_SIMA_HZWBType 0x0017
-#define HC_SIMA_HZBiasL 0x0018
-#define HC_SIMA_HZWBend 0x0019
-#define HC_SIMA_HZWTMD 0x001a
-#define HC_SIMA_HZWCDL 0x001b
-#define HC_SIMA_HZWCTAGnum 0x001c
-#define HC_SIMA_HZCYNum 0x001d
-#define HC_SIMA_HZWCFire 0x001e
-/* #define HC_SIMA_HSBBasL 0x001d */
-/* #define HC_SIMA_HSBBasH 0x001e */
-/* #define HC_SIMA_HSBFM 0x001f */
-#define HC_SIMA_HSTREF 0x0020
-#define HC_SIMA_HSTMD 0x0021
-#define HC_SIMA_HABBasL 0x0022
-#define HC_SIMA_HABBasH 0x0023
-#define HC_SIMA_HABFM 0x0024
-#define HC_SIMA_HATMD 0x0025
-#define HC_SIMA_HABLCsat 0x0026
-#define HC_SIMA_HABLCop 0x0027
-#define HC_SIMA_HABLAsat 0x0028
-#define HC_SIMA_HABLAop 0x0029
-#define HC_SIMA_HABLRCa 0x002a
-#define HC_SIMA_HABLRFCa 0x002b
-#define HC_SIMA_HABLRCbias 0x002c
-#define HC_SIMA_HABLRCb 0x002d
-#define HC_SIMA_HABLRFCb 0x002e
-#define HC_SIMA_HABLRAa 0x002f
-#define HC_SIMA_HABLRAb 0x0030
-#define HC_SIMA_HDBBasL 0x0031
-#define HC_SIMA_HDBBasH 0x0032
-#define HC_SIMA_HDBFM 0x0033
-#define HC_SIMA_HFBBMSKL 0x0034
-#define HC_SIMA_HROP 0x0035
-#define HC_SIMA_HFogLF 0x0036
-#define HC_SIMA_HFogCL 0x0037
-#define HC_SIMA_HFogCH 0x0038
-#define HC_SIMA_HFogStL 0x0039
-#define HC_SIMA_HFogStH 0x003a
-#define HC_SIMA_HFogOOdMF 0x003b
-#define HC_SIMA_HFogOOdEF 0x003c
-#define HC_SIMA_HFogEndL 0x003d
-#define HC_SIMA_HFogDenst 0x003e
-/*---- start of texture 0 setting ----
- */
-#define HC_SIMA_HTX0L0BasL 0x0040
-#define HC_SIMA_HTX0L1BasL 0x0041
-#define HC_SIMA_HTX0L2BasL 0x0042
-#define HC_SIMA_HTX0L3BasL 0x0043
-#define HC_SIMA_HTX0L4BasL 0x0044
-#define HC_SIMA_HTX0L5BasL 0x0045
-#define HC_SIMA_HTX0L6BasL 0x0046
-#define HC_SIMA_HTX0L7BasL 0x0047
-#define HC_SIMA_HTX0L8BasL 0x0048
-#define HC_SIMA_HTX0L9BasL 0x0049
-#define HC_SIMA_HTX0LaBasL 0x004a
-#define HC_SIMA_HTX0LbBasL 0x004b
-#define HC_SIMA_HTX0LcBasL 0x004c
-#define HC_SIMA_HTX0LdBasL 0x004d
-#define HC_SIMA_HTX0LeBasL 0x004e
-#define HC_SIMA_HTX0LfBasL 0x004f
-#define HC_SIMA_HTX0L10BasL 0x0050
-#define HC_SIMA_HTX0L11BasL 0x0051
-#define HC_SIMA_HTX0L012BasH 0x0052
-#define HC_SIMA_HTX0L345BasH 0x0053
-#define HC_SIMA_HTX0L678BasH 0x0054
-#define HC_SIMA_HTX0L9abBasH 0x0055
-#define HC_SIMA_HTX0LcdeBasH 0x0056
-#define HC_SIMA_HTX0Lf1011BasH 0x0057
-#define HC_SIMA_HTX0L0Pit 0x0058
-#define HC_SIMA_HTX0L1Pit 0x0059
-#define HC_SIMA_HTX0L2Pit 0x005a
-#define HC_SIMA_HTX0L3Pit 0x005b
-#define HC_SIMA_HTX0L4Pit 0x005c
-#define HC_SIMA_HTX0L5Pit 0x005d
-#define HC_SIMA_HTX0L6Pit 0x005e
-#define HC_SIMA_HTX0L7Pit 0x005f
-#define HC_SIMA_HTX0L8Pit 0x0060
-#define HC_SIMA_HTX0L9Pit 0x0061
-#define HC_SIMA_HTX0LaPit 0x0062
-#define HC_SIMA_HTX0LbPit 0x0063
-#define HC_SIMA_HTX0LcPit 0x0064
-#define HC_SIMA_HTX0LdPit 0x0065
-#define HC_SIMA_HTX0LePit 0x0066
-#define HC_SIMA_HTX0LfPit 0x0067
-#define HC_SIMA_HTX0L10Pit 0x0068
-#define HC_SIMA_HTX0L11Pit 0x0069
-#define HC_SIMA_HTX0L0_5WE 0x006a
-#define HC_SIMA_HTX0L6_bWE 0x006b
-#define HC_SIMA_HTX0Lc_11WE 0x006c
-#define HC_SIMA_HTX0L0_5HE 0x006d
-#define HC_SIMA_HTX0L6_bHE 0x006e
-#define HC_SIMA_HTX0Lc_11HE 0x006f
-#define HC_SIMA_HTX0L0OS 0x0070
-#define HC_SIMA_HTX0TB 0x0071
-#define HC_SIMA_HTX0MPMD 0x0072
-#define HC_SIMA_HTX0CLODu 0x0073
-#define HC_SIMA_HTX0FM 0x0074
-#define HC_SIMA_HTX0TRCH 0x0075
-#define HC_SIMA_HTX0TRCL 0x0076
-#define HC_SIMA_HTX0TBC 0x0077
-#define HC_SIMA_HTX0TRAH 0x0078
-#define HC_SIMA_HTX0TBLCsat 0x0079
-#define HC_SIMA_HTX0TBLCop 0x007a
-#define HC_SIMA_HTX0TBLMPfog 0x007b
-#define HC_SIMA_HTX0TBLAsat 0x007c
-#define HC_SIMA_HTX0TBLRCa 0x007d
-#define HC_SIMA_HTX0TBLRCb 0x007e
-#define HC_SIMA_HTX0TBLRCc 0x007f
-#define HC_SIMA_HTX0TBLRCbias 0x0080
-#define HC_SIMA_HTX0TBLRAa 0x0081
-#define HC_SIMA_HTX0TBLRFog 0x0082
-#define HC_SIMA_HTX0BumpM00 0x0083
-#define HC_SIMA_HTX0BumpM01 0x0084
-#define HC_SIMA_HTX0BumpM10 0x0085
-#define HC_SIMA_HTX0BumpM11 0x0086
-#define HC_SIMA_HTX0LScale 0x0087
-/*---- end of texture 0 setting ---- 0x008f
- */
-#define HC_SIMA_TX0TX1_OFF 0x0050
-/*---- start of texture 1 setting ----
- */
-#define HC_SIMA_HTX1L0BasL (HC_SIMA_HTX0L0BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L1BasL (HC_SIMA_HTX0L1BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L2BasL (HC_SIMA_HTX0L2BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L3BasL (HC_SIMA_HTX0L3BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L4BasL (HC_SIMA_HTX0L4BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L5BasL (HC_SIMA_HTX0L5BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L6BasL (HC_SIMA_HTX0L6BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L7BasL (HC_SIMA_HTX0L7BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L8BasL (HC_SIMA_HTX0L8BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L9BasL (HC_SIMA_HTX0L9BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LaBasL (HC_SIMA_HTX0LaBasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LbBasL (HC_SIMA_HTX0LbBasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LcBasL (HC_SIMA_HTX0LcBasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LdBasL (HC_SIMA_HTX0LdBasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LeBasL (HC_SIMA_HTX0LeBasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LfBasL (HC_SIMA_HTX0LfBasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L10BasL (HC_SIMA_HTX0L10BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L11BasL (HC_SIMA_HTX0L11BasL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L012BasH (HC_SIMA_HTX0L012BasH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L345BasH (HC_SIMA_HTX0L345BasH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L678BasH (HC_SIMA_HTX0L678BasH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L9abBasH (HC_SIMA_HTX0L9abBasH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LcdeBasH (HC_SIMA_HTX0LcdeBasH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1Lf1011BasH (HC_SIMA_HTX0Lf1011BasH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L0Pit (HC_SIMA_HTX0L0Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L1Pit (HC_SIMA_HTX0L1Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L2Pit (HC_SIMA_HTX0L2Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L3Pit (HC_SIMA_HTX0L3Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L4Pit (HC_SIMA_HTX0L4Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L5Pit (HC_SIMA_HTX0L5Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L6Pit (HC_SIMA_HTX0L6Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L7Pit (HC_SIMA_HTX0L7Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L8Pit (HC_SIMA_HTX0L8Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L9Pit (HC_SIMA_HTX0L9Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LaPit (HC_SIMA_HTX0LaPit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LbPit (HC_SIMA_HTX0LbPit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LcPit (HC_SIMA_HTX0LcPit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LdPit (HC_SIMA_HTX0LdPit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LePit (HC_SIMA_HTX0LePit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LfPit (HC_SIMA_HTX0LfPit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L10Pit (HC_SIMA_HTX0L10Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L11Pit (HC_SIMA_HTX0L11Pit + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L0_5WE (HC_SIMA_HTX0L0_5WE + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L6_bWE (HC_SIMA_HTX0L6_bWE + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1Lc_11WE (HC_SIMA_HTX0Lc_11WE + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L0_5HE (HC_SIMA_HTX0L0_5HE + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L6_bHE (HC_SIMA_HTX0L6_bHE + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1Lc_11HE (HC_SIMA_HTX0Lc_11HE + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1L0OS (HC_SIMA_HTX0L0OS + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TB (HC_SIMA_HTX0TB + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1MPMD (HC_SIMA_HTX0MPMD + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1CLODu (HC_SIMA_HTX0CLODu + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1FM (HC_SIMA_HTX0FM + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TRCH (HC_SIMA_HTX0TRCH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TRCL (HC_SIMA_HTX0TRCL + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBC (HC_SIMA_HTX0TBC + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TRAH (HC_SIMA_HTX0TRAH + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LTC (HC_SIMA_HTX0LTC + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LTA (HC_SIMA_HTX0LTA + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLCsat (HC_SIMA_HTX0TBLCsat + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLCop (HC_SIMA_HTX0TBLCop + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLMPfog (HC_SIMA_HTX0TBLMPfog + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLAsat (HC_SIMA_HTX0TBLAsat + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLRCa (HC_SIMA_HTX0TBLRCa + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLRCb (HC_SIMA_HTX0TBLRCb + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLRCc (HC_SIMA_HTX0TBLRCc + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLRCbias (HC_SIMA_HTX0TBLRCbias + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLRAa (HC_SIMA_HTX0TBLRAa + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1TBLRFog (HC_SIMA_HTX0TBLRFog + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1BumpM00 (HC_SIMA_HTX0BumpM00 + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1BumpM01 (HC_SIMA_HTX0BumpM01 + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1BumpM10 (HC_SIMA_HTX0BumpM10 + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1BumpM11 (HC_SIMA_HTX0BumpM11 + HC_SIMA_TX0TX1_OFF)
-#define HC_SIMA_HTX1LScale (HC_SIMA_HTX0LScale + HC_SIMA_TX0TX1_OFF)
-/*---- end of texture 1 setting ---- 0xaf
- */
-#define HC_SIMA_HTXSMD 0x00b0
-#define HC_SIMA_HenFIFOAT 0x00b1
-#define HC_SIMA_HFBDrawFirst 0x00b2
-#define HC_SIMA_HFBBasL 0x00b3
-#define HC_SIMA_HTArbRCM 0x00b4
-#define HC_SIMA_HTArbRZ 0x00b5
-#define HC_SIMA_HTArbWZ 0x00b6
-#define HC_SIMA_HTArbRTX 0x00b7
-#define HC_SIMA_HTArbRCW 0x00b8
-#define HC_SIMA_HTArbE2 0x00b9
-#define HC_SIMA_HGEMITout 0x00ba
-#define HC_SIMA_HFthRTXD 0x00bb
-#define HC_SIMA_HFthRTXA 0x00bc
-/* Define the texture palette 0
- */
-#define HC_SIMA_HTP0 0x0100
-#define HC_SIMA_HTP1 0x0200
-#define HC_SIMA_FOGTABLE 0x0300
-#define HC_SIMA_STIPPLE 0x0400
-#define HC_SIMA_HE3Fire 0x0440
-#define HC_SIMA_TRANS_SET 0x0441
-#define HC_SIMA_HREngSt 0x0442
-#define HC_SIMA_HRFIFOempty 0x0443
-#define HC_SIMA_HRFIFOfull 0x0444
-#define HC_SIMA_HRErr 0x0445
-#define HC_SIMA_FIFOstatus 0x0446
-
-/******************************************************************************
-** Define the AGP command header.
-******************************************************************************/
-#define HC_ACMD_MASK 0xfe000000
-#define HC_ACMD_SUB_MASK 0x0c000000
-#define HC_ACMD_HCmdA 0xee000000
-#define HC_ACMD_HCmdB 0xec000000
-#define HC_ACMD_HCmdC 0xea000000
-#define HC_ACMD_H1 0xf0000000
-#define HC_ACMD_H2 0xf2000000
-#define HC_ACMD_H3 0xf4000000
-#define HC_ACMD_H4 0xf6000000
-
-#define HC_ACMD_H1IO_MASK 0x000001ff
-#define HC_ACMD_H2IO1_MASK 0x001ff000
-#define HC_ACMD_H2IO2_MASK 0x000001ff
-#define HC_ACMD_H2IO1_SHIFT 12
-#define HC_ACMD_H2IO2_SHIFT 0
-#define HC_ACMD_H3IO_MASK 0x000001ff
-#define HC_ACMD_H3COUNT_MASK 0x01fff000
-#define HC_ACMD_H3COUNT_SHIFT 12
-#define HC_ACMD_H4ID_MASK 0x000001ff
-#define HC_ACMD_H4COUNT_MASK 0x01fffe00
-#define HC_ACMD_H4COUNT_SHIFT 9
-
-/********************************************************************************
-** Define Header
-********************************************************************************/
-#define HC_HEADER2 0xF210F110
-
-/********************************************************************************
-** Define Dummy Value
-********************************************************************************/
-#define HC_DUMMY 0xCCCCCCCC
-/********************************************************************************
-** Define for DMA use
-********************************************************************************/
-#define HALCYON_HEADER2 0XF210F110
-#define HALCYON_FIRECMD 0XEE100000
-#define HALCYON_FIREMASK 0XFFF00000
-#define HALCYON_CMDB 0XEC000000
-#define HALCYON_CMDBMASK 0XFFFE0000
-#define HALCYON_SUB_ADDR0 0X00000000
-#define HALCYON_HEADER1MASK 0XFFFFFF00
-#define HALCYON_HEADER1 0XF0000000
-#define HC_SubA_HAGPBstL 0x0060
-#define HC_SubA_HAGPBendL 0x0061
-#define HC_SubA_HAGPCMNT 0x0062
-#define HC_SubA_HAGPBpL 0x0063
-#define HC_SubA_HAGPBpH 0x0064
-#define HC_HAGPCMNT_MASK 0x00800000
-#define HC_HCmdErrClr_MASK 0x00400000
-#define HC_HAGPBendH_MASK 0x0000ff00
-#define HC_HAGPBstH_MASK 0x000000ff
-#define HC_HAGPBendH_SHIFT 8
-#define HC_HAGPBstH_SHIFT 0
-#define HC_HAGPBpL_MASK 0x00fffffc
-#define HC_HAGPBpID_MASK 0x00000003
-#define HC_HAGPBpID_PAUSE 0x00000000
-#define HC_HAGPBpID_JUMP 0x00000001
-#define HC_HAGPBpID_STOP 0x00000002
-#define HC_HAGPBpH_MASK 0x00ffffff
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.c
deleted file mode 100644
index 4c18eba9b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.c
+++ /dev/null
@@ -1,782 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file via_context.c
- *
- * \author John Sheng (presumably of either VIA Technologies or S3 Graphics)
- * \author Others at VIA Technologies?
- * \author Others at S3 Graphics?
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "state.h"
-#include "simple_list.h"
-#include "extensions.h"
-#include "framebuffer.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "array_cache/acache.h"
-
-#include "tnl/t_pipeline.h"
-
-#include "drivers/common/driverfuncs.h"
-
-#include "via_screen.h"
-#include "via_dri.h"
-
-#include "via_state.h"
-#include "via_tex.h"
-#include "via_span.h"
-#include "via_tris.h"
-#include "via_ioctl.h"
-#include "via_fb.h"
-
-#include <stdio.h>
-#include "macros.h"
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_point_parameters
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_secondary_color
-#include "extension_helper.h"
-
-#define DRIVER_DATE "20050526"
-
-#include "vblank.h"
-#include "utils.h"
-
-GLuint VIA_DEBUG = 0;
-
-/**
- * Return various strings for \c glGetString.
- *
- * \sa glGetString
- */
-static const GLubyte *viaGetString(GLcontext *ctx, GLenum name)
-{
- static char buffer[128];
- unsigned offset;
-
-
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *)"VIA Technology";
-
- case GL_RENDERER: {
- static const char * const chipset_names[] = {
- "UniChrome",
- "CastleRock (CLE266)",
- "UniChrome (KM400)",
- "UniChrome (K8M800)",
- "UniChrome (PM8x0/CN400)",
- };
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- unsigned id = vmesa->viaScreen->deviceID;
-
- offset = driGetRendererString( buffer,
- chipset_names[(id > VIA_PM800) ? 0 : id],
- DRIVER_DATE, 0 );
- return (GLubyte *)buffer;
- }
-
- default:
- return NULL;
- }
-}
-
-
-/**
- * Calculate a width that satisfies the hardware's alignment requirements.
- * On the Unichrome hardware, each scanline must be aligned to a multiple of
- * 16 pixels.
- *
- * \param width Minimum buffer width, in pixels.
- *
- * \returns A pixel width that meets the alignment requirements.
- */
-static __inline__ unsigned
-buffer_align( unsigned width )
-{
- return (width + 0x0f) & ~0x0f;
-}
-
-
-/**
- * Calculate the framebuffer parameters for all buffers (front, back, depth,
- * and stencil) associated with the specified context.
- *
- * \warning
- * This function also calls \c AllocateBuffer to actually allocate the
- * buffers.
- *
- * \sa AllocateBuffer
- */
-static GLboolean
-calculate_buffer_parameters( struct via_context *vmesa )
-{
- const unsigned shift = vmesa->viaScreen->bitsPerPixel / 16;
- const unsigned extra = 32;
- unsigned w;
- unsigned h;
-
- /* Allocate front-buffer */
- if (vmesa->drawType == GLX_PBUFFER_BIT) {
- w = vmesa->driDrawable->w;
- h = vmesa->driDrawable->h;
-
- vmesa->front.bpp = vmesa->viaScreen->bitsPerPixel;
- vmesa->front.pitch = buffer_align( w ) << shift;
- vmesa->front.size = vmesa->front.pitch * h;
-
- if (vmesa->front.map)
- via_free_draw_buffer(vmesa, &vmesa->front);
- if (!via_alloc_draw_buffer(vmesa, &vmesa->front))
- return GL_FALSE;
-
- } else {
- w = vmesa->viaScreen->width;
- h = vmesa->viaScreen->height;
-
- vmesa->front.bpp = vmesa->viaScreen->bitsPerPixel;
- vmesa->front.pitch = buffer_align( w ) << shift;
- vmesa->front.size = vmesa->front.pitch * h;
- if (getenv("ALTERNATE_SCREEN"))
- vmesa->front.offset = vmesa->front.size;
- else
- vmesa->front.offset = 0;
- vmesa->front.map = (char *) vmesa->driScreen->pFB;
- }
-
-
- /* Allocate back-buffer */
- if (vmesa->hasBack) {
- vmesa->back.bpp = vmesa->viaScreen->bitsPerPixel;
- vmesa->back.pitch = (buffer_align( vmesa->driDrawable->w ) << shift);
- vmesa->back.pitch += extra;
- vmesa->back.pitch = MIN2(vmesa->back.pitch, vmesa->front.pitch);
- vmesa->back.size = vmesa->back.pitch * vmesa->driDrawable->h;
- if (vmesa->back.map)
- via_free_draw_buffer(vmesa, &vmesa->back);
- if (!via_alloc_draw_buffer(vmesa, &vmesa->back))
- return GL_FALSE;
- }
- else {
- if (vmesa->back.map)
- via_free_draw_buffer(vmesa, &vmesa->back);
- (void) memset( &vmesa->back, 0, sizeof( vmesa->back ) );
- }
-
-
- /* Allocate depth-buffer */
- if ( vmesa->hasStencil || vmesa->hasDepth ) {
- vmesa->depth.bpp = vmesa->depthBits;
- if (vmesa->depth.bpp == 24)
- vmesa->depth.bpp = 32;
-
- vmesa->depth.pitch = (buffer_align( vmesa->driDrawable->w ) *
- (vmesa->depth.bpp/8)) + extra;
- vmesa->depth.size = vmesa->depth.pitch * vmesa->driDrawable->h;
-
- if (vmesa->depth.map)
- via_free_draw_buffer(vmesa, &vmesa->depth);
- if (!via_alloc_draw_buffer(vmesa, &vmesa->depth)) {
- return GL_FALSE;
- }
- }
- else {
- if (vmesa->depth.map)
- via_free_draw_buffer(vmesa, &vmesa->depth);
- (void) memset( & vmesa->depth, 0, sizeof( vmesa->depth ) );
- }
-
- if( vmesa->viaScreen->width == vmesa->driDrawable->w &&
- vmesa->viaScreen->height == vmesa->driDrawable->h ) {
- vmesa->doPageFlip = vmesa->allowPageFlip;
- assert(vmesa->back.pitch == vmesa->front.pitch);
- }
- else
- vmesa->doPageFlip = GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
- GLuint width, GLuint height)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
-#if 0
- _swrast_alloc_buffers( drawbuffer );
-#else
- _mesa_resize_framebuffer(ctx, drawbuffer, width, height);
-#endif
-
- calculate_buffer_parameters( vmesa );
-}
-
-static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- *width = vmesa->driDrawable->w;
- *height = vmesa->driDrawable->h;
-}
-
-/* Extension strings exported by the Unichrome driver.
- */
-const struct dri_extension card_extensions[] =
-{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
-/* { "GL_ARB_texture_env_dot3", NULL }, */
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_env_combine", NULL },
-/* { "GL_EXT_texture_env_dot3", NULL }, */
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_NV_blend_square", NULL },
- { NULL, NULL }
-};
-
-extern const struct tnl_pipeline_stage _via_fastrender_stage;
-extern const struct tnl_pipeline_stage _via_render_stage;
-
-static const struct tnl_pipeline_stage *via_pipeline[] = {
- &_tnl_vertex_transform_stage,
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- /* REMOVE: point attenuation stage */
-#if 1
- &_via_fastrender_stage, /* ADD: unclipped rastersetup-to-dma */
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-
-static const struct dri_debug_control debug_control[] =
-{
- { "fall", DEBUG_FALLBACKS },
- { "tex", DEBUG_TEXTURE },
- { "ioctl", DEBUG_IOCTL },
- { "prim", DEBUG_PRIMS },
- { "vert", DEBUG_VERTS },
- { "state", DEBUG_STATE },
- { "verb", DEBUG_VERBOSE },
- { "dri", DEBUG_DRI },
- { "dma", DEBUG_DMA },
- { "san", DEBUG_SANITY },
- { "sync", DEBUG_SYNC },
- { "sleep", DEBUG_SLEEP },
- { "pix", DEBUG_PIXEL },
- { "2d", DEBUG_2D },
- { NULL, 0 }
-};
-
-
-static GLboolean
-AllocateDmaBuffer(struct via_context *vmesa)
-{
- if (vmesa->dma)
- via_free_dma_buffer(vmesa);
-
- if (!via_alloc_dma_buffer(vmesa))
- return GL_FALSE;
-
- vmesa->dmaLow = 0;
- vmesa->dmaCliprectAddr = ~0;
- return GL_TRUE;
-}
-
-static void
-FreeBuffer(struct via_context *vmesa)
-{
- if (vmesa->front.map && vmesa->drawType == GLX_PBUFFER_BIT)
- via_free_draw_buffer(vmesa, &vmesa->front);
-
- if (vmesa->back.map)
- via_free_draw_buffer(vmesa, &vmesa->back);
-
- if (vmesa->depth.map)
- via_free_draw_buffer(vmesa, &vmesa->depth);
-
- if (vmesa->breadcrumb.map)
- via_free_draw_buffer(vmesa, &vmesa->breadcrumb);
-
- if (vmesa->dma)
- via_free_dma_buffer(vmesa);
-}
-
-
-GLboolean
-viaCreateContext(const __GLcontextModes *visual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- GLcontext *ctx, *shareCtx;
- struct via_context *vmesa;
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- viaScreenPrivate *viaScreen = (viaScreenPrivate *)sPriv->private;
- drm_via_sarea_t *saPriv = (drm_via_sarea_t *)
- (((GLubyte *)sPriv->pSAREA) + viaScreen->sareaPrivOffset);
- struct dd_function_table functions;
-
- /* Allocate via context */
- vmesa = (struct via_context *) CALLOC_STRUCT(via_context);
- if (!vmesa) {
- return GL_FALSE;
- }
-
- /* Parse configuration files.
- */
- driParseConfigFiles (&vmesa->optionCache, &viaScreen->optionCache,
- sPriv->myNum, "via");
-
- /* pick back buffer */
- vmesa->hasBack = visual->doubleBufferMode;
-
- switch(visual->depthBits) {
- case 0:
- vmesa->hasDepth = GL_FALSE;
- vmesa->depthBits = 0;
- vmesa->depth_max = 1.0;
- break;
- case 16:
- vmesa->hasDepth = GL_TRUE;
- vmesa->depthBits = visual->depthBits;
- vmesa->have_hw_stencil = GL_FALSE;
- vmesa->depth_max = (GLfloat)0xffff;
- vmesa->depth_clear_mask = 0xf << 28;
- vmesa->ClearDepth = 0xffff;
- vmesa->polygon_offset_scale = 1.0 / vmesa->depth_max;
- break;
- case 24:
- vmesa->hasDepth = GL_TRUE;
- vmesa->depthBits = visual->depthBits;
- vmesa->depth_max = (GLfloat) 0xffffff;
- vmesa->depth_clear_mask = 0xe << 28;
- vmesa->ClearDepth = 0xffffff00;
-
- assert(visual->haveStencilBuffer);
- assert(visual->stencilBits == 8);
-
- vmesa->have_hw_stencil = GL_TRUE;
- vmesa->stencilBits = visual->stencilBits;
- vmesa->stencil_clear_mask = 0x1 << 28;
- vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max;
- break;
- case 32:
- vmesa->hasDepth = GL_TRUE;
- vmesa->depthBits = visual->depthBits;
- assert(!visual->haveStencilBuffer);
- vmesa->have_hw_stencil = GL_FALSE;
- vmesa->depth_max = (GLfloat)0xffffffff;
- vmesa->depth_clear_mask = 0xf << 28;
- vmesa->ClearDepth = 0xffffffff;
- vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max;
- break;
- default:
- assert(0);
- break;
- }
-
- make_empty_list(&vmesa->freed_tex_buffers);
- make_empty_list(&vmesa->tex_image_list[VIA_MEM_VIDEO]);
- make_empty_list(&vmesa->tex_image_list[VIA_MEM_AGP]);
- make_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]);
-
- _mesa_init_driver_functions(&functions);
- viaInitTextureFuncs(&functions);
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((struct via_context *) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- vmesa->glCtx = _mesa_create_context(visual, shareCtx, &functions,
- (void*) vmesa);
-
- vmesa->shareCtx = shareCtx;
-
- if (!vmesa->glCtx) {
- FREE(vmesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = vmesa;
-
- ctx = vmesa->glCtx;
-
- ctx->Const.MaxTextureLevels = 10;
- ctx->Const.MaxTextureUnits = 2;
- ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
- ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
-
- ctx->Const.MinLineWidth = 1.0;
- ctx->Const.MinLineWidthAA = 1.0;
- ctx->Const.MaxLineWidth = 1.0;
- ctx->Const.MaxLineWidthAA = 1.0;
- ctx->Const.LineWidthGranularity = 1.0;
-
- ctx->Const.MinPointSize = 1.0;
- ctx->Const.MinPointSizeAA = 1.0;
- ctx->Const.MaxPointSize = 1.0;
- ctx->Const.MaxPointSizeAA = 1.0;
- ctx->Const.PointSizeGranularity = 1.0;
-
- ctx->Driver.GetBufferSize = viaBufferSize;
-/* ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; *//* FIXME ?? */
- ctx->Driver.GetString = viaGetString;
-
- ctx->DriverCtx = (void *)vmesa;
- vmesa->glCtx = ctx;
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
- _tnl_CreateContext(ctx);
- _swsetup_CreateContext(ctx);
-
- /* Install the customized pipeline:
- */
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, via_pipeline);
-
- /* Configure swrast and T&L to match hardware characteristics:
- */
- _swrast_allow_pixel_fog(ctx, GL_FALSE);
- _swrast_allow_vertex_fog(ctx, GL_TRUE);
- _tnl_allow_pixel_fog(ctx, GL_FALSE);
- _tnl_allow_vertex_fog(ctx, GL_TRUE);
-
-/* vmesa->display = dpy; */
- vmesa->display = sPriv->display;
-
- vmesa->hHWContext = driContextPriv->hHWContext;
- vmesa->driFd = sPriv->fd;
- vmesa->driHwLock = &sPriv->pSAREA->lock;
-
- vmesa->viaScreen = viaScreen;
- vmesa->driScreen = sPriv;
- vmesa->sarea = saPriv;
-
- vmesa->renderIndex = ~0;
- vmesa->setupIndex = ~0;
- vmesa->hwPrimitive = GL_POLYGON+1;
-
- /* KW: Hardwire this. Was previously set bogusly in
- * viaCreateBuffer. Needs work before PBUFFER can be used:
- */
- vmesa->drawType = GLX_WINDOW_BIT;
-
-
- _math_matrix_ctr(&vmesa->ViewportMatrix);
-
- /* Do this early, before VIA_FLUSH_DMA can be called:
- */
- if (!AllocateDmaBuffer(vmesa)) {
- fprintf(stderr ,"AllocateDmaBuffer fail\n");
- FreeBuffer(vmesa);
- FREE(vmesa);
- return GL_FALSE;
- }
-
- /* Allocate a small piece of fb memory for synchronization:
- */
- vmesa->breadcrumb.bpp = 32;
- vmesa->breadcrumb.pitch = buffer_align( 64 ) << 2;
- vmesa->breadcrumb.size = vmesa->breadcrumb.pitch;
-
- if (!via_alloc_draw_buffer(vmesa, &vmesa->breadcrumb)) {
- fprintf(stderr ,"AllocateDmaBuffer fail\n");
- FreeBuffer(vmesa);
- FREE(vmesa);
- return GL_FALSE;
- }
-
- driInitExtensions( ctx, card_extensions, GL_TRUE );
- viaInitStateFuncs(ctx);
- viaInitTriFuncs(ctx);
- viaInitSpanFuncs(ctx);
- viaInitIoctlFuncs(ctx);
- viaInitState(ctx);
-
- if (getenv("VIA_DEBUG"))
- VIA_DEBUG = driParseDebugString( getenv( "VIA_DEBUG" ),
- debug_control );
-
- if (getenv("VIA_NO_RAST"))
- FALLBACK(vmesa, VIA_FALLBACK_USER_DISABLE, 1);
-
- /* I don't understand why this isn't working:
- */
- vmesa->vblank_flags =
- vmesa->viaScreen->irqEnabled ?
- driGetDefaultVBlankFlags(&vmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
- /* Hack this up in its place:
- */
- vmesa->vblank_flags = (getenv("VIA_VSYNC") ?
- VBLANK_FLAG_SYNC : VBLANK_FLAG_NO_IRQ);
-
- if (getenv("VIA_PAGEFLIP"))
- vmesa->allowPageFlip = 1;
-
- (*dri_interface->getUST)( &vmesa->swap_ust );
-
-
- vmesa->regMMIOBase = (GLuint *)((unsigned long)viaScreen->reg);
- vmesa->pnGEMode = (GLuint *)((unsigned long)viaScreen->reg + 0x4);
- vmesa->regEngineStatus = (GLuint *)((unsigned long)viaScreen->reg + 0x400);
- vmesa->regTranSet = (GLuint *)((unsigned long)viaScreen->reg + 0x43C);
- vmesa->regTranSpace = (GLuint *)((unsigned long)viaScreen->reg + 0x440);
- vmesa->agpBase = viaScreen->agpBase;
-
-
- return GL_TRUE;
-}
-
-void
-viaDestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct via_context *vmesa =
- (struct via_context *)driContextPriv->driverPrivate;
- struct via_context *current = ctx ? VIA_CONTEXT(ctx) : NULL;
- assert(vmesa); /* should never be null */
-
- /* check if we're deleting the currently bound context */
- if (vmesa == current) {
- VIA_FLUSH_DMA(vmesa);
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- if (vmesa) {
- viaWaitIdle(vmesa, GL_FALSE);
- if (vmesa->doPageFlip) {
- LOCK_HARDWARE(vmesa);
- if (vmesa->pfCurrentOffset != 0) {
- fprintf(stderr, "%s - reset pf\n", __FUNCTION__);
- viaResetPageFlippingLocked(vmesa);
- }
- UNLOCK_HARDWARE(vmesa);
- }
-
- _swsetup_DestroyContext(vmesa->glCtx);
- _tnl_DestroyContext(vmesa->glCtx);
- _ac_DestroyContext(vmesa->glCtx);
- _swrast_DestroyContext(vmesa->glCtx);
- /* free the Mesa context */
- _mesa_destroy_context(vmesa->glCtx);
- /* release our data */
- FreeBuffer(vmesa);
-
- assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_AGP]));
- assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_VIDEO]));
- assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]));
- assert (is_empty_list(&vmesa->freed_tex_buffers));
-
- FREE(vmesa);
- }
-}
-
-
-void viaXMesaWindowMoved(struct via_context *vmesa)
-{
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
- GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
-
- if (!dPriv)
- return;
-
- switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_BACK_LEFT:
- if (dPriv->numBackClipRects == 0) {
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
- }
- else {
- vmesa->numClipRects = dPriv->numBackClipRects;
- vmesa->pClipRects = dPriv->pBackClipRects;
- }
- break;
- case BUFFER_BIT_FRONT_LEFT:
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
- break;
- default:
- vmesa->numClipRects = 0;
- break;
- }
-
- if (vmesa->drawW != dPriv->w ||
- vmesa->drawH != dPriv->h)
- calculate_buffer_parameters( vmesa );
-
- vmesa->drawXoff = (GLuint)(((dPriv->x * bytePerPixel) & 0x1f) /
- bytePerPixel);
- vmesa->drawX = dPriv->x - vmesa->drawXoff;
- vmesa->drawY = dPriv->y;
- vmesa->drawW = dPriv->w;
- vmesa->drawH = dPriv->h;
-
- vmesa->front.orig = (vmesa->front.offset +
- vmesa->drawY * vmesa->front.pitch +
- vmesa->drawX * bytePerPixel);
-
- vmesa->front.origMap = (vmesa->front.map +
- vmesa->drawY * vmesa->front.pitch +
- vmesa->drawX * bytePerPixel);
-
- vmesa->back.orig = vmesa->back.offset;
- vmesa->depth.orig = vmesa->depth.offset;
- vmesa->back.origMap = vmesa->back.map;
- vmesa->depth.origMap = vmesa->depth.map;
-
- viaCalcViewport(vmesa->glCtx);
-}
-
-GLboolean
-viaUnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- return GL_TRUE;
-}
-
-GLboolean
-viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (VIA_DEBUG & DEBUG_DRI) {
- fprintf(stderr, "driContextPriv = %016lx\n", (unsigned long)driContextPriv);
- fprintf(stderr, "driDrawPriv = %016lx\n", (unsigned long)driDrawPriv);
- fprintf(stderr, "driReadPriv = %016lx\n", (unsigned long)driReadPriv);
- }
-
- if (driContextPriv) {
- struct via_context *vmesa =
- (struct via_context *)driContextPriv->driverPrivate;
- GLcontext *ctx = vmesa->glCtx;
-
- if ( vmesa->driDrawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, vmesa->vblank_flags );
- vmesa->driDrawable = driDrawPriv;
- if ( ! calculate_buffer_parameters( vmesa ) ) {
- return GL_FALSE;
- }
- }
-
- _mesa_make_current(vmesa->glCtx,
- (GLframebuffer *)driDrawPriv->driverPrivate,
- (GLframebuffer *)driReadPriv->driverPrivate);
-
-
- ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
-
- viaXMesaWindowMoved(vmesa);
- ctx->Driver.Scissor(vmesa->glCtx,
- vmesa->glCtx->Scissor.X,
- vmesa->glCtx->Scissor.Y,
- vmesa->glCtx->Scissor.Width,
- vmesa->glCtx->Scissor.Height);
- }
- else {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
-
-void viaGetLock(struct via_context *vmesa, GLuint flags)
-{
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
- __DRIscreenPrivate *sPriv = vmesa->driScreen;
-
- drmGetLock(vmesa->driFd, vmesa->hHWContext, flags);
-
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
-
- if (vmesa->sarea->ctxOwner != vmesa->hHWContext) {
- vmesa->sarea->ctxOwner = vmesa->hHWContext;
- vmesa->newEmitState = ~0;
- }
-
- if (vmesa->lastStamp != dPriv->lastStamp) {
- viaXMesaWindowMoved(vmesa);
- vmesa->newEmitState = ~0;
- vmesa->lastStamp = dPriv->lastStamp;
- }
-
- if (vmesa->doPageFlip &&
- vmesa->pfCurrentOffset != vmesa->sarea->pfCurrentOffset) {
- fprintf(stderr, "%s - reset pf\n", __FUNCTION__);
- viaResetPageFlippingLocked(vmesa);
- }
-}
-
-
-void
-viaSwapBuffers(__DRIdrawablePrivate *drawablePrivate)
-{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *)drawablePrivate;
-
- if (dPriv &&
- dPriv->driContextPriv &&
- dPriv->driContextPriv->driverPrivate) {
- struct via_context *vmesa =
- (struct via_context *)dPriv->driContextPriv->driverPrivate;
- GLcontext *ctx = vmesa->glCtx;
-
- _mesa_notifySwapBuffers(ctx);
-
- if (ctx->Visual.doubleBufferMode) {
- if (vmesa->doPageFlip) {
- viaPageFlip(dPriv);
- }
- else {
- viaCopyBuffer(dPriv);
- }
- }
- else
- VIA_FLUSH_DMA(vmesa);
- }
- else {
- _mesa_problem(NULL, "viaSwapBuffers: drawable has no context!\n");
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.h
deleted file mode 100644
index e51ec48af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_context.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef _VIACONTEXT_H
-#define _VIACONTEXT_H
-
-#include "dri_util.h"
-
-#include "mtypes.h"
-#include "drm.h"
-#include "mm.h"
-#include "tnl/t_vertex.h"
-
-#include "via_screen.h"
-#include "via_tex.h"
-#include "via_drm.h"
-
-struct via_context;
-
-/* Chip tags. These are used to group the adapters into
- * related families.
- */
-enum VIACHIPTAGS {
- VIA_UNKNOWN = 0,
- VIA_CLE266,
- VIA_KM400,
- VIA_K8M800,
- VIA_PM800,
- VIA_LAST
-};
-
-#define VIA_FALLBACK_TEXTURE 0x1
-#define VIA_FALLBACK_DRAW_BUFFER 0x2
-#define VIA_FALLBACK_READ_BUFFER 0x4
-#define VIA_FALLBACK_COLORMASK 0x8
-#define VIA_FALLBACK_SPECULAR 0x20
-#define VIA_FALLBACK_LOGICOP 0x40
-#define VIA_FALLBACK_RENDERMODE 0x80
-#define VIA_FALLBACK_STENCIL 0x100
-#define VIA_FALLBACK_BLEND_EQ 0x200
-#define VIA_FALLBACK_BLEND_FUNC 0x400
-#define VIA_FALLBACK_USER_DISABLE 0x800
-#define VIA_FALLBACK_PROJ_TEXTURE 0x1000
-#define VIA_FALLBACK_POLY_STIPPLE 0x2000
-
-#define VIA_DMA_BUFSIZ 4096
-#define VIA_DMA_HIGHWATER (VIA_DMA_BUFSIZ - 128)
-
-#define VIA_NO_CLIPRECTS 0x1
-
-
-/* Use the templated vertex formats:
- */
-#define TAG(x) via##x
-#include "tnl_dd/t_dd_vertex.h"
-#undef TAG
-
-typedef void (*via_tri_func)(struct via_context *, viaVertex *, viaVertex *,
- viaVertex *);
-typedef void (*via_line_func)(struct via_context *, viaVertex *, viaVertex *);
-typedef void (*via_point_func)(struct via_context *, viaVertex *);
-
-struct via_buffer {
- drm_handle_t handle;
- drmSize size;
- unsigned long offset;
- unsigned long index;
- GLuint pitch;
- GLuint bpp;
- char *map;
- GLuint orig; /* The drawing origin,
- * at (drawX,drawY) in screen space.
- */
- char *origMap;
-};
-
-
-#define VIA_MAX_TEXLEVELS 10
-
-struct via_tex_buffer {
- struct via_tex_buffer *next, *prev;
- struct via_texture_image *image;
- unsigned long index;
- unsigned long offset;
- GLuint size;
- GLuint memType;
- unsigned char *bufAddr;
- GLuint texBase;
- GLuint lastUsed;
-};
-
-
-
-struct via_texture_image {
- struct gl_texture_image image;
- struct via_tex_buffer *texMem;
- GLint pitchLog2;
-};
-
-struct via_texture_object {
- struct gl_texture_object obj; /* The "parent" object */
-
- GLuint texelBytes;
- GLuint memType;
-
- GLuint regTexFM;
- GLuint regTexWidthLog2[2];
- GLuint regTexHeightLog2[2];
- GLuint regTexBaseH[4];
- struct {
- GLuint baseL;
- GLuint pitchLog2;
- } regTexBaseAndPitch[12];
-
- GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */
-};
-
-
-
-struct via_context {
- GLint refcount;
- GLcontext *glCtx;
- GLcontext *shareCtx;
-
- struct via_buffer front;
- struct via_buffer back;
- struct via_buffer depth;
- struct via_buffer breadcrumb;
-
- GLboolean hasBack;
- GLboolean hasDepth;
- GLboolean hasStencil;
- GLboolean hasAccum;
- GLuint depthBits;
- GLuint stencilBits;
-
- GLboolean have_hw_stencil;
- GLuint ClearDepth;
- GLuint depth_clear_mask;
- GLuint stencil_clear_mask;
- GLfloat depth_max;
- GLfloat polygon_offset_scale;
-
- GLubyte *dma;
- viaRegion tex;
-
- /* Bit flag to keep 0track of fallbacks.
- */
- GLuint Fallback;
-
- /* State for via_tris.c.
- */
- GLuint newState; /* _NEW_* flags */
- GLuint newEmitState; /* _NEW_* flags */
- GLuint newRenderState; /* _NEW_* flags */
-
- struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
- GLuint vertex_attr_count;
-
- GLuint setupIndex;
- GLuint renderIndex;
- GLmatrix ViewportMatrix;
- GLenum renderPrimitive;
- GLenum hwPrimitive;
- GLenum hwShadeModel;
- unsigned char *verts;
-
- /* drmBufPtr dma_buffer;
- */
- GLuint dmaLow;
- GLuint dmaCliprectAddr;
- GLuint dmaLastPrim;
- GLboolean useAgp;
-
-
- /* Fallback rasterization functions
- */
- via_point_func drawPoint;
- via_line_func drawLine;
- via_tri_func drawTri;
-
- /* Hardware register
- */
- GLuint regCmdA_End;
- GLuint regCmdB;
-
- GLuint regEnable;
- GLuint regHFBBMSKL;
- GLuint regHROP;
-
- GLuint regHZWTMD;
- GLuint regHSTREF;
- GLuint regHSTMD;
-
- GLuint regHATMD;
- GLuint regHABLCsat;
- GLuint regHABLCop;
- GLuint regHABLAsat;
- GLuint regHABLAop;
- GLuint regHABLRCa;
- GLuint regHABLRFCa;
- GLuint regHABLRCbias;
- GLuint regHABLRCb;
- GLuint regHABLRFCb;
- GLuint regHABLRAa;
- GLuint regHABLRAb;
- GLuint regHFogLF;
- GLuint regHFogCL;
- GLuint regHFogCH;
-
- GLuint regHLP;
- GLuint regHLPRF;
-
- GLuint regHTXnCLOD[2];
- GLuint regHTXnTB[2];
- GLuint regHTXnMPMD[2];
- GLuint regHTXnTBLCsat[2];
- GLuint regHTXnTBLCop[2];
- GLuint regHTXnTBLMPfog[2];
- GLuint regHTXnTBLAsat[2];
- GLuint regHTXnTBLRCb[2];
- GLuint regHTXnTBLRAa[2];
- GLuint regHTXnTBLRFog[2];
- GLuint regHTXnTBLRCa[2];
- GLuint regHTXnTBLRCc[2];
- GLuint regHTXnTBLRCbias[2];
- GLuint regHTXnTBC[2];
- GLuint regHTXnTRAH[2];
-
- int vertexSize;
- int hwVertexSize;
- GLboolean ptexHack;
- int coloroffset;
- int specoffset;
-
- GLint lastStamp;
-
- GLuint ClearColor;
- GLuint ClearMask;
-
- /* DRI stuff
- */
- GLboolean doPageFlip;
-
- struct via_buffer *drawBuffer;
- struct via_buffer *readBuffer;
-
- int drawX; /* origin of drawable in draw buffer */
- int drawY;
- int drawW;
- int drawH;
-
- int drawXoff; /* drawX is 32byte aligned - this is
- * the delta to the real origin, in
- * pixel units.
- */
-
- GLuint numClipRects; /* cliprects for that buffer */
- drm_clip_rect_t *pClipRects;
-
- GLboolean scissor;
- drm_clip_rect_t drawRect;
- drm_clip_rect_t scissorRect;
-
- drm_context_t hHWContext;
- drm_hw_lock_t *driHwLock;
- int driFd;
- __DRInativeDisplay *display;
-
- __DRIdrawablePrivate *driDrawable;
- __DRIscreenPrivate *driScreen;
- viaScreenPrivate *viaScreen;
- drm_via_sarea_t *sarea;
- volatile GLuint* regMMIOBase;
- volatile GLuint* pnGEMode;
- volatile GLuint* regEngineStatus;
- volatile GLuint* regTranSet;
- volatile GLuint* regTranSpace;
- GLuint agpBase;
- GLuint drawType;
-
- GLuint nDoneFirstFlip;
- GLuint agpFullCount;
-
- GLboolean clearTexCache;
- GLboolean thrashing;
-
- /* Configuration cache
- */
- driOptionCache optionCache;
-
- GLuint vblank_flags;
- GLuint vbl_seq;
-
- int64_t swap_ust;
- int64_t swap_missed_ust;
-
- GLuint swap_count;
- GLuint swap_missed_count;
-
-
- GLuint pfCurrentOffset;
- GLboolean allowPageFlip;
-
- GLuint lastBreadcrumbRead;
- GLuint lastBreadcrumbWrite;
- GLuint lastSwap[2];
- GLuint lastDma;
-
- GLuint total_alloc[VIA_MEM_SYSTEM+1];
-
- struct via_tex_buffer tex_image_list[VIA_MEM_SYSTEM+1];
- struct via_tex_buffer freed_tex_buffers;
-
-};
-
-
-
-#define VIA_CONTEXT(ctx) ((struct via_context *)(ctx->DriverCtx))
-
-
-
-/* Lock the hardware and validate our state.
- */
-#define LOCK_HARDWARE(vmesa) \
- do { \
- char __ret = 0; \
- DRM_CAS(vmesa->driHwLock, vmesa->hHWContext, \
- (DRM_LOCK_HELD|vmesa->hHWContext), __ret); \
- if (__ret) \
- viaGetLock(vmesa, 0); \
- } while (0)
-
-
-/* Release the kernel lock.
- */
-#define UNLOCK_HARDWARE(vmesa) \
- DRM_UNLOCK(vmesa->driFd, vmesa->driHwLock, vmesa->hHWContext);
-
-
-
-extern GLuint VIA_DEBUG;
-
-#define DEBUG_TEXTURE 0x1
-#define DEBUG_STATE 0x2
-#define DEBUG_IOCTL 0x4
-#define DEBUG_PRIMS 0x8
-#define DEBUG_VERTS 0x10
-#define DEBUG_FALLBACKS 0x20
-#define DEBUG_VERBOSE 0x40
-#define DEBUG_DRI 0x80
-#define DEBUG_DMA 0x100
-#define DEBUG_SANITY 0x200
-#define DEBUG_SYNC 0x400
-#define DEBUG_SLEEP 0x800
-#define DEBUG_PIXEL 0x1000
-#define DEBUG_2D 0x2000
-
-
-extern void viaGetLock(struct via_context *vmesa, GLuint flags);
-extern void viaLock(struct via_context *vmesa, GLuint flags);
-extern void viaUnLock(struct via_context *vmesa, GLuint flags);
-extern void viaEmitHwStateLocked(struct via_context *vmesa);
-extern void viaEmitScissorValues(struct via_context *vmesa, int box_nr, int emit);
-extern void viaXMesaSetBackClipRects(struct via_context *vmesa);
-extern void viaXMesaSetFrontClipRects(struct via_context *vmesa);
-extern void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, GLuint width, GLuint height);
-extern void viaXMesaWindowMoved(struct via_context *vmesa);
-
-extern GLboolean viaTexCombineState(struct via_context *vmesa,
- const struct gl_tex_env_combine_state * combine,
- unsigned unit );
-
-/* Via hw already adjusted for GL pixel centers:
- */
-#define SUBPIXEL_X 0
-#define SUBPIXEL_Y 0
-
-/* TODO XXX _SOLO temp defines to make code compilable */
-#ifndef GLX_PBUFFER_BIT
-#define GLX_PBUFFER_BIT 0x00000004
-#endif
-#ifndef GLX_WINDOW_BIT
-#define GLX_WINDOW_BIT 0x00000001
-#endif
-#ifndef VERT_BIT_CLIP
-#define VERT_BIT_CLIP 0x1000000
-#endif
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_drmclient.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_drmclient.h
deleted file mode 100644
index 7beff9a9d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_drmclient.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and 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
- * THE AUTHOR(S) AND/OR THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION 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 _VIA_DRMCLIENT_H_
-#define _VIA_DRMCLIENT_H_
-
-#define VIA_DMA_BUF_ORDER 12
-#define VIA_DMA_BUF_SZ (1 << VIA_DMA_BUF_ORDER)
-#define VIA_DMA_BUF_NR 256
-
-#endif /* _VIA_DRMCLIENT_H_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.c
deleted file mode 100644
index faa669073..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <assert.h>
-
-#include "via_context.h"
-#include "via_ioctl.h"
-#include "via_fb.h"
-#include "xf86drm.h"
-#include "imports.h"
-#include "simple_list.h"
-#include <sys/ioctl.h>
-
-GLboolean
-via_alloc_draw_buffer(struct via_context *vmesa, struct via_buffer *buf)
-{
- drm_via_mem_t mem;
- mem.context = vmesa->hHWContext;
- mem.size = buf->size;
- mem.type = VIA_MEM_VIDEO;
- mem.offset = 0;
- mem.index = 0;
-
- if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &mem))
- return GL_FALSE;
-
-
- buf->offset = mem.offset;
- buf->map = (char *)vmesa->driScreen->pFB + mem.offset;
- buf->index = mem.index;
- return GL_TRUE;
-}
-
-void
-via_free_draw_buffer(struct via_context *vmesa, struct via_buffer *buf)
-{
- drm_via_mem_t mem;
-
- if (!vmesa) return;
-
- mem.context = vmesa->hHWContext;
- mem.index = buf->index;
- mem.type = VIA_MEM_VIDEO;
- mem.offset = buf->offset;
- mem.size = buf->size;
-
- ioctl(vmesa->driFd, DRM_IOCTL_VIA_FREEMEM, &mem);
- buf->map = NULL;
-}
-
-
-GLboolean
-via_alloc_dma_buffer(struct via_context *vmesa)
-{
- drm_via_dma_init_t init;
-
- vmesa->dma = (GLubyte *) malloc(VIA_DMA_BUFSIZ);
-
- /*
- * Check whether AGP DMA has been initialized.
- */
- memset(&init, 0, sizeof(init));
- init.func = VIA_DMA_INITIALIZED;
-
- vmesa->useAgp =
- ( 0 == drmCommandWrite(vmesa->driFd, DRM_VIA_DMA_INIT,
- &init, sizeof(init)));
- if (VIA_DEBUG & DEBUG_DMA) {
- if (vmesa->useAgp)
- fprintf(stderr, "unichrome_dri.so: Using AGP.\n");
- else
- fprintf(stderr, "unichrome_dri.so: Using PCI.\n");
- }
-
- return ((vmesa->dma) ? GL_TRUE : GL_FALSE);
-}
-
-void
-via_free_dma_buffer(struct via_context *vmesa)
-{
- if (!vmesa) return;
- free(vmesa->dma);
- vmesa->dma = 0;
-}
-
-
-/* These functions now allocate and free the via_tex_buffer struct as well:
- */
-struct via_tex_buffer *
-via_alloc_texture(struct via_context *vmesa,
- GLuint size,
- GLuint memType)
-{
- struct via_tex_buffer *t = CALLOC_STRUCT(via_tex_buffer);
-
- if (!t)
- goto cleanup;
-
- t->size = size;
- t->memType = memType;
- insert_at_tail(&vmesa->tex_image_list[memType], t);
-
- if (t->memType == VIA_MEM_AGP ||
- t->memType == VIA_MEM_VIDEO) {
- drm_via_mem_t fb;
-
- fb.context = vmesa->hHWContext;
- fb.size = t->size;
- fb.type = t->memType;
- fb.offset = 0;
- fb.index = 0;
-
- if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb) != 0 ||
- fb.index == 0)
- goto cleanup;
-
- if (0)
- fprintf(stderr, "offset %lx index %lx\n", fb.offset, fb.index);
-
- t->offset = fb.offset;
- t->index = fb.index;
-
- if (t->memType == VIA_MEM_AGP) {
- t->bufAddr = (GLubyte *)((unsigned long)vmesa->viaScreen->agpLinearStart +
- fb.offset);
- t->texBase = vmesa->agpBase + fb.offset;
- }
- else {
- t->bufAddr = (GLubyte *)((unsigned long)vmesa->driScreen->pFB + fb.offset);
- t->texBase = fb.offset;
- }
-
- vmesa->total_alloc[t->memType] += t->size;
- return t;
- }
- else if (t->memType == VIA_MEM_SYSTEM) {
-
- t->bufAddr = _mesa_malloc(t->size);
- if (!t->bufAddr)
- goto cleanup;
-
- vmesa->total_alloc[t->memType] += t->size;
- return t;
- }
-
- cleanup:
- if (t) {
- remove_from_list(t);
- FREE(t);
- }
-
- return NULL;
-}
-
-
-static void
-via_do_free_texture(struct via_context *vmesa, struct via_tex_buffer *t)
-{
- drm_via_mem_t fb;
-
- remove_from_list( t );
-
- vmesa->total_alloc[t->memType] -= t->size;
-
- fb.context = vmesa->hHWContext;
- fb.index = t->index;
- fb.offset = t->offset;
- fb.type = t->memType;
- fb.size = t->size;
-
- if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_FREEMEM, &fb)) {
- fprintf(stderr, "via_free_texture fail\n");
- }
-
- FREE(t);
-}
-
-
-/* Release textures which were potentially still being referenced by
- * hardware at the time when they were originally freed.
- */
-void
-via_release_pending_textures( struct via_context *vmesa )
-{
- struct via_tex_buffer *s, *tmp;
-
- foreach_s( s, tmp, &vmesa->freed_tex_buffers ) {
- if (!VIA_GEQ_WRAP(s->lastUsed, vmesa->lastBreadcrumbRead)) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: release tex sz %d lastUsed %x\n",
- __FUNCTION__, s->size, s->lastUsed);
- via_do_free_texture(vmesa, s);
- }
- }
-}
-
-
-
-void
-via_free_texture(struct via_context *vmesa, struct via_tex_buffer *t)
-{
- if (!t) {
- return;
- }
- else if (t->memType == VIA_MEM_SYSTEM) {
- remove_from_list(t);
- vmesa->total_alloc[t->memType] -= t->size;
- _mesa_free(t->bufAddr);
- _mesa_free(t);
- }
- else if (t->index && viaCheckBreadcrumb(vmesa, t->lastUsed)) {
- via_do_free_texture( vmesa, t );
- }
- else {
- /* Close current breadcrumb so that we can free this eventually:
- */
- if (t->lastUsed == vmesa->lastBreadcrumbWrite)
- viaEmitBreadcrumb(vmesa);
-
- move_to_tail( &vmesa->freed_tex_buffers, t );
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.h
deleted file mode 100644
index 7ee153f47..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_fb.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIAFB_INC
-#define _VIAFB_INC
-
-#include "via_context.h"
-
-extern GLboolean via_alloc_draw_buffer(struct via_context *vmesa, struct via_buffer *buf);
-extern GLboolean via_alloc_dma_buffer(struct via_context *vmesa);
-
-struct via_tex_buffer *
-via_alloc_texture(struct via_context *vmesa,
- GLuint size,
- GLuint memType);
-
-extern void via_free_draw_buffer(struct via_context *vmesa, struct via_buffer *buf);
-extern void via_free_dma_buffer(struct via_context *vmesa);
-extern void via_free_texture(struct via_context *vmesa, struct via_tex_buffer *t);
-void via_release_pending_textures( struct via_context *vmesa );
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.c
deleted file mode 100644
index e84f4294a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ /dev/null
@@ -1,970 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <unistd.h>
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
-#include "swrast/swrast.h"
-
-#include "mm.h"
-#include "via_context.h"
-#include "via_tris.h"
-#include "via_ioctl.h"
-#include "via_state.h"
-#include "via_fb.h"
-#include "via_3d_reg.h"
-
-#include "vblank.h"
-#include "drm.h"
-#include "xf86drm.h"
-#include <sys/ioctl.h>
-#include <errno.h>
-
-
-#define VIA_REG_STATUS 0x400
-#define VIA_REG_GEMODE 0x004
-#define VIA_REG_SRCBASE 0x030
-#define VIA_REG_DSTBASE 0x034
-#define VIA_REG_PITCH 0x038
-#define VIA_REG_SRCCOLORKEY 0x01C
-#define VIA_REG_KEYCONTROL 0x02C
-#define VIA_REG_SRCPOS 0x008
-#define VIA_REG_DSTPOS 0x00C
-#define VIA_REG_GECMD 0x000
-#define VIA_REG_DIMENSION 0x010 /* width and height */
-#define VIA_REG_FGCOLOR 0x018
-
-#define VIA_GEM_8bpp 0x00000000
-#define VIA_GEM_16bpp 0x00000100
-#define VIA_GEM_32bpp 0x00000300
-#define VIA_GEC_BLT 0x00000001
-#define VIA_PITCH_ENABLE 0x80000000
-#define VIA_GEC_INCX 0x00000000
-#define VIA_GEC_DECY 0x00004000
-#define VIA_GEC_INCY 0x00000000
-#define VIA_GEC_DECX 0x00008000
-#define VIA_GEC_FIXCOLOR_PAT 0x00002000
-
-
-#define VIA_BLIT_CLEAR 0x00
-#define VIA_BLIT_COPY 0xCC
-#define VIA_BLIT_FILL 0xF0
-#define VIA_BLIT_SET 0xFF
-
-static void dump_dma( struct via_context *vmesa )
-{
- GLuint i;
- GLuint *data = (GLuint *)vmesa->dma;
- for (i = 0; i < vmesa->dmaLow; i += 16) {
- fprintf(stderr, "%04x: ", i);
- fprintf(stderr, "%08x ", *data++);
- fprintf(stderr, "%08x ", *data++);
- fprintf(stderr, "%08x ", *data++);
- fprintf(stderr, "%08x\n", *data++);
- }
- fprintf(stderr, "******************************************\n");
-}
-
-
-void viaCheckDma(struct via_context *vmesa, GLuint bytes)
-{
- VIA_FINISH_PRIM( vmesa );
- if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) {
- viaFlushDma(vmesa);
- }
-}
-
-
-
-#define SetReg2DAGP(nReg, nData) do { \
- OUT_RING( ((nReg) >> 2) | 0xF0000000 ); \
- OUT_RING( nData ); \
-} while (0)
-
-
-static void viaBlit(struct via_context *vmesa, GLuint bpp,
- GLuint srcBase, GLuint srcPitch,
- GLuint dstBase, GLuint dstPitch,
- GLuint w, GLuint h,
- GLuint blitMode,
- GLuint color, GLuint nMask )
-{
-
- GLuint dwGEMode, srcX, dstX, cmd;
- RING_VARS;
-
- if (VIA_DEBUG & DEBUG_2D)
- fprintf(stderr,
- "%s bpp %d src %x/%x dst %x/%x w %d h %d "
- " mode: %x color: 0x%08x mask 0x%08x\n",
- __FUNCTION__, bpp, srcBase, srcPitch, dstBase,
- dstPitch, w,h, blitMode, color, nMask);
-
-
- if (!w || !h)
- return;
-
- switch (bpp) {
- case 16:
- dwGEMode = VIA_GEM_16bpp;
- srcX = (srcBase & 0x1f) >> 1;
- dstX = (dstBase & 0x1f) >> 1;
- break;
- case 32:
- dwGEMode = VIA_GEM_32bpp;
- srcX = (srcBase & 0x1f) >> 2;
- dstX = (dstBase & 0x1f) >> 2;
- break;
- default:
- return;
- }
-
- switch(blitMode) {
- case VIA_BLIT_FILL:
- cmd = VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | (VIA_BLIT_FILL << 24);
- break;
- case VIA_BLIT_COPY:
- cmd = VIA_GEC_BLT | (VIA_BLIT_COPY << 24);
- break;
- default:
- return;
- }
-
- BEGIN_RING(22);
- SetReg2DAGP( VIA_REG_GEMODE, dwGEMode);
- SetReg2DAGP( VIA_REG_FGCOLOR, color);
- SetReg2DAGP( 0x2C, nMask);
- SetReg2DAGP( VIA_REG_SRCBASE, (srcBase & ~0x1f) >> 3);
- SetReg2DAGP( VIA_REG_DSTBASE, (dstBase & ~0x1f) >> 3);
- SetReg2DAGP( VIA_REG_PITCH, VIA_PITCH_ENABLE |
- (srcPitch >> 3) | ((dstPitch >> 3) << 16));
- SetReg2DAGP( VIA_REG_SRCPOS, srcX);
- SetReg2DAGP( VIA_REG_DSTPOS, dstX);
- SetReg2DAGP( VIA_REG_DIMENSION, (((h - 1) << 16) | (w - 1)));
- SetReg2DAGP( VIA_REG_GECMD, cmd);
- SetReg2DAGP( 0x2C, 0x00000000);
- ADVANCE_RING();
-}
-
-static void viaFillBuffer(struct via_context *vmesa,
- struct via_buffer *buffer,
- drm_clip_rect_t *pbox,
- int nboxes,
- GLuint pixel,
- GLuint mask)
-{
- GLuint bytePerPixel = buffer->bpp >> 3;
- GLuint i;
-
- for (i = 0; i < nboxes ; i++) {
- int x = pbox[i].x1 - vmesa->drawX;
- int y = pbox[i].y1 - vmesa->drawY;
- int w = pbox[i].x2 - pbox[i].x1;
- int h = pbox[i].y2 - pbox[i].y1;
-
- int offset = (buffer->orig +
- y * buffer->pitch +
- x * bytePerPixel);
-
- viaBlit(vmesa,
- buffer->bpp,
- offset, buffer->pitch,
- offset, buffer->pitch,
- w, h,
- VIA_BLIT_FILL, pixel, mask);
- }
-}
-
-
-
-static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint cx, GLint cy, GLint cw, GLint ch)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
- int flag = 0;
- GLuint i = 0;
- GLuint clear_depth_mask = 0xf << 28;
- GLuint clear_depth = 0;
-
- VIA_FLUSH_DMA(vmesa);
-
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- flag |= VIA_FRONT;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if (mask & BUFFER_BIT_BACK_LEFT) {
- flag |= VIA_BACK;
- mask &= ~BUFFER_BIT_BACK_LEFT;
- }
-
- if (mask & BUFFER_BIT_DEPTH) {
- flag |= VIA_DEPTH;
- clear_depth = (GLuint)(ctx->Depth.Clear * vmesa->ClearDepth);
- clear_depth_mask &= ~vmesa->depth_clear_mask;
- mask &= ~BUFFER_BIT_DEPTH;
- }
-
- if (mask & BUFFER_BIT_STENCIL) {
- if (vmesa->have_hw_stencil) {
- if (ctx->Stencil.WriteMask[0] == 0xff) {
- flag |= VIA_DEPTH;
- clear_depth &= ~0xff;
- clear_depth |= (ctx->Stencil.Clear & 0xff);
- clear_depth_mask &= ~vmesa->stencil_clear_mask;
- mask &= ~BUFFER_BIT_STENCIL;
- }
- else {
- if (VIA_DEBUG & DEBUG_2D)
- fprintf(stderr, "Clear stencil writemask %x\n",
- ctx->Stencil.WriteMask[0]);
- }
- }
- }
-
- /* 16bpp doesn't support masked clears */
- if (vmesa->viaScreen->bytesPerPixel == 2 &&
- vmesa->ClearMask & 0xf0000000) {
- if (flag & VIA_FRONT)
- mask |= BUFFER_BIT_FRONT_LEFT;
- if (flag & VIA_BACK)
- mask |= BUFFER_BIT_BACK_LEFT;
- flag &= ~(VIA_FRONT | VIA_BACK);
- }
-
- if (flag) {
- drm_clip_rect_t *boxes, *tmp_boxes = 0;
- int nr = 0;
-
- LOCK_HARDWARE(vmesa);
-
- /* flip top to bottom */
- cy = dPriv->h - cy - ch;
- cx += vmesa->drawX + vmesa->drawXoff;
- cy += vmesa->drawY;
-
- if (!all) {
- drm_clip_rect_t *b = vmesa->pClipRects;
-
- boxes = tmp_boxes =
- (drm_clip_rect_t *)malloc(vmesa->numClipRects *
- sizeof(drm_clip_rect_t));
- if (!boxes) {
- UNLOCK_HARDWARE(vmesa);
- return;
- }
-
- for (; i < vmesa->numClipRects; i++) {
- GLint x = b[i].x1;
- GLint y = b[i].y1;
- GLint w = b[i].x2 - x;
- GLint h = b[i].y2 - y;
-
- if (x < cx) w -= cx - x, x = cx;
- if (y < cy) h -= cy - y, y = cy;
- if (x + w > cx + cw) w = cx + cw - x;
- if (y + h > cy + ch) h = cy + ch - y;
- if (w <= 0) continue;
- if (h <= 0) continue;
-
- boxes[nr].x1 = x;
- boxes[nr].y1 = y;
- boxes[nr].x2 = x + w;
- boxes[nr].y2 = y + h;
- nr++;
- }
- }
- else {
- boxes = vmesa->pClipRects;
- nr = vmesa->numClipRects;
- }
-
- if (flag & VIA_FRONT) {
- viaFillBuffer(vmesa, &vmesa->front, boxes, nr, vmesa->ClearColor,
- vmesa->ClearMask);
- }
-
- if (flag & VIA_BACK) {
- viaFillBuffer(vmesa, &vmesa->back, boxes, nr, vmesa->ClearColor,
- vmesa->ClearMask);
- }
-
- if (flag & VIA_DEPTH) {
- viaFillBuffer(vmesa, &vmesa->depth, boxes, nr, clear_depth,
- clear_depth_mask);
- }
-
- viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS);
- UNLOCK_HARDWARE(vmesa);
-
- if (tmp_boxes)
- free(tmp_boxes);
- }
-
- if (mask)
- _swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
-}
-
-
-
-
-static void viaDoSwapBuffers(struct via_context *vmesa,
- drm_clip_rect_t *b,
- GLuint nbox)
-{
- GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
- struct via_buffer *front = &vmesa->front;
- struct via_buffer *back = &vmesa->back;
- GLuint i;
-
- for (i = 0; i < nbox; i++, b++) {
- GLint x = b->x1 - vmesa->drawX;
- GLint y = b->y1 - vmesa->drawY;
- GLint w = b->x2 - b->x1;
- GLint h = b->y2 - b->y1;
-
- GLuint src = back->orig + y * back->pitch + x * bytePerPixel;
- GLuint dest = front->orig + y * front->pitch + x * bytePerPixel;
-
- viaBlit(vmesa,
- bytePerPixel << 3,
- src, back->pitch,
- dest, front->pitch,
- w, h,
- VIA_BLIT_COPY, 0, 0);
- }
-
- viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS); /* redundant */
-}
-
-
-static void viaEmitBreadcrumbLocked( struct via_context *vmesa )
-{
- struct via_buffer *buffer = &vmesa->breadcrumb;
- GLuint value = vmesa->lastBreadcrumbWrite + 1;
-
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, value);
-
- assert(!vmesa->dmaLow);
-
- viaBlit(vmesa,
- buffer->bpp,
- buffer->offset, buffer->pitch,
- buffer->offset, buffer->pitch,
- 1, 1,
- VIA_BLIT_FILL, value, 0);
-
- viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS); /* often redundant */
- vmesa->lastBreadcrumbWrite = value;
-}
-
-void viaEmitBreadcrumb( struct via_context *vmesa )
-{
- LOCK_HARDWARE(vmesa);
- if (vmesa->dmaLow)
- viaFlushDmaLocked(vmesa, 0);
-
- viaEmitBreadcrumbLocked( vmesa );
- UNLOCK_HARDWARE(vmesa);
-}
-
-static GLboolean viaCheckIdle( struct via_context *vmesa )
-{
- if ((vmesa->regEngineStatus[0] & 0xFFFEFFFF) == 0x00020000) {
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-GLboolean viaCheckBreadcrumb( struct via_context *vmesa, GLuint value )
-{
- GLuint *buf = (GLuint *)vmesa->breadcrumb.map;
- vmesa->lastBreadcrumbRead = *buf;
-
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d < %d: %d\n", __FUNCTION__, value,
- vmesa->lastBreadcrumbRead,
- !VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbRead));
-
- return !VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbRead);
-}
-
-static void viaWaitBreadcrumb( struct via_context *vmesa, GLuint value )
-{
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s %d\n", __FUNCTION__, value);
-
- assert(!VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbWrite));
-
- while (!viaCheckBreadcrumb( vmesa, value )) {
- viaSwapOutWork( vmesa );
- via_release_pending_textures( vmesa );
- }
-}
-
-
-void viaWaitIdle( struct via_context *vmesa, GLboolean light )
-{
- VIA_FLUSH_DMA(vmesa);
-
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s lastDma %d lastBreadcrumbWrite %d\n",
- __FUNCTION__, vmesa->lastDma, vmesa->lastBreadcrumbWrite);
-
- /* Need to emit a new breadcrumb?
- */
- if (vmesa->lastDma == vmesa->lastBreadcrumbWrite) {
- LOCK_HARDWARE(vmesa);
- viaEmitBreadcrumbLocked( vmesa );
- UNLOCK_HARDWARE(vmesa);
- }
-
- /* Need to wait?
- */
- if (VIA_GEQ_WRAP(vmesa->lastDma, vmesa->lastBreadcrumbRead))
- viaWaitBreadcrumb( vmesa, vmesa->lastDma );
-
- if (light) return;
-
- LOCK_HARDWARE(vmesa);
- while(!viaCheckIdle(vmesa))
- ;
- UNLOCK_HARDWARE(vmesa);
- via_release_pending_textures(vmesa);
-}
-
-
-void viaWaitIdleLocked( struct via_context *vmesa, GLboolean light )
-{
- if (vmesa->dmaLow)
- viaFlushDmaLocked(vmesa, 0);
-
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s lastDma %d lastBreadcrumbWrite %d\n",
- __FUNCTION__, vmesa->lastDma, vmesa->lastBreadcrumbWrite);
-
- /* Need to emit a new breadcrumb?
- */
- if (vmesa->lastDma == vmesa->lastBreadcrumbWrite) {
- viaEmitBreadcrumbLocked( vmesa );
- }
-
- /* Need to wait?
- */
- if (vmesa->lastDma >= vmesa->lastBreadcrumbRead)
- viaWaitBreadcrumb( vmesa, vmesa->lastDma );
-
- if (light) return;
-
- while(!viaCheckIdle(vmesa))
- ;
-
- via_release_pending_textures(vmesa);
-}
-
-
-
-/* Wait for command stream to be processed *and* the next vblank to
- * occur. Equivalent to calling WAIT_IDLE() and then WaitVBlank,
- * except that WAIT_IDLE() will spin the CPU polling, while this is
- * IRQ driven.
- */
-static void viaWaitIdleVBlank( const __DRIdrawablePrivate *dPriv,
- struct via_context *vmesa,
- GLuint value )
-{
- GLboolean missed_target;
-
- VIA_FLUSH_DMA(vmesa);
-
- if (!value)
- return;
-
- do {
- if (value < vmesa->lastBreadcrumbRead ||
- vmesa->thrashing)
- viaSwapOutWork(vmesa);
-
- driWaitForVBlank( dPriv, & vmesa->vbl_seq,
- vmesa->vblank_flags, & missed_target );
- if ( missed_target ) {
- vmesa->swap_missed_count++;
- (*dri_interface->getUST)( &vmesa->swap_missed_ust );
- }
- }
- while (!viaCheckBreadcrumb(vmesa, value));
-
- vmesa->thrashing = 0; /* reset flag on swap */
- vmesa->swap_count++;
- via_release_pending_textures( vmesa );
-}
-
-
-
-static void viaDoPageFlipLocked(struct via_context *vmesa, GLuint offset)
-{
- RING_VARS;
-
- if (VIA_DEBUG & DEBUG_2D)
- fprintf(stderr, "%s %x\n", __FUNCTION__, offset);
-
- if (!vmesa->nDoneFirstFlip) {
- vmesa->nDoneFirstFlip = GL_TRUE;
- BEGIN_RING(4);
- OUT_RING(HALCYON_HEADER2);
- OUT_RING(0x00fe0000);
- OUT_RING(0x0000000e);
- OUT_RING(0x0000000e);
- ADVANCE_RING();
- }
-
- BEGIN_RING(4);
- OUT_RING( HALCYON_HEADER2 );
- OUT_RING( 0x00fe0000 );
- OUT_RING((HC_SubA_HFBBasL << 24) | (offset & 0xFFFFF8) | 0x2);
- OUT_RING((HC_SubA_HFBDrawFirst << 24) |
- ((offset & 0xFF000000) >> 24) | 0x0100);
- ADVANCE_RING();
-
- vmesa->pfCurrentOffset = vmesa->sarea->pfCurrentOffset = offset;
-
- viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS); /* often redundant */
-}
-
-void viaResetPageFlippingLocked(struct via_context *vmesa)
-{
- if (VIA_DEBUG & DEBUG_2D)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- viaDoPageFlipLocked( vmesa, 0 );
-
- if (vmesa->front.offset != 0) {
- struct via_buffer buffer_tmp;
- memcpy(&buffer_tmp, &vmesa->back, sizeof(struct via_buffer));
- memcpy(&vmesa->back, &vmesa->front, sizeof(struct via_buffer));
- memcpy(&vmesa->front, &buffer_tmp, sizeof(struct via_buffer));
- }
-
- assert(vmesa->front.offset == 0);
- vmesa->doPageFlip = vmesa->allowPageFlip = 0;
-}
-
-
-/*
- * Copy the back buffer to the front buffer.
- */
-void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
-{
- struct via_context *vmesa =
- (struct via_context *)dPriv->driContextPriv->driverPrivate;
-
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr,
- "%s: lastSwap[1] %d lastSwap[0] %d lastWrite %d lastRead %d\n",
- __FUNCTION__,
- vmesa->lastSwap[1],
- vmesa->lastSwap[0],
- vmesa->lastBreadcrumbWrite,
- vmesa->lastBreadcrumbRead);
-
- VIA_FLUSH_DMA(vmesa);
-
- if (vmesa->vblank_flags == VBLANK_FLAG_SYNC &&
- vmesa->lastBreadcrumbWrite > 1)
- viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite-1);
- else
- viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastSwap[1]);
-
- LOCK_HARDWARE(vmesa);
-
- /* Catch and cleanup situation where we were pageflipping but have
- * stopped.
- */
- if (dPriv->numClipRects && vmesa->sarea->pfCurrentOffset != 0) {
- viaResetPageFlippingLocked(vmesa);
- UNLOCK_HARDWARE(vmesa);
- return;
- }
-
- viaDoSwapBuffers(vmesa, dPriv->pClipRects, dPriv->numClipRects);
- vmesa->lastSwap[1] = vmesa->lastSwap[0];
- vmesa->lastSwap[0] = vmesa->lastBreadcrumbWrite;
- viaEmitBreadcrumbLocked(vmesa);
- UNLOCK_HARDWARE(vmesa);
-
- (*dri_interface->getUST)( &vmesa->swap_ust );
-}
-
-
-void viaPageFlip(const __DRIdrawablePrivate *dPriv)
-{
- struct via_context *vmesa =
- (struct via_context *)dPriv->driContextPriv->driverPrivate;
- struct via_buffer buffer_tmp;
-
- VIA_FLUSH_DMA(vmesa);
- if (vmesa->vblank_flags == VBLANK_FLAG_SYNC &&
- vmesa->lastBreadcrumbWrite > 1)
- viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite - 1);
- else
- viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastSwap[0]);
-
- LOCK_HARDWARE(vmesa);
- viaDoPageFlipLocked(vmesa, vmesa->back.offset);
- vmesa->lastSwap[1] = vmesa->lastSwap[0];
- vmesa->lastSwap[0] = vmesa->lastBreadcrumbWrite;
- viaEmitBreadcrumbLocked(vmesa);
- UNLOCK_HARDWARE(vmesa);
-
- (*dri_interface->getUST)( &vmesa->swap_ust );
-
-
- /* KW: FIXME: When buffers are freed, could free frontbuffer by
- * accident:
- */
- memcpy(&buffer_tmp, &vmesa->back, sizeof(struct via_buffer));
- memcpy(&vmesa->back, &vmesa->front, sizeof(struct via_buffer));
- memcpy(&vmesa->front, &buffer_tmp, sizeof(struct via_buffer));
-}
-
-
-
-
-#define VIA_CMDBUF_MAX_LAG 50000
-
-static int fire_buffer(struct via_context *vmesa)
-{
- drm_via_cmdbuffer_t bufI;
- int ret;
-
- bufI.buf = (char *)vmesa->dma;
- bufI.size = vmesa->dmaLow;
-
- if (vmesa->useAgp) {
- drm_via_cmdbuf_size_t bSiz;
-
- /* Do the CMDBUF_SIZE ioctl:
- */
- bSiz.func = VIA_CMDBUF_LAG;
- bSiz.wait = 1;
- bSiz.size = VIA_CMDBUF_MAX_LAG;
- do {
- ret = drmCommandWriteRead(vmesa->driFd, DRM_VIA_CMDBUF_SIZE,
- &bSiz, sizeof(bSiz));
- } while (ret == -EAGAIN);
- if (ret) {
- UNLOCK_HARDWARE(vmesa);
- fprintf(stderr, "%s: DRM_VIA_CMDBUF_SIZE returned %d\n",
- __FUNCTION__, ret);
- abort();
- return ret;
- }
-
- /* Actually fire the buffer:
- */
- do {
- ret = drmCommandWrite(vmesa->driFd, DRM_VIA_CMDBUFFER,
- &bufI, sizeof(bufI));
- } while (ret == -EAGAIN);
- if (ret) {
- UNLOCK_HARDWARE(vmesa);
- fprintf(stderr, "%s: DRM_VIA_CMDBUFFER returned %d\n",
- __FUNCTION__, ret);
- abort();
- /* If this fails, the original code fell back to the PCI path.
- */
- }
- else
- return 0;
-
- /* Fall through to PCI handling?!?
- */
- viaWaitIdleLocked(vmesa, GL_FALSE);
- }
-
- ret = drmCommandWrite(vmesa->driFd, DRM_VIA_PCICMD, &bufI, sizeof(bufI));
- if (ret) {
- UNLOCK_HARDWARE(vmesa);
- dump_dma(vmesa);
- fprintf(stderr, "%s: DRM_VIA_PCICMD returned %d\n", __FUNCTION__, ret);
- abort();
- }
-
- return ret;
-}
-
-
-/* Inserts the surface addresss and active cliprects one at a time
- * into the head of the DMA buffer being flushed. Fires the buffer
- * for each cliprect.
- */
-static void via_emit_cliprect(struct via_context *vmesa,
- drm_clip_rect_t *b)
-{
- struct via_buffer *buffer = vmesa->drawBuffer;
- GLuint *vb = (GLuint *)(vmesa->dma + vmesa->dmaCliprectAddr);
-
- GLuint format = (vmesa->viaScreen->bitsPerPixel == 0x20
- ? HC_HDBFM_ARGB8888
- : HC_HDBFM_RGB565);
-
- GLuint pitch = buffer->pitch;
- GLuint offset = buffer->orig;
-
- if (0)
- fprintf(stderr, "emit cliprect for box %d,%d %d,%d\n",
- b->x1, b->y1, b->x2, b->y2);
-
- vb[0] = HC_HEADER2;
- vb[1] = (HC_ParaType_NotTex << 16);
-
- if (vmesa->driDrawable->w == 0 || vmesa->driDrawable->h == 0) {
- vb[2] = (HC_SubA_HClipTB << 24) | 0x0;
- vb[3] = (HC_SubA_HClipLR << 24) | 0x0;
- }
- else {
- vb[2] = (HC_SubA_HClipTB << 24) | (b->y1 << 12) | b->y2;
- vb[3] = (HC_SubA_HClipLR << 24) | (b->x1 << 12) | b->x2;
- }
-
- vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF);
- vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24);
-
- vb[6] = (HC_SubA_HSPXYOS << 24) | ((31-vmesa->drawXoff) << HC_HSPXOS_SHIFT);
- vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch;
-}
-
-
-
-static int intersect_rect(drm_clip_rect_t *out,
- drm_clip_rect_t *a,
- drm_clip_rect_t *b)
-{
- *out = *a;
-
- if (0)
- fprintf(stderr, "intersect %d,%d %d,%d and %d,%d %d,%d\n",
- a->x1, a->y1, a->x2, a->y2,
- b->x1, b->y1, b->x2, b->y2);
-
- if (b->x1 > out->x1) out->x1 = b->x1;
- if (b->x2 < out->x2) out->x2 = b->x2;
- if (out->x1 >= out->x2) return 0;
-
- if (b->y1 > out->y1) out->y1 = b->y1;
- if (b->y2 < out->y2) out->y2 = b->y2;
- if (out->y1 >= out->y2) return 0;
-
- return 1;
-}
-
-void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags)
-{
- int i;
- RING_VARS;
-
- if (VIA_DEBUG & (DEBUG_IOCTL|DEBUG_DMA))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (*(GLuint *)vmesa->driHwLock != (DRM_LOCK_HELD|vmesa->hHWContext) &&
- *(GLuint *)vmesa->driHwLock !=
- (DRM_LOCK_HELD|DRM_LOCK_CONT|vmesa->hHWContext)) {
- fprintf(stderr, "%s called without lock held\n", __FUNCTION__);
- abort();
- }
-
- if (vmesa->dmaLow == 0) {
- return;
- }
-
- assert(vmesa->dmaLastPrim == 0);
-
- /* viaFinishPrimitive can add up to 8 bytes beyond VIA_DMA_HIGHWATER:
- */
- if (vmesa->dmaLow > VIA_DMA_HIGHWATER + 8) {
- fprintf(stderr, "buffer overflow in Flush Prims = %d\n",vmesa->dmaLow);
- abort();
- }
-
- switch (vmesa->dmaLow & 0x1F) {
- case 8:
- BEGIN_RING_NOCHECK( 6 );
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- ADVANCE_RING();
- break;
- case 16:
- BEGIN_RING_NOCHECK( 4 );
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- ADVANCE_RING();
- break;
- case 24:
- BEGIN_RING_NOCHECK( 10 );
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- OUT_RING( HC_DUMMY );
- ADVANCE_RING();
- break;
- case 0:
- break;
- default:
- if (VIA_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s: unaligned value for vmesa->dmaLow: %x\n",
- __FUNCTION__, vmesa->dmaLow);
- }
-
- vmesa->lastDma = vmesa->lastBreadcrumbWrite;
-
- if (VIA_DEBUG & DEBUG_DMA)
- dump_dma( vmesa );
-
- if (flags & VIA_NO_CLIPRECTS) {
- if (0) fprintf(stderr, "%s VIA_NO_CLIPRECTS\n", __FUNCTION__);
- assert(vmesa->dmaCliprectAddr == ~0);
- fire_buffer( vmesa );
- }
- else if (vmesa->dmaCliprectAddr == ~0) {
- /* Contains only state. Could just dump the packet?
- */
- if (0) fprintf(stderr, "%s: no dmaCliprectAddr\n", __FUNCTION__);
- if (0) fire_buffer( vmesa );
- }
- else if (vmesa->numClipRects) {
- drm_clip_rect_t *pbox = vmesa->pClipRects;
-
- for (i = 0; i < vmesa->numClipRects; i++) {
- drm_clip_rect_t b;
-
- b.x1 = pbox[i].x1 - (vmesa->drawX + vmesa->drawXoff);
- b.x2 = pbox[i].x2 - (vmesa->drawX + vmesa->drawXoff);
- b.y1 = pbox[i].y1 - vmesa->drawY;
- b.y2 = pbox[i].y2 - vmesa->drawY;
-
- if (vmesa->scissor &&
- !intersect_rect(&b, &b, &vmesa->scissorRect))
- continue;
-
- b.x1 += vmesa->drawXoff;
- b.x2 += vmesa->drawXoff;
-
- via_emit_cliprect(vmesa, &b);
-
- if (fire_buffer(vmesa) != 0) {
- dump_dma( vmesa );
- goto done;
- }
- }
- } else {
- if (0) fprintf(stderr, "%s: no cliprects\n", __FUNCTION__);
- UNLOCK_HARDWARE(vmesa);
- sched_yield();
- LOCK_HARDWARE(vmesa);
- }
-
- done:
- /* Reset vmesa vars:
- */
- vmesa->dmaLow = 0;
- vmesa->dmaCliprectAddr = ~0;
- vmesa->newEmitState = ~0;
-}
-
-void viaWrapPrimitive( struct via_context *vmesa )
-{
- GLenum renderPrimitive = vmesa->renderPrimitive;
- GLenum hwPrimitive = vmesa->hwPrimitive;
-
- if (VIA_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (vmesa->dmaLastPrim)
- viaFinishPrimitive( vmesa );
-
- viaFlushDma(vmesa);
-
- if (renderPrimitive != GL_POLYGON + 1)
- viaRasterPrimitive( vmesa->glCtx,
- renderPrimitive,
- hwPrimitive );
-
-}
-
-void viaFlushDma(struct via_context *vmesa)
-{
- if (vmesa->dmaLow) {
- assert(!vmesa->dmaLastPrim);
-
- LOCK_HARDWARE(vmesa);
- viaFlushDmaLocked(vmesa, 0);
- UNLOCK_HARDWARE(vmesa);
- }
-}
-
-static void viaFlush(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- VIA_FLUSH_DMA(vmesa);
-}
-
-static void viaFinish(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- VIA_FLUSH_DMA(vmesa);
- viaWaitIdle(vmesa, GL_FALSE);
-}
-
-static void viaClearStencil(GLcontext *ctx, int s)
-{
- return;
-}
-
-void viaInitIoctlFuncs(GLcontext *ctx)
-{
- ctx->Driver.Flush = viaFlush;
- ctx->Driver.Clear = viaClear;
- ctx->Driver.Finish = viaFinish;
- ctx->Driver.ClearStencil = viaClearStencil;
-}
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.h
deleted file mode 100644
index d5d95aa8f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_ioctl.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIAIOCTL_H
-#define _VIAIOCTL_H
-
-#include "via_context.h"
-
-
-void viaFinishPrimitive(struct via_context *vmesa);
-void viaFlushDma(struct via_context *vmesa);
-void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags);
-
-void viaInitIoctlFuncs(GLcontext *ctx);
-void viaCopyBuffer(const __DRIdrawablePrivate *dpriv);
-void viaPageFlip(const __DRIdrawablePrivate *dpriv);
-void viaCheckDma(struct via_context *vmesa, GLuint bytes);
-void viaResetPageFlippingLocked(struct via_context *vmesa);
-void viaWaitIdle(struct via_context *vmesa, GLboolean light);
-void viaWaitIdleLocked(struct via_context *vmesa, GLboolean light);
-
-GLboolean viaCheckBreadcrumb( struct via_context *vmesa, GLuint value );
-void viaEmitBreadcrumb( struct via_context *vmesa );
-
-
-#define VIA_FINISH_PRIM(vmesa) do { \
- if (vmesa->dmaLastPrim) \
- viaFinishPrimitive( vmesa ); \
-} while (0)
-
-#define VIA_FLUSH_DMA(vmesa) do { \
- VIA_FINISH_PRIM(vmesa); \
- if (vmesa->dmaLow) \
- viaFlushDma(vmesa); \
-} while (0)
-
-
-void viaWrapPrimitive( struct via_context *vmesa );
-
-static __inline__ GLuint *viaAllocDma(struct via_context *vmesa, int bytes)
-{
- if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) {
- viaFlushDma(vmesa);
- }
-
- {
- GLuint *start = (GLuint *)(vmesa->dma + vmesa->dmaLow);
- vmesa->dmaLow += bytes;
- return start;
- }
-}
-
-
-static GLuint __inline__ *viaExtendPrimitive(struct via_context *vmesa, int bytes)
-{
- if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) {
- viaWrapPrimitive(vmesa);
- }
-
- {
- GLuint *start = (GLuint *)(vmesa->dma + vmesa->dmaLow);
- vmesa->dmaLow += bytes;
- return start;
- }
-}
-
-
-
-
-#define RING_VARS GLuint *_vb = 0, _nr, _x;
-
-#define BEGIN_RING(n) do { \
- if (_vb != 0) abort(); \
- _vb = viaAllocDma(vmesa, (n) * sizeof(GLuint)); \
- _nr = (n); \
- _x = 0; \
-} while (0)
-
-#define BEGIN_RING_NOCHECK(n) do { \
- if (_vb != 0) abort(); \
- _vb = (GLuint *)(vmesa->dma + vmesa->dmaLow); \
- vmesa->dmaLow += (n) * sizeof(GLuint); \
- _nr = (n); \
- _x = 0; \
-} while (0)
-
-#define OUT_RING(n) _vb[_x++] = (n)
-
-#define ADVANCE_RING() do { \
- if (_x != _nr) abort(); \
- _vb = 0; \
-} while (0)
-
-#define ADVANCE_RING_VARIABLE() do { \
- if (_x > _nr) abort(); \
- vmesa->dmaLow -= (_nr - _x) * sizeof(GLuint); \
- _vb = 0; \
-} while (0)
-
-
-#define QWORD_PAD_RING() do { \
- if (vmesa->dmaLow & 0x4) { \
- BEGIN_RING(1); \
- OUT_RING(HC_DUMMY); \
- ADVANCE_RING(); \
- } \
-} while (0)
-
-#define VIA_GEQ_WRAP(left, right) \
- (((left) - (right)) < ( 1 << 23))
-
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_memcpy.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_memcpy.c
deleted file mode 100644
index d7b05bcaa..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_memcpy.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2004 Thomas Hellstrom, All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and 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
- * THE CODE SUPPLIER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/* Thomas' orginal gutted for mesa by Keith Whitwell
- */
-
-#include "via_tex.h"
-
-#if defined( USE_SSE_ASM )
-
-#define SSE_PREFETCH " prefetchnta "
-#define FENCE __asm__ __volatile__ ("sfence":::"memory");
-
-
-#define PREFETCH1(arch_prefetch,from) \
- __asm__ __volatile__ ( \
- "1: " arch_prefetch "(%0)\n" \
- arch_prefetch "32(%0)\n" \
- arch_prefetch "64(%0)\n" \
- arch_prefetch "96(%0)\n" \
- arch_prefetch "128(%0)\n" \
- arch_prefetch "160(%0)\n" \
- arch_prefetch "192(%0)\n" \
- arch_prefetch "256(%0)\n" \
- arch_prefetch "288(%0)\n" \
- "2:\n" \
- : : "r" (from) );
-
-
-
-#define small_memcpy(to,from,n) \
- { \
- __asm__ __volatile__( \
- "movl %2,%%ecx\n\t" \
- "sarl $2,%%ecx\n\t" \
- "rep ; movsl\n\t" \
- "testb $2,%b2\n\t" \
- "je 1f\n\t" \
- "movsw\n" \
- "1:\ttestb $1,%b2\n\t" \
- "je 2f\n\t" \
- "movsb\n" \
- "2:" \
- :"=&D" (to), "=&S" (from) \
- :"q" (n),"0" ((long) to),"1" ((long) from) \
- : "%ecx","memory"); \
- }
-
-
-#define SSE_CPY(prefetch,from,to,dummy,lcnt) \
- if ((unsigned long) from & 15) { \
- __asm__ __volatile__ ( \
- "1:\n" \
- prefetch "320(%1)\n" \
- " movups (%1), %%xmm0\n" \
- " movups 16(%1), %%xmm1\n" \
- " movntps %%xmm0, (%0)\n" \
- " movntps %%xmm1, 16(%0)\n" \
- prefetch "352(%1)\n" \
- " movups 32(%1), %%xmm2\n" \
- " movups 48(%1), %%xmm3\n" \
- " movntps %%xmm2, 32(%0)\n" \
- " movntps %%xmm3, 48(%0)\n" \
- " addl $64,%0\n" \
- " addl $64,%1\n" \
- " decl %2\n" \
- " jne 1b\n" \
- :"=&D"(to), "=&S"(from), "=&r"(dummy) \
- :"0" (to), "1" (from), "2" (lcnt): "memory"); \
- } else { \
- __asm__ __volatile__ ( \
- "2:\n" \
- prefetch "320(%1)\n" \
- " movaps (%1), %%xmm0\n" \
- " movaps 16(%1), %%xmm1\n" \
- " movntps %%xmm0, (%0)\n" \
- " movntps %%xmm1, 16(%0)\n" \
- prefetch "352(%1)\n" \
- " movaps 32(%1), %%xmm2\n" \
- " movaps 48(%1), %%xmm3\n" \
- " movntps %%xmm2, 32(%0)\n" \
- " movntps %%xmm3, 48(%0)\n" \
- " addl $64,%0\n" \
- " addl $64,%1\n" \
- " decl %2\n" \
- " jne 2b\n" \
- :"=&D"(to), "=&S"(from), "=&r"(dummy) \
- :"0" (to), "1" (from), "2" (lcnt): "memory"); \
- }
-
-
-
-/*
- */
-void via_sse_memcpy(void *to,
- const void *from,
- size_t sz)
-
-{
- int dummy;
- int lcnt = sz >> 6;
- int rest = sz & 63;
-
- PREFETCH1(SSE_PREFETCH,from);
-
- if (lcnt > 5) {
- lcnt -= 5;
- SSE_CPY(SSE_PREFETCH,from,to,dummy,lcnt);
- lcnt = 5;
- }
- if (lcnt) {
- SSE_CPY("#",from,to,dummy,lcnt);
- }
- if (rest) small_memcpy(to, from, rest);
- FENCE;
-}
-
-#endif /* defined( USE_SSE_ASM ) */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_render.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_render.c
deleted file mode 100644
index 387473ef5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_render.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware acceleration where possible.
- *
- */
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "mtypes.h"
-
-#include "tnl/t_context.h"
-
-#include "via_context.h"
-#include "via_tris.h"
-#include "via_state.h"
-#include "via_ioctl.h"
-
-/*
- * Render unclipped vertex buffers by emitting vertices directly to
- * dma buffers. Use strip/fan hardware primitives where possible.
- * Try to simulate missing primitives with indexed vertices.
- */
-#define HAVE_POINTS 1
-#define HAVE_LINES 1
-#define HAVE_LINE_STRIPS 1
-#define HAVE_LINE_LOOP 1
-#define HAVE_TRIANGLES 1
-#define HAVE_TRI_STRIPS 1
-#define HAVE_TRI_STRIP_1 0
-#define HAVE_TRI_FANS 1
-#define HAVE_POLYGONS 1
-#define HAVE_QUADS 0
-#define HAVE_QUAD_STRIPS 0
-
-#define HAVE_ELTS 0
-
-#define LOCAL_VARS struct via_context *vmesa = VIA_CONTEXT(ctx)
-#define INIT(prim) do { \
- viaRasterPrimitive(ctx, prim, prim); \
-} while (0)
-#define GET_CURRENT_VB_MAX_VERTS() \
- ((VIA_DMA_BUF_SZ - (512 + (int)vmesa->dmaLow)) / (vmesa->vertexSize * 4))
-#define GET_SUBSEQUENT_VB_MAX_VERTS() \
- (VIA_DMA_BUF_SZ - 512) / (vmesa->vertexSize * 4)
-
-#define ALLOC_VERTS( nr ) \
- viaExtendPrimitive( vmesa, (nr) * vmesa->vertexSize * 4)
-
-#define EMIT_VERTS(ctx, j, nr, buf) \
- _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf )
-
-#define FLUSH() VIA_FINISH_PRIM( vmesa )
-
-#define TAG(x) via_fast##x
-#include "tnl_dd/t_dd_dmatmp.h"
-#undef TAG
-#undef LOCAL_VARS
-#undef INIT
-
-/**********************************************************************/
-/* Fast Render pipeline stage */
-/**********************************************************************/
-static GLboolean via_run_fastrender(GLcontext *ctx,
- struct tnl_pipeline_stage *stage)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
-
- tnl->Driver.Render.Start(ctx);
-
- if (VB->ClipOrMask ||
- vmesa->renderIndex != 0 ||
- !via_fastvalidate_render( ctx, VB )) {
- tnl->Driver.Render.Finish(ctx);
- return GL_TRUE;
- }
-
- tnl->clipspace.new_inputs |= VERT_BIT_POS;
-
- for (i = 0; i < VB->PrimitiveCount; ++i) {
- GLuint mode = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
- if (length)
- via_fastrender_tab_verts[mode & PRIM_MODE_MASK](ctx, start, start+length, mode);
- }
-
- tnl->Driver.Render.Finish(ctx);
-
- return GL_FALSE; /* finished the pipe */
-}
-
-const struct tnl_pipeline_stage _via_fastrender_stage =
-{
- "via fast render",
- NULL,
- NULL,
- NULL,
- NULL,
- via_run_fastrender /* run */
-};
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.c
deleted file mode 100644
index 267eeffc8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-
-#include "utils.h"
-#include "dri_util.h"
-#include "glheader.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "vblank.h"
-
-#include "via_state.h"
-#include "via_tex.h"
-#include "via_span.h"
-#include "via_tris.h"
-#include "via_ioctl.h"
-#include "via_screen.h"
-#include "via_fb.h"
-#include "via_dri.h"
-
-#include "GL/internal/dri_interface.h"
-
-/* Radeon configuration
- */
-#include "xmlpool.h"
-
-const char __driConfigOptions[] =
-DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END
- DRI_CONF_SECTION_DEBUG
- DRI_CONF_NO_RAST(false)
- DRI_CONF_SECTION_END
-DRI_CONF_END;
-static const GLuint __driNConfigOptions = 3;
-
-extern const struct dri_extension card_extensions[];
-
-static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
-
-static drmBufMapPtr via_create_empty_buffers(void)
-{
- drmBufMapPtr retval;
-
- retval = (drmBufMapPtr)MALLOC(sizeof(drmBufMap));
- if (retval == NULL) return NULL;
- memset(retval, 0, sizeof(drmBufMap));
-
- retval->list = (drmBufPtr)MALLOC(sizeof(drmBuf) * VIA_DMA_BUF_NR);
- if (retval->list == NULL) {
- FREE(retval);
- return NULL;
- }
- memset(retval->list, 0, sizeof(drmBuf) * VIA_DMA_BUF_NR);
- return retval;
-}
-
-static void via_free_empty_buffers( drmBufMapPtr bufs )
-{
- if (bufs && bufs->list)
- FREE(bufs->list);
-
- if (bufs)
- FREE(bufs);
-}
-
-
-static GLboolean
-viaInitDriver(__DRIscreenPrivate *sPriv)
-{
- viaScreenPrivate *viaScreen;
- VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
- void * const psc = sPriv->psc->screenConfigs;
-
- if (sPriv->devPrivSize != sizeof(VIADRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(VIADRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- viaScreen = (viaScreenPrivate *) CALLOC(sizeof(viaScreenPrivate));
- if (!viaScreen) {
- __driUtilMessage("viaInitDriver: alloc viaScreenPrivate struct failed");
- return GL_FALSE;
- }
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo (&viaScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
-
- viaScreen->driScrnPriv = sPriv;
- sPriv->private = (void *)viaScreen;
-
- viaScreen->deviceID = gDRIPriv->deviceID;
- viaScreen->width = gDRIPriv->width;
- viaScreen->height = gDRIPriv->height;
- viaScreen->mem = gDRIPriv->mem;
- viaScreen->bitsPerPixel = gDRIPriv->bytesPerPixel * 8;
- viaScreen->bytesPerPixel = gDRIPriv->bytesPerPixel;
- viaScreen->fbOffset = 0;
- viaScreen->fbSize = gDRIPriv->fbSize;
- viaScreen->irqEnabled = gDRIPriv->irqEnabled;
- viaScreen->irqEnabled = 1;
-
- if (VIA_DEBUG & DEBUG_DRI) {
- fprintf(stderr, "deviceID = %08x\n", viaScreen->deviceID);
- fprintf(stderr, "width = %08x\n", viaScreen->width);
- fprintf(stderr, "height = %08x\n", viaScreen->height);
- fprintf(stderr, "cpp = %08x\n", viaScreen->cpp);
- fprintf(stderr, "fbOffset = %08x\n", viaScreen->fbOffset);
- }
-
- viaScreen->bufs = via_create_empty_buffers();
- if (viaScreen->bufs == NULL) {
- __driUtilMessage("viaInitDriver: via_create_empty_buffers() failed");
- FREE(viaScreen);
- return GL_FALSE;
- }
-
- if (drmMap(sPriv->fd,
- gDRIPriv->regs.handle,
- gDRIPriv->regs.size,
- (drmAddress *)&viaScreen->reg) != 0) {
- FREE(viaScreen);
- sPriv->private = NULL;
- __driUtilMessage("viaInitDriver: drmMap regs failed");
- return GL_FALSE;
- }
-
- if (gDRIPriv->agp.size) {
- if (drmMap(sPriv->fd,
- gDRIPriv->agp.handle,
- gDRIPriv->agp.size,
- (drmAddress *)&viaScreen->agpLinearStart) != 0) {
- drmUnmap(viaScreen->reg, gDRIPriv->regs.size);
- FREE(viaScreen);
- sPriv->private = NULL;
- __driUtilMessage("viaInitDriver: drmMap agp failed");
- return GL_FALSE;
- }
-
- /*
- * FIXME: This is an invalid assumption that works until handle is
- * changed to mean something else than the 32-bit physical AGP address.
- */
-
- viaScreen->agpBase = gDRIPriv->agp.handle;
- } else
- viaScreen->agpLinearStart = 0;
-
- viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset;
-
- if ( glx_enable_extension != NULL ) {
- if ( viaScreen->irqEnabled ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
-
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- }
-
- return GL_TRUE;
-}
-
-static void
-viaDestroyScreen(__DRIscreenPrivate *sPriv)
-{
- viaScreenPrivate *viaScreen = (viaScreenPrivate *)sPriv->private;
- VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
-
- drmUnmap(viaScreen->reg, gDRIPriv->regs.size);
- if (gDRIPriv->agp.size)
- drmUnmap(viaScreen->agpLinearStart, gDRIPriv->agp.size);
-
- via_free_empty_buffers(viaScreen->bufs);
-
- FREE(viaScreen);
- sPriv->private = NULL;
-}
-
-
-static GLboolean
-viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap)
-{
- viaScreenPrivate *screen = (viaScreenPrivate *) driScrnPriv->private;
-
- GLboolean swStencil = (mesaVis->stencilBits > 0 &&
- mesaVis->depthBits != 24);
-
-
- if (isPixmap) {
- /* KW: This needs work, disabled for now:
- */
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-
- return (driDrawPriv->driverPrivate != NULL);
-#endif
- return GL_FALSE;
- }
- else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-#else
- struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
-
- /* XXX check/fix the offset/pitch parameters! */
- {
- driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->bytesPerPixel,
- 0, screen->width);
- viaSetSpanFunctions(frontRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- }
-
- if (mesaVis->doubleBufferMode) {
- driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->bytesPerPixel,
- 0, screen->width);
- viaSetSpanFunctions(backRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- }
-
- if (mesaVis->depthBits == 16) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->bytesPerPixel,
- 0, screen->width);
- viaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 24) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->bytesPerPixel,
- 0, screen->width);
- viaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
- else if (mesaVis->depthBits == 32) {
- driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->bytesPerPixel,
- 0, screen->width);
- viaSetSpanFunctions(depthRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- }
-
- if (mesaVis->stencilBits > 0 && !swStencil) {
- driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->bytesPerPixel,
- 0, screen->width);
- viaSetSpanFunctions(stencilRb, mesaVis);
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- }
-
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- GL_FALSE, /* depth */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */);
- driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
- }
-}
-
-
-static void
-viaDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *)(driDrawPriv->driverPrivate));
-}
-
-
-
-static struct __DriverAPIRec viaAPI = {
- .InitDriver = viaInitDriver,
- .DestroyScreen = viaDestroyScreen,
- .CreateContext = viaCreateContext,
- .DestroyContext = viaDestroyContext,
- .CreateBuffer = viaCreateBuffer,
- .DestroyBuffer = viaDestroyBuffer,
- .SwapBuffers = viaSwapBuffers,
- .MakeCurrent = viaMakeCurrent,
- .UnbindContext = viaUnbindContext,
- .GetSwapInfo = getSwapInfo,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL
-};
-
-
-static __GLcontextModes *
-viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
-{
- __GLcontextModes * modes;
- __GLcontextModes * m;
- unsigned num_modes;
- const unsigned back_buffer_factor = (have_back_buffer) ? 2 : 1;
- GLenum fb_format;
- GLenum fb_type;
-
- /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
- * enough to add support. Basically, if a context is created with an
- * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping
- * will never be used.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */
- };
-
- /* The 32-bit depth-buffer mode isn't supported yet, so don't actually
- * enable it.
- */
- static const u_int8_t depth_bits_array[4] = { 0, 16, 24, 32 };
- static const u_int8_t stencil_bits_array[4] = { 0, 0, 8, 0 };
- const unsigned depth_buffer_factor = 3;
-
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if ( pixel_bits == 16 ) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
- m = modes;
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_TRUE_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- if ( ! driFillInModes( & m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor,
- back_buffer_modes, back_buffer_factor,
- GLX_DIRECT_COLOR ) ) {
- fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
- __func__, __LINE__ );
- return NULL;
- }
-
- return modes;
-}
-
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
- *
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
- */
-PUBLIC
-void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
- __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
-
-{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { VIA_DRIDDX_VERSION_MAJOR,
- VIA_DRIDDX_VERSION_MINOR,
- VIA_DRIDDX_VERSION_PATCH };
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 2, 3, 0 };
-
- dri_interface = interface;
-
- if ( ! driCheckDriDdxDrmVersions2( "Unichrome",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
- return NULL;
- }
-
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &viaAPI);
- if ( psp != NULL ) {
- VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
- *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
- GL_TRUE );
-
- /* Calling driInitExtensions here, with a NULL context pointer, does not actually
- * enable the extensions. It just makes sure that all the dispatch offsets for all
- * the extensions that *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is called, but we can't
- * enable the extensions until we have a context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- }
-
- fprintf(stderr, "%s - succeeded\n", __FUNCTION__);
- return (void *) psp;
-}
-
-
-/**
- * Get information about previous buffer swaps.
- */
-static int
-getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo )
-{
- struct via_context *vmesa;
-
- if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL)
- || (dPriv->driContextPriv->driverPrivate == NULL)
- || (sInfo == NULL) ) {
- return -1;
- }
-
- vmesa = (struct via_context *) dPriv->driContextPriv->driverPrivate;
- sInfo->swap_count = vmesa->swap_count;
- sInfo->swap_ust = vmesa->swap_ust;
- sInfo->swap_missed_count = vmesa->swap_missed_count;
-
- sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
- ? driCalculateSwapUsage( dPriv, 0, vmesa->swap_missed_ust )
- : 0.0;
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.h
deleted file mode 100644
index 84aa5aef8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_screen.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIAINIT_H
-#define _VIAINIT_H
-
-#include <sys/time.h>
-#include "dri_util.h"
-#include "via_dri.h"
-#include "xmlconfig.h"
-
-typedef struct {
- viaRegion regs;
- viaRegion agp;
- int deviceID;
- int width;
- int height;
- int mem;
-
- int cpp;
- int bitsPerPixel;
- int bytesPerPixel;
- int fbFormat;
- int fbOffset;
- int fbSize;
-
- int fbStride;
-
- int backOffset;
- int depthOffset;
-
- int backPitch;
- int backPitchBits;
-
- int textureOffset;
- int textureSize;
- int logTextureGranularity;
-
- drmAddress reg;
- drmAddress agpLinearStart;
- GLuint agpBase;
-
- __DRIscreenPrivate *driScrnPriv;
- drmBufMapPtr bufs;
- unsigned int sareaPrivOffset;
- /*=* John Sheng [2003.12.9] Tuxracer & VQ *=*/
- int VQEnable;
- int irqEnabled;
-
- /* Configuration cache with default values for all contexts */
- driOptionCache optionCache;
-} viaScreenPrivate;
-
-
-extern GLboolean
-viaCreateContext(const __GLcontextModes *mesaVis,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate);
-
-extern void
-viaDestroyContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-viaUnbindContext(__DRIcontextPrivate *driContextPriv);
-
-extern GLboolean
-viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv);
-
-extern void
-viaSwapBuffers(__DRIdrawablePrivate *drawablePrivate);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.c
deleted file mode 100644
index 40772f480..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "via_context.h"
-#include "via_span.h"
-#include "via_ioctl.h"
-#include "swrast/swrast.h"
-
-#define DBG 0
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-#define HW_LOCK()
-
-#define HW_UNLOCK()
-
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
- GLuint draw_pitch = vmesa->drawBuffer->pitch; \
- GLuint read_pitch = vmesa->readBuffer->pitch; \
- GLuint height = dPriv->h; \
- GLint p = 0; \
- char *buf = (char *)(vmesa->drawBuffer->origMap + vmesa->drawXoff * vmesa->viaScreen->bytesPerPixel); \
- char *read_buf = (char *)(vmesa->readBuffer->origMap + vmesa->drawXoff * vmesa->viaScreen->bytesPerPixel); \
- (void) (read_pitch && draw_pitch && buf && read_buf && p);
-
-/* ================================================================
- * Color buffer
- */
-
-/* 16 bit, RGB565 color spanline and pixel functions
- */
-#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 2 + (_y) * read_pitch)
-#define GET_DST_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * draw_pitch)
-#define SPANTMP_PIXEL_FMT GL_RGB
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
-
-#define TAG(x) via##x##_565
-#define TAG2(x,y) via##x##_565##y
-#include "spantmp2.h"
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions
- */
-#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 4 + (_y) * read_pitch)
-#define GET_DST_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * draw_pitch)
-#define SPANTMP_PIXEL_FMT GL_BGRA
-#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
-
-#define TAG(x) via##x##_8888
-#define TAG2(x,y) via##x##_8888##y
-#include "spantmp2.h"
-
-
-/* 16 bit depthbuffer functions.
- */
-#define LOCAL_DEPTH_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
- GLuint depth_pitch = vmesa->depth.pitch; \
- GLuint height = dPriv->h; \
- char *buf = (char *)(vmesa->depth.map + (vmesa->drawXoff * vmesa->depth.bpp/8))
-
-#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
-
-
-#define WRITE_DEPTH(_x, _y, d) \
- *(GLushort *)(buf + (_x) * 2 + (_y) * depth_pitch) = d;
-
-#define READ_DEPTH(d, _x, _y) \
- d = *(volatile GLushort *)(buf + (_x) * 2 + (_y) * depth_pitch);
-
-#define TAG(x) via##x##_16
-#include "depthtmp.h"
-
-/* 32 bit depthbuffer functions.
- */
-#define WRITE_DEPTH(_x, _y, d) \
- *(GLuint *)(buf + (_x) * 4 + (_y) * depth_pitch) = d;
-
-#define READ_DEPTH(d, _x, _y) \
- d = *(volatile GLuint *)(buf + (_x) * 4 + (_y) * depth_pitch);
-
-#define TAG(x) via##x##_32
-#include "depthtmp.h"
-
-
-
-/* 24/8 bit interleaved depth/stencil functions
- */
-#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch); \
- tmp &= 0x000000ff; \
- tmp |= ((d)<<8); \
- *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch) = tmp; \
-}
-
-#define READ_DEPTH( d, _x, _y ) \
- d = (*(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch)) >> 8;
-
-
-#define TAG(x) via##x##_24_8
-#include "depthtmp.h"
-
-#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch); \
- tmp &= 0xffffff00; \
- tmp |= (d); \
- *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch) = tmp; \
-}
-
-#define READ_STENCIL( d, _x, _y ) \
- d = *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch) & 0xff;
-
-#define TAG(x) via##x##_24_8
-#include "stenciltmp.h"
-
-
-
-static void viaSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLuint bufferBit)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (bufferBit == BUFFER_BIT_FRONT_LEFT) {
- vmesa->drawBuffer = vmesa->readBuffer = &vmesa->front;
- }
- else if (bufferBit == BUFFER_BIT_BACK_LEFT) {
- vmesa->drawBuffer = vmesa->readBuffer = &vmesa->back;
- }
- else {
- ASSERT(0);
- }
-}
-
-/* Move locking out to get reasonable span performance.
- */
-void viaSpanRenderStart( GLcontext *ctx )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- viaWaitIdle(vmesa, GL_FALSE);
- LOCK_HARDWARE(vmesa);
-}
-
-void viaSpanRenderFinish( GLcontext *ctx )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- _swrast_flush( ctx );
- UNLOCK_HARDWARE( vmesa );
-}
-
-void viaInitSpanFuncs(GLcontext *ctx)
-{
-#if 0
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-#endif
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = viaSetBuffer;
-#if 0
- if (vmesa->viaScreen->bitsPerPixel == 16) {
- viaInitPointers_565( swdd );
- }
- else if (vmesa->viaScreen->bitsPerPixel == 32) {
- viaInitPointers_8888( swdd );
- }
- else {
- assert(0);
- }
-#endif
-#if 0
- if (vmesa->glCtx->Visual.depthBits == 16) {
- swdd->ReadDepthSpan = viaReadDepthSpan_16;
- swdd->WriteDepthSpan = viaWriteDepthSpan_16;
- swdd->WriteMonoDepthSpan = viaWriteMonoDepthSpan_16;
- swdd->ReadDepthPixels = viaReadDepthPixels_16;
- swdd->WriteDepthPixels = viaWriteDepthPixels_16;
- }
- else if (vmesa->glCtx->Visual.depthBits == 24) {
- swdd->ReadDepthSpan = viaReadDepthSpan_24_8;
- swdd->WriteDepthSpan = viaWriteDepthSpan_24_8;
- swdd->WriteMonoDepthSpan = viaWriteMonoDepthSpan_24_8;
- swdd->ReadDepthPixels = viaReadDepthPixels_24_8;
- swdd->WriteDepthPixels = viaWriteDepthPixels_24_8;
-
- swdd->WriteStencilSpan = viaWriteStencilSpan_24_8;
- swdd->ReadStencilSpan = viaReadStencilSpan_24_8;
- swdd->WriteStencilPixels = viaWriteStencilPixels_24_8;
- swdd->ReadStencilPixels = viaReadStencilPixels_24_8;
- }
- else if (vmesa->glCtx->Visual.depthBits == 32) {
- swdd->ReadDepthSpan = viaReadDepthSpan_32;
- swdd->WriteDepthSpan = viaWriteDepthSpan_32;
- swdd->WriteMonoDepthSpan = viaWriteMonoDepthSpan_32;
- swdd->ReadDepthPixels = viaReadDepthPixels_32;
- swdd->WriteDepthPixels = viaWriteDepthPixels_32;
- }
-#endif
-
- swdd->SpanRenderStart = viaSpanRenderStart;
- swdd->SpanRenderFinish = viaSpanRenderFinish;
-
-#if 0
- swdd->WriteCI8Span = NULL;
- swdd->WriteCI32Span = NULL;
- swdd->WriteMonoCISpan = NULL;
- swdd->WriteCI32Pixels = NULL;
- swdd->WriteMonoCIPixels = NULL;
- swdd->ReadCI32Span = NULL;
- swdd->ReadCI32Pixels = NULL;
-#endif
-}
-
-
-
-/**
- * Plug in the Get/Put routines for the given driRenderbuffer.
- */
-void
-viaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
-{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- viaInitPointers_565(&drb->Base);
- }
- else {
- viaInitPointers_8888(&drb->Base);
- }
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = viaReadDepthSpan_16;
- drb->Base.GetValues = viaReadDepthPixels_16;
- drb->Base.PutRow = viaWriteDepthSpan_16;
- drb->Base.PutMonoRow = viaWriteMonoDepthSpan_16;
- drb->Base.PutValues = viaWriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
- drb->Base.GetRow = viaReadDepthSpan_24_8;
- drb->Base.GetValues = viaReadDepthPixels_24_8;
- drb->Base.PutRow = viaWriteDepthSpan_24_8;
- drb->Base.PutMonoRow = viaWriteMonoDepthSpan_24_8;
- drb->Base.PutValues = viaWriteDepthPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
- drb->Base.GetRow = viaReadDepthSpan_32;
- drb->Base.GetValues = viaReadDepthPixels_32;
- drb->Base.PutRow = viaWriteDepthSpan_32;
- drb->Base.PutMonoRow = viaWriteMonoDepthSpan_32;
- drb->Base.PutValues = viaWriteDepthPixels_32;
- drb->Base.PutMonoValues = NULL;
- }
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
- drb->Base.GetRow = viaReadStencilSpan_24_8;
- drb->Base.GetValues = viaReadStencilPixels_24_8;
- drb->Base.PutRow = viaWriteStencilSpan_24_8;
- drb->Base.PutMonoRow = viaWriteMonoStencilSpan_24_8;
- drb->Base.PutValues = viaWriteStencilPixels_24_8;
- drb->Base.PutMonoValues = NULL;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.h
deleted file mode 100644
index c3bd24b0e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_span.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIA_SPAN_H
-#define _VIA_SPAN_H
-
-#include "drirenderbuffer.h"
-
-extern void viaInitSpanFuncs(GLcontext *ctx);
-extern void viaSpanRenderStart( GLcontext *ctx );
-extern void viaSpanRenderFinish( GLcontext *ctx );
-
-extern void
-viaSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.c
deleted file mode 100644
index 4037d14ff..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.c
+++ /dev/null
@@ -1,1550 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-
-#include "glheader.h"
-#include "buffers.h"
-#include "context.h"
-#include "macros.h"
-#include "colormac.h"
-#include "enums.h"
-#include "dd.h"
-
-#include "mm.h"
-#include "via_context.h"
-#include "via_state.h"
-#include "via_tex.h"
-#include "via_tris.h"
-#include "via_ioctl.h"
-#include "via_3d_reg.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
-
-
-static GLuint ROP[16] = {
- HC_HROP_BLACK, /* GL_CLEAR 0 */
- HC_HROP_DPa, /* GL_AND s & d */
- HC_HROP_PDna, /* GL_AND_REVERSE s & ~d */
- HC_HROP_P, /* GL_COPY s */
- HC_HROP_DPna, /* GL_AND_INVERTED ~s & d */
- HC_HROP_D, /* GL_NOOP d */
- HC_HROP_DPx, /* GL_XOR s ^ d */
- HC_HROP_DPo, /* GL_OR s | d */
- HC_HROP_DPon, /* GL_NOR ~(s | d) */
- HC_HROP_DPxn, /* GL_EQUIV ~(s ^ d) */
- HC_HROP_Dn, /* GL_INVERT ~d */
- HC_HROP_PDno, /* GL_OR_REVERSE s | ~d */
- HC_HROP_Pn, /* GL_COPY_INVERTED ~s */
- HC_HROP_DPno, /* GL_OR_INVERTED ~s | d */
- HC_HROP_DPan, /* GL_NAND ~(s & d) */
- HC_HROP_WHITE /* GL_SET 1 */
-};
-
-/*
- * Compute the 'S5.5' lod bias factor from the floating point OpenGL bias.
- */
-static GLuint viaComputeLodBias(GLfloat bias)
-{
- int b = (int) (bias * 32.0);
- if (b > 511)
- b = 511;
- else if (b < -512)
- b = -512;
- return (GLuint) b;
-}
-
-void viaEmitState(struct via_context *vmesa)
-{
- GLcontext *ctx = vmesa->glCtx;
- GLuint i = 0;
- GLuint j = 0;
- RING_VARS;
-
- viaCheckDma(vmesa, 0x110);
-
- BEGIN_RING(5);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( ((HC_SubA_HEnable << 24) | vmesa->regEnable) );
- OUT_RING( ((HC_SubA_HFBBMSKL << 24) | vmesa->regHFBBMSKL) );
- OUT_RING( ((HC_SubA_HROP << 24) | vmesa->regHROP) );
- ADVANCE_RING();
-
- if (vmesa->have_hw_stencil) {
- GLuint pitch, format, offset;
-
- format = HC_HZWBFM_24;
- offset = vmesa->depth.offset;
- pitch = vmesa->depth.pitch;
-
- BEGIN_RING(6);
- OUT_RING( (HC_SubA_HZWBBasL << 24) | (offset & 0xFFFFFF) );
- OUT_RING( (HC_SubA_HZWBBasH << 24) | ((offset & 0xFF000000) >> 24) );
- OUT_RING( (HC_SubA_HZWBType << 24) | HC_HDBLoc_Local | HC_HZONEasFF_MASK |
- format | pitch );
- OUT_RING( (HC_SubA_HZWTMD << 24) | vmesa->regHZWTMD );
- OUT_RING( (HC_SubA_HSTREF << 24) | vmesa->regHSTREF );
- OUT_RING( (HC_SubA_HSTMD << 24) | vmesa->regHSTMD );
- ADVANCE_RING();
- }
- else if (vmesa->hasDepth) {
- GLuint pitch, format, offset;
-
- if (vmesa->depthBits == 16) {
- format = HC_HZWBFM_16;
- }
- else {
- format = HC_HZWBFM_32;
- }
-
-
- offset = vmesa->depth.offset;
- pitch = vmesa->depth.pitch;
-
- BEGIN_RING(4);
- OUT_RING( (HC_SubA_HZWBBasL << 24) | (offset & 0xFFFFFF) );
- OUT_RING( (HC_SubA_HZWBBasH << 24) | ((offset & 0xFF000000) >> 24) );
- OUT_RING( (HC_SubA_HZWBType << 24) | HC_HDBLoc_Local | HC_HZONEasFF_MASK |
- format | pitch );
- OUT_RING( (HC_SubA_HZWTMD << 24) | vmesa->regHZWTMD );
- ADVANCE_RING();
- }
-
- if (ctx->Color.AlphaEnabled) {
- BEGIN_RING(1);
- OUT_RING( (HC_SubA_HATMD << 24) | vmesa->regHATMD );
- ADVANCE_RING();
- i++;
- }
-
- if (ctx->Color.BlendEnabled) {
- BEGIN_RING(11);
- OUT_RING( (HC_SubA_HABLCsat << 24) | vmesa->regHABLCsat );
- OUT_RING( (HC_SubA_HABLCop << 24) | vmesa->regHABLCop );
- OUT_RING( (HC_SubA_HABLAsat << 24) | vmesa->regHABLAsat );
- OUT_RING( (HC_SubA_HABLAop << 24) | vmesa->regHABLAop );
- OUT_RING( (HC_SubA_HABLRCa << 24) | vmesa->regHABLRCa );
- OUT_RING( (HC_SubA_HABLRFCa << 24) | vmesa->regHABLRFCa );
- OUT_RING( (HC_SubA_HABLRCbias << 24) | vmesa->regHABLRCbias );
- OUT_RING( (HC_SubA_HABLRCb << 24) | vmesa->regHABLRCb );
- OUT_RING( (HC_SubA_HABLRFCb << 24) | vmesa->regHABLRFCb );
- OUT_RING( (HC_SubA_HABLRAa << 24) | vmesa->regHABLRAa );
- OUT_RING( (HC_SubA_HABLRAb << 24) | vmesa->regHABLRAb );
- ADVANCE_RING();
- }
-
- if (ctx->Fog.Enabled) {
- BEGIN_RING(3);
- OUT_RING( (HC_SubA_HFogLF << 24) | vmesa->regHFogLF );
- OUT_RING( (HC_SubA_HFogCL << 24) | vmesa->regHFogCL );
- OUT_RING( (HC_SubA_HFogCH << 24) | vmesa->regHFogCH );
- ADVANCE_RING();
- }
-
- if (ctx->Line.StippleFlag) {
- BEGIN_RING(2);
- OUT_RING( (HC_SubA_HLP << 24) | ctx->Line.StipplePattern );
- OUT_RING( (HC_SubA_HLPRF << 24) | ctx->Line.StippleFactor );
- ADVANCE_RING();
- }
-
- BEGIN_RING(1);
- OUT_RING( (HC_SubA_HPixGC << 24) | 0x0 );
- ADVANCE_RING();
-
- QWORD_PAD_RING();
-
-
- if (ctx->Texture._EnabledUnits) {
-
- struct gl_texture_unit *texUnit0 = &ctx->Texture.Unit[0];
- struct gl_texture_unit *texUnit1 = &ctx->Texture.Unit[1];
-
- {
- GLuint nDummyValue = 0;
-
- BEGIN_RING( 8 );
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (HC_SubType_TexGeneral << 24) );
-
- if (texUnit0->Enabled && texUnit1->Enabled) {
- nDummyValue = (HC_SubA_HTXSMD << 24) | (1 << 3);
- }
- else {
- nDummyValue = (HC_SubA_HTXSMD << 24) | 0;
- }
-
- if (vmesa->clearTexCache) {
- vmesa->clearTexCache = 0;
- OUT_RING( nDummyValue | HC_HTXCHCLR_MASK );
- OUT_RING( nDummyValue );
- }
- else {
- OUT_RING( nDummyValue );
- OUT_RING( nDummyValue );
- }
-
- OUT_RING( HC_HEADER2 );
- OUT_RING( HC_ParaType_NotTex << 16 );
- OUT_RING( (HC_SubA_HEnable << 24) | vmesa->regEnable );
- OUT_RING( (HC_SubA_HEnable << 24) | vmesa->regEnable );
- ADVANCE_RING();
- }
-
- if (texUnit0->Enabled) {
- struct gl_texture_object *texObj = texUnit0->_Current;
- struct via_texture_object *t = (struct via_texture_object *)texObj;
- GLuint numLevels = t->lastLevel - t->firstLevel + 1;
- if (VIA_DEBUG & DEBUG_STATE) {
- fprintf(stderr, "texture0 enabled\n");
- }
- if (numLevels == 8) {
- BEGIN_RING(27);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (0 << 24) );
- OUT_RING( t->regTexFM );
- OUT_RING( (HC_SubA_HTXnL0OS << 24) |
- ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel );
- OUT_RING( t->regTexWidthLog2[0] );
- OUT_RING( t->regTexWidthLog2[1] );
- OUT_RING( t->regTexHeightLog2[0] );
- OUT_RING( t->regTexHeightLog2[1] );
- OUT_RING( t->regTexBaseH[0] );
- OUT_RING( t->regTexBaseH[1] );
- OUT_RING( t->regTexBaseH[2] );
- OUT_RING( t->regTexBaseAndPitch[0].baseL );
- OUT_RING( t->regTexBaseAndPitch[0].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[1].baseL );
- OUT_RING( t->regTexBaseAndPitch[1].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[2].baseL );
- OUT_RING( t->regTexBaseAndPitch[2].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[3].baseL );
- OUT_RING( t->regTexBaseAndPitch[3].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[4].baseL );
- OUT_RING( t->regTexBaseAndPitch[4].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[5].baseL );
- OUT_RING( t->regTexBaseAndPitch[5].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[6].baseL );
- OUT_RING( t->regTexBaseAndPitch[6].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[7].baseL );
- OUT_RING( t->regTexBaseAndPitch[7].pitchLog2 );
- ADVANCE_RING();
- }
- else if (numLevels > 1) {
-
- BEGIN_RING(12 + numLevels * 2);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (0 << 24) );
- OUT_RING( t->regTexFM );
- OUT_RING( (HC_SubA_HTXnL0OS << 24) |
- ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel );
- OUT_RING( t->regTexWidthLog2[0] );
- OUT_RING( t->regTexHeightLog2[0] );
-
- if (numLevels > 6) {
- OUT_RING( t->regTexWidthLog2[1] );
- OUT_RING( t->regTexHeightLog2[1] );
- }
-
- OUT_RING( t->regTexBaseH[0] );
-
- if (numLevels > 3) {
- OUT_RING( t->regTexBaseH[1] );
- }
- if (numLevels > 6) {
- OUT_RING( t->regTexBaseH[2] );
- }
- if (numLevels > 9) {
- OUT_RING( t->regTexBaseH[3] );
- }
-
- for (j = 0; j < numLevels; j++) {
- OUT_RING( t->regTexBaseAndPitch[j].baseL );
- OUT_RING( t->regTexBaseAndPitch[j].pitchLog2 );
- }
-
- ADVANCE_RING_VARIABLE();
- }
- else {
-
- BEGIN_RING(9);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (0 << 24) );
- OUT_RING( t->regTexFM );
- OUT_RING( (HC_SubA_HTXnL0OS << 24) |
- ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel );
- OUT_RING( t->regTexWidthLog2[0] );
- OUT_RING( t->regTexHeightLog2[0] );
- OUT_RING( t->regTexBaseH[0] );
- OUT_RING( t->regTexBaseAndPitch[0].baseL );
- OUT_RING( t->regTexBaseAndPitch[0].pitchLog2 );
- ADVANCE_RING();
- }
-
- BEGIN_RING(14);
- OUT_RING( (HC_SubA_HTXnTB << 24) | vmesa->regHTXnTB[0] );
- OUT_RING( (HC_SubA_HTXnMPMD << 24) | vmesa->regHTXnMPMD[0] );
- OUT_RING( (HC_SubA_HTXnTBLCsat << 24) | vmesa->regHTXnTBLCsat[0] );
- OUT_RING( (HC_SubA_HTXnTBLCop << 24) | vmesa->regHTXnTBLCop[0] );
- OUT_RING( (HC_SubA_HTXnTBLMPfog << 24) | vmesa->regHTXnTBLMPfog[0] );
- OUT_RING( (HC_SubA_HTXnTBLAsat << 24) | vmesa->regHTXnTBLAsat[0] );
- OUT_RING( (HC_SubA_HTXnTBLRCb << 24) | vmesa->regHTXnTBLRCb[0] );
- OUT_RING( (HC_SubA_HTXnTBLRAa << 24) | vmesa->regHTXnTBLRAa[0] );
- OUT_RING( (HC_SubA_HTXnTBLRFog << 24) | vmesa->regHTXnTBLRFog[0] );
- OUT_RING( (HC_SubA_HTXnTBLRCa << 24) | vmesa->regHTXnTBLRCa[0] );
- OUT_RING( (HC_SubA_HTXnTBLRCc << 24) | vmesa->regHTXnTBLRCc[0] );
- OUT_RING( (HC_SubA_HTXnTBLRCbias << 24) | vmesa->regHTXnTBLRCbias[0] );
- OUT_RING( (HC_SubA_HTXnTBC << 24) | vmesa->regHTXnTBC[0] );
- OUT_RING( (HC_SubA_HTXnTRAH << 24) | vmesa->regHTXnTRAH[0] );
-/* OUT_RING( (HC_SubA_HTXnCLODu << 24) | vmesa->regHTXnCLOD[0] ); */
- ADVANCE_RING();
-
- /* KW: This test never succeeds:
- */
- if (t->regTexFM == HC_HTXnFM_Index8) {
- struct gl_color_table *table = &texObj->Palette;
- GLfloat *tableF = (GLfloat *)table->Table;
-
- BEGIN_RING(2 + table->Size);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Palette << 16) | (0 << 24) );
- for (j = 0; j < table->Size; j++)
- OUT_RING( tableF[j] );
- ADVANCE_RING();
-
- }
-
- QWORD_PAD_RING();
- }
-
- if (texUnit1->Enabled) {
- struct gl_texture_object *texObj = texUnit1->_Current;
- struct via_texture_object *t = (struct via_texture_object *)texObj;
- GLuint numLevels = t->lastLevel - t->firstLevel + 1;
- int texunit = (texUnit0->Enabled ? 1 : 0);
- if (VIA_DEBUG & DEBUG_STATE) {
- fprintf(stderr, "texture1 enabled\n");
- }
- if (numLevels == 8) {
- BEGIN_RING(27);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (texunit << 24) );
- OUT_RING( t->regTexFM );
- OUT_RING( (HC_SubA_HTXnL0OS << 24) |
- ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel );
- OUT_RING( t->regTexWidthLog2[0] );
- OUT_RING( t->regTexWidthLog2[1] );
- OUT_RING( t->regTexHeightLog2[0] );
- OUT_RING( t->regTexHeightLog2[1] );
- OUT_RING( t->regTexBaseH[0] );
- OUT_RING( t->regTexBaseH[1] );
- OUT_RING( t->regTexBaseH[2] );
- OUT_RING( t->regTexBaseAndPitch[0].baseL );
- OUT_RING( t->regTexBaseAndPitch[0].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[1].baseL );
- OUT_RING( t->regTexBaseAndPitch[1].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[2].baseL );
- OUT_RING( t->regTexBaseAndPitch[2].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[3].baseL );
- OUT_RING( t->regTexBaseAndPitch[3].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[4].baseL );
- OUT_RING( t->regTexBaseAndPitch[4].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[5].baseL );
- OUT_RING( t->regTexBaseAndPitch[5].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[6].baseL );
- OUT_RING( t->regTexBaseAndPitch[6].pitchLog2 );
- OUT_RING( t->regTexBaseAndPitch[7].baseL );
- OUT_RING( t->regTexBaseAndPitch[7].pitchLog2 );
- ADVANCE_RING();
- }
- else if (numLevels > 1) {
- BEGIN_RING(12 + numLevels * 2);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (texunit << 24) );
- OUT_RING( t->regTexFM );
- OUT_RING( (HC_SubA_HTXnL0OS << 24) |
- ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel );
- OUT_RING( t->regTexWidthLog2[0] );
- OUT_RING( t->regTexHeightLog2[0] );
-
- if (numLevels > 6) {
- OUT_RING( t->regTexWidthLog2[1] );
- OUT_RING( t->regTexHeightLog2[1] );
- i += 2;
- }
-
- OUT_RING( t->regTexBaseH[0] );
-
- if (numLevels > 3) {
- OUT_RING( t->regTexBaseH[1] );
- }
- if (numLevels > 6) {
- OUT_RING( t->regTexBaseH[2] );
- }
- if (numLevels > 9) {
- OUT_RING( t->regTexBaseH[3] );
- }
-
- for (j = 0; j < numLevels; j++) {
- OUT_RING( t->regTexBaseAndPitch[j].baseL );
- OUT_RING( t->regTexBaseAndPitch[j].pitchLog2 );
- }
- ADVANCE_RING_VARIABLE();
- }
- else {
- BEGIN_RING(9);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Tex << 16) | (texunit << 24) );
- OUT_RING( t->regTexFM );
- OUT_RING( (HC_SubA_HTXnL0OS << 24) |
- ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel );
- OUT_RING( t->regTexWidthLog2[0] );
- OUT_RING( t->regTexHeightLog2[0] );
- OUT_RING( t->regTexBaseH[0] );
- OUT_RING( t->regTexBaseAndPitch[0].baseL );
- OUT_RING( t->regTexBaseAndPitch[0].pitchLog2 );
- ADVANCE_RING();
- }
-
- BEGIN_RING(14);
- OUT_RING( (HC_SubA_HTXnTB << 24) | vmesa->regHTXnTB[1] );
- OUT_RING( (HC_SubA_HTXnMPMD << 24) | vmesa->regHTXnMPMD[1] );
- OUT_RING( (HC_SubA_HTXnTBLCsat << 24) | vmesa->regHTXnTBLCsat[1] );
- OUT_RING( (HC_SubA_HTXnTBLCop << 24) | vmesa->regHTXnTBLCop[1] );
- OUT_RING( (HC_SubA_HTXnTBLMPfog << 24) | vmesa->regHTXnTBLMPfog[1] );
- OUT_RING( (HC_SubA_HTXnTBLAsat << 24) | vmesa->regHTXnTBLAsat[1] );
- OUT_RING( (HC_SubA_HTXnTBLRCb << 24) | vmesa->regHTXnTBLRCb[1] );
- OUT_RING( (HC_SubA_HTXnTBLRAa << 24) | vmesa->regHTXnTBLRAa[1] );
- OUT_RING( (HC_SubA_HTXnTBLRFog << 24) | vmesa->regHTXnTBLRFog[1] );
- OUT_RING( (HC_SubA_HTXnTBLRCa << 24) | vmesa->regHTXnTBLRCa[1] );
- OUT_RING( (HC_SubA_HTXnTBLRCc << 24) | vmesa->regHTXnTBLRCc[1] );
- OUT_RING( (HC_SubA_HTXnTBLRCbias << 24) | vmesa->regHTXnTBLRCbias[1] );
- OUT_RING( (HC_SubA_HTXnTBC << 24) | vmesa->regHTXnTBC[1] );
- OUT_RING( (HC_SubA_HTXnTRAH << 24) | vmesa->regHTXnTRAH[1] );
-/* OUT_RING( (HC_SubA_HTXnCLODu << 24) | vmesa->regHTXnCLOD[1] ); */
- ADVANCE_RING();
-
- /* KW: This test never succeeds:
- */
- if (t->regTexFM == HC_HTXnFM_Index8) {
- struct gl_color_table *table = &texObj->Palette;
- GLfloat *tableF = (GLfloat *)table->Table;
-
- BEGIN_RING(2 + table->Size);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_Palette << 16) | (texunit << 24) );
- for (j = 0; j < table->Size; j++) {
- OUT_RING( tableF[j] );
- }
- ADVANCE_RING();
- }
-
- QWORD_PAD_RING();
- }
- }
-
-#if 0
- /* Polygon stipple is broken - for certain stipple values,
- * eg. 0xf0f0f0f0, the hardware will refuse to accept the stipple.
- * Coincidentally, conform generates just such a stipple.
- */
- if (ctx->Polygon.StippleFlag) {
- GLuint *stipple = &ctx->PolygonStipple[0];
- GLint i;
-
- BEGIN_RING(38);
- OUT_RING( HC_HEADER2 );
-
- OUT_RING( ((HC_ParaType_Palette << 16) | (HC_SubType_Stipple << 24)) );
- for (i = 31; i >= 0; i--) {
- GLint j;
- GLuint k = 0;
-
- /* Need to flip bits left to right:
- */
- for (j = 0 ; j < 32; j++)
- if (stipple[i] & (1<<j))
- k |= 1 << (31-j);
-
- OUT_RING( k );
- }
-
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32- vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
- OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32 - vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
-
- ADVANCE_RING();
- }
-#endif
-
- vmesa->newEmitState = 0;
-}
-
-
-static __inline__ GLuint viaPackColor(GLuint bpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a)
-{
- switch (bpp) {
- case 16:
- return PACK_COLOR_565(r, g, b);
- case 32:
- return PACK_COLOR_8888(a, r, g, b);
- default:
- assert(0);
- return 0;
- }
-}
-
-static void viaBlendEquationSeparate(GLcontext *ctx,
- GLenum rgbMode,
- GLenum aMode)
-{
- if (VIA_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s in\n", __FUNCTION__);
-
- /* GL_EXT_blend_equation_separate not supported */
- ASSERT(rgbMode == aMode);
-
- /* Can only do GL_ADD equation in hardware */
- FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_BLEND_EQ,
- rgbMode != GL_FUNC_ADD_EXT);
-
- /* BlendEquation sets ColorLogicOpEnabled in an unexpected
- * manner.
- */
- FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_LOGICOP,
- (ctx->Color.ColorLogicOpEnabled &&
- ctx->Color.LogicOp != GL_COPY));
-}
-
-static void viaBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLboolean fallback = GL_FALSE;
- if (VIA_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s in\n", __FUNCTION__);
-
- switch (ctx->Color.BlendSrcRGB) {
- case GL_SRC_ALPHA_SATURATE:
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- fallback = GL_TRUE;
- break;
- default:
- break;
- }
-
- switch (ctx->Color.BlendDstRGB) {
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- fallback = GL_TRUE;
- break;
- default:
- break;
- }
-
- FALLBACK(vmesa, VIA_FALLBACK_BLEND_FUNC, fallback);
-}
-
-/* Shouldn't be called as the extension is disabled.
- */
-static void viaBlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA)
-{
- if (dfactorRGB != dfactorA || sfactorRGB != sfactorA) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBlendEquation (disabled)");
- }
-
- viaBlendFunc(ctx, sfactorRGB, dfactorRGB);
-}
-
-
-
-
-/* =============================================================
- * Hardware clipping
- */
-static void viaScissor(GLcontext *ctx, GLint x, GLint y,
- GLsizei w, GLsizei h)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (!vmesa->driDrawable)
- return;
-
- if (VIA_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s %d,%d %dx%d, drawH %d\n", __FUNCTION__,
- x,y,w,h, vmesa->driDrawable->h);
-
- if (vmesa->scissor) {
- VIA_FLUSH_DMA(vmesa); /* don't pipeline cliprect changes */
- }
-
- vmesa->scissorRect.x1 = x;
- vmesa->scissorRect.y1 = vmesa->driDrawable->h - y - h;
- vmesa->scissorRect.x2 = x + w;
- vmesa->scissorRect.y2 = vmesa->driDrawable->h - y;
-}
-
-static void viaEnable(GLcontext *ctx, GLenum cap, GLboolean state)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- switch (cap) {
- case GL_SCISSOR_TEST:
- VIA_FLUSH_DMA(vmesa);
- vmesa->scissor = state;
- break;
- default:
- break;
- }
-}
-
-
-
-/* Fallback to swrast for select and feedback.
- */
-static void viaRenderMode(GLcontext *ctx, GLenum mode)
-{
- FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_RENDERMODE, (mode != GL_RENDER));
-}
-
-
-static void viaDrawBuffer(GLcontext *ctx, GLenum mode)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (VIA_DEBUG & (DEBUG_DRI|DEBUG_STATE))
- fprintf(stderr, "%s in\n", __FUNCTION__);
-
- if (!ctx->DrawBuffer)
- return;
-
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- VIA_FLUSH_DMA(vmesa);
- vmesa->drawBuffer = vmesa->readBuffer = &vmesa->front;
- FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_FALSE);
- break;
- case BUFFER_BIT_BACK_LEFT:
- VIA_FLUSH_DMA(vmesa);
- vmesa->drawBuffer = vmesa->readBuffer = &vmesa->back;
- FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_FALSE);
- break;
- default:
- FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_TRUE);
- return;
- }
-
-
- viaXMesaWindowMoved(vmesa);
-
- /* We want to update the s/w rast state too so that viaSetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
-}
-
-static void viaClearColor(GLcontext *ctx, const GLfloat color[4])
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLubyte pcolor[4];
- CLAMPED_FLOAT_TO_UBYTE(pcolor[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(pcolor[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(pcolor[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(pcolor[3], color[3]);
- vmesa->ClearColor = viaPackColor(vmesa->viaScreen->bitsPerPixel,
- pcolor[0], pcolor[1],
- pcolor[2], pcolor[3]);
-}
-
-#define WRITEMASK_ALPHA_SHIFT 31
-#define WRITEMASK_RED_SHIFT 30
-#define WRITEMASK_GREEN_SHIFT 29
-#define WRITEMASK_BLUE_SHIFT 28
-
-static void viaColorMask(GLcontext *ctx,
- GLboolean r, GLboolean g,
- GLboolean b, GLboolean a)
-{
- struct via_context *vmesa = VIA_CONTEXT( ctx );
-
- if (VIA_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s r(%d) g(%d) b(%d) a(%d)\n", __FUNCTION__, r, g, b, a);
-
- vmesa->ClearMask = (((!r) << WRITEMASK_RED_SHIFT) |
- ((!g) << WRITEMASK_GREEN_SHIFT) |
- ((!b) << WRITEMASK_BLUE_SHIFT) |
- ((!a) << WRITEMASK_ALPHA_SHIFT));
-}
-
-
-/* =============================================================
- */
-
-
-/* Using drawXoff like this is incorrect outside of locked regions.
- * This hardware just isn't capable of private back buffers without
- * glitches and/or a hefty locking scheme.
- */
-void viaCalcViewport(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- GLfloat *m = vmesa->ViewportMatrix.m;
-
- /* See also via_translate_vertex.
- */
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X + vmesa->drawXoff;
- m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + vmesa->driDrawable->h + SUBPIXEL_Y;
- m[MAT_SZ] = v[MAT_SZ] * (1.0 / vmesa->depth_max);
- m[MAT_TZ] = v[MAT_TZ] * (1.0 / vmesa->depth_max);
-}
-
-static void viaViewport(GLcontext *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height)
-{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
- viaCalcViewport(ctx);
-}
-
-static void viaDepthRange(GLcontext *ctx,
- GLclampd nearval, GLclampd farval)
-{
- viaCalcViewport(ctx);
-}
-
-void viaInitState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- vmesa->regCmdB = HC_ACMD_HCmdB;
- vmesa->regEnable = HC_HenCW_MASK;
-
- /* Mesa should do this for us:
- */
-
- ctx->Driver.BlendEquationSeparate( ctx,
- ctx->Color.BlendEquationRGB,
- ctx->Color.BlendEquationA);
-
- ctx->Driver.BlendFuncSeparate( ctx,
- ctx->Color.BlendSrcRGB,
- ctx->Color.BlendDstRGB,
- ctx->Color.BlendSrcA,
- ctx->Color.BlendDstA);
-
- ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height );
-
- ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
-}
-
-/**
- * Convert S and T texture coordinate wrap modes to hardware bits.
- */
-static u_int32_t
-get_wrap_mode( GLenum sWrap, GLenum tWrap )
-{
- u_int32_t v = 0;
-
-
- switch( sWrap ) {
- case GL_REPEAT:
- v |= HC_HTXnMPMD_Srepeat;
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- v |= HC_HTXnMPMD_Sclamp;
- break;
- case GL_MIRRORED_REPEAT:
- v |= HC_HTXnMPMD_Smirror;
- break;
- }
-
- switch( tWrap ) {
- case GL_REPEAT:
- v |= HC_HTXnMPMD_Trepeat;
- break;
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- v |= HC_HTXnMPMD_Tclamp;
- break;
- case GL_MIRRORED_REPEAT:
- v |= HC_HTXnMPMD_Tmirror;
- break;
- }
-
- return v;
-}
-
-static u_int32_t
-get_minmag_filter( GLenum min, GLenum mag )
-{
- u_int32_t v = 0;
-
- switch (min) {
- case GL_NEAREST:
- v = HC_HTXnFLSs_Nearest |
- HC_HTXnFLTs_Nearest;
- break;
- case GL_LINEAR:
- v = HC_HTXnFLSs_Linear |
- HC_HTXnFLTs_Linear;
- break;
- case GL_NEAREST_MIPMAP_NEAREST:
- v = HC_HTXnFLSs_Nearest |
- HC_HTXnFLTs_Nearest;
- v |= HC_HTXnFLDs_Nearest;
- break;
- case GL_LINEAR_MIPMAP_NEAREST:
- v = HC_HTXnFLSs_Linear |
- HC_HTXnFLTs_Linear;
- v |= HC_HTXnFLDs_Nearest;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- v = HC_HTXnFLSs_Nearest |
- HC_HTXnFLTs_Nearest;
- v |= HC_HTXnFLDs_Linear;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- v = HC_HTXnFLSs_Linear |
- HC_HTXnFLTs_Linear;
- v |= HC_HTXnFLDs_Linear;
- break;
- default:
- break;
- }
-
- switch (mag) {
- case GL_LINEAR:
- v |= HC_HTXnFLSe_Linear |
- HC_HTXnFLTe_Linear;
- break;
- case GL_NEAREST:
- v |= HC_HTXnFLSe_Nearest |
- HC_HTXnFLTe_Nearest;
- break;
- default:
- break;
- }
-
- return v;
-}
-
-
-static GLboolean viaChooseTextureState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- struct gl_texture_unit *texUnit0 = &ctx->Texture.Unit[0];
- struct gl_texture_unit *texUnit1 = &ctx->Texture.Unit[1];
-
- if (texUnit0->_ReallyEnabled || texUnit1->_ReallyEnabled) {
- vmesa->regEnable |= HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK;
-
- if (texUnit0->_ReallyEnabled) {
- struct gl_texture_object *texObj = texUnit0->_Current;
-
- vmesa->regHTXnTB[0] = get_minmag_filter( texObj->MinFilter,
- texObj->MagFilter );
-
- vmesa->regHTXnMPMD[0] &= ~(HC_HTXnMPMD_SMASK | HC_HTXnMPMD_TMASK);
- vmesa->regHTXnMPMD[0] |= get_wrap_mode( texObj->WrapS,
- texObj->WrapT );
-
- vmesa->regHTXnTB[0] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
- if (texObj->Image[0][texObj->BaseLevel]->Border > 0) {
- vmesa->regHTXnTB[0] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
- vmesa->regHTXnTBC[0] =
- PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor[0]),
- FLOAT_TO_UBYTE(texObj->BorderColor[1]),
- FLOAT_TO_UBYTE(texObj->BorderColor[2]));
- vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->BorderColor[3]);
- }
-
- if (texUnit0->LodBias != 0.0f) {
- GLuint b = viaComputeLodBias(texUnit0->LodBias);
- vmesa->regHTXnTB[0] &= ~HC_HTXnFLDs_MASK;
- vmesa->regHTXnTB[0] |= HC_HTXnFLDs_ConstLOD;
- vmesa->regHTXnCLOD[0] = (b&0x1f) | (((~b)&0x1f)<<10); /* FIXME */
- }
-
- if (!viaTexCombineState( vmesa, texUnit0->_CurrentCombine, 0 )) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "viaTexCombineState failed for unit 0\n");
- return GL_FALSE;
- }
- }
-
- if (texUnit1->_ReallyEnabled) {
- struct gl_texture_object *texObj = texUnit1->_Current;
-
- vmesa->regHTXnTB[1] = get_minmag_filter( texObj->MinFilter,
- texObj->MagFilter );
- vmesa->regHTXnMPMD[1] &= ~(HC_HTXnMPMD_SMASK | HC_HTXnMPMD_TMASK);
- vmesa->regHTXnMPMD[1] |= get_wrap_mode( texObj->WrapS,
- texObj->WrapT );
-
- vmesa->regHTXnTB[1] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
- if (texObj->Image[0][texObj->BaseLevel]->Border > 0) {
- vmesa->regHTXnTB[1] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
- vmesa->regHTXnTBC[1] =
- PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor[0]),
- FLOAT_TO_UBYTE(texObj->BorderColor[1]),
- FLOAT_TO_UBYTE(texObj->BorderColor[2]));
- vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->BorderColor[3]);
- }
-
-
- if (texUnit1->LodBias != 0.0f) {
- GLuint b = viaComputeLodBias(texUnit1->LodBias);
- vmesa->regHTXnTB[1] &= ~HC_HTXnFLDs_MASK;
- vmesa->regHTXnTB[1] |= HC_HTXnFLDs_ConstLOD;
- vmesa->regHTXnCLOD[1] = (b&0x1f) | (((~b)&0x1f)<<10); /* FIXME */
- }
-
- if (!viaTexCombineState( vmesa, texUnit1->_CurrentCombine, 1 )) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "viaTexCombineState failed for unit 1\n");
- return GL_FALSE;
- }
- }
- }
- else {
- vmesa->regEnable &= ~(HC_HenTXMP_MASK | HC_HenTXCH_MASK |
- HC_HenTXPP_MASK);
- }
-
- return GL_TRUE;
-}
-
-static void viaChooseColorState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLenum s = ctx->Color.BlendSrcRGB;
- GLenum d = ctx->Color.BlendDstRGB;
-
- /* The HW's blending equation is:
- * (Ca * FCa + Cbias + Cb * FCb) << Cshift
- */
-
- if (ctx->Color.BlendEnabled) {
- vmesa->regEnable |= HC_HenABL_MASK;
- /* Ca -- always from source color.
- */
- vmesa->regHABLCsat = HC_HABLCsat_MASK | HC_HABLCa_OPC | HC_HABLCa_Csrc;
- /* Aa -- always from source alpha.
- */
- vmesa->regHABLAsat = HC_HABLAsat_MASK | HC_HABLAa_OPA | HC_HABLAa_Asrc;
- /* FCa -- depend on following condition.
- * FAa -- depend on following condition.
- */
- switch (s) {
- case GL_ZERO:
- /* (0, 0, 0, 0)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa;
- vmesa->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_HABLFRA;
- vmesa->regHABLRFCa = 0x0;
- vmesa->regHABLRAa = 0x0;
- break;
- case GL_ONE:
- /* (1, 1, 1, 1)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_HABLRCa;
- vmesa->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA;
- vmesa->regHABLRFCa = 0x0;
- vmesa->regHABLRAa = 0x0;
- break;
- case GL_SRC_COLOR:
- /* (Rs, Gs, Bs, As)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Csrc;
- vmesa->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Asrc;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- /* (1, 1, 1, 1) - (Rs, Gs, Bs, As)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Csrc;
- vmesa->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Asrc;
- break;
- case GL_DST_COLOR:
- /* (Rd, Gd, Bd, Ad)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Cdst;
- vmesa->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Adst;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- /* (1, 1, 1, 1) - (Rd, Gd, Bd, Ad)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Cdst;
- vmesa->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Adst;
- break;
- case GL_SRC_ALPHA:
- /* (As, As, As, As)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Asrc;
- vmesa->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Asrc;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- /* (1, 1, 1, 1) - (As, As, As, As)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Asrc;
- vmesa->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Asrc;
- break;
- case GL_DST_ALPHA:
- {
- if (vmesa->viaScreen->bitsPerPixel == 16) {
- /* (1, 1, 1, 1)
- */
- vmesa->regHABLCsat |= (HC_HABLFCa_InvOPC |
- HC_HABLFCa_HABLRCa);
- vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA |
- HC_HABLFAa_HABLFRA);
- vmesa->regHABLRFCa = 0x0;
- vmesa->regHABLRAa = 0x0;
- }
- else {
- /* (Ad, Ad, Ad, Ad)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Adst;
- vmesa->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Adst;
- }
- }
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- {
- if (vmesa->viaScreen->bitsPerPixel == 16) {
- /* (1, 1, 1, 1) - (1, 1, 1, 1) = (0, 0, 0, 0)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa;
- vmesa->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_HABLFRA;
- vmesa->regHABLRFCa = 0x0;
- vmesa->regHABLRAa = 0x0;
- }
- else {
- /* (1, 1, 1, 1) - (Ad, Ad, Ad, Ad)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Adst;
- vmesa->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Adst;
- }
- }
- break;
- case GL_SRC_ALPHA_SATURATE:
- {
- if (vmesa->viaScreen->bitsPerPixel == 16) {
- /* (f, f, f, 1), f = min(As, 1 - Ad) = min(As, 1 - 1) = 0
- * So (f, f, f, 1) = (0, 0, 0, 1)
- */
- vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa;
- vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA |
- HC_HABLFAa_HABLFRA);
- vmesa->regHABLRFCa = 0x0;
- vmesa->regHABLRAa = 0x0;
- }
- else {
- /* (f, f, f, 1), f = min(As, 1 - Ad)
- */
- vmesa->regHABLCsat |= (HC_HABLFCa_OPC |
- HC_HABLFCa_mimAsrcInvAdst);
- vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA |
- HC_HABLFAa_HABLFRA);
- vmesa->regHABLRFCa = 0x0;
- vmesa->regHABLRAa = 0x0;
- }
- }
- break;
- }
-
- /* Op is add.
- */
-
- /* bias is 0.
- */
- vmesa->regHABLCsat |= HC_HABLCbias_HABLRCbias;
- vmesa->regHABLAsat |= HC_HABLAbias_HABLRAbias;
-
- /* Cb -- always from destination color.
- */
- vmesa->regHABLCop = HC_HABLCb_OPC | HC_HABLCb_Cdst;
- /* Ab -- always from destination alpha.
- */
- vmesa->regHABLAop = HC_HABLAb_OPA | HC_HABLAb_Adst;
- /* FCb -- depend on following condition.
- */
- switch (d) {
- case GL_ZERO:
- /* (0, 0, 0, 0)
- */
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA;
- vmesa->regHABLRFCb = 0x0;
- vmesa->regHABLRAb = 0x0;
- break;
- case GL_ONE:
- /* (1, 1, 1, 1)
- */
- vmesa->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_HABLRCb;
- vmesa->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_HABLFRA;
- vmesa->regHABLRFCb = 0x0;
- vmesa->regHABLRAb = 0x0;
- break;
- case GL_SRC_COLOR:
- /* (Rs, Gs, Bs, As)
- */
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Csrc;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Asrc;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- /* (1, 1, 1, 1) - (Rs, Gs, Bs, As)
- */
- vmesa->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Csrc;
- vmesa->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Asrc;
- break;
- case GL_DST_COLOR:
- /* (Rd, Gd, Bd, Ad)
- */
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Cdst;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Adst;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- /* (1, 1, 1, 1) - (Rd, Gd, Bd, Ad)
- */
- vmesa->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Cdst;
- vmesa->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Adst;
- break;
- case GL_SRC_ALPHA:
- /* (As, As, As, As)
- */
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Asrc;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Asrc;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- /* (1, 1, 1, 1) - (As, As, As, As)
- */
- vmesa->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Asrc;
- vmesa->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Asrc;
- break;
- case GL_DST_ALPHA:
- {
- if (vmesa->viaScreen->bitsPerPixel == 16) {
- /* (1, 1, 1, 1)
- */
- vmesa->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_HABLRCb;
- vmesa->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_HABLFRA;
- vmesa->regHABLRFCb = 0x0;
- vmesa->regHABLRAb = 0x0;
- }
- else {
- /* (Ad, Ad, Ad, Ad)
- */
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Adst;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Adst;
- }
- }
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- {
- if (vmesa->viaScreen->bitsPerPixel == 16) {
- /* (1, 1, 1, 1) - (1, 1, 1, 1) = (0, 0, 0, 0)
- */
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA;
- vmesa->regHABLRFCb = 0x0;
- vmesa->regHABLRAb = 0x0;
- }
- else {
- /* (1, 1, 1, 1) - (Ad, Ad, Ad, Ad)
- */
- vmesa->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Adst;
- vmesa->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Adst;
- }
- }
- break;
- default:
- vmesa->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb;
- vmesa->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA;
- vmesa->regHABLRFCb = 0x0;
- vmesa->regHABLRAb = 0x0;
- break;
- }
-
- if (vmesa->viaScreen->bitsPerPixel <= 16)
- vmesa->regEnable &= ~HC_HenDT_MASK;
-
- }
- else {
- vmesa->regEnable &= (~HC_HenABL_MASK);
- }
-
- if (ctx->Color.AlphaEnabled) {
- vmesa->regEnable |= HC_HenAT_MASK;
- vmesa->regHATMD = FLOAT_TO_UBYTE(ctx->Color.AlphaRef) |
- ((ctx->Color.AlphaFunc - GL_NEVER) << 8);
- }
- else {
- vmesa->regEnable &= (~HC_HenAT_MASK);
- }
-
- if (ctx->Color.DitherFlag && (vmesa->viaScreen->bitsPerPixel < 32)) {
- if (ctx->Color.BlendEnabled) {
- vmesa->regEnable &= ~HC_HenDT_MASK;
- }
- else {
- vmesa->regEnable |= HC_HenDT_MASK;
- }
- }
-
-
- vmesa->regEnable &= ~HC_HenDT_MASK;
-
- if (ctx->Color.ColorLogicOpEnabled)
- vmesa->regHROP = ROP[ctx->Color.LogicOp & 0xF];
- else
- vmesa->regHROP = HC_HROP_P;
-
- vmesa->regHFBBMSKL = PACK_COLOR_888(ctx->Color.ColorMask[0],
- ctx->Color.ColorMask[1],
- ctx->Color.ColorMask[2]);
- vmesa->regHROP |= ctx->Color.ColorMask[3];
-
- if (ctx->Color.ColorMask[3])
- vmesa->regEnable |= HC_HenAW_MASK;
- else
- vmesa->regEnable &= ~HC_HenAW_MASK;
-}
-
-static void viaChooseFogState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (ctx->Fog.Enabled) {
- GLubyte r, g, b, a;
-
- vmesa->regEnable |= HC_HenFOG_MASK;
-
- /* Use fog equation 0 (OpenGL's default) & local fog.
- */
- vmesa->regHFogLF = 0x0;
-
- r = (GLubyte)(ctx->Fog.Color[0] * 255.0F);
- g = (GLubyte)(ctx->Fog.Color[1] * 255.0F);
- b = (GLubyte)(ctx->Fog.Color[2] * 255.0F);
- a = (GLubyte)(ctx->Fog.Color[3] * 255.0F);
- vmesa->regHFogCL = (r << 16) | (g << 8) | b;
- vmesa->regHFogCH = a;
- }
- else {
- vmesa->regEnable &= ~HC_HenFOG_MASK;
- }
-}
-
-static void viaChooseDepthState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- if (ctx->Depth.Test) {
- vmesa->regEnable |= HC_HenZT_MASK;
- if (ctx->Depth.Mask)
- vmesa->regEnable |= HC_HenZW_MASK;
- else
- vmesa->regEnable &= (~HC_HenZW_MASK);
- vmesa->regHZWTMD = (ctx->Depth.Func - GL_NEVER) << 16;
-
- }
- else {
- vmesa->regEnable &= ~HC_HenZT_MASK;
-
- /*=* [DBG] racer : can't display cars in car selection menu *=*/
- /*if (ctx->Depth.Mask)
- vmesa->regEnable |= HC_HenZW_MASK;
- else
- vmesa->regEnable &= (~HC_HenZW_MASK);*/
- vmesa->regEnable &= (~HC_HenZW_MASK);
- }
-}
-
-static void viaChooseLineState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (ctx->Line.StippleFlag) {
- vmesa->regEnable |= HC_HenLP_MASK;
- vmesa->regHLP = ctx->Line.StipplePattern;
- vmesa->regHLPRF = ctx->Line.StippleFactor;
- }
- else {
- vmesa->regEnable &= ~HC_HenLP_MASK;
- }
-}
-
-static void viaChoosePolygonState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
-#if 0
- /* Polygon stipple is broken - see via_state.c
- */
- if (ctx->Polygon.StippleFlag) {
- vmesa->regEnable |= HC_HenSP_MASK;
- }
- else {
- vmesa->regEnable &= ~HC_HenSP_MASK;
- }
-#else
- FALLBACK(vmesa, VIA_FALLBACK_POLY_STIPPLE,
- ctx->Polygon.StippleFlag);
-#endif
-
- if (ctx->Polygon.CullFlag) {
- vmesa->regEnable |= HC_HenFBCull_MASK;
- }
- else {
- vmesa->regEnable &= ~HC_HenFBCull_MASK;
- }
-}
-
-static void viaChooseStencilState(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (ctx->Stencil.Enabled) {
- GLuint temp;
-
- vmesa->regEnable |= HC_HenST_MASK;
- temp = (ctx->Stencil.Ref[0] & 0xFF) << HC_HSTREF_SHIFT;
- temp |= 0xFF << HC_HSTOPMSK_SHIFT;
- temp |= (ctx->Stencil.ValueMask[0] & 0xFF);
- vmesa->regHSTREF = temp;
-
- temp = (ctx->Stencil.Function[0] - GL_NEVER) << 16;
-
- switch (ctx->Stencil.FailFunc[0]) {
- case GL_KEEP:
- temp |= HC_HSTOPSF_KEEP;
- break;
- case GL_ZERO:
- temp |= HC_HSTOPSF_ZERO;
- break;
- case GL_REPLACE:
- temp |= HC_HSTOPSF_REPLACE;
- break;
- case GL_INVERT:
- temp |= HC_HSTOPSF_INVERT;
- break;
- case GL_INCR:
- temp |= HC_HSTOPSF_INCR;
- break;
- case GL_DECR:
- temp |= HC_HSTOPSF_DECR;
- break;
- }
-
- switch (ctx->Stencil.ZFailFunc[0]) {
- case GL_KEEP:
- temp |= HC_HSTOPSPZF_KEEP;
- break;
- case GL_ZERO:
- temp |= HC_HSTOPSPZF_ZERO;
- break;
- case GL_REPLACE:
- temp |= HC_HSTOPSPZF_REPLACE;
- break;
- case GL_INVERT:
- temp |= HC_HSTOPSPZF_INVERT;
- break;
- case GL_INCR:
- temp |= HC_HSTOPSPZF_INCR;
- break;
- case GL_DECR:
- temp |= HC_HSTOPSPZF_DECR;
- break;
- }
-
- switch (ctx->Stencil.ZPassFunc[0]) {
- case GL_KEEP:
- temp |= HC_HSTOPSPZP_KEEP;
- break;
- case GL_ZERO:
- temp |= HC_HSTOPSPZP_ZERO;
- break;
- case GL_REPLACE:
- temp |= HC_HSTOPSPZP_REPLACE;
- break;
- case GL_INVERT:
- temp |= HC_HSTOPSPZP_INVERT;
- break;
- case GL_INCR:
- temp |= HC_HSTOPSPZP_INCR;
- break;
- case GL_DECR:
- temp |= HC_HSTOPSPZP_DECR;
- break;
- }
- vmesa->regHSTMD = temp;
- }
- else {
- vmesa->regEnable &= ~HC_HenST_MASK;
- }
-}
-
-
-
-static void viaChooseTriangle(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (ctx->Polygon.CullFlag == GL_TRUE) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_FRONT:
- if (ctx->Polygon.FrontFace == GL_CCW)
- vmesa->regCmdB |= HC_HBFace_MASK;
- else
- vmesa->regCmdB &= ~HC_HBFace_MASK;
- break;
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CW)
- vmesa->regCmdB |= HC_HBFace_MASK;
- else
- vmesa->regCmdB &= ~HC_HBFace_MASK;
- break;
- case GL_FRONT_AND_BACK:
- return;
- }
- }
-}
-
-void viaValidateState( GLcontext *ctx )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (vmesa->newState & _NEW_TEXTURE) {
- GLboolean ok = (viaChooseTextureState(ctx) &&
- viaUpdateTextureState(ctx));
-
- FALLBACK(vmesa, VIA_FALLBACK_TEXTURE, !ok);
- }
-
- if (vmesa->newState & _NEW_COLOR)
- viaChooseColorState(ctx);
-
- if (vmesa->newState & _NEW_DEPTH)
- viaChooseDepthState(ctx);
-
- if (vmesa->newState & _NEW_FOG)
- viaChooseFogState(ctx);
-
- if (vmesa->newState & _NEW_LINE)
- viaChooseLineState(ctx);
-
- if (vmesa->newState & (_NEW_POLYGON | _NEW_POLYGONSTIPPLE)) {
- viaChoosePolygonState(ctx);
- viaChooseTriangle(ctx);
- }
-
- if ((vmesa->newState & _NEW_STENCIL) && vmesa->have_hw_stencil)
- viaChooseStencilState(ctx);
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
- vmesa->regEnable |= HC_HenCS_MASK;
- else
- vmesa->regEnable &= ~HC_HenCS_MASK;
-
- if (ctx->Point.SmoothFlag ||
- ctx->Line.SmoothFlag ||
- ctx->Polygon.SmoothFlag)
- vmesa->regEnable |= HC_HenAA_MASK;
- else
- vmesa->regEnable &= ~HC_HenAA_MASK;
-
- vmesa->newEmitState |= vmesa->newState;
- vmesa->newState = 0;
-}
-
-static void viaInvalidateState(GLcontext *ctx, GLuint newState)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- VIA_FINISH_PRIM( vmesa );
- vmesa->newState |= newState;
-
- _swrast_InvalidateState(ctx, newState);
- _swsetup_InvalidateState(ctx, newState);
- _ac_InvalidateState(ctx, newState);
- _tnl_InvalidateState(ctx, newState);
-}
-
-void viaInitStateFuncs(GLcontext *ctx)
-{
- /* Callbacks for internal Mesa events.
- */
- ctx->Driver.UpdateState = viaInvalidateState;
-
- /* API callbacks
- */
- ctx->Driver.BlendEquationSeparate = viaBlendEquationSeparate;
- ctx->Driver.BlendFuncSeparate = viaBlendFuncSeparate;
- ctx->Driver.ClearColor = viaClearColor;
- ctx->Driver.ColorMask = viaColorMask;
- ctx->Driver.DrawBuffer = viaDrawBuffer;
- ctx->Driver.RenderMode = viaRenderMode;
- ctx->Driver.Scissor = viaScissor;
- ctx->Driver.DepthRange = viaDepthRange;
- ctx->Driver.Viewport = viaViewport;
- ctx->Driver.Enable = viaEnable;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.ResizeBuffers = viaReAllocateBuffers;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.h
deleted file mode 100644
index 065ec57d3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_state.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIA_STATE_H
-#define _VIA_STATE_H
-
-#include "via_context.h"
-
-extern void viaInitState(GLcontext *ctx);
-extern void viaInitStateFuncs(GLcontext *ctx);
-extern void viaCalcViewport(GLcontext *ctx);
-extern void viaValidateState(GLcontext *ctx);
-extern void viaEmitState(struct via_context *vmesa);
-
-extern void viaFallback(struct via_context *vmesa, GLuint bit, GLboolean mode);
-#define FALLBACK(vmesa, bit, mode) viaFallback(vmesa, bit, mode)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.c
deleted file mode 100644
index c308339f2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.c
+++ /dev/null
@@ -1,970 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "colortab.h"
-#include "convolve.h"
-#include "context.h"
-#include "simple_list.h"
-#include "texcompress.h"
-#include "texformat.h"
-#include "texobj.h"
-#include "texstore.h"
-
-#include "mm.h"
-#include "via_context.h"
-#include "via_fb.h"
-#include "via_tex.h"
-#include "via_state.h"
-#include "via_ioctl.h"
-#include "via_3d_reg.h"
-
-static const struct gl_texture_format *
-viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
- GLenum format, GLenum type )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- const GLboolean do32bpt = ( vmesa->viaScreen->bitsPerPixel == 32
-/* && vmesa->viaScreen->textureSize > 4*1024*1024 */
- );
-
-
- switch ( internalFormat ) {
- case 4:
- case GL_RGBA:
- case GL_COMPRESSED_RGBA:
- if ( format == GL_BGRA ) {
- if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_BYTE ) {
- return &_mesa_texformat_argb8888;
- }
- else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
- return &_mesa_texformat_argb4444;
- }
- else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
- }
- }
- else if ( type == GL_UNSIGNED_BYTE ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ) {
- return &_mesa_texformat_argb8888;
- }
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
-
- case 3:
- case GL_RGB:
- case GL_COMPRESSED_RGB:
- if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
- return &_mesa_texformat_rgb565;
- }
- else if ( type == GL_UNSIGNED_BYTE ) {
- return &_mesa_texformat_argb8888;
- }
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
-
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return &_mesa_texformat_argb8888;
-
- case GL_RGBA4:
- case GL_RGBA2:
- return &_mesa_texformat_argb4444;
-
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
-
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return &_mesa_texformat_argb8888;
-
- case GL_RGB5:
- case GL_RGB4:
- case GL_R3_G3_B2:
- return &_mesa_texformat_rgb565;
-
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_a8;
-
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_l8;
-
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return &_mesa_texformat_al88;
-
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_i8;
-
- case GL_YCBCR_MESA:
- if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
- type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
- else
- return &_mesa_texformat_ycbcr_rev;
-
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return &_mesa_texformat_rgb_fxt1;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return &_mesa_texformat_rgba_fxt1;
-
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
-
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
-
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
-
- default:
- fprintf(stderr, "unexpected texture format %s in %s\n",
- _mesa_lookup_enum_by_nr(internalFormat),
- __FUNCTION__);
- return NULL;
- }
-
- return NULL; /* never get here */
-}
-
-static int logbase2(int n)
-{
- GLint i = 1;
- GLint log2 = 0;
-
- while (n > i) {
- i *= 2;
- log2++;
- }
-
- return log2;
-}
-
-static const char *get_memtype_name( GLint memType )
-{
- static const char *names[] = {
- "VIA_MEM_VIDEO",
- "VIA_MEM_AGP",
- "VIA_MEM_SYSTEM",
- "VIA_MEM_MIXED",
- "VIA_MEM_UNKNOWN"
- };
-
- return names[memType];
-}
-
-
-static GLboolean viaMoveTexBuffers( struct via_context *vmesa,
- struct via_tex_buffer **buffers,
- GLuint nr,
- GLint newMemType )
-{
- struct via_tex_buffer *newTexBuf[VIA_MAX_TEXLEVELS];
- GLint i;
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s to %s\n",
- __FUNCTION__,
- get_memtype_name(newMemType));
-
- memset(newTexBuf, 0, sizeof(newTexBuf));
-
- /* First do all the allocations (or fail):
- */
- for (i = 0; i < nr; i++) {
- if (buffers[i]->memType != newMemType) {
-
- /* Don't allow uploads in a thrash state. Should try and
- * catch this earlier.
- */
- if (vmesa->thrashing && newMemType != VIA_MEM_SYSTEM)
- goto cleanup;
-
- newTexBuf[i] = via_alloc_texture(vmesa,
- buffers[i]->size,
- newMemType);
- if (!newTexBuf[i])
- goto cleanup;
- }
- }
-
-
- /* Now copy all the image data and free the old texture memory.
- */
- for (i = 0; i < nr; i++) {
- if (newTexBuf[i]) {
- memcpy(newTexBuf[i]->bufAddr,
- buffers[i]->bufAddr,
- buffers[i]->size);
-
- newTexBuf[i]->image = buffers[i]->image;
- newTexBuf[i]->image->texMem = newTexBuf[i];
- newTexBuf[i]->image->image.Data = newTexBuf[i]->bufAddr;
- via_free_texture(vmesa, buffers[i]);
- }
- }
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s - success\n", __FUNCTION__);
-
- return GL_TRUE;
-
- cleanup:
- /* Release any allocations made prior to failure:
- */
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s - failed\n", __FUNCTION__);
-
- for (i = 0; i < nr; i++) {
- if (newTexBuf[i]) {
- via_free_texture(vmesa, newTexBuf[i]);
- }
- }
-
- return GL_FALSE;
-}
-
-
-static GLboolean viaMoveTexObject( struct via_context *vmesa,
- struct via_texture_object *viaObj,
- GLint newMemType )
-{
- struct via_texture_image **viaImage =
- (struct via_texture_image **)&viaObj->obj.Image[0][0];
- struct via_tex_buffer *buffers[VIA_MAX_TEXLEVELS];
- GLuint i, nr = 0;
-
- for (i = viaObj->firstLevel; i <= viaObj->lastLevel; i++)
- buffers[nr++] = viaImage[i]->texMem;
-
- if (viaMoveTexBuffers( vmesa, &buffers[0], nr, newMemType )) {
- viaObj->memType = newMemType;
- return GL_TRUE;
- }
-
- return GL_FALSE;
-}
-
-
-
-static GLboolean viaSwapInTexObject( struct via_context *vmesa,
- struct via_texture_object *viaObj )
-{
- const struct via_texture_image *baseImage =
- (struct via_texture_image *)viaObj->obj.Image[0][viaObj->obj.BaseLevel];
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (baseImage->texMem->memType != VIA_MEM_SYSTEM)
- return viaMoveTexObject( vmesa, viaObj, baseImage->texMem->memType );
-
- return (viaMoveTexObject( vmesa, viaObj, VIA_MEM_AGP ) ||
- viaMoveTexObject( vmesa, viaObj, VIA_MEM_VIDEO ));
-}
-
-
-/* This seems crude, but it asks a fairly pertinent question and gives
- * an accurate answer:
- */
-static GLboolean viaIsTexMemLow( struct via_context *vmesa,
- GLuint heap )
-{
- struct via_tex_buffer *buf = via_alloc_texture(vmesa, 512 * 1024, heap );
- if (!buf)
- return GL_TRUE;
-
- via_free_texture(vmesa, buf);
- return GL_FALSE;
-}
-
-
-/* Speculatively move texture images which haven't been used in a
- * while back to system memory.
- *
- * TODO: only do this when texture memory is low.
- *
- * TODO: use dma.
- *
- * TODO: keep the fb/agp version hanging around and use the local
- * version as backing store, so re-upload might be avoided.
- *
- * TODO: do this properly in the kernel...
- */
-GLboolean viaSwapOutWork( struct via_context *vmesa )
-{
- struct via_tex_buffer *s, *tmp;
- GLuint done = 0;
- GLuint heap, target;
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s VID %d AGP %d SYS %d\n", __FUNCTION__,
- vmesa->total_alloc[VIA_MEM_VIDEO],
- vmesa->total_alloc[VIA_MEM_AGP],
- vmesa->total_alloc[VIA_MEM_SYSTEM]);
-
-
- for (heap = VIA_MEM_VIDEO; heap <= VIA_MEM_AGP; heap++) {
- GLuint nr = 0, sz = 0;
-
- if (vmesa->thrashing) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Heap %d: trash flag\n", heap);
- target = 1*1024*1024;
- }
- else if (viaIsTexMemLow(vmesa, heap)) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Heap %d: low memory\n", heap);
- target = 64*1024;
- }
- else {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Heap %d: nothing to do\n", heap);
- continue;
- }
-
- foreach_s( s, tmp, &vmesa->tex_image_list[heap] ) {
- if (s->lastUsed < vmesa->lastSwap[1]) {
- struct via_texture_object *viaObj =
- (struct via_texture_object *) s->image->image.TexObject;
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr,
- "back copy tex sz %d, lastUsed %d lastSwap %d\n",
- s->size, s->lastUsed, vmesa->lastSwap[1]);
-
- if (viaMoveTexBuffers( vmesa, &s, 1, VIA_MEM_SYSTEM )) {
- viaObj->memType = VIA_MEM_MIXED;
- done += s->size;
- }
- else {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Failed to back copy texture!\n");
- sz += s->size;
- }
- }
- else {
- nr ++;
- sz += s->size;
- }
-
- if (done > target) {
- vmesa->thrashing = GL_FALSE; /* might not get set otherwise? */
- return GL_TRUE;
- }
- }
-
- assert(sz == vmesa->total_alloc[heap]);
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "Heap %d: nr %d tot sz %d\n", heap, nr, sz);
- }
-
-
- return done != 0;
-}
-
-
-
-/* Basically, just collect the image dimensions and addresses for each
- * image and update the texture object state accordingly.
- */
-static GLboolean viaSetTexImages(GLcontext *ctx,
- struct gl_texture_object *texObj)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- struct via_texture_object *viaObj = (struct via_texture_object *)texObj;
- const struct via_texture_image *baseImage =
- (struct via_texture_image *)texObj->Image[0][texObj->BaseLevel];
- GLint firstLevel, lastLevel, numLevels;
- GLuint texFormat;
- GLint w, h, p;
- GLint i, j = 0, k = 0, l = 0, m = 0;
- GLuint texBase;
- GLuint basH = 0;
- GLuint widthExp = 0;
- GLuint heightExp = 0;
-
- switch (baseImage->image.TexFormat->MesaFormat) {
- case MESA_FORMAT_ARGB8888:
- texFormat = HC_HTXnFM_ARGB8888;
- break;
- case MESA_FORMAT_ARGB4444:
- texFormat = HC_HTXnFM_ARGB4444;
- break;
- case MESA_FORMAT_RGB565:
- texFormat = HC_HTXnFM_RGB565;
- break;
- case MESA_FORMAT_ARGB1555:
- texFormat = HC_HTXnFM_ARGB1555;
- break;
- case MESA_FORMAT_RGB888:
- texFormat = HC_HTXnFM_ARGB0888;
- break;
- case MESA_FORMAT_L8:
- texFormat = HC_HTXnFM_L8;
- break;
- case MESA_FORMAT_I8:
- texFormat = HC_HTXnFM_T8;
- break;
- case MESA_FORMAT_CI8:
- texFormat = HC_HTXnFM_Index8;
- break;
- case MESA_FORMAT_AL88:
- texFormat = HC_HTXnFM_AL88;
- break;
- case MESA_FORMAT_A8:
- texFormat = HC_HTXnFM_A8;
- break;
- default:
- _mesa_problem(vmesa->glCtx, "Bad texture format in viaSetTexImages");
- return GL_FALSE;
- }
-
- /* Compute which mipmap levels we really want to send 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.
- * Yes, this looks overly complicated, but it's all needed.
- */
- if (texObj->MinFilter == GL_LINEAR || texObj->MinFilter == GL_NEAREST) {
- firstLevel = lastLevel = texObj->BaseLevel;
- }
- else {
- firstLevel = texObj->BaseLevel + (GLint)(texObj->MinLod + 0.5);
- firstLevel = MAX2(firstLevel, texObj->BaseLevel);
- lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5);
- lastLevel = MAX2(lastLevel, texObj->BaseLevel);
- lastLevel = MIN2(lastLevel, texObj->BaseLevel + baseImage->image.MaxLog2);
- lastLevel = MIN2(lastLevel, texObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
- }
-
- numLevels = lastLevel - firstLevel + 1;
-
- /* save these values, check if they effect the residency of the
- * texture:
- */
- if (viaObj->firstLevel != firstLevel ||
- viaObj->lastLevel != lastLevel) {
- viaObj->firstLevel = firstLevel;
- viaObj->lastLevel = lastLevel;
- viaObj->memType = VIA_MEM_MIXED;
- }
-
- if (VIA_DEBUG & DEBUG_TEXTURE & 0)
- fprintf(stderr, "%s, current memType: %s\n",
- __FUNCTION__,
- get_memtype_name(viaObj->memType));
-
-
- if (viaObj->memType == VIA_MEM_MIXED ||
- viaObj->memType == VIA_MEM_SYSTEM) {
- if (!viaSwapInTexObject(vmesa, viaObj)) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- if (!vmesa->thrashing)
- fprintf(stderr, "Thrashing flag set for frame %d\n",
- vmesa->swap_count);
- vmesa->thrashing = GL_TRUE;
- return GL_FALSE;
- }
- }
-
- if (viaObj->memType == VIA_MEM_AGP)
- viaObj->regTexFM = (HC_SubA_HTXnFM << 24) | HC_HTXnLoc_AGP | texFormat;
- else
- viaObj->regTexFM = (HC_SubA_HTXnFM << 24) | HC_HTXnLoc_Local | texFormat;
-
-
- for (i = 0; i < numLevels; i++) {
- struct via_texture_image *viaImage =
- (struct via_texture_image *)texObj->Image[0][firstLevel + i];
-
- w = viaImage->image.WidthLog2;
- h = viaImage->image.HeightLog2;
- p = viaImage->pitchLog2;
-
- assert(viaImage->texMem->memType == viaObj->memType);
-
- texBase = viaImage->texMem->texBase;
- if (!texBase) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: no texBase[%d]\n", __FUNCTION__, i);
- return GL_FALSE;
- }
-
- /* Image has to remain resident until the coming fence is retired.
- */
- move_to_head( &vmesa->tex_image_list[viaImage->texMem->memType],
- viaImage->texMem );
- viaImage->texMem->lastUsed = vmesa->lastBreadcrumbWrite;
-
-
- viaObj->regTexBaseAndPitch[i].baseL =
- ((HC_SubA_HTXnL0BasL + i) << 24) | (texBase & 0xFFFFFF);
-
- viaObj->regTexBaseAndPitch[i].pitchLog2 =
- ((HC_SubA_HTXnL0Pit + i) << 24) | (p << 20);
-
-
- /* The base high bytes for each 3 levels are packed
- * together into one register:
- */
- j = i / 3;
- k = 3 - (i % 3);
- basH |= ((texBase & 0xFF000000) >> (k << 3));
- if (k == 1) {
- viaObj->regTexBaseH[j] = ((j + HC_SubA_HTXnL012BasH) << 24) | basH;
- basH = 0;
- }
-
- /* Likewise, sets of 6 log2width and log2height values are
- * packed into individual registers:
- */
- l = i / 6;
- m = i % 6;
- widthExp |= (((GLuint)w & 0xF) << (m << 2));
- heightExp |= (((GLuint)h & 0xF) << (m << 2));
- if (m == 5) {
- viaObj->regTexWidthLog2[l] =
- (l + HC_SubA_HTXnL0_5WE) << 24 | widthExp;
- viaObj->regTexHeightLog2[l] =
- (l + HC_SubA_HTXnL0_5HE) << 24 | heightExp;
- widthExp = 0;
- heightExp = 0;
- }
- if (w) w--;
- if (h) h--;
- if (p) p--;
- }
-
- if (k != 1) {
- viaObj->regTexBaseH[j] = ((j + HC_SubA_HTXnL012BasH) << 24) | basH;
- }
- if (m != 5) {
- viaObj->regTexWidthLog2[l] = (l + HC_SubA_HTXnL0_5WE) << 24 | widthExp;
- viaObj->regTexHeightLog2[l] = (l + HC_SubA_HTXnL0_5HE) << 24 | heightExp;
- }
-
- return GL_TRUE;
-}
-
-
-GLboolean viaUpdateTextureState( GLcontext *ctx )
-{
- struct gl_texture_unit *texUnit = ctx->Texture.Unit;
- GLuint i;
-
- for (i = 0; i < 2; i++) {
- if (texUnit[i]._ReallyEnabled == TEXTURE_2D_BIT ||
- texUnit[i]._ReallyEnabled == TEXTURE_1D_BIT) {
-
- if (!viaSetTexImages(ctx, texUnit[i]._Current))
- return GL_FALSE;
- }
- else if (texUnit[i]._ReallyEnabled) {
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-
-
-
-
-
-
-
-static void viaTexImage(GLcontext *ctx,
- GLint dims,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLint postConvWidth = width;
- GLint postConvHeight = height;
- GLint texelBytes, sizeInBytes;
- struct via_texture_object *viaObj = (struct via_texture_object *)texObj;
- struct via_texture_image *viaImage = (struct via_texture_image *)texImage;
- int heaps[3], nheaps, i;
-
- if (!is_empty_list(&vmesa->freed_tex_buffers)) {
- viaCheckBreadcrumb(vmesa, 0);
- via_release_pending_textures(vmesa);
- }
-
- if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) {
- _mesa_adjust_image_for_convolution(ctx, dims, &postConvWidth,
- &postConvHeight);
- }
-
- /* choose the texture format */
- texImage->TexFormat = viaChooseTexFormat(ctx, internalFormat,
- format, type);
-
- assert(texImage->TexFormat);
-
- if (dims == 1) {
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df;
- }
- else {
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df;
- }
- texelBytes = texImage->TexFormat->TexelBytes;
-
-
- /* Minimum pitch of 32 bytes */
- if (postConvWidth * texelBytes < 32) {
- postConvWidth = 32 / texelBytes;
- texImage->RowStride = postConvWidth;
- }
-
- assert(texImage->RowStride == postConvWidth);
- viaImage->pitchLog2 = logbase2(postConvWidth * texelBytes);
-
- /* allocate memory */
- if (texImage->IsCompressed)
- sizeInBytes = texImage->CompressedSize;
- else
- sizeInBytes = postConvWidth * postConvHeight * texelBytes;
-
-
- /* Attempt to allocate texture memory directly, otherwise use main
- * memory and this texture will always be a fallback. FIXME!
- *
- * TODO: make room in agp if this fails.
- * TODO: use fb ram for textures as well.
- */
-
-
- switch (viaObj->memType) {
- case VIA_MEM_UNKNOWN:
- heaps[0] = VIA_MEM_AGP;
- heaps[1] = VIA_MEM_VIDEO;
- heaps[2] = VIA_MEM_SYSTEM;
- nheaps = 3;
- break;
- case VIA_MEM_AGP:
- case VIA_MEM_VIDEO:
- heaps[0] = viaObj->memType;
- heaps[1] = VIA_MEM_SYSTEM;
- nheaps = 2;
- break;
- case VIA_MEM_MIXED:
- case VIA_MEM_SYSTEM:
- default:
- heaps[0] = VIA_MEM_SYSTEM;
- nheaps = 1;
- break;
- }
-
- for (i = 0; i < nheaps && !viaImage->texMem; i++) {
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "try %s (obj %s)\n", get_memtype_name(heaps[i]),
- get_memtype_name(viaObj->memType));
- viaImage->texMem = via_alloc_texture(vmesa, sizeInBytes, heaps[i]);
- }
-
- if (!viaImage->texMem) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
- return;
- }
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "upload %d bytes to %s\n", sizeInBytes,
- get_memtype_name(viaImage->texMem->memType));
-
- viaImage->texMem->image = viaImage;
- texImage->Data = viaImage->texMem->bufAddr;
-
- if (viaObj->memType == VIA_MEM_UNKNOWN)
- viaObj->memType = viaImage->texMem->memType;
- else if (viaObj->memType != viaImage->texMem->memType)
- viaObj->memType = VIA_MEM_MIXED;
-
- if (VIA_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s, obj %s, image : %s\n",
- __FUNCTION__,
- get_memtype_name(viaObj->memType),
- get_memtype_name(viaImage->texMem->memType));
-
- vmesa->clearTexCache = 1;
-
- pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1,
- format, type,
- pixels, packing, "glTexImage");
- if (!pixels) {
- /* Note: we check for a NULL image pointer here, _after_ we allocated
- * memory for the texture. That's what the GL spec calls for.
- */
- return;
- }
- else {
- GLint dstRowStride, dstImageStride = 0;
- GLboolean success;
- if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,width);
- }
- else {
- dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes;
- }
- ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, dims, texImage->Format,
- texImage->TexFormat,
- texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride, dstImageStride,
- width, height, 1,
- format, type, pixels, packing);
- if (!success) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
- }
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, target,
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
- texObj);
- }
-
- _mesa_unmap_teximage_pbo(ctx, packing);
-}
-
-static void viaTexImage2D(GLcontext *ctx,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- viaTexImage( ctx, 2, target, level,
- internalFormat, width, height, border,
- format, type, pixels,
- packing, texObj, texImage );
-}
-
-static void viaTexSubImage2D(GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- viaWaitIdle(vmesa, GL_TRUE);
- vmesa->clearTexCache = 1;
-
- _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
- height, format, type, pixels, packing, texObj,
- texImage);
-}
-
-static void viaTexImage1D(GLcontext *ctx,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- viaTexImage( ctx, 1, target, level,
- internalFormat, width, 1, border,
- format, type, pixels,
- packing, texObj, texImage );
-}
-
-static void viaTexSubImage1D(GLcontext *ctx,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- viaWaitIdle(vmesa, GL_TRUE);
- vmesa->clearTexCache = 1;
-
- _mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
- format, type, pixels, packing, texObj,
- texImage);
-}
-
-
-
-static GLboolean viaIsTextureResident(GLcontext *ctx,
- struct gl_texture_object *texObj)
-{
- struct via_texture_object *viaObj =
- (struct via_texture_object *)texObj;
-
- return (viaObj->memType == VIA_MEM_AGP ||
- viaObj->memType == VIA_MEM_VIDEO);
-}
-
-
-
-static struct gl_texture_image *viaNewTextureImage( GLcontext *ctx )
-{
- (void) ctx;
- return (struct gl_texture_image *)CALLOC_STRUCT(via_texture_image);
-}
-
-
-static struct gl_texture_object *viaNewTextureObject( GLcontext *ctx,
- GLuint name,
- GLenum target )
-{
- struct via_texture_object *obj = CALLOC_STRUCT(via_texture_object);
-
- _mesa_initialize_texture_object(&obj->obj, name, target);
- (void) ctx;
-
- obj->memType = VIA_MEM_UNKNOWN;
-
- return &obj->obj;
-}
-
-
-static void viaFreeTextureImageData( GLcontext *ctx,
- struct gl_texture_image *texImage )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- struct via_texture_image *image = (struct via_texture_image *)texImage;
-
- if (image->texMem) {
- via_free_texture(vmesa, image->texMem);
- image->texMem = NULL;
- }
-
- texImage->Data = NULL;
-}
-
-
-
-
-void viaInitTextureFuncs(struct dd_function_table * functions)
-{
- functions->ChooseTextureFormat = viaChooseTexFormat;
- functions->TexImage1D = viaTexImage1D;
- functions->TexImage2D = viaTexImage2D;
- functions->TexSubImage1D = viaTexSubImage1D;
- functions->TexSubImage2D = viaTexSubImage2D;
-
- functions->NewTextureObject = viaNewTextureObject;
- functions->NewTextureImage = viaNewTextureImage;
- functions->DeleteTexture = _mesa_delete_texture_object;
- functions->FreeTexImageData = viaFreeTextureImageData;
-
-#if 0 && defined( USE_SSE_ASM )
- /*
- * XXX this code is disabled for now because the via_sse_memcpy()
- * routine causes segfaults with flightgear.
- * See Mesa3d-dev mail list messages from 7/15/2005 for details.
- * Note that this function is currently disabled in via_tris.c too.
- */
- if (getenv("VIA_NO_SSE"))
- functions->TextureMemCpy = _mesa_memcpy;
- else
- functions->TextureMemCpy = via_sse_memcpy;
-#else
- functions->TextureMemCpy = _mesa_memcpy;
-#endif
-
- functions->UpdateTexturePalette = 0;
- functions->IsTextureResident = viaIsTextureResident;
-}
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.h
deleted file mode 100644
index 73cfa91ad..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tex.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef _VIATEX_H
-#define _VIATEX_H
-
-#include "mtypes.h"
-
-struct via_context;
-
-GLboolean viaUpdateTextureState(GLcontext *ctx);
-void viaInitTextureFuncs(struct dd_function_table * functions);
-GLboolean viaSwapOutWork( struct via_context *vmesa );
-
-#if defined( USE_SSE_ASM )
-void via_sse_memcpy( void *to, const void *from, size_t sz );
-#endif /* defined( USE_SSE_ASM ) */
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_texcombine.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_texcombine.c
deleted file mode 100644
index d604457bf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_texcombine.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 via_texcombine.c
- * Calculate texture combine hardware state.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "colormac.h"
-#include "enums.h"
-
-#include "via_context.h"
-#include "via_state.h"
-#include "via_tex.h"
-#include "via_3d_reg.h"
-
-
-#define VIA_USE_ALPHA (HC_XTC_Adif - HC_XTC_Dif)
-
-#define INPUT_A_SHIFT 14
-#define INPUT_B_SHIFT 7
-#define INPUT_C_SHIFT 0
-#define INPUT_CBias_SHIFT 14
-
-#define CONST_ONE (HC_XTC_0 | HC_XTC_InvTOPC)
-
-static const unsigned color_operand_modifier[4] = {
- 0,
- HC_XTC_InvTOPC,
- VIA_USE_ALPHA,
- VIA_USE_ALPHA | HC_XTC_InvTOPC,
-};
-
-static const unsigned alpha_operand_modifier[2] = {
- 0, HC_XTA_InvTOPA
-};
-
-static const unsigned bias_alpha_operand_modifier[2] = {
- 0, HC_HTXnTBLAbias_Inv
-};
-
-
-static const unsigned c_shift_table[3] = {
- HC_HTXnTBLCshift_No, HC_HTXnTBLCshift_1, HC_HTXnTBLCshift_2
-};
-
-static const unsigned a_shift_table[3] = {
- HC_HTXnTBLAshift_No, HC_HTXnTBLAshift_1, HC_HTXnTBLAshift_2
-};
-
-
-/**
- * Calculate the hardware state for the specified texture combine mode
- *
- * \bug
- * All forms of DOT3 bumpmapping are completely untested, and are most
- * likely wrong. KW: Looks like it will never be quite right as the
- * hardware seems to experience overflow in color calculation at the
- * 4x shift levels, which need to be programed for DOT3. Maybe newer
- * hardware fixes these issues.
- *
- * \bug
- * KW: needs attention to the case where texunit 1 is enabled but
- * texunit 0 is not.
- */
-GLboolean
-viaTexCombineState( struct via_context *vmesa,
- const struct gl_tex_env_combine_state * combine,
- unsigned unit )
-{
- unsigned color_arg[3];
- unsigned alpha_arg[3];
- unsigned bias_alpha_arg[3];
- unsigned color = HC_HTXnTBLCsat_MASK;
- unsigned alpha = HC_HTXnTBLAsat_MASK;
- unsigned bias = 0;
- unsigned op = 0;
- unsigned a_shift = combine->ScaleShiftA;
- unsigned c_shift = combine->ScaleShiftRGB;
- unsigned i;
- unsigned constant_color[3];
- unsigned ordered_constant_color[4];
- unsigned constant_alpha[3];
- unsigned bias_alpha = 0;
- unsigned abc_alpha = 0;
- const struct gl_texture_unit * texUnit =
- &vmesa->glCtx->Texture.Unit[unit];
- unsigned env_color[4];
-
- /* It seems that the color clamping can be overwhelmed at the 4x
- * scale settings, necessitating this fallback:
- */
- if (c_shift == 2 || a_shift == 2) {
- return GL_FALSE;
- }
-
- CLAMPED_FLOAT_TO_UBYTE(env_color[0], texUnit->EnvColor[0]);
- CLAMPED_FLOAT_TO_UBYTE(env_color[1], texUnit->EnvColor[1]);
- CLAMPED_FLOAT_TO_UBYTE(env_color[2], texUnit->EnvColor[2]);
- CLAMPED_FLOAT_TO_UBYTE(env_color[3], texUnit->EnvColor[3]);
-
- (void) memset( constant_color, 0, sizeof( constant_color ) );
- (void) memset( ordered_constant_color, 0, sizeof( ordered_constant_color ) );
- (void) memset( constant_alpha, 0, sizeof( constant_alpha ) );
-
- for ( i = 0 ; i < combine->_NumArgsRGB ; i++ ) {
- const GLint op = combine->OperandRGB[i] - GL_SRC_COLOR;
-
- switch ( combine->SourceRGB[i] ) {
- case GL_TEXTURE:
- color_arg[i] = HC_XTC_Tex;
- color_arg[i] += color_operand_modifier[op];
- break;
- case GL_CONSTANT:
- color_arg[i] = HC_XTC_HTXnTBLRC;
-
- switch( op ) {
- case 0: /* GL_SRC_COLOR */
- constant_color[i] = ((env_color[0] << 16) |
- (env_color[1] << 8) |
- env_color[2]);
- break;
- case 1: /* GL_ONE_MINUS_SRC_COLOR */
- constant_color[i] = ~((env_color[0] << 16) |
- (env_color[1] << 8) |
- env_color[2]) & 0x00ffffff;
- break;
- case 2: /* GL_SRC_ALPHA */
- constant_color[i] = ((env_color[3] << 16) |
- (env_color[3] << 8) |
- env_color[3]);
- break;
- case 3: /* GL_ONE_MINUS_SRC_ALPHA */
- constant_color[i] = ~((env_color[3] << 16) |
- (env_color[3] << 8) |
- env_color[3]) & 0x00ffffff;
- break;
- }
- break;
- case GL_PRIMARY_COLOR:
- color_arg[i] = HC_XTC_Dif;
- color_arg[i] += color_operand_modifier[op];
- break;
- case GL_PREVIOUS:
- color_arg[i] = (unit == 0) ? HC_XTC_Dif : HC_XTC_Cur;
- color_arg[i] += color_operand_modifier[op];
- break;
- }
- }
-
-
- /* On the Unichrome, all combine operations take on some form of:
- *
- * (xA * (xB op xC) + xBias) << xShift
- *
- * 'op' can be selected as add, subtract, min, max, or mask. The min, max
- * and mask modes are currently unused. With the exception of DOT3, all
- * standard GL_COMBINE modes can be implemented simply by selecting the
- * correct inputs for A, B, C, and Bias and the correct operation for op.
- *
- * NOTE: xBias (when read from the constant registers) is signed,
- * and scaled to fit -255..255 in 8 bits, ie 0x1 == 2.
- */
-
- switch( combine->ModeRGB ) {
- /* Ca = 1.0, Cb = arg0, Cc = 0, Cbias = 0
- */
- case GL_REPLACE:
- color |= ((CONST_ONE << INPUT_A_SHIFT) |
- (color_arg[0] << INPUT_B_SHIFT));
-
- ordered_constant_color[1] = constant_color[0];
- break;
-
- /* Ca = arg[0], Cb = arg[1], Cc = 0, Cbias = 0
- */
- case GL_MODULATE:
- color |= ((color_arg[0] << INPUT_A_SHIFT) |
- (color_arg[1] << INPUT_B_SHIFT));
-
- ordered_constant_color[0] = constant_color[0];
- ordered_constant_color[1] = constant_color[1];
- break;
-
- /* Ca = 1.0, Cb = arg[0], Cc = arg[1], Cbias = 0
- */
- case GL_ADD:
- case GL_SUBTRACT:
- if ( combine->ModeRGB == GL_SUBTRACT ) {
- op |= HC_HTXnTBLCop_Sub;
- }
-
- color |= ((CONST_ONE << INPUT_A_SHIFT) |
- (color_arg[0] << INPUT_B_SHIFT) |
- (color_arg[1] << INPUT_C_SHIFT));
-
- ordered_constant_color[1] = constant_color[0];
- ordered_constant_color[2] = constant_color[1];
- break;
-
- /* Ca = 1.0, Cb = arg[0], Cc = arg[1], Cbias = -0.5
- */
- case GL_ADD_SIGNED:
- color |= ((CONST_ONE << INPUT_A_SHIFT) |
- (color_arg[0] << INPUT_B_SHIFT) |
- (color_arg[1] << INPUT_C_SHIFT));
-
- bias |= HC_HTXnTBLCbias_HTXnTBLRC;
-
- ordered_constant_color[1] = constant_color[0];
- ordered_constant_color[2] = constant_color[1];
- ordered_constant_color[3] = 0x00bfbfbf; /* -.5 */
- break;
-
- /* Ca = arg[2], Cb = arg[0], Cc = arg[1], Cbias = arg[1]
- */
- case GL_INTERPOLATE:
- op |= HC_HTXnTBLCop_Sub;
-
- color |= ((color_arg[2] << INPUT_A_SHIFT) |
- (color_arg[0] << INPUT_B_SHIFT) |
- (color_arg[1] << INPUT_C_SHIFT));
-
- bias |= (color_arg[1] << INPUT_CBias_SHIFT);
-
- ordered_constant_color[0] = constant_color[2];
- ordered_constant_color[1] = constant_color[0];
- ordered_constant_color[2] = constant_color[1];
- ordered_constant_color[3] = (constant_color[1] >> 1) & 0x7f7f7f;
- break;
-
-#if 0
- /* At this point this code is completely untested. It appears that the
- * Unichrome has the same limitation as the Radeon R100. The only
- * supported post-scale when doing DOT3 bumpmapping is 1x.
- */
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- c_shift = 2;
- a_shift = 2;
- color |= ((color_arg[0] << INPUT_A_SHIFT) |
- (color_arg[1] << INPUT_B_SHIFT));
- op |= HC_HTXnTBLDOT4;
- break;
-#endif
-
- default:
- assert(0);
- break;
- }
-
-
-
-
- /* The alpha blend stage has the annoying quirk of not having a
- * hard-wired 0 input, like the color stage. As a result, we have
- * to program the constant register with 0 and use that as our
- * 0 input.
- *
- * (xA * (xB op xC) + xBias) << xShift
- *
- */
-
- for ( i = 0 ; i < combine->_NumArgsA ; i++ ) {
- const GLint op = combine->OperandA[i] - GL_SRC_ALPHA;
-
- switch ( combine->SourceA[i] ) {
- case GL_TEXTURE:
- alpha_arg[i] = HC_XTA_Atex;
- alpha_arg[i] += alpha_operand_modifier[op];
- bias_alpha_arg[i] = HC_HTXnTBLAbias_Atex;
- bias_alpha_arg[i] += bias_alpha_operand_modifier[op];
- break;
- case GL_CONSTANT:
- alpha_arg[i] = HC_XTA_HTXnTBLRA;
- bias_alpha_arg[i] = HC_HTXnTBLAbias_HTXnTBLRAbias;
- constant_alpha[i] = (op == 0) ? env_color[3] : (~env_color[3] & 0xff);
- break;
- case GL_PRIMARY_COLOR:
- alpha_arg[i] = HC_XTA_Adif;
- alpha_arg[i] += alpha_operand_modifier[op];
- bias_alpha_arg[i] = HC_HTXnTBLAbias_Adif;
- bias_alpha_arg[i] += bias_alpha_operand_modifier[op];
- break;
- case GL_PREVIOUS:
- alpha_arg[i] = (unit == 0) ? HC_XTA_Adif : HC_XTA_Acur;
- alpha_arg[i] += alpha_operand_modifier[op];
- bias_alpha_arg[i] = (unit == 0 ?
- HC_HTXnTBLAbias_Adif :
- HC_HTXnTBLAbias_Acur);
- bias_alpha_arg[i] += bias_alpha_operand_modifier[op];
- break;
- }
- }
-
- switch( combine->ModeA ) {
- /* Aa = 0, Ab = 0, Ac = 0, Abias = arg0
- */
- case GL_REPLACE:
- alpha |= ((HC_XTA_HTXnTBLRA << INPUT_A_SHIFT) |
- (HC_XTA_HTXnTBLRA << INPUT_B_SHIFT) |
- (HC_XTA_HTXnTBLRA << INPUT_C_SHIFT));
- abc_alpha = 0;
-
- bias |= bias_alpha_arg[0];
- bias_alpha = constant_alpha[0] >> 1;
- break;
-
- /* Aa = arg[0], Ab = arg[1], Ac = 0, Abias = 0
- */
- case GL_MODULATE:
- alpha |= ((alpha_arg[1] << INPUT_A_SHIFT) |
- (alpha_arg[0] << INPUT_B_SHIFT) |
- (HC_XTA_HTXnTBLRA << INPUT_C_SHIFT));
-
- abc_alpha = ((constant_alpha[1] << HC_HTXnTBLRAa_SHIFT) |
- (constant_alpha[0] << HC_HTXnTBLRAb_SHIFT) |
- (0 << HC_HTXnTBLRAc_SHIFT));
-
- bias |= HC_HTXnTBLAbias_HTXnTBLRAbias;
- bias_alpha = 0;
- break;
-
- /* Aa = 1.0, Ab = arg[0], Ac = arg[1], Abias = 0
- */
- case GL_ADD:
- case GL_SUBTRACT:
- if ( combine->ModeA == GL_SUBTRACT ) {
- op |= HC_HTXnTBLAop_Sub;
- }
-
- alpha |= ((HC_XTA_HTXnTBLRA << INPUT_A_SHIFT) |
- (alpha_arg[0] << INPUT_B_SHIFT) |
- (alpha_arg[1] << INPUT_C_SHIFT));
-
- abc_alpha = ((0xff << HC_HTXnTBLRAa_SHIFT) |
- (constant_alpha[0] << HC_HTXnTBLRAb_SHIFT) |
- (constant_alpha[1] << HC_HTXnTBLRAc_SHIFT));
-
- bias |= HC_HTXnTBLAbias_HTXnTBLRAbias;
- bias_alpha = 0;
- break;
-
- /* Aa = 1.0, Ab = arg[0], Ac = arg[1], Abias = -0.5
- */
- case GL_ADD_SIGNED:
- alpha |= ((HC_XTA_HTXnTBLRA << INPUT_A_SHIFT) |
- (alpha_arg[0] << INPUT_B_SHIFT) |
- (alpha_arg[1] << INPUT_C_SHIFT));
- abc_alpha = ((0xff << HC_HTXnTBLRAa_SHIFT) |
- (constant_alpha[0] << HC_HTXnTBLRAb_SHIFT) |
- (constant_alpha[1] << HC_HTXnTBLRAc_SHIFT));
-
- bias |= HC_HTXnTBLAbias_HTXnTBLRAbias;
- bias_alpha = 0xbf;
- break;
-
- /* Aa = arg[2], Ab = arg[0], Ac = arg[1], Abias = arg[1]
- */
- case GL_INTERPOLATE:
- op |= HC_HTXnTBLAop_Sub;
-
- alpha |= ((alpha_arg[2] << INPUT_A_SHIFT) |
- (alpha_arg[0] << INPUT_B_SHIFT) |
- (alpha_arg[1] << INPUT_C_SHIFT));
- abc_alpha = ((constant_alpha[2] << HC_HTXnTBLRAa_SHIFT) |
- (constant_alpha[0] << HC_HTXnTBLRAb_SHIFT) |
- (constant_alpha[1] << HC_HTXnTBLRAc_SHIFT));
-
- bias |= bias_alpha_arg[1];
- bias_alpha = constant_alpha[1] >> 1;
- break;
- }
-
-
- op |= c_shift_table[ c_shift ] | a_shift_table[ a_shift ];
-
-
- vmesa->regHTXnTBLMPfog[unit] = HC_HTXnTBLMPfog_Fog;
-
- vmesa->regHTXnTBLCsat[unit] = color;
- vmesa->regHTXnTBLAsat[unit] = alpha;
- vmesa->regHTXnTBLCop[unit] = op | bias;
- vmesa->regHTXnTBLRAa[unit] = abc_alpha;
- vmesa->regHTXnTBLRFog[unit] = bias_alpha;
-
- vmesa->regHTXnTBLRCa[unit] = ordered_constant_color[0];
- vmesa->regHTXnTBLRCb[unit] = ordered_constant_color[1];
- vmesa->regHTXnTBLRCc[unit] = ordered_constant_color[2];
- vmesa->regHTXnTBLRCbias[unit] = ordered_constant_color[3];
-
- return GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.c
deleted file mode 100644
index 9cb88ae23..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.c
+++ /dev/null
@@ -1,1190 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <math.h>
-
-#include "glheader.h"
-#include "context.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-#include "enums.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "via_context.h"
-#include "via_tris.h"
-#include "via_state.h"
-#include "via_span.h"
-#include "via_ioctl.h"
-#include "via_3d_reg.h"
-#include "via_tex.h"
-
-/***********************************************************************
- * Emit primitives as inline vertices *
- ***********************************************************************/
-#define LINE_FALLBACK (0)
-#define POINT_FALLBACK (0)
-#define TRI_FALLBACK (0)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-
-
-#if 0
-#define COPY_DWORDS(vb, vertsize, v) \
-do { \
- via_sse_memcpy(vb, v, vertsize * 4); \
- vb += vertsize; \
-} while (0)
-#else
-#if defined( USE_X86_ASM )
-#define COPY_DWORDS(vb, vertsize, v) \
- do { \
- int j; \
- int __tmp; \
- __asm__ __volatile__("rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertsize), \
- "D" ((long)vb), \
- "S" ((long)v)); \
- } while (0)
-#else
-#define COPY_DWORDS(vb, vertsize, v) \
- do { \
- int j; \
- for (j = 0; j < vertsize; j++) \
- vb[j] = ((GLuint *)v)[j]; \
- vb += vertsize; \
- } while (0)
-#endif
-#endif
-
-static void via_draw_triangle(struct via_context *vmesa,
- viaVertexPtr v0,
- viaVertexPtr v1,
- viaVertexPtr v2)
-{
- GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 3 * 4 * vertsize);
-
- COPY_DWORDS(vb, vertsize, v0);
- COPY_DWORDS(vb, vertsize, v1);
- COPY_DWORDS(vb, vertsize, v2);
-}
-
-
-static void via_draw_quad(struct via_context *vmesa,
- viaVertexPtr v0,
- viaVertexPtr v1,
- viaVertexPtr v2,
- viaVertexPtr v3)
-{
- GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 6 * 4 * vertsize);
-
- COPY_DWORDS(vb, vertsize, v0);
- COPY_DWORDS(vb, vertsize, v1);
- COPY_DWORDS(vb, vertsize, v3);
- COPY_DWORDS(vb, vertsize, v1);
- COPY_DWORDS(vb, vertsize, v2);
- COPY_DWORDS(vb, vertsize, v3);
-}
-
-static void via_draw_line(struct via_context *vmesa,
- viaVertexPtr v0,
- viaVertexPtr v1)
-{
- GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 2 * 4 * vertsize);
- COPY_DWORDS(vb, vertsize, v0);
- COPY_DWORDS(vb, vertsize, v1);
-}
-
-
-static void via_draw_point(struct via_context *vmesa,
- viaVertexPtr v0)
-{
- GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 4 * vertsize);
- COPY_DWORDS(vb, vertsize, v0);
-}
-
-
-/* Fallback drawing functions for the ptex hack.
- */
-#define PTEX_VERTEX( tmp, vertex_size, v) \
-do { \
- GLuint j; \
- GLfloat rhw = 1.0 / v->f[vertex_size]; \
- for ( j = 0 ; j < vertex_size ; j++ ) \
- tmp.f[j] = v->f[j]; \
- tmp.f[3] *= v->f[vertex_size]; \
- tmp.f[vertex_size-2] *= rhw; \
- tmp.f[vertex_size-1] *= rhw; \
-} while (0)
-
-static void via_ptex_tri (struct via_context *vmesa,
- viaVertexPtr v0,
- viaVertexPtr v1,
- viaVertexPtr v2)
-{
- GLuint vertsize = vmesa->hwVertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 3*4*vertsize);
- viaVertex tmp;
-
- PTEX_VERTEX(tmp, vertsize, v0); COPY_DWORDS(vb, vertsize, &tmp);
- PTEX_VERTEX(tmp, vertsize, v1); COPY_DWORDS(vb, vertsize, &tmp);
- PTEX_VERTEX(tmp, vertsize, v2); COPY_DWORDS(vb, vertsize, &tmp);
-}
-
-static void via_ptex_line (struct via_context *vmesa,
- viaVertexPtr v0,
- viaVertexPtr v1)
-{
- GLuint vertsize = vmesa->hwVertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 2*4*vertsize);
- viaVertex tmp;
-
- PTEX_VERTEX(tmp, vertsize, v0); COPY_DWORDS(vb, vertsize, &tmp);
- PTEX_VERTEX(tmp, vertsize, v1); COPY_DWORDS(vb, vertsize, &tmp);
-}
-
-static void via_ptex_point (struct via_context *vmesa,
- viaVertexPtr v0)
-{
- GLuint vertsize = vmesa->hwVertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, 1*4*vertsize);
- viaVertex tmp;
-
- PTEX_VERTEX(tmp, vertsize, v0); COPY_DWORDS(vb, vertsize, &tmp);
-}
-
-
-
-
-
-/***********************************************************************
- * Macros for via_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI(a, b, c) \
- do { \
- if (DO_FALLBACK) \
- vmesa->drawTri(vmesa, a, b, c); \
- else \
- via_draw_triangle(vmesa, a, b, c); \
- } while (0)
-
-#define QUAD(a, b, c, d) \
- do { \
- if (DO_FALLBACK) { \
- vmesa->drawTri(vmesa, a, b, d); \
- vmesa->drawTri(vmesa, b, c, d); \
- } \
- else \
- via_draw_quad(vmesa, a, b, c, d); \
- } while (0)
-
-#define LINE(v0, v1) \
- do { \
- if (DO_FALLBACK) \
- vmesa->drawLine(vmesa, v0, v1); \
- else \
- via_draw_line(vmesa, v0, v1); \
- } while (0)
-
-#define POINT(v0) \
- do { \
- if (DO_FALLBACK) \
- vmesa->drawPoint(vmesa, v0); \
- else \
- via_draw_point(vmesa, v0); \
- } while (0)
-
-
-/***********************************************************************
- * Build render functions from dd templates *
- ***********************************************************************/
-
-#define VIA_OFFSET_BIT 0x01
-#define VIA_TWOSIDE_BIT 0x02
-#define VIA_UNFILLED_BIT 0x04
-#define VIA_FALLBACK_BIT 0x08
-#define VIA_MAX_TRIFUNC 0x10
-
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[VIA_MAX_TRIFUNC + 1];
-
-
-#define DO_FALLBACK (IND & VIA_FALLBACK_BIT)
-#define DO_OFFSET (IND & VIA_OFFSET_BIT)
-#define DO_UNFILLED (IND & VIA_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & VIA_TWOSIDE_BIT)
-#define DO_FLAT 0
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_BACK_COLORS 0
-#define HAVE_HW_FLATSHADE 1
-#define VERTEX viaVertex
-#define TAB rast_tab
-
-/* Only used to pull back colors into vertices (ie, we know color is
- * floating point).
- */
-#define VIA_COLOR(dst, src) \
- do { \
- dst[0] = src[2]; \
- dst[1] = src[1]; \
- dst[2] = src[0]; \
- dst[3] = src[3]; \
- } while (0)
-
-#define VIA_SPEC(dst, src) \
- do { \
- dst[0] = src[2]; \
- dst[1] = src[1]; \
- dst[2] = src[0]; \
- } while (0)
-
-
-#define DEPTH_SCALE vmesa->polygon_offset_scale
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->v.x
-#define VERT_Y(_v) _v->v.y
-#define VERT_Z(_v) _v->v.z
-#define AREA_IS_CCW(a) (a > 0)
-#define GET_VERTEX(e) (vmesa->verts + (e * vmesa->vertexSize * sizeof(int)))
-
-#define VERT_SET_RGBA( v, c ) \
-do { \
- via_color_t *color = (via_color_t *)&((v)->ui[coloroffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->alpha, (c)[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-
-#define VERT_SET_SPEC( v, c ) \
-do { \
- if (specoffset) { \
- via_color_t *color = (via_color_t *)&((v)->ui[specoffset]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(color->blue, (c)[2]); \
- } \
-} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (specoffset) { \
- v0->ub4[specoffset][0] = v1->ub4[specoffset][0]; \
- v0->ub4[specoffset][1] = v1->ub4[specoffset][1]; \
- v0->ub4[specoffset][2] = v1->ub4[specoffset][2]; \
- } \
-} while (0)
-
-
-#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
-#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset]
-#define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx]
-
-
-#define LOCAL_VARS(n) \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
- GLuint coloroffset = vmesa->coloroffset; \
- GLuint specoffset = vmesa->specoffset; \
- (void)color; (void)spec; (void)coloroffset; (void)specoffset;
-
-
-/***********************************************************************
- * Helpers for rendering unfilled primitives *
- ***********************************************************************/
-
-static const GLenum hwPrim[GL_POLYGON + 2] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_POLYGON+1
-};
-
-
-#define RASTERIZE(x) viaRasterPrimitive( ctx, x, hwPrim[x] )
-#define RENDER_PRIMITIVE vmesa->renderPrimitive
-#define TAG(x) x
-#define IND VIA_FALLBACK_BIT
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-#undef RASTERIZE
-
-/***********************************************************************
- * Generate GL render functions *
- ***********************************************************************/
-#define RASTERIZE(x)
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_OFFSET_BIT|VIA_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_OFFSET_BIT|VIA_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_OFFSET_BIT|VIA_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_OFFSET_BIT|VIA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_UNFILLED_BIT|VIA_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_OFFSET_BIT|VIA_UNFILLED_BIT|VIA_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_UNFILLED_BIT|VIA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (VIA_TWOSIDE_BIT|VIA_OFFSET_BIT|VIA_UNFILLED_BIT| \
- VIA_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-/* Catchall case for flat, separate specular triangles (via has flat
- * diffuse shading, but always does specular color with gouraud).
- */
-#undef DO_FALLBACK
-#undef DO_OFFSET
-#undef DO_UNFILLED
-#undef DO_TWOSIDE
-#undef DO_FLAT
-#define DO_FALLBACK (0)
-#define DO_OFFSET (ctx->_TriangleCaps & DD_TRI_OFFSET)
-#define DO_UNFILLED (ctx->_TriangleCaps & DD_TRI_UNFILLED)
-#define DO_TWOSIDE (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE)
-#define DO_FLAT 1
-#define TAG(x) x##_flat_specular
-#define IND VIA_MAX_TRIFUNC
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-static void init_rast_tab(void)
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-
- init_flat_specular(); /* special! */
-}
-
-
-/***********************************************************************
- * Rasterization fallback helpers *
- ***********************************************************************/
-
-
-/* This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-via_fallback_tri(struct via_context *vmesa,
- viaVertex *v0,
- viaVertex *v1,
- viaVertex *v2)
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[3];
- _swsetup_Translate(ctx, v0, &v[0]);
- _swsetup_Translate(ctx, v1, &v[1]);
- _swsetup_Translate(ctx, v2, &v[2]);
- viaSpanRenderStart( ctx );
- _swrast_Triangle(ctx, &v[0], &v[1], &v[2]);
- viaSpanRenderFinish( ctx );
-}
-
-
-static void
-via_fallback_line(struct via_context *vmesa,
- viaVertex *v0,
- viaVertex *v1)
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[2];
- _swsetup_Translate(ctx, v0, &v[0]);
- _swsetup_Translate(ctx, v1, &v[1]);
- viaSpanRenderStart( ctx );
- _swrast_Line(ctx, &v[0], &v[1]);
- viaSpanRenderFinish( ctx );
-}
-
-
-static void
-via_fallback_point(struct via_context *vmesa,
- viaVertex *v0)
-{
- GLcontext *ctx = vmesa->glCtx;
- SWvertex v[1];
- _swsetup_Translate(ctx, v0, &v[0]);
- viaSpanRenderStart( ctx );
- _swrast_Point(ctx, &v[0]);
- viaSpanRenderFinish( ctx );
-}
-
-static void viaResetLineStipple( GLcontext *ctx )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- vmesa->regCmdB |= HC_HLPrst_MASK;
-}
-
-/**********************************************************************/
-/* Render unclipped begin/end objects */
-/**********************************************************************/
-#define IND 0
-#define V(x) (viaVertex *)(vertptr + ((x) * vertsize * sizeof(int)))
-#define RENDER_POINTS(start, count) \
- for (; start < count; start++) POINT(V(ELT(start)));
-#define RENDER_LINE(v0, v1) LINE(V(v0), V(v1))
-#define RENDER_TRI( v0, v1, v2) TRI( V(v0), V(v1), V(v2))
-#define RENDER_QUAD(v0, v1, v2, v3) QUAD(V(v0), V(v1), V(v2), V(v3))
-#define INIT(x) viaRasterPrimitive(ctx, x, hwPrim[x])
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- GLubyte *vertptr = (GLubyte *)vmesa->verts; \
- const GLuint vertsize = vmesa->vertexSize; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- const GLboolean stipple = ctx->Line.StippleFlag; \
- (void) elt; (void) stipple;
-#define RESET_STIPPLE if ( stipple ) viaResetLineStipple( ctx );
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-#define ELT(x) x
-#define TAG(x) via_##x##_verts
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#define TAG(x) via_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl/t_vb_rendertmp.h"
-#undef ELT
-#undef TAG
-#undef NEED_EDGEFLAG_SETUP
-#undef EDGEFLAG_GET
-#undef EDGEFLAG_SET
-#undef RESET_OCCLUSION
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void viaRenderClippedPoly(GLcontext *ctx, const GLuint *elts,
- GLuint n)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint prim = VIA_CONTEXT(ctx)->renderPrimitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON](ctx, 0, n,
- PRIM_BEGIN|PRIM_END);
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON &&
- prim != GL_POLYGON + 1)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-static void viaRenderClippedLine(GLcontext *ctx, GLuint ii, GLuint jj)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.Line(ctx, ii, jj);
-}
-
-static void viaFastRenderClippedPoly(GLcontext *ctx, const GLuint *elts,
- GLuint n)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLuint vertsize = vmesa->vertexSize;
- GLuint *vb = viaExtendPrimitive(vmesa, (n - 2) * 3 * 4 * vertsize);
- GLubyte *vertptr = (GLubyte *)vmesa->verts;
- const GLuint *start = (const GLuint *)V(elts[0]);
- int i;
-
- for (i = 2; i < n; i++) {
- COPY_DWORDS(vb, vertsize, V(elts[i - 1]));
- COPY_DWORDS(vb, vertsize, V(elts[i]));
- COPY_DWORDS(vb, vertsize, start);
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-
-
-#define _VIA_NEW_VERTEX (_NEW_TEXTURE | \
- _DD_NEW_SEPARATE_SPECULAR | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _NEW_FOG)
-
-#define _VIA_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_LIGHT_TWOSIDE | \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_STIPPLE | \
- _NEW_POLYGONSTIPPLE)
-
-
-static void viaChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (vmesa->ptexHack) {
- vmesa->drawPoint = via_ptex_point;
- vmesa->drawLine = via_ptex_line;
- vmesa->drawTri = via_ptex_tri;
- index |= VIA_FALLBACK_BIT;
- }
- else {
- vmesa->drawPoint = via_draw_point;
- vmesa->drawLine = via_draw_line;
- vmesa->drawTri = via_draw_triangle;
- }
-
- if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) {
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= VIA_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= VIA_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= VIA_UNFILLED_BIT;
- if (flags & ANY_FALLBACK_FLAGS) index |= VIA_FALLBACK_BIT;
-
- /* Hook in fallbacks for specific primitives.
- */
- if (flags & POINT_FALLBACK)
- vmesa->drawPoint = via_fallback_point;
-
- if (flags & LINE_FALLBACK)
- vmesa->drawLine = via_fallback_line;
-
- if (flags & TRI_FALLBACK)
- vmesa->drawTri = via_fallback_tri;
- }
-
-
- if ((flags & DD_SEPARATE_SPECULAR) &&
- ctx->Light.ShadeModel == GL_FLAT) {
- index = VIA_MAX_TRIFUNC; /* flat specular */
- }
-
- if (vmesa->renderIndex != index) {
- vmesa->renderIndex = index;
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = via_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = via_render_tab_elts;
- tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */
- tnl->Driver.Render.ClippedPolygon = viaFastRenderClippedPoly;
- }
- else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedLine = viaRenderClippedLine;
- tnl->Driver.Render.ClippedPolygon = viaRenderClippedPoly;
- }
- }
-}
-
-
-#define VIA_EMIT_TEX1 0x01
-#define VIA_EMIT_TEX0 0x02
-#define VIA_EMIT_PTEX0 0x04
-#define VIA_EMIT_RGBA 0x08
-#define VIA_EMIT_SPEC 0x10
-#define VIA_EMIT_FOG 0x20
-#define VIA_EMIT_W 0x40
-
-#define EMIT_ATTR( ATTR, STYLE, INDEX, REGB ) \
-do { \
- vmesa->vertex_attrs[vmesa->vertex_attr_count].attrib = (ATTR); \
- vmesa->vertex_attrs[vmesa->vertex_attr_count].format = (STYLE); \
- vmesa->vertex_attr_count++; \
- setupIndex |= (INDEX); \
- regCmdB |= (REGB); \
-} while (0)
-
-#define EMIT_PAD( N ) \
-do { \
- vmesa->vertex_attrs[vmesa->vertex_attr_count].attrib = 0; \
- vmesa->vertex_attrs[vmesa->vertex_attr_count].format = EMIT_PAD; \
- vmesa->vertex_attrs[vmesa->vertex_attr_count].offset = (N); \
- vmesa->vertex_attr_count++; \
-} while (0)
-
-
-
-static void viaChooseVertexState( GLcontext *ctx )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint index = tnl->render_inputs;
- GLuint regCmdB = HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Z;
- GLuint setupIndex = 0;
-
- vmesa->vertex_attr_count = 0;
-
- /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
- * build up a hardware vertex.
- */
- if (index & (_TNL_BITS_TEX_ANY|_TNL_BIT_FOG)) {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, VIA_EMIT_W, HC_HVPMSK_W );
- vmesa->coloroffset = 4;
- }
- else {
- EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 0 );
- vmesa->coloroffset = 3;
- }
-
- /* t_context.c always includes a diffuse color */
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, VIA_EMIT_RGBA,
- HC_HVPMSK_Cd );
-
- vmesa->specoffset = 0;
- if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
- if ((index & _TNL_BIT_COLOR1)) {
- vmesa->specoffset = vmesa->coloroffset + 1;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VIA_EMIT_SPEC,
- HC_HVPMSK_Cs );
- }
- else
- EMIT_PAD( 3 );
-
- if ((index & _TNL_BIT_FOG))
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, VIA_EMIT_FOG, HC_HVPMSK_Cs );
- else
- EMIT_PAD( 1 );
- }
-
- if (index & _TNL_BIT_TEX(0)) {
- if (vmesa->ptexHack)
- EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW, VIA_EMIT_PTEX0,
- (HC_HVPMSK_S | HC_HVPMSK_T) );
- else
- EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, VIA_EMIT_TEX0,
- (HC_HVPMSK_S | HC_HVPMSK_T) );
- }
-
- if (index & _TNL_BIT_TEX(1)) {
- EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, VIA_EMIT_TEX1,
- (HC_HVPMSK_S | HC_HVPMSK_T) );
- }
-
- if (setupIndex != vmesa->setupIndex) {
- vmesa->vertexSize = _tnl_install_attrs( ctx,
- vmesa->vertex_attrs,
- vmesa->vertex_attr_count,
- vmesa->ViewportMatrix.m, 0 );
- vmesa->vertexSize >>= 2;
- vmesa->setupIndex = setupIndex;
- vmesa->regCmdB &= ~HC_HVPMSK_MASK;
- vmesa->regCmdB |= regCmdB;
-
- if (vmesa->ptexHack)
- vmesa->hwVertexSize = vmesa->vertexSize - 1;
- else
- vmesa->hwVertexSize = vmesa->vertexSize;
- }
-}
-
-
-
-
-/* Check if projective texture coordinates are used and if we can fake
- * them. Fallback to swrast if we can't. Returns GL_TRUE if projective
- * texture coordinates must be faked, GL_FALSE otherwise.
- */
-static GLboolean viaCheckPTexHack( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint index = tnl->render_inputs;
- GLboolean fallback = GL_FALSE;
- GLboolean ptexHack = GL_FALSE;
-
- if (index & _TNL_BIT_TEX(0) && VB->TexCoordPtr[0]->size == 4) {
- if ((index & _TNL_BITS_TEX_ANY) == _TNL_BIT_TEX(0))
- ptexHack = GL_TRUE;
- else
- fallback = GL_TRUE;
- }
- if ((index & _TNL_BIT_TEX(1)) && VB->TexCoordPtr[1]->size == 4)
- fallback = GL_TRUE;
-
- FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_PROJ_TEXTURE, fallback);
- return ptexHack;
-}
-
-
-
-
-/**********************************************************************/
-/* High level hooks for t_vb_render.c */
-/**********************************************************************/
-
-
-static void viaRenderStart(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- {
- GLboolean ptexHack = viaCheckPTexHack( ctx );
- if (ptexHack != vmesa->ptexHack) {
- vmesa->ptexHack = ptexHack;
- vmesa->newRenderState |= _VIA_NEW_RENDERSTATE;
- }
- }
-
- if (vmesa->newState) {
- vmesa->newRenderState |= vmesa->newState;
- viaValidateState( ctx );
- }
-
- if (vmesa->Fallback) {
- tnl->Driver.Render.Start(ctx);
- return;
- }
-
- if (vmesa->newRenderState) {
- viaChooseVertexState(ctx);
- viaChooseRenderState(ctx);
- vmesa->newRenderState = 0;
- }
-
- /* Important:
- */
- VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
-}
-
-static void viaRenderFinish(GLcontext *ctx)
-{
- VIA_FINISH_PRIM(VIA_CONTEXT(ctx));
-}
-
-
-/* System to flush dma and emit state changes based on the rasterized
- * primitive.
- */
-void viaRasterPrimitive(GLcontext *ctx,
- GLenum glprim,
- GLenum hwprim)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- GLuint regCmdB;
- RING_VARS;
-
- if (VIA_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "%s: %s/%s/%s\n",
- __FUNCTION__, _mesa_lookup_enum_by_nr(glprim),
- _mesa_lookup_enum_by_nr(hwprim),
- _mesa_lookup_enum_by_nr(ctx->Light.ShadeModel));
-
- assert (!vmesa->newState);
-
- vmesa->renderPrimitive = glprim;
-
- if (hwprim != vmesa->hwPrimitive ||
- ctx->Light.ShadeModel != vmesa->hwShadeModel) {
-
- VIA_FINISH_PRIM(vmesa);
-
- /* Ensure no wrapping inside this function */
- viaCheckDma( vmesa, 1024 );
-
- if (vmesa->newEmitState) {
- viaEmitState(vmesa);
- }
-
- vmesa->regCmdA_End = HC_ACMD_HCmdA;
-
- if (ctx->Light.ShadeModel == GL_SMOOTH) {
- vmesa->regCmdA_End |= HC_HShading_Gouraud;
- }
-
- vmesa->hwShadeModel = ctx->Light.ShadeModel;
- regCmdB = vmesa->regCmdB;
-
- switch (hwprim) {
- case GL_POINTS:
- vmesa->regCmdA_End |= HC_HPMType_Point | HC_HVCycle_Full;
- vmesa->regCmdA_End |= HC_HShading_Gouraud; /* always Gouraud
- shade points?!? */
- break;
- case GL_LINES:
- vmesa->regCmdA_End |= HC_HPMType_Line | HC_HVCycle_Full;
- regCmdB |= HC_HLPrst_MASK;
- if (ctx->Light.ShadeModel == GL_FLAT)
- vmesa->regCmdA_End |= HC_HShading_FlatB;
- break;
- case GL_LINE_LOOP:
- case GL_LINE_STRIP:
- vmesa->regCmdA_End |= HC_HPMType_Line | HC_HVCycle_AFP |
- HC_HVCycle_AB | HC_HVCycle_NewB;
- regCmdB |= HC_HVCycle_AB | HC_HVCycle_NewB | HC_HLPrst_MASK;
- if (ctx->Light.ShadeModel == GL_FLAT)
- vmesa->regCmdA_End |= HC_HShading_FlatB;
- break;
- case GL_TRIANGLES:
- vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_Full;
- if (ctx->Light.ShadeModel == GL_FLAT)
- vmesa->regCmdA_End |= HC_HShading_FlatC;
- break;
- case GL_TRIANGLE_STRIP:
- vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_AFP |
- HC_HVCycle_AC | HC_HVCycle_BB | HC_HVCycle_NewC;
- regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
- if (ctx->Light.ShadeModel == GL_FLAT)
- vmesa->regCmdA_End |= HC_HShading_FlatC;
- break;
- case GL_TRIANGLE_FAN:
- vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_AFP |
- HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
- regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
- if (ctx->Light.ShadeModel == GL_FLAT)
- vmesa->regCmdA_End |= HC_HShading_FlatC;
- break;
- case GL_QUADS:
- abort();
- return;
- case GL_QUAD_STRIP:
- abort();
- return;
- case GL_POLYGON:
- vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_AFP |
- HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
- regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
- if (ctx->Light.ShadeModel == GL_FLAT)
- vmesa->regCmdA_End |= HC_HShading_FlatC;
- break;
- default:
- abort();
- return;
- }
-
-/* assert((vmesa->dmaLow & 0x4) == 0); */
-
- if (vmesa->dmaCliprectAddr == ~0) {
- if (VIA_DEBUG & DEBUG_DMA)
- fprintf(stderr, "reserve cliprect space at %x\n", vmesa->dmaLow);
- vmesa->dmaCliprectAddr = vmesa->dmaLow;
- BEGIN_RING(8);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( 0xCCCCCCCC );
- OUT_RING( 0xCCCCCCCC );
- OUT_RING( 0xCCCCCCCC );
- OUT_RING( 0xCCCCCCCC );
- OUT_RING( 0xCCCCCCCC );
- OUT_RING( 0xCCCCCCCC );
- ADVANCE_RING();
- }
-
- assert(vmesa->dmaLastPrim == 0);
-
- BEGIN_RING(8);
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( 0xCCCCCCCC );
- OUT_RING( 0xDDDDDDDD );
-
- OUT_RING( HC_HEADER2 );
- OUT_RING( (HC_ParaType_CmdVdata << 16) );
- OUT_RING( regCmdB );
- OUT_RING( vmesa->regCmdA_End );
- ADVANCE_RING();
-
- vmesa->hwPrimitive = hwprim;
- vmesa->dmaLastPrim = vmesa->dmaLow;
- }
- else {
- assert(!vmesa->newEmitState);
- }
-}
-
-/* Callback for mesa:
- */
-static void viaRenderPrimitive( GLcontext *ctx, GLuint prim )
-{
- viaRasterPrimitive( ctx, prim, hwPrim[prim] );
-}
-
-
-void viaFinishPrimitive(struct via_context *vmesa)
-{
- if (VIA_DEBUG & (DEBUG_DMA|DEBUG_PRIMS))
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (!vmesa->dmaLastPrim || vmesa->dmaCliprectAddr == ~0) {
- assert(0);
- }
- else if (vmesa->dmaLow != vmesa->dmaLastPrim) {
- GLuint cmdA = (vmesa->regCmdA_End | HC_HPLEND_MASK |
- HC_HPMValidN_MASK | HC_HE3Fire_MASK);
- RING_VARS;
-
- vmesa->dmaLastPrim = 0;
-
- /* KW: modified 0x1 to 0x4 below:
- */
- if ((vmesa->dmaLow & 0x4) || !vmesa->useAgp) {
- BEGIN_RING_NOCHECK( 1 );
- OUT_RING( cmdA );
- ADVANCE_RING();
- }
- else {
- BEGIN_RING_NOCHECK( 2 );
- OUT_RING( cmdA );
- OUT_RING( cmdA );
- ADVANCE_RING();
- }
-
- if (vmesa->dmaLow > VIA_DMA_HIGHWATER)
- viaFlushDma( vmesa );
- }
- else {
- if (VIA_DEBUG & (DEBUG_DMA|DEBUG_PRIMS))
- fprintf(stderr, "remove empty primitive\n");
-
- /* Remove the primitive header:
- */
- vmesa->dmaLastPrim = 0;
- vmesa->dmaLow -= 8 * sizeof(GLuint);
-
- /* Maybe remove the cliprect as well:
- */
- if (vmesa->dmaCliprectAddr == vmesa->dmaLow - 8 * sizeof(GLuint)) {
- vmesa->dmaLow -= 8 * sizeof(GLuint);
- vmesa->dmaCliprectAddr = ~0;
- }
- }
-
- vmesa->renderPrimitive = GL_POLYGON + 1;
- vmesa->hwPrimitive = GL_POLYGON + 1;
- vmesa->dmaLastPrim = 0;
-}
-
-
-/**********************************************************************/
-/* Transition to/from hardware rasterization. */
-/**********************************************************************/
-
-
-void viaFallback(struct via_context *vmesa, GLuint bit, GLboolean mode)
-{
- GLcontext *ctx = vmesa->glCtx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = vmesa->Fallback;
-
- if (mode) {
- vmesa->Fallback |= bit;
- if (oldfallback == 0) {
- VIA_FLUSH_DMA(vmesa);
-
- if (VIA_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "ENTER FALLBACK %x\n", bit);
-
- _swsetup_Wakeup(ctx);
- vmesa->renderIndex = ~0;
- }
- }
- else {
- vmesa->Fallback &= ~bit;
- if (oldfallback == bit) {
- _swrast_flush( ctx );
-
- if (VIA_DEBUG & DEBUG_FALLBACKS)
- fprintf(stderr, "LEAVE FALLBACK %x\n", bit);
-
- tnl->Driver.Render.Start = viaRenderStart;
- tnl->Driver.Render.PrimitiveNotify = viaRenderPrimitive;
- tnl->Driver.Render.Finish = viaRenderFinish;
-
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
- tnl->Driver.Render.ResetLineStipple = viaResetLineStipple;
-
- _tnl_invalidate_vertex_state( ctx, ~0 );
- _tnl_invalidate_vertices( ctx, ~0 );
- _tnl_install_attrs( ctx,
- vmesa->vertex_attrs,
- vmesa->vertex_attr_count,
- vmesa->ViewportMatrix.m, 0 );
-
- vmesa->newState |= (_VIA_NEW_RENDERSTATE|_VIA_NEW_VERTEX);
- }
- }
-}
-
-static void viaRunPipeline( GLcontext *ctx )
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
-
- if (vmesa->newState) {
- vmesa->newRenderState |= vmesa->newState;
- viaValidateState( ctx );
- }
-
- _tnl_run_pipeline( ctx );
-}
-
-
-/**********************************************************************/
-/* Initialization. */
-/**********************************************************************/
-
-
-void viaInitTriFuncs(GLcontext *ctx)
-{
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = viaRunPipeline;
- tnl->Driver.Render.Start = viaRenderStart;
- tnl->Driver.Render.Finish = viaRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = viaRenderPrimitive;
- tnl->Driver.Render.ResetLineStipple = viaResetLineStipple;
- tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
- tnl->Driver.Render.CopyPV = _tnl_copy_pv;
- tnl->Driver.Render.Interp = _tnl_interp;
-
- _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
- (6 + 2*ctx->Const.MaxTextureUnits) * sizeof(GLfloat) );
-
- vmesa->verts = (GLubyte *)tnl->clipspace.vertex_buf;
-
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.h
deleted file mode 100644
index b4f0880a7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/unichrome/via_tris.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, 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
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIATRIS_H
-#define _VIATRIS_H
-
-#include "mtypes.h"
-
-extern void viaPrintRenderState(const char *msg, GLuint state);
-extern void viaInitTriFuncs(GLcontext *ctx);
-extern void viaRasterPrimitive(GLcontext *ctx, GLenum rPrim, GLuint hwPrim);
-extern void viaRasterPrimitiveFinish(GLcontext *ctx);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/Makefile b/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/Makefile
deleted file mode 100644
index c7dd15209..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-# src/mesa/drivers/dri/x11/Makefile
-
-TOP = ../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = x11_dri.so
-
-DRIVER_SOURCES = x11_dri.c \
- $(TOP)/src/mesa/drivers/common/driverfuncs.c \
- ../common/dri_util.c \
- ../../x11/xm_api.c \
- ../../x11/xm_dd.c \
- ../../x11/xm_line.c \
- ../../x11/xm_span.c \
- ../../x11/xm_tri.c
-
-C_SOURCES = \
- $(DRIVER_SOURCES) \
- $(DRI_SOURCES)
-
-
-# Include directories
-INCLUDE_DIRS = \
- -I. \
- -I../common \
- -I../../x11 \
- -I../dri_client \
- -I../dri_client/imports \
- -Iserver \
- -I$(TOP)/include \
- -I$(DRM_SOURCE_PATH)/shared-core \
- -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
-
-# Core Mesa objects
-MESA_MODULES = $(TOP)/src/mesa/mesa.a
-
-# Libraries that the driver shared lib depends on
-LIB_DEPS = -lm -lpthread -lc
-# LIB_DEPS = -lGL -lm -lpthread -lc
-
-
-ASM_SOURCES =
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o)
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend $(LIB_DIR)/$(LIBNAME)
-
-
-$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
- CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
- $(OBJECTS) $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES)
-
-
-depend: $(C_SOURCES) $(ASM_SOURCES)
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
- > /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-clean:
- -rm -f *.o server/*.o
-
-
-include depend
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.c
deleted file mode 100644
index f414b7e42..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 0.1
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/* Minimal swrast-based DRI-loadable driver.
- *
- * Derived from fb_dri.c, the difference being that one works for
- * framebuffers without X, whereas this points Mesa at an X surface
- * to draw on.
- *
- * This is basically just a wrapper around src/mesa/drivers/x11 to make it
- * look like a DRI driver.
- */
-
-#define GLX_DIRECT_RENDERING
-
-#include <assert.h>
-#include <errno.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
-
-#include "dri_util.h"
-
-#include "GL/xmesa.h"
-#include "xmesaP.h"
-
-#include "mtypes.h"
-#include "context.h"
-#include "extensions.h"
-#include "imports.h"
-#include "matrix.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "drivers/common/driverfuncs.h"
-
-#include "x11_dri.h"
-
-typedef struct {
- GLcontext *glCtx; /* Mesa context */
-
- struct {
- __DRIcontextPrivate *context;
- __DRIscreenPrivate *screen;
- __DRIdrawablePrivate *drawable; /* drawable bound to this ctx */
- } dri;
-} x11Context, *x11ContextPtr;
-
-#define X11_CONTEXT(ctx) ((x11ContextPtr)(ctx->DriverCtx))
-
-static const GLubyte *
-get_string(GLcontext *ctx, GLenum pname)
-{
- (void) ctx;
- switch (pname) {
- case GL_RENDERER:
- return (const GLubyte *) "Mesa X11 hack";
- default:
- return NULL;
- }
-}
-
-static void
-update_state(GLcontext *ctx, GLuint new_state)
-{
- /* not much to do here - pass it on */
- _swrast_InvalidateState(ctx, new_state);
- _swsetup_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
- _tnl_InvalidateState(ctx, new_state);
-}
-
-/**
- * Called by ctx->Driver.GetBufferSize from in core Mesa to query the
- * current framebuffer size.
- */
-static void
-get_buffer_size(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- x11ContextPtr x11mesa = X11_CONTEXT(ctx);
-
- *width = x11mesa->dri.drawable->w;
- *height = x11mesa->dri.drawable->h;
-}
-
-static void
-init_core_functions(struct dd_function_table *functions)
-{
- functions->GetString = get_string;
- functions->UpdateState = update_state;
- functions->ResizeBuffers = _swrast_alloc_buffers;
- functions->GetBufferSize = get_buffer_size;
-
- functions->Clear = _swrast_Clear; /* could accelerate with blits */
-}
-
-/* Initialize the driver specific screen private data.
- */
-static GLboolean
-x11InitDriver(__DRIscreenPrivate *sPriv)
-{
- sPriv->private = NULL;
- return GL_TRUE;
-}
-
-static void
-x11DestroyScreen(__DRIscreenPrivate *sPriv)
-{
-}
-
-/* placeholders, disables rendering */
-static void
-nullwrite(void *a, int b, int c, int d, void *e, void *f)
-{
-}
-
-static void
-set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
-{
-}
-
-/* Create the device specific context. */
-static GLboolean
-x11CreateContext(const __GLcontextModes *glVisual,
- __DRIcontextPrivate *driContextPriv,
- void *sharedContextPrivate)
-{
- x11ContextPtr x11mesa;
- GLcontext *ctx, *shareCtx;
- struct dd_function_table functions;
-
- assert(glVisual);
- assert(driContextPriv);
-
- /* Allocate the Fb context */
- x11mesa = (x11ContextPtr) CALLOC(sizeof(*x11mesa));
- if (!x11mesa)
- return GL_FALSE;
-
- /* Init default driver functions then plug in our own functions */
- _mesa_init_driver_functions(&functions);
- init_core_functions(&functions);
-
- /* Allocate the Mesa context */
- if (sharedContextPrivate)
- shareCtx = ((x11ContextPtr) sharedContextPrivate)->glCtx;
- else
- shareCtx = NULL;
-
- ctx = x11mesa->glCtx = _mesa_create_context(glVisual, shareCtx,
- &functions, (void *) x11mesa);
- if (!x11mesa->glCtx) {
- FREE(x11mesa);
- return GL_FALSE;
- }
- driContextPriv->driverPrivate = x11mesa;
-
- /* Create module contexts */
- _swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
- _tnl_CreateContext(ctx);
- _swsetup_CreateContext(ctx);
- _swsetup_Wakeup(ctx);
-
- /* swrast init */
- {
- struct swrast_device_driver *swdd;
- swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetBuffer = set_buffer;
- if (!glVisual->rgbMode) {
- swdd->WriteCI32Span =
- swdd->WriteCI32Span =
- swdd->WriteCI8Span =
- swdd->WriteMonoCISpan =
- swdd->WriteCI32Pixels =
- swdd->WriteMonoCIPixels =
- swdd->ReadCI32Span =
- swdd->ReadCI32Pixels = nullwrite;
- }
- else if (glVisual->rgbBits == 24 &&
- glVisual->alphaBits == 0) {
- swdd->WriteRGBASpan =
- swdd->WriteRGBSpan =
- swdd->WriteMonoRGBASpan =
- swdd->WriteRGBAPixels =
- swdd->WriteMonoRGBAPixels =
- swdd->ReadRGBASpan =
- swdd->ReadRGBAPixels = nullwrite;
- }
- else if (glVisual->rgbBits == 32 &&
- glVisual->alphaBits == 8) {
- swdd->WriteRGBASpan =
- swdd->WriteRGBSpan =
- swdd->WriteMonoRGBASpan =
- swdd->WriteRGBAPixels =
- swdd->WriteMonoRGBAPixels =
- swdd->ReadRGBASpan =
- swdd->ReadRGBAPixels = nullwrite;
- }
- else if (glVisual->rgbBits == 16 &&
- glVisual->alphaBits == 0) {
- swdd->WriteRGBASpan =
- swdd->WriteRGBSpan =
- swdd->WriteMonoRGBASpan =
- swdd->WriteRGBAPixels =
- swdd->WriteMonoRGBAPixels =
- swdd->ReadRGBASpan =
- swdd->ReadRGBAPixels = nullwrite;
- }
- else if (glVisual->rgbBits == 15 &&
- glVisual->alphaBits == 0) {
- swdd->WriteRGBASpan =
- swdd->WriteRGBSpan =
- swdd->WriteMonoRGBASpan =
- swdd->WriteRGBAPixels =
- swdd->WriteMonoRGBAPixels =
- swdd->ReadRGBASpan =
- swdd->ReadRGBAPixels = nullwrite;
- }
- else {
- _mesa_printf("bad pixelformat rgb %d alpha %d\n",
- glVisual->rgbBits,
- glVisual->alphaBits );
- }
- }
-
- /* use default TCL pipeline */
- {
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- }
-
- _mesa_enable_sw_extensions(ctx);
-
- return GL_TRUE;
-}
-
-
-static void
-x11DestroyContext(__DRIcontextPrivate *driContextPriv)
-{
- GET_CURRENT_CONTEXT(ctx);
- x11ContextPtr x11mesa = (x11ContextPtr) driContextPriv->driverPrivate;
- x11ContextPtr current = ctx ? X11_CONTEXT(ctx) : NULL;
-
- /* check if we're deleting the currently bound context */
- if (x11mesa == current) {
- _mesa_make_current2(NULL, NULL, NULL);
- }
-
- /* Free x11 context resources */
- if (x11mesa) {
- _swsetup_DestroyContext(x11mesa->glCtx);
- _tnl_DestroyContext(x11mesa->glCtx);
- _ac_DestroyContext(x11mesa->glCtx);
- _swrast_DestroyContext(x11mesa->glCtx);
-
- /* free the Mesa context */
- x11mesa->glCtx->DriverCtx = NULL;
- _mesa_destroy_context(x11mesa->glCtx);
-
- FREE(x11mesa);
- }
-}
-
-
-/* Create and initialize the Mesa and driver specific pixmap buffer
- * data.
- */
-static GLboolean
-x11CreateBuffer(__DRIscreenPrivate *driScrnPriv,
- __DRIdrawablePrivate *driDrawPriv,
- const __GLcontextModes *mesaVis,
- GLboolean isPixmap)
-{
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- const GLboolean swDepth = mesaVis->depthBits > 0;
- const GLboolean swAlpha = mesaVis->alphaBits > 0;
- const GLboolean swAccum = mesaVis->accumRedBits > 0;
- const GLboolean swStencil = mesaVis->stencilBits > 0;
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- swDepth,
- swStencil,
- swAccum,
- swAlpha);
-
- if (!driDrawPriv->driverPrivate)
- return 0;
-
- /* Replace the framebuffer back buffer with a malloc'ed one --
- * big speedup.
- */
-/*
- if (driDrawPriv->backBuffer)
- driDrawPriv->backBuffer = malloc(driDrawPriv->currentPitch * driDrawPriv->h);
-*/
-
- return 1;
- }
-}
-
-
-static void
-x11DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
-{
- _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
-/* free(driDrawPriv->backBuffer); */
-}
-
-
-
-/* If the backbuffer is on a videocard, this is extraordinarily slow!
- */
-static void
-x11SwapBuffers(__DRIdrawablePrivate *dPriv)
-{
-
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- x11ContextPtr x11mesa;
- GLcontext *ctx;
- x11mesa = (x11ContextPtr) dPriv->driContextPriv->driverPrivate;
- ctx = x11mesa->glCtx;
- if (ctx->Visual.doubleBufferMode) {
- int i;
- int offset = 0;
- char *tmp /*= malloc(dPriv->currentPitch) */ ;
-
- _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
-
-/*
- ASSERT(dPriv->frontBuffer);
- ASSERT(dPriv->backBuffer);
-
- for (i = 0 ; i < dPriv->h ; i++ ) {
- memcpy(tmp, (char *)dPriv->frontBuffer + offset, dPriv->currentPitch);
- memcpy((char *)dPriv->backBuffer + offset, tmp, dPriv->currentPitch);
- offset += dPriv->currentPitch;
- }
-
- free(tmp);
-*/
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- _mesa_problem(NULL, "x11SwapBuffers: drawable has no context!\n");
- }
-}
-
-
-/* Force the context `c' to be the current context and associate with it
- * buffer `b'.
- */
-static GLboolean
-x11MakeCurrent(__DRIcontextPrivate *driContextPriv,
- __DRIdrawablePrivate *driDrawPriv,
- __DRIdrawablePrivate *driReadPriv)
-{
- if (driContextPriv) {
- x11ContextPtr newFbCtx =
- (x11ContextPtr) driContextPriv->driverPrivate;
-
- newFbCtx->dri.drawable = driDrawPriv;
-
- _mesa_make_current2(newFbCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
- } else {
- _mesa_make_current(0, 0);
- }
-
- return GL_TRUE;
-}
-
-
-/* Force the context `c' to be unbound from its buffer.
- */
-static GLboolean
-x11UnbindContext(__DRIcontextPrivate *driContextPriv)
-{
- return GL_TRUE;
-}
-
-static struct __DriverAPIRec x11API = {
- x11InitDriver,
- x11DestroyScreen,
- x11CreateContext,
- x11DestroyContext,
- x11CreateBuffer,
- x11DestroyBuffer,
- x11SwapBuffers,
- x11MakeCurrent,
- x11UnbindContext
-};
-
-/*
- * This is the bootstrap function for the driver.
- * The __driCreateScreen name is the symbol that libGL.so fetches.
- * Return: pointer to a __DRIscreenPrivate.
- */
-void *
-__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config)
-{
- __DRIscreenPrivate *psp;
- psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &x11API);
- return (void *) psp;
-}
-
-/**
- * \brief Establish the set of modes available for the display.
- *
- * \param ctx display handle.
- * \param numModes will receive the number of supported modes.
- * \param modes will point to the list of supported modes.
- *
- * \return one on success, or zero on failure.
- *
- * Allocates a single visual and fills it with information according to the
- * display bit depth. Supports only 16 and 32 bpp bit depths, aborting
- * otherwise.
- */
-const __GLcontextModes __glModes[] = {
- /* 32 bit, RGBA Depth=24 Stencil=8 */
- {.rgbMode = GL_TRUE, .colorIndexMode = GL_FALSE, .doubleBufferMode = GL_TRUE, .stereoMode = GL_FALSE,
- .haveAccumBuffer = GL_FALSE, .haveDepthBuffer = GL_TRUE, .haveStencilBuffer = GL_TRUE,
- .redBits = 8, .greenBits = 8, .blueBits = 8, .alphaBits = 8,
- .redMask = 0xff0000, .greenMask = 0xff00, .blueMask = 0xff, .alphaMask = 0xff000000,
- .rgbBits = 32, .indexBits = 0,
- .accumRedBits = 0, .accumGreenBits = 0, .accumBlueBits = 0, .accumAlphaBits = 0,
- .depthBits = 24, .stencilBits = 8,
- .numAuxBuffers= 0, .level = 0, .pixmapMode = GL_FALSE, },
-
- /* 16 bit, RGB Depth=16 */
- {.rgbMode = GL_TRUE, .colorIndexMode = GL_FALSE, .doubleBufferMode = GL_TRUE, .stereoMode = GL_FALSE,
- .haveAccumBuffer = GL_FALSE, .haveDepthBuffer = GL_TRUE, .haveStencilBuffer = GL_FALSE,
- .redBits = 5, .greenBits = 6, .blueBits = 5, .alphaBits = 0,
- .redMask = 0xf800, .greenMask = 0x07e0, .blueMask = 0x001f, .alphaMask = 0x0,
- .rgbBits = 16, .indexBits = 0,
- .accumRedBits = 0, .accumGreenBits = 0, .accumBlueBits = 0, .accumAlphaBits = 0,
- .depthBits = 16, .stencilBits = 0,
- .numAuxBuffers= 0, .level = 0, .pixmapMode = GL_FALSE, },
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.h b/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.h
deleted file mode 100644
index fd1e64f45..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/x11/x11_dri.h
+++ /dev/null
@@ -1,12 +0,0 @@
-typedef struct {
-
- void *frontBuffer;
- void *backBuffer;
- void *currentBuffer;
- int currentPitch;
-
- int depthCpp;
- void *depthBuffer;
- int depthPitch;
-
-} x11ScreenPrivate;
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/fbdev/glfbdev.c b/nx-X11/extras/Mesa/src/mesa/drivers/fbdev/glfbdev.c
deleted file mode 100644
index c8d9375b6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/fbdev/glfbdev.c
+++ /dev/null
@@ -1,861 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * OpenGL (Mesa) interface for fbdev.
- * For info about fbdev:
- * http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html
- *
- * known VGA modes
- * Colours 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
- * --------+--------------------------------------------------------------
- * 4 bits | ? ? 0x302 ? ? ? ?
- * 8 bits | 0x300 0x301 0x303 0x305 0x161 0x307 0x31C
- * 15 bits | ? 0x310 0x313 0x316 0x162 0x319 0x31D
- * 16 bits | ? 0x311 0x314 0x317 0x163 0x31A 0x31E
- * 24 bits | ? 0x312 0x315 0x318 ? 0x31B 0x31F
- * 32 bits | ? ? ? ? 0x164 ?
- */
-#ifdef USE_GLFBDEV_DRIVER
-
-#include "glheader.h"
-#include <linux/fb.h>
-#include "GL/glfbdev.h"
-#include "buffers.h"
-#include "context.h"
-#include "extensions.h"
-#include "fbobject.h"
-#include "framebuffer.h"
-#include "imports.h"
-#include "renderbuffer.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "drivers/common/driverfuncs.h"
-
-
-#define PF_B8G8R8 1
-#define PF_B8G8R8A8 2
-#define PF_B5G6R5 3
-#define PF_B5G5R5 4
-#define PF_CI8 5
-
-
-/*
- * Derived from Mesa's GLvisual class.
- */
-struct GLFBDevVisualRec {
- GLvisual glvisual; /* base class */
- struct fb_fix_screeninfo fix;
- struct fb_var_screeninfo var;
- int pixelFormat;
-};
-
-/*
- * Derived from Mesa's GLframebuffer class.
- */
-struct GLFBDevBufferRec {
- GLframebuffer glframebuffer; /* base class */
- GLFBDevVisualPtr visual;
- struct fb_fix_screeninfo fix;
- struct fb_var_screeninfo var;
- size_t size; /* color buffer size in bytes */
- GLuint bytesPerPixel;
-};
-
-/*
- * Derived from Mesa's GLcontext class.
- */
-struct GLFBDevContextRec {
- GLcontext glcontext; /* base class */
- GLFBDevVisualPtr visual;
- GLFBDevBufferPtr drawBuffer;
- GLFBDevBufferPtr readBuffer;
- GLFBDevBufferPtr curBuffer;
-};
-
-/*
- * Derived from Mesa's gl_renderbuffer class.
- */
-struct GLFBDevRenderbufferRec {
- struct gl_renderbuffer Base;
- GLubyte *bottom; /* pointer to last row */
- GLuint rowStride; /* in bytes */
- GLboolean mallocedBuffer;
-};
-
-
-
-#define GLFBDEV_CONTEXT(CTX) ((GLFBDevContextPtr) (CTX))
-#define GLFBDEV_BUFFER(BUF) ((GLFBDevBufferPtr) (BUF))
-
-
-/**********************************************************************/
-/* Internal device driver functions */
-/**********************************************************************/
-
-
-static const GLubyte *
-get_string(GLcontext *ctx, GLenum pname)
-{
- (void) ctx;
- switch (pname) {
- case GL_RENDERER:
- return (const GLubyte *) "Mesa glfbdev";
- default:
- return NULL;
- }
-}
-
-
-static void
-update_state( GLcontext *ctx, GLuint new_state )
-{
- /* not much to do here - pass it on */
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-
-static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
- const GLFBDevBufferPtr fbdevbuffer = GLFBDEV_BUFFER(buffer);
- *width = fbdevbuffer->var.xres_virtual;
- *height = fbdevbuffer->var.yres_virtual;
-}
-
-
-static void
-viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- /* poll for window size change and realloc software Z/stencil/etc if needed */
- _mesa_ResizeBuffersMESA();
-}
-
-
-/* specifies the buffer for swrast span rendering/reading */
-static void
-set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
-{
- /* this is a no-op when using the new gl_renderbuffer span functions. */
-}
-
-
-/*
- * Generate code for span functions.
- */
-
-/* 24-bit BGR */
-#define NAME(PREFIX) PREFIX##_B8G8R8
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) * 3
-#define INC_PIXEL_PTR(P) P += 3
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = VALUE[BCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[RCOMP]
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[2]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[0]; \
- DST[ACOMP] = CHAN_MAX
-
-#include "swrast/s_spantemp2.h"
-
-
-/* 32-bit BGRA */
-#define NAME(PREFIX) PREFIX##_B8G8R8A8
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) * 4
-#define INC_PIXEL_PTR(P) P += 4
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = VALUE[BCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[RCOMP]; \
- DST[3] = VALUE[ACOMP]
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[2]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[0]; \
- DST[ACOMP] = SRC[3]
-
-#include "swrast/s_spantemp2.h"
-
-
-/* 16-bit BGR (XXX implement dithering someday) */
-#define NAME(PREFIX) PREFIX##_B5G6R5
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) (frb->bottom - (Y) * frb->rowStride + (X) * 2)
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) )
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = ( (((SRC[0]) >> 8) & 0xf8) | (((SRC[0]) >> 11) & 0x7) ); \
- DST[GCOMP] = ( (((SRC[0]) >> 3) & 0xfc) | (((SRC[0]) >> 5) & 0x3) ); \
- DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \
- DST[ACOMP] = CHAN_MAX
-
-#include "swrast/s_spantemp2.h"
-
-
-/* 15-bit BGR (XXX implement dithering someday) */
-#define NAME(PREFIX) PREFIX##_B5G5R5
-#define FORMAT GL_RGBA8
-#define SPAN_VARS \
- struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) (frb->bottom - (Y) * frb->rowStride + (X) * 2)
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 7) | (((VALUE[GCOMP]) & 0xf8) << 2) | ((VALUE[BCOMP]) >> 3) )
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = ( (((SRC[0]) >> 7) & 0xf8) | (((SRC[0]) >> 10) & 0x7) ); \
- DST[GCOMP] = ( (((SRC[0]) >> 2) & 0xf8) | (((SRC[0]) >> 5) & 0x7) ); \
- DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \
- DST[ACOMP] = CHAN_MAX
-
-#include "swrast/s_spantemp2.h"
-
-
-/* 8-bit color index */
-#define NAME(PREFIX) PREFIX##_CI8
-#define FORMAT GL_COLOR_INDEX8_EXT
-#define SPAN_VARS \
- struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X)
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- *DST = VALUE[0]
-#define FETCH_PIXEL(DST, SRC) \
- DST = SRC[0]
-
-#include "swrast/s_spantemp2.h"
-
-
-
-
-/**********************************************************************/
-/* Public API functions */
-/**********************************************************************/
-
-
-const char *
-glFBDevGetString( int str )
-{
- switch (str) {
- case GLFBDEV_VENDOR:
- return "Mesa Project";
- case GLFBDEV_VERSION:
- return "1.0.0";
- default:
- return NULL;
- }
-}
-
-
-const GLFBDevProc
-glFBDevGetProcAddress( const char *procName )
-{
- struct name_address {
- const char *name;
- const GLFBDevProc func;
- };
- static const struct name_address functions[] = {
- { "glFBDevGetString", (GLFBDevProc) glFBDevGetString },
- { "glFBDevGetProcAddress", (GLFBDevProc) glFBDevGetProcAddress },
- { "glFBDevCreateVisual", (GLFBDevProc) glFBDevCreateVisual },
- { "glFBDevDestroyVisual", (GLFBDevProc) glFBDevDestroyVisual },
- { "glFBDevGetVisualAttrib", (GLFBDevProc) glFBDevGetVisualAttrib },
- { "glFBDevCreateBuffer", (GLFBDevProc) glFBDevCreateBuffer },
- { "glFBDevDestroyBuffer", (GLFBDevProc) glFBDevDestroyBuffer },
- { "glFBDevGetBufferAttrib", (GLFBDevProc) glFBDevGetBufferAttrib },
- { "glFBDevGetCurrentDrawBuffer", (GLFBDevProc) glFBDevGetCurrentDrawBuffer },
- { "glFBDevGetCurrentReadBuffer", (GLFBDevProc) glFBDevGetCurrentReadBuffer },
- { "glFBDevSwapBuffers", (GLFBDevProc) glFBDevSwapBuffers },
- { "glFBDevCreateContext", (GLFBDevProc) glFBDevCreateContext },
- { "glFBDevDestroyContext", (GLFBDevProc) glFBDevDestroyContext },
- { "glFBDevGetContextAttrib", (GLFBDevProc) glFBDevGetContextAttrib },
- { "glFBDevGetCurrentContext", (GLFBDevProc) glFBDevGetCurrentContext },
- { "glFBDevMakeCurrent", (GLFBDevProc) glFBDevMakeCurrent },
- { NULL, NULL }
- };
- const struct name_address *entry;
- for (entry = functions; entry->name; entry++) {
- if (_mesa_strcmp(entry->name, procName) == 0) {
- return entry->func;
- }
- }
- return _glapi_get_proc_address(procName);
-}
-
-
-GLFBDevVisualPtr
-glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
- const struct fb_var_screeninfo *varInfo,
- const int *attribs )
-{
- GLFBDevVisualPtr vis;
- const int *attrib;
- GLboolean rgbFlag = GL_TRUE, dbFlag = GL_FALSE, stereoFlag = GL_FALSE;
- GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0;
- GLint indexBits = 0, depthBits = 0, stencilBits = 0;
- GLint accumRedBits = 0, accumGreenBits = 0;
- GLint accumBlueBits = 0, accumAlphaBits = 0;
- GLint numSamples = 0;
-
- ASSERT(fixInfo);
- ASSERT(varInfo);
-
- vis = CALLOC_STRUCT(GLFBDevVisualRec);
- if (!vis)
- return NULL;
-
- vis->fix = *fixInfo; /* struct assignment */
- vis->var = *varInfo; /* struct assignment */
-
- for (attrib = attribs; attrib && *attrib != GLFBDEV_NONE; attrib++) {
- switch (*attrib) {
- case GLFBDEV_DOUBLE_BUFFER:
- dbFlag = GL_TRUE;
- break;
- case GLFBDEV_COLOR_INDEX:
- rgbFlag = GL_FALSE;
- break;
- case GLFBDEV_DEPTH_SIZE:
- depthBits = attrib[1];
- attrib++;
- break;
- case GLFBDEV_STENCIL_SIZE:
- stencilBits = attrib[1];
- attrib++;
- break;
- case GLFBDEV_ACCUM_SIZE:
- accumRedBits = accumGreenBits = accumBlueBits = accumAlphaBits
- = attrib[1];
- attrib++;
- break;
- case GLFBDEV_LEVEL:
- /* ignored for now */
- break;
- default:
- /* unexpected token */
- _mesa_free(vis);
- return NULL;
- }
- }
-
- if (rgbFlag) {
- redBits = varInfo->red.length;
- greenBits = varInfo->green.length;
- blueBits = varInfo->blue.length;
- alphaBits = varInfo->transp.length;
-
- if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 24
- && varInfo->red.offset == 16
- && varInfo->green.offset == 8
- && varInfo->blue.offset == 0) {
- vis->pixelFormat = PF_B8G8R8;
- }
- else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 32
- && varInfo->red.offset == 16
- && varInfo->green.offset == 8
- && varInfo->blue.offset == 0
- && varInfo->transp.offset == 24) {
- vis->pixelFormat = PF_B8G8R8A8;
- }
- else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 16
- && varInfo->red.offset == 11
- && varInfo->green.offset == 5
- && varInfo->blue.offset == 0) {
- vis->pixelFormat = PF_B5G6R5;
- }
- else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 16
- && varInfo->red.offset == 10
- && varInfo->green.offset == 5
- && varInfo->blue.offset == 0) {
- vis->pixelFormat = PF_B5G5R5;
- }
- else {
- _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n");
- /*
- printf("fixInfo->visual = 0x%x\n", fixInfo->visual);
- printf("varInfo->bits_per_pixel = %d\n", varInfo->bits_per_pixel);
- printf("varInfo->red.offset = %d\n", varInfo->red.offset);
- printf("varInfo->green.offset = %d\n", varInfo->green.offset);
- printf("varInfo->blue.offset = %d\n", varInfo->blue.offset);
- */
- _mesa_free(vis);
- return NULL;
- }
- }
- else {
- indexBits = varInfo->bits_per_pixel;
- if ((fixInfo->visual == FB_VISUAL_PSEUDOCOLOR ||
- fixInfo->visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
- && varInfo->bits_per_pixel == 8) {
- vis->pixelFormat = PF_CI8;
- }
- else {
- _mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n");
- _mesa_free(vis);
- return NULL;
- }
- }
-
- if (!_mesa_initialize_visual(&vis->glvisual, rgbFlag, dbFlag, stereoFlag,
- redBits, greenBits, blueBits, alphaBits,
- indexBits, depthBits, stencilBits,
- accumRedBits, accumGreenBits,
- accumBlueBits, accumAlphaBits,
- numSamples)) {
- /* something was invalid */
- _mesa_free(vis);
- return NULL;
- }
-
- return vis;
-}
-
-
-void
-glFBDevDestroyVisual( GLFBDevVisualPtr visual )
-{
- if (visual)
- _mesa_free(visual);
-}
-
-
-int
-glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib)
-{
- /* XXX unfinished */
- (void) visual;
- (void) attrib;
- return -1;
-}
-
-
-static void
-delete_renderbuffer(struct gl_renderbuffer *rb)
-{
- struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
- if (frb->mallocedBuffer) {
- _mesa_free(frb->Base.Data);
- }
- _mesa_free(frb);
-}
-
-
-static GLboolean
-renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- /* no-op: the renderbuffer storage is allocated just once when it's
- * created. Never resized or reallocated.
- */
- return GL_TRUE;
-}
-
-
-static struct GLFBDevRenderbufferRec *
-new_glfbdev_renderbuffer(void *bufferStart, int pixelFormat)
-{
- struct GLFBDevRenderbufferRec *rb = CALLOC_STRUCT(GLFBDevRenderbufferRec);
- if (rb) {
- GLuint name = 0;
- _mesa_init_renderbuffer(&rb->Base, name);
-
- rb->Base.Delete = delete_renderbuffer;
- rb->Base.AllocStorage = renderbuffer_storage;
-
- if (pixelFormat == PF_B8G8R8) {
- rb->Base.GetRow = get_row_B8G8R8;
- rb->Base.GetValues = get_values_B8G8R8;
- rb->Base.PutRow = put_row_B8G8R8;
- rb->Base.PutMonoRow = put_mono_row_B8G8R8;
- rb->Base.PutValues = put_values_B8G8R8;
- rb->Base.PutMonoValues = put_mono_values_B8G8R8;
- }
- else if (pixelFormat == PF_B8G8R8A8) {
- rb->Base.GetRow = get_row_B8G8R8A8;
- rb->Base.GetValues = get_values_B8G8R8A8;
- rb->Base.PutRow = put_row_B8G8R8A8;
- rb->Base.PutMonoRow = put_mono_row_B8G8R8A8;
- rb->Base.PutValues = put_values_B8G8R8A8;
- rb->Base.PutMonoValues = put_mono_values_B8G8R8A8;
- }
- else if (pixelFormat == PF_B5G6R5) {
- rb->Base.GetRow = get_row_B5G6R5;
- rb->Base.GetValues = get_values_B5G6R5;
- rb->Base.PutRow = put_row_B5G6R5;
- rb->Base.PutMonoRow = put_mono_row_B5G6R5;
- rb->Base.PutValues = put_values_B5G6R5;
- rb->Base.PutMonoValues = put_mono_values_B5G6R5;
- }
- else if (pixelFormat == PF_B5G5R5) {
- rb->Base.GetRow = get_row_B5G5R5;
- rb->Base.GetValues = get_values_B5G5R5;
- rb->Base.PutRow = put_row_B5G5R5;
- rb->Base.PutMonoRow = put_mono_row_B5G5R5;
- rb->Base.PutValues = put_values_B5G5R5;
- rb->Base.PutMonoValues = put_mono_values_B5G5R5;
- }
- else if (pixelFormat == PF_CI8) {
- rb->Base.GetRow = get_row_CI8;
- rb->Base.GetValues = get_values_CI8;
- rb->Base.PutRow = put_row_CI8;
- rb->Base.PutMonoRow = put_mono_row_CI8;
- rb->Base.PutValues = put_values_CI8;
- rb->Base.PutMonoValues = put_mono_values_CI8;
- }
-
- if (pixelFormat == PF_CI8) {
- rb->Base.InternalFormat = GL_COLOR_INDEX8_EXT;
- rb->Base._BaseFormat = GL_COLOR_INDEX;
- }
- else {
- rb->Base.InternalFormat = GL_RGBA;
- rb->Base._BaseFormat = GL_RGBA;
- }
- rb->Base.DataType = GL_UNSIGNED_BYTE;
- rb->Base.Data = bufferStart;
- }
- return rb;
-}
-
-
-GLFBDevBufferPtr
-glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
- const struct fb_var_screeninfo *varInfo,
- const GLFBDevVisualPtr visual,
- void *frontBuffer, void *backBuffer, size_t size )
-{
- struct GLFBDevRenderbufferRec *frontrb, *backrb;
- GLFBDevBufferPtr buf;
-
- ASSERT(visual);
- ASSERT(frontBuffer);
- ASSERT(size > 0);
-
- if (visual->fix.visual != fixInfo->visual ||
- visual->fix.type != fixInfo->type ||
- visual->var.bits_per_pixel != varInfo->bits_per_pixel ||
- visual->var.grayscale != varInfo->grayscale ||
- visual->var.red.offset != varInfo->red.offset ||
- visual->var.green.offset != varInfo->green.offset ||
- visual->var.blue.offset != varInfo->blue.offset ||
- visual->var.transp.offset != varInfo->transp.offset) {
- /* visual mismatch! */
- return NULL;
- }
-
- buf = CALLOC_STRUCT(GLFBDevBufferRec);
- if (!buf)
- return NULL;
-
- /* basic framebuffer setup */
- _mesa_initialize_framebuffer(&buf->glframebuffer, &visual->glvisual);
- /* add front renderbuffer */
- frontrb = new_glfbdev_renderbuffer(frontBuffer, visual->pixelFormat);
- _mesa_add_renderbuffer(&buf->glframebuffer, BUFFER_FRONT_LEFT,
- &frontrb->Base);
- /* add back renderbuffer */
- if (visual->glvisual.doubleBufferMode) {
- backrb = new_glfbdev_renderbuffer(backBuffer, visual->pixelFormat);
- _mesa_add_renderbuffer(&buf->glframebuffer, BUFFER_BACK_LEFT,
- &backrb->Base);
- }
- /* add software renderbuffers */
- _mesa_add_soft_renderbuffers(&buf->glframebuffer,
- GL_FALSE, /* color */
- visual->glvisual.haveDepthBuffer,
- visual->glvisual.haveStencilBuffer,
- visual->glvisual.haveAccumBuffer,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux bufs */);
-
-
-
- buf->fix = *fixInfo; /* struct assignment */
- buf->var = *varInfo; /* struct assignment */
- buf->visual = visual; /* ptr assignment */
- buf->size = size;
- buf->bytesPerPixel = visual->var.bits_per_pixel / 8;
- frontrb->rowStride = visual->var.xres_virtual * buf->bytesPerPixel;
- frontrb->bottom = (GLubyte *) frontrb->Base.Data
- + (visual->var.yres_virtual - 1) * frontrb->rowStride;
-
- if (visual->glvisual.doubleBufferMode) {
- if (!backBuffer) {
- /* malloc a back buffer */
- backrb->Base.Data = _mesa_malloc(size);
- if (!backrb->Base.Data) {
- _mesa_free_framebuffer_data(&buf->glframebuffer);
- _mesa_free(buf);
- return NULL;
- }
- backrb->mallocedBuffer = GL_TRUE;
- }
- backrb->rowStride = frontrb->rowStride;
- backrb->bottom = (GLubyte *) backrb->Base.Data
- + (visual->var.yres_virtual - 1) * backrb->rowStride;
- }
- else {
- backrb->bottom = NULL;
- backrb->rowStride = 0;
- }
-
- return buf;
-}
-
-
-void
-glFBDevDestroyBuffer( GLFBDevBufferPtr buffer )
-{
- if (buffer) {
- /* check if destroying the current buffer */
- GLFBDevBufferPtr curDraw = glFBDevGetCurrentDrawBuffer();
- GLFBDevBufferPtr curRead = glFBDevGetCurrentReadBuffer();
- if (buffer == curDraw || buffer == curRead) {
- glFBDevMakeCurrent( NULL, NULL, NULL);
- }
- /* free the software depth, stencil, accum buffers */
- _mesa_free_framebuffer_data(&buffer->glframebuffer);
- _mesa_free(buffer);
- }
-}
-
-
-int
-glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib)
-{
- (void) buffer;
- (void) attrib;
- return -1;
-}
-
-
-GLFBDevBufferPtr
-glFBDevGetCurrentDrawBuffer( void )
-{
- GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
- if (fbdevctx)
- return fbdevctx->drawBuffer;
- else
- return NULL;
-}
-
-
-GLFBDevBufferPtr
-glFBDevGetCurrentReadBuffer( void )
-{
- GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
- if (fbdevctx)
- return fbdevctx->readBuffer;
- else
- return NULL;
-}
-
-
-void
-glFBDevSwapBuffers( GLFBDevBufferPtr buffer )
-{
- GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
- struct GLFBDevRenderbufferRec *frontrb = (struct GLFBDevRenderbufferRec *)
- buffer->glframebuffer.Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
- struct GLFBDevRenderbufferRec *backrb = (struct GLFBDevRenderbufferRec *)
- buffer->glframebuffer.Attachment[BUFFER_BACK_LEFT].Renderbuffer;
-
- if (!buffer || !buffer->visual->glvisual.doubleBufferMode)
- return;
-
- /* check if swapping currently bound buffer */
- if (fbdevctx->drawBuffer == buffer) {
- /* flush pending rendering */
- _mesa_notifySwapBuffers(&fbdevctx->glcontext);
- }
-
- ASSERT(frontrb->Base.Data);
- ASSERT(backrb->Base.Data);
- _mesa_memcpy(frontrb->Base.Data, backrb->Base.Data, buffer->size);
-}
-
-
-GLFBDevContextPtr
-glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share )
-{
- GLFBDevContextPtr ctx;
- GLcontext *glctx;
- struct dd_function_table functions;
-
- ASSERT(visual);
-
- ctx = CALLOC_STRUCT(GLFBDevContextRec);
- if (!ctx)
- return NULL;
-
- /* build table of device driver functions */
- _mesa_init_driver_functions(&functions);
- functions.GetString = get_string;
- functions.UpdateState = update_state;
- functions.GetBufferSize = get_buffer_size;
- functions.Viewport = viewport;
-
- if (!_mesa_initialize_context(&ctx->glcontext, &visual->glvisual,
- share ? &share->glcontext : NULL,
- &functions, (void *) ctx)) {
- _mesa_free(ctx);
- return NULL;
- }
-
- ctx->visual = visual;
-
- /* Create module contexts */
- glctx = (GLcontext *) &ctx->glcontext;
- _swrast_CreateContext( glctx );
- _ac_CreateContext( glctx );
- _tnl_CreateContext( glctx );
- _swsetup_CreateContext( glctx );
- _swsetup_Wakeup( glctx );
-
- /* swrast init */
- {
- struct swrast_device_driver *swdd;
- swdd = _swrast_GetDeviceDriverReference( glctx );
- swdd->SetBuffer = set_buffer;
-
- /* no longer used */
- swdd->WriteRGBASpan = NULL;
- swdd->WriteRGBSpan = NULL;
- swdd->WriteMonoRGBASpan = NULL;
- swdd->WriteRGBAPixels = NULL;
- swdd->WriteMonoRGBAPixels = NULL;
- swdd->ReadRGBASpan = NULL;
- swdd->ReadRGBAPixels = NULL;
- }
-
- /* use default TCL pipeline */
- {
- TNLcontext *tnl = TNL_CONTEXT(glctx);
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- }
-
- _mesa_enable_sw_extensions(glctx);
-
- return ctx;
-}
-
-
-void
-glFBDevDestroyContext( GLFBDevContextPtr context )
-{
- GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
-
- if (context) {
- if (fbdevctx == context) {
- /* destroying current context */
- _mesa_make_current(NULL, NULL, NULL);
- _mesa_notifyDestroy(&context->glcontext);
- }
- _mesa_free_context_data(&context->glcontext);
- _mesa_free(context);
- }
-}
-
-
-int
-glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib)
-{
- (void) context;
- (void) attrib;
- return -1;
-}
-
-
-GLFBDevContextPtr
-glFBDevGetCurrentContext( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- return (GLFBDevContextPtr) ctx;
-}
-
-
-int
-glFBDevMakeCurrent( GLFBDevContextPtr context,
- GLFBDevBufferPtr drawBuffer,
- GLFBDevBufferPtr readBuffer )
-{
- if (context && drawBuffer && readBuffer) {
- /* Make sure the context's visual and the buffers' visuals match.
- * XXX we might do this by comparing specific fields like bits_per_pixel,
- * visual, etc. in the future.
- */
- if (context->visual != drawBuffer->visual ||
- context->visual != readBuffer->visual) {
- return 0;
- }
- _mesa_make_current( &context->glcontext,
- &drawBuffer->glframebuffer,
- &readBuffer->glframebuffer );
- context->drawBuffer = drawBuffer;
- context->readBuffer = readBuffer;
- context->curBuffer = drawBuffer;
- }
- else {
- /* unbind */
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return 1;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxapi.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxapi.c
deleted file mode 100644
index e535e739b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxapi.c
+++ /dev/null
@@ -1,951 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-
-/* fxapi.c - public interface to FX/Mesa functions (fxmesa.h) */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-#include "fxdrv.h"
-
-#include "drivers/common/driverfuncs.h"
-#include "framebuffer.h"
-
-#ifndef TDFX_DEBUG
-int TDFX_DEBUG = (0
-/* | VERBOSE_VARRAY */
-/* | VERBOSE_TEXTURE */
-/* | VERBOSE_IMMEDIATE */
-/* | VERBOSE_PIPELINE */
-/* | VERBOSE_DRIVER */
-/* | VERBOSE_STATE */
-/* | VERBOSE_API */
-/* | VERBOSE_DISPLAY_LIST */
-/* | VERBOSE_LIGHTING */
-/* | VERBOSE_PRIMS */
-/* | VERBOSE_VERTS */
- );
-#endif
-
-static fxMesaContext fxMesaCurrentCtx = NULL;
-
-/*
- * Status of 3Dfx hardware initialization
- */
-
-static int glbGlideInitialized = 0;
-static int glb3DfxPresent = 0;
-static int glbTotNumCtx = 0;
-
-static GrHwConfiguration glbHWConfig;
-static int glbCurrentBoard = 0;
-
-
-#if defined(__WIN32__)
-static int
-cleangraphics(void)
-{
- glbTotNumCtx = 1;
- fxMesaDestroyContext(fxMesaCurrentCtx);
-
- return 0;
-}
-#elif defined(__linux__)
-static void
-cleangraphics(void)
-{
- glbTotNumCtx = 1;
- fxMesaDestroyContext(fxMesaCurrentCtx);
-}
-
-static void
-cleangraphics_handler(int s)
-{
- fprintf(stderr, "fxmesa: ERROR: received a not handled signal %d\n", s);
-
- cleangraphics();
-/* abort(); */
- exit(1);
-}
-#endif
-
-
-/*
- * Query 3Dfx hardware presence/kind
- */
-static GLboolean GLAPIENTRY fxQueryHardware (void)
-{
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxQueryHardware()\n");
- }
-
- if (!glbGlideInitialized) {
- grGlideInit();
- glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig);
-
- glbGlideInitialized = 1;
-
-#if defined(__WIN32__)
- _onexit((_onexit_t) cleangraphics);
-#elif defined(__linux__)
- /* Only register handler if environment variable is not defined. */
- if (!getenv("MESA_FX_NO_SIGNALS")) {
- atexit(cleangraphics);
- }
-#endif
- }
-
- return glb3DfxPresent;
-}
-
-
-/*
- * Select the Voodoo board to use when creating
- * a new context.
- */
-GLint GLAPIENTRY fxMesaSelectCurrentBoard (int n)
-{
- fxQueryHardware();
-
- if ((n < 0) || (n >= glbHWConfig.num_sst))
- return -1;
-
- return glbHWConfig.SSTs[glbCurrentBoard = n].type;
-}
-
-
-fxMesaContext GLAPIENTRY fxMesaGetCurrentContext (void)
-{
- return fxMesaCurrentCtx;
-}
-
-
-void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h)
-{
- GLint width = 0;
- GLint height = 0;
-
- if (fxMesaCurrentCtx != NULL) {
- width = fxMesaCurrentCtx->screen_width;
- height = fxMesaCurrentCtx->screen_height;
- }
-
- if (w != NULL) {
- *w = width;
- }
- if (h != NULL) {
- *h = height;
- }
-}
-
-
-/*
- * The 3Dfx Global Palette extension for GLQuake.
- * More a trick than a real extesion, use the shared global
- * palette extension.
- */
-extern void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint * pal); /* silence warning */
-void GLAPIENTRY
-gl3DfxSetPaletteEXT(GLuint * pal)
-{
- fxMesaContext fxMesa = fxMesaCurrentCtx;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- int i;
-
- fprintf(stderr, "gl3DfxSetPaletteEXT(...)\n");
-
- for (i = 0; i < 256; i++) {
- fprintf(stderr, "\t%x\n", pal[i]);
- }
- }
-
- if (fxMesa) {
- fxMesa->haveGlobalPaletteTexture = 1;
-
- grTexDownloadTable(GR_TEXTABLE_PALETTE, (GuTexPalette *) pal);
- }
-}
-
-
-static GrScreenResolution_t fxBestResolution (int width, int height)
-{
- static int resolutions[][3] = {
- { GR_RESOLUTION_320x200, 320, 200 },
- { GR_RESOLUTION_320x240, 320, 240 },
- { GR_RESOLUTION_400x256, 400, 256 },
- { GR_RESOLUTION_512x384, 512, 384 },
- { GR_RESOLUTION_640x200, 640, 200 },
- { GR_RESOLUTION_640x350, 640, 350 },
- { GR_RESOLUTION_640x400, 640, 400 },
- { GR_RESOLUTION_640x480, 640, 480 },
- { GR_RESOLUTION_800x600, 800, 600 },
- { GR_RESOLUTION_960x720, 960, 720 },
- { GR_RESOLUTION_856x480, 856, 480 },
- { GR_RESOLUTION_512x256, 512, 256 },
- { GR_RESOLUTION_1024x768, 1024, 768 },
- { GR_RESOLUTION_1280x1024, 1280, 1024 },
- { GR_RESOLUTION_1600x1200, 1600, 1200 },
- { GR_RESOLUTION_400x300, 400, 300 },
- { GR_RESOLUTION_1152x864, 1152, 864 },
- { GR_RESOLUTION_1280x960, 1280, 960 },
- { GR_RESOLUTION_1600x1024, 1600, 1024 },
- { GR_RESOLUTION_1792x1344, 1792, 1344 },
- { GR_RESOLUTION_1856x1392, 1856, 1392 },
- { GR_RESOLUTION_1920x1440, 1920, 1440 },
- { GR_RESOLUTION_2048x1536, 2048, 1536 },
- { GR_RESOLUTION_2048x2048, 2048, 2048 }
- };
-
- int i, size;
- int lastvalidres = GR_RESOLUTION_640x480;
- int min = 2048 * 2048; /* max is GR_RESOLUTION_2048x2048 */
- GrResolution resTemplate = {
- GR_QUERY_ANY,
- GR_QUERY_ANY,
- 2 /*GR_QUERY_ANY */,
- GR_QUERY_ANY
- };
- GrResolution *presSupported;
-
- fxQueryHardware();
-
- size = grQueryResolutions(&resTemplate, NULL);
- presSupported = malloc(size);
-
- size /= sizeof(GrResolution);
- grQueryResolutions(&resTemplate, presSupported);
-
- for (i = 0; i < size; i++) {
- int r = presSupported[i].resolution;
- if ((width <= resolutions[r][1]) && (height <= resolutions[r][2])) {
- if (min > (resolutions[r][1] * resolutions[r][2])) {
- min = resolutions[r][1] * resolutions[r][2];
- lastvalidres = r;
- }
- }
- }
-
- free(presSupported);
-
- return resolutions[lastvalidres][0];
-}
-
-
-fxMesaContext GLAPIENTRY
-fxMesaCreateBestContext(GLuint win, GLint width, GLint height,
- const GLint attribList[])
-{
- int res = fxBestResolution(width, height);
-
- if (res == -1) {
- return NULL;
- }
-
- return fxMesaCreateContext(win, res, GR_REFRESH_60Hz, attribList);
-}
-
-
-/*
- * Create a new FX/Mesa context and return a handle to it.
- */
-fxMesaContext GLAPIENTRY
-fxMesaCreateContext(GLuint win,
- GrScreenResolution_t res,
- GrScreenRefresh_t ref, const GLint attribList[])
-{
- fxMesaContext fxMesa = NULL;
- GLcontext *ctx = NULL, *shareCtx = NULL;
- struct dd_function_table functions;
-
- int i;
- const char *str;
- int sliaa, numSLI, samplesPerChip;
- struct SstCard_St *voodoo;
- struct tdfx_glide *Glide;
-
- GLboolean aux;
- GLboolean doubleBuffer;
- GLuint colDepth;
- GLuint depthSize, alphaSize, stencilSize, accumSize;
- GLuint redBits, greenBits, blueBits, alphaBits;
- GrPixelFormat_t pixFmt;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxMesaCreateContext(...)\n");
- }
-
- /* Okay, first process the user flags */
- aux = GL_FALSE;
- doubleBuffer = GL_FALSE;
- colDepth = 16;
- depthSize = alphaSize = stencilSize = accumSize = 0;
-
- i = 0;
- while (attribList[i] != FXMESA_NONE) {
- switch (attribList[i]) {
- case FXMESA_COLORDEPTH:
- colDepth = attribList[++i];
- break;
- case FXMESA_DOUBLEBUFFER:
- doubleBuffer = GL_TRUE;
- break;
- case FXMESA_ALPHA_SIZE:
- if ((alphaSize = attribList[++i])) {
- aux = GL_TRUE;
- }
- break;
- case FXMESA_DEPTH_SIZE:
- if ((depthSize = attribList[++i])) {
- aux = GL_TRUE;
- }
- break;
- case FXMESA_STENCIL_SIZE:
- stencilSize = attribList[++i];
- break;
- case FXMESA_ACCUM_SIZE:
- accumSize = attribList[++i];
- break;
- /* XXX ugly hack here for sharing display lists */
- case FXMESA_SHARE_CONTEXT:
- shareCtx = (GLcontext *)attribList[++i];
- break;
- default:
- fprintf(stderr, "fxMesaCreateContext: ERROR: wrong parameter (%d) passed\n", attribList[i]);
- return NULL;
- }
- i++;
- }
-
- if (!fxQueryHardware()) {
- str = "no Voodoo hardware!";
- goto errorhandler;
- }
-
- grSstSelect(glbCurrentBoard);
- /*grEnable(GR_OPENGL_MODE_EXT);*/ /* [koolsmoky] */
- voodoo = &glbHWConfig.SSTs[glbCurrentBoard];
-
- fxMesa = (fxMesaContext)CALLOC_STRUCT(tfxMesaContext);
- if (!fxMesa) {
- str = "private context";
- goto errorhandler;
- }
-
- if (getenv("MESA_FX_INFO")) {
- fxMesa->verbose = GL_TRUE;
- }
-
- fxMesa->type = voodoo->type;
- fxMesa->HavePalExt = voodoo->HavePalExt && !getenv("MESA_FX_IGNORE_PALEXT");
- fxMesa->HavePixExt = voodoo->HavePixExt && !getenv("MESA_FX_IGNORE_PIXEXT");
- fxMesa->HaveTexFmt = voodoo->HaveTexFmt && !getenv("MESA_FX_IGNORE_TEXFMT");
- fxMesa->HaveCmbExt = voodoo->HaveCmbExt && !getenv("MESA_FX_IGNORE_CMBEXT");
- fxMesa->HaveMirExt = voodoo->HaveMirExt && !getenv("MESA_FX_IGNORE_MIREXT");
- fxMesa->HaveTexUma = voodoo->HaveTexUma && !getenv("MESA_FX_IGNORE_TEXUMA");
- fxMesa->Glide = glbHWConfig.Glide;
- Glide = &fxMesa->Glide;
- fxMesa->HaveTexus2 = Glide->txImgQuantize &&
- Glide->txMipQuantize &&
- Glide->txPalToNcc && !getenv("MESA_FX_IGNORE_TEXUS2");
-
- /* Determine if we need vertex swapping, RGB order and SLI/AA */
- sliaa = 0;
- switch (fxMesa->type) {
- case GR_SSTTYPE_VOODOO:
- case GR_SSTTYPE_SST96:
- case GR_SSTTYPE_Banshee:
- fxMesa->bgrOrder = GL_TRUE;
- fxMesa->snapVertices = (getenv("MESA_FX_NOSNAP") == NULL);
- break;
- case GR_SSTTYPE_Voodoo2:
- fxMesa->bgrOrder = GL_TRUE;
- fxMesa->snapVertices = GL_FALSE;
- break;
- case GR_SSTTYPE_Voodoo4:
- case GR_SSTTYPE_Voodoo5:
- /* number of SLI units and AA Samples per chip */
- if ((str = Glide->grGetRegistryOrEnvironmentStringExt("SSTH3_SLI_AA_CONFIGURATION")) != NULL) {
- sliaa = atoi(str);
- }
- case GR_SSTTYPE_Voodoo3:
- default:
- fxMesa->bgrOrder = GL_FALSE;
- fxMesa->snapVertices = GL_FALSE;
- break;
- }
- /* XXX todo - Add the old SLI/AA settings for Napalm. */
- switch(voodoo->numChips) {
- case 4: /* 4 chips */
- switch(sliaa) {
- case 8: /* 8 Sample AA */
- numSLI = 1;
- samplesPerChip = 2;
- break;
- case 7: /* 4 Sample AA */
- numSLI = 1;
- samplesPerChip = 1;
- break;
- case 6: /* 2 Sample AA */
- numSLI = 2;
- samplesPerChip = 1;
- break;
- default:
- numSLI = 4;
- samplesPerChip = 1;
- }
- break;
- case 2: /* 2 chips */
- switch(sliaa) {
- case 4: /* 4 Sample AA */
- numSLI = 1;
- samplesPerChip = 2;
- break;
- case 3: /* 2 Sample AA */
- numSLI = 1;
- samplesPerChip = 1;
- break;
- default:
- numSLI = 2;
- samplesPerChip = 1;
- }
- break;
- default: /* 1 chip */
- switch(sliaa) {
- case 1: /* 2 Sample AA */
- numSLI = 1;
- samplesPerChip = 2;
- break;
- default:
- numSLI = 1;
- samplesPerChip = 1;
- }
- }
-
- fxMesa->fsaa = samplesPerChip * voodoo->numChips / numSLI; /* 1:noFSAA, 2:2xFSAA, 4:4xFSAA, 8:8xFSAA */
-
- switch (fxMesa->colDepth = colDepth) {
- case 15:
- redBits = 5;
- greenBits = 5;
- blueBits = 5;
- alphaBits = depthSize ? 1 : 8;
- switch(fxMesa->fsaa) {
- case 8:
- pixFmt = GR_PIXFMT_AA_8_ARGB_1555;
- break;
- case 4:
- pixFmt = GR_PIXFMT_AA_4_ARGB_1555;
- break;
- case 2:
- pixFmt = GR_PIXFMT_AA_2_ARGB_1555;
- break;
- default:
- pixFmt = GR_PIXFMT_ARGB_1555;
- }
- break;
- case 16:
- redBits = 5;
- greenBits = 6;
- blueBits = 5;
- alphaBits = depthSize ? 0 : 8;
- switch(fxMesa->fsaa) {
- case 8:
- pixFmt = GR_PIXFMT_AA_8_RGB_565;
- break;
- case 4:
- pixFmt = GR_PIXFMT_AA_4_RGB_565;
- break;
- case 2:
- pixFmt = GR_PIXFMT_AA_2_RGB_565;
- break;
- default:
- pixFmt = GR_PIXFMT_RGB_565;
- }
- break;
- case 24:
- fxMesa->colDepth = 32;
- case 32:
- redBits = 8;
- greenBits = 8;
- blueBits = 8;
- alphaBits = 8;
- switch(fxMesa->fsaa) {
- case 8:
- pixFmt = GR_PIXFMT_AA_8_ARGB_8888;
- break;
- case 4:
- pixFmt = GR_PIXFMT_AA_4_ARGB_8888;
- break;
- case 2:
- pixFmt = GR_PIXFMT_AA_2_ARGB_8888;
- break;
- default:
- pixFmt = GR_PIXFMT_ARGB_8888;
- }
- break;
- default:
- str = "pixelFormat";
- goto errorhandler;
- }
-
- /* Tips:
- * 1. we don't bother setting/checking AUX for stencil, because we'll decide
- * later whether we have HW stencil, based on depth buffer (thus AUX is
- * properly set)
- * 2. when both DEPTH and ALPHA are enabled, depth should win. However, it is
- * not clear whether 15bpp and 32bpp require AUX alpha buffer. Furthermore,
- * alpha buffering is required only if destination alpha is used in alpha
- * blending; alpha blending modes that do not use destination alpha can be
- * used w/o alpha buffer.
- * 3. `alphaBits' is what we can provide
- * `alphaSize' is what app requests
- * if we cannot provide enough bits for alpha buffer, we should fallback to
- * SW alpha. However, setting `alphaBits' to `alphaSize' might confuse some
- * of the span functions...
- */
-
- fxMesa->haveHwAlpha = GL_FALSE;
- if (alphaSize && (alphaSize <= alphaBits)) {
- alphaSize = alphaBits;
- fxMesa->haveHwAlpha = GL_TRUE;
- }
-
- fxMesa->haveHwStencil = (fxMesa->HavePixExt && stencilSize && depthSize == 24);
-
- fxMesa->haveZBuffer = depthSize > 0;
- fxMesa->haveDoubleBuffer = doubleBuffer;
- fxMesa->haveGlobalPaletteTexture = GL_FALSE;
- fxMesa->board = glbCurrentBoard;
-
- fxMesa->haveTwoTMUs = (voodoo->nTexelfx > 1);
-
- if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_NUM_TMU"))) {
- if (atoi(str) <= 1) {
- fxMesa->haveTwoTMUs = GL_FALSE;
- }
- }
-
- if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_SWAPPENDINGCOUNT"))) {
- fxMesa->maxPendingSwapBuffers = atoi(str);
- if (fxMesa->maxPendingSwapBuffers > 6) {
- fxMesa->maxPendingSwapBuffers = 6;
- } else if (fxMesa->maxPendingSwapBuffers < 0) {
- fxMesa->maxPendingSwapBuffers = 0;
- }
- } else {
- fxMesa->maxPendingSwapBuffers = 2;
- }
-
- if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_SWAPINTERVAL"))) {
- fxMesa->swapInterval = atoi(str);
- } else {
- fxMesa->swapInterval = 0;
- }
-
- BEGIN_BOARD_LOCK();
- if (fxMesa->HavePixExt) {
- fxMesa->glideContext = Glide->grSstWinOpenExt((FxU32)win, res, ref,
- GR_COLORFORMAT_ABGR, GR_ORIGIN_LOWER_LEFT,
- pixFmt,
- 2, aux);
- } else if (pixFmt == GR_PIXFMT_RGB_565) {
- fxMesa->glideContext = grSstWinOpen((FxU32)win, res, ref,
- GR_COLORFORMAT_ABGR, GR_ORIGIN_LOWER_LEFT,
- 2, aux);
- } else {
- fxMesa->glideContext = 0;
- }
- END_BOARD_LOCK();
- if (!fxMesa->glideContext) {
- str = "grSstWinOpen";
- goto errorhandler;
- }
-
- /* screen */
- fxMesa->screen_width = FX_grSstScreenWidth();
- fxMesa->screen_height = FX_grSstScreenHeight();
-
- /* window inside screen */
- fxMesa->width = fxMesa->screen_width;
- fxMesa->height = fxMesa->screen_height;
-
- /* scissor inside window */
- fxMesa->clipMinX = 0;
- fxMesa->clipMaxX = fxMesa->width;
- fxMesa->clipMinY = 0;
- fxMesa->clipMaxY = fxMesa->height;
-
- if (fxMesa->verbose) {
- FxI32 tmuRam, fbRam;
-
- /* Not that it matters, but tmuRam and fbRam change after grSstWinOpen. */
- tmuRam = voodoo->tmuConfig[GR_TMU0].tmuRam;
- fbRam = voodoo->fbRam;
- BEGIN_BOARD_LOCK();
- grGet(GR_MEMORY_TMU, 4, &tmuRam);
- grGet(GR_MEMORY_FB, 4, &fbRam);
- END_BOARD_LOCK();
-
- fprintf(stderr, "Voodoo Using Glide %s\n", grGetString(GR_VERSION));
- fprintf(stderr, "Voodoo Board: %d/%d, %s, %d GPU\n",
- fxMesa->board + 1,
- glbHWConfig.num_sst,
- grGetString(GR_HARDWARE),
- voodoo->numChips);
- fprintf(stderr, "Voodoo Memory: FB = %ld, TM = %d x %ld\n",
- fbRam,
- voodoo->nTexelfx,
- tmuRam);
- fprintf(stderr, "Voodoo Screen: %dx%d:%d %s, %svertex snapping\n",
- fxMesa->screen_width,
- fxMesa->screen_height,
- colDepth,
- fxMesa->bgrOrder ? "BGR" : "RGB",
- fxMesa->snapVertices ? "" : "no ");
- }
-
- sprintf(fxMesa->rendererString, "Mesa %s v0.63 %s%s",
- grGetString(GR_RENDERER),
- grGetString(GR_HARDWARE),
- ((fxMesa->type < GR_SSTTYPE_Voodoo4) && (voodoo->numChips > 1)) ? " SLI" : "");
-
- fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */
- doubleBuffer,
- GL_FALSE, /* stereo */
- redBits, /* RGBA.R bits */
- greenBits, /* RGBA.G bits */
- blueBits, /* RGBA.B bits */
- alphaSize, /* RGBA.A bits */
- 0, /* index bits */
- depthSize, /* depth_size */
- stencilSize, /* stencil_size */
- accumSize,
- accumSize,
- accumSize,
- alphaSize ? accumSize : 0,
- 1);
- if (!fxMesa->glVis) {
- str = "_mesa_create_visual";
- goto errorhandler;
- }
-
- _mesa_init_driver_functions(&functions);
- ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx,
- &functions, (void *) fxMesa);
- if (!ctx) {
- str = "_mesa_create_context";
- goto errorhandler;
- }
-
-
- if (!fxDDInitFxMesaContext(fxMesa)) {
- str = "fxDDInitFxMesaContext";
- goto errorhandler;
- }
-
-
- fxMesa->glBuffer = _mesa_create_framebuffer(fxMesa->glVis);
-#if 0
-/* XXX this is a complete mess :(
- * _mesa_add_soft_renderbuffers
- * driNewRenderbuffer
- */
- GL_FALSE, /* no software depth */
- stencilSize && !fxMesa->haveHwStencil,
- fxMesa->glVis->accumRedBits > 0,
- alphaSize && !fxMesa->haveHwAlpha);
-#endif
- if (!fxMesa->glBuffer) {
- str = "_mesa_create_framebuffer";
- goto errorhandler;
- }
-
- glbTotNumCtx++;
-
- /* install signal handlers */
-#if defined(__linux__)
- /* Only install if environment var. is not set. */
- if (!getenv("MESA_FX_NO_SIGNALS")) {
- signal(SIGINT, cleangraphics_handler);
- signal(SIGHUP, cleangraphics_handler);
- signal(SIGPIPE, cleangraphics_handler);
- signal(SIGFPE, cleangraphics_handler);
- signal(SIGBUS, cleangraphics_handler);
- signal(SIGILL, cleangraphics_handler);
- signal(SIGSEGV, cleangraphics_handler);
- signal(SIGTERM, cleangraphics_handler);
- }
-#endif
-
- return fxMesa;
-
-errorhandler:
- if (fxMesa) {
- if (fxMesa->glideContext) {
- grSstWinClose(fxMesa->glideContext);
- fxMesa->glideContext = 0;
- }
-
- if (fxMesa->state) {
- FREE(fxMesa->state);
- }
- if (fxMesa->fogTable) {
- FREE(fxMesa->fogTable);
- }
- if (fxMesa->glBuffer) {
- _mesa_destroy_framebuffer(fxMesa->glBuffer);
- }
- if (fxMesa->glVis) {
- _mesa_destroy_visual(fxMesa->glVis);
- }
- if (fxMesa->glCtx) {
- _mesa_destroy_context(fxMesa->glCtx);
- }
- FREE(fxMesa);
- }
-
- fprintf(stderr, "fxMesaCreateContext: ERROR: %s\n", str);
- return NULL;
-}
-
-
-/*
- * Function to set the new window size in the context (mainly for the Voodoo Rush)
- */
-void GLAPIENTRY
-fxMesaUpdateScreenSize(fxMesaContext fxMesa)
-{
- fxMesa->width = FX_grSstScreenWidth();
- fxMesa->height = FX_grSstScreenHeight();
-}
-
-
-/*
- * Destroy the given FX/Mesa context.
- */
-void GLAPIENTRY
-fxMesaDestroyContext(fxMesaContext fxMesa)
-{
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxMesaDestroyContext(...)\n");
- }
-
- if (!fxMesa)
- return;
-
- if (fxMesa->verbose) {
- fprintf(stderr, "Misc Stats:\n");
- fprintf(stderr, " # swap buffer: %u\n", fxMesa->stats.swapBuffer);
-
- if (!fxMesa->stats.swapBuffer)
- fxMesa->stats.swapBuffer = 1;
-
- fprintf(stderr, "Textures Stats:\n");
- fprintf(stderr, " Free texture memory on TMU0: %d\n",
- fxMesa->freeTexMem[FX_TMU0]);
- if (fxMesa->haveTwoTMUs)
- fprintf(stderr, " Free texture memory on TMU1: %d\n",
- fxMesa->freeTexMem[FX_TMU1]);
- fprintf(stderr, " # request to TMM to upload a texture objects: %u\n",
- fxMesa->stats.reqTexUpload);
- fprintf(stderr,
- " # request to TMM to upload a texture objects per swapbuffer: %.2f\n",
- fxMesa->stats.reqTexUpload / (float) fxMesa->stats.swapBuffer);
- fprintf(stderr, " # texture objects uploaded: %u\n",
- fxMesa->stats.texUpload);
- fprintf(stderr, " # texture objects uploaded per swapbuffer: %.2f\n",
- fxMesa->stats.texUpload / (float) fxMesa->stats.swapBuffer);
- fprintf(stderr, " # MBs uploaded to texture memory: %.2f\n",
- fxMesa->stats.memTexUpload / (float) (1 << 20));
- fprintf(stderr,
- " # MBs uploaded to texture memory per swapbuffer: %.2f\n",
- (fxMesa->stats.memTexUpload /
- (float) fxMesa->stats.swapBuffer) / (float) (1 << 20));
- }
-
- glbTotNumCtx--;
-
- if (!glbTotNumCtx && getenv("MESA_FX_INFO")) {
- GrSstPerfStats_t st;
-
- FX_grSstPerfStats(&st);
-
- fprintf(stderr, "Pixels Stats:\n");
- fprintf(stderr, " # pixels processed (minus buffer clears): %u\n",
- (unsigned) st.pixelsIn);
- fprintf(stderr, " # pixels not drawn due to chroma key test failure: %u\n",
- (unsigned) st.chromaFail);
- fprintf(stderr, " # pixels not drawn due to depth test failure: %u\n",
- (unsigned) st.zFuncFail);
- fprintf(stderr,
- " # pixels not drawn due to alpha test failure: %u\n",
- (unsigned) st.aFuncFail);
- fprintf(stderr, " # pixels drawn (including buffer clears and LFB writes): %u\n",
- (unsigned) st.pixelsOut);
- }
-
- /* close the hardware first,
- * so we can debug atexit problems (memory leaks, etc).
- */
- grSstWinClose(fxMesa->glideContext);
- fxCloseHardware();
-
- fxDDDestroyFxMesaContext(fxMesa); /* must be before _mesa_destroy_context */
- _mesa_destroy_visual(fxMesa->glVis);
- _mesa_destroy_context(fxMesa->glCtx);
- _mesa_destroy_framebuffer(fxMesa->glBuffer);
- fxTMClose(fxMesa); /* must be after _mesa_destroy_context */
-
- FREE(fxMesa);
-
- if (fxMesa == fxMesaCurrentCtx)
- fxMesaCurrentCtx = NULL;
-}
-
-
-/*
- * Make the specified FX/Mesa context the current one.
- */
-void GLAPIENTRY
-fxMesaMakeCurrent(fxMesaContext fxMesa)
-{
- if (!fxMesa) {
- _mesa_make_current(NULL, NULL, NULL);
- fxMesaCurrentCtx = NULL;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxMesaMakeCurrent(NULL)\n");
- }
-
- return;
- }
-
- /* if this context is already the current one, we can return early */
- if (fxMesaCurrentCtx == fxMesa
- && fxMesaCurrentCtx->glCtx == _mesa_get_current_context()) {
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxMesaMakeCurrent(NOP)\n");
- }
-
- return;
- }
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxMesaMakeCurrent(...)\n");
- }
-
- if (fxMesaCurrentCtx)
- grGlideGetState((GrState *) fxMesaCurrentCtx->state);
-
- fxMesaCurrentCtx = fxMesa;
-
- grSstSelect(fxMesa->board);
- grGlideSetState((GrState *) fxMesa->state);
-
- _mesa_make_current(fxMesa->glCtx, fxMesa->glBuffer, fxMesa->glBuffer);
-
- fxSetupDDPointers(fxMesa->glCtx);
-}
-
-
-/*
- * Swap front/back buffers for current context if double buffered.
- */
-void GLAPIENTRY
-fxMesaSwapBuffers(void)
-{
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxMesaSwapBuffers()\n");
- }
-
- if (fxMesaCurrentCtx) {
- _mesa_notifySwapBuffers(fxMesaCurrentCtx->glCtx);
-
- if (fxMesaCurrentCtx->haveDoubleBuffer) {
-
- grBufferSwap(fxMesaCurrentCtx->swapInterval);
-
-#if 0
- /*
- * Don't allow swap buffer commands to build up!
- */
- while (FX_grGetInteger(GR_PENDING_BUFFERSWAPS) >
- fxMesaCurrentCtx->maxPendingSwapBuffers)
- /* The driver is able to sleep when waiting for the completation
- of multiple swapbuffer operations instead of wasting
- CPU time (NOTE: you must uncomment the following line in the
- in order to enable this option) */
- /* usleep(10000); */
- ;
-#endif
-
- fxMesaCurrentCtx->stats.swapBuffer++;
- }
- }
-}
-
-
-/*
- * Shutdown Glide library
- */
-void GLAPIENTRY
-fxCloseHardware(void)
-{
- if (glbGlideInitialized) {
- if (glbTotNumCtx == 0) {
- grGlideShutdown();
- glbGlideInitialized = 0;
- }
- }
-}
-
-
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-extern int gl_fx_dummy_function_api(void);
-int
-gl_fx_dummy_function_api(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdd.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdd.c
deleted file mode 100644
index 4e9df208b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdd.c
+++ /dev/null
@@ -1,2197 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-/* fxdd.c - 3Dfx VooDoo Mesa device driver functions */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-
-#include "image.h"
-#include "mtypes.h"
-#include "fxdrv.h"
-#include "buffers.h"
-#include "enums.h"
-#include "extensions.h"
-#include "macros.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "swrast/swrast.h"
-#include "swrast/s_context.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "array_cache/acache.h"
-
-
-
-/* lookup table for scaling 4 bit colors up to 8 bits */
-GLuint FX_rgb_scale_4[16] = {
- 0, 17, 34, 51, 68, 85, 102, 119,
- 136, 153, 170, 187, 204, 221, 238, 255
-};
-
-/* lookup table for scaling 5 bit colors up to 8 bits */
-GLuint FX_rgb_scale_5[32] = {
- 0, 8, 16, 25, 33, 41, 49, 58,
- 66, 74, 82, 90, 99, 107, 115, 123,
- 132, 140, 148, 156, 165, 173, 181, 189,
- 197, 206, 214, 222, 230, 239, 247, 255
-};
-
-/* lookup table for scaling 6 bit colors up to 8 bits */
-GLuint FX_rgb_scale_6[64] = {
- 0, 4, 8, 12, 16, 20, 24, 28,
- 32, 36, 40, 45, 49, 53, 57, 61,
- 65, 69, 73, 77, 81, 85, 89, 93,
- 97, 101, 105, 109, 113, 117, 121, 125,
- 130, 134, 138, 142, 146, 150, 154, 158,
- 162, 166, 170, 174, 178, 182, 186, 190,
- 194, 198, 202, 206, 210, 215, 219, 223,
- 227, 231, 235, 239, 243, 247, 251, 255
-};
-
-
-/*
- * Disable color by masking out R, G, B, A
- */
-static void fxDisableColor (fxMesaContext fxMesa)
-{
- if (fxMesa->colDepth == 32) {
- /* 32bpp mode */
- fxMesa->Glide.grColorMaskExt(FXFALSE, FXFALSE, FXFALSE, FXFALSE);
- } else {
- /* 15/16 bpp mode */
- grColorMask(FXFALSE, FXFALSE);
- }
-}
-
-
-/**********************************************************************/
-/***** Miscellaneous functions *****/
-/**********************************************************************/
-
-/* Return buffer size information */
-static void
-fxDDGetBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (ctx && FX_CONTEXT(ctx)) {
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDGetBufferSize(...)\n");
- }
-
- *width = fxMesa->width;
- *height = fxMesa->height;
- }
-}
-
-
-static void
-fxDDViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- /* poll for window size change and realloc software Z/stencil/etc if needed */
- _mesa_ResizeBuffersMESA();
-}
-
-
-/* Implements glClearColor() */
-static void
-fxDDClearColor(GLcontext * ctx, const GLfloat color[4])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLubyte col[4];
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDClearColor(%f, %f, %f, %f)\n",
- color[0], color[1], color[2], color[3]);
- }
-
- CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]);
-
- fxMesa->clearC = FXCOLOR4(col);
- fxMesa->clearA = col[3];
-}
-
-
-/* Clear the color and/or depth buffers */
-static void fxDDClear( GLcontext *ctx,
- GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
- const GLuint stencil_size = fxMesa->haveHwStencil ? ctx->Visual.stencilBits : 0;
- const FxU32 clearD = (FxU32) (ctx->DrawBuffer->_DepthMaxF * ctx->Depth.Clear);
- const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff);
-
- if ( TDFX_DEBUG & MESA_VERBOSE ) {
- fprintf( stderr, "fxDDClear( %d, %d, %d, %d )\n",
- (int) x, (int) y, (int) width, (int) height );
- }
-
- /* we can't clear accum buffers nor stereo */
- mask &= ~(BUFFER_BIT_ACCUM | BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT);
-
- /* Need this check to respond to certain HW updates */
- if (fxMesa->new_state & (FX_NEW_SCISSOR | FX_NEW_COLOR_MASK)) {
- fxSetupScissor(ctx);
- fxSetupColorMask(ctx);
- fxMesa->new_state &= ~(FX_NEW_SCISSOR | FX_NEW_COLOR_MASK);
- }
-
- /*
- * As per GL spec, color masking should be obeyed when clearing
- */
- if (ctx->Visual.greenBits != 8) {
- /* can only do color masking if running in 24/32bpp on Napalm */
- if (ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP] ||
- ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) {
- softwareMask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT));
- mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
- }
- }
-
- if (fxMesa->haveHwStencil) {
- /*
- * If we want to clear stencil, it must be enabled
- * in the HW, even if the stencil test is not enabled
- * in the OGL state.
- */
- BEGIN_BOARD_LOCK();
- if (mask & BUFFER_BIT_STENCIL) {
- fxMesa->Glide.grStencilMaskExt(fxMesa->unitsState.stencilWriteMask);
- /* set stencil ref value = desired clear value */
- fxMesa->Glide.grStencilFuncExt(GR_CMP_ALWAYS, clearS, 0xff);
- fxMesa->Glide.grStencilOpExt(GR_STENCILOP_REPLACE,
- GR_STENCILOP_REPLACE, GR_STENCILOP_REPLACE);
- grEnable(GR_STENCIL_MODE_EXT);
- }
- else {
- grDisable(GR_STENCIL_MODE_EXT);
- }
- END_BOARD_LOCK();
- } else if (mask & BUFFER_BIT_STENCIL) {
- softwareMask |= (mask & (BUFFER_BIT_STENCIL));
- mask &= ~(BUFFER_BIT_STENCIL);
- }
-
- /*
- * This may be ugly, but it's needed in order to work around a number
- * of Glide bugs.
- */
- BEGIN_CLIP_LOOP();
- {
- /*
- * This could probably be done fancier but doing each possible case
- * explicitly is less error prone.
- */
- switch (mask & ~BUFFER_BIT_STENCIL) {
- case BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH:
- /* back buffer & depth */
- grDepthMask(FXTRUE);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0) {
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- }
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- break;
- case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_DEPTH:
- /* XXX it appears that the depth buffer isn't cleared when
- * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set.
- * This is a work-around/
- */
- /* clear depth */
- grDepthMask(FXTRUE);
- fxDisableColor(fxMesa);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- fxSetupColorMask(ctx);
- grDepthMask(FXFALSE);
- /* clear front */
- grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- break;
- case BUFFER_BIT_BACK_LEFT:
- /* back buffer only */
- grDepthMask(FXFALSE);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- break;
- case BUFFER_BIT_FRONT_LEFT:
- /* front buffer only */
- grDepthMask(FXFALSE);
- grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- break;
- case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT:
- /* front and back */
- grDepthMask(FXFALSE);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- break;
- case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH:
- /* clear back and depth */
- grDepthMask(FXTRUE);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- /* clear front */
- grDepthMask(FXFALSE);
- grRenderBuffer(GR_BUFFER_FRONTBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- break;
- case BUFFER_BIT_DEPTH:
- /* just the depth buffer */
- grDepthMask(FXTRUE);
- fxDisableColor(fxMesa);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- if (stencil_size > 0)
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- else
- grBufferClear(fxMesa->clearC,
- fxMesa->clearA,
- clearD);
- fxSetupColorMask(ctx);
- break;
- default:
- /* clear no color buffers or depth buffer but might clear stencil */
- if ((stencil_size > 0) && (mask & BUFFER_BIT_STENCIL)) {
- /* XXX need this RenderBuffer call to work around Glide bug */
- grDepthMask(FXFALSE);
- grRenderBuffer(GR_BUFFER_BACKBUFFER);
- fxDisableColor(fxMesa);
- fxMesa->Glide.grBufferClearExt(fxMesa->clearC,
- fxMesa->clearA,
- clearD, clearS);
- fxSetupColorMask(ctx);
- }
- }
- }
- END_CLIP_LOOP();
-
- if (fxMesa->haveHwStencil) {
- /* We changed the stencil state above. Restore it! */
- fxSetupStencil(ctx);
- }
- fxSetupDepthTest(ctx);
- grRenderBuffer(fxMesa->currentFB);
-
- if (softwareMask)
- _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
-}
-
-
-/* Set the buffer used for drawing */
-/* XXX support for separate read/draw buffers hasn't been tested */
-/* XXX GL_NONE disables color, but fails to correctly maintain state */
-static void
-fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDSetDrawBuffer(%x)\n", (int)mode);
- }
-
- if (mode == GL_FRONT_LEFT) {
- fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- grRenderBuffer(fxMesa->currentFB);
- }
- else if (mode == GL_BACK_LEFT) {
- fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- grRenderBuffer(fxMesa->currentFB);
- }
- else if (mode == GL_NONE) {
- fxDisableColor(fxMesa);
- }
- else {
- /* we'll need a software fallback */
- /* XXX not implemented */
- }
-
- /* update s/w fallback state */
- _swrast_DrawBuffer(ctx, mode);
-}
-
-
-static void
-fxDDDrawBitmap2 (GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GrLfbInfo_t info;
- GrLfbWriteMode_t mode;
- FxU16 color;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- /* check if there's any raster operations enabled which we can't handle */
- if (swrast->_RasterMask & (ALPHATEST_BIT |
- /*BLEND_BIT |*/ /* blending ok, through pixpipe */
- DEPTH_BIT | /* could be done with RGB:DEPTH */
- FOG_BIT | /* could be done with RGB:DEPTH */
- LOGIC_OP_BIT |
- /*CLIP_BIT |*/ /* clipping ok, below */
- STENCIL_BIT |
- MASKING_BIT |
- MULTI_DRAW_BIT |
- OCCLUSION_BIT | /* nope! at least not yet */
- TEXTURE_BIT |
- FRAGPROG_BIT)) {
- _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap);
- return;
- }
-
- /* make sure the pixelpipe is configured correctly */
- fxSetupFXUnits(ctx);
-
- /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (px < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - px);
- width -= (ctx->Scissor.X - px);
- px = ctx->Scissor.X;
- }
- /* clip right */
- if (px + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (px + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (py < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - py);
- height -= (ctx->Scissor.Y - py);
- py = ctx->Scissor.Y;
- }
- /* clip top */
- if (py + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (py + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return;
- }
- else {
- finalUnpack = unpack;
- }
-
- /* compute pixel value */
- {
- GLint r = (GLint) (ctx->Current.RasterColor[RCOMP] * 255.0f);
- GLint g = (GLint) (ctx->Current.RasterColor[GCOMP] * 255.0f);
- GLint b = (GLint) (ctx->Current.RasterColor[BCOMP] * 255.0f);
- GLint a = (GLint) (ctx->Current.RasterColor[ACOMP] * 255.0f);
- if (fxMesa->colDepth == 15) {
- color = TDFXPACKCOLOR1555(b, g, r, a);
- mode = GR_LFBWRITEMODE_1555;
- } else {
- color = fxMesa->bgrOrder ? TDFXPACKCOLOR565(r, g, b) : TDFXPACKCOLOR565(b, g, r);
- mode = GR_LFBWRITEMODE_565;
- }
- }
-
- info.size = sizeof(info);
- if (!grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- mode,
- GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) {
- _swrast_Bitmap(ctx, px, py, width, height, finalUnpack, bitmap);
- return;
- }
-
- {
- const GLint winX = 0;
- const GLint winY = 0;
- /* The dest stride depends on the hardware and whether we're drawing
- * to the front or back buffer. This compile-time test seems to do
- * the job for now.
- */
- const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */
-
- GLint row;
- /* compute dest address of bottom-left pixel in bitmap */
- GLushort *dst = (GLushort *) info.lfbPtr
- + (winY + py) * dstStride + (winX + px);
-
- for (row = 0; row < height; row++) {
- const GLubyte *src =
- (const GLubyte *) _mesa_image_address2d(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- row, 0);
- if (finalUnpack->LsbFirst) {
- /* least significan bit first */
- GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- dst[col] = color;
- }
- if (mask == 128U) {
- src++;
- mask = 1U;
- }
- else {
- mask = mask << 1;
- }
- }
- if (mask != 1)
- src++;
- }
- else {
- /* most significan bit first */
- GLubyte mask = 128U >> (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- dst[col] = color;
- }
- if (mask == 1U) {
- src++;
- mask = 128U;
- }
- else {
- mask = mask >> 1;
- }
- }
- if (mask != 128)
- src++;
- }
- dst += dstStride;
- }
- }
-
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
-}
-
-static void
-fxDDDrawBitmap4 (GLcontext *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GrLfbInfo_t info;
- FxU32 color;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- /* check if there's any raster operations enabled which we can't handle */
- if ((swrast->_RasterMask & (/*ALPHATEST_BIT |*/
- /*BLEND_BIT |*/ /* blending ok, through pixpipe */
- DEPTH_BIT | /* could be done with RGB:DEPTH */
- FOG_BIT | /* could be done with RGB:DEPTH */
- LOGIC_OP_BIT |
- /*CLIP_BIT |*/ /* clipping ok, below */
- STENCIL_BIT |
- /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */
- MULTI_DRAW_BIT |
- OCCLUSION_BIT | /* nope! at least not yet */
- TEXTURE_BIT |
- FRAGPROG_BIT))
- ) {
- _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap);
- return;
- }
-
- /* make sure the pixelpipe is configured correctly */
- fxSetupFXUnits(ctx);
-
- /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (px < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - px);
- width -= (ctx->Scissor.X - px);
- px = ctx->Scissor.X;
- }
- /* clip right */
- if (px + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (px + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (py < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - py);
- height -= (ctx->Scissor.Y - py);
- py = ctx->Scissor.Y;
- }
- /* clip top */
- if (py + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (py + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return;
- }
- else {
- finalUnpack = unpack;
- }
-
- /* compute pixel value */
- {
- GLint r = (GLint) (ctx->Current.RasterColor[RCOMP] * 255.0f);
- GLint g = (GLint) (ctx->Current.RasterColor[GCOMP] * 255.0f);
- GLint b = (GLint) (ctx->Current.RasterColor[BCOMP] * 255.0f);
- GLint a = (GLint) (ctx->Current.RasterColor[ACOMP] * 255.0f);
- color = TDFXPACKCOLOR8888(b, g, r, a);
- }
-
- info.size = sizeof(info);
- if (!grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_8888,
- GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) {
- _swrast_Bitmap(ctx, px, py, width, height, finalUnpack, bitmap);
- return;
- }
-
- {
- const GLint winX = 0;
- const GLint winY = 0;
- /* The dest stride depends on the hardware and whether we're drawing
- * to the front or back buffer. This compile-time test seems to do
- * the job for now.
- */
- const GLint dstStride = info.strideInBytes / 4; /* stride in GLuints */
-
- GLint row;
- /* compute dest address of bottom-left pixel in bitmap */
- GLuint *dst = (GLuint *) info.lfbPtr
- + (winY + py) * dstStride + (winX + px);
-
- for (row = 0; row < height; row++) {
- const GLubyte *src =
- (const GLubyte *) _mesa_image_address2d(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- row, 0);
- if (finalUnpack->LsbFirst) {
- /* least significan bit first */
- GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- dst[col] = color;
- }
- if (mask == 128U) {
- src++;
- mask = 1U;
- }
- else {
- mask = mask << 1;
- }
- }
- if (mask != 1)
- src++;
- }
- else {
- /* most significan bit first */
- GLubyte mask = 128U >> (finalUnpack->SkipPixels & 0x7);
- GLint col;
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- dst[col] = color;
- }
- if (mask == 1U) {
- src++;
- mask = 128U;
- }
- else {
- mask = mask >> 1;
- }
- }
- if (mask != 128)
- src++;
- }
- dst += dstStride;
- }
- }
-
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
-}
-
-
-static void
-fxDDReadPixels565 (GLcontext * ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *dstImage)
-{
- if (ctx->_ImageTransferState/* & (IMAGE_SCALE_BIAS_BIT|IMAGE_MAP_COLOR_BIT)*/) {
- _swrast_ReadPixels(ctx, x, y, width, height, format, type,
- packing, dstImage);
- return;
- }
- else {
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrLfbInfo_t info;
-
- BEGIN_BOARD_LOCK();
- info.size = sizeof(info);
- if (grLfbLock(GR_LFB_READ_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_ANY,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
- const GLint winX = 0;
- const GLint winY = fxMesa->height - 1;
- const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
- const GLushort *src = (const GLushort *) info.lfbPtr
- + (winY - y) * srcStride + (winX + x);
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage,
- width, height, format,
- type, 0, 0);
- GLint dstStride =
- _mesa_image_row_stride(packing, width, format, type);
-
- if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- /* convert 5R6G5B into 8R8G8B */
- GLint row, col;
- const GLint halfWidth = width >> 1;
- const GLint extraPixel = (width & 1);
- for (row = 0; row < height; row++) {
- GLubyte *d = dst;
- for (col = 0; col < halfWidth; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f];
- *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 27) & 0x1f];
- *d++ = FX_rgb_scale_6[(pixel >> 21) & 0x3f];
- *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f];
- }
- if (extraPixel) {
- GLushort pixel = src[width - 1];
- *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f];
- *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- /* convert 5R6G5B into 8R8G8B8A */
- GLint row, col;
- const GLint halfWidth = width >> 1;
- const GLint extraPixel = (width & 1);
- for (row = 0; row < height; row++) {
- GLubyte *d = dst;
- for (col = 0; col < halfWidth; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f];
- *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- *d++ = 255;
- *d++ = FX_rgb_scale_5[(pixel >> 27) & 0x1f];
- *d++ = FX_rgb_scale_6[(pixel >> 21) & 0x3f];
- *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f];
- *d++ = 255;
- }
- if (extraPixel) {
- const GLushort pixel = src[width - 1];
- *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f];
- *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- *d++ = 255;
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) {
- /* directly memcpy 5R6G5B pixels into client's buffer */
- const GLint widthInBytes = width * 2;
- GLint row;
- for (row = 0; row < height; row++) {
- MEMCPY(dst, src, widthInBytes);
- dst += dstStride;
- src -= srcStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- END_BOARD_LOCK();
- _swrast_ReadPixels(ctx, x, y, width, height, format, type,
- packing, dstImage);
- return;
- }
-
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- }
- END_BOARD_LOCK();
- }
-}
-
-static void
-fxDDReadPixels555 (GLcontext * ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *dstImage)
-{
- if (ctx->_ImageTransferState/* & (IMAGE_SCALE_BIAS_BIT|IMAGE_MAP_COLOR_BIT)*/) {
- _swrast_ReadPixels(ctx, x, y, width, height, format, type,
- packing, dstImage);
- return;
- }
- else {
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrLfbInfo_t info;
-
- BEGIN_BOARD_LOCK();
- info.size = sizeof(info);
- if (grLfbLock(GR_LFB_READ_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_ANY,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
- const GLint winX = 0;
- const GLint winY = fxMesa->height - 1;
- const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
- const GLushort *src = (const GLushort *) info.lfbPtr
- + (winY - y) * srcStride + (winX + x);
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage,
- width, height, format,
- type, 0, 0);
- GLint dstStride =
- _mesa_image_row_stride(packing, width, format, type);
-
- if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- /* convert 5R5G5B into 8R8G8B */
- GLint row, col;
- const GLint halfWidth = width >> 1;
- const GLint extraPixel = (width & 1);
- for (row = 0; row < height; row++) {
- GLubyte *d = dst;
- for (col = 0; col < halfWidth; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 26) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 21) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f];
- }
- if (extraPixel) {
- GLushort pixel = src[width - 1];
- *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- /* convert 5R6G5B into 8R8G8B8A */
- GLint row, col;
- const GLint halfWidth = width >> 1;
- const GLint extraPixel = (width & 1);
- for (row = 0; row < height; row++) {
- GLubyte *d = dst;
- for (col = 0; col < halfWidth; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- *d++ = (pixel & 0x8000) ? 255 : 0;
- *d++ = FX_rgb_scale_5[(pixel >> 26) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 21) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f];
- *d++ = (pixel & 0x80000000) ? 255 : 0;
- }
- if (extraPixel) {
- const GLushort pixel = src[width - 1];
- *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f];
- *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f];
- *d++ = FX_rgb_scale_5[ pixel & 0x1f];
- *d++ = (pixel & 0x8000) ? 255 : 0;
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else if (format == GL_BGRA && type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
- /* directly memcpy 5R5G5B pixels into client's buffer */
- const GLint widthInBytes = width * 2;
- GLint row;
- for (row = 0; row < height; row++) {
- MEMCPY(dst, src, widthInBytes);
- dst += dstStride;
- src -= srcStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- END_BOARD_LOCK();
- _swrast_ReadPixels(ctx, x, y, width, height, format, type,
- packing, dstImage);
- return;
- }
-
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- }
- END_BOARD_LOCK();
- }
-}
-
-static void
-fxDDReadPixels8888 (GLcontext * ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *dstImage)
-{
- if (ctx->_ImageTransferState/* & (IMAGE_SCALE_BIAS_BIT|IMAGE_MAP_COLOR_BIT)*/) {
- _swrast_ReadPixels(ctx, x, y, width, height, format, type,
- packing, dstImage);
- return;
- }
- else {
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrLfbInfo_t info;
-
- BEGIN_BOARD_LOCK();
- info.size = sizeof(info);
- if (grLfbLock(GR_LFB_READ_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_ANY,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
- const GLint winX = 0;
- const GLint winY = fxMesa->height - 1;
- const GLint srcStride = info.strideInBytes / 4; /* stride in GLuints */
- const GLuint *src = (const GLuint *) info.lfbPtr
- + (winY - y) * srcStride + (winX + x);
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage,
- width, height, format,
- type, 0, 0);
- GLint dstStride =
- _mesa_image_row_stride(packing, width, format, type);
-
- if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- /* convert 8A8R8G8B into 8R8G8B */
- GLint row, col;
- for (row = 0; row < height; row++) {
- GLubyte *d = dst;
- for (col = 0; col < width; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = pixel >> 16;
- *d++ = pixel >> 8;
- *d++ = pixel;
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- /* 8A8R8G8B pixels into client's buffer */
- GLint row, col;
- for (row = 0; row < height; row++) {
- GLubyte *d = dst;
- for (col = 0; col < width; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = pixel >> 16;
- *d++ = pixel >> 8;
- *d++ = pixel;
- *d++ = pixel >> 24;
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) {
- /* convert 8A8R8G8B into 5R6G5B */
- GLint row, col;
- for (row = 0; row < height; row++) {
- GLushort *d = (GLushort *)dst;
- for (col = 0; col < width; col++) {
- const GLuint pixel = ((const GLuint *) src)[col];
- *d++ = (((pixel >> 16) & 0xf8) << 8) |
- (((pixel >> 8) & 0xfc) << 3) |
- ((pixel & 0xf8) >> 3);
- }
- dst += dstStride;
- src -= srcStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- END_BOARD_LOCK();
- _swrast_ReadPixels(ctx, x, y, width, height, format, type,
- packing, dstImage);
- return;
- }
-
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- }
- END_BOARD_LOCK();
- }
-}
-
-
-static void
-fxDDDrawPixels555 (GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid * pixels)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GrLfbInfo_t info;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != 1.0F ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)) ||
- (swrast->_RasterMask & (ALPHATEST_BIT |
- /*BLEND_BIT |*/ /* blending ok, through pixpipe */
- DEPTH_BIT | /* could be done with RGB:DEPTH */
- FOG_BIT | /* could be done with RGB:DEPTH */
- LOGIC_OP_BIT |
- /*CLIP_BIT |*/ /* clipping ok, below */
- STENCIL_BIT |
- MASKING_BIT |
- MULTI_DRAW_BIT |
- OCCLUSION_BIT | /* nope! at least not yet */
- TEXTURE_BIT |
- FRAGPROG_BIT)) ||
- fxMesa->fallback)
- {
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
- return;
- }
-
- /* make sure the pixelpipe is configured correctly */
- fxSetupFXUnits(ctx);
-
- /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (x < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - x);
- width -= (ctx->Scissor.X - x);
- x = ctx->Scissor.X;
- }
- /* clip right */
- if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (y < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - y);
- height -= (ctx->Scissor.Y - y);
- y = ctx->Scissor.Y;
- }
- /* clip top */
- if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return;
- }
- else {
- finalUnpack = unpack;
- }
-
- info.size = sizeof(info);
- if (!grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_1555,
- GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) {
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- {
- const GLint winX = 0;
- const GLint winY = 0;
-
- const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */
- GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x);
-
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], src[3]);
- src += 4;
- }
- dst += dstStride;
- }
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], 255);
- src += 3;
- }
- dst += dstStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- }
-
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
-}
-
-
-static void
-fxDDDrawPixels565 (GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid * pixels)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GrLfbInfo_t info;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != 1.0F ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)) ||
- (swrast->_RasterMask & (ALPHATEST_BIT |
- /*BLEND_BIT |*/ /* blending ok, through pixpipe */
- DEPTH_BIT | /* could be done with RGB:DEPTH */
- FOG_BIT | /* could be done with RGB:DEPTH */
- LOGIC_OP_BIT |
- /*CLIP_BIT |*/ /* clipping ok, below */
- STENCIL_BIT |
- MASKING_BIT |
- MULTI_DRAW_BIT |
- OCCLUSION_BIT | /* nope! at least not yet */
- TEXTURE_BIT |
- FRAGPROG_BIT)) ||
- fxMesa->fallback)
- {
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
- return;
- }
-
- /* make sure the pixelpipe is configured correctly */
- fxSetupFXUnits(ctx);
-
- /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (x < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - x);
- width -= (ctx->Scissor.X - x);
- x = ctx->Scissor.X;
- }
- /* clip right */
- if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (y < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - y);
- height -= (ctx->Scissor.Y - y);
- y = ctx->Scissor.Y;
- }
- /* clip top */
- if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return;
- }
- else {
- finalUnpack = unpack;
- }
-
- info.size = sizeof(info);
- if (!grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_565,
- GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) {
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- {
- const GLint winX = 0;
- const GLint winY = 0;
-
- const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */
- GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x);
-
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]);
- src += 4;
- }
- dst += dstStride;
- }
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]);
- src += 3;
- }
- dst += dstStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- }
-
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
-}
-
-
-static void
-fxDDDrawPixels565_rev (GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid * pixels)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GrLfbInfo_t info;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != 1.0F ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)) ||
- (swrast->_RasterMask & (ALPHATEST_BIT |
- /*BLEND_BIT |*/ /* blending ok, through pixpipe */
- DEPTH_BIT | /* could be done with RGB:DEPTH */
- FOG_BIT | /* could be done with RGB:DEPTH */
- LOGIC_OP_BIT |
- /*CLIP_BIT |*/ /* clipping ok, below */
- STENCIL_BIT |
- MASKING_BIT |
- MULTI_DRAW_BIT |
- OCCLUSION_BIT | /* nope! at least not yet */
- TEXTURE_BIT |
- FRAGPROG_BIT)) ||
- fxMesa->fallback)
- {
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
- return;
- }
-
- /* make sure the pixelpipe is configured correctly */
- fxSetupFXUnits(ctx);
-
- /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (x < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - x);
- width -= (ctx->Scissor.X - x);
- x = ctx->Scissor.X;
- }
- /* clip right */
- if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (y < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - y);
- height -= (ctx->Scissor.Y - y);
- y = ctx->Scissor.Y;
- }
- /* clip top */
- if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return;
- }
- else {
- finalUnpack = unpack;
- }
-
- info.size = sizeof(info);
- if (!grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_565,
- GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) {
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- {
- const GLint winX = 0;
- const GLint winY = 0;
-
- const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */
- GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x);
-
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR565(src[0], src[1], src[2]);
- src += 4;
- }
- dst += dstStride;
- }
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR565(src[0], src[1], src[2]);
- src += 3;
- }
- dst += dstStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- }
-
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
-}
-
-
-static void
-fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid * pixels)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GrLfbInfo_t info;
- const struct gl_pixelstore_attrib *finalUnpack;
- struct gl_pixelstore_attrib scissoredUnpack;
-
- if (ctx->Pixel.ZoomX != 1.0F ||
- ctx->Pixel.ZoomY != 1.0F ||
- (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT|
- IMAGE_MAP_COLOR_BIT)) ||
- (swrast->_RasterMask & (/*ALPHATEST_BIT |*/
- /*BLEND_BIT |*/ /* blending ok, through pixpipe */
- DEPTH_BIT | /* could be done with RGB:DEPTH */
- FOG_BIT | /* could be done with RGB:DEPTH */
- LOGIC_OP_BIT |
- /*CLIP_BIT |*/ /* clipping ok, below */
- STENCIL_BIT |
- /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */
- MULTI_DRAW_BIT |
- OCCLUSION_BIT | /* nope! at least not yet */
- TEXTURE_BIT |
- FRAGPROG_BIT)) ||
- fxMesa->fallback)
- {
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
- return;
- }
-
- /* make sure the pixelpipe is configured correctly */
- fxSetupFXUnits(ctx);
-
- /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */
- if (ctx->Scissor.Enabled) {
- /* This is a bit tricky, but by carefully adjusting the px, py,
- * width, height, skipPixels and skipRows values we can do
- * scissoring without special code in the rendering loop.
- */
-
- /* we'll construct a new pixelstore struct */
- finalUnpack = &scissoredUnpack;
- scissoredUnpack = *unpack;
- if (scissoredUnpack.RowLength == 0)
- scissoredUnpack.RowLength = width;
-
- /* clip left */
- if (x < ctx->Scissor.X) {
- scissoredUnpack.SkipPixels += (ctx->Scissor.X - x);
- width -= (ctx->Scissor.X - x);
- x = ctx->Scissor.X;
- }
- /* clip right */
- if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) {
- width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width));
- }
- /* clip bottom */
- if (y < ctx->Scissor.Y) {
- scissoredUnpack.SkipRows += (ctx->Scissor.Y - y);
- height -= (ctx->Scissor.Y - y);
- y = ctx->Scissor.Y;
- }
- /* clip top */
- if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) {
- height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height));
- }
-
- if (width <= 0 || height <= 0)
- return;
- }
- else {
- finalUnpack = unpack;
- }
-
- info.size = sizeof(info);
- if (!grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_8888,
- GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) {
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- {
- const GLint winX = 0;
- const GLint winY = 0;
-
- const GLint dstStride = info.strideInBytes / 4; /* stride in GLuints */
- GLuint *dst = (GLuint *) info.lfbPtr + (winY + y) * dstStride + (winX + x);
-
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- /* directly memcpy 8A8R8G8B pixels to screen */
- const GLint widthInBytes = width * 4;
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- MEMCPY(dst, src, widthInBytes);
- dst += dstStride;
- }
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
- pixels, width, height, format, type, row, 0);
- GLint col;
- for (col = 0; col < width; col++) {
- dst[col] = TDFXPACKCOLOR8888(src[2], src[1], src[0], 255);
- src += 3;
- }
- dst += dstStride;
- }
- }
- else {
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels);
- return;
- }
-
- }
-
- grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
-}
-
-
-static void
-fxDDFinish(GLcontext * ctx)
-{
- grFlush();
-}
-
-
-
-
-
-/* KW: Put the word Mesa in the render string because quakeworld
- * checks for this rather than doing a glGet(GL_MAX_TEXTURE_SIZE).
- * Why?
- */
-static const GLubyte *
-fxDDGetString(GLcontext * ctx, GLenum name)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- switch (name) {
- case GL_RENDERER:
- return (GLubyte *)fxMesa->rendererString;
-#if __WIN32__ /* hack to advertise vanilla extension names */
- case GL_EXTENSIONS:
- if (ctx->Extensions.String == NULL) {
- GLubyte *ext = _mesa_make_extension_string(ctx);
- if (ext != NULL) {
- ctx->Extensions.String = _mesa_malloc(strlen((char *)ext) + 256);
- if (ctx->Extensions.String != NULL) {
- strcpy((char *)ctx->Extensions.String, (char *)ext);
- /* put any additional extension names here */
-#if 0
- strcat((char *)ctx->Extensions.String, " 3DFX_set_global_palette");
-#endif
-#if __WIN32__
- strcat((char *)ctx->Extensions.String, " WGL_3DFX_gamma_control");
- strcat((char *)ctx->Extensions.String, " WGL_EXT_swap_control");
- strcat((char *)ctx->Extensions.String, " WGL_EXT_extensions_string WGL_ARB_extensions_string");
-#endif
- /* put any additional extension names here */
- _mesa_free(ext);
- } else {
- ctx->Extensions.String = ext;
- }
- }
- }
- return ctx->Extensions.String;
-#endif
- default:
- return NULL;
- }
-}
-
-static const struct tnl_pipeline_stage *fx_pipeline[] = {
- &_tnl_vertex_transform_stage, /* XXX todo - Add the fastpath here */
- &_tnl_normal_transform_stage,
- &_tnl_lighting_stage,
- &_tnl_fog_coordinate_stage,
- &_tnl_texgen_stage,
- &_tnl_texture_transform_stage,
- &_tnl_point_attenuation_stage,
-#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program)
- &_tnl_arb_vertex_program_stage,
- &_tnl_vertex_program_stage,
-#endif
- &_tnl_render_stage,
- 0,
-};
-
-
-
-
-int
-fxDDInitFxMesaContext(fxMesaContext fxMesa)
-{
- GLcontext *ctx = fxMesa->glCtx;
-
- FX_setupGrVertexLayout();
-
- fxMesa->color = 0xffffffff;
- fxMesa->clearC = 0;
- fxMesa->clearA = 0;
-
- fxMesa->stats.swapBuffer = 0;
- fxMesa->stats.reqTexUpload = 0;
- fxMesa->stats.texUpload = 0;
- fxMesa->stats.memTexUpload = 0;
-
- fxMesa->tmuSrc = FX_TMU_NONE;
- fxMesa->lastUnitsMode = FX_UM_NONE;
- fxTMInit(fxMesa);
-
- /* FX units setup */
-
- fxMesa->unitsState.alphaTestEnabled = GL_FALSE;
- fxMesa->unitsState.alphaTestFunc = GL_ALWAYS;
- fxMesa->unitsState.alphaTestRefValue = 0.0;
-
- fxMesa->unitsState.blendEnabled = GL_FALSE;
- fxMesa->unitsState.blendSrcFuncRGB = GR_BLEND_ONE;
- fxMesa->unitsState.blendDstFuncRGB = GR_BLEND_ZERO;
- fxMesa->unitsState.blendSrcFuncAlpha = GR_BLEND_ONE;
- fxMesa->unitsState.blendDstFuncAlpha = GR_BLEND_ZERO;
- fxMesa->unitsState.blendEqRGB = GR_BLEND_OP_ADD;
- fxMesa->unitsState.blendEqAlpha = GR_BLEND_OP_ADD;
-
- fxMesa->unitsState.depthTestEnabled = GL_FALSE;
- fxMesa->unitsState.depthMask = GL_TRUE;
- fxMesa->unitsState.depthTestFunc = GL_LESS;
- fxMesa->unitsState.depthBias = 0;
-
- fxMesa->unitsState.stencilWriteMask = 0xff;
-
- if (fxMesa->colDepth == 32) {
- /* 32bpp */
- fxMesa->Glide.grColorMaskExt(FXTRUE, FXTRUE, FXTRUE, fxMesa->haveHwAlpha);
- } else {
- /* 15/16 bpp mode */
- grColorMask(FXTRUE, fxMesa->haveHwAlpha);
- }
-
- fxMesa->currentFB = fxMesa->haveDoubleBuffer ? GR_BUFFER_BACKBUFFER : GR_BUFFER_FRONTBUFFER;
- grRenderBuffer(fxMesa->currentFB);
-
- fxMesa->state = MALLOC(FX_grGetInteger(GR_GLIDE_STATE_SIZE));
- fxMesa->fogTable = (GrFog_t *) MALLOC(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) *
- sizeof(GrFog_t));
-
- if (!fxMesa->state || !fxMesa->fogTable) {
- if (fxMesa->state)
- FREE(fxMesa->state);
- if (fxMesa->fogTable)
- FREE(fxMesa->fogTable);
- return 0;
- }
-
- if (fxMesa->haveZBuffer) {
- grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
- }
-
- if (!fxMesa->bgrOrder) {
- grLfbWriteColorFormat(GR_COLORFORMAT_ABGR);
- }
-
- if (fxMesa->Glide.grSetNumPendingBuffers != NULL) {
- fxMesa->Glide.grSetNumPendingBuffers(fxMesa->maxPendingSwapBuffers);
- }
-
- fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN);
- /* [koolsmoky] */
- {
- char *env;
- int textureLevels = 0;
- int textureSize = FX_grGetInteger(GR_MAX_TEXTURE_SIZE);
- do {
- textureLevels++;
- } while ((textureSize >>= 0x1) & 0x7ff);
- ctx->Const.MaxTextureLevels = textureLevels;
- ctx->Const.MaxTextureLodBias = /*textureLevels - 1*/8; /* Glide bug */
-#if FX_RESCALE_BIG_TEXURES_HACK
- fxMesa->textureMaxLod = textureLevels - 1;
- if ((env = getenv("MESA_FX_MAXLOD")) != NULL) {
- int maxLevels = atoi(env) + 1;
- if ((maxLevels <= MAX_TEXTURE_LEVELS) && (maxLevels > textureLevels)) {
- ctx->Const.MaxTextureLevels = maxLevels;
- }
- }
-#endif
- }
- ctx->Const.MaxTextureCoordUnits =
- ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1;
- ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits);
-
- fxMesa->new_state = _NEW_ALL;
- if (!fxMesa->haveHwStencil) {
- /* don't touch stencil if there is none */
- fxMesa->new_state &= ~FX_NEW_STENCIL;
- }
-
- /* Initialize the software rasterizer and helper modules.
- */
- _swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
- _tnl_CreateContext(ctx);
- _swsetup_CreateContext(ctx);
-
- /* Install customized pipeline */
- _tnl_destroy_pipeline(ctx);
- _tnl_install_pipeline(ctx, fx_pipeline);
-
- fxAllocVB(ctx);
-
- fxSetupDDPointers(ctx);
- fxDDInitTriFuncs(ctx);
-
- /* Tell the software rasterizer to use pixel fog always.
- */
- _swrast_allow_vertex_fog(ctx, GL_FALSE);
- _swrast_allow_pixel_fog(ctx, GL_TRUE);
- _tnl_allow_vertex_fog( ctx, GL_FALSE );
- _tnl_allow_pixel_fog( ctx, GL_TRUE );
-
- /* Tell tnl not to calculate or use vertex fog factors. (Needed to
- * tell render stage not to clip fog coords).
- */
-/* _tnl_calculate_vertex_fog( ctx, GL_FALSE ); */
-
- fxDDInitExtensions(ctx);
-
-#if 0
- /* do we want dither? It just looks bad... */
- grEnable(GR_ALLOW_MIPMAP_DITHER);
-#endif
- grGlideGetState((GrState *) fxMesa->state);
-
- return 1;
-}
-
-/* Undo the above.
- */
-void
-fxDDDestroyFxMesaContext(fxMesaContext fxMesa)
-{
- _swsetup_DestroyContext(fxMesa->glCtx);
- _tnl_DestroyContext(fxMesa->glCtx);
- _ac_DestroyContext(fxMesa->glCtx);
- _swrast_DestroyContext(fxMesa->glCtx);
-
- if (fxMesa->state)
- FREE(fxMesa->state);
- if (fxMesa->fogTable)
- FREE(fxMesa->fogTable);
- fxFreeVB(fxMesa->glCtx);
-}
-
-
-
-
-void
-fxDDInitExtensions(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
-#if 1 /* multipass ColorSum stage */
- _mesa_enable_extension(ctx, "GL_EXT_secondary_color");
-#endif
-
- _mesa_enable_extension(ctx, "GL_ARB_point_sprite");
- _mesa_enable_extension(ctx, "GL_EXT_point_parameters");
- _mesa_enable_extension(ctx, "GL_EXT_paletted_texture");
- _mesa_enable_extension(ctx, "GL_EXT_texture_lod_bias");
- _mesa_enable_extension(ctx, "GL_EXT_shared_texture_palette");
- _mesa_enable_extension(ctx, "GL_EXT_blend_func_separate");
- _mesa_enable_extension(ctx, "GL_EXT_texture_env_add");
- _mesa_enable_extension(ctx, "GL_EXT_stencil_wrap");
- _mesa_enable_extension(ctx, "GL_EXT_stencil_two_side");
-
- if (fxMesa->haveTwoTMUs) {
- _mesa_enable_extension(ctx, "GL_ARB_multitexture");
- }
-
- if (fxMesa->type >= GR_SSTTYPE_Voodoo4) {
- _mesa_enable_extension(ctx, "GL_ARB_texture_compression");
- _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
- _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
- _mesa_enable_extension(ctx, "GL_S3_s3tc");
- _mesa_enable_extension(ctx, "GL_NV_blend_square");
- } else {
- /* [dBorca]
- * We should enable generic texture compression functions,
- * but some poorly written apps automatically assume S3TC.
- * Binding NCC to GL_COMPRESSED_RGB[A] is an unnecessary hassle,
- * since it's slow and ugly (better with palette textures, then).
- * Moreover, NCC is not an OpenGL standard, so we can't use
- * precompressed textures. Last, but not least, NCC runs amok
- * when multitexturing on a Voodoo3 and up (see POINTCAST vs UMA).
- * Note: this is also a problem with palette textures, but
- * faking multitex by multipass is evil...
- * Implementing NCC requires three stages:
- * fxDDChooseTextureFormat:
- * bind GL_COMPRESSED_RGB[A] to _mesa_texformat_argb8888,
- * so we can quantize properly, at a later time
- * fxDDTexImage:
- * if GL_COMPRESSED_RGB
- * use _mesa_texformat_l8 to get 1bpt and set GR_TEXFMT_YIQ_422
- * if GL_COMPRESSED_RGBA
- * use _mesa_texformat_al88 to get 2bpt and set GR_TEXFMT_AYIQ_8422
- * txMipQuantize(...);
- * if (level == 0) {
- * txPalToNcc((GuNccTable *)(&(ti->palette)), pxMip.pal);
- * }
- * fxSetupSingleTMU_NoLock/fxSetupDoubleTMU_NoLock:
- * grTexDownloadTable(GR_TEXTABLE_NCC0, &(ti->palette));
- */
- /*_mesa_enable_extension(ctx, "GL_ARB_texture_compression");*/
- _mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap");
- }
-
- if (fxMesa->HaveCmbExt) {
- _mesa_enable_extension(ctx, "GL_ARB_texture_env_combine");
- _mesa_enable_extension(ctx, "GL_EXT_texture_env_combine");
- }
-
- if (fxMesa->HavePixExt) {
- _mesa_enable_extension(ctx, "GL_EXT_blend_subtract");
- _mesa_enable_extension(ctx, "GL_EXT_blend_equation_separate");
- }
-
- if (fxMesa->HaveMirExt) {
- _mesa_enable_extension(ctx, "GL_ARB_texture_mirrored_repeat");
- }
-
- if (fxMesa->type >= GR_SSTTYPE_Voodoo2) {
- _mesa_enable_extension(ctx, "GL_EXT_fog_coord");
- }
-
- /* core-level extensions */
- _mesa_enable_extension(ctx, "GL_EXT_multi_draw_arrays");
- _mesa_enable_extension(ctx, "GL_IBM_multimode_draw_arrays");
- _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object");
- /* dangerous */
- if (getenv("MESA_FX_ALLOW_VP")) {
- _mesa_enable_extension(ctx, "GL_ARB_vertex_program");
- _mesa_enable_extension(ctx, "GL_NV_vertex_program");
- _mesa_enable_extension(ctx, "GL_NV_vertex_program1_1");
- _mesa_enable_extension(ctx, "GL_MESA_program_debug");
- }
-#if 0
- /* this requires _tnl_vertex_cull_stage in the pipeline */
- _mesa_enable_extension(ctx, "EXT_cull_vertex");
-#endif
-}
-
-
-/************************************************************************/
-/************************************************************************/
-/************************************************************************/
-
-/* Check if the hardware supports the current context
- *
- * Performs similar work to fxDDChooseRenderState() - should be merged.
- */
-GLuint
-fx_check_IsInHardware(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (ctx->RenderMode != GL_RENDER) {
- return FX_FALLBACK_RENDER_MODE;
- }
-
- if (ctx->Stencil.Enabled && !fxMesa->haveHwStencil) {
- return FX_FALLBACK_STENCIL;
- }
-
- if (ctx->DrawBuffer->_ColorDrawBufferMask[0] != BUFFER_BIT_FRONT_LEFT &&
- ctx->DrawBuffer->_ColorDrawBufferMask[0] != BUFFER_BIT_BACK_LEFT) {
- return FX_FALLBACK_DRAW_BUFFER;
- }
-
- if (ctx->Color.BlendEnabled) {
- if (ctx->Color.BlendEquationRGB != GL_FUNC_ADD) {
- if (!fxMesa->HavePixExt ||
- ((ctx->Color.BlendEquationRGB != GL_FUNC_SUBTRACT) &&
- (ctx->Color.BlendEquationRGB != GL_FUNC_REVERSE_SUBTRACT))) {
- return FX_FALLBACK_BLEND;
- }
- }
-
- if (ctx->Color.BlendEquationA != GL_FUNC_ADD) {
- if (!fxMesa->HavePixExt ||
- ((ctx->Color.BlendEquationA != GL_FUNC_SUBTRACT) &&
- (ctx->Color.BlendEquationA != GL_FUNC_REVERSE_SUBTRACT))) {
- return FX_FALLBACK_BLEND;
- }
- }
-
-#if 0
- /* [dBorca]
- * We fail the spec here, unless certain blending modes:
- * RGB: (GL_ONE + GL_*) or (GL_ZERO + GL_*) or ...
- */
- if (NEED_SECONDARY_COLOR(ctx)) {
- if ((ctx->Color.BlendEquationRGB != GL_FUNC_ADD) &&
- (ctx->Color.BlendSrcRGB != GL_ONE)) {
- /* Can't use multipass to blend ColorSum stage */
- return FX_FALLBACK_SPECULAR;
- }
- }
-#endif
- }
-
- /* [dBorca]
- * We could avoid this for certain `sfactor/dfactor'
- * I do not think that is even worthwhile to check
- * because if someone is using blending they use more
- * interesting settings and also it would add more
- * state tracking to a lot of the code.
- */
- if (ctx->Color.ColorLogicOpEnabled && (ctx->Color.LogicOp != GL_COPY)) {
- return FX_FALLBACK_LOGICOP;
- }
-
- if ((fxMesa->colDepth != 32) &&
- ((ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP]) ||
- (ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]))) {
- return FX_FALLBACK_COLORMASK;
- }
-
- /* Unsupported texture/multitexture cases */
-
- /* we can only do 1D/2D textures */
- if (ctx->Texture.Unit[0]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
- return FX_FALLBACK_TEXTURE_MAP;
-
- if (fxMesa->haveTwoTMUs) {
- if (ctx->Texture.Unit[1]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
- return FX_FALLBACK_TEXTURE_MAP;
-
- if (ctx->Texture.Unit[0]._ReallyEnabled) {
- if (fxMesa->type < GR_SSTTYPE_Voodoo2)
- if (ctx->Texture.Unit[0].EnvMode == GL_BLEND &&
- (ctx->Texture.Unit[1]._ReallyEnabled ||
- ctx->Texture.Unit[0].EnvColor[0] != 0 ||
- ctx->Texture.Unit[0].EnvColor[1] != 0 ||
- ctx->Texture.Unit[0].EnvColor[2] != 0 ||
- ctx->Texture.Unit[0].EnvColor[3] != 1)) {
- return FX_FALLBACK_TEXTURE_ENV;
- }
- if (ctx->Texture.Unit[0]._Current->Image[0][0]->Border > 0)
- return FX_FALLBACK_TEXTURE_BORDER;
- }
-
- if (ctx->Texture.Unit[1]._ReallyEnabled) {
- if (fxMesa->type < GR_SSTTYPE_Voodoo2)
- if (ctx->Texture.Unit[1].EnvMode == GL_BLEND)
- return FX_FALLBACK_TEXTURE_ENV;
- if (ctx->Texture.Unit[1]._Current->Image[0][0]->Border > 0)
- return FX_FALLBACK_TEXTURE_BORDER;
- }
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE))
- fprintf(stderr, "fx_check_IsInHardware: envmode is %s/%s\n",
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode),
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode));
-
- /* KW: This was wrong (I think) and I changed it... which doesn't mean
- * it is now correct...
- * BP: The old condition just seemed to test if both texture units
- * were enabled. That's easy!
- */
- if (ctx->Texture._EnabledUnits == 0x3) {
-#if 0
- /* Can't use multipass to blend a multitextured triangle - fall
- * back to software.
- */
- if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled) {
- return FX_FALLBACK_TEXTURE_MULTI;
- }
-#endif
-
- if (!fxMesa->HaveCmbExt &&
- (ctx->Texture.Unit[0].EnvMode != ctx->Texture.Unit[1].EnvMode) &&
- (ctx->Texture.Unit[0].EnvMode != GL_MODULATE) &&
- (ctx->Texture.Unit[0].EnvMode != GL_REPLACE)) { /* q2, seems ok... */
- if (TDFX_DEBUG & VERBOSE_DRIVER)
- fprintf(stderr, "fx_check_IsInHardware: unsupported multitex env mode\n");
- return FX_FALLBACK_TEXTURE_MULTI;
- }
- }
- }
- else {
- /* we have just one texture unit */
- if (ctx->Texture._EnabledUnits > 0x1) {
- return FX_FALLBACK_TEXTURE_MULTI;
- }
-
- if (fxMesa->type < GR_SSTTYPE_Voodoo2)
- if (ctx->Texture.Unit[0]._ReallyEnabled &&
- (ctx->Texture.Unit[0].EnvMode == GL_BLEND)) {
- return FX_FALLBACK_TEXTURE_ENV;
- }
- }
-
- return 0;
-}
-
-
-
-static void
-fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state)
-{
- /* TNLcontext *tnl = TNL_CONTEXT(ctx); */
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDUpdateDDPointers(%08x)\n", new_state);
- }
-
- _swrast_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
- _tnl_InvalidateState(ctx, new_state);
- _swsetup_InvalidateState(ctx, new_state);
-
- fxMesa->new_gl_state |= new_state;
-}
-
-
-
-
-void
-fxSetupDDPointers(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- /* TNLcontext *tnl = TNL_CONTEXT(ctx); */
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupDDPointers()\n");
- }
-
- ctx->Driver.UpdateState = fxDDUpdateDDPointers;
- ctx->Driver.GetString = fxDDGetString;
- ctx->Driver.ClearIndex = NULL;
- ctx->Driver.ClearColor = fxDDClearColor;
- ctx->Driver.Clear = fxDDClear;
- ctx->Driver.DrawBuffer = fxDDSetDrawBuffer;
- ctx->Driver.GetBufferSize = fxDDGetBufferSize;
- ctx->Driver.Viewport = fxDDViewport;
- switch (fxMesa->colDepth) {
- case 15:
- ctx->Driver.DrawPixels = fxDDDrawPixels555;
- ctx->Driver.ReadPixels = fxDDReadPixels555;
- ctx->Driver.Bitmap = fxDDDrawBitmap2;
- break;
- case 16:
- ctx->Driver.DrawPixels = !fxMesa->bgrOrder ? fxDDDrawPixels565 : fxDDDrawPixels565_rev;
- ctx->Driver.ReadPixels = fxDDReadPixels565;
- ctx->Driver.Bitmap = fxDDDrawBitmap2;
- break;
- case 32:
- ctx->Driver.DrawPixels = fxDDDrawPixels8888;
- ctx->Driver.ReadPixels = fxDDReadPixels8888;
- ctx->Driver.Bitmap = fxDDDrawBitmap4;
- break;
- }
- ctx->Driver.Finish = fxDDFinish;
- ctx->Driver.Flush = NULL;
- ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat;
- ctx->Driver.TexImage1D = fxDDTexImage1D;
- ctx->Driver.TexImage2D = fxDDTexImage2D;
- ctx->Driver.TexSubImage1D = fxDDTexSubImage1D;
- ctx->Driver.TexSubImage2D = fxDDTexSubImage2D;
- ctx->Driver.CompressedTexImage2D = fxDDCompressedTexImage2D;
- ctx->Driver.CompressedTexSubImage2D = fxDDCompressedTexSubImage2D;
- ctx->Driver.TestProxyTexImage = fxDDTestProxyTexImage;
- ctx->Driver.TexEnv = fxDDTexEnv;
- ctx->Driver.TexParameter = fxDDTexParam;
- ctx->Driver.BindTexture = fxDDTexBind;
- ctx->Driver.DeleteTexture = fxDDTexDel;
- ctx->Driver.IsTextureResident = fxDDIsTextureResident;
- ctx->Driver.UpdateTexturePalette = fxDDTexPalette;
- ctx->Driver.AlphaFunc = fxDDAlphaFunc;
- ctx->Driver.BlendFuncSeparate = fxDDBlendFuncSeparate;
- ctx->Driver.BlendEquationSeparate = fxDDBlendEquationSeparate;
- ctx->Driver.DepthFunc = fxDDDepthFunc;
- ctx->Driver.DepthMask = fxDDDepthMask;
- ctx->Driver.ColorMask = fxDDColorMask;
- ctx->Driver.Fogfv = fxDDFogfv;
- ctx->Driver.Scissor = fxDDScissor;
- ctx->Driver.FrontFace = fxDDFrontFace;
- ctx->Driver.CullFace = fxDDCullFace;
- ctx->Driver.ShadeModel = fxDDShadeModel;
- ctx->Driver.Enable = fxDDEnable;
- if (fxMesa->haveHwStencil) {
- ctx->Driver.StencilFunc = fxDDStencilFunc;
- ctx->Driver.StencilMask = fxDDStencilMask;
- ctx->Driver.StencilOp = fxDDStencilOp;
- }
-
- fxSetupDDSpanPointers(ctx);
- fxDDUpdateDDPointers(ctx, ~0);
-}
-
-
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_dd(void);
-int
-gl_fx_dummy_function_dd(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddspan.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddspan.c
deleted file mode 100644
index 79abbefc2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddspan.c
+++ /dev/null
@@ -1,663 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-
-/* fxdd.c - 3Dfx VooDoo Mesa span and pixel functions */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-
-#include "fxdrv.h"
-#include "fxglidew.h"
-#include "swrast/swrast.h"
-
-
-/************************************************************************/
-/***** Span functions *****/
-/************************************************************************/
-
-#define DBG 0
-
-
-#define LOCAL_VARS \
- GLuint pitch = info.strideInBytes; \
- GLuint height = fxMesa->height; \
- char *buf = (char *)((char *)info.lfbPtr + 0 /* x, y offset */); \
- GLuint p; \
- (void) buf; (void) p;
-
-#define CLIPPIXEL( _x, _y ) ( _x >= minx && _x < maxx && \
- _y >= miny && _y < maxy )
-
-#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \
- if ( _y < miny || _y >= maxy ) { \
- _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); \
- }
-
-#define Y_FLIP(_y) (height - _y - 1)
-
-#define HW_WRITE_LOCK() \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GrLfbInfo_t info; \
- info.size = sizeof(GrLfbInfo_t); \
- if ( grLfbLock( GR_LFB_WRITE_ONLY, \
- fxMesa->currentFB, LFB_MODE, \
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) {
-
-#define HW_WRITE_UNLOCK() \
- grLfbUnlock( GR_LFB_WRITE_ONLY, fxMesa->currentFB ); \
- }
-
-#define HW_READ_LOCK() \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GrLfbInfo_t info; \
- info.size = sizeof(GrLfbInfo_t); \
- if ( grLfbLock( GR_LFB_READ_ONLY, fxMesa->currentFB, \
- LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) {
-
-#define HW_READ_UNLOCK() \
- grLfbUnlock( GR_LFB_READ_ONLY, fxMesa->currentFB ); \
- }
-
-#define HW_WRITE_CLIPLOOP() \
- do { \
- /* remember, we need to flip the scissor, too */ \
- /* is it better to do it inside fxDDScissor? */ \
- const int minx = fxMesa->clipMinX; \
- const int maxy = Y_FLIP(fxMesa->clipMinY); \
- const int maxx = fxMesa->clipMaxX; \
- const int miny = Y_FLIP(fxMesa->clipMaxY);
-
-#define HW_READ_CLIPLOOP() \
- do { \
- /* remember, we need to flip the scissor, too */ \
- /* is it better to do it inside fxDDScissor? */ \
- const int minx = fxMesa->clipMinX; \
- const int maxy = Y_FLIP(fxMesa->clipMinY); \
- const int maxx = fxMesa->clipMaxX; \
- const int miny = Y_FLIP(fxMesa->clipMaxY);
-
-#define HW_ENDCLIPLOOP() \
- } while (0)
-
-
-/* 16 bit, ARGB1555 color spanline and pixel functions */
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_1555
-
-#undef BYTESPERPIXEL
-#define BYTESPERPIXEL 2
-
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p, color) \
- p = TDFXPACKCOLOR1555( color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \
- TDFXPACKCOLOR1555( r, g, b, a )
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch); \
- rgba[0] = FX_rgb_scale_5[(p >> 10) & 0x1F]; \
- rgba[1] = FX_rgb_scale_5[(p >> 5) & 0x1F]; \
- rgba[2] = FX_rgb_scale_5[ p & 0x1F]; \
- rgba[3] = (p & 0x8000) ? 255 : 0; \
- } while (0)
-
-#define TAG(x) tdfx##x##_ARGB1555
-#include "../dri/common/spantmp.h"
-
-
-/* 16 bit, RGB565 color spanline and pixel functions */
-/* [dBorca] Hack alert:
- * This is wrong. The alpha value is lost, even when we provide
- * HW alpha (565 w/o depth buffering). To really update alpha buffer,
- * we would need to do the 565 writings via 8888 colorformat and rely
- * on the Voodoo to perform color scaling. In which case our 565 span
- * would look nicer! But this violates FSAA rules...
- */
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_565
-
-#undef BYTESPERPIXEL
-#define BYTESPERPIXEL 2
-
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p, color) \
- p = TDFXPACKCOLOR565( color[RCOMP], color[GCOMP], color[BCOMP] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \
- TDFXPACKCOLOR565( r, g, b )
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch); \
- rgba[0] = FX_rgb_scale_5[(p >> 11) & 0x1F]; \
- rgba[1] = FX_rgb_scale_6[(p >> 5) & 0x3F]; \
- rgba[2] = FX_rgb_scale_5[ p & 0x1F]; \
- rgba[3] = 0xff; \
- } while (0)
-
-#define TAG(x) tdfx##x##_RGB565
-#include "../dri/common/spantmp.h"
-
-
-/* 32 bit, ARGB8888 color spanline and pixel functions */
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_8888
-
-#undef BYTESPERPIXEL
-#define BYTESPERPIXEL 4
-
-#undef INIT_MONO_PIXEL
-#define INIT_MONO_PIXEL(p, color) \
- p = TDFXPACKCOLOR8888( color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \
- TDFXPACKCOLOR8888( r, g, b, a )
-
-#define WRITE_PIXEL( _x, _y, p ) \
- *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
- } while (0)
-
-#define TAG(x) tdfx##x##_ARGB8888
-#include "../dri/common/spantmp.h"
-
-
-/************************************************************************/
-/***** Depth functions *****/
-/************************************************************************/
-
-#define DBG 0
-
-#undef HW_WRITE_LOCK
-#undef HW_WRITE_UNLOCK
-#undef HW_READ_LOCK
-#undef HW_READ_UNLOCK
-
-#define HW_CLIPLOOP HW_WRITE_CLIPLOOP
-
-#define LOCAL_DEPTH_VARS \
- GLuint pitch = info.strideInBytes; \
- GLuint height = fxMesa->height; \
- char *buf = (char *)((char *)info.lfbPtr + 0 /* x, y offset */); \
- (void) buf;
-
-#define HW_WRITE_LOCK() \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GrLfbInfo_t info; \
- info.size = sizeof(GrLfbInfo_t); \
- if ( grLfbLock( GR_LFB_WRITE_ONLY, \
- GR_BUFFER_AUXBUFFER, LFB_MODE, \
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) {
-
-#define HW_WRITE_UNLOCK() \
- grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_AUXBUFFER); \
- }
-
-#define HW_READ_LOCK() \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GrLfbInfo_t info; \
- info.size = sizeof(GrLfbInfo_t); \
- if ( grLfbLock( GR_LFB_READ_ONLY, GR_BUFFER_AUXBUFFER, \
- LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) {
-
-#define HW_READ_UNLOCK() \
- grLfbUnlock( GR_LFB_READ_ONLY, GR_BUFFER_AUXBUFFER); \
- }
-
-
-/* 16 bit, depth spanline and pixel functions */
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_ZA16
-
-#undef BYTESPERPIXEL
-#define BYTESPERPIXEL 2
-
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = d
-
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch)
-
-#define TAG(x) tdfx##x##_Z16
-#include "../dri/common/depthtmp.h"
-
-
-/* 24 bit, depth spanline and pixel functions (for use w/ stencil) */
-/* [dBorca] Hack alert:
- * This is evil. The incoming Mesa's 24bit depth value
- * is shifted left 8 bits, to obtain a full 32bit value,
- * which will be thrown into the framebuffer. We rely on
- * the fact that Voodoo hardware transforms a 32bit value
- * into 24bit value automatically and, MOST IMPORTANT, won't
- * alter the upper 8bits of the value already existing in the
- * framebuffer (where stencil resides).
- */
-
-#undef LFB_MODE
-#define LFB_MODE GR_LFBWRITEMODE_Z32
-
-#undef BYTESPERPIXEL
-#define BYTESPERPIXEL 4
-
-#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = d << 8
-
-#define READ_DEPTH( d, _x, _y ) \
- d = (*(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch)) & 0xffffff
-
-#define TAG(x) tdfx##x##_Z24
-#include "../dri/common/depthtmp.h"
-
-
-/* 32 bit, depth spanline and pixel functions (for use w/o stencil) */
-/* [dBorca] Hack alert:
- * This is more evil. We make Mesa run in 32bit depth, but
- * tha Voodoo HW can only handle 24bit depth. Well, exploiting
- * the pixel pipeline, we can achieve 24:8 format for greater
- * precision...
- * If anyone tells me how to really store 32bit values into the
- * depth buffer, I'll write the *_Z32 routines. Howver, bear in
- * mind that means running without stencil!
- */
-
-/************************************************************************/
-/***** Span functions (optimized) *****/
-/************************************************************************/
-
-/*
- * Read a span of 15-bit RGB pixels. Note, we don't worry about cliprects
- * since OpenGL says obscured pixels have undefined values.
- */
-static void fxReadRGBASpan_ARGB1555 (const GLcontext * ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- GLint x, GLint y,
- GLubyte rgba[][4])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrLfbInfo_t info;
- info.size = sizeof(GrLfbInfo_t);
- if (grLfbLock(GR_LFB_READ_ONLY, fxMesa->currentFB,
- GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
- const GLint winX = 0;
- const GLint winY = fxMesa->height - 1;
- const GLushort *data16 = (const GLushort *)((const GLubyte *)info.lfbPtr +
- (winY - y) * info.strideInBytes +
- (winX + x) * 2);
- const GLuint *data32 = (const GLuint *) data16;
- GLuint i, j;
- GLuint extraPixel = (n & 1);
- n -= extraPixel;
-
- for (i = j = 0; i < n; i += 2, j++) {
- GLuint pixel = data32[j];
- rgba[i][0] = FX_rgb_scale_5[(pixel >> 10) & 0x1F];
- rgba[i][1] = FX_rgb_scale_5[(pixel >> 5) & 0x1F];
- rgba[i][2] = FX_rgb_scale_5[ pixel & 0x1F];
- rgba[i][3] = (pixel & 0x8000) ? 255 : 0;
- rgba[i+1][0] = FX_rgb_scale_5[(pixel >> 26) & 0x1F];
- rgba[i+1][1] = FX_rgb_scale_5[(pixel >> 21) & 0x1F];
- rgba[i+1][2] = FX_rgb_scale_5[(pixel >> 16) & 0x1F];
- rgba[i+1][3] = (pixel & 0x80000000) ? 255 : 0;
- }
- if (extraPixel) {
- GLushort pixel = data16[n];
- rgba[n][0] = FX_rgb_scale_5[(pixel >> 10) & 0x1F];
- rgba[n][1] = FX_rgb_scale_5[(pixel >> 5) & 0x1F];
- rgba[n][2] = FX_rgb_scale_5[ pixel & 0x1F];
- rgba[n][3] = (pixel & 0x8000) ? 255 : 0;
- }
-
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- }
-}
-
-/*
- * Read a span of 16-bit RGB pixels. Note, we don't worry about cliprects
- * since OpenGL says obscured pixels have undefined values.
- */
-static void fxReadRGBASpan_RGB565 (const GLcontext * ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- GLint x, GLint y,
- GLubyte rgba[][4])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrLfbInfo_t info;
- info.size = sizeof(GrLfbInfo_t);
- if (grLfbLock(GR_LFB_READ_ONLY, fxMesa->currentFB,
- GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
- const GLint winX = 0;
- const GLint winY = fxMesa->height - 1;
- const GLushort *data16 = (const GLushort *)((const GLubyte *)info.lfbPtr +
- (winY - y) * info.strideInBytes +
- (winX + x) * 2);
- const GLuint *data32 = (const GLuint *) data16;
- GLuint i, j;
- GLuint extraPixel = (n & 1);
- n -= extraPixel;
-
- for (i = j = 0; i < n; i += 2, j++) {
- GLuint pixel = data32[j];
- rgba[i][0] = FX_rgb_scale_5[(pixel >> 11) & 0x1F];
- rgba[i][1] = FX_rgb_scale_6[(pixel >> 5) & 0x3F];
- rgba[i][2] = FX_rgb_scale_5[ pixel & 0x1F];
- rgba[i][3] = 255;
- rgba[i+1][0] = FX_rgb_scale_5[(pixel >> 27) & 0x1F];
- rgba[i+1][1] = FX_rgb_scale_6[(pixel >> 21) & 0x3F];
- rgba[i+1][2] = FX_rgb_scale_5[(pixel >> 16) & 0x1F];
- rgba[i+1][3] = 255;
- }
- if (extraPixel) {
- GLushort pixel = data16[n];
- rgba[n][0] = FX_rgb_scale_5[(pixel >> 11) & 0x1F];
- rgba[n][1] = FX_rgb_scale_6[(pixel >> 5) & 0x3F];
- rgba[n][2] = FX_rgb_scale_5[ pixel & 0x1F];
- rgba[n][3] = 255;
- }
-
- grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
- }
-}
-
-/*
- * Read a span of 32-bit RGB pixels. Note, we don't worry about cliprects
- * since OpenGL says obscured pixels have undefined values.
- */
-static void fxReadRGBASpan_ARGB8888 (const GLcontext * ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- GLint x, GLint y,
- GLubyte rgba[][4])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint i;
- grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba);
- for (i = 0; i < n; i++) {
- GLubyte c = rgba[i][0];
- rgba[i][0] = rgba[i][2];
- rgba[i][2] = c;
- }
-}
-
-
-/************************************************************************/
-/***** Depth functions (optimized) *****/
-/************************************************************************/
-
-static void
-fxReadDepthSpan_Z16(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLdepth depth[])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLint bottom = fxMesa->height - 1;
- GLushort depth16[MAX_WIDTH];
- GLuint i;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxReadDepthSpan_Z16(...)\n");
- }
-
- grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
- for (i = 0; i < n; i++) {
- depth[i] = depth16[i];
- }
-}
-
-
-static void
-fxReadDepthSpan_Z24(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLdepth depth[])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLint bottom = fxMesa->height - 1;
- GLuint i;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxReadDepthSpan_Z24(...)\n");
- }
-
- grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth);
- for (i = 0; i < n; i++) {
- depth[i] &= 0xffffff;
- }
-}
-
-
-/************************************************************************/
-/***** Stencil functions (optimized) *****/
-/************************************************************************/
-
-static void
-fxWriteStencilSpan (GLcontext *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const GLstencil stencil[], const GLubyte mask[])
-{
- /*
- * XXX todo
- */
-}
-
-static void
-fxReadStencilSpan(GLcontext * ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLstencil stencil[])
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLint bottom = fxMesa->height - 1;
- GLuint zs32[MAX_WIDTH];
- GLuint i;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxReadStencilSpan(...)\n");
- }
-
- grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, zs32);
- for (i = 0; i < n; i++) {
- stencil[i] = zs32[i] >> 24;
- }
-}
-
-static void
-fxWriteStencilPixels (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
- const GLint x[], const GLint y[],
- const GLstencil stencil[],
- const GLubyte mask[])
-{
- /*
- * XXX todo
- */
-}
-
-static void
-fxReadStencilPixels (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
- const GLint x[], const GLint y[],
- GLstencil stencil[])
-{
- /*
- * XXX todo
- */
-}
-
-
-
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void
-fxDDSetBuffer(GLcontext * ctx, GLframebuffer * buffer, GLuint bufferBit)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- (void) buffer;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDSetBuffer(%x)\n", (int)bufferBit);
- }
-
- if (bufferBit == BUFFER_BIT_FRONT_LEFT) {
- fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- grRenderBuffer(fxMesa->currentFB);
- }
- else if (bufferBit == BUFFER_BIT_BACK_LEFT) {
- fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- grRenderBuffer(fxMesa->currentFB);
- }
-}
-
-
-/************************************************************************/
-
-
-
-void
-fxSetupDDSpanPointers(GLcontext * ctx)
-{
- struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx );
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- swdd->SetBuffer = fxDDSetBuffer;
-
- switch (fxMesa->colDepth) {
- case 15:
- swdd->WriteRGBASpan = tdfxWriteRGBASpan_ARGB1555;
- swdd->WriteRGBSpan = tdfxWriteRGBSpan_ARGB1555;
- swdd->WriteRGBAPixels = tdfxWriteRGBAPixels_ARGB1555;
- swdd->WriteMonoRGBASpan = tdfxWriteMonoRGBASpan_ARGB1555;
- swdd->WriteMonoRGBAPixels = tdfxWriteMonoRGBAPixels_ARGB1555;
- swdd->ReadRGBASpan = /*td*/fxReadRGBASpan_ARGB1555;
- swdd->ReadRGBAPixels = tdfxReadRGBAPixels_ARGB1555;
-
- swdd->WriteDepthSpan = tdfxWriteDepthSpan_Z16;
- swdd->WriteDepthPixels = tdfxWriteDepthPixels_Z16;
- swdd->ReadDepthSpan = /*td*/fxReadDepthSpan_Z16;
- swdd->ReadDepthPixels = tdfxReadDepthPixels_Z16;
- break;
- case 16:
- swdd->WriteRGBASpan = tdfxWriteRGBASpan_RGB565;
- swdd->WriteRGBSpan = tdfxWriteRGBSpan_RGB565;
- swdd->WriteRGBAPixels = tdfxWriteRGBAPixels_RGB565;
- swdd->WriteMonoRGBASpan = tdfxWriteMonoRGBASpan_RGB565;
- swdd->WriteMonoRGBAPixels = tdfxWriteMonoRGBAPixels_RGB565;
- swdd->ReadRGBASpan = /*td*/fxReadRGBASpan_RGB565;
- swdd->ReadRGBAPixels = tdfxReadRGBAPixels_RGB565;
-
- swdd->WriteDepthSpan = tdfxWriteDepthSpan_Z16;
- swdd->WriteDepthPixels = tdfxWriteDepthPixels_Z16;
- swdd->ReadDepthSpan = /*td*/fxReadDepthSpan_Z16;
- swdd->ReadDepthPixels = tdfxReadDepthPixels_Z16;
- break;
- case 32:
- swdd->WriteRGBASpan = tdfxWriteRGBASpan_ARGB8888;
- swdd->WriteRGBSpan = tdfxWriteRGBSpan_ARGB8888;
- swdd->WriteRGBAPixels = tdfxWriteRGBAPixels_ARGB8888;
- swdd->WriteMonoRGBASpan = tdfxWriteMonoRGBASpan_ARGB8888;
- swdd->WriteMonoRGBAPixels = tdfxWriteMonoRGBAPixels_ARGB8888;
- swdd->ReadRGBASpan = /*td*/fxReadRGBASpan_ARGB8888;
- swdd->ReadRGBAPixels = tdfxReadRGBAPixels_ARGB8888;
-
- swdd->WriteDepthSpan = tdfxWriteDepthSpan_Z24;
- swdd->WriteDepthPixels = tdfxWriteDepthPixels_Z24;
- swdd->ReadDepthSpan = /*td*/fxReadDepthSpan_Z24;
- swdd->ReadDepthPixels = tdfxReadDepthPixels_Z24;
- break;
- }
-
- if (fxMesa->haveHwStencil) {
- swdd->WriteStencilSpan = fxWriteStencilSpan;
- swdd->ReadStencilSpan = fxReadStencilSpan;
- swdd->WriteStencilPixels = fxWriteStencilPixels;
- swdd->ReadStencilPixels = fxReadStencilPixels;
- }
-#if 0
- swdd->WriteCI8Span = NULL;
- swdd->WriteCI32Span = NULL;
- swdd->WriteMonoCISpan = NULL;
- swdd->WriteCI32Pixels = NULL;
- swdd->WriteMonoCIPixels = NULL;
- swdd->ReadCI32Span = NULL;
- swdd->ReadCI32Pixels = NULL;
-
- swdd->SpanRenderStart = tdfxSpanRenderStart; /* BEGIN_BOARD_LOCK */
- swdd->SpanRenderFinish = tdfxSpanRenderFinish; /* END_BOARD_LOCK */
-#endif
-}
-
-
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_span(void);
-int
-gl_fx_dummy_function_span(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddtex.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddtex.c
deleted file mode 100644
index f3f12c4cc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxddtex.c
+++ /dev/null
@@ -1,1849 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-
-#include "fxdrv.h"
-#include "enums.h"
-#include "image.h"
-#include "teximage.h"
-#include "texformat.h"
-#include "texcompress.h"
-#include "texobj.h"
-#include "texstore.h"
-
-
-/* no borders! can't halve 1x1! (stride > width * comp) not allowed */
-static void
-_mesa_halve2x2_teximage2d ( GLcontext *ctx,
- struct gl_texture_image *texImage,
- GLuint bytesPerPixel,
- GLint srcWidth, GLint srcHeight,
- const GLvoid *srcImage, GLvoid *dstImage )
-{
- GLint i, j, k;
- GLint dstWidth = srcWidth / 2;
- GLint dstHeight = srcHeight / 2;
- GLint srcRowStride = srcWidth * bytesPerPixel;
- GLubyte *src = (GLubyte *)srcImage;
- GLubyte *dst = dstImage;
-
- GLuint bpt = 0;
- GLubyte *_s = NULL;
- GLubyte *_d = NULL;
- GLenum _t = 0;
-
- if (texImage->TexFormat->MesaFormat == MESA_FORMAT_RGB565) {
- _t = GL_UNSIGNED_SHORT_5_6_5_REV;
- bpt = bytesPerPixel;
- } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB4444) {
- _t = GL_UNSIGNED_SHORT_4_4_4_4_REV;
- bpt = bytesPerPixel;
- } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB1555) {
- _t = GL_UNSIGNED_SHORT_1_5_5_5_REV;
- bpt = bytesPerPixel;
- }
- if (bpt) {
- bytesPerPixel = 4;
- srcRowStride = srcWidth * bytesPerPixel;
- if (dstWidth == 0) {
- dstWidth = 1;
- }
- if (dstHeight == 0) {
- dstHeight = 1;
- }
- _s = src = MALLOC(srcRowStride * srcHeight);
- _d = dst = MALLOC(dstWidth * bytesPerPixel * dstHeight);
- _mesa_texstore_rgba8888(ctx, 2, GL_RGBA,
- &_mesa_texformat_rgba8888_rev, src,
- 0, 0, 0, /* dstX/Y/Zoffset */
- srcRowStride, /* dstRowStride */
- 0, /* dstImageStride */
- srcWidth, srcHeight, 1,
- texImage->Format, _t, srcImage, &ctx->DefaultPacking);
- }
-
- if (srcHeight == 1) {
- for (i = 0; i < dstWidth; i++) {
- for (k = 0; k < bytesPerPixel; k++) {
- dst[0] = (src[0] + src[bytesPerPixel] + 1) / 2;
- src++;
- dst++;
- }
- src += bytesPerPixel;
- }
- } else if (srcWidth == 1) {
- for (j = 0; j < dstHeight; j++) {
- for (k = 0; k < bytesPerPixel; k++) {
- dst[0] = (src[0] + src[srcRowStride] + 1) / 2;
- src++;
- dst++;
- }
- src += srcRowStride;
- }
- } else {
- for (j = 0; j < dstHeight; j++) {
- for (i = 0; i < dstWidth; i++) {
- for (k = 0; k < bytesPerPixel; k++) {
- dst[0] = (src[0] +
- src[bytesPerPixel] +
- src[srcRowStride] +
- src[srcRowStride + bytesPerPixel] + 2) / 4;
- src++;
- dst++;
- }
- src += bytesPerPixel;
- }
- src += srcRowStride;
- }
- }
-
- if (bpt) {
- src = _s;
- dst = _d;
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, dstImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstWidth * bpt,
- 0, /* dstImageStride */
- dstWidth, dstHeight, 1,
- GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking);
- FREE(dst);
- FREE(src);
- }
-}
-
-
-void
-fxPrintTextureData(tfxTexInfo * ti)
-{
- fprintf(stderr, "Texture Data:\n");
- if (ti->tObj) {
- fprintf(stderr, "\tName: %d\n", ti->tObj->Name);
- fprintf(stderr, "\tBaseLevel: %d\n", ti->tObj->BaseLevel);
- fprintf(stderr, "\tSize: %d x %d\n",
- ti->tObj->Image[0][ti->tObj->BaseLevel]->Width,
- ti->tObj->Image[0][ti->tObj->BaseLevel]->Height);
- }
- else
- fprintf(stderr, "\tName: UNNAMED\n");
- fprintf(stderr, "\tLast used: %d\n", ti->lastTimeUsed);
- fprintf(stderr, "\tTMU: %ld\n", ti->whichTMU);
- fprintf(stderr, "\t%s\n", (ti->isInTM) ? "In TMU" : "Not in TMU");
- if (ti->tm[0])
- fprintf(stderr, "\tMem0: %x-%x\n", (unsigned) ti->tm[0]->startAddr,
- (unsigned) ti->tm[0]->endAddr);
- if (ti->tm[1])
- fprintf(stderr, "\tMem1: %x-%x\n", (unsigned) ti->tm[1]->startAddr,
- (unsigned) ti->tm[1]->endAddr);
- fprintf(stderr, "\tMipmaps: %d-%d\n", ti->minLevel, ti->maxLevel);
- fprintf(stderr, "\tFilters: min %d max %d\n",
- (int) ti->minFilt, (int) ti->maxFilt);
- fprintf(stderr, "\tClamps: s %d t %d\n", (int) ti->sClamp,
- (int) ti->tClamp);
- fprintf(stderr, "\tScales: s %f t %f\n", ti->sScale, ti->tScale);
- fprintf(stderr, "\t%s\n",
- (ti->fixedPalette) ? "Fixed palette" : "Non fixed palette");
- fprintf(stderr, "\t%s\n", (ti->validated) ? "Validated" : "Not validated");
-}
-
-
-/************************************************************************/
-/*************************** Texture Mapping ****************************/
-/************************************************************************/
-
-static void
-fxTexInvalidate(GLcontext * ctx, struct gl_texture_object *tObj)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti;
-
- ti = fxTMGetTexInfo(tObj);
- if (ti->isInTM)
- fxTMMoveOutTM(fxMesa, tObj); /* TO DO: SLOW but easy to write */
-
- ti->validated = GL_FALSE;
- fxMesa->new_state |= FX_NEW_TEXTURING;
-}
-
-static tfxTexInfo *
-fxAllocTexObjData(fxMesaContext fxMesa)
-{
- tfxTexInfo *ti;
-
- if (!(ti = CALLOC(sizeof(tfxTexInfo)))) {
- fprintf(stderr, "fxAllocTexObjData: ERROR: out of memory !\n");
- fxCloseHardware();
- exit(-1);
- }
-
- ti->validated = GL_FALSE;
- ti->isInTM = GL_FALSE;
-
- ti->whichTMU = FX_TMU_NONE;
-
- ti->tm[FX_TMU0] = NULL;
- ti->tm[FX_TMU1] = NULL;
-
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- ti->maxFilt = GR_TEXTUREFILTER_BILINEAR;
-
- ti->sClamp = GR_TEXTURECLAMP_WRAP;
- ti->tClamp = GR_TEXTURECLAMP_WRAP;
-
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->LODblend = FXFALSE;
-
- return ti;
-}
-
-void
-fxDDTexBind(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDTexBind(%d, %x)\n", tObj->Name, (GLuint)tObj->DriverData);
- }
-
- if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
- return;
-
- if (!tObj->DriverData) {
- tObj->DriverData = fxAllocTexObjData(fxMesa);
- }
- ti = fxTMGetTexInfo(tObj);
-
- fxMesa->texBindNumber++;
- ti->lastTimeUsed = fxMesa->texBindNumber;
-
- fxMesa->new_state |= FX_NEW_TEXTURING;
-}
-
-void
-fxDDTexEnv(GLcontext * ctx, GLenum target, GLenum pname,
- const GLfloat * param)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- if (param)
- fprintf(stderr, "fxDDTexEnv(%x, %x)\n", pname, (GLint) (*param));
- else
- fprintf(stderr, "fxDDTexEnv(%x)\n", pname);
- }
-
- /* apply any lod biasing right now */
- if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
- GLfloat bias = *param;
- CLAMP_SELF(bias, -ctx->Const.MaxTextureLodBias,
- ctx->Const.MaxTextureLodBias - 0.25);
-
- grTexLodBiasValue(GR_TMU0, bias);
-
- if (fxMesa->haveTwoTMUs) {
- grTexLodBiasValue(GR_TMU1, bias);
- }
-
- }
-
- fxMesa->new_state |= FX_NEW_TEXTURING;
-}
-
-void
-fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj,
- GLenum pname, const GLfloat * params)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLenum param = (GLenum) (GLint) params[0];
- tfxTexInfo *ti;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDTexParam(%d, %x, %s, %s)\n",
- tObj->Name, (GLuint) tObj->DriverData,
- _mesa_lookup_enum_by_nr(pname),
- _mesa_lookup_enum_by_nr(param));
- }
-
- if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
- return;
-
- if (!tObj->DriverData)
- tObj->DriverData = fxAllocTexObjData(fxMesa);
- ti = fxTMGetTexInfo(tObj);
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- switch (param) {
- case GL_NEAREST:
- ti->mmMode = GR_MIPMAP_DISABLE;
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- ti->LODblend = FXFALSE;
- break;
- case GL_LINEAR:
- ti->mmMode = GR_MIPMAP_DISABLE;
- ti->minFilt = GR_TEXTUREFILTER_BILINEAR;
- ti->LODblend = FXFALSE;
- break;
- case GL_NEAREST_MIPMAP_LINEAR:
- /* [dBorca]
- * currently Napalm can't do single-pass trilinear,
- * because the way its combiners are set. So we fall back
- * to GL_NEAREST_MIPMAP_NEAREST. We'll let true trilinear
- * enabled for V2, V3.
- */
- if (!fxMesa->HaveCmbExt) {
- if (fxMesa->haveTwoTMUs) {
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->LODblend = FXTRUE;
- } else {
- ti->mmMode = GR_MIPMAP_NEAREST_DITHER;
- ti->LODblend = FXFALSE;
- }
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- break;
- }
- case GL_NEAREST_MIPMAP_NEAREST:
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- ti->LODblend = FXFALSE;
- break;
- case GL_LINEAR_MIPMAP_LINEAR:
- /* [dBorca]
- * currently Napalm can't do single-pass trilinear,
- * because the way its combiners are set. So we fall back
- * to GL_LINEAR_MIPMAP_NEAREST. We'll let true trilinear
- * enabled for V2, V3.
- */
- if (!fxMesa->HaveCmbExt) {
- if (fxMesa->haveTwoTMUs) {
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->LODblend = FXTRUE;
- } else {
- ti->mmMode = GR_MIPMAP_NEAREST_DITHER;
- ti->LODblend = FXFALSE;
- }
- ti->minFilt = GR_TEXTUREFILTER_BILINEAR;
- break;
- }
- case GL_LINEAR_MIPMAP_NEAREST:
- ti->mmMode = GR_MIPMAP_NEAREST;
- ti->minFilt = GR_TEXTUREFILTER_BILINEAR;
- ti->LODblend = FXFALSE;
- break;
- default:
- break;
- }
- fxTexInvalidate(ctx, tObj);
- break;
-
- case GL_TEXTURE_MAG_FILTER:
- switch (param) {
- case GL_NEAREST:
- ti->maxFilt = GR_TEXTUREFILTER_POINT_SAMPLED;
- break;
- case GL_LINEAR:
- ti->maxFilt = GR_TEXTUREFILTER_BILINEAR;
- break;
- default:
- break;
- }
- fxMesa->new_state |= FX_NEW_TEXTURING;
- break;
-
- case GL_TEXTURE_WRAP_S:
- switch (param) {
- case GL_MIRRORED_REPEAT:
- ti->sClamp = GR_TEXTURECLAMP_MIRROR_EXT;
- break;
- case GL_CLAMP_TO_BORDER: /* no-no, but don't REPEAT, either */
- case GL_CLAMP_TO_EDGE: /* CLAMP discarding border */
- case GL_CLAMP:
- ti->sClamp = GR_TEXTURECLAMP_CLAMP;
- break;
- case GL_REPEAT:
- ti->sClamp = GR_TEXTURECLAMP_WRAP;
- break;
- default:
- break;
- }
- fxMesa->new_state |= FX_NEW_TEXTURING;
- break;
-
- case GL_TEXTURE_WRAP_T:
- switch (param) {
- case GL_MIRRORED_REPEAT:
- ti->tClamp = GR_TEXTURECLAMP_MIRROR_EXT;
- break;
- case GL_CLAMP_TO_BORDER: /* no-no, but don't REPEAT, either */
- case GL_CLAMP_TO_EDGE: /* CLAMP discarding border */
- case GL_CLAMP:
- ti->tClamp = GR_TEXTURECLAMP_CLAMP;
- break;
- case GL_REPEAT:
- ti->tClamp = GR_TEXTURECLAMP_WRAP;
- break;
- default:
- break;
- }
- fxMesa->new_state |= FX_NEW_TEXTURING;
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- /* TO DO */
- break;
-
- case GL_TEXTURE_MIN_LOD:
- /* TO DO */
- break;
- case GL_TEXTURE_MAX_LOD:
- /* TO DO */
- break;
- case GL_TEXTURE_BASE_LEVEL:
- fxTexInvalidate(ctx, tObj);
- break;
- case GL_TEXTURE_MAX_LEVEL:
- fxTexInvalidate(ctx, tObj);
- break;
-
- default:
- break;
- }
-}
-
-void
-fxDDTexDel(GLcontext * ctx, struct gl_texture_object *tObj)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDTexDel(%d, %p)\n", tObj->Name, (void *) ti);
- }
-
- if (!ti)
- return;
-
- fxTMFreeTexture(fxMesa, tObj);
-
- FREE(ti);
- tObj->DriverData = NULL;
-
- /* Free mipmap images and the texture object itself */
- _mesa_delete_texture_object(ctx, tObj);
-}
-
-
-/**
- * Allocate a new texture object.
- * Called via ctx->Driver.NewTextureObject.
- * Note: this function will be called during context creation to
- * allocate the default texture objects.
- */
-struct gl_texture_object *
-fxDDNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- obj = _mesa_new_texture_object(ctx, name, target);
- return obj;
-}
-
-
-/*
- * Return true if texture is resident, false otherwise.
- */
-GLboolean
-fxDDIsTextureResident(GLcontext *ctx, struct gl_texture_object *tObj)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- return (ti && ti->isInTM);
-}
-
-
-
-/*
- * Convert a gl_color_table texture palette to Glide's format.
- */
-static GrTexTable_t
-convertPalette(const fxMesaContext fxMesa, FxU32 data[256], const struct gl_color_table *table)
-{
- const GLubyte *tableUB = (const GLubyte *) table->Table;
- GLint width = table->Size;
- FxU32 r, g, b, a;
- GLint i;
-
- ASSERT(table->Type == GL_UNSIGNED_BYTE);
-
- switch (table->Format) {
- case GL_INTENSITY:
- for (i = 0; i < width; i++) {
- r = tableUB[i];
- g = tableUB[i];
- b = tableUB[i];
- a = tableUB[i];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE;
- case GL_LUMINANCE:
- for (i = 0; i < width; i++) {
- r = tableUB[i];
- g = tableUB[i];
- b = tableUB[i];
- a = 255;
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE;
- case GL_ALPHA:
- for (i = 0; i < width; i++) {
- r = g = b = 255;
- a = tableUB[i];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE;
- case GL_LUMINANCE_ALPHA:
- for (i = 0; i < width; i++) {
- r = g = b = tableUB[i * 2 + 0];
- a = tableUB[i * 2 + 1];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE;
- default:
- case GL_RGB:
- for (i = 0; i < width; i++) {
- r = tableUB[i * 3 + 0];
- g = tableUB[i * 3 + 1];
- b = tableUB[i * 3 + 2];
- a = 255;
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return GR_TEXTABLE_PALETTE;
- case GL_RGBA:
- for (i = 0; i < width; i++) {
- r = tableUB[i * 4 + 0];
- g = tableUB[i * 4 + 1];
- b = tableUB[i * 4 + 2];
- a = tableUB[i * 4 + 3];
- data[i] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE;
- }
-}
-
-
-void
-fxDDTexPalette(GLcontext * ctx, struct gl_texture_object *tObj)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (tObj) {
- /* per-texture palette */
- tfxTexInfo *ti;
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDTexPalette(%d, %x)\n",
- tObj->Name, (GLuint) tObj->DriverData);
- }
- /* This might be a proxy texture. */
- if (!tObj->Palette.Table)
- return;
- if (!tObj->DriverData)
- tObj->DriverData = fxAllocTexObjData(fxMesa);
- ti = fxTMGetTexInfo(tObj);
- ti->paltype = convertPalette(fxMesa, ti->palette.data, &tObj->Palette);
- fxTexInvalidate(ctx, tObj);
- }
- else {
- /* global texture palette */
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDTexPalette(global)\n");
- }
- fxMesa->glbPalType = convertPalette(fxMesa, fxMesa->glbPalette.data, &ctx->Texture.Palette);
- fxMesa->new_state |= FX_NEW_TEXTURING;
-
- grTexDownloadTable(fxMesa->glbPalType, &(fxMesa->glbPalette));
- }
-}
-
-
-void
-fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxDDTexUseGlbPalette(%d)\n", state);
- }
-
- fxMesa->haveGlobalPaletteTexture = state;
- fxMesa->new_state |= FX_NEW_TEXTURING;
-}
-
-
-static int
-logbase2(int n)
-{
- GLint i = 1;
- GLint log2 = 0;
-
- if (n < 0) {
- return -1;
- }
-
- while (n > i) {
- i *= 2;
- log2++;
- }
- if (i != n) {
- return -1;
- }
- else {
- return log2;
- }
-}
-
-
-/* fxTexGetInfo
- * w, h - source texture width and height
- * lodlevel - Glide lod level token for the larger texture dimension
- * ar - Glide aspect ratio token
- * sscale - S scale factor used during triangle setup
- * tscale - T scale factor used during triangle setup
- * wscale - OpenGL -> Glide image width scale factor
- * hscale - OpenGL -> Glide image height scale factor
- */
-int
-fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
- float *sscale, float *tscale,
- int *wscale, int *hscale)
-{
- int logw, logh, ws, hs;
- GrLOD_t l;
- GrAspectRatio_t aspectratio;
- float s, t;
-
- logw = logbase2(w);
- logh = logbase2(h);
-
- l = MAX2(logw, logh);
- aspectratio = logw - logh;
- ws = hs = 1;
- s = t = 256.0f;
-
- /* hardware only allows a maximum aspect ratio of 8x1, so handle
- * |aspectratio| > 3 by scaling the image and using an 8x1 aspect
- * ratio
- */
- switch (aspectratio) {
- case 0:
- break;
- case 1:
- t = 128.0f;
- break;
- case 2:
- t = 64.0f;
- break;
- case 3:
- t = 32.0f;
- break;
- case -1:
- s = 128.0f;
- break;
- case -2:
- s = 64.0f;
- break;
- case -3:
- s = 32.0f;
- break;
- default:
- if (aspectratio > 3) {
- t = 32.0f;
- hs = 1 << (aspectratio - 3);
- aspectratio = GR_ASPECT_LOG2_8x1;
- } else /*if (aspectratio < -3)*/ {
- s = 32.0f;
- ws = 1 << (-aspectratio - 3);
- aspectratio = GR_ASPECT_LOG2_1x8;
- }
- }
-
- if (lodlevel)
- (*lodlevel) = l;
-
- if (ar)
- (*ar) = aspectratio;
-
- if (sscale)
- (*sscale) = s;
-
- if (tscale)
- (*tscale) = t;
-
- if (wscale)
- (*wscale) = ws;
-
- if (hscale)
- (*hscale) = hs;
-
-
- return 1;
-}
-
-static GLboolean
-fxIsTexSupported(GLenum target, GLint internalFormat,
- const struct gl_texture_image *image)
-{
- if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
- return GL_FALSE;
-
-#if 0
- if (!fxTexGetInfo(image->Width, image->Height, NULL, NULL, NULL, NULL, NULL, NULL))
- return GL_FALSE;
-#endif
-
- if (image->Border > 0)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-/**********************************************************************/
-/**** NEW TEXTURE IMAGE FUNCTIONS ****/
-/**********************************************************************/
-extern void
-fxt1_decode_1 (const void *texture, int width,
- int i, int j, unsigned char *rgba);
-
-/* Texel-fetch functions for software texturing and glGetTexImage().
- * We should have been able to use some "standard" fetch functions (which
- * may get defined in texutil.c) but we have to account for scaled texture
- * images on tdfx hardware (the 8:1 aspect ratio limit).
- * Hence, we need special functions here.
- */
-
-static void
-fetch_intensity8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = *texel;
- rgba[GCOMP] = *texel;
- rgba[BCOMP] = *texel;
- rgba[ACOMP] = *texel;
-}
-
-
-static void
-fetch_luminance8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = *texel;
- rgba[GCOMP] = *texel;
- rgba[BCOMP] = *texel;
- rgba[ACOMP] = 255;
-}
-
-
-static void
-fetch_alpha8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = 255;
- rgba[GCOMP] = 255;
- rgba[BCOMP] = 255;
- rgba[ACOMP] = *texel;
-}
-
-
-static void
-fetch_index8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *indexOut)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + j * mml->width + i;
- *indexOut = *texel;
-}
-
-
-static void
-fetch_luminance8_alpha8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLubyte *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLubyte *) texImage->Data) + (j * mml->width + i) * 2;
- rgba[RCOMP] = texel[0];
- rgba[GCOMP] = texel[0];
- rgba[BCOMP] = texel[0];
- rgba[ACOMP] = texel[1];
-}
-
-
-static void
-fetch_r5g6b5(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLushort *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLushort *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = FX_rgb_scale_5[(*texel >> 11) & 0x1F];
- rgba[GCOMP] = FX_rgb_scale_6[(*texel >> 5) & 0x3F];
- rgba[BCOMP] = FX_rgb_scale_5[ *texel & 0x1F];
- rgba[ACOMP] = 255;
-}
-
-
-static void
-fetch_r4g4b4a4(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLushort *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLushort *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = FX_rgb_scale_4[(*texel >> 8) & 0xF];
- rgba[GCOMP] = FX_rgb_scale_4[(*texel >> 4) & 0xF];
- rgba[BCOMP] = FX_rgb_scale_4[ *texel & 0xF];
- rgba[ACOMP] = FX_rgb_scale_4[(*texel >> 12) & 0xF];
-}
-
-
-static void
-fetch_r5g5b5a1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLushort *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLushort *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = FX_rgb_scale_5[(*texel >> 10) & 0x1F];
- rgba[GCOMP] = FX_rgb_scale_5[(*texel >> 5) & 0x1F];
- rgba[BCOMP] = FX_rgb_scale_5[ *texel & 0x1F];
- rgba[ACOMP] = (*texel >> 15) * 255;
-}
-
-
-static void
-fetch_a8r8g8b8(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- const GLuint *texel;
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- texel = ((GLuint *) texImage->Data) + j * mml->width + i;
- rgba[RCOMP] = (((*texel) >> 16) & 0xff);
- rgba[GCOMP] = (((*texel) >> 8) & 0xff);
- rgba[BCOMP] = (((*texel) ) & 0xff);
- rgba[ACOMP] = (((*texel) >> 24) & 0xff);
-}
-
-
-static void
-fetch_rgb_fxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- fxt1_decode_1(texImage->Data, mml->width, i, j, rgba);
- rgba[ACOMP] = 255;
-}
-
-
-static void
-fetch_rgba_fxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- fxt1_decode_1(texImage->Data, mml->width, i, j, rgba);
-}
-
-
-static void
-fetch_rgb_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgb_dxt1.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static void
-fetch_rgba_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgba_dxt1.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static void
-fetch_rgba_dxt3(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgba_dxt3.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-static void
-fetch_rgba_dxt5(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *rgba)
-{
- const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- i = i * mml->wScale;
- j = j * mml->hScale;
-
- _mesa_texformat_rgba_dxt5.FetchTexel2D(texImage, i, j, k, rgba);
-}
-
-
-#if 0 /* break glass in case of emergency */
-static void
-PrintTexture(int w, int h, int c, const GLubyte * data)
-{
- int i, j;
- for (i = 0; i < h; i++) {
- for (j = 0; j < w; j++) {
- if (c == 2)
- fprintf(stderr, "%02x %02x ", data[0], data[1]);
- else if (c == 3)
- fprintf(stderr, "%02x %02x %02x ", data[0], data[1], data[2]);
- data += c;
- }
- fprintf(stderr, "\n");
- }
-}
-#endif
-
-
-const struct gl_texture_format *
-fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum srcFormat, GLenum srcType )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLboolean allow32bpt = fxMesa->HaveTexFmt;
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxDDChooseTextureFormat(...)\n");
- }
-
- switch (internalFormat) {
- case GL_COMPRESSED_RGB:
- /* intentional fall through */
- case 3:
- case GL_RGB:
- if ( srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5 ) {
- return &_mesa_texformat_rgb565;
- }
- /* intentional fall through */
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return (allow32bpt) ? &_mesa_texformat_argb8888
- : &_mesa_texformat_rgb565;
- case GL_RGBA2:
- case GL_RGBA4:
- return &_mesa_texformat_argb4444;
- case GL_COMPRESSED_RGBA:
- /* intentional fall through */
- case 4:
- case GL_RGBA:
- if ( srcFormat == GL_BGRA ) {
- if ( srcType == GL_UNSIGNED_INT_8_8_8_8_REV ) {
- return &_mesa_texformat_argb8888;
- }
- else if ( srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
- return &_mesa_texformat_argb4444;
- }
- else if ( srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
- }
- }
- /* intentional fall through */
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return (allow32bpt) ? &_mesa_texformat_argb8888
- : &_mesa_texformat_argb4444;
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_i8;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_l8;
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_a8;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return &_mesa_texformat_al88;
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- return &_mesa_texformat_rgb565;
- case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
- /* GL_EXT_texture_compression_s3tc */
- /* GL_S3_s3tc */
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- return &_mesa_texformat_rgb_dxt1;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- return &_mesa_texformat_rgba_dxt3;
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
- /* GL_3DFX_texture_compression_FXT1 */
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return &_mesa_texformat_rgb_fxt1;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return &_mesa_texformat_rgba_fxt1;
- default:
- _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat");
- return NULL;
- }
-}
-
-
-static GrTextureFormat_t
-fxGlideFormat(GLint mesaFormat)
-{
- switch (mesaFormat) {
- case MESA_FORMAT_I8:
- return GR_TEXFMT_ALPHA_8;
- case MESA_FORMAT_A8:
- return GR_TEXFMT_ALPHA_8;
- case MESA_FORMAT_L8:
- return GR_TEXFMT_INTENSITY_8;
- case MESA_FORMAT_CI8:
- return GR_TEXFMT_P_8;
- case MESA_FORMAT_AL88:
- return GR_TEXFMT_ALPHA_INTENSITY_88;
- case MESA_FORMAT_RGB565:
- return GR_TEXFMT_RGB_565;
- case MESA_FORMAT_ARGB4444:
- return GR_TEXFMT_ARGB_4444;
- case MESA_FORMAT_ARGB1555:
- return GR_TEXFMT_ARGB_1555;
- case MESA_FORMAT_ARGB8888:
- return GR_TEXFMT_ARGB_8888;
- case MESA_FORMAT_RGB_FXT1:
- case MESA_FORMAT_RGBA_FXT1:
- return GR_TEXFMT_ARGB_CMP_FXT1;
- case MESA_FORMAT_RGB_DXT1:
- case MESA_FORMAT_RGBA_DXT1:
- return GR_TEXFMT_ARGB_CMP_DXT1;
- case MESA_FORMAT_RGBA_DXT3:
- return GR_TEXFMT_ARGB_CMP_DXT3;
- case MESA_FORMAT_RGBA_DXT5:
- return GR_TEXFMT_ARGB_CMP_DXT5;
- default:
- _mesa_problem(NULL, "Unexpected format in fxGlideFormat");
- return 0;
- }
-}
-
-
-static FetchTexelFuncC
-fxFetchFunction(GLint mesaFormat)
-{
- switch (mesaFormat) {
- case MESA_FORMAT_I8:
- return &fetch_intensity8;
- case MESA_FORMAT_A8:
- return &fetch_alpha8;
- case MESA_FORMAT_L8:
- return &fetch_luminance8;
- case MESA_FORMAT_CI8:
- return &fetch_index8;
- case MESA_FORMAT_AL88:
- return &fetch_luminance8_alpha8;
- case MESA_FORMAT_RGB565:
- return &fetch_r5g6b5;
- case MESA_FORMAT_ARGB4444:
- return &fetch_r4g4b4a4;
- case MESA_FORMAT_ARGB1555:
- return &fetch_r5g5b5a1;
- case MESA_FORMAT_ARGB8888:
- return &fetch_a8r8g8b8;
- case MESA_FORMAT_RGB_FXT1:
- return &fetch_rgb_fxt1;
- case MESA_FORMAT_RGBA_FXT1:
- return &fetch_rgba_fxt1;
- case MESA_FORMAT_RGB_DXT1:
- return &fetch_rgb_dxt1;
- case MESA_FORMAT_RGBA_DXT1:
- return &fetch_rgba_dxt1;
- case MESA_FORMAT_RGBA_DXT3:
- return &fetch_rgba_dxt3;
- case MESA_FORMAT_RGBA_DXT5:
- return &fetch_rgba_dxt5;
- default:
- _mesa_problem(NULL, "Unexpected format in fxFetchFunction");
- return NULL;
- }
-}
-
-
-static GLboolean
-adjust2DRatio (GLcontext *ctx,
- GLint xoffset, GLint yoffset,
- GLint width, GLint height,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- tfxMipMapLevel *mml,
- struct gl_texture_image *texImage,
- GLint texelBytes,
- GLint dstRowStride)
-{
- const GLint newWidth = width * mml->wScale;
- const GLint newHeight = height * mml->hScale;
- GLvoid *tempImage;
-
- if (!texImage->IsCompressed) {
- GLubyte *destAddr;
- tempImage = MALLOC(width * height * texelBytes);
- if (!tempImage) {
- return GL_FALSE;
- }
-
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, tempImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- width * texelBytes, /* dstRowStride */
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
-
- /* now rescale */
- /* compute address of dest subimage within the overal tex image */
- destAddr = (GLubyte *) texImage->Data
- + (yoffset * mml->hScale * mml->width
- + xoffset * mml->wScale) * texelBytes;
-
- _mesa_rescale_teximage2d(texelBytes,
- width,
- dstRowStride, /* dst stride */
- width, height,
- newWidth, newHeight,
- tempImage, destAddr);
- } else {
- const GLint rawBytes = 4;
- GLvoid *rawImage = MALLOC(width * height * rawBytes);
- if (!rawImage) {
- return GL_FALSE;
- }
- tempImage = MALLOC(newWidth * newHeight * rawBytes);
- if (!tempImage) {
- return GL_FALSE;
- }
- /* unpack image, apply transfer ops and store in rawImage */
- _mesa_texstore_rgba8888(ctx, 2, GL_RGBA,
- &_mesa_texformat_rgba8888_rev, rawImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- width * rawBytes, /* dstRowStride */
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
- _mesa_rescale_teximage2d(rawBytes,
- width,
- newWidth * rawBytes, /* dst stride */
- width, height, /* src */
- newWidth, newHeight, /* dst */
- rawImage /*src*/, tempImage /*dst*/ );
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, texImage->Data,
- xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- newWidth, newHeight, 1,
- GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking);
- FREE(rawImage);
- }
-
- FREE(tempImage);
-
- return GL_TRUE;
-}
-
-
-void
-fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level,
- GLint internalFormat, GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti;
- tfxMipMapLevel *mml;
- GLint texelBytes, dstRowStride;
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxDDTexImage2D: id=%d int 0x%x format 0x%x type 0x%x %dx%d\n",
- texObj->Name, texImage->IntFormat, format, type,
- texImage->Width, texImage->Height);
- }
-
- if (!fxIsTexSupported(target, internalFormat, texImage)) {
- _mesa_problem(NULL, "fx Driver: unsupported texture in fxDDTexImg()\n");
- return;
- }
-
- if (!texObj->DriverData) {
- texObj->DriverData = fxAllocTexObjData(fxMesa);
- if (!texObj->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
- ti = fxTMGetTexInfo(texObj);
-
- if (!texImage->DriverData) {
- texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel));
- if (!texImage->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
- mml = FX_MIPMAP_DATA(texImage);
-
- fxTexGetInfo(width, height, NULL, NULL, NULL, NULL,
- &mml->wScale, &mml->hScale);
-
- mml->width = width * mml->wScale;
- mml->height = height * mml->hScale;
-
-#if FX_COMPRESS_S3TC_AS_FXT1_HACK
- /* [koolsmoky] substitute FXT1 for DXTn and Legacy S3TC */
- if (!ctx->Mesa_DXTn && texImage->IsCompressed) {
- switch (internalFormat) {
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- internalFormat = GL_COMPRESSED_RGB_FXT1_3DFX;
- break;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- internalFormat = GL_COMPRESSED_RGBA_FXT1_3DFX;
- }
- texImage->IntFormat = internalFormat;
- }
-#endif
-#if FX_TC_NAPALM
- if (fxMesa->type >= GR_SSTTYPE_Voodoo4) {
- GLenum texNapalm = 0;
- if (internalFormat == GL_COMPRESSED_RGB) {
- texNapalm = GL_COMPRESSED_RGB_FXT1_3DFX;
- } else if (internalFormat == GL_COMPRESSED_RGBA) {
- texNapalm = GL_COMPRESSED_RGBA_FXT1_3DFX;
- }
- if (texNapalm) {
- texImage->IntFormat = internalFormat = texNapalm;
- texImage->IsCompressed = GL_TRUE;
- }
- }
-#endif
-
- /* choose the texture format */
- assert(ctx->Driver.ChooseTextureFormat);
- texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
- internalFormat, format, type);
- assert(texImage->TexFormat);
- texelBytes = texImage->TexFormat->TexelBytes;
- /*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/
-
- mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat);
-
- /* allocate mipmap buffer */
- assert(!texImage->Data);
- if (texImage->IsCompressed) {
- texImage->CompressedSize = _mesa_compressed_texture_size(ctx,
- mml->width,
- mml->height,
- 1,
- internalFormat);
- dstRowStride = _mesa_compressed_row_stride(internalFormat, mml->width);
- texImage->Data = _mesa_malloc(texImage->CompressedSize);
- } else {
- dstRowStride = mml->width * texelBytes;
- texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes);
- }
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
-
- if (pixels != NULL) {
- if (mml->wScale != 1 || mml->hScale != 1) {
- /* rescale image to overcome 1:8 aspect limitation */
- if (!adjust2DRatio(ctx,
- 0, 0,
- width, height,
- format, type, pixels,
- packing,
- mml,
- texImage,
- texelBytes,
- dstRowStride)
- ) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
- return;
- }
- }
- else {
- /* no rescaling needed */
- /* unpack image, apply transfer ops and store in texImage->Data */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- GLint mipWidth, mipHeight;
- tfxMipMapLevel *mip;
- struct gl_texture_image *mipImage;
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
-
- assert(!texImage->IsCompressed);
-
- while (level < texObj->MaxLevel && level < maxLevels - 1) {
- mipWidth = width / 2;
- if (!mipWidth) {
- mipWidth = 1;
- }
- mipHeight = height / 2;
- if (!mipHeight) {
- mipHeight = 1;
- }
- if ((mipWidth == width) && (mipHeight == height)) {
- break;
- }
- _mesa_TexImage2D(target, ++level, internalFormat,
- mipWidth, mipHeight, border,
- format, type,
- NULL);
- mipImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- mip = FX_MIPMAP_DATA(mipImage);
- _mesa_halve2x2_teximage2d(ctx,
- texImage,
- texelBytes,
- mml->width, mml->height,
- texImage->Data, mipImage->Data);
- texImage = mipImage;
- mml = mip;
- width = mipWidth;
- height = mipHeight;
- }
- }
- }
-
- ti->info.format = mml->glideFormat;
- texImage->FetchTexelc = fxFetchFunction(texImage->TexFormat->MesaFormat);
-
- fxTexInvalidate(ctx, texObj);
-}
-
-
-void
-fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti;
- tfxMipMapLevel *mml;
- GLint texelBytes, dstRowStride;
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxDDTexSubImage2D: id=%d\n", texObj->Name);
- }
-
- if (!texObj->DriverData) {
- _mesa_problem(ctx, "problem in fxDDTexSubImage2D");
- return;
- }
-
- ti = fxTMGetTexInfo(texObj);
- assert(ti);
- mml = FX_MIPMAP_DATA(texImage);
- assert(mml);
-
- assert(texImage->Data); /* must have an existing texture image! */
- assert(texImage->Format);
-
- texelBytes = texImage->TexFormat->TexelBytes;
- if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat, mml->width);
- } else {
- dstRowStride = mml->width * texelBytes;
- }
-
- if (mml->wScale != 1 || mml->hScale != 1) {
- /* need to rescale subimage to match mipmap level's rescale factors */
- if (!adjust2DRatio(ctx,
- xoffset, yoffset,
- width, height,
- format, type, pixels,
- packing,
- mml,
- texImage,
- texelBytes,
- dstRowStride)
- ) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
- return;
- }
- }
- else {
- /* no rescaling needed */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
- texImage->TexFormat, (GLubyte *) texImage->Data,
- xoffset, yoffset, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- GLint mipWidth, mipHeight;
- tfxMipMapLevel *mip;
- struct gl_texture_image *mipImage;
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
-
- assert(!texImage->IsCompressed);
-
- width = texImage->Width;
- height = texImage->Height;
- while (level < texObj->MaxLevel && level < maxLevels - 1) {
- mipWidth = width / 2;
- if (!mipWidth) {
- mipWidth = 1;
- }
- mipHeight = height / 2;
- if (!mipHeight) {
- mipHeight = 1;
- }
- if ((mipWidth == width) && (mipHeight == height)) {
- break;
- }
- ++level;
- mipImage = _mesa_select_tex_image(ctx, texUnit, target, level);
- mip = FX_MIPMAP_DATA(mipImage);
- _mesa_halve2x2_teximage2d(ctx,
- texImage,
- texelBytes,
- mml->width, mml->height,
- texImage->Data, mipImage->Data);
- texImage = mipImage;
- mml = mip;
- width = mipWidth;
- height = mipHeight;
- }
- }
-
- if (ti->validated && ti->isInTM && !texObj->GenerateMipmap)
- fxTMReloadMipMapLevel(fxMesa, texObj, level);
- else
- fxTexInvalidate(ctx, texObj);
-}
-
-
-void
-fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti;
- tfxMipMapLevel *mml;
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxDDCompressedTexImage2D: id=%d int 0x%x %dx%d\n",
- texObj->Name, internalFormat,
- width, height);
- }
-
- assert(texImage->IsCompressed);
-
- if (!fxIsTexSupported(target, internalFormat, texImage)) {
- _mesa_problem(NULL, "fx Driver: unsupported texture in fxDDCompressedTexImg()\n");
- return;
- }
-
- if (!texObj->DriverData) {
- texObj->DriverData = fxAllocTexObjData(fxMesa);
- if (!texObj->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
- ti = fxTMGetTexInfo(texObj);
-
- if (!texImage->DriverData) {
- texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel));
- if (!texImage->DriverData) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
- mml = FX_MIPMAP_DATA(texImage);
-
- fxTexGetInfo(width, height, NULL, NULL, NULL, NULL,
- &mml->wScale, &mml->hScale);
-
- mml->width = width * mml->wScale;
- mml->height = height * mml->hScale;
-
-
- /* choose the texture format */
- assert(ctx->Driver.ChooseTextureFormat);
- texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
- internalFormat, -1/*format*/, -1/*type*/);
- assert(texImage->TexFormat);
-
- /* Determine the appropriate Glide texel format,
- * given the user's internal texture format hint.
- */
- mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat);
-
- /* allocate new storage for texture image, if needed */
- if (!texImage->Data) {
- texImage->CompressedSize = _mesa_compressed_texture_size(ctx,
- mml->width,
- mml->height,
- 1,
- internalFormat);
- texImage->Data = _mesa_malloc(texImage->CompressedSize);
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
- return;
- }
- }
-
- /* save the texture data */
- if (mml->wScale != 1 || mml->hScale != 1) {
- /* [dBorca] Hack alert:
- * now we're screwed. We can't decompress,
- * unless we do it in HW (via textureBuffer).
- * We still have some chances:
- * 1) we got FXT1 textures - we CAN decompress, rescale for
- * aspectratio, then compress back.
- * 2) there is a chance that MIN("s", "t") won't be overflowed.
- * Thus, we don't care about textureclamp and we could lower
- * MIN("uscale", "vscale") below 32. We still have to have
- * our data aligned inside a 8:1 rectangle.
- * 3) just in case if MIN("s", "t") gets overflowed with GL_REPEAT,
- * we replicate the data over the padded area.
- * For now, we take 2) + 3) but texelfetchers will be wrong!
- */
- GLuint srcRowStride = _mesa_compressed_row_stride(internalFormat, width);
-
- GLuint destRowStride = _mesa_compressed_row_stride(internalFormat,
- mml->width);
-
- _mesa_upscale_teximage2d(srcRowStride, (height+3) / 4,
- destRowStride, (mml->height+3) / 4,
- 1, data, srcRowStride,
- texImage->Data);
- ti->padded = GL_TRUE;
- } else {
- MEMCPY(texImage->Data, data, texImage->CompressedSize);
- }
-
- ti->info.format = mml->glideFormat;
- texImage->FetchTexelc = fxFetchFunction(texImage->TexFormat->MesaFormat);
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- assert(!texImage->IsCompressed);
- }
-
- fxTexInvalidate(ctx, texObj);
-}
-
-
-void
-fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target,
- GLint level, GLint xoffset,
- GLint yoffset, GLsizei width,
- GLint height, GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti;
- tfxMipMapLevel *mml;
- GLint destRowStride, srcRowStride;
- GLint i, rows;
- GLubyte *dest;
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxDDCompressedTexSubImage2D: id=%d\n", texObj->Name);
- }
-
- ti = fxTMGetTexInfo(texObj);
- assert(ti);
- mml = FX_MIPMAP_DATA(texImage);
- assert(mml);
-
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, width);
-
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
- mml->width);
- dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
- texImage->IntFormat,
- mml->width,
- (GLubyte*) texImage->Data);
-
- rows = height / 4; /* hardcoded 4, but works for FXT1/DXTC */
-
- for (i = 0; i < rows; i++) {
- MEMCPY(dest, data, srcRowStride);
- dest += destRowStride;
- data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride);
- }
-
- /* [dBorca] Hack alert:
- * see fxDDCompressedTexImage2D for caveats
- */
- if (mml->wScale != 1 || mml->hScale != 1) {
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, texImage->Width);
-
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
- mml->width);
- _mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4,
- destRowStride, mml->height / 4,
- 1, texImage->Data, destRowStride,
- texImage->Data);
- }
-
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- assert(!texImage->IsCompressed);
- }
-
- if (ti->validated && ti->isInTM)
- fxTMReloadMipMapLevel(fxMesa, texObj, level);
- else
- fxTexInvalidate(ctx, texObj);
-}
-
-
-void
-fxDDTexImage1D (GLcontext *ctx, GLenum target, GLint level,
- GLint internalFormat, GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- fxDDTexImage2D(ctx, target, level,
- internalFormat, width, 1, border,
- format, type, pixels,
- packing,
- texObj,
- texImage);
-}
-
-
-void
-fxDDTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset,
- GLsizei width,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- fxDDTexSubImage2D(ctx, target, level,
- xoffset, 0, width, 1,
- format, type, pixels,
- packing,
- texObj,
- texImage);
-}
-
-
-GLboolean
-fxDDTestProxyTexImage (GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLenum format, GLenum type,
- GLint width, GLint height,
- GLint depth, GLint border)
-{
- /* XXX todo - maybe through fxTexValidate() */
- return _mesa_test_proxy_teximage(ctx, target,
- level, internalFormat,
- format, type,
- width, height,
- depth, border);
-}
-
-
-#else /* FX */
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_ddtex(void);
-int
-gl_fx_dummy_function_ddtex(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdrv.h b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdrv.h
deleted file mode 100644
index ca3bdc99b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxdrv.h
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
-
-
-#ifndef FXDRV_H
-#define FXDRV_H
-
-/* If you comment out this define, a variable takes its place, letting
- * you turn debugging on/off from the debugger.
- */
-
-#include "glheader.h"
-
-
-#if defined(__linux__)
-#include <signal.h>
-#endif
-
-#include "context.h"
-#include "imports.h"
-#include "macros.h"
-#include "matrix.h"
-#include "mtypes.h"
-
-#include "GL/fxmesa.h"
-#include "fxglidew.h"
-
-#include "math/m_vector.h"
-
-
-/* Define some shorter names for these things.
- */
-#define XCOORD GR_VERTEX_X_OFFSET
-#define YCOORD GR_VERTEX_Y_OFFSET
-#define ZCOORD GR_VERTEX_OOZ_OFFSET
-#define OOWCOORD GR_VERTEX_OOW_OFFSET
-
-#define S0COORD GR_VERTEX_SOW_TMU0_OFFSET
-#define T0COORD GR_VERTEX_TOW_TMU0_OFFSET
-#define S1COORD GR_VERTEX_SOW_TMU1_OFFSET
-#define T1COORD GR_VERTEX_TOW_TMU1_OFFSET
-
-
-
-#ifdef __i386__
-#define FXCOLOR4( c ) (* (int *)c)
-#else
-#define FXCOLOR4( c ) ( \
- ( ((unsigned int)(c[3]))<<24 ) | \
- ( ((unsigned int)(c[2]))<<16 ) | \
- ( ((unsigned int)(c[1]))<<8 ) | \
- ( (unsigned int)(c[0])) )
-#endif
-
-#define TDFXPACKCOLOR1555( r, g, b, a ) \
- ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \
- ((a) ? 0x8000 : 0))
-#define TDFXPACKCOLOR565( r, g, b ) \
- ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
-#define TDFXPACKCOLOR8888( r, g, b, a ) \
- (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-
-
-/* fastpath flags first
- */
-#define SETUP_TMU0 0x1
-#define SETUP_TMU1 0x2
-#define SETUP_RGBA 0x4
-#define SETUP_SNAP 0x8
-#define SETUP_XYZW 0x10
-#define SETUP_PTEX 0x20
-#define SETUP_PSIZ 0x40
-#define SETUP_SPEC 0x80
-#define SETUP_FOGC 0x100
-#define MAX_SETUP 0x200
-
-
-#define FX_NUM_TMU 2
-
-#define FX_TMU0 GR_TMU0
-#define FX_TMU1 GR_TMU1
-#define FX_TMU_SPLIT 98
-#define FX_TMU_BOTH 99
-#define FX_TMU_NONE 100
-
-/* Used for fxMesa->lastUnitsMode */
-
-#define FX_UM_NONE 0x00000000
-
-#define FX_UM_E0_REPLACE 0x00000001
-#define FX_UM_E0_MODULATE 0x00000002
-#define FX_UM_E0_DECAL 0x00000004
-#define FX_UM_E0_BLEND 0x00000008
-#define FX_UM_E0_ADD 0x00000010
-
-#define FX_UM_E1_REPLACE 0x00000020
-#define FX_UM_E1_MODULATE 0x00000040
-#define FX_UM_E1_DECAL 0x00000080
-#define FX_UM_E1_BLEND 0x00000100
-#define FX_UM_E1_ADD 0x00000200
-
-#define FX_UM_E_ENVMODE 0x000003ff
-
-#define FX_UM_E0_ALPHA 0x00001000
-#define FX_UM_E0_LUMINANCE 0x00002000
-#define FX_UM_E0_LUMINANCE_ALPHA 0x00004000
-#define FX_UM_E0_INTENSITY 0x00008000
-#define FX_UM_E0_RGB 0x00010000
-#define FX_UM_E0_RGBA 0x00020000
-
-#define FX_UM_E1_ALPHA 0x00040000
-#define FX_UM_E1_LUMINANCE 0x00080000
-#define FX_UM_E1_LUMINANCE_ALPHA 0x00100000
-#define FX_UM_E1_INTENSITY 0x00200000
-#define FX_UM_E1_RGB 0x00400000
-#define FX_UM_E1_RGBA 0x00800000
-
-#define FX_UM_E_IFMT 0x00fff000
-
-#define FX_UM_COLOR_ITERATED 0x01000000
-#define FX_UM_COLOR_CONSTANT 0x02000000
-#define FX_UM_ALPHA_ITERATED 0x04000000
-#define FX_UM_ALPHA_CONSTANT 0x08000000
-
-
-/* for Voodoo3/Banshee's grColorCombine() and grAlphaCombine() */
-struct tdfx_combine {
- GrCombineFunction_t Function; /* Combine function */
- GrCombineFactor_t Factor; /* Combine scale factor */
- GrCombineLocal_t Local; /* Local combine source */
- GrCombineOther_t Other; /* Other combine source */
- FxBool Invert; /* Combine result inversion flag */
-};
-
-/* for Voodoo3's grTexCombine() */
-struct tdfx_texcombine {
- GrCombineFunction_t FunctionRGB;
- GrCombineFactor_t FactorRGB;
- GrCombineFunction_t FunctionAlpha;
- GrCombineFactor_t FactorAlpha;
- FxBool InvertRGB;
- FxBool InvertAlpha;
-};
-
-
-/* for Voodoo5's grColorCombineExt() */
-struct tdfx_combine_color_ext {
- GrCCUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrCCUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrCCUColor_t SourceC;
- FxBool InvertC;
- GrCCUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* for Voodoo5's grAlphaCombineExt() */
-struct tdfx_combine_alpha_ext {
- GrACUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrACUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrACUColor_t SourceC;
- FxBool InvertC;
- GrACUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* for Voodoo5's grTexColorCombineExt() */
-struct tdfx_color_texenv {
- GrTCCUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrTCCUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrTCCUColor_t SourceC;
- FxBool InvertC;
- GrTCCUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* for Voodoo5's grTexAlphaCombineExt() */
-struct tdfx_alpha_texenv {
- GrTACUColor_t SourceA;
- GrCombineMode_t ModeA;
- GrTACUColor_t SourceB;
- GrCombineMode_t ModeB;
- GrTACUColor_t SourceC;
- FxBool InvertC;
- GrTCCUColor_t SourceD;
- FxBool InvertD;
- FxU32 Shift;
- FxBool Invert;
-};
-
-/* Voodoo5's texture combine environment */
-struct tdfx_texcombine_ext {
- struct tdfx_alpha_texenv Alpha;
- struct tdfx_color_texenv Color;
- GrColor_t EnvColor;
-};
-
-
-/*
- Memory range from startAddr to endAddr-1
-*/
-typedef struct MemRange_t
-{
- struct MemRange_t *next;
- FxU32 startAddr, endAddr;
-}
-MemRange;
-
-typedef struct
-{
- GLsizei width, height; /* image size */
- GLint wScale, hScale; /* image scale factor */
- GrTextureFormat_t glideFormat; /* Glide image format */
-}
-tfxMipMapLevel;
-
-/*
- * TDFX-specific texture object data. This hangs off of the
- * struct gl_texture_object DriverData pointer.
- */
-typedef struct tfxTexInfo_t
-{
- struct tfxTexInfo_t *next;
- struct gl_texture_object *tObj;
-
- GLuint lastTimeUsed;
- FxU32 whichTMU;
- GLboolean isInTM;
-
- MemRange *tm[FX_NUM_TMU];
-
- GLint minLevel, maxLevel;
- GLint baseLevelInternalFormat;
-
- GrTexInfo info;
-
- GrTextureFilterMode_t minFilt;
- GrTextureFilterMode_t maxFilt;
- FxBool LODblend;
-
- GrTextureClampMode_t sClamp;
- GrTextureClampMode_t tClamp;
-
- GrMipMapMode_t mmMode;
-
- GLfloat sScale, tScale;
-
- GrTexTable_t paltype;
- GuTexPalette palette;
-
- GLboolean fixedPalette;
- GLboolean validated;
-
- GLboolean padded;
-}
-tfxTexInfo;
-
-typedef struct
-{
- GLuint swapBuffer;
- GLuint reqTexUpload;
- GLuint texUpload;
- GLuint memTexUpload;
-}
-tfxStats;
-
-
-
-typedef struct
-{
- /* Alpha test */
-
- GLboolean alphaTestEnabled;
- GrCmpFnc_t alphaTestFunc;
- GLfloat alphaTestRefValue;
-
- /* Blend function */
-
- GLboolean blendEnabled;
- GrAlphaBlendFnc_t blendSrcFuncRGB;
- GrAlphaBlendFnc_t blendDstFuncRGB;
- GrAlphaBlendFnc_t blendSrcFuncAlpha;
- GrAlphaBlendFnc_t blendDstFuncAlpha;
- GrAlphaBlendOp_t blendEqRGB;
- GrAlphaBlendOp_t blendEqAlpha;
-
- /* Depth test */
-
- GLboolean depthTestEnabled;
- GLboolean depthMask;
- GrCmpFnc_t depthTestFunc;
- FxI32 depthBias;
-
- /* Stencil */
-
- GLboolean stencilEnabled;
- GrCmpFnc_t stencilFunction; /* Stencil function */
- GrStencil_t stencilRefValue; /* Stencil reference value */
- GrStencil_t stencilValueMask; /* Value mask */
- GrStencil_t stencilWriteMask; /* Write mask */
- GrCmpFnc_t stencilFailFunc; /* Stencil fail function */
- GrCmpFnc_t stencilZFailFunc; /* Stencil pass, depth fail function */
- GrCmpFnc_t stencilZPassFunc; /* Stencil pass, depth pass function */
- GrStencil_t stencilClear; /* Buffer clear value */
-}
-tfxUnitsState;
-
-
-
-
-/* Flags for fxMesa->new_state
- */
-#define FX_NEW_TEXTURING 0x1
-#define FX_NEW_BLEND 0x2
-#define FX_NEW_ALPHA 0x4
-#define FX_NEW_DEPTH 0x8
-#define FX_NEW_FOG 0x10
-#define FX_NEW_SCISSOR 0x20
-#define FX_NEW_COLOR_MASK 0x40
-#define FX_NEW_CULL 0x80
-#define FX_NEW_STENCIL 0x100
-
-
-#define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx))
-
-#define FX_TEXTURE_DATA(texUnit) fxTMGetTexInfo((texUnit)->_Current)
-
-#define fxTMGetTexInfo(o) ((tfxTexInfo*)((o)->DriverData))
-
-#define FX_MIPMAP_DATA(img) ((tfxMipMapLevel *) (img)->DriverData)
-
-#define BEGIN_BOARD_LOCK()
-#define END_BOARD_LOCK()
-#define BEGIN_CLIP_LOOP()
-#define END_CLIP_LOOP()
-
-
-
-
-/* Covers the state referenced by IsInHardware:
- */
-#define _FX_NEW_IS_IN_HARDWARE (_NEW_TEXTURE| \
- _NEW_HINT| \
- _NEW_STENCIL| \
- _NEW_BUFFERS| \
- _NEW_COLOR| \
- _NEW_LIGHT)
-
-/* Covers the state referenced by fxDDChooseRenderState
- */
-#define _FX_NEW_RENDERSTATE (_FX_NEW_IS_IN_HARDWARE | \
- _DD_NEW_FLATSHADE | \
- _DD_NEW_TRI_LIGHT_TWOSIDE| \
- _DD_NEW_TRI_OFFSET | \
- _DD_NEW_TRI_UNFILLED | \
- _DD_NEW_TRI_SMOOTH | \
- _DD_NEW_TRI_STIPPLE | \
- _DD_NEW_LINE_SMOOTH | \
- _DD_NEW_LINE_STIPPLE | \
- _DD_NEW_LINE_WIDTH | \
- _DD_NEW_POINT_SMOOTH | \
- _DD_NEW_POINT_SIZE | \
- _NEW_LINE)
-
-
-/* Covers the state referenced by fxDDChooseSetupFunction.
- */
-#define _FX_NEW_SETUP_FUNCTION (_NEW_LIGHT| \
- _NEW_FOG| \
- _NEW_TEXTURE| \
- _NEW_COLOR) \
-
-
-/* lookup table for scaling y bit colors up to 8 bits */
-extern GLuint FX_rgb_scale_4[16];
-extern GLuint FX_rgb_scale_5[32];
-extern GLuint FX_rgb_scale_6[64];
-
-typedef void (*fx_tri_func) (fxMesaContext, GrVertex *, GrVertex *, GrVertex *);
-typedef void (*fx_line_func) (fxMesaContext, GrVertex *, GrVertex *);
-typedef void (*fx_point_func) (fxMesaContext, GrVertex *);
-
-struct tfxMesaContext
-{
- GrTexTable_t glbPalType;
- GuTexPalette glbPalette;
-
- GLcontext *glCtx; /* the core Mesa context */
- GLvisual *glVis; /* describes the color buffer */
- GLframebuffer *glBuffer; /* the ancillary buffers */
-
- GLint board; /* the board used for this context */
- GLint width, height; /* size of color buffer */
-
- GrBuffer_t currentFB;
-
- GLboolean bgrOrder;
- GrColor_t color;
- GrColor_t clearC;
- GrAlpha_t clearA;
- GLuint constColor;
- GrCullMode_t cullMode;
-
- tfxUnitsState unitsState;
- tfxUnitsState restoreUnitsState; /* saved during multipass */
- GLboolean multipass; /* true when drawing intermediate pass */
-
- GLuint new_state;
- GLuint new_gl_state;
-
- /* Texture Memory Manager Data
- */
- GLuint texBindNumber;
- GLint tmuSrc;
- GLuint lastUnitsMode;
- GLuint freeTexMem[FX_NUM_TMU];
- MemRange *tmPool;
- MemRange *tmFree[FX_NUM_TMU];
-
- GLenum fogTableMode;
- GLfloat fogDensity;
- GLfloat fogStart, fogEnd;
- GrFog_t *fogTable;
- GLint textureAlign;
- GLint textureMaxLod;
-
- /* Vertex building and storage:
- */
- GLuint tmu_source[FX_NUM_TMU];
- GLuint SetupIndex;
- GLuint stw_hint_state; /* for grHints */
- GrVertex *verts;
- GLboolean snapVertices; /* needed for older Voodoo hardware */
-
- /* Rasterization:
- */
- GLuint render_index;
- GLuint fallback;
- GLenum render_primitive;
- GLenum raster_primitive;
-
- /* Current rasterization functions
- */
- fx_point_func draw_point;
- fx_line_func draw_line;
- fx_tri_func draw_tri;
-
-
- /* Keep texture scales somewhere handy:
- */
- GLfloat s0scale;
- GLfloat s1scale;
- GLfloat t0scale;
- GLfloat t1scale;
-
- GLfloat inv_s0scale;
- GLfloat inv_s1scale;
- GLfloat inv_t0scale;
- GLfloat inv_t1scale;
-
- /* Glide stuff
- */
- tfxStats stats;
- void *state;
-
- /* Options */
-
- GLboolean verbose;
- GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */
- GLboolean haveHwAlpha;
- GLboolean haveHwStencil;
- GLboolean haveZBuffer;
- GLboolean haveDoubleBuffer;
- GLboolean haveGlobalPaletteTexture;
- GLint swapInterval;
- GLint maxPendingSwapBuffers;
-
- GrContext_t glideContext;
-
- int screen_width;
- int screen_height;
- int clipMinX;
- int clipMaxX;
- int clipMinY;
- int clipMaxY;
-
- int colDepth;
- GLboolean fsaa;
-
- /* Glide (per card) capabilities. These get mirrored
- * from `glbHWConfig' when creating a new context...
- */
- GrSstType type;
- FxBool HavePalExt; /* PALETTE6666 */
- FxBool HavePixExt; /* PIXEXT */
- FxBool HaveTexFmt; /* TEXFMT */
- FxBool HaveCmbExt; /* COMBINE */
- FxBool HaveMirExt; /* TEXMIRROR */
- FxBool HaveTexUma; /* TEXUMA */
- FxBool HaveTexus2; /* Texus 2 - FXT1 */
- struct tdfx_glide Glide;
- char rendererString[64];
-};
-
-
-extern void fxSetupFXUnits(GLcontext *);
-extern void fxSetupDDPointers(GLcontext *);
-
-/* fxvb.c:
- */
-extern void fxAllocVB(GLcontext * ctx);
-extern void fxFreeVB(GLcontext * ctx);
-extern void fxPrintSetupFlags(char *msg, GLuint flags );
-extern void fxCheckTexSizes( GLcontext *ctx );
-extern void fxBuildVertices( GLcontext *ctx, GLuint start, GLuint end,
- GLuint newinputs );
-extern void fxChooseVertexState( GLcontext *ctx );
-
-
-
-
-
-
-/* fxtrifuncs:
- */
-extern void fxDDInitTriFuncs(GLcontext *);
-extern void fxDDChooseRenderState(GLcontext * ctx);
-
-
-extern void fxUpdateDDSpanPointers(GLcontext *);
-extern void fxSetupDDSpanPointers(GLcontext *);
-
-extern void fxPrintTextureData(tfxTexInfo * ti);
-
-extern const struct gl_texture_format *
-fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
- GLenum srcFormat, GLenum srcType );
-extern void fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level,
- GLint internalFormat, GLint width, GLint height,
- GLint border, GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-extern void fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-extern void fxDDCompressedTexImage2D(GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-extern void fxDDCompressedTexSubImage2D(GLcontext *ctx, GLenum target,
- GLint level, GLint xoffset,
- GLint yoffset, GLsizei width,
- GLint height, GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-extern void fxDDTexImage1D(GLcontext * ctx, GLenum target, GLint level,
- GLint internalFormat, GLint width,
- GLint border, GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-extern void fxDDTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
- GLint xoffset, GLint width,
- GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-extern GLboolean fxDDTestProxyTexImage (GLcontext *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLenum format, GLenum type,
- GLint width, GLint height,
- GLint depth, GLint border);
-extern void fxDDTexEnv(GLcontext *, GLenum, GLenum, const GLfloat *);
-extern void fxDDTexParam(GLcontext *, GLenum, struct gl_texture_object *,
- GLenum, const GLfloat *);
-extern void fxDDTexBind(GLcontext *, GLenum, struct gl_texture_object *);
-extern struct gl_texture_object *fxDDNewTextureObject( GLcontext *ctx, GLuint name, GLenum target );
-extern void fxDDTexDel(GLcontext *, struct gl_texture_object *);
-extern GLboolean fxDDIsTextureResident(GLcontext *, struct gl_texture_object *);
-extern void fxDDTexPalette(GLcontext *, struct gl_texture_object *);
-extern void fxDDTexUseGlbPalette(GLcontext *, GLboolean);
-
-extern void fxDDEnable(GLcontext *, GLenum, GLboolean);
-extern void fxDDAlphaFunc(GLcontext *, GLenum, GLfloat);
-extern void fxDDBlendFuncSeparate(GLcontext *, GLenum, GLenum, GLenum, GLenum);
-extern void fxDDBlendEquationSeparate(GLcontext *, GLenum, GLenum);
-extern void fxDDDepthMask(GLcontext *, GLboolean);
-extern void fxDDDepthFunc(GLcontext *, GLenum);
-extern void fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask);
-extern void fxDDStencilMask (GLcontext *ctx, GLuint mask);
-extern void fxDDStencilOp (GLcontext *ctx, GLenum sfail, GLenum zfail, GLenum zpass);
-
-extern void fxDDInitExtensions(GLcontext * ctx);
-
-extern void fxTMInit(fxMesaContext ctx);
-extern void fxTMClose(fxMesaContext ctx);
-extern void fxTMRestoreTextures_NoLock(fxMesaContext ctx);
-extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint);
-extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *);
-#define fxTMMoveOutTM_NoLock fxTMMoveOutTM
-extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *);
-extern void fxTMReloadMipMapLevel(fxMesaContext, struct gl_texture_object *,
- GLint);
-extern void fxTMReloadSubMipMapLevel(fxMesaContext,
- struct gl_texture_object *, GLint, GLint,
- GLint);
-extern int fxTMCheckStartAddr (fxMesaContext fxMesa, GLint tmu, tfxTexInfo *ti);
-
-extern void fxTexGetFormat(GLcontext *, GLenum, GrTextureFormat_t *, GLint *); /* [koolsmoky] */
-
-extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *,
- float *, float *, int *, int *);
-
-extern void fxDDScissor(GLcontext * ctx,
- GLint x, GLint y, GLsizei w, GLsizei h);
-extern void fxDDFogfv(GLcontext * ctx, GLenum pname, const GLfloat * params);
-extern void fxDDColorMask(GLcontext * ctx,
- GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-
-extern void fxDDWriteDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y,
- const GLdepth depth[], const GLubyte mask[]);
-
-extern void fxDDReadDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y,
- GLdepth depth[]);
-
-extern void fxDDWriteDepthPixels(GLcontext * ctx, GLuint n,
- const GLint x[], const GLint y[],
- const GLdepth depth[], const GLubyte mask[]);
-
-extern void fxDDReadDepthPixels(GLcontext * ctx, GLuint n,
- const GLint x[], const GLint y[],
- GLdepth depth[]);
-
-extern void fxDDShadeModel(GLcontext * ctx, GLenum mode);
-
-extern void fxDDCullFace(GLcontext * ctx, GLenum mode);
-extern void fxDDFrontFace(GLcontext * ctx, GLenum mode);
-
-extern void fxPrintRenderState(const char *msg, GLuint state);
-extern void fxPrintHintState(const char *msg, GLuint state);
-
-extern int fxDDInitFxMesaContext(fxMesaContext fxMesa);
-extern void fxDDDestroyFxMesaContext(fxMesaContext fxMesa);
-
-
-extern void fxSetScissorValues(GLcontext * ctx);
-extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa,
- struct gl_texture_object *tObj, GLint where);
-
-extern void fxCheckIsInHardware(GLcontext *ctx);
-
-/* fxsetup:
- * semi-private functions
- */
-void fxSetupCull (GLcontext * ctx);
-void fxSetupScissor (GLcontext * ctx);
-void fxSetupColorMask (GLcontext * ctx);
-void fxSetupBlend (GLcontext *ctx);
-void fxSetupDepthTest (GLcontext *ctx);
-void fxSetupTexture (GLcontext *ctx);
-void fxSetupStencil (GLcontext *ctx);
-void fxSetupStencilFace (GLcontext *ctx, GLint face);
-
-/* Flags for software fallback cases */
-#define FX_FALLBACK_TEXTURE_MAP 0x0001
-#define FX_FALLBACK_DRAW_BUFFER 0x0002
-#define FX_FALLBACK_SPECULAR 0x0004
-#define FX_FALLBACK_STENCIL 0x0008
-#define FX_FALLBACK_RENDER_MODE 0x0010
-#define FX_FALLBACK_LOGICOP 0x0020
-#define FX_FALLBACK_TEXTURE_ENV 0x0040
-#define FX_FALLBACK_TEXTURE_BORDER 0x0080
-#define FX_FALLBACK_COLORMASK 0x0100
-#define FX_FALLBACK_BLEND 0x0200
-#define FX_FALLBACK_TEXTURE_MULTI 0x0400
-
-extern GLuint fx_check_IsInHardware(GLcontext *ctx);
-
-/***
- *** CNORM: clamp float to [0,1] and map to float in [0,255]
- ***/
-#if defined(USE_IEEE) && !defined(DEBUG)
-#define IEEE_0996 0x3f7f0000 /* 0.996 or so */
-#define CNORM(N, F) \
- do { \
- fi_type __tmp; \
- __tmp.f = (F); \
- if (__tmp.i < 0) \
- N = 0; \
- else if (__tmp.i >= IEEE_0996) \
- N = 255.0f; \
- else { \
- N = (F) * 255.0f; \
- } \
- } while (0)
-#else
-#define CNORM(n, f) \
- n = (CLAMP((f), 0.0F, 1.0F) * 255.0F)
-#endif
-
-/* run-time debugging */
-#ifndef FX_DEBUG
-#define FX_DEBUG 0
-#endif
-#if FX_DEBUG
-extern int TDFX_DEBUG;
-#else
-#define TDFX_DEBUG 0
-#endif
-
-/* dirty hacks */
-#define FX_RESCALE_BIG_TEXURES_HACK 1
-#define FX_COMPRESS_S3TC_AS_FXT1_HACK 1
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.c
deleted file mode 100644
index afb9441ad..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.c
+++ /dev/null
@@ -1,2309 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.0.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Mesa/FX device driver. Interface to Glide3.
- *
- * Copyright (c) 2003 - Daniel Borca
- * Email : dborca@users.sourceforge.net
- * Web : http://www.geocities.com/dborca
- */
-
-
-#ifdef FX
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <assert.h>
-
-#define FX_TRAP_GLIDE_internal
-#include "fxg.h"
-
-
-
-/****************************************************************************\
-* logging *
-\****************************************************************************/
-#if FX_TRAP_GLIDE
-#define TRAP_LOG trp_printf
-#ifdef __GNUC__
-__attribute__ ((format(printf, 1, 2)))
-#endif /* __GNUC__ */
-int trp_printf (const char *format, ...)
-{
- va_list arg;
- int n;
- FILE *trap_file;
- va_start(arg, format);
- trap_file = fopen("trap.log", "a");
- if (trap_file == NULL) {
- trap_file = stderr;
- }
- n = vfprintf(trap_file, format, arg);
- fclose(trap_file);
- va_end(arg);
- return n;
-}
-#else /* FX_TRAP_GLIDE */
-#ifdef __GNUC__
-#define TRAP_LOG(format, ...) do {} while (0)
-#else /* __GNUC__ */
-#define TRAP_LOG 0 && (unsigned long)
-#endif /* __GNUC__ */
-#endif /* FX_TRAP_GLIDE */
-
-
-
-#if FX_TRAP_GLIDE
-/****************************************************************************\
-* helpers *
-\****************************************************************************/
-
-#define GOT "\t"
-
-const char *TRP_BOOL (FxBool b)
-{
- return b ? "FXTRUE" : "FXFALSE";
-}
-
-#define TRAP_CASE_STRING(name) case name: return #name
-#define TRAP_NODEFAULT default: assert(0)
-
-const char *TRP_PARAM (FxU32 mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_PARAM_DISABLE);
- TRAP_CASE_STRING(GR_PARAM_ENABLE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_VTX (FxU32 param)
-{
- switch (param) {
- TRAP_CASE_STRING(GR_PARAM_XY);
- TRAP_CASE_STRING(GR_PARAM_Z);
- TRAP_CASE_STRING(GR_PARAM_W);
- TRAP_CASE_STRING(GR_PARAM_Q);
- TRAP_CASE_STRING(GR_PARAM_FOG_EXT);
- TRAP_CASE_STRING(GR_PARAM_A);
- TRAP_CASE_STRING(GR_PARAM_RGB);
- TRAP_CASE_STRING(GR_PARAM_PARGB);
- TRAP_CASE_STRING(GR_PARAM_ST0);
- TRAP_CASE_STRING(GR_PARAM_ST1);
- TRAP_CASE_STRING(GR_PARAM_ST2);
- TRAP_CASE_STRING(GR_PARAM_Q0);
- TRAP_CASE_STRING(GR_PARAM_Q1);
- TRAP_CASE_STRING(GR_PARAM_Q2);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_ARRAY (FxU32 mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_POINTS);
- TRAP_CASE_STRING(GR_LINE_STRIP);
- TRAP_CASE_STRING(GR_LINES);
- TRAP_CASE_STRING(GR_POLYGON);
- TRAP_CASE_STRING(GR_TRIANGLE_STRIP);
- TRAP_CASE_STRING(GR_TRIANGLE_FAN);
- TRAP_CASE_STRING(GR_TRIANGLES);
- TRAP_CASE_STRING(GR_TRIANGLE_STRIP_CONTINUE);
- TRAP_CASE_STRING(GR_TRIANGLE_FAN_CONTINUE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_BUFFER (GrBuffer_t buffer)
-{
- switch (buffer) {
- TRAP_CASE_STRING(GR_BUFFER_FRONTBUFFER);
- TRAP_CASE_STRING(GR_BUFFER_BACKBUFFER);
- TRAP_CASE_STRING(GR_BUFFER_AUXBUFFER);
- TRAP_CASE_STRING(GR_BUFFER_DEPTHBUFFER);
- TRAP_CASE_STRING(GR_BUFFER_ALPHABUFFER);
- TRAP_CASE_STRING(GR_BUFFER_TRIPLEBUFFER);
- TRAP_CASE_STRING(GR_BUFFER_TEXTUREBUFFER_EXT);
- TRAP_CASE_STRING(GR_BUFFER_TEXTUREAUXBUFFER_EXT);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_ORIGIN (GrOriginLocation_t origin_location)
-{
- switch (origin_location) {
- TRAP_CASE_STRING(GR_ORIGIN_UPPER_LEFT);
- TRAP_CASE_STRING(GR_ORIGIN_LOWER_LEFT);
- TRAP_CASE_STRING(GR_ORIGIN_ANY);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_REFRESH (GrScreenRefresh_t refresh_rate)
-{
- switch (refresh_rate) {
- TRAP_CASE_STRING(GR_REFRESH_60Hz);
- TRAP_CASE_STRING(GR_REFRESH_70Hz);
- TRAP_CASE_STRING(GR_REFRESH_72Hz);
- TRAP_CASE_STRING(GR_REFRESH_75Hz);
- TRAP_CASE_STRING(GR_REFRESH_80Hz);
- TRAP_CASE_STRING(GR_REFRESH_90Hz);
- TRAP_CASE_STRING(GR_REFRESH_100Hz);
- TRAP_CASE_STRING(GR_REFRESH_85Hz);
- TRAP_CASE_STRING(GR_REFRESH_120Hz);
- TRAP_CASE_STRING(GR_REFRESH_NONE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_COLFMT (GrColorFormat_t color_format)
-{
- switch (color_format) {
- TRAP_CASE_STRING(GR_COLORFORMAT_ARGB);
- TRAP_CASE_STRING(GR_COLORFORMAT_ABGR);
- TRAP_CASE_STRING(GR_COLORFORMAT_RGBA);
- TRAP_CASE_STRING(GR_COLORFORMAT_BGRA);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_RESOLUTION (GrScreenResolution_t screen_resolution)
-{
- switch (screen_resolution) {
- TRAP_CASE_STRING(GR_RESOLUTION_320x200);
- TRAP_CASE_STRING(GR_RESOLUTION_320x240);
- TRAP_CASE_STRING(GR_RESOLUTION_400x256);
- TRAP_CASE_STRING(GR_RESOLUTION_512x384);
- TRAP_CASE_STRING(GR_RESOLUTION_640x200);
- TRAP_CASE_STRING(GR_RESOLUTION_640x350);
- TRAP_CASE_STRING(GR_RESOLUTION_640x400);
- TRAP_CASE_STRING(GR_RESOLUTION_640x480);
- TRAP_CASE_STRING(GR_RESOLUTION_800x600);
- TRAP_CASE_STRING(GR_RESOLUTION_960x720);
- TRAP_CASE_STRING(GR_RESOLUTION_856x480);
- TRAP_CASE_STRING(GR_RESOLUTION_512x256);
- TRAP_CASE_STRING(GR_RESOLUTION_1024x768);
- TRAP_CASE_STRING(GR_RESOLUTION_1280x1024);
- TRAP_CASE_STRING(GR_RESOLUTION_1600x1200);
- TRAP_CASE_STRING(GR_RESOLUTION_400x300);
- TRAP_CASE_STRING(GR_RESOLUTION_1152x864);
- TRAP_CASE_STRING(GR_RESOLUTION_1280x960);
- TRAP_CASE_STRING(GR_RESOLUTION_1600x1024);
- TRAP_CASE_STRING(GR_RESOLUTION_1792x1344);
- TRAP_CASE_STRING(GR_RESOLUTION_1856x1392);
- TRAP_CASE_STRING(GR_RESOLUTION_1920x1440);
- TRAP_CASE_STRING(GR_RESOLUTION_2048x1536);
- TRAP_CASE_STRING(GR_RESOLUTION_2048x2048);
- TRAP_CASE_STRING(GR_RESOLUTION_NONE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_BLEND (GrAlphaBlendFnc_t func)
-{
- switch (func) {
- TRAP_CASE_STRING(GR_BLEND_ZERO);
- TRAP_CASE_STRING(GR_BLEND_SRC_ALPHA);
- TRAP_CASE_STRING(GR_BLEND_SRC_COLOR);
- /*TRAP_CASE_STRING(GR_BLEND_DST_COLOR); ==GR_BLEND_SRC_COLOR*/
- TRAP_CASE_STRING(GR_BLEND_DST_ALPHA);
- TRAP_CASE_STRING(GR_BLEND_ONE);
- TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SRC_ALPHA);
- TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SRC_COLOR);
- /*TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_DST_COLOR); ==GR_BLEND_ONE_MINUS_SRC_COLOR*/
- TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_DST_ALPHA);
- TRAP_CASE_STRING(GR_BLEND_SAME_COLOR_EXT);
- /*TRAP_CASE_STRING(GR_BLEND_RESERVED_8); ==GR_BLEND_SAME_COLOR_EXT*/
- TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SAME_COLOR_EXT);
- /*TRAP_CASE_STRING(GR_BLEND_RESERVED_9); ==GR_BLEND_ONE_MINUS_SAME_COLOR_EXT*/
- TRAP_CASE_STRING(GR_BLEND_RESERVED_A);
- TRAP_CASE_STRING(GR_BLEND_RESERVED_B);
- TRAP_CASE_STRING(GR_BLEND_RESERVED_C);
- TRAP_CASE_STRING(GR_BLEND_RESERVED_D);
- TRAP_CASE_STRING(GR_BLEND_RESERVED_E);
- TRAP_CASE_STRING(GR_BLEND_ALPHA_SATURATE);
- /*TRAP_CASE_STRING(GR_BLEND_PREFOG_COLOR); ==GR_BLEND_ALPHA_SATURATE*/
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CMBFUNC (GrCombineFunction_t cfunc)
-{
- switch (cfunc) {
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_ZERO);
- /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_NONE); ==GR_COMBINE_FUNCTION_ZERO*/
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_LOCAL);
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_LOCAL_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER);
- /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND_OTHER); ==GR_COMBINE_FUNCTION_SCALE_OTHER*/
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL);
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL);
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL);
- /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND); ==GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL*/
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL);
- /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND_LOCAL); ==GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL*/
- TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CMBFACT (GrCombineFactor_t cfactor)
-{
- switch (cfactor) {
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ZERO);
- /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_NONE); ==GR_COMBINE_FACTOR_ZERO*/
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOCAL);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_OTHER_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOCAL_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_TEXTURE_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_TEXTURE_RGB);
- /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_DETAIL_FACTOR); ==GR_COMBINE_FACTOR_TEXTURE_ALPHA*/
- /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOD_FRACTION); ==GR_COMBINE_FACTOR_TEXTURE_RGB ???*/
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOCAL);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA);
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA);
- /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR); ==GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA*/
- TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CMBLOCAL (GrCombineLocal_t clocal)
-{
- switch (clocal) {
- TRAP_CASE_STRING(GR_COMBINE_LOCAL_ITERATED);
- TRAP_CASE_STRING(GR_COMBINE_LOCAL_CONSTANT);
- /*TRAP_CASE_STRING(GR_COMBINE_LOCAL_NONE); ==GR_COMBINE_LOCAL_CONSTANT*/
- TRAP_CASE_STRING(GR_COMBINE_LOCAL_DEPTH);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CMBOTHER (GrCombineOther_t cother)
-{
- switch (cother) {
- TRAP_CASE_STRING(GR_COMBINE_OTHER_ITERATED);
- TRAP_CASE_STRING(GR_COMBINE_OTHER_TEXTURE);
- TRAP_CASE_STRING(GR_COMBINE_OTHER_CONSTANT);
- /*TRAP_CASE_STRING(GR_COMBINE_OTHER_NONE); ==GR_COMBINE_OTHER_CONSTANT*/
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CMPFUNC (GrCmpFnc_t function)
-{
- switch (function) {
- TRAP_CASE_STRING(GR_CMP_NEVER);
- TRAP_CASE_STRING(GR_CMP_LESS);
- TRAP_CASE_STRING(GR_CMP_EQUAL);
- TRAP_CASE_STRING(GR_CMP_LEQUAL);
- TRAP_CASE_STRING(GR_CMP_GREATER);
- TRAP_CASE_STRING(GR_CMP_NOTEQUAL);
- TRAP_CASE_STRING(GR_CMP_GEQUAL);
- TRAP_CASE_STRING(GR_CMP_ALWAYS);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CKMODE (GrChromakeyMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_CHROMAKEY_DISABLE);
- TRAP_CASE_STRING(GR_CHROMAKEY_ENABLE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CULLMODE (GrCullMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_CULL_DISABLE);
- TRAP_CASE_STRING(GR_CULL_NEGATIVE);
- TRAP_CASE_STRING(GR_CULL_POSITIVE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_DEPTHMODE (GrDepthBufferMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_DEPTHBUFFER_DISABLE);
- TRAP_CASE_STRING(GR_DEPTHBUFFER_ZBUFFER);
- TRAP_CASE_STRING(GR_DEPTHBUFFER_WBUFFER);
- TRAP_CASE_STRING(GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS);
- TRAP_CASE_STRING(GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_DITHERMODE (GrDitherMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_DITHER_DISABLE);
- TRAP_CASE_STRING(GR_DITHER_2x2);
- TRAP_CASE_STRING(GR_DITHER_4x4);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_FOGMODE (GrFogMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_FOG_DISABLE);
- TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
- TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_Q);
- /*TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_W); ==GR_FOG_WITH_TABLE_ON_Q*/
- TRAP_CASE_STRING(GR_FOG_WITH_ITERATED_Z);
- TRAP_CASE_STRING(GR_FOG_WITH_ITERATED_ALPHA_EXT);
- TRAP_CASE_STRING(GR_FOG_MULT2);
- TRAP_CASE_STRING(GR_FOG_ADD2);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_GETNAME (FxU32 pname)
-{
- switch (pname) {
- TRAP_CASE_STRING(GR_BITS_DEPTH);
- TRAP_CASE_STRING(GR_BITS_RGBA);
- TRAP_CASE_STRING(GR_FIFO_FULLNESS);
- TRAP_CASE_STRING(GR_FOG_TABLE_ENTRIES);
- TRAP_CASE_STRING(GR_GAMMA_TABLE_ENTRIES);
- TRAP_CASE_STRING(GR_GLIDE_STATE_SIZE);
- TRAP_CASE_STRING(GR_GLIDE_VERTEXLAYOUT_SIZE);
- TRAP_CASE_STRING(GR_IS_BUSY);
- TRAP_CASE_STRING(GR_LFB_PIXEL_PIPE);
- TRAP_CASE_STRING(GR_MAX_TEXTURE_SIZE);
- TRAP_CASE_STRING(GR_MAX_TEXTURE_ASPECT_RATIO);
- TRAP_CASE_STRING(GR_MEMORY_FB);
- TRAP_CASE_STRING(GR_MEMORY_TMU);
- TRAP_CASE_STRING(GR_MEMORY_UMA);
- TRAP_CASE_STRING(GR_NUM_BOARDS);
- TRAP_CASE_STRING(GR_NON_POWER_OF_TWO_TEXTURES);
- TRAP_CASE_STRING(GR_NUM_FB);
- TRAP_CASE_STRING(GR_NUM_SWAP_HISTORY_BUFFER);
- TRAP_CASE_STRING(GR_NUM_TMU);
- TRAP_CASE_STRING(GR_PENDING_BUFFERSWAPS);
- TRAP_CASE_STRING(GR_REVISION_FB);
- TRAP_CASE_STRING(GR_REVISION_TMU);
- TRAP_CASE_STRING(GR_STATS_LINES);
- TRAP_CASE_STRING(GR_STATS_PIXELS_AFUNC_FAIL);
- TRAP_CASE_STRING(GR_STATS_PIXELS_CHROMA_FAIL);
- TRAP_CASE_STRING(GR_STATS_PIXELS_DEPTHFUNC_FAIL);
- TRAP_CASE_STRING(GR_STATS_PIXELS_IN);
- TRAP_CASE_STRING(GR_STATS_PIXELS_OUT);
- TRAP_CASE_STRING(GR_STATS_PIXELS);
- TRAP_CASE_STRING(GR_STATS_POINTS);
- TRAP_CASE_STRING(GR_STATS_TRIANGLES_IN);
- TRAP_CASE_STRING(GR_STATS_TRIANGLES_OUT);
- TRAP_CASE_STRING(GR_STATS_TRIANGLES);
- TRAP_CASE_STRING(GR_SWAP_HISTORY);
- TRAP_CASE_STRING(GR_SUPPORTS_PASSTHRU);
- TRAP_CASE_STRING(GR_TEXTURE_ALIGN);
- TRAP_CASE_STRING(GR_VIDEO_POSITION);
- TRAP_CASE_STRING(GR_VIEWPORT);
- TRAP_CASE_STRING(GR_WDEPTH_MIN_MAX);
- TRAP_CASE_STRING(GR_ZDEPTH_MIN_MAX);
- TRAP_CASE_STRING(GR_VERTEX_PARAMETER);
- TRAP_CASE_STRING(GR_BITS_GAMMA);
- TRAP_CASE_STRING(GR_GET_RESERVED_1);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_GETSTRING (FxU32 pname)
-{
- switch (pname) {
- TRAP_CASE_STRING(GR_EXTENSION);
- TRAP_CASE_STRING(GR_HARDWARE);
- TRAP_CASE_STRING(GR_RENDERER);
- TRAP_CASE_STRING(GR_VENDOR);
- TRAP_CASE_STRING(GR_VERSION);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_ENABLE (GrEnableMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_AA_ORDERED);
- TRAP_CASE_STRING(GR_ALLOW_MIPMAP_DITHER);
- TRAP_CASE_STRING(GR_PASSTHRU);
- TRAP_CASE_STRING(GR_SHAMELESS_PLUG);
- TRAP_CASE_STRING(GR_VIDEO_SMOOTHING);
- TRAP_CASE_STRING(GR_TEXTURE_UMA_EXT);
- TRAP_CASE_STRING(GR_STENCIL_MODE_EXT);
- TRAP_CASE_STRING(GR_OPENGL_MODE_EXT);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_COORD (GrCoordinateSpaceMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_WINDOW_COORDS);
- TRAP_CASE_STRING(GR_CLIP_COORDS);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_STIPPLEMODE (GrStippleMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_STIPPLE_DISABLE);
- TRAP_CASE_STRING(GR_STIPPLE_PATTERN);
- TRAP_CASE_STRING(GR_STIPPLE_ROTATE);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_LODLEVEL (GrLOD_t lod)
-{
- switch (lod) {
- TRAP_CASE_STRING(GR_LOD_LOG2_2048);
- TRAP_CASE_STRING(GR_LOD_LOG2_1024);
- TRAP_CASE_STRING(GR_LOD_LOG2_512);
- TRAP_CASE_STRING(GR_LOD_LOG2_256);
- TRAP_CASE_STRING(GR_LOD_LOG2_128);
- TRAP_CASE_STRING(GR_LOD_LOG2_64);
- TRAP_CASE_STRING(GR_LOD_LOG2_32);
- TRAP_CASE_STRING(GR_LOD_LOG2_16);
- TRAP_CASE_STRING(GR_LOD_LOG2_8);
- TRAP_CASE_STRING(GR_LOD_LOG2_4);
- TRAP_CASE_STRING(GR_LOD_LOG2_2);
- TRAP_CASE_STRING(GR_LOD_LOG2_1);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_ASPECTRATIO (GrAspectRatio_t aspect)
-{
- switch (aspect) {
- TRAP_CASE_STRING(GR_ASPECT_LOG2_8x1);
- TRAP_CASE_STRING(GR_ASPECT_LOG2_4x1);
- TRAP_CASE_STRING(GR_ASPECT_LOG2_2x1);
- TRAP_CASE_STRING(GR_ASPECT_LOG2_1x1);
- TRAP_CASE_STRING(GR_ASPECT_LOG2_1x2);
- TRAP_CASE_STRING(GR_ASPECT_LOG2_1x4);
- TRAP_CASE_STRING(GR_ASPECT_LOG2_1x8);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TEXFMT (GrTextureFormat_t fmt)
-{
- switch (fmt) {
- TRAP_CASE_STRING(GR_TEXFMT_8BIT);
- /*TRAP_CASE_STRING(GR_TEXFMT_RGB_332); ==GR_TEXFMT_8BIT*/
- TRAP_CASE_STRING(GR_TEXFMT_YIQ_422);
- TRAP_CASE_STRING(GR_TEXFMT_ALPHA_8);
- TRAP_CASE_STRING(GR_TEXFMT_INTENSITY_8);
- TRAP_CASE_STRING(GR_TEXFMT_ALPHA_INTENSITY_44);
- TRAP_CASE_STRING(GR_TEXFMT_P_8);
- TRAP_CASE_STRING(GR_TEXFMT_RSVD0);
- /*TRAP_CASE_STRING(GR_TEXFMT_P_8_6666); ==GR_TEXFMT_RSVD0*/
- /*TRAP_CASE_STRING(GR_TEXFMT_P_8_6666_EXT); ==GR_TEXFMT_RSVD0*/
- TRAP_CASE_STRING(GR_TEXFMT_RSVD1);
- TRAP_CASE_STRING(GR_TEXFMT_16BIT);
- /*TRAP_CASE_STRING(GR_TEXFMT_ARGB_8332); ==GR_TEXFMT_16BIT*/
- TRAP_CASE_STRING(GR_TEXFMT_AYIQ_8422);
- TRAP_CASE_STRING(GR_TEXFMT_RGB_565);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_1555);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_4444);
- TRAP_CASE_STRING(GR_TEXFMT_ALPHA_INTENSITY_88);
- TRAP_CASE_STRING(GR_TEXFMT_AP_88);
- TRAP_CASE_STRING(GR_TEXFMT_RSVD2);
- /*TRAP_CASE_STRING(GR_TEXFMT_RSVD4); ==GR_TEXFMT_RSVD2*/
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_FXT1);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_8888);
- TRAP_CASE_STRING(GR_TEXFMT_YUYV_422);
- TRAP_CASE_STRING(GR_TEXFMT_UYVY_422);
- TRAP_CASE_STRING(GR_TEXFMT_AYUV_444);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT1);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT2);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT3);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT4);
- TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT5);
- TRAP_CASE_STRING(GR_TEXTFMT_RGB_888);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_EVENODD (FxU32 evenOdd)
-{
- switch (evenOdd) {
- TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_EVEN);
- TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_ODD);
- TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_BOTH);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_NCC (GrNCCTable_t table)
-{
- switch (table) {
- TRAP_CASE_STRING(GR_NCCTABLE_NCC0);
- TRAP_CASE_STRING(GR_NCCTABLE_NCC1);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CLAMPMODE (GrTextureClampMode_t clampmode)
-{
- switch (clampmode) {
- TRAP_CASE_STRING(GR_TEXTURECLAMP_WRAP);
- TRAP_CASE_STRING(GR_TEXTURECLAMP_CLAMP);
- TRAP_CASE_STRING(GR_TEXTURECLAMP_MIRROR_EXT);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TEXFILTER (GrTextureFilterMode_t filter_mode)
-{
- switch (filter_mode) {
- TRAP_CASE_STRING(GR_TEXTUREFILTER_POINT_SAMPLED);
- TRAP_CASE_STRING(GR_TEXTUREFILTER_BILINEAR);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TABLE (GrTexTable_t type)
-{
- switch (type) {
- TRAP_CASE_STRING(GR_TEXTABLE_NCC0);
- TRAP_CASE_STRING(GR_TEXTABLE_NCC1);
- TRAP_CASE_STRING(GR_TEXTABLE_PALETTE);
- TRAP_CASE_STRING(GR_TEXTABLE_PALETTE_6666_EXT);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_MIPMODE (GrMipMapMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_MIPMAP_DISABLE);
- TRAP_CASE_STRING(GR_MIPMAP_NEAREST);
- TRAP_CASE_STRING(GR_MIPMAP_NEAREST_DITHER);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TEXBASERANGE (GrTexBaseRange_t range)
-{
- switch (range) {
- TRAP_CASE_STRING(GR_TEXBASE_2048);
- TRAP_CASE_STRING(GR_TEXBASE_1024);
- TRAP_CASE_STRING(GR_TEXBASE_512);
- TRAP_CASE_STRING(GR_TEXBASE_256_TO_1);
- TRAP_CASE_STRING(GR_TEXBASE_256);
- TRAP_CASE_STRING(GR_TEXBASE_128);
- TRAP_CASE_STRING(GR_TEXBASE_64);
- TRAP_CASE_STRING(GR_TEXBASE_32_TO_1);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_LOCKTYPE (GrLock_t type)
-{
- switch (type) {
- TRAP_CASE_STRING(GR_LFB_READ_ONLY);
- TRAP_CASE_STRING(GR_LFB_WRITE_ONLY);
- /*TRAP_CASE_STRING(GR_LFB_IDLE); ==GR_LFB_READ_ONLY*/
- TRAP_CASE_STRING(GR_LFB_NOIDLE);
- TRAP_CASE_STRING(GR_LFB_WRITE_ONLY_EXPLICIT_EXT);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_WRITEMODE (GrLfbWriteMode_t writeMode)
-{
- switch (writeMode) {
- TRAP_CASE_STRING(GR_LFBWRITEMODE_565);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_555);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_1555);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED1);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_888);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_8888);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED2);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED3);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_Z32);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED5);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED6);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED7);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_565_DEPTH);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_555_DEPTH);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_1555_DEPTH);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_ZA16);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_ANY);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_SRCFMT (GrLfbSrcFmt_t src_format)
-{
- switch (src_format) {
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_565);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_555);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_1555);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_888);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_8888);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_565_DEPTH);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_555_DEPTH);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_1555_DEPTH);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_ZA16);
- TRAP_CASE_STRING(GR_LFB_SRC_FMT_RLE16);
- TRAP_CASE_STRING(GR_LFBWRITEMODE_Z32); /*???*/
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CRMODE (GrChromaRangeMode_t mode)
-{
- switch (mode) {
- TRAP_CASE_STRING(GR_CHROMARANGE_DISABLE_EXT);
- /*TRAP_CASE_STRING(GR_CHROMARANGE_RGB_ALL_EXT); ==GR_CHROMARANGE_DISABLE_EXT*/
- TRAP_CASE_STRING(GR_CHROMARANGE_ENABLE_EXT);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_PIXFMT (GrPixelFormat_t pixelformat)
-{
- switch (pixelformat) {
- TRAP_CASE_STRING(GR_PIXFMT_I_8);
- TRAP_CASE_STRING(GR_PIXFMT_AI_88);
- TRAP_CASE_STRING(GR_PIXFMT_RGB_565);
- TRAP_CASE_STRING(GR_PIXFMT_ARGB_1555);
- TRAP_CASE_STRING(GR_PIXFMT_ARGB_8888);
- TRAP_CASE_STRING(GR_PIXFMT_AA_2_RGB_565);
- TRAP_CASE_STRING(GR_PIXFMT_AA_2_ARGB_1555);
- TRAP_CASE_STRING(GR_PIXFMT_AA_2_ARGB_8888);
- TRAP_CASE_STRING(GR_PIXFMT_AA_4_RGB_565);
- TRAP_CASE_STRING(GR_PIXFMT_AA_4_ARGB_1555);
- TRAP_CASE_STRING(GR_PIXFMT_AA_4_ARGB_8888);
- TRAP_CASE_STRING(GR_PIXFMT_AA_8_RGB_565);
- TRAP_CASE_STRING(GR_PIXFMT_AA_8_ARGB_1555);
- TRAP_CASE_STRING(GR_PIXFMT_AA_8_ARGB_8888);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_STENCILOP (GrStencilOp_t op)
-{
- switch (op) {
- TRAP_CASE_STRING(GR_STENCILOP_KEEP);
- TRAP_CASE_STRING(GR_STENCILOP_ZERO);
- TRAP_CASE_STRING(GR_STENCILOP_REPLACE);
- TRAP_CASE_STRING(GR_STENCILOP_INCR_CLAMP);
- TRAP_CASE_STRING(GR_STENCILOP_DECR_CLAMP);
- TRAP_CASE_STRING(GR_STENCILOP_INVERT);
- TRAP_CASE_STRING(GR_STENCILOP_INCR_WRAP);
- TRAP_CASE_STRING(GR_STENCILOP_DECR_WRAP);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_BLENDOP (GrAlphaBlendOp_t op)
-{
- switch (op) {
- TRAP_CASE_STRING(GR_BLEND_OP_ADD);
- TRAP_CASE_STRING(GR_BLEND_OP_SUB);
- TRAP_CASE_STRING(GR_BLEND_OP_REVSUB);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CU (GrCCUColor_t a)
-{
- switch (a) {
- TRAP_CASE_STRING(GR_CMBX_ZERO);
- TRAP_CASE_STRING(GR_CMBX_TEXTURE_ALPHA);
- TRAP_CASE_STRING(GR_CMBX_ALOCAL);
- TRAP_CASE_STRING(GR_CMBX_AOTHER);
- TRAP_CASE_STRING(GR_CMBX_B);
- TRAP_CASE_STRING(GR_CMBX_CONSTANT_ALPHA);
- TRAP_CASE_STRING(GR_CMBX_CONSTANT_COLOR);
- TRAP_CASE_STRING(GR_CMBX_DETAIL_FACTOR);
- TRAP_CASE_STRING(GR_CMBX_ITALPHA);
- TRAP_CASE_STRING(GR_CMBX_ITRGB);
- TRAP_CASE_STRING(GR_CMBX_LOCAL_TEXTURE_ALPHA);
- TRAP_CASE_STRING(GR_CMBX_LOCAL_TEXTURE_RGB);
- TRAP_CASE_STRING(GR_CMBX_LOD_FRAC);
- TRAP_CASE_STRING(GR_CMBX_OTHER_TEXTURE_ALPHA);
- TRAP_CASE_STRING(GR_CMBX_OTHER_TEXTURE_RGB);
- TRAP_CASE_STRING(GR_CMBX_TEXTURE_RGB);
- TRAP_CASE_STRING(GR_CMBX_TMU_CALPHA);
- TRAP_CASE_STRING(GR_CMBX_TMU_CCOLOR);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_CMBMODE (GrCombineMode_t a_mode)
-{
- switch (a_mode) {
- TRAP_CASE_STRING(GR_FUNC_MODE_ZERO);
- TRAP_CASE_STRING(GR_FUNC_MODE_X);
- TRAP_CASE_STRING(GR_FUNC_MODE_ONE_MINUS_X);
- TRAP_CASE_STRING(GR_FUNC_MODE_NEGATIVE_X);
- TRAP_CASE_STRING(GR_FUNC_MODE_X_MINUS_HALF);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TMU (GrChipID_t tmu)
-{
- switch (tmu) {
- TRAP_CASE_STRING(GR_TMU0);
- TRAP_CASE_STRING(GR_TMU1);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TXDITHER (FxU32 dither)
-{
- switch (dither) {
- TRAP_CASE_STRING(TX_DITHER_NONE);
- TRAP_CASE_STRING(TX_DITHER_4x4);
- TRAP_CASE_STRING(TX_DITHER_ERR);
- TRAP_NODEFAULT;
- }
-}
-
-const char *TRP_TXCOMPRESS (FxU32 compress)
-{
- switch (compress) {
- TRAP_CASE_STRING(TX_COMPRESSION_STATISTICAL);
- TRAP_CASE_STRING(TX_COMPRESSION_HEURISTIC);
- TRAP_NODEFAULT;
- }
-}
-
-
-
-/****************************************************************************\
-* REAL POINTERS *
-\****************************************************************************/
-
-/*
-** glide extensions
-*/
-void (FX_CALL *real_grSetNumPendingBuffers) (FxI32 NumPendingBuffers);
-char * (FX_CALL *real_grGetRegistryOrEnvironmentStringExt) (char *theEntry);
-void (FX_CALL *real_grGetGammaTableExt) (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
-void (FX_CALL *real_grChromaRangeModeExt) (GrChromakeyMode_t mode);
-void (FX_CALL *real_grChromaRangeExt) (GrColor_t color, GrColor_t range, GrChromaRangeMode_t match_mode);
-void (FX_CALL *real_grTexChromaModeExt) (GrChipID_t tmu, GrChromakeyMode_t mode);
-void (FX_CALL *real_grTexChromaRangeExt) (GrChipID_t tmu, GrColor_t min, GrColor_t max, GrTexChromakeyMode_t mode);
-
-/* pointcast */
-void (FX_CALL *real_grTexDownloadTableExt) (GrChipID_t tmu, GrTexTable_t type, void *data);
-void (FX_CALL *real_grTexDownloadTablePartialExt) (GrChipID_t tmu, GrTexTable_t type, void *data, int start, int end);
-void (FX_CALL *real_grTexNCCTableExt) (GrChipID_t tmu, GrNCCTable_t table);
-
-/* tbext */
-void (FX_CALL *real_grTextureBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask);
-void (FX_CALL *real_grTextureAuxBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask);
-void (FX_CALL *real_grAuxBufferExt) (GrBuffer_t buffer);
-
-/* napalm */
-GrContext_t (FX_CALL *real_grSstWinOpenExt) (FxU32 hWnd, GrScreenResolution_t resolution, GrScreenRefresh_t refresh, GrColorFormat_t format, GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers);
-void (FX_CALL *real_grStencilFuncExt) (GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask);
-void (FX_CALL *real_grStencilMaskExt) (GrStencil_t value);
-void (FX_CALL *real_grStencilOpExt) (GrStencilOp_t stencil_fail, GrStencilOp_t depth_fail, GrStencilOp_t depth_pass);
-void (FX_CALL *real_grLfbConstantStencilExt) (GrStencil_t value);
-void (FX_CALL *real_grBufferClearExt) (GrColor_t color, GrAlpha_t alpha, FxU32 depth, GrStencil_t stencil);
-void (FX_CALL *real_grColorCombineExt) (GrCCUColor_t a, GrCombineMode_t a_mode, GrCCUColor_t b, GrCombineMode_t b_mode, GrCCUColor_t c, FxBool c_invert, GrCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
-void (FX_CALL *real_grAlphaCombineExt) (GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
-void (FX_CALL *real_grTexColorCombineExt) (GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
-void (FX_CALL *real_grTexAlphaCombineExt) (GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
-void (FX_CALL *real_grConstantColorValueExt) (GrChipID_t tmu, GrColor_t value);
-void (FX_CALL *real_grColorMaskExt) (FxBool r, FxBool g, FxBool b, FxBool a);
-void (FX_CALL *real_grAlphaBlendFunctionExt) (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendOp_t rgb_op, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df, GrAlphaBlendOp_t alpha_op);
-void (FX_CALL *real_grTBufferWriteMaskExt) (FxU32 tmask);
-
-/*
-** texus
-*/
-void (FX_CALL *real_txImgQuantize) (char *dst, char *src, int w, int h, FxU32 format, FxU32 dither);
-void (FX_CALL *real_txMipQuantize) (TxMip *pxMip, TxMip *txMip, int fmt, FxU32 d, FxU32 comp);
-void (FX_CALL *real_txPalToNcc) (GuNccTable *ncc_table, const FxU32 *pal);
-
-
-
-/****************************************************************************\
-* DEBUG HOOKS *
-\****************************************************************************/
-
-/*
-** rendering functions
-*/
-void FX_CALL trap_grDrawPoint (const void *pt)
-{
-#define FN_NAME "grDrawPoint"
- TRAP_LOG("%s(%p)\n", FN_NAME, pt);
- grDrawPoint(pt);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDrawLine (const void *v1,
- const void *v2)
-{
-#define FN_NAME "grDrawLine"
- TRAP_LOG("%s(%p, %p)\n", FN_NAME, v1, v2);
- grDrawLine(v1, v2);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDrawTriangle (const void *a,
- const void *b,
- const void *c)
-{
-#define FN_NAME "grDrawTriangle"
- TRAP_LOG("%s(%p, %p, %p)\n", FN_NAME, a, b, c);
- grDrawTriangle(a, b, c);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grVertexLayout (FxU32 param,
- FxI32 offset,
- FxU32 mode)
-{
-#define FN_NAME "grVertexLayout"
- TRAP_LOG("%s(%s, %ld, %s)\n", FN_NAME, TRP_VTX(param), offset, TRP_PARAM(mode));
- grVertexLayout(param, offset, mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDrawVertexArray (FxU32 mode,
- FxU32 Count,
- void *pointers)
-{
-#define FN_NAME "grDrawVertexArray"
- TRAP_LOG("%s(%s, %lu, %p)\n", FN_NAME, TRP_ARRAY(mode), Count, pointers);
- grDrawVertexArray(mode, Count, pointers);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDrawVertexArrayContiguous (FxU32 mode,
- FxU32 Count,
- void *pointers,
- FxU32 stride)
-{
-#define FN_NAME "grDrawVertexArrayContiguous"
- TRAP_LOG("%s(%s, %lu, %p, %lu)\n", FN_NAME, TRP_ARRAY(mode), Count, pointers, stride);
- grDrawVertexArrayContiguous(mode, Count, pointers, stride);
-#undef FN_NAME
-}
-
-/*
-** Antialiasing Functions
-*/
-void FX_CALL trap_grAADrawTriangle (const void *a,
- const void *b,
- const void *c,
- FxBool ab_antialias,
- FxBool bc_antialias,
- FxBool ca_antialias)
-{
-#define FN_NAME "grAADrawTriangle"
- TRAP_LOG("%s(%p, %p, %p, %s, %s, %s)\n", FN_NAME, a, b, c, TRP_BOOL(ab_antialias), TRP_BOOL(bc_antialias), TRP_BOOL(ca_antialias));
- grAADrawTriangle(a, b, c, ab_antialias, bc_antialias, ca_antialias);
-#undef FN_NAME
-}
-
-/*
-** buffer management
-*/
-void FX_CALL trap_grBufferClear (GrColor_t color,
- GrAlpha_t alpha,
- FxU32 depth)
-{
-#define FN_NAME "grBufferClear"
- TRAP_LOG("%s(%08lx, %02x, %08lx)\n", FN_NAME, color, alpha, depth);
- grBufferClear(color, alpha, depth);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grBufferSwap (FxU32 swap_interval)
-{
-#define FN_NAME "grBufferSwap"
- TRAP_LOG("%s(%lu)\n", FN_NAME, swap_interval);
- grBufferSwap(swap_interval);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grRenderBuffer (GrBuffer_t buffer)
-{
-#define FN_NAME "grRenderBuffer"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BUFFER(buffer));
- grRenderBuffer(buffer);
-#undef FN_NAME
-}
-
-/*
-** error management
-*/
-void FX_CALL trap_grErrorSetCallback (GrErrorCallbackFnc_t fnc)
-{
-#define FN_NAME "grErrorSetCallback"
- TRAP_LOG("%s(%p)\n", FN_NAME, (void *)fnc);
- grErrorSetCallback(fnc);
-#undef FN_NAME
-}
-
-/*
-** SST routines
-*/
-void FX_CALL trap_grFinish (void)
-{
-#define FN_NAME "grFinish"
- TRAP_LOG("%s()\n", FN_NAME);
- grFinish();
-#undef FN_NAME
-}
-
-void FX_CALL trap_grFlush (void)
-{
-#define FN_NAME "grFlush"
- TRAP_LOG("%s()\n", FN_NAME);
- grFlush();
-#undef FN_NAME
-}
-
-GrContext_t FX_CALL trap_grSstWinOpen (FxU32 hWnd,
- GrScreenResolution_t screen_resolution,
- GrScreenRefresh_t refresh_rate,
- GrColorFormat_t color_format,
- GrOriginLocation_t origin_location,
- int nColBuffers,
- int nAuxBuffers)
-{
-#define FN_NAME "grSstWinOpen"
- GrContext_t rv;
- TRAP_LOG("%s(%08lx, %s, %s, %s, %s, %d, %d)\n", FN_NAME, hWnd, TRP_RESOLUTION(screen_resolution), TRP_REFRESH(refresh_rate), TRP_COLFMT(color_format), TRP_ORIGIN(origin_location), nColBuffers, nAuxBuffers);
- rv = grSstWinOpen(hWnd, screen_resolution, refresh_rate, color_format, origin_location, nColBuffers, nAuxBuffers);
- TRAP_LOG(GOT "%p\n", (void *)rv);
- return rv;
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grSstWinClose (GrContext_t context)
-{
-#define FN_NAME "grSstWinClose"
- FxBool rv;
- TRAP_LOG("%s(%p)\n", FN_NAME, (void *)context);
- rv = grSstWinClose(context);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grSelectContext (GrContext_t context)
-{
-#define FN_NAME "grSelectContext"
- FxBool rv;
- TRAP_LOG("%s(%p)\n", FN_NAME, (void *)context);
- rv = grSelectContext(context);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grSstOrigin (GrOriginLocation_t origin)
-{
-#define FN_NAME "grSstOrigin"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ORIGIN(origin));
- grSstOrigin(origin);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grSstSelect (int which_sst)
-{
-#define FN_NAME "grSstSelect"
- TRAP_LOG("%s(%d)\n", FN_NAME, which_sst);
- grSstSelect(which_sst);
-#undef FN_NAME
-}
-
-/*
-** Glide configuration and special effect maintenance functions
-*/
-void FX_CALL trap_grAlphaBlendFunction (GrAlphaBlendFnc_t rgb_sf,
- GrAlphaBlendFnc_t rgb_df,
- GrAlphaBlendFnc_t alpha_sf,
- GrAlphaBlendFnc_t alpha_df)
-{
-#define FN_NAME "grAlphaBlendFunction"
- TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_BLEND(rgb_sf), TRP_BLEND(rgb_df), TRP_BLEND(alpha_sf), TRP_BLEND(alpha_df));
- grAlphaBlendFunction(rgb_sf, rgb_df, alpha_sf, alpha_df);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAlphaCombine (GrCombineFunction_t function,
- GrCombineFactor_t factor,
- GrCombineLocal_t local,
- GrCombineOther_t other,
- FxBool invert)
-{
-#define FN_NAME "grAlphaCombine"
- TRAP_LOG("%s(%s, %s, %s, %s, %s)\n", FN_NAME, TRP_CMBFUNC(function), TRP_CMBFACT(factor), TRP_CMBLOCAL(local), TRP_CMBOTHER(other), TRP_BOOL(invert));
- grAlphaCombine(function, factor, local, other, invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAlphaControlsITRGBLighting (FxBool enable)
-{
-#define FN_NAME "grAlphaControlsITRGBLighting"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BOOL(enable));
- grAlphaControlsITRGBLighting(enable);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAlphaTestFunction (GrCmpFnc_t function)
-{
-#define FN_NAME "grAlphaTestFunction"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CMPFUNC(function));
- grAlphaTestFunction(function);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAlphaTestReferenceValue (GrAlpha_t value)
-{
-#define FN_NAME "grAlphaTestReferenceValue"
- TRAP_LOG("%s(%02x)\n", FN_NAME, value);
- grAlphaTestReferenceValue(value);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grChromakeyMode (GrChromakeyMode_t mode)
-{
-#define FN_NAME "grChromakeyMode"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CKMODE(mode));
- grChromakeyMode(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grChromakeyValue (GrColor_t value)
-{
-#define FN_NAME "grChromakeyValue"
- TRAP_LOG("%s(%08lx)\n", FN_NAME, value);
- grChromakeyValue(value);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grClipWindow (FxU32 minx,
- FxU32 miny,
- FxU32 maxx,
- FxU32 maxy)
-{
-#define FN_NAME "grClipWindow"
- TRAP_LOG("%s(%lu, %lu, %lu, %lu)\n", FN_NAME, minx, miny, maxx, maxy);
- grClipWindow(minx, miny, maxx, maxy);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grColorCombine (GrCombineFunction_t function,
- GrCombineFactor_t factor,
- GrCombineLocal_t local,
- GrCombineOther_t other,
- FxBool invert)
-{
-#define FN_NAME "grColorCombine"
- TRAP_LOG("%s(%s, %s, %s, %s, %s)\n", FN_NAME, TRP_CMBFUNC(function), TRP_CMBFACT(factor), TRP_CMBLOCAL(local), TRP_CMBOTHER(other), TRP_BOOL(invert));
- grColorCombine(function, factor, local, other, invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grColorMask (FxBool rgb,
- FxBool a)
-{
-#define FN_NAME "grColorMask"
- TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_BOOL(rgb), TRP_BOOL(a));
- grColorMask(rgb, a);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grCullMode (GrCullMode_t mode)
-{
-#define FN_NAME "grCullMode"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CULLMODE(mode));
- grCullMode(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grConstantColorValue (GrColor_t value)
-{
-#define FN_NAME "grConstantColorValue"
- TRAP_LOG("%s(%08lx)\n", FN_NAME, value);
- grConstantColorValue(value);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDepthBiasLevel (FxI32 level)
-{
-#define FN_NAME "grDepthBiasLevel"
- TRAP_LOG("%s(%ld)\n", FN_NAME, level);
- grDepthBiasLevel(level);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDepthBufferFunction (GrCmpFnc_t function)
-{
-#define FN_NAME "grDepthBufferFunction"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CMPFUNC(function));
- grDepthBufferFunction(function);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDepthBufferMode (GrDepthBufferMode_t mode)
-{
-#define FN_NAME "grDepthBufferMode"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_DEPTHMODE(mode));
- grDepthBufferMode(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDepthMask (FxBool mask)
-{
-#define FN_NAME "grDepthMask"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BOOL(mask));
- grDepthMask(mask);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDisableAllEffects (void)
-{
-#define FN_NAME "grDisableAllEffects"
- TRAP_LOG("%s()\n", FN_NAME);
- grDisableAllEffects();
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDitherMode (GrDitherMode_t mode)
-{
-#define FN_NAME "grDitherMode"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_DITHERMODE(mode));
- grDitherMode(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grFogColorValue (GrColor_t fogcolor)
-{
-#define FN_NAME "grFogColorValue"
- TRAP_LOG("%s(%08lx)\n", FN_NAME, fogcolor);
- grFogColorValue(fogcolor);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grFogMode (GrFogMode_t mode)
-{
-#define FN_NAME "grFogMode"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_FOGMODE(mode));
- grFogMode(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grFogTable (const GrFog_t ft[])
-{
-#define FN_NAME "grFogTable"
- TRAP_LOG("%s(%p)\n", FN_NAME, ft);
- grFogTable(ft);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grLoadGammaTable (FxU32 nentries,
- FxU32 *red,
- FxU32 *green,
- FxU32 *blue)
-{
-#define FN_NAME "grLoadGammaTable"
- TRAP_LOG("%s(%lu, %p, %p, %p)\n", FN_NAME, nentries, (void *)red, (void *)green, (void *)blue);
- grLoadGammaTable(nentries, red, green, blue);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grSplash (float x,
- float y,
- float width,
- float height,
- FxU32 frame)
-{
-#define FN_NAME "grSplash"
- TRAP_LOG("%s(%f, %f, %f, %f, %lu)\n", FN_NAME, x, y, width, height, frame);
- grSplash(x, y, width, height, frame);
-#undef FN_NAME
-}
-
-FxU32 FX_CALL trap_grGet (FxU32 pname,
- FxU32 plength,
- FxI32 *params)
-{
-#define FN_NAME "grGet"
- FxU32 rv, i;
- TRAP_LOG("%s(%s, %lu, %p)\n", FN_NAME, TRP_GETNAME(pname), plength, (void *)params);
- rv = grGet(pname, plength, params);
- TRAP_LOG(GOT "[");
- for (i = 0; i < (rv/sizeof(FxI32)); i++) {
- TRAP_LOG("%s%ld", i ? ", " : "", params[i]);
- }
- TRAP_LOG("]\n");
- return rv;
-#undef FN_NAME
-}
-
-const char *FX_CALL trap_grGetString (FxU32 pname)
-{
-#define FN_NAME "grGetString"
- const char *rv;
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_GETSTRING(pname));
- rv = grGetString(pname);
- if (rv) {
- TRAP_LOG(GOT "\"%s\"\n", rv);
- } else {
- TRAP_LOG(GOT "NULL\n");
- }
- return rv;
-#undef FN_NAME
-}
-
-FxI32 FX_CALL trap_grQueryResolutions (const GrResolution *resTemplate,
- GrResolution *output)
-{
-#define FN_NAME "grQueryResolutions"
- FxI32 rv;
- TRAP_LOG("%s(%p, %p)\n", FN_NAME, (void *)resTemplate, (void *)output);
- rv = grQueryResolutions(resTemplate, output);
- TRAP_LOG(GOT "%ld\n", rv);
- return rv;
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grReset (FxU32 what)
-{
-#define FN_NAME "grReset"
- FxBool rv;
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_GETNAME(what));
- rv = grReset(what);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-GrProc FX_CALL trap_grGetProcAddress (char *procName)
-{
-#define FN_NAME "grGetProcAddress"
- GrProc rv;
- TRAP_LOG("%s(%s)\n", FN_NAME, procName);
- rv = grGetProcAddress(procName);
- TRAP_LOG(GOT "%p\n", (void *)rv);
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grEnable (GrEnableMode_t mode)
-{
-#define FN_NAME "grEnable"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ENABLE(mode));
- grEnable(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDisable (GrEnableMode_t mode)
-{
-#define FN_NAME "grDisable"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ENABLE(mode));
- grDisable(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grCoordinateSpace (GrCoordinateSpaceMode_t mode)
-{
-#define FN_NAME "grCoordinateSpace"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_COORD(mode));
- grCoordinateSpace(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grDepthRange (FxFloat n,
- FxFloat f)
-{
-#define FN_NAME "grDepthRange"
- TRAP_LOG("%s(%f, %f)\n", FN_NAME, n, f);
- grDepthRange(n, f);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grStippleMode (GrStippleMode_t mode)
-{
-#define FN_NAME "grStippleMode"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_STIPPLEMODE(mode));
- grStippleMode(mode); /* some Glide libs don't have it; not used anyway */
-#undef FN_NAME
-}
-
-void FX_CALL trap_grStipplePattern (GrStipplePattern_t mode)
-{
-#define FN_NAME "grStipplePattern"
- TRAP_LOG("%s(%08lx)\n", FN_NAME, mode);
- grStipplePattern(mode); /* some Glide libs don't have it; not used anyway */
-#undef FN_NAME
-}
-
-void FX_CALL trap_grViewport (FxI32 x,
- FxI32 y,
- FxI32 width,
- FxI32 height)
-{
-#define FN_NAME "grViewport"
- TRAP_LOG("%s(%ld, %ld, %ld, %ld)\n", FN_NAME, x, y, width, height);
- grViewport(x, y, width, height);
-#undef FN_NAME
-}
-
-/*
-** texture mapping control functions
-*/
-FxU32 FX_CALL trap_grTexCalcMemRequired (GrLOD_t lodmin,
- GrLOD_t lodmax,
- GrAspectRatio_t aspect,
- GrTextureFormat_t fmt)
-{
-#define FN_NAME "grTexCalcMemRequired"
- FxU32 rv;
- TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_LODLEVEL(lodmin), TRP_LODLEVEL(lodmax), TRP_ASPECTRATIO(aspect), TRP_TEXFMT(fmt));
- rv = grTexCalcMemRequired(lodmin, lodmax, aspect, fmt);
- TRAP_LOG(GOT "%lu\n", rv);
- return rv;
-#undef FN_NAME
-}
-
-FxU32 FX_CALL trap_grTexTextureMemRequired (FxU32 evenOdd,
- GrTexInfo *info)
-{
-#define FN_NAME "grTexTextureMemRequired"
- FxU32 rv;
- TRAP_LOG("%s(%s, %p)\n", FN_NAME, TRP_EVENODD(evenOdd), (void *)info);
- rv = grTexTextureMemRequired(evenOdd, info);
- TRAP_LOG(GOT "%lu\n", rv);
- return rv;
-#undef FN_NAME
-}
-
-FxU32 FX_CALL trap_grTexMinAddress (GrChipID_t tmu)
-{
-#define FN_NAME "grTexMinAddress"
- FxU32 rv;
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_TMU(tmu));
- rv = grTexMinAddress(tmu);
- TRAP_LOG(GOT "%lu\n", rv);
- return rv;
-#undef FN_NAME
-}
-
-FxU32 FX_CALL trap_grTexMaxAddress (GrChipID_t tmu)
-{
-#define FN_NAME "grTexMaxAddress"
- FxU32 rv;
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_TMU(tmu));
- rv = grTexMaxAddress(tmu);
- TRAP_LOG(GOT "%lu\n", rv);
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexNCCTable (GrNCCTable_t table)
-{
-#define FN_NAME "grTexNCCTable"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_NCC(table));
- grTexNCCTable(table);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexSource (GrChipID_t tmu,
- FxU32 startAddress,
- FxU32 evenOdd,
- GrTexInfo *info)
-{
-#define FN_NAME "grTexSource"
- TRAP_LOG("%s(%s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_EVENODD(evenOdd), (void *)info);
- grTexSource(tmu, startAddress, evenOdd, info);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexClampMode (GrChipID_t tmu,
- GrTextureClampMode_t s_clampmode,
- GrTextureClampMode_t t_clampmode)
-{
-#define FN_NAME "grTexClampMode"
- TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CLAMPMODE(s_clampmode), TRP_CLAMPMODE(t_clampmode));
- grTexClampMode(tmu, s_clampmode, t_clampmode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexCombine (GrChipID_t tmu,
- GrCombineFunction_t rgb_function,
- GrCombineFactor_t rgb_factor,
- GrCombineFunction_t alpha_function,
- GrCombineFactor_t alpha_factor,
- FxBool rgb_invert,
- FxBool alpha_invert)
-{
-#define FN_NAME "grTexCombine"
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CMBFUNC(rgb_function), TRP_CMBFACT(rgb_factor), TRP_CMBFUNC(alpha_function), TRP_CMBFACT(alpha_factor), TRP_BOOL(rgb_invert), TRP_BOOL(alpha_invert));
- grTexCombine(tmu, rgb_function, rgb_factor, alpha_function, alpha_factor, rgb_invert, alpha_invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexDetailControl (GrChipID_t tmu,
- int lod_bias,
- FxU8 detail_scale,
- float detail_max)
-{
-#define FN_NAME "grTexDetailControl"
- TRAP_LOG("%s(%s, %u, %d, %f)\n", FN_NAME, TRP_TMU(tmu), lod_bias, detail_scale, detail_max);
- grTexDetailControl(tmu, lod_bias, detail_scale, detail_max);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexFilterMode (GrChipID_t tmu,
- GrTextureFilterMode_t minfilter_mode,
- GrTextureFilterMode_t magfilter_mode)
-{
-#define FN_NAME "grTexFilterMode"
- TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_TEXFILTER(minfilter_mode), TRP_TEXFILTER(magfilter_mode));
- grTexFilterMode(tmu, minfilter_mode, magfilter_mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexLodBiasValue (GrChipID_t tmu,
- float bias)
-{
-#define FN_NAME "grTexLodBiasValue"
- TRAP_LOG("%s(%s, %f)\n", FN_NAME, TRP_TMU(tmu), bias);
- grTexLodBiasValue(tmu, bias);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexDownloadMipMap (GrChipID_t tmu,
- FxU32 startAddress,
- FxU32 evenOdd,
- GrTexInfo *info)
-{
-#define FN_NAME "grTexDownloadMipMap"
- TRAP_LOG("%s(%s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_EVENODD(evenOdd), (void *)info);
- grTexDownloadMipMap(tmu, startAddress, evenOdd, info);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexDownloadMipMapLevel (GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLod,
- GrLOD_t largeLod,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 evenOdd,
- void *data)
-{
-#define FN_NAME "grTexDownloadMipMapLevel"
- TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLod), TRP_LODLEVEL(largeLod), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(evenOdd), data);
- grTexDownloadMipMapLevel(tmu, startAddress, thisLod, largeLod, aspectRatio, format, evenOdd, data);
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grTexDownloadMipMapLevelPartial (GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLod,
- GrLOD_t largeLod,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 evenOdd,
- void *data,
- int start,
- int end)
-{
-#define FN_NAME "grTexDownloadMipMapLevelPartial"
- FxBool rv;
- TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s, %p, %d, %d)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLod), TRP_LODLEVEL(largeLod), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(evenOdd), data, start, end);
- rv = grTexDownloadMipMapLevelPartial(tmu, startAddress, thisLod, largeLod, aspectRatio, format, evenOdd, data, start, end);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexDownloadTable (GrTexTable_t type,
- void *data)
-{
-#define FN_NAME "grTexDownloadTable"
- TRAP_LOG("%s(%s, %p)\n", FN_NAME, TRP_TABLE(type), data);
- grTexDownloadTable(type, data);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexDownloadTablePartial (GrTexTable_t type,
- void *data,
- int start,
- int end)
-{
-#define FN_NAME "grTexDownloadTablePartial"
- TRAP_LOG("%s(%s, %p, %d, %d)\n", FN_NAME, TRP_TABLE(type), data, start, end);
- grTexDownloadTablePartial(type, data, start, end);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexMipMapMode (GrChipID_t tmu,
- GrMipMapMode_t mode,
- FxBool lodBlend)
-{
-#define FN_NAME "grTexMipMapMode"
- TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_MIPMODE(mode), TRP_BOOL(lodBlend));
- grTexMipMapMode(tmu, mode, lodBlend);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexMultibase (GrChipID_t tmu,
- FxBool enable)
-{
-#define FN_NAME "grTexMultibase"
- TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_BOOL(enable));
- grTexMultibase(tmu, enable);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexMultibaseAddress (GrChipID_t tmu,
- GrTexBaseRange_t range,
- FxU32 startAddress,
- FxU32 evenOdd,
- GrTexInfo *info)
-{
-#define FN_NAME "grTexMultibaseAddress"
- TRAP_LOG("%s(%s, %s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), TRP_TEXBASERANGE(range), startAddress, TRP_EVENODD(evenOdd), (void *)info);
- grTexMultibaseAddress(tmu, range, startAddress, evenOdd, info);
-#undef FN_NAME
-}
-
-/*
-** linear frame buffer functions
-*/
-FxBool FX_CALL trap_grLfbLock (GrLock_t type,
- GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode,
- GrOriginLocation_t origin,
- FxBool pixelPipeline,
- GrLfbInfo_t *info)
-{
-#define FN_NAME "grLfbLock"
- FxBool rv;
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %p)\n", FN_NAME, TRP_LOCKTYPE(type), TRP_BUFFER(buffer), TRP_WRITEMODE(writeMode), TRP_ORIGIN(origin), TRP_BOOL(pixelPipeline), (void *)info);
- rv = grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grLfbUnlock (GrLock_t type,
- GrBuffer_t buffer)
-{
-#define FN_NAME "grLfbUnlock"
- FxBool rv;
- TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_LOCKTYPE(type), TRP_BUFFER(buffer));
- rv = grLfbUnlock(type, buffer);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grLfbConstantAlpha (GrAlpha_t alpha)
-{
-#define FN_NAME "grLfbConstantAlpha"
- TRAP_LOG("%s(%02x)\n", FN_NAME, alpha);
- grLfbConstantAlpha(alpha);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grLfbConstantDepth (FxU32 depth)
-{
-#define FN_NAME "grLfbConstantDepth"
- TRAP_LOG("%s(%08lx)\n", FN_NAME, depth);
- grLfbConstantDepth(depth);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grLfbWriteColorSwizzle (FxBool swizzleBytes,
- FxBool swapWords)
-{
-#define FN_NAME "grLfbWriteColorSwizzle"
- TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_BOOL(swizzleBytes), TRP_BOOL(swapWords));
- grLfbWriteColorSwizzle(swizzleBytes, swapWords);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grLfbWriteColorFormat (GrColorFormat_t colorFormat)
-{
-#define FN_NAME "grLfbWriteColorFormat"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_COLFMT(colorFormat));
- grLfbWriteColorFormat(colorFormat);
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grLfbWriteRegion (GrBuffer_t dst_buffer,
- FxU32 dst_x,
- FxU32 dst_y,
- GrLfbSrcFmt_t src_format,
- FxU32 src_width,
- FxU32 src_height,
- FxBool pixelPipeline,
- FxI32 src_stride,
- void *src_data)
-{
-#define FN_NAME "grLfbWriteRegion"
- FxBool rv;
- TRAP_LOG("%s(%s, %lu, %lu, %s, %lu, %lu, %s, %ld, %p)\n", FN_NAME, TRP_BUFFER(dst_buffer), dst_x, dst_y, TRP_SRCFMT(src_format), src_width, src_height, TRP_BOOL(pixelPipeline), src_stride, src_data);
- rv = grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format, src_width, src_height, pixelPipeline, src_stride, src_data);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-FxBool FX_CALL trap_grLfbReadRegion (GrBuffer_t src_buffer,
- FxU32 src_x,
- FxU32 src_y,
- FxU32 src_width,
- FxU32 src_height,
- FxU32 dst_stride,
- void *dst_data)
-{
-#define FN_NAME "grLfbReadRegion"
- FxBool rv;
- TRAP_LOG("%s(%s, %lu, %lu, %lu, %lu, %ld, %p)\n", FN_NAME, TRP_BUFFER(src_buffer), src_x, src_y, src_width, src_height, dst_stride, dst_data);
- rv = grLfbReadRegion(src_buffer, src_x, src_y, src_width, src_height, dst_stride, dst_data);
- TRAP_LOG(GOT "%s\n", TRP_BOOL(rv));
- return rv;
-#undef FN_NAME
-}
-
-/*
-** glide management functions
-*/
-void FX_CALL trap_grGlideInit (void)
-{
-#define FN_NAME "grGlideInit"
- TRAP_LOG("%s()\n", FN_NAME);
- grGlideInit();
-#undef FN_NAME
-}
-
-void FX_CALL trap_grGlideShutdown (void)
-{
-#define FN_NAME "grGlideShutdown"
- TRAP_LOG("%s()\n", FN_NAME);
- grGlideShutdown();
-#undef FN_NAME
-}
-
-void FX_CALL trap_grGlideGetState (void *state)
-{
-#define FN_NAME "grGlideGetState"
- TRAP_LOG("%s(%p)\n", FN_NAME, state);
- grGlideGetState(state);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grGlideSetState (const void *state)
-{
-#define FN_NAME "grGlideSetState"
- TRAP_LOG("%s(%p)\n", FN_NAME, state);
- grGlideSetState(state);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grGlideGetVertexLayout (void *layout)
-{
-#define FN_NAME "grGlideGetVertexLayout"
- TRAP_LOG("%s(%p)\n", FN_NAME, layout);
- grGlideGetVertexLayout(layout);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grGlideSetVertexLayout (const void *layout)
-{
-#define FN_NAME "grGlideSetVertexLayout"
- TRAP_LOG("%s(%p)\n", FN_NAME, layout);
- grGlideSetVertexLayout(layout);
-#undef FN_NAME
-}
-
-/*
-** glide utility functions
-*/
-void FX_CALL trap_guGammaCorrectionRGB (FxFloat red,
- FxFloat green,
- FxFloat blue)
-{
-#define FN_NAME "guGammaCorrectionRGB"
- TRAP_LOG("%s(%f, %f, %f)\n", FN_NAME, red, green, blue);
- guGammaCorrectionRGB(red, green, blue);
-#undef FN_NAME
-}
-
-float FX_CALL trap_guFogTableIndexToW (int i)
-{
-#define FN_NAME "guFogTableIndexToW"
- float rv;
- TRAP_LOG("%s(%d)\n", FN_NAME, i);
- rv = guFogTableIndexToW(i);
- TRAP_LOG(GOT "%f\n", rv);
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_guFogGenerateExp (GrFog_t *fogtable,
- float density)
-{
-#define FN_NAME "guFogGenerateExp"
- TRAP_LOG("%s(%p, %f)\n", FN_NAME, fogtable, density);
- guFogGenerateExp(fogtable, density);
-#undef FN_NAME
-}
-
-void FX_CALL trap_guFogGenerateExp2 (GrFog_t *fogtable,
- float density)
-{
-#define FN_NAME "guFogGenerateExp2"
- TRAP_LOG("%s(%p, %f)\n", FN_NAME, fogtable, density);
- guFogGenerateExp2(fogtable, density);
-#undef FN_NAME
-}
-
-void FX_CALL trap_guFogGenerateLinear (GrFog_t *fogtable,
- float nearZ,
- float farZ)
-{
-#define FN_NAME "guFogGenerateLinear"
- TRAP_LOG("%s(%p, %f, %f)\n", FN_NAME, fogtable, nearZ, farZ);
- guFogGenerateLinear(fogtable, nearZ, farZ);
-#undef FN_NAME
-}
-
-/*
-** glide extensions
-*/
-void FX_CALL trap_grSetNumPendingBuffers (FxI32 NumPendingBuffers)
-{
-#define FN_NAME "grSetNumPendingBuffers"
- TRAP_LOG("%s(%ld)\n", FN_NAME, NumPendingBuffers);
- assert(real_grSetNumPendingBuffers);
- (*real_grSetNumPendingBuffers)(NumPendingBuffers);
-#undef FN_NAME
-}
-
-char *FX_CALL trap_grGetRegistryOrEnvironmentStringExt (char *theEntry)
-{
-#define FN_NAME "grGetRegistryOrEnvironmentStringExt"
- char *rv;
- TRAP_LOG("%s(\"%s\")\n", FN_NAME, theEntry);
- assert(real_grGetRegistryOrEnvironmentStringExt);
- rv = (*real_grGetRegistryOrEnvironmentStringExt)(theEntry);
- if (rv) {
- TRAP_LOG(GOT "\"%s\"\n", rv);
- } else {
- TRAP_LOG(GOT "NULL\n");
- }
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grGetGammaTableExt (FxU32 nentries,
- FxU32 *red,
- FxU32 *green,
- FxU32 *blue)
-{
-#define FN_NAME "grGetGammaTableExt"
- TRAP_LOG("%s(%lu, %p, %p, %p)\n", FN_NAME, nentries, (void *)red, (void *)green, (void *)blue);
- assert(real_grGetGammaTableExt);
- (*real_grGetGammaTableExt)(nentries, red, green, blue);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grChromaRangeModeExt (GrChromakeyMode_t mode)
-{
-#define FN_NAME "grChromaRangeModeExt"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CKMODE(mode));
- assert(real_grChromaRangeModeExt);
- (*real_grChromaRangeModeExt)(mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grChromaRangeExt (GrColor_t color,
- GrColor_t range,
- GrChromaRangeMode_t match_mode)
-{
-#define FN_NAME "grChromaRangeExt"
- TRAP_LOG("%s(%08lx, %08lx, %s)\n", FN_NAME, color, range, TRP_CRMODE(match_mode));
- assert(real_grChromaRangeExt);
- (*real_grChromaRangeExt)(color, range, match_mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexChromaModeExt (GrChipID_t tmu,
- GrChromakeyMode_t mode)
-{
-#define FN_NAME "grTexChromaModeExt"
- TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CKMODE(mode));
- assert(real_grTexChromaModeExt);
- (*real_grTexChromaModeExt)(tmu, mode);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexChromaRangeExt (GrChipID_t tmu,
- GrColor_t min,
- GrColor_t max,
- GrTexChromakeyMode_t mode)
-{
-#define FN_NAME "grTexChromaRangeExt"
- TRAP_LOG("%s(%s, %08lx, %08lx, %s)\n", FN_NAME, TRP_TMU(tmu), min, max, TRP_CRMODE(mode));
- assert(real_grTexChromaRangeExt);
- (*real_grTexChromaRangeExt)(tmu, min, max, mode);
-#undef FN_NAME
-}
-
- /* pointcast */
-void FX_CALL trap_grTexDownloadTableExt (GrChipID_t tmu,
- GrTexTable_t type,
- void *data)
-{
-#define FN_NAME "grTexDownloadTableExt"
- TRAP_LOG("%s(%s, %s, %p)\n", FN_NAME, TRP_TMU(tmu), TRP_TABLE(type), data);
- assert(real_grTexDownloadTableExt);
- (*real_grTexDownloadTableExt)(tmu, type, data);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexDownloadTablePartialExt (GrChipID_t tmu,
- GrTexTable_t type,
- void *data,
- int start,
- int end)
-{
-#define FN_NAME "grTexDownloadTablePartialExt"
- TRAP_LOG("%s(%s, %s, %p, %d, %d)\n", FN_NAME, TRP_TMU(tmu), TRP_TABLE(type), data, start, end);
- assert(real_grTexDownloadTablePartialExt);
- (*real_grTexDownloadTablePartialExt)(tmu, type, data, start, end);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexNCCTableExt (GrChipID_t tmu,
- GrNCCTable_t table)
-{
-#define FN_NAME "grTexNCCTableExt"
- TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_NCC(table));
- assert(real_grTexNCCTableExt);
- (*real_grTexNCCTableExt)(tmu, table);
-#undef FN_NAME
-}
-
- /* tbext */
-void FX_CALL trap_grTextureBufferExt (GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLOD,
- GrLOD_t largeLOD,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 odd_even_mask)
-{
-#define FN_NAME "grTextureBufferExt"
- TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLOD), TRP_LODLEVEL(largeLOD), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(odd_even_mask));
- assert(real_grTextureBufferExt);
- (*real_grTextureBufferExt)(tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTextureAuxBufferExt (GrChipID_t tmu,
- FxU32 startAddress,
- GrLOD_t thisLOD,
- GrLOD_t largeLOD,
- GrAspectRatio_t aspectRatio,
- GrTextureFormat_t format,
- FxU32 odd_even_mask)
-{
-#define FN_NAME "grTextureAuxBufferExt"
- TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLOD), TRP_LODLEVEL(largeLOD), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(odd_even_mask));
- assert(real_grTextureAuxBufferExt);
- (*real_grTextureAuxBufferExt)(tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAuxBufferExt (GrBuffer_t buffer)
-{
-#define FN_NAME "grAuxBufferExt"
- TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BUFFER(buffer));
- assert(real_grAuxBufferExt);
- (*real_grAuxBufferExt)(buffer);
-#undef FN_NAME
-}
-
- /* napalm */
-GrContext_t FX_CALL trap_grSstWinOpenExt (FxU32 hWnd,
- GrScreenResolution_t resolution,
- GrScreenRefresh_t refresh,
- GrColorFormat_t format,
- GrOriginLocation_t origin,
- GrPixelFormat_t pixelformat,
- int nColBuffers,
- int nAuxBuffers)
-{
-#define FN_NAME "grSstWinOpenExt"
- GrContext_t rv;
- TRAP_LOG("%s(%08lx, %s, %s, %s, %s, %s, %d, %d)\n", FN_NAME, hWnd, TRP_RESOLUTION(resolution), TRP_REFRESH(refresh), TRP_COLFMT(format), TRP_ORIGIN(origin), TRP_PIXFMT(pixelformat), nColBuffers, nAuxBuffers);
- assert(real_grSstWinOpenExt);
- rv = (*real_grSstWinOpenExt)(hWnd, resolution, refresh, format, origin, pixelformat, nColBuffers, nAuxBuffers);
- TRAP_LOG(GOT "%p\n", (void *)rv);
- return rv;
-#undef FN_NAME
-}
-
-void FX_CALL trap_grStencilFuncExt (GrCmpFnc_t fnc,
- GrStencil_t ref,
- GrStencil_t mask)
-{
-#define FN_NAME "grStencilFuncExt"
- TRAP_LOG("%s(%s, %02x, %02x)\n", FN_NAME, TRP_CMPFUNC(fnc), ref, mask);
- assert(real_grStencilFuncExt);
- (*real_grStencilFuncExt)(fnc, ref, mask);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grStencilMaskExt (GrStencil_t value)
-{
-#define FN_NAME "grStencilMaskExt"
- TRAP_LOG("%s(%02x)\n", FN_NAME, value);
- assert(real_grStencilMaskExt);
- (*real_grStencilMaskExt)(value);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grStencilOpExt (GrStencilOp_t stencil_fail,
- GrStencilOp_t depth_fail,
- GrStencilOp_t depth_pass)
-{
-#define FN_NAME "grStencilOpExt"
- TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_STENCILOP(stencil_fail), TRP_STENCILOP(depth_fail), TRP_STENCILOP(depth_pass));
- assert(real_grStencilOpExt);
- (*real_grStencilOpExt)(stencil_fail, depth_fail, depth_pass);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grLfbConstantStencilExt (GrStencil_t value)
-{
-#define FN_NAME "grLfbConstantStencilExt"
- TRAP_LOG("%s(%02x)\n", FN_NAME, value);
- assert(real_grLfbConstantStencilExt);
- (*real_grLfbConstantStencilExt)(value);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grBufferClearExt (GrColor_t color,
- GrAlpha_t alpha,
- FxU32 depth,
- GrStencil_t stencil)
-{
-#define FN_NAME "grBufferClearExt"
- TRAP_LOG("%s(%08lx, %02x, %08lx, %02x)\n", FN_NAME, color, alpha, depth, stencil);
- assert(real_grBufferClearExt);
- (*real_grBufferClearExt)(color, alpha, depth, stencil);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grColorCombineExt (GrCCUColor_t a,
- GrCombineMode_t a_mode,
- GrCCUColor_t b,
- GrCombineMode_t b_mode,
- GrCCUColor_t c,
- FxBool c_invert,
- GrCCUColor_t d,
- FxBool d_invert,
- FxU32 shift,
- FxBool invert)
-{
-#define FN_NAME "grColorCombineExt"
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert));
- assert(real_grColorCombineExt);
- (*real_grColorCombineExt)(a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAlphaCombineExt (GrACUColor_t a,
- GrCombineMode_t a_mode,
- GrACUColor_t b,
- GrCombineMode_t b_mode,
- GrACUColor_t c,
- FxBool c_invert,
- GrACUColor_t d,
- FxBool d_invert,
- FxU32 shift,
- FxBool invert)
-{
-#define FN_NAME "grAlphaCombineExt"
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert));
- assert(real_grAlphaCombineExt);
- (*real_grAlphaCombineExt)(a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexColorCombineExt (GrChipID_t tmu,
- GrTCCUColor_t a,
- GrCombineMode_t a_mode,
- GrTCCUColor_t b,
- GrCombineMode_t b_mode,
- GrTCCUColor_t c,
- FxBool c_invert,
- GrTCCUColor_t d,
- FxBool d_invert,
- FxU32 shift,
- FxBool invert)
-{
-#define FN_NAME "grTexColorCombineExt"
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert));
- assert(real_grTexColorCombineExt);
- (*real_grTexColorCombineExt)(tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTexAlphaCombineExt (GrChipID_t tmu,
- GrTACUColor_t a,
- GrCombineMode_t a_mode,
- GrTACUColor_t b,
- GrCombineMode_t b_mode,
- GrTACUColor_t c,
- FxBool c_invert,
- GrTACUColor_t d,
- FxBool d_invert,
- FxU32 shift,
- FxBool invert)
-{
-#define FN_NAME "grTexAlphaCombineExt"
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert));
- assert(real_grTexAlphaCombineExt);
- (*real_grTexAlphaCombineExt)(tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grConstantColorValueExt (GrChipID_t tmu,
- GrColor_t value)
-{
-#define FN_NAME "grConstantColorValueExt"
- TRAP_LOG("%s(%s, %08lx)\n", FN_NAME, TRP_TMU(tmu), value);
- assert(real_grConstantColorValueExt);
- (*real_grConstantColorValueExt)(tmu, value);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grColorMaskExt (FxBool r,
- FxBool g,
- FxBool b,
- FxBool a)
-{
-#define FN_NAME "grColorMaskExt"
- TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_BOOL(r), TRP_BOOL(g), TRP_BOOL(b), TRP_BOOL(a));
- assert(real_grColorMaskExt);
- (*real_grColorMaskExt)(r, g, b, a);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grAlphaBlendFunctionExt (GrAlphaBlendFnc_t rgb_sf,
- GrAlphaBlendFnc_t rgb_df,
- GrAlphaBlendOp_t rgb_op,
- GrAlphaBlendFnc_t alpha_sf,
- GrAlphaBlendFnc_t alpha_df,
- GrAlphaBlendOp_t alpha_op)
-{
-#define FN_NAME "grAlphaBlendFunctionExt"
- TRAP_LOG("%s(%s, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_BLEND(rgb_sf), TRP_BLEND(rgb_df), TRP_BLENDOP(rgb_op), TRP_BLEND(alpha_sf), TRP_BLEND(alpha_df), TRP_BLENDOP(alpha_op));
- assert(real_grAlphaBlendFunctionExt);
- (*real_grAlphaBlendFunctionExt)(rgb_sf, rgb_df, rgb_op, alpha_sf, alpha_df, alpha_op);
-#undef FN_NAME
-}
-
-void FX_CALL trap_grTBufferWriteMaskExt (FxU32 tmask)
-{
-#define FN_NAME "grTBufferWriteMaskExt"
- TRAP_LOG("%s(%08lx)\n", FN_NAME, tmask);
- assert(real_grTBufferWriteMaskExt);
- (*real_grTBufferWriteMaskExt)(tmask);
-#undef FN_NAME
-}
-
-/*
-** texus functions
-*/
-void FX_CALL trap_txImgQuantize (char *dst,
- char *src,
- int w,
- int h,
- FxU32 format,
- FxU32 dither)
-{
-#define FN_NAME "txImgQuantize"
- TRAP_LOG("%s(%p, %p, %d, %d, %s, %s)\n", FN_NAME, dst, src, w, h, TRP_TEXFMT(format), TRP_TXDITHER(dither));
- assert(real_txImgQuantize);
- (*real_txImgQuantize)(dst, src, w, h, format, dither);
-#undef FN_NAME
-}
-
-void FX_CALL trap_txMipQuantize (TxMip *pxMip,
- TxMip *txMip,
- int fmt,
- FxU32 d,
- FxU32 comp)
-{
-#define FN_NAME "txMipQuantize"
- TRAP_LOG("%s(%p, %p, %s, %s, %s)\n", FN_NAME, (void *)pxMip, (void *)txMip, TRP_TEXFMT(fmt), TRP_TXDITHER(d), TRP_TXCOMPRESS(comp));
- assert(real_txMipQuantize);
- (*real_txMipQuantize)(pxMip, txMip, fmt, d, comp);
-#undef FN_NAME
-}
-
-void FX_CALL trap_txPalToNcc (GuNccTable *ncc_table,
- const FxU32 *pal)
-{
-#define FN_NAME "txPalToNcc"
- TRAP_LOG("%s(%p, %p)\n", FN_NAME, (void *)ncc_table, (void *)pal);
- assert(real_txPalToNcc);
- (*real_txPalToNcc)(ncc_table, pal);
-#undef FN_NAME
-}
-#endif
-
-
-
-/****************************************************************************\
-* housekeeping (fake pointers) *
-\****************************************************************************/
-char *FX_CALL fake_grGetRegistryOrEnvironmentStringExt (char *theEntry)
-{
- return getenv(theEntry);
-}
-
-void FX_CALL fake_grTexDownloadTableExt (GrChipID_t tmu,
- GrTexTable_t type,
- void *data)
-{
- (void)tmu;
- grTexDownloadTable(type, data);
-}
-
-void FX_CALL fake_grTexDownloadTablePartialExt (GrChipID_t tmu,
- GrTexTable_t type,
- void *data,
- int start,
- int end)
-{
- (void)tmu;
- grTexDownloadTablePartial(type, data, start, end);
-}
-
-void FX_CALL fake_grTexNCCTableExt (GrChipID_t tmu,
- GrNCCTable_t table)
-{
- (void)tmu;
- grTexNCCTable(table);
-}
-
-
-
-/****************************************************************************\
-* interface *
-\****************************************************************************/
-void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast)
-{
-/* GET_EXT_ADDR: get function pointer
- * GET_EXT_FAKE: get function pointer if possible, else use a fake function
- * GET_EXT_NULL: get function pointer if possible, else leave NULL pointer
- */
-#if FX_TRAP_GLIDE
-#define GET_EXT_ADDR(name) *(GrProc *)&real_##name = grGetProcAddress(#name), Glide->name = trap_##name
-#define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (real_##name == NULL) real_##name = fake_##name
-#define GET_EXT_NULL(name) GET_EXT_ADDR(name); if (real_##name == NULL) Glide->name = NULL
-#else /* FX_TRAP_GLIDE */
-#define GET_EXT_ADDR(name) *(GrProc *)&Glide->name = grGetProcAddress(#name)
-#define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (Glide->name == NULL) Glide->name = fake_##name
-#define GET_EXT_NULL(name) GET_EXT_ADDR(name)
-#endif /* FX_TRAP_GLIDE */
-
- /*
- ** glide extensions
- */
- GET_EXT_NULL(grSetNumPendingBuffers);
- GET_EXT_FAKE(grGetRegistryOrEnvironmentStringExt);
- GET_EXT_ADDR(grGetGammaTableExt);
- GET_EXT_ADDR(grChromaRangeModeExt);
- GET_EXT_ADDR(grChromaRangeExt);
- GET_EXT_ADDR(grTexChromaModeExt);
- GET_EXT_ADDR(grTexChromaRangeExt);
- /* pointcast */
- if (pointcast) {
- GET_EXT_FAKE(grTexDownloadTableExt);
- GET_EXT_FAKE(grTexDownloadTablePartialExt);
- GET_EXT_FAKE(grTexNCCTableExt);
- } else {
- Glide->grTexDownloadTableExt = fake_grTexDownloadTableExt;
- Glide->grTexDownloadTablePartialExt = fake_grTexDownloadTablePartialExt;
- Glide->grTexNCCTableExt = fake_grTexNCCTableExt;
- }
- /* tbext */
- GET_EXT_ADDR(grTextureBufferExt);
- GET_EXT_ADDR(grTextureAuxBufferExt);
- GET_EXT_ADDR(grAuxBufferExt);
- /* napalm */
- GET_EXT_ADDR(grSstWinOpenExt);
- GET_EXT_ADDR(grStencilFuncExt);
- GET_EXT_ADDR(grStencilMaskExt);
- GET_EXT_ADDR(grStencilOpExt);
- GET_EXT_ADDR(grLfbConstantStencilExt);
- GET_EXT_ADDR(grBufferClearExt);
- GET_EXT_ADDR(grColorCombineExt);
- GET_EXT_ADDR(grAlphaCombineExt);
- GET_EXT_ADDR(grTexColorCombineExt);
- GET_EXT_ADDR(grTexAlphaCombineExt);
- GET_EXT_ADDR(grConstantColorValueExt);
- GET_EXT_ADDR(grColorMaskExt);
- GET_EXT_ADDR(grAlphaBlendFunctionExt);
- GET_EXT_ADDR(grTBufferWriteMaskExt);
-
- /*
- ** texus
- */
- GET_EXT_NULL(txImgQuantize);
- GET_EXT_NULL(txMipQuantize);
- GET_EXT_NULL(txPalToNcc);
-
-#undef GET_EXT_ADDR
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.h b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.h
deleted file mode 100644
index e71201116..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxg.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.0.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Mesa/FX device driver. Interface to Glide3.
- *
- * Copyright (c) 2003 - Daniel Borca
- * Email : dborca@users.sourceforge.net
- * Web : http://www.geocities.com/dborca
- */
-
-
-#ifndef TDFX_GLIDE_H_included
-#define TDFX_GLIDE_H_included
-
-#include <glide.h>
-#include <g3ext.h>
-
-#ifndef FX_TRAP_GLIDE
-#define FX_TRAP_GLIDE 0
-#endif
-
-#if FX_TRAP_GLIDE
-/*
-** rendering functions
-*/
-void FX_CALL trap_grDrawPoint (const void *pt);
-void FX_CALL trap_grDrawLine (const void *v1, const void *v2);
-void FX_CALL trap_grDrawTriangle (const void *a, const void *b, const void *c);
-void FX_CALL trap_grVertexLayout (FxU32 param, FxI32 offset, FxU32 mode);
-void FX_CALL trap_grDrawVertexArray (FxU32 mode, FxU32 Count, void *pointers);
-void FX_CALL trap_grDrawVertexArrayContiguous (FxU32 mode, FxU32 Count, void *pointers, FxU32 stride);
-
-/*
-** Antialiasing Functions
-*/
-void FX_CALL trap_grAADrawTriangle (const void *a, const void *b, const void *c, FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias);
-
-/*
-** buffer management
-*/
-void FX_CALL trap_grBufferClear (GrColor_t color, GrAlpha_t alpha, FxU32 depth);
-void FX_CALL trap_grBufferSwap (FxU32 swap_interval);
-void FX_CALL trap_grRenderBuffer (GrBuffer_t buffer);
-
-/*
-** error management
-*/
-void FX_CALL trap_grErrorSetCallback (GrErrorCallbackFnc_t fnc);
-
-/*
-** SST routines
-*/
-void FX_CALL trap_grFinish (void);
-void FX_CALL trap_grFlush (void);
-GrContext_t FX_CALL trap_grSstWinOpen (FxU32 hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
-FxBool FX_CALL trap_grSstWinClose (GrContext_t context);
-FxBool FX_CALL trap_grSelectContext (GrContext_t context);
-void FX_CALL trap_grSstOrigin (GrOriginLocation_t origin);
-void FX_CALL trap_grSstSelect (int which_sst);
-
-/*
-** Glide configuration and special effect maintenance functions
-*/
-void FX_CALL trap_grAlphaBlendFunction (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df);
-void FX_CALL trap_grAlphaCombine (GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert);
-void FX_CALL trap_grAlphaControlsITRGBLighting (FxBool enable);
-void FX_CALL trap_grAlphaTestFunction (GrCmpFnc_t function);
-void FX_CALL trap_grAlphaTestReferenceValue (GrAlpha_t value);
-void FX_CALL trap_grChromakeyMode (GrChromakeyMode_t mode);
-void FX_CALL trap_grChromakeyValue (GrColor_t value);
-void FX_CALL trap_grClipWindow (FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy);
-void FX_CALL trap_grColorCombine (GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert);
-void FX_CALL trap_grColorMask (FxBool rgb, FxBool a);
-void FX_CALL trap_grCullMode (GrCullMode_t mode);
-void FX_CALL trap_grConstantColorValue (GrColor_t value);
-void FX_CALL trap_grDepthBiasLevel (FxI32 level);
-void FX_CALL trap_grDepthBufferFunction (GrCmpFnc_t function);
-void FX_CALL trap_grDepthBufferMode (GrDepthBufferMode_t mode);
-void FX_CALL trap_grDepthMask (FxBool mask);
-void FX_CALL trap_grDisableAllEffects (void);
-void FX_CALL trap_grDitherMode (GrDitherMode_t mode);
-void FX_CALL trap_grFogColorValue (GrColor_t fogcolor);
-void FX_CALL trap_grFogMode (GrFogMode_t mode);
-void FX_CALL trap_grFogTable (const GrFog_t ft[]);
-void FX_CALL trap_grLoadGammaTable (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
-void FX_CALL trap_grSplash (float x, float y, float width, float height, FxU32 frame);
-FxU32 FX_CALL trap_grGet (FxU32 pname, FxU32 plength, FxI32 *params);
-const char * FX_CALL trap_grGetString (FxU32 pname);
-FxI32 FX_CALL trap_grQueryResolutions (const GrResolution *resTemplate, GrResolution *output);
-FxBool FX_CALL trap_grReset (FxU32 what);
-GrProc FX_CALL trap_grGetProcAddress (char *procName);
-void FX_CALL trap_grEnable (GrEnableMode_t mode);
-void FX_CALL trap_grDisable (GrEnableMode_t mode);
-void FX_CALL trap_grCoordinateSpace (GrCoordinateSpaceMode_t mode);
-void FX_CALL trap_grDepthRange (FxFloat n, FxFloat f);
-void FX_CALL trap_grStippleMode (GrStippleMode_t mode);
-void FX_CALL trap_grStipplePattern (GrStipplePattern_t mode);
-void FX_CALL trap_grViewport (FxI32 x, FxI32 y, FxI32 width, FxI32 height);
-
-/*
-** texture mapping control functions
-*/
-FxU32 FX_CALL trap_grTexCalcMemRequired (GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt);
-FxU32 FX_CALL trap_grTexTextureMemRequired (FxU32 evenOdd, GrTexInfo *info);
-FxU32 FX_CALL trap_grTexMinAddress (GrChipID_t tmu);
-FxU32 FX_CALL trap_grTexMaxAddress (GrChipID_t tmu);
-void FX_CALL trap_grTexNCCTable (GrNCCTable_t table);
-void FX_CALL trap_grTexSource (GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info);
-void FX_CALL trap_grTexClampMode (GrChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode);
-void FX_CALL trap_grTexCombine (GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, GrCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, FxBool rgb_invert, FxBool alpha_invert);
-void FX_CALL trap_grTexDetailControl (GrChipID_t tmu, int lod_bias, FxU8 detail_scale, float detail_max);
-void FX_CALL trap_grTexFilterMode (GrChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrTextureFilterMode_t magfilter_mode);
-void FX_CALL trap_grTexLodBiasValue (GrChipID_t tmu, float bias);
-void FX_CALL trap_grTexDownloadMipMap (GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info);
-void FX_CALL trap_grTexDownloadMipMapLevel (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data);
-FxBool FX_CALL trap_grTexDownloadMipMapLevelPartial (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data, int start, int end);
-void FX_CALL trap_grTexDownloadTable (GrTexTable_t type, void *data);
-void FX_CALL trap_grTexDownloadTablePartial (GrTexTable_t type, void *data, int start, int end);
-void FX_CALL trap_grTexMipMapMode (GrChipID_t tmu, GrMipMapMode_t mode, FxBool lodBlend);
-void FX_CALL trap_grTexMultibase (GrChipID_t tmu, FxBool enable);
-void FX_CALL trap_grTexMultibaseAddress (GrChipID_t tmu, GrTexBaseRange_t range, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info);
-
-/*
-** linear frame buffer functions
-*/
-FxBool FX_CALL trap_grLfbLock (GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, FxBool pixelPipeline, GrLfbInfo_t *info);
-FxBool FX_CALL trap_grLfbUnlock (GrLock_t type, GrBuffer_t buffer);
-void FX_CALL trap_grLfbConstantAlpha (GrAlpha_t alpha);
-void FX_CALL trap_grLfbConstantDepth (FxU32 depth);
-void FX_CALL trap_grLfbWriteColorSwizzle (FxBool swizzleBytes, FxBool swapWords);
-void FX_CALL trap_grLfbWriteColorFormat (GrColorFormat_t colorFormat);
-FxBool FX_CALL trap_grLfbWriteRegion (GrBuffer_t dst_buffer, FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format, FxU32 src_width, FxU32 src_height, FxBool pixelPipeline, FxI32 src_stride, void *src_data);
-FxBool FX_CALL trap_grLfbReadRegion (GrBuffer_t src_buffer, FxU32 src_x, FxU32 src_y, FxU32 src_width, FxU32 src_height, FxU32 dst_stride, void *dst_data);
-
-/*
-** glide management functions
-*/
-void FX_CALL trap_grGlideInit (void);
-void FX_CALL trap_grGlideShutdown (void);
-void FX_CALL trap_grGlideGetState (void *state);
-void FX_CALL trap_grGlideSetState (const void *state);
-void FX_CALL trap_grGlideGetVertexLayout (void *layout);
-void FX_CALL trap_grGlideSetVertexLayout (const void *layout);
-
-/*
-** glide utility functions
-*/
-void FX_CALL trap_guGammaCorrectionRGB (FxFloat red, FxFloat green, FxFloat blue);
-float FX_CALL trap_guFogTableIndexToW (int i);
-void FX_CALL trap_guFogGenerateExp (GrFog_t *fogtable, float density);
-void FX_CALL trap_guFogGenerateExp2 (GrFog_t *fogtable, float density);
-void FX_CALL trap_guFogGenerateLinear (GrFog_t *fogtable, float nearZ, float farZ);
-
-#ifndef FX_TRAP_GLIDE_internal
-/*
-** rendering functions
-*/
-#define grDrawPoint trap_grDrawPoint
-#define grDrawLine trap_grDrawLine
-#define grDrawTriangle trap_grDrawTriangle
-#define grVertexLayout trap_grVertexLayout
-#define grDrawVertexArray trap_grDrawVertexArray
-#define grDrawVertexArrayContiguous trap_grDrawVertexArrayContiguous
-
-/*
-** Antialiasing Functions
-*/
-#define grAADrawTriangle trap_grAADrawTriangle
-
-/*
-** buffer management
-*/
-#define grBufferClear trap_grBufferClear
-#define grBufferSwap trap_grBufferSwap
-#define grRenderBuffer trap_grRenderBuffer
-
-/*
-** error management
-*/
-#define grErrorSetCallback trap_grErrorSetCallback
-
-/*
-** SST routines
-*/
-#define grFinish trap_grFinish
-#define grFlush trap_grFlush
-#define grSstWinOpen trap_grSstWinOpen
-#define grSstWinClose trap_grSstWinClose
-#define grSelectContext trap_grSelectContext
-#define grSstOrigin trap_grSstOrigin
-#define grSstSelect trap_grSstSelect
-
-/*
-** Glide configuration and special effect maintenance functions
-*/
-#define grAlphaBlendFunction trap_grAlphaBlendFunction
-#define grAlphaCombine trap_grAlphaCombine
-#define grAlphaControlsITRGBLighting trap_grAlphaControlsITRGBLighting
-#define grAlphaTestFunction trap_grAlphaTestFunction
-#define grAlphaTestReferenceValue trap_grAlphaTestReferenceValue
-#define grChromakeyMode trap_grChromakeyMode
-#define grChromakeyValue trap_grChromakeyValue
-#define grClipWindow trap_grClipWindow
-#define grColorCombine trap_grColorCombine
-#define grColorMask trap_grColorMask
-#define grCullMode trap_grCullMode
-#define grConstantColorValue trap_grConstantColorValue
-#define grDepthBiasLevel trap_grDepthBiasLevel
-#define grDepthBufferFunction trap_grDepthBufferFunction
-#define grDepthBufferMode trap_grDepthBufferMode
-#define grDepthMask trap_grDepthMask
-#define grDisableAllEffects trap_grDisableAllEffects
-#define grDitherMode trap_grDitherMode
-#define grFogColorValue trap_grFogColorValue
-#define grFogMode trap_grFogMode
-#define grFogTable trap_grFogTable
-#define grLoadGammaTable trap_grLoadGammaTable
-#define grSplash trap_grSplash
-#define grGet trap_grGet
-#define grGetString trap_grGetString
-#define grQueryResolutions trap_grQueryResolutions
-#define grReset trap_grReset
-#define grGetProcAddress trap_grGetProcAddress
-#define grEnable trap_grEnable
-#define grDisable trap_grDisable
-#define grCoordinateSpace trap_grCoordinateSpace
-#define grDepthRange trap_grDepthRange
-#define grStippleMode trap_grStippleMode
-#define grStipplePattern trap_grStipplePattern
-#define grViewport trap_grViewport
-
-/*
-** texture mapping control functions
-*/
-#define grTexCalcMemRequired trap_grTexCalcMemRequired
-#define grTexTextureMemRequired trap_grTexTextureMemRequired
-#define grTexMinAddress trap_grTexMinAddress
-#define grTexMaxAddress trap_grTexMaxAddress
-#define grTexNCCTable trap_grTexNCCTable
-#define grTexSource trap_grTexSource
-#define grTexClampMode trap_grTexClampMode
-#define grTexCombine trap_grTexCombine
-#define grTexDetailControl trap_grTexDetailControl
-#define grTexFilterMode trap_grTexFilterMode
-#define grTexLodBiasValue trap_grTexLodBiasValue
-#define grTexDownloadMipMap trap_grTexDownloadMipMap
-#define grTexDownloadMipMapLevel trap_grTexDownloadMipMapLevel
-#define grTexDownloadMipMapLevelPartial trap_grTexDownloadMipMapLevelPartial
-#define grTexDownloadTable trap_grTexDownloadTable
-#define grTexDownloadTablePartial trap_grTexDownloadTablePartial
-#define grTexMipMapMode trap_grTexMipMapMode
-#define grTexMultibase trap_grTexMultibase
-#define grTexMultibaseAddress trap_grTexMultibaseAddress
-
-/*
-** linear frame buffer functions
-*/
-#define grLfbLock trap_grLfbLock
-#define grLfbUnlock trap_grLfbUnlock
-#define grLfbConstantAlpha trap_grLfbConstantAlpha
-#define grLfbConstantDepth trap_grLfbConstantDepth
-#define grLfbWriteColorSwizzle trap_grLfbWriteColorSwizzle
-#define grLfbWriteColorFormat trap_grLfbWriteColorFormat
-#define grLfbWriteRegion trap_grLfbWriteRegion
-#define grLfbReadRegion trap_grLfbReadRegion
-
-/*
-** glide management functions
-*/
-#define grGlideInit trap_grGlideInit
-#define grGlideShutdown trap_grGlideShutdown
-#define grGlideGetState trap_grGlideGetState
-#define grGlideSetState trap_grGlideSetState
-#define grGlideGetVertexLayout trap_grGlideGetVertexLayout
-#define grGlideSetVertexLayout trap_grGlideSetVertexLayout
-
-/*
-** glide utility functions
-*/
-#define guGammaCorrectionRGB trap_guGammaCorrectionRGB
-#define guFogTableIndexToW trap_guFogTableIndexToW
-#define guFogGenerateExp trap_guFogGenerateExp
-#define guFogGenerateExp2 trap_guFogGenerateExp2
-#define guFogGenerateLinear trap_guFogGenerateLinear
-#endif /* FX_TRAP_GLIDE_internal */
-#endif /* FX_TRAP_GLIDE */
-
-
-
-/* <texus.h> */
-#define TX_MAX_LEVEL 16
-typedef struct _TxMip {
- int format;
- int width;
- int height;
- int depth;
- int size;
- void *data[TX_MAX_LEVEL];
- FxU32 pal[256];
-} TxMip;
-
-#define TX_DITHER_NONE 0x00000000
-#define TX_DITHER_4x4 0x00000001
-#define TX_DITHER_ERR 0x00000002
-
-#define TX_COMPRESSION_STATISTICAL 0x00000000
-#define TX_COMPRESSION_HEURISTIC 0x00000010
-/* <texus.h> */
-
-
-
-struct tdfx_glide {
- /*
- ** glide extensions
- */
- void (FX_CALL *grSetNumPendingBuffers) (FxI32 NumPendingBuffers);
- char * (FX_CALL *grGetRegistryOrEnvironmentStringExt) (char *theEntry);
- void (FX_CALL *grGetGammaTableExt) (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
- void (FX_CALL *grChromaRangeModeExt) (GrChromakeyMode_t mode);
- void (FX_CALL *grChromaRangeExt) (GrColor_t color, GrColor_t range, GrChromaRangeMode_t match_mode);
- void (FX_CALL *grTexChromaModeExt) (GrChipID_t tmu, GrChromakeyMode_t mode);
- void (FX_CALL *grTexChromaRangeExt) (GrChipID_t tmu, GrColor_t min, GrColor_t max, GrTexChromakeyMode_t mode);
-
- /* pointcast */
- void (FX_CALL *grTexDownloadTableExt) (GrChipID_t tmu, GrTexTable_t type, void *data);
- void (FX_CALL *grTexDownloadTablePartialExt) (GrChipID_t tmu, GrTexTable_t type, void *data, int start, int end);
- void (FX_CALL *grTexNCCTableExt) (GrChipID_t tmu, GrNCCTable_t table);
-
- /* tbext */
- void (FX_CALL *grTextureBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask);
- void (FX_CALL *grTextureAuxBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask);
- void (FX_CALL *grAuxBufferExt) (GrBuffer_t buffer);
-
- /* napalm */
- GrContext_t (FX_CALL *grSstWinOpenExt) (FxU32 hWnd, GrScreenResolution_t resolution, GrScreenRefresh_t refresh, GrColorFormat_t format, GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers);
- void (FX_CALL *grStencilFuncExt) (GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask);
- void (FX_CALL *grStencilMaskExt) (GrStencil_t value);
- void (FX_CALL *grStencilOpExt) (GrStencilOp_t stencil_fail, GrStencilOp_t depth_fail, GrStencilOp_t depth_pass);
- void (FX_CALL *grLfbConstantStencilExt) (GrStencil_t value);
- void (FX_CALL *grBufferClearExt) (GrColor_t color, GrAlpha_t alpha, FxU32 depth, GrStencil_t stencil);
- void (FX_CALL *grColorCombineExt) (GrCCUColor_t a, GrCombineMode_t a_mode, GrCCUColor_t b, GrCombineMode_t b_mode, GrCCUColor_t c, FxBool c_invert, GrCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
- void (FX_CALL *grAlphaCombineExt) (GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
- void (FX_CALL *grTexColorCombineExt) (GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
- void (FX_CALL *grTexAlphaCombineExt) (GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert);
- void (FX_CALL *grConstantColorValueExt) (GrChipID_t tmu, GrColor_t value);
- void (FX_CALL *grColorMaskExt) (FxBool r, FxBool g, FxBool b, FxBool a);
- void (FX_CALL *grAlphaBlendFunctionExt) (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendOp_t rgb_op, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df, GrAlphaBlendOp_t alpha_op);
- void (FX_CALL *grTBufferWriteMaskExt) (FxU32 tmask);
-
- /*
- ** Texus2 functions
- */
- void (FX_CALL *txImgQuantize) (char *dst, char *src, int w, int h, FxU32 format, FxU32 dither);
- void (FX_CALL *txMipQuantize) (TxMip *pxMip, TxMip *txMip, int fmt, FxU32 d, FxU32 comp);
- void (FX_CALL *txPalToNcc) (GuNccTable *ncc_table, const FxU32 *pal);
-};
-
-void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast);
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.c
deleted file mode 100644
index 1fedf2ab9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-#include "fxglidew.h"
-#include "fxdrv.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-FxI32
-FX_grGetInteger_NoLock(FxU32 pname)
-{
- FxI32 result;
-
- if (grGet(pname, 4, &result)) {
- return result;
- }
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "FX_grGetInteger_NoLock: wrong parameter (%lx)\n", pname);
- }
- return -1;
-}
-
-FxBool
-FX_grSstControl(FxU32 code)
-{
- /* The glide 3 sources call for grEnable/grDisable to be called in exchange
- * for grSstControl. */
- switch (code) {
- case GR_CONTROL_ACTIVATE:
- grEnable(GR_PASSTHRU);
- break;
- case GR_CONTROL_DEACTIVATE:
- grDisable(GR_PASSTHRU);
- break;
- }
- /* Appearently GR_CONTROL_RESIZE can be ignored. */
- return 1; /* OK? */
-}
-
-
-int
-FX_grSstScreenWidth()
-{
- FxI32 result[4];
-
- BEGIN_BOARD_LOCK();
- grGet(GR_VIEWPORT, sizeof(FxI32) * 4, result);
- END_BOARD_LOCK();
-
- return result[2];
-}
-
-int
-FX_grSstScreenHeight()
-{
- FxI32 result[4];
-
- BEGIN_BOARD_LOCK();
- grGet(GR_VIEWPORT, sizeof(FxI32) * 4, result);
- END_BOARD_LOCK();
-
- return result[3];
-}
-
-void
-FX_grSstPerfStats(GrSstPerfStats_t * st)
-{
- FxI32 n;
- grGet(GR_STATS_PIXELS_IN, 4, &n);
- st->pixelsIn = n;
- grGet(GR_STATS_PIXELS_CHROMA_FAIL, 4, &n);
- st->chromaFail = n;
- grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &n);
- st->zFuncFail = n;
- grGet(GR_STATS_PIXELS_AFUNC_FAIL, 4, &n);
- st->aFuncFail = n;
- grGet(GR_STATS_PIXELS_OUT, 4, &n);
- st->pixelsOut = n;
-}
-
-void
-FX_setupGrVertexLayout(void)
-{
- BEGIN_BOARD_LOCK();
- grReset(GR_VERTEX_PARAMETER);
-
- grCoordinateSpace(GR_WINDOW_COORDS);
- grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
-#if FX_PACKEDCOLOR
- grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE);
-#else /* !FX_PACKEDCOLOR */
- grVertexLayout(GR_PARAM_RGB, GR_VERTEX_RGB_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
-#endif /* !FX_PACKEDCOLOR */
- grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2,
- GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2,
- GR_PARAM_DISABLE);
- grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2,
- GR_PARAM_DISABLE);
- grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2,
- GR_PARAM_DISABLE);
- END_BOARD_LOCK();
-}
-
-void
-FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask)
-{
- switch (hintType) {
- case GR_HINT_STWHINT:
- {
- if (hintMask & GR_STWHINT_W_DIFF_TMU0)
- grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2,
- GR_PARAM_ENABLE);
- else
- grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2,
- GR_PARAM_DISABLE);
-
- if (hintMask & GR_STWHINT_ST_DIFF_TMU1)
- grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2,
- GR_PARAM_ENABLE);
- else
- grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2,
- GR_PARAM_DISABLE);
-
- if (hintMask & GR_STWHINT_W_DIFF_TMU1)
- grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2,
- GR_PARAM_ENABLE);
- else
- grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2,
- GR_PARAM_DISABLE);
-
- }
- }
-}
-
-/*
- * Glide3 doesn't have the grSstQueryHardware function anymore.
- * Instead, we call grGet() and fill in the data structures ourselves.
- */
-int
-FX_grSstQueryHardware(GrHwConfiguration * config)
-{
- int i, j;
- int numFB;
-
- BEGIN_BOARD_LOCK();
-
- grGet(GR_NUM_BOARDS, 4, (void *) &(config->num_sst));
- if (config->num_sst == 0)
- return 0;
-
- for (i = 0; i < config->num_sst; i++) {
- FxI32 result;
- const char *extension;
-
- grSstSelect(i);
-
- extension = grGetString(GR_HARDWARE);
- if (strstr(extension, "Rush")) {
- config->SSTs[i].type = GR_SSTTYPE_SST96;
- } else if (strstr(extension, "Voodoo2")) {
- config->SSTs[i].type = GR_SSTTYPE_Voodoo2;
- } else if (strstr(extension, "Voodoo Banshee")) {
- config->SSTs[i].type = GR_SSTTYPE_Banshee;
- } else if (strstr(extension, "Voodoo3")) {
- config->SSTs[i].type = GR_SSTTYPE_Voodoo3;
- } else if (strstr(extension, "Voodoo4")) {
- config->SSTs[i].type = GR_SSTTYPE_Voodoo4;
- } else if (strstr(extension, "Voodoo5")) {
- config->SSTs[i].type = GR_SSTTYPE_Voodoo5;
- } else {
- config->SSTs[i].type = GR_SSTTYPE_VOODOO;
- }
-
- grGet(GR_MEMORY_FB, 4, &result);
- config->SSTs[i].fbRam = result / (1024 * 1024);
-
- grGet(GR_NUM_TMU, 4, &result);
- config->SSTs[i].nTexelfx = result;
-
- grGet(GR_REVISION_FB, 4, &result);
- config->SSTs[i].fbiRev = result;
-
- for (j = 0; j < config->SSTs[i].nTexelfx; j++) {
- grGet(GR_MEMORY_TMU, 4, &result);
- config->SSTs[i].tmuConfig[j].tmuRam = result / (1024 * 1024);
- grGet(GR_REVISION_TMU, 4, &result);
- config->SSTs[i].tmuConfig[j].tmuRev = result;
- }
-
- extension = grGetString(GR_EXTENSION);
- config->SSTs[i].HavePalExt = (strstr(extension, " PALETTE6666 ") != NULL);
- config->SSTs[i].HavePixExt = (strstr(extension, " PIXEXT ") != NULL);
- config->SSTs[i].HaveTexFmt = (strstr(extension, " TEXFMT ") != NULL);
- config->SSTs[i].HaveCmbExt = (strstr(extension, " COMBINE ") != NULL);
- config->SSTs[i].HaveMirExt = (strstr(extension, " TEXMIRROR ") != NULL);
- config->SSTs[i].HaveTexUma = (strstr(extension, " TEXUMA ") != NULL);
-
- /* number of Voodoo chips */
- grGet(GR_NUM_FB, 4, (void *) &numFB);
- config->SSTs[i].numChips = numFB;
-
- }
-
- tdfx_hook_glide(&config->Glide, getenv("MESA_FX_POINTCAST") != NULL);
-
- END_BOARD_LOCK();
- return 1;
-}
-
-
-
-#else
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_glidew(void);
-int
-gl_fx_dummy_function_glidew(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.h b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.h
deleted file mode 100644
index a19d0b58c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxglidew.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-
-#ifndef __FX_GLIDE_WARPER__
-#define __FX_GLIDE_WARPER__
-
-
-#include "fxg.h"
-
-#ifndef FX_PACKEDCOLOR
-#define FX_PACKEDCOLOR 1
-#endif
-
-#define MAX_NUM_SST 4
-
-enum {
- GR_SSTTYPE_VOODOO = 0,
- GR_SSTTYPE_SST96 = 1,
- GR_SSTTYPE_AT3D = 2,
- GR_SSTTYPE_Voodoo2 = 3,
- GR_SSTTYPE_Banshee = 4,
- GR_SSTTYPE_Voodoo3 = 5,
- GR_SSTTYPE_Voodoo4 = 6,
- GR_SSTTYPE_Voodoo5 = 7
-};
-
-#define GrState void
-
-typedef int GrSstType;
-
-typedef struct GrTMUConfig_St {
- int tmuRev; /* Rev of Texelfx chip */
- int tmuRam; /* 1, 2, or 4 MB */
-} GrTMUConfig_t;
-
-typedef struct {
- int num_sst; /* # of HW units in the system */
- struct SstCard_St {
- GrSstType type; /* Which hardware is it? */
- int fbRam; /* 1, 2, or 4 MB */
- int fbiRev; /* Rev of Pixelfx chip */
- int nTexelfx; /* How many texelFX chips are there? */
- int numChips; /* Number of Voodoo chips */
- GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
- /* Glide3 extensions */
- FxBool HavePalExt; /* PALETTE6666 */
- FxBool HavePixExt; /* PIXEXT */
- FxBool HaveTexFmt; /* TEXFMT */
- FxBool HaveCmbExt; /* COMBINE */
- FxBool HaveMirExt; /* TEXMIRROR */
- FxBool HaveTexUma; /* TEXUMA */
- }
- SSTs[MAX_NUM_SST]; /* configuration for each board */
- struct tdfx_glide Glide;
-} GrHwConfiguration;
-
-
-
-typedef FxU32 GrHint_t;
-#define GR_HINTTYPE_MIN 0
-#define GR_HINT_STWHINT 0
-
-typedef FxU32 GrSTWHint_t;
-#define GR_STWHINT_W_DIFF_FBI FXBIT(0)
-#define GR_STWHINT_W_DIFF_TMU0 FXBIT(1)
-#define GR_STWHINT_ST_DIFF_TMU0 FXBIT(2)
-#define GR_STWHINT_W_DIFF_TMU1 FXBIT(3)
-#define GR_STWHINT_ST_DIFF_TMU1 FXBIT(4)
-#define GR_STWHINT_W_DIFF_TMU2 FXBIT(5)
-#define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6)
-
-#define GR_CONTROL_ACTIVATE 1
-#define GR_CONTROL_DEACTIVATE 0
-
-
-
-/*
-** move the vertex layout defintion to application
-*/
-typedef struct {
- float sow; /* s texture ordinate (s over w) */
- float tow; /* t texture ordinate (t over w) */
- float oow; /* 1/w (used mipmapping - really 0xfff/w) */
-} GrTmuVertex;
-
-#if FX_PACKEDCOLOR
-typedef struct {
- float x, y; /* X and Y in screen space */
- float ooz; /* 65535/Z (used for Z-buffering) */
- float oow; /* 1/W (used for W-buffering, texturing) */
- unsigned char pargb[4]; /* B, G, R, A [0..255] */
- GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
- float fog; /* fog coordinate */
- unsigned char pspec[4]; /* B, G, R, A [0..255] */
- float psize; /* point size */
- long pad[16 - 14]; /* ensure 64b structure */
-} GrVertex;
-
-#define GR_VERTEX_X_OFFSET 0
-#define GR_VERTEX_Y_OFFSET 1
-#define GR_VERTEX_OOZ_OFFSET 2
-#define GR_VERTEX_OOW_OFFSET 3
-#define GR_VERTEX_PARGB_OFFSET 4
-#define GR_VERTEX_SOW_TMU0_OFFSET 5
-#define GR_VERTEX_TOW_TMU0_OFFSET 6
-#define GR_VERTEX_OOW_TMU0_OFFSET 7
-#define GR_VERTEX_SOW_TMU1_OFFSET 8
-#define GR_VERTEX_TOW_TMU1_OFFSET 9
-#define GR_VERTEX_OOW_TMU1_OFFSET 10
-#define GR_VERTEX_FOG_OFFSET 11
-#define GR_VERTEX_PSPEC_OFFSET 12
-#else /* !FX_PACKEDCOLOR */
-typedef struct {
- float x, y; /* X and Y in screen space */
- float ooz; /* 65535/Z (used for Z-buffering) */
- float oow; /* 1/W (used for W-buffering, texturing) */
- float r, g, b, a; /* R, G, B, A [0..255] */
- GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
- float fog; /* fog coordinate */
- float r1, g1, b1; /* R, G, B [0..255] */
- float psize; /* point size */
- long pad[20 - 19]; /* ensure multiple of 16 */
-} GrVertex;
-
-#define GR_VERTEX_X_OFFSET 0
-#define GR_VERTEX_Y_OFFSET 1
-#define GR_VERTEX_OOZ_OFFSET 2
-#define GR_VERTEX_OOW_OFFSET 3
-#define GR_VERTEX_RGB_OFFSET 4
-#define GR_VERTEX_A_OFFSET 7
-#define GR_VERTEX_SOW_TMU0_OFFSET 8
-#define GR_VERTEX_TOW_TMU0_OFFSET 9
-#define GR_VERTEX_OOW_TMU0_OFFSET 10
-#define GR_VERTEX_SOW_TMU1_OFFSET 11
-#define GR_VERTEX_TOW_TMU1_OFFSET 12
-#define GR_VERTEX_OOW_TMU1_OFFSET 13
-#define GR_VERTEX_FOG_OFFSET 14
-#define GR_VERTEX_SPEC_OFFSET 15
-#endif /* !FX_PACKEDCOLOR */
-
-
-
-/*
- * For Lod/LodLog2 conversion.
- */
-#define FX_largeLodLog2(info) (info).largeLodLog2
-#define FX_aspectRatioLog2(info) (info).aspectRatioLog2
-#define FX_smallLodLog2(info) (info).smallLodLog2
-#define FX_lodToValue(val) ((int)(GR_LOD_LOG2_256-val))
-#define FX_largeLodValue(info) ((int)(GR_LOD_LOG2_256-(info).largeLodLog2))
-#define FX_smallLodValue(info) ((int)(GR_LOD_LOG2_256-(info).smallLodLog2))
-#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_LOG2_256-val))
-
-
-
-/*
- * Query
- */
-extern int FX_grSstScreenWidth(void);
-extern int FX_grSstScreenHeight(void);
-extern void FX_grSstPerfStats(GrSstPerfStats_t *st);
-extern int FX_grSstQueryHardware(GrHwConfiguration *config);
-#define FX_grGetInteger FX_grGetInteger_NoLock
-extern FxI32 FX_grGetInteger_NoLock(FxU32 pname);
-
-
-
-/*
- * GrHints
- */
-#define FX_grHints FX_grHints_NoLock
-extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask);
-
-
-
-/*
- * Needed for Glide3 only, to set up Glide2 compatible vertex layout.
- */
-extern void FX_setupGrVertexLayout(void);
-
-
-
-/*
- * grSstControl stuff
- */
-extern FxBool FX_grSstControl(FxU32 code);
-
-#define FX_grBufferClear(c, a, d) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grBufferClear(c, a, d); \
- END_CLIP_LOOP(); \
- } while (0)
-
-
-
-#endif /* __FX_GLIDE_WARPER__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.c
deleted file mode 100644
index 360a42f7e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.c
+++ /dev/null
@@ -1,2217 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-
-#include "fxdrv.h"
-#include "enums.h"
-#include "tnl.h"
-#include "tnl/t_context.h"
-#include "swrast.h"
-#include "texstore.h"
-
-
-static void
-fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- GLint minl, maxl;
-
- if (ti->validated) {
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxTexValidate(NOP)\n");
- }
- return;
- }
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxTexValidate(%p (%d))\n", (void *)tObj, tObj->Name);
- }
-
- ti->tObj = tObj;
- minl = ti->minLevel = tObj->BaseLevel;
- maxl = ti->maxLevel = MIN2(tObj->MaxLevel, tObj->Image[0][0]->MaxLog2);
-
-#if FX_RESCALE_BIG_TEXURES_HACK
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- /* [dBorca]
- * Fake textures larger than HW supports:
- * 1) we have mipmaps. Then we just push up to the first supported
- * LOD. A possible drawback is that Mesa will ignore the skipped
- * LODs on further texture handling.
- * Will this interfere with GL_TEXTURE_[MIN|BASE]_LEVEL? How?
- * 2) we don't have mipmaps. We need to rescale the big LOD in place.
- * The above approach is somehow dumb! we might have rescaled
- * once in TexImage2D to accomodate aspect ratio, and now we
- * are rescaling again. The thing is, in TexImage2D we don't
- * know whether we'll hit 1) or 2) by the time of validation.
- */
- if ((tObj->MinFilter == GL_NEAREST) || (tObj->MinFilter == GL_LINEAR)) {
- /* no mipmaps! */
- struct gl_texture_image *texImage = tObj->Image[0][minl];
- tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- GLint _w, _h, maxSize = 1 << fxMesa->textureMaxLod;
- if ((mml->width > maxSize) || (mml->height > maxSize)) {
- /* need to rescale */
- GLint texelBytes = texImage->TexFormat->TexelBytes;
- GLvoid *texImage_Data = texImage->Data;
- _w = MIN2(texImage->Width, maxSize);
- _h = MIN2(texImage->Height, maxSize);
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTexValidate: rescaling %d x %d -> %d x %d\n",
- texImage->Width, texImage->Height, _w, _h);
- }
- /* we should leave these as is and... (!) */
- texImage->Width = _w;
- texImage->Height = _h;
- fxTexGetInfo(_w, _h, NULL, NULL, NULL, NULL,
- &(mml->wScale), &(mml->hScale));
- _w *= mml->wScale;
- _h *= mml->hScale;
- texImage->Data = _mesa_malloc(_w * _h * texelBytes);
- _mesa_rescale_teximage2d(texelBytes,
- mml->width,
- _w * texelBytes, /* dst stride */
- mml->width, mml->height, /* src */
- _w, _h, /* dst */
- texImage_Data /*src*/, texImage->Data /*dst*/ );
- _mesa_free(texImage_Data);
- mml->width = _w;
- mml->height = _h;
- /* (!) ... and set mml->wScale = _w / texImage->Width */
- }
- } else {
- /* mipmapping */
- if (maxl - minl > fxMesa->textureMaxLod) {
- /* skip a certain number of LODs */
- minl += maxl - fxMesa->textureMaxLod;
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTexValidate: skipping %d LODs\n", minl - ti->minLevel);
- }
- ti->minLevel = tObj->BaseLevel = minl;
- }
- }
-}
-#endif
-
- fxTexGetInfo(tObj->Image[0][minl]->Width, tObj->Image[0][minl]->Height,
- &(FX_largeLodLog2(ti->info)), &(FX_aspectRatioLog2(ti->info)),
- &(ti->sScale), &(ti->tScale),
- NULL, NULL);
-
- if ((tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR))
- fxTexGetInfo(tObj->Image[0][maxl]->Width, tObj->Image[0][maxl]->Height,
- &(FX_smallLodLog2(ti->info)), NULL,
- NULL, NULL, NULL, NULL);
- else
- FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info);
-
- /* [dBorca] this is necessary because of fxDDCompressedTexImage2D */
- if (ti->padded) {
- struct gl_texture_image *texImage = tObj->Image[0][minl];
- tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
- if (mml->wScale != 1 || mml->hScale != 1) {
- ti->sScale /= mml->wScale;
- ti->tScale /= mml->hScale;
- }
- }
-
- ti->baseLevelInternalFormat = tObj->Image[0][minl]->Format;
-
- ti->validated = GL_TRUE;
-
- ti->info.data = NULL;
-}
-
-static void
-fxPrintUnitsMode(const char *msg, GLuint mode)
-{
- fprintf(stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
- msg,
- mode,
- (mode & FX_UM_E0_REPLACE) ? "E0_REPLACE, " : "",
- (mode & FX_UM_E0_MODULATE) ? "E0_MODULATE, " : "",
- (mode & FX_UM_E0_DECAL) ? "E0_DECAL, " : "",
- (mode & FX_UM_E0_BLEND) ? "E0_BLEND, " : "",
- (mode & FX_UM_E1_REPLACE) ? "E1_REPLACE, " : "",
- (mode & FX_UM_E1_MODULATE) ? "E1_MODULATE, " : "",
- (mode & FX_UM_E1_DECAL) ? "E1_DECAL, " : "",
- (mode & FX_UM_E1_BLEND) ? "E1_BLEND, " : "",
- (mode & FX_UM_E0_ALPHA) ? "E0_ALPHA, " : "",
- (mode & FX_UM_E0_LUMINANCE) ? "E0_LUMINANCE, " : "",
- (mode & FX_UM_E0_LUMINANCE_ALPHA) ? "E0_LUMINANCE_ALPHA, " : "",
- (mode & FX_UM_E0_INTENSITY) ? "E0_INTENSITY, " : "",
- (mode & FX_UM_E0_RGB) ? "E0_RGB, " : "",
- (mode & FX_UM_E0_RGBA) ? "E0_RGBA, " : "",
- (mode & FX_UM_E1_ALPHA) ? "E1_ALPHA, " : "",
- (mode & FX_UM_E1_LUMINANCE) ? "E1_LUMINANCE, " : "",
- (mode & FX_UM_E1_LUMINANCE_ALPHA) ? "E1_LUMINANCE_ALPHA, " : "",
- (mode & FX_UM_E1_INTENSITY) ? "E1_INTENSITY, " : "",
- (mode & FX_UM_E1_RGB) ? "E1_RGB, " : "",
- (mode & FX_UM_E1_RGBA) ? "E1_RGBA, " : "",
- (mode & FX_UM_COLOR_ITERATED) ? "COLOR_ITERATED, " : "",
- (mode & FX_UM_COLOR_CONSTANT) ? "COLOR_CONSTANT, " : "",
- (mode & FX_UM_ALPHA_ITERATED) ? "ALPHA_ITERATED, " : "",
- (mode & FX_UM_ALPHA_CONSTANT) ? "ALPHA_CONSTANT, " : "");
-}
-
-static GLuint
-fxGetTexSetConfiguration(GLcontext * ctx,
- struct gl_texture_object *tObj0,
- struct gl_texture_object *tObj1)
-{
- GLuint unitsmode = 0;
- GLuint envmode = 0;
- GLuint ifmt = 0;
-
- if ((ctx->Light.ShadeModel == GL_SMOOTH) || 1 ||
- (ctx->Point.SmoothFlag) ||
- (ctx->Line.SmoothFlag) ||
- (ctx->Polygon.SmoothFlag)) unitsmode |= FX_UM_ALPHA_ITERATED;
- else
- unitsmode |= FX_UM_ALPHA_CONSTANT;
-
- if (ctx->Light.ShadeModel == GL_SMOOTH || 1)
- unitsmode |= FX_UM_COLOR_ITERATED;
- else
- unitsmode |= FX_UM_COLOR_CONSTANT;
-
-
-
- /*
- OpenGL Feeds Texture 0 into Texture 1
- Glide Feeds Texture 1 into Texture 0
- */
- if (tObj0) {
- tfxTexInfo *ti0 = fxTMGetTexInfo(tObj0);
-
- switch (ti0->baseLevelInternalFormat) {
- case GL_ALPHA:
- ifmt |= FX_UM_E0_ALPHA;
- break;
- case GL_LUMINANCE:
- ifmt |= FX_UM_E0_LUMINANCE;
- break;
- case GL_LUMINANCE_ALPHA:
- ifmt |= FX_UM_E0_LUMINANCE_ALPHA;
- break;
- case GL_INTENSITY:
- ifmt |= FX_UM_E0_INTENSITY;
- break;
- case GL_RGB:
- ifmt |= FX_UM_E0_RGB;
- break;
- case GL_RGBA:
- ifmt |= FX_UM_E0_RGBA;
- break;
- }
-
- switch (ctx->Texture.Unit[0].EnvMode) {
- case GL_DECAL:
- envmode |= FX_UM_E0_DECAL;
- break;
- case GL_MODULATE:
- envmode |= FX_UM_E0_MODULATE;
- break;
- case GL_REPLACE:
- envmode |= FX_UM_E0_REPLACE;
- break;
- case GL_BLEND:
- envmode |= FX_UM_E0_BLEND;
- break;
- case GL_ADD:
- envmode |= FX_UM_E0_ADD;
- break;
- default:
- /* do nothing */
- break;
- }
- }
-
- if (tObj1) {
- tfxTexInfo *ti1 = fxTMGetTexInfo(tObj1);
-
- switch (ti1->baseLevelInternalFormat) {
- case GL_ALPHA:
- ifmt |= FX_UM_E1_ALPHA;
- break;
- case GL_LUMINANCE:
- ifmt |= FX_UM_E1_LUMINANCE;
- break;
- case GL_LUMINANCE_ALPHA:
- ifmt |= FX_UM_E1_LUMINANCE_ALPHA;
- break;
- case GL_INTENSITY:
- ifmt |= FX_UM_E1_INTENSITY;
- break;
- case GL_RGB:
- ifmt |= FX_UM_E1_RGB;
- break;
- case GL_RGBA:
- ifmt |= FX_UM_E1_RGBA;
- break;
- default:
- /* do nothing */
- break;
- }
-
- switch (ctx->Texture.Unit[1].EnvMode) {
- case GL_DECAL:
- envmode |= FX_UM_E1_DECAL;
- break;
- case GL_MODULATE:
- envmode |= FX_UM_E1_MODULATE;
- break;
- case GL_REPLACE:
- envmode |= FX_UM_E1_REPLACE;
- break;
- case GL_BLEND:
- envmode |= FX_UM_E1_BLEND;
- break;
- case GL_ADD:
- envmode |= FX_UM_E1_ADD;
- break;
- default:
- /* do nothing */
- break;
- }
- }
-
- unitsmode |= (ifmt | envmode);
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE))
- fxPrintUnitsMode("fxGetTexSetConfiguration", unitsmode);
-
- return unitsmode;
-}
-
-/************************************************************************/
-/************************* Rendering Mode SetUp *************************/
-/************************************************************************/
-
-/************************* Single Texture Set ***************************/
-
-static void
-fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- int tmu;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupSingleTMU_NoLock(%p (%d))\n", (void *)tObj, tObj->Name);
- }
-
- ti->lastTimeUsed = fxMesa->texBindNumber;
-
- /* Make sure we're not loaded incorrectly */
- if (ti->isInTM) {
- if (ti->LODblend) {
- if (ti->whichTMU != FX_TMU_SPLIT)
- fxTMMoveOutTM(fxMesa, tObj);
- }
- else {
- if (ti->whichTMU == FX_TMU_SPLIT)
- fxTMMoveOutTM(fxMesa, tObj);
- }
- }
-
- /* Make sure we're loaded correctly */
- if (!ti->isInTM) {
- if (ti->LODblend)
- fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU_SPLIT);
- else {
- if (fxMesa->haveTwoTMUs) {
- if (fxTMCheckStartAddr(fxMesa, FX_TMU0, ti)) {
- fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0);
- }
- else {
- fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU1);
- }
- }
- else
- fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0);
- }
- }
-
- if (ti->LODblend && ti->whichTMU == FX_TMU_SPLIT) {
- /* broadcast */
- if ((ti->info.format == GR_TEXFMT_P_8)
- && (!fxMesa->haveGlobalPaletteTexture)) {
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupSingleTMU_NoLock: uploading texture palette\n");
- }
- grTexDownloadTable(ti->paltype, &(ti->palette));
- }
-
- grTexClampMode(GR_TMU0, ti->sClamp, ti->tClamp);
- grTexClampMode(GR_TMU1, ti->sClamp, ti->tClamp);
- grTexFilterMode(GR_TMU0, ti->minFilt, ti->maxFilt);
- grTexFilterMode(GR_TMU1, ti->minFilt, ti->maxFilt);
- grTexMipMapMode(GR_TMU0, ti->mmMode, ti->LODblend);
- grTexMipMapMode(GR_TMU1, ti->mmMode, ti->LODblend);
-
- grTexSource(GR_TMU0, ti->tm[FX_TMU0]->startAddr,
- GR_MIPMAPLEVELMASK_ODD, &(ti->info));
- grTexSource(GR_TMU1, ti->tm[FX_TMU1]->startAddr,
- GR_MIPMAPLEVELMASK_EVEN, &(ti->info));
- }
- else {
- if (ti->whichTMU == FX_TMU_BOTH)
- tmu = FX_TMU0;
- else
- tmu = ti->whichTMU;
-
- /* pointcast */
- if ((ti->info.format == GR_TEXFMT_P_8)
- && (!fxMesa->haveGlobalPaletteTexture)) {
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupSingleTMU_NoLock: uploading texture palette\n");
- }
- fxMesa->Glide.grTexDownloadTableExt(tmu, ti->paltype, &(ti->palette));
- }
-
- /* KW: The alternative is to do the download to the other tmu. If
- * we get to this point, I think it means we are thrashing the
- * texture memory, so perhaps it's not a good idea.
- */
- if (ti->LODblend && (TDFX_DEBUG & VERBOSE_DRIVER)) {
- fprintf(stderr, "fxSetupSingleTMU_NoLock: not blending texture - only one tmu\n");
- }
-
- grTexClampMode(tmu, ti->sClamp, ti->tClamp);
- grTexFilterMode(tmu, ti->minFilt, ti->maxFilt);
- grTexMipMapMode(tmu, ti->mmMode, FXFALSE);
-
- grTexSource(tmu, ti->tm[tmu]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
- }
-}
-
-static void
-fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
-{
- struct tdfx_texcombine tex0, tex1;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSelectSingleTMUSrc_NoLock(%d, %d)\n", tmu, LODblend);
- }
-
- tex0.InvertRGB = FXFALSE;
- tex0.InvertAlpha = FXFALSE;
- tex1.InvertRGB = FXFALSE;
- tex1.InvertAlpha = FXFALSE;
-
- if (LODblend) {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION;
-
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- fxMesa->tmuSrc = FX_TMU_SPLIT;
- }
- else {
- if (tmu != FX_TMU1) {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex0.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- fxMesa->tmuSrc = FX_TMU0;
- }
- else {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- /* correct values to set TMU0 in passthrough mode */
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE;
-
- fxMesa->tmuSrc = FX_TMU1;
- }
- }
-
- grTexCombine(GR_TMU0,
- tex0.FunctionRGB,
- tex0.FactorRGB,
- tex0.FunctionAlpha,
- tex0.FactorAlpha,
- tex0.InvertRGB,
- tex0.InvertAlpha);
- if (fxMesa->haveTwoTMUs) {
- grTexCombine(GR_TMU1,
- tex1.FunctionRGB,
- tex1.FactorRGB,
- tex1.FunctionAlpha,
- tex1.FactorAlpha,
- tex1.InvertRGB,
- tex1.InvertAlpha);
- }
-}
-
-static void
-fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- struct tdfx_combine alphaComb, colorComb;
- GrCombineLocal_t localc, locala;
- GLuint unitsmode;
- GLint ifmt;
- tfxTexInfo *ti;
- struct gl_texture_object *tObj = ctx->Texture.Unit[textureset]._Current;
- int tmu;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureSingleTMU_NoLock(%d)\n", textureset);
- }
-
- ti = fxTMGetTexInfo(tObj);
-
- fxTexValidate(ctx, tObj);
-
- fxSetupSingleTMU_NoLock(fxMesa, tObj);
-
- if (ti->whichTMU == FX_TMU_BOTH)
- tmu = FX_TMU0;
- else
- tmu = ti->whichTMU;
- if (fxMesa->tmuSrc != tmu)
- fxSelectSingleTMUSrc_NoLock(fxMesa, tmu, ti->LODblend);
-
- if (textureset == 0 || !fxMesa->haveTwoTMUs)
- unitsmode = fxGetTexSetConfiguration(ctx, tObj, NULL);
- else
- unitsmode = fxGetTexSetConfiguration(ctx, NULL, tObj);
-
-/* if(fxMesa->lastUnitsMode==unitsmode) */
-/* return; */
-
- fxMesa->lastUnitsMode = unitsmode;
-
- fxMesa->stw_hint_state = 0;
- FX_grHints_NoLock(GR_HINT_STWHINT, 0);
-
- ifmt = ti->baseLevelInternalFormat;
-
- if (unitsmode & FX_UM_ALPHA_ITERATED)
- locala = GR_COMBINE_LOCAL_ITERATED;
- else
- locala = GR_COMBINE_LOCAL_CONSTANT;
-
- if (unitsmode & FX_UM_COLOR_ITERATED)
- localc = GR_COMBINE_LOCAL_ITERATED;
- else
- localc = GR_COMBINE_LOCAL_CONSTANT;
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE))
- fprintf(stderr, "fxSetupTextureSingleTMU_NoLock: envmode is %s\n",
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[textureset].EnvMode));
-
- alphaComb.Local = locala;
- alphaComb.Invert = FXFALSE;
- colorComb.Local = localc;
- colorComb.Invert = FXFALSE;
-
- switch (ctx->Texture.Unit[textureset].EnvMode) {
- case GL_DECAL:
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
-
- colorComb.Function = GR_COMBINE_FUNCTION_BLEND;
- colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- break;
- case GL_MODULATE:
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
-
- if (ifmt == GL_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
- break;
- case GL_BLEND:
- if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) {
- /* Av = Af */
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- }
- else if (ifmt == GL_INTENSITY) {
- /* Av = Af * (1 - It) + Ac * It */
- alphaComb.Function = GR_COMBINE_FUNCTION_BLEND;
- alphaComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA;
- alphaComb.Other = GR_COMBINE_OTHER_CONSTANT;
- }
- else {
- /* Av = Af * At */
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
-
- if (ifmt == GL_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- if (fxMesa->type >= GR_SSTTYPE_Voodoo2) {
- colorComb.Function = GR_COMBINE_FUNCTION_BLEND;
- colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_RGB;
- colorComb.Other = GR_COMBINE_OTHER_CONSTANT;
- } else if (ifmt == GL_INTENSITY) {
- /* just a hack: RGB == ALPHA */
- colorComb.Function = GR_COMBINE_FUNCTION_BLEND;
- colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA;
- colorComb.Other = GR_COMBINE_OTHER_CONSTANT;
- } else {
- /* Only Voodoo^2 can GL_BLEND (GR_COMBINE_FACTOR_TEXTURE_RGB)
- * These settings assume that the TexEnv color is black and
- * incoming fragment color is white.
- */
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- colorComb.Invert = FXTRUE;
- _mesa_problem(NULL, "can't GL_BLEND with SST1");
- }
- }
-
- grConstantColorValue(
- (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[0] * 255.0f)) ) |
- (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[1] * 255.0f)) << 8) |
- (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[2] * 255.0f)) << 16) |
- (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[3] * 255.0f)) << 24));
- break;
- case GL_REPLACE:
- if ((ifmt == GL_RGB) || (ifmt == GL_LUMINANCE)) {
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
-
- if (ifmt == GL_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
- break;
- case GL_ADD:
- if (ifmt == GL_ALPHA ||
- ifmt == GL_LUMINANCE_ALPHA ||
- ifmt == GL_RGBA) {
- /* product of texel and fragment alpha */
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
- else if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) {
- /* fragment alpha is unchanged */
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- }
- else {
- /* sum of texel and fragment alpha */
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
-
- if (ifmt == GL_ALPHA) {
- /* rgb unchanged */
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- }
- else {
- /* sum of texel and fragment rgb */
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
- break;
- default:
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureSingleTMU_NoLock: %x Texture.EnvMode not yet supported\n",
- ctx->Texture.Unit[textureset].EnvMode);
- }
- return;
- }
-
- grAlphaCombine(alphaComb.Function,
- alphaComb.Factor,
- alphaComb.Local,
- alphaComb.Other,
- alphaComb.Invert);
- grColorCombine(colorComb.Function,
- colorComb.Factor,
- colorComb.Local,
- colorComb.Other,
- colorComb.Invert);
-}
-
-#if 00
-static void
-fxSetupTextureSingleTMU(GLcontext * ctx, GLuint textureset)
-{
- BEGIN_BOARD_LOCK();
- fxSetupTextureSingleTMU_NoLock(ctx, textureset);
- END_BOARD_LOCK();
-}
-#endif
-
-
-/************************* Double Texture Set ***************************/
-
-static void
-fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa,
- struct gl_texture_object *tObj0,
- struct gl_texture_object *tObj1)
-{
-#define T0_NOT_IN_TMU 0x01
-#define T1_NOT_IN_TMU 0x02
-#define T0_IN_TMU0 0x04
-#define T1_IN_TMU0 0x08
-#define T0_IN_TMU1 0x10
-#define T1_IN_TMU1 0x20
-
- tfxTexInfo *ti0 = fxTMGetTexInfo(tObj0);
- tfxTexInfo *ti1 = fxTMGetTexInfo(tObj1);
- GLuint tstate = 0;
- int tmu0 = 0, tmu1 = 1;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupDoubleTMU_NoLock(...)\n");
- }
-
- /* We shouldn't need to do this. There is something wrong with
- mutlitexturing when the TMUs are swapped. So, we're forcing
- them to always be loaded correctly. !!! */
- if (ti0->whichTMU == FX_TMU1)
- fxTMMoveOutTM_NoLock(fxMesa, tObj0);
- if (ti1->whichTMU == FX_TMU0)
- fxTMMoveOutTM_NoLock(fxMesa, tObj1);
-
- if (ti0->isInTM) {
- switch (ti0->whichTMU) {
- case FX_TMU0:
- tstate |= T0_IN_TMU0;
- break;
- case FX_TMU1:
- tstate |= T0_IN_TMU1;
- break;
- case FX_TMU_BOTH:
- tstate |= T0_IN_TMU0 | T0_IN_TMU1;
- break;
- case FX_TMU_SPLIT:
- tstate |= T0_NOT_IN_TMU;
- break;
- }
- }
- else
- tstate |= T0_NOT_IN_TMU;
-
- if (ti1->isInTM) {
- switch (ti1->whichTMU) {
- case FX_TMU0:
- tstate |= T1_IN_TMU0;
- break;
- case FX_TMU1:
- tstate |= T1_IN_TMU1;
- break;
- case FX_TMU_BOTH:
- tstate |= T1_IN_TMU0 | T1_IN_TMU1;
- break;
- case FX_TMU_SPLIT:
- tstate |= T1_NOT_IN_TMU;
- break;
- }
- }
- else
- tstate |= T1_NOT_IN_TMU;
-
- ti0->lastTimeUsed = fxMesa->texBindNumber;
- ti1->lastTimeUsed = fxMesa->texBindNumber;
-
- /* Move texture maps into TMUs */
-
- if (!(((tstate & T0_IN_TMU0) && (tstate & T1_IN_TMU1)) ||
- ((tstate & T0_IN_TMU1) && (tstate & T1_IN_TMU0)))) {
- if (tObj0 == tObj1)
- fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU_BOTH);
- else {
- /* Find the minimal way to correct the situation */
- if ((tstate & T0_IN_TMU0) || (tstate & T1_IN_TMU1)) {
- /* We have one in the standard order, setup the other */
- if (tstate & T0_IN_TMU0) { /* T0 is in TMU0, put T1 in TMU1 */
- fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU1);
- }
- else {
- fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU0);
- }
- /* tmu0 and tmu1 are setup */
- }
- else if ((tstate & T0_IN_TMU1) || (tstate & T1_IN_TMU0)) {
- /* we have one in the reverse order, setup the other */
- if (tstate & T1_IN_TMU0) { /* T1 is in TMU0, put T0 in TMU1 */
- fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU1);
- }
- else {
- fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU0);
- }
- tmu0 = 1;
- tmu1 = 0;
- }
- else { /* Nothing is loaded */
- fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU0);
- fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU1);
- /* tmu0 and tmu1 are setup */
- }
- }
- }
-
- /* [dBorca] Hack alert:
- * we put these in reverse order, so that if we can't
- * do _REAL_ pointcast, the TMU0 table gets broadcasted
- */
- if (!fxMesa->haveGlobalPaletteTexture) {
- /* pointcast */
- if (ti1->info.format == GR_TEXFMT_P_8) {
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupDoubleTMU_NoLock: uploading texture palette for TMU1\n");
- }
- fxMesa->Glide.grTexDownloadTableExt(ti1->whichTMU, ti1->paltype, &(ti1->palette));
- }
- if (ti0->info.format == GR_TEXFMT_P_8) {
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupDoubleTMU_NoLock: uploading texture palette for TMU0\n");
- }
- fxMesa->Glide.grTexDownloadTableExt(ti0->whichTMU, ti0->paltype, &(ti0->palette));
- }
- }
-
- grTexSource(tmu0, ti0->tm[tmu0]->startAddr,
- GR_MIPMAPLEVELMASK_BOTH, &(ti0->info));
- grTexClampMode(tmu0, ti0->sClamp, ti0->tClamp);
- grTexFilterMode(tmu0, ti0->minFilt, ti0->maxFilt);
- grTexMipMapMode(tmu0, ti0->mmMode, FXFALSE);
-
- grTexSource(tmu1, ti1->tm[tmu1]->startAddr,
- GR_MIPMAPLEVELMASK_BOTH, &(ti1->info));
- grTexClampMode(tmu1, ti1->sClamp, ti1->tClamp);
- grTexFilterMode(tmu1, ti1->minFilt, ti1->maxFilt);
- grTexMipMapMode(tmu1, ti1->mmMode, FXFALSE);
-
-#undef T0_NOT_IN_TMU
-#undef T1_NOT_IN_TMU
-#undef T0_IN_TMU0
-#undef T1_IN_TMU0
-#undef T0_IN_TMU1
-#undef T1_IN_TMU1
-}
-
-static void
-fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- struct tdfx_combine alphaComb, colorComb;
- struct tdfx_texcombine tex0, tex1;
- GrCombineLocal_t localc, locala;
- tfxTexInfo *ti0, *ti1;
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current;
- GLuint envmode, ifmt, unitsmode;
- int tmu0 = 0, tmu1 = 1;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock(...)\n");
- }
-
- ti0 = fxTMGetTexInfo(tObj0);
- fxTexValidate(ctx, tObj0);
-
- ti1 = fxTMGetTexInfo(tObj1);
- fxTexValidate(ctx, tObj1);
-
- fxSetupDoubleTMU_NoLock(fxMesa, tObj0, tObj1);
-
- unitsmode = fxGetTexSetConfiguration(ctx, tObj0, tObj1);
-
-/* if(fxMesa->lastUnitsMode==unitsmode) */
-/* return; */
-
- fxMesa->lastUnitsMode = unitsmode;
-
- fxMesa->stw_hint_state |= GR_STWHINT_ST_DIFF_TMU1;
- FX_grHints_NoLock(GR_HINT_STWHINT, fxMesa->stw_hint_state);
-
- envmode = unitsmode & FX_UM_E_ENVMODE;
- ifmt = unitsmode & FX_UM_E_IFMT;
-
- if (unitsmode & FX_UM_ALPHA_ITERATED)
- locala = GR_COMBINE_LOCAL_ITERATED;
- else
- locala = GR_COMBINE_LOCAL_CONSTANT;
-
- if (unitsmode & FX_UM_COLOR_ITERATED)
- localc = GR_COMBINE_LOCAL_ITERATED;
- else
- localc = GR_COMBINE_LOCAL_CONSTANT;
-
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE))
- fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock: envmode is %s/%s\n",
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode),
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode));
-
-
- if ((ti0->whichTMU == FX_TMU1) || (ti1->whichTMU == FX_TMU0)) {
- tmu0 = 1;
- tmu1 = 0;
- }
- fxMesa->tmuSrc = FX_TMU_BOTH;
-
- tex0.InvertRGB = FXFALSE;
- tex0.InvertAlpha = FXFALSE;
- tex1.InvertRGB = FXFALSE;
- tex1.InvertAlpha = FXFALSE;
- alphaComb.Local = locala;
- alphaComb.Invert = FXFALSE;
- colorComb.Local = localc;
- colorComb.Invert = FXFALSE;
-
- switch (envmode) {
- case (FX_UM_E0_MODULATE | FX_UM_E1_MODULATE):
- {
- GLboolean isalpha[FX_NUM_TMU];
-
- isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA);
- isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA);
-
- if (isalpha[FX_TMU1]) {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- tex1.InvertRGB = FXTRUE;
- } else {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- }
-
- if (isalpha[FX_TMU0]) {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- } else {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- }
-
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
-
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- break;
- }
- case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */
- if (tmu0 == FX_TMU1) {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- tex1.InvertRGB = FXTRUE;
-
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- }
- else {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE_MINUS_LOCAL;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE_MINUS_LOCAL;
- }
-
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
-
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- break;
- case (FX_UM_E0_REPLACE | FX_UM_E1_MODULATE): /* Quake 2 and 3 */
- if (tmu1 == FX_TMU1) {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- tex1.InvertAlpha = FXTRUE;
-
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL;
- }
- else {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE;
- }
-
- if (ti0->baseLevelInternalFormat == GL_RGB) {
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- }
-
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- break;
-
-
- case (FX_UM_E0_MODULATE | FX_UM_E1_ADD): /* Quake 3 Sky */
- {
- GLboolean isalpha[FX_NUM_TMU];
-
- isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA);
- isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA);
-
- if (isalpha[FX_TMU1]) {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- tex1.InvertRGB = FXTRUE;
- } else {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- }
-
- if (isalpha[FX_TMU0]) {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE;
- } else {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE;
- }
-
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
-
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- break;
- }
-
- case (FX_UM_E0_REPLACE | FX_UM_E1_ADD): /* Vulpine Sky */
- {
- GLboolean isalpha[FX_NUM_TMU];
-
- isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA);
- isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA);
-
- if (isalpha[FX_TMU1]) {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- tex1.InvertRGB = FXTRUE;
- } else {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
- }
-
- if (isalpha[FX_TMU0]) {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE;
- } else {
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- tex0.FactorRGB = GR_COMBINE_FACTOR_ONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE;
- }
-
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
-
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- break;
- }
-
- case (FX_UM_E0_MODULATE | FX_UM_E1_REPLACE): /* Homeworld2 */
- {
- tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex1.FunctionAlpha = GR_COMBINE_FUNCTION_ZERO;
- tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- tex0.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL;
- tex0.FactorRGB = GR_COMBINE_FACTOR_NONE;
- tex0.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL;
- tex0.FactorAlpha = GR_COMBINE_FACTOR_NONE;
-
- if (ifmt & (FX_UM_E0_RGB | FX_UM_E0_LUMINANCE)) {
- alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- alphaComb.Factor = GR_COMBINE_FACTOR_NONE;
- alphaComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- alphaComb.Factor = GR_COMBINE_FACTOR_ONE;
- alphaComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
-
- if (ifmt & FX_UM_E0_ALPHA) {
- colorComb.Function = GR_COMBINE_FUNCTION_LOCAL;
- colorComb.Factor = GR_COMBINE_FACTOR_NONE;
- colorComb.Other = GR_COMBINE_OTHER_NONE;
- } else {
- colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER;
- colorComb.Factor = GR_COMBINE_FACTOR_ONE;
- colorComb.Other = GR_COMBINE_OTHER_TEXTURE;
- }
- break;
- }
- default:
- fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock: Unexpected dual texture mode encountered\n");
- return;
- }
-
- grAlphaCombine(alphaComb.Function,
- alphaComb.Factor,
- alphaComb.Local,
- alphaComb.Other,
- alphaComb.Invert);
- grColorCombine(colorComb.Function,
- colorComb.Factor,
- colorComb.Local,
- colorComb.Other,
- colorComb.Invert);
- grTexCombine(GR_TMU0,
- tex0.FunctionRGB,
- tex0.FactorRGB,
- tex0.FunctionAlpha,
- tex0.FactorAlpha,
- tex0.InvertRGB,
- tex0.InvertAlpha);
- grTexCombine(GR_TMU1,
- tex1.FunctionRGB,
- tex1.FactorRGB,
- tex1.FunctionAlpha,
- tex1.FactorAlpha,
- tex1.InvertRGB,
- tex1.InvertAlpha);
-}
-
-/************************* No Texture ***************************/
-
-static void
-fxSetupTextureNone_NoLock(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrCombineLocal_t localc, locala;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureNone_NoLock(...)\n");
- }
-
- if ((ctx->Light.ShadeModel == GL_SMOOTH) || 1 ||
- (ctx->Point.SmoothFlag) ||
- (ctx->Line.SmoothFlag) ||
- (ctx->Polygon.SmoothFlag)) locala = GR_COMBINE_LOCAL_ITERATED;
- else
- locala = GR_COMBINE_LOCAL_CONSTANT;
-
- if (ctx->Light.ShadeModel == GL_SMOOTH || 1)
- localc = GR_COMBINE_LOCAL_ITERATED;
- else
- localc = GR_COMBINE_LOCAL_CONSTANT;
-
- grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- locala,
- GR_COMBINE_OTHER_NONE,
- FXFALSE);
-
- grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- localc,
- GR_COMBINE_OTHER_NONE,
- FXFALSE);
-
- fxMesa->lastUnitsMode = FX_UM_NONE;
-}
-
-#include "fxsetup.h"
-
-/************************************************************************/
-/************************** Texture Mode SetUp **************************/
-/************************************************************************/
-
-static void
-fxSetupTexture_NoLock(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTexture_NoLock(...)\n");
- }
-
- if (fxMesa->HaveCmbExt) {
- /* Texture Combine, Color Combine and Alpha Combine. */
- if ((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
- (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
- fxMesa->haveTwoTMUs) {
- fxSetupTextureDoubleTMUNapalm_NoLock(ctx);
- }
- else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- fxSetupTextureSingleTMUNapalm_NoLock(ctx, 0);
- }
- else if (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- fxSetupTextureSingleTMUNapalm_NoLock(ctx, 1);
- }
- else {
- fxSetupTextureNoneNapalm_NoLock(ctx);
- }
- } else {
- /* Texture Combine, Color Combine and Alpha Combine. */
- if ((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
- (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
- fxMesa->haveTwoTMUs) {
- fxSetupTextureDoubleTMU_NoLock(ctx);
- }
- else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- fxSetupTextureSingleTMU_NoLock(ctx, 0);
- }
- else if (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
- fxSetupTextureSingleTMU_NoLock(ctx, 1);
- }
- else {
- fxSetupTextureNone_NoLock(ctx);
- }
- }
-}
-
-void
-fxSetupTexture(GLcontext * ctx)
-{
- BEGIN_BOARD_LOCK();
- fxSetupTexture_NoLock(ctx);
- END_BOARD_LOCK();
-}
-
-/************************************************************************/
-/**************************** Blend SetUp *******************************/
-/************************************************************************/
-
-void
-fxDDBlendFuncSeparate(GLcontext * ctx, GLenum sfactor, GLenum dfactor, GLenum asfactor, GLenum adfactor)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
- GLboolean isNapalm = (fxMesa->type >= GR_SSTTYPE_Voodoo4);
- GLboolean have32bpp = (fxMesa->colDepth == 32);
- GLboolean haveAlpha = fxMesa->haveHwAlpha;
- GrAlphaBlendFnc_t sfact, dfact, asfact, adfact;
-
- /*
- * 15/16 BPP alpha channel alpha blending modes
- * 0x0 AZERO Zero
- * 0x4 AONE One
- *
- * 32 BPP alpha channel alpha blending modes
- * 0x0 AZERO Zero
- * 0x1 ASRC_ALPHA Source alpha
- * 0x3 ADST_ALPHA Destination alpha
- * 0x4 AONE One
- * 0x5 AOMSRC_ALPHA 1 - Source alpha
- * 0x7 AOMDST_ALPHA 1 - Destination alpha
- *
- * If we don't have HW alpha buffer:
- * DST_ALPHA == 1
- * ONE_MINUS_DST_ALPHA == 0
- * Unsupported modes are:
- * 1 if used as src blending factor
- * 0 if used as dst blending factor
- */
-
- switch (sfactor) {
- case GL_ZERO:
- sfact = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- sfact = GR_BLEND_ONE;
- break;
- case GL_DST_COLOR:
- sfact = GR_BLEND_DST_COLOR;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- sfact = GR_BLEND_ONE_MINUS_DST_COLOR;
- break;
- case GL_SRC_ALPHA:
- sfact = GR_BLEND_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- sfact = GR_BLEND_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- sfact = haveAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- sfact = haveAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/;
- break;
- case GL_SRC_ALPHA_SATURATE:
- sfact = GR_BLEND_ALPHA_SATURATE;
- break;
- case GL_SRC_COLOR:
- if (isNapalm) {
- sfact = GR_BLEND_SAME_COLOR_EXT;
- break;
- }
- case GL_ONE_MINUS_SRC_COLOR:
- if (isNapalm) {
- sfact = GR_BLEND_ONE_MINUS_SAME_COLOR_EXT;
- break;
- }
- default:
- sfact = GR_BLEND_ONE;
- break;
- }
-
- switch (asfactor) {
- case GL_ZERO:
- asfact = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- asfact = GR_BLEND_ONE;
- break;
- case GL_SRC_COLOR:
- case GL_SRC_ALPHA:
- asfact = have32bpp ? GR_BLEND_SRC_ALPHA : GR_BLEND_ONE/*bad*/;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_ONE_MINUS_SRC_ALPHA:
- asfact = have32bpp ? GR_BLEND_ONE_MINUS_SRC_ALPHA : GR_BLEND_ONE/*bad*/;
- break;
- case GL_DST_COLOR:
- case GL_DST_ALPHA:
- asfact = (have32bpp && haveAlpha) ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- case GL_ONE_MINUS_DST_ALPHA:
- asfact = (have32bpp && haveAlpha) ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/;
- break;
- case GL_SRC_ALPHA_SATURATE:
- asfact = GR_BLEND_ONE;
- break;
- default:
- asfact = GR_BLEND_ONE;
- break;
- }
-
- switch (dfactor) {
- case GL_ZERO:
- dfact = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- dfact = GR_BLEND_ONE;
- break;
- case GL_SRC_COLOR:
- dfact = GR_BLEND_SRC_COLOR;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- dfact = GR_BLEND_ONE_MINUS_SRC_COLOR;
- break;
- case GL_SRC_ALPHA:
- dfact = GR_BLEND_SRC_ALPHA;
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- dfact = GR_BLEND_ONE_MINUS_SRC_ALPHA;
- break;
- case GL_DST_ALPHA:
- dfact = haveAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/;
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- dfact = haveAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/;
- break;
- case GL_DST_COLOR:
- if (isNapalm) {
- dfact = GR_BLEND_SAME_COLOR_EXT;
- break;
- }
- case GL_ONE_MINUS_DST_COLOR:
- if (isNapalm) {
- dfact = GR_BLEND_ONE_MINUS_SAME_COLOR_EXT;
- break;
- }
- default:
- dfact = GR_BLEND_ZERO;
- break;
- }
-
- switch (adfactor) {
- case GL_ZERO:
- adfact = GR_BLEND_ZERO;
- break;
- case GL_ONE:
- adfact = GR_BLEND_ONE;
- break;
- case GL_SRC_COLOR:
- case GL_SRC_ALPHA:
- adfact = have32bpp ? GR_BLEND_SRC_ALPHA : GR_BLEND_ZERO/*bad*/;
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_ONE_MINUS_SRC_ALPHA:
- adfact = have32bpp ? GR_BLEND_ONE_MINUS_SRC_ALPHA : GR_BLEND_ZERO/*bad*/;
- break;
- case GL_DST_COLOR:
- case GL_DST_ALPHA:
- adfact = (have32bpp && haveAlpha) ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/;
- break;
- case GL_ONE_MINUS_DST_COLOR:
- case GL_ONE_MINUS_DST_ALPHA:
- adfact = (have32bpp && haveAlpha) ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/;
- break;
- default:
- adfact = GR_BLEND_ZERO;
- break;
- }
-
- if ((sfact != us->blendSrcFuncRGB) || (asfact != us->blendSrcFuncAlpha)) {
- us->blendSrcFuncRGB = sfact;
- us->blendSrcFuncAlpha = asfact;
- fxMesa->new_state |= FX_NEW_BLEND;
- }
-
- if ((dfact != us->blendDstFuncRGB) || (adfact != us->blendDstFuncAlpha)) {
- us->blendDstFuncRGB = dfact;
- us->blendDstFuncAlpha = adfact;
- fxMesa->new_state |= FX_NEW_BLEND;
- }
-}
-
-void
-fxDDBlendEquationSeparate(GLcontext * ctx, GLenum modeRGB, GLenum modeA)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
- GrAlphaBlendOp_t q;
-
- switch (modeRGB) {
- case GL_FUNC_ADD:
- q = GR_BLEND_OP_ADD;
- break;
- case GL_FUNC_SUBTRACT:
- q = GR_BLEND_OP_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- q = GR_BLEND_OP_REVSUB;
- break;
- default:
- q = us->blendEqRGB;
- }
- if (q != us->blendEqRGB) {
- us->blendEqRGB = q;
- fxMesa->new_state |= FX_NEW_BLEND;
- }
-
- switch (modeA) {
- case GL_FUNC_ADD:
- q = GR_BLEND_OP_ADD;
- break;
- case GL_FUNC_SUBTRACT:
- q = GR_BLEND_OP_SUB;
- break;
- case GL_FUNC_REVERSE_SUBTRACT:
- q = GR_BLEND_OP_REVSUB;
- break;
- default:
- q = us->blendEqAlpha;
- }
- if (q != us->blendEqAlpha) {
- us->blendEqAlpha = q;
- fxMesa->new_state |= FX_NEW_BLEND;
- }
-}
-
-void
-fxSetupBlend(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (fxMesa->HavePixExt) {
- if (us->blendEnabled) {
- fxMesa->Glide.grAlphaBlendFunctionExt(us->blendSrcFuncRGB, us->blendDstFuncRGB,
- us->blendEqRGB,
- us->blendSrcFuncAlpha, us->blendDstFuncAlpha,
- us->blendEqAlpha);
- } else {
- fxMesa->Glide.grAlphaBlendFunctionExt(GR_BLEND_ONE, GR_BLEND_ZERO,
- GR_BLEND_OP_ADD,
- GR_BLEND_ONE, GR_BLEND_ZERO,
- GR_BLEND_OP_ADD);
- }
- } else {
- if (us->blendEnabled) {
- grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB,
- us->blendSrcFuncAlpha, us->blendDstFuncAlpha);
- } else {
- grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO,
- GR_BLEND_ONE, GR_BLEND_ZERO);
- }
- }
-}
-
-/************************************************************************/
-/************************** Alpha Test SetUp ****************************/
-/************************************************************************/
-
-void
-fxDDAlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (
- (us->alphaTestFunc != func)
- ||
- (us->alphaTestRefValue != ref)
- ) {
- us->alphaTestFunc = func;
- us->alphaTestRefValue = ref;
- fxMesa->new_state |= FX_NEW_ALPHA;
- }
-}
-
-static void
-fxSetupAlphaTest(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (us->alphaTestEnabled) {
- GrAlpha_t ref = (GLint) (us->alphaTestRefValue * 255.0);
- grAlphaTestFunction(us->alphaTestFunc - GL_NEVER + GR_CMP_NEVER);
- grAlphaTestReferenceValue(ref);
- }
- else
- grAlphaTestFunction(GR_CMP_ALWAYS);
-}
-
-/************************************************************************/
-/************************** Depth Test SetUp ****************************/
-/************************************************************************/
-
-void
-fxDDDepthFunc(GLcontext * ctx, GLenum func)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (us->depthTestFunc != func) {
- us->depthTestFunc = func;
- fxMesa->new_state |= FX_NEW_DEPTH;
- }
-}
-
-void
-fxDDDepthMask(GLcontext * ctx, GLboolean flag)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (flag != us->depthMask) {
- us->depthMask = flag;
- fxMesa->new_state |= FX_NEW_DEPTH;
- }
-}
-
-void
-fxSetupDepthTest(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (us->depthTestEnabled) {
- grDepthBufferFunction(us->depthTestFunc - GL_NEVER + GR_CMP_NEVER);
- grDepthMask(us->depthMask);
- }
- else {
- grDepthBufferFunction(GR_CMP_ALWAYS);
- grDepthMask(FXFALSE);
- }
-}
-
-/************************************************************************/
-/************************** Stencil SetUp *******************************/
-/************************************************************************/
-
-static GrStencil_t convertGLStencilOp( GLenum op )
-{
- switch ( op ) {
- case GL_KEEP:
- return GR_STENCILOP_KEEP;
- case GL_ZERO:
- return GR_STENCILOP_ZERO;
- case GL_REPLACE:
- return GR_STENCILOP_REPLACE;
- case GL_INCR:
- return GR_STENCILOP_INCR_CLAMP;
- case GL_DECR:
- return GR_STENCILOP_DECR_CLAMP;
- case GL_INVERT:
- return GR_STENCILOP_INVERT;
- case GL_INCR_WRAP_EXT:
- return GR_STENCILOP_INCR_WRAP;
- case GL_DECR_WRAP_EXT:
- return GR_STENCILOP_DECR_WRAP;
- default:
- _mesa_problem( NULL, "bad stencil op in convertGLStencilOp" );
- }
- return GR_STENCILOP_KEEP; /* never get, silence compiler warning */
-}
-
-void
-fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (ctx->Stencil.ActiveFace) {
- return;
- }
-
- if (
- (us->stencilFunction != func)
- ||
- (us->stencilRefValue != ref)
- ||
- (us->stencilValueMask != mask)
- ) {
- us->stencilFunction = func;
- us->stencilRefValue = ref;
- us->stencilValueMask = mask;
- fxMesa->new_state |= FX_NEW_STENCIL;
- }
-}
-
-void
-fxDDStencilMask (GLcontext *ctx, GLuint mask)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (ctx->Stencil.ActiveFace) {
- return;
- }
-
- if (us->stencilWriteMask != mask) {
- us->stencilWriteMask = mask;
- fxMesa->new_state |= FX_NEW_STENCIL;
- }
-}
-
-void
-fxDDStencilOp (GLcontext *ctx, GLenum sfail, GLenum zfail, GLenum zpass)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (ctx->Stencil.ActiveFace) {
- return;
- }
-
- if (
- (us->stencilFailFunc != sfail)
- ||
- (us->stencilZFailFunc != zfail)
- ||
- (us->stencilZPassFunc != zpass)
- ) {
- us->stencilFailFunc = sfail;
- us->stencilZFailFunc = zfail;
- us->stencilZPassFunc = zpass;
- fxMesa->new_state |= FX_NEW_STENCIL;
- }
-}
-
-void
-fxSetupStencil (GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (us->stencilEnabled) {
- GrCmpFnc_t stencilFailFunc = GR_STENCILOP_KEEP;
- GrCmpFnc_t stencilZFailFunc = GR_STENCILOP_KEEP;
- GrCmpFnc_t stencilZPassFunc = GR_STENCILOP_KEEP;
- if (!fxMesa->multipass) {
- stencilFailFunc = convertGLStencilOp(us->stencilFailFunc);
- stencilZFailFunc = convertGLStencilOp(us->stencilZFailFunc);
- stencilZPassFunc = convertGLStencilOp(us->stencilZPassFunc);
- }
- grEnable(GR_STENCIL_MODE_EXT);
- fxMesa->Glide.grStencilOpExt(stencilFailFunc,
- stencilZFailFunc,
- stencilZPassFunc);
- fxMesa->Glide.grStencilFuncExt(us->stencilFunction - GL_NEVER + GR_CMP_NEVER,
- us->stencilRefValue,
- us->stencilValueMask);
- fxMesa->Glide.grStencilMaskExt(us->stencilWriteMask);
- } else {
- grDisable(GR_STENCIL_MODE_EXT);
- }
-}
-
-void
-fxSetupStencilFace (GLcontext * ctx, GLint face)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (us->stencilEnabled) {
- GrCmpFnc_t stencilFailFunc = GR_STENCILOP_KEEP;
- GrCmpFnc_t stencilZFailFunc = GR_STENCILOP_KEEP;
- GrCmpFnc_t stencilZPassFunc = GR_STENCILOP_KEEP;
- if (!fxMesa->multipass) {
- stencilFailFunc = convertGLStencilOp(ctx->Stencil.FailFunc[face]);
- stencilZFailFunc = convertGLStencilOp(ctx->Stencil.ZFailFunc[face]);
- stencilZPassFunc = convertGLStencilOp(ctx->Stencil.ZPassFunc[face]);
- }
- grEnable(GR_STENCIL_MODE_EXT);
- fxMesa->Glide.grStencilOpExt(stencilFailFunc,
- stencilZFailFunc,
- stencilZPassFunc);
- fxMesa->Glide.grStencilFuncExt(ctx->Stencil.Function[face] - GL_NEVER + GR_CMP_NEVER,
- ctx->Stencil.Ref[face],
- ctx->Stencil.ValueMask[face]);
- fxMesa->Glide.grStencilMaskExt(ctx->Stencil.WriteMask[face]);
- } else {
- grDisable(GR_STENCIL_MODE_EXT);
- }
-}
-
-/************************************************************************/
-/**************************** Color Mask SetUp **************************/
-/************************************************************************/
-
-void
-fxDDColorMask(GLcontext * ctx,
- GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- fxMesa->new_state |= FX_NEW_COLOR_MASK;
- (void) r;
- (void) g;
- (void) b;
- (void) a;
-}
-
-void
-fxSetupColorMask(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (fxMesa->colDepth == 32) {
- /* 32bpp mode */
- fxMesa->Glide.grColorMaskExt(ctx->Color.ColorMask[RCOMP],
- ctx->Color.ColorMask[GCOMP],
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] && fxMesa->haveHwAlpha);
- }
- else {
- /* 15/16 bpp mode */
- grColorMask(ctx->Color.ColorMask[RCOMP] |
- ctx->Color.ColorMask[GCOMP] |
- ctx->Color.ColorMask[BCOMP],
- ctx->Color.ColorMask[ACOMP] && fxMesa->haveHwAlpha);
- }
-}
-
-
-
-
-/************************************************************************/
-/**************************** Fog Mode SetUp ****************************/
-/************************************************************************/
-
-/*
- * This is called during state update in order to update the Glide fog state.
- */
-static void
-fxSetupFog(GLcontext * ctx)
-{
- if (ctx->Fog.Enabled /*&& ctx->FogMode==FOG_FRAGMENT */ ) {
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- /* update fog color */
- GLubyte col[4];
- col[0] = (unsigned int) (255 * ctx->Fog.Color[0]);
- col[1] = (unsigned int) (255 * ctx->Fog.Color[1]);
- col[2] = (unsigned int) (255 * ctx->Fog.Color[2]);
- col[3] = (unsigned int) (255 * ctx->Fog.Color[3]);
- grFogColorValue(FXCOLOR4(col));
-
- if (fxMesa->fogTableMode != ctx->Fog.Mode ||
- fxMesa->fogDensity != ctx->Fog.Density ||
- fxMesa->fogStart != ctx->Fog.Start ||
- fxMesa->fogEnd != ctx->Fog.End) {
- /* reload the fog table */
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- guFogGenerateLinear(fxMesa->fogTable, ctx->Fog.Start,
- ctx->Fog.End);
- if (fxMesa->fogTable[0] > 63) {
- /* [dBorca] Hack alert:
- * As per Glide3 Programming Guide:
- * The difference between consecutive fog values
- * must be less than 64.
- */
- fxMesa->fogTable[0] = 63;
- }
- break;
- case GL_EXP:
- guFogGenerateExp(fxMesa->fogTable, ctx->Fog.Density);
- break;
- case GL_EXP2:
- guFogGenerateExp2(fxMesa->fogTable, ctx->Fog.Density);
- break;
- default:
- ;
- }
- fxMesa->fogTableMode = ctx->Fog.Mode;
- fxMesa->fogDensity = ctx->Fog.Density;
- fxMesa->fogStart = ctx->Fog.Start;
- fxMesa->fogEnd = ctx->Fog.End;
- }
-
- grFogTable(fxMesa->fogTable);
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- grVertexLayout(GR_PARAM_FOG_EXT, GR_VERTEX_FOG_OFFSET << 2,
- GR_PARAM_ENABLE);
- grFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
- } else {
- grVertexLayout(GR_PARAM_FOG_EXT, GR_VERTEX_FOG_OFFSET << 2,
- GR_PARAM_DISABLE);
- grFogMode(GR_FOG_WITH_TABLE_ON_Q);
- }
- }
- else {
- grFogMode(GR_FOG_DISABLE);
- }
-}
-
-void
-fxDDFogfv(GLcontext * ctx, GLenum pname, const GLfloat * params)
-{
- FX_CONTEXT(ctx)->new_state |= FX_NEW_FOG;
- switch (pname) {
- case GL_FOG_COORDINATE_SOURCE_EXT: {
- GLenum p = (GLenum)*params;
- if (p == GL_FOG_COORDINATE_EXT) {
- _swrast_allow_vertex_fog(ctx, GL_TRUE);
- _swrast_allow_pixel_fog(ctx, GL_FALSE);
- _tnl_allow_vertex_fog( ctx, GL_TRUE);
- _tnl_allow_pixel_fog( ctx, GL_FALSE);
- } else {
- _swrast_allow_vertex_fog(ctx, GL_FALSE);
- _swrast_allow_pixel_fog(ctx, GL_TRUE);
- _tnl_allow_vertex_fog( ctx, GL_FALSE);
- _tnl_allow_pixel_fog( ctx, GL_TRUE);
- }
- break;
- }
- default:
- ;
- }
-}
-
-/************************************************************************/
-/************************** Scissor Test SetUp **************************/
-/************************************************************************/
-
-/* This routine is used in managing the lock state, and therefore can't lock */
-void
-fxSetScissorValues(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- int xmin, xmax;
- int ymin, ymax;
-
- if (ctx->Scissor.Enabled) {
- xmin = ctx->Scissor.X;
- xmax = ctx->Scissor.X + ctx->Scissor.Width;
- ymin = ctx->Scissor.Y;
- ymax = ctx->Scissor.Y + ctx->Scissor.Height;
-
- if (xmin < 0)
- xmin = 0;
- if (xmax > fxMesa->width)
- xmax = fxMesa->width;
- if (ymin < fxMesa->screen_height - fxMesa->height)
- ymin = fxMesa->screen_height - fxMesa->height;
- if (ymax > fxMesa->screen_height - 0)
- ymax = fxMesa->screen_height - 0;
- }
- else {
- xmin = 0;
- ymin = 0;
- xmax = fxMesa->width;
- ymax = fxMesa->height;
- }
-
- fxMesa->clipMinX = xmin;
- fxMesa->clipMinY = ymin;
- fxMesa->clipMaxX = xmax;
- fxMesa->clipMaxY = ymax;
- grClipWindow(xmin, ymin, xmax, ymax);
-}
-
-void
-fxSetupScissor(GLcontext * ctx)
-{
- BEGIN_BOARD_LOCK();
- fxSetScissorValues(ctx);
- END_BOARD_LOCK();
-}
-
-void
-fxDDScissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- FX_CONTEXT(ctx)->new_state |= FX_NEW_SCISSOR;
-}
-
-/************************************************************************/
-/*************************** Cull mode setup ****************************/
-/************************************************************************/
-
-
-void
-fxDDCullFace(GLcontext * ctx, GLenum mode)
-{
- (void) mode;
- FX_CONTEXT(ctx)->new_state |= FX_NEW_CULL;
-}
-
-void
-fxDDFrontFace(GLcontext * ctx, GLenum mode)
-{
- (void) mode;
- FX_CONTEXT(ctx)->new_state |= FX_NEW_CULL;
-}
-
-
-void
-fxSetupCull(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrCullMode_t mode = GR_CULL_DISABLE;
-
- if (ctx->Polygon.CullFlag && (fxMesa->raster_primitive == GL_TRIANGLES)) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- if (ctx->Polygon.FrontFace == GL_CCW)
- mode = GR_CULL_NEGATIVE;
- else
- mode = GR_CULL_POSITIVE;
- break;
- case GL_FRONT:
- if (ctx->Polygon.FrontFace == GL_CCW)
- mode = GR_CULL_POSITIVE;
- else
- mode = GR_CULL_NEGATIVE;
- break;
- case GL_FRONT_AND_BACK:
- /* Handled as a fallback on triangles in tdfx_tris.c */
- return;
- default:
- ASSERT(0);
- break;
- }
- }
-
- if (fxMesa->cullMode != mode) {
- fxMesa->cullMode = mode;
- grCullMode(mode);
- }
-}
-
-
-/************************************************************************/
-/****************************** DD Enable ******************************/
-/************************************************************************/
-
-void
-fxDDEnable(GLcontext * ctx, GLenum cap, GLboolean state)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "%s(%s)\n", state ? "fxDDEnable" : "fxDDDisable",
- _mesa_lookup_enum_by_nr(cap));
- }
-
- switch (cap) {
- case GL_ALPHA_TEST:
- if (state != us->alphaTestEnabled) {
- us->alphaTestEnabled = state;
- fxMesa->new_state |= FX_NEW_ALPHA;
- }
- break;
- case GL_BLEND:
- if (state != us->blendEnabled) {
- us->blendEnabled = state;
- fxMesa->new_state |= FX_NEW_BLEND;
- }
- break;
- case GL_DEPTH_TEST:
- if (state != us->depthTestEnabled) {
- us->depthTestEnabled = state;
- fxMesa->new_state |= FX_NEW_DEPTH;
- }
- break;
- case GL_STENCIL_TEST:
- if (fxMesa->haveHwStencil && state != us->stencilEnabled) {
- us->stencilEnabled = state;
- fxMesa->new_state |= FX_NEW_STENCIL;
- }
- break;
- case GL_DITHER:
- if (state) {
- grDitherMode(GR_DITHER_4x4);
- }
- else {
- grDitherMode(GR_DITHER_DISABLE);
- }
- break;
- case GL_SCISSOR_TEST:
- fxMesa->new_state |= FX_NEW_SCISSOR;
- break;
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- fxDDTexUseGlbPalette(ctx, state);
- break;
- case GL_FOG:
- fxMesa->new_state |= FX_NEW_FOG;
- break;
- case GL_CULL_FACE:
- fxMesa->new_state |= FX_NEW_CULL;
- break;
- case GL_LINE_SMOOTH:
- case GL_LINE_STIPPLE:
- case GL_POINT_SMOOTH:
- case GL_POLYGON_SMOOTH:
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- fxMesa->new_state |= FX_NEW_TEXTURING;
- break;
- default:
- ; /* XXX no-op? */
- }
-}
-
-
-
-
-/************************************************************************/
-/************************** Changes to units state **********************/
-/************************************************************************/
-
-
-/* All units setup is handled under texture setup.
- */
-void
-fxDDShadeModel(GLcontext * ctx, GLenum mode)
-{
- FX_CONTEXT(ctx)->new_state |= FX_NEW_TEXTURING;
-}
-
-
-
-/************************************************************************/
-/****************************** Units SetUp *****************************/
-/************************************************************************/
-static void
-fx_print_state_flags(const char *msg, GLuint flags)
-{
- fprintf(stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s\n",
- msg,
- flags,
- (flags & FX_NEW_TEXTURING) ? "texture, " : "",
- (flags & FX_NEW_BLEND) ? "blend, " : "",
- (flags & FX_NEW_ALPHA) ? "alpha, " : "",
- (flags & FX_NEW_FOG) ? "fog, " : "",
- (flags & FX_NEW_SCISSOR) ? "scissor, " : "",
- (flags & FX_NEW_COLOR_MASK) ? "colormask, " : "",
- (flags & FX_NEW_CULL) ? "cull, " : "",
- (flags & FX_NEW_STENCIL) ? "stencil, " : "");
-}
-
-void
-fxSetupFXUnits(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint newstate = fxMesa->new_state;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER)
- fx_print_state_flags("fxSetupFXUnits", newstate);
-
- if (newstate) {
- if (newstate & FX_NEW_TEXTURING)
- fxSetupTexture(ctx);
-
- if (newstate & FX_NEW_BLEND)
- fxSetupBlend(ctx);
-
- if (newstate & FX_NEW_ALPHA)
- fxSetupAlphaTest(ctx);
-
- if (newstate & FX_NEW_DEPTH)
- fxSetupDepthTest(ctx);
-
- if (newstate & FX_NEW_STENCIL)
- fxSetupStencil(ctx);
-
- if (newstate & FX_NEW_FOG)
- fxSetupFog(ctx);
-
- if (newstate & FX_NEW_SCISSOR)
- fxSetupScissor(ctx);
-
- if (newstate & FX_NEW_COLOR_MASK)
- fxSetupColorMask(ctx);
-
- if (newstate & FX_NEW_CULL)
- fxSetupCull(ctx);
-
- fxMesa->new_state = 0;
- }
-}
-
-
-
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_setup(void);
-int
-gl_fx_dummy_function_setup(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.h b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.h
deleted file mode 100644
index 9d337d4b0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxsetup.h
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
-/* This code belongs to fxsetup.c, but I didn't want to clutter
- * the original code with Napalm specifics, in order to keep things
- * clear -- especially for backward compatibility. I should have
- * put it into another .c file, but I didn't want to export so many
- * things...
- * The point is, Napalm uses a different technique for texture env.
- * SST1 Single texturing:
- * setup standard grTexCombine
- * fiddle with grColorCombine/grAlphaCombine
- * SST1 Multi texturing:
- * fiddle with grTexCombine/grColorCombine/grAlphaCombine
- * Napalm Single texturing:
- * setup standard grColorCombineExt/grAlphaCombineExt
- * fiddle with grTexColorCombine/grTexAlphaCombine
- * Napalm Multi texturing:
- * setup standard grColorCombineExt/grAlphaCombineExt
- * fiddle with grTexColorCombine/grTexAlphaCombine
- */
-
-/*
- * These macros are used below when handling COMBINE_EXT.
- */
-#define TEXENV_OPERAND_INVERTED(operand) \
- (((operand) == GL_ONE_MINUS_SRC_ALPHA) \
- || ((operand) == GL_ONE_MINUS_SRC_COLOR))
-#define TEXENV_OPERAND_ALPHA(operand) \
- (((operand) == GL_SRC_ALPHA) || ((operand) == GL_ONE_MINUS_SRC_ALPHA))
-#define TEXENV_SETUP_ARG_A(param, source, operand, iteratedAlpha) \
- switch (source) { \
- case GL_TEXTURE: \
- param = GR_CMBX_LOCAL_TEXTURE_ALPHA; \
- break; \
- case GL_CONSTANT_EXT: \
- param = GR_CMBX_TMU_CALPHA; \
- break; \
- case GL_PRIMARY_COLOR_EXT: \
- param = GR_CMBX_ITALPHA; \
- break; \
- case GL_PREVIOUS_EXT: \
- param = iteratedAlpha; \
- break; \
- default: \
- /* \
- * This is here just to keep from getting \
- * compiler warnings. \
- */ \
- param = GR_CMBX_ZERO; \
- break; \
- }
-
-#define TEXENV_SETUP_ARG_RGB(param, source, operand, iteratedColor, iteratedAlpha) \
- if (!TEXENV_OPERAND_ALPHA(operand)) { \
- switch (source) { \
- case GL_TEXTURE: \
- param = GR_CMBX_LOCAL_TEXTURE_RGB; \
- break; \
- case GL_CONSTANT_EXT: \
- param = GR_CMBX_TMU_CCOLOR; \
- break; \
- case GL_PRIMARY_COLOR_EXT: \
- param = GR_CMBX_ITRGB; \
- break; \
- case GL_PREVIOUS_EXT: \
- param = iteratedColor; \
- break; \
- default: \
- /* \
- * This is here just to keep from getting \
- * compiler warnings. \
- */ \
- param = GR_CMBX_ZERO; \
- break; \
- } \
- } else { \
- switch (source) { \
- case GL_TEXTURE: \
- param = GR_CMBX_LOCAL_TEXTURE_ALPHA; \
- break; \
- case GL_CONSTANT_EXT: \
- param = GR_CMBX_TMU_CALPHA; \
- break; \
- case GL_PRIMARY_COLOR_EXT: \
- param = GR_CMBX_ITALPHA; \
- break; \
- case GL_PREVIOUS_EXT: \
- param = iteratedAlpha; \
- break; \
- default: \
- /* \
- * This is here just to keep from getting \
- * compiler warnings. \
- */ \
- param = GR_CMBX_ZERO; \
- break; \
- } \
- }
-
-#define TEXENV_SETUP_MODE_RGB(param, operand) \
- switch (operand) { \
- case GL_SRC_COLOR: \
- case GL_SRC_ALPHA: \
- param = GR_FUNC_MODE_X; \
- break; \
- case GL_ONE_MINUS_SRC_ALPHA: \
- case GL_ONE_MINUS_SRC_COLOR: \
- param = GR_FUNC_MODE_ONE_MINUS_X; \
- break; \
- default: \
- param = GR_FUNC_MODE_ZERO; \
- break; \
- }
-
-#define TEXENV_SETUP_MODE_A(param, operand) \
- switch (operand) { \
- case GL_SRC_ALPHA: \
- param = GR_FUNC_MODE_X; \
- break; \
- case GL_ONE_MINUS_SRC_ALPHA: \
- param = GR_FUNC_MODE_ONE_MINUS_X; \
- break; \
- default: \
- param = GR_FUNC_MODE_ZERO; \
- break; \
- }
-
-static void
-fxSetupTextureEnvNapalm_NoLock(GLcontext * ctx, GLuint textureset, GLuint tmu, GLboolean iterated)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[textureset];
- struct tdfx_combine_alpha_ext alphaComb;
- struct tdfx_combine_color_ext colorComb;
- const GLfloat *envColor = texUnit->EnvColor;
- GrCombineLocal_t localc, locala; /* fragmentColor/Alpha */
- GLint ifmt;
- tfxTexInfo *ti;
- struct gl_texture_object *tObj = texUnit->_Current;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureEnvNapalm_NoLock(unit %u, TMU %u, iterated %d)\n",
- textureset, tmu, iterated);
- }
-
- ti = fxTMGetTexInfo(tObj);
-
- ifmt = ti->baseLevelInternalFormat;
-
- if (iterated) {
- /* we don't have upstream TMU */
- locala = GR_CMBX_ITALPHA;
- localc = GR_CMBX_ITRGB;
- } else {
- /* we have upstream TMU */
- locala = GR_CMBX_OTHER_TEXTURE_ALPHA;
- localc = GR_CMBX_OTHER_TEXTURE_RGB;
- }
-
- alphaComb.InvertD = FXFALSE;
- alphaComb.Shift = 0;
- alphaComb.Invert = FXFALSE;
- colorComb.InvertD = FXFALSE;
- colorComb.Shift = 0;
- colorComb.Invert = FXFALSE;
-
- switch (texUnit->EnvMode) {
- case GL_DECAL:
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
-
- colorComb.SourceA = GR_CMBX_LOCAL_TEXTURE_RGB;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = localc;
- colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- colorComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- colorComb.InvertC = FXFALSE;
- colorComb.SourceD = GR_CMBX_B;
- break;
- case GL_MODULATE:
- if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- } else {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- alphaComb.InvertC = FXFALSE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- }
-
- if (ifmt == GL_ALPHA) {
- colorComb.SourceA = localc;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- } else {
- colorComb.SourceA = localc;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_LOCAL_TEXTURE_RGB;
- colorComb.InvertC = FXFALSE;
- colorComb.SourceD = GR_CMBX_ZERO;
- }
- break;
- case GL_BLEND:
- if (ifmt == GL_INTENSITY) {
- alphaComb.SourceA = GR_CMBX_TMU_CALPHA;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = locala;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- alphaComb.InvertC = FXFALSE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- } else {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- alphaComb.InvertC = FXFALSE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- }
-
- if (ifmt == GL_ALPHA) {
- colorComb.SourceA = localc;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- } else {
- colorComb.SourceA = GR_CMBX_TMU_CCOLOR;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = localc;
- colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- colorComb.SourceC = GR_CMBX_LOCAL_TEXTURE_RGB;
- colorComb.InvertC = FXFALSE;
- colorComb.SourceD = GR_CMBX_B;
- }
-
- fxMesa->Glide.grConstantColorValueExt(tmu,
- (((GLuint)(envColor[0] * 255.0f)) ) |
- (((GLuint)(envColor[1] * 255.0f)) << 8) |
- (((GLuint)(envColor[2] * 255.0f)) << 16) |
- (((GLuint)(envColor[3] * 255.0f)) << 24));
- break;
- case GL_REPLACE:
- if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- } else {
- alphaComb.SourceA = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- }
-
- if (ifmt == GL_ALPHA) {
- colorComb.SourceA = localc;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- } else {
- colorComb.SourceA = GR_CMBX_LOCAL_TEXTURE_RGB;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- }
- break;
- case GL_ADD:
- if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- } else if (ifmt == GL_INTENSITY) {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- } else {
- alphaComb.SourceA = locala;
- alphaComb.ModeA = GR_FUNC_MODE_X;
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_X;
- alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA;
- alphaComb.InvertC = FXFALSE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- }
-
- if (ifmt == GL_ALPHA) {
- colorComb.SourceA = localc;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- } else {
- colorComb.SourceA = localc;
- colorComb.ModeA = GR_FUNC_MODE_X;
- colorComb.SourceB = GR_CMBX_LOCAL_TEXTURE_RGB;
- colorComb.ModeB = GR_FUNC_MODE_X;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- }
- break;
- /* COMBINE_EXT */
- case GL_COMBINE_EXT:
- /* XXX todo - INCOMPLETE!!! */
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) {
-#if 1
- fprintf(stderr, "COMBINE_EXT: %s + %s\n",
- _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB),
- _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
-#else
- fprintf(stderr, "Texture Unit %d\n", textureset);
- fprintf(stderr, " GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode));
- fprintf(stderr, " GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
- fprintf(stderr, " GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
- fprintf(stderr, " GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0]));
- fprintf(stderr, " GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1]));
- fprintf(stderr, " GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2]));
- fprintf(stderr, " GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0]));
- fprintf(stderr, " GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1]));
- fprintf(stderr, " GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2]));
- fprintf(stderr, " GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0]));
- fprintf(stderr, " GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1]));
- fprintf(stderr, " GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2]));
- fprintf(stderr, " GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0]));
- fprintf(stderr, " GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1]));
- fprintf(stderr, " GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2]));
- fprintf(stderr, " GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB);
- fprintf(stderr, " GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA);
- fprintf(stderr, " GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", envColor[0], envColor[1], envColor[2], envColor[3]);
-#endif
- }
-
- alphaComb.Shift = texUnit->Combine.ScaleShiftA;
- colorComb.Shift = texUnit->Combine.ScaleShiftRGB;
-
- switch (texUnit->Combine.ModeRGB) {
- case GL_MODULATE:
- /* Arg0 * Arg1 == (A + 0) * C + 0 */
- TEXENV_SETUP_ARG_RGB(colorComb.SourceA,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- localc, locala);
- TEXENV_SETUP_MODE_RGB(colorComb.ModeA,
- texUnit->Combine.OperandRGB[0]);
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_ZERO;
- TEXENV_SETUP_ARG_RGB(colorComb.SourceC,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- localc, locala);
- colorComb.InvertC = TEXENV_OPERAND_INVERTED(
- texUnit->Combine.OperandRGB[1]);
- colorComb.SourceD = GR_CMBX_ZERO;
- break;
- case GL_REPLACE:
- /* Arg0 == (A + 0) * 1 + 0 */
- TEXENV_SETUP_ARG_RGB(colorComb.SourceA,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- localc, locala);
- TEXENV_SETUP_MODE_RGB(colorComb.ModeA,
- texUnit->Combine.OperandRGB[0]);
- colorComb.SourceB = GR_CMBX_ZERO;
- colorComb.ModeB = GR_FUNC_MODE_ZERO;
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- break;
- case GL_ADD:
- /* Arg0 + Arg1 = (A + B) * 1 + 0 */
- TEXENV_SETUP_ARG_RGB(colorComb.SourceA,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- localc, locala);
- TEXENV_SETUP_MODE_RGB(colorComb.ModeA,
- texUnit->Combine.OperandRGB[0]);
- TEXENV_SETUP_ARG_RGB(colorComb.SourceB,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- localc, locala);
- TEXENV_SETUP_MODE_RGB(colorComb.ModeB,
- texUnit->Combine.OperandRGB[1]);
- colorComb.SourceC = GR_CMBX_ZERO;
- colorComb.InvertC = FXTRUE;
- colorComb.SourceD = GR_CMBX_ZERO;
- break;
- case GL_INTERPOLATE_EXT:
- /* Arg0 * Arg2 + Arg1 * (1 - Arg2) ==
- * (Arg0 - Arg1) * Arg2 + Arg1 == (A - B) * C + D
- */
- TEXENV_SETUP_ARG_RGB(colorComb.SourceA,
- texUnit->Combine.SourceRGB[0],
- texUnit->Combine.OperandRGB[0],
- localc, locala);
- TEXENV_SETUP_MODE_RGB(colorComb.ModeA,
- texUnit->Combine.OperandRGB[0]);
- TEXENV_SETUP_ARG_RGB(colorComb.SourceB,
- texUnit->Combine.SourceRGB[1],
- texUnit->Combine.OperandRGB[1],
- localc, locala);
- if (TEXENV_OPERAND_INVERTED(texUnit->Combine.OperandRGB[1])) {
- /* Hack alert!!! This case is wrong!!! */
- fprintf(stderr, "COMBINE_EXT_color: WRONG!!!\n");
- colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- } else {
- colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X;
- }
- /*
- * The Source/Operand for the C value must
- * specify some kind of alpha value.
- */
- TEXENV_SETUP_ARG_A(colorComb.SourceC,
- texUnit->Combine.SourceRGB[2],
- texUnit->Combine.OperandRGB[2],
- locala);
- colorComb.InvertC = FXFALSE;
- colorComb.SourceD = GR_CMBX_B;
- break;
- default:
- fprintf(stderr, "COMBINE_EXT_color: %s\n",
- _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
- }
-
- switch (texUnit->Combine.ModeA) {
- case GL_MODULATE:
- /* Arg0 * Arg1 == (A + 0) * C + 0 */
- TEXENV_SETUP_ARG_A(alphaComb.SourceA,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- locala);
- TEXENV_SETUP_MODE_A(alphaComb.ModeA,
- texUnit->Combine.OperandA[0]);
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_ZERO;
- TEXENV_SETUP_ARG_A(alphaComb.SourceC,
- texUnit->Combine.SourceA[1],
- texUnit->Combine.OperandA[1],
- locala);
- alphaComb.InvertC = TEXENV_OPERAND_INVERTED(
- texUnit->Combine.OperandA[1]);
- alphaComb.SourceD = GR_CMBX_ZERO;
- break;
- case GL_REPLACE:
- /* Arg0 == (A + 0) * 1 + 0 */
- TEXENV_SETUP_ARG_A(alphaComb.SourceA,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- locala);
- TEXENV_SETUP_MODE_A(alphaComb.ModeA,
- texUnit->Combine.OperandA[0]);
- alphaComb.SourceB = GR_CMBX_ZERO;
- alphaComb.ModeB = GR_FUNC_MODE_ZERO;
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- break;
- case GL_ADD:
- /* Arg0 + Arg1 = (A + B) * 1 + 0 */
- TEXENV_SETUP_ARG_A(alphaComb.SourceA,
- texUnit->Combine.SourceA[0],
- texUnit->Combine.OperandA[0],
- locala);
- TEXENV_SETUP_MODE_A(alphaComb.ModeA,
- texUnit->Combine.OperandA[0]);
- TEXENV_SETUP_ARG_A(alphaComb.SourceB,
- texUnit->Combine.SourceA[1],
- texUnit->Combine.OperandA[1],
- locala);
- TEXENV_SETUP_MODE_A(alphaComb.ModeB,
- texUnit->Combine.OperandA[1]);
- alphaComb.SourceC = GR_CMBX_ZERO;
- alphaComb.InvertC = FXTRUE;
- alphaComb.SourceD = GR_CMBX_ZERO;
- break;
- default:
- fprintf(stderr, "COMBINE_EXT_alpha: %s\n",
- _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
- }
-
- fxMesa->Glide.grConstantColorValueExt(tmu,
- (((GLuint)(envColor[0] * 255.0f)) ) |
- (((GLuint)(envColor[1] * 255.0f)) << 8) |
- (((GLuint)(envColor[2] * 255.0f)) << 16) |
- (((GLuint)(envColor[3] * 255.0f)) << 24));
- break;
-
- default:
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureEnvNapalm_NoLock: %x Texture.EnvMode not yet supported\n",
- texUnit->EnvMode);
- }
- return;
- }
-
- /* On Napalm we simply put the color combine unit into passthrough mode
- * and do everything we need with the texture combine units. */
- fxMesa->Glide.grColorCombineExt(GR_CMBX_TEXTURE_RGB,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
- fxMesa->Glide.grAlphaCombineExt(GR_CMBX_TEXTURE_ALPHA,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
-
- fxMesa->Glide.grTexAlphaCombineExt(tmu,
- alphaComb.SourceA,
- alphaComb.ModeA,
- alphaComb.SourceB,
- alphaComb.ModeB,
- alphaComb.SourceC,
- alphaComb.InvertC,
- alphaComb.SourceD,
- alphaComb.InvertD,
- alphaComb.Shift,
- alphaComb.Invert);
- fxMesa->Glide.grTexColorCombineExt(tmu,
- colorComb.SourceA,
- colorComb.ModeA,
- colorComb.SourceB,
- colorComb.ModeB,
- colorComb.SourceC,
- colorComb.InvertC,
- colorComb.SourceD,
- colorComb.InvertD,
- colorComb.Shift,
- colorComb.Invert);
-}
-
-
-/************************* Single Texture Set ***************************/
-
-static void
-fxSelectSingleTMUSrcNapalm_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
-{
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSelectSingleTMUSrcNapalm_NoLock(%d, %d)\n", tmu, LODblend);
- }
-
- if (LODblend) {
- /* XXX todo - GR_CMBX_LOD_FRAC? */
- fxMesa->tmuSrc = FX_TMU_SPLIT;
- }
- else {
- if (tmu != FX_TMU1) {
- /* disable tex1 */
- if (fxMesa->haveTwoTMUs) {
- fxMesa->Glide.grTexAlphaCombineExt(FX_TMU1,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_ZERO,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_ZERO,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
- fxMesa->Glide.grTexColorCombineExt(FX_TMU1,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_ZERO,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_ZERO,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
- }
-
- fxMesa->tmuSrc = FX_TMU0;
- }
- else {
-#if 1
- grTexCombine(GR_TMU0,
- GR_COMBINE_FUNCTION_BLEND,
- GR_COMBINE_FACTOR_ONE,
- GR_COMBINE_FUNCTION_BLEND,
- GR_COMBINE_FACTOR_ONE,
- FXFALSE,
- FXFALSE);
-#else
- /* [dBorca] why, oh why? doesn't work! stupid Glide? */
- fxMesa->Glide.grTexAlphaCombineExt(FX_TMU0,
- GR_CMBX_OTHER_TEXTURE_ALPHA,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
- fxMesa->Glide.grTexColorCombineExt(FX_TMU0,
- GR_CMBX_OTHER_TEXTURE_RGB,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
-#endif
-
- fxMesa->tmuSrc = FX_TMU1;
- }
- }
-}
-
-static void
-fxSetupTextureSingleTMUNapalm_NoLock(GLcontext * ctx, GLuint textureset)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint unitsmode;
- tfxTexInfo *ti;
- struct gl_texture_object *tObj = ctx->Texture.Unit[textureset]._Current;
- int tmu;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureSingleTMUNapalm_NoLock(%d)\n", textureset);
- }
-
- ti = fxTMGetTexInfo(tObj);
-
- fxTexValidate(ctx, tObj);
-
- fxSetupSingleTMU_NoLock(fxMesa, tObj);
-
- if (ti->whichTMU == FX_TMU_BOTH)
- tmu = FX_TMU0;
- else
- tmu = ti->whichTMU;
- if (fxMesa->tmuSrc != tmu)
- fxSelectSingleTMUSrcNapalm_NoLock(fxMesa, tmu, ti->LODblend);
-
- if (textureset == 0 || !fxMesa->haveTwoTMUs)
- unitsmode = fxGetTexSetConfiguration(ctx, tObj, NULL);
- else
- unitsmode = fxGetTexSetConfiguration(ctx, NULL, tObj);
-
-/* if(fxMesa->lastUnitsMode==unitsmode) */
-/* return; */
-
- fxMesa->lastUnitsMode = unitsmode;
-
- fxMesa->stw_hint_state = 0;
- FX_grHints_NoLock(GR_HINT_STWHINT, 0);
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE))
- fprintf(stderr, "fxSetupTextureSingleTMUNapalm_NoLock: envmode is %s\n",
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[textureset].EnvMode));
-
- /* [dBorca] Hack alert:
- * what if we're in split mode? (LODBlend)
- * also should we update BOTH TMUs in FX_TMU_BOTH mode?
- */
- fxSetupTextureEnvNapalm_NoLock(ctx, textureset, tmu, GL_TRUE);
-}
-
-
-/************************* Double Texture Set ***************************/
-
-static void
-fxSetupTextureDoubleTMUNapalm_NoLock(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxTexInfo *ti0, *ti1;
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current;
- GLuint unitsmode;
- int tmu0 = 0, tmu1 = 1;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureDoubleTMUNapalm_NoLock(...)\n");
- }
-
- ti0 = fxTMGetTexInfo(tObj0);
- fxTexValidate(ctx, tObj0);
-
- ti1 = fxTMGetTexInfo(tObj1);
- fxTexValidate(ctx, tObj1);
-
- fxSetupDoubleTMU_NoLock(fxMesa, tObj0, tObj1);
-
- unitsmode = fxGetTexSetConfiguration(ctx, tObj0, tObj1);
-
-/* if(fxMesa->lastUnitsMode==unitsmode) */
-/* return; */
-
- fxMesa->lastUnitsMode = unitsmode;
-
- fxMesa->stw_hint_state |= GR_STWHINT_ST_DIFF_TMU1;
- FX_grHints_NoLock(GR_HINT_STWHINT, fxMesa->stw_hint_state);
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE))
- fprintf(stderr, "fxSetupTextureDoubleTMUNapalm_NoLock: envmode is %s/%s\n",
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode),
- _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode));
-
-
- if ((ti0->whichTMU == FX_TMU1) || (ti1->whichTMU == FX_TMU0)) {
- tmu0 = 1;
- tmu1 = 0;
- }
- fxMesa->tmuSrc = FX_TMU_BOTH;
-
- /* OpenGL vs Glide texture pipeline */
- fxSetupTextureEnvNapalm_NoLock(ctx, 0, 1, GL_TRUE);
- fxSetupTextureEnvNapalm_NoLock(ctx, 1, 0, GL_FALSE);
-}
-
-/************************* No Texture ***************************/
-
-static void
-fxSetupTextureNoneNapalm_NoLock(GLcontext * ctx)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxSetupTextureNoneNapalm_NoLock(...)\n");
- }
-
- /* the combiner formula is: (A + B) * C + D
- **
- ** a = tc_otherselect
- ** a_mode = tc_invert_other
- ** b = tc_localselect
- ** b_mode = tc_invert_local
- ** c = (tc_mselect, tc_mselect_7)
- ** d = (tc_add_clocal, tc_add_alocal)
- ** shift = tc_outshift
- ** invert = tc_invert_output
- */
-
- fxMesa->Glide.grColorCombineExt(GR_CMBX_ITRGB,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_ZERO,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
- fxMesa->Glide.grAlphaCombineExt(GR_CMBX_ITALPHA,
- GR_FUNC_MODE_X,
- GR_CMBX_ZERO,
- GR_FUNC_MODE_ZERO,
- GR_CMBX_ZERO,
- FXTRUE,
- GR_CMBX_ZERO,
- FXFALSE,
- 0,
- FXFALSE);
-
- fxMesa->lastUnitsMode = FX_UM_NONE;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtexman.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtexman.c
deleted file mode 100644
index 940c8fd0b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtexman.c
+++ /dev/null
@@ -1,874 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * David Bucciarelli
- * Brian Paul
- * Daryll Strauss
- * Keith Whitwell
- * Daniel Borca
- * Hiroshi Morii
- */
-
-/* fxtexman.c - 3Dfx VooDoo texture memory functions */
-
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#if defined(FX)
-
-#include "hash.h"
-#include "fxdrv.h"
-
-int texSwaps = 0;
-static FxU32 texBoundMask;
-
-#define FX_2MB_SPLIT 0x200000
-
-static struct gl_texture_object *fxTMFindOldestObject(fxMesaContext fxMesa,
- int tmu);
-
-
-#ifdef TEXSANITY
-static void
-fubar()
-{
-}
-
- /* Sanity Check */
-static void
-sanity(fxMesaContext fxMesa)
-{
- MemRange *tmp, *prev, *pos;
-
- prev = 0;
- tmp = fxMesa->tmFree[0];
- while (tmp) {
- if (!tmp->startAddr && !tmp->endAddr) {
- fprintf(stderr, "Textures fubar\n");
- fubar();
- }
- if (tmp->startAddr >= tmp->endAddr) {
- fprintf(stderr, "Node fubar\n");
- fubar();
- }
- if (prev && (prev->startAddr >= tmp->startAddr ||
- prev->endAddr > tmp->startAddr)) {
- fprintf(stderr, "Sorting fubar\n");
- fubar();
- }
- prev = tmp;
- tmp = tmp->next;
- }
- prev = 0;
- tmp = fxMesa->tmFree[1];
- while (tmp) {
- if (!tmp->startAddr && !tmp->endAddr) {
- fprintf(stderr, "Textures fubar\n");
- fubar();
- }
- if (tmp->startAddr >= tmp->endAddr) {
- fprintf(stderr, "Node fubar\n");
- fubar();
- }
- if (prev && (prev->startAddr >= tmp->startAddr ||
- prev->endAddr > tmp->startAddr)) {
- fprintf(stderr, "Sorting fubar\n");
- fubar();
- }
- prev = tmp;
- tmp = tmp->next;
- }
-}
-#endif
-
-static MemRange *
-fxTMNewRangeNode(fxMesaContext fxMesa, FxU32 start, FxU32 end)
-{
- MemRange *result = 0;
-
- if (fxMesa->tmPool) {
- result = fxMesa->tmPool;
- fxMesa->tmPool = fxMesa->tmPool->next;
- }
- else {
- if (!(result = MALLOC(sizeof(MemRange)))) {
- fprintf(stderr, "fxTMNewRangeNode: ERROR: out of memory!\n");
- fxCloseHardware();
- exit(-1);
- }
- }
- result->startAddr = start;
- result->endAddr = end;
- return result;
-}
-
-#if 1
-#define fxTMDeleteRangeNode(fxMesa, range) \
- do { \
- range->next = fxMesa->tmPool; \
- fxMesa->tmPool = range; \
- } while (0);
-#else
-static void
-fxTMDeleteRangeNode(fxMesaContext fxMesa, MemRange * range)
-{
- range->next = fxMesa->tmPool;
- fxMesa->tmPool = range;
-}
-#endif
-
-static void
-fxTMUInit(fxMesaContext fxMesa, int tmu)
-{
- MemRange *tmn, *last;
- FxU32 start, end, blockstart, blockend, chunk;
-
- start = grTexMinAddress(tmu);
- end = grTexMaxAddress(tmu);
-
- chunk = (fxMesa->type >= GR_SSTTYPE_Banshee) ? (end - start) : FX_2MB_SPLIT;
-
- if (fxMesa->verbose) {
- fprintf(stderr, "Voodoo TMU%d configuration:\n", tmu);
- }
-
- fxMesa->freeTexMem[tmu] = end - start;
- fxMesa->tmFree[tmu] = NULL;
-
- last = 0;
- blockstart = start;
- while (blockstart < end) {
- if (blockstart + chunk > end)
- blockend = end;
- else
- blockend = blockstart + chunk;
-
- if (fxMesa->verbose)
- fprintf(stderr, "Voodoo %08u-%08u\n",
- (unsigned int) blockstart, (unsigned int) blockend);
-
- tmn = fxTMNewRangeNode(fxMesa, blockstart, blockend);
- tmn->next = NULL;
-
-
- if (last)
- last->next = tmn;
- else
- fxMesa->tmFree[tmu] = tmn;
- last = tmn;
-
- blockstart += chunk;
- }
-}
-
-static int
-fxTMFindStartAddr(fxMesaContext fxMesa, GLint tmu, int size)
-{
- MemRange *prev, *tmp;
- int result;
- struct gl_texture_object *obj;
-
- if (fxMesa->HaveTexUma) {
- tmu = FX_TMU0;
- }
-
- while (1) {
- prev = 0;
- tmp = fxMesa->tmFree[tmu];
- while (tmp) {
- if (tmp->endAddr - tmp->startAddr >= size) { /* Fits here */
- result = tmp->startAddr;
- tmp->startAddr += size;
- if (tmp->startAddr == tmp->endAddr) { /* Empty */
- if (prev) {
- prev->next = tmp->next;
- }
- else {
- fxMesa->tmFree[tmu] = tmp->next;
- }
- fxTMDeleteRangeNode(fxMesa, tmp);
- }
- fxMesa->freeTexMem[tmu] -= size;
- return result;
- }
- prev = tmp;
- tmp = tmp->next;
- }
- /* No free space. Discard oldest */
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTMFindStartAddr: No free space. Discard oldest\n");
- }
- obj = fxTMFindOldestObject(fxMesa, tmu);
- if (!obj) {
- fprintf(stderr, "fxTMFindStartAddr: ERROR: No space for texture\n");
- return -1;
- }
- fxTMMoveOutTM(fxMesa, obj);
- texSwaps++;
- }
-}
-
-int fxTMCheckStartAddr (fxMesaContext fxMesa, GLint tmu, tfxTexInfo *ti)
-{
- MemRange *tmp;
- int size;
-
- if (fxMesa->HaveTexUma) {
- return FXTRUE;
- }
-
- size = grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
-
- tmp = fxMesa->tmFree[tmu];
- while (tmp) {
- if (tmp->endAddr - tmp->startAddr >= size) { /* Fits here */
- return FXTRUE;
- }
- tmp = tmp->next;
- }
-
- return FXFALSE;
-}
-
-static void
-fxTMRemoveRange(fxMesaContext fxMesa, GLint tmu, MemRange * range)
-{
- MemRange *tmp, *prev;
-
- if (fxMesa->HaveTexUma) {
- tmu = FX_TMU0;
- }
-
- if (range->startAddr == range->endAddr) {
- fxTMDeleteRangeNode(fxMesa, range);
- return;
- }
- fxMesa->freeTexMem[tmu] += range->endAddr - range->startAddr;
- prev = 0;
- tmp = fxMesa->tmFree[tmu];
- while (tmp) {
- if (range->startAddr > tmp->startAddr) {
- prev = tmp;
- tmp = tmp->next;
- }
- else
- break;
- }
- /* When we create the regions, we make a split at the 2MB boundary.
- Now we have to make sure we don't join those 2MB boundary regions
- back together again. */
- range->next = tmp;
- if (tmp) {
- if (range->endAddr == tmp->startAddr
- && tmp->startAddr & texBoundMask) {
- /* Combine */
- tmp->startAddr = range->startAddr;
- fxTMDeleteRangeNode(fxMesa, range);
- range = tmp;
- }
- }
- if (prev) {
- if (prev->endAddr == range->startAddr
- && range->startAddr & texBoundMask) {
- /* Combine */
- prev->endAddr = range->endAddr;
- prev->next = range->next;
- fxTMDeleteRangeNode(fxMesa, range);
- }
- else
- prev->next = range;
- }
- else {
- fxMesa->tmFree[tmu] = range;
- }
-}
-
-static struct gl_texture_object *
-fxTMFindOldestObject(fxMesaContext fxMesa, int tmu)
-{
- GLuint age, old, lasttime, bindnumber;
- GLfloat lowestPriority;
- struct gl_texture_object *obj, *lowestPriorityObj;
- struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects;
- GLuint id;
-
- if (!_mesa_HashFirstEntry(textures))
- return 0;
-
- obj = NULL;
- old = 0;
-
- lowestPriorityObj = NULL;
- lowestPriority = 1.0F;
-
- bindnumber = fxMesa->texBindNumber;
-
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *tmp
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tfxTexInfo *info = fxTMGetTexInfo(tmp);
-
- if (info && info->isInTM &&
- ((info->whichTMU == tmu) ||
- (info->whichTMU == FX_TMU_BOTH) ||
- (info->whichTMU == FX_TMU_SPLIT) ||
- fxMesa->HaveTexUma
- )
- ) {
- lasttime = info->lastTimeUsed;
-
- if (lasttime > bindnumber)
- age = bindnumber + (UINT_MAX - lasttime + 1); /* TO DO: check wrap around */
- else
- age = bindnumber - lasttime;
-
- if (age >= old) {
- old = age;
- obj = tmp;
- }
-
- /* examine priority */
- if (tmp->Priority < lowestPriority) {
- lowestPriority = tmp->Priority;
- lowestPriorityObj = tmp;
- }
- }
- }
-
- if (lowestPriorityObj != NULL) {
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTMFindOldestObject: %d pri=%f\n", lowestPriorityObj->Name, lowestPriority);
- }
- return lowestPriorityObj;
- }
- else {
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- if (obj != NULL) {
- fprintf(stderr, "fxTMFindOldestObject: %d age=%d\n", obj->Name, old);
- }
- }
- return obj;
- }
-}
-
-static MemRange *
-fxTMAddObj(fxMesaContext fxMesa,
- struct gl_texture_object *tObj, GLint tmu, int texmemsize)
-{
- FxI32 startAddr;
- MemRange *range;
-
- startAddr = fxTMFindStartAddr(fxMesa, tmu, texmemsize);
- if (startAddr < 0)
- return 0;
- range = fxTMNewRangeNode(fxMesa, startAddr, startAddr + texmemsize);
- return range;
-}
-
-/* External Functions */
-
-void
-fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
- GLint where)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- int i, l;
- int texmemsize;
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxTMMoveInTM_NoLock(%d)\n", tObj->Name);
- }
-
- fxMesa->stats.reqTexUpload++;
-
- if (!ti->validated) {
- fprintf(stderr, "fxTMMoveInTM_NoLock: INTERNAL ERROR: not validated\n");
- fxCloseHardware();
- exit(-1);
- }
-
- if (ti->isInTM) {
- if (ti->whichTMU == where)
- return;
- if (where == FX_TMU_SPLIT || ti->whichTMU == FX_TMU_SPLIT)
- fxTMMoveOutTM_NoLock(fxMesa, tObj);
- else {
- if (ti->whichTMU == FX_TMU_BOTH)
- return;
- where = FX_TMU_BOTH;
- }
- }
-
- if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) {
- fprintf(stderr, "fxTMMoveInTM_NoLock: downloading %p (%d) in texture memory in %d\n",
- (void *)tObj, tObj->Name, where);
- }
-
- ti->whichTMU = (FxU32) where;
-
- switch (where) {
- case FX_TMU0:
- case FX_TMU1:
- texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
- ti->tm[where] = fxTMAddObj(fxMesa, tObj, where, texmemsize);
- fxMesa->stats.memTexUpload += texmemsize;
-
- for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
- i <= FX_smallLodValue(ti->info); i++, l++) {
- struct gl_texture_image *texImage = tObj->Image[0][l];
- grTexDownloadMipMapLevel(where,
- ti->tm[where]->startAddr,
- FX_valueToLod(i),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- texImage->Data);
- }
- break;
- case FX_TMU_SPLIT:
- texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_ODD, &(ti->info));
- ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
- fxMesa->stats.memTexUpload += texmemsize;
-
- texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_EVEN, &(ti->info));
- ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
- fxMesa->stats.memTexUpload += texmemsize;
-
- for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
- i <= FX_smallLodValue(ti->info); i++, l++) {
- struct gl_texture_image *texImage = tObj->Image[0][l];
-
- grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[FX_TMU0]->startAddr,
- FX_valueToLod(i),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_ODD,
- texImage->Data);
-
- grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[FX_TMU1]->startAddr,
- FX_valueToLod(i),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_EVEN,
- texImage->Data);
- }
- break;
- case FX_TMU_BOTH:
- texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
- ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
- fxMesa->stats.memTexUpload += texmemsize;
-
- /*texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));*/
- ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
- fxMesa->stats.memTexUpload += texmemsize;
-
- for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
- i <= FX_smallLodValue(ti->info); i++, l++) {
- struct gl_texture_image *texImage = tObj->Image[0][l];
- grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[FX_TMU0]->startAddr,
- FX_valueToLod(i),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- texImage->Data);
-
- grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[FX_TMU1]->startAddr,
- FX_valueToLod(i),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH,
- texImage->Data);
- }
- break;
- default:
- fprintf(stderr, "fxTMMoveInTM_NoLock: INTERNAL ERROR: wrong tmu (%d)\n", where);
- fxCloseHardware();
- exit(-1);
- }
-
- fxMesa->stats.texUpload++;
-
- ti->isInTM = GL_TRUE;
-}
-
-
-void
-fxTMMoveInTM(fxMesaContext fxMesa, struct gl_texture_object *tObj,
- GLint where)
-{
- BEGIN_BOARD_LOCK();
- fxTMMoveInTM_NoLock(fxMesa, tObj, where);
- END_BOARD_LOCK();
-}
-
-
-void
-fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
- GLint level)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- GrLOD_t lodlevel;
- GLint tmu;
- struct gl_texture_image *texImage = tObj->Image[0][level];
- tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTMReloadMipMapLevel(%p (%d), %d)\n", (void *)tObj, tObj->Name, level);
- }
-
- assert(mml);
- assert(mml->width > 0);
- assert(mml->height > 0);
- assert(mml->glideFormat > 0);
- assert(ti->isInTM);
-
- if (!ti->validated) {
- fprintf(stderr, "fxTMReloadMipMapLevel: INTERNAL ERROR: not validated\n");
- fxCloseHardware();
- exit(-1);
- }
-
- tmu = (int) ti->whichTMU;
- fxMesa->stats.reqTexUpload++;
- fxMesa->stats.texUpload++;
-
- lodlevel = ti->info.largeLodLog2 - (level - ti->minLevel);
-
- switch (tmu) {
- case FX_TMU0:
- case FX_TMU1:
- grTexDownloadMipMapLevel(tmu,
- ti->tm[tmu]->startAddr,
- lodlevel,
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
- break;
- case FX_TMU_SPLIT:
- grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[GR_TMU0]->startAddr,
- lodlevel,
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_ODD, texImage->Data);
-
- grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[GR_TMU1]->startAddr,
- lodlevel,
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_EVEN, texImage->Data);
- break;
- case FX_TMU_BOTH:
- grTexDownloadMipMapLevel(GR_TMU0,
- ti->tm[GR_TMU0]->startAddr,
- lodlevel,
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
-
- grTexDownloadMipMapLevel(GR_TMU1,
- ti->tm[GR_TMU1]->startAddr,
- lodlevel,
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
- break;
-
- default:
- fprintf(stderr, "fxTMReloadMipMapLevel: INTERNAL ERROR: wrong tmu (%d)\n", tmu);
- fxCloseHardware();
- exit(-1);
- }
-}
-
-void
-fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
- struct gl_texture_object *tObj,
- GLint level, GLint yoffset, GLint height)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- GrLOD_t lodlevel;
- unsigned short *data;
- GLint tmu;
- struct gl_texture_image *texImage = tObj->Image[0][level];
- tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
-
- assert(mml);
-
- if (!ti->validated) {
- fprintf(stderr, "fxTMReloadSubMipMapLevel: INTERNAL ERROR: not validated\n");
- fxCloseHardware();
- exit(-1);
- }
-
- tmu = (int) ti->whichTMU;
- fxTMMoveInTM(fxMesa, tObj, tmu);
-
- fxTexGetInfo(mml->width, mml->height,
- &lodlevel, NULL, NULL, NULL, NULL, NULL);
-
- if ((ti->info.format == GR_TEXFMT_INTENSITY_8) ||
- (ti->info.format == GR_TEXFMT_P_8) ||
- (ti->info.format == GR_TEXFMT_ALPHA_8))
- data = (GLushort *) texImage->Data + ((yoffset * mml->width) >> 1);
- else
- data = (GLushort *) texImage->Data + yoffset * mml->width;
-
- switch (tmu) {
- case FX_TMU0:
- case FX_TMU1:
- grTexDownloadMipMapLevelPartial(tmu,
- ti->tm[tmu]->startAddr,
- FX_valueToLod(FX_lodToValue(lodlevel)
- + level),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH, data,
- yoffset, yoffset + height - 1);
- break;
- case FX_TMU_SPLIT:
- grTexDownloadMipMapLevelPartial(GR_TMU0,
- ti->tm[FX_TMU0]->startAddr,
- FX_valueToLod(FX_lodToValue(lodlevel)
- + level),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_ODD, data,
- yoffset, yoffset + height - 1);
-
- grTexDownloadMipMapLevelPartial(GR_TMU1,
- ti->tm[FX_TMU1]->startAddr,
- FX_valueToLod(FX_lodToValue(lodlevel)
- + level),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_EVEN, data,
- yoffset, yoffset + height - 1);
- break;
- case FX_TMU_BOTH:
- grTexDownloadMipMapLevelPartial(GR_TMU0,
- ti->tm[FX_TMU0]->startAddr,
- FX_valueToLod(FX_lodToValue(lodlevel)
- + level),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH, data,
- yoffset, yoffset + height - 1);
-
- grTexDownloadMipMapLevelPartial(GR_TMU1,
- ti->tm[FX_TMU1]->startAddr,
- FX_valueToLod(FX_lodToValue(lodlevel)
- + level),
- FX_largeLodLog2(ti->info),
- FX_aspectRatioLog2(ti->info),
- ti->info.format,
- GR_MIPMAPLEVELMASK_BOTH, data,
- yoffset, yoffset + height - 1);
- break;
- default:
- fprintf(stderr, "fxTMReloadSubMipMapLevel: INTERNAL ERROR: wrong tmu (%d)\n", tmu);
- fxCloseHardware();
- exit(-1);
- }
-}
-
-void
-fxTMMoveOutTM(fxMesaContext fxMesa, struct gl_texture_object *tObj)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
-
- if (TDFX_DEBUG & VERBOSE_DRIVER) {
- fprintf(stderr, "fxTMMoveOutTM(%p (%d))\n", (void *)tObj, tObj->Name);
- }
-
- if (!ti->isInTM)
- return;
-
- switch (ti->whichTMU) {
- case FX_TMU0:
- case FX_TMU1:
- fxTMRemoveRange(fxMesa, (int) ti->whichTMU, ti->tm[ti->whichTMU]);
- break;
- case FX_TMU_SPLIT:
- case FX_TMU_BOTH:
- fxTMRemoveRange(fxMesa, FX_TMU0, ti->tm[FX_TMU0]);
- fxTMRemoveRange(fxMesa, FX_TMU1, ti->tm[FX_TMU1]);
- break;
- default:
- fprintf(stderr, "fxTMMoveOutTM: INTERNAL ERROR: bad TMU (%ld)\n", ti->whichTMU);
- fxCloseHardware();
- exit(-1);
- }
-
- ti->isInTM = GL_FALSE;
- ti->whichTMU = FX_TMU_NONE;
-}
-
-void
-fxTMFreeTexture(fxMesaContext fxMesa, struct gl_texture_object *tObj)
-{
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- int i;
-
- if (TDFX_DEBUG & VERBOSE_TEXTURE) {
- fprintf(stderr, "fxTMFreeTexture(%p (%d))\n", (void *)tObj, tObj->Name);
- }
-
- fxTMMoveOutTM(fxMesa, tObj);
-
- for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
- struct gl_texture_image *texImage = tObj->Image[0][i];
- if (texImage) {
- if (texImage->DriverData) {
- FREE(texImage->DriverData);
- texImage->DriverData = NULL;
- }
- }
- }
- switch (ti->whichTMU) {
- case FX_TMU0:
- case FX_TMU1:
- fxTMDeleteRangeNode(fxMesa, ti->tm[ti->whichTMU]);
- break;
- case FX_TMU_SPLIT:
- case FX_TMU_BOTH:
- fxTMDeleteRangeNode(fxMesa, ti->tm[FX_TMU0]);
- fxTMDeleteRangeNode(fxMesa, ti->tm[FX_TMU1]);
- break;
- }
-}
-
-void
-fxTMInit(fxMesaContext fxMesa)
-{
- fxMesa->texBindNumber = 0;
- fxMesa->tmPool = 0;
-
- if (fxMesa->HaveTexUma) {
- grEnable(GR_TEXTURE_UMA_EXT);
- }
-
- fxTMUInit(fxMesa, FX_TMU0);
-
- if (!fxMesa->HaveTexUma && fxMesa->haveTwoTMUs)
- fxTMUInit(fxMesa, FX_TMU1);
-
- texBoundMask = (fxMesa->type >= GR_SSTTYPE_Banshee) ? -1 : (FX_2MB_SPLIT - 1);
-}
-
-void
-fxTMClose(fxMesaContext fxMesa)
-{
- MemRange *tmp, *next;
-
- tmp = fxMesa->tmPool;
- while (tmp) {
- next = tmp->next;
- FREE(tmp);
- tmp = next;
- }
- tmp = fxMesa->tmFree[FX_TMU0];
- while (tmp) {
- next = tmp->next;
- FREE(tmp);
- tmp = next;
- }
- if (fxMesa->haveTwoTMUs) {
- tmp = fxMesa->tmFree[FX_TMU1];
- while (tmp) {
- next = tmp->next;
- FREE(tmp);
- tmp = next;
- }
- }
-}
-
-void
-fxTMRestoreTextures_NoLock(fxMesaContext ctx)
-{
- struct _mesa_HashTable *textures = ctx->glCtx->Shared->TexObjects;
- GLuint id;
-
- for (id = _mesa_HashFirstEntry(textures);
- id;
- id = _mesa_HashNextEntry(textures, id)) {
- struct gl_texture_object *tObj
- = (struct gl_texture_object *) _mesa_HashLookup(textures, id);
- tfxTexInfo *ti = fxTMGetTexInfo(tObj);
- if (ti && ti->isInTM) {
- int i;
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- if (ctx->glCtx->Texture.Unit[i]._Current == tObj) {
- /* Force the texture onto the board, as it could be in use */
- int where = ti->whichTMU;
- fxTMMoveOutTM_NoLock(ctx, tObj);
- fxTMMoveInTM_NoLock(ctx, tObj, where);
- break;
- }
- }
- if (i == MAX_TEXTURE_UNITS) /* Mark the texture as off the board */
- fxTMMoveOutTM_NoLock(ctx, tObj);
- }
- }
-}
-
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_texman(void);
-int
-gl_fx_dummy_function_texman(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtris.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtris.c
deleted file mode 100644
index 180637565..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxtris.c
+++ /dev/null
@@ -1,1834 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.0
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Daniel Borca <dborca@users.sourceforge.net>
- */
-
-#include "glheader.h"
-
-#ifdef FX
-
-#include "imports.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-#include "nvfragprog.h"
-
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-#include "fxdrv.h"
-
-
-static GLboolean fxMultipass_ColorSum (GLcontext *ctx, GLuint pass);
-
-
-/*
- * Subpixel offsets to adjust Mesa's (true) window coordinates to
- * Glide coordinates. We need these to ensure precise rasterization.
- * Otherwise, we'll fail a bunch of conformance tests.
- */
-#define TRI_X_OFFSET ( 0.0F)
-#define TRI_Y_OFFSET ( 0.0F)
-#define LINE_X_OFFSET ( 0.0F)
-#define LINE_Y_OFFSET ( 0.125F)
-#define PNT_X_OFFSET ( 0.375F)
-#define PNT_Y_OFFSET ( 0.375F)
-
-static void fxRasterPrimitive( GLcontext *ctx, GLenum prim );
-static void fxRenderPrimitive( GLcontext *ctx, GLenum prim );
-
-static GLenum reduced_prim[GL_POLYGON+1] = {
- GL_POINTS,
- GL_LINES,
- GL_LINES,
- GL_LINES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES,
- GL_TRIANGLES
-};
-
-/***********************************************************************
- * Macros for t_dd_tritmp.h to draw basic primitives *
- ***********************************************************************/
-
-#define TRI( a, b, c ) \
-do { \
- if (DO_FALLBACK) \
- fxMesa->draw_tri( fxMesa, a, b, c ); \
- else \
- grDrawTriangle( a, b, c ); \
-} while (0) \
-
-#define QUAD( a, b, c, d ) \
-do { \
- if (DO_FALLBACK) { \
- fxMesa->draw_tri( fxMesa, a, b, d ); \
- fxMesa->draw_tri( fxMesa, b, c, d ); \
- } else { \
- GrVertex *_v_[4]; \
- _v_[0] = d; \
- _v_[1] = a; \
- _v_[2] = b; \
- _v_[3] = c; \
- grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);\
- /*grDrawTriangle( a, b, d );*/ \
- /*grDrawTriangle( b, c, d );*/ \
- } \
-} while (0)
-
-#define LINE( v0, v1 ) \
-do { \
- if (DO_FALLBACK) \
- fxMesa->draw_line( fxMesa, v0, v1 ); \
- else { \
- v0->x += LINE_X_OFFSET - TRI_X_OFFSET; \
- v0->y += LINE_Y_OFFSET - TRI_Y_OFFSET; \
- v1->x += LINE_X_OFFSET - TRI_X_OFFSET; \
- v1->y += LINE_Y_OFFSET - TRI_Y_OFFSET; \
- grDrawLine( v0, v1 ); \
- v0->x -= LINE_X_OFFSET - TRI_X_OFFSET; \
- v0->y -= LINE_Y_OFFSET - TRI_Y_OFFSET; \
- v1->x -= LINE_X_OFFSET - TRI_X_OFFSET; \
- v1->y -= LINE_Y_OFFSET - TRI_Y_OFFSET; \
- } \
-} while (0)
-
-#define POINT( v0 ) \
-do { \
- if (DO_FALLBACK) \
- fxMesa->draw_point( fxMesa, v0 ); \
- else { \
- v0->x += PNT_X_OFFSET - TRI_X_OFFSET; \
- v0->y += PNT_Y_OFFSET - TRI_Y_OFFSET; \
- grDrawPoint( v0 ); \
- v0->x -= PNT_X_OFFSET - TRI_X_OFFSET; \
- v0->y -= PNT_Y_OFFSET - TRI_Y_OFFSET; \
- } \
-} while (0)
-
-
-/***********************************************************************
- * Fallback to swrast for basic primitives *
- ***********************************************************************/
-
-/* Build an SWvertex from a hardware vertex.
- *
- * This code is hit only when a mix of accelerated and unaccelerated
- * primitives are being drawn, and only for the unaccelerated
- * primitives.
- */
-static void
-fx_translate_vertex( GLcontext *ctx, const GrVertex *src, SWvertex *dst)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint ts0 = fxMesa->tmu_source[0];
- GLuint ts1 = fxMesa->tmu_source[1];
- GLfloat w = 1.0F / src->oow;
-
- dst->win[0] = src->x;
- dst->win[1] = src->y;
- dst->win[2] = src->ooz;
- dst->win[3] = src->oow;
-
-#if FX_PACKEDCOLOR
- dst->color[0] = src->pargb[2];
- dst->color[1] = src->pargb[1];
- dst->color[2] = src->pargb[0];
- dst->color[3] = src->pargb[3];
-
- dst->specular[0] = src->pspec[2];
- dst->specular[1] = src->pspec[1];
- dst->specular[2] = src->pspec[0];
-#else /* !FX_PACKEDCOLOR */
- dst->color[0] = src->r;
- dst->color[1] = src->g;
- dst->color[2] = src->b;
- dst->color[3] = src->a;
-
- dst->specular[0] = src->r1;
- dst->specular[1] = src->g1;
- dst->specular[2] = src->g1;
-#endif /* !FX_PACKEDCOLOR */
-
- dst->texcoord[ts0][0] = fxMesa->inv_s0scale * src->tmuvtx[0].sow * w;
- dst->texcoord[ts0][1] = fxMesa->inv_t0scale * src->tmuvtx[0].tow * w;
-
- if (fxMesa->stw_hint_state & GR_STWHINT_W_DIFF_TMU0)
- dst->texcoord[ts0][3] = src->tmuvtx[0].oow * w;
- else
- dst->texcoord[ts0][3] = 1.0F;
-
- if (fxMesa->SetupIndex & SETUP_TMU1) {
- dst->texcoord[ts1][0] = fxMesa->inv_s1scale * src->tmuvtx[1].sow * w;
- dst->texcoord[ts1][1] = fxMesa->inv_t1scale * src->tmuvtx[1].tow * w;
-
- if (fxMesa->stw_hint_state & GR_STWHINT_W_DIFF_TMU1)
- dst->texcoord[ts1][3] = src->tmuvtx[1].oow * w;
- else
- dst->texcoord[ts1][3] = 1.0F;
- }
-
- dst->pointSize = src->psize;
-}
-
-
-static void
-fx_fallback_tri( fxMesaContext fxMesa,
- GrVertex *v0,
- GrVertex *v1,
- GrVertex *v2 )
-{
- GLcontext *ctx = fxMesa->glCtx;
- SWvertex v[3];
-
- fx_translate_vertex( ctx, v0, &v[0] );
- fx_translate_vertex( ctx, v1, &v[1] );
- fx_translate_vertex( ctx, v2, &v[2] );
- _swrast_Triangle( ctx, &v[0], &v[1], &v[2] );
-}
-
-
-static void
-fx_fallback_line( fxMesaContext fxMesa,
- GrVertex *v0,
- GrVertex *v1 )
-{
- GLcontext *ctx = fxMesa->glCtx;
- SWvertex v[2];
- fx_translate_vertex( ctx, v0, &v[0] );
- fx_translate_vertex( ctx, v1, &v[1] );
- _swrast_Line( ctx, &v[0], &v[1] );
-}
-
-
-static void
-fx_fallback_point( fxMesaContext fxMesa,
- GrVertex *v0 )
-{
- GLcontext *ctx = fxMesa->glCtx;
- SWvertex v[1];
- fx_translate_vertex( ctx, v0, &v[0] );
- _swrast_Point( ctx, &v[0] );
-}
-
-/***********************************************************************
- * Functions to draw basic primitives *
- ***********************************************************************/
-
-static void fx_print_vertex( GLcontext *ctx, const GrVertex *v )
-{
- fprintf(stderr, "fx_print_vertex:\n");
-
- fprintf(stderr, "\tvertex at %p\n", (void *) v);
-
- fprintf(stderr, "\tx %f y %f z %f oow %f\n", v->x, v->y, v->ooz, v->oow);
-#if FX_PACKEDCOLOR
- fprintf(stderr, "\tr %d g %d b %d a %d\n", v->pargb[2], v->pargb[1], v->pargb[0], v->pargb[3]);
-#else /* !FX_PACKEDCOLOR */
- fprintf(stderr, "\tr %f g %f b %f a %f\n", v->r, v->g, v->b, v->a);
-#endif /* !FX_PACKEDCOLOR */
-
- fprintf(stderr, "\n");
-}
-
-#define DO_FALLBACK 0
-
-/* Need to do clip loop at each triangle when mixing swrast and hw
- * rendering. These functions are only used when mixed-mode rendering
- * is occurring.
- */
-static void fx_draw_triangle( fxMesaContext fxMesa,
- GrVertex *v0,
- GrVertex *v1,
- GrVertex *v2 )
-{
- BEGIN_CLIP_LOOP();
- TRI( v0, v1, v2 );
- END_CLIP_LOOP();
-}
-
-static void fx_draw_line( fxMesaContext fxMesa,
- GrVertex *v0,
- GrVertex *v1 )
-{
- /* No support for wide lines (avoid wide/aa line fallback).
- */
- BEGIN_CLIP_LOOP();
- LINE(v0, v1);
- END_CLIP_LOOP();
-}
-
-static void fx_draw_point( fxMesaContext fxMesa,
- GrVertex *v0 )
-{
- /* No support for wide points.
- */
- BEGIN_CLIP_LOOP();
- POINT( v0 );
- END_CLIP_LOOP();
-}
-
-#ifndef M_2PI
-#define M_2PI 6.28318530717958647692528676655901
-#endif
-#define __GL_COSF cos
-#define __GL_SINF sin
-static void fx_draw_point_sprite ( fxMesaContext fxMesa,
- GrVertex *v0, GLfloat psize )
-{
- const GLcontext *ctx = fxMesa->glCtx;
-
- GLfloat radius;
- GrVertex _v_[4];
- GLuint ts0 = fxMesa->tmu_source[0];
- GLuint ts1 = fxMesa->tmu_source[1];
- GLfloat w = v0->oow;
- GLfloat u0scale = fxMesa->s0scale * w;
- GLfloat v0scale = fxMesa->t0scale * w;
- GLfloat u1scale = fxMesa->s1scale * w;
- GLfloat v1scale = fxMesa->t1scale * w;
-
- radius = psize / 2.0F;
- _v_[0] = *v0;
- _v_[1] = *v0;
- _v_[2] = *v0;
- _v_[3] = *v0;
- /* CLIP_LOOP ?!? */
- /* point coverage? */
- /* we don't care about culling here (see fxSetupCull) */
-
- if (ctx->Point.SpriteOrigin == GL_UPPER_LEFT) {
- _v_[0].x -= radius;
- _v_[0].y += radius;
- _v_[1].x += radius;
- _v_[1].y += radius;
- _v_[2].x += radius;
- _v_[2].y -= radius;
- _v_[3].x -= radius;
- _v_[3].y -= radius;
- } else {
- _v_[0].x -= radius;
- _v_[0].y -= radius;
- _v_[1].x += radius;
- _v_[1].y -= radius;
- _v_[2].x += radius;
- _v_[2].y += radius;
- _v_[3].x -= radius;
- _v_[3].y += radius;
- }
-
- if (ctx->Point.CoordReplace[ts0]) {
- _v_[0].tmuvtx[0].sow = 0;
- _v_[0].tmuvtx[0].tow = 0;
- _v_[1].tmuvtx[0].sow = u0scale;
- _v_[1].tmuvtx[0].tow = 0;
- _v_[2].tmuvtx[0].sow = u0scale;
- _v_[2].tmuvtx[0].tow = v0scale;
- _v_[3].tmuvtx[0].sow = 0;
- _v_[3].tmuvtx[0].tow = v0scale;
- }
- if (ctx->Point.CoordReplace[ts1]) {
- _v_[0].tmuvtx[1].sow = 0;
- _v_[0].tmuvtx[1].tow = 0;
- _v_[1].tmuvtx[1].sow = u1scale;
- _v_[1].tmuvtx[1].tow = 0;
- _v_[2].tmuvtx[1].sow = u1scale;
- _v_[2].tmuvtx[1].tow = v1scale;
- _v_[3].tmuvtx[1].sow = 0;
- _v_[3].tmuvtx[1].tow = v1scale;
- }
-
- grDrawVertexArrayContiguous(GR_TRIANGLE_FAN, 4, _v_, sizeof(GrVertex));
-}
-
-static void fx_draw_point_wide ( fxMesaContext fxMesa,
- GrVertex *v0 )
-{
- GLint i, n;
- GLfloat ang, radius, oon;
- GrVertex vtxB, vtxC;
- GrVertex *_v_[3];
-
- const GLcontext *ctx = fxMesa->glCtx;
- const GLfloat psize = (ctx->_TriangleCaps & DD_POINT_ATTEN)
- ? CLAMP(v0->psize, ctx->Point.MinSize, ctx->Point.MaxSize)
- : ctx->Point._Size; /* clamped */
-
- if (ctx->Point.PointSprite) {
- fx_draw_point_sprite(fxMesa, v0, psize);
- return;
- }
-
- _v_[0] = v0;
- _v_[1] = &vtxB;
- _v_[2] = &vtxC;
-
- radius = psize / 2.0F;
- n = IROUND(psize * 2); /* radius x 4 */
- if (n < 4) n = 4;
- oon = 1.0F / (GLfloat)n;
-
- /* CLIP_LOOP ?!? */
- /* point coverage? */
- /* we don't care about culling here (see fxSetupCull) */
-
- vtxB = *v0;
- vtxC = *v0;
-
- vtxB.x += radius;
- ang = M_2PI * oon;
- vtxC.x += radius * __GL_COSF(ang);
- vtxC.y += radius * __GL_SINF(ang);
- grDrawVertexArray(GR_TRIANGLE_FAN, 3, _v_);
- for (i = 2; i <= n; i++) {
- ang = M_2PI * i * oon;
- vtxC.x = v0->x + radius * __GL_COSF(ang);
- vtxC.y = v0->y + radius * __GL_SINF(ang);
- grDrawVertexArray(GR_TRIANGLE_FAN_CONTINUE, 1, &_v_[2]);
- }
-}
-
-static void fx_render_pw_verts( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- fxRenderPrimitive( ctx, GL_POINTS );
-
- for ( ; start < count ; start++)
- fx_draw_point_wide(fxMesa, fxVB + start);
-}
-
-static void fx_render_pw_elts ( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
- (void) flags;
-
- fxRenderPrimitive( ctx, GL_POINTS );
-
- for ( ; start < count ; start++)
- fx_draw_point_wide(fxMesa, fxVB + elt[start]);
-}
-
-static void fx_draw_point_wide_aa ( fxMesaContext fxMesa,
- GrVertex *v0 )
-{
- GLint i, n;
- GLfloat ang, radius, oon;
- GrVertex vtxB, vtxC;
-
- const GLcontext *ctx = fxMesa->glCtx;
- const GLfloat psize = (ctx->_TriangleCaps & DD_POINT_ATTEN)
- ? CLAMP(v0->psize, ctx->Point.MinSize, ctx->Point.MaxSize)
- : ctx->Point._Size; /* clamped */
-
- if (ctx->Point.PointSprite) {
- fx_draw_point_sprite(fxMesa, v0, psize);
- return;
- }
-
- radius = psize / 2.0F;
- n = IROUND(psize * 2); /* radius x 4 */
- if (n < 4) n = 4;
- oon = 1.0F / (GLfloat)n;
-
- /* CLIP_LOOP ?!? */
- /* point coverage? */
- /* we don't care about culling here (see fxSetupCull) */
-
- vtxB = *v0;
- vtxC = *v0;
-
- vtxB.x += radius;
- for (i = 1; i <= n; i++) {
- ang = M_2PI * i * oon;
- vtxC.x = v0->x + radius * __GL_COSF(ang);
- vtxC.y = v0->y + radius * __GL_SINF(ang);
- grAADrawTriangle( v0, &vtxB, &vtxC, FXFALSE, FXTRUE, FXFALSE);
- /*grDrawTriangle( v0, &vtxB, &vtxC);*/
- vtxB.x = vtxC.x;
- vtxB.y = vtxC.y;
- }
-}
-#undef __GLCOSF
-#undef __GLSINF
-#undef M_2PI
-
-#undef DO_FALLBACK
-
-
-#define FX_UNFILLED_BIT 0x1
-#define FX_OFFSET_BIT 0x2
-#define FX_TWOSIDE_BIT 0x4
-#define FX_FLAT_BIT 0x8
-#define FX_TWOSTENCIL_BIT 0x10
-#define FX_FALLBACK_BIT 0x20
-#define FX_MAX_TRIFUNC 0x40
-
-static struct {
- tnl_points_func points;
- tnl_line_func line;
- tnl_triangle_func triangle;
- tnl_quad_func quad;
-} rast_tab[FX_MAX_TRIFUNC];
-
-#define DO_FALLBACK (IND & FX_FALLBACK_BIT)
-#define DO_OFFSET (IND & FX_OFFSET_BIT)
-#define DO_UNFILLED (IND & FX_UNFILLED_BIT)
-#define DO_TWOSIDE (IND & FX_TWOSIDE_BIT)
-#define DO_FLAT (IND & FX_FLAT_BIT)
-#define DO_TWOSTENCIL (IND & FX_TWOSTENCIL_BIT)
-#define DO_TRI 1
-#define DO_QUAD 1
-#define DO_LINE 1
-#define DO_POINTS 1
-#define DO_FULL_QUAD 1
-
-#define HAVE_RGBA 1
-#define HAVE_SPEC 1
-#define HAVE_HW_FLATSHADE 0
-#define HAVE_BACK_COLORS 0
-#define VERTEX GrVertex
-#define TAB rast_tab
-
-#define DEPTH_SCALE 1.0
-#define UNFILLED_TRI unfilled_tri
-#define UNFILLED_QUAD unfilled_quad
-#define VERT_X(_v) _v->x
-#define VERT_Y(_v) _v->y
-#define VERT_Z(_v) _v->ooz
-#define AREA_IS_CCW( a ) IS_NEGATIVE( a )
-#define GET_VERTEX(e) (fxMesa->verts + e)
-
-
-#if FX_PACKEDCOLOR
-#define VERT_SET_RGBA( dst, f ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[2], f[0]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[1], f[1]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[0], f[2]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[3], f[3]);\
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) \
- *(GLuint *)&v0->pargb = *(GLuint *)&v1->pargb
-
-#define VERT_SAVE_RGBA( idx ) \
- *(GLuint *)&color[idx] = *(GLuint *)&v[idx]->pargb
-
-#define VERT_RESTORE_RGBA( idx ) \
- *(GLuint *)&v[idx]->pargb = *(GLuint *)&color[idx]
-
-
-#define VERT_SET_SPEC( dst, f ) \
-do { \
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pspec[2], f[0]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pspec[1], f[1]);\
- UNCLAMPED_FLOAT_TO_UBYTE(dst->pspec[0], f[2]);\
-} while (0)
-
-#define VERT_COPY_SPEC( v0, v1 ) \
- *(GLuint *)&v0->pspec = *(GLuint *)&v1->pspec
-
-#define VERT_SAVE_SPEC( idx ) \
- *(GLuint *)&spec[idx] = *(GLuint *)&v[idx]->pspec
-
-#define VERT_RESTORE_SPEC( idx ) \
- *(GLuint *)&v[idx]->pspec = *(GLuint *)&spec[idx]
-
-
-#define LOCAL_VARS(n) \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GLubyte color[n][4], spec[n][4]; \
- (void) color; (void) spec;
-#else /* !FX_PACKEDCOLOR */
-#define VERT_SET_RGBA( dst, f ) \
-do { \
- CNORM(dst->r, f[0]); \
- CNORM(dst->g, f[1]); \
- CNORM(dst->b, f[2]); \
- CNORM(dst->a, f[3]); \
-} while (0)
-
-#define VERT_COPY_RGBA( v0, v1 ) \
-do { \
- COPY_FLOAT(v0->r, v1->r); \
- COPY_FLOAT(v0->g, v1->g); \
- COPY_FLOAT(v0->b, v1->b); \
- COPY_FLOAT(v0->a, v1->a); \
-} while (0)
-
-#define VERT_SAVE_RGBA( idx ) \
-do { \
- COPY_FLOAT(color[idx][0], v[idx]->r); \
- COPY_FLOAT(color[idx][1], v[idx]->g); \
- COPY_FLOAT(color[idx][2], v[idx]->b); \
- COPY_FLOAT(color[idx][3], v[idx]->a); \
-} while (0)
-
-#define VERT_RESTORE_RGBA( idx ) \
-do { \
- COPY_FLOAT(v[idx]->r, color[idx][0]); \
- COPY_FLOAT(v[idx]->g, color[idx][1]); \
- COPY_FLOAT(v[idx]->b, color[idx][2]); \
- COPY_FLOAT(v[idx]->a, color[idx][3]); \
-} while (0)
-
-
-#define VERT_SET_SPEC( dst, f ) \
-do { \
- CNORM(dst->r1, f[0]); \
- CNORM(dst->g1, f[1]); \
- CNORM(dst->b1, f[2]); \
-} while (0)
-
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- COPY_FLOAT(v0->r1, v1->r1); \
- COPY_FLOAT(v0->g1, v1->g1); \
- COPY_FLOAT(v0->b1, v1->b1); \
-} while (0)
-
-#define VERT_SAVE_SPEC( idx ) \
-do { \
- COPY_FLOAT(spec[idx][0], v[idx]->r1); \
- COPY_FLOAT(spec[idx][1], v[idx]->g1); \
- COPY_FLOAT(spec[idx][2], v[idx]->b1); \
-} while (0)
-
-#define VERT_RESTORE_SPEC( idx ) \
-do { \
- COPY_FLOAT(v[idx]->r1, spec[idx][0]); \
- COPY_FLOAT(v[idx]->g1, spec[idx][1]); \
- COPY_FLOAT(v[idx]->b1, spec[idx][2]); \
-} while (0)
-
-
-#define LOCAL_VARS(n) \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GLfloat color[n][4], spec[n][4]; \
- (void) color; (void) spec;
-#endif /* !FX_PACKEDCOLOR */
-
-
-/***********************************************************************
- * Twoside stencil *
- ***********************************************************************/
-#define SETUP_STENCIL(f) if (f) fxSetupStencilFace(ctx, f)
-#define UNSET_STENCIL(f) if (f) fxSetupStencil(ctx)
-
-
-/***********************************************************************
- * Functions to draw basic unfilled primitives *
- ***********************************************************************/
-
-#define RASTERIZE(x) if (fxMesa->raster_primitive != reduced_prim[x]) \
- fxRasterPrimitive( ctx, reduced_prim[x] )
-#define RENDER_PRIMITIVE fxMesa->render_primitive
-#define IND FX_FALLBACK_BIT
-#define TAG(x) x
-#include "tnl_dd/t_dd_unfilled.h"
-#undef IND
-
-/***********************************************************************
- * Functions to draw GL primitives *
- ***********************************************************************/
-
-#define IND (0)
-#define TAG(x) x
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT)
-#define TAG(x) x##_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT)
-#define TAG(x) x##_twoside
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT)
-#define TAG(x) x##_twoside_offset
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT)
-#define TAG(x) x##_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT)
-#define TAG(x) x##_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT)
-#define TAG(x) x##_twoside_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT)
-#define TAG(x) x##_twoside_offset_unfilled
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_FALLBACK_BIT)
-#define TAG(x) x##_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT)
-#define TAG(x) x##_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT)
-#define TAG(x) x##_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT)
-#define TAG(x) x##_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \
- FX_FALLBACK_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-/* Fx doesn't support provoking-vertex flat-shading?
- */
-#define IND (FX_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_offset_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_offset_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_offset_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_offset_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \
- FX_FALLBACK_BIT|FX_FLAT_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback_flat
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-/* 2-sided stencil begin */
-#define IND (FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_unfilled_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_unfilled_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_unfilled_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_unfilled_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_unfilled_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \
- FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-
-/* Fx doesn't support provoking-vertex flat-shading?
- */
-#define IND (FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_unfilled_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_unfilled_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_unfilled_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_unfilled_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_offset_unfilled_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_unfilled_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-
-#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \
- FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT)
-#define TAG(x) x##_twoside_offset_unfilled_fallback_flat_twostencil
-#include "tnl_dd/t_dd_tritmp.h"
-/* 2-sided stencil end */
-
-
-static void init_rast_tab( void )
-{
- init();
- init_offset();
- init_twoside();
- init_twoside_offset();
- init_unfilled();
- init_offset_unfilled();
- init_twoside_unfilled();
- init_twoside_offset_unfilled();
- init_fallback();
- init_offset_fallback();
- init_twoside_fallback();
- init_twoside_offset_fallback();
- init_unfilled_fallback();
- init_offset_unfilled_fallback();
- init_twoside_unfilled_fallback();
- init_twoside_offset_unfilled_fallback();
-
- init_flat();
- init_offset_flat();
- init_twoside_flat();
- init_twoside_offset_flat();
- init_unfilled_flat();
- init_offset_unfilled_flat();
- init_twoside_unfilled_flat();
- init_twoside_offset_unfilled_flat();
- init_fallback_flat();
- init_offset_fallback_flat();
- init_twoside_fallback_flat();
- init_twoside_offset_fallback_flat();
- init_unfilled_fallback_flat();
- init_offset_unfilled_fallback_flat();
- init_twoside_unfilled_fallback_flat();
- init_twoside_offset_unfilled_fallback_flat();
-
- /* 2-sided stencil begin */
- init_twostencil();
- init_offset_twostencil();
- init_twoside_twostencil();
- init_twoside_offset_twostencil();
- init_unfilled_twostencil();
- init_offset_unfilled_twostencil();
- init_twoside_unfilled_twostencil();
- init_twoside_offset_unfilled_twostencil();
- init_fallback_twostencil();
- init_offset_fallback_twostencil();
- init_twoside_fallback_twostencil();
- init_twoside_offset_fallback_twostencil();
- init_unfilled_fallback_twostencil();
- init_offset_unfilled_fallback_twostencil();
- init_twoside_unfilled_fallback_twostencil();
- init_twoside_offset_unfilled_fallback_twostencil();
-
- init_flat_twostencil();
- init_offset_flat_twostencil();
- init_twoside_flat_twostencil();
- init_twoside_offset_flat_twostencil();
- init_unfilled_flat_twostencil();
- init_offset_unfilled_flat_twostencil();
- init_twoside_unfilled_flat_twostencil();
- init_twoside_offset_unfilled_flat_twostencil();
- init_fallback_flat_twostencil();
- init_offset_fallback_flat_twostencil();
- init_twoside_fallback_flat_twostencil();
- init_twoside_offset_fallback_flat_twostencil();
- init_unfilled_fallback_flat_twostencil();
- init_offset_unfilled_fallback_flat_twostencil();
- init_twoside_unfilled_fallback_flat_twostencil();
- init_twoside_offset_unfilled_fallback_flat_twostencil();
- /* 2-sided stencil end */
-}
-
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-
-/* Accelerate vertex buffer rendering when renderindex == 0 and
- * there is no clipping.
- */
-#define INIT(x) fxRenderPrimitive( ctx, x )
-
-static void fx_render_vb_points( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- GLint i;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_points\n");
- }
-
- INIT(GL_POINTS);
-
- /* Adjust point coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += PNT_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += PNT_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- grDrawVertexArrayContiguous( GR_POINTS, count-start,
- fxVB + start, sizeof(GrVertex));
- /* restore point coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= PNT_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= PNT_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void fx_render_vb_line_strip( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- GLint i;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_line_strip\n");
- }
-
- INIT(GL_LINE_STRIP);
-
- /* adjust line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- grDrawVertexArrayContiguous( GR_LINE_STRIP, count-start,
- fxVB + start, sizeof(GrVertex));
-
- /* restore line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void fx_render_vb_line_loop( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- GLint i;
- GLint j = start;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_line_loop\n");
- }
-
- INIT(GL_LINE_LOOP);
-
- if (!(flags & PRIM_BEGIN)) {
- j++;
- }
-
- /* adjust line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- grDrawVertexArrayContiguous( GR_LINE_STRIP, count-j,
- fxVB + j, sizeof(GrVertex));
-
- if (flags & PRIM_END)
- grDrawLine( fxVB + (count - 1),
- fxVB + start );
-
- /* restore line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void fx_render_vb_lines( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- GLint i;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_lines\n");
- }
-
- INIT(GL_LINES);
-
- /* adjust line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-
- grDrawVertexArrayContiguous( GR_LINES, count-start,
- fxVB + start, sizeof(GrVertex));
-
- /* restore line coords */
- for (i = start; i < count; i++) {
- fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET;
- fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET;
- }
-}
-
-static void fx_render_vb_triangles( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- GLuint j;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_triangles\n");
- }
-
- INIT(GL_TRIANGLES);
-
- for (j=start+2; j<count; j+=3) {
- grDrawTriangle(fxVB + (j-2), fxVB + (j-1), fxVB + j);
- }
-}
-
-
-static void fx_render_vb_tri_strip( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_tri_strip\n");
- }
-
- INIT(GL_TRIANGLE_STRIP);
-
- /* no GR_TRIANGLE_STRIP_CONTINUE?!? */
-
- grDrawVertexArrayContiguous( GR_TRIANGLE_STRIP, count-start,
- fxVB + start, sizeof(GrVertex));
-}
-
-
-static void fx_render_vb_tri_fan( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_tri_fan\n");
- }
-
- INIT(GL_TRIANGLE_FAN);
-
- grDrawVertexArrayContiguous( GR_TRIANGLE_FAN, count-start,
- fxVB + start, sizeof(GrVertex) );
-}
-
-static void fx_render_vb_quads( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- GLuint i;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_quads\n");
- }
-
- INIT(GL_QUADS);
-
- for (i = start + 3 ; i < count ; i += 4 ) {
-#define VERT(x) (fxVB + (x))
- GrVertex *_v_[4];
- _v_[0] = VERT(i);
- _v_[1] = VERT(i-3);
- _v_[2] = VERT(i-2);
- _v_[3] = VERT(i-1);
- grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);
- /*grDrawTriangle( VERT(i-3), VERT(i-2), VERT(i) );*/
- /*grDrawTriangle( VERT(i-2), VERT(i-1), VERT(i) );*/
-#undef VERT
- }
-}
-
-static void fx_render_vb_quad_strip( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_quad_strip\n");
- }
-
- INIT(GL_QUAD_STRIP);
-
- count -= (count-start)&1;
-
- grDrawVertexArrayContiguous( GR_TRIANGLE_STRIP,
- count-start, fxVB + start, sizeof(GrVertex));
-}
-
-static void fx_render_vb_poly( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GrVertex *fxVB = fxMesa->verts;
- (void) flags;
-
- if (TDFX_DEBUG & VERBOSE_VARRAY) {
- fprintf(stderr, "fx_render_vb_poly\n");
- }
-
- INIT(GL_POLYGON);
-
- grDrawVertexArrayContiguous( GR_POLYGON, count-start,
- fxVB + start, sizeof(GrVertex));
-}
-
-static void fx_render_vb_noop( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- (void) (ctx && start && count && flags);
-}
-
-static void (*fx_render_tab_verts[GL_POLYGON+2])(GLcontext *,
- GLuint,
- GLuint,
- GLuint) =
-{
- fx_render_vb_points,
- fx_render_vb_lines,
- fx_render_vb_line_loop,
- fx_render_vb_line_strip,
- fx_render_vb_triangles,
- fx_render_vb_tri_strip,
- fx_render_vb_tri_fan,
- fx_render_vb_quads,
- fx_render_vb_quad_strip,
- fx_render_vb_poly,
- fx_render_vb_noop,
-};
-#undef INIT
-
-
-/**********************************************************************/
-/* Render whole (indexed) begin/end objects */
-/**********************************************************************/
-
-
-#define VERT(x) (vertptr + x)
-
-#define RENDER_POINTS( start, count ) \
- for ( ; start < count ; start++) \
- grDrawPoint( VERT(ELT(start)) );
-
-#define RENDER_LINE( v0, v1 ) \
- grDrawLine( VERT(v0), VERT(v1) )
-
-#define RENDER_TRI( v0, v1, v2 ) \
- grDrawTriangle( VERT(v0), VERT(v1), VERT(v2) )
-
-#define RENDER_QUAD( v0, v1, v2, v3 ) \
- do { \
- GrVertex *_v_[4]; \
- _v_[0] = VERT(v3);\
- _v_[1] = VERT(v0);\
- _v_[2] = VERT(v1);\
- _v_[3] = VERT(v2);\
- grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);\
- /*grDrawTriangle( VERT(v0), VERT(v1), VERT(v3) );*/\
- /*grDrawTriangle( VERT(v1), VERT(v2), VERT(v3) );*/\
- } while (0)
-
-#define INIT(x) fxRenderPrimitive( ctx, x )
-
-#undef LOCAL_VARS
-#define LOCAL_VARS \
- fxMesaContext fxMesa = FX_CONTEXT(ctx); \
- GrVertex *vertptr = fxMesa->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
- (void) elt;
-
-#define RESET_STIPPLE
-#define RESET_OCCLUSION
-#define PRESERVE_VB_DEFS
-
-/* Elts, no clipping.
- */
-#undef ELT
-#undef TAG
-#define TAG(x) fx_##x##_elts
-#define ELT(x) elt[x]
-#include "tnl_dd/t_dd_rendertmp.h"
-
-/* Verts, no clipping.
- */
-#undef ELT
-#undef TAG
-#define TAG(x) fx_##x##_verts
-#define ELT(x) x
-/*#include "tnl_dd/t_dd_rendertmp.h"*/ /* we have fx_render_vb_* now */
-
-
-
-/**********************************************************************/
-/* Render clipped primitives */
-/**********************************************************************/
-
-
-
-static void fxRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint prim = fxMesa->render_primitive;
-
- /* Render the new vertices as an unclipped polygon.
- */
- {
- GLuint *tmp = VB->Elts;
- VB->Elts = (GLuint *)elts;
- tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n,
- PRIM_BEGIN|PRIM_END );
- VB->Elts = tmp;
- }
-
- /* Restore the render primitive
- */
- if (prim != GL_POLYGON)
- tnl->Driver.Render.PrimitiveNotify( ctx, prim );
-}
-
-
-static void fxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- int i;
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
- GrVertex *vertptr = fxMesa->verts;
- if (n == 3) {
- grDrawTriangle( VERT(elts[0]), VERT(elts[1]), VERT(elts[2]) );
- } else if (n <= 32) {
- GrVertex *newvptr[32];
- for (i = 0 ; i < n ; i++) {
- newvptr[i] = VERT(elts[i]);
- }
- grDrawVertexArray(GR_TRIANGLE_FAN, n, newvptr);
- } else {
- const GrVertex *start = VERT(elts[0]);
- for (i = 2 ; i < n ; i++) {
- grDrawTriangle( start, VERT(elts[i-1]), VERT(elts[i]) );
- }
- }
-}
-
-/**********************************************************************/
-/* Choose render functions */
-/**********************************************************************/
-
-
-#define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE)
-#define TRI_FALLBACK (DD_TRI_SMOOTH | DD_TRI_STIPPLE)
-#define ANY_FALLBACK_FLAGS (POINT_FALLBACK | LINE_FALLBACK | TRI_FALLBACK)
-#define ANY_RASTER_FLAGS (DD_FLATSHADE | DD_TRI_LIGHT_TWOSIDE | DD_TRI_OFFSET \
- | DD_TRI_UNFILLED | DD_TRI_TWOSTENCIL)
-
-
-
-void fxDDChooseRenderState(GLcontext *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint flags = ctx->_TriangleCaps;
- GLuint index = 0;
-
- if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) {
- if (flags & ANY_RASTER_FLAGS) {
- if (flags & DD_TRI_TWOSTENCIL) index |= FX_TWOSTENCIL_BIT;
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= FX_TWOSIDE_BIT;
- if (flags & DD_TRI_OFFSET) index |= FX_OFFSET_BIT;
- if (flags & DD_TRI_UNFILLED) index |= FX_UNFILLED_BIT;
- if (flags & DD_FLATSHADE) index |= FX_FLAT_BIT;
- }
-
- fxMesa->draw_point = fx_draw_point;
- fxMesa->draw_line = fx_draw_line;
- fxMesa->draw_tri = fx_draw_triangle;
-
- /* Hook in fallbacks for specific primitives. */
- if (flags & (POINT_FALLBACK|
- LINE_FALLBACK|
- TRI_FALLBACK))
- {
- if (fxMesa->verbose) {
- fprintf(stderr, "Voodoo ! fallback (%x), raster (%x)\n",
- flags & ANY_FALLBACK_FLAGS, flags & ANY_RASTER_FLAGS);
- }
-
- if (flags & POINT_FALLBACK)
- fxMesa->draw_point = fx_fallback_point;
-
- if (flags & LINE_FALLBACK)
- fxMesa->draw_line = fx_fallback_line;
-
- if (flags & TRI_FALLBACK)
- fxMesa->draw_tri = fx_fallback_tri;
-
- index |= FX_FALLBACK_BIT;
- }
- }
-
- tnl->Driver.Render.Points = rast_tab[index].points;
- tnl->Driver.Render.Line = rast_tab[index].line;
- tnl->Driver.Render.ClippedLine = rast_tab[index].line;
- tnl->Driver.Render.Triangle = rast_tab[index].triangle;
- tnl->Driver.Render.Quad = rast_tab[index].quad;
-
- if (index == 0) {
- tnl->Driver.Render.PrimTabVerts = fx_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = fx_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = fxFastRenderClippedPoly;
- } else {
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ClippedPolygon = fxRenderClippedPoly;
- }
-
- fxMesa->render_index = index;
-
- /* [dBorca] Hack alert: more a trick than a real plug-in!!! */
- if (flags & (DD_POINT_SIZE | DD_POINT_ATTEN)) {
- /* We need to set the point primitive to go through "rast_tab",
- * to make sure "POINT" calls "fxMesa->draw_point" instead of
- * "grDrawPoint". We can achieve this by using FX_FALLBACK_BIT
- * (not really a total rasterization fallback, so we don't alter
- * "fxMesa->render_index"). If we get here with DD_POINT_SMOOTH,
- * we're done, cos we've already set _tnl_render_tab_{verts|elts}
- * above. Otherwise, the T&L engine can optimize point rendering
- * by using fx_render_tab_{verts|elts} hence the extra work.
- */
- if (flags & DD_POINT_SMOOTH) {
- fxMesa->draw_point = fx_draw_point_wide_aa;
- } else {
- fxMesa->draw_point = fx_draw_point_wide;
- fx_render_tab_verts[0] = fx_render_pw_verts;
- fx_render_tab_elts[0] = fx_render_pw_elts;
- }
- tnl->Driver.Render.Points = rast_tab[index|FX_FALLBACK_BIT].points;
- } else {
- fx_render_tab_verts[0] = fx_render_vb_points;
- fx_render_tab_elts[0] = fx_render_points_elts;
- }
-}
-
-
-/**********************************************************************/
-/* Runtime render state and callbacks */
-/**********************************************************************/
-
-static void fxRunPipeline( GLcontext *ctx )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint new_gl_state = fxMesa->new_gl_state;
-
- if (TDFX_DEBUG & VERBOSE_PIPELINE) {
- fprintf(stderr, "fxRunPipeline()\n");
- }
-
-#if 0
- /* Recalculate fog table on projection matrix changes. This used to
- * be triggered by the NearFar callback.
- */
- if (new_gl_state & _NEW_PROJECTION)
- fxMesa->new_state |= FX_NEW_FOG;
-#endif
-
- if (new_gl_state & _FX_NEW_IS_IN_HARDWARE)
- fxCheckIsInHardware(ctx);
-
- if (fxMesa->new_state)
- fxSetupFXUnits(ctx);
-
- if (!fxMesa->fallback) {
- if (new_gl_state & _FX_NEW_RENDERSTATE)
- fxDDChooseRenderState(ctx);
-
- if (new_gl_state & _FX_NEW_SETUP_FUNCTION)
- fxChooseVertexState(ctx);
- }
-
- if (new_gl_state & _NEW_TEXTURE) {
- struct gl_texture_unit *t0 = &ctx->Texture.Unit[fxMesa->tmu_source[0]];
- struct gl_texture_unit *t1 = &ctx->Texture.Unit[fxMesa->tmu_source[1]];
-
- if (t0->_Current && FX_TEXTURE_DATA(t0)) {
- fxMesa->s0scale = FX_TEXTURE_DATA(t0)->sScale;
- fxMesa->t0scale = FX_TEXTURE_DATA(t0)->tScale;
- fxMesa->inv_s0scale = 1.0F / fxMesa->s0scale;
- fxMesa->inv_t0scale = 1.0F / fxMesa->t0scale;
- }
-
- if (t1->_Current && FX_TEXTURE_DATA(t1)) {
- fxMesa->s1scale = FX_TEXTURE_DATA(t1)->sScale;
- fxMesa->t1scale = FX_TEXTURE_DATA(t1)->tScale;
- fxMesa->inv_s1scale = 1.0F / fxMesa->s1scale;
- fxMesa->inv_t1scale = 1.0F / fxMesa->t1scale;
- }
- }
-
- fxMesa->new_gl_state = 0;
-
- _tnl_run_pipeline( ctx );
-}
-
-
-
-/* Always called between RenderStart and RenderFinish --> We already
- * hold the lock.
- */
-static void fxRasterPrimitive( GLcontext *ctx, GLenum prim )
-{
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
-
- fxMesa->raster_primitive = prim;
-
- fxSetupCull(ctx);
-}
-
-
-
-/* Determine the rasterized primitive when not drawing unfilled
- * polygons.
- */
-static void fxRenderPrimitive( GLcontext *ctx, GLenum prim )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint rprim = reduced_prim[prim];
-
- fxMesa->render_primitive = prim;
-
- if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
- return;
-
- if (fxMesa->raster_primitive != rprim) {
- fxRasterPrimitive( ctx, rprim );
- }
-}
-
-static void fxRenderFinish( GLcontext *ctx )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
-
- if (fxMesa->render_index & FX_FALLBACK_BIT)
- _swrast_flush( ctx );
-}
-
-
-
-/**********************************************************************/
-/* Manage total rasterization fallbacks */
-/**********************************************************************/
-
-static char *fallbackStrings[] = {
- "3D/Rect/Cube Texture map",
- "glDrawBuffer(GL_FRONT_AND_BACK)",
- "Separate specular color",
- "glEnable/Disable(GL_STENCIL_TEST)",
- "glRenderMode(selection or feedback)",
- "glLogicOp()",
- "Texture env mode",
- "Texture border",
- "glColorMask",
- "blend mode",
- "multitex"
-};
-
-
-static char *getFallbackString(GLuint bit)
-{
- int i = 0;
- while (bit > 1) {
- i++;
- bit >>= 1;
- }
- return fallbackStrings[i];
-}
-
-
-void fxCheckIsInHardware( GLcontext *ctx )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldfallback = fxMesa->fallback;
- GLuint newfallback = fxMesa->fallback = fx_check_IsInHardware( ctx );
-
- if (newfallback) {
- if (oldfallback == 0) {
- if (fxMesa->verbose) {
- fprintf(stderr, "Voodoo ! enter SW 0x%08x %s\n", newfallback, getFallbackString(newfallback));
- }
- _swsetup_Wakeup( ctx );
- }
- }
- else {
- if (oldfallback) {
- _swrast_flush( ctx );
- tnl->Driver.Render.Start = fxCheckTexSizes;
- tnl->Driver.Render.Finish = fxRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = fxBuildVertices;
- fxChooseVertexState(ctx);
- fxDDChooseRenderState(ctx);
- if (fxMesa->verbose) {
- fprintf(stderr, "Voodoo ! leave SW 0x%08x %s\n", oldfallback, getFallbackString(oldfallback));
- }
- }
- tnl->Driver.Render.Multipass = NULL;
- if (HAVE_SPEC && NEED_SECONDARY_COLOR(ctx)) {
- tnl->Driver.Render.Multipass = fxMultipass_ColorSum;
- /* obey stencil, but do not change it */
- fxMesa->multipass = GL_TRUE;
- if (fxMesa->unitsState.stencilEnabled) {
- fxMesa->new_state |= FX_NEW_STENCIL;
- }
- }
- }
-}
-
-void fxDDInitTriFuncs( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static int firsttime = 1;
-
- if (firsttime) {
- init_rast_tab();
- firsttime = 0;
- }
-
- tnl->Driver.RunPipeline = fxRunPipeline;
- tnl->Driver.Render.Start = fxCheckTexSizes;
- tnl->Driver.Render.Finish = fxRenderFinish;
- tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive;
- tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
- tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
- tnl->Driver.Render.BuildVertices = fxBuildVertices;
- tnl->Driver.Render.Multipass = NULL;
-
- (void) fx_print_vertex;
-}
-
-
-/* [dBorca] Hack alert:
- * doesn't work with blending.
- */
-static GLboolean
-fxMultipass_ColorSum (GLcontext *ctx, GLuint pass)
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- tfxUnitsState *us = &fxMesa->unitsState;
-
- static int t0 = 0;
- static int t1 = 0;
-
- switch (pass) {
- case 1: /* first pass: the TEXTURED triangles are drawn */
- /* set stencil's real values */
- fxMesa->multipass = GL_FALSE;
- if (us->stencilEnabled) {
- fxSetupStencil(ctx);
- }
- /* save per-pass data */
- fxMesa->restoreUnitsState = *us;
- /* turn off texturing */
- t0 = ctx->Texture.Unit[0]._ReallyEnabled;
- t1 = ctx->Texture.Unit[1]._ReallyEnabled;
- ctx->Texture.Unit[0]._ReallyEnabled = 0;
- ctx->Texture.Unit[1]._ReallyEnabled = 0;
- /* SUM the colors */
- fxDDBlendEquationSeparate(ctx, GL_FUNC_ADD, GL_FUNC_ADD);
- fxDDBlendFuncSeparate(ctx, GL_ONE, GL_ONE, GL_ZERO, GL_ONE);
- fxDDEnable(ctx, GL_BLEND, GL_TRUE);
- /* make sure we draw only where we want to */
- if (us->depthTestEnabled) {
- switch (us->depthTestFunc) {
- default:
- fxDDDepthFunc(ctx, GL_EQUAL);
- case GL_NEVER:
- case GL_ALWAYS:
- ;
- }
- fxDDDepthMask(ctx, GL_FALSE);
- }
- /* switch to secondary colors */
-#if FX_PACKEDCOLOR
- grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PSPEC_OFFSET << 2, GR_PARAM_ENABLE);
-#else /* !FX_PACKEDCOLOR */
- grVertexLayout(GR_PARAM_RGB, GR_VERTEX_SPEC_OFFSET << 2, GR_PARAM_ENABLE);
-#endif /* !FX_PACKEDCOLOR */
- /* don't advertise new state */
- fxMesa->new_state = 0;
- break;
- case 2: /* 2nd pass (last): the secondary color is summed over texture */
- /* restore original state */
- *us = fxMesa->restoreUnitsState;
- /* restore texturing */
- ctx->Texture.Unit[0]._ReallyEnabled = t0;
- ctx->Texture.Unit[1]._ReallyEnabled = t1;
- /* revert to primary colors */
-#if FX_PACKEDCOLOR
- grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE);
-#else /* !FX_PACKEDCOLOR */
- grVertexLayout(GR_PARAM_RGB, GR_VERTEX_RGB_OFFSET << 2, GR_PARAM_ENABLE);
-#endif /* !FX_PACKEDCOLOR */
- break;
- default:
- assert(0); /* NOTREACHED */
- }
-
- /* update HW state */
- fxSetupBlend(ctx);
- fxSetupDepthTest(ctx);
- fxSetupTexture(ctx);
-
- return (pass == 1);
-}
-
-
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_tris(void);
-int
-gl_fx_dummy_function_tris(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvb.c b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvb.c
deleted file mode 100644
index 34ada61f4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvb.c
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * KEITH WHITWELL, 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.
- */
-
-/* Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Daniel Borca <dborca@users.sourceforge.net>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#ifdef FX
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
-
-#include "math/m_translate.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-
-#include "fxdrv.h"
-
-
-static void copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
- GrVertex *dst = fxMesa->verts + edst;
- GrVertex *src = fxMesa->verts + esrc;
-
-#if FX_PACKEDCOLOR
- *(GLuint *)&dst->pargb = *(GLuint *)&src->pargb;
-#else /* !FX_PACKEDCOLOR */
- COPY_FLOAT(dst->r, src->r);
- COPY_FLOAT(dst->g, src->g);
- COPY_FLOAT(dst->b, src->b);
- COPY_FLOAT(dst->a, src->a);
-#endif /* !FX_PACKEDCOLOR */
-}
-
-static void copy_pv2( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
- GrVertex *dst = fxMesa->verts + edst;
- GrVertex *src = fxMesa->verts + esrc;
-
-#if FX_PACKEDCOLOR
- *(GLuint *)&dst->pargb = *(GLuint *)&src->pargb;
- *(GLuint *)&dst->pspec = *(GLuint *)&src->pspec;
-#else /* !FX_PACKEDCOLOR */
- COPY_FLOAT(dst->r, src->r);
- COPY_FLOAT(dst->g, src->g);
- COPY_FLOAT(dst->b, src->b);
- COPY_FLOAT(dst->a, src->a);
- COPY_FLOAT(dst->r1, src->r1);
- COPY_FLOAT(dst->g1, src->g1);
- COPY_FLOAT(dst->b1, src->b1);
-#endif /* !FX_PACKEDCOLOR */
-}
-
-static struct {
- void (*emit) (GLcontext *ctx, GLuint start, GLuint end, void *dest);
- tnl_copy_pv_func copy_pv;
- tnl_interp_func interp;
- GLboolean (*check_tex_sizes) (GLcontext *ctx);
- GLuint vertex_format;
-} setup_tab[MAX_SETUP];
-
-
-#define GET_COLOR(ptr, idx) ((ptr)->data[idx])
-
-
-static void interp_extras( GLcontext *ctx,
- GLfloat t,
- GLuint dst, GLuint out, GLuint in,
- GLboolean force_boundary )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- /* If stride is zero, ColorPtr[1] is constant across the VB, so
- * there is no point interpolating between two values as they will
- * be identical. This case is handled in t_dd_tritmp.h
- */
- if (VB->ColorPtr[1]->stride) {
- assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
- INTERP_4F( t,
- GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], out),
- GET_COLOR(VB->ColorPtr[1], in) );
- }
-
- if (VB->SecondaryColorPtr[1]) {
- INTERP_3F( t,
- GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], out),
- GET_COLOR(VB->SecondaryColorPtr[1], in) );
- }
- }
-
- if (VB->EdgeFlag) {
- VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
- }
-
- setup_tab[FX_CONTEXT(ctx)->SetupIndex].interp(ctx, t, dst, out, in,
- force_boundary);
-}
-
-static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], src) );
-
- if (VB->SecondaryColorPtr[1]) {
- COPY_3FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], src) );
- }
- }
-
- setup_tab[FX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src);
-}
-
-
-#define IND (SETUP_XYZW|SETUP_RGBA)
-#define TAG(x) x##_wg
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0)
-#define TAG(x) x##_wgt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_wgt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX)
-#define TAG(x) x##_wgpt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX)
-#define TAG(x) x##_wgpt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_PSIZ)
-#define TAG(x) x##_wga
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ)
-#define TAG(x) x##_wgt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ)
-#define TAG(x) x##_wgt0t1a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_wgpt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_wgpt0t1a
-#include "fxvbtmp.h"
-
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC)
-#define TAG(x) x##_2wg
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0)
-#define TAG(x) x##_2wgt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_2wgt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX)
-#define TAG(x) x##_2wgpt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX)
-#define TAG(x) x##_2wgpt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ)
-#define TAG(x) x##_2wga
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ)
-#define TAG(x) x##_2wgt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ)
-#define TAG(x) x##_2wgt0t1a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_2wgpt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_2wgpt0t1a
-#include "fxvbtmp.h"
-
-/* fog { */
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_FOGC)
-#define TAG(x) x##_wgf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_FOGC)
-#define TAG(x) x##_wgt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|SETUP_FOGC)
-#define TAG(x) x##_wgt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_wgpt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_wgpt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wgaf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wgt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wgt0t1af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wgpt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wgpt0t1af
-#include "fxvbtmp.h"
-
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_FOGC)
-#define TAG(x) x##_2wgf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_FOGC)
-#define TAG(x) x##_2wgt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|SETUP_FOGC)
-#define TAG(x) x##_2wgt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_2wgpt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_2wgpt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wgaf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wgt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wgt0t1af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wgpt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\
- SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wgpt0t1af
-#include "fxvbtmp.h"
-/* fog } */
-
-
-/* Snapping for voodoo-1
- */
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA)
-#define TAG(x) x##_wsg
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0)
-#define TAG(x) x##_wsgt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1)
-#define TAG(x) x##_wsgt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_PTEX)
-#define TAG(x) x##_wsgpt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX)
-#define TAG(x) x##_wsgpt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_PSIZ)
-#define TAG(x) x##_wsga
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ)
-#define TAG(x) x##_wsgt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PSIZ)
-#define TAG(x) x##_wsgt0t1a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_wsgpt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_wsgpt0t1a
-#include "fxvbtmp.h"
-
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC)
-#define TAG(x) x##_2wsg
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0)
-#define TAG(x) x##_2wsgt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1)
-#define TAG(x) x##_2wsgt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_PTEX)
-#define TAG(x) x##_2wsgpt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX)
-#define TAG(x) x##_2wsgpt0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ)
-#define TAG(x) x##_2wsga
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ)
-#define TAG(x) x##_2wsgt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PSIZ)
-#define TAG(x) x##_2wsgt0t1a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_2wsgpt0a
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ)
-#define TAG(x) x##_2wsgpt0t1a
-#include "fxvbtmp.h"
-
-/* fog { */
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_FOGC)
-#define TAG(x) x##_wsgf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|SETUP_FOGC)
-#define TAG(x) x##_wsgt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_FOGC)
-#define TAG(x) x##_wsgt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_wsgpt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_wsgpt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wsgaf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wsgt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wsgt0t1af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wsgpt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_wsgpt0t1af
-#include "fxvbtmp.h"
-
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_FOGC)
-#define TAG(x) x##_2wsgf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_FOGC)
-#define TAG(x) x##_2wsgt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_FOGC)
-#define TAG(x) x##_2wsgt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_2wsgpt0f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX|SETUP_FOGC)
-#define TAG(x) x##_2wsgpt0t1f
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wsgaf
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wsgt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wsgt0t1af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wsgpt0af
-#include "fxvbtmp.h"
-
-#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\
- SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC)
-#define TAG(x) x##_2wsgpt0t1af
-#include "fxvbtmp.h"
-/* fog } */
-
-
-/* Vertex repair (multipass rendering)
- */
-#define IND (SETUP_RGBA)
-#define TAG(x) x##_g
-#include "fxvbtmp.h"
-
-#define IND (SETUP_TMU0)
-#define TAG(x) x##_t0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_t0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_RGBA|SETUP_TMU0)
-#define TAG(x) x##_gt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_RGBA|SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_gt0t1
-#include "fxvbtmp.h"
-
-
-#define IND (SETUP_RGBA|SETUP_SPEC)
-#define TAG(x) x##_2g
-#include "fxvbtmp.h"
-
-#define IND (SETUP_TMU0|SETUP_SPEC)
-#define TAG(x) x##_2t0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_TMU0|SETUP_SPEC|SETUP_TMU1)
-#define TAG(x) x##_2t0t1
-#include "fxvbtmp.h"
-
-#define IND (SETUP_RGBA|SETUP_SPEC|SETUP_TMU0)
-#define TAG(x) x##_2gt0
-#include "fxvbtmp.h"
-
-#define IND (SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1)
-#define TAG(x) x##_2gt0t1
-#include "fxvbtmp.h"
-
-
-
-static void init_setup_tab( void )
-{
- init_wg();
- init_wgt0();
- init_wgt0t1();
- init_wgpt0();
- init_wgpt0t1();
- init_wga();
- init_wgt0a();
- init_wgt0t1a();
- init_wgpt0a();
- init_wgpt0t1a();
- init_2wg();
- init_2wgt0();
- init_2wgt0t1();
- init_2wgpt0();
- init_2wgpt0t1();
- init_2wga();
- init_2wgt0a();
- init_2wgt0t1a();
- init_2wgpt0a();
- init_2wgpt0t1a();
- init_wgf();
- init_wgt0f();
- init_wgt0t1f();
- init_wgpt0f();
- init_wgpt0t1f();
- init_wgaf();
- init_wgt0af();
- init_wgt0t1af();
- init_wgpt0af();
- init_wgpt0t1af();
- init_2wgf();
- init_2wgt0f();
- init_2wgt0t1f();
- init_2wgpt0f();
- init_2wgpt0t1f();
- init_2wgaf();
- init_2wgt0af();
- init_2wgt0t1af();
- init_2wgpt0af();
- init_2wgpt0t1af();
-
- init_wsg();
- init_wsgt0();
- init_wsgt0t1();
- init_wsgpt0();
- init_wsgpt0t1();
- init_wsga();
- init_wsgt0a();
- init_wsgt0t1a();
- init_wsgpt0a();
- init_wsgpt0t1a();
- init_2wsg();
- init_2wsgt0();
- init_2wsgt0t1();
- init_2wsgpt0();
- init_2wsgpt0t1();
- init_2wsga();
- init_2wsgt0a();
- init_2wsgt0t1a();
- init_2wsgpt0a();
- init_2wsgpt0t1a();
- init_wsgf();
- init_wsgt0f();
- init_wsgt0t1f();
- init_wsgpt0f();
- init_wsgpt0t1f();
- init_wsgaf();
- init_wsgt0af();
- init_wsgt0t1af();
- init_wsgpt0af();
- init_wsgpt0t1af();
- init_2wsgf();
- init_2wsgt0f();
- init_2wsgt0t1f();
- init_2wsgpt0f();
- init_2wsgpt0t1f();
- init_2wsgaf();
- init_2wsgt0af();
- init_2wsgt0t1af();
- init_2wsgpt0af();
- init_2wsgpt0t1af();
-
- init_g();
- init_t0();
- init_t0t1();
- init_gt0();
- init_gt0t1();
- init_2g();
- init_2t0();
- init_2t0t1();
- init_2gt0();
- init_2gt0t1();
-}
-
-
-void fxPrintSetupFlags(char *msg, GLuint flags )
-{
- fprintf(stderr, "%s(%x): %s%s%s%s%s%s%s%s\n",
- msg,
- (int)flags,
- (flags & SETUP_XYZW) ? " xyzw," : "",
- (flags & SETUP_SNAP) ? " snap," : "",
- (flags & SETUP_RGBA) ? " rgba," : "",
- (flags & SETUP_TMU0) ? " tex-0," : "",
- (flags & SETUP_TMU1) ? " tex-1," : "",
- (flags & SETUP_PSIZ) ? " psiz," : "",
- (flags & SETUP_SPEC) ? " spec," : "",
- (flags & SETUP_FOGC) ? " fog," : "");
-}
-
-
-
-void fxCheckTexSizes( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
-
- if (!setup_tab[fxMesa->SetupIndex].check_tex_sizes(ctx)) {
- GLuint ind = fxMesa->SetupIndex |= (SETUP_PTEX|SETUP_RGBA);
-
- /* Tdfx handles projective textures nicely; just have to change
- * up to the new vertex format.
- */
- if (setup_tab[ind].vertex_format != fxMesa->stw_hint_state) {
-
- fxMesa->stw_hint_state = setup_tab[ind].vertex_format;
- FX_grHints(GR_HINT_STWHINT, fxMesa->stw_hint_state);
-
- /* This is required as we have just changed the vertex
- * format, so the interp routines must also change.
- * In the unfilled and twosided cases we are using the
- * Extras ones anyway, so leave them in place.
- */
- if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- tnl->Driver.Render.Interp = setup_tab[fxMesa->SetupIndex].interp;
- }
- }
- }
-}
-
-
-void fxBuildVertices( GLcontext *ctx, GLuint start, GLuint end,
- GLuint newinputs )
-{
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
- GrVertex *v = (fxMesa->verts + start);
-
- if (!newinputs)
- return;
-
- if (newinputs & VERT_BIT_POS) {
- setup_tab[fxMesa->SetupIndex].emit( ctx, start, end, v );
- } else {
- GLuint ind = 0;
-
- if (newinputs & VERT_BIT_COLOR0)
- ind |= SETUP_RGBA;
-
- if (newinputs & VERT_BIT_COLOR1)
- ind |= SETUP_SPEC;
-
- if (newinputs & VERT_BIT_FOG)
- ind |= SETUP_FOGC;
-
- if (newinputs & VERT_BIT_TEX0)
- ind |= SETUP_TMU0;
-
- if (newinputs & VERT_BIT_TEX1)
- ind |= SETUP_TMU0|SETUP_TMU1;
-
- if (fxMesa->SetupIndex & SETUP_PTEX)
- ind = ~0;
-
- ind &= fxMesa->SetupIndex;
-
- if (ind) {
- setup_tab[ind].emit( ctx, start, end, v );
- }
- }
-}
-
-
-void fxChooseVertexState( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
- GLuint ind = SETUP_XYZW|SETUP_RGBA;
-
- if (fxMesa->snapVertices)
- ind |= SETUP_SNAP;
-
- fxMesa->tmu_source[0] = 0;
- fxMesa->tmu_source[1] = 1;
-
- if (ctx->Texture._EnabledUnits & 0x2) {
- if (ctx->Texture._EnabledUnits & 0x1) {
- ind |= SETUP_TMU1;
- }
- ind |= SETUP_TMU0;
- fxMesa->tmu_source[0] = 1;
- fxMesa->tmu_source[1] = 0;
- }
- else if (ctx->Texture._EnabledUnits & 0x1) {
- ind |= SETUP_TMU0;
- }
-
- if (ctx->_TriangleCaps & DD_POINT_ATTEN) {
- ind |= SETUP_PSIZ;
- }
-
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- ind |= SETUP_SPEC;
- }
-
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- ind |= SETUP_FOGC;
- }
-
- fxMesa->SetupIndex = ind;
-
- if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
- tnl->Driver.Render.Interp = interp_extras;
- tnl->Driver.Render.CopyPV = copy_pv_extras;
- } else {
- tnl->Driver.Render.Interp = setup_tab[ind].interp;
- tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv;
- }
-
- if (setup_tab[ind].vertex_format != fxMesa->stw_hint_state) {
- fxMesa->stw_hint_state = setup_tab[ind].vertex_format;
- FX_grHints(GR_HINT_STWHINT, fxMesa->stw_hint_state);
- }
-}
-
-
-
-void fxAllocVB( GLcontext *ctx )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- static int firsttime = 1;
- if (firsttime) {
- init_setup_tab();
- firsttime = 0;
- }
-
- fxMesa->verts = (GrVertex *)ALIGN_MALLOC(size * sizeof(GrVertex), 32);
- fxMesa->SetupIndex = SETUP_XYZW|SETUP_RGBA;
-}
-
-
-void fxFreeVB( GLcontext *ctx )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- if (fxMesa->verts) {
- ALIGN_FREE(fxMesa->verts);
- fxMesa->verts = 0;
- }
-}
-#else
-
-
-/*
- * Need this to provide at least one external definition.
- */
-
-extern int gl_fx_dummy_function_vb(void);
-int
-gl_fx_dummy_function_vb(void)
-{
- return 0;
-}
-
-#endif /* FX */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvbtmp.h b/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvbtmp.h
deleted file mode 100644
index f7970c78e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/glide/fxvbtmp.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 4.1
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Daniel Borca <dborca@users.sourceforge.net>
- */
-
-
-#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12]
-#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13]
-#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14]
-
-static void TAG(emit)( GLcontext *ctx,
- GLuint start, GLuint end,
- void *dest )
-{
- fxMesaContext fxMesa = FX_CONTEXT(ctx);
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint tmu0_source = fxMesa->tmu_source[0];
- GLuint tmu1_source = fxMesa->tmu_source[1];
- GLfloat (*tc0)[4], (*tc1)[4];
- GLfloat (*col)[4], (*spec)[4];
- GLuint tc0_stride, tc1_stride, col_stride, spec_stride;
- GLuint tc0_size, tc1_size, col_size;
- GLfloat (*proj)[4] = VB->NdcPtr->data;
- GLuint proj_stride = VB->NdcPtr->stride;
- GLfloat (*psize)[4];
- GLuint psize_stride;
- GLfloat (*fog)[4];
- GLuint fog_stride;
- GrVertex *v = (GrVertex *)dest;
- GLfloat u0scale,v0scale,u1scale,v1scale;
- const GLubyte *mask = VB->ClipMask;
- const GLfloat *const s = ctx->Viewport._WindowMap.m;
- int i;
-
- if (IND & SETUP_PSIZ) {
- psize = VB->PointSizePtr->data;
- psize_stride = VB->PointSizePtr->stride;
- }
-
- if (IND & SETUP_TMU0) {
- tc0 = VB->TexCoordPtr[tmu0_source]->data;
- tc0_stride = VB->TexCoordPtr[tmu0_source]->stride;
- u0scale = fxMesa->s0scale;
- v0scale = fxMesa->t0scale;
- if (IND & SETUP_PTEX)
- tc0_size = VB->TexCoordPtr[tmu0_source]->size;
- }
-
- if (IND & SETUP_TMU1) {
- tc1 = VB->TexCoordPtr[tmu1_source]->data;
- tc1_stride = VB->TexCoordPtr[tmu1_source]->stride;
- u1scale = fxMesa->s1scale; /* wrong if tmu1_source == 0, possible? */
- v1scale = fxMesa->t1scale;
- if (IND & SETUP_PTEX)
- tc1_size = VB->TexCoordPtr[tmu1_source]->size;
- }
-
- if (IND & SETUP_RGBA) {
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
- col_size = VB->ColorPtr[0]->size;
- }
-
- if (IND & SETUP_SPEC) {
- spec = VB->SecondaryColorPtr[0]->data;
- spec_stride = VB->SecondaryColorPtr[0]->stride;
- }
-
- if (IND & SETUP_FOGC) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
- }
-
- if (start) {
- proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride);
- if (IND & SETUP_PSIZ)
- psize = (GLfloat (*)[4])((GLubyte *)psize + start * psize_stride);
- if (IND & SETUP_TMU0)
- tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride);
- if (IND & SETUP_TMU1)
- tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride);
- if (IND & SETUP_RGBA)
- STRIDE_4F(col, start * col_stride);
- if (IND & SETUP_SPEC)
- STRIDE_4F(spec, start * spec_stride);
- if (IND & SETUP_FOGC)
- fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride);
- }
-
- for (i=start; i < end; i++, v++) {
- if (IND & SETUP_PSIZ) {
- v->psize = psize[0][0];
- psize = (GLfloat (*)[4])((GLubyte *)psize + psize_stride);
- }
-
- if (IND & SETUP_XYZW) {
- if (mask[i] == 0) {
- /* unclipped */
- VIEWPORT_X(v->x, proj[0][0]);
- VIEWPORT_Y(v->y, proj[0][1]);
- VIEWPORT_Z(v->ooz, proj[0][2]);
- v->oow = proj[0][3];
-
- if (IND & SETUP_SNAP) {
-#if defined(USE_IEEE)
- const float snapper = (3L << 18);
- v->x += snapper;
- v->x -= snapper;
- v->y += snapper;
- v->y -= snapper;
-#else
- v->x = ((int) (v->x * 16.0f)) * (1.0f / 16.0f);
- v->y = ((int) (v->y * 16.0f)) * (1.0f / 16.0f);
-#endif
- }
- } else {
- /* clipped */
- v->oow = 1.0;
- }
-
- proj = (GLfloat (*)[4])((GLubyte *)proj + proj_stride);
- }
- if (IND & SETUP_RGBA) {
-#if FX_PACKEDCOLOR
- UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[2], col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[1], col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[0], col[0][2]);
- if (col_size == 4) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[3], col[0][3]);
- } else {
- v->pargb[3] = 255;
- }
-#else /* !FX_PACKEDCOLOR */
- CNORM(v->r, col[0][0]);
- CNORM(v->g, col[0][1]);
- CNORM(v->b, col[0][2]);
- if (col_size == 4) {
- CNORM(v->a, col[0][3]);
- } else {
- v->a = 255.0f;
- }
-#endif /* !FX_PACKEDCOLOR */
- STRIDE_4F(col, col_stride);
- }
- if (IND & SETUP_SPEC) {
-#if FX_PACKEDCOLOR
- UNCLAMPED_FLOAT_TO_UBYTE(v->pspec[2], spec[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->pspec[1], spec[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->pspec[0], spec[0][2]);
-#else /* !FX_PACKEDCOLOR */
- CNORM(v->r1, spec[0][0]);
- CNORM(v->g1, spec[0][1]);
- CNORM(v->b1, spec[0][2]);
-#endif /* !FX_PACKEDCOLOR */
- STRIDE_4F(spec, spec_stride);
- }
- if (IND & SETUP_FOGC) {
- v->fog = CLAMP(fog[0][0], 0.0f, 1.0f);
- fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
- }
- if (IND & SETUP_TMU0) {
- GLfloat w = v->oow;
- v->tmuvtx[0].sow = tc0[0][0] * u0scale * w;
- v->tmuvtx[0].tow = tc0[0][1] * v0scale * w;
- if (IND & SETUP_PTEX) {
- v->tmuvtx[0].oow = w;
- if (tc0_size == 4)
- v->tmuvtx[0].oow *= tc0[0][3];
- }
- tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride);
- }
- if (IND & SETUP_TMU1) {
- GLfloat w = v->oow;
- v->tmuvtx[1].sow = tc1[0][0] * u1scale * w;
- v->tmuvtx[1].tow = tc1[0][1] * v1scale * w;
- if (IND & SETUP_PTEX) {
- v->tmuvtx[1].oow = w;
- if (tc1_size == 4)
- v->tmuvtx[1].oow *= tc1[0][3];
- }
- tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride);
- }
- }
-}
-
-#if (IND & SETUP_XYZW) && (IND & SETUP_RGBA)
-
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- if (IND & SETUP_PTEX)
- return GL_TRUE;
-
- if (IND & SETUP_TMU0) {
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (IND & SETUP_TMU1) {
- if (VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (VB->TexCoordPtr[1]->size == 4)
- return GL_FALSE;
- }
-
- if (VB->TexCoordPtr[0] && VB->TexCoordPtr[0]->size == 4)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- fxMesaContext fxMesa = FX_CONTEXT( ctx );
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- const GLfloat oow = (dstclip[3] == 0.0F) ? 1.0F : (1.0F / dstclip[3]);
- const GLfloat *const s = ctx->Viewport._WindowMap.m;
- GrVertex *fxverts = fxMesa->verts;
- GrVertex *dst = (GrVertex *) (fxverts + edst);
- const GrVertex *out = (const GrVertex *) (fxverts + eout);
- const GrVertex *in = (const GrVertex *) (fxverts + ein);
- const GLfloat wout = oow / out->oow;
- const GLfloat win = oow / in->oow;
-
- VIEWPORT_X(dst->x, dstclip[0] * oow);
- VIEWPORT_Y(dst->y, dstclip[1] * oow);
- VIEWPORT_Z(dst->ooz, dstclip[2] * oow);
- dst->oow = oow;
-
- if (IND & SETUP_SNAP) {
-#if defined(USE_IEEE)
- const float snapper = (3L << 18);
- dst->x += snapper;
- dst->x -= snapper;
- dst->y += snapper;
- dst->y -= snapper;
-#else
- dst->x = ((int) (dst->x * 16.0f)) * (1.0f / 16.0f);
- dst->y = ((int) (dst->y * 16.0f)) * (1.0f / 16.0f);
-#endif
- }
-
-
-#if FX_PACKEDCOLOR
- INTERP_UB( t, dst->pargb[0], out->pargb[0], in->pargb[0] );
- INTERP_UB( t, dst->pargb[1], out->pargb[1], in->pargb[1] );
- INTERP_UB( t, dst->pargb[2], out->pargb[2], in->pargb[2] );
- INTERP_UB( t, dst->pargb[3], out->pargb[3], in->pargb[3] );
-#else /* !FX_PACKEDCOLOR */
- INTERP_F( t, dst->r, out->r, in->r );
- INTERP_F( t, dst->g, out->g, in->g );
- INTERP_F( t, dst->b, out->b, in->b );
- INTERP_F( t, dst->a, out->a, in->a );
-#endif /* !FX_PACKEDCOLOR */
-
- if (IND & SETUP_SPEC) {
-#if FX_PACKEDCOLOR
- INTERP_UB( t, dst->pspec[0], out->pspec[0], in->pspec[0] );
- INTERP_UB( t, dst->pspec[1], out->pspec[1], in->pspec[1] );
- INTERP_UB( t, dst->pspec[2], out->pspec[2], in->pspec[2] );
-#else /* !FX_PACKEDCOLOR */
- INTERP_F( t, dst->r1, out->r1, in->r1 );
- INTERP_F( t, dst->g1, out->g1, in->g1 );
- INTERP_F( t, dst->b1, out->b1, in->b1 );
-#endif /* !FX_PACKEDCOLOR */
- }
-
- if (IND & SETUP_FOGC) {
- INTERP_F( t, dst->fog, out->fog, in->fog );
- }
-
- if (IND & SETUP_TMU0) {
- INTERP_F( t,
- dst->tmuvtx[0].sow,
- out->tmuvtx[0].sow * wout,
- in->tmuvtx[0].sow * win );
- INTERP_F( t,
- dst->tmuvtx[0].tow,
- out->tmuvtx[0].tow * wout,
- in->tmuvtx[0].tow * win );
- if (IND & SETUP_PTEX) {
- INTERP_F( t,
- dst->tmuvtx[0].oow,
- out->tmuvtx[0].oow * wout,
- in->tmuvtx[0].oow * win );
- }
- }
-
- if (IND & SETUP_TMU1) {
- INTERP_F( t,
- dst->tmuvtx[1].sow,
- out->tmuvtx[1].sow * wout,
- in->tmuvtx[1].sow * win );
- INTERP_F( t,
- dst->tmuvtx[1].tow,
- out->tmuvtx[1].tow * wout,
- in->tmuvtx[1].tow * win );
- if (IND & SETUP_PTEX) {
- INTERP_F( t,
- dst->tmuvtx[1].oow,
- out->tmuvtx[1].oow * wout,
- in->tmuvtx[1].oow * win );
- }
- }
-}
-#endif
-
-
-static void TAG(init)( void )
-{
- setup_tab[IND].emit = TAG(emit);
-
- if (IND & SETUP_SPEC) {
- setup_tab[IND].copy_pv = copy_pv2;
- } else {
- setup_tab[IND].copy_pv = copy_pv;
- }
-
-#if ((IND & SETUP_XYZW) && (IND & SETUP_RGBA))
- setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes);
- setup_tab[IND].interp = TAG(interp);
-
- setup_tab[IND].vertex_format = 0;
- if (IND & SETUP_PTEX) {
- setup_tab[IND].vertex_format |= GR_STWHINT_W_DIFF_TMU0;
- }
-
-#if (IND & SETUP_TMU1)
- setup_tab[IND].vertex_format |= GR_STWHINT_ST_DIFF_TMU1;
- if (IND & SETUP_PTEX) {
- setup_tab[IND].vertex_format |= GR_STWHINT_W_DIFF_TMU1;
- }
-#endif
-
-#endif
-}
-
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/Makefile.win b/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/Makefile.win
deleted file mode 100644
index 36d520e65..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/Makefile.win
+++ /dev/null
@@ -1,39 +0,0 @@
-# Makefile for Win32
-
-!include <win32.mak>
-
-TOP = ..\..
-
-OSMESA_SRCS = osmesa.c
-OSMESA_OBJS = osmesa.obj
-
-ASM_SRCS =
-CORE_SRCS =
-DRIVER_SRCS = $(OSMESA_SRCS)
-
-SRCS = $(OSMESA_SRCS)
-
-all : osmesadll
-
-!include "$(TOP)/mesawin32.mak"
-
-osmesadll: $(OSMESADLL)
-
-CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -I$(TOP)/src
-LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS)
-
-OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj)
-LIBS = $(guilibsdll) $(TOP)/lib/$(MESALIB)
-
-$(OSMESADLL) : $(OBJS) osmesa.def
- $(link) $(LFLAGS) -def:osmesa.def -out:$(OSMESADLL) $(OBJS) $(LIBS)
- @echo "copying OSMesa library to library directory..."
- -copy $(OSMESALIB) $(TOP)\lib
- @echo "copying OSMesa dll to library directory..."
- -copy $(OSMESADLL) $(TOP)\lib
-
-install : $(OSMESADLL)
- @echo "copying OSMesa library to system library directory..."
- -copy $(OSMESALIB) $(LIBINSTALL)
- @echo "copying OSMesa dll to system library directory..."
- -copy $(OSMESADLL) $(DLLINSTALL)
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/descrip.mms b/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/descrip.mms
deleted file mode 100644
index 64dc041f9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/descrip.mms
+++ /dev/null
@@ -1,41 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [----.include.gl]
- define math [--.math]
- define tnl [--.tnl]
- define swrast [--.swrast]
- define swrast_setup [--.swrast_setup]
- define array_cache [--.array_cache]
- define drivers [-]
-
-.include [----]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [----.include],[--.main],[--.glapi]
-LIBDIR = [----.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = osmesa.c
-
-OBJECTS = osmesa.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-osmesa.obj : osmesa.c
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.c b/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.c
deleted file mode 100644
index 8a85b5ecf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.c
+++ /dev/null
@@ -1,1333 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * Off-Screen Mesa rendering / Rendering into client memory space
- *
- * Note on thread safety: this driver is thread safe. All
- * functions are reentrant. The notion of current context is
- * managed by the core _mesa_make_current() and _mesa_get_current_context()
- * functions. Those functions are thread-safe.
- */
-
-
-#include "glheader.h"
-#include "GL/osmesa.h"
-#include "context.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "fbobject.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "renderbuffer.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/s_context.h"
-#include "swrast/s_depth.h"
-#include "swrast/s_lines.h"
-#include "swrast/s_triangle.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "drivers/common/driverfuncs.h"
-
-
-
-/*
- * This is the OS/Mesa context struct.
- * Notice how it includes a GLcontext. By doing this we're mimicking
- * C++ inheritance/derivation.
- * Later, we can cast a GLcontext pointer into an OSMesaContext pointer
- * or vice versa.
- */
-struct osmesa_context {
- GLcontext mesa; /* The core GL/Mesa context */
- GLvisual *gl_visual; /* Describes the buffers */
- GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */
- GLenum format; /* either GL_RGBA or GL_COLOR_INDEX */
- void *buffer; /* the image buffer */
- GLint width, height; /* size of image buffer */
- GLint rowlength; /* number of pixels per row */
- GLint userRowLength; /* user-specified number of pixels per row */
- GLint rshift, gshift; /* bit shifts for RGBA formats */
- GLint bshift, ashift;
- GLint rInd, gInd, bInd, aInd;/* index offsets for RGBA formats */
- GLchan *rowaddr[MAX_HEIGHT]; /* address of first pixel in each image row */
- GLboolean yup; /* TRUE -> Y increases upward */
- /* FALSE -> Y increases downward */
-};
-
-
-/* Just cast, since we're using structure containment */
-#define OSMESA_CONTEXT(ctx) ((OSMesaContext) (ctx->DriverCtx))
-
-
-
-/**********************************************************************/
-/*** Private Device Driver Functions ***/
-/**********************************************************************/
-
-
-static const GLubyte *
-get_string( GLcontext *ctx, GLenum name )
-{
- (void) ctx;
- switch (name) {
- case GL_RENDERER:
-#if CHAN_BITS == 32
- return (const GLubyte *) "Mesa OffScreen32";
-#elif CHAN_BITS == 16
- return (const GLubyte *) "Mesa OffScreen16";
-#else
- return (const GLubyte *) "Mesa OffScreen";
-#endif
- default:
- return NULL;
- }
-}
-
-
-static void
-osmesa_update_state( GLcontext *ctx, GLuint new_state )
-{
- /* easy - just propogate */
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-
-static void
-set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
-{
- /* separate read buffer not supported */
- ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(bufferBit == BUFFER_BIT_FRONT_LEFT);
-}
-
-
-/*
- * Just return the current buffer size.
- * There's no window to track the size of.
- */
-static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
- /* don't use GET_CURRENT_CONTEXT(ctx) here - it's a problem on Windows */
- GLcontext *ctx = (GLcontext *) _glapi_get_context();
- (void) buffer;
- if (ctx) {
- OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
- *width = osmesa->width;
- *height = osmesa->height;
- }
-}
-
-
-/**********************************************************************/
-/***** Read/write spans/arrays of pixels *****/
-/**********************************************************************/
-
-/* RGBA */
-#define NAME(PREFIX) PREFIX##_RGBA
-#define FORMAT GL_RGBA
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLchan *P = osmesa->rowaddr[Y] + 4 * (X)
-#define INC_PIXEL_PTR(P) P += 4
-#if CHAN_TYPE == GL_FLOAT
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = MAX2((VALUE[RCOMP]), 0.0F); \
- DST[1] = MAX2((VALUE[GCOMP]), 0.0F); \
- DST[2] = MAX2((VALUE[BCOMP]), 0.0F); \
- DST[3] = CLAMP((VALUE[ACOMP]), 0.0F, CHAN_MAXF)
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
- DST[0] = MAX2((VALUE[RCOMP]), 0.0F); \
- DST[1] = MAX2((VALUE[GCOMP]), 0.0F); \
- DST[2] = MAX2((VALUE[BCOMP]), 0.0F); \
- DST[3] = CHAN_MAXF
-#else
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = VALUE[RCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[BCOMP]; \
- DST[3] = VALUE[ACOMP]
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
- DST[0] = VALUE[RCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[BCOMP]; \
- DST[3] = CHAN_MAX
-#endif
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[0]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[2]; \
- DST[ACOMP] = SRC[3]
-#include "swrast/s_spantemp.h"
-
-/* BGRA */
-#define NAME(PREFIX) PREFIX##_BGRA
-#define FORMAT GL_RGBA
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLchan *P = osmesa->rowaddr[Y] + 4 * (X)
-#define INC_PIXEL_PTR(P) P += 4
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[2] = VALUE[RCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[0] = VALUE[BCOMP]; \
- DST[3] = VALUE[ACOMP]
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
- DST[2] = VALUE[RCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[0] = VALUE[BCOMP]; \
- DST[3] = CHAN_MAX
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[2]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[0]; \
- DST[ACOMP] = SRC[3]
-#include "swrast/s_spantemp.h"
-
-/* ARGB */
-#define NAME(PREFIX) PREFIX##_ARGB
-#define FORMAT GL_RGBA
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLchan *P = osmesa->rowaddr[Y] + 4 * (X)
-#define INC_PIXEL_PTR(P) P += 4
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[1] = VALUE[RCOMP]; \
- DST[2] = VALUE[GCOMP]; \
- DST[3] = VALUE[BCOMP]; \
- DST[0] = VALUE[ACOMP]
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
- DST[1] = VALUE[RCOMP]; \
- DST[2] = VALUE[GCOMP]; \
- DST[3] = VALUE[BCOMP]; \
- DST[0] = CHAN_MAX
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[1]; \
- DST[GCOMP] = SRC[2]; \
- DST[BCOMP] = SRC[3]; \
- DST[ACOMP] = SRC[0]
-#include "swrast/s_spantemp.h"
-
-/* RGB */
-#define NAME(PREFIX) PREFIX##_RGB
-#define FORMAT GL_RGBA
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLchan *P = osmesa->rowaddr[Y] + 4 * (X)
-#define INC_PIXEL_PTR(P) P += 3
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[0] = VALUE[RCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[2] = VALUE[BCOMP]
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[0]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[2]; \
- DST[ACOMP] = CHAN_MAX
-#include "swrast/s_spantemp.h"
-
-/* BGR */
-#define NAME(PREFIX) PREFIX##_BGR
-#define FORMAT GL_RGBA
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLchan *P = osmesa->rowaddr[Y] + 4 * (X)
-#define INC_PIXEL_PTR(P) P += 3
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- DST[2] = VALUE[RCOMP]; \
- DST[1] = VALUE[GCOMP]; \
- DST[0] = VALUE[BCOMP]
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = SRC[2]; \
- DST[GCOMP] = SRC[1]; \
- DST[BCOMP] = SRC[0]; \
- DST[ACOMP] = CHAN_MAX
-#include "swrast/s_spantemp.h"
-
-/* 16-bit BGR */
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
-#define NAME(PREFIX) PREFIX##_RGB_565
-#define FORMAT GL_RGBA
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) osmesa->rowaddr[Y] + (X)
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- *DST = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) )
-#define FETCH_PIXEL(DST, SRC) \
- DST[RCOMP] = ( (((*SRC) >> 8) & 0xf8) | (((*SRC) >> 11) & 0x7) ); \
- DST[GCOMP] = ( (((*SRC) >> 3) & 0xfc) | (((*SRC) >> 5) & 0x3) ); \
- DST[BCOMP] = ( (((*SRC) << 3) & 0xf8) | (((*SRC) ) & 0x7) ); \
- DST[ACOMP] = CHAN_MAX
-#include "swrast/s_spantemp.h"
-#endif /* CHAN_TYPE == GL_UNSIGNED_BYTE */
-
-/* color index */
-#define NAME(PREFIX) PREFIX##_CI
-#define FORMAT GL_COLOR_INDEX8_EXT
-#define SPAN_VARS \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = osmesa->rowaddr[Y] + (X)
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(DST, X, Y, VALUE) \
- *DST = VALUE[0]
-#define FETCH_PIXEL(DST, SRC) \
- DST = SRC[0]
-#include "swrast/s_spantemp.h"
-
-
-
-
-/**********************************************************************/
-/***** Optimized line rendering *****/
-/**********************************************************************/
-
-
-#if CHAN_TYPE == GL_FLOAT
-#define PACK_RGBA(DST, R, G, B, A) \
-do { \
- (DST)[0] = MAX2( R, 0.0F ); \
- (DST)[1] = MAX2( G, 0.0F ); \
- (DST)[2] = MAX2( B, 0.0F ); \
- (DST)[3] = CLAMP(A, 0.0F, CHAN_MAXF);\
-} while (0)
-#else
-#define PACK_RGBA(DST, R, G, B, A) \
-do { \
- (DST)[osmesa->rInd] = R; \
- (DST)[osmesa->gInd] = G; \
- (DST)[osmesa->bInd] = B; \
- (DST)[osmesa->aInd] = A; \
-} while (0)
-#endif
-
-#define PACK_RGB(DST, R, G, B) \
-do { \
- (DST)[0] = R; \
- (DST)[1] = G; \
- (DST)[2] = B; \
-} while (0)
-
-#define PACK_BGR(DST, R, G, B) \
-do { \
- (DST)[0] = B; \
- (DST)[1] = G; \
- (DST)[2] = R; \
-} while (0)
-
-#define PACK_RGB_565(DST, R, G, B) \
-do { \
- (DST) = (((int) (R) << 8) & 0xf800) | (((int) (G) << 3) & 0x7e0) | ((int) (B) >> 3);\
-} while (0)
-
-#define UNPACK_RED(P) ( (P)[osmesa->rInd] )
-#define UNPACK_GREEN(P) ( (P)[osmesa->gInd] )
-#define UNPACK_BLUE(P) ( (P)[osmesa->bInd] )
-#define UNPACK_ALPHA(P) ( (P)[osmesa->aInd] )
-
-#define PIXELADDR1(X,Y) (osmesa->rowaddr[Y] + (X))
-#define PIXELADDR2(X,Y) (osmesa->rowaddr[Y] + 2 * (X))
-#define PIXELADDR3(X,Y) (osmesa->rowaddr[Y] + 3 * (X))
-#define PIXELADDR4(X,Y) (osmesa->rowaddr[Y] + 4 * (X))
-
-
-/*
- * Draw a flat-shaded, RGB line into an osmesa buffer.
- */
-#define NAME flat_rgba_line
-#define CLIP_HACK 1
-#define SETUP_CODE \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); \
- const GLchan *color = vert1->color;
-
-#define PLOT(X, Y) \
-do { \
- GLchan *p = PIXELADDR4(X, Y); \
- PACK_RGBA(p, color[0], color[1], color[2], color[3]); \
-} while (0)
-
-#ifdef WIN32
-#include "..\swrast\s_linetemp.h"
-#else
-#include "swrast/s_linetemp.h"
-#endif
-
-
-
-/*
- * Draw a flat-shaded, Z-less, RGB line into an osmesa buffer.
- */
-#define NAME flat_rgba_z_line
-#define CLIP_HACK 1
-#define INTERP_Z 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define SETUP_CODE \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); \
- const GLchan *color = vert1->color;
-
-#define PLOT(X, Y) \
-do { \
- if (Z < *zPtr) { \
- GLchan *p = PIXELADDR4(X, Y); \
- PACK_RGBA(p, color[RCOMP], color[GCOMP], \
- color[BCOMP], color[ACOMP]); \
- *zPtr = Z; \
- } \
-} while (0)
-
-#ifdef WIN32
-#include "..\swrast\s_linetemp.h"
-#else
-#include "swrast/s_linetemp.h"
-#endif
-
-
-
-/*
- * Analyze context state to see if we can provide a fast line drawing
- * function, like those in lines.c. Otherwise, return NULL.
- */
-static swrast_line_func
-osmesa_choose_line_function( GLcontext *ctx )
-{
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
- const SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- if (CHAN_BITS != 8) return NULL;
- if (ctx->RenderMode != GL_RENDER) return NULL;
- if (ctx->Line.SmoothFlag) return NULL;
- if (ctx->Texture._EnabledUnits) return NULL;
- if (ctx->Light.ShadeModel != GL_FLAT) return NULL;
- if (ctx->Line.Width != 1.0F) return NULL;
- if (ctx->Line.StippleFlag) return NULL;
- if (ctx->Line.SmoothFlag) return NULL;
- if (osmesa->format != OSMESA_RGBA &&
- osmesa->format != OSMESA_BGRA &&
- osmesa->format != OSMESA_ARGB) return NULL;
-
- if (swrast->_RasterMask==DEPTH_BIT
- && ctx->Depth.Func==GL_LESS
- && ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) {
- return (swrast_line_func) flat_rgba_z_line;
- }
-
- if (swrast->_RasterMask == 0) {
- return (swrast_line_func) flat_rgba_line;
- }
-
- return (swrast_line_func) NULL;
-}
-
-
-/**********************************************************************/
-/***** Optimized triangle rendering *****/
-/**********************************************************************/
-
-
-/*
- * Smooth-shaded, z-less triangle, RGBA color.
- */
-#define NAME smooth_rgba_z_triangle
-#define INTERP_Z 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define SETUP_CODE \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-#define RENDER_SPAN( span ) \
- GLuint i; \
- GLchan *img = PIXELADDR4(span.x, span.y); \
- for (i = 0; i < span.end; i++, img += 4) { \
- const GLdepth z = FixedToDepth(span.z); \
- if (z < zRow[i]) { \
- PACK_RGBA(img, FixedToChan(span.red), \
- FixedToChan(span.green), FixedToChan(span.blue), \
- FixedToChan(span.alpha)); \
- zRow[i] = z; \
- } \
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
- span.z += span.zStep; \
- }
-#ifdef WIN32
-#include "..\swrast\s_tritemp.h"
-#else
-#include "swrast/s_tritemp.h"
-#endif
-
-
-
-/*
- * Flat-shaded, z-less triangle, RGBA color.
- */
-#define NAME flat_rgba_z_triangle
-#define INTERP_Z 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define SETUP_CODE \
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); \
- GLuint pixel; \
- PACK_RGBA((GLchan *) &pixel, v2->color[0], v2->color[1], \
- v2->color[2], v2->color[3]);
-
-#define RENDER_SPAN( span ) \
- GLuint i; \
- GLuint *img = (GLuint *) PIXELADDR4(span.x, span.y); \
- for (i = 0; i < span.end; i++) { \
- const GLdepth z = FixedToDepth(span.z); \
- if (z < zRow[i]) { \
- img[i] = pixel; \
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
- }
-#ifdef WIN32
-#include "..\swrast\s_tritemp.h"
-#else
-#include "swrast/s_tritemp.h"
-#endif
-
-
-
-/*
- * Return pointer to an accelerated triangle function if possible.
- */
-static swrast_tri_func
-osmesa_choose_triangle_function( GLcontext *ctx )
-{
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
- const SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- if (CHAN_BITS != 8) return (swrast_tri_func) NULL;
- if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
- if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
- if (ctx->Polygon.StippleFlag) return (swrast_tri_func) NULL;
- if (ctx->Texture._EnabledUnits) return (swrast_tri_func) NULL;
- if (osmesa->format != OSMESA_RGBA &&
- osmesa->format != OSMESA_BGRA &&
- osmesa->format != OSMESA_ARGB) return (swrast_tri_func) NULL;
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- return (swrast_tri_func) NULL;
-
- if (swrast->_RasterMask == DEPTH_BIT &&
- ctx->Depth.Func == GL_LESS &&
- ctx->Depth.Mask == GL_TRUE &&
- ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) {
- if (ctx->Light.ShadeModel == GL_SMOOTH) {
- return (swrast_tri_func) smooth_rgba_z_triangle;
- }
- else {
- return (swrast_tri_func) flat_rgba_z_triangle;
- }
- }
- return (swrast_tri_func) NULL;
-}
-
-
-
-/* Override for the swrast triangle-selection function. Try to use one
- * of our internal triangle functions, otherwise fall back to the
- * standard swrast functions.
- */
-static void
-osmesa_choose_triangle( GLcontext *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- swrast->Triangle = osmesa_choose_triangle_function( ctx );
- if (!swrast->Triangle)
- _swrast_choose_triangle( ctx );
-}
-
-static void
-osmesa_choose_line( GLcontext *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- swrast->Line = osmesa_choose_line_function( ctx );
- if (!swrast->Line)
- _swrast_choose_line( ctx );
-}
-
-
-#define OSMESA_NEW_LINE (_NEW_LINE | \
- _NEW_TEXTURE | \
- _NEW_LIGHT | \
- _NEW_DEPTH | \
- _NEW_RENDERMODE | \
- _SWRAST_NEW_RASTERMASK)
-
-#define OSMESA_NEW_TRIANGLE (_NEW_POLYGON | \
- _NEW_TEXTURE | \
- _NEW_LIGHT | \
- _NEW_DEPTH | \
- _NEW_RENDERMODE | \
- _SWRAST_NEW_RASTERMASK)
-
-
-/**
- * Don't use _mesa_delete_renderbuffer since we can't free rb->Data.
- */
-static void
-osmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
-{
- _mesa_free(rb);
-}
-
-
-/**
- * Allocate renderbuffer storage. We don't actually allocate any storage
- * since we're using a user-provided buffer.
- * Just set up all the gl_renderbuffer methods.
- */
-static GLboolean
-osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
-
- if (osmesa->format == OSMESA_RGBA) {
- rb->GetRow = get_row_RGBA;
- rb->GetValues = get_values_RGBA;
- rb->PutRow = put_row_RGBA;
- rb->PutRowRGB = put_row_rgb_RGBA;
- rb->PutMonoRow = put_mono_row_RGBA;
- rb->PutValues = put_values_RGBA;
- rb->PutMonoValues = put_mono_values_RGBA;
- }
- else if (osmesa->format == OSMESA_BGRA) {
- rb->GetRow = get_row_BGRA;
- rb->GetValues = get_values_BGRA;
- rb->PutRow = put_row_BGRA;
- rb->PutRowRGB = put_row_rgb_BGRA;
- rb->PutMonoRow = put_mono_row_BGRA;
- rb->PutValues = put_values_BGRA;
- rb->PutMonoValues = put_mono_values_BGRA;
- }
- else if (osmesa->format == OSMESA_ARGB) {
- rb->GetRow = get_row_ARGB;
- rb->GetValues = get_values_ARGB;
- rb->PutRow = put_row_ARGB;
- rb->PutRowRGB = put_row_rgb_ARGB;
- rb->PutMonoRow = put_mono_row_ARGB;
- rb->PutValues = put_values_ARGB;
- rb->PutMonoValues = put_mono_values_ARGB;
- }
- else if (osmesa->format == OSMESA_RGB) {
- rb->GetRow = get_row_RGB;
- rb->GetValues = get_values_RGB;
- rb->PutRow = put_row_RGB;
- rb->PutRowRGB = put_row_rgb_RGB;
- rb->PutMonoRow = put_mono_row_RGB;
- rb->PutValues = put_values_RGB;
- rb->PutMonoValues = put_mono_values_RGB;
- }
- else if (osmesa->format == OSMESA_BGR) {
- rb->GetRow = get_row_BGR;
- rb->GetValues = get_values_BGR;
- rb->PutRow = put_row_BGR;
- rb->PutRowRGB = put_row_rgb_BGR;
- rb->PutMonoRow = put_mono_row_BGR;
- rb->PutValues = put_values_BGR;
- rb->PutMonoValues = put_mono_values_BGR;
- }
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- else if (osmesa->format == OSMESA_RGB_565) {
- rb->GetRow = get_row_RGB_565;
- rb->GetValues = get_values_RGB_565;
- rb->PutRow = put_row_RGB_565;
- rb->PutRow = put_row_rgb_RGB_565;
- rb->PutMonoRow = put_mono_row_RGB_565;
- rb->PutValues = put_values_RGB_565;
- rb->PutMonoValues = put_mono_values_RGB_565;
- }
-#endif
- else if (osmesa->format == OSMESA_COLOR_INDEX) {
- rb->GetRow = get_row_CI;
- rb->GetValues = get_values_CI;
- rb->PutRow = put_row_CI;
- rb->PutMonoRow = put_mono_row_CI;
- rb->PutValues = put_values_CI;
- rb->PutMonoValues = put_mono_values_CI;
- }
- else {
- _mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage");
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Allocate a new renderbuffer tpo describe the user-provided color buffer.
- */
-static struct gl_renderbuffer *
-new_osmesa_renderbuffer(GLenum format)
-{
- struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer);
- if (rb) {
- const GLuint name = 0;
- _mesa_init_renderbuffer(rb, name);
-
- rb->Delete = osmesa_delete_renderbuffer;
- rb->AllocStorage = osmesa_renderbuffer_storage;
-
- if (format == OSMESA_COLOR_INDEX) {
- rb->_BaseFormat = GL_COLOR_INDEX;
- rb->InternalFormat = GL_COLOR_INDEX;
- rb->DataType = GL_UNSIGNED_BYTE;
- }
- else {
- rb->_BaseFormat = GL_RGBA;
- rb->InternalFormat = GL_RGBA;
- rb->DataType = CHAN_TYPE;
- }
- }
- return rb;
-}
-
-
-
-/**********************************************************************/
-/***** Public Functions *****/
-/**********************************************************************/
-
-
-/*
- * Create an Off-Screen Mesa rendering context. The only attribute needed is
- * an RGBA vs Color-Index mode flag.
- *
- * Input: format - either GL_RGBA or GL_COLOR_INDEX
- * sharelist - specifies another OSMesaContext with which to share
- * display lists. NULL indicates no sharing.
- * Return: an OSMesaContext or 0 if error
- */
-GLAPI OSMesaContext GLAPIENTRY
-OSMesaCreateContext( GLenum format, OSMesaContext sharelist )
-{
- const GLint accumBits = (format == OSMESA_COLOR_INDEX) ? 0 : 16;
- return OSMesaCreateContextExt(format, DEFAULT_SOFTWARE_DEPTH_BITS,
- 8, accumBits, sharelist);
-}
-
-
-
-/*
- * New in Mesa 3.5
- *
- * Create context and specify size of ancillary buffers.
- */
-GLAPI OSMesaContext GLAPIENTRY
-OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
- GLint accumBits, OSMesaContext sharelist )
-{
- OSMesaContext osmesa;
- struct dd_function_table functions;
- GLint rshift, gshift, bshift, ashift;
- GLint rind, gind, bind, aind;
- GLint indexBits = 0, redBits = 0, greenBits = 0, blueBits = 0, alphaBits =0;
- GLboolean rgbmode;
- const GLuint i4 = 1;
- const GLubyte *i1 = (GLubyte *) &i4;
- const GLint little_endian = *i1;
-
- rind = gind = bind = aind = 0;
- if (format==OSMESA_COLOR_INDEX) {
- indexBits = 8;
- rshift = gshift = bshift = ashift = 0;
- rgbmode = GL_FALSE;
- }
- else if (format==OSMESA_RGBA) {
- indexBits = 0;
- redBits = CHAN_BITS;
- greenBits = CHAN_BITS;
- blueBits = CHAN_BITS;
- alphaBits = CHAN_BITS;
- rind = 0;
- gind = 1;
- bind = 2;
- aind = 3;
- if (little_endian) {
- rshift = 0;
- gshift = 8;
- bshift = 16;
- ashift = 24;
- }
- else {
- rshift = 24;
- gshift = 16;
- bshift = 8;
- ashift = 0;
- }
- rgbmode = GL_TRUE;
- }
- else if (format==OSMESA_BGRA) {
- indexBits = 0;
- redBits = CHAN_BITS;
- greenBits = CHAN_BITS;
- blueBits = CHAN_BITS;
- alphaBits = CHAN_BITS;
- bind = 0;
- gind = 1;
- rind = 2;
- aind = 3;
- if (little_endian) {
- bshift = 0;
- gshift = 8;
- rshift = 16;
- ashift = 24;
- }
- else {
- bshift = 24;
- gshift = 16;
- rshift = 8;
- ashift = 0;
- }
- rgbmode = GL_TRUE;
- }
- else if (format==OSMESA_ARGB) {
- indexBits = 0;
- redBits = CHAN_BITS;
- greenBits = CHAN_BITS;
- blueBits = CHAN_BITS;
- alphaBits = CHAN_BITS;
- aind = 0;
- rind = 1;
- gind = 2;
- bind = 3;
- if (little_endian) {
- ashift = 0;
- rshift = 8;
- gshift = 16;
- bshift = 24;
- }
- else {
- ashift = 24;
- rshift = 16;
- gshift = 8;
- bshift = 0;
- }
- rgbmode = GL_TRUE;
- }
- else if (format==OSMESA_RGB) {
- indexBits = 0;
- redBits = CHAN_BITS;
- greenBits = CHAN_BITS;
- blueBits = CHAN_BITS;
- alphaBits = 0;
- bshift = 0;
- gshift = 8;
- rshift = 16;
- ashift = 24;
- rind = 0;
- gind = 1;
- bind = 2;
- rgbmode = GL_TRUE;
- }
- else if (format==OSMESA_BGR) {
- indexBits = 0;
- redBits = CHAN_BITS;
- greenBits = CHAN_BITS;
- blueBits = CHAN_BITS;
- alphaBits = 0;
- bshift = 0;
- gshift = 8;
- rshift = 16;
- ashift = 24;
- rind = 2;
- gind = 1;
- bind = 0;
- rgbmode = GL_TRUE;
- }
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- else if (format==OSMESA_RGB_565) {
- indexBits = 0;
- redBits = 5;
- greenBits = 6;
- blueBits = 5;
- alphaBits = 0;
- rshift = 11;
- gshift = 5;
- bshift = 0;
- ashift = 0;
- rind = 0; /* not used */
- gind = 0;
- bind = 0;
- rgbmode = GL_TRUE;
- }
-#endif
- else {
- return NULL;
- }
-
- osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context);
- if (osmesa) {
- osmesa->gl_visual = _mesa_create_visual( rgbmode,
- GL_FALSE, /* double buffer */
- GL_FALSE, /* stereo */
- redBits,
- greenBits,
- blueBits,
- alphaBits,
- indexBits,
- depthBits,
- stencilBits,
- accumBits,
- accumBits,
- accumBits,
- alphaBits ? accumBits : 0,
- 1 /* num samples */
- );
- if (!osmesa->gl_visual) {
- FREE(osmesa);
- return NULL;
- }
-
- /* Initialize device driver function table */
- _mesa_init_driver_functions(&functions);
- /* override with our functions */
- functions.GetString = get_string;
- functions.UpdateState = osmesa_update_state;
- functions.GetBufferSize = get_buffer_size;
-
- if (!_mesa_initialize_context(&osmesa->mesa,
- osmesa->gl_visual,
- sharelist ? &sharelist->mesa
- : (GLcontext *) NULL,
- &functions, (void *) osmesa)) {
- _mesa_destroy_visual( osmesa->gl_visual );
- FREE(osmesa);
- return NULL;
- }
-
- _mesa_enable_sw_extensions(&(osmesa->mesa));
- _mesa_enable_1_3_extensions(&(osmesa->mesa));
- _mesa_enable_1_4_extensions(&(osmesa->mesa));
- _mesa_enable_1_5_extensions(&(osmesa->mesa));
-
- osmesa->gl_buffer = _mesa_create_framebuffer(osmesa->gl_visual);
- if (!osmesa->gl_buffer) {
- _mesa_destroy_visual( osmesa->gl_visual );
- _mesa_free_context_data( &osmesa->mesa );
- FREE(osmesa);
- return NULL;
- }
-
- /* create front color buffer in user-provided memory (no back buffer) */
- _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT,
- new_osmesa_renderbuffer(format));
- _mesa_add_soft_renderbuffers(osmesa->gl_buffer,
- GL_FALSE, /* color */
- osmesa->gl_visual->haveDepthBuffer,
- osmesa->gl_visual->haveStencilBuffer,
- osmesa->gl_visual->haveAccumBuffer,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux */ );
-
- osmesa->format = format;
- osmesa->buffer = NULL;
- osmesa->width = 0;
- osmesa->height = 0;
- osmesa->userRowLength = 0;
- osmesa->rowlength = 0;
- osmesa->yup = GL_TRUE;
- osmesa->rshift = rshift;
- osmesa->gshift = gshift;
- osmesa->bshift = bshift;
- osmesa->ashift = ashift;
- osmesa->rInd = rind;
- osmesa->gInd = gind;
- osmesa->bInd = bind;
- osmesa->aInd = aind;
-
- /* Initialize the software rasterizer and helper modules. */
- {
- GLcontext *ctx = &osmesa->mesa;
- SWcontext *swrast;
- struct swrast_device_driver *swdd;
- TNLcontext *tnl;
-
- if (!_swrast_CreateContext( ctx ) ||
- !_ac_CreateContext( ctx ) ||
- !_tnl_CreateContext( ctx ) ||
- !_swsetup_CreateContext( ctx )) {
- _mesa_destroy_visual(osmesa->gl_visual);
- _mesa_free_context_data(ctx);
- _mesa_free(osmesa);
- return NULL;
- }
-
- _swsetup_Wakeup( ctx );
-
- /* use default TCL pipeline */
- tnl = TNL_CONTEXT(ctx);
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
-
- swdd = _swrast_GetDeviceDriverReference( ctx );
- swdd->SetBuffer = set_buffer;
-
- /* Extend the software rasterizer with our optimized line and triangle
- * drawing functions.
- */
- swrast = SWRAST_CONTEXT( ctx );
- swrast->choose_line = osmesa_choose_line;
- swrast->choose_triangle = osmesa_choose_triangle;
- swrast->invalidate_line |= OSMESA_NEW_LINE;
- swrast->invalidate_triangle |= OSMESA_NEW_TRIANGLE;
- }
- }
- return osmesa;
-}
-
-
-/*
- * Destroy an Off-Screen Mesa rendering context.
- *
- * Input: ctx - the context to destroy
- */
-GLAPI void GLAPIENTRY
-OSMesaDestroyContext( OSMesaContext ctx )
-{
- if (ctx) {
- _swsetup_DestroyContext( &ctx->mesa );
- _tnl_DestroyContext( &ctx->mesa );
- _ac_DestroyContext( &ctx->mesa );
- _swrast_DestroyContext( &ctx->mesa );
-
- _mesa_destroy_visual( ctx->gl_visual );
- _mesa_destroy_framebuffer( ctx->gl_buffer );
- _mesa_free_context_data( &ctx->mesa );
- FREE( ctx );
- }
-}
-
-
-/*
- * Recompute the values of the context's rowaddr array.
- */
-static void
-compute_row_addresses( OSMesaContext ctx )
-{
- GLint bytesPerPixel, bytesPerRow, i;
- GLubyte *origin = (GLubyte *) ctx->buffer;
-
- if (ctx->format == OSMESA_COLOR_INDEX) {
- /* CI mode */
- bytesPerPixel = 1 * sizeof(GLchan);
- }
- else if ((ctx->format == OSMESA_RGB) || (ctx->format == OSMESA_BGR)) {
- /* RGB mode */
- bytesPerPixel = 3 * sizeof(GLchan);
- }
- else if (ctx->format == OSMESA_RGB_565) {
- /* 5/6/5 RGB pixel in 16 bits */
- bytesPerPixel = 2;
- }
- else {
- /* RGBA mode */
- bytesPerPixel = 4 * sizeof(GLchan);
- }
-
- bytesPerRow = ctx->rowlength * bytesPerPixel;
-
- if (ctx->yup) {
- /* Y=0 is bottom line of window */
- for (i = 0; i < MAX_HEIGHT; i++) {
- ctx->rowaddr[i] = (GLchan *) ((GLubyte *) origin + i * bytesPerRow);
- }
- }
- else {
- /* Y=0 is top line of window */
- for (i = 0; i < MAX_HEIGHT; i++) {
- GLint j = ctx->height - i - 1;
- ctx->rowaddr[i] = (GLchan *) ((GLubyte *) origin + j * bytesPerRow);
- }
- }
-}
-
-
-/*
- * Bind an OSMesaContext to an image buffer. The image buffer is just a
- * block of memory which the client provides. Its size must be at least
- * as large as width*height*sizeof(type). Its address should be a multiple
- * of 4 if using RGBA mode.
- *
- * Image data is stored in the order of glDrawPixels: row-major order
- * with the lower-left image pixel stored in the first array position
- * (ie. bottom-to-top).
- *
- * If the context's viewport hasn't been initialized yet, it will now be
- * initialized to (0,0,width,height).
- *
- * Input: ctx - the rendering context
- * buffer - the image buffer memory
- * type - data type for pixel components
- * Normally, only GL_UNSIGNED_BYTE and GL_UNSIGNED_SHORT_5_6_5
- * are supported. But if Mesa's been compiled with CHAN_BITS==16
- * then type must be GL_UNSIGNED_SHORT. And if Mesa's been build
- * with CHAN_BITS==32 then type must be GL_FLOAT.
- * width, height - size of image buffer in pixels, at least 1
- * Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx,
- * invalid buffer address, invalid type, width<1, height<1,
- * width>internal limit or height>internal limit.
- */
-GLAPI GLboolean GLAPIENTRY
-OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
- GLsizei width, GLsizei height )
-{
- if (!ctx || !buffer ||
- width < 1 || height < 1 ||
- width > MAX_WIDTH || height > MAX_HEIGHT) {
- return GL_FALSE;
- }
-
- if (ctx->format == OSMESA_RGB_565) {
- if (type != GL_UNSIGNED_SHORT_5_6_5)
- return GL_FALSE;
- }
- else if (type != CHAN_TYPE) {
- return GL_FALSE;
- }
-
- /* Need to set these before calling _mesa_make_current() since the first
- * time the context is bound, _mesa_make_current() will call our
- * get_buffer_size() function to initialize the viewport. These are the
- * values returned by get_buffer_size():
- */
- ctx->buffer = buffer;
- ctx->width = width;
- ctx->height = height;
-
- osmesa_update_state( &ctx->mesa, 0 );
- _mesa_make_current( &ctx->mesa, ctx->gl_buffer, ctx->gl_buffer );
-
- if (ctx->userRowLength)
- ctx->rowlength = ctx->userRowLength;
- else
- ctx->rowlength = width;
-
- compute_row_addresses( ctx );
-
- /* this will make ensure we recognize the new buffer size */
- _mesa_resize_framebuffer(&ctx->mesa, ctx->gl_buffer, width, height);
-
- /* Added by Gerk Huisma: */
- _tnl_MakeCurrent( &ctx->mesa, ctx->mesa.DrawBuffer,
- ctx->mesa.ReadBuffer );
-
- return GL_TRUE;
-}
-
-
-
-GLAPI OSMesaContext GLAPIENTRY
-OSMesaGetCurrentContext( void )
-{
- GLcontext *ctx = _mesa_get_current_context();
- if (ctx)
- return (OSMesaContext) ctx;
- else
- return NULL;
-}
-
-
-
-GLAPI void GLAPIENTRY
-OSMesaPixelStore( GLint pname, GLint value )
-{
- OSMesaContext osmesa = OSMesaGetCurrentContext();
-
- switch (pname) {
- case OSMESA_ROW_LENGTH:
- if (value<0) {
- _mesa_error( &osmesa->mesa, GL_INVALID_VALUE,
- "OSMesaPixelStore(value)" );
- return;
- }
- osmesa->userRowLength = value;
- osmesa->rowlength = value ? value : osmesa->width;
- break;
- case OSMESA_Y_UP:
- osmesa->yup = value ? GL_TRUE : GL_FALSE;
- break;
- default:
- _mesa_error( &osmesa->mesa, GL_INVALID_ENUM, "OSMesaPixelStore(pname)" );
- return;
- }
-
- compute_row_addresses( osmesa );
-}
-
-
-GLAPI void GLAPIENTRY
-OSMesaGetIntegerv( GLint pname, GLint *value )
-{
- OSMesaContext osmesa = OSMesaGetCurrentContext();
-
- switch (pname) {
- case OSMESA_WIDTH:
- *value = osmesa->width;
- return;
- case OSMESA_HEIGHT:
- *value = osmesa->height;
- return;
- case OSMESA_FORMAT:
- *value = osmesa->format;
- return;
- case OSMESA_TYPE:
- *value = CHAN_TYPE;
- return;
- case OSMESA_ROW_LENGTH:
- *value = osmesa->userRowLength;
- return;
- case OSMESA_Y_UP:
- *value = osmesa->yup;
- return;
- case OSMESA_MAX_WIDTH:
- *value = MAX_WIDTH;
- return;
- case OSMESA_MAX_HEIGHT:
- *value = MAX_HEIGHT;
- return;
- default:
- _mesa_error(&osmesa->mesa, GL_INVALID_ENUM, "OSMesaGetIntergerv(pname)");
- return;
- }
-}
-
-/*
- * Return the depth buffer associated with an OSMesa context.
- * Input: c - the OSMesa context
- * Output: width, height - size of buffer in pixels
- * bytesPerValue - bytes per depth value (2 or 4)
- * buffer - pointer to depth buffer values
- * Return: GL_TRUE or GL_FALSE to indicate success or failure.
- */
-GLAPI GLboolean GLAPIENTRY
-OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
- GLint *bytesPerValue, void **buffer )
-{
- struct gl_renderbuffer *rb = NULL;
-
- if (c->gl_buffer)
- rb = c->gl_buffer->Attachment[BUFFER_DEPTH].Renderbuffer;
-
- if (!rb || !rb->Data) {
- /*if ((!c->gl_buffer) || (!c->gl_buffer->DepthBuffer)) {*/
- *width = 0;
- *height = 0;
- *bytesPerValue = 0;
- *buffer = 0;
- return GL_FALSE;
- }
- else {
- *width = c->gl_buffer->Width;
- *height = c->gl_buffer->Height;
- if (c->gl_visual->depthBits <= 16)
- *bytesPerValue = sizeof(GLushort);
- else
- *bytesPerValue = sizeof(GLuint);
- *buffer = rb->Data;
- return GL_TRUE;
- }
-}
-
-/*
- * Return the color buffer associated with an OSMesa context.
- * Input: c - the OSMesa context
- * Output: width, height - size of buffer in pixels
- * format - the pixel format (OSMESA_FORMAT)
- * buffer - pointer to color buffer values
- * Return: GL_TRUE or GL_FALSE to indicate success or failure.
- */
-GLAPI GLboolean GLAPIENTRY
-OSMesaGetColorBuffer( OSMesaContext c, GLint *width,
- GLint *height, GLint *format, void **buffer )
-{
- if (!c->buffer) {
- *width = 0;
- *height = 0;
- *format = 0;
- *buffer = 0;
- return GL_FALSE;
- }
- else {
- *width = c->width;
- *height = c->height;
- *format = c->format;
- *buffer = c->buffer;
- return GL_TRUE;
- }
-}
-
-
-struct name_function
-{
- const char *Name;
- OSMESAproc Function;
-};
-
-static struct name_function functions[] = {
- { "OSMesaCreateContext", (OSMESAproc) OSMesaCreateContext },
- { "OSMesaCreateContextExt", (OSMESAproc) OSMesaCreateContextExt },
- { "OSMesaDestroyContext", (OSMESAproc) OSMesaDestroyContext },
- { "OSMesaMakeCurrent", (OSMESAproc) OSMesaMakeCurrent },
- { "OSMesaGetCurrentContext", (OSMESAproc) OSMesaGetCurrentContext },
- { "OSMesaPixelsStore", (OSMESAproc) OSMesaPixelStore },
- { "OSMesaGetIntegerv", (OSMESAproc) OSMesaGetIntegerv },
- { "OSMesaGetDepthBuffer", (OSMESAproc) OSMesaGetDepthBuffer },
- { "OSMesaGetColorBuffer", (OSMESAproc) OSMesaGetColorBuffer },
- { "OSMesaGetProcAddress", (OSMESAproc) OSMesaGetProcAddress },
- { NULL, NULL }
-};
-
-
-GLAPI OSMESAproc GLAPIENTRY
-OSMesaGetProcAddress( const char *funcName )
-{
- int i;
- for (i = 0; functions[i].Name; i++) {
- if (_mesa_strcmp(functions[i].Name, funcName) == 0)
- return functions[i].Function;
- }
- return _glapi_get_proc_address(funcName);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.def b/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.def
deleted file mode 100644
index a92a30f35..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/osmesa/osmesa.def
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION 'Mesa OSMesa lib for Win32'
-VERSION 4.1
-
-EXPORTS
- OSMesaCreateContext
- OSMesaCreateContextExt
- OSMesaDestroyContext
- OSMesaMakeCurrent
- OSMesaGetCurrentContext
- OSMesaPixelStore
- OSMesaGetIntegerv
- OSMesaGetDepthBuffer
- OSMesaGetColorBuffer
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/descrip.mms b/nx-X11/extras/Mesa/src/mesa/drivers/x11/descrip.mms
deleted file mode 100644
index 69d14e36c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/descrip.mms
+++ /dev/null
@@ -1,51 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [----.include.gl]
- define math [--.math]
- define tnl [--.tnl]
- define swrast [--.swrast]
- define swrast_setup [--.swrast_setup]
- define array_cache [--.array_cache]
- define drivers [-]
-
-.include [----]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [----.include],[--.main],[--.glapi]
-LIBDIR = [----.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = fakeglx.c glxapi.c xfonts.c xm_api.c xm_dd.c xm_line.c xm_span.c\
- xm_tri.c xm_buffer.c
-
-OBJECTS =fakeglx.obj,glxapi.obj,xfonts.obj,xm_api.obj,xm_dd.obj,xm_line.obj,\
- xm_span.obj,xm_tri.obj,xm_buffer.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-fakeglx.obj : fakeglx.c
-glxapi.obj : glxapi.c
-xfonts.obj : xfonts.c
-xm_api.obj : xm_api.c
-xm_buffer.obj : xm_buffer.c
-xm_dd.obj : xm_dd.c
-xm_line.obj : xm_line.c
-xm_span.obj : xm_span.c
-xm_tri.obj : xm_tri.c
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/fakeglx.c b/nx-X11/extras/Mesa/src/mesa/drivers/x11/fakeglx.c
deleted file mode 100644
index d3213e708..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/fakeglx.c
+++ /dev/null
@@ -1,2886 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.4
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * This is an emulation of the GLX API which allows Mesa/GLX-based programs
- * to run on X servers which do not have the real GLX extension.
- *
- * Thanks to the contributors:
- *
- * Initial version: Philip Brown (phil@bolthole.com)
- * Better glXGetConfig() support: Armin Liebchen (liebchen@asylum.cs.utah.edu)
- * Further visual-handling refinements: Wolfram Gloger
- * (wmglo@Dent.MED.Uni-Muenchen.DE).
- *
- * Notes:
- * Don't be fooled, stereo isn't supported yet.
- */
-
-
-
-#include "glxheader.h"
-#include "glxapi.h"
-#include "GL/xmesa.h"
-#include "context.h"
-#include "config.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "version.h"
-#include "xfonts.h"
-#include "xmesaP.h"
-
-#ifdef __VMS
-#define _mesa_sprintf sprintf
-#endif
-
-/* This indicates the client-side GLX API and GLX encoder version. */
-#define CLIENT_MAJOR_VERSION 1
-#define CLIENT_MINOR_VERSION 4 /* but don't have 1.3's pbuffers, etc yet */
-
-/* This indicates the server-side GLX decoder version.
- * GLX 1.4 indicates OpenGL 1.3 support
- */
-#define SERVER_MAJOR_VERSION 1
-#define SERVER_MINOR_VERSION 4
-
-/* This is appended onto the glXGetClient/ServerString version strings. */
-#define MESA_GLX_VERSION "Mesa " MESA_VERSION_STRING
-
-/* Who implemented this GLX? */
-#define VENDOR "Brian Paul"
-
-#define EXTENSIONS \
- "GLX_MESA_set_3dfx_mode " \
- "GLX_MESA_copy_sub_buffer " \
- "GLX_MESA_pixmap_colormap " \
- "GLX_MESA_release_buffers " \
- "GLX_ARB_get_proc_address " \
- "GLX_EXT_visual_info " \
- "GLX_EXT_visual_rating " \
- "GLX_SGI_video_sync " \
- "GLX_SGIX_fbconfig " \
- "GLX_SGIX_pbuffer "
-
-/*
- * Our fake GLX context will contain a "real" GLX context and an XMesa context.
- *
- * Note that a pointer to a __GLXcontext is a pointer to a fake_glx_context,
- * and vice versa.
- *
- * We really just need this structure in order to make the libGL functions
- * glXGetCurrentContext(), glXGetCurrentDrawable() and glXGetCurrentDisplay()
- * work correctly.
- */
-struct fake_glx_context {
- __GLXcontext glxContext; /* this MUST be first! */
- XMesaContext xmesaContext;
-};
-
-
-
-/**********************************************************************/
-/*** GLX Visual Code ***/
-/**********************************************************************/
-
-#define DONT_CARE -1
-
-
-static XMesaVisual *VisualTable = NULL;
-static int NumVisuals = 0;
-
-
-/*
- * This struct and some code fragments borrowed
- * from Mark Kilgard's GLUT library.
- */
-typedef struct _OverlayInfo {
- /* Avoid 64-bit portability problems by being careful to use
- longs due to the way XGetWindowProperty is specified. Note
- that these parameters are passed as CARD32s over X
- protocol. */
- unsigned long overlay_visual;
- long transparent_type;
- long value;
- long layer;
-} OverlayInfo;
-
-
-
-/* Macro to handle c_class vs class field name in XVisualInfo struct */
-#if defined(__cplusplus) || defined(c_plusplus)
-#define CLASS c_class
-#else
-#define CLASS class
-#endif
-
-
-
-/*
- * Test if the given XVisualInfo is usable for Mesa rendering.
- */
-static GLboolean
-is_usable_visual( XVisualInfo *vinfo )
-{
- switch (vinfo->CLASS) {
- case StaticGray:
- case GrayScale:
- /* Any StaticGray/GrayScale visual works in RGB or CI mode */
- return GL_TRUE;
- case StaticColor:
- case PseudoColor:
- /* Any StaticColor/PseudoColor visual of at least 4 bits */
- if (vinfo->depth>=4) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
- case TrueColor:
- case DirectColor:
- /* Any depth of TrueColor or DirectColor works in RGB mode */
- return GL_TRUE;
- default:
- /* This should never happen */
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * Get an array OverlayInfo records for specified screen.
- * \param dpy the display
- * \param screen screen number
- * \param numOverlays returns numver of OverlayInfo records
- * \return pointer to OverlayInfo array, free with XFree()
- */
-static OverlayInfo *
-GetOverlayInfo(Display *dpy, int screen, int *numOverlays)
-{
- Atom overlayVisualsAtom;
- Atom actualType;
- Status status;
- unsigned char *ovInfo;
- unsigned long sizeData, bytesLeft;
- int actualFormat;
-
- /*
- * The SERVER_OVERLAY_VISUALS property on the root window contains
- * a list of overlay visuals. Get that list now.
- */
- overlayVisualsAtom = XInternAtom(dpy,"SERVER_OVERLAY_VISUALS", True);
- if (overlayVisualsAtom == None) {
- return 0;
- }
-
- status = XGetWindowProperty(dpy, RootWindow(dpy, screen),
- overlayVisualsAtom, 0L, (long) 10000, False,
- overlayVisualsAtom, &actualType, &actualFormat,
- &sizeData, &bytesLeft,
- &ovInfo);
-
- if (status != Success || actualType != overlayVisualsAtom ||
- actualFormat != 32 || sizeData < 4) {
- /* something went wrong */
- XFree((void *) ovInfo);
- *numOverlays = 0;
- return NULL;
- }
-
- *numOverlays = sizeData / 4;
- return (OverlayInfo *) ovInfo;
-}
-
-
-
-/**
- * Return the level (overlay, normal, underlay) of a given XVisualInfo.
- * Input: dpy - the X display
- * vinfo - the XVisualInfo to test
- * Return: level of the visual:
- * 0 = normal planes
- * >0 = overlay planes
- * <0 = underlay planes
- */
-static int
-level_of_visual( Display *dpy, XVisualInfo *vinfo )
-{
- OverlayInfo *overlay_info;
- int numOverlaysPerScreen, i;
-
- overlay_info = GetOverlayInfo(dpy, vinfo->screen, &numOverlaysPerScreen);
- if (!overlay_info) {
- return 0;
- }
-
- /* search the overlay visual list for the visual ID of interest */
- for (i = 0; i < numOverlaysPerScreen; i++) {
- const OverlayInfo *ov = overlay_info + i;
- if (ov->overlay_visual == vinfo->visualid) {
- /* found the visual */
- if (/*ov->transparent_type==1 &&*/ ov->layer!=0) {
- int level = ov->layer;
- XFree((void *) overlay_info);
- return level;
- }
- else {
- XFree((void *) overlay_info);
- return 0;
- }
- }
- }
-
- /* The visual ID was not found in the overlay list. */
- XFree((void *) overlay_info);
- return 0;
-}
-
-
-
-
-/*
- * Given an XVisualInfo and RGB, Double, and Depth buffer flags, save the
- * configuration in our list of GLX visuals.
- */
-static XMesaVisual
-save_glx_visual( Display *dpy, XVisualInfo *vinfo,
- GLboolean rgbFlag, GLboolean alphaFlag, GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint depth_size, GLint stencil_size,
- GLint accumRedSize, GLint accumGreenSize,
- GLint accumBlueSize, GLint accumAlphaSize,
- GLint level, GLint numAuxBuffers )
-{
- GLboolean ximageFlag = GL_TRUE;
- XMesaVisual xmvis;
- GLint i;
- GLboolean comparePointers;
-
- if (dbFlag) {
- /* Check if the MESA_BACK_BUFFER env var is set */
- char *backbuffer = _mesa_getenv("MESA_BACK_BUFFER");
- if (backbuffer) {
- if (backbuffer[0]=='p' || backbuffer[0]=='P') {
- ximageFlag = GL_FALSE;
- }
- else if (backbuffer[0]=='x' || backbuffer[0]=='X') {
- ximageFlag = GL_TRUE;
- }
- else {
- _mesa_warning(NULL, "Mesa: invalid value for MESA_BACK_BUFFER environment variable, using an XImage.");
- }
- }
- }
-
- /* Comparing IDs uses less memory but sometimes fails. */
- /* XXX revisit this after 3.0 is finished. */
- if (_mesa_getenv("MESA_GLX_VISUAL_HACK"))
- comparePointers = GL_TRUE;
- else
- comparePointers = GL_FALSE;
-
- /* Force the visual to have an alpha channel */
- if (rgbFlag && _mesa_getenv("MESA_GLX_FORCE_ALPHA"))
- alphaFlag = GL_TRUE;
-
- /* First check if a matching visual is already in the list */
- for (i=0; i<NumVisuals; i++) {
- XMesaVisual v = VisualTable[i];
- if (v->display == dpy
- && v->mesa_visual.level == level
- && v->mesa_visual.numAuxBuffers == numAuxBuffers
- && v->ximage_flag == ximageFlag
- && v->mesa_visual.rgbMode == rgbFlag
- && v->mesa_visual.doubleBufferMode == dbFlag
- && v->mesa_visual.stereoMode == stereoFlag
- && (v->mesa_visual.alphaBits > 0) == alphaFlag
- && (v->mesa_visual.depthBits >= depth_size || depth_size == 0)
- && (v->mesa_visual.stencilBits >= stencil_size || stencil_size == 0)
- && (v->mesa_visual.accumRedBits >= accumRedSize || accumRedSize == 0)
- && (v->mesa_visual.accumGreenBits >= accumGreenSize || accumGreenSize == 0)
- && (v->mesa_visual.accumBlueBits >= accumBlueSize || accumBlueSize == 0)
- && (v->mesa_visual.accumAlphaBits >= accumAlphaSize || accumAlphaSize == 0)) {
- /* now either compare XVisualInfo pointers or visual IDs */
- if ((!comparePointers && v->visinfo->visualid == vinfo->visualid)
- || (comparePointers && v->vishandle == vinfo)) {
- return v;
- }
- }
- }
-
- /* Create a new visual and add it to the list. */
-
- xmvis = XMesaCreateVisual( dpy, vinfo, rgbFlag, alphaFlag, dbFlag,
- stereoFlag, ximageFlag,
- depth_size, stencil_size,
- accumRedSize, accumBlueSize,
- accumBlueSize, accumAlphaSize, 0, level,
- GLX_NONE_EXT );
- if (xmvis) {
- /* Save a copy of the pointer now so we can find this visual again
- * if we need to search for it in find_glx_visual().
- */
- xmvis->vishandle = vinfo;
- /* Allocate more space for additional visual */
- VisualTable = _mesa_realloc( VisualTable,
- sizeof(XMesaVisual) * NumVisuals,
- sizeof(XMesaVisual) * (NumVisuals + 1));
- /* add xmvis to the list */
- VisualTable[NumVisuals] = xmvis;
- NumVisuals++;
- /* XXX minor hack, because XMesaCreateVisual doesn't support an
- * aux buffers parameter.
- */
- xmvis->mesa_visual.numAuxBuffers = numAuxBuffers;
- }
- return xmvis;
-}
-
-
-/**
- * Return the default number of bits for the Z buffer.
- * If defined, use the MESA_GLX_DEPTH_BITS env var value.
- * Otherwise, use the DEFAULT_SOFTWARE_DEPTH_BITS constant.
- * XXX probably do the same thing for stencil, accum, etc.
- */
-static GLint
-default_depth_bits(void)
-{
- int zBits;
- const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS");
- if (zEnv)
- zBits = _mesa_atoi(zEnv);
- else
- zBits = DEFAULT_SOFTWARE_DEPTH_BITS;
- return zBits;
-}
-
-
-
-/*
- * Create a GLX visual from a regular XVisualInfo.
- * This is called when Fake GLX is given an XVisualInfo which wasn't
- * returned by glXChooseVisual. Since this is the first time we're
- * considering this visual we'll take a guess at reasonable values
- * for depth buffer size, stencil size, accum size, etc.
- * This is the best we can do with a client-side emulation of GLX.
- */
-static XMesaVisual
-create_glx_visual( Display *dpy, XVisualInfo *visinfo )
-{
- int vislevel;
- GLint zBits = default_depth_bits();
-
- vislevel = level_of_visual( dpy, visinfo );
- if (vislevel) {
- /* Configure this visual as a CI, single-buffered overlay */
- return save_glx_visual( dpy, visinfo,
- GL_FALSE, /* rgb */
- GL_FALSE, /* alpha */
- GL_FALSE, /* double */
- GL_FALSE, /* stereo */
- 0, /* depth bits */
- 0, /* stencil bits */
- 0,0,0,0, /* accum bits */
- vislevel, /* level */
- 0 /* numAux */
- );
- }
- else if (is_usable_visual( visinfo )) {
- if (_mesa_getenv("MESA_GLX_FORCE_CI")) {
- /* Configure this visual as a COLOR INDEX visual. */
- return save_glx_visual( dpy, visinfo,
- GL_FALSE, /* rgb */
- GL_FALSE, /* alpha */
- GL_TRUE, /* double */
- GL_FALSE, /* stereo */
- zBits,
- STENCIL_BITS,
- 0, 0, 0, 0, /* accum bits */
- 0, /* level */
- 0 /* numAux */
- );
- }
- else {
- /* Configure this visual as RGB, double-buffered, depth-buffered. */
- /* This is surely wrong for some people's needs but what else */
- /* can be done? They should use glXChooseVisual(). */
- return save_glx_visual( dpy, visinfo,
- GL_TRUE, /* rgb */
- GL_FALSE, /* alpha */
- GL_TRUE, /* double */
- GL_FALSE, /* stereo */
- zBits,
- STENCIL_BITS,
- ACCUM_BITS, /* r */
- ACCUM_BITS, /* g */
- ACCUM_BITS, /* b */
- ACCUM_BITS, /* a */
- 0, /* level */
- 0 /* numAux */
- );
- }
- }
- else {
- _mesa_warning(NULL, "Mesa: error in glXCreateContext: bad visual\n");
- return NULL;
- }
-}
-
-
-
-/*
- * Find the GLX visual associated with an XVisualInfo.
- */
-static XMesaVisual
-find_glx_visual( Display *dpy, XVisualInfo *vinfo )
-{
- int i;
-
- /* try to match visual id */
- for (i=0;i<NumVisuals;i++) {
- if (VisualTable[i]->display==dpy
- && VisualTable[i]->visinfo->visualid == vinfo->visualid) {
- return VisualTable[i];
- }
- }
-
- /* if that fails, try to match pointers */
- for (i=0;i<NumVisuals;i++) {
- if (VisualTable[i]->display==dpy && VisualTable[i]->vishandle==vinfo) {
- return VisualTable[i];
- }
- }
-
- return NULL;
-}
-
-
-
-/**
- * Return the transparent pixel value for a GLX visual.
- * Input: glxvis - the glx_visual
- * Return: a pixel value or -1 if no transparent pixel
- */
-static int
-transparent_pixel( XMesaVisual glxvis )
-{
- Display *dpy = glxvis->display;
- XVisualInfo *vinfo = glxvis->visinfo;
- OverlayInfo *overlay_info;
- int numOverlaysPerScreen, i;
-
- overlay_info = GetOverlayInfo(dpy, vinfo->screen, &numOverlaysPerScreen);
- if (!overlay_info) {
- return -1;
- }
-
- for (i = 0; i < numOverlaysPerScreen; i++) {
- const OverlayInfo *ov = overlay_info + i;
- if (ov->overlay_visual == vinfo->visualid) {
- /* found it! */
- if (ov->transparent_type == 0) {
- /* type 0 indicates no transparency */
- XFree((void *) overlay_info);
- return -1;
- }
- else {
- /* ov->value is the transparent pixel */
- XFree((void *) overlay_info);
- return ov->value;
- }
- }
- }
-
- /* The visual ID was not found in the overlay list. */
- XFree((void *) overlay_info);
- return -1;
-}
-
-
-
-/**
- * Try to get an X visual which matches the given arguments.
- */
-static XVisualInfo *
-get_visual( Display *dpy, int scr, unsigned int depth, int xclass )
-{
- XVisualInfo temp, *vis;
- long mask;
- int n;
- unsigned int default_depth;
- int default_class;
-
- mask = VisualScreenMask | VisualDepthMask | VisualClassMask;
- temp.screen = scr;
- temp.depth = depth;
- temp.CLASS = xclass;
-
- default_depth = DefaultDepth(dpy,scr);
- default_class = DefaultVisual(dpy,scr)->CLASS;
-
- if (depth==default_depth && xclass==default_class) {
- /* try to get root window's visual */
- temp.visualid = DefaultVisual(dpy,scr)->visualid;
- mask |= VisualIDMask;
- }
-
- vis = XGetVisualInfo( dpy, mask, &temp, &n );
-
- /* In case bits/pixel > 24, make sure color channels are still <=8 bits.
- * An SGI Infinite Reality system, for example, can have 30bpp pixels:
- * 10 bits per color channel. Mesa's limited to a max of 8 bits/channel.
- */
- if (vis && depth > 24 && (xclass==TrueColor || xclass==DirectColor)) {
- if (_mesa_bitcount((GLuint) vis->red_mask ) <= 8 &&
- _mesa_bitcount((GLuint) vis->green_mask) <= 8 &&
- _mesa_bitcount((GLuint) vis->blue_mask ) <= 8) {
- return vis;
- }
- else {
- XFree((void *) vis);
- return NULL;
- }
- }
-
- return vis;
-}
-
-
-
-/*
- * Retrieve the value of the given environment variable and find
- * the X visual which matches it.
- * Input: dpy - the display
- * screen - the screen number
- * varname - the name of the environment variable
- * Return: an XVisualInfo pointer to NULL if error.
- */
-static XVisualInfo *
-get_env_visual(Display *dpy, int scr, const char *varname)
-{
- char value[100], type[100];
- int depth, xclass = -1;
- XVisualInfo *vis;
-
- if (!_mesa_getenv( varname )) {
- return NULL;
- }
-
- _mesa_strncpy( value, _mesa_getenv(varname), 100 );
- value[99] = 0;
-
- sscanf( value, "%s %d", type, &depth );
-
- if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor;
- else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor;
- else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor;
- else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor;
- else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale;
- else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray;
-
- if (xclass>-1 && depth>0) {
- vis = get_visual( dpy, scr, depth, xclass );
- if (vis) {
- return vis;
- }
- }
-
- _mesa_warning(NULL, "GLX unable to find visual class=%s, depth=%d.",
- type, depth);
-
- return NULL;
-}
-
-
-
-/*
- * Select an X visual which satisfies the RGBA/CI flag and minimum depth.
- * Input: dpy, screen - X display and screen number
- * rgba - GL_TRUE = RGBA mode, GL_FALSE = CI mode
- * min_depth - minimum visual depth
- * preferred_class - preferred GLX visual class or DONT_CARE
- * Return: pointer to an XVisualInfo or NULL.
- */
-static XVisualInfo *
-choose_x_visual( Display *dpy, int screen, GLboolean rgba, int min_depth,
- int preferred_class )
-{
- XVisualInfo *vis;
- int xclass, visclass = 0;
- int depth;
-
- if (rgba) {
- Atom hp_cr_maps = XInternAtom(dpy, "_HP_RGB_SMOOTH_MAP_LIST", True);
- /* First see if the MESA_RGB_VISUAL env var is defined */
- vis = get_env_visual( dpy, screen, "MESA_RGB_VISUAL" );
- if (vis) {
- return vis;
- }
- /* Otherwise, search for a suitable visual */
- if (preferred_class==DONT_CARE) {
- for (xclass=0;xclass<6;xclass++) {
- switch (xclass) {
- case 0: visclass = TrueColor; break;
- case 1: visclass = DirectColor; break;
- case 2: visclass = PseudoColor; break;
- case 3: visclass = StaticColor; break;
- case 4: visclass = GrayScale; break;
- case 5: visclass = StaticGray; break;
- }
- if (min_depth==0) {
- /* start with shallowest */
- for (depth=0;depth<=32;depth++) {
- if (visclass==TrueColor && depth==8 && !hp_cr_maps) {
- /* Special case: try to get 8-bit PseudoColor before */
- /* 8-bit TrueColor */
- vis = get_visual( dpy, screen, 8, PseudoColor );
- if (vis) {
- return vis;
- }
- }
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- }
- else {
- /* start with deepest */
- for (depth=32;depth>=min_depth;depth--) {
- if (visclass==TrueColor && depth==8 && !hp_cr_maps) {
- /* Special case: try to get 8-bit PseudoColor before */
- /* 8-bit TrueColor */
- vis = get_visual( dpy, screen, 8, PseudoColor );
- if (vis) {
- return vis;
- }
- }
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- }
- }
- }
- else {
- /* search for a specific visual class */
- switch (preferred_class) {
- case GLX_TRUE_COLOR_EXT: visclass = TrueColor; break;
- case GLX_DIRECT_COLOR_EXT: visclass = DirectColor; break;
- case GLX_PSEUDO_COLOR_EXT: visclass = PseudoColor; break;
- case GLX_STATIC_COLOR_EXT: visclass = StaticColor; break;
- case GLX_GRAY_SCALE_EXT: visclass = GrayScale; break;
- case GLX_STATIC_GRAY_EXT: visclass = StaticGray; break;
- default: return NULL;
- }
- if (min_depth==0) {
- /* start with shallowest */
- for (depth=0;depth<=32;depth++) {
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- }
- else {
- /* start with deepest */
- for (depth=32;depth>=min_depth;depth--) {
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- }
- }
- }
- else {
- /* First see if the MESA_CI_VISUAL env var is defined */
- vis = get_env_visual( dpy, screen, "MESA_CI_VISUAL" );
- if (vis) {
- return vis;
- }
- /* Otherwise, search for a suitable visual, starting with shallowest */
- if (preferred_class==DONT_CARE) {
- for (xclass=0;xclass<4;xclass++) {
- switch (xclass) {
- case 0: visclass = PseudoColor; break;
- case 1: visclass = StaticColor; break;
- case 2: visclass = GrayScale; break;
- case 3: visclass = StaticGray; break;
- }
- /* try 8-bit up through 16-bit */
- for (depth=8;depth<=16;depth++) {
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- /* try min_depth up to 8-bit */
- for (depth=min_depth;depth<8;depth++) {
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- }
- }
- else {
- /* search for a specific visual class */
- switch (preferred_class) {
- case GLX_TRUE_COLOR_EXT: visclass = TrueColor; break;
- case GLX_DIRECT_COLOR_EXT: visclass = DirectColor; break;
- case GLX_PSEUDO_COLOR_EXT: visclass = PseudoColor; break;
- case GLX_STATIC_COLOR_EXT: visclass = StaticColor; break;
- case GLX_GRAY_SCALE_EXT: visclass = GrayScale; break;
- case GLX_STATIC_GRAY_EXT: visclass = StaticGray; break;
- default: return NULL;
- }
- /* try 8-bit up through 16-bit */
- for (depth=8;depth<=16;depth++) {
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- /* try min_depth up to 8-bit */
- for (depth=min_depth;depth<8;depth++) {
- vis = get_visual( dpy, screen, depth, visclass );
- if (vis) {
- return vis;
- }
- }
- }
- }
-
- /* didn't find a visual */
- return NULL;
-}
-
-
-
-/*
- * Find the deepest X over/underlay visual of at least min_depth.
- * Input: dpy, screen - X display and screen number
- * level - the over/underlay level
- * trans_type - transparent pixel type: GLX_NONE_EXT,
- * GLX_TRANSPARENT_RGB_EXT, GLX_TRANSPARENT_INDEX_EXT,
- * or DONT_CARE
- * trans_value - transparent pixel value or DONT_CARE
- * min_depth - minimum visual depth
- * preferred_class - preferred GLX visual class or DONT_CARE
- * Return: pointer to an XVisualInfo or NULL.
- */
-static XVisualInfo *
-choose_x_overlay_visual( Display *dpy, int scr, GLboolean rgbFlag,
- int level, int trans_type, int trans_value,
- int min_depth, int preferred_class )
-{
- OverlayInfo *overlay_info;
- int numOverlaysPerScreen;
- int i;
- XVisualInfo *deepvis;
- int deepest;
-
- /*DEBUG int tt, tv; */
-
- switch (preferred_class) {
- case GLX_TRUE_COLOR_EXT: preferred_class = TrueColor; break;
- case GLX_DIRECT_COLOR_EXT: preferred_class = DirectColor; break;
- case GLX_PSEUDO_COLOR_EXT: preferred_class = PseudoColor; break;
- case GLX_STATIC_COLOR_EXT: preferred_class = StaticColor; break;
- case GLX_GRAY_SCALE_EXT: preferred_class = GrayScale; break;
- case GLX_STATIC_GRAY_EXT: preferred_class = StaticGray; break;
- default: preferred_class = DONT_CARE;
- }
-
- overlay_info = GetOverlayInfo(dpy, scr, &numOverlaysPerScreen);
- if (!overlay_info) {
- return NULL;
- }
-
- /* Search for the deepest overlay which satisifies all criteria. */
- deepest = min_depth;
- deepvis = NULL;
-
- for (i = 0; i < numOverlaysPerScreen; i++) {
- const OverlayInfo *ov = overlay_info + i;
- XVisualInfo *vislist, vistemplate;
- int count;
-
- if (ov->layer!=level) {
- /* failed overlay level criteria */
- continue;
- }
- if (!(trans_type==DONT_CARE
- || (trans_type==GLX_TRANSPARENT_INDEX_EXT
- && ov->transparent_type>0)
- || (trans_type==GLX_NONE_EXT && ov->transparent_type==0))) {
- /* failed transparent pixel type criteria */
- continue;
- }
- if (trans_value!=DONT_CARE && trans_value!=ov->value) {
- /* failed transparent pixel value criteria */
- continue;
- }
-
- /* get XVisualInfo and check the depth */
- vistemplate.visualid = ov->overlay_visual;
- vistemplate.screen = scr;
- vislist = XGetVisualInfo( dpy, VisualIDMask | VisualScreenMask,
- &vistemplate, &count );
-
- if (count!=1) {
- /* something went wrong */
- continue;
- }
- if (preferred_class!=DONT_CARE && preferred_class!=vislist->CLASS) {
- /* wrong visual class */
- continue;
- }
-
- /* if RGB was requested, make sure we have True/DirectColor */
- if (rgbFlag && vislist->CLASS != TrueColor
- && vislist->CLASS != DirectColor)
- continue;
-
- /* if CI was requested, make sure we have a color indexed visual */
- if (!rgbFlag
- && (vislist->CLASS == TrueColor || vislist->CLASS == DirectColor))
- continue;
-
- if (deepvis==NULL || vislist->depth > deepest) {
- /* YES! found a satisfactory visual */
- if (deepvis) {
- XFree( deepvis );
- }
- deepest = vislist->depth;
- deepvis = vislist;
- /* DEBUG tt = ov->transparent_type;*/
- /* DEBUG tv = ov->value; */
- }
- }
-
-/*DEBUG
- if (deepvis) {
- printf("chose 0x%x: layer=%d depth=%d trans_type=%d trans_value=%d\n",
- deepvis->visualid, level, deepvis->depth, tt, tv );
- }
-*/
- return deepvis;
-}
-
-
-/**********************************************************************/
-/*** Begin Fake GLX API Functions ***/
-/**********************************************************************/
-
-
-/**
- * Helper used by glXChooseVisual and glXChooseFBConfig.
- * The fbConfig parameter must be GL_FALSE for the former and GL_TRUE for
- * the later.
- * In either case, the attribute list is terminated with the value 'None'.
- */
-static XMesaVisual
-choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
-{
- const GLboolean rgbModeDefault = fbConfig;
- const int *parselist;
- XVisualInfo *vis;
- int min_ci = 0;
- int min_red=0, min_green=0, min_blue=0;
- GLboolean rgb_flag = rgbModeDefault;
- GLboolean alpha_flag = GL_FALSE;
- GLboolean double_flag = GL_FALSE;
- GLboolean stereo_flag = GL_FALSE;
- GLint depth_size = 0;
- GLint stencil_size = 0;
- GLint accumRedSize = 0;
- GLint accumGreenSize = 0;
- GLint accumBlueSize = 0;
- GLint accumAlphaSize = 0;
- int level = 0;
- int visual_type = DONT_CARE;
- int trans_type = DONT_CARE;
- int trans_value = DONT_CARE;
- GLint caveat = DONT_CARE;
- XMesaVisual xmvis = NULL;
- int desiredVisualID = -1;
- int numAux = 0;
-
- parselist = list;
-
- while (*parselist) {
-
- switch (*parselist) {
- case GLX_USE_GL:
- if (fbConfig) {
- /* invalid token */
- return NULL;
- }
- else {
- /* skip */
- parselist++;
- }
- break;
- case GLX_BUFFER_SIZE:
- parselist++;
- min_ci = *parselist++;
- break;
- case GLX_LEVEL:
- parselist++;
- level = *parselist++;
- break;
- case GLX_RGBA:
- if (fbConfig) {
- /* invalid token */
- return NULL;
- }
- else {
- rgb_flag = GL_TRUE;
- parselist++;
- }
- break;
- case GLX_DOUBLEBUFFER:
- parselist++;
- if (fbConfig) {
- double_flag = *parselist++;
- }
- else {
- double_flag = GL_TRUE;
- }
- break;
- case GLX_STEREO:
- parselist++;
- if (fbConfig) {
- stereo_flag = *parselist++;
- }
- else {
- stereo_flag = GL_TRUE;
- }
- return NULL; /* stereo not supported */
- case GLX_AUX_BUFFERS:
- parselist++;
- numAux = *parselist++;
- if (numAux > MAX_AUX_BUFFERS)
- return NULL;
- break;
- case GLX_RED_SIZE:
- parselist++;
- min_red = *parselist++;
- break;
- case GLX_GREEN_SIZE:
- parselist++;
- min_green = *parselist++;
- break;
- case GLX_BLUE_SIZE:
- parselist++;
- min_blue = *parselist++;
- break;
- case GLX_ALPHA_SIZE:
- parselist++;
- {
- GLint size = *parselist++;
- alpha_flag = size>0 ? 1 : 0;
- }
- break;
- case GLX_DEPTH_SIZE:
- parselist++;
- depth_size = *parselist++;
- break;
- case GLX_STENCIL_SIZE:
- parselist++;
- stencil_size = *parselist++;
- break;
- case GLX_ACCUM_RED_SIZE:
- parselist++;
- {
- GLint size = *parselist++;
- accumRedSize = MAX2( accumRedSize, size );
- }
- break;
- case GLX_ACCUM_GREEN_SIZE:
- parselist++;
- {
- GLint size = *parselist++;
- accumGreenSize = MAX2( accumGreenSize, size );
- }
- break;
- case GLX_ACCUM_BLUE_SIZE:
- parselist++;
- {
- GLint size = *parselist++;
- accumBlueSize = MAX2( accumBlueSize, size );
- }
- break;
- case GLX_ACCUM_ALPHA_SIZE:
- parselist++;
- {
- GLint size = *parselist++;
- accumAlphaSize = MAX2( accumAlphaSize, size );
- }
- break;
-
- /*
- * GLX_EXT_visual_info extension
- */
- case GLX_X_VISUAL_TYPE_EXT:
- parselist++;
- visual_type = *parselist++;
- break;
- case GLX_TRANSPARENT_TYPE_EXT:
- parselist++;
- trans_type = *parselist++;
- break;
- case GLX_TRANSPARENT_INDEX_VALUE_EXT:
- parselist++;
- trans_value = *parselist++;
- break;
- case GLX_TRANSPARENT_RED_VALUE_EXT:
- case GLX_TRANSPARENT_GREEN_VALUE_EXT:
- case GLX_TRANSPARENT_BLUE_VALUE_EXT:
- case GLX_TRANSPARENT_ALPHA_VALUE_EXT:
- /* ignore */
- parselist++;
- parselist++;
- break;
-
- /*
- * GLX_EXT_visual_info extension
- */
- case GLX_VISUAL_CAVEAT_EXT:
- parselist++;
- caveat = *parselist++; /* ignored for now */
- break;
-
- /*
- * GLX_ARB_multisample
- */
- case GLX_SAMPLE_BUFFERS_ARB:
- /* ms not supported */
- return NULL;
- case GLX_SAMPLES_ARB:
- /* ms not supported */
- return NULL;
-
- /*
- * FBConfig attribs.
- */
- case GLX_RENDER_TYPE:
- if (!fbConfig)
- return NULL;
- parselist++;
- if (*parselist == GLX_RGBA_BIT) {
- rgb_flag = GL_TRUE;
- }
- else if (*parselist == GLX_COLOR_INDEX_BIT) {
- rgb_flag = GL_FALSE;
- }
- else if (*parselist == 0) {
- rgb_flag = GL_TRUE;
- }
- parselist++;
- break;
- case GLX_DRAWABLE_TYPE:
- if (!fbConfig)
- return NULL;
- parselist++;
- if (*parselist & ~(GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT)) {
- return NULL; /* bad bit */
- }
- parselist++;
- break;
- case GLX_FBCONFIG_ID:
- if (!fbConfig)
- return NULL;
- parselist++;
- desiredVisualID = *parselist++;
- break;
- case GLX_X_RENDERABLE:
- if (!fbConfig)
- return NULL;
- parselist += 2;
- /* ignore */
- break;
-
- case None:
- /* end of list */
- break;
-
- default:
- /* undefined attribute */
- _mesa_warning(NULL, "unexpected attrib 0x%x in choose_visual()",
- *parselist);
- return NULL;
- }
- }
-
- (void) caveat;
-
- /*
- * Since we're only simulating the GLX extension this function will never
- * find any real GL visuals. Instead, all we can do is try to find an RGB
- * or CI visual of appropriate depth. Other requested attributes such as
- * double buffering, depth buffer, etc. will be associated with the X
- * visual and stored in the VisualTable[].
- */
- if (desiredVisualID != -1) {
- /* try to get a specific visual, by visualID */
- XVisualInfo temp;
- int n;
- temp.visualid = desiredVisualID;
- temp.screen = screen;
- vis = XGetVisualInfo(dpy, VisualIDMask | VisualScreenMask, &temp, &n);
- if (vis) {
- /* give the visual some useful GLX attributes */
- double_flag = GL_TRUE;
- if (vis->depth > 8)
- rgb_flag = GL_TRUE;
- depth_size = default_depth_bits();
- stencil_size = STENCIL_BITS;
- /* XXX accum??? */
- }
- }
- else if (level==0) {
- /* normal color planes */
- if (rgb_flag) {
- /* Get an RGB visual */
- int min_rgb = min_red + min_green + min_blue;
- if (min_rgb>1 && min_rgb<8) {
- /* a special case to be sure we can get a monochrome visual */
- min_rgb = 1;
- }
- vis = choose_x_visual( dpy, screen, rgb_flag, min_rgb, visual_type );
- }
- else {
- /* Get a color index visual */
- vis = choose_x_visual( dpy, screen, rgb_flag, min_ci, visual_type );
- accumRedSize = accumGreenSize = accumBlueSize = accumAlphaSize = 0;
- }
- }
- else {
- /* over/underlay planes */
- if (rgb_flag) {
- /* rgba overlay */
- int min_rgb = min_red + min_green + min_blue;
- if (min_rgb>1 && min_rgb<8) {
- /* a special case to be sure we can get a monochrome visual */
- min_rgb = 1;
- }
- vis = choose_x_overlay_visual( dpy, screen, rgb_flag, level,
- trans_type, trans_value, min_rgb, visual_type );
- }
- else {
- /* color index overlay */
- vis = choose_x_overlay_visual( dpy, screen, rgb_flag, level,
- trans_type, trans_value, min_ci, visual_type );
- }
- }
-
- if (vis) {
- /* Note: we're not exactly obeying the glXChooseVisual rules here.
- * When GLX_DEPTH_SIZE = 1 is specified we're supposed to choose the
- * largest depth buffer size, which is 32bits/value. Instead, we
- * return 16 to maintain performance with earlier versions of Mesa.
- */
- if (depth_size > 24)
- depth_size = 31; /* 32 causes int overflow problems */
- else if (depth_size > 16)
- depth_size = 24;
- else if (depth_size > 0) {
- depth_size = default_depth_bits();
- }
-
- /* we only support one size of stencil and accum buffers. */
- if (stencil_size > 0)
- stencil_size = STENCIL_BITS;
- if (accumRedSize > 0 || accumGreenSize > 0 || accumBlueSize > 0 ||
- accumAlphaSize > 0) {
- accumRedSize = ACCUM_BITS;
- accumGreenSize = ACCUM_BITS;
- accumBlueSize = ACCUM_BITS;
- accumAlphaSize = alpha_flag ? ACCUM_BITS : 0;
- }
-
- xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
- stereo_flag, depth_size, stencil_size,
- accumRedSize, accumGreenSize,
- accumBlueSize, accumAlphaSize, level, numAux );
- }
-
- return xmvis;
-}
-
-
-static XVisualInfo *
-Fake_glXChooseVisual( Display *dpy, int screen, int *list )
-{
- XMesaVisual xmvis = choose_visual(dpy, screen, list, GL_FALSE);
- if (xmvis) {
-#if 0
- return xmvis->vishandle;
-#else
- /* create a new vishandle - the cached one may be stale */
- xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo));
- if (xmvis->vishandle) {
- _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo));
- }
- return xmvis->vishandle;
-#endif
- }
- else
- return NULL;
-}
-
-
-static GLXContext
-Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
- GLXContext share_list, Bool direct )
-{
- XMesaVisual xmvis;
- struct fake_glx_context *glxCtx;
- struct fake_glx_context *shareCtx = (struct fake_glx_context *) share_list;
-
- if (!dpy || !visinfo)
- return 0;
-
- glxCtx = CALLOC_STRUCT(fake_glx_context);
- if (!glxCtx)
- return 0;
-
- /* deallocate unused windows/buffers */
- XMesaGarbageCollect();
-
- xmvis = find_glx_visual( dpy, visinfo );
- if (!xmvis) {
- /* This visual wasn't found with glXChooseVisual() */
- xmvis = create_glx_visual( dpy, visinfo );
- if (!xmvis) {
- /* unusable visual */
- FREE(glxCtx);
- return NULL;
- }
- }
-
- glxCtx->xmesaContext = XMesaCreateContext(xmvis,
- shareCtx ? shareCtx->xmesaContext : NULL);
- if (!glxCtx->xmesaContext) {
- FREE(glxCtx);
- return NULL;
- }
-
- glxCtx->xmesaContext->direct = GL_FALSE;
- glxCtx->glxContext.isDirect = GL_FALSE;
- glxCtx->glxContext.currentDpy = dpy;
- glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */
-
- assert((void *) glxCtx == (void *) &(glxCtx->glxContext));
-
- return (GLXContext) glxCtx;
-}
-
-
-/* XXX these may have to be removed due to thread-safety issues. */
-static GLXContext MakeCurrent_PrevContext = 0;
-static GLXDrawable MakeCurrent_PrevDrawable = 0;
-static GLXDrawable MakeCurrent_PrevReadable = 0;
-static XMesaBuffer MakeCurrent_PrevDrawBuffer = 0;
-static XMesaBuffer MakeCurrent_PrevReadBuffer = 0;
-
-
-/* GLX 1.3 and later */
-static Bool
-Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
- GLXDrawable read, GLXContext ctx )
-{
- struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx;
-
- if (ctx && draw && read) {
- XMesaBuffer drawBuffer, readBuffer;
- XMesaContext xmctx = glxCtx->xmesaContext;
-
- /* Find the XMesaBuffer which corresponds to the GLXDrawable 'draw' */
- if (ctx == MakeCurrent_PrevContext
- && draw == MakeCurrent_PrevDrawable) {
- drawBuffer = MakeCurrent_PrevDrawBuffer;
- }
- else {
- drawBuffer = XMesaFindBuffer( dpy, draw );
- }
- if (!drawBuffer) {
- /* drawable must be a new window! */
- drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, xmctx);
- if (!drawBuffer) {
- /* Out of memory, or context/drawable depth mismatch */
- return False;
- }
- }
-
- /* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */
- if (ctx == MakeCurrent_PrevContext
- && read == MakeCurrent_PrevReadable) {
- readBuffer = MakeCurrent_PrevReadBuffer;
- }
- else {
- readBuffer = XMesaFindBuffer( dpy, read );
- }
- if (!readBuffer) {
- /* drawable must be a new window! */
- readBuffer = XMesaCreateWindowBuffer2(glxCtx->xmesaContext->xm_visual,
- read, xmctx);
- if (!readBuffer) {
- /* Out of memory, or context/drawable depth mismatch */
- return False;
- }
- }
-
- MakeCurrent_PrevContext = ctx;
- MakeCurrent_PrevDrawable = draw;
- MakeCurrent_PrevReadable = read;
- MakeCurrent_PrevDrawBuffer = drawBuffer;
- MakeCurrent_PrevReadBuffer = readBuffer;
-
- /* Now make current! */
- if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) {
- ((__GLXcontext *) ctx)->currentDpy = dpy;
- ((__GLXcontext *) ctx)->currentDrawable = draw;
- ((__GLXcontext *) ctx)->currentReadable = read;
- return True;
- }
- else {
- return False;
- }
- }
- else if (!ctx && !draw && !read) {
- /* release current context w/out assigning new one. */
- XMesaMakeCurrent( NULL, NULL );
- MakeCurrent_PrevContext = 0;
- MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevReadable = 0;
- MakeCurrent_PrevDrawBuffer = 0;
- MakeCurrent_PrevReadBuffer = 0;
- return True;
- }
- else {
- /* The args must either all be non-zero or all zero.
- * This is an error.
- */
- return False;
- }
-}
-
-
-static Bool
-Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx )
-{
- return Fake_glXMakeContextCurrent( dpy, drawable, drawable, ctx );
-}
-
-
-static GLXPixmap
-Fake_glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo, Pixmap pixmap )
-{
- XMesaVisual v;
- XMesaBuffer b;
-
- v = find_glx_visual( dpy, visinfo );
- if (!v) {
- v = create_glx_visual( dpy, visinfo );
- if (!v) {
- /* unusable visual */
- return 0;
- }
- }
-
- b = XMesaCreatePixmapBuffer( v, pixmap, 0 );
- if (!b) {
- return 0;
- }
- return b->frontxrb->pixmap;
-}
-
-
-/*** GLX_MESA_pixmap_colormap ***/
-
-static GLXPixmap
-Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
- Pixmap pixmap, Colormap cmap )
-{
- XMesaVisual v;
- XMesaBuffer b;
-
- v = find_glx_visual( dpy, visinfo );
- if (!v) {
- v = create_glx_visual( dpy, visinfo );
- if (!v) {
- /* unusable visual */
- return 0;
- }
- }
-
- b = XMesaCreatePixmapBuffer( v, pixmap, cmap );
- if (!b) {
- return 0;
- }
- return b->frontxrb->pixmap;
-}
-
-
-static void
-Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
-{
- XMesaBuffer b = XMesaFindBuffer(dpy, pixmap);
- if (b) {
- XMesaDestroyBuffer(b);
- }
- else if (_mesa_getenv("MESA_DEBUG")) {
- _mesa_warning(NULL, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
- }
-}
-
-
-static void
-Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
- unsigned long mask )
-{
- struct fake_glx_context *fakeSrc = (struct fake_glx_context *) src;
- struct fake_glx_context *fakeDst = (struct fake_glx_context *) dst;
- XMesaContext xm_src = fakeSrc->xmesaContext;
- XMesaContext xm_dst = fakeDst->xmesaContext;
- (void) dpy;
- _mesa_copy_context( &(xm_src->mesa), &(xm_dst->mesa), (GLuint) mask );
-}
-
-
-static Bool
-Fake_glXQueryExtension( Display *dpy, int *errorb, int *event )
-{
- /* Mesa's GLX isn't really an X extension but we try to act like one. */
- (void) dpy;
- (void) errorb;
- (void) event;
- return True;
-}
-
-
-extern void _kw_ungrab_all( Display *dpy );
-void _kw_ungrab_all( Display *dpy )
-{
- XUngrabPointer( dpy, CurrentTime );
- XUngrabKeyboard( dpy, CurrentTime );
-}
-
-
-static void
-Fake_glXDestroyContext( Display *dpy, GLXContext ctx )
-{
- struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx;
- (void) dpy;
- MakeCurrent_PrevContext = 0;
- MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevReadable = 0;
- MakeCurrent_PrevDrawBuffer = 0;
- MakeCurrent_PrevReadBuffer = 0;
- XMesaDestroyContext( glxCtx->xmesaContext );
- XMesaGarbageCollect();
-}
-
-
-static Bool
-Fake_glXIsDirect( Display *dpy, GLXContext ctx )
-{
- struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx;
- (void) dpy;
- return glxCtx->xmesaContext->direct;
-}
-
-
-
-static void
-Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
-{
- XMesaBuffer buffer = XMesaFindBuffer( dpy, drawable );
-
- if (buffer) {
- XMesaSwapBuffers(buffer);
- }
- else if (_mesa_getenv("MESA_DEBUG")) {
- _mesa_warning(NULL, "glXSwapBuffers: invalid drawable 0x%x\n",
- (int) drawable);
- }
-}
-
-
-
-/*** GLX_MESA_copy_sub_buffer ***/
-
-static void
-Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height )
-{
- XMesaBuffer buffer = XMesaFindBuffer( dpy, drawable );
- if (buffer) {
- XMesaCopySubBuffer(buffer, x, y, width, height);
- }
- else if (_mesa_getenv("MESA_DEBUG")) {
- _mesa_warning(NULL, "Mesa: glXCopySubBufferMESA: invalid drawable\n");
- }
-}
-
-
-static Bool
-Fake_glXQueryVersion( Display *dpy, int *maj, int *min )
-{
- (void) dpy;
- /* Return GLX version, not Mesa version */
- assert(CLIENT_MAJOR_VERSION == SERVER_MAJOR_VERSION);
- *maj = CLIENT_MAJOR_VERSION;
- *min = MIN2( CLIENT_MINOR_VERSION, SERVER_MINOR_VERSION );
- return True;
-}
-
-
-/*
- * Query the GLX attributes of the given XVisualInfo.
- */
-static int
-get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
-{
- ASSERT(xmvis);
- switch(attrib) {
- case GLX_USE_GL:
- if (fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = (int) True;
- return 0;
- case GLX_BUFFER_SIZE:
- *value = xmvis->visinfo->depth;
- return 0;
- case GLX_LEVEL:
- *value = xmvis->mesa_visual.level;
- return 0;
- case GLX_RGBA:
- if (fbconfig)
- return GLX_BAD_ATTRIBUTE;
- if (xmvis->mesa_visual.rgbMode) {
- *value = True;
- }
- else {
- *value = False;
- }
- return 0;
- case GLX_DOUBLEBUFFER:
- *value = (int) xmvis->mesa_visual.doubleBufferMode;
- return 0;
- case GLX_STEREO:
- *value = (int) xmvis->mesa_visual.stereoMode;
- return 0;
- case GLX_AUX_BUFFERS:
- *value = xmvis->mesa_visual.numAuxBuffers;
- return 0;
- case GLX_RED_SIZE:
- *value = xmvis->mesa_visual.redBits;
- return 0;
- case GLX_GREEN_SIZE:
- *value = xmvis->mesa_visual.greenBits;
- return 0;
- case GLX_BLUE_SIZE:
- *value = xmvis->mesa_visual.blueBits;
- return 0;
- case GLX_ALPHA_SIZE:
- *value = xmvis->mesa_visual.alphaBits;
- return 0;
- case GLX_DEPTH_SIZE:
- *value = xmvis->mesa_visual.depthBits;
- return 0;
- case GLX_STENCIL_SIZE:
- *value = xmvis->mesa_visual.stencilBits;
- return 0;
- case GLX_ACCUM_RED_SIZE:
- *value = xmvis->mesa_visual.accumRedBits;
- return 0;
- case GLX_ACCUM_GREEN_SIZE:
- *value = xmvis->mesa_visual.accumGreenBits;
- return 0;
- case GLX_ACCUM_BLUE_SIZE:
- *value = xmvis->mesa_visual.accumBlueBits;
- return 0;
- case GLX_ACCUM_ALPHA_SIZE:
- *value = xmvis->mesa_visual.accumAlphaBits;
- return 0;
-
- /*
- * GLX_EXT_visual_info extension
- */
- case GLX_X_VISUAL_TYPE_EXT:
- switch (xmvis->visinfo->CLASS) {
- case StaticGray: *value = GLX_STATIC_GRAY_EXT; return 0;
- case GrayScale: *value = GLX_GRAY_SCALE_EXT; return 0;
- case StaticColor: *value = GLX_STATIC_GRAY_EXT; return 0;
- case PseudoColor: *value = GLX_PSEUDO_COLOR_EXT; return 0;
- case TrueColor: *value = GLX_TRUE_COLOR_EXT; return 0;
- case DirectColor: *value = GLX_DIRECT_COLOR_EXT; return 0;
- }
- return 0;
- case GLX_TRANSPARENT_TYPE_EXT:
- if (xmvis->mesa_visual.level==0) {
- /* normal planes */
- *value = GLX_NONE_EXT;
- }
- else if (xmvis->mesa_visual.level>0) {
- /* overlay */
- if (xmvis->mesa_visual.rgbMode) {
- *value = GLX_TRANSPARENT_RGB_EXT;
- }
- else {
- *value = GLX_TRANSPARENT_INDEX_EXT;
- }
- }
- else if (xmvis->mesa_visual.level<0) {
- /* underlay */
- *value = GLX_NONE_EXT;
- }
- return 0;
- case GLX_TRANSPARENT_INDEX_VALUE_EXT:
- {
- int pixel = transparent_pixel( xmvis );
- if (pixel>=0) {
- *value = pixel;
- }
- /* else undefined */
- }
- return 0;
- case GLX_TRANSPARENT_RED_VALUE_EXT:
- /* undefined */
- return 0;
- case GLX_TRANSPARENT_GREEN_VALUE_EXT:
- /* undefined */
- return 0;
- case GLX_TRANSPARENT_BLUE_VALUE_EXT:
- /* undefined */
- return 0;
- case GLX_TRANSPARENT_ALPHA_VALUE_EXT:
- /* undefined */
- return 0;
-
- /*
- * GLX_EXT_visual_info extension
- */
- case GLX_VISUAL_CAVEAT_EXT:
- /* test for zero, just in case */
- if (xmvis->mesa_visual.visualRating > 0)
- *value = xmvis->mesa_visual.visualRating;
- else
- *value = GLX_NONE_EXT;
- return 0;
-
- /*
- * GLX_ARB_multisample
- */
- case GLX_SAMPLE_BUFFERS_ARB:
- *value = 0;
- return 0;
- case GLX_SAMPLES_ARB:
- *value = 0;
- return 0;
-
- /*
- * For FBConfigs:
- */
- case GLX_SCREEN_EXT:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = xmvis->visinfo->screen;
- break;
- case GLX_DRAWABLE_TYPE: /*SGIX too */
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
- break;
- case GLX_RENDER_TYPE_SGIX:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- if (xmvis->mesa_visual.rgbMode)
- *value = GLX_RGBA_BIT;
- else
- *value = GLX_COLOR_INDEX_BIT;
- break;
- case GLX_X_RENDERABLE_SGIX:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = True; /* XXX really? */
- break;
- case GLX_FBCONFIG_ID_SGIX:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = xmvis->visinfo->visualid;
- break;
- case GLX_MAX_PBUFFER_WIDTH:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- /* XXX or MAX_WIDTH? */
- *value = DisplayWidth(xmvis->display, xmvis->visinfo->screen);
- break;
- case GLX_MAX_PBUFFER_HEIGHT:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = DisplayHeight(xmvis->display, xmvis->visinfo->screen);
- break;
- case GLX_MAX_PBUFFER_PIXELS:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = DisplayWidth(xmvis->display, xmvis->visinfo->screen) *
- DisplayHeight(xmvis->display, xmvis->visinfo->screen);
- break;
- case GLX_VISUAL_ID:
- if (!fbconfig)
- return GLX_BAD_ATTRIBUTE;
- *value = xmvis->visinfo->visualid;
- break;
-
- default:
- return GLX_BAD_ATTRIBUTE;
- }
- return Success;
-}
-
-
-static int
-Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
- int attrib, int *value )
-{
- XMesaVisual xmvis;
- int k;
- if (!dpy || !visinfo)
- return GLX_BAD_ATTRIBUTE;
-
- xmvis = find_glx_visual( dpy, visinfo );
- if (!xmvis) {
- /* this visual wasn't obtained with glXChooseVisual */
- xmvis = create_glx_visual( dpy, visinfo );
- if (!xmvis) {
- /* this visual can't be used for GL rendering */
- if (attrib==GLX_USE_GL) {
- *value = (int) False;
- return 0;
- }
- else {
- return GLX_BAD_VISUAL;
- }
- }
- }
-
- k = get_config(xmvis, attrib, value, GL_FALSE);
- return k;
-}
-
-
-static void
-Fake_glXWaitGL( void )
-{
- XMesaContext xmesa = XMesaGetCurrentContext();
- XMesaFlush( xmesa );
-}
-
-
-
-static void
-Fake_glXWaitX( void )
-{
- XMesaContext xmesa = XMesaGetCurrentContext();
- XMesaFlush( xmesa );
-}
-
-
-static const char *
-get_extensions( void )
-{
-#ifdef FX
- const char *fx = _mesa_getenv("MESA_GLX_FX");
- if (fx && fx[0] != 'd') {
- return EXTENSIONS;
- }
-#endif
- return EXTENSIONS + 23; /* skip "GLX_MESA_set_3dfx_mode" */
-}
-
-
-
-/* GLX 1.1 and later */
-static const char *
-Fake_glXQueryExtensionsString( Display *dpy, int screen )
-{
- (void) dpy;
- (void) screen;
- return get_extensions();
-}
-
-
-
-/* GLX 1.1 and later */
-static const char *
-Fake_glXQueryServerString( Display *dpy, int screen, int name )
-{
- static char version[1000];
- _mesa_sprintf(version, "%d.%d %s",
- SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
-
- (void) dpy;
- (void) screen;
-
- switch (name) {
- case GLX_EXTENSIONS:
- return get_extensions();
- case GLX_VENDOR:
- return VENDOR;
- case GLX_VERSION:
- return version;
- default:
- return NULL;
- }
-}
-
-
-
-/* GLX 1.1 and later */
-static const char *
-Fake_glXGetClientString( Display *dpy, int name )
-{
- static char version[1000];
- _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
- CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
-
- (void) dpy;
-
- switch (name) {
- case GLX_EXTENSIONS:
- return get_extensions();
- case GLX_VENDOR:
- return VENDOR;
- case GLX_VERSION:
- return version;
- default:
- return NULL;
- }
-}
-
-
-
-/*
- * GLX 1.3 and later
- */
-
-
-static int
-Fake_glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
- int attribute, int *value )
-{
- XMesaVisual v = (XMesaVisual) config;
- (void) dpy;
- (void) config;
-
- if (!dpy || !config || !value)
- return -1;
-
- return get_config(v, attribute, value, GL_TRUE);
-}
-
-
-static GLXFBConfig *
-Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements )
-{
- XVisualInfo *visuals, visTemplate;
- const long visMask = VisualScreenMask;
- int i;
-
- /* Get list of all X visuals */
- visTemplate.screen = screen;
- visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements);
- if (*nelements > 0) {
- XMesaVisual *results;
- results = (XMesaVisual *) _mesa_malloc(*nelements * sizeof(XMesaVisual));
- if (!results) {
- *nelements = 0;
- return NULL;
- }
- for (i = 0; i < *nelements; i++) {
- results[i] = create_glx_visual(dpy, visuals + i);
- }
- return (GLXFBConfig *) results;
- }
- return NULL;
-}
-
-
-static GLXFBConfig *
-Fake_glXChooseFBConfig( Display *dpy, int screen,
- const int *attribList, int *nitems )
-{
- XMesaVisual xmvis;
-
- if (!attribList || !attribList[0]) {
- /* return list of all configs (per GLX_SGIX_fbconfig spec) */
- return Fake_glXGetFBConfigs(dpy, screen, nitems);
- }
-
- xmvis = choose_visual(dpy, screen, attribList, GL_TRUE);
- if (xmvis) {
- GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual));
- if (!config) {
- *nitems = 0;
- return NULL;
- }
- *nitems = 1;
- config[0] = (GLXFBConfig) xmvis;
- return (GLXFBConfig *) config;
- }
- else {
- *nitems = 0;
- return NULL;
- }
-}
-
-
-static XVisualInfo *
-Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
-{
- if (dpy && config) {
- XMesaVisual xmvis = (XMesaVisual) config;
-#if 0
- return xmvis->vishandle;
-#else
- /* create a new vishandle - the cached one may be stale */
- xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo));
- if (xmvis->vishandle) {
- _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo));
- }
- return xmvis->vishandle;
-#endif
- }
- else {
- return NULL;
- }
-}
-
-
-static GLXWindow
-Fake_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win,
- const int *attribList )
-{
- XMesaVisual xmvis = (XMesaVisual) config;
- XMesaBuffer xmbuf;
- if (!xmvis)
- return 0;
-
- xmbuf = XMesaCreateWindowBuffer2(xmvis, win, NULL);
- if (!xmbuf)
- return 0;
-
- (void) dpy;
- (void) attribList; /* Ignored in GLX 1.3 */
-
- return win; /* A hack for now */
-}
-
-
-static void
-Fake_glXDestroyWindow( Display *dpy, GLXWindow window )
-{
- XMesaBuffer b = XMesaFindBuffer(dpy, (XMesaDrawable) window);
- if (b)
- XMesaDestroyBuffer(b);
- /* don't destroy X window */
-}
-
-
-/* XXX untested */
-static GLXPixmap
-Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
- const int *attribList )
-{
- XMesaVisual v = (XMesaVisual) config;
- XMesaBuffer b;
-
- (void) dpy;
- (void) config;
- (void) pixmap;
- (void) attribList; /* Ignored in GLX 1.3 */
-
- if (!dpy || !config || !pixmap)
- return 0;
-
- b = XMesaCreatePixmapBuffer( v, pixmap, 0 );
- if (!b) {
- return 0;
- }
-
- return pixmap;
-}
-
-
-static void
-Fake_glXDestroyPixmap( Display *dpy, GLXPixmap pixmap )
-{
- XMesaBuffer b = XMesaFindBuffer(dpy, (XMesaDrawable)pixmap);
- if (b)
- XMesaDestroyBuffer(b);
- /* don't destroy X pixmap */
-}
-
-
-static GLXPbuffer
-Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
- const int *attribList )
-{
- XMesaVisual xmvis = (XMesaVisual) config;
- XMesaBuffer xmbuf;
- const int *attrib;
- int width = 0, height = 0;
- GLboolean useLargest = GL_FALSE, preserveContents = GL_FALSE;
-
- (void) dpy;
-
- for (attrib = attribList; *attrib; attrib++) {
- switch (*attrib) {
- case GLX_PBUFFER_WIDTH:
- attrib++;
- width = *attrib;
- break;
- case GLX_PBUFFER_HEIGHT:
- attrib++;
- height = *attrib;
- break;
- case GLX_PRESERVED_CONTENTS:
- attrib++;
- preserveContents = *attrib; /* ignored */
- break;
- case GLX_LARGEST_PBUFFER:
- attrib++;
- useLargest = *attrib; /* ignored */
- break;
- default:
- return 0;
- }
- }
-
- /* not used at this time */
- (void) useLargest;
- (void) preserveContents;
-
- if (width == 0 || height == 0)
- return 0;
-
- xmbuf = XMesaCreatePBuffer( xmvis, 0, width, height);
- /* A GLXPbuffer handle must be an X Drawable because that's what
- * glXMakeCurrent takes.
- */
- if (xmbuf)
- return (GLXPbuffer) xmbuf->frontxrb->pixmap;
- else
- return 0;
-}
-
-
-static void
-Fake_glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf )
-{
- XMesaBuffer b = XMesaFindBuffer(dpy, pbuf);
- if (b) {
- XMesaDestroyBuffer(b);
- }
-}
-
-
-static void
-Fake_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
- unsigned int *value )
-{
- XMesaBuffer xmbuf = XMesaFindBuffer(dpy, draw);
- if (!xmbuf)
- return;
-
- switch (attribute) {
- case GLX_WIDTH:
- *value = xmbuf->mesa_buffer.Width;
- break;
- case GLX_HEIGHT:
- *value = xmbuf->mesa_buffer.Height;
- break;
- case GLX_PRESERVED_CONTENTS:
- *value = True;
- break;
- case GLX_LARGEST_PBUFFER:
- *value = xmbuf->mesa_buffer.Width * xmbuf->mesa_buffer.Height;
- break;
- case GLX_FBCONFIG_ID:
- *value = xmbuf->xm_visual->visinfo->visualid;
- return;
- default:
- return; /* GLX_BAD_ATTRIBUTE? */
- }
-}
-
-
-static GLXContext
-Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config,
- int renderType, GLXContext shareList, Bool direct )
-{
- struct fake_glx_context *glxCtx;
- struct fake_glx_context *shareCtx = (struct fake_glx_context *) shareList;
- XMesaVisual xmvis = (XMesaVisual) config;
-
- if (!dpy || !config ||
- (renderType != GLX_RGBA_TYPE && renderType != GLX_COLOR_INDEX_TYPE))
- return 0;
-
- glxCtx = CALLOC_STRUCT(fake_glx_context);
- if (!glxCtx)
- return 0;
-
- /* deallocate unused windows/buffers */
- XMesaGarbageCollect();
-
- glxCtx->xmesaContext = XMesaCreateContext(xmvis,
- shareCtx ? shareCtx->xmesaContext : NULL);
- if (!glxCtx->xmesaContext) {
- FREE(glxCtx);
- return NULL;
- }
-
- glxCtx->xmesaContext->direct = GL_FALSE;
- glxCtx->glxContext.isDirect = GL_FALSE;
- glxCtx->glxContext.currentDpy = dpy;
- glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */
-
- assert((void *) glxCtx == (void *) &(glxCtx->glxContext));
-
- return (GLXContext) glxCtx;
-}
-
-
-static int
-Fake_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value )
-{
- struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx;
- XMesaContext xmctx = glxCtx->xmesaContext;
-
- (void) dpy;
- (void) ctx;
-
- switch (attribute) {
- case GLX_FBCONFIG_ID:
- *value = xmctx->xm_visual->visinfo->visualid;
- break;
- case GLX_RENDER_TYPE:
- if (xmctx->xm_visual->mesa_visual.rgbMode)
- *value = GLX_RGBA_BIT;
- else
- *value = GLX_COLOR_INDEX_BIT;
- break;
- case GLX_SCREEN:
- *value = 0;
- return Success;
- default:
- return GLX_BAD_ATTRIBUTE;
- }
- return 0;
-}
-
-
-static void
-Fake_glXSelectEvent( Display *dpy, GLXDrawable drawable, unsigned long mask )
-{
- XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
- if (xmbuf)
- xmbuf->selectedEvents = mask;
-}
-
-
-static void
-Fake_glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
- unsigned long *mask )
-{
- XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
- if (xmbuf)
- *mask = xmbuf->selectedEvents;
- else
- *mask = 0;
-}
-
-
-
-/*** GLX_SGI_swap_control ***/
-
-static int
-Fake_glXSwapIntervalSGI(int interval)
-{
- (void) interval;
- return 0;
-}
-
-
-
-/*** GLX_SGI_video_sync ***/
-
-static int
-Fake_glXGetVideoSyncSGI(unsigned int *count)
-{
- (void) count;
- return 0;
-}
-
-static int
-Fake_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
-{
- (void) divisor;
- (void) remainder;
- (void) count;
- return 0;
-}
-
-
-
-/*** GLX_SGI_make_current_read ***/
-
-static Bool
-Fake_glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
-{
- return Fake_glXMakeContextCurrent( dpy, draw, read, ctx );
-}
-
-/* not used
-static GLXDrawable
-Fake_glXGetCurrentReadDrawableSGI(void)
-{
- return 0;
-}
-*/
-
-
-/*** GLX_SGIX_video_source ***/
-#if defined(_VL_H)
-
-static GLXVideoSourceSGIX
-Fake_glXCreateGLXVideoSourceSGIX(Display *dpy, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode)
-{
- (void) dpy;
- (void) screen;
- (void) server;
- (void) path;
- (void) nodeClass;
- (void) drainNode;
- return 0;
-}
-
-static void
-Fake_glXDestroyGLXVideoSourceSGIX(Display *dpy, GLXVideoSourceSGIX src)
-{
- (void) dpy;
- (void) src;
-}
-
-#endif
-
-
-/*** GLX_EXT_import_context ***/
-
-static void
-Fake_glXFreeContextEXT(Display *dpy, GLXContext context)
-{
- (void) dpy;
- (void) context;
-}
-
-static GLXContextID
-Fake_glXGetContextIDEXT(const GLXContext context)
-{
- (void) context;
- return 0;
-}
-
-static GLXContext
-Fake_glXImportContextEXT(Display *dpy, GLXContextID contextID)
-{
- (void) dpy;
- (void) contextID;
- return 0;
-}
-
-static int
-Fake_glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute, int *value)
-{
- (void) dpy;
- (void) context;
- (void) attribute;
- (void) value;
- return 0;
-}
-
-
-
-/*** GLX_SGIX_fbconfig ***/
-
-static int
-Fake_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
-{
- return Fake_glXGetFBConfigAttrib(dpy, config, attribute, value);
-}
-
-static GLXFBConfigSGIX *
-Fake_glXChooseFBConfigSGIX(Display *dpy, int screen, int *attrib_list, int *nelements)
-{
- return (GLXFBConfig *) Fake_glXChooseFBConfig(dpy, screen, attrib_list, nelements);
-}
-
-
-static GLXPixmap
-Fake_glXCreateGLXPixmapWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap)
-{
- XMesaVisual xmvis = (XMesaVisual) config;
- XMesaBuffer xmbuf = XMesaCreatePixmapBuffer(xmvis, pixmap, 0);
- return xmbuf->frontxrb->pixmap; /* need to return an X ID */
-}
-
-
-static GLXContext
-Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
-{
- XMesaVisual xmvis = (XMesaVisual) config;
- struct fake_glx_context *glxCtx;
- struct fake_glx_context *shareCtx = (struct fake_glx_context *) share_list;
-
- glxCtx = CALLOC_STRUCT(fake_glx_context);
- if (!glxCtx)
- return 0;
-
- /* deallocate unused windows/buffers */
- XMesaGarbageCollect();
-
- glxCtx->xmesaContext = XMesaCreateContext(xmvis,
- shareCtx ? shareCtx->xmesaContext : NULL);
- if (!glxCtx->xmesaContext) {
- FREE(glxCtx);
- return NULL;
- }
-
- glxCtx->xmesaContext->direct = GL_FALSE;
- glxCtx->glxContext.isDirect = GL_FALSE;
- glxCtx->glxContext.currentDpy = dpy;
- glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */
-
- assert((void *) glxCtx == (void *) &(glxCtx->glxContext));
-
- return (GLXContext) glxCtx;
-}
-
-
-static XVisualInfo *
-Fake_glXGetVisualFromFBConfigSGIX(Display *dpy, GLXFBConfigSGIX config)
-{
- return Fake_glXGetVisualFromFBConfig(dpy, config);
-}
-
-
-static GLXFBConfigSGIX
-Fake_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis)
-{
- XMesaVisual xmvis = find_glx_visual(dpy, vis);
- if (!xmvis) {
- /* This visual wasn't found with glXChooseVisual() */
- xmvis = create_glx_visual(dpy, vis);
- }
-
- return (GLXFBConfigSGIX) xmvis;
-}
-
-
-
-/*** GLX_SGIX_pbuffer ***/
-
-static GLXPbufferSGIX
-Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config,
- unsigned int width, unsigned int height,
- int *attribList)
-{
- XMesaVisual xmvis = (XMesaVisual) config;
- XMesaBuffer xmbuf;
- const int *attrib;
- GLboolean useLargest = GL_FALSE, preserveContents = GL_FALSE;
-
- (void) dpy;
-
- for (attrib = attribList; attrib && *attrib; attrib++) {
- switch (*attrib) {
- case GLX_PRESERVED_CONTENTS_SGIX:
- attrib++;
- preserveContents = *attrib; /* ignored */
- break;
- case GLX_LARGEST_PBUFFER_SGIX:
- attrib++;
- useLargest = *attrib; /* ignored */
- break;
- default:
- return 0;
- }
- }
-
- /* not used at this time */
- (void) useLargest;
- (void) preserveContents;
-
- xmbuf = XMesaCreatePBuffer( xmvis, 0, width, height);
- /* A GLXPbuffer handle must be an X Drawable because that's what
- * glXMakeCurrent takes.
- */
- return (GLXPbuffer) xmbuf->frontxrb->pixmap;
-}
-
-
-static void
-Fake_glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf)
-{
- XMesaBuffer xmbuf = XMesaFindBuffer(dpy, pbuf);
- if (xmbuf) {
- XMesaDestroyBuffer(xmbuf);
- }
-}
-
-
-static int
-Fake_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value)
-{
- const XMesaBuffer xmbuf = XMesaFindBuffer(dpy, pbuf);
-
- if (!xmbuf) {
- /* Generate GLXBadPbufferSGIX for bad pbuffer */
- return 0;
- }
-
- switch (attribute) {
- case GLX_PRESERVED_CONTENTS_SGIX:
- *value = True;
- break;
- case GLX_LARGEST_PBUFFER_SGIX:
- *value = xmbuf->mesa_buffer.Width * xmbuf->mesa_buffer.Height;
- break;
- case GLX_WIDTH_SGIX:
- *value = xmbuf->mesa_buffer.Width;
- break;
- case GLX_HEIGHT_SGIX:
- *value = xmbuf->mesa_buffer.Height;
- break;
- case GLX_EVENT_MASK_SGIX:
- *value = 0; /* XXX might be wrong */
- break;
- default:
- *value = 0;
- }
- return 0;
-}
-
-
-static void
-Fake_glXSelectEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long mask)
-{
- XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
- if (xmbuf) {
- /* Note: we'll never generate clobber events */
- xmbuf->selectedEvents = mask;
- }
-}
-
-
-static void
-Fake_glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long *mask)
-{
- XMesaBuffer xmbuf = XMesaFindBuffer(dpy, drawable);
- if (xmbuf) {
- *mask = xmbuf->selectedEvents;
- }
- else {
- *mask = 0;
- }
-}
-
-
-
-/*** GLX_SGI_cushion ***/
-
-static void
-Fake_glXCushionSGI(Display *dpy, Window win, float cushion)
-{
- (void) dpy;
- (void) win;
- (void) cushion;
-}
-
-
-
-/*** GLX_SGIX_video_resize ***/
-
-static int
-Fake_glXBindChannelToWindowSGIX(Display *dpy, int screen, int channel , Window window)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) window;
- return 0;
-}
-
-static int
-Fake_glXChannelRectSGIX(Display *dpy, int screen, int channel, int x, int y, int w, int h)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) x;
- (void) y;
- (void) w;
- (void) h;
- return 0;
-}
-
-static int
-Fake_glXQueryChannelRectSGIX(Display *dpy, int screen, int channel, int *x, int *y, int *w, int *h)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) x;
- (void) y;
- (void) w;
- (void) h;
- return 0;
-}
-
-static int
-Fake_glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel, int *dx, int *dy, int *dw, int *dh)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) dx;
- (void) dy;
- (void) dw;
- (void) dh;
- return 0;
-}
-
-static int
-Fake_glXChannelRectSyncSGIX(Display *dpy, int screen, int channel, GLenum synctype)
-{
- (void) dpy;
- (void) screen;
- (void) channel;
- (void) synctype;
- return 0;
-}
-
-
-
-/*** GLX_SGIX_dmbuffer **/
-
-#if defined(_DM_BUFFER_H_)
-static Bool
-Fake_glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer)
-{
- (void) dpy;
- (void) pbuffer;
- (void) params;
- (void) dmbuffer;
- return False;
-}
-#endif
-
-
-/*** GLX_SGIX_swap_group ***/
-
-static void
-Fake_glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member)
-{
- (void) dpy;
- (void) drawable;
- (void) member;
-}
-
-
-
-/*** GLX_SGIX_swap_barrier ***/
-
-static void
-Fake_glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier)
-{
- (void) dpy;
- (void) drawable;
- (void) barrier;
-}
-
-static Bool
-Fake_glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max)
-{
- (void) dpy;
- (void) screen;
- (void) max;
- return False;
-}
-
-
-
-/*** GLX_SUN_get_transparent_index ***/
-
-static Status
-Fake_glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent)
-{
- (void) dpy;
- (void) overlay;
- (void) underlay;
- (void) pTransparent;
- return 0;
-}
-
-
-
-/*** GLX_MESA_release_buffers ***/
-
-/*
- * Release the depth, stencil, accum buffers attached to a GLXDrawable
- * (a window or pixmap) prior to destroying the GLXDrawable.
- */
-static Bool
-Fake_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d )
-{
- XMesaBuffer b = XMesaFindBuffer(dpy, d);
- if (b) {
- XMesaDestroyBuffer(b);
- return True;
- }
- return False;
-}
-
-
-
-/*** GLX_MESA_set_3dfx_mode ***/
-
-static Bool
-Fake_glXSet3DfxModeMESA( int mode )
-{
- return XMesaSetFXmode( mode );
-}
-
-
-
-/*** GLX_NV_vertex_array range ***/
-static void *
-Fake_glXAllocateMemoryNV( GLsizei size,
- GLfloat readFrequency,
- GLfloat writeFrequency,
- GLfloat priority )
-{
- (void) size;
- (void) readFrequency;
- (void) writeFrequency;
- (void) priority;
- return NULL;
-}
-
-
-static void
-Fake_glXFreeMemoryNV( GLvoid *pointer )
-{
- (void) pointer;
-}
-
-
-/*** GLX_MESA_agp_offset ***/
-
-static GLuint
-Fake_glXGetAGPOffsetMESA( const GLvoid *pointer )
-{
- (void) pointer;
- return ~0;
-}
-
-
-/* silence warning */
-extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void);
-
-
-/**
- * Create a new GLX API dispatch table with its function pointers
- * initialized to point to Mesa's "fake" GLX API functions.
- * Note: there's a similar function (_real_GetGLXDispatchTable) that
- * returns a new dispatch table with all pointers initalized to point
- * to "real" GLX functions (which understand GLX wire protocol, etc).
- */
-struct _glxapi_table *
-_mesa_GetGLXDispatchTable(void)
-{
- static struct _glxapi_table glx;
-
- /* be sure our dispatch table size <= libGL's table */
- {
- GLuint size = sizeof(struct _glxapi_table) / sizeof(void *);
- (void) size;
- assert(_glxapi_get_dispatch_table_size() >= size);
- }
-
- /* initialize the whole table to no-ops */
- _glxapi_set_no_op_table(&glx);
-
- /* now initialize the table with the functions I implement */
- glx.ChooseVisual = Fake_glXChooseVisual;
- glx.CopyContext = Fake_glXCopyContext;
- glx.CreateContext = Fake_glXCreateContext;
- glx.CreateGLXPixmap = Fake_glXCreateGLXPixmap;
- glx.DestroyContext = Fake_glXDestroyContext;
- glx.DestroyGLXPixmap = Fake_glXDestroyGLXPixmap;
- glx.GetConfig = Fake_glXGetConfig;
- /*glx.GetCurrentContext = Fake_glXGetCurrentContext;*/
- /*glx.GetCurrentDrawable = Fake_glXGetCurrentDrawable;*/
- glx.IsDirect = Fake_glXIsDirect;
- glx.MakeCurrent = Fake_glXMakeCurrent;
- glx.QueryExtension = Fake_glXQueryExtension;
- glx.QueryVersion = Fake_glXQueryVersion;
- glx.SwapBuffers = Fake_glXSwapBuffers;
- glx.UseXFont = Fake_glXUseXFont;
- glx.WaitGL = Fake_glXWaitGL;
- glx.WaitX = Fake_glXWaitX;
-
- /*** GLX_VERSION_1_1 ***/
- glx.GetClientString = Fake_glXGetClientString;
- glx.QueryExtensionsString = Fake_glXQueryExtensionsString;
- glx.QueryServerString = Fake_glXQueryServerString;
-
- /*** GLX_VERSION_1_2 ***/
- /*glx.GetCurrentDisplay = Fake_glXGetCurrentDisplay;*/
-
- /*** GLX_VERSION_1_3 ***/
- glx.ChooseFBConfig = Fake_glXChooseFBConfig;
- glx.CreateNewContext = Fake_glXCreateNewContext;
- glx.CreatePbuffer = Fake_glXCreatePbuffer;
- glx.CreatePixmap = Fake_glXCreatePixmap;
- glx.CreateWindow = Fake_glXCreateWindow;
- glx.DestroyPbuffer = Fake_glXDestroyPbuffer;
- glx.DestroyPixmap = Fake_glXDestroyPixmap;
- glx.DestroyWindow = Fake_glXDestroyWindow;
- /*glx.GetCurrentReadDrawable = Fake_glXGetCurrentReadDrawable;*/
- glx.GetFBConfigAttrib = Fake_glXGetFBConfigAttrib;
- glx.GetFBConfigs = Fake_glXGetFBConfigs;
- glx.GetSelectedEvent = Fake_glXGetSelectedEvent;
- glx.GetVisualFromFBConfig = Fake_glXGetVisualFromFBConfig;
- glx.MakeContextCurrent = Fake_glXMakeContextCurrent;
- glx.QueryContext = Fake_glXQueryContext;
- glx.QueryDrawable = Fake_glXQueryDrawable;
- glx.SelectEvent = Fake_glXSelectEvent;
-
- /*** GLX_SGI_swap_control ***/
- glx.SwapIntervalSGI = Fake_glXSwapIntervalSGI;
-
- /*** GLX_SGI_video_sync ***/
- glx.GetVideoSyncSGI = Fake_glXGetVideoSyncSGI;
- glx.WaitVideoSyncSGI = Fake_glXWaitVideoSyncSGI;
-
- /*** GLX_SGI_make_current_read ***/
- glx.MakeCurrentReadSGI = Fake_glXMakeCurrentReadSGI;
- /*glx.GetCurrentReadDrawableSGI = Fake_glXGetCurrentReadDrawableSGI;*/
-
-/*** GLX_SGIX_video_source ***/
-#if defined(_VL_H)
- glx.CreateGLXVideoSourceSGIX = Fake_glXCreateGLXVideoSourceSGIX;
- glx.DestroyGLXVideoSourceSGIX = Fake_glXDestroyGLXVideoSourceSGIX;
-#endif
-
- /*** GLX_EXT_import_context ***/
- glx.FreeContextEXT = Fake_glXFreeContextEXT;
- glx.GetContextIDEXT = Fake_glXGetContextIDEXT;
- /*glx.GetCurrentDisplayEXT = Fake_glXGetCurrentDisplayEXT;*/
- glx.ImportContextEXT = Fake_glXImportContextEXT;
- glx.QueryContextInfoEXT = Fake_glXQueryContextInfoEXT;
-
- /*** GLX_SGIX_fbconfig ***/
- glx.GetFBConfigAttribSGIX = Fake_glXGetFBConfigAttribSGIX;
- glx.ChooseFBConfigSGIX = Fake_glXChooseFBConfigSGIX;
- glx.CreateGLXPixmapWithConfigSGIX = Fake_glXCreateGLXPixmapWithConfigSGIX;
- glx.CreateContextWithConfigSGIX = Fake_glXCreateContextWithConfigSGIX;
- glx.GetVisualFromFBConfigSGIX = Fake_glXGetVisualFromFBConfigSGIX;
- glx.GetFBConfigFromVisualSGIX = Fake_glXGetFBConfigFromVisualSGIX;
-
- /*** GLX_SGIX_pbuffer ***/
- glx.CreateGLXPbufferSGIX = Fake_glXCreateGLXPbufferSGIX;
- glx.DestroyGLXPbufferSGIX = Fake_glXDestroyGLXPbufferSGIX;
- glx.QueryGLXPbufferSGIX = Fake_glXQueryGLXPbufferSGIX;
- glx.SelectEventSGIX = Fake_glXSelectEventSGIX;
- glx.GetSelectedEventSGIX = Fake_glXGetSelectedEventSGIX;
-
- /*** GLX_SGI_cushion ***/
- glx.CushionSGI = Fake_glXCushionSGI;
-
- /*** GLX_SGIX_video_resize ***/
- glx.BindChannelToWindowSGIX = Fake_glXBindChannelToWindowSGIX;
- glx.ChannelRectSGIX = Fake_glXChannelRectSGIX;
- glx.QueryChannelRectSGIX = Fake_glXQueryChannelRectSGIX;
- glx.QueryChannelDeltasSGIX = Fake_glXQueryChannelDeltasSGIX;
- glx.ChannelRectSyncSGIX = Fake_glXChannelRectSyncSGIX;
-
- /*** GLX_SGIX_dmbuffer **/
-#if defined(_DM_BUFFER_H_)
- glx.AssociateDMPbufferSGIX = NULL;
-#endif
-
- /*** GLX_SGIX_swap_group ***/
- glx.JoinSwapGroupSGIX = Fake_glXJoinSwapGroupSGIX;
-
- /*** GLX_SGIX_swap_barrier ***/
- glx.BindSwapBarrierSGIX = Fake_glXBindSwapBarrierSGIX;
- glx.QueryMaxSwapBarriersSGIX = Fake_glXQueryMaxSwapBarriersSGIX;
-
- /*** GLX_SUN_get_transparent_index ***/
- glx.GetTransparentIndexSUN = Fake_glXGetTransparentIndexSUN;
-
- /*** GLX_MESA_copy_sub_buffer ***/
- glx.CopySubBufferMESA = Fake_glXCopySubBufferMESA;
-
- /*** GLX_MESA_release_buffers ***/
- glx.ReleaseBuffersMESA = Fake_glXReleaseBuffersMESA;
-
- /*** GLX_MESA_pixmap_colormap ***/
- glx.CreateGLXPixmapMESA = Fake_glXCreateGLXPixmapMESA;
-
- /*** GLX_MESA_set_3dfx_mode ***/
- glx.Set3DfxModeMESA = Fake_glXSet3DfxModeMESA;
-
- /*** GLX_NV_vertex_array_range ***/
- glx.AllocateMemoryNV = Fake_glXAllocateMemoryNV;
- glx.FreeMemoryNV = Fake_glXFreeMemoryNV;
-
- /*** GLX_MESA_agp_offset ***/
- glx.GetAGPOffsetMESA = Fake_glXGetAGPOffsetMESA;
-
- return &glx;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.c b/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.c
deleted file mode 100644
index 69af99730..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.c
+++ /dev/null
@@ -1,1348 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * This is the GLX API dispatcher. Calls to the glX* functions are
- * either routed to the real GLX encoders or to Mesa's pseudo-GLX functions.
- * See the glxapi.h file for more details.
- */
-
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "glheader.h"
-#include "glapi.h"
-#include "glxapi.h"
-
-
-extern struct _glxapi_table *_real_GetGLXDispatchTable(void);
-extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void);
-
-
-struct display_dispatch {
- Display *Dpy;
- struct _glxapi_table *Table;
- struct display_dispatch *Next;
-};
-
-static struct display_dispatch *DispatchList = NULL;
-
-
-/* Display -> Dispatch caching */
-static Display *prevDisplay = NULL;
-static struct _glxapi_table *prevTable = NULL;
-
-
-static struct _glxapi_table *
-get_dispatch(Display *dpy)
-{
- if (!dpy)
- return NULL;
-
- /* search list of display/dispatch pairs for this display */
- {
- const struct display_dispatch *d = DispatchList;
- while (d) {
- if (d->Dpy == dpy) {
- prevDisplay = dpy;
- prevTable = d->Table;
- return d->Table; /* done! */
- }
- d = d->Next;
- }
- }
-
- /* A new display, determine if we should use real GLX
- * or Mesa's pseudo-GLX.
- */
- {
- struct _glxapi_table *t = _mesa_GetGLXDispatchTable();
-
- if (t) {
- struct display_dispatch *d;
- d = (struct display_dispatch *) malloc(sizeof(struct display_dispatch));
- if (d) {
- d->Dpy = dpy;
- d->Table = t;
- /* insert at head of list */
- d->Next = DispatchList;
- DispatchList = d;
- /* update cache */
- prevDisplay = dpy;
- prevTable = t;
- return t;
- }
- }
- }
-
- /* If we get here that means we can't use real GLX on this display
- * and the Mesa pseudo-GLX software renderer wasn't compiled in.
- * Or, we ran out of memory!
- */
- return NULL;
-}
-
-
-#define GET_DISPATCH(DPY, TABLE) \
- if (DPY == prevDisplay) { \
- TABLE = prevTable; \
- } \
- else if (!DPY) { \
- TABLE = NULL; \
- } \
- else { \
- TABLE = get_dispatch(DPY); \
- }
-
-
-
-
-/* Set by glXMakeCurrent() and glXMakeContextCurrent() only */
-static GLXContext CurrentContext = 0;
-#define __glXGetCurrentContext() CurrentContext;
-
-
-/*
- * GLX API entrypoints
- */
-
-/*** GLX_VERSION_1_0 ***/
-
-XVisualInfo PUBLIC *
-glXChooseVisual(Display *dpy, int screen, int *list)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return (t->ChooseVisual)(dpy, screen, list);
-}
-
-
-void PUBLIC
-glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->CopyContext)(dpy, src, dst, mask);
-}
-
-
-GLXContext PUBLIC
-glXCreateContext(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateContext)(dpy, visinfo, shareList, direct);
-}
-
-
-GLXPixmap PUBLIC
-glXCreateGLXPixmap(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateGLXPixmap)(dpy, visinfo, pixmap);
-}
-
-
-void PUBLIC
-glXDestroyContext(Display *dpy, GLXContext ctx)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->DestroyContext)(dpy, ctx);
-}
-
-
-void PUBLIC
-glXDestroyGLXPixmap(Display *dpy, GLXPixmap pixmap)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->DestroyGLXPixmap)(dpy, pixmap);
-}
-
-
-int PUBLIC
-glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return GLX_NO_EXTENSION;
- return (t->GetConfig)(dpy, visinfo, attrib, value);
-}
-
-
-GLXContext PUBLIC
-glXGetCurrentContext(void)
-{
- return CurrentContext;
-}
-
-
-GLXDrawable PUBLIC
-glXGetCurrentDrawable(void)
-{
- __GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
- return gc ? gc->currentDrawable : 0;
-}
-
-
-Bool PUBLIC
-glXIsDirect(Display *dpy, GLXContext ctx)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (t->IsDirect)(dpy, ctx);
-}
-
-
-Bool PUBLIC
-glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
-{
- Bool b;
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t) {
- return False;
- }
- b = (*t->MakeCurrent)(dpy, drawable, ctx);
- if (b) {
- CurrentContext = ctx;
- }
- return b;
-}
-
-
-Bool PUBLIC
-glXQueryExtension(Display *dpy, int *errorb, int *event)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (t->QueryExtension)(dpy, errorb, event);
-}
-
-
-Bool PUBLIC
-glXQueryVersion(Display *dpy, int *maj, int *min)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (t->QueryVersion)(dpy, maj, min);
-}
-
-
-void PUBLIC
-glXSwapBuffers(Display *dpy, GLXDrawable drawable)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->SwapBuffers)(dpy, drawable);
-}
-
-
-void PUBLIC
-glXUseXFont(Font font, int first, int count, int listBase)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->UseXFont)(font, first, count, listBase);
-}
-
-
-void PUBLIC
-glXWaitGL(void)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->WaitGL)();
-}
-
-
-void PUBLIC
-glXWaitX(void)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->WaitX)();
-}
-
-
-
-/*** GLX_VERSION_1_1 ***/
-
-const char PUBLIC *
-glXGetClientString(Display *dpy, int name)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return (t->GetClientString)(dpy, name);
-}
-
-
-const char PUBLIC *
-glXQueryExtensionsString(Display *dpy, int screen)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return (t->QueryExtensionsString)(dpy, screen);
-}
-
-
-const char PUBLIC *
-glXQueryServerString(Display *dpy, int screen, int name)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return (t->QueryServerString)(dpy, screen, name);
-}
-
-
-/*** GLX_VERSION_1_2 ***/
-
-Display PUBLIC *
-glXGetCurrentDisplay(void)
-{
- /* Same code as in libGL's glxext.c */
- __GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
- if (NULL == gc) return NULL;
- return gc->currentDpy;
-}
-
-
-
-/*** GLX_VERSION_1_3 ***/
-
-GLXFBConfig PUBLIC *
-glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->ChooseFBConfig)(dpy, screen, attribList, nitems);
-}
-
-
-GLXContext PUBLIC
-glXCreateNewContext(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateNewContext)(dpy, config, renderType, shareList, direct);
-}
-
-
-GLXPbuffer PUBLIC
-glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attribList)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreatePbuffer)(dpy, config, attribList);
-}
-
-
-GLXPixmap PUBLIC
-glXCreatePixmap(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreatePixmap)(dpy, config, pixmap, attribList);
-}
-
-
-GLXWindow PUBLIC
-glXCreateWindow(Display *dpy, GLXFBConfig config, Window win, const int *attribList)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateWindow)(dpy, config, win, attribList);
-}
-
-
-void PUBLIC
-glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->DestroyPbuffer)(dpy, pbuf);
-}
-
-
-void PUBLIC
-glXDestroyPixmap(Display *dpy, GLXPixmap pixmap)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->DestroyPixmap)(dpy, pixmap);
-}
-
-
-void PUBLIC
-glXDestroyWindow(Display *dpy, GLXWindow window)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->DestroyWindow)(dpy, window);
-}
-
-
-GLXDrawable PUBLIC
-glXGetCurrentReadDrawable(void)
-{
- __GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
- return gc ? gc->currentReadable : 0;
-}
-
-
-int PUBLIC
-glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return GLX_NO_EXTENSION;
- return (t->GetFBConfigAttrib)(dpy, config, attribute, value);
-}
-
-
-GLXFBConfig PUBLIC *
-glXGetFBConfigs(Display *dpy, int screen, int *nelements)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->GetFBConfigs)(dpy, screen, nelements);
-}
-
-void PUBLIC
-glXGetSelectedEvent(Display *dpy, GLXDrawable drawable, unsigned long *mask)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->GetSelectedEvent)(dpy, drawable, mask);
-}
-
-
-XVisualInfo PUBLIC *
-glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return (t->GetVisualFromFBConfig)(dpy, config);
-}
-
-
-Bool PUBLIC
-glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
-{
- Bool b;
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- b = (t->MakeContextCurrent)(dpy, draw, read, ctx);
- if (b) {
- CurrentContext = ctx;
- }
- return b;
-}
-
-
-int PUBLIC
-glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- assert(t);
- if (!t)
- return 0; /* XXX correct? */
- return (t->QueryContext)(dpy, ctx, attribute, value);
-}
-
-
-void PUBLIC
-glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->QueryDrawable)(dpy, draw, attribute, value);
-}
-
-
-void PUBLIC
-glXSelectEvent(Display *dpy, GLXDrawable drawable, unsigned long mask)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->SelectEvent)(dpy, drawable, mask);
-}
-
-
-
-/*** GLX_SGI_swap_control ***/
-
-int PUBLIC
-glXSwapIntervalSGI(int interval)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->SwapIntervalSGI)(interval);
-}
-
-
-
-/*** GLX_SGI_video_sync ***/
-
-int PUBLIC
-glXGetVideoSyncSGI(unsigned int *count)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->GetVideoSyncSGI)(count);
-}
-
-int PUBLIC
-glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->WaitVideoSyncSGI)(divisor, remainder, count);
-}
-
-
-
-/*** GLX_SGI_make_current_read ***/
-
-Bool PUBLIC
-glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->MakeCurrentReadSGI)(dpy, draw, read, ctx);
-}
-
-GLXDrawable PUBLIC
-glXGetCurrentReadDrawableSGI(void)
-{
- return glXGetCurrentReadDrawable();
-}
-
-
-#if defined(_VL_H)
-
-GLXVideoSourceSGIX PUBLIC
-glXCreateGLXVideoSourceSGIX(Display *dpy, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateGLXVideoSourceSGIX)(dpy, screen, server, path, nodeClass, drainNode);
-}
-
-void PUBLIC
-glXDestroyGLXVideoSourceSGIX(Display *dpy, GLXVideoSourceSGIX src)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->DestroyGLXVideoSourceSGIX)(dpy, src);
-}
-
-#endif
-
-
-/*** GLX_EXT_import_context ***/
-
-void PUBLIC
-glXFreeContextEXT(Display *dpy, GLXContext context)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->FreeContextEXT)(dpy, context);
-}
-
-GLXContextID PUBLIC
-glXGetContextIDEXT(const GLXContext context)
-{
- return ((__GLXcontext *) context)->xid;
-}
-
-Display PUBLIC *
-glXGetCurrentDisplayEXT(void)
-{
- return glXGetCurrentDisplay();
-}
-
-GLXContext PUBLIC
-glXImportContextEXT(Display *dpy, GLXContextID contextID)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->ImportContextEXT)(dpy, contextID);
-}
-
-int PUBLIC
-glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute,int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0; /* XXX ok? */
- return (t->QueryContextInfoEXT)(dpy, context, attribute, value);
-}
-
-
-
-/*** GLX_SGIX_fbconfig ***/
-
-int PUBLIC
-glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->GetFBConfigAttribSGIX)(dpy, config, attribute, value);
-}
-
-GLXFBConfigSGIX PUBLIC *
-glXChooseFBConfigSGIX(Display *dpy, int screen, int *attrib_list, int *nelements)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->ChooseFBConfigSGIX)(dpy, screen, attrib_list, nelements);
-}
-
-GLXPixmap PUBLIC
-glXCreateGLXPixmapWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateGLXPixmapWithConfigSGIX)(dpy, config, pixmap);
-}
-
-GLXContext PUBLIC
-glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateContextWithConfigSGIX)(dpy, config, render_type, share_list, direct);
-}
-
-XVisualInfo PUBLIC *
-glXGetVisualFromFBConfigSGIX(Display *dpy, GLXFBConfigSGIX config)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->GetVisualFromFBConfigSGIX)(dpy, config);
-}
-
-GLXFBConfigSGIX PUBLIC
-glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->GetFBConfigFromVisualSGIX)(dpy, vis);
-}
-
-
-
-/*** GLX_SGIX_pbuffer ***/
-
-GLXPbufferSGIX PUBLIC
-glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateGLXPbufferSGIX)(dpy, config, width, height, attrib_list);
-}
-
-void PUBLIC
-glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->DestroyGLXPbufferSGIX)(dpy, pbuf);
-}
-
-int PUBLIC
-glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->QueryGLXPbufferSGIX)(dpy, pbuf, attribute, value);
-}
-
-void PUBLIC
-glXSelectEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long mask)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->SelectEventSGIX)(dpy, drawable, mask);
-}
-
-void PUBLIC
-glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long *mask)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->GetSelectedEventSGIX)(dpy, drawable, mask);
-}
-
-
-
-/*** GLX_SGI_cushion ***/
-
-void PUBLIC
-glXCushionSGI(Display *dpy, Window win, float cushion)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->CushionSGI)(dpy, win, cushion);
-}
-
-
-
-/*** GLX_SGIX_video_resize ***/
-
-int PUBLIC
-glXBindChannelToWindowSGIX(Display *dpy, int screen, int channel , Window window)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->BindChannelToWindowSGIX)(dpy, screen, channel, window);
-}
-
-int PUBLIC
-glXChannelRectSGIX(Display *dpy, int screen, int channel, int x, int y, int w, int h)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->ChannelRectSGIX)(dpy, screen, channel, x, y, w, h);
-}
-
-int PUBLIC
-glXQueryChannelRectSGIX(Display *dpy, int screen, int channel, int *x, int *y, int *w, int *h)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->QueryChannelRectSGIX)(dpy, screen, channel, x, y, w, h);
-}
-
-int PUBLIC
-glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel, int *dx, int *dy, int *dw, int *dh)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->QueryChannelDeltasSGIX)(dpy, screen, channel, dx, dy, dw, dh);
-}
-
-int PUBLIC
-glXChannelRectSyncSGIX(Display *dpy, int screen, int channel, GLenum synctype)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->ChannelRectSyncSGIX)(dpy, screen, channel, synctype);
-}
-
-
-
-#if defined(_DM_BUFFER_H_)
-
-Bool PUBLIC
-glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (t->AssociateDMPbufferSGIX)(dpy, pbuffer, params, dmbuffer);
-}
-
-#endif
-
-
-/*** GLX_SGIX_swap_group ***/
-
-void PUBLIC
-glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (*t->JoinSwapGroupSGIX)(dpy, drawable, member);
-}
-
-
-/*** GLX_SGIX_swap_barrier ***/
-
-void PUBLIC
-glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (*t->BindSwapBarrierSGIX)(dpy, drawable, barrier);
-}
-
-Bool PUBLIC
-glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (*t->QueryMaxSwapBarriersSGIX)(dpy, screen, max);
-}
-
-
-
-/*** GLX_SUN_get_transparent_index ***/
-
-Status PUBLIC
-glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (*t->GetTransparentIndexSUN)(dpy, overlay, underlay, pTransparent);
-}
-
-
-
-/*** GLX_MESA_copy_sub_buffer ***/
-
-void PUBLIC
-glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->CopySubBufferMESA)(dpy, drawable, x, y, width, height);
-}
-
-
-
-/*** GLX_MESA_release_buffers ***/
-
-Bool PUBLIC
-glXReleaseBuffersMESA(Display *dpy, Window w)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (t->ReleaseBuffersMESA)(dpy, w);
-}
-
-
-
-/*** GLX_MESA_pixmap_colormap ***/
-
-GLXPixmap PUBLIC
-glXCreateGLXPixmapMESA(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return 0;
- return (t->CreateGLXPixmapMESA)(dpy, visinfo, pixmap, cmap);
-}
-
-
-
-/*** GLX_MESA_set_3dfx_mode ***/
-
-Bool PUBLIC
-glXSet3DfxModeMESA(int mode)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return (t->Set3DfxModeMESA)(mode);
-}
-
-
-
-/*** GLX_NV_vertex_array_range ***/
-
-void PUBLIC *
-glXAllocateMemoryNV( GLsizei size,
- GLfloat readFrequency,
- GLfloat writeFrequency,
- GLfloat priority )
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return (t->AllocateMemoryNV)(size, readFrequency, writeFrequency, priority);
-}
-
-
-void PUBLIC
-glXFreeMemoryNV( GLvoid *pointer )
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- (t->FreeMemoryNV)(pointer);
-}
-
-
-
-
-/*** GLX_MESA_agp_offset */
-
-GLuint PUBLIC
-glXGetAGPOffsetMESA( const GLvoid *pointer )
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return ~0;
- return (t->GetAGPOffsetMESA)(pointer);
-}
-
-
-/*** GLX_MESA_allocate_memory */
-
-void *
-glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size,
- float readfreq, float writefreq, float priority)
-{
- /* dummy */
- return NULL;
-}
-
-void
-glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer)
-{
- /* dummy */
-}
-
-
-GLuint
-glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer)
-{
- /* dummy */
- return 0;
-}
-
-
-
-/**********************************************************************/
-/* GLX API management functions */
-/**********************************************************************/
-
-
-const char *
-_glxapi_get_version(void)
-{
- return "1.3";
-}
-
-
-/*
- * Return array of extension strings.
- */
-const char **
-_glxapi_get_extensions(void)
-{
- static const char *extensions[] = {
-#ifdef GLX_EXT_import_context
- "GLX_EXT_import_context",
-#endif
-#ifdef GLX_SGI_video_sync
- "GLX_SGI_video_sync",
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
- "GLX_MESA_copy_sub_buffer",
-#endif
-#ifdef GLX_MESA_release_buffers
- "GLX_MESA_release_buffers",
-#endif
-#ifdef GLX_MESA_pixmap_colormap
- "GLX_MESA_pixmap_colormap",
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
- "GLX_MESA_set_3dfx_mode",
-#endif
-#ifdef GLX_SGIX_fbconfig
- "GLX_SGIX_fbconfig",
-#endif
-#ifdef GLX_SGIX_pbuffer
- "GLX_SGIX_pbuffer",
-#endif
- NULL
- };
- return extensions;
-}
-
-
-/*
- * Return size of the GLX dispatch table, in entries, not bytes.
- */
-GLuint
-_glxapi_get_dispatch_table_size(void)
-{
- return sizeof(struct _glxapi_table) / sizeof(void *);
-}
-
-
-static int
-generic_no_op_func(void)
-{
- return 0;
-}
-
-
-/*
- * Initialize all functions in given dispatch table to be no-ops
- */
-void
-_glxapi_set_no_op_table(struct _glxapi_table *t)
-{
- typedef int (*nop_func)(void);
- nop_func *dispatch = (nop_func *) t;
- GLuint n = _glxapi_get_dispatch_table_size();
- GLuint i;
- for (i = 0; i < n; i++) {
- dispatch[i] = generic_no_op_func;
- }
-}
-
-
-struct name_address_pair {
- const char *Name;
- __GLXextFuncPtr Address;
-};
-
-static struct name_address_pair GLX_functions[] = {
- /*** GLX_VERSION_1_0 ***/
- { "glXChooseVisual", (__GLXextFuncPtr) glXChooseVisual },
- { "glXCopyContext", (__GLXextFuncPtr) glXCopyContext },
- { "glXCreateContext", (__GLXextFuncPtr) glXCreateContext },
- { "glXCreateGLXPixmap", (__GLXextFuncPtr) glXCreateGLXPixmap },
- { "glXDestroyContext", (__GLXextFuncPtr) glXDestroyContext },
- { "glXDestroyGLXPixmap", (__GLXextFuncPtr) glXDestroyGLXPixmap },
- { "glXGetConfig", (__GLXextFuncPtr) glXGetConfig },
- { "glXGetCurrentContext", (__GLXextFuncPtr) glXGetCurrentContext },
- { "glXGetCurrentDrawable", (__GLXextFuncPtr) glXGetCurrentDrawable },
- { "glXIsDirect", (__GLXextFuncPtr) glXIsDirect },
- { "glXMakeCurrent", (__GLXextFuncPtr) glXMakeCurrent },
- { "glXQueryExtension", (__GLXextFuncPtr) glXQueryExtension },
- { "glXQueryVersion", (__GLXextFuncPtr) glXQueryVersion },
- { "glXSwapBuffers", (__GLXextFuncPtr) glXSwapBuffers },
- { "glXUseXFont", (__GLXextFuncPtr) glXUseXFont },
- { "glXWaitGL", (__GLXextFuncPtr) glXWaitGL },
- { "glXWaitX", (__GLXextFuncPtr) glXWaitX },
-
- /*** GLX_VERSION_1_1 ***/
- { "glXGetClientString", (__GLXextFuncPtr) glXGetClientString },
- { "glXQueryExtensionsString", (__GLXextFuncPtr) glXQueryExtensionsString },
- { "glXQueryServerString", (__GLXextFuncPtr) glXQueryServerString },
-
- /*** GLX_VERSION_1_2 ***/
- { "glXGetCurrentDisplay", (__GLXextFuncPtr) glXGetCurrentDisplay },
-
- /*** GLX_VERSION_1_3 ***/
- { "glXChooseFBConfig", (__GLXextFuncPtr) glXChooseFBConfig },
- { "glXCreateNewContext", (__GLXextFuncPtr) glXCreateNewContext },
- { "glXCreatePbuffer", (__GLXextFuncPtr) glXCreatePbuffer },
- { "glXCreatePixmap", (__GLXextFuncPtr) glXCreatePixmap },
- { "glXCreateWindow", (__GLXextFuncPtr) glXCreateWindow },
- { "glXDestroyPbuffer", (__GLXextFuncPtr) glXDestroyPbuffer },
- { "glXDestroyPixmap", (__GLXextFuncPtr) glXDestroyPixmap },
- { "glXDestroyWindow", (__GLXextFuncPtr) glXDestroyWindow },
- { "glXGetCurrentReadDrawable", (__GLXextFuncPtr) glXGetCurrentReadDrawable },
- { "glXGetFBConfigAttrib", (__GLXextFuncPtr) glXGetFBConfigAttrib },
- { "glXGetFBConfigs", (__GLXextFuncPtr) glXGetFBConfigs },
- { "glXGetSelectedEvent", (__GLXextFuncPtr) glXGetSelectedEvent },
- { "glXGetVisualFromFBConfig", (__GLXextFuncPtr) glXGetVisualFromFBConfig },
- { "glXMakeContextCurrent", (__GLXextFuncPtr) glXMakeContextCurrent },
- { "glXQueryContext", (__GLXextFuncPtr) glXQueryContext },
- { "glXQueryDrawable", (__GLXextFuncPtr) glXQueryDrawable },
- { "glXSelectEvent", (__GLXextFuncPtr) glXSelectEvent },
-
- /*** GLX_VERSION_1_4 ***/
- { "glXGetProcAddress", (__GLXextFuncPtr) glXGetProcAddress },
-
- /*** GLX_SGI_swap_control ***/
- { "glXSwapIntervalSGI", (__GLXextFuncPtr) glXSwapIntervalSGI },
-
- /*** GLX_SGI_video_sync ***/
- { "glXGetVideoSyncSGI", (__GLXextFuncPtr) glXGetVideoSyncSGI },
- { "glXWaitVideoSyncSGI", (__GLXextFuncPtr) glXWaitVideoSyncSGI },
-
- /*** GLX_SGI_make_current_read ***/
- { "glXMakeCurrentReadSGI", (__GLXextFuncPtr) glXMakeCurrentReadSGI },
- { "glXGetCurrentReadDrawableSGI", (__GLXextFuncPtr) glXGetCurrentReadDrawableSGI },
-
- /*** GLX_SGIX_video_source ***/
-#if defined(_VL_H)
- { "glXCreateGLXVideoSourceSGIX", (__GLXextFuncPtr) glXCreateGLXVideoSourceSGIX },
- { "glXDestroyGLXVideoSourceSGIX", (__GLXextFuncPtr) glXDestroyGLXVideoSourceSGIX },
-#endif
-
- /*** GLX_EXT_import_context ***/
- { "glXFreeContextEXT", (__GLXextFuncPtr) glXFreeContextEXT },
- { "glXGetContextIDEXT", (__GLXextFuncPtr) glXGetContextIDEXT },
- { "glXGetCurrentDisplayEXT", (__GLXextFuncPtr) glXGetCurrentDisplayEXT },
- { "glXImportContextEXT", (__GLXextFuncPtr) glXImportContextEXT },
- { "glXQueryContextInfoEXT", (__GLXextFuncPtr) glXQueryContextInfoEXT },
-
- /*** GLX_SGIX_fbconfig ***/
- { "glXGetFBConfigAttribSGIX", (__GLXextFuncPtr) glXGetFBConfigAttribSGIX },
- { "glXChooseFBConfigSGIX", (__GLXextFuncPtr) glXChooseFBConfigSGIX },
- { "glXCreateGLXPixmapWithConfigSGIX", (__GLXextFuncPtr) glXCreateGLXPixmapWithConfigSGIX },
- { "glXCreateContextWithConfigSGIX", (__GLXextFuncPtr) glXCreateContextWithConfigSGIX },
- { "glXGetVisualFromFBConfigSGIX", (__GLXextFuncPtr) glXGetVisualFromFBConfigSGIX },
- { "glXGetFBConfigFromVisualSGIX", (__GLXextFuncPtr) glXGetFBConfigFromVisualSGIX },
-
- /*** GLX_SGIX_pbuffer ***/
- { "glXCreateGLXPbufferSGIX", (__GLXextFuncPtr) glXCreateGLXPbufferSGIX },
- { "glXDestroyGLXPbufferSGIX", (__GLXextFuncPtr) glXDestroyGLXPbufferSGIX },
- { "glXQueryGLXPbufferSGIX", (__GLXextFuncPtr) glXQueryGLXPbufferSGIX },
- { "glXSelectEventSGIX", (__GLXextFuncPtr) glXSelectEventSGIX },
- { "glXGetSelectedEventSGIX", (__GLXextFuncPtr) glXGetSelectedEventSGIX },
-
- /*** GLX_SGI_cushion ***/
- { "glXCushionSGI", (__GLXextFuncPtr) glXCushionSGI },
-
- /*** GLX_SGIX_video_resize ***/
- { "glXBindChannelToWindowSGIX", (__GLXextFuncPtr) glXBindChannelToWindowSGIX },
- { "glXChannelRectSGIX", (__GLXextFuncPtr) glXChannelRectSGIX },
- { "glXQueryChannelRectSGIX", (__GLXextFuncPtr) glXQueryChannelRectSGIX },
- { "glXQueryChannelDeltasSGIX", (__GLXextFuncPtr) glXQueryChannelDeltasSGIX },
- { "glXChannelRectSyncSGIX", (__GLXextFuncPtr) glXChannelRectSyncSGIX },
-
- /*** GLX_SGIX_dmbuffer **/
-#if defined(_DM_BUFFER_H_)
- { "glXAssociateDMPbufferSGIX", (__GLXextFuncPtr) glXAssociateDMPbufferSGIX },
-#endif
-
- /*** GLX_SGIX_swap_group ***/
- { "glXJoinSwapGroupSGIX", (__GLXextFuncPtr) glXJoinSwapGroupSGIX },
-
- /*** GLX_SGIX_swap_barrier ***/
- { "glXBindSwapBarrierSGIX", (__GLXextFuncPtr) glXBindSwapBarrierSGIX },
- { "glXQueryMaxSwapBarriersSGIX", (__GLXextFuncPtr) glXQueryMaxSwapBarriersSGIX },
-
- /*** GLX_SUN_get_transparent_index ***/
- { "glXGetTransparentIndexSUN", (__GLXextFuncPtr) glXGetTransparentIndexSUN },
-
- /*** GLX_MESA_copy_sub_buffer ***/
- { "glXCopySubBufferMESA", (__GLXextFuncPtr) glXCopySubBufferMESA },
-
- /*** GLX_MESA_pixmap_colormap ***/
- { "glXCreateGLXPixmapMESA", (__GLXextFuncPtr) glXCreateGLXPixmapMESA },
-
- /*** GLX_MESA_release_buffers ***/
- { "glXReleaseBuffersMESA", (__GLXextFuncPtr) glXReleaseBuffersMESA },
-
- /*** GLX_MESA_set_3dfx_mode ***/
- { "glXSet3DfxModeMESA", (__GLXextFuncPtr) glXSet3DfxModeMESA },
-
- /*** GLX_ARB_get_proc_address ***/
- { "glXGetProcAddressARB", (__GLXextFuncPtr) glXGetProcAddressARB },
-
- /*** GLX_NV_vertex_array_range ***/
- { "glXAllocateMemoryNV", (__GLXextFuncPtr) glXAllocateMemoryNV },
- { "glXFreeMemoryNV", (__GLXextFuncPtr) glXFreeMemoryNV },
-
- /*** GLX_MESA_agp_offset ***/
- { "glXGetAGPOffsetMESA", (__GLXextFuncPtr) glXGetAGPOffsetMESA },
-
- /*** GLX_MESA_allocate_memory ***/
- { "glXAllocateMemoryMESA", (__GLXextFuncPtr) glXAllocateMemoryMESA },
- { "glXFreeMemoryMESA", (__GLXextFuncPtr) glXFreeMemoryMESA },
- { "glXGetMemoryOffsetMESA", (__GLXextFuncPtr) glXGetMemoryOffsetMESA },
-
- { NULL, NULL } /* end of list */
-};
-
-
-
-/*
- * Return address of named glX function, or NULL if not found.
- */
-__GLXextFuncPtr
-_glxapi_get_proc_address(const char *funcName)
-{
- GLuint i;
- for (i = 0; GLX_functions[i].Name; i++) {
- if (strcmp(GLX_functions[i].Name, funcName) == 0)
- return GLX_functions[i].Address;
- }
- return NULL;
-}
-
-
-
-/*
- * This function does not get dispatched through the dispatch table
- * since it's really a "meta" function.
- */
-__GLXextFuncPtr
-glXGetProcAddressARB(const GLubyte *procName)
-{
- __GLXextFuncPtr f;
-
- f = _glxapi_get_proc_address((const char *) procName);
- if (f) {
- return f;
- }
-
- f = (__GLXextFuncPtr) _glapi_get_proc_address((const char *) procName);
- return f;
-}
-
-
-/* GLX 1.4 */
-void (*glXGetProcAddress(const GLubyte *procName))()
-{
- return glXGetProcAddressARB(procName);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.h
deleted file mode 100644
index 3187534c9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxapi.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef _glxapi_h_
-#define _glxapi_h_
-
-
-#define GLX_GLXEXT_PROTOTYPES
-#include "GL/glx.h"
-
-
-/* The GLX API dispatcher (i.e. this code) is being built into stand-alone
- * Mesa. We don't know anything about XFree86 or real GLX so we define a
- * minimal __GLXContextRec here so some of the functions in this file can
- * work properly.
- */
-typedef struct __GLXcontextRec {
- Display *currentDpy;
- GLboolean isDirect;
- GLXDrawable currentDrawable;
- GLXDrawable currentReadable;
- XID xid;
-} __GLXcontext;
-
-
-/*
- * Almost all the GLX API functions get routed through this dispatch table.
- * The exceptions are the glXGetCurrentXXX() functions.
- *
- * This dispatch table allows multiple GLX client-side modules to coexist.
- * Specifically, a real GLX library (like SGI's or the Utah GLX) and Mesa's
- * pseudo-GLX can be present at the same time. The former being used on
- * GLX-enabled X servers and the later on non-GLX X servers.
- *
- * Red Hat has been using this since Red Hat Linux 7.0 (I think).
- * This'll be a standard feature in XFree86 4.3. It basically allows one
- * libGL to do both DRI-rendering and "fake GLX" rendering to X displays
- * that lack the GLX extension.
- */
-struct _glxapi_table {
- /*** GLX_VERSION_1_0 ***/
- XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list);
- void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
- GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct);
- GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap);
- void (*DestroyContext)(Display *dpy, GLXContext ctx);
- void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
- int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
- /*GLXContext (*GetCurrentContext)(void);*/
- /*GLXDrawable (*GetCurrentDrawable)(void);*/
- Bool (*IsDirect)(Display *dpy, GLXContext ctx);
- Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
- Bool (*QueryExtension)(Display *dpy, int *errorb, int *event);
- Bool (*QueryVersion)(Display *dpy, int *maj, int *min);
- void (*SwapBuffers)(Display *dpy, GLXDrawable drawable);
- void (*UseXFont)(Font font, int first, int count, int listBase);
- void (*WaitGL)(void);
- void (*WaitX)(void);
-
- /*** GLX_VERSION_1_1 ***/
- const char *(*GetClientString)(Display *dpy, int name);
- const char *(*QueryExtensionsString)(Display *dpy, int screen);
- const char *(*QueryServerString)(Display *dpy, int screen, int name);
-
- /*** GLX_VERSION_1_2 ***/
- /*Display *(*GetCurrentDisplay)(void);*/
-
- /*** GLX_VERSION_1_3 ***/
- GLXFBConfig *(*ChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems);
- GLXContext (*CreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
- GLXPbuffer (*CreatePbuffer)(Display *dpy, GLXFBConfig config, const int *attribList);
- GLXPixmap (*CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
- GLXWindow (*CreateWindow)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
- void (*DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
- void (*DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
- void (*DestroyWindow)(Display *dpy, GLXWindow window);
- /*GLXDrawable (*GetCurrentReadDrawable)(void);*/
- int (*GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
- GLXFBConfig *(*GetFBConfigs)(Display *dpy, int screen, int *nelements);
- void (*GetSelectedEvent)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
- XVisualInfo *(*GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
- Bool (*MakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
- int (*QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
- void (*QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
- void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
-
- /*** GLX_SGI_swap_control ***/
- int (*SwapIntervalSGI)(int);
-
- /*** GLX_SGI_video_sync ***/
- int (*GetVideoSyncSGI)(unsigned int *count);
- int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
-
- /*** GLX_SGI_make_current_read ***/
- Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
- /*GLXDrawable (*GetCurrentReadDrawableSGI)(void);*/
-
- /*** GLX_SGIX_video_source (needs video library) ***/
-#if defined(_VL_H_)
- GLXVideoSourceSGIX (*CreateGLXVideoSourceSGIX)(Display *, int, VLServer, VLPath, int, VLNode);
- void (*DestroyGLXVideoSourceSGIX)(Display *, GLXVideoSourceSGIX);
-#else
- void *CreateGLXVideoSourceSGIX;
- void *DestroyGLXVideoSourceSGIX;
-#endif
-
- /*** GLX_EXT_import_context ***/
- void (*FreeContextEXT)(Display *dpy, GLXContext context);
- GLXContextID (*GetContextIDEXT)(const GLXContext context);
- /*Display *(*GetCurrentDisplayEXT)(void);*/
- GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
- int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
-
- /*** GLX_SGIX_fbconfig ***/
- int (*GetFBConfigAttribSGIX)(Display *, GLXFBConfigSGIX, int, int *);
- GLXFBConfigSGIX * (*ChooseFBConfigSGIX)(Display *, int, int *, int *);
- GLXPixmap (*CreateGLXPixmapWithConfigSGIX)(Display *, GLXFBConfigSGIX, Pixmap);
- GLXContext (*CreateContextWithConfigSGIX)(Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
- XVisualInfo * (*GetVisualFromFBConfigSGIX)(Display *, GLXFBConfigSGIX);
- GLXFBConfigSGIX (*GetFBConfigFromVisualSGIX)(Display *, XVisualInfo *);
-
- /*** GLX_SGIX_pbuffer ***/
- GLXPbufferSGIX (*CreateGLXPbufferSGIX)(Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
- void (*DestroyGLXPbufferSGIX)(Display *, GLXPbufferSGIX);
- int (*QueryGLXPbufferSGIX)(Display *, GLXPbufferSGIX, int, unsigned int *);
- void (*SelectEventSGIX)(Display *, GLXDrawable, unsigned long);
- void (*GetSelectedEventSGIX)(Display *, GLXDrawable, unsigned long *);
-
- /*** GLX_SGI_cushion ***/
- void (*CushionSGI)(Display *, Window, float);
-
- /*** GLX_SGIX_video_resize ***/
- int (*BindChannelToWindowSGIX)(Display *, int, int, Window);
- int (*ChannelRectSGIX)(Display *, int, int, int, int, int, int);
- int (*QueryChannelRectSGIX)(Display *, int, int, int *, int *, int *, int *);
- int (*QueryChannelDeltasSGIX)(Display *, int, int, int *, int *, int *, int *);
- int (*ChannelRectSyncSGIX)(Display *, int, int, GLenum);
-
- /*** GLX_SGIX_dmbuffer (needs dmedia library) ***/
-#if defined (_DM_BUFFER_H_)
- Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
-#else
- void *AssociciateDMPbufferSGIX;
-#endif
-
- /*** GLX_SGIX_swap_group ***/
- void (*JoinSwapGroupSGIX)(Display *, GLXDrawable, GLXDrawable);
-
- /*** GLX_SGIX_swap_barrier ***/
- void (*BindSwapBarrierSGIX)(Display *, GLXDrawable, int);
- Bool (*QueryMaxSwapBarriersSGIX)(Display *, int, int *);
-
- /*** GLX_SUN_get_transparent_index ***/
- Status (*GetTransparentIndexSUN)(Display *, Window, Window, long *);
-
- /*** GLX_MESA_copy_sub_buffer ***/
- void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
-
- /*** GLX_MESA_release_buffers ***/
- Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
-
- /*** GLX_MESA_pixmap_colormap ***/
- GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
-
- /*** GLX_MESA_set_3dfx_mode ***/
- Bool (*Set3DfxModeMESA)(int mode);
-
- /*** GLX_NV_vertex_array_range ***/
- void * (*AllocateMemoryNV)( GLsizei size,
- GLfloat readFrequency,
- GLfloat writeFrequency,
- GLfloat priority );
- void (*FreeMemoryNV)( GLvoid *pointer );
-
- /*** GLX_MESA_agp_offset ***/
- GLuint (*GetAGPOffsetMESA)( const GLvoid *pointer );
-};
-
-
-
-extern const char *
-_glxapi_get_version(void);
-
-
-extern const char **
-_glxapi_get_extensions(void);
-
-
-extern GLuint
-_glxapi_get_dispatch_table_size(void);
-
-
-extern void
-_glxapi_set_no_op_table(struct _glxapi_table *t);
-
-
-extern __GLXextFuncPtr
-_glxapi_get_proc_address(const char *funcName);
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.c b/nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.c
deleted file mode 100644
index 30adb7465..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.c
+++ /dev/null
@@ -1,180 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <assert.h>
-#include <GL/glx.h>
-#include "realglx.h"
-#include "glxapi.h"
-
-
-struct _glxapi_table *
-_real_GetGLXDispatchTable(void)
-{
- static struct _glxapi_table glx;
-
- /* be sure our dispatch table size <= libGL's table */
- {
- GLuint size = sizeof(struct _glxapi_table) / sizeof(void *);
- (void) size;
- assert(_glxapi_get_dispatch_table_size() >= size);
- }
-
- /* initialize the whole table to no-ops */
- _glxapi_set_no_op_table(&glx);
-
- /* now initialize the table with the functions I implement */
-
- /*** GLX_VERSION_1_0 ***/
- glx.ChooseVisual = _real_glXChooseVisual;
- glx.CopyContext = _real_glXCopyContext;
- glx.CreateContext = _real_glXCreateContext;
- glx.CreateGLXPixmap = _real_glXCreateGLXPixmap;
- glx.DestroyContext = _real_glXDestroyContext;
- glx.DestroyGLXPixmap = _real_glXDestroyGLXPixmap;
- glx.GetConfig = _real_glXGetConfig;
- /*glx.GetCurrentContext = _real_glXGetCurrentContext;*/
- /*glx.GetCurrentDrawable = _real_glXGetCurrentDrawable;*/
- glx.IsDirect = _real_glXIsDirect;
- glx.MakeCurrent = _real_glXMakeCurrent;
- glx.QueryExtension = _real_glXQueryExtension;
- glx.QueryVersion = _real_glXQueryVersion;
- glx.SwapBuffers = _real_glXSwapBuffers;
- glx.UseXFont = _real_glXUseXFont;
- glx.WaitGL = _real_glXWaitGL;
- glx.WaitX = _real_glXWaitX;
-
- /*** GLX_VERSION_1_1 ***/
- glx.GetClientString = _real_glXGetClientString;
- glx.QueryExtensionsString = _real_glXQueryExtensionsString;
- glx.QueryServerString = _real_glXQueryServerString;
-
- /*** GLX_VERSION_1_2 ***/
- /*glx.GetCurrentDisplay = _real_glXGetCurrentDisplay;*/
-
- /*** GLX_VERSION_1_3 ***/
- glx.ChooseFBConfig = _real_glXChooseFBConfig;
- glx.CreateNewContext = _real_glXCreateNewContext;
- glx.CreatePbuffer = _real_glXCreatePbuffer;
- glx.CreatePixmap = _real_glXCreatePixmap;
- glx.CreateWindow = _real_glXCreateWindow;
- glx.DestroyPbuffer = _real_glXDestroyPbuffer;
- glx.DestroyPixmap = _real_glXDestroyPixmap;
- glx.DestroyWindow = _real_glXDestroyWindow;
- /*glx.GetCurrentReadDrawable = _real_glXGetCurrentReadDrawable;*/
- glx.GetFBConfigAttrib = _real_glXGetFBConfigAttrib;
- glx.GetFBConfigs = _real_glXGetFBConfigs;
- glx.GetSelectedEvent = _real_glXGetSelectedEvent;
- glx.GetVisualFromFBConfig = _real_glXGetVisualFromFBConfig;
- glx.MakeContextCurrent = _real_glXMakeContextCurrent;
- glx.QueryContext = _real_glXQueryContext;
- glx.QueryDrawable = _real_glXQueryDrawable;
- glx.SelectEvent = _real_glXSelectEvent;
-
- /*** GLX_SGI_swap_control ***/
- glx.SwapIntervalSGI = _real_glXSwapIntervalSGI;
-
- /*** GLX_SGI_video_sync ***/
- glx.GetVideoSyncSGI = _real_glXGetVideoSyncSGI;
- glx.WaitVideoSyncSGI = _real_glXWaitVideoSyncSGI;
-
- /*** GLX_SGI_make_current_read ***/
- glx.MakeCurrentReadSGI = _real_glXMakeCurrentReadSGI;
- /*glx.GetCurrentReadDrawableSGI = _real_glXGetCurrentReadDrawableSGI;*/
-
-#if defined(_VL_H)
- /*** GLX_SGIX_video_source ***/
- glx.CreateGLXVideoSourceSGIX = _real_glXCreateGLXVideoSourceSGIX;
- glx.DestroyGLXVideoSourceSGIX = _real_glXDestroyGLXVideoSourceSGIX;
-#endif
-
- /*** GLX_EXT_import_context ***/
- glx.FreeContextEXT = _real_glXFreeContextEXT;
- /*glx.GetContextIDEXT = _real_glXGetContextIDEXT;*/
- /*glx.GetCurrentDisplayEXT = _real_glXGetCurrentDisplayEXT;*/
- glx.ImportContextEXT = _real_glXImportContextEXT;
- glx.QueryContextInfoEXT = _real_glXQueryContextInfoEXT;
-
- /*** GLX_SGIX_fbconfig ***/
- glx.GetFBConfigAttribSGIX = _real_glXGetFBConfigAttribSGIX;
- glx.ChooseFBConfigSGIX = _real_glXChooseFBConfigSGIX;
- glx.CreateGLXPixmapWithConfigSGIX = _real_glXCreateGLXPixmapWithConfigSGIX;
- glx.CreateContextWithConfigSGIX = _real_glXCreateContextWithConfigSGIX;
- glx.GetVisualFromFBConfigSGIX = _real_glXGetVisualFromFBConfigSGIX;
- glx.GetFBConfigFromVisualSGIX = _real_glXGetFBConfigFromVisualSGIX;
-
- /*** GLX_SGIX_pbuffer ***/
- glx.CreateGLXPbufferSGIX = _real_glXCreateGLXPbufferSGIX;
- glx.DestroyGLXPbufferSGIX = _real_glXDestroyGLXPbufferSGIX;
- glx.QueryGLXPbufferSGIX = _real_glXQueryGLXPbufferSGIX;
- glx.SelectEventSGIX = _real_glXSelectEventSGIX;
- glx.GetSelectedEventSGIX = _real_glXGetSelectedEventSGIX;
-
- /*** GLX_SGI_cushion ***/
- glx.CushionSGI = _real_glXCushionSGI;
-
- /*** GLX_SGIX_video_resize ***/
- glx.BindChannelToWindowSGIX = _real_glXBindChannelToWindowSGIX;
- glx.ChannelRectSGIX = _real_glXChannelRectSGIX;
- glx.QueryChannelRectSGIX = _real_glXQueryChannelRectSGIX;
- glx.QueryChannelDeltasSGIX = _real_glXQueryChannelDeltasSGIX;
- glx.ChannelRectSyncSGIX = _real_glXChannelRectSyncSGIX;
-
-#if defined(_DM_BUFFER_H_)
- /*** (GLX_SGIX_dmbuffer ***/
- glx.AssociateDMPbufferSGIX = NULL;
-#endif
-
- /*** GLX_SGIX_swap_group ***/
- glx.JoinSwapGroupSGIX = _real_glXJoinSwapGroupSGIX;
-
- /*** GLX_SGIX_swap_barrier ***/
- glx.BindSwapBarrierSGIX = _real_glXBindSwapBarrierSGIX;
- glx.QueryMaxSwapBarriersSGIX = _real_glXQueryMaxSwapBarriersSGIX;
-
- /*** GLX_SUN_get_transparent_index ***/
- glx.GetTransparentIndexSUN = _real_glXGetTransparentIndexSUN;
-
- /*** GLX_MESA_copy_sub_buffer ***/
- glx.CopySubBufferMESA = _real_glXCopySubBufferMESA;
-
- /*** GLX_MESA_release_buffers ***/
- glx.ReleaseBuffersMESA = _real_glXReleaseBuffersMESA;
-
- /*** GLX_MESA_pixmap_colormap ***/
- glx.CreateGLXPixmapMESA = _real_glXCreateGLXPixmapMESA;
-
- /*** GLX_MESA_set_3dfx_mode ***/
- glx.Set3DfxModeMESA = _real_glXSet3DfxModeMESA;
-
- /*** GLX_NV_vertex_array_range ***/
- glx.AllocateMemoryNV = _real_glXAllocateMemoryNV;
- glx.FreeMemoryNV = _real_glXFreeMemoryNV;
-
- /*** GLX_MESA_agp_offset ***/
- glx.GetAGPOffsetMESA = _real_glXGetAGPOffsetMESA;
-
- return &glx;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.h
deleted file mode 100644
index 150129db6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/realglx.h
+++ /dev/null
@@ -1,326 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef REALGLX_H
-#define REALGLX_H
-
-
-extern struct _glxapi_table *
-_real_GetGLXDispatchTable(void);
-
-
-/*
- * Basically just need these to prevent compiler warnings.
- */
-
-
-extern XVisualInfo *
-_real_glXChooseVisual( Display *dpy, int screen, int *list );
-
-extern GLXContext
-_real_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
- GLXContext share_list, Bool direct );
-
-extern GLXPixmap
-_real_glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo, Pixmap pixmap );
-
-extern GLXPixmap
-_real_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
- Pixmap pixmap, Colormap cmap );
-
-extern void
-_real_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
-
-extern void
-_real_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
- unsigned long mask );
-
-extern Bool
-_real_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx );
-
-extern Bool
-_real_glXQueryExtension( Display *dpy, int *errorb, int *event );
-
-extern void
-_real_glXDestroyContext( Display *dpy, GLXContext ctx );
-
-extern Bool
-_real_glXIsDirect( Display *dpy, GLXContext ctx );
-
-extern void
-_real_glXSwapBuffers( Display *dpy, GLXDrawable drawable );
-
-extern void
-_real_glXUseXFont( Font font, int first, int count, int listbase );
-
-extern Bool
-_real_glXQueryVersion( Display *dpy, int *maj, int *min );
-
-extern int
-_real_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
- int attrib, int *value );
-
-extern void
-_real_glXWaitGL( void );
-
-
-extern void
-_real_glXWaitX( void );
-
-/* GLX 1.1 and later */
-extern const char *
-_real_glXQueryExtensionsString( Display *dpy, int screen );
-
-/* GLX 1.1 and later */
-extern const char *
-_real_glXQueryServerString( Display *dpy, int screen, int name );
-
-/* GLX 1.1 and later */
-extern const char *
-_real_glXGetClientString( Display *dpy, int name );
-
-
-/*
- * GLX 1.3 and later
- */
-
-extern GLXFBConfig *
-_real_glXChooseFBConfig( Display *dpy, int screen,
- const int *attribList, int *nitems );
-
-extern int
-_real_glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
- int attribute, int *value );
-
-extern GLXFBConfig *
-_real_glXGetFBConfigs( Display *dpy, int screen, int *nelements );
-
-extern XVisualInfo *
-_real_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config );
-
-extern GLXWindow
-_real_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win,
- const int *attribList );
-
-extern void
-_real_glXDestroyWindow( Display *dpy, GLXWindow window );
-
-extern GLXPixmap
-_real_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
- const int *attribList );
-
-extern void
-_real_glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
-
-extern GLXPbuffer
-_real_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
- const int *attribList );
-
-extern void
-_real_glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
-
-extern void
-_real_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
- unsigned int *value );
-
-extern GLXContext
-_real_glXCreateNewContext( Display *dpy, GLXFBConfig config,
- int renderType, GLXContext shareList, Bool direct );
-
-
-extern Bool
-_real_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
- GLXDrawable read, GLXContext ctx );
-
-extern int
-_real_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value );
-
-extern void
-_real_glXSelectEvent( Display *dpy, GLXDrawable drawable, unsigned long mask );
-
-extern void
-_real_glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
- unsigned long *mask );
-
-#ifdef GLX_SGI_swap_control
-extern int
-_real_glXSwapIntervalSGI(int interval);
-#endif
-
-
-#ifdef GLX_SGI_video_sync
-extern int
-_real_glXGetVideoSyncSGI(unsigned int *count);
-
-extern int
-_real_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
-#endif
-
-
-#ifdef GLX_SGI_make_current_read
-extern Bool
-_real_glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-
-extern GLXDrawable
-_real_glXGetCurrentReadDrawableSGI(void);
-#endif
-
-#if defined(_VL_H) && defined(GLX_SGIX_video_source)
-extern GLXVideoSourceSGIX
-_real_glXCreateGLXVideoSourceSGIX(Display *dpy, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
-
-extern void
-_real_glXDestroyGLXVideoSourceSGIX(Display *dpy, GLXVideoSourceSGIX src);
-#endif
-
-#ifdef GLX_EXT_import_context
-extern void
-_real_glXFreeContextEXT(Display *dpy, GLXContext context);
-
-extern GLXContextID
-_real_glXGetContextIDEXT(const GLXContext context);
-
-extern Display *
-_real_glXGetCurrentDisplayEXT(void);
-
-extern GLXContext
-_real_glXImportContextEXT(Display *dpy, GLXContextID contextID);
-
-extern int
-_real_glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute, int *value);
-#endif
-
-#ifdef GLX_SGIX_fbconfig
-extern int
-_real_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
-
-extern GLXFBConfigSGIX *
-_real_glXChooseFBConfigSGIX(Display *dpy, int screen, int *attrib_list, int *nelements);
-
-extern GLXPixmap
-_real_glXCreateGLXPixmapWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
-
-extern GLXContext
-_real_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
-
-extern XVisualInfo *
-_real_glXGetVisualFromFBConfigSGIX(Display *dpy, GLXFBConfigSGIX config);
-
-extern GLXFBConfigSGIX
-_real_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis);
-#endif
-
-#ifdef GLX_SGIX_pbuffer
-extern GLXPbufferSGIX
-_real_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
-
-extern void
-_real_glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf);
-
-extern int
-_real_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
-
-extern void
-_real_glXSelectEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long mask);
-
-extern void
-_real_glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable, unsigned long *mask);
-#endif
-
-#ifdef GLX_SGI_cushion
-extern void
-_real_glXCushionSGI(Display *dpy, Window win, float cushion);
-#endif
-
-#ifdef GLX_SGIX_video_resize
-extern int
-_real_glXBindChannelToWindowSGIX(Display *dpy, int screen, int channel , Window window);
-
-extern int
-_real_glXChannelRectSGIX(Display *dpy, int screen, int channel, int x, int y, int w, int h);
-
-extern int
-_real_glXQueryChannelRectSGIX(Display *dpy, int screen, int channel, int *x, int *y, int *w, int *h);
-
-extern int
-_real_glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
-
-extern int
-_real_glXChannelRectSyncSGIX(Display *dpy, int screen, int channel, GLenum synctype);
-#endif
-
-#if defined(_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
-extern Bool
-_real_glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
-#endif
-
-#ifdef GLX_SGIX_swap_group
-extern void
-_real_glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member);
-#endif
-
-#ifdef GLX_SGIX_swap_barrier
-extern void
-_real_glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier);
-
-extern Bool
-_real_glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max);
-#endif
-
-#ifdef GLX_SUN_get_transparent_index
-extern Status
-_real_glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent);
-#endif
-
-#ifdef GLX_MESA_release_buffers
-extern Bool
-_real_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
-#endif
-
-#ifdef GLX_MESA_set_3dfx_mode
-extern Bool
-_real_glXSet3DfxModeMESA( int mode );
-#endif
-
-#ifdef GLX_NV_vertex_array_range
-extern void *
-_real_glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-extern void
-_real_glXFreeMemoryNV(GLvoid *pointer);
-#endif
-
-#ifdef GLX_MESA_agp_offset
-extern GLuint
-_real_glXGetAGPOffsetMESA(const GLvoid *pointer);
-#endif
-
-#ifdef GLX_MESA_copy_sub_buffer
-extern void
-_real_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
- int x, int y, int width, int height );
-#endif
-
-#endif /* REALGLX_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.c b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.c
deleted file mode 100644
index d72c600bd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.c
+++ /dev/null
@@ -1,377 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/* xfonts.c -- glXUseXFont() for Mesa written by
- * Copyright (C) 1995 Thorsten.Ohl @ Physik.TH-Darmstadt.de
- */
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-#endif
-
-#include "glxheader.h"
-#include "context.h"
-#include "imports.h"
-#include "xfonts.h"
-
-
-/* Some debugging info. */
-
-#ifdef DEBUG
-#undef _R
-#undef _G
-#undef _B
-#include <ctype.h>
-
-int debug_xfonts = 0;
-
-static void
-dump_char_struct(XCharStruct * ch, char *prefix)
-{
- printf("%slbearing = %d, rbearing = %d, width = %d\n",
- prefix, ch->lbearing, ch->rbearing, ch->width);
- printf("%sascent = %d, descent = %d, attributes = %u\n",
- prefix, ch->ascent, ch->descent, (unsigned int) ch->attributes);
-}
-
-static void
-dump_font_struct(XFontStruct * font)
-{
- printf("ascent = %d, descent = %d\n", font->ascent, font->descent);
- printf("char_or_byte2 = (%u,%u)\n",
- font->min_char_or_byte2, font->max_char_or_byte2);
- printf("byte1 = (%u,%u)\n", font->min_byte1, font->max_byte1);
- printf("all_chars_exist = %s\n", font->all_chars_exist ? "True" : "False");
- printf("default_char = %c (\\%03o)\n",
- (char) (isprint(font->default_char) ? font->default_char : ' '),
- font->default_char);
- dump_char_struct(&font->min_bounds, "min> ");
- dump_char_struct(&font->max_bounds, "max> ");
-#if 0
- for (c = font->min_char_or_byte2; c <= font->max_char_or_byte2; c++) {
- char prefix[8];
- sprintf(prefix, "%d> ", c);
- dump_char_struct(&font->per_char[c], prefix);
- }
-#endif
-}
-
-static void
-dump_bitmap(unsigned int width, unsigned int height, GLubyte * bitmap)
-{
- unsigned int x, y;
-
- printf(" ");
- for (x = 0; x < 8 * width; x++)
- printf("%o", 7 - (x % 8));
- putchar('\n');
- for (y = 0; y < height; y++) {
- printf("%3o:", y);
- for (x = 0; x < 8 * width; x++)
- putchar((bitmap[width * (height - y - 1) + x / 8] & (1 << (7 - (x %
- 8))))
- ? '*' : '.');
- printf(" ");
- for (x = 0; x < width; x++)
- printf("0x%02x, ", bitmap[width * (height - y - 1) + x]);
- putchar('\n');
- }
-}
-#endif /* DEBUG */
-
-
-/* Implementation. */
-
-/* Fill a BITMAP with a character C from thew current font
- in the graphics context GC. WIDTH is the width in bytes
- and HEIGHT is the height in bits.
-
- Note that the generated bitmaps must be used with
-
- glPixelStorei (GL_UNPACK_SWAP_BYTES, GL_FALSE);
- glPixelStorei (GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
-
- Possible optimizations:
-
- * use only one reusable pixmap with the maximum dimensions.
- * draw the entire font into a single pixmap (careful with
- proportional fonts!).
-*/
-
-
-/*
- * Generate OpenGL-compatible bitmap.
- */
-static void
-fill_bitmap(Display * dpy, Window win, GC gc,
- unsigned int width, unsigned int height,
- int x0, int y0, unsigned int c, GLubyte * bitmap)
-{
- XImage *image;
- unsigned int x, y;
- Pixmap pixmap;
- XChar2b char2b;
-
- pixmap = XCreatePixmap(dpy, win, 8 * width, height, 1);
- XSetForeground(dpy, gc, 0);
- XFillRectangle(dpy, pixmap, gc, 0, 0, 8 * width, height);
- XSetForeground(dpy, gc, 1);
-
- char2b.byte1 = (c >> 8) & 0xff;
- char2b.byte2 = (c & 0xff);
-
- XDrawString16(dpy, pixmap, gc, x0, y0, &char2b, 1);
-
- image = XGetImage(dpy, pixmap, 0, 0, 8 * width, height, 1, XYPixmap);
- if (image) {
- /* Fill the bitmap (X11 and OpenGL are upside down wrt each other). */
- for (y = 0; y < height; y++)
- for (x = 0; x < 8 * width; x++)
- if (XGetPixel(image, x, y))
- bitmap[width * (height - y - 1) + x / 8] |=
- (1 << (7 - (x % 8)));
- XDestroyImage(image);
- }
-
- XFreePixmap(dpy, pixmap);
-}
-
-/*
- * determine if a given glyph is valid and return the
- * corresponding XCharStruct.
- */
-static XCharStruct *
-isvalid(XFontStruct * fs, unsigned int which)
-{
- unsigned int rows, pages;
- unsigned int byte1 = 0, byte2 = 0;
- int i, valid = 1;
-
- rows = fs->max_byte1 - fs->min_byte1 + 1;
- pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1;
-
- if (rows == 1) {
- /* "linear" fonts */
- if ((fs->min_char_or_byte2 > which) || (fs->max_char_or_byte2 < which))
- valid = 0;
- }
- else {
- /* "matrix" fonts */
- byte2 = which & 0xff;
- byte1 = which >> 8;
- if ((fs->min_char_or_byte2 > byte2) ||
- (fs->max_char_or_byte2 < byte2) ||
- (fs->min_byte1 > byte1) || (fs->max_byte1 < byte1))
- valid = 0;
- }
-
- if (valid) {
- if (fs->per_char) {
- if (rows == 1) {
- /* "linear" fonts */
- return (fs->per_char + (which - fs->min_char_or_byte2));
- }
- else {
- /* "matrix" fonts */
- i = ((byte1 - fs->min_byte1) * pages) +
- (byte2 - fs->min_char_or_byte2);
- return (fs->per_char + i);
- }
- }
- else {
- return (&fs->min_bounds);
- }
- }
- return (NULL);
-}
-
-
-void
-Fake_glXUseXFont(Font font, int first, int count, int listbase)
-{
- Display *dpy;
- Window win;
- Pixmap pixmap;
- GC gc;
- XGCValues values;
- unsigned long valuemask;
- XFontStruct *fs;
- GLint swapbytes, lsbfirst, rowlength;
- GLint skiprows, skippixels, alignment;
- unsigned int max_width, max_height, max_bm_width, max_bm_height;
- GLubyte *bm;
- int i;
-
- dpy = glXGetCurrentDisplay();
- if (!dpy)
- return; /* I guess glXMakeCurrent wasn't called */
- win = RootWindow(dpy, DefaultScreen(dpy));
-
- fs = XQueryFont(dpy, font);
- if (!fs) {
- _mesa_error(NULL, GL_INVALID_VALUE,
- "Couldn't get font structure information");
- return;
- }
-
- /* Allocate a bitmap that can fit all characters. */
- max_width = fs->max_bounds.rbearing - fs->min_bounds.lbearing;
- max_height = fs->max_bounds.ascent + fs->max_bounds.descent;
- max_bm_width = (max_width + 7) / 8;
- max_bm_height = max_height;
-
- bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof(GLubyte));
- if (!bm) {
- XFreeFontInfo(NULL, fs, 1);
- _mesa_error(NULL, GL_OUT_OF_MEMORY,
- "Couldn't allocate bitmap in glXUseXFont()");
- return;
- }
-
-#if 0
- /* get the page info */
- pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1;
- firstchar = (fs->min_byte1 << 8) + fs->min_char_or_byte2;
- lastchar = (fs->max_byte1 << 8) + fs->max_char_or_byte2;
- rows = fs->max_byte1 - fs->min_byte1 + 1;
- unsigned int first_char, last_char, pages, rows;
-#endif
-
- /* Save the current packing mode for bitmaps. */
- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
- glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
-
- /* Enforce a standard packing mode which is compatible with
- fill_bitmap() from above. This is actually the default mode,
- except for the (non)alignment. */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
- glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- pixmap = XCreatePixmap(dpy, win, 10, 10, 1);
- values.foreground = BlackPixel(dpy, DefaultScreen(dpy));
- values.background = WhitePixel(dpy, DefaultScreen(dpy));
- values.font = fs->fid;
- valuemask = GCForeground | GCBackground | GCFont;
- gc = XCreateGC(dpy, pixmap, valuemask, &values);
- XFreePixmap(dpy, pixmap);
-
-#ifdef DEBUG
- if (debug_xfonts)
- dump_font_struct(fs);
-#endif
-
- for (i = 0; i < count; i++) {
- unsigned int width, height, bm_width, bm_height;
- GLfloat x0, y0, dx, dy;
- XCharStruct *ch;
- int x, y;
- unsigned int c = first + i;
- int list = listbase + i;
- int valid;
-
- /* check on index validity and get the bounds */
- ch = isvalid(fs, c);
- if (!ch) {
- ch = &fs->max_bounds;
- valid = 0;
- }
- else {
- valid = 1;
- }
-
-#ifdef DEBUG
- if (debug_xfonts) {
- char s[7];
- sprintf(s, isprint(c) ? "%c> " : "\\%03o> ", c);
- dump_char_struct(ch, s);
- }
-#endif
-
- /* glBitmap()' parameters:
- straight from the glXUseXFont(3) manpage. */
- width = ch->rbearing - ch->lbearing;
- height = ch->ascent + ch->descent;
- x0 = -ch->lbearing;
- y0 = ch->descent - 0; /* XXX used to subtract 1 here */
- /* but that caused a conformace failure */
- dx = ch->width;
- dy = 0;
-
- /* X11's starting point. */
- x = -ch->lbearing;
- y = ch->ascent;
-
- /* Round the width to a multiple of eight. We will use this also
- for the pixmap for capturing the X11 font. This is slightly
- inefficient, but it makes the OpenGL part real easy. */
- bm_width = (width + 7) / 8;
- bm_height = height;
-
- glNewList(list, GL_COMPILE);
- if (valid && (bm_width > 0) && (bm_height > 0)) {
-
- MEMSET(bm, '\0', bm_width * bm_height);
- fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm);
-
- glBitmap(width, height, x0, y0, dx, dy, bm);
-#ifdef DEBUG
- if (debug_xfonts) {
- printf("width/height = %u/%u\n", width, height);
- printf("bm_width/bm_height = %u/%u\n", bm_width, bm_height);
- dump_bitmap(bm_width, bm_height, bm);
- }
-#endif
- }
- else {
- glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL);
- }
- glEndList();
- }
-
- FREE(bm);
- XFreeFontInfo(NULL, fs, 1);
- XFreeGC(dpy, gc);
-
- /* Restore saved packing modes. */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
- glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
- glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.h
deleted file mode 100644
index e36f42f81..000000000
--- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xfonts.h
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef XFONTS_H
-#define XFONTS_H
-
-#ifdef __VMS
-#include <GL/vms_x_fix.h>
-#endif
-
-#include <X11/Xlib.h>
-
-
-extern void Fake_glXUseXFont( Font font, int first, int count, int listbase );
-
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/.cvsignore b/nx-X11/extras/Mesa/src/mesa/glapi/.cvsignore
deleted file mode 100644
index e706bc23c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.cvsignore
-glX_proto_common.pyo
-glX_proto_common.pyc
-typeexpr.pyo
-typeexpr.pyc
-license.pyo
-license.pyc
-gl_XML.pyo
-gl_XML.pyc
-glX_XML.pyo
-glX_XML.pyc
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/EXT_framebuffer_object.xml b/nx-X11/extras/Mesa/src/mesa/glapi/EXT_framebuffer_object.xml
deleted file mode 100644
index 5057bdc8b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/EXT_framebuffer_object.xml
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
-
-<OpenGLAPI>
-<category name="GL_EXT_framebuffer_object" number="310">
- <enum name="FRAMEBUFFER_EXT" value="0x8D40"/>
- <enum name="RENDERBUFFER_EXT" value="0x8D41"/>
- <enum name="RENDERBUFFER_WIDTH_EXT" value="0x8D42"/>
- <enum name="RENDERBUFFER_HEIGHT_EXT" value="0x8D43"/>
- <enum name="RENDERBUFFER_INTERNAL_FORMAT_EXT" value="0x8D44"/>
- <enum name="STENCIL_INDEX_EXT" value="0x8D45"/>
- <enum name="STENCIL_INDEX1_EXT" value="0x8D46"/>
- <enum name="STENCIL_INDEX4_EXT" value="0x8D47"/>
- <enum name="STENCIL_INDEX8_EXT" value="0x8D48"/>
- <enum name="STENCIL_INDEX16_EXT" value="0x8D49"/>
-
- <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT" count="1" value="0x8CD0">
- <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
- </enum>
- <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT" count="1" value="0x8CD1">
- <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
- </enum>
- <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT" count="1" value="0x8CD2">
- <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
- </enum>
- <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT" count="1" value="0x8CD3">
- <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
- </enum>
- <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT" count="1" value="0x8CD4">
- <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
- </enum>
-
- <enum name="COLOR_ATTACHMENT0_EXT" value="0x8CE0"/>
- <enum name="COLOR_ATTACHMENT1_EXT" value="0x8CE1"/>
- <enum name="COLOR_ATTACHMENT2_EXT" value="0x8CE2"/>
- <enum name="COLOR_ATTACHMENT3_EXT" value="0x8CE3"/>
- <enum name="COLOR_ATTACHMENT4_EXT" value="0x8CE4"/>
- <enum name="COLOR_ATTACHMENT5_EXT" value="0x8CE5"/>
- <enum name="COLOR_ATTACHMENT6_EXT" value="0x8CE6"/>
- <enum name="COLOR_ATTACHMENT7_EXT" value="0x8CE7"/>
- <enum name="COLOR_ATTACHMENT8_EXT" value="0x8CE8"/>
- <enum name="COLOR_ATTACHMENT9_EXT" value="0x8CE9"/>
- <enum name="COLOR_ATTACHMENT10_EXT" value="0x8CEA"/>
- <enum name="COLOR_ATTACHMENT11_EXT" value="0x8CEB"/>
- <enum name="COLOR_ATTACHMENT12_EXT" value="0x8CEC"/>
- <enum name="COLOR_ATTACHMENT13_EXT" value="0x8CED"/>
- <enum name="COLOR_ATTACHMENT14_EXT" value="0x8CEE"/>
- <enum name="COLOR_ATTACHMENT15_EXT" value="0x8CEF"/>
- <enum name="DEPTH_ATTACHMENT_EXT" value="0x8D00"/>
- <enum name="STENCIL_ATTACHMENT_EXT" value="0x8D20"/>
-
- <enum name="FRAMEBUFFER_COMPLETE_EXT" value="0x8CD5"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT" value="0x8CD6"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT" value="0x8CD7"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT" value="0x8CD8"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT" value="0x8CD9"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_FORMATS_EXT" value="0x8CDA"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" value="0x8CDB"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT" value="0x8CDC"/>
- <enum name="FRAMEBUFFER_UNSUPPORTED_EXT" value="0x8CDD"/>
- <enum name="FRAMEBUFFER_STATUS_ERROR_EXT" value="0x8CDE"/>
-
- <enum name="FRAMEBUFFER_BINDING_EXT" value="0x8CA6"/>
- <enum name="RENDERBUFFER_BINDING_EXT" value="0x8CA7"/>
- <enum name="MAX_COLOR_ATTACHMENTS_EXT" value="0x8CDF"/>
- <enum name="MAX_RENDERBUFFER_SIZE_EXT" value="0x84E8"/>
-
- <enum name="INVALID_FRAMEBUFFER_OPERATION_EXT" value="0x0506"/>
-
- <function name="IsRenderbufferEXT" offset="796">
- <param name="renderbuffer" type="GLuint"/>
- <return type="GLboolean"/>
- <glx vendorpriv="1422"/>
- </function>
-
- <function name="BindRenderbufferEXT" offset="797">
- <param name="target" type="GLenum"/>
- <param name="renderbuffer" type="GLuint"/>
- <glx rop="4316"/>
- </function>
-
- <function name="DeleteRenderbuffersEXT" offset="798">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="renderbuffers" type="const GLuint *" count="n"/>
- <glx rop="4317"/>
- </function>
-
- <function name="GenRenderbuffersEXT" offset="799">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="renderbuffers" type="GLuint *" count="n" output="true"/>
- <glx vendorpriv="1423" always_array="true"/>
- </function>
-
- <function name="RenderbufferStorageEXT" offset="800">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4318"/>
- </function>
-
- <function name="GetRenderbufferParameterivEXT" offset="801">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1424"/>
- </function>
-
- <function name="IsFramebufferEXT" offset="802">
- <param name="framebuffer" type="GLuint"/>
- <return type="GLboolean"/>
- <glx vendorpriv="1425"/>
- </function>
-
- <function name="BindFramebufferEXT" offset="803">
- <param name="target" type="GLenum"/>
- <param name="framebuffer" type="GLuint"/>
- <glx rop="4319"/>
- </function>
-
- <function name="DeleteFramebuffersEXT" offset="804">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="framebuffers" type="const GLuint *" count="n"/>
- <glx rop="4320"/>
- </function>
-
- <function name="GenFramebuffersEXT" offset="805">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="framebuffers" type="GLuint *" count="n" output="true"/>
- <glx vendorpriv="1426" always_array="true"/>
- </function>
-
- <function name="CheckFramebufferStatusEXT" offset="806">
- <param name="target" type="GLenum"/>
- <return type="GLenum"/>
- <glx vendorpriv="1427"/>
- </function>
-
- <function name="FramebufferTexture1DEXT" offset="807">
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="textarget" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- <param name="level" type="GLint"/>
- <glx rop="4321"/>
- </function>
-
- <function name="FramebufferTexture2DEXT" offset="808">
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="textarget" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- <param name="level" type="GLint"/>
- <glx rop="4322"/>
- </function>
-
- <function name="FramebufferTexture3DEXT" offset="809">
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="textarget" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- <param name="level" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <glx rop="4323"/>
- </function>
-
- <function name="FramebufferRenderbufferEXT" offset="810">
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="renderbuffertarget" type="GLenum"/>
- <param name="renderbuffer" type="GLuint"/>
- <glx rop="4324"/>
- </function>
-
- <function name="GetFramebufferAttachmentParameterivEXT" offset="811">
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1428"/>
- </function>
-
- <function name="GenerateMipmapEXT" offset="812">
- <param name="target" type="GLenum"/>
- <glx rop="4325"/>
- </function>
-</category>
-</OpenGLAPI>
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/Makefile b/nx-X11/extras/Mesa/src/mesa/glapi/Makefile
deleted file mode 100644
index fb5a22885..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/Makefile
+++ /dev/null
@@ -1,70 +0,0 @@
-# This file isn't used during a normal compilation since we don't want to
-# require Python in order to compile Mesa.
-# Instead, when the Mesa developers update/change the API interface it's
-# up to him/her to re-run this makefile and check in the newly generated files.
-
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \
- ../main/enums.c \
- ../x86/glapi_x86.S \
- ../x86-64/glapi_x86-64.S \
- ../drivers/dri/common/extension_helper.h \
- ../../glx/x11/indirect.c \
- ../../glx/x11/indirect.h \
- ../../glx/x11/indirect_init.c \
- ../../glx/x11/indirect_size.h \
- ../../glx/x11/indirect_size.c
-
-COMMON = gl_XML.py license.py gl_API.xml typeexpr.py
-COMMON_GLX = $(COMMON) glX_XML.py glX_proto_common.py
-
-all: $(OUTPUTS)
-
-glprocs.h: $(COMMON) gl_procs.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_procs.py > glprocs.h
-
-glapitemp.h: $(COMMON) gl_apitemp.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_apitemp.py > glapitemp.h
-
-glapioffsets.h: $(COMMON) gl_offsets.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_offsets.py > glapioffsets.h
-
-glapitable.h: $(COMMON) gl_table.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_table.py > glapitable.h
-
-dispatch.h: $(COMMON) gl_table.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_table.py -m remap_table > dispatch.h
-
-../main/enums.c: $(COMMON) gl_enums.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_enums.py > ../main/enums.c
-
-../x86/glapi_x86.S: $(COMMON) gl_x86_asm.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_x86_asm.py > ../x86/glapi_x86.S
-
-../x86-64/glapi_x86-64.S: $(COMMON) gl_x86-64_asm.py
- $(PYTHON2) $(PYTHON_FLAGS) gl_x86-64_asm.py > ../x86-64/glapi_x86-64.S
-
-../drivers/dri/common/extension_helper.h: $(COMMON) extension_helper.py
- $(PYTHON2) $(PYTHON_FLAGS) extension_helper.py > ../drivers/dri/common/extension_helper.h
-
-../../glx/x11/indirect.c: $(COMMON_GLX) glX_proto_send.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_send.py -m proto > ../../glx/x11/indirect.c
-
-../../glx/x11/indirect.h: $(COMMON_GLX) glX_proto_send.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_send.py -m init_h > ../../glx/x11/indirect.h
-
-../../glx/x11/indirect_init.c: $(COMMON_GLX) glX_proto_send.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_send.py -m init_c > ../../glx/x11/indirect_init.c
-
-../../glx/x11/indirect_size.h: $(COMMON_GLX) glX_proto_size.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_h --only-set -h _INDIRECT_SIZE_H_ > ../../glx/x11/indirect_size.h
-
-../../glx/x11/indirect_size.c: $(COMMON_GLX) glX_proto_size.py
- $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c --only-set > ../../glx/x11/indirect_size.c
-
-clean:
- rm -f *~ *.pyo
- rm -f $(OUTPUTS)
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/descrip.mms b/nx-X11/extras/Mesa/src/mesa/glapi/descrip.mms
deleted file mode 100644
index 20573b9ac..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/descrip.mms
+++ /dev/null
@@ -1,37 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [---.include.gl]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = glapi.c glthread.c
-
-OBJECTS = glapi.obj,glthread.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-glapi.obj : glapi.c
-
-glthread.obj : glthread.c
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/extension_helper.py b/nx-X11/extras/Mesa/src/mesa/glapi/extension_helper.py
deleted file mode 100644
index a2a16a8b3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/extension_helper.py
+++ /dev/null
@@ -1,316 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML
-import license
-import sys, getopt, string
-
-vtxfmt = [
- "ArrayElement", \
- "Color3f", \
- "Color3fv", \
- "Color4f", \
- "Color4fv", \
- "EdgeFlag", \
- "EdgeFlagv", \
- "EvalCoord1f", \
- "EvalCoord1fv", \
- "EvalCoord2f", \
- "EvalCoord2fv", \
- "EvalPoint1", \
- "EvalPoint2", \
- "FogCoordfEXT", \
- "FogCoordfvEXT", \
- "Indexf", \
- "Indexfv", \
- "Materialfv", \
- "MultiTexCoord1fARB", \
- "MultiTexCoord1fvARB", \
- "MultiTexCoord2fARB", \
- "MultiTexCoord2fvARB", \
- "MultiTexCoord3fARB", \
- "MultiTexCoord3fvARB", \
- "MultiTexCoord4fARB", \
- "MultiTexCoord4fvARB", \
- "Normal3f", \
- "Normal3fv", \
- "SecondaryColor3fEXT", \
- "SecondaryColor3fvEXT", \
- "TexCoord1f", \
- "TexCoord1fv", \
- "TexCoord2f", \
- "TexCoord2fv", \
- "TexCoord3f", \
- "TexCoord3fv", \
- "TexCoord4f", \
- "TexCoord4fv", \
- "Vertex2f", \
- "Vertex2fv", \
- "Vertex3f", \
- "Vertex3fv", \
- "Vertex4f", \
- "Vertex4fv", \
- "CallList", \
- "CallLists", \
- "Begin", \
- "End", \
- "VertexAttrib1fNV", \
- "VertexAttrib1fvNV", \
- "VertexAttrib2fNV", \
- "VertexAttrib2fvNV", \
- "VertexAttrib3fNV", \
- "VertexAttrib3fvNV", \
- "VertexAttrib4fNV", \
- "VertexAttrib4fvNV", \
- "VertexAttrib1fARB", \
- "VertexAttrib1fvARB", \
- "VertexAttrib2fARB", \
- "VertexAttrib2fvARB", \
- "VertexAttrib3fARB", \
- "VertexAttrib3fvARB", \
- "VertexAttrib4fARB", \
- "VertexAttrib4fvARB", \
- "Rectf", \
- "DrawArrays", \
- "DrawElements", \
- "DrawRangeElements", \
- "EvalMesh1", \
- "EvalMesh2", \
-]
-
-def all_entrypoints_in_abi(f, abi, api):
- for n in f.entry_points:
- [category, num] = api.get_category_for_name( n )
- if category not in abi:
- return 0
-
- return 1
-
-
-def any_entrypoints_in_abi(f, abi, api):
- for n in f.entry_points:
- [category, num] = api.get_category_for_name( n )
- if category in abi:
- return 1
-
- return 0
-
-
-def condition_for_function(f, abi, all_not_in_ABI):
- """Create a C-preprocessor condition for the function.
-
- There are two modes of operation. If all_not_in_ABI is set, a
- condition is only created is all of the entry-point names for f are
- not in the selected ABI. If all_not_in_ABI is not set, a condition
- is created if any entryp-point name is not in the selected ABI.
- """
-
- condition = []
- for n in f.entry_points:
- [category, num] = api.get_category_for_name( n )
- if category not in abi:
- condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) )
- elif all_not_in_ABI:
- return []
-
- return condition
-
-
-class PrintGlExtensionGlue(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "extension_helper.py (from Mesa)"
- self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
- return
-
-
- def printRealHeader(self):
- print '#include "utils.h"'
- print '#include "dispatch.h"'
- print ''
- return
-
-
- def printBody(self, api):
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
- category_list = {}
-
- print '#ifndef NULL'
- print '# define NULL 0'
- print '#endif'
- print ''
-
- for f in api.functionIterateAll():
- condition = condition_for_function(f, abi, 0)
- if len(condition):
- print '#if %s' % (string.join(condition, " || "))
- print 'static const char %s_names[] = ' % (f.name)
-
- parameter_signature = ''
- for p in f.parameterIterator():
- # FIXME: This is a *really* ugly hack. :(
-
- tn = p.type_expr.get_base_type_node()
- if p.is_pointer():
- parameter_signature += 'p'
- elif tn.integer:
- parameter_signature += 'i'
- elif tn.size == 4:
- parameter_signature += 'f'
- else:
- parameter_signature += 'd'
-
- print ' "%s\\0" /* Parameter signature */' % (parameter_signature)
-
- for n in f.entry_points:
- print ' "gl%s\\0"' % (n)
-
- [category, num] = api.get_category_for_name( n )
- if category not in abi:
- c = gl_XML.real_category_name(category)
- if not category_list.has_key(c):
- category_list[ c ] = []
-
- category_list[ c ].append( f )
-
- print ' "";'
- print '#endif'
- print ''
-
- keys = category_list.keys()
- keys.sort()
-
- for category in keys:
- print '#if defined(need_%s)' % (category)
- print 'static const struct dri_extension_function %s_functions[] = {' % (category)
-
- for f in category_list[ category ]:
- if any_entrypoints_in_abi(f, abi, api):
- index_name = "-1"
- else:
- index_name = "%s_remap_index" % (f.name)
-
- print ' { %s_names, %s, %d },' % (f.name, index_name, f.offset)
-
-
- print ' { NULL, 0, 0 }'
- print '};'
- print '#endif'
- print ''
-
- return
-
-
-class PrintInitDispatch(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "extension_helper.py (from Mesa)"
- self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
- return
-
-
- def do_function_body(self, api, abi, vtxfmt_only):
- last_condition_string = None
- for f in api.functionIterateByOffset():
- if (f.name in vtxfmt) and not vtxfmt_only:
- continue
-
- if (f.name not in vtxfmt) and vtxfmt_only:
- continue
-
- condition = condition_for_function(f, abi, 1)
- condition_string = string.join(condition, " || ")
-
- if condition_string != last_condition_string:
- if last_condition_string:
- print '#endif /* %s */' % (last_condition_string)
-
- if condition_string:
- print '#if %s' % (condition_string)
-
- if vtxfmt_only:
- print ' disp->%s = vfmt->%s;' % (f.name, f.name)
- else:
- print ' disp->%s = _mesa_%s;' % (f.name, f.name)
-
- last_condition_string = condition_string
-
- if last_condition_string:
- print '#endif /* %s */' % (last_condition_string)
-
-
-
- def printBody(self, api):
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
- print 'void driver_init_exec_table(struct _glapi_table *disp)'
- print '{'
- self.do_function_body(api, abi, 0)
- print '}'
- print ''
- print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)'
- print '{'
- self.do_function_body(api, abi, 1)
- print '}'
-
- return
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
- print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'."
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
- except Exception,e:
- show_usage()
-
- mode = "extensions"
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- if arg == '-m':
- mode = val
-
-
- api = gl_XML.parse_GL_API( file_name )
-
- if mode == "extensions":
- printer = PrintGlExtensionGlue()
- elif mode == "exec_init":
- printer = PrintInitDispatch()
- else:
- show_usage()
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/glX_XML.py b/nx-X11/extras/Mesa/src/mesa/glapi/glX_XML.py
deleted file mode 100644
index 7cc9d8d66..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/glX_XML.py
+++ /dev/null
@@ -1,531 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML
-import license
-import sys, getopt, string
-
-
-class glx_item_factory(gl_XML.gl_item_factory):
- """Factory to create GLX protocol oriented objects derived from gl_item."""
-
- def create_item(self, name, element, context):
- if name == "function":
- return glx_function(element, context)
- elif name == "enum":
- return glx_enum(element, context)
- elif name == "api":
- return glx_api(self)
- else:
- return gl_XML.gl_item_factory.create_item(self, name, element, context)
-
-
-class glx_enum(gl_XML.gl_enum):
- def __init__(self, element, context):
- gl_XML.gl_enum.__init__(self, element, context)
-
- self.functions = {}
-
- child = element.children
- while child:
- if child.type == "element" and child.name == "size":
- n = child.nsProp( "name", None )
- c = child.nsProp( "count", None )
- m = child.nsProp( "mode", None )
-
- if not c:
- c = self.default_count
- else:
- c = int(c)
-
- if m == "get":
- mode = 0
- else:
- mode = 1
-
- if not self.functions.has_key(n):
- self.functions[ n ] = [c, mode]
-
- child = child.next
-
- return
-
-
-class glx_function(gl_XML.gl_function):
- def __init__(self, element, context):
- self.glx_rop = 0
- self.glx_sop = 0
- self.glx_vendorpriv = 0
-
- # If this is set to true, it means that GLdouble parameters should be
- # written to the GLX protocol packet in the order they appear in the
- # prototype. This is different from the "classic" ordering. In the
- # classic ordering GLdoubles are written to the protocol packet first,
- # followed by non-doubles. NV_vertex_program was the first extension
- # to break with this tradition.
-
- self.glx_doubles_in_order = 0
-
- self.vectorequiv = None
- self.output = None
- self.can_be_large = 0
- self.reply_always_array = 0
- self.dimensions_in_reply = 0
- self.img_reset = None
-
- self.server_handcode = 0
- self.client_handcode = 0
- self.ignore = 0
-
- self.count_parameter_list = []
- self.counter_list = []
- self.parameters_by_name = {}
- self.offsets_calculated = 0
-
- gl_XML.gl_function.__init__(self, element, context)
- return
-
-
- def process_element(self, element):
- gl_XML.gl_function.process_element(self, element)
-
- self.vectorequiv = element.nsProp( "vectorequiv", None )
-
-
- if element.nsProp( "name", None ) == self.name:
- for param in self.parameters:
- self.parameters_by_name[ param.name ] = param
-
- if len(param.count_parameter_list):
- self.count_parameter_list.extend( param.count_parameter_list )
-
- if param.counter and param.counter not in self.counter_list:
- self.counter_list.append(param.counter)
-
-
- child = element.children
- while child:
- if child.type == "element":
- if child.name == "glx":
- rop = child.nsProp( 'rop', None )
- sop = child.nsProp( 'sop', None )
- vop = child.nsProp( 'vendorpriv', None )
-
- if rop:
- self.glx_rop = int(rop)
- else:
- self.glx_rop = 0
-
- if sop:
- self.glx_sop = int(sop)
- else:
- self.glx_sop = 0
-
- if vop:
- self.glx_vendorpriv = int(vop)
- else:
- self.glx_vendorpriv = 0
-
- self.img_reset = child.nsProp( 'img_reset', None )
-
- # The 'handcode' attribute can be one of 'true',
- # 'false', 'client', or 'server'.
-
- handcode = child.nsProp( 'handcode', None )
- if handcode == "false":
- self.server_handcode = 0
- self.client_handcode = 0
- elif handcode == "true":
- self.server_handcode = 1
- self.client_handcode = 1
- elif handcode == "client":
- self.server_handcode = 0
- self.client_handcode = 1
- elif handcode == "server":
- self.server_handcode = 1
- self.client_handcode = 0
- else:
- raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name))
-
- self.ignore = gl_XML.is_attr_true( child, 'ignore' )
- self.can_be_large = gl_XML.is_attr_true( child, 'large' )
- self.glx_doubles_in_order = gl_XML.is_attr_true( child, 'doubles_in_order' )
- self.reply_always_array = gl_XML.is_attr_true( child, 'always_array' )
- self.dimensions_in_reply = gl_XML.is_attr_true( child, 'dimensions_in_reply' )
-
- child = child.next
-
-
- # Do some validation of the GLX protocol information. As
- # new tests are discovered, they should be added here.
-
- for param in self.parameters:
- if param.is_output and self.glx_rop != 0:
- raise RuntimeError("Render / RenderLarge commands cannot have outputs (%s)." % (self.name))
-
- return
-
-
- def has_variable_size_request(self):
- """Determine if the GLX request packet is variable sized.
-
- The GLX request packet is variable sized in several common
- situations.
-
- 1. The function has a non-output parameter that is counted
- by another parameter (e.g., the 'textures' parameter of
- glDeleteTextures).
-
- 2. The function has a non-output parameter whose count is
- determined by another parameter that is an enum (e.g., the
- 'params' parameter of glLightfv).
-
- 3. The function has a non-output parameter that is an
- image.
-
- 4. The function must be hand-coded on the server.
- """
-
- if self.glx_rop == 0:
- return 0
-
- if self.server_handcode or self.images:
- return 1
-
- for param in self.parameters:
- if not param.is_output:
- if param.counter or len(param.count_parameter_list):
- return 1
-
- return 0
-
-
- def variable_length_parameter(self):
- for param in self.parameters:
- if not param.is_output:
- if param.counter or len(param.count_parameter_list):
- return param
-
- return None
-
-
- def calculate_offsets(self):
- if not self.offsets_calculated:
- # Calculate the offset of the first function parameter
- # in the GLX command packet. This byte offset is
- # measured from the end of the Render / RenderLarge
- # header. The offset for all non-pixel commends is
- # zero. The offset for pixel commands depends on the
- # number of dimensions of the pixel data.
-
- if len(self.images) and not self.images[0].is_output:
- [dim, junk, junk, junk, junk] = self.images[0].get_dimensions()
-
- # The base size is the size of the pixel pack info
- # header used by images with the specified number
- # of dimensions.
-
- if dim <= 2:
- offset = 20
- elif dim <= 4:
- offset = 36
- else:
- raise RuntimeError('Invalid number of dimensions %u for parameter "%s" in function "%s".' % (dim, self.image.name, self.name))
- else:
- offset = 0
-
- for param in self.parameterIterateGlxSend():
- if param.img_null_flag:
- offset += 4
-
- if param.name != self.img_reset:
- param.offset = offset
- if not param.is_variable_length():
- offset += param.size()
-
- if self.pad_after( param ):
- offset += 4
-
-
- self.offsets_calculated = 1
- return
-
-
- def offset_of(self, param_name):
- self.calculate_offsets()
- return self.parameters_by_name[ param_name ].offset
-
-
- def parameterIterateGlxSend(self, include_variable_parameters = 1):
- """Create an iterator for parameters in GLX request order."""
-
- # The parameter lists are usually quite short, so it's easier
- # (i.e., less code) to just generate a new list with the
- # required elements than it is to create a new iterator class.
-
- temp = [ [], [], [] ]
- for param in self.parameters:
- if param.is_output: continue
-
- if param.is_variable_length():
- temp[2].append( param )
- elif not self.glx_doubles_in_order and param.is_64_bit():
- temp[0].append( param )
- else:
- temp[1].append( param )
-
- parameters = temp[0]
- parameters.extend( temp[1] )
- if include_variable_parameters:
- parameters.extend( temp[2] )
- return parameters.__iter__()
-
-
- def parameterIterateCounters(self):
- temp = []
- for name in self.counter_list:
- temp.append( self.parameters_by_name[ name ] )
-
- return temp.__iter__()
-
-
- def parameterIterateOutputs(self):
- temp = []
- for p in self.parameters:
- if p.is_output:
- temp.append( p )
-
- return temp
-
-
- def command_fixed_length(self):
- """Return the length, in bytes as an integer, of the
- fixed-size portion of the command."""
-
- if len(self.parameters) == 0:
- return 0
-
- self.calculate_offsets()
-
- size = 0
- for param in self.parameterIterateGlxSend(0):
- if param.name != self.img_reset:
- if size == 0:
- size = param.offset + param.size()
- else:
- size += param.size()
-
- if self.pad_after( param ):
- size += 4
-
- for param in self.images:
- if param.img_null_flag or param.is_output:
- size += 4
-
- return size
-
-
- def command_variable_length(self):
- """Return the length, as a string, of the variable-sized
- portion of the command."""
-
- size_string = ""
- for p in self.parameterIterateGlxSend():
- if (not p.is_output) and (p.is_variable_length() or p.is_image()):
- # FIXME Replace the 1 in the size_string call
- # FIXME w/0 to eliminate some un-needed parnes
- # FIXME This would already be done, but it
- # FIXME adds some extra diffs to the generated
- # FIXME code.
-
- size_string = size_string + " + __GLX_PAD(%s)" % (p.size_string(1))
-
- return size_string
-
-
- def command_length(self):
- size = self.command_fixed_length()
-
- if self.glx_rop != 0:
- size += 4
-
- size = ((size + 3) & ~3)
- return "%u%s" % (size, self.command_variable_length())
-
-
- def opcode_real_value(self):
- """Get the true numeric value of the GLX opcode
-
- Behaves similarly to opcode_value, except for
- X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands.
- In these cases the value for the GLX opcode field (i.e.,
- 16 for X_GLXVendorPrivate or 17 for
- X_GLXVendorPrivateWithReply) is returned. For other 'single'
- commands, the opcode for the command (e.g., 101 for
- X_GLsop_NewList) is returned."""
-
- if self.glx_vendorpriv != 0:
- if self.needs_reply():
- return 17
- else:
- return 16
- else:
- return self.opcode_value()
-
-
- def opcode_value(self):
- """Get the unique protocol opcode for the glXFunction"""
-
- if (self.glx_rop == 0) and self.vectorequiv:
- equiv = self.context.functions_by_name[ self.vectorequiv ]
- self.glx_rop = equiv.glx_rop
-
-
- if self.glx_rop != 0:
- return self.glx_rop
- elif self.glx_sop != 0:
- return self.glx_sop
- elif self.glx_vendorpriv != 0:
- return self.glx_vendorpriv
- else:
- return -1
-
-
- def opcode_rop_basename(self):
- """Return either the name to be used for GLX protocol enum.
-
- Returns either the name of the function or the name of the
- name of the equivalent vector (e.g., glVertex3fv for
- glVertex3f) function."""
-
- if self.vectorequiv == None:
- return self.name
- else:
- return self.vectorequiv
-
-
- def opcode_name(self):
- """Get the unique protocol enum name for the glXFunction"""
-
- if (self.glx_rop == 0) and self.vectorequiv:
- equiv = self.context.functions_by_name[ self.vectorequiv ]
- self.glx_rop = equiv.glx_rop
- self.glx_doubles_in_order = equiv.glx_doubles_in_order
-
-
- if self.glx_rop != 0:
- return "X_GLrop_%s" % (self.opcode_rop_basename())
- elif self.glx_sop != 0:
- return "X_GLsop_%s" % (self.name)
- elif self.glx_vendorpriv != 0:
- return "X_GLvop_%s" % (self.name)
- else:
- raise RuntimeError('Function "%s" has no opcode.' % (self.name))
-
-
- def opcode_real_name(self):
- """Get the true protocol enum name for the GLX opcode
-
- Behaves similarly to opcode_name, except for
- X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands.
- In these cases the string 'X_GLXVendorPrivate' or
- 'X_GLXVendorPrivateWithReply' is returned. For other
- single or render commands 'X_GLsop' or 'X_GLrop' plus the
- name of the function returned."""
-
- if self.glx_vendorpriv != 0:
- if self.needs_reply():
- return "X_GLXVendorPrivateWithReply"
- else:
- return "X_GLXVendorPrivate"
- else:
- return self.opcode_name()
-
-
- def needs_reply(self):
- try:
- x = self._needs_reply
- except Exception, e:
- x = 0
- if self.return_type != 'void':
- x = 1
-
- for param in self.parameters:
- if param.is_output:
- x = 1
- break
-
- self._needs_reply = x
-
- return x
-
-
- def pad_after(self, p):
- """Returns the name of the field inserted after the
- specified field to pad out the command header."""
-
- for image in self.images:
- if image.img_pad_dimensions:
- if not image.height:
- if p.name == image.width:
- return "height"
- elif p.name == image.img_xoff:
- return "yoffset"
- elif not image.extent:
- if p.name == image.depth:
- # Should this be "size4d"?
- return "extent"
- elif p.name == image.img_zoff:
- return "woffset"
-
- return None
-
-
-class glx_function_iterator:
- """Class to iterate over a list of glXFunctions"""
-
- def __init__(self, context):
- self.iterator = context.functionIterateByOffset()
- return
-
-
- def __iter__(self):
- return self
-
-
- def next(self):
- f = self.iterator.next()
- if f.ignore or not (f.glx_rop or f.glx_sop or f.glx_vendorpriv or f.vectorequiv or f.client_handcode):
- return self.next()
- else:
- return f
-
-
-class glx_api(gl_XML.gl_api):
- def functionIterateGlx(self):
- return glx_function_iterator(self)
-
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/glX_doc.py b/nx-X11/extras/Mesa/src/mesa/glapi/glX_doc.py
deleted file mode 100644
index e9fbbe6f1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/glX_doc.py
+++ /dev/null
@@ -1,280 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, glX_XML, glX_proto_common, license
-import sys, getopt
-
-
-class glx_doc_item_factory(glX_proto_common.glx_proto_item_factory):
- """Factory to create GLX protocol documentation oriented objects derived from glItem."""
-
- def create_item(self, name, element, context):
- if name == "parameter":
- return glx_doc_parameter(element, context)
- else:
- return glX_proto_common.glx_proto_item_factory.create_item(self, name, element, context)
-
-
-class glx_doc_parameter(gl_XML.gl_parameter):
- def packet_type(self, type_dict):
- """Get the type string for the packet header
-
- GLX protocol documentation uses type names like CARD32,
- FLOAT64, LISTofCARD8, and ENUM. This function converts the
- type of the parameter to one of these names."""
-
- list_of = ""
- if self.is_array():
- list_of = "LISTof"
-
- t_name = self.get_base_type_string()
- if not type_dict.has_key( t_name ):
- type_name = "CARD8"
- else:
- type_name = type_dict[ t_name ]
-
- return "%s%s" % (list_of, type_name)
-
-
- def packet_size(self):
- p = None
- s = self.size()
- if s == 0:
- a_prod = "n"
- b_prod = self.p_type.size
-
- if not self.count_parameter_list and self.counter:
- a_prod = self.counter
- elif self.count_parameter_list and not self.counter or self.is_output:
- pass
- elif self.count_parameter_list and self.counter:
- b_prod = self.counter
- else:
- raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name))
-
- ss = "%s*%s" % (a_prod, b_prod)
-
- return [ss, p]
- else:
- if s % 4 != 0:
- p = "p"
-
- return [str(s), p]
-
-class PrintGlxProtoText(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
- self.license = ""
-
-
- def printHeader(self):
- return
-
-
- def body_size(self, f):
- # At some point, refactor this function and
- # glXFunction::command_payload_length.
-
- size = 0;
- size_str = ""
- pad_str = ""
- plus = ""
- for p in f.parameterIterateGlxSend():
- [s, pad] = p.packet_size()
- try:
- size += int(s)
- except Exception,e:
- size_str += "%s%s" % (plus, s)
- plus = "+"
-
- if pad != None:
- pad_str = pad
-
- return [size, size_str, pad_str]
-
-
- def print_render_header(self, f):
- [size, size_str, pad_str] = self.body_size(f)
- size += 4;
-
- if size_str == "":
- s = "%u" % ((size + 3) & ~3)
- elif pad_str != "":
- s = "%u+%s+%s" % (size, size_str, pad_str)
- else:
- s = "%u+%s" % (size, size_str)
-
- print ' 2 %-15s rendering command length' % (s)
- print ' 2 %-4u rendering command opcode' % (f.glx_rop)
- return
-
-
- def print_single_header(self, f):
- [size, size_str, pad_str] = self.body_size(f)
- size = ((size + 3) / 4) + 2;
-
- if f.glx_vendorpriv != 0:
- size += 1
-
- print ' 1 CARD8 opcode (X assigned)'
- print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name())
-
- if size_str == "":
- s = "%u" % (size)
- elif pad_str != "":
- s = "%u+((%s+%s)/4)" % (size, size_str, pad_str)
- else:
- s = "%u+((%s)/4)" % (size, size_str)
-
- print ' 2 %-15s request length' % (s)
-
- if f.glx_vendorpriv != 0:
- print ' 4 %-4u vendor specific opcode' % (f.opcode_value())
-
- print ' 4 GLX_CONTEXT_TAG context tag'
-
- return
-
-
- def print_reply(self, f):
- print ' =>'
- print ' 1 1 reply'
- print ' 1 unused'
- print ' 2 CARD16 sequence number'
-
- if f.output == None:
- print ' 4 0 reply length'
- elif f.reply_always_array:
- print ' 4 m reply length'
- else:
- print ' 4 m reply length, m = (n == 1 ? 0 : n)'
-
-
- output = None
- for x in f.parameterIterateOutputs():
- output = x
- break
-
-
- unused = 24
- if f.return_type != 'void':
- print ' 4 %-15s return value' % (f.return_type)
- unused -= 4
- elif output != None:
- print ' 4 unused'
- unused -= 4
-
- if output != None:
- print ' 4 CARD32 n'
- unused -= 4
-
- if output != None:
- if not f.reply_always_array:
- print ''
- print ' if (n = 1) this follows:'
- print ''
- print ' 4 CARD32 %s' % (output.name)
- print ' %-2u unused' % (unused - 4)
- print ''
- print ' otherwise this follows:'
- print ''
-
- print ' %-2u unused' % (unused)
-
- [s, pad] = output.packet_size()
- print ' %-8s %-15s %s' % (s, output.packet_type( self.type_map ), output.name)
- if pad != None:
- try:
- bytes = int(s)
- bytes = 4 - (bytes & 3)
- print ' %-8u %-15s unused' % (bytes, "")
- except Exception,e:
- print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s)
- else:
- print ' %-2u unused' % (unused)
-
-
- def print_body(self, f):
- for p in f.parameterIterateGlxSend():
- [s, pad] = p.packet_size()
- print ' %-8s %-15s %s' % (s, p.packet_type( self.type_map ), p.name)
- if pad != None:
- try:
- bytes = int(s)
- bytes = 4 - (bytes & 3)
- print ' %-8u %-15s unused' % (bytes, "")
- except Exception,e:
- print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s)
-
- def printBody(self, api):
- self.type_map = {}
- for t in api.typeIterate():
- self.type_map[ "GL" + t.name ] = t.glx_name
-
-
- # At some point this should be expanded to support pixel
- # functions, but I'm not going to lose any sleep over it now.
-
- for f in api.functionIterateByOffset():
- if f.client_handcode or f.server_handcode or f.vectorequiv or len(f.get_images()):
- continue
-
-
- if f.glx_rop:
- print ' %s' % (f.name)
- self.print_render_header(f)
- elif f.glx_sop or f.glx_vendorpriv:
- print ' %s' % (f.name)
- self.print_single_header(f)
- else:
- continue
-
- self.print_body(f)
-
- if f.needs_reply():
- self.print_reply(f)
-
- print ''
- return
-
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
-
- api = gl_XML.parse_GL_API( file_name, glx_doc_item_factory() )
-
- printer = PrintGlxProtoText()
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_common.py b/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_common.py
deleted file mode 100644
index 744896357..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_common.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, glX_XML
-import string
-
-
-class glx_proto_item_factory(glX_XML.glx_item_factory):
- """Factory to create GLX protocol oriented objects derived from gl_item."""
-
- def create_item(self, name, element, context):
- if name == "type":
- return glx_proto_type(element, context)
- else:
- return glX_XML.glx_item_factory.create_item(self, name, element, context)
-
-
-class glx_proto_type(gl_XML.gl_type):
- def __init__(self, element, context):
- gl_XML.gl_type.__init__(self, element, context)
-
- self.glx_name = element.nsProp( "glx_name", None )
- return
-
-
-class glx_print_proto(gl_XML.gl_print_base):
- def size_call(self, func):
- """Create C code to calculate 'compsize'.
-
- Creates code to calculate 'compsize'. If the function does
- not need 'compsize' to be calculated, None will be
- returned."""
-
- compsize = None
-
- for param in func.parameterIterator():
- if not param.is_output:
- if param.is_image():
- [dim, w, h, d, junk] = param.get_dimensions()
-
- compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, param.img_format, param.img_type, param.img_target)
- if not param.img_send_null:
- compsize = '(%s != NULL) ? %s : 0' % (param.name, compsize)
-
- return compsize
-
- elif len(param.count_parameter_list):
- parameters = string.join( param.count_parameter_list, "," )
- compsize = "__gl%s_size(%s)" % (func.name, parameters)
-
- return compsize
-
- return None
-
-
- def emit_packet_size_calculation(self, f, bias):
- # compsize is only used in the command size calculation if
- # the function has a non-output parameter that has a non-empty
- # counter_parameter_list.
-
- compsize = self.size_call(f)
- if compsize:
- print ' const GLuint compsize = %s;' % (compsize)
-
- if bias:
- print ' const GLuint cmdlen = %s - %u;' % (f.command_length(), bias)
- else:
- print ' const GLuint cmdlen = %s;' % (f.command_length())
-
- #print ''
- return compsize
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_send.py b/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_send.py
deleted file mode 100644
index 53a979591..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_send.py
+++ /dev/null
@@ -1,1044 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, glX_XML, glX_proto_common, license
-import sys, getopt, copy, string
-
-def hash_pixel_function(func):
- """Generate a 'unique' key for a pixel function. The key is based on
- the parameters written in the command packet. This includes any
- padding that might be added for the original function and the 'NULL
- image' flag."""
-
-
- h = ""
- hash_pre = ""
- hash_suf = ""
- for param in func.parameterIterateGlxSend():
- if param.is_image():
- [dim, junk, junk, junk, junk] = param.get_dimensions()
-
- d = (dim + 1) & ~1
- hash_pre = "%uD%uD_" % (d - 1, d)
-
- if param.img_null_flag:
- hash_suf = "_NF"
-
- h += "%u" % (param.size())
-
- if func.pad_after(param):
- h += "4"
-
-
- n = func.name.replace("%uD" % (dim), "")
- n = "__glx_%s_%uD%uD" % (n, d - 1, d)
-
- h = hash_pre + h + hash_suf
- return [h, n]
-
-
-class glx_pixel_function_stub(glX_XML.glx_function):
- """Dummy class used to generate pixel "utility" functions that are
- shared by multiple dimension image functions. For example, these
- objects are used to generate shared functions used to send GLX
- protocol for TexImage1D and TexImage2D, TexSubImage1D and
- TexSubImage2D, etc."""
-
- def __init__(self, func, name):
- # The parameters to the utility function are the same as the
- # parameters to the real function except for the added "pad"
- # parameters.
-
- self.name = name
- self.images = []
- self.parameters = []
- self.parameters_by_name = {}
- for _p in func.parameterIterator():
- p = copy.copy(_p)
- self.parameters.append(p)
- self.parameters_by_name[ p.name ] = p
-
-
- if p.is_image():
- self.images.append(p)
- p.height = "height"
-
- if p.img_yoff == None:
- p.img_yoff = "yoffset"
-
- if p.depth:
- if p.extent == None:
- p.extent = "extent"
-
- if p.img_woff == None:
- p.img_woff = "woffset"
-
-
- pad_name = func.pad_after(p)
- if pad_name:
- pad = copy.copy(p)
- pad.name = pad_name
- self.parameters.append(pad)
- self.parameters_by_name[ pad.name ] = pad
-
-
- self.return_type = func.return_type
-
- self.glx_rop = ~0
- self.glx_sop = 0
- self.glx_vendorpriv = 0
-
- self.glx_doubles_in_order = func.glx_doubles_in_order
-
- self.vectorequiv = None
- self.output = None
- self.can_be_large = func.can_be_large
- self.reply_always_array = func.reply_always_array
- self.dimensions_in_reply = func.dimensions_in_reply
- self.img_reset = None
-
- self.server_handcode = 0
- self.client_handcode = 0
- self.ignore = 0
-
- self.count_parameter_list = func.count_parameter_list
- self.counter_list = func.counter_list
- self.offsets_calculated = 0
- return
-
-
-class PrintGlxProtoStubs(glX_proto_common.glx_print_proto):
- def __init__(self):
- glX_proto_common.glx_print_proto.__init__(self)
- self.name = "glX_proto_send.py (from Mesa)"
- self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004, 2005", "IBM")
-
-
- self.last_category = ""
- self.generic_sizes = [3, 4, 6, 8, 12, 16, 24, 32]
- self.pixel_stubs = {}
- self.debug = 0
- return
-
- def printRealHeader(self):
- print ''
- print '#include <GL/gl.h>'
- print '#include "indirect.h"'
- print '#include "glxclient.h"'
- print '#include "indirect_size.h"'
- print '#include <GL/glxproto.h>'
- print '#ifdef USE_XCB'
- print '#include <X11/xcl.h>'
- print '#include <X11/XCB/xcb.h>'
- print '#include <X11/XCB/glx.h>'
- print '#endif /* USE_XCB */'
-
- print ''
- print '#define __GLX_PAD(n) (((n) + 3) & ~3)'
- print ''
- self.printFastcall()
- self.printNoinline()
- print ''
- print '#if !defined __GNUC__ || __GNUC__ < 3'
- print '# define __builtin_expect(x, y) x'
- print '#endif'
- print ''
- print '/* If the size and opcode values are known at compile-time, this will, on'
- print ' * x86 at least, emit them with a single instruction.'
- print ' */'
- print '#define emit_header(dest, op, size) \\'
- print ' do { union { short s[2]; int i; } temp; \\'
- print ' temp.s[0] = (size); temp.s[1] = (op); \\'
- print ' *((int *)(dest)) = temp.i; } while(0)'
- print ''
- print """NOINLINE CARD32
-__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array )
-{
- xGLXSingleReply reply;
-
- (void) _XReply(dpy, (xReply *) & reply, 0, False);
- if (size != 0) {
- if ((reply.length > 0) || reply_is_always_array) {
- const GLint bytes = (reply_is_always_array)
- ? (4 * reply.length) : (reply.size * size);
- const GLint extra = 4 - (bytes & 3);
-
- _XRead(dpy, dest, bytes);
- if ( extra < 4 ) {
- _XEatData(dpy, extra);
- }
- }
- else {
- (void) memcpy( dest, &(reply.pad3), size);
- }
- }
-
- return reply.retval;
-}
-
-NOINLINE void
-__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim,
- GLint width, GLint height, GLint depth, GLenum format, GLenum type,
- void * dest, GLboolean dimensions_in_reply )
-{
- xGLXSingleReply reply;
- GLint size;
-
- (void) _XReply(dpy, (xReply *) & reply, 0, False);
-
- if ( dimensions_in_reply ) {
- width = reply.pad3;
- height = reply.pad4;
- depth = reply.pad5;
-
- if ((height == 0) || (max_dim < 2)) { height = 1; }
- if ((depth == 0) || (max_dim < 3)) { depth = 1; }
- }
-
- size = reply.length * 4;
- if (size != 0) {
- void * buf = Xmalloc( size );
-
- if ( buf == NULL ) {
- _XEatData(dpy, size);
- __glXSetError(gc, GL_OUT_OF_MEMORY);
- }
- else {
- const GLint extra = 4 - (size & 3);
-
- _XRead(dpy, buf, size);
- if ( extra < 4 ) {
- _XEatData(dpy, extra);
- }
-
- __glEmptyImage(gc, 3, width, height, depth, format, type,
- buf, dest);
- Xfree(buf);
- }
- }
-}
-
-#define X_GLXSingle 0
-
-NOINLINE FASTCALL GLubyte *
-__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen )
-{
- xGLXSingleReq * req;
- Display * const dpy = gc->currentDpy;
-
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- LockDisplay(dpy);
- GetReqExtra(GLXSingle, cmdlen, req);
- req->reqType = gc->majorOpcode;
- req->contextTag = gc->currentContextTag;
- req->glxCode = sop;
- return (GLubyte *)(req) + sz_xGLXSingleReq;
-}
-
-NOINLINE FASTCALL GLubyte *
-__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen )
-{
- xGLXVendorPrivateReq * req;
- Display * const dpy = gc->currentDpy;
-
- (void) __glXFlushRenderBuffer(gc, gc->pc);
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivate, cmdlen, req);
- req->reqType = gc->majorOpcode;
- req->glxCode = code;
- req->vendorCode = vop;
- req->contextTag = gc->currentContextTag;
- return (GLubyte *)(req) + sz_xGLXVendorPrivateReq;
-}
-
-const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
-#define zero (__glXDefaultPixelStore+0)
-#define one (__glXDefaultPixelStore+8)
-#define default_pixel_store_1D (__glXDefaultPixelStore+4)
-#define default_pixel_store_1D_size 20
-#define default_pixel_store_2D (__glXDefaultPixelStore+4)
-#define default_pixel_store_2D_size 20
-#define default_pixel_store_3D (__glXDefaultPixelStore+0)
-#define default_pixel_store_3D_size 36
-#define default_pixel_store_4D (__glXDefaultPixelStore+0)
-#define default_pixel_store_4D_size 36
-"""
-
- for size in self.generic_sizes:
- self.print_generic_function(size)
- return
-
-
- def printBody(self, api):
-
- self.pixel_stubs = {}
- generated_stubs = []
-
- for func in api.functionIterateGlx():
- if func.client_handcode: continue
-
- # If the function is a pixel function with a certain
- # GLX protocol signature, create a fake stub function
- # for it. For example, create a single stub function
- # that is used to implement both glTexImage1D and
- # glTexImage2D.
-
- if func.glx_rop != 0:
- do_it = 0
- for image in func.get_images():
- if image.img_pad_dimensions:
- do_it = 1
- break
-
-
- if do_it:
- [h, n] = hash_pixel_function(func)
-
-
- self.pixel_stubs[ func.name ] = n
- if h not in generated_stubs:
- generated_stubs.append(h)
-
- fake_func = glx_pixel_function_stub( func, n )
- self.printFunction( fake_func )
-
-
- self.printFunction( func )
-
- return
-
-
- def printFunction(self, func):
- if func.glx_rop == ~0:
- print 'static %s' % (func.return_type)
- print '%s( unsigned opcode, unsigned dim, %s )' % (func.name, func.get_parameter_string())
- else:
- print '#define %s %d' % (func.opcode_name(), func.opcode_value())
-
- print '%s' % (func.return_type)
- print '__indirect_gl%s(%s)' % (func.name, func.get_parameter_string())
-
-
- print '{'
-
-
- if func.glx_rop != 0 or func.vectorequiv != None:
- if len(func.images):
- self.printPixelFunction(func)
- else:
- self.printRenderFunction(func)
- elif func.glx_sop != 0 or func.glx_vendorpriv != 0:
- self.printSingleFunction(func)
- pass
- else:
- print "/* Missing GLX protocol for %s. */" % (func.name)
-
- print '}'
- print ''
-
- return
-
-
- def print_generic_function(self, n):
- size = (n + 3) & ~3
- print """static FASTCALL NOINLINE void
-generic_%u_byte( GLint rop, const void * ptr )
-{
- __GLXcontext * const gc = __glXGetCurrentContext();
- const GLuint cmdlen = %u;
-
- emit_header(gc->pc, rop, cmdlen);
- (void) memcpy((void *)(gc->pc + 4), ptr, %u);
- gc->pc += cmdlen;
- if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
-}
-""" % (n, size + 4, size)
- return
-
-
- def common_emit_one_arg(self, p, pc, indent, adjust, extra_offset):
- if p.is_array():
- src_ptr = p.name
- else:
- src_ptr = "&" + p.name
-
- if not extra_offset:
- print '%s (void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \
- % (indent, pc, p.offset + adjust, src_ptr, p.size_string() )
- else:
- print '%s (void) memcpy((void *)(%s + %u + %s), (void *)(%s), %s);' \
- % (indent, pc, p.offset + adjust, extra_offset, src_ptr, p.size_string() )
-
- def common_emit_args(self, f, pc, indent, adjust, skip_vla):
- extra_offset = None
-
- for p in f.parameterIterateGlxSend( not skip_vla ):
- if p.name != f.img_reset:
- self.common_emit_one_arg(p, pc, indent, adjust, extra_offset)
-
- if p.is_variable_length():
- temp = p.size_string()
- if extra_offset:
- extra_offset += " + %s" % (temp)
- else:
- extra_offset = temp
-
- return
-
-
- def pixel_emit_args(self, f, pc, indent, large):
- """Emit the arguments for a pixel function. This differs from
- common_emit_args in that pixel functions may require padding
- be inserted (i.e., for the missing width field for
- TexImage1D), and they may also require a 'NULL image' flag
- be inserted before the image data."""
-
- if large:
- adjust = 8
- else:
- adjust = 4
-
- for param in f.parameterIterateGlxSend():
- if not param.is_image():
- self.common_emit_one_arg(param, pc, indent, adjust, None)
-
- if f.pad_after(param):
- print '%s (void) memcpy((void *)(%s + %u), zero, 4);' % (indent, pc, (param.offset + param.size()) + adjust)
-
- else:
- [dim, width, height, depth, extent] = param.get_dimensions()
- if f.glx_rop == ~0:
- dim_str = "dim"
- else:
- dim_str = str(dim)
-
- if param.img_null_flag:
- if large:
- print '%s (void) memcpy((void *)(%s + %u), zero, 4);' % (indent, pc, (param.offset - 4) + adjust)
- else:
- print '%s (void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (indent, pc, (param.offset - 4) + adjust, param.name)
-
-
- pixHeaderPtr = "%s + %u" % (pc, adjust)
- pcPtr = "%s + %u" % (pc, param.offset + adjust)
-
- if not large:
- if param.img_send_null:
- condition = '(compsize > 0) && (%s != NULL)' % (param.name)
- else:
- condition = 'compsize > 0'
-
- print '%s if (%s) {' % (indent, condition)
- print '%s (*gc->fillImage)(gc, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (indent, dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr)
- print '%s }' % (indent)
- print '%s else {' % (indent)
- print '%s (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (indent, pixHeaderPtr, dim, dim)
- print '%s }' % (indent)
- else:
- print '%s __glXSendLargeImage(gc, compsize, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (indent, dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr)
-
- return
-
-
- def large_emit_begin(self, indent, f, op_name = None):
- if not op_name:
- op_name = f.opcode_real_name()
-
- print '%s const GLint op = %s;' % (indent, op_name)
- print '%s const GLuint cmdlenLarge = cmdlen + 4;' % (indent)
- print '%s GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
- print '%s (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);' % (indent)
- print '%s (void) memcpy((void *)(pc + 4), (void *)(&op), 4);' % (indent)
- return
-
-
- def common_func_print_just_start(self, f):
- print ' __GLXcontext * const gc = __glXGetCurrentContext();'
-
- # The only reason that single and vendor private commands need
- # a variable called 'dpy' is becuase they use the SyncHandle
- # macro. For whatever brain-dead reason, that macro is hard-
- # coded to use a variable called 'dpy' instead of taking a
- # parameter.
-
- # FIXME Simplify the logic related to skip_condition and
- # FIXME condition_list in this function. Basically, remove
- # FIXME skip_condition, and just append the "dpy != NULL" type
- # FIXME condition to condition_list from the start. The only
- # FIXME reason it's done in this confusing way now is to
- # FIXME minimize the diffs in the generated code.
-
- if not f.glx_rop:
- for p in f.parameterIterateOutputs():
- if p.is_image():
- print ' const __GLXattribute * const state = gc->client_state_private;'
- break
-
- print ' Display * const dpy = gc->currentDpy;'
- skip_condition = "dpy != NULL"
- elif f.can_be_large:
- skip_condition = "gc->currentDpy != NULL"
- else:
- skip_condition = None
-
-
- if f.return_type != 'void':
- print ' %s retval = (%s) 0;' % (f.return_type, f.return_type)
-
-
- self.emit_packet_size_calculation(f, 0)
-
- condition_list = []
- for p in f.parameterIterateCounters():
- condition_list.append( "%s >= 0" % (p.name) )
-
- if skip_condition:
- condition_list.append( skip_condition )
-
- if len( condition_list ) > 0:
- if len( condition_list ) > 1:
- skip_condition = "(%s)" % (string.join( condition_list, ") && (" ))
- else:
- skip_condition = "%s" % (condition_list.pop(0))
-
- print ' if (__builtin_expect(%s, 1)) {' % (skip_condition)
- return 1
- else:
- return 0
-
-
- def printSingleFunction(self, f):
- self.common_func_print_just_start(f)
-
- if self.debug:
- print ' printf( "Enter %%s...\\n", "gl%s" );' % (f.name)
-
- if f.glx_vendorpriv == 0:
-
- # XCB specific:
- print '#ifdef USE_XCB'
- if self.debug:
- print ' printf("\\tUsing XCB.\\n");'
- print ' XCBConnection *c = XCBConnectionOfDisplay(dpy);'
- print ' (void) __glXFlushRenderBuffer(gc, gc->pc);'
- xcb_name = 'XCBGlx%s' % f.name
-
- iparams=[]
- extra_iparams = []
- output = None
- for p in f.parameterIterator():
- if p.is_output:
- output = p
-
- if p.is_image():
- if p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP":
- extra_iparams.append("state->storePack.swapEndian")
- else:
- extra_iparams.append("0")
-
- # Hardcode this in. lsb_first param (apparently always GL_FALSE)
- # also present in GetPolygonStipple, but taken care of above.
- if xcb_name == "XCBGlxReadPixels":
- extra_iparams.append("0")
- else:
- iparams.append(p.name)
-
-
- xcb_request = '%s(%s)' % (xcb_name, ", ".join(["c", "gc->currentContextTag"] + iparams + extra_iparams))
-
- if f.needs_reply():
- print ' %sRep *reply = %sReply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request)
- if output and f.reply_always_array:
- print ' (void)memcpy(%s, %sData(reply), %sDataLength(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
-
- elif output and not f.reply_always_array:
- if not output.is_image():
- print ' if (%sDataLength(reply) == 0)' % (xcb_name)
- print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name)
- print ' else'
- print ' (void)memcpy(%s, %sData(reply), %sDataLength(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
-
-
- if f.return_type != 'void':
- print ' retval = reply->ret_val;'
- print ' free(reply);'
- else:
- print ' ' + xcb_request + ';'
- print '#else'
- # End of XCB specific.
-
-
- if f.parameters != []:
- pc_decl = "GLubyte const * pc ="
- else:
- pc_decl = "(void)"
-
- if f.glx_vendorpriv != 0:
- print ' %s __glXSetupVendorRequest(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_name())
- else:
- print ' %s __glXSetupSingleRequest(gc, %s, cmdlen);' % (pc_decl, f.opcode_name())
-
- self.common_emit_args(f, "pc", " ", 0, 0)
-
- images = f.get_images()
-
- for img in images:
- if img.is_output:
- o = f.command_fixed_length() - 4
- print ' *(int32_t *)(pc + %u) = 0;' % (o)
- if img.img_format != "GL_COLOR_INDEX" or img.img_type != "GL_BITMAP":
- print ' * (int8_t *)(pc + %u) = state->storePack.swapEndian;' % (o)
-
- if f.img_reset:
- print ' * (int8_t *)(pc + %u) = %s;' % (o + 1, f.img_reset)
-
-
- return_name = ''
- if f.needs_reply():
- if f.return_type != 'void':
- return_name = " retval"
- return_str = " retval = (%s)" % (f.return_type)
- else:
- return_str = " (void)"
-
- got_reply = 0
-
- for p in f.parameterIterateOutputs():
- if p.is_image():
- [dim, w, h, d, junk] = p.get_dimensions()
- if f.dimensions_in_reply:
- print " __glXReadPixelReply(dpy, gc, %u, 0, 0, 0, %s, %s, %s, GL_TRUE);" % (dim, p.img_format, p.img_type, p.name)
- else:
- print " __glXReadPixelReply(dpy, gc, %u, %s, %s, %s, %s, %s, %s, GL_FALSE);" % (dim, w, h, d, p.img_format, p.img_type, p.name)
-
- got_reply = 1
- else:
- if f.reply_always_array:
- aa = "GL_TRUE"
- else:
- aa = "GL_FALSE"
-
- # gl_parameter.size() returns the size
- # of the entire data item. If the
- # item is a fixed-size array, this is
- # the size of the whole array. This
- # is not what __glXReadReply wants. It
- # wants the size of a single data
- # element in the reply packet.
- # Dividing by the array size (1 for
- # non-arrays) gives us this.
-
- s = p.size() / p.get_element_count()
- print " %s __glXReadReply(dpy, %s, %s, %s);" % (return_str, s, p.name, aa)
- got_reply = 1
-
-
- # If a reply wasn't read to fill an output parameter,
- # read a NULL reply to get the return value.
-
- if not got_reply:
- print " %s __glXReadReply(dpy, 0, NULL, GL_FALSE);" % (return_str)
-
-
- elif self.debug:
- # Only emit the extra glFinish call for functions
- # that don't already require a reply from the server.
- print ' __indirect_glFinish();'
-
- if self.debug:
- print ' printf( "Exit %%s.\\n", "gl%s" );' % (f.name)
-
-
- print ' UnlockDisplay(dpy); SyncHandle();'
-
- if f.glx_vendorpriv == 0:
- print '#endif /* USE_XCB */'
-
- print ' }'
- print ' return%s;' % (return_name)
- return
-
-
- def printPixelFunction(self, f):
- if self.pixel_stubs.has_key( f.name ):
- # Normally gl_function::get_parameter_string could be
- # used. However, this call needs to have the missing
- # dimensions (e.g., a fake height value for
- # glTexImage1D) added in.
-
- p_string = ""
- for param in f.parameterIterateGlxSend():
- p_string += ", " + param.name
-
- if param.is_image():
- [dim, junk, junk, junk, junk] = param.get_dimensions()
-
- if f.pad_after(param):
- p_string += ", 1"
-
- print ' %s(%s, %u%s );' % (self.pixel_stubs[f.name] , f.opcode_name(), dim, p_string)
- return
-
-
- if self.common_func_print_just_start(f):
- indent = " "
- trailer = " }"
- else:
- indent = ""
- trailer = None
-
-
- if f.can_be_large:
- print '%s if (cmdlen <= gc->maxSmallRenderCommandSize) {' % (indent)
- print '%s if ( (gc->pc + cmdlen) > gc->bufEnd ) {' % (indent)
- print '%s (void) __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
- print '%s }' % (indent)
- indent += " "
-
- if f.glx_rop == ~0:
- opcode = "opcode"
- else:
- opcode = f.opcode_real_name()
-
- print '%s emit_header(gc->pc, %s, cmdlen);' % (indent, opcode)
-
- self.pixel_emit_args( f, "gc->pc", indent, 0 )
- print '%s gc->pc += cmdlen;' % (indent)
- print '%s if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' % (indent)
-
- if f.can_be_large:
- print '%s}' % (indent)
- print '%selse {' % (indent)
-
- self.large_emit_begin(indent, f, opcode)
- self.pixel_emit_args( f, "pc", indent, 1 )
-
- print '%s}' % (indent)
-
- if trailer: print trailer
- return
-
-
- def printRenderFunction(self, f):
- # There is a class of GL functions that take a single pointer
- # as a parameter. This pointer points to a fixed-size chunk
- # of data, and the protocol for this functions is very
- # regular. Since they are so regular and there are so many
- # of them, special case them with generic functions. On
- # x86, this saves about 26KB in the libGL.so binary.
-
- if f.variable_length_parameter() == None and len(f.parameters) == 1:
- p = f.parameters[0]
- if p.is_pointer():
- cmdlen = f.command_fixed_length()
- if cmdlen in self.generic_sizes:
- print ' generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name)
- return
-
- if self.common_func_print_just_start(f):
- indent = " "
- trailer = " }"
- else:
- indent = ""
- trailer = None
-
- if self.debug:
- print '%s printf( "Enter %%s...\\n", "gl%s" );' % (indent, f.name)
-
- if f.can_be_large:
- print '%s if (cmdlen <= gc->maxSmallRenderCommandSize) {' % (indent)
- print '%s if ( (gc->pc + cmdlen) > gc->bufEnd ) {' % (indent)
- print '%s (void) __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
- print '%s }' % (indent)
- indent += " "
-
- print '%s emit_header(gc->pc, %s, cmdlen);' % (indent, f.opcode_real_name())
-
- self.common_emit_args(f, "gc->pc", indent, 4, 0)
- print '%s gc->pc += cmdlen;' % (indent)
- print '%s if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' % (indent)
-
- if f.can_be_large:
- print '%s}' % (indent)
- print '%selse {' % (indent)
-
- self.large_emit_begin(indent, f)
- self.common_emit_args(f, "pc", indent, 8, 1)
-
- p = f.variable_length_parameter()
- print '%s __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (indent, p.offset + 8, p.name, p.size_string())
- print '%s}' % (indent)
-
- if self.debug:
- print '%s __indirect_glFinish();' % (indent)
- print '%s printf( "Exit %%s.\\n", "gl%s" );' % (indent, f.name)
-
- if trailer: print trailer
- return
-
-
-class PrintGlxProtoInit_c(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "glX_proto_send.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM")
- return
-
-
- def printRealHeader(self):
- print """/**
- * \\file indirect_init.c
- * Initialize indirect rendering dispatch table.
- *
- * \\author Kevin E. Martin <kevin@precisioninsight.com>
- * \\author Brian Paul <brian@precisioninsight.com>
- * \\author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "indirect_init.h"
-#include "indirect.h"
-#include "glapi.h"
-
-
-/**
- * No-op function used to initialize functions that have no GLX protocol
- * support.
- */
-static int NoOp(void)
-{
- return 0;
-}
-
-/**
- * Create and initialize a new GL dispatch table. The table is initialized
- * with GLX indirect rendering protocol functions.
- */
-__GLapi * __glXNewIndirectAPI( void )
-{
- __GLapi *glAPI;
- GLuint entries;
-
- entries = _glapi_get_dispatch_table_size();
- glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *));
-
- /* first, set all entries to point to no-op functions */
- {
- int i;
- void **dispatch = (void **) glAPI;
- for (i = 0; i < entries; i++) {
- dispatch[i] = (void *) NoOp;
- }
- }
-
- /* now, initialize the entries we understand */"""
-
- def printRealFooter(self):
- print """
- return glAPI;
-}
-"""
- return
-
-
- def printCategory(self, category_group, show_num):
- cat_keys = category_group.keys()
- cat_keys.sort()
- for cat_num in cat_keys:
- first = 1
- for offset in category_group[ cat_num ]:
- [cat_name, func_name] = category_group[ cat_num ][ offset ]
-
- if first:
- print ''
- if show_num:
- print ' /* % 3u. %s */' % (cat_num, cat_name)
- else:
- print ' /* %s */' % (cat_name)
- print ''
- first = 0
-
- print ' glAPI->%s = __indirect_gl%s;' % (func_name, func_name)
-
-
- def printBody(self, api):
- core_categories = {}
- arb_categories = {}
- other_categories = {}
- next_unnum = 1000
-
- for func in api.functionIterateGlx():
- [cat, num] = api.get_category_for_name( func.name )
-
- # There are three groups of "categories" that we
- # care about here. We want to separate the core GL
- # version categories from extensions. We also want to
- # separate the ARB extensions from the non-ARB
- # extensions.
- #
- # This is done by first trying to convert the category
- # name to a floating point number. All core GL
- # versions are of the form "N.M" where both N and M
- # are integers. If the cast to float fails, an
- # exception will be thrown. Once down that path,
- # we can look at the start of the extension string.
- # If it begins with "GL_ARB_", it's an ARB extension.
- #
- # Once the categories are separated, the are ordered
- # by number. The un-numbered non-ARB extensions
- # (e.g., GL_INGR_blend_func_separate) are assigned
- # arbitrary numbers starting at 1000.
- #
- # FIXME In order to maintain repeatability, the
- # FIXME unnumbered extensions should be put in their
- # FIXME own dictionary and ordered by name (since they
- # FIXME have no number).
-
- try:
- num = float(cat)
- if not core_categories.has_key( num ):
- core_categories[ num ] = {}
-
- core_categories[ num ][ func.offset ] = [cat, func.name]
-
- except Exception, e:
- if not num:
- num = next_unnum
- next_unnum += 1
- else:
- num = int(num)
-
- if cat.startswith( "GL_ARB_" ):
- if not arb_categories.has_key( num ):
- arb_categories[ num ] = {}
-
- arb_categories[ num ][ func.offset ] = [cat, func.name]
- else:
- if not other_categories.has_key( num ):
- other_categories[ num ] = {}
-
- other_categories[ num ][ func.offset ] = [cat, func.name]
-
- self.printCategory( core_categories, 0 )
- self.printCategory( arb_categories, 1 )
- self.printCategory( other_categories, 1 )
- return
-
-
-class PrintGlxProtoInit_h(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "glX_proto_send.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM")
- self.header_tag = "_INDIRECT_H_"
-
- self.last_category = ""
- return
-
-
- def printRealHeader(self):
- print """/**
- * \\file
- * Prototypes for indirect rendering functions.
- *
- * \\author Kevin E. Martin <kevin@precisioninsight.com>
- * \\author Ian Romanick <idr@us.ibm.com>
- */
-"""
- self.printVisibility( "HIDDEN", "hidden" )
- self.printFastcall()
- self.printNoinline()
-
- print """
-#include "glxclient.h"
-
-extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size,
- void * dest, GLboolean reply_is_always_array );
-
-extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy,
- __GLXcontext * gc, unsigned max_dim, GLint width, GLint height,
- GLint depth, GLenum format, GLenum type, void * dest,
- GLboolean dimensions_in_reply );
-
-extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest(
- __GLXcontext * gc, GLint sop, GLint cmdlen );
-
-extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest(
- __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen );
-"""
-
-
- def printBody(self, api):
- for func in api.functionIterateGlx():
- print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, func.get_parameter_string())
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m output_mode] [-d]" % sys.argv[0]
- print " -m output_mode Output mode can be one of 'proto', 'init_c' or 'init_h'."
- print " -d Enable extra debug information in the generated code."
- sys.exit(1)
-
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:d")
- except Exception,e:
- show_usage()
-
- debug = 0
- mode = "proto"
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- elif arg == "-m":
- mode = val
- elif arg == "-d":
- debug = 1
-
- if mode == "proto":
- printer = PrintGlxProtoStubs()
- elif mode == "init_c":
- printer = PrintGlxProtoInit_c()
- elif mode == "init_h":
- printer = PrintGlxProtoInit_h()
- else:
- show_usage()
-
-
- printer.debug = debug
- api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() )
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_size.py b/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_size.py
deleted file mode 100644
index 81a98423a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/glX_proto_size.py
+++ /dev/null
@@ -1,705 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, glX_XML
-import license
-import sys, getopt, copy, string
-
-
-class glx_enum_function:
- def __init__(self, func_name, enum_dict):
- self.name = func_name
- self.mode = 1
- self.sig = None
-
- # "enums" is a set of lists. The element in the set is the
- # value of the enum. The list is the list of names for that
- # value. For example, [0x8126] = {"POINT_SIZE_MIN",
- # "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT",
- # "POINT_SIZE_MIN_SGIS"}.
-
- self.enums = {}
-
- # "count" is indexed by count values. Each element of count
- # is a list of index to "enums" that have that number of
- # associated data elements. For example, [4] =
- # {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION,
- # GL_AMBIENT_AND_DIFFUSE} (the enum names are used here,
- # but the actual hexadecimal values would be in the array).
-
- self.count = {}
-
-
- # Fill self.count and self.enums using the dictionary of enums
- # that was passed in. The generic Get functions (e.g.,
- # GetBooleanv and friends) are handled specially here. In
- # the data the generic Get functions are refered to as "Get".
-
- if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]:
- match_name = "Get"
- else:
- match_name = func_name
-
- mode_set = 0
- for enum_name in enum_dict:
- e = enum_dict[ enum_name ]
-
- if e.functions.has_key( match_name ):
- [count, mode] = e.functions[ match_name ]
-
- if mode_set and mode != self.mode:
- raise RuntimeError("Not all enums for %s have the same mode." % (func_name))
-
- self.mode = mode
-
- if self.enums.has_key( e.value ):
- if e.name not in self.enums[ e.value ]:
- self.enums[ e.value ].append( e )
- else:
- if not self.count.has_key( count ):
- self.count[ count ] = []
-
- self.enums[ e.value ] = [ e ]
- self.count[ count ].append( e.value )
-
-
- return
-
-
- def signature( self ):
- if self.sig == None:
- self.sig = ""
- for i in self.count:
- if i == None:
- raise RuntimeError("i is None. WTF?")
-
- self.count[i].sort()
- for e in self.count[i]:
- self.sig += "%04x,%d," % (e, i)
-
- return self.sig
-
-
- def is_set( self ):
- return self.mode
-
-
- def PrintUsingTable(self):
- """Emit the body of the __gl*_size function using a pair
- of look-up tables and a mask. The mask is calculated such
- that (e & mask) is unique for all the valid values of e for
- this function. The result of (e & mask) is used as an index
- into the first look-up table. If it matches e, then the
- same entry of the second table is returned. Otherwise zero
- is returned.
-
- It seems like this should cause better code to be generated.
- However, on x86 at least, the resulting .o file is about 20%
- larger then the switch-statment version. I am leaving this
- code in because the results may be different on other
- platforms (e.g., PowerPC or x86-64)."""
-
- return 0
- count = 0
- for a in self.enums:
- count += 1
-
- if self.count.has_key(-1):
- return 0
-
- # Determine if there is some mask M, such that M = (2^N) - 1,
- # that will generate unique values for all of the enums.
-
- mask = 0
- for i in [1, 2, 3, 4, 5, 6, 7, 8]:
- mask = (1 << i) - 1
-
- fail = 0;
- for a in self.enums:
- for b in self.enums:
- if a != b:
- if (a & mask) == (b & mask):
- fail = 1;
-
- if not fail:
- break;
- else:
- mask = 0
-
- if (mask != 0) and (mask < (2 * count)):
- masked_enums = {}
- masked_count = {}
-
- for i in range(0, mask + 1):
- masked_enums[i] = "0";
- masked_count[i] = 0;
-
- for c in self.count:
- for e in self.count[c]:
- i = e & mask
- enum_obj = self.enums[e][0]
- masked_enums[i] = '0x%04x /* %s */' % (e, enum_obj.name )
- masked_count[i] = c
-
-
- print ' static const GLushort a[%u] = {' % (mask + 1)
- for e in masked_enums:
- print ' %s, ' % (masked_enums[e])
- print ' };'
-
- print ' static const GLubyte b[%u] = {' % (mask + 1)
- for c in masked_count:
- print ' %u, ' % (masked_count[c])
- print ' };'
-
- print ' const unsigned idx = (e & 0x%02xU);' % (mask)
- print ''
- print ' return (e == a[idx]) ? (GLint) b[idx] : 0;'
- return 1;
- else:
- return 0;
-
-
- def PrintUsingSwitch(self, name):
- """Emit the body of the __gl*_size function using a
- switch-statement."""
-
- print ' switch( e ) {'
-
- for c in self.count:
- for e in self.count[c]:
- first = 1
-
- # There may be multiple enums with the same
- # value. This happens has extensions are
- # promoted from vendor-specific or EXT to
- # ARB and to the core. Emit the first one as
- # a case label, and emit the others as
- # commented-out case labels.
-
- list = {}
- for enum_obj in self.enums[e]:
- list[ enum_obj.priority() ] = enum_obj.name
-
- keys = list.keys()
- keys.sort()
- for k in keys:
- j = list[k]
- if first:
- print ' case GL_%s:' % (j)
- first = 0
- else:
- print '/* case GL_%s:*/' % (j)
-
- if c == -1:
- print ' return __gl%s_variable_size( e );' % (name)
- else:
- print ' return %u;' % (c)
-
- print ' default: return 0;'
- print ' }'
-
-
- def Print(self, name):
- print 'INTERNAL PURE FASTCALL GLint'
- print '__gl%s_size( GLenum e )' % (name)
- print '{'
-
- if not self.PrintUsingTable():
- self.PrintUsingSwitch(name)
-
- print '}'
- print ''
-
-
-class glx_server_enum_function(glx_enum_function):
- def __init__(self, func, enum_dict):
- glx_enum_function.__init__(self, func.name, enum_dict)
-
- self.function = func
- return
-
-
- def signature( self ):
- if self.sig == None:
- sig = glx_enum_function.signature(self)
-
- p = self.function.variable_length_parameter()
- if p:
- sig += "%u" % (p.size())
-
- self.sig = sig
-
- return self.sig;
-
-
- def Print(self, name, printer):
- f = self.function
- printer.common_func_print_just_header( f )
-
- fixup = []
-
- foo = {}
- for param_name in f.count_parameter_list:
- o = f.offset_of( param_name )
- foo[o] = param_name
-
- for param_name in f.counter_list:
- o = f.offset_of( param_name )
- foo[o] = param_name
-
- keys = foo.keys()
- keys.sort()
- for o in keys:
- p = f.parameters_by_name[ foo[o] ]
-
- printer.common_emit_one_arg(p, "pc", " ", 0)
- fixup.append( p.name )
-
-
- print ' GLsizei compsize;'
- print ''
-
- printer.common_emit_fixups(fixup)
-
- print ''
- print ' compsize = __gl%s_size(%s);' % (f.name, string.join(f.count_parameter_list, ","))
- p = f.variable_length_parameter()
- print ' return __GLX_PAD(%s);' % (p.size_string())
-
- print '}'
- print ''
-
-
-class PrintGlxSizeStubs_common(gl_XML.gl_print_base):
- do_get = (1 << 0)
- do_set = (1 << 1)
-
- def __init__(self, which_functions):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "glX_proto_size.py (from Mesa)"
- self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM")
-
- self.emit_set = ((which_functions & PrintGlxSizeStubs_common.do_set) != 0)
- self.emit_get = ((which_functions & PrintGlxSizeStubs_common.do_get) != 0)
- return
-
-
-class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common):
- def printRealHeader(self):
- print ''
- print '#include <GL/gl.h>'
- if self.emit_get:
- print '#include "indirect_size_get.h"'
-
- print '#include "indirect_size.h"'
-
- print ''
- self.printPure()
- print ''
- self.printFastcall()
- print ''
- self.printVisibility( "INTERNAL", "internal" )
- print ''
- print ''
- print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)'
- print '# undef HAVE_ALIAS'
- print '#endif'
- print '#ifdef HAVE_ALIAS'
- print '# define ALIAS2(from,to) \\'
- print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\'
- print ' __attribute__ ((alias( # to )));'
- print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )'
- print '#else'
- print '# define ALIAS(from,to) \\'
- print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\'
- print ' { return __gl ## to ## _size( e ); }'
- print '#endif'
- print ''
- print ''
-
-
- def printBody(self, api):
- enum_sigs = {}
- aliases = []
-
- for func in api.functionIterateGlx():
- ef = glx_enum_function( func.name, api.enums_by_name )
- if len(ef.enums) == 0:
- continue
-
- if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get):
- sig = ef.signature()
- if enum_sigs.has_key( sig ):
- aliases.append( [func.name, enum_sigs[ sig ]] )
- else:
- enum_sigs[ sig ] = func.name
- ef.Print( func.name )
-
-
- for [alias_name, real_name] in aliases:
- print 'ALIAS( %s, %s )' % (alias_name, real_name)
-
-
-
-class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common):
- def printRealHeader(self):
- print """/**
- * \\file
- * Prototypes for functions used to determine the number of data elements in
- * various GLX protocol messages.
- *
- * \\author Ian Romanick <idr@us.ibm.com>
- */
-"""
- self.printPure();
- print ''
- self.printFastcall();
- print ''
- self.printVisibility( "INTERNAL", "internal" );
- print ''
-
-
- def printBody(self, api):
- for func in api.functionIterateGlx():
- ef = glx_enum_function( func.name, api.enums_by_name )
- if len(ef.enums) == 0:
- continue
-
- if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get):
- print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name)
-
-
-class PrintGlxReqSize_common(gl_XML.gl_print_base):
- """Common base class for PrintGlxSizeReq_h and PrintGlxSizeReq_h.
-
- The main purpose of this common base class is to provide the infrastructure
- for the derrived classes to iterate over the same set of functions.
- """
-
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "glX_proto_size.py (from Mesa)"
- self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM")
-
-
-class PrintGlxReqSize_h(PrintGlxReqSize_common):
- def __init__(self):
- PrintGlxReqSize_common.__init__(self)
- self.header_tag = "_INDIRECT_REQSIZE_H_"
-
-
- def printRealHeader(self):
- self.printVisibility("HIDDEN", "hidden")
- print ''
- self.printPure()
- print ''
-
-
- def printBody(self, api):
- for func in api.functionIterateGlx():
- if not func.ignore and func.has_variable_size_request():
- print 'extern PURE HIDDEN int __glX%sReqSize(const GLbyte *pc, Bool swap);' % (func.name)
-
-
-class PrintGlxReqSize_c(PrintGlxReqSize_common):
- """Create the server-side 'request size' functions.
-
- Create the server-side functions that are used to determine what the
- size of a varible length command should be. The server then uses
- this value to determine if the incoming command packed it malformed.
- """
-
- def __init__(self):
- PrintGlxReqSize_common.__init__(self)
- self.counter_sigs = {}
-
-
- def printRealHeader(self):
- print ''
- print '#include <GL/gl.h>'
- print '#include "glxserver.h"'
- print '#include "indirect_size.h"'
- print '#include "indirect_reqsize.h"'
- print ''
- print '#if defined(linux)'
- print '# include <byteswap.h>'
- print '# define SWAP_32(v) do { (v) = bswap_32(v); } while(0)'
- print '#else'
- print '# include <X11/misc.h>'
- print '# define SWAP_32(v) do { char tmp; swapl(&v, tmp); } while(0)'
- print '#endif'
-
- print ''
- print '#define __GLX_PAD(x) (((x) + 3) & ~3)'
- print ''
- print '#if defined(__CYGWIN__) || defined(__MINGW32__)'
- print '# undef HAVE_ALIAS'
- print '#endif'
- print '#ifdef HAVE_ALIAS'
- print '# define ALIAS2(from,to) \\'
- print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\'
- print ' __attribute__ ((alias( # to )));'
- print '# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )'
- print '#else'
- print '# define ALIAS(from,to) \\'
- print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\'
- print ' { return __glX ## to ## ReqSize( pc, swap ); }'
- print '#endif'
- print ''
- print ''
-
-
- def printBody(self, api):
- aliases = []
- enum_functions = {}
- enum_sigs = {}
-
- for func in api.functionIterateGlx():
- if not func.has_variable_size_request(): continue
-
- ef = glx_server_enum_function( func, api.enums_by_name )
- if len(ef.enums) == 0: continue
-
- sig = ef.signature()
-
- if not enum_functions.has_key(func.name):
- enum_functions[ func.name ] = sig
-
- if not enum_sigs.has_key( sig ):
- enum_sigs[ sig ] = ef
-
-
-
- for func in api.functionIterateGlx():
- # Even though server-handcode fuctions are on "the
- # list", and prototypes are generated for them, there
- # isn't enough information to generate a size
- # function. If there was enough information, they
- # probably wouldn't need to be handcoded in the first
- # place!
-
- if func.server_handcode: continue
- if not func.has_variable_size_request(): continue
-
- if enum_functions.has_key(func.name):
- sig = enum_functions[func.name]
- ef = enum_sigs[ sig ]
-
- if ef.name != func.name:
- aliases.append( [func.name, ef.name] )
- else:
- ef.Print( func.name, self )
-
- elif func.images:
- self.printPixelFunction(func)
- elif func.has_variable_size_request():
- a = self.printCountedFunction(func)
- if a: aliases.append(a)
-
-
- for [alias_name, real_name] in aliases:
- print 'ALIAS( %s, %s )' % (alias_name, real_name)
-
- return
-
-
- def common_emit_fixups(self, fixup):
- """Utility function to emit conditional byte-swaps."""
-
- if fixup:
- print ' if (swap) {'
- for name in fixup:
- print ' SWAP_32( %s );' % (name)
- print ' }'
-
- return
-
-
- def common_emit_one_arg(self, p, pc, indent, adjust):
- offset = p.offset
- dst = p.string()
- src = '(%s *)' % (p.type_string())
- print '%s%-18s = *%11s(%s + %u);' % (indent, dst, src, pc, offset + adjust);
- return
-
-
- def common_func_print_just_header(self, f):
- print 'int'
- print '__glX%sReqSize( const GLbyte * pc, Bool swap )' % (f.name)
- print '{'
-
-
- def printPixelFunction(self, f):
- self.common_func_print_just_header(f)
-
- f.offset_of( f.parameters[0].name )
- [dim, w, h, d, junk] = f.get_images()[0].get_dimensions()
-
- print ' GLint row_length = * (GLint *)(pc + 4);'
-
- if dim < 3:
- fixup = ['row_length', 'skip_rows', 'alignment']
- print ' GLint image_height = 0;'
- print ' GLint skip_images = 0;'
- print ' GLint skip_rows = * (GLint *)(pc + 8);'
- print ' GLint alignment = * (GLint *)(pc + 16);'
- else:
- fixup = ['row_length', 'image_height', 'skip_rows', 'skip_images', 'alignment']
- print ' GLint image_height = * (GLint *)(pc + 8);'
- print ' GLint skip_rows = * (GLint *)(pc + 16);'
- print ' GLint skip_images = * (GLint *)(pc + 20);'
- print ' GLint alignment = * (GLint *)(pc + 32);'
-
- img = f.images[0]
- for p in f.parameterIterateGlxSend():
- if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]:
- self.common_emit_one_arg( p, "pc", " ", 0 )
- fixup.append( p.name )
-
- print ''
-
- self.common_emit_fixups(fixup)
-
- print ''
- print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d )
- print ' image_height, row_length, skip_images,'
- print ' skip_rows, alignment);'
- print '}'
- print ''
- return
-
-
- def printCountedFunction(self, f):
-
- sig = ""
- offset = 0
- fixup = []
- params = []
- plus = ''
- size = ''
- param_offsets = {}
-
- # Calculate the offset of each counter parameter and the
- # size string for the variable length parameter(s). While
- # that is being done, calculate a unique signature for this
- # function.
-
- for p in f.parameterIterateGlxSend():
- if p.is_counter:
- fixup.append( p.name )
- params.append( p )
- elif p.counter:
- s = p.size()
- if s == 0: s = 1
-
- sig += "(%u,%u)" % (f.offset_of(p.counter), s)
- size += '%s%s' % (plus, p.size_string())
- plus = ' + '
-
-
- # If the calculated signature matches a function that has
- # already be emitted, don't emit this function. Instead, add
- # it to the list of function aliases.
-
- if self.counter_sigs.has_key(sig):
- n = self.counter_sigs[sig];
- alias = [f.name, n]
- else:
- alias = None
- self.counter_sigs[sig] = f.name
-
- self.common_func_print_just_header(f)
-
- for p in params:
- self.common_emit_one_arg(p, "pc", " ", 0 )
-
-
- print ''
- self.common_emit_fixups(fixup)
- print ''
-
- print ' return __GLX_PAD(%s);' % (size)
- print '}'
- print ''
-
- return alias
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name] -m output_mode [--only-get | --only-set] [--get-alias-set]" % sys.argv[0]
- print " -m output_mode Output mode can be one of 'size_c' or 'size_h'."
- print " --only-get Only emit 'get'-type functions."
- print " --only-set Only emit 'set'-type functions."
- print ""
- print "By default, both 'get' and 'set'-type functions are emitted."
- sys.exit(1)
-
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "header-tag"])
- except Exception,e:
- show_usage()
-
- mode = None
- header_tag = None
- which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set
-
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- elif arg == "-m":
- mode = val
- elif arg == "--only-get":
- which_functions = PrintGlxSizeStubs_common.do_get
- elif arg == "--only-set":
- which_functions = PrintGlxSizeStubs_common.do_set
- elif (arg == '-h') or (arg == "--header-tag"):
- header_tag = val
-
- if mode == "size_c":
- printer = PrintGlxSizeStubs_c( which_functions )
- elif mode == "size_h":
- printer = PrintGlxSizeStubs_h( which_functions )
- if header_tag:
- printer.header_tag = header_tag
- elif mode == "reqsize_c":
- printer = PrintGlxReqSize_c()
- elif mode == "reqsize_h":
- printer = PrintGlxReqSize_h()
- else:
- show_usage()
-
- api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() )
-
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_API.dtd b/nx-X11/extras/Mesa/src/mesa/glapi/gl_API.dtd
deleted file mode 100644
index ded487bc9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_API.dtd
+++ /dev/null
@@ -1,134 +0,0 @@
-<!ELEMENT OpenGLAPI (category?, xi:include?, OpenGLAPI?)+>
-<!ELEMENT category (type*, enum*, function*)*>
-<!ELEMENT type EMPTY>
-<!ELEMENT enum (size*)>
-<!ELEMENT size EMPTY>
-<!ELEMENT function (param*, return?, glx?)*>
-<!ELEMENT param EMPTY>
-<!ELEMENT return EMPTY>
-<!ELEMENT glx EMPTY>
-
-<!ELEMENT xi:include (xi:fallback)?>
-<!ATTLIST xi:include
- xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude"
- href CDATA #REQUIRED
- parse (xml|text) "xml"
- encoding CDATA #IMPLIED>
-<!ELEMENT xi:fallback ANY>
-<!ATTLIST xi:fallback
- xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude">
-
-
-<!ATTLIST category name NMTOKEN #REQUIRED
- number NMTOKEN #IMPLIED
- window_system NMTOKEN #IMPLIED>
-<!ATTLIST type name NMTOKEN #REQUIRED
- size NMTOKEN #REQUIRED
- float (true | false) "false"
- unsigned (true | false) "false"
- glx_name NMTOKEN #IMPLIED>
-<!ATTLIST enum name NMTOKEN #REQUIRED
- count CDATA #IMPLIED
- value NMTOKEN #REQUIRED>
-<!ATTLIST function name NMTOKEN #REQUIRED
- alias NMTOKEN #IMPLIED
- offset CDATA #IMPLIED
- vectorequiv NMTOKEN #IMPLIED>
-<!ATTLIST size name NMTOKEN #REQUIRED
- count NMTOKEN #IMPLIED
- mode (get | set) "set">
-<!ATTLIST param name NMTOKEN #REQUIRED
- type CDATA #REQUIRED
- count NMTOKEN #IMPLIED
- counter (true | false) "false"
- count_scale NMTOKEN "1"
- output (true | false) "false"
- img_width NMTOKEN #IMPLIED
- img_height NMTOKEN #IMPLIED
- img_depth NMTOKEN #IMPLIED
- img_extent NMTOKEN #IMPLIED
- img_xoff NMTOKEN #IMPLIED
- img_yoff NMTOKEN #IMPLIED
- img_zoff NMTOKEN #IMPLIED
- img_woff NMTOKEN #IMPLIED
- img_format NMTOKEN #IMPLIED
- img_type NMTOKEN #IMPLIED
- img_target NMTOKEN #IMPLIED
- img_send_null (true | false) "false"
- img_null_flag (true | false) "false"
- img_pad_dimensions (true | false) "false"
- variable_param NMTOKENS #IMPLIED>
-<!ATTLIST return type CDATA "void">
-<!ATTLIST glx rop NMTOKEN #IMPLIED
- sop NMTOKEN #IMPLIED
- vendorpriv NMTOKEN #IMPLIED
- large (true | false) "false"
- doubles_in_order (true | false) "false"
- always_array (true | false) "false"
- handcode (true | false | client | server) "false"
- img_reset NMTOKEN #IMPLIED
- dimensions_in_reply (true | false) "false"
- ignore (true | false) "false">
-
-<!--
-The various attributes for param and glx have the meanings listed below.
-When adding new functions, please annote them correctly. In most cases this
-will just mean adding a '<glx ignore="true"/>' tag.
-
-param:
- name - name of the parameter
- type - fully qualified type (e.g., with "const", etc.)
- count - for counted arrays (e.g., the 'lists' parameter to glCallLists),
- the parameter or literal that represents the count. For functions
- like glVertex3fv it will be a litteral, for others it will be one of
- the parameters.
- counter - this parameter is a counter that will be referenced by the
- 'count' attribute in another parameter.
- count_scale - literal value scale factor for the 'count' attribute.
- See ProgramParameters4dvNV for an example.
- output - this parameter is used to store the output of the function.
- variable_param - name of parameter used to determine the number of
- elements referenced by this parameter. This should be the name of a
- single enum parameter. Most of the gl*Parameter[if]v functions use
- this. Additionally, the enums that can be passed should be properly
- annotated.
- img_width / img_height / img_depth / img_extent - name of parameters
- (or hardcoded integer) used for the dimensions of pixel data.
- img_xoff / img_yoff / img_zoff / img_woff - name of parameters used
- for x, y, z, and w offsets of pixel data.
- img_format - name of parameter used as the pixel data format.
- img_type - name of parameter used as the pixel data type.
- img_target - name of parameter used as a texture target. Non-texture
- pixel data should hardcode 0.
- img_send_null - boolean flag to determine if blank pixel data should
- be sent when a NULL pointer is passed. This is only used by
- TexImage1D and TexImage2D.
- img_null_flag - boolean flag to determine if an extra flag is used to
- determine if a NULL pixel pointer was passed. This is used by
- TexSubImage1D, TexSubImage2D, TexImage3D and others.
- img_pad_dimensions - boolean flag to determine if dimension data and
- offset data should be padded to the next even number of dimensions.
- For example, this will insert an empty "height" field after the
- "width" field in the protocol for TexImage1D.
-
-glx:
- rop - Opcode value for "render" commands
- sop - Opcode value for "single" commands
- vendorpriv - Opcode value for vendor private (or vendor private with
- reply) commands
- large - set to "true" of the render command can use RenderLarge protocol.
- doubles_in_order - older commands always put GLdouble data at the
- start of the render packet. Newer commands (e.g.,
- ProgramEnvParameter4dvARB) put the in the order that they appear
- in the parameter list.
- always_array - some single commands take reply data as an array or as
- return value data (e.g., glGetLightfv). Other single commands take
- reply data only as an array (e.g., glGetClipPlane).
- handcode - some functions are just too complicated to generate
- (e.g., glSeperableFilter2D) or operate only on client-side data
- (e.g., glVertexPointer) and must be handcoded.
- ignore - some functions have an entry in the dispatch table, but aren't
- suitable for protocol implementation (e.g., glLockArraysEXT). This
- also applies to functions that don't have any GLX protocol specified
- (e.g., glGetFogFuncSGIS).
--->
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_API.xml b/nx-X11/extras/Mesa/src/mesa/glapi/gl_API.xml
deleted file mode 100644
index 4f9d8c474..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_API.xml
+++ /dev/null
@@ -1,11485 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
-
-<OpenGLAPI>
-
-<!-- Core versions sorted by version number. -->
-
-<category name="1.0">
- <enum name="FALSE" value="0x0"/>
- <enum name="TRUE" value="0x1"/>
- <enum name="ZERO" value="0x0"/>
- <enum name="ONE" value="0x1"/>
- <enum name="NONE" value="0x0"/>
- <enum name="NO_ERROR" value="0x0"/>
- <enum name="POINTS" value="0x0000"/>
- <enum name="LINES" value="0x0001"/>
- <enum name="LINE_LOOP" value="0x0002"/>
- <enum name="LINE_STRIP" value="0x0003"/>
- <enum name="TRIANGLES" value="0x0004"/>
- <enum name="TRIANGLE_STRIP" value="0x0005"/>
- <enum name="TRIANGLE_FAN" value="0x0006"/>
- <enum name="QUADS" value="0x0007"/>
- <enum name="QUAD_STRIP" value="0x0008"/>
- <enum name="POLYGON" value="0x0009"/>
- <enum name="ACCUM" value="0x0100"/>
- <enum name="LOAD" value="0x0101"/>
- <enum name="RETURN" value="0x0102"/>
- <enum name="MULT" value="0x0103"/>
- <enum name="ADD" value="0x0104"/>
- <enum name="NEVER" value="0x0200"/>
- <enum name="LESS" value="0x0201"/>
- <enum name="EQUAL" value="0x0202"/>
- <enum name="LEQUAL" value="0x0203"/>
- <enum name="GREATER" value="0x0204"/>
- <enum name="NOTEQUAL" value="0x0205"/>
- <enum name="GEQUAL" value="0x0206"/>
- <enum name="ALWAYS" value="0x0207"/>
- <enum name="SRC_COLOR" value="0x0300"/>
- <enum name="ONE_MINUS_SRC_COLOR" value="0x0301"/>
- <enum name="SRC_ALPHA" value="0x0302"/>
- <enum name="ONE_MINUS_SRC_ALPHA" value="0x0303"/>
- <enum name="DST_ALPHA" value="0x0304"/>
- <enum name="ONE_MINUS_DST_ALPHA" value="0x0305"/>
- <enum name="DST_COLOR" value="0x0306"/>
- <enum name="ONE_MINUS_DST_COLOR" value="0x0307"/>
- <enum name="SRC_ALPHA_SATURATE" value="0x0308"/>
- <enum name="FRONT_LEFT" value="0x0400"/>
- <enum name="FRONT_RIGHT" value="0x0401"/>
- <enum name="BACK_LEFT" value="0x0402"/>
- <enum name="BACK_RIGHT" value="0x0403"/>
- <enum name="FRONT" value="0x0404"/>
- <enum name="BACK" value="0x0405"/>
- <enum name="LEFT" value="0x0406"/>
- <enum name="RIGHT" value="0x0407"/>
- <enum name="FRONT_AND_BACK" value="0x0408"/>
- <enum name="AUX0" value="0x0409"/>
- <enum name="AUX1" value="0x040A"/>
- <enum name="AUX2" value="0x040B"/>
- <enum name="AUX3" value="0x040C"/>
- <enum name="INVALID_VALUE" value="0x0501"/>
- <enum name="INVALID_ENUM" value="0x0500"/>
- <enum name="INVALID_OPERATION" value="0x0502"/>
- <enum name="STACK_OVERFLOW" value="0x0503"/>
- <enum name="STACK_UNDERFLOW" value="0x0504"/>
- <enum name="OUT_OF_MEMORY" value="0x0505"/>
- <enum name="2D" value="0x0600"/>
- <enum name="3D" value="0x0601"/>
- <enum name="3D_COLOR" value="0x0602"/>
- <enum name="3D_COLOR_TEXTURE" value="0x0603"/>
- <enum name="4D_COLOR_TEXTURE" value="0x0604"/>
- <enum name="PASS_THROUGH_TOKEN" value="0x0700"/>
- <enum name="POINT_TOKEN" value="0x0701"/>
- <enum name="LINE_TOKEN" value="0x0702"/>
- <enum name="POLYGON_TOKEN" value="0x0703"/>
- <enum name="BITMAP_TOKEN" value="0x0704"/>
- <enum name="DRAW_PIXEL_TOKEN" value="0x0705"/>
- <enum name="COPY_PIXEL_TOKEN" value="0x0706"/>
- <enum name="LINE_RESET_TOKEN" value="0x0707"/>
- <enum name="EXP" value="0x0800"/>
- <enum name="EXP2" value="0x0801"/>
- <enum name="CW" value="0x0900"/>
- <enum name="CCW" value="0x0901"/>
- <enum name="COEFF" value="0x0A00"/>
- <enum name="ORDER" value="0x0A01"/>
- <enum name="DOMAIN" value="0x0A02"/>
- <enum name="CURRENT_COLOR" count="4" value="0x0B00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_INDEX" count="1" value="0x0B01">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_NORMAL" count="3" value="0x0B02">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_TEXTURE_COORDS" count="4" value="0x0B03">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_COLOR" count="4" value="0x0B04">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_INDEX" count="1" value="0x0B05">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_TEXTURE_COORDS" count="4" value="0x0B06">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_POSITION" count="4" value="0x0B07">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_POSITION_VALID" count="1" value="0x0B08">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_DISTANCE" count="1" value="0x0B09">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SMOOTH" count="1" value="0x0B10">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE" count="1" value="0x0B11">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_RANGE" count="2" value="0x0B12">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_GRANULARITY" count="1" value="0x0B13">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_SMOOTH" count="1" value="0x0B20">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_WIDTH" count="1" value="0x0B21">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_WIDTH_RANGE" count="2" value="0x0B22">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_WIDTH_GRANULARITY" count="1" value="0x0B23">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_STIPPLE" count="1" value="0x0B24">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_STIPPLE_PATTERN" count="1" value="0x0B25">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_STIPPLE_REPEAT" count="1" value="0x0B26">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIST_MODE" count="1" value="0x0B30">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_LIST_NESTING" count="1" value="0x0B31">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIST_BASE" count="1" value="0x0B32">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIST_INDEX" count="1" value="0x0B33">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_MODE" count="2" value="0x0B40">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_SMOOTH" count="1" value="0x0B41">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_STIPPLE" count="1" value="0x0B42">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG" count="1" value="0x0B43">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CULL_FACE" count="1" value="0x0B44">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CULL_FACE_MODE" count="1" value="0x0B45">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FRONT_FACE" count="1" value="0x0B46">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHTING" count="1" value="0x0B50">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_LOCAL_VIEWER" count="1" value="0x0B51">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_TWO_SIDE" count="1" value="0x0B52">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_AMBIENT" count="4" value="0x0B53">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SHADE_MODEL" count="1" value="0x0B54">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATERIAL_FACE" count="1" value="0x0B55">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATERIAL_PARAMETER" count="1" value="0x0B56">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATERIAL" count="1" value="0x0B57">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG" count="1" value="0x0B60">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_INDEX" count="1" value="0x0B61">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_DENSITY" count="1" value="0x0B62">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_START" count="1" value="0x0B63">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_END" count="1" value="0x0B64">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_MODE" count="1" value="0x0B65">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COLOR" count="4" value="0x0B66">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_RANGE" count="2" value="0x0B70">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_TEST" count="1" value="0x0B71">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_WRITEMASK" count="1" value="0x0B72">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_CLEAR_VALUE" count="1" value="0x0B73">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_FUNC" count="1" value="0x0B74">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_CLEAR_VALUE" count="4" value="0x0B80">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_TEST" count="1" value="0x0B90">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_CLEAR_VALUE" count="1" value="0x0B91">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_FUNC" count="1" value="0x0B92">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_VALUE_MASK" count="1" value="0x0B93">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_FAIL" count="1" value="0x0B94">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_PASS_DEPTH_FAIL" count="1" value="0x0B95">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_PASS_DEPTH_PASS" count="1" value="0x0B96">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_REF" count="1" value="0x0B97">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_WRITEMASK" count="1" value="0x0B98">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_MODE" count="1" value="0x0BA0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMALIZE" count="1" value="0x0BA1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VIEWPORT" count="4" value="0x0BA2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW_STACK_DEPTH" count="1" value="0x0BA3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROJECTION_STACK_DEPTH" count="1" value="0x0BA4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_STACK_DEPTH" count="1" value="0x0BA5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW_MATRIX" count="16" value="0x0BA6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROJECTION_MATRIX" count="16" value="0x0BA7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_MATRIX" count="16" value="0x0BA8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ATTRIB_STACK_DEPTH" count="1" value="0x0BB0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIENT_ATTRIB_STACK_DEPTH" value="0x0BB1"/>
- <enum name="ALPHA_TEST" count="1" value="0x0BC0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_TEST_FUNC" count="1" value="0x0BC1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_TEST_REF" count="1" value="0x0BC2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DITHER" count="1" value="0x0BD0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_DST" count="1" value="0x0BE0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_SRC" count="1" value="0x0BE1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND" count="1" value="0x0BE2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LOGIC_OP_MODE" count="1" value="0x0BF0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LOGIC_OP" count="1" value="0x0BF1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="AUX_BUFFERS" count="1" value="0x0C00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER" count="1" value="0x0C01">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="READ_BUFFER" count="1" value="0x0C02">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SCISSOR_BOX" count="4" value="0x0C10">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SCISSOR_TEST" count="1" value="0x0C11">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_CLEAR_VALUE" count="1" value="0x0C20">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_WRITEMASK" count="1" value="0x0C21">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_CLEAR_VALUE" count="4" value="0x0C22">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_WRITEMASK" count="4" value="0x0C23">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_MODE" count="1" value="0x0C30">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RGBA_MODE" count="1" value="0x0C31">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DOUBLEBUFFER" count="1" value="0x0C32">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STEREO" count="1" value="0x0C33">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RENDER_MODE" count="1" value="0x0C40">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PERSPECTIVE_CORRECTION_HINT" count="1" value="0x0C50">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SMOOTH_HINT" count="1" value="0x0C51">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_SMOOTH_HINT" count="1" value="0x0C52">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_SMOOTH_HINT" count="1" value="0x0C53">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_HINT" count="1" value="0x0C54">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_S" count="1" value="0x0C60">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_T" count="1" value="0x0C61">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_R" count="1" value="0x0C62">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_Q" count="1" value="0x0C63">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_I" count="1" value="0x0C70">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_S_TO_S" value="0x0C71"/>
- <enum name="PIXEL_MAP_I_TO_R" value="0x0C72"/>
- <enum name="PIXEL_MAP_I_TO_G" value="0x0C73"/>
- <enum name="PIXEL_MAP_I_TO_B" value="0x0C74"/>
- <enum name="PIXEL_MAP_I_TO_A" value="0x0C75"/>
- <enum name="PIXEL_MAP_R_TO_R" value="0x0C76"/>
- <enum name="PIXEL_MAP_G_TO_G" value="0x0C77"/>
- <enum name="PIXEL_MAP_B_TO_B" value="0x0C78"/>
- <enum name="PIXEL_MAP_A_TO_A" value="0x0C79"/>
- <enum name="PIXEL_MAP_I_TO_I_SIZE" count="1" value="0x0CB0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_S_TO_S_SIZE" count="1" value="0x0CB1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_R_SIZE" count="1" value="0x0CB2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_G_SIZE" count="1" value="0x0CB3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_B_SIZE" count="1" value="0x0CB4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_A_SIZE" count="1" value="0x0CB5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_R_TO_R_SIZE" count="1" value="0x0CB6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_G_TO_G_SIZE" count="1" value="0x0CB7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_B_TO_B_SIZE" count="1" value="0x0CB8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_A_TO_A_SIZE" count="1" value="0x0CB9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SWAP_BYTES" count="1" value="0x0CF0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_LSB_FIRST" count="1" value="0x0CF1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_ROW_LENGTH" count="1" value="0x0CF2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SKIP_PIXELS" count="1" value="0x0CF4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SKIP_ROWS" count="1" value="0x0CF3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_ALIGNMENT" count="1" value="0x0CF5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SWAP_BYTES" count="1" value="0x0D00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_LSB_FIRST" count="1" value="0x0D01">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_ROW_LENGTH" count="1" value="0x0D02">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SKIP_ROWS" count="1" value="0x0D03">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SKIP_PIXELS" count="1" value="0x0D04">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_ALIGNMENT" count="1" value="0x0D05">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP_COLOR" count="1" value="0x0D10">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP_STENCIL" count="1" value="0x0D11">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_SHIFT" count="1" value="0x0D12">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_OFFSET" count="1" value="0x0D13">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RED_SCALE" count="1" value="0x0D14">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RED_BIAS" count="1" value="0x0D15">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ZOOM_X" count="1" value="0x0D16">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ZOOM_Y" count="1" value="0x0D17">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GREEN_SCALE" count="1" value="0x0D18">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GREEN_BIAS" count="1" value="0x0D19">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLUE_SCALE" count="1" value="0x0D1A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLUE_BIAS" count="1" value="0x0D1B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_SCALE" count="1" value="0x0D1C">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_BIAS" count="1" value="0x0D1D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_SCALE" count="1" value="0x0D1E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_BIAS" count="1" value="0x0D1F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_EVAL_ORDER" count="1" value="0x0D30">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_LIGHTS" count="1" value="0x0D31">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CLIP_PLANES" count="1" value="0x0D32">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_SIZE" count="1" value="0x0D33">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PIXEL_MAP_TABLE" count="1" value="0x0D34">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_ATTRIB_STACK_DEPTH" count="1" value="0x0D35">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_MODELVIEW_STACK_DEPTH" count="1" value="0x0D36">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_NAME_STACK_DEPTH" count="1" value="0x0D37">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PROJECTION_STACK_DEPTH" count="1" value="0x0D38">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_STACK_DEPTH" count="1" value="0x0D39">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_VIEWPORT_DIMS" count="2" value="0x0D3A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CLIENT_ATTRIB_STACK_DEPTH" value="0x0D3B"/>
- <enum name="SUBPIXEL_BITS" count="1" value="0x0D50">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_BITS" count="1" value="0x0D51">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RED_BITS" count="1" value="0x0D52">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GREEN_BITS" count="1" value="0x0D53">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLUE_BITS" count="1" value="0x0D54">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_BITS" count="1" value="0x0D55">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_BITS" count="1" value="0x0D56">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_BITS" count="1" value="0x0D57">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_RED_BITS" count="1" value="0x0D58">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_GREEN_BITS" count="1" value="0x0D59">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_BLUE_BITS" count="1" value="0x0D5A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_ALPHA_BITS" count="1" value="0x0D5B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NAME_STACK_DEPTH" count="1" value="0x0D70">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="AUTO_NORMAL" count="1" value="0x0D80">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP1_COLOR_4" count="4" value="0x0D90">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_INDEX" count="1" value="0x0D91">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_NORMAL" count="3" value="0x0D92">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_1" count="1" value="0x0D93">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_2" count="2" value="0x0D94">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_3" count="3" value="0x0D95">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_4" count="4" value="0x0D96">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_VERTEX_3" count="3" value="0x0D97">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_VERTEX_4" count="4" value="0x0D98">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_COLOR_4" count="4" value="0x0DB0">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_INDEX" count="1" value="0x0DB1">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_NORMAL" count="3" value="0x0DB2">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_1" count="1" value="0x0DB3">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_2" count="2" value="0x0DB4">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_3" count="3" value="0x0DB5">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_4" count="4" value="0x0DB6">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_VERTEX_3" count="3" value="0x0DB7">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_VERTEX_4" count="4" value="0x0DB8">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_GRID_DOMAIN" count="2" value="0x0DD0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP1_GRID_SEGMENTS" count="1" value="0x0DD1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP2_GRID_DOMAIN" count="4" value="0x0DD2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP2_GRID_SEGMENTS" count="2" value="0x0DD3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_1D" count="1" value="0x0DE0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_2D" count="1" value="0x0DE1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FEEDBACK_BUFFER_POINTER" value="0x0DF0"/>
- <enum name="FEEDBACK_BUFFER_SIZE" value="0x0DF1"/>
- <enum name="FEEDBACK_BUFFER_TYPE" value="0x0DF2"/>
- <enum name="SELECTION_BUFFER_POINTER" value="0x0DF3"/>
- <enum name="SELECTION_BUFFER_SIZE" value="0x0DF4"/>
- <enum name="TEXTURE_WIDTH" count="1" value="0x1000">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_HEIGHT" count="1" value="0x1001">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BORDER" count="1" value="0x1005">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPONENTS" count="1" value="0x1003">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BORDER_COLOR" count="4" value="0x1004">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="DONT_CARE" value="0x1100"/>
- <enum name="FASTEST" value="0x1101"/>
- <enum name="NICEST" value="0x1102"/>
- <enum name="AMBIENT" count="4" value="0x1200">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="DIFFUSE" count="4" value="0x1201">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPECULAR" count="4" value="0x1202">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="POSITION" count="4" value="0x1203">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPOT_DIRECTION" count="3" value="0x1204">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPOT_EXPONENT" count="1" value="0x1205">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPOT_CUTOFF" count="1" value="0x1206">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="CONSTANT_ATTENUATION" count="1" value="0x1207">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="LINEAR_ATTENUATION" count="1" value="0x1208">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="QUADRATIC_ATTENUATION" count="1" value="0x1209">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="COMPILE" value="0x1300"/>
- <enum name="COMPILE_AND_EXECUTE" value="0x1301"/>
- <enum name="BYTE" count="1" value="0x1400">
- <size name="CallLists"/>
- </enum>
- <enum name="UNSIGNED_BYTE" count="1" value="0x1401">
- <size name="CallLists"/>
- </enum>
- <enum name="SHORT" count="2" value="0x1402">
- <size name="CallLists"/>
- </enum>
- <enum name="UNSIGNED_SHORT" count="2" value="0x1403">
- <size name="CallLists"/>
- </enum>
- <enum name="INT" count="4" value="0x1404">
- <size name="CallLists"/>
- </enum>
- <enum name="UNSIGNED_INT" count="4" value="0x1405">
- <size name="CallLists"/>
- </enum>
- <enum name="FLOAT" count="4" value="0x1406">
- <size name="CallLists"/>
- </enum>
- <enum name="2_BYTES" count="2" value="0x1407">
- <size name="CallLists"/>
- </enum>
- <enum name="3_BYTES" count="3" value="0x1408">
- <size name="CallLists"/>
- </enum>
- <enum name="4_BYTES" count="4" value="0x1409">
- <size name="CallLists"/>
- </enum>
- <enum name="CLEAR" value="0x1500"/>
- <enum name="AND" value="0x1501"/>
- <enum name="AND_REVERSE" value="0x1502"/>
- <enum name="COPY" value="0x1503"/>
- <enum name="AND_INVERTED" value="0x1504"/>
- <enum name="NOOP" value="0x1505"/>
- <enum name="XOR" value="0x1506"/>
- <enum name="OR" value="0x1507"/>
- <enum name="NOR" value="0x1508"/>
- <enum name="EQUIV" value="0x1509"/>
- <enum name="INVERT" value="0x150A"/>
- <enum name="OR_REVERSE" value="0x150B"/>
- <enum name="COPY_INVERTED" value="0x150C"/>
- <enum name="OR_INVERTED" value="0x150D"/>
- <enum name="NAND" value="0x150E"/>
- <enum name="SET" value="0x150F"/>
- <enum name="EMISSION" count="4" value="0x1600">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="SHININESS" count="1" value="0x1601">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="AMBIENT_AND_DIFFUSE" count="4" value="0x1602">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="COLOR_INDEXES" count="3" value="0x1603">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="MODELVIEW" value="0x1700"/>
- <enum name="PROJECTION" value="0x1701"/>
- <enum name="TEXTURE" value="0x1702"/>
- <enum name="COLOR" value="0x1800"/>
- <enum name="DEPTH" value="0x1801"/>
- <enum name="STENCIL" value="0x1802"/>
- <enum name="COLOR_INDEX" value="0x1900"/>
- <enum name="STENCIL_INDEX" value="0x1901"/>
- <enum name="DEPTH_COMPONENT" value="0x1902"/>
- <enum name="RED" value="0x1903"/>
- <enum name="GREEN" value="0x1904"/>
- <enum name="BLUE" value="0x1905"/>
- <enum name="ALPHA" value="0x1906"/>
- <enum name="RGBA" value="0x1908"/>
- <enum name="RGB" value="0x1907"/>
- <enum name="LUMINANCE" value="0x1909"/>
- <enum name="LUMINANCE_ALPHA" value="0x190A"/>
- <enum name="BITMAP" value="0x1A00"/>
- <enum name="POINT" value="0x1B00"/>
- <enum name="LINE" value="0x1B01"/>
- <enum name="FILL" value="0x1B02"/>
- <enum name="FEEDBACK" value="0x1C01"/>
- <enum name="RENDER" value="0x1C00"/>
- <enum name="SELECT" value="0x1C02"/>
- <enum name="FLAT" value="0x1D00"/>
- <enum name="SMOOTH" value="0x1D01"/>
- <enum name="KEEP" value="0x1E00"/>
- <enum name="REPLACE" value="0x1E01"/>
- <enum name="INCR" value="0x1E02"/>
- <enum name="DECR" value="0x1E03"/>
- <enum name="VENDOR" value="0x1F00"/>
- <enum name="RENDERER" value="0x1F01"/>
- <enum name="VERSION" value="0x1F02"/>
- <enum name="EXTENSIONS" value="0x1F03"/>
- <enum name="S" value="0x2000"/>
- <enum name="T" value="0x2001"/>
- <enum name="R" value="0x2002"/>
- <enum name="Q" value="0x2003"/>
- <enum name="MODULATE" value="0x2100"/>
- <enum name="DECAL" value="0x2101"/>
- <enum name="TEXTURE_ENV_MODE" count="1" value="0x2200">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ENV_COLOR" count="4" value="0x2201">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ENV" value="0x2300"/>
- <enum name="EYE_LINEAR" value="0x2400"/>
- <enum name="OBJECT_LINEAR" value="0x2401"/>
- <enum name="SPHERE_MAP" value="0x2402"/>
- <enum name="TEXTURE_GEN_MODE" count="1" value="0x2500">
- <size name="TexGendv"/>
- <size name="TexGenfv"/>
- <size name="TexGeniv"/>
- <size name="GetTexGendv" mode="get"/>
- <size name="GetTexGenfv" mode="get"/>
- <size name="GetTexGeniv" mode="get"/>
- </enum>
- <enum name="OBJECT_PLANE" count="4" value="0x2501">
- <size name="TexGendv"/>
- <size name="TexGenfv"/>
- <size name="TexGeniv"/>
- <size name="GetTexGendv" mode="get"/>
- <size name="GetTexGenfv" mode="get"/>
- <size name="GetTexGeniv" mode="get"/>
- </enum>
- <enum name="EYE_PLANE" count="4" value="0x2502">
- <size name="TexGendv"/>
- <size name="TexGenfv"/>
- <size name="TexGeniv"/>
- <size name="GetTexGendv" mode="get"/>
- <size name="GetTexGenfv" mode="get"/>
- <size name="GetTexGeniv" mode="get"/>
- </enum>
- <enum name="NEAREST" value="0x2600"/>
- <enum name="LINEAR" value="0x2601"/>
- <enum name="NEAREST_MIPMAP_NEAREST" value="0x2700"/>
- <enum name="LINEAR_MIPMAP_NEAREST" value="0x2701"/>
- <enum name="NEAREST_MIPMAP_LINEAR" value="0x2702"/>
- <enum name="LINEAR_MIPMAP_LINEAR" value="0x2703"/>
- <enum name="TEXTURE_MAG_FILTER" count="1" value="0x2800">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MIN_FILTER" count="1" value="0x2801">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_WRAP_S" count="1" value="0x2802">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_WRAP_T" count="1" value="0x2803">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="CLAMP" value="0x2900"/>
- <enum name="REPEAT" value="0x2901"/>
- <enum name="CLIP_PLANE0" count="1" value="0x3000">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE1" count="1" value="0x3001">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE2" count="1" value="0x3002">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE3" count="1" value="0x3003">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE4" count="1" value="0x3004">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE5" count="1" value="0x3005">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT0" count="1" value="0x4000">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT1" count="1" value="0x4001">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT2" count="1" value="0x4002">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT3" count="1" value="0x4003">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT4" count="1" value="0x4004">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT5" count="1" value="0x4005">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT6" count="1" value="0x4006">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT7" count="1" value="0x4007">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_BIT" value="0x00000001"/>
- <enum name="POINT_BIT" value="0x00000002"/>
- <enum name="LINE_BIT" value="0x00000004"/>
- <enum name="POLYGON_BIT" value="0x00000008"/>
- <enum name="POLYGON_STIPPLE_BIT" value="0x00000010"/>
- <enum name="PIXEL_MODE_BIT" value="0x00000020"/>
- <enum name="LIGHTING_BIT" value="0x00000040"/>
- <enum name="FOG_BIT" value="0x00000080"/>
- <enum name="DEPTH_BUFFER_BIT" value="0x00000100"/>
- <enum name="ACCUM_BUFFER_BIT" value="0x00000200"/>
- <enum name="STENCIL_BUFFER_BIT" value="0x00000400"/>
- <enum name="VIEWPORT_BIT" value="0x00000800"/>
- <enum name="TRANSFORM_BIT" value="0x00001000"/>
- <enum name="ENABLE_BIT" value="0x00002000"/>
- <enum name="COLOR_BUFFER_BIT" value="0x00004000"/>
- <enum name="HINT_BIT" value="0x00008000"/>
- <enum name="EVAL_BIT" value="0x00010000"/>
- <enum name="LIST_BIT" value="0x00020000"/>
- <enum name="TEXTURE_BIT" value="0x00040000"/>
- <enum name="SCISSOR_BIT" value="0x00080000"/>
- <enum name="ALL_ATTRIB_BITS" value="0x000FFFFF"/>
-
- <type name="double" size="8" float="true" glx_name="FLOAT64"/>
- <type name="clampd" size="8" float="true" glx_name="FLOAT64"/>
-
- <type name="float" size="4" float="true" glx_name="FLOAT32"/>
- <type name="clampf" size="4" float="true" glx_name="FLOAT32"/>
-
- <type name="int" size="4" glx_name="CARD32"/>
- <type name="uint" size="4" unsigned="true" glx_name="CARD32"/>
- <type name="sizei" size="4" unsigned="true" glx_name="CARD32"/>
- <type name="enum" size="4" unsigned="true" glx_name="ENUM"/>
- <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/>
-
- <type name="short" size="2" glx_name="CARD16"/>
- <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/>
-
- <type name="byte" size="1" glx_name="CARD8"/>
- <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/>
- <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/>
-
- <type name="void" size="1"/>
-
- <function name="NewList" offset="0">
- <param name="list" type="GLuint"/>
- <param name="mode" type="GLenum"/>
- <glx sop="101"/>
- </function>
-
- <function name="EndList" offset="1">
- <glx sop="102"/>
- </function>
-
- <function name="CallList" offset="2">
- <param name="list" type="GLuint"/>
- <glx rop="1"/>
- </function>
-
- <function name="CallLists" offset="3">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="type" type="GLenum"/>
- <param name="lists" type="const GLvoid *" variable_param="type" count="n"/>
- <glx rop="2" large="true"/>
- </function>
-
- <function name="DeleteLists" offset="4">
- <param name="list" type="GLuint"/>
- <param name="range" type="GLsizei"/>
- <glx sop="103"/>
- </function>
-
- <function name="GenLists" offset="5">
- <param name="range" type="GLsizei"/>
- <return type="GLuint"/>
- <glx sop="104"/>
- </function>
-
- <function name="ListBase" offset="6">
- <param name="base" type="GLuint"/>
- <glx rop="3"/>
- </function>
-
- <function name="Begin" offset="7">
- <param name="mode" type="GLenum"/>
- <glx rop="4"/>
- </function>
-
- <function name="Bitmap" offset="8">
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="xorig" type="GLfloat"/>
- <param name="yorig" type="GLfloat"/>
- <param name="xmove" type="GLfloat"/>
- <param name="ymove" type="GLfloat"/>
- <param name="bitmap" type="const GLubyte *" img_width="width" img_height="height" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
- <glx rop="5" large="true"/>
- </function>
-
- <function name="Color3b" offset="9" vectorequiv="Color3bv">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- </function>
-
- <function name="Color3bv" offset="10">
- <param name="v" type="const GLbyte *" count="3"/>
- <glx rop="6"/>
- </function>
-
- <function name="Color3d" offset="11" vectorequiv="Color3dv">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- </function>
-
- <function name="Color3dv" offset="12">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="7"/>
- </function>
-
- <function name="Color3f" offset="13" vectorequiv="Color3fv">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- </function>
-
- <function name="Color3fv" offset="14">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="8"/>
- </function>
-
- <function name="Color3i" offset="15" vectorequiv="Color3iv">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- </function>
-
- <function name="Color3iv" offset="16">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="9"/>
- </function>
-
- <function name="Color3s" offset="17" vectorequiv="Color3sv">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- </function>
-
- <function name="Color3sv" offset="18">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="10"/>
- </function>
-
- <function name="Color3ub" offset="19" vectorequiv="Color3ubv">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- </function>
-
- <function name="Color3ubv" offset="20">
- <param name="v" type="const GLubyte *" count="3"/>
- <glx rop="11"/>
- </function>
-
- <function name="Color3ui" offset="21" vectorequiv="Color3uiv">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- </function>
-
- <function name="Color3uiv" offset="22">
- <param name="v" type="const GLuint *" count="3"/>
- <glx rop="12"/>
- </function>
-
- <function name="Color3us" offset="23" vectorequiv="Color3usv">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- </function>
-
- <function name="Color3usv" offset="24">
- <param name="v" type="const GLushort *" count="3"/>
- <glx rop="13"/>
- </function>
-
- <function name="Color4b" offset="25" vectorequiv="Color4bv">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- <param name="alpha" type="GLbyte"/>
- </function>
-
- <function name="Color4bv" offset="26">
- <param name="v" type="const GLbyte *" count="4"/>
- <glx rop="14"/>
- </function>
-
- <function name="Color4d" offset="27" vectorequiv="Color4dv">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- <param name="alpha" type="GLdouble"/>
- </function>
-
- <function name="Color4dv" offset="28">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="15"/>
- </function>
-
- <function name="Color4f" offset="29" vectorequiv="Color4fv">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- <param name="alpha" type="GLfloat"/>
- </function>
-
- <function name="Color4fv" offset="30">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="16"/>
- </function>
-
- <function name="Color4i" offset="31" vectorequiv="Color4iv">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- <param name="alpha" type="GLint"/>
- </function>
-
- <function name="Color4iv" offset="32">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="17"/>
- </function>
-
- <function name="Color4s" offset="33" vectorequiv="Color4sv">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- <param name="alpha" type="GLshort"/>
- </function>
-
- <function name="Color4sv" offset="34">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="18"/>
- </function>
-
- <function name="Color4ub" offset="35" vectorequiv="Color4ubv">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- <param name="alpha" type="GLubyte"/>
- </function>
-
- <function name="Color4ubv" offset="36">
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="19"/>
- </function>
-
- <function name="Color4ui" offset="37" vectorequiv="Color4uiv">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- <param name="alpha" type="GLuint"/>
- </function>
-
- <function name="Color4uiv" offset="38">
- <param name="v" type="const GLuint *" count="4"/>
- <glx rop="20"/>
- </function>
-
- <function name="Color4us" offset="39" vectorequiv="Color4usv">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- <param name="alpha" type="GLushort"/>
- </function>
-
- <function name="Color4usv" offset="40">
- <param name="v" type="const GLushort *" count="4"/>
- <glx rop="21"/>
- </function>
-
- <function name="EdgeFlag" offset="41" vectorequiv="EdgeFlagv">
- <param name="flag" type="GLboolean"/>
- </function>
-
- <function name="EdgeFlagv" offset="42">
- <param name="flag" type="const GLboolean *" count="1"/>
- <glx rop="22"/>
- </function>
-
- <function name="End" offset="43">
- <glx rop="23"/>
- </function>
-
- <function name="Indexd" offset="44" vectorequiv="Indexdv">
- <param name="c" type="GLdouble"/>
- </function>
-
- <function name="Indexdv" offset="45">
- <param name="c" type="const GLdouble *" count="1"/>
- <glx rop="24"/>
- </function>
-
- <function name="Indexf" offset="46" vectorequiv="Indexfv">
- <param name="c" type="GLfloat"/>
- </function>
-
- <function name="Indexfv" offset="47">
- <param name="c" type="const GLfloat *" count="1"/>
- <glx rop="25"/>
- </function>
-
- <function name="Indexi" offset="48" vectorequiv="Indexiv">
- <param name="c" type="GLint"/>
- </function>
-
- <function name="Indexiv" offset="49">
- <param name="c" type="const GLint *" count="1"/>
- <glx rop="26"/>
- </function>
-
- <function name="Indexs" offset="50" vectorequiv="Indexsv">
- <param name="c" type="GLshort"/>
- </function>
-
- <function name="Indexsv" offset="51">
- <param name="c" type="const GLshort *" count="1"/>
- <glx rop="27"/>
- </function>
-
- <function name="Normal3b" offset="52" vectorequiv="Normal3bv">
- <param name="nx" type="GLbyte"/>
- <param name="ny" type="GLbyte"/>
- <param name="nz" type="GLbyte"/>
- </function>
-
- <function name="Normal3bv" offset="53">
- <param name="v" type="const GLbyte *" count="3"/>
- <glx rop="28"/>
- </function>
-
- <function name="Normal3d" offset="54" vectorequiv="Normal3dv">
- <param name="nx" type="GLdouble"/>
- <param name="ny" type="GLdouble"/>
- <param name="nz" type="GLdouble"/>
- </function>
-
- <function name="Normal3dv" offset="55">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="29"/>
- </function>
-
- <function name="Normal3f" offset="56" vectorequiv="Normal3fv">
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- </function>
-
- <function name="Normal3fv" offset="57">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="30"/>
- </function>
-
- <function name="Normal3i" offset="58" vectorequiv="Normal3iv">
- <param name="nx" type="GLint"/>
- <param name="ny" type="GLint"/>
- <param name="nz" type="GLint"/>
- </function>
-
- <function name="Normal3iv" offset="59">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="31"/>
- </function>
-
- <function name="Normal3s" offset="60" vectorequiv="Normal3sv">
- <param name="nx" type="GLshort"/>
- <param name="ny" type="GLshort"/>
- <param name="nz" type="GLshort"/>
- </function>
-
- <function name="Normal3sv" offset="61">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="32"/>
- </function>
-
- <function name="RasterPos2d" offset="62" vectorequiv="RasterPos2dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="RasterPos2dv" offset="63">
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="33"/>
- </function>
-
- <function name="RasterPos2f" offset="64" vectorequiv="RasterPos2fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="RasterPos2fv" offset="65">
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="34"/>
- </function>
-
- <function name="RasterPos2i" offset="66" vectorequiv="RasterPos2iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="RasterPos2iv" offset="67">
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="35"/>
- </function>
-
- <function name="RasterPos2s" offset="68" vectorequiv="RasterPos2sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="RasterPos2sv" offset="69">
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="36"/>
- </function>
-
- <function name="RasterPos3d" offset="70" vectorequiv="RasterPos3dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="RasterPos3dv" offset="71">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="37"/>
- </function>
-
- <function name="RasterPos3f" offset="72" vectorequiv="RasterPos3fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="RasterPos3fv" offset="73">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="38"/>
- </function>
-
- <function name="RasterPos3i" offset="74" vectorequiv="RasterPos3iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="RasterPos3iv" offset="75">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="39"/>
- </function>
-
- <function name="RasterPos3s" offset="76" vectorequiv="RasterPos3sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="RasterPos3sv" offset="77">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="40"/>
- </function>
-
- <function name="RasterPos4d" offset="78" vectorequiv="RasterPos4dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="RasterPos4dv" offset="79">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="41"/>
- </function>
-
- <function name="RasterPos4f" offset="80" vectorequiv="RasterPos4fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="RasterPos4fv" offset="81">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="42"/>
- </function>
-
- <function name="RasterPos4i" offset="82" vectorequiv="RasterPos4iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- </function>
-
- <function name="RasterPos4iv" offset="83">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="43"/>
- </function>
-
- <function name="RasterPos4s" offset="84" vectorequiv="RasterPos4sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="RasterPos4sv" offset="85">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="44"/>
- </function>
-
- <function name="Rectd" offset="86" vectorequiv="Rectdv">
- <param name="x1" type="GLdouble"/>
- <param name="y1" type="GLdouble"/>
- <param name="x2" type="GLdouble"/>
- <param name="y2" type="GLdouble"/>
- </function>
-
- <function name="Rectdv" offset="87">
- <param name="v1" type="const GLdouble *" count="2"/>
- <param name="v2" type="const GLdouble *" count="2"/>
- <glx rop="45"/>
- </function>
-
- <function name="Rectf" offset="88" vectorequiv="Rectfv">
- <param name="x1" type="GLfloat"/>
- <param name="y1" type="GLfloat"/>
- <param name="x2" type="GLfloat"/>
- <param name="y2" type="GLfloat"/>
- </function>
-
- <function name="Rectfv" offset="89">
- <param name="v1" type="const GLfloat *" count="2"/>
- <param name="v2" type="const GLfloat *" count="2"/>
- <glx rop="46"/>
- </function>
-
- <function name="Recti" offset="90" vectorequiv="Rectiv">
- <param name="x1" type="GLint"/>
- <param name="y1" type="GLint"/>
- <param name="x2" type="GLint"/>
- <param name="y2" type="GLint"/>
- </function>
-
- <function name="Rectiv" offset="91">
- <param name="v1" type="const GLint *" count="2"/>
- <param name="v2" type="const GLint *" count="2"/>
- <glx rop="47"/>
- </function>
-
- <function name="Rects" offset="92" vectorequiv="Rectsv">
- <param name="x1" type="GLshort"/>
- <param name="y1" type="GLshort"/>
- <param name="x2" type="GLshort"/>
- <param name="y2" type="GLshort"/>
- </function>
-
- <function name="Rectsv" offset="93">
- <param name="v1" type="const GLshort *" count="2"/>
- <param name="v2" type="const GLshort *" count="2"/>
- <glx rop="48"/>
- </function>
-
- <function name="TexCoord1d" offset="94" vectorequiv="TexCoord1dv">
- <param name="s" type="GLdouble"/>
- </function>
-
- <function name="TexCoord1dv" offset="95">
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="49"/>
- </function>
-
- <function name="TexCoord1f" offset="96" vectorequiv="TexCoord1fv">
- <param name="s" type="GLfloat"/>
- </function>
-
- <function name="TexCoord1fv" offset="97">
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="50"/>
- </function>
-
- <function name="TexCoord1i" offset="98" vectorequiv="TexCoord1iv">
- <param name="s" type="GLint"/>
- </function>
-
- <function name="TexCoord1iv" offset="99">
- <param name="v" type="const GLint *" count="1"/>
- <glx rop="51"/>
- </function>
-
- <function name="TexCoord1s" offset="100" vectorequiv="TexCoord1sv">
- <param name="s" type="GLshort"/>
- </function>
-
- <function name="TexCoord1sv" offset="101">
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="52"/>
- </function>
-
- <function name="TexCoord2d" offset="102" vectorequiv="TexCoord2dv">
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- </function>
-
- <function name="TexCoord2dv" offset="103">
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="53"/>
- </function>
-
- <function name="TexCoord2f" offset="104" vectorequiv="TexCoord2fv">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fv" offset="105">
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="54"/>
- </function>
-
- <function name="TexCoord2i" offset="106" vectorequiv="TexCoord2iv">
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- </function>
-
- <function name="TexCoord2iv" offset="107">
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="55"/>
- </function>
-
- <function name="TexCoord2s" offset="108" vectorequiv="TexCoord2sv">
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- </function>
-
- <function name="TexCoord2sv" offset="109">
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="56"/>
- </function>
-
- <function name="TexCoord3d" offset="110" vectorequiv="TexCoord3dv">
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- </function>
-
- <function name="TexCoord3dv" offset="111">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="57"/>
- </function>
-
- <function name="TexCoord3f" offset="112" vectorequiv="TexCoord3fv">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- </function>
-
- <function name="TexCoord3fv" offset="113">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="58"/>
- </function>
-
- <function name="TexCoord3i" offset="114" vectorequiv="TexCoord3iv">
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- </function>
-
- <function name="TexCoord3iv" offset="115">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="59"/>
- </function>
-
- <function name="TexCoord3s" offset="116" vectorequiv="TexCoord3sv">
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- </function>
-
- <function name="TexCoord3sv" offset="117">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="60"/>
- </function>
-
- <function name="TexCoord4d" offset="118" vectorequiv="TexCoord4dv">
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- <param name="q" type="GLdouble"/>
- </function>
-
- <function name="TexCoord4dv" offset="119">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="61"/>
- </function>
-
- <function name="TexCoord4f" offset="120" vectorequiv="TexCoord4fv">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- </function>
-
- <function name="TexCoord4fv" offset="121">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="62"/>
- </function>
-
- <function name="TexCoord4i" offset="122" vectorequiv="TexCoord4iv">
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- <param name="q" type="GLint"/>
- </function>
-
- <function name="TexCoord4iv" offset="123">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="63"/>
- </function>
-
- <function name="TexCoord4s" offset="124" vectorequiv="TexCoord4sv">
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- <param name="q" type="GLshort"/>
- </function>
-
- <function name="TexCoord4sv" offset="125">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="64"/>
- </function>
-
- <function name="Vertex2d" offset="126" vectorequiv="Vertex2dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="Vertex2dv" offset="127">
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="65"/>
- </function>
-
- <function name="Vertex2f" offset="128" vectorequiv="Vertex2fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="Vertex2fv" offset="129">
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="66"/>
- </function>
-
- <function name="Vertex2i" offset="130" vectorequiv="Vertex2iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="Vertex2iv" offset="131">
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="67"/>
- </function>
-
- <function name="Vertex2s" offset="132" vectorequiv="Vertex2sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="Vertex2sv" offset="133">
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="68"/>
- </function>
-
- <function name="Vertex3d" offset="134" vectorequiv="Vertex3dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="Vertex3dv" offset="135">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="69"/>
- </function>
-
- <function name="Vertex3f" offset="136" vectorequiv="Vertex3fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Vertex3fv" offset="137">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="70"/>
- </function>
-
- <function name="Vertex3i" offset="138" vectorequiv="Vertex3iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="Vertex3iv" offset="139">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="71"/>
- </function>
-
- <function name="Vertex3s" offset="140" vectorequiv="Vertex3sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="Vertex3sv" offset="141">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="72"/>
- </function>
-
- <function name="Vertex4d" offset="142" vectorequiv="Vertex4dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="Vertex4dv" offset="143">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="73"/>
- </function>
-
- <function name="Vertex4f" offset="144" vectorequiv="Vertex4fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="Vertex4fv" offset="145">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="74"/>
- </function>
-
- <function name="Vertex4i" offset="146" vectorequiv="Vertex4iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- </function>
-
- <function name="Vertex4iv" offset="147">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="75"/>
- </function>
-
- <function name="Vertex4s" offset="148" vectorequiv="Vertex4sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="Vertex4sv" offset="149">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="76"/>
- </function>
-
- <function name="ClipPlane" offset="150">
- <param name="plane" type="GLenum"/>
- <param name="equation" type="const GLdouble *" count="4"/>
- <glx rop="77"/>
- </function>
-
- <function name="ColorMaterial" offset="151">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx rop="78"/>
- </function>
-
- <function name="CullFace" offset="152">
- <param name="mode" type="GLenum"/>
- <glx rop="79"/>
- </function>
-
- <function name="Fogf" offset="153">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="80"/>
- </function>
-
- <function name="Fogfv" offset="154">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="81"/>
- </function>
-
- <function name="Fogi" offset="155">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="82"/>
- </function>
-
- <function name="Fogiv" offset="156">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="83"/>
- </function>
-
- <function name="FrontFace" offset="157">
- <param name="mode" type="GLenum"/>
- <glx rop="84"/>
- </function>
-
- <function name="Hint" offset="158">
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx rop="85"/>
- </function>
-
- <function name="Lightf" offset="159">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="86"/>
- </function>
-
- <function name="Lightfv" offset="160">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="87"/>
- </function>
-
- <function name="Lighti" offset="161">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="88"/>
- </function>
-
- <function name="Lightiv" offset="162">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="89"/>
- </function>
-
- <function name="LightModelf" offset="163">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="90"/>
- </function>
-
- <function name="LightModelfv" offset="164">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="91"/>
- </function>
-
- <function name="LightModeli" offset="165">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="92"/>
- </function>
-
- <function name="LightModeliv" offset="166">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="93"/>
- </function>
-
- <function name="LineStipple" offset="167">
- <param name="factor" type="GLint"/>
- <param name="pattern" type="GLushort"/>
- <glx rop="94"/>
- </function>
-
- <function name="LineWidth" offset="168">
- <param name="width" type="GLfloat"/>
- <glx rop="95"/>
- </function>
-
- <function name="Materialf" offset="169">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="96"/>
- </function>
-
- <function name="Materialfv" offset="170">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="97"/>
- </function>
-
- <function name="Materiali" offset="171">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="98"/>
- </function>
-
- <function name="Materialiv" offset="172">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="99"/>
- </function>
-
- <function name="PointSize" offset="173">
- <param name="size" type="GLfloat"/>
- <glx rop="100"/>
- </function>
-
- <function name="PolygonMode" offset="174">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx rop="101"/>
- </function>
-
- <function name="PolygonStipple" offset="175">
- <param name="mask" type="const GLubyte *" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
- <glx rop="102"/>
- </function>
-
- <function name="Scissor" offset="176">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="103"/>
- </function>
-
- <function name="ShadeModel" offset="177">
- <param name="mode" type="GLenum"/>
- <glx rop="104"/>
- </function>
-
- <function name="TexParameterf" offset="178">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="105"/>
- </function>
-
- <function name="TexParameterfv" offset="179">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="106"/>
- </function>
-
- <function name="TexParameteri" offset="180">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="107"/>
- </function>
-
- <function name="TexParameteriv" offset="181">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="108"/>
- </function>
-
- <function name="TexImage1D" offset="182">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
- <glx rop="109" large="true"/>
- </function>
-
- <function name="TexImage2D" offset="183">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
- <glx rop="110" large="true"/>
- </function>
-
- <function name="TexEnvf" offset="184">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="111"/>
- </function>
-
- <function name="TexEnvfv" offset="185">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="112"/>
- </function>
-
- <function name="TexEnvi" offset="186">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="113"/>
- </function>
-
- <function name="TexEnviv" offset="187">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="114"/>
- </function>
-
- <function name="TexGend" offset="188">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLdouble"/>
- <glx rop="115"/>
- </function>
-
- <function name="TexGendv" offset="189">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLdouble *" variable_param="pname"/>
- <glx rop="116"/>
- </function>
-
- <function name="TexGenf" offset="190">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="117"/>
- </function>
-
- <function name="TexGenfv" offset="191">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="118"/>
- </function>
-
- <function name="TexGeni" offset="192">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="119"/>
- </function>
-
- <function name="TexGeniv" offset="193">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="120"/>
- </function>
-
- <function name="FeedbackBuffer" offset="194">
- <param name="size" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="buffer" type="GLfloat *" output="true"/>
- <glx sop="105" handcode="true"/>
- </function>
-
- <function name="SelectBuffer" offset="195">
- <param name="size" type="GLsizei"/>
- <param name="buffer" type="GLuint *" output="true"/>
- <glx sop="106" handcode="true"/>
- </function>
-
- <function name="RenderMode" offset="196">
- <param name="mode" type="GLenum"/>
- <return type="GLint"/>
- <glx sop="107" handcode="true"/>
- </function>
-
- <function name="InitNames" offset="197">
- <glx rop="121"/>
- </function>
-
- <function name="LoadName" offset="198">
- <param name="name" type="GLuint"/>
- <glx rop="122"/>
- </function>
-
- <function name="PassThrough" offset="199">
- <param name="token" type="GLfloat"/>
- <glx rop="123"/>
- </function>
-
- <function name="PopName" offset="200">
- <glx rop="124"/>
- </function>
-
- <function name="PushName" offset="201">
- <param name="name" type="GLuint"/>
- <glx rop="125"/>
- </function>
-
- <function name="DrawBuffer" offset="202">
- <param name="mode" type="GLenum"/>
- <glx rop="126"/>
- </function>
-
- <function name="Clear" offset="203">
- <param name="mask" type="GLbitfield"/>
- <glx rop="127"/>
- </function>
-
- <function name="ClearAccum" offset="204">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- <param name="alpha" type="GLfloat"/>
- <glx rop="128"/>
- </function>
-
- <function name="ClearIndex" offset="205">
- <param name="c" type="GLfloat"/>
- <glx rop="129"/>
- </function>
-
- <function name="ClearColor" offset="206">
- <param name="red" type="GLclampf"/>
- <param name="green" type="GLclampf"/>
- <param name="blue" type="GLclampf"/>
- <param name="alpha" type="GLclampf"/>
- <glx rop="130"/>
- </function>
-
- <function name="ClearStencil" offset="207">
- <param name="s" type="GLint"/>
- <glx rop="131"/>
- </function>
-
- <function name="ClearDepth" offset="208">
- <param name="depth" type="GLclampd"/>
- <glx rop="132"/>
- </function>
-
- <function name="StencilMask" offset="209">
- <param name="mask" type="GLuint"/>
- <glx rop="133"/>
- </function>
-
- <function name="ColorMask" offset="210">
- <param name="red" type="GLboolean"/>
- <param name="green" type="GLboolean"/>
- <param name="blue" type="GLboolean"/>
- <param name="alpha" type="GLboolean"/>
- <glx rop="134"/>
- </function>
-
- <function name="DepthMask" offset="211">
- <param name="flag" type="GLboolean"/>
- <glx rop="135"/>
- </function>
-
- <function name="IndexMask" offset="212">
- <param name="mask" type="GLuint"/>
- <glx rop="136"/>
- </function>
-
- <function name="Accum" offset="213">
- <param name="op" type="GLenum"/>
- <param name="value" type="GLfloat"/>
- <glx rop="137"/>
- </function>
-
- <function name="Disable" offset="214">
- <param name="cap" type="GLenum"/>
- <glx rop="138" handcode="client"/>
- </function>
-
- <function name="Enable" offset="215">
- <param name="cap" type="GLenum"/>
- <glx rop="139" handcode="client"/>
- </function>
-
- <function name="Finish" offset="216">
- <glx sop="108" handcode="true"/>
- </function>
-
- <function name="Flush" offset="217">
- <glx sop="142" handcode="true"/>
- </function>
-
- <function name="PopAttrib" offset="218">
- <glx rop="141"/>
- </function>
-
- <function name="PushAttrib" offset="219">
- <param name="mask" type="GLbitfield"/>
- <glx rop="142"/>
- </function>
-
- <function name="Map1d" offset="220">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="stride" type="GLint"/>
- <param name="order" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
- <glx rop="143" handcode="true"/>
- </function>
-
- <function name="Map1f" offset="221">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="stride" type="GLint"/>
- <param name="order" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
- <glx rop="144" handcode="true"/>
- </function>
-
- <function name="Map2d" offset="222">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="ustride" type="GLint"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLdouble"/>
- <param name="v2" type="GLdouble"/>
- <param name="vstride" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
- <glx rop="145" handcode="true"/>
- </function>
-
- <function name="Map2f" offset="223">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="ustride" type="GLint"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="vstride" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
- <glx rop="146" handcode="true"/>
- </function>
-
- <function name="MapGrid1d" offset="224">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <glx rop="147"/>
- </function>
-
- <function name="MapGrid1f" offset="225">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <glx rop="148"/>
- </function>
-
- <function name="MapGrid2d" offset="226">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="vn" type="GLint"/>
- <param name="v1" type="GLdouble"/>
- <param name="v2" type="GLdouble"/>
- <glx rop="149"/>
- </function>
-
- <function name="MapGrid2f" offset="227">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="vn" type="GLint"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <glx rop="150"/>
- </function>
-
- <function name="EvalCoord1d" offset="228" vectorequiv="EvalCoord1dv">
- <param name="u" type="GLdouble"/>
- </function>
-
- <function name="EvalCoord1dv" offset="229">
- <param name="u" type="const GLdouble *" count="1"/>
- <glx rop="151"/>
- </function>
-
- <function name="EvalCoord1f" offset="230" vectorequiv="EvalCoord1fv">
- <param name="u" type="GLfloat"/>
- </function>
-
- <function name="EvalCoord1fv" offset="231">
- <param name="u" type="const GLfloat *" count="1"/>
- <glx rop="152"/>
- </function>
-
- <function name="EvalCoord2d" offset="232" vectorequiv="EvalCoord2dv">
- <param name="u" type="GLdouble"/>
- <param name="v" type="GLdouble"/>
- </function>
-
- <function name="EvalCoord2dv" offset="233">
- <param name="u" type="const GLdouble *" count="2"/>
- <glx rop="153"/>
- </function>
-
- <function name="EvalCoord2f" offset="234" vectorequiv="EvalCoord2fv">
- <param name="u" type="GLfloat"/>
- <param name="v" type="GLfloat"/>
- </function>
-
- <function name="EvalCoord2fv" offset="235">
- <param name="u" type="const GLfloat *" count="2"/>
- <glx rop="154"/>
- </function>
-
- <function name="EvalMesh1" offset="236">
- <param name="mode" type="GLenum"/>
- <param name="i1" type="GLint"/>
- <param name="i2" type="GLint"/>
- <glx rop="155"/>
- </function>
-
- <function name="EvalPoint1" offset="237">
- <param name="i" type="GLint"/>
- <glx rop="156"/>
- </function>
-
- <function name="EvalMesh2" offset="238">
- <param name="mode" type="GLenum"/>
- <param name="i1" type="GLint"/>
- <param name="i2" type="GLint"/>
- <param name="j1" type="GLint"/>
- <param name="j2" type="GLint"/>
- <glx rop="157"/>
- </function>
-
- <function name="EvalPoint2" offset="239">
- <param name="i" type="GLint"/>
- <param name="j" type="GLint"/>
- <glx rop="158"/>
- </function>
-
- <function name="AlphaFunc" offset="240">
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLclampf"/>
- <glx rop="159"/>
- </function>
-
- <function name="BlendFunc" offset="241">
- <param name="sfactor" type="GLenum"/>
- <param name="dfactor" type="GLenum"/>
- <glx rop="160"/>
- </function>
-
- <function name="LogicOp" offset="242">
- <param name="opcode" type="GLenum"/>
- <glx rop="161"/>
- </function>
-
- <function name="StencilFunc" offset="243">
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- <glx rop="162"/>
- </function>
-
- <function name="StencilOp" offset="244">
- <param name="fail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- <glx rop="163"/>
- </function>
-
- <function name="DepthFunc" offset="245">
- <param name="func" type="GLenum"/>
- <glx rop="164"/>
- </function>
-
- <function name="PixelZoom" offset="246">
- <param name="xfactor" type="GLfloat"/>
- <param name="yfactor" type="GLfloat"/>
- <glx rop="165"/>
- </function>
-
- <function name="PixelTransferf" offset="247">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="166"/>
- </function>
-
- <function name="PixelTransferi" offset="248">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="167"/>
- </function>
-
- <function name="PixelStoref" offset="249">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx sop="109" handcode="client"/>
- </function>
-
- <function name="PixelStorei" offset="250">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx sop="110" handcode="client"/>
- </function>
-
- <function name="PixelMapfv" offset="251">
- <param name="map" type="GLenum"/>
- <param name="mapsize" type="GLsizei" counter="true"/>
- <param name="values" type="const GLfloat *" count="mapsize"/>
- <glx rop="168" large="true"/>
- </function>
-
- <function name="PixelMapuiv" offset="252">
- <param name="map" type="GLenum"/>
- <param name="mapsize" type="GLsizei" counter="true"/>
- <param name="values" type="const GLuint *" count="mapsize"/>
- <glx rop="169" large="true"/>
- </function>
-
- <function name="PixelMapusv" offset="253">
- <param name="map" type="GLenum"/>
- <param name="mapsize" type="GLsizei" counter="true"/>
- <param name="values" type="const GLushort *" count="mapsize"/>
- <glx rop="170" large="true"/>
- </function>
-
- <function name="ReadBuffer" offset="254">
- <param name="mode" type="GLenum"/>
- <glx rop="171"/>
- </function>
-
- <function name="CopyPixels" offset="255">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <glx rop="172"/>
- </function>
-
- <function name="ReadPixels" offset="256">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/>
- <glx sop="111"/>
- </function>
-
- <function name="DrawPixels" offset="257">
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0" img_pad_dimensions="false"/>
- <glx rop="173" large="true"/>
- </function>
-
- <function name="GetBooleanv" offset="258">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLboolean *" output="true" variable_param="pname"/>
- <glx sop="112" handcode="client"/>
- </function>
-
- <function name="GetClipPlane" offset="259">
- <param name="plane" type="GLenum"/>
- <param name="equation" type="GLdouble *" output="true" count="4"/>
- <glx sop="113" always_array="true"/>
- </function>
-
- <function name="GetDoublev" offset="260">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx sop="114" handcode="client"/>
- </function>
-
- <function name="GetError" offset="261">
- <return type="GLenum"/>
- <glx sop="115" handcode="client"/>
- </function>
-
- <function name="GetFloatv" offset="262">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="116" handcode="client"/>
- </function>
-
- <function name="GetIntegerv" offset="263">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="117" handcode="client"/>
- </function>
-
- <function name="GetLightfv" offset="264">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="118"/>
- </function>
-
- <function name="GetLightiv" offset="265">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="119"/>
- </function>
-
- <function name="GetMapdv" offset="266">
- <param name="target" type="GLenum"/>
- <param name="query" type="GLenum"/>
- <param name="v" type="GLdouble *" output="true" variable_param="target query"/>
- <glx sop="120"/>
- </function>
-
- <function name="GetMapfv" offset="267">
- <param name="target" type="GLenum"/>
- <param name="query" type="GLenum"/>
- <param name="v" type="GLfloat *" output="true" variable_param="target query"/>
- <glx sop="121"/>
- </function>
-
- <function name="GetMapiv" offset="268">
- <param name="target" type="GLenum"/>
- <param name="query" type="GLenum"/>
- <param name="v" type="GLint *" output="true" variable_param="target query"/>
- <glx sop="122"/>
- </function>
-
- <function name="GetMaterialfv" offset="269">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="123"/>
- </function>
-
- <function name="GetMaterialiv" offset="270">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="124"/>
- </function>
-
- <function name="GetPixelMapfv" offset="271">
- <param name="map" type="GLenum"/>
- <param name="values" type="GLfloat *" output="true" variable_param="map"/>
- <glx sop="125"/>
- </function>
-
- <function name="GetPixelMapuiv" offset="272">
- <param name="map" type="GLenum"/>
- <param name="values" type="GLuint *" output="true" variable_param="map"/>
- <glx sop="126"/>
- </function>
-
- <function name="GetPixelMapusv" offset="273">
- <param name="map" type="GLenum"/>
- <param name="values" type="GLushort *" output="true" variable_param="map"/>
- <glx sop="127"/>
- </function>
-
- <function name="GetPolygonStipple" offset="274">
- <param name="mask" type="GLubyte *" output="true" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP"/>
- <glx sop="128"/>
- </function>
-
- <function name="GetString" offset="275">
- <param name="name" type="GLenum"/>
- <return type="const GLubyte *"/>
- <glx sop="129" handcode="true"/>
- </function>
-
- <function name="GetTexEnvfv" offset="276">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="130"/>
- </function>
-
- <function name="GetTexEnviv" offset="277">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="131"/>
- </function>
-
- <function name="GetTexGendv" offset="278">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx sop="132"/>
- </function>
-
- <function name="GetTexGenfv" offset="279">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="133"/>
- </function>
-
- <function name="GetTexGeniv" offset="280">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="134"/>
- </function>
-
- <function name="GetTexImage" offset="281">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type"/>
- <glx sop="135" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetTexParameterfv" offset="282">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="136"/>
- </function>
-
- <function name="GetTexParameteriv" offset="283">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="137"/>
- </function>
-
- <function name="GetTexLevelParameterfv" offset="284">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="138"/>
- </function>
-
- <function name="GetTexLevelParameteriv" offset="285">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="139"/>
- </function>
-
- <function name="IsEnabled" offset="286">
- <param name="cap" type="GLenum"/>
- <return type="GLboolean"/>
- <glx sop="140" handcode="client"/>
- </function>
-
- <function name="IsList" offset="287">
- <param name="list" type="GLuint"/>
- <return type="GLboolean"/>
- <glx sop="141"/>
- </function>
-
- <function name="DepthRange" offset="288">
- <param name="zNear" type="GLclampd"/>
- <param name="zFar" type="GLclampd"/>
- <glx rop="174"/>
- </function>
-
- <function name="Frustum" offset="289">
- <param name="left" type="GLdouble"/>
- <param name="right" type="GLdouble"/>
- <param name="bottom" type="GLdouble"/>
- <param name="top" type="GLdouble"/>
- <param name="zNear" type="GLdouble"/>
- <param name="zFar" type="GLdouble"/>
- <glx rop="175"/>
- </function>
-
- <function name="LoadIdentity" offset="290">
- <glx rop="176"/>
- </function>
-
- <function name="LoadMatrixf" offset="291">
- <param name="m" type="const GLfloat *" count="16"/>
- <glx rop="177"/>
- </function>
-
- <function name="LoadMatrixd" offset="292">
- <param name="m" type="const GLdouble *" count="16"/>
- <glx rop="178"/>
- </function>
-
- <function name="MatrixMode" offset="293">
- <param name="mode" type="GLenum"/>
- <glx rop="179"/>
- </function>
-
- <function name="MultMatrixf" offset="294">
- <param name="m" type="const GLfloat *" count="16"/>
- <glx rop="180"/>
- </function>
-
- <function name="MultMatrixd" offset="295">
- <param name="m" type="const GLdouble *" count="16"/>
- <glx rop="181"/>
- </function>
-
- <function name="Ortho" offset="296">
- <param name="left" type="GLdouble"/>
- <param name="right" type="GLdouble"/>
- <param name="bottom" type="GLdouble"/>
- <param name="top" type="GLdouble"/>
- <param name="zNear" type="GLdouble"/>
- <param name="zFar" type="GLdouble"/>
- <glx rop="182"/>
- </function>
-
- <function name="PopMatrix" offset="297">
- <glx rop="183"/>
- </function>
-
- <function name="PushMatrix" offset="298">
- <glx rop="184"/>
- </function>
-
- <function name="Rotated" offset="299">
- <param name="angle" type="GLdouble"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx rop="185"/>
- </function>
-
- <function name="Rotatef" offset="300">
- <param name="angle" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <glx rop="186"/>
- </function>
-
- <function name="Scaled" offset="301">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx rop="187"/>
- </function>
-
- <function name="Scalef" offset="302">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <glx rop="188"/>
- </function>
-
- <function name="Translated" offset="303">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx rop="189"/>
- </function>
-
- <function name="Translatef" offset="304">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <glx rop="190"/>
- </function>
-
- <function name="Viewport" offset="305">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="191"/>
- </function>
-</category>
-
-<category name="1.1">
- <enum name="INDEX_LOGIC_OP" value="0x0BF1"/>
- <enum name="COLOR_LOGIC_OP" value="0x0BF2"/>
- <enum name="TEXTURE_INTERNAL_FORMAT" value="0x1003"/>
- <enum name="DOUBLE" value="0x140A"/>
- <enum name="POLYGON_OFFSET_UNITS" count="1" value="0x2A00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_OFFSET_POINT" value="0x2A01"/>
- <enum name="POLYGON_OFFSET_LINE" value="0x2A02"/>
- <enum name="R3_G3_B2" value="0x2A10"/>
- <enum name="V2F" value="0x2A20"/>
- <enum name="V3F" value="0x2A21"/>
- <enum name="C4UB_V2F" value="0x2A22"/>
- <enum name="C4UB_V3F" value="0x2A23"/>
- <enum name="C3F_V3F" value="0x2A24"/>
- <enum name="N3F_V3F" value="0x2A25"/>
- <enum name="C4F_N3F_V3F" value="0x2A26"/>
- <enum name="T2F_V3F" value="0x2A27"/>
- <enum name="T4F_V4F" value="0x2A28"/>
- <enum name="T2F_C4UB_V3F" value="0x2A29"/>
- <enum name="T2F_C3F_V3F" value="0x2A2A"/>
- <enum name="T2F_N3F_V3F" value="0x2A2B"/>
- <enum name="T2F_C4F_N3F_V3F" value="0x2A2C"/>
- <enum name="T4F_C4F_N3F_V4F" value="0x2A2D"/>
- <enum name="POLYGON_OFFSET_FILL" value="0x8037"/>
- <enum name="POLYGON_OFFSET_FACTOR" count="1" value="0x8038">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_OFFSET_BIAS" value="0x8039"/>
- <enum name="ALPHA4" value="0x803B"/>
- <enum name="ALPHA8" value="0x803C"/>
- <enum name="ALPHA12" value="0x803D"/>
- <enum name="ALPHA16" value="0x803E"/>
- <enum name="LUMINANCE4" value="0x803F"/>
- <enum name="LUMINANCE8" value="0x8040"/>
- <enum name="LUMINANCE12" value="0x8041"/>
- <enum name="LUMINANCE16" value="0x8042"/>
- <enum name="LUMINANCE4_ALPHA4" value="0x8043"/>
- <enum name="LUMINANCE6_ALPHA2" value="0x8044"/>
- <enum name="LUMINANCE8_ALPHA8" value="0x8045"/>
- <enum name="LUMINANCE12_ALPHA4" value="0x8046"/>
- <enum name="LUMINANCE12_ALPHA12" value="0x8047"/>
- <enum name="LUMINANCE16_ALPHA16" value="0x8048"/>
- <enum name="INTENSITY" value="0x8049"/>
- <enum name="INTENSITY4" value="0x804A"/>
- <enum name="INTENSITY8" value="0x804B"/>
- <enum name="INTENSITY12" value="0x804C"/>
- <enum name="INTENSITY16" value="0x804D"/>
- <enum name="RGB4" value="0x804F"/>
- <enum name="RGB5" value="0x8050"/>
- <enum name="RGB8" value="0x8051"/>
- <enum name="RGB10" value="0x8052"/>
- <enum name="RGB12" value="0x8053"/>
- <enum name="RGB16" value="0x8054"/>
- <enum name="RGBA2" value="0x8055"/>
- <enum name="RGBA4" value="0x8056"/>
- <enum name="RGB5_A1" value="0x8057"/>
- <enum name="RGBA8" value="0x8058"/>
- <enum name="RGB10_A2" value="0x8059"/>
- <enum name="RGBA12" value="0x805A"/>
- <enum name="RGBA16" value="0x805B"/>
- <enum name="TEXTURE_RED_SIZE" count="1" value="0x805C">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_GREEN_SIZE" count="1" value="0x805D">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BLUE_SIZE" count="1" value="0x805E">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ALPHA_SIZE" count="1" value="0x805F">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LUMINANCE_SIZE" count="1" value="0x8060">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_INTENSITY_SIZE" count="1" value="0x8061">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_1D" value="0x8063"/>
- <enum name="PROXY_TEXTURE_2D" value="0x8064"/>
- <enum name="TEXTURE_PRIORITY" count="1" value="0x8066">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_RESIDENT" count="1" value="0x8067">
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_1D" count="1" value="0x8068">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_2D" count="1" value="0x8069">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY" count="1" value="0x8074">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY" count="1" value="0x8075">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY" count="1" value="0x8076">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY" count="1" value="0x8077">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY" count="1" value="0x8078">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG_ARRAY" count="1" value="0x8079">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_SIZE" count="1" value="0x807A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_TYPE" count="1" value="0x807B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_STRIDE" count="1" value="0x807C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY_TYPE" count="1" value="0x807E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY_STRIDE" count="1" value="0x807F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_SIZE" count="1" value="0x8081">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_TYPE" count="1" value="0x8082">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_STRIDE" count="1" value="0x8083">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY_TYPE" count="1" value="0x8085">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY_STRIDE" count="1" value="0x8086">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_SIZE" count="1" value="0x8088">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_TYPE" count="1" value="0x8089">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_STRIDE" count="1" value="0x808A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG_ARRAY_STRIDE" count="1" value="0x808C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_POINTER" value="0x808E"/>
- <enum name="NORMAL_ARRAY_POINTER" value="0x808F"/>
- <enum name="COLOR_ARRAY_POINTER" value="0x8090"/>
- <enum name="INDEX_ARRAY_POINTER" value="0x8091"/>
- <enum name="TEXTURE_COORD_ARRAY_POINTER" value="0x8092"/>
- <enum name="EDGE_FLAG_ARRAY_POINTER" value="0x8093"/>
- <enum name="CLIENT_PIXEL_STORE_BIT" value="0x00000001"/>
- <enum name="CLIENT_VERTEX_ARRAY_BIT" value="0x00000002"/>
- <enum name="ALL_CLIENT_ATTRIB_BITS" value="0xFFFFFFFF"/>
- <enum name="CLIENT_ALL_ATTRIB_BITS" value="0xFFFFFFFF"/>
-
- <function name="ArrayElement" offset="306">
- <param name="i" type="GLint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="ColorPointer" offset="308">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DisableClientState" offset="309">
- <param name="array" type="GLenum"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DrawArrays" offset="310">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <glx rop="193" handcode="true"/>
- </function>
-
- <function name="DrawElements" offset="311">
- <param name="mode" type="GLenum"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="EdgeFlagPointer" offset="312">
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="EnableClientState" offset="313">
- <param name="array" type="GLenum"/>
- <glx handcode="true"/>
- </function>
-
- <function name="GetPointerv" offset="329">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- <glx handcode="true"/>
- </function>
-
- <function name="IndexPointer" offset="314">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="InterleavedArrays" offset="317">
- <param name="format" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="NormalPointer" offset="318">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="TexCoordPointer" offset="320">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexPointer" offset="321">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="PolygonOffset" offset="319">
- <param name="factor" type="GLfloat"/>
- <param name="units" type="GLfloat"/>
- <glx rop="192"/>
- </function>
-
- <function name="CopyTexImage1D" offset="323">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <glx rop="4119"/>
- </function>
-
- <function name="CopyTexImage2D" offset="324">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <glx rop="4120"/>
- </function>
-
- <function name="CopyTexSubImage1D" offset="325">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="4121"/>
- </function>
-
- <function name="CopyTexSubImage2D" offset="326">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4122"/>
- </function>
-
- <function name="TexSubImage1D" offset="332">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_xoff="xoffset" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="4099" large="true"/>
- </function>
-
- <function name="TexSubImage2D" offset="333">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="4100" large="true"/>
- </function>
-
- <function name="AreTexturesResident" offset="322">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <param name="residences" type="GLboolean *" output="true" count="n"/>
- <return type="GLboolean"/>
- <glx sop="143" always_array="true"/>
- </function>
-
- <function name="BindTexture" offset="307">
- <param name="target" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- <glx rop="4117"/>
- </function>
-
- <function name="DeleteTextures" offset="327">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <glx sop="144"/>
- </function>
-
- <function name="GenTextures" offset="328">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="GLuint *" output="true" count="n"/>
- <glx sop="145" always_array="true"/>
- </function>
-
- <function name="IsTexture" offset="330">
- <param name="texture" type="GLuint"/>
- <return type="GLboolean"/>
- <glx sop="146"/>
- </function>
-
- <function name="PrioritizeTextures" offset="331">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <param name="priorities" type="const GLclampf *" count="n"/>
- <glx rop="4118"/>
- </function>
-
- <function name="Indexub" offset="315" vectorequiv="Indexubv">
- <param name="c" type="GLubyte"/>
- </function>
-
- <function name="Indexubv" offset="316">
- <param name="c" type="const GLubyte *" count="1"/>
- <glx rop="194"/>
- </function>
-
- <function name="PopClientAttrib" offset="334">
- <glx handcode="true"/>
- </function>
-
- <function name="PushClientAttrib" offset="335">
- <param name="mask" type="GLbitfield"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="1.2">
- <enum name="UNSIGNED_BYTE_3_3_2" value="0x8032"/>
- <enum name="UNSIGNED_SHORT_4_4_4_4" value="0x8033"/>
- <enum name="UNSIGNED_SHORT_5_5_5_1" value="0x8034"/>
- <enum name="UNSIGNED_INT_8_8_8_8" value="0x8035"/>
- <enum name="UNSIGNED_INT_10_10_10_2" value="0x8036"/>
- <enum name="RESCALE_NORMAL" count="1" value="0x803A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_3D" count="1" value="0x806A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SKIP_IMAGES" count="1" value="0x806B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_IMAGE_HEIGHT" count="1" value="0x806C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SKIP_IMAGES" count="1" value="0x806D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_IMAGE_HEIGHT" count="1" value="0x806E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_3D" count="1" value="0x806F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_3D" value="0x8070"/>
- <enum name="TEXTURE_DEPTH" count="1" value="0x8071">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_WRAP_R" count="1" value="0x8072">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_3D_TEXTURE_SIZE" value="0x8073"/>
- <enum name="UNSIGNED_BYTE_2_3_3_REV" value="0x8362"/>
- <enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/>
- <enum name="UNSIGNED_SHORT_5_6_5_REV" value="0x8364"/>
- <enum name="UNSIGNED_SHORT_4_4_4_4_REV" value="0x8365"/>
- <enum name="UNSIGNED_SHORT_1_5_5_5_REV" value="0x8366"/>
- <enum name="UNSIGNED_INT_8_8_8_8_REV" value="0x8367"/>
- <enum name="UNSIGNED_INT_2_10_10_10_REV" value="0x8368"/>
- <enum name="BGR" value="0x80E0"/>
- <enum name="BGRA" value="0x80E1"/>
- <enum name="MAX_ELEMENTS_VERTICES" count="1" value="0x80E8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_ELEMENTS_INDICES" count="1" value="0x80E9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLAMP_TO_EDGE" value="0x812F"/>
- <enum name="TEXTURE_MIN_LOD" count="1" value="0x813A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_LOD" count="1" value="0x813B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BASE_LEVEL" count="1" value="0x813C">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_LEVEL" count="1" value="0x813D">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_COLOR_CONTROL" count="1" value="0x81F8">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SINGLE_COLOR" value="0x81F9"/>
- <enum name="SEPARATE_SPECULAR_COLOR" value="0x81FA"/>
- <enum name="SMOOTH_POINT_SIZE_RANGE" count="2" value="0x0B12">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SMOOTH_POINT_SIZE_GRANULARITY" count="1" value="0x0B13">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SMOOTH_LINE_WIDTH_RANGE" count="2" value="0x0B22">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SMOOTH_LINE_WIDTH_GRANULARITY" count="1" value="0x0B23">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALIASED_POINT_SIZE_RANGE" count="2" value="0x846D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALIASED_LINE_WIDTH_RANGE" count="2" value="0x846E">
- <size name="Get" mode="get"/>
- </enum>
-
- <!-- These enums are actually part of the ARB_imaging subset. -->
-
- <enum name="CONSTANT_COLOR" value="0x8001"/>
- <enum name="ONE_MINUS_CONSTANT_COLOR" value="0x8002"/>
- <enum name="CONSTANT_ALPHA" value="0x8003"/>
- <enum name="ONE_MINUS_CONSTANT_ALPHA" value="0x8004"/>
- <enum name="BLEND_COLOR" count="4" value="0x8005">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FUNC_ADD" value="0x8006"/>
- <enum name="MIN" value="0x8007"/>
- <enum name="MAX" value="0x8008"/>
- <enum name="BLEND_EQUATION" count="1" value="0x8009">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FUNC_SUBTRACT" value="0x800A"/>
- <enum name="FUNC_REVERSE_SUBTRACT" value="0x800B"/>
- <enum name="CONVOLUTION_1D" count="1" value="0x8010">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_2D" count="1" value="0x8011">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SEPARABLE_2D" count="1" value="0x8012">
- <size name="Get" mode="get"/>
- </enum>
-
- <enum name="CONVOLUTION_BORDER_MODE" count="1" value="0x8013">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_BORDER_COLOR" count="4" value="0x8154">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_SCALE" count="4" value="0x8014">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_BIAS" count="4" value="0x8015">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="REDUCE" value="0x8016"/>
- <enum name="CONVOLUTION_FORMAT" count="1" value="0x8017">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_WIDTH" count="1" value="0x8018">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_HEIGHT" count="1" value="0x8019">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_WIDTH" count="1" value="0x801A">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_HEIGHT" count="1" value="0x801B">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_SCALE" count="1" value="0x801C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_SCALE" count="1" value="0x801D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_SCALE" count="1" value="0x801E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_SCALE" count="1" value="0x801F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_BIAS" count="1" value="0x8020">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_BIAS" count="1" value="0x8021">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_BIAS" count="1" value="0x8022">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_BIAS" count="1" value="0x8023">
- <size name="Get" mode="get"/>
- </enum>
-
- <enum name="HISTOGRAM" count="1" value="0x8024">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_HISTOGRAM" value="0x8025"/>
- <enum name="HISTOGRAM_WIDTH" count="1" value="0x8026">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_FORMAT" count="1" value="0x8027">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_RED_SIZE" count="1" value="0x8028">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_GREEN_SIZE" count="1" value="0x8029">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_BLUE_SIZE" count="1" value="0x802A">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_ALPHA_SIZE" count="1" value="0x802B">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_LUMINANCE_SIZE" count="1" value="0x802C">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_SINK" count="1" value="0x802D">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="MINMAX" count="1" value="0x802E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MINMAX_FORMAT" count="1" value="0x802F">
- <size name="GetMinmaxParameterfv" mode="get"/>
- <size name="GetMinmaxParameteriv" mode="get"/>
- </enum>
- <enum name="MINMAX_SINK" count="1" value="0x8030">
- <size name="GetMinmaxParameterfv" mode="get"/>
- <size name="GetMinmaxParameteriv" mode="get"/>
- </enum>
-
- <enum name="COLOR_MATRIX" count="16" value="0x80B1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATRIX_STACK_DEPTH" count="1" value="0x80B2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_COLOR_MATRIX_STACK_DEPTH" count="1" value="0x80B3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_RED_SCALE" count="1" value="0x80B4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_GREEN_SCALE" count="1" value="0x80B5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_BLUE_SCALE" count="1" value="0x80B6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_ALPHA_SCALE" count="1" value="0x80B7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_RED_BIAS" count="1" value="0x80B8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_GREEN_BIAS" count="1" value="0x80B9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_BLUE_BIAS" count="1" value="0x80BA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_ALPHA_BIAS" count="1" value="0x80BB">
- <size name="Get" mode="get"/>
- </enum>
-
- <enum name="COLOR_TABLE" count="1" value="0x80D0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_COLOR_TABLE" count="1" value="0x80D1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_COLOR_TABLE" count="1" value="0x80D2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_COLOR_TABLE" value="0x80D3"/>
- <enum name="PROXY_POST_CONVOLUTION_COLOR_TABLE" value="0x80D4"/>
- <enum name="PROXY_POST_COLOR_MATRIX_COLOR_TABLE" value="0x80D5"/>
-
- <enum name="COLOR_TABLE_SCALE" count="4" value="0x80D6">
- <size name="ColorTableParameterfv"/>
- <size name="ColorTableParameteriv"/>
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BIAS" count="4" value="0x80D7">
- <size name="ColorTableParameterfv"/>
- <size name="ColorTableParameteriv"/>
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_FORMAT" count="1" value="0x80D8">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_WIDTH" count="1" value="0x80D9">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_RED_SIZE" count="1" value="0x80DA">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_GREEN_SIZE" count="1" value="0x80DB">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BLUE_SIZE" count="1" value="0x80DC">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_ALPHA_SIZE" count="1" value="0x80DD">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_LUMINANCE_SIZE" count="1" value="0x80DE">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_INTENSITY_SIZE" count="1" value="0x80DF">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
-
-
- <function name="BlendColor" offset="336">
- <param name="red" type="GLclampf"/>
- <param name="green" type="GLclampf"/>
- <param name="blue" type="GLclampf"/>
- <param name="alpha" type="GLclampf"/>
- <glx rop="4096"/>
- </function>
-
- <function name="BlendEquation" offset="337">
- <param name="mode" type="GLenum"/>
- <glx rop="4097"/>
- </function>
-
- <function name="DrawRangeElements" offset="338">
- <param name="mode" type="GLenum"/>
- <param name="start" type="GLuint"/>
- <param name="end" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="ColorTable" offset="339">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="const GLvoid *" img_width="width" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
- <glx rop="2053" large="true"/>
- </function>
-
- <function name="ColorTableParameterfv" offset="340">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="2054"/>
- </function>
-
- <function name="ColorTableParameteriv" offset="341">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="2055"/>
- </function>
-
- <function name="CopyColorTable" offset="342">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="2056"/>
- </function>
-
- <function name="GetColorTable" offset="343">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx sop="147" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetColorTableParameterfv" offset="344">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="148"/>
- </function>
-
- <function name="GetColorTableParameteriv" offset="345">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="149"/>
- </function>
-
- <function name="ColorSubTable" offset="346">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="data" type="const GLvoid *" img_width="count" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
- <glx rop="195" large="true"/>
- </function>
-
- <function name="CopyColorSubTable" offset="347">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="196"/>
- </function>
-
- <function name="ConvolutionFilter1D" offset="348">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4101" large="true"/>
- </function>
-
- <function name="ConvolutionFilter2D" offset="349">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4102" large="true"/>
- </function>
-
- <function name="ConvolutionParameterf" offset="350">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat"/>
- <glx rop="4103"/>
- </function>
-
- <function name="ConvolutionParameterfv" offset="351">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="4104"/>
- </function>
-
- <function name="ConvolutionParameteri" offset="352">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint"/>
- <glx rop="4105"/>
- </function>
-
- <function name="ConvolutionParameteriv" offset="353">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="4106"/>
- </function>
-
- <function name="CopyConvolutionFilter1D" offset="354">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="4107"/>
- </function>
-
- <function name="CopyConvolutionFilter2D" offset="355">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4108"/>
- </function>
-
- <function name="GetConvolutionFilter" offset="356">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
- <glx sop="150" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetConvolutionParameterfv" offset="357">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="151"/>
- </function>
-
- <function name="GetConvolutionParameteriv" offset="358">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="152"/>
- </function>
-
- <function name="GetSeparableFilter" offset="359">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="GLvoid *" output="true"/>
- <param name="column" type="GLvoid *" output="true"/>
- <param name="span" type="GLvoid *" output="true"/>
- <glx sop="153" handcode="true"/>
- </function>
-
- <function name="SeparableFilter2D" offset="360">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="const GLvoid *"/>
- <param name="column" type="const GLvoid *"/>
- <glx rop="4109" handcode="true"/>
- </function>
-
- <function name="GetHistogram" offset="361">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx sop="154" dimensions_in_reply="true" img_reset="reset"/>
- </function>
-
- <function name="GetHistogramParameterfv" offset="362">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="155"/>
- </function>
-
- <function name="GetHistogramParameteriv" offset="363">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="156"/>
- </function>
-
- <function name="GetMinmax" offset="364">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
- <glx sop="157" img_reset="reset"/>
- </function>
-
- <function name="GetMinmaxParameterfv" offset="365">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="158"/>
- </function>
-
- <function name="GetMinmaxParameteriv" offset="366">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="159"/>
- </function>
-
- <function name="Histogram" offset="367">
- <param name="target" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- <glx rop="4110"/>
- </function>
-
- <function name="Minmax" offset="368">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- <glx rop="4111"/>
- </function>
-
- <function name="ResetHistogram" offset="369">
- <param name="target" type="GLenum"/>
- <glx rop="4112"/>
- </function>
-
- <function name="ResetMinmax" offset="370">
- <param name="target" type="GLenum"/>
- <glx rop="4113"/>
- </function>
-
- <function name="TexImage3D" offset="371">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="4114" large="true"/>
- </function>
-
- <function name="TexSubImage3D" offset="372">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="4115" large="true"/>
- </function>
-
- <function name="CopyTexSubImage3D" offset="373">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4123"/>
- </function>
-</category>
-
-<category name="1.3">
- <enum name="TEXTURE0" value="0x84C0"/>
- <enum name="TEXTURE1" value="0x84C1"/>
- <enum name="TEXTURE2" value="0x84C2"/>
- <enum name="TEXTURE3" value="0x84C3"/>
- <enum name="TEXTURE4" value="0x84C4"/>
- <enum name="TEXTURE5" value="0x84C5"/>
- <enum name="TEXTURE6" value="0x84C6"/>
- <enum name="TEXTURE7" value="0x84C7"/>
- <enum name="TEXTURE8" value="0x84C8"/>
- <enum name="TEXTURE9" value="0x84C9"/>
- <enum name="TEXTURE10" value="0x84CA"/>
- <enum name="TEXTURE11" value="0x84CB"/>
- <enum name="TEXTURE12" value="0x84CC"/>
- <enum name="TEXTURE13" value="0x84CD"/>
- <enum name="TEXTURE14" value="0x84CE"/>
- <enum name="TEXTURE15" value="0x84CF"/>
- <enum name="TEXTURE16" value="0x84D0"/>
- <enum name="TEXTURE17" value="0x84D1"/>
- <enum name="TEXTURE18" value="0x84D2"/>
- <enum name="TEXTURE19" value="0x84D3"/>
- <enum name="TEXTURE20" value="0x84D4"/>
- <enum name="TEXTURE21" value="0x84D5"/>
- <enum name="TEXTURE22" value="0x84D6"/>
- <enum name="TEXTURE23" value="0x84D7"/>
- <enum name="TEXTURE24" value="0x84D8"/>
- <enum name="TEXTURE25" value="0x84D9"/>
- <enum name="TEXTURE26" value="0x84DA"/>
- <enum name="TEXTURE27" value="0x84DB"/>
- <enum name="TEXTURE28" value="0x84DC"/>
- <enum name="TEXTURE29" value="0x84DD"/>
- <enum name="TEXTURE30" value="0x84DE"/>
- <enum name="TEXTURE31" value="0x84DF"/>
- <enum name="ACTIVE_TEXTURE" count="1" value="0x84E0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIENT_ACTIVE_TEXTURE" count="1" value="0x84E1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_UNITS" count="1" value="0x84E2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TRANSPOSE_MODELVIEW_MATRIX" value="0x84E3"/>
- <enum name="TRANSPOSE_PROJECTION_MATRIX" value="0x84E4"/>
- <enum name="TRANSPOSE_TEXTURE_MATRIX" value="0x84E5"/>
- <enum name="TRANSPOSE_COLOR_MATRIX" value="0x84E6"/>
- <enum name="MULTISAMPLE" count="1" value="0x809D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_COVERAGE" count="1" value="0x809E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_ONE" count="1" value="0x809F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE" count="1" value="0x80A0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_BUFFERS" count="1" value="0x80A8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLES" count="1" value="0x80A9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_VALUE" count="1" value="0x80AA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_INVERT" count="1" value="0x80AB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MULTISAMPLE_BIT" value="0x20000000"/>
- <enum name="NORMAL_MAP" value="0x8511"/>
- <enum name="REFLECTION_MAP" value="0x8512"/>
- <enum name="TEXTURE_CUBE_MAP" count="1" value="0x8513">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_CUBE_MAP" count="1" value="0x8514">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_X" value="0x8515"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X" value="0x8516"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y" value="0x8517"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y" value="0x8518"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z" value="0x8519"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z" value="0x851A"/>
- <enum name="PROXY_TEXTURE_CUBE_MAP" value="0x851B"/>
- <enum name="MAX_CUBE_MAP_TEXTURE_SIZE" count="1" value="0x851C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COMPRESSED_ALPHA" value="0x84E9"/>
- <enum name="COMPRESSED_LUMINANCE" value="0x84EA"/>
- <enum name="COMPRESSED_LUMINANCE_ALPHA" value="0x84EB"/>
- <enum name="COMPRESSED_INTENSITY" value="0x84EC"/>
- <enum name="COMPRESSED_RGB" value="0x84ED"/>
- <enum name="COMPRESSED_RGBA" value="0x84EE"/>
- <enum name="TEXTURE_COMPRESSION_HINT" count="1" value="0x84EF">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_IMAGE_SIZE" count="1" value="0x86A0">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED" count="1" value="0x86A1">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COMPRESSED_TEXTURE_FORMATS" count="-1" value="0x86A3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLAMP_TO_BORDER" value="0x812D"/>
- <enum name="COMBINE" value="0x8570"/>
- <enum name="COMBINE_RGB" count="1" value="0x8571">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="COMBINE_ALPHA" count="1" value="0x8572">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE0_RGB" count="1" value="0x8580">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE1_RGB" count="1" value="0x8581">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE2_RGB" count="1" value="0x8582">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE0_ALPHA" count="1" value="0x8588">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE1_ALPHA" count="1" value="0x8589">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE2_ALPHA" count="1" value="0x858A">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND0_RGB" count="1" value="0x8590">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND1_RGB" count="1" value="0x8591">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND2_RGB" count="1" value="0x8592">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND0_ALPHA" count="1" value="0x8598">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND1_ALPHA" count="1" value="0x8599">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND2_ALPHA" count="1" value="0x859A">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="RGB_SCALE" count="1" value="0x8573">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="ADD_SIGNED" value="0x8574"/>
- <enum name="INTERPOLATE" value="0x8575"/>
- <enum name="SUBTRACT" value="0x84E7"/>
- <enum name="CONSTANT" value="0x8576"/>
- <enum name="PRIMARY_COLOR" value="0x8577"/>
- <enum name="PREVIOUS" value="0x8578"/>
- <enum name="DOT3_RGB" value="0x86AE"/>
- <enum name="DOT3_RGBA" value="0x86AF"/>
-
- <function name="ActiveTexture" alias="ActiveTextureARB">
- <param name="texture" type="GLenum"/>
- </function>
-
- <function name="ClientActiveTexture" alias="ClientActiveTextureARB">
- <param name="texture" type="GLenum"/>
- </function>
-
- <function name="MultiTexCoord1d" alias="MultiTexCoord1dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord1dv" alias="MultiTexCoord1dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord1f" alias="MultiTexCoord1fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord1fv" alias="MultiTexCoord1fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord1i" alias="MultiTexCoord1iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord1iv" alias="MultiTexCoord1ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord1s" alias="MultiTexCoord1sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord1sv" alias="MultiTexCoord1svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="MultiTexCoord2d" alias="MultiTexCoord2dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord2dv" alias="MultiTexCoord2dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord2f" alias="MultiTexCoord2fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord2fv" alias="MultiTexCoord2fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord2i" alias="MultiTexCoord2iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord2iv" alias="MultiTexCoord2ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord2s" alias="MultiTexCoord2sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord2sv" alias="MultiTexCoord2svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="MultiTexCoord3d" alias="MultiTexCoord3dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord3dv" alias="MultiTexCoord3dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord3f" alias="MultiTexCoord3fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord3fv" alias="MultiTexCoord3fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord3i" alias="MultiTexCoord3iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord3iv" alias="MultiTexCoord3ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord3s" alias="MultiTexCoord3sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord3sv" alias="MultiTexCoord3svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="MultiTexCoord4d" alias="MultiTexCoord4dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- <param name="q" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord4dv" alias="MultiTexCoord4dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord4f" alias="MultiTexCoord4fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord4fv" alias="MultiTexCoord4fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord4i" alias="MultiTexCoord4iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- <param name="q" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord4iv" alias="MultiTexCoord4ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord4s" alias="MultiTexCoord4sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- <param name="q" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord4sv" alias="MultiTexCoord4svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="LoadTransposeMatrixf" alias="LoadTransposeMatrixfARB">
- <param name="m" type="const GLfloat *"/>
- </function>
-
- <function name="LoadTransposeMatrixd" alias="LoadTransposeMatrixdARB">
- <param name="m" type="const GLdouble *"/>
- </function>
-
- <function name="MultTransposeMatrixf" alias="MultTransposeMatrixfARB">
- <param name="m" type="const GLfloat *"/>
- </function>
-
- <function name="MultTransposeMatrixd" alias="MultTransposeMatrixdARB">
- <param name="m" type="const GLdouble *"/>
- </function>
-
- <function name="SampleCoverage" alias="SampleCoverageARB">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- </function>
-
- <function name="CompressedTexImage3D" alias="CompressedTexImage3DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexImage2D" alias="CompressedTexImage2DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexImage1D" alias="CompressedTexImage1DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexSubImage3D" alias="CompressedTexSubImage3DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexSubImage2D" alias="CompressedTexSubImage2DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexSubImage1D" alias="CompressedTexSubImage1DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="GetCompressedTexImage" alias="GetCompressedTexImageARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="img" type="GLvoid *" output="true"/>
- </function>
-</category>
-
-<category name="1.4">
- <enum name="BLEND_DST_RGB" count="1" value="0x80C8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_SRC_RGB" count="1" value="0x80C9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_DST_ALPHA" count="1" value="0x80CA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_SRC_ALPHA" count="1" value="0x80CB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_MIN" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="GENERATE_MIPMAP" count="1" value="0x8191">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="GENERATE_MIPMAP_HINT" value="0x8192"/>
- <enum name="DEPTH_COMPONENT16" value="0x81A5"/>
- <enum name="DEPTH_COMPONENT24" value="0x81A6"/>
- <enum name="DEPTH_COMPONENT32" value="0x81A7"/>
- <enum name="MIRRORED_REPEAT" value="0x8370"/>
- <enum name="FOG_COORDINATE_SOURCE" count="1" value="0x8450">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE" value="0x8451"/>
- <enum name="FRAGMENT_DEPTH" value="0x8452"/>
- <enum name="CURRENT_FOG_COORDINATE" count="1" value="0x8453">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_TYPE" count="1" value="0x8454">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_STRIDE" count="1" value="0x8455">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_POINTER" value="0x8456"/>
- <enum name="FOG_COORDINATE_ARRAY" count="1" value="0x8457">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_SUM" value="0x8458"/>
- <enum name="CURRENT_SECONDARY_COLOR" count="4" value="0x8459">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_SIZE" count="1" value="0x845A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_TYPE" count="1" value="0x845B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_STRIDE" count="1" value="0x845C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_POINTER" value="0x845D"/>
- <enum name="SECONDARY_COLOR_ARRAY" count="1" value="0x845E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_LOD_BIAS" count="1" value="0x84FD">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_FILTER_CONTROL" value="0x8500"/>
- <enum name="TEXTURE_LOD_BIAS" count="1" value="0x8501">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="INCR_WRAP" value="0x8507"/>
- <enum name="DECR_WRAP" value="0x8508"/>
- <enum name="TEXTURE_DEPTH_SIZE" count="1" value="0x884A">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="DEPTH_TEXTURE_MODE" count="1" value="0x884B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_MODE" count="1" value="0x884C">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_FUNC" count="1" value="0x884D">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="COMPARE_R_TO_TEXTURE" value="0x884E"/>
-
- <function name="BlendFuncSeparate" alias="BlendFuncSeparateEXT">
- <param name="sfactorRGB" type="GLenum"/>
- <param name="dfactorRGB" type="GLenum"/>
- <param name="sfactorAlpha" type="GLenum"/>
- <param name="dfactorAlpha" type="GLenum"/>
- </function>
-
- <function name="FogCoordf" alias="FogCoordfEXT">
- <param name="coord" type="GLfloat"/>
- </function>
-
- <function name="FogCoordfv" alias="FogCoordfvEXT">
- <param name="coord" type="const GLfloat *"/>
- </function>
-
- <function name="FogCoordd" alias="FogCoorddEXT">
- <param name="coord" type="GLdouble"/>
- </function>
-
- <function name="FogCoorddv" alias="FogCoorddvEXT">
- <param name="coord" type="const GLdouble *"/>
- </function>
-
- <function name="FogCoordPointer" alias="FogCoordPointerEXT">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="MultiDrawArrays" alias="MultiDrawArraysEXT">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint *"/> <!-- Spec bug. Should be const. -->
- <param name="count" type="GLsizei *"/> <!-- Spec bug. Should be const. -->
- <param name="primcount" type="GLsizei"/>
- </function>
-
- <function name="MultiDrawElements" alias="MultiDrawElementsEXT">
- <param name="mode" type="GLenum"/>
- <param name="count" type="const GLsizei *"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid **"/>
- <param name="primcount" type="GLsizei"/>
- </function>
-
- <function name="PointParameterf" alias="PointParameterfEXT">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="PointParameterfv" alias="PointParameterfvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="PointParameteri" alias="PointParameteriNV">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
-
- <function name="PointParameteriv" alias="PointParameterivNV">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="SecondaryColor3b" alias="SecondaryColor3bEXT">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- </function>
-
- <function name="SecondaryColor3bv" alias="SecondaryColor3bvEXT">
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="SecondaryColor3d" alias="SecondaryColor3dEXT">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- </function>
-
- <function name="SecondaryColor3dv" alias="SecondaryColor3dvEXT">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="SecondaryColor3f" alias="SecondaryColor3fEXT">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- </function>
-
- <function name="SecondaryColor3fv" alias="SecondaryColor3fvEXT">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="SecondaryColor3i" alias="SecondaryColor3iEXT">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- </function>
-
- <function name="SecondaryColor3iv" alias="SecondaryColor3ivEXT">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="SecondaryColor3s" alias="SecondaryColor3sEXT">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- </function>
-
- <function name="SecondaryColor3sv" alias="SecondaryColor3svEXT">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="SecondaryColor3ub" alias="SecondaryColor3ubEXT">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- </function>
-
- <function name="SecondaryColor3ubv" alias="SecondaryColor3ubvEXT">
- <param name="v" type="const GLubyte *"/>
- </function>
-
- <function name="SecondaryColor3ui" alias="SecondaryColor3uiEXT">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- </function>
-
- <function name="SecondaryColor3uiv" alias="SecondaryColor3uivEXT">
- <param name="v" type="const GLuint *"/>
- </function>
-
- <function name="SecondaryColor3us" alias="SecondaryColor3usEXT">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- </function>
-
- <function name="SecondaryColor3usv" alias="SecondaryColor3usvEXT">
- <param name="v" type="const GLushort *"/>
- </function>
-
- <function name="SecondaryColorPointer" alias="SecondaryColorPointerEXT">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="WindowPos2d" alias="WindowPos2dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="WindowPos2dv" alias="WindowPos2dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos2f" alias="WindowPos2fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="WindowPos2fv" alias="WindowPos2fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos2i" alias="WindowPos2iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="WindowPos2iv" alias="WindowPos2ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos2s" alias="WindowPos2sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="WindowPos2sv" alias="WindowPos2svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="WindowPos3d" alias="WindowPos3dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="WindowPos3dv" alias="WindowPos3dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos3f" alias="WindowPos3fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="WindowPos3fv" alias="WindowPos3fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos3i" alias="WindowPos3iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="WindowPos3iv" alias="WindowPos3ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos3s" alias="WindowPos3sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="WindowPos3sv" alias="WindowPos3svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-</category>
-
-<category name="1.5">
- <enum name="BUFFER_SIZE" value="0x8764"/>
- <enum name="BUFFER_USAGE" value="0x8765"/>
- <enum name="QUERY_COUNTER_BITS" value="0x8864"/>
- <enum name="CURRENT_QUERY" value="0x8865"/>
- <enum name="QUERY_RESULT" value="0x8866"/>
- <enum name="QUERY_RESULT_AVAILABLE" value="0x8867"/>
- <enum name="ARRAY_BUFFER" value="0x8892"/>
- <enum name="ELEMENT_ARRAY_BUFFER" value="0x8893"/>
- <enum name="ARRAY_BUFFER_BINDING" value="0x8894"/>
- <enum name="ELEMENT_ARRAY_BUFFER_BINDING" value="0x8895"/>
- <enum name="VERTEX_ARRAY_BUFFER_BINDING" value="0x8896"/>
- <enum name="NORMAL_ARRAY_BUFFER_BINDING" value="0x8897"/>
- <enum name="COLOR_ARRAY_BUFFER_BINDING" value="0x8898"/>
- <enum name="INDEX_ARRAY_BUFFER_BINDING" value="0x8899"/>
- <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING" value="0x889A"/>
- <enum name="EDGE_FLAG_ARRAY_BUFFER_BINDING" value="0x889B"/>
- <enum name="SECONDARY_COLOR_ARRAY_BUFFER_BINDING" value="0x889C"/>
- <enum name="FOG_COORDINATE_ARRAY_BUFFER_BINDING" value="0x889D"/>
- <enum name="WEIGHT_ARRAY_BUFFER_BINDING" value="0x889E"/>
- <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" value="0x889F"/>
- <enum name="READ_ONLY" value="0x88B8"/>
- <enum name="WRITE_ONLY" value="0x88B9"/>
- <enum name="READ_WRITE" value="0x88BA"/>
- <enum name="BUFFER_ACCESS" value="0x88BB"/>
- <enum name="BUFFER_MAPPED" value="0x88BC"/>
- <enum name="BUFFER_MAP_POINTER" value="0x88BD"/>
- <enum name="STREAM_DRAW" value="0x88E0"/>
- <enum name="STREAM_READ" value="0x88E1"/>
- <enum name="STREAM_COPY" value="0x88E2"/>
- <enum name="STATIC_DRAW" value="0x88E4"/>
- <enum name="STATIC_READ" value="0x88E5"/>
- <enum name="STATIC_COPY" value="0x88E6"/>
- <enum name="DYNAMIC_DRAW" value="0x88E8"/>
- <enum name="DYNAMIC_READ" value="0x88E9"/>
- <enum name="DYNAMIC_COPY" value="0x88EA"/>
- <enum name="SAMPLES_PASSED" count="1" value="0x8914"/>
- <enum name="FOG_COORD_SRC" value="0x8450">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD" value="0x8451"/>
- <enum name="CURRENT_FOG_COORD" count="1" value="0x8453">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_TYPE" count="1" value="0x8454">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_STRIDE" count="1" value="0x8455">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_POINTER" value="0x8456"/>
- <enum name="FOG_COORD_ARRAY" count="1" value="0x8457">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_BUFFER_BINDING" value="0x889D"/>
- <enum name="SRC0_RGB" value="0x8580"/>
- <enum name="SRC1_RGB" value="0x8581"/>
- <enum name="SRC2_RGB" value="0x8582"/>
- <enum name="SRC0_ALPHA" value="0x8588"/>
- <enum name="SRC1_ALPHA" value="0x8589"/>
- <enum name="SRC2_ALPHA" value="0x858A"/>
-
- <type name="intptr" size="4" glx_name="CARD32"/>
- <type name="sizeiptr" size="4" unsigned="true" glx_name="CARD32"/>
-
- <function name="BindBuffer" alias="BindBufferARB">
- <param name="target" type="GLenum"/>
- <param name="buffer" type="GLuint"/>
- </function>
-
- <function name="BufferData" alias="BufferDataARB">
- <param name="target" type="GLenum"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="const GLvoid *"/>
- <param name="usage" type="GLenum"/>
- </function>
-
- <function name="BufferSubData" alias="BufferSubDataARB">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="DeleteBuffers" alias="DeleteBuffersARB">
- <param name="n" type="GLsizei"/>
- <param name="buffer" type="const GLuint *"/>
- </function>
-
- <function name="GenBuffers" alias="GenBuffersARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="buffer" type="GLuint *" output="true" count="n"/>
- </function>
-
- <function name="GetBufferParameteriv" alias="GetBufferParameterivARB">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetBufferPointerv" alias="GetBufferPointervARB">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- </function>
-
- <function name="GetBufferSubData" alias="GetBufferSubDataARB">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="GLvoid *" output="true"/>
- </function>
-
- <function name="IsBuffer" alias="IsBufferARB">
- <param name="buffer" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="MapBuffer" alias="MapBufferARB">
- <param name="target" type="GLenum"/>
- <param name="access" type="GLenum"/>
- <return type="GLvoid *"/>
- </function>
-
- <function name="UnmapBuffer" alias="UnmapBufferARB">
- <param name="target" type="GLenum"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="GenQueries" alias="GenQueriesARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="GLuint *" output="true" count="n"/>
- </function>
-
- <function name="DeleteQueries" alias="DeleteQueriesARB">
- <param name="n" type="GLsizei"/>
- <param name="ids" type="const GLuint *"/>
- </function>
-
- <function name="IsQuery" alias="IsQueryARB">
- <param name="id" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="BeginQuery" alias="BeginQueryARB">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- </function>
-
- <function name="EndQuery" alias="EndQueryARB">
- <param name="target" type="GLenum"/>
- </function>
-
- <function name="GetQueryiv" alias="GetQueryivARB">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetQueryObjectiv" alias="GetQueryObjectivARB">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetQueryObjectuiv" alias="GetQueryObjectuivARB">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint *" output="true" variable_param="pname"/>
- </function>
-</category>
-
-
-<category name="2.0">
- <!-- XXX this section is very much incomplete!!! -->
- <!-- These function offsets may change too!!! -->
-
- <enum name="POINT_SPRITE_COORD_ORIGIN" count="1" value="0x8CA0">
- <size name="PointParameterfvEXT"/>
- <size name="PointParameterivNV"/>
- </enum>
-
- <function name="StencilFuncSeparate" offset="813">
- <param name="face" type="GLenum"/>
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- </function>
-
- <function name="StencilOpSeparate" offset="814">
- <param name="face" type="GLenum"/>
- <param name="fail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- </function>
-
- <function name="StencilMaskSeparate" offset="815">
- <param name="face" type="GLenum"/>
- <param name="mask" type="GLuint"/>
- </function>
-</category>
-
-
-<!-- ARB extensions sorted by extension number. -->
-
-<category name="GL_ARB_multitexture" number="1">
- <enum name="TEXTURE0_ARB" value="0x84C0"/>
- <enum name="TEXTURE1_ARB" value="0x84C1"/>
- <enum name="TEXTURE2_ARB" value="0x84C2"/>
- <enum name="TEXTURE3_ARB" value="0x84C3"/>
- <enum name="TEXTURE4_ARB" value="0x84C4"/>
- <enum name="TEXTURE5_ARB" value="0x84C5"/>
- <enum name="TEXTURE6_ARB" value="0x84C6"/>
- <enum name="TEXTURE7_ARB" value="0x84C7"/>
- <enum name="TEXTURE8_ARB" value="0x84C8"/>
- <enum name="TEXTURE9_ARB" value="0x84C9"/>
- <enum name="TEXTURE10_ARB" value="0x84CA"/>
- <enum name="TEXTURE11_ARB" value="0x84CB"/>
- <enum name="TEXTURE12_ARB" value="0x84CC"/>
- <enum name="TEXTURE13_ARB" value="0x84CD"/>
- <enum name="TEXTURE14_ARB" value="0x84CE"/>
- <enum name="TEXTURE15_ARB" value="0x84CF"/>
- <enum name="TEXTURE16_ARB" value="0x84D0"/>
- <enum name="TEXTURE17_ARB" value="0x84D1"/>
- <enum name="TEXTURE18_ARB" value="0x84D2"/>
- <enum name="TEXTURE19_ARB" value="0x84D3"/>
- <enum name="TEXTURE20_ARB" value="0x84D4"/>
- <enum name="TEXTURE21_ARB" value="0x84D5"/>
- <enum name="TEXTURE22_ARB" value="0x84D6"/>
- <enum name="TEXTURE23_ARB" value="0x84D7"/>
- <enum name="TEXTURE24_ARB" value="0x84D8"/>
- <enum name="TEXTURE25_ARB" value="0x84D9"/>
- <enum name="TEXTURE26_ARB" value="0x84DA"/>
- <enum name="TEXTURE27_ARB" value="0x84DB"/>
- <enum name="TEXTURE28_ARB" value="0x84DC"/>
- <enum name="TEXTURE29_ARB" value="0x84DD"/>
- <enum name="TEXTURE30_ARB" value="0x84DE"/>
- <enum name="TEXTURE31_ARB" value="0x84DF"/>
- <enum name="ACTIVE_TEXTURE_ARB" count="1" value="0x84E0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIENT_ACTIVE_TEXTURE_ARB" count="1" value="0x84E1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_UNITS_ARB" count="1" value="0x84E2">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="ActiveTextureARB" offset="374">
- <param name="texture" type="GLenum"/>
- <glx rop="197"/>
- </function>
-
- <function name="ClientActiveTextureARB" offset="375">
- <param name="texture" type="GLenum"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultiTexCoord1dARB" offset="376" vectorequiv="MultiTexCoord1dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord1dvARB" offset="377">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="198"/>
- </function>
-
- <function name="MultiTexCoord1fARB" offset="378" vectorequiv="MultiTexCoord1fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord1fvARB" offset="379">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="199"/>
- </function>
-
- <function name="MultiTexCoord1iARB" offset="380" vectorequiv="MultiTexCoord1ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord1ivARB" offset="381">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="1"/>
- <glx rop="200"/>
- </function>
-
- <function name="MultiTexCoord1sARB" offset="382" vectorequiv="MultiTexCoord1svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord1svARB" offset="383">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="201"/>
- </function>
-
- <function name="MultiTexCoord2dARB" offset="384" vectorequiv="MultiTexCoord2dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord2dvARB" offset="385">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="202"/>
- </function>
-
- <function name="MultiTexCoord2fARB" offset="386" vectorequiv="MultiTexCoord2fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord2fvARB" offset="387">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="203"/>
- </function>
-
- <function name="MultiTexCoord2iARB" offset="388" vectorequiv="MultiTexCoord2ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord2ivARB" offset="389">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="204"/>
- </function>
-
- <function name="MultiTexCoord2sARB" offset="390" vectorequiv="MultiTexCoord2svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord2svARB" offset="391">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="205"/>
- </function>
-
- <function name="MultiTexCoord3dARB" offset="392" vectorequiv="MultiTexCoord3dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord3dvARB" offset="393">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="206"/>
- </function>
-
- <function name="MultiTexCoord3fARB" offset="394" vectorequiv="MultiTexCoord3fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord3fvARB" offset="395">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="207"/>
- </function>
-
- <function name="MultiTexCoord3iARB" offset="396" vectorequiv="MultiTexCoord3ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord3ivARB" offset="397">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="208"/>
- </function>
-
- <function name="MultiTexCoord3sARB" offset="398" vectorequiv="MultiTexCoord3svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord3svARB" offset="399">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="209"/>
- </function>
-
- <function name="MultiTexCoord4dARB" offset="400" vectorequiv="MultiTexCoord4dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- <param name="q" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord4dvARB" offset="401">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="210"/>
- </function>
-
- <function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord4fvARB" offset="403">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="211"/>
- </function>
-
- <function name="MultiTexCoord4iARB" offset="404" vectorequiv="MultiTexCoord4ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- <param name="q" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord4ivARB" offset="405">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="212"/>
- </function>
-
- <function name="MultiTexCoord4sARB" offset="406" vectorequiv="MultiTexCoord4svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- <param name="q" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord4svARB" offset="407">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="213"/>
- </function>
-</category>
-
-<!-- ARB extension number 2 is a GLX extension. -->
-
-<category name="GL_ARB_transpose_matrix" number="3">
- <enum name="TRANSPOSE_MODELVIEW_MATRIX_ARB" value="0x84E3"/>
- <enum name="TRANSPOSE_PROJECTION_MATRIX_ARB" value="0x84E4"/>
- <enum name="TRANSPOSE_TEXTURE_MATRIX_ARB" value="0x84E5"/>
- <enum name="TRANSPOSE_COLOR_MATRIX_ARB" value="0x84E6"/>
-
- <function name="LoadTransposeMatrixfARB" offset="408">
- <param name="m" type="const GLfloat *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="LoadTransposeMatrixdARB" offset="409">
- <param name="m" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultTransposeMatrixfARB" offset="410">
- <param name="m" type="const GLfloat *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultTransposeMatrixdARB" offset="411">
- <param name="m" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<!-- ARB extension number 4 is a WGL extension. -->
-
-<category name="GL_ARB_multisample" number="5">
- <enum name="MULTISAMPLE_ARB" count="1" value="0x809D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_COVERAGE_ARB" count="1" value="0x809E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_ONE_ARB" count="1" value="0x809F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_ARB" count="1" value="0x80A0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_BUFFERS_ARB" count="1" value="0x80A8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLES_ARB" count="1" value="0x80A9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_VALUE_ARB" count="1" value="0x80AA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_INVERT_ARB" count="1" value="0x80AB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MULTISAMPLE_BIT_ARB" value="0x20000000"/>
-
- <function name="SampleCoverageARB" offset="412">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- <glx rop="229"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_env_add" number="6">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_texture_cube_map" number="7">
- <enum name="NORMAL_MAP_ARB" value="0x8511"/>
- <enum name="REFLECTION_MAP_ARB" value="0x8512"/>
- <enum name="TEXTURE_CUBE_MAP_ARB" count="1" value="0x8513">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_CUBE_MAP_ARB" count="1" value="0x8514">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_X_ARB" value="0x8515"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_ARB" value="0x8516"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_ARB" value="0x8517"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB" value="0x8518"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_ARB" value="0x8519"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB" value="0x851A"/>
- <enum name="PROXY_TEXTURE_CUBE_MAP_ARB" value="0x851B"/>
- <enum name="MAX_CUBE_MAP_TEXTURE_SIZE_ARB" count="1" value="0x851C">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<!-- ARB extension number 8 is a WGL extension. -->
-<!-- ARB extension number 9 is a WGL extension. -->
-<!-- ARB extension number 10 is a WGL extension. -->
-<!-- ARB extension number 11 is a WGL extension. -->
-
-<category name="GL_ARB_texture_compression" number="12">
- <enum name="COMPRESSED_ALPHA_ARB" value="0x84E9"/>
- <enum name="COMPRESSED_LUMINANCE_ARB" value="0x84EA"/>
- <enum name="COMPRESSED_LUMINANCE_ALPHA_ARB" value="0x84EB"/>
- <enum name="COMPRESSED_INTENSITY_ARB" value="0x84EC"/>
- <enum name="COMPRESSED_RGB_ARB" value="0x84ED"/>
- <enum name="COMPRESSED_RGBA_ARB" value="0x84EE"/>
- <enum name="TEXTURE_COMPRESSION_HINT_ARB" count="1" value="0x84EF">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_IMAGE_SIZE_ARB" count="1" value="0x86A0">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_ARB" count="1" value="0x86A1">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="NUM_TEXTURE_COMPRESSED_FORMATS_ARB" count="1" value="0x86A2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_FORMATS_ARB" value="0x86A3"/>
-
- <function name="CompressedTexImage3DARB" offset="554">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="216" handcode="client"/>
- </function>
-
- <function name="CompressedTexImage2DARB" offset="555">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="215" handcode="client"/>
- </function>
-
- <function name="CompressedTexImage1DARB" offset="556">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="214" handcode="client"/>
- </function>
-
- <function name="CompressedTexSubImage3DARB" offset="557">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="219" handcode="client"/>
- </function>
-
- <function name="CompressedTexSubImage2DARB" offset="558">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="218" handcode="client"/>
- </function>
-
- <function name="CompressedTexSubImage1DARB" offset="559">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="217" handcode="client"/>
- </function>
-
- <function name="GetCompressedTexImageARB" offset="560">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="img" type="GLvoid *" output="true"/>
-
- <!-- This has to be hand coded because the image size is in the
- "wrong" place. Technically, this should be a
- 'always_array="true"' case. The size field in the reply would
- be at offset 12. However, the size is actually at offset 16.
- This is where the 'width' is in a GetTexImage reply. -->
- <glx sop="160" handcode="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_border_clamp" number="13">
- <enum name="CLAMP_TO_BORDER_ARB" value="0x812D"/>
-</category>
-
-<category name="GL_ARB_point_parameters" number="14">
- <enum name="POINT_SIZE_MIN_ARB" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX_ARB" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_ARB" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_ARB" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
-
- <function name="PointParameterfARB" alias="PointParameterfEXT">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="2065"/>
- </function>
-
- <function name="PointParameterfvARB" alias="PointParameterfvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="2066"/>
- </function>
-</category>
-
-<category name="GL_ARB_vertex_blend" number="15">
- <enum name="MAX_VERTEX_UNITS_ARB" count="1" value="0x86A4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACTIVE_VERTEX_UNITS_ARB" count="1" value="0x86A5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_SUM_UNITY_ARB" count="1" value="0x86A6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_BLEND_ARB" count="1" value="0x86A7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_WEIGHT_ARB" count="1" value="0x86A8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_TYPE_ARB" count="1" value="0x86A9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_STRIDE_ARB" count="1" value="0x86AA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_SIZE_ARB" count="1" value="0x86AB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_POINTER_ARB" value="0x86AC"/>
- <enum name="WEIGHT_ARRAY_ARB" count="1" value="0x86AD">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW0_ARB" count="16" value="0x1700">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW1_ARB" count="16" value="0x850A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW2_ARB" count="16" value="0x8722">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW3_ARB" count="16" value="0x8723">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW4_ARB" count="16" value="0x8724">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW5_ARB" count="16" value="0x8725">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW6_ARB" count="16" value="0x8726">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW7_ARB" count="16" value="0x8727">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW8_ARB" count="16" value="0x8728">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW9_ARB" count="16" value="0x8729">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW10_ARB" count="16" value="0x872A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW11_ARB" count="16" value="0x872B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW12_ARB" count="16" value="0x872C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW13_ARB" count="16" value="0x872D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW14_ARB" count="16" value="0x872E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW15_ARB" count="16" value="0x872F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW16_ARB" count="16" value="0x8730">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW17_ARB" count="16" value="0x8731">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW18_ARB" count="16" value="0x8732">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW19_ARB" count="16" value="0x8733">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW20_ARB" count="16" value="0x8734">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW21_ARB" count="16" value="0x8735">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW22_ARB" count="16" value="0x8736">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW23_ARB" count="16" value="0x8737">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW24_ARB" count="16" value="0x8738">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW25_ARB" count="16" value="0x8739">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW26_ARB" count="16" value="0x873A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW27_ARB" count="16" value="0x873B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW28_ARB" count="16" value="0x873C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW29_ARB" count="16" value="0x873D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW30_ARB" count="16" value="0x873E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW31_ARB" count="16" value="0x873F">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="WeightbvARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLbyte *"/>
- </function>
-
- <function name="WeightsvARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLshort *"/>
- </function>
-
- <function name="WeightivARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLint *"/>
- </function>
-
- <function name="WeightfvARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLfloat *"/>
- </function>
-
- <function name="WeightdvARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLdouble *"/>
- </function>
-
- <function name="WeightubvARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLubyte *"/>
- </function>
-
- <function name="WeightusvARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLushort *"/>
- </function>
-
- <function name="WeightuivARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLuint *"/>
- </function>
-
- <function name="WeightPointerARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexBlendARB" offset="?">
- <param name="count" type="GLint"/>
- </function>
-</category>
-
-<category name="GL_ARB_matrix_palette" number="16">
- <enum name="MATRIX_PALETTE_ARB" count="1" value="0x8840">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_MATRIX_PALETTE_STACK_DEPTH_ARB" count="1" value="0x8841">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PALETTE_MATRICES_ARB" count="1" value="0x8842">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_PALETTE_MATRIX_ARB" count="1" value="0x8843">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_ARB" count="1" value="0x8844">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_MATRIX_INDEX_ARB" count="1" value="0x8845">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_SIZE_ARB" count="1" value="0x8846">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_TYPE_ARB" count="1" value="0x8847">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_STRIDE_ARB" count="1" value="0x8848">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_POINTER_ARB" value="0x8849"/>
-
- <function name="CurrentPaletteMatrixARB" offset="?">
- <param name="index" type="GLint"/>
- <glx ignore="true" rop="4329"/>
- </function>
-
- <function name="MatrixIndexubvARB" offset="?">
- <param name="size" type="GLint" counter="true"/>
- <param name="indices" type="const GLubyte *" count="size"/>
- <glx ignore="true" rop="4326"/>
- </function>
-
- <function name="MatrixIndexusvARB" offset="?">
- <param name="size" type="GLint" counter="true"/>
- <param name="indices" type="const GLushort *" count="size"/>
- <glx ignore="true" rop="4327"/>
- </function>
-
- <function name="MatrixIndexuivARB" offset="?">
- <param name="size" type="GLint" counter="true"/>
- <param name="indices" type="const GLuint *" count="size"/>
- <glx ignore="true" rop="4328"/>
- </function>
-
- <function name="MatrixIndexPointerARB" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_env_combine" number="17">
- <enum name="COMBINE_ARB" value="0x8570"/>
- <enum name="COMBINE_RGB_ARB" value="0x8571"/>
- <enum name="COMBINE_ALPHA_ARB" value="0x8572"/>
- <enum name="SOURCE0_RGB_ARB" value="0x8580"/>
- <enum name="SOURCE1_RGB_ARB" value="0x8581"/>
- <enum name="SOURCE2_RGB_ARB" value="0x8582"/>
- <enum name="SOURCE0_ALPHA_ARB" value="0x8588"/>
- <enum name="SOURCE1_ALPHA_ARB" value="0x8589"/>
- <enum name="SOURCE2_ALPHA_ARB" value="0x858A"/>
- <enum name="OPERAND0_RGB_ARB" value="0x8590"/>
- <enum name="OPERAND1_RGB_ARB" value="0x8591"/>
- <enum name="OPERAND2_RGB_ARB" value="0x8592"/>
- <enum name="OPERAND0_ALPHA_ARB" value="0x8598"/>
- <enum name="OPERAND1_ALPHA_ARB" value="0x8599"/>
- <enum name="OPERAND2_ALPHA_ARB" value="0x859A"/>
- <enum name="RGB_SCALE_ARB" value="0x8573"/>
- <enum name="ADD_SIGNED_ARB" value="0x8574"/>
- <enum name="INTERPOLATE_ARB" value="0x8575"/>
- <enum name="SUBTRACT_ARB" value="0x84E7"/>
- <enum name="CONSTANT_ARB" value="0x8576"/>
- <enum name="PRIMARY_COLOR_ARB" value="0x8577"/>
- <enum name="PREVIOUS_ARB" value="0x8578"/>
-</category>
-
-<category name="GL_ARB_texture_env_crossbar" number="18">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_texture_env_dot3" number="19">
- <enum name="DOT3_RGB_ARB" value="0x86AE"/>
- <enum name="DOT3_RGBA_ARB" value="0x86AF"/>
-</category>
-
-<!-- ARB extension number 20 is a WGL extension. -->
-
-<category name="GL_ARB_texture_mirrored_repeat" number="21">
- <enum name="MIRRORED_REPEAT_ARB" value="0x8370"/>
-</category>
-
-<category name="GL_ARB_depth_texture" number="22">
- <enum name="DEPTH_COMPONENT16_ARB" value="0x81A5"/>
- <enum name="DEPTH_COMPONENT24_ARB" value="0x81A6"/>
- <enum name="DEPTH_COMPONENT32_ARB" value="0x81A7"/>
- <enum name="TEXTURE_DEPTH_SIZE_ARB" count="1" value="0x884A">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="DEPTH_TEXTURE_MODE_ARB" count="1" value="0x884B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_shadow" number="23">
- <enum name="TEXTURE_COMPARE_MODE_ARB" count="1" value="0x884C">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_FUNC_ARB" count="1" value="0x884D">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="COMPARE_R_TO_TEXTURE_ARB" value="0x884E"/>
-</category>
-
-<category name="GL_ARB_shadow_ambient" number="24">
- <enum name="TEXTURE_COMPARE_FAIL_VALUE_ARB" count="1" value="0x80BF">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_window_pos" number="25">
- <function name="WindowPos2dARB" alias="WindowPos2dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="WindowPos2fARB" alias="WindowPos2fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="WindowPos2iARB" alias="WindowPos2iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="WindowPos2sARB" alias="WindowPos2sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="WindowPos2dvARB" alias="WindowPos2dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos2fvARB" alias="WindowPos2fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos2ivARB" alias="WindowPos2ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos2svARB" alias="WindowPos2svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="WindowPos3dARB" alias="WindowPos3dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="WindowPos3fARB" alias="WindowPos3fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="WindowPos3iARB" alias="WindowPos3iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="WindowPos3sARB" alias="WindowPos3sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="WindowPos3dvARB" alias="WindowPos3dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos3fvARB" alias="WindowPos3fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos3ivARB" alias="WindowPos3ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos3svARB" alias="WindowPos3svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-</category>
-
-<category name="GL_ARB_vertex_program" number="26">
- <enum name="COLOR_SUM_ARB" count="1" value="0x8458">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_PROGRAM_ARB" count="1" value="0x8620">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_ENABLED_ARB" count="1" value="0x8622">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_SIZE_ARB" count="1" value="0x8623">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_STRIDE_ARB" count="1" value="0x8624">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_TYPE_ARB" count="1" value="0x8625">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="CURRENT_VERTEX_ATTRIB_ARB" count="1" value="0x8626">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_LENGTH_ARB" count="1" value="0x8627">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_STRING_ARB" value="0x8628"/>
- <enum name="MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB" count="1" value="0x862E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_MATRICES_ARB" count="1" value="0x862F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_MATRIX_STACK_DEPTH_ARB" count="1" value="0x8640">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_MATRIX_ARB" count="16" value="0x8641">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_PROGRAM_POINT_SIZE_ARB" count="1" value="0x8642">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_PROGRAM_TWO_SIDE_ARB" count="1" value="0x8643">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_POINTER_ARB" value="0x8645"/>
- <enum name="PROGRAM_ERROR_POSITION_ARB" count="1" value="0x864B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROGRAM_BINDING_ARB" count="1" value="0x8677">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_VERTEX_ATTRIBS_ARB" count="1" value="0x8869">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" value="0x886A"/>
- <enum name="PROGRAM_ERROR_STRING_ARB" value="0x8874"/>
- <enum name="PROGRAM_FORMAT_ASCII_ARB" value="0x8875"/>
- <enum name="PROGRAM_FORMAT_ARB" count="1" value="0x8876">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_INSTRUCTIONS_ARB" count="1" value="0x88A0">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_INSTRUCTIONS_ARB" count="1" value="0x88A1">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_INSTRUCTIONS_ARB" count="1" value="0x88A2">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" count="1" value="0x88A3">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_TEMPORARIES_ARB" count="1" value="0x88A4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_TEMPORARIES_ARB" count="1" value="0x88A5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_TEMPORARIES_ARB" count="1" value="0x88A6">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_TEMPORARIES_ARB" count="1" value="0x88A7">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_PARAMETERS_ARB" count="1" value="0x88A8">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_PARAMETERS_ARB" count="1" value="0x88A9">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_PARAMETERS_ARB" count="1" value="0x88AA">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_PARAMETERS_ARB" count="1" value="0x88AB">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_ATTRIBS_ARB" count="1" value="0x88AC">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ATTRIBS_ARB" count="1" value="0x88AD">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_ATTRIBS_ARB" count="1" value="0x88AE">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_ATTRIBS_ARB" count="1" value="0x88AF">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_ADDRESS_REGISTERS_ARB" count="1" value="0x88B0">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ADDRESS_REGISTERS_ARB" count="1" value="0x88B1">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" count="1" value="0x88B2">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" count="1" value="0x88B3">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_LOCAL_PARAMETERS_ARB" count="1" value="0x88B4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ENV_PARAMETERS_ARB" count="1" value="0x88B5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_UNDER_NATIVE_LIMITS_ARB" count="1" value="0x88B6">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="TRANSPOSE_CURRENT_MATRIX_ARB" count="16" value="0x88B7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX0_ARB" value="0x88C0"/>
- <enum name="MATRIX1_ARB" value="0x88C1"/>
- <enum name="MATRIX2_ARB" value="0x88C2"/>
- <enum name="MATRIX3_ARB" value="0x88C3"/>
- <enum name="MATRIX4_ARB" value="0x88C4"/>
- <enum name="MATRIX5_ARB" value="0x88C5"/>
- <enum name="MATRIX6_ARB" value="0x88C6"/>
- <enum name="MATRIX7_ARB" value="0x88C7"/>
- <enum name="MATRIX8_ARB" value="0x88C8"/>
- <enum name="MATRIX9_ARB" value="0x88C9"/>
- <enum name="MATRIX10_ARB" value="0x88CA"/>
- <enum name="MATRIX11_ARB" value="0x88CB"/>
- <enum name="MATRIX12_ARB" value="0x88CC"/>
- <enum name="MATRIX13_ARB" value="0x88CD"/>
- <enum name="MATRIX14_ARB" value="0x88CE"/>
- <enum name="MATRIX15_ARB" value="0x88CF"/>
- <enum name="MATRIX16_ARB" value="0x88D0"/>
- <enum name="MATRIX17_ARB" value="0x88D1"/>
- <enum name="MATRIX18_ARB" value="0x88D2"/>
- <enum name="MATRIX19_ARB" value="0x88D3"/>
- <enum name="MATRIX20_ARB" value="0x88D4"/>
- <enum name="MATRIX21_ARB" value="0x88D5"/>
- <enum name="MATRIX22_ARB" value="0x88D6"/>
- <enum name="MATRIX23_ARB" value="0x88D7"/>
- <enum name="MATRIX24_ARB" value="0x88D8"/>
- <enum name="MATRIX25_ARB" value="0x88D9"/>
- <enum name="MATRIX26_ARB" value="0x88DA"/>
- <enum name="MATRIX27_ARB" value="0x88DB"/>
- <enum name="MATRIX28_ARB" value="0x88DC"/>
- <enum name="MATRIX29_ARB" value="0x88DD"/>
- <enum name="MATRIX30_ARB" value="0x88DE"/>
- <enum name="MATRIX31_ARB" value="0x88DF"/>
-
- <function name="GetVertexAttribdvARB" offset="588">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx handcode="client" vendorpriv="1301"/>
- </function>
-
- <function name="GetVertexAttribfvARB" offset="589">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx handcode="client" vendorpriv="1302"/>
- </function>
-
- <function name="GetVertexAttribivARB" offset="590">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx handcode="client" vendorpriv="1303"/>
- </function>
-
- <function name="VertexAttrib1dARB" offset="603" vectorequiv="VertexAttrib1dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib1dvARB" offset="604">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="4197"/>
- </function>
-
- <function name="VertexAttrib1fARB" offset="605" vectorequiv="VertexAttrib1fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib1fvARB" offset="606">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="4193"/>
- </function>
-
- <function name="VertexAttrib1sARB" offset="607" vectorequiv="VertexAttrib1svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib1svARB" offset="608">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="4189"/>
- </function>
-
- <function name="VertexAttrib2dARB" offset="609" vectorequiv="VertexAttrib2dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib2dvARB" offset="610">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="4198"/>
- </function>
-
- <function name="VertexAttrib2fARB" offset="611" vectorequiv="VertexAttrib2fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib2fvARB" offset="612">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="4194"/>
- </function>
-
- <function name="VertexAttrib2sARB" offset="613" vectorequiv="VertexAttrib2svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib2svARB" offset="614">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="4190"/>
- </function>
-
- <function name="VertexAttrib3dARB" offset="615" vectorequiv="VertexAttrib3dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib3dvARB" offset="616">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="4199"/>
- </function>
-
- <function name="VertexAttrib3fARB" offset="617" vectorequiv="VertexAttrib3fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib3fvARB" offset="618">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="4195"/>
- </function>
-
- <function name="VertexAttrib3sARB" offset="619" vectorequiv="VertexAttrib3svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib3svARB" offset="620">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="4191"/>
- </function>
-
- <function name="VertexAttrib4dARB" offset="621" vectorequiv="VertexAttrib4dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib4dvARB" offset="622">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="4200"/>
- </function>
-
- <function name="VertexAttrib4fARB" offset="623" vectorequiv="VertexAttrib4fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib4fvARB" offset="624">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="4196"/>
- </function>
-
- <function name="VertexAttrib4sARB" offset="625" vectorequiv="VertexAttrib4svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib4svARB" offset="626">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="4192"/>
- </function>
-
- <function name="VertexAttrib4NubARB" offset="627" vectorequiv="VertexAttrib4NubvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLubyte"/>
- <param name="y" type="GLubyte"/>
- <param name="z" type="GLubyte"/>
- <param name="w" type="GLubyte"/>
- </function>
-
- <function name="VertexAttrib4NubvARB" offset="628">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="4201"/>
- </function>
-
- <function name="VertexAttrib4bvARB" offset="654">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *" count="4"/>
- <glx rop="4230"/>
- </function>
-
- <function name="VertexAttrib4ivARB" offset="655">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="4231"/>
- </function>
-
- <function name="VertexAttrib4ubvARB" offset="656">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="4232"/>
- </function>
-
- <function name="VertexAttrib4usvARB" offset="657">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *" count="4"/>
- <glx rop="4233"/>
- </function>
-
- <function name="VertexAttrib4uivARB" offset="658">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *" count="4"/>
- <glx rop="4234"/>
- </function>
-
- <function name="VertexAttrib4NbvARB" offset="659">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *" count="4"/>
- <glx rop="4235"/>
- </function>
-
- <function name="VertexAttrib4NsvARB" offset="660">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="4236"/>
- </function>
-
- <function name="VertexAttrib4NivARB" offset="661">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="4237"/>
- </function>
-
- <function name="VertexAttrib4NusvARB" offset="662">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *" count="4"/>
- <glx rop="4238"/>
- </function>
-
- <function name="VertexAttrib4NuivARB" offset="663">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *" count="4"/>
- <glx rop="4239"/>
- </function>
-
- <function name="VertexAttribPointerARB" offset="664">
- <param name="index" type="GLuint"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="normalized" type="GLboolean"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="EnableVertexAttribArrayARB" offset="665">
- <param name="index" type="GLuint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DisableVertexAttribArrayARB" offset="666">
- <param name="index" type="GLuint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="ProgramStringARB" offset="667">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="string" type="const GLvoid *" count="len"/>
- <glx rop="4217" large="true"/>
- </function>
-
- <function name="BindProgramARB" alias="BindProgramNV">
- <param name="target" type="GLenum"/>
- <param name="program" type="GLuint"/>
- </function>
-
- <function name="DeleteProgramsARB" alias="DeleteProgramsNV">
- <param name="n" type="GLsizei"/>
- <param name="programs" type="const GLuint *"/>
- </function>
-
- <function name="GenProgramsARB" alias="GenProgramsNV">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="programs" type="GLuint *" output="true" count="n"/>
- </function>
-
- <function name="IsProgramARB" alias="IsProgramNV">
- <param name="program" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="ProgramEnvParameter4dARB" offset="668" vectorequiv="ProgramEnvParameter4dvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramEnvParameter4dvARB" offset="669">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLdouble *" count="4"/>
- <glx rop="4185" doubles_in_order="true"/>
- </function>
-
- <function name="ProgramEnvParameter4fARB" offset="670" vectorequiv="ProgramEnvParameter4fvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramEnvParameter4fvARB" offset="671">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4184"/>
- </function>
-
- <function name="ProgramLocalParameter4dARB" offset="672" vectorequiv="ProgramLocalParameter4dvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramLocalParameter4dvARB" offset="673">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLdouble *" count="4"/>
- <glx rop="4216" doubles_in_order="true"/>
- </function>
-
- <function name="ProgramLocalParameter4fARB" offset="674" vectorequiv="ProgramLocalParameter4fvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramLocalParameter4fvARB" offset="675">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4215"/>
- </function>
-
- <!-- The GetProgramEnvParameter[df]vARB are handcoded because there
- is an extra CARD32 of padding after the "index" field. Originally,
- GetProgranEnvParameter[df]vARB and GetProgramParameter[df]vNV
- shared the same GLX protocol. The pad field was where the pname
- parameter was in the NV functions. When this error was discovered
- and fixed, there was already at least one implementation of
- GLX protocol for ARB_vertex_program, but there were no
- implementations of NV_vertex_program. The sollution was to renumber
- the opcodes for NV_vertex_program and convert the unused field in
- the ARB_vertex_program protocol to unused padding.
- -->
-
- <function name="GetProgramEnvParameterdvARB" offset="676">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1297" handcode="client" doubles_in_order="true"/>
- </function>
-
- <function name="GetProgramEnvParameterfvARB" offset="677">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1296" handcode="client"/>
- </function>
-
- <function name="GetProgramLocalParameterdvARB" offset="678">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1306" handcode="client" doubles_in_order="true"/>
- </function>
-
- <function name="GetProgramLocalParameterfvARB" offset="679">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1305" handcode="client"/>
- </function>
-
-
- <function name="GetProgramivARB" offset="680">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="1307"/>
- </function>
-
- <function name="GetProgramStringARB" offset="681">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="string" type="GLvoid *" output="true"/>
- <glx vendorpriv="1308" handcode="server" always_array="true"/>
- </function>
-
- <function name="GetVertexAttribPointervARB" alias="GetVertexAttribPointervNV">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_fragment_program" number="27">
- <enum name="FRAGMENT_PROGRAM_ARB" count="1" value="0x8804">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROGRAM_ALU_INSTRUCTIONS_ARB" count="1" value="0x8805">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_TEX_INSTRUCTIONS_ARB" count="1" value="0x8806">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_TEX_INDIRECTIONS_ARB" count="1" value="0x8807">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" count="1" value="0x8808">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" count="1" value="0x8809">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" count="1" value="0x880A">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" count="1" value="0x880B">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" count="1" value="0x880C">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_TEX_INDIRECTIONS_ARB" count="1" value="0x880D">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" count="1" value="0x880E">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" count="1" value="0x880F">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" count="1" value="0x8810">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_COORDS_ARB" count="1" value="0x8871">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_IMAGE_UNITS_ARB" count="1" value="0x8872">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_vertex_buffer_object" number="28">
- <enum name="BUFFER_SIZE_ARB" value="0x8764"/>
- <enum name="BUFFER_USAGE_ARB" value="0x8765"/>
- <enum name="ARRAY_BUFFER_ARB" value="0x8892"/>
- <enum name="ELEMENT_ARRAY_BUFFER_ARB" value="0x8893"/>
- <enum name="ARRAY_BUFFER_BINDING_ARB" value="0x8894"/>
- <enum name="ELEMENT_ARRAY_BUFFER_BINDING_ARB" value="0x8895"/>
- <enum name="VERTEX_ARRAY_BUFFER_BINDING_ARB" value="0x8896"/>
- <enum name="NORMAL_ARRAY_BUFFER_BINDING_ARB" value="0x8897"/>
- <enum name="COLOR_ARRAY_BUFFER_BINDING_ARB" value="0x8898"/>
- <enum name="INDEX_ARRAY_BUFFER_BINDING_ARB" value="0x8899"/>
- <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB" value="0x889A"/>
- <enum name="EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB" value="0x889B"/>
- <enum name="SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB" value="0x889C"/>
- <enum name="FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB" value="0x889D"/>
- <enum name="WEIGHT_ARRAY_BUFFER_BINDING_ARB" value="0x889E"/>
- <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB" value="0x889F"/>
- <enum name="READ_ONLY_ARB" value="0x88B8"/>
- <enum name="WRITE_ONLY_ARB" value="0x88B9"/>
- <enum name="READ_WRITE_ARB" value="0x88BA"/>
- <enum name="BUFFER_ACCESS_ARB" value="0x88BB"/>
- <enum name="BUFFER_MAPPED_ARB" value="0x88BC"/>
- <enum name="BUFFER_MAP_POINTER_ARB" value="0x88BD"/>
- <enum name="STREAM_DRAW_ARB" value="0x88E0"/>
- <enum name="STREAM_READ_ARB" value="0x88E1"/>
- <enum name="STREAM_COPY_ARB" value="0x88E2"/>
- <enum name="STATIC_DRAW_ARB" value="0x88E4"/>
- <enum name="STATIC_READ_ARB" value="0x88E5"/>
- <enum name="STATIC_COPY_ARB" value="0x88E6"/>
- <enum name="DYNAMIC_DRAW_ARB" value="0x88E8"/>
- <enum name="DYNAMIC_READ_ARB" value="0x88E9"/>
- <enum name="DYNAMIC_COPY_ARB" value="0x88EA"/>
-
- <type name="intptrARB" size="4"/>
- <type name="sizeiptrARB" unsigned="true" size="4"/>
-
- <function name="BindBufferARB" offset="688">
- <param name="target" type="GLenum"/>
- <param name="buffer" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BufferDataARB" offset="689">
- <param name="target" type="GLenum"/>
- <param name="size" type="GLsizeiptrARB"/>
- <param name="data" type="const GLvoid *"/>
- <param name="usage" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BufferSubDataARB" offset="690">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptrARB"/>
- <param name="size" type="GLsizeiptrARB"/>
- <param name="data" type="const GLvoid *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DeleteBuffersARB" offset="691">
- <param name="n" type="GLsizei"/>
- <param name="buffer" type="const GLuint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GenBuffersARB" offset="692">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="buffer" type="GLuint *" output="true" count="n"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetBufferParameterivARB" offset="693">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetBufferPointervARB" offset="694">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetBufferSubDataARB" offset="695">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptrARB"/>
- <param name="size" type="GLsizeiptrARB"/>
- <param name="data" type="GLvoid *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="IsBufferARB" offset="696">
- <param name="buffer" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="MapBufferARB" offset="697">
- <param name="target" type="GLenum"/>
- <param name="access" type="GLenum"/>
- <return type="GLvoid *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UnmapBufferARB" offset="698">
- <param name="target" type="GLenum"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_occlusion_query" number="29">
- <enum name="QUERY_COUNTER_BITS_ARB" count="1" value="0x8864">
- <size name="GetQueryivARB" mode="get"/>
- </enum>
- <enum name="CURRENT_QUERY_ARB" count="1" value="0x8865">
- <size name="GetQueryivARB" mode="get"/>
- </enum>
- <enum name="QUERY_RESULT_ARB" count="1" value="0x8866">
- <size name="GetQueryObjectivARB" mode="get"/>
- <size name="GetQueryObjectuivARB" mode="get"/>
- </enum>
- <enum name="QUERY_RESULT_AVAILABLE_ARB" count="1" value="0x8867">
- <size name="GetQueryObjectivARB" mode="get"/>
- <size name="GetQueryObjectuivARB" mode="get"/>
- </enum>
- <enum name="SAMPLES_PASSED_ARB" value="0x8914"/>
-
- <function name="GenQueriesARB" offset="700">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="GLuint *" output="true" count="n"/>
- <glx sop="162" always_array="true"/>
- </function>
-
- <function name="DeleteQueriesARB" offset="701">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="const GLuint *" count="n"/>
- <glx sop="161"/>
- </function>
-
- <function name="IsQueryARB" offset="702">
- <param name="id" type="GLuint"/>
- <return type="GLboolean"/>
- <glx sop="163"/>
- </function>
-
- <function name="BeginQueryARB" offset="703">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- <glx rop="231"/>
- </function>
-
- <function name="EndQueryARB" offset="704">
- <param name="target" type="GLenum"/>
- <glx rop="232"/>
- </function>
-
- <function name="GetQueryivARB" offset="705">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="164"/>
- </function>
-
- <function name="GetQueryObjectivARB" offset="706">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="165"/>
- </function>
-
- <function name="GetQueryObjectuivARB" offset="707">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint *" output="true" variable_param="pname"/>
- <glx sop="166"/>
- </function>
-</category>
-
-<category name="GL_ARB_shader_objects" number="30">
- <enum name="PROGRAM_OBJECT_ARB" value="0x8B40"/>
- <enum name="SHADER_OBJECT_ARB" value="0x8B48"/>
- <enum name="OBJECT_TYPE_ARB" value="0x8B4E"/>
- <enum name="OBJECT_SUBTYPE_ARB" value="0x8B4F"/>
- <enum name="FLOAT_VEC2_ARB" value="0x8B50"/>
- <enum name="FLOAT_VEC3_ARB" value="0x8B51"/>
- <enum name="FLOAT_VEC4_ARB" value="0x8B52"/>
- <enum name="INT_VEC2_ARB" value="0x8B53"/>
- <enum name="INT_VEC3_ARB" value="0x8B54"/>
- <enum name="INT_VEC4_ARB" value="0x8B55"/>
- <enum name="BOOL_ARB" value="0x8B56"/>
- <enum name="BOOL_VEC2_ARB" value="0x8B57"/>
- <enum name="BOOL_VEC3_ARB" value="0x8B58"/>
- <enum name="BOOL_VEC4_ARB" value="0x8B59"/>
- <enum name="FLOAT_MAT2_ARB" value="0x8B5A"/>
- <enum name="FLOAT_MAT3_ARB" value="0x8B5B"/>
- <enum name="FLOAT_MAT4_ARB" value="0x8B5C"/>
- <enum name="OBJECT_DELETE_STATUS_ARB" value="0x8B80"/>
- <enum name="OBJECT_COMPILE_STATUS_ARB" value="0x8B81"/>
- <enum name="OBJECT_LINK_STATUS_ARB" value="0x8B82"/>
- <enum name="OBJECT_VALIDATE_STATUS_ARB" value="0x8B83"/>
- <enum name="OBJECT_INFO_LOG_LENGTH_ARB" value="0x8B84"/>
- <enum name="OBJECT_ATTACHED_OBJECTS_ARB" value="0x8B85"/>
- <enum name="OBJECT_ACTIVE_UNIFORMS_ARB" value="0x8B86"/>
- <enum name="OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB" value="0x8B87"/>
- <enum name="OBJECT_SHADER_SOURCE_LENGTH_ARB" value="0x8B88"/>
-
- <type name="charARB" size="1" glx_name="CARD8"/>
- <type name="handleARB" size="4" glx_name="CARD32"/>
-
- <function name="DeleteObjectARB" offset="711">
- <param name="obj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetHandleARB" offset="712">
- <param name="pname" type="GLenum"/>
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DetachObjectARB" offset="713">
- <param name="containerObj" type="GLhandleARB"/>
- <param name="attachedObj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CreateShaderObjectARB" offset="714">
- <param name="shaderType" type="GLenum"/>
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ShaderSourceARB" offset="715">
- <param name="shaderObj" type="GLhandleARB"/>
- <param name="count" type="GLsizei"/>
- <param name="string" type="const GLcharARB **"/>
- <param name="length" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CompileShaderARB" offset="716">
- <param name="shaderObj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CreateProgramObjectARB" offset="717">
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AttachObjectARB" offset="718">
- <param name="containerObj" type="GLhandleARB"/>
- <param name="obj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="LinkProgramARB" offset="719">
- <param name="programObj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UseProgramObjectARB" offset="720">
- <param name="programObj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ValidateProgramARB" offset="721">
- <param name="programObj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1fARB" offset="722">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2fARB" offset="723">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3fARB" offset="724">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4fARB" offset="725">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="v3" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1iARB" offset="726">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2iARB" offset="727">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3iARB" offset="728">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <param name="v2" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4iARB" offset="729">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <param name="v2" type="GLint"/>
- <param name="v3" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1fvARB" offset="730">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2fvARB" offset="731">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3fvARB" offset="732">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4fvARB" offset="733">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1ivARB" offset="734">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2ivARB" offset="735">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3ivARB" offset="736">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4ivARB" offset="737">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix2fvARB" offset="738">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix3fvARB" offset="739">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix4fvARB" offset="740">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetObjectParameterfvARB" offset="741">
- <param name="obj" type="GLhandleARB"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetObjectParameterivARB" offset="742">
- <param name="obj" type="GLhandleARB"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetInfoLogARB" offset="743">
- <param name="obj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="infoLog" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetAttachedObjectsARB" offset="744">
- <param name="containerObj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="infoLog" type="GLhandleARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformLocationARB" offset="745">
- <param name="programObj" type="GLhandleARB"/>
- <param name="name" type="const GLcharARB *"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetActiveUniformARB" offset="746">
- <param name="programObj" type="GLhandleARB"/>
- <param name="index" type="GLuint"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="size" type="GLint *" output="true"/>
- <param name="type" type="GLenum *" output="true"/>
- <param name="name" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformfvARB" offset="747">
- <param name="programObj" type="GLhandleARB"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformivARB" offset="748">
- <param name="programObj" type="GLhandleARB"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetShaderSourceARB" offset="749">
- <param name="obj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="source" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_vertex_shader" number="31">
- <enum name="VERTEX_SHADER_ARB" value="0x8B31"/>
- <enum name="MAX_VERTEX_UNIFORM_COMPONENTS_ARB" value="0x8B4A"/>
- <enum name="MAX_VARYING_FLOATS_ARB" value="0x8B4B"/>
- <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" value="0x8B4C"/>
- <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" value="0x8B4D"/>
- <enum name="OBJECT_ACTIVE_ATTRIBUTES_ARB" value="0x8B89"/>
- <enum name="OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" value="0x8B8A"/>
-
- <function name="BindAttribLocationARB" offset="750">
- <param name="programObj" type="GLhandleARB"/>
- <param name="index" type="GLuint"/>
- <param name="name" type="const GLcharARB *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetActiveAttribARB" offset="751">
- <param name="programObj" type="GLhandleARB"/>
- <param name="index" type="GLuint"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="size" type="GLint *" output="true"/>
- <param name="type" type="GLenum *" output="true"/>
- <param name="name" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetAttribLocationARB" offset="752">
- <param name="programObj" type="GLhandleARB"/>
- <param name="name" type="const GLcharARB *"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_fragment_shader" number="32">
- <enum name="FRAGMENT_SHADER_ARB" value="0x8B30"/>
- <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" value="0x8B49"/>
-</category>
-
-<category name="GL_ARB_shading_language_100" number="33">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_texture_non_power_of_two" number="34">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_point_sprite" number="35">
- <enum name="POINT_SPRITE_ARB" count="1" value="0x8861">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COORD_REPLACE_ARB" count="1" value="0x8862">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_fragment_program_shadow" number="36">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_draw_buffers" number="37">
- <enum name="MAX_DRAW_BUFFERS_ARB" count="1" value="0x8824">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER0_ARB" count="1" value="0x8825">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER1_ARB" count="1" value="0x8826">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER2_ARB" count="1" value="0x8827">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER3_ARB" count="1" value="0x8828">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER4_ARB" count="1" value="0x8829">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER5_ARB" count="1" value="0x882A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER6_ARB" count="1" value="0x882B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER7_ARB" count="1" value="0x882C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER8_ARB" count="1" value="0x882D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER9_ARB" count="1" value="0x882E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER10_ARB" count="1" value="0x882F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER11_ARB" count="1" value="0x8830">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER12_ARB" count="1" value="0x8831">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER13_ARB" count="1" value="0x8832">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER14_ARB" count="1" value="0x8833">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER15_ARB" count="1" value="0x8834">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DrawBuffersARB" offset="413">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- <glx rop="233" large="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_rectangle" number="38">
- <enum name="TEXTURE_RECTANGLE_ARB" count="1" value="0x84F5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_RECTANGLE_ARB" count="1" value="0x84F6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_RECTANGLE_ARB" value="0x84F7"/>
- <enum name="MAX_RECTANGLE_TEXTURE_SIZE_ARB" count="1" value="0x84F8">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<!-- Non-ARB extensions sorted by extension number. -->
-
-<category name="GL_EXT_blend_color" number="2">
- <enum name="CONSTANT_COLOR_EXT" value="0x8001"/>
- <enum name="ONE_MINUS_CONSTANT_COLOR_EXT" value="0x8002"/>
- <enum name="CONSTANT_ALPHA_EXT" value="0x8003"/>
- <enum name="ONE_MINUS_CONSTANT_ALPHA_EXT" value="0x8004"/>
- <enum name="BLEND_COLOR_EXT" count="4" value="0x8005">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="BlendColorEXT" alias="BlendColor">
- <param name="red" type="GLclampf"/>
- <param name="green" type="GLclampf"/>
- <param name="blue" type="GLclampf"/>
- <param name="alpha" type="GLclampf"/>
- </function>
-</category>
-
-<category name="GL_EXT_polygon_offset" number="3">
- <function name="PolygonOffsetEXT" offset="414">
- <param name="factor" type="GLfloat"/>
- <param name="bias" type="GLfloat"/>
- <glx rop="4098" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture" number="4">
- <enum name="ALPHA4_EXT" value="0x803B"/>
- <enum name="ALPHA8_EXT" value="0x803C"/>
- <enum name="ALPHA12_EXT" value="0x803D"/>
- <enum name="ALPHA16_EXT" value="0x803E"/>
- <enum name="LUMINANCE4_EXT" value="0x803F"/>
- <enum name="LUMINANCE8_EXT" value="0x8040"/>
- <enum name="LUMINANCE12_EXT" value="0x8041"/>
- <enum name="LUMINANCE16_EXT" value="0x8042"/>
- <enum name="LUMINANCE4_ALPHA4_EXT" value="0x8043"/>
- <enum name="LUMINANCE6_ALPHA2_EXT" value="0x8044"/>
- <enum name="LUMINANCE8_ALPHA8_EXT" value="0x8045"/>
- <enum name="LUMINANCE12_ALPHA4_EXT" value="0x8046"/>
- <enum name="LUMINANCE12_ALPHA12_EXT" value="0x8047"/>
- <enum name="LUMINANCE16_ALPHA16_EXT" value="0x8048"/>
- <enum name="INTENSITY_EXT" value="0x8049"/>
- <enum name="INTENSITY4_EXT" value="0x804A"/>
- <enum name="INTENSITY8_EXT" value="0x804B"/>
- <enum name="INTENSITY12_EXT" value="0x804C"/>
- <enum name="INTENSITY16_EXT" value="0x804D"/>
- <enum name="RGB2_EXT" value="0x804E"/>
- <enum name="RGB4_EXT" value="0x804F"/>
- <enum name="RGB5_EXT" value="0x8050"/>
- <enum name="RGB8_EXT" value="0x8051"/>
- <enum name="RGB10_EXT" value="0x8052"/>
- <enum name="RGB12_EXT" value="0x8053"/>
- <enum name="RGB16_EXT" value="0x8054"/>
- <enum name="RGBA2_EXT" value="0x8055"/>
- <enum name="RGBA4_EXT" value="0x8056"/>
- <enum name="RGB5_A1_EXT" value="0x8057"/>
- <enum name="RGBA8_EXT" value="0x8058"/>
- <enum name="RGB10_A2_EXT" value="0x8059"/>
- <enum name="RGBA12_EXT" value="0x805A"/>
- <enum name="RGBA16_EXT" value="0x805B"/>
- <enum name="TEXTURE_RED_SIZE_EXT" count="1" value="0x805C">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_GREEN_SIZE_EXT" count="1" value="0x805D">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BLUE_SIZE_EXT" count="1" value="0x805E">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ALPHA_SIZE_EXT" count="1" value="0x805F">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LUMINANCE_SIZE_EXT" count="1" value="0x8060">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_INTENSITY_SIZE_EXT" count="1" value="0x8061">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="REPLACE_EXT" value="0x8062"/>
- <enum name="PROXY_TEXTURE_1D_EXT" value="0x8063"/>
- <enum name="PROXY_TEXTURE_2D_EXT" value="0x8064"/>
- <enum name="TEXTURE_TOO_LARGE_EXT" value="0x8065"/>
-</category>
-
-<!-- Extension number 5 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture3D" number="6">
- <function name="TexImage3DEXT" alias="TexImage3D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-
- <function name="TexSubImage3DEXT" alias="TexSubImage3D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SGIS_texture_filter4" number="7">
- <function name="GetTexFilterFuncSGIS" offset="415">
- <param name="target" type="GLenum"/>
- <param name="filter" type="GLenum"/>
- <param name="weights" type="GLfloat *" output="true"/>
- <glx vendorpriv="4101" ignore="true"/>
- </function>
-
- <function name="TexFilterFuncSGIS" offset="416">
- <param name="target" type="GLenum"/>
- <param name="filter" type="GLenum"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="weights" type="const GLfloat *" count="n"/>
- <glx rop="2064" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 8 is not listed in the extension registry. -->
-
-<category name="GL_EXT_subtexture" number="9">
- <function name="TexSubImage1DEXT" alias="TexSubImage1D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-
- <function name="TexSubImage2DEXT" alias="TexSubImage2D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_EXT_copy_texture" number="10">
- <function name="CopyTexImage1DEXT" alias="CopyTexImage1D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- </function>
-
- <function name="CopyTexImage2DEXT" alias="CopyTexImage2D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- </function>
-
- <function name="CopyTexSubImage1DEXT" alias="CopyTexSubImage1D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-
- <function name="CopyTexSubImage2DEXT" alias="CopyTexSubImage2D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </function>
-
- <function name="CopyTexSubImage3DEXT" alias="CopyTexSubImage3D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </function>
-</category>
-
-<category name="GL_EXT_histogram" number="11">
- <enum name="HISTOGRAM_EXT" value="0x8024"/>
- <enum name="PROXY_HISTOGRAM_EXT" value="0x8025"/>
- <enum name="HISTOGRAM_WIDTH_EXT" count="1" value="0x8026">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_FORMAT_EXT" count="1" value="0x8027">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_RED_SIZE_EXT" count="1" value="0x8028">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_GREEN_SIZE_EXT" count="1" value="0x8029">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_BLUE_SIZE_EXT" count="1" value="0x802A">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_ALPHA_SIZE_EXT" count="1" value="0x802B">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_LUMINANCE_SIZE_EXT" count="1" value="0x802C">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_SINK_EXT" count="1" value="0x802D">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="MINMAX_EXT" value="0x802E"/>
- <enum name="MINMAX_FORMAT_EXT" count="1" value="0x802F">
- <size name="GetMinmaxParameterfvEXT" mode="get"/>
- <size name="GetMinmaxParameterivEXT" mode="get"/>
- </enum>
- <enum name="MINMAX_SINK_EXT" count="1" value="0x8030">
- <size name="GetMinmaxParameterfvEXT" mode="get"/>
- <size name="GetMinmaxParameterivEXT" mode="get"/>
- </enum>
- <enum name="TABLE_TOO_LARGE_EXT" value="0x8031"/>
-
- <function name="GetHistogramEXT" offset="417">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true"/>
- <glx vendorpriv="5" handcode="true" ignore="true"/>
- </function>
-
- <function name="GetHistogramParameterfvEXT" offset="418">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="6" ignore="true"/>
- </function>
-
- <function name="GetHistogramParameterivEXT" offset="419">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="7" ignore="true"/>
- </function>
-
- <function name="GetMinmaxEXT" offset="420">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true"/>
- <glx vendorpriv="8" handcode="true" ignore="true"/>
- </function>
-
- <function name="GetMinmaxParameterfvEXT" offset="421">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="9" ignore="true"/>
- </function>
-
- <function name="GetMinmaxParameterivEXT" offset="422">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="10" ignore="true"/>
- </function>
-
- <function name="HistogramEXT" alias="Histogram">
- <param name="target" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- </function>
-
- <function name="MinmaxEXT" alias="Minmax">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- </function>
-
- <function name="ResetHistogramEXT" alias="ResetHistogram">
- <param name="target" type="GLenum"/>
- </function>
-
- <function name="ResetMinmaxEXT" alias="ResetMinmax">
- <param name="target" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_convolution" number="12">
- <enum name="CONVOLUTION_BORDER_MODE_EXT" count="1" value="0x8013">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_SCALE_EXT" count="4" value="0x8014">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_BIAS_EXT" count="4" value="0x8015">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="REDUCE_EXT" value="0x8016"/>
- <enum name="CONVOLUTION_FORMAT_EXT" count="1" value="0x8017">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_WIDTH_EXT" count="1" value="0x8018">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_HEIGHT_EXT" count="1" value="0x8019">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_WIDTH_EXT" count="1" value="0x801A">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_HEIGHT_EXT" count="1" value="0x801B">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_SCALE_EXT" count="1" value="0x801C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_SCALE_EXT" count="1" value="0x801D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_SCALE_EXT" count="1" value="0x801E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_SCALE_EXT" count="1" value="0x801F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_BIAS_EXT" count="1" value="0x8020">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_BIAS_EXT" count="1" value="0x8021">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_BIAS_EXT" count="1" value="0x8022">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_BIAS_EXT" count="1" value="0x8023">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="ConvolutionFilter1DEXT" alias="ConvolutionFilter1D">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *"/>
- </function>
-
- <function name="ConvolutionFilter2DEXT" alias="ConvolutionFilter2D">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *"/>
- </function>
-
- <function name="ConvolutionParameterfEXT" alias="ConvolutionParameterf">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat"/>
- </function>
-
- <function name="ConvolutionParameterfvEXT" alias="ConvolutionParameterfv">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ConvolutionParameteriEXT" alias="ConvolutionParameteri">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint"/>
- </function>
-
- <function name="ConvolutionParameterivEXT" alias="ConvolutionParameteriv">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="CopyConvolutionFilter1DEXT" alias="CopyConvolutionFilter1D">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-
- <function name="CopyConvolutionFilter2DEXT" alias="CopyConvolutionFilter2D">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </function>
-
- <function name="GetConvolutionFilterEXT" offset="423">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="GLvoid *" output="true"/>
- <glx vendorpriv="1" handcode="true" ignore="true"/>
- </function>
-
- <function name="GetConvolutionParameterfvEXT" offset="424">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="2" ignore="true"/>
- </function>
-
- <function name="GetConvolutionParameterivEXT" offset="425">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="3" ignore="true"/>
- </function>
-
- <function name="GetSeparableFilterEXT" offset="426">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="GLvoid *" output="true"/>
- <param name="column" type="GLvoid *" output="true"/>
- <param name="span" type="GLvoid *" output="true"/>
- <glx vendorpriv="4" handcode="true" ignore="true"/>
- </function>
-
- <function name="SeparableFilter2DEXT" alias="SeparableFilter2D">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="const GLvoid *"/>
- <param name="column" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SGI_color_matrix" number="13">
- <enum name="COLOR_MATRIX_SGI" value="0x80B1"/>
- <enum name="COLOR_MATRIX_STACK_DEPTH_SGI" value="0x80B2"/>
- <enum name="MAX_COLOR_MATRIX_STACK_DEPTH_SGI" value="0x80B3"/>
- <enum name="POST_COLOR_MATRIX_RED_SCALE_SGI" value="0x80B4"/>
- <enum name="POST_COLOR_MATRIX_GREEN_SCALE_SGI" value="0x80B5"/>
- <enum name="POST_COLOR_MATRIX_BLUE_SCALE_SGI" value="0x80B6"/>
- <enum name="POST_COLOR_MATRIX_ALPHA_SCALE_SGI" value="0x80B7"/>
- <enum name="POST_COLOR_MATRIX_RED_BIAS_SGI" value="0x80B8"/>
- <enum name="POST_COLOR_MATRIX_GREEN_BIAS_SGI" value="0x80B9"/>
- <enum name="POST_COLOR_MATRIX_BLUE_BIAS_SGI" value="0x80BA"/>
- <enum name="POST_COLOR_MATRIX_ALPHA_BIAS_SGI" value="0x80BB"/>
-</category>
-
-<category name="GL_SGI_color_table" number="14">
- <function name="ColorTableSGI" alias="ColorTable">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="const GLvoid *"/>
- </function>
-
- <function name="ColorTableParameterfvSGI" alias="ColorTableParameterfv">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ColorTableParameterivSGI" alias="ColorTableParameteriv">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="CopyColorTableSGI" alias="CopyColorTable">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-
- <function name="GetColorTableSGI" offset="427">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="GLvoid *" output="true"/>
- <glx vendorpriv="4098" handcode="true" ignore="true"/>
- </function>
-
- <function name="GetColorTableParameterfvSGI" offset="428">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="4099" ignore="true"/>
- </function>
-
- <function name="GetColorTableParameterivSGI" offset="429">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="4100" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_pixel_texture" number="15">
- <function name="PixelTexGenParameteriSGIS" offset="431">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PixelTexGenParameterivSGIS" offset="432">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PixelTexGenParameterfSGIS" offset="433">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PixelTexGenParameterfvSGIS" offset="434">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetPixelTexGenParameterivSGIS" offset="435">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetPixelTexGenParameterfvSGIS" offset="436">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_texture4D" number="16">
- <function name="TexImage4DSGIS" offset="437">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="size4d" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_extent="size4d" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="2057" ignore="true"/>
- </function>
-
- <function name="TexSubImage4DSGIS" offset="438">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="woffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="size4d" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_extent="size4d" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_woff="woffset" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="2058" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGI_texture_color_table" number="17">
- <enum name="TEXTURE_COLOR_TABLE_SGI" value="0x80BC"/>
- <enum name="PROXY_TEXTURE_COLOR_TABLE_SGI" value="0x80BD"/>
-</category>
-
-<!-- Extension number 19 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_object" number="20">
- <function name="AreTexturesResidentEXT" offset="439">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <param name="residences" type="GLboolean *" output="true" count="n"/>
- <return type="GLboolean"/>
- <glx vendorpriv="11" always_array="true"/>
- </function>
-
- <function name="BindTextureEXT" alias="BindTexture">
- <param name="target" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- </function>
-
- <!-- For GLX, this is wrong. DeleteTexturesEXT and DeleteTextures
- do not have the same protocol!
- -->
- <function name="DeleteTexturesEXT" alias="DeleteTextures">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <glx vendorpriv="12"/>
- </function>
-
- <function name="GenTexturesEXT" offset="440">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="GLuint *" output="true" count="n"/>
- <glx vendorpriv="13" always_array="true"/>
- </function>
-
- <function name="IsTextureEXT" offset="441">
- <param name="texture" type="GLuint"/>
- <return type="GLboolean"/>
- <glx vendorpriv="14"/>
- </function>
-
- <function name="PrioritizeTexturesEXT" alias="PrioritizeTextures">
- <param name="n" type="GLsizei"/>
- <param name="textures" type="const GLuint *"/>
- <param name="priorities" type="const GLclampf *"/>
- </function>
-</category>
-
-<category name="GL_SGIS_detail_texture" number="21">
- <function name="DetailTexFuncSGIS" offset="442">
- <param name="target" type="GLenum"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="points" type="const GLfloat *" count="n"/>
- <glx rop="2051" ignore="true"/>
- </function>
-
- <function name="GetDetailTexFuncSGIS" offset="443">
- <param name="target" type="GLenum"/>
- <param name="points" type="GLfloat *" output="true"/>
- <glx vendorpriv="4096" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_sharpen_texture" number="22">
- <function name="SharpenTexFuncSGIS" offset="444">
- <param name="target" type="GLenum"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="points" type="const GLfloat *" count="n" count_scale="2"/>
- <glx rop="2052" ignore="true"/>
- </function>
-
- <function name="GetSharpenTexFuncSGIS" offset="445">
- <param name="target" type="GLenum"/>
- <param name="points" type="GLfloat *" output="true"/>
- <glx vendorpriv="4097" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_multisample" number="25">
- <function name="SampleMaskSGIS" offset="446">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- <glx rop="2048"/>
- </function>
-
- <function name="SamplePatternSGIS" offset="447">
- <param name="pattern" type="GLenum"/>
- <glx rop="2049"/>
- </function>
-</category>
-
-<!-- Extension number 26 is not listed in the extension registry. -->
-
-<category name="GL_EXT_rescale_normal" number="27">
- <enum name="RESCALE_NORMAL_EXT" count="1" value="0x803A">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 28 is a GLX extension. -->
-<!-- Extension number 29 is not listed in the extension registry. -->
-
-<category name="GL_EXT_vertex_array" number="30">
- <function name="ArrayElementEXT" alias="ArrayElement">
- <param name="i" type="GLint"/>
- </function>
-
- <function name="ColorPointerEXT" offset="448">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DrawArraysEXT" alias="DrawArrays">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- </function>
-
- <function name="EdgeFlagPointerEXT" offset="449">
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLboolean *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="GetPointervEXT" alias="GetPointerv">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- </function>
-
- <function name="IndexPointerEXT" offset="450">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="NormalPointerEXT" offset="451">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="TexCoordPointerEXT" offset="452">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexPointerEXT" offset="453">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_generate_mipmap" number="32">
- <enum name="GENERATE_MIPMAP_SGIS" count="1" value="0x8191">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="GENERATE_MIPMAP_HINT_SGIS" value="0x8192"/>
-</category>
-
-<category name="GL_SGIX_clipmap" number="33">
- <enum name="LINEAR_CLIPMAP_LINEAR_SGIX" value="0x8170"/>
- <enum name="TEXTURE_CLIPMAP_CENTER_SGIX" count="2" value="0x8171">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_FRAME_SGIX" count="1" value="0x8172">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_OFFSET_SGIX" count="2" value="0x8173">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX" count="3" value="0x8174">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_LOD_OFFSET_SGIX" value="0x8175"/>
- <enum name="TEXTURE_CLIPMAP_DEPTH_SGIX" value="0x8176"/>
- <enum name="MAX_CLIPMAP_DEPTH_SGIX" value="0x8177"/>
- <enum name="MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX" value="0x8178"/>
- <enum name="NEAREST_CLIPMAP_NEAREST_SGIX" value="0x844D"/>
- <enum name="NEAREST_CLIPMAP_LINEAR_SGIX" value="0x844E"/>
- <enum name="LINEAR_CLIPMAP_NEAREST_SGIX" value="0x844F"/>
-</category>
-
-<category name="GL_SGIX_shadow" number="34">
- <enum name="TEXTURE_COMPARE_SGIX" count="1" value="0x819A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_OPERATOR_SGIX" count="1" value="0x819B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LEQUAL_R_SGIX" value="0x819C"/>
- <enum name="TEXTURE_GEQUAL_R_SGIX" value="0x819D"/>
-</category>
-
-<category name="GL_SGIS_texture_edge_clamp" number="35">
- <enum name="CLAMP_TO_EDGE_SGIS" value="0x812F"/>
-</category>
-
-<category name="GL_SGIS_texture_border_clamp" number="36">
- <enum name="CLAMP_TO_BORDER_SGIS" value="0x812D"/>
-</category>
-
-<category name="GL_EXT_blend_minmax" number="37">
- <enum name="FUNC_ADD_EXT" value="0x8006"/>
- <enum name="MIN_EXT" value="0x8007"/>
- <enum name="MAX_EXT" value="0x8008"/>
- <enum name="BLEND_EQUATION_EXT" count="1" value="0x8009">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="BlendEquationEXT" alias="BlendEquation">
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_blend_subtract" number="38">
- <enum name="FUNC_SUBTRACT_EXT" value="0x800A"/>
- <enum name="FUNC_REVERSE_SUBTRACT_EXT" value="0x800B"/>
-
- <!-- <function name="BlendEquationEXT" alias="BlendEquation">
- <param name="mode" type="GLenum"/>
- </function> -->
-</category>
-
-<!-- Extension number 40 is a GLX extension. -->
-<!-- Extension number 41 is a GLX extension. -->
-<!-- Extension number 42 is a GLX extension. -->
-<!-- Extension number 43 is a GLX extension. -->
-<!-- Extension number 44 is a GLX extension. -->
-<!-- Extension number 46 is not listed in the extension registry. -->
-<!-- Extension number 47 is a GLX extension. -->
-<!-- Extension number 48 is not listed in the extension registry. -->
-<!-- Extension number 49 is a GLX extension. -->
-<!-- Extension number 50 is a GLX extension. -->
-
-<category name="GL_SGIX_sprite" number="52">
- <function name="SpriteParameterfSGIX" offset="454">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SpriteParameterfvSGIX" offset="455">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SpriteParameteriSGIX" offset="456">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SpriteParameterivSGIX" offset="457">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_point_parameters" number="54">
- <enum name="POINT_SIZE_MIN_EXT" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX_EXT" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_EXT" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_EXT" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
-
- <function name="PointParameterfEXT" offset="458">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="2065"/>
- </function>
-
- <function name="PointParameterfvEXT" offset="459">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="2066"/>
- </function>
-</category>
-
-<category name="GL_SGIX_instruments" number="55">
- <function name="GetInstrumentsSGIX" offset="460">
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="InstrumentsBufferSGIX" offset="461">
- <param name="size" type="GLsizei"/>
- <param name="buffer" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PollInstrumentsSGIX" offset="462">
- <param name="marker_p" type="GLint *" output="true"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ReadInstrumentsSGIX" offset="463">
- <param name="marker" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="StartInstrumentsSGIX" offset="464">
- <glx ignore="true"/>
- </function>
-
- <function name="StopInstrumentsSGIX" offset="465">
- <param name="marker" type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIX_texture_scale_bias" number="56">
- <enum name="POST_TEXTURE_FILTER_BIAS_SGIX" count="4" value="0x8179">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="POST_TEXTURE_FILTER_SCALE_SGIX" count="4" value="0x817A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="POST_TEXTURE_FILTER_BIAS_RANGE_SGIX" value="0x817B"/>
- <enum name="POST_TEXTURE_FILTER_SCALE_RANGE_SGIX" value="0x817C"/>
-</category>
-
-<category name="GL_SGIX_framezoom" number="57">
- <function name="FrameZoomSGIX" offset="466">
- <param name="factor" type="GLint"/>
- <glx rop="2072" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIX_tag_sample_buffer" number="58">
- <function name="TagSampleBufferSGIX" offset="467">
- <glx rop="2050" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 59 is not listed in the extension registry. -->
-
-<category name="GL_SGIX_reference_plane" number="60">
- <function name="ReferencePlaneSGIX" offset="468">
- <param name="equation" type="const GLdouble *" count="4"/>
- <glx rop="2071" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIX_flush_raster" number="61">
- <function name="FlushRasterSGIX" offset="469">
- <glx vendorpriv="4105" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 62 is a GLX extension. -->
-
-<category name="GL_SGIX_depth_texture" number="63">
- <enum name="DEPTH_COMPONENT16_SGIX" value="0x81A5"/>
- <enum name="DEPTH_COMPONENT24_SGIX" value="0x81A6"/>
- <enum name="DEPTH_COMPONENT32_SGIX" value="0x81A7"/>
-</category>
-
-<category name="GL_SGIS_fog_function" number="64">
- <function name="FogFuncSGIS" offset="?">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="points" type="const GLfloat *" count="n" count_scale="2"/>
- <glx rop="2067" ignore="true"/>
- </function>
-
- <function name="GetFogFuncSGIS" offset="?">
- <param name="points" type="GLfloat *" output="true"/>
- <!-- GLX protocol for this function is unknown. -->
- </function>
-</category>
-
-<category name="GL_SGIX_fog_offset" number="65">
- <enum name="FOG_OFFSET_SGIX" value="0x8198"/>
- <enum name="FOG_OFFSET_VALUE_SGIX" count="1" value="0x8199">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- </enum>
-</category>
-
-<category name="GL_HP_image_transform" number="66">
- <function name="ImageTransformParameteriHP" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
-
- <function name="ImageTransformParameterfHP" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="ImageTransformParameterivHP" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="ImageTransformParameterfvHP" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="GetImageTransformParameterivHP" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetImageTransformParameterfvHP" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- </function>
-</category>
-
-<category name="GL_HP_convolution_border_modes" number="67">
- <enum name="IGNORE_BORDER_HP" value="0x8150"/>
- <enum name="CONSTANT_BORDER_HP" value="0x8151"/>
- <enum name="REPLICATE_BORDER_HP" value="0x8153"/>
- <enum name="CONVOLUTION_BORDER_COLOR_HP" count="4" value="0x8154">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 68 is not listed in the extension registry. -->
-<!-- Extension number 70 is not listed in the extension registry. -->
-<!-- Extension number 71 is not listed in the extension registry. -->
-<!-- Extension number 72 is not listed in the extension registry. -->
-<!-- Extension number 73 is not listed in the extension registry. -->
-
-<category name="GL_EXT_color_subtable" number="74">
- <function name="ColorSubTableEXT" alias="ColorSubTable">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CopyColorSubTableEXT" alias="CopyColorSubTable">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-</category>
-
-<!-- Extension number 75 is a GLU extension. -->
-
-<category name="GL_PGI_misc_hints" number="77">
- <function name="HintPGI" offset="544">
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_paletted_texture" number="78">
- <enum name="COLOR_TABLE_FORMAT_EXT" count="1" value="0x80D8">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_WIDTH_EXT" count="1" value="0x80D9">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_RED_SIZE_EXT" count="1" value="0x80DA">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_GREEN_SIZE_EXT" count="1" value="0x80DB">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BLUE_SIZE_EXT" count="1" value="0x80DC">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_ALPHA_SIZE_EXT" count="1" value="0x80DD">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_LUMINANCE_SIZE_EXT" count="1" value="0x80DE">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_INTENSITY_SIZE_EXT" count="1" value="0x80DF">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_INDEX_SIZE_EXT" count="1" value="0x80ED">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
-
- <function name="ColorTableEXT" alias="ColorTable">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="const GLvoid *"/>
- </function>
-
- <function name="GetColorTableEXT" offset="550">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="data" type="GLvoid *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetColorTableParameterivEXT" offset="551">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetColorTableParameterfvEXT" offset="552">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_clip_volume_hint" number="79">
- <enum name="CLIP_VOLUME_CLIPPING_HINT_EXT" count="1" value="0x80F0">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_SGIX_list_priority" number="80">
- <function name="GetListParameterfvSGIX" offset="470">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetListParameterivSGIX" offset="471">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameterfSGIX" offset="472">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameterfvSGIX" offset="473">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameteriSGIX" offset="474">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameterivSGIX" offset="475">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 82 is not listed in the extension registry. -->
-<!-- Extension number 83 is a GLX extension. -->
-
-<category name="GL_SGIX_texture_lod_bias" number="84">
- <enum name="TEXTURE_LOD_BIAS_S_SGIX" count="1" value="0x818E">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LOD_BIAS_T_SGIX" count="1" value="0x818F">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LOD_BIAS_R_SGIX" count="1" value="0x8190">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 85 is a GLU extension. -->
-<!-- Extension number 86 is a GLX extension. -->
-<!-- Extension number 87 is not listed in the extension registry. -->
-<!-- Extension number 88 is not listed in the extension registry. -->
-<!-- Extension number 89 is not listed in the extension registry. -->
-
-
-<category name="GL_SGIX_shadow_ambient" number="90">
- <enum name="SHADOW_AMBIENT_SGIX" count="1" value="0x80BF">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 91 is a GLX extension. -->
-<!-- Extension number 92 is a GLX extension. -->
-
-<category name="GL_EXT_index_material" number="94">
- <function name="IndexMaterialEXT" offset="538">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_index_func" number="95">
- <function name="IndexFuncEXT" offset="539">
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLclampf"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_compiled_vertex_array" number="97">
- <function name="LockArraysEXT" offset="540">
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <glx handcode="true" ignore="true"/>
- </function>
-
- <function name="UnlockArraysEXT" offset="541">
- <glx handcode="true" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_cull_vertex" number="98">
- <enum name="CULL_VERTEX_EXT" value="0x81AA"/>
- <enum name="CULL_VERTEX_OBJECT_POSITION_EXT" count="4" value="0x81AB">
- <size name="CullParameterfv"/>
- <size name="CullParameterdv"/>
- </enum>
- <enum name="CULL_VERTEX_EYE_POSITION_EXT" count="4" value="0x81AC">
- <size name="CullParameterfv"/>
- <size name="CullParameterdv"/>
- </enum>
-
- <function name="CullParameterdvEXT" offset="542">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *"/> <!-- Spec bug. Should be const. -->
- <glx ignore="true"/>
- </function>
-
- <function name="CullParameterfvEXT" offset="543">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *"/> <!-- Spec bug. Should be const. -->
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 99 is not listed in the extension registry. -->
-<!-- Extension number 100 is a GLU extension. -->
-
-<!-- Shouldn't this be EXT_fragment_lighting? -->
-<category name="GL_SGIX_fragment_lighting" number="102">
- <function name="FragmentColorMaterialSGIX" offset="476">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightfSGIX" offset="477">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightfvSGIX" offset="478">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightiSGIX" offset="479">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightivSGIX" offset="480">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModelfSGIX" offset="481">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModelfvSGIX" offset="482">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModeliSGIX" offset="483">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModelivSGIX" offset="484">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialfSGIX" offset="485">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialfvSGIX" offset="486">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialiSGIX" offset="487">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialivSGIX" offset="488">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentLightfvSGIX" offset="489">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentLightivSGIX" offset="490">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentMaterialfvSGIX" offset="491">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentMaterialivSGIX" offset="492">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="LightEnviSGIX" offset="493">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 103 is not listed in the extension registry. -->
-<!-- Extension number 104 is not listed in the extension registry. -->
-<!-- Extension number 105 is not listed in the extension registry. -->
-<!-- Extension number 106 is not listed in the extension registry. -->
-<!-- Extension number 107 is not listed in the extension registry. -->
-<!-- Extension number 108 is not listed in the extension registry. -->
-<!-- Extension number 109 is not listed in the extension registry. -->
-
-<category name="GL_IBM_rasterpos_clip" number="110">
- <enum name="RASTER_POSITION_UNCLIPPED_IBM" count="1" value="0x19262">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_draw_range_elements" number="112">
- <function name="DrawRangeElementsEXT" alias="DrawRangeElements">
- <param name="mode" type="GLenum"/>
- <param name="start" type="GLuint"/>
- <param name="end" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<!-- Extension number 115 is a GLX extension. -->
-<!-- Extension number 116 is not listed in the extension registry. -->
-
-<category name="GL_EXT_light_texture" number="117">
- <function name="ApplyTextureEXT" offset="?">
- <param name="mode" type="GLenum"/>
- </function>
-
- <function name="TextureLightEXT" offset="?">
- <param name="pname" type="GLenum"/>
- </function>
-
- <function name="TextureMaterialEXT" offset="?">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<!-- Extension number 118 is not listed in the extension registry. -->
-<!-- Extension number 121 is not listed in the extension registry. -->
-<!-- Extension number 122 is not listed in the extension registry. -->
-<!-- Extension number 123 is not listed in the extension registry. -->
-<!-- Extension number 124 is not listed in the extension registry. -->
-<!-- Extension number 125 is not listed in the extension registry. -->
-<!-- Extension number 126 is not listed in the extension registry. -->
-<!-- Extension number 128 is not listed in the extension registry. -->
-<!-- Extension number 130 is not listed in the extension registry. -->
-<!-- Extension number 131 is not listed in the extension registry. -->
-
-<category name="GL_SGIX_async" number="132">
- <function name="AsyncMarkerSGIX" offset="?">
- <param name="marker" type="GLuint"/>
- </function>
-
- <function name="FinishAsyncSGIX" offset="?">
- <param name="markerp" type="GLuint *"/> <!-- Spec bug. Should be const. -->
- <return type="GLint"/>
- </function>
-
- <function name="PollAsyncSGIX" offset="?">
- <param name="markerp" type="GLuint *"/> <!-- Spec bug. Should be const. -->
- <return type="GLint"/>
- </function>
-
- <function name="GenAsyncMarkersSGIX" offset="?">
- <param name="range" type="GLsizei"/>
- <return type="GLuint"/>
- </function>
-
- <function name="DeleteAsyncMarkersSGIX" offset="?">
- <param name="marker" type="GLuint"/>
- <param name="range" type="GLsizei"/>
- </function>
-
- <function name="IsAsyncMarkerSGIX" offset="?">
- <param name="marker" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-</category>
-
-<category name="GL_INTEL_parallel_arrays" number="136">
- <function name="VertexPointervINTEL" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-
- <function name="NormalPointervINTEL" offset="?">
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-
- <function name="ColorPointervINTEL" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-
- <function name="TexCoordPointervINTEL" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-</category>
-
-<category name="GL_HP_occlusion_test" number="137">
- <enum name="OCCLUSION_TEST_HP" count="1" value="0x8165">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="OCCLUSION_TEST_RESULT_HP" count="1" value="0x8166">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_pixel_transform" number="138">
- <function name="PixelTransformParameteriEXT" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
-
- <function name="PixelTransformParameterfEXT" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="PixelTransformParameterivEXT" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="PixelTransformParameterfvEXT" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-</category>
-
-<!-- Extension number 140 is not listed in the extension registry. -->
-
-<category name="GL_EXT_shared_texture_palette" number="141">
- <enum name="SHARED_TEXTURE_PALETTE_EXT" count="1" value="0x81FB"/>
-</category>
-
-<!-- Extension number 142 is a GLX extension. -->
-<!-- Extension number 143 is not listed in the extension registry. -->
-
-<category name="GL_EXT_separate_specular_color" number="144">
- <enum name="LIGHT_MODEL_COLOR_CONTROL_EXT" count="1" value="0x81F8">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- </enum>
- <enum name="SINGLE_COLOR_EXT" value="0x81F9"/>
- <enum name="SEPARATE_SPECULAR_COLOR_EXT" value="0x81FA"/>
-</category>
-
-<category name="GL_EXT_secondary_color" number="145">
- <function name="SecondaryColor3bEXT" offset="561" vectorequiv="SecondaryColor3bvEXT">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- </function>
-
- <function name="SecondaryColor3bvEXT" offset="562">
- <param name="v" type="const GLbyte *" count="3"/>
- <glx rop="4126"/>
- </function>
-
- <function name="SecondaryColor3dEXT" offset="563" vectorequiv="SecondaryColor3dvEXT">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- </function>
-
- <function name="SecondaryColor3dvEXT" offset="564">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="4130"/>
- </function>
-
- <function name="SecondaryColor3fEXT" offset="565" vectorequiv="SecondaryColor3fvEXT">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- </function>
-
- <function name="SecondaryColor3fvEXT" offset="566">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="4129"/>
- </function>
-
- <function name="SecondaryColor3iEXT" offset="567" vectorequiv="SecondaryColor3ivEXT">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- </function>
-
- <function name="SecondaryColor3ivEXT" offset="568">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="4128"/>
- </function>
-
- <function name="SecondaryColor3sEXT" offset="569" vectorequiv="SecondaryColor3svEXT">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- </function>
-
- <function name="SecondaryColor3svEXT" offset="570">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="4127"/>
- </function>
-
- <function name="SecondaryColor3ubEXT" offset="571" vectorequiv="SecondaryColor3ubvEXT">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- </function>
-
- <function name="SecondaryColor3ubvEXT" offset="572">
- <param name="v" type="const GLubyte *" count="3"/>
- <glx rop="4131"/>
- </function>
-
- <function name="SecondaryColor3uiEXT" offset="573" vectorequiv="SecondaryColor3uivEXT">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- </function>
-
- <function name="SecondaryColor3uivEXT" offset="574">
- <param name="v" type="const GLuint *" count="3"/>
- <glx rop="4133"/>
- </function>
-
- <function name="SecondaryColor3usEXT" offset="575" vectorequiv="SecondaryColor3usvEXT">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- </function>
-
- <function name="SecondaryColor3usvEXT" offset="576">
- <param name="v" type="const GLushort *" count="3"/>
- <glx rop="4132"/>
- </function>
-
- <function name="SecondaryColorPointerEXT" offset="577">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture_perturb_normal" number="147">
- <function name="TextureNormalEXT" offset="?">
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_multi_draw_arrays" number="148">
- <function name="MultiDrawArraysEXT" offset="644">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint *"/> <!-- Spec bug. Should be const. -->
- <param name="count" type="GLsizei *"/> <!-- Spec bug. Should be const. -->
- <param name="primcount" type="GLsizei"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultiDrawElementsEXT" offset="645">
- <param name="mode" type="GLenum"/>
- <param name="count" type="const GLsizei *"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid **"/>
- <param name="primcount" type="GLsizei"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_fog_coord" number="149">
- <function name="FogCoordfEXT" offset="545" vectorequiv="FogCoordfvEXT">
- <param name="coord" type="GLfloat"/>
- </function>
-
- <function name="FogCoordfvEXT" offset="546">
- <param name="coord" type="const GLfloat *" count="1"/>
- <glx rop="4124"/>
- </function>
-
- <function name="FogCoorddEXT" offset="547" vectorequiv="FogCoorddvEXT">
- <param name="coord" type="GLdouble"/>
- </function>
-
- <function name="FogCoorddvEXT" offset="548">
- <param name="coord" type="const GLdouble *" count="1"/>
- <glx rop="4125"/>
- </function>
-
- <function name="FogCoordPointerEXT" offset="549">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<!-- Extension number 150 is not listed in the extension registry. -->
-<!-- Extension number 151 is not listed in the extension registry. -->
-<!-- Extension number 152 is not listed in the extension registry. -->
-<!-- Extension number 153 is not listed in the extension registry. -->
-<!-- Extension number 154 is not listed in the extension registry. -->
-
-<category name="GL_EXT_coordinate_frame" number="156">
- <function name="Tangent3bEXT" offset="?">
- <param name="tx" type="GLbyte"/>
- <param name="ty" type="GLbyte"/>
- <param name="tz" type="GLbyte"/>
- </function>
-
- <function name="Tangent3bvEXT" offset="?">
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="Tangent3dEXT" offset="?">
- <param name="tx" type="GLdouble"/>
- <param name="ty" type="GLdouble"/>
- <param name="tz" type="GLdouble"/>
- </function>
-
- <function name="Tangent3dvEXT" offset="?">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="Tangent3fEXT" offset="?">
- <param name="tx" type="GLfloat"/>
- <param name="ty" type="GLfloat"/>
- <param name="tz" type="GLfloat"/>
- </function>
-
- <function name="Tangent3fvEXT" offset="?">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Tangent3iEXT" offset="?">
- <param name="tx" type="GLint"/>
- <param name="ty" type="GLint"/>
- <param name="tz" type="GLint"/>
- </function>
-
- <function name="Tangent3ivEXT" offset="?">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="Tangent3sEXT" offset="?">
- <param name="tx" type="GLshort"/>
- <param name="ty" type="GLshort"/>
- <param name="tz" type="GLshort"/>
- </function>
-
- <function name="Tangent3svEXT" offset="?">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="Binormal3bEXT" offset="?">
- <param name="bx" type="GLbyte"/>
- <param name="by" type="GLbyte"/>
- <param name="bz" type="GLbyte"/>
- </function>
-
- <function name="Binormal3bvEXT" offset="?">
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="Binormal3dEXT" offset="?">
- <param name="bx" type="GLdouble"/>
- <param name="by" type="GLdouble"/>
- <param name="bz" type="GLdouble"/>
- </function>
-
- <function name="Binormal3dvEXT" offset="?">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="Binormal3fEXT" offset="?">
- <param name="bx" type="GLfloat"/>
- <param name="by" type="GLfloat"/>
- <param name="bz" type="GLfloat"/>
- </function>
-
- <function name="Binormal3fvEXT" offset="?">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Binormal3iEXT" offset="?">
- <param name="bx" type="GLint"/>
- <param name="by" type="GLint"/>
- <param name="bz" type="GLint"/>
- </function>
-
- <function name="Binormal3ivEXT" offset="?">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="Binormal3sEXT" offset="?">
- <param name="bx" type="GLshort"/>
- <param name="by" type="GLshort"/>
- <param name="bz" type="GLshort"/>
- </function>
-
- <function name="Binormal3svEXT" offset="?">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="TangentPointerEXT" offset="?">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="BinormalPointerEXT" offset="?">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-</category>
-
-<!-- Extension number 157 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_env_combine" number="158">
- <enum name="COMBINE_EXT" value="0x8570"/>
- <enum name="COMBINE_RGB_EXT" count="1" value="0x8571"/>
- <enum name="COMBINE_ALPHA_EXT" count="1" value="0x8572"/>
- <enum name="RGB_SCALE_EXT" count="1" value="0x8573"/>
- <enum name="ADD_SIGNED_EXT" value="0x8574"/>
- <enum name="INTERPOLATE_EXT" value="0x8575"/>
- <enum name="CONSTANT_EXT" value="0x8576"/>
- <enum name="PRIMARY_COLOR_EXT" value="0x8577"/>
- <enum name="PREVIOUS_EXT" value="0x8578"/>
- <enum name="SOURCE0_RGB_EXT" count="1" value="0x8580"/>
- <enum name="SOURCE1_RGB_EXT" count="1" value="0x8581"/>
- <enum name="SOURCE2_RGB_EXT" count="1" value="0x8582"/>
- <enum name="SOURCE0_ALPHA_EXT" count="1" value="0x8588"/>
- <enum name="SOURCE1_ALPHA_EXT" count="1" value="0x8589"/>
- <enum name="SOURCE2_ALPHA_EXT" count="1" value="0x858A"/>
- <enum name="OPERAND0_RGB_EXT" count="1" value="0x8590"/>
- <enum name="OPERAND1_RGB_EXT" count="1" value="0x8591"/>
- <enum name="OPERAND2_RGB_EXT" count="1" value="0x8592"/>
- <enum name="OPERAND0_ALPHA_EXT" count="1" value="0x8598"/>
- <enum name="OPERAND1_ALPHA_EXT" count="1" value="0x8599"/>
- <enum name="OPERAND2_ALPHA_EXT" count="1" value="0x859A"/>
-</category>
-
-<category name="GL_SGIX_pixel_texture" number="160">
- <function name="PixelTexGenSGIX" offset="430">
- <param name="mode" type="GLenum"/>
- <glx rop="2059" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 161 is not listed in the extension registry. -->
-<!-- Extension number 162 is not listed in the extension registry. -->
-
-<category name="GL_SUNX_constant_data" number="163">
- <function name="FinishTextureSUNX" offset="?">
- </function>
-</category>
-
-<category name="GL_SUN_global_alpha" number="164">
- <function name="GlobalAlphaFactorbSUN" offset="?">
- <param name="factor" type="GLbyte"/>
- </function>
-
- <function name="GlobalAlphaFactorsSUN" offset="?">
- <param name="factor" type="GLshort"/>
- </function>
-
- <function name="GlobalAlphaFactoriSUN" offset="?">
- <param name="factor" type="GLint"/>
- </function>
-
- <function name="GlobalAlphaFactorfSUN" offset="?">
- <param name="factor" type="GLfloat"/>
- </function>
-
- <function name="GlobalAlphaFactordSUN" offset="?">
- <param name="factor" type="GLdouble"/>
- </function>
-
- <function name="GlobalAlphaFactorubSUN" offset="?">
- <param name="factor" type="GLubyte"/>
- </function>
-
- <function name="GlobalAlphaFactorusSUN" offset="?">
- <param name="factor" type="GLushort"/>
- </function>
-
- <function name="GlobalAlphaFactoruiSUN" offset="?">
- <param name="factor" type="GLuint"/>
- </function>
-</category>
-
-<category name="GL_SUN_triangle_list" number="165">
- <function name="ReplacementCodeuiSUN" offset="?">
- <param name="code" type="GLuint"/>
- </function>
-
- <function name="ReplacementCodeusSUN" offset="?">
- <param name="code" type="GLushort"/>
- </function>
-
- <function name="ReplacementCodeubSUN" offset="?">
- <param name="code" type="GLubyte"/>
- </function>
-
- <function name="ReplacementCodeuivSUN" offset="?">
- <param name="code" type="const GLuint *"/>
- </function>
-
- <function name="ReplacementCodeusvSUN" offset="?">
- <param name="code" type="const GLushort *"/>
- </function>
-
- <function name="ReplacementCodeubvSUN" offset="?">
- <param name="code" type="const GLubyte *"/>
- </function>
-
- <function name="ReplacementCodePointerSUN" offset="?">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SUN_vertex" number="166">
- <function name="Color4ubVertex2fSUN" offset="?">
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="Color4ubVertex2fvSUN" offset="?">
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Color4ubVertex3fSUN" offset="?">
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Color4ubVertex3fvSUN" offset="?">
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Color3fVertex3fSUN" offset="?">
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Color3fVertex3fvSUN" offset="?">
- <param name="c" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Normal3fVertex3fSUN" offset="?">
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Normal3fVertex3fvSUN" offset="?">
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Color4fNormal3fVertex3fSUN" offset="?">
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Color4fNormal3fVertex3fvSUN" offset="?">
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fVertex3fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fVertex3fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord4fVertex4fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="p" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="TexCoord4fVertex4fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fColor4ubVertex3fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fColor4ubVertex3fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fColor3fVertex3fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fColor3fVertex3fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fNormal3fVertex3fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fNormal3fVertex3fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fColor4fNormal3fVertex3fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fColor4fNormal3fVertex3fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord4fColor4fNormal3fVertex4fSUN" offset="?">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="p" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="TexCoord4fColor4fNormal3fVertex4fvSUN" offset="?">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiColor4ubVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiColor4ubVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiColor3fVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiColor3fVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiNormal3fVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiNormal3fVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiColor4fNormal3fVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiColor4fNormal3fVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="tc" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="tc" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN" offset="?">
- <param name="rc" type="GLuint"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN" offset="?">
- <param name="rc" type="const GLuint *"/>
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-</category>
-
-<!-- Extension number 167 is a WGL extension. -->
-<!-- Extension number 168 is a WGL extension. -->
-<!-- Extension number 169 is a WGL extension. -->
-<!-- Extension number 170 is a WGL extension. -->
-<!-- Extension number 171 is a WGL extension. -->
-<!-- Extension number 172 is a WGL extension. -->
-
-<category name="GL_EXT_blend_func_separate" number="173">
- <function name="BlendFuncSeparateEXT" offset="537">
- <param name="sfactorRGB" type="GLenum"/>
- <param name="dfactorRGB" type="GLenum"/>
- <param name="sfactorAlpha" type="GLenum"/>
- <param name="dfactorAlpha" type="GLenum"/>
- <glx rop="4134"/>
- </function>
-</category>
-
-<category name="GL_EXT_stencil_wrap" number="176">
- <enum name="INCR_WRAP_EXT" value="0x8507"/>
- <enum name="DECR_WRAP_EXT" value="0x8508"/>
-</category>
-
-<!-- Extension number 177 is a WGL extension. -->
-
-<category name="GL_NV_texgen_reflection" number="179">
- <enum name="NORMAL_MAP_NV" value="0x8511"/>
- <enum name="REFLECTION_MAP_NV" value="0x8512"/>
-</category>
-
-<!-- Extension number 180 is not listed in the extension registry. -->
-
-<category name="GL_SUN_convolution_border_modes" number="182">
- <enum name="WRAP_BORDER_SUN" value="0x81D4"/>
-</category>
-
-<!-- Extension number 183 is a GLX extension. -->
-<!-- Extension number 184 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_env_add" number="185">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_EXT_texture_lod_bias" number="186">
- <enum name="TEXTURE_LOD_BIAS_EXT" count="1" value="0x8501">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_texture_filter_anisotropic" number="187">
- <enum name="TEXTURE_MAX_ANISOTROPY_EXT" count="1" value="0x84FE">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FF"/>
-</category>
-
-<category name="GL_EXT_vertex_weighting" number="188">
- <function name="VertexWeightfEXT" offset="494" vectorequiv="VertexWeightfvEXT">
- <param name="weight" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="VertexWeightfvEXT" offset="495">
- <param name="weight" type="const GLfloat *" count="1"/>
- <glx rop="4135" ignore="true"/>
- </function>
-
- <function name="VertexWeightPointerEXT" offset="496">
- <param name="size" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_NV_light_max_exponent" number="189">
- <enum name="MAX_SHININESS_NV" count="1" value="0x8504">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_SPOT_EXPONENT_NV" count="1" value="0x8505">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_array_range" number="190">
- <function name="FlushVertexArrayRangeNV" offset="497">
- <glx ignore="true"/>
- </function>
-
- <function name="VertexArrayRangeNV" offset="498">
- <param name="length" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_NV_register_combiners" number="191">
- <function name="CombinerParameterfvNV" offset="499">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="4137" ignore="true"/>
- </function>
-
- <function name="CombinerParameterfNV" offset="500">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="4136" ignore="true"/>
- </function>
-
- <function name="CombinerParameterivNV" offset="501">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="4139" ignore="true"/>
- </function>
-
- <function name="CombinerParameteriNV" offset="502">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="4138" ignore="true"/>
- </function>
-
- <function name="CombinerInputNV" offset="503">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="variable" type="GLenum"/>
- <param name="input" type="GLenum"/>
- <param name="mapping" type="GLenum"/>
- <param name="componentUsage" type="GLenum"/>
- <glx rop="4140" ignore="true"/>
- </function>
-
- <function name="CombinerOutputNV" offset="504">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="abOutput" type="GLenum"/>
- <param name="cdOutput" type="GLenum"/>
- <param name="sumOutput" type="GLenum"/>
- <param name="scale" type="GLenum"/>
- <param name="bias" type="GLenum"/>
- <param name="abDotProduct" type="GLboolean"/>
- <param name="cdDotProduct" type="GLboolean"/>
- <param name="muxSum" type="GLboolean"/>
- <glx rop="4141" ignore="true"/>
- </function>
-
- <function name="FinalCombinerInputNV" offset="505">
- <param name="variable" type="GLenum"/>
- <param name="input" type="GLenum"/>
- <param name="mapping" type="GLenum"/>
- <param name="componentUsage" type="GLenum"/>
- <glx rop="4142" ignore="true"/>
- </function>
-
- <function name="GetCombinerInputParameterfvNV" offset="506">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx vendorpriv="1270" ignore="true"/>
- </function>
-
- <function name="GetCombinerInputParameterivNV" offset="507">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1271" ignore="true"/>
- </function>
-
- <function name="GetCombinerOutputParameterfvNV" offset="508">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx vendorpriv="1272" ignore="true"/>
- </function>
-
- <function name="GetCombinerOutputParameterivNV" offset="509">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1273" ignore="true"/>
- </function>
-
- <function name="GetFinalCombinerInputParameterfvNV" offset="510">
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx vendorpriv="1274" ignore="true"/>
- </function>
-
- <function name="GetFinalCombinerInputParameterivNV" offset="511">
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1275" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_NV_fog_distance" number="192">
- <enum name="FOG_DISTANCE_MODE_NV" count="1" value="0x855A">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EYE_RADIAL_NV" value="0x855B"/>
- <enum name="EYE_PLANE_ABSOLUTE_NV" value="0x855C"/>
-</category>
-
-<category name="GL_NV_blend_square" number="194">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_NV_texture_env_combine4" number="195">
- <enum name="COMBINE4" value="0x8503"/>
- <enum name="SOURCE3_RGB_NV" count="1" value="0x8583">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE3_ALPHA_NV" count="1" value="0x858B">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND3_RGB_NV" count="1" value="0x8593">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND3_ALPHA_NV" count="1" value="0x859B">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_MESA_resize_buffers" number="196">
- <function name="ResizeBuffersMESA" offset="512">
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_MESA_window_pos" number="197">
- <function name="WindowPos2dMESA" offset="513">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2dvMESA" offset="514">
- <param name="v" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2fMESA" offset="515">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2fvMESA" offset="516">
- <param name="v" type="const GLfloat *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2iMESA" offset="517">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2ivMESA" offset="518">
- <param name="v" type="const GLint *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2sMESA" offset="519">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2svMESA" offset="520">
- <param name="v" type="const GLshort *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3dMESA" offset="521">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3dvMESA" offset="522">
- <param name="v" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3fMESA" offset="523" vectorequiv="WindowPos3fvMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="WindowPos3fvMESA" offset="524">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="230"/>
- </function>
-
- <function name="WindowPos3iMESA" offset="525">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3ivMESA" offset="526">
- <param name="v" type="const GLint *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3sMESA" offset="527">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3svMESA" offset="528">
- <param name="v" type="const GLshort *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos4dMESA" offset="529">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4dvMESA" offset="530">
- <param name="v" type="const GLdouble *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4fMESA" offset="531">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4fvMESA" offset="532">
- <param name="v" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4iMESA" offset="533">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4ivMESA" offset="534">
- <param name="v" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4sMESA" offset="535">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4svMESA" offset="536">
- <param name="v" type="const GLshort *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture_compression_s3tc" number="198">
- <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT3_EXT" value="0x83F2"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT5_EXT" value="0x83F3"/>
-</category>
-
-<category name="GL_IBM_multimode_draw_arrays" number="200">
- <function name="MultiModeDrawArraysIBM" offset="708">
- <param name="mode" type="const GLenum *"/>
- <param name="first" type="const GLint *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="primcount" type="GLsizei"/>
- <param name="modestride" type="GLint"/>
- <glx handcode="true" ignore="true"/>
- </function>
-
- <function name="MultiModeDrawElementsIBM" offset="709">
- <param name="mode" type="const GLenum *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid * const *"/>
- <param name="primcount" type="GLsizei"/>
- <param name="modestride" type="GLint"/>
- <glx handcode="true" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_IBM_vertex_array_lists" number="201">
- <function name="ColorPointerListIBM" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="SecondaryColorPointerListIBM" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="EdgeFlagPointerListIBM" offset="?">
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLboolean **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="FogCoordPointerListIBM" offset="?">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="IndexPointerListIBM" offset="?">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="NormalPointerListIBM" offset="?">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="TexCoordPointerListIBM" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="VertexPointerListIBM" offset="?">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-</category>
-
-<!-- Extension number 202 is not listed in the extension registry. -->
-<!-- Extension number 203 is not listed in the extension registry. -->
-<!-- Extension number 204 is not listed in the extension registry. -->
-<!-- Extension number 205 is not listed in the extension registry. -->
-
-<category name="GL_3DFX_texture_compression_FXT1" number="206">
- <enum name="COMPRESSED_RGB_FXT1_3DFX" value="0x86B0"/>
- <enum name="COMPRESSED_RGBA_FXT1_3DFX" value="0x86B1"/>
-</category>
-
-<category name="GL_3DFX_multisample" number="207">
- <enum name="MULTISAMPLE_3DFX" value="0x86B2"/>
- <enum name="SAMPLE_BUFFERS_3DFX" value="0x86B3"/>
- <enum name="SAMPLES_3DFX" value="0x86B4"/>
- <enum name="MULTISAMPLE_BIT_3DFX" value="0x20000000"/>
-</category>
-
-<category name="GL_3DFX_tbuffer" number="208">
- <function name="TbufferMask3DFX" offset="553">
- <param name="mask" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_multisample" number="209">
- <function name="SampleMaskEXT" alias="SampleMaskSGIS">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- </function>
-
- <function name="SamplePatternEXT" alias="SamplePatternSGIS">
- <param name="pattern" type="GLenum"/>
- </function>
-</category>
-
-<!-- Extension number 211 is not listed in the extension registry. -->
-<!-- Extension number 213 is not listed in the extension registry. -->
-
-<category name="GL_SGIS_texture_color_mask" number="214">
- <enum name="TEXTURE_COLOR_WRITEMASK_SGIS" value="0x81EF"/>
-
- <function name="TextureColorMaskSGIS" offset="?">
- <param name="red" type="GLboolean"/>
- <param name="green" type="GLboolean"/>
- <param name="blue" type="GLboolean"/>
- <param name="alpha" type="GLboolean"/>
- <glx rop="2082" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 215 is a GLX extension. -->
-<!-- Extension number 216 is a GLX extension. -->
-<!-- Extension number 217 is a GLX extension. -->
-<!-- Extension number 218 is a GLX extension. -->
-<!-- Extension number 219 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_env_dot3" number="220">
- <enum name="DOT3_RGB_EXT" value="0x8740"/>
- <enum name="DOT3_RGBA_EXT" value="0x8741"/>
-</category>
-
-<category name="GL_ATI_texture_mirror_once" number="221">
- <enum name="MIRROR_CLAMP_ATI" value="0x8742"/>
- <enum name="MIRROR_CLAMP_TO_EDGE_ATI" value="0x8743"/>
-</category>
-
-<category name="GL_NV_fence" number="222">
- <function name="DeleteFencesNV" offset="647">
- <param name="n" type="GLsizei"/>
- <param name="fences" type="const GLuint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GenFencesNV" offset="648">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="fences" type="GLuint *" output="true" count="n"/>
- <glx ignore="true"/>
- </function>
-
- <function name="IsFenceNV" offset="649">
- <param name="fence" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="TestFenceNV" offset="650">
- <param name="fence" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFenceivNV" offset="651">
- <param name="fence" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FinishFenceNV" offset="652">
- <param name="fence" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SetFenceNV" offset="653">
- <param name="fence" type="GLuint"/>
- <param name="condition" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_IBM_texture_mirrored_repeat" number="224">
- <enum name="MIRRORED_REPEAT_IBM" value="0x8370"/>
-</category>
-
-<category name="GL_NV_evaluators" number="225">
- <function name="MapControlPointsNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="type" type="GLenum"/>
- <param name="ustride" type="GLsizei"/>
- <param name="vstride" type="GLsizei"/>
- <param name="uorder" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="packed" type="GLboolean"/>
- <param name="points" type="const GLvoid *"/>
- </function>
-
- <function name="MapParameterivNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="MapParameterfvNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="GetMapControlPointsNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="type" type="GLenum"/>
- <param name="ustride" type="GLsizei"/>
- <param name="vstride" type="GLsizei"/>
- <param name="packed" type="GLboolean"/>
- <param name="points" type="GLvoid *" output="true"/>
- </function>
-
- <function name="GetMapParameterivNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- </function>
-
- <function name="GetMapParameterfvNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- </function>
-
- <function name="GetMapAttribParameterivNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- </function>
-
- <function name="GetMapAttribParameterfvNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- </function>
-
- <function name="EvalMapsNV" offset="?">
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_NV_packed_depth_stencil" number="226">
- <enum name="DEPTH_STENCIL_NV" value="0x84F9"/>
- <enum name="UNSIGNED_INT_24_8_NV" value="0x84FA"/>
-</category>
-
-<category name="GL_NV_register_combiners2" number="227">
- <function name="CombinerStageParameterfvNV" offset="?">
- <param name="stage" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="GetCombinerStageParameterfvNV" offset="?">
- <param name="stage" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- </function>
-</category>
-
-<category name="GL_NV_texture_compression_vtc" number="228">
- <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT3_EXT" value="0x83F2"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT5_EXT" value="0x83F3"/>
-</category>
-
-<category name="GL_NV_texture_rectangle" number="229">
- <enum name="TEXTURE_RECTANGLE_NV" count="1" value="0x84F5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_RECTANGLE_NV" count="1" value="0x84F6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_RECTANGLE_NV" value="0x84F7"/>
- <enum name="MAX_RECTANGLE_TEXTURE_SIZE_NV" count="1" value="0x84F8">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_program" number="233">
- <enum name="VERTEX_PROGRAM_NV" value="0x8620"/>
- <enum name="VERTEX_STATE_PROGRAM_NV" value="0x8621"/>
- <enum name="ATTRIB_ARRAY_SIZE_NV" count="1" value="0x8623">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="ATTRIB_ARRAY_STRIDE_NV" count="1" value="0x8624">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="ATTRIB_ARRAY_TYPE_NV" count="1" value="0x8625">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="CURRENT_ATTRIB_NV" count="1" value="0x8626">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="PROGRAM_LENGTH_NV" count="1" value="0x8627">
- <size name="GetProgramivNV" mode="get"/>
- </enum>
- <enum name="PROGRAM_STRING_NV" value="0x8628"/>
- <enum name="MODELVIEW_PROJECTION_NV" value="0x8629"/>
- <enum name="IDENTITY_NV" value="0x862A"/>
- <enum name="INVERSE_NV" value="0x862B"/>
- <enum name="TRANSPOSE_NV" value="0x862C"/>
- <enum name="INVERSE_TRANSPOSE_NV" value="0x862D"/>
- <enum name="MAX_TRACK_MATRIX_STACK_DEPTH_NV" value="0x862E"/>
- <enum name="MAX_TRACK_MATRICES_NV" value="0x862F"/>
- <enum name="MATRIX0_NV" value="0x8630"/>
- <enum name="MATRIX1_NV" value="0x8631"/>
- <enum name="MATRIX2_NV" value="0x8632"/>
- <enum name="MATRIX3_NV" value="0x8633"/>
- <enum name="MATRIX4_NV" value="0x8634"/>
- <enum name="MATRIX5_NV" value="0x8635"/>
- <enum name="MATRIX6_NV" value="0x8636"/>
- <enum name="MATRIX7_NV" value="0x8637"/>
- <enum name="CURRENT_MATRIX_STACK_DEPTH_NV" value="0x8640"/>
- <enum name="CURRENT_MATRIX_NV" value="0x8641"/>
- <enum name="VERTEX_PROGRAM_POINT_SIZE_NV" value="0x8642"/>
- <enum name="VERTEX_PROGRAM_TWO_SIDE_NV" value="0x8643"/>
- <enum name="PROGRAM_PARAMETER_NV" value="0x8644"/>
- <enum name="ATTRIB_ARRAY_POINTER_NV" value="0x8645"/>
- <enum name="PROGRAM_TARGET_NV" count="1" value="0x8646">
- <size name="GetProgramivNV" mode="get"/>
- </enum>
- <enum name="PROGRAM_RESIDENT_NV" count="1" value="0x8647">
- <size name="GetProgramivNV" mode="get"/>
- </enum>
- <enum name="TRACK_MATRIX_NV" value="0x8648"/>
- <enum name="TRACK_MATRIX_TRANSFORM_NV" value="0x8649"/>
- <enum name="VERTEX_PROGRAM_BINDING_NV" value="0x864A"/>
- <enum name="PROGRAM_ERROR_POSITION_NV" value="0x864B"/>
- <enum name="VERTEX_ATTRIB_ARRAY0_NV" value="0x8650"/>
- <enum name="VERTEX_ATTRIB_ARRAY1_NV" value="0x8651"/>
- <enum name="VERTEX_ATTRIB_ARRAY2_NV" value="0x8652"/>
- <enum name="VERTEX_ATTRIB_ARRAY3_NV" value="0x8653"/>
- <enum name="VERTEX_ATTRIB_ARRAY4_NV" value="0x8654"/>
- <enum name="VERTEX_ATTRIB_ARRAY5_NV" value="0x8655"/>
- <enum name="VERTEX_ATTRIB_ARRAY6_NV" value="0x8656"/>
- <enum name="VERTEX_ATTRIB_ARRAY7_NV" value="0x8657"/>
- <enum name="VERTEX_ATTRIB_ARRAY8_NV" value="0x8658"/>
- <enum name="VERTEX_ATTRIB_ARRAY9_NV" value="0x8659"/>
- <enum name="VERTEX_ATTRIB_ARRAY10_NV" value="0x865A"/>
- <enum name="VERTEX_ATTRIB_ARRAY11_NV" value="0x865B"/>
- <enum name="VERTEX_ATTRIB_ARRAY12_NV" value="0x865C"/>
- <enum name="VERTEX_ATTRIB_ARRAY13_NV" value="0x865D"/>
- <enum name="VERTEX_ATTRIB_ARRAY14_NV" value="0x865E"/>
- <enum name="VERTEX_ATTRIB_ARRAY15_NV" value="0x865F"/>
- <enum name="MAP1_VERTEX_ATTRIB0_4_NV" value="0x8660"/>
- <enum name="MAP1_VERTEX_ATTRIB1_4_NV" value="0x8661"/>
- <enum name="MAP1_VERTEX_ATTRIB2_4_NV" value="0x8662"/>
- <enum name="MAP1_VERTEX_ATTRIB3_4_NV" value="0x8663"/>
- <enum name="MAP1_VERTEX_ATTRIB4_4_NV" value="0x8664"/>
- <enum name="MAP1_VERTEX_ATTRIB5_4_NV" value="0x8665"/>
- <enum name="MAP1_VERTEX_ATTRIB6_4_NV" value="0x8666"/>
- <enum name="MAP1_VERTEX_ATTRIB7_4_NV" value="0x8667"/>
- <enum name="MAP1_VERTEX_ATTRIB8_4_NV" value="0x8668"/>
- <enum name="MAP1_VERTEX_ATTRIB9_4_NV" value="0x8669"/>
- <enum name="MAP1_VERTEX_ATTRIB10_4_NV" value="0x866A"/>
- <enum name="MAP1_VERTEX_ATTRIB11_4_NV" value="0x866B"/>
- <enum name="MAP1_VERTEX_ATTRIB12_4_NV" value="0x866C"/>
- <enum name="MAP1_VERTEX_ATTRIB13_4_NV" value="0x866D"/>
- <enum name="MAP1_VERTEX_ATTRIB14_4_NV" value="0x866E"/>
- <enum name="MAP1_VERTEX_ATTRIB15_4_NV" value="0x866F"/>
- <enum name="MAP2_VERTEX_ATTRIB0_4_NV" value="0x8670"/>
- <enum name="MAP2_VERTEX_ATTRIB1_4_NV" value="0x8671"/>
- <enum name="MAP2_VERTEX_ATTRIB2_4_NV" value="0x8672"/>
- <enum name="MAP2_VERTEX_ATTRIB3_4_NV" value="0x8673"/>
- <enum name="MAP2_VERTEX_ATTRIB4_4_NV" value="0x8674"/>
- <enum name="MAP2_VERTEX_ATTRIB5_4_NV" value="0x8675"/>
- <enum name="MAP2_VERTEX_ATTRIB6_4_NV" value="0x8676"/>
- <enum name="MAP2_VERTEX_ATTRIB7_4_NV" value="0x8677"/>
- <enum name="MAP2_VERTEX_ATTRIB8_4_NV" value="0x8678"/>
- <enum name="MAP2_VERTEX_ATTRIB9_4_NV" value="0x8679"/>
- <enum name="MAP2_VERTEX_ATTRIB10_4_NV" value="0x867A"/>
- <enum name="MAP2_VERTEX_ATTRIB11_4_NV" value="0x867B"/>
- <enum name="MAP2_VERTEX_ATTRIB12_4_NV" value="0x867C"/>
- <enum name="MAP2_VERTEX_ATTRIB13_4_NV" value="0x867D"/>
- <enum name="MAP2_VERTEX_ATTRIB14_4_NV" value="0x867E"/>
- <enum name="MAP2_VERTEX_ATTRIB15_4_NV" value="0x867F"/>
-
- <function name="AreProgramsResidentNV" offset="578">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="const GLuint *" count="n"/>
- <param name="residences" type="GLboolean *" output="true" count="n"/>
- <return type="GLboolean"/>
- <glx vendorpriv="1293"/>
- </function>
-
- <function name="BindProgramNV" offset="579">
- <param name="target" type="GLenum"/>
- <param name="program" type="GLuint"/>
- <glx rop="4180"/>
- </function>
-
- <function name="DeleteProgramsNV" offset="580">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="programs" type="const GLuint *" count="n"/>
- <glx vendorpriv="1294"/>
- </function>
-
- <function name="ExecuteProgramNV" offset="581">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4181"/>
- </function>
-
- <function name="GenProgramsNV" offset="582">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="programs" type="GLuint *" output="true" count="n"/>
- <glx vendorpriv="1295"/>
- </function>
-
- <!-- This isn't 100% correct. Currently, the only valid value of pname
- is GL_PROGRAM_PARAMETER_NV, and the count for that pname is always
- 4. This is why the pname parameter was removed in the ARB version
- of these functions.
- -->
-
- <function name="GetProgramParameterdvNV" offset="583">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1297"/>
- </function>
-
- <function name="GetProgramParameterfvNV" offset="584">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1296"/>
- </function>
-
- <function name="GetProgramivNV" offset="585">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="1298"/>
- </function>
-
- <function name="GetProgramStringNV" offset="586">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="program" type="GLubyte *" output="true"/>
- <glx vendorpriv="1299" handcode="server" always_array="true"/>
- </function>
-
- <function name="GetTrackMatrixivNV" offset="587">
- <param name="target" type="GLenum"/>
- <param name="address" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" count="1"/>
- <glx vendorpriv="1300"/>
- </function>
-
- <function name="GetVertexAttribdvNV" offset="753">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx vendorpriv="1301"/>
- </function>
-
- <function name="GetVertexAttribfvNV" offset="754">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="1302"/>
- </function>
-
- <function name="GetVertexAttribivNV" offset="755">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="1303"/>
- </function>
-
- <function name="GetVertexAttribPointervNV" offset="591">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- <glx handcode="true"/>
- </function>
-
- <function name="IsProgramNV" offset="592">
- <param name="program" type="GLuint"/>
- <return type="GLboolean"/>
- <glx vendorpriv="1304"/>
- </function>
-
- <function name="LoadProgramNV" offset="593">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="program" type="const GLubyte *" count="len"/>
- <glx rop="4183"/>
- </function>
-
- <function name="ProgramParameter4dNV" offset="594" vectorequiv="ProgramParameter4dvNV">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramParameter4dvNV" offset="595">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLdouble *" count="4"/>
- <glx rop="4185" doubles_in_order="true"/>
- </function>
-
- <function name="ProgramParameter4fNV" offset="596" vectorequiv="ProgramParameter4fvNV">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramParameter4fvNV" offset="597">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4184"/>
- </function>
-
- <function name="ProgramParameters4dvNV" offset="598">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="num" type="GLuint" counter="true"/>
- <param name="params" type="const GLdouble *" count="num" count_scale="4"/>
- <glx rop="4187"/>
- </function>
-
- <function name="ProgramParameters4fvNV" offset="599">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="num" type="GLuint" counter="true"/>
- <param name="params" type="const GLfloat *" count="num" count_scale="4"/>
- <glx rop="4186"/>
- </function>
-
- <function name="RequestResidentProgramsNV" offset="600">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="const GLuint *" count="n"/>
- <glx rop="4182"/>
- </function>
-
- <function name="TrackMatrixNV" offset="601">
- <param name="target" type="GLenum"/>
- <param name="address" type="GLuint"/>
- <param name="matrix" type="GLenum"/>
- <param name="transform" type="GLenum"/>
- <glx rop="4188"/>
- </function>
-
- <function name="VertexAttribPointerNV" offset="602">
- <param name="index" type="GLuint"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexAttrib1sNV" offset="760" vectorequiv="VertexAttrib1svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib1svNV" offset="761">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="4189"/>
- </function>
-
- <function name="VertexAttrib2sNV" offset="766" vectorequiv="VertexAttrib2svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib2svNV" offset="767">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="4190"/>
- </function>
-
- <function name="VertexAttrib3sNV" offset="772" vectorequiv="VertexAttrib3svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib3svNV" offset="773">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="4191"/>
- </function>
-
- <function name="VertexAttrib4sNV" offset="778" vectorequiv="VertexAttrib4svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib4svNV" offset="779">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="4192"/>
- </function>
-
- <function name="VertexAttrib1fNV" offset="758" vectorequiv="VertexAttrib1fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib1fvNV" offset="759">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="4193"/>
- </function>
-
- <function name="VertexAttrib2fNV" offset="764" vectorequiv="VertexAttrib2fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib2fvNV" offset="765">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="4194"/>
- </function>
-
- <function name="VertexAttrib3fNV" offset="770" vectorequiv="VertexAttrib3fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib3fvNV" offset="771">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="4195"/>
- </function>
-
- <function name="VertexAttrib4fNV" offset="776" vectorequiv="VertexAttrib4fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib4fvNV" offset="777">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="4196"/>
- </function>
-
- <function name="VertexAttrib1dNV" offset="756" vectorequiv="VertexAttrib1dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib1dvNV" offset="757">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="4197" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib2dNV" offset="762" vectorequiv="VertexAttrib2dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib2dvNV" offset="763">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="4198" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib3dNV" offset="768" vectorequiv="VertexAttrib3dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib3dvNV" offset="769">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="4199" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib4dNV" offset="774" vectorequiv="VertexAttrib4dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib4dvNV" offset="775">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="4200" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib4ubNV" offset="780" vectorequiv="VertexAttrib4ubvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLubyte"/>
- <param name="y" type="GLubyte"/>
- <param name="z" type="GLubyte"/>
- <param name="w" type="GLubyte"/>
- </function>
-
- <function name="VertexAttrib4ubvNV" offset="781">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="4201"/>
- </function>
-
- <function name="VertexAttribs1svNV" offset="631">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n"/>
- <glx rop="4202"/>
- </function>
-
- <function name="VertexAttribs2svNV" offset="634">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n" count_scale="2"/>
- <glx rop="4203"/>
- </function>
-
- <function name="VertexAttribs3svNV" offset="637">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n" count_scale="3"/>
- <glx rop="4204"/>
- </function>
-
- <function name="VertexAttribs4svNV" offset="640">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n" count_scale="4"/>
- <glx rop="4205"/>
- </function>
-
- <function name="VertexAttribs1fvNV" offset="630">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n"/>
- <glx rop="4206"/>
- </function>
-
- <function name="VertexAttribs2fvNV" offset="633">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n" count_scale="2"/>
- <glx rop="4207"/>
- </function>
-
- <function name="VertexAttribs3fvNV" offset="636">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n" count_scale="3"/>
- <glx rop="4208"/>
- </function>
-
- <function name="VertexAttribs4fvNV" offset="639">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n" count_scale="4"/>
- <glx rop="4209"/>
- </function>
-
- <function name="VertexAttribs1dvNV" offset="629">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n"/>
- <glx rop="4210" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs2dvNV" offset="632">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n" count_scale="2"/>
- <glx rop="4211" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs3dvNV" offset="635">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n" count_scale="3"/>
- <glx rop="4212" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs4dvNV" offset="638">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n" count_scale="4"/>
- <glx rop="4213" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs4ubvNV" offset="641">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLubyte *" count="n" count_scale="4"/>
- <glx rop="4214"/>
- </function>
-</category>
-
-<!-- Extension number 234 is a GLX extension. -->
-
-<category name="GL_SGIX_texture_coordinate_clamp" number="235">
- <enum name="TEXTURE_MAX_CLAMP_S_SGIX" count="1" value="0x8369">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_CLAMP_T_SGIX" count="1" value="0x836A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_CLAMP_R_SGIX" count="1" value="0x836B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 236 is not listed in the extension registry. -->
-<!-- Extension number 237 is a GLX extension. -->
-<!-- Extension number 238 is a GLX extension. -->
-<!-- Extension number 242 is a WGL extension. -->
-
-<category name="GL_NV_copy_depth_to_color" number="243">
- <enum name="DEPTH_STENCIL_TO_RGBA_NV" value="0x886E"/>
- <enum name="DEPTH_STENCIL_TO_BGRA_NV" value="0x886F"/>
-</category>
-
-<category name="GL_ATI_fragment_shader" number="245">
- <function name="GenFragmentShadersATI" offset="782">
- <return type="GLuint"/>
- <param name="range" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BindFragmentShaderATI" offset="783">
- <param name="id" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DeleteFragmentShaderATI" offset="784">
- <param name="id" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BeginFragmentShaderATI" offset="785">
- <glx ignore="true"/>
- </function>
-
- <function name="EndFragmentShaderATI" offset="786">
- <glx ignore="true"/>
- </function>
-
- <function name="PassTexCoordATI" offset="787">
- <param name="dst" type="GLuint"/>
- <param name="coord" type="GLuint"/>
- <param name="swizzle" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SampleMapATI" offset="788">
- <param name="dst" type="GLuint"/>
- <param name="interp" type="GLuint"/>
- <param name="swizzle" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ColorFragmentOp1ATI" offset="789">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMask" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ColorFragmentOp2ATI" offset="790">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMask" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ColorFragmentOp3ATI" offset="791">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMask" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <param name="arg3" type="GLuint"/>
- <param name="arg3Rep" type="GLuint"/>
- <param name="arg3Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AlphaFragmentOp1ATI" offset="792">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AlphaFragmentOp2ATI" offset="793">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AlphaFragmentOp3ATI" offset="794">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <param name="arg3" type="GLuint"/>
- <param name="arg3Rep" type="GLuint"/>
- <param name="arg3Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SetFragmentShaderConstantATI" offset="795">
- <param name="dst" type="GLuint"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 250 is a WGL extension. -->
-<!-- Extension number 251 is a WGL extension. -->
-<!-- Extension number 252 is a WGL extension. -->
-<!-- Extension number 253 is a WGL extension. -->
-<!-- Extension number 254 is a WGL extension. -->
-<!-- Extension number 255 is a WGL extension. -->
-
-<category name="GL_SUN_mesh_array" number="257">
- <enum name="QUAD_MESH_SUN" value="0x8614"/>
- <enum name="TRIANGLE_MESH_SUN" value="0x8615"/>
-
- <function name="DrawMeshArraysSUN" offset="?">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="width" type="GLsizei"/>
- </function>
-</category>
-
-<category name="GL_SUN_slice_accum" number="258">
- <enum name="SLICE_ACCUM_SUN" value="0x85CC"/>
-</category>
-
-<category name="GL_NV_multisample_filter_hint" number="259">
- <enum name="MULTISAMPLE_FILTER_HINT_NV" count="1" value="0x8534">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_depth_clamp" number="260">
- <enum name="DEPTH_CLAMP_NV" count="1" value="0x864F">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_point_sprite" number="262">
- <!-- These existing enums can be passed as a parameter to the function
- added for this extension. -->
-
- <enum name="POINT_SIZE_MIN_EXT" count="1" value="0x8126">
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="POINT_SIZE_MAX_EXT" count="1" value="0x8127">
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_EXT" count="1" value="0x8128">
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_EXT" count="3" value="0x8129">
- <size name="PointParameterivNV"/>
- </enum>
-
- <enum name="POINT_SPRITE_NV" count="1" value="0x8861">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COORD_REPLACE_NV" count="1" value="0x8862">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="POINT_SPRITE_R_MODE_NV" count="1" value="0x8863">
- <size name="PointParameterfvEXT"/>
- <size name="PointParameterivNV"/>
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="PointParameteriNV" offset="642">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="4221"/>
- </function>
-
- <function name="PointParameterivNV" offset="643">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="4222"/>
- </function>
-</category>
-
-<!-- Extension number 263 is a WGL extension. -->
-<!-- Extension number 264 is a WGL extension. -->
-
-<category name="GL_EXT_shadow_funcs" number="267">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_EXT_stencil_two_side" number="268">
- <enum name="STENCIL_TEST_TWO_SIDE_EXT" count="1" value="0x8910">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACTIVE_STENCIL_FACE_EXT" count="1" value="0x8911">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="ActiveStencilFaceEXT" offset="646">
- <param name="face" type="GLenum"/>
- <glx rop="4220"/>
- </function>
-</category>
-
-<category name="GL_APPLE_ycbcr_422" number="275">
- <enum name="YCBCR_422_APPLE" value="0x85B9"/>
- <enum name="UNSIGNED_SHORT_8_8_APPLE" value="0x85BA"/>
- <enum name="UNSIGNED_SHORT_8_8_REV_APPLE" value="0x85BB"/>
-</category>
-
-<category name="GL_S3_s3tc" number="276">
- <enum name="RGB_S3TC" value="0x83A0"/>
- <enum name="RGB4_S3TC" value="0x83A1"/>
- <enum name="RGBA_S3TC" value="0x83A2"/>
- <enum name="RGBA4_S3TC" value="0x83A3"/>
- <enum name="RGBA_DXT5_S3TC" value="0x83A4"/>
- <enum name="RGBA4_DXT5_S3TC" value="0x83A5"/>
-</category>
-
-<category name="GL_ATI_draw_buffers" number="277">
- <enum name="MAX_DRAW_BUFFERS_ATI" count="1" value="0x8824">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER0_ATI" count="1" value="0x8825">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER1_ATI" count="1" value="0x8826">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER2_ATI" count="1" value="0x8827">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER3_ATI" count="1" value="0x8828">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER4_ATI" count="1" value="0x8829">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER5_ATI" count="1" value="0x882A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER6_ATI" count="1" value="0x882B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER7_ATI" count="1" value="0x882C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER8_ATI" count="1" value="0x882D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER9_ATI" count="1" value="0x882E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER10_ATI" count="1" value="0x882F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER11_ATI" count="1" value="0x8830">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER12_ATI" count="1" value="0x8831">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER13_ATI" count="1" value="0x8832">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER14_ATI" count="1" value="0x8833">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER15_ATI" count="1" value="0x8834">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DrawBuffersATI" alias="DrawBuffersARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- <!-- GLX protocol is not fully defined for this extension. -->
- </function>
-</category>
-
-<!-- Extension number 278 is a WGL extension. -->
-
-<category name="GL_ATI_texture_env_combine3" number="279">
- <enum name="MODULATE_ADD_ATI" value="0x8744"/>
- <enum name="MODULATE_SIGNED_ADD_ATI" value="0x8745"/>
- <enum name="MODULATE_SUBTRACT_ATI" value="0x8746"/>
-</category>
-
-<category name="GL_NV_fragment_program" number="282">
- <function name="ProgramNamedParameter4fNV" offset="682" vectorequiv="ProgramNamedParameter4fvNV">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramNamedParameter4dNV" offset="683" vectorequiv="ProgramNamedParameter4dvNV">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramNamedParameter4fvNV" offset="684">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="4218"/>
- </function>
-
- <function name="ProgramNamedParameter4dvNV" offset="685">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="4219"/>
- </function>
-
- <function name="GetProgramNamedParameterfvNV" offset="686">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1310" always_array="true"/>
- </function>
-
- <function name="GetProgramNamedParameterdvNV" offset="687">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1311" always_array="true"/>
- </function>
-</category>
-
-<category name="GL_NV_expand_normal" number="286">
- <enum name="TEXTURE_UNSIGNED_REMAP_MODE_NV" count="1" value="0x888F">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_OES_compressed_paletted_texture" number="294">
- <enum name="PALETTE4_RGB8_OES" value="0x8B90"/>
- <enum name="PALETTE4_RGBA8_OES" value="0x8B91"/>
- <enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/>
- <enum name="PALETTE4_RGBA4_OES" value="0x8B93"/>
- <enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/>
- <enum name="PALETTE8_RGB8_OES" value="0x8B95"/>
- <enum name="PALETTE8_RGBA8_OES" value="0x8B96"/>
- <enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/>
- <enum name="PALETTE8_RGBA4_OES" value="0x8B98"/>
- <enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/>
-</category>
-
-<category name="GL_OES_read_format" number="295">
- <enum name="IMPLEMENTATION_COLOR_READ_TYPE_OES" value="0x8B9A"/>
- <enum name="IMPLEMENTATION_COLOR_READ_FORMAT_OES" value="0x8B9B"/>
-</category>
-
-<category name="GL_EXT_depth_bounds_test" number="297">
- <enum name="DEPTH_BOUNDS_TEST_EXT" count="1" value="0x8890">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_BOUNDS_EXT" count="2" value="0x8891">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DepthBoundsEXT" offset="699">
- <param name="zmin" type="GLclampd"/>
- <param name="zmax" type="GLclampd"/>
- <glx rop="4229" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture_mirror_clamp" number="298">
- <enum name="MIRROR_CLAMP_EXT" value="0x8742"/>
- <enum name="MIRROR_CLAMP_TO_EDGE_EXT" value="0x8743"/>
- <enum name="MIRROR_CLAMP_TO_BORDER_EXT" value="0x8912"/>
-</category>
-
-<category name="GL_EXT_blend_equation_separate" number="299">
- <enum name="BLEND_EQUATION_RGB_EXT" count="1" value="0x8009">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_EQUATION_ALPHA_EXT" count="1" value="0x883D">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="BlendEquationSeparateEXT" offset="710">
- <param name="modeRGB" type="GLenum"/>
- <param name="modeA" type="GLenum"/>
- <glx rop="4228" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_MESA_pack_invert" number="300">
- <enum name="PACK_INVERT_MESA" count="1" value="0x8758">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_MESA_ycbcr_texture" number="301">
- <enum name="YCBCR_MESA" value="0x8757"/>
- <enum name="UNSIGNED_SHORT_8_8_MESA" value="0x85BA"/>
- <enum name="UNSIGNED_SHORT_8_8_REV_MESA" value="0x85BB"/>
-</category>
-
-<category name="GL_EXT_pixel_buffer_object" number="302">
- <enum name="PIXEL_PACK_BUFFER_EXT" value="0x88EB"/>
- <enum name="PIXEL_UNPACK_BUFFER_EXT" value="0x88EC"/>
- <enum name="PIXEL_PACK_BUFFER_BINDING_EXT" value="0x88ED"/>
- <enum name="PIXEL_UNPACK_BUFFER_BINDING_EXT" value="0x88EF"/>
-</category>
-
-<category name="GL_NV_fragment_program_option" number="303">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_NV_fragment_program2" number="304">
- <enum name="MAX_PROGRAM_EXEC_INSTRUCTIONS_NV" count="1" value="0x88F4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_CALL_DEPTH_NV" count="1" value="0x88F5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_IF_DEPTH_NV" count="1" value="0x88F6">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_LOOP_DEPTH_NV" count="1" value="0x88F7">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_LOOP_COUNT_NV" count="1" value="0x88F8">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_program2_option" number="305">
- <enum name="MAX_PROGRAM_EXEC_INSTRUCTIONS_NV" count="1" value="0x88F4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_CALL_DEPTH_NV" count="1" value="0x88F5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_program3" number="306">
- <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" count="1" value="0x8B4C"/>
-</category>
-
-<xi:include href="EXT_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<!-- Extension number 307 is a GLX extension. -->
-<!-- Extension number 308 is a GLX extension. -->
-
-<category name="GL_EXT_texture_compression_dxt1" number="309">
- <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
-</category>
-
-<!-- Unnumbered extensions sorted by name. -->
-
-<category name="GL_ATI_blend_equation_separate">
- <function name="BlendEquationSeparateATI" alias="BlendEquationSeparateEXT">
- <param name="modeRGB" type="GLenum"/>
- <param name="modeA" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_INGR_blend_func_separate">
- <function name="BlendFuncSeparateINGR" alias="BlendFuncSeparateEXT">
- <param name="sfactorRGB" type="GLenum"/>
- <param name="dfactorRGB" type="GLenum"/>
- <param name="sfactorAlpha" type="GLenum"/>
- <param name="dfactorAlpha" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_SGIS_point_parameters">
- <enum name="POINT_SIZE_MIN_SGIS" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX_SGIS" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_SGIS" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_SGIS" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
-
- <function name="PointParameterfSGIS" alias="PointParameterfEXT">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="PointParameterfvSGIS" alias="PointParameterfvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-</category>
-
-<category name="GL_SGIX_igloo_interface">
- <function name="IglooInterfaceSGIX" offset="?">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SGIX_polynomial_ffd">
- <function name="DeformationMap3dSGIX" offset="?">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="ustride" type="GLint"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLdouble"/>
- <param name="v2" type="GLdouble"/>
- <param name="vstride" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="w1" type="GLdouble"/>
- <param name="w2" type="GLdouble"/>
- <param name="wstride" type="GLint"/>
- <param name="worder" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
- </function>
-
- <function name="DeformationMap3fSGIX" offset="?">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="ustride" type="GLint"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="vstride" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="w1" type="GLfloat"/>
- <param name="w2" type="GLfloat"/>
- <param name="wstride" type="GLint"/>
- <param name="worder" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
- </function>
-
- <function name="DeformSGIX" offset="?">
- <param name="mask" type="GLenum"/>
- </function>
-
- <function name="LoadIdentityDeformationMapSGIX" offset="?">
- <param name="mask" type="GLenum"/>
- </function>
-</category>
-
-</OpenGLAPI>
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_SPARC_asm.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_SPARC_asm.py
deleted file mode 100644
index 1a8823cc4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_SPARC_asm.py
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, license
-import sys, getopt
-
-class PrintGenericStubs(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
- self.name = "gl_SPARC_asm.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
-(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
-
-
- def printRealHeader(self):
- print '#include "glapioffsets.h"'
- print ''
- print '#ifdef __arch64__'
- print '# define GL_STUB(fn,off)\t\t\t\t\\'
- print 'fn:\t\t\t\t\t\\'
- print '\tsethi\t%hi(0xDEADBEEF), %g4 ;\t\t\t\\'
- print '\tsethi\t%hi(0xDEADBEEF), %g1 ;\t\t\t\\'
- print '\tor\t%g4, %lo(0xDEADBEEF), %g4 ;\t\t\\'
- print '\tor\t%g1, %lo(0xDEADBEEF), %g1 ;\t\t\\'
- print '\tsllx\t%g4, 32, %g4 ;\t\t\t\t\\'
- print '\tldx\t[%g1 + %g4], %g1 ;\t\t\t\\'
- print '\tsethi\t%hi(8 * off), %g4 ;\t\t\t\\'
- print '\tor\t%g4, %lo(8 * off), %g4 ;\t\t\\'
- print '\tldx\t[%g1 + %g4], %g5 ;\t\t\t\\'
- print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\'
- print '\tnop'
- print '#else'
- print '# define GL_STUB(fn,off)\t\t\t\t\\'
- print 'fn:\t\t\t\t\t\\'
- print '\tsethi\t%hi(0xDEADBEEF), %g1 ;\t\t\t\\'
- print '\tld\t[%g1 + %lo(0xDEADBEEF)], %g1 ;\t\t\\'
- print '\tld\t[%g1 + (4 * off)], %g5 ;\t\t\\'
- print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\'
- print '\tnop'
- print '#endif'
- print ''
- print '#define GL_STUB_ALIAS(fn,alias) fn = alias'
- print ''
- print '.text'
- print '.align 32'
- print '\t\t.globl __glapi_sparc_icache_flush ; .type __glapi_sparc_icache_flush,#function'
- print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */'
- print '\tflush\t%o0'
- print '\tretl'
- print '\tnop'
- print ''
- print '.data'
- print '.align 64'
- print ''
- return
-
-
- def printBody(self, api):
- for f in api.functionIterateByOffset():
- print '\t\t.globl gl%s ; .type gl%s,#function' % (f.name, f.name)
-
- print '\t\t.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function'
- print '_mesa_sparc_glapi_begin:'
- print ''
-
- for f in api.functionIterateByOffset():
- print '\tGL_STUB(gl%s, _gloffset_%s)' % (f.name, f.name)
-
- print ''
- print '\t\t.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function'
- print '_mesa_sparc_glapi_end:'
- print ''
-
-
- for f in api.functionIterateByOffset():
- for n in f.entry_points:
- if n != f.name:
- print '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name)
-
- return
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
- mode = "generic"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == '-m':
- mode = val
- elif arg == "-f":
- file_name = val
-
- if mode == "generic":
- printer = PrintGenericStubs()
- else:
- print "ERROR: Invalid mode \"%s\" specified." % mode
- show_usage()
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_XML.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_XML.py
deleted file mode 100644
index 11b23b7a8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_XML.py
+++ /dev/null
@@ -1,813 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import libxml2
-import re, sys, string
-import typeexpr
-
-
-def parse_GL_API( file_name, factory = None ):
- doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT )
- ret = doc.xincludeProcess()
-
- if not factory:
- factory = gl_item_factory()
-
- api = factory.create_item( "api", None, None )
- api.process_element( doc )
-
- doc.freeDoc()
-
- return api
-
-
-def is_attr_true( element, name ):
- """Read a name value from an element's attributes.
-
- The value read from the attribute list must be either 'true' or
- 'false'. If the value is 'false', zero will be returned. If the
- value is 'true', non-zero will be returned. An exception will be
- raised for any other value."""
-
- value = element.nsProp( name, None )
- if value == "true":
- return 1
- elif value == "false":
- return 0
- else:
- raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name))
-
-
-class gl_print_base:
- """Base class of all API pretty-printers.
-
- In the model-view-controller pattern, this is the view. Any derived
- class will want to over-ride the printBody, printRealHader, and
- printRealFooter methods. Some derived classes may want to over-ride
- printHeader and printFooter, or even Print (though this is unlikely).
- """
-
- def __init__(self):
- # Name of the script that is generating the output file.
- # Every derived class should set this to the name of its
- # source file.
-
- self.name = "a"
-
-
- # License on the *generated* source file. This may differ
- # from the license on the script that is generating the file.
- # Every derived class should set this to some reasonable
- # value.
- #
- # See license.py for an example of a reasonable value.
-
- self.license = "The license for this file is unspecified."
-
-
- # The header_tag is the name of the C preprocessor define
- # used to prevent multiple inclusion. Typically only
- # generated C header files need this to be set. Setting it
- # causes code to be generated automatically in printHeader
- # and printFooter.
-
- self.header_tag = None
-
-
- # List of file-private defines that must be undefined at the
- # end of the file. This can be used in header files to define
- # names for use in the file, then undefine them at the end of
- # the header file.
-
- self.undef_list = []
- return
-
-
- def Print(self, api):
- self.printHeader()
- self.printBody(api)
- self.printFooter()
- return
-
-
- def printHeader(self):
- """Print the header associated with all files and call the printRealHeader method."""
-
- print '/* DO NOT EDIT - This file generated automatically by %s script */' \
- % (self.name)
- print ''
- print '/*'
- print ' * ' + self.license.replace('\n', '\n * ')
- print ' */'
- print ''
- if self.header_tag:
- print '#if !defined( %s )' % (self.header_tag)
- print '# define %s' % (self.header_tag)
- print ''
- self.printRealHeader();
- return
-
-
- def printFooter(self):
- """Print the header associated with all files and call the printRealFooter method."""
-
- self.printRealFooter()
-
- if self.undef_list:
- print ''
- for u in self.undef_list:
- print "# undef %s" % (u)
-
- if self.header_tag:
- print ''
- print '#endif /* !defined( %s ) */' % (self.header_tag)
-
-
- def printRealHeader(self):
- """Print the "real" header for the created file.
-
- In the base class, this function is empty. All derived
- classes should over-ride this function."""
- return
-
-
- def printRealFooter(self):
- """Print the "real" footer for the created file.
-
- In the base class, this function is empty. All derived
- classes should over-ride this function."""
- return
-
-
- def printPure(self):
- """Conditionally define `PURE' function attribute.
-
- Conditionally defines a preprocessor macro `PURE' that wraps
- GCC's `pure' function attribute. The conditional code can be
- easilly adapted to other compilers that support a similar
- feature.
-
- The name is also added to the file's undef_list.
- """
- self.undef_list.append("PURE")
- print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define PURE __attribute__((pure))
-# else
-# define PURE
-# endif"""
- return
-
-
- def printFastcall(self):
- """Conditionally define `FASTCALL' function attribute.
-
- Conditionally defines a preprocessor macro `FASTCALL' that
- wraps GCC's `fastcall' function attribute. The conditional
- code can be easilly adapted to other compilers that support a
- similar feature.
-
- The name is also added to the file's undef_list.
- """
-
- self.undef_list.append("FASTCALL")
- print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-# define FASTCALL __attribute__((fastcall))
-# else
-# define FASTCALL
-# endif"""
- return
-
-
- def printVisibility(self, S, s):
- """Conditionally define visibility function attribute.
-
- Conditionally defines a preprocessor macro name S that wraps
- GCC's visibility function attribute. The visibility used is
- the parameter s. The conditional code can be easilly adapted
- to other compilers that support a similar feature.
-
- The name is also added to the file's undef_list.
- """
-
- self.undef_list.append(S)
- print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
-# define %s __attribute__((visibility("%s")))
-# else
-# define %s
-# endif""" % (S, s, S)
- return
-
-
- def printNoinline(self):
- """Conditionally define `NOINLINE' function attribute.
-
- Conditionally defines a preprocessor macro `NOINLINE' that
- wraps GCC's `noinline' function attribute. The conditional
- code can be easilly adapted to other compilers that support a
- similar feature.
-
- The name is also added to the file's undef_list.
- """
-
- self.undef_list.append("NOINLINE")
- print """# if defined(__GNUC__)
-# define NOINLINE __attribute__((noinline))
-# else
-# define NOINLINE
-# endif"""
- return
-
-
-def real_function_name(element):
- name = element.nsProp( "name", None )
- alias = element.nsProp( "alias", None )
-
- if alias:
- return alias
- else:
- return name
-
-
-def real_category_name(c):
- if re.compile("[1-9][0-9]*[.][0-9]+").match(c):
- return "GL_VERSION_" + c.replace(".", "_")
- else:
- return c
-
-
-def create_parameter_string(parameters, include_names):
- """Create a parameter string from a list of gl_parameters."""
-
- list = []
- for p in parameters:
- if include_names:
- list.append( p.string() )
- else:
- list.append( p.type_string() )
-
- if len(list) == 0: list = ["void"]
-
- return string.join(list, ", ")
-
-
-class gl_item:
- def __init__(self, element, context):
- self.context = context
- self.name = element.nsProp( "name", None )
- self.category = real_category_name( element.parent.nsProp( "name", None ) )
- return
-
-
-class gl_type( gl_item ):
- def __init__(self, element, context):
- gl_item.__init__(self, element, context)
- self.size = int( element.nsProp( "size", None ), 0 )
-
- te = typeexpr.type_expression( None )
- tn = typeexpr.type_node()
- tn.size = int( element.nsProp( "size", None ), 0 )
- tn.integer = not is_attr_true( element, "float" )
- tn.unsigned = is_attr_true( element, "unsigned" )
- tn.name = "GL" + self.name
- te.set_base_type_node( tn )
-
- self.type_expr = te
- return
-
-
- def get_type_expression(self):
- return self.type_expr
-
-
-class gl_enum( gl_item ):
- def __init__(self, element, context):
- gl_item.__init__(self, element, context)
- self.value = int( element.nsProp( "value", None ), 0 )
-
- temp = element.nsProp( "count", None )
- if not temp or temp == "?":
- self.default_count = -1
- else:
- try:
- c = int(temp)
- except Exception,e:
- raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
-
- self.default_count = c
-
- return
-
-
- def priority(self):
- """Calculate a 'priority' for this enum name.
-
- When an enum is looked up by number, there may be many
- possible names, but only one is the 'prefered' name. The
- priority is used to select which name is the 'best'.
-
- Highest precedence is given to core GL name. ARB extension
- names have the next highest, followed by EXT extension names.
- Vendor extension names are the lowest.
- """
-
- if self.name.endswith( "_BIT" ):
- bias = 1
- else:
- bias = 0
-
- if self.category.startswith( "GL_VERSION_" ):
- priority = 0
- elif self.category.startswith( "GL_ARB_" ):
- priority = 2
- elif self.category.startswith( "GL_EXT_" ):
- priority = 4
- else:
- priority = 6
-
- return priority + bias
-
-
-
-class gl_parameter:
- def __init__(self, element, context):
- self.name = element.nsProp( "name", None )
-
- ts = element.nsProp( "type", None )
- self.type_expr = typeexpr.type_expression( ts, context )
-
- temp = element.nsProp( "variable_param", None )
- if temp:
- self.count_parameter_list = temp.split( ' ' )
- else:
- self.count_parameter_list = []
-
- # The count tag can be either a numeric string or the name of
- # a variable. If it is the name of a variable, the int(c)
- # statement will throw an exception, and the except block will
- # take over.
-
- c = element.nsProp( "count", None )
- try:
- count = int(c)
- self.count = count
- self.counter = None
- except Exception,e:
- count = 1
- self.count = 0
- self.counter = c
-
- self.count_scale = int(element.nsProp( "count_scale", None ))
-
- elements = (count * self.count_scale)
- if elements == 1:
- elements = 0
-
- #if ts == "GLdouble":
- # print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size())
- # print '/* # elements = %u */' % (elements)
- self.type_expr.set_elements( elements )
- #if ts == "GLdouble":
- # print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())
-
- self.is_counter = is_attr_true( element, 'counter' )
- self.is_output = is_attr_true( element, 'output' )
-
-
- # Pixel data has special parameters.
-
- self.width = element.nsProp('img_width', None)
- self.height = element.nsProp('img_height', None)
- self.depth = element.nsProp('img_depth', None)
- self.extent = element.nsProp('img_extent', None)
-
- self.img_xoff = element.nsProp('img_xoff', None)
- self.img_yoff = element.nsProp('img_yoff', None)
- self.img_zoff = element.nsProp('img_zoff', None)
- self.img_woff = element.nsProp('img_woff', None)
-
- self.img_format = element.nsProp('img_format', None)
- self.img_type = element.nsProp('img_type', None)
- self.img_target = element.nsProp('img_target', None)
-
- self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' )
- self.img_null_flag = is_attr_true( element, 'img_null_flag' )
- self.img_send_null = is_attr_true( element, 'img_send_null' )
-
- return
-
-
- def compatible(self, other):
- return 1
-
-
- def is_array(self):
- return self.is_pointer()
-
-
- def is_pointer(self):
- return self.type_expr.is_pointer()
-
-
- def is_image(self):
- if self.width:
- return 1
- else:
- return 0
-
-
- def is_variable_length(self):
- return len(self.count_parameter_list) or self.counter
-
-
- def is_64_bit(self):
- count = self.type_expr.get_element_count()
- if count:
- if (self.size() / count) == 8:
- return 1
- else:
- if self.size() == 8:
- return 1
-
- return 0
-
-
- def string(self):
- return self.type_expr.original_string + " " + self.name
-
-
- def type_string(self):
- return self.type_expr.original_string
-
-
- def get_base_type_string(self):
- return self.type_expr.get_base_name()
-
-
- def get_dimensions(self):
- if not self.width:
- return [ 0, "0", "0", "0", "0" ]
-
- dim = 1
- w = self.width
- h = "1"
- d = "1"
- e = "1"
-
- if self.height:
- dim = 2
- h = self.height
-
- if self.depth:
- dim = 3
- d = self.depth
-
- if self.extent:
- dim = 4
- e = self.extent
-
- return [ dim, w, h, d, e ]
-
-
- def get_stack_size(self):
- return self.type_expr.get_stack_size()
-
-
- def size(self):
- if self.is_image():
- return 0
- else:
- return self.type_expr.get_element_size()
-
-
- def get_element_count(self):
- c = self.type_expr.get_element_count()
- if c == 0:
- return 1
-
- return c
-
-
- def size_string(self, use_parens = 1):
- s = self.size()
- if self.counter or self.count_parameter_list:
- list = [ "compsize" ]
-
- if self.counter and self.count_parameter_list:
- list.append( self.counter )
- elif self.counter:
- list = [ self.counter ]
-
- if s > 1:
- list.append( str(s) )
-
- if len(list) > 1 and use_parens :
- return "(%s)" % (string.join(list, " * "))
- else:
- return string.join(list, " * ")
-
- elif self.is_image():
- return "compsize"
- else:
- return str(s)
-
-
- def format_string(self):
- if self.type_expr.original_string == "GLenum":
- return "0x%x"
- else:
- return self.type_expr.format_string()
-
-
-
-class gl_function( gl_item ):
- def __init__(self, element, context):
- self.context = context
- self.name = None
-
- self.entry_points = []
- self.return_type = "void"
- self.parameters = []
- self.offset = -1
- self.initialized = 0
- self.images = []
-
- # Track the parameter string (for the function prototype)
- # for each entry-point. This is done because some functions
- # change their prototype slightly when promoted from extension
- # to ARB extension to core. glTexImage3DEXT and glTexImage3D
- # are good examples of this. Scripts that need to generate
- # code for these differing aliases need to real prototype
- # for each entry-point. Otherwise, they may generate code
- # that won't compile.
-
- self.parameter_strings = {}
-
- self.process_element( element )
-
- return
-
-
- def process_element(self, element):
- name = element.nsProp( "name", None )
- alias = element.nsProp( "alias", None )
-
- self.entry_points.append( name )
- if alias:
- true_name = alias
- else:
- true_name = name
-
- # Only try to set the offset when a non-alias
- # entry-point is being processes.
-
- offset = element.nsProp( "offset", None )
- if offset:
- try:
- o = int( offset )
- self.offset = o
- except Exception, e:
- self.offset = -1
-
-
- if not self.name:
- self.name = true_name
- elif self.name != true_name:
- raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name))
-
-
- # There are two possible cases. The first time an entry-point
- # with data is seen, self.initialized will be 0. On that
- # pass, we just fill in the data. The next time an
- # entry-point with data is seen, self.initialized will be 1.
- # On that pass we have to make that the new values match the
- # valuse from the previous entry-point.
-
- parameters = []
- return_type = "void"
- child = element.children
- while child:
- if child.type == "element":
- if child.name == "return":
- return_type = child.nsProp( "type", None )
- elif child.name == "param":
- param = self.context.factory.create_item( "parameter", child, self.context)
- parameters.append( param )
-
- child = child.next
-
-
- if self.initialized:
- if self.return_type != return_type:
- raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type))
-
- if len(parameters) != len(self.parameters):
- raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters)))
-
- for j in range(0, len(parameters)):
- p1 = parameters[j]
- p2 = self.parameters[j]
- if not p1.compatible( p2 ):
- raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string))
-
-
- if true_name == name or not self.initialized:
- self.return_type = return_type
- self.parameters = parameters
-
- for param in self.parameters:
- if param.is_image():
- self.images.append( param )
-
- if element.children:
- self.initialized = 1
- self.parameter_strings[name] = create_parameter_string(parameters, 1)
- else:
- self.parameter_strings[name] = None
-
- return
-
-
- def get_images(self):
- """Return potentially empty list of input images."""
- return self.images
-
-
- def parameterIterator(self):
- return self.parameters.__iter__();
-
-
- def get_parameter_string(self, entrypoint = None):
- if entrypoint:
- s = self.parameter_strings[ entrypoint ]
- if s:
- return s
-
- return create_parameter_string( self.parameters, 1 )
-
-
-class gl_item_factory:
- """Factory to create objects derived from gl_item."""
-
- def create_item(self, item_name, element, context):
- if item_name == "function":
- return gl_function(element, context)
- if item_name == "type":
- return gl_type(element, context)
- elif item_name == "enum":
- return gl_enum(element, context)
- elif item_name == "parameter":
- return gl_parameter(element, context)
- elif item_name == "api":
- return gl_api(self)
- else:
- return None
-
-
-class gl_api:
- def __init__(self, factory):
- self.functions_by_name = {}
- self.enums_by_name = {}
- self.types_by_name = {}
- self.category_dict = {}
-
- self.factory = factory
-
- typeexpr.create_initial_types()
- return
-
-
- def process_element(self, doc):
- element = doc.children
- while element.type != "element" or element.name != "OpenGLAPI":
- element = element.next
-
- if element:
- self.process_OpenGLAPI(element)
- return
-
-
- def process_OpenGLAPI(self, element):
- child = element.children
- while child:
- if child.type == "element":
- if child.name == "category":
- self.process_category( child )
- elif child.name == "OpenGLAPI":
- self.process_OpenGLAPI( child )
-
- child = child.next
-
- return
-
-
- def process_category(self, cat):
- cat_name = cat.nsProp( "name", None )
- cat_number = cat.nsProp( "number", None )
-
- child = cat.children
- while child:
- if child.type == "element":
- if child.name == "function":
- func_name = real_function_name( child )
-
- temp_name = child.nsProp( "name", None )
- self.category_dict[ temp_name ] = [cat_name, cat_number]
-
- if self.functions_by_name.has_key( func_name ):
- func = self.functions_by_name[ func_name ]
- func.process_element( child )
- else:
- func = self.factory.create_item( "function", child, self )
- self.functions_by_name[ func_name ] = func
-
-
- elif child.name == "enum":
- enum = self.factory.create_item( "enum", child, self )
- self.enums_by_name[ enum.name ] = enum
- elif child.name == "type":
- t = self.factory.create_item( "type", child, self )
- self.types_by_name[ "GL" + t.name ] = t
-
-
- child = child.next
-
- return
-
-
- def functionIterateByOffset(self):
- max_offset = -1
- for func in self.functions_by_name.itervalues():
- if func.offset > max_offset:
- max_offset = func.offset
-
-
- temp = [None for i in range(0, max_offset + 1)]
- for func in self.functions_by_name.itervalues():
- if func.offset != -1:
- temp[ func.offset ] = func
-
-
- list = []
- for i in range(0, max_offset + 1):
- if temp[i]:
- list.append(temp[i])
-
- return list.__iter__();
-
-
- def functionIterateAll(self):
- return self.functions_by_name.itervalues()
-
-
- def enumIterateByName(self):
- keys = self.enums_by_name.keys()
- keys.sort()
-
- list = []
- for enum in keys:
- list.append( self.enums_by_name[ enum ] )
-
- return list.__iter__()
-
-
- def get_category_for_name( self, name ):
- if self.category_dict.has_key(name):
- return self.category_dict[name]
- else:
- return ["<unknown category>", None]
-
-
- def typeIterate(self):
- return self.types_by_name.itervalues()
-
-
- def find_type( self, type_name ):
- if type_name in self.types_by_name:
- return self.types_by_name[ type_name ].type_expr
- else:
- print "Unable to find base type matching \"%s\"." % (type_name)
- return None
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_apitemp.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_apitemp.py
deleted file mode 100644
index 7cc434fa8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_apitemp.py
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML
-import license
-import sys, getopt
-
-class PrintGlOffsets(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "gl_apitemp.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
-(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
-
- self.undef_list.append( "KEYWORD1" )
- self.undef_list.append( "KEYWORD2" )
- self.undef_list.append( "NAME" )
- self.undef_list.append( "DISPATCH" )
- self.undef_list.append( "RETURN_DISPATCH" )
- self.undef_list.append( "DISPATCH_TABLE_NAME" )
- self.undef_list.append( "UNUSED_TABLE_NAME" )
- self.undef_list.append( "TABLE_ENTRY" )
-
-
- def printFunction(self, f, name):
- p_string = ""
- o_string = ""
- t_string = ""
- comma = ""
-
- for p in f.parameterIterator():
- if p.is_pointer():
- cast = "(const void *) "
- else:
- cast = ""
-
- t_string = t_string + comma + p.format_string()
- p_string = p_string + comma + p.name
- o_string = o_string + comma + cast + p.name
- comma = ", "
-
-
- if f.return_type != 'void':
- dispatch = "RETURN_DISPATCH"
- else:
- dispatch = "DISPATCH"
-
- print 'KEYWORD1 %s KEYWORD2 NAME(%s)(%s)' \
- % (f.return_type, name, f.get_parameter_string(name))
- print '{'
- if p_string == "":
- print ' %s(%s, (), (F, "gl%s();\\n"));' \
- % (dispatch, f.name, name)
- else:
- print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \
- % (dispatch, f.name, p_string, name, t_string, o_string)
- print '}'
- print ''
- return
-
- def printRealHeader(self):
- print """
-/*
- * This file is a template which generates the OpenGL API entry point
- * functions. It should be included by a .c file which first defines
- * the following macros:
- * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
- * KEYWORD2 - usually nothing, but might be __stdcall on Win32
- * NAME(n) - builds the final function name (usually add "gl" prefix)
- * DISPATCH(func, args, msg) - code to do dispatch of named function.
- * msg is a printf-style debug message.
- * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
- *
- * Here is an example which generates the usual OpenGL functions:
- * #define KEYWORD1
- * #define KEYWORD2
- * #define NAME(func) gl##func
- * #define DISPATCH(func, args, msg) \\
- * struct _glapi_table *dispatch = CurrentDispatch; \\
- * (*dispatch->func) args
- * #define RETURN DISPATCH(func, args, msg) \\
- * struct _glapi_table *dispatch = CurrentDispatch; \\
- * return (*dispatch->func) args
- *
- */
-
-
-#if defined( NAME )
-#ifndef KEYWORD1
-#define KEYWORD1
-#endif
-
-#ifndef KEYWORD2
-#define KEYWORD2
-#endif
-
-#ifndef DISPATCH
-#error DISPATCH must be defined
-#endif
-
-#ifndef RETURN_DISPATCH
-#error RETURN_DISPATCH must be defined
-#endif
-
-"""
- return
-
-
-
- def printInitDispatch(self, api):
- print """
-#endif /* defined( NAME ) */
-
-/*
- * This is how a dispatch table can be initialized with all the functions
- * we generated above.
- */
-#ifdef DISPATCH_TABLE_NAME
-
-#ifndef TABLE_ENTRY
-#error TABLE_ENTRY must be defined
-#endif
-
-static _glapi_proc DISPATCH_TABLE_NAME[] = {"""
- for f in api.functionIterateByOffset():
- print ' TABLE_ENTRY(%s),' % (f.name)
-
- print ' /* A whole bunch of no-op functions. These might be called'
- print ' * when someone tries to call a dynamically-registered'
- print ' * extension function without a current rendering context.'
- print ' */'
- for i in range(1, 100):
- print ' TABLE_ENTRY(Unused),'
-
- print '};'
- print '#endif /* DISPATCH_TABLE_NAME */'
- print ''
- return
-
-
- def printAliasedTable(self, api):
- print """
-/*
- * This is just used to silence compiler warnings.
- * We list the functions which are not otherwise used.
- */
-#ifdef UNUSED_TABLE_NAME
-static _glapi_proc UNUSED_TABLE_NAME[] = {"""
-
- for f in api.functionIterateByOffset():
- for n in f.entry_points:
- if n != f.name:
- print ' TABLE_ENTRY(%s),' % (n)
-
- print '};'
- print '#endif /*UNUSED_TABLE_NAME*/'
- print ''
- return
-
-
- def printBody(self, api):
- for func in api.functionIterateByOffset():
- for n in func.entry_points:
- self.printFunction( func, n )
-
- self.printInitDispatch(api)
- self.printAliasedTable(api)
- return
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name]" % sys.argv[0]
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer = PrintGlOffsets()
- printer.Print(api)
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_enums.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_enums.py
deleted file mode 100644
index 33d621dcd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_enums.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/python2
-# -*- Mode: Python; py-indent-offset: 8 -*-
-
-# (C) Copyright Zack Rusin 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Zack Rusin <zack@kde.org>
-
-import license
-import gl_XML
-import sys, getopt
-
-class PrintGlEnums(gl_XML.gl_print_base):
-
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "gl_enums.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL")
- self.enum_table = {}
-
-
- def printRealHeader(self):
- print '#include "glheader.h"'
- print '#include "enums.h"'
- print '#include "imports.h"'
- print ''
- print 'typedef struct {'
- print ' size_t offset;'
- print ' int n;'
- print '} enum_elt;'
- print ''
- return
-
- def print_code(self):
- print """
-#define Elements(x) sizeof(x)/sizeof(*x)
-
-typedef int (*cfunc)(const void *, const void *);
-
-/**
- * Compare a key name to an element in the \c all_enums array.
- *
- * \c bsearch always passes the key as the first parameter and the pointer
- * to the array element as the second parameter. We can elimiate some
- * extra work by taking advantage of that fact.
- *
- * \param a Pointer to the desired enum name.
- * \param b Pointer to an element of the \c all_enums array.
- */
-static int compar_name( const char *a, const enum_elt *b )
-{
- return _mesa_strcmp( a, & enum_string_table[ b->offset ] );
-}
-
-/**
- * Compare a key enum value to an element in the \c all_enums array.
- *
- * \c bsearch always passes the key as the first parameter and the pointer
- * to the array element as the second parameter. We can elimiate some
- * extra work by taking advantage of that fact.
- *
- * \param a Pointer to the desired enum name.
- * \param b Pointer to an index into the \c all_enums array.
- */
-static int compar_nr( const int *a, const unsigned *b )
-{
- return a[0] - all_enums[*b].n;
-}
-
-
-static char token_tmp[20];
-
-const char *_mesa_lookup_enum_by_nr( int nr )
-{
- unsigned * i;
-
- i = (unsigned *)bsearch( & nr, reduced_enums, Elements(reduced_enums),
- sizeof(reduced_enums[0]), (cfunc) compar_nr );
-
- if ( i != NULL ) {
- return & enum_string_table[ all_enums[ *i ].offset ];
- }
- else {
- /* this is not re-entrant safe, no big deal here */
- _mesa_sprintf(token_tmp, "0x%x", nr);
- return token_tmp;
- }
-}
-
-int _mesa_lookup_enum_by_name( const char *symbol )
-{
- enum_elt * f = NULL;
-
- if ( symbol != NULL ) {
- f = (enum_elt *)bsearch( symbol, all_enums, Elements(all_enums),
- sizeof( enum_elt ), (cfunc) compar_name );
- }
-
- return (f != NULL) ? f->n : -1;
-}
-
-"""
- return
-
-
- def printBody(self, api):
- self.process_enums( api )
-
- keys = self.enum_table.keys()
- keys.sort()
-
- name_table = []
- enum_table = {}
-
- for enum in keys:
- low_pri = 9
- for [name, pri] in self.enum_table[ enum ]:
- name_table.append( [name, enum] )
-
- if pri < low_pri:
- low_pri = pri
- enum_table[enum] = name
-
-
- name_table.sort()
-
- string_offsets = {}
- i = 0;
- print 'static const char enum_string_table[] = '
- for [name, enum] in name_table:
- print ' "%s\\0"' % (name)
- string_offsets[ name ] = i
- i += len(name) + 1
-
- print ' ;'
- print ''
-
-
- print 'static const enum_elt all_enums[%u] =' % (len(name_table))
- print '{'
- for [name, enum] in name_table:
- print ' { % 5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name)
- print '};'
- print ''
-
- print 'static const unsigned reduced_enums[%u] =' % (len(keys))
- print '{'
- for enum in keys:
- name = enum_table[ enum ]
- if [name, enum] not in name_table:
- print ' /* Error! %s, 0x%04x */ 0,' % (name, enum)
- else:
- i = name_table.index( [name, enum] )
-
- print ' % 4u, /* %s */' % (i, name)
- print '};'
-
-
- self.print_code()
- return
-
-
- def process_enums(self, api):
- self.enum_table = {}
-
- for obj in api.enumIterateByName():
- if obj.value not in self.enum_table:
- self.enum_table[ obj.value ] = []
-
-
- name = "GL_" + obj.name
- priority = obj.priority()
- self.enum_table[ obj.value ].append( [name, priority] )
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name]" % sys.argv[0]
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer = PrintGlEnums()
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_offsets.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_offsets.py
deleted file mode 100644
index 2966e3b62..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_offsets.py
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML
-import license
-import sys, getopt
-
-class PrintGlOffsets(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "gl_offsets.py (from Mesa)"
- self.header_tag = '_GLAPI_OFFSETS_H_'
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
-(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
- return
-
- def printBody(self, api):
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
- functions = []
- abi_functions = []
- count = 0
- for f in api.functionIterateByOffset():
- [category, num] = api.get_category_for_name( f.name )
- if category not in abi:
- functions.append( [f, count] )
- count += 1
- else:
- abi_functions.append( f )
-
-
- for f in abi_functions:
- print '#define _gloffset_%s %d' % (f.name, f.offset)
- last_static = f.offset
-
- print ''
- print '#if !defined(IN_DRI_DRIVER)'
- print ''
-
- for [f, index] in functions:
- print '#define _gloffset_%s %d' % (f.name, f.offset)
- if f.offset > last_static:
- last_static = f.offset
-
- print '#define _gloffset_FIRST_DYNAMIC %d' % (last_static + 1)
-
- print ''
- print '#else'
- print ''
-
- for [f, index] in functions:
- print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name)
-
- print ''
- print '#endif /* !defined(IN_DRI_DRIVER) */'
-
- return
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name]" % sys.argv[0]
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer = PrintGlOffsets()
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_procs.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_procs.py
deleted file mode 100644
index 1ad683de5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_procs.py
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import license
-import gl_XML
-import sys, getopt
-
-class PrintGlProcs(gl_XML.gl_print_base):
- def __init__(self, long_strings):
- gl_XML.gl_print_base.__init__(self)
-
- self.long_strings = long_strings
- self.name = "gl_procs.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
-(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
-
-
- def printRealHeader(self):
- print '/* This file is only included by glapi.c and is used for'
- print ' * the GetProcAddress() function'
- print ' */'
- print ''
- print 'typedef struct {'
- print ' GLint Name_offset;'
- print '#ifdef NEED_FUNCTION_POINTER'
- print ' _glapi_proc Address;'
- print '#endif'
- print ' GLuint Offset;'
- print '} glprocs_table_t;'
- print ''
- print '#ifdef NEED_FUNCTION_POINTER'
- print '# define NAME_FUNC_OFFSET(n,f,o) { n , (_glapi_proc) f , o }'
- print '#else'
- print '# define NAME_FUNC_OFFSET(n,f,o) { n , o }'
- print '#endif'
- print ''
- return
-
- def printRealFooter(self):
- print ''
- print '#undef NAME_FUNC_OFFSET'
- return
-
- def printFunctionString(self, name):
- if self.long_strings:
- print ' "gl%s\\0"' % (name)
- else:
- print " 'g','l',",
- for c in name:
- print "'%s'," % (c),
-
- print "'\\0',"
-
-
- def printBody(self, api):
- print ''
- if self.long_strings:
- print 'static const char gl_string_table[] ='
- else:
- print 'static const char gl_string_table[] = {'
-
- base_offset = 0
- table = []
- for func in api.functionIterateByOffset():
- self.printFunctionString( func.name )
- table.append((base_offset, func.name, func.name))
-
- # The length of the function's name, plus 2 for "gl",
- # plus 1 for the NUL.
-
- base_offset += len(func.name) + 3
-
-
- for func in api.functionIterateByOffset():
- for n in func.entry_points:
- if n != func.name:
- self.printFunctionString( n )
- table.append((base_offset, n, func.name))
- base_offset += len(n) + 3
-
-
- if self.long_strings:
- print ' ;'
- else:
- print '};'
-
- print ''
- print 'static const glprocs_table_t static_functions[] = {'
-
- for (offset, disp_name, real_name) in table:
- print ' NAME_FUNC_OFFSET( % 5u, gl%s, _gloffset_%s ),' % (offset, disp_name, real_name)
-
- print ' NAME_FUNC_OFFSET( -1, NULL, 0 )'
- print '};'
- return
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0]
- print "mode can be one of:"
- print " long - Create code for compilers that can handle very "
- print " long string constants. (default)"
- print " short - Create code for compilers that can only handle "
- print " ANSI C89 string constants."
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
- except Exception,e:
- show_usage()
-
- long_string = 1
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- elif arg == "-m":
- if val == "short":
- long_string = 0
- elif val == "long":
- long_string = 1
- else:
- show_usage()
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer = PrintGlProcs( long_string )
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_table.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_table.py
deleted file mode 100644
index 52b4be1d2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_table.py
+++ /dev/null
@@ -1,194 +0,0 @@
-#!/usr/bin/python2
-
-# (C) Copyright IBM Corporation 2004
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML
-import license
-import sys, getopt
-
-class PrintGlTable(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.header_tag = '_GLAPI_TABLE_H_'
- self.name = "gl_table.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
-(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
- return
-
-
- def printBody(self, api):
- for f in api.functionIterateByOffset():
- arg_string = f.get_parameter_string()
- print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset)
-
-
- def printRealHeader(self):
- print '#ifndef GLAPIENTRYP'
- print '#define GLAPIENTRYP'
- print '#endif'
- print ''
- print 'typedef void (*_glapi_proc)(void); /* generic function pointer */'
- print ''
- print 'struct _glapi_table'
- print '{'
- return
-
-
- def printRealFooter(self):
- print '};'
- return
-
-
-class PrintRemapTable(gl_XML.gl_print_base):
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.header_tag = '_DISPATCH_H_'
- self.name = "gl_table.py (from Mesa)"
- self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
- return
-
-
- def printRealHeader(self):
- print """/**
- * \\file dispatch.h
- * Macros for handling GL dispatch tables.
- *
- * For each known GL function, there are 3 macros in this file. The first
- * macro is named CALL_FuncName and is used to call that GL function using
- * the specified dispatch table. The other 2 macros, called GET_FuncName
- * can SET_FuncName, are used to get and set the dispatch pointer for the
- * named function in the specified dispatch table.
- */
-"""
-
- return
-
- def printBody(self, api):
- print '#define CALL_by_offset(disp, cast, offset, parameters) \\'
- print ' (*(cast (GET_by_offset(disp, offset)))) parameters'
- print '#define GET_by_offset(disp, offset) \\'
- print ' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL'
- print '#define SET_by_offset(disp, offset, fn) \\'
- print ' do { \\'
- print ' if ( (offset) < 0 ) { \\'
- print ' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\'
- print ' /* __func__, __LINE__, disp, offset, # fn); */ \\'
- print ' /* abort(); */ \\'
- print ' } \\'
- print ' else { \\'
- print ' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\'
- print ' } \\'
- print ' } while(0)'
- print ''
-
- abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
- functions = []
- abi_functions = []
- count = 0
- for f in api.functionIterateByOffset():
- [category, num] = api.get_category_for_name( f.name )
- if category not in abi:
- functions.append( [f, count] )
- count += 1
- else:
- abi_functions.append( f )
-
-
- for f in abi_functions:
- print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name)
- print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name)
- print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name)
-
-
- print ''
- print '#if !defined(IN_DRI_DRIVER)'
- print ''
-
- for [f, index] in functions:
- print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name)
- print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name)
- print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name)
-
- print ''
- print '#else'
- print ''
- print '#define driDispatchRemapTable_size %u' % (count)
- print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];'
- print ''
-
- for [f, index] in functions:
- print '#define %s_remap_index %u' % (f.name, index)
-
- print ''
-
- for [f, index] in functions:
- arg_string = gl_XML.create_parameter_string( f.parameters, 0 )
- cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string)
-
- print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name)
- print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name)
- print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name)
-
-
- print ''
- print '#endif /* !defined(IN_DRI_DRIVER) */'
- return
-
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0]
- print " -m mode Mode can be 'table' or 'remap_table'."
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
- except Exception,e:
- show_usage()
-
- mode = "table"
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- elif arg == "-m":
- mode = val
-
- if mode == "table":
- printer = PrintGlTable()
- elif mode == "remap_table":
- printer = PrintRemapTable()
- else:
- show_usage()
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_x86-64_asm.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_x86-64_asm.py
deleted file mode 100644
index 1bfe3db59..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_x86-64_asm.py
+++ /dev/null
@@ -1,316 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, license
-import sys, getopt, copy
-
-def should_use_push(registers):
- for [reg, offset] in registers:
- if reg[1:4] == "xmm":
- return 0
-
- N = len(registers)
- return (N & 1) != 0
-
-
-def local_size(registers):
- # The x86-64 ABI says "the value (%rsp - 8) is always a multiple of
- # 16 when control is transfered to the function entry point." This
- # means that the local stack usage must be (16*N)+8 for some value
- # of N. (16*N)+8 = (8*(2N))+8 = 8*(2N+1). As long as N is odd, we
- # meet this requirement.
-
- N = (len(registers) | 1)
- return 8*N
-
-
-def save_all_regs(registers):
- adjust_stack = 0
- if not should_use_push(registers):
- adjust_stack = local_size(registers)
- print '\tsubq\t$%u, %%rsp' % (adjust_stack)
-
- for [reg, stack_offset] in registers:
- save_reg( reg, stack_offset, adjust_stack )
- return
-
-
-def restore_all_regs(registers):
- adjust_stack = 0
- if not should_use_push(registers):
- adjust_stack = local_size(registers)
-
- temp = copy.deepcopy(registers)
- while len(temp):
- [reg, stack_offset] = temp.pop()
- restore_reg(reg, stack_offset, adjust_stack)
-
- if adjust_stack:
- print '\taddq\t$%u, %%rsp' % (adjust_stack)
- return
-
-
-def save_reg(reg, offset, use_move):
- if use_move:
- if offset == 0:
- print '\tmovq\t%s, (%%rsp)' % (reg)
- else:
- print '\tmovq\t%s, %u(%%rsp)' % (reg, offset)
- else:
- print '\tpushq\t%s' % (reg)
-
- return
-
-
-def restore_reg(reg, offset, use_move):
- if use_move:
- if offset == 0:
- print '\tmovq\t(%%rsp), %s' % (reg)
- else:
- print '\tmovq\t%u(%%rsp), %s' % (offset, reg)
- else:
- print '\tpopq\t%s' % (reg)
-
- return
-
-
-class PrintGenericStubs(gl_XML.gl_print_base):
-
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "gl_x86-64_asm.py (from Mesa)"
- self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
- return
-
-
- def get_stack_size(self, f):
- size = 0
- for p in f.parameterIterator():
- size += p.get_stack_size()
-
- return size
-
-
- def printRealHeader(self):
- print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change"
- print " * the symbol visibility mode to 'default'."
- print ' */'
- print ''
- print '#include "assyntax.h"'
- print ''
- print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303'
- print '# pragma GCC visibility push(default)'
- print '# define HIDDEN(x) .hidden x'
- print '#else'
- print '# define HIDDEN(x)'
- print '#endif'
- print ''
- print '# if defined(USE_MGL_NAMESPACE)'
- print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))'
- print '# else'
- print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
- print '# endif'
- print ''
- print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
- print '# define THREADS'
- print '#endif'
- print ''
- print '\t.text'
- print ''
- print '#ifdef GLX_USE_TLS'
- print ''
- print '\t.globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)'
- print '_x86_64_get_get_dispatch:'
- print '\tlea\t_x86_64_get_dispatch(%rip), %rax'
- print '\tret'
- print ''
- print '\t.p2align\t4,,15'
- print '_x86_64_get_dispatch:'
- print '\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax'
- print '\tmovq\t%fs:(%rax), %rax'
- print '\tret'
- print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch'
- print ''
- print '#elif defined(PTHREADS)'
- print ''
- print '\t.extern\t_glapi_Dispatch'
- print '\t.extern\t_gl_DispatchTSD'
- print '\t.extern\tpthread_getspecific'
- print ''
- print '\t.p2align\t4,,15'
- print '_x86_64_get_dispatch:'
- print '\tmovq\t_gl_DispatchTSD(%rip), %rdi'
- print '\tjmp\tpthread_getspecific@PLT'
- print ''
- print '#elif defined(THREADS)'
- print ''
- print '\t.extern\t_glapi_get_dispatch'
- print ''
- print '#endif'
- print ''
- return
-
-
- def printRealFooter(self):
- print ''
- print '#if defined(GLX_USE_TLS) && defined(__linux__)'
- print ' .section ".note.ABI-tag", "a"'
- print ' .p2align 2'
- print ' .long 1f - 0f /* name length */'
- print ' .long 3f - 2f /* data length */'
- print ' .long 1 /* note length */'
- print '0: .asciz "GNU" /* vendor name */'
- print '1: .p2align 2'
- print '2: .long 0 /* note data: the ABI tag */'
- print ' .long 2,4,20 /* Minimum kernel version w/TLS */'
- print '3: .p2align 2 /* pad out section */'
- print '#endif /* GLX_USE_TLS */'
- return
-
-
- def printFunction(self, f):
-
- # The x86-64 ABI divides function parameters into a couple
- # classes. For the OpenGL interface, the only ones that are
- # relevent are INTEGER and SSE. Basically, the first 8
- # GLfloat or GLdouble parameters are placed in %xmm0 - %xmm7,
- # the first 6 non-GLfloat / non-GLdouble parameters are placed
- # in registers listed in int_parameters.
- #
- # If more parameters than that are required, they are passed
- # on the stack. Therefore, we just have to make sure that
- # %esp hasn't changed when we jump to the actual function.
- # Since we're jumping to the function (and not calling it), we
- # have to make sure of that anyway!
-
- int_parameters = ["%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"]
-
- int_class = 0
- sse_class = 0
- stack_offset = 0
- registers = []
- for p in f.parameterIterator():
- type_name = p.get_base_type_string()
-
- if p.is_pointer() or (type_name != "GLfloat" and type_name != "GLdouble"):
- if int_class < 6:
- registers.append( [int_parameters[int_class], stack_offset] )
- int_class += 1
- stack_offset += 8
- else:
- if sse_class < 8:
- registers.append( ["%%xmm%u" % (sse_class), stack_offset] )
- sse_class += 1
- stack_offset += 8
-
- if ((int_class & 1) == 0) and (sse_class == 0):
- registers.append( ["%rbp", 0] )
-
-
- print '\t.p2align\t4,,15'
- print '\t.globl\tGL_PREFIX(%s)' % (f.name)
- print '\t.type\tGL_PREFIX(%s), @function' % (f.name)
- print 'GL_PREFIX(%s):' % (f.name)
- print '#if defined(GLX_USE_TLS)'
- print '\tcall\t_x86_64_get_dispatch@PLT'
- print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
- print '\tjmp\t*%r11'
- print '#elif defined(PTHREADS)'
-
- save_all_regs(registers)
- print '\tcall\t_x86_64_get_dispatch@PLT'
- restore_all_regs(registers)
-
- if f.offset == 0:
- print '\tmovq\t(%rax), %r11'
- else:
- print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
-
- print '\tjmp\t*%r11'
-
- print '#else'
- print '\tmovq\t_glapi_Dispatch(%rip), %rax'
- print '\ttestq\t%rax, %rax'
- print '\tje\t1f'
- print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
- print '\tjmp\t*%r11'
- print '1:'
-
- save_all_regs(registers)
- print '\tcall\t_glapi_get_dispatch'
- restore_all_regs(registers)
-
- print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
- print '\tjmp\t*%r11'
- print '#endif /* defined(GLX_USE_TLS) */'
-
- print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (f.name, f.name)
- print ''
- return
-
-
- def printBody(self, api):
- for f in api.functionIterateByOffset():
- self.printFunction(f)
-
-
- for f in api.functionIterateByOffset():
- for n in f.entry_points:
- if n != f.name:
- print '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, f.name)
-
- return
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
- mode = "generic"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == '-m':
- mode = val
- elif arg == "-f":
- file_name = val
-
- if mode == "generic":
- printer = PrintGenericStubs()
- else:
- print "ERROR: Invalid mode \"%s\" specified." % mode
- show_usage()
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/gl_x86_asm.py b/nx-X11/extras/Mesa/src/mesa/glapi/gl_x86_asm.py
deleted file mode 100644
index e62687a72..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/gl_x86_asm.py
+++ /dev/null
@@ -1,240 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import gl_XML, license
-import sys, getopt
-
-class PrintGenericStubs(gl_XML.gl_print_base):
-
- def __init__(self):
- gl_XML.gl_print_base.__init__(self)
-
- self.name = "gl_x86_asm.py (from Mesa)"
- self.license = license.bsd_license_template % ( \
-"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
-(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM")
- return
-
-
- def get_stack_size(self, f):
- size = 0
- for p in f.parameterIterator():
- size += p.get_stack_size()
-
- return size
-
-
- def printRealHeader(self):
- print '#include "assyntax.h"'
- print '#include "glapioffsets.h"'
- print ''
- print '#if defined(STDCALL_API)'
- print '# if defined(USE_MGL_NAMESPACE)'
- print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))'
- print '# else'
- print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))'
- print '# endif'
- print '#else'
- print '# if defined(USE_MGL_NAMESPACE)'
- print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))'
- print '# else'
- print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))'
- print '# endif'
- print '#endif'
- print ''
- print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))'
- print ''
- print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)'
- print '#define GLOBL_FN(x) GLOBL x ; .type x, function'
- print '#else'
- print '#define GLOBL_FN(x) GLOBL x'
- print '#endif'
- print ''
- print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
- print '# define THREADS'
- print '#endif'
- print ''
- print '#ifdef GLX_USE_TLS'
- print ''
- print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
- print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
- print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
- print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
- print '\tCALL(_x86_get_dispatch) ;\t\t\t\\'
- print '\tNOP ;\t\t\t\t\t\t\\'
- print '\tJMP(GL_OFFSET(off))'
- print ''
- print '#elif defined(PTHREADS)'
- print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
- print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
- print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
- print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
- print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
- print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
- print '\tJE(1f) ;\t\t\t\t\t\\'
- print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
- print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\'
- print '\tJMP(GL_OFFSET(off))'
- print '#elif defined(THREADS)'
- print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
- print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
- print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
- print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
- print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
- print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
- print '\tJE(1f) ;\t\t\t\t\t\\'
- print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
- print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\'
- print '\tJMP(GL_OFFSET(off))'
- print '#else /* Non-threaded version. */'
- print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
- print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
- print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
- print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
- print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
- print '\tJMP(GL_OFFSET(off))'
- print '#endif'
- print ''
- print '#ifdef HAVE_ALIAS'
- print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\'
- print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\'
- print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)'
- print '#else'
- print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\'
- print ' GL_STUB(fn, off, fn_alt)'
- print '#endif'
- print ''
- print 'SEG_TEXT'
- print ''
- print '#ifdef GLX_USE_TLS'
- print ''
- print '\tGLOBL\tGLNAME(_x86_get_dispatch)'
- print '\tHIDDEN(GLNAME(_x86_get_dispatch))'
- print 'ALIGNTEXT16'
- print 'GLNAME(_x86_get_dispatch):'
- print '\tmovl\t%gs:_glapi_tls_Dispatch@NTPOFF, %eax'
- print '\tret'
- print ''
- print '#elif defined(PTHREADS)'
- print 'EXTERN GLNAME(_glapi_Dispatch)'
- print 'EXTERN GLNAME(_gl_DispatchTSD)'
- print 'EXTERN GLNAME(pthread_getspecific)'
- print ''
- print 'ALIGNTEXT16'
- print 'GLNAME(_x86_get_dispatch):'
- print '\tSUB_L(CONST(24), ESP)'
- print '\tPUSH_L(GLNAME(_gl_DispatchTSD))'
- print '\tCALL(GLNAME(pthread_getspecific))'
- print '\tADD_L(CONST(28), ESP)'
- print '\tRET'
- print '#elif defined(THREADS)'
- print 'EXTERN GLNAME(_glapi_get_dispatch)'
- print '#endif'
- print ''
-
- print '#if defined( GLX_USE_TLS )'
- print '\t\t.section\twtext, "awx", @progbits'
- print '#endif /* defined( GLX_USE_TLS ) */'
-
- print ''
- print '\t\tALIGNTEXT16'
- print '\t\tGLOBL GLNAME(gl_dispatch_functions_start)'
- print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_start))'
- print 'GLNAME(gl_dispatch_functions_start):'
- print ''
- return
-
-
- def printRealFooter(self):
- print ''
- print '\t\tGLOBL\tGLNAME(gl_dispatch_functions_end)'
- print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_end))'
- print '\t\tALIGNTEXT16'
- print 'GLNAME(gl_dispatch_functions_end):'
- print ''
- print '#if defined(GLX_USE_TLS) && defined(__linux__)'
- print ' .section ".note.ABI-tag", "a"'
- print ' .p2align 2'
- print ' .long 1f - 0f /* name length */'
- print ' .long 3f - 2f /* data length */'
- print ' .long 1 /* note length */'
- print '0: .asciz "GNU" /* vendor name */'
- print '1: .p2align 2'
- print '2: .long 0 /* note data: the ABI tag */'
- print ' .long 2,4,20 /* Minimum kernel version w/TLS */'
- print '3: .p2align 2 /* pad out section */'
- print '#endif /* GLX_USE_TLS */'
- return
-
-
- def printBody(self, api):
- for f in api.functionIterateByOffset():
- stack = self.get_stack_size(f)
-
- alt = "%s@%u" % (f.name, stack)
- print '\tGL_STUB(%s, _gloffset_%s, %s)' % (f.name, f.name, alt)
-
- for f in api.functionIterateByOffset():
- stack = self.get_stack_size(f)
-
- alt = "%s@%u" % (f.name, stack)
-
- for n in f.entry_points:
- if n != f.name:
- alt2 = "%s@%u" % (n, stack)
- print '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt)
-
- return
-
-def show_usage():
- print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
- sys.exit(1)
-
-if __name__ == '__main__':
- file_name = "gl_API.xml"
- mode = "generic"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
- except Exception,e:
- show_usage()
-
- for (arg,val) in args:
- if arg == '-m':
- mode = val
- elif arg == "-f":
- file_name = val
-
- if mode == "generic":
- printer = PrintGenericStubs()
- else:
- print "ERROR: Invalid mode \"%s\" specified." % mode
- show_usage()
-
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/license.py b/nx-X11/extras/Mesa/src/mesa/glapi/license.py
deleted file mode 100644
index 02181648e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/license.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# (C) Copyright IBM Corporation 2004
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-bsd_license_template = """%s
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sub license,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-%s,
-AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE."""
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/mesadef.py b/nx-X11/extras/Mesa/src/mesa/glapi/mesadef.py
deleted file mode 100644
index 604be2ba6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/mesadef.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/env python
-
-# $Id: mesadef.py,v 1.1.1.1 2004/06/16 09:19:06 anholt Exp $
-
-# Mesa 3-D graphics library
-# Version: 4.1
-#
-# Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-# Generate the mesa.def file for Windows.
-#
-# Usage:
-# mesadef.py >mesa.def
-# Then copy to src/mesa/drivers/windows/gdi
-#
-# Dependencies:
-# The apispec file must be in the current directory.
-
-
-
-import apiparser
-import string
-
-
-def PrintHead():
- print '; DO NOT EDIT - This file generated automatically by mesadef.py script'
- print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\''
- print 'VERSION 6.0'
- print ';'
- print '; Module definition file for Mesa (OPENGL32.DLL)'
- print ';'
- print '; Note: The OpenGL functions use the STDCALL'
- print '; function calling convention. Microsoft\'s'
- print '; OPENGL32 uses this convention and so must the'
- print '; Mesa OPENGL32 so that the Mesa DLL can be used'
- print '; as a drop-in replacement.'
- print ';'
- print '; The linker exports STDCALL entry points with'
- print '; \'decorated\' names; e.g., _glBegin@0, where the'
- print '; trailing number is the number of bytes of '
- print '; parameter data pushed onto the stack. The'
- print '; callee is responsible for popping this data'
- print '; off the stack, usually via a RETF n instruction.'
- print ';'
- print '; However, the Microsoft OPENGL32.DLL does not export'
- print '; the decorated names, even though the calling convention'
- print '; is STDCALL. So, this module definition file is'
- print '; needed to force the Mesa OPENGL32.DLL to export the'
- print '; symbols in the same manner as the Microsoft DLL.'
- print '; Were it not for this problem, this file would not'
- print '; be needed (for the gl* functions) since the entry'
- print '; points are compiled with dllexport declspec.'
- print ';'
- print '; However, this file is still needed to export "internal"'
- print '; Mesa symbols for the benefit of the OSMESA32.DLL.'
- print ';'
- print 'EXPORTS'
- return
-#enddef
-
-
-def PrintTail():
- print ';'
- print '; WGL API'
- print '\twglChoosePixelFormat'
- print '\twglCopyContext'
- print '\twglCreateContext'
- print '\twglCreateLayerContext'
- print '\twglDeleteContext'
- print '\twglDescribeLayerPlane'
- print '\twglDescribePixelFormat'
- print '\twglGetCurrentContext'
- print '\twglGetCurrentDC'
- print '\twglGetLayerPaletteEntries'
- print '\twglGetPixelFormat'
- print '\twglGetProcAddress'
- print '\twglMakeCurrent'
- print '\twglRealizeLayerPalette'
- print '\twglSetLayerPaletteEntries'
- print '\twglSetPixelFormat'
- print '\twglShareLists'
- print '\twglSwapBuffers'
- print '\twglSwapLayerBuffers'
- print '\twglUseFontBitmapsA'
- print '\twglUseFontBitmapsW'
- print '\twglUseFontOutlinesA'
- print '\twglUseFontOutlinesW'
- print ';'
- print '; Mesa internals - mostly for OSMESA'
- print '\t_ac_CreateContext'
- print '\t_ac_DestroyContext'
- print '\t_ac_InvalidateState'
- print '\t_glapi_get_context'
- print '\t_glapi_get_proc_address'
- print '\t_mesa_buffer_data'
- print '\t_mesa_buffer_map'
- print '\t_mesa_buffer_subdata'
- print '\t_mesa_bzero'
- print '\t_mesa_calloc'
- print '\t_mesa_choose_tex_format'
- print '\t_mesa_compressed_texture_size'
- print '\t_mesa_create_framebuffer'
- print '\t_mesa_create_visual'
- print '\t_mesa_delete_buffer_object'
- print '\t_mesa_delete_texture_object'
- print '\t_mesa_destroy_framebuffer'
- print '\t_mesa_destroy_visual'
- print '\t_mesa_enable_1_3_extensions'
- print '\t_mesa_enable_1_4_extensions'
- print '\t_mesa_enable_1_5_extensions'
- print '\t_mesa_enable_sw_extensions'
- print '\t_mesa_error'
- print '\t_mesa_free'
- print '\t_mesa_free_context_data'
- print '\t_mesa_get_current_context'
- print '\t_mesa_init_default_imports'
- print '\t_mesa_initialize_context'
- print '\t_mesa_make_current'
- print '\t_mesa_memcpy'
- print '\t_mesa_memset'
- print '\t_mesa_new_buffer_object'
- print '\t_mesa_new_texture_object'
- print '\t_mesa_problem'
- print '\t_mesa_ResizeBuffersMESA'
- print '\t_mesa_store_compressed_teximage1d'
- print '\t_mesa_store_compressed_teximage2d'
- print '\t_mesa_store_compressed_teximage3d'
- print '\t_mesa_store_compressed_texsubimage1d'
- print '\t_mesa_store_compressed_texsubimage2d'
- print '\t_mesa_store_compressed_texsubimage3d'
- print '\t_mesa_store_teximage1d'
- print '\t_mesa_store_teximage2d'
- print '\t_mesa_store_teximage3d'
- print '\t_mesa_store_texsubimage1d'
- print '\t_mesa_store_texsubimage2d'
- print '\t_mesa_store_texsubimage3d'
- print '\t_mesa_strcmp'
- print '\t_mesa_test_proxy_teximage'
- print '\t_mesa_Viewport'
- print '\t_swrast_Accum'
- print '\t_swrast_alloc_buffers'
- print '\t_swrast_Bitmap'
- print '\t_swrast_CopyPixels'
- print '\t_swrast_DrawBuffer'
- print '\t_swrast_DrawPixels'
- print '\t_swrast_GetDeviceDriverReference'
- print '\t_swrast_Clear'
- print '\t_swrast_choose_line'
- print '\t_swrast_choose_triangle'
- print '\t_swrast_CopyColorSubTable'
- print '\t_swrast_CopyColorTable'
- print '\t_swrast_CopyConvolutionFilter1D'
- print '\t_swrast_CopyConvolutionFilter2D'
- print '\t_swrast_copy_teximage1d'
- print '\t_swrast_copy_teximage2d'
- print '\t_swrast_copy_texsubimage1d'
- print '\t_swrast_copy_texsubimage2d'
- print '\t_swrast_copy_texsubimage3d'
- print '\t_swrast_CreateContext'
- print '\t_swrast_DestroyContext'
- print '\t_swrast_InvalidateState'
- print '\t_swrast_ReadPixels'
- print '\t_swrast_zbuffer_address'
- print '\t_swsetup_Wakeup'
- print '\t_swsetup_CreateContext'
- print '\t_swsetup_DestroyContext'
- print '\t_swsetup_InvalidateState'
- print '\t_tnl_CreateContext'
- print '\t_tnl_DestroyContext'
- print '\t_tnl_InvalidateState'
- print '\t_tnl_MakeCurrent'
- print '\t_tnl_run_pipeline'
-#enddef
-
-
-records = []
-
-def FindOffset(funcName):
- for (name, alias, offset) in records:
- if name == funcName:
- return offset
- #endif
- #endfor
- return -1
-#enddef
-
-
-def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset):
- if alias == '':
- dispatchName = name
- else:
- dispatchName = alias
- if offset < 0:
- offset = FindOffset(dispatchName)
- if offset >= 0 and string.find(name, "unused") == -1:
- print '\tgl%s' % (name)
- # save this info in case we need to look up an alias later
- records.append((name, dispatchName, offset))
-
-#enddef
-
-
-PrintHead()
-apiparser.ProcessSpecFile("APIspec", EmitEntry)
-PrintTail()
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/next_available_offset.sh b/nx-X11/extras/Mesa/src/mesa/glapi/next_available_offset.sh
deleted file mode 100755
index e7d6c2f4a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/next_available_offset.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env bash
-#
-# (C) Copyright IBM Corporation 2004
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-# Trivial shell script to search the API definition file and print out the
-# next numerically available API entry-point offset. This could probably
-# be made smarter, but it would be better to use the existin Python
-# framework to do that. This is just a quick-and-dirty hack.
-
-num=$(grep 'offset="' gl_API.xml |\
- sed 's/.\+ offset="//g;s/".*$//g' |\
- grep -v '?' |\
- sort -rn |\
- head -1)
-
-echo $((num + 1))
diff --git a/nx-X11/extras/Mesa/src/mesa/glapi/typeexpr.py b/nx-X11/extras/Mesa/src/mesa/glapi/typeexpr.py
deleted file mode 100644
index eface2a52..000000000
--- a/nx-X11/extras/Mesa/src/mesa/glapi/typeexpr.py
+++ /dev/null
@@ -1,288 +0,0 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import string, copy
-
-class type_node:
- def __init__(self):
- self.pointer = 0
- self.const = 0
- self.signed = 1
- self.integer = 1
-
- # If elements is set to non-zero, then field is an array.
- self.elements = 0
-
- self.name = None
- self.size = 0
- return
-
-
- def string(self):
- s = ""
-
- if self.pointer:
- s = "* "
-
- if self.const:
- s += "const "
-
- if not self.pointer:
- if self.integer:
- if self.signed:
- s += "signed "
- else:
- s += "unsigned "
-
- if self.name:
- s += "%s " % (self.name)
-
- return s
-
-
-class type_table:
- def __init__(self):
- self.types_by_name = {}
- return
-
-
- def add_type(self, type_expr):
- self.types_by_name[ type_expr.get_base_name() ] = type_expr
- return
-
-
- def find_type(self, name):
- if name in self.types_by_name:
- return self.types_by_name[ name ]
- else:
- return None
-
-
-def create_initial_types():
- tt = type_table()
-
- basic_types = [ ["char", 1, 1], \
- ["short", 2, 1], \
- ["int", 4, 1], \
- ["long", 4, 1], \
- ["float", 4, 0], \
- ["double", 8, 0], \
- ["enum", 4, 1] ]
-
-
- for [type_name, type_size, integer] in basic_types:
- te = type_expression(None)
- tn = type_node()
- tn.name = type_name
- tn.size = type_size
- tn.integer = integer
- te.expr.append(tn)
- tt.add_type( te )
-
- type_expression.built_in_types = tt
- return
-
-
-class type_expression:
- built_in_types = None
-
- def __init__(self, type_string, extra_types = None):
- self.expr = []
-
- if not type_string: return
-
- self.original_string = type_string
-
- if not type_expression.built_in_types:
- raise RuntimeError("create_initial_types must be called before creating type_expression objects.")
-
-
- elements = string.split( string.replace( type_string, "*", " * " ) )
-
- const = 0
- t = None
- signed = 0
- unsigned = 0
-
- for i in elements:
- if i == "const":
- if t and t.pointer:
- t.const = 1
- else:
- const = 1
- elif i == "signed":
- signed = 1
- elif i == "unsigned":
- unsigned = 1
- elif i == "*":
- # This is a quirky special-case because of the
- # way the C works for types. If 'unsigned' is
- # specified all by itself, it is treated the
- # same as "unsigned int".
-
- if unsigned:
- self.set_base_type( "int", signed, unsigned, const, extra_types )
- const = 0
- signed = 0
- unsigned = 0
-
- if not self.expr:
- raise RuntimeError("Invalid type expression (dangling pointer)")
-
- if signed:
- raise RuntimeError("Invalid type expression (signed / unsigned applied to pointer)")
-
- t = type_node()
- t.pointer = 1
- self.expr.append( t )
- else:
- if self.expr:
- raise RuntimeError('Invalid type expression (garbage after pointer qualifier -> "%s")' % (self.original_string))
-
- self.set_base_type( i, signed, unsigned, const, extra_types )
- const = 0
- signed = 0
- unsigned = 0
-
- if signed and unsigned:
- raise RuntimeError("Invalid type expression (both signed and unsigned specified)")
-
-
- if const:
- raise RuntimeError("Invalid type expression (dangling const)")
-
- if unsigned:
- raise RuntimeError("Invalid type expression (dangling signed)")
-
- if signed:
- raise RuntimeError("Invalid type expression (dangling unsigned)")
-
- return
-
-
- def set_base_type(self, type_name, signed, unsigned, const, extra_types):
- te = type_expression.built_in_types.find_type( type_name )
- if not te:
- te = extra_types.find_type( type_name )
-
- if not te:
- raise RuntimeError('Unknown base type "%s".' % (type_name))
-
- self.expr = copy.deepcopy(te.expr)
-
- t = self.expr[ len(self.expr) - 1 ]
- t.const = const
- if signed:
- t.signed = 1
- elif unsigned:
- t.signed = 0
-
-
- def set_base_type_node(self, tn):
- self.expr = [tn]
- return
-
-
- def set_elements(self, count):
- tn = self.expr[0]
-
- tn.elements = count
- return
-
-
- def string(self):
- s = ""
- for t in self.expr:
- s += t.string()
-
- return s
-
-
- def get_base_type_node(self):
- return self.expr[0]
-
-
- def get_base_name(self):
- if len(self.expr):
- return self.expr[0].name
- else:
- return None
-
-
- def get_element_size(self):
- tn = self.expr[0]
-
- if tn.elements:
- return tn.elements * tn.size
- else:
- return tn.size
-
-
- def get_element_count(self):
- tn = self.expr[0]
- return tn.elements
-
-
- def get_stack_size(self):
- tn = self.expr[ len(self.expr) - 1 ]
-
- if tn.elements or tn.pointer:
- return 4
- elif not tn.integer:
- return tn.size
- else:
- return 4
-
-
- def is_pointer(self):
- tn = self.expr[ len(self.expr) - 1 ]
- return tn.pointer
-
-
- def format_string(self):
- tn = self.expr[ len(self.expr) - 1 ]
- if tn.pointer:
- return "%p"
- elif not tn.integer:
- return "%f"
- else:
- return "%d"
-
-
-
-if __name__ == '__main__':
-
- types_to_try = [ "int", "int *", "const int *", "int * const", "const int * const", \
- "unsigned * const *", \
- "float", "const double", "double * const"]
-
- create_initial_types()
-
- for t in types_to_try:
- print 'Trying "%s"...' % (t)
- te = type_expression( t )
- print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size())
diff --git a/nx-X11/extras/Mesa/src/mesa/main/Imakefile b/nx-X11/extras/Mesa/src/mesa/main/Imakefile
deleted file mode 100644
index fe0658c6c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/Imakefile
+++ /dev/null
@@ -1,129 +0,0 @@
-#define DoNormalLib NO
-#define DoSharedLib YES
-#define DoDebugLib NO
-#define DoProfileLib NO
-#define LibName MESAGL
-#define SoRev SOX11REV
-#define LibHeaders NO
-
-#include <Threads.tmpl>
-
-REQUIREDLIBS = $(X11ROOT)\\XFree86\\lib\\ Xext X11
-BUILDLIBDIR = $(TOP)\\lib
-
-INCLUDES = -I$(TOP)\\include
-
-SRCS = \
-accum.c \
-alpha.c \
-alphabuf.c \
-api1.c \
-api2.c \
-attrib.c \
-bitmap.c \
-blend.c \
-bresenhm.c \
-clip.c \
-context.c \
-copypix.c \
-dd.c \
-depth.c \
-draw.c \
-drawpix.c \
-enable.c \
-eval2.c \
-feedback.c \
-fog.c \
-fortran.c \
-get.c \
-hash.c \
-glx.c \
-interp.c \
-light.c \
-lines.c \
-list.c \
-logic.c \
-masking.c \
-misc.c \
-osmesa.c \
-pb.c \
-pixel.c \
-points.c \
-polygons.c \
-readpix.c \
-scissor.c \
-span.c \
-stencil.c \
-svgamesa.c \
-texture.c \
-varray.c \
-vb.c \
-vertex.c \
-xfonts.c \
-xform.c \
-xm_api.c \
-xm_dd.c \
-xm_line.c \
-xm_span.c \
-xm_tri.c
-
-OBJS = \
-accum.o \
-alpha.o \
-alphabuf.o \
-api1.o \
-api2.o \
-attrib.o \
-bitmap.o \
-blend.o \
-bresenhm.o \
-clip.o \
-context.o \
-copypix.o \
-dd.o \
-depth.o \
-draw.o \
-drawpix.o \
-enable.o \
-eval2.o \
-feedback.o \
-fog.o \
-fortran.o \
-get.o \
-hash.o \
-glx.o \
-interp.o \
-light.o \
-lines.o \
-list.o \
-logic.o \
-masking.o \
-misc.o \
-osmesa.o \
-pb.o \
-pixel.o \
-points.o \
-polygons.o \
-readpix.o \
-scissor.o \
-span.o \
-stencil.o \
-svgamesa.o \
-texture.o \
-varray.o \
-vb.o \
-vertex.o \
-xfonts.o \
-xform.o \
-xm_api.o \
-xm_dd.o \
-xm_line.o \
-xm_span.o \
-xm_tri.o
-
-LINTLIBS =
-
-#include <Library.tmpl>
-
-DependTarget()
-
diff --git a/nx-X11/extras/Mesa/src/mesa/main/KNOWN_BUGS b/nx-X11/extras/Mesa/src/mesa/main/KNOWN_BUGS
deleted file mode 100644
index efbb0ca40..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/KNOWN_BUGS
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-Performance issues with EXT_point_parameters & quake2
-
-
-
-Using glPolygonMode() where the front and back modes aren't the
-same causes poor performance on 3Dfx.
-
-
-
-Broken drivers: some of the Mesa device drivers (such as BeOS, D3D,
-etc) haven't been updated for Mesa 3.3's device driver changes.
-
-
-
-glDrawRangeElements() should use vertex array locking to improve performance
-but trying to do so causes a rendering error. Reported by Scott McMillan.
-Fixed by disabling locking in glDrawRangeElements (varray.c) but that's
-really just hiding a bug in array locking.
-
diff --git a/nx-X11/extras/Mesa/src/mesa/main/Makefile.ugl b/nx-X11/extras/Mesa/src/mesa/main/Makefile.ugl
deleted file mode 100644
index b440e1364..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/Makefile.ugl
+++ /dev/null
@@ -1,364 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 4.1
-#
-# Copyright (C) 2001 Wind River Systems, Inc
-
-# The MIT License
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-
-# Makefile for core library
-
-# This makefile can moved all objects files in MESA_OBJ for use with
-# ld in windShell or create a library from objects files in their
-# associated .c folder.
-#
-# For an easy inclusion of lib$(CPU)$(TOOL)GL.a in vxworks image, this
-# makefile collects together all .o in an only file
-# (obj$(CPU)$(TOOL)GL.o). This operation is unnecessary for
-# lib$(CPU)$(TOOL)OSMesa.a and lib$(CPU)$(TOOL)UglMesa.a because they
-# already contain only one file.
-#
-##### MACROS #####
-MESA_MAJOR=4
-MESA_MINOR=1
-MESA_TINY=0
-VERSION=$(MESA_MAJOR).$(MESA_MINOR)
-
-GL_MAJOR = 1
-GL_MINOR = 2
-GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
-
-##### RULES #####
-
-include ..\rules.windml
-
-#### GL #####
-
-GL_SOURCES = \
- api_arrayelt.c \
- api_loopback.c \
- api_noop.c \
- api_validate.c \
- accum.c \
- arbprogram.c \
- attrib.c \
- blend.c \
- bufferobj.c \
- buffers.c \
- clip.c \
- colortab.c \
- context.c \
- convolve.c \
- debug.c \
- depth.c \
- dispatch.c \
- dlist.c \
- drawpix.c \
- enable.c \
- enums.c \
- eval.c \
- extensions.c \
- feedback.c \
- fog.c \
- get.c \
- glapi.c \
- glthread.c \
- hash.c \
- hint.c \
- histogram.c \
- image.c \
- imports.c \
- light.c \
- lines.c \
- matrix.c \
- pixel.c \
- points.c \
- polygon.c \
- rastpos.c \
- state.c \
- stencil.c \
- texcompress.c \
- texformat.c \
- teximage.c \
- texobj.c \
- texstate.c \
- texstore.c \
- texutil.c \
- varray.c \
- vtxfmt.c \
- X86/x86.c \
- X86/common_x86.c \
- X86/3dnow.c \
- X86/sse.c \
- math/m_debug_clip.c \
- math/m_debug_norm.c \
- math/m_debug_vertex.c \
- math/m_debug_xform.c \
- math/m_eval.c \
- math/m_matrix.c \
- math/m_translate.c \
- math/m_vector.c \
- math/m_vertices.c \
- math/m_xform.c \
- array_cache/ac_context.c \
- array_cache/ac_import.c \
- swrast/s_aaline.c \
- swrast/s_aatriangle.c \
- swrast/s_accum.c \
- swrast/s_alpha.c \
- swrast/s_alphabuf.c \
- swrast/s_bitmap.c \
- swrast/s_blend.c \
- swrast/s_buffers.c \
- swrast/s_copypix.c \
- swrast/s_context.c \
- swrast/s_depth.c \
- swrast/s_drawpix.c \
- swrast/s_feedback.c \
- swrast/s_fog.c \
- swrast/s_imaging.c \
- swrast/s_lines.c \
- swrast/s_logic.c \
- swrast/s_masking.c \
- swrast/s_pixeltex.c \
- swrast/s_points.c \
- swrast/s_readpix.c \
- swrast/s_span.c \
- swrast/s_stencil.c \
- swrast/s_texture.c \
- swrast/s_texstore.c \
- swrast/s_triangle.c \
- swrast/s_zoom.c \
- swrast_setup/ss_context.c \
- swrast_setup/ss_triangle.c \
- swrast_setup/ss_vb.c \
- tnl/t_array_api.c \
- tnl/t_array_import.c \
- tnl/t_context.c \
- tnl/t_eval_api.c \
- tnl/t_imm_alloc.c \
- tnl/t_imm_api.c \
- tnl/t_imm_debug.c \
- tnl/t_imm_dlist.c \
- tnl/t_imm_elt.c \
- tnl/t_imm_eval.c \
- tnl/t_imm_exec.c \
- tnl/t_imm_fixup.c \
- tnl/t_pipeline.c \
- tnl/t_vb_fog.c \
- tnl/t_vb_light.c \
- tnl/t_vb_normals.c \
- tnl/t_vb_points.c \
- tnl/t_vb_render.c \
- tnl/t_vb_texgen.c \
- tnl/t_vb_texmat.c \
- tnl/t_vb_vertex.c
-
-GL_OBJECTS = $(GL_SOURCES:.c=.o)
-GL_OBJNAME = $(MESA_LIBDIR)/objMesaGL.o
-
-#### X86 #####
-
-x86_files = \
- X86/common_x86_asm.S \
- X86/glapi_x86.S \
- X86/x86_cliptest.S \
- X86/x86_vertex.S \
- X86/x86_xform2.S \
- X86/x86_xform3.S \
- X86/x86_xform4.S \
-
-x3dnow_files = \
- X86/3dnow_normal.S \
- X86/3dnow_vertex.S \
- X86/3dnow_xform1.S \
- X86/3dnow_xform2.S \
- X86/3dnow_xform3.S \
- X86/3dnow_xform4.S
-
-sse_files = \
- X86/sse_normal.S \
- X86/sse_vertex.S \
- X86/sse_xform1.S \
- X86/sse_xform2.S \
- X86/sse_xform3.S \
- X86/sse_xform4.S
-
-mmx_files = X86/mmx_blend.S
-
-X86_OBJNAME = $(MESA_LIBDIR)/objMesaX86.o
-
-##### UGL #####
-
-UGL_SOURCES = \
- windml/ugl_api.c \
- windml/ugl_dd.c \
- windml/ugl_span.c \
- windml/ugl_line.c \
- windml/ugl_tri.c \
- windml/tornado/torMesaUGLInit.c
-
-UGL_OBJECTS = $(UGL_SOURCES:.c=.o)
-UGL_OBJNAME = $(MESA_LIBDIR)/objMesaUGL.o
-
-##### OS #####
-
-OS_SOURCES = OSmesa/osmesa.c windml/tornado/torMesaOSInit.c
-OS_OBJECTS = $(OS_SOURCES:.c=.o)
-OS_OBJNAME = $(MESA_LIBDIR)/objMesaOS.o
-
-##### GLUTSHAPES #####
-
-GLUTSHAPES_SOURCES = \
- windml/ugl_glutshapes.c \
- windml/tornado/torGLUTShapesInit.c
-
-GLUTSHAPES_OBJECTS = $(GLUTSHAPES_SOURCES:.c=.o)
-GLUTSHAPES_OBJNAME = $(MESA_LIBDIR)/objGLUTShapes.o
-
-SOURCES = $(GL_SOURCES) $(UGL_SOURCES) $(OS_SOURCES) \
- $(GLUTSHAPES_SOURCES)
-
-##### TARGETS #####
-
-all: depend.$(CPU)$(TOOL) cfgX86 $(X86_OBJNAME) $(GL_OBJNAME)\
-$(UGL_OBJNAME) $(OS_OBJNAME) $(GLUTSHAPES_OBJNAME)
-
-#histogram.o:
-# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $<
-
-#image.o:
-# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $<
-
-cfgX86:
-ifdef HAVE_3DNOW
-x3dnow_sources = $(x3dnow_files)
-CFLAGS_3DNOW = -DUSE_3DNOW_ASM
-HAVE_X86 = 1
-endif
-ifdef HAVE_SSE
-sse_sources = $(sse_files)
-CFLAGS_SSE = -DUSE_SSE_ASM
-HAVE_X86 = 1
-endif
-ifdef HAVE_MMX
-mmx_sources = $(mmx_files)
-CFLAGS_MMX = -DUSE_MMX_ASM
-HAVE_X86 = 1
-endif
-ifdef HAVE_X86
-x86_sources = $(x86_files)
-CFLAGS_X86 = -DUSE_X86_ASM
-endif
-X86_SOURCES = $(x86_sources) $(mmx_sources) \
- $(x3dnow_sources) $(sse_sources)
-X86_OBJECTS = $(X86_SOURCES:.S=.o)
-CFLAGS_USE_X86 = $(CFLAGS_3DNOW) $(CFLAGS_SSE) $(CFLAGS_MMX) $(CFLAGS_X86)
-
-#X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c
-# $(CC) -I ./ X86/gen_matypes.c -o X86/gen_matypes
-# ./X86/gen_matypes > X86/matypes.h
-# $(RM) X86/gen_matypes
-# $(RM) X86/gen_matypes.o
-
-# Make the Mesax86 library
-$(X86_OBJNAME): $(X86_OBJECTS)
-ifdef HAVE_X86
-# $(LD) -r $(X86_OBJECTS) -o $(MESA_OBJNAME)
- $(LD) -r $(X86_OBJECTS) -o $(X86_OBJNAME)
-# $(AR) rus $(MESA_LIBNAME) $(X86_OBJNAME)
-# $(RM) $(X86_OBJNAME)
-endif
-
-# Make the GL library
-$(GL_OBJNAME): $(GL_OBJECTS)
-# $(LD) -r $(GL_OBJECTS) -o $(MESA_OBJNAME)
- $(LD) -r $(GL_OBJECTS) -o $(GL_OBJNAME)
-# $(AR) rus $(MESA_LIBNAME) $(GL_OBJNAME)
-# $(AR) rus $(VX_LIBNAME) $(GL_OBJNAME)
-# $(RM) $(GL_OBJNAME)
-
-# Make the UGLMesa library
-$(UGL_OBJNAME): $(UGL_OBJECTS)
-# $(LD) -r $(UGL_OBJECTS) -o $(MESA_OBJNAME)
- $(LD) -r $(UGL_OBJECTS) -o $(UGL_OBJNAME)
-# $(AR) rus $(MESA_LIBNAME) $(UGL_OBJNAME)
-# $(AR) rus $(VX_LIBNAME) $(UGL_OBJNAME)
-# $(RM) $(UGL_OBJNAME)
-
-# Make the OSMesa library
-$(OS_OBJNAME): $(OS_OBJECTS)
-# $(LD) -r $(OS_OBJECTS) -o $(MESA_OBJNAME)
- $(LD) -r $(OS_OBJECTS) -o $(OS_OBJNAME)
-# $(AR) rus $(MESA_LIBNAME) $(OS_OBJNAME)
-# $(AR) rus $(VX_LIBNAME) $(OS_OBJNAME)
-# $(RM) $(OS_OBJNAME)
-
-# Make the GLUT Shapes library
-$(GLUTSHAPES_OBJNAME): $(GLUTSHAPES_OBJECTS)
-# $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(MESA_OBJNAME)
- $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(GLUTSHAPES_OBJNAME)
-# $(AR) rus $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME)
-# $(AR) rus $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME)
-# $(RM) $(GLUTSHAPES_OBJNAME)
-
-depend.$(CPU)$(TOOL):
-ifeq ($(WIND_HOST_TYPE),x86-win32)
- @ $(RM) $@
- @ $(ECHO) Creating depend.$(CPU)$(TOOL)
-ifneq ($(SOURCES),)
- @ for %f in ($(SOURCES)) do \
- $(CC) -MM $(CFLAGS) %f >>$@
-endif
-else
-Makefile
- @ $(RM) $@
- @ $(ECHO) "Creating depend.$(CPU)$(TOOL)"
-ifneq ($(SOURCES),)
- @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \
- do \
- $(CC) -MM $(CFLAGS) $$FILE \
- | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \
- done
-endif
-endif
-
-.PHONY = clean
-
-clean:
-# $(AR) d $(MESA_LIBNAME) $(GL_OBJNAME)
-# $(AR) d $(MESA_LIBNAME) $(UGL_OBJNAME)
-# $(AR) d $(MESA_LIBNAME) $(OS_OBJNAME)
-# $(AR) d $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME)
-# $(AR) d $(VX_LIBNAME) $(GL_OBJNAME)
-# $(AR) d $(VX_LIBNAME) $(UGL_OBJNAME)
-# $(AR) d $(VX_LIBNAME) $(OS_OBJNAME)
-# $(AR) d $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME)
- $(RM) $(GL_OBJECTS)
- $(RM) $(UGL_OBJECTS)
- $(RM) $(OS_OBJECTS)
- $(RM) $(GLUTSHAPES_OBJECTS)
- $(RM) $(GL_OBJNAME)
- $(RM) $(UGL_OBJNAME)
- $(RM) $(OS_OBJNAME)
- $(RM) $(GLUTSHAPES_OBJNAME)
- $(RM) depend.$(CPU)$(TOOL)
-
-include depend.$(CPU)$(TOOL)
-
diff --git a/nx-X11/extras/Mesa/src/mesa/main/Makefile.win b/nx-X11/extras/Mesa/src/mesa/main/Makefile.win
deleted file mode 100644
index a27f44c11..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/Makefile.win
+++ /dev/null
@@ -1,208 +0,0 @@
-# Makefile for Win32
-#
-# NOTE: the install target may overwrite important files in the system dirs
-# Check first, before making the install target.
-#
-# This builds both the osmesa and Windows drivers.
-#
-
-!include <win32.mak>
-
-TOP = ..
-SUBDIRS = osmesa.dir
-
-CORE_SRCS = \
- api_loopback.c \
- api_noop.c \
- api_validate.c \
- accum.c \
- arbprogram.c \
- attrib.c \
- blend.c \
- bufferobj.c \
- buffers.c \
- clip.c \
- colortab.c \
- context.c \
- convolve.c \
- debug.c \
- depth.c \
- dispatch.c \
- dlist.c \
- drawpix.c \
- enable.c \
- enums.c \
- eval.c \
- extensions.c \
- feedback.c \
- fog.c \
- get.c \
- glapi.c \
- glthread.c \
- hash.c \
- hint.c \
- histogram.c \
- image.c \
- imports.c \
- light.c \
- lines.c \
- matrix.c \
- nvprogram.c \
- nvfragparse.c \
- nvvertexec.c \
- nvvertparse.c \
- pixel.c \
- points.c \
- polygon.c \
- rastpos.c \
- state.c \
- stencil.c \
- texcompress.c \
- texcompress_fxt1.c \
- texcompress_s3tc.c \
- teximage.c \
- texformat.c \
- texobj.c \
- texstate.c \
- texstore.c \
- varray.c \
- vtxfmt.c \
-# X86\x86.c \
-# X86\common_x86.c \
-# X86\3dnow.c \
-# X86\sse.c \
- math\m_debug_norm.c \
- math\m_debug_xform.c \
- math\m_eval.c \
- math\m_matrix.c \
- math\m_translate.c \
- math\m_vector.c \
- math\m_xform.c \
- array_cache\ac_context.c \
- array_cache\ac_import.c \
- swrast\s_aaline.c \
- swrast\s_aatriangle.c \
- swrast\s_accum.c \
- swrast\s_alpha.c \
- swrast\s_alphabuf.c \
- swrast\s_bitmap.c \
- swrast\s_blend.c \
- swrast\s_buffers.c \
- swrast\s_copypix.c \
- swrast\s_context.c \
- swrast\s_depth.c \
- swrast\s_drawpix.c \
- swrast\s_feedback.c \
- swrast\s_fog.c \
- swrast\s_imaging.c \
- swrast\s_lines.c \
- swrast\s_logic.c \
- swrast\s_masking.c \
- swrast\s_nvfragprog.c \
- swrast\s_pixeltex.c \
- swrast\s_points.c \
- swrast\s_readpix.c \
- swrast\s_span.c \
- swrast\s_stencil.c \
- swrast\s_texstore.c \
- swrast\s_texture.c \
- swrast\s_triangle.c \
- swrast\s_zoom.c \
- swrast_setup\ss_context.c \
- swrast_setup\ss_triangle.c \
- swrast_setup\ss_vb.c \
- tnl\t_array_api.c \
- tnl\t_array_import.c \
- tnl\t_context.c \
- tnl\t_eval_api.c \
- tnl\t_imm_alloc.c \
- tnl\t_imm_api.c \
- tnl\t_imm_debug.c \
- tnl\t_imm_dlist.c \
- tnl\t_imm_elt.c \
- tnl\t_imm_eval.c \
- tnl\t_imm_exec.c \
- tnl\t_imm_fixup.c \
- tnl\t_pipeline.c \
- tnl\t_vb_fog.c \
- tnl\t_vb_light.c \
- tnl\t_vb_normals.c \
- tnl\t_vb_points.c \
- tnl\t_vb_program.c \
- tnl\t_vb_render.c \
- tnl\t_vb_texgen.c \
- tnl\t_vb_texmat.c \
- tnl\t_vb_vertex.c
-
-DRIVER_SRCS = \
- Trace\tr_context.c \
- Trace\tr_control.c \
- Trace\tr_error.c \
- Trace\tr_support.c \
- Trace\tr_wrapper.c \
- Trace\tr_write.c \
- Windows\wgl.c \
- Windows\wmesa.c
-
-ASM_SRCS =
-
-SRCS = $(CORE_SRCS) $(DRIVER_SRCS)
-
-all : mesadll $(SUBDIRS)
-
-!include "$(TOP)/mesawin32.mak"
-
-mesadll : $(MESADLL)
-
-CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO
-!IFNDEF NODEBUG
-CFLAGS = $(CFLAGS) -DMESA_DEBUG
-!ENDIF
-LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS)
-
-OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj)
-LIBS = winmm.lib $(guilibsdll)
-
-$(MESADLL) : $(OBJS) mesa.def
- $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS)
- @echo "copying Mesa dynamic link library to lib directory..."
- -copy $(MESADLL) ..\lib
- @echo "copying Mesa import library to lib directory..."
- -copy $(MESALIB) ..\lib
-
-$(SUBDIRS) :
- @echo.
- @echo Making in $* directory
- @cd $*
- @nmake -f Makefile.win -nologo
- @cd ..
-
-install : $(MESADLL)
- @echo.
- @echo "copying Mesa dynamic link library to system directory..."
- -copy $(MESADLL) $(DLLINSTALL)
- @echo "copying Mesa header files to include directory..."
- -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL)
- -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL)
- @echo "copying Mesa import library to library directory..."
- -copy $(MESALIB) $(LIBINSTALL)
-
-clean ::
- @del /f tnl\*.obj
- @del /f swrast_setup\*.obj
- @del /f math\*.obj
- @del /f array_cache\*.obj
- @del /f swrast\*.obj
- @del /f Trace\*.obj
- @del /f osmesa\*.obj
- @del /f Windows\*.obj
-
-clobber ::
- @del /f OSmesa\*.lib
- @del /f OSmesa\*.exp
- @del /f OSmesa\*.dll
-
-# override default inference rule with one that writes the object to
-# the same subdir that the c file is in.
-.c.obj :
- $(cc) $(CFLAGS) -I. $< /Fo$*.obj
diff --git a/nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h.NX.original b/nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h.NX.original
deleted file mode 100644
index b4d805d6d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h.NX.original
+++ /dev/null
@@ -1,24 +0,0 @@
-/**************************************************************************/
-/* */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
-/* */
-/* NXAGENT, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present */
-/* software is allowed according to terms specified in the file LICENSE */
-/* which comes in the source distribution. */
-/* */
-/* Check http://www.nomachine.com/licensing.html for applicability. */
-/* */
-/* NX and NoMachine are trademarks of Medialogic S.p.A. */
-/* */
-/* All rights reserved. */
-/* */
-/**************************************************************************/
-
-typedef struct _WSDrawBufferRec {
- GLframebuffer *DrawBuffer;
- struct _WSDrawBufferRec *next;
-} WSDrawBufferRec, *WSDrawBufferPtr;
-
-WSDrawBufferPtr pWSDrawBuffer;
-
diff --git a/nx-X11/extras/Mesa/src/mesa/main/context.c.NX.original b/nx-X11/extras/Mesa/src/mesa/main/context.c.NX.original
deleted file mode 100644
index eb4b4ce4e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/context.c.NX.original
+++ /dev/null
@@ -1,1818 +0,0 @@
-/**
- * \file context.c
- * Mesa context/visual/framebuffer management functions.
- * \author Brian Paul
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.4
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \mainpage Mesa Main Module
- *
- * \section MainIntroduction Introduction
- *
- * The Mesa Main module consists of all the files in the main/ directory.
- * Among the features of this module are:
- * <UL>
- * <LI> Structures to represent most GL state </LI>
- * <LI> State set/get functions </LI>
- * <LI> Display lists </LI>
- * <LI> Texture unit, object and image handling </LI>
- * <LI> Matrix and attribute stacks </LI>
- * </UL>
- *
- * Other modules are responsible for API dispatch, vertex transformation,
- * point/line/triangle setup, rasterization, vertex array caching,
- * vertex/fragment programs/shaders, etc.
- *
- *
- * \section AboutDoxygen About Doxygen
- *
- * If you're viewing this information as Doxygen-generated HTML you'll
- * see the documentation index at the top of this page.
- *
- * The first line lists the Mesa source code modules.
- * The second line lists the indexes available for viewing the documentation
- * for each module.
- *
- * Selecting the <b>Main page</b> link will display a summary of the module
- * (this page).
- *
- * Selecting <b>Data Structures</b> will list all C structures.
- *
- * Selecting the <b>File List</b> link will list all the source files in
- * the module.
- * Selecting a filename will show a list of all functions defined in that file.
- *
- * Selecting the <b>Data Fields</b> link will display a list of all
- * documented structure members.
- *
- * Selecting the <b>Globals</b> link will display a list
- * of all functions, structures, global variables and macros in the module.
- *
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "accum.h"
-#include "attrib.h"
-#include "blend.h"
-#include "buffers.h"
-#include "bufferobj.h"
-#include "colortab.h"
-#include "context.h"
-#include "debug.h"
-#include "depth.h"
-#include "dlist.h"
-#include "eval.h"
-#include "enums.h"
-#include "extensions.h"
-#include "fbobject.h"
-#include "feedback.h"
-#include "fog.h"
-#include "get.h"
-#include "glthread.h"
-#include "glapioffsets.h"
-#include "histogram.h"
-#include "hint.h"
-#include "hash.h"
-#include "light.h"
-#include "lines.h"
-#include "macros.h"
-#include "matrix.h"
-#include "occlude.h"
-#include "pixel.h"
-#include "points.h"
-#include "polygon.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "program.h"
-#endif
-#include "rastpos.h"
-#include "simple_list.h"
-#include "state.h"
-#include "stencil.h"
-#include "texcompress.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "texstate.h"
-#include "mtypes.h"
-#include "varray.h"
-#include "version.h"
-#include "vtxfmt.h"
-#if _HAVE_FULL_GL
-#include "math/m_translate.h"
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-#include "math/mathmod.h"
-#endif
-#include "shaderobjects.h"
-
-#ifdef NXAGENT_SERVER
-#include "WSDrawBuffer.h"
-#endif
-
-#ifdef USE_SPARC_ASM
-#include "sparc/sparc.h"
-#endif
-
-#ifndef MESA_VERBOSE
-int MESA_VERBOSE = 0;
-#endif
-
-#ifndef MESA_DEBUG_FLAGS
-int MESA_DEBUG_FLAGS = 0;
-#endif
-
-#ifdef NXAGENT_SERVER
-extern WSDrawBufferPtr pWSDrawBuffer;
-
-int IsWSDrawBuffer(GLframebuffer *mesa_buffer)
-{
- WSDrawBufferPtr p = pWSDrawBuffer;
-
- while (p != NULL) {
- if (p -> DrawBuffer == mesa_buffer) {
- return 1;
- }
- p = p -> next;
- }
- return 0;
-}
-
-void FreeWSDrawBuffer(GLframebuffer *mesa_buffer)
-{
- WSDrawBufferPtr p = pWSDrawBuffer;
- WSDrawBufferPtr pOld = NULL;
-
- if (p == NULL)
- return;
-
- if (p -> DrawBuffer == mesa_buffer) {
- pWSDrawBuffer = p -> next;
- free(p);
- return;
- }
-
- while (p -> next != NULL) {
- if (p -> next -> DrawBuffer == mesa_buffer) {
- pOld = p -> next;
- p -> next = p -> next -> next;
- free(pOld);
- return;
- }
- p = p -> next;
- }
-}
-#endif
-
-/* ubyte -> float conversion */
-GLfloat _mesa_ubyte_to_float_color_tab[256];
-
-static void
-free_shared_state( GLcontext *ctx, struct gl_shared_state *ss );
-
-
-/**********************************************************************/
-/** \name OpenGL SI-style interface (new in Mesa 3.5)
- *
- * \if subset
- * \note Most of these functions are never called in the Mesa subset.
- * \endif
- */
-/*@{*/
-
-/**
- * Destroy context callback.
- *
- * \param gc context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::destroyCurrent) when
- * the rendering context is to be destroyed.
- * \endif
- *
- * Frees the context data and the context structure.
- */
-GLboolean
-_mesa_destroyContext(__GLcontext *gc)
-{
- if (gc) {
- _mesa_free_context_data(gc);
- _mesa_free(gc);
- }
- return GL_TRUE;
-}
-
-/**
- * Unbind context callback.
- *
- * \param gc context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::loseCurrent)
- * when the rendering context is made non-current.
- * \endif
- *
- * No-op
- */
-GLboolean
-_mesa_loseCurrent(__GLcontext *gc)
-{
- /* XXX unbind context from thread */
- (void) gc;
- return GL_TRUE;
-}
-
-/**
- * Bind context callback.
- *
- * \param gc context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::makeCurrent)
- * when the rendering context is made current.
- * \endif
- *
- * No-op
- */
-GLboolean
-_mesa_makeCurrent(__GLcontext *gc)
-{
- /* XXX bind context to thread */
- (void) gc;
- return GL_TRUE;
-}
-
-/**
- * Share context callback.
- *
- * \param gc context.
- * \param gcShare shared context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::shareContext)
- * \endif
- *
- * Update the shared context reference count, gl_shared_state::RefCount.
- */
-GLboolean
-_mesa_shareContext(__GLcontext *gc, __GLcontext *gcShare)
-{
- if (gc && gcShare && gc->Shared && gcShare->Shared) {
- gc->Shared->RefCount--;
- if (gc->Shared->RefCount == 0) {
- free_shared_state(gc, gc->Shared);
- }
- gc->Shared = gcShare->Shared;
- gc->Shared->RefCount++;
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-#if _HAVE_FULL_GL
-/**
- * Copy context callback.
- */
-GLboolean
-_mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask)
-{
- if (dst && src) {
- _mesa_copy_context( src, dst, mask );
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-#endif
-
-/** No-op */
-GLboolean
-_mesa_forceCurrent(__GLcontext *gc)
-{
- (void) gc;
- return GL_TRUE;
-}
-
-/**
- * Windows/buffer resizing notification callback.
- *
- * \param gc GL context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- */
-GLboolean
-_mesa_notifyResize(__GLcontext *gc)
-{
- GLint x, y;
- GLuint width, height;
- __GLdrawablePrivate *d = gc->imports.getDrawablePrivate(gc);
- if (!d || !d->getDrawableSize)
- return GL_FALSE;
- d->getDrawableSize( d, &x, &y, &width, &height );
- /* update viewport, resize software buffers, etc. */
- return GL_TRUE;
-}
-
-/**
- * Window/buffer destruction notification callback.
- *
- * \param gc GL context.
- *
- * Called when the context's window/buffer is going to be destroyed.
- *
- * No-op
- */
-void
-_mesa_notifyDestroy(__GLcontext *gc)
-{
- /* Unbind from it. */
- (void) gc;
-}
-
-/**
- * Swap buffers notification callback.
- *
- * \param gc GL context.
- *
- * Called by window system just before swapping buffers.
- * We have to finish any pending rendering.
- */
-void
-_mesa_notifySwapBuffers(__GLcontext *gc)
-{
- FLUSH_VERTICES( gc, 0 );
-}
-
-/** No-op */
-struct __GLdispatchStateRec *
-_mesa_dispatchExec(__GLcontext *gc)
-{
- (void) gc;
- return NULL;
-}
-
-/** No-op */
-void
-_mesa_beginDispatchOverride(__GLcontext *gc)
-{
- (void) gc;
-}
-
-/** No-op */
-void
-_mesa_endDispatchOverride(__GLcontext *gc)
-{
- (void) gc;
-}
-
-/**
- * \ifnot subset
- * Setup the exports.
- *
- * The window system will call these functions when it needs Mesa to do
- * something.
- *
- * \note Device drivers should override these functions! For example,
- * the Xlib driver should plug in the XMesa*-style functions into this
- * structure. The XMesa-style functions should then call the _mesa_*
- * version of these functions. This is an approximation to OO design
- * (inheritance and virtual functions).
- * \endif
- *
- * \if subset
- * No-op.
- *
- * \endif
- */
-static void
-_mesa_init_default_exports(__GLexports *exports)
-{
-#if _HAVE_FULL_GL
- exports->destroyContext = _mesa_destroyContext;
- exports->loseCurrent = _mesa_loseCurrent;
- exports->makeCurrent = _mesa_makeCurrent;
- exports->shareContext = _mesa_shareContext;
- exports->copyContext = _mesa_copyContext;
- exports->forceCurrent = _mesa_forceCurrent;
- exports->notifyResize = _mesa_notifyResize;
- exports->notifyDestroy = _mesa_notifyDestroy;
- exports->notifySwapBuffers = _mesa_notifySwapBuffers;
- exports->dispatchExec = _mesa_dispatchExec;
- exports->beginDispatchOverride = _mesa_beginDispatchOverride;
- exports->endDispatchOverride = _mesa_endDispatchOverride;
-#else
- (void) exports;
-#endif
-}
-
-/**
- * Exported OpenGL SI interface.
- */
-__GLcontext *
-__glCoreCreateContext(__GLimports *imports, __GLcontextModes *modes)
-{
- GLcontext *ctx;
-
- ctx = (GLcontext *) (*imports->calloc)(NULL, 1, sizeof(GLcontext));
- if (ctx == NULL) {
- return NULL;
- }
-
- /* XXX doesn't work at this time */
- _mesa_initialize_context(ctx, modes, NULL, NULL, NULL);
- ctx->imports = *imports;
-
- return ctx;
-}
-
-/**
- * Exported OpenGL SI interface.
- */
-void
-__glCoreNopDispatch(void)
-{
-#if 0
- /* SI */
- __gl_dispatch = __glNopDispatchState;
-#else
- /* Mesa */
- _glapi_set_dispatch(NULL);
-#endif
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name GL Visual allocation/destruction */
-/**********************************************************************/
-/*@{*/
-
-/**
- * Allocates a GLvisual structure and initializes it via
- * _mesa_initialize_visual().
- *
- * \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode.
- * \param dbFlag double buffering
- * \param stereoFlag stereo buffer
- * \param depthBits requested bits per depth buffer value. Any value in [0, 32]
- * is acceptable but the actual depth type will be GLushort or GLuint as
- * needed.
- * \param stencilBits requested minimum bits per stencil buffer value
- * \param accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits number of bits per color component in accum buffer.
- * \param indexBits number of bits per pixel if \p rgbFlag is GL_FALSE
- * \param redBits number of bits per color component in frame buffer for RGB(A)
- * mode. We always use 8 in core Mesa though.
- * \param greenBits same as above.
- * \param blueBits same as above.
- * \param alphaBits same as above.
- * \param numSamples not really used.
- *
- * \return pointer to new GLvisual or NULL if requested parameters can't be
- * met.
- *
- * \note Need to add params for level and numAuxBuffers (at least)
- */
-GLvisual *
-_mesa_create_visual( GLboolean rgbFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint indexBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples )
-{
- GLvisual *vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
- if (vis) {
- if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag,
- redBits, greenBits, blueBits, alphaBits,
- indexBits, depthBits, stencilBits,
- accumRedBits, accumGreenBits,
- accumBlueBits, accumAlphaBits,
- numSamples)) {
- FREE(vis);
- return NULL;
- }
- }
- return vis;
-}
-
-/**
- * Makes some sanity checks and fills in the fields of the
- * GLvisual object with the given parameters. If the caller needs
- * to set additional fields, he should just probably init the whole GLvisual
- * object himself.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \sa _mesa_create_visual() above for the parameter description.
- */
-GLboolean
-_mesa_initialize_visual( GLvisual *vis,
- GLboolean rgbFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint indexBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples )
-{
- assert(vis);
-
- if (depthBits < 0 || depthBits > 32) {
- return GL_FALSE;
- }
- if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
- return GL_FALSE;
- }
- if (accumRedBits < 0 || accumRedBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumGreenBits < 0 || accumGreenBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumBlueBits < 0 || accumBlueBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumAlphaBits < 0 || accumAlphaBits > ACCUM_BITS) {
- return GL_FALSE;
- }
-
- vis->rgbMode = rgbFlag;
- vis->doubleBufferMode = dbFlag;
- vis->stereoMode = stereoFlag;
-
- vis->redBits = redBits;
- vis->greenBits = greenBits;
- vis->blueBits = blueBits;
- vis->alphaBits = alphaBits;
- vis->rgbBits = redBits + greenBits + blueBits;
-
- vis->indexBits = indexBits;
- vis->depthBits = depthBits;
- vis->stencilBits = stencilBits;
-
- vis->accumRedBits = accumRedBits;
- vis->accumGreenBits = accumGreenBits;
- vis->accumBlueBits = accumBlueBits;
- vis->accumAlphaBits = accumAlphaBits;
-
- vis->haveAccumBuffer = accumRedBits > 0;
- vis->haveDepthBuffer = depthBits > 0;
- vis->haveStencilBuffer = stencilBits > 0;
-
- vis->numAuxBuffers = 0;
- vis->level = 0;
- vis->pixmapMode = 0;
- vis->sampleBuffers = numSamples > 0 ? 1 : 0;
- vis->samples = numSamples;
-
- return GL_TRUE;
-}
-
-
-/**
- * Destroy a visual and free its memory.
- *
- * \param vis visual.
- *
- * Frees the visual structure.
- */
-void
-_mesa_destroy_visual( GLvisual *vis )
-{
- FREE(vis);
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Context allocation, initialization, destroying
- *
- * The purpose of the most initialization functions here is to provide the
- * default state values according to the OpenGL specification.
- */
-/**********************************************************************/
-/*@{*/
-
-/**
- * One-time initialization mutex lock.
- *
- * \sa Used by one_time_init().
- */
-_glthread_DECLARE_STATIC_MUTEX(OneTimeLock);
-
-/**
- * Calls all the various one-time-init functions in Mesa.
- *
- * While holding a global mutex lock, calls several initialization functions,
- * and sets the glapi callbacks if the \c MESA_DEBUG environment variable is
- * defined.
- *
- * \sa _mesa_init_lists(), _math_init().
- */
-static void
-one_time_init( GLcontext *ctx )
-{
- static GLboolean alreadyCalled = GL_FALSE;
- (void) ctx;
- _glthread_LOCK_MUTEX(OneTimeLock);
- if (!alreadyCalled) {
- GLuint i;
-
- /* do some implementation tests */
- assert( sizeof(GLbyte) == 1 );
- assert( sizeof(GLubyte) == 1 );
- assert( sizeof(GLshort) == 2 );
- assert( sizeof(GLushort) == 2 );
- assert( sizeof(GLint) == 4 );
- assert( sizeof(GLuint) == 4 );
-
- _mesa_init_lists();
-
-#if _HAVE_FULL_GL
- _math_init();
-
- for (i = 0; i < 256; i++) {
- _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
- }
-#endif
-
-#ifdef USE_SPARC_ASM
- _mesa_init_sparc_glapi_relocs();
-#endif
- if (_mesa_getenv("MESA_DEBUG")) {
- _glapi_noop_enable_warnings(GL_TRUE);
- _glapi_set_warning_func( (_glapi_warning_func) _mesa_warning );
- }
- else {
- _glapi_noop_enable_warnings(GL_FALSE);
- }
-
-#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
- _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",
- MESA_VERSION_STRING, __DATE__, __TIME__);
-#endif
-
- alreadyCalled = GL_TRUE;
- }
- _glthread_UNLOCK_MUTEX(OneTimeLock);
-}
-
-
-/**
- * Allocate and initialize a shared context state structure.
- * Initializes the display list, texture objects and vertex programs hash
- * tables, allocates the texture objects. If it runs out of memory, frees
- * everything already allocated before returning NULL.
- *
- * \return pointer to a gl_shared_state structure on success, or NULL on
- * failure.
- */
-static GLboolean
-alloc_shared_state( GLcontext *ctx )
-{
- struct gl_shared_state *ss = CALLOC_STRUCT(gl_shared_state);
- if (!ss)
- return GL_FALSE;
-
- ctx->Shared = ss;
-
- _glthread_INIT_MUTEX(ss->Mutex);
-
- ss->DisplayList = _mesa_NewHashTable();
- ss->TexObjects = _mesa_NewHashTable();
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
- ss->Programs = _mesa_NewHashTable();
-#endif
-
-#if FEATURE_ARB_vertex_program
- ss->DefaultVertexProgram = ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
- if (!ss->DefaultVertexProgram)
- goto cleanup;
-#endif
-#if FEATURE_ARB_fragment_program
- ss->DefaultFragmentProgram = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
- if (!ss->DefaultFragmentProgram)
- goto cleanup;
-#endif
-#if FEATURE_ATI_fragment_shader
- ss->DefaultFragmentShader = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_SHADER_ATI, 0);
- if (!ss->DefaultFragmentShader)
- goto cleanup;
-#endif
-
- ss->BufferObjects = _mesa_NewHashTable();
-
- ss->GL2Objects = _mesa_NewHashTable ();
-
- ss->Default1D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D);
- if (!ss->Default1D)
- goto cleanup;
-
- ss->Default2D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D);
- if (!ss->Default2D)
- goto cleanup;
-
- ss->Default3D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_3D);
- if (!ss->Default3D)
- goto cleanup;
-
- ss->DefaultCubeMap = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_CUBE_MAP_ARB);
- if (!ss->DefaultCubeMap)
- goto cleanup;
-
- ss->DefaultRect = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_RECTANGLE_NV);
- if (!ss->DefaultRect)
- goto cleanup;
-
- /* Effectively bind the default textures to all texture units */
- ss->Default1D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->Default2D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->Default3D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS;
-
-#if FEATURE_EXT_framebuffer_object
- ss->FrameBuffers = _mesa_NewHashTable();
- if (!ss->FrameBuffers)
- goto cleanup;
- ss->RenderBuffers = _mesa_NewHashTable();
- if (!ss->RenderBuffers)
- goto cleanup;
-#endif
-
-
- return GL_TRUE;
-
- cleanup:
- /* Ran out of memory at some point. Free everything and return NULL */
- if (ss->DisplayList)
- _mesa_DeleteHashTable(ss->DisplayList);
- if (ss->TexObjects)
- _mesa_DeleteHashTable(ss->TexObjects);
-#if FEATURE_NV_vertex_program
- if (ss->Programs)
- _mesa_DeleteHashTable(ss->Programs);
-#endif
-#if FEATURE_ARB_vertex_program
- if (ss->DefaultVertexProgram)
- ctx->Driver.DeleteProgram(ctx, ss->DefaultVertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
- if (ss->DefaultFragmentProgram)
- ctx->Driver.DeleteProgram(ctx, ss->DefaultFragmentProgram);
-#endif
-#if FEATURE_ATI_fragment_shader
- if (ss->DefaultFragmentShader)
- ctx->Driver.DeleteProgram(ctx, ss->DefaultFragmentShader);
-#endif
-#if FEATURE_ARB_vertex_buffer_object
- if (ss->BufferObjects)
- _mesa_DeleteHashTable(ss->BufferObjects);
-#endif
-
- if (ss->GL2Objects)
- _mesa_DeleteHashTable (ss->GL2Objects);
-
-#if FEATURE_EXT_framebuffer_object
- if (ss->FrameBuffers)
- _mesa_DeleteHashTable(ss->FrameBuffers);
- if (ss->RenderBuffers)
- _mesa_DeleteHashTable(ss->RenderBuffers);
-#endif
-
- if (ss->Default1D)
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default1D);
- if (ss->Default2D)
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default2D);
- if (ss->Default3D)
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default3D);
- if (ss->DefaultCubeMap)
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultCubeMap);
- if (ss->DefaultRect)
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultRect);
- if (ss)
- _mesa_free(ss);
- return GL_FALSE;
-}
-
-/**
- * Deallocate a shared state context and all children structures.
- *
- * \param ctx GL context.
- * \param ss shared state pointer.
- *
- * Frees the display lists, the texture objects (calling the driver texture
- * deletion callback to free its private data) and the vertex programs, as well
- * as their hash tables.
- *
- * \sa alloc_shared_state().
- */
-static void
-free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
-{
- /* Free display lists */
- while (1) {
- GLuint list = _mesa_HashFirstEntry(ss->DisplayList);
- if (list) {
- _mesa_destroy_list(ctx, list);
- }
- else {
- break;
- }
- }
- _mesa_DeleteHashTable(ss->DisplayList);
-
- /* Free texture objects */
- ASSERT(ctx->Driver.DeleteTexture);
- /* the default textures */
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default1D);
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default2D);
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default3D);
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultCubeMap);
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultRect);
- /* all other textures */
- while (1) {
- GLuint texName = _mesa_HashFirstEntry(ss->TexObjects);
- if (texName) {
- struct gl_texture_object *texObj = (struct gl_texture_object *)
- _mesa_HashLookup(ss->TexObjects, texName);
- ASSERT(texObj);
- (*ctx->Driver.DeleteTexture)(ctx, texObj);
- _mesa_HashRemove(ss->TexObjects, texName);
- }
- else {
- break;
- }
- }
- _mesa_DeleteHashTable(ss->TexObjects);
-
-#if FEATURE_NV_vertex_program
- /* Free vertex programs */
- while (1) {
- GLuint prog = _mesa_HashFirstEntry(ss->Programs);
- if (prog) {
- struct program *p = (struct program *) _mesa_HashLookup(ss->Programs,
- prog);
- ASSERT(p);
- ctx->Driver.DeleteProgram(ctx, p);
- _mesa_HashRemove(ss->Programs, prog);
- }
- else {
- break;
- }
- }
- _mesa_DeleteHashTable(ss->Programs);
-#endif
-#if FEATURE_ARB_vertex_program
- _mesa_delete_program(ctx, ss->DefaultVertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
- _mesa_delete_program(ctx, ss->DefaultFragmentProgram);
-#endif
-#if FEATURE_ATI_fragment_shader
- _mesa_delete_program(ctx, ss->DefaultFragmentShader);
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_DeleteHashTable(ss->BufferObjects);
-#endif
-
- _mesa_DeleteHashTable (ss->GL2Objects);
-
-#if FEATURE_EXT_framebuffer_object
- _mesa_DeleteHashTable(ss->FrameBuffers);
- _mesa_DeleteHashTable(ss->RenderBuffers);
-#endif
-
- _glthread_DESTROY_MUTEX(ss->Mutex);
-
- FREE(ss);
-}
-
-
-/**
- * Initialize fields of gl_current_attrib (aka ctx->Current.*)
- */
-static void
-_mesa_init_current( GLcontext *ctx )
-{
- GLuint i;
-
- /* Current group */
- for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 );
- }
- /* special cases: */
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_FOG], 0.0, 0.0, 0.0, 0.0 );
-
- ctx->Current.Index = 1;
- ctx->Current.EdgeFlag = GL_TRUE;
-}
-
-
-/**
- * Initialize fields of gl_constants (aka ctx->Const.*).
- * Use defaults from config.h. The device drivers will often override
- * some of these values (such as number of texture units).
- */
-static void
-_mesa_init_constants( GLcontext *ctx )
-{
- assert(ctx);
-
- assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
- assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
-
- /* Constants, may be overriden (usually only reduced) by device drivers */
- ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
- ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
- ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
- ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
- ctx->Const.MaxTextureUnits = MAX_TEXTURE_UNITS;
- ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
- ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
- ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
- ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
- ctx->Const.SubPixelBits = SUB_PIXEL_BITS;
- ctx->Const.MinPointSize = MIN_POINT_SIZE;
- ctx->Const.MaxPointSize = MAX_POINT_SIZE;
- ctx->Const.MinPointSizeAA = MIN_POINT_SIZE;
- ctx->Const.MaxPointSizeAA = MAX_POINT_SIZE;
- ctx->Const.PointSizeGranularity = (GLfloat) POINT_SIZE_GRANULARITY;
- ctx->Const.MinLineWidth = MIN_LINE_WIDTH;
- ctx->Const.MaxLineWidth = MAX_LINE_WIDTH;
- ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH;
- ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
- ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
- ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
- ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
- ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
- ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
- ctx->Const.MaxLights = MAX_LIGHTS;
- ctx->Const.MaxShininess = 128.0;
- ctx->Const.MaxSpotExponent = 128.0;
- ctx->Const.MaxViewportWidth = MAX_WIDTH;
- ctx->Const.MaxViewportHeight = MAX_HEIGHT;
-#if FEATURE_ARB_vertex_program
- ctx->Const.MaxVertexProgramInstructions = MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS;
- ctx->Const.MaxVertexProgramAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
- ctx->Const.MaxVertexProgramTemps = MAX_NV_VERTEX_PROGRAM_TEMPS;
- ctx->Const.MaxVertexProgramLocalParams = MAX_NV_VERTEX_PROGRAM_PARAMS;
- ctx->Const.MaxVertexProgramEnvParams = MAX_NV_VERTEX_PROGRAM_PARAMS;/*XXX*/
- ctx->Const.MaxVertexProgramAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
-#endif
-#if FEATURE_ARB_fragment_program
- ctx->Const.MaxFragmentProgramInstructions = MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS;
- ctx->Const.MaxFragmentProgramAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS;
- ctx->Const.MaxFragmentProgramTemps = MAX_NV_FRAGMENT_PROGRAM_TEMPS;
- ctx->Const.MaxFragmentProgramLocalParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
- ctx->Const.MaxFragmentProgramEnvParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS;/*XXX*/
- ctx->Const.MaxFragmentProgramAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
- ctx->Const.MaxFragmentProgramAluInstructions = MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS;
- ctx->Const.MaxFragmentProgramTexInstructions = MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS;
- ctx->Const.MaxFragmentProgramTexIndirections = MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS;
-#endif
-
- ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
- ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
-
- /* If we're running in the X server, do bounds checking to prevent
- * segfaults and server crashes!
- */
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- ctx->Const.CheckArrayBounds = GL_TRUE;
-#else
- ctx->Const.CheckArrayBounds = GL_FALSE;
-#endif
-
- ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
-
- /* GL_OES_read_format */
- ctx->Const.ColorReadFormat = GL_RGBA;
- ctx->Const.ColorReadType = GL_UNSIGNED_BYTE;
-
-#if FEATURE_EXT_framebuffer_object
- ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
- ctx->Const.MaxRenderbufferSize = MAX_WIDTH;
-#endif
-
- /* sanity checks */
- ASSERT(ctx->Const.MaxTextureUnits == MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits));
-}
-
-
-/**
- * Initialize the attribute groups in a GL context.
- *
- * \param ctx GL context.
- *
- * Initializes all the attributes, calling the respective <tt>init*</tt>
- * functions for the more complex data structures.
- */
-static GLboolean
-init_attrib_groups( GLcontext *ctx )
-{
- assert(ctx);
-
- /* Constants */
- _mesa_init_constants( ctx );
-
- /* Extensions */
- _mesa_init_extensions( ctx );
-
- /* Attribute Groups */
- _mesa_init_accum( ctx );
- _mesa_init_attrib( ctx );
- _mesa_init_buffer_objects( ctx );
- _mesa_init_color( ctx );
- _mesa_init_colortables( ctx );
- _mesa_init_current( ctx );
- _mesa_init_depth( ctx );
- _mesa_init_debug( ctx );
- _mesa_init_display_list( ctx );
- _mesa_init_eval( ctx );
- _mesa_init_feedback( ctx );
- _mesa_init_fog( ctx );
- _mesa_init_histogram( ctx );
- _mesa_init_hint( ctx );
- _mesa_init_line( ctx );
- _mesa_init_lighting( ctx );
- _mesa_init_matrix( ctx );
- _mesa_init_multisample( ctx );
- _mesa_init_occlude( ctx );
- _mesa_init_pixel( ctx );
- _mesa_init_point( ctx );
- _mesa_init_polygon( ctx );
- _mesa_init_program( ctx );
- _mesa_init_rastpos( ctx );
- _mesa_init_scissor( ctx );
- _mesa_init_shaderobjects (ctx);
- _mesa_init_stencil( ctx );
- _mesa_init_transform( ctx );
- _mesa_init_varray( ctx );
- _mesa_init_viewport( ctx );
-
- if (!_mesa_init_texture( ctx ))
- return GL_FALSE;
-
- _mesa_init_texture_s3tc( ctx );
- _mesa_init_texture_fxt1( ctx );
-
- /* Miscellaneous */
- ctx->NewState = _NEW_ALL;
- ctx->ErrorValue = (GLenum) GL_NO_ERROR;
- ctx->_Facing = 0;
-#if CHAN_TYPE == GL_FLOAT
- ctx->ClampFragmentColors = GL_FALSE; /* XXX temporary */
-#else
- ctx->ClampFragmentColors = GL_TRUE;
-#endif
- ctx->ClampVertexColors = GL_TRUE;
-
- return GL_TRUE;
-}
-
-
-/**
- * This is the default function we plug into all dispatch table slots
- * This helps prevents a segfault when someone calls a GL function without
- * first checking if the extension's supported.
- */
-static int
-generic_nop(void)
-{
- _mesa_problem(NULL, "User called no-op dispatch function (an unsupported extension function?)");
- return 0;
-}
-
-
-/**
- * Allocate and initialize a new dispatch table.
- */
-static struct _glapi_table *
-alloc_dispatch_table(void)
-{
- /* Find the larger of Mesa's dispatch table and libGL's dispatch table.
- * In practice, this'll be the same for stand-alone Mesa. But for DRI
- * Mesa we do this to accomodate different versions of libGL and various
- * DRI drivers.
- */
- GLint numEntries = MAX2(_glapi_get_dispatch_table_size(),
- sizeof(struct _glapi_table) / sizeof(_glapi_proc));
- struct _glapi_table *table =
- (struct _glapi_table *) _mesa_malloc(numEntries * sizeof(_glapi_proc));
- if (table) {
- _glapi_proc *entry = (_glapi_proc *) table;
- GLint i;
- for (i = 0; i < numEntries; i++) {
- entry[i] = (_glapi_proc) generic_nop;
- }
- }
- return table;
-}
-
-
-/**
- * Initialize a GLcontext struct (rendering context).
- *
- * This includes allocating all the other structs and arrays which hang off of
- * the context by pointers.
- * Note that the driver needs to pass in its dd_function_table here since
- * we need to at least call driverFunctions->NewTextureObject to create the
- * default texture objects.
- *
- * Called by _mesa_create_context().
- *
- * Performs the imports and exports callback tables initialization, and
- * miscellaneous one-time initializations. If no shared context is supplied one
- * is allocated, and increase its reference count. Setups the GL API dispatch
- * tables. Initialize the TNL module. Sets the maximum Z buffer depth.
- * Finally queries the \c MESA_DEBUG and \c MESA_VERBOSE environment variables
- * for debug flags.
- *
- * \param ctx the context to initialize
- * \param visual describes the visual attributes for this context
- * \param share_list points to context to share textures, display lists,
- * etc with, or NULL
- * \param driverFunctions table of device driver functions for this context
- * to use
- * \param driverContext pointer to driver-specific context data
- */
-GLboolean
-_mesa_initialize_context( GLcontext *ctx,
- const GLvisual *visual,
- GLcontext *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext )
-{
- ASSERT(driverContext);
- assert(driverFunctions->NewTextureObject);
- assert(driverFunctions->FreeTexImageData);
-
- /* If the driver wants core Mesa to use special imports, it'll have to
- * override these defaults.
- */
- _mesa_init_default_imports( &(ctx->imports), driverContext );
-
- /* initialize the exports (Mesa functions called by the window system) */
- _mesa_init_default_exports( &(ctx->exports) );
-
- /* misc one-time initializations */
- one_time_init(ctx);
-
- ctx->Visual = *visual;
- ctx->DrawBuffer = NULL;
- ctx->ReadBuffer = NULL;
- ctx->WinSysDrawBuffer = NULL;
- ctx->WinSysReadBuffer = NULL;
-
- /* Plug in driver functions and context pointer here.
- * This is important because when we call alloc_shared_state() below
- * we'll call ctx->Driver.NewTextureObject() to create the default
- * textures.
- */
- ctx->Driver = *driverFunctions;
- ctx->DriverCtx = driverContext;
-
- if (share_list) {
- /* share state with another context */
- ctx->Shared = share_list->Shared;
- }
- else {
- /* allocate new, unshared state */
- if (!alloc_shared_state( ctx )) {
- return GL_FALSE;
- }
- }
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- ctx->Shared->RefCount++;
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-
- if (!init_attrib_groups( ctx )) {
- free_shared_state(ctx, ctx->Shared);
- return GL_FALSE;
- }
-
- /* setup the API dispatch tables */
- ctx->Exec = alloc_dispatch_table();
- ctx->Save = alloc_dispatch_table();
- if (!ctx->Exec || !ctx->Save) {
- free_shared_state(ctx, ctx->Shared);
- if (ctx->Exec)
- _mesa_free(ctx->Exec);
- }
- _mesa_init_exec_table(ctx->Exec);
- ctx->CurrentDispatch = ctx->Exec;
-#if _HAVE_FULL_GL
- _mesa_init_dlist_table(ctx->Save);
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
- /* Neutral tnl module stuff */
- _mesa_init_exec_vtxfmt( ctx );
- ctx->TnlModule.Current = NULL;
- ctx->TnlModule.SwapCount = 0;
-#endif
-
- ctx->_MaintainTexEnvProgram = (_mesa_getenv("MESA_TEX_PROG") != NULL);
- ctx->_MaintainTnlProgram = (_mesa_getenv("MESA_TNL_PROG") != NULL);
-
- return GL_TRUE;
-}
-
-
-/**
- * Allocate and initialize a GLcontext structure.
- * Note that the driver needs to pass in its dd_function_table here since
- * we need to at least call driverFunctions->NewTextureObject to initialize
- * the rendering context.
- *
- * \param visual a GLvisual pointer (we copy the struct contents)
- * \param share_list another context to share display lists with or NULL
- * \param driverFunctions points to the dd_function_table into which the
- * driver has plugged in all its special functions.
- * \param driverCtx points to the device driver's private context state
- *
- * \return pointer to a new __GLcontextRec or NULL if error.
- */
-GLcontext *
-_mesa_create_context( const GLvisual *visual,
- GLcontext *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext )
-
-{
- GLcontext *ctx;
-
- ASSERT(visual);
- ASSERT(driverContext);
-
- ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext));
- if (!ctx)
- return NULL;
-
- if (_mesa_initialize_context(ctx, visual, share_list,
- driverFunctions, driverContext)) {
- return ctx;
- }
- else {
- _mesa_free(ctx);
- return NULL;
- }
-}
-
-
-/**
- * Free the data associated with the given context.
- *
- * But doesn't free the GLcontext struct itself.
- *
- * \sa _mesa_initialize_context() and init_attrib_groups().
- */
-void
-_mesa_free_context_data( GLcontext *ctx )
-{
- /* if we're destroying the current context, unbind it first */
- if (ctx == _mesa_get_current_context()) {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- _mesa_free_lighting_data( ctx );
- _mesa_free_eval_data( ctx );
- _mesa_free_texture_data( ctx );
- _mesa_free_matrix_data( ctx );
- _mesa_free_viewport_data( ctx );
- _mesa_free_colortables_data( ctx );
- _mesa_free_program_data(ctx);
- _mesa_free_occlude_data(ctx);
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj);
-#endif
-
- /* free dispatch tables */
- _mesa_free(ctx->Exec);
- _mesa_free(ctx->Save);
-
- /* Shared context state (display lists, textures, etc) */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- ctx->Shared->RefCount--;
- assert(ctx->Shared->RefCount >= 0);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- if (ctx->Shared->RefCount == 0) {
- /* free shared state */
- free_shared_state( ctx, ctx->Shared );
- }
-
- if (ctx->Extensions.String)
- FREE((void *) ctx->Extensions.String);
-}
-
-
-/**
- * Destroy a GLcontext structure.
- *
- * \param ctx GL context.
- *
- * Calls _mesa_free_context_data() and frees the GLcontext structure itself.
- */
-void
-_mesa_destroy_context( GLcontext *ctx )
-{
- if (ctx) {
- _mesa_free_context_data(ctx);
- FREE( (void *) ctx );
- }
-}
-
-
-#if _HAVE_FULL_GL
-/**
- * Copy attribute groups from one context to another.
- *
- * \param src source context
- * \param dst destination context
- * \param mask bitwise OR of GL_*_BIT flags
- *
- * According to the bits specified in \p mask, copies the corresponding
- * attributes from \p src into \p dst. For many of the attributes a simple \c
- * memcpy is not enough due to the existence of internal pointers in their data
- * structures.
- */
-void
-_mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
-{
- if (mask & GL_ACCUM_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Accum = src->Accum;
- }
- if (mask & GL_COLOR_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Color = src->Color;
- }
- if (mask & GL_CURRENT_BIT) {
- /* OK to memcpy */
- dst->Current = src->Current;
- }
- if (mask & GL_DEPTH_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Depth = src->Depth;
- }
- if (mask & GL_ENABLE_BIT) {
- /* no op */
- }
- if (mask & GL_EVAL_BIT) {
- /* OK to memcpy */
- dst->Eval = src->Eval;
- }
- if (mask & GL_FOG_BIT) {
- /* OK to memcpy */
- dst->Fog = src->Fog;
- }
- if (mask & GL_HINT_BIT) {
- /* OK to memcpy */
- dst->Hint = src->Hint;
- }
- if (mask & GL_LIGHTING_BIT) {
- GLuint i;
- /* begin with memcpy */
- MEMCPY( &dst->Light, &src->Light, sizeof(struct gl_light) );
- /* fixup linked lists to prevent pointer insanity */
- make_empty_list( &(dst->Light.EnabledList) );
- for (i = 0; i < MAX_LIGHTS; i++) {
- if (dst->Light.Light[i].Enabled) {
- insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i]));
- }
- }
- }
- if (mask & GL_LINE_BIT) {
- /* OK to memcpy */
- dst->Line = src->Line;
- }
- if (mask & GL_LIST_BIT) {
- /* OK to memcpy */
- dst->List = src->List;
- }
- if (mask & GL_PIXEL_MODE_BIT) {
- /* OK to memcpy */
- dst->Pixel = src->Pixel;
- }
- if (mask & GL_POINT_BIT) {
- /* OK to memcpy */
- dst->Point = src->Point;
- }
- if (mask & GL_POLYGON_BIT) {
- /* OK to memcpy */
- dst->Polygon = src->Polygon;
- }
- if (mask & GL_POLYGON_STIPPLE_BIT) {
- /* Use loop instead of MEMCPY due to problem with Portland Group's
- * C compiler. Reported by John Stone.
- */
- GLuint i;
- for (i = 0; i < 32; i++) {
- dst->PolygonStipple[i] = src->PolygonStipple[i];
- }
- }
- if (mask & GL_SCISSOR_BIT) {
- /* OK to memcpy */
- dst->Scissor = src->Scissor;
- }
- if (mask & GL_STENCIL_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Stencil = src->Stencil;
- }
- if (mask & GL_TEXTURE_BIT) {
- /* Cannot memcpy because of pointers */
- _mesa_copy_texture_state(src, dst);
- }
- if (mask & GL_TRANSFORM_BIT) {
- /* OK to memcpy */
- dst->Transform = src->Transform;
- }
- if (mask & GL_VIEWPORT_BIT) {
- /* Cannot use memcpy, because of pointers in GLmatrix _WindowMap */
- dst->Viewport.X = src->Viewport.X;
- dst->Viewport.Y = src->Viewport.Y;
- dst->Viewport.Width = src->Viewport.Width;
- dst->Viewport.Height = src->Viewport.Height;
- dst->Viewport.Near = src->Viewport.Near;
- dst->Viewport.Far = src->Viewport.Far;
- _math_matrix_copy(&dst->Viewport._WindowMap, &src->Viewport._WindowMap);
- }
-
- /* XXX FIXME: Call callbacks?
- */
- dst->NewState = _NEW_ALL;
-}
-#endif
-
-
-/**
- * Check if the given context can render into the given framebuffer
- * by checking visual attributes.
- * \return GL_TRUE if compatible, GL_FALSE otherwise.
- */
-static GLboolean
-check_compatible(const GLcontext *ctx, const GLframebuffer *buffer)
-{
- const GLvisual *ctxvis = &ctx->Visual;
- const GLvisual *bufvis = &buffer->Visual;
-
- if (ctxvis == bufvis)
- return GL_TRUE;
-
- if (ctxvis->rgbMode != bufvis->rgbMode)
- return GL_FALSE;
- if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode)
- return GL_FALSE;
- if (ctxvis->stereoMode && !bufvis->stereoMode)
- return GL_FALSE;
- if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer)
- return GL_FALSE;
- if (ctxvis->haveDepthBuffer && !bufvis->haveDepthBuffer)
- return GL_FALSE;
- if (ctxvis->haveStencilBuffer && !bufvis->haveStencilBuffer)
- return GL_FALSE;
- if (ctxvis->redMask && ctxvis->redMask != bufvis->redMask)
- return GL_FALSE;
- if (ctxvis->greenMask && ctxvis->greenMask != bufvis->greenMask)
- return GL_FALSE;
- if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask)
- return GL_FALSE;
- if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits)
- return GL_FALSE;
- if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-/**
- * Bind the given context to the given draw-buffer and read-buffer and
- * make it the current context for this thread.
- *
- * \param newCtx new GL context. If NULL then there will be no current GL
- * context.
- * \param drawBuffer draw framebuffer.
- * \param readBuffer read framebuffer.
- *
- * Check that the context's and framebuffer's visuals are compatible, returning
- * immediately otherwise. Sets the glapi current context via
- * _glapi_set_context(). If \p newCtx is not NULL, associates \p drawBuffer and
- * \p readBuffer with it and calls dd_function_table::ResizeBuffers if the buffers size has changed.
- * Calls dd_function_table::MakeCurrent callback if defined.
- *
- * When a context is bound by the first time and the \c MESA_INFO environment
- * variable is set it calls print_info() as an aid for remote user
- * troubleshooting.
- */
-void
-_mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
- GLframebuffer *readBuffer )
-{
- #ifdef NXAGENT_SERVER
- int flag;
- #endif
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(newCtx, "_mesa_make_current()\n");
-
- /* Check that the context's and framebuffer's visuals are compatible.
- */
- if (newCtx && drawBuffer && newCtx->DrawBuffer != drawBuffer) {
- if (!check_compatible(newCtx, drawBuffer))
- return;
- }
- if (newCtx && readBuffer && newCtx->ReadBuffer != readBuffer) {
- if (!check_compatible(newCtx, readBuffer))
- return;
- }
-
-#if !defined(IN_DRI_DRIVER)
- /* We call this function periodically (just here for now) in
- * order to detect when multithreading has begun. In a DRI driver, this
- * step is done by the driver loader (e.g., libGL).
- */
- _glapi_check_multithread();
-#endif /* !defined(IN_DRI_DRIVER) */
-
- _glapi_set_context((void *) newCtx);
- ASSERT(_mesa_get_current_context() == newCtx);
-
- if (!newCtx) {
- _glapi_set_dispatch(NULL); /* none current */
- }
- else {
- _glapi_set_dispatch(newCtx->CurrentDispatch);
-
- if (drawBuffer && readBuffer) {
- /* TODO: check if newCtx and buffer's visual match??? */
-
- ASSERT(drawBuffer->Name == 0);
- ASSERT(readBuffer->Name == 0);
- newCtx->WinSysDrawBuffer = drawBuffer;
- newCtx->WinSysReadBuffer = readBuffer;
-
-#ifdef NXAGENT_SERVER
- flag = 0;
- if (newCtx->DrawBuffer) {
- if (!IsWSDrawBuffer(newCtx->DrawBuffer)) {
- if (newCtx->DrawBuffer->Name == 0) {
- flag = 1;
- }
- FreeWSDrawBuffer(newCtx->DrawBuffer);
- }
- else flag = 1;
- }
-
- if (!newCtx->DrawBuffer || flag) {
- newCtx->DrawBuffer = drawBuffer;
- newCtx->ReadBuffer = readBuffer;
- }
-#else
- /* don't replace user-buffer bindings with window system buffer */
- if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
- newCtx->DrawBuffer = drawBuffer;
- newCtx->ReadBuffer = readBuffer;
- }
-#endif
-
- newCtx->NewState |= _NEW_BUFFERS;
-
-#if _HAVE_FULL_GL
- if (!drawBuffer->Initialized) {
- /* get initial window size */
- GLuint bufWidth, bufHeight;
- /* ask device driver for size of the buffer */
- (*newCtx->Driver.GetBufferSize)(drawBuffer, &bufWidth, &bufHeight);
- /* set initial buffer size */
- if (newCtx->Driver.ResizeBuffers)
- newCtx->Driver.ResizeBuffers(newCtx, drawBuffer,
- bufWidth, bufHeight);
- drawBuffer->Initialized = GL_TRUE;
- }
-
- if (readBuffer != drawBuffer && !readBuffer->Initialized) {
- /* get initial window size */
- GLuint bufWidth, bufHeight;
- /* ask device driver for size of the buffer */
- (*newCtx->Driver.GetBufferSize)(readBuffer, &bufWidth, &bufHeight);
- /* set initial buffer size */
- if (newCtx->Driver.ResizeBuffers)
- newCtx->Driver.ResizeBuffers(newCtx, readBuffer,
- bufWidth, bufHeight);
- readBuffer->Initialized = GL_TRUE;
- }
-#endif
- if (newCtx->FirstTimeCurrent) {
- /* set initial viewport and scissor size now */
- _mesa_set_viewport(newCtx, 0, 0, drawBuffer->Width, drawBuffer->Height);
- newCtx->Scissor.Width = drawBuffer->Width;
- newCtx->Scissor.Height = drawBuffer->Height;
- }
- }
-
- /* Alert the driver - usually passed on to the sw t&l module,
- * but also used to detect threaded cases in the radeon codegen
- * hw t&l module.
- */
- if (newCtx->Driver.MakeCurrent)
- newCtx->Driver.MakeCurrent( newCtx, drawBuffer, readBuffer );
-
- /* We can use this to help debug user's problems. Tell them to set
- * the MESA_INFO env variable before running their app. Then the
- * first time each context is made current we'll print some useful
- * information.
- */
- if (newCtx->FirstTimeCurrent) {
- if (_mesa_getenv("MESA_INFO")) {
- _mesa_print_info();
- }
- newCtx->FirstTimeCurrent = GL_FALSE;
- }
- }
-}
-
-
-/**
- * Make context 'ctx' share the display lists, textures and programs
- * that are associated with 'ctxToShare'.
- * Any display lists, textures or programs associated with 'ctx' will
- * be deleted if nobody else is sharing them.
- */
-GLboolean
-_mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare)
-{
- if (ctx && ctxToShare && ctx->Shared && ctxToShare->Shared) {
- ctx->Shared->RefCount--;
- if (ctx->Shared->RefCount == 0) {
- free_shared_state(ctx, ctx->Shared);
- }
- ctx->Shared = ctxToShare->Shared;
- ctx->Shared->RefCount++;
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * Get current context for the calling thread.
- *
- * \return pointer to the current GL context.
- *
- * Calls _glapi_get_context(). This isn't the fastest way to get the current
- * context. If you need speed, see the #GET_CURRENT_CONTEXT macro in context.h.
- */
-GLcontext *
-_mesa_get_current_context( void )
-{
- return (GLcontext *) _glapi_get_context();
-}
-
-/**
- * Get context's current API dispatch table.
- *
- * It'll either be the immediate-mode execute dispatcher or the display list
- * compile dispatcher.
- *
- * \param ctx GL context.
- *
- * \return pointer to dispatch_table.
- *
- * Simply returns __GLcontextRec::CurrentDispatch.
- */
-struct _glapi_table *
-_mesa_get_dispatch(GLcontext *ctx)
-{
- return ctx->CurrentDispatch;
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Miscellaneous functions */
-/**********************************************************************/
-/*@{*/
-
-/**
- * Record an error.
- *
- * \param ctx GL context.
- * \param error error code.
- *
- * Records the given error code and call the driver's dd_function_table::Error
- * function if defined.
- *
- * \sa
- * This is called via _mesa_error().
- */
-void
-_mesa_record_error( GLcontext *ctx, GLenum error )
-{
- if (!ctx)
- return;
-
- if (ctx->ErrorValue == GL_NO_ERROR) {
- ctx->ErrorValue = error;
- }
-
- /* Call device driver's error handler, if any. This is used on the Mac. */
- if (ctx->Driver.Error) {
- (*ctx->Driver.Error)( ctx );
- }
-}
-
-/**
- * Execute glFinish().
- *
- * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
- * dd_function_table::Finish driver callback, if not NULL.
- */
-void GLAPIENTRY
-_mesa_Finish( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->Driver.Finish) {
- (*ctx->Driver.Finish)( ctx );
- }
-}
-
-/**
- * Execute glFlush().
- *
- * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
- * dd_function_table::Flush driver callback, if not NULL.
- */
-void GLAPIENTRY
-_mesa_Flush( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->Driver.Flush) {
- (*ctx->Driver.Flush)( ctx );
- }
-}
-
-
-/*@}*/
diff --git a/nx-X11/extras/Mesa/src/mesa/main/context.c.X.original b/nx-X11/extras/Mesa/src/mesa/main/context.c.X.original
deleted file mode 100644
index 25a3f6a37..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/context.c.X.original
+++ /dev/null
@@ -1,1750 +0,0 @@
-/**
- * \file context.c
- * Mesa context/visual/framebuffer management functions.
- * \author Brian Paul
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.4
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \mainpage Mesa Main Module
- *
- * \section MainIntroduction Introduction
- *
- * The Mesa Main module consists of all the files in the main/ directory.
- * Among the features of this module are:
- * <UL>
- * <LI> Structures to represent most GL state </LI>
- * <LI> State set/get functions </LI>
- * <LI> Display lists </LI>
- * <LI> Texture unit, object and image handling </LI>
- * <LI> Matrix and attribute stacks </LI>
- * </UL>
- *
- * Other modules are responsible for API dispatch, vertex transformation,
- * point/line/triangle setup, rasterization, vertex array caching,
- * vertex/fragment programs/shaders, etc.
- *
- *
- * \section AboutDoxygen About Doxygen
- *
- * If you're viewing this information as Doxygen-generated HTML you'll
- * see the documentation index at the top of this page.
- *
- * The first line lists the Mesa source code modules.
- * The second line lists the indexes available for viewing the documentation
- * for each module.
- *
- * Selecting the <b>Main page</b> link will display a summary of the module
- * (this page).
- *
- * Selecting <b>Data Structures</b> will list all C structures.
- *
- * Selecting the <b>File List</b> link will list all the source files in
- * the module.
- * Selecting a filename will show a list of all functions defined in that file.
- *
- * Selecting the <b>Data Fields</b> link will display a list of all
- * documented structure members.
- *
- * Selecting the <b>Globals</b> link will display a list
- * of all functions, structures, global variables and macros in the module.
- *
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "accum.h"
-#include "attrib.h"
-#include "blend.h"
-#include "buffers.h"
-#include "bufferobj.h"
-#include "colortab.h"
-#include "context.h"
-#include "debug.h"
-#include "depth.h"
-#include "dlist.h"
-#include "eval.h"
-#include "enums.h"
-#include "extensions.h"
-#include "fbobject.h"
-#include "feedback.h"
-#include "fog.h"
-#include "get.h"
-#include "glthread.h"
-#include "glapioffsets.h"
-#include "histogram.h"
-#include "hint.h"
-#include "hash.h"
-#include "light.h"
-#include "lines.h"
-#include "macros.h"
-#include "matrix.h"
-#include "occlude.h"
-#include "pixel.h"
-#include "points.h"
-#include "polygon.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "program.h"
-#endif
-#include "rastpos.h"
-#include "simple_list.h"
-#include "state.h"
-#include "stencil.h"
-#include "texcompress.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "texstate.h"
-#include "mtypes.h"
-#include "varray.h"
-#include "version.h"
-#include "vtxfmt.h"
-#if _HAVE_FULL_GL
-#include "math/m_translate.h"
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
-#include "math/mathmod.h"
-#endif
-#include "shaderobjects.h"
-
-#ifdef USE_SPARC_ASM
-#include "sparc/sparc.h"
-#endif
-
-#ifndef MESA_VERBOSE
-int MESA_VERBOSE = 0;
-#endif
-
-#ifndef MESA_DEBUG_FLAGS
-int MESA_DEBUG_FLAGS = 0;
-#endif
-
-
-/* ubyte -> float conversion */
-GLfloat _mesa_ubyte_to_float_color_tab[256];
-
-static void
-free_shared_state( GLcontext *ctx, struct gl_shared_state *ss );
-
-
-/**********************************************************************/
-/** \name OpenGL SI-style interface (new in Mesa 3.5)
- *
- * \if subset
- * \note Most of these functions are never called in the Mesa subset.
- * \endif
- */
-/*@{*/
-
-/**
- * Destroy context callback.
- *
- * \param gc context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::destroyCurrent) when
- * the rendering context is to be destroyed.
- * \endif
- *
- * Frees the context data and the context structure.
- */
-GLboolean
-_mesa_destroyContext(__GLcontext *gc)
-{
- if (gc) {
- _mesa_free_context_data(gc);
- _mesa_free(gc);
- }
- return GL_TRUE;
-}
-
-/**
- * Unbind context callback.
- *
- * \param gc context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::loseCurrent)
- * when the rendering context is made non-current.
- * \endif
- *
- * No-op
- */
-GLboolean
-_mesa_loseCurrent(__GLcontext *gc)
-{
- /* XXX unbind context from thread */
- (void) gc;
- return GL_TRUE;
-}
-
-/**
- * Bind context callback.
- *
- * \param gc context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::makeCurrent)
- * when the rendering context is made current.
- * \endif
- *
- * No-op
- */
-GLboolean
-_mesa_makeCurrent(__GLcontext *gc)
-{
- /* XXX bind context to thread */
- (void) gc;
- return GL_TRUE;
-}
-
-/**
- * Share context callback.
- *
- * \param gc context.
- * \param gcShare shared context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \ifnot subset
- * Called by window system/device driver (via __GLexports::shareContext)
- * \endif
- *
- * Update the shared context reference count, gl_shared_state::RefCount.
- */
-GLboolean
-_mesa_shareContext(__GLcontext *gc, __GLcontext *gcShare)
-{
- if (gc && gcShare && gc->Shared && gcShare->Shared) {
- gc->Shared->RefCount--;
- if (gc->Shared->RefCount == 0) {
- free_shared_state(gc, gc->Shared);
- }
- gc->Shared = gcShare->Shared;
- gc->Shared->RefCount++;
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-#if _HAVE_FULL_GL
-/**
- * Copy context callback.
- */
-GLboolean
-_mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask)
-{
- if (dst && src) {
- _mesa_copy_context( src, dst, mask );
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-#endif
-
-/** No-op */
-GLboolean
-_mesa_forceCurrent(__GLcontext *gc)
-{
- (void) gc;
- return GL_TRUE;
-}
-
-/**
- * Windows/buffer resizing notification callback.
- *
- * \param gc GL context.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- */
-GLboolean
-_mesa_notifyResize(__GLcontext *gc)
-{
- GLint x, y;
- GLuint width, height;
- __GLdrawablePrivate *d = gc->imports.getDrawablePrivate(gc);
- if (!d || !d->getDrawableSize)
- return GL_FALSE;
- d->getDrawableSize( d, &x, &y, &width, &height );
- /* update viewport, resize software buffers, etc. */
- return GL_TRUE;
-}
-
-/**
- * Window/buffer destruction notification callback.
- *
- * \param gc GL context.
- *
- * Called when the context's window/buffer is going to be destroyed.
- *
- * No-op
- */
-void
-_mesa_notifyDestroy(__GLcontext *gc)
-{
- /* Unbind from it. */
- (void) gc;
-}
-
-/**
- * Swap buffers notification callback.
- *
- * \param gc GL context.
- *
- * Called by window system just before swapping buffers.
- * We have to finish any pending rendering.
- */
-void
-_mesa_notifySwapBuffers(__GLcontext *gc)
-{
- FLUSH_VERTICES( gc, 0 );
-}
-
-/** No-op */
-struct __GLdispatchStateRec *
-_mesa_dispatchExec(__GLcontext *gc)
-{
- (void) gc;
- return NULL;
-}
-
-/** No-op */
-void
-_mesa_beginDispatchOverride(__GLcontext *gc)
-{
- (void) gc;
-}
-
-/** No-op */
-void
-_mesa_endDispatchOverride(__GLcontext *gc)
-{
- (void) gc;
-}
-
-/**
- * \ifnot subset
- * Setup the exports.
- *
- * The window system will call these functions when it needs Mesa to do
- * something.
- *
- * \note Device drivers should override these functions! For example,
- * the Xlib driver should plug in the XMesa*-style functions into this
- * structure. The XMesa-style functions should then call the _mesa_*
- * version of these functions. This is an approximation to OO design
- * (inheritance and virtual functions).
- * \endif
- *
- * \if subset
- * No-op.
- *
- * \endif
- */
-static void
-_mesa_init_default_exports(__GLexports *exports)
-{
-#if _HAVE_FULL_GL
- exports->destroyContext = _mesa_destroyContext;
- exports->loseCurrent = _mesa_loseCurrent;
- exports->makeCurrent = _mesa_makeCurrent;
- exports->shareContext = _mesa_shareContext;
- exports->copyContext = _mesa_copyContext;
- exports->forceCurrent = _mesa_forceCurrent;
- exports->notifyResize = _mesa_notifyResize;
- exports->notifyDestroy = _mesa_notifyDestroy;
- exports->notifySwapBuffers = _mesa_notifySwapBuffers;
- exports->dispatchExec = _mesa_dispatchExec;
- exports->beginDispatchOverride = _mesa_beginDispatchOverride;
- exports->endDispatchOverride = _mesa_endDispatchOverride;
-#else
- (void) exports;
-#endif
-}
-
-/**
- * Exported OpenGL SI interface.
- */
-__GLcontext *
-__glCoreCreateContext(__GLimports *imports, __GLcontextModes *modes)
-{
- GLcontext *ctx;
-
- ctx = (GLcontext *) (*imports->calloc)(NULL, 1, sizeof(GLcontext));
- if (ctx == NULL) {
- return NULL;
- }
-
- /* XXX doesn't work at this time */
- _mesa_initialize_context(ctx, modes, NULL, NULL, NULL);
- ctx->imports = *imports;
-
- return ctx;
-}
-
-/**
- * Exported OpenGL SI interface.
- */
-void
-__glCoreNopDispatch(void)
-{
-#if 0
- /* SI */
- __gl_dispatch = __glNopDispatchState;
-#else
- /* Mesa */
- _glapi_set_dispatch(NULL);
-#endif
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name GL Visual allocation/destruction */
-/**********************************************************************/
-/*@{*/
-
-/**
- * Allocates a GLvisual structure and initializes it via
- * _mesa_initialize_visual().
- *
- * \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode.
- * \param dbFlag double buffering
- * \param stereoFlag stereo buffer
- * \param depthBits requested bits per depth buffer value. Any value in [0, 32]
- * is acceptable but the actual depth type will be GLushort or GLuint as
- * needed.
- * \param stencilBits requested minimum bits per stencil buffer value
- * \param accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits number of bits per color component in accum buffer.
- * \param indexBits number of bits per pixel if \p rgbFlag is GL_FALSE
- * \param redBits number of bits per color component in frame buffer for RGB(A)
- * mode. We always use 8 in core Mesa though.
- * \param greenBits same as above.
- * \param blueBits same as above.
- * \param alphaBits same as above.
- * \param numSamples not really used.
- *
- * \return pointer to new GLvisual or NULL if requested parameters can't be
- * met.
- *
- * \note Need to add params for level and numAuxBuffers (at least)
- */
-GLvisual *
-_mesa_create_visual( GLboolean rgbFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint indexBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples )
-{
- GLvisual *vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
- if (vis) {
- if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag,
- redBits, greenBits, blueBits, alphaBits,
- indexBits, depthBits, stencilBits,
- accumRedBits, accumGreenBits,
- accumBlueBits, accumAlphaBits,
- numSamples)) {
- FREE(vis);
- return NULL;
- }
- }
- return vis;
-}
-
-/**
- * Makes some sanity checks and fills in the fields of the
- * GLvisual object with the given parameters. If the caller needs
- * to set additional fields, he should just probably init the whole GLvisual
- * object himself.
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \sa _mesa_create_visual() above for the parameter description.
- */
-GLboolean
-_mesa_initialize_visual( GLvisual *vis,
- GLboolean rgbFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint indexBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples )
-{
- assert(vis);
-
- if (depthBits < 0 || depthBits > 32) {
- return GL_FALSE;
- }
- if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
- return GL_FALSE;
- }
- if (accumRedBits < 0 || accumRedBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumGreenBits < 0 || accumGreenBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumBlueBits < 0 || accumBlueBits > ACCUM_BITS) {
- return GL_FALSE;
- }
- if (accumAlphaBits < 0 || accumAlphaBits > ACCUM_BITS) {
- return GL_FALSE;
- }
-
- vis->rgbMode = rgbFlag;
- vis->doubleBufferMode = dbFlag;
- vis->stereoMode = stereoFlag;
-
- vis->redBits = redBits;
- vis->greenBits = greenBits;
- vis->blueBits = blueBits;
- vis->alphaBits = alphaBits;
- vis->rgbBits = redBits + greenBits + blueBits;
-
- vis->indexBits = indexBits;
- vis->depthBits = depthBits;
- vis->stencilBits = stencilBits;
-
- vis->accumRedBits = accumRedBits;
- vis->accumGreenBits = accumGreenBits;
- vis->accumBlueBits = accumBlueBits;
- vis->accumAlphaBits = accumAlphaBits;
-
- vis->haveAccumBuffer = accumRedBits > 0;
- vis->haveDepthBuffer = depthBits > 0;
- vis->haveStencilBuffer = stencilBits > 0;
-
- vis->numAuxBuffers = 0;
- vis->level = 0;
- vis->pixmapMode = 0;
- vis->sampleBuffers = numSamples > 0 ? 1 : 0;
- vis->samples = numSamples;
-
- return GL_TRUE;
-}
-
-
-/**
- * Destroy a visual and free its memory.
- *
- * \param vis visual.
- *
- * Frees the visual structure.
- */
-void
-_mesa_destroy_visual( GLvisual *vis )
-{
- FREE(vis);
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Context allocation, initialization, destroying
- *
- * The purpose of the most initialization functions here is to provide the
- * default state values according to the OpenGL specification.
- */
-/**********************************************************************/
-/*@{*/
-
-/**
- * One-time initialization mutex lock.
- *
- * \sa Used by one_time_init().
- */
-_glthread_DECLARE_STATIC_MUTEX(OneTimeLock);
-
-/**
- * Calls all the various one-time-init functions in Mesa.
- *
- * While holding a global mutex lock, calls several initialization functions,
- * and sets the glapi callbacks if the \c MESA_DEBUG environment variable is
- * defined.
- *
- * \sa _mesa_init_lists(), _math_init().
- */
-static void
-one_time_init( GLcontext *ctx )
-{
- static GLboolean alreadyCalled = GL_FALSE;
- (void) ctx;
- _glthread_LOCK_MUTEX(OneTimeLock);
- if (!alreadyCalled) {
- GLuint i;
-
- /* do some implementation tests */
- assert( sizeof(GLbyte) == 1 );
- assert( sizeof(GLubyte) == 1 );
- assert( sizeof(GLshort) == 2 );
- assert( sizeof(GLushort) == 2 );
- assert( sizeof(GLint) == 4 );
- assert( sizeof(GLuint) == 4 );
-
- _mesa_init_lists();
-
-#if _HAVE_FULL_GL
- _math_init();
-
- for (i = 0; i < 256; i++) {
- _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
- }
-#endif
-
-#ifdef USE_SPARC_ASM
- _mesa_init_sparc_glapi_relocs();
-#endif
- if (_mesa_getenv("MESA_DEBUG")) {
- _glapi_noop_enable_warnings(GL_TRUE);
- _glapi_set_warning_func( (_glapi_warning_func) _mesa_warning );
- }
- else {
- _glapi_noop_enable_warnings(GL_FALSE);
- }
-
-#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
- _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",
- MESA_VERSION_STRING, __DATE__, __TIME__);
-#endif
-
- alreadyCalled = GL_TRUE;
- }
- _glthread_UNLOCK_MUTEX(OneTimeLock);
-}
-
-
-/**
- * Allocate and initialize a shared context state structure.
- * Initializes the display list, texture objects and vertex programs hash
- * tables, allocates the texture objects. If it runs out of memory, frees
- * everything already allocated before returning NULL.
- *
- * \return pointer to a gl_shared_state structure on success, or NULL on
- * failure.
- */
-static GLboolean
-alloc_shared_state( GLcontext *ctx )
-{
- struct gl_shared_state *ss = CALLOC_STRUCT(gl_shared_state);
- if (!ss)
- return GL_FALSE;
-
- ctx->Shared = ss;
-
- _glthread_INIT_MUTEX(ss->Mutex);
-
- ss->DisplayList = _mesa_NewHashTable();
- ss->TexObjects = _mesa_NewHashTable();
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
- ss->Programs = _mesa_NewHashTable();
-#endif
-
-#if FEATURE_ARB_vertex_program
- ss->DefaultVertexProgram = ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
- if (!ss->DefaultVertexProgram)
- goto cleanup;
-#endif
-#if FEATURE_ARB_fragment_program
- ss->DefaultFragmentProgram = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
- if (!ss->DefaultFragmentProgram)
- goto cleanup;
-#endif
-#if FEATURE_ATI_fragment_shader
- ss->DefaultFragmentShader = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_SHADER_ATI, 0);
- if (!ss->DefaultFragmentShader)
- goto cleanup;
-#endif
-
- ss->BufferObjects = _mesa_NewHashTable();
-
- ss->GL2Objects = _mesa_NewHashTable ();
-
- ss->Default1D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D);
- if (!ss->Default1D)
- goto cleanup;
-
- ss->Default2D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D);
- if (!ss->Default2D)
- goto cleanup;
-
- ss->Default3D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_3D);
- if (!ss->Default3D)
- goto cleanup;
-
- ss->DefaultCubeMap = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_CUBE_MAP_ARB);
- if (!ss->DefaultCubeMap)
- goto cleanup;
-
- ss->DefaultRect = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_RECTANGLE_NV);
- if (!ss->DefaultRect)
- goto cleanup;
-
- /* Effectively bind the default textures to all texture units */
- ss->Default1D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->Default2D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->Default3D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS;
- ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS;
-
-#if FEATURE_EXT_framebuffer_object
- ss->FrameBuffers = _mesa_NewHashTable();
- if (!ss->FrameBuffers)
- goto cleanup;
- ss->RenderBuffers = _mesa_NewHashTable();
- if (!ss->RenderBuffers)
- goto cleanup;
-#endif
-
-
- return GL_TRUE;
-
- cleanup:
- /* Ran out of memory at some point. Free everything and return NULL */
- if (ss->DisplayList)
- _mesa_DeleteHashTable(ss->DisplayList);
- if (ss->TexObjects)
- _mesa_DeleteHashTable(ss->TexObjects);
-#if FEATURE_NV_vertex_program
- if (ss->Programs)
- _mesa_DeleteHashTable(ss->Programs);
-#endif
-#if FEATURE_ARB_vertex_program
- if (ss->DefaultVertexProgram)
- ctx->Driver.DeleteProgram(ctx, ss->DefaultVertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
- if (ss->DefaultFragmentProgram)
- ctx->Driver.DeleteProgram(ctx, ss->DefaultFragmentProgram);
-#endif
-#if FEATURE_ATI_fragment_shader
- if (ss->DefaultFragmentShader)
- ctx->Driver.DeleteProgram(ctx, ss->DefaultFragmentShader);
-#endif
-#if FEATURE_ARB_vertex_buffer_object
- if (ss->BufferObjects)
- _mesa_DeleteHashTable(ss->BufferObjects);
-#endif
-
- if (ss->GL2Objects)
- _mesa_DeleteHashTable (ss->GL2Objects);
-
-#if FEATURE_EXT_framebuffer_object
- if (ss->FrameBuffers)
- _mesa_DeleteHashTable(ss->FrameBuffers);
- if (ss->RenderBuffers)
- _mesa_DeleteHashTable(ss->RenderBuffers);
-#endif
-
- if (ss->Default1D)
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default1D);
- if (ss->Default2D)
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default2D);
- if (ss->Default3D)
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default3D);
- if (ss->DefaultCubeMap)
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultCubeMap);
- if (ss->DefaultRect)
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultRect);
- if (ss)
- _mesa_free(ss);
- return GL_FALSE;
-}
-
-/**
- * Deallocate a shared state context and all children structures.
- *
- * \param ctx GL context.
- * \param ss shared state pointer.
- *
- * Frees the display lists, the texture objects (calling the driver texture
- * deletion callback to free its private data) and the vertex programs, as well
- * as their hash tables.
- *
- * \sa alloc_shared_state().
- */
-static void
-free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
-{
- /* Free display lists */
- while (1) {
- GLuint list = _mesa_HashFirstEntry(ss->DisplayList);
- if (list) {
- _mesa_destroy_list(ctx, list);
- }
- else {
- break;
- }
- }
- _mesa_DeleteHashTable(ss->DisplayList);
-
- /* Free texture objects */
- ASSERT(ctx->Driver.DeleteTexture);
- /* the default textures */
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default1D);
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default2D);
- (*ctx->Driver.DeleteTexture)(ctx, ss->Default3D);
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultCubeMap);
- (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultRect);
- /* all other textures */
- while (1) {
- GLuint texName = _mesa_HashFirstEntry(ss->TexObjects);
- if (texName) {
- struct gl_texture_object *texObj = (struct gl_texture_object *)
- _mesa_HashLookup(ss->TexObjects, texName);
- ASSERT(texObj);
- (*ctx->Driver.DeleteTexture)(ctx, texObj);
- _mesa_HashRemove(ss->TexObjects, texName);
- }
- else {
- break;
- }
- }
- _mesa_DeleteHashTable(ss->TexObjects);
-
-#if FEATURE_NV_vertex_program
- /* Free vertex programs */
- while (1) {
- GLuint prog = _mesa_HashFirstEntry(ss->Programs);
- if (prog) {
- struct program *p = (struct program *) _mesa_HashLookup(ss->Programs,
- prog);
- ASSERT(p);
- ctx->Driver.DeleteProgram(ctx, p);
- _mesa_HashRemove(ss->Programs, prog);
- }
- else {
- break;
- }
- }
- _mesa_DeleteHashTable(ss->Programs);
-#endif
-#if FEATURE_ARB_vertex_program
- _mesa_delete_program(ctx, ss->DefaultVertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
- _mesa_delete_program(ctx, ss->DefaultFragmentProgram);
-#endif
-#if FEATURE_ATI_fragment_shader
- _mesa_delete_program(ctx, ss->DefaultFragmentShader);
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_DeleteHashTable(ss->BufferObjects);
-#endif
-
- _mesa_DeleteHashTable (ss->GL2Objects);
-
-#if FEATURE_EXT_framebuffer_object
- _mesa_DeleteHashTable(ss->FrameBuffers);
- _mesa_DeleteHashTable(ss->RenderBuffers);
-#endif
-
- _glthread_DESTROY_MUTEX(ss->Mutex);
-
- FREE(ss);
-}
-
-
-/**
- * Initialize fields of gl_current_attrib (aka ctx->Current.*)
- */
-static void
-_mesa_init_current( GLcontext *ctx )
-{
- GLuint i;
-
- /* Current group */
- for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 );
- }
- /* special cases: */
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_FOG], 0.0, 0.0, 0.0, 0.0 );
-
- ctx->Current.Index = 1;
- ctx->Current.EdgeFlag = GL_TRUE;
-}
-
-
-/**
- * Initialize fields of gl_constants (aka ctx->Const.*).
- * Use defaults from config.h. The device drivers will often override
- * some of these values (such as number of texture units).
- */
-static void
-_mesa_init_constants( GLcontext *ctx )
-{
- assert(ctx);
-
- assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
- assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
-
- /* Constants, may be overriden (usually only reduced) by device drivers */
- ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
- ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
- ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
- ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
- ctx->Const.MaxTextureUnits = MAX_TEXTURE_UNITS;
- ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
- ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
- ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
- ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
- ctx->Const.SubPixelBits = SUB_PIXEL_BITS;
- ctx->Const.MinPointSize = MIN_POINT_SIZE;
- ctx->Const.MaxPointSize = MAX_POINT_SIZE;
- ctx->Const.MinPointSizeAA = MIN_POINT_SIZE;
- ctx->Const.MaxPointSizeAA = MAX_POINT_SIZE;
- ctx->Const.PointSizeGranularity = (GLfloat) POINT_SIZE_GRANULARITY;
- ctx->Const.MinLineWidth = MIN_LINE_WIDTH;
- ctx->Const.MaxLineWidth = MAX_LINE_WIDTH;
- ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH;
- ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
- ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
- ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
- ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
- ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
- ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
- ctx->Const.MaxLights = MAX_LIGHTS;
- ctx->Const.MaxShininess = 128.0;
- ctx->Const.MaxSpotExponent = 128.0;
- ctx->Const.MaxViewportWidth = MAX_WIDTH;
- ctx->Const.MaxViewportHeight = MAX_HEIGHT;
-#if FEATURE_ARB_vertex_program
- ctx->Const.MaxVertexProgramInstructions = MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS;
- ctx->Const.MaxVertexProgramAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
- ctx->Const.MaxVertexProgramTemps = MAX_NV_VERTEX_PROGRAM_TEMPS;
- ctx->Const.MaxVertexProgramLocalParams = MAX_NV_VERTEX_PROGRAM_PARAMS;
- ctx->Const.MaxVertexProgramEnvParams = MAX_NV_VERTEX_PROGRAM_PARAMS;/*XXX*/
- ctx->Const.MaxVertexProgramAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
-#endif
-#if FEATURE_ARB_fragment_program
- ctx->Const.MaxFragmentProgramInstructions = MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS;
- ctx->Const.MaxFragmentProgramAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS;
- ctx->Const.MaxFragmentProgramTemps = MAX_NV_FRAGMENT_PROGRAM_TEMPS;
- ctx->Const.MaxFragmentProgramLocalParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
- ctx->Const.MaxFragmentProgramEnvParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS;/*XXX*/
- ctx->Const.MaxFragmentProgramAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
- ctx->Const.MaxFragmentProgramAluInstructions = MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS;
- ctx->Const.MaxFragmentProgramTexInstructions = MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS;
- ctx->Const.MaxFragmentProgramTexIndirections = MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS;
-#endif
-
- ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
- ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
-
- /* If we're running in the X server, do bounds checking to prevent
- * segfaults and server crashes!
- */
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- ctx->Const.CheckArrayBounds = GL_TRUE;
-#else
- ctx->Const.CheckArrayBounds = GL_FALSE;
-#endif
-
- ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
-
- /* GL_OES_read_format */
- ctx->Const.ColorReadFormat = GL_RGBA;
- ctx->Const.ColorReadType = GL_UNSIGNED_BYTE;
-
-#if FEATURE_EXT_framebuffer_object
- ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
- ctx->Const.MaxRenderbufferSize = MAX_WIDTH;
-#endif
-
- /* sanity checks */
- ASSERT(ctx->Const.MaxTextureUnits == MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits));
-}
-
-
-/**
- * Initialize the attribute groups in a GL context.
- *
- * \param ctx GL context.
- *
- * Initializes all the attributes, calling the respective <tt>init*</tt>
- * functions for the more complex data structures.
- */
-static GLboolean
-init_attrib_groups( GLcontext *ctx )
-{
- assert(ctx);
-
- /* Constants */
- _mesa_init_constants( ctx );
-
- /* Extensions */
- _mesa_init_extensions( ctx );
-
- /* Attribute Groups */
- _mesa_init_accum( ctx );
- _mesa_init_attrib( ctx );
- _mesa_init_buffer_objects( ctx );
- _mesa_init_color( ctx );
- _mesa_init_colortables( ctx );
- _mesa_init_current( ctx );
- _mesa_init_depth( ctx );
- _mesa_init_debug( ctx );
- _mesa_init_display_list( ctx );
- _mesa_init_eval( ctx );
- _mesa_init_feedback( ctx );
- _mesa_init_fog( ctx );
- _mesa_init_histogram( ctx );
- _mesa_init_hint( ctx );
- _mesa_init_line( ctx );
- _mesa_init_lighting( ctx );
- _mesa_init_matrix( ctx );
- _mesa_init_multisample( ctx );
- _mesa_init_occlude( ctx );
- _mesa_init_pixel( ctx );
- _mesa_init_point( ctx );
- _mesa_init_polygon( ctx );
- _mesa_init_program( ctx );
- _mesa_init_rastpos( ctx );
- _mesa_init_scissor( ctx );
- _mesa_init_shaderobjects (ctx);
- _mesa_init_stencil( ctx );
- _mesa_init_transform( ctx );
- _mesa_init_varray( ctx );
- _mesa_init_viewport( ctx );
-
- if (!_mesa_init_texture( ctx ))
- return GL_FALSE;
-
- _mesa_init_texture_s3tc( ctx );
- _mesa_init_texture_fxt1( ctx );
-
- /* Miscellaneous */
- ctx->NewState = _NEW_ALL;
- ctx->ErrorValue = (GLenum) GL_NO_ERROR;
- ctx->_Facing = 0;
-#if CHAN_TYPE == GL_FLOAT
- ctx->ClampFragmentColors = GL_FALSE; /* XXX temporary */
-#else
- ctx->ClampFragmentColors = GL_TRUE;
-#endif
- ctx->ClampVertexColors = GL_TRUE;
-
- return GL_TRUE;
-}
-
-
-/**
- * This is the default function we plug into all dispatch table slots
- * This helps prevents a segfault when someone calls a GL function without
- * first checking if the extension's supported.
- */
-static int
-generic_nop(void)
-{
- _mesa_problem(NULL, "User called no-op dispatch function (an unsupported extension function?)");
- return 0;
-}
-
-
-/**
- * Allocate and initialize a new dispatch table.
- */
-static struct _glapi_table *
-alloc_dispatch_table(void)
-{
- /* Find the larger of Mesa's dispatch table and libGL's dispatch table.
- * In practice, this'll be the same for stand-alone Mesa. But for DRI
- * Mesa we do this to accomodate different versions of libGL and various
- * DRI drivers.
- */
- GLint numEntries = MAX2(_glapi_get_dispatch_table_size(),
- sizeof(struct _glapi_table) / sizeof(_glapi_proc));
- struct _glapi_table *table =
- (struct _glapi_table *) _mesa_malloc(numEntries * sizeof(_glapi_proc));
- if (table) {
- _glapi_proc *entry = (_glapi_proc *) table;
- GLint i;
- for (i = 0; i < numEntries; i++) {
- entry[i] = (_glapi_proc) generic_nop;
- }
- }
- return table;
-}
-
-
-/**
- * Initialize a GLcontext struct (rendering context).
- *
- * This includes allocating all the other structs and arrays which hang off of
- * the context by pointers.
- * Note that the driver needs to pass in its dd_function_table here since
- * we need to at least call driverFunctions->NewTextureObject to create the
- * default texture objects.
- *
- * Called by _mesa_create_context().
- *
- * Performs the imports and exports callback tables initialization, and
- * miscellaneous one-time initializations. If no shared context is supplied one
- * is allocated, and increase its reference count. Setups the GL API dispatch
- * tables. Initialize the TNL module. Sets the maximum Z buffer depth.
- * Finally queries the \c MESA_DEBUG and \c MESA_VERBOSE environment variables
- * for debug flags.
- *
- * \param ctx the context to initialize
- * \param visual describes the visual attributes for this context
- * \param share_list points to context to share textures, display lists,
- * etc with, or NULL
- * \param driverFunctions table of device driver functions for this context
- * to use
- * \param driverContext pointer to driver-specific context data
- */
-GLboolean
-_mesa_initialize_context( GLcontext *ctx,
- const GLvisual *visual,
- GLcontext *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext )
-{
- ASSERT(driverContext);
- assert(driverFunctions->NewTextureObject);
- assert(driverFunctions->FreeTexImageData);
-
- /* If the driver wants core Mesa to use special imports, it'll have to
- * override these defaults.
- */
- _mesa_init_default_imports( &(ctx->imports), driverContext );
-
- /* initialize the exports (Mesa functions called by the window system) */
- _mesa_init_default_exports( &(ctx->exports) );
-
- /* misc one-time initializations */
- one_time_init(ctx);
-
- ctx->Visual = *visual;
- ctx->DrawBuffer = NULL;
- ctx->ReadBuffer = NULL;
- ctx->WinSysDrawBuffer = NULL;
- ctx->WinSysReadBuffer = NULL;
-
- /* Plug in driver functions and context pointer here.
- * This is important because when we call alloc_shared_state() below
- * we'll call ctx->Driver.NewTextureObject() to create the default
- * textures.
- */
- ctx->Driver = *driverFunctions;
- ctx->DriverCtx = driverContext;
-
- if (share_list) {
- /* share state with another context */
- ctx->Shared = share_list->Shared;
- }
- else {
- /* allocate new, unshared state */
- if (!alloc_shared_state( ctx )) {
- return GL_FALSE;
- }
- }
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- ctx->Shared->RefCount++;
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-
- if (!init_attrib_groups( ctx )) {
- free_shared_state(ctx, ctx->Shared);
- return GL_FALSE;
- }
-
- /* setup the API dispatch tables */
- ctx->Exec = alloc_dispatch_table();
- ctx->Save = alloc_dispatch_table();
- if (!ctx->Exec || !ctx->Save) {
- free_shared_state(ctx, ctx->Shared);
- if (ctx->Exec)
- _mesa_free(ctx->Exec);
- }
- _mesa_init_exec_table(ctx->Exec);
- ctx->CurrentDispatch = ctx->Exec;
-#if _HAVE_FULL_GL
- _mesa_init_dlist_table(ctx->Save);
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
- /* Neutral tnl module stuff */
- _mesa_init_exec_vtxfmt( ctx );
- ctx->TnlModule.Current = NULL;
- ctx->TnlModule.SwapCount = 0;
-#endif
-
- ctx->_MaintainTexEnvProgram = (_mesa_getenv("MESA_TEX_PROG") != NULL);
- ctx->_MaintainTnlProgram = (_mesa_getenv("MESA_TNL_PROG") != NULL);
-
- return GL_TRUE;
-}
-
-
-/**
- * Allocate and initialize a GLcontext structure.
- * Note that the driver needs to pass in its dd_function_table here since
- * we need to at least call driverFunctions->NewTextureObject to initialize
- * the rendering context.
- *
- * \param visual a GLvisual pointer (we copy the struct contents)
- * \param share_list another context to share display lists with or NULL
- * \param driverFunctions points to the dd_function_table into which the
- * driver has plugged in all its special functions.
- * \param driverCtx points to the device driver's private context state
- *
- * \return pointer to a new __GLcontextRec or NULL if error.
- */
-GLcontext *
-_mesa_create_context( const GLvisual *visual,
- GLcontext *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext )
-
-{
- GLcontext *ctx;
-
- ASSERT(visual);
- ASSERT(driverContext);
-
- ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext));
- if (!ctx)
- return NULL;
-
- if (_mesa_initialize_context(ctx, visual, share_list,
- driverFunctions, driverContext)) {
- return ctx;
- }
- else {
- _mesa_free(ctx);
- return NULL;
- }
-}
-
-
-/**
- * Free the data associated with the given context.
- *
- * But doesn't free the GLcontext struct itself.
- *
- * \sa _mesa_initialize_context() and init_attrib_groups().
- */
-void
-_mesa_free_context_data( GLcontext *ctx )
-{
- /* if we're destroying the current context, unbind it first */
- if (ctx == _mesa_get_current_context()) {
- _mesa_make_current(NULL, NULL, NULL);
- }
-
- _mesa_free_lighting_data( ctx );
- _mesa_free_eval_data( ctx );
- _mesa_free_texture_data( ctx );
- _mesa_free_matrix_data( ctx );
- _mesa_free_viewport_data( ctx );
- _mesa_free_colortables_data( ctx );
- _mesa_free_program_data(ctx);
- _mesa_free_occlude_data(ctx);
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj);
-#endif
-
- /* free dispatch tables */
- _mesa_free(ctx->Exec);
- _mesa_free(ctx->Save);
-
- /* Shared context state (display lists, textures, etc) */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- ctx->Shared->RefCount--;
- assert(ctx->Shared->RefCount >= 0);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- if (ctx->Shared->RefCount == 0) {
- /* free shared state */
- free_shared_state( ctx, ctx->Shared );
- }
-
- if (ctx->Extensions.String)
- FREE((void *) ctx->Extensions.String);
-}
-
-
-/**
- * Destroy a GLcontext structure.
- *
- * \param ctx GL context.
- *
- * Calls _mesa_free_context_data() and frees the GLcontext structure itself.
- */
-void
-_mesa_destroy_context( GLcontext *ctx )
-{
- if (ctx) {
- _mesa_free_context_data(ctx);
- FREE( (void *) ctx );
- }
-}
-
-
-#if _HAVE_FULL_GL
-/**
- * Copy attribute groups from one context to another.
- *
- * \param src source context
- * \param dst destination context
- * \param mask bitwise OR of GL_*_BIT flags
- *
- * According to the bits specified in \p mask, copies the corresponding
- * attributes from \p src into \p dst. For many of the attributes a simple \c
- * memcpy is not enough due to the existence of internal pointers in their data
- * structures.
- */
-void
-_mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
-{
- if (mask & GL_ACCUM_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Accum = src->Accum;
- }
- if (mask & GL_COLOR_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Color = src->Color;
- }
- if (mask & GL_CURRENT_BIT) {
- /* OK to memcpy */
- dst->Current = src->Current;
- }
- if (mask & GL_DEPTH_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Depth = src->Depth;
- }
- if (mask & GL_ENABLE_BIT) {
- /* no op */
- }
- if (mask & GL_EVAL_BIT) {
- /* OK to memcpy */
- dst->Eval = src->Eval;
- }
- if (mask & GL_FOG_BIT) {
- /* OK to memcpy */
- dst->Fog = src->Fog;
- }
- if (mask & GL_HINT_BIT) {
- /* OK to memcpy */
- dst->Hint = src->Hint;
- }
- if (mask & GL_LIGHTING_BIT) {
- GLuint i;
- /* begin with memcpy */
- MEMCPY( &dst->Light, &src->Light, sizeof(struct gl_light) );
- /* fixup linked lists to prevent pointer insanity */
- make_empty_list( &(dst->Light.EnabledList) );
- for (i = 0; i < MAX_LIGHTS; i++) {
- if (dst->Light.Light[i].Enabled) {
- insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i]));
- }
- }
- }
- if (mask & GL_LINE_BIT) {
- /* OK to memcpy */
- dst->Line = src->Line;
- }
- if (mask & GL_LIST_BIT) {
- /* OK to memcpy */
- dst->List = src->List;
- }
- if (mask & GL_PIXEL_MODE_BIT) {
- /* OK to memcpy */
- dst->Pixel = src->Pixel;
- }
- if (mask & GL_POINT_BIT) {
- /* OK to memcpy */
- dst->Point = src->Point;
- }
- if (mask & GL_POLYGON_BIT) {
- /* OK to memcpy */
- dst->Polygon = src->Polygon;
- }
- if (mask & GL_POLYGON_STIPPLE_BIT) {
- /* Use loop instead of MEMCPY due to problem with Portland Group's
- * C compiler. Reported by John Stone.
- */
- GLuint i;
- for (i = 0; i < 32; i++) {
- dst->PolygonStipple[i] = src->PolygonStipple[i];
- }
- }
- if (mask & GL_SCISSOR_BIT) {
- /* OK to memcpy */
- dst->Scissor = src->Scissor;
- }
- if (mask & GL_STENCIL_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Stencil = src->Stencil;
- }
- if (mask & GL_TEXTURE_BIT) {
- /* Cannot memcpy because of pointers */
- _mesa_copy_texture_state(src, dst);
- }
- if (mask & GL_TRANSFORM_BIT) {
- /* OK to memcpy */
- dst->Transform = src->Transform;
- }
- if (mask & GL_VIEWPORT_BIT) {
- /* Cannot use memcpy, because of pointers in GLmatrix _WindowMap */
- dst->Viewport.X = src->Viewport.X;
- dst->Viewport.Y = src->Viewport.Y;
- dst->Viewport.Width = src->Viewport.Width;
- dst->Viewport.Height = src->Viewport.Height;
- dst->Viewport.Near = src->Viewport.Near;
- dst->Viewport.Far = src->Viewport.Far;
- _math_matrix_copy(&dst->Viewport._WindowMap, &src->Viewport._WindowMap);
- }
-
- /* XXX FIXME: Call callbacks?
- */
- dst->NewState = _NEW_ALL;
-}
-#endif
-
-
-/**
- * Check if the given context can render into the given framebuffer
- * by checking visual attributes.
- * \return GL_TRUE if compatible, GL_FALSE otherwise.
- */
-static GLboolean
-check_compatible(const GLcontext *ctx, const GLframebuffer *buffer)
-{
- const GLvisual *ctxvis = &ctx->Visual;
- const GLvisual *bufvis = &buffer->Visual;
-
- if (ctxvis == bufvis)
- return GL_TRUE;
-
- if (ctxvis->rgbMode != bufvis->rgbMode)
- return GL_FALSE;
- if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode)
- return GL_FALSE;
- if (ctxvis->stereoMode && !bufvis->stereoMode)
- return GL_FALSE;
- if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer)
- return GL_FALSE;
- if (ctxvis->haveDepthBuffer && !bufvis->haveDepthBuffer)
- return GL_FALSE;
- if (ctxvis->haveStencilBuffer && !bufvis->haveStencilBuffer)
- return GL_FALSE;
- if (ctxvis->redMask && ctxvis->redMask != bufvis->redMask)
- return GL_FALSE;
- if (ctxvis->greenMask && ctxvis->greenMask != bufvis->greenMask)
- return GL_FALSE;
- if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask)
- return GL_FALSE;
- if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits)
- return GL_FALSE;
- if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-/**
- * Bind the given context to the given draw-buffer and read-buffer and
- * make it the current context for this thread.
- *
- * \param newCtx new GL context. If NULL then there will be no current GL
- * context.
- * \param drawBuffer draw framebuffer.
- * \param readBuffer read framebuffer.
- *
- * Check that the context's and framebuffer's visuals are compatible, returning
- * immediately otherwise. Sets the glapi current context via
- * _glapi_set_context(). If \p newCtx is not NULL, associates \p drawBuffer and
- * \p readBuffer with it and calls dd_function_table::ResizeBuffers if the buffers size has changed.
- * Calls dd_function_table::MakeCurrent callback if defined.
- *
- * When a context is bound by the first time and the \c MESA_INFO environment
- * variable is set it calls print_info() as an aid for remote user
- * troubleshooting.
- */
-void
-_mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
- GLframebuffer *readBuffer )
-{
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(newCtx, "_mesa_make_current()\n");
-
- /* Check that the context's and framebuffer's visuals are compatible.
- */
- if (newCtx && drawBuffer && newCtx->DrawBuffer != drawBuffer) {
- if (!check_compatible(newCtx, drawBuffer))
- return;
- }
- if (newCtx && readBuffer && newCtx->ReadBuffer != readBuffer) {
- if (!check_compatible(newCtx, readBuffer))
- return;
- }
-
-#if !defined(IN_DRI_DRIVER)
- /* We call this function periodically (just here for now) in
- * order to detect when multithreading has begun. In a DRI driver, this
- * step is done by the driver loader (e.g., libGL).
- */
- _glapi_check_multithread();
-#endif /* !defined(IN_DRI_DRIVER) */
-
- _glapi_set_context((void *) newCtx);
- ASSERT(_mesa_get_current_context() == newCtx);
-
- if (!newCtx) {
- _glapi_set_dispatch(NULL); /* none current */
- }
- else {
- _glapi_set_dispatch(newCtx->CurrentDispatch);
-
- if (drawBuffer && readBuffer) {
- /* TODO: check if newCtx and buffer's visual match??? */
-
- ASSERT(drawBuffer->Name == 0);
- ASSERT(readBuffer->Name == 0);
- newCtx->WinSysDrawBuffer = drawBuffer;
- newCtx->WinSysReadBuffer = readBuffer;
- /* don't replace user-buffer bindings with window system buffer */
- if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
- newCtx->DrawBuffer = drawBuffer;
- newCtx->ReadBuffer = readBuffer;
- }
-
- newCtx->NewState |= _NEW_BUFFERS;
-
-#if _HAVE_FULL_GL
- if (!drawBuffer->Initialized) {
- /* get initial window size */
- GLuint bufWidth, bufHeight;
- /* ask device driver for size of the buffer */
- (*newCtx->Driver.GetBufferSize)(drawBuffer, &bufWidth, &bufHeight);
- /* set initial buffer size */
- if (newCtx->Driver.ResizeBuffers)
- newCtx->Driver.ResizeBuffers(newCtx, drawBuffer,
- bufWidth, bufHeight);
- drawBuffer->Initialized = GL_TRUE;
- }
-
- if (readBuffer != drawBuffer && !readBuffer->Initialized) {
- /* get initial window size */
- GLuint bufWidth, bufHeight;
- /* ask device driver for size of the buffer */
- (*newCtx->Driver.GetBufferSize)(readBuffer, &bufWidth, &bufHeight);
- /* set initial buffer size */
- if (newCtx->Driver.ResizeBuffers)
- newCtx->Driver.ResizeBuffers(newCtx, readBuffer,
- bufWidth, bufHeight);
- readBuffer->Initialized = GL_TRUE;
- }
-#endif
- if (newCtx->FirstTimeCurrent) {
- /* set initial viewport and scissor size now */
- _mesa_set_viewport(newCtx, 0, 0, drawBuffer->Width, drawBuffer->Height);
- newCtx->Scissor.Width = drawBuffer->Width;
- newCtx->Scissor.Height = drawBuffer->Height;
- }
- }
-
- /* Alert the driver - usually passed on to the sw t&l module,
- * but also used to detect threaded cases in the radeon codegen
- * hw t&l module.
- */
- if (newCtx->Driver.MakeCurrent)
- newCtx->Driver.MakeCurrent( newCtx, drawBuffer, readBuffer );
-
- /* We can use this to help debug user's problems. Tell them to set
- * the MESA_INFO env variable before running their app. Then the
- * first time each context is made current we'll print some useful
- * information.
- */
- if (newCtx->FirstTimeCurrent) {
- if (_mesa_getenv("MESA_INFO")) {
- _mesa_print_info();
- }
- newCtx->FirstTimeCurrent = GL_FALSE;
- }
- }
-}
-
-
-/**
- * Make context 'ctx' share the display lists, textures and programs
- * that are associated with 'ctxToShare'.
- * Any display lists, textures or programs associated with 'ctx' will
- * be deleted if nobody else is sharing them.
- */
-GLboolean
-_mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare)
-{
- if (ctx && ctxToShare && ctx->Shared && ctxToShare->Shared) {
- ctx->Shared->RefCount--;
- if (ctx->Shared->RefCount == 0) {
- free_shared_state(ctx, ctx->Shared);
- }
- ctx->Shared = ctxToShare->Shared;
- ctx->Shared->RefCount++;
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * Get current context for the calling thread.
- *
- * \return pointer to the current GL context.
- *
- * Calls _glapi_get_context(). This isn't the fastest way to get the current
- * context. If you need speed, see the #GET_CURRENT_CONTEXT macro in context.h.
- */
-GLcontext *
-_mesa_get_current_context( void )
-{
- return (GLcontext *) _glapi_get_context();
-}
-
-/**
- * Get context's current API dispatch table.
- *
- * It'll either be the immediate-mode execute dispatcher or the display list
- * compile dispatcher.
- *
- * \param ctx GL context.
- *
- * \return pointer to dispatch_table.
- *
- * Simply returns __GLcontextRec::CurrentDispatch.
- */
-struct _glapi_table *
-_mesa_get_dispatch(GLcontext *ctx)
-{
- return ctx->CurrentDispatch;
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Miscellaneous functions */
-/**********************************************************************/
-/*@{*/
-
-/**
- * Record an error.
- *
- * \param ctx GL context.
- * \param error error code.
- *
- * Records the given error code and call the driver's dd_function_table::Error
- * function if defined.
- *
- * \sa
- * This is called via _mesa_error().
- */
-void
-_mesa_record_error( GLcontext *ctx, GLenum error )
-{
- if (!ctx)
- return;
-
- if (ctx->ErrorValue == GL_NO_ERROR) {
- ctx->ErrorValue = error;
- }
-
- /* Call device driver's error handler, if any. This is used on the Mac. */
- if (ctx->Driver.Error) {
- (*ctx->Driver.Error)( ctx );
- }
-}
-
-/**
- * Execute glFinish().
- *
- * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
- * dd_function_table::Finish driver callback, if not NULL.
- */
-void GLAPIENTRY
-_mesa_Finish( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->Driver.Finish) {
- (*ctx->Driver.Finish)( ctx );
- }
-}
-
-/**
- * Execute glFlush().
- *
- * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
- * dd_function_table::Flush driver callback, if not NULL.
- */
-void GLAPIENTRY
-_mesa_Flush( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->Driver.Flush) {
- (*ctx->Driver.Flush)( ctx );
- }
-}
-
-
-/*@}*/
diff --git a/nx-X11/extras/Mesa/src/mesa/main/descrip.mms b/nx-X11/extras/Mesa/src/mesa/main/descrip.mms
deleted file mode 100644
index ce298229c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/descrip.mms
+++ /dev/null
@@ -1,210 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 10 May 2005
-
-.first
- define gl [---.include.gl]
- define math [-.math]
- define shader [-.shader]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.glapi],[-.shader]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES =accum.c \
- api_arrayelt.c \
- api_loopback.c \
- api_noop.c \
- api_validate.c \
- attrib.c \
- blend.c \
- bufferobj.c \
- buffers.c \
- clip.c \
- colortab.c \
- context.c \
- convolve.c \
- debug.c \
- depth.c \
- dispatch.c \
- dlist.c \
- drawpix.c \
- enable.c \
- enums.c \
- eval.c \
- execmem.c \
- extensions.c \
- fbobject.c \
- feedback.c \
- fog.c \
- framebuffer.c \
- get.c \
- getstring.c \
- hash.c \
- hint.c \
- histogram.c \
- image.c \
- imports.c \
- light.c \
- lines.c \
- matrix.c \
- mm.c \
- occlude.c \
- pixel.c \
- points.c \
- polygon.c \
- rastpos.c \
- renderbuffer.c \
- state.c \
- stencil.c \
- texcompress.c \
- texcompress_fxt1.c \
- texcompress_s3tc.c \
- texenvprogram.c \
- texformat.c \
- teximage.c \
- texobj.c \
- texrender.c \
- texstate.c \
- texstore.c \
- varray.c \
- vtxfmt.c
-
-OBJECTS=accum.obj,\
-api_arrayelt.obj,\
-api_loopback.obj,\
-api_noop.obj,\
-api_validate.obj,\
-attrib.obj,\
-blend.obj,\
-bufferobj.obj,\
-buffers.obj,\
-clip.obj,\
-colortab.obj,\
-context.obj,\
-convolve.obj,\
-debug.obj,\
-depth.obj,\
-dispatch.obj,\
-dlist.obj,\
-drawpix.obj,\
-enable.obj,\
-enums.obj,\
-eval.obj,\
-execmem.obj,\
-extensions.obj,\
-fbobject.obj,\
-feedback.obj,\
-fog.obj,\
-framebuffer.obj,\
-get.obj,\
-getstring.obj,\
-hash.obj,\
-hint.obj,\
-histogram.obj,\
-image.obj,\
-imports.obj,\
-light.obj,\
-lines.obj,\
-matrix.obj,\
-mm.obj,\
-occlude.obj,\
-pixel.obj,\
-points.obj,\
-polygon.obj,\
-rastpos.obj,\
-renderbuffer.obj,\
-state.obj,\
-stencil.obj,\
-texcompress.obj,\
-texcompress_fxt1.obj,\
-texcompress_s3tc.obj,\
-texenvprogram.obj,\
-texformat.obj,\
-teximage.obj,\
-texobj.obj,\
-texrender.obj,\
-texstate.obj,\
-texstore.obj,\
-varray.obj,\
-vtxfmt.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ $(MAKELIB) $(GL_LIB) $(OBJECTS)
- @ rename $(GL_LIB)* $(LIBDIR)
-
-clean :
- purge
- delete *.obj;*
-
-accum.obj : accum.c
-api_arrayelt.obj : api_arrayelt.c
-api_loopback.obj : api_loopback.c
-api_noop.obj : api_noop.c
-api_validate.obj : api_validate.c
-attrib.obj : attrib.c
-blend.obj : blend.c
-bufferobj.obj : bufferobj.c
-buffers.obj : buffers.c
-clip.obj : clip.c
-colortab.obj : colortab.c
-context.obj : context.c
-convolve.obj : convolve.c
-debug.obj : debug.c
-depth.obj : depth.c
-dispatch.obj : dispatch.c
-dlist.obj : dlist.c
-drawpix.obj : drawpix.c
-enable.obj : enable.c
-enums.obj : enums.c
-eval.obj : eval.c
-execmem.obj : execmem.c
-extensions.obj : extensions.c
-fbobject.obj : fbobject.c
-feedback.obj : feedback.c
-fog.obj : fog.c
-framebuffer.obj : framebuffer.c
-get.obj : get.c
-getstring.obj : getstring.c
-hash.obj : hash.c
-hint.obj : hint.c
-histogram.obj : histogram.c
-image.obj : image.c
-imports.obj : imports.c vsnprintf.c
-light.obj : light.c
-lines.obj : lines.c
-matrix.obj : matrix.c
-mm.obj: mm.c
-occlude.obj : occlude.c
-pixel.obj : pixel.c
-points.obj : points.c
-polygon.obj : polygon.c
-rastpos.obj : rastpos.c
-renderbuffer.obj : renderbuffer.c
-state.obj : state.c
-stencil.obj : stencil.c
-texcompress.obj : texcompress.c
-texcompress_fxt1.obj : texcompress_fxt1.c
- cc$(CFLAGS)/warn=(disable=SHIFTCOUNT) texcompress_fxt1.c
-texcompress_s3tc.obj : texcompress_s3tc.c
-texenvprogram.obj : texenvprogram.c
-texformat.obj : texformat.c
-teximage.obj : teximage.c
-texobj.obj : texobj.c
-texrender.obj : texrender.c
-texstate.obj : texstate.c
-texstore.obj : texstore.c
-varray.obj : varray.c
-vtxfmt.obj : vtxfmt.c
diff --git a/nx-X11/extras/Mesa/src/mesa/main/get_gen.py b/nx-X11/extras/Mesa/src/mesa/main/get_gen.py
deleted file mode 100644
index 32a5a3d77..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/get_gen.py
+++ /dev/null
@@ -1,1200 +0,0 @@
-#!/usr/bin/env python
-
-# Mesa 3-D graphics library
-#
-# Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-# This script is used to generate the get.c file:
-# python get_gen.py > get.c
-
-
-import string
-
-
-GLint = 1
-GLenum = 2
-GLfloat = 3
-GLdouble = 4
-GLboolean = 5
-GLfloatN = 6 # A normalized value, such as a color or depth range
-
-
-TypeStrings = {
- GLint : "GLint",
- GLenum : "GLenum",
- GLfloat : "GLfloat",
- GLdouble : "GLdouble",
- GLboolean : "GLboolean"
-}
-
-
-# Each entry is a tuple of:
-# - the GL state name, such as GL_CURRENT_COLOR
-# - the state datatype, one of GLint, GLfloat, GLboolean or GLenum
-# - list of code fragments to get the state, such as ["ctx->Foo.Bar"]
-# - optional extra code or empty string
-# - optional extension to check, or None (XXX this should be a list!)
-#
-StateVars = [
- ( "GL_ACCUM_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.accumRedBits"],
- "", None ),
- ( "GL_ACCUM_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.accumGreenBits"],
- "", None ),
- ( "GL_ACCUM_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.accumBlueBits"],
- "", None ),
- ( "GL_ACCUM_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.accumAlphaBits"],
- "", None ),
- ( "GL_ACCUM_CLEAR_VALUE", GLfloatN,
- [ "ctx->Accum.ClearColor[0]",
- "ctx->Accum.ClearColor[1]",
- "ctx->Accum.ClearColor[2]",
- "ctx->Accum.ClearColor[3]" ],
- "", None ),
- ( "GL_ALPHA_BIAS", GLfloat, ["ctx->Pixel.AlphaBias"], "", None ),
- ( "GL_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.alphaBits"],
- "", None ),
- ( "GL_ALPHA_SCALE", GLfloat, ["ctx->Pixel.AlphaScale"], "", None ),
- ( "GL_ALPHA_TEST", GLboolean, ["ctx->Color.AlphaEnabled"], "", None ),
- ( "GL_ALPHA_TEST_FUNC", GLenum, ["ctx->Color.AlphaFunc"], "", None ),
- ( "GL_ALPHA_TEST_REF", GLfloatN, ["ctx->Color.AlphaRef"], "", None ),
- ( "GL_ATTRIB_STACK_DEPTH", GLint, ["ctx->AttribStackDepth"], "", None ),
- ( "GL_AUTO_NORMAL", GLboolean, ["ctx->Eval.AutoNormal"], "", None ),
- ( "GL_AUX_BUFFERS", GLint, ["ctx->DrawBuffer->Visual.numAuxBuffers"],
- "", None ),
- ( "GL_BLEND", GLboolean, ["ctx->Color.BlendEnabled"], "", None ),
- ( "GL_BLEND_DST", GLenum, ["ctx->Color.BlendDstRGB"], "", None ),
- ( "GL_BLEND_SRC", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ),
- ( "GL_BLEND_SRC_RGB_EXT", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ),
- ( "GL_BLEND_DST_RGB_EXT", GLenum, ["ctx->Color.BlendDstRGB"], "", None ),
- ( "GL_BLEND_SRC_ALPHA_EXT", GLenum, ["ctx->Color.BlendSrcA"], "", None ),
- ( "GL_BLEND_DST_ALPHA_EXT", GLenum, ["ctx->Color.BlendDstA"], "", None ),
- ( "GL_BLEND_EQUATION", GLenum, ["ctx->Color.BlendEquationRGB "], "", None),
- ( "GL_BLEND_EQUATION_ALPHA_EXT", GLenum, ["ctx->Color.BlendEquationA "],
- "", None ),
- ( "GL_BLEND_COLOR_EXT", GLfloatN,
- [ "ctx->Color.BlendColor[0]",
- "ctx->Color.BlendColor[1]",
- "ctx->Color.BlendColor[2]",
- "ctx->Color.BlendColor[3]"], "", None ),
- ( "GL_BLUE_BIAS", GLfloat, ["ctx->Pixel.BlueBias"], "", None ),
- ( "GL_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.blueBits"], "", None ),
- ( "GL_BLUE_SCALE", GLfloat, ["ctx->Pixel.BlueScale"], "", None ),
- ( "GL_CLIENT_ATTRIB_STACK_DEPTH", GLint,
- ["ctx->ClientAttribStackDepth"], "", None ),
- ( "GL_CLIP_PLANE0", GLboolean,
- [ "(ctx->Transform.ClipPlanesEnabled >> 0) & 1" ], "", None ),
- ( "GL_CLIP_PLANE1", GLboolean,
- [ "(ctx->Transform.ClipPlanesEnabled >> 1) & 1" ], "", None ),
- ( "GL_CLIP_PLANE2", GLboolean,
- [ "(ctx->Transform.ClipPlanesEnabled >> 2) & 1" ], "", None ),
- ( "GL_CLIP_PLANE3", GLboolean,
- [ "(ctx->Transform.ClipPlanesEnabled >> 3) & 1" ], "", None ),
- ( "GL_CLIP_PLANE4", GLboolean,
- [ "(ctx->Transform.ClipPlanesEnabled >> 4) & 1" ], "", None ),
- ( "GL_CLIP_PLANE5", GLboolean,
- [ "(ctx->Transform.ClipPlanesEnabled >> 5) & 1" ], "", None ),
- ( "GL_COLOR_CLEAR_VALUE", GLfloatN,
- [ "ctx->Color.ClearColor[0]",
- "ctx->Color.ClearColor[1]",
- "ctx->Color.ClearColor[2]",
- "ctx->Color.ClearColor[3]" ], "", None ),
- ( "GL_COLOR_MATERIAL", GLboolean,
- ["ctx->Light.ColorMaterialEnabled"], "", None ),
- ( "GL_COLOR_MATERIAL_FACE", GLenum,
- ["ctx->Light.ColorMaterialFace"], "", None ),
- ( "GL_COLOR_MATERIAL_PARAMETER", GLenum,
- ["ctx->Light.ColorMaterialMode"], "", None ),
- ( "GL_COLOR_WRITEMASK", GLint,
- [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0",
- "ctx->Color.ColorMask[GCOMP] ? 1 : 0",
- "ctx->Color.ColorMask[BCOMP] ? 1 : 0",
- "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ),
- ( "GL_CULL_FACE", GLboolean, ["ctx->Polygon.CullFlag"], "", None ),
- ( "GL_CULL_FACE_MODE", GLenum, ["ctx->Polygon.CullFaceMode"], "", None ),
- ( "GL_CURRENT_COLOR", GLfloatN,
- [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]",
- "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]",
- "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]",
- "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]" ],
- "FLUSH_CURRENT(ctx, 0);", None ),
- ( "GL_CURRENT_INDEX", GLfloat, ["ctx->Current.Index"],
- "FLUSH_CURRENT(ctx, 0);", None ),
- ( "GL_CURRENT_NORMAL", GLfloatN,
- [ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]",
- "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]",
- "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]"],
- "FLUSH_CURRENT(ctx, 0);", None ),
- ( "GL_CURRENT_RASTER_COLOR", GLfloatN,
- ["ctx->Current.RasterColor[0]",
- "ctx->Current.RasterColor[1]",
- "ctx->Current.RasterColor[2]",
- "ctx->Current.RasterColor[3]"], "", None ),
- ( "GL_CURRENT_RASTER_DISTANCE", GLfloat,
- ["ctx->Current.RasterDistance"], "", None ),
- ( "GL_CURRENT_RASTER_INDEX", GLfloat,
- ["ctx->Current.RasterIndex"], "", None ),
- ( "GL_CURRENT_RASTER_POSITION", GLfloat,
- ["ctx->Current.RasterPos[0]",
- "ctx->Current.RasterPos[1]",
- "ctx->Current.RasterPos[2]",
- "ctx->Current.RasterPos[3]"], "", None ),
- ( "GL_CURRENT_RASTER_TEXTURE_COORDS", GLfloat,
- ["ctx->Current.RasterTexCoords[texUnit][0]",
- "ctx->Current.RasterTexCoords[texUnit][1]",
- "ctx->Current.RasterTexCoords[texUnit][2]",
- "ctx->Current.RasterTexCoords[texUnit][3]"],
- "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ),
- ( "GL_CURRENT_RASTER_POSITION_VALID", GLboolean,
- ["ctx->Current.RasterPosValid"], "", None ),
- ( "GL_CURRENT_TEXTURE_COORDS", GLfloat,
- ["ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]",
- "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]",
- "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]",
- "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"],
- "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ),
- ( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ),
- ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"],
- "", None ),
- ( "GL_DEPTH_CLEAR_VALUE", GLfloat, ["ctx->Depth.Clear"], "", None ),
- ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ),
- ( "GL_DEPTH_RANGE", GLfloatN,
- [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ),
- ( "GL_DEPTH_SCALE", GLfloat, ["ctx->Pixel.DepthScale"], "", None ),
- ( "GL_DEPTH_TEST", GLboolean, ["ctx->Depth.Test"], "", None ),
- ( "GL_DEPTH_WRITEMASK", GLboolean, ["ctx->Depth.Mask"], "", None ),
- ( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ),
- ( "GL_DOUBLEBUFFER", GLboolean,
- ["ctx->DrawBuffer->Visual.doubleBufferMode"], "", None ),
- ( "GL_DRAW_BUFFER", GLenum, ["ctx->Color.DrawBuffer[0]"], "", None ),
- ( "GL_EDGE_FLAG", GLboolean, ["ctx->Current.EdgeFlag"],
- "FLUSH_CURRENT(ctx, 0);", None ),
- ( "GL_FEEDBACK_BUFFER_SIZE", GLint, ["ctx->Feedback.BufferSize"], "", None ),
- ( "GL_FEEDBACK_BUFFER_TYPE", GLenum, ["ctx->Feedback.Type"], "", None ),
- ( "GL_FOG", GLboolean, ["ctx->Fog.Enabled"], "", None ),
- ( "GL_FOG_COLOR", GLfloatN,
- [ "ctx->Fog.Color[0]",
- "ctx->Fog.Color[1]",
- "ctx->Fog.Color[2]",
- "ctx->Fog.Color[3]" ], "", None ),
- ( "GL_FOG_DENSITY", GLfloat, ["ctx->Fog.Density"], "", None ),
- ( "GL_FOG_END", GLfloat, ["ctx->Fog.End"], "", None ),
- ( "GL_FOG_HINT", GLenum, ["ctx->Hint.Fog"], "", None ),
- ( "GL_FOG_INDEX", GLfloat, ["ctx->Fog.Index"], "", None ),
- ( "GL_FOG_MODE", GLenum, ["ctx->Fog.Mode"], "", None ),
- ( "GL_FOG_START", GLfloat, ["ctx->Fog.Start"], "", None ),
- ( "GL_FRONT_FACE", GLenum, ["ctx->Polygon.FrontFace"], "", None ),
- ( "GL_GREEN_BIAS", GLfloat, ["ctx->Pixel.GreenBias"], "", None ),
- ( "GL_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.greenBits"],
- "", None ),
- ( "GL_GREEN_SCALE", GLfloat, ["ctx->Pixel.GreenScale"], "", None ),
- ( "GL_INDEX_BITS", GLint, ["ctx->DrawBuffer->Visual.indexBits"],
- "", None ),
- ( "GL_INDEX_CLEAR_VALUE", GLint, ["ctx->Color.ClearIndex"], "", None ),
- ( "GL_INDEX_MODE", GLboolean, ["!ctx->DrawBuffer->Visual.rgbMode"],
- "", None ),
- ( "GL_INDEX_OFFSET", GLint, ["ctx->Pixel.IndexOffset"], "", None ),
- ( "GL_INDEX_SHIFT", GLint, ["ctx->Pixel.IndexShift"], "", None ),
- ( "GL_INDEX_WRITEMASK", GLint, ["ctx->Color.IndexMask"], "", None ),
- ( "GL_LIGHT0", GLboolean, ["ctx->Light.Light[0].Enabled"], "", None ),
- ( "GL_LIGHT1", GLboolean, ["ctx->Light.Light[1].Enabled"], "", None ),
- ( "GL_LIGHT2", GLboolean, ["ctx->Light.Light[2].Enabled"], "", None ),
- ( "GL_LIGHT3", GLboolean, ["ctx->Light.Light[3].Enabled"], "", None ),
- ( "GL_LIGHT4", GLboolean, ["ctx->Light.Light[4].Enabled"], "", None ),
- ( "GL_LIGHT5", GLboolean, ["ctx->Light.Light[5].Enabled"], "", None ),
- ( "GL_LIGHT6", GLboolean, ["ctx->Light.Light[6].Enabled"], "", None ),
- ( "GL_LIGHT7", GLboolean, ["ctx->Light.Light[7].Enabled"], "", None ),
- ( "GL_LIGHTING", GLboolean, ["ctx->Light.Enabled"], "", None ),
- ( "GL_LIGHT_MODEL_AMBIENT", GLfloatN,
- ["ctx->Light.Model.Ambient[0]",
- "ctx->Light.Model.Ambient[1]",
- "ctx->Light.Model.Ambient[2]",
- "ctx->Light.Model.Ambient[3]"], "", None ),
- ( "GL_LIGHT_MODEL_COLOR_CONTROL", GLenum,
- ["ctx->Light.Model.ColorControl"], "", None ),
- ( "GL_LIGHT_MODEL_LOCAL_VIEWER", GLboolean,
- ["ctx->Light.Model.LocalViewer"], "", None ),
- ( "GL_LIGHT_MODEL_TWO_SIDE", GLboolean, ["ctx->Light.Model.TwoSide"], "", None ),
- ( "GL_LINE_SMOOTH", GLboolean, ["ctx->Line.SmoothFlag"], "", None ),
- ( "GL_LINE_SMOOTH_HINT", GLenum, ["ctx->Hint.LineSmooth"], "", None ),
- ( "GL_LINE_STIPPLE", GLboolean, ["ctx->Line.StippleFlag"], "", None ),
- ( "GL_LINE_STIPPLE_PATTERN", GLint, ["ctx->Line.StipplePattern"], "", None ),
- ( "GL_LINE_STIPPLE_REPEAT", GLint, ["ctx->Line.StippleFactor"], "", None ),
- ( "GL_LINE_WIDTH", GLfloat, ["ctx->Line.Width"], "", None ),
- ( "GL_LINE_WIDTH_GRANULARITY", GLfloat,
- ["ctx->Const.LineWidthGranularity"], "", None ),
- ( "GL_LINE_WIDTH_RANGE", GLfloat,
- ["ctx->Const.MinLineWidthAA",
- "ctx->Const.MaxLineWidthAA"], "", None ),
- ( "GL_ALIASED_LINE_WIDTH_RANGE", GLfloat,
- ["ctx->Const.MinLineWidth",
- "ctx->Const.MaxLineWidth"], "", None ),
- ( "GL_LIST_BASE", GLint, ["ctx->List.ListBase"], "", None ),
- ( "GL_LIST_INDEX", GLint, ["ctx->ListState.CurrentListNum"], "", None ),
- ( "GL_LIST_MODE", GLenum, ["mode"],
- """GLenum mode;
- if (!ctx->CompileFlag)
- mode = 0;
- else if (ctx->ExecuteFlag)
- mode = GL_COMPILE_AND_EXECUTE;
- else
- mode = GL_COMPILE;""", None ),
- ( "GL_INDEX_LOGIC_OP", GLboolean, ["ctx->Color.IndexLogicOpEnabled"], "", None ),
- ( "GL_COLOR_LOGIC_OP", GLboolean, ["ctx->Color.ColorLogicOpEnabled"], "", None ),
- ( "GL_LOGIC_OP_MODE", GLenum, ["ctx->Color.LogicOp"], "", None ),
- ( "GL_MAP1_COLOR_4", GLboolean, ["ctx->Eval.Map1Color4"], "", None ),
- ( "GL_MAP1_GRID_DOMAIN", GLfloat,
- ["ctx->Eval.MapGrid1u1",
- "ctx->Eval.MapGrid1u2"], "", None ),
- ( "GL_MAP1_GRID_SEGMENTS", GLint, ["ctx->Eval.MapGrid1un"], "", None ),
- ( "GL_MAP1_INDEX", GLboolean, ["ctx->Eval.Map1Index"], "", None ),
- ( "GL_MAP1_NORMAL", GLboolean, ["ctx->Eval.Map1Normal"], "", None ),
- ( "GL_MAP1_TEXTURE_COORD_1", GLboolean, ["ctx->Eval.Map1TextureCoord1"], "", None ),
- ( "GL_MAP1_TEXTURE_COORD_2", GLboolean, ["ctx->Eval.Map1TextureCoord2"], "", None ),
- ( "GL_MAP1_TEXTURE_COORD_3", GLboolean, ["ctx->Eval.Map1TextureCoord3"], "", None ),
- ( "GL_MAP1_TEXTURE_COORD_4", GLboolean, ["ctx->Eval.Map1TextureCoord4"], "", None ),
- ( "GL_MAP1_VERTEX_3", GLboolean, ["ctx->Eval.Map1Vertex3"], "", None ),
- ( "GL_MAP1_VERTEX_4", GLboolean, ["ctx->Eval.Map1Vertex4"], "", None ),
- ( "GL_MAP2_COLOR_4", GLboolean, ["ctx->Eval.Map2Color4"], "", None ),
- ( "GL_MAP2_GRID_DOMAIN", GLfloat,
- ["ctx->Eval.MapGrid2u1",
- "ctx->Eval.MapGrid2u2",
- "ctx->Eval.MapGrid2v1",
- "ctx->Eval.MapGrid2v2"], "", None ),
- ( "GL_MAP2_GRID_SEGMENTS", GLint,
- ["ctx->Eval.MapGrid2un",
- "ctx->Eval.MapGrid2vn"], "", None ),
- ( "GL_MAP2_INDEX", GLboolean, ["ctx->Eval.Map2Index"], "", None ),
- ( "GL_MAP2_NORMAL", GLboolean, ["ctx->Eval.Map2Normal"], "", None ),
- ( "GL_MAP2_TEXTURE_COORD_1", GLboolean, ["ctx->Eval.Map2TextureCoord1"], "", None ),
- ( "GL_MAP2_TEXTURE_COORD_2", GLboolean, ["ctx->Eval.Map2TextureCoord2"], "", None ),
- ( "GL_MAP2_TEXTURE_COORD_3", GLboolean, ["ctx->Eval.Map2TextureCoord3"], "", None ),
- ( "GL_MAP2_TEXTURE_COORD_4", GLboolean, ["ctx->Eval.Map2TextureCoord4"], "", None ),
- ( "GL_MAP2_VERTEX_3", GLboolean, ["ctx->Eval.Map2Vertex3"], "", None ),
- ( "GL_MAP2_VERTEX_4", GLboolean, ["ctx->Eval.Map2Vertex4"], "", None ),
- ( "GL_MAP_COLOR", GLboolean, ["ctx->Pixel.MapColorFlag"], "", None ),
- ( "GL_MAP_STENCIL", GLboolean, ["ctx->Pixel.MapStencilFlag"], "", None ),
- ( "GL_MATRIX_MODE", GLenum, ["ctx->Transform.MatrixMode"], "", None ),
-
- ( "GL_MAX_ATTRIB_STACK_DEPTH", GLint, ["MAX_ATTRIB_STACK_DEPTH"], "", None ),
- ( "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", GLint, ["MAX_CLIENT_ATTRIB_STACK_DEPTH"], "", None ),
- ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ),
- ( "GL_MAX_ELEMENTS_VERTICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ),
- ( "GL_MAX_ELEMENTS_INDICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ),
- ( "GL_MAX_EVAL_ORDER", GLint, ["MAX_EVAL_ORDER"], "", None ),
- ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ),
- ( "GL_MAX_LIST_NESTING", GLint, ["MAX_LIST_NESTING"], "", None ),
- ( "GL_MAX_MODELVIEW_STACK_DEPTH", GLint, ["MAX_MODELVIEW_STACK_DEPTH"], "", None ),
- ( "GL_MAX_NAME_STACK_DEPTH", GLint, ["MAX_NAME_STACK_DEPTH"], "", None ),
- ( "GL_MAX_PIXEL_MAP_TABLE", GLint, ["MAX_PIXEL_MAP_TABLE"], "", None ),
- ( "GL_MAX_PROJECTION_STACK_DEPTH", GLint, ["MAX_PROJECTION_STACK_DEPTH"], "", None ),
- ( "GL_MAX_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.MaxTextureLevels - 1)"], "", None ),
- ( "GL_MAX_3D_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.Max3DTextureLevels - 1)"], "", None ),
- ( "GL_MAX_TEXTURE_STACK_DEPTH", GLint, ["MAX_TEXTURE_STACK_DEPTH"], "", None ),
- ( "GL_MAX_VIEWPORT_DIMS", GLint,
- ["ctx->Const.MaxViewportWidth", "ctx->Const.MaxViewportHeight"],
- "", None ),
- ( "GL_MODELVIEW_MATRIX", GLfloat,
- [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
- "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
- "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
- "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
- "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ),
- ( "GL_MODELVIEW_STACK_DEPTH", GLint, ["ctx->ModelviewMatrixStack.Depth + 1"], "", None ),
- ( "GL_NAME_STACK_DEPTH", GLint, ["ctx->Select.NameStackDepth"], "", None ),
- ( "GL_NORMALIZE", GLboolean, ["ctx->Transform.Normalize"], "", None ),
- ( "GL_PACK_ALIGNMENT", GLint, ["ctx->Pack.Alignment"], "", None ),
- ( "GL_PACK_LSB_FIRST", GLboolean, ["ctx->Pack.LsbFirst"], "", None ),
- ( "GL_PACK_ROW_LENGTH", GLint, ["ctx->Pack.RowLength"], "", None ),
- ( "GL_PACK_SKIP_PIXELS", GLint, ["ctx->Pack.SkipPixels"], "", None ),
- ( "GL_PACK_SKIP_ROWS", GLint, ["ctx->Pack.SkipRows"], "", None ),
- ( "GL_PACK_SWAP_BYTES", GLboolean, ["ctx->Pack.SwapBytes"], "", None ),
- ( "GL_PACK_SKIP_IMAGES_EXT", GLint, ["ctx->Pack.SkipImages"], "", None ),
- ( "GL_PACK_IMAGE_HEIGHT_EXT", GLint, ["ctx->Pack.ImageHeight"], "", None ),
- ( "GL_PACK_INVERT_MESA", GLboolean, ["ctx->Pack.Invert"], "", None ),
- ( "GL_PERSPECTIVE_CORRECTION_HINT", GLenum,
- ["ctx->Hint.PerspectiveCorrection"], "", None ),
- ( "GL_PIXEL_MAP_A_TO_A_SIZE", GLint, ["ctx->Pixel.MapAtoAsize"], "", None ),
- ( "GL_PIXEL_MAP_B_TO_B_SIZE", GLint, ["ctx->Pixel.MapBtoBsize"], "", None ),
- ( "GL_PIXEL_MAP_G_TO_G_SIZE", GLint, ["ctx->Pixel.MapGtoGsize"], "", None ),
- ( "GL_PIXEL_MAP_I_TO_A_SIZE", GLint, ["ctx->Pixel.MapItoAsize"], "", None ),
- ( "GL_PIXEL_MAP_I_TO_B_SIZE", GLint, ["ctx->Pixel.MapItoBsize"], "", None ),
- ( "GL_PIXEL_MAP_I_TO_G_SIZE", GLint, ["ctx->Pixel.MapItoGsize"], "", None ),
- ( "GL_PIXEL_MAP_I_TO_I_SIZE", GLint, ["ctx->Pixel.MapItoIsize"], "", None ),
- ( "GL_PIXEL_MAP_I_TO_R_SIZE", GLint, ["ctx->Pixel.MapItoRsize"], "", None ),
- ( "GL_PIXEL_MAP_R_TO_R_SIZE", GLint, ["ctx->Pixel.MapRtoRsize"], "", None ),
- ( "GL_PIXEL_MAP_S_TO_S_SIZE", GLint, ["ctx->Pixel.MapStoSsize"], "", None ),
- ( "GL_POINT_SIZE", GLfloat, ["ctx->Point.Size"], "", None ),
- ( "GL_POINT_SIZE_GRANULARITY", GLfloat,
- ["ctx->Const.PointSizeGranularity"], "", None ),
- ( "GL_POINT_SIZE_RANGE", GLfloat,
- ["ctx->Const.MinPointSizeAA",
- "ctx->Const.MaxPointSizeAA"], "", None ),
- ( "GL_ALIASED_POINT_SIZE_RANGE", GLfloat,
- ["ctx->Const.MinPointSize",
- "ctx->Const.MaxPointSize"], "", None ),
- ( "GL_POINT_SMOOTH", GLboolean, ["ctx->Point.SmoothFlag"], "", None ),
- ( "GL_POINT_SMOOTH_HINT", GLenum, ["ctx->Hint.PointSmooth"], "", None ),
- ( "GL_POINT_SIZE_MIN_EXT", GLfloat, ["ctx->Point.MinSize"], "", None ),
- ( "GL_POINT_SIZE_MAX_EXT", GLfloat, ["ctx->Point.MaxSize"], "", None ),
- ( "GL_POINT_FADE_THRESHOLD_SIZE_EXT", GLfloat,
- ["ctx->Point.Threshold"], "", None ),
- ( "GL_DISTANCE_ATTENUATION_EXT", GLfloat,
- ["ctx->Point.Params[0]",
- "ctx->Point.Params[1]",
- "ctx->Point.Params[2]"], "", None ),
- ( "GL_POLYGON_MODE", GLenum,
- ["ctx->Polygon.FrontMode",
- "ctx->Polygon.BackMode"], "", None ),
- ( "GL_POLYGON_OFFSET_BIAS_EXT", GLfloat, ["ctx->Polygon.OffsetUnits"], "", None ),
- ( "GL_POLYGON_OFFSET_FACTOR", GLfloat, ["ctx->Polygon.OffsetFactor "], "", None ),
- ( "GL_POLYGON_OFFSET_UNITS", GLfloat, ["ctx->Polygon.OffsetUnits "], "", None ),
- ( "GL_POLYGON_SMOOTH", GLboolean, ["ctx->Polygon.SmoothFlag"], "", None ),
- ( "GL_POLYGON_SMOOTH_HINT", GLenum, ["ctx->Hint.PolygonSmooth"], "", None ),
- ( "GL_POLYGON_STIPPLE", GLboolean, ["ctx->Polygon.StippleFlag"], "", None ),
- ( "GL_PROJECTION_MATRIX", GLfloat,
- [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
- "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
- "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
- "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
- "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ),
- ( "GL_PROJECTION_STACK_DEPTH", GLint,
- ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ),
- ( "GL_READ_BUFFER", GLenum, ["ctx->Pixel.ReadBuffer"], "", None ),
- ( "GL_RED_BIAS", GLfloat, ["ctx->Pixel.RedBias"], "", None ),
- ( "GL_RED_BITS", GLint, [" ctx->DrawBuffer->Visual.redBits "], "", None ),
- ( "GL_RED_SCALE", GLfloat, ["ctx->Pixel.RedScale"], "", None ),
- ( "GL_RENDER_MODE", GLenum, ["ctx->RenderMode"], "", None ),
- ( "GL_RESCALE_NORMAL", GLboolean,
- ["ctx->Transform.RescaleNormals"], "", None ),
- ( "GL_RGBA_MODE", GLboolean, ["ctx->DrawBuffer->Visual.rgbMode"],
- "", None ),
- ( "GL_SCISSOR_BOX", GLint,
- ["ctx->Scissor.X",
- "ctx->Scissor.Y",
- "ctx->Scissor.Width",
- "ctx->Scissor.Height"], "", None ),
- ( "GL_SCISSOR_TEST", GLboolean, ["ctx->Scissor.Enabled"], "", None ),
- ( "GL_SELECTION_BUFFER_SIZE", GLint, ["ctx->Select.BufferSize"], "", None ),
- ( "GL_SHADE_MODEL", GLenum, ["ctx->Light.ShadeModel"], "", None ),
- ( "GL_SHARED_TEXTURE_PALETTE_EXT", GLboolean,
- ["ctx->Texture.SharedPalette"], "", None ),
- ( "GL_STENCIL_BITS", GLint, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ),
- ( "GL_STENCIL_CLEAR_VALUE", GLint, ["ctx->Stencil.Clear"], "", None ),
- ( "GL_STENCIL_FAIL", GLenum,
- ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STENCIL_FUNC", GLenum,
- ["ctx->Stencil.Function[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STENCIL_PASS_DEPTH_FAIL", GLenum,
- ["ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STENCIL_PASS_DEPTH_PASS", GLenum,
- ["ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STENCIL_REF", GLint,
- ["ctx->Stencil.Ref[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STENCIL_TEST", GLboolean, ["ctx->Stencil.Enabled"], "", None ),
- ( "GL_STENCIL_VALUE_MASK", GLint,
- ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STENCIL_WRITEMASK", GLint,
- ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ),
- ( "GL_STEREO", GLboolean, ["ctx->DrawBuffer->Visual.stereoMode"],
- "", None ),
- ( "GL_SUBPIXEL_BITS", GLint, ["ctx->Const.SubPixelBits"], "", None ),
- ( "GL_TEXTURE_1D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D)"], "", None ),
- ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ),
- ( "GL_TEXTURE_3D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_3D)"], "", None ),
- ( "GL_TEXTURE_BINDING_1D", GLint,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name"], "", None ),
- ( "GL_TEXTURE_BINDING_2D", GLint,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name"], "", None ),
- ( "GL_TEXTURE_BINDING_3D", GLint,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name"], "", None ),
- ( "GL_TEXTURE_ENV_COLOR", GLfloatN,
- ["color[0]", "color[1]", "color[2]", "color[3]"],
- "const GLfloat *color = ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvColor;",
- None ),
- ( "GL_TEXTURE_ENV_MODE", GLenum,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvMode"], "", None ),
- ( "GL_TEXTURE_GEN_S", GLboolean,
- ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None ),
- ( "GL_TEXTURE_GEN_T", GLboolean,
- ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)"], "", None ),
- ( "GL_TEXTURE_GEN_R", GLboolean,
- ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)"], "", None ),
- ( "GL_TEXTURE_GEN_Q", GLboolean,
- ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)"], "", None ),
- ( "GL_TEXTURE_MATRIX", GLfloat,
- ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
- "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
- "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
- "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
- "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ),
- ( "GL_TEXTURE_STACK_DEPTH", GLint,
- ["ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1"], "", None ),
- ( "GL_UNPACK_ALIGNMENT", GLint, ["ctx->Unpack.Alignment"], "", None ),
- ( "GL_UNPACK_LSB_FIRST", GLboolean, ["ctx->Unpack.LsbFirst"], "", None ),
- ( "GL_UNPACK_ROW_LENGTH", GLint, ["ctx->Unpack.RowLength"], "", None ),
- ( "GL_UNPACK_SKIP_PIXELS", GLint, ["ctx->Unpack.SkipPixels"], "", None ),
- ( "GL_UNPACK_SKIP_ROWS", GLint, ["ctx->Unpack.SkipRows"], "", None ),
- ( "GL_UNPACK_SWAP_BYTES", GLboolean, ["ctx->Unpack.SwapBytes"], "", None ),
- ( "GL_UNPACK_SKIP_IMAGES_EXT", GLint, ["ctx->Unpack.SkipImages"], "", None ),
- ( "GL_UNPACK_IMAGE_HEIGHT_EXT", GLint, ["ctx->Unpack.ImageHeight"], "", None ),
- ( "GL_UNPACK_CLIENT_STORAGE_APPLE", GLboolean, ["ctx->Unpack.ClientStorage"], "", None ),
- ( "GL_VIEWPORT", GLint, [ "ctx->Viewport.X", "ctx->Viewport.Y",
- "ctx->Viewport.Width", "ctx->Viewport.Height" ], "", None ),
- ( "GL_ZOOM_X", GLfloat, ["ctx->Pixel.ZoomX"], "", None ),
- ( "GL_ZOOM_Y", GLfloat, ["ctx->Pixel.ZoomY"], "", None ),
-
- # Vertex arrays
- ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.Vertex.Enabled"], "", None ),
- ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.Vertex.Size"], "", None ),
- ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.Vertex.Type"], "", None ),
- ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.Vertex.Stride"], "", None ),
- ( "GL_VERTEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ),
- ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.Normal.Enabled"], "", None ),
- ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.Normal.Type"], "", None ),
- ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.Normal.Stride"], "", None ),
- ( "GL_NORMAL_ARRAY_COUNT_EXT", GLint, ["0"], "", None ),
- ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.Color.Enabled"], "", None ),
- ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.Color.Size"], "", None ),
- ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.Color.Type"], "", None ),
- ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.Color.Stride"], "", None ),
- ( "GL_COLOR_ARRAY_COUNT_EXT", GLint, ["0"], "", None ),
- ( "GL_INDEX_ARRAY", GLboolean, ["ctx->Array.Index.Enabled"], "", None ),
- ( "GL_INDEX_ARRAY_TYPE", GLenum, ["ctx->Array.Index.Type"], "", None ),
- ( "GL_INDEX_ARRAY_STRIDE", GLint, ["ctx->Array.Index.Stride"], "", None ),
- ( "GL_INDEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ),
- ( "GL_TEXTURE_COORD_ARRAY", GLboolean,
- ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ),
- ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint,
- ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Size"], "", None ),
- ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum,
- ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Type"], "", None ),
- ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint,
- ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ),
- ( "GL_TEXTURE_COORD_ARRAY_COUNT_EXT", GLint, ["0"], "", None ),
- ( "GL_EDGE_FLAG_ARRAY", GLboolean, ["ctx->Array.EdgeFlag.Enabled"], "", None ),
- ( "GL_EDGE_FLAG_ARRAY_STRIDE", GLint, ["ctx->Array.EdgeFlag.Stride"], "", None ),
- ( "GL_EDGE_FLAG_ARRAY_COUNT_EXT", GLint, ["0"], "", None ),
-
- # GL_ARB_multitexture
- ( "GL_MAX_TEXTURE_UNITS_ARB", GLint,
- ["MIN2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)"],
- "", "ARB_multitexture" ),
- ( "GL_ACTIVE_TEXTURE_ARB", GLint,
- [ "GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit"], "", "ARB_multitexture" ),
- ( "GL_CLIENT_ACTIVE_TEXTURE_ARB", GLint,
- ["GL_TEXTURE0_ARB + ctx->Array.ActiveTexture"], "", "ARB_multitexture" ),
-
- # GL_ARB_texture_cube_map
- ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean,
- ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", "ARB_texture_cube_map" ),
- ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name"],
- "", "ARB_texture_cube_map" ),
- ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint,
- ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"],
- "", "ARB_texture_cube_map"),
-
- # GL_ARB_texture_compression */
- ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint,
- ["ctx->Hint.TextureCompression"], "", "ARB_texture_compression" ),
- ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint,
- ["_mesa_get_compressed_formats(ctx, NULL)"], "", "ARB_texture_compression" ),
- ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum,
- [],
- """GLint formats[100];
- GLuint i, n = _mesa_get_compressed_formats(ctx, formats);
- ASSERT(n <= 100);
- for (i = 0; i < n; i++)
- params[i] = ENUM_TO_INT(formats[i]);""",
- "ARB_texture_compression" ),
-
- # GL_EXT_compiled_vertex_array
- ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"],
- "", "EXT_compiled_vertex_array" ),
- ( "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", GLint, ["ctx->Array.LockCount"],
- "", "EXT_compiled_vertex_array" ),
-
- # GL_ARB_transpose_matrix
- ( "GL_TRANSPOSE_COLOR_MATRIX_ARB", GLfloat,
- ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
- "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
- "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
- "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
- "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ),
- ( "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB", GLfloat,
- ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
- "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
- "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
- "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
- "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ),
- ( "GL_TRANSPOSE_PROJECTION_MATRIX_ARB", GLfloat,
- ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
- "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
- "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
- "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
- "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ),
- ( "GL_TRANSPOSE_TEXTURE_MATRIX_ARB", GLfloat,
- ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
- "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
- "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
- "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
- "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ),
-
- # GL_HP_occlusion_test
- ( "GL_OCCLUSION_TEST_HP", GLboolean, ["ctx->Depth.OcclusionTest"], "",
- "HP_occlusion_test" ),
- ( "GL_OCCLUSION_TEST_RESULT_HP", GLboolean, [],
- """FLUSH_VERTICES(ctx, _NEW_DEPTH);
- if (ctx->Depth.OcclusionTest)
- params[0] = ctx->OcclusionResult;
- else
- params[0] = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- return;""",
- "HP_occlusion_test" ),
-
- # GL_SGIS_pixel_texture
- ( "GL_PIXEL_TEXTURE_SGIS", GLboolean, ["ctx->Pixel.PixelTextureEnabled"],
- "", "SGIS_pixel_texture" ),
-
- # GL_SGIX_pixel_texture
- ( "GL_PIXEL_TEX_GEN_SGIX", GLboolean, ["ctx->Pixel.PixelTextureEnabled"],
- "", "SGIX_pixel_texture" ),
- ( "GL_PIXEL_TEX_GEN_MODE_SGIX", GLenum, ["pixel_texgen_mode(ctx)"],
- "", "SGIX_pixel_texture" ),
-
- # GL_SGI_color_matrix (also in 1.2 imaging)
- ( "GL_COLOR_MATRIX_SGI", GLfloat,
- ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
- "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
- "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
- "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
- "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ),
- ( "GL_COLOR_MATRIX_STACK_DEPTH_SGI", GLint,
- ["ctx->ColorMatrixStack.Depth + 1"], "", None ),
- ( "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI", GLint,
- ["MAX_COLOR_STACK_DEPTH"], "", None ),
- ( "GL_POST_COLOR_MATRIX_RED_SCALE_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixScale[0]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixScale[1]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixScale[2]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixScale[3]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_RED_BIAS_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixBias[0]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixBias[1]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixBias[2]"], "", None ),
- ( "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI", GLfloat,
- ["ctx->Pixel.PostColorMatrixBias[3]"], "", None ),
-
- # GL_EXT_convolution (also in 1.2 imaging)
- ( "GL_CONVOLUTION_1D_EXT", GLboolean,
- ["ctx->Pixel.Convolution1DEnabled"], "", "EXT_convolution" ),
- ( "GL_CONVOLUTION_2D_EXT", GLboolean,
- ["ctx->Pixel.Convolution2DEnabled"], "", "EXT_convolution" ),
- ( "GL_SEPARABLE_2D_EXT", GLboolean,
- ["ctx->Pixel.Separable2DEnabled"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_RED_SCALE_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionScale[0]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_GREEN_SCALE_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionScale[1]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_BLUE_SCALE_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionScale[2]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionScale[3]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_RED_BIAS_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionBias[0]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_GREEN_BIAS_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionBias[1]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_BLUE_BIAS_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionBias[2]"], "", "EXT_convolution" ),
- ( "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT", GLfloat,
- ["ctx->Pixel.PostConvolutionBias[3]"], "", "EXT_convolution" ),
-
- # GL_EXT_histogram / GL_ARB_imaging
- ( "GL_HISTOGRAM", GLboolean,
- [ "ctx->Pixel.HistogramEnabled" ], "", "EXT_histogram" ),
- ( "GL_MINMAX", GLboolean,
- [ "ctx->Pixel.MinMaxEnabled" ], "", "EXT_histogram" ),
-
- # GL_SGI_color_table / GL_ARB_imaging
- ( "GL_COLOR_TABLE_SGI", GLboolean,
- ["ctx->Pixel.ColorTableEnabled"], "", "SGI_color_table" ),
- ( "GL_POST_CONVOLUTION_COLOR_TABLE_SGI", GLboolean,
- ["ctx->Pixel.PostConvolutionColorTableEnabled"], "", "SGI_color_table" ),
- ( "GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI", GLboolean,
- ["ctx->Pixel.PostColorMatrixColorTableEnabled"], "", "SGI_color_table" ),
-
- # GL_SGI_texture_color_table
- ( "GL_TEXTURE_COLOR_TABLE_SGI", GLboolean,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled"],
- "", "SGI_texture_color_table" ),
-
- # GL_EXT_secondary_color
- ( "GL_COLOR_SUM_EXT", GLboolean,
- ["ctx->Fog.ColorSumEnabled"], "", "EXT_secondary_color" ),
- ( "GL_CURRENT_SECONDARY_COLOR_EXT", GLfloatN,
- ["ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]",
- "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]",
- "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]",
- "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]"],
- "FLUSH_CURRENT(ctx, 0);", "EXT_secondary_color" ),
- ( "GL_SECONDARY_COLOR_ARRAY_EXT", GLboolean,
- ["ctx->Array.SecondaryColor.Enabled"], "", "EXT_secondary_color" ),
- ( "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT", GLenum,
- ["ctx->Array.SecondaryColor.Type"], "", "EXT_secondary_color" ),
- ( "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT", GLint,
- ["ctx->Array.SecondaryColor.Stride"], "", "EXT_secondary_color" ),
- ( "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT", GLint,
- ["ctx->Array.SecondaryColor.Size"], "", "EXT_secondary_color" ),
-
- # GL_EXT_fog_coord
- ( "GL_CURRENT_FOG_COORDINATE_EXT", GLfloat,
- ["ctx->Current.Attrib[VERT_ATTRIB_FOG][0]"],
- "FLUSH_CURRENT(ctx, 0);", "EXT_fog_coord" ),
- ( "GL_FOG_COORDINATE_ARRAY_EXT", GLboolean, ["ctx->Array.FogCoord.Enabled"],
- "", "EXT_fog_coord" ),
- ( "GL_FOG_COORDINATE_ARRAY_TYPE_EXT", GLenum, ["ctx->Array.FogCoord.Type"],
- "", "EXT_fog_coord" ),
- ( "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT", GLint, ["ctx->Array.FogCoord.Stride"],
- "", "EXT_fog_coord" ),
- ( "GL_FOG_COORDINATE_SOURCE_EXT", GLenum, ["ctx->Fog.FogCoordinateSource"],
- "", "EXT_fog_coord" ),
-
- # GL_EXT_texture_lod_bias
- ( "GL_MAX_TEXTURE_LOD_BIAS_EXT", GLfloat,
- ["ctx->Const.MaxTextureLodBias"], "", "EXT_texture_lod_bias"),
-
- # GL_EXT_texture_filter_anisotropic
- ( "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", GLfloat,
- ["ctx->Const.MaxTextureMaxAnisotropy"], "", "EXT_texture_filter_anisotropic"),
-
- # GL_ARB_multisample
- ( "GL_MULTISAMPLE_ARB", GLboolean,
- ["ctx->Multisample.Enabled"], "", "ARB_multisample" ),
- ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean,
- ["ctx->Multisample.SampleAlphaToCoverage"], "", "ARB_multisample" ),
- ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean,
- ["ctx->Multisample.SampleAlphaToOne"], "", "ARB_multisample" ),
- ( "GL_SAMPLE_COVERAGE_ARB", GLboolean,
- ["ctx->Multisample.SampleCoverage"], "", "ARB_multisample" ),
- ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat,
- ["ctx->Multisample.SampleCoverageValue"], "", "ARB_multisample" ),
- ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean,
- ["ctx->Multisample.SampleCoverageInvert"], "", "ARB_multisample" ),
- ( "GL_SAMPLE_BUFFERS_ARB", GLint,
- ["ctx->DrawBuffer->Visual.sampleBuffers"], "", "ARB_multisample" ),
- ( "GL_SAMPLES_ARB", GLint,
- ["ctx->DrawBuffer->Visual.samples"], "", "ARB_multisample" ),
-
- # GL_IBM_rasterpos_clip
- ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean,
- ["ctx->Transform.RasterPositionUnclipped"], "", "IBM_rasterpos_clip" ),
-
- # GL_NV_point_sprite
- ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"],
- "", "NV_point_sprite" ), # OR ARB_point_sprite
- ( "GL_POINT_SPRITE_R_MODE_NV", GLenum, ["ctx->Point.SpriteRMode"],
- "", "NV_point_sprite" ), # OR ARB_point_sprite
- ( "GL_POINT_SPRITE_COORD_ORIGIN", GLenum, ["ctx->Point.SpriteOrigin"],
- "", "NV_point_sprite" ), # OR ARB_point_sprite
-
- # GL_SGIS_generate_mipmap
- ( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum, ["ctx->Hint.GenerateMipmap"],
- "", "SGIS_generate_mipmap" ),
-
- # GL_NV_vertex_program
- ( "GL_VERTEX_PROGRAM_NV", GLboolean,
- ["ctx->VertexProgram.Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_PROGRAM_POINT_SIZE_NV", GLboolean,
- ["ctx->VertexProgram.PointSizeEnabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_PROGRAM_TWO_SIDE_NV", GLboolean,
- ["ctx->VertexProgram.TwoSideEnabled"], "", "NV_vertex_program" ),
- ( "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV", GLint,
- ["ctx->Const.MaxProgramMatrixStackDepth"], "", "NV_vertex_program" ),
- ( "GL_MAX_TRACK_MATRICES_NV", GLint,
- ["ctx->Const.MaxProgramMatrices"], "", "NV_vertex_program" ),
- ( "GL_CURRENT_MATRIX_STACK_DEPTH_NV", GLboolean,
- ["ctx->CurrentStack->Depth + 1"], "", "NV_vertex_program" ),
- ( "GL_CURRENT_MATRIX_NV", GLfloat,
- ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
- "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
- "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
- "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
- "const GLfloat *matrix = ctx->CurrentStack->Top->m;", "NV_vertex_program" ),
- ( "GL_VERTEX_PROGRAM_BINDING_NV", GLint,
- ["(ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)"],
- "", "NV_vertex_program" ),
- ( "GL_PROGRAM_ERROR_POSITION_NV", GLint,
- ["ctx->Program.ErrorPos"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY0_NV", GLboolean,
- ["ctx->Array.VertexAttrib[0].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY1_NV", GLboolean,
- ["ctx->Array.VertexAttrib[1].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY2_NV", GLboolean,
- ["ctx->Array.VertexAttrib[2].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY3_NV", GLboolean,
- ["ctx->Array.VertexAttrib[3].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY4_NV", GLboolean,
- ["ctx->Array.VertexAttrib[4].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY5_NV", GLboolean,
- ["ctx->Array.VertexAttrib[5].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY6_NV", GLboolean,
- ["ctx->Array.VertexAttrib[6].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY7_NV", GLboolean,
- ["ctx->Array.VertexAttrib[7].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY8_NV", GLboolean,
- ["ctx->Array.VertexAttrib[8].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY9_NV", GLboolean,
- ["ctx->Array.VertexAttrib[9].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY10_NV", GLboolean,
- ["ctx->Array.VertexAttrib[10].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY11_NV", GLboolean,
- ["ctx->Array.VertexAttrib[11].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY12_NV", GLboolean,
- ["ctx->Array.VertexAttrib[12].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY13_NV", GLboolean,
- ["ctx->Array.VertexAttrib[13].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY14_NV", GLboolean,
- ["ctx->Array.VertexAttrib[14].Enabled"], "", "NV_vertex_program" ),
- ( "GL_VERTEX_ATTRIB_ARRAY15_NV", GLboolean,
- ["ctx->Array.VertexAttrib[15].Enabled"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB0_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[0]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB1_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[1]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB2_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[2]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB3_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[3]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB4_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[4]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB5_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[5]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB6_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[6]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB7_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[7]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB8_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[8]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB9_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[9]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB10_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[10]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB11_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[11]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB12_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[12]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB13_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[13]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB14_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[14]"], "", "NV_vertex_program" ),
- ( "GL_MAP1_VERTEX_ATTRIB15_4_NV", GLboolean,
- ["ctx->Eval.Map1Attrib[15]"], "", "NV_vertex_program" ),
-
- # GL_NV_fragment_program
- ( "GL_FRAGMENT_PROGRAM_NV", GLboolean,
- ["ctx->FragmentProgram.Enabled"], "", "NV_fragment_program" ),
- ( "GL_MAX_TEXTURE_COORDS_NV", GLint,
- ["ctx->Const.MaxTextureCoordUnits"], "", "NV_fragment_program" ),
- ( "GL_MAX_TEXTURE_IMAGE_UNITS_NV", GLint,
- ["ctx->Const.MaxTextureImageUnits"], "", "NV_fragment_program" ),
- ( "GL_FRAGMENT_PROGRAM_BINDING_NV", GLint,
- ["ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0"],
- "", "NV_fragment_program" ),
- ( "GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV", GLint,
- ["MAX_NV_FRAGMENT_PROGRAM_PARAMS"], "", "NV_fragment_program" ),
-
- # GL_NV_texture_rectangle
- ( "GL_TEXTURE_RECTANGLE_NV", GLboolean,
- ["_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)"], "", "NV_texture_rectangle" ),
- ( "GL_TEXTURE_BINDING_RECTANGLE_NV", GLint,
- ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name"],
- "", "NV_texture_rectangle" ),
- ( "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV", GLint,
- ["ctx->Const.MaxTextureRectSize"], "", "NV_texture_rectangle" ),
-
- # GL_EXT_stencil_two_side
- ( "GL_STENCIL_TEST_TWO_SIDE_EXT", GLboolean,
- ["ctx->Stencil.TestTwoSide"], "", "EXT_stencil_two_side" ),
- ( "GL_ACTIVE_STENCIL_FACE_EXT", GLenum,
- ["ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT"],
- "", "EXT_stencil_two_side" ),
-
- # GL_NV_light_max_exponent
- ( "GL_MAX_SHININESS_NV", GLfloat,
- ["ctx->Const.MaxShininess"], "", "NV_light_max_exponent" ),
- ( "GL_MAX_SPOT_EXPONENT_NV", GLfloat,
- ["ctx->Const.MaxSpotExponent"], "", "NV_light_max_exponent" ),
-
- # GL_ARB_vertex_buffer_object
- ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayBufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.Vertex.BufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.Normal.BufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.Color.BufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.Index.BufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"],
- "", "ARB_vertex_buffer_object" ),
- ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.EdgeFlag.BufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.SecondaryColor.BufferObj->Name"],
- "", "ARB_vertex_buffer_object" ),
- ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.FogCoord.BufferObj->Name"], "", "ARB_vertex_buffer_object" ),
- # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported
- ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ElementArrayBufferObj->Name"], "", "ARB_vertex_buffer_object" ),
-
- # GL_EXT_pixel_buffer_object
- ( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint,
- ["ctx->Pack.BufferObj->Name"], "", "EXT_pixel_buffer_object" ),
- ( "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT", GLint,
- ["ctx->Unpack.BufferObj->Name"], "", "EXT_pixel_buffer_object" ),
-
- # GL_ARB_vertex_program
- ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint,
- ["ctx->Const.MaxVertexProgramAttribs"], "", "ARB_vertex_program" ),
-
- # GL_ARB_fragment_program
- ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean,
- ["ctx->FragmentProgram.Enabled"], "", "ARB_fragment_program" ),
- ( "GL_TRANSPOSE_CURRENT_MATRIX_ARB", GLfloat,
- ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
- "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
- "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
- "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
- "const GLfloat *matrix = ctx->CurrentStack->Top->m;", "ARB_fragment_program" ),
-
- # GL_EXT_depth_bounds_test
- ( "GL_DEPTH_BOUNDS_TEST_EXT", GLboolean,
- ["ctx->Depth.BoundsTest"], "", "EXT_depth_bounds_test" ),
- ( "GL_DEPTH_BOUNDS_EXT", GLfloat,
- ["ctx->Depth.BoundsMin", "ctx->Depth.BoundsMax"],
- "", "EXT_depth_bounds_test" ),
-
- # GL_MESA_program_debug
- ( "GL_FRAGMENT_PROGRAM_CALLBACK_MESA", GLboolean,
- ["ctx->FragmentProgram.CallbackEnabled"], "", "MESA_program_debug" ),
- ( "GL_VERTEX_PROGRAM_CALLBACK_MESA", GLboolean,
- ["ctx->VertexProgram.CallbackEnabled"], "", "MESA_program_debug" ),
- ( "GL_FRAGMENT_PROGRAM_POSITION_MESA", GLint,
- ["ctx->FragmentProgram.CurrentPosition"], "", "MESA_program_debug" ),
- ( "GL_VERTEX_PROGRAM_POSITION_MESA", GLint,
- ["ctx->VertexProgram.CurrentPosition"], "", "MESA_program_debug" ),
-
- # GL_ARB_draw_buffers
- ( "GL_MAX_DRAW_BUFFERS_ARB", GLint,
- ["ctx->Const.MaxDrawBuffers"], "", "ARB_draw_buffers" ),
- ( "GL_DRAW_BUFFER0_ARB", GLenum,
- ["ctx->Color.DrawBuffer[0]"], "", "ARB_draw_buffers" ),
- ( "GL_DRAW_BUFFER1_ARB", GLenum,
- ["buffer"],
- """GLenum buffer;
- if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
- return;
- }
- buffer = ctx->Color.DrawBuffer[1];""", "ARB_draw_buffers" ),
- ( "GL_DRAW_BUFFER2_ARB", GLenum,
- ["buffer"],
- """GLenum buffer;
- if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
- return;
- }
- buffer = ctx->Color.DrawBuffer[2];""", "ARB_draw_buffers" ),
- ( "GL_DRAW_BUFFER3_ARB", GLenum,
- ["buffer"],
- """GLenum buffer;
- if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
- return;
- }
- buffer = ctx->Color.DrawBuffer[3];""", "ARB_draw_buffers" ),
- # XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future
-
- # GL_OES_read_format
- ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint,
- ["ctx->Const.ColorReadType"], "", "OES_read_format" ),
- ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint,
- ["ctx->Const.ColorReadFormat"], "", "OES_read_format" ),
-
- # GL_ATI_fragment_shader
- ( "GL_NUM_FRAGMENT_REGISTERS_ATI", GLint, ["6"], "", "ATI_fragment_shader" ),
- ( "GL_NUM_FRAGMENT_CONSTANTS_ATI", GLint, ["8"], "", "ATI_fragment_shader" ),
- ( "GL_NUM_PASSES_ATI", GLint, ["2"], "", "ATI_fragment_shader" ),
- ( "GL_NUM_INSTRUCTIONS_PER_PASS_ATI", GLint, ["8"], "", "ATI_fragment_shader" ),
- ( "GL_NUM_INSTRUCTIONS_TOTAL_ATI", GLint, ["16"], "", "ATI_fragment_shader" ),
- ( "GL_COLOR_ALPHA_PAIRING_ATI", GLboolean, ["GL_TRUE"], "", "ATI_fragment_shader" ),
- ( "GL_NUM_LOOPBACK_COMPONENTS_ATI", GLint, ["3"], "", "ATI_fragment_shader" ),
- ( "GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI", GLint, ["3"], "", "ATI_fragment_shader" ),
-
- # OpenGL 2.0
- ( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ),
- ( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ),
- ( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ),
- ( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ),
- ( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ),
- ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum, ["ctx->Stencil.ZPassFunc[1]"], "", None ),
-
- # GL_EXT_framebuffer_object
- ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->DrawBuffer->Name"], "",
- "EXT_framebuffer_object" ),
- ( "GL_RENDERBUFFER_BINDING_EXT", GLint,
- ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "",
- "EXT_framebuffer_object" ),
- ( "GL_MAX_COLOR_ATTACHMENTS_EXT", GLint,
- ["ctx->Const.MaxColorAttachments"], "",
- "EXT_framebuffer_object" ),
- ( "GL_MAX_RENDERBUFFER_SIZE_EXT", GLint,
- ["ctx->Const.MaxRenderbufferSize"], "",
- "EXT_framebuffer_object" ),
-
- # GL_ARB_fragment_shader
- ( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint, ["MAX_FRAGMENT_UNIFORM_COMPONENTS"], "",
- "ARB_fragment_shader" ),
- ( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum, ["ctx->Hint.FragmentShaderDerivative"], "",
- "ARB_fragment_shader" ),
-
- # GL_ARB_vertex_shader
- ( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint, ["MAX_VERTEX_UNIFORM_COMPONENTS"], "",
- "ARB_vertex_shader" ),
- ( "GL_MAX_VARYING_FLOATS_ARB", GLint, ["MAX_VARYING_FLOATS"], "", "ARB_vertex_shader" ),
- ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint, ["MAX_VERTEX_TEXTURE_IMAGE_UNITS"], "",
- "ARB_vertex_shader" ),
- ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint, ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "",
- "ARB_vertex_shader" )
-]
-
-
-def ConversionFunc(fromType, toType):
- """Return the name of the macro to convert between two data types."""
- if fromType == toType:
- return ""
- elif fromType == GLfloat and toType == GLint:
- return "IROUND"
- elif fromType == GLfloatN and toType == GLfloat:
- return ""
- elif fromType == GLint and toType == GLfloat: # but not GLfloatN!
- return "(GLfloat)"
- else:
- if fromType == GLfloatN:
- fromType = GLfloat
- fromStr = TypeStrings[fromType]
- fromStr = string.upper(fromStr[2:])
- toStr = TypeStrings[toType]
- toStr = string.upper(toStr[2:])
- return fromStr + "_TO_" + toStr
-
-
-def EmitGetFunction(stateVars, returnType):
- """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv."""
- assert (returnType == GLboolean or
- returnType == GLint or
- returnType == GLfloat)
-
- strType = TypeStrings[returnType]
- # Capitalize first letter of return type
- if returnType == GLint:
- function = "GetIntegerv"
- else:
- function = "Get" + string.upper(strType[2]) + strType[3:] + "v"
-
- print "void GLAPIENTRY"
- print "_mesa_%s( GLenum pname, %s *params )" % (function, TypeStrings[returnType])
- print "{"
- print " GET_CURRENT_CONTEXT(ctx);"
- print " ASSERT_OUTSIDE_BEGIN_END(ctx);"
- print ""
- print " if (!params)"
- print " return;"
- print ""
- print " if (ctx->NewState)"
- print " _mesa_update_state(ctx);"
- print ""
- print " if (ctx->Driver.%s &&" % function
- print " ctx->Driver.%s(ctx, pname, params))" % function
- print " return;"
- print ""
- print " switch (pname) {"
-
- extCheck = "CHECK_EXTENSION_%s" % string.upper(TypeStrings[returnType][2])
-
- for (name, varType, state, optionalCode, extension) in stateVars:
- print " case " + name + ":"
- if extension:
- print " %s(%s, pname);" % (extCheck, extension)
- if optionalCode:
- print " {"
- print " " + optionalCode
- conversion = ConversionFunc(varType, returnType)
- n = len(state)
- for i in range(n):
- if conversion:
- print " params[%d] = %s(%s);" % (i, conversion, state[i])
- else:
- print " params[%d] = %s;" % (i, state[i])
- if optionalCode:
- print " }"
- print " break;"
-
- print " default:"
- print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function
- print " }"
- print "}"
- print ""
- return
-
-
-
-def EmitHeader():
- """Print the get.c file header."""
- print """
-/***
- *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py
- ***/
-
-#include "glheader.h"
-#include "context.h"
-#include "enable.h"
-#include "extensions.h"
-#include "fbobject.h"
-#include "get.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "state.h"
-#include "texcompress.h"
-
-
-#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
-
-#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
-
-#define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE )
-#define ENUM_TO_INT(E) ( (GLint) (E) )
-#define ENUM_TO_FLOAT(E) ( (GLfloat) (E) )
-
-#define BOOLEAN_TO_INT(B) ( (GLint) (B) )
-#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
-
-
-/* Check if named extension is enabled, if not generate error and return */
-
-#define CHECK1(E1, str, PNAME) \\
- if (!ctx->Extensions.E1) { \\
- _mesa_error(ctx, GL_INVALID_VALUE, \\
- "glGet" str "v(0x%x)", (int) PNAME); \\
- return; \\
- }
-
-#define CHECK2(E1, E2, str, PNAME) \\
- if (!ctx->Extensions.E1 && !ctx->Extensions.E2) { \\
- _mesa_error(ctx, GL_INVALID_VALUE, \\
- "glGet" str "v(0x%x)", (int) PNAME); \\
- return; \\
- }
-
-#define CHECK_EXTENSION_B(EXTNAME, PNAME) \\
- CHECK1(EXTNAME, "Boolean", PNAME )
-
-#define CHECK_EXTENSION_I(EXTNAME, PNAME) \\
- CHECK1(EXTNAME, "Integer", PNAME )
-
-#define CHECK_EXTENSION_F(EXTNAME, PNAME) \\
- CHECK1(EXTNAME, "Float", PNAME )
-
-
-/**
- * Helper routine.
- */
-static GLenum
-pixel_texgen_mode(const GLcontext *ctx)
-{
- if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_POSITION) {
- if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
- return GL_RGBA;
- }
- else {
- return GL_RGB;
- }
- }
- else {
- if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
- return GL_ALPHA;
- }
- else {
- return GL_NONE;
- }
- }
-}
-"""
- return
-
-
-
-def EmitGetDoublev():
- print """
-void GLAPIENTRY
-_mesa_GetDoublev( GLenum pname, GLdouble *params )
-{
- const GLfloat magic = -1234.5F;
- GLfloat values[16];
- GLuint i;
-
- if (!params)
- return;
-
- /* Init temp array to magic numbers so we can figure out how many values
- * are returned by the GetFloatv() call.
- */
- for (i = 0; i < 16; i++)
- values[i] = magic;
-
- _mesa_GetFloatv(pname, values);
-
- for (i = 0; i < 16 && values[i] != magic; i++)
- params[i] = (GLdouble) values[i];
-}
-"""
-
-
-
-
-EmitHeader()
-# XXX Maybe sort the StateVars list
-EmitGetFunction(StateVars, GLboolean)
-EmitGetFunction(StateVars, GLfloat)
-EmitGetFunction(StateVars, GLint)
-EmitGetDoublev()
-
diff --git a/nx-X11/extras/Mesa/src/mesa/main/mesa.def b/nx-X11/extras/Mesa/src/mesa/main/mesa.def
deleted file mode 100644
index b0c9ab3ca..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/mesa.def
+++ /dev/null
@@ -1,491 +0,0 @@
-DESCRIPTION 'Mesa (OpenGL work-alike) for Win32'
-VERSION 4.1
-
-EXPORTS
- glAccum
- glAlphaFunc
- glAreTexturesResident
- glAreTexturesResidentEXT
- glArrayElement
- glArrayElementEXT
- glBegin
- glBindTexture
- glBindTextureEXT
- glBitmap
- glBlendColorEXT
- glBlendEquationEXT
- glBlendFunc
- glCallList
- glCallLists
- glClear
- glClearAccum
- glClearColor
- glClearDepth
- glClearIndex
- glClearStencil
- glClipPlane
- glColor3b
- glColor3bv
- glColor3d
- glColor3dv
- glColor3f
- glColor3fv
- glColor3i
- glColor3iv
- glColor3s
- glColor3sv
- glColor3ub
- glColor3ubv
- glColor3ui
- glColor3uiv
- glColor3us
- glColor3usv
- glColor4b
- glColor4bv
- glColor4d
- glColor4dv
- glColor4f
- glColor4fv
- glColor4i
- glColor4iv
- glColor4s
- glColor4sv
- glColor4ub
- glColor4ubv
- glColor4ui
- glColor4uiv
- glColor4us
- glColor4usv
- glColorMask
- glColorMaterial
- glColorPointer
- glColorPointerEXT
- glColorSubTableEXT
- glColorTableEXT
- glCopyPixels
- glCopyTexImage1D
- glCopyTexImage2D
- glCopyTexSubImage1D
- glCopyTexSubImage2D
- glCopyTexSubImage3DEXT
- glCullFace
- glDeleteLists
- glDeleteTextures
- glDeleteTexturesEXT
- glDepthFunc
- glDepthMask
- glDepthRange
- glDisable
- glDisableClientState
- glDrawArrays
- glDrawArraysEXT
- glDrawBuffer
- glDrawElements
- glDrawPixels
- glEdgeFlag
- glEdgeFlagPointer
- glEdgeFlagPointerEXT
- glEdgeFlagv
- glEnable
- glEnableClientState
- glEnd
- glEndList
- glEvalCoord1d
- glEvalCoord1dv
- glEvalCoord1f
- glEvalCoord1fv
- glEvalCoord2d
- glEvalCoord2dv
- glEvalCoord2f
- glEvalCoord2fv
- glEvalMesh1
- glEvalMesh2
- glEvalPoint1
- glEvalPoint2
- glFeedbackBuffer
- glFinish
- glFlush
- glFogf
- glFogfv
- glFogi
- glFogiv
- glFrontFace
- glFrustum
- glGenLists
- glGenTextures
- glGenTexturesEXT
- glGetBooleanv
- glGetClipPlane
- glGetColorTableEXT
- glGetColorTableParameterfvEXT
- glGetColorTableParameterivEXT
- glGetDoublev
- glGetError
- glGetFloatv
- glGetIntegerv
- glGetLightfv
- glGetLightiv
- glGetMapdv
- glGetMapfv
- glGetMapiv
- glGetMaterialfv
- glGetMaterialiv
- glGetPixelMapfv
- glGetPixelMapuiv
- glGetPixelMapusv
- glGetPointerv
- glGetPointervEXT
- glGetPolygonStipple
- glGetString
- glGetTexEnvfv
- glGetTexEnviv
- glGetTexGendv
- glGetTexGenfv
- glGetTexGeniv
- glGetTexImage
- glGetTexLevelParameterfv
- glGetTexLevelParameteriv
- glGetTexParameterfv
- glGetTexParameteriv
- glHint
- glIndexd
- glIndexdv
- glIndexf
- glIndexfv
- glIndexi
- glIndexiv
- glIndexMask
- glIndexPointer
- glIndexPointerEXT
- glIndexs
- glIndexsv
- glIndexub
- glIndexubv
- glInitNames
- glInterleavedArrays
- glIsEnabled
- glIsList
- glIsTexture
- glIsTextureEXT
- glLightf
- glLightfv
- glLighti
- glLightiv
- glLightModelf
- glLightModelfv
- glLightModeli
- glLightModeliv
- glLineStipple
- glLineWidth
- glListBase
- glLoadIdentity
- glLoadMatrixd
- glLoadMatrixf
- glLoadName
- glLogicOp
- glMap1d
- glMap1f
- glMap2d
- glMap2f
- glMapGrid1d
- glMapGrid1f
- glMapGrid2d
- glMapGrid2f
- glMaterialf
- glMaterialfv
- glMateriali
- glMaterialiv
- glMatrixMode
- glMultMatrixd
- glMultMatrixf
- glNewList
- glNormal3b
- glNormal3bv
- glNormal3d
- glNormal3dv
- glNormal3f
- glNormal3fv
- glNormal3i
- glNormal3iv
- glNormal3s
- glNormal3sv
- glNormalPointer
- glNormalPointerEXT
- glOrtho
- glPassThrough
- glPixelMapfv
- glPixelMapuiv
- glPixelMapusv
- glPixelStoref
- glPixelStorei
- glPixelTransferf
- glPixelTransferi
- glPixelZoom
- glPointParameterfEXT
- glPointParameterfvEXT
- glPointSize
- glPolygonMode
- glPolygonOffset
- glPolygonOffsetEXT
- glPolygonStipple
- glPopAttrib
- glPopClientAttrib
- glPopMatrix
- glPopName
- glPrioritizeTextures
- glPrioritizeTexturesEXT
- glPushAttrib
- glPushClientAttrib
- glPushMatrix
- glPushName
- glRasterPos2d
- glRasterPos2dv
- glRasterPos2f
- glRasterPos2fv
- glRasterPos2i
- glRasterPos2iv
- glRasterPos2s
- glRasterPos2sv
- glRasterPos3d
- glRasterPos3dv
- glRasterPos3f
- glRasterPos3fv
- glRasterPos3i
- glRasterPos3iv
- glRasterPos3s
- glRasterPos3sv
- glRasterPos4d
- glRasterPos4dv
- glRasterPos4f
- glRasterPos4fv
- glRasterPos4i
- glRasterPos4iv
- glRasterPos4s
- glRasterPos4sv
- glReadBuffer
- glReadPixels
- glRectd
- glRectdv
- glRectf
- glRectfv
- glRecti
- glRectiv
- glRects
- glRectsv
- glRenderMode
- glResizeBuffersMESA
- glRotated
- glRotatef
- glScaled
- glScalef
- glScissor
- glSelectBuffer
- glShadeModel
- glStencilFunc
- glStencilMask
- glStencilOp
- glTexCoord1d
- glTexCoord1dv
- glTexCoord1f
- glTexCoord1fv
- glTexCoord1i
- glTexCoord1iv
- glTexCoord1s
- glTexCoord1sv
- glTexCoord2d
- glTexCoord2dv
- glTexCoord2f
- glTexCoord2fv
- glTexCoord2i
- glTexCoord2iv
- glTexCoord2s
- glTexCoord2sv
- glTexCoord3d
- glTexCoord3dv
- glTexCoord3f
- glTexCoord3fv
- glTexCoord3i
- glTexCoord3iv
- glTexCoord3s
- glTexCoord3sv
- glTexCoord4d
- glTexCoord4dv
- glTexCoord4f
- glTexCoord4fv
- glTexCoord4i
- glTexCoord4iv
- glTexCoord4s
- glTexCoord4sv
- glTexCoordPointer
- glTexCoordPointerEXT
- glTexEnvf
- glTexEnvfv
- glTexEnvi
- glTexEnviv
- glTexGend
- glTexGendv
- glTexGenf
- glTexGenfv
- glTexGeni
- glTexGeniv
- glTexImage1D
- glTexImage2D
- glTexImage3DEXT
- glTexParameterf
- glTexParameterfv
- glTexParameteri
- glTexParameteriv
- glTexSubImage1D
- glTexSubImage2D
- glTexSubImage3DEXT
- glTranslated
- glTranslatef
- glVertex2d
- glVertex2dv
- glVertex2f
- glVertex2fv
- glVertex2i
- glVertex2iv
- glVertex2s
- glVertex2sv
- glVertex3d
- glVertex3dv
- glVertex3f
- glVertex3fv
- glVertex3i
- glVertex3iv
- glVertex3s
- glVertex3sv
- glVertex4d
- glVertex4dv
- glVertex4f
- glVertex4fv
- glVertex4i
- glVertex4iv
- glVertex4s
- glVertex4sv
- glVertexPointer
- glVertexPointerEXT
- glViewport
- glWindowPos2dMESA
- glWindowPos2dvMESA
- glWindowPos2fMESA
- glWindowPos2fvMESA
- glWindowPos2iMESA
- glWindowPos2ivMESA
- glWindowPos2sMESA
- glWindowPos2svMESA
- glWindowPos3dMESA
- glWindowPos3dvMESA
- glWindowPos3fMESA
- glWindowPos3fvMESA
- glWindowPos3iMESA
- glWindowPos3ivMESA
- glWindowPos3sMESA
- glWindowPos3svMESA
- glWindowPos4dMESA
- glWindowPos4dvMESA
- glWindowPos4fMESA
- glWindowPos4fvMESA
- glWindowPos4iMESA
- glWindowPos4ivMESA
- glWindowPos4sMESA
- glWindowPos4svMESA
- _swsetup_Wakeup
- _swsetup_CreateContext
- _tnl_CreateContext
- _ac_CreateContext
- _swrast_CreateContext
- _mesa_free_context_data
- _mesa_create_framebuffer
- _mesa_enable_1_3_extensions
- _mesa_enable_1_4_extensions
- _mesa_enable_sw_extensions
- _mesa_destroy_visual
- _mesa_initialize_context
- _mesa_create_visual
- _mesa_destroy_framebuffer
- _swrast_DestroyContext
- _ac_DestroyContext
- _tnl_DestroyContext
- _swsetup_DestroyContext
- _mesa_Viewport
- _mesa_make_current
- _mesa_get_current_context
- _mesa_error
- _swrast_choose_triangle
- _mesa_zbuffer_address
- _swrast_choose_line
- _tnl_InvalidateState
- _ac_InvalidateState
- _swsetup_InvalidateState
- _swrast_InvalidateState
- _tnl_run_pipeline
- _swrast_CopyConvolutionFilter2D
- _swrast_CopyConvolutionFilter1D
- _swrast_CopyColorSubTable
- _swrast_CopyColorTable
- _swrast_copy_texsubimage3d
- _swrast_copy_texsubimage2d
- _swrast_copy_texsubimage1d
- _swrast_copy_teximage2d
- _swrast_copy_teximage1d
- _mesa_test_proxy_teximage
- _mesa_store_texsubimage3d
- _mesa_store_texsubimage2d
- _mesa_store_texsubimage1d
- _mesa_store_teximage3d
- _mesa_store_teximage2d
- _mesa_store_teximage1d
- _mesa_store_compressed_texsubimage3d
- _mesa_store_compressed_texsubimage2d
- _mesa_store_compressed_texsubimage1d
- _mesa_store_compressed_teximage3d
- _mesa_store_compressed_teximage2d
- _mesa_store_compressed_teximage1d
- _mesa_choose_tex_format
- _mesa_compressed_texture_size
- _swrast_ReadPixels
- _swrast_DrawPixels
- _swrast_CopyPixels
- _swrast_Bitmap
- _swrast_Accum
- _swrast_alloc_buffers
- _swrast_GetDeviceDriverReference
- _swrast_Clear
- _glapi_get_context
- _mesa_ResizeBuffersMESA
- _glapi_get_proc_address
- _mesa_init_default_imports
- _tnl_MakeCurrent
- _swrast_DrawBuffer
- _mesa_free
- _mesa_calloc
- _mesa_strcmp
- _mesa_bzero
- _mesa_memset
- _mesa_memcpy
- _mesa_problem
- wglCopyContext
- wglCreateContext
- wglDeleteContext
- wglCreateLayerContext
- wglGetCurrentContext
- wglGetCurrentDC
- wglMakeCurrent
- wglShareLists
- wglUseFontBitmapsA
- wglUseFontBitmapsW
- wglUseFontOutlinesA
- wglUseFontOutlinesW
- wglDescribeLayerPlane
- wglSetLayerPaletteEntries
- wglGetLayerPaletteEntries
- wglRealizeLayerPalette
- wglSwapLayerBuffers
- wglChoosePixelFormat
- wglDescribePixelFormat
- wglGetProcAddress
- wglGetPixelFormat
- wglSetPixelFormat
- wglSwapBuffers
diff --git a/nx-X11/extras/Mesa/src/mesa/main/vsnprintf.c b/nx-X11/extras/Mesa/src/mesa/main/vsnprintf.c
deleted file mode 100644
index ab6c740d7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/main/vsnprintf.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Revision 12: http://theos.com/~deraadt/snprintf.c
- *
- * Copyright (c) 1997 Theo de Raadt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __VMS
-# include <sys/param.h>
-#endif
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <signal.h>
-#include <stdio.h>
-#if __STDC__
-#include <stdarg.h>
-#include <stdlib.h>
-#else
-#include <varargs.h>
-#endif
-#include <setjmp.h>
-#include <unistd.h>
-#include <string.h>
-
-#ifndef roundup
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-#endif
-
-#ifdef __sgi
-#define size_t ssize_t
-#endif
-
-static int pgsize;
-static char *curobj;
-static int caught;
-static sigjmp_buf bail;
-
-#define EXTRABYTES 2 /* XXX: why 2? you don't want to know */
-
-static char *
-msetup(str, n)
- char *str;
- size_t n;
-{
- char *e;
-
- if (n == 0)
- return NULL;
- if (pgsize == 0)
- pgsize = getpagesize();
- curobj = (char *)malloc(n + EXTRABYTES + pgsize * 2);
- if (curobj == NULL)
- return NULL;
- e = curobj + n + EXTRABYTES;
- e = (char *)roundup((unsigned long)e, pgsize);
- if (mprotect(e, pgsize, PROT_NONE) == -1) {
- free(curobj);
- curobj = NULL;
- return NULL;
- }
- e = e - n - EXTRABYTES;
- *e = '\0';
- return (e);
-}
-
-static void
- mcatch( int a )
-{
- siglongjmp(bail, 1);
-}
-
-static void
-mcleanup(str, n, p)
- char *str;
- size_t n;
- char *p;
-{
- strncpy(str, p, n-1);
- str[n-1] = '\0';
- if (mprotect((caddr_t)(p + n + EXTRABYTES), pgsize,
- PROT_READ|PROT_WRITE|PROT_EXEC) == -1)
- mprotect((caddr_t)(p + n + EXTRABYTES), pgsize,
- PROT_READ|PROT_WRITE);
- free(curobj);
-}
-
-int
-#if __STDC__
-vsnprintf(char *str, size_t n, char const *fmt, va_list ap)
-#else
-vsnprintf(str, n, fmt, ap)
- char *str;
- size_t n;
- char *fmt;
- char *ap;
-#endif
-{
- struct sigaction osa, nsa;
- char *p;
- int ret = n + 1; /* if we bail, indicated we overflowed */
-
- memset(&nsa, 0, sizeof nsa);
- nsa.sa_handler = mcatch;
- sigemptyset(&nsa.sa_mask);
-
- p = msetup(str, n);
- if (p == NULL) {
- *str = '\0';
- return 0;
- }
- if (sigsetjmp(bail, 1) == 0) {
- if (sigaction(SIGSEGV, &nsa, &osa) == -1) {
- mcleanup(str, n, p);
- return (0);
- }
- ret = vsprintf(p, fmt, ap);
- }
- mcleanup(str, n, p);
- (void) sigaction(SIGSEGV, &osa, NULL);
- return (ret);
-}
-
-int
-#if __STDC__
-snprintf(char *str, size_t n, char const *fmt, ...)
-#else
-snprintf(str, n, fmt, va_alist)
- char *str;
- size_t n;
- char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
-
- return (vsnprintf(str, n, fmt, ap));
- va_end(ap);
-}
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/math/descrip.mms b/nx-X11/extras/Mesa/src/mesa/math/descrip.mms
deleted file mode 100644
index 86eaf0e46..000000000
--- a/nx-X11/extras/Mesa/src/mesa/math/descrip.mms
+++ /dev/null
@@ -1,45 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [---.include.gl]
- define math [-.math]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main],[-.glapi]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = m_debug_clip.c m_debug_norm.c m_debug_xform.c m_eval.c m_matrix.c\
- m_translate.c m_vector.c m_xform.c
-
-OBJECTS = m_debug_clip.obj,m_debug_norm.obj,m_debug_xform.obj,m_eval.obj,\
- m_matrix.obj,m_translate.obj,m_vector.obj,m_xform.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-m_debug_clip.obj : m_debug_clip.c
-m_debug_norm.obj : m_debug_norm.c
-m_debug_xform.obj : m_debug_xform.c
-m_eval.obj : m_eval.c
-m_matrix.obj : m_matrix.c
-m_translate.obj : m_translate.c
-m_vector.obj : m_vector.c
-m_xform.obj : m_xform.c
diff --git a/nx-X11/extras/Mesa/src/mesa/ppc/common_ppc.c b/nx-X11/extras/Mesa/src/mesa/ppc/common_ppc.c
deleted file mode 100644
index 13526df78..000000000
--- a/nx-X11/extras/Mesa/src/mesa/ppc/common_ppc.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file common_ppc.c
- * Check CPU capabilities & initialize optimized funtions for this particular
- * processor.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#ifdef USE_PPC_ASM
-#include <elf.h>
-#endif
-
-unsigned long _mesa_ppc_cpu_features = 0;
-
-/**
- * Detect CPU features and install optimized transform and lighting routines.
- * Currently, CPU features are only detected. The optimized routines have
- * yet to be written.
- *
- * \bug
- * This routine is highly specific to Linux kernel 2.6. I'm still waiting
- * to hear back from the glibc folk on how to do this "right".
- */
-
-void _mesa_init_all_ppc_transform_asm( void )
-{
-#ifdef USE_PPC_ASM
- const pid_t my_pid = getpid();
- char file_name[32];
- FILE * f;
-#ifdef __powerpc64__
- Elf64_auxv_t v;
-#else
- Elf32_auxv_t v;
-#endif
-
- sprintf( file_name, "/proc/%u/auxv", (unsigned) my_pid );
- f = fopen( file_name, "rb" );
- if ( f != NULL ) {
- while( 1 ) {
- ssize_t elem = fread( & v, sizeof( v ), 1, f );
-
- if ( elem < 1 ) {
- break;
- }
-
- if ( v.a_type == AT_HWCAP ) {
- _mesa_ppc_cpu_features = v.a_un.a_val;
- break;
- }
- }
-
- fclose( f );
- }
-
-# ifndef USE_VMX_ASM
- _mesa_ppc_cpu_features &= ~PPC_FEATURES_HAS_ALTIVEC;
-# endif
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/ppc/common_ppc_features.h b/nx-X11/extras/Mesa/src/mesa/ppc/common_ppc_features.h
deleted file mode 100644
index 4d46ca04c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/ppc/common_ppc_features.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file common_ppc_features.h
- * Interface for determining which CPU features were detected.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#ifndef COMMON_PPC_FEATURES_H
-#define COMMON_PPC_FEATURES_H
-
-#ifdef USE_PPC_ASM
-#include <asm/cputable.h>
-
-extern unsigned long _mesa_ppc_cpu_features;
-
-
-/* The PPC_FEATURE_* values come from asm/cputable.h. Should we define
- * versions of them here if that file does not exist? This will only
- * matter once these code paths are supported on non-Linux platforms.
- */
-
-#define cpu_has_64 ((_mesa_ppc_cpu_features & PPC_FEATURE_64) != 0)
-#define cpu_has_vmx ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_ALTIVEC) != 0)
-#define cpu_has_fpu ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_FPU) != 0)
-
-#endif /* USE_PPC_ASM */
-#endif /* COMMON_PPC_FEATURES_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/arbprogram.syn b/nx-X11/extras/Mesa/src/mesa/shader/arbprogram.syn
deleted file mode 100644
index 6ab0f2693..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/arbprogram.syn
+++ /dev/null
@@ -1,2786 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.2
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
- /**
- * \file arbprogram.syn
- * ARB_fragment/vertex_program syntax
- * \author Michal Krol
- */
-
-.syntax program;
-
-/*
- This value must be incremented every time emit code values or structure of the production
- array changes. This value is placed at the beginning of the production array. The loader
- compares the value with its REVISION value. If they do not match, the loader is not up
- to date.
-*/
-.emtcode REVISION 0x09
-
-/* program type */
-.emtcode FRAGMENT_PROGRAM 0x01
-.emtcode VERTEX_PROGRAM 0x02
-
-/* program section */
-.emtcode OPTION 0x01
-.emtcode INSTRUCTION 0x02
-.emtcode DECLARATION 0x03
-.emtcode END 0x04
-
-/* GL_ARB_fragment_program option */
-.emtcode ARB_PRECISION_HINT_FASTEST 0x00
-.emtcode ARB_PRECISION_HINT_NICEST 0x01
-.emtcode ARB_FOG_EXP 0x02
-.emtcode ARB_FOG_EXP2 0x03
-.emtcode ARB_FOG_LINEAR 0x04
-
-/* GL_ARB_vertex_program option */
-.emtcode ARB_POSITION_INVARIANT 0x05
-
-/* GL_ARB_fragment_program_shadow option */
-.emtcode ARB_FRAGMENT_PROGRAM_SHADOW 0x06
-
-/* GL_ARB_draw_buffers option */
-.emtcode ARB_DRAW_BUFFERS 0x07
-
-/* GL_ARB_fragment_program instruction class */
-.emtcode OP_ALU_INST 0x00
-.emtcode OP_TEX_INST 0x01
-
-/* GL_ARB_vertex_program instruction class */
-/* OP_ALU_INST */
-
-/* GL_ARB_fragment_program instruction type */
-.emtcode OP_ALU_VECTOR 0x00
-.emtcode OP_ALU_SCALAR 0x01
-.emtcode OP_ALU_BINSC 0x02
-.emtcode OP_ALU_BIN 0x03
-.emtcode OP_ALU_TRI 0x04
-.emtcode OP_ALU_SWZ 0x05
-.emtcode OP_TEX_SAMPLE 0x06
-.emtcode OP_TEX_KIL 0x07
-
-/* GL_ARB_vertex_program instruction type */
-.emtcode OP_ALU_ARL 0x08
-/* OP_ALU_VECTOR */
-/* OP_ALU_SCALAR */
-/* OP_ALU_BINSC */
-/* OP_ALU_BIN */
-/* OP_ALU_TRI */
-/* OP_ALU_SWZ */
-
-/* GL_ARB_fragment_program instruction code */
-.emtcode OP_ABS 0x00
-.emtcode OP_ABS_SAT 0x1B
-.emtcode OP_FLR 0x09
-.emtcode OP_FLR_SAT 0x26
-.emtcode OP_FRC 0x0A
-.emtcode OP_FRC_SAT 0x27
-.emtcode OP_LIT 0x0C
-.emtcode OP_LIT_SAT 0x2A
-.emtcode OP_MOV 0x11
-.emtcode OP_MOV_SAT 0x30
-.emtcode OP_COS 0x1F
-.emtcode OP_COS_SAT 0x20
-.emtcode OP_EX2 0x07
-.emtcode OP_EX2_SAT 0x25
-.emtcode OP_LG2 0x0B
-.emtcode OP_LG2_SAT 0x29
-.emtcode OP_RCP 0x14
-.emtcode OP_RCP_SAT 0x33
-.emtcode OP_RSQ 0x15
-.emtcode OP_RSQ_SAT 0x34
-.emtcode OP_SIN 0x38
-.emtcode OP_SIN_SAT 0x39
-.emtcode OP_SCS 0x35
-.emtcode OP_SCS_SAT 0x36
-.emtcode OP_POW 0x13
-.emtcode OP_POW_SAT 0x32
-.emtcode OP_ADD 0x01
-.emtcode OP_ADD_SAT 0x1C
-.emtcode OP_DP3 0x03
-.emtcode OP_DP3_SAT 0x21
-.emtcode OP_DP4 0x04
-.emtcode OP_DP4_SAT 0x22
-.emtcode OP_DPH 0x05
-.emtcode OP_DPH_SAT 0x23
-.emtcode OP_DST 0x06
-.emtcode OP_DST_SAT 0x24
-.emtcode OP_MAX 0x0F
-.emtcode OP_MAX_SAT 0x2E
-.emtcode OP_MIN 0x10
-.emtcode OP_MIN_SAT 0x2F
-.emtcode OP_MUL 0x12
-.emtcode OP_MUL_SAT 0x31
-.emtcode OP_SGE 0x16
-.emtcode OP_SGE_SAT 0x37
-.emtcode OP_SLT 0x17
-.emtcode OP_SLT_SAT 0x3A
-.emtcode OP_SUB 0x18
-.emtcode OP_SUB_SAT 0x3B
-.emtcode OP_XPD 0x1A
-.emtcode OP_XPD_SAT 0x43
-.emtcode OP_CMP 0x1D
-.emtcode OP_CMP_SAT 0x1E
-.emtcode OP_LRP 0x2B
-.emtcode OP_LRP_SAT 0x2C
-.emtcode OP_MAD 0x0E
-.emtcode OP_MAD_SAT 0x2D
-.emtcode OP_SWZ 0x19
-.emtcode OP_SWZ_SAT 0x3C
-.emtcode OP_TEX 0x3D
-.emtcode OP_TEX_SAT 0x3E
-.emtcode OP_TXB 0x3F
-.emtcode OP_TXB_SAT 0x40
-.emtcode OP_TXP 0x41
-.emtcode OP_TXP_SAT 0x42
-.emtcode OP_KIL 0x28
-
-/* GL_ARB_vertex_program instruction code */
-.emtcode OP_ARL 0x02
-/* OP_ABS */
-/* OP_FLR */
-/* OP_FRC */
-/* OP_LIT */
-/* OP_MOV */
-/* OP_EX2 */
-.emtcode OP_EXP 0x08
-/* OP_LG2 */
-.emtcode OP_LOG 0x0D
-/* OP_RCP */
-/* OP_RSQ */
-/* OP_POW */
-/* OP_ADD */
-/* OP_DP3 */
-/* OP_DP4 */
-/* OP_DPH */
-/* OP_DST */
-/* OP_MAX */
-/* OP_MIN */
-/* OP_MUL */
-/* OP_SGE */
-/* OP_SLT */
-/* OP_SUB */
-/* OP_XPD */
-/* OP_MAD */
-/* OP_SWZ */
-
-/* fragment attribute binding */
-.emtcode FRAGMENT_ATTRIB_COLOR 0x01
-.emtcode FRAGMENT_ATTRIB_TEXCOORD 0x02
-.emtcode FRAGMENT_ATTRIB_FOGCOORD 0x03
-.emtcode FRAGMENT_ATTRIB_POSITION 0x04
-
-/* vertex attribute binding */
-.emtcode VERTEX_ATTRIB_POSITION 0x01
-.emtcode VERTEX_ATTRIB_WEIGHT 0x02
-.emtcode VERTEX_ATTRIB_NORMAL 0x03
-.emtcode VERTEX_ATTRIB_COLOR 0x04
-.emtcode VERTEX_ATTRIB_FOGCOORD 0x05
-.emtcode VERTEX_ATTRIB_TEXCOORD 0x06
-.emtcode VERTEX_ATTRIB_MATRIXINDEX 0x07
-.emtcode VERTEX_ATTRIB_GENERIC 0x08
-
-/* fragment result binding */
-.emtcode FRAGMENT_RESULT_COLOR 0x01
-.emtcode FRAGMENT_RESULT_DEPTH 0x02
-
-/* vertex result binding */
-.emtcode VERTEX_RESULT_POSITION 0x01
-.emtcode VERTEX_RESULT_COLOR 0x02
-.emtcode VERTEX_RESULT_FOGCOORD 0x03
-.emtcode VERTEX_RESULT_POINTSIZE 0x04
-.emtcode VERTEX_RESULT_TEXCOORD 0x05
-
-/* texture target */
-.emtcode TEXTARGET_1D 0x01
-.emtcode TEXTARGET_2D 0x02
-.emtcode TEXTARGET_3D 0x03
-.emtcode TEXTARGET_RECT 0x04
-.emtcode TEXTARGET_CUBE 0x05
-/* GL_ARB_fragment_program_shadow */
-.emtcode TEXTARGET_SHADOW1D 0x06
-.emtcode TEXTARGET_SHADOW2D 0x07
-.emtcode TEXTARGET_SHADOWRECT 0x08
-
-/* face type */
-.emtcode FACE_FRONT 0x00
-.emtcode FACE_BACK 0x01
-
-/* color type */
-.emtcode COLOR_PRIMARY 0x00
-.emtcode COLOR_SECONDARY 0x01
-
-/* component */
-.emtcode COMPONENT_X 0x00
-.emtcode COMPONENT_Y 0x01
-.emtcode COMPONENT_Z 0x02
-.emtcode COMPONENT_W 0x03
-.emtcode COMPONENT_0 0x04
-.emtcode COMPONENT_1 0x05
-
-/* array index type */
-.emtcode ARRAY_INDEX_ABSOLUTE 0x00
-.emtcode ARRAY_INDEX_RELATIVE 0x01
-
-/* matrix name */
-.emtcode MATRIX_MODELVIEW 0x01
-.emtcode MATRIX_PROJECTION 0x02
-.emtcode MATRIX_MVP 0x03
-.emtcode MATRIX_TEXTURE 0x04
-.emtcode MATRIX_PALETTE 0x05
-.emtcode MATRIX_PROGRAM 0x06
-
-/* matrix modifier */
-.emtcode MATRIX_MODIFIER_IDENTITY 0x00
-.emtcode MATRIX_MODIFIER_INVERSE 0x01
-.emtcode MATRIX_MODIFIER_TRANSPOSE 0x02
-.emtcode MATRIX_MODIFIER_INVTRANS 0x03
-
-/* constant type */
-.emtcode CONSTANT_SCALAR 0x01
-.emtcode CONSTANT_VECTOR 0x02
-
-/* program param type */
-.emtcode PROGRAM_PARAM_ENV 0x01
-.emtcode PROGRAM_PARAM_LOCAL 0x02
-
-/* register type */
-.emtcode REGISTER_ATTRIB 0x01
-.emtcode REGISTER_PARAM 0x02
-.emtcode REGISTER_RESULT 0x03
-.emtcode REGISTER_ESTABLISHED_NAME 0x04
-
-/* param binding */
-.emtcode PARAM_NULL 0x00
-.emtcode PARAM_ARRAY_ELEMENT 0x01
-.emtcode PARAM_STATE_ELEMENT 0x02
-.emtcode PARAM_PROGRAM_ELEMENT 0x03
-.emtcode PARAM_PROGRAM_ELEMENTS 0x04
-.emtcode PARAM_CONSTANT 0x05
-
-/* param state property */
-.emtcode STATE_MATERIAL 0x01
-.emtcode STATE_LIGHT 0x02
-.emtcode STATE_LIGHT_MODEL 0x03
-.emtcode STATE_LIGHT_PROD 0x04
-.emtcode STATE_FOG 0x05
-.emtcode STATE_MATRIX_ROWS 0x06
-/* GL_ARB_fragment_program */
-.emtcode STATE_TEX_ENV 0x07
-.emtcode STATE_DEPTH 0x08
-/* GL_ARB_vertex_program */
-.emtcode STATE_TEX_GEN 0x09
-.emtcode STATE_CLIP_PLANE 0x0A
-.emtcode STATE_POINT 0x0B
-
-/* state material property */
-.emtcode MATERIAL_AMBIENT 0x01
-.emtcode MATERIAL_DIFFUSE 0x02
-.emtcode MATERIAL_SPECULAR 0x03
-.emtcode MATERIAL_EMISSION 0x04
-.emtcode MATERIAL_SHININESS 0x05
-
-/* state light property */
-.emtcode LIGHT_AMBIENT 0x01
-.emtcode LIGHT_DIFFUSE 0x02
-.emtcode LIGHT_SPECULAR 0x03
-.emtcode LIGHT_POSITION 0x04
-.emtcode LIGHT_ATTENUATION 0x05
-.emtcode LIGHT_HALF 0x06
-.emtcode LIGHT_SPOT_DIRECTION 0x07
-
-/* state light model property */
-.emtcode LIGHT_MODEL_AMBIENT 0x01
-.emtcode LIGHT_MODEL_SCENECOLOR 0x02
-
-/* state light product property */
-.emtcode LIGHT_PROD_AMBIENT 0x01
-.emtcode LIGHT_PROD_DIFFUSE 0x02
-.emtcode LIGHT_PROD_SPECULAR 0x03
-
-/* state texture environment property */
-.emtcode TEX_ENV_COLOR 0x01
-
-/* state texture generation coord property */
-.emtcode TEX_GEN_EYE 0x01
-.emtcode TEX_GEN_OBJECT 0x02
-
-/* state fog property */
-.emtcode FOG_COLOR 0x01
-.emtcode FOG_PARAMS 0x02
-
-/* state depth property */
-.emtcode DEPTH_RANGE 0x01
-
-/* state point parameters property */
-.emtcode POINT_SIZE 0x01
-.emtcode POINT_ATTENUATION 0x02
-
-/* declaration */
-.emtcode ATTRIB 0x01
-.emtcode PARAM 0x02
-.emtcode TEMP 0x03
-.emtcode OUTPUT 0x04
-.emtcode ALIAS 0x05
-/* GL_ARB_vertex_program */
-.emtcode ADDRESS 0x06
-
-/* error messages */
-.errtext UNKNOWN_PROGRAM_SIGNATURE "1001: '$e_signature$': unknown program signature"
-.errtext MISSING_END_OR_INVALID_STATEMENT "1002: '$e_statement$': invalid statement"
-.errtext CODE_AFTER_END "1003: '$e_statement$': code after 'END' keyword"
-.errtext INVALID_PROGRAM_OPTION "1004: '$e_identifier$': invalid program option"
-.errtext EXT_SWIZ_COMP_EXPECTED "1005: extended swizzle component expected but '$e_token$' found"
-.errtext TEX_TARGET_EXPECTED "1006: texture target expected but '$e_token$' found"
-.errtext TEXTURE_EXPECTED "1007: 'texture' expected but '$e_identifier$' found"
-.errtext SOURCE_REGISTER_EXPECTED "1008: source register expected but '$e_token$' found"
-.errtext DESTINATION_REGISTER_EXPECTED "1009: destination register expected but '$e_token$' found"
-.errtext INVALID_ADDRESS_COMPONENT "1010: '$e_identifier$': invalid address component"
-.errtext INVALID_ADDRESS_WRITEMASK "1011: '$e_identifier$': invalid address writemask"
-.errtext INVALID_COMPONENT "1012: '$e_charordigit$': invalid component"
-.errtext INVALID_SUFFIX "1013: '$e_identifier$': invalid suffix"
-.errtext INVALID_WRITEMASK "1014: '$e_identifier$': invalid writemask"
-.errtext FRAGMENT_EXPECTED "1015: 'fragment' expected but '$e_identifier$' found"
-.errtext VERTEX_EXPECTED "1016: 'vertex' expected but '$e_identifier$' found"
-.errtext INVALID_FRAGMENT_PROPERTY "1017: '$e_identifier$': invalid fragment property"
-.errtext INVALID_VERTEX_PROPERTY "1018: '$e_identifier$': invalid vertex property"
-.errtext INVALID_STATE_PROPERTY "1019: '$e_identifier$': invalid state property"
-.errtext INVALID_MATERIAL_PROPERTY "1020: '$e_identifier$': invalid material property"
-.errtext INVALID_LIGHT_PROPERTY "1021: '$e_identifier$': invalid light property"
-.errtext INVALID_SPOT_PROPERTY "1022: '$e_identifier$': invalid spot property"
-.errtext INVALID_LIGHTMODEL_PROPERTY "1023: '$e_identifier$': invalid light model property"
-.errtext INVALID_LIGHTPROD_PROPERTY "1024: '$e_identifier$': invalid light product property"
-.errtext INVALID_TEXENV_PROPERTY "1025: '$e_identifier$': invalid texture environment property"
-.errtext INVALID_TEXGEN_PROPERTY "1026: '$e_identifier$': invalid texture generating property"
-.errtext INVALID_TEXGEN_COORD "1027: '$e_identifier$': invalid texture generating coord"
-.errtext INVALID_FOG_PROPERTY "1028: '$e_identifier$': invalid fog property"
-.errtext INVALID_DEPTH_PROPERTY "1029: '$e_identifier$': invalid depth property"
-.errtext INVALID_CLIPPLANE_PROPERTY "1030: '$e_identifier$': invalid clip plane property"
-.errtext INVALID_POINT_PROPERTY "1031: '$e_identifier$': invalid point property"
-.errtext MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED "1032: matrix row selector or modifier expected but '$e_token$' found"
-.errtext INVALID_MATRIX_NAME "1033: '$e_identifier$': invalid matrix name"
-.errtext INVALID_PROGRAM_PROPERTY "1034: '$e_identifier$': invalid program property"
-.errtext RESULT_EXPECTED "1035: 'result' expected but '$e_token$' found"
-.errtext INVALID_RESULT_PROPERTY "1036: '$e_identifier$': invalid result property"
-.errtext INVALID_FACE_PROPERTY "1037: '$e_identifier$': invalid face property"
-.errtext INVALID_COLOR_PROPERTY "1038: '$e_identifier$': invalid color property"
-.errtext IDENTIFIER_EXPECTED "1039: identifier expected but '$e_token$' found"
-.errtext RESERVED_KEYWORD "1040: use of reserved keyword as an identifier"
-.errtext INTEGER_EXPECTED "1041: integer value expected but '$e_token$' found"
-.errtext MISSING_SEMICOLON "1042: ';' expected but '$e_token$' found"
-.errtext MISSING_COMMA "1043: ',' expected but '$e_token$' found"
-.errtext MISSING_LBRACKET "1044: '[' expected but '$e_token$' found"
-.errtext MISSING_RBRACKET "1045: ']' expected but '$e_token$' found"
-.errtext MISSING_DOT "1046: '.' expected but '$e_token$' found"
-.errtext MISSING_EQUAL "1047: '=' expected but '$e_token$' found"
-.errtext MISSING_LBRACE "1048: '{' expected but '$e_token$' found"
-.errtext MISSING_RBRACE "1049: '}' expected but '$e_token$' found"
-.errtext MISSING_DOTDOT "1050: '..' expected but '$e_token$' found"
-.errtext MISSING_FRACTION_OR_EXPONENT "1051: missing fraction part or exponent"
-.errtext MISSING_DOT_OR_EXPONENT "1052: missing '.' or exponent"
-.errtext EXPONENT_VALUE_EXPECTED "1053: exponent value expected"
-.errtext INTEGER_OUT_OF_RANGE "1054: integer value out of range"
-.errtext OPERATION_NEEDS_DESTINATION_VARIABLE "1055: operation needs destination variable"
-.errtext OPERATION_NEEDS_SOURCE_VARIABLE "1056: operation needs source variable"
-.errtext ADDRESS_REGISTER_EXPECTED "1057: address register expected but '$e_token$' found"
-.errtext ADDRESS_REGISTER_OR_INTEGER_EXPECTED "1058: address register or integer literal expected but '$e_token$' found"
-
-/* extension presence condition registers */
-
-/* GL_ARB_vertex_blend */
-/* GL_EXT_vertex_weighting */
-.regbyte vertex_blend 0x00
-
-/* GL_ARB_matrix_palette */
-.regbyte matrix_palette 0x00
-
-/* GL_ARB_point_parameters */
-/* GL_EXT_point_parameters */
-.regbyte point_parameters 0x00
-
-/* GL_EXT_secondary_color */
-.regbyte secondary_color 0x00
-
-/* GL_EXT_fog_coord */
-.regbyte fog_coord 0x00
-
-/* GL_EXT_texture_rectangle */
-/* GL_NV_texture_rectangle */
-.regbyte texture_rectangle 0x00
-
-/* GL_ARB_fragment_program_shadow */
-.regbyte fragment_program_shadow 0x00
-
-/* GL_ARB_draw_buffers */
-.regbyte draw_buffers 0x00
-
-/* option presence condition registers */
-/* they are all initially set to zero - when a particular OPTION is encountered, the appropriate */
-/* register is set to 1 to indicate that the OPTION was specified. */
-
-/* GL_ARB_fragment_program */
-.regbyte ARB_precision_hint_fastest 0x00
-.regbyte ARB_precision_hint_nicest 0x00
-.regbyte ARB_fog_exp 0x00
-.regbyte ARB_fog_exp2 0x00
-.regbyte ARB_fog_linear 0x00
-
-/* GL_ARB_vertex_program */
-.regbyte ARB_position_invariant 0x00
-
-/* GL_ARB_fragment_program_shadow */
-.regbyte ARB_fragment_program_shadow 0x00
-
-/* GL_ARB_draw_buffers */
-.regbyte ARB_draw_buffers 0x00
-
-/* program target condition register */
-/* this syntax script deals with two program targets - VERTEX_PROGRAM and FRAGMENT_PROGRAM. */
-/* to distinguish between them we need a register that will store for us the current target. */
-/* the client will typically set the register to apropriate value before parsing a particular */
-/* program. the mapping between program targets and their values is listed below. */
-/* */
-/* program target register value */
-/* ---------------------------------------------- */
-/* FRAGMENT_PROGRAM 0x10 */
-/* VERTEX_PROGRAM 0x20 */
-/* */
-/* the initial value of the register is 0 to catch potential errors with not setting the register */
-/* with the proper value. */
-.regbyte program_target 0x00
-
-/*
- <program> ::= <optionSequence> <statementSequence> "END"
-*/
-program
- programs .error UNKNOWN_PROGRAM_SIGNATURE .emit REVISION;
-programs
- .if (program_target == 0x10) frag_program_1_0 .emit FRAGMENT_PROGRAM .emit 0x01 .emit 0x00 .or
- .if (program_target == 0x20) vert_program_1_0 .emit VERTEX_PROGRAM .emit 0x01 .emit 0x00;
-frag_program_1_0
- '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'f' .and 'p' .and '1' .and '.' .and '0' .and
- optional_space .and fp_optionSequence .and fp_statementSequence .and
- "END" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and
- '\0' .error CODE_AFTER_END;
-vert_program_1_0
- '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'v' .and 'p' .and '1' .and '.' .and '0' .and
- optional_space .and vp_optionSequence .and vp_statementSequence .and
- "END" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and
- '\0' .error CODE_AFTER_END;
-
-/*
- <optionSequence> ::= <optionSequence> <option>
- | ""
-*/
-fp_optionSequence
- .loop fp_option;
-vp_optionSequence
- .loop vp_option;
-
-/*
- <option> ::= "OPTION" <identifier> ";"
-
-NOTE: options ARB_precision_hint_nicest and ARB_precision_hint_fastest are exclusive. When one of
- these options is encountered, the other one is automatically disabled.
- the same applies to options ARB_fog_exp, ARB_fog_exp2 and ARB_fog_linear.
-*/
-fp_option
- "OPTION" .emit OPTION .and space .error IDENTIFIER_EXPECTED .and
- fp_optionString .error INVALID_PROGRAM_OPTION .and semicolon;
-vp_option
- "OPTION" .emit OPTION .and space .error IDENTIFIER_EXPECTED .and
- vp_optionString .error INVALID_PROGRAM_OPTION .and semicolon;
-fp_optionString
- .if (ARB_precision_hint_nicest == 0x00) "ARB_precision_hint_fastest"
- .emit ARB_PRECISION_HINT_FASTEST .load ARB_precision_hint_fastest 0x01 .or
- .if (ARB_precision_hint_fastest == 0x00) "ARB_precision_hint_nicest"
- .emit ARB_PRECISION_HINT_NICEST .load ARB_precision_hint_nicest 0x01 .or
- fp_ARB_fog_exp .emit ARB_FOG_EXP .load ARB_fog_exp 0x01 .or
- fp_ARB_fog_exp2 .emit ARB_FOG_EXP2 .load ARB_fog_exp2 0x01 .or
- fp_ARB_fog_linear .emit ARB_FOG_LINEAR .load ARB_fog_linear 0x01 .or
- .if (fragment_program_shadow != 0x00) "ARB_fragment_program_shadow"
- .emit ARB_FRAGMENT_PROGRAM_SHADOW .load ARB_fragment_program_shadow 0x01 .or
- .if (draw_buffers != 0x00) "ARB_draw_buffers" .emit ARB_DRAW_BUFFERS
- .load ARB_draw_buffers 0x01;
-vp_optionString
- "ARB_position_invariant" .emit ARB_POSITION_INVARIANT .load ARB_position_invariant 0x01;
-fp_ARB_fog_exp
- .if (ARB_fog_exp2 == 0x00) .true .and .if (ARB_fog_linear == 0x00) "ARB_fog_exp";
-fp_ARB_fog_exp2
- .if (ARB_fog_exp == 0x00) .true .and .if (ARB_fog_linear == 0x00) "ARB_fog_exp2";
-fp_ARB_fog_linear
- .if (ARB_fog_exp == 0x00) .true .and .if (ARB_fog_exp2 == 0x00) "ARB_fog_linear";
-
-/*
- <statementSequence> ::= <statementSequence> <statement>
- | ""
-*/
-fp_statementSequence
- .loop fp_statement;
-vp_statementSequence
- .loop vp_statement;
-
-/*
- <statement> ::= <instruction> ";"
- | <namingStatement> ";"
-
-NOTE: ".emit $" in the definitions below means that we output instruction position (offset of
- the first character of instruction) for program debugging purposes.
-*/
-fp_statement
- fp_statement_1 .or fp_statement_2;
-vp_statement
- vp_statement_1 .or vp_statement_2;
-fp_statement_1
- fp_instruction .emit INSTRUCTION .emit $ .and semicolon;
-fp_statement_2
- fp_namingStatement .emit DECLARATION .and semicolon;
-vp_statement_1
- vp_instruction .emit INSTRUCTION .emit $ .and semicolon;
-vp_statement_2
- vp_namingStatement .emit DECLARATION .and semicolon;
-
-/*
-fragment program
- <instruction> ::= <ALUInstruction>
- | <TexInstruction>
-
-vertex program
- <instruction> ::= <ARL_instruction>
- | <VECTORop_instruction>
- | <SCALARop_instruction>
- | <BINSCop_instruction>
- | <BINop_instruction>
- | <TRIop_instruction>
- | <SWZ_instruction>
-*/
-fp_instruction
- ALUInstruction .emit OP_ALU_INST .or
- TexInstruction .emit OP_TEX_INST;
-vp_instruction
- ARL_instruction .emit OP_ALU_ARL .or
- vp_VECTORop_instruction .emit OP_ALU_VECTOR .or
- vp_SCALARop_instruction .emit OP_ALU_SCALAR .or
- vp_BINSCop_instruction .emit OP_ALU_BINSC .or
- vp_BINop_instruction .emit OP_ALU_BIN .or
- vp_TRIop_instruction .emit OP_ALU_TRI .or
- vp_SWZ_instruction .emit OP_ALU_SWZ;
-
-/*
-fragment program
- <ALUInstruction> ::= <VECTORop_instruction>
- | <SCALARop_instruction>
- | <BINSCop_instruction>
- | <BINop_instruction>
- | <TRIop_instruction>
- | <SWZ_instruction>
-*/
-ALUInstruction
- fp_VECTORop_instruction .emit OP_ALU_VECTOR .or
- fp_SCALARop_instruction .emit OP_ALU_SCALAR .or
- fp_BINSCop_instruction .emit OP_ALU_BINSC .or
- fp_BINop_instruction .emit OP_ALU_BIN .or
- fp_TRIop_instruction .emit OP_ALU_TRI .or
- fp_SWZ_instruction .emit OP_ALU_SWZ;
-
-/*
-fragment program
- <TexInstruction> ::= <SAMPLE_instruction>
- | <KIL_instruction>
-*/
-TexInstruction
- SAMPLE_instruction .emit OP_TEX_SAMPLE .or
- KIL_instruction .emit OP_TEX_KIL;
-
-/*
-vertex program
- <ARL_instruction> ::= "ARL" <maskedAddrReg> "," <scalarSrcReg>
-*/
-ARL_instruction
- "ARL" .emit OP_ARL .and space_dst .and maskedAddrReg .and comma .and vp_scalarSrcReg;
-
-/*
-fragment program
- <VECTORop_instruction> ::= <VECTORop> <maskedDstReg> ","
- <vectorSrcReg>
-
-vertex program
- <VECTORop_instruction> ::= <VECTORop> <maskedDstReg> "," <swizzleSrcReg>
-*/
-fp_VECTORop_instruction
- fp_VECTORop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg;
-vp_VECTORop_instruction
- vp_VECTORop .and space_dst .and vp_maskedDstReg .and comma .and swizzleSrcReg;
-
-/*
-fragment program
- <VECTORop> ::= "ABS" | "ABS_SAT"
- | "FLR" | "FLR_SAT"
- | "FRC" | "FRC_SAT"
- | "LIT" | "LIT_SAT"
- | "MOV" | "MOV_SAT"
-
-vertex program
- <VECTORop> ::= "ABS"
- | "FLR"
- | "FRC"
- | "LIT"
- | "MOV"
-*/
-fp_VECTORop
- "ABS" .emit OP_ABS .or "ABS_SAT" .emit OP_ABS_SAT .or
- "FLR" .emit OP_FLR .or "FLR_SAT" .emit OP_FLR_SAT .or
- "FRC" .emit OP_FRC .or "FRC_SAT" .emit OP_FRC_SAT .or
- "LIT" .emit OP_LIT .or "LIT_SAT" .emit OP_LIT_SAT .or
- "MOV" .emit OP_MOV .or "MOV_SAT" .emit OP_MOV_SAT;
-vp_VECTORop
- "ABS" .emit OP_ABS .or
- "FLR" .emit OP_FLR .or
- "FRC" .emit OP_FRC .or
- "LIT" .emit OP_LIT .or
- "MOV" .emit OP_MOV;
-
-/*
- <SCALARop_instruction> ::= <SCALARop> <maskedDstReg> "," <scalarSrcReg>
-*/
-fp_SCALARop_instruction
- fp_SCALARop .and space_dst .and fp_maskedDstReg .and comma .and fp_scalarSrcReg;
-vp_SCALARop_instruction
- vp_SCALARop .and space_dst .and vp_maskedDstReg .and comma .and vp_scalarSrcReg;
-
-/*
-fragment program
- <SCALARop> ::= "COS" | "COS_SAT"
- | "EX2" | "EX2_SAT"
- | "LG2" | "LG2_SAT"
- | "RCP" | "RCP_SAT"
- | "RSQ" | "RSQ_SAT"
- | "SIN" | "SIN_SAT"
- | "SCS" | "SCS_SAT"
-
-vertex program
- <SCALARop> ::= "EX2"
- | "EXP"
- | "LG2"
- | "LOG"
- | "RCP"
- | "RSQ"
-*/
-fp_SCALARop
- "COS" .emit OP_COS .or "COS_SAT" .emit OP_COS_SAT .or
- "EX2" .emit OP_EX2 .or "EX2_SAT" .emit OP_EX2_SAT .or
- "LG2" .emit OP_LG2 .or "LG2_SAT" .emit OP_LG2_SAT .or
- "RCP" .emit OP_RCP .or "RCP_SAT" .emit OP_RCP_SAT .or
- "RSQ" .emit OP_RSQ .or "RSQ_SAT" .emit OP_RSQ_SAT .or
- "SIN" .emit OP_SIN .or "SIN_SAT" .emit OP_SIN_SAT .or
- "SCS" .emit OP_SCS .or "SCS_SAT" .emit OP_SCS_SAT;
-vp_SCALARop
- "EX2" .emit OP_EX2 .or
- "EXP" .emit OP_EXP .or
- "LG2" .emit OP_LG2 .or
- "LOG" .emit OP_LOG .or
- "RCP" .emit OP_RCP .or
- "RSQ" .emit OP_RSQ;
-
-/*
- <BINSCop_instruction> ::= <BINSCop> <maskedDstReg> "," <scalarSrcReg> ","
- <scalarSrcReg>
-*/
-fp_BINSCop_instruction
- fp_BINSCop .and space_dst .and fp_maskedDstReg .and comma .and fp_scalarSrcReg .and comma .and
- fp_scalarSrcReg;
-vp_BINSCop_instruction
- vp_BINSCop .and space_dst .and vp_maskedDstReg .and comma .and vp_scalarSrcReg .and comma .and
- vp_scalarSrcReg;
-
-/*
-fragment program
- <BINSCop> ::= "POW" | "POW_SAT"
-
-vertex program
- <BINSCop> ::= "POW"
-*/
-fp_BINSCop
- "POW" .emit OP_POW .or "POW_SAT" .emit OP_POW_SAT;
-vp_BINSCop
- "POW" .emit OP_POW;
-
-/*
-fragment program
- <BINop_instruction> ::= <BINop> <maskedDstReg> ","
- <vectorSrcReg> "," <vectorSrcReg>
-
-vertex program
- <BINop_instruction> ::= <BINop> <maskedDstReg> ","
- <swizzleSrcReg> "," <swizzleSrcReg>
-*/
-fp_BINop_instruction
- fp_BINop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg .and comma .and
- vectorSrcReg;
-vp_BINop_instruction
- vp_BINop .and space_dst .and vp_maskedDstReg .and comma .and swizzleSrcReg .and comma .and
- swizzleSrcReg;
-
-/*
-fragment program
- <BINop> ::= "ADD" | "ADD_SAT"
- | "DP3" | "DP3_SAT"
- | "DP4" | "DP4_SAT"
- | "DPH" | "DPH_SAT"
- | "DST" | "DST_SAT"
- | "MAX" | "MAX_SAT"
- | "MIN" | "MIN_SAT"
- | "MUL" | "MUL_SAT"
- | "SGE" | "SGE_SAT"
- | "SLT" | "SLT_SAT"
- | "SUB" | "SUB_SAT"
- | "XPD" | "XPD_SAT"
-
-vertex program
- <BINop> ::= "ADD"
- | "DP3"
- | "DP4"
- | "DPH"
- | "DST"
- | "MAX"
- | "MIN"
- | "MUL"
- | "SGE"
- | "SLT"
- | "SUB"
- | "XPD"
-*/
-fp_BINop
- "ADD" .emit OP_ADD .or "ADD_SAT" .emit OP_ADD_SAT .or
- "DP3" .emit OP_DP3 .or "DP3_SAT" .emit OP_DP3_SAT .or
- "DP4" .emit OP_DP4 .or "DP4_SAT" .emit OP_DP4_SAT .or
- "DPH" .emit OP_DPH .or "DPH_SAT" .emit OP_DPH_SAT .or
- "DST" .emit OP_DST .or "DST_SAT" .emit OP_DST_SAT .or
- "MAX" .emit OP_MAX .or "MAX_SAT" .emit OP_MAX_SAT .or
- "MIN" .emit OP_MIN .or "MIN_SAT" .emit OP_MIN_SAT .or
- "MUL" .emit OP_MUL .or "MUL_SAT" .emit OP_MUL_SAT .or
- "SGE" .emit OP_SGE .or "SGE_SAT" .emit OP_SGE_SAT .or
- "SLT" .emit OP_SLT .or "SLT_SAT" .emit OP_SLT_SAT .or
- "SUB" .emit OP_SUB .or "SUB_SAT" .emit OP_SUB_SAT .or
- "XPD" .emit OP_XPD .or "XPD_SAT" .emit OP_XPD_SAT;
-vp_BINop
- "ADD" .emit OP_ADD .or
- "DP3" .emit OP_DP3 .or
- "DP4" .emit OP_DP4 .or
- "DPH" .emit OP_DPH .or
- "DST" .emit OP_DST .or
- "MAX" .emit OP_MAX .or
- "MIN" .emit OP_MIN .or
- "MUL" .emit OP_MUL .or
- "SGE" .emit OP_SGE .or
- "SLT" .emit OP_SLT .or
- "SUB" .emit OP_SUB .or
- "XPD" .emit OP_XPD;
-
-/*
-fragment program
- <TRIop_instruction> ::= <TRIop> <maskedDstReg> ","
- <vectorSrcReg> "," <vectorSrcReg> ","
- <vectorSrcReg>
-
-vertex program
- <TRIop_instruction> ::= <TRIop> <maskedDstReg> ","
- <swizzleSrcReg> "," <swizzleSrcReg> ","
- <swizzleSrcReg>
-*/
-fp_TRIop_instruction
- fp_TRIop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg .and comma .and
- vectorSrcReg .and comma .and vectorSrcReg;
-vp_TRIop_instruction
- vp_TRIop .and space_dst .and vp_maskedDstReg .and comma .and swizzleSrcReg .and comma .and
- swizzleSrcReg .and comma .and swizzleSrcReg;
-
-/*
-fragment program
- <TRIop> ::= "CMP" | "CMP_SAT"
- | "LRP" | "LRP_SAT"
- | "MAD" | "MAD_SAT"
-
-vertex program
- <TRIop> ::= "MAD"
-*/
-fp_TRIop
- "CMP" .emit OP_CMP .or "CMP_SAT" .emit OP_CMP_SAT .or
- "LRP" .emit OP_LRP .or "LRP_SAT" .emit OP_LRP_SAT .or
- "MAD" .emit OP_MAD .or "MAD_SAT" .emit OP_MAD_SAT;
-vp_TRIop
- "MAD" .emit OP_MAD;
-
-/*
-fragment program
- <SWZ_instruction> ::= <SWZop> <maskedDstReg> ","
- <srcReg> "," <extendedSwizzle>
-
-vertex program
- <SWZ_instruction> ::= "SWZ" <maskedDstReg> "," <srcReg> ","
- <extendedSwizzle>
-*/
-fp_SWZ_instruction
- SWZop .and space_dst .and fp_maskedDstReg .and comma .and fp_srcReg .and comma .and
- fp_extendedSwizzle .error EXT_SWIZ_COMP_EXPECTED;
-vp_SWZ_instruction
- "SWZ" .emit OP_SWZ .and space_dst .and vp_maskedDstReg .and comma .and vp_srcReg .and comma .and
- vp_extendedSwizzle .error EXT_SWIZ_COMP_EXPECTED;
-
-/*
-fragment program
- <SWZop> ::= "SWZ" | "SWZ_SAT"
-*/
-SWZop
- "SWZ" .emit OP_SWZ .or "SWZ_SAT" .emit OP_SWZ_SAT;
-
-/*
-fragment program
- <SAMPLE_instruction> ::= <SAMPLEop> <maskedDstReg> ","
- <vectorSrcReg> "," <texImageUnit> ","
- <texTarget>
-*/
-SAMPLE_instruction
- SAMPLEop .and space_dst .and fp_maskedDstReg .and comma .and vectorSrcReg .and comma .and
- texImageUnit .and comma .and texTarget .error TEX_TARGET_EXPECTED;
-
-/*
-fragment program
- <SAMPLEop> ::= "TEX" | "TEX_SAT"
- | "TXP" | "TXP_SAT"
- | "TXB" | "TXB_SAT"
-*/
-SAMPLEop
- "TEX" .emit OP_TEX .or "TEX_SAT" .emit OP_TEX_SAT .or
- "TXB" .emit OP_TXB .or "TXB_SAT" .emit OP_TXB_SAT .or
- "TXP" .emit OP_TXP .or "TXP_SAT" .emit OP_TXP_SAT;
-
-/*
-fragment program
- <KIL_instruction> ::= "KIL" <vectorSrcReg>
-*/
-KIL_instruction
- "KIL" .emit OP_KIL .and space_src .and vectorSrcReg;
-
-/*
-fragment program
- <texImageUnit> ::= "texture" <optTexImageUnitNum>
-*/
-texImageUnit
- "texture" .error TEXTURE_EXPECTED .and optTexImageUnitNum;
-
-/*
-fragment program
- <texTarget> ::= "1D"
- | "2D"
- | "3D"
- | "CUBE"
- | "RECT"
- | <shadowTarget> (if option ARB_fragment_program_shadow present)
-*/
-texTarget
- "1D" .emit TEXTARGET_1D .or
- "2D" .emit TEXTARGET_2D .or
- "3D" .emit TEXTARGET_3D .or
- .if (texture_rectangle != 0x00) "RECT" .emit TEXTARGET_RECT .or
- "CUBE" .emit TEXTARGET_CUBE .or
- .if (ARB_fragment_program_shadow != 0x00) shadowTarget;
-
-/*
-GL_ARB_fragment_program_shadow
- <shadowTarget> ::= "SHADOW1D"
- | "SHADOW2D"
- | "SHADOWRECT"
-*/
-shadowTarget
- "SHADOW1D" .emit TEXTARGET_SHADOW1D .or
- "SHADOW2D" .emit TEXTARGET_SHADOW2D .or
- .if (texture_rectangle != 0x00) "SHADOWRECT" .emit TEXTARGET_SHADOWRECT;
-
-/*
-fragment program
- <optTexImageUnitNum> ::= ""
- | "[" <texImageUnitNum> "]"
-*/
-optTexImageUnitNum
- optTexImageUnitNum_1 .or .true .emit 0x00;
-optTexImageUnitNum_1
- lbracket_ne .and texImageUnitNum .and rbracket;
-
-/*
-fragment program
- <texImageUnitNum> ::= <integer> from 0 to
- MAX_TEXTURE_IMAGE_UNITS_ARB-1
-*/
-texImageUnitNum
- integer;
-
-/*
- <scalarSrcReg> ::= <optionalSign> <srcReg> <scalarSuffix>
-*/
-fp_scalarSrcReg
- optionalSign .and fp_srcReg .and fp_scalarSuffix;
-vp_scalarSrcReg
- optionalSign .and vp_srcReg .and vp_scalarSuffix;
-
-/*
-vertex program
- <swizzleSrcReg> ::= <optionalSign> <srcReg> <swizzleSuffix>
-*/
-swizzleSrcReg
- optionalSign .and vp_srcReg .and swizzleSuffix;
-
-/*
-fragment program
- <vectorSrcReg> ::= <optionalSign> <srcReg> <optionalSuffix>
-*/
-vectorSrcReg
- optionalSign .and fp_srcReg .and optionalSuffix;
-
-/*
- <maskedDstReg> ::= <dstReg> <optionalMask>
-*/
-fp_maskedDstReg
- fp_dstReg .and fp_optionalMask;
-vp_maskedDstReg
- vp_dstReg .and vp_optionalMask;
-
-/*
-vertex program
- <maskedAddrReg> ::= <addrReg> <addrWriteMask>
-*/
-maskedAddrReg
- addrReg .error ADDRESS_REGISTER_EXPECTED .and addrWriteMask;
-
-/*
-fragment program
- <extendedSwizzle> ::= <xyzwExtendedSwizzle>
- | <rgbaExtendedSwizzle>
-
-vertex program
- <extendedSwizzle> ::= <extSwizComp> "," <extSwizComp> ","
- <extSwizComp> "," <extSwizComp>
-
-NOTE: do NOT change the order of <rgbaExtendedSwizzle> and <xyzwExtendedSwizzle> rulez
-*/
-fp_extendedSwizzle
- rgbaExtendedSwizzle .or xyzwExtendedSwizzle;
-vp_extendedSwizzle
- extSwizComp .and comma .and
- extSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- extSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- extSwizComp .error EXT_SWIZ_COMP_EXPECTED;
-
-/*
-fragment program
- <xyzwExtendedSwizzle> ::= <xyzwExtSwizComp> "," <xyzwExtSwizComp> ","
- <xyzwExtSwizComp> "," <xyzwExtSwizComp>
-*/
-xyzwExtendedSwizzle
- xyzwExtSwizComp .and comma .and
- xyzwExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- xyzwExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- xyzwExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;
-
-/*
-fragment program
- <rgbaExtendedSwizzle> ::= <rgbaExtSwizComp> "," <rgbaExtSwizComp> ","
- <rgbaExtSwizComp> "," <rgbaExtSwizComp>
-*/
-rgbaExtendedSwizzle
- rgbaExtendedSwizzle_1 .or rgbaExtendedSwizzle_2 .or rgbaExtendedSwizzle_3 .or
- rgbaExtendedSwizzle_4;
-rgbaExtendedSwizzle_1
- rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp_digit .and comma .and
- rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp;
-rgbaExtendedSwizzle_2
- rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp_digit .and comma .and
- rgbaExtSwizComp_alpha .and comma .and rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;
-rgbaExtendedSwizzle_3
- rgbaExtSwizComp_digit .and comma .and rgbaExtSwizComp_alpha .and comma .and
- rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;
-rgbaExtendedSwizzle_4
- rgbaExtSwizComp_alpha .and comma .and
- rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED .and comma .and
- rgbaExtSwizComp .error EXT_SWIZ_COMP_EXPECTED;
-
-/*
-fragment program
- <xyzwExtSwizComp> ::= <optionalSign> <xyzwExtSwizSel>
-*/
-xyzwExtSwizComp
- optionalSign .and xyzwExtSwizSel;
-
-/*
-fragment program
- <rgbaExtSwizComp> ::= <optionalSign> <rgbaExtSwizSel>
-*/
-rgbaExtSwizComp
- optionalSign .and rgbaExtSwizSel;
-rgbaExtSwizComp_digit
- optionalSign .and rgbaExtSwizSel_digit;
-rgbaExtSwizComp_alpha
- optionalSign .and rgbaExtSwizSel_alpha;
-
-/*
-vertex program
- <extSwizComp> ::= <optionalSign> <extSwizSel>
-*/
-extSwizComp
- optionalSign .and extSwizSel;
-
-/*
-fragment program
- <xyzwExtSwizSel> ::= "0"
- | "1"
- | <xyzwComponent>
-*/
-xyzwExtSwizSel
- "0" .emit COMPONENT_0 .or "1" .emit COMPONENT_1 .or xyzwComponent_single;
-
-/*
-fragment program
- <rgbaExtSwizSel> ::= "0"
- | "1"
- | <rgbaComponent>
-*/
-rgbaExtSwizSel
- rgbaExtSwizSel_digit .or rgbaExtSwizSel_alpha;
-rgbaExtSwizSel_digit
- "0" .emit COMPONENT_0 .or "1" .emit COMPONENT_1;
-rgbaExtSwizSel_alpha
- rgbaComponent_single;
-
-/*
-vertex program
- <extSwizSel> ::= "0"
- | "1"
- | <component>
-*/
-extSwizSel
- "0" .emit COMPONENT_0 .or "1" .emit COMPONENT_1 .or vp_component_single;
-
-/*
-fragment program
- <srcReg> ::= <fragmentAttribReg>
- | <temporaryReg>
- | <progParamReg>
-
-vertex program
- <srcReg> ::= <vertexAttribReg>
- | <temporaryReg>
- | <progParamReg>
-*/
-fp_srcReg
- fp_srcReg_1 .error SOURCE_REGISTER_EXPECTED;
-vp_srcReg
- vp_srcReg_1 .error SOURCE_REGISTER_EXPECTED;
-fp_srcReg_1
- fragmentAttribReg .emit REGISTER_ATTRIB .or
- fp_progParamReg .emit REGISTER_PARAM .or
- fp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;
-vp_srcReg_1
- vertexAttribReg .emit REGISTER_ATTRIB .or
- vp_progParamReg .emit REGISTER_PARAM .or
- vp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;
-
-/*
-fragment program
- <dstReg> ::= <temporaryReg>
- | <fragmentResultReg>
-
-vertex program
- <dstReg> ::= <temporaryReg>
- | <vertexResultReg>
-*/
-fp_dstReg
- fp_dstReg_1 .error DESTINATION_REGISTER_EXPECTED;
-vp_dstReg
- vp_dstReg_1 .error DESTINATION_REGISTER_EXPECTED;
-fp_dstReg_1
- fragmentResultReg .emit REGISTER_RESULT .or
- fp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;
-vp_dstReg_1
- vertexResultReg .emit REGISTER_RESULT .or
- vp_temporaryReg .emit REGISTER_ESTABLISHED_NAME;
-
-/*
-fragment program
- <fragmentAttribReg> ::= <establishedName>
- | <fragAttribBinding>
-
-NOTE: <establishedName> is driven by <temporaryReg> rule at the end of <srcReg>
-*/
-fragmentAttribReg
- /*fp_establishedName .or */fragAttribBinding;
-
-/*
-vertex program
- <vertexAttribReg> ::= <establishedName>
- | <vtxAttribBinding>
-
-NOTE: <establishedName> is driven by <temporaryReg> rule at the end of <srcReg>
-*/
-vertexAttribReg
- vtxAttribBinding;
-
-/*
- <temporaryReg> ::= <establishedName>
-*/
-fp_temporaryReg
- fp_establishedName_no_error_on_identifier;
-vp_temporaryReg
- vp_establishedName_no_error_on_identifier;
-
-/*
-fragment program
- <progParamReg> ::= <progParamSingle>
- | <progParamArray> "[" <progParamArrayAbs> "]"
- | <paramSingleItemUse>
-
-vertex program
- <progParamReg> ::= <progParamSingle>
- | <progParamArray> "[" <progParamArrayMem> "]"
- | <paramSingleItemUse>
-*/
-fp_progParamReg
- fp_paramSingleItemUse .or fp_progParamReg_1 .or fp_progParamSingle;
-vp_progParamReg
- vp_paramSingleItemUse .or vp_progParamReg_1 .or vp_progParamSingle;
-fp_progParamReg_1
- fp_progParamArray .emit PARAM_ARRAY_ELEMENT .and lbracket_ne .and progParamArrayAbs .and
- rbracket;
-vp_progParamReg_1
- vp_progParamArray .emit PARAM_ARRAY_ELEMENT .and lbracket_ne .and progParamArrayMem .and
- rbracket;
-
-/*
- <progParamSingle> ::= <establishedName>
-
-NOTE: <establishedName> is driven by <temporaryReg> rule at the end of <srcReg>
-*/
-fp_progParamSingle
- .false;
-vp_progParamSingle
- .false;
-
-/*
- <progParamArray> ::= <establishedName>
-*/
-fp_progParamArray
- fp_establishedName_no_error_on_identifier;
-vp_progParamArray
- vp_establishedName_no_error_on_identifier;
-
-/*
-vertex program
- <progParamArrayMem> ::= <progParamArrayAbs>
- | <progParamArrayRel>
-*/
-progParamArrayMem
- progParamArrayAbs .or progParamArrayRel;
-
-/*
- <progParamArrayAbs> ::= <integer>
-*/
-progParamArrayAbs
- integer_ne .emit ARRAY_INDEX_ABSOLUTE;
-
-/*
-vertex program
- <progParamArrayRel> ::= <addrReg> <addrComponent> <addrRegRelOffset>
-*/
-progParamArrayRel
- addrReg .error ADDRESS_REGISTER_OR_INTEGER_EXPECTED .emit ARRAY_INDEX_RELATIVE .and
- addrComponent .and addrRegRelOffset;
-
-/*
-vertex program
- <addrRegRelOffset> ::= ""
- | "+" <addrRegPosOffset>
- | "-" <addrRegNegOffset>
-*/
-addrRegRelOffset
- addrRegRelOffset_1 .or addrRegRelOffset_2 .or .true .emit 0x00;
-addrRegRelOffset_1
- plus_ne .and addrRegPosOffset;
-addrRegRelOffset_2
- minus_ne .and addrRegNegOffset;
-
-/*
-vertex program
- <addrRegPosOffset> ::= <integer> from 0 to 63
-*/
-addrRegPosOffset
- integer_0_63;
-
-/*
-vertex program
- <addrRegNegOffset> ::= <integer> from 0 to 64
-*/
-addrRegNegOffset
- integer_0_64;
-
-/*
-fragment program
- <fragmentResultReg> ::= <establishedName>
- | <resultBinding>
-
-NOTE: <establishedName> is driven by <temporaryReg> rule at the end of <dstReg>
-*/
-fragmentResultReg
- fp_resultBinding;
-
-/*
-vertex program
- <vertexResultReg> ::= <establishedName>
- | <resultBinding>
-
-NOTE: <establishedName> is driven by <temporaryReg> rule at the end of <dstReg>
-*/
-vertexResultReg
- vp_resultBinding;
-
-/*
-vertex program
- <addrReg> ::= <establishedName>
-*/
-addrReg
- vp_establishedName_no_error_on_identifier;
-
-/*
-vertex program
- <addrComponent> ::= "." "x"
-*/
-addrComponent
- dot .and "x" .error INVALID_ADDRESS_COMPONENT .emit COMPONENT_X .emit COMPONENT_X
- .emit COMPONENT_X .emit COMPONENT_X;
-
-/*
-vertex program
- <addrWriteMask> ::= "." "x"
-*/
-addrWriteMask
- dot .and "x" .error INVALID_ADDRESS_WRITEMASK .emit 0x08;
-
-/*
- <scalarSuffix> ::= "." <component>
-*/
-fp_scalarSuffix
- dot .and fp_component_single .error INVALID_COMPONENT;
-vp_scalarSuffix
- dot .and vp_component_single .error INVALID_COMPONENT;
-
-/*
-vertex program
- <swizzleSuffix> ::= ""
- | "." <component>
- | "." <component> <component>
- <component> <component>
-*/
-swizzleSuffix
- swizzleSuffix_1 .or
- .true .emit COMPONENT_X .emit COMPONENT_Y .emit COMPONENT_Z .emit COMPONENT_W;
-swizzleSuffix_1
- dot_ne .and swizzleSuffix_2 .error INVALID_SUFFIX;
-swizzleSuffix_2
- swizzleSuffix_3 .or swizzleSuffix_4;
-swizzleSuffix_3
- vp_component_multi .and vp_component_multi .and vp_component_multi .error INVALID_COMPONENT .and
- vp_component_multi .error INVALID_COMPONENT;
-swizzleSuffix_4
- "x" .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .or
- "y" .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .or
- "z" .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .or
- "w" .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W;
-
-/*
-fragment program
- <optionalSuffix> ::= ""
- | "." <component>
- | "." <xyzwComponent> <xyzwComponent>
- <xyzwComponent> <xyzwComponent>
- | "." <rgbaComponent> <rgbaComponent>
- <rgbaComponent> <rgbaComponent>
-*/
-optionalSuffix
- optionalSuffix_1 .or
- .true .emit COMPONENT_X .emit COMPONENT_Y .emit COMPONENT_Z .emit COMPONENT_W;
-optionalSuffix_1
- dot_ne .and optionalSuffix_2 .error INVALID_SUFFIX;
-optionalSuffix_2
- optionalSuffix_3 .or optionalSuffix_4 .or optionalSuffix_5;
-optionalSuffix_3
- xyzwComponent_multi .and xyzwComponent_multi .and
- xyzwComponent_multi .error INVALID_COMPONENT .and xyzwComponent_multi .error INVALID_COMPONENT;
-optionalSuffix_4
- rgbaComponent_multi .and rgbaComponent_multi .and
- rgbaComponent_multi .error INVALID_COMPONENT .and rgbaComponent_multi .error INVALID_COMPONENT;
-optionalSuffix_5
- "x" .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .or
- "y" .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .or
- "z" .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .or
- "w" .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .or
- "r" .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .emit COMPONENT_X .or
- "g" .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .emit COMPONENT_Y .or
- "b" .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .emit COMPONENT_Z .or
- "a" .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W .emit COMPONENT_W;
-
-/*
-fragment program
- <component> ::= <xyzwComponent>
- | <rgbaComponent>
-
-vertex program
- <component> ::= "x"
- | "y"
- | "z"
- | "w"
-*/
-fp_component_single
- xyzwComponent_single .or rgbaComponent_single;
-vp_component_multi
- 'x' .emit COMPONENT_X .or 'y' .emit COMPONENT_Y .or 'z' .emit COMPONENT_Z .or
- 'w' .emit COMPONENT_W;
-vp_component_single
- "x" .emit COMPONENT_X .or "y" .emit COMPONENT_Y .or "z" .emit COMPONENT_Z .or
- "w" .emit COMPONENT_W;
-
-/*
-fragment program
- <xyzwComponent> ::= "x" | "y" | "z" | "w"
-*/
-xyzwComponent_multi
- 'x' .emit COMPONENT_X .or 'y' .emit COMPONENT_Y .or 'z' .emit COMPONENT_Z .or
- 'w' .emit COMPONENT_W;
-xyzwComponent_single
- "x" .emit COMPONENT_X .or "y" .emit COMPONENT_Y .or "z" .emit COMPONENT_Z .or
- "w" .emit COMPONENT_W;
-
-/*
-fragment program
- <rgbaComponent> ::= "r" | "g" | "b" | "a"
-*/
-rgbaComponent_multi
- 'r' .emit COMPONENT_X .or 'g' .emit COMPONENT_Y .or 'b' .emit COMPONENT_Z .or
- 'a' .emit COMPONENT_W;
-rgbaComponent_single
- "r" .emit COMPONENT_X .or "g" .emit COMPONENT_Y .or "b" .emit COMPONENT_Z .or
- "a" .emit COMPONENT_W;
-
-/*
-fragment program
- <optionalMask> ::= ""
- | <xyzwMask>
- | <rgbaMask>
-
-vertex program
- <optionalMask> ::= ""
- | "." "x"
- | "." "y"
- | "." "xy"
- | "." "z"
- | "." "xz"
- | "." "yz"
- | "." "xyz"
- | "." "w"
- | "." "xw"
- | "." "yw"
- | "." "xyw"
- | "." "zw"
- | "." "xzw"
- | "." "yzw"
- | "." "xyzw"
-
-NOTE: do NOT change the order of <rgbaMask> and <xyzwMask> rulez
-*/
-fp_optionalMask
- rgbaMask .or xyzwMask .or .true .emit 0x0F;
-vp_optionalMask
- xyzwMask .or .true .emit 0x0F;
-
-/*
-fragment program
- <xyzwMask> ::= "." "x"
- | "." "y"
- | "." "xy"
- | "." "z"
- | "." "xz"
- | "." "yz"
- | "." "xyz"
- | "." "w"
- | "." "xw"
- | "." "yw"
- | "." "xyw"
- | "." "zw"
- | "." "xzw"
- | "." "yzw"
- | "." "xyzw"
-
-NOTE: <xyzwMask> is also referenced by the vertex program symbol <optionalMask>.
-*/
-xyzwMask
- dot_ne .and xyzwMask_1 .error INVALID_WRITEMASK;
-xyzwMask_1
- "xyzw" .emit 0x0F .or "xyz" .emit 0x0E .or "xyw" .emit 0x0D .or "xy" .emit 0x0C .or
- "xzw" .emit 0x0B .or "xz" .emit 0x0A .or "xw" .emit 0x09 .or "x" .emit 0x08 .or
- "yzw" .emit 0x07 .or "yz" .emit 0x06 .or "yw" .emit 0x05 .or "y" .emit 0x04 .or
- "zw" .emit 0x03 .or "z" .emit 0x02 .or "w" .emit 0x01;
-
-/*
-fragment program
- <rgbaMask> ::= "." "r"
- | "." "g"
- | "." "rg"
- | "." "b"
- | "." "rb"
- | "." "gb"
- | "." "rgb"
- | "." "a"
- | "." "ra"
- | "." "ga"
- | "." "rga"
- | "." "ba"
- | "." "rba"
- | "." "gba"
- | "." "rgba"
-*/
-rgbaMask
- dot_ne .and rgbaMask_1;
-rgbaMask_1
- "rgba" .emit 0x0F .or "rgb" .emit 0x0E .or "rga" .emit 0x0D .or "rg" .emit 0x0C .or
- "rba" .emit 0x0B .or "rb" .emit 0x0A .or "ra" .emit 0x09 .or "r" .emit 0x08 .or
- "gba" .emit 0x07 .or "gb" .emit 0x06 .or "ga" .emit 0x05 .or "g" .emit 0x04 .or
- "ba" .emit 0x03 .or "b" .emit 0x02 .or "a" .emit 0x01;
-
-/*
-fragment program
- <namingStatement> ::= <ATTRIB_statement>
- | <PARAM_statement>
- | <TEMP_statement>
- | <OUTPUT_statement>
- | <ALIAS_statement>
-
-vertex program
- <namingStatement> ::= <ATTRIB_statement>
- | <PARAM_statement>
- | <TEMP_statement>
- | <ADDRESS_statement>
- | <OUTPUT_statement>
- | <ALIAS_statement>
-*/
-fp_namingStatement
- fp_ATTRIB_statement .emit ATTRIB .or
- fp_PARAM_statement .emit PARAM .or
- fp_TEMP_statement .emit TEMP .or
- fp_OUTPUT_statement .emit OUTPUT .or
- fp_ALIAS_statement .emit ALIAS;
-vp_namingStatement
- vp_ATTRIB_statement .emit ATTRIB .or
- vp_PARAM_statement .emit PARAM .or
- vp_TEMP_statement .emit TEMP .or
- ADDRESS_statement .emit ADDRESS .or
- vp_OUTPUT_statement .emit OUTPUT .or
- vp_ALIAS_statement .emit ALIAS;
-
-/*
-fragment program
- <ATTRIB_statement> ::= "ATTRIB" <establishName> "="
- <fragAttribBinding>
-
-vertex program
- <ATTRIB_statement> ::= "ATTRIB" <establishName> "="
- <vtxAttribBinding>
-*/
-fp_ATTRIB_statement
- "ATTRIB" .and space .and fp_establishName .and equal .and
- fragAttribBinding .error FRAGMENT_EXPECTED;
-vp_ATTRIB_statement
- "ATTRIB" .and space .and vp_establishName .and equal .and
- vtxAttribBinding .error VERTEX_EXPECTED;
-
-/*
-fragment program
- <fragAttribBinding> ::= "fragment" "." <fragAttribItem>
-*/
-fragAttribBinding
- "fragment" .and dot .and fragAttribItem .error INVALID_FRAGMENT_PROPERTY;
-
-/*
-vertex program
- <vtxAttribBinding> ::= "vertex" "." <vtxAttribItem>
-*/
-vtxAttribBinding
- "vertex" .and dot .and vtxAttribItem .error INVALID_VERTEX_PROPERTY;
-
-/*
-fragment program
- <fragAttribItem> ::= "color" <optColorType>
- | "texcoord" <optTexCoordNum>
- | "fogcoord"
- | "position"
-*/
-fragAttribItem
- fragAttribItem_1 .emit FRAGMENT_ATTRIB_COLOR .or
- fragAttribItem_2 .emit FRAGMENT_ATTRIB_TEXCOORD .or
- .if (fog_coord != 0x00) "fogcoord" .emit FRAGMENT_ATTRIB_FOGCOORD .or
- "position" .emit FRAGMENT_ATTRIB_POSITION;
-fragAttribItem_1
- "color" .and optColorType;
-fragAttribItem_2
- "texcoord" .and optTexCoordNum;
-
-/*
-vertex program
- <vtxAttribItem> ::= "position"
- | "weight" <vtxOptWeightNum>
- | "normal"
- | "color" <optColorType>
- | "fogcoord"
- | "texcoord" <optTexCoordNum>
- | "matrixindex" "[" <vtxWeightNum> "]"
- | "attrib" "[" <vtxAttribNum> "]"
-*/
-vtxAttribItem
- "position" .emit VERTEX_ATTRIB_POSITION .or
- .if (vertex_blend != 0x00) vtxAttribItem_1 .emit VERTEX_ATTRIB_WEIGHT .or
- "normal" .emit VERTEX_ATTRIB_NORMAL .or
- vtxAttribItem_2 .emit VERTEX_ATTRIB_COLOR .or
- "fogcoord" .emit VERTEX_ATTRIB_FOGCOORD .or
- vtxAttribItem_3 .emit VERTEX_ATTRIB_TEXCOORD .or
- .if (matrix_palette != 0x00) vtxAttribItem_4 .emit VERTEX_ATTRIB_MATRIXINDEX .or
- vtxAttribItem_5 .emit VERTEX_ATTRIB_GENERIC;
-vtxAttribItem_1
- "weight" .and vtxOptWeightNum;
-vtxAttribItem_2
- "color" .and optColorType;
-vtxAttribItem_3
- "texcoord" .and optTexCoordNum;
-vtxAttribItem_4
- "matrixindex" .and lbracket .and vtxWeightNum .and rbracket;
-vtxAttribItem_5
- "attrib" .and lbracket .and vtxAttribNum .and rbracket;
-
-/*
-vertex program
- <vtxAttribNum> ::= <integer> from 0 to MAX_VERTEX_ATTRIBS_ARB-1
-*/
-vtxAttribNum
- integer;
-
-/*
-vertex program
- <vtxOptWeightNum> ::= ""
- | "[" <vtxWeightNum> "]"
-*/
-vtxOptWeightNum
- vtxOptWeightNum_1 .or .true .emit 0x00;
-vtxOptWeightNum_1
- lbracket_ne .and vtxWeightNum .and rbracket;
-
-/*
-vertex program
- <vtxWeightNum> ::= <integer> from 0 to MAX_VERTEX_UNITS_ARB-1,
- must be divisible by four
-*/
-vtxWeightNum
- integer;
-
-/*
- <PARAM_statement> ::= <PARAM_singleStmt>
- | <PARAM_multipleStmt>
-*/
-fp_PARAM_statement
- fp_PARAM_multipleStmt .or fp_PARAM_singleStmt;
-vp_PARAM_statement
- vp_PARAM_multipleStmt .or vp_PARAM_singleStmt;
-
-/*
- <PARAM_singleStmt> ::= "PARAM" <establishName> <paramSingleInit>
-*/
-fp_PARAM_singleStmt
- "PARAM" .and space .and fp_establishName .and .true .emit 0x00 .and fp_paramSingleInit .and
- .true .emit PARAM_NULL;
-vp_PARAM_singleStmt
- "PARAM" .and space .and vp_establishName .and .true .emit 0x00 .and vp_paramSingleInit .and
- .true .emit PARAM_NULL;
-
-/*
- <PARAM_multipleStmt> ::= "PARAM" <establishName> "[" <optArraySize> "]"
- <paramMultipleInit>
-*/
-fp_PARAM_multipleStmt
- "PARAM" .and space .and fp_establishName .and lbracket_ne .and optArraySize .and rbracket .and
- fp_paramMultipleInit .and .true .emit PARAM_NULL;
-vp_PARAM_multipleStmt
- "PARAM" .and space .and vp_establishName .and lbracket_ne .and optArraySize .and rbracket .and
- vp_paramMultipleInit .and .true .emit PARAM_NULL;
-
-/*
- <optArraySize> ::= ""
- | <integer> from 1 to MAX_PROGRAM_PARAMETERS_ARB
- (maximum number of allowed program
- parameter bindings)
-*/
-optArraySize
- optional_integer;
-
-/*
- <paramSingleInit> ::= "=" <paramSingleItemDecl>
-*/
-fp_paramSingleInit
- equal .and fp_paramSingleItemDecl;
-vp_paramSingleInit
- equal .and vp_paramSingleItemDecl;
-
-/*
- <paramMultipleInit> ::= "=" "{" <paramMultInitList> "}"
-*/
-fp_paramMultipleInit
- equal .and lbrace .and fp_paramMultInitList .and rbrace;
-vp_paramMultipleInit
- equal .and lbrace .and vp_paramMultInitList .and rbrace;
-
-/*
- <paramMultInitList> ::= <paramMultipleItem>
- | <paramMultipleItem> "," <paramMultiInitList>
-*/
-fp_paramMultInitList
- fp_paramMultInitList_1 .or fp_paramMultipleItem;
-vp_paramMultInitList
- vp_paramMultInitList_1 .or vp_paramMultipleItem;
-fp_paramMultInitList_1
- fp_paramMultipleItem .and comma_ne .and fp_paramMultInitList;
-vp_paramMultInitList_1
- vp_paramMultipleItem .and comma_ne .and vp_paramMultInitList;
-
-/*
- <paramSingleItemDecl> ::= <stateSingleItem>
- | <programSingleItem>
- | <paramConstDecl>
-*/
-fp_paramSingleItemDecl
- fp_stateSingleItem .emit PARAM_STATE_ELEMENT .or
- programSingleItem .emit PARAM_PROGRAM_ELEMENT .or
- paramConstDecl .emit PARAM_CONSTANT;
-vp_paramSingleItemDecl
- vp_stateSingleItem .emit PARAM_STATE_ELEMENT .or
- programSingleItem .emit PARAM_PROGRAM_ELEMENT .or
- paramConstDecl .emit PARAM_CONSTANT;
-
-/*
- <paramSingleItemUse> ::= <stateSingleItem>
- | <programSingleItem>
- | <paramConstUse>
-*/
-fp_paramSingleItemUse
- fp_stateSingleItem .emit PARAM_STATE_ELEMENT .or
- programSingleItem .emit PARAM_PROGRAM_ELEMENT .or
- paramConstUse .emit PARAM_CONSTANT;
-vp_paramSingleItemUse
- vp_stateSingleItem .emit PARAM_STATE_ELEMENT .or
- programSingleItem .emit PARAM_PROGRAM_ELEMENT .or
- paramConstUse .emit PARAM_CONSTANT;
-
-/*
- <paramMultipleItem> ::= <stateMultipleItem>
- | <programMultipleItem>
- | <paramConstDecl>
-*/
-fp_paramMultipleItem
- fp_stateMultipleItem .emit PARAM_STATE_ELEMENT .or
- programMultipleItem .emit PARAM_PROGRAM_ELEMENT .or
- paramConstDecl .emit PARAM_CONSTANT;
-vp_paramMultipleItem
- vp_stateMultipleItem .emit PARAM_STATE_ELEMENT .or
- programMultipleItem .emit PARAM_PROGRAM_ELEMENT .or
- paramConstDecl .emit PARAM_CONSTANT;
-
-/*
- <stateMultipleItem> ::= <stateSingleItem>
- | "state" "." <stateMatrixRows>
-*/
-fp_stateMultipleItem
- stateMultipleItem_1 .or fp_stateSingleItem;
-vp_stateMultipleItem
- stateMultipleItem_1 .or vp_stateSingleItem;
-stateMultipleItem_1
- "state" .and dot .and stateMatrixRows .emit STATE_MATRIX_ROWS;
-
-/*
-fragment program
- <stateSingleItem> ::= "state" "." <stateMaterialItem>
- | "state" "." <stateLightItem>
- | "state" "." <stateLightModelItem>
- | "state" "." <stateLightProdItem>
- | "state" "." <stateTexEnvItem>
- | "state" "." <stateFogItem>
- | "state" "." <stateDepthItem>
- | "state" "." <stateMatrixRow>
-
-vertex program
- <stateSingleItem> ::= "state" "." <stateMaterialItem>
- | "state" "." <stateLightItem>
- | "state" "." <stateLightModelItem>
- | "state" "." <stateLightProdItem>
- | "state" "." <stateTexGenItem>
- | "state" "." <stateFogItem>
- | "state" "." <stateClipPlaneItem>
- | "state" "." <statePointItem>
- | "state" "." <stateMatrixRow>
-*/
-fp_stateSingleItem
- "state" .and dot .and fp_stateSingleItem_1 .error INVALID_STATE_PROPERTY;
-vp_stateSingleItem
- "state" .and dot .and vp_stateSingleItem_1 .error INVALID_STATE_PROPERTY;
-fp_stateSingleItem_1
- stateSingleItem_1 .or stateSingleItem_2 .or stateSingleItem_3 .or stateSingleItem_4 .or
- stateSingleItem_5 .or stateSingleItem_7 .or stateSingleItem_8 .or stateSingleItem_11;
-vp_stateSingleItem_1
- stateSingleItem_1 .or stateSingleItem_2 .or stateSingleItem_3 .or stateSingleItem_4 .or
- stateSingleItem_6 .or stateSingleItem_7 .or stateSingleItem_9 .or stateSingleItem_10 .or
- stateSingleItem_11;
-stateSingleItem_1
- stateMaterialItem .emit STATE_MATERIAL;
-stateSingleItem_2
- stateLightItem .emit STATE_LIGHT;
-stateSingleItem_3
- stateLightModelItem .emit STATE_LIGHT_MODEL;
-stateSingleItem_4
- stateLightProdItem .emit STATE_LIGHT_PROD;
-stateSingleItem_5
- stateTexEnvItem .emit STATE_TEX_ENV;
-stateSingleItem_6
- stateTexGenItem .emit STATE_TEX_GEN;
-stateSingleItem_7
- stateFogItem .emit STATE_FOG;
-stateSingleItem_8
- stateDepthItem .emit STATE_DEPTH;
-stateSingleItem_9
- stateClipPlaneItem .emit STATE_CLIP_PLANE;
-stateSingleItem_10
- statePointItem .emit STATE_POINT;
-stateSingleItem_11
- stateMatrixRow .emit STATE_MATRIX_ROWS;
-
-/*
- <stateMaterialItem> ::= "material" <optFaceType> "." <stateMatProperty>
-*/
-stateMaterialItem
- "material" .and optFaceType .and dot .and stateMatProperty .error INVALID_MATERIAL_PROPERTY;
-
-/*
- <stateMatProperty> ::= "ambient"
- | "diffuse"
- | "specular"
- | "emission"
- | "shininess"
-*/
-stateMatProperty
- "ambient" .emit MATERIAL_AMBIENT .or
- "diffuse" .emit MATERIAL_DIFFUSE .or
- "specular" .emit MATERIAL_SPECULAR .or
- "emission" .emit MATERIAL_EMISSION .or
- "shininess" .emit MATERIAL_SHININESS;
-
-/*
- <stateLightItem> ::= "light" "[" <stateLightNumber> "]" "."
- <stateLightProperty>
-*/
-stateLightItem
- "light" .and lbracket .and stateLightNumber .and rbracket .and dot .and
- stateLightProperty .error INVALID_LIGHT_PROPERTY;
-
-/*
- <stateLightProperty> ::= "ambient"
- | "diffuse"
- | "specular"
- | "position"
- | "attenuation"
- | "spot" "." <stateSpotProperty>
- | "half"
-*/
-stateLightProperty
- "ambient" .emit LIGHT_AMBIENT .or
- "diffuse" .emit LIGHT_DIFFUSE .or
- "specular" .emit LIGHT_SPECULAR .or
- "position" .emit LIGHT_POSITION .or
- "attenuation" .emit LIGHT_ATTENUATION .or
- stateLightProperty_1 .emit LIGHT_SPOT_DIRECTION .or
- "half" .emit LIGHT_HALF;
-stateLightProperty_1
- "spot" .and dot .and stateSpotProperty .error INVALID_SPOT_PROPERTY;
-
-/*
- <stateSpotProperty> ::= "direction"
-*/
-stateSpotProperty
- "direction";
-
-/*
- <stateLightModelItem> ::= "lightmodel" <stateLModProperty>
-*/
-stateLightModelItem
- "lightmodel" .and stateLModProperty .error INVALID_LIGHTMODEL_PROPERTY;
-
-/*
- <stateLModProperty> ::= "." "ambient"
- | <optFaceType> "." "scenecolor"
-*/
-stateLModProperty
- stateLModProperty_1 .or stateLModProperty_2;
-stateLModProperty_1
- dot .and "ambient" .emit LIGHT_MODEL_AMBIENT;
-stateLModProperty_2
- stateLModProperty_3 .emit LIGHT_MODEL_SCENECOLOR;
-stateLModProperty_3
- optFaceType .and dot .and "scenecolor";
-
-/*
- <stateLightProdItem> ::= "lightprod" "[" <stateLightNumber> "]"
- <optFaceType> "." <stateLProdProperty>
-*/
-stateLightProdItem
- "lightprod" .and lbracket .and stateLightNumber .and rbracket .and optFaceType .and dot .and
- stateLProdProperty .error INVALID_LIGHTPROD_PROPERTY;
-
-/*
- <stateLProdProperty> ::= "ambient"
- | "diffuse"
- | "specular"
-*/
-stateLProdProperty
- "ambient" .emit LIGHT_PROD_AMBIENT .or
- "diffuse" .emit LIGHT_PROD_DIFFUSE .or
- "specular" .emit LIGHT_PROD_SPECULAR;
-
-/*
- <stateLightNumber> ::= <integer> from 0 to MAX_LIGHTS-1
-*/
-stateLightNumber
- integer;
-
-/*
-fragment program
- <stateTexEnvItem> ::= "texenv" <optLegacyTexUnitNum> "."
- <stateTexEnvProperty>
-*/
-stateTexEnvItem
- "texenv" .and optLegacyTexUnitNum .and dot .and
- stateTexEnvProperty .error INVALID_TEXENV_PROPERTY;
-
-/*
-fragment program
- <stateTexEnvProperty> ::= "color"
-*/
-stateTexEnvProperty
- "color" .emit TEX_ENV_COLOR;
-
-/*
-fragment program
- <optLegacyTexUnitNum> ::= ""
- | "[" <legacyTexUnitNum> "]"
-
-NOTE: <optLegaceTexUnitNum> is not optional.
-*/
-optLegacyTexUnitNum
- lbracket_ne .and legacyTexUnitNum .and rbracket;
-
-/*
-fragment program
- <legacyTexUnitNum> ::= <integer> from 0 to MAX_TEXTURE_UNITS-1
-*/
-legacyTexUnitNum
- integer;
-
-/*
-vertex program
- <stateTexGenItem> ::= "texgen" <optTexCoordNum> "."
- <stateTexGenType> "." <stateTexGenCoord>
-*/
-stateTexGenItem
- "texgen" .and optTexCoordNum .and dot .and stateTexGenType .error INVALID_TEXGEN_PROPERTY .and
- dot .and stateTexGenCoord .error INVALID_TEXGEN_COORD;
-
-/*
-vertex program
- <stateTexGenType> ::= "eye"
- | "object"
-*/
-stateTexGenType
- "eye" .emit TEX_GEN_EYE .or
- "object" .emit TEX_GEN_OBJECT;
-
-/*
-vertex program
- <stateTexGenCoord> ::= "s"
- | "t"
- | "r"
- | "q"
-*/
-stateTexGenCoord
- "s" .emit COMPONENT_X .or
- "t" .emit COMPONENT_Y .or
- "r" .emit COMPONENT_Z .or
- "q" .emit COMPONENT_W;
-
-/*
- <stateFogItem> ::= "fog" "." <stateFogProperty>
-*/
-stateFogItem
- "fog" .and dot .and stateFogProperty .error INVALID_FOG_PROPERTY;
-
-/*
- <stateFogProperty> ::= "color"
- | "params"
-*/
-stateFogProperty
- "color" .emit FOG_COLOR .or
- "params" .emit FOG_PARAMS;
-
-/*
-fragment program
- <stateDepthItem> ::= "depth" "." <stateDepthProperty>
-*/
-stateDepthItem
- "depth" .and dot .and stateDepthProperty .error INVALID_DEPTH_PROPERTY;
-
-/*
-fragment program
- <stateDepthProperty> ::= "range"
-*/
-stateDepthProperty
- "range" .emit DEPTH_RANGE;
-
-/*
-vertex program
- <stateClipPlaneItem> ::= "clip" "[" <stateClipPlaneNum> "]" "." "plane"
-*/
-stateClipPlaneItem
- "clip" .and lbracket .and stateClipPlaneNum .and rbracket .and dot .and
- "plane" .error INVALID_CLIPPLANE_PROPERTY;
-
-/*
-vertex program
- <stateClipPlaneNum> ::= <integer> from 0 to MAX_CLIP_PLANES-1
-*/
-stateClipPlaneNum
- integer;
-
-/*
-vertex program
- <statePointItem> ::= "point" "." <statePointProperty>
-*/
-statePointItem
- "point" .and dot .and statePointProperty .error INVALID_POINT_PROPERTY;
-
-/*
-vertex program
- <statePointProperty> ::= "size"
- | "attenuation"
-*/
-statePointProperty
- "size" .emit POINT_SIZE .or
- .if (point_parameters != 0x00) "attenuation" .emit POINT_ATTENUATION;
-
-/*
- <stateMatrixRow> ::= <stateMatrixItem> "." "row" "["
- <stateMatrixRowNum> "]"
-*/
-stateMatrixRow
- stateMatrixItem .and dot .and "row" .error MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED .and
- lbracket .and stateMatrixRowNum .and rbracket .emit 0x0;
-
-/*
- <stateMatrixRows> ::= <stateMatrixItem> <optMatrixRows>
-*/
-stateMatrixRows
- stateMatrixItem .and optMatrixRows;
-
-/*
- <optMatrixRows> ::= ""
- | "." "row" "[" <stateMatrixRowNum> ".."
- <stateMatrixRowNum> "]"
-*/
-optMatrixRows
- optMatrixRows_1 .or .true .emit 0x0 .emit '3' .emit 0x0 .emit $;
-optMatrixRows_1
- dot_ne .and "row" .error MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED .and lbracket .and
- stateMatrixRowNum .and dotdot .and stateMatrixRowNum .and rbracket;
-
-/*
- <stateMatrixItem> ::= "matrix" "." <stateMatrixName>
- <stateOptMatModifier>
-*/
-stateMatrixItem
- "matrix" .and dot .and stateMatrixName .error INVALID_MATRIX_NAME .and stateOptMatModifier;
-
-/*
- <stateOptMatModifier> ::= ""
- | "." <stateMatModifier>
-*/
-stateOptMatModifier
- stateOptMatModifier_1 .or .true .emit MATRIX_MODIFIER_IDENTITY;
-stateOptMatModifier_1
- dot_ne .and stateMatModifier;
-
-/*
- <stateMatModifier> ::= "inverse"
- | "transpose"
- | "invtrans"
-*/
-stateMatModifier
- "inverse" .emit MATRIX_MODIFIER_INVERSE .or
- "transpose" .emit MATRIX_MODIFIER_TRANSPOSE .or
- "invtrans" .emit MATRIX_MODIFIER_INVTRANS;
-
-/*
- <stateMatrixRowNum> ::= <integer> from 0 to 3
-*/
-stateMatrixRowNum
- integer_0_3;
-
-/*
- <stateMatrixName> ::= "modelview" <stateOptModMatNum>
- | "projection"
- | "mvp"
- | "texture" <optTexCoordNum>
- | "palette" "[" <statePaletteMatNum> "]"
- | "program" "[" <stateProgramMatNum> "]"
-*/
-stateMatrixName
- stateMatrixName_1_1 .emit MATRIX_MODELVIEW .or
- "projection" .emit MATRIX_PROJECTION .or
- "mvp" .emit MATRIX_MVP .or
- stateMatrixName_1_2 .emit MATRIX_TEXTURE .or
- .if (matrix_palette != 0x00) stateMatrixName_1_3 .emit MATRIX_PALETTE .or
- stateMatrixName_1_4 .emit MATRIX_PROGRAM;
-stateMatrixName_1_1
- "modelview" .and stateOptModMatNum;
-stateMatrixName_1_2
- "texture" .and optTexCoordNum;
-stateMatrixName_1_3
- "palette" .and lbracket .and statePaletteMatNum .and rbracket;
-stateMatrixName_1_4
- "program" .and lbracket .and stateProgramMatNum .and rbracket;
-
-/*
- <stateOptModMatNum> ::= ""
- | "[" <stateModMatNum> "]"
-*/
-stateOptModMatNum
- .if (vertex_blend != 0x00) stateOptModMatNum_1 .or
- .true .emit 0x00;
-stateOptModMatNum_1
- lbracket_ne .and stateModMatNum .and rbracket;
-
-/*
- <stateModMatNum> ::= <integer> from 0 to MAX_VERTEX_UNITS_ARB-1
-*/
-stateModMatNum
- integer;
-
-/*
- <optTexCoordNum> ::= ""
- | "[" <texCoordNum> "]"
-*/
-optTexCoordNum
- optTexCoordNum_1 .or .true .emit 0x00;
-optTexCoordNum_1
- lbracket_ne .and texCoordNum .and rbracket;
-
-/*
- <texCoordNum> ::= <integer> from 0 to MAX_TEXTURE_COORDS_ARB-1
-*/
-texCoordNum
- integer;
-
-/*
- <statePaletteMatNum> ::= <integer> from 0 to MAX_PALETTE_MATRICES_ARB-1
-*/
-statePaletteMatNum
- integer;
-
-/*
- <stateProgramMatNum> ::= <integer> from 0 to MAX_PROGRAM_MATRICES_ARB-1
-*/
-stateProgramMatNum
- integer;
-
-/*
- <programSingleItem> ::= <progEnvParam>
- | <progLocalParam>
-
-NOTE: <programSingleItem> has been modified for correct error handling. If program property
- is neither "env" nor "local" INVALID_PROGRAM_PROPERTY is generated.
-*/
-programSingleItem
- "program" .and dot .and programSingleItem_1 .error INVALID_PROGRAM_PROPERTY;
-programSingleItem_1
- progEnvParam .or progLocalParam;
-
-/*
- <programMultipleItem> ::= <progEnvParams>
- | <progLocalParams>
-
-NOTE: <programMultipleItem> has been modified for correct error handling. If program property
- is neither "env" nor "local" INVALID_PROGRAM_PROPERTY is generated.
-*/
-programMultipleItem
- "program" .and dot .and programMultipleItem_1 .error INVALID_PROGRAM_PROPERTY;
-programMultipleItem_1
- progEnvParams .or progLocalParams;
-
-/*
- <progEnvParams> ::= "program" "." "env"
- "[" <progEnvParamNums> "]"
-
-NOTE: "program" "." has been moved to <programMultipleItem>.
-*/
-progEnvParams
- "env" .emit PROGRAM_PARAM_ENV .and lbracket .and progEnvParamNums .and rbracket;
-
-/*
- <progEnvParamNums> ::= <progEnvParamNum>
- | <progEnvParamNum> ".." <progEnvParamNum>
-*/
-progEnvParamNums
- progEnvParamNums_1 .or progEnvParamNums_2;
-progEnvParamNums_1
- progEnvParamNum .and dotdot_ne .and progEnvParamNum;
-progEnvParamNums_2
- progEnvParamNum .and .true .emit 0x00;
-
-/*
- <progEnvParam> ::= "program" "." "env"
- "[" <progEnvParamNum> "]"
-
-NOTE: "program" "." has been moved to <programSingleItem>.
-*/
-progEnvParam
- "env" .emit PROGRAM_PARAM_ENV .and lbracket .and progEnvParamNum .and rbracket .emit 0x00;
-
-/*
- <progLocalParams> ::= "program" "." "local"
- "[" <progLocalParamNums> "]"
-
-NOTE: "program" "." has been moved to <programMultipleItem>.
-*/
-progLocalParams
- "local" .emit PROGRAM_PARAM_LOCAL .and lbracket .and progLocalParamNums .and rbracket;
-
-/*
- <progLocalParamNums> ::= <progLocalParamNum>
- | <progLocalParamNum> ".." <progLocalParamNum>
-*/
-progLocalParamNums
- progLocalParamNums_1 .or progLocalParamNums_2;
-progLocalParamNums_1
- progLocalParamNum .and dotdot_ne .and progLocalParamNum;
-progLocalParamNums_2
- progLocalParamNum .and .true .emit 0x00;
-
-/*
- <progLocalParam> ::= "program" "." "local"
- "[" <progLocalParamNum> "]"
-
-NOTE: "program" "." has been moved to <programSingleItem>.
-*/
-progLocalParam
- "local" .emit PROGRAM_PARAM_LOCAL .and lbracket .and progLocalParamNum .and rbracket .emit 0x00;
-
-/*
- <progEnvParamNum> ::= <integer> from 0 to
- MAX_PROGRAM_ENV_PARAMETERS_ARB - 1
-*/
-progEnvParamNum
- integer;
-
-/*
- <progLocalParamNum> ::= <integer> from 0 to
- MAX_PROGRAM_LOCAL_PARAMETERS_ARB - 1
-*/
-progLocalParamNum
- integer;
-
-/*
- <paramConstDecl> ::= <paramConstScalarDecl>
- | <paramConstVector>
-*/
-paramConstDecl
- paramConstScalarDecl .emit CONSTANT_SCALAR .or paramConstVector .emit CONSTANT_VECTOR;
-
-/*
- <paramConstUse> ::= <paramConstScalarUse>
- | <paramConstVector>
-*/
-paramConstUse
- paramConstScalarUse .emit CONSTANT_SCALAR .or paramConstVector .emit CONSTANT_VECTOR;
-
-/*
- <paramConstScalarDecl> ::= <signedFloatConstant>
-*/
-paramConstScalarDecl
- signedFloatConstant;
-
-/*
- <paramConstScalarUse> ::= <floatConstant>
-*/
-paramConstScalarUse
- floatConstant;
-
-/*
- <paramConstVector> ::= "{" <signedFloatConstant> "}"
- | "{" <signedFloatConstant> ","
- <signedFloatConstant> "}"
- | "{" <signedFloatConstant> ","
- <signedFloatConstant> ","
- <signedFloatConstant> "}"
- | "{" <signedFloatConstant> ","
- <signedFloatConstant> ","
- <signedFloatConstant> ","
- <signedFloatConstant> "}"
-*/
-paramConstVector
- paramConstVector_4 .emit 0x04 .or paramConstVector_3 .emit 0x03 .or
- paramConstVector_2 .emit 0x02 .or paramConstVector_1 .emit 0x01;
-paramConstVector_1
- lbrace_ne .and signedFloatConstant .and rbrace;
-paramConstVector_2
- lbrace_ne .and signedFloatConstant .and comma_ne .and signedFloatConstant .and rbrace;
-paramConstVector_3
- lbrace_ne .and signedFloatConstant .and comma_ne .and signedFloatConstant .and comma_ne .and
- signedFloatConstant .and rbrace;
-paramConstVector_4
- lbrace_ne .and signedFloatConstant .and comma_ne .and signedFloatConstant .and comma_ne .and
- signedFloatConstant .and comma_ne .and signedFloatConstant .and rbrace;
-
-/*
- <signedFloatConstant> ::= <optionalSign> <floatConstant>
-*/
-signedFloatConstant
- optionalSign .and floatConstant;
-
-/*
- <floatConstant> ::= see text
- The <floatConstant> rule matches a floating-point constant consisting
- of an integer part, a decimal point, a fraction part, an "e" or
- "E", and an optionally signed integer exponent. The integer and
- fraction parts both consist of a sequence of one or more digits ("0"
- through "9"). Either the integer part or the fraction parts (not
- both) may be missing; either the decimal point or the "e" (or "E")
- and the exponent (not both) may be missing.
-*/
-floatConstant
- float;
-
-/*
- <optionalSign> ::= ""
- | "-"
- | "+"
-*/
-optionalSign
- optional_sign_ne;
-
-/*
- <TEMP_statement> ::= "TEMP" <varNameList>
-*/
-fp_TEMP_statement
- "TEMP" .and space .and fp_varNameList .and .true .emit 0x00;
-vp_TEMP_statement
- "TEMP" .and space .and vp_varNameList .and .true .emit 0x00;
-
-/*
-vertex program
- <ADDRESS_statement> ::= "ADDRESS" <varNameList>
-*/
-ADDRESS_statement
- "ADDRESS" .and space .and vp_varNameList .and .true .emit 0x00;
-
-/*
- <varNameList> ::= <establishName>
- | <establishName> "," <varNameList>
-*/
-fp_varNameList
- fp_varNameList_1 .or fp_establishName;
-vp_varNameList
- vp_varNameList_1 .or vp_establishName;
-fp_varNameList_1
- fp_establishName .and comma_ne .and fp_varNameList;
-vp_varNameList_1
- vp_establishName .and comma_ne .and vp_varNameList;
-
-/*
- <OUTPUT_statement> ::= "OUTPUT" <establishName> "="
- <resultBinding>
-*/
-fp_OUTPUT_statement
- "OUTPUT" .and space .and fp_establishName .and equal .and
- fp_resultBinding .error RESULT_EXPECTED;
-vp_OUTPUT_statement
- "OUTPUT" .and space .and vp_establishName .and equal .and
- vp_resultBinding .error RESULT_EXPECTED;
-
-/*
-fragment program
- <resultBinding> ::= "result" "." "color"
- | "result" "." "color" <optOutputColorNum> (if option ARB_draw_buffers present)
- | "result" "." "depth"
-
-vertex program
- <resultBinding> ::= "result" "." "position"
- | "result" "." <resultColBinding>
- | "result" "." "fogcoord"
- | "result" "." "pointsize"
- | "result" "." "texcoord" <optTexCoordNum>
-*/
-fp_resultBinding
- "result" .and dot .and fp_resultBinding_1 .error INVALID_RESULT_PROPERTY;
-vp_resultBinding
- "result" .and dot .and vp_resultBinding_1 .error INVALID_RESULT_PROPERTY;
-fp_resultBinding_1
- fp_resultBinding_2 .emit FRAGMENT_RESULT_COLOR .or
- "depth" .emit FRAGMENT_RESULT_DEPTH;
-fp_resultBinding_2
- "color" .and optOutputColorNum;
-vp_resultBinding_1
- .if (ARB_position_invariant == 0x00) "position" .emit VERTEX_RESULT_POSITION .or
- resultColBinding .emit VERTEX_RESULT_COLOR .or
- "fogcoord" .emit VERTEX_RESULT_FOGCOORD .or
- "pointsize" .emit VERTEX_RESULT_POINTSIZE .or
- vp_resultBinding_2 .emit VERTEX_RESULT_TEXCOORD;
-vp_resultBinding_2
- "texcoord" .and optTexCoordNum;
-
-/*
-GL_ARB_draw_buffers
- <optOutputColorNum> ::= ""
- | "[" <outputColorNum> "]"
-*/
-optOutputColorNum
- .if (ARB_draw_buffers != 0x00) optOutputColorNum_1 .or .true .emit 0x00;
-optOutputColorNum_1
- lbracket_ne .and outputColorNum .and rbracket;
-
-/*
-GL_ARB_draw_buffers
- <outputColorNum> ::= <integer> from 0 to MAX_DRAW_BUFFERS_ARB-1
-*/
-outputColorNum
- integer;
-
-/*
-vertex program
- <resultColBinding> ::= "color" <optFaceType> <optColorType>
-*/
-resultColBinding
- "color" .and optFaceType .and optColorType;
-
-/*
- <optFaceType> ::= ""
- | "." "front"
- | "." "back"
-*/
-optFaceType
- FaceType .or .true .emit FACE_FRONT;
-FaceType
- dot_ne .and FaceProperty;
-FaceProperty
- "front" .emit FACE_FRONT .or "back" .emit FACE_BACK;
-
-/*
- <optColorType> ::= ""
- | "." "primary"
- | "." "secondary"
-*/
-optColorType
- ColorType .or .true .emit COLOR_PRIMARY;
-ColorType
- dot_ne .and ColorProperty;
-ColorProperty
- "primary" .emit COLOR_PRIMARY .or
- .if (secondary_color != 0x00) "secondary" .emit COLOR_SECONDARY;
-
-/*
- <ALIAS_statement> ::= "ALIAS" <establishName> "="
- <establishedName>
-*/
-fp_ALIAS_statement
- "ALIAS" .and fp_ALIAS_statement_1 .error IDENTIFIER_EXPECTED .and equal .and fp_establishedName;
-vp_ALIAS_statement
- "ALIAS" .and vp_ALIAS_statement_1 .error IDENTIFIER_EXPECTED .and equal .and vp_establishedName;
-fp_ALIAS_statement_1
- space .and fp_establishName;
-vp_ALIAS_statement_1
- space .and vp_establishName;
-
-/*
- <establishName> ::= <identifier>
-*/
-fp_establishName
- fp_identifier;
-vp_establishName
- vp_identifier;
-
-/*
- <establishedName> ::= <identifier>
-*/
-fp_establishedName
- fp_identifier;
-vp_establishedName
- vp_identifier;
-fp_establishedName_no_error_on_identifier
- fp_identifier_ne;
-vp_establishedName_no_error_on_identifier
- vp_identifier_ne;
-
-/*
-fragment program
- <identifier> ::= see text
- The <identifier> rule matches a sequence of one or more letters ("A"
- through "Z", "a" through "z"), digits ("0" through "9), underscores
- ("_"), or dollar signs ("$"); the first character must not be a
- number. Upper and lower case letters are considered different
- (names are case-sensitive). The following strings are reserved
- keywords and may not be used as identifiers:
-
- ABS, ABS_SAT, ADD, ADD_SAT, ALIAS, ATTRIB, CMP, CMP_SAT, COS,
- COS_SAT, DP3, DP3_SAT, DP4, DP4_SAT, DPH, DPH_SAT, DST, DST_SAT,
- END, EX2, EX2_SAT, FLR, FLR_SAT, FRC, FRC_SAT, KIL, LG2,
- LG2_SAT, LIT, LIT_SAT, LRP, LRP_SAT, MAD, MAD_SAT, MAX, MAX_SAT,
- MIN, MIN_SAT, MOV, MOV_SAT, MUL, MUL_SAT, OPTION, OUTPUT, PARAM,
- POW, POW_SAT, RCP, RCP_SAT, RSQ, RSQ_SAT, SIN, SIN_SAT, SCS,
- SCS_SAT, SGE, SGE_SAT, SLT, SLT_SAT, SUB, SUB_SAT, SWZ, SWZ_SAT,
- TEMP, TEX, TEX_SAT, TXB, TXB_SAT, TXP, TXP_SAT, XPD, XPD_SAT,
- fragment, program, result, state, and texture.
-
-vertex program
- <identifier> ::= see text
- The <identifier> rule matches a sequence of one or more letters ("A"
- through "Z", "a" through "z"), digits ("0" through "9), underscores ("_"),
- or dollar signs ("$"); the first character must not be a number. Upper
- and lower case letters are considered different (names are
- case-sensitive). The following strings are reserved keywords and may not
- be used as identifiers:
-
- ABS, ADD, ADDRESS, ALIAS, ARL, ATTRIB, DP3, DP4, DPH, DST, END, EX2,
- EXP, FLR, FRC, LG2, LIT, LOG, MAD, MAX, MIN, MOV, MUL, OPTION, OUTPUT,
- PARAM, POW, RCP, RSQ, SGE, SLT, SUB, SWZ, TEMP, XPD, program, result,
- state, and vertex.
-*/
-fp_identifier
- fp_identifier_ne .error IDENTIFIER_EXPECTED;
-vp_identifier
- vp_identifier_ne .error IDENTIFIER_EXPECTED;
-fp_identifier_ne
- fp_not_reserved_identifier .and identifier_ne;
-vp_identifier_ne
- vp_not_reserved_identifier .and identifier_ne;
-
-fp_not_reserved_identifier
- fp_not_reserved_identifier_1 .or .true;
-fp_not_reserved_identifier_1
- fp_reserved_identifier .and .false .error RESERVED_KEYWORD;
-vp_not_reserved_identifier
- vp_not_reserved_identifier_1 .or .true;
-vp_not_reserved_identifier_1
- vp_reserved_identifier .and .false .error RESERVED_KEYWORD;
-
-fp_reserved_identifier
- "ABS" .or "ABS_SAT" .or "ADD" .or "ADD_SAT" .or "ALIAS" .or "ATTRIB" .or "CMP" .or "CMP_SAT" .or
- "COS" .or "COS_SAT" .or "DP3" .or "DP3_SAT" .or "DP4" .or "DP4_SAT" .or "DPH" .or "DPH_SAT" .or
- "DST" .or "DST_SAT" .or "END" .or "EX2" .or "EX2_SAT" .or "FLR" .or "FLR_SAT" .or "FRC" .or
- "FRC_SAT" .or "KIL" .or "LG2" .or "LG2_SAT" .or "LIT" .or "LIT_SAT" .or "LRP" .or "LRP_SAT" .or
- "MAD" .or "MAD_SAT" .or "MAX" .or "MAX_SAT" .or "MIN" .or "MIN_SAT" .or "MOV" .or "MOV_SAT" .or
- "MUL" .or "MUL_SAT" .or "OPTION" .or "OUTPUT" .or "PARAM" .or "POW" .or "POW_SAT" .or "RCP" .or
- "RCP_SAT" .or "RSQ" .or "RSQ_SAT" .or "SIN" .or "SIN_SAT" .or "SCS" .or "SCS_SAT" .or "SGE" .or
- "SGE_SAT" .or "SLT" .or "SLT_SAT" .or "SUB" .or "SUB_SAT" .or "SWZ" .or "SWZ_SAT" .or "TEMP" .or
- "TEX" .or "TEX_SAT" .or "TXB" .or "TXB_SAT" .or "TXP" .or "TXP_SAT" .or "XPD" .or "XPD_SAT" .or
- "fragment" .or "program" .or "result" .or "state" .or "texture";
-vp_reserved_identifier
- "ABS" .or "ADD" .or "ADDRESS" .or "ALIAS" .or "ARL" .or "ATTRIB" .or "DP3" .or "DP4" .or
- "DPH" .or "DST" .or "END" .or "EX2" .or "EXP" .or "FLR" .or "FRC" .or "LG2" .or "LIT" .or
- "LOG" .or "MAD" .or "MAX" .or "MIN" .or "MOV" .or "MUL" .or "OPTION" .or "OUTPUT" .or
- "PARAM" .or "POW" .or "RCP" .or "RSQ" .or "SGE" .or "SLT" .or "SUB" .or "SWZ" .or "TEMP" .or
- "XPD" .or "program" .or "result" .or "state" .or "vertex";
-
-/*
- The <integer> rule matches an integer constant. The integer consists
- of a sequence of one or more digits ("0" through "9").
-*/
-integer
- integer_ne .error INTEGER_EXPECTED;
-
-zero
- '0';
-
-leading_zeroes
- .loop zero;
-
-no_digit
- no_digit_1 .or .true;
-no_digit_1
- digit10 .and .false .error INTEGER_OUT_OF_RANGE;
-
-all_zeroes
- all_zeroes_1 .or no_digit_1;
-all_zeroes_1
- '0' .and .loop zero .and no_digit;
-
-integer_0_3
- integer_0_3_1 .error INTEGER_EXPECTED .and .true .emit 0x00 .emit $;
-integer_0_3_1
- integer_0_3_2 .or all_zeroes .emit '0';
-integer_0_3_2 /* [1, 3] */
- leading_zeroes .and '1'-'3' .emit * .and no_digit;
-
-integer_0_63
- integer_0_63_1 .error INTEGER_EXPECTED .and .true .emit 0x00 .emit $;
-integer_0_63_1
- integer_0_63_2 .or integer_0_63_3 .or integer_0_63_4 .or integer_0_63_5 .or
- all_zeroes .emit '0';
-integer_0_63_2 /* [7, 9] */
- leading_zeroes .and '7'-'9' .emit * .and no_digit;
-integer_0_63_3 /* [10, 59] */
- leading_zeroes .and '1'-'5' .emit * .and '0'-'9' .emit * .and no_digit;
-integer_0_63_4 /* [60, 63] */
- leading_zeroes .and '6' .emit * .and '0'-'3' .emit * .and no_digit;
-integer_0_63_5 /* [1, 6] */
- leading_zeroes .and '1'-'6' .emit * .and no_digit;
-
-integer_0_64
- integer_0_64_1 .error INTEGER_EXPECTED .and .true .emit 0x00 .emit $;
-integer_0_64_1
- integer_0_64_2 .or integer_0_64_3 .or integer_0_64_4 .or integer_0_64_5 .or
- all_zeroes .emit '0';
-integer_0_64_2 /* [7, 9] */
- leading_zeroes .and '7'-'9' .emit * .and no_digit;
-integer_0_64_3 /* [10, 59] */
- leading_zeroes .and '1'-'5' .emit * .and '0'-'9' .emit * .and no_digit;
-integer_0_64_4 /* [60, 64] */
- leading_zeroes .and '6' .emit * .and '0'-'4' .emit * .and no_digit;
-integer_0_64_5 /* [1, 6] */
- leading_zeroes .and '1'-'6' .emit * .and no_digit;
-
-optional_space
- space .or .true;
-
-space_dst
- space .error OPERATION_NEEDS_DESTINATION_VARIABLE;
-
-space_src
- space .error OPERATION_NEEDS_SOURCE_VARIABLE;
-
-space
- single_space .and .loop single_space;
-
-single_space
- white_char .or comment_block;
-
-white_char
- ' ' .or '\t' .or '\n' .or '\r';
-
-comment_block
- '#' .and .loop comment_char .and new_line;
-
-/* All ASCII characters except '\r', '\n' and '\0' */
-comment_char
- '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
-
-new_line
- '\n' .or crlf .or '\0';
-
-crlf
- '\r' .and '\n';
-
-semicolon
- optional_space .and ';' .error MISSING_SEMICOLON .and optional_space;
-
-comma
- optional_space .and ',' .error MISSING_COMMA .and optional_space;
-
-comma_ne
- optional_space .and ',' .and optional_space;
-
-lbracket
- optional_space .and '[' .error MISSING_LBRACKET .and optional_space;
-
-lbracket_ne
- optional_space .and '[' .and optional_space;
-
-rbracket
- optional_space .and ']' .error MISSING_RBRACKET .and optional_space;
-
-dot
- optional_space .and '.' .error MISSING_DOT .and optional_space;
-
-dot_ne
- optional_space .and '.' .and optional_space;
-
-equal
- optional_space .and '=' .error MISSING_EQUAL .and optional_space;
-
-lbrace
- optional_space .and '{' .error MISSING_LBRACE .and optional_space;
-
-lbrace_ne
- optional_space .and '{' .and optional_space;
-
-rbrace
- optional_space .and '}' .error MISSING_RBRACE .and optional_space;
-
-dotdot
- optional_space .and '.' .and '.' .error MISSING_DOTDOT .and optional_space;
-
-dotdot_ne
- optional_space .and '.' .and '.' .and optional_space;
-
-/*
- The definition below accepts the following floating point number formats:
- .99 .99e99 99. 99.99 99.99e99 99.e99 99e99
- Also 99 format was considered and accepted because of a large number of existing program
- strings with such a format.
-*/
-float
- float_1 .or float_2 .or float_legacy;
-float_1
- '.' .emit 0x00 .and integer_ne .error MISSING_FRACTION_OR_EXPONENT .and optional_exponent;
-float_2
- integer_ne .and float_3;
-float_3
- float_4 .or float_5;
-float_4
- '.' .and optional_integer .and optional_exponent;
-float_5
- exponent .emit 0x00;
-float_legacy
- integer_ne .and .true .emit 0x00 .emit 0x00;
-
-/*
- Below is a correct version of <float> definiton.
-*/
-/*
-float
- float_1 .or float_2;
-float_1
- '.' .emit 0x00 .and integer_ne .error MISSING_FRACTION_OR_EXPONENT .and optional_exponent;
-float_2
- integer_ne .and float_3 .error MISSING_DOT_OR_EXPONENT;
-float_3
- float_4 .or float_5;
-float_4
- '.' .and optional_integer .and optional_exponent;
-float_5
- exponent .emit 0x00;
-*/
-
-integer_ne
- integer_ne_1 .and .true .emit 0x00 .emit $;
-integer_ne_1
- digit10 .emit * .and .loop digit10 .emit *;
-
-optional_integer
- integer_ne .or .true .emit 0x00;
-
-/*
-NOTE: If exponent part is omited we treat it as if it was "E+1".
-*/
-optional_exponent
- exponent .or .true .emit 0x00;
-
-exponent
- exponent_1 .and optional_sign_ne .and integer_ne .error EXPONENT_VALUE_EXPECTED;
-exponent_1
- 'e' .or 'E';
-
-optional_sign_ne
- minus_ne .or plus_ne .or .true;
-
-plus_ne
- optional_space .and '+' .and optional_space;
-
-minus_ne
- optional_space .and '-' .emit '-' .and optional_space;
-
-identifier_ne
- first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit 0x00 .emit $;
-
-follow_idchar
- first_idchar .or digit10;
-
-first_idchar
- 'a'-'z' .or 'A'-'Z' .or '_' .or '$';
-
-digit10
- '0'-'9';
-
-/*
- string filtering - if a string is encountered in grammar ("blabla"), the symbol below is
- executed to create the string. The symbol must not throw any errors and emit bytes - it should
- stop if it encounters invalid character. After this the resulting string (from starting
- position up to the invalid character (but without it) is compared with the grammar string.
-*/
-.string __string_filter;
-
-__string_filter
- .loop __identifier_char;
-
-__identifier_char
- 'a'-'z' .or 'A'-'Z' .or '_' .or '$' .or '0'-'9';
-
-/*
- error token filtering
-*/
-e_signature
- e_signature_char .and .loop e_signature_char;
-e_signature_char
- '!' .or '.' .or 'A'-'Z' .or 'a'-'z' .or '0'-'9';
-
-e_statement
- .loop e_statement_not_term;
-/* All ASCII characters to one of '\r', '\n', '\0' and ';' */
-e_statement_not_term
- '\x3C'-'\xFF' .or '\x0E'-'\x3A' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
-
-e_identifier
- e_identifier_first .and .loop e_identifier_next;
-e_identifier_first
- 'a'-'z' .or 'A'-'Z' .or '_' .or '$';
-e_identifier_next
- e_identifier_first .or '0'-'9';
-
-e_token
- e_identifier .or e_token_number .or '[' .or ']' .or '.' .or '{' .or '}' .or '=' .or '+' .or
- '-' .or ',' .or ';';
-e_token_number
- e_token_digit .and .loop e_token_digit;
-e_token_digit
- '0'-'9';
-
-e_charordigit
- 'A'-'Z' .or 'a'-'z' .or '0'-'9';
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/asmopcodes.reg b/nx-X11/extras/Mesa/src/mesa/shader/asmopcodes.reg
deleted file mode 100644
index efd8918f2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/asmopcodes.reg
+++ /dev/null
@@ -1,78 +0,0 @@
-/* */
-/* ARB program opcode registry */
-/* each instruction code has its own unique number */
-/* this registry exists to ensure that this relation retains */
-/* */
-
-/* GL_ARB_vertex_program */
-ABS 0x00
-ADD 0x01
-ARL 0x02
-DP3 0x03
-DP4 0x04
-DPH 0x05
-DST 0x06
-EX2 0x07
-EXP 0x08
-FLR 0x09
-FRC 0x0A
-LG2 0x0B
-LIT 0x0C
-LOG 0x0D
-MAD 0x0E
-MAX 0x0F
-MIN 0x10
-MOV 0x11
-MUL 0x12
-POW 0x13
-RCP 0x14
-RSQ 0x15
-SGE 0x16
-SLT 0x17
-SUB 0x18
-SWZ 0x19
-XPD 0x1A
-
-/* GL_ARB_fragment_program */
-ABS_SAT 0x1B
-ADD_SAT 0x1C
-CMP 0x1D
-CMP_SAT 0x1E
-COS 0x1F
-COS_SAT 0x20
-DP3_SAT 0x21
-DP4_SAT 0x22
-DPH_SAT 0x23
-DST_SAT 0x24
-EX2_SAT 0x25
-FLR_SAT 0x26
-FRC_SAT 0x27
-KIL 0x28
-LG2_SAT 0x29
-LIT_SAT 0x2A
-LRP 0x2B
-LRP_SAT 0x2C
-MAD_SAT 0x2D
-MAX_SAT 0x2E
-MIN_SAT 0x2F
-MOV_SAT 0x30
-MUL_SAT 0x31
-POW_SAT 0x32
-RCP_SAT 0x33
-RSQ_SAT 0x34
-SCS 0x35
-SCS_SAT 0x36
-SGE_SAT 0x37
-SIN 0x38
-SIN_SAT 0x39
-SLT_SAT 0x3A
-SUB_SAT 0x3B
-SWZ_SAT 0x3C
-TEX 0x3D
-TEX_SAT 0x3E
-TXB 0x3F
-TXB_SAT 0x40
-TXP 0x41
-TXP_SAT 0x42
-XPD_SAT 0x43
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/descrip.mms b/nx-X11/extras/Mesa/src/mesa/shader/descrip.mms
deleted file mode 100644
index e52479c9a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/descrip.mms
+++ /dev/null
@@ -1,83 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 1 June 2005
-
-.first
- define gl [---.include.gl]
- define math [-.math]
- define swrast [-.swrast]
- define array_cache [-.array_cache]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[.grammar],[-.main],[-.glapi],[.slang]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = \
- atifragshader.c \
- arbfragparse.c \
- arbprogparse.c \
- arbprogram.c \
- arbvertparse.c \
- nvfragparse.c \
- nvprogram.c \
- nvvertexec.c \
- nvvertparse.c \
- program.c \
- shaderobjects.c \
- shaderobjects_3dlabs.c
-
-OBJECTS = \
- atifragshader.obj,\
- arbfragparse.obj,\
- arbprogparse.obj,\
- arbprogram.obj,\
- arbvertparse.obj,\
- nvfragparse.obj,\
- nvprogram.obj,\
- nvvertexec.obj,\
- nvvertparse.obj,\
- program.obj,\
- shaderobjects.obj,\
- shaderobjects_3dlabs.obj
-
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-all :
- $(MMS)$(MMSQUALIFIERS) $(LIBDIR)$(GL_LIB)
- set def [.slang]
- $(MMS)$(MMSQUALIFIERS)
- set def [-.grammar]
- $(MMS)$(MMSQUALIFIERS)
- set def [-]
-
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-atifragshader.obj : atifragshader.c
-arbfragparse.obj : arbfragparse.c
-arbprogparse.obj : arbprogparse.c
-arbprogram.obj : arbprogram.c
-arbvertparse.obj : arbvertparse.c
-nvfragparse.obj : nvfragparse.c
-nvprogram.obj : nvprogram.c
-nvvertexec.obj : nvvertexec.c
-nvvertparse.obj : nvvertparse.c
-program.obj : program.c
-shaderobjects.obj : shaderobjects.c
- cc$(CFLAGS)/nowarn shaderobjects.c
-shaderobjects_3dlabs.obj : shaderobjects_3dlabs.c
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/grammar/descrip.mms b/nx-X11/extras/Mesa/src/mesa/shader/grammar/descrip.mms
deleted file mode 100644
index b6736af15..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/grammar/descrip.mms
+++ /dev/null
@@ -1,41 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 1 June 2005
-
-.first
- define gl [----.include.gl]
- define math [--.math]
- define swrast [--.swrast]
- define array_cache [--.array_cache]
-
-.include [----]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [----.include],[],[--.main],[--.glapi],[-.slang]
-LIBDIR = [----.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = grammar_mesa.c
-
-OBJECTS = grammar_mesa.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-all :
- $(MMS)$(MMSQUALIFIERS) $(LIBDIR)$(GL_LIB)
-
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-grammar_mesa.obj : grammar_mesa.c grammar.c
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar.syn b/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar.syn
deleted file mode 100644
index 5d99f65bf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar.syn
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.2
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
- /**
- * \file grammar.syn
- * syntax of .syn script - used to validate other syntax files
- * \author Michal Krol
- */
-
-.syntax grammar;
-
-/* declaration */
-.emtcode DECLARATION_END 0
-.emtcode DECLARATION_EMITCODE 1
-.emtcode DECLARATION_ERRORTEXT 2
-.emtcode DECLARATION_REGBYTE 3
-.emtcode DECLARATION_LEXER 4
-.emtcode DECLARATION_RULE 5
-
-/* specifier */
-.emtcode SPECIFIER_END 0
-.emtcode SPECIFIER_AND_TAG 1
-.emtcode SPECIFIER_OR_TAG 2
-.emtcode SPECIFIER_CHARACTER_RANGE 3
-.emtcode SPECIFIER_CHARACTER 4
-.emtcode SPECIFIER_STRING 5
-.emtcode SPECIFIER_IDENTIFIER 6
-.emtcode SPECIFIER_TRUE 7
-.emtcode SPECIFIER_FALSE 8
-.emtcode SPECIFIER_DEBUG 9
-
-/* identifier */
-.emtcode IDENTIFIER_SIMPLE 0
-.emtcode IDENTIFIER_LOOP 1
-
-/* error */
-.emtcode ERROR_NOT_PRESENT 0
-.emtcode ERROR_PRESENT 1
-
-/* emit */
-.emtcode EMIT_NULL 0
-.emtcode EMIT_INTEGER 1
-.emtcode EMIT_IDENTIFIER 2
-.emtcode EMIT_CHARACTER 3
-.emtcode EMIT_LAST_CHARACTER 4
-.emtcode EMIT_CURRENT_POSITION 5
-
-.errtext INVALID_GRAMMAR "internal error 2001: invalid grammar script"
-.errtext SYNTAX_EXPECTED "internal error 2002: '.syntax' keyword expected"
-.errtext IDENTIFIER_EXPECTED "internal error 2003: identifier expected"
-.errtext MISSING_SEMICOLON "internal error 2004: missing ';'"
-.errtext INTEGER_EXPECTED "internal error 2005: integer value expected"
-.errtext STRING_EXPECTED "internal error 2006: string expected"
-
-/*
- <grammar> ::= ".syntax" <identifier> ";" <declaration_list>
-*/
-grammar
- grammar_1 .error INVALID_GRAMMAR;
-grammar_1
- optional_space .and ".syntax" .error SYNTAX_EXPECTED .and space .and identifier .and
- semicolon .and declaration_list .and optional_space .and '\0' .emit DECLARATION_END;
-
-/*
- <optional_space> ::= <space>
- | ""
-*/
-optional_space
- space .or .true;
-
-/*
- <space> ::= <single_space> <single_space>*
-*/
-space
- single_space .and .loop single_space;
-
-/*
- <single_space> ::= <white_char>
- | <comment_block>
-*/
-single_space
- white_char .or comment_block;
-
-/*
- <white_char> ::= " "
- | "\t"
- | "\n"
- | "\r"
-*/
-white_char
- ' ' .or '\t' .or '\n' .or '\r';
-
-/*
- <comment_block> ::= "/" "*" <comment_rest>
-*/
-comment_block
- '/' .and '*' .and comment_rest;
-
-/*
- <comment_rest> ::= <comment_char_no_star>* <comment_end>
- | <comment_char_no_star>* "*" <comment_rest>
-*/
-comment_rest
- .loop comment_char_no_star .and comment_rest_1;
-comment_rest_1
- comment_end .or comment_rest_2;
-comment_rest_2
- '*' .and comment_rest;
-
-/*
- <comment_char_no_star> ::= All ASCII characters except "*" and "\0"
-*/
-comment_char_no_star
- '\x2B'-'\xFF' .or '\x01'-'\x29';
-
-/*
- <comment_end> ::= "*" "/"
-*/
-comment_end
- '*' .and '/';
-
-/*
- <identifier> ::= <identifier>
-*/
-identifier
- identifier_ne .error IDENTIFIER_EXPECTED;
-
-/*
- <identifier_ne> ::= <first_idchar> <follow_idchar>*
-*/
-identifier_ne
- first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit '\0';
-
-/*
- <first_idchar> ::= "a"-"z"
- | "A"-"Z"
- | "_"
-*/
-first_idchar
- 'a'-'z' .or 'A'-'Z' .or '_';
-
-/*
- <follow_idchar> ::= <first_idchar>
- | <digit_dec>
-*/
-follow_idchar
- first_idchar .or digit_dec;
-
-/*
- <digit_dec> ::= "0"-"9"
-*/
-digit_dec
- '0'-'9';
-
-/*
- <semicolon> ::= ";"
-*/
-semicolon
- optional_space .and ';' .error MISSING_SEMICOLON .and optional_space;
-
-/*
- <declaration_list> ::= <declaration>
- | <declaration_list> <declaration>
-*/
-declaration_list
- declaration .and .loop declaration;
-
-/*
- <declaration> ::= <emitcode_definition>
- | <errortext_definition>
- | <lexer_definition>
- | <rule_definition>
-*/
-declaration
- emitcode_definition .emit DECLARATION_EMITCODE .or
- errortext_definition .emit DECLARATION_ERRORTEXT .or
- regbyte_definition .emit DECLARATION_REGBYTE .or
- lexer_definition .emit DECLARATION_LEXER .or
- rule_definition .emit DECLARATION_RULE;
-
-/*
- <emitcode_definition> ::= ".emtcode" <identifier> <integer>
-*/
-emitcode_definition
- ".emtcode" .and space .and identifier .and space .and integer .and space_or_null;
-
-/*
- <integer> ::= <integer_ne>
-*/
-integer
- integer_ne .error INTEGER_EXPECTED;
-
-/*
- <integer_ne> ::= <hex_integer>
- | <dec_integer>
-*/
-integer_ne
- hex_integer .emit 0x10 .or dec_integer .emit 10;
-
-/*
- <hex_integer> :: <hex_prefix> <digit_hex> <digit_hex>*
-*/
-hex_integer
- hex_prefix .and digit_hex .emit * .and .loop digit_hex .emit * .and .true .emit '\0';
-
-/*
- <hex_prefix> ::= "0x"
- | "0X"
-*/
-hex_prefix
- '0' .and hex_prefix_1;
-hex_prefix_1
- 'x' .or 'X';
-
-/*
- <digit_hex> ::= "0"-"9"
- | "a"-"f"
- | "A"-"F"
-*/
-digit_hex
- '0'-'9' .or 'a'-'f' .or 'A'-'F';
-
-/*
- <dec_integer> :: <digit_dec> <digit_dec>*
-*/
-dec_integer
- digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0';
-
-/*
- <space_or_null> ::= <space>
- | "\0"
-*/
-space_or_null
- space .or '\0';
-
-/*
- <errortext_definition> ::= ".errtext" <identifier> <string>
-*/
-errortext_definition
- ".errtext" .and space .and identifier .and space .and string .and space_or_null;
-
-/*
- <string> ::= <string_ne>
-*/
-string
- string_ne .error STRING_EXPECTED;
-
-/*
- <string_ne> ::= "\"" <string_char_double_quotes> "\""
-*/
-string_ne
- '"' .and .loop string_char_double_quotes .and '"' .emit '\0';
-
-/*
- <string_char_double_quotes> ::= <escape_sequence>
- | <string_char>
- | "\'"
-*/
-string_char_double_quotes
- escape_sequence .or string_char .emit * .or '\'' .emit *;
-
-/*
- <string_char> ::= All ASCII characters except "\'", "\"", "\n", "\r",
- "\0" and "\\"
-*/
-string_char
- '\x5D'-'\xFF' .or '\x28'-'\x5B' .or '\x23'-'\x26' .or '\x0E'-'\x21' .or '\x0B'-'\x0C' .or
- '\x01'-'\x09';
-
-/*
- <escape_sequence> ::= "\\" <escape_code>
-*/
-escape_sequence
- '\\' .emit * .and escape_code;
-
-/*
- <escape_code> ::= <simple_escape_code>
- | <hex_escape_code>
- | <oct_escape_code>
-*/
-escape_code
- simple_escape_code .emit * .or hex_escape_code .or oct_escape_code;
-
-/*
- <simple_escape_code> ::= "\'"
- | "\""
- | "?"
- | "\\"
- | "a"
- | "b"
- | "f"
- | "n"
- | "r"
- | "t"
- | "v"
-*/
-simple_escape_code
- '\'' .or '"' .or '?' .or '\\' .or 'a' .or 'b' .or 'f' .or 'n' .or 'r' .or 't' .or 'v';
-
-/*
- <hex_escape_code> ::= "x" <digit_hex> <digit_hex>*
-*/
-hex_escape_code
- 'x' .emit * .and digit_hex .emit * .and .loop digit_hex .emit *;
-
-/*
- <oct_escape_code> ::= <digit_oct> <optional_digit_oct> <optional_digit_oct>
-*/
-oct_escape_code
- digit_oct .emit * .and optional_digit_oct .and optional_digit_oct;
-
-/*
- <digit_oct> ::= "0"-"7"
-*/
-digit_oct
- '0'-'7';
-
-/*
- <optional_digit_oct> ::= <digit_oct>
- | ""
-*/
-optional_digit_oct
- digit_oct .emit * .or .true;
-
-/*
- <regbyte_definition> ::= ".regbyte" <identifier> <integer>
-*/
-regbyte_definition
- ".regbyte" .and space .and identifier .and space .and integer .and space_or_null;
-
-/*
- <lexer_definition> ::= ".string" <identifier> ";"
-*/
-lexer_definition
- ".string" .and space .and identifier .and semicolon;
-
-/*
- <rule_definition> ::= <identifier_ne> <definition>
-*/
-rule_definition
- identifier_ne .and space .and definition;
-
-/*
- <definition> ::= <specifier> <optional_specifiers_and_or> ";"
-*/
-definition
- specifier .and optional_specifiers_and_or .and semicolon .emit SPECIFIER_END;
-
-/*
- <optional_specifiers_and_or> ::= <and_specifiers>
- | <or_specifiers>
- | ""
-*/
-optional_specifiers_and_or
- and_specifiers .emit SPECIFIER_AND_TAG .or or_specifiers .emit SPECIFIER_OR_TAG .or .true;
-
-/*
- <specifier> ::= <specifier_condition> <specifier_rule>
-*/
-specifier
- specifier_condition .and optional_space .and specifier_rule;
-
-/*
- <specifier_condition> ::= ".if" "(" <left_operand> <operator> <right_operand> ")"
-*/
-specifier_condition
- specifier_condition_1 .or .true;
-specifier_condition_1
- ".if" .and optional_space .and '(' .and optional_space .and left_operand .and operator .and
- right_operand .and optional_space .and ')';
-
-/*
- <left_operand> ::= <identifier>
-*/
-left_operand
- identifier;
-
-/*
- <operator> ::= "!="
- | "=="
-*/
-operator
- operator_1 .or operator_2;
-operator_1
- optional_space .and '!' .and '=' .and optional_space;
-operator_2
- optional_space .and '=' .and '=' .and optional_space;
-
-/*
- <right_operand> ::= <integer>
-*/
-right_operand
- integer;
-
-/*
- <specifier_rule> ::= <character_range> <optional_error> <emit>*
- | <character> <optional_error> <emit>*
- | <string> <optional_error> <emit>*
- | ".true" <optional_error> <emit>*
- | ".false" <optional_error> <emit>*
- | ".debug" <optional_error> <emit>*
- | <advanced_identifier> <optional_error> <emit>*
-*/
-specifier_rule
- specifier_rule_1 .and optional_error .and .loop emit .and .true .emit EMIT_NULL;
-specifier_rule_1
- character_range .emit SPECIFIER_CHARACTER_RANGE .or
- character .emit SPECIFIER_CHARACTER .or
- string_ne .emit SPECIFIER_STRING .or
- ".true" .emit SPECIFIER_TRUE .or
- ".false" .emit SPECIFIER_FALSE .or
- ".debug" .emit SPECIFIER_DEBUG .or
- advanced_identifier .emit SPECIFIER_IDENTIFIER;
-
-/*
- <character> ::= "\'" <string_char_single_quotes "\'"
-*/
-character
- '\'' .and string_char_single_quotes .and '\'' .emit '\0';
-
-/*
- <string_char_single_quotes> ::= <escape_sequence>
- | <string_char>
- | "\""
-*/
-string_char_single_quotes
- escape_sequence .or string_char .emit * .or '"' .emit *;
-
-/*
- <character_range> ::= <character> "-" <character>
-*/
-character_range
- character .and optional_space .and '-' .and optional_space .and character;
-
-/*
- <advanced_identifier> ::= <optional_loop> <identifier>
-*/
-advanced_identifier
- optional_loop .and identifier;
-
-/*
- <optional_loop> ::= ".loop"
- | ""
-*/
-optional_loop
- optional_loop_1 .emit IDENTIFIER_LOOP .or .true .emit IDENTIFIER_SIMPLE;
-optional_loop_1
- ".loop" .and space;
-
-/*
- <optional_error> ::= <error>
- | ""
-*/
-optional_error
- error .emit ERROR_PRESENT .or .true .emit ERROR_NOT_PRESENT;
-
-/*
- <error> :: ".error" <identifier>
-*/
-error
- space .and ".error" .and space .and identifier;
-
-/*
- <emit> ::= <emit_output>
- | <emit_regbyte>
-*/
-emit
- emit_output .or emit_regbyte;
-
-/*
- <emit_output> ::= ".emit" <emit_param>
-*/
-emit_output
- space .and ".emit" .and space .and emit_param;
-
-/*
- <emit_param> ::= <integer>
- | <identifier>
- | <character>
- | "*"
- | "$"
-*/
-emit_param
- integer_ne .emit EMIT_INTEGER .or
- identifier_ne .emit EMIT_IDENTIFIER .or
- character .emit EMIT_CHARACTER .or
- '*' .emit EMIT_LAST_CHARACTER .or
- '$' .emit EMIT_CURRENT_POSITION;
-
-/*
- <emit_regbyte> ::= ".load" <identifier> <emit_param>
-*/
-emit_regbyte
- space .and ".load" .and space .and identifier .and space .and emit_param;
-
-/*
- <and_specifiers> ::= <and_specifier> <and_specifier>*
-*/
-and_specifiers
- and_specifier .and .loop and_specifier;
-
-/*
- <or_specifiers> ::= <or_specifier> <or_specifier>*
-*/
-or_specifiers
- or_specifier .and .loop or_specifier;
-
-/*
- <and_specifier> ::= ".and" <specifier>
-*/
-and_specifier
- space .and ".and" .and space .and specifier;
-
-/*
- <or_specifier> ::= ".or" <specifier>
-*/
-or_specifier
- space .and ".or" .and space .and specifier;
-
-
-.string __string_filter;
-
-/*
- <__string_filter> ::= <__first_identifier_char> <__next_identifier_char>*
-*/
-__string_filter
- __first_identifier_char .and .loop __next_identifier_char;
-
-/*
- <__first_identifier_char> ::= "a"-"z"
- | "A"-"Z"
- | "_"
- | "."
-*/
-__first_identifier_char
- 'a'-'z' .or 'A'-'Z' .or '_' .or '.';
-
-/*
- <__next_identifier_char> ::= "a"-"z"
- | "A"-"Z"
- | "_"
- | "0"-"9"
-*/
-__next_identifier_char
- 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.c b/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.c
deleted file mode 100755
index 8db87358c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "grammar_crt.h"
-
-#define GRAMMAR_PORT_BUILD 1
-#include "grammar.c"
-#undef GRAMMAR_PORT_BUILD
-
-
-void grammar_alloc_free (void *ptr)
-{
- free (ptr);
-}
-
-void *grammar_alloc_malloc (unsigned int size)
-{
- return malloc (size);
-}
-
-void *grammar_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size)
-{
- return realloc (ptr, size);
-}
-
-void *grammar_memory_copy (void *dst, const void * src, unsigned int size)
-{
- return memcpy (dst, src, size);
-}
-
-int grammar_string_compare (const byte *str1, const byte *str2)
-{
- return strcmp ((const char *) str1, (const char *) str2);
-}
-
-int grammar_string_compare_n (const byte *str1, const byte *str2, unsigned int n)
-{
- return strncmp ((const char *) str1, (const char *) str2, n);
-}
-
-byte *grammar_string_copy (byte *dst, const byte *src)
-{
- return (byte *) strcpy ((char *) dst, (const char *) src);
-}
-
-byte *grammar_string_copy_n (byte *dst, const byte *src, unsigned int n)
-{
- return (byte *) strncpy ((char *) dst, (const char *) src, n);
-}
-
-unsigned int grammar_string_length (const byte *str)
-{
- return strlen ((const char *) str);
-}
-
-byte *grammar_string_duplicate (const byte *src)
-{
- const unsigned int size = grammar_string_length (src);
- byte *str = grammar_alloc_malloc (size + 1);
- if (str != NULL)
- {
- grammar_memory_copy (str, src, size);
- str[size] = '\0';
- }
- return str;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.h b/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.h
deleted file mode 100755
index f0827ce96..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_crt.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef GRAMMAR_CRT_H
-#define GRAMMAR_CRT_H
-
-
-#include <stdlib.h>
-#include <malloc.h>
-#include <string.h>
-
-
-typedef unsigned long grammar;
-typedef unsigned char byte;
-
-
-#define GRAMMAR_PORT_INCLUDE 1
-#include "grammar.h"
-#undef GRAMMAR_PORT_INCLUDE
-
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/BaseTypes.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/BaseTypes.h
deleted file mode 100755
index c5bf8de17..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/BaseTypes.h
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _BASICTYPES_INCLUDED_
-#define _BASICTYPES_INCLUDED_
-
-//
-// Basic type. Arrays, vectors, etc., are orthogonal to this.
-//
-enum TBasicType {
- EbtVoid,
- EbtFloat,
- EbtInt,
- EbtBool,
- EbtSampler1D,
- EbtSampler2D,
- EbtSampler3D,
- EbtSamplerCube,
- EbtSampler1DShadow,
- EbtSampler2DShadow,
- EbtStruct,
- EbtAddress
-};
-
-__inline bool IsSampler(TBasicType type)
-{
- return type >= EbtSampler1D && type <= EbtSampler2DShadow;
-}
-
-//
-// Qualifiers and built-ins. These are mainly used to see what can be read
-// or written, and by the machine dependent translator to know which registers
-// to allocate variables in. Since built-ins tend to go to different registers
-// than varying or uniform, it makes sense they are peers, not sub-classes.
-//
-enum TQualifier {
- EvqTemporary, // For temporaries (within a function), read/write
- EvqGlobal, // For globals read/write
- EvqConst, // User defined constants and non-output parameters in functions
- EvqAttribute, // Readonly
- EvqVaryingIn, // readonly, fragment shaders only
- EvqVaryingOut, // vertex shaders only read/write
- EvqUniform, // Readonly, vertex and fragment
-
- // pack/unpack input and output
- EvqInput,
- EvqOutput,
-
- // parameters
- EvqIn,
- EvqOut,
- EvqInOut,
- EvqConstReadOnly,
-
- // built-ins written by vertex shader
- EvqPosition,
- EvqPointSize,
- EvqClipVertex,
-
- // built-ins read by fragment shader
- EvqFace,
- EvqFragCoord,
-
- // built-ins written by fragment shader
- EvqFragColor,
- EvqFragDepth,
-
- // end of list
- EvqLast
-};
-
-//
-// This is just for debug print out, carried along with the definitions above.
-//
-__inline const char* getQualifierString(TQualifier q)
-{
- switch (q) {
- case EvqTemporary: return "Temporary"; break;
- case EvqGlobal: return "Global"; break;
- case EvqConst: return "const"; break;
- case EvqConstReadOnly: return "const"; break;
- case EvqAttribute: return "attribute"; break;
- case EvqVaryingIn: return "varying"; break;
- case EvqVaryingOut: return "varying"; break;
- case EvqUniform: return "uniform"; break;
- case EvqIn: return "in"; break;
- case EvqOut: return "out"; break;
- case EvqInOut: return "inout"; break;
- case EvqInput: return "input"; break;
- case EvqOutput: return "output"; break;
- case EvqPosition: return "Position"; break;
- case EvqPointSize: return "PointSize"; break;
- case EvqClipVertex: return "ClipVertex"; break;
- case EvqFace: return "Face"; break;
- case EvqFragCoord: return "FragCoord"; break;
- case EvqFragColor: return "FragColor"; break;
- case EvqFragDepth: return "FragDepth"; break;
- default: return "unknown qualifier";
- }
-}
-
-#endif // _BASICTYPES_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/Common.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/Common.h
deleted file mode 100755
index 4a9c0d34a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/Common.h
+++ /dev/null
@@ -1,288 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _COMMON_INCLUDED_
-#define _COMMON_INCLUDED_
-
-#ifdef _WIN32
- #include <basetsd.h>
-#elif defined (solaris)
- #include <sys/int_types.h>
- #define UINT_PTR uintptr_t
-#else
- #include <stdint.h>
- #define UINT_PTR uintptr_t
-#endif
-
-/* windows only pragma */
-#ifdef _MSC_VER
- #pragma warning(disable : 4786) // Don't warn about too long identifiers
- #pragma warning(disable : 4514) // unused inline method
- #pragma warning(disable : 4201) // nameless union
-#endif
-
-//
-// Doing the push and pop below for warnings does not leave the warning state
-// the way it was. This seems like a defect in the compiler. We would like
-// to do this, but since it does not work correctly right now, it is turned
-// off.
-//
-//??#pragma warning(push, 3)
-
- #include <set>
- #include <vector>
- #include <map>
- #include <list>
- #include <string>
- #include <stdio.h>
-
-//??#pragma warning(pop)
-
-typedef int TSourceLoc;
-
-#include <assert.h>
-#include "PoolAlloc.h"
-
-//
-// Put POOL_ALLOCATOR_NEW_DELETE in base classes to make them use this scheme.
-//
-#define POOL_ALLOCATOR_NEW_DELETE(A) \
- void* operator new(size_t s) { return (A).allocate(s); } \
- void* operator new(size_t, void *_Where) { return (_Where); } \
- void operator delete(void*) { } \
- void operator delete(void *, void *) { } \
- void* operator new[](size_t s) { return (A).allocate(s); } \
- void* operator new[](size_t, void *_Where) { return (_Where); } \
- void operator delete[](void*) { } \
- void operator delete[](void *, void *) { }
-
-#ifdef _M_AMD64
-//
-// The current version of STL that comes with the PSDK (as required for the AMD64 compiler)
-// has a very old version of the STL which is very out of date. As a result, various additions needed
-// making to it to get the compilers compiling!
-//
-
-//
-// A new version of the Map template class - the operator[] now returns the correct type reference
-//
-template <class _K, class _Ty, class _Pr = std::less<_K>, class _A = std::allocator<_Ty> >
-class TBaseMap : public std::map <_K, _Ty, _Pr, _A >
-{
-public :
- _Ty& operator[] (const _K& _Kv)
- {
- iterator _P = insert(value_type(_Kv, _Ty())).first;
- return ((*_P).second);
- }
-
- explicit TBaseMap(const _Pr& _Pred = _Pr(), const _A& _Al = _A())
- : std::map<_K, _Ty, _Pr, _A >(_Pred, _Al) {};
-
-
-};
-
-//
-// A new version of the List template class - the begin function now checks for NULL to eliminate access violations
-//
-template <class _Ty, class _A = std::allocator<_Ty> >
-class TBaseList : public std::list <_Ty, _A >
-{
-public :
- iterator begin()
- {
- return (iterator(_Head == 0 ? 0 : _Acc::_Next(_Head)));
- }
-
- const_iterator begin() const
- {
- return (const_iterator(_Head == 0 ? 0 : _Acc::_Next(_Head)));
- }
-
- //
- // These are required - apparently!
- //
- explicit TBaseList(const _A& _Al = _A())
- : std::list<_Ty, _A >(_Al) {};
- explicit TBaseList(size_type _N, const _Ty& _V = _Ty(), const _A& _Al = _A())
- : std::list<_Ty, _A >(N, _V, _Al) {};
-
-};
-
-//
-// A new version of the set class - this defines the required insert method
-//
-template<class _K, class _Pr = std::less<_K>, class _A = std::allocator<_K> >
-class TBaseSet : public std::set <_K, _Pr, _A>
-{
-public :
-
- //
- // This method wasn't defined
- //
- template<class _Iter>
- void insert(_Iter _First, _Iter _Last)
- { // insert [_First, _Last)
- for (; _First != _Last; ++_First)
- this->insert(*_First);
- }
-
- //
- // These methods were not resolved if I declared the previous method??
- //
- _Pairib insert(const value_type& _X)
- {
- _Imp::_Pairib _Ans = _Tr.insert(_X);
- return (_Pairib(_Ans.first, _Ans.second));
- }
-
- iterator insert(iterator _P, const value_type& _X)
- {
- return (_Tr.insert((_Imp::iterator&)_P, _X));
- }
-
- void insert(_It _F, _It _L)
- {
- for (; _F != _L; ++_F)
- _Tr.insert(*_F);
- }
-
-};
-
-#else
-
-#define TBaseMap std::map
-#define TBaseList std::list
-#define TBaseSet std::set
-
-#endif //_M_AMD64
-
-//
-// Pool version of string.
-//
-typedef pool_allocator<char> TStringAllocator;
-typedef std::basic_string <char, std::char_traits<char>, TStringAllocator > TString;
-inline TString* NewPoolTString(const char* s)
-{
- void* memory = GlobalPoolAllocator.allocate(sizeof(TString));
- return new(memory) TString(s);
-}
-
-//
-// Pool allocator versions of vectors, lists, and maps
-//
-template <class T> class TVector : public std::vector<T, pool_allocator<T> > {
-public:
- typedef typename std::vector<T, pool_allocator<T> >::size_type size_type;
- TVector() : std::vector<T, pool_allocator<T> >() {}
- TVector(const pool_allocator<T>& a) : std::vector<T, pool_allocator<T> >(a) {}
- TVector(size_type i): std::vector<T, pool_allocator<T> >(i) {}
-};
-
-template <class T> class TList : public TBaseList <T, pool_allocator<T> > {
-public:
- typedef typename TBaseList<T, pool_allocator<T> >::size_type size_type;
- TList() : TBaseList<T, pool_allocator<T> >() {}
- TList(const pool_allocator<T>& a) : TBaseList<T, pool_allocator<T> >(a) {}
- TList(size_type i): TBaseList<T, pool_allocator<T> >(i) {}
-};
-
-// This is called TStlSet, because TSet is taken by an existing compiler class.
-template <class T, class CMP> class TStlSet : public std::set<T, CMP, pool_allocator<T> > {
- // No pool allocator versions of constructors in std::set.
-};
-
-
-template <class K, class D, class CMP = std::less<K> > class TMap :
- public TBaseMap<K, D, CMP, pool_allocator<std::pair<K, D> > > {
-public:
- typedef pool_allocator<std::pair <K, D> > tAllocator;
-
- TMap() : TBaseMap<K, D, CMP, tAllocator >() {}
-/*
- TMap(const tAllocator& a) : TBaseMap<K, D, CMP, tAllocator >(key_compare(), a) {}
-*/
- TMap(const tAllocator& a) : TBaseMap<K, D, CMP, tAllocator >() {}
-};
-
-//
-// Persistent string memory. Should only be used for strings that survive
-// across compiles/links.
-//
-typedef std::basic_string<char> TPersistString;
-
-//
-// templatized min and max functions.
-//
-template <class T> T Min(const T a, const T b) { return a < b ? a : b; }
-template <class T> T Max(const T a, const T b) { return a > b ? a : b; }
-
-//
-// Create a TString object from an integer.
-//
-inline const TString String(const int i, const int base = 10)
-{
- char text[16]; // 32 bit ints are at most 10 digits in base 10
-
- #ifdef _WIN32
- itoa(i, text, base);
- #else
- // we assume base 10 for all cases
- sprintf(text, "%d", i);
- #endif
-
- return text;
-}
-
-const unsigned int SourceLocLineMask = 0xffff;
-const unsigned int SourceLocStringShift = 16;
-
-__inline TPersistString FormatSourceLoc(const TSourceLoc loc)
-{
- char locText[64];
-
- int string = loc >> SourceLocStringShift;
- int line = loc & SourceLocLineMask;
-
- if (line)
- sprintf(locText, "%d:%d", string, line);
- else
- sprintf(locText, "%d:? ", string);
-
- return TPersistString(locText);
-}
-typedef TMap<TString, TString> TPragmaTable;
-typedef TMap<TString, TString>::tAllocator TPragmaTableAllocator;
-
-#endif // _COMMON_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ConstantUnion.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ConstantUnion.h
deleted file mode 100755
index a60ae114f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ConstantUnion.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _CONSTANT_UNION_INCLUDED_
-#define _CONSTANT_UNION_INCLUDED_
-
-
-class constUnion {
-public:
-
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
- union {
- int iConst; // used for ivec
- bool bConst; // used for bvec
- float fConst; // used for vec, mat
- } ;
-};
-
-#endif // _CONSTANT_UNION_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InfoSink.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InfoSink.h
deleted file mode 100755
index 14d44a34a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InfoSink.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _INFOSINK_INCLUDED_
-#define _INFOSINK_INCLUDED_
-
-#include "../Include/Common.h"
-#include <math.h>
-
-//
-// TPrefixType is used to centralize how info log messages start.
-// See below.
-//
-enum TPrefixType {
- EPrefixNone,
- EPrefixWarning,
- EPrefixError,
- EPrefixInternalError,
- EPrefixUnimplemented
-};
-
-enum TOutputStream {
- ENull = 0,
- EDebugger = 0x01,
- EStdOut = 0x02,
- EString = 0x04
-};
-//
-// Encapsulate info logs for all objects that have them.
-//
-// The methods are a general set of tools for getting a variety of
-// messages and types inserted into the log.
-//
-class TInfoSinkBase {
-public:
- TInfoSinkBase() : outputStream(4) {}
- void erase() { sink.erase(); }
- TInfoSinkBase& operator<<(const TPersistString& t) { append(t); return *this; }
- TInfoSinkBase& operator<<(char c) { append(1, c); return *this; }
- TInfoSinkBase& operator<<(const char* s) { append(s); return *this; }
- TInfoSinkBase& operator<<(int n) { append(String(n)); return *this; }
- TInfoSinkBase& operator<<(const unsigned int n) { append(String(n)); return *this; }
- TInfoSinkBase& operator<<(float n) { char buf[40];
- sprintf(buf, (fabs(n) > 1e-8 && fabs(n) < 1e8) || n == 0.0f ?
- "%f" : "%g", n);
- append(buf);
- return *this; }
- TInfoSinkBase& operator+(const TPersistString& t) { append(t); return *this; }
- TInfoSinkBase& operator+(const TString& t) { append(t); return *this; }
- TInfoSinkBase& operator<<(const TString& t) { append(t); return *this; }
- TInfoSinkBase& operator+(const char* s) { append(s); return *this; }
- const char* c_str() const { return sink.c_str(); }
- void prefix(TPrefixType message) {
- switch(message) {
- case EPrefixNone: break;
- case EPrefixWarning: append("WARNING: "); break;
- case EPrefixError: append("ERROR: "); break;
- case EPrefixInternalError: append("INTERNAL ERROR: "); break;
- case EPrefixUnimplemented: append("UNIMPLEMENTED: "); break;
- default: append("UNKOWN ERROR: "); break;
- }
- }
- void location(TSourceLoc loc) {
- append(FormatSourceLoc(loc).c_str());
- append(": ");
- }
- void message(TPrefixType message, const char* s) {
- prefix(message);
- append(s);
- append("\n");
- }
- void message(TPrefixType message, const char* s, TSourceLoc loc) {
- prefix(message);
- location(loc);
- append(s);
- append("\n");
- }
-
- void setOutputStream(int output = 4)
- {
- outputStream = output;
- }
-
-protected:
- void append(const char *s);
-
- void append(int count, char c);
- void append(const TPersistString& t);
- void append(const TString& t);
-
- void checkMem(size_t growth) { if (sink.capacity() < sink.size() + growth + 2)
- sink.reserve(sink.capacity() + sink.capacity() / 2); }
- void appendToStream(const char* s);
- TPersistString sink;
- int outputStream;
-};
-
-class TInfoSink {
-public:
- TInfoSinkBase info;
- TInfoSinkBase debug;
-};
-
-#endif // _INFOSINK_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeGlobals.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeGlobals.h
deleted file mode 100755
index 3d9a42a2b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeGlobals.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef __INITIALIZE_GLOBALS_INCLUDED_
-#define __INITIALIZE_GLOBALS_INCLUDED_
-
-void InitializeGlobalPools();
-void FreeGlobalPools();
-bool InitializePoolIndex();
-void FreePoolIndex();
-
-#endif // __INITIALIZE_GLOBALS_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeParseContext.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeParseContext.h
deleted file mode 100755
index 7d565b313..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/InitializeParseContext.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef __INITIALIZE_PARSE_CONTEXT_INCLUDED_
-#define __INITIALIZE_PARSE_CONTEXT_INCLUDED_
-#include "osinclude.h"
-
-bool InitializeParseContextIndex();
-bool InitializeGlobalParseContext();
-bool FreeParseContext();
-bool FreeParseContextIndex();
-
-#endif // __INITIALIZE_PARSE_CONTEXT_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/PoolAlloc.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/PoolAlloc.h
deleted file mode 100755
index e224d3b86..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/PoolAlloc.h
+++ /dev/null
@@ -1,346 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _POOLALLOC_INCLUDED_
-#define _POOLALLOC_INCLUDED_
-
-#ifdef _DEBUG
-# define GUARD_BLOCKS // define to enable guard block sanity checking
-#endif
-
-//
-// This header defines an allocator that can be used to efficiently
-// allocate a large number of small requests for heap memory, with the
-// intention that they are not individually deallocated, but rather
-// collectively deallocated at one time.
-//
-// This simultaneously
-//
-// * Makes each individual allocation much more efficient; the
-// typical allocation is trivial.
-// * Completely avoids the cost of doing individual deallocation.
-// * Saves the trouble of tracking down and plugging a large class of leaks.
-//
-// Individual classes can use this allocator by supplying their own
-// new and delete methods.
-//
-// STL containers can use this allocator by using the pool_allocator
-// class as the allocator (second) template argument.
-//
-
-#include <stddef.h>
-#include <vector>
-
-// If we are using guard blocks, we must track each indivual
-// allocation. If we aren't using guard blocks, these
-// never get instantiated, so won't have any impact.
-//
-
-class TAllocation {
-public:
- TAllocation(size_t size, unsigned char* mem, TAllocation* prev = 0) :
- size(size), mem(mem), prevAlloc(prev) {
- // Allocations are bracketed:
- // [allocationHeader][initialGuardBlock][userData][finalGuardBlock]
- // This would be cleaner with if (guardBlockSize)..., but that
- // makes the compiler print warnings about 0 length memsets,
- // even with the if() protecting them.
-# ifdef GUARD_BLOCKS
- memset(preGuard(), guardBlockBeginVal, guardBlockSize);
- memset(data(), userDataFill, size);
- memset(postGuard(), guardBlockEndVal, guardBlockSize);
-# endif
- }
-
- void check() const {
- checkGuardBlock(preGuard(), guardBlockBeginVal, "before");
- checkGuardBlock(postGuard(), guardBlockEndVal, "after");
- }
-
- void checkAllocList() const;
-
- // Return total size needed to accomodate user buffer of 'size',
- // plus our tracking data.
- inline static size_t allocationSize(size_t size) {
- return size + 2 * guardBlockSize + headerSize();
- }
-
- // Offset from surrounding buffer to get to user data buffer.
- inline static unsigned char* offsetAllocation(unsigned char* m) {
- return m + guardBlockSize + headerSize();
- }
-
-private:
- void checkGuardBlock(unsigned char* blockMem, unsigned char val, char* locText) const;
-
- // Find offsets to pre and post guard blocks, and user data buffer
- unsigned char* preGuard() const { return mem + headerSize(); }
- unsigned char* data() const { return preGuard() + guardBlockSize; }
- unsigned char* postGuard() const { return data() + size; }
-
- size_t size; // size of the user data area
- unsigned char* mem; // beginning of our allocation (pts to header)
- TAllocation* prevAlloc; // prior allocation in the chain
-
- // Support MSVC++ 6.0
- const static unsigned char guardBlockBeginVal;
- const static unsigned char guardBlockEndVal;
- const static unsigned char userDataFill;
-
-# ifdef GUARD_BLOCKS
- const static size_t guardBlockSize;
- inline static size_t headerSize() { return sizeof(TAllocation); }
-# else
- const static size_t guardBlockSize;
- inline static size_t headerSize() { return 0; }
-# endif
-};
-
-//
-// There are several stacks. One is to track the pushing and popping
-// of the user, and not yet implemented. The others are simply a
-// repositories of free pages or used pages.
-//
-// Page stacks are linked together with a simple header at the beginning
-// of each allocation obtained from the underlying OS. Multi-page allocations
-// are returned to the OS. Individual page allocations are kept for future
-// re-use.
-//
-// The "page size" used is not, nor must it match, the underlying OS
-// page size. But, having it be about that size or equal to a set of
-// pages is likely most optimal.
-//
-class TPoolAllocator {
-public:
- TPoolAllocator(bool global = false, int growthIncrement = 8*1024, int allocationAlignment = 16);
-
- //
- // Don't call the destructor just to free up the memory, call pop()
- //
- ~TPoolAllocator();
-
- //
- // Call push() to establish a new place to pop memory too. Does not
- // have to be called to get things started.
- //
- void push();
-
- //
- // Call pop() to free all memory allocated since the last call to push(),
- // or if no last call to push, frees all memory since first allocation.
- //
- void pop();
-
- //
- // Call popAll() to free all memory allocated.
- //
- void popAll();
-
- //
- // Call allocate() to actually acquire memory. Returns 0 if no memory
- // available, otherwise a properly aligned pointer to 'numBytes' of memory.
- //
- void* allocate(size_t numBytes);
-
- //
- // There is no deallocate. The point of this class is that
- // deallocation can be skipped by the user of it, as the model
- // of use is to simultaneously deallocate everything at once
- // by calling pop(), and to not have to solve memory leak problems.
- //
-
-protected:
- friend struct tHeader;
-
- struct tHeader {
- tHeader(tHeader* nextPage, size_t pageCount) :
-#ifdef GUARD_BLOCKS
- lastAllocation(0),
-#endif
- nextPage(nextPage), pageCount(pageCount) { }
-
- ~tHeader() {
-#ifdef GUARD_BLOCKS
- if (lastAllocation)
- lastAllocation->checkAllocList();
-#endif
- }
-
- tHeader* nextPage;
- size_t pageCount;
-#ifdef GUARD_BLOCKS
- TAllocation* lastAllocation;
-#endif
- };
-
- struct tAllocState {
- size_t offset;
- tHeader* page;
- };
- typedef std::vector<tAllocState> tAllocStack;
-
- // Track allocations if and only if we're using guard blocks
- void* initializeAllocation(tHeader* block, unsigned char* memory, size_t numBytes) {
-# ifdef GUARD_BLOCKS
- new(memory) TAllocation(numBytes, memory, block->lastAllocation);
- block->lastAllocation = reinterpret_cast<TAllocation*>(memory);
-# endif
-
- // This is optimized entirely away if GUARD_BLOCKS is not defined.
- return TAllocation::offsetAllocation(memory);
- }
-
- bool global; // should be true if this object is globally scoped
- size_t pageSize; // granularity of allocation from the OS
- size_t alignment; // all returned allocations will be aligned at
- // this granularity, which will be a power of 2
- size_t alignmentMask;
- size_t headerSkip; // amount of memory to skip to make room for the
- // header (basically, size of header, rounded
- // up to make it aligned
- size_t currentPageOffset; // next offset in top of inUseList to allocate from
- tHeader* freeList; // list of popped memory
- tHeader* inUseList; // list of all memory currently being used
- tAllocStack stack; // stack of where to allocate from, to partition pool
-
- int numCalls; // just an interesting statistic
- size_t totalBytes; // just an interesting statistic
-private:
- TPoolAllocator& operator=(const TPoolAllocator&); // dont allow assignment operator
- TPoolAllocator(const TPoolAllocator&); // dont allow default copy constructor
-};
-
-
-//
-// There could potentially be many pools with pops happening at
-// different times. But a simple use is to have a global pop
-// with everyone using the same global allocator.
-//
-typedef TPoolAllocator* PoolAllocatorPointer;
-extern TPoolAllocator& GetGlobalPoolAllocator();
-#define GlobalPoolAllocator GetGlobalPoolAllocator()
-struct TThreadGlobalPools
-{
- TPoolAllocator* globalPoolAllocator;
-};
-
-//
-// This STL compatible allocator is intended to be used as the allocator
-// parameter to templatized STL containers, like vector and map.
-//
-// It will use the pools for allocation, and not
-// do any deallocation, but will still do destruction.
-//
-template<class T>
-class pool_allocator {
-public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef T *pointer;
- typedef const T *const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef T value_type;
- template<class Other>
- struct rebind {
- typedef pool_allocator<Other> other;
- };
- pointer address(reference x) const { return &x; }
- const_pointer address(const_reference x) const { return &x; }
-
-#ifdef USING_SGI_STL
- pool_allocator() { }
-#else
- pool_allocator() : allocator(GlobalPoolAllocator) { }
- pool_allocator(TPoolAllocator& a) : allocator(a) { }
- pool_allocator(const pool_allocator<T>& p) : allocator(p.allocator) { }
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER >= 1300
- template<class Other>
-#ifdef USING_SGI_STL
- pool_allocator(const pool_allocator<Other>& p) /*: allocator(p.getAllocator())*/ { }
-#else
- pool_allocator(const pool_allocator<Other>& p) : allocator(p.getAllocator()) { }
-#endif
-#endif
-
-#ifndef _WIN32
- template<class Other>
- pool_allocator(const pool_allocator<Other>& p) : allocator(p.getAllocator()) { }
-#endif
-
-#ifdef USING_SGI_STL
- static pointer allocate(size_type n) {
- return reinterpret_cast<pointer>(getAllocator().allocate(n)); }
- pointer allocate(size_type n, const void*) {
- return reinterpret_cast<pointer>(getAllocator().allocate(n)); }
-
- static void deallocate(void*, size_type) { }
- static void deallocate(pointer, size_type) { }
-#else
- pointer allocate(size_type n) {
- return reinterpret_cast<pointer>(getAllocator().allocate(n * sizeof(T))); }
- pointer allocate(size_type n, const void*) {
- return reinterpret_cast<pointer>(getAllocator().allocate(n * sizeof(T))); }
-
- void deallocate(void*, size_type) { }
- void deallocate(pointer, size_type) { }
-#endif
-
- pointer _Charalloc(size_t n) {
- return reinterpret_cast<pointer>(getAllocator().allocate(n)); }
-
- void construct(pointer p, const T& val) { new ((void *)p) T(val); }
- void destroy(pointer p) { p->T::~T(); }
-
- bool operator==(const pool_allocator& rhs) const { return &getAllocator() == &rhs.getAllocator(); }
- bool operator!=(const pool_allocator& rhs) const { return &getAllocator() != &rhs.getAllocator(); }
-
- size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
- size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
-
-#ifdef USING_SGI_STL
- //void setAllocator(TPoolAllocator* a) { allocator = a; }
- static TPoolAllocator& getAllocator() { return GlobalPoolAllocator; }
-#else
- void setAllocator(TPoolAllocator* a) { allocator = *a; }
- TPoolAllocator& getAllocator() const { return allocator; }
-
-protected:
- TPoolAllocator& allocator;
-#endif
-};
-
-#endif // _POOLALLOC_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ResourceLimits.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ResourceLimits.h
deleted file mode 100755
index ef24244c2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ResourceLimits.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef _RESOURCE_LIMITS_INCLUDED_
-#define _RESOURCE_LIMITS_INCLUDED_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct TBuiltInResource_ {
- int maxLights;
- int maxClipPlanes;
- int maxTextureUnits;
- int maxTextureCoords;
- int maxVertexAttribs;
- int maxVertexUniformComponents;
- int maxVaryingFloats;
- int maxVertexTextureImageUnits;
- int maxCombinedTextureImageUnits;
- int maxTextureImageUnits;
- int maxFragmentUniformComponents;
- int maxDrawBuffers;
-} TBuiltInResource;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _RESOURCE_LIMITS_INCLUDED_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ShHandle.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ShHandle.h
deleted file mode 100755
index 82c0314f3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/ShHandle.h
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _SHHANDLE_INCLUDED_
-#define _SHHANDLE_INCLUDED_
-
-//
-// Machine independent part of the compiler private objects
-// sent as ShHandle to the driver.
-//
-// This should not be included by driver code.
-//
-
-#define SH_EXPORTING
-#include "../Public/ShaderLangExt.h"
-#include "InfoSink.h"
-
-class TCompiler;
-class TLinker;
-class TUniformMap;
-namespace Lf {
- class TBindingList;
- class TLinker;
- class TLibrary;
-}
-
-//
-// The base class used to back handles returned to the driver.
-//
-class TShHandleBase {
-public:
- TShHandleBase() { }
- virtual ~TShHandleBase() { }
- virtual TCompiler* getAsCompiler() { return 0; }
- virtual TLinker* getAsLinker() { return 0; }
- virtual Lf::TLinker* getAsNewLinker() { return 0; }
- virtual TUniformMap* getAsUniformMap() { return 0; }
- virtual Lf::TBindingList* getAsBindingList() { return 0; }
- virtual Lf::TLibrary* getAsLibrary() { return 0; }
-};
-//
-// The base class for the machine dependent linker to derive from
-// for managing where uniforms live.
-//
-class TUniformMap : public TShHandleBase {
-public:
- TUniformMap() { }
- virtual ~TUniformMap() { }
- virtual TUniformMap* getAsUniformMap() { return this; }
- virtual int getLocation(const char* name) = 0;
- virtual TInfoSink& getInfoSink() { return infoSink; }
- TInfoSink infoSink;
-};
-
-class TIntermNode;
-
-//
-// The base class for the machine dependent compiler to derive from
-// for managing object code from the compile.
-//
-class TCompiler : public TShHandleBase {
-public:
- TCompiler(EShLanguage l, TInfoSink& sink) : infoSink(sink) , language(l), haveValidObjectCode(false) { }
- virtual ~TCompiler() { }
- EShLanguage getLanguage() { return language; }
- virtual TInfoSink& getInfoSink() { return infoSink; }
-
- virtual bool compile(TIntermNode* root) = 0;
-
- virtual TCompiler* getAsCompiler() { return this; }
- virtual bool linkable() { return haveValidObjectCode; }
-
- TInfoSink& infoSink;
-protected:
- EShLanguage language;
- bool haveValidObjectCode;
-};
-
-//
-// Link operations are base on a list of compile results...
-//
-typedef TVector<TCompiler*> TCompilerList;
-typedef TVector<TShHandleBase*> THandleList;
-
-//
-// The base class for the machine dependent linker to derive from
-// to manage the resulting executable.
-//
-
-class TLinker : public TShHandleBase {
-public:
- TLinker(EShExecutable e, TInfoSink& iSink) :
- infoSink(iSink),
- executable(e),
- haveReturnableObjectCode(false),
- appAttributeBindings(0),
- fixedAttributeBindings(0),
- excludedAttributes(0),
- excludedCount(0),
- uniformBindings(0) { }
- virtual TLinker* getAsLinker() { return this; }
- virtual ~TLinker() { }
- virtual bool link(TCompilerList&, TUniformMap*) = 0;
- virtual bool link(THandleList&) { return false; }
- virtual void setAppAttributeBindings(const ShBindingTable* t) { appAttributeBindings = t; }
- virtual void setFixedAttributeBindings(const ShBindingTable* t) { fixedAttributeBindings = t; }
- virtual void getAttributeBindings(ShBindingTable const **t) const = 0;
- virtual void setExcludedAttributes(const int* attributes, int count) { excludedAttributes = attributes; excludedCount = count; }
- virtual ShBindingTable* getUniformBindings() const { return uniformBindings; }
- virtual const void* getObjectCode() const { return 0; } // a real compiler would be returning object code here
- virtual TInfoSink& getInfoSink() { return infoSink; }
- TInfoSink& infoSink;
-protected:
- EShExecutable executable;
- bool haveReturnableObjectCode; // true when objectCode is acceptable to send to driver
-
- const ShBindingTable* appAttributeBindings;
- const ShBindingTable* fixedAttributeBindings;
- const int* excludedAttributes;
- int excludedCount;
- ShBindingTable* uniformBindings; // created by the linker
-};
-
-//
-// This is the interface between the machine independent code
-// and the machine dependent code.
-//
-// The machine dependent code should derive from the classes
-// above. Then Construct*() and Delete*() will create and
-// destroy the machine dependent objects, which contain the
-// above machine independent information.
-//
-TCompiler* ConstructCompiler(EShLanguage, int);
-
-TShHandleBase* ConstructLinker(EShExecutable, int);
-TShHandleBase* ConstructBindings();
-TShHandleBase* ConstructLibrary();
-void DeleteLinker(TShHandleBase*);
-
-TUniformMap* ConstructUniformMap();
-void DeleteCompiler(TCompiler*);
-
-void DeleteUniformMap(TUniformMap*);
-void freeTargetDependentData(void*);
-
-#endif // _SHHANDLE_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/Types.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/Types.h
deleted file mode 100755
index 9415879af..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/Types.h
+++ /dev/null
@@ -1,297 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _TYPES_INCLUDED
-#define _TYPES_INCLUDED
-
-#include "../Include/Common.h"
-#include "../Include/BaseTypes.h"
-
-//
-// Need to have association of line numbers to types in a list for building structs.
-//
-class TType;
-struct TTypeLine {
- TType* type;
- int line;
-};
-typedef TVector<TTypeLine> TTypeList;
-
-inline TTypeList* NewPoolTTypeList()
-{
- void* memory = GlobalPoolAllocator.allocate(sizeof(TTypeList));
- return new(memory) TTypeList;
-}
-
-//
-// This is a workaround for a problem with the yacc stack, It can't have
-// types that the compiler thinks non-trivial constructors. It should
-// just be used while recognizing the grammar, not anything else. Pointers
-// could be used, but also trying to avoid lots of memory management overhead.
-//
-// Not as bad as it looks, there is no actual assumption that the fields
-// match up or are name the same or anything like that.
-//
-class TPublicType {
-public:
- TBasicType type;
- TQualifier qualifier;
- int size; // size of vector or matrix, not size of array
- bool matrix;
- bool array;
- TType* userDef;
- int line;
-};
-
-typedef std::map<TTypeList*, TTypeList*> TStructureMap;
-typedef std::map<TTypeList*, TTypeList*>::iterator TStructureMapIterator;
-//
-// Base class for things that have a type.
-//
-class TType {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
- explicit TType(TBasicType t, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) :
- type(t), qualifier(q), size(s), matrix(m), array(a), arraySize(0), structure(0),
- structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), typeName(0), mangled(0)
- { }
- explicit TType(TPublicType p) :
- type(p.type), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(0),
- structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), typeName(0), mangled(0)
- {
- if (p.userDef) {
- structure = p.userDef->getStruct();
- structureSize = setStructSize(p.userDef->getStruct());
- typeName = NewPoolTString(p.userDef->getTypeName().c_str());
- }
- }
- explicit TType(TTypeList* userDef, TString n) :
- type(EbtStruct), qualifier(EvqTemporary), size(1), matrix(false), array(false), arraySize(0),
- structure(userDef), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0) {
- structureSize = setStructSize(userDef);
- typeName = NewPoolTString(n.c_str());
- }
- explicit TType() {}
- virtual ~TType() {}
-
- TType (const TType& type) { *this = type; }
-
- void copyType(const TType& copyOf, TStructureMap& remapper)
- {
- type = copyOf.type;
- qualifier = copyOf.qualifier;
- size = copyOf.size;
- matrix = copyOf.matrix;
- array = copyOf.array;
- arraySize = copyOf.arraySize;
-
- TStructureMapIterator iter;
- if (copyOf.structure) {
- if ((iter = remapper.find(structure)) == remapper.end()) {
- // create the new structure here
- structure = NewPoolTTypeList();
- for (unsigned int i = 0; i < copyOf.structure->size(); ++i) {
- TTypeLine typeLine;
- typeLine.line = (*copyOf.structure)[i].line;
- typeLine.type = (*copyOf.structure)[i].type->clone(remapper);
- structure->push_back(typeLine);
- }
- } else {
- structure = iter->second;
- }
- } else
- structure = 0;
-
- fieldName = 0;
- if (copyOf.fieldName)
- fieldName = NewPoolTString(copyOf.fieldName->c_str());
- typeName = 0;
- if (copyOf.typeName)
- typeName = NewPoolTString(copyOf.typeName->c_str());
-
- mangled = 0;
- if (copyOf.mangled)
- mangled = NewPoolTString(copyOf.mangled->c_str());
-
- structureSize = copyOf.structureSize;
- maxArraySize = copyOf.maxArraySize;
- assert (copyOf.arrayInformationType == 0);
- arrayInformationType = 0; // arrayInformationType should not be set for builtIn symbol table level
- }
-
- TType* clone(TStructureMap& remapper)
- {
- TType *newType = new TType();
- newType->copyType(*this, remapper);
-
- return newType;
- }
-
- int setStructSize(TTypeList* userDef)
- {
- int stSize = 0;
- for (TTypeList::iterator tl = userDef->begin(); tl != userDef->end(); tl++) {
- if (((*tl).type)->isArray()) {
- if (((*tl).type)->getStruct()) {
- int structSize = setStructSize(((*tl).type)->getStruct());
- stSize += structSize * ((*tl).type)->getArraySize();
- } else {
- stSize += ((*tl).type)->getInstanceSize() * ((*tl).type)->getArraySize();
- }
- } else if (((*tl).type)->isMatrix() || ((*tl).type)->isVector()){
- stSize += ((*tl).type)->getInstanceSize();
- } else if (((*tl).type)->getStruct()) {
- //?? We should actually be calling getStructSize() function and not setStructSize. This problem occurs in case
- // of nested/embedded structs.
- stSize += setStructSize(((*tl).type)->getStruct());
- } else
- stSize += 1;
- }
- structureSize = stSize;
- return stSize;
- }
-
- virtual void setType(TBasicType t, int s, bool m, bool a, int aS = 0)
- { type = t; size = s; matrix = m; array = a; arraySize = aS; }
- virtual void setType(TBasicType t, int s, bool m, TType* userDef = 0)
- { type = t;
- size = s;
- matrix = m;
- if (userDef)
- structure = userDef->getStruct();
- // leave array information intact.
- }
- virtual void setTypeName(const TString& n) { typeName = NewPoolTString(n.c_str()); }
- virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); }
- virtual const TString& getTypeName() const
- {
- assert (typeName);
- return *typeName;
- }
-
- virtual const TString& getFieldName() const
- {
- assert (fieldName);
- return *fieldName;
- }
-
- virtual TBasicType getBasicType() const { return type; }
- virtual TQualifier getQualifier() const { return qualifier; }
- virtual void changeQualifier(TQualifier q) { qualifier = q; }
-
- // One-dimensional size of single instance type
- virtual int getNominalSize() const { return size; }
-
- // Full-dimensional size of single instance of type
- virtual int getInstanceSize() const
- {
- if (matrix)
- return size * size;
- else
- return size;
- }
-
- virtual bool isMatrix() const { return matrix ? true : false; }
- virtual bool isArray() const { return array ? true : false; }
- int getArraySize() const { return arraySize; }
- void setArraySize(int s) { array = true; arraySize = s; }
- void setMaxArraySize (int s) { maxArraySize = s; }
- int getMaxArraySize () const { return maxArraySize; }
- void setArrayInformationType(TType* t) { arrayInformationType = t; }
- TType* getArrayInformationType() { return arrayInformationType; }
- virtual bool isVector() const { return size > 1 && !matrix; }
- static char* getBasicString(TBasicType t) {
- switch (t) {
- case EbtVoid: return "void"; break;
- case EbtFloat: return "float"; break;
- case EbtInt: return "int"; break;
- case EbtBool: return "bool"; break;
- case EbtSampler1D: return "sampler1D"; break;
- case EbtSampler2D: return "sampler2D"; break;
- case EbtSampler3D: return "sampler3D"; break;
- case EbtSamplerCube: return "samplerCube"; break;
- case EbtSampler1DShadow: return "sampler1DShadow"; break;
- case EbtSampler2DShadow: return "sampler2DShadow"; break;
- case EbtStruct: return "structure"; break;
- default: return "unknown type";
- }
- }
- const char* getBasicString() const { return TType::getBasicString(type); }
- const char* getQualifierString() const { return ::getQualifierString(qualifier); }
- TTypeList* getStruct() { return structure; }
- int getStructSize() const { return structureSize; }
- TTypeList* getStruct() const { return structure; }
- TString& getMangledName() {
- if (!mangled) {
- mangled = NewPoolTString("");
- buildMangledName(*mangled);
- *mangled+=';';
- }
-
- return *mangled;
- }
- bool operator==(const TType& right) const {
- return type == right.type &&
- size == right.size &&
- matrix == right.matrix &&
- array == right.array &&
- structure == right.structure;
- // don't check the qualifier, it's not ever what's being sought after
- }
- bool operator!=(const TType& right) const {
- return !operator==(right);
- }
- TString getCompleteString() const;
-
-protected:
- void buildMangledName(TString&);
-
- TBasicType type : 6;
- TQualifier qualifier : 7;
- int size : 8; // size of vector or matrix, not size of array
- unsigned int matrix : 1;
- unsigned int array : 1;
-
- int arraySize;
- TTypeList* structure; // 0 unless this is a struct
- int structureSize;
- int maxArraySize;
- TType* arrayInformationType;
- TString *fieldName; // for structure field names
- TString *typeName; // for structure field type name
- TString *mangled;
-
-};
-
-#endif // _TYPES_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/intermediate.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/intermediate.h
deleted file mode 100755
index 13e22c274..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Include/intermediate.h
+++ /dev/null
@@ -1,516 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Definition of the in-memory high-level intermediate representation
-// of shaders. This is a tree that parser creates.
-//
-// Nodes in the tree are defined as a hierarchy of classes derived from
-// TIntermNode. Each is a node in a tree. There is no preset branching factor;
-// each node can have it's own type of list of children.
-//
-
-#ifndef __INTERMEDIATE_H
-#define __INTERMEDIATE_H
-
-#include "../Include/Common.h"
-#include "../Include/Types.h"
-#include "../Include/ConstantUnion.h"
-
-//
-// Operators used by the high-level (parse tree) representation.
-//
-enum TOperator {
- EOpNull, // if in a node, should only mean a node is still being built
- EOpSequence, // denotes a list of statements, or parameters, etc.
- EOpFunctionCall,
- EOpFunction, // For function definition
- EOpParameters, // an aggregate listing the parameters to a function
-
- //
- // Unary operators
- //
-
- EOpNegative,
- EOpLogicalNot,
- EOpVectorLogicalNot,
- EOpBitwiseNot,
-
- EOpPostIncrement,
- EOpPostDecrement,
- EOpPreIncrement,
- EOpPreDecrement,
-
- EOpConvIntToBool,
- EOpConvFloatToBool,
- EOpConvBoolToFloat,
- EOpConvIntToFloat,
- EOpConvFloatToInt,
- EOpConvBoolToInt,
-
- //
- // binary operations
- //
-
- EOpAdd,
- EOpSub,
- EOpMul,
- EOpDiv,
- EOpMod,
- EOpRightShift,
- EOpLeftShift,
- EOpAnd,
- EOpInclusiveOr,
- EOpExclusiveOr,
- EOpEqual,
- EOpNotEqual,
- EOpVectorEqual,
- EOpVectorNotEqual,
- EOpLessThan,
- EOpGreaterThan,
- EOpLessThanEqual,
- EOpGreaterThanEqual,
- EOpComma,
-
- EOpVectorTimesScalar,
- EOpVectorTimesMatrix,
- EOpMatrixTimesVector,
- EOpMatrixTimesScalar,
-
- EOpLogicalOr,
- EOpLogicalXor,
- EOpLogicalAnd,
-
- EOpIndexDirect,
- EOpIndexIndirect,
- EOpIndexDirectStruct,
-
- EOpVectorSwizzle,
-
- //
- // Built-in functions potentially mapped to operators
- //
-
- EOpRadians,
- EOpDegrees,
- EOpSin,
- EOpCos,
- EOpTan,
- EOpAsin,
- EOpAcos,
- EOpAtan,
-
- EOpPow,
- EOpExp,
- EOpLog,
- EOpExp2,
- EOpLog2,
- EOpSqrt,
- EOpInverseSqrt,
-
- EOpAbs,
- EOpSign,
- EOpFloor,
- EOpCeil,
- EOpFract,
- EOpMin,
- EOpMax,
- EOpClamp,
- EOpMix,
- EOpStep,
- EOpSmoothStep,
-
- EOpLength,
- EOpDistance,
- EOpDot,
- EOpCross,
- EOpNormalize,
- EOpFaceForward,
- EOpReflect,
- EOpRefract,
-
- EOpDPdx, // Fragment only
- EOpDPdy, // Fragment only
- EOpFwidth, // Fragment only
-
- EOpMatrixTimesMatrix,
-
- EOpAny,
- EOpAll,
-
- EOpItof, // pack/unpack only
- EOpFtoi, // pack/unpack only
- EOpSkipPixels, // pack/unpack only
- EOpReadInput, // unpack only
- EOpWritePixel, // unpack only
- EOpBitmapLsb, // unpack only
- EOpBitmapMsb, // unpack only
- EOpWriteOutput, // pack only
- EOpReadPixel, // pack only
-
- //
- // Branch
- //
-
- EOpKill, // Fragment only
- EOpReturn,
- EOpBreak,
- EOpContinue,
-
- //
- // Constructors
- //
-
- EOpConstructInt,
- EOpConstructBool,
- EOpConstructFloat,
- EOpConstructVec2,
- EOpConstructVec3,
- EOpConstructVec4,
- EOpConstructBVec2,
- EOpConstructBVec3,
- EOpConstructBVec4,
- EOpConstructIVec2,
- EOpConstructIVec3,
- EOpConstructIVec4,
- EOpConstructMat2,
- EOpConstructMat3,
- EOpConstructMat4,
- EOpConstructStruct,
-
- //
- // moves
- //
-
- EOpAssign,
- EOpAddAssign,
- EOpSubAssign,
- EOpMulAssign,
- EOpVectorTimesMatrixAssign,
- EOpVectorTimesScalarAssign,
- EOpMatrixTimesScalarAssign,
- EOpMatrixTimesMatrixAssign,
- EOpDivAssign,
- EOpModAssign,
- EOpAndAssign,
- EOpInclusiveOrAssign,
- EOpExclusiveOrAssign,
- EOpLeftShiftAssign,
- EOpRightShiftAssign
-};
-
-class TIntermTraverser;
-class TIntermAggregate;
-class TIntermBinary;
-class TIntermConstantUnion;
-class TIntermSelection;
-class TIntermTyped;
-class TIntermSymbol;
-class TInfoSink;
-
-//
-// Base class for the tree nodes
-//
-class TIntermNode {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
-
- TIntermNode() : line(0) {}
- virtual TSourceLoc getLine() const { return line; }
- virtual void setLine(TSourceLoc l) { line = l; }
- virtual void traverse(TIntermTraverser*) = 0;
- virtual TIntermTyped* getAsTyped() { return 0; }
- virtual TIntermConstantUnion* getAsConstantUnion() { return 0; }
- virtual TIntermAggregate* getAsAggregate() { return 0; }
- virtual TIntermBinary* getAsBinaryNode() { return 0; }
- virtual TIntermSelection* getAsSelectionNode() { return 0; }
- virtual TIntermSymbol* getAsSymbolNode() { return 0; }
- virtual ~TIntermNode() { }
-protected:
- TSourceLoc line;
-};
-
-//
-// This is just to help yacc.
-//
-struct TIntermNodePair {
- TIntermNode* node1;
- TIntermNode* node2;
-};
-
-class TIntermSymbol;
-class TIntermBinary;
-
-//
-// Intermediate class for nodes that have a type.
-//
-class TIntermTyped : public TIntermNode {
-public:
- TIntermTyped(const TType& t) : type(t) { }
- virtual TIntermTyped* getAsTyped() { return this; }
- virtual void setType(const TType& t) { type = t; }
- virtual TType getType() const { return type; }
- virtual TType* getTypePointer() { return &type; }
-
- virtual TBasicType getBasicType() const { return type.getBasicType(); }
- virtual TQualifier getQualifier() const { return type.getQualifier(); }
- virtual int getNominalSize() const { return type.getNominalSize(); }
- virtual int getSize() const { return type.getInstanceSize(); }
- virtual bool isMatrix() const { return type.isMatrix(); }
- virtual bool isArray() const { return type.isArray(); }
- virtual bool isVector() const { return type.isVector(); }
- const char* getBasicString() const { return type.getBasicString(); }
- const char* getQualifierString() const { return type.getQualifierString(); }
- TString getCompleteString() const { return type.getCompleteString(); }
-
-protected:
- TType type;
-};
-
-//
-// Handle for, do-while, and while loops.
-//
-class TIntermLoop : public TIntermNode {
-public:
- TIntermLoop(TIntermNode* aBody, TIntermTyped* aTest, TIntermTyped* aTerminal, bool testFirst) :
- body(aBody),
- test(aTest),
- terminal(aTerminal),
- first(testFirst) { }
- virtual void traverse(TIntermTraverser*);
- TIntermNode* getBody() { return body; }
- TIntermTyped* getTest() { return test; }
- TIntermTyped* getTerminal() { return terminal; }
- bool testFirst() { return first; }
-protected:
- TIntermNode* body; // code to loop over
- TIntermTyped* test; // exit condition associated with loop, could be 0 for 'for' loops
- TIntermTyped* terminal; // exists for for-loops
- bool first; // true for while and for, not for do-while
-};
-
-//
-// Handle break, continue, return, and kill.
-//
-class TIntermBranch : public TIntermNode {
-public:
- TIntermBranch(TOperator op, TIntermTyped* e) :
- flowOp(op),
- expression(e) { }
- virtual void traverse(TIntermTraverser*);
- TOperator getFlowOp() { return flowOp; }
- TIntermTyped* getExpression() { return expression; }
-protected:
- TOperator flowOp;
- TIntermTyped* expression; // non-zero except for "return exp;" statements
-};
-
-//
-// Nodes that correspond to symbols or constants in the source code.
-//
-class TIntermSymbol : public TIntermTyped {
-public:
- // if symbol is initialized as symbol(sym), the memory comes from the poolallocator of sym. If sym comes from
- // per process globalpoolallocator, then it causes increased memory usage per compile
- // it is essential to use "symbol = sym" to assign to symbol
- TIntermSymbol(int i, const TString& sym, const TType& t) :
- TIntermTyped(t), id(i) { symbol = sym;}
- virtual int getId() const { return id; }
- virtual const TString& getSymbol() const { return symbol; }
- virtual void traverse(TIntermTraverser*);
- virtual TIntermSymbol* getAsSymbolNode() { return this; }
-protected:
- int id;
- TString symbol;
-};
-
-class TIntermConstantUnion : public TIntermTyped {
-public:
- TIntermConstantUnion(constUnion *unionPointer, const TType& t) : TIntermTyped(t), unionArrayPointer(unionPointer) { }
- constUnion* getUnionArrayPointer() const { return unionArrayPointer; }
- void setUnionArrayPointer(constUnion *c) { unionArrayPointer = c; }
- virtual TIntermConstantUnion* getAsConstantUnion() { return this; }
- virtual void traverse(TIntermTraverser* );
- virtual TIntermTyped* fold(TOperator, TIntermTyped*, TInfoSink&, bool);
-protected:
- constUnion *unionArrayPointer;
-};
-
-//
-// Intermediate class for node types that hold operators.
-//
-class TIntermOperator : public TIntermTyped {
-public:
- TOperator getOp() { return op; }
- bool modifiesState() const;
- bool isConstructor() const;
- virtual bool promote(TInfoSink&) { return true; }
-protected:
- TIntermOperator(TOperator o) : TIntermTyped(TType(EbtFloat)), op(o) {}
- TIntermOperator(TOperator o, TType& t) : TIntermTyped(t), op(o) {}
- TOperator op;
-};
-
-//
-// Nodes for all the basic binary math operators.
-//
-class TIntermBinary : public TIntermOperator {
-public:
- TIntermBinary(TOperator o) : TIntermOperator(o) {}
- virtual void traverse(TIntermTraverser*);
- virtual void setLeft(TIntermTyped* n) { left = n; }
- virtual void setRight(TIntermTyped* n) { right = n; }
- virtual TIntermTyped* getLeft() const { return left; }
- virtual TIntermTyped* getRight() const { return right; }
- virtual TIntermBinary* getAsBinaryNode() { return this; }
- virtual bool promote(TInfoSink&);
-protected:
- TIntermTyped* left;
- TIntermTyped* right;
-};
-
-//
-// Nodes for unary math operators.
-//
-class TIntermUnary : public TIntermOperator {
-public:
- TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0) {}
- TIntermUnary(TOperator o) : TIntermOperator(o), operand(0) {}
- virtual void traverse(TIntermTraverser*);
- virtual void setOperand(TIntermTyped* o) { operand = o; }
- virtual TIntermTyped* getOperand() { return operand; }
- virtual bool promote(TInfoSink&);
-protected:
- TIntermTyped* operand;
-};
-
-typedef TVector<TIntermNode*> TIntermSequence;
-typedef TVector<int> TQualifierList;
-//
-// Nodes that operate on an arbitrary sized set of children.
-//
-class TIntermAggregate : public TIntermOperator {
-public:
- TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { }
- TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
- ~TIntermAggregate() { delete pragmaTable; }
- virtual TIntermAggregate* getAsAggregate() { return this; }
- virtual void setOperator(TOperator o) { op = o; }
- virtual TIntermSequence& getSequence() { return sequence; }
- virtual void setName(const TString& n) { name = n; }
- virtual const TString& getName() const { return name; }
- virtual void traverse(TIntermTraverser*);
- virtual void setUserDefined() { userDefined = true; }
- virtual bool isUserDefined() { return userDefined; }
- virtual TQualifierList& getQualifier() { return qualifier; }
- void setOptimize(bool o) { optimize = o; }
- void setDebug(bool d) { debug = d; }
- bool getOptimize() { return optimize; }
- bool getDebug() { return debug; }
- void addToPragmaTable(const TPragmaTable& pTable);
- const TPragmaTable& getPragmaTable() const { return *pragmaTable; }
-protected:
- TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
- TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
- TIntermSequence sequence;
- TQualifierList qualifier;
- TString name;
- bool userDefined; // used for user defined function names
- bool optimize;
- bool debug;
- TPragmaTable *pragmaTable;
-};
-
-//
-// For if tests. Simplified since there is no switch statement.
-//
-class TIntermSelection : public TIntermTyped {
-public:
- TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) :
- TIntermTyped(TType(EbtVoid)), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
- TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) :
- TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
- virtual void traverse(TIntermTraverser*);
- virtual TIntermNode* getCondition() const { return condition; }
- virtual TIntermNode* getTrueBlock() const { return trueBlock; }
- virtual TIntermNode* getFalseBlock() const { return falseBlock; }
- virtual TIntermSelection* getAsSelectionNode() { return this; }
-protected:
- TIntermTyped* condition;
- TIntermNode* trueBlock;
- TIntermNode* falseBlock;
-};
-
-//
-// For traversing the tree. User should derive from this,
-// put their traversal specific data in it, and then pass
-// it to a Traverse method.
-//
-// When using this, just fill in the methods for nodes you want visited.
-// Return false from a pre-visit to skip visiting that node's subtree.
-//
-class TIntermTraverser {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
-
- TIntermTraverser() :
- visitSymbol(0),
- visitConstantUnion(0),
- visitBinary(0),
- visitUnary(0),
- visitSelection(0),
- visitAggregate(0),
- visitLoop(0),
- visitBranch(0),
- depth(0),
- preVisit(true),
- postVisit(false),
- rightToLeft(false) {}
-
- void (*visitSymbol)(TIntermSymbol*, TIntermTraverser*);
- void (*visitConstantUnion)(TIntermConstantUnion*, TIntermTraverser*);
- bool (*visitBinary)(bool preVisit, TIntermBinary*, TIntermTraverser*);
- bool (*visitUnary)(bool preVisit, TIntermUnary*, TIntermTraverser*);
- bool (*visitSelection)(bool preVisit, TIntermSelection*, TIntermTraverser*);
- bool (*visitAggregate)(bool preVisit, TIntermAggregate*, TIntermTraverser*);
- bool (*visitLoop)(bool preVisit, TIntermLoop*, TIntermTraverser*);
- bool (*visitBranch)(bool preVisit, TIntermBranch*, TIntermTraverser*);
-
- int depth;
- bool preVisit;
- bool postVisit;
- bool rightToLeft;
-};
-
-#endif // __INTERMEDIATE_H
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp
deleted file mode 100755
index 3b741048d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp
+++ /dev/null
@@ -1,2942 +0,0 @@
-#line 2 "Gen_glslang.cpp"
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /cvs/xorg/xc/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang.cpp,v 1.1.1.1 2005/07/31 16:46:33 ajax Exp $
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-#include <unistd.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif /* __STDC__ */
-#endif /* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
- };
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-
-#define yywrap() 1
-#define YY_SKIP_YYWRAP
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 144
-#define YY_END_OF_BUFFER 145
-static yyconst short int yy_accept[428] =
- { 0,
- 0, 0, 0, 0, 145, 143, 142, 142, 127, 133,
- 138, 122, 123, 131, 130, 119, 128, 126, 132, 143,
- 143, 120, 116, 134, 121, 135, 139, 143, 124, 125,
- 137, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 143, 117, 136, 118, 129, 141, 144, 143, 143, 113,
- 99, 118, 107, 102, 97, 105, 95, 106, 96, 0,
- 94, 0, 98, 90, 0, 0, 0, 125, 117, 124,
- 114, 110, 112, 111, 115, 86, 103, 109, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 11, 13, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 104, 108, 140,
- 93, 0, 1, 92, 0, 0, 88, 89, 0, 100,
- 101, 0, 0, 43, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 9, 0, 0, 0, 0, 0, 0, 0, 17,
- 0, 0, 0, 0, 0, 14, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 87, 86, 0, 19, 0, 0,
- 83, 0, 0, 0, 0, 0, 0, 0, 12, 46,
- 0, 0, 0, 0, 0, 51, 65, 0, 0, 0,
- 0, 0, 0, 62, 24, 25, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 49, 20, 0, 0, 0, 0, 0, 0, 27, 28,
- 29, 18, 0, 0, 140, 0, 0, 92, 0, 0,
- 0, 0, 6, 33, 34, 35, 44, 3, 0, 0,
- 0, 0, 76, 77, 78, 0, 21, 66, 16, 73,
-
- 74, 75, 70, 71, 72, 0, 15, 68, 0, 30,
- 31, 32, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 45, 0, 85,
- 0, 0, 10, 0, 0, 91, 0, 0, 0, 0,
- 64, 59, 54, 0, 0, 0, 69, 50, 57, 23,
- 0, 82, 58, 42, 52, 0, 0, 0, 0, 0,
- 0, 93, 92, 0, 0, 53, 22, 0, 0, 0,
- 0, 0, 0, 47, 4, 0, 5, 0, 0, 7,
- 60, 0, 0, 55, 0, 0, 0, 0, 48, 67,
- 56, 2, 61, 84, 36, 37, 38, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 39, 0, 0,
- 0, 0, 0, 79, 0, 80, 0, 0, 0, 40,
- 0, 41, 0, 0, 0, 81, 0
- } ;
-
-static yyconst int yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 5, 1, 1, 1, 6, 7, 1, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 21, 21, 22, 22, 23, 24, 25,
- 26, 27, 28, 1, 29, 29, 30, 31, 32, 29,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
- 37, 1, 38, 39, 33, 1, 40, 41, 42, 43,
-
- 44, 45, 46, 47, 48, 33, 49, 50, 51, 52,
- 53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst int yy_meta[68] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- 2, 2, 1, 1, 1, 1, 1, 1, 2, 2,
- 2, 2, 3, 3, 3, 3, 1, 1, 1, 2,
- 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 1, 1, 1, 1
- } ;
-
-static yyconst short int yy_base[432] =
- { 0,
- 0, 0, 67, 0, 678, 679, 679, 679, 651, 109,
- 130, 679, 679, 650, 127, 679, 126, 124, 139, 151,
- 671, 647, 679, 151, 647, 121, 679, 668, 679, 679,
- 124, 147, 154, 155, 158, 171, 174, 157, 156, 184,
- 175, 160, 178, 162, 176, 181, 190, 197, 193, 195,
- 179, 679, 193, 679, 679, 679, 679, 656, 666, 679,
- 679, 679, 679, 679, 679, 679, 679, 679, 679, 665,
- 679, 665, 679, 246, 663, 662, 0, 679, 679, 679,
- 639, 679, 679, 679, 638, 253, 679, 679, 612, 605,
- 608, 616, 615, 602, 617, 604, 610, 598, 595, 608,
-
- 595, 592, 592, 598, 586, 593, 590, 600, 586, 592,
- 597, 679, 136, 596, 587, 581, 586, 588, 578, 592,
- 592, 575, 580, 577, 566, 200, 580, 576, 578, 567,
- 570, 136, 575, 567, 579, 203, 572, 679, 679, 263,
- 275, 616, 679, 282, 614, 311, 318, 325, 613, 679,
- 679, 612, 611, 679, 559, 563, 572, 569, 553, 553,
- 200, 568, 565, 565, 563, 560, 552, 558, 545, 556,
- 559, 679, 556, 544, 551, 553, 546, 535, 534, 547,
- 548, 543, 268, 544, 535, 532, 536, 534, 525, 528,
- 526, 536, 522, 520, 520, 522, 519, 530, 529, 201,
-
- 524, 519, 508, 290, 526, 528, 517, 562, 561, 337,
- 560, 349, 356, 559, 0, 363, 514, 679, 512, 293,
- 679, 504, 502, 510, 499, 516, 505, 297, 679, 679,
- 499, 509, 509, 494, 368, 679, 679, 371, 498, 492,
- 491, 492, 374, 679, 679, 679, 679, 490, 495, 486,
- 499, 494, 486, 490, 482, 485, 489, 494, 493, 484,
- 679, 679, 490, 479, 479, 484, 483, 480, 679, 679,
- 679, 679, 470, 482, 379, 386, 521, 393, 400, 520,
- 422, 482, 679, 679, 679, 679, 679, 679, 470, 471,
- 465, 475, 679, 679, 679, 466, 679, 679, 679, 679,
-
- 679, 679, 679, 679, 679, 473, 679, 679, 471, 679,
- 679, 679, 461, 466, 456, 469, 469, 458, 465, 679,
- 463, 465, 449, 458, 464, 459, 447, 679, 449, 679,
- 448, 451, 679, 429, 448, 679, 440, 439, 439, 452,
- 679, 454, 679, 453, 452, 439, 679, 679, 679, 679,
- 435, 679, 679, 679, 679, 432, 443, 436, 442, 439,
- 434, 679, 679, 426, 438, 679, 679, 431, 438, 437,
- 419, 441, 418, 679, 679, 418, 679, 413, 412, 679,
- 679, 411, 410, 679, 422, 405, 404, 376, 679, 679,
- 679, 679, 679, 679, 397, 242, 397, 389, 382, 384,
-
- 380, 380, 379, 324, 321, 321, 310, 679, 308, 292,
- 282, 266, 268, 285, 265, 679, 246, 258, 229, 679,
- 221, 679, 199, 145, 131, 679, 679, 471, 179, 473,
- 475
- } ;
-
-static yyconst short int yy_def[432] =
- { 0,
- 427, 1, 427, 3, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 428, 427, 427, 427, 427, 429, 427, 427, 427,
- 427, 427, 427, 427, 427, 430, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
-
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 431,
- 427, 428, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
-
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 429, 430, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 431, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
-
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
-
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 0, 427, 427, 427,
- 427
- } ;
-
-static yyconst short int yy_nxt[747] =
- { 0,
- 6, 7, 8, 7, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 21, 21, 21,
- 21, 21, 22, 23, 24, 25, 26, 27, 28, 28,
- 28, 28, 28, 28, 28, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 28, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 28, 28, 28, 52, 53, 54, 55, 6, 56, 57,
- 56, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 58, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 59, 59, 59, 59, 59,
-
- 59, 59, 59, 6, 6, 6, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 6, 6, 6, 6, 61, 62, 63, 66, 68, 70,
- 70, 70, 70, 70, 70, 70, 84, 85, 71, 87,
- 86, 69, 67, 72, 74, 64, 79, 86, 86, 86,
- 86, 86, 88, 86, 73, 86, 75, 75, 75, 75,
- 75, 75, 76, 80, 86, 81, 82, 86, 86, 86,
- 149, 86, 86, 200, 86, 177, 77, 86, 178, 179,
- 426, 201, 180, 86, 94, 110, 86, 425, 86, 116,
-
- 86, 97, 89, 90, 95, 98, 91, 96, 92, 109,
- 99, 77, 93, 104, 111, 120, 100, 117, 138, 119,
- 101, 105, 102, 106, 122, 137, 107, 115, 112, 123,
- 118, 103, 108, 121, 134, 113, 124, 125, 135, 193,
- 128, 424, 114, 129, 132, 264, 126, 136, 133, 127,
- 205, 130, 206, 265, 194, 223, 224, 139, 131, 144,
- 423, 145, 145, 145, 145, 145, 145, 145, 152, 152,
- 152, 152, 152, 152, 152, 400, 401, 146, 208, 208,
- 208, 208, 208, 208, 208, 245, 246, 247, 422, 146,
- 70, 70, 70, 70, 70, 70, 70, 211, 211, 211,
-
- 211, 211, 211, 211, 421, 420, 210, 269, 270, 271,
- 284, 285, 286, 212, 293, 294, 295, 419, 210, 418,
- 417, 213, 416, 213, 415, 212, 214, 214, 214, 214,
- 214, 214, 214, 75, 75, 75, 75, 75, 75, 76,
- 76, 76, 76, 76, 76, 76, 76, 276, 414, 276,
- 413, 412, 277, 277, 277, 277, 277, 277, 277, 279,
- 411, 279, 410, 409, 280, 280, 280, 280, 280, 280,
- 280, 214, 214, 214, 214, 214, 214, 214, 152, 152,
- 152, 152, 152, 152, 152, 300, 301, 302, 303, 304,
- 305, 310, 311, 312, 208, 208, 208, 208, 208, 208,
-
- 208, 277, 277, 277, 277, 277, 277, 277, 211, 211,
- 211, 211, 211, 211, 211, 280, 280, 280, 280, 280,
- 280, 280, 408, 407, 212, 336, 406, 405, 404, 403,
- 402, 399, 362, 398, 397, 396, 212, 214, 214, 214,
- 214, 214, 214, 214, 277, 277, 277, 277, 277, 277,
- 277, 363, 395, 394, 393, 392, 391, 385, 386, 387,
- 390, 389, 384, 280, 280, 280, 280, 280, 280, 280,
- 388, 142, 142, 142, 153, 153, 209, 209, 383, 382,
- 381, 380, 379, 378, 377, 376, 375, 374, 373, 372,
- 371, 370, 369, 368, 367, 366, 365, 364, 361, 360,
-
- 359, 358, 357, 356, 355, 354, 353, 352, 351, 350,
- 349, 348, 347, 346, 345, 344, 343, 342, 341, 340,
- 339, 338, 337, 335, 334, 333, 332, 331, 330, 329,
- 328, 327, 326, 325, 324, 323, 322, 321, 320, 319,
- 318, 317, 316, 315, 314, 313, 309, 308, 307, 306,
- 299, 298, 297, 296, 292, 291, 290, 289, 288, 287,
- 283, 282, 281, 278, 275, 275, 274, 273, 272, 268,
- 267, 266, 263, 262, 261, 260, 259, 258, 257, 256,
- 255, 254, 253, 252, 251, 250, 249, 248, 244, 243,
- 242, 241, 240, 239, 238, 237, 236, 235, 234, 233,
-
- 232, 231, 230, 229, 228, 227, 226, 225, 222, 221,
- 220, 219, 218, 217, 216, 216, 215, 74, 143, 207,
- 204, 203, 202, 199, 198, 197, 196, 195, 192, 191,
- 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
- 176, 175, 174, 173, 172, 171, 170, 169, 168, 167,
- 166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
- 156, 155, 154, 151, 150, 148, 147, 143, 141, 140,
- 72, 86, 83, 78, 74, 65, 60, 427, 5, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
-
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427
- } ;
-
-static yyconst short int yy_chk[747] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 10, 10, 11, 15, 17, 18,
- 18, 18, 18, 18, 18, 18, 26, 26, 19, 31,
- 32, 17, 15, 19, 20, 11, 24, 33, 34, 39,
- 38, 35, 31, 42, 19, 44, 20, 20, 20, 20,
- 20, 20, 20, 24, 36, 24, 24, 37, 41, 45,
- 429, 43, 51, 132, 46, 113, 20, 40, 113, 113,
- 425, 132, 113, 47, 34, 39, 49, 424, 50, 42,
-
- 48, 35, 32, 32, 34, 35, 33, 34, 33, 38,
- 35, 20, 33, 37, 39, 45, 35, 43, 53, 44,
- 36, 37, 36, 37, 46, 51, 37, 41, 40, 47,
- 43, 36, 37, 45, 50, 40, 47, 47, 50, 126,
- 48, 423, 40, 48, 49, 200, 47, 50, 49, 47,
- 136, 48, 136, 200, 126, 161, 161, 53, 48, 74,
- 421, 74, 74, 74, 74, 74, 74, 74, 86, 86,
- 86, 86, 86, 86, 86, 396, 396, 74, 140, 140,
- 140, 140, 140, 140, 140, 183, 183, 183, 419, 74,
- 141, 141, 141, 141, 141, 141, 141, 144, 144, 144,
-
- 144, 144, 144, 144, 418, 417, 141, 204, 204, 204,
- 220, 220, 220, 144, 228, 228, 228, 415, 141, 414,
- 413, 146, 412, 146, 411, 144, 146, 146, 146, 146,
- 146, 146, 146, 147, 147, 147, 147, 147, 147, 147,
- 148, 148, 148, 148, 148, 148, 148, 210, 410, 210,
- 409, 407, 210, 210, 210, 210, 210, 210, 210, 212,
- 406, 212, 405, 404, 212, 212, 212, 212, 212, 212,
- 212, 213, 213, 213, 213, 213, 213, 213, 216, 216,
- 216, 216, 216, 216, 216, 235, 235, 235, 238, 238,
- 238, 243, 243, 243, 275, 275, 275, 275, 275, 275,
-
- 275, 276, 276, 276, 276, 276, 276, 276, 278, 278,
- 278, 278, 278, 278, 278, 279, 279, 279, 279, 279,
- 279, 279, 403, 402, 278, 281, 401, 400, 399, 398,
- 397, 395, 334, 388, 387, 386, 278, 281, 281, 281,
- 281, 281, 281, 281, 334, 334, 334, 334, 334, 334,
- 334, 335, 385, 383, 382, 379, 378, 372, 372, 372,
- 376, 373, 371, 335, 335, 335, 335, 335, 335, 335,
- 372, 428, 428, 428, 430, 430, 431, 431, 370, 369,
- 368, 365, 364, 361, 360, 359, 358, 357, 356, 351,
- 346, 345, 344, 342, 340, 339, 338, 337, 332, 331,
-
- 329, 327, 326, 325, 324, 323, 322, 321, 319, 318,
- 317, 316, 315, 314, 313, 309, 306, 296, 292, 291,
- 290, 289, 282, 280, 277, 274, 273, 268, 267, 266,
- 265, 264, 263, 260, 259, 258, 257, 256, 255, 254,
- 253, 252, 251, 250, 249, 248, 242, 241, 240, 239,
- 234, 233, 232, 231, 227, 226, 225, 224, 223, 222,
- 219, 217, 214, 211, 209, 208, 207, 206, 205, 203,
- 202, 201, 199, 198, 197, 196, 195, 194, 193, 192,
- 191, 190, 189, 188, 187, 186, 185, 184, 182, 181,
- 180, 179, 178, 177, 176, 175, 174, 173, 171, 170,
-
- 169, 168, 167, 166, 165, 164, 163, 162, 160, 159,
- 158, 157, 156, 155, 153, 152, 149, 145, 142, 137,
- 135, 134, 133, 131, 130, 129, 128, 127, 125, 124,
- 123, 122, 121, 120, 119, 118, 117, 116, 115, 114,
- 111, 110, 109, 108, 107, 106, 105, 104, 103, 102,
- 101, 100, 99, 98, 97, 96, 95, 94, 93, 92,
- 91, 90, 89, 85, 81, 76, 75, 72, 70, 59,
- 58, 28, 25, 22, 21, 14, 9, 5, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
-
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
- 427, 427, 427, 427, 427, 427
- } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "glslang.l"
-#define INITIAL 0
-/*
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-*/
-/* Based on
-ANSI C grammar, Lex specification
-
-In 1985, Jeff Lee published this Lex specification together with a Yacc
-grammar for the April 30, 1985 ANSI C draft. Tom Stockfisch reposted
-both to net.sources in 1987; that original, as mentioned in the answer
-to question 17.25 of the comp.lang.c FAQ, can be ftp'ed from ftp.uu.net,
-file usenet/net.sources/ansi.c.grammar.Z.
-
-I intend to keep this version as close to the current C Standard grammar
-as possible; please let me know if you discover discrepancies.
-
-Jutta Degener, 1995
-*/
-#define YY_NO_UNPUT 1
-#line 59 "glslang.l"
-#include <stdio.h>
-#include <stdlib.h>
-#include "ParseHelper.h"
-#include "glslang_tab.h"
-
-/* windows only pragma */
-#ifdef _MSC_VER
-#pragma warning(disable : 4102)
-#endif
-
-int yy_input(char* buf, int max_size);
-TSourceLoc yylineno;
-
-#ifdef _WIN32
- extern int yyparse(TParseContext&);
- #define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
-#else
- extern int yyparse(void*);
- #define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
- #define parseContext (*((TParseContext*)(parseContextLocal)))
-#endif
-
-#define YY_INPUT(buf,result,max_size) (result = yy_input(buf, max_size))
-
-#define YY_NEVER_INTERACTIVE 1
-#define FIELDS 1
-
-#line 753 "Gen_glslang.cpp"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
- { \
- int c = '*', n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-YY_DECL
- {
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
-
-#line 91 "glslang.l"
-
-#line 906 "Gen_glslang.cpp"
-
- if ( yy_init )
- {
- yy_init = 0;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_load_buffer_state();
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 428 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 679 );
-
-yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-
-do_action: /* This label is used only to access EOF actions. */
-
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 92 "glslang.l"
-{ /* ?? carriage and/or line-feed? */ };
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 94 "glslang.l"
-{ pyylval->lex.line = yylineno; return(ATTRIBUTE); }
- YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 95 "glslang.l"
-{ pyylval->lex.line = yylineno; return(CONST_QUAL); }
- YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 96 "glslang.l"
-{ pyylval->lex.line = yylineno; return(UNIFORM); }
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 97 "glslang.l"
-{ pyylval->lex.line = yylineno; return(VARYING); }
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 99 "glslang.l"
-{ pyylval->lex.line = yylineno; return(BREAK); }
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 100 "glslang.l"
-{ pyylval->lex.line = yylineno; return(CONTINUE); }
- YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 101 "glslang.l"
-{ pyylval->lex.line = yylineno; return(DO); }
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 102 "glslang.l"
-{ pyylval->lex.line = yylineno; return(FOR); }
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 103 "glslang.l"
-{ pyylval->lex.line = yylineno; return(WHILE); }
- YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 105 "glslang.l"
-{ pyylval->lex.line = yylineno; return(IF); }
- YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 106 "glslang.l"
-{ pyylval->lex.line = yylineno; return(ELSE); }
- YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 108 "glslang.l"
-{ pyylval->lex.line = yylineno; return(IN_QUAL); }
- YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 109 "glslang.l"
-{ pyylval->lex.line = yylineno; return(OUT_QUAL); }
- YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 110 "glslang.l"
-{ pyylval->lex.line = yylineno; return(INOUT_QUAL); }
- YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 112 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(FLOAT_TYPE); }
- YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 113 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(INT_TYPE); }
- YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 114 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(VOID_TYPE); }
- YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 115 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(BOOL_TYPE); }
- YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 116 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.b = true; return(BOOLCONSTANT); }
- YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 117 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.b = false; return(BOOLCONSTANT); }
- YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 119 "glslang.l"
-{ pyylval->lex.line = yylineno; return(DISCARD); }
- YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 120 "glslang.l"
-{ pyylval->lex.line = yylineno; return(RETURN); }
- YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 122 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX2); }
- YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 123 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX3); }
- YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 124 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX4); }
- YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 126 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC2); }
- YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 127 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC3); }
- YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 128 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC4); }
- YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 129 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC2); }
- YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 130 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC3); }
- YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 131 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC4); }
- YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 132 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC2); }
- YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 133 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC3); }
- YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 134 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC4); }
- YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 136 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1D; }
- YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 137 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; }
- YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 138 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER3D; }
- YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 139 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; }
- YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 140 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1DSHADOW; }
- YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 141 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DSHADOW; }
- YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 143 "glslang.l"
-{ pyylval->lex.line = yylineno; return(STRUCT); }
- YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 145 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 147 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 148 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 149 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 150 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 151 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 152 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 153 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 155 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 156 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 157 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 159 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 160 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 161 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 162 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 163 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 164 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 165 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 166 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 168 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 169 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 170 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 171 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 172 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 173 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 175 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 176 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 178 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 179 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 72:
-YY_RULE_SETUP
-#line 180 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 181 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 182 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 183 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 184 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 185 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 186 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 188 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 189 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 190 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 192 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 193 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 195 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 85:
-YY_RULE_SETUP
-#line 196 "glslang.l"
-{ PaReservedWord(); return 0; }
- YY_BREAK
-case 86:
-YY_RULE_SETUP
-#line 198 "glslang.l"
-{
- pyylval->lex.line = yylineno;
- pyylval->lex.string = NewPoolTString(yytext);
- return PaIdentOrType(*pyylval->lex.string, parseContext, pyylval->lex.symbol);
-}
- YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 204 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
- YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 205 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
- YY_BREAK
-case 89:
-YY_RULE_SETUP
-#line 206 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;}
- YY_BREAK
-case 90:
-YY_RULE_SETUP
-#line 207 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
- YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 209 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
- YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 210 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
- YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 211 "glslang.l"
-{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
- YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 213 "glslang.l"
-{ int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; }
- YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 215 "glslang.l"
-{ pyylval->lex.line = yylineno; return(ADD_ASSIGN); }
- YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 216 "glslang.l"
-{ pyylval->lex.line = yylineno; return(SUB_ASSIGN); }
- YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 217 "glslang.l"
-{ pyylval->lex.line = yylineno; return(MUL_ASSIGN); }
- YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 218 "glslang.l"
-{ pyylval->lex.line = yylineno; return(DIV_ASSIGN); }
- YY_BREAK
-case 99:
-YY_RULE_SETUP
-#line 219 "glslang.l"
-{ pyylval->lex.line = yylineno; return(MOD_ASSIGN); }
- YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 220 "glslang.l"
-{ pyylval->lex.line = yylineno; return(LEFT_ASSIGN); }
- YY_BREAK
-case 101:
-YY_RULE_SETUP
-#line 221 "glslang.l"
-{ pyylval->lex.line = yylineno; return(RIGHT_ASSIGN); }
- YY_BREAK
-case 102:
-YY_RULE_SETUP
-#line 222 "glslang.l"
-{ pyylval->lex.line = yylineno; return(AND_ASSIGN); }
- YY_BREAK
-case 103:
-YY_RULE_SETUP
-#line 223 "glslang.l"
-{ pyylval->lex.line = yylineno; return(XOR_ASSIGN); }
- YY_BREAK
-case 104:
-YY_RULE_SETUP
-#line 224 "glslang.l"
-{ pyylval->lex.line = yylineno; return(OR_ASSIGN); }
- YY_BREAK
-case 105:
-YY_RULE_SETUP
-#line 226 "glslang.l"
-{ pyylval->lex.line = yylineno; return(INC_OP); }
- YY_BREAK
-case 106:
-YY_RULE_SETUP
-#line 227 "glslang.l"
-{ pyylval->lex.line = yylineno; return(DEC_OP); }
- YY_BREAK
-case 107:
-YY_RULE_SETUP
-#line 228 "glslang.l"
-{ pyylval->lex.line = yylineno; return(AND_OP); }
- YY_BREAK
-case 108:
-YY_RULE_SETUP
-#line 229 "glslang.l"
-{ pyylval->lex.line = yylineno; return(OR_OP); }
- YY_BREAK
-case 109:
-YY_RULE_SETUP
-#line 230 "glslang.l"
-{ pyylval->lex.line = yylineno; return(XOR_OP); }
- YY_BREAK
-case 110:
-YY_RULE_SETUP
-#line 231 "glslang.l"
-{ pyylval->lex.line = yylineno; return(LE_OP); }
- YY_BREAK
-case 111:
-YY_RULE_SETUP
-#line 232 "glslang.l"
-{ pyylval->lex.line = yylineno; return(GE_OP); }
- YY_BREAK
-case 112:
-YY_RULE_SETUP
-#line 233 "glslang.l"
-{ pyylval->lex.line = yylineno; return(EQ_OP); }
- YY_BREAK
-case 113:
-YY_RULE_SETUP
-#line 234 "glslang.l"
-{ pyylval->lex.line = yylineno; return(NE_OP); }
- YY_BREAK
-case 114:
-YY_RULE_SETUP
-#line 235 "glslang.l"
-{ pyylval->lex.line = yylineno; return(LEFT_OP); }
- YY_BREAK
-case 115:
-YY_RULE_SETUP
-#line 236 "glslang.l"
-{ pyylval->lex.line = yylineno; return(RIGHT_OP); }
- YY_BREAK
-case 116:
-YY_RULE_SETUP
-#line 237 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(SEMICOLON); }
- YY_BREAK
-case 117:
-YY_RULE_SETUP
-#line 238 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(LEFT_BRACE); }
- YY_BREAK
-case 118:
-YY_RULE_SETUP
-#line 239 "glslang.l"
-{ pyylval->lex.line = yylineno; return(RIGHT_BRACE); }
- YY_BREAK
-case 119:
-YY_RULE_SETUP
-#line 240 "glslang.l"
-{ pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return(COMMA); }
- YY_BREAK
-case 120:
-YY_RULE_SETUP
-#line 241 "glslang.l"
-{ pyylval->lex.line = yylineno; return(COLON); }
- YY_BREAK
-case 121:
-YY_RULE_SETUP
-#line 242 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(EQUAL); }
- YY_BREAK
-case 122:
-YY_RULE_SETUP
-#line 243 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return(LEFT_PAREN); }
- YY_BREAK
-case 123:
-YY_RULE_SETUP
-#line 244 "glslang.l"
-{ pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return(RIGHT_PAREN); }
- YY_BREAK
-case 124:
-YY_RULE_SETUP
-#line 245 "glslang.l"
-{ pyylval->lex.line = yylineno; return(LEFT_BRACKET); }
- YY_BREAK
-case 125:
-YY_RULE_SETUP
-#line 246 "glslang.l"
-{ pyylval->lex.line = yylineno; return(RIGHT_BRACKET); }
- YY_BREAK
-case 126:
-YY_RULE_SETUP
-#line 247 "glslang.l"
-{ BEGIN(FIELDS); return(DOT); }
- YY_BREAK
-case 127:
-YY_RULE_SETUP
-#line 248 "glslang.l"
-{ pyylval->lex.line = yylineno; return(BANG); }
- YY_BREAK
-case 128:
-YY_RULE_SETUP
-#line 249 "glslang.l"
-{ pyylval->lex.line = yylineno; return(DASH); }
- YY_BREAK
-case 129:
-YY_RULE_SETUP
-#line 250 "glslang.l"
-{ pyylval->lex.line = yylineno; return(TILDE); }
- YY_BREAK
-case 130:
-YY_RULE_SETUP
-#line 251 "glslang.l"
-{ pyylval->lex.line = yylineno; return(PLUS); }
- YY_BREAK
-case 131:
-YY_RULE_SETUP
-#line 252 "glslang.l"
-{ pyylval->lex.line = yylineno; return(STAR); }
- YY_BREAK
-case 132:
-YY_RULE_SETUP
-#line 253 "glslang.l"
-{ pyylval->lex.line = yylineno; return(SLASH); }
- YY_BREAK
-case 133:
-YY_RULE_SETUP
-#line 254 "glslang.l"
-{ pyylval->lex.line = yylineno; return(PERCENT); }
- YY_BREAK
-case 134:
-YY_RULE_SETUP
-#line 255 "glslang.l"
-{ pyylval->lex.line = yylineno; return(LEFT_ANGLE); }
- YY_BREAK
-case 135:
-YY_RULE_SETUP
-#line 256 "glslang.l"
-{ pyylval->lex.line = yylineno; return(RIGHT_ANGLE); }
- YY_BREAK
-case 136:
-YY_RULE_SETUP
-#line 257 "glslang.l"
-{ pyylval->lex.line = yylineno; return(VERTICAL_BAR); }
- YY_BREAK
-case 137:
-YY_RULE_SETUP
-#line 258 "glslang.l"
-{ pyylval->lex.line = yylineno; return(CARET); }
- YY_BREAK
-case 138:
-YY_RULE_SETUP
-#line 259 "glslang.l"
-{ pyylval->lex.line = yylineno; return(AMPERSAND); }
- YY_BREAK
-case 139:
-YY_RULE_SETUP
-#line 260 "glslang.l"
-{ pyylval->lex.line = yylineno; return(QUESTION); }
- YY_BREAK
-case 140:
-YY_RULE_SETUP
-#line 262 "glslang.l"
-{
-BEGIN(INITIAL);
- pyylval->lex.line = yylineno;
- pyylval->lex.string = NewPoolTString(yytext);
- return FIELD_SELECTION; }
- YY_BREAK
-case 141:
-YY_RULE_SETUP
-#line 267 "glslang.l"
-{}
- YY_BREAK
-case 142:
-YY_RULE_SETUP
-#line 269 "glslang.l"
-{ }
- YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(FIELDS):
-#line 270 "glslang.l"
-{ (&parseContext)->AfterEOF = true; yy_delete_buffer(YY_CURRENT_BUFFER); yyterminate();}
- YY_BREAK
-case 143:
-YY_RULE_SETUP
-#line 271 "glslang.l"
-{ parseContext.infoSink.info << "FLEX: Unknown char " << yytext << "\n";
- return 0; }
- YY_BREAK
-case 144:
-YY_RULE_SETUP
-#line 274 "glslang.l"
-ECHO;
- YY_BREAK
-#line 1723 "Gen_glslang.cpp"
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = yytext_ptr + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = yy_c_buf_p;
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
-
- if ( yywrap() )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
- } /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( yy_current_buffer->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
- else
- {
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
-
- int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = yy_current_buffer->yy_buf_size -
- number_to_move - 1;
-#endif
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
-
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
- return ret_val;
- }
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = yy_start;
-
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 428 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
- }
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
- register int yy_is_jam;
- register char *yy_cp = yy_c_buf_p;
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 428 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 427);
-
- return yy_is_jam ? 0 : yy_current_state;
- }
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
- register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
-
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
-
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
- {
- int c;
-
- *yy_c_buf_p = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* This was really a NUL. */
- *yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart( yyin );
-
- /* fall through */
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- return EOF;
-
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput();
-#else
- return input();
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
-
-
- return c;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
- return;
-
- if ( yy_current_buffer )
- {
- /* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer( b, file );
-
- return b;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
- if ( ! b )
- return;
-
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
-
-
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
- {
- yy_flush_buffer( b );
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
- {
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
- }
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer( b );
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
-
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = yy_scan_buffer( buf, n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
-
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
-
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
-
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
-
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
-
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
- BEGIN(new_state);
- }
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
-
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
- }
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
- }
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
- return (void *) malloc( size );
- }
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
- }
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
-
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 274 "glslang.l"
-
-
-
-//Including Pre-processor.
-extern "C" {
- #include "./preprocessor/preprocess.h"
-}
-
-//
-// The YY_INPUT macro just calls this. Maybe this could be just put into
-// the macro directly.
-//
-
-int yy_input(char* buf, int max_size)
-{
- char *char_token =NULL;
- int len;
-
- if ((len = yylex_CPP(buf, max_size)) == 0)
- return 0;
- if (len >= max_size)
- YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-
- buf[len] = ' ';
- return len+1;
-}
-
-
-//
-// Parse an array of strings using yyparse. We set up globals used by
-// yywrap.
-//
-// Returns 0 for success, as per yyparse().
-//
-int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseContextLocal)
-{
- int argv0len;
- ScanFromString(argv[0]);
-
- //Storing the Current Compiler Parse context into the cpp structure.
- cpp->pC = (void*)&parseContextLocal;
-
- if (!argv || argc == 0 || !argv[0])
- return 1;
-
- if (!strLen) {
- argv0len = (int) strlen(argv[0]);
- strLen = &argv0len;
- }
- yyrestart(0);
- (&parseContextLocal)->AfterEOF = false;
- cpp->PaWhichStr = 0;
- cpp->PaArgv = argv;
- cpp->PaArgc = argc;
- cpp->PaStrLen = strLen;
- yylineno = 1;
-
- if (*cpp->PaStrLen >= 0) {
- int ret;
- #ifdef _WIN32
- ret = yyparse(parseContextLocal);
- #else
- ret = yyparse((void*)(&parseContextLocal));
- #endif
- if (cpp->CompileError == 1 || parseContextLocal.recoveredFromError || parseContextLocal.numErrors > 0)
- return 1;
- else
- return 0;
- }
- else
- return 0;
-}
-
-void yyerror(char *s)
-{
- if (((TParseContext *)cpp->pC)->AfterEOF) {
- if (cpp->tokensBeforeEOF == 1) {
- GlobalParseContext->error(yylineno, "syntax error", "pre-mature EOF", s, "");
- GlobalParseContext->recover();
- }
- } else {
- GlobalParseContext->error(yylineno, "syntax error", yytext, s, "");
- GlobalParseContext->recover();
- }
-}
-
-void PaReservedWord()
-{
- GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", "");
- GlobalParseContext->recover();
-}
-
-int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbol)
-{
- symbol = parseContextLocal.symbolTable.find(id);
- if (parseContextLocal.lexAfterType == false && symbol && symbol->isVariable()) {
- TVariable* variable = static_cast<TVariable*>(symbol);
- if (variable->isUserType()) {
- parseContextLocal.lexAfterType = true;
- return TYPE_NAME;
- }
- }
-
- return IDENTIFIER;
-}
-
-int PaParseComment(int &lineno, TParseContext& parseContextLocal)
-{
- int transitionFlag = 0;
- int nextChar;
-
- while (transitionFlag != 2) {
- nextChar = yyinput();
- if (nextChar == '\n')
- lineno++;
- switch (nextChar) {
- case '*' :
- transitionFlag = 1;
- break;
- case '/' : /* if star is the previous character, then it is the end of comment */
- if (transitionFlag == 1) {
- return 1 ;
- }
- break;
- case EOF :
- /* Raise error message here */
- parseContextLocal.error(yylineno, "End of shader found before end of comment.", "", "", "");
- GlobalParseContext->recover();
- return YY_NULL;
- default : /* Any other character will be a part of the comment */
- transitionFlag = 0;
- }
- }
- return 1;
-}
-
-extern "C" {
-
-void CPPDebugLogMsg(const char *msg)
-{
- ((TParseContext *)cpp->pC)->infoSink.debug.message(EPrefixNone, msg);
-}
-
-void CPPWarningToInfoLog(const char *msg)
-{
- ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg, yylineno);
-}
-
-void CPPShInfoLogMsg(const char *msg)
-{
- ((TParseContext *)cpp->pC)->error(yylineno,"", "",msg,"");
- GlobalParseContext->recover();
-}
-
-void CPPErrorToInfoLog(char *msg)
-{
- ((TParseContext *)cpp->pC)->error(yylineno,"syntax error", "",msg,"");
- GlobalParseContext->recover();
-}
-
-void SetLineNumber(int line)
-{
- yylineno &= ~SourceLocLineMask;
- yylineno |= line;
-}
-
-void SetStringNumber(int string)
-{
- yylineno = (string << SourceLocStringShift) | (yylineno & SourceLocLineMask);
-}
-
-int GetStringNumber(void)
-{
- return yylineno >> 16;
-}
-
-int GetLineNumber(void)
-{
- return yylineno & SourceLocLineMask;
-}
-
-void IncLineNumber(void)
-{
- if ((yylineno & SourceLocLineMask) <= SourceLocLineMask)
- ++yylineno;
-}
-
-void DecLineNumber(void)
-{
- if ((yylineno & SourceLocLineMask) > 0)
- --yylineno;
-}
-
-void HandlePragma(const char **tokens, int numTokens)
-{
- if (!strcmp(tokens[0], "optimize")) {
- if (numTokens != 4) {
- CPPShInfoLogMsg("optimize pragma syntax is incorrect");
- return;
- }
-
- if (strcmp(tokens[1], "(")) {
- CPPShInfoLogMsg("\"(\" expected after 'optimize' keyword");
- return;
- }
-
- if (!strcmp(tokens[2], "on"))
- ((TParseContext *)cpp->pC)->contextPragma.optimize = true;
- else if (!strcmp(tokens[2], "off"))
- ((TParseContext *)cpp->pC)->contextPragma.optimize = false;
- else {
- CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'optimize' pragma");
- return;
- }
-
- if (strcmp(tokens[3], ")")) {
- CPPShInfoLogMsg("\")\" expected to end 'optimize' pragma");
- return;
- }
- } else if (!strcmp(tokens[0], "debug")) {
- if (numTokens != 4) {
- CPPShInfoLogMsg("debug pragma syntax is incorrect");
- return;
- }
-
- if (strcmp(tokens[1], "(")) {
- CPPShInfoLogMsg("\"(\" expected after 'debug' keyword");
- return;
- }
-
- if (!strcmp(tokens[2], "on"))
- ((TParseContext *)cpp->pC)->contextPragma.debug = true;
- else if (!strcmp(tokens[2], "off"))
- ((TParseContext *)cpp->pC)->contextPragma.debug = false;
- else {
- CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'debug' pragma");
- return;
- }
-
- if (strcmp(tokens[3], ")")) {
- CPPShInfoLogMsg("\")\" expected to end 'debug' pragma");
- return;
- }
- } else {
- /*
- // implementation specific pragma
- // use ((TParseContext *)cpp->pC)->contextPragma.pragmaTable to store the information about pragma
- // For now, just ignore the pragma that the implementation cannot recognize
- // An Example of one such implementation for a pragma that has a syntax like
- // #pragma pragmaname(pragmavalue)
- // This implementation stores the current pragmavalue against the pragma name in pragmaTable.
- if (numTokens == 4 && !strcmp(tokens[1], "(") && !strcmp(tokens[3], ")")) {
- TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable;
- TPragmaTable::iterator iter;
- iter = pragmaTable.find(TString(tokens[0]));
- if (iter != pragmaTable.end()) {
- iter->second = tokens[2];
- } else {
- pragmaTable[tokens[0]] = tokens[2];
- }
- }
- */
- }
-}
-
-void StoreStr(char *string)
-{
- TString strSrc;
- strSrc = TString(string);
-
- ((TParseContext *)cpp->pC)->HashErrMsg = ((TParseContext *)cpp->pC)->HashErrMsg + " " + strSrc;
-}
-
-const char* GetStrfromTStr(void)
-{
- cpp->ErrMsg = (((TParseContext *)cpp->pC)->HashErrMsg).c_str();
- return cpp->ErrMsg;
-}
-
-void ResetTString(void)
-{
- ((TParseContext *)cpp->pC)->HashErrMsg = "";
-}
-
-TBehavior GetBehavior(const char* behavior)
-{
- if (!strcmp("require", behavior))
- return EBhRequire;
- else if (!strcmp("enable", behavior))
- return EBhEnable;
- else if (!strcmp("disable", behavior))
- return EBhDisable;
- else if (!strcmp("warn", behavior))
- return EBhWarn;
- else {
- CPPShInfoLogMsg((TString("behavior '") + behavior + "' is not supported").c_str());
- return EBhDisable;
- }
-}
-
-void updateExtensionBehavior(const char* extName, const char* behavior)
-{
- TBehavior behaviorVal = GetBehavior(behavior);
- TMap<TString, TBehavior>:: iterator iter;
- TString msg;
-
- // special cased for all extension
- if (!strcmp(extName, "all")) {
- if (behaviorVal == EBhRequire || behaviorVal == EBhEnable) {
- CPPShInfoLogMsg("extension 'all' cannot have 'require' or 'enable' behavior");
- return;
- } else {
- for (iter = ((TParseContext *)cpp->pC)->extensionBehavior.begin(); iter != ((TParseContext *)cpp->pC)->extensionBehavior.end(); ++iter)
- iter->second = behaviorVal;
- }
- } else {
- iter = ((TParseContext *)cpp->pC)->extensionBehavior.find(TString(extName));
- if (iter == ((TParseContext *)cpp->pC)->extensionBehavior.end()) {
- switch (behaviorVal) {
- case EBhRequire:
- CPPShInfoLogMsg((TString("extension '") + extName + "' is not supported").c_str());
- break;
- case EBhEnable:
- case EBhWarn:
- case EBhDisable:
- msg = TString("extension '") + extName + "' is not supported";
- ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno);
- break;
- }
- return;
- } else
- iter->second = behaviorVal;
- }
-}
-
-}
-
-void setInitialState()
-{
- yy_start = 1;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp
deleted file mode 100755
index 69aa60872..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Gen_glslang_tab.cpp
+++ /dev/null
@@ -1,4354 +0,0 @@
-/* A Bison parser, made by GNU Bison 1.875. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 1
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- ATTRIBUTE = 258,
- CONST_QUAL = 259,
- BOOL_TYPE = 260,
- FLOAT_TYPE = 261,
- INT_TYPE = 262,
- BREAK = 263,
- CONTINUE = 264,
- DO = 265,
- ELSE = 266,
- FOR = 267,
- IF = 268,
- DISCARD = 269,
- RETURN = 270,
- BVEC2 = 271,
- BVEC3 = 272,
- BVEC4 = 273,
- IVEC2 = 274,
- IVEC3 = 275,
- IVEC4 = 276,
- VEC2 = 277,
- VEC3 = 278,
- VEC4 = 279,
- MATRIX2 = 280,
- MATRIX3 = 281,
- MATRIX4 = 282,
- IN_QUAL = 283,
- OUT_QUAL = 284,
- INOUT_QUAL = 285,
- UNIFORM = 286,
- VARYING = 287,
- STRUCT = 288,
- VOID_TYPE = 289,
- WHILE = 290,
- SAMPLER1D = 291,
- SAMPLER2D = 292,
- SAMPLER3D = 293,
- SAMPLERCUBE = 294,
- SAMPLER1DSHADOW = 295,
- SAMPLER2DSHADOW = 296,
- IDENTIFIER = 297,
- TYPE_NAME = 298,
- FLOATCONSTANT = 299,
- INTCONSTANT = 300,
- BOOLCONSTANT = 301,
- FIELD_SELECTION = 302,
- LEFT_OP = 303,
- RIGHT_OP = 304,
- INC_OP = 305,
- DEC_OP = 306,
- LE_OP = 307,
- GE_OP = 308,
- EQ_OP = 309,
- NE_OP = 310,
- AND_OP = 311,
- OR_OP = 312,
- XOR_OP = 313,
- MUL_ASSIGN = 314,
- DIV_ASSIGN = 315,
- ADD_ASSIGN = 316,
- MOD_ASSIGN = 317,
- LEFT_ASSIGN = 318,
- RIGHT_ASSIGN = 319,
- AND_ASSIGN = 320,
- XOR_ASSIGN = 321,
- OR_ASSIGN = 322,
- SUB_ASSIGN = 323,
- LEFT_PAREN = 324,
- RIGHT_PAREN = 325,
- LEFT_BRACKET = 326,
- RIGHT_BRACKET = 327,
- LEFT_BRACE = 328,
- RIGHT_BRACE = 329,
- DOT = 330,
- COMMA = 331,
- COLON = 332,
- EQUAL = 333,
- SEMICOLON = 334,
- BANG = 335,
- DASH = 336,
- TILDE = 337,
- PLUS = 338,
- STAR = 339,
- SLASH = 340,
- PERCENT = 341,
- LEFT_ANGLE = 342,
- RIGHT_ANGLE = 343,
- VERTICAL_BAR = 344,
- CARET = 345,
- AMPERSAND = 346,
- QUESTION = 347
- };
-#endif
-#define ATTRIBUTE 258
-#define CONST_QUAL 259
-#define BOOL_TYPE 260
-#define FLOAT_TYPE 261
-#define INT_TYPE 262
-#define BREAK 263
-#define CONTINUE 264
-#define DO 265
-#define ELSE 266
-#define FOR 267
-#define IF 268
-#define DISCARD 269
-#define RETURN 270
-#define BVEC2 271
-#define BVEC3 272
-#define BVEC4 273
-#define IVEC2 274
-#define IVEC3 275
-#define IVEC4 276
-#define VEC2 277
-#define VEC3 278
-#define VEC4 279
-#define MATRIX2 280
-#define MATRIX3 281
-#define MATRIX4 282
-#define IN_QUAL 283
-#define OUT_QUAL 284
-#define INOUT_QUAL 285
-#define UNIFORM 286
-#define VARYING 287
-#define STRUCT 288
-#define VOID_TYPE 289
-#define WHILE 290
-#define SAMPLER1D 291
-#define SAMPLER2D 292
-#define SAMPLER3D 293
-#define SAMPLERCUBE 294
-#define SAMPLER1DSHADOW 295
-#define SAMPLER2DSHADOW 296
-#define IDENTIFIER 297
-#define TYPE_NAME 298
-#define FLOATCONSTANT 299
-#define INTCONSTANT 300
-#define BOOLCONSTANT 301
-#define FIELD_SELECTION 302
-#define LEFT_OP 303
-#define RIGHT_OP 304
-#define INC_OP 305
-#define DEC_OP 306
-#define LE_OP 307
-#define GE_OP 308
-#define EQ_OP 309
-#define NE_OP 310
-#define AND_OP 311
-#define OR_OP 312
-#define XOR_OP 313
-#define MUL_ASSIGN 314
-#define DIV_ASSIGN 315
-#define ADD_ASSIGN 316
-#define MOD_ASSIGN 317
-#define LEFT_ASSIGN 318
-#define RIGHT_ASSIGN 319
-#define AND_ASSIGN 320
-#define XOR_ASSIGN 321
-#define OR_ASSIGN 322
-#define SUB_ASSIGN 323
-#define LEFT_PAREN 324
-#define RIGHT_PAREN 325
-#define LEFT_BRACKET 326
-#define RIGHT_BRACKET 327
-#define LEFT_BRACE 328
-#define RIGHT_BRACE 329
-#define DOT 330
-#define COMMA 331
-#define COLON 332
-#define EQUAL 333
-#define SEMICOLON 334
-#define BANG 335
-#define DASH 336
-#define TILDE 337
-#define PLUS 338
-#define STAR 339
-#define SLASH 340
-#define PERCENT 341
-#define LEFT_ANGLE 342
-#define RIGHT_ANGLE 343
-#define VERTICAL_BAR 344
-#define CARET 345
-#define AMPERSAND 346
-#define QUESTION 347
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 39 "glslang.y"
-
-
-/* Based on:
-ANSI C Yacc grammar
-
-In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a
-matching Lex specification) for the April 30, 1985 draft version of the
-ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that
-original, as mentioned in the answer to question 17.25 of the comp.lang.c
-FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z.
-
-I intend to keep this version as close to the current C Standard grammar as
-possible; please let me know if you discover discrepancies.
-
-Jutta Degener, 1995
-*/
-
-#include "SymbolTable.h"
-#include "ParseHelper.h"
-#include "../Public/ShaderLang.h"
-
-#ifdef _WIN32
- #define YYPARSE_PARAM parseContext
- #define YYPARSE_PARAM_DECL TParseContext&
- #define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
- #define YYLEX_PARAM parseContext
-#else
- #define YYPARSE_PARAM parseContextLocal
- #define parseContext (*((TParseContext*)(parseContextLocal)))
- #define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
- #define YYLEX_PARAM (void*)(parseContextLocal)
- extern void yyerror(char*);
-#endif
-
-#define FRAG_VERT_ONLY(S, L) { \
- if (parseContext.language != EShLangFragment && \
- parseContext.language != EShLangVertex) { \
- parseContext.error(L, " supported in vertex/fragment shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define VERTEX_ONLY(S, L) { \
- if (parseContext.language != EShLangVertex) { \
- parseContext.error(L, " supported in vertex shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define FRAG_ONLY(S, L) { \
- if (parseContext.language != EShLangFragment) { \
- parseContext.error(L, " supported in fragment shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define PACK_ONLY(S, L) { \
- if (parseContext.language != EShLangPack) { \
- parseContext.error(L, " supported in pack shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define UNPACK_ONLY(S, L) { \
- if (parseContext.language != EShLangUnpack) { \
- parseContext.error(L, " supported in unpack shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define PACK_UNPACK_ONLY(S, L) { \
- if (parseContext.language != EShLangUnpack && \
- parseContext.language != EShLangPack) { \
- parseContext.error(L, " supported in pack/unpack shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 1
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 117 "glslang.y"
-typedef union YYSTYPE {
- struct {
- TSourceLoc line;
- union {
- TString *string;
- float f;
- int i;
- bool b;
- };
- TSymbol* symbol;
- } lex;
- struct {
- TSourceLoc line;
- TOperator op;
- union {
- TIntermNode* intermNode;
- TIntermNodePair nodePair;
- TIntermTyped* intermTypedNode;
- TIntermAggregate* intermAggregate;
- };
- union {
- TPublicType type;
- TQualifier qualifier;
- TFunction* function;
- TParameter param;
- TTypeLine typeLine;
- TTypeList* typeList;
- };
- } interm;
-} YYSTYPE;
-/* Line 191 of yacc.c. */
-#line 369 "glslang.tab.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations. */
-#line 148 "glslang.y"
-
-#ifndef _WIN32
- extern int yylex(YYSTYPE*, void*);
-#endif
-
-
-/* Line 214 of yacc.c. */
-#line 386 "glslang.tab.c"
-
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# else
-# ifndef YYSTACK_USE_ALLOCA
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE free
-# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- register YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
-
-#endif
-
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 59
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1231
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 93
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 75
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 214
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 331
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 347
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned short yyprhs[] =
-{
- 0, 0, 3, 5, 7, 9, 11, 13, 17, 19,
- 24, 26, 30, 33, 36, 38, 40, 43, 46, 49,
- 51, 54, 58, 61, 63, 65, 67, 69, 71, 73,
- 75, 77, 79, 81, 83, 85, 87, 89, 91, 93,
- 95, 97, 99, 102, 105, 108, 110, 112, 114, 116,
- 118, 122, 126, 130, 132, 136, 140, 142, 146, 150,
- 152, 156, 160, 164, 168, 170, 174, 178, 180, 184,
- 186, 190, 192, 196, 198, 202, 204, 208, 210, 214,
- 216, 222, 224, 228, 230, 232, 234, 236, 238, 240,
- 242, 244, 246, 248, 250, 252, 256, 258, 261, 264,
- 267, 269, 271, 274, 278, 282, 285, 291, 295, 298,
- 302, 305, 306, 308, 310, 312, 314, 319, 321, 325,
- 331, 338, 344, 346, 349, 354, 360, 365, 367, 370,
- 372, 374, 376, 378, 380, 382, 384, 386, 388, 390,
- 392, 394, 396, 398, 400, 402, 404, 406, 408, 410,
- 412, 414, 416, 418, 420, 422, 424, 426, 432, 437,
- 439, 442, 446, 448, 452, 454, 459, 461, 463, 465,
- 467, 469, 471, 473, 475, 477, 480, 481, 482, 488,
- 490, 492, 495, 499, 501, 504, 506, 509, 515, 519,
- 521, 523, 528, 529, 536, 537, 546, 547, 555, 557,
- 559, 561, 562, 565, 569, 572, 575, 578, 582, 585,
- 587, 590, 592, 594, 595
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const short yyrhs[] =
-{
- 164, 0, -1, 42, -1, 94, -1, 45, -1, 44,
- -1, 46, -1, 69, 121, 70, -1, 95, -1, 96,
- 71, 97, 72, -1, 98, -1, 96, 75, 47, -1,
- 96, 50, -1, 96, 51, -1, 121, -1, 99, -1,
- 101, 70, -1, 100, 70, -1, 102, 34, -1, 102,
- -1, 102, 119, -1, 101, 76, 119, -1, 103, 69,
- -1, 104, -1, 42, -1, 6, -1, 7, -1, 5,
- -1, 22, -1, 23, -1, 24, -1, 16, -1, 17,
- -1, 18, -1, 19, -1, 20, -1, 21, -1, 25,
- -1, 26, -1, 27, -1, 43, -1, 96, -1, 50,
- 105, -1, 51, 105, -1, 106, 105, -1, 83, -1,
- 81, -1, 80, -1, 82, -1, 105, -1, 107, 84,
- 105, -1, 107, 85, 105, -1, 107, 86, 105, -1,
- 107, -1, 108, 83, 107, -1, 108, 81, 107, -1,
- 108, -1, 109, 48, 108, -1, 109, 49, 108, -1,
- 109, -1, 110, 87, 109, -1, 110, 88, 109, -1,
- 110, 52, 109, -1, 110, 53, 109, -1, 110, -1,
- 111, 54, 110, -1, 111, 55, 110, -1, 111, -1,
- 112, 91, 111, -1, 112, -1, 113, 90, 112, -1,
- 113, -1, 114, 89, 113, -1, 114, -1, 115, 56,
- 114, -1, 115, -1, 116, 58, 115, -1, 116, -1,
- 117, 57, 116, -1, 117, -1, 117, 92, 121, 77,
- 119, -1, 118, -1, 105, 120, 119, -1, 78, -1,
- 59, -1, 60, -1, 62, -1, 61, -1, 68, -1,
- 63, -1, 64, -1, 65, -1, 66, -1, 67, -1,
- 119, -1, 121, 76, 119, -1, 118, -1, 124, 79,
- -1, 132, 79, -1, 125, 70, -1, 127, -1, 126,
- -1, 127, 129, -1, 126, 76, 129, -1, 134, 42,
- 69, -1, 136, 42, -1, 136, 42, 71, 122, 72,
- -1, 135, 130, 128, -1, 130, 128, -1, 135, 130,
- 131, -1, 130, 131, -1, -1, 28, -1, 29, -1,
- 30, -1, 136, -1, 136, 71, 122, 72, -1, 133,
- -1, 132, 76, 42, -1, 132, 76, 42, 71, 72,
- -1, 132, 76, 42, 71, 122, 72, -1, 132, 76,
- 42, 78, 142, -1, 134, -1, 134, 42, -1, 134,
- 42, 71, 72, -1, 134, 42, 71, 122, 72, -1,
- 134, 42, 78, 142, -1, 136, -1, 135, 136, -1,
- 4, -1, 3, -1, 32, -1, 31, -1, 34, -1,
- 6, -1, 7, -1, 5, -1, 22, -1, 23, -1,
- 24, -1, 16, -1, 17, -1, 18, -1, 19, -1,
- 20, -1, 21, -1, 25, -1, 26, -1, 27, -1,
- 36, -1, 37, -1, 38, -1, 39, -1, 40, -1,
- 41, -1, 137, -1, 43, -1, 33, 42, 73, 138,
- 74, -1, 33, 73, 138, 74, -1, 139, -1, 138,
- 139, -1, 136, 140, 79, -1, 141, -1, 140, 76,
- 141, -1, 42, -1, 42, 71, 122, 72, -1, 119,
- -1, 123, -1, 146, -1, 145, -1, 143, -1, 152,
- -1, 153, -1, 156, -1, 163, -1, 73, 74, -1,
- -1, -1, 73, 147, 151, 148, 74, -1, 150, -1,
- 145, -1, 73, 74, -1, 73, 151, 74, -1, 144,
- -1, 151, 144, -1, 79, -1, 121, 79, -1, 13,
- 69, 121, 70, 154, -1, 144, 11, 144, -1, 144,
- -1, 121, -1, 134, 42, 78, 142, -1, -1, 35,
- 69, 157, 155, 70, 149, -1, -1, 10, 158, 144,
- 35, 69, 121, 70, 79, -1, -1, 12, 69, 159,
- 160, 162, 70, 149, -1, 152, -1, 143, -1, 155,
- -1, -1, 161, 79, -1, 161, 79, 121, -1, 9,
- 79, -1, 8, 79, -1, 15, 79, -1, 15, 121,
- 79, -1, 14, 79, -1, 165, -1, 164, 165, -1,
- 166, -1, 123, -1, -1, 124, 167, 150, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned short yyrline[] =
-{
- 0, 210, 210, 245, 248, 261, 266, 271, 277, 280,
- 348, 351, 460, 470, 483, 491, 586, 590, 597, 601,
- 608, 614, 623, 629, 640, 656, 657, 658, 659, 660,
- 661, 662, 663, 664, 665, 666, 667, 668, 669, 670,
- 671, 682, 685, 695, 705, 727, 728, 729, 730, 736,
- 737, 746, 755, 767, 768, 776, 787, 788, 797, 809,
- 810, 820, 830, 840, 853, 854, 864, 877, 878, 890,
- 891, 903, 904, 916, 917, 930, 931, 944, 945, 958,
- 959, 976, 977, 990, 991, 992, 993, 994, 995, 996,
- 997, 998, 999, 1000, 1004, 1007, 1018, 1026, 1027, 1035,
- 1071, 1074, 1081, 1089, 1110, 1129, 1140, 1167, 1172, 1182,
- 1187, 1197, 1200, 1203, 1206, 1212, 1217, 1235, 1238, 1246,
- 1254, 1262, 1284, 1288, 1297, 1306, 1315, 1405, 1408, 1425,
- 1429, 1436, 1444, 1453, 1458, 1463, 1468, 1479, 1484, 1489,
- 1494, 1499, 1504, 1509, 1514, 1519, 1524, 1530, 1536, 1542,
- 1548, 1554, 1560, 1566, 1572, 1578, 1583, 1596, 1606, 1614,
- 1617, 1632, 1650, 1654, 1660, 1665, 1681, 1685, 1689, 1690,
- 1696, 1697, 1698, 1699, 1700, 1704, 1705, 1705, 1705, 1713,
- 1714, 1719, 1722, 1730, 1733, 1739, 1740, 1744, 1752, 1756,
- 1766, 1771, 1788, 1788, 1793, 1793, 1800, 1800, 1813, 1816,
- 1822, 1825, 1831, 1835, 1842, 1849, 1856, 1863, 1874, 1883,
- 1887, 1894, 1897, 1903, 1903
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "ATTRIBUTE", "CONST_QUAL", "BOOL_TYPE",
- "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE", "DO", "ELSE", "FOR",
- "IF", "DISCARD", "RETURN", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
- "IVEC4", "VEC2", "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4",
- "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM", "VARYING", "STRUCT",
- "VOID_TYPE", "WHILE", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D",
- "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "IDENTIFIER",
- "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT", "BOOLCONSTANT",
- "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP",
- "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN",
- "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN",
- "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN",
- "RIGHT_PAREN", "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE",
- "RIGHT_BRACE", "DOT", "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG",
- "DASH", "TILDE", "PLUS", "STAR", "SLASH", "PERCENT", "LEFT_ANGLE",
- "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", "AMPERSAND", "QUESTION",
- "$accept", "variable_identifier", "primary_expression",
- "postfix_expression", "integer_expression", "function_call",
- "function_call_generic", "function_call_header_no_parameters",
- "function_call_header_with_parameters", "function_call_header",
- "function_identifier", "constructor_identifier", "unary_expression",
- "unary_operator", "multiplicative_expression", "additive_expression",
- "shift_expression", "relational_expression", "equality_expression",
- "and_expression", "exclusive_or_expression", "inclusive_or_expression",
- "logical_and_expression", "logical_xor_expression",
- "logical_or_expression", "conditional_expression",
- "assignment_expression", "assignment_operator", "expression",
- "constant_expression", "declaration", "function_prototype",
- "function_declarator", "function_header_with_parameters",
- "function_header", "parameter_declarator", "parameter_declaration",
- "parameter_qualifier", "parameter_type_specifier",
- "init_declarator_list", "single_declaration", "fully_specified_type",
- "type_qualifier", "type_specifier", "struct_specifier",
- "struct_declaration_list", "struct_declaration",
- "struct_declarator_list", "struct_declarator", "initializer",
- "declaration_statement", "statement", "simple_statement",
- "compound_statement", "@1", "@2", "statement_no_new_scope",
- "compound_statement_no_new_scope", "statement_list",
- "expression_statement", "selection_statement",
- "selection_rest_statement", "condition", "iteration_statement", "@3",
- "@4", "@5", "for_init_statement", "conditionopt", "for_rest_statement",
- "jump_statement", "translation_unit", "external_declaration",
- "function_definition", "@6", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const unsigned short yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
- 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
- 345, 346, 347
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 93, 94, 95, 95, 95, 95, 95, 96, 96,
- 96, 96, 96, 96, 97, 98, 99, 99, 100, 100,
- 101, 101, 102, 103, 103, 104, 104, 104, 104, 104,
- 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
- 104, 105, 105, 105, 105, 106, 106, 106, 106, 107,
- 107, 107, 107, 108, 108, 108, 109, 109, 109, 110,
- 110, 110, 110, 110, 111, 111, 111, 112, 112, 113,
- 113, 114, 114, 115, 115, 116, 116, 117, 117, 118,
- 118, 119, 119, 120, 120, 120, 120, 120, 120, 120,
- 120, 120, 120, 120, 121, 121, 122, 123, 123, 124,
- 125, 125, 126, 126, 127, 128, 128, 129, 129, 129,
- 129, 130, 130, 130, 130, 131, 131, 132, 132, 132,
- 132, 132, 133, 133, 133, 133, 133, 134, 134, 135,
- 135, 135, 135, 136, 136, 136, 136, 136, 136, 136,
- 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
- 136, 136, 136, 136, 136, 136, 136, 137, 137, 138,
- 138, 139, 140, 140, 141, 141, 142, 143, 144, 144,
- 145, 145, 145, 145, 145, 146, 147, 148, 146, 149,
- 149, 150, 150, 151, 151, 152, 152, 153, 154, 154,
- 155, 155, 157, 156, 158, 156, 159, 156, 160, 160,
- 161, 161, 162, 162, 163, 163, 163, 163, 163, 164,
- 164, 165, 165, 167, 166
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
-{
- 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
- 1, 3, 2, 2, 1, 1, 2, 2, 2, 1,
- 2, 3, 2, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 1, 1, 1, 1, 1,
- 3, 3, 3, 1, 3, 3, 1, 3, 3, 1,
- 3, 3, 3, 3, 1, 3, 3, 1, 3, 1,
- 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 5, 1, 3, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 3, 1, 2, 2, 2,
- 1, 1, 2, 3, 3, 2, 5, 3, 2, 3,
- 2, 0, 1, 1, 1, 1, 4, 1, 3, 5,
- 6, 5, 1, 2, 4, 5, 4, 1, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 5, 4, 1,
- 2, 3, 1, 3, 1, 4, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 0, 0, 5, 1,
- 1, 2, 3, 1, 2, 1, 2, 5, 3, 1,
- 1, 4, 0, 6, 0, 8, 0, 7, 1, 1,
- 1, 0, 2, 3, 2, 2, 2, 3, 2, 1,
- 2, 1, 1, 0, 3
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const unsigned char yydefact[] =
-{
- 0, 130, 129, 136, 134, 135, 140, 141, 142, 143,
- 144, 145, 137, 138, 139, 146, 147, 148, 132, 131,
- 0, 133, 149, 150, 151, 152, 153, 154, 156, 212,
- 213, 0, 101, 111, 0, 117, 122, 0, 127, 155,
- 0, 209, 211, 0, 0, 97, 0, 99, 111, 112,
- 113, 114, 102, 0, 111, 0, 98, 123, 128, 1,
- 210, 0, 0, 0, 159, 0, 214, 103, 108, 110,
- 115, 0, 118, 104, 0, 0, 0, 164, 0, 162,
- 158, 160, 136, 134, 135, 0, 0, 194, 0, 0,
- 0, 0, 140, 141, 142, 143, 144, 145, 137, 138,
- 139, 146, 147, 148, 0, 2, 156, 5, 4, 6,
- 0, 0, 0, 176, 181, 185, 47, 46, 48, 45,
- 3, 8, 41, 10, 15, 0, 0, 19, 0, 23,
- 49, 0, 53, 56, 59, 64, 67, 69, 71, 73,
- 75, 77, 79, 81, 94, 0, 167, 0, 170, 183,
- 169, 168, 0, 171, 172, 173, 174, 105, 0, 107,
- 109, 0, 0, 27, 25, 26, 31, 32, 33, 34,
- 35, 36, 28, 29, 30, 37, 38, 39, 40, 124,
- 49, 96, 0, 166, 126, 157, 0, 0, 161, 205,
- 204, 0, 196, 0, 208, 206, 0, 192, 42, 43,
- 0, 175, 0, 12, 13, 0, 0, 17, 16, 0,
- 18, 20, 22, 84, 85, 87, 86, 89, 90, 91,
- 92, 93, 88, 83, 0, 44, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 186, 182, 184,
- 0, 0, 119, 0, 121, 125, 0, 163, 0, 0,
- 0, 207, 0, 7, 177, 0, 14, 11, 21, 82,
- 50, 51, 52, 55, 54, 57, 58, 62, 63, 60,
- 61, 65, 66, 68, 70, 72, 74, 76, 78, 0,
- 95, 0, 116, 120, 165, 0, 199, 198, 201, 0,
- 190, 0, 0, 0, 9, 0, 106, 0, 200, 0,
- 0, 189, 187, 0, 0, 178, 80, 0, 202, 0,
- 0, 0, 180, 193, 179, 0, 203, 197, 188, 191,
- 195
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const short yydefgoto[] =
-{
- -1, 120, 121, 122, 265, 123, 124, 125, 126, 127,
- 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
- 138, 139, 140, 141, 142, 143, 144, 224, 145, 182,
- 146, 147, 31, 32, 33, 68, 52, 53, 69, 34,
- 35, 36, 37, 38, 39, 63, 64, 78, 79, 184,
- 148, 149, 150, 151, 202, 303, 323, 324, 152, 153,
- 154, 312, 302, 155, 262, 191, 259, 298, 309, 310,
- 156, 40, 41, 42, 46
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -297
-static const short yypact[] =
-{
- 1149, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -27, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -42, -28, -32, 4, 18, -297, 19, 1188, -297, -297,
- 1108, -297, -297, -10, 1188, -297, -3, -297, 36, -297,
- -297, -297, -297, 1188, 83, 33, -297, -9, -297, -297,
- -297, 1188, 39, 1025, -297, 235, -297, -297, -297, -297,
- -18, 1188, -52, -297, 685, 957, 1064, -17, 20, -297,
- -297, -297, 29, 45, 63, 21, 23, -297, 75, 77,
- 66, 753, 78, 79, 81, 82, 84, 85, 87, 89,
- 90, 91, 93, 94, 95, 96, 97, -297, -297, -297,
- 957, 957, 957, 120, -297, -297, -297, -297, -297, -297,
- -297, -297, 5, -297, -297, 98, 1, 821, 100, -297,
- 57, 957, 42, -56, 37, -40, 76, 61, 80, 106,
- 111, 138, -41, -297, -297, 30, -297, -42, -297, -297,
- -297, -297, 316, -297, -297, -297, -297, 127, 957, -297,
- -297, 889, 957, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, 128, -297, -297, -297, 957, 39, -297, -297,
- -297, 397, -297, 957, -297, -297, 31, -297, -297, -297,
- 3, -297, 397, -297, -297, 957, 152, -297, -297, 957,
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, 957, -297, 957, 957, 957, 957,
- 957, 957, 957, 957, 957, 957, 957, 957, 957, 957,
- 957, 957, 957, 957, 957, 957, 957, -297, -297, -297,
- 957, 129, -297, 130, -297, -297, 131, -297, 169, 549,
- 12, -297, 617, -297, 397, 133, 134, -297, -297, -297,
- -297, -297, -297, 42, 42, -56, -56, 37, 37, 37,
- 37, -40, -40, 76, 61, 80, 106, 111, 138, 60,
- -297, 135, -297, -297, -297, 137, -297, -297, 617, 397,
- 134, 167, 141, 140, -297, 957, -297, 957, -297, 136,
- 142, 205, -297, 143, 478, -297, -297, 13, 957, 478,
- 397, 957, -297, -297, -297, 139, 134, -297, -297, -297,
- -297
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const short yypgoto[] =
-{
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -53, -297, -91, -89, -143, -97, -20, -16,
- -21, -15, -14, -22, -297, -57, -75, -297, -90, -155,
- 9, 10, -297, -297, -297, 154, 175, 172, 160, -297,
- -297, -257, -19, -33, -297, 171, -4, -297, 46, -160,
- -25, -107, -296, -297, -297, -297, -84, 190, 35, 6,
- -297, -297, -35, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, 224, -297, -297
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -101
-static const short yytable[] =
-{
- 183, 196, 254, 251, 58, 301, 253, 1, 2, 29,
- 30, 62, 233, 234, 54, 43, 244, 181, 322, 161,
- 70, 180, 200, 322, 157, 229, 162, 230, 62, 54,
- 62, 256, 49, 50, 51, 18, 19, 45, 70, 1,
- 2, 301, 47, 62, 48, 249, 44, 235, 236, 29,
- 30, 245, 211, 158, 186, 203, 204, 198, 199, 81,
- 73, 57, 74, 61, 49, 50, 51, 18, 19, 75,
- 65, 208, 81, 263, -100, 72, 205, 209, 225, 246,
- 206, 77, 299, 325, 258, 231, 232, 183, 246, 246,
- 277, 278, 279, 280, 55, 291, 187, 56, -27, 188,
- 189, 181, 190, 260, 181, 180, 246, 246, 180, 247,
- 261, 49, 50, 51, -25, 266, 213, 214, 215, 216,
- 217, 218, 219, 220, 221, 222, 226, 227, 228, 181,
- 237, 238, -26, 180, 268, 223, 246, 305, 273, 274,
- 281, 282, 275, 276, 192, 194, 193, -31, -32, 269,
- -33, -34, 239, -35, -36, 289, -28, 249, -29, -30,
- -37, 329, -38, -39, 197, -24, -40, 242, 207, 212,
- 240, 290, 300, 270, 271, 272, 180, 180, 180, 180,
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
- 180, 180, 311, 181, 201, 241, 243, 180, 250, 267,
- 255, 292, 293, 294, 295, 304, 307, 306, 300, 313,
- 246, 314, 319, 328, 315, 318, 320, 317, 330, 283,
- 285, 321, 288, 67, 284, 159, 71, 286, 326, 287,
- 316, 160, 76, 257, 296, 327, 66, 264, 1, 2,
- 82, 83, 84, 85, 86, 87, 183, 88, 89, 90,
- 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 308, 60, 297, 18, 19, 20, 21,
- 104, 22, 23, 24, 25, 26, 27, 105, 106, 107,
- 108, 109, 0, 0, 0, 110, 111, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 112, 0, 0, 0, 113, 114,
- 0, 0, 0, 0, 115, 116, 117, 118, 119, 1,
- 2, 82, 83, 84, 85, 86, 87, 0, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 0, 0, 0, 18, 19, 20,
- 21, 104, 22, 23, 24, 25, 26, 27, 105, 106,
- 107, 108, 109, 0, 0, 0, 110, 111, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 112, 0, 0, 0, 113,
- 248, 0, 0, 0, 0, 115, 116, 117, 118, 119,
- 1, 2, 82, 83, 84, 85, 86, 87, 0, 88,
- 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, 0, 0, 0, 18, 19,
- 20, 21, 104, 22, 23, 24, 25, 26, 27, 105,
- 106, 107, 108, 109, 0, 0, 0, 110, 111, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 112, 0, 0, 0,
- 113, 0, 0, 0, 0, 0, 115, 116, 117, 118,
- 119, 1, 2, 82, 83, 84, 85, 86, 87, 0,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, 0, 0, 0, 18,
- 19, 20, 21, 104, 22, 23, 24, 25, 26, 27,
- 105, 106, 107, 108, 109, 0, 0, 0, 110, 111,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 112, 0, 0,
- 0, 65, 1, 2, 82, 83, 84, 115, 116, 117,
- 118, 119, 0, 0, 0, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 0, 0, 0,
- 18, 19, 20, 21, 0, 22, 23, 24, 25, 26,
- 27, 105, 106, 107, 108, 109, 0, 0, 0, 110,
- 111, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 112, 0,
- 1, 2, 82, 83, 84, 0, 0, 0, 115, 116,
- 117, 118, 119, 92, 93, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, 0, 0, 0, 18, 19,
- 20, 21, 0, 22, 23, 24, 25, 26, 27, 105,
- 106, 107, 108, 109, 0, 0, 0, 110, 111, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 112, 0, 0, 0,
- 163, 164, 165, 0, 0, 0, 0, 116, 117, 118,
- 119, 166, 167, 168, 169, 170, 171, 172, 173, 174,
- 175, 176, 177, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 105, 178, 107,
- 108, 109, 0, 0, 0, 110, 111, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 112, 0, 0, 179, 163, 164,
- 165, 0, 0, 0, 0, 116, 117, 118, 119, 166,
- 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
- 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 105, 178, 107, 108, 109,
- 0, 0, 0, 110, 111, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 112, 0, 0, 0, 163, 164, 165, 0,
- 0, 0, 195, 116, 117, 118, 119, 166, 167, 168,
- 169, 170, 171, 172, 173, 174, 175, 176, 177, 0,
- 0, 0, 0, 0, 0, 210, 0, 0, 0, 0,
- 0, 0, 0, 105, 178, 107, 108, 109, 0, 0,
- 0, 110, 111, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 112, 0, 0, 0, 163, 164, 165, 0, 0, 0,
- 0, 116, 117, 118, 119, 166, 167, 168, 169, 170,
- 171, 172, 173, 174, 175, 176, 177, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 105, 178, 107, 108, 109, 0, 0, 0, 110,
- 111, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 112, 0,
- 0, 252, 163, 164, 165, 0, 0, 0, 0, 116,
- 117, 118, 119, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 105,
- 178, 107, 108, 109, 0, 0, 0, 110, 111, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 112, 0, 0, 0,
- 3, 4, 5, 0, 0, 0, 0, 116, 117, 118,
- 119, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 0, 0, 0, 0, 0, 20, 21,
- 0, 22, 23, 24, 25, 26, 27, 0, 28, 3,
- 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 0, 0, 0, 0, 0, 20, 21, 80,
- 22, 23, 24, 25, 26, 27, 0, 28, 59, 0,
- 0, 1, 2, 3, 4, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 0, 0, 185, 18,
- 19, 20, 21, 0, 22, 23, 24, 25, 26, 27,
- 0, 28, 1, 2, 3, 4, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 0, 0, 0,
- 18, 19, 20, 21, 0, 22, 23, 24, 25, 26,
- 27, 0, 28, 3, 4, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 0, 0, 0, 0,
- 0, 20, 21, 0, 22, 23, 24, 25, 26, 27,
- 0, 28
-};
-
-static const short yycheck[] =
-{
- 75, 91, 162, 158, 37, 262, 161, 3, 4, 0,
- 0, 44, 52, 53, 33, 42, 57, 74, 314, 71,
- 53, 74, 112, 319, 42, 81, 78, 83, 61, 48,
- 63, 186, 28, 29, 30, 31, 32, 79, 71, 3,
- 4, 298, 70, 76, 76, 152, 73, 87, 88, 40,
- 40, 92, 127, 71, 71, 50, 51, 110, 111, 63,
- 69, 42, 71, 73, 28, 29, 30, 31, 32, 78,
- 73, 70, 76, 70, 70, 42, 71, 76, 131, 76,
- 75, 42, 70, 70, 191, 48, 49, 162, 76, 76,
- 233, 234, 235, 236, 76, 250, 76, 79, 69, 79,
- 79, 158, 79, 193, 161, 158, 76, 76, 161, 79,
- 79, 28, 29, 30, 69, 205, 59, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 84, 85, 86, 186,
- 54, 55, 69, 186, 209, 78, 76, 77, 229, 230,
- 237, 238, 231, 232, 69, 79, 69, 69, 69, 224,
- 69, 69, 91, 69, 69, 245, 69, 264, 69, 69,
- 69, 321, 69, 69, 69, 69, 69, 56, 70, 69,
- 90, 246, 262, 226, 227, 228, 229, 230, 231, 232,
- 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
- 243, 244, 299, 250, 74, 89, 58, 250, 71, 47,
- 72, 72, 72, 72, 35, 72, 69, 72, 298, 42,
- 76, 70, 70, 320, 74, 79, 11, 307, 79, 239,
- 241, 78, 244, 48, 240, 71, 54, 242, 318, 243,
- 305, 71, 61, 187, 259, 319, 46, 202, 3, 4,
- 5, 6, 7, 8, 9, 10, 321, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 298, 40, 259, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, -1, -1, -1, 50, 51, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 69, -1, -1, -1, 73, 74,
- -1, -1, -1, -1, 79, 80, 81, 82, 83, 3,
- 4, 5, 6, 7, 8, 9, 10, -1, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, -1, -1, -1, 31, 32, 33,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, -1, -1, -1, 50, 51, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 69, -1, -1, -1, 73,
- 74, -1, -1, -1, -1, 79, 80, 81, 82, 83,
- 3, 4, 5, 6, 7, 8, 9, 10, -1, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, -1, -1, -1, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, -1, -1, -1, 50, 51, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 69, -1, -1, -1,
- 73, -1, -1, -1, -1, -1, 79, 80, 81, 82,
- 83, 3, 4, 5, 6, 7, 8, 9, 10, -1,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, -1, -1, -1, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, -1, -1, -1, 50, 51,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 69, -1, -1,
- -1, 73, 3, 4, 5, 6, 7, 79, 80, 81,
- 82, 83, -1, -1, -1, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, -1, -1, -1,
- 31, 32, 33, 34, -1, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, -1, -1, -1, 50,
- 51, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 69, -1,
- 3, 4, 5, 6, 7, -1, -1, -1, 79, 80,
- 81, 82, 83, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, -1, -1, -1, 31, 32,
- 33, 34, -1, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, -1, -1, -1, 50, 51, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 69, -1, -1, -1,
- 5, 6, 7, -1, -1, -1, -1, 80, 81, 82,
- 83, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, 43, 44,
- 45, 46, -1, -1, -1, 50, 51, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 69, -1, -1, 72, 5, 6,
- 7, -1, -1, -1, -1, 80, 81, 82, 83, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, 43, 44, 45, 46,
- -1, -1, -1, 50, 51, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 69, -1, -1, -1, 5, 6, 7, -1,
- -1, -1, 79, 80, 81, 82, 83, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, -1,
- -1, -1, -1, -1, -1, 34, -1, -1, -1, -1,
- -1, -1, -1, 42, 43, 44, 45, 46, -1, -1,
- -1, 50, 51, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 69, -1, -1, -1, 5, 6, 7, -1, -1, -1,
- -1, 80, 81, 82, 83, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 42, 43, 44, 45, 46, -1, -1, -1, 50,
- 51, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 69, -1,
- -1, 72, 5, 6, 7, -1, -1, -1, -1, 80,
- 81, 82, 83, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 42,
- 43, 44, 45, 46, -1, -1, -1, 50, 51, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 69, -1, -1, -1,
- 5, 6, 7, -1, -1, -1, -1, 80, 81, 82,
- 83, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, -1, -1, -1, -1, -1, 33, 34,
- -1, 36, 37, 38, 39, 40, 41, -1, 43, 5,
- 6, 7, -1, -1, -1, -1, -1, -1, -1, -1,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, -1, -1, -1, -1, -1, 33, 34, 74,
- 36, 37, 38, 39, 40, 41, -1, 43, 0, -1,
- -1, 3, 4, 5, 6, 7, -1, -1, -1, -1,
- -1, -1, -1, -1, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, -1, -1, 74, 31,
- 32, 33, 34, -1, 36, 37, 38, 39, 40, 41,
- -1, 43, 3, 4, 5, 6, 7, -1, -1, -1,
- -1, -1, -1, -1, -1, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, -1, -1, -1,
- 31, 32, 33, 34, -1, 36, 37, 38, 39, 40,
- 41, -1, 43, 5, 6, 7, -1, -1, -1, -1,
- -1, -1, -1, -1, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, -1, -1, -1, -1,
- -1, 33, 34, -1, 36, 37, 38, 39, 40, 41,
- -1, 43
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
-{
- 0, 3, 4, 5, 6, 7, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 31, 32,
- 33, 34, 36, 37, 38, 39, 40, 41, 43, 123,
- 124, 125, 126, 127, 132, 133, 134, 135, 136, 137,
- 164, 165, 166, 42, 73, 79, 167, 70, 76, 28,
- 29, 30, 129, 130, 135, 76, 79, 42, 136, 0,
- 165, 73, 136, 138, 139, 73, 150, 129, 128, 131,
- 136, 130, 42, 69, 71, 78, 138, 42, 140, 141,
- 74, 139, 5, 6, 7, 8, 9, 10, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 35, 42, 43, 44, 45, 46,
- 50, 51, 69, 73, 74, 79, 80, 81, 82, 83,
- 94, 95, 96, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 121, 123, 124, 143, 144,
- 145, 146, 151, 152, 153, 156, 163, 42, 71, 128,
- 131, 71, 78, 5, 6, 7, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 43, 72,
- 105, 118, 122, 119, 142, 74, 71, 76, 79, 79,
- 79, 158, 69, 69, 79, 79, 121, 69, 105, 105,
- 121, 74, 147, 50, 51, 71, 75, 70, 70, 76,
- 34, 119, 69, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 78, 120, 105, 84, 85, 86, 81,
- 83, 48, 49, 52, 53, 87, 88, 54, 55, 91,
- 90, 89, 56, 58, 57, 92, 76, 79, 74, 144,
- 71, 122, 72, 122, 142, 72, 122, 141, 144, 159,
- 121, 79, 157, 70, 151, 97, 121, 47, 119, 119,
- 105, 105, 105, 107, 107, 108, 108, 109, 109, 109,
- 109, 110, 110, 111, 112, 113, 114, 115, 116, 121,
- 119, 122, 72, 72, 72, 35, 143, 152, 160, 70,
- 121, 134, 155, 148, 72, 77, 72, 69, 155, 161,
- 162, 144, 154, 42, 70, 74, 119, 121, 79, 70,
- 11, 78, 145, 149, 150, 70, 121, 149, 144, 142,
- 79
-};
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrlab1
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-
-#define YYFAIL goto yyerrlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror ("syntax error: cannot back up");\
- YYERROR; \
- } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run). */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.first_line = Rhs[1].first_line; \
- Current.first_column = Rhs[1].first_column; \
- Current.last_line = Rhs[N].last_line; \
- Current.last_column = Rhs[N].last_column;
-#endif
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval)
-#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-# define YYDSYMPRINT(Args) \
-do { \
- if (yydebug) \
- yysymprint Args; \
-} while (0)
-
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Token, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (cinluded). |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short *bottom, short *top)
-#else
-static void
-yy_stack_print (bottom, top)
- short *bottom;
- short *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
- int yyrule;
-#endif
-{
- int yyi;
- unsigned int yylineno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
- yyrule - 1, yylineno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
-}
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#if YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- register char *yyd = yydest;
- register const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-#endif /* !YYERROR_VERBOSE */
-
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- {
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- }
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
-}
-
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yytype, yyvaluep)
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
- /* The lookahead symbol. */
-int yychar;
-
-/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
- register int yystate;
- register int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
- register short *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK (yyvsp--, yyssp--)
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyss + yystacksize - 1 <= yyssp)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
-# else
- /* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
- yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
-
- {
- short *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyoverflowlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- if (yychar <= YYEOF)
- {
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yytoken = YYTRANSLATE (yychar);
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
- goto yydefault;
- yyn = yytable[yyn];
- if (yyn <= 0)
- {
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-#line 210 "glslang.y"
- {
- // The symbol table search was done in the lexical phase
- const TSymbol* symbol = yyvsp[0].lex.symbol;
- const TVariable* variable;
- if (symbol == 0) {
- parseContext.error(yyvsp[0].lex.line, "undeclared identifier", yyvsp[0].lex.string->c_str(), "");
- parseContext.recover();
- TType type(EbtFloat);
- TVariable* fakeVariable = new TVariable(yyvsp[0].lex.string, type);
- parseContext.symbolTable.insert(*fakeVariable);
- variable = fakeVariable;
- } else {
- // This identifier can only be a variable type symbol
- if (! symbol->isVariable()) {
- parseContext.error(yyvsp[0].lex.line, "variable expected", yyvsp[0].lex.string->c_str(), "");
- parseContext.recover();
- }
- variable = static_cast<const TVariable*>(symbol);
- }
-
- // don't delete $1.string, it's used by error recovery, and the pool
- // pop will reclaim the memory
-
- if (variable->getType().getQualifier() == EvqConst ) {
- constUnion* constArray = variable->getConstPointer();
- TType t(variable->getType());
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(constArray, t, yyvsp[0].lex.line);
- } else
- yyval.interm.intermTypedNode = parseContext.intermediate.addSymbol(variable->getUniqueId(),
- variable->getName(),
- variable->getType(), yyvsp[0].lex.line);
- ;}
- break;
-
- case 3:
-#line 245 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 4:
-#line 248 "glslang.y"
- {
- //
- // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
- // check for overflow for constants
- //
- if (abs(yyvsp[0].lex.i) >= (1 << 16)) {
- parseContext.error(yyvsp[0].lex.line, " integer constant overflow", "", "");
- parseContext.recover();
- }
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = yyvsp[0].lex.i;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
- ;}
- break;
-
- case 5:
-#line 261 "glslang.y"
- {
- constUnion *unionArray = new constUnion[1];
- unionArray->fConst = yyvsp[0].lex.f;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), yyvsp[0].lex.line);
- ;}
- break;
-
- case 6:
-#line 266 "glslang.y"
- {
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = yyvsp[0].lex.b;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[0].lex.line);
- ;}
- break;
-
- case 7:
-#line 271 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode;
- ;}
- break;
-
- case 8:
-#line 277 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 9:
-#line 280 "glslang.y"
- {
- if (!yyvsp[-3].interm.intermTypedNode->isArray() && !yyvsp[-3].interm.intermTypedNode->isMatrix() && !yyvsp[-3].interm.intermTypedNode->isVector()) {
- if (yyvsp[-3].interm.intermTypedNode->getAsSymbolNode())
- parseContext.error(yyvsp[-2].lex.line, " left of '[' is not of type array, matrix, or vector ", yyvsp[-3].interm.intermTypedNode->getAsSymbolNode()->getSymbol().c_str(), "");
- else
- parseContext.error(yyvsp[-2].lex.line, " left of '[' is not of type array, matrix, or vector ", "expression", "");
- parseContext.recover();
- }
- if (yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst && !yyvsp[-3].interm.intermTypedNode->isArray() && yyvsp[-1].interm.intermTypedNode->getQualifier() == EvqConst) {
- if (yyvsp[-3].interm.intermTypedNode->isVector()) { // constant folding for vectors
- TVectorFields fields;
- fields.num = 1;
- fields.offsets[0] = yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst; // need to do it this way because v.xy sends fields integer array
- yyval.interm.intermTypedNode = parseContext.addConstVectorNode(fields, yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line);
- } else if (yyvsp[-3].interm.intermTypedNode->isMatrix()) { // constant folding for matrices
- yyval.interm.intermTypedNode = parseContext.addConstMatrixNode(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst, yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line);
- }
- } else {
- if (yyvsp[-1].interm.intermTypedNode->getQualifier() == EvqConst) {
- if ((yyvsp[-3].interm.intermTypedNode->isVector() || yyvsp[-3].interm.intermTypedNode->isMatrix()) && yyvsp[-3].interm.intermTypedNode->getType().getNominalSize() <= yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst && !yyvsp[-3].interm.intermTypedNode->isArray() ) {
- parseContext.error(yyvsp[-2].lex.line, "", "[", "field selection out of range '%d'", yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- parseContext.recover();
- } else {
- if (yyvsp[-3].interm.intermTypedNode->isArray()) {
- if (yyvsp[-3].interm.intermTypedNode->getType().getArraySize() == 0) {
- if (yyvsp[-3].interm.intermTypedNode->getType().getMaxArraySize() <= yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst) {
- if (parseContext.arraySetMaxSize(yyvsp[-3].interm.intermTypedNode->getAsSymbolNode(), yyvsp[-3].interm.intermTypedNode->getTypePointer(), yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst, true, yyvsp[-2].lex.line))
- parseContext.recover();
- } else {
- if (parseContext.arraySetMaxSize(yyvsp[-3].interm.intermTypedNode->getAsSymbolNode(), yyvsp[-3].interm.intermTypedNode->getTypePointer(), 0, false, yyvsp[-2].lex.line))
- parseContext.recover();
- }
- } else if ( yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst >= yyvsp[-3].interm.intermTypedNode->getType().getArraySize()) {
- parseContext.error(yyvsp[-2].lex.line, "", "[", "array index out of range '%d'", yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- parseContext.recover();
- }
- }
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-3].interm.intermTypedNode, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line);
- }
- } else {
- if (yyvsp[-3].interm.intermTypedNode->isArray() && yyvsp[-3].interm.intermTypedNode->getType().getArraySize() == 0) {
- parseContext.error(yyvsp[-2].lex.line, "", "[", "array must be redeclared with a size before being indexed with a variable");
- parseContext.recover();
- }
-
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexIndirect, yyvsp[-3].interm.intermTypedNode, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line);
- }
- }
- if (yyval.interm.intermTypedNode == 0) {
- constUnion *unionArray = new constUnion[1];
- unionArray->fConst = 0.0;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), yyvsp[-2].lex.line);
- } else if (yyvsp[-3].interm.intermTypedNode->isArray()) {
- if (yyvsp[-3].interm.intermTypedNode->getType().getStruct())
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getType().getStruct(), yyvsp[-3].interm.intermTypedNode->getType().getTypeName()));
- else
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqTemporary, yyvsp[-3].interm.intermTypedNode->getNominalSize(), yyvsp[-3].interm.intermTypedNode->isMatrix()));
- } else if (yyvsp[-3].interm.intermTypedNode->isMatrix() && yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst)
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqConst, yyvsp[-3].interm.intermTypedNode->getNominalSize()));
- else if (yyvsp[-3].interm.intermTypedNode->isMatrix())
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqTemporary, yyvsp[-3].interm.intermTypedNode->getNominalSize()));
- else if (yyvsp[-3].interm.intermTypedNode->isVector() && yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst)
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqConst));
- else if (yyvsp[-3].interm.intermTypedNode->isVector())
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), EvqTemporary));
- else
- yyval.interm.intermTypedNode->setType(yyvsp[-3].interm.intermTypedNode->getType());
- ;}
- break;
-
- case 10:
-#line 348 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 11:
-#line 351 "glslang.y"
- {
- if (yyvsp[-2].interm.intermTypedNode->isArray()) {
- parseContext.error(yyvsp[0].lex.line, "cannot apply dot operator to an array", ".", "");
- parseContext.recover();
- }
-
- if (yyvsp[-2].interm.intermTypedNode->isVector()) {
- TVectorFields fields;
- if (! parseContext.parseVectorFields(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode->getNominalSize(), fields, yyvsp[0].lex.line)) {
- fields.num = 1;
- fields.offsets[0] = 0;
- parseContext.recover();
- }
-
- if (yyvsp[-2].interm.intermTypedNode->getType().getQualifier() == EvqConst) { // constant folding for vector fields
- yyval.interm.intermTypedNode = parseContext.addConstVectorNode(fields, yyvsp[-2].interm.intermTypedNode, yyvsp[0].lex.line);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- else
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), EvqConst, (int) (*yyvsp[0].lex.string).size()));
- } else {
- if (fields.num == 1) {
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = fields.offsets[0];
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType()));
- } else {
- TString vectorString = *yyvsp[0].lex.string;
- TIntermTyped* index = parseContext.intermediate.addSwizzle(fields, yyvsp[0].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpVectorSwizzle, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(),EvqTemporary, (int) vectorString.size()));
- }
- }
- } else if (yyvsp[-2].interm.intermTypedNode->isMatrix()) {
- TMatrixFields fields;
- if (! parseContext.parseMatrixFields(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode->getNominalSize(), fields, yyvsp[0].lex.line)) {
- fields.wholeRow = false;
- fields.wholeCol = false;
- fields.row = 0;
- fields.col = 0;
- parseContext.recover();
- }
-
- if (fields.wholeRow || fields.wholeCol) {
- parseContext.error(yyvsp[-1].lex.line, " non-scalar fields not implemented yet", ".", "");
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = 0;
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), EvqTemporary, yyvsp[-2].interm.intermTypedNode->getNominalSize()));
- } else {
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = fields.col * yyvsp[-2].interm.intermTypedNode->getNominalSize() + fields.row;
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType()));
- }
- } else if (yyvsp[-2].interm.intermTypedNode->getBasicType() == EbtStruct) {
- bool fieldFound = false;
- TTypeList* fields = yyvsp[-2].interm.intermTypedNode->getType().getStruct();
- if (fields == 0) {
- parseContext.error(yyvsp[-1].lex.line, "structure has no fields", "Internal Error", "");
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- } else {
- unsigned int i;
- for (i = 0; i < fields->size(); ++i) {
- if ((*fields)[i].type->getFieldName() == *yyvsp[0].lex.string) {
- fieldFound = true;
- break;
- }
- }
- if (fieldFound) {
- if (yyvsp[-2].interm.intermTypedNode->getType().getQualifier() == EvqConst) {
- yyval.interm.intermTypedNode = parseContext.addConstStruct(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode, yyvsp[-1].lex.line);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- else {
- yyval.interm.intermTypedNode->setType(*(*fields)[i].type);
- // change the qualifier of the return type, not of the structure field
- // as the structure definition is shared between various structures.
- yyval.interm.intermTypedNode->getTypePointer()->changeQualifier(EvqConst);
- }
- } else {
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = i;
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), yyvsp[0].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addIndex(EOpIndexDirectStruct, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode->setType(*(*fields)[i].type);
- }
- } else {
- parseContext.error(yyvsp[-1].lex.line, " no such field in structure", yyvsp[0].lex.string->c_str(), "");
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- }
- } else {
- parseContext.error(yyvsp[-1].lex.line, " field selection requires structure, vector, or matrix on left hand side", yyvsp[0].lex.string->c_str(), "");
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- // don't delete $3.string, it's from the pool
- ;}
- break;
-
- case 12:
-#line 460 "glslang.y"
- {
- if (parseContext.lValueErrorCheck(yyvsp[0].lex.line, "++", yyvsp[-1].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPostIncrement, yyvsp[-1].interm.intermTypedNode, yyvsp[0].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.unaryOpError(yyvsp[0].lex.line, "++", yyvsp[-1].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 13:
-#line 470 "glslang.y"
- {
- if (parseContext.lValueErrorCheck(yyvsp[0].lex.line, "--", yyvsp[-1].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPostDecrement, yyvsp[-1].interm.intermTypedNode, yyvsp[0].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.unaryOpError(yyvsp[0].lex.line, "--", yyvsp[-1].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 14:
-#line 483 "glslang.y"
- {
- if (parseContext.integerErrorCheck(yyvsp[0].interm.intermTypedNode, "[]"))
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 15:
-#line 491 "glslang.y"
- {
- TFunction* fnCall = yyvsp[0].interm.function;
- TOperator op = fnCall->getBuiltInOp();
-
- if (op != EOpNull) {
- //
- // Then this should be a constructor.
- //
- TType type(EbtVoid); // use this to get the type back
- if (parseContext.constructorErrorCheck(yyvsp[0].interm.line, yyvsp[0].interm.intermNode, *fnCall, op, &type)) {
- yyval.interm.intermTypedNode = 0;
- } else {
- //
- // It's a constructor, of type 'type'.
- //
- yyval.interm.intermTypedNode = parseContext.addConstructor(yyvsp[0].interm.intermNode, &type, op, fnCall, yyvsp[0].interm.line);
- }
-
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.recover();
- yyval.interm.intermTypedNode = parseContext.intermediate.setAggregateOperator(0, op, yyvsp[0].interm.line);
- }
- yyval.interm.intermTypedNode->setType(type);
- } else {
- //
- // Not a constructor. Find it in the symbol table.
- //
- const TFunction* fnCandidate;
- bool builtIn;
- fnCandidate = parseContext.findFunction(yyvsp[0].interm.line, fnCall, &builtIn);
- if (fnCandidate) {
- //
- // A declared function. But, it might still map to a built-in
- // operation.
- //
- op = fnCandidate->getBuiltInOp();
- if (builtIn && op != EOpNull) {
- //
- // A function call mapped to a built-in operation.
- //
- if (fnCandidate->getParamCount() == 1) {
- //
- // Treat it like a built-in unary operator.
- //
- yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(op, yyvsp[0].interm.intermNode, 0, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.error(yyvsp[0].interm.intermNode->getLine(), " wrong operand type", "Internal Error",
- "built in unary operator function. Type: %s",
- static_cast<TIntermTyped*>(yyvsp[0].interm.intermNode)->getCompleteString().c_str());
- YYERROR;
- }
- } else {
- yyval.interm.intermTypedNode = parseContext.intermediate.setAggregateOperator(yyvsp[0].interm.intermAggregate, op, yyvsp[0].interm.line);
- }
- } else {
- // This is a real function call
-
- yyval.interm.intermTypedNode = parseContext.intermediate.setAggregateOperator(yyvsp[0].interm.intermAggregate, EOpFunctionCall, yyvsp[0].interm.line);
- yyval.interm.intermTypedNode->setType(fnCandidate->getReturnType());
-
- // this is how we know whether the given function is a builtIn function or a user defined function
- // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
- // if builtIn == true, it's definitely a builtIn function with EOpNull
- if (!builtIn)
- yyval.interm.intermTypedNode->getAsAggregate()->setUserDefined();
- yyval.interm.intermTypedNode->getAsAggregate()->setName(fnCandidate->getMangledName());
-
- TQualifier qual;
- TQualifierList& qualifierList = yyval.interm.intermTypedNode->getAsAggregate()->getQualifier();
- for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
- qual = (*fnCandidate)[i].type->getQualifier();
- if (qual == EvqOut || qual == EvqInOut) {
- if (parseContext.lValueErrorCheck(yyval.interm.intermTypedNode->getLine(), "assign", yyval.interm.intermTypedNode->getAsAggregate()->getSequence()[i]->getAsTyped())) {
- parseContext.error(yyvsp[0].interm.intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error", "");
- parseContext.recover();
- }
- }
- qualifierList.push_back(qual);
- }
- }
- yyval.interm.intermTypedNode->setType(fnCandidate->getReturnType());
- } else {
- // error message was put out by PaFindFunction()
- // Put on a dummy node for error recovery
- constUnion *unionArray = new constUnion[1];
- unionArray->fConst = 0.0;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), yyvsp[0].interm.line);
- parseContext.recover();
- }
- }
- delete fnCall;
- ;}
- break;
-
- case 16:
-#line 586 "glslang.y"
- {
- yyval.interm = yyvsp[-1].interm;
- yyval.interm.line = yyvsp[0].lex.line;
- ;}
- break;
-
- case 17:
-#line 590 "glslang.y"
- {
- yyval.interm = yyvsp[-1].interm;
- yyval.interm.line = yyvsp[0].lex.line;
- ;}
- break;
-
- case 18:
-#line 597 "glslang.y"
- {
- yyval.interm.function = yyvsp[-1].interm.function;
- yyval.interm.intermNode = 0;
- ;}
- break;
-
- case 19:
-#line 601 "glslang.y"
- {
- yyval.interm.function = yyvsp[0].interm.function;
- yyval.interm.intermNode = 0;
- ;}
- break;
-
- case 20:
-#line 608 "glslang.y"
- {
- TParameter param = { 0, new TType(yyvsp[0].interm.intermTypedNode->getType()) };
- yyvsp[-1].interm.function->addParameter(param);
- yyval.interm.function = yyvsp[-1].interm.function;
- yyval.interm.intermNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 21:
-#line 614 "glslang.y"
- {
- TParameter param = { 0, new TType(yyvsp[0].interm.intermTypedNode->getType()) };
- yyvsp[-2].interm.function->addParameter(param);
- yyval.interm.function = yyvsp[-2].interm.function;
- yyval.interm.intermNode = parseContext.intermediate.growAggregate(yyvsp[-2].interm.intermNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line);
- ;}
- break;
-
- case 22:
-#line 623 "glslang.y"
- {
- yyval.interm.function = yyvsp[-1].interm.function;
- ;}
- break;
-
- case 23:
-#line 629 "glslang.y"
- {
- if (yyvsp[0].interm.op == EOpConstructStruct) {
- TString tempString = "";
- TFunction *function = new TFunction(&tempString, *(yyvsp[0].interm.type.userDef), yyvsp[0].interm.op);
- yyval.interm.function = function;
- }
- else {
- TFunction *function = new TFunction(yyvsp[0].interm.op);
- yyval.interm.function = function;
- }
- ;}
- break;
-
- case 24:
-#line 640 "glslang.y"
- {
- if (parseContext.reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string))
- parseContext.recover();
- TType type(EbtVoid);
- TFunction *function = new TFunction(yyvsp[0].lex.string, type);
- yyval.interm.function = function;
- ;}
- break;
-
- case 25:
-#line 656 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructFloat; ;}
- break;
-
- case 26:
-#line 657 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructInt; ;}
- break;
-
- case 27:
-#line 658 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBool; ;}
- break;
-
- case 28:
-#line 659 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructVec2; ;}
- break;
-
- case 29:
-#line 660 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructVec3; ;}
- break;
-
- case 30:
-#line 661 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructVec4; ;}
- break;
-
- case 31:
-#line 662 "glslang.y"
- { FRAG_VERT_ONLY("bvec2", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBVec2; ;}
- break;
-
- case 32:
-#line 663 "glslang.y"
- { FRAG_VERT_ONLY("bvec3", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBVec3; ;}
- break;
-
- case 33:
-#line 664 "glslang.y"
- { FRAG_VERT_ONLY("bvec4", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructBVec4; ;}
- break;
-
- case 34:
-#line 665 "glslang.y"
- { FRAG_VERT_ONLY("ivec2", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructIVec2; ;}
- break;
-
- case 35:
-#line 666 "glslang.y"
- { FRAG_VERT_ONLY("ivec3", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructIVec3; ;}
- break;
-
- case 36:
-#line 667 "glslang.y"
- { FRAG_VERT_ONLY("ivec4", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructIVec4; ;}
- break;
-
- case 37:
-#line 668 "glslang.y"
- { FRAG_VERT_ONLY("mat2", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructMat2; ;}
- break;
-
- case 38:
-#line 669 "glslang.y"
- { FRAG_VERT_ONLY("mat3", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructMat3; ;}
- break;
-
- case 39:
-#line 670 "glslang.y"
- { FRAG_VERT_ONLY("mat4", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpConstructMat4; ;}
- break;
-
- case 40:
-#line 671 "glslang.y"
- {
- TType& structure = static_cast<TVariable*>(yyvsp[0].lex.symbol)->getType();
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtStruct, qual, 1, false, false, &structure, yyvsp[0].lex.line };
- yyval.interm.type = t;
- yyval.interm.line = yyvsp[0].lex.line;
- yyval.interm.op = EOpConstructStruct;
- ;}
- break;
-
- case 41:
-#line 682 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 42:
-#line 685 "glslang.y"
- {
- if (parseContext.lValueErrorCheck(yyvsp[-1].lex.line, "++", yyvsp[0].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPreIncrement, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.unaryOpError(yyvsp[-1].lex.line, "++", yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 43:
-#line 695 "glslang.y"
- {
- if (parseContext.lValueErrorCheck(yyvsp[-1].lex.line, "--", yyvsp[0].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(EOpPreDecrement, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.unaryOpError(yyvsp[-1].lex.line, "--", yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 44:
-#line 705 "glslang.y"
- {
- if (yyvsp[-1].interm.op != EOpNull) {
- yyval.interm.intermTypedNode = parseContext.intermediate.addUnaryMath(yyvsp[-1].interm.op, yyvsp[0].interm.intermTypedNode, yyvsp[-1].interm.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- char* errorOp = "";
- switch(yyvsp[-1].interm.op) {
- case EOpNegative: errorOp = "-"; break;
- case EOpLogicalNot: errorOp = "!"; break;
- case EOpBitwiseNot: errorOp = "~"; break;
- default: break;
- }
- parseContext.unaryOpError(yyvsp[-1].interm.line, errorOp, yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- }
- } else
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 45:
-#line 727 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpNull; ;}
- break;
-
- case 46:
-#line 728 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpNegative; ;}
- break;
-
- case 47:
-#line 729 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpLogicalNot; ;}
- break;
-
- case 48:
-#line 730 "glslang.y"
- { PACK_UNPACK_ONLY("~", yyvsp[0].lex.line);
- yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpBitwiseNot; ;}
- break;
-
- case 49:
-#line 736 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 50:
-#line 737 "glslang.y"
- {
- FRAG_VERT_ONLY("*", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpMul, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "*", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 51:
-#line 746 "glslang.y"
- {
- FRAG_VERT_ONLY("/", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpDiv, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "/", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 52:
-#line 755 "glslang.y"
- {
- PACK_UNPACK_ONLY("%", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpMod, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "%", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 53:
-#line 767 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 54:
-#line 768 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpAdd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "+", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 55:
-#line 776 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpSub, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "-", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 56:
-#line 787 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 57:
-#line 788 "glslang.y"
- {
- PACK_UNPACK_ONLY("<<", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLeftShift, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "<<", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 58:
-#line 797 "glslang.y"
- {
- PACK_UNPACK_ONLY(">>", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpRightShift, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, ">>", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 59:
-#line 809 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 60:
-#line 810 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLessThan, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "<", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 61:
-#line 820 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpGreaterThan, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, ">", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 62:
-#line 830 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLessThanEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "<=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 63:
-#line 840 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpGreaterThanEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, ">=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 64:
-#line 853 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 65:
-#line 854 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "==", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 66:
-#line 864 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpNotEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "!=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 67:
-#line 877 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 68:
-#line 878 "glslang.y"
- {
- PACK_UNPACK_ONLY("&", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpAnd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "&", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 69:
-#line 890 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 70:
-#line 891 "glslang.y"
- {
- PACK_UNPACK_ONLY("^", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpExclusiveOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "^", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 71:
-#line 903 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 72:
-#line 904 "glslang.y"
- {
- PACK_UNPACK_ONLY("|", yyvsp[-1].lex.line);
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpInclusiveOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "|", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 73:
-#line 916 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 74:
-#line 917 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLogicalAnd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "&&", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 75:
-#line 930 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 76:
-#line 931 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLogicalXor, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "^^", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 77:
-#line 944 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 78:
-#line 945 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addBinaryMath(EOpLogicalOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext.symbolTable);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, "||", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- yyval.interm.intermTypedNode = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), yyvsp[-1].lex.line);
- }
- ;}
- break;
-
- case 79:
-#line 958 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 80:
-#line 959 "glslang.y"
- {
- if (parseContext.boolErrorCheck(yyvsp[-3].lex.line, yyvsp[-4].interm.intermTypedNode))
- parseContext.recover();
-
- yyval.interm.intermTypedNode = parseContext.intermediate.addSelection(yyvsp[-4].interm.intermTypedNode, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-3].lex.line);
- if (yyvsp[-2].interm.intermTypedNode->getType() != yyvsp[0].interm.intermTypedNode->getType())
- yyval.interm.intermTypedNode = 0;
-
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-3].lex.line, ":", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 81:
-#line 976 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 82:
-#line 977 "glslang.y"
- {
- if (parseContext.lValueErrorCheck(yyvsp[-1].interm.line, "assign", yyvsp[-2].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermTypedNode = parseContext.intermediate.addAssign(yyvsp[-1].interm.op, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].interm.line);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.assignError(yyvsp[-1].interm.line, "assign", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 83:
-#line 990 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAssign; ;}
- break;
-
- case 84:
-#line 991 "glslang.y"
- { FRAG_VERT_ONLY("*=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpMulAssign; ;}
- break;
-
- case 85:
-#line 992 "glslang.y"
- { FRAG_VERT_ONLY("/=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpDivAssign; ;}
- break;
-
- case 86:
-#line 993 "glslang.y"
- { PACK_UNPACK_ONLY("%=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpModAssign; ;}
- break;
-
- case 87:
-#line 994 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAddAssign; ;}
- break;
-
- case 88:
-#line 995 "glslang.y"
- { yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpSubAssign; ;}
- break;
-
- case 89:
-#line 996 "glslang.y"
- { PACK_UNPACK_ONLY("<<=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpLeftShiftAssign; ;}
- break;
-
- case 90:
-#line 997 "glslang.y"
- { PACK_UNPACK_ONLY("<<=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpRightShiftAssign; ;}
- break;
-
- case 91:
-#line 998 "glslang.y"
- { PACK_UNPACK_ONLY("&=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAndAssign; ;}
- break;
-
- case 92:
-#line 999 "glslang.y"
- { PACK_UNPACK_ONLY("^=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpExclusiveOrAssign; ;}
- break;
-
- case 93:
-#line 1000 "glslang.y"
- { PACK_UNPACK_ONLY("|=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpInclusiveOrAssign; ;}
- break;
-
- case 94:
-#line 1004 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 95:
-#line 1007 "glslang.y"
- {
- yyval.interm.intermTypedNode = parseContext.intermediate.addComma(yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line);
- if (yyval.interm.intermTypedNode == 0) {
- parseContext.binaryOpError(yyvsp[-1].lex.line, ",", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString());
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- }
- ;}
- break;
-
- case 96:
-#line 1018 "glslang.y"
- {
- if (parseContext.constErrorCheck(yyvsp[0].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 97:
-#line 1026 "glslang.y"
- { yyval.interm.intermNode = 0; ;}
- break;
-
- case 98:
-#line 1027 "glslang.y"
- {
- if (yyvsp[-1].interm.intermAggregate)
- yyvsp[-1].interm.intermAggregate->setOperator(EOpSequence);
- yyval.interm.intermNode = yyvsp[-1].interm.intermAggregate;
- ;}
- break;
-
- case 99:
-#line 1035 "glslang.y"
- {
- //
- // Multiple declarations of the same function are allowed.
- //
- // If this is a definition, the definition production code will check for redefinitions
- // (we don't know at this point if it's a definition or not).
- //
- // Redeclarations are allowed. But, return types and parameter qualifiers must match.
- //
- TFunction* prevDec = static_cast<TFunction*>(parseContext.symbolTable.find(yyvsp[-1].interm.function->getMangledName()));
- if (prevDec) {
- if (prevDec->getReturnType() != yyvsp[-1].interm.function->getReturnType()) {
- parseContext.error(yyvsp[0].lex.line, "overloaded functions must have the same return type", yyvsp[-1].interm.function->getReturnType().getBasicString(), "");
- parseContext.recover();
- }
- for (int i = 0; i < prevDec->getParamCount(); ++i) {
- if ((*prevDec)[i].type->getQualifier() != (*yyvsp[-1].interm.function)[i].type->getQualifier()) {
- parseContext.error(yyvsp[0].lex.line, "overloaded functions must have the same parameter qualifiers", (*yyvsp[-1].interm.function)[i].type->getQualifierString(), "");
- parseContext.recover();
- }
- }
- }
-
- //
- // If this is a redeclaration, it could also be a definition,
- // in which case, we want to use the variable names from this one, and not the one that's
- // being redeclared. So, pass back up this declaration, not the one in the symbol table.
- //
- yyval.interm.function = yyvsp[-1].interm.function;
- yyval.interm.line = yyvsp[0].lex.line;
-
- parseContext.symbolTable.insert(*yyval.interm.function);
- ;}
- break;
-
- case 100:
-#line 1071 "glslang.y"
- {
- yyval.interm.function = yyvsp[0].interm.function;
- ;}
- break;
-
- case 101:
-#line 1074 "glslang.y"
- {
- yyval.interm.function = yyvsp[0].interm.function;
- ;}
- break;
-
- case 102:
-#line 1081 "glslang.y"
- {
- // Add the parameter
- yyval.interm.function = yyvsp[-1].interm.function;
- if (yyvsp[0].interm.param.type->getBasicType() != EbtVoid)
- yyvsp[-1].interm.function->addParameter(yyvsp[0].interm.param);
- else
- delete yyvsp[0].interm.param.type;
- ;}
- break;
-
- case 103:
-#line 1089 "glslang.y"
- {
- //
- // Only first parameter of one-parameter functions can be void
- // The check for named parameters not being void is done in parameter_declarator
- //
- if (yyvsp[0].interm.param.type->getBasicType() == EbtVoid) {
- //
- // This parameter > first is void
- //
- parseContext.error(yyvsp[-1].lex.line, "cannot be an argument type except for '(void)'", "void", "");
- parseContext.recover();
- delete yyvsp[0].interm.param.type;
- } else {
- // Add the parameter
- yyval.interm.function = yyvsp[-2].interm.function;
- yyvsp[-2].interm.function->addParameter(yyvsp[0].interm.param);
- }
- ;}
- break;
-
- case 104:
-#line 1110 "glslang.y"
- {
- if (yyvsp[-2].interm.type.qualifier != EvqGlobal && yyvsp[-2].interm.type.qualifier != EvqTemporary) {
- parseContext.error(yyvsp[-1].lex.line, "no qualifiers allowed for function return", getQualifierString(yyvsp[-2].interm.type.qualifier), "");
- parseContext.recover();
- }
- // make sure a sampler is not involved as well...
- if (parseContext.structQualifierErrorCheck(yyvsp[-1].lex.line, yyvsp[-2].interm.type))
- parseContext.recover();
-
- // Add the function as a prototype after parsing it (we do not support recursion)
- TFunction *function;
- TType type(yyvsp[-2].interm.type);
- function = new TFunction(yyvsp[-1].lex.string, type);
- yyval.interm.function = function;
- ;}
- break;
-
- case 105:
-#line 1129 "glslang.y"
- {
- if (yyvsp[-1].interm.type.type == EbtVoid) {
- parseContext.error(yyvsp[0].lex.line, "illegal use of type 'void'", yyvsp[0].lex.string->c_str(), "");
- parseContext.recover();
- }
- if (parseContext.reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string))
- parseContext.recover();
- TParameter param = {yyvsp[0].lex.string, new TType(yyvsp[-1].interm.type)};
- yyval.interm.line = yyvsp[0].lex.line;
- yyval.interm.param = param;
- ;}
- break;
-
- case 106:
-#line 1140 "glslang.y"
- {
- // Check that we can make an array out of this type
- if (yyvsp[-4].interm.type.array) {
- parseContext.error(yyvsp[-2].lex.line, "cannot declare arrays of this type", TType(yyvsp[-4].interm.type).getCompleteString().c_str(), "");
- parseContext.recover();
- }
- if (parseContext.reservedErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string))
- parseContext.recover();
- yyvsp[-4].interm.type.array = true;
- TType* type = new TType(yyvsp[-4].interm.type);
- if (yyvsp[-1].interm.intermTypedNode->getAsConstantUnion())
- type->setArraySize(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- TParameter param = { yyvsp[-3].lex.string, type };
- yyval.interm.line = yyvsp[-3].lex.line;
- yyval.interm.param = param;
- ;}
- break;
-
- case 107:
-#line 1167 "glslang.y"
- {
- yyval.interm = yyvsp[0].interm;
- if (parseContext.paramErrorCheck(yyvsp[0].interm.line, yyvsp[-2].interm.type.qualifier, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
- parseContext.recover();
- ;}
- break;
-
- case 108:
-#line 1172 "glslang.y"
- {
- yyval.interm = yyvsp[0].interm;
- if (parseContext.parameterSamplerErrorCheck(yyvsp[0].interm.line, yyvsp[-1].interm.qualifier, *yyvsp[0].interm.param.type))
- parseContext.recover();
- if (parseContext.paramErrorCheck(yyvsp[0].interm.line, EvqTemporary, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
- parseContext.recover();
- ;}
- break;
-
- case 109:
-#line 1182 "glslang.y"
- {
- yyval.interm = yyvsp[0].interm;
- if (parseContext.paramErrorCheck(yyvsp[0].interm.line, yyvsp[-2].interm.type.qualifier, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
- parseContext.recover();
- ;}
- break;
-
- case 110:
-#line 1187 "glslang.y"
- {
- yyval.interm = yyvsp[0].interm;
- if (parseContext.parameterSamplerErrorCheck(yyvsp[0].interm.line, yyvsp[-1].interm.qualifier, *yyvsp[0].interm.param.type))
- parseContext.recover();
- if (parseContext.paramErrorCheck(yyvsp[0].interm.line, EvqTemporary, yyvsp[-1].interm.qualifier, yyval.interm.param.type))
- parseContext.recover();
- ;}
- break;
-
- case 111:
-#line 1197 "glslang.y"
- {
- yyval.interm.qualifier = EvqIn;
- ;}
- break;
-
- case 112:
-#line 1200 "glslang.y"
- {
- yyval.interm.qualifier = EvqIn;
- ;}
- break;
-
- case 113:
-#line 1203 "glslang.y"
- {
- yyval.interm.qualifier = EvqOut;
- ;}
- break;
-
- case 114:
-#line 1206 "glslang.y"
- {
- yyval.interm.qualifier = EvqInOut;
- ;}
- break;
-
- case 115:
-#line 1212 "glslang.y"
- {
- TParameter param = { 0, new TType(yyvsp[0].interm.type) };
- yyval.interm.param = param;
-
- ;}
- break;
-
- case 116:
-#line 1217 "glslang.y"
- {
- // Check that we can make an array out of this type
- if (yyvsp[-3].interm.type.array) {
- parseContext.error(yyvsp[-2].lex.line, "cannot declare arrays of this type", TType(yyvsp[-3].interm.type).getCompleteString().c_str(), "");
- parseContext.recover();
- }
- yyvsp[-3].interm.type.array = true;
- TType* type = new TType(yyvsp[-3].interm.type);
- if (yyvsp[-1].interm.intermTypedNode->getAsConstantUnion())
- type->setArraySize(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
-
- TParameter param = { 0, type };
- yyval.interm.line = yyvsp[-2].lex.line;
- yyval.interm.param = param;
- ;}
- break;
-
- case 117:
-#line 1235 "glslang.y"
- {
- yyval.interm = yyvsp[0].interm;
- ;}
- break;
-
- case 118:
-#line 1238 "glslang.y"
- {
- yyval.interm = yyvsp[-2].interm;
- if (parseContext.structQualifierErrorCheck(yyvsp[0].lex.line, yyvsp[-2].interm.type))
- parseContext.recover();
-
- if (parseContext.nonInitErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type))
- parseContext.recover();
- ;}
- break;
-
- case 119:
-#line 1246 "glslang.y"
- {
- yyval.interm = yyvsp[-4].interm;
- if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck(yyvsp[-1].lex.line, *yyvsp[-2].lex.string, yyval.interm.type, 0))
- parseContext.recover();
- ;}
- break;
-
- case 120:
-#line 1254 "glslang.y"
- {
- yyval.interm = yyvsp[-5].interm;
- if (parseContext.structQualifierErrorCheck(yyvsp[-3].lex.line, yyvsp[-5].interm.type))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck(yyvsp[-2].lex.line, *yyvsp[-3].lex.string, yyval.interm.type, yyvsp[-1].interm.intermTypedNode))
- parseContext.recover();
- ;}
- break;
-
- case 121:
-#line 1262 "glslang.y"
- {
- yyval.interm = yyvsp[-4].interm;
- if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type))
- parseContext.recover();
-
- TIntermNode* intermNode;
- if (!parseContext.executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-4].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) {
- //
- // build the intermediate representation
- //
- if (intermNode)
- yyval.interm.intermAggregate = parseContext.intermediate.growAggregate(yyvsp[-4].interm.intermNode, intermNode, yyvsp[-1].lex.line);
- else
- yyval.interm.intermAggregate = yyvsp[-4].interm.intermAggregate;
- } else {
- parseContext.recover();
- yyval.interm.intermAggregate = 0;
- }
- ;}
- break;
-
- case 122:
-#line 1284 "glslang.y"
- {
- yyval.interm.type = yyvsp[0].interm.type;
- yyval.interm.intermAggregate = 0;
- ;}
- break;
-
- case 123:
-#line 1288 "glslang.y"
- {
- yyval.interm.intermAggregate = 0;
- yyval.interm.type = yyvsp[-1].interm.type;
- if (parseContext.structQualifierErrorCheck(yyvsp[0].lex.line, yyvsp[-1].interm.type))
- parseContext.recover();
-
- if (parseContext.nonInitErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type))
- parseContext.recover();
- ;}
- break;
-
- case 124:
-#line 1297 "glslang.y"
- {
- yyval.interm.intermAggregate = 0;
- yyval.interm.type = yyvsp[-3].interm.type;
- if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck(yyvsp[-1].lex.line, *yyvsp[-2].lex.string, yyval.interm.type, 0))
- parseContext.recover();
- ;}
- break;
-
- case 125:
-#line 1306 "glslang.y"
- {
- yyval.interm.intermAggregate = 0;
- yyval.interm.type = yyvsp[-4].interm.type;
- if (parseContext.structQualifierErrorCheck(yyvsp[-3].lex.line, yyvsp[-4].interm.type))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck(yyvsp[-2].lex.line, *yyvsp[-3].lex.string, yyval.interm.type, yyvsp[-1].interm.intermTypedNode))
- parseContext.recover();
- ;}
- break;
-
- case 126:
-#line 1315 "glslang.y"
- {
- yyval.interm.type = yyvsp[-3].interm.type;
- if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
- parseContext.recover();
-
- TIntermNode* intermNode;
- if (!parseContext.executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) {
- //
- // Build intermediate representation
- //
- if (intermNode)
- yyval.interm.intermAggregate = parseContext.intermediate.makeAggregate(intermNode, yyvsp[-1].lex.line);
- else
- yyval.interm.intermAggregate = 0;
- } else {
- parseContext.recover();
- yyval.interm.intermAggregate = 0;
- }
- ;}
- break;
-
- case 127:
-#line 1405 "glslang.y"
- {
- yyval.interm.type = yyvsp[0].interm.type;
- ;}
- break;
-
- case 128:
-#line 1408 "glslang.y"
- {
- TPublicType t = { yyvsp[0].interm.type.type, yyvsp[-1].interm.type.qualifier, yyvsp[0].interm.type.size, yyvsp[0].interm.type.matrix, false, yyvsp[0].interm.type.userDef, 0 };
- if (yyvsp[-1].interm.type.qualifier == EvqAttribute &&
- (yyvsp[0].interm.type.type == EbtBool || yyvsp[0].interm.type.type == EbtInt)) {
- parseContext.error(yyvsp[0].interm.type.line, "cannot be bool or int", getQualifierString(yyvsp[-1].interm.type.qualifier), "");
- parseContext.recover();
- }
- if ((yyvsp[-1].interm.type.qualifier == EvqVaryingIn || yyvsp[-1].interm.type.qualifier == EvqVaryingOut) &&
- (yyvsp[0].interm.type.type == EbtBool || yyvsp[0].interm.type.type == EbtInt)) {
- parseContext.error(yyvsp[0].interm.type.line, "cannot be bool or int", getQualifierString(yyvsp[-1].interm.type.qualifier), "");
- parseContext.recover();
- }
- yyval.interm.type = t;
- ;}
- break;
-
- case 129:
-#line 1425 "glslang.y"
- {
- TPublicType t = { EbtVoid, EvqConst, 1, false, false, 0 };
- yyval.interm.type = t;
- ;}
- break;
-
- case 130:
-#line 1429 "glslang.y"
- {
- VERTEX_ONLY("attribute", yyvsp[0].lex.line);
- if (parseContext.globalErrorCheck(yyvsp[0].lex.line, parseContext.symbolTable.atGlobalLevel(), "attribute"))
- parseContext.recover();
- TPublicType t = { EbtVoid, EvqAttribute, 1, false, false, 0 };
- yyval.interm.type = t;
- ;}
- break;
-
- case 131:
-#line 1436 "glslang.y"
- {
- if (parseContext.globalErrorCheck(yyvsp[0].lex.line, parseContext.symbolTable.atGlobalLevel(), "varying"))
- parseContext.recover();
- TPublicType t = { EbtVoid, EvqVaryingIn, 1, false, false, 0 };
- if (parseContext.language == EShLangVertex)
- t.qualifier = EvqVaryingOut;
- yyval.interm.type = t;
- ;}
- break;
-
- case 132:
-#line 1444 "glslang.y"
- {
- if (parseContext.globalErrorCheck(yyvsp[0].lex.line, parseContext.symbolTable.atGlobalLevel(), "uniform"))
- parseContext.recover();
- TPublicType t = { EbtVoid, EvqUniform, 1, false, false, 0 };
- yyval.interm.type = t;
- ;}
- break;
-
- case 133:
-#line 1453 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtVoid, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 134:
-#line 1458 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 135:
-#line 1463 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 136:
-#line 1468 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 137:
-#line 1479 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 2, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 138:
-#line 1484 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 3, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 139:
-#line 1489 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 4, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 140:
-#line 1494 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 2, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 141:
-#line 1499 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 3, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 142:
-#line 1504 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 4, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 143:
-#line 1509 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 2, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 144:
-#line 1514 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 3, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 145:
-#line 1519 "glslang.y"
- {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 4, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 146:
-#line 1524 "glslang.y"
- {
- FRAG_VERT_ONLY("mat2", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 2, true, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 147:
-#line 1530 "glslang.y"
- {
- FRAG_VERT_ONLY("mat3", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 3, true, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 148:
-#line 1536 "glslang.y"
- {
- FRAG_VERT_ONLY("mat4", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 4, true, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 149:
-#line 1542 "glslang.y"
- {
- FRAG_VERT_ONLY("sampler1D", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler1D, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 150:
-#line 1548 "glslang.y"
- {
- FRAG_VERT_ONLY("sampler2D", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler2D, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 151:
-#line 1554 "glslang.y"
- {
- FRAG_VERT_ONLY("sampler3D", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler3D, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 152:
-#line 1560 "glslang.y"
- {
- FRAG_VERT_ONLY("samplerCube", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSamplerCube, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 153:
-#line 1566 "glslang.y"
- {
- FRAG_VERT_ONLY("sampler1DShadow", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler1DShadow, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 154:
-#line 1572 "glslang.y"
- {
- FRAG_VERT_ONLY("sampler2DShadow", yyvsp[0].lex.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler2DShadow, qual, 1, false, false, 0, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 155:
-#line 1578 "glslang.y"
- {
- FRAG_VERT_ONLY("struct", yyvsp[0].interm.type.line);
- yyval.interm.type = yyvsp[0].interm.type;
- yyval.interm.type.qualifier = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- ;}
- break;
-
- case 156:
-#line 1583 "glslang.y"
- {
- //
- // This is for user defined type names. The lexical phase looked up the
- // type.
- //
- TType& structure = static_cast<TVariable*>(yyvsp[0].lex.symbol)->getType();
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtStruct, qual, 1, false, false, &structure, yyvsp[0].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 157:
-#line 1596 "glslang.y"
- {
- TType* structure = new TType(yyvsp[-1].interm.typeList, *yyvsp[-3].lex.string);
- TVariable* userTypeDef = new TVariable(yyvsp[-3].lex.string, *structure, true);
- if (! parseContext.symbolTable.insert(*userTypeDef)) {
- parseContext.error(yyvsp[-3].lex.line, "redefinition", yyvsp[-3].lex.string->c_str(), "struct");
- parseContext.recover();
- }
- TPublicType t = { EbtStruct, EvqTemporary, 1, false, false, structure, yyvsp[-4].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 158:
-#line 1606 "glslang.y"
- {
- TType* structure = new TType(yyvsp[-1].interm.typeList, TString(""));
- TPublicType t = { EbtStruct, EvqTemporary, 1, false, false, structure, yyvsp[-3].lex.line };
- yyval.interm.type = t;
- ;}
- break;
-
- case 159:
-#line 1614 "glslang.y"
- {
- yyval.interm.typeList = yyvsp[0].interm.typeList;
- ;}
- break;
-
- case 160:
-#line 1617 "glslang.y"
- {
- yyval.interm.typeList = yyvsp[-1].interm.typeList;
- for (unsigned int i = 0; i < yyvsp[0].interm.typeList->size(); ++i) {
- for (unsigned int j = 0; j < yyval.interm.typeList->size(); ++j) {
- if ((*yyval.interm.typeList)[j].type->getFieldName() == (*yyvsp[0].interm.typeList)[i].type->getFieldName()) {
- parseContext.error((*yyvsp[0].interm.typeList)[i].line, "duplicate field name in structure:", "struct", (*yyvsp[0].interm.typeList)[i].type->getFieldName().c_str());
- parseContext.recover();
- }
- }
- yyval.interm.typeList->push_back((*yyvsp[0].interm.typeList)[i]);
- }
- ;}
- break;
-
- case 161:
-#line 1632 "glslang.y"
- {
- yyval.interm.typeList = yyvsp[-1].interm.typeList;
-
- if (parseContext.voidErrorCheck(yyvsp[-2].interm.type.line, (*yyvsp[-1].interm.typeList)[0].type->getFieldName(), yyvsp[-2].interm.type)) {
- parseContext.recover();
- }
- for (unsigned int i = 0; i < yyval.interm.typeList->size(); ++i) {
- //
- // Careful not to replace already know aspects of type, like array-ness
- //
- (*yyval.interm.typeList)[i].type->setType(yyvsp[-2].interm.type.type, yyvsp[-2].interm.type.size, yyvsp[-2].interm.type.matrix, yyvsp[-2].interm.type.userDef);
- if (yyvsp[-2].interm.type.userDef)
- (*yyval.interm.typeList)[i].type->setTypeName(yyvsp[-2].interm.type.userDef->getTypeName());
- }
- ;}
- break;
-
- case 162:
-#line 1650 "glslang.y"
- {
- yyval.interm.typeList = NewPoolTTypeList();
- yyval.interm.typeList->push_back(yyvsp[0].interm.typeLine);
- ;}
- break;
-
- case 163:
-#line 1654 "glslang.y"
- {
- yyval.interm.typeList->push_back(yyvsp[0].interm.typeLine);
- ;}
- break;
-
- case 164:
-#line 1660 "glslang.y"
- {
- yyval.interm.typeLine.type = new TType(EbtVoid);
- yyval.interm.typeLine.line = yyvsp[0].lex.line;
- yyval.interm.typeLine.type->setFieldName(*yyvsp[0].lex.string);
- ;}
- break;
-
- case 165:
-#line 1665 "glslang.y"
- {
- yyval.interm.typeLine.type = new TType(EbtVoid);
- yyval.interm.typeLine.line = yyvsp[-3].lex.line;
- yyval.interm.typeLine.type->setFieldName(*yyvsp[-3].lex.string);
-
- if (yyvsp[-1].interm.intermTypedNode->getAsConstantUnion() == 0 || yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getBasicType() != EbtInt ||
- yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst <= 0) {
- parseContext.error(yyvsp[-2].lex.line, "structure field array size must be a positive integer", yyvsp[-3].lex.string->c_str(), "");
- parseContext.recover();
- } else {
- yyval.interm.typeLine.type->setArraySize(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- }
- ;}
- break;
-
- case 166:
-#line 1681 "glslang.y"
- { yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ;}
- break;
-
- case 167:
-#line 1685 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 168:
-#line 1689 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermAggregate; ;}
- break;
-
- case 169:
-#line 1690 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 170:
-#line 1696 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 171:
-#line 1697 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 172:
-#line 1698 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 173:
-#line 1699 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 174:
-#line 1700 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 175:
-#line 1704 "glslang.y"
- { yyval.interm.intermAggregate = 0; ;}
- break;
-
- case 176:
-#line 1705 "glslang.y"
- { parseContext.symbolTable.push(); ;}
- break;
-
- case 177:
-#line 1705 "glslang.y"
- { parseContext.symbolTable.pop(); ;}
- break;
-
- case 178:
-#line 1705 "glslang.y"
- {
- if (yyvsp[-2].interm.intermAggregate != 0)
- yyvsp[-2].interm.intermAggregate->setOperator(EOpSequence);
- yyval.interm.intermAggregate = yyvsp[-2].interm.intermAggregate;
- ;}
- break;
-
- case 179:
-#line 1713 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 180:
-#line 1714 "glslang.y"
- { yyval.interm.intermNode = yyvsp[0].interm.intermNode; ;}
- break;
-
- case 181:
-#line 1719 "glslang.y"
- {
- yyval.interm.intermNode = 0;
- ;}
- break;
-
- case 182:
-#line 1722 "glslang.y"
- {
- if (yyvsp[-1].interm.intermAggregate)
- yyvsp[-1].interm.intermAggregate->setOperator(EOpSequence);
- yyval.interm.intermNode = yyvsp[-1].interm.intermAggregate;
- ;}
- break;
-
- case 183:
-#line 1730 "glslang.y"
- {
- yyval.interm.intermAggregate = parseContext.intermediate.makeAggregate(yyvsp[0].interm.intermNode, 0);
- ;}
- break;
-
- case 184:
-#line 1733 "glslang.y"
- {
- yyval.interm.intermAggregate = parseContext.intermediate.growAggregate(yyvsp[-1].interm.intermAggregate, yyvsp[0].interm.intermNode, 0);
- ;}
- break;
-
- case 185:
-#line 1739 "glslang.y"
- { yyval.interm.intermNode = 0; ;}
- break;
-
- case 186:
-#line 1740 "glslang.y"
- { yyval.interm.intermNode = static_cast<TIntermNode*>(yyvsp[-1].interm.intermTypedNode); ;}
- break;
-
- case 187:
-#line 1744 "glslang.y"
- {
- if (parseContext.boolErrorCheck(yyvsp[-4].lex.line, yyvsp[-2].interm.intermTypedNode))
- parseContext.recover();
- yyval.interm.intermNode = parseContext.intermediate.addSelection(yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.nodePair, yyvsp[-4].lex.line);
- ;}
- break;
-
- case 188:
-#line 1752 "glslang.y"
- {
- yyval.interm.nodePair.node1 = yyvsp[-2].interm.intermNode;
- yyval.interm.nodePair.node2 = yyvsp[0].interm.intermNode;
- ;}
- break;
-
- case 189:
-#line 1756 "glslang.y"
- {
- yyval.interm.nodePair.node1 = yyvsp[0].interm.intermNode;
- yyval.interm.nodePair.node2 = 0;
- ;}
- break;
-
- case 190:
-#line 1766 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- if (parseContext.boolErrorCheck(yyvsp[0].interm.intermTypedNode->getLine(), yyvsp[0].interm.intermTypedNode))
- parseContext.recover();
- ;}
- break;
-
- case 191:
-#line 1771 "glslang.y"
- {
- TIntermNode* intermNode;
- if (parseContext.structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
- parseContext.recover();
- if (parseContext.boolErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type))
- parseContext.recover();
-
- if (!parseContext.executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, yyvsp[0].interm.intermTypedNode, intermNode))
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- else {
- parseContext.recover();
- yyval.interm.intermTypedNode = 0;
- }
- ;}
- break;
-
- case 192:
-#line 1788 "glslang.y"
- { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ;}
- break;
-
- case 193:
-#line 1788 "glslang.y"
- {
- parseContext.symbolTable.pop();
- yyval.interm.intermNode = parseContext.intermediate.addLoop(yyvsp[0].interm.intermNode, yyvsp[-2].interm.intermTypedNode, 0, true, yyvsp[-5].lex.line);
- --parseContext.loopNestingLevel;
- ;}
- break;
-
- case 194:
-#line 1793 "glslang.y"
- { ++parseContext.loopNestingLevel; ;}
- break;
-
- case 195:
-#line 1793 "glslang.y"
- {
- if (parseContext.boolErrorCheck(yyvsp[0].lex.line, yyvsp[-2].interm.intermTypedNode))
- parseContext.recover();
-
- yyval.interm.intermNode = parseContext.intermediate.addLoop(yyvsp[-5].interm.intermNode, yyvsp[-2].interm.intermTypedNode, 0, false, yyvsp[-4].lex.line);
- --parseContext.loopNestingLevel;
- ;}
- break;
-
- case 196:
-#line 1800 "glslang.y"
- { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ;}
- break;
-
- case 197:
-#line 1800 "glslang.y"
- {
- parseContext.symbolTable.pop();
- yyval.interm.intermNode = parseContext.intermediate.makeAggregate(yyvsp[-3].interm.intermNode, yyvsp[-5].lex.line);
- yyval.interm.intermNode = parseContext.intermediate.growAggregate(
- yyval.interm.intermNode,
- parseContext.intermediate.addLoop(yyvsp[0].interm.intermNode, reinterpret_cast<TIntermTyped*>(yyvsp[-2].interm.nodePair.node1), reinterpret_cast<TIntermTyped*>(yyvsp[-2].interm.nodePair.node2), true, yyvsp[-6].lex.line),
- yyvsp[-6].lex.line);
- yyval.interm.intermNode->getAsAggregate()->setOperator(EOpSequence);
- --parseContext.loopNestingLevel;
- ;}
- break;
-
- case 198:
-#line 1813 "glslang.y"
- {
- yyval.interm.intermNode = yyvsp[0].interm.intermNode;
- ;}
- break;
-
- case 199:
-#line 1816 "glslang.y"
- {
- yyval.interm.intermNode = yyvsp[0].interm.intermNode;
- ;}
- break;
-
- case 200:
-#line 1822 "glslang.y"
- {
- yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 201:
-#line 1825 "glslang.y"
- {
- yyval.interm.intermTypedNode = 0;
- ;}
- break;
-
- case 202:
-#line 1831 "glslang.y"
- {
- yyval.interm.nodePair.node1 = yyvsp[-1].interm.intermTypedNode;
- yyval.interm.nodePair.node2 = 0;
- ;}
- break;
-
- case 203:
-#line 1835 "glslang.y"
- {
- yyval.interm.nodePair.node1 = yyvsp[-2].interm.intermTypedNode;
- yyval.interm.nodePair.node2 = yyvsp[0].interm.intermTypedNode;
- ;}
- break;
-
- case 204:
-#line 1842 "glslang.y"
- {
- if (parseContext.loopNestingLevel <= 0) {
- parseContext.error(yyvsp[-1].lex.line, "continue statement only allowed in loops", "", "");
- parseContext.recover();
- }
- yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpContinue, yyvsp[-1].lex.line);
- ;}
- break;
-
- case 205:
-#line 1849 "glslang.y"
- {
- if (parseContext.loopNestingLevel <= 0) {
- parseContext.error(yyvsp[-1].lex.line, "break statement only allowed in loops", "", "");
- parseContext.recover();
- }
- yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpBreak, yyvsp[-1].lex.line);
- ;}
- break;
-
- case 206:
-#line 1856 "glslang.y"
- {
- yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpReturn, yyvsp[-1].lex.line);
- if (parseContext.currentFunctionType->getBasicType() != EbtVoid) {
- parseContext.error(yyvsp[-1].lex.line, "non-void function must return a value", "return", "");
- parseContext.recover();
- }
- ;}
- break;
-
- case 207:
-#line 1863 "glslang.y"
- {
- yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpReturn, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line);
- parseContext.functionReturnsValue = true;
- if (parseContext.currentFunctionType->getBasicType() == EbtVoid) {
- parseContext.error(yyvsp[-2].lex.line, "void function cannot return a value", "return", "");
- parseContext.recover();
- } else if (*(parseContext.currentFunctionType) != yyvsp[-1].interm.intermTypedNode->getType()) {
- parseContext.error(yyvsp[-2].lex.line, "function return is not matching type:", "return", "");
- parseContext.recover();
- }
- ;}
- break;
-
- case 208:
-#line 1874 "glslang.y"
- {
- FRAG_ONLY("discard", yyvsp[-1].lex.line);
- yyval.interm.intermNode = parseContext.intermediate.addBranch(EOpKill, yyvsp[-1].lex.line);
- ;}
- break;
-
- case 209:
-#line 1883 "glslang.y"
- {
- yyval.interm.intermNode = yyvsp[0].interm.intermNode;
- parseContext.treeRoot = yyval.interm.intermNode;
- ;}
- break;
-
- case 210:
-#line 1887 "glslang.y"
- {
- yyval.interm.intermNode = parseContext.intermediate.growAggregate(yyvsp[-1].interm.intermNode, yyvsp[0].interm.intermNode, 0);
- parseContext.treeRoot = yyval.interm.intermNode;
- ;}
- break;
-
- case 211:
-#line 1894 "glslang.y"
- {
- yyval.interm.intermNode = yyvsp[0].interm.intermNode;
- ;}
- break;
-
- case 212:
-#line 1897 "glslang.y"
- {
- yyval.interm.intermNode = yyvsp[0].interm.intermNode;
- ;}
- break;
-
- case 213:
-#line 1903 "glslang.y"
- {
- TFunction& function = *(yyvsp[0].interm.function);
- TFunction* prevDec = static_cast<TFunction*>(parseContext.symbolTable.find(function.getMangledName()));
- //
- // Note: 'prevDec' could be 'function' if this is the first time we've seen function
- // as it would have just been put in the symbol table. Otherwise, we're looking up
- // an earlier occurance.
- //
- if (prevDec->isDefined()) {
- //
- // Then this function already has a body.
- //
- parseContext.error(yyvsp[0].interm.line, "function already has a body", function.getName().c_str(), "");
- parseContext.recover();
- }
- prevDec->setDefined();
-
- //
- // Raise error message if main function takes any parameters or return anything other than void
- //
- if (function.getName() == "main") {
- if (function.getParamCount() > 0) {
- parseContext.error(yyvsp[0].interm.line, "function cannot take any parameter(s)", function.getName().c_str(), "");
- parseContext.recover();
- }
- if (function.getReturnType().getBasicType() != EbtVoid) {
- parseContext.error(yyvsp[0].interm.line, "", function.getReturnType().getBasicString(), "main function cannot return a value" );
- parseContext.recover();
- }
- }
-
- //
- // New symbol table scope for body of function plus its arguments
- //
- parseContext.symbolTable.push();
-
- //
- // Remember the return type for later checking for RETURN statements.
- //
- parseContext.currentFunctionType = &(prevDec->getReturnType());
- parseContext.functionReturnsValue = false;
-
- //
- // Insert parameters into the symbol table.
- // If the parameter has no name, it's not an error, just don't insert it
- // (could be used for unused args).
- //
- // Also, accumulate the list of parameters into the HIL, so lower level code
- // knows where to find parameters.
- //
- TIntermAggregate* paramNodes = new TIntermAggregate;
- for (int i = 0; i < function.getParamCount(); i++) {
- TParameter& param = function[i];
- if (param.name != 0) {
- TVariable *variable = new TVariable(param.name, *param.type);
- //
- // Insert the parameters with name in the symbol table.
- //
- if (! parseContext.symbolTable.insert(*variable)) {
- parseContext.error(yyvsp[0].interm.line, "redefinition", variable->getName().c_str(), "");
- parseContext.recover();
- delete variable;
- }
- //
- // Transfer ownership of name pointer to symbol table.
- //
- param.name = 0;
-
- //
- // Add the parameter to the HIL
- //
- paramNodes = parseContext.intermediate.growAggregate(
- paramNodes,
- parseContext.intermediate.addSymbol(variable->getUniqueId(),
- variable->getName(),
- variable->getType(), yyvsp[0].interm.line),
- yyvsp[0].interm.line);
- } else {
- paramNodes = parseContext.intermediate.growAggregate(paramNodes, parseContext.intermediate.addSymbol(0, "", *param.type, yyvsp[0].interm.line), yyvsp[0].interm.line);
- }
- }
- parseContext.intermediate.setAggregateOperator(paramNodes, EOpParameters, yyvsp[0].interm.line);
- yyvsp[0].interm.intermAggregate = paramNodes;
- parseContext.loopNestingLevel = 0;
- ;}
- break;
-
- case 214:
-#line 1988 "glslang.y"
- {
- //?? Check that all paths return a value if return type != void ?
- // May be best done as post process phase on intermediate code
- if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) {
- parseContext.error(yyvsp[-2].interm.line, "function does not return a value:", "", yyvsp[-2].interm.function->getName().c_str());
- parseContext.recover();
- }
- parseContext.symbolTable.pop();
- yyval.interm.intermNode = parseContext.intermediate.growAggregate(yyvsp[-2].interm.intermAggregate, yyvsp[0].interm.intermNode, 0);
- parseContext.intermediate.setAggregateOperator(yyval.interm.intermNode, EOpFunction, yyvsp[-2].interm.line);
- yyval.interm.intermNode->getAsAggregate()->setName(yyvsp[-2].interm.function->getMangledName().c_str());
- yyval.interm.intermNode->getAsAggregate()->setType(yyvsp[-2].interm.function->getReturnType());
-
- // store the pragma information for debug and optimize and other vendor specific
- // information. This information can be queried from the parse tree
- yyval.interm.intermNode->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
- yyval.interm.intermNode->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
- yyval.interm.intermNode->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable);
- ;}
- break;
-
-
- }
-
-/* Line 999 of yacc.c. */
-#line 4158 "glslang.tab.c"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
- YY_STACK_PRINT (yyss, yyssp);
-
- *++yyvsp = yyval;
-
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- char *yymsg;
- int yyx, yycount;
-
- yycount = 0;
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- yysize += yystrlen (yytname[yyx]) + 15, yycount++;
- yysize += yystrlen ("syntax error, unexpected ") + 1;
- yysize += yystrlen (yytname[yytype]);
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
-
- if (yycount < 5)
- {
- yycount = 0;
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *));
- yyx++)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- const char *yyq = ! yycount ? ", expecting " : " or ";
- yyp = yystpcpy (yyp, yyq);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yycount++;
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
- }
-
-
-
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
-
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- {
- /* Pop the error token. */
- YYPOPSTACK;
- /* Pop the rest of the stack. */
- while (yyss < yyssp)
- {
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- YYPOPSTACK;
- }
- YYABORT;
- }
-
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
- yychar = YYEMPTY;
-
- }
-
- /* Else will try to reuse lookahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
-/*----------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action. |
-`----------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
-
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- yyvsp--;
- yystate = *--yyssp;
-
- YY_STACK_PRINT (yyss, yyssp);
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- YYDPRINTF ((stderr, "Shifting error token, "));
-
- *++yyvsp = yylval;
-
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
- return yyresult;
-}
-
-
-#line 209 "glslang.y"
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/InfoSink.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/InfoSink.cpp
deleted file mode 100755
index 9a1aaa26f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/InfoSink.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "Include/InfoSink.h"
-
-#ifdef _WIN32
- #include <windows.h>
-#endif
-
-void TInfoSinkBase::append(const char *s)
-{
- if (outputStream & EString) {
- checkMem(strlen(s));
- sink.append(s);
- }
-
-#ifdef _WIN32
- if (outputStream & EDebugger)
- OutputDebugString(s);
-#endif
-
- if (outputStream & EStdOut)
- fprintf(stdout, "%s", s);
-}
-
-void TInfoSinkBase::append(int count, char c)
-{
- if (outputStream & EString) {
- checkMem(count);
- sink.append(count, c);
- }
-
-#ifdef _WIN32
- if (outputStream & EDebugger) {
- char str[2];
- str[0] = c;
- str[1] = '\0';
- OutputDebugString(str);
- }
-#endif
-
- if (outputStream & EStdOut)
- fprintf(stdout, "%c", c);
-}
-
-void TInfoSinkBase::append(const TPersistString& t)
-{
- if (outputStream & EString) {
- checkMem(t.size());
- sink.append(t);
- }
-
-#ifdef _WIN32
- if (outputStream & EDebugger)
- OutputDebugString(t.c_str());
-#endif
-
- if (outputStream & EStdOut)
- fprintf(stdout, "%s", t.c_str());
-}
-
-void TInfoSinkBase::append(const TString& t)
-{
- if (outputStream & EString) {
- checkMem(t.size());
- sink.append(t.c_str());
- }
-
-#ifdef _WIN32
- if (outputStream & EDebugger)
- OutputDebugString(t.c_str());
-#endif
-
- if (outputStream & EStdOut)
- fprintf(stdout, "%s", t.c_str());
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.cpp
deleted file mode 100755
index 0913e531a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.cpp
+++ /dev/null
@@ -1,948 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Create strings that declare built-in definitions, add built-ins that
-// cannot be expressed in the files, and establish mappings between
-// built-in functions and operators.
-//
-
-#include "../Include/intermediate.h"
-#include "Initialize.h"
-
-void TBuiltIns::initialize()
-{
- //
- // Initialize all the built-in strings for parsing.
- //
- TString BuiltInFunctions;
- TString BuiltInFunctionsVertex;
- TString BuiltInFunctionsFragment;
- TString StandardVertexVaryings;
- TString StandardFragmentVaryings;
- TString StandardVertexAttributes;
- TString StandardUniforms;
-
- {
- //============================================================================
- //
- // Prototypes for built-in functions seen by both vertex and fragment shaders.
- //
- //============================================================================
-
- TString& s = BuiltInFunctions;
-
- //
- // Angle and Trigonometric Functions.
- //
- s.append(TString("float radians(float degrees);"));
- s.append(TString("vec2 radians(vec2 degrees);"));
- s.append(TString("vec3 radians(vec3 degrees);"));
- s.append(TString("vec4 radians(vec4 degrees);"));
-
- s.append(TString("float degrees(float radians);"));
- s.append(TString("vec2 degrees(vec2 radians);"));
- s.append(TString("vec3 degrees(vec3 radians);"));
- s.append(TString("vec4 degrees(vec4 radians);"));
-
- s.append(TString("float sin(float angle);"));
- s.append(TString("vec2 sin(vec2 angle);"));
- s.append(TString("vec3 sin(vec3 angle);"));
- s.append(TString("vec4 sin(vec4 angle);"));
-
- s.append(TString("float cos(float angle);"));
- s.append(TString("vec2 cos(vec2 angle);"));
- s.append(TString("vec3 cos(vec3 angle);"));
- s.append(TString("vec4 cos(vec4 angle);"));
-
- s.append(TString("float tan(float angle);"));
- s.append(TString("vec2 tan(vec2 angle);"));
- s.append(TString("vec3 tan(vec3 angle);"));
- s.append(TString("vec4 tan(vec4 angle);"));
-
- s.append(TString("float asin(float x);"));
- s.append(TString("vec2 asin(vec2 x);"));
- s.append(TString("vec3 asin(vec3 x);"));
- s.append(TString("vec4 asin(vec4 x);"));
-
- s.append(TString("float acos(float x);"));
- s.append(TString("vec2 acos(vec2 x);"));
- s.append(TString("vec3 acos(vec3 x);"));
- s.append(TString("vec4 acos(vec4 x);"));
-
- s.append(TString("float atan(float y, float x);"));
- s.append(TString("vec2 atan(vec2 y, vec2 x);"));
- s.append(TString("vec3 atan(vec3 y, vec3 x);"));
- s.append(TString("vec4 atan(vec4 y, vec4 x);"));
-
- s.append(TString("float atan(float y_over_x);"));
- s.append(TString("vec2 atan(vec2 y_over_x);"));
- s.append(TString("vec3 atan(vec3 y_over_x);"));
- s.append(TString("vec4 atan(vec4 y_over_x);"));
-
- //
- // Exponential Functions.
- //
- s.append(TString("float pow(float x, float y);"));
- s.append(TString("vec2 pow(vec2 x, vec2 y);"));
- s.append(TString("vec3 pow(vec3 x, vec3 y);"));
- s.append(TString("vec4 pow(vec4 x, vec4 y);"));
-
- s.append(TString("float exp(float x);"));
- s.append(TString("vec2 exp(vec2 x);"));
- s.append(TString("vec3 exp(vec3 x);"));
- s.append(TString("vec4 exp(vec4 x);"));
-
- s.append(TString("float log(float x);"));
- s.append(TString("vec2 log(vec2 x);"));
- s.append(TString("vec3 log(vec3 x);"));
- s.append(TString("vec4 log(vec4 x);"));
-
- s.append(TString("float exp2(float x);"));
- s.append(TString("vec2 exp2(vec2 x);"));
- s.append(TString("vec3 exp2(vec3 x);"));
- s.append(TString("vec4 exp2(vec4 x);"));
-
- s.append(TString("float log2(float x);"));
- s.append(TString("vec2 log2(vec2 x);"));
- s.append(TString("vec3 log2(vec3 x);"));
- s.append(TString("vec4 log2(vec4 x);"));
-
- s.append(TString("float sqrt(float x);"));
- s.append(TString("vec2 sqrt(vec2 x);"));
- s.append(TString("vec3 sqrt(vec3 x);"));
- s.append(TString("vec4 sqrt(vec4 x);"));
-
- s.append(TString("float inversesqrt(float x);"));
- s.append(TString("vec2 inversesqrt(vec2 x);"));
- s.append(TString("vec3 inversesqrt(vec3 x);"));
- s.append(TString("vec4 inversesqrt(vec4 x);"));
-
- //
- // Common Functions.
- //
- s.append(TString("float abs(float x);"));
- s.append(TString("vec2 abs(vec2 x);"));
- s.append(TString("vec3 abs(vec3 x);"));
- s.append(TString("vec4 abs(vec4 x);"));
-
- s.append(TString("float sign(float x);"));
- s.append(TString("vec2 sign(vec2 x);"));
- s.append(TString("vec3 sign(vec3 x);"));
- s.append(TString("vec4 sign(vec4 x);"));
-
- s.append(TString("float floor(float x);"));
- s.append(TString("vec2 floor(vec2 x);"));
- s.append(TString("vec3 floor(vec3 x);"));
- s.append(TString("vec4 floor(vec4 x);"));
-
- s.append(TString("float ceil(float x);"));
- s.append(TString("vec2 ceil(vec2 x);"));
- s.append(TString("vec3 ceil(vec3 x);"));
- s.append(TString("vec4 ceil(vec4 x);"));
-
- s.append(TString("float fract(float x);"));
- s.append(TString("vec2 fract(vec2 x);"));
- s.append(TString("vec3 fract(vec3 x);"));
- s.append(TString("vec4 fract(vec4 x);"));
-
- s.append(TString("float mod(float x, float y);"));
- s.append(TString("vec2 mod(vec2 x, float y);"));
- s.append(TString("vec3 mod(vec3 x, float y);"));
- s.append(TString("vec4 mod(vec4 x, float y);"));
- s.append(TString("vec2 mod(vec2 x, vec2 y);"));
- s.append(TString("vec3 mod(vec3 x, vec3 y);"));
- s.append(TString("vec4 mod(vec4 x, vec4 y);"));
-
- s.append(TString("float min(float x, float y);"));
- s.append(TString("vec2 min(vec2 x, float y);"));
- s.append(TString("vec3 min(vec3 x, float y);"));
- s.append(TString("vec4 min(vec4 x, float y);"));
- s.append(TString("vec2 min(vec2 x, vec2 y);"));
- s.append(TString("vec3 min(vec3 x, vec3 y);"));
- s.append(TString("vec4 min(vec4 x, vec4 y);"));
-
- s.append(TString("float max(float x, float y);"));
- s.append(TString("vec2 max(vec2 x, float y);"));
- s.append(TString("vec3 max(vec3 x, float y);"));
- s.append(TString("vec4 max(vec4 x, float y);"));
- s.append(TString("vec2 max(vec2 x, vec2 y);"));
- s.append(TString("vec3 max(vec3 x, vec3 y);"));
- s.append(TString("vec4 max(vec4 x, vec4 y);"));
-
- s.append(TString("float clamp(float x, float minVal, float maxVal);"));
- s.append(TString("vec2 clamp(vec2 x, float minVal, float maxVal);"));
- s.append(TString("vec3 clamp(vec3 x, float minVal, float maxVal);"));
- s.append(TString("vec4 clamp(vec4 x, float minVal, float maxVal);"));
- s.append(TString("vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);"));
- s.append(TString("vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);"));
- s.append(TString("vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);"));
-
- s.append(TString("float mix(float x, float y, float a);"));
- s.append(TString("vec2 mix(vec2 x, vec2 y, float a);"));
- s.append(TString("vec3 mix(vec3 x, vec3 y, float a);"));
- s.append(TString("vec4 mix(vec4 x, vec4 y, float a);"));
- s.append(TString("vec2 mix(vec2 x, vec2 y, vec2 a);"));
- s.append(TString("vec3 mix(vec3 x, vec3 y, vec3 a);"));
- s.append(TString("vec4 mix(vec4 x, vec4 y, vec4 a);"));
-
- s.append(TString("float step(float edge, float x);"));
- s.append(TString("vec2 step(vec2 edge, vec2 x);"));
- s.append(TString("vec3 step(vec3 edge, vec3 x);"));
- s.append(TString("vec4 step(vec4 edge, vec4 x);"));
- s.append(TString("vec2 step(float edge, vec2 x);"));
- s.append(TString("vec3 step(float edge, vec3 x);"));
- s.append(TString("vec4 step(float edge, vec4 x);"));
-
- s.append(TString("float smoothstep(float edge0, float edge1, float x);"));
- s.append(TString("vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);"));
- s.append(TString("vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);"));
- s.append(TString("vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);"));
- s.append(TString("vec2 smoothstep(float edge0, float edge1, vec2 x);"));
- s.append(TString("vec3 smoothstep(float edge0, float edge1, vec3 x);"));
- s.append(TString("vec4 smoothstep(float edge0, float edge1, vec4 x);"));
-
- //
- // Geometric Functions.
- //
- s.append(TString("float length(float x);"));
- s.append(TString("float length(vec2 x);"));
- s.append(TString("float length(vec3 x);"));
- s.append(TString("float length(vec4 x);"));
-
- s.append(TString("float distance(float p0, float p1);"));
- s.append(TString("float distance(vec2 p0, vec2 p1);"));
- s.append(TString("float distance(vec3 p0, vec3 p1);"));
- s.append(TString("float distance(vec4 p0, vec4 p1);"));
-
- s.append(TString("float dot(float x, float y);"));
- s.append(TString("float dot(vec2 x, vec2 y);"));
- s.append(TString("float dot(vec3 x, vec3 y);"));
- s.append(TString("float dot(vec4 x, vec4 y);"));
-
- s.append(TString("vec3 cross(vec3 x, vec3 y);"));
- s.append(TString("float normalize(float x);"));
- s.append(TString("vec2 normalize(vec2 x);"));
- s.append(TString("vec3 normalize(vec3 x);"));
- s.append(TString("vec4 normalize(vec4 x);"));
-
- s.append(TString("float faceforward(float N, float I, float Nref);"));
- s.append(TString("vec2 faceforward(vec2 N, vec2 I, vec2 Nref);"));
- s.append(TString("vec3 faceforward(vec3 N, vec3 I, vec3 Nref);"));
- s.append(TString("vec4 faceforward(vec4 N, vec4 I, vec4 Nref);"));
-
- s.append(TString("float reflect(float I, float N);"));
- s.append(TString("vec2 reflect(vec2 I, vec2 N);"));
- s.append(TString("vec3 reflect(vec3 I, vec3 N);"));
- s.append(TString("vec4 reflect(vec4 I, vec4 N);"));
-
- s.append(TString("float refract(float I, float N, float eta);"));
- s.append(TString("vec2 refract(vec2 I, vec2 N, float eta);"));
- s.append(TString("vec3 refract(vec3 I, vec3 N, float eta);"));
- s.append(TString("vec4 refract(vec4 I, vec4 N, float eta);"));
-
- //
- // Matrix Functions.
- //
- s.append(TString("mat2 matrixCompMult(mat2 x, mat2 y);"));
- s.append(TString("mat3 matrixCompMult(mat3 x, mat3 y);"));
- s.append(TString("mat4 matrixCompMult(mat4 x, mat4 y);"));
-
- //
- // Vector relational functions.
- //
- s.append(TString("bvec2 lessThan(vec2 x, vec2 y);"));
- s.append(TString("bvec3 lessThan(vec3 x, vec3 y);"));
- s.append(TString("bvec4 lessThan(vec4 x, vec4 y);"));
-
- s.append(TString("bvec2 lessThan(ivec2 x, ivec2 y);"));
- s.append(TString("bvec3 lessThan(ivec3 x, ivec3 y);"));
- s.append(TString("bvec4 lessThan(ivec4 x, ivec4 y);"));
-
- s.append(TString("bvec2 lessThanEqual(vec2 x, vec2 y);"));
- s.append(TString("bvec3 lessThanEqual(vec3 x, vec3 y);"));
- s.append(TString("bvec4 lessThanEqual(vec4 x, vec4 y);"));
-
- s.append(TString("bvec2 lessThanEqual(ivec2 x, ivec2 y);"));
- s.append(TString("bvec3 lessThanEqual(ivec3 x, ivec3 y);"));
- s.append(TString("bvec4 lessThanEqual(ivec4 x, ivec4 y);"));
-
- s.append(TString("bvec2 greaterThan(vec2 x, vec2 y);"));
- s.append(TString("bvec3 greaterThan(vec3 x, vec3 y);"));
- s.append(TString("bvec4 greaterThan(vec4 x, vec4 y);"));
-
- s.append(TString("bvec2 greaterThan(ivec2 x, ivec2 y);"));
- s.append(TString("bvec3 greaterThan(ivec3 x, ivec3 y);"));
- s.append(TString("bvec4 greaterThan(ivec4 x, ivec4 y);"));
-
- s.append(TString("bvec2 greaterThanEqual(vec2 x, vec2 y);"));
- s.append(TString("bvec3 greaterThanEqual(vec3 x, vec3 y);"));
- s.append(TString("bvec4 greaterThanEqual(vec4 x, vec4 y);"));
-
- s.append(TString("bvec2 greaterThanEqual(ivec2 x, ivec2 y);"));
- s.append(TString("bvec3 greaterThanEqual(ivec3 x, ivec3 y);"));
- s.append(TString("bvec4 greaterThanEqual(ivec4 x, ivec4 y);"));
-
- s.append(TString("bvec2 equal(vec2 x, vec2 y);"));
- s.append(TString("bvec3 equal(vec3 x, vec3 y);"));
- s.append(TString("bvec4 equal(vec4 x, vec4 y);"));
-
- s.append(TString("bvec2 equal(ivec2 x, ivec2 y);"));
- s.append(TString("bvec3 equal(ivec3 x, ivec3 y);"));
- s.append(TString("bvec4 equal(ivec4 x, ivec4 y);"));
-
- s.append(TString("bvec2 equal(bvec2 x, bvec2 y);"));
- s.append(TString("bvec3 equal(bvec3 x, bvec3 y);"));
- s.append(TString("bvec4 equal(bvec4 x, bvec4 y);"));
-
- s.append(TString("bvec2 notEqual(vec2 x, vec2 y);"));
- s.append(TString("bvec3 notEqual(vec3 x, vec3 y);"));
- s.append(TString("bvec4 notEqual(vec4 x, vec4 y);"));
-
- s.append(TString("bvec2 notEqual(ivec2 x, ivec2 y);"));
- s.append(TString("bvec3 notEqual(ivec3 x, ivec3 y);"));
- s.append(TString("bvec4 notEqual(ivec4 x, ivec4 y);"));
-
- s.append(TString("bvec2 notEqual(bvec2 x, bvec2 y);"));
- s.append(TString("bvec3 notEqual(bvec3 x, bvec3 y);"));
- s.append(TString("bvec4 notEqual(bvec4 x, bvec4 y);"));
-
- s.append(TString("bool any(bvec2 x);"));
- s.append(TString("bool any(bvec3 x);"));
- s.append(TString("bool any(bvec4 x);"));
-
- s.append(TString("bool all(bvec2 x);"));
- s.append(TString("bool all(bvec3 x);"));
- s.append(TString("bool all(bvec4 x);"));
-
- s.append(TString("bvec2 not(bvec2 x);"));
- s.append(TString("bvec3 not(bvec3 x);"));
- s.append(TString("bvec4 not(bvec4 x);"));
-
- //
- // Texture Functions.
- //
- s.append(TString("vec4 texture1D(sampler1D sampler, float coord);"));
- s.append(TString("vec4 texture1DProj(sampler1D sampler, vec2 coord);"));
- s.append(TString("vec4 texture1DProj(sampler1D sampler, vec4 coord);"));
-
- s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);"));
-
- s.append(TString("vec4 texture3D(sampler3D sampler, vec3 coord);"));
- s.append(TString("vec4 texture3DProj(sampler3D sampler, vec4 coord);"));
-
- s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);"));
-
- s.append(TString("vec4 shadow1D(sampler1DShadow sampler, vec3 coord);"));
-
- s.append(TString("vec4 shadow2D(sampler2DShadow sampler, vec3 coord);"));
-
- s.append(TString("vec4 shadow1DProj(sampler1DShadow sampler, vec4 coord);"));
-
- s.append(TString("vec4 shadow2DProj(sampler2DShadow sampler, vec4 coord);"));
-
-
- //
- // Noise functions.
- //
- s.append(TString("float noise1(float x);"));
- s.append(TString("float noise1(vec2 x);"));
- s.append(TString("float noise1(vec3 x);"));
- s.append(TString("float noise1(vec4 x);"));
-
- s.append(TString("vec2 noise2(float x);"));
- s.append(TString("vec2 noise2(vec2 x);"));
- s.append(TString("vec2 noise2(vec3 x);"));
- s.append(TString("vec2 noise2(vec4 x);"));
-
- s.append(TString("vec3 noise3(float x);"));
- s.append(TString("vec3 noise3(vec2 x);"));
- s.append(TString("vec3 noise3(vec3 x);"));
- s.append(TString("vec3 noise3(vec4 x);"));
-
- s.append(TString("vec4 noise4(float x);"));
- s.append(TString("vec4 noise4(vec2 x);"));
- s.append(TString("vec4 noise4(vec3 x);"));
- s.append(TString("vec4 noise4(vec4 x);"));
-
- s.append(TString("\n"));
- }
- {
- //============================================================================
- //
- // Prototypes for built-in functions seen by vertex shaders only.
- //
- //============================================================================
-
- TString& s = BuiltInFunctionsVertex;
-
- //
- // Geometric Functions.
- //
- s.append(TString("vec4 ftransform();"));
-
- //
- // Texture Functions.
- //
- s.append(TString("vec4 texture1DLod(sampler1D sampler, float coord, float lod);"));
- s.append(TString("vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod);"));
- s.append(TString("vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod);"));
-
- s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);"));
- s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);"));
- s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);"));
-
- s.append(TString("vec4 texture3DLod(sampler3D sampler, vec3 coord, float lod);"));
- s.append(TString("vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod);"));
- s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);"));
-
- s.append(TString("vec4 shadow1DLod(sampler1DShadow sampler, vec3 coord, float lod);"));
- s.append(TString("vec4 shadow2DLod(sampler2DShadow sampler, vec3 coord, float lod);"));
- s.append(TString("vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod);"));
- s.append(TString("vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod);"));
-
- s.append(TString("\n"));
- }
- {
- //============================================================================
- //
- // Prototypes for built-in functions seen by fragment shaders only.
- //
- //============================================================================
-
- TString& s = BuiltInFunctionsFragment;
-
- //
- // Texture Functions.
- //
- s.append(TString("vec4 texture1D(sampler1D sampler, float coord, float bias);"));
- s.append(TString("vec4 texture1DProj(sampler1D sampler, vec2 coord, float bias);"));
- s.append(TString("vec4 texture1DProj(sampler1D sampler, vec4 coord, float bias);"));
-
- s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord, float bias);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord, float bias);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias);"));
-
- s.append(TString("vec4 texture3D(sampler3D sampler, vec3 coord, float bias);"));
- s.append(TString("vec4 texture3DProj(sampler3D sampler, vec4 coord, float bias);"));
- s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord, float bias);"));
-
- s.append(TString("vec4 shadow1D(sampler1DShadow sampler, vec3 coord, float bias);"));
- s.append(TString("vec4 shadow2D(sampler2DShadow sampler, vec3 coord, float bias);"));
- s.append(TString("vec4 shadow1DProj(sampler1DShadow sampler, vec4 coord, float bias);"));
- s.append(TString("vec4 shadow2DProj(sampler2DShadow sampler, vec4 coord, float bias);"));
-
- s.append(TString("float dFdx(float p);"));
- s.append(TString("vec2 dFdx(vec2 p);"));
- s.append(TString("vec3 dFdx(vec3 p);"));
- s.append(TString("vec4 dFdx(vec4 p);"));
-
- s.append(TString("float dFdy(float p);"));
- s.append(TString("vec2 dFdy(vec2 p);"));
- s.append(TString("vec3 dFdy(vec3 p);"));
- s.append(TString("vec4 dFdy(vec4 p);"));
-
- s.append(TString("float fwidth(float p);"));
- s.append(TString("vec2 fwidth(vec2 p);"));
- s.append(TString("vec3 fwidth(vec3 p);"));
- s.append(TString("vec4 fwidth(vec4 p);"));
-
- s.append(TString("\n"));
- }
- {
- //============================================================================
- //
- // Standard Uniforms
- //
- //============================================================================
-
- TString& s = StandardUniforms;
-
-
- //
- // OpenGL'uniform' state. Page numbers are in reference to version
- // 1.4 of the OpenGL specification.
- //
-
- //
- // Matrix state. p. 31, 32, 37, 39, 40.
- //
- s.append(TString("uniform mat4 gl_ModelViewMatrix;"));
- s.append(TString("uniform mat4 gl_ProjectionMatrix;"));
- s.append(TString("uniform mat4 gl_ModelViewProjectionMatrix;"));
-
- //
- // Derived matrix state that provides inverse and transposed versions
- // of the matrices above.
- //
- s.append(TString("uniform mat3 gl_NormalMatrix;"));
-
- s.append(TString("uniform mat4 gl_ModelViewMatrixInverse;"));
- s.append(TString("uniform mat4 gl_ProjectionMatrixInverse;"));
- s.append(TString("uniform mat4 gl_ModelViewProjectionMatrixInverse;"));
-
- s.append(TString("uniform mat4 gl_ModelViewMatrixTranspose;"));
- s.append(TString("uniform mat4 gl_ProjectionMatrixTranspose;"));
- s.append(TString("uniform mat4 gl_ModelViewProjectionMatrixTranspose;"));
-
- s.append(TString("uniform mat4 gl_ModelViewMatrixInverseTranspose;"));
- s.append(TString("uniform mat4 gl_ProjectionMatrixInverseTranspose;"));
- s.append(TString("uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;"));
-
- //
- // Normal scaling p. 39.
- //
- s.append(TString("uniform float gl_NormalScale;"));
-
- //
- // Depth range in window coordinates, p. 33
- //
- s.append(TString("struct gl_DepthRangeParameters {"));
- s.append(TString(" float near;")); // n
- s.append(TString(" float far;")); // f
- s.append(TString(" float diff;")); // f - n
- s.append(TString("};"));
- s.append(TString("uniform gl_DepthRangeParameters gl_DepthRange;"));
-
-
- //
- // Point Size, p. 66, 67.
- //
- s.append(TString("struct gl_PointParameters {"));
- s.append(TString(" float size;"));
- s.append(TString(" float sizeMin;"));
- s.append(TString(" float sizeMax;"));
- s.append(TString(" float fadeThresholdSize;"));
- s.append(TString(" float distanceConstantAttenuation;"));
- s.append(TString(" float distanceLinearAttenuation;"));
- s.append(TString(" float distanceQuadraticAttenuation;"));
- s.append(TString("};"));
-
- s.append(TString("uniform gl_PointParameters gl_Point;"));
-
- //
- // Material State p. 50, 55.
- //
- s.append(TString("struct gl_MaterialParameters {"));
- s.append(TString(" vec4 emission;")); // Ecm
- s.append(TString(" vec4 ambient;")); // Acm
- s.append(TString(" vec4 diffuse;")); // Dcm
- s.append(TString(" vec4 specular;")); // Scm
- s.append(TString(" float shininess;")); // Srm
- s.append(TString("};"));
- s.append(TString("uniform gl_MaterialParameters gl_FrontMaterial;"));
- s.append(TString("uniform gl_MaterialParameters gl_BackMaterial;"));
-
- //
- // Light State p 50, 53, 55.
- //
-
- s.append(TString("struct gl_LightSourceParameters {"));
- s.append(TString(" vec4 ambient;")); // Acli
- s.append(TString(" vec4 diffuse;")); // Dcli
- s.append(TString(" vec4 specular;")); // Scli
- s.append(TString(" vec4 position;")); // Ppli
- s.append(TString(" vec4 halfVector;")); // Derived: Hi
- s.append(TString(" vec3 spotDirection;")); // Sdli
- s.append(TString(" float spotExponent;")); // Srli
- s.append(TString(" float spotCutoff;")); // Crli
- // (range: [0.0,90.0], 180.0)
- s.append(TString(" float spotCosCutoff;")); // Derived: cos(Crli)
- // (range: [1.0,0.0],-1.0)
- s.append(TString(" float constantAttenuation;")); // K0
- s.append(TString(" float linearAttenuation;")); // K1
- s.append(TString(" float quadraticAttenuation;"));// K2
- s.append(TString("};"));
-
-
- s.append(TString("struct gl_LightModelParameters {"));
- s.append(TString(" vec4 ambient;")); // Acs
- s.append(TString("};"));
-
- s.append(TString("uniform gl_LightModelParameters gl_LightModel;"));
-
- //
- // Derived state from products of light and material.
- //
-
- s.append(TString("struct gl_LightModelProducts {"));
- s.append(TString(" vec4 sceneColor;")); // Derived. Ecm + Acm * Acs
- s.append(TString("};"));
-
- s.append(TString("uniform gl_LightModelProducts gl_FrontLightModelProduct;"));
- s.append(TString("uniform gl_LightModelProducts gl_BackLightModelProduct;"));
-
- s.append(TString("struct gl_LightProducts {"));
- s.append(TString(" vec4 ambient;")); // Acm * Acli
- s.append(TString(" vec4 diffuse;")); // Dcm * Dcli
- s.append(TString(" vec4 specular;")); // Scm * Scli
- s.append(TString("};"));
-
-
-
-
- //
- // Fog p. 161
- //
- s.append(TString("struct gl_FogParameters {"));
- s.append(TString(" vec4 color;"));
- s.append(TString(" float density;"));
- s.append(TString(" float start;"));
- s.append(TString(" float end;"));
- s.append(TString(" float scale;")); // 1 / (gl_FogEnd - gl_FogStart)
- s.append(TString("};"));
-
- s.append(TString("uniform gl_FogParameters gl_Fog;"));
-
- s.append(TString("\n"));
- }
- {
- //============================================================================
- //
- // Vertex attributes, p. 19.
- //
- //============================================================================
-
- TString& s = StandardVertexAttributes;
-
- s.append(TString("attribute vec4 gl_Color;"));
- s.append(TString("attribute vec4 gl_SecondaryColor;"));
- s.append(TString("attribute vec3 gl_Normal;"));
- s.append(TString("attribute vec4 gl_Vertex;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord0;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord1;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord2;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord3;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord4;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord5;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord6;"));
- s.append(TString("attribute vec4 gl_MultiTexCoord7;"));
- s.append(TString("attribute float gl_FogCoord;"));
-
- s.append(TString("\n"));
- }
- {
- //============================================================================
- //
- // Define the output varying interface from the vertex shader.
- //
- //============================================================================
-
- TString& s = StandardVertexVaryings;
-
- s.append(TString("varying vec4 gl_FrontColor;"));
- s.append(TString("varying vec4 gl_BackColor;"));
- s.append(TString("varying vec4 gl_FrontSecondaryColor;"));
- s.append(TString("varying vec4 gl_BackSecondaryColor;"));
- s.append(TString("varying vec4 gl_TexCoord[];"));
- s.append(TString("varying float gl_FogFragCoord;"));
-
- s.append(TString("\n"));
- }
- {
- //============================================================================
- //
- // Define the input varying interface to the fragment shader.
- //
- //============================================================================
-
- TString& s = StandardFragmentVaryings;
-
- s.append(TString("varying vec4 gl_Color;"));
- s.append(TString("varying vec4 gl_SecondaryColor;"));
- s.append(TString("varying vec4 gl_TexCoord[];"));
- s.append(TString("varying float gl_FogFragCoord;"));
-
- s.append(TString("\n"));
- }
-
- builtInStrings[EShLangFragment].push_back(BuiltInFunctions.c_str());
- builtInStrings[EShLangFragment].push_back(BuiltInFunctionsFragment);
- builtInStrings[EShLangFragment].push_back(StandardUniforms);
- builtInStrings[EShLangFragment].push_back(StandardFragmentVaryings);
-
- builtInStrings[EShLangVertex].push_back(BuiltInFunctions);
- builtInStrings[EShLangVertex].push_back(BuiltInFunctionsVertex);
- builtInStrings[EShLangVertex].push_back(StandardVertexVaryings);
- builtInStrings[EShLangVertex].push_back(StandardVertexAttributes);
- builtInStrings[EShLangVertex].push_back(StandardUniforms);
-}
-
-
-void TBuiltIns::initialize(const TBuiltInResource &resources)
-{
- //
- // Initialize all the built-in strings for parsing.
- //
- TString StandardUniforms;
-
- {
- //============================================================================
- //
- // Standard Uniforms
- //
- //============================================================================
-
- TString& s = StandardUniforms;
-
- //
- // Implementation dependent constants. The example values below
- // are the minimum values allowed for these maximums.
- //
- char builtInConstant[80];
- sprintf(builtInConstant, "const int gl_MaxLights = %d;", resources.maxLights); // GL 1.0
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxClipPlanes = %d;", resources.maxClipPlanes); // GL 1.0
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxTextureUnits = %d;", resources.maxTextureUnits); // GL 1.2
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxTextureCoords = %d;", resources.maxTextureCoords); // ARB_fragment_program
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs); // ARB_vertex_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxVertexUniformComponents = %d;", resources.maxVertexUniformComponents); // ARB_vertex_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats); // ARB_vertex_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxVertexTextureImageUnits = %d;", resources.maxVertexTextureImageUnits); // ARB_vertex_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxCombinedTextureImageUnits = %d;", resources.maxCombinedTextureImageUnits); // ARB_vertex_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxTextureImageUnits = %d;", resources.maxTextureImageUnits); // ARB_fragment_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxFragmentUniformComponents = %d;", resources.maxFragmentUniformComponents); // ARB_fragment_shader
- s.append(TString(builtInConstant));
-
- sprintf(builtInConstant, "const int gl_MaxDrawBuffers = %d;", resources.maxDrawBuffers); // proposed ARB_draw_buffers
- s.append(TString(builtInConstant));
-
- //
- // OpenGL'uniform' state. Page numbers are in reference to version
- // 1.4 of the OpenGL specification.
- //
-
- //
- // Matrix state. p. 31, 32, 37, 39, 40.
- //
- s.append(TString("uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];"));
-
- //
- // Derived matrix state that provides inverse and transposed versions
- // of the matrices above.
- //
- s.append(TString("uniform mat4 gl_TextureMatrixInverse[gl_MaxTextureCoords];"));
-
- s.append(TString("uniform mat4 gl_TextureMatrixTranspose[gl_MaxTextureCoords];"));
-
- s.append(TString("uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords];"));
-
- //
- // Clip planes p. 42.
- //
- s.append(TString("uniform vec4 gl_ClipPlane[gl_MaxClipPlanes];"));
-
- //
- // Light State p 50, 53, 55.
- //
- s.append(TString("uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];"));
-
- //
- // Derived state from products of light.
- //
- s.append(TString("uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights];"));
- s.append(TString("uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights];"));
-
- //
- // Textureg Environment and Generation, p. 152, p. 40-42.
- //
- s.append(TString("uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits];"));
- s.append(TString("uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_EyePlaneR[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_EyePlaneQ[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_ObjectPlaneS[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords];"));
- s.append(TString("uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords];"));
-
- s.append(TString("\n"));
- }
-
- builtInStrings[EShLangFragment].push_back(StandardUniforms);
- builtInStrings[EShLangVertex].push_back(StandardUniforms);
-}
-
-void IdentifyBuiltIns(EShLanguage language, TSymbolTable& symbolTable)
-{
- //
- // First, insert some special built-in variables that are not in
- // the built-in header files.
- //
- switch(language) {
-
- case EShLangFragment: {
- symbolTable.insert(*new TVariable(NewPoolTString("gl_FrontFacing"), TType(EbtBool, EvqFace, 1)));
- symbolTable.insert(*new TVariable(NewPoolTString("gl_FragCoord"), TType(EbtFloat, EvqFragCoord, 4)));
- symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EvqFragColor, 4)));
- symbolTable.insert(*new TVariable(NewPoolTString("gl_FragDepth"), TType(EbtFloat, EvqFragDepth, 1)));
-
- }
- break;
-
- case EShLangVertex:
- symbolTable.insert(*new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EvqPosition, 4)));
- symbolTable.insert(*new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EvqPointSize, 1)));
- symbolTable.insert(*new TVariable(NewPoolTString("gl_ClipVertex"), TType(EbtFloat, EvqClipVertex, 4)));
- break;
- default: break;
- }
-
- //
- // Next, identify which built-ins from the already loaded headers have
- // a mapping to an operator. Those that are not identified as such are
- // expected to be resolved through a library of functions, versus as
- // operations.
- //
- symbolTable.relateToOperator("not", EOpVectorLogicalNot);
-
- symbolTable.relateToOperator("matrixCompMult", EOpMul);
- symbolTable.relateToOperator("mod", EOpMod);
-
- symbolTable.relateToOperator("equal", EOpVectorEqual);
- symbolTable.relateToOperator("notEqual", EOpVectorNotEqual);
- symbolTable.relateToOperator("lessThan", EOpLessThan);
- symbolTable.relateToOperator("greaterThan", EOpGreaterThan);
- symbolTable.relateToOperator("lessThanEqual", EOpLessThanEqual);
- symbolTable.relateToOperator("greaterThanEqual", EOpGreaterThanEqual);
-
- symbolTable.relateToOperator("radians", EOpRadians);
- symbolTable.relateToOperator("degrees", EOpDegrees);
- symbolTable.relateToOperator("sin", EOpSin);
- symbolTable.relateToOperator("cos", EOpCos);
- symbolTable.relateToOperator("tan", EOpTan);
- symbolTable.relateToOperator("asin", EOpAsin);
- symbolTable.relateToOperator("acos", EOpAcos);
- symbolTable.relateToOperator("atan", EOpAtan);
-
- symbolTable.relateToOperator("pow", EOpPow);
- symbolTable.relateToOperator("exp2", EOpExp2);
- symbolTable.relateToOperator("log", EOpLog);
- symbolTable.relateToOperator("exp", EOpExp);
- symbolTable.relateToOperator("log2", EOpLog2);
- symbolTable.relateToOperator("sqrt", EOpSqrt);
- symbolTable.relateToOperator("inversesqrt", EOpInverseSqrt);
-
- symbolTable.relateToOperator("abs", EOpAbs);
- symbolTable.relateToOperator("sign", EOpSign);
- symbolTable.relateToOperator("floor", EOpFloor);
- symbolTable.relateToOperator("ceil", EOpCeil);
- symbolTable.relateToOperator("fract", EOpFract);
- symbolTable.relateToOperator("min", EOpMin);
- symbolTable.relateToOperator("max", EOpMax);
- symbolTable.relateToOperator("clamp", EOpClamp);
- symbolTable.relateToOperator("mix", EOpMix);
- symbolTable.relateToOperator("step", EOpStep);
- symbolTable.relateToOperator("smoothstep", EOpSmoothStep);
-
- symbolTable.relateToOperator("length", EOpLength);
- symbolTable.relateToOperator("distance", EOpDistance);
- symbolTable.relateToOperator("dot", EOpDot);
- symbolTable.relateToOperator("cross", EOpCross);
- symbolTable.relateToOperator("normalize", EOpNormalize);
- symbolTable.relateToOperator("forward", EOpFaceForward);
- symbolTable.relateToOperator("reflect", EOpReflect);
- symbolTable.relateToOperator("refract", EOpRefract);
-
- symbolTable.relateToOperator("any", EOpAny);
- symbolTable.relateToOperator("all", EOpAll);
-
- switch(language) {
-
- case EShLangVertex:
- break;
-
- case EShLangFragment:
- symbolTable.relateToOperator("dFdx", EOpDPdx);
- symbolTable.relateToOperator("dFdy", EOpDPdy);
- symbolTable.relateToOperator("fwidth", EOpFwidth);
-
- break;
-
- case EShLangPack:
- case EShLangUnpack:
- symbolTable.relateToOperator("itof", EOpItof);
- symbolTable.relateToOperator("ftoi", EOpFtoi);
- symbolTable.relateToOperator("skipPixels", EOpSkipPixels);
- symbolTable.relateToOperator("readInput", EOpReadInput);
- symbolTable.relateToOperator("writePixel", EOpWritePixel);
- symbolTable.relateToOperator("bitmapLSB", EOpBitmapLsb);
- symbolTable.relateToOperator("bitmapMSB", EOpBitmapMsb);
- symbolTable.relateToOperator("writeOutput", EOpWriteOutput);
- symbolTable.relateToOperator("readPixel", EOpReadPixel);
- break;
- default: assert (false && "Language not supported");
- }
-}
-
-void IdentifyBuiltIns(EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources)
-{
- //
- // First, insert some special built-in variables that are not in
- // the built-in header files.
- //
- switch(language) {
-
- case EShLangFragment: {
- // Set up gl_FragData. The array size.
- TType fragData(EbtFloat, EvqFragColor, 4, false, true);
- fragData.setArraySize(resources.maxDrawBuffers);
- symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData));
- }
- break;
-
- default: break;
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.h
deleted file mode 100755
index b273f06ca..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Initialize.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _INITIALIZE_INCLUDED_
-#define _INITIALIZE_INCLUDED_
-
-#include "Include/ResourceLimits.h"
-#include "../Include/Common.h"
-#include "../Include/ShHandle.h"
-#include "SymbolTable.h"
-
-typedef TVector<TString> TBuiltInStrings;
-
-class TBuiltIns {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
- void initialize();
- void initialize(const TBuiltInResource& resources);
- TBuiltInStrings* getBuiltInStrings() { return builtInStrings; }
-protected:
- TBuiltInStrings builtInStrings[EShLangCount];
-};
-
-void IdentifyBuiltIns(EShLanguage, TSymbolTable&);
-void IdentifyBuiltIns(EShLanguage, TSymbolTable&, const TBuiltInResource &resources);
-
-#endif // _INITIALIZE_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp
deleted file mode 100755
index da77806dd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/IntermTraverse.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "../Include/intermediate.h"
-
-//
-// Traverse the intermediate representation tree, and
-// call a node type specific function for each node.
-// Done recursively through the member function Traverse().
-// Node types can be skipped if their function to call is 0,
-// but their subtree will still be traversed.
-// Nodes with children can have their whole subtree skipped
-// if preVisit is turned on and the type specific function
-// returns false.
-//
-// preVisit, postVisit, and rightToLeft control what order
-// nodes are visited in.
-//
-
-//
-// Traversal functions for terminals are straighforward....
-//
-void TIntermSymbol::traverse(TIntermTraverser* it)
-{
- if (it->visitSymbol)
- it->visitSymbol(this, it);
-}
-
-void TIntermConstantUnion::traverse(TIntermTraverser* it)
-{
- if (it->visitConstantUnion)
- it->visitConstantUnion(this, it);
-}
-
-//
-// Traverse a binary node.
-//
-void TIntermBinary::traverse(TIntermTraverser* it)
-{
- bool visit = true;
-
- //
- // visit the node before children if pre-visiting.
- //
- if (it->preVisit && it->visitBinary)
- visit = it->visitBinary(true, this, it);
-
- //
- // Visit the children, in the right order.
- //
- if (visit) {
- ++it->depth;
- if (it->rightToLeft) {
- if (right)
- right->traverse(it);
- if (left)
- left->traverse(it);
- } else {
- if (left)
- left->traverse(it);
- if (right)
- right->traverse(it);
- }
- --it->depth;
- }
-
- //
- // Visit the node after the children, if requested and the traversal
- // hasn't been cancelled yet.
- //
- if (visit && it->postVisit && it->visitBinary)
- it->visitBinary(false, this, it);
-}
-
-//
-// Traverse a unary node. Same comments in binary node apply here.
-//
-void TIntermUnary::traverse(TIntermTraverser* it)
-{
- bool visit = true;
-
- if (it->preVisit && it->visitUnary)
- visit = it->visitUnary(true, this, it);
-
- if (visit) {
- ++it->depth;
- operand->traverse(it);
- --it->depth;
- }
-
- if (visit && it->postVisit && it->visitUnary)
- it->visitUnary(false, this, it);
-}
-
-//
-// Traverse an aggregate node. Same comments in binary node apply here.
-//
-void TIntermAggregate::traverse(TIntermTraverser* it)
-{
- bool visit = true;
-
- if (it->preVisit && it->visitAggregate)
- visit = it->visitAggregate(true, this, it);
-
- if (visit) {
- ++it->depth;
-
- TIntermSequence::iterator sit;
- if (it->rightToLeft) {
- sit = sequence.end();
- while (sit != sequence.begin()) {
- --sit;
- (*sit)->traverse(it);
- }
- } else {
- for (sit = sequence.begin(); sit != sequence.end(); ++sit)
- (*sit)->traverse(it);
- }
-
- --it->depth;
- }
-
- if (visit && it->postVisit && it->visitAggregate)
- it->visitAggregate(false, this, it);
-}
-
-//
-// Traverse a selection node. Same comments in binary node apply here.
-//
-void TIntermSelection::traverse(TIntermTraverser* it)
-{
- bool visit = true;
-
- if (it->preVisit && it->visitSelection)
- visit = it->visitSelection(true, this, it);
-
- if (visit) {
- ++it->depth;
- if (it->rightToLeft) {
- if (falseBlock)
- falseBlock->traverse(it);
- if (trueBlock)
- trueBlock->traverse(it);
- condition->traverse(it);
- } else {
- condition->traverse(it);
- if (trueBlock)
- trueBlock->traverse(it);
- if (falseBlock)
- falseBlock->traverse(it);
- }
- --it->depth;
- }
-
- if (visit && it->postVisit && it->visitSelection)
- it->visitSelection(false, this, it);
-}
-
-//
-// Traverse a loop node. Same comments in binary node apply here.
-//
-void TIntermLoop::traverse(TIntermTraverser* it)
-{
- bool visit = true;
-
- if (it->preVisit && it->visitLoop)
- visit = it->visitLoop(true, this, it);
-
- if (visit) {
- ++it->depth;
- if (it->rightToLeft) {
- if (terminal)
- terminal->traverse(it);
- if (body)
- body->traverse(it);
- if (test)
- test->traverse(it);
- } else {
- if (test)
- test->traverse(it);
- if (body)
- body->traverse(it);
- if (terminal)
- terminal->traverse(it);
- }
- --it->depth;
- }
-
- if (visit && it->postVisit && it->visitLoop)
- it->visitLoop(false, this, it);
-}
-
-//
-// Traverse a branch node. Same comments in binary node apply here.
-//
-void TIntermBranch::traverse(TIntermTraverser* it)
-{
- bool visit = true;
-
- if (it->preVisit && it->visitBranch)
- visit = it->visitBranch(true, this, it);
-
- if (visit && expression) {
- ++it->depth;
- expression->traverse(it);
- --it->depth;
- }
-
- if (visit && it->postVisit && it->visitBranch)
- it->visitBranch(false, this, it);
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp
deleted file mode 100755
index 056fe17de..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/Intermediate.cpp
+++ /dev/null
@@ -1,2110 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Build the intermediate representation.
-//
-
-#include "../Include/ShHandle.h"
-#include "localintermediate.h"
-#include "QualifierAlive.h"
-#include "RemoveTree.h"
-#include <float.h>
-
-////////////////////////////////////////////////////////////////////////////
-//
-// First set of functions are to help build the intermediate representation.
-// These functions are not member functions of the nodes.
-// They are called from parser productions.
-//
-/////////////////////////////////////////////////////////////////////////////
-
-//
-// Add a terminal node for an identifier in an expression.
-//
-// Returns the added node.
-//
-TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, TSourceLoc line)
-{
- TIntermSymbol* node = new TIntermSymbol(id, name, type);
- node->setLine(line);
-
- return node;
-}
-
-//
-// Connect two nodes with a new parent that does a binary operation on the nodes.
-//
-// Returns the added node.
-//
-TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc line, TSymbolTable& symbolTable)
-{
- switch (op) {
- case EOpLessThan:
- case EOpGreaterThan:
- case EOpLessThanEqual:
- case EOpGreaterThanEqual:
- if (left->getType().isMatrix() || left->getType().isArray() || left->getType().isVector() || left->getType().getBasicType() == EbtStruct) {
- return 0;
- }
- break;
- case EOpLogicalOr:
- case EOpLogicalXor:
- case EOpLogicalAnd:
- if (left->getType().getBasicType() != EbtBool || left->getType().isMatrix() || left->getType().isArray() || left->getType().isVector()) {
- return 0;
- }
- break;
- case EOpAdd:
- case EOpSub:
- case EOpDiv:
- case EOpMul:
- if (left->getType().getBasicType() == EbtStruct || left->getType().getBasicType() == EbtBool)
- return 0;
- default: break;
- }
-
- //
- // First try converting the children to compatible types.
- //
-
- if (!(left->getType().getStruct() && right->getType().getStruct())) {
- TIntermTyped* child = addConversion(op, left->getType(), right);
- if (child)
- right = child;
- else {
- child = addConversion(op, right->getType(), left);
- if (child)
- left = child;
- else
- return 0;
- }
- } else {
- if (left->getType() != right->getType())
- return 0;
- }
-
-
- //
- // Need a new node holding things together then. Make
- // one and promote it to the right type.
- //
- TIntermBinary* node = new TIntermBinary(op);
- if (line == 0)
- line = right->getLine();
- node->setLine(line);
-
- node->setLeft(left);
- node->setRight(right);
- if (! node->promote(infoSink))
- return 0;
-
- TIntermConstantUnion *leftTempConstant = left->getAsConstantUnion();
- TIntermConstantUnion *rightTempConstant = right->getAsConstantUnion();
-
- if (leftTempConstant)
- leftTempConstant = copyConstUnion(left->getAsConstantUnion())->getAsConstantUnion();
-
- if (rightTempConstant)
- rightTempConstant = copyConstUnion(right->getAsConstantUnion())->getAsConstantUnion();
-
- if (right->getType().getQualifier() == EvqConst && left->getType().getQualifier() == EvqConst) {
- if (right->getAsAggregate()) {
- rightTempConstant = changeAggrToTempConst(right->getAsAggregate(), symbolTable, line);
- if (rightTempConstant->getUnionArrayPointer() == 0)
- return 0;
- }
-
- if (left->getAsAggregate()) {
- leftTempConstant = changeAggrToTempConst(left->getAsAggregate(), symbolTable, line);
- if (leftTempConstant->getUnionArrayPointer() == 0)
- return 0;
- }
- }
-
- //
- // See if we can fold constants.
- //
-
- TIntermTyped* typedReturnNode = 0;
- if ( leftTempConstant && rightTempConstant) {
- if (leftTempConstant->getSize() == 1 && rightTempConstant->getSize() > 1)
- typedReturnNode = rightTempConstant->fold(node->getOp(), leftTempConstant, infoSink, false);
- else
- typedReturnNode = leftTempConstant->fold(node->getOp(), rightTempConstant, infoSink, true);
-
- if (typedReturnNode)
- return typedReturnNode;
- else {
- node->setLeft(leftTempConstant);
- node->setRight(rightTempConstant);
- }
- } else if (leftTempConstant) {
- node->setLeft(copyConstUnion(leftTempConstant));
- } else if (rightTempConstant) {
- node->setRight(rightTempConstant);
- }
-
- return node;
-}
-
-//
-// Connect two nodes through an assignment.
-//
-// Returns the added node.
-//
-TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc line)
-{
- //
- // Like adding binary math, except the conversion can only go
- // from right to left.
- //
- TIntermBinary* node = new TIntermBinary(op);
- if (line == 0)
- line = left->getLine();
- node->setLine(line);
-
- if (right->getAsConstantUnion()) { // if the right node of assignment is a TempConstant node, allocate its own new space and remove the pointer to the symbol table value
- right = copyConstUnion(right->getAsConstantUnion()) ;
- if (right == 0)
- return 0;
- }
-
- TIntermTyped* child = addConversion(op, left->getType(), right);
- if (child == 0)
- return 0;
-
- node->setLeft(left);
- node->setRight(child);
- if (! node->promote(infoSink))
- return 0;
-
- return node;
-}
-
-//
-// Connect two nodes through an index operator, where the left node is the base
-// of an array or struct, and the right node is a direct or indirect offset.
-//
-// Returns the added node.
-// The caller should set the type of the returned node.
-//
-TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, TSourceLoc line)
-{
- TIntermBinary* node = new TIntermBinary(op);
- if (line == 0)
- line = index->getLine();
- node->setLine(line);
- node->setLeft(base);
- node->setRight(index);
-
- // caller should set the type
-
- return node;
-}
-
-//
-// Add one node as the parent of another that it operates on.
-//
-// Returns the added node.
-//
-TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode, TSourceLoc line, TSymbolTable& symbolTable)
-{
- TIntermUnary* node;
- TIntermTyped* child = childNode->getAsTyped();
-
- if (child == 0) {
- infoSink.info.message(EPrefixInternalError, "Bad type in AddUnaryMath", line);
- return 0;
- }
-
- switch (op) {
- case EOpLogicalNot:
- if (child->getType().getBasicType() != EbtBool || child->getType().isMatrix() || child->getType().isArray() || child->getType().isVector()) {
- return 0;
- }
- break;
-
- case EOpPostIncrement:
- case EOpPreIncrement:
- case EOpPostDecrement:
- case EOpPreDecrement:
- case EOpNegative:
- if (child->getType().getBasicType() == EbtStruct)
- return 0;
- default: break;
- }
-
- //
- // Do we need to promote the operand?
- //
- // Note: Implicit promotions were removed from the language.
- //
- TBasicType newType = EbtVoid;
- switch (op) {
- case EOpConstructInt: newType = EbtInt; break;
- case EOpConstructBool: newType = EbtBool; break;
- case EOpConstructFloat: newType = EbtFloat; break;
- default: break;
- }
-
- if (newType != EbtVoid) {
- child = addConversion(op, TType(newType, EvqTemporary, child->getNominalSize(),
- child->isMatrix(),
- child->isArray()),
- child);
- if (child == 0)
- return 0;
- }
-
- //
- // For constructors, we are now done, it's all in the conversion.
- //
- switch (op) {
- case EOpConstructInt:
- case EOpConstructBool:
- case EOpConstructFloat:
- return child;
- default: break;
- }
-
- if (child->getAsConstantUnion())
- child = copyConstUnion(child->getAsConstantUnion());
-
- if (child->getAsAggregate() && child->getType().getQualifier() == EvqConst) {
- child = changeAggrToTempConst(child->getAsAggregate(), symbolTable, line);
- if (child->getAsConstantUnion()->getUnionArrayPointer() == 0)
- return 0;
- }
-
- TIntermConstantUnion *childTempConstant = child->getAsConstantUnion();
-
- //
- // Make a new node for the operator.
- //
- node = new TIntermUnary(op);
- if (line == 0)
- line = child->getLine();
- node->setLine(line);
- node->setOperand(child);
-
- if (! node->promote(infoSink))
- return 0;
-
- if (childTempConstant) {
- TIntermTyped* newChild = childTempConstant->fold(op, 0, infoSink, true);
-
- if (newChild) {
- return newChild;
- }
- }
-
- return node;
-}
-
-//
-// This is the safe way to change the operator on an aggregate, as it
-// does lots of error checking and fixing. Especially for establishing
-// a function call's operation on it's set of parameters. Sequences
-// of instructions are also aggregates, but they just direnctly set
-// their operator to EOpSequence.
-//
-// Returns an aggregate node, which could be the one passed in if
-// it was already an aggregate.
-//
-TIntermAggregate* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator op, TSourceLoc line)
-{
- TIntermAggregate* aggNode;
-
- //
- // Make sure we have an aggregate. If not turn it into one.
- //
- if (node) {
- aggNode = node->getAsAggregate();
- if (aggNode == 0 || aggNode->getOp() != EOpNull) {
- //
- // Make an aggregate containing this node.
- //
- aggNode = new TIntermAggregate();
- aggNode->getSequence().push_back(node);
- if (line == 0)
- line = node->getLine();
- }
- } else
- aggNode = new TIntermAggregate();
-
- //
- // Set the operator.
- //
- aggNode->setOperator(op);
- if (line != 0)
- aggNode->setLine(line);
-
- return aggNode;
-}
-
-//
-// Convert one type to another.
-//
-// Returns the node representing the conversion, which could be the same
-// node passed in if no conversion was needed.
-//
-// Return 0 if a conversion can't be done.
-//
-TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node)
-{
- //
- // Does the base type allow operation?
- //
- switch (node->getBasicType()) {
- case EbtVoid:
- case EbtSampler1D:
- case EbtSampler2D:
- case EbtSampler3D:
- case EbtSamplerCube:
- case EbtSampler1DShadow:
- case EbtSampler2DShadow:
- return 0;
- default: break;
- }
-
- //
- // Otherwise, if types are identical, no problem
- //
- if (type == node->getType())
- return node;
-
- //
- // If one's a structure, then no conversions.
- //
- if (type.getStruct() || node->getType().getStruct())
- return 0;
-
- TBasicType promoteTo;
-
- switch (op) {
- //
- // Explicit conversions
- //
- case EOpConstructBool:
- promoteTo = EbtBool;
- break;
- case EOpConstructFloat:
- promoteTo = EbtFloat;
- break;
- case EOpConstructInt:
- promoteTo = EbtInt;
- break;
- default:
- //
- // implicit conversions were removed from the language.
- //
- if (type.getBasicType() != node->getType().getBasicType())
- return 0;
- //
- // Size and structure could still differ, but that's
- // handled by operator promotion.
- //
- return node;
- }
-
- //
- // Do conversion.
- //
- bool allConstant = true;
- // check to see if there is an aggregate node
- if (node->getAsAggregate()) {
- if (node->getAsAggregate()->getOp() != EOpFunctionCall) {
- // if the aggregate node is a constructor or a comma operator, look at its children, if they are constant
- // convert them into the right type
- TIntermSequence &sequenceVector = node->getAsAggregate()->getSequence() ;
- for (TIntermSequence::iterator p = sequenceVector.begin();
- p != sequenceVector.end(); p++) {
- if (!(*p)->getAsTyped()->getAsConstantUnion())
- allConstant = false;
- }
- } else
- allConstant = false;
- }
- if (allConstant && node->getAsAggregate()) { // we can do the constant folding here as all the nodes of the aggregate are const
- TIntermSequence &sequenceVector = node->getAsAggregate()->getSequence() ;
- for (TIntermSequence::iterator p = sequenceVector.begin();
- p != sequenceVector.end(); p++) {
- TIntermTyped* newNode = 0;
- constUnion *unionArray = new constUnion[1];
-
- switch (promoteTo) {
- case EbtFloat:
- switch ((*p)->getAsTyped()->getType().getBasicType()) {
-
- case EbtInt:
- unionArray->fConst = static_cast<float>((*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- newNode = addConstantUnion(unionArray, TType(EbtFloat, EvqConst), node->getLine()); break;
- case EbtBool:
- unionArray->fConst = static_cast<float>((*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->bConst);
- newNode = newNode = addConstantUnion(unionArray, TType(EbtFloat, EvqConst), node->getLine()); break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- break;
- case EbtInt:
- switch ((*p)->getAsTyped()->getType().getBasicType()) {
- case EbtFloat:
- unionArray->iConst = static_cast<int>((*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->fConst);
- newNode = addConstantUnion(unionArray, TType(EbtInt, EvqConst), node->getLine());
- break;
- case EbtBool:
- unionArray->iConst = static_cast<int>((*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->bConst);
- newNode = addConstantUnion(unionArray, TType(EbtInt, EvqConst), node->getLine());
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- break;
- case EbtBool:
- switch ((*p)->getAsTyped()->getType().getBasicType()) {
- case EbtFloat:
- unionArray->bConst = (*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->fConst != 0.0 ;
- newNode = addConstantUnion(unionArray, TType(EbtBool, EvqConst), node->getLine());
- break;
- case EbtInt:
- unionArray->bConst = (*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->iConst != 0 ;
- newNode = addConstantUnion(unionArray, TType(EbtBool, EvqConst), node->getLine());
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- if (newNode) {
- sequenceVector.erase(p);
- sequenceVector.insert(p, newNode);
- }
- }
- return node->getAsAggregate();
- } else if (node->getAsConstantUnion()) {
-
- return (promoteConstantUnion(promoteTo, node->getAsConstantUnion()));
- } else {
-
- //
- // Add a new newNode for the conversion.
- //
- TIntermUnary* newNode = 0;
-
- TOperator newOp = EOpNull;
- switch (promoteTo) {
- case EbtFloat:
- switch (node->getBasicType()) {
- case EbtInt: newOp = EOpConvIntToFloat; break;
- case EbtBool: newOp = EOpConvBoolToFloat; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- break;
- case EbtBool:
- switch (node->getBasicType()) {
- case EbtInt: newOp = EOpConvIntToBool; break;
- case EbtFloat: newOp = EOpConvFloatToBool; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- break;
- case EbtInt:
- switch (node->getBasicType()) {
- case EbtBool: newOp = EOpConvBoolToInt; break;
- case EbtFloat: newOp = EOpConvFloatToInt; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine());
- return 0;
- }
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Bad promotion type", node->getLine());
- return 0;
- }
-
- TType type(promoteTo, EvqTemporary, node->getNominalSize(), node->isMatrix(), node->isArray());
- newNode = new TIntermUnary(newOp, type);
- newNode->setLine(node->getLine());
- newNode->setOperand(node);
-
- return newNode;
- }
-}
-
-//
-// Safe way to combine two nodes into an aggregate. Works with null pointers,
-// a node that's not a aggregate yet, etc.
-//
-// Returns the resulting aggregate, unless 0 was passed in for
-// both existing nodes.
-//
-TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right, TSourceLoc line)
-{
- if (left == 0 && right == 0)
- return 0;
-
- TIntermAggregate* aggNode = 0;
- if (left)
- aggNode = left->getAsAggregate();
- if (!aggNode || aggNode->getOp() != EOpNull) {
- aggNode = new TIntermAggregate;
- if (left)
- aggNode->getSequence().push_back(left);
- }
-
- if (right)
- aggNode->getSequence().push_back(right);
-
- if (line != 0)
- aggNode->setLine(line);
-
- return aggNode;
-}
-
-//
-// Turn an existing node into an aggregate.
-//
-// Returns an aggregate, unless 0 was passed in for the existing node.
-//
-TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, TSourceLoc line)
-{
- if (node == 0)
- return 0;
-
- TIntermAggregate* aggNode = new TIntermAggregate;
- aggNode->getSequence().push_back(node);
-
- if (line != 0)
- aggNode->setLine(line);
- else
- aggNode->setLine(node->getLine());
-
- return aggNode;
-}
-
-//
-// For "if" test nodes. There are three children; a condition,
-// a true path, and a false path. The two paths are in the
-// nodePair.
-//
-// Returns the selection node created.
-//
-TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, TSourceLoc line)
-{
- //
- // For compile time constant selections, prune the code and
- // test now.
- //
-
- if (cond->getAsTyped() && cond->getAsTyped()->getAsConstantUnion()) {
- if (cond->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->bConst)
- return nodePair.node1;
- else
- return nodePair.node2;
- }
-
- TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2);
- node->setLine(line);
-
- return node;
-}
-
-
-TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc line)
-{
- if (left->getType().getQualifier() == EvqConst && right->getType().getQualifier() == EvqConst) {
- return right;
- } else {
- TIntermTyped *commaAggregate = growAggregate(left, right, line);
- commaAggregate->getAsAggregate()->setOperator(EOpComma);
- commaAggregate->setType(right->getType());
- commaAggregate->getTypePointer()->changeQualifier(EvqTemporary);
- return commaAggregate;
- }
-}
-
-//
-// For "?:" test nodes. There are three children; a condition,
-// a true path, and a false path. The two paths are specified
-// as separate parameters.
-//
-// Returns the selection node created, or 0 if one could not be.
-//
-TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, TSourceLoc line)
-{
- //
- // Get compatible types.
- //
- TIntermTyped* child = addConversion(EOpSequence, trueBlock->getType(), falseBlock);
- if (child)
- falseBlock = child;
- else {
- child = addConversion(EOpSequence, falseBlock->getType(), trueBlock);
- if (child)
- trueBlock = child;
- else
- return 0;
- }
-
- //
- // See if condition is constant, and select now.
- //
-
- if (cond->getAsConstantUnion()) {
- if (cond->getAsConstantUnion()->getUnionArrayPointer()->bConst)
- return trueBlock;
- else
- return falseBlock;
- }
-
- //
- // Make a selection node.
- //
- TIntermSelection* node = new TIntermSelection(cond, trueBlock, falseBlock, trueBlock->getType());
- node->setLine(line);
-
- return node;
-}
-
-//
-// Constant terminal nodes. Has a union that contains bool, float or int constants
-//
-// Returns the constant union node created.
-//
-
-TIntermConstantUnion* TIntermediate::addConstantUnion(constUnion* unionArrayPointer, const TType& t, TSourceLoc line)
-{
- TIntermConstantUnion* node = new TIntermConstantUnion(unionArrayPointer, t);
- node->setLine(line);
-
- return node;
-}
-
-TIntermTyped* TIntermediate::addSwizzle(TVectorFields& fields, TSourceLoc line)
-{
-
- TIntermAggregate* node = new TIntermAggregate(EOpSequence);
-
- node->setLine(line);
- TIntermConstantUnion* constIntNode;
- TIntermSequence &sequenceVector = node->getSequence();
- constUnion* unionArray;
-
- for (int i = 0; i < fields.num; i++) {
- unionArray = new constUnion[1];
- unionArray->iConst = fields.offsets[i];
- constIntNode = addConstantUnion(unionArray, TType(EbtInt, EvqConst), line);
- sequenceVector.push_back(constIntNode);
- }
-
- return node;
-}
-
-//
-// Create loop nodes.
-//
-TIntermNode* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, TSourceLoc line)
-{
- TIntermNode* node = new TIntermLoop(body, test, terminal, testFirst);
- node->setLine(line);
-
- return node;
-}
-
-//
-// Add branches.
-//
-TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TSourceLoc line)
-{
- return addBranch(branchOp, 0, line);
-}
-
-TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, TSourceLoc line)
-{
- TIntermBranch* node = new TIntermBranch(branchOp, expression);
- node->setLine(line);
-
- return node;
-}
-
-//
-// This is to be executed once the final root is put on top by the parsing
-// process.
-//
-bool TIntermediate::postProcess(TIntermNode* root, EShLanguage language)
-{
- if (root == 0)
- return true;
-
- //
- // First, finish off the top level sequence, if any
- //
- TIntermAggregate* aggRoot = root->getAsAggregate();
- if (aggRoot && aggRoot->getOp() == EOpNull)
- aggRoot->setOperator(EOpSequence);
-
- return true;
-}
-
-//
-// This deletes the tree.
-//
-void TIntermediate::remove(TIntermNode* root)
-{
- if (root)
- RemoveAllTreeNodes(root);
-}
-
-////////////////////////////////////////////////////////////////
-//
-// Member functions of the nodes used for building the tree.
-//
-////////////////////////////////////////////////////////////////
-
-//
-// Say whether or not an operation node changes the value of a variable.
-//
-// Returns true if state is modified.
-//
-bool TIntermOperator::modifiesState() const
-{
- switch (op) {
- case EOpPostIncrement:
- case EOpPostDecrement:
- case EOpPreIncrement:
- case EOpPreDecrement:
- case EOpAssign:
- case EOpAddAssign:
- case EOpSubAssign:
- case EOpMulAssign:
- case EOpVectorTimesMatrixAssign:
- case EOpVectorTimesScalarAssign:
- case EOpMatrixTimesScalarAssign:
- case EOpMatrixTimesMatrixAssign:
- case EOpDivAssign:
- case EOpModAssign:
- case EOpAndAssign:
- case EOpInclusiveOrAssign:
- case EOpExclusiveOrAssign:
- case EOpLeftShiftAssign:
- case EOpRightShiftAssign:
- return true;
- default:
- return false;
- }
-}
-
-//
-// returns true if the operator is for one of the constructors
-//
-bool TIntermOperator::isConstructor() const
-{
- switch (op) {
- case EOpConstructVec2:
- case EOpConstructVec3:
- case EOpConstructVec4:
- case EOpConstructMat2:
- case EOpConstructMat3:
- case EOpConstructMat4:
- case EOpConstructFloat:
- case EOpConstructIVec2:
- case EOpConstructIVec3:
- case EOpConstructIVec4:
- case EOpConstructInt:
- case EOpConstructBVec2:
- case EOpConstructBVec3:
- case EOpConstructBVec4:
- case EOpConstructBool:
- case EOpConstructStruct:
- return true;
- default:
- return false;
- }
-}
-//
-// Make sure the type of a unary operator is appropriate for its
-// combination of operation and operand type.
-//
-// Returns false in nothing makes sense.
-//
-bool TIntermUnary::promote(TInfoSink&)
-{
- switch (op) {
- case EOpLogicalNot:
- if (operand->getBasicType() != EbtBool)
- return false;
- break;
- case EOpBitwiseNot:
- if (operand->getBasicType() != EbtInt)
- return false;
- break;
- case EOpNegative:
- case EOpPostIncrement:
- case EOpPostDecrement:
- case EOpPreIncrement:
- case EOpPreDecrement:
- if (operand->getBasicType() == EbtBool)
- return false;
- break;
-
- // operators for built-ins are already type checked against their prototype
- case EOpAny:
- case EOpAll:
- case EOpVectorLogicalNot:
- return true;
-
- default:
- if (operand->getBasicType() != EbtFloat)
- return false;
- }
-
- setType(operand->getType());
-
- return true;
-}
-
-//
-// Establishes the type of the resultant operation, as well as
-// makes the operator the correct one for the operands.
-//
-// Returns false if operator can't work on operands.
-//
-bool TIntermBinary::promote(TInfoSink& infoSink)
-{
- int size = left->getNominalSize();
- if (right->getNominalSize() > size)
- size = right->getNominalSize();
-
- TBasicType type = left->getBasicType();
-
- //
- // Don't operate on arrays.
- //
- if (left->isArray() || right->isArray())
- return false;
-
- //
- // Base assumption: just make the type the same as the left
- // operand. Then only deviations from this need be coded.
- //
- setType(TType(type, EvqTemporary, left->getNominalSize(), left->isMatrix()));
-
- //
- // All scalars. Code after this test assumes this case is removed!
- //
- if (size == 1) {
-
- switch (op) {
-
- //
- // Promote to conditional
- //
- case EOpEqual:
- case EOpNotEqual:
- case EOpLessThan:
- case EOpGreaterThan:
- case EOpLessThanEqual:
- case EOpGreaterThanEqual:
- setType(TType(EbtBool));
- break;
-
- //
- // And and Or operate on conditionals
- //
- case EOpLogicalAnd:
- case EOpLogicalOr:
- if (left->getBasicType() != EbtBool || right->getBasicType() != EbtBool)
- return false;
- setType(TType(EbtBool));
- break;
-
- //
- // Check for integer only operands.
- //
- case EOpMod:
- case EOpRightShift:
- case EOpLeftShift:
- case EOpAnd:
- case EOpInclusiveOr:
- case EOpExclusiveOr:
- if (left->getBasicType() != EbtInt || right->getBasicType() != EbtInt)
- return false;
- break;
- case EOpModAssign:
- case EOpAndAssign:
- case EOpInclusiveOrAssign:
- case EOpExclusiveOrAssign:
- case EOpLeftShiftAssign:
- case EOpRightShiftAssign:
- if (left->getBasicType() != EbtInt || right->getBasicType() != EbtInt)
- return false;
- // fall through
-
- //
- // Everything else should have matching types
- //
- default:
- if (left->getBasicType() != right->getBasicType() ||
- left->isMatrix() != right->isMatrix())
- return false;
- }
-
- return true;
- }
-
- //
- // Are the sizes compatible?
- //
- if ( left->getNominalSize() != size && left->getNominalSize() != 1 ||
- right->getNominalSize() != size && right->getNominalSize() != 1)
- return false;
-
- //
- // Can these two operands be combined?
- //
- switch (op) {
- case EOpMul:
- if (!left->isMatrix() && right->isMatrix()) {
- if (left->isVector())
- op = EOpVectorTimesMatrix;
- else {
- op = EOpMatrixTimesScalar;
- setType(TType(type, EvqTemporary, size, true));
- }
- } else if (left->isMatrix() && !right->isMatrix()) {
- if (right->isVector()) {
- op = EOpMatrixTimesVector;
- setType(TType(type, EvqTemporary, size, false));
- } else {
- op = EOpMatrixTimesScalar;
- }
- } else if (left->isMatrix() && right->isMatrix()) {
- op = EOpMatrixTimesMatrix;
- } else if (!left->isMatrix() && !right->isMatrix()) {
- if (left->isVector() && right->isVector()) {
- // leave as component product
- } else if (left->isVector() || right->isVector()) {
- op = EOpVectorTimesScalar;
- setType(TType(type, EvqTemporary, size, false));
- }
- } else {
- infoSink.info.message(EPrefixInternalError, "Missing elses", getLine());
- return false;
- }
- break;
- case EOpMulAssign:
- if (!left->isMatrix() && right->isMatrix()) {
- if (left->isVector())
- op = EOpVectorTimesMatrixAssign;
- else {
- return false;
- }
- } else if (left->isMatrix() && !right->isMatrix()) {
- if (right->isVector()) {
- return false;
- } else {
- op = EOpMatrixTimesScalarAssign;
- }
- } else if (left->isMatrix() && right->isMatrix()) {
- op = EOpMatrixTimesMatrixAssign;
- } else if (!left->isMatrix() && !right->isMatrix()) {
- if (left->isVector() && right->isVector()) {
- // leave as component product
- } else if (left->isVector() || right->isVector()) {
- if (! left->isVector())
- return false;
- op = EOpVectorTimesScalarAssign;
- setType(TType(type, EvqTemporary, size, false));
- }
- } else {
- infoSink.info.message(EPrefixInternalError, "Missing elses", getLine());
- return false;
- }
- break;
- case EOpAssign:
- if (left->getNominalSize() != right->getNominalSize())
- return false;
- // fall through
- case EOpAdd:
- case EOpSub:
- case EOpDiv:
- case EOpMod:
- case EOpAddAssign:
- case EOpSubAssign:
- case EOpDivAssign:
- case EOpModAssign:
- if (left->isMatrix() && right->isVector() ||
- left->isVector() && right->isMatrix() ||
- left->getBasicType() != right->getBasicType())
- return false;
- setType(TType(type, EvqTemporary, size, left->isMatrix() || right->isMatrix()));
- break;
-
- case EOpEqual:
- case EOpNotEqual:
- case EOpLessThan:
- case EOpGreaterThan:
- case EOpLessThanEqual:
- case EOpGreaterThanEqual:
- if (left->isMatrix() && right->isVector() ||
- left->isVector() && right->isMatrix() ||
- left->getBasicType() != right->getBasicType())
- return false;
- setType(TType(EbtBool));
- break;
-
-default:
- return false;
- }
-
- //
- // One more check for assignment. The Resulting type has to match the left operand.
- //
- switch (op) {
- case EOpAssign:
- case EOpAddAssign:
- case EOpSubAssign:
- case EOpMulAssign:
- case EOpDivAssign:
- case EOpModAssign:
- case EOpAndAssign:
- case EOpInclusiveOrAssign:
- case EOpExclusiveOrAssign:
- case EOpLeftShiftAssign:
- case EOpRightShiftAssign:
- if (getType() != left->getType())
- return false;
- break;
- default:
- break;
- }
-
- return true;
-}
-
-bool compareStructure(const TType& leftNodeType, constUnion* rightUnionArray, constUnion* leftUnionArray, int& index)
-{
- TTypeList* fields = leftNodeType.getStruct();
-
- size_t structSize = fields->size();
-
- for (size_t j = 0; j < structSize; j++) {
- int size = (*fields)[j].type->getInstanceSize();
- for (int i = 0; i < size; i++) {
- switch ((*fields)[j].type->getBasicType()) {
- case EbtFloat:
- if (leftUnionArray[index].fConst != rightUnionArray[index].fConst)
- return false;
- index++;
- break;
- case EbtInt:
- if (leftUnionArray[index].iConst != rightUnionArray[index].iConst)
- return false;
- index++;
- break;
- case EbtBool:
- if (leftUnionArray[index].bConst != rightUnionArray[index].bConst)
- return false;
- index++;
- break;
- case EbtStruct:
- if (!compareStructure(*(*fields)[j].type, rightUnionArray, leftUnionArray, index))
- return false;
- break;
- default:
- assert(true && "Cannot compare");
- break;
- }
-
- }
- }
- return true;
-}
-
-//
-// The fold functions see if an operation on a constant can be done in place,
-// without generating run-time code.
-//
-// Returns the node to keep using, which may or may not be the node passed in.
-//
-
-TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNode, TInfoSink& infoSink, bool leftOperand)
-{
- constUnion *unionArray = this->getUnionArrayPointer();
-
- if (constantNode) {
- if (constantNode->getAsConstantUnion() && constantNode->getSize() == 1 && constantNode->getType().getBasicType() != EbtStruct
- && this->getSize() > 1) {
- TIntermConstantUnion *node = constantNode->getAsConstantUnion();
- TIntermConstantUnion *newNode;
- constUnion* tempConstArray;
- switch(op) {
- case EOpAdd:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat: tempConstArray[i].fConst = unionArray[i].fConst + node->getUnionArrayPointer()->fConst; break;
- case EbtInt: tempConstArray[i].iConst = unionArray[i].iConst + node->getUnionArrayPointer()->iConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"+\"", this->getLine());
- return 0;
- }
- }
- }
- break;
- case EOpMatrixTimesScalar:
- case EOpVectorTimesScalar:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat: tempConstArray[i].fConst = unionArray[i].fConst * node->getUnionArrayPointer()->fConst; break;
- case EbtInt: tempConstArray[i].iConst = unionArray[i].iConst * node->getUnionArrayPointer()->iConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"*\"", this->getLine());
- return 0;
- }
- }
- }
- break;
- case EOpSub:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat:
- if (leftOperand)
- tempConstArray[i].fConst = unionArray[i].fConst - node->getUnionArrayPointer()->fConst;
- else
- tempConstArray[i].fConst = node->getUnionArrayPointer()->fConst - unionArray[i].fConst;
- break;
-
- case EbtInt:
- if (leftOperand)
- tempConstArray[i].iConst = unionArray[i].iConst - node->getUnionArrayPointer()->iConst;
- else
- tempConstArray[i].iConst = node->getUnionArrayPointer()->iConst - unionArray[i].iConst;
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"-\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpDiv:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat:
- if (leftOperand) {
- if (node->getUnionArrayPointer()->fConst == 0.0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].fConst = FLT_MAX;
- } else
- tempConstArray[i].fConst = unionArray[i].fConst / node->getUnionArrayPointer()->fConst;
- } else {
- if (unionArray[i].fConst == 0.0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].fConst = FLT_MAX;
- } else
- tempConstArray[i].fConst = node->getUnionArrayPointer()->fConst / unionArray[i].fConst;
- }
- break;
-
- case EbtInt:
- if (leftOperand) {
- if (node->getUnionArrayPointer()->iConst == 0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].iConst = INT_MAX;
- } else
- tempConstArray[i].iConst = unionArray[i].iConst / node->getUnionArrayPointer()->iConst;
- } else {
- if (unionArray[i].iConst == 0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].iConst = INT_MAX;
- } else
- tempConstArray[i].iConst = node->getUnionArrayPointer()->iConst / unionArray[i].iConst;
- }
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"/\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpLogicalAnd: // this code is written for possible future use, will not get executed currently
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = unionArray[i].bConst && node->getUnionArrayPointer()->bConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"&&\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpLogicalXor: // this code is written for possible future use, will not get executed currently
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = unionArray[i].bConst ^ node->getUnionArrayPointer()->bConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"^^\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpLogicalOr: // this code is written for possible future use, will not get executed currently
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = unionArray[i].bConst || node->getUnionArrayPointer()->bConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"||\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- default:
- infoSink.info.message(EPrefixInternalError, "Invalid operator for constant folding", this->getLine());
- return 0;
- }
- newNode = new TIntermConstantUnion(tempConstArray, this->getType());
- newNode->setLine(this->getLine());
-
- return newNode;
- } else if (constantNode->getAsConstantUnion() && (this->getSize() > 1 || this->getType().getBasicType() == EbtStruct)) {
- TIntermConstantUnion *node = constantNode->getAsConstantUnion();
- constUnion *rightUnionArray = node->getUnionArrayPointer();
- constUnion* tempConstArray = 0;
- TIntermConstantUnion *tempNode;
- int index = 0;
- bool boolNodeFlag = false;
- switch(op) {
- case EOpAdd:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat: tempConstArray[i].fConst = unionArray[i].fConst + rightUnionArray[i].fConst; break;
- case EbtInt: tempConstArray[i].iConst = unionArray[i].iConst + rightUnionArray[i].iConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"+\"", this->getLine());
- return 0;
- }
- }
- }
- break;
- case EOpSub:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat:
- if (leftOperand)
- tempConstArray[i].fConst = unionArray[i].fConst - rightUnionArray[i].fConst;
- else
- tempConstArray[i].fConst = rightUnionArray[i].fConst - unionArray[i].fConst;
- break;
-
- case EbtInt:
- if (leftOperand)
- tempConstArray[i].iConst = unionArray[i].iConst - rightUnionArray[i].iConst;
- else
- tempConstArray[i].iConst = rightUnionArray[i].iConst - unionArray[i].iConst;
- break;
-
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"-\"", this->getLine());
- return 0;
- }
- }
- }
- break;
- case EOpMul:
- if (this->isVector()) { // two vectors multiplied together
- int size = this->getSize();
- tempConstArray = new constUnion[size];
-
- for (int i = 0; i < size; i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat: tempConstArray[i].fConst = unionArray[i].fConst * rightUnionArray[i].fConst; break;
- case EbtInt: tempConstArray[i].iConst = unionArray[i].iConst * rightUnionArray[i].iConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for vector multiply", this->getLine());
- return 0;
- }
- }
- }
- break;
- case EOpMatrixTimesMatrix:
- if (this->getType().getBasicType() != EbtFloat || node->getBasicType() != EbtFloat) {
- infoSink.info.message(EPrefixInternalError, "Constant Folding cannot be done for matrix multiply", this->getLine());
- return 0;
- }
- {// support MSVC++6.0
- int size = this->getNominalSize();
- tempConstArray = new constUnion[size*size];
- for (int row = 0; row < size; row++) {
- for (int column = 0; column < size; column++) {
- tempConstArray[size * column + row].fConst = 0.0;
- for (int i = 0; i < size; i++) {
- tempConstArray[size * column + row].fConst += unionArray[i * size + row].fConst * (rightUnionArray[column * size + i].fConst);
- }
- }
- }
- }
- break;
- case EOpDiv:
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtFloat:
- if (leftOperand) {
- if (rightUnionArray[i].fConst == 0.0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].fConst = FLT_MAX;
- } else
- tempConstArray[i].fConst = unionArray[i].fConst / rightUnionArray[i].fConst;
- } else {
- if (unionArray[i].fConst == 0.0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].fConst = FLT_MAX;
- } else
- tempConstArray[i].fConst = rightUnionArray[i].fConst / unionArray[i].fConst;
- }
- break;
-
- case EbtInt:
- if (leftOperand) {
- if (rightUnionArray[i].iConst == 0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].iConst = INT_MAX;
- } else
- tempConstArray[i].iConst = unionArray[i].iConst / rightUnionArray[i].iConst;
- } else {
- if (unionArray[i].iConst == 0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- tempConstArray[i].iConst = INT_MAX;
- } else
- tempConstArray[i].iConst = rightUnionArray[i].iConst / unionArray[i].iConst;
- }
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"/\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpMatrixTimesVector:
- if (node->getBasicType() != EbtFloat) {
- infoSink.info.message(EPrefixInternalError, "Constant Folding cannot be done for matrix times vector", this->getLine());
- return 0;
- }
- tempConstArray = new constUnion[this->getNominalSize()];
-
- {// support MSVC++6.0
- for (int size = this->getNominalSize(), i = 0; i < size; i++) {
- tempConstArray[i].fConst = 0.0;
- for (int j = 0; j < size; j++) {
- tempConstArray[i].fConst += ((unionArray[j*size + i].fConst) * rightUnionArray[j].fConst);
- }
- }
- }
-
- tempNode = new TIntermConstantUnion(tempConstArray, node->getType());
- tempNode->setLine(this->getLine());
-
- return tempNode;
-
- case EOpVectorTimesMatrix:
- if (this->getType().getBasicType() != EbtFloat) {
- infoSink.info.message(EPrefixInternalError, "Constant Folding cannot be done for vector times matrix", this->getLine());
- return 0;
- }
-
- tempConstArray = new constUnion[this->getNominalSize()];
- {// support MSVC++6.0
- for (int size = this->getNominalSize(), i = 0; i < size; i++) {
- tempConstArray[i].fConst = 0.0;
- for (int j = 0; j < size; j++) {
- tempConstArray[i].fConst += ((unionArray[j].fConst) * rightUnionArray[i*size + j].fConst);
- }
- }
- }
- break;
-
- case EOpLogicalAnd: // this code is written for possible future use, will not get executed currently
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = unionArray[i].bConst && rightUnionArray[i].bConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"&&\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpLogicalXor: // this code is written for possible future use, will not get executed currently
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = unionArray[i].bConst ^ rightUnionArray[i].bConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"^^\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpLogicalOr: // this code is written for possible future use, will not get executed currently
- tempConstArray = new constUnion[this->getSize()];
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = unionArray[i].bConst || rightUnionArray[i].bConst; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"||\"", this->getLine());
- return 0;
- }
- }
- }
- break;
-
- case EOpEqual:
-
- switch (this->getType().getBasicType()) {
- case EbtFloat:
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- if (unionArray[i].fConst != rightUnionArray[i].fConst) {
- boolNodeFlag = true;
- break; // break out of for loop
- }
- }
- }
- break;
-
- case EbtInt:
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- if (unionArray[i].iConst != rightUnionArray[i].iConst) {
- boolNodeFlag = true;
- break; // break out of for loop
- }
- }
- }
- break;
- case EbtBool:
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- if (unionArray[i].bConst != rightUnionArray[i].bConst) {
- boolNodeFlag = true;
- break; // break out of for loop
- }
- }
- }
- break;
- case EbtStruct:
- if (!compareStructure(node->getType(), node->getUnionArrayPointer(), unionArray, index))
- boolNodeFlag = true;
- break;
-
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"==\"", this->getLine());
- return 0;
- }
-
- tempConstArray = new constUnion[1];
- if (!boolNodeFlag) {
- tempConstArray->bConst = true;
- }
- else {
- tempConstArray->bConst = false;
- }
-
- tempNode = new TIntermConstantUnion(tempConstArray, TType(EbtBool, EvqConst));
- tempNode->setLine(this->getLine());
-
- return tempNode;
-
- case EOpNotEqual:
- switch (this->getType().getBasicType()) {
- case EbtFloat:
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- if (unionArray[i].fConst == rightUnionArray[i].fConst) {
- boolNodeFlag = true;
- break; // break out of for loop
- }
- }
- }
- break;
-
- case EbtInt:
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- if (unionArray[i].iConst == rightUnionArray[i].iConst) {
- boolNodeFlag = true;
- break; // break out of for loop
- }
- }
- }
- break;
- case EbtBool:
- {// support MSVC++6.0
- for (int i = 0; i < this->getSize(); i++) {
- if (unionArray[i].bConst == rightUnionArray[i].bConst) {
- boolNodeFlag = true;
- break; // break out of for loop
- }
- }
- }
- break;
- case EbtStruct:
- if (compareStructure(node->getType(), node->getUnionArrayPointer(), unionArray, index))
- boolNodeFlag = true;
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"!=\"", this->getLine());
- return 0;
- }
-
- tempConstArray = new constUnion[1];
- if (!boolNodeFlag) {
- tempConstArray->bConst = true;
- }
- else {
- tempConstArray->bConst = false;
- }
-
- tempNode = new TIntermConstantUnion(tempConstArray, TType(EbtBool, EvqConst));
- tempNode->setLine(this->getLine());
-
- return tempNode;
-
- default:
- infoSink.info.message(EPrefixInternalError, "Invalid operator for constant folding", this->getLine());
- return 0;
- }
- tempNode = new TIntermConstantUnion(tempConstArray, this->getType());
- tempNode->setLine(this->getLine());
-
- return tempNode;
- } else if (this->getSize() == 1 && this->getType().getBasicType() != EbtStruct
- && constantNode->getSize() == 1 && constantNode->getType().getBasicType() != EbtStruct ) { // scalar constant folding
- constUnion *unionArray = new constUnion[1];
- TIntermConstantUnion* newNode = 0;
-
- switch (this->getType().getBasicType()) {
- case EbtInt:
- {
- //
- // Dealing with two operands, us and constant.
- //
- // Do Binary operations.
- //
- int rightValue = constantNode->getAsConstantUnion()->getUnionArrayPointer()->iConst;
- int leftValue = this->getUnionArrayPointer()->iConst;
- //int line = this->getLine();
-
- switch(op) {
- //?? add constant intrinsics
- case EOpAdd: unionArray->iConst = leftValue + rightValue; break;
- case EOpSub: unionArray->iConst = leftValue - rightValue; break;
- case EOpMul: unionArray->iConst = leftValue * rightValue; break;
- case EOpDiv:
- if (rightValue == 0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- unionArray->iConst = INT_MAX;
- } else
- unionArray->iConst = leftValue / rightValue; break;
-
- case EOpMod: unionArray->iConst = leftValue % rightValue; break;
-
- case EOpRightShift: unionArray->iConst = leftValue >> rightValue; break;
- case EOpLeftShift: unionArray->iConst = leftValue << rightValue; break;
-
- case EOpAnd: unionArray->iConst = leftValue & rightValue; break;
- case EOpInclusiveOr: unionArray->iConst = leftValue | rightValue; break;
- case EOpExclusiveOr: unionArray->iConst = leftValue ^ rightValue; break;
-
- // the following assume it's okay to have memory leaks
- case EOpEqual:
- unionArray->bConst = leftValue == rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpNotEqual:
- unionArray->bConst = leftValue != rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpLessThan:
- unionArray->bConst = leftValue < rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpGreaterThan:
- unionArray->bConst = leftValue > rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpLessThanEqual:
- unionArray->bConst = leftValue <= rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpGreaterThanEqual:
- unionArray->bConst = leftValue >= rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
-
- default:
- //infoSink.info.message(EPrefixInternalError, "Binary operation not folded into constant int", line);
- return 0;
- }
- if (!newNode) {
- newNode = new TIntermConstantUnion(unionArray, TType(EbtInt, EvqConst));
- }
- newNode->setLine(constantNode->getLine());
- return newNode;
- }
- case EbtFloat:
- {
- float rightValue = constantNode->getAsConstantUnion()->getUnionArrayPointer()->fConst;
- float leftValue = this->getUnionArrayPointer()->fConst;
-
- switch(op) {
- //?? add constant intrinsics
- case EOpAdd: unionArray->fConst = leftValue + rightValue; break;
- case EOpSub: unionArray->fConst = leftValue - rightValue; break;
- case EOpMul: unionArray->fConst = leftValue * rightValue; break;
- case EOpDiv:
- if (rightValue == 0.0) {
- infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", this->getLine());
- unionArray->fConst = FLT_MAX;
- } else
- unionArray->fConst = leftValue / rightValue; break;
-
- // the following assume it's okay to have memory leaks (cleaned up by pool allocator)
- case EOpEqual:
- unionArray->bConst = leftValue == rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpNotEqual:
- unionArray->bConst = leftValue != rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpLessThan:
- unionArray->bConst = leftValue < rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpGreaterThan:
- unionArray->bConst = leftValue > rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpLessThanEqual:
- unionArray->bConst = leftValue <= rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
- case EOpGreaterThanEqual:
- unionArray->bConst = leftValue >= rightValue;
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- break;
-
- default:
- //infoSink.info.message(EPrefixInternalError, "Binary operation not folded into constant float", line);
- return 0;
- }
- if (!newNode) {
- newNode = new TIntermConstantUnion(unionArray, TType(EbtFloat, EvqConst));
- }
- newNode->setLine(constantNode->getLine());
- return newNode;
- }
- case EbtBool:
- {
- bool rightValue = constantNode->getAsConstantUnion()->getUnionArrayPointer()->bConst;
- bool leftValue = this->getUnionArrayPointer()->bConst;
-
- switch(op) {
- //?? add constant intrinsics
- case EOpLogicalAnd: unionArray->bConst = leftValue & rightValue; break;
- case EOpLogicalXor: unionArray->bConst = leftValue ^ rightValue; break;
- case EOpLogicalOr: unionArray->bConst = leftValue | rightValue; break;
- default:
- infoSink.info.message(EPrefixInternalError, "Binary operator cannot be folded into constant bool", line);
- return 0;
- }
- newNode = new TIntermConstantUnion(unionArray, TType(EbtBool, EvqConst));
- newNode->setLine(constantNode->getLine());
- return newNode;
- }
- default:
- infoSink.info.message(EPrefixInternalError, "Cannot fold constant", this->getLine());
- return 0;
- }
- }
- } else {
- //
- // Do unary operations
- //
- TIntermConstantUnion *newNode = 0;
- constUnion* tempConstArray = new constUnion[this->getSize()];
- if (this->getSize() > 1) {
- for (int i = 0; i < this->getSize(); i++) {
- switch(op) {
- case EOpNegative:
- switch (this->getType().getBasicType()) {
- case EbtFloat: tempConstArray[i].fConst = -(unionArray[i].fConst); break;
- case EbtInt: tempConstArray[i].iConst = -(unionArray[i].iConst); break;
- default:
- infoSink.info.message(EPrefixInternalError, "Unary operation not folded into constant", this->getLine());
- return 0;
- }
- break;
- case EOpLogicalNot: // this code is written for possible future use, will not get executed currently
- switch (this->getType().getBasicType()) {
- case EbtBool: tempConstArray[i].bConst = !(unionArray[i].bConst); break;
- default:
- infoSink.info.message(EPrefixInternalError, "Unary operation not folded into constant", this->getLine());
- return 0;
- }
- break;
- default:
- return 0;
- }
- }
- newNode = new TIntermConstantUnion(tempConstArray, this->getType());
- newNode->setLine(this->getLine());
- return newNode;
- } else {
- switch(op) {
- //?? add constant intrinsics
- case EOpNegative:
- switch (this->getType().getBasicType()) {
- case EbtInt:
- tempConstArray->iConst = -(this->getUnionArrayPointer()->iConst);
- newNode = new TIntermConstantUnion(tempConstArray, TType(EbtInt, EvqConst));
- break;
- case EbtFloat:
- tempConstArray->fConst = -(this->getUnionArrayPointer()->fConst);
- newNode = new TIntermConstantUnion(tempConstArray, TType(EbtFloat, EvqConst));
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Unary operation not folded into constant", line);
- return 0;
- }
- break;
- case EOpLogicalNot:
- switch (this->getType().getBasicType()) {
- case EbtBool:
- tempConstArray->bConst = !this->getUnionArrayPointer()->bConst;
- newNode = new TIntermConstantUnion(tempConstArray, TType(EbtBool, EvqConst));
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Unary operation not folded into constant", line);
- return 0;
- }
- break;
- default:
- return 0;
- }
- newNode->setLine(this->getLine());
- return newNode;
-
- }
- }
-
- return this;
-}
-
-TIntermConstantUnion* TIntermediate::changeAggrToTempConst(TIntermAggregate* node, TSymbolTable& symbolTable, TSourceLoc line)
-{
- constUnion* unionArray = new constUnion[node->getType().getInstanceSize()];
- bool returnVal;
-
- if (node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion()) {
- returnVal = parseConstTree(line, node, unionArray, node->getOp(), symbolTable, node->getType(), true);
- }
- else {
- returnVal = parseConstTree(line, node, unionArray, node->getOp(), symbolTable, node->getType());
- }
-
- if (returnVal)
- unionArray = 0;
-
- return (addConstantUnion(unionArray, node->getType(), node->getLine()));
-}
-
-TIntermTyped* TIntermediate::copyConstUnion(TIntermConstantUnion* node)
-{
- constUnion *unionArray = node->getUnionArrayPointer();
-
- if (!unionArray)
- return 0;
-
- int size;
- if (node->getType().getBasicType() == EbtStruct)
- //?? We should actually be calling getStructSize() function and not setStructSize. This problem occurs in case
- // of nested/embedded structs.
- size = node->getType().setStructSize(node->getType().getStruct());
- //size = node->getType().getStructSize();
- else
- size = node->getType().getInstanceSize();
-
- constUnion *newSpace = new constUnion[size];
-
- for (int i = 0; i < size; i++)
- newSpace[i] = unionArray[i];
-
- node->setUnionArrayPointer(newSpace);
- return node;
-}
-
-TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermConstantUnion* node)
-{
- constUnion *rightUnionArray = node->getUnionArrayPointer();
- int size = node->getType().getInstanceSize();
-
- constUnion *leftUnionArray = new constUnion[size];
-
- for (int i=0; i < size; i++) {
-
- switch (promoteTo) {
- case EbtFloat:
- switch (node->getType().getBasicType()) {
- case EbtInt:
- (leftUnionArray[i]).fConst = static_cast<float>(rightUnionArray[i].iConst);
- break;
- case EbtBool:
- (leftUnionArray[i]).fConst = static_cast<float>(rightUnionArray[i].bConst);
- break;
- case EbtFloat:
- (leftUnionArray[i]).fConst = rightUnionArray[i].fConst;
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine());
- return 0;
- }
- break;
- case EbtInt:
- switch (node->getType().getBasicType()) {
- case EbtInt:
- (leftUnionArray[i]).iConst = rightUnionArray[i].iConst;
- break;
- case EbtBool:
- (leftUnionArray[i]).iConst = static_cast<int>(rightUnionArray[i].bConst);
- break;
- case EbtFloat:
- (leftUnionArray[i]).iConst = static_cast<int>(rightUnionArray[i].fConst);
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine());
- return 0;
- }
- break;
- case EbtBool:
- switch (node->getType().getBasicType()) {
- case EbtInt:
- (leftUnionArray[i]).bConst = rightUnionArray[i].iConst != 0;
- break;
- case EbtBool:
- (leftUnionArray[i]).bConst = rightUnionArray[i].bConst;
- break;
- case EbtFloat:
- (leftUnionArray[i]).bConst = rightUnionArray[i].fConst != 0.0;
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine());
- return 0;
- }
-
- break;
- default:
- infoSink.info.message(EPrefixInternalError, "Incorrect data type found", node->getLine());
- return 0;
- }
-
- }
-
- const TType& t = node->getType();
-
- return addConstantUnion(leftUnionArray, TType(promoteTo, t.getQualifier(), t.getNominalSize(), t.isMatrix(), t.isArray()), node->getLine());
-}
-
-//
-// This method inserts the child nodes into the parent node at the given location specified
-// by parentNodeIter. offset tells the integer offset into the parent vector that points to
-// the child node. sequenceVector is the parent vector.
-// Returns reference to the last inserted child node
-// increments the offset based on the number of child nodes added
-//
-void TIntermediate::removeChildNode(TIntermSequence &parentSequence, TType& parentType, int& offset, TIntermSequence::iterator& parentNodeIter, TIntermAggregate* child)
-{
- if (!child)
- return;
-
- parentNodeIter = parentSequence.begin() + offset;
-
- TIntermSequence& childSequence = child->getSequence();
- int oldSize = static_cast<int>(parentSequence.size());
- if (childSequence.size() == 1) {
- if (!removeMatrixConstNode(parentSequence, parentType, child, offset)) {
- for (int i = 0; i < child->getType().getInstanceSize(); i++) {
- constUnion* constantUnion = new constUnion[1];
- *constantUnion = *(childSequence[0]->getAsConstantUnion()->getUnionArrayPointer());
- TIntermConstantUnion *constant = new TIntermConstantUnion(constantUnion,
- childSequence[0]->getAsConstantUnion()->getType());
- constant->setLine(child->getLine());
- parentNodeIter = parentSequence.begin() + offset;
- parentSequence.insert(parentNodeIter, constant);
- }
- }
- } else
- parentSequence.insert(parentNodeIter, childSequence.begin(), childSequence.end());
-
- int newSize = static_cast<int>(parentSequence.size());
- offset = offset + newSize - oldSize;
- parentNodeIter = parentSequence.begin() + offset;
- parentNodeIter = parentSequence.erase(parentNodeIter);
- offset--;
- parentNodeIter--;
-}
-
-//
-// The parent has only one child node. This method is not implemented
-// for parent that is a structure
-//
-TIntermTyped* TIntermediate::removeChildNode(TIntermTyped* parent, TType* parentType, TIntermAggregate* child)
-{
- TIntermTyped* resultNode = 0;
-
- if (parentType->getInstanceSize() == 1) {
- resultNode = child->getSequence()[0]->getAsTyped();
- } else {
- int size = parentType->getInstanceSize();
- TIntermSequence& parentSequence = parent->getAsAggregate()->getSequence();
- TIntermSequence& childSequence = child->getSequence();
-
- if (childSequence.size() == 1) {
- if (!removeMatrixConstNode(parentSequence, *parentType, child, 1))
- parentSequence.push_back(child->getSequence()[0]);
- } else {
- for (int i = 0; i < size; i++) {
- parentSequence.push_back(child->getSequence()[i]);
- }
- }
- parentSequence.erase(parentSequence.begin());
-
- return parent;
- }
-
- return resultNode;
-}
-
-bool TIntermediate::removeMatrixConstNode(TIntermSequence &parentSequence, TType& parentType, TIntermAggregate* child, int offset)
-{
- if (!child)
- return false;
-
- TIntermSequence::iterator parentNodeIter;
- TIntermSequence &childSequence = child->getSequence();
-
- switch (child->getOp()) {
- case EOpConstructMat2:
- case EOpConstructMat3:
- case EOpConstructMat4:
- {// support MSVC++6.0
- for (int i = 0; i < child->getType().getInstanceSize(); i++) {
- constUnion* constantUnion = new constUnion[1];
- if (i % (child->getType().getNominalSize() + 1) == 0) {
- *constantUnion = *(childSequence[0]->getAsConstantUnion()->getUnionArrayPointer());
- } else {
- switch (parentType.getBasicType()) {
- case EbtInt: constantUnion->iConst = 0; break;
- case EbtFloat: constantUnion->fConst = 0.0; break;
- case EbtBool: constantUnion->bConst = false; break;
- default: ; /* default added by BrianP */
- }
- }
- TIntermConstantUnion *constant = new TIntermConstantUnion(constantUnion,
- childSequence[0]->getAsConstantUnion()->getType());
- constant->setLine(child->getLine());
- parentNodeIter = parentSequence.begin() + offset + i;
- parentSequence.insert(parentNodeIter, constant);
- }
- }
- return true;
- default:
- return false;
- }
-}
-
-void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
-{
- assert (!pragmaTable);
- pragmaTable = new TPragmaTable();
- *pragmaTable = pTable;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/MMap.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/MMap.h
deleted file mode 100755
index 66703cdd9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/MMap.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _MMAP_INCLUDED_
-#define _MMAP_INCLUDED_
-
-//
-// Encapsulate memory mapped files
-//
-
-class TMMap {
-public:
- TMMap(const char* fileName) :
- fSize(-1), // -1 is the error value returned by GetFileSize()
- fp(NULL),
- fBuff(0) // 0 is the error value returned by MapViewOfFile()
- {
- if ((fp = fopen(fileName, "r")) == NULL)
- return;
- char c = getc(fp);
- fSize = 0;
- while (c != EOF) {
- fSize++;
- c = getc(fp);
- }
- if (c == EOF)
- fSize++;
- rewind(fp);
- fBuff = (char*)malloc(sizeof(char) * fSize);
- int count = 0;
- c = getc(fp);
- while (c != EOF) {
- fBuff[count++] = c;
- c = getc(fp);
- }
- fBuff[count++] = c;
- }
-
- char* getData() { return fBuff; }
- int getSize() { return fSize; }
-
- ~TMMap() {
- if (fp != NULL)
- fclose(fp);
- }
-
-private:
- int fSize; // size of file to map in
- FILE *fp;
- char* fBuff; // the actual data;
-};
-
-#endif // _MMAP_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.cpp
deleted file mode 100755
index cfc42746a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.cpp
+++ /dev/null
@@ -1,1452 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "ParseHelper.h"
-#include "Include/InitializeParseContext.h"
-#include "osinclude.h"
-#include <stdarg.h>
-///////////////////////////////////////////////////////////////////////
-//
-// Sub- vector and matrix fields
-//
-////////////////////////////////////////////////////////////////////////
-
-//
-// Look at a '.' field selector string and change it into offsets
-// for a vector.
-//
-bool TParseContext::parseVectorFields(const TString& compString, int vecSize, TVectorFields& fields, int line)
-{
- fields.num = (int) compString.size();
- if (fields.num > 4) {
- error(line, "illegal vector field selection", compString.c_str(), "");
- return false;
- }
-
- enum {
- exyzw,
- ergba,
- estpq
- } fieldSet[4];
-
- for (int i = 0; i < fields.num; ++i) {
- switch (compString[i]) {
- case 'x':
- fields.offsets[i] = 0;
- fieldSet[i] = exyzw;
- break;
- case 'r':
- fields.offsets[i] = 0;
- fieldSet[i] = ergba;
- break;
- case 's':
- fields.offsets[i] = 0;
- fieldSet[i] = estpq;
- break;
- case 'y':
- fields.offsets[i] = 1;
- fieldSet[i] = exyzw;
- break;
- case 'g':
- fields.offsets[i] = 1;
- fieldSet[i] = ergba;
- break;
- case 't':
- fields.offsets[i] = 1;
- fieldSet[i] = estpq;
- break;
- case 'z':
- fields.offsets[i] = 2;
- fieldSet[i] = exyzw;
- break;
- case 'b':
- fields.offsets[i] = 2;
- fieldSet[i] = ergba;
- break;
- case 'p':
- fields.offsets[i] = 2;
- fieldSet[i] = estpq;
- break;
-
- case 'w':
- fields.offsets[i] = 3;
- fieldSet[i] = exyzw;
- break;
- case 'a':
- fields.offsets[i] = 3;
- fieldSet[i] = ergba;
- break;
- case 'q':
- fields.offsets[i] = 3;
- fieldSet[i] = estpq;
- break;
- default:
- error(line, "illegal vector field selection", compString.c_str(), "");
- return false;
- }
- }
-
- for (int i = 0; i < fields.num; ++i) {
- if (fields.offsets[i] >= vecSize) {
- error(line, "vector field selection out of range", compString.c_str(), "");
- return false;
- }
-
- if (i > 0) {
- if (fieldSet[i] != fieldSet[i-1]) {
- error(line, "illegal - vector component fields not from the same set", compString.c_str(), "");
- return false;
- }
- }
- }
-
- return true;
-}
-
-
-//
-// Look at a '.' field selector string and change it into offsets
-// for a matrix.
-//
-bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TMatrixFields& fields, int line)
-{
- fields.wholeRow = false;
- fields.wholeCol = false;
- fields.row = -1;
- fields.col = -1;
-
- if (compString.size() != 2) {
- error(line, "illegal length of matrix field selection", compString.c_str(), "");
- return false;
- }
-
- if (compString[0] == '_') {
- if (compString[1] < '0' || compString[1] > '3') {
- error(line, "illegal matrix field selection", compString.c_str(), "");
- return false;
- }
- fields.wholeCol = true;
- fields.col = compString[1] - '0';
- } else if (compString[1] == '_') {
- if (compString[0] < '0' || compString[0] > '3') {
- error(line, "illegal matrix field selection", compString.c_str(), "");
- return false;
- }
- fields.wholeRow = true;
- fields.row = compString[0] - '0';
- } else {
- if (compString[0] < '0' || compString[0] > '3' ||
- compString[1] < '0' || compString[1] > '3') {
- error(line, "illegal matrix field selection", compString.c_str(), "");
- return false;
- }
- fields.row = compString[0] - '0';
- fields.col = compString[1] - '0';
- }
-
- if (fields.row >= matSize || fields.col >= matSize) {
- error(line, "matrix field selection out of range", compString.c_str(), "");
- return false;
- }
-
- return true;
-}
-
-///////////////////////////////////////////////////////////////////////
-//
-// Errors
-//
-////////////////////////////////////////////////////////////////////////
-
-//
-// Track whether errors have occurred.
-//
-void TParseContext::recover()
-{
- recoveredFromError = true;
-}
-
-//
-// Used by flex/bison to output all syntax and parsing errors.
-//
-void C_DECL TParseContext::error(TSourceLoc nLine, const char *szReason, const char *szToken,
- const char *szExtraInfoFormat, ...)
-{
- char szExtraInfo[400];
- va_list marker;
-
- va_start(marker, szExtraInfoFormat);
-
- _vsnprintf(szExtraInfo, sizeof(szExtraInfo), szExtraInfoFormat, marker);
-
- /* VC++ format: file(linenum) : error #: 'token' : extrainfo */
- infoSink.info.prefix(EPrefixError);
- infoSink.info.location(nLine);
- infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n";
-
- va_end(marker);
-
- ++numErrors;
-}
-
-//
-// Same error message for all places assignments don't work.
-//
-void TParseContext::assignError(int line, const char* op, TString left, TString right)
-{
- error(line, "", op, "cannot convert from '%s' to '%s'",
- right.c_str(), left.c_str());
-}
-
-//
-// Same error message for all places unary operations don't work.
-//
-void TParseContext::unaryOpError(int line, char* op, TString operand)
-{
- error(line, " wrong operand type", op,
- "no operation '%s' exists that takes an operand of type %s (or there is no acceptable conversion)",
- op, operand.c_str());
-}
-
-//
-// Same error message for all binary operations don't work.
-//
-void TParseContext::binaryOpError(int line, char* op, TString left, TString right)
-{
- error(line, " wrong operand types ", op,
- "no operation '%s' exists that takes a left-hand operand of type '%s' and "
- "a right operand of type '%s' (or there is no acceptable conversion)",
- op, left.c_str(), right.c_str());
-}
-
-//
-// Both test and if necessary, spit out an error, to see if the node is really
-// an l-value that can be operated on this way.
-//
-// Returns true if the was an error.
-//
-bool TParseContext::lValueErrorCheck(int line, char* op, TIntermTyped* node)
-{
- TIntermSymbol* symNode = node->getAsSymbolNode();
- TIntermBinary* binaryNode = node->getAsBinaryNode();
-
- if (binaryNode) {
- bool errorReturn;
-
- switch(binaryNode->getOp()) {
- case EOpIndexDirect:
- case EOpIndexIndirect:
- case EOpIndexDirectStruct:
- return lValueErrorCheck(line, op, binaryNode->getLeft());
- case EOpVectorSwizzle:
- errorReturn = lValueErrorCheck(line, op, binaryNode->getLeft());
- if (!errorReturn) {
- int offset[4] = {0,0,0,0};
-
- TIntermTyped* rightNode = binaryNode->getRight();
- TIntermAggregate *aggrNode = rightNode->getAsAggregate();
-
- for (TIntermSequence::iterator p = aggrNode->getSequence().begin();
- p != aggrNode->getSequence().end(); p++) {
- int value = (*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->iConst;
- offset[value]++;
- if (offset[value] > 1) {
- error(line, " l-value of swizzle cannot have duplicate components", op, "", "");
-
- return true;
- }
- }
- }
-
- return errorReturn;
- default:
- break;
- }
- error(line, " l-value required", op, "", "");
-
- return true;
- }
-
-
- const char* symbol = 0;
- if (symNode != 0)
- symbol = symNode->getSymbol().c_str();
-
- char* message = 0;
- switch (node->getQualifier()) {
- case EvqConst: message = "can't modify a const"; break;
- case EvqConstReadOnly: message = "can't modify a const"; break;
- case EvqAttribute: message = "can't modify an attribute"; break;
- case EvqUniform: message = "can't modify a uniform"; break;
- case EvqVaryingIn: message = "can't modify a varying"; break;
- case EvqInput: message = "can't modify an input"; break;
- case EvqFace: message = "can't modify gl_FrontFace"; break;
- case EvqFragCoord: message = "can't modify gl_FragCoord"; break;
- default:
-
- //
- // Type that can't be written to?
- //
- switch (node->getBasicType()) {
- case EbtSampler1D:
- case EbtSampler2D:
- case EbtSampler3D:
- case EbtSamplerCube:
- case EbtSampler1DShadow:
- case EbtSampler2DShadow:
- message = "can't modify a sampler";
- break;
- case EbtVoid:
- message = "can't modify void";
- break;
- default:
- break;
- }
- }
-
- if (message == 0 && binaryNode == 0 && symNode == 0) {
- error(line, " l-value required", op, "", "");
-
- return true;
- }
-
-
- //
- // Everything else is okay, no error.
- //
- if (message == 0)
- return false;
-
- //
- // If we get here, we have an error and a message.
- //
- if (symNode)
- error(line, " l-value required", op, "\"%s\" (%s)", symbol, message);
- else
- error(line, " l-value required", op, "(%s)", message);
-
- return true;
-}
-
-//
-// Both test, and if necessary spit out an error, to see if the node is really
-// a constant.
-//
-// Returns true if the was an error.
-//
-bool TParseContext::constErrorCheck(TIntermTyped* node)
-{
- if (node->getQualifier() == EvqConst)
- return false;
-
- error(node->getLine(), "constant expression required", "", "");
-
- return true;
-}
-
-//
-// Both test, and if necessary spit out an error, to see if the node is really
-// an integer.
-//
-// Returns true if the was an error.
-//
-bool TParseContext::integerErrorCheck(TIntermTyped* node, char* token)
-{
- if (node->getBasicType() == EbtInt && node->getNominalSize() == 1)
- return false;
-
- error(node->getLine(), "integer expression required", token, "");
-
- return true;
-}
-
-//
-// Both test, and if necessary spit out an error, to see if we are currently
-// globally scoped.
-//
-// Returns true if the was an error.
-//
-bool TParseContext::globalErrorCheck(int line, bool global, char* token)
-{
- if (global)
- return false;
-
- error(line, "only allowed at global scope", token, "");
-
- return true;
-}
-
-//
-// For now, keep it simple: if it starts "gl_", it's reserved, independent
-// of scope. Except, if the symbol table is at the built-in push-level,
-// which is when we are parsing built-ins.
-//
-// Returns true if there was an error.
-//
-bool TParseContext::reservedErrorCheck(int line, const TString& identifier)
-{
- if (symbolTable.atBuiltInLevel() ||
- identifier.substr(0, 3) != TString("gl_"))
- return false;
-
- error(line, "reserved built-in name", "gl_", "");
-
- return true;
-}
-
-//
-// Make sure there is enough data provided to the constructor to build
-// something of the type of the constructor. Also returns the type of
-// the constructor.
-//
-// Returns true if there was an error in construction.
-//
-bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction& function, TOperator op, TType* type)
-{
- switch(op) {
- case EOpConstructInt: *type = TType(EbtInt); break;
- case EOpConstructBool: *type = TType(EbtBool); break;
- case EOpConstructFloat: *type = TType(EbtFloat); break;
- case EOpConstructVec2: *type = TType(EbtFloat, EvqTemporary, 2); break;
- case EOpConstructVec3: *type = TType(EbtFloat, EvqTemporary, 3); break;
- case EOpConstructVec4: *type = TType(EbtFloat, EvqTemporary, 4); break;
- case EOpConstructBVec2: *type = TType(EbtBool, EvqTemporary, 2); break;
- case EOpConstructBVec3: *type = TType(EbtBool, EvqTemporary, 3); break;
- case EOpConstructBVec4: *type = TType(EbtBool, EvqTemporary, 4); break;
- case EOpConstructIVec2: *type = TType(EbtInt, EvqTemporary, 2); break;
- case EOpConstructIVec3: *type = TType(EbtInt, EvqTemporary, 3); break;
- case EOpConstructIVec4: *type = TType(EbtInt, EvqTemporary, 4); break;
- case EOpConstructMat2: *type = TType(EbtFloat, EvqTemporary, 2, true); break;
- case EOpConstructMat3: *type = TType(EbtFloat, EvqTemporary, 3, true); break;
- case EOpConstructMat4: *type = TType(EbtFloat, EvqTemporary, 4, true); break;
- case EOpConstructStruct: *type = TType(function.getReturnType().getStruct(), function.getReturnType().getTypeName()); break;
- default:
- error(line, "expected constructor", "Internal Error", "");
- return true;
- }
-
- bool constructingMatrix = false;
- switch(op) {
- case EOpConstructMat2:
- case EOpConstructMat3:
- case EOpConstructMat4:
- constructingMatrix = true;
- break;
- default:
- break;
- }
-
- //
- // Note: It's okay to have too many components available, but not okay to have unused
- // arguments. 'full' will go to true when enough args have been seen. If we loop
- // again, there is an extra argument, so 'overfull' will become true.
- //
-
- int size = 0;
- bool constType = true;
- bool full = false;
- bool overFull = false;
- bool matrixInMatrix = false;
- for (int i = 0; i < function.getParamCount(); ++i) {
- size += function[i].type->getInstanceSize();
- if (constructingMatrix && function[i].type->isMatrix())
- matrixInMatrix = true;
- if (full)
- overFull = true;
- if (op != EOpConstructStruct && size >= type->getInstanceSize())
- full = true;
- if (function[i].type->getQualifier() != EvqConst)
- constType = false;
- }
-
- if (constType)
- type->changeQualifier(EvqConst);
-
- if (matrixInMatrix) {
- error(line, "constructing matrix from matrix", "constructor", "(reserved)");
- return true;
- }
-
- if (overFull) {
- error(line, "too many arguments", "constructor", "");
- return true;
- }
-
- if (size != 1 && size < type->getInstanceSize() || (size < 1) && op == EOpConstructStruct) {
- error(line, "not enough data provided for construction", "constructor", "");
- return true;
- }
-
- TIntermTyped* typed = node->getAsTyped();
- if (typed == 0) {
- error(line, "constructor argument does not have a type", "constructor", "");
- return true;
- }
- if (op != EOpConstructStruct && IsSampler(typed->getBasicType())) {
- error(line, "cannot convert a sampler", "constructor", "");
- return true;
- }
- if (typed->getBasicType() == EbtVoid) {
- error(line, "cannot convert a void", "constructor", "");
- return true;
- }
-
- return false;
-}
-
-// This function checks to see if a void variable has been declared and raise an error message for such a case
-//
-// returns true in case of an error
-//
-bool TParseContext::voidErrorCheck(int line, const TString& identifier, const TPublicType& pubType)
-{
- if (pubType.type == EbtVoid) {
- error(line, "illegal use of type 'void'", identifier.c_str(), "");
- return true;
- }
-
- return false;
-}
-
-// This function checks to see if the node (for the expression) contains a scalar boolean expression or not
-//
-// returns true in case of an error
-//
-bool TParseContext::boolErrorCheck(int line, const TIntermTyped* type)
-{
- if (type->getBasicType() != EbtBool || type->isArray() || type->isMatrix() || type->isVector()) {
- error(line, "boolean expression expected", "", "");
- return true;
- }
-
- return false;
-}
-
-// This function checks to see if the node (for the expression) contains a scalar boolean expression or not
-//
-// returns true in case of an error
-//
-bool TParseContext::boolErrorCheck(int line, const TPublicType& pType)
-{
- if (pType.type != EbtBool || pType.array || pType.matrix || (pType.size > 1)) {
- error(line, "boolean expression expected", "", "");
- return true;
- }
-
- return false;
-}
-
-bool TParseContext::samplerErrorCheck(int line, const TPublicType& pType, const char* reason)
-{
- if (pType.type == EbtStruct) {
- if (containsSampler(*pType.userDef)) {
- error(line, reason, TType::getBasicString(pType.type), "(structure contains a sampler)");
-
- return true;
- }
-
- return false;
- } else if (IsSampler(pType.type)) {
- error(line, reason, TType::getBasicString(pType.type), "");
-
- return true;
- }
-
- return false;
-}
-
-bool TParseContext::structQualifierErrorCheck(int line, const TPublicType& pType)
-{
- if ((pType.qualifier == EvqVaryingIn || pType.qualifier == EvqVaryingOut || pType.qualifier == EvqAttribute) &&
- pType.type == EbtStruct) {
- error(line, "cannot be used with a structure", getQualifierString(pType.qualifier), "");
-
- return true;
- }
-
- if (pType.qualifier != EvqUniform && samplerErrorCheck(line, pType, "samplers must be uniform"))
- return true;
-
- return false;
-}
-
-bool TParseContext::parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type)
-{
- if ((qualifier == EvqOut || qualifier == EvqInOut) &&
- type.getBasicType() != EbtStruct && IsSampler(type.getBasicType())) {
- error(line, "samplers cannot be output parameters", type.getBasicString(), "");
- return true;
- }
-
- return false;
-}
-
-bool TParseContext::containsSampler(TType& type)
-{
- if (IsSampler(type.getBasicType()))
- return true;
-
- if (type.getBasicType() == EbtStruct) {
- TTypeList& structure = *type.getStruct();
- for (unsigned int i = 0; i < structure.size(); ++i) {
- if (containsSampler(*structure[i].type))
- return true;
- }
- }
-
- return false;
-}
-
-bool TParseContext::insertBuiltInArrayAtGlobalLevel()
-{
- TString *name = NewPoolTString("gl_TexCoord");
- TSymbol* symbol = symbolTable.find(*name);
- if (!symbol) {
- error(0, "INTERNAL ERROR finding symbol", name->c_str(), "");
- return true;
- }
- TVariable* variable = static_cast<TVariable*>(symbol);
-
- TVariable* newVariable = new TVariable(name, variable->getType());
-
- if (! symbolTable.insert(*newVariable)) {
- delete newVariable;
- error(0, "INTERNAL ERROR inserting new symbol", name->c_str(), "");
- return true;
- }
-
- return false;
-}
-
-//
-// Do all the semantic checking for declaring an array, with and
-// without a size, and make the right changes to the symbol table.
-//
-// size == 0 means no specified size.
-//
-// Returns true if there was an error.
-//
-bool TParseContext::arrayErrorCheck(int line, TString& identifier, TPublicType type, TIntermTyped* size)
-{
- //
- // Don't check for reserved word use until after we know it's not in the symbol table,
- // because reserved arrays can be redeclared.
- //
-
- //
- // Can the type be an array?
- //
- if (type.array || type.qualifier == EvqAttribute || type.qualifier == EvqConst) {
- error(line, "cannot declare arrays of this type", TType(type).getCompleteString().c_str(), "");
- return true;
- }
- type.array = true;
-
- //
- // size will be 0 if there is no size declared, otherwise it contains the size
- // declared.
- //
- TIntermConstantUnion* constant = 0;
- if (size) {
- constant = size->getAsConstantUnion();
- if (constant == 0 || constant->getBasicType() != EbtInt || constant->getUnionArrayPointer()->iConst <= 0) {
- error(line, "array size must be a positive integer", identifier.c_str(), "");
- return true;
- }
- }
-
- bool builtIn = false;
- bool sameScope = false;
- TSymbol* symbol = symbolTable.find(identifier, &builtIn, &sameScope);
- if (symbol == 0 || !sameScope) {
- if (reservedErrorCheck(line, identifier))
- return true;
-
- TVariable* variable = new TVariable(&identifier, TType(type));
-
- if (size)
- variable->getType().setArraySize(constant->getUnionArrayPointer()->iConst);
-
- if (! symbolTable.insert(*variable)) {
- delete variable;
- error(line, "INTERNAL ERROR inserting new symbol", identifier.c_str(), "");
- return true;
- }
- } else {
- if (! symbol->isVariable()) {
- error(line, "variable expected", identifier.c_str(), "");
- return true;
- }
-
- TVariable* variable = static_cast<TVariable*>(symbol);
- if (! variable->getType().isArray()) {
- error(line, "redeclaring non-array as array", identifier.c_str(), "");
- return true;
- }
- if (variable->getType().getArraySize() > 0) {
- error(line, "redeclaration of array with size", identifier.c_str(), "");
- return true;
- }
-
- if (variable->getType() != TType(type)) {
- error(line, "redeclaration of array with a different type", identifier.c_str(), "");
- return true;
- }
-
- TType* t = variable->getArrayInformationType();
- while (t != 0) {
- if (t->getMaxArraySize() > constant->getUnionArrayPointer()->iConst) {
- error(line, "higher index value already used for the array", identifier.c_str(), "");
- return true;
- }
- t->setArraySize(constant->getUnionArrayPointer()->iConst);
- t = t->getArrayInformationType();
- }
-
- if (size)
- variable->getType().setArraySize(constant->getUnionArrayPointer()->iConst);
- }
-
- if (voidErrorCheck(line, identifier, type))
- return true;
-
- return false;
-}
-
-bool TParseContext::arraySetMaxSize(TIntermSymbol *node, TType* type, int size, bool updateFlag, TSourceLoc line)
-{
- bool builtIn = false;
- TSymbol* symbol = symbolTable.find(node->getSymbol(), &builtIn);
- if (symbol == 0) {
- error(line, " undeclared identifier", node->getSymbol().c_str(), "");
- return true;
- }
- TVariable* variable = static_cast<TVariable*>(symbol);
-
- type->setArrayInformationType(variable->getArrayInformationType());
- variable->updateArrayInformationType(type);
-
- // we dont want to update the maxArraySize when this flag is not set, we just want to include this
- // node type in the chain of node types so that its updated when a higher maxArraySize comes in.
- if (!updateFlag)
- return false;
-
- size++;
- variable->getType().setMaxArraySize(size);
- type->setMaxArraySize(size);
- TType* tt = type;
-
- while(tt->getArrayInformationType() != 0) {
- tt = tt->getArrayInformationType();
- tt->setMaxArraySize(size);
- }
-
- return false;
-}
-
-//
-// Do semantic checking for a variable declaration that has no initializer,
-// and update the symbol table.
-//
-// Returns true if there was an error.
-//
-bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType& type)
-{
- if (reservedErrorCheck(line, identifier))
- recover();
-
- //
- // Make the qualifier make sense, error is issued in a little bit.
- //
- bool constError = false;
- if (type.qualifier == EvqConst) {
- type.qualifier = EvqTemporary;
- constError = true;
- }
-
- TVariable* variable = new TVariable(&identifier, TType(type));
-
- if (! symbolTable.insert(*variable)) {
- error(line, "redefinition", variable->getName().c_str(), "");
- delete variable;
- return true;
- }
- if (constError) {
- error(line, "variables with qualifier 'const' must be initialized", identifier.c_str(), "");
- return true;
- }
-
- if (voidErrorCheck(line, identifier, type))
- return true;
-
- return false;
-}
-
-bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type)
-{
- if (qualifier != EvqConst && qualifier != EvqTemporary) {
- error(line, "qualifier not allowed on function parameter", getQualifierString(qualifier), "");
- return true;
- }
- if (qualifier == EvqConst && paramQualifier != EvqIn) {
- error(line, "qualifier not allowed with ", getQualifierString(qualifier), getQualifierString(paramQualifier));
- return true;
- }
-
- if (qualifier == EvqConst)
- type->changeQualifier(EvqConstReadOnly);
- else
- type->changeQualifier(paramQualifier);
-
- return false;
-}
-
-/////////////////////////////////////////////////////////////////////////////////
-//
-// Non-Errors.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-//
-// Look up a function name in the symbol table, and make sure it is a function.
-//
-// Return the function symbol if found, otherwise 0.
-//
-const TFunction* TParseContext::findFunction(int line, TFunction* call, bool *builtIn)
-{
- const TSymbol* symbol = symbolTable.find(call->getMangledName(), builtIn);
-
- if (symbol == 0) {
- error(line, "no matching overloaded function found", call->getName().c_str(), "");
- return 0;
- }
-
- if (! symbol->isFunction()) {
- error(line, "function name expected", call->getName().c_str(), "");
- return 0;
- }
-
- const TFunction* function = static_cast<const TFunction*>(symbol);
-
- return function;
-}
-//
-// Initializers show up in several places in the grammar. Have one set of
-// code to handle them here.
-//
-bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType,
- TIntermTyped* initializer, TIntermNode*& intermNode)
-{
- if (reservedErrorCheck(line, identifier))
- return true;
-
- if (voidErrorCheck(line, identifier, pType))
- return true;
-
- //
- // add variable to symbol table
- //
- TVariable* variable = new TVariable(&identifier, TType(pType));
- if (! symbolTable.insert(*variable)) {
- error(line, "redefinition", variable->getName().c_str(), "");
- return true;
- // don't delete variable, it's used by error recovery, and the pool
- // pop will take care of the memory
- }
-
- //
- // identifier must be of type constant, a global, or a temporary
- //
- TQualifier qualifier = variable->getType().getQualifier();
- if ((qualifier != EvqTemporary) && (qualifier != EvqGlobal) && (qualifier != EvqConst)) {
- error(line, " cannot initialize this type of qualifier ", variable->getType().getQualifierString(), "");
- return true;
- }
- //
- // test for and propagate constant
- //
-
- if (qualifier == EvqConst) {
- if (qualifier != initializer->getType().getQualifier()) {
- error(line, " assigning non-constant to", "=", "'%s'", variable->getType().getCompleteString().c_str());
- variable->getType().changeQualifier(EvqTemporary);
- return true;
- }
- if (TType(pType) != initializer->getType()) {
- error(line, " non-matching types for const initializer ",
- variable->getType().getQualifierString(), "");
- variable->getType().changeQualifier(EvqTemporary);
- return true;
- }
- if (initializer->getAsConstantUnion()) {
- constUnion* unionArray = variable->getConstPointer();
-
- if (pType.size == 1 && TType(pType).getBasicType() != EbtStruct) {
- switch (pType.type ) {
- case EbtInt:
- unionArray->iConst = (initializer->getAsConstantUnion()->getUnionArrayPointer())[0].iConst;
- break;
- case EbtFloat:
- unionArray->fConst = (initializer->getAsConstantUnion()->getUnionArrayPointer())[0].fConst;
- break;
- case EbtBool:
- unionArray->bConst = (initializer->getAsConstantUnion()->getUnionArrayPointer())[0].bConst;
- break;
- default:
- error(line, " cannot initialize constant of this type", "", "");
- return true;
- }
- } else {
- variable->shareConstPointer(initializer->getAsConstantUnion()->getUnionArrayPointer());
- }
- } else if (initializer->getAsAggregate()) {
- bool returnVal = false;
- constUnion* unionArray = variable->getConstPointer();
- if (initializer->getAsAggregate()->getSequence().size() == 1 && initializer->getAsAggregate()->getSequence()[0]->getAsTyped()->getAsConstantUnion()) {
- returnVal = intermediate.parseConstTree(line, initializer, unionArray, initializer->getAsAggregate()->getOp(), symbolTable, variable->getType(), true);
- }
- else {
- returnVal = intermediate.parseConstTree(line, initializer, unionArray, initializer->getAsAggregate()->getOp(), symbolTable, variable->getType());
- }
- intermNode = 0;
- constUnion *arrayUnion = unionArray;
- if (returnVal) {
- arrayUnion = 0;
- variable->getType().changeQualifier(EvqTemporary);
- }
- return returnVal;
- } else if (initializer->getAsSymbolNode()) {
- const TSymbol* symbol = symbolTable.find(initializer->getAsSymbolNode()->getSymbol());
- const TVariable* tVar = static_cast<const TVariable*>(symbol);
-
- constUnion* constArray = tVar->getConstPointer();
- variable->shareConstPointer(constArray);
- } else {
- error(line, " assigning non-constant to", "=", "'%s'", variable->getType().getCompleteString().c_str());
- variable->getType().changeQualifier(EvqTemporary);
- return true;
- }
- }
-
- if (qualifier != EvqConst) {
- TIntermSymbol* intermSymbol = intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), line);
- intermNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, line);
- if (intermNode == 0) {
- assignError(line, "=", intermSymbol->getCompleteString(), initializer->getCompleteString());
- return true;
- }
- } else
- intermNode = 0;
-
- return false;
-}
-
-//
-// This method checks to see if the given aggregate node has all its children nodes as constants
-// This method does not test if structure members are constant
-//
-bool TParseContext::canNodeBeRemoved(TIntermNode* childNode)
-{
- TIntermAggregate *aggrNode = childNode->getAsAggregate();
- if (!aggrNode)
- return false;
-
- if (!aggrNode->isConstructor() || aggrNode->getOp() == EOpConstructStruct)
- return false;
-
- bool allConstant = true;
-
- // check if all the child nodes are constants so that they can be inserted into
- // the parent node
- if (aggrNode) {
- TIntermSequence &childSequenceVector = aggrNode->getSequence() ;
- for (TIntermSequence::iterator p = childSequenceVector.begin();
- p != childSequenceVector.end(); p++) {
- if (!(*p)->getAsTyped()->getAsConstantUnion())
- return false;
- }
- }
-
- return allConstant;
-}
-
-// This function is used to test for the correctness of the parameters passed to various constructor functions
-// and also convert them to the right datatype if it is allowed and required.
-//
-// Returns 0 for an error or the constructed node (aggregate or typed) for no error.
-//
-TIntermTyped* TParseContext::addConstructor(TIntermNode* node, TType* type, TOperator op, TFunction* fnCall, TSourceLoc line)
-{
- if (node == 0)
- return 0;
-
- TIntermAggregate* aggrNode = node->getAsAggregate();
-
- TTypeList::iterator list;
- TTypeList* structure = 0; // Store the information (vector) about the return type of the structure.
- if (op == EOpConstructStruct) {
- const TType& ttype = fnCall->getReturnType();
- structure = ttype.getStruct();
- list = (*structure).begin();
- }
-
- bool singleArg;
- if (aggrNode) {
- if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1)
- singleArg = true;
- else
- singleArg = false;
- } else
- singleArg = true;
-
- TIntermTyped *newNode;
- if (singleArg) {
- if (op == EOpConstructStruct) {
- // If structure constructor is being called for only one parameter inside the structure,
- // we need to call constructStruct function once.
- if (structure->size() != 1) {
- error(line, "Number of constructor parameters does not match the number of structure fields", "constructor", "");
-
- return 0;
- } else
- return constructStruct(node, (*list).type, 1, node->getLine(), false);
- } else {
- newNode = constructBuiltIn(type, op, node, node->getLine(), false);
- if (newNode && newNode->getAsAggregate()) {
- if (canNodeBeRemoved(newNode->getAsAggregate()->getSequence()[0])) {
- TIntermAggregate* returnAggNode = newNode->getAsAggregate()->getSequence()[0]->getAsAggregate();
- newNode = intermediate.removeChildNode(newNode, type, returnAggNode);
- }
- }
- return newNode;
- }
- }
-
- //
- // Handle list of arguments.
- //
- TIntermSequence &sequenceVector = aggrNode->getSequence() ; // Stores the information about the parameter to the constructor
- // if the structure constructor contains more than one parameter, then construct
- // each parameter
- if (op == EOpConstructStruct) {
- if (structure->size() != sequenceVector.size()) { // If the number of parameters to the constructor does not match the expected number of parameters
- error(line, "Number of constructor parameters does not match the number of structure fields", "constructor", "");
-
- return 0;
- }
- }
-
- int paramCount = 0; // keeps a track of the constructor parameter number being checked
-
- // for each parameter to the constructor call, check to see if the right type is passed or convert them
- // to the right type if possible (and allowed).
- // for structure constructors, just check if the right type is passed, no conversion is allowed.
-
- for (TIntermSequence::iterator p = sequenceVector.begin();
- p != sequenceVector.end(); p++, paramCount++) {
- bool move = false;
- if (op == EOpConstructStruct) {
- newNode = constructStruct(*p, (list[paramCount]).type, paramCount+1, node->getLine(), true);
- if (newNode)
- move = true;
- } else {
- newNode = constructBuiltIn(type, op, *p, node->getLine(), true);
-
- if (newNode) {
- if (canNodeBeRemoved(newNode))
- intermediate.removeChildNode(sequenceVector, *type, paramCount, p, newNode->getAsAggregate());
- else
- move = true;
- }
- }
- if (move) {
- sequenceVector.erase(p);
- sequenceVector.insert(p, newNode);
- }
- }
-
- return intermediate.setAggregateOperator(aggrNode, op, line);
-}
-
-// Function for constructor implementation. Calls addUnaryMath with appropriate EOp value
-// for the parameter to the constructor (passed to this function). Essentially, it converts
-// the parameter types correctly. If a constructor expects an int (like ivec2) and is passed a
-// float, then float is converted to int.
-//
-// Returns 0 for an error or the constructed node.
-//
-TIntermTyped* TParseContext::constructBuiltIn(TType* type, TOperator op, TIntermNode* node, TSourceLoc line, bool subset)
-{
- TIntermTyped* newNode;
- TOperator basicOp;
-
- //
- // First, convert types as needed.
- //
- switch (op) {
- case EOpConstructVec2:
- case EOpConstructVec3:
- case EOpConstructVec4:
- case EOpConstructMat2:
- case EOpConstructMat3:
- case EOpConstructMat4:
- case EOpConstructFloat:
- basicOp = EOpConstructFloat;
- break;
-
- case EOpConstructIVec2:
- case EOpConstructIVec3:
- case EOpConstructIVec4:
- case EOpConstructInt:
- basicOp = EOpConstructInt;
- break;
-
- case EOpConstructBVec2:
- case EOpConstructBVec3:
- case EOpConstructBVec4:
- case EOpConstructBool:
- basicOp = EOpConstructBool;
- break;
-
- default:
- error(line, "unsupported construction", "", "");
- recover();
-
- return 0;
- }
- newNode = intermediate.addUnaryMath(basicOp, node, node->getLine(), symbolTable);
- if (newNode == 0) {
- error(line, "can't convert", "constructor", "");
- return 0;
- }
-
- //
- // Now, if there still isn't an operation to do the construction, and we need one, add one.
- //
-
- // Otherwise, skip out early.
- if (subset || newNode != node && newNode->getType() == *type)
- return newNode;
-
- // setAggregateOperator will insert a new node for the constructor, as needed.
- return intermediate.setAggregateOperator(newNode, op, line);
-}
-
-// This function tests for the type of the parameters to the structures constructors. Raises
-// an error message if the expected type does not match the parameter passed to the constructor.
-//
-// Returns 0 for an error or the input node itself if the expected and the given parameter types match.
-//
-TIntermTyped* TParseContext::constructStruct(TIntermNode* node, TType* type, int paramCount, TSourceLoc line, bool subset)
-{
- if (*type == node->getAsTyped()->getType()) {
- if (subset)
- return node->getAsTyped();
- else
- return intermediate.setAggregateOperator(node->getAsTyped(), EOpConstructStruct, line);
- } else {
- error(line, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount,
- node->getAsTyped()->getType().getBasicString(), type->getBasicString());
- recover();
- }
-
- return 0;
-}
-
-//
-// This function returns the tree representation for the vector field(s) being accessed from contant vector.
-// If only one component of vector is accessed (v.x or v[0] where v is a contant vector), then a contant node is
-// returned, else an aggregate node is returned (for v.xy). The input to this function could either be the symbol
-// node or it could be the intermediate tree representation of accessing fields in a constant structure or column of
-// a constant matrix.
-//
-TIntermTyped* TParseContext::addConstVectorNode(TVectorFields& fields, TIntermTyped* node, TSourceLoc line)
-{
- TIntermTyped* typedNode;
- TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion();
- TIntermAggregate* aggregateNode = node->getAsAggregate();
-
- constUnion *unionArray;
- if (tempConstantNode) {
- unionArray = tempConstantNode->getUnionArrayPointer();
-
- if (!unionArray) { // this error message should never be raised
- infoSink.info.message(EPrefixInternalError, "constUnion not initialized in addConstVectorNode function", line);
- recover();
-
- return node;
- }
- } else if (aggregateNode) { // if an aggregate node is present, the value has to be taken from the parse tree
- // for a case like vec(4).xz
- unionArray = new constUnion[aggregateNode->getType().getInstanceSize()];
-
- bool returnVal = false;
- if (aggregateNode->getAsAggregate()->getSequence().size() == 1 && aggregateNode->getAsAggregate()->getSequence()[0]->getAsTyped()->getAsConstantUnion()) {
- returnVal = intermediate.parseConstTree(line, aggregateNode, unionArray, aggregateNode->getOp(), symbolTable, aggregateNode->getType(), true);
- }
- else {
- returnVal = intermediate.parseConstTree(line, aggregateNode, unionArray, aggregateNode->getOp(), symbolTable, aggregateNode->getType());
- }
-
- if (returnVal)
- return 0;
-
- } else { // The node has to be either a symbol node or an aggregate node or a tempConstant node, else, its an error
- error(line, "No aggregate or constant union node available", "Internal Error", "");
- recover();
-
- return 0;
- }
-
- constUnion* constArray = new constUnion[fields.num];
-
- for (int i = 0; i < fields.num; i++) {
- if (fields.offsets[i] >= node->getType().getInstanceSize()) {
- error(line, "", "[", "vector field selection out of range '%d'", fields.offsets[i]);
- recover();
- fields.offsets[i] = 0;
- }
-
- constArray[i] = unionArray[fields.offsets[i]];
-
- }
- typedNode = intermediate.addConstantUnion(constArray, node->getType(), line);
- return typedNode;
-}
-
-//
-// This function returns the column being accessed from a constant matrix. The values are retrieved from
-// the symbol table and parse-tree is built for a vector (each column of a matrix is a vector). The input
-// to the function could either be a symbol node (m[0] where m is a constant matrix)that represents a
-// constant matrix or it could be the tree representation of the constant matrix (s.m1[0] where s is a constant structure)
-//
-TIntermTyped* TParseContext::addConstMatrixNode(int index, TIntermTyped* node, TSourceLoc line)
-{
- TIntermTyped* typedNode;
- TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion();
- TIntermAggregate* aggregateNode = node->getAsAggregate();
-
- if (index >= node->getType().getNominalSize()) {
- error(line, "", "[", "matrix field selection out of range '%d'", index);
- recover();
- index = 0;
- }
-
- if (tempConstantNode) {
- constUnion* unionArray = tempConstantNode->getUnionArrayPointer();
- int size = tempConstantNode->getType().getNominalSize();
- typedNode = intermediate.addConstantUnion(&unionArray[size*index], tempConstantNode->getType(), line);
- } else if (aggregateNode) {
- // for a case like mat4(5)[0]
- constUnion* unionArray = new constUnion[aggregateNode->getType().getInstanceSize()];
- int size = aggregateNode->getType().getNominalSize();
-
- bool returnVal = false;
- if (aggregateNode->getAsAggregate()->getSequence().size() == 1 && aggregateNode->getAsAggregate()->getSequence()[0]->getAsTyped()->getAsConstantUnion()) {
- returnVal = intermediate.parseConstTree(line, aggregateNode, unionArray, aggregateNode->getOp(), symbolTable, aggregateNode->getType(), true);
- }
- else {
- returnVal = intermediate.parseConstTree(line, aggregateNode, unionArray, aggregateNode->getOp(), symbolTable, aggregateNode->getType());
- }
-
- if (!returnVal)
- typedNode = intermediate.addConstantUnion(&unionArray[size*index], aggregateNode->getType(), line);
- else
- return 0;
-
- } else {
- error(line, "No Aggregate or Constant Union node available", "Internal Error", "");
- recover();
-
- return 0;
- }
-
- return typedNode;
-}
-
-//
-// This function returns the value of a particular field inside a constant structure from the symbol table.
-// If there is an embedded/nested struct, it appropriately calls addConstStructNested or addConstStructFromAggr
-// function and returns the parse-tree with the values of the embedded/nested struct.
-//
-TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* node, TSourceLoc line)
-{
- TTypeList* fields = node->getType().getStruct();
- TIntermTyped *typedNode;
- int instanceSize = 0;
- unsigned int index = 0;
- TIntermConstantUnion *tempConstantNode = node->getAsConstantUnion();
- TIntermAggregate* aggregateNode = node->getAsAggregate();
-
- for ( index = 0; index < fields->size(); ++index) {
- if ((*fields)[index].type->getFieldName() == identifier) {
- break;
- } else {
- if ((*fields)[index].type->getStruct())
- //?? We should actually be calling getStructSize() function and not setStructSize. This problem occurs in case
- // of nested/embedded structs.
- instanceSize += (*fields)[index].type->setStructSize((*fields)[index].type->getStruct());
- else
- instanceSize += (*fields)[index].type->getInstanceSize();
- }
- }
-
- if (tempConstantNode) {
- constUnion* constArray = tempConstantNode->getUnionArrayPointer();
-
- typedNode = intermediate.addConstantUnion(constArray+instanceSize, tempConstantNode->getType(), line); // type will be changed in the calling function
- } else if (aggregateNode) {
- // for a case like constStruct(1,v3).i where structure fields is int i and vec3 v3.
-
- constUnion* unionArray = new constUnion[aggregateNode->getType().getStructSize()];
-
- bool returnVal = false;
- if (aggregateNode->getAsAggregate()->getSequence().size() == 1 && aggregateNode->getAsAggregate()->getSequence()[0]->getAsTyped()->getAsConstantUnion()) {
- returnVal = intermediate.parseConstTree(line, aggregateNode, unionArray, aggregateNode->getOp(), symbolTable, aggregateNode->getType(), true);
- }
- else {
- returnVal = intermediate.parseConstTree(line, aggregateNode, unionArray, aggregateNode->getOp(), symbolTable, aggregateNode->getType());
- }
-
- if (!returnVal)
- typedNode = intermediate.addConstantUnion(unionArray+instanceSize, aggregateNode->getType(), line);
- else
- return 0;
-
- } else {
- error(line, "No Aggregate or Constant Union node available", "Internal Error", "");
- recover();
-
- return 0;
- }
-
- return typedNode;
-}
-
-//
-// Initialize all supported extensions to disable
-//
-void TParseContext::initializeExtensionBehavior()
-{
- //
- // example code: extensionBehavior["test"] = EDisable; // where "test" is the name of
- // supported extension
- //
-}
-
-OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
-
-bool InitializeParseContextIndex()
-{
- if (GlobalParseContextIndex != OS_INVALID_TLS_INDEX) {
- assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
- return false;
- }
-
- //
- // Allocate a TLS index.
- //
- GlobalParseContextIndex = OS_AllocTLSIndex();
-
- if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
- return false;
- }
-
- return true;
-}
-
-bool InitializeGlobalParseContext()
-{
- if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "InitializeGlobalParseContext(): Parse Context index not initalised");
- return false;
- }
-
- TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
- if (lpParseContext != 0) {
- assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
- return false;
- }
-
- TThreadParseContext *lpThreadData = new TThreadParseContext();
- if (lpThreadData == 0) {
- assert(0 && "InitializeGlobalParseContext(): Unable to create thread parse context");
- return false;
- }
-
- lpThreadData->lpGlobalParseContext = 0;
- OS_SetTLSValue(GlobalParseContextIndex, lpThreadData);
-
- return true;
-}
-
-TParseContextPointer& GetGlobalParseContext()
-{
- //
- // Minimal error checking for speed
- //
-
- TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
-
- return lpParseContext->lpGlobalParseContext;
-}
-
-bool FreeParseContext()
-{
- if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "FreeParseContext(): Parse Context index not initalised");
- return false;
- }
-
- TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
- if (lpParseContext)
- delete lpParseContext;
-
- return true;
-}
-
-bool FreeParseContextIndex()
-{
- OS_TLSIndex tlsiIndex = GlobalParseContextIndex;
-
- if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "FreeParseContextIndex(): Parse Context index not initalised");
- return false;
- }
-
- GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
-
- return OS_FreeTLSIndex(tlsiIndex);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.h
deleted file mode 100755
index 00552b855..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ParseHelper.h
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-#ifndef _PARSER_HELPER_INCLUDED_
-#define _PARSER_HELPER_INCLUDED_
-
-#include "../Include/ShHandle.h"
-#include "SymbolTable.h"
-#include "localintermediate.h"
-
-struct TMatrixFields {
- bool wholeRow;
- bool wholeCol;
- int row;
- int col;
-};
-
-typedef enum {
- EBhRequire,
- EBhEnable,
- EBhWarn,
- EBhDisable
-} TBehavior;
-
-struct TPragma {
- TPragma(bool o, bool d) : optimize(o), debug(d) { }
- bool optimize;
- bool debug;
- TPragmaTable pragmaTable;
-};
-
-//
-// The following are extra variables needed during parsing, grouped together so
-// they can be passed to the parser without needing a global.
-//
-struct TParseContext {
- TParseContext(TSymbolTable& symt, TIntermediate& interm, EShLanguage L, TInfoSink& is) :
- intermediate(interm), symbolTable(symt), infoSink(is), language(L), treeRoot(0),
- recoveredFromError(false), numErrors(0), lexAfterType(false), loopNestingLevel(0),
- inTypeParen(false), contextPragma(true, false) { }
- TIntermediate& intermediate; // to hold and build a parse tree
- TSymbolTable& symbolTable; // symbol table that goes with the language currently being parsed
- TInfoSink& infoSink;
- EShLanguage language; // vertex or fragment language (future: pack or unpack)
- TIntermNode* treeRoot; // root of parse tree being created
- bool recoveredFromError; // true if a parse error has occurred, but we continue to parse
- int numErrors;
- bool lexAfterType; // true if we've recognized a type, so can only be looking for an identifier
- int loopNestingLevel; // 0 if outside all loops
- bool inTypeParen; // true if in parentheses, looking only for an identifier
- const TType* currentFunctionType; // the return type of the function that's currently being parsed
- bool functionReturnsValue; // true if a non-void function has a return
- TMap<TString, TBehavior> extensionBehavior;
- void initializeExtensionBehavior();
-
- void C_DECL error(TSourceLoc, const char *szReason, const char *szToken,
- const char *szExtraInfoFormat, ...);
- bool reservedErrorCheck(int line, const TString& identifier);
- void recover();
-
- bool parseVectorFields(const TString&, int vecSize, TVectorFields&, int line);
- bool parseMatrixFields(const TString&, int matSize, TMatrixFields&, int line);
- void assignError(int line, const char* op, TString left, TString right);
- void unaryOpError(int line, char* op, TString operand);
- void binaryOpError(int line, char* op, TString left, TString right);
- bool lValueErrorCheck(int line, char* op, TIntermTyped*);
- bool constErrorCheck(TIntermTyped* node);
- bool integerErrorCheck(TIntermTyped* node, char* token);
- bool globalErrorCheck(int line, bool global, char* token);
- bool constructorErrorCheck(int line, TIntermNode*, TFunction&, TOperator, TType*);
- bool arrayErrorCheck(int line, TString& identifier, TPublicType type, TIntermTyped* size);
- bool insertBuiltInArrayAtGlobalLevel();
- bool voidErrorCheck(int, const TString&, const TPublicType&);
- bool boolErrorCheck(int, const TIntermTyped*);
- bool boolErrorCheck(int, const TPublicType&);
- bool samplerErrorCheck(int line, const TPublicType& pType, const char* reason);
- bool structQualifierErrorCheck(int line, const TPublicType& pType);
- bool parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type);
- bool containsSampler(TType& type);
- bool nonInitErrorCheck(int line, TString& identifier, TPublicType& type);
- bool paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type);
- const TFunction* findFunction(int line, TFunction* pfnCall, bool *builtIn = 0);
- bool executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType,
- TIntermTyped* initializer, TIntermNode*& intermNode);
- bool canNodeBeRemoved(TIntermNode*);
- TIntermTyped* addConstructor(TIntermNode*, TType*, TOperator, TFunction*, TSourceLoc);
- TIntermTyped* constructStruct(TIntermNode*, TType*, int, TSourceLoc, bool subset);
- TIntermTyped* constructBuiltIn(TType*, TOperator, TIntermNode*, TSourceLoc, bool subset);
- TIntermTyped* addConstVectorNode(TVectorFields&, TIntermTyped*, TSourceLoc);
- TIntermTyped* addConstMatrixNode(int , TIntermTyped*, TSourceLoc);
- TIntermTyped* addConstStruct(TString& , TIntermTyped*, TSourceLoc);
- bool arraySetMaxSize(TIntermSymbol*, TType*, int, bool, TSourceLoc);
- struct TPragma contextPragma;
- TString HashErrMsg;
- bool AfterEOF;
-};
-
-int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext&);
-void PaReservedWord();
-int PaIdentOrType(TString& id, TParseContext&, TSymbol*&);
-int PaParseComment(int &lineno, TParseContext&);
-void setInitialState();
-
-typedef TParseContext* TParseContextPointer;
-extern TParseContextPointer& GetGlobalParseContext();
-#define GlobalParseContext GetGlobalParseContext()
-
-typedef struct TThreadParseContextRec
-{
- TParseContext *lpGlobalParseContext;
-} TThreadParseContext;
-
-#endif // _PARSER_HELPER_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp
deleted file mode 100755
index ba717fce1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/PoolAlloc.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "../Include/PoolAlloc.h"
-#include "../Include/Common.h"
-
-#include "Include/InitializeGlobals.h"
-#include "osinclude.h"
-
-OS_TLSIndex PoolIndex;
-
-void InitializeGlobalPools()
-{
- TThreadGlobalPools* globalPools= static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
- if (globalPools)
- return;
-
- TPoolAllocator *globalPoolAllocator = new TPoolAllocator(true);
-
- TThreadGlobalPools* threadData = new TThreadGlobalPools();
-
- threadData->globalPoolAllocator = globalPoolAllocator;
-
- OS_SetTLSValue(PoolIndex, threadData);
- globalPoolAllocator->push();
-}
-
-void FreeGlobalPools()
-{
- // Release the allocated memory for this thread.
- TThreadGlobalPools* globalPools= static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
- if (!globalPools)
- return;
-
- GlobalPoolAllocator.popAll();
- delete &GlobalPoolAllocator;
- delete globalPools;
-}
-
-bool InitializePoolIndex()
-{
- // Allocate a TLS index.
- if ((PoolIndex = OS_AllocTLSIndex()) == OS_INVALID_TLS_INDEX)
- return false;
-
- return true;
-}
-
-void FreePoolIndex()
-{
- // Release the TLS index.
- OS_FreeTLSIndex(PoolIndex);
-}
-
-TPoolAllocator& GetGlobalPoolAllocator()
-{
- TThreadGlobalPools* threadData = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
-
- return *threadData->globalPoolAllocator;
-}
-
-void SetGlobalPoolAllocatorPtr(TPoolAllocator* poolAllocator)
-{
- TThreadGlobalPools* threadData = static_cast<TThreadGlobalPools*>(OS_GetTLSValue(PoolIndex));
-
- threadData->globalPoolAllocator = poolAllocator;
-}
-
-//
-// Implement the functionality of the TPoolAllocator class, which
-// is documented in PoolAlloc.h.
-//
-TPoolAllocator::TPoolAllocator(bool g, int growthIncrement, int allocationAlignment) :
- global(g),
- pageSize(growthIncrement),
- alignment(allocationAlignment),
- freeList(0),
- inUseList(0),
- numCalls(0)
-{
- //
- // Don't allow page sizes we know are smaller than all common
- // OS page sizes.
- //
- if (pageSize < 4*1024)
- pageSize = 4*1024;
-
- //
- // A large currentPageOffset indicates a new page needs to
- // be obtained to allocate memory.
- //
- currentPageOffset = pageSize;
-
- //
- // Adjust alignment to be at least pointer aligned and
- // power of 2.
- //
- size_t minAlign = sizeof(void*);
- alignment &= ~(minAlign - 1);
- if (alignment < minAlign)
- alignment = minAlign;
- size_t a = 1;
- while (a < alignment)
- a <<= 1;
- alignment = a;
- alignmentMask = a - 1;
-
- //
- // Align header skip
- //
- headerSkip = minAlign;
- if (headerSkip < sizeof(tHeader)) {
- headerSkip = (sizeof(tHeader) + alignmentMask) & ~alignmentMask;
- }
-
- //
- // Put a marker at the beginning of the stack. We won't
- // pop() past this.
- //
- tAllocState start = { currentPageOffset, 0 };
- stack.push_back(start);
-}
-
-TPoolAllocator::~TPoolAllocator()
-{
- if (!global) {
- //
- // Then we know that this object is not being
- // allocated after other, globally scoped objects
- // that depend on it. So we can delete the "in use" memory.
- //
- while (inUseList) {
- tHeader* next = inUseList->nextPage;
- inUseList->~tHeader();
- delete [] reinterpret_cast<char*>(inUseList);
- inUseList = next;
- }
- }
-
- //
- // Always delete the free list memory - it can't be being
- // (correctly) referenced, whether the pool allocator was
- // global or not. We should not check the guard blocks
- // here, because we did it already when the block was
- // placed into the free list.
- //
- while (freeList) {
- tHeader* next = freeList->nextPage;
- delete [] reinterpret_cast<char*>(freeList);
- freeList = next;
- }
-}
-
-// Support MSVC++ 6.0
-const unsigned char TAllocation::guardBlockBeginVal = 0xfb;
-const unsigned char TAllocation::guardBlockEndVal = 0xfe;
-const unsigned char TAllocation::userDataFill = 0xcd;
-
-# ifdef GUARD_BLOCKS
- const size_t TAllocation::guardBlockSize = 16;
-# else
- const size_t TAllocation::guardBlockSize = 0;
-# endif
-
-//
-// Check a single guard block for damage
-//
-void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, char* locText) const
-{
- for (int x = 0; x < guardBlockSize; x++) {
- if (blockMem[x] != val) {
- char assertMsg[80];
-
- // We don't print the assert message. It's here just to be helpful.
- sprintf(assertMsg, "PoolAlloc: Damage %s %u byte allocation at 0x%p\n",
- locText, size, data());
- assert(0 && "PoolAlloc: Damage in guard block");
- }
- }
-}
-
-
-void TPoolAllocator::push()
-{
- tAllocState state = { currentPageOffset, inUseList };
-
- stack.push_back(state);
-
- //
- // Indicate there is no current page to allocate from.
- //
- currentPageOffset = pageSize;
-}
-
-//
-// Do a mass-deallocation of all the individual allocations
-// that have occurred since the last push(), or since the
-// last pop(), or since the object's creation.
-//
-// The deallocated pages are saved for future allocations.
-//
-void TPoolAllocator::pop()
-{
- if (stack.size() < 1)
- return;
-
- tHeader* page = stack.back().page;
- currentPageOffset = stack.back().offset;
-
- while (inUseList != page) {
- // invoke destructor to free allocation list
- inUseList->~tHeader();
-
- tHeader* nextInUse = inUseList->nextPage;
- if (inUseList->pageCount > 1)
- delete [] reinterpret_cast<char*>(inUseList);
- else {
- inUseList->nextPage = freeList;
- freeList = inUseList;
- }
- inUseList = nextInUse;
- }
-
- stack.pop_back();
-}
-
-//
-// Do a mass-deallocation of all the individual allocations
-// that have occurred.
-//
-void TPoolAllocator::popAll()
-{
- while (stack.size() > 0)
- pop();
-}
-
-void* TPoolAllocator::allocate(size_t numBytes)
-{
- // If we are using guard blocks, all allocations are bracketed by
- // them: [guardblock][allocation][guardblock]. numBytes is how
- // much memory the caller asked for. allocationSize is the total
- // size including guard blocks. In release build,
- // guardBlockSize=0 and this all gets optimized away.
- size_t allocationSize = TAllocation::allocationSize(numBytes);
-
- //
- // Just keep some interesting statistics.
- //
- ++numCalls;
- totalBytes += numBytes;
-
- //
- // Do the allocation, most likely case first, for efficiency.
- // This step could be moved to be inline sometime.
- //
- if (currentPageOffset + allocationSize <= pageSize) {
- //
- // Safe to allocate from currentPageOffset.
- //
- unsigned char* memory = reinterpret_cast<unsigned char *>(inUseList) + currentPageOffset;
- currentPageOffset += allocationSize;
- currentPageOffset = (currentPageOffset + alignmentMask) & ~alignmentMask;
-
- return initializeAllocation(inUseList, memory, numBytes);
- }
-
- if (allocationSize + headerSkip > pageSize) {
- //
- // Do a multi-page allocation. Don't mix these with the others.
- // The OS is efficient and allocating and free-ing multiple pages.
- //
- size_t numBytesToAlloc = allocationSize + headerSkip;
- tHeader* memory = reinterpret_cast<tHeader*>(::new char[numBytesToAlloc]);
- if (memory == 0)
- return 0;
-
- // Use placement-new to initialize header
- new(memory) tHeader(inUseList, (numBytesToAlloc + pageSize - 1) / pageSize);
- inUseList = memory;
-
- currentPageOffset = pageSize; // make next allocation come from a new page
-
- // No guard blocks for multi-page allocations (yet)
- return reinterpret_cast<void*>(reinterpret_cast<UINT_PTR>(memory) + headerSkip);
- }
-
- //
- // Need a simple page to allocate from.
- //
- tHeader* memory;
- if (freeList) {
- memory = freeList;
- freeList = freeList->nextPage;
- } else {
- memory = reinterpret_cast<tHeader*>(::new char[pageSize]);
- if (memory == 0)
- return 0;
- }
-
- // Use placement-new to initialize header
- new(memory) tHeader(inUseList, 1);
- inUseList = memory;
-
- unsigned char* ret = reinterpret_cast<unsigned char *>(inUseList) + headerSkip;
- currentPageOffset = (headerSkip + allocationSize + alignmentMask) & ~alignmentMask;
-
- return initializeAllocation(inUseList, ret, numBytes);
-}
-
-
-//
-// Check all allocations in a list for damage by calling check on each.
-//
-void TAllocation::checkAllocList() const
-{
- for (const TAllocation* alloc = this; alloc != 0; alloc = alloc->prevAlloc)
- alloc->check();
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp
deleted file mode 100755
index 2897f48b1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "../Include/intermediate.h"
-
-class TAliveTraverser : public TIntermTraverser {
-public:
- TAliveTraverser(TQualifier q) : TIntermTraverser(), found(false), qualifier(q)
- {
- visitSymbol = AliveSymbol;
- visitSelection = AliveSelection;
- rightToLeft = true;
- }
- bool wasFound() { return found; }
-protected:
- bool found;
- TQualifier qualifier;
-
- friend void AliveSymbol(TIntermSymbol*, TIntermTraverser*);
- friend bool AliveSelection(bool, TIntermSelection*, TIntermTraverser*);
-};
-
-//
-// Report whether or not a variable of the given qualifier type
-// is guaranteed written. Not always possible to determine if
-// it is written conditionally.
-//
-// ?? It does not do this well yet, this is just a place holder
-// that simply determines if it was reference at all, anywhere.
-//
-bool QualifierWritten(TIntermNode* node, TQualifier qualifier)
-{
- TAliveTraverser it(qualifier);
-
- if (node)
- node->traverse(&it);
-
- return it.wasFound();
-}
-
-void AliveSymbol(TIntermSymbol* node, TIntermTraverser* it)
-{
- TAliveTraverser* lit = static_cast<TAliveTraverser*>(it);
-
- //
- // If it's what we're looking for, record it.
- //
- if (node->getQualifier() == lit->qualifier)
- lit->found = true;
-}
-
-bool AliveSelection(bool preVisit, TIntermSelection* node, TIntermTraverser* it)
-{
- TAliveTraverser* lit = static_cast<TAliveTraverser*>(it);
-
- if (lit->wasFound())
- return false;
-
- return true;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.h
deleted file mode 100755
index 73e902cd0..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/QualifierAlive.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-bool QualifierWritten(TIntermNode* root, TQualifier);
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.cpp
deleted file mode 100755
index 2435a485b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "../Include/intermediate.h"
-#include "RemoveTree.h"
-//
-// Code to recursively delete the intermediate tree.
-//
-
-void RemoveSymbol(TIntermSymbol* node, TIntermTraverser* it)
-{
- delete node;
-}
-
-bool RemoveBinary(bool /*preVisit*/ , TIntermBinary* node, TIntermTraverser*)
-{
- delete node;
-
- return true;
-}
-
-bool RemoveUnary(bool /*preVisit */, TIntermUnary* node, TIntermTraverser*)
-{
- delete node;
-
- return true;
-}
-
-bool RemoveAggregate(bool /*preVisit*/ , TIntermAggregate* node, TIntermTraverser*)
-{
- delete node;
-
- return true;
-}
-
-bool RemoveSelection(bool /*preVisit*/ , TIntermSelection* node, TIntermTraverser*)
-{
- delete node;
-
- return true;
-}
-
-void RemoveConstantUnion(TIntermConstantUnion* node, TIntermTraverser*)
-{
- delete node;
-}
-
-//
-// Entry point.
-//
-void RemoveAllTreeNodes(TIntermNode* root)
-{
- TIntermTraverser it;
-
- it.visitAggregate = RemoveAggregate;
- it.visitBinary = RemoveBinary;
- it.visitConstantUnion = RemoveConstantUnion;
- it.visitSelection = RemoveSelection;
- it.visitSymbol = RemoveSymbol;
- it.visitUnary = RemoveUnary;
-
- it.preVisit = false;
- it.postVisit = true;
-
- root->traverse(&it);
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.h
deleted file mode 100755
index 171092f1a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/RemoveTree.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-void RemoveAllTreeNodes(TIntermNode*);
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ShaderLang.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ShaderLang.cpp
deleted file mode 100755
index 3f37e15f3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/ShaderLang.cpp
+++ /dev/null
@@ -1,607 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Implement the top-level of interface to the compiler/linker,
-// as defined in ShaderLang.h
-//
-#include "SymbolTable.h"
-#include "ParseHelper.h"
-#include "../Include/ShHandle.h"
-#include "Initialisation.h"
-
-#define SH_EXPORTING
-#include "../Public/ShaderLangExt.h"
-
-#include "Include/ResourceLimits.h"
-#include "Initialize.h"
-
-extern "C" int InitPreprocessor(void);
-extern "C" int FinalizePreprocessor(void);
-extern void SetGlobalPoolAllocatorPtr(TPoolAllocator* poolAllocator);
-
-bool generateBuiltInSymbolTable(const TBuiltInResource* resources, TInfoSink&, TSymbolTable*, EShLanguage language = EShLangCount);
-bool initializeSymbolTable(TBuiltInStrings* BuiltInStrings, EShLanguage language, TInfoSink& infoSink, const TBuiltInResource *resources, TSymbolTable*);
-
-//
-// A symbol table for each language. Each has a different
-// set of built-ins, and we want to preserve that from
-// compile to compile.
-//
-TSymbolTable SymbolTables[EShLangCount];
-
-TPoolAllocator* PerProcessGPA = 0;
-//
-// This is the platform independent interface between an OGL driver
-// and the shading language compiler/linker.
-//
-
-//
-// Driver must call this first, once, before doing any other
-// compiler/linker operations.
-//
-int ShInitialize()
-{
- TInfoSink infoSink;
- bool ret = true;
-
- if (!InitProcess())
- return 0;
-
- // This method should be called once per process. If its called by multiple threads, then
- // we need to have thread synchronization code around the initialization of per process
- // global pool allocator
- if (!PerProcessGPA) {
- TPoolAllocator *builtInPoolAllocator = new TPoolAllocator(true);
- builtInPoolAllocator->push();
- TPoolAllocator* gPoolAllocator = &GlobalPoolAllocator;
- SetGlobalPoolAllocatorPtr(builtInPoolAllocator);
-
- TSymbolTable symTables[EShLangCount];
- generateBuiltInSymbolTable(0, infoSink, symTables);
-
- PerProcessGPA = new TPoolAllocator(true);
- PerProcessGPA->push();
- SetGlobalPoolAllocatorPtr(PerProcessGPA);
-
- SymbolTables[EShLangVertex].copyTable(symTables[EShLangVertex]);
- SymbolTables[EShLangFragment].copyTable(symTables[EShLangFragment]);
-
- SetGlobalPoolAllocatorPtr(gPoolAllocator);
-
- symTables[EShLangVertex].pop();
- symTables[EShLangFragment].pop();
-
- builtInPoolAllocator->popAll();
- delete builtInPoolAllocator;
-
- }
-
- return ret ? 1 : 0;
-}
-
-//
-// Driver calls these to create and destroy compiler/linker
-// objects.
-//
-
-ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
-{
- if (!InitThread())
- return 0;
-
- TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(language, debugOptions));
-
- return reinterpret_cast<void*>(base);
-}
-
-ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions)
-{
- if (!InitThread())
- return 0;
-
- TShHandleBase* base = static_cast<TShHandleBase*>(ConstructLinker(executable, debugOptions));
-
- return reinterpret_cast<void*>(base);
-}
-
-ShHandle ShConstructUniformMap()
-{
- if (!InitThread())
- return 0;
-
- TShHandleBase* base = static_cast<TShHandleBase*>(ConstructUniformMap());
-
- return reinterpret_cast<void*>(base);
-}
-
-void ShDestruct(ShHandle handle)
-{
- if (handle == 0)
- return;
-
- TShHandleBase* base = static_cast<TShHandleBase*>(handle);
-
- if (base->getAsCompiler())
- DeleteCompiler(base->getAsCompiler());
- else if (base->getAsLinker())
- DeleteLinker(base->getAsLinker());
- else if (base->getAsUniformMap())
- DeleteUniformMap(base->getAsUniformMap());
-}
-
-//
-// Cleanup symbol tables
-//
-int __fastcall ShFinalize()
-{
- if (PerProcessGPA) {
- PerProcessGPA->popAll();
- delete PerProcessGPA;
- }
- return 1;
-}
-
-//
-// This function should be called only once by the Master Dll. Currently, this is being called for each thread
-// which is incorrect. This is required to keep the Sh interface working for now and will eventually be called
-// from master dll once.
-//
-bool generateBuiltInSymbolTable(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable* symbolTables, EShLanguage language)
-{
- TBuiltIns builtIns;
-
- if (resources) {
- builtIns.initialize(*resources);
- initializeSymbolTable(builtIns.getBuiltInStrings(), language, infoSink, resources, symbolTables);
- } else {
- builtIns.initialize();
- initializeSymbolTable(builtIns.getBuiltInStrings(), EShLangVertex, infoSink, resources, symbolTables);
- initializeSymbolTable(builtIns.getBuiltInStrings(), EShLangFragment, infoSink, resources, symbolTables);
- }
-
- return true;
-}
-
-bool initializeSymbolTable(TBuiltInStrings* BuiltInStrings, EShLanguage language, TInfoSink& infoSink, const TBuiltInResource* resources, TSymbolTable* symbolTables)
-{
- TIntermediate intermediate(infoSink);
- TSymbolTable* symbolTable;
-
- if (resources)
- symbolTable = symbolTables;
- else
- symbolTable = &symbolTables[language];
-
- TParseContext parseContext(*symbolTable, intermediate, language, infoSink);
-
- GlobalParseContext = &parseContext;
-
- setInitialState();
-
- assert (symbolTable->isEmpty() || symbolTable->atSharedBuiltInLevel());
-
- //
- // Parse the built-ins. This should only happen once per
- // language symbol table.
- //
- // Push the symbol table to give it an initial scope. This
- // push should not have a corresponding pop, so that built-ins
- // are preserved, and the test for an empty table fails.
- //
-
- symbolTable->push();
-
- //Initialize the Preprocessor
- int ret = InitPreprocessor();
- if (ret) {
- infoSink.info.message(EPrefixInternalError, "Unable to intialize the Preprocessor");
- return false;
- }
-
- for (TBuiltInStrings::iterator i = BuiltInStrings[parseContext.language].begin();
- i != BuiltInStrings[parseContext.language].end();
- ++i) {
- const char* builtInShaders[1];
- int builtInLengths[1];
-
- builtInShaders[0] = (*i).c_str();
- builtInLengths[0] = (int) (*i).size();
-
- if (PaParseStrings(const_cast<char**>(builtInShaders), builtInLengths, 1, parseContext) != 0) {
- infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins");
- return false;
- }
- }
-
- if (resources) {
- IdentifyBuiltIns(parseContext.language, *symbolTable, *resources);
- } else {
- IdentifyBuiltIns(parseContext.language, *symbolTable);
- }
-
- FinalizePreprocessor();
-
- return true;
-}
-
-
-//
-// Do an actual compile on the given strings. The result is left
-// in the given compile object.
-//
-// Return: The return value of ShCompile is really boolean, indicating
-// success or failure.
-//
-int ShCompile(
- const ShHandle handle,
- const char* const shaderStrings[],
- const int numStrings,
- const EShOptimizationLevel optLevel,
- const TBuiltInResource* resources,
- int debugOptions
- )
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return 0;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
- TCompiler* compiler = base->getAsCompiler();
- if (compiler == 0)
- return 0;
-
- GlobalPoolAllocator.push();
- compiler->infoSink.info.erase();
- compiler->infoSink.debug.erase();
-
- if (numStrings == 0)
- return 1;
-
- TIntermediate intermediate(compiler->infoSink);
- TSymbolTable symbolTable(SymbolTables[compiler->getLanguage()]);
-
- generateBuiltInSymbolTable(resources, compiler->infoSink, &symbolTable, compiler->getLanguage());
-
- TParseContext parseContext(symbolTable, intermediate, compiler->getLanguage(), compiler->infoSink);
- parseContext.initializeExtensionBehavior();
-
- GlobalParseContext = &parseContext;
-
- setInitialState();
-
- InitPreprocessor();
- //
- // Parse the application's shaders. All the following symbol table
- // work will be throw-away, so push a new allocation scope that can
- // be thrown away, then push a scope for the current shader's globals.
- //
- bool success = true;
-
- symbolTable.push();
- if (!symbolTable.atGlobalLevel())
- parseContext.infoSink.info.message(EPrefixInternalError, "Wrong symbol table level");
-
- if (parseContext.insertBuiltInArrayAtGlobalLevel())
- success = false;
-
- int ret = PaParseStrings(const_cast<char**>(shaderStrings), 0, numStrings, parseContext);
- if (ret)
- success = false;
-
- if (success && parseContext.treeRoot) {
- if (optLevel == EShOptNoGeneration)
- parseContext.infoSink.info.message(EPrefixNone, "No errors. No code generation or linking was requested.");
- else {
- success = intermediate.postProcess(parseContext.treeRoot, parseContext.language);
-
- if (success) {
-
- if (debugOptions & EDebugOpIntermediate)
- intermediate.outputTree(parseContext.treeRoot);
-
- //
- // Call the machine dependent compiler
- //
- if (! compiler->compile(parseContext.treeRoot))
- success = false;
- }
- }
- } else if (!success) {
- parseContext.infoSink.info.prefix(EPrefixError);
- parseContext.infoSink.info << parseContext.numErrors << " compilation errors. No code generated.\n\n";
- success = false;
- if (debugOptions & EDebugOpIntermediate)
- intermediate.outputTree(parseContext.treeRoot);
- }
-
- intermediate.remove(parseContext.treeRoot);
-
- //
- // Ensure symbol table is returned to the built-in level,
- // throwing away all but the built-ins.
- //
- while (! symbolTable.atSharedBuiltInLevel())
- symbolTable.pop();
-
- FinalizePreprocessor();
- //
- // Throw away all the temporary memory used by the compilation process.
- //
- GlobalPoolAllocator.pop();
-
- return success ? 1 : 0;
-}
-
-//
-// Do an actual link on the given compile objects.
-//
-// Return: The return value of is really boolean, indicating
-// success or failure.
-//
-int ShLink(
- const ShHandle linkHandle,
- const ShHandle compHandles[],
- const int numHandles,
- ShHandle uniformMapHandle,
- short int** uniformsAccessed,
- int* numUniformsAccessed)
-
-{
- if (!InitThread())
- return 0;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(linkHandle);
- TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
- if (linker == 0)
- return 0;
-
- int returnValue;
- GlobalPoolAllocator.push();
- returnValue = ShLinkExt(linkHandle, compHandles, numHandles);
- GlobalPoolAllocator.pop();
-
- if (returnValue)
- return 1;
-
- return 0;
-}
-//
-// This link method will be eventually used once the ICD supports the new linker interface
-//
-int ShLinkExt(
- const ShHandle linkHandle,
- const ShHandle compHandles[],
- const int numHandles)
-{
- if (linkHandle == 0 || numHandles == 0)
- return 0;
-
- THandleList cObjects;
-
- {// support MSVC++6.0
- for (int i = 0; i < numHandles; ++i) {
- if (compHandles[i] == 0)
- return 0;
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(compHandles[i]);
- if (base->getAsLinker()) {
- cObjects.push_back(base->getAsLinker());
- }
- if (base->getAsCompiler())
- cObjects.push_back(base->getAsCompiler());
-
-
- if (cObjects[i] == 0)
- return 0;
- }
- }
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(linkHandle);
- TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
-
- if (linker == 0)
- return 0;
-
- linker->infoSink.info.erase();
-
- {// support MSVC++6.0
- for (int i = 0; i < numHandles; ++i) {
- if (cObjects[i]->getAsCompiler()) {
- if (! cObjects[i]->getAsCompiler()->linkable()) {
- linker->infoSink.info.message(EPrefixError, "Not all shaders have valid object code.");
- return 0;
- }
- }
- }
- }
-
- bool ret = linker->link(cObjects);
-
- return ret ? 1 : 0;
-}
-
-//
-// ShSetEncrpytionMethod is a place-holder for specifying
-// how source code is encrypted.
-//
-void ShSetEncryptionMethod(ShHandle handle)
-{
- if (handle == 0)
- return;
-}
-
-//
-// Return any compiler/linker/uniformmap log of messages for the application.
-//
-const char* ShGetInfoLog(const ShHandle handle)
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return 0;
-
- TShHandleBase* base = static_cast<TShHandleBase*>(handle);
- TInfoSink* infoSink;
-
- if (base->getAsCompiler())
- infoSink = &(base->getAsCompiler()->getInfoSink());
- else if (base->getAsLinker())
- infoSink = &(base->getAsLinker()->getInfoSink());
-
- infoSink->info << infoSink->debug.c_str();
- return infoSink->info.c_str();
-}
-
-//
-// Return the resulting binary code from the link process. Structure
-// is machine dependent.
-//
-const void* ShGetExecutable(const ShHandle handle)
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return 0;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
-
- TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
- if (linker == 0)
- return 0;
-
- return linker->getObjectCode();
-}
-
-//
-// Let the linker know where the application said it's attributes are bound.
-// The linker does not use these values, they are remapped by the ICD or
-// hardware. It just needs them to know what's aliased.
-//
-// Return: The return value of is really boolean, indicating
-// success or failure.
-//
-// This is to preserve the old linker API, P20 code can use the generic
-// ShConstructBinding() and ShAddBinding() APIs
-//
-int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table)
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return 0;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
- TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
-
- if (linker == 0)
- return 0;
-
- linker->setAppAttributeBindings(table);
-
- return 1;
-}
-
-//
-// Let the linker know where the predefined attributes have to live.
-// This is to preserve the old linker API, P20 code can use the generic
-// ShConstructBinding() and ShAddBinding() APIs
-//
-int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table)
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return 0;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
- TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
-
- if (linker == 0)
- return 0;
-
- linker->setFixedAttributeBindings(table);
- return 1;
-}
-
-//
-// Some attribute locations are off-limits to the linker...
-//
-int ShExcludeAttributes(const ShHandle handle, int *attributes, int count)
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return 0;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
- TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
- if (linker == 0)
- return 0;
-
- linker->setExcludedAttributes(attributes, count);
-
- return 1;
-}
-
-//
-// Return the index for OpenGL to use for knowing where a uniform lives.
-//
-// Return: The return value of is really boolean, indicating
-// success or failure.
-//
-// We dont have to change this code for now since the TUniformMap being
-// passed back to ICD by the linker is the same as being used for the old P10 linker
-//
-int ShGetUniformLocation(const ShHandle handle, const char* name)
-{
- if (!InitThread())
- return 0;
-
- if (handle == 0)
- return -1;
-
- TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
- TUniformMap* uniformMap= base->getAsUniformMap();
- if (uniformMap == 0)
- return -1;
-
- return uniformMap->getLocation(name);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.cpp
deleted file mode 100755
index 0e052c2ea..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Symbol table for parsing. Most functionaliy and main ideas
-// are documented in the header file.
-//
-
-#include "SymbolTable.h"
-
-//
-// TType helper function needs a place to live.
-//
-
-//
-// Recursively generate mangled names.
-//
-void TType::buildMangledName(TString& mangledName)
-{
- if (isMatrix())
- mangledName += 'm';
- else if (isVector())
- mangledName += 'v';
-
- switch (type) {
- case EbtFloat: mangledName += 'f'; break;
- case EbtInt: mangledName += 'i'; break;
- case EbtBool: mangledName += 'b'; break;
- case EbtSampler1D: mangledName += "s1"; break;
- case EbtSampler2D: mangledName += "s2"; break;
- case EbtSampler3D: mangledName += "s3"; break;
- case EbtSamplerCube: mangledName += "sC"; break;
- case EbtSampler1DShadow: mangledName += "sS1"; break;
- case EbtSampler2DShadow: mangledName += "sS2"; break;
- case EbtStruct:
- mangledName += "struct-";
- if (typeName)
- mangledName += *typeName;
- {// support MSVC++6.0
- for (unsigned int i = 0; i < structure->size(); ++i) {
- mangledName += '-';
- (*structure)[i].type->buildMangledName(mangledName);
- }
- }
- default:
- break;
- }
-
- mangledName += static_cast<char>('0' + getNominalSize());
- if (isArray()) {
- char buf[10];
- sprintf(buf, "%d", arraySize);
- mangledName += '[';
- mangledName += buf;
- mangledName += ']';
- }
-}
-
-//
-// Dump functions.
-//
-
-void TVariable::dump(TInfoSink& infoSink) const
-{
- infoSink.debug << getName().c_str() << ": " << type.getQualifierString() << " " << type.getBasicString();
- if (type.isArray()) {
- infoSink.debug << "[0]";
- }
- infoSink.debug << "\n";
-}
-
-void TFunction::dump(TInfoSink &infoSink) const
-{
- infoSink.debug << getName().c_str() << ": " << returnType.getBasicString() << " " << getMangledName().c_str() << "\n";
-}
-
-void TSymbolTableLevel::dump(TInfoSink &infoSink) const
-{
- tLevel::const_iterator it;
- for (it = level.begin(); it != level.end(); ++it)
- (*it).second->dump(infoSink);
-}
-
-void TSymbolTable::dump(TInfoSink &infoSink) const
-{
- for (int level = currentLevel(); level >= 0; --level) {
- infoSink.debug << "LEVEL " << level << "\n";
- table[level]->dump(infoSink);
- }
-}
-
-//
-// Functions have buried pointers to delete.
-//
-TFunction::~TFunction()
-{
- for (TParamList::iterator i = parameters.begin(); i != parameters.end(); ++i)
- delete (*i).type;
-}
-
-//
-// Symbol table levels are a map of pointers to symbols that have to be deleted.
-//
-TSymbolTableLevel::~TSymbolTableLevel()
-{
- for (tLevel::iterator it = level.begin(); it != level.end(); ++it)
- delete (*it).second;
-}
-
-//
-// Change all function entries in the table with the non-mangled name
-// to be related to the provided built-in operation. This is a low
-// performance operation, and only intended for symbol tables that
-// live across a large number of compiles.
-//
-void TSymbolTableLevel::relateToOperator(const char* name, TOperator op)
-{
- tLevel::iterator it;
- for (it = level.begin(); it != level.end(); ++it) {
- if ((*it).second->isFunction()) {
- TFunction* function = static_cast<TFunction*>((*it).second);
- if (function->getName() == name)
- function->relateToOperator(op);
- }
- }
-}
-
-
-TSymbol::TSymbol(const TSymbol& copyOf)
-{
- name = NewPoolTString(copyOf.name->c_str());
- uniqueId = copyOf.uniqueId;
-}
-
-TVariable::TVariable(const TVariable& copyOf, TStructureMap& remapper) : TSymbol(copyOf)
-{
- type.copyType(copyOf.type, remapper);
- userType = copyOf.userType;
- // for builtIn symbol table level, unionArray and arrayInformation pointers should be NULL
- assert(copyOf.arrayInformationType == 0);
- arrayInformationType = 0;
-
- if (copyOf.unionArray) {
- assert(!copyOf.type.getStruct());
- assert(copyOf.type.getInstanceSize() == 1);
- unionArray = new constUnion[1];
- switch (type.getBasicType()) {
- case EbtFloat: unionArray[0].fConst = copyOf.unionArray[0].fConst; break;
- case EbtInt: unionArray[0].iConst = copyOf.unionArray[0].iConst; break;
- case EbtBool: unionArray[0].bConst = copyOf.unionArray[0].bConst; break;
- default:
- assert (false && "Unknown type");
- }
- } else
- unionArray = 0;
-}
-
-TVariable* TVariable::clone(TStructureMap& remapper)
-{
- TVariable *variable = new TVariable(*this, remapper);
-
- return variable;
-}
-
-TFunction::TFunction(const TFunction& copyOf, TStructureMap& remapper) : TSymbol(copyOf)
-{
- for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
- TParameter param;
- parameters.push_back(param);
- parameters.back().copyParam(copyOf.parameters[i], remapper);
- }
-
- returnType.copyType(copyOf.returnType, remapper);
- mangledName = copyOf.mangledName;
- op = copyOf.op;
- defined = copyOf.defined;
-}
-
-TFunction* TFunction::clone(TStructureMap& remapper)
-{
- TFunction *function = new TFunction(*this, remapper);
-
- return function;
-}
-
-TSymbolTableLevel* TSymbolTableLevel::clone(TStructureMap& remapper)
-{
- TSymbolTableLevel *symTableLevel = new TSymbolTableLevel();
- tLevel::iterator iter;
- for (iter = level.begin(); iter != level.end(); ++iter) {
- symTableLevel->insert(*iter->second->clone(remapper));
- }
-
- return symTableLevel;
-}
-
-void TSymbolTable::copyTable(const TSymbolTable& copyOf)
-{
- TStructureMap remapper;
- uniqueId = copyOf.uniqueId;
- for (unsigned int i = 0; i < copyOf.table.size(); ++i) {
- table.push_back(copyOf.table[i]->clone(remapper));
- }
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.h
deleted file mode 100755
index 7e4ff6824..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/SymbolTable.h
+++ /dev/null
@@ -1,320 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _SYMBOL_TABLE_INCLUDED_
-#define _SYMBOL_TABLE_INCLUDED_
-
-//
-// Symbol table for parsing. Has these design characteristics:
-//
-// * Same symbol table can be used to compile many shaders, to preserve
-// effort of creating and loading with the large numbers of built-in
-// symbols.
-//
-// * Name mangling will be used to give each function a unique name
-// so that symbol table lookups are never ambiguous. This allows
-// a simpler symbol table structure.
-//
-// * Pushing and popping of scope, so symbol table will really be a stack
-// of symbol tables. Searched from the top, with new inserts going into
-// the top.
-//
-// * Constants: Compile time constant symbols will keep their values
-// in the symbol table. The parser can substitute constants at parse
-// time, including doing constant folding and constant propagation.
-//
-// * No temporaries: Temporaries made from operations (+, --, .xy, etc.)
-// are tracked in the intermediate representation, not the symbol table.
-//
-
-#include "Include/Common.h"
-#include "Include/intermediate.h"
-#include "Include/InfoSink.h"
-
-//
-// Symbol base class. (Can build functions or variables out of these...)
-//
-class TSymbol {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
- TSymbol(const TString *n) : name(n) { }
- virtual ~TSymbol() { /* don't delete name, it's from the pool */ }
- const TString& getName() const { return *name; }
- virtual const TString& getMangledName() const { return getName(); }
- virtual bool isFunction() const { return false; }
- virtual bool isVariable() const { return false; }
- void setUniqueId(int id) { uniqueId = id; }
- int getUniqueId() const { return uniqueId; }
- virtual void dump(TInfoSink &infoSink) const = 0;
- TSymbol(const TSymbol&);
- virtual TSymbol* clone(TStructureMap& remapper) = 0;
-
-protected:
- const TString *name;
- unsigned int uniqueId; // For real comparing during code generation
-};
-
-//
-// Variable class, meaning a symbol that's not a function.
-//
-// There could be a separate class heirarchy for Constant variables;
-// Only one of int, bool, or float, (or none) is correct for
-// any particular use, but it's easy to do this way, and doesn't
-// seem worth having separate classes, and "getConst" can't simply return
-// different values for different types polymorphically, so this is
-// just simple and pragmatic.
-//
-class TVariable : public TSymbol {
-public:
- TVariable(const TString *name, const TType& t, bool uT = false ) : TSymbol(name), type(t), userType(uT), unionArray(0), arrayInformationType(0) { }
- virtual ~TVariable() { }
- virtual bool isVariable() const { return true; }
- TType& getType() { return type; }
- const TType& getType() const { return type; }
- bool isUserType() const { return userType; }
- void changeQualifier(TQualifier qualifier) { type.changeQualifier(qualifier); }
- void updateArrayInformationType(TType *t) { arrayInformationType = t; }
- TType* getArrayInformationType() { return arrayInformationType; }
-
- virtual void dump(TInfoSink &infoSink) const;
-
- constUnion* getConstPointer() {
- if (!unionArray) {
- if (!type.getStruct())
- unionArray = new constUnion[type.getInstanceSize()];
- else
- unionArray = new constUnion[type.getStructSize()];
- }
- return unionArray;
- }
-
- constUnion* getConstPointer() const { return unionArray; }
-
- void shareConstPointer( constUnion *constArray)
- {
- delete unionArray;
- unionArray = constArray;
- }
- TVariable(const TVariable&, TStructureMap& remapper); // copy constructor
- virtual TVariable* clone(TStructureMap& remapper);
-
-protected:
- TType type;
- bool userType;
- // we are assuming that Pool Allocator will free the memory allocated to unionArray
- // when this object is destroyed
- constUnion *unionArray;
- TType *arrayInformationType; // this is used for updating maxArraySize in all the references to a given symbol
-};
-
-//
-// The function sub-class of symbols and the parser will need to
-// share this definition of a function parameter.
-//
-struct TParameter {
- TString *name;
- TType* type;
- void copyParam(const TParameter& param, TStructureMap& remapper) {
- name = NewPoolTString(param.name->c_str());
- type = param.type->clone(remapper);
- }
-};
-
-//
-// The function sub-class of a symbol.
-//
-class TFunction : public TSymbol {
-public:
- TFunction(TOperator o) :
- TSymbol(0),
- returnType(TType(EbtVoid)),
- op(o),
- defined(false) { }
- TFunction(const TString *name, TType& retType, TOperator tOp = EOpNull) :
- TSymbol(name),
- returnType(retType),
- mangledName(*name + '('),
- op(tOp),
- defined(false) { }
- virtual ~TFunction();
- virtual bool isFunction() const { return true; }
-
- void addParameter(TParameter& p)
- {
- parameters.push_back(p);
- mangledName = mangledName + p.type->getMangledName();
- }
-
- const TString& getMangledName() const { return mangledName; }
- const TType& getReturnType() const { return returnType; }
- void relateToOperator(TOperator o) { op = o; }
- TOperator getBuiltInOp() const { return op; }
- void setDefined() { defined = true; }
- bool isDefined() { return defined; }
-
- int getParamCount() const { return static_cast<int>(parameters.size()); }
- TParameter& operator [](int i) { return parameters[i]; }
- const TParameter& operator [](int i) const { return parameters[i]; }
-
- virtual void dump(TInfoSink &infoSink) const;
- TFunction(const TFunction&, TStructureMap& remapper);
- virtual TFunction* clone(TStructureMap& remapper);
-
-protected:
- typedef TVector<TParameter> TParamList;
- TParamList parameters;
- TType returnType;
- TString mangledName;
- TOperator op;
- bool defined;
-};
-
-
-class TSymbolTableLevel {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
- TSymbolTableLevel() { }
- ~TSymbolTableLevel();
-
- bool insert(TSymbol& symbol)
- {
- //
- // returning true means symbol was added to the table
- //
- tInsertResult result;
- result = level.insert(tLevelPair(symbol.getMangledName(), &symbol));
-
- return result.second;
- }
-
- TSymbol* find(const TString& name) const
- {
- tLevel::const_iterator it = level.find(name);
- if (it == level.end())
- return 0;
- else
- return (*it).second;
- }
-
- void relateToOperator(const char* name, TOperator op);
- void dump(TInfoSink &infoSink) const;
- TSymbolTableLevel* clone(TStructureMap& remapper);
-
-protected:
- typedef std::map<TString, TSymbol*, std::less<TString>, pool_allocator<std::pair<const TString, TSymbol*> > > tLevel;
- typedef const tLevel::value_type tLevelPair;
- typedef std::pair<tLevel::iterator, bool> tInsertResult;
-
- tLevel level;
-};
-
-class TSymbolTable {
-public:
- TSymbolTable() : uniqueId(0)
- {
- //
- // The symbol table cannot be used until push() is called, but
- // the lack of an initial call to push() can be used to detect
- // that the symbol table has not been preloaded with built-ins.
- //
- }
-
- TSymbolTable(TSymbolTable& symTable)
- {
- table.push_back(symTable.table[0]);
- uniqueId = symTable.uniqueId;
- }
-
- ~TSymbolTable()
- {
- // level 0 is always built In symbols, so we never pop that out
- while (table.size() > 1)
- pop();
- }
-
- //
- // When the symbol table is initialized with the built-ins, there should
- // 'push' calls, so that built-ins are at level 0 and the shader
- // globals are at level 1.
- //
- bool isEmpty() { return table.size() == 0; }
- bool atBuiltInLevel() { return atSharedBuiltInLevel() || atDynamicBuiltInLevel(); }
- bool atSharedBuiltInLevel() { return table.size() == 1; }
- bool atGlobalLevel() { return table.size() <= 3; }
- void push() {
- table.push_back(new TSymbolTableLevel);
- }
-
- void pop() {
- delete table[currentLevel()];
- table.pop_back();
- }
-
- bool insert(TSymbol& symbol)
- {
- symbol.setUniqueId(++uniqueId);
- return table[currentLevel()]->insert(symbol);
- }
-
- TSymbol* find(const TString& name, bool* builtIn = 0, bool *sameScope = 0)
- {
- int level = currentLevel();
- TSymbol* symbol;
- do {
- symbol = table[level]->find(name);
- --level;
- } while (symbol == 0 && level >= 0);
- level++;
- if (builtIn)
- *builtIn = level == 0;
- if (sameScope)
- *sameScope = level == currentLevel();
- return symbol;
- }
-
- TSymbolTableLevel* getGlobalLevel() { assert (table.size() >= 3); return table[2]; }
- void relateToOperator(const char* name, TOperator op) { table[0]->relateToOperator(name, op); }
- int getMaxSymbolId() { return uniqueId; }
- void dump(TInfoSink &infoSink) const;
- void copyTable(const TSymbolTable& copyOf);
-
-protected:
- int currentLevel() const { return static_cast<int>(table.size()) - 1; }
- bool atDynamicBuiltInLevel() { return table.size() == 2; }
-
- std::vector<TSymbolTableLevel*> table;
- int uniqueId; // for unique identification in code generation
-};
-
-#endif // _SYMBOL_TABLE_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.l b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.l
deleted file mode 100644
index f6cd3ca66..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.l
+++ /dev/null
@@ -1,614 +0,0 @@
-/*
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-*/
-/* Based on
-ANSI C grammar, Lex specification
-
-In 1985, Jeff Lee published this Lex specification together with a Yacc
-grammar for the April 30, 1985 ANSI C draft. Tom Stockfisch reposted
-both to net.sources in 1987; that original, as mentioned in the answer
-to question 17.25 of the comp.lang.c FAQ, can be ftp'ed from ftp.uu.net,
-file usenet/net.sources/ansi.c.grammar.Z.
-
-I intend to keep this version as close to the current C Standard grammar
-as possible; please let me know if you discover discrepancies.
-
-Jutta Degener, 1995
-*/
-
-D [0-9]
-L [a-zA-Z_]
-H [a-fA-F0-9]
-E [Ee][+-]?{D}+
-O [0-7]
-
-%option nounput
-%{
-#include <stdio.h>
-#include <stdlib.h>
-#include "ParseHelper.h"
-#include "glslang_tab.h"
-
-/* windows only pragma */
-#ifdef _MSC_VER
-#pragma warning(disable : 4102)
-#endif
-
-int yy_input(char* buf, int max_size);
-TSourceLoc yylineno;
-
-#ifdef _WIN32
- extern int yyparse(TParseContext&);
- #define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
-#else
- extern int yyparse(void*);
- #define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
- #define parseContext (*((TParseContext*)(parseContextLocal)))
-#endif
-
-#define YY_INPUT(buf,result,max_size) (result = yy_input(buf, max_size))
-
-%}
-
-%option noyywrap
-%option never-interactive
-%option outfile="Gen_glslang.cpp"
-%x FIELDS
-
-
-%%
-<*>"//"[^\n]*"\n" { /* ?? carriage and/or line-feed? */ };
-
-"attribute" { pyylval->lex.line = yylineno; return(ATTRIBUTE); }
-"const" { pyylval->lex.line = yylineno; return(CONST_QUAL); }
-"uniform" { pyylval->lex.line = yylineno; return(UNIFORM); }
-"varying" { pyylval->lex.line = yylineno; return(VARYING); }
-
-"break" { pyylval->lex.line = yylineno; return(BREAK); }
-"continue" { pyylval->lex.line = yylineno; return(CONTINUE); }
-"do" { pyylval->lex.line = yylineno; return(DO); }
-"for" { pyylval->lex.line = yylineno; return(FOR); }
-"while" { pyylval->lex.line = yylineno; return(WHILE); }
-
-"if" { pyylval->lex.line = yylineno; return(IF); }
-"else" { pyylval->lex.line = yylineno; return(ELSE); }
-
-"in" { pyylval->lex.line = yylineno; return(IN_QUAL); }
-"out" { pyylval->lex.line = yylineno; return(OUT_QUAL); }
-"inout" { pyylval->lex.line = yylineno; return(INOUT_QUAL); }
-
-"float" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(FLOAT_TYPE); }
-"int" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(INT_TYPE); }
-"void" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(VOID_TYPE); }
-"bool" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(BOOL_TYPE); }
-"true" { pyylval->lex.line = yylineno; pyylval->lex.b = true; return(BOOLCONSTANT); }
-"false" { pyylval->lex.line = yylineno; pyylval->lex.b = false; return(BOOLCONSTANT); }
-
-"discard" { pyylval->lex.line = yylineno; return(DISCARD); }
-"return" { pyylval->lex.line = yylineno; return(RETURN); }
-
-"mat2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX2); }
-"mat3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX3); }
-"mat4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX4); }
-
-"vec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC2); }
-"vec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC3); }
-"vec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC4); }
-"ivec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC2); }
-"ivec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC3); }
-"ivec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC4); }
-"bvec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC2); }
-"bvec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC3); }
-"bvec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC4); }
-
-"sampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1D; }
-"sampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; }
-"sampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER3D; }
-"samplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; }
-"sampler1DShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1DSHADOW; }
-"sampler2DShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DSHADOW; }
-
-"struct" { pyylval->lex.line = yylineno; return(STRUCT); }
-
-"asm" { PaReservedWord(); return 0; }
-
-"class" { PaReservedWord(); return 0; }
-"union" { PaReservedWord(); return 0; }
-"enum" { PaReservedWord(); return 0; }
-"typedef" { PaReservedWord(); return 0; }
-"template" { PaReservedWord(); return 0; }
-"this" { PaReservedWord(); return 0; }
-"packed" { PaReservedWord(); return 0; }
-
-"goto" { PaReservedWord(); return 0; }
-"switch" { PaReservedWord(); return 0; }
-"default" { PaReservedWord(); return 0; }
-
-"inline" { PaReservedWord(); return 0; }
-"noinline" { PaReservedWord(); return 0; }
-"volatile" { PaReservedWord(); return 0; }
-"public" { PaReservedWord(); return 0; }
-"static" { PaReservedWord(); return 0; }
-"extern" { PaReservedWord(); return 0; }
-"external" { PaReservedWord(); return 0; }
-"interface" { PaReservedWord(); return 0; }
-
-"long" { PaReservedWord(); return 0; }
-"short" { PaReservedWord(); return 0; }
-"double" { PaReservedWord(); return 0; }
-"half" { PaReservedWord(); return 0; }
-"fixed" { PaReservedWord(); return 0; }
-"unsigned" { PaReservedWord(); return 0; }
-
-"input" { PaReservedWord(); return 0; }
-"output" { PaReservedWord(); return 0; }
-
-"hvec2" { PaReservedWord(); return 0; }
-"hvec3" { PaReservedWord(); return 0; }
-"hvec4" { PaReservedWord(); return 0; }
-"fvec2" { PaReservedWord(); return 0; }
-"fvec3" { PaReservedWord(); return 0; }
-"fvec4" { PaReservedWord(); return 0; }
-"dvec2" { PaReservedWord(); return 0; }
-"dvec3" { PaReservedWord(); return 0; }
-"dvec4" { PaReservedWord(); return 0; }
-
-"sampler2DRect" { PaReservedWord(); return 0; }
-"sampler3DRect" { PaReservedWord(); return 0; }
-"sampler2DRectShadow" { PaReservedWord(); return 0; }
-
-"sizeof" { PaReservedWord(); return 0; }
-"cast" { PaReservedWord(); return 0; }
-
-"namespace" { PaReservedWord(); return 0; }
-"using" { PaReservedWord(); return 0; }
-
-{L}({L}|{D})* {
- pyylval->lex.line = yylineno;
- pyylval->lex.string = NewPoolTString(yytext);
- return PaIdentOrType(*pyylval->lex.string, parseContext, pyylval->lex.symbol);
-}
-
-0[xX]{H}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
-0{O}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
-0{D}+ { pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;}
-{D}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
-
-{D}+{E} { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
-{D}+"."{D}*({E})? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
-"."{D}+({E})? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); }
-
-"/*" { int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; }
-
-"+=" { pyylval->lex.line = yylineno; return(ADD_ASSIGN); }
-"-=" { pyylval->lex.line = yylineno; return(SUB_ASSIGN); }
-"*=" { pyylval->lex.line = yylineno; return(MUL_ASSIGN); }
-"/=" { pyylval->lex.line = yylineno; return(DIV_ASSIGN); }
-"%=" { pyylval->lex.line = yylineno; return(MOD_ASSIGN); }
-"<<=" { pyylval->lex.line = yylineno; return(LEFT_ASSIGN); }
-">>=" { pyylval->lex.line = yylineno; return(RIGHT_ASSIGN); }
-"&=" { pyylval->lex.line = yylineno; return(AND_ASSIGN); }
-"^=" { pyylval->lex.line = yylineno; return(XOR_ASSIGN); }
-"|=" { pyylval->lex.line = yylineno; return(OR_ASSIGN); }
-
-"++" { pyylval->lex.line = yylineno; return(INC_OP); }
-"--" { pyylval->lex.line = yylineno; return(DEC_OP); }
-"&&" { pyylval->lex.line = yylineno; return(AND_OP); }
-"||" { pyylval->lex.line = yylineno; return(OR_OP); }
-"^^" { pyylval->lex.line = yylineno; return(XOR_OP); }
-"<=" { pyylval->lex.line = yylineno; return(LE_OP); }
-">=" { pyylval->lex.line = yylineno; return(GE_OP); }
-"==" { pyylval->lex.line = yylineno; return(EQ_OP); }
-"!=" { pyylval->lex.line = yylineno; return(NE_OP); }
-"<<" { pyylval->lex.line = yylineno; return(LEFT_OP); }
-">>" { pyylval->lex.line = yylineno; return(RIGHT_OP); }
-";" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(SEMICOLON); }
-("{"|"<%") { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(LEFT_BRACE); }
-("}"|"%>") { pyylval->lex.line = yylineno; return(RIGHT_BRACE); }
-"," { pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return(COMMA); }
-":" { pyylval->lex.line = yylineno; return(COLON); }
-"=" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(EQUAL); }
-"(" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return(LEFT_PAREN); }
-")" { pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return(RIGHT_PAREN); }
-("["|"<:") { pyylval->lex.line = yylineno; return(LEFT_BRACKET); }
-("]"|":>") { pyylval->lex.line = yylineno; return(RIGHT_BRACKET); }
-"." { BEGIN(FIELDS); return(DOT); }
-"!" { pyylval->lex.line = yylineno; return(BANG); }
-"-" { pyylval->lex.line = yylineno; return(DASH); }
-"~" { pyylval->lex.line = yylineno; return(TILDE); }
-"+" { pyylval->lex.line = yylineno; return(PLUS); }
-"*" { pyylval->lex.line = yylineno; return(STAR); }
-"/" { pyylval->lex.line = yylineno; return(SLASH); }
-"%" { pyylval->lex.line = yylineno; return(PERCENT); }
-"<" { pyylval->lex.line = yylineno; return(LEFT_ANGLE); }
-">" { pyylval->lex.line = yylineno; return(RIGHT_ANGLE); }
-"|" { pyylval->lex.line = yylineno; return(VERTICAL_BAR); }
-"^" { pyylval->lex.line = yylineno; return(CARET); }
-"&" { pyylval->lex.line = yylineno; return(AMPERSAND); }
-"?" { pyylval->lex.line = yylineno; return(QUESTION); }
-
-<FIELDS>{L}({L}|{D})* {
-BEGIN(INITIAL);
- pyylval->lex.line = yylineno;
- pyylval->lex.string = NewPoolTString(yytext);
- return FIELD_SELECTION; }
-<FIELDS>[ \t\v\f\r] {}
-
-[ \t\v\n\f\r] { }
-<*><<EOF>> { (&parseContext)->AfterEOF = true; yy_delete_buffer(YY_CURRENT_BUFFER); yyterminate();}
-<*>. { parseContext.infoSink.info << "FLEX: Unknown char " << yytext << "\n";
- return 0; }
-
-%%
-
-
-//Including Pre-processor.
-extern "C" {
- #include "./preprocessor/preprocess.h"
-}
-
-//
-// The YY_INPUT macro just calls this. Maybe this could be just put into
-// the macro directly.
-//
-
-int yy_input(char* buf, int max_size)
-{
- char *char_token =NULL;
- int len;
-
- if ((len = yylex_CPP(buf, max_size)) == 0)
- return 0;
- if (len >= max_size)
- YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-
- buf[len] = ' ';
- return len+1;
-}
-
-
-//
-// Parse an array of strings using yyparse. We set up globals used by
-// yywrap.
-//
-// Returns 0 for success, as per yyparse().
-//
-int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseContextLocal)
-{
- int argv0len;
- ScanFromString(argv[0]);
-
- //Storing the Current Compiler Parse context into the cpp structure.
- cpp->pC = (void*)&parseContextLocal;
-
- if (!argv || argc == 0 || !argv[0])
- return 1;
-
- if (!strLen) {
- argv0len = (int) strlen(argv[0]);
- strLen = &argv0len;
- }
- yyrestart(0);
- (&parseContextLocal)->AfterEOF = false;
- cpp->PaWhichStr = 0;
- cpp->PaArgv = argv;
- cpp->PaArgc = argc;
- cpp->PaStrLen = strLen;
- yylineno = 1;
-
- if (*cpp->PaStrLen >= 0) {
- int ret;
- #ifdef _WIN32
- ret = yyparse(parseContextLocal);
- #else
- ret = yyparse((void*)(&parseContextLocal));
- #endif
- if (cpp->CompileError == 1 || parseContextLocal.recoveredFromError || parseContextLocal.numErrors > 0)
- return 1;
- else
- return 0;
- }
- else
- return 0;
-}
-
-void yyerror(char *s)
-{
- if (((TParseContext *)cpp->pC)->AfterEOF) {
- if (cpp->tokensBeforeEOF == 1) {
- GlobalParseContext->error(yylineno, "syntax error", "pre-mature EOF", s, "");
- GlobalParseContext->recover();
- }
- } else {
- GlobalParseContext->error(yylineno, "syntax error", yytext, s, "");
- GlobalParseContext->recover();
- }
-}
-
-void PaReservedWord()
-{
- GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", "");
- GlobalParseContext->recover();
-}
-
-int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbol)
-{
- symbol = parseContextLocal.symbolTable.find(id);
- if (parseContextLocal.lexAfterType == false && symbol && symbol->isVariable()) {
- TVariable* variable = static_cast<TVariable*>(symbol);
- if (variable->isUserType()) {
- parseContextLocal.lexAfterType = true;
- return TYPE_NAME;
- }
- }
-
- return IDENTIFIER;
-}
-
-int PaParseComment(int &lineno, TParseContext& parseContextLocal)
-{
- int transitionFlag = 0;
- int nextChar;
-
- while (transitionFlag != 2) {
- nextChar = yyinput();
- if (nextChar == '\n')
- lineno++;
- switch (nextChar) {
- case '*' :
- transitionFlag = 1;
- break;
- case '/' : /* if star is the previous character, then it is the end of comment */
- if (transitionFlag == 1) {
- return 1 ;
- }
- break;
- case EOF :
- /* Raise error message here */
- parseContextLocal.error(yylineno, "End of shader found before end of comment.", "", "", "");
- GlobalParseContext->recover();
- return YY_NULL;
- default : /* Any other character will be a part of the comment */
- transitionFlag = 0;
- }
- }
- return 1;
-}
-
-extern "C" {
-
-void CPPDebugLogMsg(const char *msg)
-{
- ((TParseContext *)cpp->pC)->infoSink.debug.message(EPrefixNone, msg);
-}
-
-void CPPWarningToInfoLog(const char *msg)
-{
- ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg, yylineno);
-}
-
-void CPPShInfoLogMsg(const char *msg)
-{
- ((TParseContext *)cpp->pC)->error(yylineno,"", "",msg,"");
- GlobalParseContext->recover();
-}
-
-void CPPErrorToInfoLog(char *msg)
-{
- ((TParseContext *)cpp->pC)->error(yylineno,"syntax error", "",msg,"");
- GlobalParseContext->recover();
-}
-
-void SetLineNumber(int line)
-{
- yylineno &= ~SourceLocLineMask;
- yylineno |= line;
-}
-
-void SetStringNumber(int string)
-{
- yylineno = (string << SourceLocStringShift) | (yylineno & SourceLocLineMask);
-}
-
-int GetStringNumber(void)
-{
- return yylineno >> 16;
-}
-
-int GetLineNumber(void)
-{
- return yylineno & SourceLocLineMask;
-}
-
-void IncLineNumber(void)
-{
- if ((yylineno & SourceLocLineMask) <= SourceLocLineMask)
- ++yylineno;
-}
-
-void DecLineNumber(void)
-{
- if ((yylineno & SourceLocLineMask) > 0)
- --yylineno;
-}
-
-void HandlePragma(const char **tokens, int numTokens)
-{
- if (!strcmp(tokens[0], "optimize")) {
- if (numTokens != 4) {
- CPPShInfoLogMsg("optimize pragma syntax is incorrect");
- return;
- }
-
- if (strcmp(tokens[1], "(")) {
- CPPShInfoLogMsg("\"(\" expected after 'optimize' keyword");
- return;
- }
-
- if (!strcmp(tokens[2], "on"))
- ((TParseContext *)cpp->pC)->contextPragma.optimize = true;
- else if (!strcmp(tokens[2], "off"))
- ((TParseContext *)cpp->pC)->contextPragma.optimize = false;
- else {
- CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'optimize' pragma");
- return;
- }
-
- if (strcmp(tokens[3], ")")) {
- CPPShInfoLogMsg("\")\" expected to end 'optimize' pragma");
- return;
- }
- } else if (!strcmp(tokens[0], "debug")) {
- if (numTokens != 4) {
- CPPShInfoLogMsg("debug pragma syntax is incorrect");
- return;
- }
-
- if (strcmp(tokens[1], "(")) {
- CPPShInfoLogMsg("\"(\" expected after 'debug' keyword");
- return;
- }
-
- if (!strcmp(tokens[2], "on"))
- ((TParseContext *)cpp->pC)->contextPragma.debug = true;
- else if (!strcmp(tokens[2], "off"))
- ((TParseContext *)cpp->pC)->contextPragma.debug = false;
- else {
- CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'debug' pragma");
- return;
- }
-
- if (strcmp(tokens[3], ")")) {
- CPPShInfoLogMsg("\")\" expected to end 'debug' pragma");
- return;
- }
- } else {
- /*
- // implementation specific pragma
- // use ((TParseContext *)cpp->pC)->contextPragma.pragmaTable to store the information about pragma
- // For now, just ignore the pragma that the implementation cannot recognize
- // An Example of one such implementation for a pragma that has a syntax like
- // #pragma pragmaname(pragmavalue)
- // This implementation stores the current pragmavalue against the pragma name in pragmaTable.
- if (numTokens == 4 && !strcmp(tokens[1], "(") && !strcmp(tokens[3], ")")) {
- TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable;
- TPragmaTable::iterator iter;
- iter = pragmaTable.find(TString(tokens[0]));
- if (iter != pragmaTable.end()) {
- iter->second = tokens[2];
- } else {
- pragmaTable[tokens[0]] = tokens[2];
- }
- }
- */
- }
-}
-
-void StoreStr(char *string)
-{
- TString strSrc;
- strSrc = TString(string);
-
- ((TParseContext *)cpp->pC)->HashErrMsg = ((TParseContext *)cpp->pC)->HashErrMsg + " " + strSrc;
-}
-
-const char* GetStrfromTStr(void)
-{
- cpp->ErrMsg = (((TParseContext *)cpp->pC)->HashErrMsg).c_str();
- return cpp->ErrMsg;
-}
-
-void ResetTString(void)
-{
- ((TParseContext *)cpp->pC)->HashErrMsg = "";
-}
-
-TBehavior GetBehavior(const char* behavior)
-{
- if (!strcmp("require", behavior))
- return EBhRequire;
- else if (!strcmp("enable", behavior))
- return EBhEnable;
- else if (!strcmp("disable", behavior))
- return EBhDisable;
- else if (!strcmp("warn", behavior))
- return EBhWarn;
- else {
- CPPShInfoLogMsg((TString("behavior '") + behavior + "' is not supported").c_str());
- return EBhDisable;
- }
-}
-
-void updateExtensionBehavior(const char* extName, const char* behavior)
-{
- TBehavior behaviorVal = GetBehavior(behavior);
- TMap<TString, TBehavior>:: iterator iter;
- TString msg;
-
- // special cased for all extension
- if (!strcmp(extName, "all")) {
- if (behaviorVal == EBhRequire || behaviorVal == EBhEnable) {
- CPPShInfoLogMsg("extension 'all' cannot have 'require' or 'enable' behavior");
- return;
- } else {
- for (iter = ((TParseContext *)cpp->pC)->extensionBehavior.begin(); iter != ((TParseContext *)cpp->pC)->extensionBehavior.end(); ++iter)
- iter->second = behaviorVal;
- }
- } else {
- iter = ((TParseContext *)cpp->pC)->extensionBehavior.find(TString(extName));
- if (iter == ((TParseContext *)cpp->pC)->extensionBehavior.end()) {
- switch (behaviorVal) {
- case EBhRequire:
- CPPShInfoLogMsg((TString("extension '") + extName + "' is not supported").c_str());
- break;
- case EBhEnable:
- case EBhWarn:
- case EBhDisable:
- msg = TString("extension '") + extName + "' is not supported";
- ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno);
- break;
- }
- return;
- } else
- iter->second = behaviorVal;
- }
-}
-
-}
-
-void setInitialState()
-{
- yy_start = 1;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.y b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.y
deleted file mode 100644
index d2dc1db37..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang.y
+++ /dev/null
@@ -1,2009 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-/**
- * This is bison grammar and production code for parsing the OpenGL 2.0 shading
- * languages.
- */
-%{
-
-/* Based on:
-ANSI C Yacc grammar
-
-In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a
-matching Lex specification) for the April 30, 1985 draft version of the
-ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that
-original, as mentioned in the answer to question 17.25 of the comp.lang.c
-FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z.
-
-I intend to keep this version as close to the current C Standard grammar as
-possible; please let me know if you discover discrepancies.
-
-Jutta Degener, 1995
-*/
-
-#include "SymbolTable.h"
-#include "ParseHelper.h"
-#include "../Public/ShaderLang.h"
-
-#ifdef _WIN32
- #define YYPARSE_PARAM parseContext
- #define YYPARSE_PARAM_DECL TParseContext&
- #define YY_DECL int yylex(YYSTYPE* pyylval, TParseContext& parseContext)
- #define YYLEX_PARAM parseContext
-#else
- #define YYPARSE_PARAM parseContextLocal
- #define parseContext (*((TParseContext*)(parseContextLocal)))
- #define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
- #define YYLEX_PARAM (void*)(parseContextLocal)
- extern void yyerror(char*);
-#endif
-
-#define FRAG_VERT_ONLY(S, L) { \
- if (parseContext.language != EShLangFragment && \
- parseContext.language != EShLangVertex) { \
- parseContext.error(L, " supported in vertex/fragment shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define VERTEX_ONLY(S, L) { \
- if (parseContext.language != EShLangVertex) { \
- parseContext.error(L, " supported in vertex shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define FRAG_ONLY(S, L) { \
- if (parseContext.language != EShLangFragment) { \
- parseContext.error(L, " supported in fragment shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define PACK_ONLY(S, L) { \
- if (parseContext.language != EShLangPack) { \
- parseContext.error(L, " supported in pack shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define UNPACK_ONLY(S, L) { \
- if (parseContext.language != EShLangUnpack) { \
- parseContext.error(L, " supported in unpack shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-
-#define PACK_UNPACK_ONLY(S, L) { \
- if (parseContext.language != EShLangUnpack && \
- parseContext.language != EShLangPack) { \
- parseContext.error(L, " supported in pack/unpack shaders only ", S, "", ""); \
- parseContext.recover(); \
- } \
-}
-%}
-%union {
- struct {
- TSourceLoc line;
- union {
- TString *string;
- float f;
- int i;
- bool b;
- };
- TSymbol* symbol;
- } lex;
- struct {
- TSourceLoc line;
- TOperator op;
- union {
- TIntermNode* intermNode;
- TIntermNodePair nodePair;
- TIntermTyped* intermTypedNode;
- TIntermAggregate* intermAggregate;
- };
- union {
- TPublicType type;
- TQualifier qualifier;
- TFunction* function;
- TParameter param;
- TTypeLine typeLine;
- TTypeList* typeList;
- };
- } interm;
-}
-
-%{
-#ifndef _WIN32
- extern int yylex(YYSTYPE*, void*);
-#endif
-%}
-
-%pure_parser /* Just in case is called from multiple threads */
-%expect 1 /* One shift reduce conflict because of if | else */
-%token <lex> ATTRIBUTE CONST_QUAL BOOL_TYPE FLOAT_TYPE INT_TYPE
-%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN
-%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 VEC2 VEC3 VEC4
-%token <lex> MATRIX2 MATRIX3 MATRIX4 IN_QUAL OUT_QUAL INOUT_QUAL UNIFORM VARYING
-%token <lex> STRUCT VOID_TYPE WHILE
-%token <lex> SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW
-
-%token <lex> IDENTIFIER TYPE_NAME FLOATCONSTANT INTCONSTANT BOOLCONSTANT
-%token <lex> FIELD_SELECTION
-%token <lex> LEFT_OP RIGHT_OP
-%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
-%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
-%token <lex> MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
-%token <lex> SUB_ASSIGN
-
-%token <lex> LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT
-%token <lex> COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT
-%token <lex> LEFT_ANGLE RIGHT_ANGLE VERTICAL_BAR CARET AMPERSAND QUESTION
-
-%type <interm> assignment_operator constructor_identifier unary_operator
-%type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
-%type <interm.intermTypedNode> expression integer_expression assignment_expression
-%type <interm.intermTypedNode> unary_expression multiplicative_expression additive_expression
-%type <interm.intermTypedNode> relational_expression equality_expression
-%type <interm.intermTypedNode> conditional_expression constant_expression
-%type <interm.intermTypedNode> logical_or_expression logical_xor_expression logical_and_expression
-%type <interm.intermTypedNode> shift_expression and_expression exclusive_or_expression inclusive_or_expression
-%type <interm.intermTypedNode> function_call initializer condition conditionopt
-
-%type <interm.intermNode> translation_unit function_definition
-%type <interm.intermNode> statement simple_statement
-%type <interm.intermAggregate> statement_list compound_statement
-%type <interm.intermNode> declaration_statement selection_statement expression_statement
-%type <interm.intermNode> declaration external_declaration
-%type <interm.intermNode> for_init_statement compound_statement_no_new_scope
-%type <interm.nodePair> selection_rest_statement for_rest_statement
-%type <interm.intermNode> iteration_statement jump_statement statement_no_new_scope
-%type <interm> single_declaration init_declarator_list
-
-%type <interm> parameter_declaration parameter_declarator parameter_type_specifier
-%type <interm.qualifier> parameter_qualifier
-
-%type <interm.type> type_qualifier fully_specified_type type_specifier
-%type <interm.type> struct_specifier
-%type <interm.typeLine> struct_declarator
-%type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list
-%type <interm.function> function_header function_declarator function_identifier
-%type <interm.function> function_header_with_parameters function_call_header
-%type <interm> function_call_header_with_parameters function_call_header_no_parameters function_call_generic function_prototype
-
-%start translation_unit
-%%
-
-variable_identifier
- : IDENTIFIER {
- // The symbol table search was done in the lexical phase
- const TSymbol* symbol = $1.symbol;
- const TVariable* variable;
- if (symbol == 0) {
- parseContext.error($1.line, "undeclared identifier", $1.string->c_str(), "");
- parseContext.recover();
- TType type(EbtFloat);
- TVariable* fakeVariable = new TVariable($1.string, type);
- parseContext.symbolTable.insert(*fakeVariable);
- variable = fakeVariable;
- } else {
- // This identifier can only be a variable type symbol
- if (! symbol->isVariable()) {
- parseContext.error($1.line, "variable expected", $1.string->c_str(), "");
- parseContext.recover();
- }
- variable = static_cast<const TVariable*>(symbol);
- }
-
- // don't delete $1.string, it's used by error recovery, and the pool
- // pop will reclaim the memory
-
- if (variable->getType().getQualifier() == EvqConst ) {
- constUnion* constArray = variable->getConstPointer();
- TType t(variable->getType());
- $$ = parseContext.intermediate.addConstantUnion(constArray, t, $1.line);
- } else
- $$ = parseContext.intermediate.addSymbol(variable->getUniqueId(),
- variable->getName(),
- variable->getType(), $1.line);
- }
- ;
-
-primary_expression
- : variable_identifier {
- $$ = $1;
- }
- | INTCONSTANT {
- //
- // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
- // check for overflow for constants
- //
- if (abs($1.i) >= (1 << 16)) {
- parseContext.error($1.line, " integer constant overflow", "", "");
- parseContext.recover();
- }
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = $1.i;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), $1.line);
- }
- | FLOATCONSTANT {
- constUnion *unionArray = new constUnion[1];
- unionArray->fConst = $1.f;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), $1.line);
- }
- | BOOLCONSTANT {
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = $1.b;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $1.line);
- }
- | LEFT_PAREN expression RIGHT_PAREN {
- $$ = $2;
- }
- ;
-
-postfix_expression
- : primary_expression {
- $$ = $1;
- }
- | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET {
- if (!$1->isArray() && !$1->isMatrix() && !$1->isVector()) {
- if ($1->getAsSymbolNode())
- parseContext.error($2.line, " left of '[' is not of type array, matrix, or vector ", $1->getAsSymbolNode()->getSymbol().c_str(), "");
- else
- parseContext.error($2.line, " left of '[' is not of type array, matrix, or vector ", "expression", "");
- parseContext.recover();
- }
- if ($1->getType().getQualifier() == EvqConst && !$1->isArray() && $3->getQualifier() == EvqConst) {
- if ($1->isVector()) { // constant folding for vectors
- TVectorFields fields;
- fields.num = 1;
- fields.offsets[0] = $3->getAsConstantUnion()->getUnionArrayPointer()->iConst; // need to do it this way because v.xy sends fields integer array
- $$ = parseContext.addConstVectorNode(fields, $1, $2.line);
- } else if ($1->isMatrix()) { // constant folding for matrices
- $$ = parseContext.addConstMatrixNode($3->getAsConstantUnion()->getUnionArrayPointer()->iConst, $1, $2.line);
- }
- } else {
- if ($3->getQualifier() == EvqConst) {
- if (($1->isVector() || $1->isMatrix()) && $1->getType().getNominalSize() <= $3->getAsConstantUnion()->getUnionArrayPointer()->iConst && !$1->isArray() ) {
- parseContext.error($2.line, "", "[", "field selection out of range '%d'", $3->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- parseContext.recover();
- } else {
- if ($1->isArray()) {
- if ($1->getType().getArraySize() == 0) {
- if ($1->getType().getMaxArraySize() <= $3->getAsConstantUnion()->getUnionArrayPointer()->iConst) {
- if (parseContext.arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), $3->getAsConstantUnion()->getUnionArrayPointer()->iConst, true, $2.line))
- parseContext.recover();
- } else {
- if (parseContext.arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), 0, false, $2.line))
- parseContext.recover();
- }
- } else if ( $3->getAsConstantUnion()->getUnionArrayPointer()->iConst >= $1->getType().getArraySize()) {
- parseContext.error($2.line, "", "[", "array index out of range '%d'", $3->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- parseContext.recover();
- }
- }
- $$ = parseContext.intermediate.addIndex(EOpIndexDirect, $1, $3, $2.line);
- }
- } else {
- if ($1->isArray() && $1->getType().getArraySize() == 0) {
- parseContext.error($2.line, "", "[", "array must be redeclared with a size before being indexed with a variable");
- parseContext.recover();
- }
-
- $$ = parseContext.intermediate.addIndex(EOpIndexIndirect, $1, $3, $2.line);
- }
- }
- if ($$ == 0) {
- constUnion *unionArray = new constUnion[1];
- unionArray->fConst = 0.0;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), $2.line);
- } else if ($1->isArray()) {
- if ($1->getType().getStruct())
- $$->setType(TType($1->getType().getStruct(), $1->getType().getTypeName()));
- else
- $$->setType(TType($1->getBasicType(), EvqTemporary, $1->getNominalSize(), $1->isMatrix()));
- } else if ($1->isMatrix() && $1->getType().getQualifier() == EvqConst)
- $$->setType(TType($1->getBasicType(), EvqConst, $1->getNominalSize()));
- else if ($1->isMatrix())
- $$->setType(TType($1->getBasicType(), EvqTemporary, $1->getNominalSize()));
- else if ($1->isVector() && $1->getType().getQualifier() == EvqConst)
- $$->setType(TType($1->getBasicType(), EvqConst));
- else if ($1->isVector())
- $$->setType(TType($1->getBasicType(), EvqTemporary));
- else
- $$->setType($1->getType());
- }
- | function_call {
- $$ = $1;
- }
- | postfix_expression DOT FIELD_SELECTION {
- if ($1->isArray()) {
- parseContext.error($3.line, "cannot apply dot operator to an array", ".", "");
- parseContext.recover();
- }
-
- if ($1->isVector()) {
- TVectorFields fields;
- if (! parseContext.parseVectorFields(*$3.string, $1->getNominalSize(), fields, $3.line)) {
- fields.num = 1;
- fields.offsets[0] = 0;
- parseContext.recover();
- }
-
- if ($1->getType().getQualifier() == EvqConst) { // constant folding for vector fields
- $$ = parseContext.addConstVectorNode(fields, $1, $3.line);
- if ($$ == 0) {
- parseContext.recover();
- $$ = $1;
- }
- else
- $$->setType(TType($1->getBasicType(), EvqConst, (int) (*$3.string).size()));
- } else {
- if (fields.num == 1) {
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = fields.offsets[0];
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), $3.line);
- $$ = parseContext.intermediate.addIndex(EOpIndexDirect, $1, index, $2.line);
- $$->setType(TType($1->getBasicType()));
- } else {
- TString vectorString = *$3.string;
- TIntermTyped* index = parseContext.intermediate.addSwizzle(fields, $3.line);
- $$ = parseContext.intermediate.addIndex(EOpVectorSwizzle, $1, index, $2.line);
- $$->setType(TType($1->getBasicType(),EvqTemporary, (int) vectorString.size()));
- }
- }
- } else if ($1->isMatrix()) {
- TMatrixFields fields;
- if (! parseContext.parseMatrixFields(*$3.string, $1->getNominalSize(), fields, $3.line)) {
- fields.wholeRow = false;
- fields.wholeCol = false;
- fields.row = 0;
- fields.col = 0;
- parseContext.recover();
- }
-
- if (fields.wholeRow || fields.wholeCol) {
- parseContext.error($2.line, " non-scalar fields not implemented yet", ".", "");
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = 0;
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), $3.line);
- $$ = parseContext.intermediate.addIndex(EOpIndexDirect, $1, index, $2.line);
- $$->setType(TType($1->getBasicType(), EvqTemporary, $1->getNominalSize()));
- } else {
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = fields.col * $1->getNominalSize() + fields.row;
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), $3.line);
- $$ = parseContext.intermediate.addIndex(EOpIndexDirect, $1, index, $2.line);
- $$->setType(TType($1->getBasicType()));
- }
- } else if ($1->getBasicType() == EbtStruct) {
- bool fieldFound = false;
- TTypeList* fields = $1->getType().getStruct();
- if (fields == 0) {
- parseContext.error($2.line, "structure has no fields", "Internal Error", "");
- parseContext.recover();
- $$ = $1;
- } else {
- unsigned int i;
- for (i = 0; i < fields->size(); ++i) {
- if ((*fields)[i].type->getFieldName() == *$3.string) {
- fieldFound = true;
- break;
- }
- }
- if (fieldFound) {
- if ($1->getType().getQualifier() == EvqConst) {
- $$ = parseContext.addConstStruct(*$3.string, $1, $2.line);
- if ($$ == 0) {
- parseContext.recover();
- $$ = $1;
- }
- else {
- $$->setType(*(*fields)[i].type);
- // change the qualifier of the return type, not of the structure field
- // as the structure definition is shared between various structures.
- $$->getTypePointer()->changeQualifier(EvqConst);
- }
- } else {
- constUnion *unionArray = new constUnion[1];
- unionArray->iConst = i;
- TIntermTyped* index = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtInt, EvqConst), $3.line);
- $$ = parseContext.intermediate.addIndex(EOpIndexDirectStruct, $1, index, $2.line);
- $$->setType(*(*fields)[i].type);
- }
- } else {
- parseContext.error($2.line, " no such field in structure", $3.string->c_str(), "");
- parseContext.recover();
- $$ = $1;
- }
- }
- } else {
- parseContext.error($2.line, " field selection requires structure, vector, or matrix on left hand side", $3.string->c_str(), "");
- parseContext.recover();
- $$ = $1;
- }
- // don't delete $3.string, it's from the pool
- }
- | postfix_expression INC_OP {
- if (parseContext.lValueErrorCheck($2.line, "++", $1))
- parseContext.recover();
- $$ = parseContext.intermediate.addUnaryMath(EOpPostIncrement, $1, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.unaryOpError($2.line, "++", $1->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- | postfix_expression DEC_OP {
- if (parseContext.lValueErrorCheck($2.line, "--", $1))
- parseContext.recover();
- $$ = parseContext.intermediate.addUnaryMath(EOpPostDecrement, $1, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.unaryOpError($2.line, "--", $1->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-integer_expression
- : expression {
- if (parseContext.integerErrorCheck($1, "[]"))
- parseContext.recover();
- $$ = $1;
- }
- ;
-
-function_call
- : function_call_generic {
- TFunction* fnCall = $1.function;
- TOperator op = fnCall->getBuiltInOp();
-
- if (op != EOpNull) {
- //
- // Then this should be a constructor.
- //
- TType type(EbtVoid); // use this to get the type back
- if (parseContext.constructorErrorCheck($1.line, $1.intermNode, *fnCall, op, &type)) {
- $$ = 0;
- } else {
- //
- // It's a constructor, of type 'type'.
- //
- $$ = parseContext.addConstructor($1.intermNode, &type, op, fnCall, $1.line);
- }
-
- if ($$ == 0) {
- parseContext.recover();
- $$ = parseContext.intermediate.setAggregateOperator(0, op, $1.line);
- }
- $$->setType(type);
- } else {
- //
- // Not a constructor. Find it in the symbol table.
- //
- const TFunction* fnCandidate;
- bool builtIn;
- fnCandidate = parseContext.findFunction($1.line, fnCall, &builtIn);
- if (fnCandidate) {
- //
- // A declared function. But, it might still map to a built-in
- // operation.
- //
- op = fnCandidate->getBuiltInOp();
- if (builtIn && op != EOpNull) {
- //
- // A function call mapped to a built-in operation.
- //
- if (fnCandidate->getParamCount() == 1) {
- //
- // Treat it like a built-in unary operator.
- //
- $$ = parseContext.intermediate.addUnaryMath(op, $1.intermNode, 0, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.error($1.intermNode->getLine(), " wrong operand type", "Internal Error",
- "built in unary operator function. Type: %s",
- static_cast<TIntermTyped*>($1.intermNode)->getCompleteString().c_str());
- YYERROR;
- }
- } else {
- $$ = parseContext.intermediate.setAggregateOperator($1.intermAggregate, op, $1.line);
- }
- } else {
- // This is a real function call
-
- $$ = parseContext.intermediate.setAggregateOperator($1.intermAggregate, EOpFunctionCall, $1.line);
- $$->setType(fnCandidate->getReturnType());
-
- // this is how we know whether the given function is a builtIn function or a user defined function
- // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
- // if builtIn == true, it's definitely a builtIn function with EOpNull
- if (!builtIn)
- $$->getAsAggregate()->setUserDefined();
- $$->getAsAggregate()->setName(fnCandidate->getMangledName());
-
- TQualifier qual;
- TQualifierList& qualifierList = $$->getAsAggregate()->getQualifier();
- for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
- qual = (*fnCandidate)[i].type->getQualifier();
- if (qual == EvqOut || qual == EvqInOut) {
- if (parseContext.lValueErrorCheck($$->getLine(), "assign", $$->getAsAggregate()->getSequence()[i]->getAsTyped())) {
- parseContext.error($1.intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error", "");
- parseContext.recover();
- }
- }
- qualifierList.push_back(qual);
- }
- }
- $$->setType(fnCandidate->getReturnType());
- } else {
- // error message was put out by PaFindFunction()
- // Put on a dummy node for error recovery
- constUnion *unionArray = new constUnion[1];
- unionArray->fConst = 0.0;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtFloat, EvqConst), $1.line);
- parseContext.recover();
- }
- }
- delete fnCall;
- }
- ;
-
-function_call_generic
- : function_call_header_with_parameters RIGHT_PAREN {
- $$ = $1;
- $$.line = $2.line;
- }
- | function_call_header_no_parameters RIGHT_PAREN {
- $$ = $1;
- $$.line = $2.line;
- }
- ;
-
-function_call_header_no_parameters
- : function_call_header VOID_TYPE {
- $$.function = $1;
- $$.intermNode = 0;
- }
- | function_call_header {
- $$.function = $1;
- $$.intermNode = 0;
- }
- ;
-
-function_call_header_with_parameters
- : function_call_header assignment_expression {
- TParameter param = { 0, new TType($2->getType()) };
- $1->addParameter(param);
- $$.function = $1;
- $$.intermNode = $2;
- }
- | function_call_header_with_parameters COMMA assignment_expression {
- TParameter param = { 0, new TType($3->getType()) };
- $1.function->addParameter(param);
- $$.function = $1.function;
- $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.line);
- }
- ;
-
-function_call_header
- : function_identifier LEFT_PAREN {
- $$ = $1;
- }
- ;
-
-function_identifier
- : constructor_identifier {
- if ($1.op == EOpConstructStruct) {
- TString tempString = "";
- TFunction *function = new TFunction(&tempString, *($1.type.userDef), $1.op);
- $$ = function;
- }
- else {
- TFunction *function = new TFunction($1.op);
- $$ = function;
- }
- }
- | IDENTIFIER {
- if (parseContext.reservedErrorCheck($1.line, *$1.string))
- parseContext.recover();
- TType type(EbtVoid);
- TFunction *function = new TFunction($1.string, type);
- $$ = function;
- }
- ;
-
-// Grammar Note: Constructors look like functions, but lexical anaylsis recognized most of them as keywords.
-
-//
-// Don't go through the symbol table for constructors.
-// Their parameters will be verified algorithmically.
-//
-constructor_identifier
- : FLOAT_TYPE { $$.line = $1.line; $$.op = EOpConstructFloat; }
- | INT_TYPE { $$.line = $1.line; $$.op = EOpConstructInt; }
- | BOOL_TYPE { $$.line = $1.line; $$.op = EOpConstructBool; }
- | VEC2 { $$.line = $1.line; $$.op = EOpConstructVec2; }
- | VEC3 { $$.line = $1.line; $$.op = EOpConstructVec3; }
- | VEC4 { $$.line = $1.line; $$.op = EOpConstructVec4; }
- | BVEC2 { FRAG_VERT_ONLY("bvec2", $1.line); $$.line = $1.line; $$.op = EOpConstructBVec2; }
- | BVEC3 { FRAG_VERT_ONLY("bvec3", $1.line); $$.line = $1.line; $$.op = EOpConstructBVec3; }
- | BVEC4 { FRAG_VERT_ONLY("bvec4", $1.line); $$.line = $1.line; $$.op = EOpConstructBVec4; }
- | IVEC2 { FRAG_VERT_ONLY("ivec2", $1.line); $$.line = $1.line; $$.op = EOpConstructIVec2; }
- | IVEC3 { FRAG_VERT_ONLY("ivec3", $1.line); $$.line = $1.line; $$.op = EOpConstructIVec3; }
- | IVEC4 { FRAG_VERT_ONLY("ivec4", $1.line); $$.line = $1.line; $$.op = EOpConstructIVec4; }
- | MATRIX2 { FRAG_VERT_ONLY("mat2", $1.line); $$.line = $1.line; $$.op = EOpConstructMat2; }
- | MATRIX3 { FRAG_VERT_ONLY("mat3", $1.line); $$.line = $1.line; $$.op = EOpConstructMat3; }
- | MATRIX4 { FRAG_VERT_ONLY("mat4", $1.line); $$.line = $1.line; $$.op = EOpConstructMat4; }
- | TYPE_NAME {
- TType& structure = static_cast<TVariable*>($1.symbol)->getType();
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtStruct, qual, 1, false, false, &structure, $1.line };
- $$.type = t;
- $$.line = $1.line;
- $$.op = EOpConstructStruct;
- }
- ;
-
-unary_expression
- : postfix_expression {
- $$ = $1;
- }
- | INC_OP unary_expression {
- if (parseContext.lValueErrorCheck($1.line, "++", $2))
- parseContext.recover();
- $$ = parseContext.intermediate.addUnaryMath(EOpPreIncrement, $2, $1.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.unaryOpError($1.line, "++", $2->getCompleteString());
- parseContext.recover();
- $$ = $2;
- }
- }
- | DEC_OP unary_expression {
- if (parseContext.lValueErrorCheck($1.line, "--", $2))
- parseContext.recover();
- $$ = parseContext.intermediate.addUnaryMath(EOpPreDecrement, $2, $1.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.unaryOpError($1.line, "--", $2->getCompleteString());
- parseContext.recover();
- $$ = $2;
- }
- }
- | unary_operator unary_expression {
- if ($1.op != EOpNull) {
- $$ = parseContext.intermediate.addUnaryMath($1.op, $2, $1.line, parseContext.symbolTable);
- if ($$ == 0) {
- char* errorOp = "";
- switch($1.op) {
- case EOpNegative: errorOp = "-"; break;
- case EOpLogicalNot: errorOp = "!"; break;
- case EOpBitwiseNot: errorOp = "~"; break;
- default: break;
- }
- parseContext.unaryOpError($1.line, errorOp, $2->getCompleteString());
- parseContext.recover();
- $$ = $2;
- }
- } else
- $$ = $2;
- }
- ;
-// Grammar Note: No traditional style type casts.
-
-unary_operator
- : PLUS { $$.line = $1.line; $$.op = EOpNull; }
- | DASH { $$.line = $1.line; $$.op = EOpNegative; }
- | BANG { $$.line = $1.line; $$.op = EOpLogicalNot; }
- | TILDE { PACK_UNPACK_ONLY("~", $1.line);
- $$.line = $1.line; $$.op = EOpBitwiseNot; }
- ;
-// Grammar Note: No '*' or '&' unary ops. Pointers are not supported.
-
-multiplicative_expression
- : unary_expression { $$ = $1; }
- | multiplicative_expression STAR unary_expression {
- FRAG_VERT_ONLY("*", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpMul, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "*", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- | multiplicative_expression SLASH unary_expression {
- FRAG_VERT_ONLY("/", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpDiv, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "/", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- | multiplicative_expression PERCENT unary_expression {
- PACK_UNPACK_ONLY("%", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpMod, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "%", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-additive_expression
- : multiplicative_expression { $$ = $1; }
- | additive_expression PLUS multiplicative_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpAdd, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "+", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- | additive_expression DASH multiplicative_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpSub, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "-", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-shift_expression
- : additive_expression { $$ = $1; }
- | shift_expression LEFT_OP additive_expression {
- PACK_UNPACK_ONLY("<<", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpLeftShift, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "<<", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- | shift_expression RIGHT_OP additive_expression {
- PACK_UNPACK_ONLY(">>", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpRightShift, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, ">>", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-relational_expression
- : shift_expression { $$ = $1; }
- | relational_expression LEFT_ANGLE shift_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpLessThan, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "<", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- | relational_expression RIGHT_ANGLE shift_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpGreaterThan, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, ">", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- | relational_expression LE_OP shift_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpLessThanEqual, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "<=", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- | relational_expression GE_OP shift_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpGreaterThanEqual, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, ">=", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- ;
-
-equality_expression
- : relational_expression { $$ = $1; }
- | equality_expression EQ_OP relational_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpEqual, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "==", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- | equality_expression NE_OP relational_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpNotEqual, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "!=", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- ;
-
-and_expression
- : equality_expression { $$ = $1; }
- | and_expression AMPERSAND equality_expression {
- PACK_UNPACK_ONLY("&", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpAnd, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "&", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-exclusive_or_expression
- : and_expression { $$ = $1; }
- | exclusive_or_expression CARET and_expression {
- PACK_UNPACK_ONLY("^", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpExclusiveOr, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "^", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-inclusive_or_expression
- : exclusive_or_expression { $$ = $1; }
- | inclusive_or_expression VERTICAL_BAR exclusive_or_expression {
- PACK_UNPACK_ONLY("|", $2.line);
- $$ = parseContext.intermediate.addBinaryMath(EOpInclusiveOr, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "|", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-logical_and_expression
- : inclusive_or_expression { $$ = $1; }
- | logical_and_expression AND_OP inclusive_or_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpLogicalAnd, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "&&", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- ;
-
-logical_xor_expression
- : logical_and_expression { $$ = $1; }
- | logical_xor_expression XOR_OP logical_and_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpLogicalXor, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "^^", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- ;
-
-logical_or_expression
- : logical_xor_expression { $$ = $1; }
- | logical_or_expression OR_OP logical_xor_expression {
- $$ = parseContext.intermediate.addBinaryMath(EOpLogicalOr, $1, $3, $2.line, parseContext.symbolTable);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, "||", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- constUnion *unionArray = new constUnion[1];
- unionArray->bConst = false;
- $$ = parseContext.intermediate.addConstantUnion(unionArray, TType(EbtBool, EvqConst), $2.line);
- }
- }
- ;
-
-conditional_expression
- : logical_or_expression { $$ = $1; }
- | logical_or_expression QUESTION expression COLON assignment_expression {
- if (parseContext.boolErrorCheck($2.line, $1))
- parseContext.recover();
-
- $$ = parseContext.intermediate.addSelection($1, $3, $5, $2.line);
- if ($3->getType() != $5->getType())
- $$ = 0;
-
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, ":", $3->getCompleteString(), $5->getCompleteString());
- parseContext.recover();
- $$ = $5;
- }
- }
- ;
-
-assignment_expression
- : conditional_expression { $$ = $1; }
- | unary_expression assignment_operator assignment_expression {
- if (parseContext.lValueErrorCheck($2.line, "assign", $1))
- parseContext.recover();
- $$ = parseContext.intermediate.addAssign($2.op, $1, $3, $2.line);
- if ($$ == 0) {
- parseContext.assignError($2.line, "assign", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $1;
- }
- }
- ;
-
-assignment_operator
- : EQUAL { $$.line = $1.line; $$.op = EOpAssign; }
- | MUL_ASSIGN { FRAG_VERT_ONLY("*=", $1.line); $$.line = $1.line; $$.op = EOpMulAssign; }
- | DIV_ASSIGN { FRAG_VERT_ONLY("/=", $1.line); $$.line = $1.line; $$.op = EOpDivAssign; }
- | MOD_ASSIGN { PACK_UNPACK_ONLY("%=", $1.line); $$.line = $1.line; $$.op = EOpModAssign; }
- | ADD_ASSIGN { $$.line = $1.line; $$.op = EOpAddAssign; }
- | SUB_ASSIGN { $$.line = $1.line; $$.op = EOpSubAssign; }
- | LEFT_ASSIGN { PACK_UNPACK_ONLY("<<=", $1.line); $$.line = $1.line; $$.op = EOpLeftShiftAssign; }
- | RIGHT_ASSIGN { PACK_UNPACK_ONLY("<<=", $1.line); $$.line = $1.line; $$.op = EOpRightShiftAssign; }
- | AND_ASSIGN { PACK_UNPACK_ONLY("&=", $1.line); $$.line = $1.line; $$.op = EOpAndAssign; }
- | XOR_ASSIGN { PACK_UNPACK_ONLY("^=", $1.line); $$.line = $1.line; $$.op = EOpExclusiveOrAssign; }
- | OR_ASSIGN { PACK_UNPACK_ONLY("|=", $1.line); $$.line = $1.line; $$.op = EOpInclusiveOrAssign; }
- ;
-
-expression
- : assignment_expression {
- $$ = $1;
- }
- | expression COMMA assignment_expression {
- $$ = parseContext.intermediate.addComma($1, $3, $2.line);
- if ($$ == 0) {
- parseContext.binaryOpError($2.line, ",", $1->getCompleteString(), $3->getCompleteString());
- parseContext.recover();
- $$ = $3;
- }
- }
- ;
-
-constant_expression
- : conditional_expression {
- if (parseContext.constErrorCheck($1))
- parseContext.recover();
- $$ = $1;
- }
- ;
-
-declaration
- : function_prototype SEMICOLON { $$ = 0; }
- | init_declarator_list SEMICOLON {
- if ($1.intermAggregate)
- $1.intermAggregate->setOperator(EOpSequence);
- $$ = $1.intermAggregate;
- }
- ;
-
-function_prototype
- : function_declarator RIGHT_PAREN {
- //
- // Multiple declarations of the same function are allowed.
- //
- // If this is a definition, the definition production code will check for redefinitions
- // (we don't know at this point if it's a definition or not).
- //
- // Redeclarations are allowed. But, return types and parameter qualifiers must match.
- //
- TFunction* prevDec = static_cast<TFunction*>(parseContext.symbolTable.find($1->getMangledName()));
- if (prevDec) {
- if (prevDec->getReturnType() != $1->getReturnType()) {
- parseContext.error($2.line, "overloaded functions must have the same return type", $1->getReturnType().getBasicString(), "");
- parseContext.recover();
- }
- for (int i = 0; i < prevDec->getParamCount(); ++i) {
- if ((*prevDec)[i].type->getQualifier() != (*$1)[i].type->getQualifier()) {
- parseContext.error($2.line, "overloaded functions must have the same parameter qualifiers", (*$1)[i].type->getQualifierString(), "");
- parseContext.recover();
- }
- }
- }
-
- //
- // If this is a redeclaration, it could also be a definition,
- // in which case, we want to use the variable names from this one, and not the one that's
- // being redeclared. So, pass back up this declaration, not the one in the symbol table.
- //
- $$.function = $1;
- $$.line = $2.line;
-
- parseContext.symbolTable.insert(*$$.function);
- }
- ;
-
-function_declarator
- : function_header {
- $$ = $1;
- }
- | function_header_with_parameters {
- $$ = $1;
- }
- ;
-
-
-function_header_with_parameters
- : function_header parameter_declaration {
- // Add the parameter
- $$ = $1;
- if ($2.param.type->getBasicType() != EbtVoid)
- $1->addParameter($2.param);
- else
- delete $2.param.type;
- }
- | function_header_with_parameters COMMA parameter_declaration {
- //
- // Only first parameter of one-parameter functions can be void
- // The check for named parameters not being void is done in parameter_declarator
- //
- if ($3.param.type->getBasicType() == EbtVoid) {
- //
- // This parameter > first is void
- //
- parseContext.error($2.line, "cannot be an argument type except for '(void)'", "void", "");
- parseContext.recover();
- delete $3.param.type;
- } else {
- // Add the parameter
- $$ = $1;
- $1->addParameter($3.param);
- }
- }
- ;
-
-function_header
- : fully_specified_type IDENTIFIER LEFT_PAREN {
- if ($1.qualifier != EvqGlobal && $1.qualifier != EvqTemporary) {
- parseContext.error($2.line, "no qualifiers allowed for function return", getQualifierString($1.qualifier), "");
- parseContext.recover();
- }
- // make sure a sampler is not involved as well...
- if (parseContext.structQualifierErrorCheck($2.line, $1))
- parseContext.recover();
-
- // Add the function as a prototype after parsing it (we do not support recursion)
- TFunction *function;
- TType type($1);
- function = new TFunction($2.string, type);
- $$ = function;
- }
- ;
-
-parameter_declarator
- // Type + name
- : type_specifier IDENTIFIER {
- if ($1.type == EbtVoid) {
- parseContext.error($2.line, "illegal use of type 'void'", $2.string->c_str(), "");
- parseContext.recover();
- }
- if (parseContext.reservedErrorCheck($2.line, *$2.string))
- parseContext.recover();
- TParameter param = {$2.string, new TType($1)};
- $$.line = $2.line;
- $$.param = param;
- }
- | type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
- // Check that we can make an array out of this type
- if ($1.array) {
- parseContext.error($3.line, "cannot declare arrays of this type", TType($1).getCompleteString().c_str(), "");
- parseContext.recover();
- }
- if (parseContext.reservedErrorCheck($2.line, *$2.string))
- parseContext.recover();
- $1.array = true;
- TType* type = new TType($1);
- if ($4->getAsConstantUnion())
- type->setArraySize($4->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- TParameter param = { $2.string, type };
- $$.line = $2.line;
- $$.param = param;
- }
- ;
-
-parameter_declaration
- //
- // The only parameter qualifier a parameter can have are
- // IN_QUAL, OUT_QUAL, INOUT_QUAL, or CONST.
- //
-
- //
- // Type + name
- //
- : type_qualifier parameter_qualifier parameter_declarator {
- $$ = $3;
- if (parseContext.paramErrorCheck($3.line, $1.qualifier, $2, $$.param.type))
- parseContext.recover();
- }
- | parameter_qualifier parameter_declarator {
- $$ = $2;
- if (parseContext.parameterSamplerErrorCheck($2.line, $1, *$2.param.type))
- parseContext.recover();
- if (parseContext.paramErrorCheck($2.line, EvqTemporary, $1, $$.param.type))
- parseContext.recover();
- }
- //
- // Only type
- //
- | type_qualifier parameter_qualifier parameter_type_specifier {
- $$ = $3;
- if (parseContext.paramErrorCheck($3.line, $1.qualifier, $2, $$.param.type))
- parseContext.recover();
- }
- | parameter_qualifier parameter_type_specifier {
- $$ = $2;
- if (parseContext.parameterSamplerErrorCheck($2.line, $1, *$2.param.type))
- parseContext.recover();
- if (parseContext.paramErrorCheck($2.line, EvqTemporary, $1, $$.param.type))
- parseContext.recover();
- }
- ;
-
-parameter_qualifier
- : /* empty */ {
- $$ = EvqIn;
- }
- | IN_QUAL {
- $$ = EvqIn;
- }
- | OUT_QUAL {
- $$ = EvqOut;
- }
- | INOUT_QUAL {
- $$ = EvqInOut;
- }
- ;
-
-parameter_type_specifier
- : type_specifier {
- TParameter param = { 0, new TType($1) };
- $$.param = param;
-
- }
- | type_specifier LEFT_BRACKET constant_expression RIGHT_BRACKET {
- // Check that we can make an array out of this type
- if ($1.array) {
- parseContext.error($2.line, "cannot declare arrays of this type", TType($1).getCompleteString().c_str(), "");
- parseContext.recover();
- }
- $1.array = true;
- TType* type = new TType($1);
- if ($3->getAsConstantUnion())
- type->setArraySize($3->getAsConstantUnion()->getUnionArrayPointer()->iConst);
-
- TParameter param = { 0, type };
- $$.line = $2.line;
- $$.param = param;
- }
- ;
-
-init_declarator_list
- : single_declaration {
- $$ = $1;
- }
- | init_declarator_list COMMA IDENTIFIER {
- $$ = $1;
- if (parseContext.structQualifierErrorCheck($3.line, $1.type))
- parseContext.recover();
-
- if (parseContext.nonInitErrorCheck($3.line, *$3.string, $$.type))
- parseContext.recover();
- }
- | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET {
- $$ = $1;
- if (parseContext.structQualifierErrorCheck($3.line, $1.type))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck($4.line, *$3.string, $$.type, 0))
- parseContext.recover();
- }
- | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
- $$ = $1;
- if (parseContext.structQualifierErrorCheck($3.line, $1.type))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck($4.line, *$3.string, $$.type, $5))
- parseContext.recover();
- }
- | init_declarator_list COMMA IDENTIFIER EQUAL initializer {
- $$ = $1;
- if (parseContext.structQualifierErrorCheck($3.line, $1.type))
- parseContext.recover();
-
- TIntermNode* intermNode;
- if (!parseContext.executeInitializer($3.line, *$3.string, $1.type, $5, intermNode)) {
- //
- // build the intermediate representation
- //
- if (intermNode)
- $$.intermAggregate = parseContext.intermediate.growAggregate($1.intermNode, intermNode, $4.line);
- else
- $$.intermAggregate = $1.intermAggregate;
- } else {
- parseContext.recover();
- $$.intermAggregate = 0;
- }
- }
- ;
-
-single_declaration
- : fully_specified_type {
- $$.type = $1;
- $$.intermAggregate = 0;
- }
- | fully_specified_type IDENTIFIER {
- $$.intermAggregate = 0;
- $$.type = $1;
- if (parseContext.structQualifierErrorCheck($2.line, $1))
- parseContext.recover();
-
- if (parseContext.nonInitErrorCheck($2.line, *$2.string, $$.type))
- parseContext.recover();
- }
- | fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET {
- $$.intermAggregate = 0;
- $$.type = $1;
- if (parseContext.structQualifierErrorCheck($2.line, $1))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck($3.line, *$2.string, $$.type, 0))
- parseContext.recover();
- }
- | fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
- $$.intermAggregate = 0;
- $$.type = $1;
- if (parseContext.structQualifierErrorCheck($2.line, $1))
- parseContext.recover();
-
- if (parseContext.arrayErrorCheck($3.line, *$2.string, $$.type, $4))
- parseContext.recover();
- }
- | fully_specified_type IDENTIFIER EQUAL initializer {
- $$.type = $1;
- if (parseContext.structQualifierErrorCheck($2.line, $1))
- parseContext.recover();
-
- TIntermNode* intermNode;
- if (!parseContext.executeInitializer($2.line, *$2.string, $1, $4, intermNode)) {
- //
- // Build intermediate representation
- //
- if (intermNode)
- $$.intermAggregate = parseContext.intermediate.makeAggregate(intermNode, $3.line);
- else
- $$.intermAggregate = 0;
- } else {
- parseContext.recover();
- $$.intermAggregate = 0;
- }
- }
-
-//
-// Place holder for the pack/unpack languages.
-//
-// | buffer_specifier {
-// $$.intermAggregate = 0;
-// }
- ;
-
-// Grammar Note: No 'enum', or 'typedef'.
-
-//
-// Place holder for the pack/unpack languages.
-//
-//%type <interm> buffer_declaration
-//%type <interm.type> buffer_specifier input_or_output buffer_declaration_list
-//buffer_specifier
-// : input_or_output LEFT_BRACE buffer_declaration_list RIGHT_BRACE {
-// }
-// ;
-//
-//input_or_output
-// : INPUT {
-// if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "input"))
-// parseContext.recover();
-// UNPACK_ONLY("input", $1.line);
-// $$.qualifier = EvqInput;
-// }
-// | OUTPUT {
-// if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "output"))
-// parseContext.recover();
-// PACK_ONLY("output", $1.line);
-// $$.qualifier = EvqOutput;
-// }
-// ;
-
-//
-// Place holder for the pack/unpack languages.
-//
-//buffer_declaration_list
-// : buffer_declaration {
-// }
-// | buffer_declaration_list buffer_declaration {
-// }
-// ;
-
-//
-// Input/output semantics:
-// float must be 16 or 32 bits
-// float alignment restrictions?
-// check for only one input and only one output
-// sum of bitfields has to be multiple of 32
-//
-
-//
-// Place holder for the pack/unpack languages.
-//
-//buffer_declaration
-// : type_specifier IDENTIFIER COLON constant_expression SEMICOLON {
-// if (parseContext.reservedErrorCheck($2.line, *$2.string, parseContext))
-// parseContext.recover();
-// $$.variable = new TVariable($2.string, $1);
-// if (! parseContext.symbolTable.insert(*$$.variable)) {
-// parseContext.error($2.line, "redefinition", $$.variable->getName().c_str(), "");
-// parseContext.recover();
-// // don't have to delete $$.variable, the pool pop will take care of it
-// }
-// }
-// ;
-
-fully_specified_type
- : type_specifier {
- $$ = $1;
- }
- | type_qualifier type_specifier {
- TPublicType t = { $2.type, $1.qualifier, $2.size, $2.matrix, false, $2.userDef, 0 };
- if ($1.qualifier == EvqAttribute &&
- ($2.type == EbtBool || $2.type == EbtInt)) {
- parseContext.error($2.line, "cannot be bool or int", getQualifierString($1.qualifier), "");
- parseContext.recover();
- }
- if (($1.qualifier == EvqVaryingIn || $1.qualifier == EvqVaryingOut) &&
- ($2.type == EbtBool || $2.type == EbtInt)) {
- parseContext.error($2.line, "cannot be bool or int", getQualifierString($1.qualifier), "");
- parseContext.recover();
- }
- $$ = t;
- }
- ;
-
-type_qualifier
- : CONST_QUAL {
- TPublicType t = { EbtVoid, EvqConst, 1, false, false, 0 };
- $$ = t;
- }
- | ATTRIBUTE {
- VERTEX_ONLY("attribute", $1.line);
- if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "attribute"))
- parseContext.recover();
- TPublicType t = { EbtVoid, EvqAttribute, 1, false, false, 0 };
- $$ = t;
- }
- | VARYING {
- if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "varying"))
- parseContext.recover();
- TPublicType t = { EbtVoid, EvqVaryingIn, 1, false, false, 0 };
- if (parseContext.language == EShLangVertex)
- t.qualifier = EvqVaryingOut;
- $$ = t;
- }
- | UNIFORM {
- if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "uniform"))
- parseContext.recover();
- TPublicType t = { EbtVoid, EvqUniform, 1, false, false, 0 };
- $$ = t;
- }
- ;
-
-type_specifier
- : VOID_TYPE {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtVoid, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | FLOAT_TYPE {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | INT_TYPE {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | BOOL_TYPE {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
-// | UNSIGNED INT_TYPE {
-// PACK_UNPACK_ONLY("unsigned", $1.line);
-// TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
-// TPublicType t = { EbtInt, qual, 1, false, false, 0, $1.line };
-// $$ = t;
-// }
- | VEC2 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 2, false, false, 0, $1.line };
- $$ = t;
- }
- | VEC3 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 3, false, false, 0, $1.line };
- $$ = t;
- }
- | VEC4 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 4, false, false, 0, $1.line };
- $$ = t;
- }
- | BVEC2 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 2, false, false, 0, $1.line };
- $$ = t;
- }
- | BVEC3 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 3, false, false, 0, $1.line };
- $$ = t;
- }
- | BVEC4 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtBool, qual, 4, false, false, 0, $1.line };
- $$ = t;
- }
- | IVEC2 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 2, false, false, 0, $1.line };
- $$ = t;
- }
- | IVEC3 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 3, false, false, 0, $1.line };
- $$ = t;
- }
- | IVEC4 {
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtInt, qual, 4, false, false, 0, $1.line };
- $$ = t;
- }
- | MATRIX2 {
- FRAG_VERT_ONLY("mat2", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 2, true, false, 0, $1.line };
- $$ = t;
- }
- | MATRIX3 {
- FRAG_VERT_ONLY("mat3", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 3, true, false, 0, $1.line };
- $$ = t;
- }
- | MATRIX4 {
- FRAG_VERT_ONLY("mat4", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtFloat, qual, 4, true, false, 0, $1.line };
- $$ = t;
- }
- | SAMPLER1D {
- FRAG_VERT_ONLY("sampler1D", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler1D, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | SAMPLER2D {
- FRAG_VERT_ONLY("sampler2D", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler2D, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | SAMPLER3D {
- FRAG_VERT_ONLY("sampler3D", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler3D, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | SAMPLERCUBE {
- FRAG_VERT_ONLY("samplerCube", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSamplerCube, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | SAMPLER1DSHADOW {
- FRAG_VERT_ONLY("sampler1DShadow", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler1DShadow, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | SAMPLER2DSHADOW {
- FRAG_VERT_ONLY("sampler2DShadow", $1.line);
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtSampler2DShadow, qual, 1, false, false, 0, $1.line };
- $$ = t;
- }
- | struct_specifier {
- FRAG_VERT_ONLY("struct", $1.line);
- $$ = $1;
- $$.qualifier = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- }
- | TYPE_NAME {
- //
- // This is for user defined type names. The lexical phase looked up the
- // type.
- //
- TType& structure = static_cast<TVariable*>($1.symbol)->getType();
- TQualifier qual = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
- TPublicType t = { EbtStruct, qual, 1, false, false, &structure, $1.line };
- $$ = t;
- }
- ;
-
-struct_specifier
- : STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE {
- TType* structure = new TType($4, *$2.string);
- TVariable* userTypeDef = new TVariable($2.string, *structure, true);
- if (! parseContext.symbolTable.insert(*userTypeDef)) {
- parseContext.error($2.line, "redefinition", $2.string->c_str(), "struct");
- parseContext.recover();
- }
- TPublicType t = { EbtStruct, EvqTemporary, 1, false, false, structure, $1.line };
- $$ = t;
- }
- | STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE {
- TType* structure = new TType($3, TString(""));
- TPublicType t = { EbtStruct, EvqTemporary, 1, false, false, structure, $1.line };
- $$ = t;
- }
- ;
-
-struct_declaration_list
- : struct_declaration {
- $$ = $1;
- }
- | struct_declaration_list struct_declaration {
- $$ = $1;
- for (unsigned int i = 0; i < $2->size(); ++i) {
- for (unsigned int j = 0; j < $$->size(); ++j) {
- if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName()) {
- parseContext.error((*$2)[i].line, "duplicate field name in structure:", "struct", (*$2)[i].type->getFieldName().c_str());
- parseContext.recover();
- }
- }
- $$->push_back((*$2)[i]);
- }
- }
- ;
-
-struct_declaration
- : type_specifier struct_declarator_list SEMICOLON {
- $$ = $2;
-
- if (parseContext.voidErrorCheck($1.line, (*$2)[0].type->getFieldName(), $1)) {
- parseContext.recover();
- }
- for (unsigned int i = 0; i < $$->size(); ++i) {
- //
- // Careful not to replace already know aspects of type, like array-ness
- //
- (*$$)[i].type->setType($1.type, $1.size, $1.matrix, $1.userDef);
- if ($1.userDef)
- (*$$)[i].type->setTypeName($1.userDef->getTypeName());
- }
- }
- ;
-
-struct_declarator_list
- : struct_declarator {
- $$ = NewPoolTTypeList();
- $$->push_back($1);
- }
- | struct_declarator_list COMMA struct_declarator {
- $$->push_back($3);
- }
- ;
-
-struct_declarator
- : IDENTIFIER {
- $$.type = new TType(EbtVoid);
- $$.line = $1.line;
- $$.type->setFieldName(*$1.string);
- }
- | IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET {
- $$.type = new TType(EbtVoid);
- $$.line = $1.line;
- $$.type->setFieldName(*$1.string);
-
- if ($3->getAsConstantUnion() == 0 || $3->getAsConstantUnion()->getBasicType() != EbtInt ||
- $3->getAsConstantUnion()->getUnionArrayPointer()->iConst <= 0) {
- parseContext.error($2.line, "structure field array size must be a positive integer", $1.string->c_str(), "");
- parseContext.recover();
- } else {
- $$.type->setArraySize($3->getAsConstantUnion()->getUnionArrayPointer()->iConst);
- }
- }
- ;
-
-initializer
- : assignment_expression { $$ = $1; }
- ;
-
-declaration_statement
- : declaration { $$ = $1; }
- ;
-
-statement
- : compound_statement { $$ = $1; }
- | simple_statement { $$ = $1; }
- ;
-
-// Grammar Note: No labeled statements; 'goto' is not supported.
-
-simple_statement
- : declaration_statement { $$ = $1; }
- | expression_statement { $$ = $1; }
- | selection_statement { $$ = $1; }
- | iteration_statement { $$ = $1; }
- | jump_statement { $$ = $1; }
- ;
-
-compound_statement
- : LEFT_BRACE RIGHT_BRACE { $$ = 0; }
- | LEFT_BRACE { parseContext.symbolTable.push(); } statement_list { parseContext.symbolTable.pop(); } RIGHT_BRACE {
- if ($3 != 0)
- $3->setOperator(EOpSequence);
- $$ = $3;
- }
- ;
-
-statement_no_new_scope
- : compound_statement_no_new_scope { $$ = $1; }
- | simple_statement { $$ = $1; }
- ;
-
-compound_statement_no_new_scope
- // Statement that doesn't create a new scope, for selection_statement, iteration_statement
- : LEFT_BRACE RIGHT_BRACE {
- $$ = 0;
- }
- | LEFT_BRACE statement_list RIGHT_BRACE {
- if ($2)
- $2->setOperator(EOpSequence);
- $$ = $2;
- }
- ;
-
-statement_list
- : statement {
- $$ = parseContext.intermediate.makeAggregate($1, 0);
- }
- | statement_list statement {
- $$ = parseContext.intermediate.growAggregate($1, $2, 0);
- }
- ;
-
-expression_statement
- : SEMICOLON { $$ = 0; }
- | expression SEMICOLON { $$ = static_cast<TIntermNode*>($1); }
- ;
-
-selection_statement
- : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
- if (parseContext.boolErrorCheck($1.line, $3))
- parseContext.recover();
- $$ = parseContext.intermediate.addSelection($3, $5, $1.line);
- }
- ;
-
-selection_rest_statement
- : statement ELSE statement {
- $$.node1 = $1;
- $$.node2 = $3;
- }
- | statement {
- $$.node1 = $1;
- $$.node2 = 0;
- }
- ;
-
-// Grammar Note: No 'switch'. Switch statements not supported.
-
-condition
- // In 1996 c++ draft, conditions can include single declarations
- : expression {
- $$ = $1;
- if (parseContext.boolErrorCheck($1->getLine(), $1))
- parseContext.recover();
- }
- | fully_specified_type IDENTIFIER EQUAL initializer {
- TIntermNode* intermNode;
- if (parseContext.structQualifierErrorCheck($2.line, $1))
- parseContext.recover();
- if (parseContext.boolErrorCheck($2.line, $1))
- parseContext.recover();
-
- if (!parseContext.executeInitializer($2.line, *$2.string, $1, $4, intermNode))
- $$ = $4;
- else {
- parseContext.recover();
- $$ = 0;
- }
- }
- ;
-
-iteration_statement
- : WHILE LEFT_PAREN { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; } condition RIGHT_PAREN statement_no_new_scope {
- parseContext.symbolTable.pop();
- $$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.line);
- --parseContext.loopNestingLevel;
- }
- | DO { ++parseContext.loopNestingLevel; } statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON {
- if (parseContext.boolErrorCheck($8.line, $6))
- parseContext.recover();
-
- $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.line);
- --parseContext.loopNestingLevel;
- }
- | FOR LEFT_PAREN { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; } for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope {
- parseContext.symbolTable.pop();
- $$ = parseContext.intermediate.makeAggregate($4, $2.line);
- $$ = parseContext.intermediate.growAggregate(
- $$,
- parseContext.intermediate.addLoop($7, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), true, $1.line),
- $1.line);
- $$->getAsAggregate()->setOperator(EOpSequence);
- --parseContext.loopNestingLevel;
- }
- ;
-
-for_init_statement
- : expression_statement {
- $$ = $1;
- }
- | declaration_statement {
- $$ = $1;
- }
- ;
-
-conditionopt
- : condition {
- $$ = $1;
- }
- | /* May be null */ {
- $$ = 0;
- }
- ;
-
-for_rest_statement
- : conditionopt SEMICOLON {
- $$.node1 = $1;
- $$.node2 = 0;
- }
- | conditionopt SEMICOLON expression {
- $$.node1 = $1;
- $$.node2 = $3;
- }
- ;
-
-jump_statement
- : CONTINUE SEMICOLON {
- if (parseContext.loopNestingLevel <= 0) {
- parseContext.error($1.line, "continue statement only allowed in loops", "", "");
- parseContext.recover();
- }
- $$ = parseContext.intermediate.addBranch(EOpContinue, $1.line);
- }
- | BREAK SEMICOLON {
- if (parseContext.loopNestingLevel <= 0) {
- parseContext.error($1.line, "break statement only allowed in loops", "", "");
- parseContext.recover();
- }
- $$ = parseContext.intermediate.addBranch(EOpBreak, $1.line);
- }
- | RETURN SEMICOLON {
- $$ = parseContext.intermediate.addBranch(EOpReturn, $1.line);
- if (parseContext.currentFunctionType->getBasicType() != EbtVoid) {
- parseContext.error($1.line, "non-void function must return a value", "return", "");
- parseContext.recover();
- }
- }
- | RETURN expression SEMICOLON {
- $$ = parseContext.intermediate.addBranch(EOpReturn, $2, $1.line);
- parseContext.functionReturnsValue = true;
- if (parseContext.currentFunctionType->getBasicType() == EbtVoid) {
- parseContext.error($1.line, "void function cannot return a value", "return", "");
- parseContext.recover();
- } else if (*(parseContext.currentFunctionType) != $2->getType()) {
- parseContext.error($1.line, "function return is not matching type:", "return", "");
- parseContext.recover();
- }
- }
- | DISCARD SEMICOLON {
- FRAG_ONLY("discard", $1.line);
- $$ = parseContext.intermediate.addBranch(EOpKill, $1.line);
- }
- ;
-
-// Grammar Note: No 'goto'. Gotos are not supported.
-
-translation_unit
- : external_declaration {
- $$ = $1;
- parseContext.treeRoot = $$;
- }
- | translation_unit external_declaration {
- $$ = parseContext.intermediate.growAggregate($1, $2, 0);
- parseContext.treeRoot = $$;
- }
- ;
-
-external_declaration
- : function_definition {
- $$ = $1;
- }
- | declaration {
- $$ = $1;
- }
- ;
-
-function_definition
- : function_prototype {
- TFunction& function = *($1.function);
- TFunction* prevDec = static_cast<TFunction*>(parseContext.symbolTable.find(function.getMangledName()));
- //
- // Note: 'prevDec' could be 'function' if this is the first time we've seen function
- // as it would have just been put in the symbol table. Otherwise, we're looking up
- // an earlier occurance.
- //
- if (prevDec->isDefined()) {
- //
- // Then this function already has a body.
- //
- parseContext.error($1.line, "function already has a body", function.getName().c_str(), "");
- parseContext.recover();
- }
- prevDec->setDefined();
-
- //
- // Raise error message if main function takes any parameters or return anything other than void
- //
- if (function.getName() == "main") {
- if (function.getParamCount() > 0) {
- parseContext.error($1.line, "function cannot take any parameter(s)", function.getName().c_str(), "");
- parseContext.recover();
- }
- if (function.getReturnType().getBasicType() != EbtVoid) {
- parseContext.error($1.line, "", function.getReturnType().getBasicString(), "main function cannot return a value" );
- parseContext.recover();
- }
- }
-
- //
- // New symbol table scope for body of function plus its arguments
- //
- parseContext.symbolTable.push();
-
- //
- // Remember the return type for later checking for RETURN statements.
- //
- parseContext.currentFunctionType = &(prevDec->getReturnType());
- parseContext.functionReturnsValue = false;
-
- //
- // Insert parameters into the symbol table.
- // If the parameter has no name, it's not an error, just don't insert it
- // (could be used for unused args).
- //
- // Also, accumulate the list of parameters into the HIL, so lower level code
- // knows where to find parameters.
- //
- TIntermAggregate* paramNodes = new TIntermAggregate;
- for (int i = 0; i < function.getParamCount(); i++) {
- TParameter& param = function[i];
- if (param.name != 0) {
- TVariable *variable = new TVariable(param.name, *param.type);
- //
- // Insert the parameters with name in the symbol table.
- //
- if (! parseContext.symbolTable.insert(*variable)) {
- parseContext.error($1.line, "redefinition", variable->getName().c_str(), "");
- parseContext.recover();
- delete variable;
- }
- //
- // Transfer ownership of name pointer to symbol table.
- //
- param.name = 0;
-
- //
- // Add the parameter to the HIL
- //
- paramNodes = parseContext.intermediate.growAggregate(
- paramNodes,
- parseContext.intermediate.addSymbol(variable->getUniqueId(),
- variable->getName(),
- variable->getType(), $1.line),
- $1.line);
- } else {
- paramNodes = parseContext.intermediate.growAggregate(paramNodes, parseContext.intermediate.addSymbol(0, "", *param.type, $1.line), $1.line);
- }
- }
- parseContext.intermediate.setAggregateOperator(paramNodes, EOpParameters, $1.line);
- $1.intermAggregate = paramNodes;
- parseContext.loopNestingLevel = 0;
- }
- compound_statement_no_new_scope {
- //?? Check that all paths return a value if return type != void ?
- // May be best done as post process phase on intermediate code
- if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) {
- parseContext.error($1.line, "function does not return a value:", "", $1.function->getName().c_str());
- parseContext.recover();
- }
- parseContext.symbolTable.pop();
- $$ = parseContext.intermediate.growAggregate($1.intermAggregate, $3, 0);
- parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.line);
- $$->getAsAggregate()->setName($1.function->getMangledName().c_str());
- $$->getAsAggregate()->setType($1.function->getReturnType());
-
- // store the pragma information for debug and optimize and other vendor specific
- // information. This information can be queried from the parse tree
- $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
- $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
- $$->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable);
- }
- ;
-
-%%
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang_tab.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang_tab.h
deleted file mode 100755
index 97d827fe9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/glslang_tab.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/* A Bison parser, made by GNU Bison 1.875. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- ATTRIBUTE = 258,
- CONST_QUAL = 259,
- BOOL_TYPE = 260,
- FLOAT_TYPE = 261,
- INT_TYPE = 262,
- BREAK = 263,
- CONTINUE = 264,
- DO = 265,
- ELSE = 266,
- FOR = 267,
- IF = 268,
- DISCARD = 269,
- RETURN = 270,
- BVEC2 = 271,
- BVEC3 = 272,
- BVEC4 = 273,
- IVEC2 = 274,
- IVEC3 = 275,
- IVEC4 = 276,
- VEC2 = 277,
- VEC3 = 278,
- VEC4 = 279,
- MATRIX2 = 280,
- MATRIX3 = 281,
- MATRIX4 = 282,
- IN_QUAL = 283,
- OUT_QUAL = 284,
- INOUT_QUAL = 285,
- UNIFORM = 286,
- VARYING = 287,
- STRUCT = 288,
- VOID_TYPE = 289,
- WHILE = 290,
- SAMPLER1D = 291,
- SAMPLER2D = 292,
- SAMPLER3D = 293,
- SAMPLERCUBE = 294,
- SAMPLER1DSHADOW = 295,
- SAMPLER2DSHADOW = 296,
- IDENTIFIER = 297,
- TYPE_NAME = 298,
- FLOATCONSTANT = 299,
- INTCONSTANT = 300,
- BOOLCONSTANT = 301,
- FIELD_SELECTION = 302,
- LEFT_OP = 303,
- RIGHT_OP = 304,
- INC_OP = 305,
- DEC_OP = 306,
- LE_OP = 307,
- GE_OP = 308,
- EQ_OP = 309,
- NE_OP = 310,
- AND_OP = 311,
- OR_OP = 312,
- XOR_OP = 313,
- MUL_ASSIGN = 314,
- DIV_ASSIGN = 315,
- ADD_ASSIGN = 316,
- MOD_ASSIGN = 317,
- LEFT_ASSIGN = 318,
- RIGHT_ASSIGN = 319,
- AND_ASSIGN = 320,
- XOR_ASSIGN = 321,
- OR_ASSIGN = 322,
- SUB_ASSIGN = 323,
- LEFT_PAREN = 324,
- RIGHT_PAREN = 325,
- LEFT_BRACKET = 326,
- RIGHT_BRACKET = 327,
- LEFT_BRACE = 328,
- RIGHT_BRACE = 329,
- DOT = 330,
- COMMA = 331,
- COLON = 332,
- EQUAL = 333,
- SEMICOLON = 334,
- BANG = 335,
- DASH = 336,
- TILDE = 337,
- PLUS = 338,
- STAR = 339,
- SLASH = 340,
- PERCENT = 341,
- LEFT_ANGLE = 342,
- RIGHT_ANGLE = 343,
- VERTICAL_BAR = 344,
- CARET = 345,
- AMPERSAND = 346,
- QUESTION = 347
- };
-#endif
-#define ATTRIBUTE 258
-#define CONST_QUAL 259
-#define BOOL_TYPE 260
-#define FLOAT_TYPE 261
-#define INT_TYPE 262
-#define BREAK 263
-#define CONTINUE 264
-#define DO 265
-#define ELSE 266
-#define FOR 267
-#define IF 268
-#define DISCARD 269
-#define RETURN 270
-#define BVEC2 271
-#define BVEC3 272
-#define BVEC4 273
-#define IVEC2 274
-#define IVEC3 275
-#define IVEC4 276
-#define VEC2 277
-#define VEC3 278
-#define VEC4 279
-#define MATRIX2 280
-#define MATRIX3 281
-#define MATRIX4 282
-#define IN_QUAL 283
-#define OUT_QUAL 284
-#define INOUT_QUAL 285
-#define UNIFORM 286
-#define VARYING 287
-#define STRUCT 288
-#define VOID_TYPE 289
-#define WHILE 290
-#define SAMPLER1D 291
-#define SAMPLER2D 292
-#define SAMPLER3D 293
-#define SAMPLERCUBE 294
-#define SAMPLER1DSHADOW 295
-#define SAMPLER2DSHADOW 296
-#define IDENTIFIER 297
-#define TYPE_NAME 298
-#define FLOATCONSTANT 299
-#define INTCONSTANT 300
-#define BOOLCONSTANT 301
-#define FIELD_SELECTION 302
-#define LEFT_OP 303
-#define RIGHT_OP 304
-#define INC_OP 305
-#define DEC_OP 306
-#define LE_OP 307
-#define GE_OP 308
-#define EQ_OP 309
-#define NE_OP 310
-#define AND_OP 311
-#define OR_OP 312
-#define XOR_OP 313
-#define MUL_ASSIGN 314
-#define DIV_ASSIGN 315
-#define ADD_ASSIGN 316
-#define MOD_ASSIGN 317
-#define LEFT_ASSIGN 318
-#define RIGHT_ASSIGN 319
-#define AND_ASSIGN 320
-#define XOR_ASSIGN 321
-#define OR_ASSIGN 322
-#define SUB_ASSIGN 323
-#define LEFT_PAREN 324
-#define RIGHT_PAREN 325
-#define LEFT_BRACKET 326
-#define RIGHT_BRACKET 327
-#define LEFT_BRACE 328
-#define RIGHT_BRACE 329
-#define DOT 330
-#define COMMA 331
-#define COLON 332
-#define EQUAL 333
-#define SEMICOLON 334
-#define BANG 335
-#define DASH 336
-#define TILDE 337
-#define PLUS 338
-#define STAR 339
-#define SLASH 340
-#define PERCENT 341
-#define LEFT_ANGLE 342
-#define RIGHT_ANGLE 343
-#define VERTICAL_BAR 344
-#define CARET 345
-#define AMPERSAND 346
-#define QUESTION 347
-
-
-
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 117 "glslang.y"
-typedef union YYSTYPE {
- struct {
- TSourceLoc line;
- union {
- TString *string;
- float f;
- int i;
- bool b;
- };
- TSymbol* symbol;
- } lex;
- struct {
- TSourceLoc line;
- TOperator op;
- union {
- TIntermNode* intermNode;
- TIntermNodePair nodePair;
- TIntermTyped* intermTypedNode;
- TIntermAggregate* intermAggregate;
- };
- union {
- TPublicType type;
- TQualifier qualifier;
- TFunction* function;
- TParameter param;
- TTypeLine typeLine;
- TTypeList* typeList;
- };
- } interm;
-} YYSTYPE;
-/* Line 1240 of yacc.c. */
-#line 251 "glslang.tab.h"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/intermOut.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/intermOut.cpp
deleted file mode 100755
index e75608c45..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/intermOut.cpp
+++ /dev/null
@@ -1,496 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "localintermediate.h"
-#include "../Include/ShHandle.h"
-
-//
-// Two purposes:
-// 1. Show an example of how to iterate tree. Functions can
-// also directly call Traverse() on children themselves to
-// have finer grained control over the process than shown here.
-// See the last function for how to get started.
-// 2. Print out a text based description of the tree.
-//
-
-//
-// Use this class to carry along data from node to node in
-// the traversal
-//
-class TOutputTraverser : public TIntermTraverser {
-public:
- TOutputTraverser(TInfoSink& i) : infoSink(i) { }
- TInfoSink& infoSink;
-};
-
-TString TType::getCompleteString() const
-{
- char buf[100];
- char *p = &buf[0];
-
- if (qualifier != EvqTemporary && qualifier != EvqGlobal)
- p += sprintf(p, "%s ", getQualifierString());
- if (array)
- p += sprintf(p, "array of ");
- if (matrix)
- p += sprintf(p, "%dX%d matrix of ", size, size);
- else if (size > 1)
- p += sprintf(p, "%d-component vector of ", size);
-
- sprintf(p, "%s", getBasicString());
-
- return TString(buf);
-}
-
-//
-// Helper functions for printing, not part of traversing.
-//
-
-void OutputTreeText(TInfoSink& infoSink, TIntermNode* node, const int depth)
-{
- int i;
-
- infoSink.debug << FormatSourceLoc(node->getLine());
-
- for (i = 0; i < depth; ++i)
- infoSink.debug << " ";
-}
-
-//
-// The rest of the file are the traversal functions. The last one
-// is the one that starts the traversal.
-//
-// Return true from interior nodes to have the external traversal
-// continue on to children. If you process children yourself,
-// return false.
-//
-
-void OutputSymbol(TIntermSymbol* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
-
- OutputTreeText(oit->infoSink, node, oit->depth);
-
- char buf[100];
- sprintf(buf, "'%s' (%s)\n",
- node->getSymbol().c_str(),
- node->getCompleteString().c_str());
-
- oit->infoSink.debug << buf;
-}
-
-bool OutputBinary(bool /* preVisit */, TIntermBinary* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- OutputTreeText(out, node, oit->depth);
-
- switch (node->getOp()) {
- case EOpAssign: out.debug << "move second child to first child"; break;
- case EOpAddAssign: out.debug << "add second child into first child"; break;
- case EOpSubAssign: out.debug << "subtract second child into first child"; break;
- case EOpMulAssign: out.debug << "multiply second child into first child"; break;
- case EOpVectorTimesMatrixAssign: out.debug << "matrix mult second child into first child"; break;
- case EOpVectorTimesScalarAssign: out.debug << "vector scale second child into first child"; break;
- case EOpMatrixTimesScalarAssign: out.debug << "matrix scale second child into first child"; break;
- case EOpMatrixTimesMatrixAssign: out.debug << "matrix mult second child into first child"; break;
- case EOpDivAssign: out.debug << "divide second child into first child"; break;
- case EOpModAssign: out.debug << "mod second child into first child"; break;
- case EOpAndAssign: out.debug << "and second child into first child"; break;
- case EOpInclusiveOrAssign: out.debug << "or second child into first child"; break;
- case EOpExclusiveOrAssign: out.debug << "exclusive or second child into first child"; break;
- case EOpLeftShiftAssign: out.debug << "left shift second child into first child"; break;
- case EOpRightShiftAssign: out.debug << "right shift second child into first child"; break;
-
- case EOpIndexDirect: out.debug << "direct index"; break;
- case EOpIndexIndirect: out.debug << "indirect index"; break;
- case EOpIndexDirectStruct: out.debug << "direct index for structure"; break;
- case EOpVectorSwizzle: out.debug << "vector swizzle"; break;
-
- case EOpAdd: out.debug << "add"; break;
- case EOpSub: out.debug << "subtract"; break;
- case EOpMul: out.debug << "component-wise multiply"; break;
- case EOpDiv: out.debug << "divide"; break;
- case EOpMod: out.debug << "mod"; break;
- case EOpRightShift: out.debug << "right-shift"; break;
- case EOpLeftShift: out.debug << "left-shift"; break;
- case EOpAnd: out.debug << "bitwise and"; break;
- case EOpInclusiveOr: out.debug << "inclusive-or"; break;
- case EOpExclusiveOr: out.debug << "exclusive-or"; break;
- case EOpEqual: out.debug << "Compare Equal"; break;
- case EOpNotEqual: out.debug << "Compare Not Equal"; break;
- case EOpLessThan: out.debug << "Compare Less Than"; break;
- case EOpGreaterThan: out.debug << "Compare Greater Than"; break;
- case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break;
- case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break;
-
- case EOpVectorTimesScalar: out.debug << "vector-scale"; break;
- case EOpVectorTimesMatrix: out.debug << "vector-times-matrix"; break;
- case EOpMatrixTimesVector: out.debug << "matrix-times-vector"; break;
- case EOpMatrixTimesScalar: out.debug << "matrix-scale"; break;
- case EOpMatrixTimesMatrix: out.debug << "matrix-multiply"; break;
-
- case EOpLogicalOr: out.debug << "logical-or"; break;
- case EOpLogicalXor: out.debug << "logical-xor"; break;
- case EOpLogicalAnd: out.debug << "logical-and"; break;
- default: out.debug << "<unknown op>";
- }
-
- out.debug << " (" << node->getCompleteString() << ")";
-
- out.debug << "\n";
-
- return true;
-}
-
-bool OutputUnary(bool /* preVisit */, TIntermUnary* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- OutputTreeText(out, node, oit->depth);
-
- switch (node->getOp()) {
- case EOpNegative: out.debug << "Negate value"; break;
- case EOpVectorLogicalNot:
- case EOpLogicalNot: out.debug << "Negate conditional"; break;
- case EOpBitwiseNot: out.debug << "Bitwise not"; break;
-
- case EOpPostIncrement: out.debug << "Post-Increment"; break;
- case EOpPostDecrement: out.debug << "Post-Decrement"; break;
- case EOpPreIncrement: out.debug << "Pre-Increment"; break;
- case EOpPreDecrement: out.debug << "Pre-Decrement"; break;
-
- case EOpConvIntToBool: out.debug << "Convert int to bool"; break;
- case EOpConvFloatToBool:out.debug << "Convert float to bool";break;
- case EOpConvBoolToFloat:out.debug << "Convert bool to float";break;
- case EOpConvIntToFloat: out.debug << "Convert int to float"; break;
- case EOpConvFloatToInt: out.debug << "Convert float to int"; break;
- case EOpConvBoolToInt: out.debug << "Convert bool to int"; break;
-
- case EOpRadians: out.debug << "radians"; break;
- case EOpDegrees: out.debug << "degrees"; break;
- case EOpSin: out.debug << "sine"; break;
- case EOpCos: out.debug << "cosine"; break;
- case EOpTan: out.debug << "tangent"; break;
- case EOpAsin: out.debug << "arc sine"; break;
- case EOpAcos: out.debug << "arc cosine"; break;
- case EOpAtan: out.debug << "arc tangent"; break;
-
- case EOpExp: out.debug << "exp"; break;
- case EOpLog: out.debug << "log"; break;
- case EOpExp2: out.debug << "exp2"; break;
- case EOpLog2: out.debug << "log2"; break;
- case EOpSqrt: out.debug << "sqrt"; break;
- case EOpInverseSqrt: out.debug << "inverse sqrt"; break;
-
- case EOpAbs: out.debug << "Absolute value"; break;
- case EOpSign: out.debug << "Sign"; break;
- case EOpFloor: out.debug << "Floor"; break;
- case EOpCeil: out.debug << "Ceiling"; break;
- case EOpFract: out.debug << "Fraction"; break;
-
- case EOpLength: out.debug << "length"; break;
- case EOpNormalize: out.debug << "normalize"; break;
- case EOpDPdx: out.debug << "dPdx"; break;
- case EOpDPdy: out.debug << "dPdy"; break;
- case EOpFwidth: out.debug << "fwidth"; break;
-
- case EOpAny: out.debug << "any"; break;
- case EOpAll: out.debug << "all"; break;
-
- default: out.debug.message(EPrefixError, "Bad unary op");
- }
-
- out.debug << " (" << node->getCompleteString() << ")";
-
- out.debug << "\n";
-
- return true;
-}
-
-bool OutputAggregate(bool /* preVisit */, TIntermAggregate* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- if (node->getOp() == EOpNull) {
- out.debug.message(EPrefixError, "node is still EOpNull!");
- return true;
- }
-
- OutputTreeText(out, node, oit->depth);
-
- switch (node->getOp()) {
- case EOpSequence: out.debug << "Sequence\n"; return true;
- case EOpComma: out.debug << "Comma\n"; return true;
- case EOpFunction: out.debug << "Function Definition: " << node->getName(); break;
- case EOpFunctionCall: out.debug << "Function Call: " << node->getName(); break;
- case EOpParameters: out.debug << "Function Parameters: "; break;
-
- case EOpConstructFloat: out.debug << "Construct float"; break;
- case EOpConstructVec2: out.debug << "Construct vec2"; break;
- case EOpConstructVec3: out.debug << "Construct vec3"; break;
- case EOpConstructVec4: out.debug << "Construct vec4"; break;
- case EOpConstructBool: out.debug << "Construct bool"; break;
- case EOpConstructBVec2: out.debug << "Construct bvec2"; break;
- case EOpConstructBVec3: out.debug << "Construct bvec3"; break;
- case EOpConstructBVec4: out.debug << "Construct bvec4"; break;
- case EOpConstructInt: out.debug << "Construct int"; break;
- case EOpConstructIVec2: out.debug << "Construct ivec2"; break;
- case EOpConstructIVec3: out.debug << "Construct ivec3"; break;
- case EOpConstructIVec4: out.debug << "Construct ivec4"; break;
- case EOpConstructMat2: out.debug << "Construct mat2"; break;
- case EOpConstructMat3: out.debug << "Construct mat3"; break;
- case EOpConstructMat4: out.debug << "Construct mat4"; break;
- case EOpConstructStruct: out.debug << "Construct structure"; break;
-
- case EOpLessThan: out.debug << "Compare Less Than"; break;
- case EOpGreaterThan: out.debug << "Compare Greater Than"; break;
- case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break;
- case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break;
- case EOpVectorEqual: out.debug << "Equal"; break;
- case EOpVectorNotEqual: out.debug << "NotEqual"; break;
-
- case EOpMod: out.debug << "mod"; break;
- case EOpPow: out.debug << "pow"; break;
-
- case EOpAtan: out.debug << "arc tangent"; break;
-
- case EOpMin: out.debug << "min"; break;
- case EOpMax: out.debug << "max"; break;
- case EOpClamp: out.debug << "clamp"; break;
- case EOpMix: out.debug << "mix"; break;
- case EOpStep: out.debug << "step"; break;
- case EOpSmoothStep: out.debug << "smoothstep"; break;
-
- case EOpDistance: out.debug << "distance"; break;
- case EOpDot: out.debug << "dot-product"; break;
- case EOpCross: out.debug << "cross-product"; break;
- case EOpFaceForward: out.debug << "face-forward"; break;
- case EOpReflect: out.debug << "reflect"; break;
- case EOpRefract: out.debug << "refract"; break;
- case EOpMul: out.debug << "component-wise multiply"; break;
-
- case EOpItof: out.debug << "itof"; break;
- case EOpFtoi: out.debug << "ftoi"; break;
- case EOpSkipPixels: out.debug << "skipPixels"; break;
- case EOpReadInput: out.debug << "readInput"; break;
- case EOpWritePixel: out.debug << "writePixel"; break;
- case EOpBitmapLsb: out.debug << "bitmapLSB"; break;
- case EOpBitmapMsb: out.debug << "bitmapMSB"; break;
- case EOpWriteOutput: out.debug << "writeOutput"; break;
- case EOpReadPixel: out.debug << "readPixel"; break;
-
- default: out.debug.message(EPrefixError, "Bad aggregation op");
- }
-
- if (node->getOp() != EOpSequence && node->getOp() != EOpParameters)
- out.debug << " (" << node->getCompleteString() << ")";
-
- out.debug << "\n";
-
- return true;
-}
-
-bool OutputSelection(bool /* preVisit */, TIntermSelection* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- OutputTreeText(out, node, oit->depth);
-
- out.debug << "Test condition and select";
- out.debug << " (" << node->getCompleteString() << ")\n";
-
- ++oit->depth;
-
- OutputTreeText(oit->infoSink, node, oit->depth);
- out.debug << "Condition\n";
- node->getCondition()->traverse(it);
-
- OutputTreeText(oit->infoSink, node, oit->depth);
- if (node->getTrueBlock()) {
- out.debug << "true case\n";
- node->getTrueBlock()->traverse(it);
- } else
- out.debug << "true case is null\n";
-
- if (node->getFalseBlock()) {
- OutputTreeText(oit->infoSink, node, oit->depth);
- out.debug << "false case\n";
- node->getFalseBlock()->traverse(it);
- }
-
- --oit->depth;
-
- return false;
-}
-
-void OutputConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- int size = 0;
- if (node->getType().getBasicType() == EbtStruct)
- size = node->getType().getStructSize();
- else
- size = node->getType().getInstanceSize();
-
- for (int i = 0; i < size; i++) {
- OutputTreeText(out, node, oit->depth);
- switch (node->getType().getBasicType()) {
- case EbtBool:
- if (node->getUnionArrayPointer()[i].bConst)
- out.debug << "true";
- else
- out.debug << "false";
-
- out.debug << " (" << "const bool" << ")";
-
- out.debug << "\n";
- break;
- case EbtFloat:
- {
- char buf[300];
- sprintf(buf, "%f (%s)", node->getUnionArrayPointer()[i].fConst, "const float");
-
- out.debug << buf << "\n";
- }
- break;
- case EbtInt:
- {
- char buf[300];
- sprintf(buf, "%d (%s)", node->getUnionArrayPointer()[i].iConst, "const int");
-
- out.debug << buf << "\n";
- break;
- }
- default:
- out.info.message(EPrefixInternalError, "Unknown constant", node->getLine());
- break;
- }
- }
-}
-
-bool OutputLoop(bool /* preVisit */, TIntermLoop* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- OutputTreeText(out, node, oit->depth);
-
- out.debug << "Loop with condition ";
- if (! node->testFirst())
- out.debug << "not ";
- out.debug << "tested first\n";
-
- ++oit->depth;
-
- OutputTreeText(oit->infoSink, node, oit->depth);
- if (node->getTest()) {
- out.debug << "Loop Condition\n";
- node->getTest()->traverse(it);
- } else
- out.debug << "No loop condition\n";
-
- OutputTreeText(oit->infoSink, node, oit->depth);
- if (node->getBody()) {
- out.debug << "Loop Body\n";
- node->getBody()->traverse(it);
- } else
- out.debug << "No loop body\n";
-
- if (node->getTerminal()) {
- OutputTreeText(oit->infoSink, node, oit->depth);
- out.debug << "Loop Terminal Expression\n";
- node->getTerminal()->traverse(it);
- }
-
- --oit->depth;
-
- return false;
-}
-
-bool OutputBranch(bool /* previsit*/, TIntermBranch* node, TIntermTraverser* it)
-{
- TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
- TInfoSink& out = oit->infoSink;
-
- OutputTreeText(out, node, oit->depth);
-
- switch (node->getFlowOp()) {
- case EOpKill: out.debug << "Branch: Kill"; break;
- case EOpBreak: out.debug << "Branch: Break"; break;
- case EOpContinue: out.debug << "Branch: Continue"; break;
- case EOpReturn: out.debug << "Branch: Return"; break;
- default: out.debug << "Branch: Unknown Branch"; break;
- }
-
- if (node->getExpression()) {
- out.debug << " with expression\n";
- ++oit->depth;
- node->getExpression()->traverse(it);
- --oit->depth;
- } else
- out.debug << "\n";
-
- return false;
-}
-
-//
-// This function is the one to call externally to start the traversal.
-// Individual functions can be initialized to 0 to skip processing of that
-// type of node. It's children will still be processed.
-//
-void TIntermediate::outputTree(TIntermNode* root)
-{
- if (root == 0)
- return;
-
- TOutputTraverser it(infoSink);
-
- it.visitAggregate = OutputAggregate;
- it.visitBinary = OutputBinary;
- it.visitConstantUnion = OutputConstantUnion;
- it.visitSelection = OutputSelection;
- it.visitSymbol = OutputSymbol;
- it.visitUnary = OutputUnary;
- it.visitLoop = OutputLoop;
- it.visitBranch = OutputBranch;
-
- root->traverse(&it);
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/localintermediate.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/localintermediate.h
deleted file mode 100755
index 5b4e5ea11..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/localintermediate.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef _LOCAL_INTERMEDIATE_INCLUDED_
-#define _LOCAL_INTERMEDIATE_INCLUDED_
-
-#include "../Include/intermediate.h"
-#include "../Public/ShaderLang.h"
-#include "SymbolTable.h"
-
-struct TVectorFields {
- int offsets[4];
- int num;
-};
-
-//
-// Set of helper functions to help parse and build the tree.
-//
-class TInfoSink;
-class TIntermediate {
-public:
- POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
-
- TIntermediate(TInfoSink& i) : infoSink(i) { }
- TIntermSymbol* addSymbol(int Id, const TString&, const TType&, TSourceLoc);
- TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*);
- TIntermTyped* addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc, TSymbolTable&);
- TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc);
- TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, TSourceLoc);
- TIntermTyped* addUnaryMath(TOperator op, TIntermNode* child, TSourceLoc, TSymbolTable&);
- TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, TSourceLoc);
- TIntermAggregate* makeAggregate(TIntermNode* node, TSourceLoc);
- TIntermAggregate* setAggregateOperator(TIntermNode*, TOperator, TSourceLoc);
- TIntermNode* addSelection(TIntermTyped* cond, TIntermNodePair code, TSourceLoc);
- TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, TSourceLoc);
- TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc);
- TIntermConstantUnion* addConstantUnion(constUnion*, const TType&, TSourceLoc);
- TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) ;
- TIntermTyped* copyConstUnion(TIntermConstantUnion*) ;
- TIntermConstantUnion* changeAggrToTempConst(TIntermAggregate*, TSymbolTable&, TSourceLoc );
- bool parseConstTree(TSourceLoc, TIntermNode*, constUnion*, TOperator, TSymbolTable&, TType, bool singleConstantParam = false);
- TIntermNode* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, TSourceLoc);
- TIntermBranch* addBranch(TOperator, TSourceLoc);
- TIntermBranch* addBranch(TOperator, TIntermTyped*, TSourceLoc);
- TIntermTyped* addSwizzle(TVectorFields&, TSourceLoc);
- bool postProcess(TIntermNode*, EShLanguage);
- void remove(TIntermNode*);
- void outputTree(TIntermNode*);
- void removeChildNode(TIntermSequence&, TType&, int&, TIntermSequence::iterator&, TIntermAggregate*);
- TIntermTyped* removeChildNode(TIntermTyped*, TType*, TIntermAggregate*);
- bool removeMatrixConstNode(TIntermSequence&, TType&, TIntermAggregate*, int);
-
-protected:
- TInfoSink& infoSink;
-
-private:
- void operator=(TIntermediate&); // prevent assignments
-};
-
-#endif // _LOCAL_INTERMEDIATE_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/parseConst.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/parseConst.cpp
deleted file mode 100755
index 1ea91b3c5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/parseConst.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "ParseHelper.h"
-
-//
-// Use this class to carry along data from node to node in
-// the traversal
-//
-class TConstTraverser : public TIntermTraverser {
-public:
- TConstTraverser(constUnion* cUnion, bool singleConstParam, TOperator constructType, TInfoSink& sink, TSymbolTable& symTable, TType& t) : unionArray(cUnion), type(t),
- constructorType(constructType), singleConstantParam(singleConstParam), infoSink(sink), symbolTable(symTable), error(false), isMatrix(false), matrixSize(0) { index = 0; tOp = EOpNull;}
- int index ;
- constUnion *unionArray;
- TOperator tOp;
- TType type;
- TOperator constructorType;
- bool singleConstantParam;
- TInfoSink& infoSink;
- TSymbolTable& symbolTable;
- bool error;
- int size; // size of the constructor ( 4 for vec4)
- bool isMatrix;
- int matrixSize; // dimension of the matrix (nominal size and not the instance size)
-};
-
-//
-// The rest of the file are the traversal functions. The last one
-// is the one that starts the traversal.
-//
-// Return true from interior nodes to have the external traversal
-// continue on to children. If you process children yourself,
-// return false.
-//
-
-void ParseSymbol(TIntermSymbol* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
- TQualifier qualifier = node->getType().getQualifier();
- constUnion* unionArray = oit->unionArray;
- int instanceSize;
- if (oit->type.getBasicType() == EbtStruct)
- instanceSize = oit->type.getStructSize();
- else
- instanceSize = oit->type.getInstanceSize();
-
- if (oit->index >= instanceSize)
- return;
-
- if (qualifier != EvqConst) {
- char buf[200];
- sprintf(buf, "'constructor' : assigning non-constant to %s", oit->type.getCompleteString().c_str());
- oit->infoSink.info.message(EPrefixError, buf, node->getLine());
- oit->error = true;
- return ;
- }
- TSymbol* symbol = oit->symbolTable.find(node->getSymbol());
- TVariable* tVar = static_cast<TVariable*>(symbol);
-
- constUnion* constArray = tVar->getConstPointer();
- if (!constArray) {
- char buf[200];
- sprintf(buf, "'constructor' : constant '%s' has not been initialized correctly", node->getSymbol().c_str());
- oit->infoSink.info.message(EPrefixError, buf, node->getLine());
- oit->error = true;
- return;
- }
- int symbolSize;
-
- if (tVar->getType().getBasicType() == EbtStruct)
- symbolSize = tVar->getType().getStructSize();
- else
- symbolSize = tVar->getType().getInstanceSize();
-
- // for constructors such as ivec4(vec4), if vec4 is a symbol node, then the appropriate conversion is required as the
- // types do not match
- for (int i = 0; i < symbolSize; i++) {
- if (oit->index >= instanceSize)
- return;
- if (tVar->getType().getBasicType() == oit->type.getBasicType() || oit->type.getBasicType() == EbtStruct)
- (unionArray[oit->index]) = constArray[i];
- else {
- switch (tVar->getType().getBasicType()) {
- case EbtFloat:
- switch (oit->type.getBasicType()) {
- case EbtInt: unionArray[oit->index].iConst = static_cast<int> (constArray[i].fConst); break;
- case EbtBool: unionArray[oit->index].bConst = constArray[i].fConst != 0.0; break;
- default: oit->infoSink.info.message(EPrefixInternalError, "Incorrect type, cannot parse symbol", node->getLine()); break;
- }
- break;
- case EbtInt:
- switch (oit->type.getBasicType()) {
- case EbtFloat: unionArray[oit->index].fConst = static_cast<float>(constArray[i].iConst); break;
- case EbtBool: unionArray[oit->index].bConst = constArray[i].iConst != 0 ; break;
- default: oit->infoSink.info.message(EPrefixInternalError, "Incorrect type, cannot parse symbol", node->getLine()); break;
- }
- break;
- case EbtBool:
- switch (oit->type.getBasicType()) {
- case EbtFloat: unionArray[oit->index].fConst = static_cast<float>(constArray[i].bConst); break;
- case EbtInt: unionArray[oit->index].iConst = static_cast<int> (constArray[i].bConst); break;
- default: oit->infoSink.info.message(EPrefixInternalError, "Incorrect type, cannot parse symbol", node->getLine()); break;
- }
- break;
- default: oit->infoSink.info.message(EPrefixInternalError, "Incorrect type, cannot parse symbol", node->getLine()); break;
- }
- }
- (oit->index)++;
- }
-}
-
-bool ParseBinary(bool /* preVisit */, TIntermBinary* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
-
- TQualifier qualifier = node->getType().getQualifier();
-
- if (qualifier != EvqConst) {
- char buf[200];
- sprintf(buf, "'constructor' : assigning non-constant to %s", oit->type.getCompleteString().c_str());
- oit->infoSink.info.message(EPrefixError, buf, node->getLine());
- oit->error = true;
- return false;
- }
-
- oit->infoSink.info.message(EPrefixInternalError, "Binary Node found in constant constructor", node->getLine());
-
- return false;
-}
-
-bool ParseUnary(bool /* preVisit */, TIntermUnary* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
-
- char buf[200];
- sprintf(buf, "'constructor' : assigning non-constant to '%s'", oit->type.getCompleteString().c_str());
- oit->infoSink.info.message(EPrefixError, buf, node->getLine());
- oit->error = true;
- return false;
-}
-
-bool ParseAggregate(bool /* preVisit */, TIntermAggregate* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
-
- if (!node->isConstructor() && node->getOp() != EOpComma) {
- char buf[200];
- sprintf(buf, "'constructor' : assigning non-constant to '%s'", oit->type.getCompleteString().c_str());
- oit->infoSink.info.message(EPrefixError, buf, node->getLine());
- oit->error = true;
- return false;
- }
-
- if (node->getSequence().size() == 0) {
- oit->error = true;
- return false;
- }
-
- bool flag = node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion();
- if (flag)
- {
- oit->singleConstantParam = true;
- oit->constructorType = node->getOp();
- if (node->getType().getBasicType() == EbtStruct)
- oit->size = node->getType().getStructSize();
- else
- oit->size = node->getType().getInstanceSize();
- if (node->getType().isMatrix()) {
- oit->isMatrix = true;
- oit->matrixSize = node->getType().getNominalSize();
- }
- }
-
- for (TIntermSequence::iterator p = node->getSequence().begin();
- p != node->getSequence().end(); p++) {
-
- if (node->getOp() == EOpComma)
- oit->index = 0;
-
- (*p)->traverse(oit);
- }
- if (flag)
- {
- oit->singleConstantParam = false;
- oit->constructorType = EOpNull;
- oit->size = 0;
- oit->isMatrix = false;
- oit->matrixSize = 0;
- }
- return false;
-}
-
-bool ParseSelection(bool /* preVisit */, TIntermSelection* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
- oit->infoSink.info.message(EPrefixInternalError, "Selection Node found in constant constructor", node->getLine());
- oit->error = true;
- return false;
-}
-
-void ParseConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
- constUnion* leftUnionArray = oit->unionArray;
- int instanceSize;
- if (oit->type.getBasicType() == EbtStruct)
- instanceSize = oit->type.getStructSize();
- else
- instanceSize = oit->type.getInstanceSize();
-
- if (oit->index >= instanceSize)
- return;
-
- if (!oit->singleConstantParam) {
- int size;
- if (node->getType().getBasicType() == EbtStruct)
- size = node->getType().getStructSize();
- else
- size = node->getType().getInstanceSize();
-
- constUnion *rightUnionArray = node->getUnionArrayPointer();
- for (int i=0; i < size; i++) {
- if (oit->index >= instanceSize)
- return;
- leftUnionArray[oit->index] = rightUnionArray[i];
-
- (oit->index)++;
- }
- } else {
- int size, totalSize, matrixSize;
- bool isMatrix = false;
- size = oit->size;
- matrixSize = oit->matrixSize;
- isMatrix = oit->isMatrix;
- totalSize = oit->index + size ;
- constUnion *rightUnionArray = node->getUnionArrayPointer();
- if (!isMatrix) {
- int count = 0;
- for (int i = oit->index; i < totalSize; i++) {
- if (i >= instanceSize)
- return;
-
- leftUnionArray[i] = rightUnionArray[count];
-
- (oit->index)++;
- if (node->getType().getBasicType() == EbtStruct && node->getType().getStructSize() > 1 ||
- node->getType().getBasicType() != EbtStruct && node->getType().getInstanceSize() > 1)
- count++;
- }
- } else { // for matrix constructors
- int count = 0;
- int index = oit->index;
- for (int i = index; i < totalSize; i++) {
- if (i >= instanceSize)
- return;
- if (index - i == 0 || (i - index) % (matrixSize + 1) == 0 )
- leftUnionArray[i] = rightUnionArray[count];
- else
- leftUnionArray[i].fConst = 0.0;
-
- (oit->index)++;
- if (node->getType().getBasicType() == EbtStruct && node->getType().getStructSize() > 1 ||
- node->getType().getBasicType() != EbtStruct && node->getType().getInstanceSize() > 1)
- count++;
- }
- }
- }
-}
-
-bool ParseLoop(bool /* preVisit */, TIntermLoop* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
- oit->infoSink.info.message(EPrefixInternalError, "Loop Node found in constant constructor", node->getLine());
- oit->error = true;
- return false;
-}
-
-bool ParseBranch(bool /* previsit*/, TIntermBranch* node, TIntermTraverser* it)
-{
- TConstTraverser* oit = static_cast<TConstTraverser*>(it);
- oit->infoSink.info.message(EPrefixInternalError, "Branch Node found in constant constructor", node->getLine());
- oit->error = true;
- return false;
-}
-
-//
-// This function is the one to call externally to start the traversal.
-// Individual functions can be initialized to 0 to skip processing of that
-// type of node. It's children will still be processed.
-//
-bool TIntermediate::parseConstTree(TSourceLoc line, TIntermNode* root, constUnion* unionArray, TOperator constructorType, TSymbolTable& symbolTable, TType t, bool singleConstantParam)
-{
- if (root == 0)
- return false;
-
- TConstTraverser it(unionArray, singleConstantParam, constructorType, infoSink, symbolTable, t);
-
- it.visitAggregate = ParseAggregate;
- it.visitBinary = ParseBinary;
- it.visitConstantUnion = ParseConstantUnion;
- it.visitSelection = ParseSelection;
- it.visitSymbol = ParseSymbol;
- it.visitUnary = ParseUnary;
- it.visitLoop = ParseLoop;
- it.visitBranch = ParseBranch;
-
- root->traverse(&it);
- if (it.error)
- return true;
- else
- return false;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.c
deleted file mode 100755
index b409c99bb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.c
+++ /dev/null
@@ -1,768 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-
-/* */
-/* atom.c */
-/* */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "slglobals.h"
-
-#undef malloc
-#undef realloc
-#undef free
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*//////////////////////////////////////// String table: ////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-static const struct {
- int val;
- const char *str;
-} tokens[] = {
- { CPP_AND_OP, "&&" },
- { CPP_AND_ASSIGN, "&=" },
- { CPP_SUB_ASSIGN, "-=" },
- { CPP_MOD_ASSIGN, "%=" },
- { CPP_ADD_ASSIGN, "+=" },
- { CPP_DIV_ASSIGN, "/=" },
- { CPP_MUL_ASSIGN, "*=" },
- { CPP_RIGHT_BRACKET, ":>" },
- { CPP_EQ_OP, "==" },
- { CPP_XOR_OP, "^^" },
- { CPP_XOR_ASSIGN, "^=" },
- { CPP_FLOATCONSTANT, "<float-const>" },
- { CPP_GE_OP, ">=" },
- { CPP_RIGHT_OP, ">>" },
- { CPP_RIGHT_ASSIGN, ">>=" },
- { CPP_IDENTIFIER, "<ident>" },
- { CPP_INTCONSTANT, "<int-const>" },
- { CPP_LE_OP, "<=" },
- { CPP_LEFT_OP, "<<" },
- { CPP_LEFT_ASSIGN, "<<=" },
- { CPP_LEFT_BRACKET, "<:" },
- { CPP_LEFT_BRACE, "<%" },
- { CPP_DEC_OP, "--" },
- { CPP_RIGHT_BRACE, "%>" },
- { CPP_NE_OP, "!=" },
- { CPP_OR_OP, "||" },
- { CPP_OR_ASSIGN, "|=" },
- { CPP_INC_OP, "++" },
- { CPP_STRCONSTANT, "<string-const>" },
- { CPP_TYPEIDENTIFIER, "<type-ident>" },
-};
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*//////////////////////////////////////// String table: ////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-#define INIT_STRING_TABLE_SIZE 16384
-
-typedef struct StringTable_Rec {
- char *strings;
- int nextFree;
- int size;
-} StringTable;
-
-/*
- * InitStringTable() - Initialize the string table.
- *
- */
-
-static int InitStringTable(StringTable *stable)
-{
- stable->strings = (char *) malloc(INIT_STRING_TABLE_SIZE);
- if (!stable->strings)
- return 0;
- /* Zero-th offset means "empty" so don't use it. */
- stable->nextFree = 1;
- stable->size = INIT_STRING_TABLE_SIZE;
- return 1;
-} /* InitStringTable */
-
-/*
- * FreeStringTable() - Free the string table.
- *
- */
-
-static void FreeStringTable(StringTable *stable)
-{
- if (stable->strings)
- free(stable->strings);
- stable->strings = NULL;
- stable->nextFree = 0;
- stable->size = 0;
-} /* FreeStringTable */
-
-/*
- * HashString() - Hash a string with the base hash function.
- *
- */
-
-static int HashString(const char *s)
-{
- int hval = 0;
-
- while (*s) {
- hval = (hval*13507 + *s*197) ^ (hval >> 2);
- s++;
- }
- return hval & 0x7fffffff;
-} /* HashString */
-
-/*
- * HashString2() - Hash a string with the incrimenting hash function.
- *
- */
-
-static int HashString2(const char *s)
-{
- int hval = 0;
-
- while (*s) {
- hval = (hval*729 + *s*37) ^ (hval >> 1);
- s++;
- }
- return hval;
-} /* HashString2 */
-
-/*
- * AddString() - Add a string to a string table. Return it's offset.
- *
- */
-
-static int AddString(StringTable *stable, const char *s)
-{
- int len, loc;
- char *str;
-
- len = (int) strlen(s);
- if (stable->nextFree + len + 1 >= stable->size) {
- assert(stable->size < 1000000);
- str = (char *) malloc(stable->size*2);
- memcpy(str, stable->strings, stable->size);
- free(stable->strings);
- stable->strings = str;
- }
- loc = stable->nextFree;
- strcpy(&stable->strings[loc], s);
- stable->nextFree += len + 1;
- return loc;
-} /* AddString */
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*///////////////////////////////////////// Hash table: /////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-#define INIT_HASH_TABLE_SIZE 2047
-#define HASH_TABLE_MAX_COLLISIONS 3
-
-typedef struct HashEntry_Rec {
- int index; /* String table offset of string representation */
- int value; /* Atom (symbol) value */
-} HashEntry;
-
-typedef struct HashTable_Rec {
- HashEntry *entry;
- int size;
- int entries;
- int counts[HASH_TABLE_MAX_COLLISIONS + 1];
-} HashTable;
-
-/*
- * InitHashTable() - Initialize the hash table.
- *
- */
-
-static int InitHashTable(HashTable *htable, int fsize)
-{
- int ii;
-
- htable->entry = (HashEntry *) malloc(sizeof(HashEntry)*fsize);
- if (!htable->entry)
- return 0;
- htable->size = fsize;
- for (ii = 0; ii < fsize; ii++) {
- htable->entry[ii].index = 0;
- htable->entry[ii].value = 0;
- }
- htable->entries = 0;
- for (ii = 0; ii <= HASH_TABLE_MAX_COLLISIONS; ii++)
- htable->counts[ii] = 0;
- return 1;
-} /* InitHashTable */
-
-/*
- * FreeHashTable() - Free the hash table.
- *
- */
-
-static void FreeHashTable(HashTable *htable)
-{
- if (htable->entry)
- free(htable->entry);
- htable->entry = NULL;
- htable->size = 0;
- htable->entries = 0;
-} /* FreeHashTable */
-
-/*
- * Empty() - See if a hash table entry is empty.
- *
- */
-
-static int Empty(HashTable *htable, int hashloc)
-{
- assert(hashloc >= 0 && hashloc < htable->size);
- if (htable->entry[hashloc].index == 0) {
- return 1;
- } else {
- return 0;
- }
-} /* Empty */
-
-/*
- * Match() - See if a hash table entry is matches a string.
- *
- */
-
-static int Match(HashTable *htable, StringTable *stable, const char *s, int hashloc)
-{
- int strloc;
-
- strloc = htable->entry[hashloc].index;
- if (!strcmp(s, &stable->strings[strloc])) {
- return 1;
- } else {
- return 0;
- }
-} /* Match */
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*///////////////////////////////////////// Atom table: /////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-#define INIT_ATOM_TABLE_SIZE 1024
-
-
-struct AtomTable_Rec {
- StringTable stable; /* String table. */
- HashTable htable; /* Hashes string to atom number and token value. Multiple strings can */
- /* have the same token value but each unique string is a unique atom. */
- int *amap; /* Maps atom value to offset in string table. Atoms all map to unique */
- /* strings except for some undefined values in the lower, fixed part */
- /* of the atom table that map to "<undefined>". The lowest 256 atoms */
- /* correspond to single character ASCII values except for alphanumeric */
- /* characters and '_', which can be other tokens. Next come the */
- /* language tokens with their atom values equal to the token value. */
- /* Then come predefined atoms, followed by user specified identifiers. */
- int *arev; /* Reversed atom for symbol table use. */
- int nextFree;
- int size;
-};
-
-static AtomTable latable = { { 0 } };
-AtomTable *atable = &latable;
-
-static int AddAtomFixed(AtomTable *atable, const char *s, int atom);
-
-/*
- * GrowAtomTable() - Grow the atom table to at least "size" if it's smaller.
- *
- */
-
-static int GrowAtomTable(AtomTable *atable, int size)
-{
- int *newmap, *newrev;
-
- if (atable->size < size) {
- if (atable->amap) {
- newmap = realloc(atable->amap, sizeof(int)*size);
- newrev = realloc(atable->arev, sizeof(int)*size);
- } else {
- newmap = malloc(sizeof(int)*size);
- newrev = malloc(sizeof(int)*size);
- atable->size = 0;
- }
- if (!newmap || !newrev) {
- /* failed to grow -- error */
- if (newmap)
- atable->amap = newmap;
- if (newrev)
- atable->amap = newrev;
- return -1;
- }
- memset(&newmap[atable->size], 0, (size - atable->size) * sizeof(int));
- memset(&newrev[atable->size], 0, (size - atable->size) * sizeof(int));
- atable->amap = newmap;
- atable->arev = newrev;
- atable->size = size;
- }
- return 0;
-} /* GrowAtomTable */
-
-/*
- * lReverse() - Reverse the bottom 20 bits of a 32 bit int.
- *
- */
-
-static int lReverse(int fval)
-{
- unsigned int in = fval;
- int result = 0, cnt = 0;
-
- while(in) {
- result <<= 1;
- result |= in&1;
- in >>= 1;
- cnt++;
- }
-
- /* Don't use all 31 bits. One million atoms is plenty and sometimes the */
- /* upper bits are used for other things. */
-
- if (cnt < 20)
- result <<= 20 - cnt;
- return result;
-} /* lReverse */
-
-/*
- * AllocateAtom() - Allocate a new atom. Associated with the "undefined" value of -1.
- *
- */
-
-static int AllocateAtom(AtomTable *atable)
-{
- if (atable->nextFree >= atable->size)
- GrowAtomTable(atable, atable->nextFree*2);
- atable->amap[atable->nextFree] = -1;
- atable->arev[atable->nextFree] = lReverse(atable->nextFree);
- atable->nextFree++;
- return atable->nextFree - 1;
-} /* AllocateAtom */
-
-/*
- * SetAtomValue() - Allocate a new atom associated with "hashindex".
- *
- */
-
-static void SetAtomValue(AtomTable *atable, int atomnumber, int hashindex)
-{
- atable->amap[atomnumber] = atable->htable.entry[hashindex].index;
- atable->htable.entry[hashindex].value = atomnumber;
-} /* SetAtomValue */
-
-/*
- * FindHashLoc() - Find the hash location for this string. Return -1 it hash table is full.
- *
- */
-
-static int FindHashLoc(AtomTable *atable, const char *s)
-{
- int hashloc, hashdelta, count;
- int FoundEmptySlot = 0;
- int collision[HASH_TABLE_MAX_COLLISIONS + 1];
-
- hashloc = HashString(s) % atable->htable.size;
- if (!Empty(&atable->htable, hashloc)) {
- if (Match(&atable->htable, &atable->stable, s, hashloc))
- return hashloc;
- collision[0] = hashloc;
- hashdelta = HashString2(s);
- count = 0;
- while (count < HASH_TABLE_MAX_COLLISIONS) {
- hashloc = ((hashloc + hashdelta) & 0x7fffffff) % atable->htable.size;
- if (!Empty(&atable->htable, hashloc)) {
- if (Match(&atable->htable, &atable->stable, s, hashloc)) {
- return hashloc;
- }
- } else {
- FoundEmptySlot = 1;
- break;
- }
- count++;
- collision[count] = hashloc;
- }
-
- if (!FoundEmptySlot) {
- if (cpp->options.DumpAtomTable) {
- int ii;
- char str[200];
- sprintf(str, "*** Hash failed with more than %d collisions. Must increase hash table size. ***",
- HASH_TABLE_MAX_COLLISIONS);
- CPPShInfoLogMsg(str);
-
- sprintf(str, "*** New string \"%s\", hash=%04x, delta=%04x", s, collision[0], hashdelta);
- CPPShInfoLogMsg(str);
- for (ii = 0; ii <= HASH_TABLE_MAX_COLLISIONS; ii++) {
- sprintf(str, "*** Collides on try %d at hash entry %04x with \"%s\"",
- ii + 1, collision[ii], GetAtomString(atable, atable->htable.entry[collision[ii]].value));
- CPPShInfoLogMsg(str);
- }
- }
- return -1;
- } else {
- atable->htable.counts[count]++;
- }
- }
- return hashloc;
-} /* FindHashLoc */
-
-/*
- * IncreaseHashTableSize()
- *
- */
-
-static int IncreaseHashTableSize(AtomTable *atable)
-{
- int ii, strloc, oldhashloc, value, size;
- AtomTable oldtable;
- char *s;
-
- /* Save the old atom table and create a new one: */
-
- oldtable = *atable;
- size = oldtable.htable.size*2 + 1;
- if (!InitAtomTable(atable, size))
- return 0;
-
- /* Add all the existing values to the new atom table preserving their atom values: */
-
- for (ii = atable->nextFree; ii < oldtable.nextFree; ii++) {
- strloc = oldtable.amap[ii];
- s = &oldtable.stable.strings[strloc];
- oldhashloc = FindHashLoc(&oldtable, s);
- assert(oldhashloc >= 0);
- value = oldtable.htable.entry[oldhashloc].value;
- AddAtomFixed(atable, s, value);
- }
- FreeAtomTable(&oldtable);
- return 1;
-} /* IncreaseHashTableSize */
-
-/*
- * LookUpAddStringHash() - Lookup a string in the hash table. If it's not there, add it and
- * initialize the atom value in the hash table to 0. Return the hash table index.
- */
-
-static int LookUpAddStringHash(AtomTable *atable, const char *s)
-{
- int hashloc, strloc;
-
- while(1) {
- hashloc = FindHashLoc(atable, s);
- if (hashloc >= 0)
- break;
- IncreaseHashTableSize(atable);
- }
-
- if (Empty(&atable->htable, hashloc)) {
- atable->htable.entries++;
- strloc = AddString(&atable->stable, s);
- atable->htable.entry[hashloc].index = strloc;
- atable->htable.entry[hashloc].value = 0;
- }
- return hashloc;
-} /* LookUpAddStringHash */
-
-/*
- * LookUpAddString() - Lookup a string in the hash table. If it's not there, add it and
- * initialize the atom value in the hash table to the next atom number.
- * Return the atom value of string.
- */
-
-int LookUpAddString(AtomTable *atable, const char *s)
-{
- int hashindex, atom;
-
- hashindex = LookUpAddStringHash(atable, s);
- atom = atable->htable.entry[hashindex].value;
- if (atom == 0) {
- atom = AllocateAtom(atable);
- SetAtomValue(atable, atom, hashindex);
- }
- return atom;
-} /* LookUpAddString */
-
-/*
- * GetAtomString()
- *
- */
-
-const char *GetAtomString(AtomTable *atable, int atom)
-{
- int soffset;
-
- if (atom > 0 && atom < atable->nextFree) {
- soffset = atable->amap[atom];
- if (soffset > 0 && soffset < atable->stable.nextFree) {
- return &atable->stable.strings[soffset];
- } else {
- return "<internal error: bad soffset>";
- }
- } else {
- if (atom == 0) {
- return "<null atom>";
- } else {
- if (atom == EOF) {
- return "<EOF>";
- } else {
- return "<invalid atom>";
- }
- }
- }
-} /* GetAtomString */
-
-/*
- * GetReversedAtom()
- *
- */
-
-int GetReversedAtom(AtomTable *atable, int atom)
-{
- if (atom > 0 && atom < atable->nextFree) {
- return atable->arev[atom];
- } else {
- return 0;
- }
-} /* GetReversedAtom */
-
-/*
- * AddAtom() - Add a string to the atom, hash and string tables if it isn't already there.
- * Return it's atom index.
- */
-
-int AddAtom(AtomTable *atable, const char *s)
-{
- int atom;
-
- atom = LookUpAddString(atable, s);
- return atom;
-} /* AddAtom */
-
-/*
- * AddAtomFixed() - Add an atom to the hash and string tables if it isn't already there.
- * Assign it the atom value of "atom".
- */
-
-static int AddAtomFixed(AtomTable *atable, const char *s, int atom)
-{
- int hashindex, lsize;
-
- hashindex = LookUpAddStringHash(atable, s);
- if (atable->nextFree >= atable->size || atom >= atable->size) {
- lsize = atable->size*2;
- if (lsize <= atom)
- lsize = atom + 1;
- GrowAtomTable(atable, lsize);
- }
- atable->amap[atom] = atable->htable.entry[hashindex].index;
- atable->htable.entry[hashindex].value = atom;
- /*if (atom >= atable->nextFree) */
- /* atable->nextFree = atom + 1; */
- while (atom >= atable->nextFree) {
- atable->arev[atable->nextFree] = lReverse(atable->nextFree);
- atable->nextFree++;
- }
- return atom;
-} /* AddAtomFixed */
-
-/*
- * InitAtomTable() - Initialize the atom table.
- *
- */
-
-int InitAtomTable(AtomTable *atable, int htsize)
-{
- int ii;
-
- htsize = htsize <= 0 ? INIT_HASH_TABLE_SIZE : htsize;
- if (!InitStringTable(&atable->stable))
- return 0;
- if (!InitHashTable(&atable->htable, htsize))
- return 0;
-
- atable->nextFree = 0;
- atable->amap = NULL;
- atable->size = 0;
- GrowAtomTable(atable, INIT_ATOM_TABLE_SIZE);
- if (!atable->amap)
- return 0;
-
- /* Initialize lower part of atom table to "<undefined>" atom: */
-
- AddAtomFixed(atable, "<undefined>", 0);
- for (ii = 0; ii < FIRST_USER_TOKEN_SY; ii++)
- atable->amap[ii] = atable->amap[0];
-
- /* Add single character tokens to the atom table: */
-
- {
- const char *s = "~!%^&*()-+=|,.<>/?;:[]{}#";
- char t[2];
-
- t[1] = '\0';
- while (*s) {
- t[0] = *s;
- AddAtomFixed(atable, t, s[0]);
- s++;
- }
- }
-
- /* Add multiple character scanner tokens : */
-
- for (ii = 0; ii < sizeof(tokens)/sizeof(tokens[0]); ii++)
- AddAtomFixed(atable, tokens[ii].str, tokens[ii].val);
-
- /* Add error symbol if running in error mode: */
-
- if (cpp->options.ErrorMode)
- AddAtomFixed(atable, "error", ERROR_SY);
-
- AddAtom(atable, "<*** end fixed atoms ***>");
-
- return 1;
-} /* InitAtomTable */
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*//////////////////////////////// Debug Printing Functions: ////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-/*
- * PrintAtomTable()
- *
- */
-
-void PrintAtomTable(AtomTable *atable)
-{
- int ii;
- char str[200];
-
- for (ii = 0; ii < atable->nextFree; ii++) {
- sprintf(str, "%d: \"%s\"", ii, &atable->stable.strings[atable->amap[ii]]);
- CPPDebugLogMsg(str);
- }
- sprintf(str, "Hash table: size=%d, entries=%d, collisions=",
- atable->htable.size, atable->htable.entries);
- CPPDebugLogMsg(str);
- for (ii = 0; ii < HASH_TABLE_MAX_COLLISIONS; ii++) {
- sprintf(str, " %d", atable->htable.counts[ii]);
- CPPDebugLogMsg(str);
- }
-
-} /* PrintAtomTable */
-
-
-/*
- * GetStringOfAtom()
- *
- */
-
-char* GetStringOfAtom(AtomTable *atable, int atom)
-{
- char* chr_str;
- chr_str=&atable->stable.strings[atable->amap[atom]];
- return chr_str;
-} /* GetStringOfAtom */
-
-/*
- * FreeAtomTable() - Free the atom table and associated memory
- *
- */
-
-void FreeAtomTable(AtomTable *atable)
-{
- FreeStringTable(&atable->stable);
- FreeHashTable(&atable->htable);
- if (atable->amap)
- free(atable->amap);
- if (atable->arev)
- free(atable->arev);
- atable->amap = NULL;
- atable->arev = NULL;
- atable->nextFree = 0;
- atable->size = 0;
-} /* FreeAtomTable */
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*/////////////////////////////////////// End of atom.c /////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.h
deleted file mode 100755
index 4e509d6ba..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/atom.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* atom.h */
-/* */
-
-#if !defined(__ATOM_H)
-#define __ATOM_H 1
-
-typedef struct AtomTable_Rec AtomTable;
-
-extern AtomTable *atable;
-
-int InitAtomTable(AtomTable *atable, int htsize);
-void FreeAtomTable(AtomTable *atable);
-int AddAtom(AtomTable *atable, const char *s);
-void PrintAtomTable(AtomTable *atable);
-int LookUpAddString(AtomTable *atable, const char *s);
-const char *GetAtomString(AtomTable *atable, int atom);
-int GetReversedAtom(AtomTable *atable, int atom);
-char* GetStringOfAtom(AtomTable *atable, int atom);
-#endif /* !defined(__ATOM_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/compile.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/compile.h
deleted file mode 100755
index 24673461e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/compile.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* compile.h */
-/* */
-
-#if !defined(__COMPILE_H)
-#define __COMPILE_H 1
-
-int InitCPPStruct(void);
-
-typedef struct Options_Rec{
- const char *profileString;
- int ErrorMode;
- int Quiet;
-
- /* Debug The Compiler options: */
- int DumpAtomTable;
-} Options;
-
-struct CPPStruct_Rec {
- /* Public members */
- SourceLoc *pLastSourceLoc; /* Set at the start of each statement by the tree walkers */
- Options options; /* Compile options and parameters */
-
- /* Private members */
- SourceLoc lastSourceLoc;
-
- /* Scanner data: */
-
- SourceLoc *tokenLoc; /* Source location of most recent token seen by the scanner */
- int mostRecentToken; /* Most recent token seen by the scanner */
- InputSrc *currentInput;
- int previous_token;
- int notAVersionToken; /* used to make sure that #version is the first token seen in the file, if present */
-
- void *pC; /* storing the parseContext of the compile object in cpp. */
-
- /* Private members: */
- SourceLoc ltokenLoc;
- int ifdepth; /*current #if-#else-#endif nesting in the cpp.c file (pre-processor) */
- int elsedepth[64]; /*Keep a track of #if depth..Max allowed is 64. */
- int elsetracker; /*#if-#else and #endif constructs...Counter. */
- const char *ErrMsg;
- int CompileError; /*Indicate compile error when #error, #else,#elif mismatch. */
-
- /* */
- /* Globals used to communicate between PaParseStrings() and yy_input()and */
- /* also across the files.(gen_glslang.cpp and scanner.c) */
- /* */
- int PaWhichStr; /* which string we're parsing */
- int* PaStrLen; /* array of lengths of the PaArgv strings */
- int PaArgc; /* count of strings in the array */
- char** PaArgv; /* our array of strings to parse */
- unsigned int tokensBeforeEOF : 1;
-};
-
-#endif /* !defined(__COMPILE_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c
deleted file mode 100755
index f8da59b38..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.c
+++ /dev/null
@@ -1,1037 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* cpp.c */
-/* */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "slglobals.h"
-
-static int CPPif(yystypepp * yylvalpp);
-
-/* Don't use memory.c's replacements, as we clean up properly here */
-#undef malloc
-#undef free
-
-static int bindAtom = 0;
-static int constAtom = 0;
-static int defaultAtom = 0;
-static int defineAtom = 0;
-static int definedAtom = 0;
-static int elseAtom = 0;
-static int elifAtom = 0;
-static int endifAtom = 0;
-static int ifAtom = 0;
-static int ifdefAtom = 0;
-static int ifndefAtom = 0;
-static int includeAtom = 0;
-static int lineAtom = 0;
-static int pragmaAtom = 0;
-static int texunitAtom = 0;
-static int undefAtom = 0;
-static int errorAtom = 0;
-static int __LINE__Atom = 0;
-static int __FILE__Atom = 0;
-static int __VERSION__Atom = 0;
-static int versionAtom = 0;
-static int extensionAtom = 0;
-
-static Scope *macros = 0;
-#define MAX_MACRO_ARGS 64
-#define MAX_IF_NESTING 64
-
-static SourceLoc ifloc; /* outermost #if */
-
-int InitCPP(void)
-{
- char buffer[64], *t;
- const char *f;
- /* Add various atoms needed by the CPP line scanner: */
- bindAtom = LookUpAddString(atable, "bind");
- constAtom = LookUpAddString(atable, "const");
- defaultAtom = LookUpAddString(atable, "default");
- defineAtom = LookUpAddString(atable, "define");
- definedAtom = LookUpAddString(atable, "defined");
- elifAtom = LookUpAddString(atable, "elif");
- elseAtom = LookUpAddString(atable, "else");
- endifAtom = LookUpAddString(atable, "endif");
- ifAtom = LookUpAddString(atable, "if");
- ifdefAtom = LookUpAddString(atable, "ifdef");
- ifndefAtom = LookUpAddString(atable, "ifndef");
- includeAtom = LookUpAddString(atable, "include");
- lineAtom = LookUpAddString(atable, "line");
- pragmaAtom = LookUpAddString(atable, "pragma");
- texunitAtom = LookUpAddString(atable, "texunit");
- undefAtom = LookUpAddString(atable, "undef");
- errorAtom = LookUpAddString(atable, "error");
- __LINE__Atom = LookUpAddString(atable, "__LINE__");
- __FILE__Atom = LookUpAddString(atable, "__FILE__");
- __VERSION__Atom = LookUpAddString(atable, "__VERSION__");
- versionAtom = LookUpAddString(atable, "version");
- extensionAtom = LookUpAddString(atable, "extension");
- macros = NewScopeInPool(mem_CreatePool(0, 0));
- strcpy(buffer, "PROFILE_");
- t = buffer + strlen(buffer);
- f = cpp->options.profileString;
- while ((isalnum(*f) || *f == '_') && t < buffer + sizeof(buffer) - 1)
- *t++ = toupper(*f++);
- *t = 0;
- return 1;
-} /* InitCPP */
-
-int FreeCPP(void)
-{
- if (macros)
- {
- mem_FreePool(macros->pool);
- macros = 0;
- }
-
- return 1;
-}
-
-int FinalCPP(void)
-{
- if (cpp->ifdepth)
- CPPErrorToInfoLog("#if mismatch");
- return 1;
-}
-
-static int CPPdefine(yystypepp * yylvalpp)
-{
- int token, name, args[MAX_MACRO_ARGS], argc;
- const char *message;
- MacroSymbol mac;
- Symbol *symb;
- SourceLoc dummyLoc;
- memset(&mac, 0, sizeof(mac));
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != CPP_IDENTIFIER) {
- CPPErrorToInfoLog("#define");
- return token;
- }
- name = yylvalpp->sc_ident;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token == '(' && !yylvalpp->sc_int) {
- /* gather arguments */
- argc = 0;
- do {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (argc == 0 && token == ')') break;
- if (token != CPP_IDENTIFIER) {
- CPPErrorToInfoLog("#define");
- return token;
- }
- if (argc < MAX_MACRO_ARGS)
- args[argc++] = yylvalpp->sc_ident;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- } while (token == ',');
- if (token != ')') {
- CPPErrorToInfoLog("#define");
- return token;
- }
- mac.argc = argc;
- mac.args = mem_Alloc(macros->pool, argc * sizeof(int));
- memcpy(mac.args, args, argc * sizeof(int));
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- mac.body = NewTokenStream(GetAtomString(atable, name));
- while (token != '\n') {
- while (token == '\\') {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token == '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- else
- RecordToken(mac.body, '\\', yylvalpp);
- }
- RecordToken(mac.body, token, yylvalpp);
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- };
-
- symb = LookUpSymbol(macros, name);
- if (symb) {
- if (!symb->details.mac.undef) {
- /* already defined -- need to make sure they are identical */
- if (symb->details.mac.argc != mac.argc) goto error;
- for (argc=0; argc < mac.argc; argc++)
- if (symb->details.mac.args[argc] != mac.args[argc])
- goto error;
- RewindTokenStream(symb->details.mac.body);
- RewindTokenStream(mac.body);
- do {
- int old_lval, old_token;
- old_token = ReadToken(symb->details.mac.body, yylvalpp);
- old_lval = yylvalpp->sc_int;
- token = ReadToken(mac.body, yylvalpp);
- if (token != old_token || yylvalpp->sc_int != old_lval) {
- error:
- StoreStr("Macro Redefined");
- StoreStr(GetStringOfAtom(atable,name));
- message=GetStrfromTStr();
- DecLineNumber();
- CPPShInfoLogMsg(message);
- IncLineNumber();
- ResetTString();
- break; }
- } while (token > 0);
- }
- FreeMacro(&symb->details.mac);
- } else {
- dummyLoc.file = 0;
- dummyLoc.line = 0;
- symb = AddSymbol(&dummyLoc, macros, name, MACRO_S);
- }
- symb->details.mac = mac;
- return '\n';
-} /* CPPdefine */
-
-static int CPPundef(yystypepp * yylvalpp)
-{
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- Symbol *symb;
- if(token == '\n'){
- CPPErrorToInfoLog("#undef");
- return token;
- }
- if (token != CPP_IDENTIFIER)
- goto error;
- symb = LookUpSymbol(macros, yylvalpp->sc_ident);
- if (symb) {
- symb->details.mac.undef = 1;
- }
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != '\n') {
- error:
- CPPErrorToInfoLog("#undef");
- }
- return token;
-} /* CPPundef */
-
-/* CPPelse -- skip forward to appropriate spot. This is actually used
-** to skip to and #endif after seeing an #else, AND to skip to a #else,
-** #elif, or #endif after a #if/#ifdef/#ifndef/#elif test was false
-*/
-
-static int CPPelse(int matchelse, yystypepp * yylvalpp)
-{
- int atom,depth=0;
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- while (token > 0) {
- if (token != '#') {
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- continue;
- }
- if ((token = cpp->currentInput->scan(cpp->currentInput, yylvalpp)) != CPP_IDENTIFIER)
- continue;
- atom = yylvalpp->sc_ident;
- if (atom == ifAtom || atom == ifdefAtom || atom == ifndefAtom){
- depth++; cpp->ifdepth++; cpp->elsetracker++;
- }
- else if (atom == endifAtom) {
- if(--depth<=0){
- cpp->elsedepth[cpp->elsetracker]=0;
- --cpp->elsetracker;
- if (cpp->ifdepth)
- --cpp->ifdepth;
- break;
- }
- --cpp->elsetracker;
- --cpp->ifdepth;
- }
- else if (((int)(matchelse) != 0)&& depth==0) {
- if (atom == elseAtom ) {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != '\n') {
- CPPWarningToInfoLog("unexpected tokens following #else preprocessor directive - expected a newline");
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- break;
- }
- else if (atom == elifAtom) {
- /* we decrement cpp->ifdepth here, because CPPif will increment
- * it and we really want to leave it alone */
- if (cpp->ifdepth){
- --cpp->ifdepth;
- --cpp->elsetracker;
- }
- return CPPif(yylvalpp);
- }
- }
- else if((atom==elseAtom) && (!ChkCorrectElseNesting())){
- CPPErrorToInfoLog("#else after a #else");
- cpp->CompileError=1;
- }
- };
- return token;
-}
-
-enum eval_prec {
- MIN_PREC,
- COND, LOGOR, LOGAND, OR, XOR, AND, EQUAL, RELATION, SHIFT, ADD, MUL, UNARY,
- MAX_PREC
-};
-
-static int op_logor(int a, int b) { return a || b; }
-static int op_logand(int a, int b) { return a && b; }
-static int op_or(int a, int b) { return a | b; }
-static int op_xor(int a, int b) { return a ^ b; }
-static int op_and(int a, int b) { return a & b; }
-static int op_eq(int a, int b) { return a == b; }
-static int op_ne(int a, int b) { return a != b; }
-static int op_ge(int a, int b) { return a >= b; }
-static int op_le(int a, int b) { return a <= b; }
-static int op_gt(int a, int b) { return a > b; }
-static int op_lt(int a, int b) { return a < b; }
-static int op_shl(int a, int b) { return a << b; }
-static int op_shr(int a, int b) { return a >> b; }
-static int op_add(int a, int b) { return a + b; }
-static int op_sub(int a, int b) { return a - b; }
-static int op_mul(int a, int b) { return a * b; }
-static int op_div(int a, int b) { return a / b; }
-static int op_mod(int a, int b) { return a % b; }
-static int op_pos(int a) { return a; }
-static int op_neg(int a) { return -a; }
-static int op_cmpl(int a) { return ~a; }
-static int op_not(int a) { return !a; }
-
-struct {
- int token, prec, (*op)(int, int);
-} binop[] = {
- { CPP_OR_OP, LOGOR, op_logor },
- { CPP_AND_OP, LOGAND, op_logand },
- { '|', OR, op_or },
- { '^', XOR, op_xor },
- { '&', AND, op_and },
- { CPP_EQ_OP, EQUAL, op_eq },
- { CPP_NE_OP, EQUAL, op_ne },
- { '>', RELATION, op_gt },
- { CPP_GE_OP, RELATION, op_ge },
- { '<', RELATION, op_lt },
- { CPP_LE_OP, RELATION, op_le },
- { CPP_LEFT_OP, SHIFT, op_shl },
- { CPP_RIGHT_OP, SHIFT, op_shr },
- { '+', ADD, op_add },
- { '-', ADD, op_sub },
- { '*', MUL, op_mul },
- { '/', MUL, op_div },
- { '%', MUL, op_mod },
-};
-
-struct {
- int token, (*op)(int);
-} unop[] = {
- { '+', op_pos },
- { '-', op_neg },
- { '~', op_cmpl },
- { '!', op_not },
-};
-
-#define ALEN(A) (sizeof(A)/sizeof(A[0]))
-
-static int eval(int token, int prec, int *res, int *err, yystypepp * yylvalpp)
-{
- int i, val;
- Symbol *s;
- if (token == CPP_IDENTIFIER) {
- if (yylvalpp->sc_ident == definedAtom) {
- int needclose = 0;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token == '(') {
- needclose = 1;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- if (token != CPP_IDENTIFIER)
- goto error;
- *res = (s = LookUpSymbol(macros, yylvalpp->sc_ident))
- ? !s->details.mac.undef : 0;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (needclose) {
- if (token != ')')
- goto error;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- } else if (MacroExpand(yylvalpp->sc_ident, yylvalpp)) {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- return eval(token, prec, res, err, yylvalpp);
- } else {
- goto error;
- }
- } else if (token == CPP_INTCONSTANT) {
- *res = yylvalpp->sc_int;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- } else if (token == '(') {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- token = eval(token, MIN_PREC, res, err, yylvalpp);
- if (!*err) {
- if (token != ')')
- goto error;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- } else {
- for (i = ALEN(unop) - 1; i >= 0; i--) {
- if (unop[i].token == token)
- break;
- }
- if (i >= 0) {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- token = eval(token, UNARY, res, err, yylvalpp);
- *res = unop[i].op(*res);
- } else {
- goto error;
- }
- }
- while (!*err) {
- if (token == ')' || token == '\n') break;
- for (i = ALEN(binop) - 1; i >= 0; i--) {
- if (binop[i].token == token)
- break;
- }
- if (i < 0 || binop[i].prec <= prec)
- break;
- val = *res;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- token = eval(token, binop[i].prec, res, err, yylvalpp);
- *res = binop[i].op(val, *res);
- }
- return token;
-error:
- CPPErrorToInfoLog("incorrect preprocessor directive");
- *err = 1;
- *res = 0;
- return token;
-} /* eval */
-
-static int CPPif(yystypepp * yylvalpp) {
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- int res = 0, err = 0;
- cpp->elsetracker++;
- if (!cpp->ifdepth++)
- ifloc = *cpp->tokenLoc;
- if(cpp->ifdepth >MAX_IF_NESTING){
- CPPErrorToInfoLog("max #if nesting depth exceeded");
- return 0;
- }
- token = eval(token, MIN_PREC, &res, &err, yylvalpp);
- if (token != '\n') {
- CPPWarningToInfoLog("unexpected tokens following the preprocessor directive - expected a newline");
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- if (!res && !err) {
- token = CPPelse(1, yylvalpp);
- }
-
- return token;
-} /* CPPif */
-
-static int CPPifdef(int defined, yystypepp * yylvalpp)
-{
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- int name = yylvalpp->sc_ident;
- if(++cpp->ifdepth >MAX_IF_NESTING){
- CPPErrorToInfoLog("max #if nesting depth exceeded");
- return 0;
- }
- cpp->elsetracker++;
- if (token != CPP_IDENTIFIER) {
- defined ? CPPErrorToInfoLog("ifdef"):CPPErrorToInfoLog("ifndef");
- } else {
- Symbol *s = LookUpSymbol(macros, name);
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != '\n') {
- CPPWarningToInfoLog("unexpected tokens following #ifdef preprocessor directive - expected a newline");
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- if (((s && !s->details.mac.undef) ? 1 : 0) != defined)
- token = CPPelse(1, yylvalpp);
- }
- return token;
-} /* CPPifdef */
-
-static int CPPline(yystypepp * yylvalpp)
-{
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if(token=='\n'){
- DecLineNumber();
- CPPErrorToInfoLog("#line");
- IncLineNumber();
- return token;
- }
- else if (token == CPP_INTCONSTANT) {
- yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
- SetLineNumber(yylvalpp->sc_int);
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- if (token == CPP_INTCONSTANT) {
- yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
- SetStringNumber(yylvalpp->sc_int);
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if(token!='\n')
- CPPErrorToInfoLog("#line");
- }
- else if (token == '\n'){
- return token;
- }
- else{
- CPPErrorToInfoLog("#line");
- }
- }
- else{
- CPPErrorToInfoLog("#line");
- }
- return token;
-}
-
-static int CPPerror(yystypepp * yylvalpp) {
-
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- const char *message;
-
- while (token != '\n') {
- if (token == CPP_FLOATCONSTANT || token == CPP_INTCONSTANT){
- StoreStr(yylvalpp->symbol_name);
- }else if(token == CPP_IDENTIFIER || token == CPP_STRCONSTANT){
- StoreStr(GetStringOfAtom(atable,yylvalpp->sc_ident));
- }else {
- StoreStr(GetStringOfAtom(atable,token));
- }
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- DecLineNumber();
- /*store this msg into the shader's information log..set the Compile Error flag!!!! */
- message=GetStrfromTStr();
- CPPShInfoLogMsg(message);
- ResetTString();
- cpp->CompileError=1;
- IncLineNumber();
- return '\n';
-}/*CPPerror */
-
-static int CPPpragma(yystypepp * yylvalpp)
-{
- char SrcStrName[2];
- char** allTokens;
- int tokenCount = 0;
- int maxTokenCount = 10;
- const char* SrcStr;
- int i;
-
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- if (token=='\n') {
- DecLineNumber();
- CPPErrorToInfoLog("#pragma");
- IncLineNumber();
- return token;
- }
-
- allTokens = (char**)malloc(sizeof(char*) * maxTokenCount);
-
- while (token != '\n') {
- if (tokenCount >= maxTokenCount) {
- maxTokenCount *= 2;
- allTokens = (char**)realloc((char**)allTokens, sizeof(char*) * maxTokenCount);
- }
- switch (token) {
- case CPP_IDENTIFIER:
- SrcStr = GetAtomString(atable, yylvalpp->sc_ident);
- allTokens[tokenCount] = (char*)malloc(strlen(SrcStr) + 1);
- strcpy(allTokens[tokenCount++], SrcStr);
- break;
- case CPP_INTCONSTANT:
- SrcStr = yylvalpp->symbol_name;
- allTokens[tokenCount] = (char*)malloc(strlen(SrcStr) + 1);
- strcpy(allTokens[tokenCount++], SrcStr);
- break;
- case CPP_FLOATCONSTANT:
- SrcStr = yylvalpp->symbol_name;
- allTokens[tokenCount] = (char*)malloc(strlen(SrcStr) + 1);
- strcpy(allTokens[tokenCount++], SrcStr);
- break;
- case -1:
- /* EOF */
- CPPShInfoLogMsg("#pragma directive must end with a newline");
- return token;
- default:
- SrcStrName[0] = token;
- SrcStrName[1] = '\0';
- allTokens[tokenCount] = (char*)malloc(2);
- strcpy(allTokens[tokenCount++], SrcStrName);
- }
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
-
- cpp->currentInput->ungetch(cpp->currentInput, token, yylvalpp);
- HandlePragma(allTokens, tokenCount);
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- for (i = 0; i < tokenCount; ++i) {
- free (allTokens[i]);
- }
- free (allTokens);
-
- return token;
-} /* CPPpragma */
-
-#define GL2_VERSION_NUMBER 110
-
-static int CPPversion(yystypepp * yylvalpp)
-{
-
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- if (cpp->notAVersionToken == 1)
- CPPShInfoLogMsg("#version must occur before any other statement in the program");
-
- if(token=='\n'){
- DecLineNumber();
- CPPErrorToInfoLog("#version");
- IncLineNumber();
- return token;
- }
- if (token != CPP_INTCONSTANT)
- CPPErrorToInfoLog("#version");
-
- yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
- /*SetVersionNumber(yylvalpp->sc_int); */
-
- if (yylvalpp->sc_int != GL2_VERSION_NUMBER)
- CPPShInfoLogMsg("Version number not supported by GL2");
-
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-
- if (token == '\n'){
- return token;
- }
- else{
- CPPErrorToInfoLog("#version");
- }
- return token;
-} /* CPPversion */
-
-static int CPPextension(yystypepp * yylvalpp)
-{
-
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- char extensionName[80];
-
- if(token=='\n'){
- DecLineNumber();
- CPPShInfoLogMsg("extension name not specified");
- IncLineNumber();
- return token;
- }
-
- if (token != CPP_IDENTIFIER)
- CPPErrorToInfoLog("#extension");
-
- strcpy(extensionName, GetAtomString(atable, yylvalpp->sc_ident));
-
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != ':') {
- CPPShInfoLogMsg("':' missing after extension name");
- return token;
- }
-
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != CPP_IDENTIFIER) {
- CPPShInfoLogMsg("behavior for extension not specified");
- return token;
- }
-
- updateExtensionBehavior(extensionName, GetAtomString(atable, yylvalpp->sc_ident));
-
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token == '\n'){
- return token;
- }
- else{
- CPPErrorToInfoLog("#extension");
- }
- return token;
-} /* CPPextension */
-
-int readCPPline(yystypepp * yylvalpp)
-{
- int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- const char *message;
- int isVersion = 0;
-
- if (token == CPP_IDENTIFIER) {
- if (yylvalpp->sc_ident == defineAtom) {
- token = CPPdefine(yylvalpp);
- } else if (yylvalpp->sc_ident == elseAtom) {
- if(ChkCorrectElseNesting()){
- if (!cpp->ifdepth ){
- CPPErrorToInfoLog("#else mismatch");
- cpp->CompileError=1;
- }
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != '\n') {
- CPPWarningToInfoLog("unexpected tokens following #else preprocessor directive - expected a newline");
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- token = CPPelse(0, yylvalpp);
- }else{
- CPPErrorToInfoLog("#else after a #else");
- cpp->ifdepth=0;
- cpp->notAVersionToken = 1;
- return 0;
- }
- } else if (yylvalpp->sc_ident == elifAtom) {
- if (!cpp->ifdepth){
- CPPErrorToInfoLog("#elif mismatch");
- cpp->CompileError=1;
- }
- /* this token is really a dont care, but we still need to eat the tokens */
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- while (token != '\n')
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- token = CPPelse(0, yylvalpp);
- } else if (yylvalpp->sc_ident == endifAtom) {
- cpp->elsedepth[cpp->elsetracker]=0;
- --cpp->elsetracker;
- if (!cpp->ifdepth){
- CPPErrorToInfoLog("#endif mismatch");
- cpp->CompileError=1;
- }
- else
- --cpp->ifdepth;
- } else if (yylvalpp->sc_ident == ifAtom) {
- token = CPPif(yylvalpp);
- } else if (yylvalpp->sc_ident == ifdefAtom) {
- token = CPPifdef(1, yylvalpp);
- } else if (yylvalpp->sc_ident == ifndefAtom) {
- token = CPPifdef(0, yylvalpp);
- } else if (yylvalpp->sc_ident == lineAtom) {
- token = CPPline(yylvalpp);
- } else if (yylvalpp->sc_ident == pragmaAtom) {
- token = CPPpragma(yylvalpp);
- } else if (yylvalpp->sc_ident == undefAtom) {
- token = CPPundef(yylvalpp);
- } else if (yylvalpp->sc_ident == errorAtom) {
- token = CPPerror(yylvalpp);
- } else if (yylvalpp->sc_ident == versionAtom) {
- token = CPPversion(yylvalpp);
- isVersion = 1;
- } else if (yylvalpp->sc_ident == extensionAtom) {
- token = CPPextension(yylvalpp);
- } else {
- StoreStr("Invalid Directive");
- StoreStr(GetStringOfAtom(atable,yylvalpp->sc_ident));
- message=GetStrfromTStr();
- CPPShInfoLogMsg(message);
- ResetTString();
- }
- }
- while (token != '\n' && token != 0 && token != EOF) {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
-
- cpp->notAVersionToken = !isVersion;
-
- return token;
-} /* readCPPline */
-
-void FreeMacro(MacroSymbol *s) {
- DeleteTokenStream(s->body);
-}
-
-static int eof_scan(InputSrc *in, yystypepp * yylvalpp) { return -1; }
-static void noop(InputSrc *in, int ch, yystypepp * yylvalpp) { }
-
-static void PushEofSrc() {
- InputSrc *in = malloc(sizeof(InputSrc));
- memset(in, 0, sizeof(InputSrc));
- in->scan = eof_scan;
- in->getch = eof_scan;
- in->ungetch = noop;
- in->prev = cpp->currentInput;
- cpp->currentInput = in;
-}
-
-static void PopEofSrc() {
- if (cpp->currentInput->scan == eof_scan) {
- InputSrc *in = cpp->currentInput;
- cpp->currentInput = in->prev;
- free(in);
- }
-}
-
-static TokenStream *PrescanMacroArg(TokenStream *a, yystypepp * yylvalpp) {
- int token;
- TokenStream *n;
- RewindTokenStream(a);
- do {
- token = ReadToken(a, yylvalpp);
- if (token == CPP_IDENTIFIER && LookUpSymbol(macros, yylvalpp->sc_ident))
- break;
- } while (token > 0);
- if (token <= 0) return a;
- n = NewTokenStream("macro arg");
- PushEofSrc();
- ReadFromTokenStream(a, 0, 0);
- while ((token = cpp->currentInput->scan(cpp->currentInput, yylvalpp)) > 0) {
- if (token == CPP_IDENTIFIER && MacroExpand(yylvalpp->sc_ident, yylvalpp))
- continue;
- RecordToken(n, token, yylvalpp);
- }
- PopEofSrc();
- DeleteTokenStream(a);
- return n;
-} /* PrescanMacroArg */
-
-typedef struct MacroInputSrc {
- InputSrc base;
- MacroSymbol *mac;
- TokenStream **args;
-} MacroInputSrc;
-
-/* macro_scan ---
-** return the next token for a macro expanion, handling macro args
-*/
-static int macro_scan(MacroInputSrc *in, yystypepp * yylvalpp) {
- int i;
- int token = ReadToken(in->mac->body, yylvalpp);
- if (token == CPP_IDENTIFIER) {
- for (i = in->mac->argc-1; i>=0; i--)
- if (in->mac->args[i] == yylvalpp->sc_ident) break;
- if (i >= 0) {
- ReadFromTokenStream(in->args[i], yylvalpp->sc_ident, 0);
- return cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- }
- }
- if (token > 0) return token;
- in->mac->busy = 0;
- cpp->currentInput = in->base.prev;
- if (in->args) {
- for (i=in->mac->argc-1; i>=0; i--)
- DeleteTokenStream(in->args[i]);
- free(in->args);
- }
- free(in);
- return cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-} /* macro_scan */
-
-/* MacroExpand
-** check an identifier (atom) to see if it a macro that should be expanded.
-** If it is, push an InputSrc that will produce the appropriate expansion
-** and return TRUE. If not, return FALSE.
-*/
-
-int MacroExpand(int atom, yystypepp * yylvalpp)
-{
- Symbol *sym = LookUpSymbol(macros, atom);
- MacroInputSrc *in;
- int i,j, token, depth=0;
- const char *message;
- if (atom == __LINE__Atom) {
- yylvalpp->sc_int = GetLineNumber();
- sprintf(yylvalpp->symbol_name,"%d",yylvalpp->sc_int);
- UngetToken(CPP_INTCONSTANT, yylvalpp);
- return 1;
- }
- if (atom == __FILE__Atom) {
- yylvalpp->sc_int = GetStringNumber();
- sprintf(yylvalpp->symbol_name,"%d",yylvalpp->sc_int);
- UngetToken(CPP_INTCONSTANT, yylvalpp);
- return 1;
- }
- if (atom == __VERSION__Atom) {
- strcpy(yylvalpp->symbol_name,"100");
- yylvalpp->sc_int = atoi(yylvalpp->symbol_name);
- UngetToken(CPP_INTCONSTANT, yylvalpp);
- return 1;
- }
- if (!sym || sym->details.mac.undef) return 0;
- if (sym->details.mac.busy) return 0; /* no recursive expansions */
- in = malloc(sizeof(*in));
- memset(in, 0, sizeof(*in));
- in->base.scan = (void *)macro_scan;
- in->base.line = cpp->currentInput->line;
- in->base.name = cpp->currentInput->name;
- in->mac = &sym->details.mac;
- if (sym->details.mac.args) {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token != '(') {
- UngetToken(token, yylvalpp);
- yylvalpp->sc_ident = atom;
- return 0;
- }
- in->args = malloc(in->mac->argc * sizeof(TokenStream *));
- for (i=0; i<in->mac->argc; i++)
- in->args[i] = NewTokenStream("macro arg");
- i=0;j=0;
- do{
- depth = 0;
- while(1) {
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token <= 0) {
- StoreStr("EOF in Macro ");
- StoreStr(GetStringOfAtom(atable,atom));
- message=GetStrfromTStr();
- CPPShInfoLogMsg(message);
- ResetTString();
- return 1;
- }
- if((in->mac->argc==0) && (token!=')')) break;
- if (depth == 0 && (token == ',' || token == ')')) break;
- if (token == '(') depth++;
- if (token == ')') depth--;
- RecordToken(in->args[i], token, yylvalpp);
- j=1;
- }
- if (token == ')') {
- if((in->mac->argc==1) &&j==0)
- break;
- i++;
- break;
- }
- i++;
- }while(i < in->mac->argc);
-
- if (i < in->mac->argc) {
- StoreStr("Too few args in Macro ");
- StoreStr(GetStringOfAtom(atable,atom));
- message=GetStrfromTStr();
- CPPShInfoLogMsg(message);
- ResetTString();
- } else if (token != ')') {
- depth=0;
- while (token >= 0 && (depth > 0 || token != ')')) {
- if (token == ')') depth--;
- token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (token == '(') depth++;
- }
-
- if (token <= 0) {
- StoreStr("EOF in Macro ");
- StoreStr(GetStringOfAtom(atable,atom));
- message=GetStrfromTStr();
- CPPShInfoLogMsg(message);
- ResetTString();
- return 1;
- }
- StoreStr("Too many args in Macro ");
- StoreStr(GetStringOfAtom(atable,atom));
- message=GetStrfromTStr();
- CPPShInfoLogMsg(message);
- ResetTString();
- }
- for (i=0; i<in->mac->argc; i++) {
- in->args[i] = PrescanMacroArg(in->args[i], yylvalpp);
- }
- }
-#if 0
- printf(" <%s:%d>found macro %s\n", GetAtomString(atable, loc.file),
- loc.line, GetAtomString(atable, atom));
- for (i=0; i<in->mac->argc; i++) {
- printf("\targ %s = '", GetAtomString(atable, in->mac->args[i]));
- DumpTokenStream(stdout, in->args[i]);
- printf("'\n");
- }
-#endif
- /*retain the input source*/
- in->base.prev = cpp->currentInput;
- sym->details.mac.busy = 1;
- RewindTokenStream(sym->details.mac.body);
- cpp->currentInput = &in->base;
- return 1;
-} /* MacroExpand */
-
-int ChkCorrectElseNesting(void)
-{
- if(cpp->elsedepth[cpp->elsetracker]==0){
- cpp->elsedepth[cpp->elsetracker]=1;
- return 1;
- }
- return 0;
-}
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h
deleted file mode 100755
index 03449a17a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* cpp.h */
-/* */
-
-#if !defined(__CPP_H)
-#define __CPP_H 1
-
-#include "parser.h"
-#include "tokens.h"
-
-int InitCPP(void);
-int FinalCPP(void);
-int readCPPline(yystypepp * yylvalpp);
-int MacroExpand(int atom, yystypepp * yylvalpp);
-int ChkCorrectElseNesting(void);
-
-typedef struct MacroSymbol {
- int argc;
- int *args;
- TokenStream *body;
- unsigned busy:1;
- unsigned undef:1;
-} MacroSymbol;
-
-void FreeMacro(MacroSymbol *);
-int PredefineMacro(char *);
-
-void CPPDebugLogMsg(const char *msg); /* Prints information into debug log */
-void CPPShInfoLogMsg(const char*); /* Store cpp Err Msg into Sh.Info.Log */
-void CPPWarningToInfoLog(const char *msg); /* Prints warning messages into info log */
-void HandlePragma(const char**, int numTokens); /* #pragma directive container. */
-void ResetTString(void); /* #error Message as TString. */
-void CPPErrorToInfoLog(char*); /* Stick all cpp errors into Sh.Info.log . */
-void StoreStr(char*); /* Store the TString in Parse Context. */
-void SetLineNumber(int); /* Set line number. */
-void SetStringNumber(int); /* Set string number. */
-int GetLineNumber(void); /* Get the current String Number. */
-int GetStringNumber(void); /* Get the current String Number. */
-const char* GetStrfromTStr(void); /* Convert TString to String. */
-void updateExtensionBehavior(const char* extName, const char* behavior);
-int FreeCPP(void);
-
-#endif /* !(defined(__CPP_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c
deleted file mode 100644
index 0c3073590..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cpp_comment_fix.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* converts c++ to c comments */
-/* usage: ./cpp_comment_fix source */
-
-#include <stdio.h>
-
-int main (int argc, char *argv[])
-{
- FILE *f;
- int c;
- char *buf = NULL;
- int size = 0, i = 0;
-
- f = fopen (argv[1], "r");
- while ((c = fgetc (f)) != EOF)
- {
- buf = (void *) realloc (buf, size + 1);
- buf[size] = c;
- size++;
- }
- fclose (f);
-
- f = fopen (argv[1], "w");
-
- while (i < size)
- {
- if (buf[i] == '/')
- {
- if (buf[i+1] == '/')
- {
- fprintf (f, "/*");
- i+=2;
- while (buf[i] != '\n' && buf[i] != '\r' && i < size)
- fprintf (f, "%c", buf[i++]);
- fprintf (f, " */\n");
- if (i < size && buf[i] == '\n')
- i++;
- else if (i < size && buf[i] == '\r')
- i+=2;
- }
- else
- {
- fprintf (f, "/");
- i++;
-
- if (buf[i] == '*')
- {
- fprintf (f, "*");
- i++;
-
- for (;;)
- {
- if (buf[i] == '*' && buf[i+1] == '/')
- {
- fprintf (f, "*/");
- i+=2;
- break;
- }
- else
- {
- fprintf (f, "%c", buf[i]);
- i++;
- }
- }
- }
- }
- }
- else
- {
- fprintf (f, "%c", buf[i]);
- i++;
- }
- }
- fclose (f);
- return 0;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c
deleted file mode 100755
index c55b3f7c7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/cppstruct.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* cppstruct.c */
-/* */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "slglobals.h"
-
-CPPStruct *cpp = NULL;
-static int refCount = 0;
-
-int InitPreprocessor(void);
-int ResetPreprocessor(void);
-int FreeCPPStruct(void);
-int FinalizePreprocessor(void);
-
-/*
- * InitCPPStruct() - Initilaize the CPP structure.
- *
- */
-
-int InitCPPStruct(void)
-{
- int len;
- char *p;
-
- cpp = (CPPStruct *) malloc(sizeof(CPPStruct));
- if (cpp == NULL)
- return 0;
-
- refCount++;
-
- /* Initialize public members: */
- cpp->pLastSourceLoc = &cpp->lastSourceLoc;
-
- p = (char *) &cpp->options;
- len = sizeof(cpp->options);
- while (--len >= 0)
- p[len] = 0;
-
- ResetPreprocessor();
- return 1;
-} /* InitCPPStruct */
-
-int ResetPreprocessor(void)
-{
- /* Initialize private members: */
-
- cpp->lastSourceLoc.file = 0;
- cpp->lastSourceLoc.line = 0;
- cpp->pC=0;
- cpp->CompileError=0;
- cpp->ifdepth=0;
- for(cpp->elsetracker=0; cpp->elsetracker<64; cpp->elsetracker++)
- cpp->elsedepth[cpp->elsetracker]=0;
- cpp->elsetracker=0;
- cpp->tokensBeforeEOF = 0;
- return 1;
-}
-
-/*Intializing the Preprocessor. */
-
-int InitPreprocessor(void)
-{
- # define CPP_STUFF true
- # ifdef CPP_STUFF
- FreeCPPStruct();
- InitCPPStruct();
- cpp->options.Quiet = 1;
- cpp->options.profileString = "generic";
- if (!InitAtomTable(atable, 0))
- return 1;
- if (!InitScanner(cpp))
- return 1;
- # endif
- return 0;
-}
-
-/*FreeCPPStruct() - Free the CPP structure. */
-
-int FreeCPPStruct(void)
-{
- if (refCount)
- {
- free(cpp);
- refCount--;
- }
-
- return 1;
-}
-
-/*Finalizing the Preprocessor. */
-
-int FinalizePreprocessor(void)
-{
- # define CPP_STUFF true
- # ifdef CPP_STUFF
- FreeAtomTable(atable);
- FreeCPPStruct();
- FreeScanner();
- # endif
- return 0;
-}
-
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*//////////////////////////////////// End of cppstruct.c ////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.c
deleted file mode 100755
index ed0f4fb4b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __STDC99__
-#include <stdint.h>
-#elif defined (_WIN64)
-typedef unsigned __int64 uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
-
-#include "memory.h"
-
-/* default alignment and chunksize, if called with 0 arguments */
-#define CHUNKSIZE (64*1024)
-#define ALIGN 8
-
-/* we need to call the `real' malloc and free, not our replacements */
-#undef malloc
-#undef free
-
-struct chunk {
- struct chunk *next;
-};
-
-struct cleanup {
- struct cleanup *next;
- void (*fn)(void *);
- void *arg;
-};
-
-struct MemoryPool_rec {
- struct chunk *next;
- uintptr_t free, end;
- size_t chunksize;
- uintptr_t alignmask;
- struct cleanup *cleanup;
-};
-
-MemoryPool *mem_CreatePool(size_t chunksize, unsigned int align)
-{
- MemoryPool *pool;
-
- if (align == 0) align = ALIGN;
- if (chunksize == 0) chunksize = CHUNKSIZE;
- if (align & (align-1)) return 0;
- if (chunksize < sizeof(MemoryPool)) return 0;
- if (chunksize & (align-1)) return 0;
- if (!(pool = malloc(chunksize))) return 0;
- pool->next = 0;
- pool->chunksize = chunksize;
- pool->alignmask = (uintptr_t)(align)-1;
- pool->free = ((uintptr_t)(pool + 1) + pool->alignmask) & ~pool->alignmask;
- pool->end = (uintptr_t)pool + chunksize;
- pool->cleanup = 0;
- return pool;
-}
-
-void mem_FreePool(MemoryPool *pool)
-{
- struct cleanup *cleanup;
- struct chunk *p, *next;
-
- for (cleanup = pool->cleanup; cleanup; cleanup = cleanup->next) {
- cleanup->fn(cleanup->arg);
- }
- for (p = (struct chunk *)pool; p; p = next) {
- next = p->next;
- free(p);
- }
-}
-
-void *mem_Alloc(MemoryPool *pool, size_t size)
-{
- struct chunk *ch;
- void *rv = (void *)pool->free;
- size = (size + pool->alignmask) & ~pool->alignmask;
- if (size <= 0) size = pool->alignmask;
- pool->free += size;
- if (pool->free > pool->end || pool->free < (uintptr_t)rv) {
- size_t minreq = (size + sizeof(struct chunk) + pool->alignmask)
- & ~pool->alignmask;
- pool->free = (uintptr_t)rv;
- if (minreq >= pool->chunksize) {
- /* request size is too big for the chunksize, so allocate it as */
- /* a single chunk of the right size */
- ch = malloc(minreq);
- if (!ch) return 0;
- } else {
- ch = malloc(pool->chunksize);
- if (!ch) return 0;
- pool->free = (uintptr_t)ch + minreq;
- pool->end = (uintptr_t)ch + pool->chunksize;
- }
- ch->next = pool->next;
- pool->next = ch;
- rv = (void *)(((uintptr_t)(ch+1) + pool->alignmask) & ~pool->alignmask);
- }
- return rv;
-}
-
-int mem_AddCleanup(MemoryPool *pool, void (*fn)(void *), void *arg) {
- struct cleanup *cleanup;
-
- pool->free = (pool->free + sizeof(void *) - 1) & ~(sizeof(void *)-1);
- cleanup = mem_Alloc(pool, sizeof(struct cleanup));
- if (!cleanup) return -1;
- cleanup->next = pool->cleanup;
- cleanup->fn = fn;
- cleanup->arg = arg;
- pool->cleanup = cleanup;
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.h
deleted file mode 100755
index 89a57e24c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/memory.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-#ifndef __MEMORY_H
-#define __MEMORY_H
-
-typedef struct MemoryPool_rec MemoryPool;
-
-extern MemoryPool *mem_CreatePool(size_t chunksize, unsigned align);
-extern void mem_FreePool(MemoryPool *);
-extern void *mem_Alloc(MemoryPool *p, size_t size);
-extern void *mem_Realloc(MemoryPool *p, void *old, size_t oldsize, size_t newsize);
-extern int mem_AddCleanup(MemoryPool *p, void (*fn)(void *), void *arg);
-
-#endif /* __MEMORY_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/parser.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/parser.h
deleted file mode 100755
index 5f70bdd1a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/parser.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-
-#ifndef BISON_PARSER_H
-# define BISON_PARSER_H
-
-#ifndef yystypepp
-typedef struct {
- int sc_int;
- float sc_fval;
- int sc_ident;
- char symbol_name[MAX_SYMBOL_NAME_LEN+1];
-} yystypepp;
-
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-# define CPP_AND_OP 257
-# define CPP_SUB_ASSIGN 259
-# define CPP_MOD_ASSIGN 260
-# define CPP_ADD_ASSIGN 261
-# define CPP_DIV_ASSIGN 262
-# define CPP_MUL_ASSIGN 263
-# define CPP_EQ_OP 264
-# define CPP_XOR_OP 265
-# define ERROR_SY 266
-# define CPP_FLOATCONSTANT 267
-# define CPP_GE_OP 268
-# define CPP_RIGHT_OP 269
-# define CPP_IDENTIFIER 270
-# define CPP_INTCONSTANT 271
-# define CPP_LE_OP 272
-# define CPP_LEFT_OP 273
-# define CPP_DEC_OP 274
-# define CPP_NE_OP 275
-# define CPP_OR_OP 276
-# define CPP_INC_OP 277
-# define CPP_STRCONSTANT 278
-# define CPP_TYPEIDENTIFIER 279
-
-# define FIRST_USER_TOKEN_SY 289
-
-# define CPP_RIGHT_ASSIGN 280
-# define CPP_LEFT_ASSIGN 281
-# define CPP_AND_ASSIGN 282
-# define CPP_OR_ASSIGN 283
-# define CPP_XOR_ASSIGN 284
-# define CPP_LEFT_BRACKET 285
-# define CPP_RIGHT_BRACKET 286
-# define CPP_LEFT_BRACE 287
-# define CPP_RIGHT_BRACE 288
-
-#endif /* not BISON_PARSER_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h
deleted file mode 100755
index 63996d669..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/preprocess.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-
-# include "slglobals.h"
-extern CPPStruct *cpp;
-int InitCPPStruct(void);
-int InitScanner(CPPStruct *cpp);
-int InitAtomTable(AtomTable *atable, int htsize);
-int ScanFromString(char *s);
-char* GetStringOfAtom(AtomTable *atable, int atom);
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c
deleted file mode 100755
index d80e37b8e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.c
+++ /dev/null
@@ -1,789 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* scanner.c */
-/* */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if 0
- #include <ieeefp.h>
- #else
- #define isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
- ((*(long *)&(x) & 0x007fffffL)==0000000000L))
-#endif
-
-#include "slglobals.h"
-
-
-typedef struct StringInputSrc {
- InputSrc base;
- char *p;
-} StringInputSrc;
-
-static int eof_scan(InputSrc *is, yystypepp * yylvalpp)
-{
- return EOF;
-} /* eof_scan */
-
-static void noop(InputSrc *in, int ch, yystypepp * yylvalpp) {}
-
-static InputSrc eof_inputsrc = { 0, &eof_scan, &eof_scan, &noop };
-
-static int byte_scan(InputSrc *, yystypepp * yylvalpp);
-
-#define EOL_SY '\n'
-
-#if defined(_WIN32)
- #define DBG_BREAKPOINT() __asm int 3
- #elif defined(_M_AMD64)
- #define DBG_BREAKPOINT() assert(!"Dbg_Breakpoint");
- #else
- #define DBG_BREAKPOINT()
- #endif
-
- #if defined(_WIN32) && !defined(_M_AMD64)
- __int64 RDTSC ( void ) {
-
- __int64 v;
-
- __asm __emit 0x0f
- __asm __emit 0x31
- __asm mov dword ptr v, eax
- __asm mov dword ptr v+4, edx
-
- return v;
- }
-#endif
-
-
-int InitScanner(CPPStruct *cpp)
-{
- /* Add various atoms needed by the CPP line scanner: */
- if (!InitCPP())
- return 0;
-
- cpp->mostRecentToken = 0;
- cpp->tokenLoc = &cpp->ltokenLoc;
-
- cpp->ltokenLoc.file = 0;
- cpp->ltokenLoc.line = 0;
-
- cpp->currentInput = &eof_inputsrc;
- cpp->previous_token = '\n';
- cpp->notAVersionToken = 0;
-
- return 1;
-} /* InitScanner */
-
-int FreeScanner(void)
-{
- return (FreeCPP());
-}
-
-/*
- * str_getch()
- * takes care of reading from multiple strings.
- * returns the next-char from the input stream.
- * returns EOF when the complete shader is parsed.
- */
-static int str_getch(StringInputSrc *in)
-{
- for(;;){
- if (*in->p){
- if (*in->p == '\n') {
- in->base.line++;
- IncLineNumber();
- }
- return *in->p++;
- }
- if(++(cpp->PaWhichStr) < cpp->PaArgc){
- free(in);
- SetStringNumber(cpp->PaWhichStr);
- SetLineNumber(1);
- ScanFromString(cpp->PaArgv[cpp->PaWhichStr]);
- in=(StringInputSrc*)cpp->currentInput;
- continue;
- }
- else{
- cpp->currentInput = in->base.prev;
- cpp->PaWhichStr=0;
- free(in);
- return EOF;
- }
- }
-} /* str_getch */
-
-static void str_ungetch(StringInputSrc *in, int ch, yystypepp *type) {
- if (in->p[-1] == ch)in->p--;
- else {
- *(in->p)='\0'; /*this would take care of shifting to the previous string. */
- cpp->PaWhichStr--;
- }
- if (ch == '\n') {
- in->base.line--;
- DecLineNumber();
- }
-} /* str_ungetch */
-
-int ScanFromString(char *s)
-{
-
- StringInputSrc *in = malloc(sizeof(StringInputSrc));
- memset(in, 0, sizeof(StringInputSrc));
- in->p = s;
- in->base.line = 1;
- in->base.scan = byte_scan;
- in->base.getch = (int (*)(InputSrc *, yystypepp *))str_getch;
- in->base.ungetch = (void (*)(InputSrc *, int, yystypepp *))str_ungetch;
- in->base.prev = cpp->currentInput;
- cpp->currentInput = &in->base;
-
- return 1;
-} /* ScanFromString; */
-
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*///////////////////////////////// Floating point constants: ///////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*
- * lBuildFloatValue() - Quick and dirty conversion to floating point. Since all
- * we need is single precision this should be quite precise.
- */
-
-static float lBuildFloatValue(const char *str, int len, int exp)
-{
- double val, expval, ten;
- int ii, llen, absexp;
- float rv;
-
- val = 0.0;
- llen = len;
- for (ii = 0; ii < len; ii++)
- val = val*10.0 + (str[ii] - '0');
- if (exp != 0) {
- absexp = exp > 0 ? exp : -exp;
- expval = 1.0f;
- ten = 10.0;
- while (absexp) {
- if (absexp & 1)
- expval *= ten;
- ten *= ten;
- absexp >>= 1;
- }
- if (exp >= 0) {
- val *= expval;
- } else {
- val /= expval;
- }
- }
- rv = (float)val;
- if (isinff(rv)) {
- CPPErrorToInfoLog(" ERROR___FP_CONST_OVERFLOW");
- }
- return rv;
-} /* lBuildFloatValue */
-
-
-/*
- * lFloatConst() - Scan a floating point constant. Assumes that the scanner
- * has seen at least one digit, followed by either a decimal '.' or the
- * letter 'e'.
- */
-
-static int lFloatConst(char *str, int len, int ch, yystypepp * yylvalpp)
-{
- int HasDecimal, declen, exp, ExpSign;
- int str_len;
- float lval;
-
- HasDecimal = 0;
- declen = 0;
- exp = 0;
-
- str_len=len;
- if (ch == '.') {
- str[len++]=ch;
- HasDecimal = 1;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- while (ch >= '0' && ch <= '9') {
- if (len < MAX_SYMBOL_NAME_LEN) {
- declen++;
- if (len > 0 || ch != '0') {
- str[len] = ch;
- len++;str_len++;
- }
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- } else {
- CPPErrorToInfoLog("ERROR___FP_CONST_TOO_LONG");
- len = 1,str_len=1;
- }
- }
- }
-
- /* Exponent: */
-
- if (ch == 'e' || ch == 'E') {
- ExpSign = 1;
- str[len++]=ch;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '+') {
- str[len++]=ch;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- } else if (ch == '-') {
- ExpSign = -1;
- str[len++]=ch;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
- if (ch >= '0' && ch <= '9') {
- while (ch >= '0' && ch <= '9') {
- exp = exp*10 + ch - '0';
- str[len++]=ch;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
- } else {
- CPPErrorToInfoLog("ERROR___ERROR_IN_EXPONENT");
- }
- exp *= ExpSign;
- }
-
- if (len == 0) {
- lval = 0.0f;
- strcpy(str,"0.0");
- } else {
- str[len]='\0';
- lval = lBuildFloatValue(str, str_len, exp - declen);
- }
- /* Suffix: */
-
- yylvalpp->sc_fval = lval;
- strcpy(yylvalpp->symbol_name,str);
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return CPP_FLOATCONSTANT;
-} /* lFloatConst */
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*/////////////////////////////////////// Normal Scanner ////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-static int byte_scan(InputSrc *in, yystypepp * yylvalpp)
-{
- char symbol_name[MAX_SYMBOL_NAME_LEN + 1];
- char string_val[MAX_STRING_LEN + 1];
- int AlreadyComplained;
- int len, ch, ii, ival = 0;
-
- for (;;) {
- yylvalpp->sc_int = 0;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
-
- while (ch == ' ' || ch == '\t' || ch == '\r') {
- yylvalpp->sc_int = 1;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
-
- cpp->ltokenLoc.file = cpp->currentInput->name;
- cpp->ltokenLoc.line = cpp->currentInput->line;
- len = 0;
- switch (ch) {
- default:
- return ch; /* Single character token */
- case EOF:
- return -1;
- case 'A': case 'B': case 'C': case 'D': case 'E':
- case 'F': case 'G': case 'H': case 'I': case 'J':
- case 'K': case 'L': case 'M': case 'N': case 'O':
- case 'P': case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X': case 'Y':
- case 'Z': case '_':
- case 'a': case 'b': case 'c': case 'd': case 'e':
- case 'f': case 'g': case 'h': case 'i': case 'j':
- case 'k': case 'l': case 'm': case 'n': case 'o':
- case 'p': case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x': case 'y':
- case 'z':
- do {
- if (len < MAX_SYMBOL_NAME_LEN) {
- symbol_name[len] = ch;
- len++;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- } else {
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
- } while ((ch >= 'a' && ch <= 'z') ||
- (ch >= 'A' && ch <= 'Z') ||
- (ch >= '0' && ch <= '9') ||
- ch == '_');
- if (len >= MAX_SYMBOL_NAME_LEN)
- len = MAX_SYMBOL_NAME_LEN - 1;
- symbol_name[len] = '\0';
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- yylvalpp->sc_ident = LookUpAddString(atable, symbol_name);
- return CPP_IDENTIFIER;
- break;
- case '0':
- yylvalpp->symbol_name[len++] = ch;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == 'x' || ch == 'X') {
- yylvalpp->symbol_name[len++] = ch;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if ((ch >= '0' && ch <= '9') ||
- (ch >= 'A' && ch <= 'F') ||
- (ch >= 'a' && ch <= 'f'))
- {
- AlreadyComplained = 0;
- ival = 0;
- do {
- yylvalpp->symbol_name[len++] = ch;
- if (ival <= 0x0fffffff) {
- if (ch >= '0' && ch <= '9') {
- ii = ch - '0';
- } else if (ch >= 'A' && ch <= 'F') {
- ii = ch - 'A' + 10;
- } else {
- ii = ch - 'a' + 10;
- }
- ival = (ival << 4) | ii;
- } else {
- if (!AlreadyComplained)
- CPPErrorToInfoLog("ERROR___HEX_CONST_OVERFLOW");
- AlreadyComplained = 1;
- }
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- } while ((ch >= '0' && ch <= '9') ||
- (ch >= 'A' && ch <= 'F') ||
- (ch >= 'a' && ch <= 'f'));
- } else {
- CPPErrorToInfoLog("ERROR___ERROR_IN_HEX_CONSTANT");
- }
- yylvalpp->symbol_name[len] = '\0';
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- yylvalpp->sc_int = ival;
- return CPP_INTCONSTANT;
- } else if (ch >= '0' && ch <= '7') { /* octal integer constants */
- AlreadyComplained = 0;
- ival = 0;
- do {
- yylvalpp->symbol_name[len++] = ch;
- if (ival <= 0x1fffffff) {
- ii = ch - '0';
- ival = (ival << 3) | ii;
- } else {
- if (!AlreadyComplained)
- CPPErrorToInfoLog("ERROR___OCT_CONST_OVERFLOW");
- AlreadyComplained = 1;
- }
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- } while (ch >= '0' && ch <= '7');
- if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'h' || ch == 'x'|| ch == 'E')
- return lFloatConst(yylvalpp->symbol_name, len, ch, yylvalpp);
- yylvalpp->symbol_name[len] = '\0';
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- yylvalpp->sc_int = ival;
- return CPP_INTCONSTANT;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- ch = '0';
- }
- /* Fall through... */
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- do {
- if (len < MAX_SYMBOL_NAME_LEN) {
- if (len > 0 || ch != '0') {
- yylvalpp->symbol_name[len] = ch;
- len++;
- }
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
- } while (ch >= '0' && ch <= '9');
- if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'h' || ch == 'x'|| ch == 'E') {
- return lFloatConst(yylvalpp->symbol_name, len, ch, yylvalpp);
- } else {
- yylvalpp->symbol_name[len] = '\0';
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- ival = 0;
- AlreadyComplained = 0;
- for (ii = 0; ii < len; ii++) {
- ch = yylvalpp->symbol_name[ii] - '0';
- if ((ival > 214748364) || (ival == 214748364 && ch >= 8)) {
- if (!AlreadyComplained)
- CPPErrorToInfoLog("ERROR___INTEGER_CONST_OVERFLOW");
- AlreadyComplained = 1;
- }
- ival = ival*10 + ch;
- }
- yylvalpp->sc_int = ival;
- if(ival==0)
- strcpy(yylvalpp->symbol_name,"0");
- return CPP_INTCONSTANT;
- }
- break;
- case '-':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '-') {
- return CPP_DEC_OP;
- } else if (ch == '=') {
- return CPP_SUB_ASSIGN;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '-';
- }
- case '+':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '+') {
- return CPP_INC_OP;
- } else if (ch == '=') {
- return CPP_ADD_ASSIGN;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '+';
- }
- case '*':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '=') {
- return CPP_MUL_ASSIGN;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '*';
- }
- case '%':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '=') {
- return CPP_MOD_ASSIGN;
- } else if (ch == '>'){
- return CPP_RIGHT_BRACE;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '%';
- }
- case ':':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '>') {
- return CPP_RIGHT_BRACKET;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return ':';
- }
- case '^':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '^') {
- return CPP_XOR_OP;
- } else {
- if (ch == '=')
- return CPP_XOR_ASSIGN;
- else{
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '^';
- }
- }
-
- case '=':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '=') {
- return CPP_EQ_OP;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '=';
- }
- case '!':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '=') {
- return CPP_NE_OP;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '!';
- }
- case '|':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '|') {
- return CPP_OR_OP;
- } else {
- if (ch == '=')
- return CPP_OR_ASSIGN;
- else{
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '|';
- }
- }
- case '&':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '&') {
- return CPP_AND_OP;
- } else {
- if (ch == '=')
- return CPP_AND_ASSIGN;
- else{
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '&';
- }
- }
- case '<':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '<') {
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if(ch == '=')
- return CPP_LEFT_ASSIGN;
- else{
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return CPP_LEFT_OP;
- }
- } else {
- if (ch == '=') {
- return CPP_LE_OP;
- } else {
- if (ch == '%')
- return CPP_LEFT_BRACE;
- else if (ch == ':')
- return CPP_LEFT_BRACKET;
- else{
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '<';
- }
- }
- }
- case '>':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '>') {
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if(ch == '=')
- return CPP_RIGHT_ASSIGN;
- else{
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return CPP_RIGHT_OP;
- }
- } else {
- if (ch == '=') {
- return CPP_GE_OP;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '>';
- }
- }
- case '.':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch >= '0' && ch <= '9') {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return lFloatConst(yylvalpp->symbol_name, 0, '.', yylvalpp);
- } else {
- if (ch == '.') {
- return -1; /* Special EOF hack */
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '.';
- }
- }
- case '/':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '/') {
- do {
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- } while (ch != '\n' && ch != EOF);
- if (ch == EOF)
- return -1;
- return '\n';
- } else if (ch == '*') {
- int nlcount = 0;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- do {
- while (ch != '*') {
- if (ch == '\n') nlcount++;
- if (ch == EOF) {
- CPPErrorToInfoLog("ERROR___EOF_IN_COMMENT");
- return -1;
- }
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == EOF) {
- CPPErrorToInfoLog("ERROR___EOF_IN_COMMENT");
- return -1;
- }
- } while (ch != '/');
- if (nlcount) {
- return '\n';
- }
- /* Go try it again... */
- } else if (ch == '=') {
- return CPP_DIV_ASSIGN;
- } else {
- cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
- return '/';
- }
- break;
- case '"':
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- while (ch != '"' && ch != '\n' && ch != EOF) {
- if (ch == '\\') {
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- if (ch == '\n' || ch == EOF) {
- break;
- }
- }
- if (len < MAX_STRING_LEN) {
- string_val[len] = ch;
- len++;
- ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
- }
- };
- string_val[len] = '\0';
- if (ch == '"') {
- yylvalpp->sc_ident = LookUpAddString(atable, string_val);
- return CPP_STRCONSTANT;
- } else {
- CPPErrorToInfoLog("ERROR___CPP_EOL_IN_STRING");
- return ERROR_SY;
- }
- }
- }
-} /* byte_scan */
-
-int yylex_CPP(char* buf, int maxSize)
-{
- yystypepp yylvalpp;
- int token = '\n';
-
- for(;;) {
-
- char* tokenString = 0;
- token = cpp->currentInput->scan(cpp->currentInput, &yylvalpp);
- if(check_EOF(token))
- return 0;
- if (token == '#' && (cpp->previous_token == '\n'||cpp->previous_token==0)) {
- token = readCPPline(&yylvalpp);
- if(check_EOF(token))
- return 0;
- continue;
- }
- cpp->previous_token = token;
- /* expand macros */
- if (token == CPP_IDENTIFIER && MacroExpand(yylvalpp.sc_ident, &yylvalpp)) {
- cpp->notAVersionToken = 1;
- continue;
- }
-
- if (token == '\n')
- continue;
-
- if (token == CPP_IDENTIFIER) {
- cpp->notAVersionToken = 1;
- tokenString = GetStringOfAtom(atable,yylvalpp.sc_ident);
- } else if (token == CPP_FLOATCONSTANT||token == CPP_INTCONSTANT){
- cpp->notAVersionToken = 1;
- tokenString = yylvalpp.symbol_name;
- } else {
- cpp->notAVersionToken = 1;
- tokenString = GetStringOfAtom(atable,token);
- }
-
- if (tokenString) {
- if ((signed)strlen(tokenString) >= maxSize) {
- cpp->tokensBeforeEOF = 1;
- return maxSize;
- } else if (strlen(tokenString) > 0) {
- strcpy(buf, tokenString);
- cpp->tokensBeforeEOF = 1;
- return (int)strlen(tokenString);
- }
-
- return 0;
- }
- }
-
- return 0;
-} /* yylex */
-
-/*Checks if the token just read is EOF or not. */
-int check_EOF(int token)
-{
- if(token==-1){
- if(cpp->ifdepth >0){
- CPPErrorToInfoLog("#endif missing!! Compilation stopped");
- cpp->CompileError=1;
- }
- return 1;
- }
- return 0;
-}
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*///////////////////////////////////// End of scanner.c ////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h
deleted file mode 100755
index 15472b5bf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/scanner.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* scanner.h */
-/* */
-
-#if !defined(__SCANNER_H)
-#define __SCANNER_H 1
-
-#define MAX_SYMBOL_NAME_LEN 128
-#define MAX_STRING_LEN 512
-
-#include "parser.h"
-
-/* Not really atom table stuff but needed first... */
-
-typedef struct SourceLoc_Rec {
- unsigned short file, line;
-} SourceLoc;
-
-int yyparse (void);
-
-int yylex_CPP(char* buf, int maxSize);
-
-typedef struct InputSrc {
- struct InputSrc *prev;
- int (*scan)(struct InputSrc *, yystypepp *);
- int (*getch)(struct InputSrc *, yystypepp *);
- void (*ungetch)(struct InputSrc *, int, yystypepp *);
- int name; /* atom */
- int line;
-} InputSrc;
-
-int InitScanner(CPPStruct *cpp); /* Intialise the cpp scanner. */
-int ScanFromString(char *); /* Start scanning the input from the string mentioned. */
-int check_EOF(int); /* check if we hit a EOF abruptly */
-void CPPErrorToInfoLog(char *); /* sticking the msg,line into the Shader's.Info.log */
-void SetLineNumber(int);
-void SetStringNumber(int);
-void IncLineNumber(void);
-void DecLineNumber(void);
-int FreeScanner(void); /* Free the cpp scanner */
-#endif /* !(defined(__SCANNER_H) */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h
deleted file mode 100755
index 667ada6a2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/slglobals.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* slglobals.h */
-/* */
-
-#if !defined(__SLGLOBALS_H)
-#define __SLGLOBALS_H 1
-
-typedef struct CPPStruct_Rec CPPStruct;
-
-extern CPPStruct *cpp;
-
-#undef CPPC_DEBUG_THE_COMPILER
-#if defined(_DEBUG)
-#define CPPC_DEBUG_THE_COMPILER 1
-#endif
-
-#undef CPPC_ENABLE_TOOLS
-#define CPPC_ENABLE_TOOLS 1
-
-#include "memory.h"
-#include "atom.h"
-#include "scanner.h"
-#include "cpp.h"
-#include "tokens.h"
-#include "symbols.h"
-#include "compile.h"
-#if !defined(NO_PARSER)
-#include "parser.h"
-#endif
-
-#if !defined(NULL)
-#define NULL 0
-#endif
-
-#endif /* !(defined(__SLGLOBALS_H) */
-
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c
deleted file mode 100755
index e807fe343..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* symbols.c */
-/* */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "slglobals.h"
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*///////////////////////////////// Symbol Table Variables: /////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-Scope *ScopeList = NULL;
-Scope *CurrentScope = NULL;
-Scope *GlobalScope = NULL;
-
-static void unlinkScope(void *_scope) {
- Scope *scope = _scope;
-
- if (scope->next)
- scope->next->prev = scope->prev;
- if (scope->prev)
- scope->prev->next = scope->next;
- else
- ScopeList = scope->next;
-}
-
-/*
- * NewScope()
- *
- */
-Scope *NewScopeInPool(MemoryPool *pool)
-{
- Scope *lScope;
-
- lScope = mem_Alloc(pool, sizeof(Scope));
- lScope->pool = pool;
- lScope->parent = NULL;
- lScope->funScope = NULL;
- lScope->symbols = NULL;
-
- lScope->level = 0;
-
- lScope->programs = NULL;
- if ((lScope->next = ScopeList))
- ScopeList->prev = lScope;
- lScope->prev = 0;
- ScopeList = lScope;
- mem_AddCleanup(pool, unlinkScope, lScope);
- return lScope;
-} /* NewScope */
-
-/*
- * PushScope()
- *
- */
-
-void PushScope(Scope *fScope)
-{
- Scope *lScope;
-
- if (CurrentScope) {
- fScope->level = CurrentScope->level + 1;
- if (fScope->level == 1) {
- if (!GlobalScope) {
- /* HACK - CTD -- if GlobalScope==NULL and level==1, we're
- * defining a function in the superglobal scope. Things
- * will break if we leave the level as 1, so we arbitrarily
- * set it to 2 */
- fScope->level = 2;
- }
- }
- if (fScope->level >= 2) {
- lScope = fScope;
- while (lScope->level > 2)
- lScope = lScope->next;
- fScope->funScope = lScope;
- }
- } else {
- fScope->level = 0;
- }
- fScope->parent = CurrentScope;
- CurrentScope = fScope;
-} /* PushScope */
-
-/*
- * PopScope()
- *
- */
-
-Scope *PopScope(void)
-{
- Scope *lScope;
-
- lScope = CurrentScope;
- if (CurrentScope)
- CurrentScope = CurrentScope->parent;
- return lScope;
-} /* PopScope */
-
-/*
- * NewSymbol() - Allocate a new symbol node;
- *
- */
-
-Symbol *NewSymbol(SourceLoc *loc, Scope *fScope, int name, symbolkind kind)
-{
- Symbol *lSymb;
- char *pch;
- int ii;
-
- lSymb = (Symbol *) mem_Alloc(fScope->pool, sizeof(Symbol));
- lSymb->left = NULL;
- lSymb->right = NULL;
- lSymb->next = NULL;
- lSymb->name = name;
- lSymb->loc = *loc;
- lSymb->kind = kind;
-
- /* Clear union area: */
-
- pch = (char *) &lSymb->details;
- for (ii = 0; ii < sizeof(lSymb->details); ii++)
- *pch++ = 0;
- return lSymb;
-} /* NewSymbol */
-
-/*
- * lAddToTree() - Using a binary tree is not a good idea for basic atom values because they
- * are generated in order. We'll fix this later (by reversing the bit pattern).
- */
-
-static void lAddToTree(Symbol **fSymbols, Symbol *fSymb)
-{
- Symbol *lSymb;
- int lrev, frev;
-
- lSymb = *fSymbols;
- if (lSymb) {
- frev = GetReversedAtom(atable, fSymb->name);
- while (lSymb) {
- lrev = GetReversedAtom(atable, lSymb->name);
- if (lrev == frev) {
- CPPErrorToInfoLog("GetAtomString(atable, fSymb->name)");
- break;
- } else {
- if (lrev > frev) {
- if (lSymb->left) {
- lSymb = lSymb->left;
- } else {
- lSymb->left = fSymb;
- break;
- }
- } else {
- if (lSymb->right) {
- lSymb = lSymb->right;
- } else {
- lSymb->right = fSymb;
- break;
- }
- }
- }
- }
- } else {
- *fSymbols = fSymb;
- }
-} /* lAddToTree */
-
-
-/*
- * AddSymbol() - Add a variable, type, or function name to a scope.
- *
- */
-
-Symbol *AddSymbol(SourceLoc *loc, Scope *fScope, int atom, symbolkind kind)
-{
- Symbol *lSymb;
-
- if (!fScope)
- fScope = CurrentScope;
- lSymb = NewSymbol(loc, fScope, atom, kind);
- lAddToTree(&fScope->symbols, lSymb);
- return lSymb;
-} /* AddSymbol */
-
-
-/*********************************************************************************************/
-/************************************ Symbol Semantic Functions ******************************/
-/*********************************************************************************************/
-
-/*
- * LookUpLocalSymbol()
- *
- */
-
-Symbol *LookUpLocalSymbol(Scope *fScope, int atom)
-{
- Symbol *lSymb;
- int rname, ratom;
-
- ratom = GetReversedAtom(atable, atom);
- if (!fScope)
- fScope = CurrentScope;
- lSymb = fScope->symbols;
- while (lSymb) {
- rname = GetReversedAtom(atable, lSymb->name);
- if (rname == ratom) {
- return lSymb;
- } else {
- if (rname > ratom) {
- lSymb = lSymb->left;
- } else {
- lSymb = lSymb->right;
- }
- }
- }
- return NULL;
-} /* LookUpLocalSymbol */
-
-/*
- * LookUpSymbol()
- *
- */
-
-Symbol *LookUpSymbol(Scope *fScope, int atom)
-{
- Symbol *lSymb;
-
- if (!fScope)
- fScope = CurrentScope;
- while (fScope) {
- lSymb = LookUpLocalSymbol(fScope, atom);
- if (lSymb)
- return lSymb;
- fScope = fScope->parent;
- }
- return NULL;
-} /* LookUpSymbol */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h
deleted file mode 100755
index 65cba9d6c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/symbols.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* symbols.h */
-/* */
-
-#if !defined(__SYMBOLS_H)
-#define __SYMBOLS_H 1
-
-#include "memory.h"
-
-typedef enum symbolkind {
- MACRO_S
-} symbolkind;
-
-/* Typedefs for things defined here in "symbols.h": */
-
-typedef struct Scope_Rec Scope;
-typedef struct Symbol_Rec Symbol;
-
-typedef struct SymbolList_Rec {
- struct SymbolList_Rec *next;
- Symbol *symb;
-} SymbolList;
-
-struct Scope_Rec {
- Scope *next, *prev; /* doubly-linked list of all scopes */
- Scope *parent;
- Scope *funScope; /* Points to base scope of enclosing function */
- MemoryPool *pool; /* pool used for allocation in this scope */
- Symbol *symbols;
-
- int level; /* 0 = super globals, 1 = globals, etc. */
-
- /* Only used at global scope (level 1): */
- SymbolList *programs; /* List of programs for this compilation. */
-};
-
-
-/* Symbol table is a simple binary tree. */
-
-#include "cpp.h" /* to get MacroSymbol def */
-
-struct Symbol_Rec {
- Symbol *left, *right;
- Symbol *next;
- int name; /* Name atom */
- SourceLoc loc;
- symbolkind kind;
- union {
- MacroSymbol mac;
- } details;
-};
-
-extern Scope *CurrentScope;
-extern Scope *GlobalScope;
-extern Scope *ScopeList;
-
-Scope *NewScopeInPool(MemoryPool *);
-#define NewScope() NewScopeInPool(CurrentScope->pool)
-void PushScope(Scope *fScope);
-Scope *PopScope(void);
-Symbol *NewSymbol(SourceLoc *loc, Scope *fScope, int name, symbolkind kind);
-Symbol *AddSymbol(SourceLoc *loc, Scope *fScope, int atom, symbolkind kind);
-Symbol *LookUpLocalSymbol(Scope *fScope, int atom);
-Symbol *LookUpSymbol(Scope *fScope, int atom);
-void CPPErrorToInfoLog(char *);
-
-
-#endif /* !defined(__SYMBOLS_H) */
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c
deleted file mode 100755
index 815277db5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* tokens.c */
-/* */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "slglobals.h"
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*////////////////////// Preprocessor and Token Recorder and Playback: //////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-
-/*
- * idstr()
- * Copy a string to a malloc'ed block and convert it into something suitable
- * for an ID
- *
- */
-
-static char *idstr(const char *fstr)
-{
- size_t len;
- char *str, *t;
- const char *f;
-
- len = strlen(fstr);
- str = (char *) malloc(len + 1);
- for (f=fstr, t=str; *f; f++) {
- if (isalnum(*f)) *t++ = *f;
- else if (*f == '.' || *f == '/') *t++ = '_';
- }
- *t = 0;
- return str;
-} /* idstr */
-
-
-/*
- * lNewBlock()
- *
- */
-
-static TokenBlock *lNewBlock(TokenStream *fTok)
-{
- TokenBlock *lBlock;
-
- lBlock = (TokenBlock *) malloc(sizeof(TokenBlock) + 256);
- lBlock->count = 0;
- lBlock->current = 0;
- lBlock->data = (unsigned char *) lBlock + sizeof(TokenBlock);
- lBlock->max = 256;
- lBlock->next = NULL;
- if (fTok->head) {
- fTok->current->next = lBlock;
- } else {
- fTok->head = lBlock;
- }
- fTok->current = lBlock;
- return lBlock;
-} /* lNewBlock */
-
-/*
- * lAddByte()
- *
- */
-
-static void lAddByte(TokenStream *fTok, unsigned char fVal)
-{
- TokenBlock *lBlock;
- lBlock = fTok->current;
- if (lBlock->count >= lBlock->max)
- lBlock = lNewBlock(fTok);
- lBlock->data[lBlock->count++] = fVal;
-} /* lAddByte */
-
-
-
-/*
- * lReadByte() - Get the next byte from a stream.
- *
- */
-
-static int lReadByte(TokenStream *pTok)
-{
- TokenBlock *lBlock;
- int lval = -1;
-
- lBlock = pTok->current;
- if (lBlock) {
- if (lBlock->current >= lBlock->count) {
- lBlock = lBlock->next;
- if (lBlock)
- lBlock->current = 0;
- pTok->current = lBlock;
- }
- if (lBlock)
- lval = lBlock->data[lBlock->current++];
- }
- return lval;
-} /* lReadByte */
-
-/*///////////////////////////////////// Global Functions:////////////////////////////////////// */
-
-/*
- * NewTokenStream()
- *
- */
-
-TokenStream *NewTokenStream(const char *name)
-{
- TokenStream *pTok;
-
- pTok = (TokenStream *) malloc(sizeof(TokenStream));
- pTok->next = NULL;
- pTok->name = idstr(name);
- pTok->head = NULL;
- pTok->current = NULL;
- lNewBlock(pTok);
- return pTok;
-} /* NewTokenStream */
-
-/*
- * DeleteTokenStream()
- *
- */
-
-void DeleteTokenStream(TokenStream *pTok)
-{
- TokenBlock *pBlock, *nBlock;
-
- if (pTok) {
- pBlock = pTok->head;
- while (pBlock) {
- nBlock = pBlock->next;
- free(pBlock);
- pBlock = nBlock;
- }
- if (pTok->name)
- free(pTok->name);
- free(pTok);
- }
-} /* DeleteTokenStream */
-
-/*
- * RecordToken() - Add a token to the end of a list for later playback or printout.
- *
- */
-
-void RecordToken(TokenStream *pTok, int token, yystypepp * yylvalpp)
-{
- const char *s;
- unsigned char *str=NULL;
-
- if (token > 256)
- lAddByte(pTok, (unsigned char)((token & 0x7f) + 0x80));
- else
- lAddByte(pTok, (unsigned char)(token & 0x7f));
- switch (token) {
- case CPP_IDENTIFIER:
- case CPP_TYPEIDENTIFIER:
- case CPP_STRCONSTANT:
- s = GetAtomString(atable, yylvalpp->sc_ident);
- while (*s)
- lAddByte(pTok, (unsigned char) *s++);
- lAddByte(pTok, 0);
- break;
- case CPP_FLOATCONSTANT:
- case CPP_INTCONSTANT:
- str=yylvalpp->symbol_name;
- while (*str){
- lAddByte(pTok,(unsigned char) *str);
- *str++;
- }
- lAddByte(pTok, 0);
- break;
- case '(':
- lAddByte(pTok, (unsigned char)(yylvalpp->sc_int ? 1 : 0));
- default:
- break;
- }
-} /* RecordToken */
-
-/*
- * RewindTokenStream() - Reset a token stream in preperation for reading.
- *
- */
-
-void RewindTokenStream(TokenStream *pTok)
-{
- if (pTok->head) {
- pTok->current = pTok->head;
- pTok->current->current = 0;
- }
-} /* RewindTokenStream */
-
-/*
- * ReadToken() - Read the next token from a stream.
- *
- */
-
-int ReadToken(TokenStream *pTok, yystypepp * yylvalpp)
-{
- char symbol_name[MAX_SYMBOL_NAME_LEN + 1];
- char string_val[MAX_STRING_LEN + 1];
- int ltoken, len;
- char ch;
-
- ltoken = lReadByte(pTok);
- if (ltoken >= 0) {
- if (ltoken > 127)
- ltoken += 128;
- switch (ltoken) {
- case CPP_IDENTIFIER:
- case CPP_TYPEIDENTIFIER:
- len = 0;
- ch = lReadByte(pTok);
- while ((ch >= 'a' && ch <= 'z') ||
- (ch >= 'A' && ch <= 'Z') ||
- (ch >= '0' && ch <= '9') ||
- ch == '_')
- {
- if (len < MAX_SYMBOL_NAME_LEN) {
- symbol_name[len] = ch;
- len++;
- ch = lReadByte(pTok);
- }
- }
- symbol_name[len] = '\0';
- assert(ch == '\0');
- yylvalpp->sc_ident = LookUpAddString(atable, symbol_name);
- return CPP_IDENTIFIER;
- break;
- case CPP_STRCONSTANT:
- len = 0;
- while ((ch = lReadByte(pTok)) != 0)
- if (len < MAX_STRING_LEN)
- string_val[len++] = ch;
- string_val[len] = 0;
- yylvalpp->sc_ident = LookUpAddString(atable, string_val);
- break;
- case CPP_FLOATCONSTANT:
- len = 0;
- ch = lReadByte(pTok);
- while ((ch >= '0' && ch <= '9')||(ch=='e'||ch=='E'||ch=='.')||(ch=='+'||ch=='-'))
- {
- if (len < MAX_SYMBOL_NAME_LEN) {
- symbol_name[len] = ch;
- len++;
- ch = lReadByte(pTok);
- }
- }
- symbol_name[len] = '\0';
- assert(ch == '\0');
- strcpy(yylvalpp->symbol_name,symbol_name);
- yylvalpp->sc_fval=(float)atof(yylvalpp->symbol_name);
- break;
- case CPP_INTCONSTANT:
- len = 0;
- ch = lReadByte(pTok);
- while ((ch >= '0' && ch <= '9'))
- {
- if (len < MAX_SYMBOL_NAME_LEN) {
- symbol_name[len] = ch;
- len++;
- ch = lReadByte(pTok);
- }
- }
- symbol_name[len] = '\0';
- assert(ch == '\0');
- strcpy(yylvalpp->symbol_name,symbol_name);
- yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
- break;
- case '(':
- yylvalpp->sc_int = lReadByte(pTok);
- break;
- }
- return ltoken;
- }
- return EOF_SY;
-} /* ReadToken */
-
-typedef struct TokenInputSrc {
- InputSrc base;
- TokenStream *tokens;
- int (*final)(CPPStruct *);
-} TokenInputSrc;
-
-static int scan_token(TokenInputSrc *in, yystypepp * yylvalpp)
-{
- int token = ReadToken(in->tokens, yylvalpp);
- int (*final)(CPPStruct *);
- cpp->tokenLoc->file = cpp->currentInput->name;
- cpp->tokenLoc->line = cpp->currentInput->line;
- if (token == '\n') {
- in->base.line++;
- return token;
- }
- if (token > 0) return token;
- cpp->currentInput = in->base.prev;
- final = in->final;
- free(in);
- if (final && !final(cpp)) return -1;
- return cpp->currentInput->scan(cpp->currentInput, yylvalpp);
-}
-
-int ReadFromTokenStream(TokenStream *ts, int name, int (*final)(CPPStruct *))
-{
- TokenInputSrc *in = malloc(sizeof(TokenInputSrc));
- memset(in, 0, sizeof(TokenInputSrc));
- in->base.name = name;
- in->base.prev = cpp->currentInput;
- in->base.scan = (int (*)(InputSrc *, yystypepp *))scan_token;
- in->base.line = 1;
- in->tokens = ts;
- in->final = final;
- RewindTokenStream(ts);
- cpp->currentInput = &in->base;
- return 1;
-}
-
-typedef struct UngotToken {
- InputSrc base;
- int token;
- yystypepp lval;
-} UngotToken;
-
-static int reget_token(UngotToken *t, yystypepp * yylvalpp)
-{
- int token = t->token;
- *yylvalpp = t->lval;
- cpp->currentInput = t->base.prev;
- free(t);
- return token;
-}
-
-void UngetToken(int token, yystypepp * yylvalpp) {
- UngotToken *t = malloc(sizeof(UngotToken));
- memset(t, 0, sizeof(UngotToken));
- t->token = token;
- t->lval = *yylvalpp;
- t->base.scan = (void *)reget_token;
- t->base.prev = cpp->currentInput;
- t->base.name = cpp->currentInput->name;
- t->base.line = cpp->currentInput->line;
- cpp->currentInput = &t->base;
-}
-
-
-void DumpTokenStream(FILE *fp, TokenStream *s, yystypepp * yylvalpp) {
- int token;
- char str[100];
-
- if (fp == 0) fp = stdout;
- RewindTokenStream(s);
- while ((token = ReadToken(s, yylvalpp)) > 0) {
- switch (token) {
- case CPP_IDENTIFIER:
- case CPP_TYPEIDENTIFIER:
- sprintf(str, "%s ", GetAtomString(atable, yylvalpp->sc_ident));
- break;
- case CPP_STRCONSTANT:
- sprintf(str, "\"%s\"", GetAtomString(atable, yylvalpp->sc_ident));
- break;
- case CPP_FLOATCONSTANT:
- /*printf("%g9.6 ", yylvalpp->sc_fval); */
- break;
- case CPP_INTCONSTANT:
- /*printf("%d ", yylvalpp->sc_int); */
- break;
- default:
- if (token >= 127)
- sprintf(str, "%s ", GetAtomString(atable, token));
- else
- sprintf(str, "%c", token);
- break;
- }
- CPPDebugLogMsg(str);
- }
-}
-
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
-/*///////////////////////////////////// End of tokens.c /////////////////////////////////////// */
-/*///////////////////////////////////////////////////////////////////////////////////////////// */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h
deleted file mode 100755
index 0a25bf7c8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/preprocessor/tokens.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* */
-/*Copyright (C) 2002-2005 3Dlabs Inc. Ltd. */
-/*All rights reserved. */
-/* */
-/*Redistribution and use in source and binary forms, with or without */
-/*modification, are permitted provided that the following conditions */
-/*are met: */
-/* */
-/* Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials provided */
-/* with the distribution. */
-/* */
-/* Neither the name of 3Dlabs Inc. Ltd. nor the names of its */
-/* contributors may be used to endorse or promote products derived */
-/* from this software without specific prior written permission. */
-/* */
-/*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
-/*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
-/*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
-/*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */
-/*COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
-/*INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */
-/*BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/*LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */
-/*CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */
-/*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
-/*ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
-/*POSSIBILITY OF SUCH DAMAGE. */
-/* */
-/****************************************************************************\
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms. If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder.
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-\****************************************************************************/
-/* */
-/* tokens.h */
-/* */
-
-#if !defined(__TOKENS_H)
-#define __TOKENS_H 1
-
-#include "parser.h"
-
-#define EOF_SY (-1)
-
-typedef struct TokenBlock_Rec TokenBlock;
-
-typedef struct TokenStream_Rec {
- struct TokenStream_Rec *next;
- char *name;
- TokenBlock *head;
- TokenBlock *current;
-} TokenStream;
-
-struct TokenBlock_Rec {
- TokenBlock *next;
- int current;
- int count;
- int max;
- unsigned char *data;
-};
-
-extern TokenStream stdlib_cpp_stream;
-
-
-TokenStream *NewTokenStream(const char *name);
-void DeleteTokenStream(TokenStream *pTok);
-void RecordToken(TokenStream *pTok, int token, yystypepp * yylvalpp);
-void RewindTokenStream(TokenStream *pTok);
-int ReadToken(TokenStream *pTok, yystypepp * yylvalpp);
-int ReadFromTokenStream(TokenStream *pTok, int name, int (*final)(CPPStruct *));
-void UngetToken(int, yystypepp * yylvalpp);
-
-#if defined(CPPC_ENABLE_TOOLS)
-
-void DumpTokenStream(FILE *, TokenStream *, yystypepp * yylvalpp);
-
-#endif /* defined(CPPC_ENABLE_TOOLS) */
-
-#endif /* !defined(__TOKENS_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/unistd.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/unistd.h
deleted file mode 100755
index efadd63fd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/MachineIndependent/unistd.h
+++ /dev/null
@@ -1 +0,0 @@
-// This is a NULL file and is meant to be empty
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp
deleted file mode 100755
index 2e6f8c69b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#define SH_EXPORTING
-#include "Initialisation.h"
-#include "Include/InitializeGlobals.h"
-#include "Include/InitializeParseContext.h"
-#include "Public/ShaderLang.h"
-
-OS_TLSIndex GlobalProcessFlag = OS_INVALID_TLS_INDEX;
-
-bool InitProcess()
-{
- if (GlobalProcessFlag != OS_INVALID_TLS_INDEX) {
- //
- // Function is re-entrant.
- //
- return true;
- }
-
- GlobalProcessFlag = OS_AllocTLSIndex();
-
- if (GlobalProcessFlag == OS_INVALID_TLS_INDEX) {
- assert (0 && "InitProcess(): Failed to allocate TLS area for init flag");
- return false;
- }
-
- if (!InitializePoolIndex()) {
- assert (0 && "InitProcess(): Failed to initalize global pool");
- return false;
- }
-
- if (!InitializeParseContextIndex()) {
- assert (0 && "InitProcess(): Failed to initalize parse context");
- return false;
- }
-
- InitThread();
- return true;
-}
-
-
-bool InitThread()
-{
- //
- // This function is re-entrant
- //
- if (GlobalProcessFlag == OS_INVALID_TLS_INDEX) {
- assert(0 && "InitThread(): Process hasn't been initalised.");
- return false;
- }
-
- if (OS_GetTLSValue(GlobalProcessFlag) != 0) {
- return true;
- }
-
- InitializeGlobalPools();
-
- if(!InitializeGlobalParseContext())
- return false;
-
- if(!OS_SetTLSValue(GlobalProcessFlag, (void *)1)) {
- assert(0 && "InitThread(): Unable to set init flag.");
- return false;
- }
-
- return true;
-}
-
-
-bool DetachThread()
-{
- bool retFlag = true;
-
- if (GlobalProcessFlag == OS_INVALID_TLS_INDEX) {
- assert(0 && "DetachThread(): Process hasn't been initalised.");
- return false;
- }
-
- //
- // Function is re-entrant and this thread may not have been initalised.
- //
- if (OS_GetTLSValue(GlobalProcessFlag) != 0)
- {
- if(!OS_SetTLSValue(GlobalProcessFlag, (void *)0)) {
- assert(0 && "DetachThread(): Unable to clear init flag.");
- retFlag = false;
- }
-
- FreeGlobalPools();
-
- if (!FreeParseContext())
- retFlag = false;
- }
-
- return retFlag;
-}
-
-bool DetachProcess()
-{
- bool retFlag = true;
-
- if (GlobalProcessFlag == OS_INVALID_TLS_INDEX)
- return true;
-
- ShFinalize();
-
- retFlag = DetachThread();
-
- FreePoolIndex();
-
- if(!FreeParseContextIndex())
- retFlag = false;
-
- OS_FreeTLSIndex(GlobalProcessFlag);
- GlobalProcessFlag = OS_INVALID_TLS_INDEX;
-
- return retFlag;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.h
deleted file mode 100755
index 1cfd97eeb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/OGLCompilersDLL/Initialisation.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-#ifndef __INITIALISATION_H
-#define __INITIALISATION_H
-
-
-#include "osinclude.h"
-
-
-bool InitProcess();
-bool InitThread();
-bool DetachThread();
-bool DetachProcess();
-
-#endif // __INITIALISATION_H
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/osinclude.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/osinclude.h
deleted file mode 100755
index 8b20b961c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/osinclude.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef __OSINCLUDE_H
-#define __OSINCLUDE_H
-
-//
-// This file contains any Linux specific functions.
-//
-
-/* WORKAROUND: linux builds seem not to define "linux" */
-/*#if !(defined(linux))
-#error Trying to include a Linux specific file in a non-Linux build.
-#endif*/
-
-#include <pthread.h>
-#include <semaphore.h>
-#include <assert.h>
-#include <errno.h>
-#include "Include/InitializeGlobals.h"
-#include "Include/PoolAlloc.h"
-
-#define _vsnprintf vsnprintf
-
-void DetachThreadLinux(void *);
-
-//
-// Thread Local Storage Operations
-//
-typedef unsigned int OS_TLSIndex;
-#define OS_INVALID_TLS_INDEX 0xFFFFFFFF
-
-OS_TLSIndex OS_AllocTLSIndex();
-bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
-bool OS_FreeTLSIndex(OS_TLSIndex nIndex);
-
-
-inline void * OS_GetTLSValue(OS_TLSIndex nIndex)
-{
- //
- // This function should return 0 if nIndex is invalid.
- //
- assert(nIndex != OS_INVALID_TLS_INDEX);
- return (pthread_getspecific(nIndex));
-}
-
-#endif // __OSINCLUDE_H
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/ossource.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/ossource.cpp
deleted file mode 100755
index 4bcd66a31..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Linux/ossource.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// This file contains the Linux specific functions
-//
-#include "osinclude.h"
-#include "Initialisation.h"
-
-/*#if !(defined(linux))
-#error Trying to build a Linux specific file in a non-Linux build.
-#endif*/
-
-//
-// Thread cleanup
-//
-
-//
-// Wrapper for Linux call to DetachThread. This is required as pthread_cleanup_push() expects
-// the cleanup routine to return void.
-//
-void DetachThreadLinux(void *)
-{
- DetachThread();
-}
-
-
-//
-// Registers cleanup handler, sets cancel type and state, and excecutes the thread specific
-// cleanup handler. This function will be called in the Standalone.cpp for regression
-// testing. When OpenGL applications are run with the driver code, Linux OS does the
-// thread cleanup.
-//
-void OS_CleanupThreadData(void)
-{
- int old_cancel_state, old_cancel_type;
- void *cleanupArg = NULL;
-
- //
- // Set thread cancel state and push cleanup handler.
- //
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancel_state);
- pthread_cleanup_push(DetachThreadLinux, (void *) cleanupArg);
-
- //
- // Put the thread in deferred cancellation mode.
- //
- pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &old_cancel_type);
-
- //
- // Pop cleanup handler and execute it prior to unregistering the cleanup handler.
- //
- pthread_cleanup_pop(1);
-
- //
- // Restore the thread's previous cancellation mode.
- //
- pthread_setcanceltype(old_cancel_state, NULL);
-}
-
-
-//
-// Thread Local Storage Operations
-//
-OS_TLSIndex OS_AllocTLSIndex()
-{
- pthread_key_t pPoolIndex;
-
- //
- // Create global pool key.
- //
- if ((pthread_key_create(&pPoolIndex, NULL)) != 0) {
- assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
- return false;
- }
- else
- return pPoolIndex;
-}
-
-
-bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
-{
- if (nIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
- return false;
- }
-
- if (pthread_setspecific(nIndex, lpvValue) == 0)
- return true;
- else
- return false;
-}
-
-
-bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
-{
- if (nIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
- return false;
- }
-
- //
- // Delete the global pool key.
- //
- if (pthread_key_delete(nIndex) == 0)
- return true;
- else
- return false;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/osinclude.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/osinclude.h
deleted file mode 100755
index 97a9e9f3d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/osinclude.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#ifndef __OSINCLUDE_H
-#define __OSINCLUDE_H
-
-//
-// This file contains contains the window's specific datatypes and
-// declares any windows specific functions.
-//
-
-#if !(defined(_WIN32) || defined(_WIN64))
-#error Trying to include a windows specific file in a non windows build.
-#endif
-
-#define STRICT
-#define VC_EXTRALEAN 1
-#include <windows.h>
-#include <assert.h>
-
-//
-// Thread Local Storage Operations
-//
-typedef DWORD OS_TLSIndex;
-#define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
-
-OS_TLSIndex OS_AllocTLSIndex();
-bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
-bool OS_FreeTLSIndex(OS_TLSIndex nIndex);
-
-inline void* OS_GetTLSValue(OS_TLSIndex nIndex)
-{
- assert(nIndex != OS_INVALID_TLS_INDEX);
- return TlsGetValue(nIndex);
-}
-
-#endif // __OSINCLUDE_H
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/ossource.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/ossource.cpp
deleted file mode 100755
index 35d086614..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/OSDependent/Windows/ossource.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-
-#include "Initialisation.h"
-
-//
-// This file contains contains the window's specific functions
-//
-
-#if !(defined(_WIN32) || defined(_WIN64))
-#error Trying to build a windows specific file in a non windows build.
-#endif
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- if (!InitProcess())
- return false;
- break;
- case DLL_THREAD_ATTACH:
- if (!InitThread())
- return false;
- break;
-
- case DLL_THREAD_DETACH:
-
- if (!DetachThread())
- return false;
- break;
-
- case DLL_PROCESS_DETACH:
-
- DetachProcess();
- break;
-
- default:
- assert(0 && "DllMain(): Reason for calling DLL Main is unknown");
- return false;
- }
-
- return true;
-}
-
-//
-// Thread Local Storage Operations
-//
-OS_TLSIndex OS_AllocTLSIndex()
-{
- DWORD dwIndex = TlsAlloc();
- if (dwIndex == TLS_OUT_OF_INDEXES) {
- assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
- return (OS_INVALID_TLS_INDEX);
- }
-
- return dwIndex;
-}
-
-
-bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
-{
- if (nIndex == OS_INVALID_TLS_INDEX)
- {
- assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
- return false;
- }
-
- if (TlsSetValue(nIndex, lpvValue))
- return true;
- else
- return false;
-}
-
-
-bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
-{
- if (nIndex == OS_INVALID_TLS_INDEX) {
- assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
- return false;
- }
-
- if (TlsFree(nIndex))
- return true;
- else
- return false;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLang.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLang.h
deleted file mode 100755
index 34b1688e8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLang.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
-//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef _COMPILER_INTERFACE_INCLUDED_
-#define _COMPILER_INTERFACE_INCLUDED_
-
-#include "../Include/ResourceLimits.h"
-
-#ifdef _WIN32
-#define C_DECL __cdecl
-/*#ifdef SH_EXPORTING
- #define SH_IMPORT_EXPORT __declspec(dllexport)
-#else
- #define SH_IMPORT_EXPORT __declspec(dllimport)
-#endif*/
-/* disable DLL linking */
-#define SH_IMPORT_EXPORT
-#else
-#define SH_IMPORT_EXPORT
-#define __fastcall
-#define C_DECL
-#endif
-
-/*
-// This is the platform independent interface between an OGL driver
-// and the shading language compiler/linker.
-*/
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/*
-// Driver must call this first, once, before doing any other
-// compiler/linker operations.
-*/
-SH_IMPORT_EXPORT int ShInitialize();
-/*
-// Driver should call this at shutdown.
-*/
-SH_IMPORT_EXPORT int __fastcall ShFinalize();
-
-/*
-// Types of languages the compiler can consume.
-*/
-typedef enum {
- EShLangVertex,
- EShLangFragment,
- EShLangPack,
- EShLangUnpack,
- EShLangCount
-} EShLanguage;
-
-/*
-// Types of output the linker will create.
-*/
-typedef enum {
- EShExVertexFragment,
- EShExPackFragment,
- EShExUnpackFragment,
- EShExFragment
-} EShExecutable;
-
-/*
-// Optimization level for the compiler.
-*/
-typedef enum {
- EShOptNoGeneration,
- EShOptNone,
- EShOptSimple, /* Optimizations that can be done quickly */
- EShOptFull /* Optimizations that will take more time */
-} EShOptimizationLevel;
-
-/*
-// Build a table for bindings. This can be used for locating
-// attributes, uniforms, globals, etc., as needed.
-*/
-typedef struct {
- char* name;
- int binding;
-} ShBinding;
-
-typedef struct {
- int numBindings;
- ShBinding* bindings; /* array of bindings */
-} ShBindingTable;
-
-/*
-// ShHandle held by but opaque to the driver. It is allocated,
-// managed, and de-allocated by the compiler/linker. It's contents
-// are defined by and used by the compiler and linker. For example,
-// symbol table information and object code passed from the compiler
-// to the linker can be stored where ShHandle points.
-//
-// If handle creation fails, 0 will be returned.
-*/
-typedef void* ShHandle;
-
-/*
-// Driver calls these to create and destroy compiler/linker
-// objects.
-*/
-SH_IMPORT_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int debugOptions); /* one per shader */
-SH_IMPORT_EXPORT ShHandle ShConstructLinker(const EShExecutable, int debugOptions); /* one per shader pair */
-SH_IMPORT_EXPORT ShHandle ShConstructUniformMap(); /* one per uniform namespace (currently entire program object) */
-SH_IMPORT_EXPORT void ShDestruct(ShHandle);
-
-/*
-// The return value of ShCompile is boolean, indicating
-// success or failure.
-//
-// The info-log should be written by ShCompile into
-// ShHandle, so it can answer future queries.
-*/
-SH_IMPORT_EXPORT int ShCompile(
- const ShHandle,
- const char* const shaderStrings[],
- const int numStrings,
- const EShOptimizationLevel,
- const TBuiltInResource *resources,
- int debugOptions
- );
-
-
-/*
-// Similar to ShCompile, but accepts an opaque handle to an
-// intermediate language structure.
-*/
-SH_IMPORT_EXPORT int ShCompileIntermediate(
- ShHandle compiler,
- ShHandle intermediate,
- const EShOptimizationLevel,
- int debuggable /* boolean */
- );
-
-SH_IMPORT_EXPORT int ShLink(
- const ShHandle, /* linker object */
- const ShHandle h[], /* compiler objects to link together */
- const int numHandles,
- ShHandle uniformMap, /* updated with new uniforms */
- short int** uniformsAccessed, /* returned with indexes of uniforms accessed */
- int* numUniformsAccessed);
-
-/*
-// ShSetEncrpytionMethod is a place-holder for specifying
-// how source code is encrypted.
-*/
-SH_IMPORT_EXPORT void ShSetEncryptionMethod(ShHandle);
-
-/*
-// All the following return 0 if the information is not
-// available in the object passed down, or the object is bad.
-*/
-SH_IMPORT_EXPORT const char* ShGetInfoLog(const ShHandle);
-SH_IMPORT_EXPORT const void* ShGetExecutable(const ShHandle);
-SH_IMPORT_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); /* to detect user aliasing */
-SH_IMPORT_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); /* to force any physical mappings */
-SH_IMPORT_EXPORT int ShGetPhysicalAttributeBindings(const ShHandle, const ShBindingTable**); /* for all attributes */
-/*
-// Tell the linker to never assign a vertex attribute to this list of physical attributes
-*/
-SH_IMPORT_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int count);
-
-/*
-// Returns the location ID of the named uniform.
-// Returns -1 if error.
-*/
-SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name);
-
-enum TDebugOptions {
- EDebugOpNone = 0x000,
- EDebugOpIntermediate = 0x001,
- EDebugOpAssembly = 0x002,
- EDebugOpObjectCode = 0x004,
- EDebugOpLinkMaps = 0x008
-};
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _COMPILER_INTERFACE_INCLUDED_ */
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLangExt.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLangExt.h
deleted file mode 100755
index e44b5f99a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/Public/ShaderLangExt.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-//Copyright (C) 2002-2004 3Dlabs Inc. Ltd.
-//All rights reserved.
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-//POSSIBILITY OF SUCH DAMAGE.
-//
-#ifndef _SHADERLANG_EXTENSION_INCLUDED_
-#define _SHADERLANG_EXTENSION_INCLUDED_
-
-#include "ShaderLang.h"
-
-//
-// This is the platform independent interface between an OGL driver
-// and the shading language compiler/linker.
-//
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-SH_IMPORT_EXPORT int ShLinkExt(
- const ShHandle, // linker object
- const ShHandle h[], // compiler objects to link together
- const int numHandles);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif // _SHADERLANG_EXTENSION_INCLUDED_
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/descrip.mms b/nx-X11/extras/Mesa/src/mesa/shader/slang/descrip.mms
deleted file mode 100644
index 6f2b90296..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/descrip.mms
+++ /dev/null
@@ -1,52 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 1 June 2005
-
-.first
- define gl [----.include.gl]
- define math [--.math]
- define swrast [--.swrast]
- define array_cache [--.array_cache]
-
-.include [----]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [----.include],[--.main],[--.glapi],[-.slang],[-.grammar],[-]
-LIBDIR = [----.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = \
- slang_compile.c,slang_preprocess.c
-
-OBJECTS = \
- slang_compile.obj,slang_preprocess.obj,slang_utility.obj,\
- slang_execute.obj,slang_assemble.obj,slang_assemble_conditional.obj,\
- slang_assemble_constructor.obj,slang_assemble_typeinfo.obj,\
- slang_storage.obj,slang_assemble_assignment.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-slang_compile.obj : slang_compile.c
-slang_preprocess.obj : slang_preprocess.c
-slang_utility.obj : slang_utility.c
-slang_execute.obj : slang_execute.c
-slang_assemble.obj : slang_assemble.c
-slang_assemble_conditional.obj : slang_assemble_conditional.c
-slang_assemble_constructor.obj : slang_assemble_constructor.c
-slang_assemble_typeinfo.obj : slang_assemble_typeinfo.c
-slang_storage.obj : slang_storage.c
-slang_assemble_assignment.obj : slang_assemble_assignment.c
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_bin.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_bin.c
deleted file mode 100755
index 4bd211442..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_bin.c
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "../../grammar/grammar_crt.h"
-#include "../../grammar/grammar_crt.c"
-#include <stdio.h>
-
-static const char *slang_shader_syn =
-#include "slang_shader_syn.h"
-;
-
-static void gc_to_bin (grammar id, const char *in, const char *out)
-{
- FILE *f;
- byte *source, *prod;
- unsigned int size, i, line = 0;
-
- f = fopen (in, "r");
- if (f == NULL)
- return;
- fseek (f, 0, SEEK_END);
- size = ftell (f);
- fseek (f, 0, SEEK_SET);
- source = (byte *) grammar_alloc_malloc (size + 1);
- source[fread (source, 1, size, f)] = '\0';
- fclose (f);
-
- if (!grammar_fast_check (id, source, &prod, &size, 65536))
- {
- grammar_alloc_free (source);
- return;
- }
-
- f = fopen (out, "w");
- for (i = 0; i < size; i++)
- {
- unsigned int a;
- if (prod[i] < 10)
- a = 1;
- else if (prod[i] < 100)
- a = 2;
- else
- a = 3;
- if (i < size - 1)
- a++;
- if (line + a > 100)
- {
- fprintf (f, "\n");
- line = 0;
- }
- line += a;
- fprintf (f, "%d", prod[i]);
- if (i < size - 1)
- fprintf (f, ",");
- }
- fclose (f);
- grammar_alloc_free (prod);
-}
-
-int main ()
-{
- grammar id;
-
- id = grammar_load_from_text ((const byte *) slang_shader_syn);
- if (id == 0)
- return 1;
-
- grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1);
-
- grammar_set_reg8 (id, (const byte *) "shader_type", 1);
- gc_to_bin (id, "slang_core.gc", "slang_core_gc_bin.h");
- gc_to_bin (id, "slang_common_builtin.gc", "slang_common_builtin_gc_bin.h");
- gc_to_bin (id, "slang_fragment_builtin.gc", "slang_fragment_builtin_gc_bin.h");
-
- grammar_set_reg8 (id, (const byte *) "shader_type", 2);
- gc_to_bin (id, "slang_vertex_builtin.gc", "slang_vertex_builtin_gc_bin.h");
-
- grammar_destroy (id);
-
- return 0;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_string.py b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_string.py
deleted file mode 100644
index a9d399fc1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/gc_to_string.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python
-
-# Mesa 3-D graphics library
-# Version: 6.3
-#
-# Copyright (C) 2005 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# author: Michal Krol
-
-# converts slang source file into a C header containing one big string
-# comments and trailing whitespaces are stripped
-# C style comments are not supported, only C++ style ones are
-# empty lines are kept to maintain line numbers correlation
-# escape characters are not handled except for newlines
-
-# example:
-# -- source file
-# // some comment
-#
-# attribute vec4 myPosition; // my vertex data
-# -- output file
-# "\n"
-# "\n"
-# "attribute vec4 myPosition;\n"
-
-# usage: gc_to_string.py filename.gc > filename_gc.h
-
-import sys
-
-f = open (sys.argv[1], 'r')
-s = f.readline ()
-while s != '':
- s = s[0:s.find ('//')].rstrip ()
- # output empty lines, too, so line numbers can be tracked
- print '\"' + s + '\\n\"'
- s = f.readline ()
-f.close ()
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_common_builtin.gc b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_common_builtin.gc
deleted file mode 100755
index 0b3ed0e88..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ /dev/null
@@ -1,1410 +0,0 @@
-
-//
-// TODO:
-// - implement sin, asin, acos, atan, pow, log2, floor, ceil,
-// - implement texture1D, texture2D, texture3D, textureCube,
-// - implement shadow1D, shadow2D,
-// - implement noise1, noise2, noise3, noise4,
-//
-
-//
-// From Shader Spec, ver. 1.10, rev. 59
-//
-// The following built-in constants are provided to vertex and fragment shaders.
-//
-
-//
-// Implementation dependent constants. The example values below
-// are the minimum values allowed for these maximums.
-//
-
-const int gl_MaxLights = 8; // GL 1.0
-const int gl_MaxClipPlanes = 6; // GL 1.0
-const int gl_MaxTextureUnits = 2; // GL 1.3
-const int gl_MaxTextureCoords = 2; // ARB_fragment_program
-const int gl_MaxVertexAttribs = 16; // ARB_vertex_shader
-const int gl_MaxVertexUniformComponents = 512; // ARB_vertex_shader
-const int gl_MaxVaryingFloats = 32; // ARB_vertex_shader
-const int gl_MaxVertexTextureImageUnits = 0; // ARB_vertex_shader
-const int gl_MaxCombinedTextureImageUnits = 2; // ARB_vertex_shader
-const int gl_MaxTextureImageUnits = 2; // ARB_fragment_shader
-const int gl_MaxFragmentUniformComponents = 64; // ARB_fragment_shader
-const int gl_MaxDrawBuffers = 1; // proposed ARB_draw_buffers
-
-//
-// As an aid to accessing OpenGL processing state, the following uniform variables are built into
-// the OpenGL Shading Language. All page numbers and notations are references to the 1.4
-// specification.
-//
-
-//
-// Matrix state. p. 31, 32, 37, 39, 40.
-//
-
-uniform mat4 gl_ModelViewMatrix;
-uniform mat4 gl_ProjectionMatrix;
-uniform mat4 gl_ModelViewProjectionMatrix;
-uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];
-
-//
-// Derived matrix state that provides inverse and transposed versions
-// of the matrices above. Poorly conditioned matrices may result
-// in unpredictable values in their inverse forms.
-//
-uniform mat3 gl_NormalMatrix; // transpose of the inverse of the
- // upper leftmost 3x3 of gl_ModelViewMatrix
-
-uniform mat4 gl_ModelViewMatrixInverse;
-uniform mat4 gl_ProjectionMatrixInverse;
-uniform mat4 gl_ModelViewProjectionMatrixInverse;
-uniform mat4 gl_TextureMatrixInverse[gl_MaxTextureCoords];
-
-uniform mat4 gl_ModelViewMatrixTranspose;
-uniform mat4 gl_ProjectionMatrixTranspose;
-uniform mat4 gl_ModelViewProjectionMatrixTranspose;
-uniform mat4 gl_TextureMatrixTranspose[gl_MaxTextureCoords];
-
-uniform mat4 gl_ModelViewMatrixInverseTranspose;
-uniform mat4 gl_ProjectionMatrixInverseTranspose;
-uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;
-uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords];
-
-//
-// Normal scaling p. 39.
-//
-
-uniform float gl_NormalScale;
-
-//
-// Depth range in window coordinates, p. 33
-//
-
-struct gl_DepthRangeParameters {
- float near; // n
- float far; // f
- float diff; // f - n
-};
-
-uniform gl_DepthRangeParameters gl_DepthRange;
-
-//
-// Clip planes p. 42.
-//
-
-uniform vec4 gl_ClipPlane[gl_MaxClipPlanes];
-
-//
-// Point Size, p. 66, 67.
-//
-
-struct gl_PointParameters {
- float size;
- float sizeMin;
- float sizeMax;
- float fadeThresholdSize;
- float distanceConstantAttenuation;
- float distanceLinearAttenuation;
- float distanceQuadraticAttenuation;
-};
-
-uniform gl_PointParameters gl_Point;
-
-//
-// Material State p. 50, 55.
-//
-
-struct gl_MaterialParameters {
- vec4 emission; // Ecm
- vec4 ambient; // Acm
- vec4 diffuse; // Dcm
- vec4 specular; // Scm
- float shininess; // Srm
-};
-
-uniform gl_MaterialParameters gl_FrontMaterial;
-uniform gl_MaterialParameters gl_BackMaterial;
-
-//
-// Light State p 50, 53, 55.
-//
-
-struct gl_LightSourceParameters {
- vec4 ambient; // Acli
- vec4 diffuse; // Dcli
- vec4 specular; // Scli
- vec4 position; // Ppli
- vec4 halfVector; // Derived: Hi
- vec3 spotDirection; // Sdli
- float spotExponent; // Srli
- float spotCutoff; // Crli
- // (range: [0.0,90.0], 180.0)
- float spotCosCutoff; // Derived: cos(Crli)
- // (range: [1.0,0.0],-1.0)
- float constantAttenuation; // K0
- float linearAttenuation; // K1
- float quadraticAttenuation; // K2
-};
-
-uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];
-
-struct gl_LightModelParameters {
- vec4 ambient; // Acs
-};
-
-uniform gl_LightModelParameters gl_LightModel;
-
-//
-// Derived state from products of light and material.
-//
-
-struct gl_LightModelProducts {
- vec4 sceneColor; // Derived. Ecm + Acm * Acs
-};
-
-uniform gl_LightModelProducts gl_FrontLightModelProduct;
-uniform gl_LightModelProducts gl_BackLightModelProduct;
-
-struct gl_LightProducts {
- vec4 ambient; // Acm * Acli
- vec4 diffuse; // Dcm * Dcli
- vec4 specular; // Scm * Scli
-};
-
-uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights];
-uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights];
-
-//
-// Texture Environment and Generation, p. 152, p. 40-42.
-//
-
-uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits];
-uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords];
-uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords];
-uniform vec4 gl_EyePlaneR[gl_MaxTextureCoords];
-uniform vec4 gl_EyePlaneQ[gl_MaxTextureCoords];
-uniform vec4 gl_ObjectPlaneS[gl_MaxTextureCoords];
-uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords];
-uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords];
-uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords];
-
-//
-// Fog p. 161
-//
-
-struct gl_FogParameters {
- vec4 color;
- float density;
- float start;
- float end;
- float scale; // Derived: 1.0 / (end - start)
-};
-
-uniform gl_FogParameters gl_Fog;
-
-//
-// The OpenGL Shading Language defines an assortment of built-in convenience functions for scalar
-// and vector operations. Many of these built-in functions can be used in more than one type
-// of shader, but some are intended to provide a direct mapping to hardware and so are available
-// only for a specific type of shader.
-//
-// The built-in functions basically fall into three categories:
-//
-// * They expose some necessary hardware functionality in a convenient way such as accessing
-// a texture map. There is no way in the language for these functions to be emulated by a shader.
-//
-// * They represent a trivial operation (clamp, mix, etc.) that is very simple for the user
-// to write, but they are very common and may have direct hardware support. It is a very hard
-// problem for the compiler to map expressions to complex assembler instructions.
-//
-// * They represent an operation graphics hardware is likely to accelerate at some point. The
-// trigonometry functions fall into this category.
-//
-// Many of the functions are similar to the same named ones in common C libraries, but they support
-// vector input as well as the more traditional scalar input.
-//
-// Applications should be encouraged to use the built-in functions rather than do the equivalent
-// computations in their own shader code since the built-in functions are assumed to be optimal
-// (e.g., perhaps supported directly in hardware).
-//
-// User code can replace built-in functions with their own if they choose, by simply re-declaring
-// and defining the same name and argument list.
-//
-
-//
-// 8.1 Angle and Trigonometry Functions
-//
-// Function parameters specified as angle are assumed to be in units of radians. In no case will
-// any of these functions result in a divide by zero error. If the divisor of a ratio is 0, then
-// results will be undefined.
-//
-// These all operate component-wise. The description is per component.
-//
-
-//
-// Converts degrees to radians and returns the result, i.e., result = PI*deg/180.
-//
-
-float radians (float deg) {
- return 3.141593 * deg / 180.0;
-}
-vec2 radians (vec2 deg) {
- return vec2 (radians (deg.x), radians (deg.y));
-}
-vec3 radians (vec3 deg) {
- return vec3 (radians (deg.x), radians (deg.y), radians (deg.z));
-}
-vec4 radians (vec4 deg) {
- return vec4 (radians (deg.x), radians (deg.y), radians (deg.z), radians (deg.w));
-}
-
-//
-// Converts radians to degrees and returns the result, i.e., result = 180*rad/PI.
-//
-
-float degrees (float rad) {
- return 180.0 * rad / 3.141593;
-}
-vec2 degrees (vec2 rad) {
- return vec2 (degrees (rad.x), degrees (rad.y));
-}
-vec3 degrees (vec3 rad) {
- return vec3 (degrees (rad.x), degrees (rad.y), degrees (rad.z));
-}
-vec4 degrees (vec4 rad) {
- return vec4 (degrees (rad.x), degrees (rad.y), degrees (rad.z), degrees (rad.w));
-}
-
-//
-// The standard trigonometric sine function.
-//
-// XXX
-float sin (float angle) {
- return 0.0;
-}
-vec2 sin (vec2 angle) {
- return vec2 (sin (angle.x), sin (angle.y));
-}
-vec3 sin (vec3 angle) {
- return vec3 (sin (angle.x), sin (angle.y), sin (angle.z));
-}
-vec4 sin (vec4 angle) {
- return vec4 (sin (angle.x), sin (angle.y), sin (angle.z), sin (angle.w));
-}
-
-//
-// The standard trigonometric cosine function.
-//
-
-float cos (float angle) {
- return sin (angle + 1.5708);
-}
-vec2 cos (vec2 angle) {
- return vec2 (cos (angle.x), cos (angle.y));
-}
-vec3 cos (vec3 angle) {
- return vec3 (cos (angle.x), cos (angle.y), cos (angle.z));
-}
-vec4 cos (vec4 angle) {
- return vec4 (cos (angle.x), cos (angle.y), cos (angle.z), cos (angle.w));
-}
-
-//
-// The standard trigonometric tangent.
-//
-
-float tan (float angle) {
- return sin (angle) / cos (angle);
-}
-vec2 tan (vec2 angle) {
- return vec2 (tan (angle.x), tan (angle.y));
-}
-vec3 tan (vec3 angle) {
- return vec3 (tan (angle.x), tan (angle.y), tan (angle.z));
-}
-vec4 tan (vec4 angle) {
- return vec4 (tan (angle.x), tan (angle.y), tan (angle.z), tan (angle.w));
-}
-
-//
-// Arc sine. Returns an angle whose sine is x. The range of values returned by this function is
-// [–PI/2, PI/2]. Results are undefined if |x| > 1.
-//
-// XXX
-float asin (float x) {
- return 0.0;
-}
-vec2 asin (vec2 x) {
- return vec2 (asin (x.x), asin (x.y));
-}
-vec3 asin (vec3 x) {
- return vec3 (asin (x.x), asin (x.y), asin (x.z));
-}
-vec4 asin (vec4 x) {
- return vec4 (asin (x.x), asin (x.y), asin (x.z), asin (x.w));
-}
-
-//
-// Arc cosine. Returns an angle whose cosine is x. The range of values returned by this function is
-// [0, PI]. Results are undefined if |x| > 1.
-//
-// XXX
-float acos (float x) {
- return 0.0;
-}
-vec2 acos (vec2 x) {
- return vec2 (acos (x.x), acos (x.y));
-}
-vec3 acos (vec3 x) {
- return vec3 (acos (x.x), acos (x.y), acos (x.z));
-}
-vec4 acos (vec4 x) {
- return vec4 (acos (x.x), acos (x.y), acos (x.z), acos (x.w));
-}
-
-//
-// Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine
-// what quadrant the angle is in. The range of values returned by this function is [–PI, PI].
-// Results are undefined if x and y are both 0.
-//
-// XXX
-float atan (float x, float y) {
- return 0.0;
-}
-vec2 atan (vec2 x, vec2 y) {
- return vec2 (atan (x.x, y.x), atan (x.y, y.y));
-}
-vec3 atan (vec3 x, vec3 y) {
- return vec3 (atan (x.x, y.x), atan (x.y, y.y), atan (x.z, y.z));
-}
-vec4 atan (vec4 x, vec4 y) {
- return vec4 (atan (x.x, y.x), atan (x.y, y.y), atan (x.z, y.z), atan (x.w, y.w));
-}
-
-//
-// Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this
-// function is [–PI/2, PI/2].
-//
-// XXX
-float atan (float y_over_x) {
- return 0.0;
-}
-vec2 atan (vec2 y_over_x) {
- return vec2 (atan (y_over_x.x), atan (y_over_x.y));
-}
-vec3 atan (vec3 y_over_x) {
- return vec3 (atan (y_over_x.x), atan (y_over_x.y), atan (y_over_x.z));
-}
-vec4 atan (vec4 y_over_x) {
- return vec4 (atan (y_over_x.x), atan (y_over_x.y), atan (y_over_x.z), atan (y_over_x.w));
-}
-
-//
-// 8.2 Exponential Functions
-//
-// These all operate component-wise. The description is per component.
-//
-
-//
-// Returns x raised to the y power, i.e., x^y.
-// Results are undefined if x < 0.
-// Results are undefined if x = 0 and y <= 0.
-//
-// XXX
-float pow (float x, float y) {
- return 0.0;
-}
-vec2 pow (vec2 x, vec2 y) {
- return vec2 (pow (x.x, y.x), pow (x.y, y.y));
-}
-vec3 pow (vec3 x, vec3 y) {
- return vec3 (pow (x.x, y.x), pow (x.y, y.y), pow (x.z, y.z));
-}
-vec4 pow (vec4 x, vec4 y) {
- return vec4 (pow (x.x, y.x), pow (x.y, y.y), pow (x.z, y.z), pow (x.w, y.w));
-}
-
-//
-// Returns the natural exponentiation of x, i.e., e^x.
-//
-
-float exp (float x) {
- return pow (2.71828183, x);
-}
-vec2 exp (vec2 x) {
- return vec2 (exp (x.x), exp (x.y));
-}
-vec3 exp (vec3 x) {
- return vec3 (exp (x.x), exp (x.y), exp (x.z));
-}
-vec4 exp (vec4 x) {
- return vec4 (exp (x.x), exp (x.y), exp (x.z), exp (x.w));
-}
-
-//
-// Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation
-// x = e^y.
-// Results are undefined if x <= 0.
-//
-
-float log (float x) {
- return log2 (x) / log2 (2.71828183);
-}
-vec2 log (vec2 x) {
- return vec2 (log (x.x), log (x.y));
-}
-vec3 log (vec3 x) {
- return vec3 (log (x.x), log (x.y), log (x.z));
-}
-vec4 log (vec4 x) {
- return vec4 (log (x.x), log (x.y), log (x.z), log (x.w));
-}
-
-//
-// Returns 2 raised to the x power, i.e., 2^x
-//
-
-float exp2 (float x) {
- return pow (2.0, x);
-}
-vec2 exp2 (vec2 x) {
- return vec2 (exp2 (x.x), exp2 (x.y));
-}
-vec3 exp2 (vec3 x) {
- return vec3 (exp2 (x.x), exp2 (x.y), exp2 (x.z));
-}
-vec4 exp2 (vec4 x) {
- return vec4 (exp2 (x.x), exp2 (x.y), exp2 (x.z), exp2 (x.w));
-}
-
-//
-// Returns the base 2 logarithm of x, i.e., returns the value y which satisfies the equation
-// x = 2^y.
-// Results are undefined if x <= 0.
-//
-// XXX
-float log2 (float x) {
- return 0.0;
-}
-vec2 log2 (vec2 x) {
- return vec2 (log2 (x.x), log2 (x.y));
-}
-vec3 log2 (vec3 x) {
- return vec3 (log2 (x.x), log2 (x.y), log2 (x.z));
-}
-vec4 log2 (vec4 x) {
- return vec4 (log2 (x.x), log2 (x.y), log2 (x.z), log2 (x.w));
-}
-
-//
-// Returns the positive square root of x.
-// Results are undefined if x < 0.
-//
-
-float sqrt (float x) {
- return pow (x, 0.5);
-}
-vec2 sqrt (vec2 x) {
- return vec2 (sqrt (x.x), sqrt (x.y));
-}
-vec3 sqrt (vec3 x) {
- return vec3 (sqrt (x.x), sqrt (x.y), sqrt (x.z));
-}
-vec4 sqrt (vec4 x) {
- return vec4 (sqrt (x.x), sqrt (x.y), sqrt (x.z), sqrt (x.w));
-}
-
-//
-// Returns the reciprocal of the positive square root of x.
-// Results are undefined if x <= 0.
-//
-
-float inversesqrt (float x) {
- return 1.0 / sqrt (x);
-}
-vec2 inversesqrt (vec2 x) {
- return vec2 (inversesqrt (x.x), inversesqrt (x.y));
-}
-vec3 inversesqrt (vec3 x) {
- return vec3 (inversesqrt (x.x), inversesqrt (x.y), inversesqrt (x.z));
-}
-vec4 inversesqrt (vec4 x) {
- return vec4 (inversesqrt (x.x), inversesqrt (x.y), inversesqrt (x.z), inversesqrt (x.w));
-}
-
-//
-// 8.3 Common Functions
-//
-// These all operate component-wise. The description is per component.
-//
-
-//
-// Returns x if x >= 0, otherwise it returns –x
-//
-
-float abs (float x) {
- return x >= 0.0 ? x : -x;
-}
-vec2 abs (vec2 x) {
- return vec2 (abs (x.x), abs (x.y));
-}
-vec3 abs (vec3 x) {
- return vec3 (abs (x.x), abs (x.y), abs (x.z));
-}
-vec4 abs (vec4 x) {
- return vec4 (abs (x.x), abs (x.y), abs (x.z), abs (x.w));
-}
-
-//
-// Returns 1.0 if x > 0, 0.0 if x = 0, or –1.0 if x < 0
-//
-
-float sign (float x) {
- return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;
-}
-vec2 sign (vec2 x) {
- return vec2 (sign (x.x), sign (x.y));
-}
-vec3 sign (vec3 x) {
- return vec3 (sign (x.x), sign (x.y), sign (x.z));
-}
-vec4 sign (vec4 x) {
- return vec4 (sign (x.x), sign (x.y), sign (x.z), sign (x.w));
-}
-
-//
-// Returns a value equal to the nearest integer that is less than or equal to x
-//
-// XXX
-float floor (float x) {
- return 0.0;
-}
-vec2 floor (vec2 x) {
- return vec2 (floor (x.x), floor (x.y));
-}
-vec3 floor (vec3 x) {
- return vec3 (floor (x.x), floor (x.y), floor (x.z));
-}
-vec4 floor (vec4 x) {
- return vec4 (floor (x.x), floor (x.y), floor (x.z), floor (x.w));
-}
-
-//
-// Returns a value equal to the nearest integer that is greater than or equal to x
-//
-// XXX
-float ceil (float x) {
- return 0.0;
-}
-vec2 ceil (vec2 x) {
- return vec2 (ceil (x.x), ceil (x.y));
-}
-vec3 ceil (vec3 x) {
- return vec3 (ceil (x.x), ceil (x.y), ceil (x.z));
-}
-vec4 ceil (vec4 x) {
- return vec4 (ceil (x.x), ceil (x.y), ceil (x.z), ceil (x.w));
-}
-
-//
-// Returns x – floor (x)
-//
-
-float fract (float x) {
- return x - floor (x);
-}
-vec2 fract (vec2 x) {
- return vec2 (fract (x.x), fract (x.y));
-}
-vec3 fract (vec3 x) {
- return vec3 (fract (x.x), fract (x.y), fract (x.z));
-}
-vec4 fract (vec4 x) {
- return vec4 (fract (x.x), fract (x.y), fract (x.z), fract (x.w));
-}
-
-//
-// Modulus. Returns x – y * floor (x/y)
-//
-
-float mod (float x, float y) {
- return x - y * floor (x / y);
-}
-vec2 mod (vec2 x, float y) {
- return vec2 (mod (x.x, y), mod (x.y, y));
-}
-vec3 mod (vec3 x, float y) {
- return vec3 (mod (x.x, y), mod (x.y, y), mod (x.z, y));
-}
-vec4 mod (vec4 x, float y) {
- return vec4 (mod (x.x, y), mod (x.y, y), mod (x.z, y), mod (x.w, y));
-}
-vec2 mod (vec2 x, vec2 y) {
- return vec2 (mod (x.x, y.x), mod (x.y, y.y));
-}
-vec3 mod (vec3 x, vec3 y) {
- return vec3 (mod (x.x, y.x), mod (x.y, y.y), mod (x.z, y.z));
-}
-vec4 mod (vec4 x, vec4 y) {
- return vec4 (mod (x.x, y.x), mod (x.y, y.y), mod (x.z, y.z), mod (x.w, y.w));
-}
-
-//
-// Returns y if y < x, otherwise it returns x
-//
-
-float min (float x, float y) {
- return y < x ? y : x;
-}
-vec2 min (vec2 x, float y) {
- return vec2 (min (x.x, y), min (x.y, y));
-}
-vec3 min (vec3 x, float y) {
- return vec3 (min (x.x, y), min (x.y, y), min (x.z, y));
-}
-vec4 min (vec4 x, float y) {
- return vec4 (min (x.x, y), min (x.y, y), min (x.z, y), min (x.w, y));
-}
-vec2 min (vec2 x, vec2 y) {
- return vec2 (min (x.x, y.x), min (x.y, y.y));
-}
-vec3 min (vec3 x, vec3 y) {
- return vec3 (min (x.x, y.x), min (x.y, y.y), min (x.z, y.z));
-}
-vec4 min (vec4 x, vec4 y) {
- return vec4 (min (x.x, y.x), min (x.y, y.y), min (x.z, y.z), min (x.w, y.w));
-}
-
-//
-// Returns y if x < y, otherwise it returns x
-//
-
-float max (float x, float y) {
- return min (y, x);
-}
-vec2 max (vec2 x, float y) {
- return vec2 (max (x.x, y), max (x.y, y));
-}
-vec3 max (vec3 x, float y) {
- return vec3 (max (x.x, y), max (x.y, y), max (x.z, y));
-}
-vec4 max (vec4 x, float y) {
- return vec4 (max (x.x, y), max (x.y, y), max (x.z, y), max (x.w, y));
-}
-vec2 max (vec2 x, vec2 y) {
- return vec2 (max (x.x, y.x), max (x.y, y.y));
-}
-vec3 max (vec3 x, vec3 y) {
- return vec3 (max (x.x, y.x), max (x.y, y.y), max (x.z, y.z));
-}
-vec4 max (vec4 x, vec4 y) {
- return vec4 (max (x.x, y.x), max (x.y, y.y), max (x.z, y.z), max (x.w, y.w));
-}
-
-//
-// Returns min (max (x, minVal), maxVal)
-//
-// Note that colors and depths written by fragment shaders will be clamped by the implementation
-// after the fragment shader runs.
-//
-
-float clamp (float x, float minVal, float maxVal) {
- return min (max (x, minVal), maxVal);
-}
-vec2 clamp (vec2 x, float minVal, float maxVal) {
- return vec2 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal));
-}
-vec3 clamp (vec3 x, float minVal, float maxVal) {
- return vec3 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal),
- clamp (x.z, minVal, maxVal));
-}
-vec4 clamp (vec4 x, float minVal, float maxVal) {
- return vec4 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal),
- clamp (x.z, minVal, maxVal), clamp (x.w, minVal, maxVal));
-}
-vec2 clamp (vec2 x, vec2 minVal, vec2 maxVal) {
- return vec2 (clamp (x.x, minVal.x, maxVal.x), clamp (x.y, minVal.y, maxVal.y));
-}
-vec3 clamp (vec3 x, vec3 minVal, vec3 maxVal) {
- return vec3 (clamp (x.x, minVal.x, maxVal.x), clamp (x.y, minVal.y, maxVal.y),
- clamp (x.z, minVal.z, maxVal.z));
-}
-vec4 clamp (vec4 x, vec4 minVal, vec4 maxVal) {
- return vec4 (clamp (x.x, minVal.x, maxVal.y), clamp (x.y, minVal.y, maxVal.y),
- clamp (x.z, minVal.z, maxVal.z), clamp (x.w, minVal.w, maxVal.w));
-}
-
-//
-// Returns x * (1 – a) + y * a, i.e., the linear blend of x and y
-//
-
-float mix (float x, float y, float a) {
- return x * (1.0 - a) + y * a;
-}
-vec2 mix (vec2 x, vec2 y, float a) {
- return vec2 (mix (x.x, y.x, a), mix (x.y, y.y, a));
-}
-vec3 mix (vec3 x, vec3 y, float a) {
- return vec3 (mix (x.x, y.x, a), mix (x.y, y.y, a), mix (x.z, y.z, a));
-}
-vec4 mix (vec4 x, vec4 y, float a) {
- return vec4 (mix (x.x, y.x, a), mix (x.y, y.y, a), mix (x.z, y.z, a), mix (x.w, y.w, a));
-}
-vec2 mix (vec2 x, vec2 y, vec2 a) {
- return vec2 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y));
-}
-vec3 mix (vec3 x, vec3 y, vec3 a) {
- return vec3 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y), mix (x.z, y.z, a.z));
-}
-vec4 mix (vec4 x, vec4 y, vec4 a) {
- return vec4 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y), mix (x.z, y.z, a.z),
- mix (x.w, y.w, a.w));
-}
-
-//
-// Returns 0.0 if x < edge, otherwise it returns 1.0
-//
-
-float step (float edge, float x) {
- return x < edge ? 0.0 : 1.0;
-}
-vec2 step (float edge, vec2 x) {
- return vec2 (step (edge, x.x), step (edge, x.y));
-}
-vec3 step (float edge, vec3 x) {
- return vec3 (step (edge, x.x), step (edge, x.y), step (edge, x.z));
-}
-vec4 step (float edge, vec4 x) {
- return vec4 (step (edge, x.x), step (edge, x.y), step (edge, x.z), step (edge, x.w));
-}
-vec2 step (vec2 edge, vec2 x) {
- return vec2 (step (edge.x, x.x), step (edge.y, x.y));
-}
-vec3 step (vec3 edge, vec3 x) {
- return vec3 (step (edge.x, x.x), step (edge.y, x.y), step (edge.z, x.z));
-}
-vec4 step (vec4 edge, vec4 x) {
- return vec4 (step (edge.x, x.x), step (edge.y, x.y), step (edge.z, x.z), step (edge.w, x.w));
-}
-
-//
-// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation
-// between 0 and 1 when edge0 < x < edge1. This is useful in cases where you would want a threshold
-// function with a smooth transition. This is equivalent to:
-// <type> t;
-// t = clamp ((x – edge0) / (edge1 – edge0), 0, 1);
-// return t * t * (3 – 2 * t);
-//
-
-float smoothstep (float edge0, float edge1, float x) {
- const float t = clamp ((x - edge0) / (edge1 - edge0), 0.0, 1.0);
- return t * t * (3.0 - 2.0 * t);
-}
-vec2 smoothstep (float edge0, float edge1, vec2 x) {
- return vec2 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y));
-}
-vec3 smoothstep (float edge0, float edge1, vec3 x) {
- return vec3 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y),
- smoothstep (edge0, edge1, x.z));
-}
-vec4 smoothstep (float edge0, float edge1, vec4 x) {
- return vec4 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y),
- smoothstep (edge0, edge1, x.z), smoothstep (edge0, edge1, x.w));
-}
-vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 x) {
- return vec2 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y));
-}
-vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 x) {
- return vec3 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y),
- smoothstep (edge0.z, edge1.z, x.z));
-}
-vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 x) {
- return vec4 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y),
- smoothstep (edge0.z, edge1.z, x.z), smoothstep (edge0.w, edge1.w, x.w));
-}
-
-//
-// 8.4 Geometric Functions
-//
-// These operate on vectors as vectors, not component-wise.
-//
-
-//
-// Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1] + ...
-//
-
-float dot (float x, float y) {
- return x * y;
-}
-float dot (vec2 x, vec2 y) {
- return dot (x.x, y.x) + dot (x.y, y.y);
-}
-float dot (vec3 x, vec3 y) {
- return dot (x.x, y.x) + dot (x.y, y.y) + dot (x.z, y.z);
-}
-float dot (vec4 x, vec4 y) {
- return dot (x.x, y.x) + dot (x.y, y.y) + dot (x.z, y.z) + dot (x.w, y.w);
-}
-
-//
-// Returns the length of vector x, i.e., sqrt (x[0] * x[0] + x[1] * x[1] + ...)
-//
-
-float length (float x) {
- return sqrt (dot (x, x));
-}
-float length (vec2 x) {
- return sqrt (dot (x, x));
-}
-float length (vec3 x) {
- return sqrt (dot (x, x));
-}
-float length (vec4 x) {
- return sqrt (dot (x, x));
-}
-
-//
-// Returns the distance between p0 and p1, i.e. length (p0 – p1)
-//
-
-float distance (float x, float y) {
- return length (x - y);
-}
-float distance (vec2 x, vec2 y) {
- return length (x - y);
-}
-float distance (vec3 x, vec3 y) {
- return length (x - y);
-}
-float distance (vec4 x, vec4 y) {
- return length (x - y);
-}
-
-//
-// Returns the cross product of x and y, i.e.
-// result.0 = x[1] * y[2] - y[1] * x[2]
-// result.1 = x[2] * y[0] - y[2] * x[0]
-// result.2 = x[0] * y[1] - y[0] * x[1]
-//
-
-vec3 cross (vec3 x, vec3 y) {
- return vec3 (x.y * y.z - y.y * x.z, x.z * y.x - y.z * x.x, x.x * y.y - y.x * x.y);
-}
-
-//
-// Returns a vector in the same direction as x but with a length of 1.
-//
-
-float normalize (float x) {
- return 1.0;
-}
-vec2 normalize (vec2 x) {
- return x / length (x);
-}
-vec3 normalize (vec3 x) {
- return x / length (x);
-}
-vec4 normalize (vec4 x) {
- return x / length (x);
-}
-
-//
-// If dot (Nref, I) < 0 return N otherwise return –N
-//
-
-float faceforward (float N, float I, float Nref) {
- return dot (Nref, I) < 0.0 ? N : -N;
-}
-vec2 faceforward (vec2 N, vec2 I, vec2 Nref) {
- return dot (Nref, I) < 0.0 ? N : -N;
-}
-vec3 faceforward (vec3 N, vec3 I, vec3 Nref) {
- return dot (Nref, I) < 0.0 ? N : -N;
-}
-vec4 faceforward (vec4 N, vec4 I, vec4 Nref) {
- return dot (Nref, I) < 0.0 ? N : -N;
-}
-
-//
-// For the incident vector I and surface orientation N, returns the reflection direction:
-// result = I - 2 * dot (N, I) * N
-// N must already be normalized in order to achieve the desired result.
-//
-
-float reflect (float I, float N) {
- return I - 2.0 * dot (N, I) * N;
-}
-vec2 reflect (vec2 I, vec2 N) {
- return I - 2.0 * dot (N, I) * N;
-}
-vec3 reflect (vec3 I, vec3 N) {
- return I - 2.0 * dot (N, I) * N;
-}
-vec4 reflect (vec4 I, vec4 N) {
- return I - 2.0 * dot (N, I) * N;
-}
-
-//
-// For the incident vector I and surface normal N, and the ratio of inidices of refraction eta,
-// return the refraction vector. The returned result is computed by
-//
-// k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I))
-// if (k < 0.0)
-// result = genType (0.0)
-// else
-// result = eta * I - (eta * dot (N, I) + sqrt (k)) * N
-//
-// The input parameters for the incident vector I and the surface normal N must already be
-// normalized to get the desired results.
-//
-
-float refract (float I, float N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return 0.0;
- return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
-vec2 refract (vec2 I, vec2 N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return vec2 (0.0);
- return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
-vec3 refract (vec3 I, vec3 N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return vec3 (0.0);
- return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
-vec4 refract (vec4 I, vec4 N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return vec4 (0.0);
- return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
-
-//
-// 8.5 Matrix Functions
-//
-
-//
-// Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product
-// of x[i][j] and y[i][j].
-// Note: to get linear algebraic matrix multiplication, use the multiply operator (*).
-//
-
-mat2 matrixCompMult (mat2 x, mat2 y) {
- return mat2 (
- x[0].x * y[0].x, x[0].y * y[0].y,
- x[1].x * y[1].x, x[1].y * y[1].y
- );
-}
-mat3 matrixCompMult (mat3 x, mat3 y) {
- return mat4 (
- x[0].x * y[0].x, x[0].y * y[0].y, x[0].z * y[0].z,
- x[1].x * y[1].x, x[1].y * y[1].y, x[1].z * y[1].z,
- x[2].x * y[2].x, x[2].y * y[2].y, x[2].z * y[2].z
- );
-}
-mat4 matrixCompMult (mat4 x, mat4 y) {
- return mat4 (
- x[0].x * y[0].x, x[0].y * y[0].y, x[0].z * y[0].z + x[0].w * y[0].w,
- x[1].x * y[1].x, x[1].y * y[1].y, x[1].z * y[1].z + x[1].w * y[1].w,
- x[2].x * y[2].x, x[2].y * y[2].y, x[2].z * y[2].z + x[2].w * y[2].w,
- x[3].x * y[3].x, x[3].y * y[3].y, x[3].z * y[3].z + x[3].w * y[3].w
- );
-}
-
-//
-// 8.6 Vector Relational Functions
-//
-// Relational and equality operators (<, <=, >, >=, ==, !=) are defined (or reserved) to produce
-// scalar Boolean results.
-//
-
-//
-// Returns the component-wise compare of x < y.
-//
-
-bvec2 lessThan (vec2 x, vec2 y) {
- return bvec2 (x.x < y.x, x.y < y.y);
-}
-bvec3 lessThan (vec3 x, vec3 y) {
- return bvec3 (x.x < y.x, x.y < y.y, x.z < y.z);
-}
-bvec4 lessThan (vec4 x, vec4 y) {
- return bvec4 (x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);
-}
-bvec2 lessThan (ivec2 x, ivec2 y) {
- return bvec2 (x.x < y.x, x.y < y.y);
-}
-bvec3 lessThan (ivec3 x, ivec3 y) {
- return bvec3 (x.x < y.x, x.y < y.y, x.z < y.z);
-}
-bvec4 lessThan (ivec4 x, ivec4 y) {
- return bvec4 (x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);
-}
-
-//
-// Returns the component-wise compare of x <= y.
-//
-
-bvec2 lessThanEqual (vec2 x, vec2 y) {
- return bvec2 (x.x <= y.x, x.y <= y.y);
-}
-bvec3 lessThanEqual (vec3 x, vec3 y) {
- return bvec3 (x.x <= y.x, x.y <= y.y, x.z <= y.z);
-}
-bvec4 lessThanEqual (vec4 x, vec4 y) {
- return bvec4 (x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);
-}
-bvec2 lessThanEqual (ivec2 x, ivec2 y) {
- return bvec2 (x.x <= y.x, x.y <= y.y);
-}
-bvec3 lessThanEqual (ivec3 x, ivec3 y) {
- return bvec3 (x.x <= y.x, x.y <= y.y, x.z <= y.z);
-}
-bvec4 lessThanEqual (ivec4 x, ivec4 y) {
- return bvec4 (x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);
-}
-
-//
-// Returns the component-wise compare of x > y.
-//
-
-bvec2 greaterThan (vec2 x, vec2 y) {
- return bvec2 (x.x > y.x, x.y > y.y);
-}
-bvec3 greaterThan (vec3 x, vec3 y) {
- return bvec3 (x.x > y.x, x.y > y.y, x.z > y.z);
-}
-bvec4 greaterThan (vec4 x, vec4 y) {
- return bvec4 (x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);
-}
-bvec2 greaterThan (ivec2 x, ivec2 y) {
- return bvec2 (x.x > y.x, x.y > y.y);
-}
-bvec3 greaterThan (ivec3 x, ivec3 y) {
- return bvec3 (x.x > y.x, x.y > y.y, x.z > y.z);
-}
-bvec4 greaterThan (ivec4 x, ivec4 y) {
- return bvec4 (x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);
-}
-
-//
-// Returns the component-wise compare of x >= y.
-//
-
-bvec2 greaterThanEqual (vec2 x, vec2 y) {
- return bvec2 (x.x >= y.x, x.y >= y.y);
-}
-bvec3 greaterThanEqual (vec3 x, vec3 y) {
- return bvec3 (x.x >= y.x, x.y >= y.y, x.z >= y.z);
-}
-bvec4 greaterThanEqual (vec4 x, vec4 y) {
- return bvec4 (x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);
-}
-bvec2 greaterThanEqual (ivec2 x, ivec2 y) {
- return bvec2 (x.x >= y.x, x.y >= y.y);
-}
-bvec3 greaterThanEqual (ivec3 x, ivec3 y) {
- return bvec3 (x.x >= y.x, x.y >= y.y, x.z >= y.z);
-}
-bvec4 greaterThanEqual (ivec4 x, ivec4 y) {
- return bvec4 (x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);
-}
-
-//
-// Returns the component-wise compare of x == y.
-//
-
-bvec2 equal (vec2 x, vec2 y) {
- return bvec2 (x.x == y.x, x.y == y.y);
-}
-bvec3 equal (vec3 x, vec3 y) {
- return bvec3 (x.x == y.x, x.y == y.y, x.z == y.z);
-}
-bvec4 equal (vec4 x, vec4 y) {
- return bvec4 (x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);
-}
-bvec2 equal (ivec2 x, ivec2 y) {
- return bvec2 (x.x == y.x, x.y == y.y);
-}
-bvec3 equal (ivec3 x, ivec3 y) {
- return bvec3 (x.x == y.x, x.y == y.y, x.z == y.z);
-}
-bvec4 equal (ivec4 x, ivec4 y) {
- return bvec4 (x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);
-}
-
-//
-// Returns the component-wise compare of x != y.
-//
-
-bvec2 notEqual (vec2 x, vec2 y) {
- return bvec2 (x.x != y.x, x.y != y.y);
-}
-bvec3 notEqual (vec3 x, vec3 y) {
- return bvec3 (x.x != y.x, x.y != y.y, x.z != y.z);
-}
-bvec4 notEqual (vec4 x, vec4 y) {
- return bvec4 (x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);
-}
-bvec2 notEqual (ivec2 x, ivec2 y) {
- return bvec2 (x.x != y.x, x.y != y.y);
-}
-bvec3 notEqual (ivec3 x, ivec3 y) {
- return bvec3 (x.x != y.x, x.y != y.y, x.z != y.z);
-}
-bvec4 notEqual (ivec4 x, ivec4 y) {
- return bvec4 (x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);
-}
-
-//
-// Returns true if any component of x is true.
-//
-
-bool any (bvec2 x) {
- return x.x || x.y;
-}
-bool any (bvec3 x) {
- return x.x || x.y || x.z;
-}
-bool any (bvec4 x) {
- return x.x || x.y || x.z || x.w;
-}
-
-//
-// Returns true only if all components of x are true.
-//
-
-bool all (bvec2 x) {
- return x.x && x.y;
-}
-bool all (bvec3 x) {
- return x.x && x.y && x.z;
-}
-bool all (bvec4 x) {
- return x.x && x.y && x.z && x.w;
-}
-
-//
-// Returns the component-wise logical complement of x.
-//
-
-bvec2 not (bvec2 x) {
- return bvec2 (!x.x, !x.y);
-}
-bvec3 not (bvec3 x) {
- return bvec3 (!x.x, !x.y, !x.z);
-}
-bvec4 not (bvec4 x) {
- return bvec4 (!x.x, !x.y, !x.z, !x.w);
-}
-
-//
-// 8.7 Texture Lookup Functions
-//
-// Texture lookup functions are available to both vertex and fragment shaders. However, level
-// of detail is not computed by fixed functionality for vertex shaders, so there are some
-// differences in operation between vertex and fragment texture lookups. The functions in the table
-// below provide access to textures through samplers, as set up through the OpenGL API. Texture
-// properties such as size, pixel format, number of dimensions, filtering method, number of mip-map
-// levels, depth comparison, and so on are also defined by OpenGL API calls. Such properties are
-// taken into account as the texture is accessed via the built-in functions defined below.
-//
-// If a non-shadow texture call is made to a sampler that represents a depth texture with depth
-// comparisons turned on, then results are undefined. If a shadow texture call is made to a sampler
-// that represents a depth texture with depth comparisions turned off, the results are undefined.
-// If a shadow texture call is made to a sampler that does not represent a depth texture, then
-// results are undefined.
-//
-// In all functions below, the bias parameter is optional for fragment shaders. The bias parameter
-// is not accepted in a vertex shader. For a fragment shader, if bias is present, it is added to
-// the calculated level of detail prior to performing the texture access operation. If the bias
-// parameter is not provided, then the implementation automatically selects level of detail:
-// For a texture that is not mip-mapped, the texture is used directly. If it is mip-mapped and
-// running in a fragment shader, the LOD computed by the implementation is used to do the texture
-// lookup. If it is mip-mapped and running on the vertex shader, then the base texture is used.
-//
-// The built-ins suffixed with "Lod" are allowed only in a vertex shader. For the "Lod" functions,
-// lod is directly used as the level of detail.
-//
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 1D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate coord.s is divided by
-// the last component of coord.
-//
-// XXX
-vec4 texture1D (sampler1D sampler, float coord) {
- return vec4 (0.0);
-}
-vec4 texture1DProj (sampler1D sampler, vec2 coord) {
- return texture1D (sampler, coord.s / coord.t);
-}
-vec4 texture1DProj (sampler1D sampler, vec4 coord) {
- return texture1D (sampler, coord.s / coord.q);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate (coord.s, coord.t) is
-// divided by the last component of coord. The third component of coord is ignored for the vec4
-// coord variant.
-//
-// XXX
-vec4 texture2D (sampler2D sampler, vec2 coord) {
- return vec4 (0.0);
-}
-vec4 texture2DProj (sampler2D sampler, vec3 coord) {
- return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p));
-}
-vec4 texture2DProj (sampler2D sampler, vec4 coord) {
- return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q));
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate is divided by coord.q.
-//
-// XXX
-vec4 texture3D (sampler3D sampler, vec3 coord) {
- return vec4 (0.0);
-}
-vec4 texture3DProj (sampler3D sampler, vec4 coord) {
- return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the cube map texture currently bound
-// to sampler. The direction of coord is used to select which face to do a 2-dimensional texture
-// lookup in, as described in section 3.8.6 in version 1.4 of the OpenGL specification.
-//
-// XXX
-vec4 textureCube (samplerCube sampler, vec3 coord) {
- return vec4 (0.0);
-}
-
-//
-// Use texture coordinate coord to do a depth comparison lookup on the depth texture bound
-// to sampler, as described in section 3.8.14 of version 1.4 of the OpenGL specification. The 3rd
-// component of coord (coord.p) is used as the R value. The texture bound to sampler must be a
-// depth texture, or results are undefined. For the projective ("Proj") version of each built-in,
-// the texture coordinate is divide by coord.q, giving a depth value R of coord.p/coord.q. The
-// second component of coord is ignored for the "1D" variants.
-//
-// XXX
-vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {
- return vec4 (0.0);
-}
-// XXX
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {
- return vec4 (0.0);
-}
-vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));
-}
-vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {
- return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));
-}
-
-//
-// 8.9 Noise Functions
-//
-// Noise functions are available to both fragment and vertex shaders. They are stochastic functions
-// that can be used to increase visual complexity. Values returned by the following noise functions
-// give the appearance of randomness, but are not truly random. The noise functions below are
-// defined to have the following characteristics:
-//
-// - The return value(s) are always in the range [-1,1], and cover at least the range [-0.6, 0.6],
-// with a gaussian-like distribution.
-// * The return value(s) have an overall average of 0.0
-// * They are repeatable, in that a particular input value will always produce the same return value
-// * They are statistically invariant under rotation (i.e., no matter how the domain is rotated, it
-// has the same statistical character)
-// * They have a statistical invariance under translation (i.e., no matter how the domain is
-// translated, it has the same statistical character)
-// * They typically give different results under translation.
-// - The spatial frequency is narrowly concentrated, centered somewhere between 0.5 to 1.0.
-//
-
-//
-// Returns a 1D noise value based on the input value x.
-//
-// XXX
-float noise1 (float x) {
- return 0.0;
-}
-// XXX
-float noise1 (vec2 x) {
- return 0.0;
-}
-// XXX
-float noise1 (vec3 x) {
- return 0.0;
-}
-// XXX
-float noise1 (vec4 x) {
- return 0.0;
-}
-
-//
-// Returns a 2D noise value based on the input value x.
-//
-// XXX
-vec2 noise2 (float x) {
- return vec2 (0.0);
-}
-// XXX
-vec2 noise2 (vec2 x) {
- return vec2 (0.0);
-}
-// XXX
-vec2 noise2 (vec3 x) {
- return vec2 (0.0);
-}
-// XXX
-vec2 noise2 (vec4 x) {
- return vec2 (0.0);
-}
-
-//
-// Returns a 3D noise value based on the input value x.
-//
-// XXX
-vec3 noise3 (float x) {
- return vec3 (0.0);
-}
-// XXX
-vec3 noise3 (vec2 x) {
- return vec3 (0.0);
-}
-// XXX
-vec3 noise3 (vec3 x) {
- return vec3 (0.0);
-}
-// XXX
-vec3 noise3 (vec4 x) {
- return vec3 (0.0);
-}
-
-//
-// Returns a 4D noise value based on the input value x.
-//
-// XXX
-vec4 noise4 (float x) {
- return vec4 (0.0);
-}
-// XXX
-vec4 noise4 (vec2 x) {
- return vec4 (0.0);
-}
-// XXX
-vec4 noise4 (vec3 x) {
- return vec4 (0.0);
-}
-// XXX
-vec4 noise4 (vec4 x) {
- return vec4 (0.0);
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_core.gc b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_core.gc
deleted file mode 100755
index d1d2cb10f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_core.gc
+++ /dev/null
@@ -1,1565 +0,0 @@
-
-//
-// This file defines nearly all constructors and operators for built-in data types, using
-// extended language syntax. In general, compiler treats constructors and operators as
-// ordinary functions with some exceptions. For example, the language does not allow
-// functions to be called in constant expressions - here the exception is made to allow it.
-//
-// Each implementation provides its own version of this file. Each implementation can define
-// the required set of operators and constructors in its own fashion.
-//
-// The extended language syntax is only present when compiling this file. It is implicitly
-// included at the very beginning of the compiled shader, so no built-in functions can be
-// used.
-//
-// To communicate with the implementation, a special extended "__asm" keyword is used, followed
-// by an instruction name (any valid identifier), a destination variable identifier and a
-// a list of zero or more source variable identifiers. A variable identifier is a variable name
-// declared earlier in the code (as a function parameter, local or global variable).
-// An instruction name designates an instruction that must be exported by the implementation.
-// Each instruction receives data from source variable identifiers and returns data in the
-// destination variable identifier.
-//
-// It is up to the implementation how to define a particular operator or constructor. If it is
-// expected to being used rarely, it can be defined in terms of other operators and constructors,
-// for example:
-//
-// ivec2 __operator + (const ivec2 x, const ivec2 y) {
-// return ivec2 (x[0] + y[0], x[1] + y[1]);
-// }
-//
-// If a particular operator or constructor is expected to be used very often or is an atomic
-// operation (that is, an operation that cannot be expressed in terms of other operations or
-// would create a dependency cycle) it must be defined using one or more __asm constructs.
-//
-// Each implementation must define constructors for all scalar types (bool, float, int).
-// There are 9 scalar-to-scalar constructors (including identity constructors). However,
-// since the language introduces special constructors (like matrix constructor with a single
-// scalar value), implementations must also implement these cases.
-// The compiler provides the following algorithm when resolving a constructor:
-// - try to find a constructor with a prototype matching ours,
-// - if no constructor is found and this is a scalar-to-scalar constructor, raise an error,
-// - if a constructor is found, execute it and return,
-// - count the size of the constructor parameter list - if it is less than the size of
-// our constructor's type, raise an error,
-// - for each parameter in the list do a recursive constructor matching for appropriate
-// scalar fields in the constructed variable,
-//
-// Each implementation must also define a set of operators that deal with built-in data types.
-// There are four kinds of operators:
-// 1) Operators that are implemented only by the compiler: "()" (function call), "," (sequence)
-// and "?:" (selection).
-// 2) Operators that are implemented by the compiler by expressing it in terms of other operators:
-// - "." (field selection) - translated to subscript access,
-// - "&&" (logical and) - translated to "<left_expr> ? <right_expr> : false",
-// - "||" (logical or) - translated to "<left_expr> ? true : <right_expr>",
-// 3) Operators that can be defined by the implementation and if the required prototype is not
-// found, standard behaviour is used:
-// - "==", "!=", "=" (equality, assignment) - compare or assign matching fields one-by-one;
-// note that at least operators for scalar data types must be defined by the implementation
-// to get it work,
-// 4) All other operators not mentioned above. If no required prototype is found, an error is
-// raised. An implementation must follow the language specification to provide all valid
-// operator prototypes.
-//
-
-int __constructor (const float _f) {
- int _i;
- __asm float_to_int _i, _f;
- return _i;
-}
-
-bool __constructor (const int _i) {
- return _i != 0;
-}
-
-bool __constructor (const float _f) {
- return _f != 0.0;
-}
-
-int __constructor (const bool _b) {
- return _b ? 1 : 0;
-}
-
-float __constructor (const bool _b) {
- return _b ? 1.0 : 0.0;
-}
-
-float __constructor (const int _i) {
- float _f;
- __asm int_to_float _f, _i;
- return _f;
-}
-
-bool __constructor (const bool _b) {
- return _b;
-}
-
-int __constructor (const int _i) {
- return _i;
-}
-
-float __constructor (const float _f) {
- return _f;
-}
-
-vec2 __constructor (const float _f) {
- return vec2 (_f, _f);
-}
-
-vec2 __constructor (const int _i) {
- return vec2 (_i, _i);
-}
-
-vec2 __constructor (const bool _b) {
- return vec2 (_b, _b);
-}
-
-vec3 __constructor (const float _f) {
- return vec3 (_f, _f, _f);
-}
-
-vec3 __constructor (const int _i) {
- return vec3 (_i, _i, _i);
-}
-
-vec3 __constructor (const bool _b) {
- return vec3 (_b, _b, _b);
-}
-
-vec4 __constructor (const float _f) {
- return vec4 (_f, _f, _f, _f);
-}
-
-vec4 __constructor (const int _i) {
- return vec4 (_i, _i, _i, _i);
-}
-
-vec4 __constructor (const bool _b) {
- return vec4 (_b, _b, _b, _b);
-}
-
-ivec2 __constructor (const int _i) {
- return ivec2 (_i, _i);
-}
-
-ivec2 __constructor (const float _f) {
- return ivec2 (_f, _f);
-}
-
-ivec2 __constructor (const bool _b) {
- return ivec2 (_b, _b);
-}
-
-ivec3 __constructor (const int _i) {
- return ivec3 (_i, _i, _i);
-}
-
-ivec3 __constructor (const float _f) {
- return ivec3 (_f, _f, _f);
-}
-
-ivec3 __constructor (const bool _b) {
- return ivec3 (_b, _b, _b);
-}
-
-ivec4 __constructor (const int _i) {
- return ivec4 (_i, _i, _i, _i);
-}
-
-ivec4 __constructor (const float _f) {
- return ivec4 (_f, _f, _f, _f);
-}
-
-ivec4 __constructor (const bool _b) {
- return ivec4 (_b, _b, _b, _b);
-}
-
-bvec2 __constructor (const bool _b) {
- return bvec2 (_b, _b);
-}
-
-bvec2 __constructor (const float _f) {
- return bvec2 (_f, _f);
-}
-
-bvec2 __constructor (const int _i) {
- return bvec2 (_i, _i);
-}
-
-bvec3 __constructor (const bool _b) {
- return bvec3 (_b, _b, _b);
-}
-
-bvec3 __constructor (const float _f) {
- return bvec3 (_f, _f, _f);
-}
-
-bvec3 __constructor (const int _i) {
- return bvec3 (_i, _i, _i);
-}
-
-bvec4 __constructor (const bool _b) {
- return bvec4 (_b, _b, _b, _b);
-}
-
-bvec4 __constructor (const float _f) {
- return bvec4 (_f, _f, _f, _f);
-}
-
-bvec4 __constructor (const int _i) {
- return bvec4 (_i, _i, _i, _i);
-}
-
-mat2 __constructor (const float _f) {
- return mat2 (
- _f, .0,
- .0, _f
- );
-}
-
-mat2 __constructor (const int _i) {
- return mat2 (
- _i, .0,
- .0, _i
- );
-}
-
-mat2 __constructor (const bool _b) {
- return mat2 (
- _b, .0,
- .0, _b
- );
-}
-
-mat3 __constructor (const float _f) {
- return mat3 (
- _f, .0, .0,
- .0, _f, .0,
- .0, .0, _f
- );
-}
-
-mat3 __constructor (const int _i) {
- return mat3 (
- _i, .0, .0,
- .0, _i, .0,
- .0, .0, _i
- );
-}
-
-mat3 __constructor (const bool _b) {
- return mat3 (
- _b, .0, .0,
- .0, _b, .0,
- .0, .0, _b
- );
-}
-
-mat4 __constructor (const float _f) {
- return mat4 (
- _f, .0, .0, .0,
- .0, _f, .0, .0,
- .0, .0, _f, .0,
- .0, .0, .0, _f
- );
-}
-
-mat4 __constructor (const int _i) {
- return mat4 (
- _i, .0, .0, .0,
- .0, _i, .0, .0,
- .0, .0, _i, .0,
- .0, .0, .0, _i
- );
-}
-
-mat4 __constructor (const bool _b) {
- return mat4 (
- _b, .0, .0, .0,
- .0, _b, .0, .0,
- .0, .0, _b, .0,
- .0, .0, .0, _b
- );
-}
-
-//void __operator = (out float a, const float b) {
-// __asm float_copy a, b;
-//}
-//
-//void __operator = (out int a, const int b) {
-// __asm int_copy a, b;
-//}
-//
-//void __operator = (out bool a, const bool b) {
-// __asm bool_copy a, b;
-//}
-//
-//void __operator = (out vec2 v, const vec2 u) {
-// v.x = u.x, v.y = u.y;
-//}
-//
-//void __operator = (out vec3 v, const vec3 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z;
-//}
-//
-//void __operator = (out vec4 v, const vec4 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z, v.w = u.w;
-//}
-//
-//void __operator = (out ivec2 v, const ivec2 u) {
-// v.x = u.x, v.y = u.y;
-//}
-//
-//void __operator = (out ivec3 v, const ivec3 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z;
-//}
-//
-//void __operator = (out ivec4 v, const ivec4 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z, v.w = u.w;
-//}
-//
-//void __operator = (out bvec2 v, const bvec2 u) {
-// v.x = u.x, v.y = u.y;
-//}
-//
-//void __operator = (out bvec3 v, const bvec3 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z;
-//}
-//
-//void __operator = (out bvec4 v, const bvec4 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z, v.w = u.w;
-//}
-//
-//void __operator = (out mat2 m, const mat2 n) {
-// m[0] = n[0], m[1] = n[1];
-//}
-//
-//void __operator = (out mat3 m, const mat3 n) {
-// m[0] = n[0], m[1] = n[1], m[2] = n[2];
-//}
-//
-//void __operator = (out mat4 m, const mat4 n) {
-// m[0] = n[0], m[1] = n[1], m[2] = n[2], m[3] = n[3];
-//}
-
-void __operator += (inout float a, const float b) {
- __asm float_add a, a, b;
-}
-
-float __operator - (const float a) {
- float c;
- __asm float_negate c, a;
- return c;
-}
-
-void __operator -= (inout float a, const float b) {
- a += -b;
-}
-
-void __operator *= (inout float a, const float b) {
- __asm float_multiply a, a, b;
-}
-
-void __operator /= (inout float a, const float b) {
- __asm float_divide a, a, b;
-}
-
-float __operator + (const float a, const float b) {
- float c;
- c = a;
- return c += b;
-}
-
-void __operator += (inout int a, const int b) {
- a = int (float (a) + float (b));
-}
-
-int __operator - (const int a) {
- return int (-float (a));
-}
-
-void __operator -= (inout int a, const int b) {
- a += -b;
-}
-
-float __operator * (const float a, const float b) {
- float c;
- c = a;
- return c *= b;
-}
-
-void __operator *= (inout int a, const int b) {
- a = int (float (a) * float (b));
-}
-
-float __operator / (const float a, const float b) {
- float c;
- c = a;
- return c /= b;
-}
-
-void __operator /= (inout int a, const int b) {
- a = int (float (a) / float (b));
-}
-
-void __operator += (inout vec2 v, const vec2 u) {
- v.x += u.x, v.y += u.y;
-}
-
-void __operator -= (inout vec2 v, const vec2 u) {
- v.x -= u.x, v.y -= u.y;
-}
-
-void __operator *= (inout vec2 v, const vec2 u) {
- v.x *= u.x, v.y *= u.y;
-}
-
-void __operator /= (inout vec2 v, const vec2 u) {
- v.x /= u.x, v.y /= u.y;
-}
-
-void __operator += (inout vec3 v, const vec3 u) {
- v.x += u.x, v.y += u.y, v.z += u.z;
-}
-
-void __operator -= (inout vec3 v, const vec3 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z;
-}
-
-void __operator *= (inout vec3 v, const vec3 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z;
-}
-
-void __operator /= (inout vec3 v, const vec3 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z;
-}
-
-void __operator += (inout vec4 v, const vec4 u) {
- v.x += u.x, v.y += u.y, v.z += u.z, v.w += u.w;
-}
-
-void __operator -= (inout vec4 v, const vec4 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z, v.w -= u.w;
-}
-
-void __operator *= (inout vec4 v, const vec4 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z, v.w *= u.w;
-}
-
-void __operator /= (inout vec4 v, const vec4 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z, v.w /= u.w;
-}
-
-void __operator += (inout ivec2 v, const ivec2 u) {
- v.x += u.x, v.y += u.y;
-}
-
-void __operator -= (inout ivec2 v, const ivec2 u) {
- v.x -= u.x, v.y -= u.y;
-}
-
-void __operator *= (inout ivec2 v, const ivec2 u) {
- v.x *= u.x, v.y *= u.y;
-}
-
-void __operator /= (inout ivec2 v, const ivec2 u) {
- v.x /= u.x, v.y /= u.y;
-}
-
-void __operator += (inout ivec3 v, const ivec3 u) {
- v.x += u.x, v.y += u.y, v.z += u.z;
-}
-
-void __operator -= (inout ivec3 v, const ivec3 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z;
-}
-
-void __operator *= (inout ivec3 v, const ivec3 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z;
-}
-
-void __operator /= (inout ivec3 v, const ivec3 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z;
-}
-
-void __operator += (inout ivec4 v, const ivec4 u) {
- v.x += u.x, v.y += u.y, v.z += u.z, v.w += u.w;
-}
-
-void __operator -= (inout ivec4 v, const ivec4 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z, v.w -= u.w;
-}
-
-void __operator *= (inout ivec4 v, const ivec4 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z, v.w *= u.w;
-}
-
-void __operator /= (inout ivec4 v, const ivec4 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z, v.w /= u.w;
-}
-
-void __operator += (inout mat2 m, const mat2 n) {
- m[0] += n[0], m[1] += n[1];
-}
-
-void __operator -= (inout mat2 m, const mat2 n) {
- m[0] -= n[0], m[1] -= n[1];
-}
-
-vec2 __operator * (const mat2 m, const vec2 v) {
- return vec2 (
- v.x * m[0].x + v.y * m[1].x,
- v.x * m[0].y + v.y * m[1].y
- );
-}
-
-mat2 __operator * (const mat2 m, const mat2 n) {
- return mat2 (m * n[0], m * n[1]);
-}
-
-void __operator *= (inout mat2 m, const mat2 n) {
- m = m * n;
-}
-
-void __operator /= (inout mat2 m, const mat2 n) {
- m[0] /= n[0], m[1] /= n[1];
-}
-
-void __operator += (inout mat3 m, const mat3 n) {
- m[0] += n[0], m[1] += n[1], m[2] += n[2];
-}
-
-void __operator -= (inout mat3 m, const mat3 n) {
- m[0] -= n[0], m[1] -= n[1], m[2] -= n[2];
-}
-
-vec3 __operator * (const mat3 m, const vec3 v) {
- return vec3 (
- v.x * m[0].x + v.y * m[1].x + v.z * m[2].x,
- v.x * m[0].y + v.y * m[1].y + v.z * m[2].y,
- v.x * m[0].z + v.y * m[1].z + v.z * m[2].z
- );
-}
-
-mat3 __operator * (const mat3 m, const mat3 n) {
- return mat3 (m * n[0], m * n[1], m * n[2]);
-}
-
-void __operator *= (inout mat3 m, const mat3 n) {
- m = m * n;
-}
-
-void __operator /= (inout mat3 m, const mat3 n) {
- m[0] /= n[0], m[1] /= n[1], m[2] /= n[2];
-}
-
-void __operator += (inout mat4 m, const mat4 n) {
- m[0] += n[0], m[1] += n[1], m[2] += n[2], m[3] += n[3];
-}
-
-void __operator -= (inout mat4 m, const mat4 n) {
- m[0] -= n[0], m[1] -= n[1], m[2] -= n[2], m[3] -= n[3];
-}
-
-vec4 __operator * (const mat4 m, const vec4 v) {
- return vec4 (
- v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x,
- v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y,
- v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z,
- v.x * m[0].w + v.y * m[1].w + v.z * m[2].w + v.w * m[3].w
- );
-}
-
-mat4 __operator * (const mat4 m, const mat4 n) {
- return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]);
-}
-
-void __operator *= (inout mat4 m, const mat4 n) {
- m = m * n;
-}
-
-void __operator /= (inout mat4 m, const mat4 n) {
- m[0] /= n[0], m[1] /= n[1], m[2] /= n[2], m[3] /= n[3];
-}
-
-void __operator += (inout vec2 v, const float a) {
- v.x += a, v.y += a;
-}
-
-void __operator -= (inout vec2 v, const float a) {
- v.x -= a, v.y -= a;
-}
-
-void __operator *= (inout vec2 v, const float a) {
- v.x *= a, v.y *= a;
-}
-
-void __operator /= (inout vec2 v, const float a) {
- v.x /= a, v.y /= a;
-}
-
-void __operator += (inout vec3 v, const float a) {
- v.x += a, v.y += a, v.z += a;
-}
-
-void __operator -= (inout vec3 v, const float a) {
- v.x -= a, v.y -= a, v.z -= a;
-}
-
-void __operator *= (inout vec3 v, const float a) {
- v.x *= a, v.y *= a, v.z *= a;
-}
-
-void __operator /= (inout vec3 v, const float a) {
- v.x /= a, v.y /= a, v.z /= a;
-}
-
-void __operator += (inout vec4 v, const float a) {
- v.x += a, v.y += a, v.z += a, v.w += a;
-}
-
-void __operator -= (inout vec4 v, const float a) {
- v.x -= a, v.y -= a, v.z -= a, v.w -= a;
-}
-
-void __operator *= (inout vec4 v, const float a) {
- v.x *= a, v.y *= a, v.z *= a, v.w *= a;
-}
-
-void __operator /= (inout vec4 v, const float a) {
- v.x /= a, v.y /= a, v.z /= a, v.w /= a;
-}
-
-void __operator += (inout mat2 m, const float a) {
- m[0] += a, m[1] += a;
-}
-
-void __operator -= (inout mat2 m, const float a) {
- m[0] -= a, m[1] -= a;
-}
-
-void __operator *= (inout mat2 m, const float a) {
- m[0] *= a, m[1] *= a;
-}
-
-void __operator /= (inout mat2 m, const float a) {
- m[0] /= a, m[1] /= a;
-}
-
-void __operator += (inout mat3 m, const float a) {
- m[0] += a, m[1] += a, m[2] += a;
-}
-
-void __operator -= (inout mat3 m, const float a) {
- m[0] -= a, m[1] -= a, m[2] -= a;
-}
-
-void __operator *= (inout mat3 m, const float a) {
- m[0] *= a, m[1] *= a, m[2] *= a;
-}
-
-void __operator /= (inout mat3 m, const float a) {
- m[0] /= a, m[1] /= a, m[2] /= a;
-}
-
-void __operator += (inout mat4 m, const float a) {
- m[0] += a, m[1] += a, m[2] += a, m[3] += a;
-}
-
-void __operator -= (inout mat4 m, const float a) {
- m[0] -= a, m[1] -= a, m[2] -= a, m[3] -= a;
-}
-
-void __operator *= (inout mat4 m, const float a) {
- m[0] *= a, m[1] *= a, m[2] *= a, m[3] *= a;
-}
-
-void __operator /= (inout mat4 m, const float a) {
- m[0] /= a, m[1] /= a, m[2] /= a, m[3] /= a;
-}
-
-vec2 __operator * (const vec2 v, const mat2 m) {
- return vec2 (
- v.x * m[0].x + v.y * m[0].y,
- v.x * m[1].x + v.y * m[1].y
- );
-}
-
-void __operator *= (inout vec2 v, const mat2 m) {
- v = v * m;
-}
-
-vec3 __operator * (const vec3 v, const mat3 m) {
- return vec3 (
- v.x * m[0].x + v.y * m[0].y + v.z * m[0].z,
- v.x * m[1].x + v.y * m[1].y + v.z * m[1].z,
- v.x * m[2].x + v.y * m[2].y + v.z * m[2].z
- );
-}
-
-void __operator *= (inout vec3 v, const mat3 m) {
- v = v * m;
-}
-
-vec4 __operator * (const vec4 v, const mat4 m) {
- return vec4 (
- v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w,
- v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w,
- v.x * m[2].x + v.y * m[2].y + v.z * m[2].z + v.w * m[2].w,
- v.x * m[3].x + v.y * m[3].y + v.z * m[3].z + v.w * m[3].w
- );
-}
-
-void __operator *= (inout vec4 v, const mat4 m) {
- v = v * m;
-}
-
-float __operator - (const float a, const float b) {
- return a + -b;
-}
-
-int __operator + (const int a, const int b) {
- int c;
- c = a;
- return c += b;
-}
-
-int __operator - (const int a, const int b) {
- return a + -b;
-}
-
-int __operator * (const int a, const int b) {
- int c;
- return (c = a) *= b;
-}
-
-int __operator / (const int a, const int b) {
- int c;
- return (c = a) /= b;
-}
-
-vec2 __operator + (const vec2 v, const vec2 u) {
- return vec2 (v.x + u.x, v.y + u.y);
-}
-
-vec2 __operator - (const vec2 v, const vec2 u) {
- return vec2 (v.x - u.x, v.y - u.y);
-}
-
-vec3 __operator + (const vec3 v, const vec3 u) {
- return vec3 (v.x + u.x, v.y + u.y, v.z + u.z);
-}
-
-vec3 __operator - (const vec3 v, const vec3 u) {
- return vec3 (v.x - u.x, v.y - u.y, v.z - u.z);
-}
-
-vec4 __operator + (const vec4 v, const vec4 u) {
- return vec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
-}
-
-vec4 __operator - (const vec4 v, const vec4 u) {
- return vec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
-}
-
-ivec2 __operator + (const ivec2 v, const ivec2 u) {
- return ivec2 (v.x + u.x, v.y + u.y);
-}
-
-ivec2 __operator - (const ivec2 v, const ivec2 u) {
- return ivec2 (v.x - u.x, v.y - u.y);
-}
-
-ivec3 __operator + (const ivec3 v, const ivec3 u) {
- return ivec3 (v.x + u.x, v.y + u.y, v.z + u.z);
-}
-
-ivec3 __operator - (const ivec3 v, const ivec3 u) {
- return ivec3 (v.x - u.x, v.y - u.y, v.z - u.z);
-}
-
-ivec4 __operator + (const ivec4 v, const ivec4 u) {
- return ivec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
-}
-
-ivec4 __operator - (const ivec4 v, const ivec4 u) {
- return ivec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
-}
-
-mat2 __operator + (const mat2 m, const mat2 n) {
- return mat2 (m[0] + n[0], m[1] + n[1]);
-}
-
-mat2 __operator - (const mat2 m, const mat2 n) {
- return mat2 (m[0] - n[0], m[1] - n[1]);
-}
-
-mat3 __operator + (const mat3 m, const mat3 n) {
- return mat3 (m[0] + n[0], m[1] + n[1], m[2] + n[2]);
-}
-
-mat3 __operator - (const mat3 m, const mat3 n) {
- return mat3 (m[0] - n[0], m[1] - n[1], m[2] - n[2]);
-}
-
-mat4 __operator + (const mat4 m, const mat4 n) {
- return mat4 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]);
-}
-
-mat4 __operator - (const mat4 m, const mat4 n) {
- return mat4 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]);
-}
-
-vec2 __operator + (const float a, const vec2 u) {
- return vec2 (a + u.x, a + u.y);
-}
-
-vec2 __operator + (const vec2 v, const float b) {
- return vec2 (v.x + b, v.y + b);
-}
-
-vec2 __operator - (const float a, const vec2 u) {
- return vec2 (a - u.x, a - u.y);
-}
-
-vec2 __operator - (const vec2 v, const float b) {
- return vec2 (v.x - b, v.y - b);
-}
-
-vec2 __operator * (const float a, const vec2 u) {
- return vec2 (a * u.x, a * u.y);
-}
-
-vec2 __operator * (const vec2 v, const float b) {
- return vec2 (v.x * b, v.y * b);
-}
-
-vec2 __operator / (const float a, const vec2 u) {
- return vec2 (a / u.x, a / u.y);
-}
-
-vec2 __operator / (const vec2 v, const float b) {
- return vec2 (v.x / b, v.y / b);
-}
-
-vec3 __operator + (const float a, const vec3 u) {
- return vec3 (a + u.x, a + u.y, a + u.z);
-}
-
-vec3 __operator + (const vec3 v, const float b) {
- return vec3 (v.x + b, v.y + b, v.z + b);
-}
-
-vec3 __operator - (const float a, const vec3 u) {
- return vec3 (a - u.x, a - u.y, a - u.z);
-}
-
-vec3 __operator - (const vec3 v, const float b) {
- return vec3 (v.x - b, v.y - b, v.z - b);
-}
-
-vec3 __operator * (const float a, const vec3 u) {
- return vec3 (a * u.x, a * u.y, a * u.z);
-}
-
-vec3 __operator * (const vec3 v, const float b) {
- return vec3 (v.x * b, v.y * b, v.z * b);
-}
-
-vec3 __operator / (const float a, const vec3 u) {
- return vec3 (a / u.x, a / u.y, a / u.z);
-}
-
-vec3 __operator / (const vec3 v, const float b) {
- return vec3 (v.x / b, v.y / b, v.z / b);
-}
-
-vec4 __operator + (const float a, const vec4 u) {
- return vec4 (a + u.x, a + u.y, a + u.z, a + u.w);
-}
-
-vec4 __operator + (const vec4 v, const float b) {
- return vec4 (v.x + b, v.y + b, v.z + b, v.w + b);
-}
-
-vec4 __operator - (const float a, const vec4 u) {
- return vec4 (a - u.x, a - u.y, a - u.z, a - u.w);
-}
-
-vec4 __operator - (const vec4 v, const float b) {
- return vec4 (v.x - b, v.y - b, v.z - b, v.w - b);
-}
-
-vec4 __operator * (const float a, const vec4 u) {
- return vec4 (a * u.x, a * u.y, a * u.z, a * u.w);
-}
-
-vec4 __operator * (const vec4 v, const float b) {
- return vec4 (v.x * b, v.y * b, v.z * b, v.w * b);
-}
-
-vec4 __operator / (const float a, const vec4 u) {
- return vec4 (a / u.x, a / u.y, a / u.z, a / u.w);
-}
-
-vec4 __operator / (const vec4 v, const float b) {
- return vec4 (v.x / b, v.y / b, v.z / b, v.w / b);
-}
-
-mat2 __operator + (const float a, const mat2 n) {
- return mat2 (a + n[0], a + n[1]);
-}
-
-mat2 __operator + (const mat2 m, const float b) {
- return mat2 (m[0] + b, m[1] + b);
-}
-
-mat2 __operator - (const float a, const mat2 n) {
- return mat2 (a - n[0], a - n[1]);
-}
-
-mat2 __operator - (const mat2 m, const float b) {
- return mat2 (m[0] - b, m[1] - b);
-}
-
-mat2 __operator * (const float a, const mat2 n) {
- return mat2 (a * n[0], a * n[1]);
-}
-
-mat2 __operator * (const mat2 m, const float b) {
- return mat2 (m[0] * b, m[1] * b);
-}
-
-mat2 __operator / (const float a, const mat2 n) {
- return mat2 (a / n[0], a / n[1]);
-}
-
-mat2 __operator / (const mat2 m, const float b) {
- return mat2 (m[0] / b, m[1] / b);
-}
-
-mat3 __operator + (const float a, const mat3 n) {
- return mat3 (a + n[0], a + n[1], a + n[2]);
-}
-
-mat3 __operator + (const mat3 m, const float b) {
- return mat3 (m[0] + b, m[1] + b, m[2] + b);
-}
-
-mat3 __operator - (const float a, const mat3 n) {
- return mat3 (a - n[0], a - n[1], a - n[2]);
-}
-
-mat3 __operator - (const mat3 m, const float b) {
- return mat3 (m[0] - b, m[1] - b, m[2] - b);
-}
-
-mat3 __operator * (const float a, const mat3 n) {
- return mat3 (a * n[0], a * n[1], a * n[2]);
-}
-
-mat3 __operator * (const mat3 m, const float b) {
- return mat3 (m[0] * b, m[1] * b, m[2] * b);
-}
-
-mat3 __operator / (const float a, const mat3 n) {
- return mat3 (a / n[0], a / n[1], a / n[2]);
-}
-
-mat3 __operator / (const mat3 m, const float b) {
- return mat3 (m[0] / b, m[1] / b, m[2] / b);
-}
-
-mat4 __operator + (const float a, const mat4 n) {
- return mat4 (a + n[0], a + n[1], a + n[2], a + n[3]);
-}
-
-mat4 __operator + (const mat4 m, const float b) {
- return mat4 (m[0] + b, m[1] + b, m[2] + b, m[3] + b);
-}
-
-mat4 __operator - (const float a, const mat4 n) {
- return mat4 (a - n[0], a - n[1], a - n[2], a - n[3]);
-}
-
-mat4 __operator - (const mat4 m, const float b) {
- return mat4 (m[0] - b, m[1] - b, m[2] - b, m[3] - b);
-}
-
-mat4 __operator * (const float a, const mat4 n) {
- return mat4 (a * n[0], a * n[1], a * n[2], a * n[3]);
-}
-
-mat4 __operator * (const mat4 m, const float b) {
- return mat4 (m[0] * b, m[1] * b, m[2] * b, m[3] * b);
-}
-
-mat4 __operator / (const float a, const mat4 n) {
- return mat4 (a / n[0], a / n[1], a / n[2], a / n[3]);
-}
-
-mat4 __operator / (const mat4 m, const float b) {
- return mat4 (m[0] / b, m[1] / b, m[2] / b, m[3] / b);
-}
-
-ivec2 __operator + (const int a, const ivec2 u) {
- return ivec2 (a + u.x, a + u.y);
-}
-
-ivec2 __operator + (const ivec2 v, const int b) {
- return ivec2 (v.x + b, v.y + b);
-}
-
-ivec2 __operator - (const int a, const ivec2 u) {
- return ivec2 (a - u.x, a - u.y);
-}
-
-ivec2 __operator - (const ivec2 v, const int b) {
- return ivec2 (v.x - b, v.y - b);
-}
-
-ivec2 __operator * (const int a, const ivec2 u) {
- return ivec2 (a * u.x, a * u.y);
-}
-
-ivec2 __operator * (const ivec2 v, const int b) {
- return ivec2 (v.x * b, v.y * b);
-}
-
-ivec2 __operator / (const int a, const ivec2 u) {
- return ivec2 (a / u.x, a / u.y);
-}
-
-ivec2 __operator / (const ivec2 v, const int b) {
- return ivec2 (v.x / b, v.y / b);
-}
-
-ivec3 __operator + (const int a, const ivec3 u) {
- return ivec3 (a + u.x, a + u.y, a + u.z);
-}
-
-ivec3 __operator + (const ivec3 v, const int b) {
- return ivec3 (v.x + b, v.y + b, v.z + b);
-}
-
-ivec3 __operator - (const int a, const ivec3 u) {
- return ivec3 (a - u.x, a - u.y, a - u.z);
-}
-
-ivec3 __operator - (const ivec3 v, const int b) {
- return ivec3 (v.x - b, v.y - b, v.z - b);
-}
-
-ivec3 __operator * (const int a, const ivec3 u) {
- return ivec3 (a * u.x, a * u.y, a * u.z);
-}
-
-ivec3 __operator * (const ivec3 v, const int b) {
- return ivec3 (v.x * b, v.y * b, v.z * b);
-}
-
-ivec3 __operator / (const int a, const ivec3 u) {
- return ivec3 (a / u.x, a / u.y, a / u.z);
-}
-
-ivec3 __operator / (const ivec3 v, const int b) {
- return ivec3 (v.x / b, v.y / b, v.z / b);
-}
-
-ivec4 __operator + (const int a, const ivec4 u) {
- return ivec4 (a + u.x, a + u.y, a + u.z, a + u.w);
-}
-
-ivec4 __operator + (const ivec4 v, const int b) {
- return ivec4 (v.x + b, v.y + b, v.z + b, v.w + b);
-}
-
-ivec4 __operator - (const int a, const ivec4 u) {
- return ivec4 (a - u.x, a - u.y, a - u.z, a - u.w);
-}
-
-ivec4 __operator - (const ivec4 v, const int b) {
- return ivec4 (v.x - b, v.y - b, v.z - b, v.w - b);
-}
-
-ivec4 __operator * (const int a, const ivec4 u) {
- return ivec4 (a * u.x, a * u.y, a * u.z, a * u.w);
-}
-
-ivec4 __operator * (const ivec4 v, const int b) {
- return ivec4 (v.x * b, v.y * b, v.z * b, v.w * b);
-}
-
-ivec4 __operator / (const int a, const ivec4 u) {
- return ivec4 (a / u.x, a / u.y, a / u.z, a / u.w);
-}
-
-ivec4 __operator / (const ivec4 v, const int b) {
- return ivec4 (v.x / b, v.y / b, v.z / b, v.w / b);
-}
-
-vec2 __operator * (const vec2 v, const vec2 u) {
- return vec2 (v.x * u.x, v.y * u.y);
-}
-
-vec3 __operator * (const vec3 v, const vec3 u) {
- return vec3 (v.x * u.x, v.y * u.y, v.z * u.z);
-}
-
-vec4 __operator * (const vec4 v, const vec4 u) {
- return vec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
-}
-
-ivec2 __operator * (const ivec2 v, const ivec2 u) {
- return ivec2 (v.x * u.x, v.y * u.y);
-}
-
-ivec3 __operator * (const ivec3 v, const ivec3 u) {
- return ivec3 (v.x * u.x, v.y * u.y, v.z * u.z);
-}
-
-ivec4 __operator * (const ivec4 v, const ivec4 u) {
- return ivec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
-}
-
-vec2 __operator / (const vec2 v, const vec2 u) {
- return vec2 (v.x / u.x, v.y / u.y);
-}
-
-vec3 __operator / (const vec3 v, const vec3 u) {
- return vec3 (v.x / u.x, v.y / u.y, v.z / u.z);
-}
-
-vec4 __operator / (const vec4 v, const vec4 u) {
- return vec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
-}
-
-ivec2 __operator / (const ivec2 v, const ivec2 u) {
- return ivec2 (v.x / u.x, v.y / u.y);
-}
-
-ivec3 __operator / (const ivec3 v, const ivec3 u) {
- return ivec3 (v.x / u.x, v.y / u.y, v.z / u.z);
-}
-
-ivec4 __operator / (const ivec4 v, const ivec4 u) {
- return ivec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
-}
-
-mat2 __operator / (const mat2 m, const mat2 n) {
- return mat2 (m[0] / n[0], m[1] / n[1]);
-}
-
-mat3 __operator / (const mat3 m, const mat3 n) {
- return mat3 (m[0] / n[0], m[1] / n[1], m[2] / n[2]);
-}
-
-mat4 __operator / (const mat4 m, const mat4 n) {
- return mat4 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]);
-}
-
-vec2 __operator - (const vec2 v) {
- return vec2 (-v.x, -v.y);
-}
-
-vec3 __operator - (const vec3 v) {
- return vec3 (-v.x, -v.y, -v.z);
-}
-
-vec4 __operator - (const vec4 v) {
- return vec4 (-v.x, -v.y, -v.z, -v.w);
-}
-
-ivec2 __operator - (const ivec2 v) {
- return ivec2 (-v.x, -v.y);
-}
-
-ivec3 __operator - (const ivec3 v) {
- return ivec3 (-v.x, -v.y, -v.z);
-}
-
-ivec4 __operator - (const ivec4 v) {
- return ivec4 (-v.x, -v.y, -v.z, -v.w);
-}
-
-mat2 __operator - (const mat2 m) {
- return mat2 (-m[0], -m[1]);
-}
-
-mat3 __operator - (const mat3 m) {
- return mat3 (-m[0], -m[1], -m[2]);
-}
-
-mat4 __operator - (const mat4 m) {
- return mat4 (-m[0], -m[1], -m[2], -m[3]);
-}
-
-//
-// NOTE: postfix increment and decrement operators take additional dummy int parameter to
-// distinguish their prototypes from prefix ones.
-//
-
-void __operator -- (inout float a) {
- a -= 1.0;
-}
-
-void __operator -- (inout int a) {
- a -= 1;
-}
-
-void __operator -- (inout vec2 v) {
- --v.x, --v.y;
-}
-
-void __operator -- (inout vec3 v) {
- --v.x, --v.y, --v.z;
-}
-
-void __operator -- (inout vec4 v) {
- --v.x, --v.y, --v.z, --v.w;
-}
-
-void __operator -- (inout ivec2 v) {
- --v.x, --v.y;
-}
-
-void __operator -- (inout ivec3 v) {
- --v.x, --v.y, --v.z;
-}
-
-void __operator -- (inout ivec4 v) {
- --v.x, --v.y, --v.z, --v.w;
-}
-
-void __operator -- (inout mat2 m) {
- --m[0], --m[1];
-}
-
-void __operator -- (inout mat3 m) {
- --m[0], --m[1], --m[2];
-}
-
-void __operator -- (inout mat4 m) {
- --m[0], --m[1], --m[2], --m[3];
-}
-
-void __operator ++ (inout float a) {
- a += 1.0;
-}
-
-void __operator ++ (inout int a) {
- a += 1;
-}
-
-void __operator ++ (inout vec2 v) {
- ++v.x, ++v.y;
-}
-
-void __operator ++ (inout vec3 v) {
- ++v.x, ++v.y, ++v.z;
-}
-
-void __operator ++ (inout vec4 v) {
- ++v.x, ++v.y, ++v.z, ++v.w;
-}
-
-void __operator ++ (inout ivec2 v) {
- ++v.x, ++v.y;
-}
-
-void __operator ++ (inout ivec3 v) {
- ++v.x, ++v.y, ++v.z;
-}
-
-void __operator ++ (inout ivec4 v) {
- ++v.x, ++v.y, ++v.z, ++v.w;
-}
-
-void __operator ++ (inout mat2 m) {
- ++m[0], ++m[1];
-}
-
-void __operator ++ (inout mat3 m) {
- ++m[0], ++m[1], ++m[2];
-}
-
-void __operator ++ (inout mat4 m) {
- ++m[0], ++m[1], ++m[2], ++m[3];
-}
-
-float __operator -- (inout float a, const int) {
- float c;
- c = a;
- --a;
- return c;
-}
-
-int __operator -- (inout int a, const int) {
- int c;
- c = a;
- --a;
- return c;
-}
-
-vec2 __operator -- (inout vec2 v, const int) {
- return vec2 (v.x--, v.y--);
-}
-
-vec3 __operator -- (inout vec3 v, const int) {
- return vec3 (v.x--, v.y--, v.z--);
-}
-
-vec4 __operator -- (inout vec4 v, const int) {
- return vec4 (v.x--, v.y--, v.z--, v.w--);
-}
-
-ivec2 __operator -- (inout ivec2 v, const int) {
- return ivec2 (v.x--, v.y--);
-}
-
-ivec3 __operator -- (inout ivec3 v, const int) {
- return ivec3 (v.x--, v.y--, v.z--);
-}
-
-ivec4 __operator -- (inout ivec4 v, const int) {
- return ivec4 (v.x--, v.y--, v.z--, v.w--);
-}
-
-mat2 __operator -- (inout mat2 m, const int) {
- return mat2 (m[0]--, m[1]--);
-}
-
-mat3 __operator -- (inout mat3 m, const int) {
- return mat3 (m[0]--, m[1]--, m[2]--);
-}
-
-mat4 __operator -- (inout mat4 m, const int) {
- return mat4 (m[0]--, m[1]--, m[2]--, m[3]--);
-}
-
-float __operator ++ (inout float a, const int) {
- float c;
- c = a;
- ++a;
- return c;
-}
-
-int __operator ++ (inout int a, const int) {
- int c;
- c = a;
- ++a;
- return c;
-}
-
-vec2 __operator ++ (inout vec2 v, const int) {
- return vec2 (v.x++, v.y++);
-}
-
-vec3 __operator ++ (inout vec3 v, const int) {
- return vec3 (v.x++, v.y++, v.z++);
-}
-
-vec4 __operator ++ (inout vec4 v, const int) {
- return vec4 (v.x++, v.y++, v.z++, v.w++);
-}
-
-ivec2 __operator ++ (inout ivec2 v, const int) {
- return ivec2 (v.x++, v.y++);
-}
-
-ivec3 __operator ++ (inout ivec3 v, const int) {
- return ivec3 (v.x++, v.y++, v.z++);
-}
-
-ivec4 __operator ++ (inout ivec4 v, const int) {
- return ivec4 (v.x++, v.y++, v.z++, v.w++);
-}
-
-mat2 __operator ++ (inout mat2 m, const int) {
- return mat2 (m[0]++, m[1]++);
-}
-
-mat3 __operator ++ (inout mat3 m, const int) {
- return mat3 (m[0]++, m[1]++, m[2]++);
-}
-
-mat4 __operator ++ (inout mat4 m, const int) {
- return mat4 (m[0]++, m[1]++, m[2]++, m[3]++);
-}
-
-bool __operator < (const float a, const float b) {
- bool c;
- __asm float_less c, a, b;
- return c;
-}
-
-bool __operator < (const int a, const int b) {
- return float (a) < float (b);
-}
-
-bool __operator > (const float a, const float b) {
- return b < a;
-}
-
-bool __operator > (const int a, const int b) {
- return b < a;
-}
-
-bool __operator >= (const float a, const float b) {
- return a > b || a == b;
-}
-
-bool __operator >= (const int a, const int b) {
- return a > b || a == b;
-}
-
-bool __operator <= (const float a, const float b) {
- return a < b || a == b;
-}
-
-bool __operator <= (const int a, const int b) {
- return a < b || a == b;
-}
-
-//bool __operator == (const float a, const float b) {
-// bool c;
-// __asm float_equal c, a, b;
-// return c;
-//}
-//
-//bool __operator == (const int a, const int b) {
-// return float (a) == float (b);
-//}
-//
-//bool __operator == (const bool a, const bool b) {
-// return float (a) == float (b);
-//}
-//
-//bool __operator == (const vec2 v, const vec2 u) {
-// return v.x == u.x && v.y == u.y;
-//}
-//
-//bool __operator == (const vec3 v, const vec3 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z;
-//}
-//
-//bool __operator == (const vec4 v, const vec4 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z && v.w == u.w;
-//}
-//
-//bool __operator == (const ivec2 v, const ivec2 u) {
-// return v.x == u.x && v.y == u.y;
-//}
-//
-//bool __operator == (const ivec3 v, const ivec3 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z;
-//}
-//
-//bool __operator == (const ivec4 v, const ivec4 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z && v.w == u.w;
-//}
-//
-//bool __operator == (const bvec2 v, const bvec2 u) {
-// return v.x == u.x && v.y == u.y;
-//}
-//
-//bool __operator == (const bvec3 v, const bvec3 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z;
-//}
-//
-//bool __operator == (const bvec4 v, const bvec4 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z && v.w == u.w;
-//}
-//
-//bool __operator == (const mat2 m, const mat2 n) {
-// return m[0] == n[0] && m[1] == n[1];
-//}
-//
-//bool __operator == (const mat3 m, const mat3 n) {
-// return m[0] == n[0] && m[1] == n[1] && m[2] == n[2];
-//}
-//
-//bool __operator == (const mat4 m, const mat4 n) {
-// return m[0] == n[0] && m[1] == n[1] && m[2] == n[2] && m[3] == n[3];
-//}
-//
-//bool __operator != (const float a, const float b) {
-// return !(a == b);
-//}
-//
-//bool __operator != (const int a, const int b) {
-// return !(a == b);
-//}
-//
-//bool __operator != (const bool a, const bool b) {
-// return !(a == b);
-//}
-//
-//bool __operator != (const vec2 v, const vec2 u) {
-// return v.x != u.x || v.y != u.y;
-//}
-//
-//bool __operator != (const vec3 v, const vec3 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z;
-//}
-//
-//bool __operator != (const vec4 v, const vec4 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z || v.w != u.w;
-//}
-//
-//bool __operator != (const ivec2 v, const ivec2 u) {
-// return v.x != u.x || v.y != u.y;
-//}
-//
-//bool __operator != (const ivec3 v, const ivec3 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z;
-//}
-//
-//bool __operator != (const ivec4 v, const ivec4 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z || v.w != u.w;
-//}
-//
-//bool __operator != (const bvec2 v, const bvec2 u) {
-// return v.x != u.x || v.y != u.y;
-//}
-//
-//bool __operator != (const bvec3 v, const bvec3 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z;
-//}
-//
-//bool __operator != (const bvec4 v, const bvec4 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z || v.w != u.w;
-//}
-//
-//bool __operator != (const mat2 m, const mat2 n) {
-// return m[0] != n[0] || m[1] != n[1];
-//}
-//
-//bool __operator != (const mat3 m, const mat3 n) {
-// return m[0] != n[0] || m[1] != n[1] || m[2] != n[2];
-//}
-//
-//bool __operator != (const mat4 m, const mat4 n) {
-// return m[0] != n[0] || m[1] != n[1] || m[2] != n[2] || m[3] != n[3];
-//}
-
-bool __operator ^^ (const bool a, const bool b) {
- return a != b;
-}
-
-//
-// These operators are handled internally by the compiler:
-//
-// bool __operator && (bool a, bool b) {
-// return a ? b : false;
-// }
-// bool __operator || (bool a, bool b) {
-// return a ? true : b;
-// }
-//
-
-bool __operator ! (const bool a) {
- return a == false;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_fragment_builtin.gc
deleted file mode 100755
index b4c5aa3ec..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_fragment_builtin.gc
+++ /dev/null
@@ -1,366 +0,0 @@
-
-//
-// TODO:
-// - implement texture1D, texture2D, texture3D, textureCube,
-// - implement shadow1D, shadow2D,
-// - implement dFdx, dFdy,
-//
-
-//
-// From Shader Spec, ver. 1.10, rev. 59
-//
-// The output of the fragment shader is processed by the fixed function operations at the back end
-// of the OpenGL pipeline. Fragment shaders output values to the OpenGL pipeline using the built-in
-// variables gl_FragColor, gl_FragData and gl_FragDepth, unless the discard keyword is executed.
-//
-// These variables may be written more than once within a fragment shader. If so, the last value
-// assigned is the one used in the subsequent fixed function pipeline. The values written to these
-// variables may be read back after writing them. Reading from these variables before writing them
-// results in an undefined value. The fixed functionality computed depth for a fragment may be
-// obtained by reading gl_FragCoord.z, described below.
-//
-// Writing to gl_FragColor specifies the fragment color that will be used by the subsequent fixed
-// functionality pipeline. If subsequent fixed functionality consumes fragment color and an
-// execution of a fragment shader does not write a value to gl_FragColor then the fragment color
-// consumed is undefined.
-//
-// If the frame buffer is configured as a color index buffer then behavior is undefined when using
-// a fragment shader.
-//
-// Writing to gl_FragDepth will establish the depth value for the fragment being processed. If
-// depth buffering is enabled, and a shader does not write gl_FragDepth, then the fixed function
-// value for depth will be used as the fragment's depth value. If a shader statically assigns
-// a value to gl_FragDepth, and there is an execution path through the shader that does not set
-// gl_FragDepth, then the value of the fragment's depth may be undefined for executions of the
-// shader that take that path. That is, if a shader statically contains a write gl_FragDepth, then
-// it is responsible for always writing it.
-//
-// (A shader contains a static assignment to a variable x if, after pre-processing, the shader
-// contains statement that would write x, whether or not run-time flow of control will cause
-// that statement to be executed.)
-//
-// The variable gl_FragData is an array. Writing to gl_FragData[n] specifies the fragment data
-// that will be used by the subsequent fixed functionality pipeline for data n. If subsequent
-// fixed functionality consumes fragment data and an execution of a fragment shader does not
-// write a value to it, then the fragment data consumed is undefined.
-//
-// If a shader statically assigns a value to gl_FragColor, it may not assign a value to any element
-// of gl_FragData. If a shader statically writes a value to any element of gl_FragData, it may not
-// assign a value to gl_FragColor. That is, a shader may assign values to either gl_FragColor or
-// gl_FragData, but not both.
-//
-// If a shader executes the discard keyword, the fragment is discarded, and the values of
-// gl_FragDepth, gl_FragColor and gl_FragData become irrelevant.
-//
-// The variable gl_FragCoord is available as a read-only variable from within fragment shaders
-// and it holds the window relative coordinates x, y, z, and 1/w values for the fragment. This
-// value is the result of the fixed functionality that interpolates primitives after vertex
-// processing to generate fragments. The z component is the depth value that would be used for
-// the fragment's depth if a shader contained no writes to gl_FragDepth. This is useful for
-// invariance if a shader conditionally computes gl_FragDepth but otherwise wants the fixed
-// functionality fragment depth.
-//
-// The fragment shader has access to the read-only built-in variable gl_FrontFacing whose value
-// is true if the fragment belongs to a front-facing primitive. One use of this is to emulate
-// two-sided lighting by selecting one of two colors calculated by the vertex shader.
-//
-// The built-in variables that are accessible from a fragment shader are intrinsically given types
-// as follows:
-//
-
-__fixed_input vec4 gl_FragCoord;
-__fixed_input bool gl_FrontFacing;
-__fixed_output vec4 gl_FragColor;
-__fixed_output vec4 gl_FragData[gl_MaxDrawBuffers];
-__fixed_output float gl_FragDepth;
-
-//
-// However, they do not behave like variables with no qualifier; their behavior is as described
-// above. These built-in variables have global scope.
-//
-
-//
-// Unlike user-defined varying variables, the built-in varying variables don't have a strict
-// one-to-one correspondence between the vertex language and the fragment language. Two sets are
-// provided, one for each language. Their relationship is described below.
-//
-// The following varying variables are available to read from in a fragment shader. The gl_Color
-// and gl_SecondaryColor names are the same names as attributes passed to the vertex shader.
-// However, there is no name conflict, because attributes are visible only in vertex shaders
-// and the following are only visible in a fragment shader.
-//
-
-varying vec4 gl_Color;
-varying vec4 gl_SecondaryColor;
-varying vec4 gl_TexCoord[]; // at most will be gl_MaxTextureCoords
-varying float gl_FogFragCoord;
-
-//
-// The values in gl_Color and gl_SecondaryColor will be derived automatically by the system from
-// gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and gl_BackSecondaryColor based on which
-// face is visible. If fixed functionality is used for vertex processing, then gl_FogFragCoord will
-// either be the z-coordinate of the fragment in eye space, or the interpolation of the fog
-// coordinate, as described in section 3.10 of the OpenGL 1.4 Specification. The gl_TexCoord[]
-// values are the interpolated gl_TexCoord[] values from a vertex shader or the texture coordinates
-// of any fixed pipeline based vertex functionality.
-//
-// Indices to the fragment shader gl_TexCoord array are as described above in the vertex shader
-// text.
-//
-
-//
-// The OpenGL Shading Language defines an assortment of built-in convenience functions for scalar
-// and vector operations. Many of these built-in functions can be used in more than one type
-// of shader, but some are intended to provide a direct mapping to hardware and so are available
-// only for a specific type of shader.
-//
-// The built-in functions basically fall into three categories:
-//
-// * They expose some necessary hardware functionality in a convenient way such as accessing
-// a texture map. There is no way in the language for these functions to be emulated by a shader.
-//
-// * They represent a trivial operation (clamp, mix, etc.) that is very simple for the user
-// to write, but they are very common and may have direct hardware support. It is a very hard
-// problem for the compiler to map expressions to complex assembler instructions.
-//
-// * They represent an operation graphics hardware is likely to accelerate at some point. The
-// trigonometry functions fall into this category.
-//
-// Many of the functions are similar to the same named ones in common C libraries, but they support
-// vector input as well as the more traditional scalar input.
-//
-// Applications should be encouraged to use the built-in functions rather than do the equivalent
-// computations in their own shader code since the built-in functions are assumed to be optimal
-// (e.g., perhaps supported directly in hardware).
-//
-// User code can replace built-in functions with their own if they choose, by simply re-declaring
-// and defining the same name and argument list.
-//
-
-//
-// 8.7 Texture Lookup Functions
-//
-// Texture lookup functions are available to both vertex and fragment shaders. However, level
-// of detail is not computed by fixed functionality for vertex shaders, so there are some
-// differences in operation between vertex and fragment texture lookups. The functions in the table
-// below provide access to textures through samplers, as set up through the OpenGL API. Texture
-// properties such as size, pixel format, number of dimensions, filtering method, number of mip-map
-// levels, depth comparison, and so on are also defined by OpenGL API calls. Such properties are
-// taken into account as the texture is accessed via the built-in functions defined below.
-//
-// If a non-shadow texture call is made to a sampler that represents a depth texture with depth
-// comparisons turned on, then results are undefined. If a shadow texture call is made to a sampler
-// that represents a depth texture with depth comparisions turned off, the results are undefined.
-// If a shadow texture call is made to a sampler that does not represent a depth texture, then
-// results are undefined.
-//
-// In all functions below, the bias parameter is optional for fragment shaders. The bias parameter
-// is not accepted in a vertex shader. For a fragment shader, if bias is present, it is added to
-// the calculated level of detail prior to performing the texture access operation. If the bias
-// parameter is not provided, then the implementation automatically selects level of detail:
-// For a texture that is not mip-mapped, the texture is used directly. If it is mip-mapped and
-// running in a fragment shader, the LOD computed by the implementation is used to do the texture
-// lookup. If it is mip-mapped and running on the vertex shader, then the base texture is used.
-//
-// The built-ins suffixed with "Lod" are allowed only in a vertex shader. For the "Lod" functions,
-// lod is directly used as the level of detail.
-//
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 1D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate coord.s is divided by
-// the last component of coord.
-//
-// XXX
-vec4 texture1D (sampler1D sampler, float coord, float bias) {
- return vec4 (0.0);
-}
-vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias) {
- return texture1D (sampler, coord.s / coord.t, bias);
-}
-vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias) {
- return texture1D (sampler, coord.s / coord.q, bias);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate (coord.s, coord.t) is
-// divided by the last component of coord. The third component of coord is ignored for the vec4
-// coord variant.
-//
-// XXX
-vec4 texture2D (sampler2D sampler, vec2 coord, float bias) {
- return vec4 (0.0);
-}
-vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias) {
- return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p), bias);
-}
-vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias) {
- return texture2D (sampler, vec2 (coord.s / coord.q, coord.s / coord.q), bias);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate is divided by coord.q.
-//
-// XXX
-vec4 texture3D (sampler3D sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
-vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias) {
- return texture3DProj (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q),
- bias);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the cube map texture currently bound
-// to sampler. The direction of coord is used to select which face to do a 2-dimensional texture
-// lookup in, as described in section 3.8.6 in version 1.4 of the OpenGL specification.
-//
-// XXX
-vec4 textureCube (samplerCube sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
-
-//
-// Use texture coordinate coord to do a depth comparison lookup on the depth texture bound
-// to sampler, as described in section 3.8.14 of version 1.4 of the OpenGL specification. The 3rd
-// component of coord (coord.p) is used as the R value. The texture bound to sampler must be a
-// depth texture, or results are undefined. For the projective ("Proj") version of each built-in,
-// the texture coordinate is divide by coord.q, giving a depth value R of coord.p/coord.q. The
-// second component of coord is ignored for the "1D" variants.
-//
-// XXX
-vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
-// XXX
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
-vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias) {
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);
-}
-vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias) {
- return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), bias);
-}
-
-//
-// 8.8 Fragment Processing Functions
-//
-// Fragment processing functions are only available in shaders intended for use on the fragment
-// processor. Derivatives may be computationally expensive and/or numerically unstable. Therefore,
-// an OpenGL implementation may approximate the true derivatives by using a fast but not entirely
-// accurate derivative computation.
-//
-// The expected behavior of a derivative is specified using forward/backward differencing.
-//
-// Forward differencing:
-//
-// F(x+dx) - F(x) ~ dFdx(x) * dx 1a
-// dFdx(x) ~ (F(x+dx) - F(x)) / dx 1b
-//
-// Backward differencing:
-//
-// F(x-dx) - F(x) ~ -dFdx(x) * dx 2a
-// dFdx(x) ~ (F(x) - F(x-dx)) / dx 2b
-//
-// With single-sample rasterization, dx <= 1.0 in equations 1b and 2b. For multi-sample
-// rasterization, dx < 2.0 in equations 1b and 2b.
-//
-// dFdy is approximated similarly, with y replacing x.
-//
-// A GL implementation may use the above or other methods to perform the calculation, subject
-// to the following conditions:
-//
-// 1) The method may use piecewise linear approximations. Such linear approximations imply that
-// higher order derivatives, dFdx(dFdx(x)) and above, are undefined.
-//
-// 2) The method may assume that the function evaluated is continuous. Therefore derivatives within
-// the body of a non-uniform conditional are undefined.
-//
-// 3) The method may differ per fragment, subject to the constraint that the method may vary by
-// window coordinates, not screen coordinates. The invariance requirement described in section
-// 3.1 of the OpenGL 1.4 specification is relaxed for derivative calculations, because
-// the method may be a function of fragment location.
-//
-// Other properties that are desirable, but not required, are:
-//
-// 4) Functions should be evaluated within the interior of a primitive (interpolated, not
-// extrapolated).
-//
-// 5) Functions for dFdx should be evaluated while holding y constant. Functions for dFdy should
-// be evaluated while holding x constant. However, mixed higher order derivatives, like
-// dFdx(dFdy(y)) and dFdy(dFdx(x)) are undefined.
-//
-// In some implementations, varying degrees of derivative accuracy may be obtained by providing
-// GL hints (section 5.6 of the OpenGL 1.4 specification), allowing a user to make an image
-// quality versus speed tradeoff.
-//
-
-//
-// Returns the derivative in x using local differencing for the input argument p.
-//
-// XXX
-float dFdx (float p) {
- return 0.0;
-}
-// XXX
-vec2 dFdx (vec2 p) {
- return vec2 (0.0);
-}
-// XXX
-vec3 dFdx (vec3 p) {
- return vec3 (0.0);
-}
-// XXX
-vec4 dFdx (vec4 p) {
- return vec4 (0.0);
-}
-
-//
-// Returns the derivative in y using local differencing for the input argument p.
-//
-// These two functions are commonly used to estimate the filter width used to anti-alias procedural
-// textures.We are assuming that the expression is being evaluated in parallel on a SIMD array so
-// that at any given point in time the value of the function is known at the grid points
-// represented by the SIMD array. Local differencing between SIMD array elements can therefore
-// be used to derive dFdx, dFdy, etc.
-//
-// XXX
-float dFdy (float p) {
- return 0.0;
-}
-// XXX
-vec2 dFdy (vec2 p) {
- return vec2 (0.0);
-}
-// XXX
-vec3 dFdy (vec3 p) {
- return vec3 (0.0);
-}
-// XXX
-vec4 dFdy (vec4 p) {
- return vec4 (0.0);
-}
-
-//
-// Returns the sum of the absolute derivative in x and y using local differencing for the input
-// argument p, i.e.:
-//
-// return = abs (dFdx (p)) + abs (dFdy (p));
-//
-
-float fwidth (float p) {
- return abs (dFdx (p)) + abs (dFdy (p));
-}
-vec2 fwidth (vec2 p) {
- return abs (dFdx (p)) + abs (dFdy (p));
-}
-vec3 fwidth (vec3 p) {
- return abs (dFdx (p)) + abs (dFdy (p));
-}
-vec4 fwidth (vec4 p) {
- return abs (dFdx (p)) + abs (dFdy (p));
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_shader.syn b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_shader.syn
deleted file mode 100644
index 65d7fe353..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_shader.syn
+++ /dev/null
@@ -1,1508 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.2
- *
- * Copyright (C) 2004-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * \file slang_shader.syn
- * slang vertex/fragment shader syntax
- * \author Michal Krol
- */
-
-/*
- * usage:
- * syn2c slang_shader.syn > slang_shader_syn.h
- *
- * when modifying or extending this file, several things must be taken into consideration:
- * - when adding new operators that were marked as reserved in the initial specification,
- * one must only uncomment particular lines of code that refer to operators being added;
- * - when adding new shader target, one must reserve new value for shader_type register and
- * use it in .if constructs for symbols that are exclusive for that shader;
- * - some symbols mimic output of other symbols - the best example is the "for" construct:
- * expression "for (foo(); ; bar())" is seen as "for (foo(); true; bar())" by the output
- * processor - hence, special care must be taken when rearranging output of essential symbols;
- * - order of single-quoted tokens does matter in alternatives - so do not parse "<" operator
- * before "<<" and "<<" before "<<=";
- * - all double-quoted tokens are internally preprocessed to eliminate problems with parsing
- * strings that are prefixes of other strings, like "sampler1D" and "sampler1DShadow";
- */
-
-.syntax translation_unit;
-
-/* revision number - increment after each change affecting emitted output */
-.emtcode REVISION 2
-
-/* external declaration */
-.emtcode EXTERNAL_NULL 0
-.emtcode EXTERNAL_FUNCTION_DEFINITION 1
-.emtcode EXTERNAL_DECLARATION 2
-
-/* declaration */
-.emtcode DECLARATION_FUNCTION_PROTOTYPE 1
-.emtcode DECLARATION_INIT_DECLARATOR_LIST 2
-
-/* function type */
-.emtcode FUNCTION_ORDINARY 0
-.emtcode FUNCTION_CONSTRUCTOR 1
-.emtcode FUNCTION_OPERATOR 2
-
-/* operator type */
-.emtcode OPERATOR_ASSIGN 1
-.emtcode OPERATOR_ADDASSIGN 2
-.emtcode OPERATOR_SUBASSIGN 3
-.emtcode OPERATOR_MULASSIGN 4
-.emtcode OPERATOR_DIVASSIGN 5
-/*.emtcode OPERATOR_MODASSIGN 6*/
-/*.emtcode OPERATOR_LSHASSIGN 7*/
-/*.emtcode OPERATOR_RSHASSIGN 8*/
-/*.emtcode OPERATOR_ORASSIGN 9*/
-/*.emtcode OPERATOR_XORASSIGN 10*/
-/*.emtcode OPERATOR_ANDASSIGN 11*/
-.emtcode OPERATOR_LOGICALXOR 12
-/*.emtcode OPERATOR_BITOR 13*/
-/*.emtcode OPERATOR_BITXOR 14*/
-/*.emtcode OPERATOR_BITAND 15*/
-.emtcode OPERATOR_EQUAL 16
-.emtcode OPERATOR_NOTEQUAL 17
-.emtcode OPERATOR_LESS 18
-.emtcode OPERATOR_GREATER 19
-.emtcode OPERATOR_LESSEQUAL 20
-.emtcode OPERATOR_GREATEREQUAL 21
-/*.emtcode OPERATOR_LSHIFT 22*/
-/*.emtcode OPERATOR_RSHIFT 23*/
-.emtcode OPERATOR_MULTIPLY 24
-.emtcode OPERATOR_DIVIDE 25
-/*.emtcode OPERATOR_MODULUS 26*/
-.emtcode OPERATOR_INCREMENT 27
-.emtcode OPERATOR_DECREMENT 28
-.emtcode OPERATOR_PLUS 29
-.emtcode OPERATOR_MINUS 30
-/*.emtcode OPERATOR_COMPLEMENT 31*/
-.emtcode OPERATOR_NOT 32
-
-/* init declarator list */
-.emtcode DECLARATOR_NONE 0
-.emtcode DECLARATOR_NEXT 1
-
-/* variable declaration */
-.emtcode VARIABLE_NONE 0
-.emtcode VARIABLE_IDENTIFIER 1
-.emtcode VARIABLE_INITIALIZER 2
-.emtcode VARIABLE_ARRAY_EXPLICIT 3
-.emtcode VARIABLE_ARRAY_UNKNOWN 4
-
-/* type qualifier */
-.emtcode TYPE_QUALIFIER_NONE 0
-.emtcode TYPE_QUALIFIER_CONST 1
-.emtcode TYPE_QUALIFIER_ATTRIBUTE 2
-.emtcode TYPE_QUALIFIER_VARYING 3
-.emtcode TYPE_QUALIFIER_UNIFORM 4
-.emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5
-.emtcode TYPE_QUALIFIER_FIXEDINPUT 6
-
-/* type specifier */
-.emtcode TYPE_SPECIFIER_VOID 0
-.emtcode TYPE_SPECIFIER_BOOL 1
-.emtcode TYPE_SPECIFIER_BVEC2 2
-.emtcode TYPE_SPECIFIER_BVEC3 3
-.emtcode TYPE_SPECIFIER_BVEC4 4
-.emtcode TYPE_SPECIFIER_INT 5
-.emtcode TYPE_SPECIFIER_IVEC2 6
-.emtcode TYPE_SPECIFIER_IVEC3 7
-.emtcode TYPE_SPECIFIER_IVEC4 8
-.emtcode TYPE_SPECIFIER_FLOAT 9
-.emtcode TYPE_SPECIFIER_VEC2 10
-.emtcode TYPE_SPECIFIER_VEC3 11
-.emtcode TYPE_SPECIFIER_VEC4 12
-.emtcode TYPE_SPECIFIER_MAT2 13
-.emtcode TYPE_SPECIFIER_MAT3 14
-.emtcode TYPE_SPECIFIER_MAT4 15
-.emtcode TYPE_SPECIFIER_SAMPLER1D 16
-.emtcode TYPE_SPECIFIER_SAMPLER2D 17
-.emtcode TYPE_SPECIFIER_SAMPLER3D 18
-.emtcode TYPE_SPECIFIER_SAMPLERCUBE 19
-.emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20
-.emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21
-.emtcode TYPE_SPECIFIER_STRUCT 22
-.emtcode TYPE_SPECIFIER_TYPENAME 23
-
-/* structure field */
-.emtcode FIELD_NONE 0
-.emtcode FIELD_NEXT 1
-.emtcode FIELD_ARRAY 2
-
-/* operation */
-.emtcode OP_END 0
-.emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1
-.emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2
-.emtcode OP_DECLARE 3
-.emtcode OP_ASM 4
-.emtcode OP_BREAK 5
-.emtcode OP_CONTINUE 6
-.emtcode OP_DISCARD 7
-.emtcode OP_RETURN 8
-.emtcode OP_EXPRESSION 9
-.emtcode OP_IF 10
-.emtcode OP_WHILE 11
-.emtcode OP_DO 12
-.emtcode OP_FOR 13
-.emtcode OP_PUSH_VOID 14
-.emtcode OP_PUSH_BOOL 15
-.emtcode OP_PUSH_INT 16
-.emtcode OP_PUSH_FLOAT 17
-.emtcode OP_PUSH_IDENTIFIER 18
-.emtcode OP_SEQUENCE 19
-.emtcode OP_ASSIGN 20
-.emtcode OP_ADDASSIGN 21
-.emtcode OP_SUBASSIGN 22
-.emtcode OP_MULASSIGN 23
-.emtcode OP_DIVASSIGN 24
-/*.emtcode OP_MODASSIGN 25*/
-/*.emtcode OP_LSHASSIGN 26*/
-/*.emtcode OP_RSHASSIGN 27*/
-/*.emtcode OP_ORASSIGN 28*/
-/*.emtcode OP_XORASSIGN 29*/
-/*.emtcode OP_ANDASSIGN 30*/
-.emtcode OP_SELECT 31
-.emtcode OP_LOGICALOR 32
-.emtcode OP_LOGICALXOR 33
-.emtcode OP_LOGICALAND 34
-/*.emtcode OP_BITOR 35*/
-/*.emtcode OP_BITXOR 36*/
-/*.emtcode OP_BITAND 37*/
-.emtcode OP_EQUAL 38
-.emtcode OP_NOTEQUAL 39
-.emtcode OP_LESS 40
-.emtcode OP_GREATER 41
-.emtcode OP_LESSEQUAL 42
-.emtcode OP_GREATEREQUAL 43
-/*.emtcode OP_LSHIFT 44*/
-/*.emtcode OP_RSHIFT 45*/
-.emtcode OP_ADD 46
-.emtcode OP_SUBTRACT 47
-.emtcode OP_MULTIPLY 48
-.emtcode OP_DIVIDE 49
-/*.emtcode OP_MODULUS 50*/
-.emtcode OP_PREINCREMENT 51
-.emtcode OP_PREDECREMENT 52
-.emtcode OP_PLUS 53
-.emtcode OP_MINUS 54
-/*.emtcode OP_COMPLEMENT 55*/
-.emtcode OP_NOT 56
-.emtcode OP_SUBSCRIPT 57
-.emtcode OP_CALL 58
-.emtcode OP_FIELD 59
-.emtcode OP_POSTINCREMENT 60
-.emtcode OP_POSTDECREMENT 61
-
-/* parameter qualifier */
-.emtcode PARAM_QUALIFIER_IN 0
-.emtcode PARAM_QUALIFIER_OUT 1
-.emtcode PARAM_QUALIFIER_INOUT 2
-
-/* function parameter */
-.emtcode PARAMETER_NONE 0
-.emtcode PARAMETER_NEXT 1
-
-/* function parameter array presence */
-.emtcode PARAMETER_ARRAY_NOT_PRESENT 0
-.emtcode PARAMETER_ARRAY_PRESENT 1
-
-.errtext INVALID_EXTERNAL_DECLARATION "error 2001: invalid external declaration"
-.errtext INVALID_OPERATOR_OVERRIDE "error 2002: invalid operator override"
-.errtext LBRACE_EXPECTED "error 2003: '{' expected but '$err_token$' found"
-.errtext LPAREN_EXPECTED "error 2004: '(' expected but '$err_token$' found"
-.errtext RPAREN_EXPECTED "error 2005: ')' expected but '$err_token$' found"
-
-/* tells whether the shader that is being parsed is a built-in shader or not */
-/* 0 - normal behaviour */
-/* 1 - accepts constructor and operator definitions and __asm statements */
-/* the implementation will set it to 1 when compiling internal built-in shaders */
-.regbyte parsing_builtin 0
-
-/* holds the type of the shader being parsed; possible values are listed below */
-/* FRAGMENT_SHADER 1 */
-/* VERTEX_SHADER 2 */
-/* shader type is set by the caller before parsing */
-.regbyte shader_type 0
-
-/*
- <variable_identifier> ::= <identifier>
-*/
-variable_identifier
- identifier .emit OP_PUSH_IDENTIFIER;
-
-/*
- <primary_expression> ::= <variable_identifier>
- | <intconstant>
- | <floatconstant>
- | <boolconstant>
- | "(" <expression> ")"
-*/
-primary_expression
- floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;
-primary_expression_1
- lparen .and expression .and rparen;
-
-/*
- <postfix_expression> ::= <primary_expression>
- | <postfix_expression> "[" <integer_expression> "]"
- | <function_call>
- | <postfix_expression> "." <field_selection>
- | <postfix_expression> "++"
- | <postfix_expression> "--"
-*/
-postfix_expression
- postfix_expression_1 .and .loop postfix_expression_2;
-postfix_expression_1
- function_call .or primary_expression;
-postfix_expression_2
- postfix_expression_3 .or postfix_expression_4 .or
- plusplus .emit OP_POSTINCREMENT .or
- minusminus .emit OP_POSTDECREMENT;
-postfix_expression_3
- lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;
-postfix_expression_4
- dot .and field_selection .emit OP_FIELD;
-
-/*
- <integer_expression> ::= <expression>
-*/
-integer_expression
- expression;
-
-/*
- <function_call> ::= <function_call_generic>
-*/
-function_call
- function_call_generic .emit OP_CALL .and .true .emit OP_END;
-
-/*
- <function_call_generic> ::= <function_call_header_with_parameters> ")"
- | <function_call_header_no_parameters> ")"
-*/
-function_call_generic
- function_call_generic_1 .or function_call_generic_2;
-function_call_generic_1
- function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;
-function_call_generic_2
- function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;
-
-/*
- <function_call_header_no_parameters>::= <function_call_header> "void"
- | <function_call_header>
-*/
-function_call_header_no_parameters
- function_call_header .and function_call_header_no_parameters_1;
-function_call_header_no_parameters_1
- "void" .or .true;
-
-/*
- <function_call_header_with_parameters>::= <function_call_header> <assignment_expression>
- | <function_call_header_with_parameters> ","
- <assignment_expression>
-*/
-function_call_header_with_parameters
- function_call_header .and assignment_expression .and .true .emit OP_END .and
- .loop function_call_header_with_parameters_1;
-function_call_header_with_parameters_1
- comma .and assignment_expression .and .true .emit OP_END;
-
-/*
- <function_call_header> ::= <function_identifier> "("
-*/
-function_call_header
- function_identifier .and lparen;
-
-/*
- <function_identifier> ::= <constructor_identifier>
- | <identifier>
-
-note: <constructor_identifier> has been deleted
-*/
-function_identifier
- identifier;
-
-/*
- <unary_expression> ::= <postfix_expression>
- | "++" <unary_expression>
- | "--" <unary_expression>
- | <unary_operator> <unary_expression>
-
- <unary_operator> ::= "+"
- | "-"
- | "!"
- | "~" // reserved
-*/
-unary_expression
- postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or
- unary_expression_4 .or unary_expression_5/* .or unary_expression_6*/;
-unary_expression_1
- plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;
-unary_expression_2
- minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;
-unary_expression_3
- plus .and unary_expression .and .true .emit OP_PLUS;
-unary_expression_4
- minus .and unary_expression .and .true .emit OP_MINUS;
-unary_expression_5
- bang .and unary_expression .and .true .emit OP_NOT;
-/*unary_expression_6
- tilde .and unary_expression .and .true .emit OP_COMPLEMENT;*/
-
-/*
- <multiplicative_expression> ::= <unary_expression>
- | <multiplicative_expression> "*" <unary_expression>
- | <multiplicative_expression> "/" <unary_expression>
- | <multiplicative_expression> "%" <unary_expression> // reserved
-*/
-multiplicative_expression
- unary_expression .and .loop multiplicative_expression_1;
-multiplicative_expression_1
- multiplicative_expression_2 .or multiplicative_expression_3/* .or multiplicative_expression_4*/;
-multiplicative_expression_2
- star .and unary_expression .and .true .emit OP_MULTIPLY;
-multiplicative_expression_3
- slash .and unary_expression .and .true .emit OP_DIVIDE;
-/*multiplicative_expression_4
- percent .and unary_expression .and .true .emit OP_MODULUS;*/
-
-/*
- <additive_expression> ::= <multiplicative_expression>
- | <additive_expression> "+" <multiplicative_expression>
- | <additive_expression> "-" <multiplicative_expression>
-*/
-additive_expression
- multiplicative_expression .and .loop additive_expression_1;
-additive_expression_1
- additive_expression_2 .or additive_expression_3;
-additive_expression_2
- plus .and multiplicative_expression .and .true .emit OP_ADD;
-additive_expression_3
- minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;
-
-/*
- <shift_expression> ::= <additive_expression>
- | <shift_expression> "<<" <additive_expression> // reserved
- | <shift_expression> ">>" <additive_expression> // reserved
-*/
-shift_expression
- additive_expression/* .and .loop shift_expression_1*/;
-/*shift_expression_1
- shift_expression_2 .or shift_expression_3;*/
-/*shift_expression_2
- lessless .and additive_expression .and .true .emit OP_LSHIFT;*/
-/*shift_expression_3
- greatergreater .and additive_expression .and .true .emit OP_RSHIFT;*/
-
-/*
- <relational_expression> ::= <shift_expression>
- | <relational_expression> "<" <shift_expression>
- | <relational_expression> ">" <shift_expression>
- | <relational_expression> "<=" <shift_expression>
- | <relational_expression> ">=" <shift_expression>
-*/
-relational_expression
- shift_expression .and .loop relational_expression_1;
-relational_expression_1
- relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or
- relational_expression_5;
-relational_expression_2
- lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;
-relational_expression_3
- greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;
-relational_expression_4
- less .and shift_expression .and .true .emit OP_LESS;
-relational_expression_5
- greater .and shift_expression .and .true .emit OP_GREATER;
-
-/*
- <equality_expression> ::= <relational_expression>
- | <equality_expression> "==" <relational_expression>
- | <equality_expression> "!=" <relational_expression>
-*/
-equality_expression
- relational_expression .and .loop equality_expression_1;
-equality_expression_1
- equality_expression_2 .or equality_expression_3;
-equality_expression_2
- equalsequals .and relational_expression .and .true .emit OP_EQUAL;
-equality_expression_3
- bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;
-
-/*
- <and_expression> ::= <equality_expression>
- | <and_expression> "&" <equality_expression> // reserved
-*/
-and_expression
- equality_expression/* .and .loop and_expression_1*/;
-/*and_expression_1
- ampersand .and equality_expression .and .true .emit OP_BITAND;*/
-
-/*
- <exclusive_or_expression> ::= <and_expression>
- | <exclusive_or_expression> "^" <and_expression> // reserved
-*/
-exclusive_or_expression
- and_expression/* .and .loop exclusive_or_expression_1*/;
-/*exclusive_or_expression_1
- caret .and and_expression .and .true .emit OP_BITXOR;*/
-
-/*
- <inclusive_or_expression> ::= <exclusive_or_expression>
- | <inclusive_or_expression> "|" <exclusive_or_expression> // reserved
-*/
-inclusive_or_expression
- exclusive_or_expression/* .and .loop inclusive_or_expression_1*/;
-/*inclusive_or_expression_1
- bar .and exclusive_or_expression .and .true .emit OP_BITOR;*/
-
-/*
- <logical_and_expression> ::= <inclusive_or_expression>
- | <logical_and_expression> "&&" <inclusive_or_expression>
-*/
-logical_and_expression
- inclusive_or_expression .and .loop logical_and_expression_1;
-logical_and_expression_1
- ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;
-
-/*
- <logical_xor_expression> ::= <logical_and_expression>
- | <logical_xor_expression> "^^" <logical_and_expression>
-*/
-logical_xor_expression
- logical_and_expression .and .loop logical_xor_expression_1;
-logical_xor_expression_1
- caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;
-
-/*
- <logical_or_expression> ::= <logical_xor_expression>
- | <logical_or_expression> "||" <logical_xor_expression>
-*/
-logical_or_expression
- logical_xor_expression .and .loop logical_or_expression_1;
-logical_or_expression_1
- barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;
-
-/*
- <conditional_expression> ::= <logical_or_expression>
- | <logical_or_expression> "?" <expression> ":"
- <conditional_expression>
-*/
-conditional_expression
- logical_or_expression .and .loop conditional_expression_1;
-conditional_expression_1
- question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;
-
-/*
- <assignment_expression> ::= <conditional_expression>
- | <unary_expression> <assignment_operator>
- <assignment_expression>
-
- <assignment_operator> ::= "="
- | "*="
- | "/="
- | "+="
- | "-="
- | "%=" // reserved
- | "<<=" // reserved
- | ">>=" // reserved
- | "&=" // reserved
- | "^=" // reserved
- | "|=" // reserved
-*/
-assignment_expression
- assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or
- assignment_expression_4 .or assignment_expression_5/* .or assignment_expression_6 .or
- assignment_expression_7 .or assignment_expression_8 .or assignment_expression_9 .or
- assignment_expression_10 .or assignment_expression_11*/ .or conditional_expression;
-assignment_expression_1
- unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;
-assignment_expression_2
- unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;
-assignment_expression_3
- unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;
-assignment_expression_4
- unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;
-assignment_expression_5
- unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;
-/*assignment_expression_6
- unary_expression .and percentequals .and assignment_expression .and .true .emit OP_MODASSIGN;*/
-/*assignment_expression_7
- unary_expression .and lesslessequals .and assignment_expression .and .true .emit OP_LSHASSIGN;*/
-/*assignment_expression_8
- unary_expression .and greatergreaterequals .and assignment_expression .and
- .true .emit OP_RSHASSIGN;*/
-/*assignment_expression_9
- unary_expression .and ampersandequals .and assignment_expression .and .true .emit OP_ANDASSIGN;*/
-/*assignment_expression_10
- unary_expression .and caretequals .and assignment_expression .and .true .emit OP_XORASSIGN;*/
-/*assignment_expression_11
- unary_expression .and barequals .and assignment_expression .and .true .emit OP_ORASSIGN;*/
-
-/*
- <expression> ::= <assignment_expression>
- | <expression> "," <assignment_expression>
-*/
-expression
- assignment_expression .and .loop expression_1;
-expression_1
- comma .and assignment_expression .and .true .emit OP_SEQUENCE;
-
-/*
- <constant_expression> ::= <conditional_expression>
-*/
-constant_expression
- conditional_expression .and .true .emit OP_END;
-
-/*
- <declaration> ::= <function_prototype> ";"
- | <init_declarator_list> ";"
-*/
-declaration
- declaration_1 .or declaration_2;
-declaration_1
- function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;
-declaration_2
- init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;
-
-/*
- <function_prototype> ::= <function_declarator> ")"
-*/
-function_prototype
- function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;
-
-/*
- <function_declarator> ::= <function_header>
- | <function_header_with_parameters>
-*/
-function_declarator
- function_header_with_parameters .or function_header;
-
-/*
- <function_header_with_parameters> ::= <function_header> <parameter_declaration>
- | <function_header_with_parameters> ","
- <parameter_declaration>
-*/
-function_header_with_parameters
- function_header .and parameter_declaration .and .loop function_header_with_parameters_1;
-function_header_with_parameters_1
- comma .and parameter_declaration;
-
-/*
- <function_header> ::= <fully_specified_type> <identifier> "("
-*/
-function_header
- function_header_nospace .or function_header_space;
-function_header_space
- fully_specified_type_space .and space .and function_decl_identifier .and lparen;
-function_header_nospace
- fully_specified_type_nospace .and function_decl_identifier .and lparen;
-
-/*
- <function_decl_identifier> ::= "__constructor"
- | <__operator>
- | <identifier>
-
-note: this is an extension to the standard language specification - normally slang disallows
- operator and constructor prototypes and definitions
-*/
-function_decl_identifier
- .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or
- .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or
- identifier .emit FUNCTION_ORDINARY;
-
-/*
- <__operator> ::= "__operator" <overriden_op>
-
-note: this is an extension to the standard language specification - normally slang disallows
- operator prototypes and definitions
-*/
-__operator
- "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;
-
-/*
- <overriden_op> ::= "="
- | "+="
- | "-="
- | "*="
- | "/="
- | "%=" // reserved
- | "<<=" // reserved
- | ">>=" // reserved
- | "&=" // reserved
- | "^=" // reserved
- | "|=" // reserved
- | "^^"
- | "|" // reserved
- | "^" // reserved
- | "&" // reserved
- | "=="
- | "!="
- | "<"
- | ">"
- | "<="
- | ">="
- | "<<" // reserved
- | ">>" // reserved
- | "*"
- | "/"
- | "%" // reserved
- | "++"
- | "--"
- | "+"
- | "-"
- | "~" // reserved
- | "!"
-
-note: this is an extension to the standard language specification - normally slang disallows
- operator prototypes and definitions
-*/
-overriden_operator
- plusplus .emit OPERATOR_INCREMENT .or
- plusequals .emit OPERATOR_ADDASSIGN .or
- plus .emit OPERATOR_PLUS .or
- minusminus .emit OPERATOR_DECREMENT .or
- minusequals .emit OPERATOR_SUBASSIGN .or
- minus .emit OPERATOR_MINUS .or
- bangequals .emit OPERATOR_NOTEQUAL .or
- bang .emit OPERATOR_NOT .or
- starequals .emit OPERATOR_MULASSIGN .or
- star .emit OPERATOR_MULTIPLY .or
- slashequals .emit OPERATOR_DIVASSIGN .or
- slash .emit OPERATOR_DIVIDE .or
- lessequals .emit OPERATOR_LESSEQUAL .or
- /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/
- /*lessless .emit OPERATOR_LSHIFT .or*/
- less .emit OPERATOR_LESS .or
- greaterequals .emit OPERATOR_GREATEREQUAL .or
- /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/
- /*greatergreater .emit OPERATOR_RSHIFT .or*/
- greater .emit OPERATOR_GREATER .or
- equalsequals .emit OPERATOR_EQUAL .or
- equals .emit OPERATOR_ASSIGN .or
- /*percentequals .emit OPERATOR_MODASSIGN .or*/
- /*percent .emit OPERATOR_MODULUS .or*/
- /*ampersandequals .emit OPERATOR_ANDASSIGN */
- /*ampersand .emit OPERATOR_BITAND .or*/
- /*barequals .emit OPERATOR_ORASSIGN .or*/
- /*bar .emit OPERATOR_BITOR .or*/
- /*tilde .emit OPERATOR_COMPLEMENT .or*/
- /*caretequals .emit OPERATOR_XORASSIGN .or*/
- caretcaret .emit OPERATOR_LOGICALXOR /*.or
- caret .emit OPERATOR_BITXOR*/;
-
-/*
- <parameter_declarator> ::= <type_specifier> <identifier>
- | <type_specifier> <identifier> "[" <constant_expression>
- "]"
-*/
-parameter_declarator
- parameter_declarator_nospace .or parameter_declarator_space;
-parameter_declarator_nospace
- type_specifier_nospace .and identifier .and parameter_declarator_1;
-parameter_declarator_space
- type_specifier_space .and space .and identifier .and parameter_declarator_1;
-parameter_declarator_1
- parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or
- .true .emit PARAMETER_ARRAY_NOT_PRESENT;
-parameter_declarator_2
- lbracket .and constant_expression .and rbracket;
-
-/*
- <parameter_declaration> ::= <type_qualifier> <parameter_qualifier>
- <parameter_declarator>
- | <type_qualifier> <parameter_qualifier>
- <parameter_type_specifier>
- | <parameter_qualifier> <parameter_declarator>
- | <parameter_qualifier> <parameter_type_specifier>
-*/
-parameter_declaration
- parameter_declaration_1 .emit PARAMETER_NEXT;
-parameter_declaration_1
- parameter_declaration_2 .or parameter_declaration_3;
-parameter_declaration_2
- type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;
-parameter_declaration_3
- parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;
-parameter_declaration_4
- parameter_declarator .or parameter_type_specifier;
-
-/*
- <parameter_qualifier> ::= "in"
- | "out"
- | "inout"
- | ""
-*/
-parameter_qualifier
- parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;
-parameter_qualifier_1
- parameter_qualifier_2 .and space;
-parameter_qualifier_2
- "in" .emit PARAM_QUALIFIER_IN .or
- "out" .emit PARAM_QUALIFIER_OUT .or
- "inout" .emit PARAM_QUALIFIER_INOUT;
-
-/*
- <parameter_type_specifier> ::= <type_specifier>
- | <type_specifier> "[" <constant_expression> "]"
-*/
-parameter_type_specifier
- parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2;
-parameter_type_specifier_1
- type_specifier_nospace .or type_specifier_space;
-parameter_type_specifier_2
- parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or
- .true .emit PARAMETER_ARRAY_NOT_PRESENT;
-parameter_type_specifier_3
- lbracket .and constant_expression .and rbracket;
-
-/*
- <init_declarator_list> ::= <single_declaration>
- | <init_declarator_list> "," <identifier>
- | <init_declarator_list> "," <identifier> "[" "]"
- | <init_declarator_list> "," <identifier> "["
- <constant_expression> "]"
- | <init_declarator_list> "," <identifier> "="
- <initializer>
-*/
-init_declarator_list
- single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and
- .true .emit DECLARATOR_NONE;
-init_declarator_list_1
- comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;
-init_declarator_list_2
- init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;
-init_declarator_list_3
- equals .and initializer .emit VARIABLE_INITIALIZER;
-init_declarator_list_4
- lbracket .and init_declarator_list_5 .and rbracket;
-init_declarator_list_5
- constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;
-
-/*
- <single_declaration> ::= <fully_specified_type>
- | <fully_specified_type> <identifier>
- | <fully_specified_type> <identifier> "[" "]"
- | <fully_specified_type> <identifier> "["
- <constant_expression> "]"
- | <fully_specified_type> <identifier> "=" <initializer>
-*/
-single_declaration
- single_declaration_nospace .or single_declaration_space;
-single_declaration_space
- fully_specified_type_space .and single_declaration_space_1;
-single_declaration_nospace
- fully_specified_type_nospace .and single_declaration_nospace_1;
-single_declaration_space_1
- single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;
-single_declaration_nospace_1
- single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;
-single_declaration_space_2
- space .and identifier .and single_declaration_3;
-single_declaration_nospace_2
- identifier .and single_declaration_3;
-single_declaration_3
- single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;
-single_declaration_4
- equals .and initializer .emit VARIABLE_INITIALIZER;
-single_declaration_5
- lbracket .and single_declaration_6 .and rbracket;
-single_declaration_6
- constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;
-
-/*
- <fully_specified_type> ::= <type_specifier>
- | <type_qualifier> <type_specifier>
-*/
-fully_specified_type_space
- fully_specified_type_1 .and type_specifier_space;
-fully_specified_type_nospace
- fully_specified_type_1 .and type_specifier_nospace;
-fully_specified_type_1
- fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;
-fully_specified_type_2
- type_qualifier .and space;
-
-/*
- <type_qualifier> ::= "const"
- | "attribute" // Vertex only.
- | "varying"
- | "uniform"
- | "__fixed_output"
- | "__fixed_input"
-
-note: this is an extension to the standard language specification - normally slang disallows
- __fixed_output and __fixed_input type qualifiers
-*/
-type_qualifier
- "const" .emit TYPE_QUALIFIER_CONST .or
- .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or
- "varying" .emit TYPE_QUALIFIER_VARYING .or
- "uniform" .emit TYPE_QUALIFIER_UNIFORM .or
- .if (parsing_builtin != 0) "__fixed_output" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or
- .if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT;
-
-/*
- <type_specifier> ::= "void"
- | "float"
- | "int"
- | "bool"
- | "vec2"
- | "vec3"
- | "vec4"
- | "bvec2"
- | "bvec3"
- | "bvec4"
- | "ivec2"
- | "ivec3"
- | "ivec4"
- | "mat2"
- | "mat3"
- | "mat4"
- | "sampler1D"
- | "sampler2D"
- | "sampler3D"
- | "samplerCube"
- | "sampler1DShadow"
- | "sampler2DShadow"
- | <struct_specifier>
- | <type_name>
-*/
-type_specifier_space
- "void" .emit TYPE_SPECIFIER_VOID .or
- "float" .emit TYPE_SPECIFIER_FLOAT .or
- "int" .emit TYPE_SPECIFIER_INT .or
- "bool" .emit TYPE_SPECIFIER_BOOL .or
- "vec2" .emit TYPE_SPECIFIER_VEC2 .or
- "vec3" .emit TYPE_SPECIFIER_VEC3 .or
- "vec4" .emit TYPE_SPECIFIER_VEC4 .or
- "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or
- "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or
- "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or
- "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or
- "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or
- "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or
- "mat2" .emit TYPE_SPECIFIER_MAT2 .or
- "mat3" .emit TYPE_SPECIFIER_MAT3 .or
- "mat4" .emit TYPE_SPECIFIER_MAT4 .or
- "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or
- "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or
- "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or
- "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or
- "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or
- "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or
- type_name .emit TYPE_SPECIFIER_TYPENAME;
-type_specifier_nospace
- struct_specifier .emit TYPE_SPECIFIER_STRUCT;
-
-/*
- <struct_specifier> ::= "struct" <identifier> "{" <struct_declaration_list> "}"
- | "struct" "{" <struct_declaration_list> "}"
-*/
-struct_specifier
- "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and
- struct_declaration_list .and rbrace .emit FIELD_NONE;
-struct_specifier_1
- struct_specifier_2 .or .true .emit '\0';
-struct_specifier_2
- space .and identifier;
-
-/*
- <struct_declaration_list> ::= <struct_declaration>
- | <struct_declaration_list> <struct_declaration>
-*/
-struct_declaration_list
- struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;
-
-/*
- <struct_declaration> ::= <type_specifier> <struct_declarator_list> ";"
-*/
-struct_declaration
- struct_declaration_nospace .or struct_declaration_space;
-struct_declaration_space
- type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;
-struct_declaration_nospace
- type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;
-
-/*
- <struct_declarator_list> ::= <struct_declarator>
- | <struct_declarator_list> "," <struct_declarator>
-*/
-struct_declarator_list
- struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;
-struct_declarator_list_1
- comma .and struct_declarator;
-
-/*
- <struct_declarator> ::= <identifier>
- | <identifier> "[" <constant_expression> "]"
-*/
-struct_declarator
- identifier .and struct_declarator_1;
-struct_declarator_1
- struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;
-struct_declarator_2
- lbracket .and constant_expression .and rbracket;
-
-/*
- <initializer> ::= <assignment_expression>
-*/
-initializer
- assignment_expression .and .true .emit OP_END;
-
-/*
- <declaration_statement> ::= <declaration>
-*/
-declaration_statement
- declaration;
-
-/*
- <statement> ::= <compound_statement>
- | <simple_statement>
-*/
-statement
- compound_statement .or simple_statement;
-statement_space
- compound_statement .or statement_space_1;
-statement_space_1
- space .and simple_statement;
-
-/*
- <simple_statement> ::= <__asm_statement>
- | <selection_statement>
- | <iteration_statement>
- | <jump_statement>
- | <expression_statement>
- | <declaration_statement>
-
-note: this is an extension to the standard language specification - normally slang disallows
- use of __asm statements
-*/
-simple_statement
- .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or
- selection_statement .or
- iteration_statement .or
- jump_statement .or
- expression_statement .emit OP_EXPRESSION .or
- declaration_statement .emit OP_DECLARE;
-
-/*
- <compound_statement> ::= "{" "}"
- | "{" <statement_list> "}"
-*/
-compound_statement
- compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;
-compound_statement_1
- compound_statement_2 .or compound_statement_3;
-compound_statement_2
- lbrace .and rbrace;
-compound_statement_3
- lbrace .and statement_list .and rbrace;
-
-/*
- <statement_no_new_scope> ::= <compound_statement_no_new_scope>
- | <simple_statement>
-*/
-statement_no_new_scope
- compound_statement_no_new_scope .or simple_statement;
-
-/*
- <compound_statement_no_new_scope> ::= "{" "}"
- | "{" <statement_list> "}"
-*/
-compound_statement_no_new_scope
- compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;
-compound_statement_no_new_scope_1
- compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;
-compound_statement_no_new_scope_2
- lbrace .and rbrace;
-compound_statement_no_new_scope_3
- lbrace .and statement_list .and rbrace;
-
-/*
- <statement_list> ::= <statement>
- | <statement_list> <statement>
-*/
-statement_list
- statement .and .loop statement;
-
-/*
- <expression_statement> ::= ";"
- | <expression> ";"
-*/
-expression_statement
- expression_statement_1 .or expression_statement_2;
-expression_statement_1
- semicolon .emit OP_PUSH_VOID .emit OP_END;
-expression_statement_2
- expression .and semicolon .emit OP_END;
-
-/*
- <selection_statement> ::= "if" "(" <expression> ")" <selection_rest_statement>
-*/
-selection_statement
- "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and
- rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;
-
-/*
- <selection_rest_statement> ::= <statement> "else" <statement>
- | <statement>
-*/
-selection_rest_statement
- statement .and selection_rest_statement_1;
-selection_rest_statement_1
- selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;
-selection_rest_statement_2
- "else" .and optional_space .and statement;
-
-/*
- <condition> ::= <expression>
- | <fully_specified_type> <identifier> "=" <initializer>
-
-note: if <condition_1> is executed, the emit format must match <declaration> emit format
-*/
-condition
- condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or
- condition_3 .emit OP_EXPRESSION;
-condition_1
- condition_1_nospace .or condition_1_space;
-condition_1_nospace
- fully_specified_type_nospace .and condition_2;
-condition_1_space
- fully_specified_type_space .and space .and condition_2;
-condition_2
- identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and
- initializer .and .true .emit DECLARATOR_NONE;
-condition_3
- expression .and .true .emit OP_END;
-
-/*
- <iteration_statement> ::= "while" "(" <condition> ")" <statement_no_new_scope>
- | "do" <statement> "while" "(" <expression> ")" ";"
- | "for" "(" <for_init_statement> <for_rest_statement> ")"
- <statement_no_new_scope>
-*/
-iteration_statement
- iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;
-iteration_statement_1
- "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and
- rparen .error RPAREN_EXPECTED .and statement_no_new_scope;
-iteration_statement_2
- "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and
- expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;
-iteration_statement_3
- "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and
- for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;
-
-/*
- <for_init_statement> ::= <expression_statement>
- | <declaration_statement>
-*/
-for_init_statement
- expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;
-
-/*
- <conditionopt> ::= <condition>
- | ""
-
-note: <conditionopt> is used only by "for" statement - if <condition> is ommitted, parser
- simulates default behaviour, that is simulates "true" expression
-*/
-conditionopt
- condition .or
- .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END;
-
-/*
- <for_rest_statement> ::= <conditionopt> ";"
- | <conditionopt> ";" <expression>
-*/
-for_rest_statement
- conditionopt .and semicolon .and for_rest_statement_1;
-for_rest_statement_1
- for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;
-for_rest_statement_2
- expression .and .true .emit OP_END;
-
-/*
- <jump_statement> ::= "continue" ";"
- | "break" ";"
- | "return" ";"
- | "return" <expression> ";"
- | "discard" ";" // Fragment shader only.
-*/
-jump_statement
- jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or
- .if (shader_type == 1) jump_statement_5;
-jump_statement_1
- "continue" .and semicolon .emit OP_CONTINUE;
-jump_statement_2
- "break" .and semicolon .emit OP_BREAK;
-jump_statement_3
- "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;
-jump_statement_4
- "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;
-jump_statement_5
- "discard" .and semicolon .emit OP_DISCARD;
-
-/*
- <__asm_statement> ::= "__asm" <identifier> <asm_arguments> ";"
-
-note: this is an extension to the standard language specification - normally slang disallows
- __asm statements
-*/
-__asm_statement
- "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;
-
-/*
- <asm_arguments> ::= <identifier>
- | <asm_arguments> "," <identifier>
-
-note: this is an extension to the standard language specification - normally slang disallows
- __asm statements
-*/
-asm_arguments
- variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;
-asm_arguments_1
- comma .and variable_identifier .and .true .emit OP_END;
-
-/*
- <translation_unit> ::= <external_declaration>
- | <translation_unit> <external_declaration>
-*/
-translation_unit
- optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and
- .loop external_declaration .and optional_space .and
- '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;
-
-/*
- <external_declaration> ::= <function_definition>
- | <declaration>
-*/
-external_declaration
- function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or
- declaration .emit EXTERNAL_DECLARATION;
-
-/*
- <function_definition> :: <function_prototype> <compound_statement_no_new_scope>
-*/
-function_definition
- function_prototype .and compound_statement_no_new_scope;
-
-/* helper rulez, not part of the official language syntax */
-
-digit_oct
- '0'-'7';
-
-digit_dec
- '0'-'9';
-
-digit_hex
- '0'-'9' .or 'A'-'F' .or 'a'-'f';
-
-id_character_first
- 'a'-'z' .or 'A'-'Z' .or '_';
-
-id_character_next
- id_character_first .or digit_dec;
-
-identifier
- id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0';
-
-float
- float_1 .or float_2;
-float_1
- float_fractional_constant .and float_optional_exponent_part;
-float_2
- float_digit_sequence .and .true .emit '\0' .and float_exponent_part;
-
-float_fractional_constant
- float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;
-float_fractional_constant_1
- float_digit_sequence .and '.' .and float_digit_sequence;
-float_fractional_constant_2
- float_digit_sequence .and '.' .and .true .emit '\0';
-float_fractional_constant_3
- '.' .emit '\0' .and float_digit_sequence;
-
-float_optional_exponent_part
- float_exponent_part .or .true .emit '\0';
-
-float_digit_sequence
- digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0';
-
-float_exponent_part
- float_exponent_part_1 .or float_exponent_part_2;
-float_exponent_part_1
- 'e' .and float_optional_sign .and float_digit_sequence;
-float_exponent_part_2
- 'E' .and float_optional_sign .and float_digit_sequence;
-
-float_optional_sign
- float_sign .or .true;
-
-float_sign
- '+' .or '-' .emit '-';
-
-integer
- integer_hex .or integer_oct .or integer_dec;
-
-integer_hex
- '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and
- .true .emit '\0';
-integer_hex_1
- 'x' .or 'X';
-
-integer_oct
- '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\0';
-
-integer_dec
- digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0';
-
-boolean
- "true" .emit 2 .emit '1' .emit '\0' .or
- "false" .emit 2 .emit '0' .emit '\0';
-
-type_name
- identifier;
-
-field_selection
- identifier;
-
-floatconstant
- float .emit OP_PUSH_FLOAT;
-
-intconstant
- integer .emit OP_PUSH_INT;
-
-boolconstant
- boolean .emit OP_PUSH_BOOL;
-
-optional_space
- .loop single_space;
-
-space
- single_space .and .loop single_space;
-
-single_space
- white_char .or c_style_comment_block .or cpp_style_comment_block;
-
-white_char
- ' ' .or '\t' .or new_line .or '\v' .or '\f';
-
-new_line
- cr_lf .or lf_cr .or '\n' .or '\r';
-
-cr_lf
- '\r' .and '\n';
-
-lf_cr
- '\n' .and '\r';
-
-c_style_comment_block
- '/' .and '*' .and c_style_comment_rest;
-
-c_style_comment_rest
- .loop c_style_comment_char_no_star .and c_style_comment_rest_1;
-c_style_comment_rest_1
- c_style_comment_end .or c_style_comment_rest_2;
-c_style_comment_rest_2
- '*' .and c_style_comment_rest;
-
-c_style_comment_char_no_star
- '\x2B'-'\xFF' .or '\x01'-'\x29';
-
-c_style_comment_end
- '*' .and '/';
-
-cpp_style_comment_block
- '/' .and '/' .and cpp_style_comment_block_1;
-cpp_style_comment_block_1
- cpp_style_comment_block_2 .or cpp_style_comment_block_3;
-cpp_style_comment_block_2
- .loop cpp_style_comment_char .and new_line;
-cpp_style_comment_block_3
- .loop cpp_style_comment_char;
-
-cpp_style_comment_char
- '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
-
-/* lexical rulez */
-
-/*ampersand
- optional_space .and '&' .and optional_space;*/
-
-ampersandampersand
- optional_space .and '&' .and '&' .and optional_space;
-
-/*ampersandequals
- optional_space .and '&' .and '=' .and optional_space;*/
-
-/*bar
- optional_space .and '|' .and optional_space;*/
-
-barbar
- optional_space .and '|' .and '|' .and optional_space;
-
-/*barequals
- optional_space .and '|' .and '=' .and optional_space;*/
-
-bang
- optional_space .and '!' .and optional_space;
-
-bangequals
- optional_space .and '!' .and '=' .and optional_space;
-
-/*caret
- optional_space .and '^' .and optional_space;*/
-
-caretcaret
- optional_space .and '^' .and '^' .and optional_space;
-
-/*caretequals
- optional_space .and '^' .and '=' .and optional_space;*/
-
-colon
- optional_space .and ':' .and optional_space;
-
-comma
- optional_space .and ',' .and optional_space;
-
-dot
- optional_space .and '.' .and optional_space;
-
-equals
- optional_space .and '=' .and optional_space;
-
-equalsequals
- optional_space .and '=' .and '=' .and optional_space;
-
-greater
- optional_space .and '>' .and optional_space;
-
-greaterequals
- optional_space .and '>' .and '=' .and optional_space;
-
-/*greatergreater
- optional_space .and '>' .and '>' .and optional_space;*/
-
-/*greatergreaterequals
- optional_space .and '>' .and '>' .and '=' .and optional_space;*/
-
-lbrace
- optional_space .and '{' .and optional_space;
-
-lbracket
- optional_space .and '[' .and optional_space;
-
-less
- optional_space .and '<' .and optional_space;
-
-lessequals
- optional_space .and '<' .and '=' .and optional_space;
-
-/*lessless
- optional_space .and '<' .and '<' .and optional_space;*/
-
-/*lesslessequals
- optional_space .and '<' .and '<' .and '=' .and optional_space;*/
-
-lparen
- optional_space .and '(' .and optional_space;
-
-minus
- optional_space .and '-' .and optional_space;
-
-minusequals
- optional_space .and '-' .and '=' .and optional_space;
-
-minusminus
- optional_space .and '-' .and '-' .and optional_space;
-
-/*percent
- optional_space .and '%' .and optional_space;*/
-
-/*percentequals
- optional_space .and '%' .and '=' .and optional_space;*/
-
-plus
- optional_space .and '+' .and optional_space;
-
-plusequals
- optional_space .and '+' .and '=' .and optional_space;
-
-plusplus
- optional_space .and '+' .and '+' .and optional_space;
-
-question
- optional_space .and '?' .and optional_space;
-
-rbrace
- optional_space .and '}' .and optional_space;
-
-rbracket
- optional_space .and ']' .and optional_space;
-
-rparen
- optional_space .and ')' .and optional_space;
-
-semicolon
- optional_space .and ';' .and optional_space;
-
-slash
- optional_space .and '/' .and optional_space;
-
-slashequals
- optional_space .and '/' .and '=' .and optional_space;
-
-star
- optional_space .and '*' .and optional_space;
-
-starequals
- optional_space .and '*' .and '=' .and optional_space;
-
-/*tilde
- optional_space .and '~' .and optional_space;*/
-
-/* string rulez - these are used internally by the parser when parsing quoted strings */
-
-.string string_lexer;
-
-string_lexer
- lex_first_identifier_character .and .loop lex_next_identifier_character;
-
-lex_first_identifier_character
- 'a'-'z' .or 'A'-'Z' .or '_';
-
-lex_next_identifier_character
- 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';
-
-/* error rulez - these are used by error messages */
-
-err_token
- '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or
- '-' .or '+' .or '=' .or '|' .or '\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '"' .or
- '\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;
-
-err_identifier
- id_character_first .and .loop id_character_next;
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_version.syn b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_version.syn
deleted file mode 100755
index 3a8c7046b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_version.syn
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file slang_version.syn
- * slang #version directive syntax
- * \author Michal Krol
- */
-
-.syntax version_directive;
-
-version_directive
- version_directive_1 .and .loop version_directive_2;
-version_directive_1
- prior_optional_spaces .and optional_version_directive .and .true .emit $;
-version_directive_2
- prior_optional_spaces .and version_directive_body .and .true .emit $;
-
-optional_version_directive
- version_directive_body .or .true .emit 10 .emit 1;
-
-version_directive_body
- '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and
- new_line;
-
-version_number
- version_number_110;
-
-version_number_110
- leading_zeroes .and "110" .emit 10 .emit 1;
-
-leading_zeroes
- .loop zero;
-
-zero
- '0';
-
-space
- single_space .and .loop single_space;
-
-optional_space
- .loop single_space;
-
-single_space
- ' ' .or '\t';
-
-prior_optional_spaces
- .loop prior_space;
-
-prior_space
- c_style_comment_block .or cpp_style_comment_block .or space .or new_line;
-
-c_style_comment_block
- '/' .and '*' .and c_style_comment_rest;
-
-c_style_comment_rest
- .loop c_style_comment_char_no_star .and c_style_comment_rest_1;
-c_style_comment_rest_1
- c_style_comment_end .or c_style_comment_rest_2;
-c_style_comment_rest_2
- '*' .and c_style_comment_rest;
-
-c_style_comment_char_no_star
- '\x2B'-'\xFF' .or '\x01'-'\x29';
-
-c_style_comment_end
- '*' .and '/';
-
-cpp_style_comment_block
- '/' .and '/' .and cpp_style_comment_block_1;
-cpp_style_comment_block_1
- cpp_style_comment_block_2 .or cpp_style_comment_block_3;
-cpp_style_comment_block_2
- .loop cpp_style_comment_char .and new_line;
-cpp_style_comment_block_3
- .loop cpp_style_comment_char;
-
-cpp_style_comment_char
- '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
-
-new_line
- cr_lf .or lf_cr .or '\n' .or '\r';
-
-cr_lf
- '\r' .and '\n';
-
-lf_cr
- '\n' .and '\r';
-
-.string __string_filter;
-
-__string_filter
- .loop __identifier_char;
-
-__identifier_char
- 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_vertex_builtin.gc b/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_vertex_builtin.gc
deleted file mode 100755
index 850fd2bb8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_vertex_builtin.gc
+++ /dev/null
@@ -1,262 +0,0 @@
-
-//
-// TODO:
-// - what to do with ftransform? can it stay in the current form?
-// - implement texture1DLod, texture2DLod, texture3DLod, textureCubeLod,
-// - implement shadow1DLod, shadow2DLod,
-//
-
-//
-// From Shader Spec, ver. 1.10, rev. 59
-//
-// Some OpenGL operations still continue to occur in fixed functionality in between the vertex
-// processor and the fragment processor. Other OpenGL operations continue to occur in fixed
-// functionality after the fragment processor. Shaders communicate with the fixed functionality
-// of OpenGL through the use of built-in variables.
-//
-// The variable gl_Position is available only in the vertex language and is intended for writing
-// the homogeneous vertex position. All executions of a well-formed vertex shader must write
-// a value into this variable. It can be written at any time during shader execution. It may also
-// be read back by the shader after being written. This value will be used by primitive assembly,
-// clipping, culling, and other fixed functionality operations that operate on primitives after
-// vertex processing has occurred. Compilers may generate a diagnostic message if they detect
-// gl_Position is not written, or read before being written, but not all such cases are detectable.
-// Results are undefined if a vertex shader is executed and does not write gl_Position.
-//
-// The variable gl_PointSize is available only in the vertex language and is intended for a vertex
-// shader to write the size of the point to be rasterized. It is measured in pixels.
-//
-// The variable gl_ClipVertex is available only in the vertex language and provides a place for
-// vertex shaders to write the coordinate to be used with the user clipping planes. The user must
-// ensure the clip vertex and user clipping planes are defined in the same coordinate space. User
-// clip planes work properly only under linear transform. It is undefined what happens under
-// non-linear transform.
-//
-// These built-in vertex shader variables for communicating with fixed functionality are
-// intrinsically declared with the following types:
-//
-
-__fixed_output vec4 gl_Position; // must be written to
-__fixed_output float gl_PointSize; // may be written to
-__fixed_output vec4 gl_ClipVertex; // may be written to
-
-//
-// If gl_PointSize or gl_ClipVertex are not written to, their values are undefined. Any of these
-// variables can be read back by the shader after writing to them, to retrieve what was written.
-// Reading them before writing them results in undefined behavior. If they are written more than
-// once, it is the last value written that is consumed by the subsequent operations.
-//
-// These built-in variables have global scope.
-//
-
-//
-// The following attribute names are built into the OpenGL vertex language and can be used from
-// within a vertex shader to access the current values of attributes declared by OpenGL. All page
-// numbers and notations are references to the OpenGL 1.4 specification.
-//
-
-//
-// Vertex Attributes, p. 19.
-//
-
-attribute vec4 gl_Color;
-attribute vec4 gl_SecondaryColor;
-attribute vec3 gl_Normal;
-attribute vec4 gl_Vertex;
-attribute vec4 gl_MultiTexCoord0;
-attribute vec4 gl_MultiTexCoord1;
-attribute vec4 gl_MultiTexCoord2;
-attribute vec4 gl_MultiTexCoord3;
-attribute vec4 gl_MultiTexCoord4;
-attribute vec4 gl_MultiTexCoord5;
-attribute vec4 gl_MultiTexCoord6;
-attribute vec4 gl_MultiTexCoord7;
-attribute float gl_FogCoord;
-
-//
-// Unlike user-defined varying variables, the built-in varying variables don't have a strict
-// one-to-one correspondence between the vertex language and the fragment language. Two sets are
-// provided, one for each language. Their relationship is described below.
-//
-// The following built-in varying variables are available to write to in a vertex shader.
-// A particular one should be written to if any functionality in a corresponding fragment shader
-// or fixed pipeline uses it or state derived from it. Otherwise, behavior is undefined.
-//
-
-varying vec4 gl_FrontColor;
-varying vec4 gl_BackColor;
-varying vec4 gl_FrontSecondaryColor;
-varying vec4 gl_BackSecondaryColor;
-varying vec4 gl_TexCoord[]; // at most will be gl_MaxTextureCoords
-varying float gl_FogFragCoord;
-
-//
-// For gl_FogFragCoord, the value written will be used as the "c" value on page 160 of the
-// OpenGL 1.4 Specification by the fixed functionality pipeline. For example, if the z-coordinate
-// of the fragment in eye space is desired as "c", then that's what the vertex shader should write
-// into gl_FogFragCoord.
-//
-// As with all arrays, indices used to subscript gl_TexCoord must either be an integral constant
-// expressions, or this array must be re-declared by the shader with a size. The size can be
-// at most gl_MaxTextureCoords. Using indexes close to 0 may aid the implementation
-// in preserving varying resources.
-//
-
-//
-// The OpenGL Shading Language defines an assortment of built-in convenience functions for scalar
-// and vector operations. Many of these built-in functions can be used in more than one type
-// of shader, but some are intended to provide a direct mapping to hardware and so are available
-// only for a specific type of shader.
-//
-// The built-in functions basically fall into three categories:
-//
-// * They expose some necessary hardware functionality in a convenient way such as accessing
-// a texture map. There is no way in the language for these functions to be emulated by a shader.
-//
-// * They represent a trivial operation (clamp, mix, etc.) that is very simple for the user
-// to write, but they are very common and may have direct hardware support. It is a very hard
-// problem for the compiler to map expressions to complex assembler instructions.
-//
-// * They represent an operation graphics hardware is likely to accelerate at some point. The
-// trigonometry functions fall into this category.
-//
-// Many of the functions are similar to the same named ones in common C libraries, but they support
-// vector input as well as the more traditional scalar input.
-//
-// Applications should be encouraged to use the built-in functions rather than do the equivalent
-// computations in their own shader code since the built-in functions are assumed to be optimal
-// (e.g., perhaps supported directly in hardware).
-//
-// User code can replace built-in functions with their own if they choose, by simply re-declaring
-// and defining the same name and argument list.
-//
-
-//
-// Geometric Functions
-//
-// These operate on vectors as vectors, not component-wise.
-//
-
-//
-// For vertex shaders only. This function will ensure that the incoming vertex value will be
-// transformed in a way that produces exactly the same result as would be produced by OpenGL's
-// fixed functionality transform. It is intended to be used to compute gl_Position, e.g.,
-// gl_Position = ftransform()
-// This function should be used, for example, when an application is rendering the same geometry in
-// separate passes, and one pass uses the fixed functionality path to render and another pass uses
-// programmable shaders.
-//
-
-vec4 ftransform () {
- return gl_ModelViewProjectionMatrix * gl_Vertex;
-}
-
-//
-// 8.7 Texture Lookup Functions
-//
-// Texture lookup functions are available to both vertex and fragment shaders. However, level
-// of detail is not computed by fixed functionality for vertex shaders, so there are some
-// differences in operation between vertex and fragment texture lookups. The functions in the table
-// below provide access to textures through samplers, as set up through the OpenGL API. Texture
-// properties such as size, pixel format, number of dimensions, filtering method, number of mip-map
-// levels, depth comparison, and so on are also defined by OpenGL API calls. Such properties are
-// taken into account as the texture is accessed via the built-in functions defined below.
-//
-// If a non-shadow texture call is made to a sampler that represents a depth texture with depth
-// comparisons turned on, then results are undefined. If a shadow texture call is made to a sampler
-// that represents a depth texture with depth comparisions turned off, the results are undefined.
-// If a shadow texture call is made to a sampler that does not represent a depth texture, then
-// results are undefined.
-//
-// In all functions below, the bias parameter is optional for fragment shaders. The bias parameter
-// is not accepted in a vertex shader. For a fragment shader, if bias is present, it is added to
-// the calculated level of detail prior to performing the texture access operation. If the bias
-// parameter is not provided, then the implementation automatically selects level of detail:
-// For a texture that is not mip-mapped, the texture is used directly. If it is mip-mapped and
-// running in a fragment shader, the LOD computed by the implementation is used to do the texture
-// lookup. If it is mip-mapped and running on the vertex shader, then the base texture is used.
-//
-// The built-ins suffixed with "Lod" are allowed only in a vertex shader. For the "Lod" functions,
-// lod is directly used as the level of detail.
-//
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 1D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate coord.s is divided by
-// the last component of coord.
-//
-// XXX
-vec4 texture1DLod (sampler1D sampler, float coord, float lod) {
- return vec4 (0.0);
-}
-vec4 texture1DProjLod (sampler1D sampler, vec2 coord, float lod) {
- return texture1DLod (sampler, coord.s / coord.t, lod);
-}
-vec4 texture1DProjLod (sampler1D sampler, vec4 coord, float lod) {
- return texture1DLod (sampler, coord.s / coord.q, lod);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate (coord.s, coord.t) is
-// divided by the last component of coord. The third component of coord is ignored for the vec4
-// coord variant.
-//
-// XXX
-vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod) {
- return vec4 (0.0);
-}
-vec4 texture2DProjLod (sampler2D sampler, vec3 coord, float lod) {
- return texture2DLod (sampler, vec2 (coord.s / coord.p, coord.t / coord.p), lod);
-}
-vec4 texture2DProjLod (sampler2D sampler, vec4 coord, float lod) {
- return texture2DLod (sampler, vec2 (coord.s / coord.q, coord.t / coord.q), lod);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate is divided by coord.q.
-//
-// XXX
-vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod) {
- return vec4 (0.0);
-}
-vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod) {
- return texture3DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.s / coord.q),
- lod);
-}
-
-//
-// Use the texture coordinate coord to do a texture lookup in the cube map texture currently bound
-// to sampler. The direction of coord is used to select which face to do a 2-dimensional texture
-// lookup in, as described in section 3.8.6 in version 1.4 of the OpenGL specification.
-//
-// XXX
-vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod) {
- return vec4 (0.0);
-}
-
-//
-// Use texture coordinate coord to do a depth comparison lookup on the depth texture bound
-// to sampler, as described in section 3.8.14 of version 1.4 of the OpenGL specification. The 3rd
-// component of coord (coord.p) is used as the R value. The texture bound to sampler must be a
-// depth texture, or results are undefined. For the projective ("Proj") version of each built-in,
-// the texture coordinate is divide by coord.q, giving a depth value R of coord.p/coord.q. The
-// second component of coord is ignored for the "1D" variants.
-//
-// XXX
-vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod) {
- return vec4 (0.0);
-}
-// XXX
-vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod) {
- return vec4 (0.0);
-}
-vec4 shadow1DProjLod (sampler1DShadow sampler, vec4 coord, float lod) {
- return shadow1DLod (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), lod);
-}
-vec4 shadow2DProjLod (sampler2DShadow sampler, vec4 coord, float lod) {
- return shadow2DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q),
- lod);
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.cpp b/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.cpp
deleted file mode 100755
index 3f437ee7d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "slang_mesa.h"
-#include "Initialisation.h"
-#include "Include/Common.h"
-#include "Include/ShHandle.h"
-#include "Public/ShaderLang.h"
-
-
-class TGenericCompiler: public TCompiler
-{
-public:
- TGenericCompiler (EShLanguage l, int dOptions): TCompiler(l, infoSink), debugOptions(dOptions)
- {
- }
-public:
- virtual bool compile (TIntermNode *root)
- {
- haveValidObjectCode = true;
- return haveValidObjectCode;
- }
- TInfoSink infoSink;
- int debugOptions;
-};
-
-TCompiler *ConstructCompiler (EShLanguage language, int debugOptions)
-{
- return new TGenericCompiler (language, debugOptions);
-}
-
-void DeleteCompiler (TCompiler *compiler)
-{
- delete compiler;
-}
-
-class TGenericLinker: public TLinker
-{
-public:
- TGenericLinker (EShExecutable e, int dOptions): TLinker(e, infoSink), debugOptions(dOptions)
- {
- }
-public:
- bool link (TCompilerList &, TUniformMap *)
- {
- return true;
- }
- void getAttributeBindings (ShBindingTable const **t) const
- {
- }
- TInfoSink infoSink;
- int debugOptions;
-};
-
-TShHandleBase *ConstructLinker (EShExecutable executable, int debugOptions)
-{
- return new TGenericLinker (executable, debugOptions);
-}
-
-void DeleteLinker (TShHandleBase *linker)
-{
- delete linker;
-}
-
-class TUniformLinkedMap: public TUniformMap
-{
-public:
- TUniformLinkedMap()
- {
- }
-public:
- virtual int getLocation (const char *name)
- {
- return 0;
- }
-};
-
-TUniformMap *ConstructUniformMap ()
-{
- return new TUniformLinkedMap;
-}
-
-void DeleteUniformMap (TUniformMap *map)
-{
- delete map;
-}
-
-
-namespace std
-{
-
-void _Xran ()
-{
- /* XXX fix this under Linux */
- /*_THROW(out_of_range, "invalid string position");*/
-}
-
-void _Xlen ()
-{
- /* XXX fix this under Linux */
- /*_THROW(length_error, "string too long");*/
-}
-
-}
-
-
-/* these functions link with extern "C" */
-
-int _mesa_isalnum (char c)
-{
- return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9');
-}
-
-int _glslang_3dlabs_InitProcess ()
-{
- return InitProcess () ? 1 : 0;
-}
-
-int _glslang_3dlabs_ShInitialize ()
-{
- return ShInitialize () ? 1 : 0;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.h
deleted file mode 100755
index 41f79aa70..000000000
--- a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_mesa.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#if defined __cplusplus
-extern "C" {
-#endif
-
-int _mesa_isalnum (char);
-int _glslang_3dlabs_InitProcess ();
-int _glslang_3dlabs_ShInitialize ();
-
-#if defined __cplusplus
-}
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/sources b/nx-X11/extras/Mesa/src/mesa/sources
deleted file mode 100644
index 48c3ab543..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sources
+++ /dev/null
@@ -1,335 +0,0 @@
-### Lists of source files, included by Makefiles
-
-MAIN_SOURCES = \
- main/api_arrayelt.c \
- main/api_loopback.c \
- main/api_noop.c \
- main/api_validate.c \
- main/accum.c \
- main/attrib.c \
- main/blend.c \
- main/bufferobj.c \
- main/buffers.c \
- main/clip.c \
- main/colortab.c \
- main/context.c \
- main/convolve.c \
- main/debug.c \
- main/depth.c \
- main/dispatch.c \
- main/dlist.c \
- main/drawpix.c \
- main/enable.c \
- main/enums.c \
- main/eval.c \
- main/execmem.c \
- main/extensions.c \
- main/fbobject.c \
- main/feedback.c \
- main/fog.c \
- main/framebuffer.c \
- main/get.c \
- main/getstring.c \
- main/hash.c \
- main/hint.c \
- main/histogram.c \
- main/image.c \
- main/imports.c \
- main/light.c \
- main/lines.c \
- main/matrix.c \
- main/mm.c \
- main/occlude.c \
- main/pixel.c \
- main/points.c \
- main/polygon.c \
- main/rastpos.c \
- main/renderbuffer.c \
- main/state.c \
- main/stencil.c \
- main/texcompress.c \
- main/texcompress_s3tc.c \
- main/texcompress_fxt1.c \
- main/texenvprogram.c \
- main/texformat.c \
- main/teximage.c \
- main/texrender.c \
- main/texobj.c \
- main/texstate.c \
- main/texstore.c \
- main/varray.c \
- main/vtxfmt.c
-
-GLAPI_SOURCES = \
- glapi/glapi.c \
- glapi/glthread.c
-
-MATH_SOURCES = \
- math/m_debug_clip.c \
- math/m_debug_norm.c \
- math/m_debug_xform.c \
- math/m_eval.c \
- math/m_matrix.c \
- math/m_translate.c \
- math/m_vector.c \
- math/m_xform.c
-
-ARRAY_CACHE_SOURCES = \
- array_cache/ac_context.c \
- array_cache/ac_import.c
-
-SWRAST_SOURCES = \
- swrast/s_fragprog_to_c.c \
- swrast/s_aaline.c \
- swrast/s_aatriangle.c \
- swrast/s_accum.c \
- swrast/s_alpha.c \
- swrast/s_atifragshader.c \
- swrast/s_bitmap.c \
- swrast/s_blend.c \
- swrast/s_buffers.c \
- swrast/s_copypix.c \
- swrast/s_context.c \
- swrast/s_depth.c \
- swrast/s_drawpix.c \
- swrast/s_feedback.c \
- swrast/s_fog.c \
- swrast/s_imaging.c \
- swrast/s_lines.c \
- swrast/s_logic.c \
- swrast/s_masking.c \
- swrast/s_nvfragprog.c \
- swrast/s_pixeltex.c \
- swrast/s_points.c \
- swrast/s_readpix.c \
- swrast/s_span.c \
- swrast/s_stencil.c \
- swrast/s_tcc.c \
- swrast/s_texture.c \
- swrast/s_texstore.c \
- swrast/s_triangle.c \
- swrast/s_zoom.c
-
-SWRAST_SETUP_SOURCES = \
- swrast_setup/ss_context.c \
- swrast_setup/ss_triangle.c
-
-TNL_SOURCES = \
- tnl/t_array_api.c \
- tnl/t_array_import.c \
- tnl/t_context.c \
- tnl/t_pipeline.c \
- tnl/t_save_api.c \
- tnl/t_save_loopback.c \
- tnl/t_save_playback.c \
- tnl/t_vb_arbprogram.c \
- tnl/t_vb_arbprogram_sse.c \
- tnl/t_vb_program.c \
- tnl/t_vb_render.c \
- tnl/t_vb_texgen.c \
- tnl/t_vb_texmat.c \
- tnl/t_vb_vertex.c \
- tnl/t_vb_cull.c \
- tnl/t_vb_fog.c \
- tnl/t_vb_light.c \
- tnl/t_vb_normals.c \
- tnl/t_vb_points.c \
- tnl/t_vp_build.c \
- tnl/t_vertex.c \
- tnl/t_vertex_sse.c \
- tnl/t_vertex_generic.c \
- tnl/t_vtx_api.c \
- tnl/t_vtx_generic.c \
- tnl/t_vtx_x86.c \
- tnl/t_vtx_eval.c \
- tnl/t_vtx_exec.c
-
-
-
-SHADER_SOURCES = \
- shader/arbfragparse.c \
- shader/arbprogparse.c \
- shader/arbprogram.c \
- shader/arbvertparse.c \
- shader/atifragshader.c \
- shader/grammar/grammar_mesa.c \
- shader/nvfragparse.c \
- shader/nvprogram.c \
- shader/nvvertexec.c \
- shader/nvvertparse.c \
- shader/program.c \
- shader/shaderobjects.c \
- shader/shaderobjects_3dlabs.c
-
-SLANG_C_SOURCES = \
- shader/slang/MachineIndependent/preprocessor/atom.c \
- shader/slang/MachineIndependent/preprocessor/cpp.c \
- shader/slang/MachineIndependent/preprocessor/cppstruct.c \
- shader/slang/MachineIndependent/preprocessor/memory.c \
- shader/slang/MachineIndependent/preprocessor/scanner.c \
- shader/slang/MachineIndependent/preprocessor/symbols.c \
- shader/slang/MachineIndependent/preprocessor/tokens.c
-
-SLANG_CPP_SOURCES = \
- shader/slang/slang_mesa.cpp \
- shader/slang/MachineIndependent/Gen_glslang.cpp \
- shader/slang/MachineIndependent/Gen_glslang_tab.cpp \
- shader/slang/MachineIndependent/InfoSink.cpp \
- shader/slang/MachineIndependent/Initialize.cpp \
- shader/slang/MachineIndependent/Intermediate.cpp \
- shader/slang/MachineIndependent/intermOut.cpp \
- shader/slang/MachineIndependent/IntermTraverse.cpp \
- shader/slang/MachineIndependent/parseConst.cpp \
- shader/slang/MachineIndependent/ParseHelper.cpp \
- shader/slang/MachineIndependent/PoolAlloc.cpp \
- shader/slang/MachineIndependent/QualifierAlive.cpp \
- shader/slang/MachineIndependent/RemoveTree.cpp \
- shader/slang/MachineIndependent/ShaderLang.cpp \
- shader/slang/MachineIndependent/SymbolTable.cpp \
- shader/slang/OGLCompilersDLL/Initialisation.cpp \
- shader/slang/OSDependent/Linux/ossource.cpp
-
-SLANG_SOURCES = \
- shader/slang/slang_assemble.c \
- shader/slang/slang_assemble_assignment.c \
- shader/slang/slang_assemble_conditional.c \
- shader/slang/slang_assemble_constructor.c \
- shader/slang/slang_assemble_typeinfo.c \
- shader/slang/slang_compile.c \
- shader/slang/slang_execute.c \
- shader/slang/slang_preprocess.c \
- shader/slang/slang_storage.c \
- shader/slang/slang_utility.c
-
-ASM_C_SOURCES = \
- x86/common_x86.c \
- x86/x86.c \
- x86/3dnow.c \
- x86/sse.c \
- x86/rtasm/x86sse.c \
- sparc/sparc.c \
- ppc/common_ppc.c \
- x86-64/x86-64.c
-
-X86_SOURCES = \
- x86/common_x86_asm.S \
- x86/x86_xform2.S \
- x86/x86_xform3.S \
- x86/x86_xform4.S \
- x86/x86_cliptest.S \
- x86/mmx_blend.S \
- x86/3dnow_xform1.S \
- x86/3dnow_xform2.S \
- x86/3dnow_xform3.S \
- x86/3dnow_xform4.S \
- x86/3dnow_normal.S \
- x86/sse_xform1.S \
- x86/sse_xform2.S \
- x86/sse_xform3.S \
- x86/sse_xform4.S \
- x86/sse_normal.S \
- x86/read_rgba_span_x86.S \
- tnl/t_vtx_x86_gcc.S
-
-X86_API = \
- x86/glapi_x86.S
-
-X86-64_SOURCES = \
- x86-64/xform4.S
-
-X86-64_API = \
- x86-64/glapi_x86-64.S
-
-SPARC_SOURCES = \
- sparc/clip.S \
- sparc/norm.S \
- sparc/xform.S
-
-SPARC_API = \
- sparc/glapi_sparc.S
-
-COMMON_DRIVER_SOURCES = \
- drivers/common/driverfuncs.c
-
-X11_DRIVER_SOURCES = \
- drivers/x11/glxapi.c \
- drivers/x11/fakeglx.c \
- drivers/x11/xfonts.c \
- drivers/x11/xm_api.c \
- drivers/x11/xm_buffer.c \
- drivers/x11/xm_dd.c \
- drivers/x11/xm_line.c \
- drivers/x11/xm_span.c \
- drivers/x11/xm_tri.c
-
-OSMESA_DRIVER_SOURCES = \
- drivers/osmesa/osmesa.c
-
-GLIDE_DRIVER_SOURCES = \
- drivers/glide/fxapi.c \
- drivers/glide/fxdd.c \
- drivers/glide/fxddspan.c \
- drivers/glide/fxddtex.c \
- drivers/glide/fxsetup.c \
- drivers/glide/fxtexman.c \
- drivers/glide/fxtris.c \
- drivers/glide/fxvb.c \
- drivers/glide/fxglidew.c \
- drivers/glide/fxg.c
-
-SVGA_DRIVER_SOURCES = \
- drivers/svga/svgamesa.c \
- drivers/svga/svgamesa8.c \
- drivers/svga/svgamesa15.c \
- drivers/svga/svgamesa16.c \
- drivers/svga/svgamesa24.c \
- drivers/svga/svgamesa32.c
-
-FBDEV_DRIVER_SOURCES = \
- drivers/fbdev/glfbdev.c
-
-
-### All the core C sources
-
-CORE_SOURCES = \
- $(MAIN_SOURCES) \
- $(GLAPI_SOURCES) \
- $(MATH_SOURCES) \
- $(ARRAY_CACHE_SOURCES) \
- $(TNL_SOURCES) \
- $(SHADER_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
- $(ASM_C_SOURCES) \
- $(SLANG_SOURCES)
-
-# $(SLANG_C_SOURCES)
-
-
-### Object files
-
-#CORE_OBJECTS = $(CORE_SOURCES:.c=.o) $(SLANG_CPP_SOURCES:.cpp=.o)
-CORE_OBJECTS = $(CORE_SOURCES:.c=.o)
-
-OSMESA_DRIVER_OBJECTS = $(OSMESA_DRIVER_SOURCES:.c=.o)
-
-COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
-
-
-
-### Include directories
-
-INCLUDE_DIRS = \
- -I$(TOP)/include \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mesa/glapi \
- -I$(TOP)/src/mesa/math \
- -I$(TOP)/src/mesa/tnl \
- -I$(TOP)/src/mesa/shader \
- -I$(TOP)/src/mesa/shader/grammar \
- -I$(TOP)/src/mesa/shader/slang \
- -I$(TOP)/src/mesa/shader/slang/OSDependent/Linux \
- -I$(TOP)/src/mesa/shader/slang/OGLCompilersDLL \
- -I$(TOP)/src/mesa/swrast \
- -I$(TOP)/src/mesa/swrast_setup
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/clip.S b/nx-X11/extras/Mesa/src/mesa/sparc/clip.S
deleted file mode 100644
index 58c228ed1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/clip.S
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Clip testing in SPARC assembly
- */
-
-#if __arch64__
-#define LDPTR ldx
-#define V4F_DATA 0x00
-#define V4F_START 0x08
-#define V4F_COUNT 0x10
-#define V4F_STRIDE 0x14
-#define V4F_SIZE 0x18
-#define V4F_FLAGS 0x1c
-#else
-#define LDPTR ld
-#define V4F_DATA 0x00
-#define V4F_START 0x04
-#define V4F_COUNT 0x08
-#define V4F_STRIDE 0x0c
-#define V4F_SIZE 0x10
-#define V4F_FLAGS 0x14
-#endif
-
-#define VEC_SIZE_1 1
-#define VEC_SIZE_2 3
-#define VEC_SIZE_3 7
-#define VEC_SIZE_4 15
-
-#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)
- /* Solaris requires this for 64-bit. */
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g7, #scratch
-#endif
-
- .text
- .align 64
-
-one_dot_zero:
- .word 0x3f800000 /* 1.0f */
-
- /* This trick is shamelessly stolen from the x86
- * Mesa asm. Very clever, and we can do it too
- * since we have the necessary add with carry
- * instructions on Sparc.
- */
-clip_table:
- .byte 0, 1, 0, 2, 4, 5, 4, 6
- .byte 0, 1, 0, 2, 8, 9, 8, 10
- .byte 32, 33, 32, 34, 36, 37, 36, 38
- .byte 32, 33, 32, 34, 40, 41, 40, 42
- .byte 0, 1, 0, 2, 4, 5, 4, 6
- .byte 0, 1, 0, 2, 8, 9, 8, 10
- .byte 16, 17, 16, 18, 20, 21, 20, 22
- .byte 16, 17, 16, 18, 24, 25, 24, 26
- .byte 63, 61, 63, 62, 55, 53, 55, 54
- .byte 63, 61, 63, 62, 59, 57, 59, 58
- .byte 47, 45, 47, 46, 39, 37, 39, 38
- .byte 47, 45, 47, 46, 43, 41, 43, 42
- .byte 63, 61, 63, 62, 55, 53, 55, 54
- .byte 63, 61, 63, 62, 59, 57, 59, 58
- .byte 31, 29, 31, 30, 23, 21, 23, 22
- .byte 31, 29, 31, 30, 27, 25, 27, 26
-
-/* GLvector4f *clip_vec, GLvector4f *proj_vec,
- GLubyte clipMask[], GLubyte *orMask, GLubyte *andMask */
-
- .align 64
-__pc_tramp:
- retl
- nop
-
- .globl _mesa_sparc_cliptest_points4
-_mesa_sparc_cliptest_points4:
- save %sp, -64, %sp
- call __pc_tramp
- sub %o7, (. - one_dot_zero - 4), %g1
- ld [%g1 + 0x0], %f4
- add %g1, 0x4, %g1
-
- ld [%i0 + V4F_STRIDE], %l1
- ld [%i0 + V4F_COUNT], %g7
- LDPTR [%i0 + V4F_START], %i0
- LDPTR [%i1 + V4F_START], %i5
- ldub [%i3], %g2
- ldub [%i4], %g3
- sll %g3, 8, %g3
- or %g2, %g3, %g2
-
- ld [%i1 + V4F_FLAGS], %g3
- or %g3, VEC_SIZE_4, %g3
- st %g3, [%i1 + V4F_FLAGS]
- mov 3, %g3
- st %g3, [%i1 + V4F_SIZE]
- st %g7, [%i1 + V4F_COUNT]
- clr %l2
- clr %l0
-
- /* l0: i
- * g7: count
- * l1: stride
- * l2: c
- * g2: (tmpAndMask << 8) | tmpOrMask
- * g1: clip_table
- * i0: from[stride][i]
- * i2: clipMask
- * i5: vProj[4][i]
- */
-
-1: ld [%i0 + 0x0c], %f3 ! LSU Group
- ld [%i0 + 0x0c], %g5 ! LSU Group
- ld [%i0 + 0x08], %g4 ! LSU Group
- fdivs %f4, %f3, %f8 ! FGM
- addcc %g5, %g5, %g5 ! IEU1 Group
- addx %g0, 0x0, %g3 ! IEU1 Group
- addcc %g4, %g4, %g4 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- subcc %g5, %g4, %g0 ! IEU1 Group
- ld [%i0 + 0x04], %g4 ! LSU Group
- addx %g3, %g3, %g3 ! IEU1 Group
- addcc %g4, %g4, %g4 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- subcc %g5, %g4, %g0 ! IEU1 Group
- ld [%i0 + 0x00], %g4 ! LSU Group
- addx %g3, %g3, %g3 ! IEU1 Group
- addcc %g4, %g4, %g4 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- subcc %g5, %g4, %g0 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- ldub [%g1 + %g3], %g3 ! LSU Group
- cmp %g3, 0 ! IEU1 Group, stall
- be 2f ! CTI
- stb %g3, [%i2] ! LSU
- sll %g3, 8, %g4 ! IEU1 Group
- add %l2, 1, %l2 ! IEU0
- st %g0, [%i5 + 0x00] ! LSU
- or %g4, 0xff, %g4 ! IEU0 Group
- or %g2, %g3, %g2 ! IEU1
- st %g0, [%i5 + 0x04] ! LSU
- and %g2, %g4, %g2 ! IEU0 Group
- st %g0, [%i5 + 0x08] ! LSU
- b 3f ! CTI
- st %f4, [%i5 + 0x0c] ! LSU Group
-2: ld [%i0 + 0x00], %f0 ! LSU Group
- ld [%i0 + 0x04], %f1 ! LSU Group
- ld [%i0 + 0x08], %f2 ! LSU Group
- fmuls %f0, %f8, %f0 ! FGM
- st %f0, [%i5 + 0x00] ! LSU Group
- fmuls %f1, %f8, %f1 ! FGM
- st %f1, [%i5 + 0x04] ! LSU Group
- fmuls %f2, %f8, %f2 ! FGM
- st %f2, [%i5 + 0x08] ! LSU Group
- st %f8, [%i5 + 0x0c] ! LSU Group
-3: add %i5, 0x10, %i5 ! IEU1
- add %l0, 1, %l0 ! IEU0 Group
- add %i2, 1, %i2 ! IEU0 Group
- cmp %l0, %g7 ! IEU1 Group
- bne 1b ! CTI
- add %i0, %l1, %i0 ! IEU0 Group
- stb %g2, [%i3] ! LSU
- srl %g2, 8, %g3 ! IEU0 Group
- cmp %l2, %g7 ! IEU1 Group
- bl,a 1f ! CTI
- clr %g3 ! IEU0
-1: stb %g3, [%i4] ! LSU Group
- ret ! CTI Group
- restore %i1, 0x0, %o0
-
- .globl _mesa_sparc_cliptest_points4_np
-_mesa_sparc_cliptest_points4_np:
- save %sp, -64, %sp
-
- call __pc_tramp
- sub %o7, (. - one_dot_zero - 4), %g1
- add %g1, 0x4, %g1
-
- ld [%i0 + V4F_STRIDE], %l1
- ld [%i0 + V4F_COUNT], %g7
- LDPTR [%i0 + V4F_START], %i0
- LDPTR [%i1 + V4F_START], %i5
- ldub [%i3], %g2
- ldub [%i4], %g3
- sll %g3, 8, %g3
- or %g2, %g3, %g2
-
- ld [%i1 + V4F_FLAGS], %g3
- or %g3, VEC_SIZE_4, %g3
- st %g3, [%i1 + V4F_FLAGS]
- mov 3, %g3
- st %g3, [%i1 + V4F_SIZE]
- st %g7, [%i1 + V4F_COUNT]
- clr %l2
- clr %l0
-
- /* l0: i
- * g7: count
- * l1: stride
- * l2: c
- * g2: (tmpAndMask << 8) | tmpOrMask
- * g1: clip_table
- * i0: from[stride][i]
- * i2: clipMask
- */
-
-1: ld [%i0 + 0x0c], %g5 ! LSU Group
- ld [%i0 + 0x08], %g4 ! LSU Group
- addcc %g5, %g5, %g5 ! IEU1 Group
- addx %g0, 0x0, %g3 ! IEU1 Group
- addcc %g4, %g4, %g4 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- subcc %g5, %g4, %g0 ! IEU1 Group
- ld [%i0 + 0x04], %g4 ! LSU Group
- addx %g3, %g3, %g3 ! IEU1 Group
- addcc %g4, %g4, %g4 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- subcc %g5, %g4, %g0 ! IEU1 Group
- ld [%i0 + 0x00], %g4 ! LSU Group
- addx %g3, %g3, %g3 ! IEU1 Group
- addcc %g4, %g4, %g4 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- subcc %g5, %g4, %g0 ! IEU1 Group
- addx %g3, %g3, %g3 ! IEU1 Group
- ldub [%g1 + %g3], %g3 ! LSU Group
- cmp %g3, 0 ! IEU1 Group, stall
- be 2f ! CTI
- stb %g3, [%i2] ! LSU
- sll %g3, 8, %g4 ! IEU1 Group
- add %l2, 1, %l2 ! IEU0
- or %g4, 0xff, %g4 ! IEU0 Group
- or %g2, %g3, %g2 ! IEU1
- and %g2, %g4, %g2 ! IEU0 Group
-2: add %l0, 1, %l0 ! IEU0 Group
- add %i2, 1, %i2 ! IEU0 Group
- cmp %l0, %g7 ! IEU1 Group
- bne 1b ! CTI
- add %i0, %l1, %i0 ! IEU0 Group
- stb %g2, [%i3] ! LSU
- srl %g2, 8, %g3 ! IEU0 Group
- cmp %l2, %g7 ! IEU1 Group
- bl,a 1f ! CTI
- clr %g3 ! IEU0
-1: stb %g3, [%i4] ! LSU Group
- ret ! CTI Group
- restore %i1, 0x0, %o0
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/glapi_sparc.S b/nx-X11/extras/Mesa/src/mesa/sparc/glapi_sparc.S
deleted file mode 100644
index 175a2819f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/glapi_sparc.S
+++ /dev/null
@@ -1,1884 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by gl_SPARC_asm.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "glapioffsets.h"
-
-#ifdef __arch64__
-# define GL_STUB(fn,off) \
-fn: \
- sethi %hi(0x00000000), %g4 ; \
- sethi %hi(0x00000000), %g1 ; \
- or %g4, %lo(0x00000000), %g4 ; \
- or %g1, %lo(0x00000000), %g1 ; \
- sllx %g4, 32, %g4 ; \
- ldx [%g1 + %g4], %g1 ; \
- sethi %hi(8 * off), %g4 ; \
- or %g4, %lo(8 * off), %g4 ; \
- ldx [%g1 + %g4], %g5 ; \
- jmpl %g5, %g0 ; \
- nop
-#else
-# define GL_STUB(fn,off) \
-fn: \
- sethi %hi(0x00000000), %g1 ; \
- ld [%g1 + %lo(0x00000000)], %g1 ; \
- ld [%g1 + (4 * off)], %g5 ; \
- jmpl %g5, %g0 ; \
- nop
-#endif
-
-#define GL_STUB_ALIAS(fn,alias) fn = alias
-
-.text
-.align 32
- .globl __glapi_sparc_icache_flush ; .type __glapi_sparc_icache_flush,#function
-__glapi_sparc_icache_flush: /* %o0 = insn_addr */
- flush %o0
- retl
- nop
-
-.data
-.align 64
-
- .globl glNewList ; .type glNewList,#function
- .globl glEndList ; .type glEndList,#function
- .globl glCallList ; .type glCallList,#function
- .globl glCallLists ; .type glCallLists,#function
- .globl glDeleteLists ; .type glDeleteLists,#function
- .globl glGenLists ; .type glGenLists,#function
- .globl glListBase ; .type glListBase,#function
- .globl glBegin ; .type glBegin,#function
- .globl glBitmap ; .type glBitmap,#function
- .globl glColor3b ; .type glColor3b,#function
- .globl glColor3bv ; .type glColor3bv,#function
- .globl glColor3d ; .type glColor3d,#function
- .globl glColor3dv ; .type glColor3dv,#function
- .globl glColor3f ; .type glColor3f,#function
- .globl glColor3fv ; .type glColor3fv,#function
- .globl glColor3i ; .type glColor3i,#function
- .globl glColor3iv ; .type glColor3iv,#function
- .globl glColor3s ; .type glColor3s,#function
- .globl glColor3sv ; .type glColor3sv,#function
- .globl glColor3ub ; .type glColor3ub,#function
- .globl glColor3ubv ; .type glColor3ubv,#function
- .globl glColor3ui ; .type glColor3ui,#function
- .globl glColor3uiv ; .type glColor3uiv,#function
- .globl glColor3us ; .type glColor3us,#function
- .globl glColor3usv ; .type glColor3usv,#function
- .globl glColor4b ; .type glColor4b,#function
- .globl glColor4bv ; .type glColor4bv,#function
- .globl glColor4d ; .type glColor4d,#function
- .globl glColor4dv ; .type glColor4dv,#function
- .globl glColor4f ; .type glColor4f,#function
- .globl glColor4fv ; .type glColor4fv,#function
- .globl glColor4i ; .type glColor4i,#function
- .globl glColor4iv ; .type glColor4iv,#function
- .globl glColor4s ; .type glColor4s,#function
- .globl glColor4sv ; .type glColor4sv,#function
- .globl glColor4ub ; .type glColor4ub,#function
- .globl glColor4ubv ; .type glColor4ubv,#function
- .globl glColor4ui ; .type glColor4ui,#function
- .globl glColor4uiv ; .type glColor4uiv,#function
- .globl glColor4us ; .type glColor4us,#function
- .globl glColor4usv ; .type glColor4usv,#function
- .globl glEdgeFlag ; .type glEdgeFlag,#function
- .globl glEdgeFlagv ; .type glEdgeFlagv,#function
- .globl glEnd ; .type glEnd,#function
- .globl glIndexd ; .type glIndexd,#function
- .globl glIndexdv ; .type glIndexdv,#function
- .globl glIndexf ; .type glIndexf,#function
- .globl glIndexfv ; .type glIndexfv,#function
- .globl glIndexi ; .type glIndexi,#function
- .globl glIndexiv ; .type glIndexiv,#function
- .globl glIndexs ; .type glIndexs,#function
- .globl glIndexsv ; .type glIndexsv,#function
- .globl glNormal3b ; .type glNormal3b,#function
- .globl glNormal3bv ; .type glNormal3bv,#function
- .globl glNormal3d ; .type glNormal3d,#function
- .globl glNormal3dv ; .type glNormal3dv,#function
- .globl glNormal3f ; .type glNormal3f,#function
- .globl glNormal3fv ; .type glNormal3fv,#function
- .globl glNormal3i ; .type glNormal3i,#function
- .globl glNormal3iv ; .type glNormal3iv,#function
- .globl glNormal3s ; .type glNormal3s,#function
- .globl glNormal3sv ; .type glNormal3sv,#function
- .globl glRasterPos2d ; .type glRasterPos2d,#function
- .globl glRasterPos2dv ; .type glRasterPos2dv,#function
- .globl glRasterPos2f ; .type glRasterPos2f,#function
- .globl glRasterPos2fv ; .type glRasterPos2fv,#function
- .globl glRasterPos2i ; .type glRasterPos2i,#function
- .globl glRasterPos2iv ; .type glRasterPos2iv,#function
- .globl glRasterPos2s ; .type glRasterPos2s,#function
- .globl glRasterPos2sv ; .type glRasterPos2sv,#function
- .globl glRasterPos3d ; .type glRasterPos3d,#function
- .globl glRasterPos3dv ; .type glRasterPos3dv,#function
- .globl glRasterPos3f ; .type glRasterPos3f,#function
- .globl glRasterPos3fv ; .type glRasterPos3fv,#function
- .globl glRasterPos3i ; .type glRasterPos3i,#function
- .globl glRasterPos3iv ; .type glRasterPos3iv,#function
- .globl glRasterPos3s ; .type glRasterPos3s,#function
- .globl glRasterPos3sv ; .type glRasterPos3sv,#function
- .globl glRasterPos4d ; .type glRasterPos4d,#function
- .globl glRasterPos4dv ; .type glRasterPos4dv,#function
- .globl glRasterPos4f ; .type glRasterPos4f,#function
- .globl glRasterPos4fv ; .type glRasterPos4fv,#function
- .globl glRasterPos4i ; .type glRasterPos4i,#function
- .globl glRasterPos4iv ; .type glRasterPos4iv,#function
- .globl glRasterPos4s ; .type glRasterPos4s,#function
- .globl glRasterPos4sv ; .type glRasterPos4sv,#function
- .globl glRectd ; .type glRectd,#function
- .globl glRectdv ; .type glRectdv,#function
- .globl glRectf ; .type glRectf,#function
- .globl glRectfv ; .type glRectfv,#function
- .globl glRecti ; .type glRecti,#function
- .globl glRectiv ; .type glRectiv,#function
- .globl glRects ; .type glRects,#function
- .globl glRectsv ; .type glRectsv,#function
- .globl glTexCoord1d ; .type glTexCoord1d,#function
- .globl glTexCoord1dv ; .type glTexCoord1dv,#function
- .globl glTexCoord1f ; .type glTexCoord1f,#function
- .globl glTexCoord1fv ; .type glTexCoord1fv,#function
- .globl glTexCoord1i ; .type glTexCoord1i,#function
- .globl glTexCoord1iv ; .type glTexCoord1iv,#function
- .globl glTexCoord1s ; .type glTexCoord1s,#function
- .globl glTexCoord1sv ; .type glTexCoord1sv,#function
- .globl glTexCoord2d ; .type glTexCoord2d,#function
- .globl glTexCoord2dv ; .type glTexCoord2dv,#function
- .globl glTexCoord2f ; .type glTexCoord2f,#function
- .globl glTexCoord2fv ; .type glTexCoord2fv,#function
- .globl glTexCoord2i ; .type glTexCoord2i,#function
- .globl glTexCoord2iv ; .type glTexCoord2iv,#function
- .globl glTexCoord2s ; .type glTexCoord2s,#function
- .globl glTexCoord2sv ; .type glTexCoord2sv,#function
- .globl glTexCoord3d ; .type glTexCoord3d,#function
- .globl glTexCoord3dv ; .type glTexCoord3dv,#function
- .globl glTexCoord3f ; .type glTexCoord3f,#function
- .globl glTexCoord3fv ; .type glTexCoord3fv,#function
- .globl glTexCoord3i ; .type glTexCoord3i,#function
- .globl glTexCoord3iv ; .type glTexCoord3iv,#function
- .globl glTexCoord3s ; .type glTexCoord3s,#function
- .globl glTexCoord3sv ; .type glTexCoord3sv,#function
- .globl glTexCoord4d ; .type glTexCoord4d,#function
- .globl glTexCoord4dv ; .type glTexCoord4dv,#function
- .globl glTexCoord4f ; .type glTexCoord4f,#function
- .globl glTexCoord4fv ; .type glTexCoord4fv,#function
- .globl glTexCoord4i ; .type glTexCoord4i,#function
- .globl glTexCoord4iv ; .type glTexCoord4iv,#function
- .globl glTexCoord4s ; .type glTexCoord4s,#function
- .globl glTexCoord4sv ; .type glTexCoord4sv,#function
- .globl glVertex2d ; .type glVertex2d,#function
- .globl glVertex2dv ; .type glVertex2dv,#function
- .globl glVertex2f ; .type glVertex2f,#function
- .globl glVertex2fv ; .type glVertex2fv,#function
- .globl glVertex2i ; .type glVertex2i,#function
- .globl glVertex2iv ; .type glVertex2iv,#function
- .globl glVertex2s ; .type glVertex2s,#function
- .globl glVertex2sv ; .type glVertex2sv,#function
- .globl glVertex3d ; .type glVertex3d,#function
- .globl glVertex3dv ; .type glVertex3dv,#function
- .globl glVertex3f ; .type glVertex3f,#function
- .globl glVertex3fv ; .type glVertex3fv,#function
- .globl glVertex3i ; .type glVertex3i,#function
- .globl glVertex3iv ; .type glVertex3iv,#function
- .globl glVertex3s ; .type glVertex3s,#function
- .globl glVertex3sv ; .type glVertex3sv,#function
- .globl glVertex4d ; .type glVertex4d,#function
- .globl glVertex4dv ; .type glVertex4dv,#function
- .globl glVertex4f ; .type glVertex4f,#function
- .globl glVertex4fv ; .type glVertex4fv,#function
- .globl glVertex4i ; .type glVertex4i,#function
- .globl glVertex4iv ; .type glVertex4iv,#function
- .globl glVertex4s ; .type glVertex4s,#function
- .globl glVertex4sv ; .type glVertex4sv,#function
- .globl glClipPlane ; .type glClipPlane,#function
- .globl glColorMaterial ; .type glColorMaterial,#function
- .globl glCullFace ; .type glCullFace,#function
- .globl glFogf ; .type glFogf,#function
- .globl glFogfv ; .type glFogfv,#function
- .globl glFogi ; .type glFogi,#function
- .globl glFogiv ; .type glFogiv,#function
- .globl glFrontFace ; .type glFrontFace,#function
- .globl glHint ; .type glHint,#function
- .globl glLightf ; .type glLightf,#function
- .globl glLightfv ; .type glLightfv,#function
- .globl glLighti ; .type glLighti,#function
- .globl glLightiv ; .type glLightiv,#function
- .globl glLightModelf ; .type glLightModelf,#function
- .globl glLightModelfv ; .type glLightModelfv,#function
- .globl glLightModeli ; .type glLightModeli,#function
- .globl glLightModeliv ; .type glLightModeliv,#function
- .globl glLineStipple ; .type glLineStipple,#function
- .globl glLineWidth ; .type glLineWidth,#function
- .globl glMaterialf ; .type glMaterialf,#function
- .globl glMaterialfv ; .type glMaterialfv,#function
- .globl glMateriali ; .type glMateriali,#function
- .globl glMaterialiv ; .type glMaterialiv,#function
- .globl glPointSize ; .type glPointSize,#function
- .globl glPolygonMode ; .type glPolygonMode,#function
- .globl glPolygonStipple ; .type glPolygonStipple,#function
- .globl glScissor ; .type glScissor,#function
- .globl glShadeModel ; .type glShadeModel,#function
- .globl glTexParameterf ; .type glTexParameterf,#function
- .globl glTexParameterfv ; .type glTexParameterfv,#function
- .globl glTexParameteri ; .type glTexParameteri,#function
- .globl glTexParameteriv ; .type glTexParameteriv,#function
- .globl glTexImage1D ; .type glTexImage1D,#function
- .globl glTexImage2D ; .type glTexImage2D,#function
- .globl glTexEnvf ; .type glTexEnvf,#function
- .globl glTexEnvfv ; .type glTexEnvfv,#function
- .globl glTexEnvi ; .type glTexEnvi,#function
- .globl glTexEnviv ; .type glTexEnviv,#function
- .globl glTexGend ; .type glTexGend,#function
- .globl glTexGendv ; .type glTexGendv,#function
- .globl glTexGenf ; .type glTexGenf,#function
- .globl glTexGenfv ; .type glTexGenfv,#function
- .globl glTexGeni ; .type glTexGeni,#function
- .globl glTexGeniv ; .type glTexGeniv,#function
- .globl glFeedbackBuffer ; .type glFeedbackBuffer,#function
- .globl glSelectBuffer ; .type glSelectBuffer,#function
- .globl glRenderMode ; .type glRenderMode,#function
- .globl glInitNames ; .type glInitNames,#function
- .globl glLoadName ; .type glLoadName,#function
- .globl glPassThrough ; .type glPassThrough,#function
- .globl glPopName ; .type glPopName,#function
- .globl glPushName ; .type glPushName,#function
- .globl glDrawBuffer ; .type glDrawBuffer,#function
- .globl glClear ; .type glClear,#function
- .globl glClearAccum ; .type glClearAccum,#function
- .globl glClearIndex ; .type glClearIndex,#function
- .globl glClearColor ; .type glClearColor,#function
- .globl glClearStencil ; .type glClearStencil,#function
- .globl glClearDepth ; .type glClearDepth,#function
- .globl glStencilMask ; .type glStencilMask,#function
- .globl glColorMask ; .type glColorMask,#function
- .globl glDepthMask ; .type glDepthMask,#function
- .globl glIndexMask ; .type glIndexMask,#function
- .globl glAccum ; .type glAccum,#function
- .globl glDisable ; .type glDisable,#function
- .globl glEnable ; .type glEnable,#function
- .globl glFinish ; .type glFinish,#function
- .globl glFlush ; .type glFlush,#function
- .globl glPopAttrib ; .type glPopAttrib,#function
- .globl glPushAttrib ; .type glPushAttrib,#function
- .globl glMap1d ; .type glMap1d,#function
- .globl glMap1f ; .type glMap1f,#function
- .globl glMap2d ; .type glMap2d,#function
- .globl glMap2f ; .type glMap2f,#function
- .globl glMapGrid1d ; .type glMapGrid1d,#function
- .globl glMapGrid1f ; .type glMapGrid1f,#function
- .globl glMapGrid2d ; .type glMapGrid2d,#function
- .globl glMapGrid2f ; .type glMapGrid2f,#function
- .globl glEvalCoord1d ; .type glEvalCoord1d,#function
- .globl glEvalCoord1dv ; .type glEvalCoord1dv,#function
- .globl glEvalCoord1f ; .type glEvalCoord1f,#function
- .globl glEvalCoord1fv ; .type glEvalCoord1fv,#function
- .globl glEvalCoord2d ; .type glEvalCoord2d,#function
- .globl glEvalCoord2dv ; .type glEvalCoord2dv,#function
- .globl glEvalCoord2f ; .type glEvalCoord2f,#function
- .globl glEvalCoord2fv ; .type glEvalCoord2fv,#function
- .globl glEvalMesh1 ; .type glEvalMesh1,#function
- .globl glEvalPoint1 ; .type glEvalPoint1,#function
- .globl glEvalMesh2 ; .type glEvalMesh2,#function
- .globl glEvalPoint2 ; .type glEvalPoint2,#function
- .globl glAlphaFunc ; .type glAlphaFunc,#function
- .globl glBlendFunc ; .type glBlendFunc,#function
- .globl glLogicOp ; .type glLogicOp,#function
- .globl glStencilFunc ; .type glStencilFunc,#function
- .globl glStencilOp ; .type glStencilOp,#function
- .globl glDepthFunc ; .type glDepthFunc,#function
- .globl glPixelZoom ; .type glPixelZoom,#function
- .globl glPixelTransferf ; .type glPixelTransferf,#function
- .globl glPixelTransferi ; .type glPixelTransferi,#function
- .globl glPixelStoref ; .type glPixelStoref,#function
- .globl glPixelStorei ; .type glPixelStorei,#function
- .globl glPixelMapfv ; .type glPixelMapfv,#function
- .globl glPixelMapuiv ; .type glPixelMapuiv,#function
- .globl glPixelMapusv ; .type glPixelMapusv,#function
- .globl glReadBuffer ; .type glReadBuffer,#function
- .globl glCopyPixels ; .type glCopyPixels,#function
- .globl glReadPixels ; .type glReadPixels,#function
- .globl glDrawPixels ; .type glDrawPixels,#function
- .globl glGetBooleanv ; .type glGetBooleanv,#function
- .globl glGetClipPlane ; .type glGetClipPlane,#function
- .globl glGetDoublev ; .type glGetDoublev,#function
- .globl glGetError ; .type glGetError,#function
- .globl glGetFloatv ; .type glGetFloatv,#function
- .globl glGetIntegerv ; .type glGetIntegerv,#function
- .globl glGetLightfv ; .type glGetLightfv,#function
- .globl glGetLightiv ; .type glGetLightiv,#function
- .globl glGetMapdv ; .type glGetMapdv,#function
- .globl glGetMapfv ; .type glGetMapfv,#function
- .globl glGetMapiv ; .type glGetMapiv,#function
- .globl glGetMaterialfv ; .type glGetMaterialfv,#function
- .globl glGetMaterialiv ; .type glGetMaterialiv,#function
- .globl glGetPixelMapfv ; .type glGetPixelMapfv,#function
- .globl glGetPixelMapuiv ; .type glGetPixelMapuiv,#function
- .globl glGetPixelMapusv ; .type glGetPixelMapusv,#function
- .globl glGetPolygonStipple ; .type glGetPolygonStipple,#function
- .globl glGetString ; .type glGetString,#function
- .globl glGetTexEnvfv ; .type glGetTexEnvfv,#function
- .globl glGetTexEnviv ; .type glGetTexEnviv,#function
- .globl glGetTexGendv ; .type glGetTexGendv,#function
- .globl glGetTexGenfv ; .type glGetTexGenfv,#function
- .globl glGetTexGeniv ; .type glGetTexGeniv,#function
- .globl glGetTexImage ; .type glGetTexImage,#function
- .globl glGetTexParameterfv ; .type glGetTexParameterfv,#function
- .globl glGetTexParameteriv ; .type glGetTexParameteriv,#function
- .globl glGetTexLevelParameterfv ; .type glGetTexLevelParameterfv,#function
- .globl glGetTexLevelParameteriv ; .type glGetTexLevelParameteriv,#function
- .globl glIsEnabled ; .type glIsEnabled,#function
- .globl glIsList ; .type glIsList,#function
- .globl glDepthRange ; .type glDepthRange,#function
- .globl glFrustum ; .type glFrustum,#function
- .globl glLoadIdentity ; .type glLoadIdentity,#function
- .globl glLoadMatrixf ; .type glLoadMatrixf,#function
- .globl glLoadMatrixd ; .type glLoadMatrixd,#function
- .globl glMatrixMode ; .type glMatrixMode,#function
- .globl glMultMatrixf ; .type glMultMatrixf,#function
- .globl glMultMatrixd ; .type glMultMatrixd,#function
- .globl glOrtho ; .type glOrtho,#function
- .globl glPopMatrix ; .type glPopMatrix,#function
- .globl glPushMatrix ; .type glPushMatrix,#function
- .globl glRotated ; .type glRotated,#function
- .globl glRotatef ; .type glRotatef,#function
- .globl glScaled ; .type glScaled,#function
- .globl glScalef ; .type glScalef,#function
- .globl glTranslated ; .type glTranslated,#function
- .globl glTranslatef ; .type glTranslatef,#function
- .globl glViewport ; .type glViewport,#function
- .globl glArrayElement ; .type glArrayElement,#function
- .globl glBindTexture ; .type glBindTexture,#function
- .globl glColorPointer ; .type glColorPointer,#function
- .globl glDisableClientState ; .type glDisableClientState,#function
- .globl glDrawArrays ; .type glDrawArrays,#function
- .globl glDrawElements ; .type glDrawElements,#function
- .globl glEdgeFlagPointer ; .type glEdgeFlagPointer,#function
- .globl glEnableClientState ; .type glEnableClientState,#function
- .globl glIndexPointer ; .type glIndexPointer,#function
- .globl glIndexub ; .type glIndexub,#function
- .globl glIndexubv ; .type glIndexubv,#function
- .globl glInterleavedArrays ; .type glInterleavedArrays,#function
- .globl glNormalPointer ; .type glNormalPointer,#function
- .globl glPolygonOffset ; .type glPolygonOffset,#function
- .globl glTexCoordPointer ; .type glTexCoordPointer,#function
- .globl glVertexPointer ; .type glVertexPointer,#function
- .globl glAreTexturesResident ; .type glAreTexturesResident,#function
- .globl glCopyTexImage1D ; .type glCopyTexImage1D,#function
- .globl glCopyTexImage2D ; .type glCopyTexImage2D,#function
- .globl glCopyTexSubImage1D ; .type glCopyTexSubImage1D,#function
- .globl glCopyTexSubImage2D ; .type glCopyTexSubImage2D,#function
- .globl glDeleteTextures ; .type glDeleteTextures,#function
- .globl glGenTextures ; .type glGenTextures,#function
- .globl glGetPointerv ; .type glGetPointerv,#function
- .globl glIsTexture ; .type glIsTexture,#function
- .globl glPrioritizeTextures ; .type glPrioritizeTextures,#function
- .globl glTexSubImage1D ; .type glTexSubImage1D,#function
- .globl glTexSubImage2D ; .type glTexSubImage2D,#function
- .globl glPopClientAttrib ; .type glPopClientAttrib,#function
- .globl glPushClientAttrib ; .type glPushClientAttrib,#function
- .globl glBlendColor ; .type glBlendColor,#function
- .globl glBlendEquation ; .type glBlendEquation,#function
- .globl glDrawRangeElements ; .type glDrawRangeElements,#function
- .globl glColorTable ; .type glColorTable,#function
- .globl glColorTableParameterfv ; .type glColorTableParameterfv,#function
- .globl glColorTableParameteriv ; .type glColorTableParameteriv,#function
- .globl glCopyColorTable ; .type glCopyColorTable,#function
- .globl glGetColorTable ; .type glGetColorTable,#function
- .globl glGetColorTableParameterfv ; .type glGetColorTableParameterfv,#function
- .globl glGetColorTableParameteriv ; .type glGetColorTableParameteriv,#function
- .globl glColorSubTable ; .type glColorSubTable,#function
- .globl glCopyColorSubTable ; .type glCopyColorSubTable,#function
- .globl glConvolutionFilter1D ; .type glConvolutionFilter1D,#function
- .globl glConvolutionFilter2D ; .type glConvolutionFilter2D,#function
- .globl glConvolutionParameterf ; .type glConvolutionParameterf,#function
- .globl glConvolutionParameterfv ; .type glConvolutionParameterfv,#function
- .globl glConvolutionParameteri ; .type glConvolutionParameteri,#function
- .globl glConvolutionParameteriv ; .type glConvolutionParameteriv,#function
- .globl glCopyConvolutionFilter1D ; .type glCopyConvolutionFilter1D,#function
- .globl glCopyConvolutionFilter2D ; .type glCopyConvolutionFilter2D,#function
- .globl glGetConvolutionFilter ; .type glGetConvolutionFilter,#function
- .globl glGetConvolutionParameterfv ; .type glGetConvolutionParameterfv,#function
- .globl glGetConvolutionParameteriv ; .type glGetConvolutionParameteriv,#function
- .globl glGetSeparableFilter ; .type glGetSeparableFilter,#function
- .globl glSeparableFilter2D ; .type glSeparableFilter2D,#function
- .globl glGetHistogram ; .type glGetHistogram,#function
- .globl glGetHistogramParameterfv ; .type glGetHistogramParameterfv,#function
- .globl glGetHistogramParameteriv ; .type glGetHistogramParameteriv,#function
- .globl glGetMinmax ; .type glGetMinmax,#function
- .globl glGetMinmaxParameterfv ; .type glGetMinmaxParameterfv,#function
- .globl glGetMinmaxParameteriv ; .type glGetMinmaxParameteriv,#function
- .globl glHistogram ; .type glHistogram,#function
- .globl glMinmax ; .type glMinmax,#function
- .globl glResetHistogram ; .type glResetHistogram,#function
- .globl glResetMinmax ; .type glResetMinmax,#function
- .globl glTexImage3D ; .type glTexImage3D,#function
- .globl glTexSubImage3D ; .type glTexSubImage3D,#function
- .globl glCopyTexSubImage3D ; .type glCopyTexSubImage3D,#function
- .globl glActiveTextureARB ; .type glActiveTextureARB,#function
- .globl glClientActiveTextureARB ; .type glClientActiveTextureARB,#function
- .globl glMultiTexCoord1dARB ; .type glMultiTexCoord1dARB,#function
- .globl glMultiTexCoord1dvARB ; .type glMultiTexCoord1dvARB,#function
- .globl glMultiTexCoord1fARB ; .type glMultiTexCoord1fARB,#function
- .globl glMultiTexCoord1fvARB ; .type glMultiTexCoord1fvARB,#function
- .globl glMultiTexCoord1iARB ; .type glMultiTexCoord1iARB,#function
- .globl glMultiTexCoord1ivARB ; .type glMultiTexCoord1ivARB,#function
- .globl glMultiTexCoord1sARB ; .type glMultiTexCoord1sARB,#function
- .globl glMultiTexCoord1svARB ; .type glMultiTexCoord1svARB,#function
- .globl glMultiTexCoord2dARB ; .type glMultiTexCoord2dARB,#function
- .globl glMultiTexCoord2dvARB ; .type glMultiTexCoord2dvARB,#function
- .globl glMultiTexCoord2fARB ; .type glMultiTexCoord2fARB,#function
- .globl glMultiTexCoord2fvARB ; .type glMultiTexCoord2fvARB,#function
- .globl glMultiTexCoord2iARB ; .type glMultiTexCoord2iARB,#function
- .globl glMultiTexCoord2ivARB ; .type glMultiTexCoord2ivARB,#function
- .globl glMultiTexCoord2sARB ; .type glMultiTexCoord2sARB,#function
- .globl glMultiTexCoord2svARB ; .type glMultiTexCoord2svARB,#function
- .globl glMultiTexCoord3dARB ; .type glMultiTexCoord3dARB,#function
- .globl glMultiTexCoord3dvARB ; .type glMultiTexCoord3dvARB,#function
- .globl glMultiTexCoord3fARB ; .type glMultiTexCoord3fARB,#function
- .globl glMultiTexCoord3fvARB ; .type glMultiTexCoord3fvARB,#function
- .globl glMultiTexCoord3iARB ; .type glMultiTexCoord3iARB,#function
- .globl glMultiTexCoord3ivARB ; .type glMultiTexCoord3ivARB,#function
- .globl glMultiTexCoord3sARB ; .type glMultiTexCoord3sARB,#function
- .globl glMultiTexCoord3svARB ; .type glMultiTexCoord3svARB,#function
- .globl glMultiTexCoord4dARB ; .type glMultiTexCoord4dARB,#function
- .globl glMultiTexCoord4dvARB ; .type glMultiTexCoord4dvARB,#function
- .globl glMultiTexCoord4fARB ; .type glMultiTexCoord4fARB,#function
- .globl glMultiTexCoord4fvARB ; .type glMultiTexCoord4fvARB,#function
- .globl glMultiTexCoord4iARB ; .type glMultiTexCoord4iARB,#function
- .globl glMultiTexCoord4ivARB ; .type glMultiTexCoord4ivARB,#function
- .globl glMultiTexCoord4sARB ; .type glMultiTexCoord4sARB,#function
- .globl glMultiTexCoord4svARB ; .type glMultiTexCoord4svARB,#function
- .globl glLoadTransposeMatrixfARB ; .type glLoadTransposeMatrixfARB,#function
- .globl glLoadTransposeMatrixdARB ; .type glLoadTransposeMatrixdARB,#function
- .globl glMultTransposeMatrixfARB ; .type glMultTransposeMatrixfARB,#function
- .globl glMultTransposeMatrixdARB ; .type glMultTransposeMatrixdARB,#function
- .globl glSampleCoverageARB ; .type glSampleCoverageARB,#function
- .globl glDrawBuffersARB ; .type glDrawBuffersARB,#function
- .globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function
- .globl glGetTexFilterFuncSGIS ; .type glGetTexFilterFuncSGIS,#function
- .globl glTexFilterFuncSGIS ; .type glTexFilterFuncSGIS,#function
- .globl glGetHistogramEXT ; .type glGetHistogramEXT,#function
- .globl glGetHistogramParameterfvEXT ; .type glGetHistogramParameterfvEXT,#function
- .globl glGetHistogramParameterivEXT ; .type glGetHistogramParameterivEXT,#function
- .globl glGetMinmaxEXT ; .type glGetMinmaxEXT,#function
- .globl glGetMinmaxParameterfvEXT ; .type glGetMinmaxParameterfvEXT,#function
- .globl glGetMinmaxParameterivEXT ; .type glGetMinmaxParameterivEXT,#function
- .globl glGetConvolutionFilterEXT ; .type glGetConvolutionFilterEXT,#function
- .globl glGetConvolutionParameterfvEXT ; .type glGetConvolutionParameterfvEXT,#function
- .globl glGetConvolutionParameterivEXT ; .type glGetConvolutionParameterivEXT,#function
- .globl glGetSeparableFilterEXT ; .type glGetSeparableFilterEXT,#function
- .globl glGetColorTableSGI ; .type glGetColorTableSGI,#function
- .globl glGetColorTableParameterfvSGI ; .type glGetColorTableParameterfvSGI,#function
- .globl glGetColorTableParameterivSGI ; .type glGetColorTableParameterivSGI,#function
- .globl glPixelTexGenSGIX ; .type glPixelTexGenSGIX,#function
- .globl glPixelTexGenParameteriSGIS ; .type glPixelTexGenParameteriSGIS,#function
- .globl glPixelTexGenParameterivSGIS ; .type glPixelTexGenParameterivSGIS,#function
- .globl glPixelTexGenParameterfSGIS ; .type glPixelTexGenParameterfSGIS,#function
- .globl glPixelTexGenParameterfvSGIS ; .type glPixelTexGenParameterfvSGIS,#function
- .globl glGetPixelTexGenParameterivSGIS ; .type glGetPixelTexGenParameterivSGIS,#function
- .globl glGetPixelTexGenParameterfvSGIS ; .type glGetPixelTexGenParameterfvSGIS,#function
- .globl glTexImage4DSGIS ; .type glTexImage4DSGIS,#function
- .globl glTexSubImage4DSGIS ; .type glTexSubImage4DSGIS,#function
- .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function
- .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function
- .globl glIsTextureEXT ; .type glIsTextureEXT,#function
- .globl glDetailTexFuncSGIS ; .type glDetailTexFuncSGIS,#function
- .globl glGetDetailTexFuncSGIS ; .type glGetDetailTexFuncSGIS,#function
- .globl glSharpenTexFuncSGIS ; .type glSharpenTexFuncSGIS,#function
- .globl glGetSharpenTexFuncSGIS ; .type glGetSharpenTexFuncSGIS,#function
- .globl glSampleMaskSGIS ; .type glSampleMaskSGIS,#function
- .globl glSamplePatternSGIS ; .type glSamplePatternSGIS,#function
- .globl glColorPointerEXT ; .type glColorPointerEXT,#function
- .globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function
- .globl glIndexPointerEXT ; .type glIndexPointerEXT,#function
- .globl glNormalPointerEXT ; .type glNormalPointerEXT,#function
- .globl glTexCoordPointerEXT ; .type glTexCoordPointerEXT,#function
- .globl glVertexPointerEXT ; .type glVertexPointerEXT,#function
- .globl glSpriteParameterfSGIX ; .type glSpriteParameterfSGIX,#function
- .globl glSpriteParameterfvSGIX ; .type glSpriteParameterfvSGIX,#function
- .globl glSpriteParameteriSGIX ; .type glSpriteParameteriSGIX,#function
- .globl glSpriteParameterivSGIX ; .type glSpriteParameterivSGIX,#function
- .globl glPointParameterfEXT ; .type glPointParameterfEXT,#function
- .globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function
- .globl glGetInstrumentsSGIX ; .type glGetInstrumentsSGIX,#function
- .globl glInstrumentsBufferSGIX ; .type glInstrumentsBufferSGIX,#function
- .globl glPollInstrumentsSGIX ; .type glPollInstrumentsSGIX,#function
- .globl glReadInstrumentsSGIX ; .type glReadInstrumentsSGIX,#function
- .globl glStartInstrumentsSGIX ; .type glStartInstrumentsSGIX,#function
- .globl glStopInstrumentsSGIX ; .type glStopInstrumentsSGIX,#function
- .globl glFrameZoomSGIX ; .type glFrameZoomSGIX,#function
- .globl glTagSampleBufferSGIX ; .type glTagSampleBufferSGIX,#function
- .globl glReferencePlaneSGIX ; .type glReferencePlaneSGIX,#function
- .globl glFlushRasterSGIX ; .type glFlushRasterSGIX,#function
- .globl glGetListParameterfvSGIX ; .type glGetListParameterfvSGIX,#function
- .globl glGetListParameterivSGIX ; .type glGetListParameterivSGIX,#function
- .globl glListParameterfSGIX ; .type glListParameterfSGIX,#function
- .globl glListParameterfvSGIX ; .type glListParameterfvSGIX,#function
- .globl glListParameteriSGIX ; .type glListParameteriSGIX,#function
- .globl glListParameterivSGIX ; .type glListParameterivSGIX,#function
- .globl glFragmentColorMaterialSGIX ; .type glFragmentColorMaterialSGIX,#function
- .globl glFragmentLightfSGIX ; .type glFragmentLightfSGIX,#function
- .globl glFragmentLightfvSGIX ; .type glFragmentLightfvSGIX,#function
- .globl glFragmentLightiSGIX ; .type glFragmentLightiSGIX,#function
- .globl glFragmentLightivSGIX ; .type glFragmentLightivSGIX,#function
- .globl glFragmentLightModelfSGIX ; .type glFragmentLightModelfSGIX,#function
- .globl glFragmentLightModelfvSGIX ; .type glFragmentLightModelfvSGIX,#function
- .globl glFragmentLightModeliSGIX ; .type glFragmentLightModeliSGIX,#function
- .globl glFragmentLightModelivSGIX ; .type glFragmentLightModelivSGIX,#function
- .globl glFragmentMaterialfSGIX ; .type glFragmentMaterialfSGIX,#function
- .globl glFragmentMaterialfvSGIX ; .type glFragmentMaterialfvSGIX,#function
- .globl glFragmentMaterialiSGIX ; .type glFragmentMaterialiSGIX,#function
- .globl glFragmentMaterialivSGIX ; .type glFragmentMaterialivSGIX,#function
- .globl glGetFragmentLightfvSGIX ; .type glGetFragmentLightfvSGIX,#function
- .globl glGetFragmentLightivSGIX ; .type glGetFragmentLightivSGIX,#function
- .globl glGetFragmentMaterialfvSGIX ; .type glGetFragmentMaterialfvSGIX,#function
- .globl glGetFragmentMaterialivSGIX ; .type glGetFragmentMaterialivSGIX,#function
- .globl glLightEnviSGIX ; .type glLightEnviSGIX,#function
- .globl glVertexWeightfEXT ; .type glVertexWeightfEXT,#function
- .globl glVertexWeightfvEXT ; .type glVertexWeightfvEXT,#function
- .globl glVertexWeightPointerEXT ; .type glVertexWeightPointerEXT,#function
- .globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function
- .globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function
- .globl glCombinerParameterfvNV ; .type glCombinerParameterfvNV,#function
- .globl glCombinerParameterfNV ; .type glCombinerParameterfNV,#function
- .globl glCombinerParameterivNV ; .type glCombinerParameterivNV,#function
- .globl glCombinerParameteriNV ; .type glCombinerParameteriNV,#function
- .globl glCombinerInputNV ; .type glCombinerInputNV,#function
- .globl glCombinerOutputNV ; .type glCombinerOutputNV,#function
- .globl glFinalCombinerInputNV ; .type glFinalCombinerInputNV,#function
- .globl glGetCombinerInputParameterfvNV ; .type glGetCombinerInputParameterfvNV,#function
- .globl glGetCombinerInputParameterivNV ; .type glGetCombinerInputParameterivNV,#function
- .globl glGetCombinerOutputParameterfvNV ; .type glGetCombinerOutputParameterfvNV,#function
- .globl glGetCombinerOutputParameterivNV ; .type glGetCombinerOutputParameterivNV,#function
- .globl glGetFinalCombinerInputParameterfvNV ; .type glGetFinalCombinerInputParameterfvNV,#function
- .globl glGetFinalCombinerInputParameterivNV ; .type glGetFinalCombinerInputParameterivNV,#function
- .globl glResizeBuffersMESA ; .type glResizeBuffersMESA,#function
- .globl glWindowPos2dMESA ; .type glWindowPos2dMESA,#function
- .globl glWindowPos2dvMESA ; .type glWindowPos2dvMESA,#function
- .globl glWindowPos2fMESA ; .type glWindowPos2fMESA,#function
- .globl glWindowPos2fvMESA ; .type glWindowPos2fvMESA,#function
- .globl glWindowPos2iMESA ; .type glWindowPos2iMESA,#function
- .globl glWindowPos2ivMESA ; .type glWindowPos2ivMESA,#function
- .globl glWindowPos2sMESA ; .type glWindowPos2sMESA,#function
- .globl glWindowPos2svMESA ; .type glWindowPos2svMESA,#function
- .globl glWindowPos3dMESA ; .type glWindowPos3dMESA,#function
- .globl glWindowPos3dvMESA ; .type glWindowPos3dvMESA,#function
- .globl glWindowPos3fMESA ; .type glWindowPos3fMESA,#function
- .globl glWindowPos3fvMESA ; .type glWindowPos3fvMESA,#function
- .globl glWindowPos3iMESA ; .type glWindowPos3iMESA,#function
- .globl glWindowPos3ivMESA ; .type glWindowPos3ivMESA,#function
- .globl glWindowPos3sMESA ; .type glWindowPos3sMESA,#function
- .globl glWindowPos3svMESA ; .type glWindowPos3svMESA,#function
- .globl glWindowPos4dMESA ; .type glWindowPos4dMESA,#function
- .globl glWindowPos4dvMESA ; .type glWindowPos4dvMESA,#function
- .globl glWindowPos4fMESA ; .type glWindowPos4fMESA,#function
- .globl glWindowPos4fvMESA ; .type glWindowPos4fvMESA,#function
- .globl glWindowPos4iMESA ; .type glWindowPos4iMESA,#function
- .globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function
- .globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function
- .globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function
- .globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function
- .globl glIndexMaterialEXT ; .type glIndexMaterialEXT,#function
- .globl glIndexFuncEXT ; .type glIndexFuncEXT,#function
- .globl glLockArraysEXT ; .type glLockArraysEXT,#function
- .globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function
- .globl glCullParameterdvEXT ; .type glCullParameterdvEXT,#function
- .globl glCullParameterfvEXT ; .type glCullParameterfvEXT,#function
- .globl glHintPGI ; .type glHintPGI,#function
- .globl glFogCoordfEXT ; .type glFogCoordfEXT,#function
- .globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function
- .globl glFogCoorddEXT ; .type glFogCoorddEXT,#function
- .globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function
- .globl glFogCoordPointerEXT ; .type glFogCoordPointerEXT,#function
- .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function
- .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function
- .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function
- .globl glTbufferMask3DFX ; .type glTbufferMask3DFX,#function
- .globl glCompressedTexImage3DARB ; .type glCompressedTexImage3DARB,#function
- .globl glCompressedTexImage2DARB ; .type glCompressedTexImage2DARB,#function
- .globl glCompressedTexImage1DARB ; .type glCompressedTexImage1DARB,#function
- .globl glCompressedTexSubImage3DARB ; .type glCompressedTexSubImage3DARB,#function
- .globl glCompressedTexSubImage2DARB ; .type glCompressedTexSubImage2DARB,#function
- .globl glCompressedTexSubImage1DARB ; .type glCompressedTexSubImage1DARB,#function
- .globl glGetCompressedTexImageARB ; .type glGetCompressedTexImageARB,#function
- .globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function
- .globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function
- .globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function
- .globl glSecondaryColor3dvEXT ; .type glSecondaryColor3dvEXT,#function
- .globl glSecondaryColor3fEXT ; .type glSecondaryColor3fEXT,#function
- .globl glSecondaryColor3fvEXT ; .type glSecondaryColor3fvEXT,#function
- .globl glSecondaryColor3iEXT ; .type glSecondaryColor3iEXT,#function
- .globl glSecondaryColor3ivEXT ; .type glSecondaryColor3ivEXT,#function
- .globl glSecondaryColor3sEXT ; .type glSecondaryColor3sEXT,#function
- .globl glSecondaryColor3svEXT ; .type glSecondaryColor3svEXT,#function
- .globl glSecondaryColor3ubEXT ; .type glSecondaryColor3ubEXT,#function
- .globl glSecondaryColor3ubvEXT ; .type glSecondaryColor3ubvEXT,#function
- .globl glSecondaryColor3uiEXT ; .type glSecondaryColor3uiEXT,#function
- .globl glSecondaryColor3uivEXT ; .type glSecondaryColor3uivEXT,#function
- .globl glSecondaryColor3usEXT ; .type glSecondaryColor3usEXT,#function
- .globl glSecondaryColor3usvEXT ; .type glSecondaryColor3usvEXT,#function
- .globl glSecondaryColorPointerEXT ; .type glSecondaryColorPointerEXT,#function
- .globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function
- .globl glBindProgramNV ; .type glBindProgramNV,#function
- .globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function
- .globl glExecuteProgramNV ; .type glExecuteProgramNV,#function
- .globl glGenProgramsNV ; .type glGenProgramsNV,#function
- .globl glGetProgramParameterdvNV ; .type glGetProgramParameterdvNV,#function
- .globl glGetProgramParameterfvNV ; .type glGetProgramParameterfvNV,#function
- .globl glGetProgramivNV ; .type glGetProgramivNV,#function
- .globl glGetProgramStringNV ; .type glGetProgramStringNV,#function
- .globl glGetTrackMatrixivNV ; .type glGetTrackMatrixivNV,#function
- .globl glGetVertexAttribdvARB ; .type glGetVertexAttribdvARB,#function
- .globl glGetVertexAttribfvARB ; .type glGetVertexAttribfvARB,#function
- .globl glGetVertexAttribivARB ; .type glGetVertexAttribivARB,#function
- .globl glGetVertexAttribPointervNV ; .type glGetVertexAttribPointervNV,#function
- .globl glIsProgramNV ; .type glIsProgramNV,#function
- .globl glLoadProgramNV ; .type glLoadProgramNV,#function
- .globl glProgramParameter4dNV ; .type glProgramParameter4dNV,#function
- .globl glProgramParameter4dvNV ; .type glProgramParameter4dvNV,#function
- .globl glProgramParameter4fNV ; .type glProgramParameter4fNV,#function
- .globl glProgramParameter4fvNV ; .type glProgramParameter4fvNV,#function
- .globl glProgramParameters4dvNV ; .type glProgramParameters4dvNV,#function
- .globl glProgramParameters4fvNV ; .type glProgramParameters4fvNV,#function
- .globl glRequestResidentProgramsNV ; .type glRequestResidentProgramsNV,#function
- .globl glTrackMatrixNV ; .type glTrackMatrixNV,#function
- .globl glVertexAttribPointerNV ; .type glVertexAttribPointerNV,#function
- .globl glVertexAttrib1dARB ; .type glVertexAttrib1dARB,#function
- .globl glVertexAttrib1dvARB ; .type glVertexAttrib1dvARB,#function
- .globl glVertexAttrib1fARB ; .type glVertexAttrib1fARB,#function
- .globl glVertexAttrib1fvARB ; .type glVertexAttrib1fvARB,#function
- .globl glVertexAttrib1sARB ; .type glVertexAttrib1sARB,#function
- .globl glVertexAttrib1svARB ; .type glVertexAttrib1svARB,#function
- .globl glVertexAttrib2dARB ; .type glVertexAttrib2dARB,#function
- .globl glVertexAttrib2dvARB ; .type glVertexAttrib2dvARB,#function
- .globl glVertexAttrib2fARB ; .type glVertexAttrib2fARB,#function
- .globl glVertexAttrib2fvARB ; .type glVertexAttrib2fvARB,#function
- .globl glVertexAttrib2sARB ; .type glVertexAttrib2sARB,#function
- .globl glVertexAttrib2svARB ; .type glVertexAttrib2svARB,#function
- .globl glVertexAttrib3dARB ; .type glVertexAttrib3dARB,#function
- .globl glVertexAttrib3dvARB ; .type glVertexAttrib3dvARB,#function
- .globl glVertexAttrib3fARB ; .type glVertexAttrib3fARB,#function
- .globl glVertexAttrib3fvARB ; .type glVertexAttrib3fvARB,#function
- .globl glVertexAttrib3sARB ; .type glVertexAttrib3sARB,#function
- .globl glVertexAttrib3svARB ; .type glVertexAttrib3svARB,#function
- .globl glVertexAttrib4dARB ; .type glVertexAttrib4dARB,#function
- .globl glVertexAttrib4dvARB ; .type glVertexAttrib4dvARB,#function
- .globl glVertexAttrib4fARB ; .type glVertexAttrib4fARB,#function
- .globl glVertexAttrib4fvARB ; .type glVertexAttrib4fvARB,#function
- .globl glVertexAttrib4sARB ; .type glVertexAttrib4sARB,#function
- .globl glVertexAttrib4svARB ; .type glVertexAttrib4svARB,#function
- .globl glVertexAttrib4NubARB ; .type glVertexAttrib4NubARB,#function
- .globl glVertexAttrib4NubvARB ; .type glVertexAttrib4NubvARB,#function
- .globl glVertexAttribs1dvNV ; .type glVertexAttribs1dvNV,#function
- .globl glVertexAttribs1fvNV ; .type glVertexAttribs1fvNV,#function
- .globl glVertexAttribs1svNV ; .type glVertexAttribs1svNV,#function
- .globl glVertexAttribs2dvNV ; .type glVertexAttribs2dvNV,#function
- .globl glVertexAttribs2fvNV ; .type glVertexAttribs2fvNV,#function
- .globl glVertexAttribs2svNV ; .type glVertexAttribs2svNV,#function
- .globl glVertexAttribs3dvNV ; .type glVertexAttribs3dvNV,#function
- .globl glVertexAttribs3fvNV ; .type glVertexAttribs3fvNV,#function
- .globl glVertexAttribs3svNV ; .type glVertexAttribs3svNV,#function
- .globl glVertexAttribs4dvNV ; .type glVertexAttribs4dvNV,#function
- .globl glVertexAttribs4fvNV ; .type glVertexAttribs4fvNV,#function
- .globl glVertexAttribs4svNV ; .type glVertexAttribs4svNV,#function
- .globl glVertexAttribs4ubvNV ; .type glVertexAttribs4ubvNV,#function
- .globl glPointParameteriNV ; .type glPointParameteriNV,#function
- .globl glPointParameterivNV ; .type glPointParameterivNV,#function
- .globl glMultiDrawArraysEXT ; .type glMultiDrawArraysEXT,#function
- .globl glMultiDrawElementsEXT ; .type glMultiDrawElementsEXT,#function
- .globl glActiveStencilFaceEXT ; .type glActiveStencilFaceEXT,#function
- .globl glDeleteFencesNV ; .type glDeleteFencesNV,#function
- .globl glGenFencesNV ; .type glGenFencesNV,#function
- .globl glIsFenceNV ; .type glIsFenceNV,#function
- .globl glTestFenceNV ; .type glTestFenceNV,#function
- .globl glGetFenceivNV ; .type glGetFenceivNV,#function
- .globl glFinishFenceNV ; .type glFinishFenceNV,#function
- .globl glSetFenceNV ; .type glSetFenceNV,#function
- .globl glVertexAttrib4bvARB ; .type glVertexAttrib4bvARB,#function
- .globl glVertexAttrib4ivARB ; .type glVertexAttrib4ivARB,#function
- .globl glVertexAttrib4ubvARB ; .type glVertexAttrib4ubvARB,#function
- .globl glVertexAttrib4usvARB ; .type glVertexAttrib4usvARB,#function
- .globl glVertexAttrib4uivARB ; .type glVertexAttrib4uivARB,#function
- .globl glVertexAttrib4NbvARB ; .type glVertexAttrib4NbvARB,#function
- .globl glVertexAttrib4NsvARB ; .type glVertexAttrib4NsvARB,#function
- .globl glVertexAttrib4NivARB ; .type glVertexAttrib4NivARB,#function
- .globl glVertexAttrib4NusvARB ; .type glVertexAttrib4NusvARB,#function
- .globl glVertexAttrib4NuivARB ; .type glVertexAttrib4NuivARB,#function
- .globl glVertexAttribPointerARB ; .type glVertexAttribPointerARB,#function
- .globl glEnableVertexAttribArrayARB ; .type glEnableVertexAttribArrayARB,#function
- .globl glDisableVertexAttribArrayARB ; .type glDisableVertexAttribArrayARB,#function
- .globl glProgramStringARB ; .type glProgramStringARB,#function
- .globl glProgramEnvParameter4dARB ; .type glProgramEnvParameter4dARB,#function
- .globl glProgramEnvParameter4dvARB ; .type glProgramEnvParameter4dvARB,#function
- .globl glProgramEnvParameter4fARB ; .type glProgramEnvParameter4fARB,#function
- .globl glProgramEnvParameter4fvARB ; .type glProgramEnvParameter4fvARB,#function
- .globl glProgramLocalParameter4dARB ; .type glProgramLocalParameter4dARB,#function
- .globl glProgramLocalParameter4dvARB ; .type glProgramLocalParameter4dvARB,#function
- .globl glProgramLocalParameter4fARB ; .type glProgramLocalParameter4fARB,#function
- .globl glProgramLocalParameter4fvARB ; .type glProgramLocalParameter4fvARB,#function
- .globl glGetProgramEnvParameterdvARB ; .type glGetProgramEnvParameterdvARB,#function
- .globl glGetProgramEnvParameterfvARB ; .type glGetProgramEnvParameterfvARB,#function
- .globl glGetProgramLocalParameterdvARB ; .type glGetProgramLocalParameterdvARB,#function
- .globl glGetProgramLocalParameterfvARB ; .type glGetProgramLocalParameterfvARB,#function
- .globl glGetProgramivARB ; .type glGetProgramivARB,#function
- .globl glGetProgramStringARB ; .type glGetProgramStringARB,#function
- .globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function
- .globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function
- .globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function
- .globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function
- .globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function
- .globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function
- .globl glBindBufferARB ; .type glBindBufferARB,#function
- .globl glBufferDataARB ; .type glBufferDataARB,#function
- .globl glBufferSubDataARB ; .type glBufferSubDataARB,#function
- .globl glDeleteBuffersARB ; .type glDeleteBuffersARB,#function
- .globl glGenBuffersARB ; .type glGenBuffersARB,#function
- .globl glGetBufferParameterivARB ; .type glGetBufferParameterivARB,#function
- .globl glGetBufferPointervARB ; .type glGetBufferPointervARB,#function
- .globl glGetBufferSubDataARB ; .type glGetBufferSubDataARB,#function
- .globl glIsBufferARB ; .type glIsBufferARB,#function
- .globl glMapBufferARB ; .type glMapBufferARB,#function
- .globl glUnmapBufferARB ; .type glUnmapBufferARB,#function
- .globl glDepthBoundsEXT ; .type glDepthBoundsEXT,#function
- .globl glGenQueriesARB ; .type glGenQueriesARB,#function
- .globl glDeleteQueriesARB ; .type glDeleteQueriesARB,#function
- .globl glIsQueryARB ; .type glIsQueryARB,#function
- .globl glBeginQueryARB ; .type glBeginQueryARB,#function
- .globl glEndQueryARB ; .type glEndQueryARB,#function
- .globl glGetQueryivARB ; .type glGetQueryivARB,#function
- .globl glGetQueryObjectivARB ; .type glGetQueryObjectivARB,#function
- .globl glGetQueryObjectuivARB ; .type glGetQueryObjectuivARB,#function
- .globl glMultiModeDrawArraysIBM ; .type glMultiModeDrawArraysIBM,#function
- .globl glMultiModeDrawElementsIBM ; .type glMultiModeDrawElementsIBM,#function
- .globl glBlendEquationSeparateEXT ; .type glBlendEquationSeparateEXT,#function
- .globl glDeleteObjectARB ; .type glDeleteObjectARB,#function
- .globl glGetHandleARB ; .type glGetHandleARB,#function
- .globl glDetachObjectARB ; .type glDetachObjectARB,#function
- .globl glCreateShaderObjectARB ; .type glCreateShaderObjectARB,#function
- .globl glShaderSourceARB ; .type glShaderSourceARB,#function
- .globl glCompileShaderARB ; .type glCompileShaderARB,#function
- .globl glCreateProgramObjectARB ; .type glCreateProgramObjectARB,#function
- .globl glAttachObjectARB ; .type glAttachObjectARB,#function
- .globl glLinkProgramARB ; .type glLinkProgramARB,#function
- .globl glUseProgramObjectARB ; .type glUseProgramObjectARB,#function
- .globl glValidateProgramARB ; .type glValidateProgramARB,#function
- .globl glUniform1fARB ; .type glUniform1fARB,#function
- .globl glUniform2fARB ; .type glUniform2fARB,#function
- .globl glUniform3fARB ; .type glUniform3fARB,#function
- .globl glUniform4fARB ; .type glUniform4fARB,#function
- .globl glUniform1iARB ; .type glUniform1iARB,#function
- .globl glUniform2iARB ; .type glUniform2iARB,#function
- .globl glUniform3iARB ; .type glUniform3iARB,#function
- .globl glUniform4iARB ; .type glUniform4iARB,#function
- .globl glUniform1fvARB ; .type glUniform1fvARB,#function
- .globl glUniform2fvARB ; .type glUniform2fvARB,#function
- .globl glUniform3fvARB ; .type glUniform3fvARB,#function
- .globl glUniform4fvARB ; .type glUniform4fvARB,#function
- .globl glUniform1ivARB ; .type glUniform1ivARB,#function
- .globl glUniform2ivARB ; .type glUniform2ivARB,#function
- .globl glUniform3ivARB ; .type glUniform3ivARB,#function
- .globl glUniform4ivARB ; .type glUniform4ivARB,#function
- .globl glUniformMatrix2fvARB ; .type glUniformMatrix2fvARB,#function
- .globl glUniformMatrix3fvARB ; .type glUniformMatrix3fvARB,#function
- .globl glUniformMatrix4fvARB ; .type glUniformMatrix4fvARB,#function
- .globl glGetObjectParameterfvARB ; .type glGetObjectParameterfvARB,#function
- .globl glGetObjectParameterivARB ; .type glGetObjectParameterivARB,#function
- .globl glGetInfoLogARB ; .type glGetInfoLogARB,#function
- .globl glGetAttachedObjectsARB ; .type glGetAttachedObjectsARB,#function
- .globl glGetUniformLocationARB ; .type glGetUniformLocationARB,#function
- .globl glGetActiveUniformARB ; .type glGetActiveUniformARB,#function
- .globl glGetUniformfvARB ; .type glGetUniformfvARB,#function
- .globl glGetUniformivARB ; .type glGetUniformivARB,#function
- .globl glGetShaderSourceARB ; .type glGetShaderSourceARB,#function
- .globl glBindAttribLocationARB ; .type glBindAttribLocationARB,#function
- .globl glGetActiveAttribARB ; .type glGetActiveAttribARB,#function
- .globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function
- .globl glGetVertexAttribdvNV ; .type glGetVertexAttribdvNV,#function
- .globl glGetVertexAttribfvNV ; .type glGetVertexAttribfvNV,#function
- .globl glGetVertexAttribivNV ; .type glGetVertexAttribivNV,#function
- .globl glVertexAttrib1dNV ; .type glVertexAttrib1dNV,#function
- .globl glVertexAttrib1dvNV ; .type glVertexAttrib1dvNV,#function
- .globl glVertexAttrib1fNV ; .type glVertexAttrib1fNV,#function
- .globl glVertexAttrib1fvNV ; .type glVertexAttrib1fvNV,#function
- .globl glVertexAttrib1sNV ; .type glVertexAttrib1sNV,#function
- .globl glVertexAttrib1svNV ; .type glVertexAttrib1svNV,#function
- .globl glVertexAttrib2dNV ; .type glVertexAttrib2dNV,#function
- .globl glVertexAttrib2dvNV ; .type glVertexAttrib2dvNV,#function
- .globl glVertexAttrib2fNV ; .type glVertexAttrib2fNV,#function
- .globl glVertexAttrib2fvNV ; .type glVertexAttrib2fvNV,#function
- .globl glVertexAttrib2sNV ; .type glVertexAttrib2sNV,#function
- .globl glVertexAttrib2svNV ; .type glVertexAttrib2svNV,#function
- .globl glVertexAttrib3dNV ; .type glVertexAttrib3dNV,#function
- .globl glVertexAttrib3dvNV ; .type glVertexAttrib3dvNV,#function
- .globl glVertexAttrib3fNV ; .type glVertexAttrib3fNV,#function
- .globl glVertexAttrib3fvNV ; .type glVertexAttrib3fvNV,#function
- .globl glVertexAttrib3sNV ; .type glVertexAttrib3sNV,#function
- .globl glVertexAttrib3svNV ; .type glVertexAttrib3svNV,#function
- .globl glVertexAttrib4dNV ; .type glVertexAttrib4dNV,#function
- .globl glVertexAttrib4dvNV ; .type glVertexAttrib4dvNV,#function
- .globl glVertexAttrib4fNV ; .type glVertexAttrib4fNV,#function
- .globl glVertexAttrib4fvNV ; .type glVertexAttrib4fvNV,#function
- .globl glVertexAttrib4sNV ; .type glVertexAttrib4sNV,#function
- .globl glVertexAttrib4svNV ; .type glVertexAttrib4svNV,#function
- .globl glVertexAttrib4ubNV ; .type glVertexAttrib4ubNV,#function
- .globl glVertexAttrib4ubvNV ; .type glVertexAttrib4ubvNV,#function
- .globl glGenFragmentShadersATI ; .type glGenFragmentShadersATI,#function
- .globl glBindFragmentShaderATI ; .type glBindFragmentShaderATI,#function
- .globl glDeleteFragmentShaderATI ; .type glDeleteFragmentShaderATI,#function
- .globl glBeginFragmentShaderATI ; .type glBeginFragmentShaderATI,#function
- .globl glEndFragmentShaderATI ; .type glEndFragmentShaderATI,#function
- .globl glPassTexCoordATI ; .type glPassTexCoordATI,#function
- .globl glSampleMapATI ; .type glSampleMapATI,#function
- .globl glColorFragmentOp1ATI ; .type glColorFragmentOp1ATI,#function
- .globl glColorFragmentOp2ATI ; .type glColorFragmentOp2ATI,#function
- .globl glColorFragmentOp3ATI ; .type glColorFragmentOp3ATI,#function
- .globl glAlphaFragmentOp1ATI ; .type glAlphaFragmentOp1ATI,#function
- .globl glAlphaFragmentOp2ATI ; .type glAlphaFragmentOp2ATI,#function
- .globl glAlphaFragmentOp3ATI ; .type glAlphaFragmentOp3ATI,#function
- .globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function
- .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function
- .globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function
- .globl glDeleteRenderbuffersEXT ; .type glDeleteRenderbuffersEXT,#function
- .globl glGenRenderbuffersEXT ; .type glGenRenderbuffersEXT,#function
- .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function
- .globl glGetRenderbufferParameterivEXT ; .type glGetRenderbufferParameterivEXT,#function
- .globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function
- .globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function
- .globl glDeleteFramebuffersEXT ; .type glDeleteFramebuffersEXT,#function
- .globl glGenFramebuffersEXT ; .type glGenFramebuffersEXT,#function
- .globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function
- .globl glFramebufferTexture1DEXT ; .type glFramebufferTexture1DEXT,#function
- .globl glFramebufferTexture2DEXT ; .type glFramebufferTexture2DEXT,#function
- .globl glFramebufferTexture3DEXT ; .type glFramebufferTexture3DEXT,#function
- .globl glFramebufferRenderbufferEXT ; .type glFramebufferRenderbufferEXT,#function
- .globl glGetFramebufferAttachmentParameterivEXT ; .type glGetFramebufferAttachmentParameterivEXT,#function
- .globl glGenerateMipmapEXT ; .type glGenerateMipmapEXT,#function
- .globl glStencilFuncSeparate ; .type glStencilFuncSeparate,#function
- .globl glStencilOpSeparate ; .type glStencilOpSeparate,#function
- .globl glStencilMaskSeparate ; .type glStencilMaskSeparate,#function
- .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function
-_mesa_sparc_glapi_begin:
-
- GL_STUB(glNewList, _gloffset_NewList)
- GL_STUB(glEndList, _gloffset_EndList)
- GL_STUB(glCallList, _gloffset_CallList)
- GL_STUB(glCallLists, _gloffset_CallLists)
- GL_STUB(glDeleteLists, _gloffset_DeleteLists)
- GL_STUB(glGenLists, _gloffset_GenLists)
- GL_STUB(glListBase, _gloffset_ListBase)
- GL_STUB(glBegin, _gloffset_Begin)
- GL_STUB(glBitmap, _gloffset_Bitmap)
- GL_STUB(glColor3b, _gloffset_Color3b)
- GL_STUB(glColor3bv, _gloffset_Color3bv)
- GL_STUB(glColor3d, _gloffset_Color3d)
- GL_STUB(glColor3dv, _gloffset_Color3dv)
- GL_STUB(glColor3f, _gloffset_Color3f)
- GL_STUB(glColor3fv, _gloffset_Color3fv)
- GL_STUB(glColor3i, _gloffset_Color3i)
- GL_STUB(glColor3iv, _gloffset_Color3iv)
- GL_STUB(glColor3s, _gloffset_Color3s)
- GL_STUB(glColor3sv, _gloffset_Color3sv)
- GL_STUB(glColor3ub, _gloffset_Color3ub)
- GL_STUB(glColor3ubv, _gloffset_Color3ubv)
- GL_STUB(glColor3ui, _gloffset_Color3ui)
- GL_STUB(glColor3uiv, _gloffset_Color3uiv)
- GL_STUB(glColor3us, _gloffset_Color3us)
- GL_STUB(glColor3usv, _gloffset_Color3usv)
- GL_STUB(glColor4b, _gloffset_Color4b)
- GL_STUB(glColor4bv, _gloffset_Color4bv)
- GL_STUB(glColor4d, _gloffset_Color4d)
- GL_STUB(glColor4dv, _gloffset_Color4dv)
- GL_STUB(glColor4f, _gloffset_Color4f)
- GL_STUB(glColor4fv, _gloffset_Color4fv)
- GL_STUB(glColor4i, _gloffset_Color4i)
- GL_STUB(glColor4iv, _gloffset_Color4iv)
- GL_STUB(glColor4s, _gloffset_Color4s)
- GL_STUB(glColor4sv, _gloffset_Color4sv)
- GL_STUB(glColor4ub, _gloffset_Color4ub)
- GL_STUB(glColor4ubv, _gloffset_Color4ubv)
- GL_STUB(glColor4ui, _gloffset_Color4ui)
- GL_STUB(glColor4uiv, _gloffset_Color4uiv)
- GL_STUB(glColor4us, _gloffset_Color4us)
- GL_STUB(glColor4usv, _gloffset_Color4usv)
- GL_STUB(glEdgeFlag, _gloffset_EdgeFlag)
- GL_STUB(glEdgeFlagv, _gloffset_EdgeFlagv)
- GL_STUB(glEnd, _gloffset_End)
- GL_STUB(glIndexd, _gloffset_Indexd)
- GL_STUB(glIndexdv, _gloffset_Indexdv)
- GL_STUB(glIndexf, _gloffset_Indexf)
- GL_STUB(glIndexfv, _gloffset_Indexfv)
- GL_STUB(glIndexi, _gloffset_Indexi)
- GL_STUB(glIndexiv, _gloffset_Indexiv)
- GL_STUB(glIndexs, _gloffset_Indexs)
- GL_STUB(glIndexsv, _gloffset_Indexsv)
- GL_STUB(glNormal3b, _gloffset_Normal3b)
- GL_STUB(glNormal3bv, _gloffset_Normal3bv)
- GL_STUB(glNormal3d, _gloffset_Normal3d)
- GL_STUB(glNormal3dv, _gloffset_Normal3dv)
- GL_STUB(glNormal3f, _gloffset_Normal3f)
- GL_STUB(glNormal3fv, _gloffset_Normal3fv)
- GL_STUB(glNormal3i, _gloffset_Normal3i)
- GL_STUB(glNormal3iv, _gloffset_Normal3iv)
- GL_STUB(glNormal3s, _gloffset_Normal3s)
- GL_STUB(glNormal3sv, _gloffset_Normal3sv)
- GL_STUB(glRasterPos2d, _gloffset_RasterPos2d)
- GL_STUB(glRasterPos2dv, _gloffset_RasterPos2dv)
- GL_STUB(glRasterPos2f, _gloffset_RasterPos2f)
- GL_STUB(glRasterPos2fv, _gloffset_RasterPos2fv)
- GL_STUB(glRasterPos2i, _gloffset_RasterPos2i)
- GL_STUB(glRasterPos2iv, _gloffset_RasterPos2iv)
- GL_STUB(glRasterPos2s, _gloffset_RasterPos2s)
- GL_STUB(glRasterPos2sv, _gloffset_RasterPos2sv)
- GL_STUB(glRasterPos3d, _gloffset_RasterPos3d)
- GL_STUB(glRasterPos3dv, _gloffset_RasterPos3dv)
- GL_STUB(glRasterPos3f, _gloffset_RasterPos3f)
- GL_STUB(glRasterPos3fv, _gloffset_RasterPos3fv)
- GL_STUB(glRasterPos3i, _gloffset_RasterPos3i)
- GL_STUB(glRasterPos3iv, _gloffset_RasterPos3iv)
- GL_STUB(glRasterPos3s, _gloffset_RasterPos3s)
- GL_STUB(glRasterPos3sv, _gloffset_RasterPos3sv)
- GL_STUB(glRasterPos4d, _gloffset_RasterPos4d)
- GL_STUB(glRasterPos4dv, _gloffset_RasterPos4dv)
- GL_STUB(glRasterPos4f, _gloffset_RasterPos4f)
- GL_STUB(glRasterPos4fv, _gloffset_RasterPos4fv)
- GL_STUB(glRasterPos4i, _gloffset_RasterPos4i)
- GL_STUB(glRasterPos4iv, _gloffset_RasterPos4iv)
- GL_STUB(glRasterPos4s, _gloffset_RasterPos4s)
- GL_STUB(glRasterPos4sv, _gloffset_RasterPos4sv)
- GL_STUB(glRectd, _gloffset_Rectd)
- GL_STUB(glRectdv, _gloffset_Rectdv)
- GL_STUB(glRectf, _gloffset_Rectf)
- GL_STUB(glRectfv, _gloffset_Rectfv)
- GL_STUB(glRecti, _gloffset_Recti)
- GL_STUB(glRectiv, _gloffset_Rectiv)
- GL_STUB(glRects, _gloffset_Rects)
- GL_STUB(glRectsv, _gloffset_Rectsv)
- GL_STUB(glTexCoord1d, _gloffset_TexCoord1d)
- GL_STUB(glTexCoord1dv, _gloffset_TexCoord1dv)
- GL_STUB(glTexCoord1f, _gloffset_TexCoord1f)
- GL_STUB(glTexCoord1fv, _gloffset_TexCoord1fv)
- GL_STUB(glTexCoord1i, _gloffset_TexCoord1i)
- GL_STUB(glTexCoord1iv, _gloffset_TexCoord1iv)
- GL_STUB(glTexCoord1s, _gloffset_TexCoord1s)
- GL_STUB(glTexCoord1sv, _gloffset_TexCoord1sv)
- GL_STUB(glTexCoord2d, _gloffset_TexCoord2d)
- GL_STUB(glTexCoord2dv, _gloffset_TexCoord2dv)
- GL_STUB(glTexCoord2f, _gloffset_TexCoord2f)
- GL_STUB(glTexCoord2fv, _gloffset_TexCoord2fv)
- GL_STUB(glTexCoord2i, _gloffset_TexCoord2i)
- GL_STUB(glTexCoord2iv, _gloffset_TexCoord2iv)
- GL_STUB(glTexCoord2s, _gloffset_TexCoord2s)
- GL_STUB(glTexCoord2sv, _gloffset_TexCoord2sv)
- GL_STUB(glTexCoord3d, _gloffset_TexCoord3d)
- GL_STUB(glTexCoord3dv, _gloffset_TexCoord3dv)
- GL_STUB(glTexCoord3f, _gloffset_TexCoord3f)
- GL_STUB(glTexCoord3fv, _gloffset_TexCoord3fv)
- GL_STUB(glTexCoord3i, _gloffset_TexCoord3i)
- GL_STUB(glTexCoord3iv, _gloffset_TexCoord3iv)
- GL_STUB(glTexCoord3s, _gloffset_TexCoord3s)
- GL_STUB(glTexCoord3sv, _gloffset_TexCoord3sv)
- GL_STUB(glTexCoord4d, _gloffset_TexCoord4d)
- GL_STUB(glTexCoord4dv, _gloffset_TexCoord4dv)
- GL_STUB(glTexCoord4f, _gloffset_TexCoord4f)
- GL_STUB(glTexCoord4fv, _gloffset_TexCoord4fv)
- GL_STUB(glTexCoord4i, _gloffset_TexCoord4i)
- GL_STUB(glTexCoord4iv, _gloffset_TexCoord4iv)
- GL_STUB(glTexCoord4s, _gloffset_TexCoord4s)
- GL_STUB(glTexCoord4sv, _gloffset_TexCoord4sv)
- GL_STUB(glVertex2d, _gloffset_Vertex2d)
- GL_STUB(glVertex2dv, _gloffset_Vertex2dv)
- GL_STUB(glVertex2f, _gloffset_Vertex2f)
- GL_STUB(glVertex2fv, _gloffset_Vertex2fv)
- GL_STUB(glVertex2i, _gloffset_Vertex2i)
- GL_STUB(glVertex2iv, _gloffset_Vertex2iv)
- GL_STUB(glVertex2s, _gloffset_Vertex2s)
- GL_STUB(glVertex2sv, _gloffset_Vertex2sv)
- GL_STUB(glVertex3d, _gloffset_Vertex3d)
- GL_STUB(glVertex3dv, _gloffset_Vertex3dv)
- GL_STUB(glVertex3f, _gloffset_Vertex3f)
- GL_STUB(glVertex3fv, _gloffset_Vertex3fv)
- GL_STUB(glVertex3i, _gloffset_Vertex3i)
- GL_STUB(glVertex3iv, _gloffset_Vertex3iv)
- GL_STUB(glVertex3s, _gloffset_Vertex3s)
- GL_STUB(glVertex3sv, _gloffset_Vertex3sv)
- GL_STUB(glVertex4d, _gloffset_Vertex4d)
- GL_STUB(glVertex4dv, _gloffset_Vertex4dv)
- GL_STUB(glVertex4f, _gloffset_Vertex4f)
- GL_STUB(glVertex4fv, _gloffset_Vertex4fv)
- GL_STUB(glVertex4i, _gloffset_Vertex4i)
- GL_STUB(glVertex4iv, _gloffset_Vertex4iv)
- GL_STUB(glVertex4s, _gloffset_Vertex4s)
- GL_STUB(glVertex4sv, _gloffset_Vertex4sv)
- GL_STUB(glClipPlane, _gloffset_ClipPlane)
- GL_STUB(glColorMaterial, _gloffset_ColorMaterial)
- GL_STUB(glCullFace, _gloffset_CullFace)
- GL_STUB(glFogf, _gloffset_Fogf)
- GL_STUB(glFogfv, _gloffset_Fogfv)
- GL_STUB(glFogi, _gloffset_Fogi)
- GL_STUB(glFogiv, _gloffset_Fogiv)
- GL_STUB(glFrontFace, _gloffset_FrontFace)
- GL_STUB(glHint, _gloffset_Hint)
- GL_STUB(glLightf, _gloffset_Lightf)
- GL_STUB(glLightfv, _gloffset_Lightfv)
- GL_STUB(glLighti, _gloffset_Lighti)
- GL_STUB(glLightiv, _gloffset_Lightiv)
- GL_STUB(glLightModelf, _gloffset_LightModelf)
- GL_STUB(glLightModelfv, _gloffset_LightModelfv)
- GL_STUB(glLightModeli, _gloffset_LightModeli)
- GL_STUB(glLightModeliv, _gloffset_LightModeliv)
- GL_STUB(glLineStipple, _gloffset_LineStipple)
- GL_STUB(glLineWidth, _gloffset_LineWidth)
- GL_STUB(glMaterialf, _gloffset_Materialf)
- GL_STUB(glMaterialfv, _gloffset_Materialfv)
- GL_STUB(glMateriali, _gloffset_Materiali)
- GL_STUB(glMaterialiv, _gloffset_Materialiv)
- GL_STUB(glPointSize, _gloffset_PointSize)
- GL_STUB(glPolygonMode, _gloffset_PolygonMode)
- GL_STUB(glPolygonStipple, _gloffset_PolygonStipple)
- GL_STUB(glScissor, _gloffset_Scissor)
- GL_STUB(glShadeModel, _gloffset_ShadeModel)
- GL_STUB(glTexParameterf, _gloffset_TexParameterf)
- GL_STUB(glTexParameterfv, _gloffset_TexParameterfv)
- GL_STUB(glTexParameteri, _gloffset_TexParameteri)
- GL_STUB(glTexParameteriv, _gloffset_TexParameteriv)
- GL_STUB(glTexImage1D, _gloffset_TexImage1D)
- GL_STUB(glTexImage2D, _gloffset_TexImage2D)
- GL_STUB(glTexEnvf, _gloffset_TexEnvf)
- GL_STUB(glTexEnvfv, _gloffset_TexEnvfv)
- GL_STUB(glTexEnvi, _gloffset_TexEnvi)
- GL_STUB(glTexEnviv, _gloffset_TexEnviv)
- GL_STUB(glTexGend, _gloffset_TexGend)
- GL_STUB(glTexGendv, _gloffset_TexGendv)
- GL_STUB(glTexGenf, _gloffset_TexGenf)
- GL_STUB(glTexGenfv, _gloffset_TexGenfv)
- GL_STUB(glTexGeni, _gloffset_TexGeni)
- GL_STUB(glTexGeniv, _gloffset_TexGeniv)
- GL_STUB(glFeedbackBuffer, _gloffset_FeedbackBuffer)
- GL_STUB(glSelectBuffer, _gloffset_SelectBuffer)
- GL_STUB(glRenderMode, _gloffset_RenderMode)
- GL_STUB(glInitNames, _gloffset_InitNames)
- GL_STUB(glLoadName, _gloffset_LoadName)
- GL_STUB(glPassThrough, _gloffset_PassThrough)
- GL_STUB(glPopName, _gloffset_PopName)
- GL_STUB(glPushName, _gloffset_PushName)
- GL_STUB(glDrawBuffer, _gloffset_DrawBuffer)
- GL_STUB(glClear, _gloffset_Clear)
- GL_STUB(glClearAccum, _gloffset_ClearAccum)
- GL_STUB(glClearIndex, _gloffset_ClearIndex)
- GL_STUB(glClearColor, _gloffset_ClearColor)
- GL_STUB(glClearStencil, _gloffset_ClearStencil)
- GL_STUB(glClearDepth, _gloffset_ClearDepth)
- GL_STUB(glStencilMask, _gloffset_StencilMask)
- GL_STUB(glColorMask, _gloffset_ColorMask)
- GL_STUB(glDepthMask, _gloffset_DepthMask)
- GL_STUB(glIndexMask, _gloffset_IndexMask)
- GL_STUB(glAccum, _gloffset_Accum)
- GL_STUB(glDisable, _gloffset_Disable)
- GL_STUB(glEnable, _gloffset_Enable)
- GL_STUB(glFinish, _gloffset_Finish)
- GL_STUB(glFlush, _gloffset_Flush)
- GL_STUB(glPopAttrib, _gloffset_PopAttrib)
- GL_STUB(glPushAttrib, _gloffset_PushAttrib)
- GL_STUB(glMap1d, _gloffset_Map1d)
- GL_STUB(glMap1f, _gloffset_Map1f)
- GL_STUB(glMap2d, _gloffset_Map2d)
- GL_STUB(glMap2f, _gloffset_Map2f)
- GL_STUB(glMapGrid1d, _gloffset_MapGrid1d)
- GL_STUB(glMapGrid1f, _gloffset_MapGrid1f)
- GL_STUB(glMapGrid2d, _gloffset_MapGrid2d)
- GL_STUB(glMapGrid2f, _gloffset_MapGrid2f)
- GL_STUB(glEvalCoord1d, _gloffset_EvalCoord1d)
- GL_STUB(glEvalCoord1dv, _gloffset_EvalCoord1dv)
- GL_STUB(glEvalCoord1f, _gloffset_EvalCoord1f)
- GL_STUB(glEvalCoord1fv, _gloffset_EvalCoord1fv)
- GL_STUB(glEvalCoord2d, _gloffset_EvalCoord2d)
- GL_STUB(glEvalCoord2dv, _gloffset_EvalCoord2dv)
- GL_STUB(glEvalCoord2f, _gloffset_EvalCoord2f)
- GL_STUB(glEvalCoord2fv, _gloffset_EvalCoord2fv)
- GL_STUB(glEvalMesh1, _gloffset_EvalMesh1)
- GL_STUB(glEvalPoint1, _gloffset_EvalPoint1)
- GL_STUB(glEvalMesh2, _gloffset_EvalMesh2)
- GL_STUB(glEvalPoint2, _gloffset_EvalPoint2)
- GL_STUB(glAlphaFunc, _gloffset_AlphaFunc)
- GL_STUB(glBlendFunc, _gloffset_BlendFunc)
- GL_STUB(glLogicOp, _gloffset_LogicOp)
- GL_STUB(glStencilFunc, _gloffset_StencilFunc)
- GL_STUB(glStencilOp, _gloffset_StencilOp)
- GL_STUB(glDepthFunc, _gloffset_DepthFunc)
- GL_STUB(glPixelZoom, _gloffset_PixelZoom)
- GL_STUB(glPixelTransferf, _gloffset_PixelTransferf)
- GL_STUB(glPixelTransferi, _gloffset_PixelTransferi)
- GL_STUB(glPixelStoref, _gloffset_PixelStoref)
- GL_STUB(glPixelStorei, _gloffset_PixelStorei)
- GL_STUB(glPixelMapfv, _gloffset_PixelMapfv)
- GL_STUB(glPixelMapuiv, _gloffset_PixelMapuiv)
- GL_STUB(glPixelMapusv, _gloffset_PixelMapusv)
- GL_STUB(glReadBuffer, _gloffset_ReadBuffer)
- GL_STUB(glCopyPixels, _gloffset_CopyPixels)
- GL_STUB(glReadPixels, _gloffset_ReadPixels)
- GL_STUB(glDrawPixels, _gloffset_DrawPixels)
- GL_STUB(glGetBooleanv, _gloffset_GetBooleanv)
- GL_STUB(glGetClipPlane, _gloffset_GetClipPlane)
- GL_STUB(glGetDoublev, _gloffset_GetDoublev)
- GL_STUB(glGetError, _gloffset_GetError)
- GL_STUB(glGetFloatv, _gloffset_GetFloatv)
- GL_STUB(glGetIntegerv, _gloffset_GetIntegerv)
- GL_STUB(glGetLightfv, _gloffset_GetLightfv)
- GL_STUB(glGetLightiv, _gloffset_GetLightiv)
- GL_STUB(glGetMapdv, _gloffset_GetMapdv)
- GL_STUB(glGetMapfv, _gloffset_GetMapfv)
- GL_STUB(glGetMapiv, _gloffset_GetMapiv)
- GL_STUB(glGetMaterialfv, _gloffset_GetMaterialfv)
- GL_STUB(glGetMaterialiv, _gloffset_GetMaterialiv)
- GL_STUB(glGetPixelMapfv, _gloffset_GetPixelMapfv)
- GL_STUB(glGetPixelMapuiv, _gloffset_GetPixelMapuiv)
- GL_STUB(glGetPixelMapusv, _gloffset_GetPixelMapusv)
- GL_STUB(glGetPolygonStipple, _gloffset_GetPolygonStipple)
- GL_STUB(glGetString, _gloffset_GetString)
- GL_STUB(glGetTexEnvfv, _gloffset_GetTexEnvfv)
- GL_STUB(glGetTexEnviv, _gloffset_GetTexEnviv)
- GL_STUB(glGetTexGendv, _gloffset_GetTexGendv)
- GL_STUB(glGetTexGenfv, _gloffset_GetTexGenfv)
- GL_STUB(glGetTexGeniv, _gloffset_GetTexGeniv)
- GL_STUB(glGetTexImage, _gloffset_GetTexImage)
- GL_STUB(glGetTexParameterfv, _gloffset_GetTexParameterfv)
- GL_STUB(glGetTexParameteriv, _gloffset_GetTexParameteriv)
- GL_STUB(glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv)
- GL_STUB(glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv)
- GL_STUB(glIsEnabled, _gloffset_IsEnabled)
- GL_STUB(glIsList, _gloffset_IsList)
- GL_STUB(glDepthRange, _gloffset_DepthRange)
- GL_STUB(glFrustum, _gloffset_Frustum)
- GL_STUB(glLoadIdentity, _gloffset_LoadIdentity)
- GL_STUB(glLoadMatrixf, _gloffset_LoadMatrixf)
- GL_STUB(glLoadMatrixd, _gloffset_LoadMatrixd)
- GL_STUB(glMatrixMode, _gloffset_MatrixMode)
- GL_STUB(glMultMatrixf, _gloffset_MultMatrixf)
- GL_STUB(glMultMatrixd, _gloffset_MultMatrixd)
- GL_STUB(glOrtho, _gloffset_Ortho)
- GL_STUB(glPopMatrix, _gloffset_PopMatrix)
- GL_STUB(glPushMatrix, _gloffset_PushMatrix)
- GL_STUB(glRotated, _gloffset_Rotated)
- GL_STUB(glRotatef, _gloffset_Rotatef)
- GL_STUB(glScaled, _gloffset_Scaled)
- GL_STUB(glScalef, _gloffset_Scalef)
- GL_STUB(glTranslated, _gloffset_Translated)
- GL_STUB(glTranslatef, _gloffset_Translatef)
- GL_STUB(glViewport, _gloffset_Viewport)
- GL_STUB(glArrayElement, _gloffset_ArrayElement)
- GL_STUB(glBindTexture, _gloffset_BindTexture)
- GL_STUB(glColorPointer, _gloffset_ColorPointer)
- GL_STUB(glDisableClientState, _gloffset_DisableClientState)
- GL_STUB(glDrawArrays, _gloffset_DrawArrays)
- GL_STUB(glDrawElements, _gloffset_DrawElements)
- GL_STUB(glEdgeFlagPointer, _gloffset_EdgeFlagPointer)
- GL_STUB(glEnableClientState, _gloffset_EnableClientState)
- GL_STUB(glIndexPointer, _gloffset_IndexPointer)
- GL_STUB(glIndexub, _gloffset_Indexub)
- GL_STUB(glIndexubv, _gloffset_Indexubv)
- GL_STUB(glInterleavedArrays, _gloffset_InterleavedArrays)
- GL_STUB(glNormalPointer, _gloffset_NormalPointer)
- GL_STUB(glPolygonOffset, _gloffset_PolygonOffset)
- GL_STUB(glTexCoordPointer, _gloffset_TexCoordPointer)
- GL_STUB(glVertexPointer, _gloffset_VertexPointer)
- GL_STUB(glAreTexturesResident, _gloffset_AreTexturesResident)
- GL_STUB(glCopyTexImage1D, _gloffset_CopyTexImage1D)
- GL_STUB(glCopyTexImage2D, _gloffset_CopyTexImage2D)
- GL_STUB(glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D)
- GL_STUB(glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D)
- GL_STUB(glDeleteTextures, _gloffset_DeleteTextures)
- GL_STUB(glGenTextures, _gloffset_GenTextures)
- GL_STUB(glGetPointerv, _gloffset_GetPointerv)
- GL_STUB(glIsTexture, _gloffset_IsTexture)
- GL_STUB(glPrioritizeTextures, _gloffset_PrioritizeTextures)
- GL_STUB(glTexSubImage1D, _gloffset_TexSubImage1D)
- GL_STUB(glTexSubImage2D, _gloffset_TexSubImage2D)
- GL_STUB(glPopClientAttrib, _gloffset_PopClientAttrib)
- GL_STUB(glPushClientAttrib, _gloffset_PushClientAttrib)
- GL_STUB(glBlendColor, _gloffset_BlendColor)
- GL_STUB(glBlendEquation, _gloffset_BlendEquation)
- GL_STUB(glDrawRangeElements, _gloffset_DrawRangeElements)
- GL_STUB(glColorTable, _gloffset_ColorTable)
- GL_STUB(glColorTableParameterfv, _gloffset_ColorTableParameterfv)
- GL_STUB(glColorTableParameteriv, _gloffset_ColorTableParameteriv)
- GL_STUB(glCopyColorTable, _gloffset_CopyColorTable)
- GL_STUB(glGetColorTable, _gloffset_GetColorTable)
- GL_STUB(glGetColorTableParameterfv, _gloffset_GetColorTableParameterfv)
- GL_STUB(glGetColorTableParameteriv, _gloffset_GetColorTableParameteriv)
- GL_STUB(glColorSubTable, _gloffset_ColorSubTable)
- GL_STUB(glCopyColorSubTable, _gloffset_CopyColorSubTable)
- GL_STUB(glConvolutionFilter1D, _gloffset_ConvolutionFilter1D)
- GL_STUB(glConvolutionFilter2D, _gloffset_ConvolutionFilter2D)
- GL_STUB(glConvolutionParameterf, _gloffset_ConvolutionParameterf)
- GL_STUB(glConvolutionParameterfv, _gloffset_ConvolutionParameterfv)
- GL_STUB(glConvolutionParameteri, _gloffset_ConvolutionParameteri)
- GL_STUB(glConvolutionParameteriv, _gloffset_ConvolutionParameteriv)
- GL_STUB(glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D)
- GL_STUB(glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D)
- GL_STUB(glGetConvolutionFilter, _gloffset_GetConvolutionFilter)
- GL_STUB(glGetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv)
- GL_STUB(glGetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv)
- GL_STUB(glGetSeparableFilter, _gloffset_GetSeparableFilter)
- GL_STUB(glSeparableFilter2D, _gloffset_SeparableFilter2D)
- GL_STUB(glGetHistogram, _gloffset_GetHistogram)
- GL_STUB(glGetHistogramParameterfv, _gloffset_GetHistogramParameterfv)
- GL_STUB(glGetHistogramParameteriv, _gloffset_GetHistogramParameteriv)
- GL_STUB(glGetMinmax, _gloffset_GetMinmax)
- GL_STUB(glGetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv)
- GL_STUB(glGetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv)
- GL_STUB(glHistogram, _gloffset_Histogram)
- GL_STUB(glMinmax, _gloffset_Minmax)
- GL_STUB(glResetHistogram, _gloffset_ResetHistogram)
- GL_STUB(glResetMinmax, _gloffset_ResetMinmax)
- GL_STUB(glTexImage3D, _gloffset_TexImage3D)
- GL_STUB(glTexSubImage3D, _gloffset_TexSubImage3D)
- GL_STUB(glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D)
- GL_STUB(glActiveTextureARB, _gloffset_ActiveTextureARB)
- GL_STUB(glClientActiveTextureARB, _gloffset_ClientActiveTextureARB)
- GL_STUB(glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB)
- GL_STUB(glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB)
- GL_STUB(glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB)
- GL_STUB(glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB)
- GL_STUB(glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB)
- GL_STUB(glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB)
- GL_STUB(glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB)
- GL_STUB(glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB)
- GL_STUB(glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB)
- GL_STUB(glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB)
- GL_STUB(glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB)
- GL_STUB(glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB)
- GL_STUB(glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB)
- GL_STUB(glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB)
- GL_STUB(glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB)
- GL_STUB(glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB)
- GL_STUB(glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB)
- GL_STUB(glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB)
- GL_STUB(glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB)
- GL_STUB(glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB)
- GL_STUB(glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB)
- GL_STUB(glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB)
- GL_STUB(glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB)
- GL_STUB(glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB)
- GL_STUB(glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB)
- GL_STUB(glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB)
- GL_STUB(glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB)
- GL_STUB(glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB)
- GL_STUB(glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB)
- GL_STUB(glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB)
- GL_STUB(glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB)
- GL_STUB(glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB)
- GL_STUB(glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB)
- GL_STUB(glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB)
- GL_STUB(glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB)
- GL_STUB(glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB)
- GL_STUB(glSampleCoverageARB, _gloffset_SampleCoverageARB)
- GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB)
- GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT)
- GL_STUB(glGetTexFilterFuncSGIS, _gloffset_GetTexFilterFuncSGIS)
- GL_STUB(glTexFilterFuncSGIS, _gloffset_TexFilterFuncSGIS)
- GL_STUB(glGetHistogramEXT, _gloffset_GetHistogramEXT)
- GL_STUB(glGetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfvEXT)
- GL_STUB(glGetHistogramParameterivEXT, _gloffset_GetHistogramParameterivEXT)
- GL_STUB(glGetMinmaxEXT, _gloffset_GetMinmaxEXT)
- GL_STUB(glGetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfvEXT)
- GL_STUB(glGetMinmaxParameterivEXT, _gloffset_GetMinmaxParameterivEXT)
- GL_STUB(glGetConvolutionFilterEXT, _gloffset_GetConvolutionFilterEXT)
- GL_STUB(glGetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfvEXT)
- GL_STUB(glGetConvolutionParameterivEXT, _gloffset_GetConvolutionParameterivEXT)
- GL_STUB(glGetSeparableFilterEXT, _gloffset_GetSeparableFilterEXT)
- GL_STUB(glGetColorTableSGI, _gloffset_GetColorTableSGI)
- GL_STUB(glGetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfvSGI)
- GL_STUB(glGetColorTableParameterivSGI, _gloffset_GetColorTableParameterivSGI)
- GL_STUB(glPixelTexGenSGIX, _gloffset_PixelTexGenSGIX)
- GL_STUB(glPixelTexGenParameteriSGIS, _gloffset_PixelTexGenParameteriSGIS)
- GL_STUB(glPixelTexGenParameterivSGIS, _gloffset_PixelTexGenParameterivSGIS)
- GL_STUB(glPixelTexGenParameterfSGIS, _gloffset_PixelTexGenParameterfSGIS)
- GL_STUB(glPixelTexGenParameterfvSGIS, _gloffset_PixelTexGenParameterfvSGIS)
- GL_STUB(glGetPixelTexGenParameterivSGIS, _gloffset_GetPixelTexGenParameterivSGIS)
- GL_STUB(glGetPixelTexGenParameterfvSGIS, _gloffset_GetPixelTexGenParameterfvSGIS)
- GL_STUB(glTexImage4DSGIS, _gloffset_TexImage4DSGIS)
- GL_STUB(glTexSubImage4DSGIS, _gloffset_TexSubImage4DSGIS)
- GL_STUB(glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT)
- GL_STUB(glGenTexturesEXT, _gloffset_GenTexturesEXT)
- GL_STUB(glIsTextureEXT, _gloffset_IsTextureEXT)
- GL_STUB(glDetailTexFuncSGIS, _gloffset_DetailTexFuncSGIS)
- GL_STUB(glGetDetailTexFuncSGIS, _gloffset_GetDetailTexFuncSGIS)
- GL_STUB(glSharpenTexFuncSGIS, _gloffset_SharpenTexFuncSGIS)
- GL_STUB(glGetSharpenTexFuncSGIS, _gloffset_GetSharpenTexFuncSGIS)
- GL_STUB(glSampleMaskSGIS, _gloffset_SampleMaskSGIS)
- GL_STUB(glSamplePatternSGIS, _gloffset_SamplePatternSGIS)
- GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT)
- GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT)
- GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT)
- GL_STUB(glNormalPointerEXT, _gloffset_NormalPointerEXT)
- GL_STUB(glTexCoordPointerEXT, _gloffset_TexCoordPointerEXT)
- GL_STUB(glVertexPointerEXT, _gloffset_VertexPointerEXT)
- GL_STUB(glSpriteParameterfSGIX, _gloffset_SpriteParameterfSGIX)
- GL_STUB(glSpriteParameterfvSGIX, _gloffset_SpriteParameterfvSGIX)
- GL_STUB(glSpriteParameteriSGIX, _gloffset_SpriteParameteriSGIX)
- GL_STUB(glSpriteParameterivSGIX, _gloffset_SpriteParameterivSGIX)
- GL_STUB(glPointParameterfEXT, _gloffset_PointParameterfEXT)
- GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT)
- GL_STUB(glGetInstrumentsSGIX, _gloffset_GetInstrumentsSGIX)
- GL_STUB(glInstrumentsBufferSGIX, _gloffset_InstrumentsBufferSGIX)
- GL_STUB(glPollInstrumentsSGIX, _gloffset_PollInstrumentsSGIX)
- GL_STUB(glReadInstrumentsSGIX, _gloffset_ReadInstrumentsSGIX)
- GL_STUB(glStartInstrumentsSGIX, _gloffset_StartInstrumentsSGIX)
- GL_STUB(glStopInstrumentsSGIX, _gloffset_StopInstrumentsSGIX)
- GL_STUB(glFrameZoomSGIX, _gloffset_FrameZoomSGIX)
- GL_STUB(glTagSampleBufferSGIX, _gloffset_TagSampleBufferSGIX)
- GL_STUB(glReferencePlaneSGIX, _gloffset_ReferencePlaneSGIX)
- GL_STUB(glFlushRasterSGIX, _gloffset_FlushRasterSGIX)
- GL_STUB(glGetListParameterfvSGIX, _gloffset_GetListParameterfvSGIX)
- GL_STUB(glGetListParameterivSGIX, _gloffset_GetListParameterivSGIX)
- GL_STUB(glListParameterfSGIX, _gloffset_ListParameterfSGIX)
- GL_STUB(glListParameterfvSGIX, _gloffset_ListParameterfvSGIX)
- GL_STUB(glListParameteriSGIX, _gloffset_ListParameteriSGIX)
- GL_STUB(glListParameterivSGIX, _gloffset_ListParameterivSGIX)
- GL_STUB(glFragmentColorMaterialSGIX, _gloffset_FragmentColorMaterialSGIX)
- GL_STUB(glFragmentLightfSGIX, _gloffset_FragmentLightfSGIX)
- GL_STUB(glFragmentLightfvSGIX, _gloffset_FragmentLightfvSGIX)
- GL_STUB(glFragmentLightiSGIX, _gloffset_FragmentLightiSGIX)
- GL_STUB(glFragmentLightivSGIX, _gloffset_FragmentLightivSGIX)
- GL_STUB(glFragmentLightModelfSGIX, _gloffset_FragmentLightModelfSGIX)
- GL_STUB(glFragmentLightModelfvSGIX, _gloffset_FragmentLightModelfvSGIX)
- GL_STUB(glFragmentLightModeliSGIX, _gloffset_FragmentLightModeliSGIX)
- GL_STUB(glFragmentLightModelivSGIX, _gloffset_FragmentLightModelivSGIX)
- GL_STUB(glFragmentMaterialfSGIX, _gloffset_FragmentMaterialfSGIX)
- GL_STUB(glFragmentMaterialfvSGIX, _gloffset_FragmentMaterialfvSGIX)
- GL_STUB(glFragmentMaterialiSGIX, _gloffset_FragmentMaterialiSGIX)
- GL_STUB(glFragmentMaterialivSGIX, _gloffset_FragmentMaterialivSGIX)
- GL_STUB(glGetFragmentLightfvSGIX, _gloffset_GetFragmentLightfvSGIX)
- GL_STUB(glGetFragmentLightivSGIX, _gloffset_GetFragmentLightivSGIX)
- GL_STUB(glGetFragmentMaterialfvSGIX, _gloffset_GetFragmentMaterialfvSGIX)
- GL_STUB(glGetFragmentMaterialivSGIX, _gloffset_GetFragmentMaterialivSGIX)
- GL_STUB(glLightEnviSGIX, _gloffset_LightEnviSGIX)
- GL_STUB(glVertexWeightfEXT, _gloffset_VertexWeightfEXT)
- GL_STUB(glVertexWeightfvEXT, _gloffset_VertexWeightfvEXT)
- GL_STUB(glVertexWeightPointerEXT, _gloffset_VertexWeightPointerEXT)
- GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV)
- GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV)
- GL_STUB(glCombinerParameterfvNV, _gloffset_CombinerParameterfvNV)
- GL_STUB(glCombinerParameterfNV, _gloffset_CombinerParameterfNV)
- GL_STUB(glCombinerParameterivNV, _gloffset_CombinerParameterivNV)
- GL_STUB(glCombinerParameteriNV, _gloffset_CombinerParameteriNV)
- GL_STUB(glCombinerInputNV, _gloffset_CombinerInputNV)
- GL_STUB(glCombinerOutputNV, _gloffset_CombinerOutputNV)
- GL_STUB(glFinalCombinerInputNV, _gloffset_FinalCombinerInputNV)
- GL_STUB(glGetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV)
- GL_STUB(glGetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV)
- GL_STUB(glGetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV)
- GL_STUB(glGetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV)
- GL_STUB(glGetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV)
- GL_STUB(glGetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV)
- GL_STUB(glResizeBuffersMESA, _gloffset_ResizeBuffersMESA)
- GL_STUB(glWindowPos2dMESA, _gloffset_WindowPos2dMESA)
- GL_STUB(glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA)
- GL_STUB(glWindowPos2fMESA, _gloffset_WindowPos2fMESA)
- GL_STUB(glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA)
- GL_STUB(glWindowPos2iMESA, _gloffset_WindowPos2iMESA)
- GL_STUB(glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA)
- GL_STUB(glWindowPos2sMESA, _gloffset_WindowPos2sMESA)
- GL_STUB(glWindowPos2svMESA, _gloffset_WindowPos2svMESA)
- GL_STUB(glWindowPos3dMESA, _gloffset_WindowPos3dMESA)
- GL_STUB(glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA)
- GL_STUB(glWindowPos3fMESA, _gloffset_WindowPos3fMESA)
- GL_STUB(glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA)
- GL_STUB(glWindowPos3iMESA, _gloffset_WindowPos3iMESA)
- GL_STUB(glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA)
- GL_STUB(glWindowPos3sMESA, _gloffset_WindowPos3sMESA)
- GL_STUB(glWindowPos3svMESA, _gloffset_WindowPos3svMESA)
- GL_STUB(glWindowPos4dMESA, _gloffset_WindowPos4dMESA)
- GL_STUB(glWindowPos4dvMESA, _gloffset_WindowPos4dvMESA)
- GL_STUB(glWindowPos4fMESA, _gloffset_WindowPos4fMESA)
- GL_STUB(glWindowPos4fvMESA, _gloffset_WindowPos4fvMESA)
- GL_STUB(glWindowPos4iMESA, _gloffset_WindowPos4iMESA)
- GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA)
- GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA)
- GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA)
- GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT)
- GL_STUB(glIndexMaterialEXT, _gloffset_IndexMaterialEXT)
- GL_STUB(glIndexFuncEXT, _gloffset_IndexFuncEXT)
- GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT)
- GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT)
- GL_STUB(glCullParameterdvEXT, _gloffset_CullParameterdvEXT)
- GL_STUB(glCullParameterfvEXT, _gloffset_CullParameterfvEXT)
- GL_STUB(glHintPGI, _gloffset_HintPGI)
- GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT)
- GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT)
- GL_STUB(glFogCoorddEXT, _gloffset_FogCoorddEXT)
- GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT)
- GL_STUB(glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT)
- GL_STUB(glGetColorTableEXT, _gloffset_GetColorTableEXT)
- GL_STUB(glGetColorTableParameterivEXT, _gloffset_GetColorTableParameterivEXT)
- GL_STUB(glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfvEXT)
- GL_STUB(glTbufferMask3DFX, _gloffset_TbufferMask3DFX)
- GL_STUB(glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB)
- GL_STUB(glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB)
- GL_STUB(glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB)
- GL_STUB(glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB)
- GL_STUB(glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB)
- GL_STUB(glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB)
- GL_STUB(glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB)
- GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT)
- GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT)
- GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT)
- GL_STUB(glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT)
- GL_STUB(glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT)
- GL_STUB(glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT)
- GL_STUB(glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT)
- GL_STUB(glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT)
- GL_STUB(glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT)
- GL_STUB(glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT)
- GL_STUB(glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT)
- GL_STUB(glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT)
- GL_STUB(glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT)
- GL_STUB(glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT)
- GL_STUB(glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT)
- GL_STUB(glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT)
- GL_STUB(glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT)
- GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV)
- GL_STUB(glBindProgramNV, _gloffset_BindProgramNV)
- GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV)
- GL_STUB(glExecuteProgramNV, _gloffset_ExecuteProgramNV)
- GL_STUB(glGenProgramsNV, _gloffset_GenProgramsNV)
- GL_STUB(glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV)
- GL_STUB(glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV)
- GL_STUB(glGetProgramivNV, _gloffset_GetProgramivNV)
- GL_STUB(glGetProgramStringNV, _gloffset_GetProgramStringNV)
- GL_STUB(glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV)
- GL_STUB(glGetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB)
- GL_STUB(glGetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB)
- GL_STUB(glGetVertexAttribivARB, _gloffset_GetVertexAttribivARB)
- GL_STUB(glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV)
- GL_STUB(glIsProgramNV, _gloffset_IsProgramNV)
- GL_STUB(glLoadProgramNV, _gloffset_LoadProgramNV)
- GL_STUB(glProgramParameter4dNV, _gloffset_ProgramParameter4dNV)
- GL_STUB(glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV)
- GL_STUB(glProgramParameter4fNV, _gloffset_ProgramParameter4fNV)
- GL_STUB(glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV)
- GL_STUB(glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV)
- GL_STUB(glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV)
- GL_STUB(glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV)
- GL_STUB(glTrackMatrixNV, _gloffset_TrackMatrixNV)
- GL_STUB(glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV)
- GL_STUB(glVertexAttrib1dARB, _gloffset_VertexAttrib1dARB)
- GL_STUB(glVertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB)
- GL_STUB(glVertexAttrib1fARB, _gloffset_VertexAttrib1fARB)
- GL_STUB(glVertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB)
- GL_STUB(glVertexAttrib1sARB, _gloffset_VertexAttrib1sARB)
- GL_STUB(glVertexAttrib1svARB, _gloffset_VertexAttrib1svARB)
- GL_STUB(glVertexAttrib2dARB, _gloffset_VertexAttrib2dARB)
- GL_STUB(glVertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB)
- GL_STUB(glVertexAttrib2fARB, _gloffset_VertexAttrib2fARB)
- GL_STUB(glVertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB)
- GL_STUB(glVertexAttrib2sARB, _gloffset_VertexAttrib2sARB)
- GL_STUB(glVertexAttrib2svARB, _gloffset_VertexAttrib2svARB)
- GL_STUB(glVertexAttrib3dARB, _gloffset_VertexAttrib3dARB)
- GL_STUB(glVertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB)
- GL_STUB(glVertexAttrib3fARB, _gloffset_VertexAttrib3fARB)
- GL_STUB(glVertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB)
- GL_STUB(glVertexAttrib3sARB, _gloffset_VertexAttrib3sARB)
- GL_STUB(glVertexAttrib3svARB, _gloffset_VertexAttrib3svARB)
- GL_STUB(glVertexAttrib4dARB, _gloffset_VertexAttrib4dARB)
- GL_STUB(glVertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB)
- GL_STUB(glVertexAttrib4fARB, _gloffset_VertexAttrib4fARB)
- GL_STUB(glVertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB)
- GL_STUB(glVertexAttrib4sARB, _gloffset_VertexAttrib4sARB)
- GL_STUB(glVertexAttrib4svARB, _gloffset_VertexAttrib4svARB)
- GL_STUB(glVertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB)
- GL_STUB(glVertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB)
- GL_STUB(glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV)
- GL_STUB(glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV)
- GL_STUB(glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV)
- GL_STUB(glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV)
- GL_STUB(glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV)
- GL_STUB(glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV)
- GL_STUB(glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV)
- GL_STUB(glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV)
- GL_STUB(glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV)
- GL_STUB(glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV)
- GL_STUB(glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV)
- GL_STUB(glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV)
- GL_STUB(glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV)
- GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV)
- GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV)
- GL_STUB(glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT)
- GL_STUB(glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT)
- GL_STUB(glActiveStencilFaceEXT, _gloffset_ActiveStencilFaceEXT)
- GL_STUB(glDeleteFencesNV, _gloffset_DeleteFencesNV)
- GL_STUB(glGenFencesNV, _gloffset_GenFencesNV)
- GL_STUB(glIsFenceNV, _gloffset_IsFenceNV)
- GL_STUB(glTestFenceNV, _gloffset_TestFenceNV)
- GL_STUB(glGetFenceivNV, _gloffset_GetFenceivNV)
- GL_STUB(glFinishFenceNV, _gloffset_FinishFenceNV)
- GL_STUB(glSetFenceNV, _gloffset_SetFenceNV)
- GL_STUB(glVertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB)
- GL_STUB(glVertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB)
- GL_STUB(glVertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB)
- GL_STUB(glVertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB)
- GL_STUB(glVertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB)
- GL_STUB(glVertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB)
- GL_STUB(glVertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB)
- GL_STUB(glVertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB)
- GL_STUB(glVertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB)
- GL_STUB(glVertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB)
- GL_STUB(glVertexAttribPointerARB, _gloffset_VertexAttribPointerARB)
- GL_STUB(glEnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB)
- GL_STUB(glDisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB)
- GL_STUB(glProgramStringARB, _gloffset_ProgramStringARB)
- GL_STUB(glProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB)
- GL_STUB(glProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB)
- GL_STUB(glProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB)
- GL_STUB(glProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB)
- GL_STUB(glProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB)
- GL_STUB(glProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB)
- GL_STUB(glProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB)
- GL_STUB(glProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB)
- GL_STUB(glGetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB)
- GL_STUB(glGetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB)
- GL_STUB(glGetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB)
- GL_STUB(glGetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB)
- GL_STUB(glGetProgramivARB, _gloffset_GetProgramivARB)
- GL_STUB(glGetProgramStringARB, _gloffset_GetProgramStringARB)
- GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV)
- GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV)
- GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV)
- GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV)
- GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV)
- GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV)
- GL_STUB(glBindBufferARB, _gloffset_BindBufferARB)
- GL_STUB(glBufferDataARB, _gloffset_BufferDataARB)
- GL_STUB(glBufferSubDataARB, _gloffset_BufferSubDataARB)
- GL_STUB(glDeleteBuffersARB, _gloffset_DeleteBuffersARB)
- GL_STUB(glGenBuffersARB, _gloffset_GenBuffersARB)
- GL_STUB(glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB)
- GL_STUB(glGetBufferPointervARB, _gloffset_GetBufferPointervARB)
- GL_STUB(glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB)
- GL_STUB(glIsBufferARB, _gloffset_IsBufferARB)
- GL_STUB(glMapBufferARB, _gloffset_MapBufferARB)
- GL_STUB(glUnmapBufferARB, _gloffset_UnmapBufferARB)
- GL_STUB(glDepthBoundsEXT, _gloffset_DepthBoundsEXT)
- GL_STUB(glGenQueriesARB, _gloffset_GenQueriesARB)
- GL_STUB(glDeleteQueriesARB, _gloffset_DeleteQueriesARB)
- GL_STUB(glIsQueryARB, _gloffset_IsQueryARB)
- GL_STUB(glBeginQueryARB, _gloffset_BeginQueryARB)
- GL_STUB(glEndQueryARB, _gloffset_EndQueryARB)
- GL_STUB(glGetQueryivARB, _gloffset_GetQueryivARB)
- GL_STUB(glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB)
- GL_STUB(glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB)
- GL_STUB(glMultiModeDrawArraysIBM, _gloffset_MultiModeDrawArraysIBM)
- GL_STUB(glMultiModeDrawElementsIBM, _gloffset_MultiModeDrawElementsIBM)
- GL_STUB(glBlendEquationSeparateEXT, _gloffset_BlendEquationSeparateEXT)
- GL_STUB(glDeleteObjectARB, _gloffset_DeleteObjectARB)
- GL_STUB(glGetHandleARB, _gloffset_GetHandleARB)
- GL_STUB(glDetachObjectARB, _gloffset_DetachObjectARB)
- GL_STUB(glCreateShaderObjectARB, _gloffset_CreateShaderObjectARB)
- GL_STUB(glShaderSourceARB, _gloffset_ShaderSourceARB)
- GL_STUB(glCompileShaderARB, _gloffset_CompileShaderARB)
- GL_STUB(glCreateProgramObjectARB, _gloffset_CreateProgramObjectARB)
- GL_STUB(glAttachObjectARB, _gloffset_AttachObjectARB)
- GL_STUB(glLinkProgramARB, _gloffset_LinkProgramARB)
- GL_STUB(glUseProgramObjectARB, _gloffset_UseProgramObjectARB)
- GL_STUB(glValidateProgramARB, _gloffset_ValidateProgramARB)
- GL_STUB(glUniform1fARB, _gloffset_Uniform1fARB)
- GL_STUB(glUniform2fARB, _gloffset_Uniform2fARB)
- GL_STUB(glUniform3fARB, _gloffset_Uniform3fARB)
- GL_STUB(glUniform4fARB, _gloffset_Uniform4fARB)
- GL_STUB(glUniform1iARB, _gloffset_Uniform1iARB)
- GL_STUB(glUniform2iARB, _gloffset_Uniform2iARB)
- GL_STUB(glUniform3iARB, _gloffset_Uniform3iARB)
- GL_STUB(glUniform4iARB, _gloffset_Uniform4iARB)
- GL_STUB(glUniform1fvARB, _gloffset_Uniform1fvARB)
- GL_STUB(glUniform2fvARB, _gloffset_Uniform2fvARB)
- GL_STUB(glUniform3fvARB, _gloffset_Uniform3fvARB)
- GL_STUB(glUniform4fvARB, _gloffset_Uniform4fvARB)
- GL_STUB(glUniform1ivARB, _gloffset_Uniform1ivARB)
- GL_STUB(glUniform2ivARB, _gloffset_Uniform2ivARB)
- GL_STUB(glUniform3ivARB, _gloffset_Uniform3ivARB)
- GL_STUB(glUniform4ivARB, _gloffset_Uniform4ivARB)
- GL_STUB(glUniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB)
- GL_STUB(glUniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB)
- GL_STUB(glUniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB)
- GL_STUB(glGetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB)
- GL_STUB(glGetObjectParameterivARB, _gloffset_GetObjectParameterivARB)
- GL_STUB(glGetInfoLogARB, _gloffset_GetInfoLogARB)
- GL_STUB(glGetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB)
- GL_STUB(glGetUniformLocationARB, _gloffset_GetUniformLocationARB)
- GL_STUB(glGetActiveUniformARB, _gloffset_GetActiveUniformARB)
- GL_STUB(glGetUniformfvARB, _gloffset_GetUniformfvARB)
- GL_STUB(glGetUniformivARB, _gloffset_GetUniformivARB)
- GL_STUB(glGetShaderSourceARB, _gloffset_GetShaderSourceARB)
- GL_STUB(glBindAttribLocationARB, _gloffset_BindAttribLocationARB)
- GL_STUB(glGetActiveAttribARB, _gloffset_GetActiveAttribARB)
- GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB)
- GL_STUB(glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV)
- GL_STUB(glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV)
- GL_STUB(glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV)
- GL_STUB(glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV)
- GL_STUB(glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV)
- GL_STUB(glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV)
- GL_STUB(glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV)
- GL_STUB(glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV)
- GL_STUB(glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV)
- GL_STUB(glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV)
- GL_STUB(glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV)
- GL_STUB(glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV)
- GL_STUB(glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV)
- GL_STUB(glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV)
- GL_STUB(glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV)
- GL_STUB(glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV)
- GL_STUB(glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV)
- GL_STUB(glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV)
- GL_STUB(glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV)
- GL_STUB(glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV)
- GL_STUB(glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV)
- GL_STUB(glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV)
- GL_STUB(glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV)
- GL_STUB(glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV)
- GL_STUB(glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV)
- GL_STUB(glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV)
- GL_STUB(glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV)
- GL_STUB(glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV)
- GL_STUB(glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV)
- GL_STUB(glGenFragmentShadersATI, _gloffset_GenFragmentShadersATI)
- GL_STUB(glBindFragmentShaderATI, _gloffset_BindFragmentShaderATI)
- GL_STUB(glDeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI)
- GL_STUB(glBeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI)
- GL_STUB(glEndFragmentShaderATI, _gloffset_EndFragmentShaderATI)
- GL_STUB(glPassTexCoordATI, _gloffset_PassTexCoordATI)
- GL_STUB(glSampleMapATI, _gloffset_SampleMapATI)
- GL_STUB(glColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI)
- GL_STUB(glColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI)
- GL_STUB(glColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI)
- GL_STUB(glAlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI)
- GL_STUB(glAlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI)
- GL_STUB(glAlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI)
- GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI)
- GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT)
- GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT)
- GL_STUB(glDeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT)
- GL_STUB(glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT)
- GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT)
- GL_STUB(glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT)
- GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT)
- GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT)
- GL_STUB(glDeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT)
- GL_STUB(glGenFramebuffersEXT, _gloffset_GenFramebuffersEXT)
- GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT)
- GL_STUB(glFramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT)
- GL_STUB(glFramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT)
- GL_STUB(glFramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT)
- GL_STUB(glFramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT)
- GL_STUB(glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT)
- GL_STUB(glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT)
- GL_STUB(glStencilFuncSeparate, _gloffset_StencilFuncSeparate)
- GL_STUB(glStencilOpSeparate, _gloffset_StencilOpSeparate)
- GL_STUB(glStencilMaskSeparate, _gloffset_StencilMaskSeparate)
-
- .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function
-_mesa_sparc_glapi_end:
-
- .globl glArrayElementEXT ; .type glArrayElementEXT,#function ; glArrayElementEXT = glArrayElement
- .globl glBindTextureEXT ; .type glBindTextureEXT,#function ; glBindTextureEXT = glBindTexture
- .globl glDrawArraysEXT ; .type glDrawArraysEXT,#function ; glDrawArraysEXT = glDrawArrays
- .globl glCopyTexImage1DEXT ; .type glCopyTexImage1DEXT,#function ; glCopyTexImage1DEXT = glCopyTexImage1D
- .globl glCopyTexImage2DEXT ; .type glCopyTexImage2DEXT,#function ; glCopyTexImage2DEXT = glCopyTexImage2D
- .globl glCopyTexSubImage1DEXT ; .type glCopyTexSubImage1DEXT,#function ; glCopyTexSubImage1DEXT = glCopyTexSubImage1D
- .globl glCopyTexSubImage2DEXT ; .type glCopyTexSubImage2DEXT,#function ; glCopyTexSubImage2DEXT = glCopyTexSubImage2D
- .globl glDeleteTexturesEXT ; .type glDeleteTexturesEXT,#function ; glDeleteTexturesEXT = glDeleteTextures
- .globl glGetPointervEXT ; .type glGetPointervEXT,#function ; glGetPointervEXT = glGetPointerv
- .globl glPrioritizeTexturesEXT ; .type glPrioritizeTexturesEXT,#function ; glPrioritizeTexturesEXT = glPrioritizeTextures
- .globl glTexSubImage1DEXT ; .type glTexSubImage1DEXT,#function ; glTexSubImage1DEXT = glTexSubImage1D
- .globl glTexSubImage2DEXT ; .type glTexSubImage2DEXT,#function ; glTexSubImage2DEXT = glTexSubImage2D
- .globl glBlendColorEXT ; .type glBlendColorEXT,#function ; glBlendColorEXT = glBlendColor
- .globl glBlendEquationEXT ; .type glBlendEquationEXT,#function ; glBlendEquationEXT = glBlendEquation
- .globl glDrawRangeElementsEXT ; .type glDrawRangeElementsEXT,#function ; glDrawRangeElementsEXT = glDrawRangeElements
- .globl glColorTableSGI ; .type glColorTableSGI,#function ; glColorTableSGI = glColorTable
- .globl glColorTableEXT ; .type glColorTableEXT,#function ; glColorTableEXT = glColorTable
- .globl glColorTableParameterfvSGI ; .type glColorTableParameterfvSGI,#function ; glColorTableParameterfvSGI = glColorTableParameterfv
- .globl glColorTableParameterivSGI ; .type glColorTableParameterivSGI,#function ; glColorTableParameterivSGI = glColorTableParameteriv
- .globl glCopyColorTableSGI ; .type glCopyColorTableSGI,#function ; glCopyColorTableSGI = glCopyColorTable
- .globl glColorSubTableEXT ; .type glColorSubTableEXT,#function ; glColorSubTableEXT = glColorSubTable
- .globl glCopyColorSubTableEXT ; .type glCopyColorSubTableEXT,#function ; glCopyColorSubTableEXT = glCopyColorSubTable
- .globl glConvolutionFilter1DEXT ; .type glConvolutionFilter1DEXT,#function ; glConvolutionFilter1DEXT = glConvolutionFilter1D
- .globl glConvolutionFilter2DEXT ; .type glConvolutionFilter2DEXT,#function ; glConvolutionFilter2DEXT = glConvolutionFilter2D
- .globl glConvolutionParameterfEXT ; .type glConvolutionParameterfEXT,#function ; glConvolutionParameterfEXT = glConvolutionParameterf
- .globl glConvolutionParameterfvEXT ; .type glConvolutionParameterfvEXT,#function ; glConvolutionParameterfvEXT = glConvolutionParameterfv
- .globl glConvolutionParameteriEXT ; .type glConvolutionParameteriEXT,#function ; glConvolutionParameteriEXT = glConvolutionParameteri
- .globl glConvolutionParameterivEXT ; .type glConvolutionParameterivEXT,#function ; glConvolutionParameterivEXT = glConvolutionParameteriv
- .globl glCopyConvolutionFilter1DEXT ; .type glCopyConvolutionFilter1DEXT,#function ; glCopyConvolutionFilter1DEXT = glCopyConvolutionFilter1D
- .globl glCopyConvolutionFilter2DEXT ; .type glCopyConvolutionFilter2DEXT,#function ; glCopyConvolutionFilter2DEXT = glCopyConvolutionFilter2D
- .globl glSeparableFilter2DEXT ; .type glSeparableFilter2DEXT,#function ; glSeparableFilter2DEXT = glSeparableFilter2D
- .globl glHistogramEXT ; .type glHistogramEXT,#function ; glHistogramEXT = glHistogram
- .globl glMinmaxEXT ; .type glMinmaxEXT,#function ; glMinmaxEXT = glMinmax
- .globl glResetHistogramEXT ; .type glResetHistogramEXT,#function ; glResetHistogramEXT = glResetHistogram
- .globl glResetMinmaxEXT ; .type glResetMinmaxEXT,#function ; glResetMinmaxEXT = glResetMinmax
- .globl glTexImage3DEXT ; .type glTexImage3DEXT,#function ; glTexImage3DEXT = glTexImage3D
- .globl glTexSubImage3DEXT ; .type glTexSubImage3DEXT,#function ; glTexSubImage3DEXT = glTexSubImage3D
- .globl glCopyTexSubImage3DEXT ; .type glCopyTexSubImage3DEXT,#function ; glCopyTexSubImage3DEXT = glCopyTexSubImage3D
- .globl glActiveTexture ; .type glActiveTexture,#function ; glActiveTexture = glActiveTextureARB
- .globl glClientActiveTexture ; .type glClientActiveTexture,#function ; glClientActiveTexture = glClientActiveTextureARB
- .globl glMultiTexCoord1d ; .type glMultiTexCoord1d,#function ; glMultiTexCoord1d = glMultiTexCoord1dARB
- .globl glMultiTexCoord1dv ; .type glMultiTexCoord1dv,#function ; glMultiTexCoord1dv = glMultiTexCoord1dvARB
- .globl glMultiTexCoord1f ; .type glMultiTexCoord1f,#function ; glMultiTexCoord1f = glMultiTexCoord1fARB
- .globl glMultiTexCoord1fv ; .type glMultiTexCoord1fv,#function ; glMultiTexCoord1fv = glMultiTexCoord1fvARB
- .globl glMultiTexCoord1i ; .type glMultiTexCoord1i,#function ; glMultiTexCoord1i = glMultiTexCoord1iARB
- .globl glMultiTexCoord1iv ; .type glMultiTexCoord1iv,#function ; glMultiTexCoord1iv = glMultiTexCoord1ivARB
- .globl glMultiTexCoord1s ; .type glMultiTexCoord1s,#function ; glMultiTexCoord1s = glMultiTexCoord1sARB
- .globl glMultiTexCoord1sv ; .type glMultiTexCoord1sv,#function ; glMultiTexCoord1sv = glMultiTexCoord1svARB
- .globl glMultiTexCoord2d ; .type glMultiTexCoord2d,#function ; glMultiTexCoord2d = glMultiTexCoord2dARB
- .globl glMultiTexCoord2dv ; .type glMultiTexCoord2dv,#function ; glMultiTexCoord2dv = glMultiTexCoord2dvARB
- .globl glMultiTexCoord2f ; .type glMultiTexCoord2f,#function ; glMultiTexCoord2f = glMultiTexCoord2fARB
- .globl glMultiTexCoord2fv ; .type glMultiTexCoord2fv,#function ; glMultiTexCoord2fv = glMultiTexCoord2fvARB
- .globl glMultiTexCoord2i ; .type glMultiTexCoord2i,#function ; glMultiTexCoord2i = glMultiTexCoord2iARB
- .globl glMultiTexCoord2iv ; .type glMultiTexCoord2iv,#function ; glMultiTexCoord2iv = glMultiTexCoord2ivARB
- .globl glMultiTexCoord2s ; .type glMultiTexCoord2s,#function ; glMultiTexCoord2s = glMultiTexCoord2sARB
- .globl glMultiTexCoord2sv ; .type glMultiTexCoord2sv,#function ; glMultiTexCoord2sv = glMultiTexCoord2svARB
- .globl glMultiTexCoord3d ; .type glMultiTexCoord3d,#function ; glMultiTexCoord3d = glMultiTexCoord3dARB
- .globl glMultiTexCoord3dv ; .type glMultiTexCoord3dv,#function ; glMultiTexCoord3dv = glMultiTexCoord3dvARB
- .globl glMultiTexCoord3f ; .type glMultiTexCoord3f,#function ; glMultiTexCoord3f = glMultiTexCoord3fARB
- .globl glMultiTexCoord3fv ; .type glMultiTexCoord3fv,#function ; glMultiTexCoord3fv = glMultiTexCoord3fvARB
- .globl glMultiTexCoord3i ; .type glMultiTexCoord3i,#function ; glMultiTexCoord3i = glMultiTexCoord3iARB
- .globl glMultiTexCoord3iv ; .type glMultiTexCoord3iv,#function ; glMultiTexCoord3iv = glMultiTexCoord3ivARB
- .globl glMultiTexCoord3s ; .type glMultiTexCoord3s,#function ; glMultiTexCoord3s = glMultiTexCoord3sARB
- .globl glMultiTexCoord3sv ; .type glMultiTexCoord3sv,#function ; glMultiTexCoord3sv = glMultiTexCoord3svARB
- .globl glMultiTexCoord4d ; .type glMultiTexCoord4d,#function ; glMultiTexCoord4d = glMultiTexCoord4dARB
- .globl glMultiTexCoord4dv ; .type glMultiTexCoord4dv,#function ; glMultiTexCoord4dv = glMultiTexCoord4dvARB
- .globl glMultiTexCoord4f ; .type glMultiTexCoord4f,#function ; glMultiTexCoord4f = glMultiTexCoord4fARB
- .globl glMultiTexCoord4fv ; .type glMultiTexCoord4fv,#function ; glMultiTexCoord4fv = glMultiTexCoord4fvARB
- .globl glMultiTexCoord4i ; .type glMultiTexCoord4i,#function ; glMultiTexCoord4i = glMultiTexCoord4iARB
- .globl glMultiTexCoord4iv ; .type glMultiTexCoord4iv,#function ; glMultiTexCoord4iv = glMultiTexCoord4ivARB
- .globl glMultiTexCoord4s ; .type glMultiTexCoord4s,#function ; glMultiTexCoord4s = glMultiTexCoord4sARB
- .globl glMultiTexCoord4sv ; .type glMultiTexCoord4sv,#function ; glMultiTexCoord4sv = glMultiTexCoord4svARB
- .globl glLoadTransposeMatrixf ; .type glLoadTransposeMatrixf,#function ; glLoadTransposeMatrixf = glLoadTransposeMatrixfARB
- .globl glLoadTransposeMatrixd ; .type glLoadTransposeMatrixd,#function ; glLoadTransposeMatrixd = glLoadTransposeMatrixdARB
- .globl glMultTransposeMatrixf ; .type glMultTransposeMatrixf,#function ; glMultTransposeMatrixf = glMultTransposeMatrixfARB
- .globl glMultTransposeMatrixd ; .type glMultTransposeMatrixd,#function ; glMultTransposeMatrixd = glMultTransposeMatrixdARB
- .globl glSampleCoverage ; .type glSampleCoverage,#function ; glSampleCoverage = glSampleCoverageARB
- .globl glDrawBuffersATI ; .type glDrawBuffersATI,#function ; glDrawBuffersATI = glDrawBuffersARB
- .globl glSampleMaskEXT ; .type glSampleMaskEXT,#function ; glSampleMaskEXT = glSampleMaskSGIS
- .globl glSamplePatternEXT ; .type glSamplePatternEXT,#function ; glSamplePatternEXT = glSamplePatternSGIS
- .globl glPointParameterf ; .type glPointParameterf,#function ; glPointParameterf = glPointParameterfEXT
- .globl glPointParameterfARB ; .type glPointParameterfARB,#function ; glPointParameterfARB = glPointParameterfEXT
- .globl glPointParameterfSGIS ; .type glPointParameterfSGIS,#function ; glPointParameterfSGIS = glPointParameterfEXT
- .globl glPointParameterfv ; .type glPointParameterfv,#function ; glPointParameterfv = glPointParameterfvEXT
- .globl glPointParameterfvARB ; .type glPointParameterfvARB,#function ; glPointParameterfvARB = glPointParameterfvEXT
- .globl glPointParameterfvSGIS ; .type glPointParameterfvSGIS,#function ; glPointParameterfvSGIS = glPointParameterfvEXT
- .globl glWindowPos2d ; .type glWindowPos2d,#function ; glWindowPos2d = glWindowPos2dMESA
- .globl glWindowPos2dARB ; .type glWindowPos2dARB,#function ; glWindowPos2dARB = glWindowPos2dMESA
- .globl glWindowPos2dv ; .type glWindowPos2dv,#function ; glWindowPos2dv = glWindowPos2dvMESA
- .globl glWindowPos2dvARB ; .type glWindowPos2dvARB,#function ; glWindowPos2dvARB = glWindowPos2dvMESA
- .globl glWindowPos2f ; .type glWindowPos2f,#function ; glWindowPos2f = glWindowPos2fMESA
- .globl glWindowPos2fARB ; .type glWindowPos2fARB,#function ; glWindowPos2fARB = glWindowPos2fMESA
- .globl glWindowPos2fv ; .type glWindowPos2fv,#function ; glWindowPos2fv = glWindowPos2fvMESA
- .globl glWindowPos2fvARB ; .type glWindowPos2fvARB,#function ; glWindowPos2fvARB = glWindowPos2fvMESA
- .globl glWindowPos2i ; .type glWindowPos2i,#function ; glWindowPos2i = glWindowPos2iMESA
- .globl glWindowPos2iARB ; .type glWindowPos2iARB,#function ; glWindowPos2iARB = glWindowPos2iMESA
- .globl glWindowPos2iv ; .type glWindowPos2iv,#function ; glWindowPos2iv = glWindowPos2ivMESA
- .globl glWindowPos2ivARB ; .type glWindowPos2ivARB,#function ; glWindowPos2ivARB = glWindowPos2ivMESA
- .globl glWindowPos2s ; .type glWindowPos2s,#function ; glWindowPos2s = glWindowPos2sMESA
- .globl glWindowPos2sARB ; .type glWindowPos2sARB,#function ; glWindowPos2sARB = glWindowPos2sMESA
- .globl glWindowPos2sv ; .type glWindowPos2sv,#function ; glWindowPos2sv = glWindowPos2svMESA
- .globl glWindowPos2svARB ; .type glWindowPos2svARB,#function ; glWindowPos2svARB = glWindowPos2svMESA
- .globl glWindowPos3d ; .type glWindowPos3d,#function ; glWindowPos3d = glWindowPos3dMESA
- .globl glWindowPos3dARB ; .type glWindowPos3dARB,#function ; glWindowPos3dARB = glWindowPos3dMESA
- .globl glWindowPos3dv ; .type glWindowPos3dv,#function ; glWindowPos3dv = glWindowPos3dvMESA
- .globl glWindowPos3dvARB ; .type glWindowPos3dvARB,#function ; glWindowPos3dvARB = glWindowPos3dvMESA
- .globl glWindowPos3f ; .type glWindowPos3f,#function ; glWindowPos3f = glWindowPos3fMESA
- .globl glWindowPos3fARB ; .type glWindowPos3fARB,#function ; glWindowPos3fARB = glWindowPos3fMESA
- .globl glWindowPos3fv ; .type glWindowPos3fv,#function ; glWindowPos3fv = glWindowPos3fvMESA
- .globl glWindowPos3fvARB ; .type glWindowPos3fvARB,#function ; glWindowPos3fvARB = glWindowPos3fvMESA
- .globl glWindowPos3i ; .type glWindowPos3i,#function ; glWindowPos3i = glWindowPos3iMESA
- .globl glWindowPos3iARB ; .type glWindowPos3iARB,#function ; glWindowPos3iARB = glWindowPos3iMESA
- .globl glWindowPos3iv ; .type glWindowPos3iv,#function ; glWindowPos3iv = glWindowPos3ivMESA
- .globl glWindowPos3ivARB ; .type glWindowPos3ivARB,#function ; glWindowPos3ivARB = glWindowPos3ivMESA
- .globl glWindowPos3s ; .type glWindowPos3s,#function ; glWindowPos3s = glWindowPos3sMESA
- .globl glWindowPos3sARB ; .type glWindowPos3sARB,#function ; glWindowPos3sARB = glWindowPos3sMESA
- .globl glWindowPos3sv ; .type glWindowPos3sv,#function ; glWindowPos3sv = glWindowPos3svMESA
- .globl glWindowPos3svARB ; .type glWindowPos3svARB,#function ; glWindowPos3svARB = glWindowPos3svMESA
- .globl glBlendFuncSeparate ; .type glBlendFuncSeparate,#function ; glBlendFuncSeparate = glBlendFuncSeparateEXT
- .globl glBlendFuncSeparateINGR ; .type glBlendFuncSeparateINGR,#function ; glBlendFuncSeparateINGR = glBlendFuncSeparateEXT
- .globl glFogCoordf ; .type glFogCoordf,#function ; glFogCoordf = glFogCoordfEXT
- .globl glFogCoordfv ; .type glFogCoordfv,#function ; glFogCoordfv = glFogCoordfvEXT
- .globl glFogCoordd ; .type glFogCoordd,#function ; glFogCoordd = glFogCoorddEXT
- .globl glFogCoorddv ; .type glFogCoorddv,#function ; glFogCoorddv = glFogCoorddvEXT
- .globl glFogCoordPointer ; .type glFogCoordPointer,#function ; glFogCoordPointer = glFogCoordPointerEXT
- .globl glCompressedTexImage3D ; .type glCompressedTexImage3D,#function ; glCompressedTexImage3D = glCompressedTexImage3DARB
- .globl glCompressedTexImage2D ; .type glCompressedTexImage2D,#function ; glCompressedTexImage2D = glCompressedTexImage2DARB
- .globl glCompressedTexImage1D ; .type glCompressedTexImage1D,#function ; glCompressedTexImage1D = glCompressedTexImage1DARB
- .globl glCompressedTexSubImage3D ; .type glCompressedTexSubImage3D,#function ; glCompressedTexSubImage3D = glCompressedTexSubImage3DARB
- .globl glCompressedTexSubImage2D ; .type glCompressedTexSubImage2D,#function ; glCompressedTexSubImage2D = glCompressedTexSubImage2DARB
- .globl glCompressedTexSubImage1D ; .type glCompressedTexSubImage1D,#function ; glCompressedTexSubImage1D = glCompressedTexSubImage1DARB
- .globl glGetCompressedTexImage ; .type glGetCompressedTexImage,#function ; glGetCompressedTexImage = glGetCompressedTexImageARB
- .globl glSecondaryColor3b ; .type glSecondaryColor3b,#function ; glSecondaryColor3b = glSecondaryColor3bEXT
- .globl glSecondaryColor3bv ; .type glSecondaryColor3bv,#function ; glSecondaryColor3bv = glSecondaryColor3bvEXT
- .globl glSecondaryColor3d ; .type glSecondaryColor3d,#function ; glSecondaryColor3d = glSecondaryColor3dEXT
- .globl glSecondaryColor3dv ; .type glSecondaryColor3dv,#function ; glSecondaryColor3dv = glSecondaryColor3dvEXT
- .globl glSecondaryColor3f ; .type glSecondaryColor3f,#function ; glSecondaryColor3f = glSecondaryColor3fEXT
- .globl glSecondaryColor3fv ; .type glSecondaryColor3fv,#function ; glSecondaryColor3fv = glSecondaryColor3fvEXT
- .globl glSecondaryColor3i ; .type glSecondaryColor3i,#function ; glSecondaryColor3i = glSecondaryColor3iEXT
- .globl glSecondaryColor3iv ; .type glSecondaryColor3iv,#function ; glSecondaryColor3iv = glSecondaryColor3ivEXT
- .globl glSecondaryColor3s ; .type glSecondaryColor3s,#function ; glSecondaryColor3s = glSecondaryColor3sEXT
- .globl glSecondaryColor3sv ; .type glSecondaryColor3sv,#function ; glSecondaryColor3sv = glSecondaryColor3svEXT
- .globl glSecondaryColor3ub ; .type glSecondaryColor3ub,#function ; glSecondaryColor3ub = glSecondaryColor3ubEXT
- .globl glSecondaryColor3ubv ; .type glSecondaryColor3ubv,#function ; glSecondaryColor3ubv = glSecondaryColor3ubvEXT
- .globl glSecondaryColor3ui ; .type glSecondaryColor3ui,#function ; glSecondaryColor3ui = glSecondaryColor3uiEXT
- .globl glSecondaryColor3uiv ; .type glSecondaryColor3uiv,#function ; glSecondaryColor3uiv = glSecondaryColor3uivEXT
- .globl glSecondaryColor3us ; .type glSecondaryColor3us,#function ; glSecondaryColor3us = glSecondaryColor3usEXT
- .globl glSecondaryColor3usv ; .type glSecondaryColor3usv,#function ; glSecondaryColor3usv = glSecondaryColor3usvEXT
- .globl glSecondaryColorPointer ; .type glSecondaryColorPointer,#function ; glSecondaryColorPointer = glSecondaryColorPointerEXT
- .globl glBindProgramARB ; .type glBindProgramARB,#function ; glBindProgramARB = glBindProgramNV
- .globl glDeleteProgramsARB ; .type glDeleteProgramsARB,#function ; glDeleteProgramsARB = glDeleteProgramsNV
- .globl glGenProgramsARB ; .type glGenProgramsARB,#function ; glGenProgramsARB = glGenProgramsNV
- .globl glGetVertexAttribPointervARB ; .type glGetVertexAttribPointervARB,#function ; glGetVertexAttribPointervARB = glGetVertexAttribPointervNV
- .globl glIsProgramARB ; .type glIsProgramARB,#function ; glIsProgramARB = glIsProgramNV
- .globl glPointParameteri ; .type glPointParameteri,#function ; glPointParameteri = glPointParameteriNV
- .globl glPointParameteriv ; .type glPointParameteriv,#function ; glPointParameteriv = glPointParameterivNV
- .globl glMultiDrawArrays ; .type glMultiDrawArrays,#function ; glMultiDrawArrays = glMultiDrawArraysEXT
- .globl glMultiDrawElements ; .type glMultiDrawElements,#function ; glMultiDrawElements = glMultiDrawElementsEXT
- .globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB
- .globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB
- .globl glBufferSubData ; .type glBufferSubData,#function ; glBufferSubData = glBufferSubDataARB
- .globl glDeleteBuffers ; .type glDeleteBuffers,#function ; glDeleteBuffers = glDeleteBuffersARB
- .globl glGenBuffers ; .type glGenBuffers,#function ; glGenBuffers = glGenBuffersARB
- .globl glGetBufferParameteriv ; .type glGetBufferParameteriv,#function ; glGetBufferParameteriv = glGetBufferParameterivARB
- .globl glGetBufferPointerv ; .type glGetBufferPointerv,#function ; glGetBufferPointerv = glGetBufferPointervARB
- .globl glGetBufferSubData ; .type glGetBufferSubData,#function ; glGetBufferSubData = glGetBufferSubDataARB
- .globl glIsBuffer ; .type glIsBuffer,#function ; glIsBuffer = glIsBufferARB
- .globl glMapBuffer ; .type glMapBuffer,#function ; glMapBuffer = glMapBufferARB
- .globl glUnmapBuffer ; .type glUnmapBuffer,#function ; glUnmapBuffer = glUnmapBufferARB
- .globl glGenQueries ; .type glGenQueries,#function ; glGenQueries = glGenQueriesARB
- .globl glDeleteQueries ; .type glDeleteQueries,#function ; glDeleteQueries = glDeleteQueriesARB
- .globl glIsQuery ; .type glIsQuery,#function ; glIsQuery = glIsQueryARB
- .globl glBeginQuery ; .type glBeginQuery,#function ; glBeginQuery = glBeginQueryARB
- .globl glEndQuery ; .type glEndQuery,#function ; glEndQuery = glEndQueryARB
- .globl glGetQueryiv ; .type glGetQueryiv,#function ; glGetQueryiv = glGetQueryivARB
- .globl glGetQueryObjectiv ; .type glGetQueryObjectiv,#function ; glGetQueryObjectiv = glGetQueryObjectivARB
- .globl glGetQueryObjectuiv ; .type glGetQueryObjectuiv,#function ; glGetQueryObjectuiv = glGetQueryObjectuivARB
- .globl glBlendEquationSeparateATI ; .type glBlendEquationSeparateATI,#function ; glBlendEquationSeparateATI = glBlendEquationSeparateEXT
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/norm.S b/nx-X11/extras/Mesa/src/mesa/sparc/norm.S
deleted file mode 100644
index ec25edd3e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/norm.S
+++ /dev/null
@@ -1,609 +0,0 @@
-/* $Id: norm.S,v 1.1.1.3 2005/07/31 16:46:49 ajax Exp $ */
-
-#include "sparc_matrix.h"
-
-#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)
- /* Solaris requires this for 64-bit. */
- .register %g2, #scratch
- .register %g3, #scratch
-#endif
-
- .text
-
-#ifdef __arch64__
-#define STACK_VAR_OFF (2047 + (8 * 16))
-#else
-#define STACK_VAR_OFF (4 * 16)
-#endif
-
- /* Newton-Raphson approximation turns out to be slower
- * (and less accurate) than direct fsqrts/fdivs.
- */
-#define ONE_DOT_ZERO 0x3f800000
-
- .globl _mesa_sparc_transform_normalize_normals
-_mesa_sparc_transform_normalize_normals:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
-
- sethi %hi(ONE_DOT_ZERO), %g2
- sub %sp, 16, %sp
- st %g2, [%sp + STACK_VAR_OFF+0x0]
- st %o1, [%sp + STACK_VAR_OFF+0x4]
- ld [%sp + STACK_VAR_OFF+0x0], %f12 ! f12 = 1.0f
- ld [%sp + STACK_VAR_OFF+0x4], %f15 ! f15 = scale
- add %sp, 16, %sp
-
- LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- LDMATRIX_0_1_2_4_5_6_8_9_10(%o0)
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- cmp %o3, 0
- bne 4f
- clr %o4 ! 'i' for STRIDE_LOOP
-
-1: /* LENGTHS == NULL */
- ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* tx (f3) = (ux * m0) + (uy * m1) + (uz * m2)
- * ty (f5) = (ux * m4) + (uy * m5) + (uz * m6)
- * tz (f7) = (ux * m8) + (uy * m9) + (uz * m10)
- */
- fmuls %f0, M0, %f3 ! FGM Group
- fmuls %f1, M1, %f4 ! FGM Group
- fmuls %f0, M4, %f5 ! FGM Group
- fmuls %f1, M5, %f6 ! FGM Group
- fmuls %f0, M8, %f7 ! FGM Group f3 available
- fmuls %f1, M9, %f8 ! FGM Group f4 available
- fadds %f3, %f4, %f3 ! FGA
- fmuls %f2, M2, %f10 ! FGM Group f5 available
- fmuls %f2, M6, %f0 ! FGM Group f6 available
- fadds %f5, %f6, %f5 ! FGA
- fmuls %f2, M10, %f4 ! FGM Group f7 available
- fadds %f7, %f8, %f7 ! FGA Group f8,f3 available
- fadds %f3, %f10, %f3 ! FGA Group f10 available
- fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available
- fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available
-
- /* f3=tx, f5=ty, f7=tz */
-
- /* len (f6) = (tx * tx) + (ty * ty) + (tz * tz) */
- fmuls %f3, %f3, %f6 ! FGM Group f3 available
- fmuls %f5, %f5, %f8 ! FGM Group f5 available
- fmuls %f7, %f7, %f10 ! FGM Group f7 available
- fadds %f6, %f8, %f6 ! FGA Group 2cyc stall f6,f8 available
- fadds %f6, %f10, %f6 ! FGA Group 4cyc stall f6,f10 available
-
- /* scale (f6) = 1.0 / sqrt(len) */
- fsqrts %f6, %f6 ! FDIV 20 cycles
- fdivs %f12, %f6, %f6 ! FDIV 14 cycles
-
- fmuls %f3, %f6, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale
- fmuls %f5, %f6, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale
- fmuls %f7, %f6, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
- ba 7f
- nop
-
-4: /* LENGTHS != NULL */
- fmuls M0, %f15, M0
- fmuls M1, %f15, M1
- fmuls M2, %f15, M2
- fmuls M4, %f15, M4
- fmuls M5, %f15, M5
- fmuls M6, %f15, M6
- fmuls M8, %f15, M8
- fmuls M9, %f15, M9
- fmuls M10, %f15, M10
-
-5:
- ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* tx (f3) = (ux * m0) + (uy * m1) + (uz * m2)
- * ty (f5) = (ux * m4) + (uy * m5) + (uz * m6)
- * tz (f7) = (ux * m8) + (uy * m9) + (uz * m10)
- */
- fmuls %f0, M0, %f3 ! FGM Group
- fmuls %f1, M1, %f4 ! FGM Group
- fmuls %f0, M4, %f5 ! FGM Group
- fmuls %f1, M5, %f6 ! FGM Group
- fmuls %f0, M8, %f7 ! FGM Group f3 available
- fmuls %f1, M9, %f8 ! FGM Group f4 available
- fadds %f3, %f4, %f3 ! FGA
- fmuls %f2, M2, %f10 ! FGM Group f5 available
- fmuls %f2, M6, %f0 ! FGM Group f6 available
- fadds %f5, %f6, %f5 ! FGA
- fmuls %f2, M10, %f4 ! FGM Group f7 available
- fadds %f7, %f8, %f7 ! FGA Group f8,f3 available
- fadds %f3, %f10, %f3 ! FGA Group f10 available
- ld [%o3], %f13 ! LSU
- fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available
- add %o3, 4, %o3 ! IEU0
- fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available
-
- /* f3=tx, f5=ty, f7=tz, f13=lengths[i] */
-
- fmuls %f3, %f13, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * len
- fmuls %f5, %f13, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * len
- fmuls %f7, %f13, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * len
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 5b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_transform_normalize_normals_no_rot
-_mesa_sparc_transform_normalize_normals_no_rot:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
-
- sethi %hi(ONE_DOT_ZERO), %g2
- sub %sp, 16, %sp
- st %g2, [%sp + STACK_VAR_OFF+0x0]
- st %o1, [%sp + STACK_VAR_OFF+0x4]
- ld [%sp + STACK_VAR_OFF+0x0], %f12 ! f12 = 1.0f
- ld [%sp + STACK_VAR_OFF+0x4], %f15 ! f15 = scale
- add %sp, 16, %sp
-
- LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- LDMATRIX_0_5_10(%o0)
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- cmp %o3, 0
- bne 4f
- clr %o4 ! 'i' for STRIDE_LOOP
-
-1: /* LENGTHS == NULL */
- ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* tx (f3) = (ux * m0)
- * ty (f5) = (uy * m5)
- * tz (f7) = (uz * m10)
- */
- fmuls %f0, M0, %f3 ! FGM Group
- fmuls %f1, M5, %f5 ! FGM Group
- fmuls %f2, M10, %f7 ! FGM Group
-
- /* f3=tx, f5=ty, f7=tz */
-
- /* len (f6) = (tx * tx) + (ty * ty) + (tz * tz) */
- fmuls %f3, %f3, %f6 ! FGM Group stall, f3 available
- fmuls %f5, %f5, %f8 ! FGM Group f5 available
- fmuls %f7, %f7, %f10 ! FGM Group f7 available
- fadds %f6, %f8, %f6 ! FGA Group 2cyc stall f6,f8 available
- fadds %f6, %f10, %f6 ! FGA Group 4cyc stall f6,f10 available
-
- /* scale (f6) = 1.0 / sqrt(len) */
- fsqrts %f6, %f6 ! FDIV 20 cycles
- fdivs %f12, %f6, %f6 ! FDIV 14 cycles
-
- fmuls %f3, %f6, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale
- fmuls %f5, %f6, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale
- fmuls %f7, %f6, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
- ba 7f
- nop
-
-4: /* LENGTHS != NULL */
- fmuls M0, %f15, M0
- fmuls M5, %f15, M5
- fmuls M10, %f15, M10
-
-5:
- ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* tx (f3) = (ux * m0)
- * ty (f5) = (uy * m5)
- * tz (f7) = (uz * m10)
- */
- fmuls %f0, M0, %f3 ! FGM Group
- ld [%o3], %f13 ! LSU
- fmuls %f1, M5, %f5 ! FGM Group
- add %o3, 4, %o3 ! IEU0
- fmuls %f2, M10, %f7 ! FGM Group
-
- /* f3=tx, f5=ty, f7=tz, f13=lengths[i] */
-
- fmuls %f3, %f13, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * len
- fmuls %f5, %f13, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * len
- fmuls %f7, %f13, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * len
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 5b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_transform_rescale_normals_no_rot
-_mesa_sparc_transform_rescale_normals_no_rot:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
- sub %sp, 16, %sp
- st %o1, [%sp + STACK_VAR_OFF+0x0]
- ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale
- add %sp, 16, %sp
-
- LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- LDMATRIX_0_5_10(%o0)
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- clr %o4 ! 'i' for STRIDE_LOOP
-
- fmuls M0, %f15, M0
- fmuls M5, %f15, M5
- fmuls M10, %f15, M10
-
-1: ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* tx (f3) = (ux * m0)
- * ty (f5) = (uy * m5)
- * tz (f7) = (uz * m10)
- */
- fmuls %f0, M0, %f3 ! FGM Group
- st %f3, [%g3 + 0x00] ! LSU
- fmuls %f1, M5, %f5 ! FGM Group
- st %f5, [%g3 + 0x04] ! LSU
- fmuls %f2, M10, %f7 ! FGM Group
- st %f7, [%g3 + 0x08] ! LSU
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_transform_rescale_normals
-_mesa_sparc_transform_rescale_normals:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
- sub %sp, 16, %sp
- st %o1, [%sp + STACK_VAR_OFF+0x0]
- ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale
- add %sp, 16, %sp
-
- LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- LDMATRIX_0_1_2_4_5_6_8_9_10(%o0)
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- clr %o4 ! 'i' for STRIDE_LOOP
-
- fmuls M0, %f15, M0
- fmuls M1, %f15, M1
- fmuls M2, %f15, M2
- fmuls M4, %f15, M4
- fmuls M5, %f15, M5
- fmuls M6, %f15, M6
- fmuls M8, %f15, M8
- fmuls M9, %f15, M9
- fmuls M10, %f15, M10
-
-1: ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- fmuls %f0, M0, %f3 ! FGM Group
- fmuls %f1, M1, %f4 ! FGM Group
- fmuls %f0, M4, %f5 ! FGM Group
- fmuls %f1, M5, %f6 ! FGM Group
- fmuls %f0, M8, %f7 ! FGM Group f3 available
- fmuls %f1, M9, %f8 ! FGM Group f4 available
- fadds %f3, %f4, %f3 ! FGA
- fmuls %f2, M2, %f10 ! FGM Group f5 available
- fmuls %f2, M6, %f0 ! FGM Group f6 available
- fadds %f5, %f6, %f5 ! FGA
- fmuls %f2, M10, %f4 ! FGM Group f7 available
- fadds %f7, %f8, %f7 ! FGA Group f8,f3 available
- fadds %f3, %f10, %f3 ! FGA Group f10 available
- st %f3, [%g3 + 0x00] ! LSU
- fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available
- st %f5, [%g3 + 0x04] ! LSU
- fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available
- st %f7, [%g3 + 0x08] ! LSU
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_transform_normals_no_rot
-_mesa_sparc_transform_normals_no_rot:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
- LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- LDMATRIX_0_5_10(%o0)
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- clr %o4 ! 'i' for STRIDE_LOOP
-
-1: ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* tx (f3) = (ux * m0)
- * ty (f5) = (uy * m5)
- * tz (f7) = (uz * m10)
- */
- fmuls %f0, M0, %f3 ! FGM Group
- st %f3, [%g3 + 0x00] ! LSU
- fmuls %f1, M5, %f5 ! FGM Group
- st %f5, [%g3 + 0x04] ! LSU
- fmuls %f2, M10, %f7 ! FGM Group
- st %f7, [%g3 + 0x08] ! LSU
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_transform_normals
-_mesa_sparc_transform_normals:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
- LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- LDMATRIX_0_1_2_4_5_6_8_9_10(%o0)
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- clr %o4 ! 'i' for STRIDE_LOOP
-
-1: ld [%o5 + 0x00], %f0 ! ux = from[0]
- ld [%o5 + 0x04], %f1 ! uy = from[1]
- ld [%o5 + 0x08], %f2 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- fmuls %f0, M0, %f3 ! FGM Group
- fmuls %f1, M1, %f4 ! FGM Group
- fmuls %f0, M4, %f5 ! FGM Group
- fmuls %f1, M5, %f6 ! FGM Group
- fmuls %f0, M8, %f7 ! FGM Group f3 available
- fmuls %f1, M9, %f8 ! FGM Group f4 available
- fadds %f3, %f4, %f3 ! FGA
- fmuls %f2, M2, %f10 ! FGM Group f5 available
- fmuls %f2, M6, %f0 ! FGM Group f6 available
- fadds %f5, %f6, %f5 ! FGA
- fmuls %f2, M10, %f4 ! FGM Group f7 available
- fadds %f7, %f8, %f7 ! FGA Group f8,f3 available
- fadds %f3, %f10, %f3 ! FGA Group f10 available
- st %f3, [%g3 + 0x00] ! LSU
- fadds %f5, %f0, %f5 ! FGA Group stall f0,f5 available
- st %f5, [%g3 + 0x04] ! LSU
- fadds %f7, %f4, %f7 ! FGA Group stall f4,f7 available
- st %f7, [%g3 + 0x08] ! LSU
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_normalize_normals
-_mesa_sparc_normalize_normals:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
-
- sethi %hi(ONE_DOT_ZERO), %g2
- sub %sp, 16, %sp
- st %g2, [%sp + STACK_VAR_OFF+0x0]
- ld [%sp + STACK_VAR_OFF+0x0], %f12 ! f12 = 1.0f
- add %sp, 16, %sp
-
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- cmp %o3, 0
- bne 4f
- clr %o4 ! 'i' for STRIDE_LOOP
-
-1: /* LENGTHS == NULL */
- ld [%o5 + 0x00], %f3 ! ux = from[0]
- ld [%o5 + 0x04], %f5 ! uy = from[1]
- ld [%o5 + 0x08], %f7 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* f3=tx, f5=ty, f7=tz */
-
- /* len (f6) = (tx * tx) + (ty * ty) + (tz * tz) */
- fmuls %f3, %f3, %f6 ! FGM Group f3 available
- fmuls %f5, %f5, %f8 ! FGM Group f5 available
- fmuls %f7, %f7, %f10 ! FGM Group f7 available
- fadds %f6, %f8, %f6 ! FGA Group 2cyc stall f6,f8 available
- fadds %f6, %f10, %f6 ! FGA Group 4cyc stall f6,f10 available
-
- /* scale (f6) = 1.0 / sqrt(len) */
- fsqrts %f6, %f6 ! FDIV 20 cycles
- fdivs %f12, %f6, %f6 ! FDIV 14 cycles
-
- fmuls %f3, %f6, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale
- fmuls %f5, %f6, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale
- fmuls %f7, %f6, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
- ba 7f
- nop
-
-4: /* LENGTHS != NULL */
-
-5:
- ld [%o5 + 0x00], %f3 ! ux = from[0]
- ld [%o5 + 0x04], %f5 ! uy = from[1]
- ld [%o5 + 0x08], %f7 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- ld [%o3], %f13 ! LSU
- add %o3, 4, %o3 ! IEU0
-
- /* f3=tx, f5=ty, f7=tz, f13=lengths[i] */
-
- fmuls %f3, %f13, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * len
- fmuls %f5, %f13, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * len
- fmuls %f7, %f13, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * len
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 5b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
-
- .globl _mesa_sparc_rescale_normals
-_mesa_sparc_rescale_normals:
- /* o0=mat o1=scale o2=in o3=lengths o4=dest */
-
- sethi %hi(ONE_DOT_ZERO), %g2
- sub %sp, 16, %sp
- st %o1, [%sp + STACK_VAR_OFF+0x0]
- ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale
- add %sp, 16, %sp
-
- LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start
- ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count
- ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride
- LDPTR [%o4 + V4F_START], %g3 ! g3 = 'out' dest->start
-
- /* dest->count = in->count */
- st %g1, [%o4 + V4F_COUNT]
-
- cmp %g1, 1
- bl 7f
- clr %o4 ! 'i' for STRIDE_LOOP
-
-1:
- ld [%o5 + 0x00], %f3 ! ux = from[0]
- ld [%o5 + 0x04], %f5 ! uy = from[1]
- ld [%o5 + 0x08], %f7 ! uz = from[2]
- add %o5, %g2, %o5 ! STRIDE_F(from, stride)
- add %o4, 1, %o4 ! i++
-
- /* f3=tx, f5=ty, f7=tz */
-
- fmuls %f3, %f15, %f3
- st %f3, [%g3 + 0x00] ! out[i][0] = tx * scale
- fmuls %f5, %f15, %f5
- st %f5, [%g3 + 0x04] ! out[i][1] = ty * scale
- fmuls %f7, %f15, %f7
- st %f7, [%g3 + 0x08] ! out[i][2] = tz * scale
-
- cmp %o4, %g1 ! continue if (i < count)
- bl 1b
- add %g3, 0x0c, %g3 ! advance out vector pointer
-
-7: retl
- nop
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/sparc.c b/nx-X11/extras/Mesa/src/mesa/sparc/sparc.c
deleted file mode 100644
index b7fe360d2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/sparc.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Sparc assembly code by David S. Miller
- */
-
-
-#include "sparc.h"
-
-#ifdef USE_SPARC_ASM
-
-#include "context.h"
-#include "math/m_xform.h"
-#include "tnl/t_context.h"
-
-#ifdef DEBUG
-#include "math/m_debug.h"
-#endif
-
-#define XFORM_ARGS GLvector4f *to_vec, \
- const GLfloat m[16], \
- const GLvector4f *from_vec
-
-#define DECLARE_XFORM_GROUP(pfx, sz) \
- extern void _mesa_##pfx##_transform_points##sz##_general(XFORM_ARGS); \
- extern void _mesa_##pfx##_transform_points##sz##_identity(XFORM_ARGS); \
- extern void _mesa_##pfx##_transform_points##sz##_3d_no_rot(XFORM_ARGS); \
- extern void _mesa_##pfx##_transform_points##sz##_perspective(XFORM_ARGS); \
- extern void _mesa_##pfx##_transform_points##sz##_2d(XFORM_ARGS); \
- extern void _mesa_##pfx##_transform_points##sz##_2d_no_rot(XFORM_ARGS); \
- extern void _mesa_##pfx##_transform_points##sz##_3d(XFORM_ARGS);
-
-#define ASSIGN_XFORM_GROUP(pfx, sz) \
- _mesa_transform_tab[sz][MATRIX_GENERAL] = \
- _mesa_##pfx##_transform_points##sz##_general; \
- _mesa_transform_tab[sz][MATRIX_IDENTITY] = \
- _mesa_##pfx##_transform_points##sz##_identity; \
- _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
- _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] = \
- _mesa_##pfx##_transform_points##sz##_perspective; \
- _mesa_transform_tab[sz][MATRIX_2D] = \
- _mesa_##pfx##_transform_points##sz##_2d; \
- _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
- _mesa_transform_tab[sz][MATRIX_3D] = \
- _mesa_##pfx##_transform_points##sz##_3d;
-
-
-DECLARE_XFORM_GROUP(sparc, 1)
-DECLARE_XFORM_GROUP(sparc, 2)
-DECLARE_XFORM_GROUP(sparc, 3)
-DECLARE_XFORM_GROUP(sparc, 4)
-
-extern GLvector4f *_mesa_sparc_cliptest_points4(GLvector4f *clip_vec,
- GLvector4f *proj_vec,
- GLubyte clipMask[],
- GLubyte *orMask,
- GLubyte *andMask);
-
-extern GLvector4f *_mesa_sparc_cliptest_points4_np(GLvector4f *clip_vec,
- GLvector4f *proj_vec,
- GLubyte clipMask[],
- GLubyte *orMask,
- GLubyte *andMask);
-
-#define NORM_ARGS const GLmatrix *mat, \
- GLfloat scale, \
- const GLvector4f *in, \
- const GLfloat *lengths, \
- GLvector4f *dest
-
-extern void _mesa_sparc_transform_normalize_normals(NORM_ARGS);
-extern void _mesa_sparc_transform_normalize_normals_no_rot(NORM_ARGS);
-extern void _mesa_sparc_transform_rescale_normals_no_rot(NORM_ARGS);
-extern void _mesa_sparc_transform_rescale_normals(NORM_ARGS);
-extern void _mesa_sparc_transform_normals_no_rot(NORM_ARGS);
-extern void _mesa_sparc_transform_normals(NORM_ARGS);
-extern void _mesa_sparc_normalize_normals(NORM_ARGS);
-extern void _mesa_sparc_rescale_normals(NORM_ARGS);
-
-
-
-void _mesa_init_all_sparc_transform_asm(void)
-{
- ASSIGN_XFORM_GROUP(sparc, 1)
- ASSIGN_XFORM_GROUP(sparc, 2)
- ASSIGN_XFORM_GROUP(sparc, 3)
- ASSIGN_XFORM_GROUP(sparc, 4)
-
- _mesa_clip_tab[4] = _mesa_sparc_cliptest_points4;
- _mesa_clip_np_tab[4] = _mesa_sparc_cliptest_points4_np;
-
-#if 0
- /* disable these too. See bug 673938 */
- _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] =
- _mesa_sparc_transform_normalize_normals;
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] =
- _mesa_sparc_transform_normalize_normals_no_rot;
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =
- _mesa_sparc_transform_rescale_normals_no_rot;
- _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =
- _mesa_sparc_transform_rescale_normals;
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
- _mesa_sparc_transform_normals_no_rot;
- _mesa_normal_tab[NORM_TRANSFORM] =
- _mesa_sparc_transform_normals;
- _mesa_normal_tab[NORM_NORMALIZE] =
- _mesa_sparc_normalize_normals;
- _mesa_normal_tab[NORM_RESCALE] =
- _mesa_sparc_rescale_normals;
-#endif
-
-#ifdef DEBUG
- _math_test_all_transform_functions("sparc");
- _math_test_all_cliptest_functions("sparc");
- _math_test_all_normal_transform_functions("sparc");
-#endif
-}
-
-extern unsigned int _mesa_sparc_glapi_begin;
-extern unsigned int _mesa_sparc_glapi_end;
-extern void __glapi_sparc_icache_flush(unsigned int *);
-
-#endif /* USE_SPARC_ASM */
-
-
-void _mesa_init_sparc_glapi_relocs(void)
-{
-#ifdef USE_SPARC_ASM
- unsigned int *insn_ptr, *end_ptr;
- unsigned long disp_addr;
-
- insn_ptr = &_mesa_sparc_glapi_begin;
- end_ptr = &_mesa_sparc_glapi_end;
- disp_addr = (unsigned long) &_glapi_Dispatch;
-
- while (insn_ptr < end_ptr) {
-#ifdef __arch64__
- insn_ptr[0] |= (disp_addr >> (32 + 10));
- insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10);
- __glapi_sparc_icache_flush(&insn_ptr[0]);
- insn_ptr[2] |= ((disp_addr >> 32) & ((1 << 10) - 1));
- insn_ptr[3] |= (disp_addr & ((1 << 10) - 1));
- __glapi_sparc_icache_flush(&insn_ptr[2]);
- insn_ptr += 11;
-#else
- insn_ptr[0] |= (disp_addr >> 10);
- insn_ptr[1] |= (disp_addr & ((1 << 10) - 1));
- __glapi_sparc_icache_flush(&insn_ptr[0]);
- insn_ptr += 5;
-#endif
- }
-#endif /* USE_SPARC_ASM */
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/sparc.h b/nx-X11/extras/Mesa/src/mesa/sparc/sparc.h
deleted file mode 100644
index 497b5728c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/sparc.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $Id: sparc.h,v 1.1.1.1 2004/06/16 09:19:24 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.1
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Sparc assembly code by David S. Miller
- */
-
-
-#ifndef SPARC_H
-#define SPARC_H
-
-extern void _mesa_init_all_sparc_transform_asm(void);
-extern void _mesa_init_sparc_glapi_relocs(void);
-
-#endif /* !(SPARC_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/sparc_matrix.h b/nx-X11/extras/Mesa/src/mesa/sparc/sparc_matrix.h
deleted file mode 100644
index f677d9bda..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/sparc_matrix.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * SPARC assembly matrix code.
- */
-
-#ifndef _SPARC_MATRIX_H
-#define _SPARC_MATRIX_H
-
-#ifdef __arch64__
-#define LDPTR ldx
-#define MAT_M 0x00
-#define MAT_INV 0x08
-#define V4F_DATA 0x00
-#define V4F_START 0x08
-#define V4F_COUNT 0x10
-#define V4F_STRIDE 0x14
-#define V4F_SIZE 0x18
-#define V4F_FLAGS 0x1c
-#else
-#define LDPTR ld
-#define MAT_M 0x00
-#define MAT_INV 0x04
-#define V4F_DATA 0x00
-#define V4F_START 0x04
-#define V4F_COUNT 0x08
-#define V4F_STRIDE 0x0c
-#define V4F_SIZE 0x10
-#define V4F_FLAGS 0x14
-#endif
-
-#define VEC_SIZE_1 1
-#define VEC_SIZE_2 3
-#define VEC_SIZE_3 7
-#define VEC_SIZE_4 15
-
-#define M0 %f16
-#define M1 %f17
-#define M2 %f18
-#define M3 %f19
-#define M4 %f20
-#define M5 %f21
-#define M6 %f22
-#define M7 %f23
-#define M8 %f24
-#define M9 %f25
-#define M10 %f26
-#define M11 %f27
-#define M12 %f28
-#define M13 %f29
-#define M14 %f30
-#define M15 %f31
-
-#define LDMATRIX_0_1_2_3_12_13_14_15(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + (12 * 0x4)], M12; \
- ldd [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_1_12_13(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + (12 * 0x4)], M12
-
-#define LDMATRIX_0_12_13(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + (12 * 0x4)], M12
-
-#define LDMATRIX_0_1_2_12_13_14(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + (12 * 0x4)], M12; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_12_13_14(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + (12 * 0x4)], M12; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_14(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_1_2_3_4_5_6_7_12_13_14_15(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + ( 4 * 0x4)], M4; \
- ldd [BASE + ( 6 * 0x4)], M6; \
- ldd [BASE + (12 * 0x4)], M12; \
- ldd [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_5_12_13(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ldd [BASE + (12 * 0x4)], M12
-
-#define LDMATRIX_0_1_2_3_4_5_6_12_13_14(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + ( 4 * 0x4)], M4; \
- ld [BASE + ( 6 * 0x4)], M6; \
- ldd [BASE + (12 * 0x4)], M12; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_5_12_13_14(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ldd [BASE + (12 * 0x4)], M12; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_5_14(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + ( 4 * 0x4)], M4; \
- ldd [BASE + ( 6 * 0x4)], M6; \
- ldd [BASE + ( 8 * 0x4)], M8; \
- ldd [BASE + (10 * 0x4)], M10; \
- ldd [BASE + (12 * 0x4)], M12; \
- ldd [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_1_4_5_12_13(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ldd [BASE + ( 4 * 0x4)], M4; \
- ldd [BASE + (12 * 0x4)], M12
-
-#define LDMATRIX_0_5_12_13(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ldd [BASE + (12 * 0x4)], M12
-
-#define LDMATRIX_0_1_2_4_5_6_8_9_10(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + ( 4 * 0x4)], M4; \
- ld [BASE + ( 6 * 0x4)], M6; \
- ldd [BASE + ( 8 * 0x4)], M8; \
- ld [BASE + (10 * 0x4)], M10
-
-#define LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(BASE) \
- ldd [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 2 * 0x4)], M2; \
- ldd [BASE + ( 4 * 0x4)], M4; \
- ld [BASE + ( 6 * 0x4)], M6; \
- ldd [BASE + ( 8 * 0x4)], M8; \
- ld [BASE + (10 * 0x4)], M10; \
- ldd [BASE + (12 * 0x4)], M12; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_5_10(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ld [BASE + (10 * 0x4)], M10; \
-
-#define LDMATRIX_0_5_10_12_13_14(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ld [BASE + (10 * 0x4)], M10; \
- ldd [BASE + (12 * 0x4)], M12; \
- ld [BASE + (14 * 0x4)], M14
-
-#define LDMATRIX_0_5_8_9_10_14(BASE) \
- ld [BASE + ( 0 * 0x4)], M0; \
- ld [BASE + ( 5 * 0x4)], M5; \
- ldd [BASE + ( 8 * 0x4)], M8; \
- ld [BASE + (10 * 0x4)], M10; \
- ld [BASE + (14 * 0x4)], M14
-
-#endif /* !(_SPARC_MATRIX_H) */
diff --git a/nx-X11/extras/Mesa/src/mesa/sparc/xform.S b/nx-X11/extras/Mesa/src/mesa/sparc/xform.S
deleted file mode 100644
index 625d31cbd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/sparc/xform.S
+++ /dev/null
@@ -1,1393 +0,0 @@
-/* $Id: xform.S,v 1.1.1.2 2005/07/31 16:46:49 ajax Exp $ */
-
- /* TODO
- *
- * 1) It would be nice if load/store double could be used
- * at least for the matrix parts. I think for the matrices
- * it is safe, but for the vertices it probably is not due to
- * things like glInterleavedArrays etc.
- *
- * UPDATE: Trying this now in sparc_matrix.h -DaveM_990624
- *
- * 2) One extremely slick trick would be if we could enclose
- * groups of xform calls on the same vertices such that
- * we just load the matrix into f16-->f31 before the calls
- * and then we would not have to do them here. This may be
- * tricky and not much of a gain though.
- */
-
-#include "sparc_matrix.h"
-
-#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)
- /* Solaris requires this for 64-bit. */
- .register %g2, #scratch
- .register %g3, #scratch
-#endif
-
- .text
- .align 64
-
-__set_v4f_1:
- ld [%o0 + V4F_FLAGS], %g2
- mov 1, %g1
- st %g1, [%o0 + V4F_SIZE]
- or %g2, VEC_SIZE_1, %g2
- retl
- st %g2, [%o0 + V4F_FLAGS]
-__set_v4f_2:
- ld [%o0 + V4F_FLAGS], %g2
- mov 2, %g1
- st %g1, [%o0 + V4F_SIZE]
- or %g2, VEC_SIZE_2, %g2
- retl
- st %g2, [%o0 + V4F_FLAGS]
-__set_v4f_3:
- ld [%o0 + V4F_FLAGS], %g2
- mov 3, %g1
- st %g1, [%o0 + V4F_SIZE]
- or %g2, VEC_SIZE_3, %g2
- retl
- st %g2, [%o0 + V4F_FLAGS]
-__set_v4f_4:
- ld [%o0 + V4F_FLAGS], %g2
- mov 4, %g1
- st %g1, [%o0 + V4F_SIZE]
- or %g2, VEC_SIZE_4, %g2
- retl
- st %g2, [%o0 + V4F_FLAGS]
-
- /* First the raw versions. */
-
- .globl _mesa_sparc_transform_points1_general
-_mesa_sparc_transform_points1_general:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_3_12_13_14_15(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f8 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f1 ! FGM Group 1-cycle stall on %f0
- fmuls %f0, M1, %f2 ! FGM Group
- fmuls %f0, M2, %f3 ! FGM Group
- fmuls %f0, M3, %f4 ! FGM Group
- fmuls %f8, M0, %f9 ! FGM Group f1 available
- fadds %f1, M12, %f1 ! FGA
- st %f1, [%g2 + 0x00] ! LSU
- fmuls %f8, M1, %f10 ! FGM Group f2 available
- fadds %f2, M13, %f2 ! FGA
- st %f2, [%g2 + 0x04] ! LSU
- fmuls %f8, M2, %f11 ! FGM Group f3 available
- fadds %f3, M14, %f3 ! FGA
- st %f3, [%g2 + 0x08] ! LSU
- fmuls %f8, M3, %f12 ! FGM Group f4 available
- fadds %f4, M15, %f4 ! FGA
- st %f4, [%g2 + 0x0c] ! LSU
- fadds %f9, M12, %f9 ! FGA Group f9 available
- st %f9, [%g2 + 0x10] ! LSU
- fadds %f10, M13, %f10 ! FGA Group f10 available
- st %f10, [%g2 + 0x14] ! LSU
- fadds %f11, M14, %f11 ! FGA Group f11 available
- st %f11, [%g2 + 0x18] ! LSU
- fadds %f12, M15, %f12 ! FGA Group f12 available
- st %f12, [%g2 + 0x1c] ! LSU
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0 ! LSU Group
- fmuls %f0, M0, %f1 ! FGM Group 1-cycle stall on %f0
- fmuls %f0, M1, %f2 ! FGM Group
- fmuls %f0, M2, %f3 ! FGM Group
- fmuls %f0, M3, %f4 ! FGM Group
- fadds %f1, M12, %f1 ! FGA Group
- st %f1, [%g2 + 0x00] ! LSU
- fadds %f2, M13, %f2 ! FGA Group
- st %f2, [%g2 + 0x04] ! LSU
- fadds %f3, M14, %f3 ! FGA Group
- st %f3, [%g2 + 0x08] ! LSU
- fadds %f4, M15, %f4 ! FGA Group
- st %f4, [%g2 + 0x0c] ! LSU
-
-3:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points1_identity
-_mesa_sparc_transform_points1_identity:
- cmp %o0, %o2
- be 4f
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f1 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- st %f0, [%g2 + 0x00] ! LSU Group
- cmp %o1, %o2 ! IEU1
- st %f1, [%g2 + 0x10] ! LSU Group
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0
- addx %g0, %g0, %g0
- st %f0, [%g2 + 0x00]
-
-3:
- ba __set_v4f_1
- nop
-
-4: retl
- nop
-
- .globl _mesa_sparc_transform_points1_2d
-_mesa_sparc_transform_points1_2d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_12_13(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f8 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f1 ! FGM Group
- fmuls %f0, M1, %f2 ! FGM Group
- fmuls %f8, M0, %f9 ! FGM Group
- fmuls %f8, M1, %f10 ! FGM Group
- fadds %f1, M12, %f3 ! FGA Group f1 available
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f2, M13, %f4 ! FGA Group f2 available
- st %f4, [%g2 + 0x04] ! LSU
- fadds %f9, M12, %f11 ! FGA Group f9 available
- st %f11, [%g2 + 0x10] ! LSU
- fadds %f10, M13, %f12 ! FGA Group f10 available
- st %f12, [%g2 + 0x14] ! LSU
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0
- fmuls %f0, M0, %f1
- fmuls %f0, M1, %f2
- fadds %f1, M12, %f3
- st %f3, [%g2 + 0x00]
- fadds %f2, M13, %f4
- st %f4, [%g2 + 0x04]
-
-3:
- ba __set_v4f_2
- nop
-
- .globl _mesa_sparc_transform_points1_2d_no_rot
-_mesa_sparc_transform_points1_2d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_12_13(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f4 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f1 ! FGM Group
- fmuls %f4, M0, %f5 ! FGM Group
- fadds %f1, M12, %f3 ! FGA Group, 2 cycle stall, f1 available
- st %f3, [%g2 + 0x00] ! LSU
- st M13, [%g2 + 0x04] ! LSU Group, f5 available
- fadds %f5, M12, %f6 ! FGA
- st %f6, [%g2 + 0x10] ! LSU Group
- st M13, [%g2 + 0x14] ! LSU Group
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0
- fmuls %f0, M0, %f1
- fadds %f1, M12, %f3
- st %f3, [%g2 + 0x00]
- st M13, [%g2 + 0x04]
-
-3:
- ba __set_v4f_2
- nop
-
- .globl _mesa_sparc_transform_points1_3d
-_mesa_sparc_transform_points1_3d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_12_13_14(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f4 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f1 ! FGM Group
- fmuls %f0, M1, %f2 ! FGM Group
- fmuls %f0, M2, %f3 ! FGM Group
- fmuls %f4, M0, %f5 ! FGM Group
- fadds %f1, M12, %f1 ! FGA Group, f1 available
- st %f1, [%g2 + 0x00] ! LSU
- fmuls %f4, M1, %f6 ! FGM
- fadds %f2, M13, %f2 ! FGA Group, f2 available
- st %f2, [%g2 + 0x04] ! LSU
- fmuls %f4, M2, %f7 ! FGM
- fadds %f3, M14, %f3 ! FGA Group, f3 available
- st %f3, [%g2 + 0x08] ! LSU
- fadds %f5, M12, %f5 ! FGA Group, f5 available
- st %f5, [%g2 + 0x10] ! LSU
- fadds %f6, M13, %f6 ! FGA Group, f6 available
- st %f6, [%g2 + 0x14] ! LSU
- fadds %f7, M14, %f7 ! FGA Group, f7 available
- st %f7, [%g2 + 0x18] ! LSU
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0
- fmuls %f0, M0, %f1
- fmuls %f0, M1, %f2
- fmuls %f0, M2, %f3
- fadds %f1, M12, %f1
- st %f1, [%g2 + 0x00]
- fadds %f2, M13, %f2
- st %f2, [%g2 + 0x04]
- fadds %f3, M14, %f3
- st %f3, [%g2 + 0x08]
-
-3:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points1_3d_no_rot
-_mesa_sparc_transform_points1_3d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_12_13_14(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f2 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f1 ! FGM Group
- fmuls %f2, M0, %f3 ! FGM Group
- fadds %f1, M12, %f1 ! FGA Group, 2 cycle stall, f1 available
- st %f1, [%g2 + 0x00] ! LSU
- fadds %f3, M12, %f3 ! FGA Group, f3 available
- st M13, [%g2 + 0x04] ! LSU
- st M14, [%g2 + 0x08] ! LSU Group
- st %f3, [%g2 + 0x10] ! LSU Group
- st M13, [%g2 + 0x14] ! LSU Group
- st M14, [%g2 + 0x18] ! LSU Group
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0
- fmuls %f0, M0, %f1
- fadds %f1, M12, %f1
- st %f1, [%g2 + 0x00]
- st M13, [%g2 + 0x04]
- st M14, [%g2 + 0x08]
-
-3:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points1_perspective
-_mesa_sparc_transform_points1_perspective:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_14(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- ld [%g1 + 0x00], %f2 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f1 ! FGM Group
- st %f1, [%g2 + 0x00] ! LSU
- fmuls %f2, M0, %f3 ! FGM Group
- st %g0, [%g2 + 0x04] ! LSU
- st M14, [%g2 + 0x08] ! LSU Group
- st %g0, [%g2 + 0x0c] ! LSU Group
- st %f3, [%g2 + 0x10] ! LSU Group
- st %g0, [%g2 + 0x14] ! LSU Group
- st M14, [%g2 + 0x18] ! LSU Group
- st %g0, [%g2 + 0x1c] ! LSU Group
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0
- fmuls %f0, M0, %f1
- st %f1, [%g2 + 0x00]
- st %g0, [%g2 + 0x04]
- st M14, [%g2 + 0x08]
- st %g0, [%g2 + 0x0c]
-
-3:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points2_general
-_mesa_sparc_transform_points2_general:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_3_4_5_6_7_12_13_14_15(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f2 ! FGM Group
- fmuls %f0, M1, %f3 ! FGM Group
- fmuls %f0, M2, %f4 ! FGM Group
- fmuls %f0, M3, %f5 ! FGM Group
- fadds %f2, M12, %f2 ! FGA Group f2 available
- fmuls %f1, M4, %f6 ! FGM
- fadds %f3, M13, %f3 ! FGA Group f3 available
- fmuls %f1, M5, %f7 ! FGM
- fadds %f4, M14, %f4 ! FGA Group f4 available
- fmuls %f1, M6, %f8 ! FGM
- fadds %f5, M15, %f5 ! FGA Group f5 available
- fmuls %f1, M7, %f9 ! FGM
- fadds %f2, %f6, %f2 ! FGA Group f6 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, %f7, %f3 ! FGA Group f7 available
- st %f3, [%g2 + 0x04] ! LSU
- fadds %f4, %f8, %f4 ! FGA Group f8 available
- st %f4, [%g2 + 0x08] ! LSU
- fadds %f5, %f9, %f5 ! FGA Group f9 available
- st %f5, [%g2 + 0x0c] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points2_identity
-_mesa_sparc_transform_points2_identity:
- cmp %o2, %o0
- be 3f
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- ld [%g1 + 0x04], %f1 ! LSU Group
- add %g1, %o5, %g1 ! IEU0
- cmp %o1, %g3 ! IEU1
- st %f0, [%g2 + 0x00] ! LSU Group
- st %f1, [%g2 + 0x04] ! LSU Group
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0
-2:
- ba __set_v4f_2
- nop
-
-3: retl
- nop
-
- .globl _mesa_sparc_transform_points2_2d
-_mesa_sparc_transform_points2_2d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_4_5_12_13(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f2 ! FGM
- ld [%g1 + 0x00], %f8 ! LSU Group
- fmuls %f0, M1, %f3 ! FGM
- ld [%g1 + 0x04], %f9 ! LSU Group
- fmuls %f1, M4, %f6 ! FGM
- fmuls %f1, M5, %f7 ! FGM Group
- add %g1, %o5, %g1 ! IEU0
- fmuls %f8, M0, %f10 ! FGM Group f2 available
- fadds %f2, M12, %f2 ! FGA
- fmuls %f8, M1, %f11 ! FGM Group f3 available
- fadds %f3, M13, %f3 ! FGA
- fmuls %f9, M4, %f12 ! FGM Group
- fmuls %f9, M5, %f13 ! FGM Group
- fadds %f10, M12, %f10 ! FGA Group f2, f10 available
- fadds %f2, %f6, %f2 ! FGA Group f3, f11 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f11, M13, %f11 ! FGA Group f12 available
- fadds %f3, %f7, %f3 ! FGA Group f13 available
- st %f3, [%g2 + 0x04] ! LSU
- fadds %f10, %f12, %f10 ! FGA Group f10 available
- st %f10, [%g2 + 0x10] ! LSU
- fadds %f11, %f13, %f11 ! FGA Group f11 available
- st %f11, [%g2 + 0x14] ! LSU
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM Group
- fmuls %f0, M1, %f3 ! FGM Group
- fmuls %f1, M4, %f6 ! FGM Group
- fmuls %f1, M5, %f7 ! FGM Group
- fadds %f2, M12, %f2 ! FGA Group f2 available
- fadds %f3, M13, %f3 ! FGA Group f3 available
- fadds %f2, %f6, %f2 ! FGA Group 2 cycle stall, f2 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, %f7, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x04] ! LSU
-
-3:
- ba __set_v4f_2
- nop
-
- .globl _mesa_sparc_transform_points2_2d_no_rot
-_mesa_sparc_transform_points2_2d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_12_13(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- ld [%g1 + 0x00], %f4 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM
- ld [%g1 + 0x04], %f5 ! LSU Group
- fmuls %f1, M5, %f3 ! FGM
- fmuls %f4, M0, %f6 ! FGM Group
- add %g1, %o5, %g1 ! IEU0
- fmuls %f5, M5, %f7 ! FGM Group
- fadds %f2, M12, %f2 ! FGA Group f2 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, M13, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x04] ! LSU
- fadds %f6, M12, %f6 ! FGA Group f6 available
- st %f6, [%g2 + 0x10] ! LSU
- fadds %f7, M13, %f7 ! FGA Group f7 available
- st %f7, [%g2 + 0x14] ! LSU
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM Group
- fmuls %f1, M5, %f3 ! FGM Group
- fadds %f2, M12, %f2 ! FGA Group, 2 cycle stall, f2 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, M13, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x04] ! LSU
-
-3:
- ba __set_v4f_2
- nop
-
- /* orig: 12 cycles */
- .globl _mesa_sparc_transform_points2_3d
-_mesa_sparc_transform_points2_3d:
- ld [%o2 + V4F_STRIDE], %o5
- ld [%o2 + V4F_START], %g1
- ld [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_3_4_5_6_12_13_14(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o1
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- add %o1, 2, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- ld [%g1 + 0x00], %f9 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM
- ld [%g1 + 0x04], %f10 ! LSU Group
- fmuls %f0, M1, %f3 ! FGM
- fmuls %f0, M2, %f4 ! FGM Group
- add %g1, %o5, %g1 ! IEU0
- fmuls %f1, M4, %f6 ! FGM Group
- fmuls %f1, M5, %f7 ! FGM Group f2 available
- fadds %f2, M12, %f2 ! FGA
- fmuls %f1, M6, %f8 ! FGM Group f3 available
- fadds %f3, M13, %f3 ! FGA
- fmuls %f9, M0, %f11 ! FGM Group f4 available
- fadds %f4, M14, %f4 ! FGA
- fmuls %f9, M1, %f12 ! FGM Group f6 available
- fmuls %f9, M2, %f13 ! FGM Group f2, f7 available
- fadds %f2, %f6, %f2 ! FGA
- st %f2, [%g2 + 0x00] ! LSU
- fmuls %f10, M4, %f14 ! FGM Group f3, f8 available
- fadds %f3, %f7, %f3 ! FGA
- st %f3, [%g2 + 0x04] ! LSU
- fmuls %f10, M5, %f15 ! FGM Group f4, f11 available
- fadds %f11, M12, %f11 ! FGA
- fmuls %f10, M6, %f0 ! FGM Group f12 available
- fadds %f12, M13, %f12 ! FGA
- fadds %f13, M14, %f13 ! FGA Group f13 available
- fadds %f4, %f8, %f4 ! FGA Group f14 available
- st %f4, [%g2 + 0x08] ! LSU
- fadds %f11, %f14, %f11 ! FGA Group f15, f11 available
- st %f11, [%g2 + 0x10] ! LSU
- fadds %f12, %f15, %f12 ! FGA Group f0, f12 available
- st %f12, [%g2 + 0x14] ! LSU
- fadds %f13, %f0, %f13 ! FGA Group f13 available
- st %f13, [%g2 + 0x18] ! LSU
-
- cmp %o1, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o1, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM Group
- fmuls %f0, M1, %f3 ! FGM Group
- fmuls %f0, M2, %f4 ! FGM Group
- fmuls %f1, M4, %f6 ! FGM Group
- fmuls %f1, M5, %f7 ! FGM Group f2 available
- fadds %f2, M12, %f2 ! FGA
- fmuls %f1, M6, %f8 ! FGM Group f3 available
- fadds %f3, M13, %f3 ! FGA
- fadds %f4, M14, %f4 ! FGA Group f4 available
- fadds %f2, %f6, %f2 ! FGA Group stall, f2, f6, f7 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, %f7, %f3 ! FGA Group f3, f8 available
- st %f3, [%g2 + 0x04] ! LSU
- fadds %f4, %f8, %f4 ! FGA Group f4 available
- st %f4, [%g2 + 0x08] ! LSU
-
-3:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points2_3d_no_rot
-_mesa_sparc_transform_points2_3d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_12_13_14(%o1)
-
- cmp %g3, 1
- st %g3, [%o0 + V4F_COUNT]
- bl 3f
- clr %o3
-
- be 2f
- andn %g3, 1, %o2
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- add %o3, 2, %o3 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- ld [%g1 + 0x00], %f4 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM
- ld [%g1 + 0x04], %f5 ! LSU Group
- fmuls %f1, M5, %f3 ! FGM
- fmuls %f4, M0, %f6 ! FGM Group
- add %g1, %o5, %g1 ! IEU0
- fmuls %f5, M5, %f7 ! FGM Group
- fadds %f2, M12, %f2 ! FGA Group f2 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, M13, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x04] ! LSU
- fadds %f6, M12, %f6 ! FGA Group f6 available
- st M14, [%g2 + 0x08] ! LSU
- fadds %f7, M13, %f7 ! FGA Group f7 available
- st %f6, [%g2 + 0x10] ! LSU
- st %f7, [%g2 + 0x14] ! LSU Group
- st M14, [%g2 + 0x18] ! LSU Group
- cmp %o3, %o2 ! IEU1
- bne 1b ! CTI
- add %g2, 0x20, %g2 ! IEU0 Group
-
- cmp %o3, %g3
- be 3f
- nop
-
-2: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- fmuls %f0, M0, %f2 ! FGM Group
- fmuls %f1, M5, %f3 ! FGM Group
- fadds %f2, M12, %f2 ! FGA Group, 2 cycle stall, f2 available
- st %f2, [%g2 + 0x00] ! LSU
- fadds %f3, M13, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x04] ! LSU
- st M14, [%g2 + 0x08] ! LSU Group
-
-3: ld [%o1 + (14 * 0x4)], %g3
- cmp %g3, 0
- bne __set_v4f_3
- nop
- ba __set_v4f_2
- nop
-
- .globl _mesa_sparc_transform_points2_perspective
-_mesa_sparc_transform_points2_perspective:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0
- ld [%g1 + 0x04], %f1
- add %o1, 1, %o1
- add %g1, %o5, %g1
- fmuls %f0, M0, %f2
- st %f2, [%g2 + 0x00]
- fmuls %f1, M5, %f3
- st %f3, [%g2 + 0x04]
- st M14, [%g2 + 0x08]
- st %g0, [%g2 + 0x0c]
- cmp %o1, %g3
- bne 1b
- add %g2, 0x10, %g2
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points3_general
-_mesa_sparc_transform_points3_general:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f3 ! FGM
- fmuls %f1, M4, %f7 ! FGM Group
- fmuls %f0, M1, %f4 ! FGM Group
- fmuls %f1, M5, %f8 ! FGM Group
- fmuls %f0, M2, %f5 ! FGM Group f3 available
- fmuls %f1, M6, %f9 ! FGM Group f7 available
- fadds %f3, %f7, %f3 ! FGA
- fmuls %f0, M3, %f6 ! FGM Group f4 available
- fmuls %f1, M7, %f10 ! FGM Group f8 available
- fadds %f4, %f8, %f4 ! FGA
- fmuls %f2, M8, %f7 ! FGM Group f5 available
- fmuls %f2, M9, %f8 ! FGM Group f9,f3 available
- fadds %f5, %f9, %f5 ! FGA
- fmuls %f2, M10, %f9 ! FGM Group f6 available
- fadds %f6, %f10, %f6 ! FGA Group f10,f4 available
- fmuls %f2, M11, %f10 ! FGM
- fadds %f3, M12, %f3 ! FGA Group f7 available
- fadds %f4, M13, %f4 ! FGA Group f8,f5 available
- fadds %f5, M14, %f5 ! FGA Group f9 available
- fadds %f6, M15, %f6 ! FGA Group f10,f6 available
- fadds %f3, %f7, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f4, %f8, %f4 ! FGA Group f4 available
- st %f4, [%g2 + 0x04] ! LSU
- fadds %f5, %f9, %f5 ! FGA Group f5 available
- st %f5, [%g2 + 0x08] ! LSU
- fadds %f6, %f10, %f6 ! FGA Group f6 available
- st %f6, [%g2 + 0x0c] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points3_identity
-_mesa_sparc_transform_points3_identity:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0
- ld [%g1 + 0x04], %f1
- ld [%g1 + 0x08], %f2
- add %o1, 1, %o1
- add %g1, %o5, %g1
- cmp %o1, %g3
- st %f0, [%g2 + 0x00]
- st %f1, [%g2 + 0x04]
- st %f2, [%g2 + 0x08]
- bne 1b
- add %g2, 0x10, %g2
-2:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points3_2d
-_mesa_sparc_transform_points3_2d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_4_5_12_13(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f3 ! FGM
- fmuls %f0, M1, %f4 ! FGM Group
- fmuls %f1, M4, %f6 ! FGM Group
- fmuls %f1, M5, %f7 ! FGM Group
- fadds %f3, M12, %f3 ! FGA Group f3 available
- fadds %f4, M13, %f4 ! FGA Group f4 available
- fadds %f3, %f6, %f3 ! FGA Group f6 available
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f4, %f7, %f4 ! FGA Group f7 available
- st %f4, [%g2 + 0x04] ! LSU
- st %f2, [%g2 + 0x08] ! LSU Group
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points3_2d_no_rot
-_mesa_sparc_transform_points3_2d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_12_13(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f3 ! FGM
- fmuls %f1, M5, %f4 ! FGM Group
- st %f2, [%g2 + 0x08] ! LSU
- fadds %f3, M12, %f3 ! FGA Group
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f4, M13, %f4 ! FGA Group
- st %f4, [%g2 + 0x04] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points3_3d
-_mesa_sparc_transform_points3_3d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f3 ! FGM
- fmuls %f1, M4, %f6 ! FGM Group
- fmuls %f0, M1, %f4 ! FGM Group
- fmuls %f1, M5, %f7 ! FGM Group
- fmuls %f0, M2, %f5 ! FGM Group f3 available
- fmuls %f1, M6, %f8 ! FGM Group f6 available
- fadds %f3, %f6, %f3 ! FGA
- fmuls %f2, M8, %f9 ! FGM Group f4 available
- fmuls %f2, M9, %f10 ! FGM Group f7 available
- fadds %f4, %f7, %f4 ! FGA
- fmuls %f2, M10, %f11 ! FGM Group f5 available
- fadds %f5, %f8, %f5 ! FGA Group f8, f3 available
- fadds %f3, %f9, %f3 ! FGA Group f9 available
- fadds %f4, %f10, %f4 ! FGA Group f10, f4 available
- fadds %f5, %f11, %f5 ! FGA Group stall, f11, f5 available
- fadds %f3, M12, %f3 ! FGA Group f3 available
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f4, M13, %f4 ! FGA Group f4 available
- st %f4, [%g2 + 0x04] ! LSU
- fadds %f5, M14, %f5 ! FGA Group f5 available
- st %f5, [%g2 + 0x08] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points3_3d_no_rot
-_mesa_sparc_transform_points3_3d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_10_12_13_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- cmp %o1, %g3 ! IEU1 Group
- fmuls %f0, M0, %f3 ! FGM
- fmuls %f1, M5, %f4 ! FGM Group
- fmuls %f2, M10, %f5 ! FGM Group
- fadds %f3, M12, %f3 ! FGA Group, stall, f3 available
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f4, M13, %f4 ! FGA Group, f4 available
- st %f4, [%g2 + 0x04] ! LSU
- fadds %f5, M14, %f5 ! FGA Group, f5 available
- st %f5, [%g2 + 0x08] ! LEU
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_3
- nop
-
- .globl _mesa_sparc_transform_points3_perspective
-_mesa_sparc_transform_points3_perspective:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_8_9_10_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f3 ! FGM
- fmuls %f2, M8, %f6 ! FGM Group
- fmuls %f1, M5, %f4 ! FGM Group
- fmuls %f2, M9, %f7 ! FGM Group
- fmuls %f2, M10, %f5 ! FGM Group f3 available
- fadds %f3, %f6, %f3 ! FGA Group f6 available
- st %f3, [%g2 + 0x00] ! LSU
- fadds %f4, %f7, %f4 ! FGA Group stall, f4, f7 available
- st %f4, [%g2 + 0x04] ! LSU
- fadds %f5, M14, %f5 ! FGA Group
- st %f5, [%g2 + 0x08] ! LSU
- fnegs %f2, %f6 ! FGA Group
- st %f6, [%g2 + 0x0c] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_general
-_mesa_sparc_transform_points4_general:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- ld [%g1 + 0x0c], %f3 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f4 ! FGM Group
- fmuls %f1, M4, %f8 ! FGM Group
- fmuls %f0, M1, %f5 ! FGM Group
- fmuls %f1, M5, %f9 ! FGM Group
- fmuls %f0, M2, %f6 ! FGM Group f4 available
- fmuls %f1, M6, %f10 ! FGM Group f8 available
- fadds %f4, %f8, %f4 ! FGA
- fmuls %f0, M3, %f7 ! FGM Group f5 available
- fmuls %f1, M7, %f11 ! FGM Group f9 available
- fadds %f5, %f9, %f5 ! FGA
- fmuls %f2, M8, %f12 ! FGM Group f6 available
- fmuls %f2, M9, %f13 ! FGM Group f10, f4 available
- fadds %f6, %f10, %f6 ! FGA
- fmuls %f2, M10, %f14 ! FGM Group f7 available
- fmuls %f2, M11, %f15 ! FGM Group f11, f5 available
- fadds %f7, %f11, %f7 ! FGA
- fmuls %f3, M12, %f8 ! FGM Group f12 available
- fadds %f4, %f12, %f4 ! FGA
- fmuls %f3, M13, %f9 ! FGM Group f13, f6 available
- fadds %f5, %f13, %f5 ! FGA
- fmuls %f3, M14, %f10 ! FGM Group f14 available
- fadds %f6, %f14, %f6 ! FGA
- fmuls %f3, M15, %f11 ! FGM Group f15, f7 available
- fadds %f7, %f15, %f7 ! FGA
- fadds %f4, %f8, %f4 ! FGA Group f8, f4 available
- st %f4, [%g2 + 0x00] ! LSU
- fadds %f5, %f9, %f5 ! FGA Group f9, f5 available
- st %f5, [%g2 + 0x04] ! LSU
- fadds %f6, %f10, %f6 ! FGA Group f10, f6 available
- st %f6, [%g2 + 0x08] ! LSU
- fadds %f7, %f11, %f7 ! FGA Group f11, f7 available
- st %f7, [%g2 + 0x0c] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_identity
-_mesa_sparc_transform_points4_identity:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0
- ld [%g1 + 0x04], %f1
- ld [%g1 + 0x08], %f2
- add %o1, 1, %o1
- ld [%g1 + 0x0c], %f3
- add %g1, %o5, %g1
- st %f0, [%g2 + 0x00]
- st %f1, [%g2 + 0x04]
- st %f2, [%g2 + 0x08]
- cmp %o1, %g3
- st %f3, [%g2 + 0x0c]
- bne 1b
- add %g2, 0x10, %g2
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_2d
-_mesa_sparc_transform_points4_2d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_4_5_12_13(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- ld [%g1 + 0x0c], %f3 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f4 ! FGM
- fmuls %f1, M4, %f8 ! FGM Group
- fmuls %f0, M1, %f5 ! FGM Group
- fmuls %f1, M5, %f9 ! FGM Group f4 available
- fmuls %f3, M12, %f12 ! FGM Group
- fmuls %f3, M13, %f13 ! FGM Group f8 available
- fadds %f4, %f8, %f4 ! FGA
- fadds %f5, %f9, %f5 ! FGA Group stall, f5, f9 available
- fadds %f4, %f12, %f4 ! FGA Group 2 cycle stall, f4, f12, f13 avail
- st %f4, [%g2 + 0x00] ! LSU
- fadds %f5, %f13, %f5 ! FGA Group f5 available
- st %f5, [%g2 + 0x04] ! LSU
- st %f2, [%g2 + 0x08] ! LSU Group
- st %f3, [%g2 + 0x0c] ! LSU Group
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_2d_no_rot
-_mesa_sparc_transform_points4_2d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_4_5_12_13(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0
- ld [%g1 + 0x04], %f1
- ld [%g1 + 0x08], %f2
- ld [%g1 + 0x0c], %f3
- add %o1, 1, %o1
- add %g1, %o5, %g1
- fmuls %f0, M0, %f4
- fmuls %f3, M12, %f8
- fmuls %f1, M5, %f5
- fmuls %f3, M13, %f9
- fadds %f4, %f8, %f4
- st %f4, [%g2 + 0x00]
- fadds %f5, %f9, %f5
- st %f5, [%g2 + 0x04]
- st %f2, [%g2 + 0x08]
- st %f3, [%g2 + 0x0c]
- cmp %o1, %g3
- bne 1b
- add %g2, 0x10, %g2
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_3d
-_mesa_sparc_transform_points4_3d:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_1_2_4_5_6_8_9_10_12_13_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- ld [%g1 + 0x0c], %f3 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f4 ! FGM
- fmuls %f1, M4, %f7 ! FGM Group
- fmuls %f0, M1, %f5 ! FGM Group
- fmuls %f1, M5, %f8 ! FGM Group
- fmuls %f0, M2, %f6 ! FGM Group f4 available
- fmuls %f1, M6, %f9 ! FGM Group f7 available
- fadds %f4, %f7, %f4 ! FGA
- fmuls %f2, M8, %f10 ! FGM Group f5 available
- fmuls %f2, M9, %f11 ! FGM Group f8 available
- fadds %f5, %f8, %f5 ! FGA
- fmuls %f2, M10, %f12 ! FGM Group f6 available
- fmuls %f3, M12, %f13 ! FGM Group f9, f4 available
- fadds %f6, %f9, %f6 ! FGA
- fmuls %f3, M13, %f14 ! FGM Group f10 available
- fadds %f4, %f10, %f4 ! FGA
- fmuls %f3, M14, %f15 ! FGM Group f11, f5 available
- fadds %f5, %f11, %f5 ! FGA
- fadds %f6, %f12, %f6 ! FGA Group stall, f12, f13, f6 available
- fadds %f4, %f13, %f4 ! FGA Group f14, f4 available
- st %f4, [%g2 + 0x00] ! LSU
- fadds %f5, %f14, %f5 ! FGA Group f15, f5 available
- st %f5, [%g2 + 0x04] ! LSU
- fadds %f6, %f15, %f6 ! FGA Group f6 available
- st %f6, [%g2 + 0x08] ! LSU
- st %f3, [%g2 + 0x0c] ! LSU Group
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_3d_no_rot
-_mesa_sparc_transform_points4_3d_no_rot:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_10_12_13_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- ld [%g1 + 0x0c], %f3 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f4 ! FGM
- fmuls %f3, M12, %f7 ! FGM Group
- fmuls %f1, M5, %f5 ! FGM Group
- fmuls %f3, M13, %f8 ! FGM Group
- fmuls %f2, M10, %f6 ! FGM Group f4 available
- fmuls %f3, M14, %f9 ! FGM Group f7 available
- fadds %f4, %f7, %f4 ! FGA
- st %f4, [%g2 + 0x00] ! LSU
- fadds %f5, %f8, %f5 ! FGA Group stall, f5, f8 available
- st %f5, [%g2 + 0x04] ! LSU
- fadds %f6, %f9, %f6 ! FGA Group stall, f6, f9 available
- st %f6, [%g2 + 0x08] ! LSU
- st %f3, [%g2 + 0x0c] ! LSU Group
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
-
- .globl _mesa_sparc_transform_points4_perspective
-_mesa_sparc_transform_points4_perspective:
- ld [%o2 + V4F_STRIDE], %o5
- LDPTR [%o2 + V4F_START], %g1
- LDPTR [%o0 + V4F_START], %g2
- ld [%o2 + V4F_COUNT], %g3
-
- LDMATRIX_0_5_8_9_10_14(%o1)
-
- cmp %g3, 0
- st %g3, [%o0 + V4F_COUNT]
- be 2f
- clr %o1
-
-1: ld [%g1 + 0x00], %f0 ! LSU Group
- ld [%g1 + 0x04], %f1 ! LSU Group
- ld [%g1 + 0x08], %f2 ! LSU Group
- ld [%g1 + 0x0c], %f3 ! LSU Group
- add %o1, 1, %o1 ! IEU0
- add %g1, %o5, %g1 ! IEU1
- fmuls %f0, M0, %f4 ! FGM
- fmuls %f2, M8, %f7 ! FGM Group
- fmuls %f1, M5, %f5 ! FGM Group
- fmuls %f2, M9, %f8 ! FGM Group
- fmuls %f2, M10, %f6 ! FGM Group f4 available
- fmuls %f3, M14, %f9 ! FGM Group f7 available
- fadds %f4, %f7, %f4 ! FGA
- st %f4, [%g2 + 0x00] ! LSU
- fadds %f5, %f8, %f5 ! FGA Group stall, f5, f8 available
- st %f5, [%g2 + 0x04] ! LSU
- fadds %f6, %f9, %f6 ! FGA Group stall, f6, f9 available
- st %f6, [%g2 + 0x08] ! LSU
- fnegs %f2, %f7 ! FGA Group
- st %f7, [%g2 + 0x0c] ! LSU
- cmp %o1, %g3 ! IEU1
- bne 1b ! CTI
- add %g2, 0x10, %g2 ! IEU0 Group
-2:
- ba __set_v4f_4
- nop
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast/NOTES b/nx-X11/extras/Mesa/src/mesa/swrast/NOTES
deleted file mode 100644
index f906e41b9..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast/NOTES
+++ /dev/null
@@ -1,55 +0,0 @@
-INTRODUCTION
-
-Mesa's native software rasterizer. This module provides the fallback
-paths for rasterization operations and states that aren't accelerated
-in hardware drivers, and as the full rasterization engine in software
-drivers.
-
-The swrast module 'stands alone', relying only on interfaces to core
-mesa and it's own driver interface. It knows nothing about the tnl or
-other modules, allowing it to be used for fallback paths in future tnl
-schemes without modification.
-
-As well as providing triangle/line/point rasterization functionality,
-the module provides implementations of the pixel operations
-(ReadPixels, etc), and texture operations (CopyTexSubImage) which may
-be plugged in to the core Mesa driver interface where accelerated
-versions of these operations are unavailable.
-
-
-STATE
-
-To create and destroy the module:
-
- GLboolean _swrast_CreateContext( GLcontext *ctx );
- void _swrast_DestroyContext( GLcontext *ctx );
-
-This module tracks state changes internally and maintains derived
-values based on the current state. For this to work, the driver
-ensure the following funciton is called whenever the state changes and
-the swsetup module is 'awake':
-
- void _swrast_InvalidateState( GLcontext *ctx, GLuint new_state );
-
-There is no explicit call to put the swrast module to sleep.
-
-
-CUSTOMIZATION
-
- void (*choose_point)( GLcontext * );
- void (*choose_line)( GLcontext * );
- void (*choose_triangle)( GLcontext * );
-
-Drivers may add additional triangle/line/point functions to swrast by
-overriding these functions. It is necessary for the driver to be very
-careful that it doesn't return an inappropriate function, eg a
-rasterization function in feedback mode. See the X11 driver for
-examples.
-
-DRIVER INTERFACE
-
-The swrast device driver provides swrast primarily with span- and
-pixel- level interfaces to a framebuffer, with a few additional hooks
-for locking and setting the read buffer.
-
-See the definition of struct swrast_device_driver in swrast.h. \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast/descrip.mms b/nx-X11/extras/Mesa/src/mesa/swrast/descrip.mms
deleted file mode 100644
index 7b3562770..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast/descrip.mms
+++ /dev/null
@@ -1,76 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 23 March 2004
-
-.first
- define gl [---.include.gl]
- define math [-.math]
- define swrast [-.swrast]
- define array_cache [-.array_cache]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main],[-.glapi],[-.shader]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = s_aaline.c s_aatriangle.c s_accum.c s_alpha.c \
- s_bitmap.c s_blend.c s_buffers.c s_context.c s_copypix.c s_depth.c \
- s_drawpix.c s_feedback.c s_fog.c s_imaging.c s_lines.c s_logic.c \
- s_masking.c s_nvfragprog.c s_pixeltex.c s_points.c s_readpix.c \
- s_span.c s_stencil.c s_texstore.c s_texture.c s_triangle.c s_zoom.c \
- s_atifragshader.c
-
-OBJECTS = s_aaline.obj,s_aatriangle.obj,s_accum.obj,s_alpha.obj,\
- s_bitmap.obj,s_blend.obj,\
- s_buffers.obj,s_context.obj,s_atifragshader.obj,\
- s_copypix.obj,s_depth.obj,s_drawpix.obj,s_feedback.obj,s_fog.obj,\
- s_imaging.obj,s_lines.obj,s_logic.obj,s_masking.obj,s_nvfragprog.obj,\
- s_pixeltex.obj,s_points.obj,s_readpix.obj,s_span.obj,s_stencil.obj,\
- s_texstore.obj,s_texture.obj,s_triangle.obj,s_zoom.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-s_atifragshader.obj : s_atifragshader.c
-s_aaline.obj : s_aaline.c
-s_aatriangle.obj : s_aatriangle.c
-s_accum.obj : s_accum.c
-s_alpha.obj : s_alpha.c
-s_bitmap.obj : s_bitmap.c
-s_blend.obj : s_blend.c
-s_buffers.obj : s_buffers.c
-s_context.obj : s_context.c
-s_copypix.obj : s_copypix.c
-s_depth.obj : s_depth.c
-s_drawpix.obj : s_drawpix.c
-s_feedback.obj : s_feedback.c
-s_fog.obj : s_fog.c
-s_imaging.obj : s_imaging.c
-s_lines.obj : s_lines.c
-s_logic.obj : s_logic.c
-s_masking.obj : s_masking.c
-s_nvfragprog.obj : s_nvfragprog.c
-s_pixeltex.obj : s_pixeltex.c
-s_points.obj : s_points.c
-s_readpix.obj : s_readpix.c
-s_span.obj : s_span.c
-s_stencil.obj : s_stencil.c
-s_texstore.obj : s_texstore.c
-s_texture.obj : s_texture.c
-s_triangle.obj : s_triangle.c
-s_zoom.obj : s_zoom.c
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast/s_fragprog_to_c.c b/nx-X11/extras/Mesa/src/mesa/swrast/s_fragprog_to_c.c
deleted file mode 100644
index 1953e8c73..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast/s_fragprog_to_c.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* An amusing little utility to print ARB fragment programs out as a C
- * function. Resulting code not tested except visually.
- */
-
-
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "nvfragprog.h"
-#include "macros.h"
-#include "program.h"
-
-#include "s_nvfragprog.h"
-#include "s_span.h"
-#include "s_texture.h"
-
-
-#ifdef USE_TCC
-
-/* UREG - a way of representing an FP source register including
- * swizzling and negation in a single GLuint. Major flaw is the
- * limitiation to source->Index < 32. Secondary flaw is the fact that
- * it's overkill & we could probably just pass around the original
- * datatypes instead.
- */
-
-#define UREG_TYPE_TEMP 0
-#define UREG_TYPE_INTERP 1
-#define UREG_TYPE_LOCAL_CONST 2
-#define UREG_TYPE_ENV_CONST 3
-#define UREG_TYPE_STATE_CONST 4
-#define UREG_TYPE_PARAM 5
-#define UREG_TYPE_OUTPUT 6
-#define UREG_TYPE_MASK 0x7
-
-#define UREG_TYPE_SHIFT 29
-#define UREG_NR_SHIFT 24
-#define UREG_NR_MASK 0x1f /* 31 */
-#define UREG_CHANNEL_X_NEGATE_SHIFT 23
-#define UREG_CHANNEL_X_SHIFT 20
-#define UREG_CHANNEL_Y_NEGATE_SHIFT 19
-#define UREG_CHANNEL_Y_SHIFT 16
-#define UREG_CHANNEL_Z_NEGATE_SHIFT 15
-#define UREG_CHANNEL_Z_SHIFT 12
-#define UREG_CHANNEL_W_NEGATE_SHIFT 11
-#define UREG_CHANNEL_W_SHIFT 8
-#define UREG_CHANNEL_ZERO_NEGATE_MBZ 5
-#define UREG_CHANNEL_ZERO_SHIFT 4
-#define UREG_CHANNEL_ONE_NEGATE_MBZ 1
-#define UREG_CHANNEL_ONE_SHIFT 0
-
-#define UREG_BAD 0xffffffff /* not a valid ureg */
-
-#define _X 0
-#define _Y 1
-#define _Z 2
-#define _W 3
-#define _ZERO 4 /* NOTE! */
-#define _ONE 5 /* NOTE! */
-
-
-/* Construct a ureg:
- */
-#define UREG( type, nr ) (((type)<< UREG_TYPE_SHIFT) | \
- ((nr) << UREG_NR_SHIFT) | \
- (_X << UREG_CHANNEL_X_SHIFT) | \
- (_Y << UREG_CHANNEL_Y_SHIFT) | \
- (_Z << UREG_CHANNEL_Z_SHIFT) | \
- (_W << UREG_CHANNEL_W_SHIFT) | \
- (_ZERO << UREG_CHANNEL_ZERO_SHIFT) | \
- (_ONE << UREG_CHANNEL_ONE_SHIFT))
-
-#define GET_CHANNEL_SRC( reg, channel ) ((reg<<(channel*4)) & \
- (0xf<<UREG_CHANNEL_X_SHIFT))
-#define CHANNEL_SRC( src, channel ) (src>>(channel*4))
-
-#define GET_UREG_TYPE(reg) (((reg)>>UREG_TYPE_SHIFT)&UREG_TYPE_MASK)
-#define GET_UREG_NR(reg) (((reg)>>UREG_NR_SHIFT)&UREG_NR_MASK)
-
-
-
-#define UREG_XYZW_CHANNEL_MASK 0x00ffff00
-
-#define deref(reg,pos) swizzle(reg, pos, pos, pos, pos)
-
-
-static INLINE int is_swizzled( int reg )
-{
- return ((reg & UREG_XYZW_CHANNEL_MASK) !=
- (UREG(0,0) & UREG_XYZW_CHANNEL_MASK));
-}
-
-
-/* One neat thing about the UREG representation:
- */
-static INLINE int swizzle( int reg, int x, int y, int z, int w )
-{
- return ((reg & ~UREG_XYZW_CHANNEL_MASK) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, x ), 0 ) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, y ), 1 ) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, z ), 2 ) |
- CHANNEL_SRC( GET_CHANNEL_SRC( reg, w ), 3 ));
-}
-
-/* Another neat thing about the UREG representation:
- */
-static INLINE int negate( int reg, int x, int y, int z, int w )
-{
- return reg ^ (((x&1)<<UREG_CHANNEL_X_NEGATE_SHIFT)|
- ((y&1)<<UREG_CHANNEL_Y_NEGATE_SHIFT)|
- ((z&1)<<UREG_CHANNEL_Z_NEGATE_SHIFT)|
- ((w&1)<<UREG_CHANNEL_W_NEGATE_SHIFT));
-}
-
-
-
-static GLuint src_reg_file( GLuint file )
-{
- switch (file) {
- case PROGRAM_TEMPORARY: return UREG_TYPE_TEMP;
- case PROGRAM_INPUT: return UREG_TYPE_INTERP;
- case PROGRAM_LOCAL_PARAM: return UREG_TYPE_LOCAL_CONST;
- case PROGRAM_ENV_PARAM: return UREG_TYPE_ENV_CONST;
-
- case PROGRAM_STATE_VAR: return UREG_TYPE_STATE_CONST;
- case PROGRAM_NAMED_PARAM: return UREG_TYPE_PARAM;
- default: return UREG_BAD;
- }
-}
-
-static void emit( struct fragment_program *p,
- const char *fmt,
- ... )
-{
- va_list ap;
- va_start( ap, fmt );
-
- if (p->c_strlen < sizeof(p->c_str))
- p->c_strlen += vsnprintf( p->c_str + p->c_strlen,
- sizeof(p->c_str) - p->c_strlen,
- fmt, ap );
-
- va_end( ap );
-}
-
-static INLINE void emit_char( struct fragment_program *p, char c )
-{
- if (p->c_strlen < sizeof(p->c_str)) {
- p->c_str[p->c_strlen] = c;
- p->c_strlen++;
- }
-}
-
-
-/**
- * Retrieve a ureg for the given source register. Will emit
- * constants, apply swizzling and negation as needed.
- */
-static GLuint src_vector( const struct fp_src_register *source )
-{
- GLuint src;
-
- assert(source->Index < 32); /* limitiation of UREG representation */
-
- src = UREG( src_reg_file( source->File ), source->Index );
-
- src = swizzle(src,
- _X + source->Swizzle[0],
- _X + source->Swizzle[1],
- _X + source->Swizzle[2],
- _X + source->Swizzle[3]);
-
- if (source->NegateBase)
- src = negate( src, 1,1,1,1 );
-
- return src;
-}
-
-
-static void print_header( struct fragment_program *p )
-{
- emit(p, "\n\n\n");
-
- /* Mesa's program_parameter struct:
- */
- emit(p,
- "struct program_parameter\n"
- "{\n"
- " const char *Name;\n"
- " int Type;\n"
- " int StateIndexes[6];\n"
- " float Values[4];\n"
- "};\n");
-
-
- /* Texture samplers, not written yet:
- */
- emit(p, "extern void TEX( void *ctx, const float *txc, int unit, float *rslt );\n"
- "extern void TXB( void *ctx, const float *txc, int unit, float *rslt );\n"
- "extern void TXP( void *ctx, const float *txc, int unit, float *rslt );\n");
-
- /* Resort to the standard math library (float versions):
- */
- emit(p, "extern float fabsf( float );\n"
- "extern float cosf( float );\n"
- "extern float sinf( float );\n"
- "extern float expf( float );\n"
- "extern float powf( float, float );\n"
- "extern float floorf( float );\n");
-
- /* These ones we have fast code in Mesa for:
- */
- emit(p, "extern float LOG2( float );\n"
- "extern float _mesa_inv_sqrtf( float );\n");
-
- /* The usual macros, not really needed, but handy:
- */
- emit(p, "#define MIN2(x,y) ((x)<(y)?(x):(y))\n"
- "#define MAX2(x,y) ((x)<(y)?(x):(y))\n"
- "#define SATURATE(x) ((x)>1.0?1.0:((x)<0.0?0.0:(x)))\n");
-
- /* Our function!
- */
- emit(p, "int run_program( void *ctx, \n"
- " const float (*local_param)[4], \n"
- " const float (*env_param)[4], \n"
- " const struct program_parameter *state_param, \n"
- " const float (*interp)[4], \n"
- " float (*outputs)[4])\n"
- "{\n"
- " float temp[32][4];\n"
- );
-}
-
-static void print_footer( struct fragment_program *p )
-{
- emit(p, " return 1;");
- emit(p, "}\n");
-}
-
-static void print_dest_reg( struct fragment_program *p,
- const struct fp_instruction *inst )
-{
- switch (inst->DstReg.File) {
- case PROGRAM_OUTPUT:
- emit(p, "outputs[%d]", inst->DstReg.Index);
- break;
- case PROGRAM_TEMPORARY:
- emit(p, "temp[%d]", inst->DstReg.Index);
- break;
- default:
- break;
- }
-}
-
-static void print_dest( struct fragment_program *p,
- const struct fp_instruction *inst,
- GLuint idx )
-{
- print_dest_reg(p, inst);
- emit(p, "[%d]", idx);
-}
-
-
-#define UREG_SRC0(reg) (((reg)>>UREG_CHANNEL_X_SHIFT) & 0x7)
-
-static void print_reg( struct fragment_program *p,
- GLuint arg )
-{
- switch (GET_UREG_TYPE(arg)) {
- case UREG_TYPE_TEMP: emit(p, "temp"); break;
- case UREG_TYPE_INTERP: emit(p, "interp"); break;
- case UREG_TYPE_LOCAL_CONST: emit(p, "local_const"); break;
- case UREG_TYPE_ENV_CONST: emit(p, "env_const"); break;
- case UREG_TYPE_STATE_CONST: emit(p, "state_param"); break;
- case UREG_TYPE_PARAM: emit(p, "local_param"); break;
- };
-
- emit(p, "[%d]", GET_UREG_NR(arg));
-
- if (GET_UREG_TYPE(arg) == UREG_TYPE_STATE_CONST) {
- emit(p, ".Values");
- }
-}
-
-
-static void print_arg( struct fragment_program *p,
- GLuint arg )
-{
- GLuint src = UREG_SRC0(arg);
-
- if (src == _ZERO) {
- emit(p, "0");
- return;
- }
-
- if (arg & (1<<UREG_CHANNEL_X_NEGATE_SHIFT))
- emit(p, "-");
-
- if (src == _ONE) {
- emit(p, "1");
- return;
- }
-
- if (GET_UREG_TYPE(arg) == UREG_TYPE_STATE_CONST &&
- p->Parameters->Parameters[GET_UREG_NR(arg)].Type == CONSTANT) {
- emit(p, "%g", p->Parameters->Parameters[GET_UREG_NR(arg)].Values[src]);
- return;
- }
-
- print_reg( p, arg );
-
- switch (src){
- case _X: emit(p, "[0]"); break;
- case _Y: emit(p, "[1]"); break;
- case _Z: emit(p, "[2]"); break;
- case _W: emit(p, "[3]"); break;
- }
-}
-
-
-/* This is where the handling of expressions breaks down into string
- * processing:
- */
-static void print_expression( struct fragment_program *p,
- GLuint i,
- const char *fmt,
- va_list ap )
-{
- while (*fmt) {
- if (*fmt == '%' && *(fmt+1) == 's') {
- int reg = va_arg(ap, int);
-
- /* Use of deref() is a bit of a hack:
- */
- print_arg( p, deref(reg, i) );
- fmt += 2;
- }
- else {
- emit_char(p, *fmt);
- fmt++;
- }
- }
-
- emit(p, ";\n");
-}
-
-static void do_tex_kill( struct fragment_program *p,
- const struct fp_instruction *inst,
- GLuint arg )
-{
- GLuint i;
-
- emit(p, "if (");
-
- for (i = 0; i < 4; i++) {
- print_arg( p, deref(arg, i) );
- emit(p, " < 0 ");
- if (i + 1 < 4)
- emit(p, "|| ");
- }
-
- emit(p, ")\n");
- emit(p, " return 0;\n");
-
-}
-
-static void do_tex_simple( struct fragment_program *p,
- const struct fp_instruction *inst,
- const char *fn, GLuint texunit, GLuint arg )
-{
- emit(p, " %s( ctx, ", fn);
- print_reg( p, arg );
- emit(p, ", %d, ", texunit );
- print_dest_reg(p, inst);
- emit(p, ");\n");
-}
-
-
-static void do_tex( struct fragment_program *p,
- const struct fp_instruction *inst,
- const char *fn, GLuint texunit, GLuint arg )
-{
- GLuint i;
- GLboolean need_tex = GL_FALSE, need_result = GL_FALSE;
-
- for (i = 0; i < 4; i++)
- if (!inst->DstReg.WriteMask[i])
- need_result = GL_TRUE;
-
- if (is_swizzled(arg))
- need_tex = GL_TRUE;
-
- if (!need_tex && !need_result) {
- do_tex_simple( p, inst, fn, texunit, arg );
- return;
- }
-
- emit(p, " {\n");
- emit(p, " float texcoord[4];\n");
- emit(p, " float result[4];\n");
-
- for (i = 0; i < 4; i++) {
- emit(p, " texcoord[%d] = ", i);
- print_arg( p, deref(arg, i) );
- emit(p, ";\n");
- }
-
- emit(p, " %s( ctx, texcoord, %d, result);\n", fn, texunit );
-
- for (i = 0; i < 4; i++) {
- if (inst->DstReg.WriteMask[i]) {
- emit(p, " ");
- print_dest(p, inst, i);
- emit(p, " = result[%d];\n", i);
- }
- }
-
- emit(p, " }\n");
-}
-
-
-static void saturate( struct fragment_program *p,
- const struct fp_instruction *inst,
- GLuint i )
-{
- emit(p, " ");
- print_dest(p, inst, i);
- emit(p, " = SATURATE( ");
- print_dest(p, inst, i);
- emit(p, ");\n");
-}
-
-static void assign_single( GLuint i,
- struct fragment_program *p,
- const struct fp_instruction *inst,
- const char *fmt,
- ... )
-{
- va_list ap;
- va_start( ap, fmt );
-
- if (inst->DstReg.WriteMask[i]) {
- emit(p, " ");
- print_dest(p, inst, i);
- emit(p, " = ");
- print_expression( p, i, fmt, ap);
- if (inst->Saturate)
- saturate(p, inst, i);
- }
-
- va_end( ap );
-}
-
-static void assign4( struct fragment_program *p,
- const struct fp_instruction *inst,
- const char *fmt,
- ... )
-{
- GLuint i;
- va_list ap;
- va_start( ap, fmt );
-
- for (i = 0; i < 4; i++)
- if (inst->DstReg.WriteMask[i]) {
- emit(p, " ");
- print_dest(p, inst, i);
- emit(p, " = ");
- print_expression( p, i, fmt, ap);
- if (inst->Saturate)
- saturate(p, inst, i);
- }
-
- va_end( ap );
-}
-
-static void assign4_replicate( struct fragment_program *p,
- const struct fp_instruction *inst,
- const char *fmt,
- ... )
-{
- GLuint i, first = 0;
- GLboolean ok = 0;
- va_list ap;
-
- for (i = 0; i < 4; i++)
- if (inst->DstReg.WriteMask[i]) {
- ok = 1;
- first = i;
- break;
- }
-
- if (!ok) return;
-
- va_start( ap, fmt );
-
- emit(p, " ");
-
- print_dest(p, inst, first);
- emit(p, " = ");
- print_expression( p, 0, fmt, ap);
- if (inst->Saturate)
- saturate(p, inst, first);
- va_end( ap );
-
- for (i = first+1; i < 4; i++)
- if (inst->DstReg.WriteMask[i]) {
- emit(p, " ");
- print_dest(p, inst, i);
- emit(p, " = ");
- print_dest(p, inst, first);
- emit(p, ";\n");
- }
-}
-
-
-
-
-static GLuint nr_args( GLuint opcode )
-{
- switch (opcode) {
- case FP_OPCODE_ABS: return 1;
- case FP_OPCODE_ADD: return 2;
- case FP_OPCODE_CMP: return 3;
- case FP_OPCODE_COS: return 1;
- case FP_OPCODE_DP3: return 2;
- case FP_OPCODE_DP4: return 2;
- case FP_OPCODE_DPH: return 2;
- case FP_OPCODE_DST: return 2;
- case FP_OPCODE_EX2: return 1;
- case FP_OPCODE_FLR: return 1;
- case FP_OPCODE_FRC: return 1;
- case FP_OPCODE_KIL: return 1;
- case FP_OPCODE_LG2: return 1;
- case FP_OPCODE_LIT: return 1;
- case FP_OPCODE_LRP: return 3;
- case FP_OPCODE_MAD: return 3;
- case FP_OPCODE_MAX: return 2;
- case FP_OPCODE_MIN: return 2;
- case FP_OPCODE_MOV: return 1;
- case FP_OPCODE_MUL: return 2;
- case FP_OPCODE_POW: return 2;
- case FP_OPCODE_RCP: return 1;
- case FP_OPCODE_RSQ: return 1;
- case FP_OPCODE_SCS: return 1;
- case FP_OPCODE_SGE: return 2;
- case FP_OPCODE_SIN: return 1;
- case FP_OPCODE_SLT: return 2;
- case FP_OPCODE_SUB: return 2;
- case FP_OPCODE_SWZ: return 1;
- case FP_OPCODE_TEX: return 1;
- case FP_OPCODE_TXB: return 1;
- case FP_OPCODE_TXP: return 1;
- case FP_OPCODE_XPD: return 2;
- default: return 0;
- }
-}
-
-
-
-static void translate_program( struct fragment_program *p )
-{
- const struct fp_instruction *inst = p->Instructions;
-
- for (; inst->Opcode != FP_OPCODE_END; inst++) {
-
- GLuint src[3], i;
- GLuint nr = nr_args( inst->Opcode );
-
- for (i = 0; i < nr; i++)
- src[i] = src_vector( &inst->SrcReg[i] );
-
- /* Print the original program instruction string */
- if (p->Base.String)
- {
- const char *s = (const char *) p->Base.String + inst->StringPos;
- emit(p, " /* ");
- while (*s != ';') {
- emit_char(p, *s);
- s++;
- }
- emit(p, "; */\n");
- }
-
- switch (inst->Opcode) {
- case FP_OPCODE_ABS:
- assign4(p, inst, "fabsf(%s)", src[0]);
- break;
-
- case FP_OPCODE_ADD:
- assign4(p, inst, "%s + %s", src[0], src[1]);
- break;
-
- case FP_OPCODE_CMP:
- assign4(p, inst, "%s < 0.0F ? %s : %s", src[0], src[1], src[2]);
- break;
-
- case FP_OPCODE_COS:
- assign4_replicate(p, inst, "COS(%s)", src[0]);
- break;
-
- case FP_OPCODE_DP3:
- assign4_replicate(p, inst,
- "%s*%s + %s*%s + %s*%s",
- deref(src[0],_X),
- deref(src[1],_X),
- deref(src[0],_Y),
- deref(src[1],_Y),
- deref(src[0],_Z),
- deref(src[1],_Z));
- break;
-
- case FP_OPCODE_DP4:
- assign4_replicate(p, inst,
- "%s*%s + %s*%s + %s*%s + %s*%s",
- deref(src[0],_X),
- deref(src[1],_X),
- deref(src[0],_Y),
- deref(src[1],_Y),
- deref(src[0],_Z),
- deref(src[1],_Z));
- break;
-
- case FP_OPCODE_DPH:
- assign4_replicate(p, inst,
- "%s*%s + %s*%s + %s*%s + %s",
- deref(src[0],_X),
- deref(src[1],_X),
- deref(src[0],_Y),
- deref(src[1],_Y),
- deref(src[1],_Z));
- break;
-
- case FP_OPCODE_DST:
- /* result[0] = 1 * 1;
- * result[1] = a[1] * b[1];
- * result[2] = a[2] * 1;
- * result[3] = 1 * b[3];
- */
- assign_single(0, p, inst, "1.0");
-
- assign_single(1, p, inst, "%s * %s",
- deref(src[0], _Y), deref(src[1], _Y));
-
- assign_single(2, p, inst, "%s", deref(src[0], _Z));
- assign_single(3, p, inst, "%s", deref(src[1], _W));
- break;
-
- case FP_OPCODE_EX2:
- assign4_replicate(p, inst, "powf(2.0, %s)", src[0]);
- break;
-
- case FP_OPCODE_FLR:
- assign4_replicate(p, inst, "floorf(%s)", src[0]);
- break;
-
- case FP_OPCODE_FRC:
- assign4_replicate(p, inst, "%s - floorf(%s)", src[0], src[0]);
- break;
-
- case FP_OPCODE_KIL:
- do_tex_kill(p, inst, src[0]);
- break;
-
- case FP_OPCODE_LG2:
- assign4_replicate(p, inst, "LOG2(%s)", src[0]);
- break;
-
- case FP_OPCODE_LIT:
- assign_single(0, p, inst, "1.0");
- assign_single(1, p, inst, "MIN2(%s, 0)", deref(src[0], _X));
- assign_single(2, p, inst, "(%s > 0.0) ? expf(%s * MIN2(%s, 0)) : 0.0",
- deref(src[0], _X),
- deref(src[0], _Z),
- deref(src[0], _Y));
- assign_single(3, p, inst, "1.0");
- break;
-
- case FP_OPCODE_LRP:
- assign4(p, inst,
- "%s * %s + (1.0 - %s) * %s",
- src[0], src[1], src[0], src[2]);
- break;
-
- case FP_OPCODE_MAD:
- assign4(p, inst, "%s * %s + %s", src[0], src[1], src[2]);
- break;
-
- case FP_OPCODE_MAX:
- assign4(p, inst, "MAX2(%s, %s)", src[0], src[1]);
- break;
-
- case FP_OPCODE_MIN:
- assign4(p, inst, "MIN2(%s, %s)", src[0], src[1]);
- break;
-
- case FP_OPCODE_MOV:
- assign4(p, inst, "%s", src[0]);
- break;
-
- case FP_OPCODE_MUL:
- assign4(p, inst, "%s * %s", src[0], src[1]);
- break;
-
- case FP_OPCODE_POW:
- assign4_replicate(p, inst, "powf(%s, %s)", src[0], src[1]);
- break;
-
- case FP_OPCODE_RCP:
- assign4_replicate(p, inst, "1.0/%s", src[0]);
- break;
-
- case FP_OPCODE_RSQ:
- assign4_replicate(p, inst, "_mesa_inv_sqrtf(%s)", src[0]);
- break;
-
- case FP_OPCODE_SCS:
- if (inst->DstReg.WriteMask[0]) {
- assign_single(0, p, inst, "cosf(%s)", deref(src[0], _X));
- }
-
- if (inst->DstReg.WriteMask[1]) {
- assign_single(1, p, inst, "sinf(%s)", deref(src[0], _X));
- }
- break;
-
- case FP_OPCODE_SGE:
- assign4(p, inst, "%s >= %s ? 1.0 : 0.0", src[0], src[1]);
- break;
-
- case FP_OPCODE_SIN:
- assign4_replicate(p, inst, "sinf(%s)", src[0]);
- break;
-
- case FP_OPCODE_SLT:
- assign4(p, inst, "%s < %s ? 1.0 : 0.0", src[0], src[1]);
- break;
-
- case FP_OPCODE_SUB:
- assign4(p, inst, "%s - %s", src[0], src[1]);
- break;
-
- case FP_OPCODE_SWZ: /* same implementation as MOV: */
- assign4(p, inst, "%s", src[0]);
- break;
-
- case FP_OPCODE_TEX:
- do_tex(p, inst, "TEX", inst->TexSrcUnit, src[0]);
- break;
-
- case FP_OPCODE_TXB:
- do_tex(p, inst, "TXB", inst->TexSrcUnit, src[0]);
- break;
-
- case FP_OPCODE_TXP:
- do_tex(p, inst, "TXP", inst->TexSrcUnit, src[0]);
- break;
-
- case FP_OPCODE_XPD:
- /* Cross product:
- * result.x = src[0].y * src[1].z - src[0].z * src[1].y;
- * result.y = src[0].z * src[1].x - src[0].x * src[1].z;
- * result.z = src[0].x * src[1].y - src[0].y * src[1].x;
- * result.w = undef;
- */
- assign4(p, inst,
- "%s * %s - %s * %s",
- swizzle(src[0], _Y, _Z, _X, _ONE),
- swizzle(src[1], _Z, _X, _Y, _ONE),
- swizzle(src[0], _Z, _X, _Y, _ONE),
- swizzle(src[1], _Y, _Z, _X, _ONE));
- break;
-
- default:
- emit(p, "BOGUS OPCODE\n");
- return;
- }
- }
-}
-
-
-
-
-
-void _swrast_translate_program( GLcontext *ctx )
-{
- struct fragment_program *p = ctx->FragmentProgram._Current;
-
- if (p) {
- p->c_strlen = 0;
-
- print_header( p );
- translate_program( p );
- print_footer( p );
- }
-}
-
-#endif /*USE_TCC*/
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast/s_tcc.c b/nx-X11/extras/Mesa/src/mesa/swrast/s_tcc.c
deleted file mode 100644
index 550a2aabd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast/s_tcc.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* An attempt to hook s_fragprog_to_c.c up to libtcc.a to try &
- * generate some real code.
- *
- * TCC isn't threadsafe, so it will need additional locking help if we
- * end up using it as a backend in mesa.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "nvfragprog.h"
-#include "macros.h"
-#include "program.h"
-
-#include "s_nvfragprog.h"
-#include "s_texture.h"
-
-#ifdef USE_TCC
-
-#include <libtcc.h>
-
-typedef int (*cfunc)( void *ctx,
- const GLfloat (*local_param)[4],
- const GLfloat (*env_param)[4],
- const struct program_parameter *state_param,
- const GLfloat (*interp)[4],
- GLfloat (*outputs)[4]);
-
-
-static cfunc current_func;
-static struct fragment_program *current_program;
-static TCCState *current_tcc_state;
-
-
-static void TEX( void *cc, const float *texcoord, int unit, float *result )
-{
- GLcontext *ctx = (GLcontext *)cc;
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLfloat lambda = 1.0; /* hack */
- GLchan rgba[4];
-
- swrast->TextureSample[unit](ctx, unit, ctx->Texture.Unit[unit]._Current,
- 1, (const GLfloat (*)[4]) texcoord,
- &lambda, &rgba);
-
- result[0] = CHAN_TO_FLOAT(rgba[0]);
- result[1] = CHAN_TO_FLOAT(rgba[1]);
- result[2] = CHAN_TO_FLOAT(rgba[2]);
- result[3] = CHAN_TO_FLOAT(rgba[3]);
-}
-
-
-static void TXB( void *cc, const float *texcoord, int unit, float *result )
-{
- GLcontext *ctx = (GLcontext *)cc;
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLfloat lambda = 1.0; /* hack */
- GLchan rgba[4];
-
- /* texcoord[3] is the bias to add to lambda */
- lambda += texcoord[3];
-
-
- /* Is it necessary to reset texcoord[3] to 1 at this point?
- */
- swrast->TextureSample[unit](ctx, unit, ctx->Texture.Unit[unit]._Current,
- 1, (const GLfloat (*)[4]) texcoord,
- &lambda, &rgba);
-
- result[0] = CHAN_TO_FLOAT(rgba[0]);
- result[1] = CHAN_TO_FLOAT(rgba[1]);
- result[2] = CHAN_TO_FLOAT(rgba[2]);
- result[3] = CHAN_TO_FLOAT(rgba[3]);
-}
-
-
-static void TXP( void *cc, const float *texcoord, int unit, float *result )
-{
- /* I think that TEX needs to undo the perspective divide which has
- * already occurred. In the meantime, TXP is correct to do this:
- */
- TEX( cc, texcoord, unit, result );
-}
-
-
-static cfunc codegen( TCCState *s, const char *prog, const char *fname )
-{
- unsigned long val;
-
- if (s)
- tcc_delete(s);
-
- s = tcc_new();
- if (!s)
- return 0;
-
- tcc_set_output_type(s, TCC_OUTPUT_MEMORY);
- tcc_compile_string(s, prog);
-
-/* tcc_add_dll("/usr/lib/libm.so"); */
-
- tcc_add_symbol(s, "TEX", (unsigned long)&TEX);
- tcc_add_symbol(s, "TXB", (unsigned long)&TXB);
- tcc_add_symbol(s, "TXP", (unsigned long)&TXP);
-
-
- tcc_relocate(s);
- tcc_get_symbol(s, &val, fname);
- return (cfunc) val;
-}
-
-/* TCC isn't threadsafe and even seems not to like having more than
- * one TCCState created or used at any one time in a single threaded
- * environment. So, this code is all for investigation only and can't
- * currently be used in Mesa proper.
- *
- * I've taken some liberties with globals myself, now.
- */
-GLboolean
-_swrast_execute_codegen_program( GLcontext *ctx,
- const struct fragment_program *program, GLuint maxInst,
- struct fp_machine *machine, const struct sw_span *span,
- GLuint column )
-{
- if (program != current_program) {
-
- _swrast_translate_program( ctx );
-
- fprintf(stderr, "%s: compiling:\n%s\n", __FUNCTION__, program->c_str);
-
- current_program = program;
- current_func = codegen( current_tcc_state, program->c_str,
- "run_program" );
- }
-
- assert(current_func);
-
- return current_func( ctx,
- program->Base.LocalParams,
- (const GLfloat (*)[4])ctx->FragmentProgram.Parameters,
- program->Parameters->Parameters,
- (const GLfloat (*)[4])machine->Inputs,
- machine->Outputs );
-}
-
-#else /* USE_TCC */
-
-GLboolean
-_swrast_execute_codegen_program( GLcontext *ctx,
- const struct fragment_program *program, GLuint maxInst,
- struct fp_machine *machine, const struct sw_span *span,
- GLuint column )
-{
- (void) ctx;
- (void) program; (void) maxInst;
- (void) machine; (void) span;
- (void) column;
- return 0;
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/NOTES b/nx-X11/extras/Mesa/src/mesa/swrast_setup/NOTES
deleted file mode 100644
index c6cb4ab34..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/NOTES
+++ /dev/null
@@ -1,65 +0,0 @@
-INTRODUCTION
-
-A helper module which provides glue to bind the software rasterizer to
-the software t&l module. The main task of this module is to build
-swrast vertices from the t&l vertex_buffer structs, and to use them to
-perform triangle setup functions not implemented in the software
-rasterizer.
-
-The module implements a full set of functions to plug into the
-t_vb_render.c driver interface (tnl->Driver.Render.*).
-
-There are strong advantages to decoupling the software rasterizer from
-the t&l module, primarily allowing hardware drivers better control
-over fallbacks, the removal of implicit knowledge about the software
-rasterizer in the t&l module, allowing the two modules to evolve
-independently and allowing either to be substituted with equivalent
-functionality from another codebase.
-
-This module implements triangle/quad setup for offset, unfilled and
-twoside-lit triangles. The software rasterizer doesn't handle these
-primitives directly.
-
-Hardware rasterization drivers typically use this module in situations
-where no hardware rasterization is possible, ie during total
-fallbacks.
-
-STATE
-
-To create and destroy the module:
-
- GLboolean _swsetup_CreateContext( GLcontext *ctx );
- void _swsetup_DestroyContext( GLcontext *ctx );
-
-The module is not active by default, and must be installed by calling
-_swrast_Wakeup(). This function installs internal swrast_setup
-functions into all the tnl->Driver.Render driver hooks, thus taking
-over the task of rasterization entirely:
-
- void _swrast_Wakeup( GLcontext *ctx );
-
-
-This module tracks state changes internally and maintains derived
-values based on the current state. For this to work, the driver
-ensure the following funciton is called whenever the state changes and
-the swsetup module is 'awake':
-
- void _swsetup_InvalidateState( GLcontext *ctx, GLuint new_state );
-
-There is no explicit call to put the swsetup module to sleep. Simply
-install other function pointers into all the tnl->Driver.Render.*
-hooks, and (optionally) cease calling _swsetup_InvalidateState().
-
-DRIVER INTERFACE
-
-The module offers a minimal driver interface:
-
- void (*Start)( GLcontext *ctx );
- void (*Finish)( GLcontext *ctx );
-
-These are called before and after the completion of all swrast drawing
-activity. As swrast doesn't call callbacks during triangle, line or
-point rasterization, these are necessary to provide locking hooks for
-some drivers. They may otherwise be left null.
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/descrip.mms b/nx-X11/extras/Mesa/src/mesa/swrast_setup/descrip.mms
deleted file mode 100644
index 3b8af930c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/descrip.mms
+++ /dev/null
@@ -1,39 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 16 June 2003
-
-.first
- define gl [---.include.gl]
- define math [-.math]
- define tnl [-.tnl]
- define swrast [-.swrast]
- define array_cache [-.array_cache]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main],[-.glapi]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = ss_context.c ss_triangle.c
-
-OBJECTS = ss_context.obj,ss_triangle.obj
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-ss_context.obj : ss_context.c
-ss_triangle.obj : ss_triangle.c
diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_vb.h b/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_vb.h
deleted file mode 100644
index 6ea0cb1a7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_vb.h
+++ /dev/null
@@ -1,38 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef SS_VB_H
-#define SS_VB_H
-
-#include "mtypes.h"
-#include "swrast_setup.h"
-
-void _swsetup_vb_init( GLcontext *ctx );
-void _swsetup_choose_rastersetup_func( GLcontext *ctx );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl/NOTES b/nx-X11/extras/Mesa/src/mesa/tnl/NOTES
deleted file mode 100644
index c39b43485..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl/NOTES
+++ /dev/null
@@ -1,102 +0,0 @@
-INTRODUCTION
-
-A generic, configurable software implementation of GL transformation &
-lighting.
-
-This module provides an implementation of the routines required by the
-'vtxfmt' mechanism of core mesa for tnl functionality in all
-combinations of compile and execute modes.
-
-Most current drivers use the tnl module exclusively to provide this
-functionality, though there is an experimental alternate
-implementation provided by the tnl_dd/t_dd_imm_* files which can
-handle a small subset of GL states in execute mode only.
-
-
-STATE
-
-To create and destroy the module:
-
- GLboolean _tnl_CreateContext( GLcontext *ctx );
- void _tnl_DestroyContext( GLcontext *ctx );
-
-The module is not active by default, and must be installed by calling
-_tnl_Wakeup(). This function installs internal tnl functions into all
-the vtxfmt dispatch hooks, thus taking over the task of transformation
-and lighting entirely:
-
- void _tnl_wakeup_exec( GLcontext *ctx );
- void _tnl_wakeup_save_exec( GLcontext *ctx );
-
-
-This module tracks state changes internally and maintains derived
-values based on the current state. For this to work, the driver
-ensure the following funciton is called whenever the state changes and
-the swsetup module is 'awake':
-
- void _tnl_InvalidateState( GLcontext *ctx, GLuint new_state );
-
-There is no explicit call to put the tnl module to sleep. Simply
-install other function pointers into all the vtxfmt dispatch slots,
-and (optionally) cease calling _tnl_InvalidateState().
-
-CUSTOMIZATION
-
-The module provides customizability through several mechanisms. The
-most important is by allowing drivers to specify the pipeline through
-which vertex data is passed, including its eventual transfer to
-rasterization hardware (or software).
-
-The default pipeline is specified in t_pipeline.c, and is usually a
-starting point for driver pipelines. Some drivers will remove a stage
-where hardware provides support for the implemented operation (for
-instance fog where per-pixel hardware fog is available, as in the dri
-tdfx driver), or add stages to shortcircuit latter operations (for
-example taking advantage of hardware support for strips and other
-higher-level primitives (for example the radeon driver).
-
-In addition, the following functions provide further tweaks:
-
-extern void
-_tnl_need_projected_coords( GLcontext *ctx, GLboolean flag );
-
- - Direct the default vertex transformation stage to
- produce/not produce projected clip coordinates.
-
-extern void
-_tnl_need_dlist_loopback( GLcontext *ctx, GLboolean flag );
-
- - Direct the display list component of the tnl module to
- replay display lists as 'glVertex' type calls, rather than
- passing the display list data directly into the tnl pipeline
- mechanism.
-
- This allows display lists to be replayed by the tnl module
- even when the module is not strictly active.
-
-
-extern void
-_tnl_need_dlist_norm_lengths( GLcontext *ctx, GLboolean flag );
-
- - Direct the display list component to enable/disable caching
- 1/length values for display list normals. Doing so is
- ususally helpful when lighting is performed in software, but
- wasteful otherwise.
-
-
-DRIVER INTERFACE
-
-The module itself offers a minimal driver interface:
-
- void (*RunPipeline)( GLcontext *ctx );
-
-Normally this is set to _tnl_RunPipeline(), however the driver can use
-this hook to wrap checks or other code around this call.
-
-In addition, the driver interface for the default render pipeline
-stage is housed in the tnl context struct (this could be cleaner).
-
-
-RENDER DRIVER INTERFACE
-
-See t_context.h for the definition and explanation of this. \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl/descrip.mms b/nx-X11/extras/Mesa/src/mesa/tnl/descrip.mms
deleted file mode 100644
index a77d66ca3..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl/descrip.mms
+++ /dev/null
@@ -1,74 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 13 June 2005
-
-.first
- define gl [---.include.gl]
- define math [-.math]
- define shader [-.shader]
- define array_cache [-.array_cache]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main],[-.glapi],[-.shader]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)
-
-SOURCES = t_array_api.c t_array_import.c t_context.c \
- t_pipeline.c t_vb_fog.c t_save_api.c t_vtx_api.c \
- t_vb_light.c t_vb_normals.c t_vb_points.c t_vb_program.c \
- t_vb_render.c t_vb_texgen.c t_vb_texmat.c t_vb_vertex.c \
- t_vtx_eval.c t_vtx_exec.c t_save_playback.c t_save_loopback.c \
- t_vertex.c t_vtx_generic.c t_vtx_x86.c t_vertex_generic.c \
- t_vb_arbprogram.c t_vp_build.c
-
-OBJECTS = t_array_api.obj,t_array_import.obj,t_context.obj,\
- t_pipeline.obj,t_vb_fog.obj,t_vb_light.obj,t_vb_normals.obj,\
- t_vb_points.obj,t_vb_program.obj,t_vb_render.obj,t_vb_texgen.obj,\
- t_vb_texmat.obj,t_vb_vertex.obj,t_save_api.obj,t_vtx_api.obj,\
- t_vtx_eval.obj,t_vtx_exec.obj,t_save_playback.obj,t_save_loopback.obj,\
- t_vertex.obj,t_vtx_generic.obj,t_vtx_x86.obj,t_vertex_generic.obj,\
- t_vb_arbprogram.obj,t_vp_build.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-t_array_api.obj : t_array_api.c
-t_array_import.obj : t_array_import.c
-t_context.obj : t_context.c
-t_pipeline.obj : t_pipeline.c
-t_vb_fog.obj : t_vb_fog.c
-t_vb_light.obj : t_vb_light.c
-t_vb_normals.obj : t_vb_normals.c
-t_vb_points.obj : t_vb_points.c
-t_vb_program.obj : t_vb_program.c
-t_vb_render.obj : t_vb_render.c
-t_vb_texgen.obj : t_vb_texgen.c
-t_vb_texmat.obj : t_vb_texmat.c
-t_vb_vertex.obj : t_vb_vertex.c
-t_save_api.obj : t_save_api.c
-t_vtx_api.obj : t_vtx_api.c
-t_vtx_eval.obj : t_vtx_eval.c
-t_vtx_exec.obj : t_vtx_exec.c
-t_save_playback.obj : t_save_playback.c
-t_save_loopback.obj : t_save_loopback.c
-t_vertex.obj : t_vertex.c
-t_vtx_x86.obj : t_vtx_x86.c
-t_vtx_generic.obj : t_vtx_generic.c
-t_vertex_generic.obj : t_vertex_generic.c
-t_vb_arbprogram.obj : t_vb_arbprogram.c
-t_vp_build.obj : t_vp_build.c
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/NOTES.imm b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/NOTES.imm
deleted file mode 100644
index 9b2bd65e4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/NOTES.imm
+++ /dev/null
@@ -1,112 +0,0 @@
-
-NOTE:
-
-These files are incomplete. They do not yet form a working
-implementation of hte concepts discused below.
-
-
-OVERVIEW
-
-The t_dd_imm_* files form a set of templates to produce driver -
-specific software tnl modules for a small subset of transformation and
-lighting states.
-
-The approach is quite different to the large vertex buffers of the
-src/tnl module, and is based around a cache of four recent vertices
-and a 'current' vertex which is updated directly from the Color,
-Normal, Texcoord, SecondaryColor and Fog entrypoints.
-
-The current vertex is actually a composite of the ctx->Current values
-and a partial hardware vertex maintained where the hardware values
-differ from those in ctx->Current. For example, clamped color values
-are kept in the hardware vertex, while texcoords remain in
-ctx->Current.
-
-A crude diagram:
-
- +--------------+ +-------------------+
- | ctx->Current | | Current-HW-vertex |
- +--------------+ +-------------------+
- \ /
- \ /
- \ /
- \ /
- --------- --------
- | |
- v v
- +--------+ +--------+ +--------+ +--------+
- | vert-0 | | vert-1 | | vert-2 | | vert-3 |
- +--------+ +--------+ +--------+ +--------+
- |
- |
- v
-
- DMA
-
-
-Here values from ctx->Current and current-HW-vertex are merged to
-build vert-2, which is then dumped to hardware (DMA). A state machine
-determines which vertex is built in turn, and how the vertices are
-used to present primitives to hardware. These actions all occur
-during a call to Vertex{234}f{v}.
-
-Each vert-n includes clip coordinates and a clipmask in addition to
-the hardware (window) coordinates. This information allows clipping
-to take place directly on these vertices, if need be.
-
-t_dd_imm_capi.h
-
- Color{34}{fub}{v}() implementations. These update both
- ctx->Current (unclamped float colors) and current-HW-vertex
- with hardware-specific color values (typically unsigned
- bytes).
-
- When lighting is enabled, the functions from src/api_noop.c
- should be used, which just update ctx->Current. (The
- current-hw-vertex colors are produced from lighting, which is
- keyed to Normal3f).
-
-t_dd_imm_vb.c
-
- Support functions for clipping and fallback. See
- t_dd_imm_primtmp.h.
-
-t_dd_imm_napi.c
-t_dd_imm_napi.h
-
- Versions of Normal3f{v} to perform lighting with one or more
- infinite lights. Updates ctx->Current.Normal and the current
- HW colors.
-
- When lighting is disabled, use the functions from api_noop.c
- instead.
-
-
-t_dd_imm_primtmp.h
-
- State machine to control emission of vertices and primitives
- to hardware. Called indirectly from Vertex{234}f{v}. Capable
- of supporting hardware strip and fan primitives, and of
- decomposing to discreet primitives for clipping or fallback,
- or where the native primitive is unavailable.
-
-t_dd_imm_tapi.h
-
- Implementations of TexCoord{v} and MultiTexCoord4f{v}ARB to
- fire a callback when transitioning to projective texture.
- Most drivers will need to change vertex format at this point,
- some may need to enable a software rasterization fallback.
-
-t_dd_imm_vapi.h
-
- Implementations of Vertex{234}f{v}. These perform
- transformation and cliptesting on their arguments, then jump
- into the state machine implemented in primtmp.h.
-
-t_dd_imm_vertex.h
-
- Support functions for building and clip-interpolating hardware
- vertices. Called from primtmp.h.
-
-
-Keith Whitwell, June 2001. \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_capi.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_capi.h
deleted file mode 100644
index eecbf0da5..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_capi.h
+++ /dev/null
@@ -1,419 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- */
-
-/* Template for immediate mode color functions.
- *
- * FIXME: Floating-point color versions of these...
- */
-
-
-static void TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = CLAMP(r, 0.0f, 1.0f);
- CURRENT_COLOR( GCOMP ) = CLAMP(g, 0.0f, 1.0f);
- CURRENT_COLOR( BCOMP ) = CLAMP(b, 0.0f, 1.0f);
- CURRENT_COLOR( ACOMP ) = 1.0f;
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), r );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), g );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), b );
- CURRENT_COLOR( ACOMP ) = 255;
-#endif
-}
-
-static void TAG(Color3fv)( const GLfloat *v )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = CLAMP(v[0], 0.0f, 1.0f);
- CURRENT_COLOR( GCOMP ) = CLAMP(v[1], 0.0f, 1.0f);
- CURRENT_COLOR( BCOMP ) = CLAMP(v[2], 0.0f, 1.0f);
- CURRENT_COLOR( ACOMP ) = 1.0f;
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), v[2] );
- CURRENT_COLOR( ACOMP ) = 255;
-#endif
-}
-
-static void TAG(Color3ub)( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( r );
- CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( g );
- CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( b );
- CURRENT_COLOR( ACOMP ) = 1.0f;
-#else
- CURRENT_COLOR( RCOMP ) = r;
- CURRENT_COLOR( GCOMP ) = g;
- CURRENT_COLOR( BCOMP ) = b;
- CURRENT_COLOR( ACOMP ) = 255;
-#endif
-}
-
-static void TAG(Color3ubv)( const GLubyte *v )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( v[0] );
- CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( v[1] );
- CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( v[2] );
- CURRENT_COLOR( ACOMP ) = 1.0f;
-#else
- CURRENT_COLOR( RCOMP ) = v[0];
- CURRENT_COLOR( GCOMP ) = v[1];
- CURRENT_COLOR( BCOMP ) = v[2];
- CURRENT_COLOR( ACOMP ) = 255;
-#endif
-}
-
-static void TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = CLAMP(r, 0.0f, 1.0f);
- CURRENT_COLOR( GCOMP ) = CLAMP(g, 0.0f, 1.0f);
- CURRENT_COLOR( BCOMP ) = CLAMP(b, 0.0f, 1.0f);
- CURRENT_COLOR( ACOMP ) = CLAMP(a, 0.0f, 1.0f);
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), r );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), g );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), b );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( ACOMP ), a );
-#endif
-}
-
-static void TAG(Color4fv)( const GLfloat *v )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = CLAMP(v[0], 0.0f, 1.0f);
- CURRENT_COLOR( GCOMP ) = CLAMP(v[1], 0.0f, 1.0f);
- CURRENT_COLOR( BCOMP ) = CLAMP(v[2], 0.0f, 1.0f);
- CURRENT_COLOR( ACOMP ) = CLAMP(v[3], 0.0f, 1.0f);
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( RCOMP ), v[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( GCOMP ), v[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( BCOMP ), v[2] );
- UNCLAMPED_FLOAT_TO_UBYTE( CURRENT_COLOR( ACOMP ), v[3] );
-#endif
-}
-
-static void TAG(Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( r );
- CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( g );
- CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( b );
- CURRENT_COLOR( ACOMP ) = UBYTE_TO_FLOAT( a );
-#else
- CURRENT_COLOR( RCOMP ) = r;
- CURRENT_COLOR( GCOMP ) = g;
- CURRENT_COLOR( BCOMP ) = b;
- CURRENT_COLOR( ACOMP ) = a;
-#endif
-}
-
-static void TAG(Color4ubv)( const GLubyte *v )
-{
- GET_CURRENT;
-#ifdef COLOR_IS_FLOAT
- CURRENT_COLOR( RCOMP ) = UBYTE_TO_FLOAT( v[0] );
- CURRENT_COLOR( GCOMP ) = UBYTE_TO_FLOAT( v[1] );
- CURRENT_COLOR( BCOMP ) = UBYTE_TO_FLOAT( v[2] );
- CURRENT_COLOR( ACOMP ) = UBYTE_TO_FLOAT( v[3] );
-#else
- CURRENT_COLOR( RCOMP ) = v[0];
- CURRENT_COLOR( GCOMP ) = v[1];
- CURRENT_COLOR( BCOMP ) = v[2];
- CURRENT_COLOR( ACOMP ) = v[3];
-#endif
-}
-
-
-static void TAG(ColorMaterial3f)( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = r;
- color[1] = g;
- color[2] = b;
- color[3] = 1.0;
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial3fv)( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = v[0];
- color[1] = v[1];
- color[2] = v[2];
- color[3] = 1.0;
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial3ub)( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = UBYTE_TO_FLOAT( r );
- color[1] = UBYTE_TO_FLOAT( g );
- color[2] = UBYTE_TO_FLOAT( b );
- color[3] = 1.0;
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial3ubv)( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = UBYTE_TO_FLOAT( v[0] );
- color[1] = UBYTE_TO_FLOAT( v[1] );
- color[2] = UBYTE_TO_FLOAT( v[2] );
- color[3] = 1.0;
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = r;
- color[1] = g;
- color[2] = b;
- color[3] = a;
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial4fv)( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = v[0];
- color[1] = v[1];
- color[2] = v[2];
- color[3] = v[3];
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = UBYTE_TO_FLOAT( r );
- color[1] = UBYTE_TO_FLOAT( g );
- color[2] = UBYTE_TO_FLOAT( b );
- color[3] = UBYTE_TO_FLOAT( a );
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-static void TAG(ColorMaterial4ubv)( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
-
- color[0] = UBYTE_TO_FLOAT( v[0] );
- color[1] = UBYTE_TO_FLOAT( v[1] );
- color[2] = UBYTE_TO_FLOAT( v[2] );
- color[3] = UBYTE_TO_FLOAT( v[3] );
-
- _mesa_update_color_material( ctx, color );
- RECALC_BASE_COLOR( ctx );
-}
-
-
-
-
-
-/* =============================================================
- * Color chooser functions:
- */
-
-static void TAG(choose_Color3f)( GLfloat r, GLfloat g, GLfloat b )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color3f(ctx->Exec, TAG(ColorMaterial3f));
- } else {
- SET_Color3f(ctx->Exec, _mesa_noop_Color3f);
- }
- } else {
- SET_Color3f(ctx->Exec, TAG(Color3f));
- }
- glColor3f( r, g, b );
-}
-
-static void TAG(choose_Color3fv)( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color3fv(ctx->Exec, TAG(ColorMaterial3fv));
- } else {
- SET_Color3fv(ctx->Exec, _mesa_noop_Color3fv);
- }
- } else {
- SET_Color3fv(ctx->Exec, TAG(Color3fv));
- }
- glColor3fv( v );
-}
-
-static void TAG(choose_Color3ub)( GLubyte r, GLubyte g, GLubyte b )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color3ub(ctx->Exec, TAG(ColorMaterial3ub));
- } else {
- SET_Color3ub(ctx->Exec, _mesa_noop_Color3ub);
- }
- } else {
- SET_Color3ub(ctx->Exec, TAG(Color3ub));
- }
- glColor3ub( r, g, b );
-}
-
-static void TAG(choose_Color3ubv)( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color3ubv(ctx->Exec, TAG(ColorMaterial3ubv));
- } else {
- SET_Color3ubv(ctx->Exec, _mesa_noop_Color3ubv);
- }
- } else {
- SET_Color3ubv(ctx->Exec, TAG(Color3ubv));
- }
- glColor3ubv( v );
-}
-
-static void TAG(choose_Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color4f(ctx->Exec, TAG(ColorMaterial4f));
- } else {
- SET_Color4f(ctx->Exec, _mesa_noop_Color4f);
- }
- } else {
- SET_Color4f(ctx->Exec, TAG(Color4f));
- }
- glColor4f( r, g, b, a );
-}
-
-static void TAG(choose_Color4fv)( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color4fv(ctx->Exec, TAG(ColorMaterial4fv));
- } else {
- SET_Color4fv(ctx->Exec, _mesa_noop_Color4fv);
- }
- } else {
- SET_Color4fv(ctx->Exec, TAG(Color4fv));
- }
- glColor4fv( v );
-}
-
-static void TAG(choose_Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color4ub(ctx->Exec, TAG(ColorMaterial4ub));
- } else {
- SET_Color4ub(ctx->Exec, _mesa_noop_Color4ub);
- }
- } else {
- SET_Color4ub(ctx->Exec, TAG(Color4ub));
- }
- glColor4ub( r, g, b, a );
-}
-
-static void TAG(choose_Color4ubv)( const GLubyte *v )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ( ctx->Light.Enabled ) {
- if ( ctx->Light.ColorMaterialEnabled ) {
- SET_Color4ubv(ctx->Exec, TAG(ColorMaterial4ubv));
- } else {
- SET_Color4ubv(ctx->Exec, _mesa_noop_Color4ubv);
- }
- } else {
- SET_Color4ubv(ctx->Exec, TAG(Color4ubv));
- }
- glColor4ubv( v );
-}
-
-
-
-#undef GET_CURRENT
-#undef CURRENT_COLOR
-#undef CURRENT_SPECULAR
-#undef COLOR_IS_FLOAT
-#undef RECALC_BASE_COLOR
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_napi.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_napi.h
deleted file mode 100644
index 9844f615f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_napi.h
+++ /dev/null
@@ -1,226 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith_whitwell@yahoo.com>
- */
-
-/* Template for immediate mode normal functions. Optimize for infinite
- * lights when doing software lighting.
- */
-
-static void TAG(Normal3f_single)( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_VERTEX;
- const struct gl_light *light = ctx->Light.EnabledList.prev;
- GLfloat n_dot_h, n_dot_VP, spec, sum[3];
- GLfloat *normal = ctx->Current.Normal;
- GLfloat scale = 1.0;
-
- ASSIGN_3V( normal, x, y, z );
- COPY_3V( sum, BASE_COLOR );
-
- if ( IND & NORM_RESCALE ) {
- scale = ctx->_ModelViewInvScale;
- } else if ( IND & NORM_NORMALIZE ) {
- scale = LEN_3FV( normal );
- if ( scale != 0.0 ) scale = 1.0 / scale;
- }
-
- n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale;
- if ( n_dot_VP > 0.0F ) {
- ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] );
- n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale;
- if ( n_dot_h > 0.0F ) {
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
- ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] );
- }
- }
-
-#ifdef LIT_COLOR_IS_FLOAT
- LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f);
- LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f);
- LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f);
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] );
-#endif
- LIT_COLOR( ACOMP ) = LIT_ALPHA;
-}
-
-static void TAG(Normal3fv_single)( const GLfloat *normal )
-{
- GET_CURRENT_VERTEX;
- const struct gl_light *light = ctx->Light.EnabledList.prev;
- GLfloat n_dot_h, n_dot_VP, spec, sum[3];
- GLfloat scale = 1.0;
-
- COPY_3V( ctx->Current.Normal, normal );
- COPY_3V( sum, BASE_COLOR );
-
- if ( IND & NORM_RESCALE ) {
- scale = ctx->_ModelViewInvScale;
- } else if ( IND & NORM_NORMALIZE ) {
- scale = LEN_3FV( normal );
- if ( scale != 0.0 ) scale = 1.0 / scale;
- }
-
- n_dot_VP = DOT3( normal, light->_VP_inf_norm ) * scale;
- if ( n_dot_VP > 0.0F ) {
- ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] );
- n_dot_h = DOT3( normal, light->_h_inf_norm ) * scale;
- if ( n_dot_h > 0.0F ) {
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
- ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] );
- }
- }
-
-#ifdef LIT_COLOR_IS_FLOAT
- LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f);
- LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f);
- LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f);
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] );
-#endif
- LIT_COLOR( ACOMP ) = LIT_ALPHA;
-}
-
-
-static void TAG(Normal3f_multi)( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_VERTEX;
- struct gl_light *light;
- GLfloat n_dot_h, n_dot_VP, spec, sum[3], tmp[3];
- GLfloat *normal;
-
- ASSIGN_3V( ctx->Current.Normal, x, y, z );
- COPY_3V( sum, BASE_COLOR );
-
- if ( IND & NORM_RESCALE ) {
- normal = tmp;
- ASSIGN_3V( normal, x, y, z );
- SELF_SCALE_SCALAR_3V( normal, ctx->_ModelViewInvScale );
- } else if ( IND & NORM_NORMALIZE ) {
- normal = tmp;
- ASSIGN_3V( normal, x, y, z );
- NORMALIZE_3FV( normal );
- } else {
- normal = ctx->Current.Normal;
- }
-
- foreach ( light, &ctx->Light.EnabledList ) {
- n_dot_VP = DOT3( normal, light->_VP_inf_norm );
- if ( n_dot_VP > 0.0F ) {
- ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] );
- n_dot_h = DOT3( normal, light->_h_inf_norm );
- if ( n_dot_h > 0.0F ) {
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
- ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] );
- }
- }
- }
-
-#ifdef LIT_COLOR_IS_FLOAT
- LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f);
- LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f);
- LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f);
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] );
-#endif
- LIT_COLOR( ACOMP ) = LIT_ALPHA;
-}
-
-static void TAG(Normal3fv_multi)( const GLfloat *n )
-{
- GET_CURRENT_VERTEX;
- struct gl_light *light;
- GLfloat n_dot_h, n_dot_VP, spec, sum[3], tmp[3];
- GLfloat *normal;
-
- COPY_3V( ctx->Current.Normal, n );
- COPY_3V( sum, BASE_COLOR );
-
- if ( IND & NORM_RESCALE ) {
- normal = tmp;
- COPY_3V( normal, n );
- SELF_SCALE_SCALAR_3V( normal, ctx->_ModelViewInvScale );
- } else if ( IND & NORM_NORMALIZE ) {
- normal = tmp;
- COPY_3V( normal, n );
- NORMALIZE_3FV( normal );
- } else {
- normal = ctx->Current.Normal;
- }
-
- foreach ( light, &ctx->Light.EnabledList ) {
- n_dot_VP = DOT3( normal, light->_VP_inf_norm );
- if ( n_dot_VP > 0.0F ) {
- ACC_SCALE_SCALAR_3V( sum, n_dot_VP, light->_MatDiffuse[0] );
- n_dot_h = DOT3( normal, light->_h_inf_norm );
- if ( n_dot_h > 0.0F ) {
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
- ACC_SCALE_SCALAR_3V( sum, spec, light->_MatSpecular[0] );
- }
- }
- }
-
-#ifdef LIT_COLOR_IS_FLOAT
- LIT_COLOR ( RCOMP ) = CLAMP(sum[0], 0.0f, 0.1f);
- LIT_COLOR ( GCOMP ) = CLAMP(sum[1], 0.0f, 0.1f);
- LIT_COLOR ( BCOMP ) = CLAMP(sum[2], 0.0f, 0.1f);
-#else
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( RCOMP ), sum[0] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( GCOMP ), sum[1] );
- UNCLAMPED_FLOAT_TO_UBYTE( LIT_COLOR( BCOMP ), sum[2] );
-#endif
- LIT_COLOR( ACOMP ) = LIT_ALPHA;
-}
-
-
-
-static void TAG(init_norm)( void )
-{
- norm_tab[IND].normal3f_single = TAG(Normal3f_single);
- norm_tab[IND].normal3fv_single = TAG(Normal3fv_single);
- norm_tab[IND].normal3f_multi = TAG(Normal3f_multi);
- norm_tab[IND].normal3fv_multi = TAG(Normal3fv_multi);
-}
-
-
-
-#ifndef PRESERVE_NORMAL_DEFS
-#undef GET_CURRENT
-#undef GET_CURRENT_VERTEX
-#undef LIT_COLOR
-#undef LIT_COLOR_IS_FLOAT
-#endif
-#undef PRESERVE_NORMAL_DEFS
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h
deleted file mode 100644
index 97dca3fd4..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h
+++ /dev/null
@@ -1,570 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keithw@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- */
-
-/* Template for immediate mode vertices.
- *
- * Probably instantiate once for each vertex format used:
- * - TINY_VERTICES
- * - TEX0_VERTICES
- * - TEX1_VERTICES
- * - PTEX_VERTICES
- *
- * Have to handle TEX->PTEX transition somehow.
- */
-
-#define DBG 0
-
-
-
-/* =============================================================
- * GL_POINTS
- */
-
-static void TAG(flush_point_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- if ( !v0->mask ) {
- LOCAL_VARS;
- DRAW_POINT( v0 );
- }
-}
-
-
-/* =============================================================
- * GL_LINES
- */
-
-static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_line_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- FLUSH_VERTEX = TAG(flush_line_1);
- ACTIVE_VERTEX = IMM_VERTICES( 1 );
-}
-
-static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v1 = v0 - 1;
- ACTIVE_VERTEX = IMM_VERTICES( 0 );
- FLUSH_VERTEX = TAG(flush_line_0);
- if (FALLBACK_OR_CLIPPING)
- CLIP_OR_DRAW_LINE( ctx, v1, v0 );
- else
- DRAW_LINE( ctx, v1, v0 );
-}
-
-
-/* =============================================================
- * GL_LINE_LOOP
- */
-
-static void TAG(flush_line_loop_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_line_loop_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_line_loop_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- ACTIVE_VERTEX = v0 + 1;
- FLUSH_VERTEX = TAG(flush_line_loop_1);
-}
-
-#define DRAW_LINELOOP_LINE( a, b ) \
- if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING) { \
- CLIP_OR_DRAW_LINE( ctx, a, b ); \
- } else if (EXTEND_PRIM( 1 )) { \
- EMIT_VERTEX( b ); \
- } else { \
- BEGIN_PRIM( GL_LINE_STRIP, 2 ); \
- EMIT_VERTEX( a ); \
- EMIT_VERTEX( b ); \
- }
-
-static void TAG(flush_line_loop_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v1 = v0 - 1;
- ACTIVE_VERTEX = v1;
- FLUSH_VERTEX = TAG(flush_line_loop_2);
- DRAW_LINELOOP_LINE( v1, v0 );
-}
-
-static void TAG(flush_line_loop_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v1 = v0 + 1;
- ACTIVE_VERTEX = v1;
- FLUSH_VERTEX = TAG(flush_line_loop_1);
- DRAW_LINELOOP_LINE( v1, v0 );
-}
-
-static void TAG(end_line_loop)( GLcontext *ctx )
-{
- LOCAL_VARS;
-
- if ( FLUSH_VERTEX != TAG(flush_line_loop_0) ) {
- TNL_VERTEX *v1 = ACTIVE_VERTEX;
- TNL_VERTEX *v0 = IMM_VERTICES( 0 );
- DRAW_LINELOOP_LINE( v1, v0 );
- }
-}
-
-
-
-/* =============================================================
- * GL_LINE_STRIP
- */
-
-static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_line_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- ACTIVE_VERTEX = v0 + 1;
- FLUSH_VERTEX = TAG(flush_line_strip_0b);
-}
-
-
-static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v1 = v0 - 1;
-
- ACTIVE_VERTEX = v1;
- FLUSH_VERTEX = TAG(flush_line_strip_2);
-
- if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING)
- CLIP_OR_DRAW_LINE( ctx, v1, v0 );
- else if (EXTEND_PRIM( 1 )) {
- EMIT_VERTEX( v0 );
- } else {
- BEGIN_PRIM( GL_LINE_STRIP, 2 );
- EMIT_VERTEX( v1 );
- EMIT_VERTEX( v0 );
- }
-}
-
-static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v1 = v0 + 1;
-
- ACTIVE_VERTEX = v1;
- FLUSH_VERTEX = TAG(flush_line_strip_1);
-
- if (!HAVE_LINE_STRIP || FALLBACK_OR_CLIPPING)
- CLIP_OR_DRAW_LINE( ctx, v1, v0 );
- else if (EXTEND_PRIM( 1 )) {
- EMIT_VERTEX( v0 );
- } else {
- BEGIN_PRIM( GL_LINE_STRIP, 2 );
- EMIT_VERTEX( v1 );
- EMIT_VERTEX( v0 );
- }
-}
-
-
-
-/* =============================================================
- * GL_TRIANGLES
- */
-
-static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_triangle_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_triangle_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" );
-
- ACTIVE_VERTEX = v0 + 1;
- FLUSH_VERTEX = TAG(flush_triangle_1);
- BEGIN_PRIM( GL_TRIANGLES, 0 );
-}
-
-static void TAG(flush_triangle_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" );
-
- ACTIVE_VERTEX = v0 + 1;
- FLUSH_VERTEX = TAG(flush_triangle_2);
-}
-
-static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v2 = v0 - 2;
- TNL_VERTEX *v1 = v0 - 1;
-
- if ( DBG ) fprintf( stderr, __FUNCTION__ "\n" );
-
- ACTIVE_VERTEX = v2;
- FLUSH_VERTEX = TAG(flush_triangle_0);
-
- /* nothing gained by trying to emit as hw primitives -- that
- * happens normally in this case.
- */
- if (FALLBACK_OR_CLIPPING)
- CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 );
- else
- DRAW_TRI( ctx, v2, v1, v0 );
-}
-
-
-
-
-/* =============================================================
- * GL_TRIANGLE_STRIP
- */
-
-static void TAG(flush_tri_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_tri_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 1 );
- FLUSH_VERTEX = TAG(flush_tri_strip_1);
-}
-
-static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 2 );
- FLUSH_VERTEX = TAG(flush_tri_strip_2);
-}
-
-#define DO_TRISTRIP_TRI( vert0, vert1 ) \
- if (!HAVE_TRI_STRIP || FALLBACK_OR_CLIPPING) { \
- TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \
- TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \
- TAG(draw_tri)( ctx, v2, v1, v0 ); \
- } else if (EXTEND_PRIM( 1 )) { \
- EMIT_VERTEX( v0 ); \
- } else { \
- TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \
- TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \
- BEGIN_PRIM( GL_TRIANGLE_STRIP, 3 ); \
- EMIT_VERTEX( v2 ); \
- EMIT_VERTEX( v1 ); \
- EMIT_VERTEX( v0 ); \
- }
-
-static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- FLUSH_VERTEX = TAG(flush_tri_strip_3);
- ACTIVE_VERTEX = IMM_VERTICES( 3 );
- DO_TRISTRIP_TRI( 0, 1 );
-}
-
-static void TAG(flush_tri_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- FLUSH_VERTEX = TAG(flush_tri_strip_4);
- ACTIVE_VERTEX = IMM_VERTICES( 0 );
- DO_TRISTRIP_TRI( 1, 2 );
-}
-
-static void TAG(flush_tri_strip_4)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- FLUSH_VERTEX = TAG(flush_tri_strip_5);
- ACTIVE_VERTEX = IMM_VERTICES( 1 );
- DO_TRISTRIP_TRI( 2, 3 );
-}
-
-static void TAG(flush_tri_strip_5)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- FLUSH_VERTEX = TAG(flush_tri_strip_2);
- ACTIVE_VERTEX = IMM_VERTICES( 2 );
- DO_TRISTRIP_TRI( 0, 3 );
-}
-
-
-
-/* =============================================================
- * GL_TRIANGLE_FAN
- */
-
-static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_tri_fan_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- ACTIVE_VERTEX = v0 + 1;
- FLUSH_VERTEX = TAG(flush_tri_fan_1);
-}
-
-static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- ACTIVE_VERTEX = v0 + 1;
- FLUSH_VERTEX = TAG(flush_tri_fan_2);
-}
-
-#define DO_TRIFAN_TRI( vert0, vert1 ) \
- if (!HAVE_TRI_FAN || FALLBACK_OR_CLIPPING) { \
- TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \
- TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \
- TAG(draw_tri)( ctx, v2, v1, v0 ); \
- } else if (EXTEND_PRIM( 1 )) { \
- EMIT_VERTEX( v0 ); \
- } else { \
- TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \
- TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \
- BEGIN_PRIM( GL_TRIANGLE_FAN, 3 ); \
- EMIT_VERTEX( v2 ); \
- EMIT_VERTEX( v1 ); \
- EMIT_VERTEX( v0 ); \
- }
-
-static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 1 );
- FLUSH_VERTEX = TAG(flush_tri_fan_3 );
- DO_TRIFAN_TRI( 0, 1 );
-}
-
-static void TAG(flush_tri_fan_3)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 2 );
- FLUSH_VERTEX = TAG(flush_tri_fan_2 );
- DO_TRIFAN_TRI( 0, 2 );
-}
-
-
-
-/* =============================================================
- * GL_QUADS
- */
-
-static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_quad_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_quad_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_quad_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- IMM_VERTEX( v0 ) = v0 + 1;
- FLUSH_VERTEX = TAG(flush_quad_1);
-}
-
-static void TAG(flush_quad_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- IMM_VERTEX( v0 ) = v0 + 1;
- FLUSH_VERTEX = TAG(flush_quad_2);
-}
-
-static void TAG(flush_quad_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- IMM_VERTEX( v0 ) = v0 + 1;
- FLUSH_VERTEX = TAG(flush_quad_3);
-}
-
-static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v3 = v0 - 3;
- TNL_VERTEX *v2 = v0 - 2;
- TNL_VERTEX *v1 = v0 - 1;
-
- IMM_VERTEX( v0 ) = v3;
- FLUSH_VERTEX = TAG(flush_quad_0);
-
- if (!HAVE_HW_QUADS || FALLBACK_OR_CLIPPING) {
- CLIP_OR_DRAW_TRI( ctx, v3, v2, v0 );
- CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 );
- } else {
- EXTEND_PRIM_NF( GL_QUADS, 4 );
- EMIT_VERTEX( v3 );
- EMIT_VERTEX( v2 );
- EMIT_VERTEX( v1 );
- EMIT_VERTEX( v0 );
- }
-}
-
-
-
-/* =============================================================
- * GL_QUAD_STRIP
- */
-
-static void TAG(flush_quad_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_quad_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_quad_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_quad_strip_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- IMM_VERTEX( v3 ) = v0;
- IMM_VERTEX( v0 ) = v0 + 1;
- FLUSH_VERTEX = TAG(flush_quad_strip_1);
-}
-
-static void TAG(flush_quad_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- IMM_VERTEX( v2 ) = v0;
- IMM_VERTEX( v0 ) = v0 + 1;
- FLUSH_VERTEX = TAG(flush_quad_strip_2);
-}
-
-static void TAG(flush_quad_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
-
- IMM_VERTEX( v1 ) = v0;
- IMM_VERTEX( v0 ) = v0 + 1;
- FLUSH_VERTEX = TAG(flush_quad_strip_3);
-}
-
-static void TAG(flush_quad_strip_3)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- TNL_VERTEX *v3 = IMM_VERTEX( v3 );
- TNL_VERTEX *v2 = IMM_VERTEX( v2 );
- TNL_VERTEX *v1 = IMM_VERTEX( v1 );
-
- IMM_VERTEX( v0 ) = v3;
- IMM_VERTEX( v2 ) = v0;
- IMM_VERTEX( v3 ) = v1;
- FLUSH_VERTEX = TAG(flush_quad_strip_2);
-
- if (FALLBACK_OR_CLIPPING) {
- CLIP_OR_DRAW_TRI( ctx, v3, v2, v0 );
- CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 );
- } else {
- DRAW_TRI( ctx, v3, v2, v0 );
- DRAW_TRI( ctx, v2, v1, v0 );
- }
-}
-
-
-
-/* =============================================================
- * GL_POLYGON
- */
-
-static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 );
-static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 );
-
-static void TAG(flush_poly_0)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 1 );
- FLUSH_VERTEX = TAG(flush_poly_1);
-}
-
-static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 2 );
- FLUSH_VERTEX = TAG(flush_poly_2);
-}
-
-#define DO_POLY_TRI( vert0, vert1 ) \
- if (!HAVE_POLYGONS || FALLBACK_OR_CLIPPING) { \
- TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \
- TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \
- TAG(draw_tri)( ctx, v1, v0, v2 ); \
- } else if (EXTEND_PRIM( 1 )) { \
- EMIT_VERTEX( v0 ); \
- } else { \
- TNL_VERTEX *v2 = IMM_VERTICES( vert0 ); \
- TNL_VERTEX *v1 = IMM_VERTICES( vert1 ); \
- BEGIN_PRIM( GL_POLYGON, 3 ); \
- EMIT_VERTEX( v2 ); \
- EMIT_VERTEX( v1 ); \
- EMIT_VERTEX( v0 ); \
- }
-
-static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 1 );
- FLUSH_VERTEX = TAG(flush_poly_3);
- DO_POLY_TRI( 0, 1 );
-}
-
-static void TAG(flush_poly_3)( GLcontext *ctx, TNL_VERTEX *v0 )
-{
- LOCAL_VARS;
- ACTIVE_VERTEX = IMM_VERTICES( 2 );
- FLUSH_VERTEX = TAG(flush_poly_2);
- DO_POLY_TRI( 0, 2 );
-}
-
-
-void (*TAG(flush_tab)[GL_POLYGON+1])( GLcontext *, TNL_VERTEX * ) =
-{
- TAG(flush_point),
- TAG(flush_line_0),
- TAG(flush_line_loop_0),
- TAG(flush_line_strip_0),
- TAG(flush_triangle_0),
- TAG(flush_tri_strip_0),
- TAG(flush_tri_fan_0),
- TAG(flush_quad_0),
- TAG(flush_quad_strip_0),
- TAG(flush_poly_0),
-};
-
-
-#ifndef PRESERVE_PRIM_DEFS
-#undef LOCAL_VARS
-#undef GET_INTERP_FUNC
-#undef IMM_VERTEX
-#undef IMM_VERTICES
-#undef FLUSH_VERTEX
-#endif
-#undef PRESERVE_PRIM_DEFS
-#undef EXTEND_PRIM
-#undef EMIT_VERTEX
-#undef EMIT_VERTEX_TRI
-#undef EMIT_VERTEX_LINE
-#undef EMIT_VERTEX_POINT
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_tapi.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_tapi.h
deleted file mode 100644
index b82a9abeb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_tapi.h
+++ /dev/null
@@ -1,75 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keith_whitwell@yahoo.com>
- */
-
-/* Template for immediate mode texture coordinate functions.
- */
-
-#ifndef DO_PROJ_TEX
-#error "Need to define DO_PROJ_TEX"
-#endif
-
-
-/* =============================================================
- * Notify on calls to texture4f, to allow switch to projected texture
- * vertex format:
- */
-
-static void TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
-{
- GET_CURRENT;
- DO_PROJ_TEX;
- TEXCOORD4( s, t, r, q );
-}
-
-static void TAG(TexCoord4fv)( const GLfloat *v )
-{
- GET_CURRENT;
- DO_PROJ_TEX;
- TEXCOORD4( v[0], v[1], v[2], v[3] );
-}
-
-static void TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s,
- GLfloat t, GLfloat r, GLfloat q )
-{
- GET_CURRENT;
- DO_PROJ_TEX;
- MULTI_TEXCOORD4( unit, s, t, r, q );
-}
-
-static void TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *v )
-{
- GET_CURRENT;
- DO_PROJ_TEX;
- MULTI_TEXCOORD4( unit, v[0], v[1], v[2], v[3] );
-}
-
-
-
-#undef DO_PROJ_TEX
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h
deleted file mode 100644
index 95e93b1c8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h
+++ /dev/null
@@ -1,159 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes <gareth@valinux.com>
- * Keith Whitwell <keithw@valinux.com>
- */
-
-/* Template for immediate mode vertex functions.
- */
-
-#define DBG 0
-
-#define VERTEX( ox, oy, oz, ow )
-do {
- GET_CURRENT_VERTEX;
- GLfloat w;
- GLuint mask;
- const GLfloat * const m = ctx->_ModelProjectMatrix.m;
-
- if (DO_FULL_MATRIX) {
- VERTEX_CLIP(0) = m[0] * ox + m[4] * oy + m[8] * oz + m[12] * ow;
- VERTEX_CLIP(1) = m[1] * ox + m[5] * oy + m[9] * oz + m[13] * ow;
- VERTEX_CLIP(2) = m[2] * ox + m[6] * oy + m[10] * oz + m[14] * ow;
- VERTEX_CLIP(3) = m[3] * ox + m[7] * oy + m[11] * oz + m[15] * ow;
- w = VERTEX_CLIP(3);
- }
- else if (DO_NOROT_MATRIX) {
- VERTEX_CLIP(0) = m[0] * ox + m[12] * ow;
- VERTEX_CLIP(1) = m[5] * oy + m[13] * ow;
- VERTEX_CLIP(2) = m[10] * oz + m[14] * ow;
- VERTEX_CLIP(3) = ow;
- w = ow;
- }
- else {
- ASSERT (DO_IDENTITY_MATRIX);
- VERTEX_CLIP(0) = ox;
- VERTEX_CLIP(1) = oy;
- VERTEX_CLIP(2) = oz;
- VERTEX_CLIP(3) = ow;
- w = ow;
- }
-
- mask = 0;
- if (DO_CLIP_TEST) {
- if ( VERTEX_CLIP(0) > w ) mask |= CLIP_RIGHT_BIT;
- if ( VERTEX_CLIP(0) < -w ) mask |= CLIP_LEFT_BIT;
- if ( VERTEX_CLIP(1) > w ) mask |= CLIP_TOP_BIT;
- if ( VERTEX_CLIP(1) < -w ) mask |= CLIP_BOTTOM_BIT;
- if ( VERTEX_CLIP(2) > w ) mask |= CLIP_FAR_BIT;
- if ( VERTEX_CLIP(2) < -w ) mask |= CLIP_NEAR_BIT;
- VERTEX_MASK(v) = mask;
- }
-
- if (!mask) {
- if (HAVE_VERTEX_WIN) {
- if (!HAVE_HW_VIEWPORT) {
- const GLfloat *s = GET_VIEWPORT_MATRIX();
- if (HAVE_W && HAVE_HW_DIVIDE) {
- VERTEX_WIN( 0 ) = s[0] * VERTEX_CLIP( 0 ) + s[12];
- VERTEX_WIN( 1 ) = s[5] * VERTEX_CLIP( 1 ) + s[13];
- VERTEX_WIN( 2 ) = s[10] * VERTEX_CLIP( 2 ) + s[14];
- VERTEX_WIN( 3 ) = w;
- }
- else {
- const GLfloat oow = 1.0/w; /* possibly opt away */
- VERTEX_WIN( 0 ) = s[0] * VERTEX_CLIP( 0 ) * oow + s[12];
- VERTEX_WIN( 1 ) = s[5] * VERTEX_CLIP( 1 ) * oow + s[13];
- VERTEX_WIN( 2 ) = s[10] * VERTEX_CLIP( 2 ) * oow + s[14];
- if (HAVE_W)
- VERTEX_WIN( 3 ) = oow;
- }
- }
- else if (HAVE_W && HAVE_HW_DIVIDE) {
- if (!VERTEX_WIN_IS_VERTEX_CLIP) {
- VERTEX_WIN( 0 ) = VERTEX_CLIP( 0 );
- VERTEX_WIN( 1 ) = VERTEX_CLIP( 1 );
- VERTEX_WIN( 2 ) = VERTEX_CLIP( 2 );
- VERTEX_WIN( 3 ) = w;
- }
- }
- else {
- const GLfloat oow = 1.0/w; /* possibly opt away */
- VERTEX_WIN( 0 ) = VERTEX_CLIP( 0 ) * oow;
- VERTEX_WIN( 1 ) = VERTEX_CLIP( 1 ) * oow;
- VERTEX_WIN( 2 ) = VERTEX_CLIP( 2 ) * oow;
- if (HAVE_W)
- VERTEX_WIN( 3 ) = oow;
- }
- }
- } else if (!FALLBACK_OR_CLIPPING) {
- SET_CLIPPING(); /* transition to clipping */
- }
-
- COPY_VERTEX_FROM_CURRENT;
- BUILD_PRIM_FROM_VERTEX;
-}
-
-/* Let the compiler optimize away the constant operations:
- */
-static void VTAG(Vertex2f)( GLfloat ox, GLfloat oy )
-{
- /* Cliptest on clip[2] could also be eliminated...
- */
- VERTEX( ox, oy, 0, 1 );
-}
-
-static void VTAG(Vertex2fv)( const GLfloat *obj )
-{
- /* Cliptest on clip[2] could also be eliminated...
- */
- VERTEX( obj[0], obj[1], 0, 1 );
-}
-
-static void VTAG(Vertex3f)( GLfloat ox, GLfloat oy, GLfloat oz )
-{
- VERTEX( ox, oy, oz, 1 );
-}
-
-static void VTAG(Vertex3fv)( const GLfloat *obj )
-{
- VERTEX( obj[0], obj[1], obj[2], 1 );
-}
-
-static void VTAG(Vertex4f)( GLfloat ox, GLfloat oy, GLfloat oz, GLfloat ow )
-{
- VERTEX( ox, oy, oz, ow );
-}
-
-static void VTAG(Vertex4fv)( const GLfloat *obj )
-{
- VERTEX( obj[0], obj[1], obj[2], obj[3] );
-}
-
-
-#undef DO_FULL_MATRIX
-#undef VTAG
-#undef VERTEX
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vb.c b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vb.c
deleted file mode 100644
index 0c4462f55..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vb.c
+++ /dev/null
@@ -1,204 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith_whitwell@yahoo.com>
- */
-
-/* Template to build clipping routines to support t_dd_imm_primtmp.h.
- *
- * The TAG(draw_line) and TAG(draw_triangle) routines are called in
- * clipping and fallback scenarios, and when the native hardware
- * primitive (eg polygons) is unavailable.
- */
-
-
-#define CLIP_DOTPROD(K, A, B, C, D) \
- (CLIP_X(K)*A + CLIP_Y(K)*B + \
- CLIP_Z(K)*C + CLIP_W(K)*D)
-
-#define POLY_CLIP( PLANE, A, B, C, D ) \
-do { \
- if (mask & PLANE) { \
- TNL_VERTEX **indata = inlist[in]; \
- TNL_VERTEX **outdata = inlist[in ^= 1]; \
- TNL_VERTEX *J = indata[0]; \
- GLfloat dpJ = CLIP_DOTPROD(J, A, B, C, D ); \
- GLuint outcount = 0; \
- GLuint i; \
- \
- indata[n] = indata[0]; /* prevent rotation of vertices */ \
- for (i = 1; i <= n; i++) { \
- TNL_VERTEX *I = indata[i]; \
- GLfloat dpI = CLIP_DOTPROD(idx, A, B, C, D ); \
- \
- if (!NEGATIVE(dpPrev)) { \
- outdata[outcount++] = J; \
- } \
- \
- if (DIFFERENT_SIGNS(dpI, dpJ)) { \
- TNL_VERTEX *O = verts++; \
- outdata[outcount++] = O; \
- if (NEGATIVE(dpI)) { \
- /* Going out of bounds. Avoid division by zero as we \
- * know dp != dpPrev from DIFFERENT_SIGNS, above. \
- */ \
- GLfloat t = dpI / (dpI - dpJ); \
- INTERP( ctx, t, O, I, J ); \
- } else { \
- /* Coming back in. \
- */ \
- GLfloat t = dpJ / (dpJ - dpI); \
- INTERP( ctx, t, O, J, I ); \
- } \
- } \
- \
- J = I; \
- dpJ = dpI; \
- } \
- \
- if (outcount < 3) \
- return; \
- \
- nr = outcount; \
- } \
-} while (0)
-
-
-#define LINE_CLIP(PLANE, A, B, C, D ) \
-do { \
- if (mask & PLANE) { \
- GLfloat dpI = CLIP_DOTPROD( I, A, B, C, D ); \
- GLfloat dpJ = CLIP_DOTPROD( J, A, B, C, D ); \
- \
- if (DIFFERENT_SIGNS(dpI, dpJ)) { \
- TNL_VERTEX *O = verts++; \
- if (NEGATIVE(dpJ)) { \
- GLfloat t = dpI / (dpI - dpJ); \
- INTERP( ctx, t, O, I, J ); \
- J = O; \
- } else { \
- GLfloat t = dpJ / (dpJ - dpI); \
- INTERP( ctx, t, O, J, I ); \
- I = O; \
- } \
- } \
- else if (NEGATIVE(dpI)) \
- return; \
- } \
-} while (0)
-
-
-
-/* Clip a line against the viewport and user clip planes.
- */
-static void TAG(clip_draw_line)( GLcontext *ctx,
- TNL_VERTEX *I,
- TNL_VERTEX *J,
- GLuint mask )
-{
- LOCAL_VARS;
- GET_INTERP_FUNC;
- TNL_VERTEX tmp[MAX_CLIPPED_VERTICES];
- TNL_VERTEX *verts = tmp;
- TNL_VERTEX *pv = J;
-
- LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 );
- LINE_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 );
- LINE_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 );
- LINE_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 );
- LINE_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 );
- LINE_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 );
-
- if ((ctx->_TriangleCaps & DD_FLATSHADE) && J != pv)
- COPY_PV( ctx, J, pv );
-
- DRAW_LINE( I, J );
-}
-
-
-/* Clip a triangle against the viewport and user clip planes.
- */
-static void TAG(clip_draw_triangle)( GLcontext *ctx,
- TNL_VERTEX *v0,
- TNL_VERTEX *v1,
- TNL_VERTEX *v2,
- GLuint mask )
-{
- LOCAL_VARS;
- GET_INTERP_FUNC;
- TNL_VERTEX tmp[MAX_CLIPPED_VERTICES];
- TNL_VERTEX *verts = tmp;
- TNL_VERTEX *(inlist[2][MAX_CLIPPED_VERTICES]);
- TNL_VERTEX **out;
- GLuint in = 0;
- GLuint n = 3;
- GLuint i;
-
- ASSIGN_3V(inlist, v2, v0, v1 ); /* pv rotated to slot zero */
-
- POLY_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 );
- POLY_CLIP( CLIP_LEFT_BIT, 1, 0, 0, 1 );
- POLY_CLIP( CLIP_TOP_BIT, 0, -1, 0, 1 );
- POLY_CLIP( CLIP_BOTTOM_BIT, 0, 1, 0, 1 );
- POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 );
- POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 );
-
- if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0])
- COPY_PV( ctx, inlist[0], v2 );
-
- out = inlist[in];
- DRAW_POLYGON( out, n );
-}
-
-
-static __inline void TAG(draw_triangle)( GLcontext *ctx,
- TNL_VERTEX *v0,
- TNL_VERTEX *v1,
- TNL_VERTEX *v2 )
-{
- LOCAL_VARS;
- GLubyte ormask = (v0->mask | v1->mask | v2->mask);
-
- if ( !ormask ) {
- DRAW_TRI( v0, v1, v2 );
- } else if ( !(v0->mask & v1->mask & v2->mask) ) {
- TAG(clip_draw_triangle)( ctx, v0, v1, v2, ormask );
- }
-}
-
-static __inline void TAG(draw_line)( GLcontext *ctx,
- TNL_VERTEX *v0,
- TNL_VERTEX *v1 )
-{
- LOCAL_VARS;
- GLubyte ormask = (v0->mask | v1->mask);
-
- if ( !ormask ) {
- DRAW_LINE( v0, v1 );
- } else if ( !(v0->mask & v1->mask) ) {
- TAG(clip_draw_line)( ctx, v0, v1, ormask );
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h
deleted file mode 100644
index 2f76553cf..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h
+++ /dev/null
@@ -1,268 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith_whitwell@yahoo.com>
- */
-
-/* Template to build support for t_dd_imm_* tnl module using vertices
- * as defined in t_dd_vertex.h.
- *
- * See t_dd_vbtmp.h for definitions of arguments to this file.
- * Unfortunately it seems necessary to duplicate a lot of that code.
- */
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-
-
-/* COPY_VERTEX_FROM_CURRENT in t_dd_imm_vapi.c
- */
-static void TAG(emit_vfmt)( GLcontext *ctx, VERTEX *v )
-{
- LOCALVARS
- ;
-
- /* This template assumes (like t_dd_vbtmp.h) that color is ubyte.
- */
- if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES)
- {
- const GLubyte *col = GET_HARDWARE_COLOR();
- if (HAVE_RGBA_COLOR) {
- v->v.ui[4] = *(GLuint *)&col;
- } else {
- v->v.color.blue = col[2];
- v->v.color.green = col[1];
- v->v.color.red = col[0];
- v->v.color.alpha = col[3];
- }
- }
- else {
- if (HAVE_RGBA_COLOR) {
- v->v.ui[3] = *(GLuint *)col;
- }
- else {
- v->tv.color.blue = col[2];
- v->tv.color.green = col[1];
- v->tv.color.red = col[0];
- v->tv.color.alpha = col[3];
- }
- }
-
- if (DO_TEX0) {
- GLfloat *tc = ctx->Current.Texture[0];
- v->v.u0 = tc[0];
- v->v.v0 = tc[1];
- if (DO_PTEX) {
- if (HAVE_PTEX_VERTICES) {
- v->pv.q0 = tc[3];
- }
- else {
- float rhw = 1.0 / tc[3];
- v->v.w *= tc[3];
- v->v.u0 *= rhw;
- v->v.v0 *= rhw;
- }
- }
- }
- if (DO_TEX1) {
- GLfloat *tc = ctx->Current.Texture[1];
- if (DO_PTEX) {
- v->pv.u1 = tc[0];
- v->pv.v1 = tc[1];
- v->pv.q1 = tc[3];
- }
- else {
- v->v.u1 = tc[0];
- v->v.v1 = tc[1];
- }
- }
- else if (DO_PTEX) {
- *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */
- }
- if (DO_TEX2) {
- GLfloat *tc = ctx->Current.Texture[2];
- if (DO_PTEX) {
- v->pv.u2 = tc[0];
- v->pv.v2 = tc[1];
- v->pv.q2 = tc[3];
- }
- else {
- v->v.u2 = tc[0];
- v->v.v2 = tc[1];
- }
- }
- if (DO_TEX3) {
- GLfloat *tc = ctx->Current.Texture[3];
- if (DO_PTEX) {
- v->pv.u3 = tc[0];
- v->pv.v3 = tc[1];
- v->pv.q3 = tc[3];
- }
- else {
- v->v.u3 = tc[0];
- v->v.v3 = tc[1];
- }
- }
-}
-
-
-
-
-static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
- TNL_VERTEX *dst,
- TNL_VERTEX *in,
- TNL_VERTEX *out )
-{
- LOCALVARS
- const GLfloat *s = GET_VIEWPORT_MAT();
- GLfloat w;
-
- (void)s;
-
- if (HAVE_HW_DIVIDE) {
- VIEWPORT_X( dst->v.v.x, dst->clip[0] );
- VIEWPORT_Y( dst->v.v.y, dst->clip[1] );
- VIEWPORT_Z( dst->v.v.z, dst->clip[2] );
- w = dstclip[3];
- }
- else {
- w = 1.0 / dst->clip[3];
- VIEWPORT_X( dst->v.v.x, dst->clip[0] * w );
- VIEWPORT_Y( dst->v.v.y, dst->clip[1] * w );
- VIEWPORT_Z( dst->v.v.z, dst->clip[2] * w );
- }
-
- if (HAVE_HW_DIVIDE || DO_TEX0) {
-
- dst->v.v.w = w;
-
- INTERP_UB( t, dst->v.ub4[4][0], out->v.ub4[4][0], in->v.ub4[4][0] );
- INTERP_UB( t, dst->v.ub4[4][1], out->v.ub4[4][1], in->v.ub4[4][1] );
- INTERP_UB( t, dst->v.ub4[4][2], out->v.ub4[4][2], in->v.ub4[4][2] );
- INTERP_UB( t, dst->v.ub4[4][3], out->v.ub4[4][3], in->v.ub4[4][3] );
-
- if (DO_TEX0) {
- if (DO_PTEX) {
- if (HAVE_PTEX_VERTICES) {
- INTERP_F( t, dst->v.pv.u0, out->v.pv.u0, in->v.pv.u0 );
- INTERP_F( t, dst->v.pv.v0, out->v.pv.v0, in->v.pv.v0 );
- INTERP_F( t, dst->v.pv.q0, out->v.pv.q0, in->v.pv.q0 );
- } else {
- GLfloat wout = out->clip[3]; /* projected clip */
- GLfloat win = in->clip[3]; /* projected clip */
- GLfloat qout = out->v.pv.w / wout;
- GLfloat qin = in->v.pv.w / win;
- GLfloat qdst, rqdst;
-
- ASSERT( !HAVE_HW_DIVIDE ); /* assert win, wout projected clip */
-
- INTERP_F( t, dst->v.v.u0, out->v.v.u0 * qout, in->v.v.u0 * qin );
- INTERP_F( t, dst->v.v.v0, out->v.v.v0 * qout, in->v.v.v0 * qin );
- INTERP_F( t, qdst, qout, qin );
-
- rqdst = 1.0 / qdst;
- dst->v.v.u0 *= rqdst;
- dst->v.v.v0 *= rqdst;
- dst->v.v.w *= rqdst;
- }
- }
- else {
- INTERP_F( t, dst->v.v.u0, out->v.v.u0, in->v.v.u0 );
- INTERP_F( t, dst->v.v.v0, out->v.v.v0, in->v.v.v0 );
- }
- }
- if (DO_TEX1) {
- if (DO_PTEX) {
- INTERP_F( t, dst->v.pv.u1, out->v.pv.u1, in->v.pv.u1 );
- INTERP_F( t, dst->v.pv.v1, out->v.pv.v1, in->v.pv.v1 );
- INTERP_F( t, dst->v.pv.q1, out->v.pv.q1, in->v.pv.q1 );
- } else {
- INTERP_F( t, dst->v.v.u1, out->v.v.u1, in->v.v.u1 );
- INTERP_F( t, dst->v.v.v1, out->v.v.v1, in->v.v.v1 );
- }
- }
- else if (DO_PTEX) {
- dst->v.pv.q0 = 0.0; /* must be a valid float on radeon */
- }
- if (DO_TEX2) {
- if (DO_PTEX) {
- INTERP_F( t, dst->v.pv.u2, out->v.pv.u2, in->v.pv.u2 );
- INTERP_F( t, dst->v.pv.v2, out->v.pv.v2, in->v.pv.v2 );
- INTERP_F( t, dst->v.pv.q2, out->v.pv.q2, in->v.pv.q2 );
- } else {
- INTERP_F( t, dst->v.v.u2, out->v.v.u2, in->v.v.u2 );
- INTERP_F( t, dst->v.v.v2, out->v.v.v2, in->v.v.v2 );
- }
- }
- if (DO_TEX3) {
- if (DO_PTEX) {
- INTERP_F( t, dst->v.pv.u3, out->v.pv.u3, in->v.pv.u3 );
- INTERP_F( t, dst->v.pv.v3, out->v.pv.v3, in->v.pv.v3 );
- INTERP_F( t, dst->v.pv.q3, out->v.pv.q3, in->v.pv.q3 );
- } else {
- INTERP_F( t, dst->v.v.u3, out->v.v.u3, in->v.v.u3 );
- INTERP_F( t, dst->v.v.v3, out->v.v.v3, in->v.v.v3 );
- }
- }
- } else {
- /* 4-dword vertex. Color is in v[3] and there is no oow coordinate.
- */
- INTERP_UB( t, dst->v.ub4[3][0], out->v.ub4[3][0], in->v.ub4[3][0] );
- INTERP_UB( t, dst->v.ub4[3][1], out->v.ub4[3][1], in->v.ub4[3][1] );
- INTERP_UB( t, dst->v.ub4[3][2], out->v.ub4[3][2], in->v.ub4[3][2] );
- INTERP_UB( t, dst->v.ub4[3][3], out->v.ub4[3][3], in->v.ub4[3][3] );
- }
-}
-
-
-static __inline void TAG(copy_pv)( GLcontext *ctx,
- TNL_VERTEX *dst,
- TNL_VERTEX *src )
-{
- if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) {
- dst->v.v.ui[4] = src->v.v.ui[4];
- }
- else {
- dst->v.v.ui[3] = src->v.v.ui[3];
- }
-}
-
-
-
-static void TAG(init)( void )
-{
- setup_tab[IND].emit = TAG(emit_vfmt);
- setup_tab[IND].interp = TAG(interp_vfmt);
-}
-
-
-#undef IND
-#undef TAG
-
-
-
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd.c b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd.c
deleted file mode 100644
index 731da5c32..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd.c
+++ /dev/null
@@ -1,58 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLubyte *i810verts = (GLubyte *)imesa->verts;
- GLuint shift = imesa->vertex_stride_shift;
- i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift));
- i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift));
- dst->ui[4] = src->ui[4];
- dst->ui[5] = src->ui[5];
-}
-
-static void copy_pv_rgba4( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLubyte *i810verts = (GLubyte *)imesa->verts;
- GLuint shift = imesa->vertex_stride_shift;
- i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift));
- i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift));
- dst->ui[4] = src->ui[4];
-}
-
-static void copy_pv_rgba3( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLubyte *i810verts = (GLubyte *)imesa->verts;
- GLuint shift = imesa->vertex_stride_shift;
- i810Vertex *dst = (i810Vertex *)(i810verts + (edst << shift));
- i810Vertex *src = (i810Vertex *)(i810verts + (esrc << shift));
- dst->ui[3] = src->ui[3];
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp.h
deleted file mode 100644
index d274ead2c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ /dev/null
@@ -1,1254 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-/* Template for render stages which build and emit vertices directly
- * to fixed-size dma buffers. Useful for rendering strips and other
- * native primitives where clipping and per-vertex tweaks such as
- * those in t_dd_tritmp.h are not required.
- *
- * Produces code for both inline triangles and indexed triangles.
- * Where various primitive types are unaccelerated by hardware, the
- * code attempts to fallback to other primitive types (quadstrips to
- * tristrips, lineloops to linestrips), or to indexed vertices.
- */
-
-#if !defined(HAVE_TRIANGLES)
-#error "must have at least triangles to use render template"
-#endif
-
-#if !HAVE_ELTS
-#define ELTS_VARS(buf)
-#define ALLOC_ELTS(nr) 0
-#define EMIT_ELT( offset, elt )
-#define EMIT_TWO_ELTS( offset, elt0, elt1 )
-#define INCR_ELTS( nr )
-#define ELT_INIT(prim)
-#define GET_CURRENT_VB_MAX_ELTS() 0
-#define GET_SUBSEQUENT_VB_MAX_ELTS() 0
-#define RELEASE_ELT_VERTS()
-#define EMIT_INDEXED_VERTS( ctx, start, count )
-#endif
-
-#ifndef EMIT_TWO_ELTS
-#define EMIT_TWO_ELTS( offset, elt0, elt1 ) \
-do { \
- EMIT_ELT( offset, elt0 ); \
- EMIT_ELT( offset+1, elt1 ); \
-} while (0)
-#endif
-
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-
-
-
-#if (HAVE_ELTS)
-static void *TAG(emit_elts)( GLcontext *ctx, GLuint *elts, GLuint nr,
- void *buf)
-{
- GLint i;
- LOCAL_VARS;
- ELTS_VARS(buf);
-
- for ( i = 0 ; i+1 < nr ; i+=2, elts += 2 ) {
- EMIT_TWO_ELTS( 0, elts[0], elts[1] );
- INCR_ELTS( 2 );
- }
-
- if (i < nr) {
- EMIT_ELT( 0, elts[0] );
- INCR_ELTS( 1 );
- }
-
- return (void *)ELTPTR;
-}
-#endif
-
-static __inline void *TAG(emit_verts)( GLcontext *ctx, GLuint start,
- GLuint count, void *buf )
-{
- return EMIT_VERTS(ctx, start, count, buf);
-}
-
-/***********************************************************************
- * Render non-indexed primitives.
- ***********************************************************************/
-
-static void TAG(render_points_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_POINTS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
- GLuint j, nr;
-
- INIT( GL_POINTS );
-
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-static void TAG(render_lines_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_LINES) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
- GLuint j, nr;
-
- INIT( GL_LINES );
-
- /* Emit whole number of lines in total and in each buffer:
- */
- count -= (count-start) & 1;
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- currentsz -= currentsz & 1;
- dmasz -= dmasz & 1;
-
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_line_strip_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_LINE_STRIPS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
- GLuint j, nr;
-
- INIT( GL_LINE_STRIP );
-
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-
- FLUSH();
-
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_line_loop_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_LINE_STRIPS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
- GLuint j, nr;
-
- INIT( GL_LINE_STRIP );
-
- if (flags & PRIM_BEGIN)
- j = start;
- else
- j = start + 1;
-
- /* Ensure last vertex won't wrap buffers:
- */
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- currentsz--;
- dmasz--;
-
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- if (j + 1 < count) {
- for ( ; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( currentsz, count - j );
-
- if (j + nr >= count &&
- start < count - 1 &&
- (flags & PRIM_END))
- {
- void *tmp;
- tmp = ALLOC_VERTS(nr+1);
- tmp = TAG(emit_verts)( ctx, j, nr, tmp );
- tmp = TAG(emit_verts)( ctx, start, 1, tmp );
- }
- else {
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
- }
-
- }
- else if (start + 1 < count && (flags & PRIM_END)) {
- void *tmp;
- tmp = ALLOC_VERTS(2);
- tmp = TAG(emit_verts)( ctx, start+1, 1, tmp );
- tmp = TAG(emit_verts)( ctx, start, 1, tmp );
- }
-
- FLUSH();
-
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_triangles_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/3) * 3;
- int currentsz;
- GLuint j, nr;
-
- INIT(GL_TRIANGLES);
-
- currentsz = (GET_CURRENT_VB_MAX_VERTS()/3) * 3;
-
- /* Emit whole number of tris in total. dmasz is already a multiple
- * of 3.
- */
- count -= (count-start)%3;
-
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-}
-
-
-
-static void TAG(render_tri_strip_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_TRI_STRIPS) {
- LOCAL_VARS;
- GLuint j, nr;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
-
- INIT(GL_TRIANGLE_STRIP);
-
- currentsz = GET_CURRENT_VB_MAX_VERTS();
-
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- /* From here on emit even numbers of tris when wrapping over buffers:
- */
- dmasz -= (dmasz & 1);
- currentsz -= (currentsz & 1);
-
- for (j = start ; j + 2 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-
- FLUSH();
-
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-static void TAG(render_tri_fan_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_TRI_FANS) {
- LOCAL_VARS;
- GLuint j, nr;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
-
- INIT(GL_TRIANGLE_FAN);
-
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
- void *tmp;
- nr = MIN2( currentsz, count - j + 1 );
- tmp = ALLOC_VERTS( nr );
- tmp = TAG(emit_verts)( ctx, start, 1, tmp );
- tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
- currentsz = dmasz;
- }
-
- FLUSH();
- }
- else {
- /* Could write code to emit these as indexed vertices (for the
- * g400, for instance).
- */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_poly_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_POLYGONS) {
- LOCAL_VARS;
- GLuint j, nr;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
-
- INIT(GL_POLYGON);
-
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- for (j = start + 1 ; j + 1 < count ; j += nr - 2 ) {
- void *tmp;
- nr = MIN2( currentsz, count - j + 1 );
- tmp = ALLOC_VERTS( nr );
- tmp = TAG(emit_verts)( ctx, start, 1, tmp );
- tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
- currentsz = dmasz;
- }
-
- FLUSH();
- }
- else if (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE)) {
- TAG(render_tri_fan_verts)( ctx, start, count, flags );
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-static void TAG(render_quad_strip_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j, nr;
-
- if (HAVE_QUAD_STRIPS) {
- LOCAL_VARS;
- GLuint j, nr;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
-
- INIT(GL_QUAD_STRIP);
-
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- dmasz -= (dmasz & 2);
- currentsz -= (currentsz & 2);
-
- for (j = start ; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-
- FLUSH();
-
- } else if (HAVE_TRI_STRIPS &&
- (ctx->_TriangleCaps & DD_FLATSHADE) &&
- TNL_CONTEXT(ctx)->vb.ColorPtr[0]->stride) {
- if (HAVE_ELTS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint j, nr;
-
- EMIT_INDEXED_VERTS( ctx, start, count );
-
- /* Simulate flat-shaded quadstrips using indexed vertices:
- */
- ELT_INIT( GL_TRIANGLES );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 1;
- count -= (count-start) & 1;
- currentsz -= currentsz & 1;
-
- if (currentsz < 12)
- currentsz = dmasz;
-
- currentsz = currentsz/6*2;
- dmasz = dmasz/6*2;
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
- if (nr >= 4) {
- GLint quads = (nr/2)-1;
- GLint i;
- ELTS_VARS( ALLOC_ELTS( quads*6 ) );
-
- for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) {
- EMIT_TWO_ELTS( 0, (i+0), (i+1) );
- EMIT_TWO_ELTS( 2, (i+2), (i+1) );
- EMIT_TWO_ELTS( 4, (i+3), (i+2) );
- INCR_ELTS( 6 );
- }
-
- FLUSH();
- }
- currentsz = dmasz;
- }
-
- RELEASE_ELT_VERTS();
- FLUSH();
- }
- else {
- /* Vertices won't fit in a single buffer or elts not
- * available - should never happen.
- */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
- }
- else if (HAVE_TRI_STRIPS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
- int currentsz;
-
- /* Emit smooth-shaded quadstrips as tristrips:
- */
- FLUSH();
- INIT( GL_TRIANGLE_STRIP );
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 1;
- currentsz = GET_CURRENT_VB_MAX_VERTS();
- currentsz -= currentsz & 1;
- count -= (count-start) & 1;
-
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
-
- FLUSH();
-
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_quads_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_QUADS) {
- LOCAL_VARS;
- int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4;
- int currentsz;
- GLuint j, nr;
-
- INIT(GL_QUADS);
-
- /* Emit whole number of quads in total. dmasz is already a multiple
- * of 4.
- */
- count -= (count-start)%4;
-
- currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4;
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
- currentsz = dmasz;
- }
- }
- else if (HAVE_ELTS) {
- /* Hardware doesn't have a quad primitive type -- try to
- * simulate it using indexed vertices and the triangle
- * primitive:
- */
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint j, nr;
-
- EMIT_INDEXED_VERTS( ctx, start, count );
-
- FLUSH();
- ELT_INIT( GL_TRIANGLES );
- currentsz = GET_CURRENT_VB_MAX_ELTS();
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 3;
- count -= (count-start) & 3;
- currentsz -= currentsz & 3;
-
- /* Adjust for rendering as triangles:
- */
- currentsz = currentsz/6*4;
- dmasz = dmasz/6*4;
-
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( currentsz, count - j );
- if (nr >= 4) {
- GLint quads = nr/4;
- GLint i;
- ELTS_VARS( ALLOC_ELTS( quads*6 ) );
-
- for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) {
- EMIT_TWO_ELTS( 0, (i+0), (i+1) );
- EMIT_TWO_ELTS( 2, (i+3), (i+1) );
- EMIT_TWO_ELTS( 4, (i+2), (i+3) );
- INCR_ELTS( 6 );
- }
-
- FLUSH();
- }
- currentsz = dmasz;
- }
-
- RELEASE_ELT_VERTS();
- }
- else if (HAVE_TRIANGLES) {
- /* Hardware doesn't have a quad primitive type -- try to
- * simulate it using triangle primitive. This is a win for
- * gears, but is it useful in the broader world?
- */
- LOCAL_VARS;
- GLuint j;
-
- INIT(GL_TRIANGLES);
-
- for (j = start; j < count-3; j += 4) {
- void *tmp = ALLOC_VERTS( 6 );
- /* Send v0, v1, v3
- */
- tmp = EMIT_VERTS(ctx, j, 2, tmp);
- tmp = EMIT_VERTS(ctx, j + 3, 1, tmp);
- /* Send v1, v2, v3
- */
- tmp = EMIT_VERTS(ctx, j + 1, 3, tmp);
- }
- }
- else {
- /* Vertices won't fit in a single buffer, should never happen.
- */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-static void TAG(render_noop)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
-}
-
-
-
-
-static tnl_render_func TAG(render_tab_verts)[GL_POLYGON+2] =
-{
- TAG(render_points_verts),
- TAG(render_lines_verts),
- TAG(render_line_loop_verts),
- TAG(render_line_strip_verts),
- TAG(render_triangles_verts),
- TAG(render_tri_strip_verts),
- TAG(render_tri_fan_verts),
- TAG(render_quads_verts),
- TAG(render_quad_strip_verts),
- TAG(render_poly_verts),
- TAG(render_noop),
-};
-
-
-/****************************************************************************
- * Render elts using hardware indexed verts *
- ****************************************************************************/
-
-#if (HAVE_ELTS)
-static void TAG(render_points_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_POINTS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- GLuint j, nr;
-
- ELT_INIT( GL_POINTS );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-
-static void TAG(render_lines_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_LINES) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- GLuint j, nr;
-
- ELT_INIT( GL_LINES );
-
- /* Emit whole number of lines in total and in each buffer:
- */
- count -= (count-start) & 1;
- currentsz -= currentsz & 1;
- dmasz -= dmasz & 1;
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_line_strip_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_LINE_STRIPS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- GLuint j, nr;
-
- FLUSH(); /* always a new primitive */
- ELT_INIT( GL_LINE_STRIP );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
- } else {
- /* TODO: Try to emit as indexed lines.
- */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_line_loop_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_LINE_STRIPS) {
- LOCAL_VARS;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- GLuint j, nr;
-
- FLUSH();
- ELT_INIT( GL_LINE_STRIP );
-
- if (flags & PRIM_BEGIN)
- j = start;
- else
- j = start + 1;
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- /* Ensure last vertex doesn't wrap:
- */
- currentsz--;
- dmasz--;
-
- if (j + 1 < count) {
- for ( ; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( currentsz, count - j );
-
- if (j + nr >= count &&
- start < count - 1 &&
- (flags & PRIM_END))
- {
- void *tmp;
- tmp = ALLOC_ELTS(nr+1);
- tmp = TAG(emit_elts)( ctx, elts+j, nr, tmp );
- tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
- }
- else {
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- currentsz = dmasz;
- }
- }
-
- }
- else if (start + 1 < count && (flags & PRIM_END)) {
- void *tmp;
- tmp = ALLOC_ELTS(2);
- tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp );
- tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
- }
-
- FLUSH();
- } else {
- /* TODO: Try to emit as indexed lines */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-/* For verts, we still eliminate the copy from main memory to dma
- * buffers. For elts, this is probably no better (worse?) than the
- * standard path.
- */
-static void TAG(render_triangles_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/3*3;
- int currentsz;
- GLuint j, nr;
-
- FLUSH();
- ELT_INIT( GL_TRIANGLES );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
-
- /* Emit whole number of tris in total. dmasz is already a multiple
- * of 3.
- */
- count -= (count-start)%3;
- currentsz -= currentsz%3;
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
-}
-
-
-
-static void TAG(render_tri_strip_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_TRI_STRIPS) {
- LOCAL_VARS;
- GLuint j, nr;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
-
- FLUSH();
- ELT_INIT( GL_TRIANGLE_STRIP );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- /* Keep the same winding over multiple buffers:
- */
- dmasz -= (dmasz & 1);
- currentsz -= (currentsz & 1);
-
- for (j = start ; j + 2 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
- } else {
- /* TODO: try to emit as indexed triangles */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-static void TAG(render_tri_fan_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_TRI_FANS) {
- LOCAL_VARS;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- GLuint j, nr;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
-
- FLUSH();
- ELT_INIT( GL_TRIANGLE_FAN );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
- void *tmp;
- nr = MIN2( currentsz, count - j + 1 );
- tmp = ALLOC_ELTS( nr );
- tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
- tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
- FLUSH();
- currentsz = dmasz;
- }
- } else {
- /* TODO: try to emit as indexed triangles */
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-
-static void TAG(render_poly_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_POLYGONS) {
- LOCAL_VARS;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- GLuint j, nr;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
-
- FLUSH();
- ELT_INIT( GL_POLYGON );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS();
- if (currentsz < 8) {
- currentsz = dmasz;
- }
-
- for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
- void *tmp;
- nr = MIN2( currentsz, count - j + 1 );
- tmp = ALLOC_ELTS( nr );
- tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
- tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
- FLUSH();
- currentsz = dmasz;
- }
- } else if (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE)) {
- TAG(render_tri_fan_verts)( ctx, start, count, flags );
- } else {
- fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
- return;
- }
-}
-
-static void TAG(render_quad_strip_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_QUAD_STRIPS && 0) {
- }
- else if (HAVE_TRI_STRIPS) {
- LOCAL_VARS;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint j, nr;
-
- FLUSH();
- currentsz = GET_CURRENT_VB_MAX_ELTS();
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 1;
- count -= (count-start) & 1;
- currentsz -= currentsz & 1;
-
- if (currentsz < 12)
- currentsz = dmasz;
-
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- ELT_INIT( GL_TRIANGLES );
-
- currentsz = currentsz/6*2;
- dmasz = dmasz/6*2;
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
-
- if (nr >= 4)
- {
- GLint i;
- GLint quads = (nr/2)-1;
- ELTS_VARS( ALLOC_ELTS( quads*6 ) );
-
- for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
- EMIT_TWO_ELTS( 0, elts[0], elts[1] );
- EMIT_TWO_ELTS( 2, elts[2], elts[1] );
- EMIT_TWO_ELTS( 4, elts[3], elts[2] );
- INCR_ELTS( 6 );
- }
-
- FLUSH();
- }
-
- currentsz = dmasz;
- }
- }
- else {
- ELT_INIT( GL_TRIANGLE_STRIP );
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
- }
- }
-}
-
-
-static void TAG(render_quads_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (HAVE_QUADS) {
- LOCAL_VARS;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/4*4;
- int currentsz;
- GLuint j, nr;
-
- FLUSH();
- ELT_INIT( GL_TRIANGLES );
-
- currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4;
-
- count -= (count-start)%4;
-
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j < count; j += nr) {
- nr = MIN2( currentsz, count - j );
- TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
- FLUSH();
- currentsz = dmasz;
- }
- } else {
- LOCAL_VARS;
- GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
- int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
- int currentsz;
- GLuint j, nr;
-
- ELT_INIT( GL_TRIANGLES );
- currentsz = GET_CURRENT_VB_MAX_ELTS();
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 3;
- count -= (count-start) & 3;
- currentsz -= currentsz & 3;
-
- /* Adjust for rendering as triangles:
- */
- currentsz = currentsz/6*4;
- dmasz = dmasz/6*4;
-
- if (currentsz < 8)
- currentsz = dmasz;
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( currentsz, count - j );
-
- if (nr >= 4)
- {
- GLint quads = nr/4;
- GLint i;
- ELTS_VARS( ALLOC_ELTS( quads * 6 ) );
-
- for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
- EMIT_TWO_ELTS( 0, elts[0], elts[1] );
- EMIT_TWO_ELTS( 2, elts[3], elts[1] );
- EMIT_TWO_ELTS( 4, elts[2], elts[3] );
- INCR_ELTS( 6 );
- }
-
- FLUSH();
- }
-
- currentsz = dmasz;
- }
- }
-}
-
-
-
-static tnl_render_func TAG(render_tab_elts)[GL_POLYGON+2] =
-{
- TAG(render_points_elts),
- TAG(render_lines_elts),
- TAG(render_line_loop_elts),
- TAG(render_line_strip_elts),
- TAG(render_triangles_elts),
- TAG(render_tri_strip_elts),
- TAG(render_tri_fan_elts),
- TAG(render_quads_elts),
- TAG(render_quad_strip_elts),
- TAG(render_poly_elts),
- TAG(render_noop),
-};
-
-
-
-#endif
-
-
-
-/* Pre-check the primitives in the VB to prevent the need for
- * fallbacks later on.
- */
-static GLboolean TAG(validate_render)( GLcontext *ctx,
- struct vertex_buffer *VB )
-{
- GLint i;
-
- if (VB->ClipOrMask & ~CLIP_CULL_BIT)
- return GL_FALSE;
-
- if (VB->Elts && !HAVE_ELTS)
- return GL_FALSE;
-
- for (i = 0 ; i < VB->PrimitiveCount ; i++) {
- GLuint prim = VB->Primitive[i].mode;
- GLuint count = VB->Primitive[i].count;
- GLboolean ok = GL_FALSE;
-
- if (!count)
- continue;
-
- switch (prim & PRIM_MODE_MASK) {
- case GL_POINTS:
- ok = HAVE_POINTS;
- break;
- case GL_LINES:
- ok = HAVE_LINES && !ctx->Line.StippleFlag;
- break;
- case GL_LINE_STRIP:
- ok = HAVE_LINE_STRIPS && !ctx->Line.StippleFlag;
- break;
- case GL_LINE_LOOP:
- ok = HAVE_LINE_STRIPS && !ctx->Line.StippleFlag;
- break;
- case GL_TRIANGLES:
- ok = HAVE_TRIANGLES;
- break;
- case GL_TRIANGLE_STRIP:
- ok = HAVE_TRI_STRIPS;
- break;
- case GL_TRIANGLE_FAN:
- ok = HAVE_TRI_FANS;
- break;
- case GL_POLYGON:
- if (HAVE_POLYGONS) {
- ok = GL_TRUE;
- }
- else
- ok = (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE));
- break;
- case GL_QUAD_STRIP:
- if (VB->Elts) {
- ok = HAVE_TRI_STRIPS;
- }
- else if (HAVE_QUAD_STRIPS) {
- ok = GL_TRUE;
- } else if (HAVE_TRI_STRIPS &&
- (ctx->_TriangleCaps & DD_FLATSHADE) &&
- VB->ColorPtr[0]->stride != 0) {
- if (HAVE_ELTS) {
- ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS();
- }
- else {
- ok = GL_FALSE;
- }
- }
- else
- ok = HAVE_TRI_STRIPS;
- break;
- case GL_QUADS:
- if (HAVE_QUADS) {
- ok = GL_TRUE;
- } else if (HAVE_ELTS) {
- ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS();
- }
- else {
- ok = HAVE_TRIANGLES; /* flatshading is ok. */
- }
- break;
- default:
- break;
- }
-
- if (!ok) {
-/* fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK)); */
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp2.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp2.h
deleted file mode 100644
index b762221b1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_dmatmp2.h
+++ /dev/null
@@ -1,914 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 4.0.3
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-/* Template for render stages which build and emit vertices directly
- * to fixed-size dma buffers. Useful for rendering strips and other
- * native primitives where clipping and per-vertex tweaks such as
- * those in t_dd_tritmp.h are not required.
- *
- */
-
-#if !HAVE_TRIANGLES || !HAVE_POINTS || !HAVE_LINES
-#error "must have points, lines & triangles to use render template"
-#endif
-
-#if !HAVE_TRI_STRIPS || !HAVE_TRI_FANS
-#error "must have tri strip and fans to use render template"
-#endif
-
-#if !HAVE_LINE_STRIPS
-#error "must have line strips to use render template"
-#endif
-
-#if !HAVE_POLYGONS
-#error "must have polygons to use render template"
-#endif
-
-#if !HAVE_ELTS
-#error "must have elts to use render template"
-#endif
-
-
-#ifndef EMIT_TWO_ELTS
-#define EMIT_TWO_ELTS( dest, offset, elt0, elt1 ) \
-do { \
- (dest)[offset] = (elt0); \
- (dest)[offset+1] = (elt1); \
-} while (0)
-#endif
-
-
-/**********************************************************************/
-/* Render whole begin/end objects */
-/**********************************************************************/
-
-
-static ELT_TYPE *TAG(emit_elts)( GLcontext *ctx,
- ELT_TYPE *dest,
- GLuint *elts, GLuint nr )
-{
- GLint i;
- LOCAL_VARS;
-
- for ( i = 0 ; i+1 < nr ; i+=2, elts += 2 ) {
- EMIT_TWO_ELTS( dest, 0, elts[0], elts[1] );
- dest += 2;
- }
- if (i < nr) {
- EMIT_ELT( dest, 0, elts[0] );
- dest += 1;
- }
-
- return dest;
-}
-
-static ELT_TYPE *TAG(emit_consecutive_elts)( GLcontext *ctx,
- ELT_TYPE *dest,
- GLuint start, GLuint nr )
-{
- GLint i;
- LOCAL_VARS;
-
- for ( i = 0 ; i+1 < nr ; i+=2, start += 2 ) {
- EMIT_TWO_ELTS( dest, 0, start, start+1 );
- dest += 2;
- }
- if (i < nr) {
- EMIT_ELT( dest, 0, start );
- dest += 1;
- }
-
- return dest;
-}
-
-/***********************************************************************
- * Render non-indexed primitives.
- ***********************************************************************/
-
-
-
-static void TAG(render_points_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (start < count) {
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
- EMIT_PRIM( ctx, GL_POINTS, HW_POINTS, start, count );
- }
-}
-
-static void TAG(render_lines_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
- count -= (count-start) & 1;
-
- if (start+1 >= count)
- return;
-
- if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) {
- RESET_STIPPLE();
- AUTO_STIPPLE( GL_TRUE );
- }
-
- EMIT_PRIM( ctx, GL_LINES, HW_LINES, start, count );
-
- if ((flags & PRIM_END) && ctx->Line.StippleFlag)
- AUTO_STIPPLE( GL_FALSE );
-}
-
-
-static void TAG(render_line_strip_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (start+1 >= count)
- return;
-
- if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag)
- RESET_STIPPLE();
-
-
- if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES ))
- {
- int dmasz = GET_MAX_HW_ELTS();
- GLuint j, nr;
-
- ELT_INIT( GL_LINES, HW_LINES );
-
- /* Emit whole number of lines in each full buffer.
- */
- dmasz = dmasz/2;
-
-
- for (j = start; j + 1 < count; j += nr - 1 ) {
- ELT_TYPE *dest;
- GLint i;
-
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( (nr-1)*2 );
-
- for ( i = j ; i+1 < j+nr ; i+=1 ) {
- EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) );
- dest += 2;
- }
-
- CLOSE_ELTS();
- }
- }
- else
- EMIT_PRIM( ctx, GL_LINE_STRIP, HW_LINE_STRIP, start, count );
-}
-
-
-static void TAG(render_line_loop_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- GLuint j, nr;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (flags & PRIM_BEGIN) {
- j = start;
- if (ctx->Line.StippleFlag)
- RESET_STIPPLE( );
- }
- else
- j = start + 1;
-
- if (flags & PRIM_END) {
-
- if (start+1 >= count)
- return;
-
- if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) {
- int dmasz = GET_MAX_HW_ELTS();
-
- ELT_INIT( GL_LINES, HW_LINES );
-
- /* Emit whole number of lines in each full buffer.
- */
- dmasz = dmasz/2;
-
- /* Ensure last vertex doesn't wrap:
- */
- dmasz--;
-
- for (; j + 1 < count; ) {
- GLint i;
- ELT_TYPE *dest;
-
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr*2 ); /* allocs room for 1 more line */
-
- for ( i = 0 ; i < nr - 1 ; i+=1 ) {
- EMIT_TWO_ELTS( dest, 0, (j+i), (j+i+1) );
- dest += 2;
- }
-
- j += nr - 1;
-
- /* Emit 1 more line into space alloced above */
- if (j + 1 >= count) {
- EMIT_TWO_ELTS( dest, 0, (j), (start) );
- dest += 2;
- }
-
- CLOSE_ELTS();
- }
- }
- else
- {
- int dmasz = GET_MAX_HW_ELTS() - 1;
-
- ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP );
-
- for ( ; j + 1 < count; ) {
- nr = MIN2( dmasz, count - j );
- if (j + nr < count) {
- ELT_TYPE *dest = ALLOC_ELTS( nr );
- dest = TAG(emit_consecutive_elts)( ctx, dest, j, nr );
- j += nr - 1;
- CLOSE_ELTS();
- }
- else if (nr) {
- ELT_TYPE *dest = ALLOC_ELTS( nr + 1 );
- dest = TAG(emit_consecutive_elts)( ctx, dest, j, nr );
- dest = TAG(emit_consecutive_elts)( ctx, dest, start, 1 );
- j += nr;
- CLOSE_ELTS();
- }
- }
- }
- } else {
- TAG(render_line_strip_verts)( ctx, j, count, flags );
- }
-}
-
-
-static void TAG(render_triangles_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- count -= (count-start)%3;
-
- if (start+2 >= count) {
- return;
- }
-
- /* need a PREFER_DISCRETE_ELT_PRIM here too..
- */
- EMIT_PRIM( ctx, GL_TRIANGLES, HW_TRIANGLES, start, count );
-}
-
-
-
-static void TAG(render_tri_strip_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (start + 2 >= count)
- return;
-
- if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES ))
- {
- int dmasz = GET_MAX_HW_ELTS();
- int parity = 0;
- GLuint j, nr;
-
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
- /* Emit even number of tris in each full buffer.
- */
- dmasz = dmasz/3;
- dmasz -= dmasz & 1;
-
- for (j = start; j + 2 < count; j += nr - 2 ) {
- ELT_TYPE *dest;
- GLint i;
-
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( (nr-2)*3 );
-
- for ( i = j ; i+2 < j+nr ; i++, parity^=1 ) {
- EMIT_ELT( dest, 0, (i+0+parity) );
- EMIT_ELT( dest, 1, (i+1-parity) );
- EMIT_ELT( dest, 2, (i+2) );
- dest += 3;
- }
-
- CLOSE_ELTS();
- }
- }
- else
- EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, count );
-}
-
-static void TAG(render_tri_fan_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (start+2 >= count)
- return;
-
- if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES ))
- {
- int dmasz = GET_MAX_HW_ELTS();
- GLuint j, nr;
-
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
- dmasz = dmasz/3;
-
- for (j = start + 1; j + 1 < count; j += nr - 1 ) {
- ELT_TYPE *dest;
- GLint i;
-
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( (nr-1)*3 );
-
- for ( i = j ; i+1 < j+nr ; i++ ) {
- EMIT_ELT( dest, 0, (start) );
- EMIT_ELT( dest, 1, (i) );
- EMIT_ELT( dest, 2, (i+1) );
- dest += 3;
- }
-
- CLOSE_ELTS();
- }
- }
- else {
- EMIT_PRIM( ctx, GL_TRIANGLE_FAN, HW_TRIANGLE_FAN, start, count );
- }
-}
-
-
-static void TAG(render_poly_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (start+2 >= count)
- return;
-
- EMIT_PRIM( ctx, GL_POLYGON, HW_POLYGON, start, count );
-}
-
-static void TAG(render_quad_strip_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- count -= (count-start) & 1;
-
- if (start+3 >= count)
- return;
-
- if (HAVE_QUAD_STRIPS) {
- EMIT_PRIM( ctx, GL_QUAD_STRIP, HW_QUAD_STRIP, start, count );
- }
- else if (ctx->_TriangleCaps & DD_FLATSHADE) {
- LOCAL_VARS;
- int dmasz = GET_MAX_HW_ELTS();
- GLuint j, nr;
-
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz = (dmasz/6)*2;
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- ELT_TYPE *dest;
- GLint quads, i;
-
- nr = MIN2( dmasz, count - j );
- quads = (nr/2)-1;
- dest = ALLOC_ELTS( quads*6 );
-
- for ( i = j ; i < j+quads*2 ; i+=2 ) {
- EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) );
- EMIT_TWO_ELTS( dest, 2, (i+2), (i+1) );
- EMIT_TWO_ELTS( dest, 4, (i+3), (i+2) );
- dest += 6;
- }
-
- CLOSE_ELTS();
- }
- }
- else {
- EMIT_PRIM( ctx, GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0, start, count );
- }
-}
-
-
-static void TAG(render_quads_verts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
- count -= (count-start)%4;
-
- if (start+3 >= count)
- return;
-
- if (HAVE_QUADS) {
- EMIT_PRIM( ctx, GL_QUADS, HW_QUADS, start, count );
- }
- else {
- /* Hardware doesn't have a quad primitive type -- simulate it
- * using indexed vertices and the triangle primitive:
- */
- LOCAL_VARS;
- int dmasz = GET_MAX_HW_ELTS();
- GLuint j, nr;
-
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
- /* Adjust for rendering as triangles:
- */
- dmasz = (dmasz/6)*4;
-
- for (j = start; j < count; j += nr ) {
- ELT_TYPE *dest;
- GLint quads, i;
-
- nr = MIN2( dmasz, count - j );
- quads = nr/4;
- dest = ALLOC_ELTS( quads*6 );
-
- for ( i = j ; i < j+quads*4 ; i+=4 ) {
- EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) );
- EMIT_TWO_ELTS( dest, 2, (i+3), (i+1) );
- EMIT_TWO_ELTS( dest, 4, (i+2), (i+3) );
- dest += 6;
- }
-
- CLOSE_ELTS();
- }
- }
-}
-
-static void TAG(render_noop)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
-}
-
-
-
-
-static tnl_render_func TAG(render_tab_verts)[GL_POLYGON+2] =
-{
- TAG(render_points_verts),
- TAG(render_lines_verts),
- TAG(render_line_loop_verts),
- TAG(render_line_strip_verts),
- TAG(render_triangles_verts),
- TAG(render_tri_strip_verts),
- TAG(render_tri_fan_verts),
- TAG(render_quads_verts),
- TAG(render_quad_strip_verts),
- TAG(render_poly_verts),
- TAG(render_noop),
-};
-
-
-/****************************************************************************
- * Render elts using hardware indexed verts *
- ****************************************************************************/
-
-static void TAG(render_points_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- int dmasz = GET_MAX_HW_ELTS();
- GLuint *elts = GET_MESA_ELTS();
- GLuint j, nr;
- ELT_TYPE *dest;
-
- ELT_INIT( GL_POINTS, HW_POINTS );
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- CLOSE_ELTS();
- }
-}
-
-
-
-static void TAG(render_lines_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- int dmasz = GET_MAX_HW_ELTS();
- GLuint *elts = GET_MESA_ELTS();
- GLuint j, nr;
- ELT_TYPE *dest;
-
- if (start+1 >= count)
- return;
-
- if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) {
- RESET_STIPPLE();
- AUTO_STIPPLE( GL_TRUE );
- }
-
- ELT_INIT( GL_LINES, HW_LINES );
-
- /* Emit whole number of lines in total and in each buffer:
- */
- count -= (count-start) & 1;
- dmasz -= dmasz & 1;
-
- for (j = start; j < count; j += nr ) {
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- CLOSE_ELTS();
- }
-
- if ((flags & PRIM_END) && ctx->Line.StippleFlag)
- AUTO_STIPPLE( GL_FALSE );
-}
-
-
-static void TAG(render_line_strip_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- int dmasz = GET_MAX_HW_ELTS();
- GLuint *elts = GET_MESA_ELTS();
- GLuint j, nr;
- ELT_TYPE *dest;
-
- if (start+1 >= count)
- return;
-
- ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP );
-
- if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag)
- RESET_STIPPLE();
-
- for (j = start; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- CLOSE_ELTS();
- }
-}
-
-
-static void TAG(render_line_loop_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- int dmasz = GET_MAX_HW_ELTS();
- GLuint *elts = GET_MESA_ELTS();
- GLuint j, nr;
- ELT_TYPE *dest;
-
- if (0) fprintf(stderr, "%s\n", __FUNCTION__);
-
- if (flags & PRIM_BEGIN)
- j = start;
- else
- j = start + 1;
-
-
- if (flags & PRIM_END) {
- if (start+1 >= count)
- return;
- }
- else {
- if (j+1 >= count)
- return;
- }
-
- ELT_INIT( GL_LINE_STRIP, HW_LINE_STRIP );
-
- if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag)
- RESET_STIPPLE();
-
-
- /* Ensure last vertex doesn't wrap:
- */
- dmasz--;
-
- for ( ; j + 1 < count; ) {
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr+1 ); /* Reserve possible space for last elt */
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- j += nr - 1;
- if (j + 1 >= count && (flags & PRIM_END)) {
- dest = TAG(emit_elts)( ctx, dest, elts+start, 1 );
- }
- CLOSE_ELTS();
- }
-}
-
-
-static void TAG(render_triangles_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- GLuint *elts = GET_MESA_ELTS();
- int dmasz = GET_MAX_HW_ELTS()/3*3;
- GLuint j, nr;
- ELT_TYPE *dest;
-
- if (start+2 >= count)
- return;
-
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
-
- /* Emit whole number of tris in total. dmasz is already a multiple
- * of 3.
- */
- count -= (count-start)%3;
-
- for (j = start; j < count; j += nr) {
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- CLOSE_ELTS();
- }
-}
-
-
-
-static void TAG(render_tri_strip_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- GLuint j, nr;
- GLuint *elts = GET_MESA_ELTS();
- int dmasz = GET_MAX_HW_ELTS();
- ELT_TYPE *dest;
-
- if (start+2 >= count)
- return;
-
- ELT_INIT( GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0 );
-
- /* Keep the same winding over multiple buffers:
- */
- dmasz -= (dmasz & 1);
-
- for (j = start ; j + 2 < count; j += nr - 2 ) {
- nr = MIN2( dmasz, count - j );
-
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- CLOSE_ELTS();
- }
-}
-
-static void TAG(render_tri_fan_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- GLuint *elts = GET_MESA_ELTS();
- GLuint j, nr;
- int dmasz = GET_MAX_HW_ELTS();
- ELT_TYPE *dest;
-
- if (start+2 >= count)
- return;
-
- ELT_INIT( GL_TRIANGLE_FAN, HW_TRIANGLE_FAN );
-
- for (j = start + 1 ; j + 1 < count; j += nr - 1 ) {
- nr = MIN2( dmasz, count - j + 1 );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+start, 1 );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr - 1 );
- CLOSE_ELTS();
- }
-}
-
-
-static void TAG(render_poly_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- GLuint *elts = GET_MESA_ELTS();
- GLuint j, nr;
- int dmasz = GET_MAX_HW_ELTS();
- ELT_TYPE *dest;
-
- if (start+2 >= count)
- return;
-
- ELT_INIT( GL_POLYGON, HW_POLYGON );
-
- for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) {
- nr = MIN2( dmasz, count - j + 1 );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+start, 1 );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr - 1 );
- CLOSE_ELTS();
- }
-}
-
-static void TAG(render_quad_strip_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (start+3 >= count)
- return;
-
- if (HAVE_QUAD_STRIPS && 0) {
- }
- else {
- LOCAL_VARS;
- GLuint *elts = GET_MESA_ELTS();
- int dmasz = GET_MAX_HW_ELTS();
- GLuint j, nr;
- ELT_TYPE *dest;
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 1;
- count -= (count-start) & 1;
-
- if (ctx->_TriangleCaps & DD_FLATSHADE) {
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
- dmasz = dmasz/6*2;
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( dmasz, count - j );
-
- if (nr >= 4)
- {
- GLint quads = (nr/2)-1;
- ELT_TYPE *dest = ALLOC_ELTS( quads*6 );
- GLint i;
-
- for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
- EMIT_TWO_ELTS( dest, 0, elts[0], elts[1] );
- EMIT_TWO_ELTS( dest, 2, elts[2], elts[1] );
- EMIT_TWO_ELTS( dest, 4, elts[3], elts[2] );
- dest += 6;
- }
-
- CLOSE_ELTS();
- }
- }
- }
- else {
- ELT_INIT( GL_TRIANGLE_STRIP, HW_TRIANGLE_STRIP_0 );
-
- for (j = start; j + 3 < count; j += nr - 2 ) {
- nr = MIN2( dmasz, count - j );
- dest = ALLOC_ELTS( nr );
- dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
- CLOSE_ELTS();
- }
- }
- }
-}
-
-
-static void TAG(render_quads_elts)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- if (start+3 >= count)
- return;
-
- if (HAVE_QUADS && 0) {
- } else {
- LOCAL_VARS;
- GLuint *elts = GET_MESA_ELTS();
- int dmasz = GET_MAX_HW_ELTS();
- GLuint j, nr;
-
- ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
-
- /* Emit whole number of quads in total, and in each buffer.
- */
- dmasz -= dmasz & 3;
- count -= (count-start) & 3;
-
- /* Adjust for rendering as triangles:
- */
- dmasz = dmasz/6*4;
-
- for (j = start; j + 3 < count; j += nr ) {
- nr = MIN2( dmasz, count - j );
-
- {
- GLint quads = nr/4;
- ELT_TYPE *dest = ALLOC_ELTS( quads * 6 );
- GLint i;
-
- for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
- EMIT_TWO_ELTS( dest, 0, elts[0], elts[1] );
- EMIT_TWO_ELTS( dest, 2, elts[3], elts[1] );
- EMIT_TWO_ELTS( dest, 4, elts[2], elts[3] );
- dest += 6;
- }
-
- CLOSE_ELTS();
- }
- }
- }
-}
-
-
-
-static tnl_render_func TAG(render_tab_elts)[GL_POLYGON+2] =
-{
- TAG(render_points_elts),
- TAG(render_lines_elts),
- TAG(render_line_loop_elts),
- TAG(render_line_strip_elts),
- TAG(render_triangles_elts),
- TAG(render_tri_strip_elts),
- TAG(render_tri_fan_elts),
- TAG(render_quads_elts),
- TAG(render_quad_strip_elts),
- TAG(render_poly_elts),
- TAG(render_noop),
-};
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_rendertmp.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_rendertmp.h
deleted file mode 100644
index b9f030195..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_rendertmp.h
+++ /dev/null
@@ -1,434 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-#ifndef POSTFIX
-#define POSTFIX
-#endif
-
-#ifndef INIT
-#define INIT(x)
-#endif
-
-#ifndef NEED_EDGEFLAG_SETUP
-#define NEED_EDGEFLAG_SETUP 0
-#define EDGEFLAG_GET(a) 0
-#define EDGEFLAG_SET(a,b) (void)b
-#endif
-
-#ifndef RESET_STIPPLE
-#define RESET_STIPPLE
-#endif
-
-#ifndef RESET_OCCLUSION
-#define RESET_OCCLUSION
-#endif
-
-#ifndef TEST_PRIM_END
-#define TEST_PRIM_END(flags) (flags & PRIM_END)
-#define TEST_PRIM_BEGIN(flags) (flags & PRIM_BEGIN)
-#define TEST_PRIM_PARITY(flags) (flags & PRIM_PARITY)
-#endif
-
-#ifndef ELT
-#define ELT(x) x
-#endif
-
-#ifndef RENDER_TAB_QUALIFIER
-#define RENDER_TAB_QUALIFIER static
-#endif
-
-static void TAG(render_points)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- LOCAL_VARS;
- (void) flags;
-
- RESET_OCCLUSION;
- INIT(GL_POINTS);
- RENDER_POINTS( start, count );
- POSTFIX;
-}
-
-static void TAG(render_lines)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- LOCAL_VARS;
- (void) flags;
-
- RESET_OCCLUSION;
- INIT(GL_LINES);
- for (j=start+1; j<count; j+=2 ) {
- RENDER_LINE( ELT(j-1), ELT(j) );
- RESET_STIPPLE;
- }
- POSTFIX;
-}
-
-
-static void TAG(render_line_strip)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- LOCAL_VARS;
- (void) flags;
-
- RESET_OCCLUSION;
- INIT(GL_LINE_STRIP);
-
- for (j=start+1; j<count; j++ )
- RENDER_LINE( ELT(j-1), ELT(j) );
-
- if (TEST_PRIM_END(flags))
- RESET_STIPPLE;
-
- POSTFIX;
-}
-
-
-static void TAG(render_line_loop)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint i;
- LOCAL_VARS;
-
- (void) flags;
-
- RESET_OCCLUSION;
- INIT(GL_LINE_LOOP);
-
- if (start+1 < count) {
- if (TEST_PRIM_BEGIN(flags)) {
- RENDER_LINE( ELT(start), ELT(start+1) );
- }
-
- for ( i = start+2 ; i < count ; i++) {
- RENDER_LINE( ELT(i-1), ELT(i) );
- }
-
- if ( TEST_PRIM_END(flags)) {
- RENDER_LINE( ELT(count-1), ELT(start) );
- RESET_STIPPLE;
- }
- }
-
- POSTFIX;
-}
-
-
-static void TAG(render_triangles)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- LOCAL_VARS;
- (void) flags;
-
- INIT(GL_TRIANGLES);
- if (NEED_EDGEFLAG_SETUP) {
- for (j=start+2; j<count; j+=3) {
- /* Leave the edgeflags as supplied by the user.
- */
- RENDER_TRI( ELT(j-2), ELT(j-1), ELT(j) );
- RESET_STIPPLE;
- }
- } else {
- for (j=start+2; j<count; j+=3) {
- RENDER_TRI( ELT(j-2), ELT(j-1), ELT(j) );
- }
- }
- POSTFIX;
-}
-
-
-
-static void TAG(render_tri_strip)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- GLuint parity = 0;
- LOCAL_VARS;
-
- INIT(GL_TRIANGLE_STRIP);
- if (NEED_EDGEFLAG_SETUP) {
- for (j=start+2;j<count;j++,parity^=1) {
- GLuint ej2 = ELT(j-2+parity);
- GLuint ej1 = ELT(j-1-parity);
- GLuint ej = ELT(j);
- GLboolean ef2 = EDGEFLAG_GET( ej2 );
- GLboolean ef1 = EDGEFLAG_GET( ej1 );
- GLboolean ef = EDGEFLAG_GET( ej );
- EDGEFLAG_SET( ej2, GL_TRUE );
- EDGEFLAG_SET( ej1, GL_TRUE );
- EDGEFLAG_SET( ej, GL_TRUE );
- RENDER_TRI( ej2, ej1, ej );
- EDGEFLAG_SET( ej2, ef2 );
- EDGEFLAG_SET( ej1, ef1 );
- EDGEFLAG_SET( ej, ef );
- RESET_STIPPLE;
- }
- } else {
- for (j=start+2; j<count ; j++, parity^=1) {
- RENDER_TRI( ELT(j-2+parity), ELT(j-1-parity), ELT(j) );
- }
- }
- POSTFIX;
-}
-
-
-static void TAG(render_tri_fan)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- LOCAL_VARS;
- (void) flags;
-
- INIT(GL_TRIANGLE_FAN);
- if (NEED_EDGEFLAG_SETUP) {
- for (j=start+2;j<count;j++) {
- /* For trifans, all edges are boundary.
- */
- GLuint ejs = ELT(start);
- GLuint ej1 = ELT(j-1);
- GLuint ej = ELT(j);
- GLboolean efs = EDGEFLAG_GET( ejs );
- GLboolean ef1 = EDGEFLAG_GET( ej1 );
- GLboolean ef = EDGEFLAG_GET( ej );
- EDGEFLAG_SET( ejs, GL_TRUE );
- EDGEFLAG_SET( ej1, GL_TRUE );
- EDGEFLAG_SET( ej, GL_TRUE );
- RENDER_TRI( ejs, ej1, ej);
- EDGEFLAG_SET( ejs, efs );
- EDGEFLAG_SET( ej1, ef1 );
- EDGEFLAG_SET( ej, ef );
- RESET_STIPPLE;
- }
- } else {
- for (j=start+2;j<count;j++) {
- RENDER_TRI( ELT(start), ELT(j-1), ELT(j) );
- }
- }
-
- POSTFIX;
-}
-
-
-static void TAG(render_poly)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j = start+2;
- LOCAL_VARS;
- (void) flags;
-
- INIT(GL_POLYGON);
- if (NEED_EDGEFLAG_SETUP) {
- GLboolean efstart = EDGEFLAG_GET( ELT(start) );
- GLboolean efcount = EDGEFLAG_GET( ELT(count-1) );
-
- /* If the primitive does not begin here, the first edge
- * is non-boundary.
- */
- if (!TEST_PRIM_BEGIN(flags))
- EDGEFLAG_SET( ELT(start), GL_FALSE );
-
- /* If the primitive does not end here, the final edge is
- * non-boundary.
- */
- if (!TEST_PRIM_END(flags))
- EDGEFLAG_SET( ELT(count-1), GL_FALSE );
-
- /* Draw the first triangles (possibly zero)
- */
- if (j<count-1) {
- GLboolean ef = EDGEFLAG_GET( ELT(j) );
- EDGEFLAG_SET( ELT(j), GL_FALSE );
- RENDER_TRI( ELT(j-1), ELT(j), ELT(start) );
- EDGEFLAG_SET( ELT(j), ef );
- j++;
-
- /* Don't render the first edge again:
- */
- EDGEFLAG_SET( ELT(start), GL_FALSE );
-
- for (;j<count-1;j++) {
- GLboolean efj = EDGEFLAG_GET( ELT(j) );
- EDGEFLAG_SET( ELT(j), GL_FALSE );
- RENDER_TRI( ELT(j-1), ELT(j), ELT(start) );
- EDGEFLAG_SET( ELT(j), efj );
- }
- }
-
- /* Draw the last or only triangle
- */
- if (j < count)
- RENDER_TRI( ELT(j-1), ELT(j), ELT(start) );
-
- /* Restore the first and last edgeflags:
- */
- EDGEFLAG_SET( ELT(count-1), efcount );
- EDGEFLAG_SET( ELT(start), efstart );
-
- if (TEST_PRIM_END(flags)) {
- RESET_STIPPLE;
- }
- }
- else {
- for (j=start+2;j<count;j++) {
- RENDER_TRI( ELT(j-1), ELT(j), ELT(start) );
- }
- }
- POSTFIX;
-}
-
-static void TAG(render_quads)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- LOCAL_VARS;
- (void) flags;
-
- INIT(GL_QUADS);
- if (NEED_EDGEFLAG_SETUP) {
- for (j=start+3; j<count; j+=4) {
- /* Use user-specified edgeflags for quads.
- */
- RENDER_QUAD( ELT(j-3), ELT(j-2), ELT(j-1), ELT(j) );
- RESET_STIPPLE;
- }
- } else {
- for (j=start+3; j<count; j+=4) {
- RENDER_QUAD( ELT(j-3), ELT(j-2), ELT(j-1), ELT(j) );
- }
- }
- POSTFIX;
-}
-
-static void TAG(render_quad_strip)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- GLuint j;
- LOCAL_VARS;
- (void) flags;
-
- INIT(GL_QUAD_STRIP);
- if (NEED_EDGEFLAG_SETUP) {
- for (j=start+3;j<count;j+=2) {
- /* All edges are boundary. Set edgeflags to 1, draw the
- * quad, and restore them to the original values.
- */
- GLboolean ef3 = EDGEFLAG_GET( ELT(j-3) );
- GLboolean ef2 = EDGEFLAG_GET( ELT(j-2) );
- GLboolean ef1 = EDGEFLAG_GET( ELT(j-1) );
- GLboolean ef = EDGEFLAG_GET( ELT(j) );
- EDGEFLAG_SET( ELT(j-3), GL_TRUE );
- EDGEFLAG_SET( ELT(j-2), GL_TRUE );
- EDGEFLAG_SET( ELT(j-1), GL_TRUE );
- EDGEFLAG_SET( ELT(j), GL_TRUE );
- RENDER_QUAD( ELT(j-1), ELT(j-3), ELT(j-2), ELT(j) );
- EDGEFLAG_SET( ELT(j-3), ef3 );
- EDGEFLAG_SET( ELT(j-2), ef2 );
- EDGEFLAG_SET( ELT(j-1), ef1 );
- EDGEFLAG_SET( ELT(j), ef );
- RESET_STIPPLE;
- }
- } else {
- for (j=start+3;j<count;j+=2) {
- RENDER_QUAD( ELT(j-1), ELT(j-3), ELT(j-2), ELT(j) );
- }
- }
- POSTFIX;
-}
-
-static void TAG(render_noop)( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- (void)(ctx && start && count && flags);
-}
-
-RENDER_TAB_QUALIFIER void (*TAG(render_tab)[GL_POLYGON+2])(GLcontext *,
- GLuint,
- GLuint,
- GLuint) =
-{
- TAG(render_points),
- TAG(render_lines),
- TAG(render_line_loop),
- TAG(render_line_strip),
- TAG(render_triangles),
- TAG(render_tri_strip),
- TAG(render_tri_fan),
- TAG(render_quads),
- TAG(render_quad_strip),
- TAG(render_poly),
- TAG(render_noop),
-};
-
-
-
-#ifndef PRESERVE_VB_DEFS
-#undef RENDER_TRI
-#undef RENDER_QUAD
-#undef RENDER_LINE
-#undef RENDER_POINTS
-#undef LOCAL_VARS
-#undef INIT
-#undef POSTFIX
-#undef RESET_STIPPLE
-#undef DBG
-#undef ELT
-#undef RENDER_TAB_QUALIFIER
-#endif
-
-#ifndef PRESERVE_TAG
-#undef TAG
-#endif
-
-#undef PRESERVE_VB_DEFS
-#undef PRESERVE_TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_triemit.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_triemit.h
deleted file mode 100644
index f5979ee9a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_triemit.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef DO_DEBUG_VERTS
-#define DO_DEBUG_VERTS 0
-#endif
-
-#ifndef PRINT_VERTEX
-#define PRINT_VERTEX(x)
-#endif
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (j), "=D" (vb), "=S" (__tmp) \
- : "0" (vertsize), \
- "D" ((long)vb), \
- "S" ((long)v) ); \
-} while (0)
-#elif defined(HAVE_LE32_VERTS)
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- for ( j = 0 ; j < vertsize ; j++ ) \
- vb[j] = CPU_TO_LE32(((GLuint *)v)[j]); \
- vb += vertsize; \
-} while (0)
-#else
-#define COPY_DWORDS( j, vb, vertsize, v ) \
-do { \
- for ( j = 0 ; j < vertsize ; j++ ) \
- vb[j] = ((GLuint *)v)[j]; \
- vb += vertsize; \
-} while (0)
-#endif
-
-
-
-#if HAVE_QUADS
-static __inline void TAG(quad)( CTX_ARG,
- VERTEX *v0,
- VERTEX *v1,
- VERTEX *v2,
- VERTEX *v3 )
-{
- GLuint vertsize = GET_VERTEX_DWORDS();
- GLuint *vb = (GLuint *)ALLOC_VERTS( 4, vertsize);
- GLuint j;
-
- if (DO_DEBUG_VERTS) {
- fprintf(stderr, "%s\n", __FUNCTION__);
- PRINT_VERTEX(v0);
- PRINT_VERTEX(v1);
- PRINT_VERTEX(v2);
- PRINT_VERTEX(v3);
- }
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
- COPY_DWORDS( j, vb, vertsize, v3 );
-}
-#else
-static __inline void TAG(quad)( CTX_ARG,
- VERTEX *v0,
- VERTEX *v1,
- VERTEX *v2,
- VERTEX *v3 )
-{
- GLuint vertsize = GET_VERTEX_DWORDS();
- GLuint *vb = (GLuint *)ALLOC_VERTS( 6, vertsize);
- GLuint j;
-
- if (DO_DEBUG_VERTS) {
- fprintf(stderr, "%s\n", __FUNCTION__);
- PRINT_VERTEX(v0);
- PRINT_VERTEX(v1);
- PRINT_VERTEX(v2);
- PRINT_VERTEX(v3);
- }
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v3 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
- COPY_DWORDS( j, vb, vertsize, v3 );
-}
-#endif
-
-
-static __inline void TAG(triangle)( CTX_ARG,
- VERTEX *v0,
- VERTEX *v1,
- VERTEX *v2 )
-{
- GLuint vertsize = GET_VERTEX_DWORDS();
- GLuint *vb = (GLuint *)ALLOC_VERTS( 3, vertsize);
- GLuint j;
-
- if (DO_DEBUG_VERTS) {
- fprintf(stderr, "%s\n", __FUNCTION__);
- PRINT_VERTEX(v0);
- PRINT_VERTEX(v1);
- PRINT_VERTEX(v2);
- }
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
- COPY_DWORDS( j, vb, vertsize, v2 );
-}
-
-
-#if HAVE_LINES
-static __inline void TAG(line)( CTX_ARG,
- VERTEX *v0,
- VERTEX *v1 )
-{
- GLuint vertsize = GET_VERTEX_DWORDS();
- GLuint *vb = (GLuint *)ALLOC_VERTS( 2, vertsize);
- GLuint j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
- COPY_DWORDS( j, vb, vertsize, v1 );
-}
-#endif
-
-#if HAVE_POINTS
-static __inline void TAG(point)( CTX_ARG,
- VERTEX *v0 )
-{
- GLuint vertsize = GET_VERTEX_DWORDS();
- GLuint *vb = (GLuint *)ALLOC_VERTS( 1, vertsize);
- int j;
-
- COPY_DWORDS( j, vb, vertsize, v0 );
-}
-#endif
-
-
-static void TAG(fast_clipped_poly)( GLcontext *ctx, const GLuint *elts,
- GLuint n )
-{
- LOCAL_VARS
- GLuint vertsize = GET_VERTEX_DWORDS();
- GLuint *vb = (GLuint *)ALLOC_VERTS( (n-2) * 3, vertsize );
- const GLuint *start = (const GLuint *)VERT(elts[0]);
- GLuint i,j;
-
- if (DO_DEBUG_VERTS) {
- fprintf(stderr, "%s\n", __FUNCTION__);
- PRINT_VERTEX(VERT(elts[0]));
- PRINT_VERTEX(VERT(elts[1]));
- }
-
- for (i = 2 ; i < n ; i++) {
- if (DO_DEBUG_VERTS) {
- PRINT_VERTEX(VERT(elts[i]));
- }
-
- COPY_DWORDS( j, vb, vertsize, VERT(elts[i-1]) );
- COPY_DWORDS( j, vb, vertsize, VERT(elts[i]) );
- COPY_DWORDS( j, vb, vertsize, start );
- }
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_tritmp.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_tritmp.h
deleted file mode 100644
index 0bf32ff34..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_tritmp.h
+++ /dev/null
@@ -1,833 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-/* Template for building functions to plug into the driver interface
- * of t_vb_render.c:
- * ctx->Driver.QuadFunc
- * ctx->Driver.TriangleFunc
- * ctx->Driver.LineFunc
- * ctx->Driver.PointsFunc
- *
- * DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles,
- * and restore vertices afterwards.
- * DO_OFFSET: Calculate offset for triangles and adjust vertices. Restore
- * vertices after rendering.
- * DO_FLAT: For hardware without native flatshading, copy provoking colors
- * into the other vertices. Restore after rendering.
- * DO_UNFILLED: Decompose triangles to lines and points where appropriate.
- * DO_TWOSTENCIL:Gross hack for two-sided stencil.
- *
- * HAVE_RGBA: Vertices have rgba values (otherwise index values).
- * HAVE_SPEC: Vertices have secondary rgba values.
- *
- * VERT_X(v): Alias for vertex x value.
- * VERT_Y(v): Alias for vertex y value.
- * VERT_Z(v): Alias for vertex z value.
- * DEPTH_SCALE: Scale for constant offset.
- * REVERSE_DEPTH: Viewport depth range reversed.
- *
- * VERTEX: Hardware vertex type.
- * GET_VERTEX(n): Retreive vertex with index n.
- * AREA_IS_CCW(a): Return true if triangle with signed area a is ccw.
- *
- * VERT_SET_RGBA: Assign vertex rgba from VB color.
- * VERT_COPY_RGBA: Copy vertex rgba another vertex.
- * VERT_SAVE_RGBA: Save vertex rgba to a local variable.
- * VERT_RESTORE_RGBA: Restore vertex rgba from a local variable.
- * --> Similar for IND and SPEC.
- *
- * LOCAL_VARS(n): (At least) define local vars for save/restore rgba.
- *
- */
-
-#if HAVE_RGBA
-#define VERT_SET_IND( v, c ) (void) c
-#define VERT_COPY_IND( v0, v1 )
-#define VERT_SAVE_IND( idx )
-#define VERT_RESTORE_IND( idx )
-#if HAVE_BACK_COLORS
-#define VERT_SET_RGBA( v, c )
-#endif
-#else
-#define VERT_SET_RGBA( v, c ) (void) c
-#define VERT_COPY_RGBA( v0, v1 )
-#define VERT_SAVE_RGBA( idx )
-#define VERT_RESTORE_RGBA( idx )
-#if HAVE_BACK_COLORS
-#define VERT_SET_IND( v, c )
-#endif
-#endif
-
-#if !HAVE_SPEC
-#define VERT_SET_SPEC( v, c ) (void) c
-#define VERT_COPY_SPEC( v0, v1 )
-#define VERT_SAVE_SPEC( idx )
-#define VERT_RESTORE_SPEC( idx )
-#if HAVE_BACK_COLORS
-#define VERT_COPY_SPEC1( v )
-#endif
-#else
-#if HAVE_BACK_COLORS
-#define VERT_SET_SPEC( v, c )
-#endif
-#endif
-
-#if !HAVE_BACK_COLORS
-#define VERT_COPY_SPEC1( v )
-#define VERT_COPY_IND1( v )
-#define VERT_COPY_RGBA1( v )
-#endif
-
-#ifndef INSANE_VERTICES
-#define VERT_SET_Z(v,val) VERT_Z(v) = val
-#define VERT_Z_ADD(v,val) VERT_Z(v) += val
-#endif
-
-#ifndef REVERSE_DEPTH
-#define REVERSE_DEPTH 0
-#endif
-
-/* disable twostencil for un-aware drivers */
-#ifndef HAVE_STENCIL_TWOSIDE
-#define HAVE_STENCIL_TWOSIDE 0
-#endif
-#ifndef DO_TWOSTENCIL
-#define DO_TWOSTENCIL 0
-#endif
-#ifndef SETUP_STENCIL
-#define SETUP_STENCIL(f)
-#endif
-#ifndef UNSET_STENCIL
-#define UNSET_STENCIL(f)
-#endif
-
-#if DO_TRI
-static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
- VERTEX *v[3];
- GLfloat offset = 0;
- GLfloat z[3];
- GLenum mode = GL_FILL;
- GLuint facing = 0;
- LOCAL_VARS(3);
-
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
- v[0] = (VERTEX *)GET_VERTEX(e0);
- v[1] = (VERTEX *)GET_VERTEX(e1);
- v[2] = (VERTEX *)GET_VERTEX(e2);
-
- if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL)
- {
- GLfloat ex = VERT_X(v[0]) - VERT_X(v[2]);
- GLfloat ey = VERT_Y(v[0]) - VERT_Y(v[2]);
- GLfloat fx = VERT_X(v[1]) - VERT_X(v[2]);
- GLfloat fy = VERT_Y(v[1]) - VERT_Y(v[2]);
- GLfloat cc = ex*fy - ey*fx;
-
- if (DO_TWOSIDE || DO_UNFILLED || DO_TWOSTENCIL)
- {
- facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit;
-
- if (DO_TWOSTENCIL && ctx->Stencil.TestTwoSide) {
- ctx->_Facing = facing; /* mixed mode rendering: for 2-sided stencil test */
- }
-
- if (DO_UNFILLED) {
- if (facing) {
- mode = ctx->Polygon.BackMode;
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode != GL_FRONT) {
- return;
- }
- } else {
- mode = ctx->Polygon.FrontMode;
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode != GL_BACK) {
- return;
- }
- }
- }
-
- if (DO_TWOSIDE && facing == 1)
- {
- if (HAVE_RGBA) {
- if (HAVE_BACK_COLORS) {
- if (!DO_FLAT) {
- VERT_SAVE_RGBA( 0 );
- VERT_SAVE_RGBA( 1 );
- VERT_COPY_RGBA1( v[0] );
- VERT_COPY_RGBA1( v[1] );
- }
- VERT_SAVE_RGBA( 2 );
- VERT_COPY_RGBA1( v[2] );
- if (HAVE_SPEC) {
- if (!DO_FLAT) {
- VERT_SAVE_SPEC( 0 );
- VERT_SAVE_SPEC( 1 );
- VERT_COPY_SPEC1( v[0] );
- VERT_COPY_SPEC1( v[1] );
- }
- VERT_SAVE_SPEC( 2 );
- VERT_COPY_SPEC1( v[2] );
- }
- }
- else {
- GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data;
- (void) vbcolor;
-
- if (!DO_FLAT) {
- VERT_SAVE_RGBA( 0 );
- VERT_SAVE_RGBA( 1 );
- }
- VERT_SAVE_RGBA( 2 );
-
- if (VB->ColorPtr[1]->stride) {
- ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat));
-
- if (!DO_FLAT) {
- VERT_SET_RGBA( v[0], vbcolor[e0] );
- VERT_SET_RGBA( v[1], vbcolor[e1] );
- }
- VERT_SET_RGBA( v[2], vbcolor[e2] );
- }
- else {
- if (!DO_FLAT) {
- VERT_SET_RGBA( v[0], vbcolor[0] );
- VERT_SET_RGBA( v[1], vbcolor[0] );
- }
- VERT_SET_RGBA( v[2], vbcolor[0] );
- }
-
- if (HAVE_SPEC && VB->SecondaryColorPtr[1]) {
- GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
- ASSERT(VB->SecondaryColorPtr[1]->stride == 4*sizeof(GLfloat));
-
- if (!DO_FLAT) {
- VERT_SAVE_SPEC( 0 );
- VERT_SAVE_SPEC( 1 );
- VERT_SET_SPEC( v[0], vbspec[e0] );
- VERT_SET_SPEC( v[1], vbspec[e1] );
- }
- VERT_SAVE_SPEC( 2 );
- VERT_SET_SPEC( v[2], vbspec[e2] );
- }
- }
- }
- else {
- GLfloat (*vbindex) = (GLfloat *)VB->IndexPtr[1]->data;
- if (!DO_FLAT) {
- VERT_SAVE_IND( 0 );
- VERT_SAVE_IND( 1 );
- VERT_SET_IND( v[0], vbindex[e0] );
- VERT_SET_IND( v[1], vbindex[e1] );
- }
- VERT_SAVE_IND( 2 );
- VERT_SET_IND( v[2], vbindex[e2] );
- }
- }
- }
-
-
- if (DO_OFFSET)
- {
- offset = ctx->Polygon.OffsetUnits * DEPTH_SCALE;
- z[0] = VERT_Z(v[0]);
- z[1] = VERT_Z(v[1]);
- z[2] = VERT_Z(v[2]);
- if (cc * cc > 1e-16) {
- GLfloat ic = 1.0 / cc;
- GLfloat ez = z[0] - z[2];
- GLfloat fz = z[1] - z[2];
- GLfloat a = ey*fz - ez*fy;
- GLfloat b = ez*fx - ex*fz;
- GLfloat ac = a * ic;
- GLfloat bc = b * ic;
- if ( ac < 0.0f ) ac = -ac;
- if ( bc < 0.0f ) bc = -bc;
- offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor;
- }
- offset *= ctx->DrawBuffer->_MRD * (REVERSE_DEPTH ? -1.0 : 1.0);
- }
- }
-
- if (DO_FLAT) {
- if (HAVE_RGBA) {
- VERT_SAVE_RGBA( 0 );
- VERT_SAVE_RGBA( 1 );
- VERT_COPY_RGBA( v[0], v[2] );
- VERT_COPY_RGBA( v[1], v[2] );
- if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
- VERT_SAVE_SPEC( 0 );
- VERT_SAVE_SPEC( 1 );
- VERT_COPY_SPEC( v[0], v[2] );
- VERT_COPY_SPEC( v[1], v[2] );
- }
- }
- else {
- VERT_SAVE_IND( 0 );
- VERT_SAVE_IND( 1 );
- VERT_COPY_IND( v[0], v[2] );
- VERT_COPY_IND( v[1], v[2] );
- }
- }
-
- if (mode == GL_POINT) {
- if (DO_OFFSET && ctx->Polygon.OffsetPoint) {
- VERT_Z_ADD(v[0], offset);
- VERT_Z_ADD(v[1], offset);
- VERT_Z_ADD(v[2], offset);
- }
- if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
- SETUP_STENCIL(facing);
- UNFILLED_TRI( ctx, GL_POINT, e0, e1, e2 );
- UNSET_STENCIL(facing);
- } else {
- UNFILLED_TRI( ctx, GL_POINT, e0, e1, e2 );
- }
- } else if (mode == GL_LINE) {
- if (DO_OFFSET && ctx->Polygon.OffsetLine) {
- VERT_Z_ADD(v[0], offset);
- VERT_Z_ADD(v[1], offset);
- VERT_Z_ADD(v[2], offset);
- }
- if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
- SETUP_STENCIL(facing);
- UNFILLED_TRI( ctx, GL_LINE, e0, e1, e2 );
- UNSET_STENCIL(facing);
- } else {
- UNFILLED_TRI( ctx, GL_LINE, e0, e1, e2 );
- }
- } else {
- if (DO_OFFSET && ctx->Polygon.OffsetFill) {
- VERT_Z_ADD(v[0], offset);
- VERT_Z_ADD(v[1], offset);
- VERT_Z_ADD(v[2], offset);
- }
- if (DO_UNFILLED)
- RASTERIZE( GL_TRIANGLES );
- if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
- SETUP_STENCIL(facing);
- TRI( v[0], v[1], v[2] );
- UNSET_STENCIL(facing);
- } else {
- TRI( v[0], v[1], v[2] );
- }
- }
-
- if (DO_OFFSET)
- {
- VERT_SET_Z(v[0], z[0]);
- VERT_SET_Z(v[1], z[1]);
- VERT_SET_Z(v[2], z[2]);
- }
-
- if (DO_TWOSIDE && facing == 1)
- {
- if (HAVE_RGBA) {
- if (!DO_FLAT) {
- VERT_RESTORE_RGBA( 0 );
- VERT_RESTORE_RGBA( 1 );
- }
- VERT_RESTORE_RGBA( 2 );
- if (HAVE_SPEC) {
- if (!DO_FLAT) {
- VERT_RESTORE_SPEC( 0 );
- VERT_RESTORE_SPEC( 1 );
- }
- VERT_RESTORE_SPEC( 2 );
- }
- }
- else {
- if (!DO_FLAT) {
- VERT_RESTORE_IND( 0 );
- VERT_RESTORE_IND( 1 );
- }
- VERT_RESTORE_IND( 2 );
- }
- }
-
-
- if (DO_FLAT) {
- if (HAVE_RGBA) {
- VERT_RESTORE_RGBA( 0 );
- VERT_RESTORE_RGBA( 1 );
- if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
- VERT_RESTORE_SPEC( 0 );
- VERT_RESTORE_SPEC( 1 );
- }
- }
- else {
- VERT_RESTORE_IND( 0 );
- VERT_RESTORE_IND( 1 );
- }
- }
-}
-#endif
-
-#if DO_QUAD
-#if DO_FULL_QUAD
-static void TAG(quad)( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2, GLuint e3 )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
- VERTEX *v[4];
- GLfloat offset = 0;
- GLfloat z[4];
- GLenum mode = GL_FILL;
- GLuint facing = 0;
- LOCAL_VARS(4);
-
- v[0] = (VERTEX *)GET_VERTEX(e0);
- v[1] = (VERTEX *)GET_VERTEX(e1);
- v[2] = (VERTEX *)GET_VERTEX(e2);
- v[3] = (VERTEX *)GET_VERTEX(e3);
-
- if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL)
- {
- GLfloat ex = VERT_X(v[2]) - VERT_X(v[0]);
- GLfloat ey = VERT_Y(v[2]) - VERT_Y(v[0]);
- GLfloat fx = VERT_X(v[3]) - VERT_X(v[1]);
- GLfloat fy = VERT_Y(v[3]) - VERT_Y(v[1]);
- GLfloat cc = ex*fy - ey*fx;
-
- if (DO_TWOSIDE || DO_UNFILLED || DO_TWOSTENCIL)
- {
- facing = AREA_IS_CCW( cc ) ^ ctx->Polygon._FrontBit;
-
- if (DO_TWOSTENCIL && ctx->Stencil.TestTwoSide) {
- ctx->_Facing = facing; /* mixed mode rendering: for 2-sided stencil test */
- }
-
- if (DO_UNFILLED) {
- if (facing) {
- mode = ctx->Polygon.BackMode;
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode != GL_FRONT) {
- return;
- }
- } else {
- mode = ctx->Polygon.FrontMode;
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode != GL_BACK) {
- return;
- }
- }
- }
-
- if (DO_TWOSIDE && facing == 1)
- {
- if (HAVE_RGBA) {
- GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data;
- (void)vbcolor;
-
- if (HAVE_BACK_COLORS) {
- if (!DO_FLAT) {
- VERT_SAVE_RGBA( 0 );
- VERT_SAVE_RGBA( 1 );
- VERT_SAVE_RGBA( 2 );
- VERT_COPY_RGBA1( v[0] );
- VERT_COPY_RGBA1( v[1] );
- VERT_COPY_RGBA1( v[2] );
- }
- VERT_SAVE_RGBA( 3 );
- VERT_COPY_RGBA1( v[3] );
- if (HAVE_SPEC) {
- if (!DO_FLAT) {
- VERT_SAVE_SPEC( 0 );
- VERT_SAVE_SPEC( 1 );
- VERT_SAVE_SPEC( 2 );
- VERT_COPY_SPEC1( v[0] );
- VERT_COPY_SPEC1( v[1] );
- VERT_COPY_SPEC1( v[2] );
- }
- VERT_SAVE_SPEC( 3 );
- VERT_COPY_SPEC1( v[3] );
- }
- }
- else {
- if (!DO_FLAT) {
- VERT_SAVE_RGBA( 0 );
- VERT_SAVE_RGBA( 1 );
- VERT_SAVE_RGBA( 2 );
- }
- VERT_SAVE_RGBA( 3 );
-
- if (VB->ColorPtr[1]->stride) {
- if (!DO_FLAT) {
- VERT_SET_RGBA( v[0], vbcolor[e0] );
- VERT_SET_RGBA( v[1], vbcolor[e1] );
- VERT_SET_RGBA( v[2], vbcolor[e2] );
- }
- VERT_SET_RGBA( v[3], vbcolor[e3] );
- }
- else {
- if (!DO_FLAT) {
- VERT_SET_RGBA( v[0], vbcolor[0] );
- VERT_SET_RGBA( v[1], vbcolor[0] );
- VERT_SET_RGBA( v[2], vbcolor[0] );
- }
- VERT_SET_RGBA( v[3], vbcolor[0] );
- }
-
- if (HAVE_SPEC && VB->SecondaryColorPtr[1]) {
- GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
- ASSERT(VB->SecondaryColorPtr[1]->stride==4*sizeof(GLfloat));
-
- if (!DO_FLAT) {
- VERT_SAVE_SPEC( 0 );
- VERT_SAVE_SPEC( 1 );
- VERT_SAVE_SPEC( 2 );
- VERT_SET_SPEC( v[0], vbspec[e0] );
- VERT_SET_SPEC( v[1], vbspec[e1] );
- VERT_SET_SPEC( v[2], vbspec[e2] );
- }
- VERT_SAVE_SPEC( 3 );
- VERT_SET_SPEC( v[3], vbspec[e3] );
- }
- }
- }
- else {
- GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data;
- if (!DO_FLAT) {
- VERT_SAVE_IND( 0 );
- VERT_SAVE_IND( 1 );
- VERT_SAVE_IND( 2 );
- VERT_SET_IND( v[0], vbindex[e0] );
- VERT_SET_IND( v[1], vbindex[e1] );
- VERT_SET_IND( v[2], vbindex[e2] );
- }
- VERT_SAVE_IND( 3 );
- VERT_SET_IND( v[3], vbindex[e3] );
- }
- }
- }
-
-
- if (DO_OFFSET)
- {
- offset = ctx->Polygon.OffsetUnits * DEPTH_SCALE;
- z[0] = VERT_Z(v[0]);
- z[1] = VERT_Z(v[1]);
- z[2] = VERT_Z(v[2]);
- z[3] = VERT_Z(v[3]);
- if (cc * cc > 1e-16) {
- GLfloat ez = z[2] - z[0];
- GLfloat fz = z[3] - z[1];
- GLfloat a = ey*fz - ez*fy;
- GLfloat b = ez*fx - ex*fz;
- GLfloat ic = 1.0 / cc;
- GLfloat ac = a * ic;
- GLfloat bc = b * ic;
- if ( ac < 0.0f ) ac = -ac;
- if ( bc < 0.0f ) bc = -bc;
- offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor;
- }
- offset *= ctx->DrawBuffer->_MRD * (REVERSE_DEPTH ? -1.0 : 1.0);
- }
- }
-
- if (DO_FLAT) {
- if (HAVE_RGBA) {
- VERT_SAVE_RGBA( 0 );
- VERT_SAVE_RGBA( 1 );
- VERT_SAVE_RGBA( 2 );
- VERT_COPY_RGBA( v[0], v[3] );
- VERT_COPY_RGBA( v[1], v[3] );
- VERT_COPY_RGBA( v[2], v[3] );
- if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
- VERT_SAVE_SPEC( 0 );
- VERT_SAVE_SPEC( 1 );
- VERT_SAVE_SPEC( 2 );
- VERT_COPY_SPEC( v[0], v[3] );
- VERT_COPY_SPEC( v[1], v[3] );
- VERT_COPY_SPEC( v[2], v[3] );
- }
- }
- else {
- VERT_SAVE_IND( 0 );
- VERT_SAVE_IND( 1 );
- VERT_SAVE_IND( 2 );
- VERT_COPY_IND( v[0], v[3] );
- VERT_COPY_IND( v[1], v[3] );
- VERT_COPY_IND( v[2], v[3] );
- }
- }
-
- if (mode == GL_POINT) {
- if (( DO_OFFSET) && ctx->Polygon.OffsetPoint) {
- VERT_Z_ADD(v[0], offset);
- VERT_Z_ADD(v[1], offset);
- VERT_Z_ADD(v[2], offset);
- VERT_Z_ADD(v[3], offset);
- }
- if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
- SETUP_STENCIL(facing);
- UNFILLED_QUAD( ctx, GL_POINT, e0, e1, e2, e3 );
- UNSET_STENCIL(facing);
- } else {
- UNFILLED_QUAD( ctx, GL_POINT, e0, e1, e2, e3 );
- }
- } else if (mode == GL_LINE) {
- if (DO_OFFSET && ctx->Polygon.OffsetLine) {
- VERT_Z_ADD(v[0], offset);
- VERT_Z_ADD(v[1], offset);
- VERT_Z_ADD(v[2], offset);
- VERT_Z_ADD(v[3], offset);
- }
- if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
- SETUP_STENCIL(facing);
- UNFILLED_QUAD( ctx, GL_LINE, e0, e1, e2, e3 );
- UNSET_STENCIL(facing);
- } else {
- UNFILLED_QUAD( ctx, GL_LINE, e0, e1, e2, e3 );
- }
- } else {
- if (DO_OFFSET && ctx->Polygon.OffsetFill) {
- VERT_Z_ADD(v[0], offset);
- VERT_Z_ADD(v[1], offset);
- VERT_Z_ADD(v[2], offset);
- VERT_Z_ADD(v[3], offset);
- }
- RASTERIZE( GL_QUADS );
- if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
- SETUP_STENCIL(facing);
- QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
- UNSET_STENCIL(facing);
- } else {
- QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
- }
- }
-
- if (DO_OFFSET)
- {
- VERT_SET_Z(v[0], z[0]);
- VERT_SET_Z(v[1], z[1]);
- VERT_SET_Z(v[2], z[2]);
- VERT_SET_Z(v[3], z[3]);
- }
-
- if (DO_TWOSIDE && facing == 1)
- {
- if (HAVE_RGBA) {
- if (!DO_FLAT) {
- VERT_RESTORE_RGBA( 0 );
- VERT_RESTORE_RGBA( 1 );
- VERT_RESTORE_RGBA( 2 );
- }
- VERT_RESTORE_RGBA( 3 );
- if (HAVE_SPEC) {
- if (!DO_FLAT) {
- VERT_RESTORE_SPEC( 0 );
- VERT_RESTORE_SPEC( 1 );
- VERT_RESTORE_SPEC( 2 );
- }
- VERT_RESTORE_SPEC( 3 );
- }
- }
- else {
- if (!DO_FLAT) {
- VERT_RESTORE_IND( 0 );
- VERT_RESTORE_IND( 1 );
- VERT_RESTORE_IND( 2 );
- }
- VERT_RESTORE_IND( 3 );
- }
- }
-
-
- if (DO_FLAT) {
- if (HAVE_RGBA) {
- VERT_RESTORE_RGBA( 0 );
- VERT_RESTORE_RGBA( 1 );
- VERT_RESTORE_RGBA( 2 );
- if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
- VERT_RESTORE_SPEC( 0 );
- VERT_RESTORE_SPEC( 1 );
- VERT_RESTORE_SPEC( 2 );
- }
- }
- else {
- VERT_RESTORE_IND( 0 );
- VERT_RESTORE_IND( 1 );
- VERT_RESTORE_IND( 2 );
- }
- }
-}
-#else
-static void TAG(quad)( GLcontext *ctx, GLuint e0,
- GLuint e1, GLuint e2, GLuint e3 )
-{
- if (DO_UNFILLED) {
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte ef1 = VB->EdgeFlag[e1];
- GLubyte ef3 = VB->EdgeFlag[e3];
- VB->EdgeFlag[e1] = 0;
- TAG(triangle)( ctx, e0, e1, e3 );
- VB->EdgeFlag[e1] = ef1;
- VB->EdgeFlag[e3] = 0;
- TAG(triangle)( ctx, e1, e2, e3 );
- VB->EdgeFlag[e3] = ef3;
- } else {
- TAG(triangle)( ctx, e0, e1, e3 );
- TAG(triangle)( ctx, e1, e2, e3 );
- }
-}
-#endif
-#endif
-
-#if DO_LINE
-static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- VERTEX *v[2];
- LOCAL_VARS(2);
-
- v[0] = (VERTEX *)GET_VERTEX(e0);
- v[1] = (VERTEX *)GET_VERTEX(e1);
-
- if (DO_FLAT) {
- if (HAVE_RGBA) {
- VERT_SAVE_RGBA( 0 );
- VERT_COPY_RGBA( v[0], v[1] );
- if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
- VERT_SAVE_SPEC( 0 );
- VERT_COPY_SPEC( v[0], v[1] );
- }
- }
- else {
- VERT_SAVE_IND( 0 );
- VERT_COPY_IND( v[0], v[1] );
- }
- }
-
- LINE( v[0], v[1] );
-
- if (DO_FLAT) {
- if (HAVE_RGBA) {
- VERT_RESTORE_RGBA( 0 );
-
- if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
- VERT_RESTORE_SPEC( 0 );
- }
- }
- else {
- VERT_RESTORE_IND( 0 );
- }
- }
-}
-#endif
-
-#if DO_POINTS
-static void TAG(points)( GLcontext *ctx, GLuint first, GLuint last )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
- GLuint i;
- LOCAL_VARS(1);
-
- if (VB->Elts == 0) {
- for ( i = first ; i < last ; i++ ) {
- if ( VB->ClipMask[i] == 0 ) {
- VERTEX *v = (VERTEX *)GET_VERTEX(i);
- POINT( v );
- }
- }
- } else {
- for ( i = first ; i < last ; i++ ) {
- GLuint e = VB->Elts[i];
- if ( VB->ClipMask[e] == 0 ) {
- VERTEX *v = (VERTEX *)GET_VERTEX(e);
- POINT( v );
- }
- }
- }
-}
-#endif
-
-static void TAG(init)( void )
-{
-#if DO_QUAD
- TAB[IND].quad = TAG(quad);
-#endif
-#if DO_TRI
- TAB[IND].triangle = TAG(triangle);
-#endif
-#if DO_LINE
- TAB[IND].line = TAG(line);
-#endif
-#if DO_POINTS
- TAB[IND].points = TAG(points);
-#endif
-}
-
-#undef IND
-#undef TAG
-
-#if HAVE_RGBA
-#undef VERT_SET_IND
-#undef VERT_COPY_IND
-#undef VERT_SAVE_IND
-#undef VERT_RESTORE_IND
-#if HAVE_BACK_COLORS
-#undef VERT_SET_RGBA
-#endif
-#else
-#undef VERT_SET_RGBA
-#undef VERT_COPY_RGBA
-#undef VERT_SAVE_RGBA
-#undef VERT_RESTORE_RGBA
-#if HAVE_BACK_COLORS
-#undef VERT_SET_IND
-#endif
-#endif
-
-#if !HAVE_SPEC
-#undef VERT_SET_SPEC
-#undef VERT_COPY_SPEC
-#undef VERT_SAVE_SPEC
-#undef VERT_RESTORE_SPEC
-#if HAVE_BACK_COLORS
-#undef VERT_COPY_SPEC1
-#endif
-#else
-#if HAVE_BACK_COLORS
-#undef VERT_SET_SPEC
-#endif
-#endif
-
-#if !HAVE_BACK_COLORS
-#undef VERT_COPY_SPEC1
-#undef VERT_COPY_IND1
-#undef VERT_COPY_RGBA1
-#endif
-
-#ifndef INSANE_VERTICES
-#undef VERT_SET_Z
-#undef VERT_Z_ADD
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_unfilled.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_unfilled.h
deleted file mode 100644
index 46415ea5f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_unfilled.h
+++ /dev/null
@@ -1,212 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#if HAVE_RGBA
-#define VERT_SET_IND( v, c )
-#define VERT_COPY_IND( v0, v1 )
-#define VERT_SAVE_IND( idx )
-#define VERT_RESTORE_IND( idx )
-#endif
-
-#if !HAVE_SPEC
-#define VERT_SET_SPEC( v, c )
-#define VERT_COPY_SPEC( v0, v1 )
-#define VERT_SAVE_SPEC( idx )
-#define VERT_RESTORE_SPEC( idx )
-#endif
-
-static void TAG(unfilled_tri)( GLcontext *ctx,
- GLenum mode,
- GLuint e0, GLuint e1, GLuint e2 )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte *ef = VB->EdgeFlag;
- VERTEX *v[3];
- LOCAL_VARS(3);
-
- v[0] = (VERTEX *)GET_VERTEX(e0);
- v[1] = (VERTEX *)GET_VERTEX(e1);
- v[2] = (VERTEX *)GET_VERTEX(e2);
-
- if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
- if (HAVE_RGBA) {
- VERT_SAVE_RGBA(0);
- VERT_SAVE_RGBA(1);
- VERT_COPY_RGBA(v[0], v[2]);
- VERT_COPY_RGBA(v[1], v[2]);
-
- if (HAVE_SPEC) {
- VERT_SAVE_SPEC(0);
- VERT_SAVE_SPEC(1);
- VERT_COPY_SPEC(v[0], v[2]);
- VERT_COPY_SPEC(v[1], v[2]);
- }
- } else {
- VERT_SAVE_IND(0);
- VERT_SAVE_IND(1);
- VERT_COPY_IND(v[0], v[2]);
- VERT_COPY_IND(v[1], v[2]);
- }
- }
-
-/* fprintf(stderr, "%s %s %d %d %d\n", __FUNCTION__, */
-/* _mesa_lookup_enum_by_nr( mode ), */
-/* ef[e0], ef[e1], ef[e2]); */
-
- if (mode == GL_POINT) {
- RASTERIZE(GL_POINTS);
- if (ef[e0]) POINT( v[0] );
- if (ef[e1]) POINT( v[1] );
- if (ef[e2]) POINT( v[2] );
- }
- else {
- RASTERIZE(GL_LINES);
- if (RENDER_PRIMITIVE == GL_POLYGON) {
- if (ef[e2]) LINE( v[2], v[0] );
- if (ef[e0]) LINE( v[0], v[1] );
- if (ef[e1]) LINE( v[1], v[2] );
- }
- else {
- if (ef[e0]) LINE( v[0], v[1] );
- if (ef[e1]) LINE( v[1], v[2] );
- if (ef[e2]) LINE( v[2], v[0] );
- }
- }
-
- if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
- if (HAVE_RGBA) {
- VERT_RESTORE_RGBA(0);
- VERT_RESTORE_RGBA(1);
-
- if (HAVE_SPEC) {
- VERT_RESTORE_SPEC(0);
- VERT_RESTORE_SPEC(1);
- }
- } else {
- VERT_RESTORE_IND(0);
- VERT_RESTORE_IND(1);
- }
- }
-}
-
-
-static void TAG(unfilled_quad)( GLcontext *ctx,
- GLenum mode,
- GLuint e0, GLuint e1,
- GLuint e2, GLuint e3 )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte *ef = VB->EdgeFlag;
- VERTEX *v[4];
- LOCAL_VARS(4);
-
- v[0] = (VERTEX *)GET_VERTEX(e0);
- v[1] = (VERTEX *)GET_VERTEX(e1);
- v[2] = (VERTEX *)GET_VERTEX(e2);
- v[3] = (VERTEX *)GET_VERTEX(e3);
-
- /* Hardware flatshading breaks down here. If the hardware doesn't
- * support flatshading, this will already have been done:
- */
- if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
- if (HAVE_RGBA) {
- VERT_SAVE_RGBA(0);
- VERT_SAVE_RGBA(1);
- VERT_SAVE_RGBA(2);
- VERT_COPY_RGBA(v[0], v[3]);
- VERT_COPY_RGBA(v[1], v[3]);
- VERT_COPY_RGBA(v[2], v[3]);
-
- if (HAVE_SPEC) {
- VERT_SAVE_SPEC(0);
- VERT_SAVE_SPEC(1);
- VERT_SAVE_SPEC(2);
- VERT_COPY_SPEC(v[0], v[3]);
- VERT_COPY_SPEC(v[1], v[3]);
- VERT_COPY_SPEC(v[2], v[3]);
- }
- } else {
- VERT_SAVE_IND(0);
- VERT_SAVE_IND(1);
- VERT_SAVE_IND(2);
- VERT_COPY_IND(v[0], v[3]);
- VERT_COPY_IND(v[1], v[3]);
- VERT_COPY_IND(v[2], v[3]);
- }
- }
-
- if (mode == GL_POINT) {
- RASTERIZE(GL_POINTS);
- if (ef[e0]) POINT( v[0] );
- if (ef[e1]) POINT( v[1] );
- if (ef[e2]) POINT( v[2] );
- if (ef[e3]) POINT( v[3] );
- }
- else {
- RASTERIZE(GL_LINES);
- if (ef[e0]) LINE( v[0], v[1] );
- if (ef[e1]) LINE( v[1], v[2] );
- if (ef[e2]) LINE( v[2], v[3] );
- if (ef[e3]) LINE( v[3], v[0] );
- }
-
- if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
- if (HAVE_RGBA) {
- VERT_RESTORE_RGBA(0);
- VERT_RESTORE_RGBA(1);
- VERT_RESTORE_RGBA(2);
-
- if (HAVE_SPEC) {
- VERT_RESTORE_SPEC(0);
- VERT_RESTORE_SPEC(1);
- VERT_RESTORE_SPEC(2);
- }
- } else {
- VERT_RESTORE_IND(0);
- VERT_RESTORE_IND(1);
- VERT_RESTORE_IND(2);
- }
- }
-}
-
-
-#if HAVE_RGBA
-#undef VERT_SET_IND
-#undef VERT_COPY_IND
-#undef VERT_SAVE_IND
-#undef VERT_RESTORE_IND
-#endif
-
-#if !HAVE_SPEC
-#undef VERT_SET_SPEC
-#undef VERT_COPY_SPEC
-#undef VERT_SAVE_SPEC
-#undef VERT_RESTORE_SPEC
-#endif
-
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vb.c b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vb.c
deleted file mode 100644
index edd78f7ac..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vb.c
+++ /dev/null
@@ -1,344 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-#include "math/m_translate.h"
-
-#if (HAVE_HW_VIEWPORT)
-#define UNVIEWPORT_VARS
-#define UNVIEWPORT_X(x) x
-#define UNVIEWPORT_Y(x) x
-#define UNVIEWPORT_Z(x) x
-#endif
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-#ifndef CHECK_HW_DIVIDE
-#define CHECK_HW_DIVIDE 1
-#endif
-
-/* These don't need to be duplicated, but there's currently nowhere
- * really convenient to put them. Need to build some actual .o files in
- * this directory?
- */
-static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- LOCALVARS
- GLubyte *verts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- GLuint *dst = (GLuint *)(verts + (edst * size));
- GLuint *src = (GLuint *)(verts + (esrc * size));
- dst[4] = src[4];
- dst[5] = src[5];
-}
-
-static void copy_pv_rgba4( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- LOCALVARS
- GLubyte *verts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- GLuint *dst = (GLuint *)(verts + (edst * size));
- GLuint *src = (GLuint *)(verts + (esrc * size));
- dst[4] = src[4];
-}
-
-static void copy_pv_rgba3( GLcontext *ctx, GLuint edst, GLuint esrc )
-{
- LOCALVARS
- GLubyte *verts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- GLuint *dst = (GLuint *)(verts + (edst * size));
- GLuint *src = (GLuint *)(verts + (esrc * size));
- dst[3] = src[3];
-}
-
-
-void TAG(translate_vertex)(GLcontext *ctx,
- const VERTEX *src,
- SWvertex *dst)
-{
- LOCALVARS
- GLuint format = GET_VERTEX_FORMAT();
- GLfloat *s = ctx->Viewport._WindowMap.m;
- UNVIEWPORT_VARS;
-
- if (format == TINY_VERTEX_FORMAT) {
- if (HAVE_HW_VIEWPORT) {
- dst->win[0] = s[0] * src->v.x + s[12];
- dst->win[1] = s[5] * src->v.y + s[13];
- dst->win[2] = s[10] * src->v.z + s[14];
- dst->win[3] = 1.0;
- } else {
- dst->win[0] = UNVIEWPORT_X( src->v.x );
- dst->win[1] = UNVIEWPORT_Y( src->v.y );
- dst->win[2] = UNVIEWPORT_Z( src->v.z );
- dst->win[3] = 1.0;
- }
-
- dst->color[0] = src->tv.color.red;
- dst->color[1] = src->tv.color.green;
- dst->color[2] = src->tv.color.blue;
- dst->color[3] = src->tv.color.alpha;
- }
- else {
- if (HAVE_HW_VIEWPORT) {
- if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
- GLfloat oow = 1.0 / src->v.w;
- dst->win[0] = s[0] * src->v.x * oow + s[12];
- dst->win[1] = s[5] * src->v.y * oow + s[13];
- dst->win[2] = s[10] * src->v.z * oow + s[14];
- dst->win[3] = oow;
- } else {
- dst->win[0] = s[0] * src->v.x + s[12];
- dst->win[1] = s[5] * src->v.y + s[13];
- dst->win[2] = s[10] * src->v.z + s[14];
- dst->win[3] = src->v.w;
- }
- } else {
- dst->win[0] = UNVIEWPORT_X( src->v.x );
- dst->win[1] = UNVIEWPORT_Y( src->v.y );
- dst->win[2] = UNVIEWPORT_Z( src->v.z );
- dst->win[3] = src->v.w;
- }
-
- dst->color[0] = src->v.color.red;
- dst->color[1] = src->v.color.green;
- dst->color[2] = src->v.color.blue;
- dst->color[3] = src->v.color.alpha;
-
- dst->specular[0] = src->v.specular.red;
- dst->specular[1] = src->v.specular.green;
- dst->specular[2] = src->v.specular.blue;
-
- dst->fog = src->v.specular.alpha/255.0;
-
- if (HAVE_PTEX_VERTICES &&
- ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||
- (format == PROJ_TEX1_VERTEX_FORMAT))) {
-
- dst->texcoord[0][0] = src->pv.u0;
- dst->texcoord[0][1] = src->pv.v0;
- dst->texcoord[0][3] = src->pv.q0;
-
- dst->texcoord[1][0] = src->pv.u1;
- dst->texcoord[1][1] = src->pv.v1;
- dst->texcoord[1][3] = src->pv.q1;
-
- if (HAVE_TEX2_VERTICES) {
- dst->texcoord[2][0] = src->pv.u2;
- dst->texcoord[2][1] = src->pv.v2;
- dst->texcoord[2][3] = src->pv.q2;
- }
-
- if (HAVE_TEX3_VERTICES) {
- dst->texcoord[3][0] = src->pv.u3;
- dst->texcoord[3][1] = src->pv.v3;
- dst->texcoord[3][3] = src->pv.q3;
- }
- }
- else {
- dst->texcoord[0][0] = src->v.u0;
- dst->texcoord[0][1] = src->v.v0;
- dst->texcoord[0][3] = 1.0;
-
- dst->texcoord[1][0] = src->v.u1;
- dst->texcoord[1][1] = src->v.v1;
- dst->texcoord[1][3] = 1.0;
-
- if (HAVE_TEX2_VERTICES) {
- dst->texcoord[2][0] = src->v.u2;
- dst->texcoord[2][1] = src->v.v2;
- dst->texcoord[2][3] = 1.0;
- }
-
- if (HAVE_TEX3_VERTICES) {
- dst->texcoord[3][0] = src->v.u3;
- dst->texcoord[3][1] = src->v.v3;
- dst->texcoord[3][3] = 1.0;
- }
- }
- }
-
- dst->pointSize = ctx->Point._Size;
-}
-
-
-
-void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
-{
- LOCALVARS
- GLuint format = GET_VERTEX_FORMAT();
-
- fprintf(stderr, "(%x) ", format);
-
- switch (format) {
-#if HAVE_TINY_VERTICES
- case TINY_VERTEX_FORMAT:
- fprintf(stderr, "xyz %.4f,%.4f,%.4f rgba %x:%x:%x:%x\n",
- v->v.x, v->v.y, v->v.z,
- v->tv.color.red,
- v->tv.color.green,
- v->tv.color.blue,
- v->tv.color.alpha);
- break;
-#endif
-#if HAVE_NOTEX_VERTICES
- case NOTEX_VERTEX_FORMAT:
- fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x spec %x:%x:%x:%x\n",
- v->v.x, v->v.y, v->v.z, v->v.w,
- v->v.color.red,
- v->v.color.green,
- v->v.color.blue,
- v->v.color.alpha,
- v->v.specular.red,
- v->v.specular.green,
- v->v.specular.blue,
- v->v.specular.alpha);
- break;
-#endif
-#if HAVE_TEX0_VERTICES
- case TEX0_VERTEX_FORMAT:
- fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f\n",
- v->v.x, v->v.y, v->v.z, v->v.w,
- v->v.color.red,
- v->v.color.green,
- v->v.color.blue,
- v->v.color.alpha,
- v->v.u0,
- v->v.v0);
- break;
-#endif
-#if HAVE_TEX1_VERTICES
- case TEX1_VERTEX_FORMAT:
- fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f st %.4f,%.4f\n",
- v->v.x, v->v.y, v->v.z, v->v.w,
- v->v.color.red,
- v->v.color.green,
- v->v.color.blue,
- v->v.color.alpha,
- v->v.u0,
- v->v.v0,
- v->v.u1,
- v->v.u2);
- break;
-#endif
-#if HAVE_PTEX_VERTICES
- case PROJ_TEX1_VERTEX_FORMAT:
- fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x stq %.4f,%.4f,%.4f stq %.4f,%.4f,%.4f\n",
- v->v.x, v->v.y, v->v.z, v->v.w,
- v->v.color.red,
- v->v.color.green,
- v->v.color.blue,
- v->v.color.alpha,
- v->pv.u0,
- v->pv.v0,
- v->pv.q0,
- v->pv.u1,
- v->pv.v1,
- v->pv.q1);
- break;
-#endif
- default:
- fprintf(stderr, "???\n");
- break;
- }
-
- fprintf(stderr, "\n");
-}
-
-
-
-/* Interpolate the elements of the VB not included in typical hardware
- * vertices.
- *
- * NOTE: All these arrays are guarenteed by tnl to be writeable and
- * have good stride.
- */
-#ifndef INTERP_QUALIFIER
-#define INTERP_QUALIFIER static
-#endif
-
-#define GET_COLOR(ptr, idx) ((ptr)->data[idx])
-
-
-INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
- GLfloat t,
- GLuint dst, GLuint out, GLuint in,
- GLboolean force_boundary )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
-
- INTERP_4F( t,
- GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], out),
- GET_COLOR(VB->ColorPtr[1], in) );
-
- if (VB->SecondaryColorPtr[1]) {
- INTERP_3F( t,
- GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], out),
- GET_COLOR(VB->SecondaryColorPtr[1], in) );
- }
- }
-
- if (VB->EdgeFlag) {
- VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
- }
-
- INTERP_VERTEX(ctx, t, dst, out, in, force_boundary);
-}
-
-INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
- GLuint dst, GLuint src )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- if (VB->ColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], src) );
-
- if (VB->SecondaryColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], src) );
- }
- }
-
- COPY_PV_VERTEX(ctx, dst, src);
-}
-
-
-#undef INTERP_QUALIFIER
-#undef GET_COLOR
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vbtmp.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vbtmp.h
deleted file mode 100644
index 92dd8931c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vbtmp.h
+++ /dev/null
@@ -1,675 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.0.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-/* Unlike the other templates here, this assumes quite a bit about the
- * underlying hardware. Specifically it assumes a d3d-like vertex
- * format, with a layout more or less constrained to look like the
- * following:
- *
- * union {
- * struct {
- * float x, y, z, w;
- * struct { char r, g, b, a; } color;
- * struct { char r, g, b, fog; } spec;
- * float u0, v0;
- * float u1, v1;
- * float u2, v2;
- * float u3, v3;
- * } v;
- * struct {
- * float x, y, z, w;
- * struct { char r, g, b, a; } color;
- * struct { char r, g, b, fog; } spec;
- * float u0, v0, q0;
- * float u1, v1, q1;
- * float u2, v2, q2;
- * float u3, v3, q3;
- * } pv;
- * struct {
- * float x, y, z;
- * struct { char r, g, b, a; } color;
- * } tv;
- * float f[16];
- * unsigned int ui[16];
- * unsigned char ub4[4][16];
- * }
- *
-
- * VERTEX: hw vertex type as above
- * VERTEX_COLOR: hw color struct type in VERTEX
- *
- * DO_XYZW: Emit xyz and maybe w coordinates.
- * DO_RGBA: Emit color.
- * DO_SPEC: Emit specular color.
- * DO_FOG: Emit fog coordinate in specular alpha.
- * DO_TEX0: Emit tex0 u,v coordinates.
- * DO_TEX1: Emit tex1 u,v coordinates.
- * DO_TEX2: Emit tex2 u,v coordinates.
- * DO_TEX3: Emit tex3 u,v coordinates.
- * DO_PTEX: Emit tex0,1,2,3 q coordinates where possible.
- *
- * HAVE_RGBA_COLOR: Hardware takes color in rgba order (else bgra).
- *
- * HAVE_HW_VIEWPORT: Hardware performs viewport transform.
- * HAVE_HW_DIVIDE: Hardware performs perspective divide.
- *
- * HAVE_TINY_VERTICES: Hardware understands v.tv format.
- * HAVE_PTEX_VERTICES: Hardware understands v.pv format.
- * HAVE_NOTEX_VERTICES: Hardware understands v.v format with texcount 0.
- *
- * Additionally, this template assumes it is emitting *transformed*
- * vertices; the modifications to emit untransformed vertices (ie. to
- * t&l hardware) are probably too great to cooexist with the code
- * already in this file.
- *
- * NOTE: The PTEX vertex format always includes TEX0 and TEX1, even if
- * only TEX0 is enabled, in order to maintain a vertex size which is
- * an exact number of quadwords.
- */
-
-#if (HAVE_HW_VIEWPORT)
-#define VIEWPORT_X(dst,x) dst = x
-#define VIEWPORT_Y(dst,y) dst = y
-#define VIEWPORT_Z(dst,z) dst = z
-#else
-#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12]
-#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13]
-#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14]
-#endif
-
-#if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES)
-#error "can't cope with this combination"
-#endif
-
-#ifndef LOCALVARS
-#define LOCALVARS
-#endif
-
-#ifndef CHECK_HW_DIVIDE
-#define CHECK_HW_DIVIDE 1
-#endif
-
-#if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES)
-
-static void TAG(emit)( GLcontext *ctx,
- GLuint start, GLuint end,
- void *dest,
- GLuint stride )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*tc0)[4], (*tc1)[4], (*fog)[4];
- GLfloat (*tc2)[4], (*tc3)[4];
- GLfloat (*col)[4], (*spec)[4];
- GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride;
- GLuint tc2_stride, tc3_stride;
- GLuint tc0_size, tc1_size, col_size;
- GLuint tc2_size, tc3_size;
- GLfloat (*coord)[4];
- GLuint coord_stride;
- VERTEX *v = (VERTEX *)dest;
- const GLfloat *s = GET_VIEWPORT_MAT();
- const GLubyte *mask = VB->ClipMask;
- int i;
-
-/* fprintf(stderr, "%s(big) importable %d %d..%d\n", */
-/* __FUNCTION__, VB->importable_data, start, end); */
-
- if (HAVE_HW_VIEWPORT && HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
- (void) s;
- coord = VB->ClipPtr->data;
- coord_stride = VB->ClipPtr->stride;
- }
- else {
- coord = VB->NdcPtr->data;
- coord_stride = VB->NdcPtr->stride;
- }
-
- if (DO_TEX3) {
- const GLuint t3 = GET_TEXSOURCE(3);
- tc3 = VB->TexCoordPtr[t3]->data;
- tc3_stride = VB->TexCoordPtr[t3]->stride;
- if (DO_PTEX)
- tc3_size = VB->TexCoordPtr[t3]->size;
- }
-
- if (DO_TEX2) {
- const GLuint t2 = GET_TEXSOURCE(2);
- tc2 = VB->TexCoordPtr[t2]->data;
- tc2_stride = VB->TexCoordPtr[t2]->stride;
- if (DO_PTEX)
- tc2_size = VB->TexCoordPtr[t2]->size;
- }
-
- if (DO_TEX1) {
- const GLuint t1 = GET_TEXSOURCE(1);
- tc1 = VB->TexCoordPtr[t1]->data;
- tc1_stride = VB->TexCoordPtr[t1]->stride;
- if (DO_PTEX)
- tc1_size = VB->TexCoordPtr[t1]->size;
- }
-
- if (DO_TEX0) {
- const GLuint t0 = GET_TEXSOURCE(0);
- tc0_stride = VB->TexCoordPtr[t0]->stride;
- tc0 = VB->TexCoordPtr[t0]->data;
- if (DO_PTEX)
- tc0_size = VB->TexCoordPtr[t0]->size;
- }
-
- if (DO_RGBA) {
- col_stride = VB->ColorPtr[0]->stride;
- col = VB->ColorPtr[0]->data;
- col_size = VB->ColorPtr[0]->size;
- }
-
- if (DO_SPEC) {
- if (VB->SecondaryColorPtr[0]) {
- spec_stride = VB->SecondaryColorPtr[0]->stride;
- spec = VB->SecondaryColorPtr[0]->data;
- } else {
- spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
- spec_stride = 0;
- }
- }
-
- if (DO_FOG) {
- if (VB->FogCoordPtr) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
- }
- else {
- static GLfloat tmp[4] = {0, 0, 0, 0};
- fog = &tmp;
- fog_stride = 0;
- }
- }
-
- /* May have nonstandard strides:
- */
- if (start) {
- STRIDE_4F(coord, start * coord_stride);
- if (DO_TEX0)
- STRIDE_4F(tc0, start * tc0_stride);
- if (DO_TEX1)
- STRIDE_4F(tc1, start * tc1_stride);
- if (DO_TEX2)
- STRIDE_4F(tc2, start * tc2_stride);
- if (DO_TEX3)
- STRIDE_4F(tc3, start * tc3_stride);
- if (DO_RGBA)
- STRIDE_4F(col, start * col_stride);
- if (DO_SPEC)
- STRIDE_4F(spec, start * spec_stride);
- if (DO_FOG)
- STRIDE_4F(fog, start * fog_stride);
- }
-
- for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
- if (DO_XYZW) {
- if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v->v.x, coord[0][0]);
- VIEWPORT_Y(v->v.y, coord[0][1]);
- VIEWPORT_Z(v->v.z, coord[0][2]);
- v->v.w = coord[0][3];
- }
- STRIDE_4F(coord, coord_stride);
- }
- if (DO_RGBA) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.red, col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.green, col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.blue, col[0][2]);
- if (col_size == 4) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.color.alpha, col[0][3]);
- } else {
- v->v.color.alpha = CHAN_MAX;
- }
- STRIDE_4F(col, col_stride);
- }
- if (DO_SPEC) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.red, spec[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.green, spec[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.blue, spec[0][2]);
- STRIDE_4F(spec, spec_stride);
- }
- if (DO_FOG) {
- UNCLAMPED_FLOAT_TO_UBYTE(v->v.specular.alpha, fog[0][0]);
- STRIDE_4F(fog, fog_stride);
- }
- if (DO_TEX0) {
- v->v.u0 = tc0[0][0];
- v->v.v0 = tc0[0][1];
- if (DO_PTEX) {
- if (HAVE_PTEX_VERTICES) {
- if (tc0_size == 4)
- v->pv.q0 = tc0[0][3];
- else
- v->pv.q0 = 1.0;
- }
- else if (tc0_size == 4) {
- float rhw = 1.0 / tc0[0][3];
- v->v.w *= tc0[0][3];
- v->v.u0 *= rhw;
- v->v.v0 *= rhw;
- }
- }
- STRIDE_4F(tc0, tc0_stride);
- }
- if (DO_TEX1) {
- if (DO_PTEX) {
- v->pv.u1 = tc1[0][0];
- v->pv.v1 = tc1[0][1];
- if (tc1_size == 4)
- v->pv.q1 = tc1[0][3];
- else
- v->pv.q1 = 1.0;
- }
- else {
- v->v.u1 = tc1[0][0];
- v->v.v1 = tc1[0][1];
- }
- STRIDE_4F(tc1, tc1_stride);
- }
- else if (DO_PTEX) {
- *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */
- }
- if (DO_TEX2) {
- if (DO_PTEX) {
- v->pv.u2 = tc2[0][0];
- v->pv.v2 = tc2[0][1];
- if (tc2_size == 4)
- v->pv.q2 = tc2[0][3];
- else
- v->pv.q2 = 1.0;
- }
- else {
- v->v.u2 = tc2[0][0];
- v->v.v2 = tc2[0][1];
- }
- STRIDE_4F(tc2, tc2_stride);
- }
- if (DO_TEX3) {
- if (DO_PTEX) {
- v->pv.u3 = tc3[0][0];
- v->pv.v3 = tc3[0][1];
- if (tc3_size == 4)
- v->pv.q3 = tc3[0][3];
- else
- v->pv.q3 = 1.0;
- }
- else {
- v->v.u3 = tc3[0][0];
- v->v.v3 = tc3[0][1];
- }
- STRIDE_4F(tc3, tc3_stride);
- }
- }
-
-}
-#else
-
-#if HAVE_HW_DIVIDE
-#error "cannot use tiny vertices with hw perspective divide"
-#endif
-
-static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
- void *dest, GLuint stride )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLfloat (*col)[4];
- GLuint col_stride, col_size;
- GLfloat (*coord)[4] = VB->NdcPtr->data;
- GLuint coord_stride = VB->NdcPtr->stride;
- GLfloat *v = (GLfloat *)dest;
- const GLubyte *mask = VB->ClipMask;
- const GLfloat *s = GET_VIEWPORT_MAT();
- int i;
-
- (void) s;
-
- ASSERT(stride == 4);
-
- col = VB->ColorPtr[0]->data;
- col_stride = VB->ColorPtr[0]->stride;
- col_size = VB->ColorPtr[0]->size;
-
-/* fprintf(stderr, "%s(small) importable %x\n", */
-/* __FUNCTION__, VB->importable_data); */
-
- /* Pack what's left into a 4-dword vertex. Color is in a different
- * place, and there is no 'w' coordinate.
- */
- if (start) {
- STRIDE_4F(coord, start * coord_stride);
- STRIDE_4F(col, start * col_stride);
- }
-
- for (i=start; i < end; i++, v+=4) {
- if (DO_XYZW) {
- if (HAVE_HW_VIEWPORT || mask[i] == 0) {
- VIEWPORT_X(v[0], coord[0][0]);
- VIEWPORT_Y(v[1], coord[0][1]);
- VIEWPORT_Z(v[2], coord[0][2]);
- }
- STRIDE_4F( coord, coord_stride );
- }
- if (DO_RGBA) {
- VERTEX_COLOR *c = (VERTEX_COLOR *)&v[3];
- UNCLAMPED_FLOAT_TO_UBYTE(c->red, col[0][0]);
- UNCLAMPED_FLOAT_TO_UBYTE(c->green, col[0][1]);
- UNCLAMPED_FLOAT_TO_UBYTE(c->blue, col[0][2]);
- if (col_size == 4) {
- UNCLAMPED_FLOAT_TO_UBYTE(c->alpha, col[0][3]);
- } else {
- c->alpha = CHAN_MAX;
- }
- STRIDE_4F( col, col_stride );
- }
-/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */
-/* i, v[0], v[1], v[2], *(int *)&v[3]); */
- }
-}
-
-#endif /* emit */
-
-#if (DO_XYZW) && (DO_RGBA)
-
-
-#if (HAVE_PTEX_VERTICES)
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* Force 'missing' texcoords to something valid.
- */
- if (DO_TEX3 && VB->TexCoordPtr[2] == 0)
- VB->TexCoordPtr[2] = VB->TexCoordPtr[3];
-
- if (DO_TEX2 && VB->TexCoordPtr[1] == 0)
- VB->TexCoordPtr[1] = VB->TexCoordPtr[2];
-
- if (DO_TEX1 && VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (DO_PTEX)
- return GL_TRUE;
-
- if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) ||
- (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) ||
- (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) ||
- (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4))
- return GL_FALSE;
-
- return GL_TRUE;
-}
-#else
-static GLboolean TAG(check_tex_sizes)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* Force 'missing' texcoords to something valid.
- */
- if (DO_TEX3 && VB->TexCoordPtr[2] == 0)
- VB->TexCoordPtr[2] = VB->TexCoordPtr[3];
-
- if (DO_TEX2 && VB->TexCoordPtr[1] == 0)
- VB->TexCoordPtr[1] = VB->TexCoordPtr[2];
-
- if (DO_TEX1 && VB->TexCoordPtr[0] == 0)
- VB->TexCoordPtr[0] = VB->TexCoordPtr[1];
-
- if (DO_PTEX)
- return GL_TRUE;
-
- /* No hardware support for projective texture. Can fake it for
- * TEX0 only.
- */
- if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) ||
- (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) ||
- (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) {
- PTEX_FALLBACK();
- return GL_FALSE;
- }
-
- if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) {
- if (DO_TEX1 || DO_TEX2 || DO_TEX3) {
- PTEX_FALLBACK();
- }
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-#endif /* ptex */
-
-
-static void TAG(interp)( GLcontext *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte *ddverts = GET_VERTEX_STORE();
- GLuint size = GET_VERTEX_SIZE();
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- GLfloat w;
- const GLfloat *s = GET_VIEWPORT_MAT();
-
- VERTEX *dst = (VERTEX *)(ddverts + (edst * size));
- VERTEX *in = (VERTEX *)(ddverts + (ein * size));
- VERTEX *out = (VERTEX *)(ddverts + (eout * size));
-
- (void)s;
-
- if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
- VIEWPORT_X( dst->v.x, dstclip[0] );
- VIEWPORT_Y( dst->v.y, dstclip[1] );
- VIEWPORT_Z( dst->v.z, dstclip[2] );
- w = dstclip[3];
- }
- else {
- w = 1.0 / dstclip[3];
- VIEWPORT_X( dst->v.x, dstclip[0] * w );
- VIEWPORT_Y( dst->v.y, dstclip[1] * w );
- VIEWPORT_Z( dst->v.z, dstclip[2] * w );
- }
-
- if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) ||
- DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 ||
- DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) {
-
- dst->v.w = w;
-
- INTERP_UB( t, dst->ub4[4][0], out->ub4[4][0], in->ub4[4][0] );
- INTERP_UB( t, dst->ub4[4][1], out->ub4[4][1], in->ub4[4][1] );
- INTERP_UB( t, dst->ub4[4][2], out->ub4[4][2], in->ub4[4][2] );
- INTERP_UB( t, dst->ub4[4][3], out->ub4[4][3], in->ub4[4][3] );
-
- if (DO_SPEC) {
- INTERP_UB( t, dst->v.specular.red, out->v.specular.red, in->v.specular.red );
- INTERP_UB( t, dst->v.specular.green, out->v.specular.green, in->v.specular.green );
- INTERP_UB( t, dst->v.specular.blue, out->v.specular.blue, in->v.specular.blue );
- }
- if (DO_FOG) {
- INTERP_UB( t, dst->v.specular.alpha, out->v.specular.alpha, in->v.specular.alpha );
- }
- if (DO_TEX0) {
- if (DO_PTEX) {
- if (HAVE_PTEX_VERTICES) {
- INTERP_F( t, dst->pv.u0, out->pv.u0, in->pv.u0 );
- INTERP_F( t, dst->pv.v0, out->pv.v0, in->pv.v0 );
- INTERP_F( t, dst->pv.q0, out->pv.q0, in->pv.q0 );
- } else {
- GLfloat wout = VB->NdcPtr->data[eout][3];
- GLfloat win = VB->NdcPtr->data[ein][3];
- GLfloat qout = out->pv.w / wout;
- GLfloat qin = in->pv.w / win;
- GLfloat qdst, rqdst;
-
- ASSERT( !HAVE_HW_DIVIDE );
-
- INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin );
- INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin );
- INTERP_F( t, qdst, qout, qin );
-
- rqdst = 1.0 / qdst;
- dst->v.u0 *= rqdst;
- dst->v.v0 *= rqdst;
- dst->v.w *= rqdst;
- }
- }
- else {
- INTERP_F( t, dst->v.u0, out->v.u0, in->v.u0 );
- INTERP_F( t, dst->v.v0, out->v.v0, in->v.v0 );
- }
- }
- if (DO_TEX1) {
- if (DO_PTEX) {
- INTERP_F( t, dst->pv.u1, out->pv.u1, in->pv.u1 );
- INTERP_F( t, dst->pv.v1, out->pv.v1, in->pv.v1 );
- INTERP_F( t, dst->pv.q1, out->pv.q1, in->pv.q1 );
- } else {
- INTERP_F( t, dst->v.u1, out->v.u1, in->v.u1 );
- INTERP_F( t, dst->v.v1, out->v.v1, in->v.v1 );
- }
- }
- else if (DO_PTEX) {
- dst->pv.q1 = 0.0; /* must be a valid float on radeon */
- }
- if (DO_TEX2) {
- if (DO_PTEX) {
- INTERP_F( t, dst->pv.u2, out->pv.u2, in->pv.u2 );
- INTERP_F( t, dst->pv.v2, out->pv.v2, in->pv.v2 );
- INTERP_F( t, dst->pv.q2, out->pv.q2, in->pv.q2 );
- } else {
- INTERP_F( t, dst->v.u2, out->v.u2, in->v.u2 );
- INTERP_F( t, dst->v.v2, out->v.v2, in->v.v2 );
- }
- }
- if (DO_TEX3) {
- if (DO_PTEX) {
- INTERP_F( t, dst->pv.u3, out->pv.u3, in->pv.u3 );
- INTERP_F( t, dst->pv.v3, out->pv.v3, in->pv.v3 );
- INTERP_F( t, dst->pv.q3, out->pv.q3, in->pv.q3 );
- } else {
- INTERP_F( t, dst->v.u3, out->v.u3, in->v.u3 );
- INTERP_F( t, dst->v.v3, out->v.v3, in->v.v3 );
- }
- }
- } else {
- /* 4-dword vertex. Color is in v[3] and there is no oow coordinate.
- */
- INTERP_UB( t, dst->ub4[3][0], out->ub4[3][0], in->ub4[3][0] );
- INTERP_UB( t, dst->ub4[3][1], out->ub4[3][1], in->ub4[3][1] );
- INTERP_UB( t, dst->ub4[3][2], out->ub4[3][2], in->ub4[3][2] );
- INTERP_UB( t, dst->ub4[3][3], out->ub4[3][3], in->ub4[3][3] );
- }
-}
-
-#endif /* rgba && xyzw */
-
-
-static void TAG(init)( void )
-{
- setup_tab[IND].emit = TAG(emit);
-
-#if (DO_XYZW && DO_RGBA)
- setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes);
- setup_tab[IND].interp = TAG(interp);
-#endif
-
- if (DO_SPEC)
- setup_tab[IND].copy_pv = copy_pv_rgba4_spec5;
- else if (HAVE_HW_DIVIDE || DO_SPEC || DO_FOG || DO_TEX0 || DO_TEX1 ||
- DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES)
- setup_tab[IND].copy_pv = copy_pv_rgba4;
- else
- setup_tab[IND].copy_pv = copy_pv_rgba3;
-
- if (DO_TEX3) {
- if (DO_PTEX) {
- ASSERT(HAVE_PTEX_VERTICES);
- setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 18;
- }
- else {
- setup_tab[IND].vertex_format = TEX3_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 14;
- }
- }
- else if (DO_TEX2) {
- if (DO_PTEX) {
- ASSERT(HAVE_PTEX_VERTICES);
- setup_tab[IND].vertex_format = PROJ_TEX3_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 18;
- }
- else {
- setup_tab[IND].vertex_format = TEX2_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 12;
- }
- }
- else if (DO_TEX1) {
- if (DO_PTEX) {
- ASSERT(HAVE_PTEX_VERTICES);
- setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 12;
- }
- else {
- setup_tab[IND].vertex_format = TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 10;
- }
- }
- else if (DO_TEX0) {
- if (DO_PTEX && HAVE_PTEX_VERTICES) {
- setup_tab[IND].vertex_format = PROJ_TEX1_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 12;
- } else {
- setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 8;
- }
- }
- else if (!HAVE_HW_DIVIDE && !DO_SPEC && !DO_FOG && HAVE_TINY_VERTICES) {
- setup_tab[IND].vertex_format = TINY_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 4;
- } else if (HAVE_NOTEX_VERTICES) {
- setup_tab[IND].vertex_format = NOTEX_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 6;
- } else {
- setup_tab[IND].vertex_format = TEX0_VERTEX_FORMAT;
- setup_tab[IND].vertex_size = 8;
- }
-}
-
-
-#undef IND
-#undef TAG
diff --git a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vertex.h b/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vertex.h
deleted file mode 100644
index d45dd09fb..000000000
--- a/nx-X11/extras/Mesa/src/mesa/tnl_dd/t_dd_vertex.h
+++ /dev/null
@@ -1,78 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 4.0.3
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-typedef struct {
- GLfloat x, y, z, w;
-} TAG(_coord_t);
-
-#ifdef COLOR_IS_RGBA
-typedef struct {
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
- GLubyte alpha, blue, green, red;
-#else
- GLubyte red, green, blue, alpha;
-#endif
-} TAG(_color_t);
-#else
-typedef struct {
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
- GLubyte alpha, red, green, blue;
-#else
- GLubyte blue, green, red, alpha;
-#endif
-} TAG(_color_t);
-#endif
-
-typedef union {
- struct {
- GLfloat x, y, z, w;
- TAG(_color_t) color;
- TAG(_color_t) specular;
- GLfloat u0, v0;
- GLfloat u1, v1;
- GLfloat u2, v2;
- GLfloat u3, v3;
- } v;
- struct {
- GLfloat x, y, z, w;
- TAG(_color_t) color;
- TAG(_color_t) specular;
- GLfloat u0, v0, q0;
- GLfloat u1, v1, q1;
- GLfloat u2, v2, q2;
- GLfloat u3, v3, q3;
- } pv;
- struct {
- GLfloat x, y, z;
- TAG(_color_t) color;
- } tv;
- GLfloat f[24];
- GLuint ui[24];
- GLubyte ub4[24][4];
-} TAG(Vertex), *TAG(VertexPtr);
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86-64/Makefile b/nx-X11/extras/Mesa/src/mesa/x86-64/Makefile
deleted file mode 100644
index 252218ca8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86-64/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# src/mesa/x86-64/Makefile
-
-TOP = ../../..
-
-include $(TOP)/configs/current
-
-
-
-INCLUDE_DIRS = \
- -I$(TOP)/include/GL \
- -I$(TOP)/include \
- -I.. \
- -I../main \
- -I../math \
- -I../glapi \
- -I../tnl
-
-
-default: matypes.h
-
-clean:
- rm -f matypes.h
-
-
-# need some special rules here, unfortunately
-matypes.h: ../main/mtypes.h ../tnl/t_context.h ../x86/gen_matypes
- ../x86/gen_matypes | grep -v '#include "assyntax.h' > matypes.h
-
-xform4.o: matypes.h
diff --git a/nx-X11/extras/Mesa/src/mesa/x86-64/calling_convention.txt b/nx-X11/extras/Mesa/src/mesa/x86-64/calling_convention.txt
deleted file mode 100644
index 4147f7eba..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86-64/calling_convention.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-Register Usage
-rax temporary register; with variable arguments passes information
- about the number of SSE registers used; 1st return register
-
-rbx* callee-saved register; optionally used as base pointer
-
-rcx used to pass 4th integer argument to functions
-
-rdx used to pass 3rd argument to functions 2nd return register
-
-rsp* stack pointer
-
-rbp* callee-saved register; optionally used as frame pointer
-
-rsi used to pass 2nd argument to functions
-
-rdi used to pass 1st argument to functions
-
-r8 used to pass 5th argument to functions
-
-r9 used to pass 6th argument to functions
-
-r10 temporary register, used for passing a function's static chain pointer
-
-r11 temporary register
-
-r12-15* callee-saved registers
-
-xmm0­1 used to pass and return floating point arguments
-
-xmm2­7 used to pass floating point arguments
-
-xmm8­15 temporary registers
-
-mmx0­7 temporary registers
-
-st0 temporary register; used to return long double arguments
-
-st1 temporary registers; used to return long double arguments
-
-st2­7 temporary registers
-
-fs Reserved for system use (as thread specific data register)
-
-
-
-*) must be preserved across function calls
-
-Integer arguments from list: rdi,rsi,rdx,rcx,r8,r9,stack
-Floating point arguments from list: xmm0-xmm7 \ No newline at end of file
diff --git a/nx-X11/extras/Mesa/src/mesa/x86-64/glapi_x86-64.S b/nx-X11/extras/Mesa/src/mesa/x86-64/glapi_x86-64.S
deleted file mode 100644
index dbc2d7702..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86-64/glapi_x86-64.S
+++ /dev/null
@@ -1,31002 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by gl_x86-64_asm.py (from Mesa) script */
-
-/*
- * (C) Copyright IBM Corporation 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* If we build with gcc's -fvisibility=hidden flag, we'll need to change
- * the symbol visibility mode to 'default'.
- */
-
-#include "assyntax.h"
-
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
-# pragma GCC visibility push(default)
-# define HIDDEN(x) .hidden x
-#else
-# define HIDDEN(x)
-#endif
-
-# if defined(USE_MGL_NAMESPACE)
-# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))
-# else
-# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))
-# endif
-
-#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
-# define THREADS
-#endif
-
- .text
-
-#ifdef GLX_USE_TLS
-
- .globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)
-_x86_64_get_get_dispatch:
- lea _x86_64_get_dispatch(%rip), %rax
- ret
-
- .p2align 4,,15
-_x86_64_get_dispatch:
- movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax
- movq %fs:(%rax), %rax
- ret
- .size _x86_64_get_dispatch, .-_x86_64_get_dispatch
-
-#elif defined(PTHREADS)
-
- .extern _glapi_Dispatch
- .extern _gl_DispatchTSD
- .extern pthread_getspecific
-
- .p2align 4,,15
-_x86_64_get_dispatch:
- movq _gl_DispatchTSD(%rip), %rdi
- jmp pthread_getspecific@PLT
-
-#elif defined(THREADS)
-
- .extern _glapi_get_dispatch
-
-#endif
-
- .p2align 4,,15
- .globl GL_PREFIX(NewList)
- .type GL_PREFIX(NewList), @function
-GL_PREFIX(NewList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 0(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq (%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 0(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 0(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(NewList), .-GL_PREFIX(NewList)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndList)
- .type GL_PREFIX(EndList), @function
-GL_PREFIX(EndList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 8(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 8(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 8(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 8(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndList), .-GL_PREFIX(EndList)
-
- .p2align 4,,15
- .globl GL_PREFIX(CallList)
- .type GL_PREFIX(CallList), @function
-GL_PREFIX(CallList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 16(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 16(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 16(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 16(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CallList), .-GL_PREFIX(CallList)
-
- .p2align 4,,15
- .globl GL_PREFIX(CallLists)
- .type GL_PREFIX(CallLists), @function
-GL_PREFIX(CallLists):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 24(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 24(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 24(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 24(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CallLists), .-GL_PREFIX(CallLists)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteLists)
- .type GL_PREFIX(DeleteLists), @function
-GL_PREFIX(DeleteLists):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 32(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 32(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 32(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 32(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteLists), .-GL_PREFIX(DeleteLists)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenLists)
- .type GL_PREFIX(GenLists), @function
-GL_PREFIX(GenLists):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 40(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 40(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 40(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 40(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenLists), .-GL_PREFIX(GenLists)
-
- .p2align 4,,15
- .globl GL_PREFIX(ListBase)
- .type GL_PREFIX(ListBase), @function
-GL_PREFIX(ListBase):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 48(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 48(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 48(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 48(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ListBase), .-GL_PREFIX(ListBase)
-
- .p2align 4,,15
- .globl GL_PREFIX(Begin)
- .type GL_PREFIX(Begin), @function
-GL_PREFIX(Begin):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 56(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 56(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 56(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 56(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Begin), .-GL_PREFIX(Begin)
-
- .p2align 4,,15
- .globl GL_PREFIX(Bitmap)
- .type GL_PREFIX(Bitmap), @function
-GL_PREFIX(Bitmap):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 64(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- movq %rdx, 48(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 48(%rsp), %rdx
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 64(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 64(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- movq %rdx, 48(%rsp)
- call _glapi_get_dispatch
- movq 48(%rsp), %rdx
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 64(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Bitmap), .-GL_PREFIX(Bitmap)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3b)
- .type GL_PREFIX(Color3b), @function
-GL_PREFIX(Color3b):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 72(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 72(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 72(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 72(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3b), .-GL_PREFIX(Color3b)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3bv)
- .type GL_PREFIX(Color3bv), @function
-GL_PREFIX(Color3bv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 80(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 80(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 80(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 80(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3bv), .-GL_PREFIX(Color3bv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3d)
- .type GL_PREFIX(Color3d), @function
-GL_PREFIX(Color3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 88(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 88(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 88(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 88(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3d), .-GL_PREFIX(Color3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3dv)
- .type GL_PREFIX(Color3dv), @function
-GL_PREFIX(Color3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 96(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 96(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 96(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 96(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3dv), .-GL_PREFIX(Color3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3f)
- .type GL_PREFIX(Color3f), @function
-GL_PREFIX(Color3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 104(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3f), .-GL_PREFIX(Color3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3fv)
- .type GL_PREFIX(Color3fv), @function
-GL_PREFIX(Color3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3fv), .-GL_PREFIX(Color3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3i)
- .type GL_PREFIX(Color3i), @function
-GL_PREFIX(Color3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3i), .-GL_PREFIX(Color3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3iv)
- .type GL_PREFIX(Color3iv), @function
-GL_PREFIX(Color3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3iv), .-GL_PREFIX(Color3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3s)
- .type GL_PREFIX(Color3s), @function
-GL_PREFIX(Color3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3s), .-GL_PREFIX(Color3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3sv)
- .type GL_PREFIX(Color3sv), @function
-GL_PREFIX(Color3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3sv), .-GL_PREFIX(Color3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3ub)
- .type GL_PREFIX(Color3ub), @function
-GL_PREFIX(Color3ub):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3ub), .-GL_PREFIX(Color3ub)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3ubv)
- .type GL_PREFIX(Color3ubv), @function
-GL_PREFIX(Color3ubv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3ubv), .-GL_PREFIX(Color3ubv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3ui)
- .type GL_PREFIX(Color3ui), @function
-GL_PREFIX(Color3ui):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3ui), .-GL_PREFIX(Color3ui)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3uiv)
- .type GL_PREFIX(Color3uiv), @function
-GL_PREFIX(Color3uiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3uiv), .-GL_PREFIX(Color3uiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3us)
- .type GL_PREFIX(Color3us), @function
-GL_PREFIX(Color3us):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3us), .-GL_PREFIX(Color3us)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3usv)
- .type GL_PREFIX(Color3usv), @function
-GL_PREFIX(Color3usv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3usv), .-GL_PREFIX(Color3usv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4b)
- .type GL_PREFIX(Color4b), @function
-GL_PREFIX(Color4b):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4b), .-GL_PREFIX(Color4b)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4bv)
- .type GL_PREFIX(Color4bv), @function
-GL_PREFIX(Color4bv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4bv), .-GL_PREFIX(Color4bv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4d)
- .type GL_PREFIX(Color4d), @function
-GL_PREFIX(Color4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 216(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4d), .-GL_PREFIX(Color4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4dv)
- .type GL_PREFIX(Color4dv), @function
-GL_PREFIX(Color4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4dv), .-GL_PREFIX(Color4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4f)
- .type GL_PREFIX(Color4f), @function
-GL_PREFIX(Color4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 232(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4f), .-GL_PREFIX(Color4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4fv)
- .type GL_PREFIX(Color4fv), @function
-GL_PREFIX(Color4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4fv), .-GL_PREFIX(Color4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4i)
- .type GL_PREFIX(Color4i), @function
-GL_PREFIX(Color4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4i), .-GL_PREFIX(Color4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4iv)
- .type GL_PREFIX(Color4iv), @function
-GL_PREFIX(Color4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4iv), .-GL_PREFIX(Color4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4s)
- .type GL_PREFIX(Color4s), @function
-GL_PREFIX(Color4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4s), .-GL_PREFIX(Color4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4sv)
- .type GL_PREFIX(Color4sv), @function
-GL_PREFIX(Color4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4sv), .-GL_PREFIX(Color4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4ub)
- .type GL_PREFIX(Color4ub), @function
-GL_PREFIX(Color4ub):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4ub), .-GL_PREFIX(Color4ub)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4ubv)
- .type GL_PREFIX(Color4ubv), @function
-GL_PREFIX(Color4ubv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4ubv), .-GL_PREFIX(Color4ubv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4ui)
- .type GL_PREFIX(Color4ui), @function
-GL_PREFIX(Color4ui):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4ui), .-GL_PREFIX(Color4ui)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4uiv)
- .type GL_PREFIX(Color4uiv), @function
-GL_PREFIX(Color4uiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4uiv), .-GL_PREFIX(Color4uiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4us)
- .type GL_PREFIX(Color4us), @function
-GL_PREFIX(Color4us):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4us), .-GL_PREFIX(Color4us)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4usv)
- .type GL_PREFIX(Color4usv), @function
-GL_PREFIX(Color4usv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4usv), .-GL_PREFIX(Color4usv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlag)
- .type GL_PREFIX(EdgeFlag), @function
-GL_PREFIX(EdgeFlag):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlag), .-GL_PREFIX(EdgeFlag)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlagv)
- .type GL_PREFIX(EdgeFlagv), @function
-GL_PREFIX(EdgeFlagv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlagv), .-GL_PREFIX(EdgeFlagv)
-
- .p2align 4,,15
- .globl GL_PREFIX(End)
- .type GL_PREFIX(End), @function
-GL_PREFIX(End):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 344(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(End), .-GL_PREFIX(End)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexd)
- .type GL_PREFIX(Indexd), @function
-GL_PREFIX(Indexd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 352(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexd), .-GL_PREFIX(Indexd)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexdv)
- .type GL_PREFIX(Indexdv), @function
-GL_PREFIX(Indexdv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexdv), .-GL_PREFIX(Indexdv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexf)
- .type GL_PREFIX(Indexf), @function
-GL_PREFIX(Indexf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 368(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexf), .-GL_PREFIX(Indexf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexfv)
- .type GL_PREFIX(Indexfv), @function
-GL_PREFIX(Indexfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexfv), .-GL_PREFIX(Indexfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexi)
- .type GL_PREFIX(Indexi), @function
-GL_PREFIX(Indexi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexi), .-GL_PREFIX(Indexi)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexiv)
- .type GL_PREFIX(Indexiv), @function
-GL_PREFIX(Indexiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexiv), .-GL_PREFIX(Indexiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexs)
- .type GL_PREFIX(Indexs), @function
-GL_PREFIX(Indexs):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexs), .-GL_PREFIX(Indexs)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexsv)
- .type GL_PREFIX(Indexsv), @function
-GL_PREFIX(Indexsv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexsv), .-GL_PREFIX(Indexsv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3b)
- .type GL_PREFIX(Normal3b), @function
-GL_PREFIX(Normal3b):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3b), .-GL_PREFIX(Normal3b)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3bv)
- .type GL_PREFIX(Normal3bv), @function
-GL_PREFIX(Normal3bv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3bv), .-GL_PREFIX(Normal3bv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3d)
- .type GL_PREFIX(Normal3d), @function
-GL_PREFIX(Normal3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 432(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3d), .-GL_PREFIX(Normal3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3dv)
- .type GL_PREFIX(Normal3dv), @function
-GL_PREFIX(Normal3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3dv), .-GL_PREFIX(Normal3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3f)
- .type GL_PREFIX(Normal3f), @function
-GL_PREFIX(Normal3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 448(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3f), .-GL_PREFIX(Normal3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3fv)
- .type GL_PREFIX(Normal3fv), @function
-GL_PREFIX(Normal3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3fv), .-GL_PREFIX(Normal3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3i)
- .type GL_PREFIX(Normal3i), @function
-GL_PREFIX(Normal3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3i), .-GL_PREFIX(Normal3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3iv)
- .type GL_PREFIX(Normal3iv), @function
-GL_PREFIX(Normal3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3iv), .-GL_PREFIX(Normal3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3s)
- .type GL_PREFIX(Normal3s), @function
-GL_PREFIX(Normal3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3s), .-GL_PREFIX(Normal3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3sv)
- .type GL_PREFIX(Normal3sv), @function
-GL_PREFIX(Normal3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3sv), .-GL_PREFIX(Normal3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2d)
- .type GL_PREFIX(RasterPos2d), @function
-GL_PREFIX(RasterPos2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 496(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2d), .-GL_PREFIX(RasterPos2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2dv)
- .type GL_PREFIX(RasterPos2dv), @function
-GL_PREFIX(RasterPos2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2dv), .-GL_PREFIX(RasterPos2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2f)
- .type GL_PREFIX(RasterPos2f), @function
-GL_PREFIX(RasterPos2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 512(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2f), .-GL_PREFIX(RasterPos2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2fv)
- .type GL_PREFIX(RasterPos2fv), @function
-GL_PREFIX(RasterPos2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2fv), .-GL_PREFIX(RasterPos2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2i)
- .type GL_PREFIX(RasterPos2i), @function
-GL_PREFIX(RasterPos2i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2i), .-GL_PREFIX(RasterPos2i)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2iv)
- .type GL_PREFIX(RasterPos2iv), @function
-GL_PREFIX(RasterPos2iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2iv), .-GL_PREFIX(RasterPos2iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2s)
- .type GL_PREFIX(RasterPos2s), @function
-GL_PREFIX(RasterPos2s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2s), .-GL_PREFIX(RasterPos2s)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2sv)
- .type GL_PREFIX(RasterPos2sv), @function
-GL_PREFIX(RasterPos2sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2sv), .-GL_PREFIX(RasterPos2sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3d)
- .type GL_PREFIX(RasterPos3d), @function
-GL_PREFIX(RasterPos3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 560(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3d), .-GL_PREFIX(RasterPos3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3dv)
- .type GL_PREFIX(RasterPos3dv), @function
-GL_PREFIX(RasterPos3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3dv), .-GL_PREFIX(RasterPos3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3f)
- .type GL_PREFIX(RasterPos3f), @function
-GL_PREFIX(RasterPos3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 576(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3f), .-GL_PREFIX(RasterPos3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3fv)
- .type GL_PREFIX(RasterPos3fv), @function
-GL_PREFIX(RasterPos3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3fv), .-GL_PREFIX(RasterPos3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3i)
- .type GL_PREFIX(RasterPos3i), @function
-GL_PREFIX(RasterPos3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3i), .-GL_PREFIX(RasterPos3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3iv)
- .type GL_PREFIX(RasterPos3iv), @function
-GL_PREFIX(RasterPos3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3iv), .-GL_PREFIX(RasterPos3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3s)
- .type GL_PREFIX(RasterPos3s), @function
-GL_PREFIX(RasterPos3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3s), .-GL_PREFIX(RasterPos3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3sv)
- .type GL_PREFIX(RasterPos3sv), @function
-GL_PREFIX(RasterPos3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3sv), .-GL_PREFIX(RasterPos3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4d)
- .type GL_PREFIX(RasterPos4d), @function
-GL_PREFIX(RasterPos4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 624(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4d), .-GL_PREFIX(RasterPos4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4dv)
- .type GL_PREFIX(RasterPos4dv), @function
-GL_PREFIX(RasterPos4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4dv), .-GL_PREFIX(RasterPos4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4f)
- .type GL_PREFIX(RasterPos4f), @function
-GL_PREFIX(RasterPos4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 640(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4f), .-GL_PREFIX(RasterPos4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4fv)
- .type GL_PREFIX(RasterPos4fv), @function
-GL_PREFIX(RasterPos4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4fv), .-GL_PREFIX(RasterPos4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4i)
- .type GL_PREFIX(RasterPos4i), @function
-GL_PREFIX(RasterPos4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4i), .-GL_PREFIX(RasterPos4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4iv)
- .type GL_PREFIX(RasterPos4iv), @function
-GL_PREFIX(RasterPos4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4iv), .-GL_PREFIX(RasterPos4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4s)
- .type GL_PREFIX(RasterPos4s), @function
-GL_PREFIX(RasterPos4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4s), .-GL_PREFIX(RasterPos4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4sv)
- .type GL_PREFIX(RasterPos4sv), @function
-GL_PREFIX(RasterPos4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4sv), .-GL_PREFIX(RasterPos4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectd)
- .type GL_PREFIX(Rectd), @function
-GL_PREFIX(Rectd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 688(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectd), .-GL_PREFIX(Rectd)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectdv)
- .type GL_PREFIX(Rectdv), @function
-GL_PREFIX(Rectdv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectdv), .-GL_PREFIX(Rectdv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectf)
- .type GL_PREFIX(Rectf), @function
-GL_PREFIX(Rectf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 704(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectf), .-GL_PREFIX(Rectf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectfv)
- .type GL_PREFIX(Rectfv), @function
-GL_PREFIX(Rectfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectfv), .-GL_PREFIX(Rectfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Recti)
- .type GL_PREFIX(Recti), @function
-GL_PREFIX(Recti):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Recti), .-GL_PREFIX(Recti)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectiv)
- .type GL_PREFIX(Rectiv), @function
-GL_PREFIX(Rectiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectiv), .-GL_PREFIX(Rectiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rects)
- .type GL_PREFIX(Rects), @function
-GL_PREFIX(Rects):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rects), .-GL_PREFIX(Rects)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectsv)
- .type GL_PREFIX(Rectsv), @function
-GL_PREFIX(Rectsv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectsv), .-GL_PREFIX(Rectsv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1d)
- .type GL_PREFIX(TexCoord1d), @function
-GL_PREFIX(TexCoord1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 752(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1d), .-GL_PREFIX(TexCoord1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1dv)
- .type GL_PREFIX(TexCoord1dv), @function
-GL_PREFIX(TexCoord1dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1dv), .-GL_PREFIX(TexCoord1dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1f)
- .type GL_PREFIX(TexCoord1f), @function
-GL_PREFIX(TexCoord1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 768(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1f), .-GL_PREFIX(TexCoord1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1fv)
- .type GL_PREFIX(TexCoord1fv), @function
-GL_PREFIX(TexCoord1fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1fv), .-GL_PREFIX(TexCoord1fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1i)
- .type GL_PREFIX(TexCoord1i), @function
-GL_PREFIX(TexCoord1i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1i), .-GL_PREFIX(TexCoord1i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1iv)
- .type GL_PREFIX(TexCoord1iv), @function
-GL_PREFIX(TexCoord1iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1iv), .-GL_PREFIX(TexCoord1iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1s)
- .type GL_PREFIX(TexCoord1s), @function
-GL_PREFIX(TexCoord1s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 800(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1s), .-GL_PREFIX(TexCoord1s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1sv)
- .type GL_PREFIX(TexCoord1sv), @function
-GL_PREFIX(TexCoord1sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1sv), .-GL_PREFIX(TexCoord1sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2d)
- .type GL_PREFIX(TexCoord2d), @function
-GL_PREFIX(TexCoord2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 816(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2d), .-GL_PREFIX(TexCoord2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2dv)
- .type GL_PREFIX(TexCoord2dv), @function
-GL_PREFIX(TexCoord2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2dv), .-GL_PREFIX(TexCoord2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2f)
- .type GL_PREFIX(TexCoord2f), @function
-GL_PREFIX(TexCoord2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 832(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2f), .-GL_PREFIX(TexCoord2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2fv)
- .type GL_PREFIX(TexCoord2fv), @function
-GL_PREFIX(TexCoord2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2fv), .-GL_PREFIX(TexCoord2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2i)
- .type GL_PREFIX(TexCoord2i), @function
-GL_PREFIX(TexCoord2i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2i), .-GL_PREFIX(TexCoord2i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2iv)
- .type GL_PREFIX(TexCoord2iv), @function
-GL_PREFIX(TexCoord2iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2iv), .-GL_PREFIX(TexCoord2iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2s)
- .type GL_PREFIX(TexCoord2s), @function
-GL_PREFIX(TexCoord2s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2s), .-GL_PREFIX(TexCoord2s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2sv)
- .type GL_PREFIX(TexCoord2sv), @function
-GL_PREFIX(TexCoord2sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2sv), .-GL_PREFIX(TexCoord2sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3d)
- .type GL_PREFIX(TexCoord3d), @function
-GL_PREFIX(TexCoord3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 880(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3d), .-GL_PREFIX(TexCoord3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3dv)
- .type GL_PREFIX(TexCoord3dv), @function
-GL_PREFIX(TexCoord3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3dv), .-GL_PREFIX(TexCoord3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3f)
- .type GL_PREFIX(TexCoord3f), @function
-GL_PREFIX(TexCoord3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 896(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3f), .-GL_PREFIX(TexCoord3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3fv)
- .type GL_PREFIX(TexCoord3fv), @function
-GL_PREFIX(TexCoord3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3fv), .-GL_PREFIX(TexCoord3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3i)
- .type GL_PREFIX(TexCoord3i), @function
-GL_PREFIX(TexCoord3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3i), .-GL_PREFIX(TexCoord3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3iv)
- .type GL_PREFIX(TexCoord3iv), @function
-GL_PREFIX(TexCoord3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3iv), .-GL_PREFIX(TexCoord3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3s)
- .type GL_PREFIX(TexCoord3s), @function
-GL_PREFIX(TexCoord3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3s), .-GL_PREFIX(TexCoord3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3sv)
- .type GL_PREFIX(TexCoord3sv), @function
-GL_PREFIX(TexCoord3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3sv), .-GL_PREFIX(TexCoord3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4d)
- .type GL_PREFIX(TexCoord4d), @function
-GL_PREFIX(TexCoord4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 944(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4d), .-GL_PREFIX(TexCoord4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4dv)
- .type GL_PREFIX(TexCoord4dv), @function
-GL_PREFIX(TexCoord4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4dv), .-GL_PREFIX(TexCoord4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4f)
- .type GL_PREFIX(TexCoord4f), @function
-GL_PREFIX(TexCoord4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 960(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4f), .-GL_PREFIX(TexCoord4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4fv)
- .type GL_PREFIX(TexCoord4fv), @function
-GL_PREFIX(TexCoord4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4fv), .-GL_PREFIX(TexCoord4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4i)
- .type GL_PREFIX(TexCoord4i), @function
-GL_PREFIX(TexCoord4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4i), .-GL_PREFIX(TexCoord4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4iv)
- .type GL_PREFIX(TexCoord4iv), @function
-GL_PREFIX(TexCoord4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4iv), .-GL_PREFIX(TexCoord4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4s)
- .type GL_PREFIX(TexCoord4s), @function
-GL_PREFIX(TexCoord4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4s), .-GL_PREFIX(TexCoord4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4sv)
- .type GL_PREFIX(TexCoord4sv), @function
-GL_PREFIX(TexCoord4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4sv), .-GL_PREFIX(TexCoord4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2d)
- .type GL_PREFIX(Vertex2d), @function
-GL_PREFIX(Vertex2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1008(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2d), .-GL_PREFIX(Vertex2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2dv)
- .type GL_PREFIX(Vertex2dv), @function
-GL_PREFIX(Vertex2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2dv), .-GL_PREFIX(Vertex2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2f)
- .type GL_PREFIX(Vertex2f), @function
-GL_PREFIX(Vertex2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1024(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2f), .-GL_PREFIX(Vertex2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2fv)
- .type GL_PREFIX(Vertex2fv), @function
-GL_PREFIX(Vertex2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2fv), .-GL_PREFIX(Vertex2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2i)
- .type GL_PREFIX(Vertex2i), @function
-GL_PREFIX(Vertex2i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2i), .-GL_PREFIX(Vertex2i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2iv)
- .type GL_PREFIX(Vertex2iv), @function
-GL_PREFIX(Vertex2iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2iv), .-GL_PREFIX(Vertex2iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2s)
- .type GL_PREFIX(Vertex2s), @function
-GL_PREFIX(Vertex2s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2s), .-GL_PREFIX(Vertex2s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2sv)
- .type GL_PREFIX(Vertex2sv), @function
-GL_PREFIX(Vertex2sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2sv), .-GL_PREFIX(Vertex2sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3d)
- .type GL_PREFIX(Vertex3d), @function
-GL_PREFIX(Vertex3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1072(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3d), .-GL_PREFIX(Vertex3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3dv)
- .type GL_PREFIX(Vertex3dv), @function
-GL_PREFIX(Vertex3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3dv), .-GL_PREFIX(Vertex3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3f)
- .type GL_PREFIX(Vertex3f), @function
-GL_PREFIX(Vertex3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1088(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3f), .-GL_PREFIX(Vertex3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3fv)
- .type GL_PREFIX(Vertex3fv), @function
-GL_PREFIX(Vertex3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3fv), .-GL_PREFIX(Vertex3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3i)
- .type GL_PREFIX(Vertex3i), @function
-GL_PREFIX(Vertex3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3i), .-GL_PREFIX(Vertex3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3iv)
- .type GL_PREFIX(Vertex3iv), @function
-GL_PREFIX(Vertex3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3iv), .-GL_PREFIX(Vertex3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3s)
- .type GL_PREFIX(Vertex3s), @function
-GL_PREFIX(Vertex3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3s), .-GL_PREFIX(Vertex3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3sv)
- .type GL_PREFIX(Vertex3sv), @function
-GL_PREFIX(Vertex3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3sv), .-GL_PREFIX(Vertex3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4d)
- .type GL_PREFIX(Vertex4d), @function
-GL_PREFIX(Vertex4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1136(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4d), .-GL_PREFIX(Vertex4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4dv)
- .type GL_PREFIX(Vertex4dv), @function
-GL_PREFIX(Vertex4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4dv), .-GL_PREFIX(Vertex4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4f)
- .type GL_PREFIX(Vertex4f), @function
-GL_PREFIX(Vertex4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1152(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4f), .-GL_PREFIX(Vertex4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4fv)
- .type GL_PREFIX(Vertex4fv), @function
-GL_PREFIX(Vertex4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4fv), .-GL_PREFIX(Vertex4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4i)
- .type GL_PREFIX(Vertex4i), @function
-GL_PREFIX(Vertex4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4i), .-GL_PREFIX(Vertex4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4iv)
- .type GL_PREFIX(Vertex4iv), @function
-GL_PREFIX(Vertex4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4iv), .-GL_PREFIX(Vertex4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4s)
- .type GL_PREFIX(Vertex4s), @function
-GL_PREFIX(Vertex4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4s), .-GL_PREFIX(Vertex4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4sv)
- .type GL_PREFIX(Vertex4sv), @function
-GL_PREFIX(Vertex4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4sv), .-GL_PREFIX(Vertex4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClipPlane)
- .type GL_PREFIX(ClipPlane), @function
-GL_PREFIX(ClipPlane):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClipPlane), .-GL_PREFIX(ClipPlane)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorMaterial)
- .type GL_PREFIX(ColorMaterial), @function
-GL_PREFIX(ColorMaterial):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorMaterial), .-GL_PREFIX(ColorMaterial)
-
- .p2align 4,,15
- .globl GL_PREFIX(CullFace)
- .type GL_PREFIX(CullFace), @function
-GL_PREFIX(CullFace):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CullFace), .-GL_PREFIX(CullFace)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogf)
- .type GL_PREFIX(Fogf), @function
-GL_PREFIX(Fogf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1224(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogf), .-GL_PREFIX(Fogf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogfv)
- .type GL_PREFIX(Fogfv), @function
-GL_PREFIX(Fogfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogfv), .-GL_PREFIX(Fogfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogi)
- .type GL_PREFIX(Fogi), @function
-GL_PREFIX(Fogi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogi), .-GL_PREFIX(Fogi)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogiv)
- .type GL_PREFIX(Fogiv), @function
-GL_PREFIX(Fogiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogiv), .-GL_PREFIX(Fogiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(FrontFace)
- .type GL_PREFIX(FrontFace), @function
-GL_PREFIX(FrontFace):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FrontFace), .-GL_PREFIX(FrontFace)
-
- .p2align 4,,15
- .globl GL_PREFIX(Hint)
- .type GL_PREFIX(Hint), @function
-GL_PREFIX(Hint):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Hint), .-GL_PREFIX(Hint)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lightf)
- .type GL_PREFIX(Lightf), @function
-GL_PREFIX(Lightf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1272(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lightf), .-GL_PREFIX(Lightf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lightfv)
- .type GL_PREFIX(Lightfv), @function
-GL_PREFIX(Lightfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lightfv), .-GL_PREFIX(Lightfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lighti)
- .type GL_PREFIX(Lighti), @function
-GL_PREFIX(Lighti):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lighti), .-GL_PREFIX(Lighti)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lightiv)
- .type GL_PREFIX(Lightiv), @function
-GL_PREFIX(Lightiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lightiv), .-GL_PREFIX(Lightiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModelf)
- .type GL_PREFIX(LightModelf), @function
-GL_PREFIX(LightModelf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1304(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModelf), .-GL_PREFIX(LightModelf)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModelfv)
- .type GL_PREFIX(LightModelfv), @function
-GL_PREFIX(LightModelfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModelfv), .-GL_PREFIX(LightModelfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModeli)
- .type GL_PREFIX(LightModeli), @function
-GL_PREFIX(LightModeli):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModeli), .-GL_PREFIX(LightModeli)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModeliv)
- .type GL_PREFIX(LightModeliv), @function
-GL_PREFIX(LightModeliv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModeliv), .-GL_PREFIX(LightModeliv)
-
- .p2align 4,,15
- .globl GL_PREFIX(LineStipple)
- .type GL_PREFIX(LineStipple), @function
-GL_PREFIX(LineStipple):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LineStipple), .-GL_PREFIX(LineStipple)
-
- .p2align 4,,15
- .globl GL_PREFIX(LineWidth)
- .type GL_PREFIX(LineWidth), @function
-GL_PREFIX(LineWidth):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1344(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LineWidth), .-GL_PREFIX(LineWidth)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materialf)
- .type GL_PREFIX(Materialf), @function
-GL_PREFIX(Materialf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1352(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materialf), .-GL_PREFIX(Materialf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materialfv)
- .type GL_PREFIX(Materialfv), @function
-GL_PREFIX(Materialfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materialfv), .-GL_PREFIX(Materialfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materiali)
- .type GL_PREFIX(Materiali), @function
-GL_PREFIX(Materiali):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materiali), .-GL_PREFIX(Materiali)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materialiv)
- .type GL_PREFIX(Materialiv), @function
-GL_PREFIX(Materialiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materialiv), .-GL_PREFIX(Materialiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointSize)
- .type GL_PREFIX(PointSize), @function
-GL_PREFIX(PointSize):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1384(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointSize), .-GL_PREFIX(PointSize)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonMode)
- .type GL_PREFIX(PolygonMode), @function
-GL_PREFIX(PolygonMode):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonMode), .-GL_PREFIX(PolygonMode)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonStipple)
- .type GL_PREFIX(PolygonStipple), @function
-GL_PREFIX(PolygonStipple):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonStipple), .-GL_PREFIX(PolygonStipple)
-
- .p2align 4,,15
- .globl GL_PREFIX(Scissor)
- .type GL_PREFIX(Scissor), @function
-GL_PREFIX(Scissor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Scissor), .-GL_PREFIX(Scissor)
-
- .p2align 4,,15
- .globl GL_PREFIX(ShadeModel)
- .type GL_PREFIX(ShadeModel), @function
-GL_PREFIX(ShadeModel):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ShadeModel), .-GL_PREFIX(ShadeModel)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameterf)
- .type GL_PREFIX(TexParameterf), @function
-GL_PREFIX(TexParameterf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1424(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameterf), .-GL_PREFIX(TexParameterf)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameterfv)
- .type GL_PREFIX(TexParameterfv), @function
-GL_PREFIX(TexParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameterfv), .-GL_PREFIX(TexParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameteri)
- .type GL_PREFIX(TexParameteri), @function
-GL_PREFIX(TexParameteri):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameteri), .-GL_PREFIX(TexParameteri)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameteriv)
- .type GL_PREFIX(TexParameteriv), @function
-GL_PREFIX(TexParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameteriv), .-GL_PREFIX(TexParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage1D)
- .type GL_PREFIX(TexImage1D), @function
-GL_PREFIX(TexImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage1D), .-GL_PREFIX(TexImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage2D)
- .type GL_PREFIX(TexImage2D), @function
-GL_PREFIX(TexImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage2D), .-GL_PREFIX(TexImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnvf)
- .type GL_PREFIX(TexEnvf), @function
-GL_PREFIX(TexEnvf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1472(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnvf), .-GL_PREFIX(TexEnvf)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnvfv)
- .type GL_PREFIX(TexEnvfv), @function
-GL_PREFIX(TexEnvfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnvfv), .-GL_PREFIX(TexEnvfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnvi)
- .type GL_PREFIX(TexEnvi), @function
-GL_PREFIX(TexEnvi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnvi), .-GL_PREFIX(TexEnvi)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnviv)
- .type GL_PREFIX(TexEnviv), @function
-GL_PREFIX(TexEnviv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnviv), .-GL_PREFIX(TexEnviv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGend)
- .type GL_PREFIX(TexGend), @function
-GL_PREFIX(TexGend):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1504(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGend), .-GL_PREFIX(TexGend)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGendv)
- .type GL_PREFIX(TexGendv), @function
-GL_PREFIX(TexGendv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGendv), .-GL_PREFIX(TexGendv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGenf)
- .type GL_PREFIX(TexGenf), @function
-GL_PREFIX(TexGenf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1520(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGenf), .-GL_PREFIX(TexGenf)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGenfv)
- .type GL_PREFIX(TexGenfv), @function
-GL_PREFIX(TexGenfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGenfv), .-GL_PREFIX(TexGenfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGeni)
- .type GL_PREFIX(TexGeni), @function
-GL_PREFIX(TexGeni):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGeni), .-GL_PREFIX(TexGeni)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGeniv)
- .type GL_PREFIX(TexGeniv), @function
-GL_PREFIX(TexGeniv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGeniv), .-GL_PREFIX(TexGeniv)
-
- .p2align 4,,15
- .globl GL_PREFIX(FeedbackBuffer)
- .type GL_PREFIX(FeedbackBuffer), @function
-GL_PREFIX(FeedbackBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FeedbackBuffer), .-GL_PREFIX(FeedbackBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(SelectBuffer)
- .type GL_PREFIX(SelectBuffer), @function
-GL_PREFIX(SelectBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SelectBuffer), .-GL_PREFIX(SelectBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(RenderMode)
- .type GL_PREFIX(RenderMode), @function
-GL_PREFIX(RenderMode):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RenderMode), .-GL_PREFIX(RenderMode)
-
- .p2align 4,,15
- .globl GL_PREFIX(InitNames)
- .type GL_PREFIX(InitNames), @function
-GL_PREFIX(InitNames):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1576(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(InitNames), .-GL_PREFIX(InitNames)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadName)
- .type GL_PREFIX(LoadName), @function
-GL_PREFIX(LoadName):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadName), .-GL_PREFIX(LoadName)
-
- .p2align 4,,15
- .globl GL_PREFIX(PassThrough)
- .type GL_PREFIX(PassThrough), @function
-GL_PREFIX(PassThrough):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1592(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PassThrough), .-GL_PREFIX(PassThrough)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopName)
- .type GL_PREFIX(PopName), @function
-GL_PREFIX(PopName):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1600(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopName), .-GL_PREFIX(PopName)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushName)
- .type GL_PREFIX(PushName), @function
-GL_PREFIX(PushName):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushName), .-GL_PREFIX(PushName)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawBuffer)
- .type GL_PREFIX(DrawBuffer), @function
-GL_PREFIX(DrawBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawBuffer), .-GL_PREFIX(DrawBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(Clear)
- .type GL_PREFIX(Clear), @function
-GL_PREFIX(Clear):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Clear), .-GL_PREFIX(Clear)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearAccum)
- .type GL_PREFIX(ClearAccum), @function
-GL_PREFIX(ClearAccum):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1632(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearAccum), .-GL_PREFIX(ClearAccum)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearIndex)
- .type GL_PREFIX(ClearIndex), @function
-GL_PREFIX(ClearIndex):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1640(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearIndex), .-GL_PREFIX(ClearIndex)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearColor)
- .type GL_PREFIX(ClearColor), @function
-GL_PREFIX(ClearColor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearColor), .-GL_PREFIX(ClearColor)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearStencil)
- .type GL_PREFIX(ClearStencil), @function
-GL_PREFIX(ClearStencil):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearStencil), .-GL_PREFIX(ClearStencil)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearDepth)
- .type GL_PREFIX(ClearDepth), @function
-GL_PREFIX(ClearDepth):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearDepth), .-GL_PREFIX(ClearDepth)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilMask)
- .type GL_PREFIX(StencilMask), @function
-GL_PREFIX(StencilMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilMask), .-GL_PREFIX(StencilMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorMask)
- .type GL_PREFIX(ColorMask), @function
-GL_PREFIX(ColorMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorMask), .-GL_PREFIX(ColorMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthMask)
- .type GL_PREFIX(DepthMask), @function
-GL_PREFIX(DepthMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthMask), .-GL_PREFIX(DepthMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexMask)
- .type GL_PREFIX(IndexMask), @function
-GL_PREFIX(IndexMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexMask), .-GL_PREFIX(IndexMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(Accum)
- .type GL_PREFIX(Accum), @function
-GL_PREFIX(Accum):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1704(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Accum), .-GL_PREFIX(Accum)
-
- .p2align 4,,15
- .globl GL_PREFIX(Disable)
- .type GL_PREFIX(Disable), @function
-GL_PREFIX(Disable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Disable), .-GL_PREFIX(Disable)
-
- .p2align 4,,15
- .globl GL_PREFIX(Enable)
- .type GL_PREFIX(Enable), @function
-GL_PREFIX(Enable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Enable), .-GL_PREFIX(Enable)
-
- .p2align 4,,15
- .globl GL_PREFIX(Finish)
- .type GL_PREFIX(Finish), @function
-GL_PREFIX(Finish):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1728(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Finish), .-GL_PREFIX(Finish)
-
- .p2align 4,,15
- .globl GL_PREFIX(Flush)
- .type GL_PREFIX(Flush), @function
-GL_PREFIX(Flush):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1736(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Flush), .-GL_PREFIX(Flush)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopAttrib)
- .type GL_PREFIX(PopAttrib), @function
-GL_PREFIX(PopAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1744(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopAttrib), .-GL_PREFIX(PopAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushAttrib)
- .type GL_PREFIX(PushAttrib), @function
-GL_PREFIX(PushAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushAttrib), .-GL_PREFIX(PushAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map1d)
- .type GL_PREFIX(Map1d), @function
-GL_PREFIX(Map1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1760(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map1d), .-GL_PREFIX(Map1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map1f)
- .type GL_PREFIX(Map1f), @function
-GL_PREFIX(Map1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1768(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map1f), .-GL_PREFIX(Map1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map2d)
- .type GL_PREFIX(Map2d), @function
-GL_PREFIX(Map2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1776(%rax), %r11
- jmp *%r11
-1:
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _glapi_get_dispatch
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map2d), .-GL_PREFIX(Map2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map2f)
- .type GL_PREFIX(Map2f), @function
-GL_PREFIX(Map2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1784(%rax), %r11
- jmp *%r11
-1:
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _glapi_get_dispatch
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map2f), .-GL_PREFIX(Map2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid1d)
- .type GL_PREFIX(MapGrid1d), @function
-GL_PREFIX(MapGrid1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1792(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid1d), .-GL_PREFIX(MapGrid1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid1f)
- .type GL_PREFIX(MapGrid1f), @function
-GL_PREFIX(MapGrid1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1800(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid1f), .-GL_PREFIX(MapGrid1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid2d)
- .type GL_PREFIX(MapGrid2d), @function
-GL_PREFIX(MapGrid2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1808(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid2d), .-GL_PREFIX(MapGrid2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid2f)
- .type GL_PREFIX(MapGrid2f), @function
-GL_PREFIX(MapGrid2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1816(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid2f), .-GL_PREFIX(MapGrid2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1d)
- .type GL_PREFIX(EvalCoord1d), @function
-GL_PREFIX(EvalCoord1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1824(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1d), .-GL_PREFIX(EvalCoord1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1dv)
- .type GL_PREFIX(EvalCoord1dv), @function
-GL_PREFIX(EvalCoord1dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1dv), .-GL_PREFIX(EvalCoord1dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1f)
- .type GL_PREFIX(EvalCoord1f), @function
-GL_PREFIX(EvalCoord1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1840(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1f), .-GL_PREFIX(EvalCoord1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1fv)
- .type GL_PREFIX(EvalCoord1fv), @function
-GL_PREFIX(EvalCoord1fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1fv), .-GL_PREFIX(EvalCoord1fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2d)
- .type GL_PREFIX(EvalCoord2d), @function
-GL_PREFIX(EvalCoord2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1856(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2d), .-GL_PREFIX(EvalCoord2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2dv)
- .type GL_PREFIX(EvalCoord2dv), @function
-GL_PREFIX(EvalCoord2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2dv), .-GL_PREFIX(EvalCoord2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2f)
- .type GL_PREFIX(EvalCoord2f), @function
-GL_PREFIX(EvalCoord2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1872(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2f), .-GL_PREFIX(EvalCoord2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2fv)
- .type GL_PREFIX(EvalCoord2fv), @function
-GL_PREFIX(EvalCoord2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2fv), .-GL_PREFIX(EvalCoord2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalMesh1)
- .type GL_PREFIX(EvalMesh1), @function
-GL_PREFIX(EvalMesh1):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalMesh1), .-GL_PREFIX(EvalMesh1)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalPoint1)
- .type GL_PREFIX(EvalPoint1), @function
-GL_PREFIX(EvalPoint1):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalPoint1), .-GL_PREFIX(EvalPoint1)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalMesh2)
- .type GL_PREFIX(EvalMesh2), @function
-GL_PREFIX(EvalMesh2):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalMesh2), .-GL_PREFIX(EvalMesh2)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalPoint2)
- .type GL_PREFIX(EvalPoint2), @function
-GL_PREFIX(EvalPoint2):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalPoint2), .-GL_PREFIX(EvalPoint2)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFunc)
- .type GL_PREFIX(AlphaFunc), @function
-GL_PREFIX(AlphaFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFunc), .-GL_PREFIX(AlphaFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendFunc)
- .type GL_PREFIX(BlendFunc), @function
-GL_PREFIX(BlendFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendFunc), .-GL_PREFIX(BlendFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(LogicOp)
- .type GL_PREFIX(LogicOp), @function
-GL_PREFIX(LogicOp):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LogicOp), .-GL_PREFIX(LogicOp)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilFunc)
- .type GL_PREFIX(StencilFunc), @function
-GL_PREFIX(StencilFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilFunc), .-GL_PREFIX(StencilFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilOp)
- .type GL_PREFIX(StencilOp), @function
-GL_PREFIX(StencilOp):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilOp), .-GL_PREFIX(StencilOp)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthFunc)
- .type GL_PREFIX(DepthFunc), @function
-GL_PREFIX(DepthFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthFunc), .-GL_PREFIX(DepthFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelZoom)
- .type GL_PREFIX(PixelZoom), @function
-GL_PREFIX(PixelZoom):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1968(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelZoom), .-GL_PREFIX(PixelZoom)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTransferf)
- .type GL_PREFIX(PixelTransferf), @function
-GL_PREFIX(PixelTransferf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1976(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTransferf), .-GL_PREFIX(PixelTransferf)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTransferi)
- .type GL_PREFIX(PixelTransferi), @function
-GL_PREFIX(PixelTransferi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTransferi), .-GL_PREFIX(PixelTransferi)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelStoref)
- .type GL_PREFIX(PixelStoref), @function
-GL_PREFIX(PixelStoref):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1992(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelStoref), .-GL_PREFIX(PixelStoref)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelStorei)
- .type GL_PREFIX(PixelStorei), @function
-GL_PREFIX(PixelStorei):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelStorei), .-GL_PREFIX(PixelStorei)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelMapfv)
- .type GL_PREFIX(PixelMapfv), @function
-GL_PREFIX(PixelMapfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelMapfv), .-GL_PREFIX(PixelMapfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelMapuiv)
- .type GL_PREFIX(PixelMapuiv), @function
-GL_PREFIX(PixelMapuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelMapuiv), .-GL_PREFIX(PixelMapuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelMapusv)
- .type GL_PREFIX(PixelMapusv), @function
-GL_PREFIX(PixelMapusv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelMapusv), .-GL_PREFIX(PixelMapusv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReadBuffer)
- .type GL_PREFIX(ReadBuffer), @function
-GL_PREFIX(ReadBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReadBuffer), .-GL_PREFIX(ReadBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyPixels)
- .type GL_PREFIX(CopyPixels), @function
-GL_PREFIX(CopyPixels):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyPixels), .-GL_PREFIX(CopyPixels)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReadPixels)
- .type GL_PREFIX(ReadPixels), @function
-GL_PREFIX(ReadPixels):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReadPixels), .-GL_PREFIX(ReadPixels)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawPixels)
- .type GL_PREFIX(DrawPixels), @function
-GL_PREFIX(DrawPixels):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawPixels), .-GL_PREFIX(DrawPixels)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBooleanv)
- .type GL_PREFIX(GetBooleanv), @function
-GL_PREFIX(GetBooleanv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBooleanv), .-GL_PREFIX(GetBooleanv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetClipPlane)
- .type GL_PREFIX(GetClipPlane), @function
-GL_PREFIX(GetClipPlane):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetClipPlane), .-GL_PREFIX(GetClipPlane)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetDoublev)
- .type GL_PREFIX(GetDoublev), @function
-GL_PREFIX(GetDoublev):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetDoublev), .-GL_PREFIX(GetDoublev)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetError)
- .type GL_PREFIX(GetError), @function
-GL_PREFIX(GetError):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2088(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetError), .-GL_PREFIX(GetError)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFloatv)
- .type GL_PREFIX(GetFloatv), @function
-GL_PREFIX(GetFloatv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFloatv), .-GL_PREFIX(GetFloatv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetIntegerv)
- .type GL_PREFIX(GetIntegerv), @function
-GL_PREFIX(GetIntegerv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetIntegerv), .-GL_PREFIX(GetIntegerv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetLightfv)
- .type GL_PREFIX(GetLightfv), @function
-GL_PREFIX(GetLightfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetLightfv), .-GL_PREFIX(GetLightfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetLightiv)
- .type GL_PREFIX(GetLightiv), @function
-GL_PREFIX(GetLightiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetLightiv), .-GL_PREFIX(GetLightiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMapdv)
- .type GL_PREFIX(GetMapdv), @function
-GL_PREFIX(GetMapdv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMapdv), .-GL_PREFIX(GetMapdv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMapfv)
- .type GL_PREFIX(GetMapfv), @function
-GL_PREFIX(GetMapfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMapfv), .-GL_PREFIX(GetMapfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMapiv)
- .type GL_PREFIX(GetMapiv), @function
-GL_PREFIX(GetMapiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMapiv), .-GL_PREFIX(GetMapiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMaterialfv)
- .type GL_PREFIX(GetMaterialfv), @function
-GL_PREFIX(GetMaterialfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMaterialfv), .-GL_PREFIX(GetMaterialfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMaterialiv)
- .type GL_PREFIX(GetMaterialiv), @function
-GL_PREFIX(GetMaterialiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMaterialiv), .-GL_PREFIX(GetMaterialiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelMapfv)
- .type GL_PREFIX(GetPixelMapfv), @function
-GL_PREFIX(GetPixelMapfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelMapfv), .-GL_PREFIX(GetPixelMapfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelMapuiv)
- .type GL_PREFIX(GetPixelMapuiv), @function
-GL_PREFIX(GetPixelMapuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelMapuiv), .-GL_PREFIX(GetPixelMapuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelMapusv)
- .type GL_PREFIX(GetPixelMapusv), @function
-GL_PREFIX(GetPixelMapusv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelMapusv), .-GL_PREFIX(GetPixelMapusv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPolygonStipple)
- .type GL_PREFIX(GetPolygonStipple), @function
-GL_PREFIX(GetPolygonStipple):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPolygonStipple), .-GL_PREFIX(GetPolygonStipple)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetString)
- .type GL_PREFIX(GetString), @function
-GL_PREFIX(GetString):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetString), .-GL_PREFIX(GetString)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexEnvfv)
- .type GL_PREFIX(GetTexEnvfv), @function
-GL_PREFIX(GetTexEnvfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexEnvfv), .-GL_PREFIX(GetTexEnvfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexEnviv)
- .type GL_PREFIX(GetTexEnviv), @function
-GL_PREFIX(GetTexEnviv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexEnviv), .-GL_PREFIX(GetTexEnviv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexGendv)
- .type GL_PREFIX(GetTexGendv), @function
-GL_PREFIX(GetTexGendv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexGendv), .-GL_PREFIX(GetTexGendv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexGenfv)
- .type GL_PREFIX(GetTexGenfv), @function
-GL_PREFIX(GetTexGenfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexGenfv), .-GL_PREFIX(GetTexGenfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexGeniv)
- .type GL_PREFIX(GetTexGeniv), @function
-GL_PREFIX(GetTexGeniv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexGeniv), .-GL_PREFIX(GetTexGeniv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexImage)
- .type GL_PREFIX(GetTexImage), @function
-GL_PREFIX(GetTexImage):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexImage), .-GL_PREFIX(GetTexImage)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexParameterfv)
- .type GL_PREFIX(GetTexParameterfv), @function
-GL_PREFIX(GetTexParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexParameterfv), .-GL_PREFIX(GetTexParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexParameteriv)
- .type GL_PREFIX(GetTexParameteriv), @function
-GL_PREFIX(GetTexParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexParameteriv), .-GL_PREFIX(GetTexParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexLevelParameterfv)
- .type GL_PREFIX(GetTexLevelParameterfv), @function
-GL_PREFIX(GetTexLevelParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexLevelParameterfv), .-GL_PREFIX(GetTexLevelParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexLevelParameteriv)
- .type GL_PREFIX(GetTexLevelParameteriv), @function
-GL_PREFIX(GetTexLevelParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexLevelParameteriv), .-GL_PREFIX(GetTexLevelParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsEnabled)
- .type GL_PREFIX(IsEnabled), @function
-GL_PREFIX(IsEnabled):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsEnabled), .-GL_PREFIX(IsEnabled)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsList)
- .type GL_PREFIX(IsList), @function
-GL_PREFIX(IsList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsList), .-GL_PREFIX(IsList)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthRange)
- .type GL_PREFIX(DepthRange), @function
-GL_PREFIX(DepthRange):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthRange), .-GL_PREFIX(DepthRange)
-
- .p2align 4,,15
- .globl GL_PREFIX(Frustum)
- .type GL_PREFIX(Frustum), @function
-GL_PREFIX(Frustum):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2312(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Frustum), .-GL_PREFIX(Frustum)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadIdentity)
- .type GL_PREFIX(LoadIdentity), @function
-GL_PREFIX(LoadIdentity):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2320(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadIdentity), .-GL_PREFIX(LoadIdentity)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadMatrixf)
- .type GL_PREFIX(LoadMatrixf), @function
-GL_PREFIX(LoadMatrixf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadMatrixf), .-GL_PREFIX(LoadMatrixf)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadMatrixd)
- .type GL_PREFIX(LoadMatrixd), @function
-GL_PREFIX(LoadMatrixd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadMatrixd), .-GL_PREFIX(LoadMatrixd)
-
- .p2align 4,,15
- .globl GL_PREFIX(MatrixMode)
- .type GL_PREFIX(MatrixMode), @function
-GL_PREFIX(MatrixMode):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MatrixMode), .-GL_PREFIX(MatrixMode)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultMatrixf)
- .type GL_PREFIX(MultMatrixf), @function
-GL_PREFIX(MultMatrixf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultMatrixf), .-GL_PREFIX(MultMatrixf)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultMatrixd)
- .type GL_PREFIX(MultMatrixd), @function
-GL_PREFIX(MultMatrixd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultMatrixd), .-GL_PREFIX(MultMatrixd)
-
- .p2align 4,,15
- .globl GL_PREFIX(Ortho)
- .type GL_PREFIX(Ortho), @function
-GL_PREFIX(Ortho):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2368(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Ortho), .-GL_PREFIX(Ortho)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopMatrix)
- .type GL_PREFIX(PopMatrix), @function
-GL_PREFIX(PopMatrix):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2376(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopMatrix), .-GL_PREFIX(PopMatrix)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushMatrix)
- .type GL_PREFIX(PushMatrix), @function
-GL_PREFIX(PushMatrix):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2384(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushMatrix), .-GL_PREFIX(PushMatrix)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rotated)
- .type GL_PREFIX(Rotated), @function
-GL_PREFIX(Rotated):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2392(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rotated), .-GL_PREFIX(Rotated)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rotatef)
- .type GL_PREFIX(Rotatef), @function
-GL_PREFIX(Rotatef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2400(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rotatef), .-GL_PREFIX(Rotatef)
-
- .p2align 4,,15
- .globl GL_PREFIX(Scaled)
- .type GL_PREFIX(Scaled), @function
-GL_PREFIX(Scaled):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2408(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Scaled), .-GL_PREFIX(Scaled)
-
- .p2align 4,,15
- .globl GL_PREFIX(Scalef)
- .type GL_PREFIX(Scalef), @function
-GL_PREFIX(Scalef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2416(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Scalef), .-GL_PREFIX(Scalef)
-
- .p2align 4,,15
- .globl GL_PREFIX(Translated)
- .type GL_PREFIX(Translated), @function
-GL_PREFIX(Translated):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2424(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Translated), .-GL_PREFIX(Translated)
-
- .p2align 4,,15
- .globl GL_PREFIX(Translatef)
- .type GL_PREFIX(Translatef), @function
-GL_PREFIX(Translatef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2432(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Translatef), .-GL_PREFIX(Translatef)
-
- .p2align 4,,15
- .globl GL_PREFIX(Viewport)
- .type GL_PREFIX(Viewport), @function
-GL_PREFIX(Viewport):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Viewport), .-GL_PREFIX(Viewport)
-
- .p2align 4,,15
- .globl GL_PREFIX(ArrayElement)
- .type GL_PREFIX(ArrayElement), @function
-GL_PREFIX(ArrayElement):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ArrayElement), .-GL_PREFIX(ArrayElement)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindTexture)
- .type GL_PREFIX(BindTexture), @function
-GL_PREFIX(BindTexture):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindTexture), .-GL_PREFIX(BindTexture)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorPointer)
- .type GL_PREFIX(ColorPointer), @function
-GL_PREFIX(ColorPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorPointer), .-GL_PREFIX(ColorPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(DisableClientState)
- .type GL_PREFIX(DisableClientState), @function
-GL_PREFIX(DisableClientState):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DisableClientState), .-GL_PREFIX(DisableClientState)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawArrays)
- .type GL_PREFIX(DrawArrays), @function
-GL_PREFIX(DrawArrays):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawArrays), .-GL_PREFIX(DrawArrays)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawElements)
- .type GL_PREFIX(DrawElements), @function
-GL_PREFIX(DrawElements):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawElements), .-GL_PREFIX(DrawElements)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlagPointer)
- .type GL_PREFIX(EdgeFlagPointer), @function
-GL_PREFIX(EdgeFlagPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlagPointer), .-GL_PREFIX(EdgeFlagPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(EnableClientState)
- .type GL_PREFIX(EnableClientState), @function
-GL_PREFIX(EnableClientState):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EnableClientState), .-GL_PREFIX(EnableClientState)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexPointer)
- .type GL_PREFIX(IndexPointer), @function
-GL_PREFIX(IndexPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexPointer), .-GL_PREFIX(IndexPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexub)
- .type GL_PREFIX(Indexub), @function
-GL_PREFIX(Indexub):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexub), .-GL_PREFIX(Indexub)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexubv)
- .type GL_PREFIX(Indexubv), @function
-GL_PREFIX(Indexubv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexubv), .-GL_PREFIX(Indexubv)
-
- .p2align 4,,15
- .globl GL_PREFIX(InterleavedArrays)
- .type GL_PREFIX(InterleavedArrays), @function
-GL_PREFIX(InterleavedArrays):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(InterleavedArrays), .-GL_PREFIX(InterleavedArrays)
-
- .p2align 4,,15
- .globl GL_PREFIX(NormalPointer)
- .type GL_PREFIX(NormalPointer), @function
-GL_PREFIX(NormalPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(NormalPointer), .-GL_PREFIX(NormalPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonOffset)
- .type GL_PREFIX(PolygonOffset), @function
-GL_PREFIX(PolygonOffset):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2552(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonOffset), .-GL_PREFIX(PolygonOffset)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoordPointer)
- .type GL_PREFIX(TexCoordPointer), @function
-GL_PREFIX(TexCoordPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoordPointer), .-GL_PREFIX(TexCoordPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexPointer)
- .type GL_PREFIX(VertexPointer), @function
-GL_PREFIX(VertexPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexPointer), .-GL_PREFIX(VertexPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(AreTexturesResident)
- .type GL_PREFIX(AreTexturesResident), @function
-GL_PREFIX(AreTexturesResident):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AreTexturesResident), .-GL_PREFIX(AreTexturesResident)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexImage1D)
- .type GL_PREFIX(CopyTexImage1D), @function
-GL_PREFIX(CopyTexImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexImage1D), .-GL_PREFIX(CopyTexImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexImage2D)
- .type GL_PREFIX(CopyTexImage2D), @function
-GL_PREFIX(CopyTexImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexImage2D), .-GL_PREFIX(CopyTexImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexSubImage1D)
- .type GL_PREFIX(CopyTexSubImage1D), @function
-GL_PREFIX(CopyTexSubImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexSubImage1D), .-GL_PREFIX(CopyTexSubImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexSubImage2D)
- .type GL_PREFIX(CopyTexSubImage2D), @function
-GL_PREFIX(CopyTexSubImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexSubImage2D), .-GL_PREFIX(CopyTexSubImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteTextures)
- .type GL_PREFIX(DeleteTextures), @function
-GL_PREFIX(DeleteTextures):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteTextures), .-GL_PREFIX(DeleteTextures)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenTextures)
- .type GL_PREFIX(GenTextures), @function
-GL_PREFIX(GenTextures):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenTextures), .-GL_PREFIX(GenTextures)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPointerv)
- .type GL_PREFIX(GetPointerv), @function
-GL_PREFIX(GetPointerv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPointerv), .-GL_PREFIX(GetPointerv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsTexture)
- .type GL_PREFIX(IsTexture), @function
-GL_PREFIX(IsTexture):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsTexture), .-GL_PREFIX(IsTexture)
-
- .p2align 4,,15
- .globl GL_PREFIX(PrioritizeTextures)
- .type GL_PREFIX(PrioritizeTextures), @function
-GL_PREFIX(PrioritizeTextures):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PrioritizeTextures), .-GL_PREFIX(PrioritizeTextures)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage1D)
- .type GL_PREFIX(TexSubImage1D), @function
-GL_PREFIX(TexSubImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage1D), .-GL_PREFIX(TexSubImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage2D)
- .type GL_PREFIX(TexSubImage2D), @function
-GL_PREFIX(TexSubImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage2D), .-GL_PREFIX(TexSubImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopClientAttrib)
- .type GL_PREFIX(PopClientAttrib), @function
-GL_PREFIX(PopClientAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2672(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopClientAttrib), .-GL_PREFIX(PopClientAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushClientAttrib)
- .type GL_PREFIX(PushClientAttrib), @function
-GL_PREFIX(PushClientAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushClientAttrib), .-GL_PREFIX(PushClientAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendColor)
- .type GL_PREFIX(BlendColor), @function
-GL_PREFIX(BlendColor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendColor), .-GL_PREFIX(BlendColor)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendEquation)
- .type GL_PREFIX(BlendEquation), @function
-GL_PREFIX(BlendEquation):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendEquation), .-GL_PREFIX(BlendEquation)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawRangeElements)
- .type GL_PREFIX(DrawRangeElements), @function
-GL_PREFIX(DrawRangeElements):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawRangeElements), .-GL_PREFIX(DrawRangeElements)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorTable)
- .type GL_PREFIX(ColorTable), @function
-GL_PREFIX(ColorTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorTable), .-GL_PREFIX(ColorTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorTableParameterfv)
- .type GL_PREFIX(ColorTableParameterfv), @function
-GL_PREFIX(ColorTableParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorTableParameterfv), .-GL_PREFIX(ColorTableParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorTableParameteriv)
- .type GL_PREFIX(ColorTableParameteriv), @function
-GL_PREFIX(ColorTableParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorTableParameteriv), .-GL_PREFIX(ColorTableParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyColorTable)
- .type GL_PREFIX(CopyColorTable), @function
-GL_PREFIX(CopyColorTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyColorTable), .-GL_PREFIX(CopyColorTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTable)
- .type GL_PREFIX(GetColorTable), @function
-GL_PREFIX(GetColorTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTable), .-GL_PREFIX(GetColorTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameterfv)
- .type GL_PREFIX(GetColorTableParameterfv), @function
-GL_PREFIX(GetColorTableParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameterfv), .-GL_PREFIX(GetColorTableParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameteriv)
- .type GL_PREFIX(GetColorTableParameteriv), @function
-GL_PREFIX(GetColorTableParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameteriv), .-GL_PREFIX(GetColorTableParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorSubTable)
- .type GL_PREFIX(ColorSubTable), @function
-GL_PREFIX(ColorSubTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorSubTable), .-GL_PREFIX(ColorSubTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyColorSubTable)
- .type GL_PREFIX(CopyColorSubTable), @function
-GL_PREFIX(CopyColorSubTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyColorSubTable), .-GL_PREFIX(CopyColorSubTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionFilter1D)
- .type GL_PREFIX(ConvolutionFilter1D), @function
-GL_PREFIX(ConvolutionFilter1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionFilter1D), .-GL_PREFIX(ConvolutionFilter1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionFilter2D)
- .type GL_PREFIX(ConvolutionFilter2D), @function
-GL_PREFIX(ConvolutionFilter2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionFilter2D), .-GL_PREFIX(ConvolutionFilter2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameterf)
- .type GL_PREFIX(ConvolutionParameterf), @function
-GL_PREFIX(ConvolutionParameterf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 2800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2800(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 2800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameterf), .-GL_PREFIX(ConvolutionParameterf)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameterfv)
- .type GL_PREFIX(ConvolutionParameterfv), @function
-GL_PREFIX(ConvolutionParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameterfv), .-GL_PREFIX(ConvolutionParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameteri)
- .type GL_PREFIX(ConvolutionParameteri), @function
-GL_PREFIX(ConvolutionParameteri):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameteri), .-GL_PREFIX(ConvolutionParameteri)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameteriv)
- .type GL_PREFIX(ConvolutionParameteriv), @function
-GL_PREFIX(ConvolutionParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameteriv), .-GL_PREFIX(ConvolutionParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyConvolutionFilter1D)
- .type GL_PREFIX(CopyConvolutionFilter1D), @function
-GL_PREFIX(CopyConvolutionFilter1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyConvolutionFilter1D), .-GL_PREFIX(CopyConvolutionFilter1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyConvolutionFilter2D)
- .type GL_PREFIX(CopyConvolutionFilter2D), @function
-GL_PREFIX(CopyConvolutionFilter2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyConvolutionFilter2D), .-GL_PREFIX(CopyConvolutionFilter2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionFilter)
- .type GL_PREFIX(GetConvolutionFilter), @function
-GL_PREFIX(GetConvolutionFilter):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionFilter), .-GL_PREFIX(GetConvolutionFilter)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionParameterfv)
- .type GL_PREFIX(GetConvolutionParameterfv), @function
-GL_PREFIX(GetConvolutionParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionParameterfv), .-GL_PREFIX(GetConvolutionParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionParameteriv)
- .type GL_PREFIX(GetConvolutionParameteriv), @function
-GL_PREFIX(GetConvolutionParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionParameteriv), .-GL_PREFIX(GetConvolutionParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSeparableFilter)
- .type GL_PREFIX(GetSeparableFilter), @function
-GL_PREFIX(GetSeparableFilter):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSeparableFilter), .-GL_PREFIX(GetSeparableFilter)
-
- .p2align 4,,15
- .globl GL_PREFIX(SeparableFilter2D)
- .type GL_PREFIX(SeparableFilter2D), @function
-GL_PREFIX(SeparableFilter2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SeparableFilter2D), .-GL_PREFIX(SeparableFilter2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogram)
- .type GL_PREFIX(GetHistogram), @function
-GL_PREFIX(GetHistogram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogram), .-GL_PREFIX(GetHistogram)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramParameterfv)
- .type GL_PREFIX(GetHistogramParameterfv), @function
-GL_PREFIX(GetHistogramParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramParameterfv), .-GL_PREFIX(GetHistogramParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramParameteriv)
- .type GL_PREFIX(GetHistogramParameteriv), @function
-GL_PREFIX(GetHistogramParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramParameteriv), .-GL_PREFIX(GetHistogramParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmax)
- .type GL_PREFIX(GetMinmax), @function
-GL_PREFIX(GetMinmax):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmax), .-GL_PREFIX(GetMinmax)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxParameterfv)
- .type GL_PREFIX(GetMinmaxParameterfv), @function
-GL_PREFIX(GetMinmaxParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxParameterfv), .-GL_PREFIX(GetMinmaxParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxParameteriv)
- .type GL_PREFIX(GetMinmaxParameteriv), @function
-GL_PREFIX(GetMinmaxParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxParameteriv), .-GL_PREFIX(GetMinmaxParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Histogram)
- .type GL_PREFIX(Histogram), @function
-GL_PREFIX(Histogram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Histogram), .-GL_PREFIX(Histogram)
-
- .p2align 4,,15
- .globl GL_PREFIX(Minmax)
- .type GL_PREFIX(Minmax), @function
-GL_PREFIX(Minmax):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Minmax), .-GL_PREFIX(Minmax)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResetHistogram)
- .type GL_PREFIX(ResetHistogram), @function
-GL_PREFIX(ResetHistogram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResetHistogram), .-GL_PREFIX(ResetHistogram)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResetMinmax)
- .type GL_PREFIX(ResetMinmax), @function
-GL_PREFIX(ResetMinmax):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResetMinmax), .-GL_PREFIX(ResetMinmax)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage3D)
- .type GL_PREFIX(TexImage3D), @function
-GL_PREFIX(TexImage3D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage3D), .-GL_PREFIX(TexImage3D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage3D)
- .type GL_PREFIX(TexSubImage3D), @function
-GL_PREFIX(TexSubImage3D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage3D), .-GL_PREFIX(TexSubImage3D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexSubImage3D)
- .type GL_PREFIX(CopyTexSubImage3D), @function
-GL_PREFIX(CopyTexSubImage3D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexSubImage3D), .-GL_PREFIX(CopyTexSubImage3D)
-
- .p2align 4,,15
- .globl GL_PREFIX(ActiveTextureARB)
- .type GL_PREFIX(ActiveTextureARB), @function
-GL_PREFIX(ActiveTextureARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ActiveTextureARB), .-GL_PREFIX(ActiveTextureARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClientActiveTextureARB)
- .type GL_PREFIX(ClientActiveTextureARB), @function
-GL_PREFIX(ClientActiveTextureARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClientActiveTextureARB), .-GL_PREFIX(ClientActiveTextureARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1dARB)
- .type GL_PREFIX(MultiTexCoord1dARB), @function
-GL_PREFIX(MultiTexCoord1dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3008(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1dARB), .-GL_PREFIX(MultiTexCoord1dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1dvARB)
- .type GL_PREFIX(MultiTexCoord1dvARB), @function
-GL_PREFIX(MultiTexCoord1dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1dvARB), .-GL_PREFIX(MultiTexCoord1dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1fARB)
- .type GL_PREFIX(MultiTexCoord1fARB), @function
-GL_PREFIX(MultiTexCoord1fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3024(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1fARB), .-GL_PREFIX(MultiTexCoord1fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1fvARB)
- .type GL_PREFIX(MultiTexCoord1fvARB), @function
-GL_PREFIX(MultiTexCoord1fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1fvARB), .-GL_PREFIX(MultiTexCoord1fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1iARB)
- .type GL_PREFIX(MultiTexCoord1iARB), @function
-GL_PREFIX(MultiTexCoord1iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1iARB), .-GL_PREFIX(MultiTexCoord1iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1ivARB)
- .type GL_PREFIX(MultiTexCoord1ivARB), @function
-GL_PREFIX(MultiTexCoord1ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1ivARB), .-GL_PREFIX(MultiTexCoord1ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1sARB)
- .type GL_PREFIX(MultiTexCoord1sARB), @function
-GL_PREFIX(MultiTexCoord1sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1sARB), .-GL_PREFIX(MultiTexCoord1sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1svARB)
- .type GL_PREFIX(MultiTexCoord1svARB), @function
-GL_PREFIX(MultiTexCoord1svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1svARB), .-GL_PREFIX(MultiTexCoord1svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2dARB)
- .type GL_PREFIX(MultiTexCoord2dARB), @function
-GL_PREFIX(MultiTexCoord2dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3072(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2dARB), .-GL_PREFIX(MultiTexCoord2dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2dvARB)
- .type GL_PREFIX(MultiTexCoord2dvARB), @function
-GL_PREFIX(MultiTexCoord2dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2dvARB), .-GL_PREFIX(MultiTexCoord2dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2fARB)
- .type GL_PREFIX(MultiTexCoord2fARB), @function
-GL_PREFIX(MultiTexCoord2fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3088(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2fARB), .-GL_PREFIX(MultiTexCoord2fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2fvARB)
- .type GL_PREFIX(MultiTexCoord2fvARB), @function
-GL_PREFIX(MultiTexCoord2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2fvARB), .-GL_PREFIX(MultiTexCoord2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2iARB)
- .type GL_PREFIX(MultiTexCoord2iARB), @function
-GL_PREFIX(MultiTexCoord2iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2iARB), .-GL_PREFIX(MultiTexCoord2iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2ivARB)
- .type GL_PREFIX(MultiTexCoord2ivARB), @function
-GL_PREFIX(MultiTexCoord2ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2ivARB), .-GL_PREFIX(MultiTexCoord2ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2sARB)
- .type GL_PREFIX(MultiTexCoord2sARB), @function
-GL_PREFIX(MultiTexCoord2sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2sARB), .-GL_PREFIX(MultiTexCoord2sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2svARB)
- .type GL_PREFIX(MultiTexCoord2svARB), @function
-GL_PREFIX(MultiTexCoord2svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2svARB), .-GL_PREFIX(MultiTexCoord2svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3dARB)
- .type GL_PREFIX(MultiTexCoord3dARB), @function
-GL_PREFIX(MultiTexCoord3dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3136(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3dARB), .-GL_PREFIX(MultiTexCoord3dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3dvARB)
- .type GL_PREFIX(MultiTexCoord3dvARB), @function
-GL_PREFIX(MultiTexCoord3dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3dvARB), .-GL_PREFIX(MultiTexCoord3dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3fARB)
- .type GL_PREFIX(MultiTexCoord3fARB), @function
-GL_PREFIX(MultiTexCoord3fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3152(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3fARB), .-GL_PREFIX(MultiTexCoord3fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3fvARB)
- .type GL_PREFIX(MultiTexCoord3fvARB), @function
-GL_PREFIX(MultiTexCoord3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3fvARB), .-GL_PREFIX(MultiTexCoord3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3iARB)
- .type GL_PREFIX(MultiTexCoord3iARB), @function
-GL_PREFIX(MultiTexCoord3iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3iARB), .-GL_PREFIX(MultiTexCoord3iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3ivARB)
- .type GL_PREFIX(MultiTexCoord3ivARB), @function
-GL_PREFIX(MultiTexCoord3ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3ivARB), .-GL_PREFIX(MultiTexCoord3ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3sARB)
- .type GL_PREFIX(MultiTexCoord3sARB), @function
-GL_PREFIX(MultiTexCoord3sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3sARB), .-GL_PREFIX(MultiTexCoord3sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3svARB)
- .type GL_PREFIX(MultiTexCoord3svARB), @function
-GL_PREFIX(MultiTexCoord3svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3svARB), .-GL_PREFIX(MultiTexCoord3svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4dARB)
- .type GL_PREFIX(MultiTexCoord4dARB), @function
-GL_PREFIX(MultiTexCoord4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3200(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4dARB), .-GL_PREFIX(MultiTexCoord4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4dvARB)
- .type GL_PREFIX(MultiTexCoord4dvARB), @function
-GL_PREFIX(MultiTexCoord4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4dvARB), .-GL_PREFIX(MultiTexCoord4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4fARB)
- .type GL_PREFIX(MultiTexCoord4fARB), @function
-GL_PREFIX(MultiTexCoord4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3216(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4fARB), .-GL_PREFIX(MultiTexCoord4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4fvARB)
- .type GL_PREFIX(MultiTexCoord4fvARB), @function
-GL_PREFIX(MultiTexCoord4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4fvARB), .-GL_PREFIX(MultiTexCoord4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4iARB)
- .type GL_PREFIX(MultiTexCoord4iARB), @function
-GL_PREFIX(MultiTexCoord4iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4iARB), .-GL_PREFIX(MultiTexCoord4iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4ivARB)
- .type GL_PREFIX(MultiTexCoord4ivARB), @function
-GL_PREFIX(MultiTexCoord4ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4ivARB), .-GL_PREFIX(MultiTexCoord4ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4sARB)
- .type GL_PREFIX(MultiTexCoord4sARB), @function
-GL_PREFIX(MultiTexCoord4sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4sARB), .-GL_PREFIX(MultiTexCoord4sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4svARB)
- .type GL_PREFIX(MultiTexCoord4svARB), @function
-GL_PREFIX(MultiTexCoord4svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadTransposeMatrixfARB)
- .type GL_PREFIX(LoadTransposeMatrixfARB), @function
-GL_PREFIX(LoadTransposeMatrixfARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadTransposeMatrixdARB)
- .type GL_PREFIX(LoadTransposeMatrixdARB), @function
-GL_PREFIX(LoadTransposeMatrixdARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultTransposeMatrixfARB)
- .type GL_PREFIX(MultTransposeMatrixfARB), @function
-GL_PREFIX(MultTransposeMatrixfARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultTransposeMatrixdARB)
- .type GL_PREFIX(MultTransposeMatrixdARB), @function
-GL_PREFIX(MultTransposeMatrixdARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(SampleCoverageARB)
- .type GL_PREFIX(SampleCoverageARB), @function
-GL_PREFIX(SampleCoverageARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawBuffersARB)
- .type GL_PREFIX(DrawBuffersARB), @function
-GL_PREFIX(DrawBuffersARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonOffsetEXT)
- .type GL_PREFIX(PolygonOffsetEXT), @function
-GL_PREFIX(PolygonOffsetEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 3312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3312(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 3312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexFilterFuncSGIS)
- .type GL_PREFIX(GetTexFilterFuncSGIS), @function
-GL_PREFIX(GetTexFilterFuncSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexFilterFuncSGIS), .-GL_PREFIX(GetTexFilterFuncSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexFilterFuncSGIS)
- .type GL_PREFIX(TexFilterFuncSGIS), @function
-GL_PREFIX(TexFilterFuncSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexFilterFuncSGIS), .-GL_PREFIX(TexFilterFuncSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramEXT)
- .type GL_PREFIX(GetHistogramEXT), @function
-GL_PREFIX(GetHistogramEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramEXT), .-GL_PREFIX(GetHistogramEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramParameterfvEXT)
- .type GL_PREFIX(GetHistogramParameterfvEXT), @function
-GL_PREFIX(GetHistogramParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramParameterfvEXT), .-GL_PREFIX(GetHistogramParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramParameterivEXT)
- .type GL_PREFIX(GetHistogramParameterivEXT), @function
-GL_PREFIX(GetHistogramParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramParameterivEXT), .-GL_PREFIX(GetHistogramParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxEXT)
- .type GL_PREFIX(GetMinmaxEXT), @function
-GL_PREFIX(GetMinmaxEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxEXT), .-GL_PREFIX(GetMinmaxEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxParameterfvEXT)
- .type GL_PREFIX(GetMinmaxParameterfvEXT), @function
-GL_PREFIX(GetMinmaxParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxParameterfvEXT), .-GL_PREFIX(GetMinmaxParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxParameterivEXT)
- .type GL_PREFIX(GetMinmaxParameterivEXT), @function
-GL_PREFIX(GetMinmaxParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxParameterivEXT), .-GL_PREFIX(GetMinmaxParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionFilterEXT)
- .type GL_PREFIX(GetConvolutionFilterEXT), @function
-GL_PREFIX(GetConvolutionFilterEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionFilterEXT), .-GL_PREFIX(GetConvolutionFilterEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionParameterfvEXT)
- .type GL_PREFIX(GetConvolutionParameterfvEXT), @function
-GL_PREFIX(GetConvolutionParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionParameterfvEXT), .-GL_PREFIX(GetConvolutionParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionParameterivEXT)
- .type GL_PREFIX(GetConvolutionParameterivEXT), @function
-GL_PREFIX(GetConvolutionParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionParameterivEXT), .-GL_PREFIX(GetConvolutionParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSeparableFilterEXT)
- .type GL_PREFIX(GetSeparableFilterEXT), @function
-GL_PREFIX(GetSeparableFilterEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSeparableFilterEXT), .-GL_PREFIX(GetSeparableFilterEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableSGI)
- .type GL_PREFIX(GetColorTableSGI), @function
-GL_PREFIX(GetColorTableSGI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableSGI), .-GL_PREFIX(GetColorTableSGI)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameterfvSGI)
- .type GL_PREFIX(GetColorTableParameterfvSGI), @function
-GL_PREFIX(GetColorTableParameterfvSGI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameterfvSGI), .-GL_PREFIX(GetColorTableParameterfvSGI)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameterivSGI)
- .type GL_PREFIX(GetColorTableParameterivSGI), @function
-GL_PREFIX(GetColorTableParameterivSGI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameterivSGI), .-GL_PREFIX(GetColorTableParameterivSGI)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTexGenSGIX)
- .type GL_PREFIX(PixelTexGenSGIX), @function
-GL_PREFIX(PixelTexGenSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTexGenSGIX), .-GL_PREFIX(PixelTexGenSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTexGenParameteriSGIS)
- .type GL_PREFIX(PixelTexGenParameteriSGIS), @function
-GL_PREFIX(PixelTexGenParameteriSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTexGenParameteriSGIS), .-GL_PREFIX(PixelTexGenParameteriSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTexGenParameterivSGIS)
- .type GL_PREFIX(PixelTexGenParameterivSGIS), @function
-GL_PREFIX(PixelTexGenParameterivSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTexGenParameterivSGIS), .-GL_PREFIX(PixelTexGenParameterivSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTexGenParameterfSGIS)
- .type GL_PREFIX(PixelTexGenParameterfSGIS), @function
-GL_PREFIX(PixelTexGenParameterfSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3464(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTexGenParameterfSGIS), .-GL_PREFIX(PixelTexGenParameterfSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTexGenParameterfvSGIS)
- .type GL_PREFIX(PixelTexGenParameterfvSGIS), @function
-GL_PREFIX(PixelTexGenParameterfvSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTexGenParameterfvSGIS), .-GL_PREFIX(PixelTexGenParameterfvSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelTexGenParameterivSGIS)
- .type GL_PREFIX(GetPixelTexGenParameterivSGIS), @function
-GL_PREFIX(GetPixelTexGenParameterivSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelTexGenParameterivSGIS), .-GL_PREFIX(GetPixelTexGenParameterivSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelTexGenParameterfvSGIS)
- .type GL_PREFIX(GetPixelTexGenParameterfvSGIS), @function
-GL_PREFIX(GetPixelTexGenParameterfvSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelTexGenParameterfvSGIS), .-GL_PREFIX(GetPixelTexGenParameterfvSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage4DSGIS)
- .type GL_PREFIX(TexImage4DSGIS), @function
-GL_PREFIX(TexImage4DSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage4DSGIS), .-GL_PREFIX(TexImage4DSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage4DSGIS)
- .type GL_PREFIX(TexSubImage4DSGIS), @function
-GL_PREFIX(TexSubImage4DSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage4DSGIS), .-GL_PREFIX(TexSubImage4DSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(AreTexturesResidentEXT)
- .type GL_PREFIX(AreTexturesResidentEXT), @function
-GL_PREFIX(AreTexturesResidentEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AreTexturesResidentEXT), .-GL_PREFIX(AreTexturesResidentEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenTexturesEXT)
- .type GL_PREFIX(GenTexturesEXT), @function
-GL_PREFIX(GenTexturesEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenTexturesEXT), .-GL_PREFIX(GenTexturesEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsTextureEXT)
- .type GL_PREFIX(IsTextureEXT), @function
-GL_PREFIX(IsTextureEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsTextureEXT), .-GL_PREFIX(IsTextureEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DetailTexFuncSGIS)
- .type GL_PREFIX(DetailTexFuncSGIS), @function
-GL_PREFIX(DetailTexFuncSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DetailTexFuncSGIS), .-GL_PREFIX(DetailTexFuncSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetDetailTexFuncSGIS)
- .type GL_PREFIX(GetDetailTexFuncSGIS), @function
-GL_PREFIX(GetDetailTexFuncSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetDetailTexFuncSGIS), .-GL_PREFIX(GetDetailTexFuncSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(SharpenTexFuncSGIS)
- .type GL_PREFIX(SharpenTexFuncSGIS), @function
-GL_PREFIX(SharpenTexFuncSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SharpenTexFuncSGIS), .-GL_PREFIX(SharpenTexFuncSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSharpenTexFuncSGIS)
- .type GL_PREFIX(GetSharpenTexFuncSGIS), @function
-GL_PREFIX(GetSharpenTexFuncSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSharpenTexFuncSGIS), .-GL_PREFIX(GetSharpenTexFuncSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(SampleMaskSGIS)
- .type GL_PREFIX(SampleMaskSGIS), @function
-GL_PREFIX(SampleMaskSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SampleMaskSGIS), .-GL_PREFIX(SampleMaskSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplePatternSGIS)
- .type GL_PREFIX(SamplePatternSGIS), @function
-GL_PREFIX(SamplePatternSGIS):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplePatternSGIS), .-GL_PREFIX(SamplePatternSGIS)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorPointerEXT)
- .type GL_PREFIX(ColorPointerEXT), @function
-GL_PREFIX(ColorPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlagPointerEXT)
- .type GL_PREFIX(EdgeFlagPointerEXT), @function
-GL_PREFIX(EdgeFlagPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexPointerEXT)
- .type GL_PREFIX(IndexPointerEXT), @function
-GL_PREFIX(IndexPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(NormalPointerEXT)
- .type GL_PREFIX(NormalPointerEXT), @function
-GL_PREFIX(NormalPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoordPointerEXT)
- .type GL_PREFIX(TexCoordPointerEXT), @function
-GL_PREFIX(TexCoordPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexPointerEXT)
- .type GL_PREFIX(VertexPointerEXT), @function
-GL_PREFIX(VertexPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SpriteParameterfSGIX)
- .type GL_PREFIX(SpriteParameterfSGIX), @function
-GL_PREFIX(SpriteParameterfSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3632(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SpriteParameterfSGIX), .-GL_PREFIX(SpriteParameterfSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(SpriteParameterfvSGIX)
- .type GL_PREFIX(SpriteParameterfvSGIX), @function
-GL_PREFIX(SpriteParameterfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SpriteParameterfvSGIX), .-GL_PREFIX(SpriteParameterfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(SpriteParameteriSGIX)
- .type GL_PREFIX(SpriteParameteriSGIX), @function
-GL_PREFIX(SpriteParameteriSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SpriteParameteriSGIX), .-GL_PREFIX(SpriteParameteriSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(SpriteParameterivSGIX)
- .type GL_PREFIX(SpriteParameterivSGIX), @function
-GL_PREFIX(SpriteParameterivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SpriteParameterivSGIX), .-GL_PREFIX(SpriteParameterivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameterfEXT)
- .type GL_PREFIX(PointParameterfEXT), @function
-GL_PREFIX(PointParameterfEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3664(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameterfvEXT)
- .type GL_PREFIX(PointParameterfvEXT), @function
-GL_PREFIX(PointParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetInstrumentsSGIX)
- .type GL_PREFIX(GetInstrumentsSGIX), @function
-GL_PREFIX(GetInstrumentsSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 3680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3680(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 3680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetInstrumentsSGIX), .-GL_PREFIX(GetInstrumentsSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(InstrumentsBufferSGIX)
- .type GL_PREFIX(InstrumentsBufferSGIX), @function
-GL_PREFIX(InstrumentsBufferSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(InstrumentsBufferSGIX), .-GL_PREFIX(InstrumentsBufferSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(PollInstrumentsSGIX)
- .type GL_PREFIX(PollInstrumentsSGIX), @function
-GL_PREFIX(PollInstrumentsSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PollInstrumentsSGIX), .-GL_PREFIX(PollInstrumentsSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReadInstrumentsSGIX)
- .type GL_PREFIX(ReadInstrumentsSGIX), @function
-GL_PREFIX(ReadInstrumentsSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReadInstrumentsSGIX), .-GL_PREFIX(ReadInstrumentsSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(StartInstrumentsSGIX)
- .type GL_PREFIX(StartInstrumentsSGIX), @function
-GL_PREFIX(StartInstrumentsSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 3712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3712(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 3712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StartInstrumentsSGIX), .-GL_PREFIX(StartInstrumentsSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(StopInstrumentsSGIX)
- .type GL_PREFIX(StopInstrumentsSGIX), @function
-GL_PREFIX(StopInstrumentsSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StopInstrumentsSGIX), .-GL_PREFIX(StopInstrumentsSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FrameZoomSGIX)
- .type GL_PREFIX(FrameZoomSGIX), @function
-GL_PREFIX(FrameZoomSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FrameZoomSGIX), .-GL_PREFIX(FrameZoomSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(TagSampleBufferSGIX)
- .type GL_PREFIX(TagSampleBufferSGIX), @function
-GL_PREFIX(TagSampleBufferSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 3736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3736(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 3736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TagSampleBufferSGIX), .-GL_PREFIX(TagSampleBufferSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReferencePlaneSGIX)
- .type GL_PREFIX(ReferencePlaneSGIX), @function
-GL_PREFIX(ReferencePlaneSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReferencePlaneSGIX), .-GL_PREFIX(ReferencePlaneSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FlushRasterSGIX)
- .type GL_PREFIX(FlushRasterSGIX), @function
-GL_PREFIX(FlushRasterSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 3752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3752(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 3752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FlushRasterSGIX), .-GL_PREFIX(FlushRasterSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetListParameterfvSGIX)
- .type GL_PREFIX(GetListParameterfvSGIX), @function
-GL_PREFIX(GetListParameterfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetListParameterfvSGIX), .-GL_PREFIX(GetListParameterfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetListParameterivSGIX)
- .type GL_PREFIX(GetListParameterivSGIX), @function
-GL_PREFIX(GetListParameterivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetListParameterivSGIX), .-GL_PREFIX(GetListParameterivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(ListParameterfSGIX)
- .type GL_PREFIX(ListParameterfSGIX), @function
-GL_PREFIX(ListParameterfSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3776(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ListParameterfSGIX), .-GL_PREFIX(ListParameterfSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(ListParameterfvSGIX)
- .type GL_PREFIX(ListParameterfvSGIX), @function
-GL_PREFIX(ListParameterfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ListParameterfvSGIX), .-GL_PREFIX(ListParameterfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(ListParameteriSGIX)
- .type GL_PREFIX(ListParameteriSGIX), @function
-GL_PREFIX(ListParameteriSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ListParameteriSGIX), .-GL_PREFIX(ListParameteriSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(ListParameterivSGIX)
- .type GL_PREFIX(ListParameterivSGIX), @function
-GL_PREFIX(ListParameterivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3800(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ListParameterivSGIX), .-GL_PREFIX(ListParameterivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentColorMaterialSGIX)
- .type GL_PREFIX(FragmentColorMaterialSGIX), @function
-GL_PREFIX(FragmentColorMaterialSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentColorMaterialSGIX), .-GL_PREFIX(FragmentColorMaterialSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightfSGIX)
- .type GL_PREFIX(FragmentLightfSGIX), @function
-GL_PREFIX(FragmentLightfSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3816(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightfSGIX), .-GL_PREFIX(FragmentLightfSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightfvSGIX)
- .type GL_PREFIX(FragmentLightfvSGIX), @function
-GL_PREFIX(FragmentLightfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightfvSGIX), .-GL_PREFIX(FragmentLightfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightiSGIX)
- .type GL_PREFIX(FragmentLightiSGIX), @function
-GL_PREFIX(FragmentLightiSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightiSGIX), .-GL_PREFIX(FragmentLightiSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightivSGIX)
- .type GL_PREFIX(FragmentLightivSGIX), @function
-GL_PREFIX(FragmentLightivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightivSGIX), .-GL_PREFIX(FragmentLightivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightModelfSGIX)
- .type GL_PREFIX(FragmentLightModelfSGIX), @function
-GL_PREFIX(FragmentLightModelfSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3848(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightModelfSGIX), .-GL_PREFIX(FragmentLightModelfSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightModelfvSGIX)
- .type GL_PREFIX(FragmentLightModelfvSGIX), @function
-GL_PREFIX(FragmentLightModelfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightModelfvSGIX), .-GL_PREFIX(FragmentLightModelfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightModeliSGIX)
- .type GL_PREFIX(FragmentLightModeliSGIX), @function
-GL_PREFIX(FragmentLightModeliSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightModeliSGIX), .-GL_PREFIX(FragmentLightModeliSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentLightModelivSGIX)
- .type GL_PREFIX(FragmentLightModelivSGIX), @function
-GL_PREFIX(FragmentLightModelivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentLightModelivSGIX), .-GL_PREFIX(FragmentLightModelivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentMaterialfSGIX)
- .type GL_PREFIX(FragmentMaterialfSGIX), @function
-GL_PREFIX(FragmentMaterialfSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3880(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentMaterialfSGIX), .-GL_PREFIX(FragmentMaterialfSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentMaterialfvSGIX)
- .type GL_PREFIX(FragmentMaterialfvSGIX), @function
-GL_PREFIX(FragmentMaterialfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentMaterialfvSGIX), .-GL_PREFIX(FragmentMaterialfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentMaterialiSGIX)
- .type GL_PREFIX(FragmentMaterialiSGIX), @function
-GL_PREFIX(FragmentMaterialiSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentMaterialiSGIX), .-GL_PREFIX(FragmentMaterialiSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(FragmentMaterialivSGIX)
- .type GL_PREFIX(FragmentMaterialivSGIX), @function
-GL_PREFIX(FragmentMaterialivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FragmentMaterialivSGIX), .-GL_PREFIX(FragmentMaterialivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFragmentLightfvSGIX)
- .type GL_PREFIX(GetFragmentLightfvSGIX), @function
-GL_PREFIX(GetFragmentLightfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFragmentLightfvSGIX), .-GL_PREFIX(GetFragmentLightfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFragmentLightivSGIX)
- .type GL_PREFIX(GetFragmentLightivSGIX), @function
-GL_PREFIX(GetFragmentLightivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFragmentLightivSGIX), .-GL_PREFIX(GetFragmentLightivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFragmentMaterialfvSGIX)
- .type GL_PREFIX(GetFragmentMaterialfvSGIX), @function
-GL_PREFIX(GetFragmentMaterialfvSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFragmentMaterialfvSGIX), .-GL_PREFIX(GetFragmentMaterialfvSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFragmentMaterialivSGIX)
- .type GL_PREFIX(GetFragmentMaterialivSGIX), @function
-GL_PREFIX(GetFragmentMaterialivSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFragmentMaterialivSGIX), .-GL_PREFIX(GetFragmentMaterialivSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightEnviSGIX)
- .type GL_PREFIX(LightEnviSGIX), @function
-GL_PREFIX(LightEnviSGIX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightEnviSGIX), .-GL_PREFIX(LightEnviSGIX)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexWeightfEXT)
- .type GL_PREFIX(VertexWeightfEXT), @function
-GL_PREFIX(VertexWeightfEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 3952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3952(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 3952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexWeightfEXT), .-GL_PREFIX(VertexWeightfEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexWeightfvEXT)
- .type GL_PREFIX(VertexWeightfvEXT), @function
-GL_PREFIX(VertexWeightfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexWeightfvEXT), .-GL_PREFIX(VertexWeightfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexWeightPointerEXT)
- .type GL_PREFIX(VertexWeightPointerEXT), @function
-GL_PREFIX(VertexWeightPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexWeightPointerEXT), .-GL_PREFIX(VertexWeightPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FlushVertexArrayRangeNV)
- .type GL_PREFIX(FlushVertexArrayRangeNV), @function
-GL_PREFIX(FlushVertexArrayRangeNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 3976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3976(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 3976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexArrayRangeNV)
- .type GL_PREFIX(VertexArrayRangeNV), @function
-GL_PREFIX(VertexArrayRangeNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameterfvNV)
- .type GL_PREFIX(CombinerParameterfvNV), @function
-GL_PREFIX(CombinerParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameterfNV)
- .type GL_PREFIX(CombinerParameterfNV), @function
-GL_PREFIX(CombinerParameterfNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4000(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameterivNV)
- .type GL_PREFIX(CombinerParameterivNV), @function
-GL_PREFIX(CombinerParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameteriNV)
- .type GL_PREFIX(CombinerParameteriNV), @function
-GL_PREFIX(CombinerParameteriNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerInputNV)
- .type GL_PREFIX(CombinerInputNV), @function
-GL_PREFIX(CombinerInputNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerOutputNV)
- .type GL_PREFIX(CombinerOutputNV), @function
-GL_PREFIX(CombinerOutputNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(FinalCombinerInputNV)
- .type GL_PREFIX(FinalCombinerInputNV), @function
-GL_PREFIX(FinalCombinerInputNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerInputParameterfvNV)
- .type GL_PREFIX(GetCombinerInputParameterfvNV), @function
-GL_PREFIX(GetCombinerInputParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerInputParameterivNV)
- .type GL_PREFIX(GetCombinerInputParameterivNV), @function
-GL_PREFIX(GetCombinerInputParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerOutputParameterfvNV)
- .type GL_PREFIX(GetCombinerOutputParameterfvNV), @function
-GL_PREFIX(GetCombinerOutputParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerOutputParameterivNV)
- .type GL_PREFIX(GetCombinerOutputParameterivNV), @function
-GL_PREFIX(GetCombinerOutputParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFinalCombinerInputParameterfvNV)
- .type GL_PREFIX(GetFinalCombinerInputParameterfvNV), @function
-GL_PREFIX(GetFinalCombinerInputParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFinalCombinerInputParameterivNV)
- .type GL_PREFIX(GetFinalCombinerInputParameterivNV), @function
-GL_PREFIX(GetFinalCombinerInputParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResizeBuffersMESA)
- .type GL_PREFIX(ResizeBuffersMESA), @function
-GL_PREFIX(ResizeBuffersMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 4096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4096(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 4096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2dMESA)
- .type GL_PREFIX(WindowPos2dMESA), @function
-GL_PREFIX(WindowPos2dMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4104(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2dvMESA)
- .type GL_PREFIX(WindowPos2dvMESA), @function
-GL_PREFIX(WindowPos2dvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2fMESA)
- .type GL_PREFIX(WindowPos2fMESA), @function
-GL_PREFIX(WindowPos2fMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4120(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2fvMESA)
- .type GL_PREFIX(WindowPos2fvMESA), @function
-GL_PREFIX(WindowPos2fvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2iMESA)
- .type GL_PREFIX(WindowPos2iMESA), @function
-GL_PREFIX(WindowPos2iMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2ivMESA)
- .type GL_PREFIX(WindowPos2ivMESA), @function
-GL_PREFIX(WindowPos2ivMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2sMESA)
- .type GL_PREFIX(WindowPos2sMESA), @function
-GL_PREFIX(WindowPos2sMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2svMESA)
- .type GL_PREFIX(WindowPos2svMESA), @function
-GL_PREFIX(WindowPos2svMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3dMESA)
- .type GL_PREFIX(WindowPos3dMESA), @function
-GL_PREFIX(WindowPos3dMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4168(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3dvMESA)
- .type GL_PREFIX(WindowPos3dvMESA), @function
-GL_PREFIX(WindowPos3dvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3fMESA)
- .type GL_PREFIX(WindowPos3fMESA), @function
-GL_PREFIX(WindowPos3fMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4184(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3fvMESA)
- .type GL_PREFIX(WindowPos3fvMESA), @function
-GL_PREFIX(WindowPos3fvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3iMESA)
- .type GL_PREFIX(WindowPos3iMESA), @function
-GL_PREFIX(WindowPos3iMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3ivMESA)
- .type GL_PREFIX(WindowPos3ivMESA), @function
-GL_PREFIX(WindowPos3ivMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3sMESA)
- .type GL_PREFIX(WindowPos3sMESA), @function
-GL_PREFIX(WindowPos3sMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3svMESA)
- .type GL_PREFIX(WindowPos3svMESA), @function
-GL_PREFIX(WindowPos3svMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4dMESA)
- .type GL_PREFIX(WindowPos4dMESA), @function
-GL_PREFIX(WindowPos4dMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 4232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4232(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 4232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4dvMESA)
- .type GL_PREFIX(WindowPos4dvMESA), @function
-GL_PREFIX(WindowPos4dvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4fMESA)
- .type GL_PREFIX(WindowPos4fMESA), @function
-GL_PREFIX(WindowPos4fMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 4248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4248(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 4248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4fvMESA)
- .type GL_PREFIX(WindowPos4fvMESA), @function
-GL_PREFIX(WindowPos4fvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4iMESA)
- .type GL_PREFIX(WindowPos4iMESA), @function
-GL_PREFIX(WindowPos4iMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4ivMESA)
- .type GL_PREFIX(WindowPos4ivMESA), @function
-GL_PREFIX(WindowPos4ivMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4sMESA)
- .type GL_PREFIX(WindowPos4sMESA), @function
-GL_PREFIX(WindowPos4sMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4svMESA)
- .type GL_PREFIX(WindowPos4svMESA), @function
-GL_PREFIX(WindowPos4svMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendFuncSeparateEXT)
- .type GL_PREFIX(BlendFuncSeparateEXT), @function
-GL_PREFIX(BlendFuncSeparateEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexMaterialEXT)
- .type GL_PREFIX(IndexMaterialEXT), @function
-GL_PREFIX(IndexMaterialEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexMaterialEXT), .-GL_PREFIX(IndexMaterialEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexFuncEXT)
- .type GL_PREFIX(IndexFuncEXT), @function
-GL_PREFIX(IndexFuncEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexFuncEXT), .-GL_PREFIX(IndexFuncEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(LockArraysEXT)
- .type GL_PREFIX(LockArraysEXT), @function
-GL_PREFIX(LockArraysEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(UnlockArraysEXT)
- .type GL_PREFIX(UnlockArraysEXT), @function
-GL_PREFIX(UnlockArraysEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 4328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4328(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 4328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(CullParameterdvEXT)
- .type GL_PREFIX(CullParameterdvEXT), @function
-GL_PREFIX(CullParameterdvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CullParameterdvEXT), .-GL_PREFIX(CullParameterdvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(CullParameterfvEXT)
- .type GL_PREFIX(CullParameterfvEXT), @function
-GL_PREFIX(CullParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CullParameterfvEXT), .-GL_PREFIX(CullParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(HintPGI)
- .type GL_PREFIX(HintPGI), @function
-GL_PREFIX(HintPGI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(HintPGI), .-GL_PREFIX(HintPGI)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoordfEXT)
- .type GL_PREFIX(FogCoordfEXT), @function
-GL_PREFIX(FogCoordfEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 4360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4360(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 4360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoordfvEXT)
- .type GL_PREFIX(FogCoordfvEXT), @function
-GL_PREFIX(FogCoordfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoorddEXT)
- .type GL_PREFIX(FogCoorddEXT), @function
-GL_PREFIX(FogCoorddEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 4376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4376(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 4376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoorddvEXT)
- .type GL_PREFIX(FogCoorddvEXT), @function
-GL_PREFIX(FogCoorddvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoordPointerEXT)
- .type GL_PREFIX(FogCoordPointerEXT), @function
-GL_PREFIX(FogCoordPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableEXT)
- .type GL_PREFIX(GetColorTableEXT), @function
-GL_PREFIX(GetColorTableEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableEXT), .-GL_PREFIX(GetColorTableEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameterivEXT)
- .type GL_PREFIX(GetColorTableParameterivEXT), @function
-GL_PREFIX(GetColorTableParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameterivEXT), .-GL_PREFIX(GetColorTableParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameterfvEXT)
- .type GL_PREFIX(GetColorTableParameterfvEXT), @function
-GL_PREFIX(GetColorTableParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameterfvEXT), .-GL_PREFIX(GetColorTableParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TbufferMask3DFX)
- .type GL_PREFIX(TbufferMask3DFX), @function
-GL_PREFIX(TbufferMask3DFX):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TbufferMask3DFX), .-GL_PREFIX(TbufferMask3DFX)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexImage3DARB)
- .type GL_PREFIX(CompressedTexImage3DARB), @function
-GL_PREFIX(CompressedTexImage3DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexImage2DARB)
- .type GL_PREFIX(CompressedTexImage2DARB), @function
-GL_PREFIX(CompressedTexImage2DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexImage1DARB)
- .type GL_PREFIX(CompressedTexImage1DARB), @function
-GL_PREFIX(CompressedTexImage1DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexSubImage3DARB)
- .type GL_PREFIX(CompressedTexSubImage3DARB), @function
-GL_PREFIX(CompressedTexSubImage3DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexSubImage2DARB)
- .type GL_PREFIX(CompressedTexSubImage2DARB), @function
-GL_PREFIX(CompressedTexSubImage2DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexSubImage1DARB)
- .type GL_PREFIX(CompressedTexSubImage1DARB), @function
-GL_PREFIX(CompressedTexSubImage1DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCompressedTexImageARB)
- .type GL_PREFIX(GetCompressedTexImageARB), @function
-GL_PREFIX(GetCompressedTexImageARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3bEXT)
- .type GL_PREFIX(SecondaryColor3bEXT), @function
-GL_PREFIX(SecondaryColor3bEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3bvEXT)
- .type GL_PREFIX(SecondaryColor3bvEXT), @function
-GL_PREFIX(SecondaryColor3bvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3dEXT)
- .type GL_PREFIX(SecondaryColor3dEXT), @function
-GL_PREFIX(SecondaryColor3dEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4504(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3dvEXT)
- .type GL_PREFIX(SecondaryColor3dvEXT), @function
-GL_PREFIX(SecondaryColor3dvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3fEXT)
- .type GL_PREFIX(SecondaryColor3fEXT), @function
-GL_PREFIX(SecondaryColor3fEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4520(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 4520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3fvEXT)
- .type GL_PREFIX(SecondaryColor3fvEXT), @function
-GL_PREFIX(SecondaryColor3fvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3iEXT)
- .type GL_PREFIX(SecondaryColor3iEXT), @function
-GL_PREFIX(SecondaryColor3iEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3ivEXT)
- .type GL_PREFIX(SecondaryColor3ivEXT), @function
-GL_PREFIX(SecondaryColor3ivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3sEXT)
- .type GL_PREFIX(SecondaryColor3sEXT), @function
-GL_PREFIX(SecondaryColor3sEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3svEXT)
- .type GL_PREFIX(SecondaryColor3svEXT), @function
-GL_PREFIX(SecondaryColor3svEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3ubEXT)
- .type GL_PREFIX(SecondaryColor3ubEXT), @function
-GL_PREFIX(SecondaryColor3ubEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3ubvEXT)
- .type GL_PREFIX(SecondaryColor3ubvEXT), @function
-GL_PREFIX(SecondaryColor3ubvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3uiEXT)
- .type GL_PREFIX(SecondaryColor3uiEXT), @function
-GL_PREFIX(SecondaryColor3uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3uivEXT)
- .type GL_PREFIX(SecondaryColor3uivEXT), @function
-GL_PREFIX(SecondaryColor3uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3usEXT)
- .type GL_PREFIX(SecondaryColor3usEXT), @function
-GL_PREFIX(SecondaryColor3usEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3usvEXT)
- .type GL_PREFIX(SecondaryColor3usvEXT), @function
-GL_PREFIX(SecondaryColor3usvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColorPointerEXT)
- .type GL_PREFIX(SecondaryColorPointerEXT), @function
-GL_PREFIX(SecondaryColorPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(AreProgramsResidentNV)
- .type GL_PREFIX(AreProgramsResidentNV), @function
-GL_PREFIX(AreProgramsResidentNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindProgramNV)
- .type GL_PREFIX(BindProgramNV), @function
-GL_PREFIX(BindProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteProgramsNV)
- .type GL_PREFIX(DeleteProgramsNV), @function
-GL_PREFIX(DeleteProgramsNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ExecuteProgramNV)
- .type GL_PREFIX(ExecuteProgramNV), @function
-GL_PREFIX(ExecuteProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenProgramsNV)
- .type GL_PREFIX(GenProgramsNV), @function
-GL_PREFIX(GenProgramsNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramParameterdvNV)
- .type GL_PREFIX(GetProgramParameterdvNV), @function
-GL_PREFIX(GetProgramParameterdvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramParameterfvNV)
- .type GL_PREFIX(GetProgramParameterfvNV), @function
-GL_PREFIX(GetProgramParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramivNV)
- .type GL_PREFIX(GetProgramivNV), @function
-GL_PREFIX(GetProgramivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramStringNV)
- .type GL_PREFIX(GetProgramStringNV), @function
-GL_PREFIX(GetProgramStringNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTrackMatrixivNV)
- .type GL_PREFIX(GetTrackMatrixivNV), @function
-GL_PREFIX(GetTrackMatrixivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribdvARB)
- .type GL_PREFIX(GetVertexAttribdvARB), @function
-GL_PREFIX(GetVertexAttribdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribfvARB)
- .type GL_PREFIX(GetVertexAttribfvARB), @function
-GL_PREFIX(GetVertexAttribfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribivARB)
- .type GL_PREFIX(GetVertexAttribivARB), @function
-GL_PREFIX(GetVertexAttribivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribPointervNV)
- .type GL_PREFIX(GetVertexAttribPointervNV), @function
-GL_PREFIX(GetVertexAttribPointervNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsProgramNV)
- .type GL_PREFIX(IsProgramNV), @function
-GL_PREFIX(IsProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadProgramNV)
- .type GL_PREFIX(LoadProgramNV), @function
-GL_PREFIX(LoadProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameter4dNV)
- .type GL_PREFIX(ProgramParameter4dNV), @function
-GL_PREFIX(ProgramParameter4dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 4752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4752(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 4752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameter4dNV), .-GL_PREFIX(ProgramParameter4dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameter4dvNV)
- .type GL_PREFIX(ProgramParameter4dvNV), @function
-GL_PREFIX(ProgramParameter4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameter4dvNV), .-GL_PREFIX(ProgramParameter4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameter4fNV)
- .type GL_PREFIX(ProgramParameter4fNV), @function
-GL_PREFIX(ProgramParameter4fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 4768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4768(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 4768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameter4fNV), .-GL_PREFIX(ProgramParameter4fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameter4fvNV)
- .type GL_PREFIX(ProgramParameter4fvNV), @function
-GL_PREFIX(ProgramParameter4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameter4fvNV), .-GL_PREFIX(ProgramParameter4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameters4dvNV)
- .type GL_PREFIX(ProgramParameters4dvNV), @function
-GL_PREFIX(ProgramParameters4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameters4fvNV)
- .type GL_PREFIX(ProgramParameters4fvNV), @function
-GL_PREFIX(ProgramParameters4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(RequestResidentProgramsNV)
- .type GL_PREFIX(RequestResidentProgramsNV), @function
-GL_PREFIX(RequestResidentProgramsNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4800(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(TrackMatrixNV)
- .type GL_PREFIX(TrackMatrixNV), @function
-GL_PREFIX(TrackMatrixNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribPointerNV)
- .type GL_PREFIX(VertexAttribPointerNV), @function
-GL_PREFIX(VertexAttribPointerNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dARB)
- .type GL_PREFIX(VertexAttrib1dARB), @function
-GL_PREFIX(VertexAttrib1dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4824(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dvARB)
- .type GL_PREFIX(VertexAttrib1dvARB), @function
-GL_PREFIX(VertexAttrib1dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fARB)
- .type GL_PREFIX(VertexAttrib1fARB), @function
-GL_PREFIX(VertexAttrib1fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4840(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fvARB)
- .type GL_PREFIX(VertexAttrib1fvARB), @function
-GL_PREFIX(VertexAttrib1fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1sARB)
- .type GL_PREFIX(VertexAttrib1sARB), @function
-GL_PREFIX(VertexAttrib1sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1svARB)
- .type GL_PREFIX(VertexAttrib1svARB), @function
-GL_PREFIX(VertexAttrib1svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dARB)
- .type GL_PREFIX(VertexAttrib2dARB), @function
-GL_PREFIX(VertexAttrib2dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4872(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dvARB)
- .type GL_PREFIX(VertexAttrib2dvARB), @function
-GL_PREFIX(VertexAttrib2dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fARB)
- .type GL_PREFIX(VertexAttrib2fARB), @function
-GL_PREFIX(VertexAttrib2fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4888(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fvARB)
- .type GL_PREFIX(VertexAttrib2fvARB), @function
-GL_PREFIX(VertexAttrib2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2sARB)
- .type GL_PREFIX(VertexAttrib2sARB), @function
-GL_PREFIX(VertexAttrib2sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2svARB)
- .type GL_PREFIX(VertexAttrib2svARB), @function
-GL_PREFIX(VertexAttrib2svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dARB)
- .type GL_PREFIX(VertexAttrib3dARB), @function
-GL_PREFIX(VertexAttrib3dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4920(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dvARB)
- .type GL_PREFIX(VertexAttrib3dvARB), @function
-GL_PREFIX(VertexAttrib3dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fARB)
- .type GL_PREFIX(VertexAttrib3fARB), @function
-GL_PREFIX(VertexAttrib3fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4936(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fvARB)
- .type GL_PREFIX(VertexAttrib3fvARB), @function
-GL_PREFIX(VertexAttrib3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3sARB)
- .type GL_PREFIX(VertexAttrib3sARB), @function
-GL_PREFIX(VertexAttrib3sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3svARB)
- .type GL_PREFIX(VertexAttrib3svARB), @function
-GL_PREFIX(VertexAttrib3svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dARB)
- .type GL_PREFIX(VertexAttrib4dARB), @function
-GL_PREFIX(VertexAttrib4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4968(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dvARB)
- .type GL_PREFIX(VertexAttrib4dvARB), @function
-GL_PREFIX(VertexAttrib4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fARB)
- .type GL_PREFIX(VertexAttrib4fARB), @function
-GL_PREFIX(VertexAttrib4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4984(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fvARB)
- .type GL_PREFIX(VertexAttrib4fvARB), @function
-GL_PREFIX(VertexAttrib4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4sARB)
- .type GL_PREFIX(VertexAttrib4sARB), @function
-GL_PREFIX(VertexAttrib4sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4svARB)
- .type GL_PREFIX(VertexAttrib4svARB), @function
-GL_PREFIX(VertexAttrib4svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NubARB)
- .type GL_PREFIX(VertexAttrib4NubARB), @function
-GL_PREFIX(VertexAttrib4NubARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NubvARB)
- .type GL_PREFIX(VertexAttrib4NubvARB), @function
-GL_PREFIX(VertexAttrib4NubvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs1dvNV)
- .type GL_PREFIX(VertexAttribs1dvNV), @function
-GL_PREFIX(VertexAttribs1dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs1fvNV)
- .type GL_PREFIX(VertexAttribs1fvNV), @function
-GL_PREFIX(VertexAttribs1fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs1svNV)
- .type GL_PREFIX(VertexAttribs1svNV), @function
-GL_PREFIX(VertexAttribs1svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs2dvNV)
- .type GL_PREFIX(VertexAttribs2dvNV), @function
-GL_PREFIX(VertexAttribs2dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs2fvNV)
- .type GL_PREFIX(VertexAttribs2fvNV), @function
-GL_PREFIX(VertexAttribs2fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs2svNV)
- .type GL_PREFIX(VertexAttribs2svNV), @function
-GL_PREFIX(VertexAttribs2svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs3dvNV)
- .type GL_PREFIX(VertexAttribs3dvNV), @function
-GL_PREFIX(VertexAttribs3dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs3fvNV)
- .type GL_PREFIX(VertexAttribs3fvNV), @function
-GL_PREFIX(VertexAttribs3fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs3svNV)
- .type GL_PREFIX(VertexAttribs3svNV), @function
-GL_PREFIX(VertexAttribs3svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4dvNV)
- .type GL_PREFIX(VertexAttribs4dvNV), @function
-GL_PREFIX(VertexAttribs4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4fvNV)
- .type GL_PREFIX(VertexAttribs4fvNV), @function
-GL_PREFIX(VertexAttribs4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4svNV)
- .type GL_PREFIX(VertexAttribs4svNV), @function
-GL_PREFIX(VertexAttribs4svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4ubvNV)
- .type GL_PREFIX(VertexAttribs4ubvNV), @function
-GL_PREFIX(VertexAttribs4ubvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameteriNV)
- .type GL_PREFIX(PointParameteriNV), @function
-GL_PREFIX(PointParameteriNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameterivNV)
- .type GL_PREFIX(PointParameterivNV), @function
-GL_PREFIX(PointParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiDrawArraysEXT)
- .type GL_PREFIX(MultiDrawArraysEXT), @function
-GL_PREFIX(MultiDrawArraysEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiDrawElementsEXT)
- .type GL_PREFIX(MultiDrawElementsEXT), @function
-GL_PREFIX(MultiDrawElementsEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(ActiveStencilFaceEXT)
- .type GL_PREFIX(ActiveStencilFaceEXT), @function
-GL_PREFIX(ActiveStencilFaceEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ActiveStencilFaceEXT), .-GL_PREFIX(ActiveStencilFaceEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteFencesNV)
- .type GL_PREFIX(DeleteFencesNV), @function
-GL_PREFIX(DeleteFencesNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteFencesNV), .-GL_PREFIX(DeleteFencesNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenFencesNV)
- .type GL_PREFIX(GenFencesNV), @function
-GL_PREFIX(GenFencesNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenFencesNV), .-GL_PREFIX(GenFencesNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsFenceNV)
- .type GL_PREFIX(IsFenceNV), @function
-GL_PREFIX(IsFenceNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsFenceNV), .-GL_PREFIX(IsFenceNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(TestFenceNV)
- .type GL_PREFIX(TestFenceNV), @function
-GL_PREFIX(TestFenceNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TestFenceNV), .-GL_PREFIX(TestFenceNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFenceivNV)
- .type GL_PREFIX(GetFenceivNV), @function
-GL_PREFIX(GetFenceivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFenceivNV), .-GL_PREFIX(GetFenceivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(FinishFenceNV)
- .type GL_PREFIX(FinishFenceNV), @function
-GL_PREFIX(FinishFenceNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FinishFenceNV), .-GL_PREFIX(FinishFenceNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(SetFenceNV)
- .type GL_PREFIX(SetFenceNV), @function
-GL_PREFIX(SetFenceNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SetFenceNV), .-GL_PREFIX(SetFenceNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4bvARB)
- .type GL_PREFIX(VertexAttrib4bvARB), @function
-GL_PREFIX(VertexAttrib4bvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ivARB)
- .type GL_PREFIX(VertexAttrib4ivARB), @function
-GL_PREFIX(VertexAttrib4ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ubvARB)
- .type GL_PREFIX(VertexAttrib4ubvARB), @function
-GL_PREFIX(VertexAttrib4ubvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4usvARB)
- .type GL_PREFIX(VertexAttrib4usvARB), @function
-GL_PREFIX(VertexAttrib4usvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4uivARB)
- .type GL_PREFIX(VertexAttrib4uivARB), @function
-GL_PREFIX(VertexAttrib4uivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NbvARB)
- .type GL_PREFIX(VertexAttrib4NbvARB), @function
-GL_PREFIX(VertexAttrib4NbvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NsvARB)
- .type GL_PREFIX(VertexAttrib4NsvARB), @function
-GL_PREFIX(VertexAttrib4NsvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NivARB)
- .type GL_PREFIX(VertexAttrib4NivARB), @function
-GL_PREFIX(VertexAttrib4NivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NusvARB)
- .type GL_PREFIX(VertexAttrib4NusvARB), @function
-GL_PREFIX(VertexAttrib4NusvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NuivARB)
- .type GL_PREFIX(VertexAttrib4NuivARB), @function
-GL_PREFIX(VertexAttrib4NuivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribPointerARB)
- .type GL_PREFIX(VertexAttribPointerARB), @function
-GL_PREFIX(VertexAttribPointerARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(EnableVertexAttribArrayARB)
- .type GL_PREFIX(EnableVertexAttribArrayARB), @function
-GL_PREFIX(EnableVertexAttribArrayARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DisableVertexAttribArrayARB)
- .type GL_PREFIX(DisableVertexAttribArrayARB), @function
-GL_PREFIX(DisableVertexAttribArrayARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramStringARB)
- .type GL_PREFIX(ProgramStringARB), @function
-GL_PREFIX(ProgramStringARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4dARB)
- .type GL_PREFIX(ProgramEnvParameter4dARB), @function
-GL_PREFIX(ProgramEnvParameter4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5344(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4dvARB)
- .type GL_PREFIX(ProgramEnvParameter4dvARB), @function
-GL_PREFIX(ProgramEnvParameter4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4fARB)
- .type GL_PREFIX(ProgramEnvParameter4fARB), @function
-GL_PREFIX(ProgramEnvParameter4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5360(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4fvARB)
- .type GL_PREFIX(ProgramEnvParameter4fvARB), @function
-GL_PREFIX(ProgramEnvParameter4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4dARB)
- .type GL_PREFIX(ProgramLocalParameter4dARB), @function
-GL_PREFIX(ProgramLocalParameter4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5376(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4dvARB)
- .type GL_PREFIX(ProgramLocalParameter4dvARB), @function
-GL_PREFIX(ProgramLocalParameter4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4fARB)
- .type GL_PREFIX(ProgramLocalParameter4fARB), @function
-GL_PREFIX(ProgramLocalParameter4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5392(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4fvARB)
- .type GL_PREFIX(ProgramLocalParameter4fvARB), @function
-GL_PREFIX(ProgramLocalParameter4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramEnvParameterdvARB)
- .type GL_PREFIX(GetProgramEnvParameterdvARB), @function
-GL_PREFIX(GetProgramEnvParameterdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramEnvParameterfvARB)
- .type GL_PREFIX(GetProgramEnvParameterfvARB), @function
-GL_PREFIX(GetProgramEnvParameterfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramLocalParameterdvARB)
- .type GL_PREFIX(GetProgramLocalParameterdvARB), @function
-GL_PREFIX(GetProgramLocalParameterdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramLocalParameterfvARB)
- .type GL_PREFIX(GetProgramLocalParameterfvARB), @function
-GL_PREFIX(GetProgramLocalParameterfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramivARB)
- .type GL_PREFIX(GetProgramivARB), @function
-GL_PREFIX(GetProgramivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramStringARB)
- .type GL_PREFIX(GetProgramStringARB), @function
-GL_PREFIX(GetProgramStringARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4fNV)
- .type GL_PREFIX(ProgramNamedParameter4fNV), @function
-GL_PREFIX(ProgramNamedParameter4fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5456(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _glapi_get_dispatch
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4dNV)
- .type GL_PREFIX(ProgramNamedParameter4dNV), @function
-GL_PREFIX(ProgramNamedParameter4dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5464(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _glapi_get_dispatch
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 5464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4fvNV)
- .type GL_PREFIX(ProgramNamedParameter4fvNV), @function
-GL_PREFIX(ProgramNamedParameter4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4dvNV)
- .type GL_PREFIX(ProgramNamedParameter4dvNV), @function
-GL_PREFIX(ProgramNamedParameter4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramNamedParameterfvNV)
- .type GL_PREFIX(GetProgramNamedParameterfvNV), @function
-GL_PREFIX(GetProgramNamedParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramNamedParameterdvNV)
- .type GL_PREFIX(GetProgramNamedParameterdvNV), @function
-GL_PREFIX(GetProgramNamedParameterdvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindBufferARB)
- .type GL_PREFIX(BindBufferARB), @function
-GL_PREFIX(BindBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BufferDataARB)
- .type GL_PREFIX(BufferDataARB), @function
-GL_PREFIX(BufferDataARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BufferSubDataARB)
- .type GL_PREFIX(BufferSubDataARB), @function
-GL_PREFIX(BufferSubDataARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteBuffersARB)
- .type GL_PREFIX(DeleteBuffersARB), @function
-GL_PREFIX(DeleteBuffersARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenBuffersARB)
- .type GL_PREFIX(GenBuffersARB), @function
-GL_PREFIX(GenBuffersARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferParameterivARB)
- .type GL_PREFIX(GetBufferParameterivARB), @function
-GL_PREFIX(GetBufferParameterivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferPointervARB)
- .type GL_PREFIX(GetBufferPointervARB), @function
-GL_PREFIX(GetBufferPointervARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferSubDataARB)
- .type GL_PREFIX(GetBufferSubDataARB), @function
-GL_PREFIX(GetBufferSubDataARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsBufferARB)
- .type GL_PREFIX(IsBufferARB), @function
-GL_PREFIX(IsBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapBufferARB)
- .type GL_PREFIX(MapBufferARB), @function
-GL_PREFIX(MapBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UnmapBufferARB)
- .type GL_PREFIX(UnmapBufferARB), @function
-GL_PREFIX(UnmapBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthBoundsEXT)
- .type GL_PREFIX(DepthBoundsEXT), @function
-GL_PREFIX(DepthBoundsEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthBoundsEXT), .-GL_PREFIX(DepthBoundsEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenQueriesARB)
- .type GL_PREFIX(GenQueriesARB), @function
-GL_PREFIX(GenQueriesARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteQueriesARB)
- .type GL_PREFIX(DeleteQueriesARB), @function
-GL_PREFIX(DeleteQueriesARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsQueryARB)
- .type GL_PREFIX(IsQueryARB), @function
-GL_PREFIX(IsQueryARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BeginQueryARB)
- .type GL_PREFIX(BeginQueryARB), @function
-GL_PREFIX(BeginQueryARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndQueryARB)
- .type GL_PREFIX(EndQueryARB), @function
-GL_PREFIX(EndQueryARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetQueryivARB)
- .type GL_PREFIX(GetQueryivARB), @function
-GL_PREFIX(GetQueryivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetQueryObjectivARB)
- .type GL_PREFIX(GetQueryObjectivARB), @function
-GL_PREFIX(GetQueryObjectivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetQueryObjectuivARB)
- .type GL_PREFIX(GetQueryObjectuivARB), @function
-GL_PREFIX(GetQueryObjectuivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiModeDrawArraysIBM)
- .type GL_PREFIX(MultiModeDrawArraysIBM), @function
-GL_PREFIX(MultiModeDrawArraysIBM):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiModeDrawArraysIBM), .-GL_PREFIX(MultiModeDrawArraysIBM)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiModeDrawElementsIBM)
- .type GL_PREFIX(MultiModeDrawElementsIBM), @function
-GL_PREFIX(MultiModeDrawElementsIBM):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiModeDrawElementsIBM), .-GL_PREFIX(MultiModeDrawElementsIBM)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendEquationSeparateEXT)
- .type GL_PREFIX(BlendEquationSeparateEXT), @function
-GL_PREFIX(BlendEquationSeparateEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendEquationSeparateEXT), .-GL_PREFIX(BlendEquationSeparateEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteObjectARB)
- .type GL_PREFIX(DeleteObjectARB), @function
-GL_PREFIX(DeleteObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHandleARB)
- .type GL_PREFIX(GetHandleARB), @function
-GL_PREFIX(GetHandleARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DetachObjectARB)
- .type GL_PREFIX(DetachObjectARB), @function
-GL_PREFIX(DetachObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateShaderObjectARB)
- .type GL_PREFIX(CreateShaderObjectARB), @function
-GL_PREFIX(CreateShaderObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ShaderSourceARB)
- .type GL_PREFIX(ShaderSourceARB), @function
-GL_PREFIX(ShaderSourceARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompileShaderARB)
- .type GL_PREFIX(CompileShaderARB), @function
-GL_PREFIX(CompileShaderARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateProgramObjectARB)
- .type GL_PREFIX(CreateProgramObjectARB), @function
-GL_PREFIX(CreateProgramObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 5736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5736(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 5736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(AttachObjectARB)
- .type GL_PREFIX(AttachObjectARB), @function
-GL_PREFIX(AttachObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(LinkProgramARB)
- .type GL_PREFIX(LinkProgramARB), @function
-GL_PREFIX(LinkProgramARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UseProgramObjectARB)
- .type GL_PREFIX(UseProgramObjectARB), @function
-GL_PREFIX(UseProgramObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ValidateProgramARB)
- .type GL_PREFIX(ValidateProgramARB), @function
-GL_PREFIX(ValidateProgramARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1fARB)
- .type GL_PREFIX(Uniform1fARB), @function
-GL_PREFIX(Uniform1fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5776(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2fARB)
- .type GL_PREFIX(Uniform2fARB), @function
-GL_PREFIX(Uniform2fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5784(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3fARB)
- .type GL_PREFIX(Uniform3fARB), @function
-GL_PREFIX(Uniform3fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 5792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5792(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 5792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4fARB)
- .type GL_PREFIX(Uniform4fARB), @function
-GL_PREFIX(Uniform4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 5800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5800(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 5800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1iARB)
- .type GL_PREFIX(Uniform1iARB), @function
-GL_PREFIX(Uniform1iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2iARB)
- .type GL_PREFIX(Uniform2iARB), @function
-GL_PREFIX(Uniform2iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3iARB)
- .type GL_PREFIX(Uniform3iARB), @function
-GL_PREFIX(Uniform3iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4iARB)
- .type GL_PREFIX(Uniform4iARB), @function
-GL_PREFIX(Uniform4iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1fvARB)
- .type GL_PREFIX(Uniform1fvARB), @function
-GL_PREFIX(Uniform1fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2fvARB)
- .type GL_PREFIX(Uniform2fvARB), @function
-GL_PREFIX(Uniform2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3fvARB)
- .type GL_PREFIX(Uniform3fvARB), @function
-GL_PREFIX(Uniform3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4fvARB)
- .type GL_PREFIX(Uniform4fvARB), @function
-GL_PREFIX(Uniform4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1ivARB)
- .type GL_PREFIX(Uniform1ivARB), @function
-GL_PREFIX(Uniform1ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2ivARB)
- .type GL_PREFIX(Uniform2ivARB), @function
-GL_PREFIX(Uniform2ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3ivARB)
- .type GL_PREFIX(Uniform3ivARB), @function
-GL_PREFIX(Uniform3ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4ivARB)
- .type GL_PREFIX(Uniform4ivARB), @function
-GL_PREFIX(Uniform4ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix2fvARB)
- .type GL_PREFIX(UniformMatrix2fvARB), @function
-GL_PREFIX(UniformMatrix2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix3fvARB)
- .type GL_PREFIX(UniformMatrix3fvARB), @function
-GL_PREFIX(UniformMatrix3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix4fvARB)
- .type GL_PREFIX(UniformMatrix4fvARB), @function
-GL_PREFIX(UniformMatrix4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetObjectParameterfvARB)
- .type GL_PREFIX(GetObjectParameterfvARB), @function
-GL_PREFIX(GetObjectParameterfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetObjectParameterivARB)
- .type GL_PREFIX(GetObjectParameterivARB), @function
-GL_PREFIX(GetObjectParameterivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetInfoLogARB)
- .type GL_PREFIX(GetInfoLogARB), @function
-GL_PREFIX(GetInfoLogARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetAttachedObjectsARB)
- .type GL_PREFIX(GetAttachedObjectsARB), @function
-GL_PREFIX(GetAttachedObjectsARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformLocationARB)
- .type GL_PREFIX(GetUniformLocationARB), @function
-GL_PREFIX(GetUniformLocationARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetActiveUniformARB)
- .type GL_PREFIX(GetActiveUniformARB), @function
-GL_PREFIX(GetActiveUniformARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformfvARB)
- .type GL_PREFIX(GetUniformfvARB), @function
-GL_PREFIX(GetUniformfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformivARB)
- .type GL_PREFIX(GetUniformivARB), @function
-GL_PREFIX(GetUniformivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetShaderSourceARB)
- .type GL_PREFIX(GetShaderSourceARB), @function
-GL_PREFIX(GetShaderSourceARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindAttribLocationARB)
- .type GL_PREFIX(BindAttribLocationARB), @function
-GL_PREFIX(BindAttribLocationARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetActiveAttribARB)
- .type GL_PREFIX(GetActiveAttribARB), @function
-GL_PREFIX(GetActiveAttribARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetAttribLocationARB)
- .type GL_PREFIX(GetAttribLocationARB), @function
-GL_PREFIX(GetAttribLocationARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribdvNV)
- .type GL_PREFIX(GetVertexAttribdvNV), @function
-GL_PREFIX(GetVertexAttribdvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribfvNV)
- .type GL_PREFIX(GetVertexAttribfvNV), @function
-GL_PREFIX(GetVertexAttribfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribivNV)
- .type GL_PREFIX(GetVertexAttribivNV), @function
-GL_PREFIX(GetVertexAttribivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dNV)
- .type GL_PREFIX(VertexAttrib1dNV), @function
-GL_PREFIX(VertexAttrib1dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6048(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dvNV)
- .type GL_PREFIX(VertexAttrib1dvNV), @function
-GL_PREFIX(VertexAttrib1dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fNV)
- .type GL_PREFIX(VertexAttrib1fNV), @function
-GL_PREFIX(VertexAttrib1fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6064(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fvNV)
- .type GL_PREFIX(VertexAttrib1fvNV), @function
-GL_PREFIX(VertexAttrib1fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1sNV)
- .type GL_PREFIX(VertexAttrib1sNV), @function
-GL_PREFIX(VertexAttrib1sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1svNV)
- .type GL_PREFIX(VertexAttrib1svNV), @function
-GL_PREFIX(VertexAttrib1svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dNV)
- .type GL_PREFIX(VertexAttrib2dNV), @function
-GL_PREFIX(VertexAttrib2dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6096(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dvNV)
- .type GL_PREFIX(VertexAttrib2dvNV), @function
-GL_PREFIX(VertexAttrib2dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fNV)
- .type GL_PREFIX(VertexAttrib2fNV), @function
-GL_PREFIX(VertexAttrib2fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6112(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fvNV)
- .type GL_PREFIX(VertexAttrib2fvNV), @function
-GL_PREFIX(VertexAttrib2fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2sNV)
- .type GL_PREFIX(VertexAttrib2sNV), @function
-GL_PREFIX(VertexAttrib2sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2svNV)
- .type GL_PREFIX(VertexAttrib2svNV), @function
-GL_PREFIX(VertexAttrib2svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dNV)
- .type GL_PREFIX(VertexAttrib3dNV), @function
-GL_PREFIX(VertexAttrib3dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6144(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dvNV)
- .type GL_PREFIX(VertexAttrib3dvNV), @function
-GL_PREFIX(VertexAttrib3dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fNV)
- .type GL_PREFIX(VertexAttrib3fNV), @function
-GL_PREFIX(VertexAttrib3fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6160(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fvNV)
- .type GL_PREFIX(VertexAttrib3fvNV), @function
-GL_PREFIX(VertexAttrib3fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3sNV)
- .type GL_PREFIX(VertexAttrib3sNV), @function
-GL_PREFIX(VertexAttrib3sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3svNV)
- .type GL_PREFIX(VertexAttrib3svNV), @function
-GL_PREFIX(VertexAttrib3svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dNV)
- .type GL_PREFIX(VertexAttrib4dNV), @function
-GL_PREFIX(VertexAttrib4dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6192(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dvNV)
- .type GL_PREFIX(VertexAttrib4dvNV), @function
-GL_PREFIX(VertexAttrib4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fNV)
- .type GL_PREFIX(VertexAttrib4fNV), @function
-GL_PREFIX(VertexAttrib4fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6208(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fvNV)
- .type GL_PREFIX(VertexAttrib4fvNV), @function
-GL_PREFIX(VertexAttrib4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4sNV)
- .type GL_PREFIX(VertexAttrib4sNV), @function
-GL_PREFIX(VertexAttrib4sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4svNV)
- .type GL_PREFIX(VertexAttrib4svNV), @function
-GL_PREFIX(VertexAttrib4svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ubNV)
- .type GL_PREFIX(VertexAttrib4ubNV), @function
-GL_PREFIX(VertexAttrib4ubNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ubvNV)
- .type GL_PREFIX(VertexAttrib4ubvNV), @function
-GL_PREFIX(VertexAttrib4ubvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenFragmentShadersATI)
- .type GL_PREFIX(GenFragmentShadersATI), @function
-GL_PREFIX(GenFragmentShadersATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindFragmentShaderATI)
- .type GL_PREFIX(BindFragmentShaderATI), @function
-GL_PREFIX(BindFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteFragmentShaderATI)
- .type GL_PREFIX(DeleteFragmentShaderATI), @function
-GL_PREFIX(DeleteFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(BeginFragmentShaderATI)
- .type GL_PREFIX(BeginFragmentShaderATI), @function
-GL_PREFIX(BeginFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 6280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6280(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 6280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndFragmentShaderATI)
- .type GL_PREFIX(EndFragmentShaderATI), @function
-GL_PREFIX(EndFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 6288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6288(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 6288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(PassTexCoordATI)
- .type GL_PREFIX(PassTexCoordATI), @function
-GL_PREFIX(PassTexCoordATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(SampleMapATI)
- .type GL_PREFIX(SampleMapATI), @function
-GL_PREFIX(SampleMapATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorFragmentOp1ATI)
- .type GL_PREFIX(ColorFragmentOp1ATI), @function
-GL_PREFIX(ColorFragmentOp1ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorFragmentOp2ATI)
- .type GL_PREFIX(ColorFragmentOp2ATI), @function
-GL_PREFIX(ColorFragmentOp2ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorFragmentOp3ATI)
- .type GL_PREFIX(ColorFragmentOp3ATI), @function
-GL_PREFIX(ColorFragmentOp3ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFragmentOp1ATI)
- .type GL_PREFIX(AlphaFragmentOp1ATI), @function
-GL_PREFIX(AlphaFragmentOp1ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFragmentOp2ATI)
- .type GL_PREFIX(AlphaFragmentOp2ATI), @function
-GL_PREFIX(AlphaFragmentOp2ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFragmentOp3ATI)
- .type GL_PREFIX(AlphaFragmentOp3ATI), @function
-GL_PREFIX(AlphaFragmentOp3ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(SetFragmentShaderConstantATI)
- .type GL_PREFIX(SetFragmentShaderConstantATI), @function
-GL_PREFIX(SetFragmentShaderConstantATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsRenderbufferEXT)
- .type GL_PREFIX(IsRenderbufferEXT), @function
-GL_PREFIX(IsRenderbufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindRenderbufferEXT)
- .type GL_PREFIX(BindRenderbufferEXT), @function
-GL_PREFIX(BindRenderbufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteRenderbuffersEXT)
- .type GL_PREFIX(DeleteRenderbuffersEXT), @function
-GL_PREFIX(DeleteRenderbuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenRenderbuffersEXT)
- .type GL_PREFIX(GenRenderbuffersEXT), @function
-GL_PREFIX(GenRenderbuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(RenderbufferStorageEXT)
- .type GL_PREFIX(RenderbufferStorageEXT), @function
-GL_PREFIX(RenderbufferStorageEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetRenderbufferParameterivEXT)
- .type GL_PREFIX(GetRenderbufferParameterivEXT), @function
-GL_PREFIX(GetRenderbufferParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsFramebufferEXT)
- .type GL_PREFIX(IsFramebufferEXT), @function
-GL_PREFIX(IsFramebufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindFramebufferEXT)
- .type GL_PREFIX(BindFramebufferEXT), @function
-GL_PREFIX(BindFramebufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteFramebuffersEXT)
- .type GL_PREFIX(DeleteFramebuffersEXT), @function
-GL_PREFIX(DeleteFramebuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenFramebuffersEXT)
- .type GL_PREFIX(GenFramebuffersEXT), @function
-GL_PREFIX(GenFramebuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(CheckFramebufferStatusEXT)
- .type GL_PREFIX(CheckFramebufferStatusEXT), @function
-GL_PREFIX(CheckFramebufferStatusEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture1DEXT)
- .type GL_PREFIX(FramebufferTexture1DEXT), @function
-GL_PREFIX(FramebufferTexture1DEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture2DEXT)
- .type GL_PREFIX(FramebufferTexture2DEXT), @function
-GL_PREFIX(FramebufferTexture2DEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture3DEXT)
- .type GL_PREFIX(FramebufferTexture3DEXT), @function
-GL_PREFIX(FramebufferTexture3DEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferRenderbufferEXT)
- .type GL_PREFIX(FramebufferRenderbufferEXT), @function
-GL_PREFIX(FramebufferRenderbufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
- .type GL_PREFIX(GetFramebufferAttachmentParameterivEXT), @function
-GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenerateMipmapEXT)
- .type GL_PREFIX(GenerateMipmapEXT), @function
-GL_PREFIX(GenerateMipmapEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilFuncSeparate)
- .type GL_PREFIX(StencilFuncSeparate), @function
-GL_PREFIX(StencilFuncSeparate):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilOpSeparate)
- .type GL_PREFIX(StencilOpSeparate), @function
-GL_PREFIX(StencilOpSeparate):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilMaskSeparate)
- .type GL_PREFIX(StencilMaskSeparate), @function
-GL_PREFIX(StencilMaskSeparate):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate)
-
- .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
- .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
- .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays)
- .globl GL_PREFIX(CopyTexImage1DEXT) ; .set GL_PREFIX(CopyTexImage1DEXT), GL_PREFIX(CopyTexImage1D)
- .globl GL_PREFIX(CopyTexImage2DEXT) ; .set GL_PREFIX(CopyTexImage2DEXT), GL_PREFIX(CopyTexImage2D)
- .globl GL_PREFIX(CopyTexSubImage1DEXT) ; .set GL_PREFIX(CopyTexSubImage1DEXT), GL_PREFIX(CopyTexSubImage1D)
- .globl GL_PREFIX(CopyTexSubImage2DEXT) ; .set GL_PREFIX(CopyTexSubImage2DEXT), GL_PREFIX(CopyTexSubImage2D)
- .globl GL_PREFIX(DeleteTexturesEXT) ; .set GL_PREFIX(DeleteTexturesEXT), GL_PREFIX(DeleteTextures)
- .globl GL_PREFIX(GetPointervEXT) ; .set GL_PREFIX(GetPointervEXT), GL_PREFIX(GetPointerv)
- .globl GL_PREFIX(PrioritizeTexturesEXT) ; .set GL_PREFIX(PrioritizeTexturesEXT), GL_PREFIX(PrioritizeTextures)
- .globl GL_PREFIX(TexSubImage1DEXT) ; .set GL_PREFIX(TexSubImage1DEXT), GL_PREFIX(TexSubImage1D)
- .globl GL_PREFIX(TexSubImage2DEXT) ; .set GL_PREFIX(TexSubImage2DEXT), GL_PREFIX(TexSubImage2D)
- .globl GL_PREFIX(BlendColorEXT) ; .set GL_PREFIX(BlendColorEXT), GL_PREFIX(BlendColor)
- .globl GL_PREFIX(BlendEquationEXT) ; .set GL_PREFIX(BlendEquationEXT), GL_PREFIX(BlendEquation)
- .globl GL_PREFIX(DrawRangeElementsEXT) ; .set GL_PREFIX(DrawRangeElementsEXT), GL_PREFIX(DrawRangeElements)
- .globl GL_PREFIX(ColorTableSGI) ; .set GL_PREFIX(ColorTableSGI), GL_PREFIX(ColorTable)
- .globl GL_PREFIX(ColorTableEXT) ; .set GL_PREFIX(ColorTableEXT), GL_PREFIX(ColorTable)
- .globl GL_PREFIX(ColorTableParameterfvSGI) ; .set GL_PREFIX(ColorTableParameterfvSGI), GL_PREFIX(ColorTableParameterfv)
- .globl GL_PREFIX(ColorTableParameterivSGI) ; .set GL_PREFIX(ColorTableParameterivSGI), GL_PREFIX(ColorTableParameteriv)
- .globl GL_PREFIX(CopyColorTableSGI) ; .set GL_PREFIX(CopyColorTableSGI), GL_PREFIX(CopyColorTable)
- .globl GL_PREFIX(ColorSubTableEXT) ; .set GL_PREFIX(ColorSubTableEXT), GL_PREFIX(ColorSubTable)
- .globl GL_PREFIX(CopyColorSubTableEXT) ; .set GL_PREFIX(CopyColorSubTableEXT), GL_PREFIX(CopyColorSubTable)
- .globl GL_PREFIX(ConvolutionFilter1DEXT) ; .set GL_PREFIX(ConvolutionFilter1DEXT), GL_PREFIX(ConvolutionFilter1D)
- .globl GL_PREFIX(ConvolutionFilter2DEXT) ; .set GL_PREFIX(ConvolutionFilter2DEXT), GL_PREFIX(ConvolutionFilter2D)
- .globl GL_PREFIX(ConvolutionParameterfEXT) ; .set GL_PREFIX(ConvolutionParameterfEXT), GL_PREFIX(ConvolutionParameterf)
- .globl GL_PREFIX(ConvolutionParameterfvEXT) ; .set GL_PREFIX(ConvolutionParameterfvEXT), GL_PREFIX(ConvolutionParameterfv)
- .globl GL_PREFIX(ConvolutionParameteriEXT) ; .set GL_PREFIX(ConvolutionParameteriEXT), GL_PREFIX(ConvolutionParameteri)
- .globl GL_PREFIX(ConvolutionParameterivEXT) ; .set GL_PREFIX(ConvolutionParameterivEXT), GL_PREFIX(ConvolutionParameteriv)
- .globl GL_PREFIX(CopyConvolutionFilter1DEXT) ; .set GL_PREFIX(CopyConvolutionFilter1DEXT), GL_PREFIX(CopyConvolutionFilter1D)
- .globl GL_PREFIX(CopyConvolutionFilter2DEXT) ; .set GL_PREFIX(CopyConvolutionFilter2DEXT), GL_PREFIX(CopyConvolutionFilter2D)
- .globl GL_PREFIX(SeparableFilter2DEXT) ; .set GL_PREFIX(SeparableFilter2DEXT), GL_PREFIX(SeparableFilter2D)
- .globl GL_PREFIX(HistogramEXT) ; .set GL_PREFIX(HistogramEXT), GL_PREFIX(Histogram)
- .globl GL_PREFIX(MinmaxEXT) ; .set GL_PREFIX(MinmaxEXT), GL_PREFIX(Minmax)
- .globl GL_PREFIX(ResetHistogramEXT) ; .set GL_PREFIX(ResetHistogramEXT), GL_PREFIX(ResetHistogram)
- .globl GL_PREFIX(ResetMinmaxEXT) ; .set GL_PREFIX(ResetMinmaxEXT), GL_PREFIX(ResetMinmax)
- .globl GL_PREFIX(TexImage3DEXT) ; .set GL_PREFIX(TexImage3DEXT), GL_PREFIX(TexImage3D)
- .globl GL_PREFIX(TexSubImage3DEXT) ; .set GL_PREFIX(TexSubImage3DEXT), GL_PREFIX(TexSubImage3D)
- .globl GL_PREFIX(CopyTexSubImage3DEXT) ; .set GL_PREFIX(CopyTexSubImage3DEXT), GL_PREFIX(CopyTexSubImage3D)
- .globl GL_PREFIX(ActiveTexture) ; .set GL_PREFIX(ActiveTexture), GL_PREFIX(ActiveTextureARB)
- .globl GL_PREFIX(ClientActiveTexture) ; .set GL_PREFIX(ClientActiveTexture), GL_PREFIX(ClientActiveTextureARB)
- .globl GL_PREFIX(MultiTexCoord1d) ; .set GL_PREFIX(MultiTexCoord1d), GL_PREFIX(MultiTexCoord1dARB)
- .globl GL_PREFIX(MultiTexCoord1dv) ; .set GL_PREFIX(MultiTexCoord1dv), GL_PREFIX(MultiTexCoord1dvARB)
- .globl GL_PREFIX(MultiTexCoord1f) ; .set GL_PREFIX(MultiTexCoord1f), GL_PREFIX(MultiTexCoord1fARB)
- .globl GL_PREFIX(MultiTexCoord1fv) ; .set GL_PREFIX(MultiTexCoord1fv), GL_PREFIX(MultiTexCoord1fvARB)
- .globl GL_PREFIX(MultiTexCoord1i) ; .set GL_PREFIX(MultiTexCoord1i), GL_PREFIX(MultiTexCoord1iARB)
- .globl GL_PREFIX(MultiTexCoord1iv) ; .set GL_PREFIX(MultiTexCoord1iv), GL_PREFIX(MultiTexCoord1ivARB)
- .globl GL_PREFIX(MultiTexCoord1s) ; .set GL_PREFIX(MultiTexCoord1s), GL_PREFIX(MultiTexCoord1sARB)
- .globl GL_PREFIX(MultiTexCoord1sv) ; .set GL_PREFIX(MultiTexCoord1sv), GL_PREFIX(MultiTexCoord1svARB)
- .globl GL_PREFIX(MultiTexCoord2d) ; .set GL_PREFIX(MultiTexCoord2d), GL_PREFIX(MultiTexCoord2dARB)
- .globl GL_PREFIX(MultiTexCoord2dv) ; .set GL_PREFIX(MultiTexCoord2dv), GL_PREFIX(MultiTexCoord2dvARB)
- .globl GL_PREFIX(MultiTexCoord2f) ; .set GL_PREFIX(MultiTexCoord2f), GL_PREFIX(MultiTexCoord2fARB)
- .globl GL_PREFIX(MultiTexCoord2fv) ; .set GL_PREFIX(MultiTexCoord2fv), GL_PREFIX(MultiTexCoord2fvARB)
- .globl GL_PREFIX(MultiTexCoord2i) ; .set GL_PREFIX(MultiTexCoord2i), GL_PREFIX(MultiTexCoord2iARB)
- .globl GL_PREFIX(MultiTexCoord2iv) ; .set GL_PREFIX(MultiTexCoord2iv), GL_PREFIX(MultiTexCoord2ivARB)
- .globl GL_PREFIX(MultiTexCoord2s) ; .set GL_PREFIX(MultiTexCoord2s), GL_PREFIX(MultiTexCoord2sARB)
- .globl GL_PREFIX(MultiTexCoord2sv) ; .set GL_PREFIX(MultiTexCoord2sv), GL_PREFIX(MultiTexCoord2svARB)
- .globl GL_PREFIX(MultiTexCoord3d) ; .set GL_PREFIX(MultiTexCoord3d), GL_PREFIX(MultiTexCoord3dARB)
- .globl GL_PREFIX(MultiTexCoord3dv) ; .set GL_PREFIX(MultiTexCoord3dv), GL_PREFIX(MultiTexCoord3dvARB)
- .globl GL_PREFIX(MultiTexCoord3f) ; .set GL_PREFIX(MultiTexCoord3f), GL_PREFIX(MultiTexCoord3fARB)
- .globl GL_PREFIX(MultiTexCoord3fv) ; .set GL_PREFIX(MultiTexCoord3fv), GL_PREFIX(MultiTexCoord3fvARB)
- .globl GL_PREFIX(MultiTexCoord3i) ; .set GL_PREFIX(MultiTexCoord3i), GL_PREFIX(MultiTexCoord3iARB)
- .globl GL_PREFIX(MultiTexCoord3iv) ; .set GL_PREFIX(MultiTexCoord3iv), GL_PREFIX(MultiTexCoord3ivARB)
- .globl GL_PREFIX(MultiTexCoord3s) ; .set GL_PREFIX(MultiTexCoord3s), GL_PREFIX(MultiTexCoord3sARB)
- .globl GL_PREFIX(MultiTexCoord3sv) ; .set GL_PREFIX(MultiTexCoord3sv), GL_PREFIX(MultiTexCoord3svARB)
- .globl GL_PREFIX(MultiTexCoord4d) ; .set GL_PREFIX(MultiTexCoord4d), GL_PREFIX(MultiTexCoord4dARB)
- .globl GL_PREFIX(MultiTexCoord4dv) ; .set GL_PREFIX(MultiTexCoord4dv), GL_PREFIX(MultiTexCoord4dvARB)
- .globl GL_PREFIX(MultiTexCoord4f) ; .set GL_PREFIX(MultiTexCoord4f), GL_PREFIX(MultiTexCoord4fARB)
- .globl GL_PREFIX(MultiTexCoord4fv) ; .set GL_PREFIX(MultiTexCoord4fv), GL_PREFIX(MultiTexCoord4fvARB)
- .globl GL_PREFIX(MultiTexCoord4i) ; .set GL_PREFIX(MultiTexCoord4i), GL_PREFIX(MultiTexCoord4iARB)
- .globl GL_PREFIX(MultiTexCoord4iv) ; .set GL_PREFIX(MultiTexCoord4iv), GL_PREFIX(MultiTexCoord4ivARB)
- .globl GL_PREFIX(MultiTexCoord4s) ; .set GL_PREFIX(MultiTexCoord4s), GL_PREFIX(MultiTexCoord4sARB)
- .globl GL_PREFIX(MultiTexCoord4sv) ; .set GL_PREFIX(MultiTexCoord4sv), GL_PREFIX(MultiTexCoord4svARB)
- .globl GL_PREFIX(LoadTransposeMatrixf) ; .set GL_PREFIX(LoadTransposeMatrixf), GL_PREFIX(LoadTransposeMatrixfARB)
- .globl GL_PREFIX(LoadTransposeMatrixd) ; .set GL_PREFIX(LoadTransposeMatrixd), GL_PREFIX(LoadTransposeMatrixdARB)
- .globl GL_PREFIX(MultTransposeMatrixf) ; .set GL_PREFIX(MultTransposeMatrixf), GL_PREFIX(MultTransposeMatrixfARB)
- .globl GL_PREFIX(MultTransposeMatrixd) ; .set GL_PREFIX(MultTransposeMatrixd), GL_PREFIX(MultTransposeMatrixdARB)
- .globl GL_PREFIX(SampleCoverage) ; .set GL_PREFIX(SampleCoverage), GL_PREFIX(SampleCoverageARB)
- .globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB)
- .globl GL_PREFIX(SampleMaskEXT) ; .set GL_PREFIX(SampleMaskEXT), GL_PREFIX(SampleMaskSGIS)
- .globl GL_PREFIX(SamplePatternEXT) ; .set GL_PREFIX(SamplePatternEXT), GL_PREFIX(SamplePatternSGIS)
- .globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT)
- .globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT)
- .globl GL_PREFIX(PointParameterfSGIS) ; .set GL_PREFIX(PointParameterfSGIS), GL_PREFIX(PointParameterfEXT)
- .globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT)
- .globl GL_PREFIX(PointParameterfvARB) ; .set GL_PREFIX(PointParameterfvARB), GL_PREFIX(PointParameterfvEXT)
- .globl GL_PREFIX(PointParameterfvSGIS) ; .set GL_PREFIX(PointParameterfvSGIS), GL_PREFIX(PointParameterfvEXT)
- .globl GL_PREFIX(WindowPos2d) ; .set GL_PREFIX(WindowPos2d), GL_PREFIX(WindowPos2dMESA)
- .globl GL_PREFIX(WindowPos2dARB) ; .set GL_PREFIX(WindowPos2dARB), GL_PREFIX(WindowPos2dMESA)
- .globl GL_PREFIX(WindowPos2dv) ; .set GL_PREFIX(WindowPos2dv), GL_PREFIX(WindowPos2dvMESA)
- .globl GL_PREFIX(WindowPos2dvARB) ; .set GL_PREFIX(WindowPos2dvARB), GL_PREFIX(WindowPos2dvMESA)
- .globl GL_PREFIX(WindowPos2f) ; .set GL_PREFIX(WindowPos2f), GL_PREFIX(WindowPos2fMESA)
- .globl GL_PREFIX(WindowPos2fARB) ; .set GL_PREFIX(WindowPos2fARB), GL_PREFIX(WindowPos2fMESA)
- .globl GL_PREFIX(WindowPos2fv) ; .set GL_PREFIX(WindowPos2fv), GL_PREFIX(WindowPos2fvMESA)
- .globl GL_PREFIX(WindowPos2fvARB) ; .set GL_PREFIX(WindowPos2fvARB), GL_PREFIX(WindowPos2fvMESA)
- .globl GL_PREFIX(WindowPos2i) ; .set GL_PREFIX(WindowPos2i), GL_PREFIX(WindowPos2iMESA)
- .globl GL_PREFIX(WindowPos2iARB) ; .set GL_PREFIX(WindowPos2iARB), GL_PREFIX(WindowPos2iMESA)
- .globl GL_PREFIX(WindowPos2iv) ; .set GL_PREFIX(WindowPos2iv), GL_PREFIX(WindowPos2ivMESA)
- .globl GL_PREFIX(WindowPos2ivARB) ; .set GL_PREFIX(WindowPos2ivARB), GL_PREFIX(WindowPos2ivMESA)
- .globl GL_PREFIX(WindowPos2s) ; .set GL_PREFIX(WindowPos2s), GL_PREFIX(WindowPos2sMESA)
- .globl GL_PREFIX(WindowPos2sARB) ; .set GL_PREFIX(WindowPos2sARB), GL_PREFIX(WindowPos2sMESA)
- .globl GL_PREFIX(WindowPos2sv) ; .set GL_PREFIX(WindowPos2sv), GL_PREFIX(WindowPos2svMESA)
- .globl GL_PREFIX(WindowPos2svARB) ; .set GL_PREFIX(WindowPos2svARB), GL_PREFIX(WindowPos2svMESA)
- .globl GL_PREFIX(WindowPos3d) ; .set GL_PREFIX(WindowPos3d), GL_PREFIX(WindowPos3dMESA)
- .globl GL_PREFIX(WindowPos3dARB) ; .set GL_PREFIX(WindowPos3dARB), GL_PREFIX(WindowPos3dMESA)
- .globl GL_PREFIX(WindowPos3dv) ; .set GL_PREFIX(WindowPos3dv), GL_PREFIX(WindowPos3dvMESA)
- .globl GL_PREFIX(WindowPos3dvARB) ; .set GL_PREFIX(WindowPos3dvARB), GL_PREFIX(WindowPos3dvMESA)
- .globl GL_PREFIX(WindowPos3f) ; .set GL_PREFIX(WindowPos3f), GL_PREFIX(WindowPos3fMESA)
- .globl GL_PREFIX(WindowPos3fARB) ; .set GL_PREFIX(WindowPos3fARB), GL_PREFIX(WindowPos3fMESA)
- .globl GL_PREFIX(WindowPos3fv) ; .set GL_PREFIX(WindowPos3fv), GL_PREFIX(WindowPos3fvMESA)
- .globl GL_PREFIX(WindowPos3fvARB) ; .set GL_PREFIX(WindowPos3fvARB), GL_PREFIX(WindowPos3fvMESA)
- .globl GL_PREFIX(WindowPos3i) ; .set GL_PREFIX(WindowPos3i), GL_PREFIX(WindowPos3iMESA)
- .globl GL_PREFIX(WindowPos3iARB) ; .set GL_PREFIX(WindowPos3iARB), GL_PREFIX(WindowPos3iMESA)
- .globl GL_PREFIX(WindowPos3iv) ; .set GL_PREFIX(WindowPos3iv), GL_PREFIX(WindowPos3ivMESA)
- .globl GL_PREFIX(WindowPos3ivARB) ; .set GL_PREFIX(WindowPos3ivARB), GL_PREFIX(WindowPos3ivMESA)
- .globl GL_PREFIX(WindowPos3s) ; .set GL_PREFIX(WindowPos3s), GL_PREFIX(WindowPos3sMESA)
- .globl GL_PREFIX(WindowPos3sARB) ; .set GL_PREFIX(WindowPos3sARB), GL_PREFIX(WindowPos3sMESA)
- .globl GL_PREFIX(WindowPos3sv) ; .set GL_PREFIX(WindowPos3sv), GL_PREFIX(WindowPos3svMESA)
- .globl GL_PREFIX(WindowPos3svARB) ; .set GL_PREFIX(WindowPos3svARB), GL_PREFIX(WindowPos3svMESA)
- .globl GL_PREFIX(BlendFuncSeparate) ; .set GL_PREFIX(BlendFuncSeparate), GL_PREFIX(BlendFuncSeparateEXT)
- .globl GL_PREFIX(BlendFuncSeparateINGR) ; .set GL_PREFIX(BlendFuncSeparateINGR), GL_PREFIX(BlendFuncSeparateEXT)
- .globl GL_PREFIX(FogCoordf) ; .set GL_PREFIX(FogCoordf), GL_PREFIX(FogCoordfEXT)
- .globl GL_PREFIX(FogCoordfv) ; .set GL_PREFIX(FogCoordfv), GL_PREFIX(FogCoordfvEXT)
- .globl GL_PREFIX(FogCoordd) ; .set GL_PREFIX(FogCoordd), GL_PREFIX(FogCoorddEXT)
- .globl GL_PREFIX(FogCoorddv) ; .set GL_PREFIX(FogCoorddv), GL_PREFIX(FogCoorddvEXT)
- .globl GL_PREFIX(FogCoordPointer) ; .set GL_PREFIX(FogCoordPointer), GL_PREFIX(FogCoordPointerEXT)
- .globl GL_PREFIX(CompressedTexImage3D) ; .set GL_PREFIX(CompressedTexImage3D), GL_PREFIX(CompressedTexImage3DARB)
- .globl GL_PREFIX(CompressedTexImage2D) ; .set GL_PREFIX(CompressedTexImage2D), GL_PREFIX(CompressedTexImage2DARB)
- .globl GL_PREFIX(CompressedTexImage1D) ; .set GL_PREFIX(CompressedTexImage1D), GL_PREFIX(CompressedTexImage1DARB)
- .globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB)
- .globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB)
- .globl GL_PREFIX(CompressedTexSubImage1D) ; .set GL_PREFIX(CompressedTexSubImage1D), GL_PREFIX(CompressedTexSubImage1DARB)
- .globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB)
- .globl GL_PREFIX(SecondaryColor3b) ; .set GL_PREFIX(SecondaryColor3b), GL_PREFIX(SecondaryColor3bEXT)
- .globl GL_PREFIX(SecondaryColor3bv) ; .set GL_PREFIX(SecondaryColor3bv), GL_PREFIX(SecondaryColor3bvEXT)
- .globl GL_PREFIX(SecondaryColor3d) ; .set GL_PREFIX(SecondaryColor3d), GL_PREFIX(SecondaryColor3dEXT)
- .globl GL_PREFIX(SecondaryColor3dv) ; .set GL_PREFIX(SecondaryColor3dv), GL_PREFIX(SecondaryColor3dvEXT)
- .globl GL_PREFIX(SecondaryColor3f) ; .set GL_PREFIX(SecondaryColor3f), GL_PREFIX(SecondaryColor3fEXT)
- .globl GL_PREFIX(SecondaryColor3fv) ; .set GL_PREFIX(SecondaryColor3fv), GL_PREFIX(SecondaryColor3fvEXT)
- .globl GL_PREFIX(SecondaryColor3i) ; .set GL_PREFIX(SecondaryColor3i), GL_PREFIX(SecondaryColor3iEXT)
- .globl GL_PREFIX(SecondaryColor3iv) ; .set GL_PREFIX(SecondaryColor3iv), GL_PREFIX(SecondaryColor3ivEXT)
- .globl GL_PREFIX(SecondaryColor3s) ; .set GL_PREFIX(SecondaryColor3s), GL_PREFIX(SecondaryColor3sEXT)
- .globl GL_PREFIX(SecondaryColor3sv) ; .set GL_PREFIX(SecondaryColor3sv), GL_PREFIX(SecondaryColor3svEXT)
- .globl GL_PREFIX(SecondaryColor3ub) ; .set GL_PREFIX(SecondaryColor3ub), GL_PREFIX(SecondaryColor3ubEXT)
- .globl GL_PREFIX(SecondaryColor3ubv) ; .set GL_PREFIX(SecondaryColor3ubv), GL_PREFIX(SecondaryColor3ubvEXT)
- .globl GL_PREFIX(SecondaryColor3ui) ; .set GL_PREFIX(SecondaryColor3ui), GL_PREFIX(SecondaryColor3uiEXT)
- .globl GL_PREFIX(SecondaryColor3uiv) ; .set GL_PREFIX(SecondaryColor3uiv), GL_PREFIX(SecondaryColor3uivEXT)
- .globl GL_PREFIX(SecondaryColor3us) ; .set GL_PREFIX(SecondaryColor3us), GL_PREFIX(SecondaryColor3usEXT)
- .globl GL_PREFIX(SecondaryColor3usv) ; .set GL_PREFIX(SecondaryColor3usv), GL_PREFIX(SecondaryColor3usvEXT)
- .globl GL_PREFIX(SecondaryColorPointer) ; .set GL_PREFIX(SecondaryColorPointer), GL_PREFIX(SecondaryColorPointerEXT)
- .globl GL_PREFIX(BindProgramARB) ; .set GL_PREFIX(BindProgramARB), GL_PREFIX(BindProgramNV)
- .globl GL_PREFIX(DeleteProgramsARB) ; .set GL_PREFIX(DeleteProgramsARB), GL_PREFIX(DeleteProgramsNV)
- .globl GL_PREFIX(GenProgramsARB) ; .set GL_PREFIX(GenProgramsARB), GL_PREFIX(GenProgramsNV)
- .globl GL_PREFIX(GetVertexAttribPointervARB) ; .set GL_PREFIX(GetVertexAttribPointervARB), GL_PREFIX(GetVertexAttribPointervNV)
- .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV)
- .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV)
- .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV)
- .globl GL_PREFIX(MultiDrawArrays) ; .set GL_PREFIX(MultiDrawArrays), GL_PREFIX(MultiDrawArraysEXT)
- .globl GL_PREFIX(MultiDrawElements) ; .set GL_PREFIX(MultiDrawElements), GL_PREFIX(MultiDrawElementsEXT)
- .globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB)
- .globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB)
- .globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB)
- .globl GL_PREFIX(DeleteBuffers) ; .set GL_PREFIX(DeleteBuffers), GL_PREFIX(DeleteBuffersARB)
- .globl GL_PREFIX(GenBuffers) ; .set GL_PREFIX(GenBuffers), GL_PREFIX(GenBuffersARB)
- .globl GL_PREFIX(GetBufferParameteriv) ; .set GL_PREFIX(GetBufferParameteriv), GL_PREFIX(GetBufferParameterivARB)
- .globl GL_PREFIX(GetBufferPointerv) ; .set GL_PREFIX(GetBufferPointerv), GL_PREFIX(GetBufferPointervARB)
- .globl GL_PREFIX(GetBufferSubData) ; .set GL_PREFIX(GetBufferSubData), GL_PREFIX(GetBufferSubDataARB)
- .globl GL_PREFIX(IsBuffer) ; .set GL_PREFIX(IsBuffer), GL_PREFIX(IsBufferARB)
- .globl GL_PREFIX(MapBuffer) ; .set GL_PREFIX(MapBuffer), GL_PREFIX(MapBufferARB)
- .globl GL_PREFIX(UnmapBuffer) ; .set GL_PREFIX(UnmapBuffer), GL_PREFIX(UnmapBufferARB)
- .globl GL_PREFIX(GenQueries) ; .set GL_PREFIX(GenQueries), GL_PREFIX(GenQueriesARB)
- .globl GL_PREFIX(DeleteQueries) ; .set GL_PREFIX(DeleteQueries), GL_PREFIX(DeleteQueriesARB)
- .globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB)
- .globl GL_PREFIX(BeginQuery) ; .set GL_PREFIX(BeginQuery), GL_PREFIX(BeginQueryARB)
- .globl GL_PREFIX(EndQuery) ; .set GL_PREFIX(EndQuery), GL_PREFIX(EndQueryARB)
- .globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB)
- .globl GL_PREFIX(GetQueryObjectiv) ; .set GL_PREFIX(GetQueryObjectiv), GL_PREFIX(GetQueryObjectivARB)
- .globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB)
- .globl GL_PREFIX(BlendEquationSeparateATI) ; .set GL_PREFIX(BlendEquationSeparateATI), GL_PREFIX(BlendEquationSeparateEXT)
-
-#if defined(GLX_USE_TLS) && defined(__linux__)
- .section ".note.ABI-tag", "a"
- .p2align 2
- .long 1f - 0f /* name length */
- .long 3f - 2f /* data length */
- .long 1 /* note length */
-0: .asciz "GNU" /* vendor name */
-1: .p2align 2
-2: .long 0 /* note data: the ABI tag */
- .long 2,4,20 /* Minimum kernel version w/TLS */
-3: .p2align 2 /* pad out section */
-#endif /* GLX_USE_TLS */
diff --git a/nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.c b/nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.c
deleted file mode 100644
index 13393bc21..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $Id: x86-64.c,v 1.1.1.1 2005/07/31 16:46:23 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * x86-64 optimizations shamelessy converted from x86/sse/3dnow assembly by
- * Mikko Tiihonen
- */
-
-#ifdef USE_X86_64_ASM
-
-#include "glheader.h"
-#include "context.h"
-#include "math/m_xform.h"
-#include "tnl/t_context.h"
-#include "x86-64.h"
-#include "../x86/common_x86_macros.h"
-
-#ifdef DEBUG
-#include "math/m_debug.h"
-#endif
-
-DECLARE_XFORM_GROUP( x86_64, 4 )
-
-#endif
-
-/*
-extern void _mesa_x86_64_transform_points4_general( XFORM_ARGS );
-extern void _mesa_x86_64_transform_points4_identity( XFORM_ARGS );
-extern void _mesa_x86_64_transform_points4_perspective( XFORM_ARGS );
-extern void _mesa_x86_64_transform_points4_3d( XFORM_ARGS );
-extern void _mesa_x86_64_transform_points4_3d_no_rot( XFORM_ARGS );
-extern void _mesa_x86_64_transform_points4_2d_no_rot( XFORM_ARGS );
-extern void _mesa_x86_64_transform_points4_2d( XFORM_ARGS );
-*/
-
-#ifdef USE_X86_64_ASM
-static void message( const char *msg )
-{
- GLboolean debug;
-#ifdef DEBUG
- debug = GL_TRUE;
-#else
- if ( _mesa_getenv( "MESA_DEBUG" ) ) {
- debug = GL_TRUE;
- } else {
- debug = GL_FALSE;
- }
-#endif
- if ( debug ) {
- fprintf( stderr, "%s", msg );
- }
-}
-#endif
-
-
-void _mesa_init_all_x86_64_transform_asm(void)
-{
-#ifdef USE_X86_64_ASM
-
- if ( _mesa_getenv( "MESA_NO_ASM" ) ) {
- return;
- }
-
- message("Initializing x86-64 optimizations\n");
-
- ASSIGN_XFORM_GROUP( x86_64, 4 );
-
- /*
- _mesa_transform_tab[4][MATRIX_GENERAL] =
- _mesa_x86_64_transform_points4_general;
- _mesa_transform_tab[4][MATRIX_IDENTITY] =
- _mesa_x86_64_transform_points4_identity;
- _mesa_transform_tab[4][MATRIX_3D] =
- _mesa_x86_64_transform_points4_3d;
- _mesa_transform_tab[4][MATRIX_3D_NO_ROT] =
- _mesa_x86_64_transform_points4_3d_no_rot;
- _mesa_transform_tab[4][MATRIX_PERSPECTIVE] =
- _mesa_x86_64_transform_points4_perspective;
- _mesa_transform_tab[4][MATRIX_2D_NO_ROT] =
- _mesa_x86_64_transform_points4_2d_no_rot;
- _mesa_transform_tab[4][MATRIX_2D] =
- _mesa_x86_64_transform_points4_2d;
- */
-
-#ifdef DEBUG
- _math_test_all_transform_functions("x86_64");
- _math_test_all_cliptest_functions("x86_64");
- _math_test_all_normal_transform_functions("x86_64");
-#endif
-
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.h b/nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.h
deleted file mode 100644
index cfd7857f2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86-64/x86-64.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* $Id: x86-64.h,v 1.1.1.1 2005/07/31 16:46:25 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __X86_64_ASM_H__
-#define __X86_64_ASM_H__
-
-extern void _mesa_init_all_x86_64_transform_asm( void );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86-64/xform4.S b/nx-X11/extras/Mesa/src/mesa/x86-64/xform4.S
deleted file mode 100644
index 96318f2d7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86-64/xform4.S
+++ /dev/null
@@ -1,458 +0,0 @@
-/* $Id: xform4.S,v 1.1.1.1 2005/07/31 16:46:23 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef USE_X86_64_ASM
-
-#include "matypes.h"
-
-.text
-
-.align 16
-
-.globl _mesa_x86_64_transform_points4_general
-_mesa_x86_64_transform_points4_general:
-/*
- * rdi = dest
- * rsi = matrix
- * rdx = source
- */
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- .byte 0x66, 0x66, 0x66, 0x90 /* manual align += 3 */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- testl %ecx, %ecx /* verify non-zero count */
- prefetchnta 64(%rsi)
- jz p4_general_done
-
- movq V4F_START(%rdx), %rdx /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
-
- prefetch 16(%rdx)
-
- movaps 0(%rsi), %xmm4 /* m3 | m2 | m1 | m0 */
- movaps 16(%rsi), %xmm5 /* m7 | m6 | m5 | m4 */
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- movaps 32(%rsi), %xmm6 /* m11 | m10 | m9 | m8 */
- movaps 48(%rsi), %xmm7 /* m15 | m14 | m13 | m12 */
-
-p4_general_loop:
-
- movaps (%rdx), %xmm8 /* ox | oy | oz | ow */
- prefetchw 16(%rdi)
-
- pshufd $0x00, %xmm8, %xmm0 /* ox | ox | ox | ox */
- addq %rax, %rdx
- pshufd $0x55, %xmm8, %xmm1 /* oy | oy | oy | oy */
- mulps %xmm4, %xmm0 /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
- pshufd $0xAA, %xmm8, %xmm2 /* oz | oz | oz | ox */
- mulps %xmm5, %xmm1 /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
- pshufd $0xFF, %xmm8, %xmm3 /* ow | ow | ow | ow */
- mulps %xmm6, %xmm2 /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
- addps %xmm1, %xmm0 /* ox*m3+oy*m7 | ... */
- mulps %xmm7, %xmm3 /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
- addps %xmm2, %xmm0 /* ox*m3+oy*m7+oz*m11 | ... */
- prefetch 16(%rdx)
- addps %xmm3, %xmm0 /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
-
- movaps %xmm0, (%rdi) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
- addq $16, %rdi
-
- decl %ecx
- jnz p4_general_loop
-
-p4_general_done:
- .byte 0xf3
- ret
-
-.section .rodata
-
-.align 16
-p4_constants:
-.byte 0xff, 0xff, 0xff, 0xff
-.byte 0xff, 0xff, 0xff, 0xff
-.byte 0xff, 0xff, 0xff, 0xff
-.byte 0x00, 0x00, 0x00, 0x00
-
-.byte 0x00, 0x00, 0x00, 0x00
-.byte 0x00, 0x00, 0x00, 0x00
-.byte 0x00, 0x00, 0x00, 0x00
-.float 0f+1.0
-
-.text
-.align 16
-.globl _mesa_x86_64_transform_points4_3d
-/*
- * this is slower than _mesa_x86_64_transform_points4_general
- * because it ensures that the last matrix row (or is it column?) is 0,0,0,1
- */
-_mesa_x86_64_transform_points4_3d:
-
- leaq p4_constants(%rip), %rax
-
- prefetchnta 64(%rsi)
-
- movaps (%rax), %xmm9
- movaps 16(%rax), %xmm10
-
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- testl %ecx, %ecx /* verify non-zero count */
- jz p4_3d_done
-
- movq V4F_START(%rdx), %rdx /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
-
- prefetch 16(%rdx)
-
- movaps 0(%rsi), %xmm4 /* m3 | m2 | m1 | m0 */
- movaps 16(%rsi), %xmm5 /* m7 | m6 | m5 | m4 */
- andps %xmm9, %xmm4 /* 0.0 | m2 | m1 | m0 */
- movaps 32(%rsi), %xmm6 /* m11 | m10 | m9 | m8 */
- andps %xmm9, %xmm5 /* 0.0 | m6 | m5 | m4 */
- movaps 48(%rsi), %xmm7 /* m15 | m14 | m13 | m12 */
- andps %xmm9, %xmm6 /* 0.0 | m10 | m9 | m8 */
- andps %xmm9, %xmm7 /* 0.0 | m14 | m13 | m12 */
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- orps %xmm10, %xmm7 /* 1.0 | m14 | m13 | m12 */
-
-p4_3d_loop:
-
- movaps (%rdx), %xmm8 /* ox | oy | oz | ow */
- prefetchw 16(%rdi)
-
- pshufd $0x00, %xmm8, %xmm0 /* ox | ox | ox | ox */
- addq %rax, %rdx
- pshufd $0x55, %xmm8, %xmm1 /* oy | oy | oy | oy */
- mulps %xmm4, %xmm0 /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
- pshufd $0xAA, %xmm8, %xmm2 /* oz | oz | oz | ox */
- mulps %xmm5, %xmm1 /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
- pshufd $0xFF, %xmm8, %xmm3 /* ow | ow | ow | ow */
- mulps %xmm6, %xmm2 /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
- addps %xmm1, %xmm0 /* ox*m3+oy*m7 | ... */
- mulps %xmm7, %xmm3 /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
- addps %xmm2, %xmm0 /* ox*m3+oy*m7+oz*m11 | ... */
- prefetch 16(%rdx)
- addps %xmm3, %xmm0 /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
-
- movaps %xmm0, (%rdi) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
- addq $16, %rdi
-
- dec %ecx
- jnz p4_3d_loop
-
-p4_3d_done:
- .byte 0xf3
- ret
-
-
-.align 16
-.globl _mesa_x86_64_transform_points4_identity
-_mesa_x86_64_transform_points4_identity:
-
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- test %ecx, %ecx
- jz p4_identity_done
-
- movq V4F_START(%rdx), %rsi /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
- prefetch 64(%rsi)
- prefetchw 64(%rdi)
-
- add %ecx, %ecx
-
- rep movsq
-
-p4_identity_done:
- .byte 0xf3
- ret
-
-
-.align 16
-.globl _mesa_x86_64_transform_points4_3d_no_rot
-_mesa_x86_64_transform_points4_3d_no_rot:
-
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- test %ecx, %ecx
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- jz p4_3d_no_rot_done
-
- movq V4F_START(%rdx), %rdx /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
-
- prefetch (%rdx)
-
- movd (%rsi), %mm0 /* | m00 */
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- punpckldq 20(%rsi), %mm0 /* m11 | m00 */
-
- movd 40(%rsi), %mm2 /* | m22 */
- movq 48(%rsi), %mm1 /* m31 | m30 */
-
- punpckldq 56(%rsi), %mm2 /* m11 | m00 */
-
-p4_3d_no_rot_loop:
-
- prefetchw 32(%rdi)
-
- movq (%rdx), %mm4 /* x1 | x0 */
- movq 8(%rdx), %mm5 /* x3 | x2 */
- movd 12(%rdx), %mm7 /* | x3 */
-
- movq %mm5, %mm6 /* x3 | x2 */
- pfmul %mm0, %mm4 /* x1*m11 | x0*m00 */
-
- punpckhdq %mm6, %mm6 /* x3 | x3 */
- pfmul %mm2, %mm5 /* x3*m32 | x2*m22 */
-
- pfmul %mm1, %mm6 /* x3*m31 | x3*m30 */
- pfacc %mm7, %mm5 /* x3 | x2*m22+x3*m32 */
-
- pfadd %mm6, %mm4 /* x1*m11+x3*m31 | x0*m00+x3*m30 */
-
- addq %rax, %rdx
- movq %mm4, (%rdi) /* write r0, r1 */
- movq %mm5, 8(%rdi) /* write r2, r3 */
-
- addq $16, %rdi
-
- decl %ecx
- prefetch 32(%rdx)
- jnz p4_3d_no_rot_loop
-
-p4_3d_no_rot_done:
- femms
- ret
-
-
-.align 16
-.globl _mesa_x86_64_transform_points4_perspective
-_mesa_x86_64_transform_points4_perspective:
-
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- test %ecx, %ecx
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- jz p4_perspective_done
-
- movq V4F_START(%rdx), %rdx /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
-
- movd (%rsi), %mm0 /* | m00 */
- pxor %mm7, %mm7 /* 0 | 0 */
- punpckldq 20(%rsi), %mm0 /* m11 | m00 */
-
- movq 32(%rsi), %mm2 /* m21 | m20 */
- prefetch (%rdx)
-
- movd 40(%rsi), %mm1 /* | m22 */
-
- .byte 0x66, 0x66, 0x90 /* manual align += 3 */
- punpckldq 56(%rsi), %mm1 /* m32 | m22 */
-
-
-p4_perspective_loop:
-
- prefetchw 32(%rdi) /* prefetch 2 vertices ahead */
-
- movq (%rdx), %mm4 /* x1 | x0 */
- movq 8(%rdx), %mm5 /* x3 | x2 */
- movd 8(%rdx), %mm3 /* | x2 */
-
- movq %mm5, %mm6 /* x3 | x2 */
- pfmul %mm0, %mm4 /* x1*m11 | x0*m00 */
-
- punpckldq %mm5, %mm5 /* x2 | x2 */
-
- pfmul %mm2, %mm5 /* x2*m21 | x2*m20 */
- pfsubr %mm7, %mm3 /* | -x2 */
-
- pfmul %mm1, %mm6 /* x3*m32 | x2*m22 */
- pfadd %mm4, %mm5 /* x1*m11+x2*m21 | x0*m00+x2*m20 */
-
- pfacc %mm3, %mm6 /* -x2 | x2*m22+x3*m32 */
-
- movq %mm5, (%rdi) /* write r0, r1 */
- addq %rax, %rdx
- movq %mm6, 8(%rdi) /* write r2, r3 */
-
- addq $16, %rdi
-
- decl %ecx
- prefetch 32(%rdx) /* hopefully stride is zero */
- jnz p4_perspective_loop
-
-p4_perspective_done:
- femms
- ret
-
-.align 16
-.globl _mesa_x86_64_transform_points4_2d_no_rot
-_mesa_x86_64_transform_points4_2d_no_rot:
-
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- test %ecx, %ecx
- .byte 0x90 /* manual align += 1 */
- jz p4_2d_no_rot_done
-
- movq V4F_START(%rdx), %rdx /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
-
- movd (%rsi), %mm0 /* | m00 */
- prefetch (%rdx)
- punpckldq 20(%rsi), %mm0 /* m11 | m00 */
-
- movq 48(%rsi), %mm1 /* m31 | m30 */
-
-p4_2d_no_rot_loop:
-
- prefetchw 32(%rdi) /* prefetch 2 vertices ahead */
-
- movq (%rdx), %mm4 /* x1 | x0 */
- movq 8(%rdx), %mm5 /* x3 | x2 */
-
- pfmul %mm0, %mm4 /* x1*m11 | x0*m00 */
- movq %mm5, %mm6 /* x3 | x2 */
-
- punpckhdq %mm6, %mm6 /* x3 | x3 */
-
- addq %rax, %rdx
- pfmul %mm1, %mm6 /* x3*m31 | x3*m30 */
-
- prefetch 32(%rdx) /* hopefully stride is zero */
- pfadd %mm4, %mm6 /* x1*m11+x3*m31 | x0*m00+x3*m30 */
-
- movq %mm6, (%rdi) /* write r0, r1 */
- movq %mm5, 8(%rdi) /* write r2, r3 */
-
- addq $16, %rdi
-
- decl %ecx
- jnz p4_2d_no_rot_loop
-
-p4_2d_no_rot_done:
- femms
- ret
-
-
-.align 16
-.globl _mesa_x86_64_transform_points4_2d
-_mesa_x86_64_transform_points4_2d:
-
- movl V4F_COUNT(%rdx), %ecx /* count */
- movzx V4F_STRIDE(%rdx), %eax /* stride */
-
- movl %ecx, V4F_COUNT(%rdi) /* set dest count */
- movl $4, V4F_SIZE(%rdi) /* set dest size */
- .byte 0x66, 0x66, 0x90 /* manual align += 4 */
- orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */
-
- test %ecx, %ecx
- .byte 0x66, 0x66, 0x90 /* manual align += 4 */
- jz p4_2d_done
-
- movq V4F_START(%rdx), %rdx /* ptr to first src vertex */
- movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */
-
- movd (%rsi), %mm0 /* | m00 */
- movd 4(%rsi), %mm1 /* | m01 */
-
- prefetch (%rdx)
-
- punpckldq 16(%rsi), %mm0 /* m10 | m00 */
- .byte 0x66, 0x66, 0x90 /* manual align += 4 */
- punpckldq 20(%rsi), %mm1 /* m11 | m01 */
-
- movq 48(%rsi), %mm2 /* m31 | m30 */
-
-p4_2d_loop:
-
- prefetchw 32(%rdi) /* prefetch 2 vertices ahead */
-
- movq (%rdx), %mm3 /* x1 | x0 */
- movq 8(%rdx), %mm5 /* x3 | x2 */
-
- movq %mm3, %mm4 /* x1 | x0 */
- movq %mm5, %mm6 /* x3 | x2 */
-
- pfmul %mm1, %mm4 /* x1*m11 | x0*m01 */
- punpckhdq %mm6, %mm6 /* x3 | x3 */
-
- pfmul %mm0, %mm3 /* x1*m10 | x0*m00 */
-
- addq %rax, %rdx
- pfacc %mm4, %mm3 /* x0*m01+x1*m11 | x0*m00+x1*m10 */
-
- pfmul %mm2, %mm6 /* x3*m31 | x3*m30 */
- prefetch 32(%rdx) /* hopefully stride is zero */
-
- pfadd %mm6, %mm3 /* r1 | r0 */
-
- movq %mm3, (%rdi) /* write r0, r1 */
- movq %mm5, 8(%rdi) /* write r2, r3 */
-
- addq $16, %rdi
-
- decl %ecx
- jnz p4_2d_loop
-
-p4_2d_done:
- femms
- ret
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow.c b/nx-X11/extras/Mesa/src/mesa/x86/3dnow.c
deleted file mode 100644
index d1f827c3a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $Id: 3dnow.c,v 1.1.1.1 2004/06/16 09:19:34 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.0.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * 3DNow! optimizations contributed by
- * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "math/m_xform.h"
-#include "tnl/t_context.h"
-
-#include "3dnow.h"
-#include "common_x86_macros.h"
-
-#ifdef DEBUG
-#include "math/m_debug.h"
-#endif
-
-
-#ifdef USE_3DNOW_ASM
-DECLARE_XFORM_GROUP( 3dnow, 2 )
-DECLARE_XFORM_GROUP( 3dnow, 3 )
-DECLARE_XFORM_GROUP( 3dnow, 4 )
-
-DECLARE_NORM_GROUP( 3dnow )
-
-
-extern void _ASMAPI
-_mesa_v16_3dnow_general_xform( GLfloat *first_vert,
- const GLfloat *m,
- const GLfloat *src,
- GLuint src_stride,
- GLuint count );
-
-extern void _ASMAPI
-_mesa_3dnow_project_vertices( GLfloat *first,
- GLfloat *last,
- const GLfloat *m,
- GLuint stride );
-
-extern void _ASMAPI
-_mesa_3dnow_project_clipped_vertices( GLfloat *first,
- GLfloat *last,
- const GLfloat *m,
- GLuint stride,
- const GLubyte *clipmask );
-#endif
-
-
-void _mesa_init_3dnow_transform_asm( void )
-{
-#ifdef USE_3DNOW_ASM
- ASSIGN_XFORM_GROUP( 3dnow, 2 );
- ASSIGN_XFORM_GROUP( 3dnow, 3 );
- ASSIGN_XFORM_GROUP( 3dnow, 4 );
-
- /* There's a bug somewhere in the 3dnow_normal.S file that causes
- * bad shading. Disable for now.
- ASSIGN_NORM_GROUP( 3dnow );
- */
-
-#ifdef DEBUG
- _math_test_all_transform_functions( "3DNow!" );
- _math_test_all_normal_transform_functions( "3DNow!" );
-#endif
-#endif
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow.h b/nx-X11/extras/Mesa/src/mesa/x86/3dnow.h
deleted file mode 100644
index 0ff0888ff..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $Id: 3dnow.h,v 1.1.1.1 2004/06/16 09:19:34 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * 3DNow! optimizations contributed by
- * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
- */
-
-#ifndef __3DNOW_H__
-#define __3DNOW_H__
-
-#include "math/m_xform.h"
-
-void _mesa_init_3dnow_transform_asm( void );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_normal.S b/nx-X11/extras/Mesa/src/mesa/x86/3dnow_normal.S
deleted file mode 100644
index 15fc569bc..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_normal.S
+++ /dev/null
@@ -1,848 +0,0 @@
-/* $Id: 3dnow_normal.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * 3Dnow assembly code by Holger Waechtler
- */
-
-#ifdef USE_3DNOW_ASM
-
-#include "matypes.h"
-#include "norm_args.h"
-
- SEG_TEXT
-
-#define M(i) REGOFF(i * 4, ECX)
-#define STRIDE REGOFF(12, ESI)
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_transform_normalize_normals)
-HIDDEN(_mesa_3dnow_transform_normalize_normals)
-GLNAME(_mesa_3dnow_transform_normalize_normals):
-
-#define FRAME_OFFSET 12
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
- PUSH_L ( EBP )
-
- MOV_L ( ARG_LENGTHS, EDI )
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EBP ) /* dest->count = in->count */
- MOV_L ( EBP, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( ARG_MAT, ECX )
- MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */
-
- CMP_L ( CONST(0), EBP ) /* count > 0 ?? */
- JE ( LLBL (G3TN_end) )
-
- MOV_L ( REGOFF (V4F_COUNT, ESI), EBP )
- FEMMS
-
- PUSH_L ( EBP )
- PUSH_L ( EAX )
- PUSH_L ( EDX ) /* save counter & pointer for */
- /* the normalize pass */
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 24
-
- MOVQ ( M(0), MM3 ) /* m1 | m0 */
- MOVQ ( M(4), MM4 ) /* m5 | m4 */
-
- MOVD ( M(2), MM5 ) /* | m2 */
- PUNPCKLDQ ( M(6), MM5 ) /* m6 | m2 */
-
- MOVQ ( M(8), MM6 ) /* m9 | m8 */
- MOVQ ( M(10), MM7 ) /* | m10 */
-
- CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */
- JNE ( LLBL (G3TN_scale_end ) )
-
- MOVD ( ARG_SCALE, MM0 ) /* | scale */
- PUNPCKLDQ ( MM0, MM0 ) /* scale | scale */
-
- PFMUL ( MM0, MM3 ) /* scale * m1 | scale * m0 */
- PFMUL ( MM0, MM4 ) /* scale * m5 | scale * m4 */
- PFMUL ( MM0, MM5 ) /* scale * m6 | scale * m2 */
- PFMUL ( MM0, MM6 ) /* scale * m9 | scale * m8 */
- PFMUL ( MM0, MM7 ) /* | scale * m10 */
-
-ALIGNTEXT32
-LLBL (G3TN_scale_end):
-LLBL (G3TN_transform):
- MOVQ ( REGIND (EDX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */
-
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
-
- PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- PREFETCHW ( REGIND(EAX) )
-
- PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */
- PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */
-
- PFMUL ( MM5, MM2 ) /* x2*m6 | x2*m2 */
- PFADD ( MM2, MM0 ) /* x0*m4+x1*m5+x2*m6| x0*m0+...+x2**/
-
- MOVQ ( REGIND (EDX), MM1 ) /* x1 | x0 */
- MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */
-
- PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */
- MOVD ( REGOFF (8, EDX), MM2 ) /* | x2 */
-
- PFMUL ( MM7, MM2 ) /* | x2*m10 */
- PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */
-
- PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m*/
- ADD_L ( STRIDE, EDX ) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */
- DEC_L ( EBP ) /* decrement normal counter */
- JA ( LLBL (G3TN_transform) )
-
-
- POP_L ( EDX ) /* end of transform --- */
- POP_L ( EAX ) /* now normalizing ... */
- POP_L ( EBP )
-
- CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */
- JE ( LLBL (G3TN_norm ) ) /* calculate lengths */
-
-
-ALIGNTEXT32
-LLBL (G3TN_norm_w_lengths):
-
- PREFETCHW ( REGOFF(12,EAX) )
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
-
- MOVD ( REGIND (EDI), MM3 ) /* | length (x) */
- PFMUL ( MM3, MM1 ) /* | x2 (normalize*/
-
- PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */
- PFMUL ( MM3, MM0 ) /* x1 (normalized) | x0 (normalize*/
-
- ADD_L ( STRIDE, EDX ) /* next normal */
- ADD_L ( CONST(4), EDI ) /* next length */
-
- PREFETCH ( REGIND(EDI) )
-
- MOVQ ( MM0, REGIND(EAX) ) /* write new x0, x1 */
- MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */
-
- ADD_L ( CONST(16), EAX ) /* next r */
- DEC_L ( EBP ) /* decrement normal counter */
-
- JA ( LLBL (G3TN_norm_w_lengths) )
- JMP ( LLBL (G3TN_exit_3dnow) )
-
-ALIGNTEXT32
-LLBL (G3TN_norm):
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND (EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
-
- MOVQ ( MM0, MM3 ) /* x1 | x0 */
- MOVQ ( MM1, MM4 ) /* | x2 */
-
- PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- PFMUL ( MM1, MM4 ) /* | x2*x2 */
- PFADD ( MM4, MM3 ) /* | x0*x0+x2*x2 */
-
- PFACC ( MM3, MM3 ) /* **not used** | x0*x0+x1*x1+x2**/
- PFRSQRT ( MM3, MM5 ) /* 1/sqrt (x0*x0+x1*x1+x2*x2) */
-
- MOVQ ( MM5, MM4 )
- PUNPCKLDQ ( MM3, MM3 )
-
- DEC_L ( EBP ) /* decrement normal counter */
- PFMUL ( MM5, MM5 )
-
- PFRSQIT1 ( MM3, MM5 )
- PFRCPIT2 ( MM4, MM5 )
-
- PFMUL ( MM5, MM0 ) /* x1 (normalized) | x0 (normalize*/
-
- MOVQ ( MM0, REGOFF(-16, EAX) ) /* write new x0, x1 */
- PFMUL ( MM5, MM1 ) /* | x2 (normalize*/
-
- MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */
- JA ( LLBL (G3TN_norm) )
-
-LLBL (G3TN_exit_3dnow):
- FEMMS
-
-LLBL (G3TN_end):
- POP_L ( EBP )
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot)
-HIDDEN(_mesa_3dnow_transform_normalize_normals_no_rot)
-GLNAME(_mesa_3dnow_transform_normalize_normals_no_rot):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 12
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
- PUSH_L ( EBP )
-
- MOV_L ( ARG_LENGTHS, EDI )
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EBP ) /* dest->count = in->count */
- MOV_L ( EBP, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( ARG_MAT, ECX )
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */
- MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */
-
- CMP_L ( CONST(0), EBP ) /* count > 0 ?? */
- JE ( LLBL (G3TNNR_end) )
-
- FEMMS
-
- MOVD ( M(0), MM0 ) /* | m0 */
- PUNPCKLDQ ( M(5), MM0 ) /* m5 | m0 */
-
- MOVD ( M(10), MM2 ) /* | m10 */
- PUNPCKLDQ ( MM2, MM2 ) /* m10 | m10 */
-
- CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */
- JNE ( LLBL (G3TNNR_scale_end ) )
-
- MOVD ( ARG_SCALE, MM7 ) /* | scale */
- PUNPCKLDQ ( MM7, MM7 ) /* scale | scale */
-
- PFMUL ( MM7, MM0 ) /* scale * m5 | scale * m0 */
- PFMUL ( MM7, MM2 ) /* scale * m10 | scale * m10 */
-
-ALIGNTEXT32
-LLBL (G3TNNR_scale_end):
- CMP_L ( CONST(0), EDI ) /* lengths == 0 ? */
- JE ( LLBL (G3TNNR_norm) ) /* need to calculate lengths */
-
- MOVD ( REGIND(EDI), MM3 ) /* | length (x) */
-
-
-ALIGNTEXT32
-LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
-
- PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */
- ADD_L ( STRIDE, EDX ) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- PFMUL ( MM2, MM7 ) /* | x2*m10 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- PFMUL ( MM3, MM7 ) /* | x2 (normalized) */
- PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */
-
- ADD_L ( CONST(4), EDI ) /* next length */
- PFMUL ( MM3, MM6 ) /* x1 (normalized) | x0 (normalized) */
-
- DEC_L ( EBP ) /* decrement normal counter */
- MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */
-
- MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */
- MOVD ( REGIND(EDI), MM3 ) /* | length (x) */
-
- JA ( LLBL (G3TNNR_norm_w_lengths) )
- JMP ( LLBL (G3TNNR_exit_3dnow) )
-
-ALIGNTEXT32
-LLBL (G3TNNR_norm): /* need to calculate lengths */
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(EDX), MM6 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM7 ) /* | x2 */
-
- PFMUL ( MM0, MM6 ) /* x1*m5 | x0*m0 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- PFMUL ( MM2, MM7 ) /* | x2*m10 */
- MOVQ ( MM6, MM3 ) /* x1 (transformed)| x0 (transformed) */
-
- MOVQ ( MM7, MM4 ) /* | x2 (transformed) */
- PFMUL ( MM6, MM3 ) /* x1*x1 | x0*x0 */
-
-
- PFMUL ( MM7, MM4 ) /* | x2*x2 */
- PFACC ( MM3, MM3 ) /* **not used** | x0*x0+x1*x1 */
-
- PFADD ( MM4, MM3 ) /* | x0*x0+x1*x1+x2*x2*/
- ADD_L ( STRIDE, EDX ) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- PFRSQRT ( MM3, MM5 ) /* 1/sqrt (x0*x0+x1*x1+x2*x2) */
- MOVQ ( MM5, MM4 )
-
- PUNPCKLDQ ( MM3, MM3 )
- PFMUL ( MM5, MM5 )
-
- PFRSQIT1 ( MM3, MM5 )
- DEC_L ( EBP ) /* decrement normal counter */
-
- PFRCPIT2 ( MM4, MM5 )
- PFMUL ( MM5, MM6 ) /* x1 (normalized) | x0 (normalized) */
-
- MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */
- PFMUL ( MM5, MM7 ) /* | x2 (normalized) */
-
- MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */
- JA ( LLBL (G3TNNR_norm) )
-
-
-LLBL (G3TNNR_exit_3dnow):
- FEMMS
-
-LLBL (G3TNNR_end):
- POP_L ( EBP )
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot)
-HIDDEN(_mesa_3dnow_transform_rescale_normals_no_rot)
-GLNAME(_mesa_3dnow_transform_rescale_normals_no_rot):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 12
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
- PUSH_L ( EBP )
-
- MOV_L ( ARG_IN, EAX )
- MOV_L ( ARG_DEST, EDX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EBP ) /* dest->count = in->count */
- MOV_L ( EBP, REGOFF(V4F_COUNT, EDX) )
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_MAT, ECX )
- MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */
- MOV_L ( REGOFF(V4F_START, EDX), EAX ) /* dest->start */
- MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */
-
- CMP_L ( CONST(0), EBP )
- JE ( LLBL (G3TRNR_end) )
-
- FEMMS
-
- MOVD ( ARG_SCALE, MM6 ) /* | scale */
- PUNPCKLDQ ( MM6, MM6 ) /* scale | scale */
-
- MOVD ( REGIND(ECX), MM0 ) /* | m0 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m5 | m0 */
-
- PFMUL ( MM6, MM0 ) /* scale*m5 | scale*m0 */
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m10 */
-
- PFMUL ( MM6, MM2 ) /* | scale*m10 */
-
-ALIGNTEXT32
-LLBL (G3TRNR_rescale):
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
-
- PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */
- ADD_L ( STRIDE, EDX ) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- PFMUL ( MM2, MM5 ) /* | x2*m10 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- DEC_L ( EBP ) /* decrement normal counter */
- MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */
-
- MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */
- JA ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */
-
- FEMMS
-
-LLBL (G3TRNR_end):
- POP_L ( EBP )
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_transform_rescale_normals)
-HIDDEN(_mesa_3dnow_transform_rescale_normals)
-GLNAME(_mesa_3dnow_transform_rescale_normals):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 8
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
-
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( ARG_MAT, ECX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EDI ) /* dest->count = in->count */
- MOV_L ( EDI, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */
- MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */
-
- CMP_L ( CONST(0), EDI )
- JE ( LLBL (G3TR_end) )
-
- FEMMS
-
- MOVQ ( REGIND(ECX), MM3 ) /* m1 | m0 */
-
- MOVQ ( REGOFF(16,ECX), MM4 ) /* m5 | m4 */
- MOVD ( ARG_SCALE, MM0 ) /* scale */
-
- MOVD ( REGOFF(8,ECX), MM5 ) /* | m2 */
- PUNPCKLDQ ( MM0, MM0 ) /* scale | scale */
-
- PUNPCKLDQ ( REGOFF(24, ECX), MM5 )
- PFMUL ( MM0, MM3 ) /* scale*m1 | scale*m0 */
-
- MOVQ ( REGOFF(32, ECX), MM6 ) /* m9 | m8*/
- PFMUL ( MM0, MM4 ) /* scale*m5 | scale*m4 */
-
- MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */
- PFMUL ( MM0, MM5 ) /* scale*m6 | scale*m2 */
-
- PFMUL ( MM0, MM6 ) /* scale*m9 | scale*m8 */
-
- PFMUL ( MM0, MM7 ) /* | scale*m10 */
-
-ALIGNTEXT32
-LLBL (G3TR_rescale):
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
-
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
-
- PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */
- PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */
-
- MOVQ ( REGIND(EDX), MM1 ) /* x1 | x0 */
-
- PFMUL ( MM5, MM2 ) /* x2*m6 | x2*m2 */
- PFADD ( MM2, MM0 ) /* x0*m4...+x2*m6| x0*m0+x1*m1+x2*m2 */
-
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
- ADD_L ( STRIDE, EDX ) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */
- PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */
-
- PFMUL ( MM7, MM2 ) /* | x2*m10 */
- PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */
-
- PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */
- MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */
-
- DEC_L ( EDI ) /* decrement normal counter */
- JA ( LLBL (G3TR_rescale) )
-
- FEMMS
-
-LLBL (G3TR_end):
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_transform_normals_no_rot)
-HIDDEN(_mesa_3dnow_transform_normals_no_rot)
-GLNAME(_mesa_3dnow_transform_normals_no_rot):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 8
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
-
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( ARG_MAT, ECX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EDI ) /* dest->count = in->count */
- MOV_L ( EDI, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */
- MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */
-
- CMP_L ( CONST(0), EDI )
- JE ( LLBL (G3TNR_end) )
-
- FEMMS
-
- MOVD ( REGIND(ECX), MM0 ) /* | m0 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m5 | m0 */
-
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m10 */
- PUNPCKLDQ ( MM2, MM2 ) /* m10 | m10 */
-
-ALIGNTEXT32
-LLBL (G3TNR_transform):
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */
-
- PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */
- ADD_L ( STRIDE, EDX) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- PFMUL ( MM2, MM5 ) /* | x2*m10 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- DEC_L ( EDI ) /* decrement normal counter */
- MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */
-
- MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */
- JA ( LLBL (G3TNR_transform) )
-
- FEMMS
-
-LLBL (G3TNR_end):
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_transform_normals)
-HIDDEN(_mesa_3dnow_transform_normals)
-GLNAME(_mesa_3dnow_transform_normals):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 8
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
-
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( ARG_MAT, ECX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EDI ) /* dest->count = in->count */
- MOV_L ( EDI, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( REGOFF(V4F_START, ESI), EDX ) /* in->start */
- MOV_L ( REGOFF(MATRIX_INV, ECX), ECX ) /* mat->inv */
-
- CMP_L ( CONST(0), EDI ) /* count > 0 ?? */
- JE ( LLBL (G3T_end) )
-
- FEMMS
-
- MOVQ ( REGIND(ECX), MM3 ) /* m1 | m0 */
- MOVQ ( REGOFF(16, ECX), MM4 ) /* m5 | m4 */
-
- MOVD ( REGOFF(8, ECX), MM5 ) /* | m2 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM5 ) /* m6 | m2 */
-
- MOVQ ( REGOFF(32, ECX), MM6 ) /* m9 | m8 */
- MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */
-
-ALIGNTEXT32
-LLBL (G3T_transform):
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(EDX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
-
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
-
- PFMUL ( MM3, MM0 ) /* x1*m1 | x0*m0 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- PFMUL ( MM4, MM1 ) /* x1*m5 | x0*m4 */
- PFACC ( MM1, MM0 ) /* x0*m4+x1*m5 | x0*m0+x1*m1 */
-
- PFMUL ( MM5, MM2 ) /* x2*m6 | x2*m2 */
- PFADD ( MM2, MM0 ) /* x0*m4...+x2*m6| x0*m0+x1*m1+x2*m2 */
-
- MOVQ ( REGIND(EDX), MM1 ) /* x1 | x0 */
- MOVQ ( MM0, REGOFF(-16, EAX) ) /* write r0, r1 */
-
- PFMUL ( MM6, MM1 ) /* x1*m9 | x0*m8 */
- MOVD ( REGOFF(8, EDX), MM2 ) /* | x2 */
-
- PFMUL ( MM7, MM2 ) /* | x2*m10 */
- ADD_L ( STRIDE, EDX ) /* next normal */
-
- PREFETCH ( REGIND(EDX) )
-
- PFACC ( MM1, MM1 ) /* *not used* | x0*m8+x1*m9 */
- PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */
-
- MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */
- DEC_L ( EDI ) /* decrement normal counter */
-
- JA ( LLBL (G3T_transform) )
-
- FEMMS
-
-LLBL (G3T_end):
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_normalize_normals)
-HIDDEN(_mesa_3dnow_normalize_normals)
-GLNAME(_mesa_3dnow_normalize_normals):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 12
-
- PUSH_L ( EDI )
- PUSH_L ( ESI )
- PUSH_L ( EBP )
-
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EBP ) /* dest->count = in->count */
- MOV_L ( EBP, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( REGOFF(V4F_START, ESI), ECX ) /* in->start */
- MOV_L ( ARG_LENGTHS, EDX )
-
- CMP_L ( CONST(0), EBP ) /* count > 0 ?? */
- JE ( LLBL (G3N_end) )
-
- FEMMS
-
- CMP_L ( CONST(0), EDX ) /* lengths == 0 ? */
- JE ( LLBL (G3N_norm2) ) /* calculate lengths */
-
-ALIGNTEXT32
-LLBL (G3N_norm1): /* use precalculated lengths */
-
- PREFETCH ( REGIND(EAX) )
-
- MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
-
- MOVD ( REGIND(EDX), MM3 ) /* | length (x) */
- PFMUL ( MM3, MM1 ) /* | x2 (normalized) */
-
- PUNPCKLDQ ( MM3, MM3 ) /* length (x) | length (x) */
- ADD_L ( STRIDE, ECX ) /* next normal */
-
- PREFETCH ( REGIND(ECX) )
-
- PFMUL ( MM3, MM0 ) /* x1 (normalized) | x0 (normalized) */
- MOVQ ( MM0, REGIND(EAX) ) /* write new x0, x1 */
-
- MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- ADD_L ( CONST(4), EDX ) /* next length */
- DEC_L ( EBP ) /* decrement normal counter */
-
- JA ( LLBL (G3N_norm1) )
-
- JMP ( LLBL (G3N_end1) )
-
-ALIGNTEXT32
-LLBL (G3N_norm2): /* need to calculate lengths */
-
- PREFETCHW ( REGIND(EAX) )
-
- PREFETCH ( REGIND(ECX) )
-
- MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */
-
- MOVQ ( MM0, MM3 ) /* x1 | x0 */
- ADD_L ( STRIDE, ECX ) /* next normal */
-
- PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */
- MOVQ ( MM1, MM4 ) /* | x2 */
-
- ADD_L ( CONST(16), EAX ) /* next r */
- PFMUL ( MM1, MM4 ) /* | x2*x2 */
-
- PFADD ( MM4, MM3 ) /* | x0*x0+x2*x2 */
- PFACC ( MM3, MM3 ) /* x0*x0+...+x2*x2 | x0*x0+x1*x1+x2*x2*/
-
- PFRSQRT ( MM3, MM5 ) /* 1/sqrt (x0*x0+x1*x1+x2*x2) */
- MOVQ ( MM5, MM4 )
-
- PUNPCKLDQ ( MM3, MM3 )
- PFMUL ( MM5, MM5 )
-
- PFRSQIT1 ( MM3, MM5 )
- DEC_L ( EBP ) /* decrement normal counter */
-
- PFRCPIT2 ( MM4, MM5 )
-
- PFMUL ( MM5, MM0 ) /* x1 (normalized) | x0 (normalized) */
- MOVQ ( MM0, REGOFF(-16, EAX) ) /* write new x0, x1 */
-
- PFMUL ( MM5, MM1 ) /* | x2 (normalized) */
- MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */
-
- JA ( LLBL (G3N_norm2) )
-
-LLBL (G3N_end1):
- FEMMS
-
-LLBL (G3N_end):
- POP_L ( EBP )
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_3dnow_rescale_normals)
-HIDDEN(_mesa_3dnow_rescale_normals)
-GLNAME(_mesa_3dnow_rescale_normals):
-
-#undef FRAME_OFFSET
-#define FRAME_OFFSET 8
- PUSH_L ( EDI )
- PUSH_L ( ESI )
-
- MOV_L ( ARG_IN, ESI )
- MOV_L ( ARG_DEST, EAX )
- MOV_L ( REGOFF(V4F_COUNT, ESI), EDX ) /* dest->count = in->count */
- MOV_L ( EDX, REGOFF(V4F_COUNT, EAX) )
- MOV_L ( REGOFF(V4F_START, EAX), EAX ) /* dest->start */
- MOV_L ( REGOFF(V4F_START, ESI), ECX ) /* in->start */
-
- CMP_L ( CONST(0), EDX )
- JE ( LLBL (G3R_end) )
-
- FEMMS
-
- MOVD ( ARG_SCALE, MM0 ) /* scale */
- PUNPCKLDQ ( MM0, MM0 )
-
-ALIGNTEXT32
-LLBL (G3R_rescale):
-
- PREFETCHW ( REGIND(EAX) )
-
- MOVQ ( REGIND(ECX), MM1 ) /* x1 | x0 */
- MOVD ( REGOFF(8, ECX), MM2 ) /* | x2 */
-
- PFMUL ( MM0, MM1 ) /* x1*scale | x0*scale */
- ADD_L ( STRIDE, ECX ) /* next normal */
-
- PREFETCH ( REGIND(ECX) )
-
- PFMUL ( MM0, MM2 ) /* | x2*scale */
- ADD_L ( CONST(16), EAX ) /* next r */
-
- MOVQ ( MM1, REGOFF(-16, EAX) ) /* write r0, r1 */
- MOVD ( MM2, REGOFF(-8, EAX) ) /* write r2 */
-
- DEC_L ( EDX ) /* decrement normal counter */
- JA ( LLBL (G3R_rescale) )
-
- FEMMS
-
-LLBL (G3R_end):
- POP_L ( ESI )
- POP_L ( EDI )
- RET
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform1.S b/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform1.S
deleted file mode 100644
index f1e4c7b67..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform1.S
+++ /dev/null
@@ -1,433 +0,0 @@
-/* $Id: 3dnow_xform1.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef USE_3DNOW_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FRAME_OFFSET 4
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_general )
-HIDDEN(_mesa_3dnow_transform_points1_general)
-GLNAME( _mesa_3dnow_transform_points1_general ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPGR_3 ) )
-
- MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */
- MOVQ ( REGOFF(8, ECX), MM1 ) /* m03 | m02 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
- MOVQ ( REGOFF(56, ECX), MM3 ) /* m33 | m32 */
-
-ALIGNTEXT16
-LLBL( G3TPGR_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* | x0 */
- PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */
-
- MOVQ ( MM4, MM5 ) /* x0 | x0 */
- PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */
-
- PFMUL ( MM1, MM5 ) /* x0*m03 | x0*m02 */
- PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */
-
- PFADD ( MM3, MM5 ) /* x0*m03+m33 | x0*m02+m32 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
-
- MOVQ ( MM5, REGOFF(8, EDX) ) /* write r3, r2 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TPGR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPGR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_identity )
-HIDDEN(_mesa_3dnow_transform_points1_identity)
-GLNAME( _mesa_3dnow_transform_points1_identity ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(1), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_1), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPIR_4) )
-
-ALIGNTEXT16
-LLBL( G3TPIR_3 ):
-
- MOVD ( REGIND(EAX), MM0 ) /* | x0 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- MOVD ( MM0, REGIND(EDX) ) /* | r0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPIR_3 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPIR_4 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_3d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points1_3d_no_rot)
-GLNAME( _mesa_3dnow_transform_points1_3d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3NRR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TP3NRR_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* | x0 */
- PFMUL ( MM0, MM4 ) /* | x0*m00 */
-
- PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
-
- MOVD ( MM3, REGOFF(8, EDX) ) /* write r2 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP3NRR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3NRR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_perspective )
-HIDDEN(_mesa_3dnow_transform_points1_perspective)
-GLNAME( _mesa_3dnow_transform_points1_perspective ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPPR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TPPR_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* 0 | x0 */
- PFMUL ( MM0, MM4 ) /* 0 | x0*m00 */
-
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
- MOVQ ( MM3, REGOFF(8, EDX) ) /* write r2 (=m32), r3 (=0) */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPPR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPPR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_2d )
-HIDDEN(_mesa_3dnow_transform_points1_2d)
-GLNAME( _mesa_3dnow_transform_points1_2d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2R_3 ) )
-
- MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2R_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* | x0 */
- PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */
-
- PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */
- PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */
-
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2R_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_2d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points1_2d_no_rot)
-GLNAME( _mesa_3dnow_transform_points1_2d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2NRR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2NRR_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* | x0 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- PFMUL ( MM0, MM4 ) /* | x0*m00 */
- PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */
-
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2NRR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points1_3d )
-HIDDEN(_mesa_3dnow_transform_points1_3d)
-GLNAME( _mesa_3dnow_transform_points1_3d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(4, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3R_3 ) )
-
- MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */
- MOVD ( REGOFF(8, ECX), MM1 ) /* | m02 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TP3R_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* | x0 */
- PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */
-
- MOVQ ( MM4, MM5 ) /* | x0 */
- PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */
-
- PFMUL ( MM1, MM5 ) /* | x0*m02 */
- PFADD ( MM2, MM4 ) /* x0*m01+m31 | x0*m00+m30 */
-
- PFADD ( MM3, MM5 ) /* | x0*m02+m32 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
-
- MOVD ( MM5, REGOFF(8, EDX) ) /* write r2 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP3R_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3R_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform2.S b/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform2.S
deleted file mode 100644
index 49a602b83..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform2.S
+++ /dev/null
@@ -1,473 +0,0 @@
-/* $Id: 3dnow_xform2.S,v 1.1.1.2 2005/07/31 16:46:38 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef USE_3DNOW_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FRAME_OFFSET 4
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_general )
-HIDDEN(_mesa_3dnow_transform_points2_general)
-GLNAME( _mesa_3dnow_transform_points2_general ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPGR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
-
- MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
-
- MOVD ( REGOFF(8, ECX), MM2 ) /* | m02 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM2 ) /* m12 | m02 */
-
- MOVD ( REGOFF(12, ECX), MM3 ) /* | m03 */
- PUNPCKLDQ ( REGOFF(28, ECX), MM3 ) /* m13 | m03 */
-
- MOVQ ( REGOFF(48, ECX), MM4 ) /* m31 | m30 */
- MOVQ ( REGOFF(56, ECX), MM5 ) /* m33 | m32 */
-
-ALIGNTEXT16
-LLBL( G3TPGR_2 ):
-
- MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */
- MOVQ ( MM6, MM7 ) /* x1 | x0 */
-
- PFMUL ( MM0, MM6 ) /* x1*m10 | x0*m00 */
- PFMUL ( MM1, MM7 ) /* x1*m11 | x0*m01 */
-
- PFACC ( MM7, MM6 ) /* x0*m01+x1*m11 | x0*x00+x1*m10 */
- PFADD ( MM4, MM6 ) /* x0*...*m11+m31 | x0*...*m10+m30 */
-
- MOVQ ( MM6, REGIND(EDX) ) /* write r1, r0 */
- MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */
-
- MOVQ ( MM6, MM7 ) /* x1 | x0 */
- PFMUL ( MM2, MM6 ) /* x1*m12 | x0*m02 */
-
- PFMUL ( MM3, MM7 ) /* x1*m13 | x0*m03 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- PFACC ( MM7, MM6 ) /* x0*m03+x1*m13 | x0*x02+x1*m12 */
- PFADD ( MM5, MM6 ) /* x0*...*m13+m33 | x0*...*m12+m32 */
-
- MOVQ ( MM6, REGOFF(8, EDX) ) /* write r3, r2 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPGR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPGR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_perspective )
-HIDDEN(_mesa_3dnow_transform_points2_perspective)
-GLNAME( _mesa_3dnow_transform_points2_perspective ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPPR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TPPR_2 ):
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
- MOVQ ( MM3, REGOFF(8, EDX) ) /* write r2 (=m32), r3 (=0) */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPPR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPPR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_3d )
-HIDDEN(_mesa_3dnow_transform_points2_3d)
-GLNAME( _mesa_3dnow_transform_points2_3d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3 ), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3R_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
-
- MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
-
- MOVD ( REGOFF(8, ECX), MM2 ) /* | m02 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM2 ) /* m12 | m02 */
-
- MOVQ ( REGOFF(48, ECX), MM4 ) /* m31 | m30 */
- MOVD ( REGOFF(56, ECX), MM5 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TP3R_2 ):
-
- MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */
- MOVQ ( MM6, MM7 ) /* x1 | x0 */
-
- PFMUL ( MM0, MM6 ) /* x1*m10 | x0*m00 */
- PFMUL ( MM1, MM7 ) /* x1*m11 | x0*m01 */
-
- PFACC ( MM7, MM6 ) /* x0*m01+x1*m11 | x0*x00+x1*m10 */
- PFADD ( MM4, MM6 ) /* x0*...*m11+m31 | x0*...*m10+m30 */
-
- MOVQ ( MM6, REGIND(EDX) ) /* write r1, r0 */
- MOVQ ( REGIND(EAX), MM6 ) /* x1 | x0 */
-
- MOVQ ( MM6, MM7 ) /* x1 | x0 */
- PFMUL ( MM2, MM6 ) /* x1*m12 | x0*m02 */
-
- PFACC ( MM7, MM6 ) /* ***trash*** | x0*x02+x1*m12 */
- PFADD ( MM5, MM6 ) /* ***trash*** | x0*...*m12+m32 */
-
- MOVD ( MM6, REGOFF(8, EDX) ) /* write r2 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP3R_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3R_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_3d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points2_3d_no_rot)
-GLNAME( _mesa_3dnow_transform_points2_3d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3 ), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3NRR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TP3NRR_2 ):
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PFADD ( MM2, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
-
- MOVD ( MM3, REGOFF(8, EDX) ) /* write r2 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP3NRR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3NRR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_2d )
-HIDDEN(_mesa_3dnow_transform_points2_2d)
-GLNAME( _mesa_3dnow_transform_points2_2d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2R_3 ) )
-
- MOVQ ( REGIND(ECX), MM0 ) /* m01 | m00 */
- MOVQ ( REGOFF(16, ECX), MM1 ) /* m11 | m10 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2R_2 ):
-
- MOVD ( REGIND(EAX), MM4 ) /* | x0 */
- MOVD ( REGOFF(4, EAX), MM5 ) /* | x1 */
-
- PUNPCKLDQ ( MM4, MM4 ) /* x0 | x0 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- PFMUL ( MM0, MM4 ) /* x0*m01 | x0*m00 */
- PUNPCKLDQ ( MM5, MM5 ) /* x1 | x1 */
-
- PFMUL ( MM1, MM5 ) /* x1*m11 | x1*m10 */
- PFADD ( MM2, MM4 ) /* x...x1*m11+31 | x0*..*m10+m30 */
-
- PFADD ( MM5, MM4 ) /* x0*m01+x1*m11 | x0*m00+x1*m10 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2R_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_2d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points2_2d_no_rot)
-GLNAME( _mesa_3dnow_transform_points2_2d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2NRR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2NRR_2 ):
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- PFADD ( MM2, MM4 ) /* m31 | x0*m00+m30 */
-
- MOVQ ( MM4, REGIND(EDX) ) /* write r1, r0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2NRR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points2_identity )
-HIDDEN(_mesa_3dnow_transform_points2_identity)
-GLNAME( _mesa_3dnow_transform_points2_identity ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(2), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPIR_3 ) )
-
-ALIGNTEXT16
-LLBL( G3TPIR_3 ):
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- ADD_L ( EDI, EAX ) /* next vertex */
-
- MOVQ ( MM0, REGIND(EDX) ) /* r1 | r0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPIR_3 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPIR_4 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform3.S b/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform3.S
deleted file mode 100644
index d9fac6612..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform3.S
+++ /dev/null
@@ -1,557 +0,0 @@
-/* $Id: 3dnow_xform3.S,v 1.1.1.2 2005/07/31 16:46:40 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef USE_3DNOW_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FRAME_OFFSET 4
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_general )
-HIDDEN(_mesa_3dnow_transform_points3_general)
-GLNAME( _mesa_3dnow_transform_points3_general ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPGR_2 ) )
-
- PREFETCHW ( REGIND(EDX) )
-
-ALIGNTEXT16
-LLBL( G3TPGR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM2 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- PUNPCKLDQ ( MM2, MM2 ) /* x2 | x2 */
-
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- MOVQ ( MM2, MM5 ) /* x2 | x2 */
-
- PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */
- PFMUL ( REGOFF(32, ECX), MM2 ) /* x2*m9 | x2*m8 */
-
- MOVQ ( MM0, MM3 ) /* x0 | x0 */
- PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */
-
- MOVQ ( MM1, MM4 ) /* x1 | x1 */
- PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
-
- PFADD ( REGOFF(48, ECX), MM2 ) /* x2*m9+m13 | x2*m8+m12 */
- PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */
-
- PFADD ( REGOFF(56, ECX), MM5 ) /* x2*m11+m15 | x2*m10+m14 */
- PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
-
- PFMUL ( REGOFF(8, ECX), MM3 ) /* x0*m3 | x0*m2 */
- PFADD ( MM1, MM2 ) /* r1 | r0 */
-
- PFMUL ( REGOFF(24, ECX), MM4 ) /* x1*m7 | x1*m6 */
- ADD_L ( CONST(16), EDX ) /* next output vertex */
-
- PFADD ( MM3, MM4 ) /* x0*m3+x1*m7 | x0*m2+x1*m6 */
- MOVQ ( MM2, REGOFF(-16, EDX) ) /* write r0, r1 */
-
- PFADD ( MM4, MM5 ) /* r3 | r2 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPGR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_perspective )
-HIDDEN(_mesa_3dnow_transform_points3_perspective)
-GLNAME( _mesa_3dnow_transform_points3_perspective ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPPR_2 ) )
-
- PREFETCH ( REGIND(EAX) )
- PREFETCHW ( REGIND(EDX) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVQ ( REGOFF(32, ECX), MM1 ) /* m21 | m20 */
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
-
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
-ALIGNTEXT16
-LLBL( G3TPPR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- PXOR ( MM7, MM7 ) /* 0 | 0 */
- MOVQ ( MM5, MM6 ) /* | x2 */
-
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- PFSUB ( MM5, MM7 ) /* | -x2 */
-
- PFMUL ( MM2, MM6 ) /* | x2*m22 */
- PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- PFMUL ( MM1, MM5 ) /* x2*m21 | x2*m20 */
-
- PFADD ( MM3, MM6 ) /* | x2*m22+m32 */
- PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */
-
- MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVD ( MM6, REGOFF(-8, EDX) ) /* write r2 */
-
- MOVD ( MM7, REGOFF(-4, EDX) ) /* write r3 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPPR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_3d )
-HIDDEN(_mesa_3dnow_transform_points3_3d)
-GLNAME( _mesa_3dnow_transform_points3_3d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3R_2 ) )
-
- PREFETCH ( REGIND(EAX) )
- PREFETCH ( REGIND(EDX) )
-
- MOVD ( REGOFF(8, ECX), MM7 ) /* | m2 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM7 ) /* m6 | m2 */
-
-
-ALIGNTEXT16
-LLBL( G3TP3R_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- MOVQ ( MM0, MM2 ) /* x1 | x0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PUNPCKLDQ ( MM2, MM2 ) /* x0 | x0 */
- MOVQ ( MM0, MM3 ) /* x1 | x0 */
-
- PFMUL ( REGIND(ECX), MM2 ) /* x0*m1 | x0*m0 */
- PUNPCKHDQ ( MM3, MM3 ) /* x1 | x1 */
-
- MOVQ ( MM1, MM4 ) /* | x2 */
- PFMUL ( REGOFF(16, ECX), MM3 ) /* x1*m5 | x1*m4 */
-
- PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */
- PFADD ( MM2, MM3 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
-
- PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */
- PFADD ( REGOFF(48, ECX), MM3 ) /* x0*m1+...+m11 | x0*m0+x1*m4+m12 */
-
- PFMUL ( MM7, MM0 ) /* x1*m6 | x0*m2 */
- PFADD ( MM4, MM3 ) /* r1 | r0 */
-
- PFMUL ( REGOFF(40, ECX), MM1 ) /* | x2*m10 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m14 | x2*m10 */
-
- PFACC ( MM0, MM1 )
-
- MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
- PFACC ( MM1, MM1 ) /* | r2 */
-
- MOVD ( MM1, REGOFF(-8, EDX) ) /* write r2 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3R_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_3d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points3_3d_no_rot)
-GLNAME( _mesa_3dnow_transform_points3_3d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3NRR_2 ) )
-
- PREFETCH ( REGIND(EAX) )
- PREFETCHW ( REGIND(EDX) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
- PUNPCKLDQ ( MM2, MM2 ) /* m22 | m22 */
-
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
- MOVD ( REGOFF(56, ECX), MM3 ) /* | m32 */
-
- PUNPCKLDQ ( MM3, MM3 ) /* m32 | m32 */
-
-
-ALIGNTEXT16
-LLBL( G3TP3NRR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCHW ( REGIND(EAX) )
-
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
- PFMUL ( MM2, MM5 ) /* | x2*m22 */
-
- PFADD ( MM3, MM5 ) /* | x2*m22+m32 */
- MOVQ ( MM4, REGIND(EDX) ) /* write r0, r1 */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 */
- JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3NRR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_2d )
-HIDDEN(_mesa_3dnow_transform_points3_2d)
-GLNAME( _mesa_3dnow_transform_points3_2d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2R_3) )
-
- PREFETCH ( REGIND(EAX) )
- PREFETCHW ( REGIND(EDX) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
-
- MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2R_2 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- MOVQ ( MM3, MM4 ) /* x1 | x0 */
- PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */
-
- PFACC ( MM4, MM3 ) /* x0*m00+x1*m10 | x0*m01+x1*m11 */
- MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */
-
- PFADD ( MM2, MM3 ) /* x0*...*m10+m30 | x0*...*m11+m31 */
- MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP2R_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2R_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_2d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points3_2d_no_rot)
-GLNAME( _mesa_3dnow_transform_points3_2d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2NRR_2 ) )
-
- PREFETCH ( REGIND(EAX) )
- PREFETCHW ( REGIND(EDX) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
-
-
-ALIGNTEXT16
-LLBL( G3TP2NRR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM5 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */
-
- MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVD ( MM5, REGOFF(-8, EDX) ) /* write r2 (=x2) */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP2NRR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2NRR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points3_identity )
-HIDDEN(_mesa_3dnow_transform_points3_identity)
-GLNAME( _mesa_3dnow_transform_points3_identity ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(3), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPIR_2 ) )
-
- PREFETCHW ( REGIND(EDX) )
-
-ALIGNTEXT16
-LLBL( G3TPIR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) )
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVD ( REGOFF(8, EAX), MM1 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */
-
- MOVD ( MM1, REGOFF(-8, EDX) ) /* | r2 */
- JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPIR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform4.S b/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform4.S
deleted file mode 100644
index 4df8ae8e2..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/3dnow_xform4.S
+++ /dev/null
@@ -1,566 +0,0 @@
-/* $Id: 3dnow_xform4.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef USE_3DNOW_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FRAME_OFFSET 4
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_general )
-HIDDEN(_mesa_3dnow_transform_points4_general)
-GLNAME( _mesa_3dnow_transform_points4_general ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPGR_2 ) )
-
- PREFETCHW ( REGIND(EDX) )
-
-ALIGNTEXT16
-LLBL( G3TPGR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- MOVQ ( MM0, MM2 ) /* x1 | x0 */
- MOVQ ( MM4, MM6 ) /* x3 | x2 */
-
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- PUNPCKHDQ ( MM2, MM2 ) /* x1 | x1 */
-
- MOVQ ( MM0, MM1 ) /* x0 | x0 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
- MOVQ ( MM2, MM3 ) /* x1 | x1 */
-
- PFMUL ( REGOFF(8, ECX), MM1 ) /* x0*m3 | x0*m2 */
- PUNPCKLDQ ( MM4, MM4 ) /* x2 | x2 */
-
- PFMUL ( REGOFF(16, ECX), MM2 ) /* x1*m5 | x1*m4 */
- MOVQ ( MM4, MM5 ) /* x2 | x2 */
-
- PFMUL ( REGOFF(24, ECX), MM3 ) /* x1*m7 | x1*m6 */
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
-
- PFMUL ( REGOFF(32, ECX), MM4 ) /* x2*m9 | x2*m8 */
- MOVQ ( MM6, MM7 ) /* x3 | x3 */
-
- PFMUL ( REGOFF(40, ECX), MM5 ) /* x2*m11 | x2*m10 */
- PFADD ( MM0, MM2 )
-
- PFMUL ( REGOFF(48, ECX), MM6 ) /* x3*m13 | x3*m12 */
- PFADD ( MM1, MM3 )
-
- PFMUL ( REGOFF(56, ECX), MM7 ) /* x3*m15 | x3*m14 */
- PFADD ( MM4, MM6 )
-
- PFADD ( MM5, MM7 )
- PFADD ( MM2, MM6 )
-
- PFADD ( MM3, MM7 )
- MOVQ ( MM6, REGOFF(-16, EDX) )
-
- MOVQ ( MM7, REGOFF(-8, EDX) )
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPGR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPGR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_perspective )
-HIDDEN(_mesa_3dnow_transform_points4_perspective)
-GLNAME( _mesa_3dnow_transform_points4_perspective ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPPR_2 ) )
-
- PREFETCH ( REGIND(EAX) )
- PREFETCHW ( REGIND(EDX) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVD ( REGOFF(40, ECX), MM1 ) /* | m22 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM1 ) /* m32 | m22 */
-
- MOVQ ( REGOFF(32, ECX), MM2 ) /* m21 | m20 */
- PXOR ( MM7, MM7 ) /* 0 | 0 */
-
-ALIGNTEXT16
-LLBL( G3TPPR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- MOVD ( REGOFF(8, EAX), MM3 ) /* | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */
-
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PUNPCKLDQ ( MM5, MM5 ) /* x2 | x2 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PFMUL ( MM2, MM5 ) /* x2*m21 | x2*m20 */
- PFSUBR ( MM7, MM3 ) /* | -x2 */
-
- PFMUL ( MM1, MM6 ) /* x3*m32 | x2*m22 */
- PFADD ( MM4, MM5 ) /* x1*m11+x2*m21 | x0*m00+x2*m20 */
-
- PFACC ( MM3, MM6 ) /* -x2 | x2*m22+x3*m32 */
- MOVQ ( MM5, REGOFF(-16, EDX) ) /* write r0, r1 */
-
- MOVQ ( MM6, REGOFF(-8, EDX) ) /* write r2, r3 */
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TPPR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPPR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_3d )
-HIDDEN(_mesa_3dnow_transform_points4_3d)
-GLNAME( _mesa_3dnow_transform_points4_3d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3R_2 ) )
-
- MOVD ( REGOFF(8, ECX), MM6 ) /* | m2 */
- PUNPCKLDQ ( REGOFF(24, ECX), MM6 ) /* m6 | m2 */
-
- MOVD ( REGOFF(40, ECX), MM7 ) /* | m10 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM7 ) /* m14 | m10 */
-
-ALIGNTEXT16
-LLBL( G3TP3R_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
- PREFETCH ( REGOFF(32, EAX) ) /* hopefully array is tightly packed */
-
- MOVQ ( REGIND(EAX), MM2 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM3 ) /* x3 | x2 */
-
- MOVQ ( MM2, MM0 ) /* x1 | x0 */
- MOVQ ( MM3, MM4 ) /* x3 | x2 */
-
- MOVQ ( MM0, MM1 ) /* x1 | x0 */
- MOVQ ( MM4, MM5 ) /* x3 | x2 */
-
- PUNPCKLDQ ( MM0, MM0 ) /* x0 | x0 */
- PUNPCKHDQ ( MM1, MM1 ) /* x1 | x1 */
-
- PFMUL ( REGIND(ECX), MM0 ) /* x0*m1 | x0*m0 */
- PUNPCKLDQ ( MM3, MM3 ) /* x2 | x2 */
-
- PFMUL ( REGOFF(16, ECX), MM1 ) /* x1*m5 | x1*m4 */
- PUNPCKHDQ ( MM4, MM4 ) /* x3 | x3 */
-
- PFMUL ( MM6, MM2 ) /* x1*m6 | x0*m2 */
- PFADD ( MM0, MM1 ) /* x0*m1+x1*m5 | x0*m0+x1*m4 */
-
- PFMUL ( REGOFF(32, ECX), MM3 ) /* x2*m9 | x2*m8 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PFMUL ( REGOFF(48, ECX), MM4 ) /* x3*m13 | x3*m12 */
- PFADD ( MM1, MM3 ) /* x0*m1+..+x2*m9 | x0*m0+...+x2*m8 */
-
- PFMUL ( MM7, MM5 ) /* x3*m14 | x2*m10 */
- PFADD ( MM3, MM4 ) /* r1 | r0 */
-
- PFACC ( MM2, MM5 ) /* x0*m2+x1*m6 | x2*m10+x3*m14 */
- MOVD ( REGOFF(12, EAX), MM0 ) /* | x3 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PFACC ( MM0, MM5 ) /* r3 | r2 */
-
- MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP3R_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3R_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_3d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points4_3d_no_rot)
-GLNAME( _mesa_3dnow_transform_points4_3d_no_rot ):
-
- PUSH_L ( ESI )
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP3NRR_2 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVD ( REGOFF(40, ECX), MM2 ) /* | m22 */
- PUNPCKLDQ ( REGOFF(56, ECX), MM2 ) /* m32 | m22 */
-
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP3NRR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
- MOVD ( REGOFF(12, EAX), MM7 ) /* | x3 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGOFF(32, EAX) ) /* hopefully stride is zero */
-
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
-
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
- PFMUL ( MM2, MM5 ) /* x3*m32 | x2*m22 */
-
- PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */
- PFACC ( MM7, MM5 ) /* x3 | x2*m22+x3*m32 */
-
- PFADD ( MM6, MM4 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- MOVQ ( MM4, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP3NRR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP3NRR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_2d )
-HIDDEN(_mesa_3dnow_transform_points4_2d)
-GLNAME( _mesa_3dnow_transform_points4_2d ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2R_2 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(16, ECX), MM0 ) /* m10 | m00 */
-
- MOVD ( REGOFF(4, ECX), MM1 ) /* | m01 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM1 ) /* m11 | m01 */
-
- MOVQ ( REGOFF(48, ECX), MM2 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2R_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM3 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- MOVQ ( MM3, MM4 ) /* x1 | x0 */
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
-
- PFMUL ( MM1, MM4 ) /* x1*m11 | x0*m01 */
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
-
- PFMUL ( MM0, MM3 ) /* x1*m10 | x0*m00 */
- ADD_L ( CONST(16), EDX ) /* next r */
-
- PFACC ( MM4, MM3 ) /* x0*m01+x1*m11 | x0*m00+x1*m10 */
- PFMUL ( MM2, MM6 ) /* x3*m31 | x3*m30 */
-
- PFADD ( MM6, MM3 ) /* r1 | r0 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
-
- MOVQ ( MM3, REGOFF(-16, EDX) ) /* write r0, r1 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TP2R_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2R_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_2d_no_rot )
-HIDDEN(_mesa_3dnow_transform_points4_2d_no_rot)
-GLNAME( _mesa_3dnow_transform_points4_2d_no_rot ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TP2NRR_3 ) )
-
- MOVD ( REGIND(ECX), MM0 ) /* | m00 */
- PUNPCKLDQ ( REGOFF(20, ECX), MM0 ) /* m11 | m00 */
-
- MOVQ ( REGOFF(48, ECX), MM1 ) /* m31 | m30 */
-
-ALIGNTEXT16
-LLBL( G3TP2NRR_2 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM4 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM5 ) /* x3 | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */
- MOVQ ( MM5, MM6 ) /* x3 | x2 */
-
- ADD_L ( CONST(16), EDX ) /* next r */
- PUNPCKHDQ ( MM6, MM6 ) /* x3 | x3 */
-
- PFMUL ( MM1, MM6 ) /* x3*m31 | x3*m30 */
- PFADD ( MM4, MM6 ) /* x1*m11+x3*m31 | x0*m00+x3*m30 */
-
- MOVQ ( MM6, REGOFF(-16, EDX) ) /* write r0, r1 */
- MOVQ ( MM5, REGOFF(-8, EDX) ) /* write r2, r3 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
-
- JNZ ( LLBL( G3TP2NRR_2 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TP2NRR_3 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_3dnow_transform_points4_identity )
-HIDDEN(_mesa_3dnow_transform_points4_identity)
-GLNAME( _mesa_3dnow_transform_points4_identity ):
-
- PUSH_L ( ESI )
-
- MOV_L ( ARG_DEST, ECX )
- MOV_L ( ARG_MATRIX, ESI )
- MOV_L ( ARG_SOURCE, EAX )
- MOV_L ( CONST(4), REGOFF(V4F_SIZE, ECX) )
- OR_B ( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, ECX) )
- MOV_L ( REGOFF(V4F_COUNT, EAX), EDX )
- MOV_L ( EDX, REGOFF(V4F_COUNT, ECX) )
-
- PUSH_L ( EDI )
-
- MOV_L ( REGOFF(V4F_START, ECX), EDX )
- MOV_L ( ESI, ECX )
- MOV_L ( REGOFF(V4F_COUNT, EAX), ESI )
- MOV_L ( REGOFF(V4F_STRIDE, EAX), EDI )
- MOV_L ( REGOFF(V4F_START, EAX), EAX )
-
- TEST_L ( ESI, ESI )
- JZ ( LLBL( G3TPIR_2 ) )
-
-ALIGNTEXT16
-LLBL( G3TPIR_1 ):
-
- PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */
-
- MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */
- MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */
-
- ADD_L ( EDI, EAX ) /* next vertex */
- PREFETCH ( REGIND(EAX) )
-
- ADD_L ( CONST(16), EDX ) /* next r */
- MOVQ ( MM0, REGOFF(-16, EDX) ) /* r1 | r0 */
-
- MOVQ ( MM1, REGOFF(-8, EDX) ) /* r3 | r2 */
-
- DEC_L ( ESI ) /* decrement vertex counter */
- JNZ ( LLBL( G3TPIR_1 ) ) /* cnt > 0 ? -> process next vertex */
-
-LLBL( G3TPIR_2 ):
-
- FEMMS
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/Makefile b/nx-X11/extras/Mesa/src/mesa/x86/Makefile
deleted file mode 100644
index 3c6a6b11c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-# src/mesa/x86/Makefile
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-
-INCLUDE_DIRS = \
- -I$(TOP)/include/GL \
- -I$(TOP)/include \
- -I.. \
- -I../main \
- -I../math \
- -I../glapi \
- -I../tnl
-
-
-default: gen_matypes matypes.h
-
-clean:
- rm -f matypes.h gen_matypes
-
-
-gen_matypes: gen_matypes.c
- $(CC) $(INCLUDE_DIRS) $(CFLAGS) gen_matypes.c -o gen_matypes
-
-# need some special rules here, unfortunately
-matypes.h: ../main/mtypes.h ../tnl/t_context.h gen_matypes
- ./gen_matypes > matypes.h
-
-common_x86_asm.o: matypes.h
-3dnow_normal.o: matypes.h
-3dnow_xform1.o: matypes.h
-3dnow_xform2.o: matypes.h
-3dnow_xform3.o: matypes.h
-3dnow_xform4.o: matypes.h
-mmx_blend.o: matypes.h
-sse_normal.o: matypes.h
-sse_xform1.o: matypes.h
-sse_xform2.o: matypes.h
-sse_xform3.o: matypes.h
-sse_xform4.o: matypes.h
-x86_cliptest.o: matypes.h
-x86_xform2.o: matypes.h
-x86_xform3.o: matypes.h
-x86_xform4.o: matypes.h
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/assyntax.h b/nx-X11/extras/Mesa/src/mesa/x86/assyntax.h
deleted file mode 100644
index 9bceacebd..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/assyntax.h
+++ /dev/null
@@ -1,1746 +0,0 @@
-
-#ifndef __ASSYNTAX_H__
-#define __ASSYNTAX_H__
-
-/*
- * Copyright 1992 Vrije Universiteit, The Netherlands
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the Vrije Universiteit not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. The Vrije Universiteit makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
- * IN NO EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * assyntax.h
- *
- * Select the syntax appropriate to the 386 assembler being used
- * To add support for more assemblers add more columns to the CHOICE
- * macro. Note that register names must also have uppercase names
- * to avoid macro recursion. e.g., #define ah %ah recurses!
- *
- * NB 1. Some of the macros for certain assemblers imply that the code is to
- * run in protected mode!! Caveat emptor.
- *
- * NB 2. 486 specific instructions are not included. This is to discourage
- * their accidental use in code that is intended to run on 386 and 486
- * systems.
- *
- * Supported assemblers:
- *
- * (a) AT&T SysVr4 as(1): define ATT_ASSEMBLER
- * (b) GNU Assembler gas: define GNU_ASSEMBLER (default)
- * (c) Amsterdam Compiler kit: define ACK_ASSEMBLER
- * (d) The Netwide Assembler: define NASM_ASSEMBLER
- * (e) Microsoft Assembler: define MASM_ASSEMBLER (UNTESTED!)
- *
- * The following naming conventions have been used to identify the various
- * data types:
- * _SR = segment register version
- * Integer:
- * _Q = quadword = 64 bits
- * _L = long = 32 bits
- * _W = short = 16 bits
- * _B = byte = 8 bits
- * Floating-point:
- * _X = m80real = 80 bits
- * _D = double = 64 bits
- * _S = single = 32 bits
- *
- * Author: Gregory J. Sharp, Sept 1992
- * Vrije Universiteit, Amsterdam, The Netherlands
- *
- * [support for Intel syntax added by Josh Vanderhoof, 1999]
- */
-
-#if !(defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER))
-
-/* Default to ATT_ASSEMBLER when SVR4 or SYSV are defined */
-#if (defined(SVR4) || defined(SYSV)) && !defined(GNU_ASSEMBLER)
-#define ATT_ASSEMBLER
-#endif
-
-#if !defined(ATT_ASSEMBLER) && !defined(GNU_ASSEMBLER) && !defined(ACK_ASSEMBLER)
-#define GNU_ASSEMBLER
-#endif
-
-#if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__))
-#define CONCAT(x, y) x ## y
-#define CONCAT3(x, y, z) x ## y ## z
-#else
-#define CONCAT(x, y) x/**/y
-#define CONCAT3(x, y, z) x/**/y/**/z
-#endif
-
-#ifdef ACK_ASSEMBLER
-
-/* Assume we write code for 32-bit protected mode! */
-
-/* Redefine register names for GAS & AT&T assemblers */
-#define AL al
-#define AH ah
-#define AX ax
-#define EAX ax
-#define BL bl
-#define BH bh
-#define BX bx
-#define EBX bx
-#define CL cl
-#define CH ch
-#define CX cx
-#define ECX cx
-#define DL dl
-#define DH dh
-#define DX dx
-#define EDX dx
-#define BP bp
-#define EBP bp
-#define SI si
-#define ESI si
-#define DI di
-#define EDI di
-#define SP sp
-#define ESP sp
-#define CS cs
-#define SS ss
-#define DS ds
-#define ES es
-#define FS fs
-#define GS gs
-/* Control Registers */
-#define CR0 cr0
-#define CR1 cr1
-#define CR2 cr2
-#define CR3 cr3
-/* Debug Registers */
-#define DR0 dr0
-#define DR1 dr1
-#define DR2 dr2
-#define DR3 dr3
-#define DR4 dr4
-#define DR5 dr5
-#define DR6 dr6
-#define DR7 dr7
-/* Floating-point Stack */
-#define ST st
-
-#define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
-
-
-#define _WTOG o16 /* word toggle for _W instructions */
-#define _LTOG /* long toggle for _L instructions */
-#define ADDR_TOGGLE a16
-#define OPSZ_TOGGLE o16
-#define USE16 .use16
-#define USE32 .use32
-
-#define CHOICE(a,b,c) c
-
-#else /* AT&T or GAS */
-
-/* Redefine register names for GAS & AT&T assemblers */
-#define AL %al
-#define AH %ah
-#define AX %ax
-#define EAX %eax
-#define BL %bl
-#define BH %bh
-#define BX %bx
-#define EBX %ebx
-#define CL %cl
-#define CH %ch
-#define CX %cx
-#define ECX %ecx
-#define DL %dl
-#define DH %dh
-#define DX %dx
-#define EDX %edx
-#define BP %bp
-#define EBP %ebp
-#define SI %si
-#define ESI %esi
-#define DI %di
-#define EDI %edi
-#define SP %sp
-#define ESP %esp
-#define CS %cs
-#define SS %ss
-#define DS %ds
-#define ES %es
-#define FS %fs
-#define GS %gs
-/* Control Registers */
-#define CR0 %cr0
-#define CR1 %cr1
-#define CR2 %cr2
-#define CR3 %cr3
-/* Debug Registers */
-#define DR0 %db0
-#define DR1 %db1
-#define DR2 %db2
-#define DR3 %db3
-#define DR4 %db4
-#define DR5 %db5
-#define DR6 %db6
-#define DR7 %db7
-/* Floating-point Stack */
-#define _STX0 %st(0)
-#define _STX1 %st(1)
-#define _STX2 %st(2)
-#define _STX3 %st(3)
-#define _STX4 %st(4)
-#define _STX5 %st(5)
-#define _STX6 %st(6)
-#define _STX7 %st(7)
-#define ST(x) CONCAT(_STX,x)
-#ifdef GNU_ASSEMBLER
-#define ST0 %st(0)
-#else
-#define ST0 %st
-#endif
-/* MMX Registers */
-#define MM0 %mm0
-#define MM1 %mm1
-#define MM2 %mm2
-#define MM3 %mm3
-#define MM4 %mm4
-#define MM5 %mm5
-#define MM6 %mm6
-#define MM7 %mm7
-/* SSE Registers */
-#define XMM0 %xmm0
-#define XMM1 %xmm1
-#define XMM2 %xmm2
-#define XMM3 %xmm3
-#define XMM4 %xmm4
-#define XMM5 %xmm5
-#define XMM6 %xmm6
-#define XMM7 %xmm7
-
-#define AS_BEGIN
-#define USE16
-#define USE32
-
-#ifdef GNU_ASSEMBLER
-
-#define ADDR_TOGGLE aword
-#define OPSZ_TOGGLE word
-
-#define CHOICE(a,b,c) b
-
-#else
-/*
- * AT&T ASSEMBLER SYNTAX
- * *********************
- */
-#define CHOICE(a,b,c) a
-
-#define ADDR_TOGGLE addr16
-#define OPSZ_TOGGLE data16
-
-#endif /* GNU_ASSEMBLER */
-#endif /* ACK_ASSEMBLER */
-
-
-#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__)
-#define GLNAME(a) a
-#else
-#define GLNAME(a) CONCAT(_,a)
-#endif
-
-
- /****************************************/
- /* */
- /* Select the various choices */
- /* */
- /****************************************/
-
-
-/* Redefine assembler directives */
-/*********************************/
-#define GLOBL CHOICE(.globl, .globl, .extern)
-#define GLOBAL GLOBL
-#define EXTERN GLOBL
-#ifndef __AOUT__
-#define ALIGNTEXT32 CHOICE(.align 32, .balign 32, .align 32)
-#define ALIGNTEXT16 CHOICE(.align 16, .balign 16, .align 16)
-#define ALIGNTEXT8 CHOICE(.align 8, .balign 8, .align 8)
-#define ALIGNTEXT4 CHOICE(.align 4, .balign 4, .align 4)
-#define ALIGNTEXT2 CHOICE(.align 2, .balign 2, .align 2)
-/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
- * guaranteed to be filled with NOPs. Otherwise it does nothing.
- */
-#define ALIGNTEXT32ifNOP CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/)
-#define ALIGNTEXT16ifNOP CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/)
-#define ALIGNTEXT8ifNOP CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/)
-#define ALIGNTEXT4ifNOP CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/)
-#define ALIGNDATA32 CHOICE(.align 32, .balign ARG2(32,0x0), .align 32)
-#define ALIGNDATA16 CHOICE(.align 16, .balign ARG2(16,0x0), .align 16)
-#define ALIGNDATA8 CHOICE(.align 8, .balign ARG2(8,0x0), .align 8)
-#define ALIGNDATA4 CHOICE(.align 4, .balign ARG2(4,0x0), .align 4)
-#define ALIGNDATA2 CHOICE(.align 2, .balign ARG2(2,0x0), .align 2)
-#else
-/* 'as -aout' on FreeBSD doesn't have .balign */
-#define ALIGNTEXT32 CHOICE(.align 32, .align ARG2(5,0x90), .align 32)
-#define ALIGNTEXT16 CHOICE(.align 16, .align ARG2(4,0x90), .align 16)
-#define ALIGNTEXT8 CHOICE(.align 8, .align ARG2(3,0x90), .align 8)
-#define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4)
-#define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2)
-/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
- * guaranteed to be filled with NOPs. Otherwise it does nothing.
- */
-#define ALIGNTEXT32ifNOP CHOICE(.align 32, .align ARG2(5,0x90), /*can't do it*/)
-#define ALIGNTEXT16ifNOP CHOICE(.align 16, .align ARG2(4,0x90), /*can't do it*/)
-#define ALIGNTEXT8ifNOP CHOICE(.align 8, .align ARG2(3,0x90), /*can't do it*/)
-#define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)
-#define ALIGNDATA32 CHOICE(.align 32, .align ARG2(5,0x0), .align 32)
-#define ALIGNDATA16 CHOICE(.align 16, .align ARG2(4,0x0), .align 16)
-#define ALIGNDATA8 CHOICE(.align 8, .align ARG2(3,0x0), .align 8)
-#define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4)
-#define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2)
-#endif /* __AOUT__ */
-#define FILE(s) CHOICE(.file s, .file s, .file s)
-#define STRING(s) CHOICE(.string s, .asciz s, .asciz s)
-#define D_LONG CHOICE(.long, .long, .data4)
-#define D_WORD CHOICE(.value, .short, .data2)
-#define D_BYTE CHOICE(.byte, .byte, .data1)
-#define SPACE CHOICE(.comm, .space, .space)
-#define COMM CHOICE(.comm, .comm, .comm)
-#define SEG_DATA CHOICE(.data, .data, .sect .data)
-#define SEG_TEXT CHOICE(.text, .text, .sect .text)
-#define SEG_BSS CHOICE(.bss, .bss, .sect .bss)
-
-#ifdef GNU_ASSEMBLER
-#define D_SPACE(n) . = . + n
-#else
-#define D_SPACE(n) .space n
-#endif
-
-/* Addressing Modes */
-/* Immediate Mode */
-#define ADDR(a) CHOICE(CONCAT($,a), $a, a)
-#define CONST(a) CHOICE(CONCAT($,a), $a, a)
-
-/* Indirect Mode */
-#define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */
-#define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */
-/* Register b indirect plus displacement a */
-#define REGOFF(a, b) CHOICE(a(b), a(b), a(b))
-/* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode
- * which has no scaling
- */
-#define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i))
-/* Reg indirect Base + (Index * Scale) */
-#define REGBIS(b,i,s) CHOICE((b,i,s), (b,i,s), (b)(i*s))
-/* Reg indirect Base + (Index * Scale) + Displacement */
-#define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))
-/* Displaced Scaled Index: */
-#define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s))
-/* Indexed Base: */
-#define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i))
-/* Displaced Base: */
-#define REGDB(d,b) CHOICE(d(b), d(b), d(b))
-/* Variable indirect: */
-#define VARINDIRECT(var) CHOICE(*var, *var, (var))
-/* Use register contents as jump/call target: */
-#define CODEPTR(reg) CHOICE(*reg, *reg, reg)
-
-/* For expressions requiring bracketing
- * eg. (CRT0_PM | CRT_EM)
- */
-
-#define EXPR(a) CHOICE([a], (a), [a])
-#define ENOT(a) CHOICE(0!a, ~a, ~a)
-#define EMUL(a,b) CHOICE(a\*b, a*b, a*b)
-#define EDIV(a,b) CHOICE(a\/b, a/b, a/b)
-
-/*
- * We have to beat the problem of commas within arguments to choice.
- * eg. choice (add a,b, add b,a) will get argument mismatch. Luckily ANSI
- * and other known cpp definitions evaluate arguments before substitution
- * so the following works.
- */
-#define ARG2(a, b) a,b
-#define ARG3(a,b,c) a,b,c
-
-/* Redefine assembler commands */
-#define AAA CHOICE(aaa, aaa, aaa)
-#define AAD CHOICE(aad, aad, aad)
-#define AAM CHOICE(aam, aam, aam)
-#define AAS CHOICE(aas, aas, aas)
-#define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a))
-#define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a))
-#define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a))
-#define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a))
-#define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a))
-#define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a))
-#define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a))
-#define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a))
-#define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a))
-#define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a))
-#define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a))
-#define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a))
-#define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a))
-#define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a))
-#define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a))
-#define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a))
-#define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a))
-#define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a))
-#define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a))
-#define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a))
-#define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a))
-#define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a))
-#define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a))
-#define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a))
-#define CALL(a) CHOICE(call a, call a, call a)
-#define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a)
-#define CBW CHOICE(cbtw, cbw, cbw)
-#define CWDE CHOICE(cwtd, cwde, cwde)
-#define CLC CHOICE(clc, clc, clc)
-#define CLD CHOICE(cld, cld, cld)
-#define CLI CHOICE(cli, cli, cli)
-#define CLTS CHOICE(clts, clts, clts)
-#define CMC CHOICE(cmc, cmc, cmc)
-#define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a))
-#define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a))
-#define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a))
-#define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps)
-#define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps)
-#define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb)
-#define CWD CHOICE(cwtl, cwd, cwd)
-#define CDQ CHOICE(cltd, cdq, cdq)
-#define DAA CHOICE(daa, daa, daa)
-#define DAS CHOICE(das, das, das)
-#define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a)
-#define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a)
-#define DEC_B(a) CHOICE(decb a, decb a, decb a)
-#define DIV_L(a) CHOICE(divl a, divl a, div a)
-#define DIV_W(a) CHOICE(divw a, divw a, div a)
-#define DIV_B(a) CHOICE(divb a, divb a, divb a)
-#define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a))
-#define HLT CHOICE(hlt, hlt, hlt)
-#define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a)
-#define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a)
-#define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a)
-/* More forms than this for imul!! */
-#define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a))
-#define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a))
-#define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a)
-#define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX)
-#define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX)
-#define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX)
-/* Please AS code writer: use the following ONLY, if you refer to ports<256
- * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer
- */
-#if defined (sun)
-#define IN1_L(a) CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a)
-#define IN1_W(a) CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a)
-#define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a)
-#else
-#define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a)
-#define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a)
-#define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a)
-#endif
-#define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a)
-#define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a)
-#define INC_B(a) CHOICE(incb a, incb a, incb a)
-#define INS_L CHOICE(insl, insl, _LTOG ins)
-#define INS_W CHOICE(insw, insw, _WTOG ins)
-#define INS_B CHOICE(insb, insb, insb)
-#define INT(a) CHOICE(int a, int a, int a)
-#define INT3 CHOICE(int CONST(3), int3, int CONST(3))
-#define INTO CHOICE(into, into, into)
-#define IRET CHOICE(iret, iret, iret)
-#define IRETD CHOICE(iret, iret, iretd)
-#define JA(a) CHOICE(ja a, ja a, ja a)
-#define JAE(a) CHOICE(jae a, jae a, jae a)
-#define JB(a) CHOICE(jb a, jb a, jb a)
-#define JBE(a) CHOICE(jbe a, jbe a, jbe a)
-#define JC(a) CHOICE(jc a, jc a, jc a)
-#define JE(a) CHOICE(je a, je a, je a)
-#define JG(a) CHOICE(jg a, jg a, jg a)
-#define JGE(a) CHOICE(jge a, jge a, jge a)
-#define JL(a) CHOICE(jl a, jl a, jl a)
-#define JLE(a) CHOICE(jle a, jle a, jle a)
-#define JNA(a) CHOICE(jna a, jna a, jna a)
-#define JNAE(a) CHOICE(jnae a, jnae a, jnae a)
-#define JNB(a) CHOICE(jnb a, jnb a, jnb a)
-#define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a)
-#define JNC(a) CHOICE(jnc a, jnc a, jnc a)
-#define JNE(a) CHOICE(jne a, jne a, jne a)
-#define JNG(a) CHOICE(jng a, jng a, jng a)
-#define JNGE(a) CHOICE(jnge a, jnge a, jnge a)
-#define JNL(a) CHOICE(jnl a, jnl a, jnl a)
-#define JNLE(a) CHOICE(jnle a, jnle a, jnle a)
-#define JNO(a) CHOICE(jno a, jno a, jno a)
-#define JNP(a) CHOICE(jnp a, jnp a, jnp a)
-#define JNS(a) CHOICE(jns a, jns a, jns a)
-#define JNZ(a) CHOICE(jnz a, jnz a, jnz a)
-#define JO(a) CHOICE(jo a, jo a, jo a)
-#define JP(a) CHOICE(jp a, jp a, jp a)
-#define JPE(a) CHOICE(jpe a, jpe a, jpe a)
-#define JPO(a) CHOICE(jpo a, jpo a, jpo a)
-#define JS(a) CHOICE(js a, js a, js a)
-#define JZ(a) CHOICE(jz a, jz a, jz a)
-#define JMP(a) CHOICE(jmp a, jmp a, jmp a)
-#define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a)
-#define LAHF CHOICE(lahf, lahf, lahf)
-#if !defined(_REAL_MODE) && !defined(_V86_MODE)
-#define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a))
-#endif
-#define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a))
-#define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a))
-#define LEAVE CHOICE(leave, leave, leave)
-#define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a)
-#define LIDT(a) CHOICE(lidt a, lidt a, lidt a)
-#define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a))
-#define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a))
-#define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a))
-#define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a))
-#define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a))
-#define LLDT(a) CHOICE(lldt a, lldt a, lldt a)
-#define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a)
-#define LOCK CHOICE(lock, lock, lock)
-#define LODS_L CHOICE(lodsl, lodsl, _LTOG lods)
-#define LODS_W CHOICE(lodsw, lodsw, _WTOG lods)
-#define LODS_B CHOICE(lodsb, lodsb, lodsb)
-#define LOOP(a) CHOICE(loop a, loop a, loop a)
-#define LOOPE(a) CHOICE(loope a, loope a, loope a)
-#define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a)
-#define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a)
-#define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a)
-#if !defined(_REAL_MODE) && !defined(_V86_MODE)
-#define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a))
-#endif
-#define LTR(a) CHOICE(ltr a, ltr a, ltr a)
-#define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a))
-#define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a))
-#define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a))
-#define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a))
-#define MOVS_L CHOICE(movsl, movsl, _LTOG movs)
-#define MOVS_W CHOICE(movsw, movsw, _WTOG movs)
-#define MOVS_B CHOICE(movsb, movsb, movsb)
-#define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a))
-#define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a))
-#define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a))
-#define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a))
-#define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a))
-#define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a))
-#define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a)
-#define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a)
-#define MUL_B(a) CHOICE(mulb a, mulb a, mulb a)
-#define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a)
-#define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a)
-#define NEG_B(a) CHOICE(negb a, negb a, negb a)
-#define NOP CHOICE(nop, nop, nop)
-#define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a)
-#define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a)
-#define NOT_B(a) CHOICE(notb a, notb a, notb a)
-#define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a))
-#define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a))
-#define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a))
-#define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX)
-#define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX)
-#define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX)
-/* Please AS code writer: use the following ONLY, if you refer to ports<256
- * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer
- */
-#define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a)
-#define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a)
-#define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a)
-#define OUTS_L CHOICE(outsl, outsl, _LTOG outs)
-#define OUTS_W CHOICE(outsw, outsw, _WTOG outs)
-#define OUTS_B CHOICE(outsb, outsb, outsb)
-#define POP_SR(a) CHOICE(pop a, pop a, pop a)
-#define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a)
-#define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a)
-#define POPA_L CHOICE(popal, popal, _LTOG popa)
-#define POPA_W CHOICE(popaw, popaw, _WTOG popa)
-#define POPF_L CHOICE(popfl, popfl, _LTOG popf)
-#define POPF_W CHOICE(popfw, popfw, _WTOG popf)
-#define PUSH_SR(a) CHOICE(push a, push a, push a)
-#define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a)
-#define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a)
-#define PUSH_B(a) CHOICE(push a, pushb a, push a)
-#define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha)
-#define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha)
-#define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf)
-#define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf)
-#define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a))
-#define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a))
-#define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a))
-#define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a))
-#define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a))
-#define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a))
-#define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a))
-#define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a))
-#define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a))
-#define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a))
-#define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a))
-#define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a))
-#define REP CHOICE(rep ;, rep ;, repe)
-#define REPE CHOICE(repz ;, repe ;, repe)
-#define REPNE CHOICE(repnz ;, repne ;, repne)
-#define REPNZ REPNE
-#define REPZ REPE
-#define RET CHOICE(ret, ret, ret)
-#define SAHF CHOICE(sahf, sahf, sahf)
-#define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a))
-#define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a))
-#define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a))
-#define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a))
-#define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a))
-#define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a))
-#define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a))
-#define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a))
-#define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a))
-#define SCAS_L CHOICE(scasl, scasl, _LTOG scas)
-#define SCAS_W CHOICE(scasw, scasw, _WTOG scas)
-#define SCAS_B CHOICE(scasb, scasb, scasb)
-#define SETA(a) CHOICE(seta a, seta a, seta a)
-#define SETAE(a) CHOICE(setae a, setae a, setae a)
-#define SETB(a) CHOICE(setb a, setb a, setb a)
-#define SETBE(a) CHOICE(setbe a, setbe a, setbe a)
-#define SETC(a) CHOICE(setc a, setb a, setb a)
-#define SETE(a) CHOICE(sete a, sete a, sete a)
-#define SETG(a) CHOICE(setg a, setg a, setg a)
-#define SETGE(a) CHOICE(setge a, setge a, setge a)
-#define SETL(a) CHOICE(setl a, setl a, setl a)
-#define SETLE(a) CHOICE(setle a, setle a, setle a)
-#define SETNA(a) CHOICE(setna a, setna a, setna a)
-#define SETNAE(a) CHOICE(setnae a, setnae a, setnae a)
-#define SETNB(a) CHOICE(setnb a, setnb a, setnb a)
-#define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a)
-#define SETNC(a) CHOICE(setnc a, setnb a, setnb a)
-#define SETNE(a) CHOICE(setne a, setne a, setne a)
-#define SETNG(a) CHOICE(setng a, setng a, setng a)
-#define SETNGE(a) CHOICE(setnge a, setnge a, setnge a)
-#define SETNL(a) CHOICE(setnl a, setnl a, setnl a)
-#define SETNLE(a) CHOICE(setnle a, setnle a, setnle a)
-#define SETNO(a) CHOICE(setno a, setno a, setno a)
-#define SETNP(a) CHOICE(setnp a, setnp a, setnp a)
-#define SETNS(a) CHOICE(setns a, setns a, setna a)
-#define SETNZ(a) CHOICE(setnz a, setnz a, setnz a)
-#define SETO(a) CHOICE(seto a, seto a, seto a)
-#define SETP(a) CHOICE(setp a, setp a, setp a)
-#define SETPE(a) CHOICE(setpe a, setpe a, setpe a)
-#define SETPO(a) CHOICE(setpo a, setpo a, setpo a)
-#define SETS(a) CHOICE(sets a, sets a, seta a)
-#define SETZ(a) CHOICE(setz a, setz a, setz a)
-#define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a)
-#define SIDT(a) CHOICE(sidt a, sidt a, sidt a)
-#define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a))
-#define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a))
-#define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a))
-#define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a))
-#define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL))
-#define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a))
-#define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL))
-#define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a))
-#define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a))
-#define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a))
-#define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a))
-#define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL))
-#define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a))
-#define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL))
-#define SLDT(a) CHOICE(sldt a, sldt a, sldt a)
-#define SMSW(a) CHOICE(smsw a, smsw a, smsw a)
-#define STC CHOICE(stc, stc, stc)
-#define STD CHOICE(std, std, std)
-#define STI CHOICE(sti, sti, sti)
-#define STOS_L CHOICE(stosl, stosl, _LTOG stos)
-#define STOS_W CHOICE(stosw, stosw, _WTOG stos)
-#define STOS_B CHOICE(stosb, stosb, stosb)
-#define STR(a) CHOICE(str a, str a, str a)
-#define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a))
-#define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a))
-#define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a))
-#define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a))
-#define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a))
-#define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a))
-#define VERR(a) CHOICE(verr a, verr a, verr a)
-#define VERW(a) CHOICE(verw a, verw a, verw a)
-#define WAIT CHOICE(wait, wait, wait)
-#define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a))
-#define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a))
-#define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a))
-#define XLAT CHOICE(xlat, xlat, xlat)
-#define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a))
-#define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a))
-#define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a))
-
-
-/* Floating Point Instructions */
-#define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1)
-#define FABS CHOICE(fabs, fabs, fabs)
-#define FADD_D(a) CHOICE(faddl a, faddl a, faddd a)
-#define FADD_S(a) CHOICE(fadds a, fadds a, fadds a)
-#define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a))
-#define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a))
-#define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a)
-#define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a)
-#define FBLD(a) CHOICE(fbld a, fbld a, fbld a)
-#define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a)
-#define FCHS CHOICE(fchs, fchs, fchs)
-#define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex)
-#define FNCLEX CHOICE(fnclex, fnclex, fclex)
-#define FCOM(a) CHOICE(fcom a, fcom a, fcom a)
-#define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a)
-#define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a)
-#define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a)
-#define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a)
-#define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a)
-#define FCOMPP CHOICE(fcompp, fcompp, fcompp)
-#define FCOS CHOICE(fcos, fcos, fcos)
-#define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp)
-#define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a)
-#define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a)
-#define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))
-#define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))
-#define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a)
-#define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a)
-#define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a)
-#define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a)
-#define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))
-#define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))
-#define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a)
-#define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a)
-#define FFREE(a) CHOICE(ffree a, ffree a, ffree a)
-#define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a)
-#define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a)
-#define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a)
-#define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a)
-#define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a)
-#define FILD_L(a) CHOICE(fildl a, fildl a, fildl a)
-#define FILD_W(a) CHOICE(fild a, filds a, filds a)
-#define FINCSTP CHOICE(fincstp, fincstp, fincstp)
-#define FINIT CHOICE(finit, wait; fninit, wait; finit)
-#define FNINIT CHOICE(fninit, fninit, finit)
-#define FIST_L(a) CHOICE(fistl a, fistl a, fistl a)
-#define FIST_W(a) CHOICE(fist a, fists a, fists a)
-#define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a)
-#define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a)
-#define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a)
-#define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */
-#define FLD_D(a) CHOICE(fldl a, fldl a, fldd a)
-#define FLD_S(a) CHOICE(flds a, flds a, flds a)
-#define FLD1 CHOICE(fld1, fld1, fld1)
-#define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t)
-#define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e)
-#define FLDPI CHOICE(fldpi, fldpi, fldpi)
-#define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2)
-#define FLDLN2 CHOICE(fldln2, fldln2, fldln2)
-#define FLDZ CHOICE(fldz, fldz, fldz)
-#define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a)
-#define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a)
-#define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a)
-#define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a)
-#define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))
-#define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))
-#define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a)
-#define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a)
-#define FNOP CHOICE(fnop, fnop, fnop)
-#define FPATAN CHOICE(fpatan, fpatan, fpatan)
-#define FPREM CHOICE(fprem, fprem, fprem)
-#define FPREM1 CHOICE(fprem1, fprem1, fprem1)
-#define FPTAN CHOICE(fptan, fptan, fptan)
-#define FRNDINT CHOICE(frndint, frndint, frndint)
-#define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a)
-#define FSAVE(a) CHOICE(fsave a, wait; fnsave a, wait; fsave a)
-#define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a)
-#define FSCALE CHOICE(fscale, fscale, fscale)
-#define FSIN CHOICE(fsin, fsin, fsin)
-#define FSINCOS CHOICE(fsincos, fsincos, fsincos)
-#define FSQRT CHOICE(fsqrt, fsqrt, fsqrt)
-#define FST_D(a) CHOICE(fstl a, fstl a, fstd a)
-#define FST_S(a) CHOICE(fsts a, fsts a, fsts a)
-#define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a)
-#define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a)
-#define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a)
-#define FSTP(a) CHOICE(fstp a, fstp a, fstp a)
-#define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
-#define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a)
-#define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a)
-#define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a)
-#define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)
-#define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a)
-#define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a)
-#define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a)
-#define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))
-#define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))
-#define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a)
-#define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a)
-#define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a)
-#define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a)
-#define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))
-#define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))
-#define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a)
-#define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a)
-#define FTST CHOICE(ftst, ftst, ftst)
-#define FUCOM(a) CHOICE(fucom a, fucom a, fucom a)
-#define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a)
-#define FUCOMPP CHOICE(fucompp, fucompp, fucompp)
-#define FWAIT CHOICE(wait, wait, wait)
-#define FXAM CHOICE(fxam, fxam, fxam)
-#define FXCH(a) CHOICE(fxch a, fxch a, fxch a)
-#define FXTRACT CHOICE(fxtract, fxtract, fxtract)
-#define FYL2X CHOICE(fyl2x, fyl2x, fyl2x)
-#define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)
-
-/* New instructions */
-#define CPUID CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162))
-#define RDTSC CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49))
-
-#else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */
-
- /****************************************/
- /* */
- /* Intel style assemblers. */
- /* (NASM and MASM) */
- /* */
- /****************************************/
-
-#define P_EAX EAX
-#define L_EAX EAX
-#define W_AX AX
-#define B_AH AH
-#define B_AL AL
-
-#define P_EBX EBX
-#define L_EBX EBX
-#define W_BX BX
-#define B_BH BH
-#define B_BL BL
-
-#define P_ECX ECX
-#define L_ECX ECX
-#define W_CX CX
-#define B_CH CH
-#define B_CL CL
-
-#define P_EDX EDX
-#define L_EDX EDX
-#define W_DX DX
-#define B_DH DH
-#define B_DL DL
-
-#define P_EBP EBP
-#define L_EBP EBP
-#define W_BP BP
-
-#define P_ESI ESI
-#define L_ESI ESI
-#define W_SI SI
-
-#define P_EDI EDI
-#define L_EDI EDI
-#define W_DI DI
-
-#define P_ESP ESP
-#define L_ESP ESP
-#define W_SP SP
-
-#define W_CS CS
-#define W_SS SS
-#define W_DS DS
-#define W_ES ES
-#define W_FS FS
-#define W_GS GS
-
-#define X_ST ST
-#define D_ST ST
-#define L_ST ST
-
-#define P_MM0 mm0
-#define P_MM1 mm1
-#define P_MM2 mm2
-#define P_MM3 mm3
-#define P_MM4 mm4
-#define P_MM5 mm5
-#define P_MM6 mm6
-#define P_MM7 mm7
-
-#define P_XMM0 xmm0
-#define P_XMM1 xmm1
-#define P_XMM2 xmm2
-#define P_XMM3 xmm3
-#define P_XMM4 xmm4
-#define P_XMM5 xmm5
-#define P_XMM6 xmm6
-#define P_XMM7 xmm7
-
-#define CONCAT(x, y) x ## y
-#define CONCAT3(x, y, z) x ## y ## z
-
-#if defined(NASM_ASSEMBLER)
-
-#define ST(n) st ## n
-#define ST0 st0
-
-#define TBYTE_PTR tword
-#define QWORD_PTR qword
-#define DWORD_PTR dword
-#define WORD_PTR word
-#define BYTE_PTR byte
-
-#define OFFSET
-
-#define GLOBL GLOBAL
-#define ALIGNTEXT32 ALIGN 32
-#define ALIGNTEXT16 ALIGN 16
-#define ALIGNTEXT8 ALIGN 8
-#define ALIGNTEXT4 ALIGN 4
-#define ALIGNTEXT2 ALIGN 2
-#define ALIGNTEXT32ifNOP ALIGN 32
-#define ALIGNTEXT16ifNOP ALIGN 16
-#define ALIGNTEXT8ifNOP ALIGN 8
-#define ALIGNTEXT4ifNOP ALIGN 4
-#define ALIGNDATA32 ALIGN 32
-#define ALIGNDATA16 ALIGN 16
-#define ALIGNDATA8 ALIGN 8
-#define ALIGNDATA4 ALIGN 4
-#define ALIGNDATA2 ALIGN 2
-#define FILE(s)
-#define STRING(s) db s
-#define D_LONG dd
-#define D_WORD dw
-#define D_BYTE db
-/* #define SPACE */
-/* #define COMM */
-#if defined(__WATCOMC__)
-SECTION _TEXT public align=16 class=CODE use32 flat
-SECTION _DATA public align=16 class=DATA use32 flat
-#define SEG_TEXT SECTION _TEXT
-#define SEG_DATA SECTION _DATA
-#define SEG_BSS SECTION .bss
-#else
-#define SEG_DATA SECTION .data
-#define SEG_TEXT SECTION .text
-#define SEG_BSS SECTION .bss
-#endif
-
-#define D_SPACE(n) db n REP 0
-
-#define AS_BEGIN
-
-/* Jcc's should be handled better than this... */
-#define NEAR near
-
-#else /* MASM */
-
-#define TBYTE_PTR tbyte ptr
-#define QWORD_PTR qword ptr
-#define DWORD_PTR dword ptr
-#define WORD_PTR word ptr
-#define BYTE_PTR byte ptr
-
-#define OFFSET offset
-
-#define GLOBL GLOBAL
-#define ALIGNTEXT32 ALIGN 32
-#define ALIGNTEXT16 ALIGN 16
-#define ALIGNTEXT8 ALIGN 8
-#define ALIGNTEXT4 ALIGN 4
-#define ALIGNTEXT2 ALIGN 2
-#define ALIGNTEXT32ifNOP ALIGN 32
-#define ALIGNTEXT16ifNOP ALIGN 16
-#define ALIGNTEXT8ifNOP ALIGN 8
-#define ALIGNTEXT4ifNOP ALIGN 4
-#define ALIGNDATA32 ALIGN 32
-#define ALIGNDATA16 ALIGN 16
-#define ALIGNDATA8 ALIGN 8
-#define ALIGNDATA4 ALIGN 4
-#define ALIGNDATA2 ALIGN 2
-#define FILE(s)
-#define STRING(s) db s
-#define D_LONG dd
-#define D_WORD dw
-#define D_BYTE db
-/* #define SPACE */
-/* #define COMM */
-#define SEG_DATA .DATA
-#define SEG_TEXT .CODE
-#define SEG_BSS .DATA
-
-#define D_SPACE(n) db n REP 0
-
-#define AS_BEGIN
-
-#define NEAR
-
-#endif
-
-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
- || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \
- || defined(__FreeBSD__) && __FreeBSD__ >= 3
-#define GLNAME(a) a
-#else
-#define GLNAME(a) CONCAT(_, a)
-#endif
-
-/*
- * Addressing Modes
- */
-
-/* Immediate Mode */
-#define P_ADDR(a) OFFSET a
-#define X_ADDR(a) OFFSET a
-#define D_ADDR(a) OFFSET a
-#define L_ADDR(a) OFFSET a
-#define W_ADDR(a) OFFSET a
-#define B_ADDR(a) OFFSET a
-
-#define P_CONST(a) a
-#define X_CONST(a) a
-#define D_CONST(a) a
-#define L_CONST(a) a
-#define W_CONST(a) a
-#define B_CONST(a) a
-
-/* Indirect Mode */
-#ifdef NASM_ASSEMBLER
-#define P_CONTENT(a) [a]
-#define X_CONTENT(a) TBYTE_PTR [a]
-#define D_CONTENT(a) QWORD_PTR [a]
-#define L_CONTENT(a) DWORD_PTR [a]
-#define W_CONTENT(a) WORD_PTR [a]
-#define B_CONTENT(a) BYTE_PTR [a]
-#else
-#define P_CONTENT(a) a
-#define X_CONTENT(a) TBYTE_PTR a
-#define D_CONTENT(a) QWORD_PTR a
-#define L_CONTENT(a) DWORD_PTR a
-#define W_CONTENT(a) WORD_PTR a
-#define B_CONTENT(a) BYTE_PTR a
-#endif
-
-/* Register a indirect */
-#define P_REGIND(a) [a]
-#define X_REGIND(a) TBYTE_PTR [a]
-#define D_REGIND(a) QWORD_PTR [a]
-#define L_REGIND(a) DWORD_PTR [a]
-#define W_REGIND(a) WORD_PTR [a]
-#define B_REGIND(a) BYTE_PTR [a]
-
-/* Register b indirect plus displacement a */
-#define P_REGOFF(a, b) [b + a]
-#define X_REGOFF(a, b) TBYTE_PTR [b + a]
-#define D_REGOFF(a, b) QWORD_PTR [b + a]
-#define L_REGOFF(a, b) DWORD_PTR [b + a]
-#define W_REGOFF(a, b) WORD_PTR [b + a]
-#define B_REGOFF(a, b) BYTE_PTR [b + a]
-
-/* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode
- * which has no scaling
- */
-#define P_REGBID(b, i, d) [b + i + d]
-#define X_REGBID(b, i, d) TBYTE_PTR [b + i + d]
-#define D_REGBID(b, i, d) QWORD_PTR [b + i + d]
-#define L_REGBID(b, i, d) DWORD_PTR [b + i + d]
-#define W_REGBID(b, i, d) WORD_PTR [b + i + d]
-#define B_REGBID(b, i, d) BYTE_PTR [b + i + d]
-
-/* Reg indirect Base + (Index * Scale) */
-#define P_REGBIS(b, i, s) [b + i * s]
-#define X_REGBIS(b, i, s) TBYTE_PTR [b + i * s]
-#define D_REGBIS(b, i, s) QWORD_PTR [b + i * s]
-#define L_REGBIS(b, i, s) DWORD_PTR [b + i * s]
-#define W_REGBIS(b, i, s) WORD_PTR [b + i * s]
-#define B_REGBIS(b, i, s) BYTE_PTR [b + i * s]
-
-/* Reg indirect Base + (Index * Scale) + Displacement */
-#define P_REGBISD(b, i, s, d) [b + i * s + d]
-#define X_REGBISD(b, i, s, d) TBYTE_PTR [b + i * s + d]
-#define D_REGBISD(b, i, s, d) QWORD_PTR [b + i * s + d]
-#define L_REGBISD(b, i, s, d) DWORD_PTR [b + i * s + d]
-#define W_REGBISD(b, i, s, d) WORD_PTR [b + i * s + d]
-#define B_REGBISD(b, i, s, d) BYTE_PTR [b + i * s + d]
-
-/* Displaced Scaled Index: */
-#define P_REGDIS(d, i, s) [i * s + d]
-#define X_REGDIS(d, i, s) TBYTE_PTR [i * s + d]
-#define D_REGDIS(d, i, s) QWORD_PTR [i * s + d]
-#define L_REGDIS(d, i, s) DWORD_PTR [i * s + d]
-#define W_REGDIS(d, i, s) WORD_PTR [i * s + d]
-#define B_REGDIS(d, i, s) BYTE_PTR [i * s + d]
-
-/* Indexed Base: */
-#define P_REGBI(b, i) [b + i]
-#define X_REGBI(b, i) TBYTE_PTR [b + i]
-#define D_REGBI(b, i) QWORD_PTR [b + i]
-#define L_REGBI(b, i) DWORD_PTR [b + i]
-#define W_REGBI(b, i) WORD_PTR [b + i]
-#define B_REGBI(b, i) BYTE_PTR [b + i]
-
-/* Displaced Base: */
-#define P_REGDB(d, b) [b + d]
-#define X_REGDB(d, b) TBYTE_PTR [b + d]
-#define D_REGDB(d, b) QWORD_PTR [b + d]
-#define L_REGDB(d, b) DWORD_PTR [b + d]
-#define W_REGDB(d, b) WORD_PTR [b + d]
-#define B_REGDB(d, b) BYTE_PTR [b + d]
-
-/* Variable indirect: */
-#define VARINDIRECT(var) [var]
-
-/* Use register contents as jump/call target: */
-#define CODEPTR(reg) P_(reg)
-
-/*
- * Redefine assembler commands
- */
-
-#define P_(a) P_ ## a
-#define X_(a) X_ ## a
-#define D_(a) D_ ## a
-#define SR_(a) W_ ## a
-#define S_(a) L_ ## a
-#define L_(a) L_ ## a
-#define W_(a) W_ ## a
-#define B_(a) B_ ## a
-
-#define AAA aaa
-#define AAD aad
-#define AAM aam
-#define AAS aas
-#define ADC_L(a, b) adc L_(b), L_(a)
-#define ADC_W(a, b) adc W_(b), W_(a)
-#define ADC_B(a, b) adc B_(b), B_(a)
-#define ADD_L(a, b) add L_(b), L_(a)
-#define ADD_W(a, b) add W_(b), W_(a)
-#define ADD_B(a, b) add B_(b), B_(a)
-#define AND_L(a, b) and L_(b), L_(a)
-#define AND_W(a, b) and W_(b), W_(a)
-#define AND_B(a, b) and B_(b), B_(a)
-#define ARPL(a,b) arpl W_(b), a
-#define BOUND_L(a, b) bound L_(b), L_(a)
-#define BOUND_W(a, b) bound W_(b), W_(a)
-#define BSF_L(a, b) bsf L_(b), L_(a)
-#define BSF_W(a, b) bsf W_(b), W_(a)
-#define BSR_L(a, b) bsr L_(b), L_(a)
-#define BSR_W(a, b) bsr W_(b), W_(a)
-#define BT_L(a, b) bt L_(b), L_(a)
-#define BT_W(a, b) bt W_(b), W_(a)
-#define BTC_L(a, b) btc L_(b), L_(a)
-#define BTC_W(a, b) btc W_(b), W_(a)
-#define BTR_L(a, b) btr L_(b), L_(a)
-#define BTR_W(a, b) btr W_(b), W_(a)
-#define BTS_L(a, b) bts L_(b), L_(a)
-#define BTS_W(a, b) bts W_(b), W_(a)
-#define CALL(a) call a
-#define CALLF(s,a) call far s:a
-#define CBW cbw
-#define CWDE cwde
-#define CLC clc
-#define CLD cld
-#define CLI cli
-#define CLTS clts
-#define CMC cmc
-#define CMP_L(a, b) cmp L_(b), L_(a)
-#define CMP_W(a, b) cmp W_(b), W_(a)
-#define CMP_B(a, b) cmp B_(b), B_(a)
-#define CMPS_L cmpsd
-#define CMPS_W cmpsw
-#define CMPS_B cmpsb
-#define CPUID cpuid
-#define CWD cwd
-#define CDQ cdq
-#define DAA daa
-#define DAS das
-#define DEC_L(a) dec L_(a)
-#define DEC_W(a) dec W_(a)
-#define DEC_B(a) dec B_(a)
-#define DIV_L(a) div L_(a)
-#define DIV_W(a) div W_(a)
-#define DIV_B(a) div B_(a)
-#define ENTER(a,b) enter b, a
-#define HLT hlt
-#define IDIV_L(a) idiv L_(a)
-#define IDIV_W(a) idiv W_(a)
-#define IDIV_B(a) idiv B_(a)
-#define IMUL_L(a, b) imul L_(b), L_(a)
-#define IMUL_W(a, b) imul W_(b), W_(a)
-#define IMUL_B(a) imul B_(a)
-#define IN_L in EAX, DX
-#define IN_W in AX, DX
-#define IN_B in AL, DX
-#define IN1_L(a) in1 L_(a)
-#define IN1_W(a) in1 W_(a)
-#define IN1_B(a) in1 B_(a)
-#define INC_L(a) inc L_(a)
-#define INC_W(a) inc W_(a)
-#define INC_B(a) inc B_(a)
-#define INS_L ins
-#define INS_W ins
-#define INS_B ins
-#define INT(a) int B_(a)
-#define INT3 int3
-#define INTO into
-#define IRET iret
-#define IRETD iretd
-#define JA(a) ja NEAR a
-#define JAE(a) jae NEAR a
-#define JB(a) jb NEAR a
-#define JBE(a) jbe NEAR a
-#define JC(a) jc NEAR a
-#define JE(a) je NEAR a
-#define JG(a) jg NEAR a
-#define JGE(a) jge NEAR a
-#define JL(a) jl NEAR a
-#define JLE(a) jle NEAR a
-#define JNA(a) jna NEAR a
-#define JNAE(a) jnae NEAR a
-#define JNB(a) jnb NEAR a
-#define JNBE(a) jnbe NEAR a
-#define JNC(a) jnc NEAR a
-#define JNE(a) jne NEAR a
-#define JNG(a) jng NEAR a
-#define JNGE(a) jnge NEAR a
-#define JNL(a) jnl NEAR a
-#define JNLE(a) jnle NEAR a
-#define JNO(a) jno NEAR a
-#define JNP(a) jnp NEAR a
-#define JNS(a) jns NEAR a
-#define JNZ(a) jnz NEAR a
-#define JO(a) jo NEAR a
-#define JP(a) jp NEAR a
-#define JPE(a) jpe NEAR a
-#define JPO(a) jpo NEAR a
-#define JS(a) js NEAR a
-#define JZ(a) jz NEAR a
-#define JMP(a) jmp a
-#define JMPF(s,a) jmp far s:a
-#define LAHF lahf
-#define LAR(a, b) lar b, a
-#define LEA_L(a, b) lea P_(b), P_(a)
-#define LEA_W(a, b) lea P_(b), P_(a)
-#define LEAVE leave
-#define LGDT(a) lgdt a
-#define LIDT(a) lidt a
-#define LDS(a, b) lds b, P_(a)
-#define LES(a, b) les b, P_(a)
-#define LFS(a, b) lfs b, P_(a)
-#define LGS(a, b) lgs b, P_(a)
-#define LSS(a, b) lss b, P_(a)
-#define LLDT(a) lldt a
-#define LMSW(a) lmsw a
-#define LOCK lock
-#define LODS_L lodsd
-#define LODS_W lodsw
-#define LODS_B lodsb
-#define LOOP(a) loop a
-#define LOOPE(a) loope a
-#define LOOPZ(a) loopz a
-#define LOOPNE(a) loopne a
-#define LOOPNZ(a) loopnz a
-#define LSL(a, b) lsl b, a
-#define LTR(a) ltr a
-#define MOV_SR(a, b) mov SR_(b), SR_(a)
-#define MOV_L(a, b) mov L_(b), L_(a)
-#define MOV_W(a, b) mov W_(b), W_(a)
-#define MOV_B(a, b) mov B_(b), B_(a)
-#define MOVS_L movsd
-#define MOVS_W movsw
-#define MOVS_B movsb
-#define MOVSX_BL(a, b) movsx B_(b), B_(a)
-#define MOVSX_BW(a, b) movsx B_(b), B_(a)
-#define MOVSX_WL(a, b) movsx W_(b), W_(a)
-#define MOVZX_BL(a, b) movzx B_(b), B_(a)
-#define MOVZX_BW(a, b) movzx B_(b), B_(a)
-#define MOVZX_WL(a, b) movzx W_(b), W_(a)
-#define MUL_L(a) mul L_(a)
-#define MUL_W(a) mul W_(a)
-#define MUL_B(a) mul B_(a)
-#define NEG_L(a) neg L_(a)
-#define NEG_W(a) neg W_(a)
-#define NEG_B(a) neg B_(a)
-#define NOP nop
-#define NOT_L(a) not L_(a)
-#define NOT_W(a) not W_(a)
-#define NOT_B(a) not B_(a)
-#define OR_L(a,b) or L_(b), L_(a)
-#define OR_W(a,b) or W_(b), W_(a)
-#define OR_B(a,b) or B_(b), B_(a)
-#define OUT_L out DX, EAX
-#define OUT_W out DX, AX
-#define OUT_B out DX, AL
-#define OUT1_L(a) out1 L_(a)
-#define OUT1_W(a) out1 W_(a)
-#define OUT1_B(a) out1 B_(a)
-#define OUTS_L outsd
-#define OUTS_W outsw
-#define OUTS_B outsb
-#define POP_SR(a) pop SR_(a)
-#define POP_L(a) pop L_(a)
-#define POP_W(a) pop W_(a)
-#define POPA_L popad
-#define POPA_W popa
-#define POPF_L popfd
-#define POPF_W popf
-#define PUSH_SR(a) push SR_(a)
-#define PUSH_L(a) push L_(a)
-#define PUSH_W(a) push W_(a)
-#define PUSH_B(a) push B_(a)
-#define PUSHA_L pushad
-#define PUSHA_W pusha
-#define PUSHF_L pushfd
-#define PUSHF_W pushf
-#define RCL_L(a, b) rcl L_(b), L_(a)
-#define RCL_W(a, b) rcl W_(b), W_(a)
-#define RCL_B(a, b) rcl B_(b), B_(a)
-#define RCR_L(a, b) rcr L_(b), L_(a)
-#define RCR_W(a, b) rcr W_(b), W_(a)
-#define RCR_B(a, b) rcr B_(b), B_(a)
-#define RDTSC rdtsc
-#define ROL_L(a, b) rol L_(b), L_(a)
-#define ROL_W(a, b) rol W_(b), W_(a)
-#define ROL_B(a, b) rol B_(b), B_(a)
-#define ROR_L(a, b) ror L_(b), L_(a)
-#define ROR_W(a, b) ror W_(b), W_(a)
-#define ROR_B(a, b) ror B_(b), B_(a)
-#define REP rep
-#define REPE repe
-#define REPNE repne
-#define REPNZ REPNE
-#define REPZ REPE
-#define RET ret
-#define SAHF sahf
-#define SAL_L(a, b) sal L_(b), B_(a)
-#define SAL_W(a, b) sal W_(b), B_(a)
-#define SAL_B(a, b) sal B_(b), B_(a)
-#define SAR_L(a, b) sar L_(b), B_(a)
-#define SAR_W(a, b) sar W_(b), B_(a)
-#define SAR_B(a, b) sar B_(b), B_(a)
-#define SBB_L(a, b) sbb L_(b), L_(a)
-#define SBB_W(a, b) sbb W_(b), W_(a)
-#define SBB_B(a, b) sbb B_(b), B_(a)
-#define SCAS_L scas
-#define SCAS_W scas
-#define SCAS_B scas
-#define SETA(a) seta a
-#define SETAE(a) setae a
-#define SETB(a) setb a
-#define SETBE(a) setbe a
-#define SETC(a) setc a
-#define SETE(a) sete a
-#define SETG(a) setg a
-#define SETGE(a) setge a
-#define SETL(a) setl a
-#define SETLE(a) setle a
-#define SETNA(a) setna a
-#define SETNAE(a) setnae a
-#define SETNB(a) setnb a
-#define SETNBE(a) setnbe a
-#define SETNC(a) setnc a
-#define SETNE(a) setne a
-#define SETNG(a) setng a
-#define SETNGE(a) setnge a
-#define SETNL(a) setnl a
-#define SETNLE(a) setnle a
-#define SETNO(a) setno a
-#define SETNP(a) setnp a
-#define SETNS(a) setns a
-#define SETNZ(a) setnz a
-#define SETO(a) seto a
-#define SETP(a) setp a
-#define SETPE(a) setpe a
-#define SETPO(a) setpo a
-#define SETS(a) sets a
-#define SETZ(a) setz a
-#define SGDT(a) sgdt a
-#define SIDT(a) sidt a
-#define SHL_L(a, b) shl L_(b), B_(a)
-#define SHL_W(a, b) shl W_(b), B_(a)
-#define SHL_B(a, b) shl B_(b), B_(a)
-#define SHLD_L(a,b,c) shld
-#define SHLD2_L(a,b) shld L_(b), L_(a)
-#define SHLD_W(a,b,c) shld
-#define SHLD2_W(a,b) shld W_(b), W_(a)
-#define SHR_L(a, b) shr L_(b), B_(a)
-#define SHR_W(a, b) shr W_(b), B_(a)
-#define SHR_B(a, b) shr B_(b), B_(a)
-#define SHRD_L(a,b,c) shrd
-#define SHRD2_L(a,b) shrd L_(b), L_(a)
-#define SHRD_W(a,b,c) shrd
-#define SHRD2_W(a,b) shrd W_(b), W_(a)
-#define SLDT(a) sldt a
-#define SMSW(a) smsw a
-#define STC stc
-#define STD std
-#define STI sti
-#define STOS_L stosd
-#define STOS_W stosw
-#define STOS_B stosb
-#define STR(a) str a
-#define SUB_L(a, b) sub L_(b), L_(a)
-#define SUB_W(a, b) sub W_(b), W_(a)
-#define SUB_B(a, b) sub B_(b), B_(a)
-#define TEST_L(a, b) test L_(b), L_(a)
-#define TEST_W(a, b) test W_(b), W_(a)
-#define TEST_B(a, b) test B_(b), B_(a)
-#define VERR(a) verr a
-#define VERW(a) verw a
-#define WAIT wait
-#define XCHG_L(a, b) xchg L_(b), L_(a)
-#define XCHG_W(a, b) xchg W_(b), W_(a)
-#define XCHG_B(a, b) xchg B_(b), B_(a)
-#define XLAT xlat
-#define XOR_L(a, b) xor L_(b), L_(a)
-#define XOR_W(a, b) xor W_(b), W_(a)
-#define XOR_B(a, b) xor B_(b), B_(a)
-
-
-/* Floating Point Instructions */
-#define F2XM1 f2xm1
-#define FABS fabs
-#define FADD_D(a) fadd D_(a)
-#define FADD_S(a) fadd S_(a)
-#define FADD2(a, b) fadd b, a
-#define FADDP(a, b) faddp b, a
-#define FIADD_L(a) fiadd L_(a)
-#define FIADD_W(a) fiadd W_(a)
-#define FBLD(a) fbld a
-#define FBSTP(a) fbstp a
-#define FCHS fchs
-#define FCLEX fclex
-#define FNCLEX fnclex
-#define FCOM(a) fcom a
-#define FCOM_D(a) fcom D_(a)
-#define FCOM_S(a) fcom S_(a)
-#define FCOMP(a) fcomp a
-#define FCOMP_D(a) fcomp D_(a)
-#define FCOMP_S(a) fcomp S_(a)
-#define FCOMPP fcompp
-#define FCOS fcos
-#define FDECSTP fdecstp
-#define FDIV_D(a) fdiv D_(a)
-#define FDIV_S(a) fdiv S_(a)
-#define FDIV2(a, b) fdiv b, a
-#define FDIVP(a, b) fdivp b, a
-#define FIDIV_L(a) fidiv L_(a)
-#define FIDIV_W(a) fidiv W_(a)
-#define FDIVR_D(a) fdivr D_(a)
-#define FDIVR_S(a) fdivr S_(a)
-#define FDIVR2(a, b) fdivr b, a
-#define FDIVRP(a, b) fdivrp b, a
-#define FIDIVR_L(a) fidivr L_(a)
-#define FIDIVR_W(a) fidivr W_(a)
-#define FFREE(a) ffree a
-#define FICOM_L(a) ficom L_(a)
-#define FICOM_W(a) ficom W_(a)
-#define FICOMP_L(a) ficomp L_(a)
-#define FICOMP_W(a) ficomp W_(a)
-#define FILD_Q(a) fild D_(a)
-#define FILD_L(a) fild L_(a)
-#define FILD_W(a) fild W_(a)
-#define FINCSTP fincstp
-#define FINIT finit
-#define FNINIT fninit
-#define FIST_L(a) fist L_(a)
-#define FIST_W(a) fist W_(a)
-#define FISTP_Q(a) fistp D_(a)
-#define FISTP_L(a) fistp L_(a)
-#define FISTP_W(a) fistp W_(a)
-#define FLD_X(a) fld X_(a)
-#define FLD_D(a) fld D_(a)
-#define FLD_S(a) fld S_(a)
-#define FLD1 fld1
-#define FLDL2T fldl2t
-#define FLDL2E fldl2e
-#define FLDPI fldpi
-#define FLDLG2 fldlg2
-#define FLDLN2 fldln2
-#define FLDZ fldz
-#define FLDCW(a) fldcw a
-#define FLDENV(a) fldenv a
-#define FMUL_S(a) fmul S_(a)
-#define FMUL_D(a) fmul D_(a)
-#define FMUL2(a, b) fmul b, a
-#define FMULP(a, b) fmulp b, a
-#define FIMUL_L(a) fimul L_(a)
-#define FIMUL_W(a) fimul W_(a)
-#define FNOP fnop
-#define FPATAN fpatan
-#define FPREM fprem
-#define FPREM1 fprem1
-#define FPTAN fptan
-#define FRNDINT frndint
-#define FRSTOR(a) frstor a
-#define FSAVE(a) fsave a
-#define FNSAVE(a) fnsave a
-#define FSCALE fscale
-#define FSIN fsin
-#define FSINCOS fsincos
-#define FSQRT fsqrt
-#define FST_D(a) fst D_(a)
-#define FST_S(a) fst S_(a)
-#define FSTP_X(a) fstp X_(a)
-#define FSTP_D(a) fstp D_(a)
-#define FSTP_S(a) fstp S_(a)
-#define FSTP(a) fstp a
-#define FSTCW(a) fstcw a
-#define FNSTCW(a) fnstcw a
-#define FSTENV(a) fstenv a
-#define FNSTENV(a) fnstenv a
-#define FSTSW(a) fstsw a
-#define FNSTSW(a) fnstsw a
-#define FSUB_S(a) fsub S_(a)
-#define FSUB_D(a) fsub D_(a)
-#define FSUB2(a, b) fsub b, a
-#define FSUBP(a, b) fsubp b, a
-#define FISUB_L(a) fisub L_(a)
-#define FISUB_W(a) fisub W_(a)
-#define FSUBR_S(a) fsubr S_(a)
-#define FSUBR_D(a) fsubr D_(a)
-#define FSUBR2(a, b) fsubr b, a
-#define FSUBRP(a, b) fsubrp b, a
-#define FISUBR_L(a) fisubr L_(a)
-#define FISUBR_W(a) fisubr W_(a)
-#define FTST ftst
-#define FUCOM(a) fucom a
-#define FUCOMP(a) fucomp a
-#define FUCOMPP fucompp
-#define FWAIT fwait
-#define FXAM fxam
-#define FXCH(a) fxch a
-#define FXTRACT fxtract
-#define FYL2X fyl2x
-#define FYL2XP1 fyl2xp1
-
-#endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */
-
- /****************************************/
- /* */
- /* Extensions to x86 insn set - */
- /* MMX, 3DNow! */
- /* */
- /****************************************/
-
-#if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER)
-#define P_ARG1(a) P_ ## a
-#define P_ARG2(a, b) P_ ## b, P_ ## a
-#define P_ARG3(a, b, c) P_ ## c, P_ ## b, P_ ## a
-#else
-#define P_ARG1(a) a
-#define P_ARG2(a, b) a, b
-#define P_ARG3(a, b, c) a, b, c
-#endif
-
-/* MMX */
-#define MOVD(a, b) movd P_ARG2(a, b)
-#define MOVQ(a, b) movq P_ARG2(a, b)
-
-#define PADDB(a, b) paddb P_ARG2(a, b)
-#define PADDW(a, b) paddw P_ARG2(a, b)
-#define PADDD(a, b) paddd P_ARG2(a, b)
-
-#define PADDSB(a, b) paddsb P_ARG2(a, b)
-#define PADDSW(a, b) paddsw P_ARG2(a, b)
-
-#define PADDUSB(a, b) paddusb P_ARG2(a, b)
-#define PADDUSW(a, b) paddusw P_ARG2(a, b)
-
-#define PSUBB(a, b) psubb P_ARG2(a, b)
-#define PSUBW(a, b) psubw P_ARG2(a, b)
-#define PSUBD(a, b) psubd P_ARG2(a, b)
-
-#define PSUBSB(a, b) psubsb P_ARG2(a, b)
-#define PSUBSW(a, b) psubsw P_ARG2(a, b)
-
-#define PSUBUSB(a, b) psubusb P_ARG2(a, b)
-#define PSUBUSW(a, b) psubusw P_ARG2(a, b)
-
-#define PCMPEQB(a, b) pcmpeqb P_ARG2(a, b)
-#define PCMPEQW(a, b) pcmpeqw P_ARG2(a, b)
-#define PCMPEQD(a, b) pcmpeqd P_ARG2(a, b)
-
-#define PCMPGTB(a, b) pcmpgtb P_ARG2(a, b)
-#define PCMPGTW(a, b) pcmpgtw P_ARG2(a, b)
-#define PCMPGTD(a, b) pcmpgtd P_ARG2(a, b)
-
-#define PMULHW(a, b) pmulhw P_ARG2(a, b)
-#define PMULLW(a, b) pmullw P_ARG2(a, b)
-
-#define PMADDWD(a, b) pmaddwd P_ARG2(a, b)
-
-#define PAND(a, b) pand P_ARG2(a, b)
-
-#define PANDN(a, b) pandn P_ARG2(a, b)
-
-#define POR(a, b) por P_ARG2(a, b)
-
-#define PXOR(a, b) pxor P_ARG2(a, b)
-
-#define PSRAW(a, b) psraw P_ARG2(a, b)
-#define PSRAD(a, b) psrad P_ARG2(a, b)
-
-#define PSRLW(a, b) psrlw P_ARG2(a, b)
-#define PSRLD(a, b) psrld P_ARG2(a, b)
-#define PSRLQ(a, b) psrlq P_ARG2(a, b)
-
-#define PSLLW(a, b) psllw P_ARG2(a, b)
-#define PSLLD(a, b) pslld P_ARG2(a, b)
-#define PSLLQ(a, b) psllq P_ARG2(a, b)
-
-#define PACKSSWB(a, b) packsswb P_ARG2(a, b)
-#define PACKSSDW(a, b) packssdw P_ARG2(a, b)
-#define PACKUSWB(a, b) packuswb P_ARG2(a, b)
-
-#define PUNPCKHBW(a, b) punpckhbw P_ARG2(a, b)
-#define PUNPCKHWD(a, b) punpckhwd P_ARG2(a, b)
-#define PUNPCKHDQ(a, b) punpckhdq P_ARG2(a, b)
-#define PUNPCKLBW(a, b) punpcklbw P_ARG2(a, b)
-#define PUNPCKLWD(a, b) punpcklwd P_ARG2(a, b)
-#define PUNPCKLDQ(a, b) punpckldq P_ARG2(a, b)
-
-#define EMMS emms
-
-/* AMD 3DNow! */
-#define PAVGUSB(a, b) pavgusb P_ARG2(a, b)
-#define PFADD(a, b) pfadd P_ARG2(a, b)
-#define PFSUB(a, b) pfsub P_ARG2(a, b)
-#define PFSUBR(a, b) pfsubr P_ARG2(a, b)
-#define PFACC(a, b) pfacc P_ARG2(a, b)
-#define PFCMPGE(a, b) pfcmpge P_ARG2(a, b)
-#define PFCMPGT(a, b) pfcmpgt P_ARG2(a, b)
-#define PFCMPEQ(a, b) pfcmpeq P_ARG2(a, b)
-#define PFMIN(a, b) pfmin P_ARG2(a, b)
-#define PFMAX(a, b) pfmax P_ARG2(a, b)
-#define PI2FD(a, b) pi2fd P_ARG2(a, b)
-#define PF2ID(a, b) pf2id P_ARG2(a, b)
-#define PFRCP(a, b) pfrcp P_ARG2(a, b)
-#define PFRSQRT(a, b) pfrsqrt P_ARG2(a, b)
-#define PFMUL(a, b) pfmul P_ARG2(a, b)
-#define PFRCPIT1(a, b) pfrcpit1 P_ARG2(a, b)
-#define PFRSQIT1(a, b) pfrsqit1 P_ARG2(a, b)
-#define PFRCPIT2(a, b) pfrcpit2 P_ARG2(a, b)
-#define PMULHRW(a, b) pmulhrw P_ARG2(a, b)
-
-#define FEMMS femms
-#define PREFETCH(a) prefetch P_ARG1(a)
-#define PREFETCHW(a) prefetchw P_ARG1(a)
-
-/* Intel SSE */
-#define ADDPS(a, b) addps P_ARG2(a, b)
-#define ADDSS(a, b) addss P_ARG2(a, b)
-#define ANDNPS(a, b) andnps P_ARG2(a, b)
-#define ANDPS(a, b) andps P_ARG2(a, b)
-/* NASM only knows the pseudo ops for these.
-#define CMPPS(a, b, c) cmpps P_ARG3(a, b, c)
-#define CMPSS(a, b, c) cmpss P_ARG3(a, b, c)
-*/
-#define CMPEQPS(a, b) cmpeqps P_ARG2(a, b)
-#define CMPLTPS(a, b) cmpltps P_ARG2(a, b)
-#define CMPLEPS(a, b) cmpleps P_ARG2(a, b)
-#define CMPUNORDPS(a, b) cmpunordps P_ARG2(a, b)
-#define CMPNEQPS(a, b) cmpneqps P_ARG2(a, b)
-#define CMPNLTPS(a, b) cmpnltps P_ARG2(a, b)
-#define CMPNLEPS(a, b) cmpnleps P_ARG2(a, b)
-#define CMPORDPS(a, b) cmpordps P_ARG2(a, b)
-#define CMPEQSS(a, b) cmpeqss P_ARG2(a, b)
-#define CMPLTSS(a, b) cmpltss P_ARG2(a, b)
-#define CMPLESS(a, b) cmpless P_ARG2(a, b)
-#define CMPUNORDSS(a, b) cmpunordss P_ARG2(a, b)
-#define CMPNEQSS(a, b) cmpneqss P_ARG2(a, b)
-#define CMPNLTSS(a, b) cmpnltss P_ARG2(a, b)
-#define CMPNLESS(a, b) cmpnless P_ARG2(a, b)
-#define CMPORDSS(a, b) cmpordss P_ARG2(a, b)
-#define COMISS(a, b) comiss P_ARG2(a, b)
-#define CVTPI2PS(a, b) cvtpi2ps P_ARG2(a, b)
-#define CVTPS2PI(a, b) cvtps2pi P_ARG2(a, b)
-#define CVTSI2SS(a, b) cvtsi2ss P_ARG2(a, b)
-#define CVTSS2SI(a, b) cvtss2si P_ARG2(a, b)
-#define CVTTPS2PI(a, b) cvttps2pi P_ARG2(a, b)
-#define CVTTSS2SI(a, b) cvttss2si P_ARG2(a, b)
-#define DIVPS(a, b) divps P_ARG2(a, b)
-#define DIVSS(a, b) divss P_ARG2(a, b)
-#define FXRSTOR(a) fxrstor P_ARG1(a)
-#define FXSAVE(a) fxsave P_ARG1(a)
-#define LDMXCSR(a) ldmxcsr P_ARG1(a)
-#define MAXPS(a, b) maxps P_ARG2(a, b)
-#define MAXSS(a, b) maxss P_ARG2(a, b)
-#define MINPS(a, b) minps P_ARG2(a, b)
-#define MINSS(a, b) minss P_ARG2(a, b)
-#define MOVAPS(a, b) movaps P_ARG2(a, b)
-#define MOVHLPS(a, b) movhlps P_ARG2(a, b)
-#define MOVHPS(a, b) movhps P_ARG2(a, b)
-#define MOVLHPS(a, b) movlhps P_ARG2(a, b)
-#define MOVLPS(a, b) movlps P_ARG2(a, b)
-#define MOVMSKPS(a, b) movmskps P_ARG2(a, b)
-#define MOVNTPS(a, b) movntps P_ARG2(a, b)
-#define MOVNTQ(a, b) movntq P_ARG2(a, b)
-#define MOVSS(a, b) movss P_ARG2(a, b)
-#define MOVUPS(a, b) movups P_ARG2(a, b)
-#define MULPS(a, b) mulps P_ARG2(a, b)
-#define MULSS(a, b) mulss P_ARG2(a, b)
-#define ORPS(a, b) orps P_ARG2(a, b)
-#define RCPPS(a, b) rcpps P_ARG2(a, b)
-#define RCPSS(a, b) rcpss P_ARG2(a, b)
-#define RSQRTPS(a, b) rsqrtps P_ARG2(a, b)
-#define RSQRTSS(a, b) rsqrtss P_ARG2(a, b)
-#define SHUFPS(a, b, c) shufps P_ARG3(a, b, c)
-#define SQRTPS(a, b) sqrtps P_ARG2(a, b)
-#define SQRTSS(a, b) sqrtss P_ARG2(a, b)
-#define STMXCSR(a) stmxcsr P_ARG1(a)
-#define SUBPS(a, b) subps P_ARG2(a, b)
-#define UCOMISS(a, b) ucomiss P_ARG2(a, b)
-#define UNPCKHPS(a, b) unpckhps P_ARG2(a, b)
-#define UNPCKLPS(a, b) unpcklps P_ARG2(a, b)
-#define XORPS(a, b) xorps P_ARG2(a, b)
-
-#define PREFETCHNTA(a) prefetchnta P_ARG1(a)
-#define PREFETCHT0(a) prefetcht0 P_ARG1(a)
-#define PREFETCHT1(a) prefetcht1 P_ARG1(a)
-#define PREFETCHT2(a) prefetcht2 P_ARG1(a)
-#define SFENCE sfence
-
-/* Added by BrianP for FreeBSD (per David Dawes) */
-#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__)
-#define LLBL(a) CONCAT(.L,a)
-#define LLBL2(a,b) CONCAT3(.L,a,b)
-#else
-#define LLBL(a) a
-#define LLBL2(a,b) CONCAT(a,b)
-#endif
-
-/* Segment overrides */
-#define SEGCS D_BYTE 46
-#define SEGDS D_BYTE 62
-#define SEGES D_BYTE 38
-#define SEGFS D_BYTE 100
-#define SEGGS D_BYTE 101
-
-/* Temporary labels: valid until next non-local label */
-#ifdef NASM_ASSEMBLER
-#define TLBL(a) CONCAT(.,a)
-#else
-#define TLBL(a) CONCAT(a,$)
-#endif
-
-/* Hidden symbol visibility support.
- * If we build with gcc's -fvisibility=hidden flag, we'll need to change
- * the symbol visibility mode to 'default'.
- */
-#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)
-# define HIDDEN(x) .hidden x
-#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__MINGW32__)
-# pragma GCC visibility push(default)
-# define HIDDEN(x) .hidden x
-#else
-# define HIDDEN(x)
-#endif
-
-#endif /* __ASSYNTAX_H__ */
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/clip_args.h b/nx-X11/extras/Mesa/src/mesa/x86/clip_args.h
deleted file mode 100644
index ff9aa377f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/clip_args.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $Id: clip_args.h,v 1.1.1.1 2004/06/16 09:19:35 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Clip test function interface for assembly code. Simply define
- * FRAME_OFFSET to the number of bytes pushed onto the stack before
- * using the ARG_* argument macros.
- *
- * Gareth Hughes
- */
-
-#ifndef __CLIP_ARGS_H__
-#define __CLIP_ARGS_H__
-
-/*
- * Offsets for clip_func arguments
- *
- * typedef GLvector4f *(*clip_func)( GLvector4f *clip_vec,
- * GLvector4f *proj_vec,
- * GLubyte clipMask[],
- * GLubyte *orMask,
- * GLubyte *andMask );
- */
-
-#define OFFSET_SOURCE 4
-#define OFFSET_DEST 8
-#define OFFSET_CLIP 12
-#define OFFSET_OR 16
-#define OFFSET_AND 20
-
-#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
-#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
-#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
-#define ARG_OR REGOFF(FRAME_OFFSET+OFFSET_OR, ESP)
-#define ARG_AND REGOFF(FRAME_OFFSET+OFFSET_AND, ESP)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/common_x86.c b/nx-X11/extras/Mesa/src/mesa/x86/common_x86.c
deleted file mode 100644
index 0ff7fd51a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/common_x86.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.0.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file common_x86.c
- *
- * Check CPU capabilities & initialize optimized funtions for this particular
- * processor.
- *
- * Changed by Andre Werthmann for using the new SSE functions.
- *
- * \author Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
- * \author Andre Werthmann <wertmann@cs.uni-potsdam.de>
- */
-
-/* XXX these includes should probably go into imports.h or glheader.h */
-#if defined(USE_SSE_ASM) && defined(__linux__)
-#include <signal.h>
-#endif
-#if defined(USE_SSE_ASM) && defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
-
-#include "common_x86_asm.h"
-#include "imports.h"
-
-
-int _mesa_x86_cpu_features = 0;
-
-/* No reason for this to be public.
- */
-extern GLuint _ASMAPI _mesa_x86_has_cpuid(void);
-extern void _ASMAPI _mesa_x86_cpuid(GLuint op, GLuint *reg_eax, GLuint *reg_ebx, GLuint *reg_ecx, GLuint *reg_edx);
-extern GLuint _ASMAPI _mesa_x86_cpuid_eax(GLuint op);
-extern GLuint _ASMAPI _mesa_x86_cpuid_ebx(GLuint op);
-extern GLuint _ASMAPI _mesa_x86_cpuid_ecx(GLuint op);
-extern GLuint _ASMAPI _mesa_x86_cpuid_edx(GLuint op);
-
-static void message( const char *msg )
-{
- GLboolean debug;
-#ifdef DEBUG
- debug = GL_TRUE;
-#else
- if ( _mesa_getenv( "MESA_DEBUG" ) ) {
- debug = GL_TRUE;
- } else {
- debug = GL_FALSE;
- }
-#endif
- if ( debug ) {
- fprintf( stderr, "%s", msg );
- }
-}
-
-#if defined(USE_SSE_ASM)
-/*
- * We must verify that the Streaming SIMD Extensions are truly supported
- * on this processor before we go ahead and hook out the optimized code.
- * Unfortunately, the CPUID bit isn't enough, as the OS must set the
- * OSFXSR bit in CR4 if it supports the extended FPU save and restore
- * required to use SSE. Unfortunately, we can't just go ahead and read
- * this register, as only the kernel can do that. Similarly, we must
- * verify that the OSXMMEXCPT bit in CR4 has been set by the OS,
- * signifying that it supports unmasked SIMD FPU exceptions. If we take
- * an unmasked exception and the OS doesn't correctly support them, the
- * best we'll get is a SIGILL and the worst we'll get is an infinite
- * loop in the signal delivery from the kernel as we can't interact with
- * the SIMD FPU state to clear the exception bits. Either way, this is
- * not good.
- *
- * However, I have been told by Alan Cox that all 2.4 (and later) Linux
- * kernels provide full SSE support on all processors that expose SSE via
- * the CPUID mechanism. It just so happens that this is the exact set of
- * kernels supported DRI. Therefore, when building for DRI the funky SSE
- * exception test is omitted.
- */
-
-extern void _mesa_test_os_sse_support( void );
-extern void _mesa_test_os_sse_exception_support( void );
-
-#if defined(__linux__) && defined(_POSIX_SOURCE) && defined(X86_FXSR_MAGIC) \
- && !defined(IN_DRI_DRIVER)
-static void sigill_handler( int signal, struct sigcontext sc )
-{
- message( "SIGILL, " );
-
- /* Both the "xorps %%xmm0,%%xmm0" and "divps %xmm0,%%xmm1"
- * instructions are 3 bytes long. We must increment the instruction
- * pointer manually to avoid repeated execution of the offending
- * instruction.
- *
- * If the SIGILL is caused by a divide-by-zero when unmasked
- * exceptions aren't supported, the SIMD FPU status and control
- * word will be restored at the end of the test, so we don't need
- * to worry about doing it here. Besides, we may not be able to...
- */
- sc.eip += 3;
-
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
-}
-
-static void sigfpe_handler( int signal, struct sigcontext sc )
-{
- message( "SIGFPE, " );
-
- if ( sc.fpstate->magic != 0xffff ) {
- /* Our signal context has the extended FPU state, so reset the
- * divide-by-zero exception mask and clear the divide-by-zero
- * exception bit.
- */
- sc.fpstate->mxcsr |= 0x00000200;
- sc.fpstate->mxcsr &= 0xfffffffb;
- } else {
- /* If we ever get here, we're completely hosed.
- */
- message( "\n\n" );
- _mesa_problem( NULL, "SSE enabling test failed badly!" );
- }
-}
-#endif /* __linux__ && _POSIX_SOURCE && X86_FXSR_MAGIC */
-
-#if defined(WIN32)
-#ifndef STATUS_FLOAT_MULTIPLE_TRAPS
-# define STATUS_FLOAT_MULTIPLE_TRAPS (0xC00002B5L)
-#endif
-static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp)
-{
- PEXCEPTION_RECORD rec = exp->ExceptionRecord;
- PCONTEXT ctx = exp->ContextRecord;
-
- if ( rec->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION ) {
- message( "EXCEPTION_ILLEGAL_INSTRUCTION, " );
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
- } else if ( rec->ExceptionCode == STATUS_FLOAT_MULTIPLE_TRAPS ) {
- message( "STATUS_FLOAT_MULTIPLE_TRAPS, " );
- /* Windows seems to clear the exception flag itself, we just have to increment Eip */
- } else {
- message( "UNEXPECTED EXCEPTION (0x%08x), terminating!" );
- return EXCEPTION_EXECUTE_HANDLER;
- }
-
- if ( (ctx->ContextFlags & CONTEXT_CONTROL) != CONTEXT_CONTROL ) {
- message( "Context does not contain control registers, terminating!" );
- return EXCEPTION_EXECUTE_HANDLER;
- }
- ctx->Eip += 3;
-
- return EXCEPTION_CONTINUE_EXECUTION;
-}
-#endif /* WIN32 */
-
-
-/* If we're running on a processor that can do SSE, let's see if we
- * are allowed to or not. This will catch 2.4.0 or later kernels that
- * haven't been configured for a Pentium III but are running on one,
- * and RedHat patched 2.2 kernels that have broken exception handling
- * support for user space apps that do SSE.
- *
- * GH: Isn't this just awful?
- */
-static void check_os_sse_support( void )
-{
-#if defined(__linux__) && !defined(IN_DRI_DRIVER)
-#if defined(_POSIX_SOURCE) && defined(X86_FXSR_MAGIC)
- struct sigaction saved_sigill;
- struct sigaction saved_sigfpe;
-
- /* Save the original signal handlers.
- */
- sigaction( SIGILL, NULL, &saved_sigill );
- sigaction( SIGFPE, NULL, &saved_sigfpe );
-
- signal( SIGILL, (void (*)(int))sigill_handler );
- signal( SIGFPE, (void (*)(int))sigfpe_handler );
-
- /* Emulate test for OSFXSR in CR4. The OS will set this bit if it
- * supports the extended FPU save and restore required for SSE. If
- * we execute an SSE instruction on a PIII and get a SIGILL, the OS
- * doesn't support Streaming SIMD Exceptions, even if the processor
- * does.
- */
- if ( cpu_has_xmm ) {
- message( "Testing OS support for SSE... " );
-
- _mesa_test_os_sse_support();
-
- if ( cpu_has_xmm ) {
- message( "yes.\n" );
- } else {
- message( "no!\n" );
- }
- }
-
- /* Emulate test for OSXMMEXCPT in CR4. The OS will set this bit if
- * it supports unmasked SIMD FPU exceptions. If we unmask the
- * exceptions, do a SIMD divide-by-zero and get a SIGILL, the OS
- * doesn't support unmasked SIMD FPU exceptions. If we get a SIGFPE
- * as expected, we're okay but we need to clean up after it.
- *
- * Are we being too stringent in our requirement that the OS support
- * unmasked exceptions? Certain RedHat 2.2 kernels enable SSE by
- * setting CR4.OSFXSR but don't support unmasked exceptions. Win98
- * doesn't even support them. We at least know the user-space SSE
- * support is good in kernels that do support unmasked exceptions,
- * and therefore to be safe I'm going to leave this test in here.
- */
- if ( cpu_has_xmm ) {
- message( "Testing OS support for SSE unmasked exceptions... " );
-
- _mesa_test_os_sse_exception_support();
-
- if ( cpu_has_xmm ) {
- message( "yes.\n" );
- } else {
- message( "no!\n" );
- }
- }
-
- /* Restore the original signal handlers.
- */
- sigaction( SIGILL, &saved_sigill, NULL );
- sigaction( SIGFPE, &saved_sigfpe, NULL );
-
- /* If we've gotten to here and the XMM CPUID bit is still set, we're
- * safe to go ahead and hook out the SSE code throughout Mesa.
- */
- if ( cpu_has_xmm ) {
- message( "Tests of OS support for SSE passed.\n" );
- } else {
- message( "Tests of OS support for SSE failed!\n" );
- }
-#else
- /* We can't use POSIX signal handling to test the availability of
- * SSE, so we disable it by default.
- */
- message( "Cannot test OS support for SSE, disabling to be safe.\n" );
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
-#endif /* _POSIX_SOURCE && X86_FXSR_MAGIC */
-#elif defined(__FreeBSD__)
- {
- int ret, enabled;
- unsigned int len;
- len = sizeof(enabled);
- ret = sysctlbyname("hw.instruction_sse", &enabled, &len, NULL, 0);
- if (ret || !enabled)
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
- }
-#elif defined(WIN32)
- LPTOP_LEVEL_EXCEPTION_FILTER oldFilter;
-
- /* Install our ExceptionFilter */
- oldFilter = SetUnhandledExceptionFilter( ExceptionFilter );
-
- if ( cpu_has_xmm ) {
- message( "Testing OS support for SSE... " );
-
- _mesa_test_os_sse_support();
-
- if ( cpu_has_xmm ) {
- message( "yes.\n" );
- } else {
- message( "no!\n" );
- }
- }
-
- if ( cpu_has_xmm ) {
- message( "Testing OS support for SSE unmasked exceptions... " );
-
- _mesa_test_os_sse_exception_support();
-
- if ( cpu_has_xmm ) {
- message( "yes.\n" );
- } else {
- message( "no!\n" );
- }
- }
-
- /* Restore previous exception filter */
- SetUnhandledExceptionFilter( oldFilter );
-
- if ( cpu_has_xmm ) {
- message( "Tests of OS support for SSE passed.\n" );
- } else {
- message( "Tests of OS support for SSE failed!\n" );
- }
-#else
- /* Do nothing on other platforms for now.
- */
- message( "Not testing OS support for SSE, leaving enabled.\n" );
-#endif /* __linux__ */
-}
-
-#endif /* USE_SSE_ASM */
-
-
-void _mesa_init_all_x86_transform_asm( void )
-{
- (void) message; /* silence warning */
-#ifdef USE_X86_ASM
- _mesa_x86_cpu_features = 0;
-
- if (!_mesa_x86_has_cpuid()) {
- message("CPUID not detected");
- }
- else {
- GLuint cpu_features;
- GLuint cpu_ext_features;
- GLuint cpu_ext_info;
- char cpu_vendor[13];
- GLuint result;
-
- /* get vendor name */
- _mesa_x86_cpuid(0, &result, (GLuint *)(cpu_vendor + 0), (GLuint *)(cpu_vendor + 8), (GLuint *)(cpu_vendor + 4));
- cpu_vendor[12] = '\0';
-
- message("cpu vendor: ");
- message(cpu_vendor);
- message("\n");
-
- /* get cpu features */
- cpu_features = _mesa_x86_cpuid_edx(1);
-
- if (cpu_features & X86_CPU_FPU)
- _mesa_x86_cpu_features |= X86_FEATURE_FPU;
- if (cpu_features & X86_CPU_CMOV)
- _mesa_x86_cpu_features |= X86_FEATURE_CMOV;
-
-#ifdef USE_MMX_ASM
- if (cpu_features & X86_CPU_MMX)
- _mesa_x86_cpu_features |= X86_FEATURE_MMX;
-#endif
-
-#ifdef USE_SSE_ASM
- if (cpu_features & X86_CPU_XMM)
- _mesa_x86_cpu_features |= X86_FEATURE_XMM;
- if (cpu_features & X86_CPU_XMM2)
- _mesa_x86_cpu_features |= X86_FEATURE_XMM2;
-#endif
-
- /* query extended cpu features */
- if ((cpu_ext_info = _mesa_x86_cpuid_eax(0x80000000)) > 0x80000000) {
- if (cpu_ext_info >= 0x80000001) {
-
- cpu_ext_features = _mesa_x86_cpuid_edx(0x80000001);
-
- if (cpu_features & X86_CPU_MMX) {
-
-#ifdef USE_3DNOW_ASM
- if (cpu_ext_features & X86_CPUEXT_3DNOW)
- _mesa_x86_cpu_features |= X86_FEATURE_3DNOW;
- if (cpu_ext_features & X86_CPUEXT_3DNOW_EXT)
- _mesa_x86_cpu_features |= X86_FEATURE_3DNOWEXT;
-#endif
-
-#ifdef USE_MMX_ASM
- if (cpu_ext_features & X86_CPUEXT_MMX_EXT)
- _mesa_x86_cpu_features |= X86_FEATURE_MMXEXT;
-#endif
- }
- }
-
- /* query cpu name */
- if (cpu_ext_info >= 0x80000002) {
- GLuint ofs;
- char cpu_name[49];
- for (ofs = 0; ofs < 3; ofs++)
- _mesa_x86_cpuid(0x80000002+ofs, (GLuint *)(cpu_name + (16*ofs)+0), (GLuint *)(cpu_name + (16*ofs)+4), (GLuint *)(cpu_name + (16*ofs)+8), (GLuint *)(cpu_name + (16*ofs)+12));
- cpu_name[48] = '\0'; /* the name should be NULL terminated, but just to be sure */
-
- message("cpu name: ");
- message(cpu_name);
- message("\n");
- }
- }
-
- }
-
- if ( _mesa_getenv( "MESA_NO_ASM" ) ) {
- _mesa_x86_cpu_features = 0;
- }
-
- if ( _mesa_x86_cpu_features ) {
- _mesa_init_x86_transform_asm();
- }
-
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- if ( _mesa_getenv( "MESA_NO_MMX" ) == 0 ) {
- message( "MMX cpu detected.\n" );
- } else {
- _mesa_x86_cpu_features &= ~(X86_FEATURE_MMX);
- }
- }
-#endif
-
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- if ( _mesa_getenv( "MESA_NO_3DNOW" ) == 0 ) {
- message( "3DNow! cpu detected.\n" );
- _mesa_init_3dnow_transform_asm();
- } else {
- _mesa_x86_cpu_features &= ~(X86_FEATURE_3DNOW);
- }
- }
-#endif
-
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- if ( _mesa_getenv( "MESA_NO_SSE" ) == 0 ) {
- message( "SSE cpu detected.\n" );
- if ( _mesa_getenv( "MESA_FORCE_SSE" ) == 0 ) {
- check_os_sse_support();
- }
- if ( cpu_has_xmm ) {
- _mesa_init_sse_transform_asm();
- }
- } else {
- message( "SSE cpu detected, but switched off by user.\n" );
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
- }
- }
-#endif
-#endif
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.S b/nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.S
deleted file mode 100644
index 654b3469d..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.S
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Check extended CPU capabilities. Now justs returns the raw CPUID
- * feature information, allowing the higher level code to interpret the
- * results.
- *
- * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
- *
- * Cleaned up and simplified by Gareth Hughes <gareth@valinux.com>
- *
- */
-
-/*
- * NOTE: Avoid using spaces in between '(' ')' and arguments, especially
- * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces
- * in there will break the build on some platforms.
- */
-
-#include "matypes.h"
-#include "common_x86_features.h"
-
- SEG_TEXT
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_x86_has_cpuid)
-HIDDEN(_mesa_x86_has_cpuid)
-GLNAME(_mesa_x86_has_cpuid):
-
- /* Test for the CPUID command. If the ID Flag bit in EFLAGS
- * (bit 21) is writable, the CPUID command is present */
- PUSHF_L
- POP_L (EAX)
- MOV_L (EAX, ECX)
- XOR_L (CONST(0x00200000), EAX)
- PUSH_L (EAX)
- POPF_L
- PUSHF_L
- POP_L (EAX)
-
- /* Verify the ID Flag bit has been written. */
- CMP_L (ECX, EAX)
- SETNE (AL)
- XOR_L (CONST(0xff), EAX)
-
- RET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_x86_cpuid)
-HIDDEN(_mesa_x86_cpuid)
-GLNAME(_mesa_x86_cpuid):
-
- MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
- PUSH_L (EDI)
- PUSH_L (EBX)
-
- CPUID
-
- MOV_L (REGOFF(16, ESP), EDI) /* *eax */
- MOV_L (EAX, REGIND(EDI))
- MOV_L (REGOFF(20, ESP), EDI) /* *ebx */
- MOV_L (EBX, REGIND(EDI))
- MOV_L (REGOFF(24, ESP), EDI) /* *ecx */
- MOV_L (ECX, REGIND(EDI))
- MOV_L (REGOFF(28, ESP), EDI) /* *edx */
- MOV_L (EDX, REGIND(EDI))
-
- POP_L (EBX)
- POP_L (EDI)
- RET
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_x86_cpuid_eax)
-HIDDEN(_mesa_x86_cpuid_eax)
-GLNAME(_mesa_x86_cpuid_eax):
-
- MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
- PUSH_L (EBX)
-
- CPUID
-
- POP_L (EBX)
- RET
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_x86_cpuid_ebx)
-HIDDEN(_mesa_x86_cpuid_ebx)
-GLNAME(_mesa_x86_cpuid_ebx):
-
- MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
- PUSH_L (EBX)
-
- CPUID
- MOV_L (EBX, EAX) /* return EBX */
-
- POP_L (EBX)
- RET
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_x86_cpuid_ecx)
-HIDDEN(_mesa_x86_cpuid_ecx)
-GLNAME(_mesa_x86_cpuid_ecx):
-
- MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
- PUSH_L (EBX)
-
- CPUID
- MOV_L (ECX, EAX) /* return ECX */
-
- POP_L (EBX)
- RET
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_x86_cpuid_edx)
-HIDDEN(_mesa_x86_cpuid_edx)
-GLNAME(_mesa_x86_cpuid_edx):
-
- MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
- PUSH_L (EBX)
-
- CPUID
- MOV_L (EDX, EAX) /* return EDX */
-
- POP_L (EBX)
- RET
-
-#ifdef USE_SSE_ASM
-/* Execute an SSE instruction to see if the operating system correctly
- * supports SSE. A signal handler for SIGILL should have been set
- * before calling this function, otherwise this could kill the client
- * application.
- *
- * -----> !!!! ATTENTION DEVELOPERS !!!! <-----
- *
- * If you're debugging with gdb and you get stopped in this function,
- * just type 'continue'! Execution will proceed normally.
- * See freedesktop.org bug #1709 for more info.
- */
-ALIGNTEXT4
-GLOBL GLNAME( _mesa_test_os_sse_support )
-HIDDEN(_mesa_test_os_sse_support)
-GLNAME( _mesa_test_os_sse_support ):
-
- XORPS ( XMM0, XMM0 )
-
- RET
-
-
-/* Perform an SSE divide-by-zero to see if the operating system
- * correctly supports unmasked SIMD FPU exceptions. Signal handlers for
- * SIGILL and SIGFPE should have been set before calling this function,
- * otherwise this could kill the client application.
- */
-ALIGNTEXT4
-GLOBL GLNAME( _mesa_test_os_sse_exception_support )
-HIDDEN(_mesa_test_os_sse_exception_support)
-GLNAME( _mesa_test_os_sse_exception_support ):
-
- PUSH_L ( EBP )
- MOV_L ( ESP, EBP )
- SUB_L ( CONST( 8 ), ESP )
-
- /* Save the original MXCSR register value.
- */
- STMXCSR ( REGOFF( -4, EBP ) )
-
- /* Unmask the divide-by-zero exception and perform one.
- */
- STMXCSR ( REGOFF( -8, EBP ) )
- AND_L ( CONST( 0xfffffdff ), REGOFF( -8, EBP ) )
- LDMXCSR ( REGOFF( -8, EBP ) )
-
- XORPS ( XMM0, XMM0 )
-
- PUSH_L ( CONST( 0x3f800000 ) )
- PUSH_L ( CONST( 0x3f800000 ) )
- PUSH_L ( CONST( 0x3f800000 ) )
- PUSH_L ( CONST( 0x3f800000 ) )
-
- MOVUPS ( REGIND( ESP ), XMM1 )
-
- DIVPS ( XMM0, XMM1 )
-
- /* Restore the original MXCSR register value.
- */
- LDMXCSR ( REGOFF( -4, EBP ) )
-
- LEAVE
- RET
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.h b/nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.h
deleted file mode 100644
index a59585abe..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_asm.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $Id: common_x86_asm.h,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Check CPU capabilities & initialize optimized funtions for this particular
- * processor.
- *
- * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
- * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the
- * new SSE functions
- *
- * Reimplemented by Gareth Hughes in a more
- * future-proof manner, based on code in the Linux kernel.
- */
-
-#ifndef __COMMON_X86_ASM_H__
-#define __COMMON_X86_ASM_H__
-
-/* Do not reference mtypes.h from this file.
- */
-#include "common_x86_features.h"
-
-#ifdef USE_X86_ASM
-#include "x86.h"
-#ifdef USE_3DNOW_ASM
-#include "3dnow.h"
-#endif
-#ifdef USE_SSE_ASM
-#include "sse.h"
-#endif
-#endif
-
-extern int _mesa_x86_cpu_features;
-
-extern void _mesa_init_all_x86_transform_asm( void );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_features.h b/nx-X11/extras/Mesa/src/mesa/x86/common_x86_features.h
deleted file mode 100644
index d6f488fc7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_features.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $Id: common_x86_features.h,v 1.1.1.1 2004/06/16 09:19:36 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * x86 CPUID feature information. The raw data is returned by
- * _mesa_identify_x86_cpu_features() and interpreted with the cpu_has_*
- * helper macros.
- *
- * Gareth Hughes
- */
-
-#ifndef __COMMON_X86_FEATURES_H__
-#define __COMMON_X86_FEATURES_H__
-
-#define X86_FEATURE_FPU (1<<0)
-#define X86_FEATURE_CMOV (1<<1)
-#define X86_FEATURE_MMXEXT (1<<2)
-#define X86_FEATURE_MMX (1<<3)
-#define X86_FEATURE_FXSR (1<<4)
-#define X86_FEATURE_XMM (1<<5)
-#define X86_FEATURE_XMM2 (1<<6)
-#define X86_FEATURE_3DNOWEXT (1<<7)
-#define X86_FEATURE_3DNOW (1<<8)
-
-/* standard X86 CPU features */
-#define X86_CPU_FPU (1<<0)
-#define X86_CPU_CMOV (1<<15)
-#define X86_CPU_MMX (1<<23)
-#define X86_CPU_XMM (1<<25)
-#define X86_CPU_XMM2 (1<<26)
-
-/* extended X86 CPU features */
-#define X86_CPUEXT_MMX_EXT (1<<22)
-#define X86_CPUEXT_3DNOW_EXT (1<<30)
-#define X86_CPUEXT_3DNOW (1<<31)
-
-#define cpu_has_mmx (_mesa_x86_cpu_features & X86_FEATURE_MMX)
-#define cpu_has_mmxext (_mesa_x86_cpu_features & X86_FEATURE_MMXEXT)
-#define cpu_has_xmm (_mesa_x86_cpu_features & X86_FEATURE_XMM)
-#define cpu_has_xmm2 (_mesa_x86_cpu_features & X86_FEATURE_XMM2)
-#define cpu_has_3dnow (_mesa_x86_cpu_features & X86_FEATURE_3DNOW)
-#define cpu_has_3dnowext (_mesa_x86_cpu_features & X86_FEATURE_3DNOWEXT)
-
-#endif
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_macros.h b/nx-X11/extras/Mesa/src/mesa/x86/common_x86_macros.h
deleted file mode 100644
index 8741ff11b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/common_x86_macros.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* $Id: common_x86_macros.h,v 1.1.1.1 2004/06/16 09:19:36 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes
- */
-
-#ifndef __COMMON_X86_MACROS_H__
-#define __COMMON_X86_MACROS_H__
-
-
-/* =============================================================
- * Transformation function declarations:
- */
-
-#define XFORM_ARGS GLvector4f *to_vec, \
- const GLfloat m[16], \
- const GLvector4f *from_vec
-
-#define DECLARE_XFORM_GROUP( pfx, sz ) \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
-
-#define ASSIGN_XFORM_GROUP( pfx, sz ) \
- _mesa_transform_tab[sz][MATRIX_GENERAL] = \
- _mesa_##pfx##_transform_points##sz##_general; \
- _mesa_transform_tab[sz][MATRIX_IDENTITY] = \
- _mesa_##pfx##_transform_points##sz##_identity; \
- _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
- _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] = \
- _mesa_##pfx##_transform_points##sz##_perspective; \
- _mesa_transform_tab[sz][MATRIX_2D] = \
- _mesa_##pfx##_transform_points##sz##_2d; \
- _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
- _mesa_transform_tab[sz][MATRIX_3D] = \
- _mesa_##pfx##_transform_points##sz##_3d;
-
-
-/* =============================================================
- * Normal transformation function declarations:
- */
-
-#define NORM_ARGS const GLmatrix *mat, \
- GLfloat scale, \
- const GLvector4f *in, \
- const GLfloat *lengths, \
- GLvector4f *dest
-
-#define DECLARE_NORM_GROUP( pfx ) \
-extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
-
-#define ASSIGN_NORM_GROUP( pfx ) \
- _mesa_normal_tab[NORM_RESCALE] = \
- _mesa_##pfx##_rescale_normals; \
- _mesa_normal_tab[NORM_NORMALIZE] = \
- _mesa_##pfx##_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM] = \
- _mesa_##pfx##_transform_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = \
- _mesa_##pfx##_transform_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = \
- _mesa_##pfx##_transform_rescale_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = \
- _mesa_##pfx##_transform_rescale_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = \
- _mesa_##pfx##_transform_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = \
- _mesa_##pfx##_transform_normalize_normals_no_rot;
-
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/gen_matypes.c b/nx-X11/extras/Mesa/src/mesa/x86/gen_matypes.c
deleted file mode 100644
index d5cee5347..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/gen_matypes.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes
- */
-
-/*
- * This generates an asm version of mtypes.h (called matypes.h), so that
- * Mesa's x86 assembly code can access the internal structures easily.
- * This will be particularly useful when developing new x86 asm code for
- * Mesa, including lighting, clipping, texture image conversion etc.
- */
-
-#include "main/glheader.h"
-#include "main/mtypes.h"
-#include "tnl/t_context.h"
-
-
-#undef offsetof
-#define offsetof( type, member ) ((size_t) &((type *)0)->member)
-
-
-#define OFFSET_HEADER( x ) \
-do { \
- printf( "\n" ); \
- printf( "\n" ); \
- printf( "/* =====================================================" \
- "========\n" ); \
- printf( " * Offsets for %s\n", x ); \
- printf( " */\n" ); \
- printf( "\n" ); \
-} while (0)
-
-#define DEFINE_HEADER( x ) \
-do { \
- printf( "\n" ); \
- printf( "/*\n" ); \
- printf( " * Flags for %s\n", x ); \
- printf( " */\n" ); \
- printf( "\n" ); \
-} while (0)
-
-#if defined(__BEOS__) || defined(_LP64)
-#define OFFSET( s, t, m ) \
- printf( "#define %s\t%ld\n", s, offsetof( t, m ) );
-#else
-#define OFFSET( s, t, m ) \
- printf( "#define %s\t%d\n", s, offsetof( t, m ) );
-#endif
-
-#if defined(__BEOS__) || defined(_LP64)
-#define SIZEOF( s, t ) \
- printf( "#define %s\t%ld\n", s, sizeof(t) );
-#else
-#define SIZEOF( s, t ) \
- printf( "#define %s\t%d\n", s, sizeof(t) );
-#endif
-
-#define DEFINE( s, d ) \
- printf( "#define %s\t0x%x\n", s, d );
-
-
-
-int main( int argc, char **argv )
-{
- printf( "/*\n" );
- printf( " * This file is automatically generated from the Mesa internal type\n" );
- printf( " * definitions. Do not edit directly.\n" );
- printf( " */\n" );
- printf( "\n" );
- printf( "#ifndef __ASM_TYPES_H__\n" );
- printf( "#define __ASM_TYPES_H__\n" );
- printf( "\n" );
- printf( "#include \"assyntax.h\"\n" );
-
-
- /* GLcontext offsets:
- */
- OFFSET_HEADER( "GLcontext" );
-
- OFFSET( "CTX_DRIVER_CTX ", GLcontext, DriverCtx );
- printf( "\n" );
- OFFSET( "CTX_LIGHT_ENABLED ", GLcontext, Light.Enabled );
- OFFSET( "CTX_LIGHT_SHADE_MODEL ", GLcontext, Light.ShadeModel );
- OFFSET( "CTX_LIGHT_COLOR_MAT_FACE ", GLcontext, Light.ColorMaterialFace );
- OFFSET( "CTX_LIGHT_COLOR_MAT_MODE ", GLcontext, Light.ColorMaterialMode );
- OFFSET( "CTX_LIGHT_COLOR_MAT_MASK ", GLcontext, Light.ColorMaterialBitmask );
- OFFSET( "CTX_LIGHT_COLOR_MAT_ENABLED ", GLcontext, Light.ColorMaterialEnabled );
- OFFSET( "CTX_LIGHT_ENABLED_LIST ", GLcontext, Light.EnabledList );
- OFFSET( "CTX_LIGHT_NEED_VERTS ", GLcontext, Light._NeedVertices );
- OFFSET( "CTX_LIGHT_FLAGS ", GLcontext, Light._Flags );
- OFFSET( "CTX_LIGHT_BASE_COLOR ", GLcontext, Light._BaseColor );
-
-
- /* struct vertex_buffer offsets:
- */
- OFFSET_HEADER( "struct vertex_buffer" );
-
- OFFSET( "VB_SIZE ", struct vertex_buffer, Size );
- OFFSET( "VB_COUNT ", struct vertex_buffer, Count );
- printf( "\n" );
- OFFSET( "VB_ELTS ", struct vertex_buffer, Elts );
- OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, ObjPtr );
- OFFSET( "VB_EYE_PTR ", struct vertex_buffer, EyePtr );
- OFFSET( "VB_CLIP_PTR ", struct vertex_buffer, ClipPtr );
- OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, NdcPtr );
- OFFSET( "VB_CLIP_OR_MASK ", struct vertex_buffer, ClipOrMask );
- OFFSET( "VB_CLIP_MASK ", struct vertex_buffer, ClipMask );
- OFFSET( "VB_NORMAL_PTR ", struct vertex_buffer, NormalPtr );
- OFFSET( "VB_EDGE_FLAG ", struct vertex_buffer, EdgeFlag );
- OFFSET( "VB_TEX0_COORD_PTR ", struct vertex_buffer, TexCoordPtr[0] );
- OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, TexCoordPtr[1] );
- OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, TexCoordPtr[2] );
- OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, TexCoordPtr[3] );
- OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, IndexPtr );
- OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr );
- OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr );
- OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr );
- OFFSET( "VB_POINT_SIZE_PTR ", struct vertex_buffer, PointSizePtr );
- OFFSET( "VB_PRIMITIVE ", struct vertex_buffer, Primitive );
- printf( "\n" );
- OFFSET( "VB_LAST_CLIPPED ", struct vertex_buffer, LastClipped );
-
- DEFINE_HEADER( "struct vertex_buffer" );
-
- /* XXX use new labels here someday after vertex proram is done */
- DEFINE( "VERT_BIT_OBJ ", VERT_BIT_POS );
- DEFINE( "VERT_BIT_NORM ", VERT_BIT_NORMAL );
- DEFINE( "VERT_BIT_RGBA ", VERT_BIT_COLOR0 );
- DEFINE( "VERT_BIT_SPEC_RGB ", VERT_BIT_COLOR1 );
- DEFINE( "VERT_BIT_FOG_COORD ", VERT_BIT_FOG );
- DEFINE( "VERT_BIT_TEX0 ", VERT_BIT_TEX0 );
- DEFINE( "VERT_BIT_TEX1 ", VERT_BIT_TEX1 );
- DEFINE( "VERT_BIT_TEX2 ", VERT_BIT_TEX2 );
- DEFINE( "VERT_BIT_TEX3 ", VERT_BIT_TEX3 );
-
-
- /* GLvector4f offsets:
- */
- OFFSET_HEADER( "GLvector4f" );
-
- OFFSET( "V4F_DATA ", GLvector4f, data );
- OFFSET( "V4F_START ", GLvector4f, start );
- OFFSET( "V4F_COUNT ", GLvector4f, count );
- OFFSET( "V4F_STRIDE ", GLvector4f, stride );
- OFFSET( "V4F_SIZE ", GLvector4f, size );
- OFFSET( "V4F_FLAGS ", GLvector4f, flags );
-
- DEFINE_HEADER( "GLvector4f" );
-
- DEFINE( "VEC_MALLOC ", VEC_MALLOC );
- DEFINE( "VEC_NOT_WRITEABLE ", VEC_NOT_WRITEABLE );
- DEFINE( "VEC_BAD_STRIDE ", VEC_BAD_STRIDE );
- printf( "\n" );
- DEFINE( "VEC_SIZE_1 ", VEC_SIZE_1 );
- DEFINE( "VEC_SIZE_2 ", VEC_SIZE_2 );
- DEFINE( "VEC_SIZE_3 ", VEC_SIZE_3 );
- DEFINE( "VEC_SIZE_4 ", VEC_SIZE_4 );
-
-
- /* GLmatrix offsets:
- */
- OFFSET_HEADER( "GLmatrix" );
-
- OFFSET( "MATRIX_DATA ", GLmatrix, m );
- OFFSET( "MATRIX_INV ", GLmatrix, inv );
- OFFSET( "MATRIX_FLAGS ", GLmatrix, flags );
- OFFSET( "MATRIX_TYPE ", GLmatrix, type );
-
-
- /* struct gl_light offsets:
- */
- OFFSET_HEADER( "struct gl_light" );
-
- OFFSET( "LIGHT_NEXT ", struct gl_light, next );
- OFFSET( "LIGHT_PREV ", struct gl_light, prev );
- printf( "\n" );
- OFFSET( "LIGHT_AMBIENT ", struct gl_light, Ambient );
- OFFSET( "LIGHT_DIFFUSE ", struct gl_light, Diffuse );
- OFFSET( "LIGHT_SPECULAR ", struct gl_light, Specular );
- OFFSET( "LIGHT_EYE_POSITION ", struct gl_light, EyePosition );
- OFFSET( "LIGHT_EYE_DIRECTION ", struct gl_light, EyeDirection );
- OFFSET( "LIGHT_SPOT_EXPONENT ", struct gl_light, SpotExponent );
- OFFSET( "LIGHT_SPOT_CUTOFF ", struct gl_light, SpotCutoff );
- OFFSET( "LIGHT_COS_CUTOFF ", struct gl_light, _CosCutoff );
- OFFSET( "LIGHT_CONST_ATTEN ", struct gl_light, ConstantAttenuation );
- OFFSET( "LIGHT_LINEAR_ATTEN ", struct gl_light, LinearAttenuation );
- OFFSET( "LIGHT_QUADRATIC_ATTEN ", struct gl_light, QuadraticAttenuation );
- OFFSET( "LIGHT_ENABLED ", struct gl_light, Enabled );
- printf( "\n" );
- OFFSET( "LIGHT_FLAGS ", struct gl_light, _Flags );
- printf( "\n" );
- OFFSET( "LIGHT_POSITION ", struct gl_light, _Position );
- OFFSET( "LIGHT_VP_INF_NORM ", struct gl_light, _VP_inf_norm );
- OFFSET( "LIGHT_H_INF_NORM ", struct gl_light, _h_inf_norm );
- OFFSET( "LIGHT_NORM_DIRECTION ", struct gl_light, _NormDirection );
- OFFSET( "LIGHT_VP_INF_SPOT_ATTEN ", struct gl_light, _VP_inf_spot_attenuation );
- printf( "\n" );
- OFFSET( "LIGHT_SPOT_EXP_TABLE ", struct gl_light, _SpotExpTable );
- OFFSET( "LIGHT_MAT_AMBIENT ", struct gl_light, _MatAmbient );
- OFFSET( "LIGHT_MAT_DIFFUSE ", struct gl_light, _MatDiffuse );
- OFFSET( "LIGHT_MAT_SPECULAR ", struct gl_light, _MatSpecular );
- printf( "\n" );
- SIZEOF( "SIZEOF_GL_LIGHT ", struct gl_light );
-
- DEFINE_HEADER( "struct gl_light" );
-
- DEFINE( "LIGHT_SPOT ", LIGHT_SPOT );
- DEFINE( "LIGHT_LOCAL_VIEWER ", LIGHT_LOCAL_VIEWER );
- DEFINE( "LIGHT_POSITIONAL ", LIGHT_POSITIONAL );
- printf( "\n" );
- DEFINE( "LIGHT_NEED_VERTICES ", LIGHT_NEED_VERTICES );
-
-
- /* struct gl_lightmodel offsets:
- */
- OFFSET_HEADER( "struct gl_lightmodel" );
-
- OFFSET( "LIGHT_MODEL_AMBIENT ", struct gl_lightmodel, Ambient );
- OFFSET( "LIGHT_MODEL_LOCAL_VIEWER ", struct gl_lightmodel, LocalViewer );
- OFFSET( "LIGHT_MODEL_TWO_SIDE ", struct gl_lightmodel, TwoSide );
- OFFSET( "LIGHT_MODEL_COLOR_CONTROL ", struct gl_lightmodel, ColorControl );
-
-
- printf( "\n" );
- printf( "\n" );
- printf( "#endif /* __ASM_TYPES_H__ */\n" );
-
- return 0;
-}
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/glapi_x86.S b/nx-X11/extras/Mesa/src/mesa/x86/glapi_x86.S
deleted file mode 100644
index 231027ed6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/glapi_x86.S
+++ /dev/null
@@ -1,1155 +0,0 @@
-/* DO NOT EDIT - This file generated automatically by gl_x86_asm.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "assyntax.h"
-#include "glapioffsets.h"
-
-#if defined(STDCALL_API)
-# if defined(USE_MGL_NAMESPACE)
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))
-# else
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))
-# endif
-#else
-# if defined(USE_MGL_NAMESPACE)
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))
-# else
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))
-# endif
-#endif
-
-#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
-
-#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)
-#define GLOBL_FN(x) GLOBL x ; .type x, function
-#else
-#define GLOBL_FN(x) GLOBL x
-#endif
-
-#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
-# define THREADS
-#endif
-
-#ifdef GLX_USE_TLS
-
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- CALL(_x86_get_dispatch) ; \
- NOP ; \
- JMP(GL_OFFSET(off))
-
-#elif defined(PTHREADS)
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
- TEST_L(EAX, EAX) ; \
- JE(1f) ; \
- JMP(GL_OFFSET(off)) ; \
-1: CALL(_x86_get_dispatch) ; \
- JMP(GL_OFFSET(off))
-#elif defined(THREADS)
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
- TEST_L(EAX, EAX) ; \
- JE(1f) ; \
- JMP(GL_OFFSET(off)) ; \
-1: CALL(_glapi_get_dispatch) ; \
- JMP(GL_OFFSET(off))
-#else /* Non-threaded version. */
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
- JMP(GL_OFFSET(off))
-#endif
-
-#ifdef HAVE_ALIAS
-# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \
- .globl GL_PREFIX(fn, fn_alt) ; \
- .set GL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)
-#else
-# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \
- GL_STUB(fn, off, fn_alt)
-#endif
-
-SEG_TEXT
-
-#ifdef GLX_USE_TLS
-
- GLOBL GLNAME(_x86_get_dispatch)
- HIDDEN(GLNAME(_x86_get_dispatch))
-ALIGNTEXT16
-GLNAME(_x86_get_dispatch):
- movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax
- ret
-
-#elif defined(PTHREADS)
-EXTERN GLNAME(_glapi_Dispatch)
-EXTERN GLNAME(_gl_DispatchTSD)
-EXTERN GLNAME(pthread_getspecific)
-
-ALIGNTEXT16
-GLNAME(_x86_get_dispatch):
- SUB_L(CONST(24), ESP)
- PUSH_L(GLNAME(_gl_DispatchTSD))
- CALL(GLNAME(pthread_getspecific))
- ADD_L(CONST(28), ESP)
- RET
-#elif defined(THREADS)
-EXTERN GLNAME(_glapi_get_dispatch)
-#endif
-
-#if defined( GLX_USE_TLS )
- .section wtext, "awx", @progbits
-#endif /* defined( GLX_USE_TLS ) */
-
- ALIGNTEXT16
- GLOBL GLNAME(gl_dispatch_functions_start)
- HIDDEN(GLNAME(gl_dispatch_functions_start))
-GLNAME(gl_dispatch_functions_start):
-
- GL_STUB(NewList, _gloffset_NewList, NewList@8)
- GL_STUB(EndList, _gloffset_EndList, EndList@0)
- GL_STUB(CallList, _gloffset_CallList, CallList@4)
- GL_STUB(CallLists, _gloffset_CallLists, CallLists@12)
- GL_STUB(DeleteLists, _gloffset_DeleteLists, DeleteLists@8)
- GL_STUB(GenLists, _gloffset_GenLists, GenLists@4)
- GL_STUB(ListBase, _gloffset_ListBase, ListBase@4)
- GL_STUB(Begin, _gloffset_Begin, Begin@4)
- GL_STUB(Bitmap, _gloffset_Bitmap, Bitmap@28)
- GL_STUB(Color3b, _gloffset_Color3b, Color3b@12)
- GL_STUB(Color3bv, _gloffset_Color3bv, Color3bv@4)
- GL_STUB(Color3d, _gloffset_Color3d, Color3d@24)
- GL_STUB(Color3dv, _gloffset_Color3dv, Color3dv@4)
- GL_STUB(Color3f, _gloffset_Color3f, Color3f@12)
- GL_STUB(Color3fv, _gloffset_Color3fv, Color3fv@4)
- GL_STUB(Color3i, _gloffset_Color3i, Color3i@12)
- GL_STUB(Color3iv, _gloffset_Color3iv, Color3iv@4)
- GL_STUB(Color3s, _gloffset_Color3s, Color3s@12)
- GL_STUB(Color3sv, _gloffset_Color3sv, Color3sv@4)
- GL_STUB(Color3ub, _gloffset_Color3ub, Color3ub@12)
- GL_STUB(Color3ubv, _gloffset_Color3ubv, Color3ubv@4)
- GL_STUB(Color3ui, _gloffset_Color3ui, Color3ui@12)
- GL_STUB(Color3uiv, _gloffset_Color3uiv, Color3uiv@4)
- GL_STUB(Color3us, _gloffset_Color3us, Color3us@12)
- GL_STUB(Color3usv, _gloffset_Color3usv, Color3usv@4)
- GL_STUB(Color4b, _gloffset_Color4b, Color4b@16)
- GL_STUB(Color4bv, _gloffset_Color4bv, Color4bv@4)
- GL_STUB(Color4d, _gloffset_Color4d, Color4d@32)
- GL_STUB(Color4dv, _gloffset_Color4dv, Color4dv@4)
- GL_STUB(Color4f, _gloffset_Color4f, Color4f@16)
- GL_STUB(Color4fv, _gloffset_Color4fv, Color4fv@4)
- GL_STUB(Color4i, _gloffset_Color4i, Color4i@16)
- GL_STUB(Color4iv, _gloffset_Color4iv, Color4iv@4)
- GL_STUB(Color4s, _gloffset_Color4s, Color4s@16)
- GL_STUB(Color4sv, _gloffset_Color4sv, Color4sv@4)
- GL_STUB(Color4ub, _gloffset_Color4ub, Color4ub@16)
- GL_STUB(Color4ubv, _gloffset_Color4ubv, Color4ubv@4)
- GL_STUB(Color4ui, _gloffset_Color4ui, Color4ui@16)
- GL_STUB(Color4uiv, _gloffset_Color4uiv, Color4uiv@4)
- GL_STUB(Color4us, _gloffset_Color4us, Color4us@16)
- GL_STUB(Color4usv, _gloffset_Color4usv, Color4usv@4)
- GL_STUB(EdgeFlag, _gloffset_EdgeFlag, EdgeFlag@4)
- GL_STUB(EdgeFlagv, _gloffset_EdgeFlagv, EdgeFlagv@4)
- GL_STUB(End, _gloffset_End, End@0)
- GL_STUB(Indexd, _gloffset_Indexd, Indexd@8)
- GL_STUB(Indexdv, _gloffset_Indexdv, Indexdv@4)
- GL_STUB(Indexf, _gloffset_Indexf, Indexf@4)
- GL_STUB(Indexfv, _gloffset_Indexfv, Indexfv@4)
- GL_STUB(Indexi, _gloffset_Indexi, Indexi@4)
- GL_STUB(Indexiv, _gloffset_Indexiv, Indexiv@4)
- GL_STUB(Indexs, _gloffset_Indexs, Indexs@4)
- GL_STUB(Indexsv, _gloffset_Indexsv, Indexsv@4)
- GL_STUB(Normal3b, _gloffset_Normal3b, Normal3b@12)
- GL_STUB(Normal3bv, _gloffset_Normal3bv, Normal3bv@4)
- GL_STUB(Normal3d, _gloffset_Normal3d, Normal3d@24)
- GL_STUB(Normal3dv, _gloffset_Normal3dv, Normal3dv@4)
- GL_STUB(Normal3f, _gloffset_Normal3f, Normal3f@12)
- GL_STUB(Normal3fv, _gloffset_Normal3fv, Normal3fv@4)
- GL_STUB(Normal3i, _gloffset_Normal3i, Normal3i@12)
- GL_STUB(Normal3iv, _gloffset_Normal3iv, Normal3iv@4)
- GL_STUB(Normal3s, _gloffset_Normal3s, Normal3s@12)
- GL_STUB(Normal3sv, _gloffset_Normal3sv, Normal3sv@4)
- GL_STUB(RasterPos2d, _gloffset_RasterPos2d, RasterPos2d@16)
- GL_STUB(RasterPos2dv, _gloffset_RasterPos2dv, RasterPos2dv@4)
- GL_STUB(RasterPos2f, _gloffset_RasterPos2f, RasterPos2f@8)
- GL_STUB(RasterPos2fv, _gloffset_RasterPos2fv, RasterPos2fv@4)
- GL_STUB(RasterPos2i, _gloffset_RasterPos2i, RasterPos2i@8)
- GL_STUB(RasterPos2iv, _gloffset_RasterPos2iv, RasterPos2iv@4)
- GL_STUB(RasterPos2s, _gloffset_RasterPos2s, RasterPos2s@8)
- GL_STUB(RasterPos2sv, _gloffset_RasterPos2sv, RasterPos2sv@4)
- GL_STUB(RasterPos3d, _gloffset_RasterPos3d, RasterPos3d@24)
- GL_STUB(RasterPos3dv, _gloffset_RasterPos3dv, RasterPos3dv@4)
- GL_STUB(RasterPos3f, _gloffset_RasterPos3f, RasterPos3f@12)
- GL_STUB(RasterPos3fv, _gloffset_RasterPos3fv, RasterPos3fv@4)
- GL_STUB(RasterPos3i, _gloffset_RasterPos3i, RasterPos3i@12)
- GL_STUB(RasterPos3iv, _gloffset_RasterPos3iv, RasterPos3iv@4)
- GL_STUB(RasterPos3s, _gloffset_RasterPos3s, RasterPos3s@12)
- GL_STUB(RasterPos3sv, _gloffset_RasterPos3sv, RasterPos3sv@4)
- GL_STUB(RasterPos4d, _gloffset_RasterPos4d, RasterPos4d@32)
- GL_STUB(RasterPos4dv, _gloffset_RasterPos4dv, RasterPos4dv@4)
- GL_STUB(RasterPos4f, _gloffset_RasterPos4f, RasterPos4f@16)
- GL_STUB(RasterPos4fv, _gloffset_RasterPos4fv, RasterPos4fv@4)
- GL_STUB(RasterPos4i, _gloffset_RasterPos4i, RasterPos4i@16)
- GL_STUB(RasterPos4iv, _gloffset_RasterPos4iv, RasterPos4iv@4)
- GL_STUB(RasterPos4s, _gloffset_RasterPos4s, RasterPos4s@16)
- GL_STUB(RasterPos4sv, _gloffset_RasterPos4sv, RasterPos4sv@4)
- GL_STUB(Rectd, _gloffset_Rectd, Rectd@32)
- GL_STUB(Rectdv, _gloffset_Rectdv, Rectdv@8)
- GL_STUB(Rectf, _gloffset_Rectf, Rectf@16)
- GL_STUB(Rectfv, _gloffset_Rectfv, Rectfv@8)
- GL_STUB(Recti, _gloffset_Recti, Recti@16)
- GL_STUB(Rectiv, _gloffset_Rectiv, Rectiv@8)
- GL_STUB(Rects, _gloffset_Rects, Rects@16)
- GL_STUB(Rectsv, _gloffset_Rectsv, Rectsv@8)
- GL_STUB(TexCoord1d, _gloffset_TexCoord1d, TexCoord1d@8)
- GL_STUB(TexCoord1dv, _gloffset_TexCoord1dv, TexCoord1dv@4)
- GL_STUB(TexCoord1f, _gloffset_TexCoord1f, TexCoord1f@4)
- GL_STUB(TexCoord1fv, _gloffset_TexCoord1fv, TexCoord1fv@4)
- GL_STUB(TexCoord1i, _gloffset_TexCoord1i, TexCoord1i@4)
- GL_STUB(TexCoord1iv, _gloffset_TexCoord1iv, TexCoord1iv@4)
- GL_STUB(TexCoord1s, _gloffset_TexCoord1s, TexCoord1s@4)
- GL_STUB(TexCoord1sv, _gloffset_TexCoord1sv, TexCoord1sv@4)
- GL_STUB(TexCoord2d, _gloffset_TexCoord2d, TexCoord2d@16)
- GL_STUB(TexCoord2dv, _gloffset_TexCoord2dv, TexCoord2dv@4)
- GL_STUB(TexCoord2f, _gloffset_TexCoord2f, TexCoord2f@8)
- GL_STUB(TexCoord2fv, _gloffset_TexCoord2fv, TexCoord2fv@4)
- GL_STUB(TexCoord2i, _gloffset_TexCoord2i, TexCoord2i@8)
- GL_STUB(TexCoord2iv, _gloffset_TexCoord2iv, TexCoord2iv@4)
- GL_STUB(TexCoord2s, _gloffset_TexCoord2s, TexCoord2s@8)
- GL_STUB(TexCoord2sv, _gloffset_TexCoord2sv, TexCoord2sv@4)
- GL_STUB(TexCoord3d, _gloffset_TexCoord3d, TexCoord3d@24)
- GL_STUB(TexCoord3dv, _gloffset_TexCoord3dv, TexCoord3dv@4)
- GL_STUB(TexCoord3f, _gloffset_TexCoord3f, TexCoord3f@12)
- GL_STUB(TexCoord3fv, _gloffset_TexCoord3fv, TexCoord3fv@4)
- GL_STUB(TexCoord3i, _gloffset_TexCoord3i, TexCoord3i@12)
- GL_STUB(TexCoord3iv, _gloffset_TexCoord3iv, TexCoord3iv@4)
- GL_STUB(TexCoord3s, _gloffset_TexCoord3s, TexCoord3s@12)
- GL_STUB(TexCoord3sv, _gloffset_TexCoord3sv, TexCoord3sv@4)
- GL_STUB(TexCoord4d, _gloffset_TexCoord4d, TexCoord4d@32)
- GL_STUB(TexCoord4dv, _gloffset_TexCoord4dv, TexCoord4dv@4)
- GL_STUB(TexCoord4f, _gloffset_TexCoord4f, TexCoord4f@16)
- GL_STUB(TexCoord4fv, _gloffset_TexCoord4fv, TexCoord4fv@4)
- GL_STUB(TexCoord4i, _gloffset_TexCoord4i, TexCoord4i@16)
- GL_STUB(TexCoord4iv, _gloffset_TexCoord4iv, TexCoord4iv@4)
- GL_STUB(TexCoord4s, _gloffset_TexCoord4s, TexCoord4s@16)
- GL_STUB(TexCoord4sv, _gloffset_TexCoord4sv, TexCoord4sv@4)
- GL_STUB(Vertex2d, _gloffset_Vertex2d, Vertex2d@16)
- GL_STUB(Vertex2dv, _gloffset_Vertex2dv, Vertex2dv@4)
- GL_STUB(Vertex2f, _gloffset_Vertex2f, Vertex2f@8)
- GL_STUB(Vertex2fv, _gloffset_Vertex2fv, Vertex2fv@4)
- GL_STUB(Vertex2i, _gloffset_Vertex2i, Vertex2i@8)
- GL_STUB(Vertex2iv, _gloffset_Vertex2iv, Vertex2iv@4)
- GL_STUB(Vertex2s, _gloffset_Vertex2s, Vertex2s@8)
- GL_STUB(Vertex2sv, _gloffset_Vertex2sv, Vertex2sv@4)
- GL_STUB(Vertex3d, _gloffset_Vertex3d, Vertex3d@24)
- GL_STUB(Vertex3dv, _gloffset_Vertex3dv, Vertex3dv@4)
- GL_STUB(Vertex3f, _gloffset_Vertex3f, Vertex3f@12)
- GL_STUB(Vertex3fv, _gloffset_Vertex3fv, Vertex3fv@4)
- GL_STUB(Vertex3i, _gloffset_Vertex3i, Vertex3i@12)
- GL_STUB(Vertex3iv, _gloffset_Vertex3iv, Vertex3iv@4)
- GL_STUB(Vertex3s, _gloffset_Vertex3s, Vertex3s@12)
- GL_STUB(Vertex3sv, _gloffset_Vertex3sv, Vertex3sv@4)
- GL_STUB(Vertex4d, _gloffset_Vertex4d, Vertex4d@32)
- GL_STUB(Vertex4dv, _gloffset_Vertex4dv, Vertex4dv@4)
- GL_STUB(Vertex4f, _gloffset_Vertex4f, Vertex4f@16)
- GL_STUB(Vertex4fv, _gloffset_Vertex4fv, Vertex4fv@4)
- GL_STUB(Vertex4i, _gloffset_Vertex4i, Vertex4i@16)
- GL_STUB(Vertex4iv, _gloffset_Vertex4iv, Vertex4iv@4)
- GL_STUB(Vertex4s, _gloffset_Vertex4s, Vertex4s@16)
- GL_STUB(Vertex4sv, _gloffset_Vertex4sv, Vertex4sv@4)
- GL_STUB(ClipPlane, _gloffset_ClipPlane, ClipPlane@8)
- GL_STUB(ColorMaterial, _gloffset_ColorMaterial, ColorMaterial@8)
- GL_STUB(CullFace, _gloffset_CullFace, CullFace@4)
- GL_STUB(Fogf, _gloffset_Fogf, Fogf@8)
- GL_STUB(Fogfv, _gloffset_Fogfv, Fogfv@8)
- GL_STUB(Fogi, _gloffset_Fogi, Fogi@8)
- GL_STUB(Fogiv, _gloffset_Fogiv, Fogiv@8)
- GL_STUB(FrontFace, _gloffset_FrontFace, FrontFace@4)
- GL_STUB(Hint, _gloffset_Hint, Hint@8)
- GL_STUB(Lightf, _gloffset_Lightf, Lightf@12)
- GL_STUB(Lightfv, _gloffset_Lightfv, Lightfv@12)
- GL_STUB(Lighti, _gloffset_Lighti, Lighti@12)
- GL_STUB(Lightiv, _gloffset_Lightiv, Lightiv@12)
- GL_STUB(LightModelf, _gloffset_LightModelf, LightModelf@8)
- GL_STUB(LightModelfv, _gloffset_LightModelfv, LightModelfv@8)
- GL_STUB(LightModeli, _gloffset_LightModeli, LightModeli@8)
- GL_STUB(LightModeliv, _gloffset_LightModeliv, LightModeliv@8)
- GL_STUB(LineStipple, _gloffset_LineStipple, LineStipple@8)
- GL_STUB(LineWidth, _gloffset_LineWidth, LineWidth@4)
- GL_STUB(Materialf, _gloffset_Materialf, Materialf@12)
- GL_STUB(Materialfv, _gloffset_Materialfv, Materialfv@12)
- GL_STUB(Materiali, _gloffset_Materiali, Materiali@12)
- GL_STUB(Materialiv, _gloffset_Materialiv, Materialiv@12)
- GL_STUB(PointSize, _gloffset_PointSize, PointSize@4)
- GL_STUB(PolygonMode, _gloffset_PolygonMode, PolygonMode@8)
- GL_STUB(PolygonStipple, _gloffset_PolygonStipple, PolygonStipple@4)
- GL_STUB(Scissor, _gloffset_Scissor, Scissor@16)
- GL_STUB(ShadeModel, _gloffset_ShadeModel, ShadeModel@4)
- GL_STUB(TexParameterf, _gloffset_TexParameterf, TexParameterf@12)
- GL_STUB(TexParameterfv, _gloffset_TexParameterfv, TexParameterfv@12)
- GL_STUB(TexParameteri, _gloffset_TexParameteri, TexParameteri@12)
- GL_STUB(TexParameteriv, _gloffset_TexParameteriv, TexParameteriv@12)
- GL_STUB(TexImage1D, _gloffset_TexImage1D, TexImage1D@32)
- GL_STUB(TexImage2D, _gloffset_TexImage2D, TexImage2D@36)
- GL_STUB(TexEnvf, _gloffset_TexEnvf, TexEnvf@12)
- GL_STUB(TexEnvfv, _gloffset_TexEnvfv, TexEnvfv@12)
- GL_STUB(TexEnvi, _gloffset_TexEnvi, TexEnvi@12)
- GL_STUB(TexEnviv, _gloffset_TexEnviv, TexEnviv@12)
- GL_STUB(TexGend, _gloffset_TexGend, TexGend@16)
- GL_STUB(TexGendv, _gloffset_TexGendv, TexGendv@12)
- GL_STUB(TexGenf, _gloffset_TexGenf, TexGenf@12)
- GL_STUB(TexGenfv, _gloffset_TexGenfv, TexGenfv@12)
- GL_STUB(TexGeni, _gloffset_TexGeni, TexGeni@12)
- GL_STUB(TexGeniv, _gloffset_TexGeniv, TexGeniv@12)
- GL_STUB(FeedbackBuffer, _gloffset_FeedbackBuffer, FeedbackBuffer@12)
- GL_STUB(SelectBuffer, _gloffset_SelectBuffer, SelectBuffer@8)
- GL_STUB(RenderMode, _gloffset_RenderMode, RenderMode@4)
- GL_STUB(InitNames, _gloffset_InitNames, InitNames@0)
- GL_STUB(LoadName, _gloffset_LoadName, LoadName@4)
- GL_STUB(PassThrough, _gloffset_PassThrough, PassThrough@4)
- GL_STUB(PopName, _gloffset_PopName, PopName@0)
- GL_STUB(PushName, _gloffset_PushName, PushName@4)
- GL_STUB(DrawBuffer, _gloffset_DrawBuffer, DrawBuffer@4)
- GL_STUB(Clear, _gloffset_Clear, Clear@4)
- GL_STUB(ClearAccum, _gloffset_ClearAccum, ClearAccum@16)
- GL_STUB(ClearIndex, _gloffset_ClearIndex, ClearIndex@4)
- GL_STUB(ClearColor, _gloffset_ClearColor, ClearColor@16)
- GL_STUB(ClearStencil, _gloffset_ClearStencil, ClearStencil@4)
- GL_STUB(ClearDepth, _gloffset_ClearDepth, ClearDepth@8)
- GL_STUB(StencilMask, _gloffset_StencilMask, StencilMask@4)
- GL_STUB(ColorMask, _gloffset_ColorMask, ColorMask@16)
- GL_STUB(DepthMask, _gloffset_DepthMask, DepthMask@4)
- GL_STUB(IndexMask, _gloffset_IndexMask, IndexMask@4)
- GL_STUB(Accum, _gloffset_Accum, Accum@8)
- GL_STUB(Disable, _gloffset_Disable, Disable@4)
- GL_STUB(Enable, _gloffset_Enable, Enable@4)
- GL_STUB(Finish, _gloffset_Finish, Finish@0)
- GL_STUB(Flush, _gloffset_Flush, Flush@0)
- GL_STUB(PopAttrib, _gloffset_PopAttrib, PopAttrib@0)
- GL_STUB(PushAttrib, _gloffset_PushAttrib, PushAttrib@4)
- GL_STUB(Map1d, _gloffset_Map1d, Map1d@32)
- GL_STUB(Map1f, _gloffset_Map1f, Map1f@24)
- GL_STUB(Map2d, _gloffset_Map2d, Map2d@56)
- GL_STUB(Map2f, _gloffset_Map2f, Map2f@40)
- GL_STUB(MapGrid1d, _gloffset_MapGrid1d, MapGrid1d@20)
- GL_STUB(MapGrid1f, _gloffset_MapGrid1f, MapGrid1f@12)
- GL_STUB(MapGrid2d, _gloffset_MapGrid2d, MapGrid2d@40)
- GL_STUB(MapGrid2f, _gloffset_MapGrid2f, MapGrid2f@24)
- GL_STUB(EvalCoord1d, _gloffset_EvalCoord1d, EvalCoord1d@8)
- GL_STUB(EvalCoord1dv, _gloffset_EvalCoord1dv, EvalCoord1dv@4)
- GL_STUB(EvalCoord1f, _gloffset_EvalCoord1f, EvalCoord1f@4)
- GL_STUB(EvalCoord1fv, _gloffset_EvalCoord1fv, EvalCoord1fv@4)
- GL_STUB(EvalCoord2d, _gloffset_EvalCoord2d, EvalCoord2d@16)
- GL_STUB(EvalCoord2dv, _gloffset_EvalCoord2dv, EvalCoord2dv@4)
- GL_STUB(EvalCoord2f, _gloffset_EvalCoord2f, EvalCoord2f@8)
- GL_STUB(EvalCoord2fv, _gloffset_EvalCoord2fv, EvalCoord2fv@4)
- GL_STUB(EvalMesh1, _gloffset_EvalMesh1, EvalMesh1@12)
- GL_STUB(EvalPoint1, _gloffset_EvalPoint1, EvalPoint1@4)
- GL_STUB(EvalMesh2, _gloffset_EvalMesh2, EvalMesh2@20)
- GL_STUB(EvalPoint2, _gloffset_EvalPoint2, EvalPoint2@8)
- GL_STUB(AlphaFunc, _gloffset_AlphaFunc, AlphaFunc@8)
- GL_STUB(BlendFunc, _gloffset_BlendFunc, BlendFunc@8)
- GL_STUB(LogicOp, _gloffset_LogicOp, LogicOp@4)
- GL_STUB(StencilFunc, _gloffset_StencilFunc, StencilFunc@12)
- GL_STUB(StencilOp, _gloffset_StencilOp, StencilOp@12)
- GL_STUB(DepthFunc, _gloffset_DepthFunc, DepthFunc@4)
- GL_STUB(PixelZoom, _gloffset_PixelZoom, PixelZoom@8)
- GL_STUB(PixelTransferf, _gloffset_PixelTransferf, PixelTransferf@8)
- GL_STUB(PixelTransferi, _gloffset_PixelTransferi, PixelTransferi@8)
- GL_STUB(PixelStoref, _gloffset_PixelStoref, PixelStoref@8)
- GL_STUB(PixelStorei, _gloffset_PixelStorei, PixelStorei@8)
- GL_STUB(PixelMapfv, _gloffset_PixelMapfv, PixelMapfv@12)
- GL_STUB(PixelMapuiv, _gloffset_PixelMapuiv, PixelMapuiv@12)
- GL_STUB(PixelMapusv, _gloffset_PixelMapusv, PixelMapusv@12)
- GL_STUB(ReadBuffer, _gloffset_ReadBuffer, ReadBuffer@4)
- GL_STUB(CopyPixels, _gloffset_CopyPixels, CopyPixels@20)
- GL_STUB(ReadPixels, _gloffset_ReadPixels, ReadPixels@28)
- GL_STUB(DrawPixels, _gloffset_DrawPixels, DrawPixels@20)
- GL_STUB(GetBooleanv, _gloffset_GetBooleanv, GetBooleanv@8)
- GL_STUB(GetClipPlane, _gloffset_GetClipPlane, GetClipPlane@8)
- GL_STUB(GetDoublev, _gloffset_GetDoublev, GetDoublev@8)
- GL_STUB(GetError, _gloffset_GetError, GetError@0)
- GL_STUB(GetFloatv, _gloffset_GetFloatv, GetFloatv@8)
- GL_STUB(GetIntegerv, _gloffset_GetIntegerv, GetIntegerv@8)
- GL_STUB(GetLightfv, _gloffset_GetLightfv, GetLightfv@12)
- GL_STUB(GetLightiv, _gloffset_GetLightiv, GetLightiv@12)
- GL_STUB(GetMapdv, _gloffset_GetMapdv, GetMapdv@12)
- GL_STUB(GetMapfv, _gloffset_GetMapfv, GetMapfv@12)
- GL_STUB(GetMapiv, _gloffset_GetMapiv, GetMapiv@12)
- GL_STUB(GetMaterialfv, _gloffset_GetMaterialfv, GetMaterialfv@12)
- GL_STUB(GetMaterialiv, _gloffset_GetMaterialiv, GetMaterialiv@12)
- GL_STUB(GetPixelMapfv, _gloffset_GetPixelMapfv, GetPixelMapfv@8)
- GL_STUB(GetPixelMapuiv, _gloffset_GetPixelMapuiv, GetPixelMapuiv@8)
- GL_STUB(GetPixelMapusv, _gloffset_GetPixelMapusv, GetPixelMapusv@8)
- GL_STUB(GetPolygonStipple, _gloffset_GetPolygonStipple, GetPolygonStipple@4)
- GL_STUB(GetString, _gloffset_GetString, GetString@4)
- GL_STUB(GetTexEnvfv, _gloffset_GetTexEnvfv, GetTexEnvfv@12)
- GL_STUB(GetTexEnviv, _gloffset_GetTexEnviv, GetTexEnviv@12)
- GL_STUB(GetTexGendv, _gloffset_GetTexGendv, GetTexGendv@12)
- GL_STUB(GetTexGenfv, _gloffset_GetTexGenfv, GetTexGenfv@12)
- GL_STUB(GetTexGeniv, _gloffset_GetTexGeniv, GetTexGeniv@12)
- GL_STUB(GetTexImage, _gloffset_GetTexImage, GetTexImage@20)
- GL_STUB(GetTexParameterfv, _gloffset_GetTexParameterfv, GetTexParameterfv@12)
- GL_STUB(GetTexParameteriv, _gloffset_GetTexParameteriv, GetTexParameteriv@12)
- GL_STUB(GetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv, GetTexLevelParameterfv@16)
- GL_STUB(GetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv, GetTexLevelParameteriv@16)
- GL_STUB(IsEnabled, _gloffset_IsEnabled, IsEnabled@4)
- GL_STUB(IsList, _gloffset_IsList, IsList@4)
- GL_STUB(DepthRange, _gloffset_DepthRange, DepthRange@16)
- GL_STUB(Frustum, _gloffset_Frustum, Frustum@48)
- GL_STUB(LoadIdentity, _gloffset_LoadIdentity, LoadIdentity@0)
- GL_STUB(LoadMatrixf, _gloffset_LoadMatrixf, LoadMatrixf@4)
- GL_STUB(LoadMatrixd, _gloffset_LoadMatrixd, LoadMatrixd@4)
- GL_STUB(MatrixMode, _gloffset_MatrixMode, MatrixMode@4)
- GL_STUB(MultMatrixf, _gloffset_MultMatrixf, MultMatrixf@4)
- GL_STUB(MultMatrixd, _gloffset_MultMatrixd, MultMatrixd@4)
- GL_STUB(Ortho, _gloffset_Ortho, Ortho@48)
- GL_STUB(PopMatrix, _gloffset_PopMatrix, PopMatrix@0)
- GL_STUB(PushMatrix, _gloffset_PushMatrix, PushMatrix@0)
- GL_STUB(Rotated, _gloffset_Rotated, Rotated@32)
- GL_STUB(Rotatef, _gloffset_Rotatef, Rotatef@16)
- GL_STUB(Scaled, _gloffset_Scaled, Scaled@24)
- GL_STUB(Scalef, _gloffset_Scalef, Scalef@12)
- GL_STUB(Translated, _gloffset_Translated, Translated@24)
- GL_STUB(Translatef, _gloffset_Translatef, Translatef@12)
- GL_STUB(Viewport, _gloffset_Viewport, Viewport@16)
- GL_STUB(ArrayElement, _gloffset_ArrayElement, ArrayElement@4)
- GL_STUB(BindTexture, _gloffset_BindTexture, BindTexture@8)
- GL_STUB(ColorPointer, _gloffset_ColorPointer, ColorPointer@16)
- GL_STUB(DisableClientState, _gloffset_DisableClientState, DisableClientState@4)
- GL_STUB(DrawArrays, _gloffset_DrawArrays, DrawArrays@12)
- GL_STUB(DrawElements, _gloffset_DrawElements, DrawElements@16)
- GL_STUB(EdgeFlagPointer, _gloffset_EdgeFlagPointer, EdgeFlagPointer@8)
- GL_STUB(EnableClientState, _gloffset_EnableClientState, EnableClientState@4)
- GL_STUB(IndexPointer, _gloffset_IndexPointer, IndexPointer@12)
- GL_STUB(Indexub, _gloffset_Indexub, Indexub@4)
- GL_STUB(Indexubv, _gloffset_Indexubv, Indexubv@4)
- GL_STUB(InterleavedArrays, _gloffset_InterleavedArrays, InterleavedArrays@12)
- GL_STUB(NormalPointer, _gloffset_NormalPointer, NormalPointer@12)
- GL_STUB(PolygonOffset, _gloffset_PolygonOffset, PolygonOffset@8)
- GL_STUB(TexCoordPointer, _gloffset_TexCoordPointer, TexCoordPointer@16)
- GL_STUB(VertexPointer, _gloffset_VertexPointer, VertexPointer@16)
- GL_STUB(AreTexturesResident, _gloffset_AreTexturesResident, AreTexturesResident@12)
- GL_STUB(CopyTexImage1D, _gloffset_CopyTexImage1D, CopyTexImage1D@28)
- GL_STUB(CopyTexImage2D, _gloffset_CopyTexImage2D, CopyTexImage2D@32)
- GL_STUB(CopyTexSubImage1D, _gloffset_CopyTexSubImage1D, CopyTexSubImage1D@24)
- GL_STUB(CopyTexSubImage2D, _gloffset_CopyTexSubImage2D, CopyTexSubImage2D@32)
- GL_STUB(DeleteTextures, _gloffset_DeleteTextures, DeleteTextures@8)
- GL_STUB(GenTextures, _gloffset_GenTextures, GenTextures@8)
- GL_STUB(GetPointerv, _gloffset_GetPointerv, GetPointerv@8)
- GL_STUB(IsTexture, _gloffset_IsTexture, IsTexture@4)
- GL_STUB(PrioritizeTextures, _gloffset_PrioritizeTextures, PrioritizeTextures@12)
- GL_STUB(TexSubImage1D, _gloffset_TexSubImage1D, TexSubImage1D@28)
- GL_STUB(TexSubImage2D, _gloffset_TexSubImage2D, TexSubImage2D@36)
- GL_STUB(PopClientAttrib, _gloffset_PopClientAttrib, PopClientAttrib@0)
- GL_STUB(PushClientAttrib, _gloffset_PushClientAttrib, PushClientAttrib@4)
- GL_STUB(BlendColor, _gloffset_BlendColor, BlendColor@16)
- GL_STUB(BlendEquation, _gloffset_BlendEquation, BlendEquation@4)
- GL_STUB(DrawRangeElements, _gloffset_DrawRangeElements, DrawRangeElements@24)
- GL_STUB(ColorTable, _gloffset_ColorTable, ColorTable@24)
- GL_STUB(ColorTableParameterfv, _gloffset_ColorTableParameterfv, ColorTableParameterfv@12)
- GL_STUB(ColorTableParameteriv, _gloffset_ColorTableParameteriv, ColorTableParameteriv@12)
- GL_STUB(CopyColorTable, _gloffset_CopyColorTable, CopyColorTable@20)
- GL_STUB(GetColorTable, _gloffset_GetColorTable, GetColorTable@16)
- GL_STUB(GetColorTableParameterfv, _gloffset_GetColorTableParameterfv, GetColorTableParameterfv@12)
- GL_STUB(GetColorTableParameteriv, _gloffset_GetColorTableParameteriv, GetColorTableParameteriv@12)
- GL_STUB(ColorSubTable, _gloffset_ColorSubTable, ColorSubTable@24)
- GL_STUB(CopyColorSubTable, _gloffset_CopyColorSubTable, CopyColorSubTable@20)
- GL_STUB(ConvolutionFilter1D, _gloffset_ConvolutionFilter1D, ConvolutionFilter1D@24)
- GL_STUB(ConvolutionFilter2D, _gloffset_ConvolutionFilter2D, ConvolutionFilter2D@28)
- GL_STUB(ConvolutionParameterf, _gloffset_ConvolutionParameterf, ConvolutionParameterf@12)
- GL_STUB(ConvolutionParameterfv, _gloffset_ConvolutionParameterfv, ConvolutionParameterfv@12)
- GL_STUB(ConvolutionParameteri, _gloffset_ConvolutionParameteri, ConvolutionParameteri@12)
- GL_STUB(ConvolutionParameteriv, _gloffset_ConvolutionParameteriv, ConvolutionParameteriv@12)
- GL_STUB(CopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D, CopyConvolutionFilter1D@20)
- GL_STUB(CopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D, CopyConvolutionFilter2D@24)
- GL_STUB(GetConvolutionFilter, _gloffset_GetConvolutionFilter, GetConvolutionFilter@16)
- GL_STUB(GetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv, GetConvolutionParameterfv@12)
- GL_STUB(GetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv, GetConvolutionParameteriv@12)
- GL_STUB(GetSeparableFilter, _gloffset_GetSeparableFilter, GetSeparableFilter@24)
- GL_STUB(SeparableFilter2D, _gloffset_SeparableFilter2D, SeparableFilter2D@32)
- GL_STUB(GetHistogram, _gloffset_GetHistogram, GetHistogram@20)
- GL_STUB(GetHistogramParameterfv, _gloffset_GetHistogramParameterfv, GetHistogramParameterfv@12)
- GL_STUB(GetHistogramParameteriv, _gloffset_GetHistogramParameteriv, GetHistogramParameteriv@12)
- GL_STUB(GetMinmax, _gloffset_GetMinmax, GetMinmax@20)
- GL_STUB(GetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv, GetMinmaxParameterfv@12)
- GL_STUB(GetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv, GetMinmaxParameteriv@12)
- GL_STUB(Histogram, _gloffset_Histogram, Histogram@16)
- GL_STUB(Minmax, _gloffset_Minmax, Minmax@12)
- GL_STUB(ResetHistogram, _gloffset_ResetHistogram, ResetHistogram@4)
- GL_STUB(ResetMinmax, _gloffset_ResetMinmax, ResetMinmax@4)
- GL_STUB(TexImage3D, _gloffset_TexImage3D, TexImage3D@40)
- GL_STUB(TexSubImage3D, _gloffset_TexSubImage3D, TexSubImage3D@44)
- GL_STUB(CopyTexSubImage3D, _gloffset_CopyTexSubImage3D, CopyTexSubImage3D@36)
- GL_STUB(ActiveTextureARB, _gloffset_ActiveTextureARB, ActiveTextureARB@4)
- GL_STUB(ClientActiveTextureARB, _gloffset_ClientActiveTextureARB, ClientActiveTextureARB@4)
- GL_STUB(MultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB, MultiTexCoord1dARB@12)
- GL_STUB(MultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB, MultiTexCoord1dvARB@8)
- GL_STUB(MultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB, MultiTexCoord1fARB@8)
- GL_STUB(MultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB, MultiTexCoord1fvARB@8)
- GL_STUB(MultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB, MultiTexCoord1iARB@8)
- GL_STUB(MultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB, MultiTexCoord1ivARB@8)
- GL_STUB(MultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB, MultiTexCoord1sARB@8)
- GL_STUB(MultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB, MultiTexCoord1svARB@8)
- GL_STUB(MultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB, MultiTexCoord2dARB@20)
- GL_STUB(MultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB, MultiTexCoord2dvARB@8)
- GL_STUB(MultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB, MultiTexCoord2fARB@12)
- GL_STUB(MultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB, MultiTexCoord2fvARB@8)
- GL_STUB(MultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB, MultiTexCoord2iARB@12)
- GL_STUB(MultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB, MultiTexCoord2ivARB@8)
- GL_STUB(MultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB, MultiTexCoord2sARB@12)
- GL_STUB(MultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB, MultiTexCoord2svARB@8)
- GL_STUB(MultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB, MultiTexCoord3dARB@28)
- GL_STUB(MultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB, MultiTexCoord3dvARB@8)
- GL_STUB(MultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB, MultiTexCoord3fARB@16)
- GL_STUB(MultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB, MultiTexCoord3fvARB@8)
- GL_STUB(MultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB, MultiTexCoord3iARB@16)
- GL_STUB(MultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB, MultiTexCoord3ivARB@8)
- GL_STUB(MultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB, MultiTexCoord3sARB@16)
- GL_STUB(MultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB, MultiTexCoord3svARB@8)
- GL_STUB(MultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB, MultiTexCoord4dARB@36)
- GL_STUB(MultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB, MultiTexCoord4dvARB@8)
- GL_STUB(MultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB, MultiTexCoord4fARB@20)
- GL_STUB(MultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB, MultiTexCoord4fvARB@8)
- GL_STUB(MultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB, MultiTexCoord4iARB@20)
- GL_STUB(MultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4ivARB@8)
- GL_STUB(MultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB, MultiTexCoord4sARB@20)
- GL_STUB(MultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB, MultiTexCoord4svARB@8)
- GL_STUB(LoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4)
- GL_STUB(LoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4)
- GL_STUB(MultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB, MultTransposeMatrixfARB@4)
- GL_STUB(MultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixdARB@4)
- GL_STUB(SampleCoverageARB, _gloffset_SampleCoverageARB, SampleCoverageARB@8)
- GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8)
- GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8)
- GL_STUB(GetTexFilterFuncSGIS, _gloffset_GetTexFilterFuncSGIS, GetTexFilterFuncSGIS@12)
- GL_STUB(TexFilterFuncSGIS, _gloffset_TexFilterFuncSGIS, TexFilterFuncSGIS@16)
- GL_STUB(GetHistogramEXT, _gloffset_GetHistogramEXT, GetHistogramEXT@20)
- GL_STUB(GetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfvEXT, GetHistogramParameterfvEXT@12)
- GL_STUB(GetHistogramParameterivEXT, _gloffset_GetHistogramParameterivEXT, GetHistogramParameterivEXT@12)
- GL_STUB(GetMinmaxEXT, _gloffset_GetMinmaxEXT, GetMinmaxEXT@20)
- GL_STUB(GetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfvEXT, GetMinmaxParameterfvEXT@12)
- GL_STUB(GetMinmaxParameterivEXT, _gloffset_GetMinmaxParameterivEXT, GetMinmaxParameterivEXT@12)
- GL_STUB(GetConvolutionFilterEXT, _gloffset_GetConvolutionFilterEXT, GetConvolutionFilterEXT@16)
- GL_STUB(GetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfvEXT, GetConvolutionParameterfvEXT@12)
- GL_STUB(GetConvolutionParameterivEXT, _gloffset_GetConvolutionParameterivEXT, GetConvolutionParameterivEXT@12)
- GL_STUB(GetSeparableFilterEXT, _gloffset_GetSeparableFilterEXT, GetSeparableFilterEXT@24)
- GL_STUB(GetColorTableSGI, _gloffset_GetColorTableSGI, GetColorTableSGI@16)
- GL_STUB(GetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfvSGI, GetColorTableParameterfvSGI@12)
- GL_STUB(GetColorTableParameterivSGI, _gloffset_GetColorTableParameterivSGI, GetColorTableParameterivSGI@12)
- GL_STUB(PixelTexGenSGIX, _gloffset_PixelTexGenSGIX, PixelTexGenSGIX@4)
- GL_STUB(PixelTexGenParameteriSGIS, _gloffset_PixelTexGenParameteriSGIS, PixelTexGenParameteriSGIS@8)
- GL_STUB(PixelTexGenParameterivSGIS, _gloffset_PixelTexGenParameterivSGIS, PixelTexGenParameterivSGIS@8)
- GL_STUB(PixelTexGenParameterfSGIS, _gloffset_PixelTexGenParameterfSGIS, PixelTexGenParameterfSGIS@8)
- GL_STUB(PixelTexGenParameterfvSGIS, _gloffset_PixelTexGenParameterfvSGIS, PixelTexGenParameterfvSGIS@8)
- GL_STUB(GetPixelTexGenParameterivSGIS, _gloffset_GetPixelTexGenParameterivSGIS, GetPixelTexGenParameterivSGIS@8)
- GL_STUB(GetPixelTexGenParameterfvSGIS, _gloffset_GetPixelTexGenParameterfvSGIS, GetPixelTexGenParameterfvSGIS@8)
- GL_STUB(TexImage4DSGIS, _gloffset_TexImage4DSGIS, TexImage4DSGIS@44)
- GL_STUB(TexSubImage4DSGIS, _gloffset_TexSubImage4DSGIS, TexSubImage4DSGIS@52)
- GL_STUB(AreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT, AreTexturesResidentEXT@12)
- GL_STUB(GenTexturesEXT, _gloffset_GenTexturesEXT, GenTexturesEXT@8)
- GL_STUB(IsTextureEXT, _gloffset_IsTextureEXT, IsTextureEXT@4)
- GL_STUB(DetailTexFuncSGIS, _gloffset_DetailTexFuncSGIS, DetailTexFuncSGIS@12)
- GL_STUB(GetDetailTexFuncSGIS, _gloffset_GetDetailTexFuncSGIS, GetDetailTexFuncSGIS@8)
- GL_STUB(SharpenTexFuncSGIS, _gloffset_SharpenTexFuncSGIS, SharpenTexFuncSGIS@12)
- GL_STUB(GetSharpenTexFuncSGIS, _gloffset_GetSharpenTexFuncSGIS, GetSharpenTexFuncSGIS@8)
- GL_STUB(SampleMaskSGIS, _gloffset_SampleMaskSGIS, SampleMaskSGIS@8)
- GL_STUB(SamplePatternSGIS, _gloffset_SamplePatternSGIS, SamplePatternSGIS@4)
- GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20)
- GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12)
- GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16)
- GL_STUB(NormalPointerEXT, _gloffset_NormalPointerEXT, NormalPointerEXT@16)
- GL_STUB(TexCoordPointerEXT, _gloffset_TexCoordPointerEXT, TexCoordPointerEXT@20)
- GL_STUB(VertexPointerEXT, _gloffset_VertexPointerEXT, VertexPointerEXT@20)
- GL_STUB(SpriteParameterfSGIX, _gloffset_SpriteParameterfSGIX, SpriteParameterfSGIX@8)
- GL_STUB(SpriteParameterfvSGIX, _gloffset_SpriteParameterfvSGIX, SpriteParameterfvSGIX@8)
- GL_STUB(SpriteParameteriSGIX, _gloffset_SpriteParameteriSGIX, SpriteParameteriSGIX@8)
- GL_STUB(SpriteParameterivSGIX, _gloffset_SpriteParameterivSGIX, SpriteParameterivSGIX@8)
- GL_STUB(PointParameterfEXT, _gloffset_PointParameterfEXT, PointParameterfEXT@8)
- GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8)
- GL_STUB(GetInstrumentsSGIX, _gloffset_GetInstrumentsSGIX, GetInstrumentsSGIX@0)
- GL_STUB(InstrumentsBufferSGIX, _gloffset_InstrumentsBufferSGIX, InstrumentsBufferSGIX@8)
- GL_STUB(PollInstrumentsSGIX, _gloffset_PollInstrumentsSGIX, PollInstrumentsSGIX@4)
- GL_STUB(ReadInstrumentsSGIX, _gloffset_ReadInstrumentsSGIX, ReadInstrumentsSGIX@4)
- GL_STUB(StartInstrumentsSGIX, _gloffset_StartInstrumentsSGIX, StartInstrumentsSGIX@0)
- GL_STUB(StopInstrumentsSGIX, _gloffset_StopInstrumentsSGIX, StopInstrumentsSGIX@4)
- GL_STUB(FrameZoomSGIX, _gloffset_FrameZoomSGIX, FrameZoomSGIX@4)
- GL_STUB(TagSampleBufferSGIX, _gloffset_TagSampleBufferSGIX, TagSampleBufferSGIX@0)
- GL_STUB(ReferencePlaneSGIX, _gloffset_ReferencePlaneSGIX, ReferencePlaneSGIX@4)
- GL_STUB(FlushRasterSGIX, _gloffset_FlushRasterSGIX, FlushRasterSGIX@0)
- GL_STUB(GetListParameterfvSGIX, _gloffset_GetListParameterfvSGIX, GetListParameterfvSGIX@12)
- GL_STUB(GetListParameterivSGIX, _gloffset_GetListParameterivSGIX, GetListParameterivSGIX@12)
- GL_STUB(ListParameterfSGIX, _gloffset_ListParameterfSGIX, ListParameterfSGIX@12)
- GL_STUB(ListParameterfvSGIX, _gloffset_ListParameterfvSGIX, ListParameterfvSGIX@12)
- GL_STUB(ListParameteriSGIX, _gloffset_ListParameteriSGIX, ListParameteriSGIX@12)
- GL_STUB(ListParameterivSGIX, _gloffset_ListParameterivSGIX, ListParameterivSGIX@12)
- GL_STUB(FragmentColorMaterialSGIX, _gloffset_FragmentColorMaterialSGIX, FragmentColorMaterialSGIX@8)
- GL_STUB(FragmentLightfSGIX, _gloffset_FragmentLightfSGIX, FragmentLightfSGIX@12)
- GL_STUB(FragmentLightfvSGIX, _gloffset_FragmentLightfvSGIX, FragmentLightfvSGIX@12)
- GL_STUB(FragmentLightiSGIX, _gloffset_FragmentLightiSGIX, FragmentLightiSGIX@12)
- GL_STUB(FragmentLightivSGIX, _gloffset_FragmentLightivSGIX, FragmentLightivSGIX@12)
- GL_STUB(FragmentLightModelfSGIX, _gloffset_FragmentLightModelfSGIX, FragmentLightModelfSGIX@8)
- GL_STUB(FragmentLightModelfvSGIX, _gloffset_FragmentLightModelfvSGIX, FragmentLightModelfvSGIX@8)
- GL_STUB(FragmentLightModeliSGIX, _gloffset_FragmentLightModeliSGIX, FragmentLightModeliSGIX@8)
- GL_STUB(FragmentLightModelivSGIX, _gloffset_FragmentLightModelivSGIX, FragmentLightModelivSGIX@8)
- GL_STUB(FragmentMaterialfSGIX, _gloffset_FragmentMaterialfSGIX, FragmentMaterialfSGIX@12)
- GL_STUB(FragmentMaterialfvSGIX, _gloffset_FragmentMaterialfvSGIX, FragmentMaterialfvSGIX@12)
- GL_STUB(FragmentMaterialiSGIX, _gloffset_FragmentMaterialiSGIX, FragmentMaterialiSGIX@12)
- GL_STUB(FragmentMaterialivSGIX, _gloffset_FragmentMaterialivSGIX, FragmentMaterialivSGIX@12)
- GL_STUB(GetFragmentLightfvSGIX, _gloffset_GetFragmentLightfvSGIX, GetFragmentLightfvSGIX@12)
- GL_STUB(GetFragmentLightivSGIX, _gloffset_GetFragmentLightivSGIX, GetFragmentLightivSGIX@12)
- GL_STUB(GetFragmentMaterialfvSGIX, _gloffset_GetFragmentMaterialfvSGIX, GetFragmentMaterialfvSGIX@12)
- GL_STUB(GetFragmentMaterialivSGIX, _gloffset_GetFragmentMaterialivSGIX, GetFragmentMaterialivSGIX@12)
- GL_STUB(LightEnviSGIX, _gloffset_LightEnviSGIX, LightEnviSGIX@8)
- GL_STUB(VertexWeightfEXT, _gloffset_VertexWeightfEXT, VertexWeightfEXT@4)
- GL_STUB(VertexWeightfvEXT, _gloffset_VertexWeightfvEXT, VertexWeightfvEXT@4)
- GL_STUB(VertexWeightPointerEXT, _gloffset_VertexWeightPointerEXT, VertexWeightPointerEXT@16)
- GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0)
- GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8)
- GL_STUB(CombinerParameterfvNV, _gloffset_CombinerParameterfvNV, CombinerParameterfvNV@8)
- GL_STUB(CombinerParameterfNV, _gloffset_CombinerParameterfNV, CombinerParameterfNV@8)
- GL_STUB(CombinerParameterivNV, _gloffset_CombinerParameterivNV, CombinerParameterivNV@8)
- GL_STUB(CombinerParameteriNV, _gloffset_CombinerParameteriNV, CombinerParameteriNV@8)
- GL_STUB(CombinerInputNV, _gloffset_CombinerInputNV, CombinerInputNV@24)
- GL_STUB(CombinerOutputNV, _gloffset_CombinerOutputNV, CombinerOutputNV@40)
- GL_STUB(FinalCombinerInputNV, _gloffset_FinalCombinerInputNV, FinalCombinerInputNV@16)
- GL_STUB(GetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV, GetCombinerInputParameterfvNV@20)
- GL_STUB(GetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV, GetCombinerInputParameterivNV@20)
- GL_STUB(GetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV, GetCombinerOutputParameterfvNV@16)
- GL_STUB(GetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV, GetCombinerOutputParameterivNV@16)
- GL_STUB(GetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV, GetFinalCombinerInputParameterfvNV@12)
- GL_STUB(GetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV, GetFinalCombinerInputParameterivNV@12)
- GL_STUB(ResizeBuffersMESA, _gloffset_ResizeBuffersMESA, ResizeBuffersMESA@0)
- GL_STUB(WindowPos2dMESA, _gloffset_WindowPos2dMESA, WindowPos2dMESA@16)
- GL_STUB(WindowPos2dvMESA, _gloffset_WindowPos2dvMESA, WindowPos2dvMESA@4)
- GL_STUB(WindowPos2fMESA, _gloffset_WindowPos2fMESA, WindowPos2fMESA@8)
- GL_STUB(WindowPos2fvMESA, _gloffset_WindowPos2fvMESA, WindowPos2fvMESA@4)
- GL_STUB(WindowPos2iMESA, _gloffset_WindowPos2iMESA, WindowPos2iMESA@8)
- GL_STUB(WindowPos2ivMESA, _gloffset_WindowPos2ivMESA, WindowPos2ivMESA@4)
- GL_STUB(WindowPos2sMESA, _gloffset_WindowPos2sMESA, WindowPos2sMESA@8)
- GL_STUB(WindowPos2svMESA, _gloffset_WindowPos2svMESA, WindowPos2svMESA@4)
- GL_STUB(WindowPos3dMESA, _gloffset_WindowPos3dMESA, WindowPos3dMESA@24)
- GL_STUB(WindowPos3dvMESA, _gloffset_WindowPos3dvMESA, WindowPos3dvMESA@4)
- GL_STUB(WindowPos3fMESA, _gloffset_WindowPos3fMESA, WindowPos3fMESA@12)
- GL_STUB(WindowPos3fvMESA, _gloffset_WindowPos3fvMESA, WindowPos3fvMESA@4)
- GL_STUB(WindowPos3iMESA, _gloffset_WindowPos3iMESA, WindowPos3iMESA@12)
- GL_STUB(WindowPos3ivMESA, _gloffset_WindowPos3ivMESA, WindowPos3ivMESA@4)
- GL_STUB(WindowPos3sMESA, _gloffset_WindowPos3sMESA, WindowPos3sMESA@12)
- GL_STUB(WindowPos3svMESA, _gloffset_WindowPos3svMESA, WindowPos3svMESA@4)
- GL_STUB(WindowPos4dMESA, _gloffset_WindowPos4dMESA, WindowPos4dMESA@32)
- GL_STUB(WindowPos4dvMESA, _gloffset_WindowPos4dvMESA, WindowPos4dvMESA@4)
- GL_STUB(WindowPos4fMESA, _gloffset_WindowPos4fMESA, WindowPos4fMESA@16)
- GL_STUB(WindowPos4fvMESA, _gloffset_WindowPos4fvMESA, WindowPos4fvMESA@4)
- GL_STUB(WindowPos4iMESA, _gloffset_WindowPos4iMESA, WindowPos4iMESA@16)
- GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4)
- GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16)
- GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4)
- GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
- GL_STUB(IndexMaterialEXT, _gloffset_IndexMaterialEXT, IndexMaterialEXT@8)
- GL_STUB(IndexFuncEXT, _gloffset_IndexFuncEXT, IndexFuncEXT@8)
- GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8)
- GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0)
- GL_STUB(CullParameterdvEXT, _gloffset_CullParameterdvEXT, CullParameterdvEXT@8)
- GL_STUB(CullParameterfvEXT, _gloffset_CullParameterfvEXT, CullParameterfvEXT@8)
- GL_STUB(HintPGI, _gloffset_HintPGI, HintPGI@8)
- GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4)
- GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4)
- GL_STUB(FogCoorddEXT, _gloffset_FogCoorddEXT, FogCoorddEXT@8)
- GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4)
- GL_STUB(FogCoordPointerEXT, _gloffset_FogCoordPointerEXT, FogCoordPointerEXT@12)
- GL_STUB(GetColorTableEXT, _gloffset_GetColorTableEXT, GetColorTableEXT@16)
- GL_STUB(GetColorTableParameterivEXT, _gloffset_GetColorTableParameterivEXT, GetColorTableParameterivEXT@12)
- GL_STUB(GetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfvEXT, GetColorTableParameterfvEXT@12)
- GL_STUB(TbufferMask3DFX, _gloffset_TbufferMask3DFX, TbufferMask3DFX@4)
- GL_STUB(CompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB, CompressedTexImage3DARB@36)
- GL_STUB(CompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB, CompressedTexImage2DARB@32)
- GL_STUB(CompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB, CompressedTexImage1DARB@28)
- GL_STUB(CompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44)
- GL_STUB(CompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36)
- GL_STUB(CompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB, CompressedTexSubImage1DARB@28)
- GL_STUB(GetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB, GetCompressedTexImageARB@12)
- GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12)
- GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
- GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24)
- GL_STUB(SecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT, SecondaryColor3dvEXT@4)
- GL_STUB(SecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT, SecondaryColor3fEXT@12)
- GL_STUB(SecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT, SecondaryColor3fvEXT@4)
- GL_STUB(SecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT, SecondaryColor3iEXT@12)
- GL_STUB(SecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT, SecondaryColor3ivEXT@4)
- GL_STUB(SecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT, SecondaryColor3sEXT@12)
- GL_STUB(SecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT, SecondaryColor3svEXT@4)
- GL_STUB(SecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT, SecondaryColor3ubEXT@12)
- GL_STUB(SecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT, SecondaryColor3ubvEXT@4)
- GL_STUB(SecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT, SecondaryColor3uiEXT@12)
- GL_STUB(SecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT, SecondaryColor3uivEXT@4)
- GL_STUB(SecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT, SecondaryColor3usEXT@12)
- GL_STUB(SecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT, SecondaryColor3usvEXT@4)
- GL_STUB(SecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT, SecondaryColorPointerEXT@16)
- GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12)
- GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8)
- GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8)
- GL_STUB(ExecuteProgramNV, _gloffset_ExecuteProgramNV, ExecuteProgramNV@12)
- GL_STUB(GenProgramsNV, _gloffset_GenProgramsNV, GenProgramsNV@8)
- GL_STUB(GetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV, GetProgramParameterdvNV@16)
- GL_STUB(GetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV, GetProgramParameterfvNV@16)
- GL_STUB(GetProgramivNV, _gloffset_GetProgramivNV, GetProgramivNV@12)
- GL_STUB(GetProgramStringNV, _gloffset_GetProgramStringNV, GetProgramStringNV@12)
- GL_STUB(GetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV, GetTrackMatrixivNV@16)
- GL_STUB(GetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB, GetVertexAttribdvARB@12)
- GL_STUB(GetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB, GetVertexAttribfvARB@12)
- GL_STUB(GetVertexAttribivARB, _gloffset_GetVertexAttribivARB, GetVertexAttribivARB@12)
- GL_STUB(GetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV, GetVertexAttribPointervNV@12)
- GL_STUB(IsProgramNV, _gloffset_IsProgramNV, IsProgramNV@4)
- GL_STUB(LoadProgramNV, _gloffset_LoadProgramNV, LoadProgramNV@16)
- GL_STUB(ProgramParameter4dNV, _gloffset_ProgramParameter4dNV, ProgramParameter4dNV@40)
- GL_STUB(ProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV, ProgramParameter4dvNV@12)
- GL_STUB(ProgramParameter4fNV, _gloffset_ProgramParameter4fNV, ProgramParameter4fNV@24)
- GL_STUB(ProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV, ProgramParameter4fvNV@12)
- GL_STUB(ProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV, ProgramParameters4dvNV@16)
- GL_STUB(ProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV, ProgramParameters4fvNV@16)
- GL_STUB(RequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV, RequestResidentProgramsNV@8)
- GL_STUB(TrackMatrixNV, _gloffset_TrackMatrixNV, TrackMatrixNV@16)
- GL_STUB(VertexAttribPointerNV, _gloffset_VertexAttribPointerNV, VertexAttribPointerNV@20)
- GL_STUB(VertexAttrib1dARB, _gloffset_VertexAttrib1dARB, VertexAttrib1dARB@12)
- GL_STUB(VertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB, VertexAttrib1dvARB@8)
- GL_STUB(VertexAttrib1fARB, _gloffset_VertexAttrib1fARB, VertexAttrib1fARB@8)
- GL_STUB(VertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB, VertexAttrib1fvARB@8)
- GL_STUB(VertexAttrib1sARB, _gloffset_VertexAttrib1sARB, VertexAttrib1sARB@8)
- GL_STUB(VertexAttrib1svARB, _gloffset_VertexAttrib1svARB, VertexAttrib1svARB@8)
- GL_STUB(VertexAttrib2dARB, _gloffset_VertexAttrib2dARB, VertexAttrib2dARB@20)
- GL_STUB(VertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB, VertexAttrib2dvARB@8)
- GL_STUB(VertexAttrib2fARB, _gloffset_VertexAttrib2fARB, VertexAttrib2fARB@12)
- GL_STUB(VertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB, VertexAttrib2fvARB@8)
- GL_STUB(VertexAttrib2sARB, _gloffset_VertexAttrib2sARB, VertexAttrib2sARB@12)
- GL_STUB(VertexAttrib2svARB, _gloffset_VertexAttrib2svARB, VertexAttrib2svARB@8)
- GL_STUB(VertexAttrib3dARB, _gloffset_VertexAttrib3dARB, VertexAttrib3dARB@28)
- GL_STUB(VertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB, VertexAttrib3dvARB@8)
- GL_STUB(VertexAttrib3fARB, _gloffset_VertexAttrib3fARB, VertexAttrib3fARB@16)
- GL_STUB(VertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB, VertexAttrib3fvARB@8)
- GL_STUB(VertexAttrib3sARB, _gloffset_VertexAttrib3sARB, VertexAttrib3sARB@16)
- GL_STUB(VertexAttrib3svARB, _gloffset_VertexAttrib3svARB, VertexAttrib3svARB@8)
- GL_STUB(VertexAttrib4dARB, _gloffset_VertexAttrib4dARB, VertexAttrib4dARB@36)
- GL_STUB(VertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB, VertexAttrib4dvARB@8)
- GL_STUB(VertexAttrib4fARB, _gloffset_VertexAttrib4fARB, VertexAttrib4fARB@20)
- GL_STUB(VertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB, VertexAttrib4fvARB@8)
- GL_STUB(VertexAttrib4sARB, _gloffset_VertexAttrib4sARB, VertexAttrib4sARB@20)
- GL_STUB(VertexAttrib4svARB, _gloffset_VertexAttrib4svARB, VertexAttrib4svARB@8)
- GL_STUB(VertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB, VertexAttrib4NubARB@20)
- GL_STUB(VertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
- GL_STUB(VertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV, VertexAttribs1dvNV@12)
- GL_STUB(VertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV, VertexAttribs1fvNV@12)
- GL_STUB(VertexAttribs1svNV, _gloffset_VertexAttribs1svNV, VertexAttribs1svNV@12)
- GL_STUB(VertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV, VertexAttribs2dvNV@12)
- GL_STUB(VertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV, VertexAttribs2fvNV@12)
- GL_STUB(VertexAttribs2svNV, _gloffset_VertexAttribs2svNV, VertexAttribs2svNV@12)
- GL_STUB(VertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV, VertexAttribs3dvNV@12)
- GL_STUB(VertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV, VertexAttribs3fvNV@12)
- GL_STUB(VertexAttribs3svNV, _gloffset_VertexAttribs3svNV, VertexAttribs3svNV@12)
- GL_STUB(VertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV, VertexAttribs4dvNV@12)
- GL_STUB(VertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV, VertexAttribs4fvNV@12)
- GL_STUB(VertexAttribs4svNV, _gloffset_VertexAttribs4svNV, VertexAttribs4svNV@12)
- GL_STUB(VertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV, VertexAttribs4ubvNV@12)
- GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8)
- GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8)
- GL_STUB(MultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT, MultiDrawArraysEXT@16)
- GL_STUB(MultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT, MultiDrawElementsEXT@20)
- GL_STUB(ActiveStencilFaceEXT, _gloffset_ActiveStencilFaceEXT, ActiveStencilFaceEXT@4)
- GL_STUB(DeleteFencesNV, _gloffset_DeleteFencesNV, DeleteFencesNV@8)
- GL_STUB(GenFencesNV, _gloffset_GenFencesNV, GenFencesNV@8)
- GL_STUB(IsFenceNV, _gloffset_IsFenceNV, IsFenceNV@4)
- GL_STUB(TestFenceNV, _gloffset_TestFenceNV, TestFenceNV@4)
- GL_STUB(GetFenceivNV, _gloffset_GetFenceivNV, GetFenceivNV@12)
- GL_STUB(FinishFenceNV, _gloffset_FinishFenceNV, FinishFenceNV@4)
- GL_STUB(SetFenceNV, _gloffset_SetFenceNV, SetFenceNV@8)
- GL_STUB(VertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB, VertexAttrib4bvARB@8)
- GL_STUB(VertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB, VertexAttrib4ivARB@8)
- GL_STUB(VertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubvARB@8)
- GL_STUB(VertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB, VertexAttrib4usvARB@8)
- GL_STUB(VertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB, VertexAttrib4uivARB@8)
- GL_STUB(VertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB, VertexAttrib4NbvARB@8)
- GL_STUB(VertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB, VertexAttrib4NsvARB@8)
- GL_STUB(VertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB, VertexAttrib4NivARB@8)
- GL_STUB(VertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
- GL_STUB(VertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
- GL_STUB(VertexAttribPointerARB, _gloffset_VertexAttribPointerARB, VertexAttribPointerARB@24)
- GL_STUB(EnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4)
- GL_STUB(DisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4)
- GL_STUB(ProgramStringARB, _gloffset_ProgramStringARB, ProgramStringARB@16)
- GL_STUB(ProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40)
- GL_STUB(ProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12)
- GL_STUB(ProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24)
- GL_STUB(ProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12)
- GL_STUB(ProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB, ProgramLocalParameter4dARB@40)
- GL_STUB(ProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB, ProgramLocalParameter4dvARB@12)
- GL_STUB(ProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB, ProgramLocalParameter4fARB@24)
- GL_STUB(ProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB, ProgramLocalParameter4fvARB@12)
- GL_STUB(GetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB, GetProgramEnvParameterdvARB@12)
- GL_STUB(GetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB, GetProgramEnvParameterfvARB@12)
- GL_STUB(GetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB, GetProgramLocalParameterdvARB@12)
- GL_STUB(GetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB, GetProgramLocalParameterfvARB@12)
- GL_STUB(GetProgramivARB, _gloffset_GetProgramivARB, GetProgramivARB@12)
- GL_STUB(GetProgramStringARB, _gloffset_GetProgramStringARB, GetProgramStringARB@12)
- GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28)
- GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44)
- GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16)
- GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16)
- GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16)
- GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16)
- GL_STUB(BindBufferARB, _gloffset_BindBufferARB, BindBufferARB@8)
- GL_STUB(BufferDataARB, _gloffset_BufferDataARB, BufferDataARB@16)
- GL_STUB(BufferSubDataARB, _gloffset_BufferSubDataARB, BufferSubDataARB@16)
- GL_STUB(DeleteBuffersARB, _gloffset_DeleteBuffersARB, DeleteBuffersARB@8)
- GL_STUB(GenBuffersARB, _gloffset_GenBuffersARB, GenBuffersARB@8)
- GL_STUB(GetBufferParameterivARB, _gloffset_GetBufferParameterivARB, GetBufferParameterivARB@12)
- GL_STUB(GetBufferPointervARB, _gloffset_GetBufferPointervARB, GetBufferPointervARB@12)
- GL_STUB(GetBufferSubDataARB, _gloffset_GetBufferSubDataARB, GetBufferSubDataARB@16)
- GL_STUB(IsBufferARB, _gloffset_IsBufferARB, IsBufferARB@4)
- GL_STUB(MapBufferARB, _gloffset_MapBufferARB, MapBufferARB@8)
- GL_STUB(UnmapBufferARB, _gloffset_UnmapBufferARB, UnmapBufferARB@4)
- GL_STUB(DepthBoundsEXT, _gloffset_DepthBoundsEXT, DepthBoundsEXT@16)
- GL_STUB(GenQueriesARB, _gloffset_GenQueriesARB, GenQueriesARB@8)
- GL_STUB(DeleteQueriesARB, _gloffset_DeleteQueriesARB, DeleteQueriesARB@8)
- GL_STUB(IsQueryARB, _gloffset_IsQueryARB, IsQueryARB@4)
- GL_STUB(BeginQueryARB, _gloffset_BeginQueryARB, BeginQueryARB@8)
- GL_STUB(EndQueryARB, _gloffset_EndQueryARB, EndQueryARB@4)
- GL_STUB(GetQueryivARB, _gloffset_GetQueryivARB, GetQueryivARB@12)
- GL_STUB(GetQueryObjectivARB, _gloffset_GetQueryObjectivARB, GetQueryObjectivARB@12)
- GL_STUB(GetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB, GetQueryObjectuivARB@12)
- GL_STUB(MultiModeDrawArraysIBM, _gloffset_MultiModeDrawArraysIBM, MultiModeDrawArraysIBM@20)
- GL_STUB(MultiModeDrawElementsIBM, _gloffset_MultiModeDrawElementsIBM, MultiModeDrawElementsIBM@24)
- GL_STUB(BlendEquationSeparateEXT, _gloffset_BlendEquationSeparateEXT, BlendEquationSeparateEXT@8)
- GL_STUB(DeleteObjectARB, _gloffset_DeleteObjectARB, DeleteObjectARB@4)
- GL_STUB(GetHandleARB, _gloffset_GetHandleARB, GetHandleARB@4)
- GL_STUB(DetachObjectARB, _gloffset_DetachObjectARB, DetachObjectARB@8)
- GL_STUB(CreateShaderObjectARB, _gloffset_CreateShaderObjectARB, CreateShaderObjectARB@4)
- GL_STUB(ShaderSourceARB, _gloffset_ShaderSourceARB, ShaderSourceARB@16)
- GL_STUB(CompileShaderARB, _gloffset_CompileShaderARB, CompileShaderARB@4)
- GL_STUB(CreateProgramObjectARB, _gloffset_CreateProgramObjectARB, CreateProgramObjectARB@0)
- GL_STUB(AttachObjectARB, _gloffset_AttachObjectARB, AttachObjectARB@8)
- GL_STUB(LinkProgramARB, _gloffset_LinkProgramARB, LinkProgramARB@4)
- GL_STUB(UseProgramObjectARB, _gloffset_UseProgramObjectARB, UseProgramObjectARB@4)
- GL_STUB(ValidateProgramARB, _gloffset_ValidateProgramARB, ValidateProgramARB@4)
- GL_STUB(Uniform1fARB, _gloffset_Uniform1fARB, Uniform1fARB@8)
- GL_STUB(Uniform2fARB, _gloffset_Uniform2fARB, Uniform2fARB@12)
- GL_STUB(Uniform3fARB, _gloffset_Uniform3fARB, Uniform3fARB@16)
- GL_STUB(Uniform4fARB, _gloffset_Uniform4fARB, Uniform4fARB@20)
- GL_STUB(Uniform1iARB, _gloffset_Uniform1iARB, Uniform1iARB@8)
- GL_STUB(Uniform2iARB, _gloffset_Uniform2iARB, Uniform2iARB@12)
- GL_STUB(Uniform3iARB, _gloffset_Uniform3iARB, Uniform3iARB@16)
- GL_STUB(Uniform4iARB, _gloffset_Uniform4iARB, Uniform4iARB@20)
- GL_STUB(Uniform1fvARB, _gloffset_Uniform1fvARB, Uniform1fvARB@12)
- GL_STUB(Uniform2fvARB, _gloffset_Uniform2fvARB, Uniform2fvARB@12)
- GL_STUB(Uniform3fvARB, _gloffset_Uniform3fvARB, Uniform3fvARB@12)
- GL_STUB(Uniform4fvARB, _gloffset_Uniform4fvARB, Uniform4fvARB@12)
- GL_STUB(Uniform1ivARB, _gloffset_Uniform1ivARB, Uniform1ivARB@12)
- GL_STUB(Uniform2ivARB, _gloffset_Uniform2ivARB, Uniform2ivARB@12)
- GL_STUB(Uniform3ivARB, _gloffset_Uniform3ivARB, Uniform3ivARB@12)
- GL_STUB(Uniform4ivARB, _gloffset_Uniform4ivARB, Uniform4ivARB@12)
- GL_STUB(UniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB, UniformMatrix2fvARB@16)
- GL_STUB(UniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB, UniformMatrix3fvARB@16)
- GL_STUB(UniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB, UniformMatrix4fvARB@16)
- GL_STUB(GetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB, GetObjectParameterfvARB@12)
- GL_STUB(GetObjectParameterivARB, _gloffset_GetObjectParameterivARB, GetObjectParameterivARB@12)
- GL_STUB(GetInfoLogARB, _gloffset_GetInfoLogARB, GetInfoLogARB@16)
- GL_STUB(GetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB, GetAttachedObjectsARB@16)
- GL_STUB(GetUniformLocationARB, _gloffset_GetUniformLocationARB, GetUniformLocationARB@8)
- GL_STUB(GetActiveUniformARB, _gloffset_GetActiveUniformARB, GetActiveUniformARB@28)
- GL_STUB(GetUniformfvARB, _gloffset_GetUniformfvARB, GetUniformfvARB@12)
- GL_STUB(GetUniformivARB, _gloffset_GetUniformivARB, GetUniformivARB@12)
- GL_STUB(GetShaderSourceARB, _gloffset_GetShaderSourceARB, GetShaderSourceARB@16)
- GL_STUB(BindAttribLocationARB, _gloffset_BindAttribLocationARB, BindAttribLocationARB@12)
- GL_STUB(GetActiveAttribARB, _gloffset_GetActiveAttribARB, GetActiveAttribARB@28)
- GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8)
- GL_STUB(GetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV, GetVertexAttribdvNV@12)
- GL_STUB(GetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV, GetVertexAttribfvNV@12)
- GL_STUB(GetVertexAttribivNV, _gloffset_GetVertexAttribivNV, GetVertexAttribivNV@12)
- GL_STUB(VertexAttrib1dNV, _gloffset_VertexAttrib1dNV, VertexAttrib1dNV@12)
- GL_STUB(VertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV, VertexAttrib1dvNV@8)
- GL_STUB(VertexAttrib1fNV, _gloffset_VertexAttrib1fNV, VertexAttrib1fNV@8)
- GL_STUB(VertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV, VertexAttrib1fvNV@8)
- GL_STUB(VertexAttrib1sNV, _gloffset_VertexAttrib1sNV, VertexAttrib1sNV@8)
- GL_STUB(VertexAttrib1svNV, _gloffset_VertexAttrib1svNV, VertexAttrib1svNV@8)
- GL_STUB(VertexAttrib2dNV, _gloffset_VertexAttrib2dNV, VertexAttrib2dNV@20)
- GL_STUB(VertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV, VertexAttrib2dvNV@8)
- GL_STUB(VertexAttrib2fNV, _gloffset_VertexAttrib2fNV, VertexAttrib2fNV@12)
- GL_STUB(VertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV, VertexAttrib2fvNV@8)
- GL_STUB(VertexAttrib2sNV, _gloffset_VertexAttrib2sNV, VertexAttrib2sNV@12)
- GL_STUB(VertexAttrib2svNV, _gloffset_VertexAttrib2svNV, VertexAttrib2svNV@8)
- GL_STUB(VertexAttrib3dNV, _gloffset_VertexAttrib3dNV, VertexAttrib3dNV@28)
- GL_STUB(VertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV, VertexAttrib3dvNV@8)
- GL_STUB(VertexAttrib3fNV, _gloffset_VertexAttrib3fNV, VertexAttrib3fNV@16)
- GL_STUB(VertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV, VertexAttrib3fvNV@8)
- GL_STUB(VertexAttrib3sNV, _gloffset_VertexAttrib3sNV, VertexAttrib3sNV@16)
- GL_STUB(VertexAttrib3svNV, _gloffset_VertexAttrib3svNV, VertexAttrib3svNV@8)
- GL_STUB(VertexAttrib4dNV, _gloffset_VertexAttrib4dNV, VertexAttrib4dNV@36)
- GL_STUB(VertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV, VertexAttrib4dvNV@8)
- GL_STUB(VertexAttrib4fNV, _gloffset_VertexAttrib4fNV, VertexAttrib4fNV@20)
- GL_STUB(VertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV, VertexAttrib4fvNV@8)
- GL_STUB(VertexAttrib4sNV, _gloffset_VertexAttrib4sNV, VertexAttrib4sNV@20)
- GL_STUB(VertexAttrib4svNV, _gloffset_VertexAttrib4svNV, VertexAttrib4svNV@8)
- GL_STUB(VertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV, VertexAttrib4ubNV@20)
- GL_STUB(VertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV, VertexAttrib4ubvNV@8)
- GL_STUB(GenFragmentShadersATI, _gloffset_GenFragmentShadersATI, GenFragmentShadersATI@4)
- GL_STUB(BindFragmentShaderATI, _gloffset_BindFragmentShaderATI, BindFragmentShaderATI@4)
- GL_STUB(DeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI, DeleteFragmentShaderATI@4)
- GL_STUB(BeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI, BeginFragmentShaderATI@0)
- GL_STUB(EndFragmentShaderATI, _gloffset_EndFragmentShaderATI, EndFragmentShaderATI@0)
- GL_STUB(PassTexCoordATI, _gloffset_PassTexCoordATI, PassTexCoordATI@12)
- GL_STUB(SampleMapATI, _gloffset_SampleMapATI, SampleMapATI@12)
- GL_STUB(ColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI, ColorFragmentOp1ATI@28)
- GL_STUB(ColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI, ColorFragmentOp2ATI@40)
- GL_STUB(ColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI, ColorFragmentOp3ATI@52)
- GL_STUB(AlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI, AlphaFragmentOp1ATI@24)
- GL_STUB(AlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI, AlphaFragmentOp2ATI@36)
- GL_STUB(AlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI, AlphaFragmentOp3ATI@48)
- GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8)
- GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4)
- GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
- GL_STUB(DeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT, DeleteRenderbuffersEXT@8)
- GL_STUB(GenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT, GenRenderbuffersEXT@8)
- GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16)
- GL_STUB(GetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12)
- GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4)
- GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
- GL_STUB(DeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT, DeleteFramebuffersEXT@8)
- GL_STUB(GenFramebuffersEXT, _gloffset_GenFramebuffersEXT, GenFramebuffersEXT@8)
- GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
- GL_STUB(FramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT, FramebufferTexture1DEXT@20)
- GL_STUB(FramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT, FramebufferTexture2DEXT@20)
- GL_STUB(FramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT, FramebufferTexture3DEXT@24)
- GL_STUB(FramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT, FramebufferRenderbufferEXT@16)
- GL_STUB(GetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16)
- GL_STUB(GenerateMipmapEXT, _gloffset_GenerateMipmapEXT, GenerateMipmapEXT@4)
- GL_STUB(StencilFuncSeparate, _gloffset_StencilFuncSeparate, StencilFuncSeparate@16)
- GL_STUB(StencilOpSeparate, _gloffset_StencilOpSeparate, StencilOpSeparate@16)
- GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8)
- GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
- GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
- GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
- GL_STUB_ALIAS(CopyTexImage1DEXT, _gloffset_CopyTexImage1D, CopyTexImage1DEXT@28, CopyTexImage1D, CopyTexImage1D@28)
- GL_STUB_ALIAS(CopyTexImage2DEXT, _gloffset_CopyTexImage2D, CopyTexImage2DEXT@32, CopyTexImage2D, CopyTexImage2D@32)
- GL_STUB_ALIAS(CopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D, CopyTexSubImage1DEXT@24, CopyTexSubImage1D, CopyTexSubImage1D@24)
- GL_STUB_ALIAS(CopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D, CopyTexSubImage2DEXT@32, CopyTexSubImage2D, CopyTexSubImage2D@32)
- GL_STUB_ALIAS(DeleteTexturesEXT, _gloffset_DeleteTextures, DeleteTexturesEXT@8, DeleteTextures, DeleteTextures@8)
- GL_STUB_ALIAS(GetPointervEXT, _gloffset_GetPointerv, GetPointervEXT@8, GetPointerv, GetPointerv@8)
- GL_STUB_ALIAS(PrioritizeTexturesEXT, _gloffset_PrioritizeTextures, PrioritizeTexturesEXT@12, PrioritizeTextures, PrioritizeTextures@12)
- GL_STUB_ALIAS(TexSubImage1DEXT, _gloffset_TexSubImage1D, TexSubImage1DEXT@28, TexSubImage1D, TexSubImage1D@28)
- GL_STUB_ALIAS(TexSubImage2DEXT, _gloffset_TexSubImage2D, TexSubImage2DEXT@36, TexSubImage2D, TexSubImage2D@36)
- GL_STUB_ALIAS(BlendColorEXT, _gloffset_BlendColor, BlendColorEXT@16, BlendColor, BlendColor@16)
- GL_STUB_ALIAS(BlendEquationEXT, _gloffset_BlendEquation, BlendEquationEXT@4, BlendEquation, BlendEquation@4)
- GL_STUB_ALIAS(DrawRangeElementsEXT, _gloffset_DrawRangeElements, DrawRangeElementsEXT@24, DrawRangeElements, DrawRangeElements@24)
- GL_STUB_ALIAS(ColorTableSGI, _gloffset_ColorTable, ColorTableSGI@24, ColorTable, ColorTable@24)
- GL_STUB_ALIAS(ColorTableEXT, _gloffset_ColorTable, ColorTableEXT@24, ColorTable, ColorTable@24)
- GL_STUB_ALIAS(ColorTableParameterfvSGI, _gloffset_ColorTableParameterfv, ColorTableParameterfvSGI@12, ColorTableParameterfv, ColorTableParameterfv@12)
- GL_STUB_ALIAS(ColorTableParameterivSGI, _gloffset_ColorTableParameteriv, ColorTableParameterivSGI@12, ColorTableParameteriv, ColorTableParameteriv@12)
- GL_STUB_ALIAS(CopyColorTableSGI, _gloffset_CopyColorTable, CopyColorTableSGI@20, CopyColorTable, CopyColorTable@20)
- GL_STUB_ALIAS(ColorSubTableEXT, _gloffset_ColorSubTable, ColorSubTableEXT@24, ColorSubTable, ColorSubTable@24)
- GL_STUB_ALIAS(CopyColorSubTableEXT, _gloffset_CopyColorSubTable, CopyColorSubTableEXT@20, CopyColorSubTable, CopyColorSubTable@20)
- GL_STUB_ALIAS(ConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D, ConvolutionFilter1DEXT@24, ConvolutionFilter1D, ConvolutionFilter1D@24)
- GL_STUB_ALIAS(ConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D, ConvolutionFilter2DEXT@28, ConvolutionFilter2D, ConvolutionFilter2D@28)
- GL_STUB_ALIAS(ConvolutionParameterfEXT, _gloffset_ConvolutionParameterf, ConvolutionParameterfEXT@12, ConvolutionParameterf, ConvolutionParameterf@12)
- GL_STUB_ALIAS(ConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv, ConvolutionParameterfvEXT@12, ConvolutionParameterfv, ConvolutionParameterfv@12)
- GL_STUB_ALIAS(ConvolutionParameteriEXT, _gloffset_ConvolutionParameteri, ConvolutionParameteriEXT@12, ConvolutionParameteri, ConvolutionParameteri@12)
- GL_STUB_ALIAS(ConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv, ConvolutionParameterivEXT@12, ConvolutionParameteriv, ConvolutionParameteriv@12)
- GL_STUB_ALIAS(CopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D, CopyConvolutionFilter1DEXT@20, CopyConvolutionFilter1D, CopyConvolutionFilter1D@20)
- GL_STUB_ALIAS(CopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D, CopyConvolutionFilter2DEXT@24, CopyConvolutionFilter2D, CopyConvolutionFilter2D@24)
- GL_STUB_ALIAS(SeparableFilter2DEXT, _gloffset_SeparableFilter2D, SeparableFilter2DEXT@32, SeparableFilter2D, SeparableFilter2D@32)
- GL_STUB_ALIAS(HistogramEXT, _gloffset_Histogram, HistogramEXT@16, Histogram, Histogram@16)
- GL_STUB_ALIAS(MinmaxEXT, _gloffset_Minmax, MinmaxEXT@12, Minmax, Minmax@12)
- GL_STUB_ALIAS(ResetHistogramEXT, _gloffset_ResetHistogram, ResetHistogramEXT@4, ResetHistogram, ResetHistogram@4)
- GL_STUB_ALIAS(ResetMinmaxEXT, _gloffset_ResetMinmax, ResetMinmaxEXT@4, ResetMinmax, ResetMinmax@4)
- GL_STUB_ALIAS(TexImage3DEXT, _gloffset_TexImage3D, TexImage3DEXT@40, TexImage3D, TexImage3D@40)
- GL_STUB_ALIAS(TexSubImage3DEXT, _gloffset_TexSubImage3D, TexSubImage3DEXT@44, TexSubImage3D, TexSubImage3D@44)
- GL_STUB_ALIAS(CopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D, CopyTexSubImage3DEXT@36, CopyTexSubImage3D, CopyTexSubImage3D@36)
- GL_STUB_ALIAS(ActiveTexture, _gloffset_ActiveTextureARB, ActiveTexture@4, ActiveTextureARB, ActiveTextureARB@4)
- GL_STUB_ALIAS(ClientActiveTexture, _gloffset_ClientActiveTextureARB, ClientActiveTexture@4, ClientActiveTextureARB, ClientActiveTextureARB@4)
- GL_STUB_ALIAS(MultiTexCoord1d, _gloffset_MultiTexCoord1dARB, MultiTexCoord1d@12, MultiTexCoord1dARB, MultiTexCoord1dARB@12)
- GL_STUB_ALIAS(MultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB, MultiTexCoord1dv@8, MultiTexCoord1dvARB, MultiTexCoord1dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord1f, _gloffset_MultiTexCoord1fARB, MultiTexCoord1f@8, MultiTexCoord1fARB, MultiTexCoord1fARB@8)
- GL_STUB_ALIAS(MultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB, MultiTexCoord1fv@8, MultiTexCoord1fvARB, MultiTexCoord1fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord1i, _gloffset_MultiTexCoord1iARB, MultiTexCoord1i@8, MultiTexCoord1iARB, MultiTexCoord1iARB@8)
- GL_STUB_ALIAS(MultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB, MultiTexCoord1iv@8, MultiTexCoord1ivARB, MultiTexCoord1ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord1s, _gloffset_MultiTexCoord1sARB, MultiTexCoord1s@8, MultiTexCoord1sARB, MultiTexCoord1sARB@8)
- GL_STUB_ALIAS(MultiTexCoord1sv, _gloffset_MultiTexCoord1svARB, MultiTexCoord1sv@8, MultiTexCoord1svARB, MultiTexCoord1svARB@8)
- GL_STUB_ALIAS(MultiTexCoord2d, _gloffset_MultiTexCoord2dARB, MultiTexCoord2d@20, MultiTexCoord2dARB, MultiTexCoord2dARB@20)
- GL_STUB_ALIAS(MultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB, MultiTexCoord2dv@8, MultiTexCoord2dvARB, MultiTexCoord2dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord2f, _gloffset_MultiTexCoord2fARB, MultiTexCoord2f@12, MultiTexCoord2fARB, MultiTexCoord2fARB@12)
- GL_STUB_ALIAS(MultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB, MultiTexCoord2fv@8, MultiTexCoord2fvARB, MultiTexCoord2fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord2i, _gloffset_MultiTexCoord2iARB, MultiTexCoord2i@12, MultiTexCoord2iARB, MultiTexCoord2iARB@12)
- GL_STUB_ALIAS(MultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB, MultiTexCoord2iv@8, MultiTexCoord2ivARB, MultiTexCoord2ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord2s, _gloffset_MultiTexCoord2sARB, MultiTexCoord2s@12, MultiTexCoord2sARB, MultiTexCoord2sARB@12)
- GL_STUB_ALIAS(MultiTexCoord2sv, _gloffset_MultiTexCoord2svARB, MultiTexCoord2sv@8, MultiTexCoord2svARB, MultiTexCoord2svARB@8)
- GL_STUB_ALIAS(MultiTexCoord3d, _gloffset_MultiTexCoord3dARB, MultiTexCoord3d@28, MultiTexCoord3dARB, MultiTexCoord3dARB@28)
- GL_STUB_ALIAS(MultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB, MultiTexCoord3dv@8, MultiTexCoord3dvARB, MultiTexCoord3dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord3f, _gloffset_MultiTexCoord3fARB, MultiTexCoord3f@16, MultiTexCoord3fARB, MultiTexCoord3fARB@16)
- GL_STUB_ALIAS(MultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB, MultiTexCoord3fv@8, MultiTexCoord3fvARB, MultiTexCoord3fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord3i, _gloffset_MultiTexCoord3iARB, MultiTexCoord3i@16, MultiTexCoord3iARB, MultiTexCoord3iARB@16)
- GL_STUB_ALIAS(MultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB, MultiTexCoord3iv@8, MultiTexCoord3ivARB, MultiTexCoord3ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord3s, _gloffset_MultiTexCoord3sARB, MultiTexCoord3s@16, MultiTexCoord3sARB, MultiTexCoord3sARB@16)
- GL_STUB_ALIAS(MultiTexCoord3sv, _gloffset_MultiTexCoord3svARB, MultiTexCoord3sv@8, MultiTexCoord3svARB, MultiTexCoord3svARB@8)
- GL_STUB_ALIAS(MultiTexCoord4d, _gloffset_MultiTexCoord4dARB, MultiTexCoord4d@36, MultiTexCoord4dARB, MultiTexCoord4dARB@36)
- GL_STUB_ALIAS(MultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB, MultiTexCoord4dv@8, MultiTexCoord4dvARB, MultiTexCoord4dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord4f, _gloffset_MultiTexCoord4fARB, MultiTexCoord4f@20, MultiTexCoord4fARB, MultiTexCoord4fARB@20)
- GL_STUB_ALIAS(MultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB, MultiTexCoord4fv@8, MultiTexCoord4fvARB, MultiTexCoord4fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord4i, _gloffset_MultiTexCoord4iARB, MultiTexCoord4i@20, MultiTexCoord4iARB, MultiTexCoord4iARB@20)
- GL_STUB_ALIAS(MultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4iv@8, MultiTexCoord4ivARB, MultiTexCoord4ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord4s, _gloffset_MultiTexCoord4sARB, MultiTexCoord4s@20, MultiTexCoord4sARB, MultiTexCoord4sARB@20)
- GL_STUB_ALIAS(MultiTexCoord4sv, _gloffset_MultiTexCoord4svARB, MultiTexCoord4sv@8, MultiTexCoord4svARB, MultiTexCoord4svARB@8)
- GL_STUB_ALIAS(LoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixf@4, LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4)
- GL_STUB_ALIAS(LoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixd@4, LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4)
- GL_STUB_ALIAS(MultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB, MultTransposeMatrixf@4, MultTransposeMatrixfARB, MultTransposeMatrixfARB@4)
- GL_STUB_ALIAS(MultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixd@4, MultTransposeMatrixdARB, MultTransposeMatrixdARB@4)
- GL_STUB_ALIAS(SampleCoverage, _gloffset_SampleCoverageARB, SampleCoverage@8, SampleCoverageARB, SampleCoverageARB@8)
- GL_STUB_ALIAS(DrawBuffersATI, _gloffset_DrawBuffersARB, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8)
- GL_STUB_ALIAS(SampleMaskEXT, _gloffset_SampleMaskSGIS, SampleMaskEXT@8, SampleMaskSGIS, SampleMaskSGIS@8)
- GL_STUB_ALIAS(SamplePatternEXT, _gloffset_SamplePatternSGIS, SamplePatternEXT@4, SamplePatternSGIS, SamplePatternSGIS@4)
- GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8)
- GL_STUB_ALIAS(PointParameterfARB, _gloffset_PointParameterfEXT, PointParameterfARB@8, PointParameterfEXT, PointParameterfEXT@8)
- GL_STUB_ALIAS(PointParameterfSGIS, _gloffset_PointParameterfEXT, PointParameterfSGIS@8, PointParameterfEXT, PointParameterfEXT@8)
- GL_STUB_ALIAS(PointParameterfv, _gloffset_PointParameterfvEXT, PointParameterfv@8, PointParameterfvEXT, PointParameterfvEXT@8)
- GL_STUB_ALIAS(PointParameterfvARB, _gloffset_PointParameterfvEXT, PointParameterfvARB@8, PointParameterfvEXT, PointParameterfvEXT@8)
- GL_STUB_ALIAS(PointParameterfvSGIS, _gloffset_PointParameterfvEXT, PointParameterfvSGIS@8, PointParameterfvEXT, PointParameterfvEXT@8)
- GL_STUB_ALIAS(WindowPos2d, _gloffset_WindowPos2dMESA, WindowPos2d@16, WindowPos2dMESA, WindowPos2dMESA@16)
- GL_STUB_ALIAS(WindowPos2dARB, _gloffset_WindowPos2dMESA, WindowPos2dARB@16, WindowPos2dMESA, WindowPos2dMESA@16)
- GL_STUB_ALIAS(WindowPos2dv, _gloffset_WindowPos2dvMESA, WindowPos2dv@4, WindowPos2dvMESA, WindowPos2dvMESA@4)
- GL_STUB_ALIAS(WindowPos2dvARB, _gloffset_WindowPos2dvMESA, WindowPos2dvARB@4, WindowPos2dvMESA, WindowPos2dvMESA@4)
- GL_STUB_ALIAS(WindowPos2f, _gloffset_WindowPos2fMESA, WindowPos2f@8, WindowPos2fMESA, WindowPos2fMESA@8)
- GL_STUB_ALIAS(WindowPos2fARB, _gloffset_WindowPos2fMESA, WindowPos2fARB@8, WindowPos2fMESA, WindowPos2fMESA@8)
- GL_STUB_ALIAS(WindowPos2fv, _gloffset_WindowPos2fvMESA, WindowPos2fv@4, WindowPos2fvMESA, WindowPos2fvMESA@4)
- GL_STUB_ALIAS(WindowPos2fvARB, _gloffset_WindowPos2fvMESA, WindowPos2fvARB@4, WindowPos2fvMESA, WindowPos2fvMESA@4)
- GL_STUB_ALIAS(WindowPos2i, _gloffset_WindowPos2iMESA, WindowPos2i@8, WindowPos2iMESA, WindowPos2iMESA@8)
- GL_STUB_ALIAS(WindowPos2iARB, _gloffset_WindowPos2iMESA, WindowPos2iARB@8, WindowPos2iMESA, WindowPos2iMESA@8)
- GL_STUB_ALIAS(WindowPos2iv, _gloffset_WindowPos2ivMESA, WindowPos2iv@4, WindowPos2ivMESA, WindowPos2ivMESA@4)
- GL_STUB_ALIAS(WindowPos2ivARB, _gloffset_WindowPos2ivMESA, WindowPos2ivARB@4, WindowPos2ivMESA, WindowPos2ivMESA@4)
- GL_STUB_ALIAS(WindowPos2s, _gloffset_WindowPos2sMESA, WindowPos2s@8, WindowPos2sMESA, WindowPos2sMESA@8)
- GL_STUB_ALIAS(WindowPos2sARB, _gloffset_WindowPos2sMESA, WindowPos2sARB@8, WindowPos2sMESA, WindowPos2sMESA@8)
- GL_STUB_ALIAS(WindowPos2sv, _gloffset_WindowPos2svMESA, WindowPos2sv@4, WindowPos2svMESA, WindowPos2svMESA@4)
- GL_STUB_ALIAS(WindowPos2svARB, _gloffset_WindowPos2svMESA, WindowPos2svARB@4, WindowPos2svMESA, WindowPos2svMESA@4)
- GL_STUB_ALIAS(WindowPos3d, _gloffset_WindowPos3dMESA, WindowPos3d@24, WindowPos3dMESA, WindowPos3dMESA@24)
- GL_STUB_ALIAS(WindowPos3dARB, _gloffset_WindowPos3dMESA, WindowPos3dARB@24, WindowPos3dMESA, WindowPos3dMESA@24)
- GL_STUB_ALIAS(WindowPos3dv, _gloffset_WindowPos3dvMESA, WindowPos3dv@4, WindowPos3dvMESA, WindowPos3dvMESA@4)
- GL_STUB_ALIAS(WindowPos3dvARB, _gloffset_WindowPos3dvMESA, WindowPos3dvARB@4, WindowPos3dvMESA, WindowPos3dvMESA@4)
- GL_STUB_ALIAS(WindowPos3f, _gloffset_WindowPos3fMESA, WindowPos3f@12, WindowPos3fMESA, WindowPos3fMESA@12)
- GL_STUB_ALIAS(WindowPos3fARB, _gloffset_WindowPos3fMESA, WindowPos3fARB@12, WindowPos3fMESA, WindowPos3fMESA@12)
- GL_STUB_ALIAS(WindowPos3fv, _gloffset_WindowPos3fvMESA, WindowPos3fv@4, WindowPos3fvMESA, WindowPos3fvMESA@4)
- GL_STUB_ALIAS(WindowPos3fvARB, _gloffset_WindowPos3fvMESA, WindowPos3fvARB@4, WindowPos3fvMESA, WindowPos3fvMESA@4)
- GL_STUB_ALIAS(WindowPos3i, _gloffset_WindowPos3iMESA, WindowPos3i@12, WindowPos3iMESA, WindowPos3iMESA@12)
- GL_STUB_ALIAS(WindowPos3iARB, _gloffset_WindowPos3iMESA, WindowPos3iARB@12, WindowPos3iMESA, WindowPos3iMESA@12)
- GL_STUB_ALIAS(WindowPos3iv, _gloffset_WindowPos3ivMESA, WindowPos3iv@4, WindowPos3ivMESA, WindowPos3ivMESA@4)
- GL_STUB_ALIAS(WindowPos3ivARB, _gloffset_WindowPos3ivMESA, WindowPos3ivARB@4, WindowPos3ivMESA, WindowPos3ivMESA@4)
- GL_STUB_ALIAS(WindowPos3s, _gloffset_WindowPos3sMESA, WindowPos3s@12, WindowPos3sMESA, WindowPos3sMESA@12)
- GL_STUB_ALIAS(WindowPos3sARB, _gloffset_WindowPos3sMESA, WindowPos3sARB@12, WindowPos3sMESA, WindowPos3sMESA@12)
- GL_STUB_ALIAS(WindowPos3sv, _gloffset_WindowPos3svMESA, WindowPos3sv@4, WindowPos3svMESA, WindowPos3svMESA@4)
- GL_STUB_ALIAS(WindowPos3svARB, _gloffset_WindowPos3svMESA, WindowPos3svARB@4, WindowPos3svMESA, WindowPos3svMESA@4)
- GL_STUB_ALIAS(BlendFuncSeparate, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparate@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
- GL_STUB_ALIAS(BlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateINGR@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
- GL_STUB_ALIAS(FogCoordf, _gloffset_FogCoordfEXT, FogCoordf@4, FogCoordfEXT, FogCoordfEXT@4)
- GL_STUB_ALIAS(FogCoordfv, _gloffset_FogCoordfvEXT, FogCoordfv@4, FogCoordfvEXT, FogCoordfvEXT@4)
- GL_STUB_ALIAS(FogCoordd, _gloffset_FogCoorddEXT, FogCoordd@8, FogCoorddEXT, FogCoorddEXT@8)
- GL_STUB_ALIAS(FogCoorddv, _gloffset_FogCoorddvEXT, FogCoorddv@4, FogCoorddvEXT, FogCoorddvEXT@4)
- GL_STUB_ALIAS(FogCoordPointer, _gloffset_FogCoordPointerEXT, FogCoordPointer@12, FogCoordPointerEXT, FogCoordPointerEXT@12)
- GL_STUB_ALIAS(CompressedTexImage3D, _gloffset_CompressedTexImage3DARB, CompressedTexImage3D@36, CompressedTexImage3DARB, CompressedTexImage3DARB@36)
- GL_STUB_ALIAS(CompressedTexImage2D, _gloffset_CompressedTexImage2DARB, CompressedTexImage2D@32, CompressedTexImage2DARB, CompressedTexImage2DARB@32)
- GL_STUB_ALIAS(CompressedTexImage1D, _gloffset_CompressedTexImage1DARB, CompressedTexImage1D@28, CompressedTexImage1DARB, CompressedTexImage1DARB@28)
- GL_STUB_ALIAS(CompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44)
- GL_STUB_ALIAS(CompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36)
- GL_STUB_ALIAS(CompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB, CompressedTexSubImage1D@28, CompressedTexSubImage1DARB, CompressedTexSubImage1DARB@28)
- GL_STUB_ALIAS(GetCompressedTexImage, _gloffset_GetCompressedTexImageARB, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12)
- GL_STUB_ALIAS(SecondaryColor3b, _gloffset_SecondaryColor3bEXT, SecondaryColor3b@12, SecondaryColor3bEXT, SecondaryColor3bEXT@12)
- GL_STUB_ALIAS(SecondaryColor3bv, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bv@4, SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3d, _gloffset_SecondaryColor3dEXT, SecondaryColor3d@24, SecondaryColor3dEXT, SecondaryColor3dEXT@24)
- GL_STUB_ALIAS(SecondaryColor3dv, _gloffset_SecondaryColor3dvEXT, SecondaryColor3dv@4, SecondaryColor3dvEXT, SecondaryColor3dvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3f, _gloffset_SecondaryColor3fEXT, SecondaryColor3f@12, SecondaryColor3fEXT, SecondaryColor3fEXT@12)
- GL_STUB_ALIAS(SecondaryColor3fv, _gloffset_SecondaryColor3fvEXT, SecondaryColor3fv@4, SecondaryColor3fvEXT, SecondaryColor3fvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3i, _gloffset_SecondaryColor3iEXT, SecondaryColor3i@12, SecondaryColor3iEXT, SecondaryColor3iEXT@12)
- GL_STUB_ALIAS(SecondaryColor3iv, _gloffset_SecondaryColor3ivEXT, SecondaryColor3iv@4, SecondaryColor3ivEXT, SecondaryColor3ivEXT@4)
- GL_STUB_ALIAS(SecondaryColor3s, _gloffset_SecondaryColor3sEXT, SecondaryColor3s@12, SecondaryColor3sEXT, SecondaryColor3sEXT@12)
- GL_STUB_ALIAS(SecondaryColor3sv, _gloffset_SecondaryColor3svEXT, SecondaryColor3sv@4, SecondaryColor3svEXT, SecondaryColor3svEXT@4)
- GL_STUB_ALIAS(SecondaryColor3ub, _gloffset_SecondaryColor3ubEXT, SecondaryColor3ub@12, SecondaryColor3ubEXT, SecondaryColor3ubEXT@12)
- GL_STUB_ALIAS(SecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT, SecondaryColor3ubv@4, SecondaryColor3ubvEXT, SecondaryColor3ubvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3ui, _gloffset_SecondaryColor3uiEXT, SecondaryColor3ui@12, SecondaryColor3uiEXT, SecondaryColor3uiEXT@12)
- GL_STUB_ALIAS(SecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT, SecondaryColor3uiv@4, SecondaryColor3uivEXT, SecondaryColor3uivEXT@4)
- GL_STUB_ALIAS(SecondaryColor3us, _gloffset_SecondaryColor3usEXT, SecondaryColor3us@12, SecondaryColor3usEXT, SecondaryColor3usEXT@12)
- GL_STUB_ALIAS(SecondaryColor3usv, _gloffset_SecondaryColor3usvEXT, SecondaryColor3usv@4, SecondaryColor3usvEXT, SecondaryColor3usvEXT@4)
- GL_STUB_ALIAS(SecondaryColorPointer, _gloffset_SecondaryColorPointerEXT, SecondaryColorPointer@16, SecondaryColorPointerEXT, SecondaryColorPointerEXT@16)
- GL_STUB_ALIAS(BindProgramARB, _gloffset_BindProgramNV, BindProgramARB@8, BindProgramNV, BindProgramNV@8)
- GL_STUB_ALIAS(DeleteProgramsARB, _gloffset_DeleteProgramsNV, DeleteProgramsARB@8, DeleteProgramsNV, DeleteProgramsNV@8)
- GL_STUB_ALIAS(GenProgramsARB, _gloffset_GenProgramsNV, GenProgramsARB@8, GenProgramsNV, GenProgramsNV@8)
- GL_STUB_ALIAS(GetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV, GetVertexAttribPointervARB@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12)
- GL_STUB_ALIAS(IsProgramARB, _gloffset_IsProgramNV, IsProgramARB@4, IsProgramNV, IsProgramNV@4)
- GL_STUB_ALIAS(PointParameteri, _gloffset_PointParameteriNV, PointParameteri@8, PointParameteriNV, PointParameteriNV@8)
- GL_STUB_ALIAS(PointParameteriv, _gloffset_PointParameterivNV, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8)
- GL_STUB_ALIAS(MultiDrawArrays, _gloffset_MultiDrawArraysEXT, MultiDrawArrays@16, MultiDrawArraysEXT, MultiDrawArraysEXT@16)
- GL_STUB_ALIAS(MultiDrawElements, _gloffset_MultiDrawElementsEXT, MultiDrawElements@20, MultiDrawElementsEXT, MultiDrawElementsEXT@20)
- GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8)
- GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16)
- GL_STUB_ALIAS(BufferSubData, _gloffset_BufferSubDataARB, BufferSubData@16, BufferSubDataARB, BufferSubDataARB@16)
- GL_STUB_ALIAS(DeleteBuffers, _gloffset_DeleteBuffersARB, DeleteBuffers@8, DeleteBuffersARB, DeleteBuffersARB@8)
- GL_STUB_ALIAS(GenBuffers, _gloffset_GenBuffersARB, GenBuffers@8, GenBuffersARB, GenBuffersARB@8)
- GL_STUB_ALIAS(GetBufferParameteriv, _gloffset_GetBufferParameterivARB, GetBufferParameteriv@12, GetBufferParameterivARB, GetBufferParameterivARB@12)
- GL_STUB_ALIAS(GetBufferPointerv, _gloffset_GetBufferPointervARB, GetBufferPointerv@12, GetBufferPointervARB, GetBufferPointervARB@12)
- GL_STUB_ALIAS(GetBufferSubData, _gloffset_GetBufferSubDataARB, GetBufferSubData@16, GetBufferSubDataARB, GetBufferSubDataARB@16)
- GL_STUB_ALIAS(IsBuffer, _gloffset_IsBufferARB, IsBuffer@4, IsBufferARB, IsBufferARB@4)
- GL_STUB_ALIAS(MapBuffer, _gloffset_MapBufferARB, MapBuffer@8, MapBufferARB, MapBufferARB@8)
- GL_STUB_ALIAS(UnmapBuffer, _gloffset_UnmapBufferARB, UnmapBuffer@4, UnmapBufferARB, UnmapBufferARB@4)
- GL_STUB_ALIAS(GenQueries, _gloffset_GenQueriesARB, GenQueries@8, GenQueriesARB, GenQueriesARB@8)
- GL_STUB_ALIAS(DeleteQueries, _gloffset_DeleteQueriesARB, DeleteQueries@8, DeleteQueriesARB, DeleteQueriesARB@8)
- GL_STUB_ALIAS(IsQuery, _gloffset_IsQueryARB, IsQuery@4, IsQueryARB, IsQueryARB@4)
- GL_STUB_ALIAS(BeginQuery, _gloffset_BeginQueryARB, BeginQuery@8, BeginQueryARB, BeginQueryARB@8)
- GL_STUB_ALIAS(EndQuery, _gloffset_EndQueryARB, EndQuery@4, EndQueryARB, EndQueryARB@4)
- GL_STUB_ALIAS(GetQueryiv, _gloffset_GetQueryivARB, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12)
- GL_STUB_ALIAS(GetQueryObjectiv, _gloffset_GetQueryObjectivARB, GetQueryObjectiv@12, GetQueryObjectivARB, GetQueryObjectivARB@12)
- GL_STUB_ALIAS(GetQueryObjectuiv, _gloffset_GetQueryObjectuivARB, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12)
- GL_STUB_ALIAS(BlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT, BlendEquationSeparateATI@8, BlendEquationSeparateEXT, BlendEquationSeparateEXT@8)
-
- GLOBL GLNAME(gl_dispatch_functions_end)
- HIDDEN(GLNAME(gl_dispatch_functions_end))
- ALIGNTEXT16
-GLNAME(gl_dispatch_functions_end):
-
-#if defined(GLX_USE_TLS) && defined(__linux__)
- .section ".note.ABI-tag", "a"
- .p2align 2
- .long 1f - 0f /* name length */
- .long 3f - 2f /* data length */
- .long 1 /* note length */
-0: .asciz "GNU" /* vendor name */
-1: .p2align 2
-2: .long 0 /* note data: the ABI tag */
- .long 2,4,20 /* Minimum kernel version w/TLS */
-3: .p2align 2 /* pad out section */
-#endif /* GLX_USE_TLS */
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/mmx.h b/nx-X11/extras/Mesa/src/mesa/x86/mmx.h
deleted file mode 100644
index b3a096725..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/mmx.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $Id: mmx.h,v 1.1.1.1 2004/06/16 09:19:36 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef ASM_MMX_H
-#define ASM_MMX_H
-
-extern void _ASMAPI
-_mesa_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
-
-extern void _ASMAPI
-_mesa_mmx_blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
-
-extern void _ASMAPI
-_mesa_mmx_blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
-
-extern void _ASMAPI
-_mesa_mmx_blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
-
-extern void _ASMAPI
-_mesa_mmx_blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLubyte rgba[][4], const GLubyte dest[][4] );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/mmx_blend.S b/nx-X11/extras/Mesa/src/mesa/x86/mmx_blend.S
deleted file mode 100644
index f7326cdbe..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/mmx_blend.S
+++ /dev/null
@@ -1,366 +0,0 @@
-
-/*
- * Written by José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-
-#ifdef USE_MMX_ASM
-#include "matypes.h"
-
-/* integer multiplication - alpha plus one
- *
- * makes the following approximation to the division (Sree)
- *
- * rgb*a/255 ~= (rgb*(a+1)) >> 256
- *
- * which is the fastest method that satisfies the following OpenGL criteria
- *
- * 0*0 = 0 and 255*255 = 255
- *
- * note that MX1 is a register with 0xffffffffffffffff constant which can be easily obtained making
- *
- * PCMPEQW ( MX1, MX1 )
- */
-#define GMB_MULT_AP1( MP1, MA1, MP2, MA2, MX1 ) \
- PSUBW ( MX1, MA1 ) /* a1 + 1 | a1 + 1 | a1 + 1 | a1 + 1 */ ;\
- PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\
- ;\
-TWO(PSUBW ( MX1, MA2 )) /* a2 + 1 | a2 + 1 | a2 + 1 | a2 + 1 */ ;\
-TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\
- ;\
- PSRLW ( CONST(8), MA1 ) /* t1 >> 8 ~= t1/255 */ ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 ~= t2/255 */
-
-
-/* integer multiplication - geometric series
- *
- * takes the geometric series approximation to the division
- *
- * t/255 = (t >> 8) + (t >> 16) + (t >> 24) ..
- *
- * in this case just the first two terms to fit in 16bit arithmetic
- *
- * t/255 ~= (t + (t >> 8)) >> 8
- *
- * note that just by itself it doesn't satisfies the OpenGL criteria, as 255*255 = 254,
- * so the special case a = 255 must be accounted or roundoff must be used
- */
-#define GMB_MULT_GS( MP1, MA1, MP2, MA2 ) \
- PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\
-TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\
- ;\
- MOVQ ( MA1, MP1 ) ;\
- PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
- ;\
-TWO(MOVQ ( MA2, MP2 )) ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
- ;\
- PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
- PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
- ;\
-TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
-
-
-/* integer multiplication - geometric series plus rounding
- *
- * when using a geometric series division instead of truncating the result
- * use roundoff in the approximation (Jim Blinn)
- *
- * t = rgb*a + 0x80
- *
- * achieving the exact results
- *
- * note that M80 is register with the 0x0080008000800080 constant
- */
-#define GMB_MULT_GSR( MP1, MA1, MP2, MA2, M80 ) \
- PMULLW ( MP1, MA1 ) /* t1 = p1*a1 */ ;\
- PADDW ( M80, MA1 ) /* t1 += 0x80 */ ;\
- ;\
-TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\
-TWO(PADDW ( M80, MA2 )) /* t2 += 0x80 */ ;\
- ;\
- MOVQ ( MA1, MP1 ) ;\
- PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
- ;\
-TWO(MOVQ ( MA2, MP2 )) ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
- ;\
- PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
- PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
- ;\
-TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
-
-
-/* linear interpolation - geometric series
- */
-#define GMB_LERP_GS( MP1, MQ1, MA1, MP2, MQ2, MA2) \
- PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\
- PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\
- PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\
- ;\
-TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\
-TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\
-TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\
- ;\
- MOVQ ( MA1, MP1 ) ;\
- PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
- ;\
-TWO(MOVQ ( MA2, MP2 )) ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
- ;\
- PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
-TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
- ;\
- PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\
-TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\
- ;\
- PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
-
-
-/* linear interpolation - geometric series with roundoff
- *
- * this is a generalization of Blinn's formula to signed arithmetic
- *
- * note that M80 is a register with the 0x0080008000800080 constant
- */
-#define GMB_LERP_GSR( MP1, MQ1, MA1, MP2, MQ2, MA2, M80) \
- PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\
- PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\
- PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\
- ;\
-TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\
-TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\
-TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\
- ;\
- PSRLW ( CONST(15), MP1 ) /* q1 > p1 ? 1 : 0 */ ;\
-TWO(PSRLW ( CONST(15), MP2 )) /* q2 > q2 ? 1 : 0 */ ;\
- ;\
- PSLLW ( CONST(8), MP1 ) /* q1 > p1 ? 0x100 : 0 */ ;\
-TWO(PSLLW ( CONST(8), MP2 )) /* q2 > q2 ? 0x100 : 0 */ ;\
- ;\
- PSUBW ( MP1, MA1 ) /* t1 -=? 0x100 */ ;\
-TWO(PSUBW ( MP2, MA2 )) /* t2 -=? 0x100 */ ;\
- ;\
- PADDW ( M80, MA1 ) /* t1 += 0x80 */ ;\
-TWO(PADDW ( M80, MA2 )) /* t2 += 0x80 */ ;\
- ;\
- MOVQ ( MA1, MP1 ) ;\
- PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
- ;\
-TWO(MOVQ ( MA2, MP2 )) ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
- ;\
- PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
-TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
- ;\
- PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\
-TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\
- ;\
- PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
-
-
-/* linear interpolation - geometric series with correction
- *
- * instead of the roundoff this adds a small correction to satisfy the OpenGL criteria
- *
- * t/255 ~= (t + (t >> 8) + (t >> 15)) >> 8
- *
- * note that although is faster than rounding off it doesn't give always the exact results
- */
-#define GMB_LERP_GSC( MP1, MQ1, MA1, MP2, MQ2, MA2) \
- PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\
- PSLLW ( CONST(8), MQ1 ) /* q1 << 8 */ ;\
- PMULLW ( MP1, MA1 ) /* t1 = (q1 - p1)*pa1 */ ;\
- ;\
-TWO(PSUBW ( MQ2, MP2 )) /* pa2 - qa2 | pb2 - qb2 | pg2 - qg2 | pr2 - qr2 */ ;\
-TWO(PSLLW ( CONST(8), MQ2 )) /* q2 << 8 */ ;\
-TWO(PMULLW ( MP2, MA2 )) /* t2 = (q2 - p2)*pa2 */ ;\
- ;\
- MOVQ ( MA1, MP1 ) ;\
- PSRLW ( CONST(8), MA1 ) /* t1 >> 8 */ ;\
- ;\
-TWO(MOVQ ( MA2, MP2 )) ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 */ ;\
- ;\
- PADDW ( MA1, MP1 ) /* t1 + (t1 >> 8) ~= (t1/255) << 8 */ ;\
- PSRLW ( CONST(7), MA1 ) /* t1 >> 15 */ ;\
- ;\
-TWO(PADDW ( MA2, MP2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 */ ;\
-TWO(PSRLW ( CONST(7), MA2 )) /* t2 >> 15 */ ;\
- ;\
- PADDW ( MP1, MA1 ) /* t1 + (t1 >> 8) + (t1 >>15) ~= (t1/255) << 8 */ ;\
-TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) + (t2 >>15) ~= (t2/255) << 8 */ ;\
- ;\
- PADDW ( MQ1, MA1 ) /* (t1/255 + q1) << 8 */ ;\
-TWO(PADDW ( MQ2, MA2 )) /* (t2/255 + q2) << 8 */ ;\
- ;\
- PSRLW ( CONST(8), MA1 ) /* sa1 | sb1 | sg1 | sr1 */ ;\
-TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */
-
-
-/* common blending setup code
- *
- * note that M00 is a register with 0x0000000000000000 constant which can be easily obtained making
- *
- * PXOR ( M00, M00 )
- */
-#define GMB_LOAD(rgba, dest, MPP, MQQ) \
-ONE(MOVD ( REGIND(rgba), MPP )) /* | | | | qa1 | qb1 | qg1 | qr1 */ ;\
-ONE(MOVD ( REGIND(dest), MQQ )) /* | | | | pa1 | pb1 | pg1 | pr1 */ ;\
- ;\
-TWO(MOVQ ( REGIND(rgba), MPP )) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */ ;\
-TWO(MOVQ ( REGIND(dest), MQQ )) /* pa2 | pb2 | pg2 | pr2 | pa1 | pb1 | pg1 | pr1 */
-
-#define GMB_UNPACK(MP1, MQ1, MP2, MQ2, M00) \
-TWO(MOVQ ( MP1, MP2 )) ;\
-TWO(MOVQ ( MQ1, MQ2 )) ;\
- ;\
- PUNPCKLBW ( M00, MQ1 ) /* qa1 | qb1 | qg1 | qr1 */ ;\
-TWO(PUNPCKHBW ( M00, MQ2 )) /* qa2 | qb2 | qg2 | qr2 */ ;\
- PUNPCKLBW ( M00, MP1 ) /* pa1 | pb1 | pg1 | pr1 */ ;\
-TWO(PUNPCKHBW ( M00, MP2 )) /* pa2 | pb2 | pg2 | pr2 */
-
-#define GMB_ALPHA(MP1, MA1, MP2, MA2) \
- MOVQ ( MP1, MA1 ) ;\
-TWO(MOVQ ( MP2, MA2 )) ;\
- ;\
- PUNPCKHWD ( MA1, MA1 ) /* pa1 | pa1 | | */ ;\
-TWO(PUNPCKHWD ( MA2, MA2 )) /* pa2 | pa2 | | */ ;\
- PUNPCKHDQ ( MA1, MA1 ) /* pa1 | pa1 | pa1 | pa1 */ ;\
-TWO(PUNPCKHDQ ( MA2, MA2 )) /* pa2 | pa2 | pa2 | pa2 */
-
-#define GMB_PACK( MS1, MS2 ) \
- PACKUSWB ( MS2, MS1 ) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ ;\
-
-#define GMB_STORE(rgba, MSS ) \
-ONE(MOVD ( MSS, REGIND(rgba) )) /* | | | | sa1 | sb1 | sg1 | sr1 */ ;\
-TWO(MOVQ ( MSS, REGIND(rgba) )) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */
-
-
- SEG_DATA
-
-ALIGNDATA8
-const_0080:
- D_LONG 0x00800080, 0x00800080
-
-const_80:
- D_LONG 0x80808080, 0x80808080
-
- SEG_TEXT
-
-
-/* Blend transparency function
- */
-
-#define TAG(x) CONCAT(x,_transparency)
-#define LLTAG(x) LLBL2(x,_transparency)
-
-#define INIT \
- PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */
-
-#define MAIN( rgba, dest ) \
- GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
- GMB_UNPACK( MM1, MM2, MM4, MM5, MM0 ) ;\
- GMB_ALPHA( MM1, MM3, MM4, MM6 ) ;\
- GMB_LERP_GSC( MM1, MM2, MM3, MM4, MM5, MM6 ) ;\
- GMB_PACK( MM3, MM6 ) ;\
- GMB_STORE( rgba, MM3 )
-
-#include "mmx_blendtmp.h"
-
-
-/* Blend add function
- *
- * FIXME: Add some loop unrolling here...
- */
-
-#define TAG(x) CONCAT(x,_add)
-#define LLTAG(x) LLBL2(x,_add)
-
-#define INIT
-
-#define MAIN( rgba, dest ) \
-ONE(MOVD ( REGIND(rgba), MM1 )) /* | | | | qa1 | qb1 | qg1 | qr1 */ ;\
-ONE(MOVD ( REGIND(dest), MM2 )) /* | | | | pa1 | pb1 | pg1 | pr1 */ ;\
-ONE(PADDUSB ( MM2, MM1 )) ;\
-ONE(MOVD ( MM1, REGIND(rgba) )) /* | | | | sa1 | sb1 | sg1 | sr1 */ ;\
- ;\
-TWO(MOVQ ( REGIND(rgba), MM1 )) /* qa2 | qb2 | qg2 | qr2 | qa1 | qb1 | qg1 | qr1 */ ;\
-TWO(PADDUSB ( REGIND(dest), MM1 )) /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */ ;\
-TWO(MOVQ ( MM1, REGIND(rgba) ))
-
-#include "mmx_blendtmp.h"
-
-
-/* Blend min function
- */
-
-#define TAG(x) CONCAT(x,_min)
-#define LLTAG(x) LLBL2(x,_min)
-
-#define INIT \
- MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
-
-#define MAIN( rgba, dest ) \
- GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
- MOVQ ( MM1, MM3 ) ;\
- MOVQ ( MM2, MM4 ) ;\
- PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\
- PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\
- PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\
- PAND ( MM4, MM1 ) /* q > p ? p : 0 */ ;\
- PANDN ( MM2, MM4 ) /* q > p ? 0 : q */ ;\
- POR ( MM1, MM4 ) /* q > p ? p : q */ ;\
- GMB_STORE( rgba, MM4 )
-
-#include "mmx_blendtmp.h"
-
-
-/* Blend max function
- */
-
-#define TAG(x) CONCAT(x,_max)
-#define LLTAG(x) LLBL2(x,_max)
-
-#define INIT \
- MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
-
-#define MAIN( rgba, dest ) \
- GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
- MOVQ ( MM1, MM3 ) ;\
- MOVQ ( MM2, MM4 ) ;\
- PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\
- PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\
- PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\
- PAND ( MM4, MM2 ) /* q > p ? q : 0 */ ;\
- PANDN ( MM1, MM4 ) /* q > p ? 0 : p */ ;\
- POR ( MM2, MM4 ) /* q > p ? p : q */ ;\
- GMB_STORE( rgba, MM4 )
-
-#include "mmx_blendtmp.h"
-
-
-/* Blend modulate function
- */
-
-#define TAG(x) CONCAT(x,_modulate)
-#define LLTAG(x) LLBL2(x,_modulate)
-
-#define INIT \
- PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */ ;\
- MOVQ ( CONTENT(const_0080), MM7 ) /* 0x0080 | 0x0080 | 0x0080 | 0x0080 */
-
-#define MAIN( rgba, dest ) \
- GMB_LOAD( rgba, dest, MM1, MM2 ) ;\
- GMB_UNPACK( MM1, MM2, MM4, MM5, MM0 ) ;\
- GMB_MULT_GSR( MM1, MM2, MM4, MM5, MM7 ) ;\
- GMB_PACK( MM2, MM5 ) ;\
- GMB_STORE( rgba, MM2 )
-
-#include "mmx_blendtmp.h"
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/mmx_blendtmp.h b/nx-X11/extras/Mesa/src/mesa/x86/mmx_blendtmp.h
deleted file mode 100644
index c2fdeb62b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/mmx_blendtmp.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Written by José Fonseca <j_r_fonseca@yahoo.co.uk>
- */
-
-
-/*
- * void _mesa_mmx_blend( GLcontext *ctx,
- * GLuint n,
- * const GLubyte mask[],
- * GLchan rgba[][4],
- * CONST GLchan dest[][4] )
- *
- */
-ALIGNTEXT16
-GLOBL GLNAME( TAG(_mesa_mmx_blend) )
-HIDDEN( TAG(_mesa_mmx_blend) )
-GLNAME( TAG(_mesa_mmx_blend) ):
-
- PUSH_L ( EBP )
- MOV_L ( ESP, EBP )
- PUSH_L ( ESI )
- PUSH_L ( EDI )
- PUSH_L ( EBX )
-
- MOV_L ( REGOFF(12, EBP), ECX ) /* n */
- CMP_L ( CONST(0), ECX)
- JE ( LLTAG(GMB_return) )
-
- MOV_L ( REGOFF(16, EBP), EBX ) /* mask */
- MOV_L ( REGOFF(20, EBP), EDI ) /* rgba */
- MOV_L ( REGOFF(24, EBP), ESI ) /* dest */
-
- INIT
-
- TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */
- JZ ( LLTAG(GMB_align_end) )
-
- CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
- JE ( LLTAG(GMB_align_continue) )
-
- /* runin */
-#define ONE(x) x
-#define TWO(x)
- MAIN ( EDI, ESI )
-#undef ONE
-#undef TWO
-
-LLTAG(GMB_align_continue):
-
- DEC_L ( ECX ) /* n -= 1 */
- INC_L ( EBX ) /* mask += 1 */
- ADD_L ( CONST(4), EDI ) /* rgba += 1 */
- ADD_L ( CONST(4), ESI ) /* dest += 1 */
-
-LLTAG(GMB_align_end):
-
- CMP_L ( CONST(2), ECX)
- JB ( LLTAG(GMB_loop_end) )
-
-ALIGNTEXT16
-LLTAG(GMB_loop_begin):
-
- CMP_W ( CONST(0), REGIND(EBX) ) /* *mask == 0 && *(mask + 1) == 0 */
- JE ( LLTAG(GMB_loop_continue) )
-
- /* main loop */
-#define ONE(x)
-#define TWO(x) x
- MAIN ( EDI, ESI )
-#undef ONE
-#undef TWO
-
-LLTAG(GMB_loop_continue):
-
- DEC_L ( ECX )
- DEC_L ( ECX ) /* n -= 2 */
- ADD_L ( CONST(2), EBX ) /* mask += 2 */
- ADD_L ( CONST(8), EDI ) /* rgba += 2 */
- ADD_L ( CONST(8), ESI ) /* dest += 2 */
- CMP_L ( CONST(2), ECX )
- JAE ( LLTAG(GMB_loop_begin) )
-
-LLTAG(GMB_loop_end):
-
- CMP_L ( CONST(1), ECX )
- JB ( LLTAG(GMB_done) )
-
- CMP_B ( CONST(0), REGIND(EBX) ) /* *mask == 0 */
- JE ( LLTAG(GMB_done) )
-
- /* runout */
-#define ONE(x) x
-#define TWO(x)
- MAIN ( EDI, ESI )
-#undef ONE
-#undef TWO
-
-LLTAG(GMB_done):
-
- EMMS
-
-LLTAG(GMB_return):
-
- POP_L ( EBX )
- POP_L ( EDI )
- POP_L ( ESI )
- MOV_L ( EBP, ESP )
- POP_L ( EBP )
- RET
-
-#undef TAG
-#undef LLTAG
-#undef INIT
-#undef MAIN
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/norm_args.h b/nx-X11/extras/Mesa/src/mesa/x86/norm_args.h
deleted file mode 100644
index cb18fba9b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/norm_args.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $Id: norm_args.h,v 1.1.1.1 2004/06/16 09:19:36 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Normal transform function interface for assembly code. Simply define
- * FRAME_OFFSET to the number of bytes pushed onto the stack before
- * using the ARG_* argument macros.
- *
- * Gareth Hughes
- */
-
-#ifndef __NORM_ARGS_H__
-#define __NORM_ARGS_H__
-
-/* Offsets for normal_func arguments
- *
- * typedef void (*normal_func)( CONST GLmatrix *mat,
- * GLfloat scale,
- * CONST GLvector4f *in,
- * CONST GLfloat lengths[],
- * GLvector4f *dest );
- */
-#define OFFSET_MAT 4
-#define OFFSET_SCALE 8
-#define OFFSET_IN 12
-#define OFFSET_LENGTHS 16
-#define OFFSET_DEST 20
-
-#define ARG_MAT REGOFF(FRAME_OFFSET+OFFSET_MAT, ESP)
-#define ARG_SCALE REGOFF(FRAME_OFFSET+OFFSET_SCALE, ESP)
-#define ARG_IN REGOFF(FRAME_OFFSET+OFFSET_IN, ESP)
-#define ARG_LENGTHS REGOFF(FRAME_OFFSET+OFFSET_LENGTHS, ESP)
-#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.S b/nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.S
deleted file mode 100644
index 6b8036e5b..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.S
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 read_rgba_span_x86.S
- * Optimized routines to transfer pixel data from the framebuffer to a
- * buffer in main memory.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
- .file "read_rgba_span_x86.S"
-#if !defined(__DJGPP__) && !defined(__MINGW32__) /* this one cries for assyntax.h */
- .section .rodata
- .align 16
- .type mask, @object
- .size mask, 32
-mask:
- .long 0xff00ff00
- .long 0xff00ff00
- .long 0xff00ff00
- .long 0xff00ff00
- .long 0x00ff0000
- .long 0x00ff0000
- .long 0x00ff0000
- .long 0x00ff0000
-
-
-/* I implemented these as macros because the appear in quite a few places,
- * and I've tweaked them a number of times. I got tired of changing every
- * place they appear. :)
- */
-
-#define DO_ONE_PIXEL() \
- movl (%ebx), %eax ; \
- addl $4, %ebx ; \
- bswap %eax /* ARGB -> BGRA */ ; \
- rorl $8, %eax /* BGRA -> ABGR */ ; \
- movl %eax, (%ecx) /* ABGR -> R, G, B, A */ ; \
- addl $4, %ecx
-
-#define DO_ONE_LAST_PIXEL() \
- movl (%ebx), %eax ; \
- bswap %eax /* ARGB -> BGRA */ ; \
- rorl $8, %eax /* BGRA -> ABGR */ ; \
- movl %eax, (%ecx) /* ABGR -> R, G, B, A */ ; \
-
-
-/**
- * MMX optimized version of the BGRA8888_REV to RGBA copy routine.
- *
- * \warning
- * This function assumes that the caller will issue the EMMS instruction
- * at the correct places.
- */
-
-.globl _generic_read_RGBA_span_BGRA8888_REV_MMX
-.hidden _generic_read_RGBA_span_BGRA8888_REV_MMX
- .type _generic_read_RGBA_span_BGRA8888_REV_MMX, @function
-_generic_read_RGBA_span_BGRA8888_REV_MMX:
- pushl %ebx
-
-#ifdef USE_INNER_EMMS
- emms
-#endif
- movq mask, %mm1
- movq mask+16, %mm2
-
- movl 8(%esp), %ebx /* source pointer */
- movl 16(%esp), %edx /* number of pixels to copy */
- movl 12(%esp), %ecx /* destination pointer */
-
- testl %edx, %edx
- jle .L20 /* Bail if there's nothing to do. */
-
- movl %ebx, %eax
-
- negl %eax
- sarl $2, %eax
- andl $1, %eax
- je .L17
-
- subl %eax, %edx
- DO_ONE_PIXEL()
-.L17:
-
- /* Would it be faster to unroll this loop once and process 4 pixels
- * per pass, instead of just two?
- */
-
- movl %edx, %eax
- shrl %eax
- jmp .L18
-.L19:
- movq (%ebx), %mm0
- addl $8, %ebx
-
- /* These 9 instructions do what PSHUFB (if there were such an
- * instruction) could do in 1. :(
- */
-
- movq %mm0, %mm3
- movq %mm0, %mm4
-
- pand %mm2, %mm3
- psllq $16, %mm4
- psrlq $16, %mm3
- pand %mm2, %mm4
-
- pand %mm1, %mm0
- por %mm4, %mm3
- por %mm3, %mm0
-
- movq %mm0, (%ecx)
- addl $8, %ecx
- subl $1, %eax
-.L18:
- jne .L19
-
-#ifdef USE_INNER_EMMS
- emms
-#endif
-
- /* At this point there are either 1 or 0 pixels remaining to be
- * converted. Convert the last pixel, if needed.
- */
-
- testl $1, %edx
- je .L20
-
- DO_ONE_LAST_PIXEL()
-
-.L20:
- popl %ebx
- ret
- .size _generic_read_RGBA_span_BGRA8888_REV_MMX, .-_generic_read_RGBA_span_BGRA8888_REV_MMX
-
-
-/**
- * SSE optimized version of the BGRA8888_REV to RGBA copy routine. SSE
- * instructions are only actually used to read data from the framebuffer.
- * In practice, the speed-up is pretty small.
- *
- * \todo
- * Do some more testing and determine if there's any reason to have this
- * function in addition to the MMX version.
- *
- * \warning
- * This function assumes that the caller will issue the EMMS instruction
- * at the correct places.
- */
-
-.globl _generic_read_RGBA_span_BGRA8888_REV_SSE
-.hidden _generic_read_RGBA_span_BGRA8888_REV_SSE
- .type _generic_read_RGBA_span_BGRA8888_REV_SSE, @function
-_generic_read_RGBA_span_BGRA8888_REV_SSE:
- pushl %esi
- pushl %ebx
- pushl %ebp
-
-#ifdef USE_INNER_EMMS
- emms
-#endif
- movq mask, %mm1
- movq mask+16, %mm2
-
- movl 16(%esp), %ebx /* source pointer */
- movl 24(%esp), %edx /* number of pixels to copy */
- movl 20(%esp), %ecx /* destination pointer */
-
- testl %edx, %edx
- jle .L35 /* Bail if there's nothing to do. */
-
- movl %esp, %ebp
- subl $16, %esp
- andl $0xfffffff0, %esp
-
- movl %ebx, %eax
- movl %edx, %esi
-
- negl %eax
- andl $15, %eax
- sarl $2, %eax
- cmpl %edx, %eax
- cmovle %eax, %esi
-
- subl %esi, %edx
-
- testl $1, %esi
- je .L32
-
- DO_ONE_PIXEL()
-.L32:
-
- testl $2, %esi
- je .L31
-
- movq (%ebx), %mm0
- addl $8, %ebx
-
- movq %mm0, %mm3
- movq %mm0, %mm4
-
- pand %mm2, %mm3
- psllq $16, %mm4
- psrlq $16, %mm3
- pand %mm2, %mm4
-
- pand %mm1, %mm0
- por %mm4, %mm3
- por %mm3, %mm0
-
- movq %mm0, (%ecx)
- addl $8, %ecx
-.L31:
-
- movl %edx, %eax
- shrl $2, %eax
- jmp .L33
-.L34:
- movaps (%ebx), %xmm0
- addl $16, %ebx
-
- /* This would be so much better if we could just move directly from
- * an SSE register to an MMX register. Unfortunately, that
- * functionality wasn't introduced until SSE2 with the MOVDQ2Q
- * instruction.
- */
-
- movaps %xmm0, (%esp)
- movq (%esp), %mm0
- movq 8(%esp), %mm5
-
- movq %mm0, %mm3
- movq %mm0, %mm4
- movq %mm5, %mm6
- movq %mm5, %mm7
-
- pand %mm2, %mm3
- pand %mm2, %mm6
-
- psllq $16, %mm4
- psllq $16, %mm7
-
- psrlq $16, %mm3
- psrlq $16, %mm6
-
- pand %mm2, %mm4
- pand %mm2, %mm7
-
- pand %mm1, %mm0
- pand %mm1, %mm5
-
- por %mm4, %mm3
- por %mm7, %mm6
-
- por %mm3, %mm0
- por %mm6, %mm5
-
- movq %mm0, (%ecx)
- movq %mm5, 8(%ecx)
- addl $16, %ecx
-
- subl $1, %eax
-.L33:
- jne .L34
-
-#ifdef USE_INNER_EMMS
- emms
-#endif
- movl %ebp, %esp
-
- /* At this point there are either [0, 3] pixels remaining to be
- * converted.
- */
-
- testl $2, %edx
- je .L36
-
- movq (%ebx), %mm0
- addl $8, %ebx
-
- movq %mm0, %mm3
- movq %mm0, %mm4
-
- pand %mm2, %mm3
- psllq $16, %mm4
- psrlq $16, %mm3
- pand %mm2, %mm4
-
- pand %mm1, %mm0
- por %mm4, %mm3
- por %mm3, %mm0
-
- movq %mm0, (%ecx)
- addl $8, %ecx
-.L36:
-
- testl $1, %edx
- je .L35
-
- DO_ONE_LAST_PIXEL()
-.L35:
- popl %ebp
- popl %ebx
- popl %esi
- ret
- .size _generic_read_RGBA_span_BGRA8888_REV_SSE, .-_generic_read_RGBA_span_BGRA8888_REV_SSE
-
-
-/**
- * SSE2 optimized version of the BGRA8888_REV to RGBA copy routine.
- */
-
- .text
-.globl _generic_read_RGBA_span_BGRA8888_REV_SSE2
-.hidden _generic_read_RGBA_span_BGRA8888_REV_SSE2
- .type _generic_read_RGBA_span_BGRA8888_REV_SSE2, @function
-_generic_read_RGBA_span_BGRA8888_REV_SSE2:
- pushl %esi
- pushl %ebx
-
- movdqa mask, %xmm1
- movdqa mask+16, %xmm2
-
- movl 12(%esp), %ebx /* source pointer */
- movl 20(%esp), %edx /* number of pixels to copy */
- movl 16(%esp), %ecx /* destination pointer */
-
- movl %ebx, %eax
- movl %edx, %esi
-
- testl %edx, %edx
- jle .L46 /* Bail if there's nothing to do. */
-
- /* If the source pointer isn't a multiple of 16 we have to process
- * a few pixels the "slow" way to get the address aligned for
- * the SSE fetch intsructions.
- */
-
- negl %eax
- andl $15, %eax
- sarl $2, %eax
-
- cmpl %edx, %eax
- cmovbe %eax, %esi
- subl %esi, %edx
-
- testl $1, %esi
- je .L41
-
- DO_ONE_PIXEL()
-.L41:
- testl $2, %esi
- je .L40
-
- movq (%ebx), %xmm0
- addl $8, %ebx
-
- movdqa %xmm0, %xmm3
- movdqa %xmm0, %xmm4
- andps %xmm1, %xmm0
-
- andps %xmm2, %xmm3
- pslldq $2, %xmm4
- psrldq $2, %xmm3
- andps %xmm2, %xmm4
-
- orps %xmm4, %xmm3
- orps %xmm3, %xmm0
-
- movq %xmm0, (%ecx)
- addl $8, %ecx
-.L40:
-
- /* Would it be worth having a specialized version of this loop for
- * the case where the destination is 16-byte aligned? That version
- * would be identical except that it could use movedqa instead of
- * movdqu.
- */
-
- movl %edx, %eax
- shrl $2, %eax
- jmp .L42
-.L43:
- movdqa (%ebx), %xmm0
- addl $16, %ebx
-
- movdqa %xmm0, %xmm3
- movdqa %xmm0, %xmm4
- andps %xmm1, %xmm0
-
- andps %xmm2, %xmm3
- pslldq $2, %xmm4
- psrldq $2, %xmm3
- andps %xmm2, %xmm4
-
- orps %xmm4, %xmm3
- orps %xmm3, %xmm0
-
- movdqu %xmm0, (%ecx)
- addl $16, %ecx
- subl $1, %eax
-.L42:
- jne .L43
-
-
- /* There may be upto 3 pixels remaining to be copied. Take care
- * of them now. We do the 2 pixel case first because the data
- * will be aligned.
- */
-
- testl $2, %edx
- je .L47
-
- movq (%ebx), %xmm0
-
- movdqa %xmm0, %xmm3
- movdqa %xmm0, %xmm4
- andps %xmm1, %xmm0
-
- andps %xmm2, %xmm3
- pslldq $2, %xmm4
- psrldq $2, %xmm3
- andps %xmm2, %xmm4
-
- orps %xmm4, %xmm3
- orps %xmm3, %xmm0
-
- movq %xmm0, (%ecx)
-.L47:
-
- testl $1, %edx
- je .L46
-
- DO_ONE_LAST_PIXEL()
-.L46:
-
- popl %ebx
- popl %esi
- ret
- .size _generic_read_RGBA_span_BGRA8888_REV_SSE2, .-_generic_read_RGBA_span_BGRA8888_REV_SSE2
-
-
-
- .section .rodata
-
- .align 16
-mask_565:
- .word 0xf800
- .word 0x07e0
- .word 0x001f
- .word 0x0000
-
-/* Setting SCALE_ADJUST to 5 gives a perfect match with the classic C
- * implementation in Mesa. Setting SCALE_ADJUST to 0 is slightly faster but
- * at a small cost to accuracy.
- */
-
-#define SCALE_ADJUST 5
-#if SCALE_ADJUST == 5
-prescale:
- .word 0x0001
- .word 0x0010
- .word 0x0200
- .word 0x0000
-
-scale:
- .word 0x20e8 /* (0x00ff0000 / 0x000007c0) + 1 */
- .word 0x40c5 /* (0x00ff0000 / 0x000003f0) + 1 */
- .word 0x839d /* (0x00ff0000 / 0x000001f0) + 1 */
- .word 0x0000
-#elif SCALE_ADJUST == 0
-prescale:
- .word 0x0001
- .word 0x0020
- .word 0x0800
- .word 0x0000
-
-scale:
- .word 0x0108 /* (0x00ff0000 / 0x0000f800) + 1 */
- .word 0x0104 /* (0x00ff0000 / 0x0000fc00) + 1 */
- .word 0x0108 /* (0x00ff0000 / 0x0000f800) + 1 */
- .word 0x0000
-#else
-#error SCALE_ADJUST must either be 5 or 0.
-#endif
-
-
-alpha: .long 0x00000000
- .long 0x00ff0000
-
-/**
- * MMX optimized version of the RGB565 to RGBA copy routine.
- */
-
- .text
- .globl _generic_read_RGBA_span_RGB565_MMX
- .hidden _generic_read_RGBA_span_RGB565_MMX
- .type _generic_read_RGBA_span_RGB565_MMX, @function
-
-_generic_read_RGBA_span_RGB565_MMX:
-
-#ifdef USE_INNER_EMMS
- emms
-#endif
-
- movl 4(%esp), %eax /* source pointer */
- movl 8(%esp), %edx /* destination pointer */
- movl 12(%esp), %ecx /* number of pixels to copy */
-
- movq mask_565, %mm5
- movq prescale, %mm6
- movq scale, %mm7
-
- sarl $2, %ecx
- jle .L01 /* Bail early if the count is negative. */
- jmp .L02
-
-.L03:
- /* Fetch 4 RGB565 pixels into %mm4. Distribute the first and
- * second pixels into the four words of %mm0 and %mm2.
- */
-
- movq (%eax), %mm4
- addl $8, %eax
-
- pshufw $0x00, %mm4, %mm0
- pshufw $0x55, %mm4, %mm2
-
-
- /* Mask the pixels so that each word of each register contains only
- * one color component.
- */
-
- pand %mm5, %mm0
- pand %mm5, %mm2
-
-
- /* Adjust the component values so that they are as small as possible,
- * but large enough so that we can multiply them by an unsigned 16-bit
- * number and get a value as large as 0x00ff0000.
- */
-
- pmullw %mm6, %mm0
- pmullw %mm6, %mm2
-#if SCALE_ADJUST > 0
- psrlw $SCALE_ADJUST, %mm0
- psrlw $SCALE_ADJUST, %mm2
-#endif
-
- /* Scale the input component values to be on the range
- * [0, 0x00ff0000]. This it the real magic of the whole routine.
- */
-
- pmulhuw %mm7, %mm0
- pmulhuw %mm7, %mm2
-
-
- /* Always set the alpha value to 0xff.
- */
-
- por alpha, %mm0
- por alpha, %mm2
-
-
- /* Pack the 16-bit values to 8-bit values and store the converted
- * pixel data.
- */
-
- packuswb %mm2, %mm0
- movq %mm0, (%edx)
- addl $8, %edx
-
-
-
- pshufw $0xaa, %mm4, %mm0
- pshufw $0xff, %mm4, %mm2
-
- pand %mm5, %mm0
- pand %mm5, %mm2
- pmullw %mm6, %mm0
- pmullw %mm6, %mm2
-#if SCALE_ADJUST > 0
- psrlw $SCALE_ADJUST, %mm0
- psrlw $SCALE_ADJUST, %mm2
-#endif
- pmulhuw %mm7, %mm0
- pmulhuw %mm7, %mm2
-
- por alpha, %mm0
- por alpha, %mm2
-
- packuswb %mm2, %mm0
-
- movq %mm0, (%edx)
- addl $8, %edx
-
- subl $1, %ecx
-.L02:
- jne .L03
-
-
- /* At this point there can be at most 3 pixels left to process. If
- * there is either 2 or 3 left, process 2.
- */
-
- movl 12(%esp), %ecx
- testl $0x02, %ecx
- je .L04
-
- movd (%eax), %mm4
- addl $4, %eax
-
- pshufw $0x00, %mm4, %mm0
- pshufw $0x55, %mm4, %mm2
-
- pand %mm5, %mm0
- pand %mm5, %mm2
- pmullw %mm6, %mm0
- pmullw %mm6, %mm2
-#if SCALE_ADJUST > 0
- psrlw $SCALE_ADJUST, %mm0
- psrlw $SCALE_ADJUST, %mm2
-#endif
- pmulhuw %mm7, %mm0
- pmulhuw %mm7, %mm2
-
- por alpha, %mm0
- por alpha, %mm2
-
- packuswb %mm2, %mm0
-
- movq %mm0, (%edx)
- addl $8, %edx
-
-.L04:
- /* At this point there can be at most 1 pixel left to process.
- * Process it if needed.
- */
-
- testl $0x01, %ecx
- je .L01
-
- movzxw (%eax), %ecx
- movd %ecx, %mm4
-
- pshufw $0x00, %mm4, %mm0
-
- pand %mm5, %mm0
- pmullw %mm6, %mm0
-#if SCALE_ADJUST > 0
- psrlw $SCALE_ADJUST, %mm0
-#endif
- pmulhuw %mm7, %mm0
-
- por alpha, %mm0
-
- packuswb %mm0, %mm0
-
- movd %mm0, (%edx)
-
-.L01:
-#ifdef USE_INNER_EMMS
- emms
-#endif
- ret
-#endif /* !defined(__DJGPP__) && !defined(__MINGW32__) */
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.h b/nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.h
deleted file mode 100644
index 564b1bb0f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/read_rgba_span_x86.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM AND/OR 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 read_rgba_span_x86.h
- *
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#ifndef READ_RGBA_SPAN_X86_H
-#define READ_RGBA_SPAN_X86_H
-
-#if defined(USE_SSE_ASM) || defined(USE_MMX_ASM)
-#include "x86/common_x86_asm.h"
-#endif
-
-#if defined(USE_SSE_ASM)
-extern void _generic_read_RGBA_span_BGRA8888_REV_SSE2( const unsigned char *,
- unsigned char *, unsigned );
-#endif
-
-#if defined(USE_SSE_ASM)
-extern void _generic_read_RGBA_span_BGRA8888_REV_SSE( const unsigned char *,
- unsigned char *, unsigned );
-#endif
-
-#if defined(USE_MMX_ASM)
-extern void _generic_read_RGBA_span_BGRA8888_REV_MMX( const unsigned char *,
- unsigned char *, unsigned );
-
-extern void _generic_read_RGBA_span_RGB565_MMX( const unsigned char *,
- unsigned char *, unsigned );
-#endif
-
-#endif /* READ_RGBA_SPAN_X86_H */
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.c b/nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.c
deleted file mode 100644
index 0c9ffe25f..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.c
+++ /dev/null
@@ -1,997 +0,0 @@
-#if defined(USE_X86_ASM)
-
-#include "imports.h"
-#include "x86sse.h"
-
-#define DISASSEM 0
-#define X86_TWOB 0x0f
-
-/* Emit bytes to the instruction stream:
- */
-static void emit_1b( struct x86_function *p, GLbyte b0 )
-{
- *(GLbyte *)(p->csr++) = b0;
-}
-
-static void emit_1i( struct x86_function *p, GLint i0 )
-{
- *(GLint *)(p->csr) = i0;
- p->csr += 4;
-}
-
-static void disassem( struct x86_function *p, const char *fn )
-{
-#if DISASSEM && 0
- if (fn && fn != p->fn) {
- _mesa_printf("0x%x: %s\n", p->csr, fn);
- p->fn = fn;
- }
-#endif
-}
-
-static void emit_1ub_fn( struct x86_function *p, GLubyte b0, const char *fn )
-{
- disassem(p, fn);
- *(p->csr++) = b0;
-}
-
-static void emit_2ub_fn( struct x86_function *p, GLubyte b0, GLubyte b1, const char *fn )
-{
- disassem(p, fn);
- *(p->csr++) = b0;
- *(p->csr++) = b1;
-}
-
-static void emit_3ub_fn( struct x86_function *p, GLubyte b0, GLubyte b1, GLubyte b2, const char *fn )
-{
- disassem(p, fn);
- *(p->csr++) = b0;
- *(p->csr++) = b1;
- *(p->csr++) = b2;
-}
-
-#define emit_1ub(p, b0) emit_1ub_fn(p, b0, __FUNCTION__)
-#define emit_2ub(p, b0, b1) emit_2ub_fn(p, b0, b1, __FUNCTION__)
-#define emit_3ub(p, b0, b1, b2) emit_3ub_fn(p, b0, b1, b2, __FUNCTION__)
-
-
-
-/* Build a modRM byte + possible displacement. No treatment of SIB
- * indexing. BZZT - no way to encode an absolute address.
- */
-static void emit_modrm( struct x86_function *p,
- struct x86_reg reg,
- struct x86_reg regmem )
-{
- GLubyte val = 0;
-
- assert(reg.mod == mod_REG);
-
- val |= regmem.mod << 6; /* mod field */
- val |= reg.idx << 3; /* reg field */
- val |= regmem.idx; /* r/m field */
-
- emit_1ub_fn(p, val, 0);
-
- /* Oh-oh we've stumbled into the SIB thing.
- */
- if (regmem.file == file_REG32 &&
- regmem.idx == reg_SP) {
- emit_1ub_fn(p, 0x24, 0); /* simplistic! */
- }
-
- switch (regmem.mod) {
- case mod_REG:
- case mod_INDIRECT:
- break;
- case mod_DISP8:
- emit_1b(p, regmem.disp);
- break;
- case mod_DISP32:
- emit_1i(p, regmem.disp);
- break;
- default:
- assert(0);
- break;
- }
-}
-
-
-static void emit_modrm_noreg( struct x86_function *p,
- GLuint op,
- struct x86_reg regmem )
-{
- struct x86_reg dummy = x86_make_reg(file_REG32, op);
- emit_modrm(p, dummy, regmem);
-}
-
-/* Many x86 instructions have two opcodes to cope with the situations
- * where the destination is a register or memory reference
- * respectively. This function selects the correct opcode based on
- * the arguments presented.
- */
-static void emit_op_modrm( struct x86_function *p,
- GLubyte op_dst_is_reg,
- GLubyte op_dst_is_mem,
- struct x86_reg dst,
- struct x86_reg src )
-{
- switch (dst.mod) {
- case mod_REG:
- emit_1ub_fn(p, op_dst_is_reg, 0);
- emit_modrm(p, dst, src);
- break;
- case mod_INDIRECT:
- case mod_DISP32:
- case mod_DISP8:
- assert(src.mod == mod_REG);
- emit_1ub_fn(p, op_dst_is_mem, 0);
- emit_modrm(p, src, dst);
- break;
- default:
- assert(0);
- break;
- }
-}
-
-
-
-
-
-
-
-/* Create and manipulate registers and regmem values:
- */
-struct x86_reg x86_make_reg( GLuint file,
- GLuint idx )
-{
- struct x86_reg reg;
-
- reg.file = file;
- reg.idx = idx;
- reg.mod = mod_REG;
- reg.disp = 0;
-
- return reg;
-}
-
-struct x86_reg x86_make_disp( struct x86_reg reg,
- GLint disp )
-{
- assert(reg.file == file_REG32);
-
- if (reg.mod == mod_REG)
- reg.disp = disp;
- else
- reg.disp += disp;
-
- if (reg.disp == 0)
- reg.mod = mod_INDIRECT;
- else if (reg.disp <= 127 && reg.disp >= -128)
- reg.mod = mod_DISP8;
- else
- reg.mod = mod_DISP32;
-
- return reg;
-}
-
-struct x86_reg x86_deref( struct x86_reg reg )
-{
- return x86_make_disp(reg, 0);
-}
-
-struct x86_reg x86_get_base_reg( struct x86_reg reg )
-{
- return x86_make_reg( reg.file, reg.idx );
-}
-
-GLubyte *x86_get_label( struct x86_function *p )
-{
- return p->csr;
-}
-
-
-
-/***********************************************************************
- * x86 instructions
- */
-
-
-void x86_jcc( struct x86_function *p,
- GLuint cc,
- GLubyte *label )
-{
- GLint offset = label - (x86_get_label(p) + 2);
-
- if (offset <= 127 && offset >= -128) {
- emit_1ub(p, 0x70 + cc);
- emit_1b(p, (GLbyte) offset);
- }
- else {
- offset = label - (x86_get_label(p) + 6);
- emit_2ub(p, 0x0f, 0x80 + cc);
- emit_1i(p, offset);
- }
-}
-
-/* Always use a 32bit offset for forward jumps:
- */
-GLubyte *x86_jcc_forward( struct x86_function *p,
- GLuint cc )
-{
- emit_2ub(p, 0x0f, 0x80 + cc);
- emit_1i(p, 0);
- return x86_get_label(p);
-}
-
-/* Fixup offset from forward jump:
- */
-void x86_fixup_fwd_jump( struct x86_function *p,
- GLubyte *fixup )
-{
- *(int *)(fixup - 4) = x86_get_label(p) - fixup;
-}
-
-void x86_push( struct x86_function *p,
- struct x86_reg reg )
-{
- assert(reg.mod == mod_REG);
- emit_1ub(p, 0x50 + reg.idx);
- p->stack_offset += 4;
-}
-
-void x86_pop( struct x86_function *p,
- struct x86_reg reg )
-{
- assert(reg.mod == mod_REG);
- emit_1ub(p, 0x58 + reg.idx);
- p->stack_offset -= 4;
-}
-
-void x86_inc( struct x86_function *p,
- struct x86_reg reg )
-{
- assert(reg.mod == mod_REG);
- emit_1ub(p, 0x40 + reg.idx);
-}
-
-void x86_dec( struct x86_function *p,
- struct x86_reg reg )
-{
- assert(reg.mod == mod_REG);
- emit_1ub(p, 0x48 + reg.idx);
-}
-
-void x86_ret( struct x86_function *p )
-{
- emit_1ub(p, 0xc3);
-}
-
-void x86_sahf( struct x86_function *p )
-{
- emit_1ub(p, 0x9e);
-}
-
-void x86_mov( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_op_modrm( p, 0x8b, 0x89, dst, src );
-}
-
-void x86_xor( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_op_modrm( p, 0x33, 0x31, dst, src );
-}
-
-void x86_cmp( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_op_modrm( p, 0x3b, 0x39, dst, src );
-}
-
-void x86_lea( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_1ub(p, 0x8d);
- emit_modrm( p, dst, src );
-}
-
-void x86_test( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_1ub(p, 0x85);
- emit_modrm( p, dst, src );
-}
-
-
-
-/***********************************************************************
- * SSE instructions
- */
-
-
-void sse_movss( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, 0xF3, X86_TWOB);
- emit_op_modrm( p, 0x10, 0x11, dst, src );
-}
-
-void sse_movaps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_1ub(p, X86_TWOB);
- emit_op_modrm( p, 0x28, 0x29, dst, src );
-}
-
-void sse_movups( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_1ub(p, X86_TWOB);
- emit_op_modrm( p, 0x10, 0x11, dst, src );
-}
-
-void sse_movhps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.mod != mod_REG || src.mod != mod_REG);
- emit_1ub(p, X86_TWOB);
- emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */
-}
-
-void sse_movlps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.mod != mod_REG || src.mod != mod_REG);
- emit_1ub(p, X86_TWOB);
- emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */
-}
-
-void sse_maxps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, X86_TWOB, 0x5F);
- emit_modrm( p, dst, src );
-}
-
-void sse_divss( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0xF3, X86_TWOB, 0x5E);
- emit_modrm( p, dst, src );
-}
-
-void sse_minps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, X86_TWOB, 0x5D);
- emit_modrm( p, dst, src );
-}
-
-void sse_subps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, X86_TWOB, 0x5C);
- emit_modrm( p, dst, src );
-}
-
-void sse_mulps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, X86_TWOB, 0x59);
- emit_modrm( p, dst, src );
-}
-
-void sse_addps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, X86_TWOB, 0x58);
- emit_modrm( p, dst, src );
-}
-
-void sse_addss( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0xF3, X86_TWOB, 0x58);
- emit_modrm( p, dst, src );
-}
-
-void sse_andps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, X86_TWOB, 0x54);
- emit_modrm( p, dst, src );
-}
-
-
-void sse_rsqrtss( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0xF3, X86_TWOB, 0x52);
- emit_modrm( p, dst, src );
-
-}
-
-void sse_movhlps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.mod == mod_REG && src.mod == mod_REG);
- emit_2ub(p, X86_TWOB, 0x12);
- emit_modrm( p, dst, src );
-}
-
-void sse_movlhps( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.mod == mod_REG && src.mod == mod_REG);
- emit_2ub(p, X86_TWOB, 0x16);
- emit_modrm( p, dst, src );
-}
-
-
-void sse_cvtps2pi( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.file == file_MMX &&
- (src.file == file_XMM || src.mod != mod_REG));
-
- p->need_emms = 1;
-
- emit_2ub(p, X86_TWOB, 0x2d);
- emit_modrm( p, dst, src );
-}
-
-
-/* Shufps can also be used to implement a reduced swizzle when dest ==
- * arg0.
- */
-void sse_shufps( struct x86_function *p,
- struct x86_reg dest,
- struct x86_reg arg0,
- GLubyte shuf)
-{
- emit_2ub(p, X86_TWOB, 0xC6);
- emit_modrm(p, dest, arg0);
- emit_1ub(p, shuf);
-}
-
-void sse_cmpps( struct x86_function *p,
- struct x86_reg dest,
- struct x86_reg arg0,
- GLubyte cc)
-{
- emit_2ub(p, X86_TWOB, 0xC2);
- emit_modrm(p, dest, arg0);
- emit_1ub(p, cc);
-}
-
-/***********************************************************************
- * SSE2 instructions
- */
-
-/**
- * Perform a reduced swizzle:
- */
-void sse2_pshufd( struct x86_function *p,
- struct x86_reg dest,
- struct x86_reg arg0,
- GLubyte shuf)
-{
- emit_3ub(p, 0x66, X86_TWOB, 0x70);
- emit_modrm(p, dest, arg0);
- emit_1ub(p, shuf);
-}
-
-void sse2_cvtps2dq( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0x66, X86_TWOB, 0x5B);
- emit_modrm( p, dst, src );
-}
-
-void sse2_packssdw( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0x66, X86_TWOB, 0x6B);
- emit_modrm( p, dst, src );
-}
-
-void sse2_packsswb( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0x66, X86_TWOB, 0x63);
- emit_modrm( p, dst, src );
-}
-
-void sse2_packuswb( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0x66, X86_TWOB, 0x67);
- emit_modrm( p, dst, src );
-}
-
-void sse2_rcpss( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_3ub(p, 0xF3, X86_TWOB, 0x53);
- emit_modrm( p, dst, src );
-}
-
-void sse2_movd( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- emit_2ub(p, 0x66, X86_TWOB);
- emit_op_modrm( p, 0x6e, 0x7e, dst, src );
-}
-
-
-
-
-/***********************************************************************
- * x87 instructions
- */
-void x87_fist( struct x86_function *p, struct x86_reg dst )
-{
- emit_1ub(p, 0xdb);
- emit_modrm_noreg(p, 2, dst);
-}
-
-void x87_fistp( struct x86_function *p, struct x86_reg dst )
-{
- emit_1ub(p, 0xdb);
- emit_modrm_noreg(p, 3, dst);
-}
-
-void x87_fldz( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xee);
-}
-
-
-void x87_fldcw( struct x86_function *p, struct x86_reg arg )
-{
- assert(arg.file == file_REG32);
- assert(arg.mod != mod_REG);
- emit_1ub(p, 0xd9);
- emit_modrm_noreg(p, 5, arg);
-}
-
-void x87_fld1( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xe8);
-}
-
-void x87_fldl2e( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xea);
-}
-
-void x87_fldln2( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xed);
-}
-
-void x87_fwait( struct x86_function *p )
-{
- emit_1ub(p, 0x9b);
-}
-
-void x87_fnclex( struct x86_function *p )
-{
- emit_2ub(p, 0xdb, 0xe2);
-}
-
-void x87_fclex( struct x86_function *p )
-{
- x87_fwait(p);
- x87_fnclex(p);
-}
-
-
-static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg,
- GLubyte dst0ub0,
- GLubyte dst0ub1,
- GLubyte arg0ub0,
- GLubyte arg0ub1,
- GLubyte argmem_noreg)
-{
- assert(dst.file == file_x87);
-
- if (arg.file == file_x87) {
- if (dst.idx == 0)
- emit_2ub(p, dst0ub0, dst0ub1+arg.idx);
- else if (arg.idx == 0)
- emit_2ub(p, arg0ub0, arg0ub1+arg.idx);
- else
- assert(0);
- }
- else if (dst.idx == 0) {
- assert(arg.file = file_REG32);
- emit_1ub(p, 0xd8);
- emit_modrm_noreg(p, argmem_noreg, arg);
- }
- else
- assert(0);
-}
-
-void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
-{
- x87_arith_op(p, dst, arg,
- 0xd8, 0xc8,
- 0xdc, 0xc8,
- 4);
-}
-
-void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
-{
- x87_arith_op(p, dst, arg,
- 0xd8, 0xe0,
- 0xdc, 0xe8,
- 4);
-}
-
-void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
-{
- x87_arith_op(p, dst, arg,
- 0xd8, 0xe8,
- 0xdc, 0xe0,
- 5);
-}
-
-void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
-{
- x87_arith_op(p, dst, arg,
- 0xd8, 0xc0,
- 0xdc, 0xc0,
- 0);
-}
-
-void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
-{
- x87_arith_op(p, dst, arg,
- 0xd8, 0xf0,
- 0xdc, 0xf8,
- 6);
-}
-
-void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
-{
- x87_arith_op(p, dst, arg,
- 0xd8, 0xf8,
- 0xdc, 0xf0,
- 7);
-}
-
-void x87_fmulp( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_x87);
- assert(dst.idx >= 1);
- emit_2ub(p, 0xde, 0xc8+dst.idx);
-}
-
-void x87_fsubp( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_x87);
- assert(dst.idx >= 1);
- emit_2ub(p, 0xde, 0xe8+dst.idx);
-}
-
-void x87_fsubrp( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_x87);
- assert(dst.idx >= 1);
- emit_2ub(p, 0xde, 0xe0+dst.idx);
-}
-
-void x87_faddp( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_x87);
- assert(dst.idx >= 1);
- emit_2ub(p, 0xde, 0xc0+dst.idx);
-}
-
-void x87_fdivp( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_x87);
- assert(dst.idx >= 1);
- emit_2ub(p, 0xde, 0xf8+dst.idx);
-}
-
-void x87_fdivrp( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_x87);
- assert(dst.idx >= 1);
- emit_2ub(p, 0xde, 0xf0+dst.idx);
-}
-
-void x87_fucom( struct x86_function *p, struct x86_reg arg )
-{
- assert(arg.file == file_x87);
- emit_2ub(p, 0xdd, 0xe0+arg.idx);
-}
-
-void x87_fucomp( struct x86_function *p, struct x86_reg arg )
-{
- assert(arg.file == file_x87);
- emit_2ub(p, 0xdd, 0xe8+arg.idx);
-}
-
-void x87_fucompp( struct x86_function *p )
-{
- emit_2ub(p, 0xda, 0xe9);
-}
-
-void x87_fxch( struct x86_function *p, struct x86_reg arg )
-{
- assert(arg.file == file_x87);
- emit_2ub(p, 0xd9, 0xc8+arg.idx);
-}
-
-void x87_fabs( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xe1);
-}
-
-void x87_fchs( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xe0);
-}
-
-void x87_fcos( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xff);
-}
-
-
-void x87_fprndint( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xfc);
-}
-
-void x87_fscale( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xfd);
-}
-
-void x87_fsin( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xfe);
-}
-
-void x87_fsincos( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xfb);
-}
-
-void x87_fsqrt( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xfa);
-}
-
-void x87_fxtract( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xf4);
-}
-
-/* st0 = (2^st0)-1
- *
- * Restrictions: -1.0 <= st0 <= 1.0
- */
-void x87_f2xm1( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xf0);
-}
-
-/* st1 = st1 * log2(st0);
- * pop_stack;
- */
-void x87_fyl2x( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xf1);
-}
-
-/* st1 = st1 * log2(st0 + 1.0);
- * pop_stack;
- *
- * A fast operation, with restrictions: -.29 < st0 < .29
- */
-void x87_fyl2xp1( struct x86_function *p )
-{
- emit_2ub(p, 0xd9, 0xf9);
-}
-
-
-void x87_fld( struct x86_function *p, struct x86_reg arg )
-{
- if (arg.file == file_x87)
- emit_2ub(p, 0xd9, 0xc0 + arg.idx);
- else {
- emit_1ub(p, 0xd9);
- emit_modrm_noreg(p, 0, arg);
- }
-}
-
-void x87_fst( struct x86_function *p, struct x86_reg dst )
-{
- if (dst.file == file_x87)
- emit_2ub(p, 0xdd, 0xd0 + dst.idx);
- else {
- emit_1ub(p, 0xd9);
- emit_modrm_noreg(p, 2, dst);
- }
-}
-
-void x87_fstp( struct x86_function *p, struct x86_reg dst )
-{
- if (dst.file == file_x87)
- emit_2ub(p, 0xdd, 0xd8 + dst.idx);
- else {
- emit_1ub(p, 0xd9);
- emit_modrm_noreg(p, 3, dst);
- }
-}
-
-void x87_fcom( struct x86_function *p, struct x86_reg dst )
-{
- if (dst.file == file_x87)
- emit_2ub(p, 0xd8, 0xd0 + dst.idx);
- else {
- emit_1ub(p, 0xd8);
- emit_modrm_noreg(p, 2, dst);
- }
-}
-
-void x87_fcomp( struct x86_function *p, struct x86_reg dst )
-{
- if (dst.file == file_x87)
- emit_2ub(p, 0xd8, 0xd8 + dst.idx);
- else {
- emit_1ub(p, 0xd8);
- emit_modrm_noreg(p, 3, dst);
- }
-}
-
-
-void x87_fnstsw( struct x86_function *p, struct x86_reg dst )
-{
- assert(dst.file == file_REG32);
-
- if (dst.idx == reg_AX &&
- dst.mod == mod_REG)
- emit_2ub(p, 0xdf, 0xe0);
- else {
- emit_1ub(p, 0xdd);
- emit_modrm_noreg(p, 7, dst);
- }
-}
-
-
-
-
-/***********************************************************************
- * MMX instructions
- */
-
-void mmx_emms( struct x86_function *p )
-{
- assert(p->need_emms);
- emit_2ub(p, 0x0f, 0x77);
- p->need_emms = 0;
-}
-
-void mmx_packssdw( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.file == file_MMX &&
- (src.file == file_MMX || src.mod != mod_REG));
-
- p->need_emms = 1;
-
- emit_2ub(p, X86_TWOB, 0x6b);
- emit_modrm( p, dst, src );
-}
-
-void mmx_packuswb( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- assert(dst.file == file_MMX &&
- (src.file == file_MMX || src.mod != mod_REG));
-
- p->need_emms = 1;
-
- emit_2ub(p, X86_TWOB, 0x67);
- emit_modrm( p, dst, src );
-}
-
-void mmx_movd( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- p->need_emms = 1;
- emit_1ub(p, X86_TWOB);
- emit_op_modrm( p, 0x6e, 0x7e, dst, src );
-}
-
-void mmx_movq( struct x86_function *p,
- struct x86_reg dst,
- struct x86_reg src )
-{
- p->need_emms = 1;
- emit_1ub(p, X86_TWOB);
- emit_op_modrm( p, 0x6f, 0x7f, dst, src );
-}
-
-
-/***********************************************************************
- * Helper functions
- */
-
-
-/* Retreive a reference to one of the function arguments, taking into
- * account any push/pop activity:
- */
-struct x86_reg x86_fn_arg( struct x86_function *p,
- GLuint arg )
-{
- return x86_make_disp(x86_make_reg(file_REG32, reg_SP),
- p->stack_offset + arg * 4); /* ??? */
-}
-
-
-void x86_init_func( struct x86_function *p )
-{
- p->store = _mesa_exec_malloc(1024);
- p->csr = p->store;
-}
-
-void x86_release_func( struct x86_function *p )
-{
- _mesa_exec_free(p->store);
-}
-
-
-void (*x86_get_func( struct x86_function *p ))(void)
-{
- if (DISASSEM)
- _mesa_printf("disassemble %p %p\n", p->store, p->csr);
- return (void (*)())p->store;
-}
-
-#else
-
-void x86sse_dummy( void )
-{
-}
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.h b/nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.h
deleted file mode 100644
index 611d01e1c..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/rtasm/x86sse.h
+++ /dev/null
@@ -1,223 +0,0 @@
-
-#ifndef _X86SSE_H_
-#define _X86SSE_H_
-
-#if defined(USE_X86_ASM)
-
-#include "glheader.h"
-
-/* It is up to the caller to ensure that instructions issued are
- * suitable for the host cpu. There are no checks made in this module
- * for mmx/sse/sse2 support on the cpu.
- */
-struct x86_reg {
- GLuint file:3;
- GLuint idx:3;
- GLuint mod:2; /* mod_REG if this is just a register */
- GLint disp:24; /* only +/- 23bits of offset - should be enough... */
-};
-
-struct x86_function {
- GLubyte *store;
- GLubyte *csr;
- GLuint stack_offset;
- GLint need_emms;
- const char *fn;
-};
-
-enum x86_reg_file {
- file_REG32,
- file_MMX,
- file_XMM,
- file_x87
-};
-
-/* Values for mod field of modr/m byte
- */
-enum x86_reg_mod {
- mod_INDIRECT,
- mod_DISP8,
- mod_DISP32,
- mod_REG
-};
-
-enum x86_reg_name {
- reg_AX,
- reg_CX,
- reg_DX,
- reg_BX,
- reg_SP,
- reg_BP,
- reg_SI,
- reg_DI
-};
-
-
-enum x86_cc {
- cc_O, /* overflow */
- cc_NO, /* not overflow */
- cc_NAE, /* not above or equal / carry */
- cc_AE, /* above or equal / not carry */
- cc_E, /* equal / zero */
- cc_NE /* not equal / not zero */
-};
-
-enum sse_cc {
- cc_Equal,
- cc_LessThan,
- cc_LessThanEqual,
- cc_Unordered,
- cc_NotEqual,
- cc_NotLessThan,
- cc_NotLessThanEqual,
- cc_Ordered
-};
-
-#define cc_Z cc_E
-#define cc_NZ cc_NE
-
-/* Begin/end/retreive function creation:
- */
-
-
-void x86_init_func( struct x86_function *p );
-void x86_release_func( struct x86_function *p );
-void (*x86_get_func( struct x86_function *p ))( void );
-
-
-
-/* Create and manipulate registers and regmem values:
- */
-struct x86_reg x86_make_reg( enum x86_reg_file file,
- enum x86_reg_name idx );
-
-struct x86_reg x86_make_disp( struct x86_reg reg,
- GLint disp );
-
-struct x86_reg x86_deref( struct x86_reg reg );
-
-struct x86_reg x86_get_base_reg( struct x86_reg reg );
-
-
-/* Labels, jumps and fixup:
- */
-GLubyte *x86_get_label( struct x86_function *p );
-
-void x86_jcc( struct x86_function *p,
- enum x86_cc cc,
- GLubyte *label );
-
-GLubyte *x86_jcc_forward( struct x86_function *p,
- enum x86_cc cc );
-
-void x86_fixup_fwd_jump( struct x86_function *p,
- GLubyte *fixup );
-
-
-/* Macro for sse_shufps() and sse2_pshufd():
- */
-#define SHUF(_x,_y,_z,_w) (((_x)<<0) | ((_y)<<2) | ((_z)<<4) | ((_w)<<6))
-#define SHUF_NOOP RSW(0,1,2,3)
-#define GET_SHUF(swz, idx) (((swz) >> ((idx)*2)) & 0x3)
-
-void mmx_emms( struct x86_function *p );
-void mmx_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void mmx_movq( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void mmx_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void mmx_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-
-void sse2_cvtps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse2_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse2_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse2_packsswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse2_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse2_pshufd( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, GLubyte shuf );
-void sse2_rcpss( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-
-void sse_addps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_addss( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_cvtps2pi( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_divss( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_andps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_cmpps( struct x86_function *p, struct x86_reg dst, struct x86_reg src, GLubyte cc );
-void sse_maxps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_minps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movaps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movhlps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movlhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movlps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movss( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_movups( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_mulps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_subps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_rsqrtss( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, GLubyte shuf );
-
-void x86_cmp( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void x86_dec( struct x86_function *p, struct x86_reg reg );
-void x86_inc( struct x86_function *p, struct x86_reg reg );
-void x86_lea( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void x86_mov( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void x86_pop( struct x86_function *p, struct x86_reg reg );
-void x86_push( struct x86_function *p, struct x86_reg reg );
-void x86_ret( struct x86_function *p );
-void x86_test( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void x86_xor( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void x86_sahf( struct x86_function *p );
-
-void x87_f2xm1( struct x86_function *p );
-void x87_fabs( struct x86_function *p );
-void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg );
-void x87_faddp( struct x86_function *p, struct x86_reg dst );
-void x87_fchs( struct x86_function *p );
-void x87_fclex( struct x86_function *p );
-void x87_fcom( struct x86_function *p, struct x86_reg dst );
-void x87_fcomp( struct x86_function *p, struct x86_reg dst );
-void x87_fcos( struct x86_function *p );
-void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg );
-void x87_fdivp( struct x86_function *p, struct x86_reg dst );
-void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg );
-void x87_fdivrp( struct x86_function *p, struct x86_reg dst );
-void x87_fist( struct x86_function *p, struct x86_reg dst );
-void x87_fistp( struct x86_function *p, struct x86_reg dst );
-void x87_fld( struct x86_function *p, struct x86_reg arg );
-void x87_fld1( struct x86_function *p );
-void x87_fldcw( struct x86_function *p, struct x86_reg arg );
-void x87_fldl2e( struct x86_function *p );
-void x87_fldln2( struct x86_function *p );
-void x87_fldz( struct x86_function *p );
-void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg );
-void x87_fmulp( struct x86_function *p, struct x86_reg dst );
-void x87_fnclex( struct x86_function *p );
-void x87_fprndint( struct x86_function *p );
-void x87_fscale( struct x86_function *p );
-void x87_fsin( struct x86_function *p );
-void x87_fsincos( struct x86_function *p );
-void x87_fsqrt( struct x86_function *p );
-void x87_fst( struct x86_function *p, struct x86_reg dst );
-void x87_fstp( struct x86_function *p, struct x86_reg dst );
-void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg );
-void x87_fsubp( struct x86_function *p, struct x86_reg dst );
-void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg );
-void x87_fsubrp( struct x86_function *p, struct x86_reg dst );
-void x87_fxch( struct x86_function *p, struct x86_reg dst );
-void x87_fxtract( struct x86_function *p );
-void x87_fyl2x( struct x86_function *p );
-void x87_fyl2xp1( struct x86_function *p );
-void x87_fwait( struct x86_function *p );
-void x87_fnstsw( struct x86_function *p, struct x86_reg dst );
-void x87_fucompp( struct x86_function *p );
-void x87_fucomp( struct x86_function *p, struct x86_reg arg );
-void x87_fucom( struct x86_function *p, struct x86_reg arg );
-
-
-
-/* Retreive a reference to one of the function arguments, taking into
- * account any push/pop activity. Note - doesn't track explict
- * manipulation of ESP by other instructions.
- */
-struct x86_reg x86_fn_arg( struct x86_function *p, GLuint arg );
-
-#endif
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse.c b/nx-X11/extras/Mesa/src/mesa/x86/sse.c
deleted file mode 100644
index 45852c4e1..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.0
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * PentiumIII-SIMD (SSE) optimizations contributed by
- * Andre Werthmann <wertmann@cs.uni-potsdam.de>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "math/m_xform.h"
-#include "tnl/t_context.h"
-
-#include "sse.h"
-#include "common_x86_macros.h"
-
-#ifdef DEBUG
-#include "math/m_debug.h"
-#endif
-
-
-#ifdef USE_SSE_ASM
-DECLARE_XFORM_GROUP( sse, 2 )
-DECLARE_XFORM_GROUP( sse, 3 )
-
-#if 1
-/* Some functions are not written in SSE-assembly, because the fpu ones are faster */
-extern void _ASMAPI _mesa_sse_transform_normals_no_rot( NORM_ARGS );
-extern void _ASMAPI _mesa_sse_transform_rescale_normals( NORM_ARGS );
-extern void _ASMAPI _mesa_sse_transform_rescale_normals_no_rot( NORM_ARGS );
-
-extern void _ASMAPI _mesa_sse_transform_points4_general( XFORM_ARGS );
-extern void _ASMAPI _mesa_sse_transform_points4_3d( XFORM_ARGS );
-/* XXX this function segfaults, see below */
-extern void _ASMAPI _mesa_sse_transform_points4_identity( XFORM_ARGS );
-/* XXX this one works, see below */
-extern void _ASMAPI _mesa_x86_transform_points4_identity( XFORM_ARGS );
-#else
-DECLARE_NORM_GROUP( sse )
-#endif
-
-
-extern void _ASMAPI
-_mesa_v16_sse_general_xform( GLfloat *first_vert,
- const GLfloat *m,
- const GLfloat *src,
- GLuint src_stride,
- GLuint count );
-
-extern void _ASMAPI
-_mesa_sse_project_vertices( GLfloat *first,
- GLfloat *last,
- const GLfloat *m,
- GLuint stride );
-
-extern void _ASMAPI
-_mesa_sse_project_clipped_vertices( GLfloat *first,
- GLfloat *last,
- const GLfloat *m,
- GLuint stride,
- const GLubyte *clipmask );
-#endif
-
-
-void _mesa_init_sse_transform_asm( void )
-{
-#ifdef USE_SSE_ASM
- ASSIGN_XFORM_GROUP( sse, 2 );
- ASSIGN_XFORM_GROUP( sse, 3 );
-
-#if 1
- /* TODO: Finish these off.
- */
- _mesa_transform_tab[4][MATRIX_GENERAL] =
- _mesa_sse_transform_points4_general;
- _mesa_transform_tab[4][MATRIX_3D] =
- _mesa_sse_transform_points4_3d;
- /* XXX NOTE: _mesa_sse_transform_points4_identity segfaults with the
- conformance tests, so use the x86 version.
- */
- _mesa_transform_tab[4][MATRIX_IDENTITY] =
- _mesa_x86_transform_points4_identity;/*_mesa_sse_transform_points4_identity;*/
-
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
- _mesa_sse_transform_normals_no_rot;
- _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =
- _mesa_sse_transform_rescale_normals;
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =
- _mesa_sse_transform_rescale_normals_no_rot;
-#else
- ASSIGN_XFORM_GROUP( sse, 4 );
-
- ASSIGN_NORM_GROUP( sse );
-#endif
-
-#ifdef DEBUG
- _math_test_all_transform_functions( "SSE" );
- _math_test_all_normal_transform_functions( "SSE" );
-#endif
-#endif
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse.h b/nx-X11/extras/Mesa/src/mesa/x86/sse.h
deleted file mode 100644
index 447f192a8..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $Id: sse.h,v 1.1.1.1 2004/06/16 09:19:36 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * PentiumIII-SIMD (SSE) optimizations contributed by
- * Andre Werthmann <wertmann@cs.uni-potsdam.de>
- */
-
-#ifndef __SSE_H__
-#define __SSE_H__
-
-#include "math/m_xform.h"
-
-void _mesa_init_sse_transform_asm( void );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse_normal.S b/nx-X11/extras/Mesa/src/mesa/x86/sse_normal.S
deleted file mode 100644
index 5bff8921e..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse_normal.S
+++ /dev/null
@@ -1,257 +0,0 @@
-/* $Id: sse_normal.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/** TODO:
- * - insert PREFETCH instructions to avoid cache-misses !
- * - some more optimizations are possible...
- * - for 40-50% more performance in the SSE-functions, the
- * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
- */
-
-#ifdef USE_SSE_ASM
-#include "matypes.h"
-#include "norm_args.h"
-
- SEG_TEXT
-
-#define M(i) REGOFF(i * 4, EDX)
-#define S(i) REGOFF(i * 4, ESI)
-#define D(i) REGOFF(i * 4, EDI)
-#define STRIDE REGOFF(12, ESI)
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_sse_transform_rescale_normals_no_rot)
-HIDDEN(_mesa_sse_transform_rescale_normals_no_rot)
-GLNAME(_mesa_sse_transform_rescale_normals_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L ( ARG_IN, ESI ) /* ptr to source GLvector3f */
- MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
-
- MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
- MOV_L ( REGOFF(MATRIX_INV, EDX), EDX) /* matrix->inv */
-
- MOV_L ( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L ( ECX, ECX )
- JZ( LLBL(K_G3TRNNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L ( STRIDE, EAX ) /* stride */
- MOV_L ( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest-count */
-
- IMUL_L( CONST(16), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* m0 */
- MOVSS ( M(5), XMM2 ) /* m5 */
- UNPCKLPS( XMM2, XMM1 ) /* m5 | m0 */
- MOVSS ( ARG_SCALE, XMM0 ) /* scale */
- SHUFPS ( CONST(0x0), XMM0, XMM0 ) /* scale | scale */
- MULPS ( XMM0, XMM1 ) /* m5*scale | m0*scale */
- MULSS ( M(10), XMM0 ) /* m10*scale */
-
-ALIGNTEXT32
-LLBL(K_G3TRNNRR_top):
- MOVLPS ( S(0), XMM2 ) /* uy | ux */
- MULPS ( XMM1, XMM2 ) /* uy*m5*scale | ux*m0*scale */
- MOVLPS ( XMM2, D(0) ) /* ->D(1) | D(0) */
-
- MOVSS ( S(2), XMM2 ) /* uz */
- MULSS ( XMM0, XMM2 ) /* uz*m10*scale */
- MOVSS ( XMM2, D(2) ) /* ->D(2) */
-
-LLBL(K_G3TRNNRR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_G3TRNNRR_top) )
-
-LLBL(K_G3TRNNRR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_sse_transform_rescale_normals)
-HIDDEN(_mesa_sse_transform_rescale_normals)
-GLNAME(_mesa_sse_transform_rescale_normals):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L ( ARG_IN, ESI ) /* ptr to source GLvector3f */
- MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
-
- MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
- MOV_L ( REGOFF(MATRIX_INV, EDX), EDX) /* matrix->inv */
-
- MOV_L ( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L ( ECX, ECX )
- JZ( LLBL(K_G3TRNR_finish) ) /* count was zero; go to finish */
-
- MOV_L ( STRIDE, EAX ) /* stride */
- MOV_L ( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest-count */
-
- IMUL_L( CONST(16), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM0 ) /* m0 */
- MOVSS ( M(4), XMM1 ) /* m4 */
- UNPCKLPS( XMM1, XMM0 ) /* m4 | m0 */
-
- MOVSS ( ARG_SCALE, XMM4 ) /* scale */
- SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* scale | scale */
-
- MULPS ( XMM4, XMM0 ) /* m4*scale | m0*scale */
- MOVSS ( M(1), XMM1 ) /* m1 */
- MOVSS ( M(5), XMM2 ) /* m5 */
- UNPCKLPS( XMM2, XMM1 ) /* m5 | m1 */
- MULPS ( XMM4, XMM1 ) /* m5*scale | m1*scale */
- MOVSS ( M(2), XMM2 ) /* m2 */
- MOVSS ( M(6), XMM3 ) /* m6 */
- UNPCKLPS( XMM3, XMM2 ) /* m6 | m2 */
- MULPS ( XMM4, XMM2 ) /* m6*scale | m2*scale */
-
- MOVSS ( M(8), XMM6 ) /* m8 */
- MULSS ( ARG_SCALE, XMM6 ) /* m8*scale */
- MOVSS ( M(9), XMM7 ) /* m9 */
- MULSS ( ARG_SCALE, XMM7 ) /* m9*scale */
-
-ALIGNTEXT32
-LLBL(K_G3TRNR_top):
- MOVSS ( S(0), XMM3 ) /* ux */
- SHUFPS ( CONST(0x0), XMM3, XMM3 ) /* ux | ux */
- MULPS ( XMM0, XMM3 ) /* ux*m4 | ux*m0 */
- MOVSS ( S(1), XMM4 ) /* uy */
- SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* uy | uy */
- MULPS ( XMM1, XMM4 ) /* uy*m5 | uy*m1 */
- MOVSS ( S(2), XMM5 ) /* uz */
- SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* uz | uz */
- MULPS ( XMM2, XMM5 ) /* uz*m6 | uz*m2 */
-
- ADDPS ( XMM4, XMM3 )
- ADDPS ( XMM5, XMM3 )
- MOVLPS ( XMM3, D(0) )
-
- MOVSS ( M(10), XMM3 ) /* m10 */
- MULSS ( ARG_SCALE, XMM3 ) /* m10*scale */
- MULSS ( S(2), XMM3 ) /* m10*scale*uz */
- MOVSS ( S(1), XMM4 ) /* uy */
- MULSS ( XMM7, XMM4 ) /* uy*m9*scale */
- MOVSS ( S(0), XMM5 ) /* ux */
- MULSS ( XMM6, XMM5 ) /* ux*m8*scale */
-
- ADDSS ( XMM4, XMM3 )
- ADDSS ( XMM5, XMM3 )
- MOVSS ( XMM3, D(2) )
-
-LLBL(K_G3TRNR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_G3TRNR_top) )
-
-LLBL(K_G3TRNR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_sse_transform_normals_no_rot)
-HIDDEN(_mesa_sse_transform_normals_no_rot)
-GLNAME(_mesa_sse_transform_normals_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L ( ARG_IN, ESI ) /* ptr to source GLvector3f */
- MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
-
- MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
- MOV_L ( REGOFF(MATRIX_INV, EDX), EDX) /* matrix->inv */
-
- MOV_L ( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L ( ECX, ECX )
- JZ( LLBL(K_G3TNNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L ( STRIDE, EAX ) /* stride */
- MOV_L ( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest-count */
-
- IMUL_L( CONST(16), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS( M(0), XMM0 ) /* m0 */
- MOVSS( M(5), XMM1 ) /* m5 */
- UNPCKLPS( XMM1, XMM0 ) /* m5 | m0 */
- MOVSS( M(10), XMM1 ) /* m10 */
-
-ALIGNTEXT32
-LLBL(K_G3TNNRR_top):
- MOVLPS( S(0), XMM2 ) /* uy | ux */
- MULPS( XMM0, XMM2 ) /* uy*m5 | ux*m0 */
- MOVLPS( XMM2, D(0) )
-
- MOVSS( S(2), XMM2 ) /* uz */
- MULSS( XMM1, XMM2 ) /* uz*m10 */
- MOVSS( XMM2, D(2) )
-
-LLBL(K_G3TNNRR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_G3TNNRR_top) )
-
-LLBL(K_G3TNNRR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform1.S b/nx-X11/extras/Mesa/src/mesa/x86/sse_xform1.S
deleted file mode 100644
index 17a61b410..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform1.S
+++ /dev/null
@@ -1,442 +0,0 @@
-/* $Id: sse_xform1.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/** TODO:
- * - insert PREFETCH instructions to avoid cache-misses !
- * - some more optimizations are possible...
- * - for 40-50% more performance in the SSE-functions, the
- * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
- */
-
-#ifdef USE_SSE_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define S(i) REGOFF(i * 4, ESI)
-#define D(i) REGOFF(i * 4, EDI)
-#define M(i) REGOFF(i * 4, EDX)
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_general)
-HIDDEN( _mesa_sse_transform_points1_general )
-GLNAME( _mesa_sse_transform_points1_general ):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- CMP_L( CONST(0), ECX ) /* count == 0 ? */
- JE( LLBL(K_GTP1GR_finish) ) /* yes -> nothing to do. */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVAPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
- MOVAPS( M(12), XMM1 ) /* m15 | m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP1GR_top):
- MOVSS( S(0), XMM2 ) /* ox */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
- MULPS( XMM0, XMM2 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
- ADDPS( XMM1, XMM2 ) /* + | + | + | + */
- MOVUPS( XMM2, D(0) )
-
-LLBL(K_GTP1GR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP1GR_top) )
-
-LLBL(K_GTP1GR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_identity)
-HIDDEN(_mesa_sse_transform_points1_identity)
-GLNAME( _mesa_sse_transform_points1_identity ):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP1IR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_1), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(1), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
- CMP_L( ESI, EDI )
- JE( LLBL(K_GTP1IR_finish) )
-
-
-ALIGNTEXT32
-LLBL(K_GTP1IR_top):
- MOV_L( S(0), EDX )
- MOV_L( EDX, D(0) )
-
-LLBL(K_GTP1IR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP1IR_top) )
-
-LLBL(K_GTP1IR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_3d_no_rot)
-HIDDEN(_mesa_sse_transform_points1_3d_no_rot)
-GLNAME(_mesa_sse_transform_points1_3d_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP13DNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVSS( M(0), XMM0 ) /* m0 */
- MOVSS( M(12), XMM1 ) /* m12 */
- MOVSS( M(13), XMM2 ) /* m13 */
- MOVSS( M(14), XMM3 ) /* m14 */
-
-ALIGNTEXT32
-LLBL(K_GTP13DNRR_top):
- MOVSS( S(0), XMM4 ) /* ox */
- MULSS( XMM0, XMM4 ) /* ox*m0 */
- ADDSS( XMM1, XMM4 ) /* ox*m0+m12 */
- MOVSS( XMM4, D(0) )
-
- MOVSS( XMM2, D(1) )
- MOVSS( XMM3, D(2) )
-
-LLBL(K_GTP13DNRR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP13DNRR_top) )
-
-LLBL(K_GTP13DNRR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_perspective)
-HIDDEN(_mesa_sse_transform_points1_perspective)
-GLNAME(_mesa_sse_transform_points1_perspective):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP13PR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- XORPS( XMM0, XMM0 ) /* 0 | 0 | 0 | 0 */
- MOVSS( M(0), XMM1 ) /* m0 */
- MOVSS( M(14), XMM2 ) /* m14 */
-
-ALIGNTEXT32
-LLBL(K_GTP13PR_top):
- MOVSS( S(0), XMM3 ) /* ox */
- MULSS( XMM1, XMM3 ) /* ox*m0 */
- MOVSS( XMM3, D(0) ) /* ox*m0->D(0) */
- MOVSS( XMM2, D(2) ) /* m14->D(2) */
-
- MOVSS( XMM0, D(1) )
- MOVSS( XMM0, D(3) )
-
-LLBL(K_GTP13PR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP13PR_top) )
-
-LLBL(K_GTP13PR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_2d)
-HIDDEN(_mesa_sse_transform_points1_2d)
-GLNAME(_mesa_sse_transform_points1_2d):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP13P2DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVLPS( M(0), XMM0 ) /* m1 | m0 */
- MOVLPS( M(12), XMM1 ) /* m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP13P2DR_top):
- MOVSS( S(0), XMM2 ) /* ox */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
- MULPS( XMM0, XMM2 ) /* - | - | ox*m1 | ox*m0 */
- ADDPS( XMM1, XMM2 ) /* - | - | ox*m1+m13 | ox*m0+m12 */
- MOVLPS( XMM2, D(0) )
-
-LLBL(K_GTP13P2DR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP13P2DR_top) )
-
-LLBL(K_GTP13P2DR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_2d_no_rot)
-HIDDEN(_mesa_sse_transform_points1_2d_no_rot)
-GLNAME(_mesa_sse_transform_points1_2d_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP13P2DNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS( M(0), XMM0 ) /* m0 */
- MOVSS( M(12), XMM1 ) /* m12 */
- MOVSS( M(13), XMM2 ) /* m13 */
-
-ALIGNTEXT32
-LLBL(K_GTP13P2DNRR_top):
- MOVSS( S(0), XMM3 ) /* ox */
- MULSS( XMM0, XMM3 ) /* ox*m0 */
- ADDSS( XMM1, XMM3 ) /* ox*m0+m12 */
- MOVSS( XMM3, D(0) )
- MOVSS( XMM2, D(1) )
-
-LLBL(K_GTP13P2DNRR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP13P2DNRR_top) )
-
-LLBL(K_GTP13P2DNRR_finish):
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points1_3d)
-HIDDEN(_mesa_sse_transform_points1_3d)
-GLNAME(_mesa_sse_transform_points1_3d):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP13P3DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVAPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
- MOVAPS( M(12), XMM1 ) /* m15 | m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP13P3DR_top):
- MOVSS( S(0), XMM2 ) /* ox */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* ox | ox | ox | ox */
- MULPS( XMM0, XMM2 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
- ADDPS( XMM1, XMM2 ) /* +m15 | +m14 | +m13 | +m12 */
- MOVLPS( XMM2, D(0) ) /* - | - | ->D(1)| ->D(0)*/
- UNPCKHPS( XMM2, XMM2 ) /* ox*m3+m15 | ox*m3+m15 | ox*m2+m14 | ox*m2+m14 */
- MOVSS( XMM2, D(2) )
-
-LLBL(K_GTP13P3DR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP13P3DR_top) )
-
-LLBL(K_GTP13P3DR_finish):
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform2.S b/nx-X11/extras/Mesa/src/mesa/x86/sse_xform2.S
deleted file mode 100644
index 97c7e5d77..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform2.S
+++ /dev/null
@@ -1,461 +0,0 @@
-/* $Id: sse_xform2.S,v 1.1.1.2 2005/07/31 16:46:40 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/** TODO:
- * - insert PREFETCH instructions to avoid cache-misses !
- * - some more optimizations are possible...
- * - for 40-50% more performance in the SSE-functions, the
- * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
- */
-
-#ifdef USE_SSE_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define S(i) REGOFF(i * 4, ESI)
-#define D(i) REGOFF(i * 4, EDI)
-#define M(i) REGOFF(i * 4, EDX)
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_general)
-HIDDEN (_mesa_sse_transform_points2_general)
-GLNAME( _mesa_sse_transform_points2_general ):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX )
- JZ( LLBL(K_GTP2GR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVAPS( M(0), XMM0 ) /* m3 | m2 | m1 | m0 */
- MOVAPS( M(4), XMM1 ) /* m7 | m6 | m5 | m4 */
- MOVAPS( M(12), XMM2 ) /* m15 | m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP2GR_top):
- MOVSS( S(0), XMM3 ) /* ox */
- SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox | ox | ox */
- MULPS( XMM0, XMM3 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
- MOVSS( S(1), XMM4 ) /* oy */
- SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy | oy | oy */
- MULPS( XMM1, XMM4 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
-
- ADDPS( XMM4, XMM3 )
- ADDPS( XMM2, XMM3 )
- MOVAPS( XMM3, D(0) )
-
-LLBL(K_GTP2GR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP2GR_top) )
-
-LLBL(K_GTP2GR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_identity)
-HIDDEN(_mesa_sse_transform_points2_identity)
-GLNAME( _mesa_sse_transform_points2_identity ):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP2IR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
- CMP_L( ESI, EDI )
- JE( LLBL(K_GTP2IR_finish) )
-
-
-ALIGNTEXT32
-LLBL(K_GTP2IR_top):
- MOV_L ( S(0), EDX )
- MOV_L ( EDX, D(0) )
- MOV_L ( S(1), EDX )
- MOV_L ( EDX, D(1) )
-
-LLBL(K_GTP2IR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP2IR_top) )
-
-LLBL(K_GTP2IR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_3d_no_rot)
-HIDDEN(_mesa_sse_transform_points2_3d_no_rot)
-GLNAME(_mesa_sse_transform_points2_3d_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP23DNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
- MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
- UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
- MOVLPS ( M(12), XMM2 ) /* - | - | m13 | m12 */
- MOVSS ( M(14), XMM3 ) /* - | - | - | m14 */
-
-ALIGNTEXT32
-LLBL(K_GTP23DNRR_top):
- MOVLPS ( S(0), XMM0 ) /* - | - | oy | ox */
- MULPS ( XMM1, XMM0 ) /* - | - | oy*m5 | ox*m0 */
- ADDPS ( XMM2, XMM0 ) /* - | - | +m13 | +m12 */
- MOVLPS ( XMM0, D(0) ) /* -> D(1) | -> D(0) */
-
- MOVSS ( XMM3, D(2) ) /* -> D(2) */
-
-LLBL(K_GTP23DNRR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP23DNRR_top) )
-
-LLBL(K_GTP23DNRR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_perspective)
-HIDDEN(_mesa_sse_transform_points2_perspective)
-GLNAME(_mesa_sse_transform_points2_perspective):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP23PR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
- MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
- UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
- MOVSS ( M(14), XMM3 ) /* m14 */
- XORPS ( XMM0, XMM0 ) /* 0 | 0 | 0 | 0 */
-
-ALIGNTEXT32
-LLBL(K_GTP23PR_top):
- MOVLPS( S(0), XMM4 ) /* oy | ox */
- MULPS( XMM1, XMM4 ) /* oy*m5 | ox*m0 */
- MOVLPS( XMM4, D(0) ) /* ->D(1) | ->D(0) */
- MOVSS( XMM3, D(2) ) /* ->D(2) */
- MOVSS( XMM0, D(3) ) /* ->D(3) */
-
-LLBL(K_GTP23PR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP23PR_top) )
-
-LLBL(K_GTP23PR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_2d)
-HIDDEN(_mesa_sse_transform_points2_2d)
-GLNAME(_mesa_sse_transform_points2_2d):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP23P2DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVLPS( M(0), XMM0 ) /* m1 | m0 */
- MOVLPS( M(4), XMM1 ) /* m5 | m4 */
- MOVLPS( M(12), XMM2 ) /* m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP23P2DR_top):
- MOVSS( S(0), XMM3 ) /* ox */
- SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox */
- MULPS( XMM0, XMM3 ) /* ox*m1 | ox*m0 */
-
- MOVSS( S(1), XMM4 ) /* oy */
- SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy */
- MULPS( XMM1, XMM4 ) /* oy*m5 | oy*m4 */
-
- ADDPS( XMM4, XMM3 )
- ADDPS( XMM2, XMM3 )
- MOVLPS( XMM3, D(0) ) /* ->D(1) | ->D(0) */
-
-LLBL(K_GTP23P2DR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP23P2DR_top) )
-
-LLBL(K_GTP23P2DR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_2d_no_rot)
-HIDDEN(_mesa_sse_transform_points2_2d_no_rot)
-GLNAME(_mesa_sse_transform_points2_2d_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP23P2DNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* m0 */
- MOVSS ( M(5), XMM2 ) /* m5 */
- UNPCKLPS ( XMM2, XMM1 ) /* m5 | m0 */
- MOVLPS ( M(12), XMM2 ) /* m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP23P2DNRR_top):
- MOVLPS( S(0), XMM0 ) /* oy | ox */
- MULPS( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
- ADDPS( XMM2, XMM0 ) /* +m13 | +m12 */
- MOVLPS( XMM0, D(0) ) /* ->D(1) | ->D(0) */
-
-LLBL(K_GTP23P2DNRR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP23P2DNRR_top) )
-
-LLBL(K_GTP23P2DNRR_finish):
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points2_3d)
-HIDDEN(_mesa_sse_transform_points2_3d)
-GLNAME(_mesa_sse_transform_points2_3d):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP23P3DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVAPS( M(0), XMM0 ) /* m2 | m1 | m0 */
- MOVAPS( M(4), XMM1 ) /* m6 | m5 | m4 */
- MOVAPS( M(12), XMM2 ) /* m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP23P3DR_top):
- MOVSS( S(0), XMM3 ) /* ox */
- SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ox | ox | ox */
- MULPS( XMM0, XMM3 ) /* ox*m2 | ox*m1 | ox*m0 */
-
- MOVSS( S(1), XMM4 ) /* oy */
- SHUFPS( CONST(0x0), XMM4, XMM4 ) /* oy | oy | oy */
- MULPS( XMM1, XMM4 ) /* oy*m6 | oy*m5 | oy*m4 */
-
- ADDPS( XMM4, XMM3 )
- ADDPS( XMM2, XMM3 )
-
- MOVLPS( XMM3, D(0) ) /* ->D(1) | ->D(0) */
- UNPCKHPS( XMM3, XMM3 )
- MOVSS( XMM3, D(2) ) /* ->D(2) */
-
-LLBL(K_GTP23P3DR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP23P3DR_top) )
-
-LLBL(K_GTP23P3DR_finish):
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform3.S b/nx-X11/extras/Mesa/src/mesa/x86/sse_xform3.S
deleted file mode 100644
index 0449d6858..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform3.S
+++ /dev/null
@@ -1,507 +0,0 @@
-/* $Id: sse_xform3.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/** TODO:
- * - insert PREFETCH instructions to avoid cache-misses !
- * - some more optimizations are possible...
- * - for 40-50% more performance in the SSE-functions, the
- * data (trans-matrix, src_vert, dst_vert) needs to be 16byte aligned !
- */
-
-#ifdef USE_SSE_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define S(i) REGOFF(i * 4, ESI)
-#define D(i) REGOFF(i * 4, EDI)
-#define M(i) REGOFF(i * 4, EDX)
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_general)
-HIDDEN(_mesa_sse_transform_points3_general)
-GLNAME( _mesa_sse_transform_points3_general ):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- CMP_L ( CONST(0), ECX ) /* count == 0 ? */
- JE ( LLBL(K_GTPGR_finish) ) /* yes -> nothing to do. */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVAPS ( REGOFF(0, EDX), XMM0 ) /* m0 | m1 | m2 | m3 */
- MOVAPS ( REGOFF(16, EDX), XMM1 ) /* m4 | m5 | m6 | m7 */
- MOVAPS ( REGOFF(32, EDX), XMM2 ) /* m8 | m9 | m10 | m11 */
- MOVAPS ( REGOFF(48, EDX), XMM3 ) /* m12 | m13 | m14 | m15 */
-
-
-ALIGNTEXT32
-LLBL(K_GTPGR_top):
- MOVSS ( REGOFF(0, ESI), XMM4 ) /* | | | ox */
- SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
- MOVSS ( REGOFF(4, ESI), XMM5 ) /* | | | oy */
- SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
- MOVSS ( REGOFF(8, ESI), XMM6 ) /* | | | oz */
- SHUFPS ( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
-
- MULPS ( XMM0, XMM4 ) /* m3*ox | m2*ox | m1*ox | m0*ox */
- MULPS ( XMM1, XMM5 ) /* m7*oy | m6*oy | m5*oy | m4*oy */
- MULPS ( XMM2, XMM6 ) /* m11*oz | m10*oz | m9*oz | m8*oz */
-
- ADDPS ( XMM5, XMM4 )
- ADDPS ( XMM6, XMM4 )
- ADDPS ( XMM3, XMM4 )
-
- MOVAPS ( XMM4, REGOFF(0, EDI) )
-
-LLBL(K_GTPGR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTPGR_top) )
-
-LLBL(K_GTPGR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_identity)
-HIDDEN(_mesa_sse_transform_points3_identity)
-GLNAME( _mesa_sse_transform_points3_identity ):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTPIR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
- CMP_L( ESI, EDI )
- JE( LLBL(K_GTPIR_finish) )
-
-
-ALIGNTEXT32
-LLBL(K_GTPIR_top):
- MOVLPS ( S(0), XMM0 )
- MOVLPS ( XMM0, D(0) )
- MOVSS ( S(2), XMM0 )
- MOVSS ( XMM0, D(2) )
-
-LLBL(K_GTPIR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTPIR_top) )
-
-LLBL(K_GTPIR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_3d_no_rot)
-HIDDEN(_mesa_sse_transform_points3_3d_no_rot)
-GLNAME(_mesa_sse_transform_points3_3d_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP3DNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
- MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
- UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
- MOVLPS ( M(12), XMM2 ) /* - | - | m13 | m12 */
- MOVSS ( M(10), XMM3 ) /* - | - | - | m10 */
- MOVSS ( M(14), XMM4 ) /* - | - | - | m14 */
-
-ALIGNTEXT32
-LLBL(K_GTP3DNRR_top):
-
- MOVLPS ( S(0), XMM0 ) /* - | - | s1 | s0 */
- MULPS ( XMM1, XMM0 ) /* - | - | s1*m5 | s0*m0 */
- ADDPS ( XMM2, XMM0 ) /* - | - | +m13 | +m12 */
- MOVLPS ( XMM0, D(0) ) /* -> D(1) | -> D(0) */
-
- MOVSS ( S(2), XMM0 ) /* sz */
- MULSS ( XMM3, XMM0 ) /* sz*m10 */
- ADDSS ( XMM4, XMM0 ) /* +m14 */
- MOVSS ( XMM0, D(2) ) /* -> D(2) */
-
-LLBL(K_GTP3DNRR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP3DNRR_top) )
-
-LLBL(K_GTP3DNRR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_perspective)
-HIDDEN(_mesa_sse_transform_points3_perspective)
-GLNAME(_mesa_sse_transform_points3_perspective):
-
-#define FRAME_OFFSET 8
- PUSH_L ( ESI )
- PUSH_L ( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP3PR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* - | - | - | m0 */
- MOVSS ( M(5), XMM2 ) /* - | - | - | m5 */
- UNPCKLPS ( XMM2, XMM1 ) /* - | - | m5 | m0 */
- MOVLPS ( M(8), XMM2 ) /* - | - | m9 | m8 */
- MOVSS ( M(10), XMM3 ) /* m10 */
- MOVSS ( M(14), XMM4 ) /* m14 */
- XORPS ( XMM6, XMM6 ) /* 0 */
-
-ALIGNTEXT32
-LLBL(K_GTP3PR_top):
- MOVLPS ( S(0), XMM0 ) /* oy | ox */
- MULPS ( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
- MOVSS ( S(2), XMM5 ) /* oz */
- SHUFPS ( CONST(0x0), XMM5, XMM5 ) /* oz | oz */
- MULPS ( XMM2, XMM5 ) /* oz*m9 | oz*m8 */
- ADDPS ( XMM5, XMM0 ) /* +oy*m5 | +ox*m0 */
- MOVLPS ( XMM0, D(0) ) /* ->D(1) | ->D(0) */
-
- MOVSS ( S(2), XMM0 ) /* oz */
- MULSS ( XMM3, XMM0 ) /* oz*m10 */
- ADDSS ( XMM4, XMM0 ) /* +m14 */
- MOVSS ( XMM0, D(2) ) /* ->D(2) */
-
- MOVSS ( S(2), XMM0 ) /* oz */
- MOVSS ( XMM6, XMM5 ) /* 0 */
- SUBPS ( XMM0, XMM5 ) /* -oz */
- MOVSS ( XMM5, D(3) ) /* ->D(3) */
-
-LLBL(K_GTP3PR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP3PR_top) )
-
-LLBL(K_GTP3PR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_2d)
-HIDDEN(_mesa_sse_transform_points3_2d)
-GLNAME(_mesa_sse_transform_points3_2d):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP3P2DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVLPS( M(0), XMM0 ) /* m1 | m0 */
- MOVLPS( M(4), XMM1 ) /* m5 | m4 */
- MOVLPS( M(12), XMM2 ) /* m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP3P2DR_top):
- MOVSS ( S(0), XMM3 ) /* ox */
- SHUFPS ( CONST(0x0), XMM3, XMM3 ) /* ox | ox */
- MULPS ( XMM0, XMM3 ) /* ox*m1 | ox*m0 */
- MOVSS ( S(1), XMM4 ) /* oy */
- SHUFPS ( CONST(0x0), XMM4, XMM4 ) /* oy | oy */
- MULPS ( XMM1, XMM4 ) /* oy*m5 | oy*m4 */
-
- ADDPS ( XMM4, XMM3 )
- ADDPS ( XMM2, XMM3 )
- MOVLPS ( XMM3, D(0) )
-
- MOVSS ( S(2), XMM3 )
- MOVSS ( XMM3, D(2) )
-
-LLBL(K_GTP3P2DR_skip):
- ADD_L ( CONST(16), EDI )
- ADD_L ( EAX, ESI )
- CMP_L ( ECX, EDI )
- JNE ( LLBL(K_GTP3P2DR_top) )
-
-LLBL(K_GTP3P2DR_finish):
- POP_L ( EDI )
- POP_L ( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_2d_no_rot)
-HIDDEN(_mesa_sse_transform_points3_2d_no_rot)
-GLNAME(_mesa_sse_transform_points3_2d_no_rot):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP3P2DNRR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-ALIGNTEXT32
- MOVSS ( M(0), XMM1 ) /* m0 */
- MOVSS ( M(5), XMM2 ) /* m5 */
- UNPCKLPS ( XMM2, XMM1 ) /* m5 | m0 */
- MOVLPS ( M(12), XMM2 ) /* m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP3P2DNRR_top):
- MOVLPS( S(0), XMM0 ) /* oy | ox */
- MULPS( XMM1, XMM0 ) /* oy*m5 | ox*m0 */
- ADDPS( XMM2, XMM0 ) /* +m13 | +m12 */
- MOVLPS( XMM0, D(0) ) /* ->D(1) | ->D(0) */
-
- MOVSS( S(2), XMM0 )
- MOVSS( XMM0, D(2) )
-
-LLBL(K_GTP3P2DNRR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP3P2DNRR_top) )
-
-LLBL(K_GTP3P2DNRR_finish):
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME(_mesa_sse_transform_points3_3d)
-HIDDEN(_mesa_sse_transform_points3_3d)
-GLNAME(_mesa_sse_transform_points3_3d):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( REGOFF(OFFSET_SOURCE+8, ESP), ESI ) /* ptr to source GLvector4f */
- MOV_L( REGOFF(OFFSET_DEST+8, ESP), EDI ) /* ptr to dest GLvector4f */
-
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP3P3DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) /* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
-
-ALIGNTEXT32
- MOVAPS( M(0), XMM0 ) /* m2 | m1 | m0 */
- MOVAPS( M(4), XMM1 ) /* m6 | m5 | m4 */
- MOVAPS( M(8), XMM2 ) /* m10 | m9 | m8 */
- MOVAPS( M(12), XMM3 ) /* m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL(K_GTP3P3DR_top):
- MOVSS( S(0), XMM4 )
- SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox */
- MULPS( XMM0, XMM4 ) /* ox*m2 | ox*m1 | ox*m0 */
-
- MOVSS( S(1), XMM5 )
- SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy */
- MULPS( XMM1, XMM5 ) /* oy*m6 | oy*m5 | oy*m4 */
-
- MOVSS( S(2), XMM6 )
- SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz */
- MULPS( XMM2, XMM6 ) /* oz*m10 | oz*m9 | oz*m8 */
-
- ADDPS( XMM5, XMM4 ) /* + | + | + */
- ADDPS( XMM6, XMM4 ) /* + | + | + */
- ADDPS( XMM3, XMM4 ) /* + | + | + */
-
- MOVLPS( XMM4, D(0) ) /* => D(1) | => D(0) */
- UNPCKHPS( XMM4, XMM4 )
- MOVSS( XMM4, D(2) )
-
-LLBL(K_GTP3P3DR_skip):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP3P3DR_top) )
-
-LLBL(K_GTP3P3DR_finish):
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform4.S b/nx-X11/extras/Mesa/src/mesa/x86/sse_xform4.S
deleted file mode 100644
index 2ac644ac7..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/sse_xform4.S
+++ /dev/null
@@ -1,231 +0,0 @@
-/* $Id: sse_xform4.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef USE_SSE_ASM
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FRAME_OFFSET 8
-
-#define SRC(i) REGOFF(i * 4, ESI)
-#define DST(i) REGOFF(i * 4, EDI)
-#define MAT(i) REGOFF(i * 4, EDX)
-
-#define SELECT(r0, r1, r2, r3) CONST( r0 * 64 + r1 * 16 + r2 * 4 + r3 )
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_sse_transform_points4_general )
-HIDDEN(_mesa_sse_transform_points4_general)
-GLNAME( _mesa_sse_transform_points4_general ):
-
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX ) /* verify non-zero count */
- JE( LLBL( sse_general_done ) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )/* set dest size */
-
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
-
- PREFETCHT0( REGIND(ESI) )
-
- MOVAPS( MAT(0), XMM4 ) /* m3 | m2 | m1 | m0 */
- MOVAPS( MAT(4), XMM5 ) /* m7 | m6 | m5 | m4 */
- MOVAPS( MAT(8), XMM6 ) /* m11 | m10 | m9 | m8 */
- MOVAPS( MAT(12), XMM7 ) /* m15 | m14 | m13 | m12 */
-
-ALIGNTEXT16
-LLBL( sse_general_loop ):
-
- MOVSS( SRC(0), XMM0 ) /* ox */
- SHUFPS( CONST(0x0), XMM0, XMM0 ) /* ox | ox | ox | ox */
- MULPS( XMM4, XMM0 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
-
- MOVSS( SRC(1), XMM1 ) /* oy */
- SHUFPS( CONST(0x0), XMM1, XMM1 ) /* oy | oy | oy | oy */
- MULPS( XMM5, XMM1 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
-
- MOVSS( SRC(2), XMM2 ) /* oz */
- SHUFPS( CONST(0x0), XMM2, XMM2 ) /* oz | oz | oz | oz */
- MULPS( XMM6, XMM2 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
-
- MOVSS( SRC(3), XMM3 ) /* ow */
- SHUFPS( CONST(0x0), XMM3, XMM3 ) /* ow | ow | ow | ow */
- MULPS( XMM7, XMM3 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
-
- ADDPS( XMM1, XMM0 ) /* ox*m3+oy*m7 | ... */
- ADDPS( XMM2, XMM0 ) /* ox*m3+oy*m7+oz*m11 | ... */
- ADDPS( XMM3, XMM0 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
- MOVAPS( XMM0, DST(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
-
- DEC_L( ECX )
- JNZ( LLBL( sse_general_loop ) )
-
-LLBL( sse_general_done ):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME( _mesa_sse_transform_points4_3d )
-HIDDEN(_mesa_sse_transform_points4_3d)
-GLNAME( _mesa_sse_transform_points4_3d ):
-
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI ) /* ptr to source GLvector4f */
- MOV_L( ARG_DEST, EDI ) /* ptr to dest GLvector4f */
-
- MOV_L( ARG_MATRIX, EDX ) /* ptr to matrix */
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
-
- TEST_L( ECX, ECX)
- JZ( LLBL(K_GTP43P3DR_finish) ) /* count was zero; go to finish */
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )/* set dest size */
-
- SHL_L( CONST(4), ECX ) /* count *= 16 */
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
-
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
- ADD_L( EDI, ECX ) /* count += dest ptr */
-
- MOVAPS( MAT(0), XMM0 ) /* m3 | m2 | m1 | m0 */
- MOVAPS( MAT(4), XMM1 ) /* m7 | m6 | m5 | m4 */
- MOVAPS( MAT(8), XMM2 ) /* m11 | m10 | m9 | m8 */
- MOVAPS( MAT(12), XMM3 ) /* m15 | m14 | m13 | m12 */
-
-ALIGNTEXT32
-LLBL( K_GTP43P3DR_top ):
- MOVSS( SRC(0), XMM4 ) /* ox */
- SHUFPS( CONST(0x0), XMM4, XMM4 ) /* ox | ox | ox | ox */
- MULPS( XMM0, XMM4 ) /* ox*m3 | ox*m2 | ox*m1 | ox*m0 */
-
- MOVSS( SRC(1), XMM5 ) /* oy */
- SHUFPS( CONST(0x0), XMM5, XMM5 ) /* oy | oy | oy | oy */
- MULPS( XMM1, XMM5 ) /* oy*m7 | oy*m6 | oy*m5 | oy*m4 */
-
- MOVSS( SRC(2), XMM6 ) /* oz */
- SHUFPS( CONST(0x0), XMM6, XMM6 ) /* oz | oz | oz | oz */
- MULPS( XMM2, XMM6 ) /* oz*m11 | oz*m10 | oz*m9 | oz*m8 */
-
- MOVSS( SRC(3), XMM7 ) /* ow */
- SHUFPS( CONST(0x0), XMM7, XMM7 ) /* ow | ow | ow | ow */
- MULPS( XMM3, XMM7 ) /* ow*m15 | ow*m14 | ow*m13 | ow*m12 */
-
- ADDPS( XMM5, XMM4 ) /* ox*m3+oy*m7 | ... */
- ADDPS( XMM6, XMM4 ) /* ox*m3+oy*m7+oz*m11 | ... */
- ADDPS( XMM7, XMM4 ) /* ox*m3+oy*m7+oz*m11+ow*m15 | ... */
- MOVAPS( XMM4, DST(0) ) /* ->D(3) | ->D(2) | ->D(1) | ->D(0) */
-
- MOVSS( SRC(3), XMM4 ) /* ow */
- MOVSS( XMM4, DST(3) ) /* ->D(3) */
-
-LLBL( K_GTP43P3DR_skip ):
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(K_GTP43P3DR_top) )
-
-LLBL( K_GTP43P3DR_finish ):
- POP_L( EDI )
- POP_L( ESI )
- RET
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_sse_transform_points4_identity )
-HIDDEN(_mesa_sse_transform_points4_identity)
-GLNAME( _mesa_sse_transform_points4_identity ):
-
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX ) /* verify non-zero count */
- JE( LLBL( sse_identity_done ) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) /* stride */
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) /* set dest flags */
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) /* set dest count */
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )/* set dest size */
-
- MOV_L( REGOFF(V4F_START, ESI), ESI ) /* ptr to first source vertex */
- MOV_L( REGOFF(V4F_START, EDI), EDI ) /* ptr to first dest vertex */
-
-ALIGNTEXT16
-LLBL( sse_identity_loop ):
-
- PREFETCHNTA( REGOFF(32, ESI) )
-
- MOVAPS( REGIND(ESI), XMM0 )
- ADD_L( EAX, ESI )
-
- MOVAPS( XMM0, REGIND(EDI) )
- ADD_L( CONST(16), EDI )
-
- DEC_L( ECX )
- JNZ( LLBL( sse_identity_loop ) )
-
-LLBL( sse_identity_done ):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/x86.c b/nx-X11/extras/Mesa/src/mesa/x86/x86.c
deleted file mode 100644
index aff71d224..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/x86.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $Id: x86.c,v 1.1.1.1 2004/06/16 09:19:37 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Intel x86 assembly code by Josh Vanderhoof
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "math/m_xform.h"
-#include "tnl/t_context.h"
-
-#include "x86.h"
-#include "common_x86_macros.h"
-
-#ifdef DEBUG
-#include "math/m_debug.h"
-#endif
-
-
-#ifdef USE_X86_ASM
-DECLARE_XFORM_GROUP( x86, 2 )
-DECLARE_XFORM_GROUP( x86, 3 )
-DECLARE_XFORM_GROUP( x86, 4 )
-
-
-extern GLvector4f * _ASMAPI
-_mesa_x86_cliptest_points4( GLvector4f *clip_vec,
- GLvector4f *proj_vec,
- GLubyte clipMask[],
- GLubyte *orMask,
- GLubyte *andMask );
-
-extern GLvector4f * _ASMAPI
-_mesa_x86_cliptest_points4_np( GLvector4f *clip_vec,
- GLvector4f *proj_vec,
- GLubyte clipMask[],
- GLubyte *orMask,
- GLubyte *andMask );
-
-extern void _ASMAPI
-_mesa_v16_x86_cliptest_points4( GLfloat *first_vert,
- GLfloat *last_vert,
- GLubyte *or_mask,
- GLubyte *and_mask,
- GLubyte *clip_mask );
-
-extern void _ASMAPI
-_mesa_v16_x86_general_xform( GLfloat *dest,
- const GLfloat *m,
- const GLfloat *src,
- GLuint src_stride,
- GLuint count );
-#endif
-
-
-void _mesa_init_x86_transform_asm( void )
-{
-#ifdef USE_X86_ASM
- ASSIGN_XFORM_GROUP( x86, 2 );
- ASSIGN_XFORM_GROUP( x86, 3 );
- ASSIGN_XFORM_GROUP( x86, 4 );
-
- _mesa_clip_tab[4] = _mesa_x86_cliptest_points4;
- _mesa_clip_np_tab[4] = _mesa_x86_cliptest_points4_np;
-
-#ifdef DEBUG
- _math_test_all_transform_functions( "x86" );
- _math_test_all_cliptest_functions( "x86" );
-#endif
-#endif
-}
-
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/x86.h b/nx-X11/extras/Mesa/src/mesa/x86/x86.h
deleted file mode 100644
index 920387707..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/x86.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $Id: x86.h,v 1.1.1.1 2004/06/16 09:19:37 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Intel x86 assembly code by Josh Vanderhoof
- */
-
-#ifndef __X86_H__
-#define __X86_H__
-
-extern void _mesa_init_x86_transform_asm( void );
-
-#endif
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/x86_cliptest.S b/nx-X11/extras/Mesa/src/mesa/x86/x86_cliptest.S
deleted file mode 100644
index 3fa9cb526..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/x86_cliptest.S
+++ /dev/null
@@ -1,403 +0,0 @@
-/* $Id: x86_cliptest.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * NOTE: Avoid using spaces in between '(' ')' and arguments, especially
- * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces
- * in there will break the build on some platforms.
- */
-
-#include "matypes.h"
-#include "clip_args.h"
-
-#define SRC0 REGOFF(0, ESI)
-#define SRC1 REGOFF(4, ESI)
-#define SRC2 REGOFF(8, ESI)
-#define SRC3 REGOFF(12, ESI)
-#define DST0 REGOFF(0, EDI)
-#define DST1 REGOFF(4, EDI)
-#define DST2 REGOFF(8, EDI)
-#define DST3 REGOFF(12, EDI)
-#define MAT0 REGOFF(0, EDX)
-#define MAT1 REGOFF(4, EDX)
-#define MAT2 REGOFF(8, EDX)
-#define MAT3 REGOFF(12, EDX)
-
-
-/*
- * Table for clip test.
- *
- * bit6 = SRC3 < 0
- * bit5 = SRC2 < 0
- * bit4 = abs(S(2)) > abs(S(3))
- * bit3 = SRC1 < 0
- * bit2 = abs(S(1)) > abs(S(3))
- * bit1 = SRC0 < 0
- * bit0 = abs(S(0)) > abs(S(3))
- */
-
- SEG_DATA
-
-clip_table:
- D_BYTE 0x00, 0x01, 0x00, 0x02, 0x04, 0x05, 0x04, 0x06
- D_BYTE 0x00, 0x01, 0x00, 0x02, 0x08, 0x09, 0x08, 0x0a
- D_BYTE 0x20, 0x21, 0x20, 0x22, 0x24, 0x25, 0x24, 0x26
- D_BYTE 0x20, 0x21, 0x20, 0x22, 0x28, 0x29, 0x28, 0x2a
- D_BYTE 0x00, 0x01, 0x00, 0x02, 0x04, 0x05, 0x04, 0x06
- D_BYTE 0x00, 0x01, 0x00, 0x02, 0x08, 0x09, 0x08, 0x0a
- D_BYTE 0x10, 0x11, 0x10, 0x12, 0x14, 0x15, 0x14, 0x16
- D_BYTE 0x10, 0x11, 0x10, 0x12, 0x18, 0x19, 0x18, 0x1a
- D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x37, 0x35, 0x37, 0x36
- D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x3b, 0x39, 0x3b, 0x3a
- D_BYTE 0x2f, 0x2d, 0x2f, 0x2e, 0x27, 0x25, 0x27, 0x26
- D_BYTE 0x2f, 0x2d, 0x2f, 0x2e, 0x2b, 0x29, 0x2b, 0x2a
- D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x37, 0x35, 0x37, 0x36
- D_BYTE 0x3f, 0x3d, 0x3f, 0x3e, 0x3b, 0x39, 0x3b, 0x3a
- D_BYTE 0x1f, 0x1d, 0x1f, 0x1e, 0x17, 0x15, 0x17, 0x16
- D_BYTE 0x1f, 0x1d, 0x1f, 0x1e, 0x1b, 0x19, 0x1b, 0x1a
-
-
- SEG_TEXT
-
-/*
- * _mesa_x86_cliptest_points4
- *
- * AL: ormask
- * AH: andmask
- * EBX: temp0
- * ECX: temp1
- * EDX: clipmask[]
- * ESI: clip[]
- * EDI: proj[]
- * EBP: temp2
- */
-
-#if defined(__ELF__) && defined(__PIC__) && defined(GNU_ASSEMBLER) && !defined(ELFPIC)
-#define ELFPIC
-#endif
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_cliptest_points4 )
-HIDDEN(_mesa_x86_cliptest_points4)
-GLNAME( _mesa_x86_cliptest_points4 ):
-
-#ifdef ELFPIC
-#define FRAME_OFFSET 20
-#else
-#define FRAME_OFFSET 16
-#endif
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBP )
- PUSH_L( EBX )
-
-#ifdef ELFPIC
- /* store pointer to clip_table on stack */
- CALL( LLBL(ctp4_get_eip) )
- ADD_L( CONST(_GLOBAL_OFFSET_TABLE_), EBX )
- MOV_L( REGOFF(clip_table@GOT, EBX), EBX )
- PUSH_L( EBX )
- JMP( LLBL(ctp4_clip_table_ready) )
-
-LLBL(ctp4_get_eip):
- /* store eip in ebx */
- MOV_L( REGIND(ESP), EBX )
- RET
-
-LLBL(ctp4_clip_table_ready):
-#endif
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_CLIP, EDX )
- MOV_L( ARG_OR, EBX )
-
- MOV_L( ARG_AND, EBP )
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
-
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
- MOV_L( EAX, ARG_SOURCE ) /* put stride in ARG_SOURCE */
-
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDX, ECX )
-
- MOV_L( ECX, ARG_CLIP ) /* put clipmask + count in ARG_CLIP */
- CMP_L( ECX, EDX )
-
- MOV_B( REGIND(EBX), AL )
- MOV_B( REGIND(EBP), AH )
-
- JZ( LLBL(ctp4_finish) )
-
-ALIGNTEXT16
-LLBL(ctp4_top):
-
- FLD1 /* F3 */
- FDIV_S( SRC3 ) /* GH: don't care about div-by-zero */
-
- MOV_L( SRC3, EBP )
- MOV_L( SRC2, EBX )
-
- XOR_L( ECX, ECX )
- ADD_L( EBP, EBP ) /* ebp = abs(S(3))*2 ; carry = sign of S(3) */
-
- ADC_L( ECX, ECX )
- ADD_L( EBX, EBX ) /* ebx = abs(S(2))*2 ; carry = sign of S(2) */
-
- ADC_L( ECX, ECX )
- CMP_L( EBX, EBP ) /* carry = abs(S(2))*2 > abs(S(3))*2 */
-
- ADC_L( ECX, ECX )
- MOV_L( SRC1, EBX )
-
- ADD_L( EBX, EBX ) /* ebx = abs(S(1))*2 ; carry = sign of S(1) */
-
- ADC_L( ECX, ECX )
- CMP_L( EBX, EBP ) /* carry = abs(S(1))*2 > abs(S(3))*2 */
-
- ADC_L( ECX, ECX )
- MOV_L( SRC0, EBX )
-
- ADD_L( EBX, EBX ) /* ebx = abs(S(0))*2 ; carry = sign of S(0) */
-
- ADC_L( ECX, ECX )
- CMP_L( EBX, EBP ) /* carry = abs(S(0))*2 > abs(S(3))*2 */
-
- ADC_L( ECX, ECX )
-
-#ifdef ELFPIC
- MOV_L( REGIND(ESP), EBP ) /* clip_table */
-
- MOV_B( REGBI(EBP, ECX), CL )
-#else
- MOV_B( REGOFF(clip_table,ECX), CL )
-#endif
-
- OR_B( CL, AL )
- AND_B( CL, AH )
-
- TEST_B( CL, CL )
- MOV_B( CL, REGIND(EDX) )
-
- JZ( LLBL(ctp4_proj) )
-
-LLBL(ctp4_noproj):
-
- FSTP( ST(0) ) /* */
-
- MOV_L( CONST(0), DST0 )
- MOV_L( CONST(0), DST1 )
- MOV_L( CONST(0), DST2 )
- MOV_L( CONST(0x3f800000), DST3 )
-
- JMP( LLBL(ctp4_next) )
-
-LLBL(ctp4_proj):
-
- FLD_S( SRC0 ) /* F0 F3 */
- FMUL2( ST(1), ST0 )
-
- FLD_S( SRC1 ) /* F1 F0 F3 */
- FMUL2( ST(2), ST0 )
-
- FLD_S( SRC2 ) /* F2 F1 F0 F3 */
- FMUL2( ST(3), ST0 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F3 */
- FSTP_S( DST0 ) /* F1 F2 F3 */
- FSTP_S( DST1 ) /* F2 F3 */
- FSTP_S( DST2 ) /* F3 */
- FSTP_S( DST3 ) /* */
-
-LLBL(ctp4_next):
-
- INC_L( EDX )
- ADD_L( CONST(16), EDI )
-
- ADD_L( ARG_SOURCE, ESI )
- CMP_L( EDX, ARG_CLIP )
-
- JNZ( LLBL(ctp4_top) )
-
- MOV_L( ARG_OR, ECX )
- MOV_L( ARG_AND, EDX )
-
- MOV_B( AL, REGIND(ECX) )
- MOV_B( AH, REGIND(EDX) )
-
-LLBL(ctp4_finish):
-
- MOV_L( ARG_DEST, EAX )
-#ifdef ELFPIC
- POP_L( ESI ) /* discard ptr to clip_table */
-#endif
- POP_L( EBX )
- POP_L( EBP )
- POP_L( EDI )
- POP_L( ESI )
-
- RET
-
-
-
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_cliptest_points4_np )
-HIDDEN(_mesa_x86_cliptest_points4_np)
-GLNAME( _mesa_x86_cliptest_points4_np ):
-
-#ifdef ELFPIC
-#define FRAME_OFFSET 20
-#else
-#define FRAME_OFFSET 16
-#endif
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBP )
- PUSH_L( EBX )
-
-#ifdef ELFPIC
- /* store pointer to clip_table on stack */
- CALL( LLBL(ctp4_np_get_eip) )
- ADD_L( CONST(_GLOBAL_OFFSET_TABLE_), EBX )
- MOV_L( REGOFF(clip_table@GOT, EBX), EBX )
- PUSH_L( EBX )
- JMP( LLBL(ctp4_np_clip_table_ready) )
-
-LLBL(ctp4_np_get_eip):
- /* store eip in ebx */
- MOV_L( REGIND(ESP), EBX )
- RET
-
-LLBL(ctp4_np_clip_table_ready):
-#endif
-
- MOV_L( ARG_SOURCE, ESI )
- /* slot */
-
- MOV_L( ARG_CLIP, EDX )
- MOV_L( ARG_OR, EBX )
-
- MOV_L( ARG_AND, EBP )
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
-
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( EAX, ARG_DEST ) /* put stride in ARG_DEST */
- ADD_L( EDX, ECX )
-
- MOV_L( ECX, EDI ) /* put clipmask + count in EDI */
- CMP_L( ECX, EDX )
-
- MOV_B( REGIND(EBX), AL )
- MOV_B( REGIND(EBP), AH )
-
- JZ( LLBL(ctp4_np_finish) )
-
-ALIGNTEXT16
-LLBL(ctp4_np_top):
-
- MOV_L( SRC3, EBP )
- MOV_L( SRC2, EBX )
-
- XOR_L( ECX, ECX )
- ADD_L( EBP, EBP ) /* ebp = abs(S(3))*2 ; carry = sign of S(3) */
-
- ADC_L( ECX, ECX )
- ADD_L( EBX, EBX ) /* ebx = abs(S(2))*2 ; carry = sign of S(2) */
-
- ADC_L( ECX, ECX )
- CMP_L( EBX, EBP ) /* carry = abs(S(2))*2 > abs(S(3))*2 */
-
- ADC_L( ECX, ECX )
- MOV_L( SRC1, EBX )
-
- ADD_L( EBX, EBX ) /* ebx = abs(S(1))*2 ; carry = sign of S(1) */
-
- ADC_L( ECX, ECX )
- CMP_L( EBX, EBP ) /* carry = abs(S(1))*2 > abs(S(3))*2 */
-
- ADC_L( ECX, ECX )
- MOV_L( SRC0, EBX )
-
- ADD_L( EBX, EBX ) /* ebx = abs(S(0))*2 ; carry = sign of S(0) */
-
- ADC_L( ECX, ECX )
- CMP_L( EBX, EBP ) /* carry = abs(S(0))*2 > abs(S(3))*2 */
-
- ADC_L( ECX, ECX )
-
-#ifdef ELFPIC
- MOV_L( REGIND(ESP), EBP ) /* clip_table */
-
- MOV_B( REGBI(EBP, ECX), CL )
-#else
- MOV_B( REGOFF(clip_table,ECX), CL )
-#endif
-
- OR_B( CL, AL )
- AND_B( CL, AH )
-
- TEST_B( CL, CL )
- MOV_B( CL, REGIND(EDX) )
-
- INC_L( EDX )
- /* slot */
-
- ADD_L( ARG_DEST, ESI )
- CMP_L( EDX, EDI )
-
- JNZ( LLBL(ctp4_np_top) )
-
- MOV_L( ARG_OR, ECX )
- MOV_L( ARG_AND, EDX )
-
- MOV_B( AL, REGIND(ECX) )
- MOV_B( AH, REGIND(EDX) )
-
-LLBL(ctp4_np_finish):
-
- MOV_L( ARG_SOURCE, EAX )
-#ifdef ELFPIC
- POP_L( ESI ) /* discard ptr to clip_table */
-#endif
- POP_L( EBX )
- POP_L( EBP )
- POP_L( EDI )
- POP_L( ESI )
-
- RET
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/x86_xform2.S b/nx-X11/extras/Mesa/src/mesa/x86/x86_xform2.S
deleted file mode 100644
index 61a031488..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/x86_xform2.S
+++ /dev/null
@@ -1,570 +0,0 @@
-/* $Id: x86_xform2.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * NOTE: Avoid using spaces in between '(' ')' and arguments, especially
- * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces
- * in there will break the build on some platforms.
- */
-
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FP_ONE 1065353216
-#define FP_ZERO 0
-
-#define SRC0 REGOFF(0, ESI)
-#define SRC1 REGOFF(4, ESI)
-#define SRC2 REGOFF(8, ESI)
-#define SRC3 REGOFF(12, ESI)
-#define DST0 REGOFF(0, EDI)
-#define DST1 REGOFF(4, EDI)
-#define DST2 REGOFF(8, EDI)
-#define DST3 REGOFF(12, EDI)
-#define MAT0 REGOFF(0, EDX)
-#define MAT1 REGOFF(4, EDX)
-#define MAT2 REGOFF(8, EDX)
-#define MAT3 REGOFF(12, EDX)
-#define MAT4 REGOFF(16, EDX)
-#define MAT5 REGOFF(20, EDX)
-#define MAT6 REGOFF(24, EDX)
-#define MAT7 REGOFF(28, EDX)
-#define MAT8 REGOFF(32, EDX)
-#define MAT9 REGOFF(36, EDX)
-#define MAT10 REGOFF(40, EDX)
-#define MAT11 REGOFF(44, EDX)
-#define MAT12 REGOFF(48, EDX)
-#define MAT13 REGOFF(52, EDX)
-#define MAT14 REGOFF(56, EDX)
-#define MAT15 REGOFF(60, EDX)
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points2_general )
-HIDDEN(_mesa_x86_transform_points2_general)
-GLNAME( _mesa_x86_transform_points2_general ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_gr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p2_gr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
- FLD_S( SRC0 ) /* F6 F5 F4 */
- FMUL_S( MAT2 )
- FLD_S( SRC0 ) /* F7 F6 F5 F4 */
- FMUL_S( MAT3 )
-
- FLD_S( SRC1 ) /* F0 F7 F6 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT5 )
- FLD_S( SRC1 ) /* F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT6 )
- FLD_S( SRC1 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT7 )
-
- FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */
- FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */
-
- FXCH( ST(3) ) /* F4 F6 F5 F7 */
- FADD_S( MAT12 )
- FXCH( ST(2) ) /* F5 F6 F4 F7 */
- FADD_S( MAT13 )
- FXCH( ST(1) ) /* F6 F5 F4 F7 */
- FADD_S( MAT14 )
- FXCH( ST(3) ) /* F7 F5 F4 F6 */
- FADD_S( MAT15 )
-
- FXCH( ST(2) ) /* F4 F5 F7 F6 */
- FSTP_S( DST0 ) /* F5 F7 F6 */
- FSTP_S( DST1 ) /* F7 F6 */
- FXCH( ST(1) ) /* F6 F7 */
- FSTP_S( DST2 ) /* F7 */
- FSTP_S( DST3 ) /* */
-
-LLBL(x86_p2_gr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_gr_loop) )
-
-LLBL(x86_p2_gr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points2_perspective )
-HIDDEN(_mesa_x86_transform_points2_perspective)
-GLNAME( _mesa_x86_transform_points2_perspective ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_pr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
- MOV_L( MAT14, EBX )
-
-ALIGNTEXT16
-LLBL(x86_p2_pr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F1 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F4 F1 */
- FSTP_S( DST0 ) /* F1 */
- FSTP_S( DST1 ) /* */
- MOV_L( EBX, DST2 )
- MOV_L( CONST(FP_ZERO), DST3 )
-
-LLBL(x86_p2_pr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_pr_loop) )
-
-LLBL(x86_p2_pr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points2_3d )
-HIDDEN(_mesa_x86_transform_points2_3d)
-GLNAME( _mesa_x86_transform_points2_3d ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_3dr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p2_3dr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
- FLD_S( SRC0 ) /* F6 F5 F4 */
- FMUL_S( MAT2 )
-
- FLD_S( SRC1 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT5 )
- FLD_S( SRC1 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT6 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- FXCH( ST(2) ) /* F4 F5 F6 */
- FADD_S( MAT12 )
- FXCH( ST(1) ) /* F5 F4 F6 */
- FADD_S( MAT13 )
- FXCH( ST(2) ) /* F6 F4 F5 */
- FADD_S( MAT14 )
-
- FXCH( ST(1) ) /* F4 F6 F5 */
- FSTP_S( DST0 ) /* F6 F5 */
- FXCH( ST(1) ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
-
-LLBL(x86_p2_3dr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_3dr_loop) )
-
-LLBL(x86_p2_3dr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points2_3d_no_rot )
-HIDDEN(_mesa_x86_transform_points2_3d_no_rot)
-GLNAME( _mesa_x86_transform_points2_3d_no_rot ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_3dnrr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
- MOV_L( MAT14, EBX )
-
-ALIGNTEXT16
-LLBL(x86_p2_3dnrr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F1 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F4 F1 */
- FADD_S( MAT12 )
- FLD_S( MAT13 ) /* F5 F4 F1 */
- FXCH( ST(2) ) /* F1 F4 F5 */
- FADDP( ST0, ST(2) ) /* F4 F5 */
-
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
- MOV_L( EBX, DST2 )
-
-LLBL(x86_p2_3dnrr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_3dnrr_loop) )
-
-LLBL(x86_p2_3dnrr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points2_2d )
-HIDDEN(_mesa_x86_transform_points2_2d)
-GLNAME( _mesa_x86_transform_points2_2d ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_2dr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p2_2dr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
-
- FLD_S( SRC1 ) /* F0 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F0 F1 F5 F4 */
- FADDP( ST0, ST(3) ) /* F1 F5 F4 */
- FADDP( ST0, ST(1) ) /* F5 F4 */
-
- FXCH( ST(1) ) /* F4 F5 */
- FADD_S( MAT12 )
- FXCH( ST(1) ) /* F5 F4 */
- FADD_S( MAT13 )
-
- FXCH( ST(1) ) /* F4 F5 */
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
-
-LLBL(x86_p2_2dr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_2dr_loop) )
-
-LLBL(x86_p2_2dr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT4
-GLOBL GLNAME( _mesa_x86_transform_points2_2d_no_rot )
-HIDDEN(_mesa_x86_transform_points2_2d_no_rot)
-GLNAME( _mesa_x86_transform_points2_2d_no_rot ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_2dnrr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p2_2dnrr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F1 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F4 F1 */
- FADD_S( MAT12 )
- FLD_S( MAT13 ) /* F5 F4 F1 */
- FXCH( ST(2) ) /* F1 F4 F5 */
- FADDP( ST0, ST(2) ) /* F4 F5 */
-
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
-
-LLBL(x86_p2_2dnrr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_2dnrr_loop) )
-
-LLBL(x86_p2_2dnrr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points2_identity )
-HIDDEN(_mesa_x86_transform_points2_identity)
-GLNAME( _mesa_x86_transform_points2_identity ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p2_ir_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_2), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(2), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
- CMP_L( ESI, EDI )
- JE( LLBL(x86_p2_ir_done) )
-
-ALIGNTEXT16
-LLBL(x86_p2_ir_loop):
-
- MOV_L( SRC0, EBX )
- MOV_L( SRC1, EDX )
-
- MOV_L( EBX, DST0 )
- MOV_L( EDX, DST1 )
-
-LLBL(x86_p2_ir_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p2_ir_loop) )
-
-LLBL(x86_p2_ir_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/x86_xform3.S b/nx-X11/extras/Mesa/src/mesa/x86/x86_xform3.S
deleted file mode 100644
index 04ef3a9ee..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/x86_xform3.S
+++ /dev/null
@@ -1,640 +0,0 @@
-/* $Id: x86_xform3.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * NOTE: Avoid using spaces in between '(' ')' and arguments, especially
- * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces
- * in there will break the build on some platforms.
- */
-
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FP_ONE 1065353216
-#define FP_ZERO 0
-
-#define SRC0 REGOFF(0, ESI)
-#define SRC1 REGOFF(4, ESI)
-#define SRC2 REGOFF(8, ESI)
-#define SRC3 REGOFF(12, ESI)
-#define DST0 REGOFF(0, EDI)
-#define DST1 REGOFF(4, EDI)
-#define DST2 REGOFF(8, EDI)
-#define DST3 REGOFF(12, EDI)
-#define MAT0 REGOFF(0, EDX)
-#define MAT1 REGOFF(4, EDX)
-#define MAT2 REGOFF(8, EDX)
-#define MAT3 REGOFF(12, EDX)
-#define MAT4 REGOFF(16, EDX)
-#define MAT5 REGOFF(20, EDX)
-#define MAT6 REGOFF(24, EDX)
-#define MAT7 REGOFF(28, EDX)
-#define MAT8 REGOFF(32, EDX)
-#define MAT9 REGOFF(36, EDX)
-#define MAT10 REGOFF(40, EDX)
-#define MAT11 REGOFF(44, EDX)
-#define MAT12 REGOFF(48, EDX)
-#define MAT13 REGOFF(52, EDX)
-#define MAT14 REGOFF(56, EDX)
-#define MAT15 REGOFF(60, EDX)
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_general )
-HIDDEN(_mesa_x86_transform_points3_general)
-GLNAME( _mesa_x86_transform_points3_general ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_gr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p3_gr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
- FLD_S( SRC0 ) /* F6 F5 F4 */
- FMUL_S( MAT2 )
- FLD_S( SRC0 ) /* F7 F6 F5 F4 */
- FMUL_S( MAT3 )
-
- FLD_S( SRC1 ) /* F0 F7 F6 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT5 )
- FLD_S( SRC1 ) /* F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT6 )
- FLD_S( SRC1 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT7 )
-
- FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */
- FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */
-
- FLD_S( SRC2 ) /* F0 F7 F6 F5 F4 */
- FMUL_S( MAT8 )
- FLD_S( SRC2 ) /* F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT9 )
- FLD_S( SRC2 ) /* F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT10 )
- FLD_S( SRC2 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT11 )
-
- FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */
- FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */
-
- FXCH( ST(3) ) /* F4 F6 F5 F7 */
- FADD_S( MAT12 )
- FXCH( ST(2) ) /* F5 F6 F4 F7 */
- FADD_S( MAT13 )
- FXCH( ST(1) ) /* F6 F5 F4 F7 */
- FADD_S( MAT14 )
- FXCH( ST(3) ) /* F7 F5 F4 F6 */
- FADD_S( MAT15 )
-
- FXCH( ST(2) ) /* F4 F5 F7 F6 */
- FSTP_S( DST0 ) /* F5 F7 F6 */
- FSTP_S( DST1 ) /* F7 F6 */
- FXCH( ST(1) ) /* F6 F7 */
- FSTP_S( DST2 ) /* F7 */
- FSTP_S( DST3 ) /* */
-
-LLBL(x86_p3_gr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_gr_loop) )
-
-LLBL(x86_p3_gr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_perspective )
-HIDDEN(_mesa_x86_transform_points3_perspective)
-GLNAME( _mesa_x86_transform_points3_perspective ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_pr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p3_pr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F5 F4 */
- FMUL_S( MAT5 )
-
- FLD_S( SRC2 ) /* F0 F5 F4 */
- FMUL_S( MAT8 )
- FLD_S( SRC2 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT9 )
- FLD_S( SRC2 ) /* F2 F1 F0 F5 F4 */
- FMUL_S( MAT10 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F5 F4 */
- FADDP( ST0, ST(4) ) /* F1 F2 F5 F4 */
- FADDP( ST0, ST(2) ) /* F2 F5 F4 */
- FLD_S( MAT14 ) /* F6 F2 F5 F4 */
- FXCH( ST(1) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- MOV_L( SRC2, EBX )
- XOR_L( CONST(-2147483648), EBX )/* change sign */
-
- FXCH( ST(2) ) /* F4 F5 F6 */
- FSTP_S( DST0 ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
- MOV_L( EBX, DST3 )
-
-LLBL(x86_p3_pr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_pr_loop) )
-
-LLBL(x86_p3_pr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_3d )
-HIDDEN(_mesa_x86_transform_points3_3d)
-GLNAME( _mesa_x86_transform_points3_3d ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_3dr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p3_3dr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
- FLD_S( SRC0 ) /* F6 F5 F4 */
- FMUL_S( MAT2 )
-
- FLD_S( SRC1 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT5 )
- FLD_S( SRC1 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT6 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- FLD_S( SRC2 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT8 )
- FLD_S( SRC2 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT9 )
- FLD_S( SRC2 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT10 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- FXCH( ST(2) ) /* F4 F5 F6 */
- FADD_S( MAT12 )
- FXCH( ST(1) ) /* F5 F4 F6 */
- FADD_S( MAT13 )
- FXCH( ST(2) ) /* F6 F4 F5 */
- FADD_S( MAT14 )
-
- FXCH( ST(1) ) /* F4 F6 F5 */
- FSTP_S( DST0 ) /* F6 F5 */
- FXCH( ST(1) ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
-
-LLBL(x86_p3_3dr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_3dr_loop) )
-
-LLBL(x86_p3_3dr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_3d_no_rot )
-HIDDEN(_mesa_x86_transform_points3_3d_no_rot)
-GLNAME( _mesa_x86_transform_points3_3d_no_rot ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_3dnrr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p3_3dnrr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F1 F4 */
- FMUL_S( MAT5 )
-
- FLD_S( SRC2 ) /* F2 F1 F4 */
- FMUL_S( MAT10 )
-
- FXCH( ST(2) ) /* F4 F1 F2 */
- FADD_S( MAT12 )
- FLD_S( MAT13 ) /* F5 F4 F1 F2 */
- FXCH( ST(2) ) /* F1 F4 F5 F2 */
- FADDP( ST0, ST(2) ) /* F4 F5 F2 */
- FLD_S( MAT14 ) /* F6 F4 F5 F2 */
- FXCH( ST(3) ) /* F2 F4 F5 F6 */
- FADDP( ST0, ST(3) ) /* F4 F5 F6 */
-
- FSTP_S( DST0 ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
-
-LLBL(x86_p3_3dnrr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_3dnrr_loop) )
-
-LLBL(x86_p3_3dnrr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_2d )
-HIDDEN(_mesa_x86_transform_points3_2d)
-GLNAME( _mesa_x86_transform_points3_2d ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_2dr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p3_2dr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
-
- FLD_S( SRC1 ) /* F0 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F0 F1 F5 F4 */
- FADDP( ST0, ST(3) ) /* F1 F5 F4 */
- FADDP( ST0, ST(1) ) /* F5 F4 */
-
- FXCH( ST(1) ) /* F4 F5 */
- FADD_S( MAT12 )
- FXCH( ST(1) ) /* F5 F4 */
- FADD_S( MAT13 )
-
- MOV_L( SRC2, EBX )
-
- FXCH( ST(1) ) /* F4 F5 */
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
- MOV_L( EBX, DST2 )
-
-LLBL(x86_p3_2dr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_2dr_loop) )
-
-LLBL(x86_p3_2dr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_2d_no_rot )
-HIDDEN(_mesa_x86_transform_points3_2d_no_rot)
-GLNAME( _mesa_x86_transform_points3_2d_no_rot ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_2dnrr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p3_2dnrr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F1 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F4 F1 */
- FADD_S( MAT12 )
- FLD_S( MAT13 ) /* F5 F4 F1 */
-
- FXCH( ST(2) ) /* F1 F4 F5 */
- FADDP( ST0, ST(2) ) /* F4 F5 */
-
- MOV_L( SRC2, EBX )
-
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
- MOV_L( EBX, DST2 )
-
-LLBL(x86_p3_2dnrr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_2dnrr_loop) )
-
-LLBL(x86_p3_2dnrr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points3_identity )
-HIDDEN(_mesa_x86_transform_points3_identity)
-GLNAME(_mesa_x86_transform_points3_identity ):
-
-#define FRAME_OFFSET 16
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
- PUSH_L( EBP )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p3_ir_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_3), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
- CMP_L( ESI, EDI )
- JE( LLBL(x86_p3_ir_done) )
-
-ALIGNTEXT16
-LLBL(x86_p3_ir_loop):
-
-#if 1
- MOV_L( SRC0, EBX )
- MOV_L( SRC1, EBP )
- MOV_L( SRC2, EDX )
-
- MOV_L( EBX, DST0 )
- MOV_L( EBP, DST1 )
- MOV_L( EDX, DST2 )
-#else
- FLD_S( SRC0 )
- FLD_S( SRC1 )
- FLD_S( SRC2 )
-
- FSTP_S( DST2 )
- FSTP_S( DST1 )
- FSTP_S( DST0 )
-#endif
-
-LLBL(x86_p3_ir_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p3_ir_loop) )
-
-LLBL(x86_p3_ir_done):
-
- POP_L( EBP )
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/x86_xform4.S b/nx-X11/extras/Mesa/src/mesa/x86/x86_xform4.S
deleted file mode 100644
index 79e6b657a..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/x86_xform4.S
+++ /dev/null
@@ -1,673 +0,0 @@
-/* $Id: x86_xform4.S,v 1.1.1.2 2005/07/31 16:46:39 ajax Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * NOTE: Avoid using spaces in between '(' ')' and arguments, especially
- * with macros like CONST, LLBL that expand to CONCAT(...). Putting spaces
- * in there will break the build on some platforms.
- */
-
-#include "matypes.h"
-#include "xform_args.h"
-
- SEG_TEXT
-
-#define FP_ONE 1065353216
-#define FP_ZERO 0
-
-#define SRC0 REGOFF(0, ESI)
-#define SRC1 REGOFF(4, ESI)
-#define SRC2 REGOFF(8, ESI)
-#define SRC3 REGOFF(12, ESI)
-#define DST0 REGOFF(0, EDI)
-#define DST1 REGOFF(4, EDI)
-#define DST2 REGOFF(8, EDI)
-#define DST3 REGOFF(12, EDI)
-#define MAT0 REGOFF(0, EDX)
-#define MAT1 REGOFF(4, EDX)
-#define MAT2 REGOFF(8, EDX)
-#define MAT3 REGOFF(12, EDX)
-#define MAT4 REGOFF(16, EDX)
-#define MAT5 REGOFF(20, EDX)
-#define MAT6 REGOFF(24, EDX)
-#define MAT7 REGOFF(28, EDX)
-#define MAT8 REGOFF(32, EDX)
-#define MAT9 REGOFF(36, EDX)
-#define MAT10 REGOFF(40, EDX)
-#define MAT11 REGOFF(44, EDX)
-#define MAT12 REGOFF(48, EDX)
-#define MAT13 REGOFF(52, EDX)
-#define MAT14 REGOFF(56, EDX)
-#define MAT15 REGOFF(60, EDX)
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points4_general )
-HIDDEN(_mesa_x86_transform_points4_general)
-GLNAME( _mesa_x86_transform_points4_general ):
-
-#define FRAME_OFFSET 8
- PUSH_L( ESI )
- PUSH_L( EDI )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_gr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p4_gr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
- FLD_S( SRC0 ) /* F6 F5 F4 */
- FMUL_S( MAT2 )
- FLD_S( SRC0 ) /* F7 F6 F5 F4 */
- FMUL_S( MAT3 )
-
- FLD_S( SRC1 ) /* F0 F7 F6 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT5 )
- FLD_S( SRC1 ) /* F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT6 )
- FLD_S( SRC1 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT7 )
-
- FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */
- FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */
-
- FLD_S( SRC2 ) /* F0 F7 F6 F5 F4 */
- FMUL_S( MAT8 )
- FLD_S( SRC2 ) /* F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT9 )
- FLD_S( SRC2 ) /* F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT10 )
- FLD_S( SRC2 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT11 )
-
- FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */
- FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */
-
- FLD_S( SRC3 ) /* F0 F7 F6 F5 F4 */
- FMUL_S( MAT12 )
- FLD_S( SRC3 ) /* F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT13 )
- FLD_S( SRC3 ) /* F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT14 )
- FLD_S( SRC3 ) /* F3 F2 F1 F0 F7 F6 F5 F4 */
- FMUL_S( MAT15 )
-
- FXCH( ST(3) ) /* F0 F2 F1 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(7) ) /* F2 F1 F3 F7 F6 F5 F4 */
- FXCH( ST(1) ) /* F1 F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F2 F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F3 F7 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F7 F6 F5 F4 */
-
- FXCH( ST(3) ) /* F4 F6 F5 F7 */
- FSTP_S( DST0 ) /* F6 F5 F7 */
- FXCH( ST(1) ) /* F5 F6 F7 */
- FSTP_S( DST1 ) /* F6 F7 */
- FSTP_S( DST2 ) /* F7 */
- FSTP_S( DST3 ) /* */
-
-LLBL(x86_p4_gr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_gr_loop) )
-
-LLBL(x86_p4_gr_done):
-
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points4_perspective )
-HIDDEN(_mesa_x86_transform_points4_perspective)
-GLNAME( _mesa_x86_transform_points4_perspective ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_pr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p4_pr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F5 F4 */
- FMUL_S( MAT5 )
-
- FLD_S( SRC2 ) /* F0 F5 F4 */
- FMUL_S( MAT8 )
- FLD_S( SRC2 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT9 )
- FLD_S( SRC2 ) /* F6 F1 F0 F5 F4 */
- FMUL_S( MAT10 )
-
- FXCH( ST(2) ) /* F0 F1 F6 F5 F4 */
- FADDP( ST0, ST(4) ) /* F1 F6 F5 F4 */
- FADDP( ST0, ST(2) ) /* F6 F5 F4 */
-
- FLD_S( SRC3 ) /* F2 F6 F5 F4 */
- FMUL_S( MAT14 )
-
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- MOV_L( SRC2, EBX )
- XOR_L( CONST(-2147483648), EBX )/* change sign */
-
- FXCH( ST(2) ) /* F4 F5 F6 */
- FSTP_S( DST0 ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
- MOV_L( EBX, DST3 )
-
-LLBL(x86_p4_pr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_pr_loop) )
-
-LLBL(x86_p4_pr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points4_3d )
-HIDDEN(_mesa_x86_transform_points4_3d)
-GLNAME( _mesa_x86_transform_points4_3d ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_3dr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p4_3dr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
- FLD_S( SRC0 ) /* F6 F5 F4 */
- FMUL_S( MAT2 )
-
- FLD_S( SRC1 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT5 )
- FLD_S( SRC1 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT6 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- FLD_S( SRC2 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT8 )
- FLD_S( SRC2 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT9 )
- FLD_S( SRC2 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT10 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- FLD_S( SRC3 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT12 )
- FLD_S( SRC3 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT13 )
- FLD_S( SRC3 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT14 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- MOV_L( SRC3, EBX )
-
- FXCH( ST(2) ) /* F4 F5 F6 */
- FSTP_S( DST0 ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
- MOV_L( EBX, DST3 )
-
-LLBL(x86_p4_3dr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_3dr_loop) )
-
-LLBL(x86_p4_3dr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME(_mesa_x86_transform_points4_3d_no_rot)
-HIDDEN(_mesa_x86_transform_points4_3d_no_rot)
-GLNAME(_mesa_x86_transform_points4_3d_no_rot):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_3dnrr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p4_3dnrr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F5 F4 */
- FMUL_S( MAT5 )
-
- FLD_S( SRC2 ) /* F6 F5 F4 */
- FMUL_S( MAT10 )
-
- FLD_S( SRC3 ) /* F0 F6 F5 F4 */
- FMUL_S( MAT12 )
- FLD_S( SRC3 ) /* F1 F0 F6 F5 F4 */
- FMUL_S( MAT13 )
- FLD_S( SRC3 ) /* F2 F1 F0 F6 F5 F4 */
- FMUL_S( MAT14 )
-
- FXCH( ST(2) ) /* F0 F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(5) ) /* F1 F2 F6 F5 F4 */
- FADDP( ST0, ST(3) ) /* F2 F6 F5 F4 */
- FADDP( ST0, ST(1) ) /* F6 F5 F4 */
-
- MOV_L( SRC3, EBX )
-
- FXCH( ST(2) ) /* F4 F5 F6 */
- FSTP_S( DST0 ) /* F5 F6 */
- FSTP_S( DST1 ) /* F6 */
- FSTP_S( DST2 ) /* */
- MOV_L( EBX, DST3 )
-
-LLBL(x86_p4_3dnrr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_3dnrr_loop) )
-
-LLBL(x86_p4_3dnrr_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points4_2d )
-HIDDEN(_mesa_x86_transform_points4_2d)
-GLNAME( _mesa_x86_transform_points4_2d ):
-
-#define FRAME_OFFSET 16
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
- PUSH_L( EBP )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_2dr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p4_2dr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
- FLD_S( SRC0 ) /* F5 F4 */
- FMUL_S( MAT1 )
-
- FLD_S( SRC1 ) /* F0 F5 F4 */
- FMUL_S( MAT4 )
- FLD_S( SRC1 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT5 )
-
- FXCH( ST(1) ) /* F0 F1 F5 F4 */
- FADDP( ST0, ST(3) ) /* F1 F5 F4 */
- FADDP( ST0, ST(1) ) /* F5 F4 */
-
- FLD_S( SRC3 ) /* F0 F5 F4 */
- FMUL_S( MAT12 )
- FLD_S( SRC3 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT13 )
-
- FXCH( ST(1) ) /* F0 F1 F5 F4 */
- FADDP( ST0, ST(3) ) /* F1 F5 F4 */
- FADDP( ST0, ST(1) ) /* F5 F4 */
-
- MOV_L( SRC2, EBX )
- MOV_L( SRC3, EBP )
-
- FXCH( ST(1) ) /* F4 F5 */
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
- MOV_L( EBX, DST2 )
- MOV_L( EBP, DST3 )
-
-LLBL(x86_p4_2dr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_2dr_loop) )
-
-LLBL(x86_p4_2dr_done):
-
- POP_L( EBP )
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points4_2d_no_rot )
-HIDDEN(_mesa_x86_transform_points4_2d_no_rot)
-GLNAME( _mesa_x86_transform_points4_2d_no_rot ):
-
-#define FRAME_OFFSET 16
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
- PUSH_L( EBP )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_2dnrr_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
-ALIGNTEXT16
-LLBL(x86_p4_2dnrr_loop):
-
- FLD_S( SRC0 ) /* F4 */
- FMUL_S( MAT0 )
-
- FLD_S( SRC1 ) /* F5 F4 */
- FMUL_S( MAT5 )
-
- FLD_S( SRC3 ) /* F0 F5 F4 */
- FMUL_S( MAT12 )
- FLD_S( SRC3 ) /* F1 F0 F5 F4 */
- FMUL_S( MAT13 )
-
- FXCH( ST(1) ) /* F0 F1 F5 F4 */
- FADDP( ST0, ST(3) ) /* F1 F5 F4 */
- FADDP( ST0, ST(1) ) /* F5 F4 */
-
- MOV_L( SRC2, EBX )
- MOV_L( SRC3, EBP )
-
- FXCH( ST(1) ) /* F4 F5 */
- FSTP_S( DST0 ) /* F5 */
- FSTP_S( DST1 ) /* */
- MOV_L( EBX, DST2 )
- MOV_L( EBP, DST3 )
-
-LLBL(x86_p4_2dnrr_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_2dnrr_loop) )
-
-LLBL(x86_p4_2dnrr_done):
-
- POP_L( EBP )
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
-#undef FRAME_OFFSET
-
-
-
-
-ALIGNTEXT16
-GLOBL GLNAME( _mesa_x86_transform_points4_identity )
-HIDDEN(_mesa_x86_transform_points4_identity)
-GLNAME( _mesa_x86_transform_points4_identity ):
-
-#define FRAME_OFFSET 12
- PUSH_L( ESI )
- PUSH_L( EDI )
- PUSH_L( EBX )
-
- MOV_L( ARG_SOURCE, ESI )
- MOV_L( ARG_DEST, EDI )
-
- MOV_L( ARG_MATRIX, EDX )
- MOV_L( REGOFF(V4F_COUNT, ESI), ECX )
-
- TEST_L( ECX, ECX )
- JZ( LLBL(x86_p4_ir_done) )
-
- MOV_L( REGOFF(V4F_STRIDE, ESI), EAX )
- OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) )
-
- MOV_L( ECX, REGOFF(V4F_COUNT, EDI) )
- MOV_L( CONST(4), REGOFF(V4F_SIZE, EDI) )
-
- SHL_L( CONST(4), ECX )
- MOV_L( REGOFF(V4F_START, ESI), ESI )
-
- MOV_L( REGOFF(V4F_START, EDI), EDI )
- ADD_L( EDI, ECX )
-
- CMP_L( ESI, EDI )
- JE( LLBL(x86_p4_ir_done) )
-
-ALIGNTEXT16
-LLBL(x86_p4_ir_loop):
-
- MOV_L( SRC0, EBX )
- MOV_L( SRC1, EDX )
-
- MOV_L( EBX, DST0 )
- MOV_L( EDX, DST1 )
-
- MOV_L( SRC2, EBX )
- MOV_L( SRC3, EDX )
-
- MOV_L( EBX, DST2 )
- MOV_L( EDX, DST3 )
-
-LLBL(x86_p4_ir_skip):
-
- ADD_L( CONST(16), EDI )
- ADD_L( EAX, ESI )
- CMP_L( ECX, EDI )
- JNE( LLBL(x86_p4_ir_loop) )
-
-LLBL(x86_p4_ir_done):
-
- POP_L( EBX )
- POP_L( EDI )
- POP_L( ESI )
- RET
diff --git a/nx-X11/extras/Mesa/src/mesa/x86/xform_args.h b/nx-X11/extras/Mesa/src/mesa/x86/xform_args.h
deleted file mode 100644
index 349e47ac6..000000000
--- a/nx-X11/extras/Mesa/src/mesa/x86/xform_args.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $Id: xform_args.h,v 1.1.1.1 2004/06/16 09:19:37 anholt Exp $ */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Transform function interface for assembly code. Simply define
- * FRAME_OFFSET to the number of bytes pushed onto the stack before
- * using the ARG_* argument macros.
- *
- * Gareth Hughes
- */
-
-#ifndef __XFORM_ARGS_H__
-#define __XFORM_ARGS_H__
-
-/* Offsets for transform_func arguments
- *
- * typedef void (*transform_func)( GLvector4f *to_vec,
- * const GLfloat m[16],
- * const GLvector4f *from_vec );
- */
-#define OFFSET_DEST 4
-#define OFFSET_MATRIX 8
-#define OFFSET_SOURCE 12
-
-#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
-#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
-#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
-
-#endif
diff --git a/nx-X11/extras/Mesa/vms/analyze_map.com b/nx-X11/extras/Mesa/vms/analyze_map.com
deleted file mode 100644
index d024ffcf9..000000000
--- a/nx-X11/extras/Mesa/vms/analyze_map.com
+++ /dev/null
@@ -1,148 +0,0 @@
-$! Analyze Map for OpenVMS AXP
-$!
-$! Originally found in the distribution of gv
-$! http://wwwthep.physik.uni-mainz.de/~plass/gv/
-$!
-$! 1-Jul-1999 : modified to be used with $BSS$ & $READONLY sections in the
-$! map-file by J. Jansen (joukj@hrem.stm.tudelft.nl)
-$!
-$ SET SYMBOL/GENERAL/SCOPE=(NOLOCAL,NOGLOBAL)
-$ SAY := "WRITE_ SYS$OUTPUT"
-$
-$ IF F$SEARCH("''P1'") .EQS. ""
-$ THEN
-$ SAY " ANALYZE_MAP.COM: Error, no mapfile provided"
-$ EXIT_
-$ ENDIF
-$ IF "''P2'" .EQS. ""
-$ THEN
-$ SAY " ANALYZE_MAP.COM: Error, no output file provided"
-$ EXIT_
-$ ENDIF
-$
-$ LINK_TMP = F$PARSE(P2,,,"DEVICE")+F$PARSE(P2,,,"DIRECTORY")+F$PARSE(P2,,,"NAME")+".TMP"
-$
-$ SAY " checking PSECT list in ''P2'"
-$ OPEN_/READ IN 'P1'
-$ LOOP_PSECT_SEARCH:
-$ READ_/END=EOF_PSECT IN REC
-$ LOOP_PSECT_SEARCH0:
-$ if F$EXTRACT(0,5,REC) .eqs. "$DATA" .or. F$EXTRACT(0,5,REC) .eqs. -
- "$BSS$" .or. f$extract(0,10,rec) .eqs. "$READONLY$" then goto do_data
-$ if F$EXTRACT(0,14,REC) .eqs. "$READONLY_ADDR" then goto do_readonly
-$ goto LOOP_PSECT_SEARCH
-$ do_data:
-$ LAST = ""
-$ LOOP_PSECT:
-$ READ_/END=EOF_PSECT IN REC
-$ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,5,REC) .nes. "$DATA" -
- .and. F$EXTRACT(0,5,REC) .nes. "$BSS$" .and. f$extract(0,10,rec) -
- .nes. "$READONLY$" then goto LOOP_PSECT_SEARCH0
-$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE, WRT,NOVEC" .nes. REC
-$ then
-$ J = F$LOCATE(" ",REC)
-$ S = F$EXTRACT(0,J,REC)
-$ IF S .EQS. LAST THEN GOTO LOOP_PSECT
-$ P$_'S= 1
-$ LAST = S
-$ endif
-$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC" .nes. REC
-$ then
-$ J = F$LOCATE(" ",REC)
-$ S = F$EXTRACT(0,J,REC)
-$ IF S .EQS. LAST THEN GOTO LOOP_PSECT
-$ P$_'S= 1
-$ LAST = S
-$ endif
-$ GOTO LOOP_PSECT
-$
-$ do_readonly:
-$ LAST = ""
-$ LOOP_PSECT3:
-$ READ_/END=EOF_PSECT IN REC
-$ if F$EXTRACT(0,1,REC) .eqs. "-" .or. F$EXTRACT(0,3,REC) .eqs. "NL:" then -
- goto loop_psect3
-$ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,14,REC) .nes. -
- "$READONLY_ADDR" then goto LOOP_PSECT_SEARCH0
-$ if REC - "OCTA" .nes. REC
-$ then
-$ J = F$LOCATE(" ",REC)
-$ S = F$EXTRACT(0,J,REC)
-$ IF S .EQS. LAST THEN GOTO LOOP_PSECT3
-$ P$_'S= 1
-$ LAST = S
-$ endif
-$ GOTO LOOP_PSECT3
-$
-$ EOF_PSECT:
-$ CLOSE_ IN
-$
-$ SAY " appending list of UNIVERSAL procedures to ''P2'"
-$ SEARCH_/NOHIGH/WINDOW=(0,0) 'P1' " R-"/OUT='LINK_TMP
-$ OPEN_/READ IN 'LINK_TMP
-$ OPEN_/write OUT 'P2'
-$ WRITE_ OUT "!"
-$ WRITE_ OUT "! ### UNIVERSAL procedures and global definitions extracted from ''P1'"
-$ WRITE_ OUT "!"
-$ write_ OUT "case_sensitive=YES"
-$ LOOP_UNIVERSAL:
-$ READ_/END=EOF_UNIVERSAL IN REC
-$ J = F$LOCATE(" R-",REC)
-$ S = F$EXTRACT(J+3,F$length(rec),REC)
-$ J = F$LOCATE(" ",S)
-$ S = F$EXTRACT(0,J,S)
-$ PP$_'S= 1
-$ IF F$TYPE(P$_'S').EQS.""
-$ THEN
-$ WRITE_ OUT "symbol_vector = ("+S+" = PROCEDURE)"
-$ ELSE
-$ WRITE_ OUT "symbol_vector = ("+S+" = DATA)"
-$ ENDIF
-$ GOTO LOOP_UNIVERSAL
-$ EOF_UNIVERSAL:
-$ CLOSE_ IN
-$ CLOSE_ OUT
-$!
-$ SAY " creating PSECT list in ''P2'"
-$ OPEN_/READ IN 'P1'
-$ OPEN_/append OUT 'P2'
-$ WRITE_ OUT "!"
-$ WRITE_ OUT "! ### PSECT list extracted from ''P1'"
-$ WRITE_ OUT "!"
-$ LOOP_PSECT_SEARCH1:
-$ READ_/END=EOF_PSECT1 IN REC
-$ if F$EXTRACT(0,5,REC) .nes. "$DATA" .and. F$EXTRACT(0,5,REC) .nes. -
- "$BSS$" .and. f$extract(0,10,rec) .nes. "$READONLY$" then goto -
- LOOP_PSECT_SEARCH1
-$ LAST = ""
-$ LOOP_PSECT1:
-$ READ_/END=EOF_PSECT1 IN REC
-$ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,5,REC) .nes. "$DATA" -
- .and. F$EXTRACT(0,5,REC) .nes. "$BSS$" .and. f$extract(0,10,rec) -
- .nes. "$READONLY$" then goto LOOP_PSECT_SEARCH1
-$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE, WRT,NOVEC" .nes. REC
-$ then
-$ J = F$LOCATE(" ",REC)
-$ S = F$EXTRACT(0,J,REC)
-$ IF S .EQS. LAST THEN GOTO LOOP_PSECT1
-$ IF F$TYPE(PP$_'S').nes."" then WRITE_ OUT "symbol_vector = (" + S + " = PSECT)"
-$ P$_'S= 1
-$ LAST = S
-$ endif
-$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC" .nes. REC
-$ then
-$ J = F$LOCATE(" ",REC)
-$ S = F$EXTRACT(0,J,REC)
-$ IF S .EQS. LAST THEN GOTO LOOP_PSECT1
-$ IF F$TYPE(PP$_'S').nes."" then WRITE_ OUT "symbol_vector = (" + S + " = PSECT)"
-$ P$_'S= 1
-$ LAST = S
-$ endif
-$ GOTO LOOP_PSECT1
-$
-$ EOF_PSECT1:
-$ CLOSE_ IN
-$ CLOSE_ OUT
-$ if f$search("''LINK_TMP'") .nes. "" then DELETE_/NOLOG/NOCONFIRM 'LINK_TMP';*
-$
-$ EXIT_
diff --git a/nx-X11/extras/Mesa/vms/xlib.opt b/nx-X11/extras/Mesa/vms/xlib.opt
deleted file mode 100644
index acae358b5..000000000
--- a/nx-X11/extras/Mesa/vms/xlib.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-sys$library:decw$xlibshr.exe/share
-sys$library:decw$xmulibshr.exe/share
diff --git a/nx-X11/extras/Mesa/vms/xlib_share.opt b/nx-X11/extras/Mesa/vms/xlib_share.opt
deleted file mode 100644
index ebe039f01..000000000
--- a/nx-X11/extras/Mesa/vms/xlib_share.opt
+++ /dev/null
@@ -1,7 +0,0 @@
-[--.lib]libmesagl.exe/share
-[--.lib]libmesaglu.exe/share
-[--.lib]libglut.exe/share
-sys$library:decw$xlibshr.exe/share
-sys$library:decw$xmulibshr.exe/share
-sys$library:decw$xmlibshr12/share
-sys$library:decw$xtlibshrr5/share
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/gdi/gdi.dsp b/nx-X11/extras/Mesa/windows/VC6/mesa/gdi/gdi.dsp
deleted file mode 100644
index 03389a66d..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/gdi/gdi.dsp
+++ /dev/null
@@ -1,141 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gdi" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gdi - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gdi.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gdi.mak" CFG="gdi - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gdi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gdi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gdi - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GDI_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../main" /I "../../../../include" /I "../../../../src/mesa" /I "../../../../src/mesa/main" /I "../../../../src/mesa/glapi" /I "../../../../src/mesa/swrast" /I "../../../../src/mesa/shader" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GDI_EXPORTS" /D "_DLL" /D "BUILD_GL32" /D "MESA_MINWARN" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 mesa.lib winmm.lib msvcrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib /out:"Release/OPENGL32.DLL" /libpath:"../mesa/Release"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Release\OPENGL32.LIB ..\..\..\..\lib copy Release\OPENGL32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Release\OPENGL32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gdi - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GDI_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../../../include" /I "../../../../src/mesa" /I "../../../../src/mesa/main" /I "../../../../src/mesa/glapi" /I "../../../../src/mesa/swrast" /I "../../../../src/mesa/shader" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GDI_EXPORTS" /D "_DLL" /D "BUILD_GL32" /D "MESA_MINWARN" /FR /FD /GZ /c
-# SUBTRACT CPP /YX /Yc /Yu
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 mesa.lib winmm.lib msvcrtd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib /out:"Debug/OPENGL32.DLL" /pdbtype:sept /libpath:"../mesa/Debug"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Debug\OPENGL32.LIB ..\..\..\..\lib copy Debug\OPENGL32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Debug\OPENGL32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gdi - Win32 Release"
-# Name "gdi - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\common\driverfuncs.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\windows\gdi\mesa.def
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\windows\gdi\wgl.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\windows\gdi\wmesa.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\windows\gdi\colors.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\common\driverfuncs.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\windows\gdi\wmesadef.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileDebug.txt b/nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileDebug.txt
deleted file mode 100644
index d14930224..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileDebug.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-/nologo /W2 /GX- /Zi /Od /c /TP
-/I "../../../../include"
-/I "../../../../src/glu/sgi/include"
-/I "../../../../src/glu/sgi/libnurbs/interface"
-/I "../../../../src/glu/sgi/libnurbs/internals"
-/I "../../../../src/glu/sgi/libnurbs/nurbtess"
-/D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS"
-/D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /D "LIBRARYBUILD"
-/Fo"Debug/" /Fd"Debug/" /GZ
-../../../../src/glu/sgi/libnurbs/interface/bezierEval.cc
-../../../../src/glu/sgi/libnurbs/interface/bezierPatch.cc
-../../../../src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc
-../../../../src/glu/sgi/libnurbs/interface/glcurveval.cc
-../../../../src/glu/sgi/libnurbs/interface/glinterface.cc
-../../../../src/glu/sgi/libnurbs/interface/glrenderer.cc
-../../../../src/glu/sgi/libnurbs/interface/glsurfeval.cc
-../../../../src/glu/sgi/libnurbs/interface/incurveeval.cc
-../../../../src/glu/sgi/libnurbs/interface/insurfeval.cc
-../../../../src/glu/sgi/libnurbs/internals/arc.cc
-../../../../src/glu/sgi/libnurbs/internals/arcsorter.cc
-../../../../src/glu/sgi/libnurbs/internals/arctess.cc
-../../../../src/glu/sgi/libnurbs/internals/backend.cc
-../../../../src/glu/sgi/libnurbs/internals/basiccrveval.cc
-../../../../src/glu/sgi/libnurbs/internals/basicsurfeval.cc
-../../../../src/glu/sgi/libnurbs/internals/bin.cc
-../../../../src/glu/sgi/libnurbs/internals/bufpool.cc
-../../../../src/glu/sgi/libnurbs/internals/cachingeval.cc
-../../../../src/glu/sgi/libnurbs/internals/ccw.cc
-../../../../src/glu/sgi/libnurbs/internals/coveandtiler.cc
-../../../../src/glu/sgi/libnurbs/internals/curve.cc
-../../../../src/glu/sgi/libnurbs/internals/curvelist.cc
-../../../../src/glu/sgi/libnurbs/internals/curvesub.cc
-../../../../src/glu/sgi/libnurbs/internals/dataTransform.cc
-../../../../src/glu/sgi/libnurbs/internals/displaylist.cc
-../../../../src/glu/sgi/libnurbs/internals/flist.cc
-../../../../src/glu/sgi/libnurbs/internals/flistsorter.cc
-../../../../src/glu/sgi/libnurbs/internals/hull.cc
-../../../../src/glu/sgi/libnurbs/internals/intersect.cc
-../../../../src/glu/sgi/libnurbs/internals/knotvector.cc
-../../../../src/glu/sgi/libnurbs/internals/mapdesc.cc
-../../../../src/glu/sgi/libnurbs/internals/mapdescv.cc
-../../../../src/glu/sgi/libnurbs/internals/maplist.cc
-../../../../src/glu/sgi/libnurbs/internals/mesher.cc
-../../../../src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc
-../../../../src/glu/sgi/libnurbs/internals/monotonizer.cc
-../../../../src/glu/sgi/libnurbs/internals/mycode.cc
-../../../../src/glu/sgi/libnurbs/internals/nurbsinterfac.cc
-../../../../src/glu/sgi/libnurbs/internals/nurbstess.cc
-../../../../src/glu/sgi/libnurbs/internals/patch.cc
-../../../../src/glu/sgi/libnurbs/internals/patchlist.cc
-../../../../src/glu/sgi/libnurbs/internals/quilt.cc
-../../../../src/glu/sgi/libnurbs/internals/reader.cc
-../../../../src/glu/sgi/libnurbs/internals/renderhints.cc
-../../../../src/glu/sgi/libnurbs/internals/slicer.cc
-../../../../src/glu/sgi/libnurbs/internals/sorter.cc
-../../../../src/glu/sgi/libnurbs/internals/splitarcs.cc
-../../../../src/glu/sgi/libnurbs/internals/subdivider.cc
-../../../../src/glu/sgi/libnurbs/internals/tobezier.cc
-../../../../src/glu/sgi/libnurbs/internals/trimline.cc
-../../../../src/glu/sgi/libnurbs/internals/trimregion.cc
-../../../../src/glu/sgi/libnurbs/internals/trimvertpool.cc
-../../../../src/glu/sgi/libnurbs/internals/uarray.cc
-../../../../src/glu/sgi/libnurbs/internals/varray.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/directedLine.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/gridWrap.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/monoChain.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/partitionX.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/partitionY.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/polyDBG.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/polyUtil.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/quicksort.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/rectBlock.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleComp.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampledLine.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/searchTree.cc
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileRelease.txt b/nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileRelease.txt
deleted file mode 100644
index 7f41952bd..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/compileRelease.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-/nologo /W2 /GX- /O2 /c /TP
-/I "../../../../include"
-/I "../../../../src/glu/sgi/include"
-/I "../../../../src/glu/sgi/libnurbs/interface"
-/I "../../../../src/glu/sgi/libnurbs/internals"
-/I "../../../../src/glu/sgi/libnurbs/nurbtess"
-/D "WIN32" /D "_WINDOWS" /D "_MBCS"
-/D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /D "LIBRARYBUILD"
-/Fo"Release/"
-../../../../src/glu/sgi/libnurbs/interface/bezierEval.cc
-../../../../src/glu/sgi/libnurbs/interface/bezierPatch.cc
-../../../../src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc
-../../../../src/glu/sgi/libnurbs/interface/glcurveval.cc
-../../../../src/glu/sgi/libnurbs/interface/glinterface.cc
-../../../../src/glu/sgi/libnurbs/interface/glrenderer.cc
-../../../../src/glu/sgi/libnurbs/interface/glsurfeval.cc
-../../../../src/glu/sgi/libnurbs/interface/incurveeval.cc
-../../../../src/glu/sgi/libnurbs/interface/insurfeval.cc
-../../../../src/glu/sgi/libnurbs/internals/arc.cc
-../../../../src/glu/sgi/libnurbs/internals/arcsorter.cc
-../../../../src/glu/sgi/libnurbs/internals/arctess.cc
-../../../../src/glu/sgi/libnurbs/internals/backend.cc
-../../../../src/glu/sgi/libnurbs/internals/basiccrveval.cc
-../../../../src/glu/sgi/libnurbs/internals/basicsurfeval.cc
-../../../../src/glu/sgi/libnurbs/internals/bin.cc
-../../../../src/glu/sgi/libnurbs/internals/bufpool.cc
-../../../../src/glu/sgi/libnurbs/internals/cachingeval.cc
-../../../../src/glu/sgi/libnurbs/internals/ccw.cc
-../../../../src/glu/sgi/libnurbs/internals/coveandtiler.cc
-../../../../src/glu/sgi/libnurbs/internals/curve.cc
-../../../../src/glu/sgi/libnurbs/internals/curvelist.cc
-../../../../src/glu/sgi/libnurbs/internals/curvesub.cc
-../../../../src/glu/sgi/libnurbs/internals/dataTransform.cc
-../../../../src/glu/sgi/libnurbs/internals/displaylist.cc
-../../../../src/glu/sgi/libnurbs/internals/flist.cc
-../../../../src/glu/sgi/libnurbs/internals/flistsorter.cc
-../../../../src/glu/sgi/libnurbs/internals/hull.cc
-../../../../src/glu/sgi/libnurbs/internals/intersect.cc
-../../../../src/glu/sgi/libnurbs/internals/knotvector.cc
-../../../../src/glu/sgi/libnurbs/internals/mapdesc.cc
-../../../../src/glu/sgi/libnurbs/internals/mapdescv.cc
-../../../../src/glu/sgi/libnurbs/internals/maplist.cc
-../../../../src/glu/sgi/libnurbs/internals/mesher.cc
-../../../../src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc
-../../../../src/glu/sgi/libnurbs/internals/monotonizer.cc
-../../../../src/glu/sgi/libnurbs/internals/mycode.cc
-../../../../src/glu/sgi/libnurbs/internals/nurbsinterfac.cc
-../../../../src/glu/sgi/libnurbs/internals/nurbstess.cc
-../../../../src/glu/sgi/libnurbs/internals/patch.cc
-../../../../src/glu/sgi/libnurbs/internals/patchlist.cc
-../../../../src/glu/sgi/libnurbs/internals/quilt.cc
-../../../../src/glu/sgi/libnurbs/internals/reader.cc
-../../../../src/glu/sgi/libnurbs/internals/renderhints.cc
-../../../../src/glu/sgi/libnurbs/internals/slicer.cc
-../../../../src/glu/sgi/libnurbs/internals/sorter.cc
-../../../../src/glu/sgi/libnurbs/internals/splitarcs.cc
-../../../../src/glu/sgi/libnurbs/internals/subdivider.cc
-../../../../src/glu/sgi/libnurbs/internals/tobezier.cc
-../../../../src/glu/sgi/libnurbs/internals/trimline.cc
-../../../../src/glu/sgi/libnurbs/internals/trimregion.cc
-../../../../src/glu/sgi/libnurbs/internals/trimvertpool.cc
-../../../../src/glu/sgi/libnurbs/internals/uarray.cc
-../../../../src/glu/sgi/libnurbs/internals/varray.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/directedLine.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/gridWrap.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/monoChain.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/partitionX.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/partitionY.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/polyDBG.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/polyUtil.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/quicksort.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/rectBlock.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleComp.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/sampledLine.cc
-../../../../src/glu/sgi/libnurbs/nurbtess/searchTree.cc
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/glu.dsp b/nx-X11/extras/Mesa/windows/VC6/mesa/glu/glu.dsp
deleted file mode 100644
index da035e998..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/glu.dsp
+++ /dev/null
@@ -1,985 +0,0 @@
-# Microsoft Developer Studio Project File - Name="glu" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=glu - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glu.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glu.mak" CFG="glu - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glu - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "glu - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glu - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../../include" /I "../../../../src/glu/sgi/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 msvcrt.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib Release/glucc.lib /nologo /dll /machine:I386 /nodefaultlib /out:"Release/GLU32.DLL" /libpath:"../gdi/Release"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PreLink_Desc=C++ Compilations
-PreLink_Cmds=cl @compileRelease.txt LIB /OUT:Release/GLUCC.LIB @objectsRelease.txt
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Release\GLU32.LIB ..\..\..\..\lib copy Release\GLU32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Release\GLU32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glu - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../../../include" /I "../../../../src/glu/sgi/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 msvcrtd.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib Debug/glucc.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib /out:"Debug/GLU32.DLL" /pdbtype:sept /libpath:"../gdi/Debug"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PreLink_Desc=C++ Compilations
-PreLink_Cmds=cl @compileDebug.txt LIB /OUT:Debug/GLUCC.LIB @objectsDebug.txt
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Debug\GLU32.LIB ..\..\..\..\lib copy Debug\GLU32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Debug\GLU32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glu - Win32 Release"
-# Name "glu - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\dict.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\error.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\geom.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\glu.def
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\glue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\memalloc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\mesh.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\mipmap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\normal.c
-# End Source File
-# Begin Source File
-
-SOURCE="..\..\..\..\src\glu\sgi\libtess\priorityq-heap.c"
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\priorityq.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\project.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\quad.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\registry.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\render.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\sweep.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\tess.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\tessmono.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\arc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\arcsorter.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\arctess.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\backend.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\basiccrveval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\basicsurfeval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\bezierarc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\bezierEval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatch.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatchMesh.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\bin.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\bufpool.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\cachingeval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\coveandtiler.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\curve.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\curvelist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\dataTransform.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\defines.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\definitions.h
-# End Source File
-# Begin Source File
-
-SOURCE="..\..\..\..\src\glu\sgi\libtess\dict-list.h"
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\dict.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\directedLine.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\displaylist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\displaymode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\flist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\flistsorter.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\geom.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glcurveval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glimports.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\glimports.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glrenderer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glsurfeval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libutil\gluint.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\include\gluos.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\gridline.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\gridtrimvertex.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\gridvertex.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\gridWrap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\hull.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\jarcloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\knotvector.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mapdesc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\maplist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\memalloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\mesh.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mesher.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoChain.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoPolyPart.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\monotonizer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoTriangulation.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\myassert.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mymath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mysetjmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\mystdio.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\mystdio.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\mystdlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\mystdlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mystring.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\normal.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\nurbsconsts.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\nurbstess.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionX.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionY.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\patch.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\patchlist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyDBG.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyUtil.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\primitiveStream.h
-# End Source File
-# Begin Source File
-
-SOURCE="..\..\..\..\src\glu\sgi\libtess\priorityq-heap.h"
-# End Source File
-# Begin Source File
-
-SOURCE="..\..\..\..\src\glu\sgi\libtess\priorityq-sort.h"
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\priorityq.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\pwlarc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\quicksort.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\quilt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\reader.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\rectBlock.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\render.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\renderhints.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleComp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompBot.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompRight.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompTop.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampledLine.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleMonoPoly.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\searchTree.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\simplemath.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\slicer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\sorter.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\subdivider.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\sweep.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\tess.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\tessmono.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimline.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimregion.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimvertex.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimvertpool.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\types.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\uarray.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\varray.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\zlassert.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "C++ files"
-
-# PROP Default_Filter ".cc"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\arc.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\arcsorter.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\arctess.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\backend.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\basiccrveval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\basicsurfeval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\bezierEval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatch.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatchMesh.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\bin.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\bufpool.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\cachingeval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\ccw.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\coveandtiler.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\curve.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\curvelist.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\curvesub.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\dataTransform.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\directedLine.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\displaylist.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\flist.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\flistsorter.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glcurveval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glinterface.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glrenderer.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\glsurfeval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\gridWrap.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\hull.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\incurveeval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\interface\insurfeval.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\intersect.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\knotvector.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mapdesc.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mapdescv.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\maplist.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mesher.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoChain.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoPolyPart.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\monotonizer.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoTriangulation.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\monoTriangulationBackend.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\mycode.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\nurbsinterfac.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\nurbstess.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionX.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionY.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\patch.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\patchlist.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyDBG.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyUtil.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\primitiveStream.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\quicksort.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\quilt.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\reader.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libtess\README
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\rectBlock.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\renderhints.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleComp.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompBot.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompRight.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompTop.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampledLine.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleMonoPoly.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\nurbtess\searchTree.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\slicer.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\sorter.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\splitarcs.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\subdivider.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\tobezier.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimline.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimregion.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\trimvertpool.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\uarray.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glu\sgi\libnurbs\internals\varray.cc
-# PROP Exclude_From_Build 1
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE="..\..\..\..\src\glu\sgi\libtess\alg-outline"
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=.\compileDebug.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\compileRelease.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\objectsDebug.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\objectsRelease.txt
-# End Source File
-# End Target
-# End Project
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsDebug.txt b/nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsDebug.txt
deleted file mode 100644
index 9fdce157c..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsDebug.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-Debug/bezierEval.obj
-Debug/bezierPatch.obj
-Debug/bezierPatchMesh.obj
-Debug/glcurveval.obj
-Debug/glinterface.obj
-Debug/glrenderer.obj
-Debug/glsurfeval.obj
-Debug/incurveeval.obj
-Debug/insurfeval.obj
-Debug/arc.obj
-Debug/arcsorter.obj
-Debug/arctess.obj
-Debug/backend.obj
-Debug/basiccrveval.obj
-Debug/basicsurfeval.obj
-Debug/bin.obj
-Debug/bufpool.obj
-Debug/cachingeval.obj
-Debug/ccw.obj
-Debug/coveandtiler.obj
-Debug/curve.obj
-Debug/curvelist.obj
-Debug/curvesub.obj
-Debug/dataTransform.obj
-Debug/displaylist.obj
-Debug/flist.obj
-Debug/flistsorter.obj
-Debug/hull.obj
-Debug/intersect.obj
-Debug/knotvector.obj
-Debug/mapdesc.obj
-Debug/mapdescv.obj
-Debug/maplist.obj
-Debug/mesher.obj
-Debug/monoTriangulationBackend.obj
-Debug/monotonizer.obj
-Debug/mycode.obj
-Debug/nurbsinterfac.obj
-Debug/nurbstess.obj
-Debug/patch.obj
-Debug/patchlist.obj
-Debug/quilt.obj
-Debug/reader.obj
-Debug/renderhints.obj
-Debug/slicer.obj
-Debug/sorter.obj
-Debug/splitarcs.obj
-Debug/subdivider.obj
-Debug/tobezier.obj
-Debug/trimline.obj
-Debug/trimregion.obj
-Debug/trimvertpool.obj
-Debug/uarray.obj
-Debug/varray.obj
-Debug/directedLine.obj
-Debug/gridWrap.obj
-Debug/monoChain.obj
-Debug/monoPolyPart.obj
-Debug/monoTriangulation.obj
-Debug/partitionX.obj
-Debug/partitionY.obj
-Debug/polyDBG.obj
-Debug/polyUtil.obj
-Debug/primitiveStream.obj
-Debug/quicksort.obj
-Debug/rectBlock.obj
-Debug/sampleComp.obj
-Debug/sampleCompBot.obj
-Debug/sampleCompRight.obj
-Debug/sampleCompTop.obj
-Debug/sampleMonoPoly.obj
-Debug/sampledLine.obj
-Debug/searchTree.obj
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsRelease.txt b/nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsRelease.txt
deleted file mode 100644
index 2d1b384db..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/glu/objectsRelease.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-Release/bezierEval.obj
-Release/bezierPatch.obj
-Release/bezierPatchMesh.obj
-Release/glcurveval.obj
-Release/glinterface.obj
-Release/glrenderer.obj
-Release/glsurfeval.obj
-Release/incurveeval.obj
-Release/insurfeval.obj
-Release/arc.obj
-Release/arcsorter.obj
-Release/arctess.obj
-Release/backend.obj
-Release/basiccrveval.obj
-Release/basicsurfeval.obj
-Release/bin.obj
-Release/bufpool.obj
-Release/cachingeval.obj
-Release/ccw.obj
-Release/coveandtiler.obj
-Release/curve.obj
-Release/curvelist.obj
-Release/curvesub.obj
-Release/dataTransform.obj
-Release/displaylist.obj
-Release/flist.obj
-Release/flistsorter.obj
-Release/hull.obj
-Release/intersect.obj
-Release/knotvector.obj
-Release/mapdesc.obj
-Release/mapdescv.obj
-Release/maplist.obj
-Release/mesher.obj
-Release/monoTriangulationBackend.obj
-Release/monotonizer.obj
-Release/mycode.obj
-Release/nurbsinterfac.obj
-Release/nurbstess.obj
-Release/patch.obj
-Release/patchlist.obj
-Release/quilt.obj
-Release/reader.obj
-Release/renderhints.obj
-Release/slicer.obj
-Release/sorter.obj
-Release/splitarcs.obj
-Release/subdivider.obj
-Release/tobezier.obj
-Release/trimline.obj
-Release/trimregion.obj
-Release/trimvertpool.obj
-Release/uarray.obj
-Release/varray.obj
-Release/directedLine.obj
-Release/gridWrap.obj
-Release/monoChain.obj
-Release/monoPolyPart.obj
-Release/monoTriangulation.obj
-Release/partitionX.obj
-Release/partitionY.obj
-Release/polyDBG.obj
-Release/polyUtil.obj
-Release/primitiveStream.obj
-Release/quicksort.obj
-Release/rectBlock.obj
-Release/sampleComp.obj
-Release/sampleCompBot.obj
-Release/sampleCompRight.obj
-Release/sampleCompTop.obj
-Release/sampleMonoPoly.obj
-Release/sampledLine.obj
-Release/searchTree.obj
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/mesa.dsw b/nx-X11/extras/Mesa/windows/VC6/mesa/mesa.dsw
deleted file mode 100644
index a6da850c1..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/mesa.dsw
+++ /dev/null
@@ -1,74 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "gdi"=.\gdi\gdi.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name mesa
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glu"=.\glu\glu.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name gdi
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "mesa"=.\mesa\mesa.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "osmesa"=.\osmesa\osmesa.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name gdi
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/mesa/mesa.dsp b/nx-X11/extras/Mesa/windows/VC6/mesa/mesa/mesa.dsp
deleted file mode 100644
index ecdacef22..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/mesa/mesa.dsp
+++ /dev/null
@@ -1,1350 +0,0 @@
-# Microsoft Developer Studio Project File - Name="mesa" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=mesa - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mesa.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mesa.mak" CFG="mesa - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mesa - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "mesa - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mesa - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../../include" /I "../../../../src/mesa" /I "../../../../src/mesa/glapi" /I "../../../../src/mesa/main" /I "../../../../src/mesa/shader" /I "../../../../src/mesa/shader/slang" /I "../../../../src/mesa/shader/grammar" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_DLL" /D "BUILD_GL32" /D "MESA_MINWARN" /YX /FD /Zm1000 /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "mesa - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../../../include" /I "../../../../src/mesa" /I "../../../../src/mesa/glapi" /I "../../../../src/mesa/main" /I "../../../../src/mesa/shader" /I "../../../../src/mesa/shader/slang" /I "../../../../src/mesa/shader/grammar" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_DLL" /D "BUILD_GL32" /D "MESA_MINWARN" /Fr /FD /GZ /Zm1000 /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "mesa - Win32 Release"
-# Name "mesa - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\array_cache\ac_context.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\array_cache\ac_import.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\accum.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_arrayelt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_loopback.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_noop.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_validate.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbfragparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbprogparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbprogram.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbvertparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\atifragshader.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\attrib.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\blend.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\bufferobj.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\buffers.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\clip.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\colortab.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\context.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\convolve.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\debug.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\depth.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\dispatch.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\dlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\drawpix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\enable.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\enums.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\eval.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\extensions.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\execmem.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\fbobject.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\feedback.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\fog.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\framebuffer.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\get.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\getstring.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glapi.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glthread.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\grammar\grammar.c
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\grammar\grammar_mesa.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\hash.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\hint.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\histogram.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\image.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\imports.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\light.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\lines.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_debug_clip.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_debug_norm.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_debug_xform.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_eval.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_matrix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_translate.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_vector.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_xform.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\matrix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\mm.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvfragparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvprogram.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvvertexec.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvvertparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\occlude.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\pixel.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\points.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\polygon.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\program.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\rastpos.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\renderbuffer.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_aaline.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_aatriangle.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_accum.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_alpha.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_atifragshader.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_bitmap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_blend.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_buffers.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_context.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_copypix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_depth.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_drawpix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_feedback.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_fog.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_imaging.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_lines.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_logic.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_masking.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_nvfragprog.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_pixeltex.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_points.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_readpix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_span.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_stencil.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_texstore.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_texture.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_triangle.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_zoom.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\shaderobjects.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\shaderobjects_3dlabs.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_assignment.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_conditional.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_constructor.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_typeinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_compile.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_execute.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_preprocess.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_storage.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_utility.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\ss_context.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\ss_triangle.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\state.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\stencil.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_array_api.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_array_import.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_context.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_pipeline.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_save_api.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_save_loopback.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_save_playback.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_arbprogram.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_cull.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_fog.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_light.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_normals.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_points.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_program.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_render.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_texgen.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_texmat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_vertex.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vertex.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vertex_generic.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vp_build.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vtx_api.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vtx_eval.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vtx_exec.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vtx_generic.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texcompress.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texcompress_fxt1.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texcompress_s3tc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texenvprogram.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texformat.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\teximage.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texobj.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texrender.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texstate.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texstore.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\varray.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\vsnprintf.c
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\vtxfmt.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\array_cache\ac_context.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\array_cache\acache.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\accum.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_arrayelt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_eval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_loopback.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_noop.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\api_validate.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbfragparse.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbprogparse.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbprogram.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbprogram_syn.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\arbvertparse.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\atifragshader.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\attrib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\blend.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\bufferobj.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\buffers.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\clip.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\colormac.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\colortab.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\config.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\context.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\convolve.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\dd.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\debug.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\depth.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\dlist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\drawpix.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\enable.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\enums.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\eval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\extensions.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\fbobject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\feedback.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\fog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\framebuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\get.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glapi.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glapioffsets.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glapitable.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glapitemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\glheader.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glprocs.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\glapi\glthread.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\grammar\grammar.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\grammar\grammar_mesa.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\grammar\grammar_syn.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\hash.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\hint.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\histogram.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\image.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\imports.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\light.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\lines.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_clip_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_copy_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_debug.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_debug_util.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_dotprod_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_eval.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_matrix.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_norm_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_trans_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_translate.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_vector.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_xform.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\m_xform_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\macros.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\math\mathmod.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\matrix.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\mm.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\mtypes.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvfragparse.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvfragprog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvprogram.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvvertexec.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvvertparse.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\nvvertprog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\occlude.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\pixel.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\points.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\polygon.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\program.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\rastpos.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\renderbuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_aaline.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_aalinetemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_aatriangle.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_aatritemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_accum.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_alpha.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_atifragshader.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_blend.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_context.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_depth.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_drawpix.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_feedback.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_fog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_lines.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_linetemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_logic.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_masking.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_nvfragprog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_pixeltex.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_points.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_pointtemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_span.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_spantemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_stencil.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_texture.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_triangle.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_trispan.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_tritemp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\s_zoom.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\shaderobjects.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\shaderobjects_3dlabs.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\simple_list.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_assignment.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_conditional.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_constructor.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble_typeinfo.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_compile.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_execute.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_mesa.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_preprocess.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_storage.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\slang_utility.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\ss_context.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\ss_triangle.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\ss_tritmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\ss_vb.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\state.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\stencil.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast\swrast.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\swrast_setup\swrast_setup.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_array_api.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_array_import.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_context.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_pipeline.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_save_api.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_arbprogram.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_cliptmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_lighttmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vb_rendertmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vertex.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vp_build.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\t_vtx_api.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texcompress.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texenvprogram.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texformat.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texformat_tmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\teximage.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texobj.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texrender.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texstate.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\texstore.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\tnl\tnl.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\shader\slang\traverse_wrap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\varray.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\version.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\vtxfmt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\main\vtxfmt_tmp.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/nx-X11/extras/Mesa/windows/VC6/mesa/osmesa/osmesa.dsp b/nx-X11/extras/Mesa/windows/VC6/mesa/osmesa/osmesa.dsp
deleted file mode 100644
index 63c7b5503..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/mesa/osmesa/osmesa.dsp
+++ /dev/null
@@ -1,125 +0,0 @@
-# Microsoft Developer Studio Project File - Name="osmesa" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=osmesa - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "osmesa.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "osmesa.mak" CFG="osmesa - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "osmesa - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "osmesa - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "osmesa - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSMESA_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../../include" /I "../../../../src/mesa" /I "../../../../src/mesa/main" /I "../../../../src/mesa/glapi" /I "../../../../src/mesa/swrast" /I "../../../../src/mesa/shader" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSMESA_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 opengl32.lib winmm.lib msvcrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib /out:"Release/OSMESA32.DLL" /libpath:"../gdi/Release"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Release\OSMESA32.LIB ..\..\..\..\lib copy Release\OSMESA32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Release\OSMESA32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "osmesa - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSMESA_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../../../include" /I "../../../../src/mesa" /I "../../../../src/mesa/main" /I "../../../../src/mesa/glapi" /I "../../../../src/mesa/swrast" /I "../../../../src/mesa/shader" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSMESA_EXPORTS" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 opengl32.lib winmm.lib msvcrtd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib /out:"Debug/OSMESA32.DLL" /pdbtype:sept /libpath:"../gdi/Debug"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Debug\OSMESA32.LIB ..\..\..\..\lib copy Debug\OSMESA32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Debug\OSMESA32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "osmesa - Win32 Release"
-# Name "osmesa - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\common\driverfuncs.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\osmesa\osmesa.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\mesa\drivers\osmesa\osmesa.def
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/nx-X11/extras/Mesa/windows/VC6/progs/demos/gears.dsp b/nx-X11/extras/Mesa/windows/VC6/progs/demos/gears.dsp
deleted file mode 100644
index af6b3a879..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/progs/demos/gears.dsp
+++ /dev/null
@@ -1,114 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gears" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gears - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gears.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gears.mak" CFG="gears - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gears - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gears - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gears - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 glut32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../glut/Release"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\gears.exe ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gears - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 glut32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../glut/Debug"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\gears.exe ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gears - Win32 Release"
-# Name "gears - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\..\progs\demos\gears.c
-# ADD CPP /I "../../../../include"
-# SUBTRACT CPP /I "../../../../../include"
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/nx-X11/extras/Mesa/windows/VC6/progs/glut/glut.dsp b/nx-X11/extras/Mesa/windows/VC6/progs/glut/glut.dsp
deleted file mode 100644
index 04fb886c0..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/progs/glut/glut.dsp
+++ /dev/null
@@ -1,333 +0,0 @@
-# Microsoft Developer Studio Project File - Name="glut" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=glut - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glut.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glut.mak" CFG="glut - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glut - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "glut - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glut - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLUT_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_DLL" /D "_USRDLL" /D "GLUT_EXPORTS" /D "MESA" /D "BUILD_GL32" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 opengl32.lib glu32.lib winmm.lib msvcrt.lib oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib /out:"Release/GLUT32.DLL" /libpath:"../../mesa/Release"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Release\GLUT32.LIB ..\..\..\..\lib copy Release\GLUT32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Release\GLUT32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glut - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLUT_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_DLL" /D "_USRDLL" /D "GLUT_EXPORTS" /D "MESA" /D "BUILD_GL32" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 winmm.lib msvcrtd.lib oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib /out:"Debug/GLUT32.DLL" /pdbtype:sept /libpath:"../../mesa/Debug"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=if not exist ..\..\..\..\lib md ..\..\..\..\lib copy Debug\GLUT32.LIB ..\..\..\..\lib copy Debug\GLUT32.DLL ..\..\..\..\lib if exist ..\..\..\..\progs\demos copy Debug\GLUT32.DLL ..\..\..\..\progs\demos
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glut - Win32 Release"
-# Name "glut - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_8x13.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_9x15.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_bitmap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_bwidth.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_cindex.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_cmap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_cursor.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_dials.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_dstr.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_event.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_ext.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_fbc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_fullscrn.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_gamemode.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_get.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_hel10.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_hel12.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_hel18.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_init.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_input.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_joy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_key.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_keyctrl.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_keyup.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_mesa.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_modifier.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_mroman.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_overlay.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_roman.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_shapes.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_space.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_stroke.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_swap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_swidth.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_tablet.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_teapot.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_tr10.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_tr24.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_util.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_vidresize.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_warp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_win.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glut_winmisc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_glx.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_menu.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_util.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_winproc.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_x11.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glutbitmap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glutint.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glutstroke.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\glutwin32.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\stroke.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_glx.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\src\glut\glx\win32_x11.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/nx-X11/extras/Mesa/windows/VC6/progs/progs.dsw b/nx-X11/extras/Mesa/windows/VC6/progs/progs.dsw
deleted file mode 100644
index d220455e6..000000000
--- a/nx-X11/extras/Mesa/windows/VC6/progs/progs.dsw
+++ /dev/null
@@ -1,41 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "gears"=.\demos\gears.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "glut"=.\glut\glut.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/nx-X11/extras/Mesa/windows/VC7/mesa/gdi/gdi.vcproj b/nx-X11/extras/Mesa/windows/VC7/mesa/gdi/gdi.vcproj
deleted file mode 100644
index 82de75dc5..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/mesa/gdi/gdi.vcproj
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="gdi"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/main,../../../../src/mesa/glapi,../../../../src/mesa/swrast,../../../../src/mesa/shader"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;GDI_EXPORTS;_DLL;BUILD_GL32;MESA_MINWARN"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- PrecompiledHeaderFile=".\Debug/gdi.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="mesa.lib winmm.lib msvcrtd.lib odbc32.lib odbccp32.lib"
- OutputFile="Debug/OPENGL32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../mesa/Debug"
- IgnoreAllDefaultLibraries="TRUE"
- ModuleDefinitionFile="..\..\..\..\src\mesa\drivers\windows\gdi\mesa.def"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/OPENGL32.pdb"
- ImportLibrary=".\Debug/OPENGL32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Debug/gdi.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Debug\OPENGL32.LIB ..\..\..\..\lib
-copy Debug\OPENGL32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Debug\OPENGL32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../main,../../../../include,../../../../src/mesa,../../../../src/mesa/main,../../../../src/mesa/glapi,../../../../src/mesa/swrast,../../../../src/mesa/shader"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;GDI_EXPORTS;_DLL;BUILD_GL32;MESA_MINWARN"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/gdi.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="mesa.lib winmm.lib msvcrt.lib odbc32.lib odbccp32.lib"
- OutputFile="Release/OPENGL32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../mesa/Release"
- IgnoreAllDefaultLibraries="TRUE"
- ModuleDefinitionFile="..\..\..\..\src\mesa\drivers\windows\gdi\mesa.def"
- ProgramDatabaseFile=".\Release/OPENGL32.pdb"
- ImportLibrary=".\Release/OPENGL32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Release/gdi.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Release\OPENGL32.LIB ..\..\..\..\lib
-copy Release\OPENGL32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Release\OPENGL32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\common\driverfuncs.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\windows\gdi\mesa.def">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\windows\gdi\wgl.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\windows\gdi\wmesa.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\windows\gdi\colors.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\common\driverfuncs.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\windows\gdi\wmesadef.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/nx-X11/extras/Mesa/windows/VC7/mesa/glu/glu.vcproj b/nx-X11/extras/Mesa/windows/VC7/mesa/glu/glu.vcproj
deleted file mode 100644
index e0c481e01..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/mesa/glu/glu.vcproj
+++ /dev/null
@@ -1,752 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="glu"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../../../include;../../../../src/glu/sgi/include;../../../../src/glu/sgi/libnurbs/interface;../../../../src/glu/sgi/libnurbs/internals;../../../../src/glu/sgi/libnurbs/nurbtess"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GLU_EXPORTS;BUILD_GL32;LIBRARYBUILD"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/glu.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="msvcrt.lib winmm.lib odbc32.lib odbccp32.lib opengl32.lib"
- OutputFile="Release/GLU32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../gdi/Release"
- IgnoreAllDefaultLibraries="TRUE"
- ModuleDefinitionFile="..\..\..\..\src\glu\sgi\glu.def"
- ProgramDatabaseFile=".\Release/GLU32.pdb"
- ImportLibrary=".\Release/GLU32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Release/glu.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Release\GLU32.LIB ..\..\..\..\lib
-copy Release\GLU32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Release\GLU32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../include;../../../../src/glu/sgi/include;../../../../src/glu/sgi/libnurbs/interface;../../../../src/glu/sgi/libnurbs/internals;../../../../src/glu/sgi/libnurbs/nurbtess"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GLU_EXPORTS;BUILD_GL32;LIBRARYBUILD"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- PrecompiledHeaderFile=".\Debug/glu.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="msvcrtd.lib winmm.lib odbc32.lib odbccp32.lib opengl32.lib"
- OutputFile="Debug/GLU32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../gdi/Debug"
- IgnoreAllDefaultLibraries="TRUE"
- ModuleDefinitionFile="..\..\..\..\src\glu\sgi\glu.def"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/GLU32.pdb"
- ImportLibrary=".\Debug/GLU32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Debug/glu.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Debug\GLU32.LIB ..\..\..\..\lib
-copy Debug\GLU32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Debug\GLU32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\dict.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\error.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\geom.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\glu.def">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\glue.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\memalloc.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\mesh.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\mipmap.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\normal.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\priorityq-heap.c">
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\priorityq.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\project.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\quad.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\registry.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\render.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\sweep.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\tess.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\tessmono.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\arc.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\arcsorter.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\arctess.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\backend.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\basiccrveval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\basicsurfeval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\bezierEval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatch.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatchMesh.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\bezierarc.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\bin.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\bufpool.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\cachingeval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\coveandtiler.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\curve.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\curvelist.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\dataTransform.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\defines.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\definitions.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\dict-list.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\dict.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\directedLine.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\displaylist.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\displaymode.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\flist.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\flistsorter.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\geom.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glcurveval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\glimports.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glimports.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glrenderer.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glsurfeval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libutil\gluint.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\include\gluos.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\gridWrap.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\gridline.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\gridtrimvertex.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\gridvertex.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\hull.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\jarcloc.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\knotvector.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mapdesc.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\maplist.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\memalloc.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\mesh.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mesher.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoChain.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoPolyPart.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoTriangulation.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\monotonizer.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\myassert.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mymath.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mysetjmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\mystdio.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\mystdio.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\mystdlib.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\mystdlib.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mystring.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\normal.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\nurbsconsts.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\nurbstess.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionX.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionY.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\patch.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\patchlist.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyDBG.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyUtil.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\primitiveStream.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\priorityq-heap.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\priorityq-sort.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\priorityq.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\pwlarc.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\quicksort.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\quilt.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\reader.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\rectBlock.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\render.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\renderhints.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleComp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompBot.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompRight.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompTop.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleMonoPoly.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampledLine.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\searchTree.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\simplemath.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\slicer.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\sorter.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\subdivider.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\sweep.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\tess.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\tessmono.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimline.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimregion.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimvertex.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimvertpool.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\types.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\uarray.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\varray.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\zlassert.h">
- </File>
- </Filter>
- <Filter
- Name="C++ files"
- Filter=".cc">
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\README">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\arc.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\arcsorter.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\arctess.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\backend.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\basiccrveval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\basicsurfeval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\bezierEval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatch.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\bezierPatchMesh.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\bin.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\bufpool.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\cachingeval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\ccw.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\coveandtiler.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\curve.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\curvelist.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\curvesub.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\dataTransform.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\directedLine.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\displaylist.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\flist.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\flistsorter.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glcurveval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glinterface.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glrenderer.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\glsurfeval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\gridWrap.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\hull.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\incurveeval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\interface\insurfeval.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\intersect.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\knotvector.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mapdesc.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mapdescv.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\maplist.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mesher.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoChain.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoPolyPart.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\monoTriangulation.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\monoTriangulationBackend.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\monotonizer.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\mycode.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\nurbsinterfac.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\nurbstess.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionX.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\partitionY.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\patch.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\patchlist.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyDBG.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\polyUtil.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\primitiveStream.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\quicksort.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\quilt.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\reader.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\rectBlock.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\renderhints.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleComp.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompBot.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompRight.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleCompTop.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampleMonoPoly.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\sampledLine.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\nurbtess\searchTree.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\slicer.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\sorter.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\splitarcs.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\subdivider.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\tobezier.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimline.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimregion.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\trimvertpool.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\uarray.cc">
- </File>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libnurbs\internals\varray.cc">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- <File
- RelativePath="..\..\..\..\src\glu\sgi\libtess\alg-outline">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/nx-X11/extras/Mesa/windows/VC7/mesa/mesa.sln b/nx-X11/extras/Mesa/windows/VC7/mesa/mesa.sln
deleted file mode 100644
index ada5568f4..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/mesa/mesa.sln
+++ /dev/null
@@ -1,41 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdi", "gdi\gdi.vcproj", "{A1B24907-E196-4826-B6AF-26723629B633}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glu", "glu\glu.vcproj", "{2E50FDAF-430B-475B-AE6B-60B68F2875BA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mesa", "mesa\mesa.vcproj", "{2120C974-2717-4709-B44F-D6E6D0A56448}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osmesa", "osmesa\osmesa.vcproj", "{8D6CD423-383B-49E7-81BC-D20C70B07DF5}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- {A1B24907-E196-4826-B6AF-26723629B633}.0 = {2120C974-2717-4709-B44F-D6E6D0A56448}
- {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.0 = {A1B24907-E196-4826-B6AF-26723629B633}
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {A1B24907-E196-4826-B6AF-26723629B633}.Debug.ActiveCfg = Debug|Win32
- {A1B24907-E196-4826-B6AF-26723629B633}.Debug.Build.0 = Debug|Win32
- {A1B24907-E196-4826-B6AF-26723629B633}.Release.ActiveCfg = Release|Win32
- {A1B24907-E196-4826-B6AF-26723629B633}.Release.Build.0 = Release|Win32
- {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Debug.ActiveCfg = Debug|Win32
- {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Debug.Build.0 = Debug|Win32
- {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Release.ActiveCfg = Release|Win32
- {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Release.Build.0 = Release|Win32
- {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug.ActiveCfg = Debug|Win32
- {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug.Build.0 = Debug|Win32
- {2120C974-2717-4709-B44F-D6E6D0A56448}.Release.ActiveCfg = Release|Win32
- {2120C974-2717-4709-B44F-D6E6D0A56448}.Release.Build.0 = Release|Win32
- {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Debug.ActiveCfg = Debug|Win32
- {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Debug.Build.0 = Debug|Win32
- {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release.ActiveCfg = Release|Win32
- {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/nx-X11/extras/Mesa/windows/VC7/mesa/mesa/mesa.vcproj b/nx-X11/extras/Mesa/windows/VC7/mesa/mesa/mesa.vcproj
deleted file mode 100644
index ed124b537..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/mesa/mesa/mesa.vcproj
+++ /dev/null
@@ -1,1084 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="mesa"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Zm1000 "
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB,_DLL,BUILD_GL32,MESA_MINWARN"
- StringPooling="TRUE"
- RuntimeLibrary="4"
- EnableFunctionLevelLinking="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile=".\Release/mesa.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\Release\mesa.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Zm1000 "
- Optimization="0"
- AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB,_DLL,BUILD_GL32,MESA_MINWARN"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- PrecompiledHeaderFile=".\Debug/mesa.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\Debug\mesa.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\..\src\mesa\array_cache\ac_context.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\array_cache\ac_import.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\accum.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_arrayelt.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_loopback.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_noop.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_validate.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbfragparse.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbprogparse.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbprogram.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbvertparse.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\atifragshader.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\attrib.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\blend.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\bufferobj.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\buffers.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\clip.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\colortab.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\context.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\convolve.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\debug.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\depth.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\dispatch.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\dlist.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\drawpix.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\enable.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\enums.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\eval.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\execmem.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\extensions.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\fbobject.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\feedback.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\fog.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\framebuffer.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\get.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\getstring.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glapi.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glthread.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\grammar\grammar.c">
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\grammar\grammar_mesa.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\hash.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\hint.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\histogram.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\image.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\imports.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\light.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\lines.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_debug_clip.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_debug_norm.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_debug_xform.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_eval.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_matrix.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_translate.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_vector.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_xform.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\matrix.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\mm.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvfragparse.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvprogram.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvvertexec.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvvertparse.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\occlude.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\pixel.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\points.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\polygon.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\program.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\rastpos.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\renderbuffer.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_aaline.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_aatriangle.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_accum.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_alpha.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_atifragshader.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_bitmap.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_blend.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_buffers.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_context.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_copypix.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_depth.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_drawpix.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_feedback.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_fog.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_imaging.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_lines.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_logic.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_masking.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_nvfragprog.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_pixeltex.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_points.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_readpix.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_span.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_stencil.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_texstore.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_texture.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_triangle.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_zoom.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\shaderobjects.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\shaderobjects_3dlabs.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_assignment.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_conditional.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_constructor.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_typeinfo.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_execute.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_preprocess.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_storage.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_utility.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_context.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_triangle.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\state.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\stencil.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_array_api.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_array_import.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_context.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_pipeline.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_save_api.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_save_loopback.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_save_playback.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_arbprogram.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_cull.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_fog.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_light.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_normals.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_points.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_program.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_render.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_texgen.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_texmat.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_vertex.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vertex.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vertex_generic.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vp_build.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vtx_api.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vtx_eval.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vtx_exec.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vtx_generic.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texcompress.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texcompress_fxt1.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texcompress_s3tc.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texenvprogram.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texformat.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\teximage.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texobj.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texrender.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texstate.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texstore.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\varray.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\vsnprintf.c">
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\vtxfmt.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\..\..\src\mesa\array_cache\ac_context.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\array_cache\acache.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\accum.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_arrayelt.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_eval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_loopback.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_noop.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\api_validate.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbfragparse.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbprogparse.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbprogram.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbprogram_syn.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\arbvertparse.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\atifragshader.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\attrib.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\blend.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\bufferobj.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\buffers.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\clip.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\colormac.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\colortab.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\config.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\context.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\convolve.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\dd.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\debug.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\depth.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\dlist.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\drawpix.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\enable.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\enums.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\eval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\extensions.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\fbobject.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\feedback.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\fog.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\framebuffer.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\get.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glapi.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glapioffsets.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glapitable.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glapitemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\glheader.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glprocs.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\glapi\glthread.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\grammar\grammar.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\grammar\grammar_mesa.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\grammar\grammar_syn.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\hash.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\hint.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\histogram.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\image.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\imports.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\light.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\lines.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_clip_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_copy_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_debug.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_debug_util.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_dotprod_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_eval.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_matrix.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_norm_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_trans_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_translate.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_vector.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_xform.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\m_xform_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\macros.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\math\mathmod.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\matrix.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\mm.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\mtypes.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvfragparse.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvfragprog.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvprogram.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvvertexec.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvvertparse.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\nvvertprog.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\occlude.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\pixel.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\points.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\polygon.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\program.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\rastpos.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\renderbuffer.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_aaline.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_aalinetemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_aatriangle.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_aatritemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_accum.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_alpha.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_atifragshader.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_blend.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_context.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_depth.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_drawpix.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_feedback.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_fog.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_lines.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_linetemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_logic.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_masking.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_nvfragprog.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_pixeltex.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_points.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_pointtemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_span.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_spantemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_stencil.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_texture.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_triangle.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_trispan.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_tritemp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\s_zoom.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\shaderobjects.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\shaderobjects_3dlabs.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\simple_list.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_assignment.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_conditional.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_constructor.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_assemble_typeinfo.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_execute.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_mesa.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_preprocess.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_storage.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\slang_utility.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_context.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_triangle.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_tritmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_vb.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\state.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\stencil.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast\swrast.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\swrast_setup\swrast_setup.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_array_api.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_array_import.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_context.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_pipeline.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_save_api.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_arbprogram.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_cliptmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_lighttmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vb_rendertmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vertex.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vp_build.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\t_vtx_api.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texcompress.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texenvprogram.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texformat.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texformat_tmp.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\teximage.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texobj.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texrender.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texstate.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\texstore.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\tnl\tnl.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\shader\slang\traverse_wrap.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\varray.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\version.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\vtxfmt.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\main\vtxfmt_tmp.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/nx-X11/extras/Mesa/windows/VC7/mesa/osmesa/osmesa.vcproj b/nx-X11/extras/Mesa/windows/VC7/mesa/osmesa/osmesa.vcproj
deleted file mode 100644
index 266aff509..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/mesa/osmesa/osmesa.vcproj
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="osmesa"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/main,../../../../src/mesa/glapi,../../../../src/mesa/swrast,../../../../src/mesa/shader"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OSMESA_EXPORTS"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/osmesa.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="opengl32.lib winmm.lib msvcrt.lib odbc32.lib odbccp32.lib"
- OutputFile="Release/OSMESA32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../gdi/Release"
- IgnoreAllDefaultLibraries="TRUE"
- ModuleDefinitionFile="..\..\..\..\src\mesa\drivers\osmesa\osmesa.def"
- ProgramDatabaseFile=".\Release/OSMESA32.pdb"
- ImportLibrary=".\Release/OSMESA32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Release/osmesa.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Release\OSMESA32.LIB ..\..\..\..\lib
-copy Release\OSMESA32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Release\OSMESA32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/main,../../../../src/mesa/glapi,../../../../src/mesa/swrast,../../../../src/mesa/shader"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OSMESA_EXPORTS"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- PrecompiledHeaderFile=".\Debug/osmesa.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="opengl32.lib winmm.lib msvcrtd.lib odbc32.lib odbccp32.lib"
- OutputFile="Debug/OSMESA32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../gdi/Debug"
- IgnoreAllDefaultLibraries="TRUE"
- ModuleDefinitionFile="..\..\..\..\src\mesa\drivers\osmesa\osmesa.def"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/OSMESA32.pdb"
- ImportLibrary=".\Debug/OSMESA32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Debug/osmesa.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Debug\OSMESA32.LIB ..\..\..\..\lib
-copy Debug\OSMESA32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Debug\OSMESA32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\common\driverfuncs.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\osmesa\osmesa.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\drivers\osmesa\osmesa.def">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/nx-X11/extras/Mesa/windows/VC7/progs/demos/gears.vcproj b/nx-X11/extras/Mesa/windows/VC7/progs/demos/gears.vcproj
deleted file mode 100644
index 9880b2e08..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/progs/demos/gears.vcproj
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="gears"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../include"
- PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- PrecompiledHeaderFile=".\Debug/gears.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="glut32.lib odbc32.lib odbccp32.lib"
- OutputFile=".\Debug/gears.exe"
- LinkIncremental="2"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../glut/Debug"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/gears.pdb"
- SubSystem="1"/>
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gears.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy Debug\gears.exe ..\..\..\..\progs\demos"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="1"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../../../include"
- PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
- StringPooling="TRUE"
- RuntimeLibrary="4"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/gears.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="glut32.lib odbc32.lib odbccp32.lib"
- OutputFile=".\Release/gears.exe"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../glut/Release"
- ProgramDatabaseFile=".\Release/gears.pdb"
- SubSystem="1"/>
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release/gears.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy Release\gears.exe ..\..\..\..\progs\demos"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\..\progs\demos\gears.c">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/nx-X11/extras/Mesa/windows/VC7/progs/glut/glut.vcproj b/nx-X11/extras/Mesa/windows/VC7/progs/glut/glut.vcproj
deleted file mode 100644
index 2d0dd351c..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/progs/glut/glut.vcproj
+++ /dev/null
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="glut"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../include"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_DLL;_USRDLL;GLUT_EXPORTS;MESA;BUILD_GL32"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- PrecompiledHeaderFile=".\Debug/glut.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="winmm.lib msvcrtd.lib oldnames.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib"
- OutputFile="Debug/GLUT32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../../mesa/Debug"
- IgnoreAllDefaultLibraries="TRUE"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\Debug/GLUT32.pdb"
- ImportLibrary=".\Debug/GLUT32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Debug/glut.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Debug\GLUT32.LIB ..\..\..\..\lib
-copy Debug\GLUT32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Debug\GLUT32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../../../include"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_DLL;_USRDLL;GLUT_EXPORTS;MESA;BUILD_GL32"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- PrecompiledHeaderFile=".\Release/glut.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="opengl32.lib glu32.lib winmm.lib msvcrt.lib oldnames.lib odbc32.lib odbccp32.lib"
- OutputFile="Release/GLUT32.DLL"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="../../mesa/Release"
- IgnoreAllDefaultLibraries="TRUE"
- ProgramDatabaseFile=".\Release/GLUT32.pdb"
- ImportLibrary=".\Release/GLUT32.lib"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\Release/glut.tlb"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if not exist ..\..\..\..\lib md ..\..\..\..\lib
-copy Release\GLUT32.LIB ..\..\..\..\lib
-copy Release\GLUT32.DLL ..\..\..\..\lib
-if exist ..\..\..\..\progs\demos copy Release\GLUT32.DLL ..\..\..\..\progs\demos
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_8x13.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_9x15.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_bitmap.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_bwidth.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_cindex.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_cmap.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_cursor.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_dials.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_dstr.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_event.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_ext.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_fbc.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_fullscrn.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_gamemode.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_get.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_hel10.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_hel12.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_hel18.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_init.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_input.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_joy.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_key.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_keyctrl.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_keyup.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_mesa.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_modifier.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_mroman.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_overlay.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_roman.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_shapes.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_space.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_stroke.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_swap.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_swidth.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_tablet.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_teapot.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_tr10.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_tr24.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_util.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_vidresize.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_warp.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_win.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glut_winmisc.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_glx.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_menu.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_util.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_winproc.c">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_x11.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\..\..\src\glut\glx\glutbitmap.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glutint.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glutstroke.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\glutwin32.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\stroke.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_glx.h">
- </File>
- <File
- RelativePath="..\..\..\..\src\glut\glx\win32_x11.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/nx-X11/extras/Mesa/windows/VC7/progs/progs.sln b/nx-X11/extras/Mesa/windows/VC7/progs/progs.sln
deleted file mode 100644
index d94293e31..000000000
--- a/nx-X11/extras/Mesa/windows/VC7/progs/progs.sln
+++ /dev/null
@@ -1,27 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gears", "demos\gears.vcproj", "{3A7B0671-10F8-45D1-B012-F6D650F817CE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glut", "glut\glut.vcproj", "{0234F0D2-C8A6-4C4D-93E7-0E2248049C67}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Debug.ActiveCfg = Debug|Win32
- {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Debug.Build.0 = Debug|Win32
- {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Release.ActiveCfg = Release|Win32
- {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Release.Build.0 = Release|Win32
- {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Debug.ActiveCfg = Debug|Win32
- {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Debug.Build.0 = Debug|Win32
- {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Release.ActiveCfg = Release|Win32
- {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal